From: Andrea Amorese Date: Mon, 15 Nov 2021 12:46:29 +0000 (+0100) Subject: Built motion from commit ab9cd8aa.|2.5.38 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=9537a0249dcd7d6b7807260887d42401ac9d54e2;p=motion2.git Built motion from commit ab9cd8aa.|2.5.38 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9a0fd31..688d440 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-15T11:11:33.863Z", + "time": "2021-11-15T12:29:34.066Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7dd8914..c1efade 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-15T11:11:33.863Z", + "time": "2021-11-15T12:29:34.066Z", "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 637d8f5..11121a7 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 _0x1696=['contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','VIRTUAL','getDataValue','action','STRING'];(function(_0x45dae3,_0x56e6c4){var _0x507d5f=function(_0xa541d4){while(--_0xa541d4){_0x45dae3['push'](_0x45dae3['shift']());}};_0x507d5f(++_0x56e6c4);}(_0x1696,0x79));var _0x6169=function(_0x72bfb9,_0x141d09){_0x72bfb9=_0x72bfb9-0x0;var _0x16150c=_0x1696[_0x72bfb9];return _0x16150c;};'use strict';var Sequelize=require(_0x6169('0x0'));module['exports']={'name':{'type':Sequelize[_0x6169('0x1')],'get':function(_0x42e140){return this[_0x6169('0x2')](_0x6169('0x3'));}},'action':{'type':Sequelize[_0x6169('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6169('0x5'),_0x6169('0x6'),_0x6169('0x7'),_0x6169('0x8'),'urlForward',_0x6169('0x9'),_0x6169('0xa'),_0x6169('0xb')]],'msg':_0x6169('0xc')}},'comment':_0x6169('0xc')},'data1':{'type':Sequelize[_0x6169('0x4')](0x1000),'comment':_0x6169('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x6169('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6169('0xf')},'data4':{'type':Sequelize[_0x6169('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6169('0x4')](0x1000),'comments':_0x6169('0x10')},'data6':{'type':Sequelize[_0x6169('0x4')],'comments':_0x6169('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xbe0b=['getDataValue','STRING','integration','motionbar','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xbe0b,0x11e));var _0xbbe0=function(_0x50d05d,_0x25d8e0){_0x50d05d=_0x50d05d-0x0;var _0x350c93=_0xbe0b[_0x50d05d];return _0x350c93;};'use strict';var Sequelize=require(_0xbbe0('0x0'));module[_0xbbe0('0x1')]={'name':{'type':Sequelize[_0xbbe0('0x2')],'get':function(_0x4eed7a){return this[_0xbbe0('0x3')]('action');}},'action':{'type':Sequelize[_0xbbe0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbbe0('0x5'),_0xbbe0('0x6'),'jscripty','urlForward',_0xbbe0('0x7'),_0xbbe0('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xbbe0('0x9')},'data1':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xa')},'data2':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xb')},'data3':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xc')},'data4':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comments':_0xbbe0('0xd')},'data5':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comments':_0xbbe0('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0xbbe0('0xf')},'data7':{'type':Sequelize[_0xbbe0('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 ae391b1..d5471ae 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 _0x38d3=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0xf94caf,_0x30f519){var _0x2a4012=function(_0x536bb8){while(--_0x536bb8){_0xf94caf['push'](_0xf94caf['shift']());}};_0x2a4012(++_0x30f519);}(_0x38d3,0x1d8));var _0x338d=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x38d3[_0x1fc122];return _0xa2cb13;};'use strict';var emlformat=require(_0x338d('0x0'));var rimraf=require(_0x338d('0x1'));var zipdir=require(_0x338d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x338d('0x3'));var moment=require('moment');var BPromise=require(_0x338d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x338d('0x5'));var csv=require(_0x338d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x338d('0x7'));var _=require(_0x338d('0x8'));var squel=require(_0x338d('0x9'));var crypto=require(_0x338d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x338d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x338d('0xc'));var Papa=require(_0x338d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x338d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x338d('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x338d('0x10'));var licenseUtil=require(_0x338d('0x11'));var db=require(_0x338d('0x12'))['db'];function respondWithStatusCode(_0x2824bf,_0x54bab3){_0x54bab3=_0x54bab3||0xcc;return function(_0x47a11e){if(_0x47a11e){return _0x2824bf[_0x338d('0x13')](_0x54bab3);}return _0x2824bf[_0x338d('0x14')](_0x54bab3)['end']();};}function respondWithResult(_0x2673b0,_0x524a05){_0x524a05=_0x524a05||0xc8;return function(_0x3b2c13){if(_0x3b2c13){return _0x2673b0['status'](_0x524a05)[_0x338d('0x15')](_0x3b2c13);}};}function respondWithFilteredResult(_0x50401c,_0x47f6e7){return function(_0x38928c){if(_0x38928c){var _0xa8e859=typeof _0x47f6e7[_0x338d('0x16')]===_0x338d('0x17')&&typeof _0x47f6e7['limit']===_0x338d('0x17');var _0x4e6927=_0x38928c[_0x338d('0x18')];var _0x35c3bf=_0xa8e859?0x0:_0x47f6e7[_0x338d('0x16')];var _0x12e931=_0xa8e859?_0x38928c['count']:_0x47f6e7['offset']+_0x47f6e7[_0x338d('0x19')];var _0x39e0da;if(_0x12e931>=_0x4e6927){_0x12e931=_0x4e6927;_0x39e0da=0xc8;}else{_0x39e0da=0xce;}_0x50401c[_0x338d('0x14')](_0x39e0da);return _0x50401c[_0x338d('0x1a')](_0x338d('0x1b'),_0x35c3bf+'-'+_0x12e931+'/'+_0x4e6927)['json'](_0x38928c);}return null;};}function patchUpdates(_0x8b669d){return function(_0x948b56){try{jsonpatch[_0x338d('0x1c')](_0x948b56,_0x8b669d,!![]);}catch(_0x2c84eb){return BPromise[_0x338d('0x1d')](_0x2c84eb);}return _0x948b56[_0x338d('0x1e')]();};}function saveUpdates(_0x35f253,_0x19527a){return function(_0x22f78e){if(_0x22f78e){return _0x22f78e[_0x338d('0x1f')](_0x35f253)[_0x338d('0x20')](function(_0x226d6c){return _0x226d6c;});}return null;};}function removeEntity(_0x4504b0,_0x34ba7b){return function(_0x6b0f50){if(_0x6b0f50){return _0x6b0f50['destroy']()[_0x338d('0x20')](function(){_0x4504b0[_0x338d('0x14')](0xcc)[_0x338d('0x21')]();});}};}function handleEntityNotFound(_0x2b348b,_0x25b387){return function(_0x227b79){if(!_0x227b79){_0x2b348b['sendStatus'](0x194);}return _0x227b79;};}function handleError(_0x14ccee,_0x26123b){_0x26123b=_0x26123b||0x1f4;return function(_0x6c4026){logger[_0x338d('0x22')](_0x6c4026[_0x338d('0x23')]);if(_0x6c4026['name']){delete _0x6c4026[_0x338d('0x24')];}_0x14ccee[_0x338d('0x14')](_0x26123b)[_0x338d('0x25')](_0x6c4026);};}exports[_0x338d('0x1f')]=function(_0x3638fa,_0x15a0ef){if(_0x3638fa[_0x338d('0x26')]['id']){delete _0x3638fa[_0x338d('0x26')]['id'];}return db[_0x338d('0x27')][_0x338d('0x28')]({'where':{'id':_0x3638fa[_0x338d('0x29')]['id']}})[_0x338d('0x20')](handleEntityNotFound(_0x15a0ef,null))[_0x338d('0x20')](saveUpdates(_0x3638fa[_0x338d('0x26')],null))[_0x338d('0x20')](respondWithResult(_0x15a0ef,null))['catch'](handleError(_0x15a0ef,null));};exports[_0x338d('0x2a')]=function(_0xd9832e,_0x527e16){return db[_0x338d('0x27')][_0x338d('0x28')]({'where':{'id':_0xd9832e[_0x338d('0x29')]['id']}})[_0x338d('0x20')](handleEntityNotFound(_0x527e16,null))['then'](removeEntity(_0x527e16,null))[_0x338d('0x2b')](handleError(_0x527e16,null));}; \ No newline at end of file +var _0xd3a7=['params','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','Action','find'];(function(_0x52c6b7,_0x1b31aa){var _0x3c3ac9=function(_0xc06755){while(--_0xc06755){_0x52c6b7['push'](_0x52c6b7['shift']());}};_0x3c3ac9(++_0x1b31aa);}(_0xd3a7,0xcb));var _0x7d3a=function(_0x217ad5,_0x58db5c){_0x217ad5=_0x217ad5-0x0;var _0x805eb9=_0xd3a7[_0x217ad5];return _0x805eb9;};'use strict';var emlformat=require(_0x7d3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d3a('0x1'));var jsonpatch=require(_0x7d3a('0x2'));var rp=require(_0x7d3a('0x3'));var moment=require('moment');var BPromise=require(_0x7d3a('0x4'));var Mustache=require(_0x7d3a('0x5'));var util=require(_0x7d3a('0x6'));var path=require('path');var sox=require(_0x7d3a('0x7'));var csv=require(_0x7d3a('0x8'));var ejs=require(_0x7d3a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d3a('0xb'));var deskjs=require(_0x7d3a('0xc'));var toCsv=require(_0x7d3a('0x8'));var querystring=require('querystring');var Papa=require(_0x7d3a('0xd'));var Redis=require(_0x7d3a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7d3a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d3a('0x10'))(_0x7d3a('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d0ef9,_0x5a2511){_0x5a2511=_0x5a2511||0xcc;return function(_0x9b4f1e){if(_0x9b4f1e){return _0x5d0ef9[_0x7d3a('0x12')](_0x5a2511);}return _0x5d0ef9[_0x7d3a('0x13')](_0x5a2511)['end']();};}function respondWithResult(_0x2b12d0,_0x24363e){_0x24363e=_0x24363e||0xc8;return function(_0x2adb26){if(_0x2adb26){return _0x2b12d0[_0x7d3a('0x13')](_0x24363e)['json'](_0x2adb26);}};}function respondWithFilteredResult(_0x3f7db3,_0xdc823c){return function(_0x4b3ba2){if(_0x4b3ba2){var _0x2e6836=typeof _0xdc823c[_0x7d3a('0x14')]===_0x7d3a('0x15')&&typeof _0xdc823c['limit']==='undefined';var _0x490d01=_0x4b3ba2[_0x7d3a('0x16')];var _0x59cfc7=_0x2e6836?0x0:_0xdc823c[_0x7d3a('0x14')];var _0x407e0c=_0x2e6836?_0x4b3ba2['count']:_0xdc823c[_0x7d3a('0x14')]+_0xdc823c['limit'];var _0x5b0912;if(_0x407e0c>=_0x490d01){_0x407e0c=_0x490d01;_0x5b0912=0xc8;}else{_0x5b0912=0xce;}_0x3f7db3[_0x7d3a('0x13')](_0x5b0912);return _0x3f7db3[_0x7d3a('0x17')]('Content-Range',_0x59cfc7+'-'+_0x407e0c+'/'+_0x490d01)[_0x7d3a('0x18')](_0x4b3ba2);}return null;};}function patchUpdates(_0x20ceb8){return function(_0x49ece7){try{jsonpatch[_0x7d3a('0x19')](_0x49ece7,_0x20ceb8,!![]);}catch(_0xd8ab2c){return BPromise[_0x7d3a('0x1a')](_0xd8ab2c);}return _0x49ece7[_0x7d3a('0x1b')]();};}function saveUpdates(_0x11684c,_0x278007){return function(_0x556a51){if(_0x556a51){return _0x556a51[_0x7d3a('0x1c')](_0x11684c)[_0x7d3a('0x1d')](function(_0x459fa9){return _0x459fa9;});}return null;};}function removeEntity(_0xbbc828,_0x31b117){return function(_0xa2f5f8){if(_0xa2f5f8){return _0xa2f5f8[_0x7d3a('0x1e')]()[_0x7d3a('0x1d')](function(){_0xbbc828['status'](0xcc)[_0x7d3a('0x1f')]();});}};}function handleEntityNotFound(_0xbd4ab5,_0x46b5d2){return function(_0xf12b8c){if(!_0xf12b8c){_0xbd4ab5[_0x7d3a('0x12')](0x194);}return _0xf12b8c;};}function handleError(_0x120326,_0x38bdd1){_0x38bdd1=_0x38bdd1||0x1f4;return function(_0x3233cb){logger[_0x7d3a('0x20')](_0x3233cb[_0x7d3a('0x21')]);if(_0x3233cb['name']){delete _0x3233cb[_0x7d3a('0x22')];}_0x120326[_0x7d3a('0x13')](_0x38bdd1)['send'](_0x3233cb);};}exports[_0x7d3a('0x1c')]=function(_0xbe28b3,_0x61a1cc){if(_0xbe28b3['body']['id']){delete _0xbe28b3['body']['id'];}return db[_0x7d3a('0x23')][_0x7d3a('0x24')]({'where':{'id':_0xbe28b3[_0x7d3a('0x25')]['id']}})[_0x7d3a('0x1d')](handleEntityNotFound(_0x61a1cc,null))[_0x7d3a('0x1d')](saveUpdates(_0xbe28b3[_0x7d3a('0x26')],null))[_0x7d3a('0x1d')](respondWithResult(_0x61a1cc,null))[_0x7d3a('0x27')](handleError(_0x61a1cc,null));};exports[_0x7d3a('0x1e')]=function(_0x4710b1,_0x3641fa){return db[_0x7d3a('0x23')]['find']({'where':{'id':_0x4710b1[_0x7d3a('0x25')]['id']}})[_0x7d3a('0x1d')](handleEntityNotFound(_0x3641fa,null))[_0x7d3a('0x1d')](removeEntity(_0x3641fa,null))['catch'](handleError(_0x3641fa,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 67a37aa..7632e14 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 _0x9b50=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','api'];(function(_0x14f31f,_0x3ed1ec){var _0x9a29a=function(_0x508965){while(--_0x508965){_0x14f31f['push'](_0x14f31f['shift']());}};_0x9a29a(++_0x3ed1ec);}(_0x9b50,0x11b));var _0x09b5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9b50[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x09b5('0x0'));var util=require(_0x09b5('0x1'));var logger=require('../../config/logger')(_0x09b5('0x2'));var moment=require('moment');var BPromise=require(_0x09b5('0x3'));var rp=require(_0x09b5('0x4'));var fs=require('fs');var path=require(_0x09b5('0x5'));var rimraf=require(_0x09b5('0x6'));var config=require(_0x09b5('0x7'));var attributes=require(_0x09b5('0x8'));module[_0x09b5('0x9')]=function(_0x5f8598,_0x5e3c07){return _0x5f8598['define'](_0x09b5('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xced6=['path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','../../config/logger','bluebird','request-promise'];(function(_0x4f0f9b,_0x4e963e){var _0x970f94=function(_0xdde68a){while(--_0xdde68a){_0x4f0f9b['push'](_0x4f0f9b['shift']());}};_0x970f94(++_0x4e963e);}(_0xced6,0x1dd));var _0x6ced=function(_0xea0e0f,_0x222d33){_0xea0e0f=_0xea0e0f-0x0;var _0x2b0623=_0xced6[_0xea0e0f];return _0x2b0623;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ced('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6ced('0x1'));var rp=require(_0x6ced('0x2'));var fs=require('fs');var path=require(_0x6ced('0x3'));var rimraf=require(_0x6ced('0x4'));var config=require(_0x6ced('0x5'));var attributes=require(_0x6ced('0x6'));module[_0x6ced('0x7')]=function(_0x3f027b,_0x204fae){return _0x3f027b['define'](_0x6ced('0x8'),attributes,{'tableName':_0x6ced('0x9'),'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 0c0978a..b1f7bf9 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x53ec,0x192));var _0xc53e=function(_0x40b0b7,_0xf53ae5){_0x40b0b7=_0x40b0b7-0x0;var _0x5dfb0b=_0x53ec[_0x40b0b7];return _0x5dfb0b;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5fab,0x177));var _0xb5fa=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x5fab[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index bc88823..08c69f1 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 _0xe504=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xe504,0x185));var _0x4e50=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe504[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x4e50('0x0'));var util=require(_0x4e50('0x1'));var path=require('path');var timeout=require(_0x4e50('0x2'));var express=require('express');var router=express[_0x4e50('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e50('0x4'));var interaction=require(_0x4e50('0x5'));var config=require(_0x4e50('0x6'));var controller=require(_0x4e50('0x7'));router[_0x4e50('0x8')](_0x4e50('0x9'),auth[_0x4e50('0xa')](),controller[_0x4e50('0xb')]);router[_0x4e50('0xc')](_0x4e50('0x9'),auth[_0x4e50('0xa')](),controller[_0x4e50('0xd')]);module[_0x4e50('0xe')]=router; \ No newline at end of file +var _0x370e=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13de46,_0x36f035){var _0x397f04=function(_0x5790e9){while(--_0x5790e9){_0x13de46['push'](_0x13de46['shift']());}};_0x397f04(++_0x36f035);}(_0x370e,0x171));var _0xe370=function(_0x34c1ba,_0x8f6e6){_0x34c1ba=_0x34c1ba-0x0;var _0x54b8a0=_0x370e[_0x34c1ba];return _0x54b8a0;};'use strict';var multer=require(_0xe370('0x0'));var util=require(_0xe370('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe370('0x2'));var router=express[_0xe370('0x3')]();var fs_extra=require(_0xe370('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe370('0x5'));var config=require(_0xe370('0x6'));var controller=require(_0xe370('0x7'));router[_0xe370('0x8')](_0xe370('0x9'),auth[_0xe370('0xa')](),controller[_0xe370('0xb')]);router[_0xe370('0xc')](_0xe370('0x9'),auth['isAuthenticated'](),controller[_0xe370('0xd')]);module[_0xe370('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7466784..6b9e504 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4b13ce,_0x339cb0){_0x4b13ce=_0x4b13ce-0x0;var _0x427d4b=_0xfdbd[_0x4b13ce];return _0x427d4b;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x386213,_0x308bfc){var _0x4a0cc7=function(_0x491962){while(--_0x491962){_0x386213['push'](_0x386213['shift']());}};_0x4a0cc7(++_0x308bfc);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a179c11..996952f 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 _0x2e32=['orderBy','DESC','joins','parse','type','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','join','COUNT(DISTINCT\x20%s)','AVG(%s)','ROUND(%s)','IS\x20NULL','value','ValidationErrorItem','keyBy','order','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','SELECT','run','runReport','IS\x20EMPTY','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','includeAll','include','findAll','show','rawAttributes','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','group','rules','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','MetricId','metric','function','replace','format','groupBy'];(function(_0x3a4b41,_0x2c8256){var _0x10861b=function(_0x31fa12){while(--_0x31fa12){_0x3a4b41['push'](_0x3a4b41['shift']());}};_0x10861b(++_0x2c8256);}(_0x2e32,0x186));var _0x22e3=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x2e32[_0x172747];return _0x509692;};'use strict';var emlformat=require(_0x22e3('0x0'));var rimraf=require(_0x22e3('0x1'));var zipdir=require(_0x22e3('0x2'));var jsonpatch=require(_0x22e3('0x3'));var rp=require(_0x22e3('0x4'));var moment=require(_0x22e3('0x5'));var BPromise=require(_0x22e3('0x6'));var Mustache=require(_0x22e3('0x7'));var util=require(_0x22e3('0x8'));var path=require(_0x22e3('0x9'));var sox=require(_0x22e3('0xa'));var csv=require(_0x22e3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22e3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x22e3('0xd'));var jsforce=require(_0x22e3('0xe'));var deskjs=require(_0x22e3('0xf'));var toCsv=require(_0x22e3('0xb'));var querystring=require(_0x22e3('0x10'));var Papa=require(_0x22e3('0x11'));var Redis=require(_0x22e3('0x12'));var authService=require(_0x22e3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x22e3('0x14'));var hardwareService=require(_0x22e3('0x15'));var logger=require('../../config/logger')(_0x22e3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x22e3('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x22e3('0x18'))[_0x22e3('0x19')];function respondWithStatusCode(_0x46e312,_0x4ef7fb){_0x4ef7fb=_0x4ef7fb||0xcc;return function(_0x3fe1ee){if(_0x3fe1ee){return _0x46e312[_0x22e3('0x1a')](_0x4ef7fb);}return _0x46e312[_0x22e3('0x1b')](_0x4ef7fb)[_0x22e3('0x1c')]();};}function respondWithResult(_0x16b687,_0x3a657a){_0x3a657a=_0x3a657a||0xc8;return function(_0x22775a){if(_0x22775a){return _0x16b687[_0x22e3('0x1b')](_0x3a657a)[_0x22e3('0x1d')](_0x22775a);}};}function respondWithFilteredResult(_0x5565a6,_0x5d4ce8){return function(_0x2e980c){if(_0x2e980c){var _0x244363=typeof _0x5d4ce8[_0x22e3('0x1e')]===_0x22e3('0x1f')&&typeof _0x5d4ce8[_0x22e3('0x20')]===_0x22e3('0x1f');var _0x25fad0=_0x2e980c[_0x22e3('0x21')];var _0x328199=_0x244363?0x0:_0x5d4ce8[_0x22e3('0x1e')];var _0x11b420=_0x244363?_0x2e980c[_0x22e3('0x21')]:_0x5d4ce8[_0x22e3('0x1e')]+_0x5d4ce8['limit'];var _0x1d562f;if(_0x11b420>=_0x25fad0){_0x11b420=_0x25fad0;_0x1d562f=0xc8;}else{_0x1d562f=0xce;}_0x5565a6[_0x22e3('0x1b')](_0x1d562f);return _0x5565a6[_0x22e3('0x22')](_0x22e3('0x23'),_0x328199+'-'+_0x11b420+'/'+_0x25fad0)[_0x22e3('0x1d')](_0x2e980c);}return null;};}function patchUpdates(_0x47ff12){return function(_0xc44a80){try{jsonpatch[_0x22e3('0x24')](_0xc44a80,_0x47ff12,!![]);}catch(_0x146a4a){return BPromise['reject'](_0x146a4a);}return _0xc44a80[_0x22e3('0x25')]();};}function saveUpdates(_0x181013,_0x3950fe){return function(_0x1b830a){if(_0x1b830a){return _0x1b830a[_0x22e3('0x26')](_0x181013)[_0x22e3('0x27')](function(_0x4aef0c){return _0x4aef0c;});}return null;};}function removeEntity(_0x25e6fa,_0xd96465){return function(_0x90682){if(_0x90682){return _0x90682[_0x22e3('0x28')]()[_0x22e3('0x27')](function(){var _0x44b315=_0x90682[_0x22e3('0x29')]({'plain':!![]});var _0x56402b='CustomReports';return db['UserProfileResource'][_0x22e3('0x28')]({'where':{'type':_0x56402b,'resourceId':_0x44b315['id']}})[_0x22e3('0x27')](function(){return _0x90682;});})[_0x22e3('0x27')](function(){_0x25e6fa[_0x22e3('0x1b')](0xcc)[_0x22e3('0x1c')]();});}};}function handleEntityNotFound(_0x34ba41,_0x4c1d2f){return function(_0x34c607){if(!_0x34c607){_0x34ba41[_0x22e3('0x1a')](0x194);}return _0x34c607;};}function handleError(_0x4aed6d,_0x34d799){_0x34d799=_0x34d799||0x1f4;return function(_0x5c829e){logger['error'](_0x5c829e[_0x22e3('0x2a')]);if(_0x5c829e['name']){delete _0x5c829e[_0x22e3('0x2b')];}_0x4aed6d[_0x22e3('0x1b')](_0x34d799)[_0x22e3('0x2c')](_0x5c829e);};}exports[_0x22e3('0x2d')]=function(_0x4107cc,_0x54128e){var _0x5ddd39={},_0x13c3bb={},_0x2088fa={'count':0x0,'rows':[]};var _0x13e7cd=_[_0x22e3('0x2e')](db[_0x22e3('0x2f')]['rawAttributes'],function(_0x4fd7ac){return{'name':_0x4fd7ac[_0x22e3('0x30')],'type':_0x4fd7ac['type'][_0x22e3('0x31')]};});_0x13c3bb[_0x22e3('0x32')]=_[_0x22e3('0x2e')](_0x13e7cd,_0x22e3('0x2b'));_0x13c3bb[_0x22e3('0x33')]=_[_0x22e3('0x34')](_0x4107cc['query']);_0x13c3bb[_0x22e3('0x35')]=_[_0x22e3('0x36')](_0x13c3bb[_0x22e3('0x32')],_0x13c3bb['query']);_0x5ddd39[_0x22e3('0x37')]=_['intersection'](_0x13c3bb[_0x22e3('0x32')],qs['fields'](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x38')]));_0x5ddd39[_0x22e3('0x37')]=_0x5ddd39[_0x22e3('0x37')]['length']?_0x5ddd39[_0x22e3('0x37')]:_0x13c3bb[_0x22e3('0x32')];if(!_0x4107cc[_0x22e3('0x33')][_0x22e3('0x39')](_0x22e3('0x3a'))){_0x5ddd39[_0x22e3('0x20')]=qs[_0x22e3('0x20')](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x20')]);_0x5ddd39[_0x22e3('0x1e')]=qs[_0x22e3('0x1e')](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x1e')]);}_0x5ddd39['order']=qs['sort'](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3b')]);_0x5ddd39['where']=qs[_0x22e3('0x35')](_['pick'](_0x4107cc[_0x22e3('0x33')],_0x13c3bb['filters']),_0x13e7cd);if(_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3c')]){_0x5ddd39[_0x22e3('0x3d')]=_[_0x22e3('0x3e')](_0x5ddd39[_0x22e3('0x3d')],{'$or':_[_0x22e3('0x2e')](_0x13e7cd,function(_0x294d7c){if(_0x294d7c['type']!=='VIRTUAL'){var _0x95657d={};_0x95657d[_0x294d7c[_0x22e3('0x2b')]]={'$like':'%'+_0x4107cc['query']['filter']+'%'};return _0x95657d;}})});}_0x5ddd39=_[_0x22e3('0x3e')]({},_0x5ddd39,_0x4107cc['options']);var _0x1802b7={'where':_0x5ddd39[_0x22e3('0x3d')]};return db['AnalyticCustomReport'][_0x22e3('0x21')](_0x1802b7)[_0x22e3('0x27')](function(_0x470857){_0x2088fa[_0x22e3('0x21')]=_0x470857;if(_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3f')]){_0x5ddd39[_0x22e3('0x40')]=[{'all':!![]}];}return db[_0x22e3('0x2f')][_0x22e3('0x41')](_0x5ddd39);})[_0x22e3('0x27')](function(_0x508dc2){_0x2088fa['rows']=_0x508dc2;return _0x2088fa;})['then'](respondWithFilteredResult(_0x54128e,_0x5ddd39))['catch'](handleError(_0x54128e,null));};exports[_0x22e3('0x42')]=function(_0x92879,_0x938f77){var _0x2b54ec={'raw':![],'where':{'id':_0x92879['params']['id']}},_0x3971c5={};_0x3971c5['model']=_[_0x22e3('0x34')](db[_0x22e3('0x2f')][_0x22e3('0x43')]);_0x3971c5[_0x22e3('0x33')]=_['keys'](_0x92879[_0x22e3('0x33')]);_0x3971c5[_0x22e3('0x35')]=_[_0x22e3('0x36')](_0x3971c5[_0x22e3('0x32')],_0x3971c5['query']);_0x2b54ec['attributes']=_[_0x22e3('0x36')](_0x3971c5[_0x22e3('0x32')],qs[_0x22e3('0x38')](_0x92879['query']['fields']));_0x2b54ec['attributes']=_0x2b54ec[_0x22e3('0x37')][_0x22e3('0x44')]?_0x2b54ec[_0x22e3('0x37')]:_0x3971c5['model'];if(_0x92879[_0x22e3('0x33')]['includeAll']){_0x2b54ec[_0x22e3('0x40')]=[{'all':!![]}];}_0x2b54ec=_[_0x22e3('0x3e')]({},_0x2b54ec,_0x92879[_0x22e3('0x45')]);return db['AnalyticCustomReport'][_0x22e3('0x46')](_0x2b54ec)[_0x22e3('0x27')](handleEntityNotFound(_0x938f77,null))[_0x22e3('0x27')](respondWithResult(_0x938f77,null))[_0x22e3('0x47')](handleError(_0x938f77,null));};exports[_0x22e3('0x48')]=function(_0x3c9787,_0xff07c2){return db['AnalyticCustomReport']['create'](_0x3c9787[_0x22e3('0x49')],{})[_0x22e3('0x27')](function(_0x5e536b){var _0x42e04f=_0x3c9787['user'][_0x22e3('0x29')]({'plain':!![]});if(!_0x42e04f)throw new Error(_0x22e3('0x4a'));if(_0x42e04f[_0x22e3('0x4b')]===_0x22e3('0x4c')){var _0xfca105=_0x5e536b[_0x22e3('0x29')]({'plain':!![]});var _0x271129='Reports';return db[_0x22e3('0x4d')][_0x22e3('0x46')]({'where':{'name':_0x271129,'userProfileId':_0x42e04f[_0x22e3('0x4e')]},'raw':!![]})[_0x22e3('0x27')](function(_0x301580){if(_0x301580&&_0x301580[_0x22e3('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0xfca105[_0x22e3('0x2b')],'resourceId':_0xfca105['id'],'type':_0x22e3('0x50'),'sectionId':_0x301580['id']},{})[_0x22e3('0x27')](function(){return _0x5e536b;});}else{return _0x5e536b;}})[_0x22e3('0x47')](function(_0x271bfd){logger['error'](_0x22e3('0x51'),_0x271bfd);throw _0x271bfd;});}return _0x5e536b;})[_0x22e3('0x27')](respondWithResult(_0xff07c2,0xc9))['catch'](handleError(_0xff07c2,null));};exports[_0x22e3('0x26')]=function(_0x83822b,_0x44271e){if(_0x83822b[_0x22e3('0x49')]['id']){delete _0x83822b[_0x22e3('0x49')]['id'];}return db[_0x22e3('0x2f')][_0x22e3('0x46')]({'where':{'id':_0x83822b[_0x22e3('0x52')]['id']}})[_0x22e3('0x27')](handleEntityNotFound(_0x44271e,null))[_0x22e3('0x27')](saveUpdates(_0x83822b[_0x22e3('0x49')],null))[_0x22e3('0x27')](respondWithResult(_0x44271e,null))[_0x22e3('0x47')](handleError(_0x44271e,null));};exports[_0x22e3('0x28')]=function(_0x484771,_0xdec59){return db[_0x22e3('0x2f')][_0x22e3('0x46')]({'where':{'id':_0x484771['params']['id']}})[_0x22e3('0x27')](handleEntityNotFound(_0xdec59,null))['then'](removeEntity(_0xdec59,null))['catch'](handleError(_0xdec59,null));};exports[_0x22e3('0x53')]=function(_0x369a30,_0x49f2a1){var _0xb4e394=0xa;var _0x4ab2c6=['join',_0x22e3('0x54'),_0x22e3('0x55'),_0x22e3('0x56')];var _0x4bd0e0={'SUM':_0x22e3('0x57'),'COUNT':_0x22e3('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x22e3('0x59'),'MIN':_0x22e3('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x22e3('0x5b'),'GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0x20e076={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':_0x22e3('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x22e3('0x61')};var _0x9d2e3f=function(_0x14d06b){return!_[_0x22e3('0x62')](['IS\x20NULL',_0x22e3('0x63'),'IS\x20EMPTY',_0x22e3('0x64')],_0x14d06b);};var _0x45016e=function(_0x382cb7){if(!_0x382cb7||!_0x382cb7['rules']['length']){return'';}for(var _0x2b172c='(',_0x3cfe79=0x0;_0x3cfe79<_0x382cb7['rules'][_0x22e3('0x44')];_0x3cfe79+=0x1){_0x3cfe79>0x0&&(_0x2b172c+='\x20'+_0x382cb7[_0x22e3('0x65')]+'\x20');_0x2b172c+=_0x382cb7['rules'][_0x3cfe79][_0x22e3('0x66')]?_0x45016e(_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x66')]):_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x68')]+'\x20'+_0x382cb7[_0x22e3('0x67')][_0x3cfe79]['condition']+(_0x9d2e3f(_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x69')])?'\x20'+_0x382cb7['rules'][_0x3cfe79]['value']:'');}return _0x2b172c+')';};var _0x31e7f4={'where':{'id':_0x369a30['params']['id']}},_0x3b90be,_0xf7855f,_0x500609,_0x4599d0,_0x3a7005;_0x31e7f4=_[_0x22e3('0x3e')]({},_0x31e7f4,_0x369a30[_0x22e3('0x45')]);return db['AnalyticCustomReport'][_0x22e3('0x46')](_0x31e7f4)[_0x22e3('0x27')](function(_0x4b91b7){if(_0x4b91b7){_0x3b90be=_0x4b91b7;return _0x4b91b7[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x6573ac){if(_0x6573ac){if(!_0x6573ac[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))]['ValidationErrorItem'](_0x22e3('0x6c'),0x193);}_0xf7855f=_0x6573ac;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4aba44){if(_0x4aba44){_0x500609=_['keyBy'](_0x4aba44,'id');var _0x32019d;var _0x3a9ec7=squel['select']();_0x3a9ec7[_0x22e3('0x6e')](_0x3b90be['table']);for(var _0x16cc89=0x0;_0x16cc89<_0xf7855f[_0x22e3('0x44')];_0x16cc89+=0x1){_0x32019d=_0xf7855f[_0x16cc89][_0x22e3('0x6f')]?_0x500609[_0xf7855f[_0x16cc89][_0x22e3('0x6f')]][_0x22e3('0x70')]:_0xf7855f[_0x16cc89][_0x22e3('0x68')];_0x32019d=_0xf7855f[_0x16cc89]['function']?_['replace'](_0x4bd0e0[_0xf7855f[_0x16cc89][_0x22e3('0x71')]],'%s',_0x32019d):_0x32019d;_0x32019d=_0xf7855f[_0x16cc89]['format']?_[_0x22e3('0x72')](_0x20e076[_0xf7855f[_0x16cc89][_0x22e3('0x73')]],'%s',_0x32019d):_0x32019d;if(_0xf7855f[_0x16cc89][_0x22e3('0x74')]){_0x3a9ec7[_0x22e3('0x66')](_0x32019d);}_0xf7855f[_0x16cc89][_0x22e3('0x75')]&&_0x3a9ec7['order'](_0x32019d,_0xf7855f[_0x16cc89][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x3a9ec7[_0x22e3('0x68')](_0x32019d,_0xf7855f[_0x16cc89]['alias']||_0x32019d);}if(_0x3b90be['joins']){_0x3b90be[_0x22e3('0x77')]=JSON[_0x22e3('0x78')](_0x3b90be[_0x22e3('0x77')]);for(var _0x533190=0x0;_0x533190<_0x3b90be['joins']['length'];_0x533190+=0x1){if(_0x3b90be['joins'][_0x533190][_0x22e3('0x79')]&&_[_0x22e3('0x62')](_0x4ab2c6,_0x3b90be['joins'][_0x533190][_0x22e3('0x79')])&&_0x3b90be[_0x22e3('0x77')][_0x533190]['parentKey']&&_0x3b90be[_0x22e3('0x77')][_0x533190]['foreignTable']&&_0x3b90be['joins'][_0x533190][_0x22e3('0x7a')]){_0x3a9ec7[_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x79')]](_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7b')],null,util[_0x22e3('0x73')](_0x22e3('0x7c'),_0x3b90be[_0x22e3('0x7d')],_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7e')],_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7b')],_0x3b90be['joins'][_0x533190]['foreignKey']));}}}if(_0x3b90be['conditions']){_0x3b90be[_0x22e3('0x7f')]=JSON[_0x22e3('0x78')](_0x3b90be[_0x22e3('0x7f')]);_0x3a9ec7['where'](_0x45016e(_0x3b90be['conditions'][_0x22e3('0x66')]));}_0x3a7005=_0x3a9ec7[_0x22e3('0x80')]();_0x3a9ec7['limit'](_0xb4e394);_0x3a9ec7[_0x22e3('0x1e')](0x0);logger[_0x22e3('0x81')]('Limited\x20Query:',_0x3a9ec7[_0x22e3('0x82')]());return dbH[_0x22e3('0x83')]['query'](_0x3a9ec7[_0x22e3('0x82')](),{'type':dbH[_0x22e3('0x83')][_0x22e3('0x84')]['SELECT']});}})['then'](respondWithResult(_0x49f2a1,null))[_0x22e3('0x47')](handleError(_0x49f2a1,null));};function runReport(_0x51535a,_0x445cba,_0x3fb25e){var _0x35b83d=_0x445cba[_0x22e3('0x2b')];var _0x32e4fd=0xa;var _0x3ccde9=[_0x22e3('0x85'),_0x22e3('0x54'),_0x22e3('0x55'),_0x22e3('0x56')];var _0x35f42e={'SUM':_0x22e3('0x57'),'COUNT':_0x22e3('0x58'),'COUNT DISTINCT':_0x22e3('0x86'),'MAX':_0x22e3('0x59'),'MIN':_0x22e3('0x5a'),'AVG':_0x22e3('0x87'),'GROUP_CONCAT':_0x22e3('0x5b'),'GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0xf3701f={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x22e3('0x88'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x373172=function(_0x290543){return!_[_0x22e3('0x62')]([_0x22e3('0x89'),_0x22e3('0x63'),'IS\x20EMPTY',_0x22e3('0x64')],_0x290543);};var _0x4f1714=function(_0x52662e){if(!_0x52662e||!_0x52662e[_0x22e3('0x67')]['length']){return'';}for(var _0x3e79f4='(',_0x55e662=0x0;_0x55e662<_0x52662e[_0x22e3('0x67')][_0x22e3('0x44')];_0x55e662+=0x1){_0x55e662>0x0&&(_0x3e79f4+='\x20'+_0x52662e[_0x22e3('0x65')]+'\x20');_0x3e79f4+=_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x66')]?_0x4f1714(_0x52662e[_0x22e3('0x67')][_0x55e662]['group']):_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x68')]+'\x20'+_0x52662e[_0x22e3('0x67')][_0x55e662]['condition']+(_0x373172(_0x52662e[_0x22e3('0x67')][_0x55e662]['condition'])?'\x20'+_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x8a')]:'');}return _0x3e79f4+')';};var _0x45f132={'where':{'id':_0x51535a['id']}},_0x44ee63,_0x2b2cb8,_0x4be8e0,_0x5e01ea,_0x4c475d;_0x45f132=_[_0x22e3('0x3e')]({},_0x45f132,_0x3fb25e);return db[_0x22e3('0x2f')][_0x22e3('0x46')](_0x45f132)[_0x22e3('0x27')](function(_0x4126c8){if(_0x4126c8){_0x44ee63=_0x4126c8;return _0x4126c8[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x1226d8){if(_0x1226d8){if(!_0x1226d8[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))][(_0x22e3('0x8b'))](_0x22e3('0x6c'),0x193);}_0x2b2cb8=_0x1226d8;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x22e3('0x27')](function(_0x31f9bc){if(_0x31f9bc){_0x4be8e0=_[_0x22e3('0x8c')](_0x31f9bc,'id');var _0x20ecd9;var _0x49a71b=squel['select']();_0x49a71b[_0x22e3('0x6e')](_0x44ee63[_0x22e3('0x7d')]);for(var _0x179bb3=0x0;_0x179bb3<_0x2b2cb8[_0x22e3('0x44')];_0x179bb3+=0x1){_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x6f')]?_0x4be8e0[_0x2b2cb8[_0x179bb3]['MetricId']]['metric']:_0x2b2cb8[_0x179bb3][_0x22e3('0x68')];_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x71')]?_[_0x22e3('0x72')](_0x35f42e[_0x2b2cb8[_0x179bb3]['function']],'%s',_0x20ecd9):_0x20ecd9;_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x73')]?_[_0x22e3('0x72')](_0xf3701f[_0x2b2cb8[_0x179bb3]['format']],'%s',_0x20ecd9):_0x20ecd9;if(_0x2b2cb8[_0x179bb3][_0x22e3('0x74')]){_0x49a71b['group'](_0x20ecd9);}_0x2b2cb8[_0x179bb3][_0x22e3('0x75')]&&_0x49a71b[_0x22e3('0x8d')](_0x20ecd9,_0x2b2cb8[_0x179bb3][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x49a71b[_0x22e3('0x68')](_0x20ecd9,_0x2b2cb8[_0x179bb3]['alias']||_0x20ecd9);}if(_0x44ee63[_0x22e3('0x77')]){_0x44ee63['joins']=JSON['parse'](_0x44ee63[_0x22e3('0x77')]);for(var _0x56bf18=0x0;_0x56bf18<_0x44ee63[_0x22e3('0x77')][_0x22e3('0x44')];_0x56bf18+=0x1){if(_0x44ee63['joins'][_0x56bf18]['type']&&_[_0x22e3('0x62')](_0x3ccde9,_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x79')])&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7e')]&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7b')]&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7a')]){_0x49a71b[_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x79')]](_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x44ee63[_0x22e3('0x7d')],_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x7e')],_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x7b')],_0x44ee63['joins'][_0x56bf18]['foreignKey']));}}}if(_0x44ee63[_0x22e3('0x7f')]){_0x44ee63['conditions']=JSON[_0x22e3('0x78')](_0x44ee63[_0x22e3('0x7f')]);_0x49a71b[_0x22e3('0x3d')](_0x4f1714(_0x44ee63[_0x22e3('0x7f')][_0x22e3('0x66')]));}_0x4c475d=_0x49a71b['clone']();_0x49a71b['limit'](_0x32e4fd);_0x49a71b[_0x22e3('0x1e')](0x0);return;}})[_0x22e3('0x27')](function(){if(_0x445cba[_0x22e3('0x8e')]===_0x22e3('0x8f')){return null;}var _0x27d1e8=_[_0x22e3('0x3e')](_0x445cba,{'name':_0x445cba[_0x22e3('0x90')]||_0x445cba[_0x22e3('0x2b')]||_0x44ee63[_0x22e3('0x2b')],'basename':_0x35b83d,'savename':util['format']('%s-%s.%s',_0x445cba[_0x22e3('0x2b')]||_0x44ee63[_0x22e3('0x2b')],require(_0x22e3('0x91'))[_0x22e3('0x92')](0x4),_0x445cba[_0x22e3('0x8e')]||_0x22e3('0x93')),'reportId':_0x44ee63['id'],'reportType':_0x22e3('0x94')});return db[_0x22e3('0x95')][_0x22e3('0x48')](_0x27d1e8,{'raw':!![]});})[_0x22e3('0x27')](function(_0x470375){if(_0x44ee63[_0x22e3('0x7d')]===_0x22e3('0x96')){_0x4c475d[_0x22e3('0x3d')](_0x44ee63[_0x22e3('0x7d')]+_0x22e3('0x97'),_0x445cba[_0x22e3('0x98')],_0x445cba[_0x22e3('0x99')]);}else{_0x4c475d[_0x22e3('0x3d')](_0x44ee63['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x445cba[_0x22e3('0x98')],_0x445cba[_0x22e3('0x99')]);}if(_0x470375){logger[_0x22e3('0x9a')](_0x22e3('0x9b'),_0x4c475d[_0x22e3('0x82')]());require(_0x22e3('0x9c'))[_0x22e3('0x9d')](path[_0x22e3('0x85')](__dirname,_0x22e3('0x9e'),_0x470375[_0x22e3('0x8e')]),[_0x470375['id'],_0x4c475d[_0x22e3('0x82')](),path[_0x22e3('0x85')](__dirname,_0x22e3('0x9f'),_0x470375[_0x22e3('0xa0')]),_0x35b83d]);return _0x470375;}else{var _0x5b0f21=squel[_0x22e3('0xa1')]();_0x5b0f21[_0x22e3('0x6e')]('('+_0x4c475d[_0x22e3('0x82')]()+')',_0x22e3('0xa2'));_0x5b0f21[_0x22e3('0x68')](_0x22e3('0xa3'),_0x22e3('0x21'));_0x4c475d[_0x22e3('0x20')](_0x445cba['limit']||_0x32e4fd);_0x4c475d[_0x22e3('0x1e')](_0x445cba[_0x22e3('0x1e')]||0x0);return dbH[_0x22e3('0x83')][_0x22e3('0x33')](_0x5b0f21[_0x22e3('0x82')](),{'type':dbH[_0x22e3('0x83')][_0x22e3('0x84')][_0x22e3('0xa4')]})[_0x22e3('0x27')](function(_0x4cb668){if(!_0x4cb668[_0x22e3('0x44')]){_0x5e01ea=0x0;}else{_0x5e01ea=_0x4cb668[0x0][_0x22e3('0x21')]||0x0;}return dbH[_0x22e3('0x83')][_0x22e3('0x33')](_0x4c475d[_0x22e3('0x82')](),{'type':dbH['sequelize'][_0x22e3('0x84')][_0x22e3('0xa4')]});})['then'](function(_0x2e00df){return{'rows':_0x2e00df||[],'count':_0x5e01ea};});}});}exports[_0x22e3('0xa5')]=function(_0x5bd506,_0x1d3c84){return runReport(_0x5bd506[_0x22e3('0x52')],_0x5bd506[_0x22e3('0x33')],_0x5bd506[_0x22e3('0x45')])[_0x22e3('0x27')](respondWithResult(_0x1d3c84,null))[_0x22e3('0x47')](handleError(_0x1d3c84,null));};exports[_0x22e3('0xa6')]=runReport;exports[_0x22e3('0x33')]=function(_0x46ca5c,_0x1ded9c){var _0x2cd8eb=0xa;var _0x1d61af=[_0x22e3('0x85'),'left_join',_0x22e3('0x55'),_0x22e3('0x56')];var _0x494bd5={'SUM':'SUM(%s)','COUNT':_0x22e3('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x22e3('0x59'),'MIN':'MIN(%s)','AVG':_0x22e3('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0x528834={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':_0x22e3('0x60'),'ROUND':_0x22e3('0x88'),'UNIX_TIMESTAMP':_0x22e3('0x61')};var _0x200a93=function(_0x3c799c){return!_[_0x22e3('0x62')]([_0x22e3('0x89'),'IS\x20NOT\x20NULL',_0x22e3('0xa7'),_0x22e3('0x64')],_0x3c799c);};var _0x1542d0=function(_0x49f31a){if(!_0x49f31a||!_0x49f31a[_0x22e3('0x67')]['length']){return'';}for(var _0xe40604='(',_0x4119ab=0x0;_0x4119ab<_0x49f31a[_0x22e3('0x67')][_0x22e3('0x44')];_0x4119ab+=0x1){_0x4119ab>0x0&&(_0xe40604+='\x20'+_0x49f31a[_0x22e3('0x65')]+'\x20');_0xe40604+=_0x49f31a['rules'][_0x4119ab][_0x22e3('0x66')]?_0x1542d0(_0x49f31a[_0x22e3('0x67')][_0x4119ab]['group']):_0x49f31a[_0x22e3('0x67')][_0x4119ab]['field']+'\x20'+_0x49f31a[_0x22e3('0x67')][_0x4119ab][_0x22e3('0x69')]+(_0x200a93(_0x49f31a[_0x22e3('0x67')][_0x4119ab]['condition'])?'\x20'+_0x49f31a[_0x22e3('0x67')][_0x4119ab]['value']:'');}return _0xe40604+')';};var _0x38cdb0={'where':{'id':_0x46ca5c[_0x22e3('0x52')]['id']}},_0xb23de1,_0x258351,_0x3b490a,_0x1319fa,_0x6adec8;_0x38cdb0=_[_0x22e3('0x3e')]({},_0x38cdb0,_0x46ca5c[_0x22e3('0x45')]);return db[_0x22e3('0x2f')][_0x22e3('0x46')](_0x38cdb0)[_0x22e3('0x27')](function(_0x37d3cf){if(_0x37d3cf){_0xb23de1=_0x37d3cf;return _0x37d3cf[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x5aa0cb){if(_0x5aa0cb){if(!_0x5aa0cb[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))]['ValidationErrorItem'](_0x22e3('0x6c'),0x193);}_0x258351=_0x5aa0cb;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x22e3('0x27')](function(_0x4922b3){if(_0x4922b3){_0x3b490a=_[_0x22e3('0x8c')](_0x4922b3,'id');var _0x1628dc;var _0x4f2243=squel[_0x22e3('0xa1')]();_0x4f2243[_0x22e3('0x6e')](_0xb23de1['table']);for(var _0x2d3345=0x0;_0x2d3345<_0x258351[_0x22e3('0x44')];_0x2d3345+=0x1){_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x6f')]?_0x3b490a[_0x258351[_0x2d3345]['MetricId']]['metric']:_0x258351[_0x2d3345][_0x22e3('0x68')];_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x71')]?_[_0x22e3('0x72')](_0x494bd5[_0x258351[_0x2d3345]['function']],'%s',_0x1628dc):_0x1628dc;_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x73')]?_[_0x22e3('0x72')](_0x528834[_0x258351[_0x2d3345][_0x22e3('0x73')]],'%s',_0x1628dc):_0x1628dc;if(_0x258351[_0x2d3345][_0x22e3('0x74')]){_0x4f2243[_0x22e3('0x66')](_0x1628dc);}_0x258351[_0x2d3345][_0x22e3('0x75')]&&_0x4f2243[_0x22e3('0x8d')](_0x1628dc,_0x258351[_0x2d3345][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x4f2243[_0x22e3('0x68')](_0x1628dc,_0x258351[_0x2d3345]['alias']||_0x1628dc);}if(_0xb23de1['joins']){_0xb23de1[_0x22e3('0x77')]=JSON[_0x22e3('0x78')](_0xb23de1[_0x22e3('0x77')]);for(var _0x46e1b1=0x0;_0x46e1b1<_0xb23de1['joins'][_0x22e3('0x44')];_0x46e1b1+=0x1){if(_0xb23de1['joins'][_0x46e1b1][_0x22e3('0x79')]&&_[_0x22e3('0x62')](_0x1d61af,_0xb23de1['joins'][_0x46e1b1]['type'])&&_0xb23de1['joins'][_0x46e1b1][_0x22e3('0x7e')]&&_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')]&&_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7a')]){_0x4f2243[_0xb23de1[_0x22e3('0x77')][_0x46e1b1]['type']](_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')],null,util['format'](_0x22e3('0x7c'),_0xb23de1[_0x22e3('0x7d')],_0xb23de1[_0x22e3('0x77')][_0x46e1b1]['parentKey'],_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')],_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7a')]));}}}if(_0xb23de1[_0x22e3('0x7f')]){_0xb23de1['conditions']=JSON['parse'](_0xb23de1[_0x22e3('0x7f')]);_0x4f2243[_0x22e3('0x3d')](_0x1542d0(_0xb23de1[_0x22e3('0x7f')]['group']));}_0x6adec8=_0x4f2243[_0x22e3('0x80')]();_0x4f2243[_0x22e3('0x20')](_0x2cd8eb);_0x4f2243[_0x22e3('0x1e')](0x0);logger['debug'](_0x22e3('0xa8'),_0x4f2243['toString']());return dbH['sequelize']['query'](_0x4f2243[_0x22e3('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x22e3('0xa4')]});}})[_0x22e3('0x27')](function(){return{'sql':_0x6adec8[_0x22e3('0x82')]()};})['then'](respondWithResult(_0x1ded9c,null))[_0x22e3('0x47')](handleError(_0x1ded9c,null));}; \ No newline at end of file +var _0x70f4=['HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','join','cross_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','value','from','parse','parentKey','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','SELECT','runReport','left_join','Please\x20insert\x20at\x20least\x20one\x20field','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)'];(function(_0xeedbc5,_0x2a5fb8){var _0x487a74=function(_0x24462b){while(--_0x24462b){_0xeedbc5['push'](_0xeedbc5['shift']());}};_0x487a74(++_0x2a5fb8);}(_0x70f4,0xf1));var _0x470f=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0x70f4[_0xd6aad];return _0x1109e6;};'use strict';var emlformat=require(_0x470f('0x0'));var rimraf=require(_0x470f('0x1'));var zipdir=require(_0x470f('0x2'));var jsonpatch=require(_0x470f('0x3'));var rp=require(_0x470f('0x4'));var moment=require('moment');var BPromise=require(_0x470f('0x5'));var Mustache=require(_0x470f('0x6'));var util=require(_0x470f('0x7'));var path=require('path');var sox=require(_0x470f('0x8'));var csv=require(_0x470f('0x9'));var ejs=require(_0x470f('0xa'));var fs=require('fs');var fs_extra=require(_0x470f('0xb'));var _=require(_0x470f('0xc'));var squel=require('squel');var crypto=require(_0x470f('0xd'));var jsforce=require(_0x470f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x470f('0x9'));var querystring=require(_0x470f('0xf'));var Papa=require(_0x470f('0x10'));var Redis=require(_0x470f('0x11'));var authService=require(_0x470f('0x12'));var qs=require(_0x470f('0x13'));var as=require(_0x470f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x470f('0x15'))(_0x470f('0x16'));var utils=require(_0x470f('0x17'));var config=require(_0x470f('0x18'));var licenseUtil=require(_0x470f('0x19'));var db=require(_0x470f('0x1a'))['db'];var dbH=require(_0x470f('0x1a'))['dbH'];function respondWithStatusCode(_0x509619,_0x2ab430){_0x2ab430=_0x2ab430||0xcc;return function(_0x58f241){if(_0x58f241){return _0x509619[_0x470f('0x1b')](_0x2ab430);}return _0x509619[_0x470f('0x1c')](_0x2ab430)[_0x470f('0x1d')]();};}function respondWithResult(_0x350b8c,_0x52b839){_0x52b839=_0x52b839||0xc8;return function(_0x585fc3){if(_0x585fc3){return _0x350b8c['status'](_0x52b839)['json'](_0x585fc3);}};}function respondWithFilteredResult(_0x26079d,_0x97e396){return function(_0x30e69f){if(_0x30e69f){var _0x3eea1e=typeof _0x97e396[_0x470f('0x1e')]==='undefined'&&typeof _0x97e396['limit']===_0x470f('0x1f');var _0x468527=_0x30e69f[_0x470f('0x20')];var _0x3bb398=_0x3eea1e?0x0:_0x97e396[_0x470f('0x1e')];var _0x5055a1=_0x3eea1e?_0x30e69f[_0x470f('0x20')]:_0x97e396['offset']+_0x97e396['limit'];var _0x4de533;if(_0x5055a1>=_0x468527){_0x5055a1=_0x468527;_0x4de533=0xc8;}else{_0x4de533=0xce;}_0x26079d[_0x470f('0x1c')](_0x4de533);return _0x26079d['set'](_0x470f('0x21'),_0x3bb398+'-'+_0x5055a1+'/'+_0x468527)[_0x470f('0x22')](_0x30e69f);}return null;};}function patchUpdates(_0x4d96f4){return function(_0x3f2202){try{jsonpatch[_0x470f('0x23')](_0x3f2202,_0x4d96f4,!![]);}catch(_0x4f7004){return BPromise[_0x470f('0x24')](_0x4f7004);}return _0x3f2202[_0x470f('0x25')]();};}function saveUpdates(_0x2ebe02,_0x2f8917){return function(_0x2cda2f){if(_0x2cda2f){return _0x2cda2f[_0x470f('0x26')](_0x2ebe02)[_0x470f('0x27')](function(_0x31edc4){return _0x31edc4;});}return null;};}function removeEntity(_0x15d8eb,_0x5c7844){return function(_0x1986a1){if(_0x1986a1){return _0x1986a1['destroy']()['then'](function(){var _0x2b91a4=_0x1986a1[_0x470f('0x28')]({'plain':!![]});var _0x3b9544=_0x470f('0x29');return db[_0x470f('0x2a')][_0x470f('0x2b')]({'where':{'type':_0x3b9544,'resourceId':_0x2b91a4['id']}})[_0x470f('0x27')](function(){return _0x1986a1;});})['then'](function(){_0x15d8eb[_0x470f('0x1c')](0xcc)[_0x470f('0x1d')]();});}};}function handleEntityNotFound(_0x578b8c,_0x1668f4){return function(_0x24d18b){if(!_0x24d18b){_0x578b8c[_0x470f('0x1b')](0x194);}return _0x24d18b;};}function handleError(_0x423492,_0x30c24b){_0x30c24b=_0x30c24b||0x1f4;return function(_0x3c23ea){logger[_0x470f('0x2c')](_0x3c23ea['stack']);if(_0x3c23ea[_0x470f('0x2d')]){delete _0x3c23ea[_0x470f('0x2d')];}_0x423492['status'](_0x30c24b)[_0x470f('0x2e')](_0x3c23ea);};}exports[_0x470f('0x2f')]=function(_0x337dd2,_0x429b20){var _0x1be2a4={},_0x188422={},_0x276266={'count':0x0,'rows':[]};var _0x4c90c4=_[_0x470f('0x30')](db[_0x470f('0x31')][_0x470f('0x32')],function(_0x3e9821){return{'name':_0x3e9821[_0x470f('0x33')],'type':_0x3e9821[_0x470f('0x34')][_0x470f('0x35')]};});_0x188422[_0x470f('0x36')]=_[_0x470f('0x30')](_0x4c90c4,_0x470f('0x2d'));_0x188422['query']=_[_0x470f('0x37')](_0x337dd2[_0x470f('0x38')]);_0x188422[_0x470f('0x39')]=_[_0x470f('0x3a')](_0x188422[_0x470f('0x36')],_0x188422[_0x470f('0x38')]);_0x1be2a4[_0x470f('0x3b')]=_[_0x470f('0x3a')](_0x188422[_0x470f('0x36')],qs['fields'](_0x337dd2[_0x470f('0x38')][_0x470f('0x3c')]));_0x1be2a4['attributes']=_0x1be2a4['attributes']['length']?_0x1be2a4['attributes']:_0x188422[_0x470f('0x36')];if(!_0x337dd2[_0x470f('0x38')][_0x470f('0x3d')](_0x470f('0x3e'))){_0x1be2a4[_0x470f('0x3f')]=qs[_0x470f('0x3f')](_0x337dd2['query']['limit']);_0x1be2a4[_0x470f('0x1e')]=qs[_0x470f('0x1e')](_0x337dd2['query'][_0x470f('0x1e')]);}_0x1be2a4[_0x470f('0x40')]=qs[_0x470f('0x41')](_0x337dd2[_0x470f('0x38')]['sort']);_0x1be2a4[_0x470f('0x42')]=qs[_0x470f('0x39')](_['pick'](_0x337dd2[_0x470f('0x38')],_0x188422['filters']),_0x4c90c4);if(_0x337dd2[_0x470f('0x38')][_0x470f('0x43')]){_0x1be2a4[_0x470f('0x42')]=_[_0x470f('0x44')](_0x1be2a4[_0x470f('0x42')],{'$or':_[_0x470f('0x30')](_0x4c90c4,function(_0x23a158){if(_0x23a158[_0x470f('0x34')]!==_0x470f('0x45')){var _0x576043={};_0x576043[_0x23a158[_0x470f('0x2d')]]={'$like':'%'+_0x337dd2[_0x470f('0x38')][_0x470f('0x43')]+'%'};return _0x576043;}})});}_0x1be2a4=_[_0x470f('0x44')]({},_0x1be2a4,_0x337dd2[_0x470f('0x46')]);var _0x13c64c={'where':_0x1be2a4[_0x470f('0x42')]};return db[_0x470f('0x31')][_0x470f('0x20')](_0x13c64c)[_0x470f('0x27')](function(_0x35f177){_0x276266[_0x470f('0x20')]=_0x35f177;if(_0x337dd2['query'][_0x470f('0x47')]){_0x1be2a4['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x470f('0x48')](_0x1be2a4);})['then'](function(_0x3674da){_0x276266[_0x470f('0x49')]=_0x3674da;return _0x276266;})['then'](respondWithFilteredResult(_0x429b20,_0x1be2a4))[_0x470f('0x4a')](handleError(_0x429b20,null));};exports['show']=function(_0x4dbead,_0x5cde16){var _0x179423={'raw':![],'where':{'id':_0x4dbead[_0x470f('0x4b')]['id']}},_0x4153e3={};_0x4153e3['model']=_[_0x470f('0x37')](db['AnalyticCustomReport']['rawAttributes']);_0x4153e3[_0x470f('0x38')]=_[_0x470f('0x37')](_0x4dbead[_0x470f('0x38')]);_0x4153e3['filters']=_['intersection'](_0x4153e3[_0x470f('0x36')],_0x4153e3['query']);_0x179423['attributes']=_[_0x470f('0x3a')](_0x4153e3[_0x470f('0x36')],qs[_0x470f('0x3c')](_0x4dbead[_0x470f('0x38')][_0x470f('0x3c')]));_0x179423[_0x470f('0x3b')]=_0x179423['attributes'][_0x470f('0x4c')]?_0x179423['attributes']:_0x4153e3[_0x470f('0x36')];if(_0x4dbead[_0x470f('0x38')][_0x470f('0x47')]){_0x179423[_0x470f('0x4d')]=[{'all':!![]}];}_0x179423=_[_0x470f('0x44')]({},_0x179423,_0x4dbead[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x179423)[_0x470f('0x27')](handleEntityNotFound(_0x5cde16,null))[_0x470f('0x27')](respondWithResult(_0x5cde16,null))[_0x470f('0x4a')](handleError(_0x5cde16,null));};exports['create']=function(_0x465767,_0x33a615){return db[_0x470f('0x31')]['create'](_0x465767['body'],{})[_0x470f('0x27')](function(_0x385667){var _0x4908ac=_0x465767['user'][_0x470f('0x28')]({'plain':!![]});if(!_0x4908ac)throw new Error(_0x470f('0x4f'));if(_0x4908ac[_0x470f('0x50')]==='user'){var _0x3ad4fb=_0x385667[_0x470f('0x28')]({'plain':!![]});var _0xebc3=_0x470f('0x51');return db[_0x470f('0x52')][_0x470f('0x4e')]({'where':{'name':_0xebc3,'userProfileId':_0x4908ac['userProfileId']},'raw':!![]})[_0x470f('0x27')](function(_0x49967a){if(_0x49967a&&_0x49967a[_0x470f('0x53')]===0x0){return db[_0x470f('0x2a')][_0x470f('0x54')]({'name':_0x3ad4fb['name'],'resourceId':_0x3ad4fb['id'],'type':_0x470f('0x29'),'sectionId':_0x49967a['id']},{})['then'](function(){return _0x385667;});}else{return _0x385667;}})['catch'](function(_0x3482ac){logger[_0x470f('0x2c')](_0x470f('0x55'),_0x3482ac);throw _0x3482ac;});}return _0x385667;})[_0x470f('0x27')](respondWithResult(_0x33a615,0xc9))[_0x470f('0x4a')](handleError(_0x33a615,null));};exports['update']=function(_0x54b769,_0x1f70f9){if(_0x54b769[_0x470f('0x56')]['id']){delete _0x54b769[_0x470f('0x56')]['id'];}return db[_0x470f('0x31')][_0x470f('0x4e')]({'where':{'id':_0x54b769[_0x470f('0x4b')]['id']}})[_0x470f('0x27')](handleEntityNotFound(_0x1f70f9,null))[_0x470f('0x27')](saveUpdates(_0x54b769[_0x470f('0x56')],null))['then'](respondWithResult(_0x1f70f9,null))[_0x470f('0x4a')](handleError(_0x1f70f9,null));};exports[_0x470f('0x2b')]=function(_0x2d5814,_0xa80608){return db[_0x470f('0x31')]['find']({'where':{'id':_0x2d5814['params']['id']}})[_0x470f('0x27')](handleEntityNotFound(_0xa80608,null))[_0x470f('0x27')](removeEntity(_0xa80608,null))[_0x470f('0x4a')](handleError(_0xa80608,null));};exports[_0x470f('0x57')]=function(_0x406db3,_0x2d6523){var _0x398277=0xa;var _0x2e30df=['join','left_join',_0x470f('0x58'),'cross_join'];var _0x26d2a5={'SUM':_0x470f('0x59'),'COUNT':_0x470f('0x5a'),'COUNT DISTINCT':_0x470f('0x5b'),'MAX':_0x470f('0x5c'),'MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':_0x470f('0x5f'),'GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x4a0808={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x470f('0x62'),'HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x5a4e25=function(_0x300339){return!_[_0x470f('0x66')](['IS\x20NULL',_0x470f('0x67'),'IS\x20EMPTY',_0x470f('0x68')],_0x300339);};var _0x4b832=function(_0x24c4fa){if(!_0x24c4fa||!_0x24c4fa[_0x470f('0x69')][_0x470f('0x4c')]){return'';}for(var _0x2ac14b='(',_0x497b4a=0x0;_0x497b4a<_0x24c4fa[_0x470f('0x69')][_0x470f('0x4c')];_0x497b4a+=0x1){_0x497b4a>0x0&&(_0x2ac14b+='\x20'+_0x24c4fa[_0x470f('0x6a')]+'\x20');_0x2ac14b+=_0x24c4fa['rules'][_0x497b4a][_0x470f('0x6b')]?_0x4b832(_0x24c4fa[_0x470f('0x69')][_0x497b4a][_0x470f('0x6b')]):_0x24c4fa['rules'][_0x497b4a][_0x470f('0x6c')]+'\x20'+_0x24c4fa[_0x470f('0x69')][_0x497b4a]['condition']+(_0x5a4e25(_0x24c4fa[_0x470f('0x69')][_0x497b4a][_0x470f('0x6d')])?'\x20'+_0x24c4fa[_0x470f('0x69')][_0x497b4a]['value']:'');}return _0x2ac14b+')';};var _0x342b01={'where':{'id':_0x406db3[_0x470f('0x4b')]['id']}},_0x5efa6f,_0x4d26a3,_0x32a1e4,_0x143273,_0x2d3ff3;_0x342b01=_['merge']({},_0x342b01,_0x406db3[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x342b01)[_0x470f('0x27')](function(_0x56ad89){if(_0x56ad89){_0x5efa6f=_0x56ad89;return _0x56ad89[_0x470f('0x6e')]();}return null;})[_0x470f('0x27')](function(_0x4a9282){if(_0x4a9282){if(!_0x4a9282[_0x470f('0x4c')]){throw new db[(_0x470f('0x6f'))][(_0x470f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4d26a3=_0x4a9282;return db[_0x470f('0x71')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d8f74){if(_0x1d8f74){_0x32a1e4=_[_0x470f('0x72')](_0x1d8f74,'id');var _0x4c0b66;var _0x4c3783=squel[_0x470f('0x73')]();_0x4c3783['from'](_0x5efa6f[_0x470f('0x74')]);for(var _0x2c4a0f=0x0;_0x2c4a0f<_0x4d26a3['length'];_0x2c4a0f+=0x1){_0x4c0b66=_0x4d26a3[_0x2c4a0f]['MetricId']?_0x32a1e4[_0x4d26a3[_0x2c4a0f][_0x470f('0x75')]]['metric']:_0x4d26a3[_0x2c4a0f][_0x470f('0x6c')];_0x4c0b66=_0x4d26a3[_0x2c4a0f][_0x470f('0x76')]?_[_0x470f('0x77')](_0x26d2a5[_0x4d26a3[_0x2c4a0f][_0x470f('0x76')]],'%s',_0x4c0b66):_0x4c0b66;_0x4c0b66=_0x4d26a3[_0x2c4a0f][_0x470f('0x78')]?_['replace'](_0x4a0808[_0x4d26a3[_0x2c4a0f][_0x470f('0x78')]],'%s',_0x4c0b66):_0x4c0b66;if(_0x4d26a3[_0x2c4a0f][_0x470f('0x79')]){_0x4c3783[_0x470f('0x6b')](_0x4c0b66);}_0x4d26a3[_0x2c4a0f]['orderBy']&&_0x4c3783[_0x470f('0x40')](_0x4c0b66,_0x4d26a3[_0x2c4a0f][_0x470f('0x7a')]===_0x470f('0x7b')?![]:!![]);_0x4c3783['field'](_0x4c0b66,_0x4d26a3[_0x2c4a0f][_0x470f('0x7c')]||_0x4c0b66);}if(_0x5efa6f[_0x470f('0x7d')]){_0x5efa6f[_0x470f('0x7d')]=JSON['parse'](_0x5efa6f[_0x470f('0x7d')]);for(var _0x2275e7=0x0;_0x2275e7<_0x5efa6f[_0x470f('0x7d')]['length'];_0x2275e7+=0x1){if(_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x34')]&&_['includes'](_0x2e30df,_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x34')])&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['parentKey']&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7e')]&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7f')]){_0x4c3783[_0x5efa6f['joins'][_0x2275e7]['type']](_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['foreignTable'],null,util['format'](_0x470f('0x80'),_0x5efa6f[_0x470f('0x74')],_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['parentKey'],_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7e')],_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7f')]));}}}if(_0x5efa6f[_0x470f('0x81')]){_0x5efa6f['conditions']=JSON['parse'](_0x5efa6f[_0x470f('0x81')]);_0x4c3783['where'](_0x4b832(_0x5efa6f[_0x470f('0x81')][_0x470f('0x6b')]));}_0x2d3ff3=_0x4c3783[_0x470f('0x82')]();_0x4c3783[_0x470f('0x3f')](_0x398277);_0x4c3783['offset'](0x0);logger[_0x470f('0x83')](_0x470f('0x84'),_0x4c3783['toString']());return dbH['sequelize'][_0x470f('0x38')](_0x4c3783[_0x470f('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x2d6523,null))[_0x470f('0x4a')](handleError(_0x2d6523,null));};function runReport(_0x5ac5fa,_0xcd6ad9,_0x43aa0d){var _0x5e6fdb=_0xcd6ad9[_0x470f('0x2d')];var _0x35a339=0xa;var _0x2a8814=[_0x470f('0x86'),'left_join',_0x470f('0x58'),_0x470f('0x87')];var _0x390d59={'SUM':_0x470f('0x59'),'COUNT':_0x470f('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x470f('0x5c'),'MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':_0x470f('0x5f'),'GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x28c43d={'SEC_TO_TIME':_0x470f('0x88'),'DATE':'DATE(%s)','HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x1badbd=function(_0xb2a243){return!_[_0x470f('0x66')]([_0x470f('0x89'),_0x470f('0x67'),_0x470f('0x8a'),_0x470f('0x68')],_0xb2a243);};var _0xea8b99=function(_0x3a9692){if(!_0x3a9692||!_0x3a9692[_0x470f('0x69')]['length']){return'';}for(var _0x4eb2f8='(',_0x13089a=0x0;_0x13089a<_0x3a9692[_0x470f('0x69')][_0x470f('0x4c')];_0x13089a+=0x1){_0x13089a>0x0&&(_0x4eb2f8+='\x20'+_0x3a9692[_0x470f('0x6a')]+'\x20');_0x4eb2f8+=_0x3a9692['rules'][_0x13089a][_0x470f('0x6b')]?_0xea8b99(_0x3a9692['rules'][_0x13089a][_0x470f('0x6b')]):_0x3a9692['rules'][_0x13089a][_0x470f('0x6c')]+'\x20'+_0x3a9692['rules'][_0x13089a][_0x470f('0x6d')]+(_0x1badbd(_0x3a9692[_0x470f('0x69')][_0x13089a][_0x470f('0x6d')])?'\x20'+_0x3a9692[_0x470f('0x69')][_0x13089a][_0x470f('0x8b')]:'');}return _0x4eb2f8+')';};var _0x27f397={'where':{'id':_0x5ac5fa['id']}},_0xde1801,_0xc8837d,_0x288783,_0x3fddb0,_0x1e78f4;_0x27f397=_[_0x470f('0x44')]({},_0x27f397,_0x43aa0d);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x27f397)[_0x470f('0x27')](function(_0x77b214){if(_0x77b214){_0xde1801=_0x77b214;return _0x77b214[_0x470f('0x6e')]();}return null;})['then'](function(_0x31bdeb){if(_0x31bdeb){if(!_0x31bdeb[_0x470f('0x4c')]){throw new db['Sequelize'][(_0x470f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc8837d=_0x31bdeb;return db[_0x470f('0x71')][_0x470f('0x48')]({'raw':!![]});}return null;})[_0x470f('0x27')](function(_0x4d2d65){if(_0x4d2d65){_0x288783=_['keyBy'](_0x4d2d65,'id');var _0x42ad84;var _0x250d7d=squel[_0x470f('0x73')]();_0x250d7d[_0x470f('0x8c')](_0xde1801[_0x470f('0x74')]);for(var _0x26df3b=0x0;_0x26df3b<_0xc8837d[_0x470f('0x4c')];_0x26df3b+=0x1){_0x42ad84=_0xc8837d[_0x26df3b]['MetricId']?_0x288783[_0xc8837d[_0x26df3b][_0x470f('0x75')]]['metric']:_0xc8837d[_0x26df3b][_0x470f('0x6c')];_0x42ad84=_0xc8837d[_0x26df3b][_0x470f('0x76')]?_[_0x470f('0x77')](_0x390d59[_0xc8837d[_0x26df3b][_0x470f('0x76')]],'%s',_0x42ad84):_0x42ad84;_0x42ad84=_0xc8837d[_0x26df3b][_0x470f('0x78')]?_[_0x470f('0x77')](_0x28c43d[_0xc8837d[_0x26df3b][_0x470f('0x78')]],'%s',_0x42ad84):_0x42ad84;if(_0xc8837d[_0x26df3b][_0x470f('0x79')]){_0x250d7d[_0x470f('0x6b')](_0x42ad84);}_0xc8837d[_0x26df3b][_0x470f('0x7a')]&&_0x250d7d[_0x470f('0x40')](_0x42ad84,_0xc8837d[_0x26df3b]['orderBy']===_0x470f('0x7b')?![]:!![]);_0x250d7d[_0x470f('0x6c')](_0x42ad84,_0xc8837d[_0x26df3b][_0x470f('0x7c')]||_0x42ad84);}if(_0xde1801[_0x470f('0x7d')]){_0xde1801[_0x470f('0x7d')]=JSON[_0x470f('0x8d')](_0xde1801['joins']);for(var _0x52377c=0x0;_0x52377c<_0xde1801['joins']['length'];_0x52377c+=0x1){if(_0xde1801['joins'][_0x52377c][_0x470f('0x34')]&&_[_0x470f('0x66')](_0x2a8814,_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x34')])&&_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x8e')]&&_0xde1801['joins'][_0x52377c][_0x470f('0x7e')]&&_0xde1801['joins'][_0x52377c][_0x470f('0x7f')]){_0x250d7d[_0xde1801['joins'][_0x52377c][_0x470f('0x34')]](_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7e')],null,util[_0x470f('0x78')](_0x470f('0x80'),_0xde1801[_0x470f('0x74')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x8e')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7e')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7f')]));}}}if(_0xde1801[_0x470f('0x81')]){_0xde1801[_0x470f('0x81')]=JSON['parse'](_0xde1801[_0x470f('0x81')]);_0x250d7d[_0x470f('0x42')](_0xea8b99(_0xde1801[_0x470f('0x81')]['group']));}_0x1e78f4=_0x250d7d[_0x470f('0x82')]();_0x250d7d['limit'](_0x35a339);_0x250d7d[_0x470f('0x1e')](0x0);return;}})[_0x470f('0x27')](function(){if(_0xcd6ad9[_0x470f('0x8f')]===_0x470f('0x90')){return null;}var _0x494738=_['merge'](_0xcd6ad9,{'name':_0xcd6ad9['fullPath']||_0xcd6ad9[_0x470f('0x2d')]||_0xde1801[_0x470f('0x2d')],'basename':_0x5e6fdb,'savename':util[_0x470f('0x78')]('%s-%s.%s',_0xcd6ad9['name']||_0xde1801[_0x470f('0x2d')],require(_0x470f('0x91'))[_0x470f('0x92')](0x4),_0xcd6ad9[_0x470f('0x8f')]||_0x470f('0x93')),'reportId':_0xde1801['id'],'reportType':_0x470f('0x94')});return db[_0x470f('0x95')][_0x470f('0x54')](_0x494738,{'raw':!![]});})['then'](function(_0x329a5c){if(_0xde1801[_0x470f('0x74')]===_0x470f('0x96')){_0x1e78f4[_0x470f('0x42')](_0xde1801[_0x470f('0x74')]+_0x470f('0x97'),_0xcd6ad9['startDate'],_0xcd6ad9[_0x470f('0x98')]);}else{_0x1e78f4[_0x470f('0x42')](_0xde1801[_0x470f('0x74')]+_0x470f('0x99'),_0xcd6ad9['startDate'],_0xcd6ad9['endDate']);}if(_0x329a5c){logger[_0x470f('0x9a')](_0x470f('0x9b'),_0x1e78f4['toString']());require(_0x470f('0x9c'))[_0x470f('0x9d')](path[_0x470f('0x86')](__dirname,_0x470f('0x9e'),_0x329a5c['output']),[_0x329a5c['id'],_0x1e78f4[_0x470f('0x85')](),path['join'](__dirname,_0x470f('0x9f'),_0x329a5c[_0x470f('0xa0')]),_0x5e6fdb]);return _0x329a5c;}else{var _0x43fa6f=squel['select']();_0x43fa6f[_0x470f('0x8c')]('('+_0x1e78f4['toString']()+')',_0x470f('0xa1'));_0x43fa6f[_0x470f('0x6c')](_0x470f('0xa2'),_0x470f('0x20'));_0x1e78f4['limit'](_0xcd6ad9['limit']||_0x35a339);_0x1e78f4['offset'](_0xcd6ad9[_0x470f('0x1e')]||0x0);return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x43fa6f['toString'](),{'type':dbH['sequelize'][_0x470f('0xa4')][_0x470f('0xa5')]})[_0x470f('0x27')](function(_0x4a3bba){if(!_0x4a3bba['length']){_0x3fddb0=0x0;}else{_0x3fddb0=_0x4a3bba[0x0][_0x470f('0x20')]||0x0;}return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x1e78f4[_0x470f('0x85')](),{'type':dbH['sequelize'][_0x470f('0xa4')][_0x470f('0xa5')]});})[_0x470f('0x27')](function(_0x3d4ffc){return{'rows':_0x3d4ffc||[],'count':_0x3fddb0};});}});}exports['run']=function(_0x154177,_0x2cf264){return runReport(_0x154177[_0x470f('0x4b')],_0x154177[_0x470f('0x38')],_0x154177['options'])[_0x470f('0x27')](respondWithResult(_0x2cf264,null))['catch'](handleError(_0x2cf264,null));};exports[_0x470f('0xa6')]=runReport;exports[_0x470f('0x38')]=function(_0x56b21e,_0x3e980a){var _0x2304ab=0xa;var _0xeb201f=[_0x470f('0x86'),_0x470f('0xa7'),_0x470f('0x58'),_0x470f('0x87')];var _0x10d356={'SUM':'SUM(%s)','COUNT':_0x470f('0x5a'),'COUNT DISTINCT':_0x470f('0x5b'),'MAX':'MAX(%s)','MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x459926={'SEC_TO_TIME':_0x470f('0x88'),'DATE':'DATE(%s)','HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x1cd091=function(_0x359a6a){return!_[_0x470f('0x66')]([_0x470f('0x89'),_0x470f('0x67'),_0x470f('0x8a'),_0x470f('0x68')],_0x359a6a);};var _0x27e421=function(_0x24c4bf){if(!_0x24c4bf||!_0x24c4bf[_0x470f('0x69')][_0x470f('0x4c')]){return'';}for(var _0x5b82c0='(',_0x367827=0x0;_0x367827<_0x24c4bf[_0x470f('0x69')][_0x470f('0x4c')];_0x367827+=0x1){_0x367827>0x0&&(_0x5b82c0+='\x20'+_0x24c4bf[_0x470f('0x6a')]+'\x20');_0x5b82c0+=_0x24c4bf['rules'][_0x367827][_0x470f('0x6b')]?_0x27e421(_0x24c4bf['rules'][_0x367827][_0x470f('0x6b')]):_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6c')]+'\x20'+_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6d')]+(_0x1cd091(_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6d')])?'\x20'+_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x8b')]:'');}return _0x5b82c0+')';};var _0x2bdbcc={'where':{'id':_0x56b21e[_0x470f('0x4b')]['id']}},_0x31a8a3,_0x36e601,_0x252c17,_0x16cb91,_0x2e4732;_0x2bdbcc=_[_0x470f('0x44')]({},_0x2bdbcc,_0x56b21e[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x2bdbcc)[_0x470f('0x27')](function(_0x1486b3){if(_0x1486b3){_0x31a8a3=_0x1486b3;return _0x1486b3['getFields']();}return null;})[_0x470f('0x27')](function(_0x5b06be){if(_0x5b06be){if(!_0x5b06be['length']){throw new db[(_0x470f('0x6f'))]['ValidationErrorItem'](_0x470f('0xa8'),0x193);}_0x36e601=_0x5b06be;return db[_0x470f('0x71')][_0x470f('0x48')]({'raw':!![]});}return null;})[_0x470f('0x27')](function(_0x320bf5){if(_0x320bf5){_0x252c17=_[_0x470f('0x72')](_0x320bf5,'id');var _0x30120f;var _0x2dbf19=squel['select']();_0x2dbf19[_0x470f('0x8c')](_0x31a8a3['table']);for(var _0x2f504b=0x0;_0x2f504b<_0x36e601[_0x470f('0x4c')];_0x2f504b+=0x1){_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x75')]?_0x252c17[_0x36e601[_0x2f504b][_0x470f('0x75')]][_0x470f('0xa9')]:_0x36e601[_0x2f504b][_0x470f('0x6c')];_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x76')]?_[_0x470f('0x77')](_0x10d356[_0x36e601[_0x2f504b][_0x470f('0x76')]],'%s',_0x30120f):_0x30120f;_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x78')]?_['replace'](_0x459926[_0x36e601[_0x2f504b][_0x470f('0x78')]],'%s',_0x30120f):_0x30120f;if(_0x36e601[_0x2f504b][_0x470f('0x79')]){_0x2dbf19[_0x470f('0x6b')](_0x30120f);}_0x36e601[_0x2f504b][_0x470f('0x7a')]&&_0x2dbf19[_0x470f('0x40')](_0x30120f,_0x36e601[_0x2f504b][_0x470f('0x7a')]===_0x470f('0x7b')?![]:!![]);_0x2dbf19['field'](_0x30120f,_0x36e601[_0x2f504b][_0x470f('0x7c')]||_0x30120f);}if(_0x31a8a3['joins']){_0x31a8a3[_0x470f('0x7d')]=JSON[_0x470f('0x8d')](_0x31a8a3[_0x470f('0x7d')]);for(var _0x5c0d2e=0x0;_0x5c0d2e<_0x31a8a3[_0x470f('0x7d')][_0x470f('0x4c')];_0x5c0d2e+=0x1){if(_0x31a8a3['joins'][_0x5c0d2e]['type']&&_[_0x470f('0x66')](_0xeb201f,_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x34')])&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x8e')]&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x7e')]&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['foreignKey']){_0x2dbf19[_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['type']](_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x7e')],null,util[_0x470f('0x78')]('%s.%s\x20=\x20%s.%s',_0x31a8a3[_0x470f('0x74')],_0x31a8a3['joins'][_0x5c0d2e]['parentKey'],_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['foreignTable'],_0x31a8a3['joins'][_0x5c0d2e][_0x470f('0x7f')]));}}}if(_0x31a8a3['conditions']){_0x31a8a3[_0x470f('0x81')]=JSON[_0x470f('0x8d')](_0x31a8a3[_0x470f('0x81')]);_0x2dbf19['where'](_0x27e421(_0x31a8a3[_0x470f('0x81')][_0x470f('0x6b')]));}_0x2e4732=_0x2dbf19[_0x470f('0x82')]();_0x2dbf19[_0x470f('0x3f')](_0x2304ab);_0x2dbf19[_0x470f('0x1e')](0x0);logger[_0x470f('0x83')](_0x470f('0x84'),_0x2dbf19[_0x470f('0x85')]());return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x2dbf19[_0x470f('0x85')](),{'type':dbH[_0x470f('0xa3')][_0x470f('0xa4')][_0x470f('0xa5')]});}})[_0x470f('0x27')](function(){return{'sql':_0x2e4732[_0x470f('0x85')]()};})['then'](respondWithResult(_0x3e980a,null))['catch'](handleError(_0x3e980a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3126936..fa5474c 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 _0xb49c=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x54e4ec,_0x183144){var _0x44ef91=function(_0x34fe75){while(--_0x34fe75){_0x54e4ec['push'](_0x54e4ec['shift']());}};_0x44ef91(++_0x183144);}(_0xb49c,0x104));var _0xcb49=function(_0x5c6ba4,_0x1dfbc6){_0x5c6ba4=_0x5c6ba4-0x0;var _0x4ec318=_0xb49c[_0x5c6ba4];return _0x4ec318;};'use strict';var _=require(_0xcb49('0x0'));var util=require(_0xcb49('0x1'));var logger=require(_0xcb49('0x2'))(_0xcb49('0x3'));var moment=require('moment');var BPromise=require(_0xcb49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb49('0x5'));var rimraf=require(_0xcb49('0x6'));var config=require(_0xcb49('0x7'));var attributes=require(_0xcb49('0x8'));module[_0xcb49('0x9')]=function(_0x441fed,_0x6685c5){return _0x441fed[_0xcb49('0xa')](_0xcb49('0xb'),attributes,{'tableName':_0xcb49('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fc2=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d0dfe,_0x1356af){var _0x1f3f73=function(_0x47f635){while(--_0x47f635){_0x4d0dfe['push'](_0x4d0dfe['shift']());}};_0x1f3f73(++_0x1356af);}(_0x7fc2,0x102));var _0x27fc=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7fc2[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x27fc('0x0'));var util=require(_0x27fc('0x1'));var logger=require(_0x27fc('0x2'))(_0x27fc('0x3'));var moment=require(_0x27fc('0x4'));var BPromise=require(_0x27fc('0x5'));var rp=require(_0x27fc('0x6'));var fs=require('fs');var path=require(_0x27fc('0x7'));var rimraf=require(_0x27fc('0x8'));var config=require(_0x27fc('0x9'));var attributes=require(_0x27fc('0xa'));module[_0x27fc('0xb')]=function(_0x172f75,_0x5ab7bd){return _0x172f75[_0x27fc('0xc')](_0x27fc('0xd'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 4e67317..3562aa2 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 _0x021f=['request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2b0b4c,_0x5e92dd){var _0x46da74=function(_0x272ce9){while(--_0x272ce9){_0x2b0b4c['push'](_0x2b0b4c['shift']());}};_0x46da74(++_0x5e92dd);}(_0x021f,0x70));var _0xf021=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x021f[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xf021('0x0'));var util=require(_0xf021('0x1'));var moment=require(_0xf021('0x2'));var BPromise=require('bluebird');var rs=require(_0xf021('0x3'));var fs=require('fs');var Redis=require(_0xf021('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf021('0x5'));var logger=require('../../config/logger')(_0xf021('0x6'));var config=require(_0xf021('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44601f,_0x2c898f,_0x138401){return new BPromise(function(_0xc7caeb,_0x5a6f8c){return client[_0xf021('0x8')](_0x44601f,_0x138401)[_0xf021('0x9')](function(_0x3cf7fc){logger['info'](_0xf021('0xa'),_0x2c898f,_0xf021('0xb'));logger[_0xf021('0xc')](_0xf021('0xd'),_0x2c898f,_0xf021('0xb'),JSON[_0xf021('0xe')](_0x3cf7fc));if(_0x3cf7fc[_0xf021('0xf')]){if(_0x3cf7fc[_0xf021('0xf')]['code']===0x1f4){logger[_0xf021('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c898f,_0x3cf7fc['error'][_0xf021('0x10')]);return _0x5a6f8c(_0x3cf7fc[_0xf021('0xf')][_0xf021('0x10')]);}logger[_0xf021('0xf')](_0xf021('0xa'),_0x2c898f,_0x3cf7fc['error'][_0xf021('0x10')]);return _0xc7caeb(_0x3cf7fc['error'][_0xf021('0x10')]);}else{logger[_0xf021('0x11')](_0xf021('0xa'),_0x2c898f,_0xf021('0xb'));_0xc7caeb(_0x3cf7fc[_0xf021('0x12')][_0xf021('0x10')]);}})[_0xf021('0x13')](function(_0x583577){logger['error'](_0xf021('0xa'),_0x2c898f,_0x583577);_0x5a6f8c(_0x583577);});});} \ No newline at end of file +var _0xa8b4=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8b4,0xb1));var _0x4a8b=function(_0x24f00e,_0x4ace7f){_0x24f00e=_0x24f00e-0x0;var _0x201636=_0xa8b4[_0x24f00e];return _0x201636;};'use strict';var _=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var moment=require(_0x4a8b('0x2'));var BPromise=require(_0x4a8b('0x3'));var rs=require(_0x4a8b('0x4'));var fs=require('fs');var Redis=require(_0x4a8b('0x5'));var db=require(_0x4a8b('0x6'))['db'];var utils=require(_0x4a8b('0x7'));var logger=require(_0x4a8b('0x8'))(_0x4a8b('0x9'));var config=require('../../config/environment');var jayson=require(_0x4a8b('0xa'));var client=jayson['client'][_0x4a8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x519544,_0x14b9ca,_0x31208a){return new BPromise(function(_0x862dbf,_0x2bba0e){return client[_0x4a8b('0xc')](_0x519544,_0x31208a)[_0x4a8b('0xd')](function(_0x9960f3){logger[_0x4a8b('0xe')](_0x4a8b('0xf'),_0x14b9ca,'request\x20sent');logger['debug'](_0x4a8b('0x10'),_0x14b9ca,_0x4a8b('0x11'),JSON[_0x4a8b('0x12')](_0x9960f3));if(_0x9960f3[_0x4a8b('0x13')]){if(_0x9960f3[_0x4a8b('0x13')][_0x4a8b('0x14')]===0x1f4){logger[_0x4a8b('0x13')](_0x4a8b('0xf'),_0x14b9ca,_0x9960f3['error']['message']);return _0x2bba0e(_0x9960f3[_0x4a8b('0x13')]['message']);}logger['error'](_0x4a8b('0xf'),_0x14b9ca,_0x9960f3['error'][_0x4a8b('0x15')]);return _0x862dbf(_0x9960f3[_0x4a8b('0x13')]['message']);}else{logger[_0x4a8b('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x14b9ca,_0x4a8b('0x11'));_0x862dbf(_0x9960f3[_0x4a8b('0x16')]['message']);}})[_0x4a8b('0x17')](function(_0x5369d1){logger[_0x4a8b('0x13')](_0x4a8b('0xf'),_0x14b9ca,_0x5369d1);_0x2bba0e(_0x5369d1);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 6a8e1da..bfbc279 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 _0x90b9=['/:id','isAuthenticated','show','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get'];(function(_0x3f4070,_0x3ff2a6){var _0x1063be=function(_0x13aa61){while(--_0x13aa61){_0x3f4070['push'](_0x3f4070['shift']());}};_0x1063be(++_0x3ff2a6);}(_0x90b9,0x12d));var _0x990b=function(_0x5eae6a,_0x1da425){_0x5eae6a=_0x5eae6a-0x0;var _0x5b2849=_0x90b9[_0x5eae6a];return _0x5b2849;};'use strict';var multer=require(_0x990b('0x0'));var util=require(_0x990b('0x1'));var path=require('path');var timeout=require(_0x990b('0x2'));var express=require(_0x990b('0x3'));var router=express['Router']();var fs_extra=require(_0x990b('0x4'));var auth=require(_0x990b('0x5'));var interaction=require(_0x990b('0x6'));var config=require(_0x990b('0x7'));var controller=require(_0x990b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x990b('0x9')]);router[_0x990b('0xa')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0xd')]);router[_0x990b('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x990b('0xe')]);router['get'](_0x990b('0xf'),auth['isAuthenticated'](),controller['run']);router[_0x990b('0xa')](_0x990b('0x10'),auth['isAuthenticated'](),controller[_0x990b('0x11')]);router[_0x990b('0x12')]('/',auth['isAuthenticated'](),controller[_0x990b('0x13')]);router[_0x990b('0x14')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0x15')]);router[_0x990b('0x16')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbdc7=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path'];(function(_0x5d4d83,_0x15f5fd){var _0x5d44f0=function(_0x3547f5){while(--_0x3547f5){_0x5d4d83['push'](_0x5d4d83['shift']());}};_0x5d44f0(++_0x15f5fd);}(_0xbdc7,0x1dd));var _0x7bdc=function(_0x1d83a8,_0x5effc7){_0x1d83a8=_0x1d83a8-0x0;var _0x53245f=_0xbdc7[_0x1d83a8];return _0x53245f;};'use strict';var multer=require(_0x7bdc('0x0'));var util=require(_0x7bdc('0x1'));var path=require(_0x7bdc('0x2'));var timeout=require(_0x7bdc('0x3'));var express=require(_0x7bdc('0x4'));var router=express['Router']();var fs_extra=require(_0x7bdc('0x5'));var auth=require(_0x7bdc('0x6'));var interaction=require(_0x7bdc('0x7'));var config=require('../../config/environment');var controller=require(_0x7bdc('0x8'));router['get']('/',auth[_0x7bdc('0x9')](),controller['index']);router[_0x7bdc('0xa')](_0x7bdc('0xb'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0xc')]);router[_0x7bdc('0xa')](_0x7bdc('0xd'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0xe')]);router['get'](_0x7bdc('0xf'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x10')]);router[_0x7bdc('0xa')](_0x7bdc('0x11'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x12')]);router[_0x7bdc('0x13')]('/',auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x14')]);router[_0x7bdc('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7bdc('0x16')](_0x7bdc('0xb'),auth[_0x7bdc('0x9')](),controller['destroy']);module[_0x7bdc('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 9ca8a83..5a0e453 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x487dd8,_0x1d96c5){var _0x1a34a1=function(_0x593cfb){while(--_0x593cfb){_0x487dd8['push'](_0x487dd8['shift']());}};_0x1a34a1(++_0x1d96c5);}(_0xeec6,0x1c2));var _0x6eec=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xeec6[_0x40d8d7];return _0x3454cc;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x40bdc5,_0x4bd99f){var _0x2a3472=function(_0x4e0512){while(--_0x4e0512){_0x40bdc5['push'](_0x40bdc5['shift']());}};_0x2a3472(++_0x4bd99f);}(_0xeda8,0x104));var _0x8eda=function(_0xb8433f,_0x168fa8){_0xb8433f=_0xb8433f-0x0;var _0x4d3cff=_0xeda8[_0xb8433f];return _0x4d3cff;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 015c8f9..75a62bd 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x544df4,_0x25edf9){var _0x58e935=function(_0x439212){while(--_0x439212){_0x544df4['push'](_0x544df4['shift']());}};_0x58e935(++_0x25edf9);}(_0x53ec,0x192));var _0xc53e=function(_0x4e6243,_0x37ec06){_0x4e6243=_0x4e6243-0x0;var _0x211fbc=_0x53ec[_0x4e6243];return _0x211fbc;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file +var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x3ca981,_0x5c4727){var _0x5dbc78=function(_0x399ff1){while(--_0x399ff1){_0x3ca981['push'](_0x3ca981['shift']());}};_0x5dbc78(++_0x5c4727);}(_0x1261,0x144));var _0x1126=function(_0x5ecc5d,_0x38d142){_0x5ecc5d=_0x5ecc5d-0x0;var _0x5b98a3=_0x1261[_0x5ecc5d];return _0x5b98a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a967158..9d44da1 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 _0xb1df=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x7342be,_0x205080){var _0x33ae3b=function(_0x36c28b){while(--_0x36c28b){_0x7342be['push'](_0x7342be['shift']());}};_0x33ae3b(++_0x205080);}(_0xb1df,0x1c7));var _0xfb1d=function(_0x551894,_0x3f2829){_0x551894=_0x551894-0x0;var _0x3b9d31=_0xb1df[_0x551894];return _0x3b9d31;};'use strict';var _=require(_0xfb1d('0x0'));var util=require(_0xfb1d('0x1'));var logger=require(_0xfb1d('0x2'))('api');var moment=require(_0xfb1d('0x3'));var BPromise=require(_0xfb1d('0x4'));var rp=require(_0xfb1d('0x5'));var fs=require('fs');var path=require(_0xfb1d('0x6'));var rimraf=require(_0xfb1d('0x7'));var config=require(_0xfb1d('0x8'));var attributes=require(_0xfb1d('0x9'));module[_0xfb1d('0xa')]=function(_0xb4e535,_0x2a6182){return _0xb4e535[_0xfb1d('0xb')](_0xfb1d('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd6e=['AnalyticDefaultReport','analytics_default_reports','../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x2b356c,_0x28112d){var _0x35d043=function(_0x136de6){while(--_0x136de6){_0x2b356c['push'](_0x2b356c['shift']());}};_0x35d043(++_0x28112d);}(_0xbd6e,0x188));var _0xebd6=function(_0x59fde4,_0x709447){_0x59fde4=_0x59fde4-0x0;var _0x1dd98f=_0xbd6e[_0x59fde4];return _0x1dd98f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebd6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xebd6('0x1'));var rp=require(_0xebd6('0x2'));var fs=require('fs');var path=require(_0xebd6('0x3'));var rimraf=require('rimraf');var config=require(_0xebd6('0x4'));var attributes=require(_0xebd6('0x5'));module[_0xebd6('0x6')]=function(_0x2a71e6,_0x5407c6){return _0x2a71e6[_0xebd6('0x7')](_0xebd6('0x8'),attributes,{'tableName':_0xebd6('0x9'),'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 8af803c..d3e224d 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 _0x7b24=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2c0b85,_0x4e95ba){var _0xad2ee6=function(_0x35dcc9){while(--_0x35dcc9){_0x2c0b85['push'](_0x2c0b85['shift']());}};_0xad2ee6(++_0x4e95ba);}(_0x7b24,0x180));var _0x47b2=function(_0xf78723,_0x213b30){_0xf78723=_0xf78723-0x0;var _0x1265bf=_0x7b24[_0xf78723];return _0x1265bf;};'use strict';var _=require('lodash');var util=require(_0x47b2('0x0'));var moment=require(_0x47b2('0x1'));var BPromise=require(_0x47b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47b2('0x3'))['db'];var utils=require(_0x47b2('0x4'));var logger=require(_0x47b2('0x5'))(_0x47b2('0x6'));var config=require(_0x47b2('0x7'));var jayson=require(_0x47b2('0x8'));var client=jayson[_0x47b2('0x9')][_0x47b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570091,_0x3d88e1,_0x34f9a7){return new BPromise(function(_0xdca28a,_0x1a5338){return client[_0x47b2('0xb')](_0x570091,_0x34f9a7)[_0x47b2('0xc')](function(_0x333be8){logger['info'](_0x47b2('0xd'),_0x3d88e1,_0x47b2('0xe'));logger[_0x47b2('0xf')](_0x47b2('0x10'),_0x3d88e1,_0x47b2('0xe'),JSON[_0x47b2('0x11')](_0x333be8));if(_0x333be8[_0x47b2('0x12')]){if(_0x333be8[_0x47b2('0x12')]['code']===0x1f4){logger[_0x47b2('0x12')](_0x47b2('0xd'),_0x3d88e1,_0x333be8['error'][_0x47b2('0x13')]);return _0x1a5338(_0x333be8[_0x47b2('0x12')][_0x47b2('0x13')]);}logger['error'](_0x47b2('0xd'),_0x3d88e1,_0x333be8['error'][_0x47b2('0x13')]);return _0xdca28a(_0x333be8['error'][_0x47b2('0x13')]);}else{logger[_0x47b2('0x14')](_0x47b2('0xd'),_0x3d88e1,'request\x20sent');_0xdca28a(_0x333be8['result'][_0x47b2('0x13')]);}})['catch'](function(_0x19455b){logger[_0x47b2('0x12')](_0x47b2('0xd'),_0x3d88e1,_0x19455b);_0x1a5338(_0x19455b);});});} \ No newline at end of file +var _0x5293=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x327a25,_0x41c3c3){var _0x1c72f2=function(_0x1c4a03){while(--_0x1c4a03){_0x327a25['push'](_0x327a25['shift']());}};_0x1c72f2(++_0x41c3c3);}(_0x5293,0x1c9));var _0x3529=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x5293[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x3529('0x0'));var util=require(_0x3529('0x1'));var moment=require(_0x3529('0x2'));var BPromise=require(_0x3529('0x3'));var rs=require(_0x3529('0x4'));var fs=require('fs');var Redis=require(_0x3529('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3529('0x6'));var logger=require(_0x3529('0x7'))(_0x3529('0x8'));var config=require(_0x3529('0x9'));var jayson=require(_0x3529('0xa'));var client=jayson[_0x3529('0xb')][_0x3529('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x242ebf,_0x1941bd,_0x12a7e8){return new BPromise(function(_0x422d8b,_0x12f58f){return client[_0x3529('0xd')](_0x242ebf,_0x12a7e8)[_0x3529('0xe')](function(_0x5f21ed){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1941bd,_0x3529('0xf'));logger[_0x3529('0x10')](_0x3529('0x11'),_0x1941bd,_0x3529('0xf'),JSON[_0x3529('0x12')](_0x5f21ed));if(_0x5f21ed[_0x3529('0x13')]){if(_0x5f21ed['error'][_0x3529('0x14')]===0x1f4){logger[_0x3529('0x13')](_0x3529('0x15'),_0x1941bd,_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);return _0x12f58f(_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);}logger[_0x3529('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1941bd,_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);return _0x422d8b(_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);}else{logger['info'](_0x3529('0x15'),_0x1941bd,_0x3529('0xf'));_0x422d8b(_0x5f21ed[_0x3529('0x17')][_0x3529('0x16')]);}})['catch'](function(_0x3413c6){logger[_0x3529('0x13')](_0x3529('0x15'),_0x1941bd,_0x3413c6);_0x12f58f(_0x3413c6);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 6b4d4d4..565dd43 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 _0xfa03=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x356b9e,_0x306f73){var _0x15e910=function(_0x476146){while(--_0x476146){_0x356b9e['push'](_0x356b9e['shift']());}};_0x15e910(++_0x306f73);}(_0xfa03,0xe3));var _0x3fa0=function(_0x5baf08,_0x48dfb1){_0x5baf08=_0x5baf08-0x0;var _0x312d7e=_0xfa03[_0x5baf08];return _0x312d7e;};'use strict';var multer=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var path=require('path');var timeout=require(_0x3fa0('0x2'));var express=require(_0x3fa0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3fa0('0x4'));var interaction=require(_0x3fa0('0x5'));var config=require(_0x3fa0('0x6'));var controller=require(_0x3fa0('0x7'));router['get']('/',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x9')]);router[_0x3fa0('0xa')](_0x3fa0('0xb'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xc')]);router[_0x3fa0('0xa')](_0x3fa0('0xd'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xe')]);router[_0x3fa0('0xa')]('/:id/run',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xf')]);router[_0x3fa0('0xa')](_0x3fa0('0x10'),auth[_0x3fa0('0x8')](),controller['query']);router[_0x3fa0('0x11')]('/',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x12')]);router[_0x3fa0('0x13')](_0x3fa0('0xb'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x14')]);router[_0x3fa0('0x15')]('/:id',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc564=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/query','query'];(function(_0x3ea1f2,_0x37d32a){var _0x69dc66=function(_0x3415ac){while(--_0x3415ac){_0x3ea1f2['push'](_0x3ea1f2['shift']());}};_0x69dc66(++_0x37d32a);}(_0xc564,0xf7));var _0x4c56=function(_0x150e73,_0x5e9ba6){_0x150e73=_0x150e73-0x0;var _0x42da8f=_0xc564[_0x150e73];return _0x42da8f;};'use strict';var multer=require('multer');var util=require(_0x4c56('0x0'));var path=require(_0x4c56('0x1'));var timeout=require(_0x4c56('0x2'));var express=require(_0x4c56('0x3'));var router=express['Router']();var fs_extra=require(_0x4c56('0x4'));var auth=require(_0x4c56('0x5'));var interaction=require(_0x4c56('0x6'));var config=require(_0x4c56('0x7'));var controller=require(_0x4c56('0x8'));router[_0x4c56('0x9')]('/',auth[_0x4c56('0xa')](),controller['index']);router[_0x4c56('0x9')](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0xc')]);router[_0x4c56('0x9')](_0x4c56('0xd'),auth[_0x4c56('0xa')](),controller[_0x4c56('0xe')]);router[_0x4c56('0x9')]('/:id/run',auth[_0x4c56('0xa')](),controller['run']);router[_0x4c56('0x9')](_0x4c56('0xf'),auth[_0x4c56('0xa')](),controller[_0x4c56('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4c56('0x11')](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0x12')]);router[_0x4c56('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4c56('0x14')]);module[_0x4c56('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0264ce1..0af4301 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 _0xbc08=['csv','pdf','DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x3b8b89,_0x2e1b03){var _0x31d9da=function(_0x54b32a){while(--_0x54b32a){_0x3b8b89['push'](_0x3b8b89['shift']());}};_0x31d9da(++_0x2e1b03);}(_0xbc08,0xc1));var _0x8bc0=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0xbc08[_0x111311];return _0x4cef39;};'use strict';var Sequelize=require(_0x8bc0('0x0'));var moment=require(_0x8bc0('0x1'));module[_0x8bc0('0x2')]={'name':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8bc0('0x4')](_0x8bc0('0x5'),_0x8bc0('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8bc0('0x7')]},'endDate':{'type':Sequelize[_0x8bc0('0x7')]},'status':{'type':Sequelize[_0x8bc0('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x8bc0('0x8'),_0x8bc0('0x9')),'allowNull':![],'defaultValue':_0x8bc0('0x8')},'reportId':{'type':Sequelize[_0x8bc0('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8bc0('0x3')]}}; \ No newline at end of file +var _0xfb69=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','sequelize'];(function(_0x32876c,_0x192d6f){var _0x3b834c=function(_0xca78f9){while(--_0xca78f9){_0x32876c['push'](_0x32876c['shift']());}};_0x3b834c(++_0x192d6f);}(_0xfb69,0x12b));var _0x9fb6=function(_0x22abc0,_0x488b20){_0x22abc0=_0x22abc0-0x0;var _0x240e7d=_0xfb69[_0x22abc0];return _0x240e7d;};'use strict';var Sequelize=require(_0x9fb6('0x0'));var moment=require(_0x9fb6('0x1'));module[_0x9fb6('0x2')]={'name':{'type':Sequelize[_0x9fb6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9fb6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9fb6('0x4')](_0x9fb6('0x5'),_0x9fb6('0x6'),_0x9fb6('0x7')),'allowNull':![],'defaultValue':_0x9fb6('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9fb6('0x8')]},'endDate':{'type':Sequelize[_0x9fb6('0x8')]},'status':{'type':Sequelize[_0x9fb6('0x3')],'defaultValue':_0x9fb6('0x9')},'type':{'type':Sequelize[_0x9fb6('0x4')](_0x9fb6('0xa'),_0x9fb6('0xb')),'allowNull':![],'defaultValue':_0x9fb6('0xa')},'reportId':{'type':Sequelize['INTEGER'](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 85a0c0e..3f216f6 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 _0xfcfa=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','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','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x1f548d,_0x3f2843){var _0x46affb=function(_0x23aa3c){while(--_0x23aa3c){_0x1f548d['push'](_0x1f548d['shift']());}};_0x46affb(++_0x3f2843);}(_0xfcfa,0x1d4));var _0xafcf=function(_0x1d5764,_0x34af97){_0x1d5764=_0x1d5764-0x0;var _0x39f642=_0xfcfa[_0x1d5764];return _0x39f642;};'use strict';var emlformat=require(_0xafcf('0x0'));var rimraf=require(_0xafcf('0x1'));var zipdir=require(_0xafcf('0x2'));var jsonpatch=require(_0xafcf('0x3'));var rp=require('request-promise');var moment=require(_0xafcf('0x4'));var BPromise=require(_0xafcf('0x5'));var Mustache=require(_0xafcf('0x6'));var util=require(_0xafcf('0x7'));var path=require('path');var sox=require(_0xafcf('0x8'));var csv=require(_0xafcf('0x9'));var ejs=require(_0xafcf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafcf('0xb'));var squel=require(_0xafcf('0xc'));var crypto=require(_0xafcf('0xd'));var jsforce=require(_0xafcf('0xe'));var deskjs=require(_0xafcf('0xf'));var toCsv=require(_0xafcf('0x9'));var querystring=require('querystring');var Papa=require(_0xafcf('0x10'));var Redis=require('ioredis');var authService=require(_0xafcf('0x11'));var qs=require(_0xafcf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xafcf('0x13'))(_0xafcf('0x14'));var utils=require(_0xafcf('0x15'));var config=require(_0xafcf('0x16'));var licenseUtil=require(_0xafcf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e410,_0x4faf8d){_0x4faf8d=_0x4faf8d||0xcc;return function(_0x39dc3d){if(_0x39dc3d){return _0x23e410[_0xafcf('0x18')](_0x4faf8d);}return _0x23e410[_0xafcf('0x19')](_0x4faf8d)[_0xafcf('0x1a')]();};}function respondWithResult(_0x2a6b49,_0x18a92d){_0x18a92d=_0x18a92d||0xc8;return function(_0x1138bb){if(_0x1138bb){return _0x2a6b49['status'](_0x18a92d)[_0xafcf('0x1b')](_0x1138bb);}};}function respondWithFilteredResult(_0x5e32b5,_0x675c65){return function(_0x24f447){if(_0x24f447){var _0xd12bcb=typeof _0x675c65['offset']===_0xafcf('0x1c')&&typeof _0x675c65['limit']===_0xafcf('0x1c');var _0x29b914=_0x24f447[_0xafcf('0x1d')];var _0x5506a7=_0xd12bcb?0x0:_0x675c65[_0xafcf('0x1e')];var _0x75cdd9=_0xd12bcb?_0x24f447['count']:_0x675c65[_0xafcf('0x1e')]+_0x675c65[_0xafcf('0x1f')];var _0x3f847a;if(_0x75cdd9>=_0x29b914){_0x75cdd9=_0x29b914;_0x3f847a=0xc8;}else{_0x3f847a=0xce;}_0x5e32b5[_0xafcf('0x19')](_0x3f847a);return _0x5e32b5[_0xafcf('0x20')](_0xafcf('0x21'),_0x5506a7+'-'+_0x75cdd9+'/'+_0x29b914)['json'](_0x24f447);}return null;};}function patchUpdates(_0x55aad5){return function(_0x34e181){try{jsonpatch[_0xafcf('0x22')](_0x34e181,_0x55aad5,!![]);}catch(_0x1b9b85){return BPromise[_0xafcf('0x23')](_0x1b9b85);}return _0x34e181[_0xafcf('0x24')]();};}function saveUpdates(_0x57c87d,_0x1a8534){return function(_0x14e740){if(_0x14e740){return _0x14e740[_0xafcf('0x25')](_0x57c87d)[_0xafcf('0x26')](function(_0x43abb4){return _0x43abb4;});}return null;};}function removeEntity(_0xf1e11,_0x1d7e71){return function(_0x503053){if(_0x503053){return _0x503053[_0xafcf('0x27')]()[_0xafcf('0x26')](function(){var _0x5761a1=_0x503053[_0xafcf('0x28')]({'plain':!![]});var _0x1ef121=_0xafcf('0x29');return db[_0xafcf('0x2a')][_0xafcf('0x27')]({'where':{'type':_0x1ef121,'resourceId':_0x5761a1['id']}})[_0xafcf('0x26')](function(){return _0x503053;});})[_0xafcf('0x26')](function(){_0xf1e11[_0xafcf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12e707,_0x5906b9){return function(_0x21daa4){if(!_0x21daa4){_0x12e707[_0xafcf('0x18')](0x194);}return _0x21daa4;};}function handleError(_0x175cd1,_0x5f82d0){_0x5f82d0=_0x5f82d0||0x1f4;return function(_0x27ea1f){logger[_0xafcf('0x2b')](_0x27ea1f[_0xafcf('0x2c')]);if(_0x27ea1f[_0xafcf('0x2d')]){delete _0x27ea1f[_0xafcf('0x2d')];}_0x175cd1['status'](_0x5f82d0)['send'](_0x27ea1f);};}exports[_0xafcf('0x2e')]=function(_0x8732b0,_0x474aeb){var _0x3f6759={},_0x1d9fc1={},_0x4fb0f7={'count':0x0,'rows':[]};var _0x275868=_[_0xafcf('0x2f')](db[_0xafcf('0x30')][_0xafcf('0x31')],function(_0x5d6236){return{'name':_0x5d6236[_0xafcf('0x32')],'type':_0x5d6236[_0xafcf('0x33')]['key']};});_0x1d9fc1['model']=_[_0xafcf('0x2f')](_0x275868,'name');_0x1d9fc1[_0xafcf('0x34')]=_[_0xafcf('0x35')](_0x8732b0['query']);_0x1d9fc1[_0xafcf('0x36')]=_['intersection'](_0x1d9fc1[_0xafcf('0x37')],_0x1d9fc1['query']);_0x3f6759[_0xafcf('0x38')]=_[_0xafcf('0x39')](_0x1d9fc1['model'],qs[_0xafcf('0x3a')](_0x8732b0['query'][_0xafcf('0x3a')]));_0x3f6759[_0xafcf('0x38')]=_0x3f6759[_0xafcf('0x38')]['length']?_0x3f6759[_0xafcf('0x38')]:_0x1d9fc1[_0xafcf('0x37')];if(!_0x8732b0[_0xafcf('0x34')][_0xafcf('0x3b')]('nolimit')){_0x3f6759[_0xafcf('0x1f')]=qs[_0xafcf('0x1f')](_0x8732b0[_0xafcf('0x34')][_0xafcf('0x1f')]);_0x3f6759[_0xafcf('0x1e')]=qs['offset'](_0x8732b0['query'][_0xafcf('0x1e')]);}_0x3f6759[_0xafcf('0x3c')]=qs[_0xafcf('0x3d')](_0x8732b0[_0xafcf('0x34')]['sort']);_0x3f6759[_0xafcf('0x3e')]=qs[_0xafcf('0x36')](_[_0xafcf('0x3f')](_0x8732b0[_0xafcf('0x34')],_0x1d9fc1[_0xafcf('0x36')]),_0x275868);if(_0x8732b0[_0xafcf('0x34')][_0xafcf('0x40')]){_0x3f6759[_0xafcf('0x3e')]=_[_0xafcf('0x41')](_0x3f6759['where'],{'$or':_[_0xafcf('0x2f')](_0x275868,function(_0x16441a){if(_0x16441a[_0xafcf('0x33')]!==_0xafcf('0x42')){var _0x2bfe26={};_0x2bfe26[_0x16441a[_0xafcf('0x2d')]]={'$like':'%'+_0x8732b0['query']['filter']+'%'};return _0x2bfe26;}})});}_0x3f6759=_[_0xafcf('0x41')]({},_0x3f6759,_0x8732b0[_0xafcf('0x43')]);var _0x56054c={'where':_0x3f6759[_0xafcf('0x3e')]};return db[_0xafcf('0x30')][_0xafcf('0x1d')](_0x56054c)[_0xafcf('0x26')](function(_0x5f3857){_0x4fb0f7[_0xafcf('0x1d')]=_0x5f3857;if(_0x8732b0[_0xafcf('0x34')]['includeAll']){_0x3f6759[_0xafcf('0x44')]=[{'all':!![]}];}return db[_0xafcf('0x30')][_0xafcf('0x45')](_0x3f6759);})[_0xafcf('0x26')](function(_0x5c3d00){_0x4fb0f7[_0xafcf('0x46')]=_0x5c3d00;return _0x4fb0f7;})['then'](respondWithFilteredResult(_0x474aeb,_0x3f6759))[_0xafcf('0x47')](handleError(_0x474aeb,null));};exports[_0xafcf('0x48')]=function(_0x31fb05,_0x3cf036){var _0x81653d={'raw':!![],'where':{'id':_0x31fb05[_0xafcf('0x49')]['id']}},_0x295290={};_0x295290['model']=_['keys'](db[_0xafcf('0x30')][_0xafcf('0x31')]);_0x295290[_0xafcf('0x34')]=_[_0xafcf('0x35')](_0x31fb05['query']);_0x295290[_0xafcf('0x36')]=_[_0xafcf('0x39')](_0x295290[_0xafcf('0x37')],_0x295290[_0xafcf('0x34')]);_0x81653d[_0xafcf('0x38')]=_[_0xafcf('0x39')](_0x295290[_0xafcf('0x37')],qs[_0xafcf('0x3a')](_0x31fb05[_0xafcf('0x34')][_0xafcf('0x3a')]));_0x81653d[_0xafcf('0x38')]=_0x81653d[_0xafcf('0x38')]['length']?_0x81653d[_0xafcf('0x38')]:_0x295290['model'];if(_0x31fb05[_0xafcf('0x34')][_0xafcf('0x4a')]){_0x81653d['include']=[{'all':!![]}];}_0x81653d=_[_0xafcf('0x41')]({},_0x81653d,_0x31fb05['options']);return db['AnalyticExtractedReport'][_0xafcf('0x4b')](_0x81653d)[_0xafcf('0x26')](handleEntityNotFound(_0x3cf036,null))[_0xafcf('0x26')](respondWithResult(_0x3cf036,null))[_0xafcf('0x47')](handleError(_0x3cf036,null));};exports['create']=function(_0x485510,_0x46d33b){return db['AnalyticExtractedReport'][_0xafcf('0x4c')](_0x485510[_0xafcf('0x4d')],{})[_0xafcf('0x26')](function(_0x3f8160){var _0x3e7112=_0x485510[_0xafcf('0x4e')][_0xafcf('0x28')]({'plain':!![]});if(!_0x3e7112)throw new Error(_0xafcf('0x4f'));if(_0x3e7112[_0xafcf('0x50')]==='user'){var _0x540898=_0x3f8160['get']({'plain':!![]});var _0x362f15=_0xafcf('0x29');return db[_0xafcf('0x51')]['find']({'where':{'name':_0x362f15,'userProfileId':_0x3e7112[_0xafcf('0x52')]},'raw':!![]})[_0xafcf('0x26')](function(_0x3fdcf3){if(_0x3fdcf3&&_0x3fdcf3[_0xafcf('0x53')]===0x0){return db[_0xafcf('0x2a')][_0xafcf('0x4c')]({'name':_0x540898['name'],'resourceId':_0x540898['id'],'type':_0x3fdcf3[_0xafcf('0x2d')],'sectionId':_0x3fdcf3['id']},{})[_0xafcf('0x26')](function(){return _0x3f8160;});}else{return _0x3f8160;}})[_0xafcf('0x47')](function(_0x47d4ea){logger[_0xafcf('0x2b')](_0xafcf('0x54'),_0x47d4ea);throw _0x47d4ea;});}return _0x3f8160;})[_0xafcf('0x26')](respondWithResult(_0x46d33b,0xc9))['catch'](handleError(_0x46d33b,null));};exports[_0xafcf('0x25')]=function(_0x21ab12,_0x5287da){if(_0x21ab12[_0xafcf('0x4d')]['id']){delete _0x21ab12[_0xafcf('0x4d')]['id'];}return db['AnalyticExtractedReport'][_0xafcf('0x4b')]({'where':{'id':_0x21ab12['params']['id']}})[_0xafcf('0x26')](handleEntityNotFound(_0x5287da,null))[_0xafcf('0x26')](saveUpdates(_0x21ab12['body'],null))['then'](respondWithResult(_0x5287da,null))[_0xafcf('0x47')](handleError(_0x5287da,null));};exports['destroy']=function(_0x38e73d,_0x572c34){return db[_0xafcf('0x30')][_0xafcf('0x4b')]({'where':{'id':_0x38e73d[_0xafcf('0x49')]['id']}})['then'](handleEntityNotFound(_0x572c34,null))[_0xafcf('0x26')](removeEntity(_0x572c34,null))[_0xafcf('0x47')](handleError(_0x572c34,null));};exports[_0xafcf('0x55')]=function(_0x36228c,_0x4a2576,_0x3bb64e){return db[_0xafcf('0x30')][_0xafcf('0x4b')]({'where':{'id':_0x36228c[_0xafcf('0x49')]['id']},'attributes':['name',_0xafcf('0x56'),_0xafcf('0x57'),_0xafcf('0x58')],'raw':!![]})[_0xafcf('0x26')](handleEntityNotFound(_0x4a2576,null))[_0xafcf('0x26')](function(_0x3047bf){if(_0x3047bf){if(!fs[_0xafcf('0x59')](path[_0xafcf('0x5a')](config[_0xafcf('0x5b')],'server/files/reports',_0x3047bf[_0xafcf('0x57')]))){throw new db[(_0xafcf('0x5c'))][(_0xafcf('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x36228c[_0xafcf('0x34')][_0xafcf('0x5e')]){return _0x4a2576['sendStatus'](0xc8);}return _0x4a2576['download'](path['join'](config[_0xafcf('0x5b')],'server/files/reports',_0x3047bf[_0xafcf('0x57')]),util[_0xafcf('0x5f')](_0xafcf('0x60'),_0x3047bf[_0xafcf('0x56')]||_0x3047bf[_0xafcf('0x2d')],_0x3047bf[_0xafcf('0x58')][_0xafcf('0x61')]()));}})[_0xafcf('0x47')](handleError(_0x4a2576,null));}; \ No newline at end of file +var _0x1505=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','exists','format','%s.%s','output','toLowerCase','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','AnalyticExtractedReport','findAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x28c84b,_0x2ebb43){var _0x657d5=function(_0x3d34e8){while(--_0x3d34e8){_0x28c84b['push'](_0x28c84b['shift']());}};_0x657d5(++_0x2ebb43);}(_0x1505,0x1f4));var _0x5150=function(_0xc565e5,_0x13160d){_0xc565e5=_0xc565e5-0x0;var _0x571055=_0x1505[_0xc565e5];return _0x571055;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5150('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5150('0x1'));var moment=require(_0x5150('0x2'));var BPromise=require(_0x5150('0x3'));var Mustache=require(_0x5150('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5150('0x5'));var ejs=require(_0x5150('0x6'));var fs=require('fs');var fs_extra=require(_0x5150('0x7'));var _=require(_0x5150('0x8'));var squel=require(_0x5150('0x9'));var crypto=require('crypto');var jsforce=require(_0x5150('0xa'));var deskjs=require(_0x5150('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5150('0xc'));var authService=require(_0x5150('0xd'));var qs=require(_0x5150('0xe'));var as=require(_0x5150('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5150('0x10'))(_0x5150('0x11'));var utils=require(_0x5150('0x12'));var config=require(_0x5150('0x13'));var licenseUtil=require(_0x5150('0x14'));var db=require(_0x5150('0x15'))['db'];function respondWithStatusCode(_0x3c1c9f,_0x4e4e39){_0x4e4e39=_0x4e4e39||0xcc;return function(_0x3434ab){if(_0x3434ab){return _0x3c1c9f[_0x5150('0x16')](_0x4e4e39);}return _0x3c1c9f[_0x5150('0x17')](_0x4e4e39)[_0x5150('0x18')]();};}function respondWithResult(_0x4ffd0e,_0x3cc230){_0x3cc230=_0x3cc230||0xc8;return function(_0x493117){if(_0x493117){return _0x4ffd0e[_0x5150('0x17')](_0x3cc230)[_0x5150('0x19')](_0x493117);}};}function respondWithFilteredResult(_0x39f1a8,_0x4c31b4){return function(_0x4fed5a){if(_0x4fed5a){var _0x1875ec=typeof _0x4c31b4[_0x5150('0x1a')]===_0x5150('0x1b')&&typeof _0x4c31b4[_0x5150('0x1c')]===_0x5150('0x1b');var _0x85a595=_0x4fed5a['count'];var _0x12c677=_0x1875ec?0x0:_0x4c31b4[_0x5150('0x1a')];var _0x301f13=_0x1875ec?_0x4fed5a[_0x5150('0x1d')]:_0x4c31b4[_0x5150('0x1a')]+_0x4c31b4[_0x5150('0x1c')];var _0x1320ab;if(_0x301f13>=_0x85a595){_0x301f13=_0x85a595;_0x1320ab=0xc8;}else{_0x1320ab=0xce;}_0x39f1a8[_0x5150('0x17')](_0x1320ab);return _0x39f1a8['set'](_0x5150('0x1e'),_0x12c677+'-'+_0x301f13+'/'+_0x85a595)[_0x5150('0x19')](_0x4fed5a);}return null;};}function patchUpdates(_0x3520b1){return function(_0x454e74){try{jsonpatch[_0x5150('0x1f')](_0x454e74,_0x3520b1,!![]);}catch(_0xce378c){return BPromise[_0x5150('0x20')](_0xce378c);}return _0x454e74[_0x5150('0x21')]();};}function saveUpdates(_0x13cc33,_0x11e5ab){return function(_0x17c196){if(_0x17c196){return _0x17c196[_0x5150('0x22')](_0x13cc33)['then'](function(_0x3804e0){return _0x3804e0;});}return null;};}function removeEntity(_0x1f21ff,_0x4799f2){return function(_0x43eb75){if(_0x43eb75){return _0x43eb75[_0x5150('0x23')]()[_0x5150('0x24')](function(){var _0x34b8eb=_0x43eb75[_0x5150('0x25')]({'plain':!![]});var _0x3c136a=_0x5150('0x26');return db[_0x5150('0x27')][_0x5150('0x23')]({'where':{'type':_0x3c136a,'resourceId':_0x34b8eb['id']}})[_0x5150('0x24')](function(){return _0x43eb75;});})[_0x5150('0x24')](function(){_0x1f21ff[_0x5150('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b40da,_0x559f77){return function(_0x50dfa1){if(!_0x50dfa1){_0x4b40da[_0x5150('0x16')](0x194);}return _0x50dfa1;};}function handleError(_0x57adc8,_0xa92097){_0xa92097=_0xa92097||0x1f4;return function(_0x59aaf0){logger['error'](_0x59aaf0[_0x5150('0x28')]);if(_0x59aaf0['name']){delete _0x59aaf0['name'];}_0x57adc8['status'](_0xa92097)[_0x5150('0x29')](_0x59aaf0);};}exports['index']=function(_0x43fc13,_0x20e3ff){var _0x1afbbc={},_0x225970={},_0x428b75={'count':0x0,'rows':[]};var _0x59baca=_[_0x5150('0x2a')](db['AnalyticExtractedReport'][_0x5150('0x2b')],function(_0x5cff70){return{'name':_0x5cff70[_0x5150('0x2c')],'type':_0x5cff70[_0x5150('0x2d')][_0x5150('0x2e')]};});_0x225970[_0x5150('0x2f')]=_['map'](_0x59baca,'name');_0x225970[_0x5150('0x30')]=_[_0x5150('0x31')](_0x43fc13[_0x5150('0x30')]);_0x225970[_0x5150('0x32')]=_['intersection'](_0x225970[_0x5150('0x2f')],_0x225970[_0x5150('0x30')]);_0x1afbbc[_0x5150('0x33')]=_[_0x5150('0x34')](_0x225970['model'],qs[_0x5150('0x35')](_0x43fc13[_0x5150('0x30')][_0x5150('0x35')]));_0x1afbbc[_0x5150('0x33')]=_0x1afbbc[_0x5150('0x33')]['length']?_0x1afbbc[_0x5150('0x33')]:_0x225970[_0x5150('0x2f')];if(!_0x43fc13['query'][_0x5150('0x36')]('nolimit')){_0x1afbbc[_0x5150('0x1c')]=qs[_0x5150('0x1c')](_0x43fc13[_0x5150('0x30')][_0x5150('0x1c')]);_0x1afbbc['offset']=qs['offset'](_0x43fc13[_0x5150('0x30')][_0x5150('0x1a')]);}_0x1afbbc[_0x5150('0x37')]=qs[_0x5150('0x38')](_0x43fc13[_0x5150('0x30')][_0x5150('0x38')]);_0x1afbbc['where']=qs[_0x5150('0x32')](_[_0x5150('0x39')](_0x43fc13['query'],_0x225970[_0x5150('0x32')]),_0x59baca);if(_0x43fc13[_0x5150('0x30')][_0x5150('0x3a')]){_0x1afbbc[_0x5150('0x3b')]=_[_0x5150('0x3c')](_0x1afbbc[_0x5150('0x3b')],{'$or':_[_0x5150('0x2a')](_0x59baca,function(_0x5efd01){if(_0x5efd01[_0x5150('0x2d')]!==_0x5150('0x3d')){var _0x505a29={};_0x505a29[_0x5efd01[_0x5150('0x3e')]]={'$like':'%'+_0x43fc13[_0x5150('0x30')][_0x5150('0x3a')]+'%'};return _0x505a29;}})});}_0x1afbbc=_[_0x5150('0x3c')]({},_0x1afbbc,_0x43fc13[_0x5150('0x3f')]);var _0x4f62e4={'where':_0x1afbbc['where']};return db['AnalyticExtractedReport'][_0x5150('0x1d')](_0x4f62e4)[_0x5150('0x24')](function(_0x52a302){_0x428b75[_0x5150('0x1d')]=_0x52a302;if(_0x43fc13[_0x5150('0x30')][_0x5150('0x40')]){_0x1afbbc['include']=[{'all':!![]}];}return db[_0x5150('0x41')][_0x5150('0x42')](_0x1afbbc);})[_0x5150('0x24')](function(_0x575e69){_0x428b75[_0x5150('0x43')]=_0x575e69;return _0x428b75;})[_0x5150('0x24')](respondWithFilteredResult(_0x20e3ff,_0x1afbbc))[_0x5150('0x44')](handleError(_0x20e3ff,null));};exports[_0x5150('0x45')]=function(_0x2b52ae,_0x4e7507){var _0x11a757={'raw':!![],'where':{'id':_0x2b52ae[_0x5150('0x46')]['id']}},_0xcf7aa9={};_0xcf7aa9[_0x5150('0x2f')]=_[_0x5150('0x31')](db[_0x5150('0x41')]['rawAttributes']);_0xcf7aa9['query']=_[_0x5150('0x31')](_0x2b52ae['query']);_0xcf7aa9[_0x5150('0x32')]=_[_0x5150('0x34')](_0xcf7aa9[_0x5150('0x2f')],_0xcf7aa9[_0x5150('0x30')]);_0x11a757['attributes']=_[_0x5150('0x34')](_0xcf7aa9[_0x5150('0x2f')],qs[_0x5150('0x35')](_0x2b52ae[_0x5150('0x30')][_0x5150('0x35')]));_0x11a757[_0x5150('0x33')]=_0x11a757['attributes'][_0x5150('0x47')]?_0x11a757['attributes']:_0xcf7aa9[_0x5150('0x2f')];if(_0x2b52ae['query']['includeAll']){_0x11a757[_0x5150('0x48')]=[{'all':!![]}];}_0x11a757=_[_0x5150('0x3c')]({},_0x11a757,_0x2b52ae[_0x5150('0x3f')]);return db[_0x5150('0x41')][_0x5150('0x49')](_0x11a757)['then'](handleEntityNotFound(_0x4e7507,null))[_0x5150('0x24')](respondWithResult(_0x4e7507,null))['catch'](handleError(_0x4e7507,null));};exports[_0x5150('0x4a')]=function(_0x2aa771,_0x1d6559){return db[_0x5150('0x41')][_0x5150('0x4a')](_0x2aa771[_0x5150('0x4b')],{})['then'](function(_0x4e267c){var _0xc71ebc=_0x2aa771['user'][_0x5150('0x25')]({'plain':!![]});if(!_0xc71ebc)throw new Error(_0x5150('0x4c'));if(_0xc71ebc[_0x5150('0x4d')]===_0x5150('0x4e')){var _0x1e6f51=_0x4e267c[_0x5150('0x25')]({'plain':!![]});var _0x189d08=_0x5150('0x26');return db[_0x5150('0x4f')][_0x5150('0x49')]({'where':{'name':_0x189d08,'userProfileId':_0xc71ebc[_0x5150('0x50')]},'raw':!![]})[_0x5150('0x24')](function(_0x22ed57){if(_0x22ed57&&_0x22ed57[_0x5150('0x51')]===0x0){return db['UserProfileResource'][_0x5150('0x4a')]({'name':_0x1e6f51[_0x5150('0x3e')],'resourceId':_0x1e6f51['id'],'type':_0x22ed57[_0x5150('0x3e')],'sectionId':_0x22ed57['id']},{})['then'](function(){return _0x4e267c;});}else{return _0x4e267c;}})['catch'](function(_0x5f347e){logger[_0x5150('0x52')](_0x5150('0x53'),_0x5f347e);throw _0x5f347e;});}return _0x4e267c;})[_0x5150('0x24')](respondWithResult(_0x1d6559,0xc9))[_0x5150('0x44')](handleError(_0x1d6559,null));};exports['update']=function(_0x3a5c95,_0x4a7ece){if(_0x3a5c95[_0x5150('0x4b')]['id']){delete _0x3a5c95[_0x5150('0x4b')]['id'];}return db[_0x5150('0x41')][_0x5150('0x49')]({'where':{'id':_0x3a5c95['params']['id']}})[_0x5150('0x24')](handleEntityNotFound(_0x4a7ece,null))[_0x5150('0x24')](saveUpdates(_0x3a5c95[_0x5150('0x4b')],null))[_0x5150('0x24')](respondWithResult(_0x4a7ece,null))[_0x5150('0x44')](handleError(_0x4a7ece,null));};exports[_0x5150('0x23')]=function(_0x42a39e,_0x2cd8d6){return db[_0x5150('0x41')][_0x5150('0x49')]({'where':{'id':_0x42a39e[_0x5150('0x46')]['id']}})[_0x5150('0x24')](handleEntityNotFound(_0x2cd8d6,null))[_0x5150('0x24')](removeEntity(_0x2cd8d6,null))[_0x5150('0x44')](handleError(_0x2cd8d6,null));};exports[_0x5150('0x54')]=function(_0x208e82,_0x1fedd4,_0xc96019){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x208e82[_0x5150('0x46')]['id']},'attributes':['name',_0x5150('0x55'),_0x5150('0x56'),'output'],'raw':!![]})[_0x5150('0x24')](handleEntityNotFound(_0x1fedd4,null))['then'](function(_0xea8c89){if(_0xea8c89){if(!fs[_0x5150('0x57')](path[_0x5150('0x58')](config[_0x5150('0x59')],_0x5150('0x5a'),_0xea8c89[_0x5150('0x56')]))){throw new db['Sequelize'][(_0x5150('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x208e82[_0x5150('0x30')][_0x5150('0x5c')]){return _0x1fedd4[_0x5150('0x16')](0xc8);}return _0x1fedd4[_0x5150('0x54')](path[_0x5150('0x58')](config[_0x5150('0x59')],_0x5150('0x5a'),_0xea8c89[_0x5150('0x56')]),util[_0x5150('0x5d')](_0x5150('0x5e'),_0xea8c89[_0x5150('0x55')]||_0xea8c89[_0x5150('0x3e')],_0xea8c89[_0x5150('0x5f')][_0x5150('0x60')]()));}})[_0x5150('0x44')](handleError(_0x1fedd4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index c28017b..ff68e6b 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 _0xe19e=['bluebird','request-promise','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xe19e,0x179));var _0xee19=function(_0x43fd72,_0x45abf1){_0x43fd72=_0x43fd72-0x0;var _0x1310c5=_0xe19e[_0x43fd72];return _0x1310c5;};'use strict';var _=require(_0xee19('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee19('0x1'));var moment=require(_0xee19('0x2'));var BPromise=require(_0xee19('0x3'));var rp=require(_0xee19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xee19('0x5'));module[_0xee19('0x6')]=function(_0x4b3014,_0x43ec63){return _0x4b3014[_0xee19('0x7')](_0xee19('0x8'),attributes,{'tableName':_0xee19('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7709=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x4a8285,_0x35958e){var _0x55dc97=function(_0x3274a3){while(--_0x3274a3){_0x4a8285['push'](_0x4a8285['shift']());}};_0x55dc97(++_0x35958e);}(_0x7709,0xf5));var _0x9770=function(_0x56e759,_0x203644){_0x56e759=_0x56e759-0x0;var _0xd028c7=_0x7709[_0x56e759];return _0xd028c7;};'use strict';var _=require(_0x9770('0x0'));var util=require(_0x9770('0x1'));var logger=require(_0x9770('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9770('0x3'));var rp=require(_0x9770('0x4'));var fs=require('fs');var path=require(_0x9770('0x5'));var rimraf=require('rimraf');var config=require(_0x9770('0x6'));var attributes=require(_0x9770('0x7'));module[_0x9770('0x8')]=function(_0x34b135,_0x457915){return _0x34b135[_0x9770('0x9')](_0x9770('0xa'),attributes,{'tableName':_0x9770('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 3e37768..e50cecf 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 _0xc981=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37b7c9,_0x274436){var _0x506993=function(_0x10b177){while(--_0x10b177){_0x37b7c9['push'](_0x37b7c9['shift']());}};_0x506993(++_0x274436);}(_0xc981,0xeb));var _0x1c98=function(_0x1b3aa7,_0x2d5ed6){_0x1b3aa7=_0x1b3aa7-0x0;var _0x27482a=_0xc981[_0x1b3aa7];return _0x27482a;};'use strict';var _=require(_0x1c98('0x0'));var util=require(_0x1c98('0x1'));var moment=require(_0x1c98('0x2'));var BPromise=require(_0x1c98('0x3'));var rs=require(_0x1c98('0x4'));var fs=require('fs');var Redis=require(_0x1c98('0x5'));var db=require(_0x1c98('0x6'))['db'];var utils=require(_0x1c98('0x7'));var logger=require(_0x1c98('0x8'))(_0x1c98('0x9'));var config=require(_0x1c98('0xa'));var jayson=require(_0x1c98('0xb'));var client=jayson[_0x1c98('0xc')][_0x1c98('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e42e3,_0x2fef6b,_0x1aa746){return new BPromise(function(_0x1b6861,_0x5f4742){return client[_0x1c98('0xe')](_0x4e42e3,_0x1aa746)[_0x1c98('0xf')](function(_0x536ebd){logger[_0x1c98('0x10')](_0x1c98('0x11'),_0x2fef6b,_0x1c98('0x12'));logger[_0x1c98('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2fef6b,'request\x20sent',JSON[_0x1c98('0x14')](_0x536ebd));if(_0x536ebd[_0x1c98('0x15')]){if(_0x536ebd[_0x1c98('0x15')][_0x1c98('0x16')]===0x1f4){logger['error'](_0x1c98('0x11'),_0x2fef6b,_0x536ebd['error'][_0x1c98('0x17')]);return _0x5f4742(_0x536ebd[_0x1c98('0x15')]['message']);}logger[_0x1c98('0x15')](_0x1c98('0x11'),_0x2fef6b,_0x536ebd['error']['message']);return _0x1b6861(_0x536ebd[_0x1c98('0x15')][_0x1c98('0x17')]);}else{logger[_0x1c98('0x10')](_0x1c98('0x11'),_0x2fef6b,_0x1c98('0x12'));_0x1b6861(_0x536ebd[_0x1c98('0x18')][_0x1c98('0x17')]);}})['catch'](function(_0x905f){logger[_0x1c98('0x15')](_0x1c98('0x11'),_0x2fef6b,_0x905f);_0x5f4742(_0x905f);});});} \ No newline at end of file +var _0xa081=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','debug'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xa081,0x7c));var _0x1a08=function(_0x42772,_0x5b6de2){_0x42772=_0x42772-0x0;var _0x339117=_0xa081[_0x42772];return _0x339117;};'use strict';var _=require(_0x1a08('0x0'));var util=require(_0x1a08('0x1'));var moment=require(_0x1a08('0x2'));var BPromise=require(_0x1a08('0x3'));var rs=require(_0x1a08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a08('0x5'))['db'];var utils=require(_0x1a08('0x6'));var logger=require('../../config/logger')(_0x1a08('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a08('0x8'));var client=jayson['client'][_0x1a08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c0d9,_0x47951,_0x43b082){return new BPromise(function(_0x224d2b,_0x515c76){return client[_0x1a08('0xa')](_0x27c0d9,_0x43b082)[_0x1a08('0xb')](function(_0x46ed0b){logger[_0x1a08('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47951,'request\x20sent');logger[_0x1a08('0xd')](_0x1a08('0xe'),_0x47951,_0x1a08('0xf'),JSON[_0x1a08('0x10')](_0x46ed0b));if(_0x46ed0b['error']){if(_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x12')]===0x1f4){logger['error'](_0x1a08('0x13'),_0x47951,_0x46ed0b[_0x1a08('0x11')]['message']);return _0x515c76(_0x46ed0b[_0x1a08('0x11')]['message']);}logger[_0x1a08('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47951,_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x14')]);return _0x224d2b(_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x14')]);}else{logger['info'](_0x1a08('0x13'),_0x47951,_0x1a08('0xf'));_0x224d2b(_0x46ed0b[_0x1a08('0x15')]['message']);}})[_0x1a08('0x16')](function(_0x5b9703){logger['error'](_0x1a08('0x13'),_0x47951,_0x5b9703);_0x515c76(_0x5b9703);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ea63517..edfb739 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 _0x8c54=['./analyticExtractedReport.controller','get','index','/:id','show','isAuthenticated','download','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa92146,_0x57b211){var _0x4687b9=function(_0x1ad2a6){while(--_0x1ad2a6){_0xa92146['push'](_0xa92146['shift']());}};_0x4687b9(++_0x57b211);}(_0x8c54,0x1aa));var _0x48c5=function(_0x35fb77,_0x55d93c){_0x35fb77=_0x35fb77-0x0;var _0x40a168=_0x8c54[_0x35fb77];return _0x40a168;};'use strict';var multer=require(_0x48c5('0x0'));var util=require(_0x48c5('0x1'));var path=require('path');var timeout=require(_0x48c5('0x2'));var express=require(_0x48c5('0x3'));var router=express[_0x48c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48c5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x48c5('0x6'));router[_0x48c5('0x7')]('/',auth['isAuthenticated'](),controller[_0x48c5('0x8')]);router['get'](_0x48c5('0x9'),auth['isAuthenticated'](),controller[_0x48c5('0xa')]);router[_0x48c5('0x7')]('/:id/download',auth[_0x48c5('0xb')](),controller[_0x48c5('0xc')]);router[_0x48c5('0xd')]('/',auth[_0x48c5('0xb')](),controller[_0x48c5('0xe')]);router['put'](_0x48c5('0x9'),auth[_0x48c5('0xb')](),controller[_0x48c5('0xf')]);router['delete']('/:id',auth[_0x48c5('0xb')](),controller[_0x48c5('0x10')]);module[_0x48c5('0x11')]=router; \ No newline at end of file +var _0x23fb=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','post','create','update','delete','destroy','exports','util','path'];(function(_0x41d34b,_0x4cd7d4){var _0x48b69f=function(_0xf63636){while(--_0xf63636){_0x41d34b['push'](_0x41d34b['shift']());}};_0x48b69f(++_0x4cd7d4);}(_0x23fb,0x18e));var _0xb23f=function(_0xcb7bc6,_0x2bed38){_0xcb7bc6=_0xcb7bc6-0x0;var _0x1c678e=_0x23fb[_0xcb7bc6];return _0x1c678e;};'use strict';var multer=require('multer');var util=require(_0xb23f('0x0'));var path=require(_0xb23f('0x1'));var timeout=require(_0xb23f('0x2'));var express=require(_0xb23f('0x3'));var router=express['Router']();var fs_extra=require(_0xb23f('0x4'));var auth=require(_0xb23f('0x5'));var interaction=require(_0xb23f('0x6'));var config=require(_0xb23f('0x7'));var controller=require(_0xb23f('0x8'));router[_0xb23f('0x9')]('/',auth[_0xb23f('0xa')](),controller[_0xb23f('0xb')]);router['get'](_0xb23f('0xc'),auth[_0xb23f('0xa')](),controller['show']);router[_0xb23f('0x9')](_0xb23f('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xb23f('0xe')]('/',auth['isAuthenticated'](),controller[_0xb23f('0xf')]);router['put']('/:id',auth[_0xb23f('0xa')](),controller[_0xb23f('0x10')]);router[_0xb23f('0x11')](_0xb23f('0xc'),auth['isAuthenticated'](),controller[_0xb23f('0x12')]);module[_0xb23f('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 119e234..94d5da7 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 _0xf1a9=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xf1a9,0x1c2));var _0x9f1a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf1a9[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x9f1a('0x0'));module[_0x9f1a('0x1')]={'field':{'type':Sequelize[_0x9f1a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x9f1a('0x3')]},'groupBy':{'type':Sequelize[_0x9f1a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9f1a('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x776a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0x776a,0x146));var _0xa776=function(_0x2b7454,_0x230822){_0x2b7454=_0x2b7454-0x0;var _0x32e68e=_0x776a[_0x2b7454];return _0x32e68e;};'use strict';var Sequelize=require(_0xa776('0x0'));module[_0xa776('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa776('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xa776('0x2')]},'groupBy':{'type':Sequelize[_0xa776('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa776('0x2')]},'custom':{'type':Sequelize[_0xa776('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0b9ea66..c481870 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 _0x1a6d=['VIRTUAL','options','include','rows','catch','show','keys','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1a6d,0x1b0));var _0xd1a6=function(_0x52afdf,_0x440409){_0x52afdf=_0x52afdf-0x0;var _0x272f80=_0x1a6d[_0x52afdf];return _0x272f80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd1a6('0x0'));var jsonpatch=require(_0xd1a6('0x1'));var rp=require(_0xd1a6('0x2'));var moment=require(_0xd1a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd1a6('0x4'));var util=require(_0xd1a6('0x5'));var path=require(_0xd1a6('0x6'));var sox=require(_0xd1a6('0x7'));var csv=require('to-csv');var ejs=require(_0xd1a6('0x8'));var fs=require('fs');var fs_extra=require(_0xd1a6('0x9'));var _=require('lodash');var squel=require(_0xd1a6('0xa'));var crypto=require(_0xd1a6('0xb'));var jsforce=require(_0xd1a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd1a6('0xd'));var querystring=require(_0xd1a6('0xe'));var Papa=require(_0xd1a6('0xf'));var Redis=require(_0xd1a6('0x10'));var authService=require(_0xd1a6('0x11'));var qs=require(_0xd1a6('0x12'));var as=require(_0xd1a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1a6('0x14'))(_0xd1a6('0x15'));var utils=require(_0xd1a6('0x16'));var config=require(_0xd1a6('0x17'));var licenseUtil=require(_0xd1a6('0x18'));var db=require(_0xd1a6('0x19'))['db'];function respondWithStatusCode(_0x5004ca,_0xa77dc2){_0xa77dc2=_0xa77dc2||0xcc;return function(_0x179ff5){if(_0x179ff5){return _0x5004ca[_0xd1a6('0x1a')](_0xa77dc2);}return _0x5004ca[_0xd1a6('0x1b')](_0xa77dc2)[_0xd1a6('0x1c')]();};}function respondWithResult(_0xd178fa,_0x1a4b94){_0x1a4b94=_0x1a4b94||0xc8;return function(_0x249311){if(_0x249311){return _0xd178fa[_0xd1a6('0x1b')](_0x1a4b94)['json'](_0x249311);}};}function respondWithFilteredResult(_0x5ca4cc,_0x186bcc){return function(_0x47bba0){if(_0x47bba0){var _0x27edac=typeof _0x186bcc['offset']==='undefined'&&typeof _0x186bcc[_0xd1a6('0x1d')]===_0xd1a6('0x1e');var _0x29112e=_0x47bba0[_0xd1a6('0x1f')];var _0x4a87ff=_0x27edac?0x0:_0x186bcc[_0xd1a6('0x20')];var _0x45fd4f=_0x27edac?_0x47bba0['count']:_0x186bcc[_0xd1a6('0x20')]+_0x186bcc[_0xd1a6('0x1d')];var _0x45018b;if(_0x45fd4f>=_0x29112e){_0x45fd4f=_0x29112e;_0x45018b=0xc8;}else{_0x45018b=0xce;}_0x5ca4cc['status'](_0x45018b);return _0x5ca4cc[_0xd1a6('0x21')](_0xd1a6('0x22'),_0x4a87ff+'-'+_0x45fd4f+'/'+_0x29112e)[_0xd1a6('0x23')](_0x47bba0);}return null;};}function patchUpdates(_0x3ad79d){return function(_0x15c85){try{jsonpatch['apply'](_0x15c85,_0x3ad79d,!![]);}catch(_0x27328c){return BPromise[_0xd1a6('0x24')](_0x27328c);}return _0x15c85[_0xd1a6('0x25')]();};}function saveUpdates(_0x385571,_0x20ebe2){return function(_0x2c510a){if(_0x2c510a){return _0x2c510a[_0xd1a6('0x26')](_0x385571)['then'](function(_0x35b96a){return _0x35b96a;});}return null;};}function removeEntity(_0x4d625b,_0x27efa1){return function(_0x2dc3ed){if(_0x2dc3ed){return _0x2dc3ed[_0xd1a6('0x27')]()[_0xd1a6('0x28')](function(){_0x4d625b[_0xd1a6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad950,_0x2713b4){return function(_0x659511){if(!_0x659511){_0x3ad950[_0xd1a6('0x1a')](0x194);}return _0x659511;};}function handleError(_0x1108ee,_0x62748d){_0x62748d=_0x62748d||0x1f4;return function(_0x55b77d){logger[_0xd1a6('0x29')](_0x55b77d[_0xd1a6('0x2a')]);if(_0x55b77d['name']){delete _0x55b77d[_0xd1a6('0x2b')];}_0x1108ee[_0xd1a6('0x1b')](_0x62748d)[_0xd1a6('0x2c')](_0x55b77d);};}exports[_0xd1a6('0x2d')]=function(_0x4cc346,_0x21aea6){var _0x53946b={},_0x21a43a={},_0x3d56a9={'count':0x0,'rows':[]};var _0x31153f=_[_0xd1a6('0x2e')](db[_0xd1a6('0x2f')][_0xd1a6('0x30')],function(_0x172c7a){return{'name':_0x172c7a[_0xd1a6('0x31')],'type':_0x172c7a[_0xd1a6('0x32')][_0xd1a6('0x33')]};});_0x21a43a[_0xd1a6('0x34')]=_[_0xd1a6('0x2e')](_0x31153f,'name');_0x21a43a[_0xd1a6('0x35')]=_['keys'](_0x4cc346[_0xd1a6('0x35')]);_0x21a43a[_0xd1a6('0x36')]=_[_0xd1a6('0x37')](_0x21a43a[_0xd1a6('0x34')],_0x21a43a['query']);_0x53946b[_0xd1a6('0x38')]=_['intersection'](_0x21a43a[_0xd1a6('0x34')],qs[_0xd1a6('0x39')](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x39')]));_0x53946b[_0xd1a6('0x38')]=_0x53946b[_0xd1a6('0x38')][_0xd1a6('0x3a')]?_0x53946b['attributes']:_0x21a43a[_0xd1a6('0x34')];if(!_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x3b')](_0xd1a6('0x3c'))){_0x53946b[_0xd1a6('0x1d')]=qs[_0xd1a6('0x1d')](_0x4cc346[_0xd1a6('0x35')]['limit']);_0x53946b['offset']=qs['offset'](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x20')]);}_0x53946b[_0xd1a6('0x3d')]=qs[_0xd1a6('0x3e')](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x3e')]);_0x53946b[_0xd1a6('0x3f')]=qs[_0xd1a6('0x36')](_['pick'](_0x4cc346[_0xd1a6('0x35')],_0x21a43a[_0xd1a6('0x36')]),_0x31153f);if(_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x40')]){_0x53946b[_0xd1a6('0x3f')]=_[_0xd1a6('0x41')](_0x53946b[_0xd1a6('0x3f')],{'$or':_['map'](_0x31153f,function(_0x9b0729){if(_0x9b0729[_0xd1a6('0x32')]!==_0xd1a6('0x42')){var _0x294b2c={};_0x294b2c[_0x9b0729[_0xd1a6('0x2b')]]={'$like':'%'+_0x4cc346['query'][_0xd1a6('0x40')]+'%'};return _0x294b2c;}})});}_0x53946b=_['merge']({},_0x53946b,_0x4cc346[_0xd1a6('0x43')]);var _0x58bbf4={'where':_0x53946b[_0xd1a6('0x3f')]};return db[_0xd1a6('0x2f')][_0xd1a6('0x1f')](_0x58bbf4)[_0xd1a6('0x28')](function(_0x4dc2b6){_0x3d56a9[_0xd1a6('0x1f')]=_0x4dc2b6;if(_0x4cc346[_0xd1a6('0x35')]['includeAll']){_0x53946b[_0xd1a6('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x53946b);})[_0xd1a6('0x28')](function(_0x4f3549){_0x3d56a9[_0xd1a6('0x45')]=_0x4f3549;return _0x3d56a9;})[_0xd1a6('0x28')](respondWithFilteredResult(_0x21aea6,_0x53946b))[_0xd1a6('0x46')](handleError(_0x21aea6,null));};exports[_0xd1a6('0x47')]=function(_0x4f125d,_0x4461ea){var _0x369f12={'raw':![],'where':{'id':_0x4f125d['params']['id']}},_0x5e5a99={};_0x5e5a99[_0xd1a6('0x34')]=_[_0xd1a6('0x48')](db[_0xd1a6('0x2f')]['rawAttributes']);_0x5e5a99[_0xd1a6('0x35')]=_[_0xd1a6('0x48')](_0x4f125d[_0xd1a6('0x35')]);_0x5e5a99[_0xd1a6('0x36')]=_['intersection'](_0x5e5a99[_0xd1a6('0x34')],_0x5e5a99[_0xd1a6('0x35')]);_0x369f12[_0xd1a6('0x38')]=_[_0xd1a6('0x37')](_0x5e5a99[_0xd1a6('0x34')],qs[_0xd1a6('0x39')](_0x4f125d[_0xd1a6('0x35')][_0xd1a6('0x39')]));_0x369f12['attributes']=_0x369f12['attributes'][_0xd1a6('0x3a')]?_0x369f12[_0xd1a6('0x38')]:_0x5e5a99[_0xd1a6('0x34')];if(_0x4f125d[_0xd1a6('0x35')]['includeAll']){_0x369f12[_0xd1a6('0x44')]=[{'all':!![]}];}_0x369f12=_[_0xd1a6('0x41')]({},_0x369f12,_0x4f125d[_0xd1a6('0x43')]);return db[_0xd1a6('0x2f')]['find'](_0x369f12)['then'](handleEntityNotFound(_0x4461ea,null))[_0xd1a6('0x28')](respondWithResult(_0x4461ea,null))[_0xd1a6('0x46')](handleError(_0x4461ea,null));};exports[_0xd1a6('0x49')]=function(_0x63bd26,_0x1dcf5b){return db[_0xd1a6('0x2f')][_0xd1a6('0x49')](_0x63bd26[_0xd1a6('0x4a')],{})[_0xd1a6('0x28')](respondWithResult(_0x1dcf5b,0xc9))[_0xd1a6('0x46')](handleError(_0x1dcf5b,null));};exports[_0xd1a6('0x4b')]=function(_0x3dbfa8,_0x5878f6){return db[_0xd1a6('0x2f')][_0xd1a6('0x4b')](_0x3dbfa8[_0xd1a6('0x4a')],{'raw':![],'individualHooks':!![]})[_0xd1a6('0x28')](respondWithResult(_0x5878f6,0xc9))['catch'](handleError(_0x5878f6,null));};exports[_0xd1a6('0x26')]=function(_0x53600b,_0x42b1ec){if(_0x53600b[_0xd1a6('0x4a')]['id']){delete _0x53600b[_0xd1a6('0x4a')]['id'];}return db[_0xd1a6('0x2f')]['find']({'where':{'id':_0x53600b[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x42b1ec,null))[_0xd1a6('0x28')](saveUpdates(_0x53600b[_0xd1a6('0x4a')],null))['then'](respondWithResult(_0x42b1ec,null))[_0xd1a6('0x46')](handleError(_0x42b1ec,null));};exports[_0xd1a6('0x27')]=function(_0x4bb6d5,_0x348d27){return db[_0xd1a6('0x2f')]['find']({'where':{'id':_0x4bb6d5[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x348d27,null))[_0xd1a6('0x28')](removeEntity(_0x348d27,null))[_0xd1a6('0x46')](handleError(_0x348d27,null));};exports[_0xd1a6('0x4d')]=function(_0x4b3a00,_0x44dafd){return db['AnalyticFieldReport'][_0xd1a6('0x27')]({'where':{'id':_0x4b3a00[_0xd1a6('0x35')][_0xd1a6('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44dafd,0xcc))[_0xd1a6('0x46')](handleError(_0x44dafd,null));};exports[_0xd1a6('0x4f')]=function(_0x2f5416,_0x3a0993,_0x4eeb4b){return db[_0xd1a6('0x50')]['findOne']({'where':{'id':_0x2f5416[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x3a0993,null))['then'](function(_0x292d53){if(_0x292d53){return db['sequelize']['transaction'](function(_0x54fd68){return db[_0xd1a6('0x2f')]['destroy']({'where':{'CustomReportId':_0x2f5416['params']['id']},'transaction':_0x54fd68})[_0xd1a6('0x28')](function(_0x2f34b5){var _0x28cb49=_[_0xd1a6('0x2e')](_0x2f5416[_0xd1a6('0x4a')],function(_0x583669){delete _0x583669['id'];_0x583669[_0xd1a6('0x51')]=_0x2f5416[_0xd1a6('0x4c')]['id'];return _0x583669;});return db[_0xd1a6('0x2f')][_0xd1a6('0x4b')](_0x28cb49,{'transaction':_0x54fd68});});})['then'](function(){return db['AnalyticFieldReport'][_0xd1a6('0x52')]({'where':{'CustomReportId':_0x2f5416[_0xd1a6('0x4c')]['id']}});});}})['then'](respondWithResult(_0x3a0993,null))[_0xd1a6('0x46')](handleError(_0x3a0993,null));}; \ No newline at end of file +var _0xf7eb=['fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','findAll','show','params','includeAll','include','create','body','bulkCreate','catch','update','find','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir'];(function(_0x75bc4b,_0x569fe6){var _0x4852ee=function(_0x419a86){while(--_0x419a86){_0x75bc4b['push'](_0x75bc4b['shift']());}};_0x4852ee(++_0x569fe6);}(_0xf7eb,0x13a));var _0xbf7e=function(_0x5a253a,_0x42e412){_0x5a253a=_0x5a253a-0x0;var _0x3835f3=_0xf7eb[_0x5a253a];return _0x3835f3;};'use strict';var emlformat=require(_0xbf7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf7e('0x1'));var jsonpatch=require(_0xbf7e('0x2'));var rp=require('request-promise');var moment=require(_0xbf7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf7e('0x4'));var util=require(_0xbf7e('0x5'));var path=require('path');var sox=require(_0xbf7e('0x6'));var csv=require('to-csv');var ejs=require(_0xbf7e('0x7'));var fs=require('fs');var fs_extra=require(_0xbf7e('0x8'));var _=require(_0xbf7e('0x9'));var squel=require(_0xbf7e('0xa'));var crypto=require(_0xbf7e('0xb'));var jsforce=require(_0xbf7e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbf7e('0xd'));var querystring=require(_0xbf7e('0xe'));var Papa=require(_0xbf7e('0xf'));var Redis=require(_0xbf7e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf7e('0x11'));var as=require(_0xbf7e('0x12'));var hardwareService=require(_0xbf7e('0x13'));var logger=require(_0xbf7e('0x14'))(_0xbf7e('0x15'));var utils=require('../../config/utils');var config=require(_0xbf7e('0x16'));var licenseUtil=require(_0xbf7e('0x17'));var db=require(_0xbf7e('0x18'))['db'];function respondWithStatusCode(_0x159c8f,_0x141dd6){_0x141dd6=_0x141dd6||0xcc;return function(_0x265f28){if(_0x265f28){return _0x159c8f[_0xbf7e('0x19')](_0x141dd6);}return _0x159c8f[_0xbf7e('0x1a')](_0x141dd6)[_0xbf7e('0x1b')]();};}function respondWithResult(_0x5ec433,_0x3a699c){_0x3a699c=_0x3a699c||0xc8;return function(_0x4b021a){if(_0x4b021a){return _0x5ec433[_0xbf7e('0x1a')](_0x3a699c)[_0xbf7e('0x1c')](_0x4b021a);}};}function respondWithFilteredResult(_0x4f0536,_0x4938c7){return function(_0x7a6ec){if(_0x7a6ec){var _0x8bfc6b=typeof _0x4938c7[_0xbf7e('0x1d')]===_0xbf7e('0x1e')&&typeof _0x4938c7[_0xbf7e('0x1f')]===_0xbf7e('0x1e');var _0x189de4=_0x7a6ec['count'];var _0x303886=_0x8bfc6b?0x0:_0x4938c7[_0xbf7e('0x1d')];var _0x23d0a1=_0x8bfc6b?_0x7a6ec['count']:_0x4938c7[_0xbf7e('0x1d')]+_0x4938c7[_0xbf7e('0x1f')];var _0x4a88ca;if(_0x23d0a1>=_0x189de4){_0x23d0a1=_0x189de4;_0x4a88ca=0xc8;}else{_0x4a88ca=0xce;}_0x4f0536['status'](_0x4a88ca);return _0x4f0536[_0xbf7e('0x20')]('Content-Range',_0x303886+'-'+_0x23d0a1+'/'+_0x189de4)['json'](_0x7a6ec);}return null;};}function patchUpdates(_0x59df89){return function(_0x190018){try{jsonpatch[_0xbf7e('0x21')](_0x190018,_0x59df89,!![]);}catch(_0x151c38){return BPromise[_0xbf7e('0x22')](_0x151c38);}return _0x190018[_0xbf7e('0x23')]();};}function saveUpdates(_0x227e6b,_0x8e5976){return function(_0x765108){if(_0x765108){return _0x765108['update'](_0x227e6b)[_0xbf7e('0x24')](function(_0x5771b5){return _0x5771b5;});}return null;};}function removeEntity(_0x4e29d5,_0x26d691){return function(_0x2fc852){if(_0x2fc852){return _0x2fc852[_0xbf7e('0x25')]()[_0xbf7e('0x24')](function(){_0x4e29d5[_0xbf7e('0x1a')](0xcc)[_0xbf7e('0x1b')]();});}};}function handleEntityNotFound(_0x2e1b5,_0x4340dd){return function(_0x42add3){if(!_0x42add3){_0x2e1b5[_0xbf7e('0x19')](0x194);}return _0x42add3;};}function handleError(_0x2d4df7,_0x3abe39){_0x3abe39=_0x3abe39||0x1f4;return function(_0x37fc98){logger[_0xbf7e('0x26')](_0x37fc98[_0xbf7e('0x27')]);if(_0x37fc98[_0xbf7e('0x28')]){delete _0x37fc98[_0xbf7e('0x28')];}_0x2d4df7[_0xbf7e('0x1a')](_0x3abe39)[_0xbf7e('0x29')](_0x37fc98);};}exports[_0xbf7e('0x2a')]=function(_0x4c9e09,_0x268e6c){var _0x5a06ff={},_0x10d572={},_0x2bbfd6={'count':0x0,'rows':[]};var _0x185885=_['map'](db[_0xbf7e('0x2b')][_0xbf7e('0x2c')],function(_0x108670){return{'name':_0x108670[_0xbf7e('0x2d')],'type':_0x108670[_0xbf7e('0x2e')]['key']};});_0x10d572[_0xbf7e('0x2f')]=_['map'](_0x185885,_0xbf7e('0x28'));_0x10d572[_0xbf7e('0x30')]=_[_0xbf7e('0x31')](_0x4c9e09[_0xbf7e('0x30')]);_0x10d572['filters']=_[_0xbf7e('0x32')](_0x10d572[_0xbf7e('0x2f')],_0x10d572[_0xbf7e('0x30')]);_0x5a06ff[_0xbf7e('0x33')]=_[_0xbf7e('0x32')](_0x10d572[_0xbf7e('0x2f')],qs['fields'](_0x4c9e09['query'][_0xbf7e('0x34')]));_0x5a06ff[_0xbf7e('0x33')]=_0x5a06ff[_0xbf7e('0x33')][_0xbf7e('0x35')]?_0x5a06ff['attributes']:_0x10d572[_0xbf7e('0x2f')];if(!_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x36')](_0xbf7e('0x37'))){_0x5a06ff[_0xbf7e('0x1f')]=qs[_0xbf7e('0x1f')](_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x1f')]);_0x5a06ff[_0xbf7e('0x1d')]=qs[_0xbf7e('0x1d')](_0x4c9e09[_0xbf7e('0x30')]['offset']);}_0x5a06ff['order']=qs[_0xbf7e('0x38')](_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x38')]);_0x5a06ff['where']=qs[_0xbf7e('0x39')](_[_0xbf7e('0x3a')](_0x4c9e09['query'],_0x10d572[_0xbf7e('0x39')]),_0x185885);if(_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x3b')]){_0x5a06ff[_0xbf7e('0x3c')]=_[_0xbf7e('0x3d')](_0x5a06ff[_0xbf7e('0x3c')],{'$or':_[_0xbf7e('0x3e')](_0x185885,function(_0x4285d5){if(_0x4285d5['type']!==_0xbf7e('0x3f')){var _0x3bc3d5={};_0x3bc3d5[_0x4285d5[_0xbf7e('0x28')]]={'$like':'%'+_0x4c9e09['query'][_0xbf7e('0x3b')]+'%'};return _0x3bc3d5;}})});}_0x5a06ff=_[_0xbf7e('0x3d')]({},_0x5a06ff,_0x4c9e09[_0xbf7e('0x40')]);var _0x2810d2={'where':_0x5a06ff['where']};return db[_0xbf7e('0x2b')]['count'](_0x2810d2)['then'](function(_0xe0be0b){_0x2bbfd6['count']=_0xe0be0b;if(_0x4c9e09[_0xbf7e('0x30')]['includeAll']){_0x5a06ff['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xbf7e('0x41')](_0x5a06ff);})[_0xbf7e('0x24')](function(_0x2e5c24){_0x2bbfd6['rows']=_0x2e5c24;return _0x2bbfd6;})[_0xbf7e('0x24')](respondWithFilteredResult(_0x268e6c,_0x5a06ff))['catch'](handleError(_0x268e6c,null));};exports[_0xbf7e('0x42')]=function(_0x281571,_0x317b98){var _0x38ad44={'raw':![],'where':{'id':_0x281571[_0xbf7e('0x43')]['id']}},_0x96c11c={};_0x96c11c[_0xbf7e('0x2f')]=_[_0xbf7e('0x31')](db[_0xbf7e('0x2b')][_0xbf7e('0x2c')]);_0x96c11c['query']=_['keys'](_0x281571[_0xbf7e('0x30')]);_0x96c11c[_0xbf7e('0x39')]=_[_0xbf7e('0x32')](_0x96c11c[_0xbf7e('0x2f')],_0x96c11c[_0xbf7e('0x30')]);_0x38ad44['attributes']=_[_0xbf7e('0x32')](_0x96c11c[_0xbf7e('0x2f')],qs[_0xbf7e('0x34')](_0x281571[_0xbf7e('0x30')][_0xbf7e('0x34')]));_0x38ad44[_0xbf7e('0x33')]=_0x38ad44[_0xbf7e('0x33')][_0xbf7e('0x35')]?_0x38ad44[_0xbf7e('0x33')]:_0x96c11c[_0xbf7e('0x2f')];if(_0x281571[_0xbf7e('0x30')][_0xbf7e('0x44')]){_0x38ad44[_0xbf7e('0x45')]=[{'all':!![]}];}_0x38ad44=_['merge']({},_0x38ad44,_0x281571[_0xbf7e('0x40')]);return db[_0xbf7e('0x2b')]['find'](_0x38ad44)['then'](handleEntityNotFound(_0x317b98,null))[_0xbf7e('0x24')](respondWithResult(_0x317b98,null))['catch'](handleError(_0x317b98,null));};exports['create']=function(_0x1219c2,_0x4a31d9){return db[_0xbf7e('0x2b')][_0xbf7e('0x46')](_0x1219c2[_0xbf7e('0x47')],{})['then'](respondWithResult(_0x4a31d9,0xc9))['catch'](handleError(_0x4a31d9,null));};exports[_0xbf7e('0x48')]=function(_0x3d8cb4,_0x45ef7a){return db[_0xbf7e('0x2b')][_0xbf7e('0x48')](_0x3d8cb4[_0xbf7e('0x47')],{'raw':![],'individualHooks':!![]})[_0xbf7e('0x24')](respondWithResult(_0x45ef7a,0xc9))[_0xbf7e('0x49')](handleError(_0x45ef7a,null));};exports[_0xbf7e('0x4a')]=function(_0x220f57,_0x396a91){if(_0x220f57[_0xbf7e('0x47')]['id']){delete _0x220f57['body']['id'];}return db[_0xbf7e('0x2b')][_0xbf7e('0x4b')]({'where':{'id':_0x220f57[_0xbf7e('0x43')]['id']}})['then'](handleEntityNotFound(_0x396a91,null))[_0xbf7e('0x24')](saveUpdates(_0x220f57['body'],null))[_0xbf7e('0x24')](respondWithResult(_0x396a91,null))[_0xbf7e('0x49')](handleError(_0x396a91,null));};exports[_0xbf7e('0x25')]=function(_0x53cbfc,_0x409ab0){return db[_0xbf7e('0x2b')]['find']({'where':{'id':_0x53cbfc[_0xbf7e('0x43')]['id']}})['then'](handleEntityNotFound(_0x409ab0,null))[_0xbf7e('0x24')](removeEntity(_0x409ab0,null))[_0xbf7e('0x49')](handleError(_0x409ab0,null));};exports['bulkDestroy']=function(_0x3a3eb4,_0x1e2399){return db[_0xbf7e('0x2b')][_0xbf7e('0x25')]({'where':{'id':_0x3a3eb4['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1e2399,0xcc))['catch'](handleError(_0x1e2399,null));};exports['addFields']=function(_0x5dde5a,_0x2d11f9,_0x1c05f3){return db[_0xbf7e('0x4c')]['findOne']({'where':{'id':_0x5dde5a['params']['id']}})[_0xbf7e('0x24')](handleEntityNotFound(_0x2d11f9,null))[_0xbf7e('0x24')](function(_0x274c74){if(_0x274c74){return db[_0xbf7e('0x4d')][_0xbf7e('0x4e')](function(_0x15c3c2){return db[_0xbf7e('0x2b')]['destroy']({'where':{'CustomReportId':_0x5dde5a[_0xbf7e('0x43')]['id']},'transaction':_0x15c3c2})[_0xbf7e('0x24')](function(_0x57b8fa){var _0x61566d=_[_0xbf7e('0x3e')](_0x5dde5a[_0xbf7e('0x47')],function(_0x52a57d){delete _0x52a57d['id'];_0x52a57d['CustomReportId']=_0x5dde5a[_0xbf7e('0x43')]['id'];return _0x52a57d;});return db[_0xbf7e('0x2b')][_0xbf7e('0x48')](_0x61566d,{'transaction':_0x15c3c2});});})[_0xbf7e('0x24')](function(){return db[_0xbf7e('0x2b')][_0xbf7e('0x41')]({'where':{'CustomReportId':_0x5dde5a['params']['id']}});});}})['then'](respondWithResult(_0x2d11f9,null))[_0xbf7e('0x49')](handleError(_0x2d11f9,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1c794bc..8ba856c 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 _0x0834=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','api','moment','bluebird'];(function(_0x1d90ef,_0x39ab6d){var _0x554777=function(_0x949d06){while(--_0x949d06){_0x1d90ef['push'](_0x1d90ef['shift']());}};_0x554777(++_0x39ab6d);}(_0x0834,0x1e8));var _0x4083=function(_0x5a98b8,_0x2e9fea){_0x5a98b8=_0x5a98b8-0x0;var _0x8a89b6=_0x0834[_0x5a98b8];return _0x8a89b6;};'use strict';var _=require(_0x4083('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4083('0x1'));var moment=require(_0x4083('0x2'));var BPromise=require(_0x4083('0x3'));var rp=require(_0x4083('0x4'));var fs=require('fs');var path=require(_0x4083('0x5'));var rimraf=require(_0x4083('0x6'));var config=require(_0x4083('0x7'));var attributes=require(_0x4083('0x8'));module[_0x4083('0x9')]=function(_0x4eaf7a,_0x8e45df){return _0x4eaf7a[_0x4083('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x4083('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x976b=['analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x976b,0x1ae));var _0xb976=function(_0x4ef921,_0x31cc9d){_0x4ef921=_0x4ef921-0x0;var _0x4766e1=_0x976b[_0x4ef921];return _0x4766e1;};'use strict';var _=require(_0xb976('0x0'));var util=require('util');var logger=require(_0xb976('0x1'))(_0xb976('0x2'));var moment=require(_0xb976('0x3'));var BPromise=require('bluebird');var rp=require(_0xb976('0x4'));var fs=require('fs');var path=require(_0xb976('0x5'));var rimraf=require(_0xb976('0x6'));var config=require('../../config/environment');var attributes=require(_0xb976('0x7'));module[_0xb976('0x8')]=function(_0xae5804,_0x19f3f5){return _0xae5804[_0xb976('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xb976('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 ac512fd..2a96831 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 _0x9c43=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5cca84,_0x3889cd){var _0x129dad=function(_0x372687){while(--_0x372687){_0x5cca84['push'](_0x5cca84['shift']());}};_0x129dad(++_0x3889cd);}(_0x9c43,0x1ed));var _0x39c4=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x9c43[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x39c4('0x0'));var util=require(_0x39c4('0x1'));var moment=require('moment');var BPromise=require(_0x39c4('0x2'));var rs=require(_0x39c4('0x3'));var fs=require('fs');var Redis=require(_0x39c4('0x4'));var db=require(_0x39c4('0x5'))['db'];var utils=require(_0x39c4('0x6'));var logger=require('../../config/logger')(_0x39c4('0x7'));var config=require(_0x39c4('0x8'));var jayson=require(_0x39c4('0x9'));var client=jayson['client'][_0x39c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3caec5,_0x49ce86,_0x2883de){return new BPromise(function(_0x581531,_0x176d7c){return client[_0x39c4('0xb')](_0x3caec5,_0x2883de)[_0x39c4('0xc')](function(_0x25bb74){logger[_0x39c4('0xd')](_0x39c4('0xe'),_0x49ce86,_0x39c4('0xf'));logger[_0x39c4('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x49ce86,_0x39c4('0xf'),JSON[_0x39c4('0x11')](_0x25bb74));if(_0x25bb74[_0x39c4('0x12')]){if(_0x25bb74[_0x39c4('0x12')]['code']===0x1f4){logger[_0x39c4('0x12')](_0x39c4('0xe'),_0x49ce86,_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);return _0x176d7c(_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);}logger[_0x39c4('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49ce86,_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);return _0x581531(_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);}else{logger[_0x39c4('0xd')](_0x39c4('0xe'),_0x49ce86,_0x39c4('0xf'));_0x581531(_0x25bb74[_0x39c4('0x14')]['message']);}})['catch'](function(_0x765c49){logger[_0x39c4('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49ce86,_0x765c49);_0x176d7c(_0x765c49);});});} \ No newline at end of file +var _0x6fb6=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27d35e,_0x33598f){var _0x381848=function(_0x514d26){while(--_0x514d26){_0x27d35e['push'](_0x27d35e['shift']());}};_0x381848(++_0x33598f);}(_0x6fb6,0x139));var _0x66fb=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x6fb6[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x66fb('0x0'));var util=require(_0x66fb('0x1'));var moment=require(_0x66fb('0x2'));var BPromise=require(_0x66fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66fb('0x4'));var db=require(_0x66fb('0x5'))['db'];var utils=require(_0x66fb('0x6'));var logger=require(_0x66fb('0x7'))(_0x66fb('0x8'));var config=require(_0x66fb('0x9'));var jayson=require(_0x66fb('0xa'));var client=jayson[_0x66fb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2c77,_0x4bd6fe,_0x59d410){return new BPromise(function(_0xcafd5e,_0xcab0db){return client[_0x66fb('0xc')](_0x2a2c77,_0x59d410)[_0x66fb('0xd')](function(_0x211bf4){logger[_0x66fb('0xe')](_0x66fb('0xf'),_0x4bd6fe,_0x66fb('0x10'));logger[_0x66fb('0x11')](_0x66fb('0x12'),_0x4bd6fe,'request\x20sent',JSON[_0x66fb('0x13')](_0x211bf4));if(_0x211bf4[_0x66fb('0x14')]){if(_0x211bf4['error'][_0x66fb('0x15')]===0x1f4){logger[_0x66fb('0x14')](_0x66fb('0xf'),_0x4bd6fe,_0x211bf4['error']['message']);return _0xcab0db(_0x211bf4['error'][_0x66fb('0x16')]);}logger[_0x66fb('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4bd6fe,_0x211bf4[_0x66fb('0x14')][_0x66fb('0x16')]);return _0xcafd5e(_0x211bf4['error'][_0x66fb('0x16')]);}else{logger[_0x66fb('0xe')](_0x66fb('0xf'),_0x4bd6fe,_0x66fb('0x10'));_0xcafd5e(_0x211bf4[_0x66fb('0x17')][_0x66fb('0x16')]);}})[_0x66fb('0x18')](function(_0x1877cc){logger[_0x66fb('0x14')](_0x66fb('0xf'),_0x4bd6fe,_0x1877cc);_0xcab0db(_0x1877cc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 28f37b3..35d3fe9 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(_0x26b5af,_0x38291e){var _0x13dad4=function(_0x56117c){while(--_0x56117c){_0x26b5af['push'](_0x26b5af['shift']());}};_0x13dad4(++_0x38291e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x5cc96b,_0x45b46d){var _0x59e5ee=function(_0x5b0b7e){while(--_0x5b0b7e){_0x5cc96b['push'](_0x5cc96b['shift']());}};_0x59e5ee(++_0x45b46d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 59fc6c3..c0cd792 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 _0x8322=['sequelize','exports','STRING','name','TEXT'];(function(_0x27ba44,_0xa633a4){var _0x5c03dd=function(_0x423436){while(--_0x423436){_0x27ba44['push'](_0x27ba44['shift']());}};_0x5c03dd(++_0xa633a4);}(_0x8322,0x186));var _0x2832=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0x8322[_0x512f81];return _0xa15099;};'use strict';var Sequelize=require(_0x2832('0x0'));module[_0x2832('0x1')]={'name':{'type':Sequelize[_0x2832('0x2')],'allowNull':![],'unique':_0x2832('0x3')},'table':{'type':Sequelize[_0x2832('0x2')]},'metric':{'type':Sequelize[_0x2832('0x4')]},'description':{'type':Sequelize[_0x2832('0x2')]}}; \ No newline at end of file +var _0x705f=['TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x705f,0x75));var _0xf705=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0x705f[_0x22afd5];return _0x336ebc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf705('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf705('0x0')]},'metric':{'type':Sequelize[_0xf705('0x1')]},'description':{'type':Sequelize[_0xf705('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1ed6f06..7886bdf 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x98e685,_0x43260f){_0x98e685=_0x98e685-0x0;var _0x331b8e=_0x1cb9[_0x98e685];return _0x331b8e;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','sendStatus','end','status','json'];(function(_0x3a2823,_0x253aae){var _0x5d3133=function(_0x237caf){while(--_0x237caf){_0x3a2823['push'](_0x3a2823['shift']());}};_0x5d3133(++_0x253aae);}(_0xe5b3,0x133));var _0x3e5b=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0xe5b3[_0x310d10];return _0x1fb8af;};'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'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 310a7e2..67efdde 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 _0x8458=['analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x25a841,_0x222508){var _0x39be29=function(_0x3ec3d5){while(--_0x3ec3d5){_0x25a841['push'](_0x25a841['shift']());}};_0x39be29(++_0x222508);}(_0x8458,0x1a5));var _0x8845=function(_0x36d118,_0x19307b){_0x36d118=_0x36d118-0x0;var _0x5dddf0=_0x8458[_0x36d118];return _0x5dddf0;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var logger=require(_0x8845('0x1'))(_0x8845('0x2'));var moment=require(_0x8845('0x3'));var BPromise=require(_0x8845('0x4'));var rp=require(_0x8845('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8845('0x6'));var config=require(_0x8845('0x7'));var attributes=require(_0x8845('0x8'));module[_0x8845('0x9')]=function(_0x1bf1a1,_0x575470){return _0x1bf1a1[_0x8845('0xa')]('AnalyticMetric',attributes,{'tableName':_0x8845('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87d8=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment'];(function(_0x1fedc6,_0x4fe8a2){var _0x4edb67=function(_0x43cbec){while(--_0x43cbec){_0x1fedc6['push'](_0x1fedc6['shift']());}};_0x4edb67(++_0x4fe8a2);}(_0x87d8,0x1a9));var _0x887d=function(_0x2f6799,_0x4e7f00){_0x2f6799=_0x2f6799-0x0;var _0x3cb26f=_0x87d8[_0x2f6799];return _0x3cb26f;};'use strict';var _=require('lodash');var util=require(_0x887d('0x0'));var logger=require(_0x887d('0x1'))(_0x887d('0x2'));var moment=require(_0x887d('0x3'));var BPromise=require(_0x887d('0x4'));var rp=require(_0x887d('0x5'));var fs=require('fs');var path=require(_0x887d('0x6'));var rimraf=require(_0x887d('0x7'));var config=require(_0x887d('0x8'));var attributes=require(_0x887d('0x9'));module[_0x887d('0xa')]=function(_0x256742,_0x317a7){return _0x256742[_0x887d('0xb')](_0x887d('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 33e8903..decbb32 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 _0x2763=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x485cf5,_0x336a8b){var _0x276c0c=function(_0x203866){while(--_0x203866){_0x485cf5['push'](_0x485cf5['shift']());}};_0x276c0c(++_0x336a8b);}(_0x2763,0xe0));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3276('0x0'));var util=require(_0x3276('0x1'));var moment=require(_0x3276('0x2'));var BPromise=require(_0x3276('0x3'));var rs=require(_0x3276('0x4'));var fs=require('fs');var Redis=require(_0x3276('0x5'));var db=require(_0x3276('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3276('0x7'))(_0x3276('0x8'));var config=require(_0x3276('0x9'));var jayson=require(_0x3276('0xa'));var client=jayson[_0x3276('0xb')][_0x3276('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18e0c1,_0x26888a,_0xba9087){return new BPromise(function(_0x2972a5,_0x148ea3){return client['request'](_0x18e0c1,_0xba9087)[_0x3276('0xd')](function(_0x67e405){logger['info'](_0x3276('0xe'),_0x26888a,_0x3276('0xf'));logger[_0x3276('0x10')](_0x3276('0x11'),_0x26888a,_0x3276('0xf'),JSON[_0x3276('0x12')](_0x67e405));if(_0x67e405['error']){if(_0x67e405['error'][_0x3276('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x26888a,_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);return _0x148ea3(_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);}logger[_0x3276('0x14')](_0x3276('0xe'),_0x26888a,_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);return _0x2972a5(_0x67e405['error'][_0x3276('0x15')]);}else{logger[_0x3276('0x16')](_0x3276('0xe'),_0x26888a,_0x3276('0xf'));_0x2972a5(_0x67e405[_0x3276('0x17')][_0x3276('0x15')]);}})[_0x3276('0x18')](function(_0x23d1a8){logger[_0x3276('0x14')](_0x3276('0xe'),_0x26888a,_0x23d1a8);_0x148ea3(_0x23d1a8);});});} \ No newline at end of file +var _0x617c=['http','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5afff3,_0x41c270){var _0x492f48=function(_0x17f82e){while(--_0x17f82e){_0x5afff3['push'](_0x5afff3['shift']());}};_0x492f48(++_0x41c270);}(_0x617c,0x6c));var _0xc617=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x617c[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0xc617('0x0'));var util=require(_0xc617('0x1'));var moment=require(_0xc617('0x2'));var BPromise=require(_0xc617('0x3'));var rs=require(_0xc617('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc617('0x5'))['db'];var utils=require(_0xc617('0x6'));var logger=require(_0xc617('0x7'))(_0xc617('0x8'));var config=require(_0xc617('0x9'));var jayson=require(_0xc617('0xa'));var client=jayson[_0xc617('0xb')][_0xc617('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11240a,_0x5699ae,_0x2c824f){return new BPromise(function(_0x226013,_0x5e1543){return client[_0xc617('0xd')](_0x11240a,_0x2c824f)['then'](function(_0x351c9a){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5699ae,_0xc617('0xe'));logger['debug'](_0xc617('0xf'),_0x5699ae,_0xc617('0xe'),JSON[_0xc617('0x10')](_0x351c9a));if(_0x351c9a['error']){if(_0x351c9a['error'][_0xc617('0x11')]===0x1f4){logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x351c9a[_0xc617('0x12')][_0xc617('0x14')]);return _0x5e1543(_0x351c9a[_0xc617('0x12')]['message']);}logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x351c9a['error'][_0xc617('0x14')]);return _0x226013(_0x351c9a[_0xc617('0x12')][_0xc617('0x14')]);}else{logger[_0xc617('0x15')](_0xc617('0x13'),_0x5699ae,_0xc617('0xe'));_0x226013(_0x351c9a[_0xc617('0x16')][_0xc617('0x14')]);}})[_0xc617('0x17')](function(_0x1af5f9){logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x1af5f9);_0x5e1543(_0x1af5f9);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9e2e30f..4e9aed4 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 _0x960c=['/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','put'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x960c,0x113));var _0xc960=function(_0x990df1,_0x361825){_0x990df1=_0x990df1-0x0;var _0xf48f15=_0x960c[_0x990df1];return _0xf48f15;};'use strict';var multer=require(_0xc960('0x0'));var util=require('util');var path=require(_0xc960('0x1'));var timeout=require('connect-timeout');var express=require(_0xc960('0x2'));var router=express[_0xc960('0x3')]();var fs_extra=require(_0xc960('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc960('0x5'));var config=require(_0xc960('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc960('0x7')](),controller[_0xc960('0x8')]);router[_0xc960('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc960('0xa')]);router[_0xc960('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc960('0xc')](_0xc960('0xd'),auth[_0xc960('0x7')](),controller[_0xc960('0xe')]);router[_0xc960('0xf')]('/:id',auth[_0xc960('0x7')](),controller[_0xc960('0x10')]);module[_0xc960('0x11')]=router; \ No newline at end of file +var _0x9a6b=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0xb70791,_0x1d91d6){var _0x48f939=function(_0x591c48){while(--_0x591c48){_0xb70791['push'](_0xb70791['shift']());}};_0x48f939(++_0x1d91d6);}(_0x9a6b,0x77));var _0xb9a6=function(_0x33536e,_0x31bde3){_0x33536e=_0x33536e-0x0;var _0x4c699e=_0x9a6b[_0x33536e];return _0x4c699e;};'use strict';var multer=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var path=require(_0xb9a6('0x2'));var timeout=require(_0xb9a6('0x3'));var express=require(_0xb9a6('0x4'));var router=express[_0xb9a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb9a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb9a6('0x7'));var controller=require(_0xb9a6('0x8'));router[_0xb9a6('0x9')]('/',auth[_0xb9a6('0xa')](),controller[_0xb9a6('0xb')]);router[_0xb9a6('0x9')](_0xb9a6('0xc'),auth[_0xb9a6('0xa')](),controller[_0xb9a6('0xd')]);router[_0xb9a6('0xe')]('/',auth['isAuthenticated'](),controller[_0xb9a6('0xf')]);router[_0xb9a6('0x10')]('/:id',auth[_0xb9a6('0xa')](),controller[_0xb9a6('0x11')]);router[_0xb9a6('0x12')](_0xb9a6('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5934e4e..cb20bc1 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 _0x154b=['TEXT','sequelize','exports'];(function(_0x597049,_0x2351b3){var _0x542b6c=function(_0x5b2666){while(--_0x5b2666){_0x597049['push'](_0x597049['shift']());}};_0x542b6c(++_0x2351b3);}(_0x154b,0x169));var _0xb154=function(_0x2ef28d,_0x42cb2f){_0x2ef28d=_0x2ef28d-0x0;var _0x2c70f1=_0x154b[_0x2ef28d];return _0x2c70f1;};'use strict';var Sequelize=require(_0xb154('0x0'));module[_0xb154('0x1')]={'tree':{'type':Sequelize[_0xb154('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1e10=['sequelize','exports','TEXT'];(function(_0x451e57,_0x4ee9f7){var _0x3179f4=function(_0x2c6e74){while(--_0x2c6e74){_0x451e57['push'](_0x451e57['shift']());}};_0x3179f4(++_0x4ee9f7);}(_0x1e10,0x90));var _0x01e1=function(_0xf48693,_0x435864){_0xf48693=_0xf48693-0x0;var _0x1e009d=_0x1e10[_0xf48693];return _0x1e009d;};'use strict';var Sequelize=require(_0x01e1('0x0'));module[_0x01e1('0x1')]={'tree':{'type':Sequelize[_0x01e1('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 c89166e..3561248 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 _0xafc0=['key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','catch','keys','merge','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type'];(function(_0x4c6233,_0x12bc76){var _0x1949b4=function(_0x411000){while(--_0x411000){_0x4c6233['push'](_0x4c6233['shift']());}};_0x1949b4(++_0x12bc76);}(_0xafc0,0xf0));var _0x0afc=function(_0x56535f,_0x5d5cac){_0x56535f=_0x56535f-0x0;var _0x1857d9=_0xafc0[_0x56535f];return _0x1857d9;};'use strict';var emlformat=require(_0x0afc('0x0'));var rimraf=require(_0x0afc('0x1'));var zipdir=require(_0x0afc('0x2'));var jsonpatch=require(_0x0afc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0afc('0x4'));var Mustache=require(_0x0afc('0x5'));var util=require(_0x0afc('0x6'));var path=require(_0x0afc('0x7'));var sox=require('sox');var csv=require(_0x0afc('0x8'));var ejs=require(_0x0afc('0x9'));var fs=require('fs');var fs_extra=require(_0x0afc('0xa'));var _=require('lodash');var squel=require(_0x0afc('0xb'));var crypto=require(_0x0afc('0xc'));var jsforce=require(_0x0afc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0afc('0xe'));var Papa=require(_0x0afc('0xf'));var Redis=require(_0x0afc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0afc('0x11'));var as=require(_0x0afc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0afc('0x13'));var utils=require(_0x0afc('0x14'));var config=require(_0x0afc('0x15'));var licenseUtil=require(_0x0afc('0x16'));var db=require(_0x0afc('0x17'))['db'];function respondWithStatusCode(_0x3eee8c,_0xa51046){_0xa51046=_0xa51046||0xcc;return function(_0x2c58a8){if(_0x2c58a8){return _0x3eee8c['sendStatus'](_0xa51046);}return _0x3eee8c['status'](_0xa51046)[_0x0afc('0x18')]();};}function respondWithResult(_0x55f0cf,_0x2492ca){_0x2492ca=_0x2492ca||0xc8;return function(_0x14fc49){if(_0x14fc49){return _0x55f0cf[_0x0afc('0x19')](_0x2492ca)[_0x0afc('0x1a')](_0x14fc49);}};}function respondWithFilteredResult(_0x12e42b,_0x28fe9b){return function(_0x426e57){if(_0x426e57){var _0x14aad1=typeof _0x28fe9b[_0x0afc('0x1b')]===_0x0afc('0x1c')&&typeof _0x28fe9b[_0x0afc('0x1d')]===_0x0afc('0x1c');var _0x300246=_0x426e57[_0x0afc('0x1e')];var _0x16ecc8=_0x14aad1?0x0:_0x28fe9b['offset'];var _0xf9d112=_0x14aad1?_0x426e57[_0x0afc('0x1e')]:_0x28fe9b[_0x0afc('0x1b')]+_0x28fe9b['limit'];var _0x2afe54;if(_0xf9d112>=_0x300246){_0xf9d112=_0x300246;_0x2afe54=0xc8;}else{_0x2afe54=0xce;}_0x12e42b[_0x0afc('0x19')](_0x2afe54);return _0x12e42b[_0x0afc('0x1f')](_0x0afc('0x20'),_0x16ecc8+'-'+_0xf9d112+'/'+_0x300246)[_0x0afc('0x1a')](_0x426e57);}return null;};}function patchUpdates(_0x1b3305){return function(_0x49e51a){try{jsonpatch[_0x0afc('0x21')](_0x49e51a,_0x1b3305,!![]);}catch(_0x59c297){return BPromise['reject'](_0x59c297);}return _0x49e51a[_0x0afc('0x22')]();};}function saveUpdates(_0x3541f8,_0xebbe3d){return function(_0xd02b55){if(_0xd02b55){return _0xd02b55[_0x0afc('0x23')](_0x3541f8)[_0x0afc('0x24')](function(_0x1c7a63){return _0x1c7a63;});}return null;};}function removeEntity(_0x39e173,_0x64cde0){return function(_0x2d257b){if(_0x2d257b){return _0x2d257b[_0x0afc('0x25')]()[_0x0afc('0x24')](function(){_0x39e173[_0x0afc('0x19')](0xcc)[_0x0afc('0x18')]();});}};}function handleEntityNotFound(_0x59a970,_0x1db80b){return function(_0x18f8ea){if(!_0x18f8ea){_0x59a970[_0x0afc('0x26')](0x194);}return _0x18f8ea;};}function handleError(_0x4a5fc0,_0x2fac69){_0x2fac69=_0x2fac69||0x1f4;return function(_0x50bd60){logger['error'](_0x50bd60[_0x0afc('0x27')]);if(_0x50bd60[_0x0afc('0x28')]){delete _0x50bd60[_0x0afc('0x28')];}_0x4a5fc0[_0x0afc('0x19')](_0x2fac69)[_0x0afc('0x29')](_0x50bd60);};}exports[_0x0afc('0x2a')]=function(_0x4f7c23,_0x4ab489){var _0x1dfa24={},_0x7d5177={},_0x5576e0={'count':0x0,'rows':[]};var _0x2eb7d3=_[_0x0afc('0x2b')](db[_0x0afc('0x2c')][_0x0afc('0x2d')],function(_0x5e7a47){return{'name':_0x5e7a47[_0x0afc('0x2e')],'type':_0x5e7a47[_0x0afc('0x2f')][_0x0afc('0x30')]};});_0x7d5177[_0x0afc('0x31')]=_[_0x0afc('0x2b')](_0x2eb7d3,'name');_0x7d5177[_0x0afc('0x32')]=_['keys'](_0x4f7c23[_0x0afc('0x32')]);_0x7d5177[_0x0afc('0x33')]=_['intersection'](_0x7d5177[_0x0afc('0x31')],_0x7d5177['query']);_0x1dfa24[_0x0afc('0x34')]=_[_0x0afc('0x35')](_0x7d5177[_0x0afc('0x31')],qs[_0x0afc('0x36')](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x36')]));_0x1dfa24[_0x0afc('0x34')]=_0x1dfa24[_0x0afc('0x34')][_0x0afc('0x37')]?_0x1dfa24[_0x0afc('0x34')]:_0x7d5177[_0x0afc('0x31')];if(!_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x38')](_0x0afc('0x39'))){_0x1dfa24[_0x0afc('0x1d')]=qs['limit'](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x1d')]);_0x1dfa24['offset']=qs[_0x0afc('0x1b')](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x1b')]);}_0x1dfa24['order']=qs[_0x0afc('0x3a')](_0x4f7c23[_0x0afc('0x32')]['sort']);_0x1dfa24[_0x0afc('0x3b')]=qs[_0x0afc('0x33')](_[_0x0afc('0x3c')](_0x4f7c23['query'],_0x7d5177['filters']),_0x2eb7d3);if(_0x4f7c23['query'][_0x0afc('0x3d')]){_0x1dfa24['where']=_['merge'](_0x1dfa24['where'],{'$or':_[_0x0afc('0x2b')](_0x2eb7d3,function(_0x18ce5e){if(_0x18ce5e[_0x0afc('0x2f')]!==_0x0afc('0x3e')){var _0x588f45={};_0x588f45[_0x18ce5e[_0x0afc('0x28')]]={'$like':'%'+_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x3d')]+'%'};return _0x588f45;}})});}_0x1dfa24=_['merge']({},_0x1dfa24,_0x4f7c23[_0x0afc('0x3f')]);var _0x172c53={'where':_0x1dfa24[_0x0afc('0x3b')]};return db['AnalyticTreeReport'][_0x0afc('0x1e')](_0x172c53)[_0x0afc('0x24')](function(_0x377b35){_0x5576e0['count']=_0x377b35;if(_0x4f7c23['query'][_0x0afc('0x40')]){_0x1dfa24[_0x0afc('0x41')]=[{'all':!![]}];}return db[_0x0afc('0x2c')]['findAll'](_0x1dfa24);})[_0x0afc('0x24')](function(_0x18f549){_0x5576e0['rows']=_0x18f549;return _0x5576e0;})[_0x0afc('0x24')](respondWithFilteredResult(_0x4ab489,_0x1dfa24))[_0x0afc('0x42')](handleError(_0x4ab489,null));};exports['show']=function(_0x35da34,_0x265f4d){var _0x338bcd={'raw':!![],'where':{'id':_0x35da34['params']['id']}},_0xc27d89={};_0xc27d89[_0x0afc('0x31')]=_[_0x0afc('0x43')](db[_0x0afc('0x2c')][_0x0afc('0x2d')]);_0xc27d89[_0x0afc('0x32')]=_['keys'](_0x35da34[_0x0afc('0x32')]);_0xc27d89[_0x0afc('0x33')]=_[_0x0afc('0x35')](_0xc27d89[_0x0afc('0x31')],_0xc27d89[_0x0afc('0x32')]);_0x338bcd[_0x0afc('0x34')]=_[_0x0afc('0x35')](_0xc27d89[_0x0afc('0x31')],qs[_0x0afc('0x36')](_0x35da34[_0x0afc('0x32')][_0x0afc('0x36')]));_0x338bcd[_0x0afc('0x34')]=_0x338bcd[_0x0afc('0x34')][_0x0afc('0x37')]?_0x338bcd['attributes']:_0xc27d89['model'];if(_0x35da34['query'][_0x0afc('0x40')]){_0x338bcd[_0x0afc('0x41')]=[{'all':!![]}];}_0x338bcd=_[_0x0afc('0x44')]({},_0x338bcd,_0x35da34[_0x0afc('0x3f')]);return db['AnalyticTreeReport'][_0x0afc('0x45')](_0x338bcd)['then'](handleEntityNotFound(_0x265f4d,null))[_0x0afc('0x24')](respondWithResult(_0x265f4d,null))[_0x0afc('0x42')](handleError(_0x265f4d,null));};exports['create']=function(_0x222baa,_0x2d3d1e){return db['AnalyticTreeReport']['create'](_0x222baa[_0x0afc('0x46')],{})[_0x0afc('0x24')](respondWithResult(_0x2d3d1e,0xc9))[_0x0afc('0x42')](handleError(_0x2d3d1e,null));};exports[_0x0afc('0x23')]=function(_0x295743,_0x166409){if(_0x295743[_0x0afc('0x46')]['id']){delete _0x295743[_0x0afc('0x46')]['id'];}return db['AnalyticTreeReport'][_0x0afc('0x45')]({'where':{'id':_0x295743[_0x0afc('0x47')]['id']}})['then'](handleEntityNotFound(_0x166409,null))[_0x0afc('0x24')](saveUpdates(_0x295743[_0x0afc('0x46')],null))['then'](respondWithResult(_0x166409,null))['catch'](handleError(_0x166409,null));};exports[_0x0afc('0x25')]=function(_0x42575d,_0x54e023){return db[_0x0afc('0x2c')][_0x0afc('0x45')]({'where':{'id':_0x42575d[_0x0afc('0x47')]['id']}})[_0x0afc('0x24')](handleEntityNotFound(_0x54e023,null))[_0x0afc('0x24')](removeEntity(_0x54e023,null))[_0x0afc('0x42')](handleError(_0x54e023,null));}; \ No newline at end of file +var _0xa513=['limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4bde34,_0xaa7b76){var _0x57ef23=function(_0x371c99){while(--_0x371c99){_0x4bde34['push'](_0x4bde34['shift']());}};_0x57ef23(++_0xaa7b76);}(_0xa513,0x102));var _0x3a51=function(_0x5e5b6c,_0x29c663){_0x5e5b6c=_0x5e5b6c-0x0;var _0x40bf3c=_0xa513[_0x5e5b6c];return _0x40bf3c;};'use strict';var emlformat=require(_0x3a51('0x0'));var rimraf=require(_0x3a51('0x1'));var zipdir=require(_0x3a51('0x2'));var jsonpatch=require(_0x3a51('0x3'));var rp=require(_0x3a51('0x4'));var moment=require(_0x3a51('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3a51('0x6'));var path=require('path');var sox=require(_0x3a51('0x7'));var csv=require(_0x3a51('0x8'));var ejs=require(_0x3a51('0x9'));var fs=require('fs');var fs_extra=require(_0x3a51('0xa'));var _=require(_0x3a51('0xb'));var squel=require(_0x3a51('0xc'));var crypto=require(_0x3a51('0xd'));var jsforce=require(_0x3a51('0xe'));var deskjs=require(_0x3a51('0xf'));var toCsv=require(_0x3a51('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a51('0x10'));var authService=require(_0x3a51('0x11'));var qs=require(_0x3a51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a51('0x13'));var logger=require('../../config/logger')(_0x3a51('0x14'));var utils=require('../../config/utils');var config=require(_0x3a51('0x15'));var licenseUtil=require(_0x3a51('0x16'));var db=require(_0x3a51('0x17'))['db'];function respondWithStatusCode(_0x19f555,_0x48808a){_0x48808a=_0x48808a||0xcc;return function(_0x46f85c){if(_0x46f85c){return _0x19f555[_0x3a51('0x18')](_0x48808a);}return _0x19f555[_0x3a51('0x19')](_0x48808a)[_0x3a51('0x1a')]();};}function respondWithResult(_0x203333,_0x3462c2){_0x3462c2=_0x3462c2||0xc8;return function(_0x4eea17){if(_0x4eea17){return _0x203333['status'](_0x3462c2)[_0x3a51('0x1b')](_0x4eea17);}};}function respondWithFilteredResult(_0x2cde6e,_0x5955f6){return function(_0x3c0c88){if(_0x3c0c88){var _0x186b29=typeof _0x5955f6[_0x3a51('0x1c')]===_0x3a51('0x1d')&&typeof _0x5955f6[_0x3a51('0x1e')]===_0x3a51('0x1d');var _0x4df86e=_0x3c0c88[_0x3a51('0x1f')];var _0x58f64a=_0x186b29?0x0:_0x5955f6['offset'];var _0x457376=_0x186b29?_0x3c0c88[_0x3a51('0x1f')]:_0x5955f6[_0x3a51('0x1c')]+_0x5955f6['limit'];var _0x582c4c;if(_0x457376>=_0x4df86e){_0x457376=_0x4df86e;_0x582c4c=0xc8;}else{_0x582c4c=0xce;}_0x2cde6e[_0x3a51('0x19')](_0x582c4c);return _0x2cde6e[_0x3a51('0x20')](_0x3a51('0x21'),_0x58f64a+'-'+_0x457376+'/'+_0x4df86e)[_0x3a51('0x1b')](_0x3c0c88);}return null;};}function patchUpdates(_0x4bdc89){return function(_0x2924e3){try{jsonpatch['apply'](_0x2924e3,_0x4bdc89,!![]);}catch(_0x321845){return BPromise[_0x3a51('0x22')](_0x321845);}return _0x2924e3[_0x3a51('0x23')]();};}function saveUpdates(_0x429cff,_0x2e04b9){return function(_0x34a296){if(_0x34a296){return _0x34a296[_0x3a51('0x24')](_0x429cff)[_0x3a51('0x25')](function(_0x42542d){return _0x42542d;});}return null;};}function removeEntity(_0x32b191,_0x438388){return function(_0x2a566d){if(_0x2a566d){return _0x2a566d[_0x3a51('0x26')]()[_0x3a51('0x25')](function(){_0x32b191['status'](0xcc)[_0x3a51('0x1a')]();});}};}function handleEntityNotFound(_0x5c0943,_0x22ccdb){return function(_0x117a76){if(!_0x117a76){_0x5c0943['sendStatus'](0x194);}return _0x117a76;};}function handleError(_0x2d8af0,_0x222e8c){_0x222e8c=_0x222e8c||0x1f4;return function(_0x462ebe){logger['error'](_0x462ebe[_0x3a51('0x27')]);if(_0x462ebe[_0x3a51('0x28')]){delete _0x462ebe[_0x3a51('0x28')];}_0x2d8af0[_0x3a51('0x19')](_0x222e8c)[_0x3a51('0x29')](_0x462ebe);};}exports[_0x3a51('0x2a')]=function(_0x1c7ab4,_0x26ae6c){var _0x19d15b={},_0x458cf3={},_0x15959f={'count':0x0,'rows':[]};var _0x1e3c45=_[_0x3a51('0x2b')](db['AnalyticTreeReport'][_0x3a51('0x2c')],function(_0x307601){return{'name':_0x307601[_0x3a51('0x2d')],'type':_0x307601[_0x3a51('0x2e')][_0x3a51('0x2f')]};});_0x458cf3['model']=_[_0x3a51('0x2b')](_0x1e3c45,_0x3a51('0x28'));_0x458cf3[_0x3a51('0x30')]=_[_0x3a51('0x31')](_0x1c7ab4[_0x3a51('0x30')]);_0x458cf3[_0x3a51('0x32')]=_['intersection'](_0x458cf3[_0x3a51('0x33')],_0x458cf3[_0x3a51('0x30')]);_0x19d15b[_0x3a51('0x34')]=_[_0x3a51('0x35')](_0x458cf3[_0x3a51('0x33')],qs[_0x3a51('0x36')](_0x1c7ab4['query']['fields']));_0x19d15b[_0x3a51('0x34')]=_0x19d15b[_0x3a51('0x34')][_0x3a51('0x37')]?_0x19d15b['attributes']:_0x458cf3[_0x3a51('0x33')];if(!_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x38')](_0x3a51('0x39'))){_0x19d15b[_0x3a51('0x1e')]=qs[_0x3a51('0x1e')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x1e')]);_0x19d15b['offset']=qs[_0x3a51('0x1c')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x1c')]);}_0x19d15b['order']=qs[_0x3a51('0x3a')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x3a')]);_0x19d15b['where']=qs[_0x3a51('0x32')](_['pick'](_0x1c7ab4['query'],_0x458cf3[_0x3a51('0x32')]),_0x1e3c45);if(_0x1c7ab4['query'][_0x3a51('0x3b')]){_0x19d15b[_0x3a51('0x3c')]=_['merge'](_0x19d15b[_0x3a51('0x3c')],{'$or':_[_0x3a51('0x2b')](_0x1e3c45,function(_0x10a07e){if(_0x10a07e[_0x3a51('0x2e')]!==_0x3a51('0x3d')){var _0x146d00={};_0x146d00[_0x10a07e[_0x3a51('0x28')]]={'$like':'%'+_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x3b')]+'%'};return _0x146d00;}})});}_0x19d15b=_['merge']({},_0x19d15b,_0x1c7ab4[_0x3a51('0x3e')]);var _0xf6d89d={'where':_0x19d15b[_0x3a51('0x3c')]};return db[_0x3a51('0x3f')]['count'](_0xf6d89d)['then'](function(_0x121262){_0x15959f[_0x3a51('0x1f')]=_0x121262;if(_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x40')]){_0x19d15b[_0x3a51('0x41')]=[{'all':!![]}];}return db[_0x3a51('0x3f')][_0x3a51('0x42')](_0x19d15b);})['then'](function(_0x1ec7b8){_0x15959f['rows']=_0x1ec7b8;return _0x15959f;})['then'](respondWithFilteredResult(_0x26ae6c,_0x19d15b))[_0x3a51('0x43')](handleError(_0x26ae6c,null));};exports['show']=function(_0x7c07c6,_0x4e73a2){var _0x3663f5={'raw':!![],'where':{'id':_0x7c07c6[_0x3a51('0x44')]['id']}},_0x495b82={};_0x495b82[_0x3a51('0x33')]=_[_0x3a51('0x31')](db[_0x3a51('0x3f')][_0x3a51('0x2c')]);_0x495b82['query']=_['keys'](_0x7c07c6[_0x3a51('0x30')]);_0x495b82[_0x3a51('0x32')]=_[_0x3a51('0x35')](_0x495b82[_0x3a51('0x33')],_0x495b82[_0x3a51('0x30')]);_0x3663f5[_0x3a51('0x34')]=_['intersection'](_0x495b82[_0x3a51('0x33')],qs[_0x3a51('0x36')](_0x7c07c6[_0x3a51('0x30')][_0x3a51('0x36')]));_0x3663f5[_0x3a51('0x34')]=_0x3663f5[_0x3a51('0x34')][_0x3a51('0x37')]?_0x3663f5['attributes']:_0x495b82[_0x3a51('0x33')];if(_0x7c07c6[_0x3a51('0x30')]['includeAll']){_0x3663f5[_0x3a51('0x41')]=[{'all':!![]}];}_0x3663f5=_['merge']({},_0x3663f5,_0x7c07c6[_0x3a51('0x3e')]);return db[_0x3a51('0x3f')][_0x3a51('0x45')](_0x3663f5)[_0x3a51('0x25')](handleEntityNotFound(_0x4e73a2,null))[_0x3a51('0x25')](respondWithResult(_0x4e73a2,null))[_0x3a51('0x43')](handleError(_0x4e73a2,null));};exports[_0x3a51('0x46')]=function(_0x2e6457,_0x302921){return db[_0x3a51('0x3f')][_0x3a51('0x46')](_0x2e6457[_0x3a51('0x47')],{})[_0x3a51('0x25')](respondWithResult(_0x302921,0xc9))[_0x3a51('0x43')](handleError(_0x302921,null));};exports[_0x3a51('0x24')]=function(_0x10466a,_0x1b05f3){if(_0x10466a[_0x3a51('0x47')]['id']){delete _0x10466a[_0x3a51('0x47')]['id'];}return db[_0x3a51('0x3f')]['find']({'where':{'id':_0x10466a[_0x3a51('0x44')]['id']}})[_0x3a51('0x25')](handleEntityNotFound(_0x1b05f3,null))['then'](saveUpdates(_0x10466a[_0x3a51('0x47')],null))[_0x3a51('0x25')](respondWithResult(_0x1b05f3,null))['catch'](handleError(_0x1b05f3,null));};exports[_0x3a51('0x26')]=function(_0x343387,_0x4b0b19){return db['AnalyticTreeReport'][_0x3a51('0x45')]({'where':{'id':_0x343387[_0x3a51('0x44')]['id']}})[_0x3a51('0x25')](handleEntityNotFound(_0x4b0b19,null))[_0x3a51('0x25')](removeEntity(_0x4b0b19,null))[_0x3a51('0x43')](handleError(_0x4b0b19,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5760fba..636f091 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 _0x8e33=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x214393,_0x243463){var _0x38be1a=function(_0x3e46b0){while(--_0x3e46b0){_0x214393['push'](_0x214393['shift']());}};_0x38be1a(++_0x243463);}(_0x8e33,0x181));var _0x38e3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8e33[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x38e3('0x0'));var util=require('util');var logger=require(_0x38e3('0x1'))(_0x38e3('0x2'));var moment=require(_0x38e3('0x3'));var BPromise=require(_0x38e3('0x4'));var rp=require(_0x38e3('0x5'));var fs=require('fs');var path=require(_0x38e3('0x6'));var rimraf=require(_0x38e3('0x7'));var config=require(_0x38e3('0x8'));var attributes=require(_0x38e3('0x9'));module[_0x38e3('0xa')]=function(_0x10c544,_0x18d8c1){return _0x10c544[_0x38e3('0xb')](_0x38e3('0xc'),attributes,{'tableName':_0x38e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe300=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xe300,0x120));var _0x0e30=function(_0x2bd92d,_0x484c0e){_0x2bd92d=_0x2bd92d-0x0;var _0x5007c5=_0xe300[_0x2bd92d];return _0x5007c5;};'use strict';var _=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var logger=require(_0x0e30('0x2'))(_0x0e30('0x3'));var moment=require(_0x0e30('0x4'));var BPromise=require(_0x0e30('0x5'));var rp=require(_0x0e30('0x6'));var fs=require('fs');var path=require(_0x0e30('0x7'));var rimraf=require(_0x0e30('0x8'));var config=require('../../config/environment');var attributes=require(_0x0e30('0x9'));module[_0x0e30('0xa')]=function(_0x24fd41,_0x14c1e3){return _0x24fd41['define']('AnalyticTreeReport',attributes,{'tableName':_0x0e30('0xb'),'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 e7f6521..fc9d76e 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4a72df,_0x1a26cf){var _0x455a66=function(_0x4f8187){while(--_0x4f8187){_0x4a72df['push'](_0x4a72df['shift']());}};_0x455a66(++_0x1a26cf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x149f32,_0x4273f7){_0x149f32=_0x149f32-0x0;var _0x11f475=_0x5f2f[_0x149f32];return _0x11f475;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xbcdb67,_0x3f3b93){var _0x5f8cb3=function(_0x638824){while(--_0x638824){_0xbcdb67['push'](_0xbcdb67['shift']());}};_0x5f8cb3(++_0x3f3b93);}(_0xdb28,0x106));var _0x8db2=function(_0x51aa19,_0xbfd6c1){_0x51aa19=_0x51aa19-0x0;var _0x197223=_0xdb28[_0x51aa19];return _0x197223;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 3f06dab..0e654b7 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 _0xfa12=['isAuthenticated','show','post','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x1cbecb,_0x505e33){var _0x4112c4=function(_0x1d1d36){while(--_0x1d1d36){_0x1cbecb['push'](_0x1cbecb['shift']());}};_0x4112c4(++_0x505e33);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0xfa12[_0x1f23b1];return _0x3c9197;};'use strict';var multer=require('multer');var util=require(_0x2fa1('0x0'));var path=require(_0x2fa1('0x1'));var timeout=require(_0x2fa1('0x2'));var express=require(_0x2fa1('0x3'));var router=express[_0x2fa1('0x4')]();var fs_extra=require(_0x2fa1('0x5'));var auth=require(_0x2fa1('0x6'));var interaction=require(_0x2fa1('0x7'));var config=require(_0x2fa1('0x8'));var controller=require(_0x2fa1('0x9'));router[_0x2fa1('0xa')]('/',auth[_0x2fa1('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2fa1('0xc')]);router[_0x2fa1('0xd')]('/',auth[_0x2fa1('0xb')](),controller['create']);router['put'](_0x2fa1('0xe'),auth['isAuthenticated'](),controller[_0x2fa1('0xf')]);router[_0x2fa1('0x10')](_0x2fa1('0xe'),auth['isAuthenticated'](),controller[_0x2fa1('0x11')]);module[_0x2fa1('0x12')]=router; \ No newline at end of file +var _0x10b2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x10b2,0xb8));var _0x210b=function(_0x3c7ecb,_0xfe99d5){_0x3c7ecb=_0x3c7ecb-0x0;var _0x3c8a56=_0x10b2[_0x3c7ecb];return _0x3c8a56;};'use strict';var multer=require('multer');var util=require(_0x210b('0x0'));var path=require(_0x210b('0x1'));var timeout=require(_0x210b('0x2'));var express=require(_0x210b('0x3'));var router=express[_0x210b('0x4')]();var fs_extra=require(_0x210b('0x5'));var auth=require(_0x210b('0x6'));var interaction=require(_0x210b('0x7'));var config=require(_0x210b('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x210b('0x9')]('/',auth[_0x210b('0xa')](),controller['index']);router['get'](_0x210b('0xb'),auth['isAuthenticated'](),controller[_0x210b('0xc')]);router[_0x210b('0xd')]('/',auth[_0x210b('0xa')](),controller[_0x210b('0xe')]);router[_0x210b('0xf')](_0x210b('0xb'),auth[_0x210b('0xa')](),controller[_0x210b('0x10')]);router[_0x210b('0x11')](_0x210b('0xb'),auth['isAuthenticated'](),controller[_0x210b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8e6ebd3..172548a 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 _0x6c6f=['sequelize','exports','STRING'];(function(_0x352fc5,_0xc25f36){var _0x47095f=function(_0xb9849e){while(--_0xb9849e){_0x352fc5['push'](_0x352fc5['shift']());}};_0x47095f(++_0xc25f36);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x1f99fc,_0x1cb2ee){_0x1f99fc=_0x1f99fc-0x0;var _0x474f5c=_0x6c6f[_0x1f99fc];return _0x474f5c;};'use strict';var Sequelize=require(_0xf6c6('0x0'));module[_0xf6c6('0x1')]={'name':{'type':Sequelize[_0xf6c6('0x2')]},'basename':{'type':Sequelize[_0xf6c6('0x2')]},'type':{'type':Sequelize[_0xf6c6('0x2')]}}; \ No newline at end of file +var _0xc524=['STRING'];(function(_0x4864bb,_0x25e0b4){var _0x5a7ca0=function(_0xe28e73){while(--_0xe28e73){_0x4864bb['push'](_0x4864bb['shift']());}};_0x5a7ca0(++_0x25e0b4);}(_0xc524,0x1bf));var _0x4c52=function(_0xeb10d8,_0x2c188c){_0xeb10d8=_0xeb10d8-0x0;var _0x13afb5=_0xc524[_0xeb10d8];return _0x13afb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4c52('0x0')]},'basename':{'type':Sequelize[_0x4c52('0x0')]},'type':{'type':Sequelize[_0x4c52('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index aa70137..573788d 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 _0xcb01=['../../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','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','include','find','catch','clone','includeAll','get','omit','createdAt','updatedAt','body','params','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xcb01,0x10a));var _0x1cb0=function(_0x2f48d4,_0x29b0fd){_0x2f48d4=_0x2f48d4-0x0;var _0x515c6f=_0xcb01[_0x2f48d4];return _0x515c6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cb0('0x0'));var zipdir=require(_0x1cb0('0x1'));var jsonpatch=require(_0x1cb0('0x2'));var rp=require(_0x1cb0('0x3'));var moment=require(_0x1cb0('0x4'));var BPromise=require(_0x1cb0('0x5'));var Mustache=require(_0x1cb0('0x6'));var util=require(_0x1cb0('0x7'));var path=require(_0x1cb0('0x8'));var sox=require('sox');var csv=require(_0x1cb0('0x9'));var ejs=require(_0x1cb0('0xa'));var fs=require('fs');var fs_extra=require(_0x1cb0('0xb'));var _=require(_0x1cb0('0xc'));var squel=require('squel');var crypto=require(_0x1cb0('0xd'));var jsforce=require(_0x1cb0('0xe'));var deskjs=require(_0x1cb0('0xf'));var toCsv=require(_0x1cb0('0x9'));var querystring=require(_0x1cb0('0x10'));var Papa=require(_0x1cb0('0x11'));var Redis=require(_0x1cb0('0x12'));var authService=require(_0x1cb0('0x13'));var qs=require(_0x1cb0('0x14'));var as=require(_0x1cb0('0x15'));var hardwareService=require(_0x1cb0('0x16'));var logger=require(_0x1cb0('0x17'))('api');var utils=require(_0x1cb0('0x18'));var config=require(_0x1cb0('0x19'));var licenseUtil=require(_0x1cb0('0x1a'));var db=require(_0x1cb0('0x1b'))['db'];function respondWithStatusCode(_0x3debb8,_0x524399){_0x524399=_0x524399||0xcc;return function(_0x51b79f){if(_0x51b79f){return _0x3debb8[_0x1cb0('0x1c')](_0x524399);}return _0x3debb8[_0x1cb0('0x1d')](_0x524399)[_0x1cb0('0x1e')]();};}function respondWithResult(_0x1a5714,_0x497c41){_0x497c41=_0x497c41||0xc8;return function(_0x3dbc8d){if(_0x3dbc8d){return _0x1a5714[_0x1cb0('0x1d')](_0x497c41)['json'](_0x3dbc8d);}};}function respondWithFilteredResult(_0x5357eb,_0x47f774){return function(_0x11b6f9){if(_0x11b6f9){var _0x1ba8be=typeof _0x47f774[_0x1cb0('0x1f')]==='undefined'&&typeof _0x47f774[_0x1cb0('0x20')]==='undefined';var _0x579eb5=_0x11b6f9[_0x1cb0('0x21')];var _0x39dd35=_0x1ba8be?0x0:_0x47f774[_0x1cb0('0x1f')];var _0x285e5d=_0x1ba8be?_0x11b6f9['count']:_0x47f774[_0x1cb0('0x1f')]+_0x47f774[_0x1cb0('0x20')];var _0x409ed5;if(_0x285e5d>=_0x579eb5){_0x285e5d=_0x579eb5;_0x409ed5=0xc8;}else{_0x409ed5=0xce;}_0x5357eb['status'](_0x409ed5);return _0x5357eb[_0x1cb0('0x22')](_0x1cb0('0x23'),_0x39dd35+'-'+_0x285e5d+'/'+_0x579eb5)[_0x1cb0('0x24')](_0x11b6f9);}return null;};}function patchUpdates(_0xbe899){return function(_0x1281c6){try{jsonpatch[_0x1cb0('0x25')](_0x1281c6,_0xbe899,!![]);}catch(_0x398006){return BPromise[_0x1cb0('0x26')](_0x398006);}return _0x1281c6[_0x1cb0('0x27')]();};}function saveUpdates(_0x1d17e2,_0x1db965){return function(_0xdda99b){if(_0xdda99b){return _0xdda99b[_0x1cb0('0x28')](_0x1d17e2)[_0x1cb0('0x29')](function(_0x21f196){return _0x21f196;});}return null;};}function removeEntity(_0x511f97,_0x4cc0d2){return function(_0x1d1830){if(_0x1d1830){return _0x1d1830[_0x1cb0('0x2a')]()[_0x1cb0('0x29')](function(){_0x511f97[_0x1cb0('0x1d')](0xcc)[_0x1cb0('0x1e')]();});}};}function handleEntityNotFound(_0x1dffe5,_0x1e1683){return function(_0x2c04df){if(!_0x2c04df){_0x1dffe5[_0x1cb0('0x1c')](0x194);}return _0x2c04df;};}function handleError(_0x10d398,_0x5866d0){_0x5866d0=_0x5866d0||0x1f4;return function(_0x149b1c){logger[_0x1cb0('0x2b')](_0x149b1c[_0x1cb0('0x2c')]);if(_0x149b1c[_0x1cb0('0x2d')]){delete _0x149b1c[_0x1cb0('0x2d')];}_0x10d398[_0x1cb0('0x1d')](_0x5866d0)[_0x1cb0('0x2e')](_0x149b1c);};}exports['index']=function(_0x3be041,_0x41c7e1){var _0x25be22={},_0x1f0950={},_0x45498e={'count':0x0,'rows':[]};var _0x31d4f0=_[_0x1cb0('0x2f')](db[_0x1cb0('0x30')][_0x1cb0('0x31')],function(_0x2c4d8){return{'name':_0x2c4d8['fieldName'],'type':_0x2c4d8[_0x1cb0('0x32')][_0x1cb0('0x33')]};});_0x1f0950[_0x1cb0('0x34')]=_[_0x1cb0('0x2f')](_0x31d4f0,_0x1cb0('0x2d'));_0x1f0950[_0x1cb0('0x35')]=_[_0x1cb0('0x36')](_0x3be041[_0x1cb0('0x35')]);_0x1f0950[_0x1cb0('0x37')]=_[_0x1cb0('0x38')](_0x1f0950[_0x1cb0('0x34')],_0x1f0950[_0x1cb0('0x35')]);_0x25be22[_0x1cb0('0x39')]=_[_0x1cb0('0x38')](_0x1f0950[_0x1cb0('0x34')],qs[_0x1cb0('0x3a')](_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3a')]));_0x25be22[_0x1cb0('0x39')]=_0x25be22[_0x1cb0('0x39')][_0x1cb0('0x3b')]?_0x25be22[_0x1cb0('0x39')]:_0x1f0950['model'];if(!_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3c')](_0x1cb0('0x3d'))){_0x25be22[_0x1cb0('0x20')]=qs[_0x1cb0('0x20')](_0x3be041[_0x1cb0('0x35')]['limit']);_0x25be22['offset']=qs[_0x1cb0('0x1f')](_0x3be041['query'][_0x1cb0('0x1f')]);}_0x25be22[_0x1cb0('0x3e')]=qs[_0x1cb0('0x3f')](_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3f')]);_0x25be22[_0x1cb0('0x40')]=qs[_0x1cb0('0x37')](_[_0x1cb0('0x41')](_0x3be041[_0x1cb0('0x35')],_0x1f0950['filters']),_0x31d4f0);if(_0x3be041[_0x1cb0('0x35')]['filter']){_0x25be22['where']=_[_0x1cb0('0x42')](_0x25be22[_0x1cb0('0x40')],{'$or':_['map'](_0x31d4f0,function(_0x26464e){if(_0x26464e[_0x1cb0('0x32')]!==_0x1cb0('0x43')){var _0xee7f8b={};_0xee7f8b[_0x26464e[_0x1cb0('0x2d')]]={'$like':'%'+_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x44')]+'%'};return _0xee7f8b;}})});}_0x25be22=_['merge']({},_0x25be22,_0x3be041[_0x1cb0('0x45')]);var _0x32bb84={'where':_0x25be22['where']};return db[_0x1cb0('0x30')]['count'](_0x32bb84)[_0x1cb0('0x29')](function(_0xe7acf4){_0x45498e[_0x1cb0('0x21')]=_0xe7acf4;if(_0x3be041[_0x1cb0('0x35')]['includeAll']){_0x25be22['include']=[{'all':!![]}];}return db['Attachment'][_0x1cb0('0x46')](_0x25be22);})['then'](function(_0x235082){_0x45498e[_0x1cb0('0x47')]=_0x235082;return _0x45498e;})[_0x1cb0('0x29')](respondWithFilteredResult(_0x41c7e1,_0x25be22))['catch'](handleError(_0x41c7e1,null));};exports['show']=function(_0xd0b382,_0x2fd1e6){var _0x1885bd={'raw':!![],'where':{'id':_0xd0b382['params']['id']}},_0x27dd9a={};_0x27dd9a['model']=_[_0x1cb0('0x36')](db[_0x1cb0('0x30')][_0x1cb0('0x31')]);_0x27dd9a[_0x1cb0('0x35')]=_[_0x1cb0('0x36')](_0xd0b382['query']);_0x27dd9a['filters']=_[_0x1cb0('0x38')](_0x27dd9a[_0x1cb0('0x34')],_0x27dd9a['query']);_0x1885bd['attributes']=_['intersection'](_0x27dd9a[_0x1cb0('0x34')],qs[_0x1cb0('0x3a')](_0xd0b382[_0x1cb0('0x35')][_0x1cb0('0x3a')]));_0x1885bd[_0x1cb0('0x39')]=_0x1885bd[_0x1cb0('0x39')]['length']?_0x1885bd['attributes']:_0x27dd9a[_0x1cb0('0x34')];if(_0xd0b382['query']['includeAll']){_0x1885bd[_0x1cb0('0x48')]=[{'all':!![]}];}_0x1885bd=_[_0x1cb0('0x42')]({},_0x1885bd,_0xd0b382[_0x1cb0('0x45')]);return db[_0x1cb0('0x30')][_0x1cb0('0x49')](_0x1885bd)[_0x1cb0('0x29')](handleEntityNotFound(_0x2fd1e6,null))['then'](respondWithResult(_0x2fd1e6,null))[_0x1cb0('0x4a')](handleError(_0x2fd1e6,null));};exports[_0x1cb0('0x4b')]=function(_0xa25dd5,_0x48bf90){var _0x15b994={'where':{'id':_0xa25dd5['params']['id']}},_0x48a544={};_0x48a544['model']=_[_0x1cb0('0x36')](db['Attachment'][_0x1cb0('0x31')]);_0x15b994['attributes']=_[_0x1cb0('0x38')](_0x48a544[_0x1cb0('0x34')],qs['fields'](_0xa25dd5['query'][_0x1cb0('0x3a')]));_0x15b994['attributes']=_0x15b994[_0x1cb0('0x39')][_0x1cb0('0x3b')]?_0x15b994[_0x1cb0('0x39')]:_0x48a544['model'];if(_0xa25dd5[_0x1cb0('0x35')][_0x1cb0('0x4c')]){_0x15b994[_0x1cb0('0x48')]=[{'all':!![]}];}_0x15b994=_[_0x1cb0('0x42')]({},_0x15b994,_0xa25dd5[_0x1cb0('0x45')]);return db[_0x1cb0('0x30')][_0x1cb0('0x49')](_0x15b994)[_0x1cb0('0x29')](handleEntityNotFound(_0x48bf90,null))['then'](function(_0x37dc89){if(_0x37dc89){var _0x515f90=_0x37dc89[_0x1cb0('0x4d')]({'plain':!![]});_0x515f90=qs[_0x1cb0('0x4e')](_0x515f90,['id',_0x1cb0('0x4f'),_0x1cb0('0x50')]);_0xa25dd5[_0x1cb0('0x51')]=_['omit'](_0xa25dd5[_0x1cb0('0x51')],['id',_0x1cb0('0x4f'),_0x1cb0('0x50')]);return db[_0x1cb0('0x30')]['create'](_[_0x1cb0('0x42')](_0x515f90,_0xa25dd5['body']),{'include':_0xa25dd5[_0x1cb0('0x35')][_0x1cb0('0x4c')]?[{'all':!![]}]:undefined});}})[_0x1cb0('0x29')](respondWithResult(_0x48bf90,0xc9))['catch'](handleError(_0x48bf90,null));};exports[_0x1cb0('0x28')]=function(_0x447a11,_0x49653d){if(_0x447a11['body']['id']){delete _0x447a11['body']['id'];}return db[_0x1cb0('0x30')][_0x1cb0('0x49')]({'where':{'id':_0x447a11[_0x1cb0('0x52')]['id']}})[_0x1cb0('0x29')](handleEntityNotFound(_0x49653d,null))[_0x1cb0('0x29')](saveUpdates(_0x447a11[_0x1cb0('0x51')],null))[_0x1cb0('0x29')](respondWithResult(_0x49653d,null))[_0x1cb0('0x4a')](handleError(_0x49653d,null));};exports[_0x1cb0('0x2a')]=function(_0x1cb487,_0x319ee7){return db[_0x1cb0('0x30')]['find']({'where':{'id':_0x1cb487['params']['id']}})['then'](handleEntityNotFound(_0x319ee7,null))[_0x1cb0('0x29')](removeEntity(_0x319ee7,null))[_0x1cb0('0x4a')](handleError(_0x319ee7,null));};exports[_0x1cb0('0x53')]=function(_0x155720,_0x3c8c6b,_0x1b181b){_0x155720[_0x1cb0('0x51')]['name']=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x55')];_0x155720[_0x1cb0('0x51')][_0x1cb0('0x56')]=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x57')];_0x155720[_0x1cb0('0x51')]['type']=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x58')];return db[_0x1cb0('0x30')][_0x1cb0('0x53')](_0x155720[_0x1cb0('0x51')])[_0x1cb0('0x29')](respondWithResult(_0x3c8c6b,0xc9))[_0x1cb0('0x4a')](handleError(_0x3c8c6b,null));};exports['download']=function(_0x52dd1a,_0x2b8ebf,_0x1e0d3a){return db[_0x1cb0('0x30')][_0x1cb0('0x59')]({'where':{'id':_0x52dd1a['params']['id']},'raw':!![]})[_0x1cb0('0x29')](handleEntityNotFound(_0x2b8ebf,null))['then'](function(_0x13c47d){if(_0x13c47d){var _0x2c6498=_0x13c47d[_0x1cb0('0x5a')]!==null;var _0x1c7b05=path['join'](config[_0x1cb0('0x5b')],_0x1cb0('0x5c'));if(_0x2c6498){_0x1c7b05=path['join'](_0x1c7b05,'offline-chat/');}var _0xf7d090=path[_0x1cb0('0x5d')](_0x1c7b05,_0x13c47d[_0x1cb0('0x56')]);return _0x2b8ebf[_0x1cb0('0x5e')](_0xf7d090);}})[_0x1cb0('0x4a')](handleError(_0x2b8ebf,null));}; \ No newline at end of file +var _0x02fa=['updatedAt','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Attachment','includeAll','include','findAll','catch','show','params','find','clone','get','omit','createdAt','body'];(function(_0x1055d3,_0x5dce87){var _0x55b24a=function(_0x559f0a){while(--_0x559f0a){_0x1055d3['push'](_0x1055d3['shift']());}};_0x55b24a(++_0x5dce87);}(_0x02fa,0x1c9));var _0xa02f=function(_0x29c03e,_0x1bc373){_0x29c03e=_0x29c03e-0x0;var _0x1ea621=_0x02fa[_0x29c03e];return _0x1ea621;};'use strict';var emlformat=require(_0xa02f('0x0'));var rimraf=require(_0xa02f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa02f('0x2'));var rp=require('request-promise');var moment=require(_0xa02f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa02f('0x4'));var util=require(_0xa02f('0x5'));var path=require('path');var sox=require(_0xa02f('0x6'));var csv=require('to-csv');var ejs=require(_0xa02f('0x7'));var fs=require('fs');var fs_extra=require(_0xa02f('0x8'));var _=require(_0xa02f('0x9'));var squel=require(_0xa02f('0xa'));var crypto=require('crypto');var jsforce=require(_0xa02f('0xb'));var deskjs=require(_0xa02f('0xc'));var toCsv=require(_0xa02f('0xd'));var querystring=require('querystring');var Papa=require(_0xa02f('0xe'));var Redis=require(_0xa02f('0xf'));var authService=require(_0xa02f('0x10'));var qs=require(_0xa02f('0x11'));var as=require(_0xa02f('0x12'));var hardwareService=require(_0xa02f('0x13'));var logger=require('../../config/logger')(_0xa02f('0x14'));var utils=require('../../config/utils');var config=require(_0xa02f('0x15'));var licenseUtil=require(_0xa02f('0x16'));var db=require(_0xa02f('0x17'))['db'];function respondWithStatusCode(_0x51a744,_0x1032d9){_0x1032d9=_0x1032d9||0xcc;return function(_0x3be340){if(_0x3be340){return _0x51a744[_0xa02f('0x18')](_0x1032d9);}return _0x51a744[_0xa02f('0x19')](_0x1032d9)[_0xa02f('0x1a')]();};}function respondWithResult(_0x4e7cf5,_0x49155a){_0x49155a=_0x49155a||0xc8;return function(_0x435111){if(_0x435111){return _0x4e7cf5['status'](_0x49155a)['json'](_0x435111);}};}function respondWithFilteredResult(_0x169e84,_0x5603d9){return function(_0xfb630a){if(_0xfb630a){var _0x4871cf=typeof _0x5603d9['offset']===_0xa02f('0x1b')&&typeof _0x5603d9[_0xa02f('0x1c')]===_0xa02f('0x1b');var _0x5652d4=_0xfb630a[_0xa02f('0x1d')];var _0x4c8bba=_0x4871cf?0x0:_0x5603d9[_0xa02f('0x1e')];var _0x1b80df=_0x4871cf?_0xfb630a['count']:_0x5603d9[_0xa02f('0x1e')]+_0x5603d9['limit'];var _0x47f30d;if(_0x1b80df>=_0x5652d4){_0x1b80df=_0x5652d4;_0x47f30d=0xc8;}else{_0x47f30d=0xce;}_0x169e84[_0xa02f('0x19')](_0x47f30d);return _0x169e84[_0xa02f('0x1f')]('Content-Range',_0x4c8bba+'-'+_0x1b80df+'/'+_0x5652d4)['json'](_0xfb630a);}return null;};}function patchUpdates(_0x1c6d2e){return function(_0x39ee7c){try{jsonpatch[_0xa02f('0x20')](_0x39ee7c,_0x1c6d2e,!![]);}catch(_0x109dbd){return BPromise[_0xa02f('0x21')](_0x109dbd);}return _0x39ee7c[_0xa02f('0x22')]();};}function saveUpdates(_0x4d2312,_0x339a02){return function(_0x43daab){if(_0x43daab){return _0x43daab[_0xa02f('0x23')](_0x4d2312)[_0xa02f('0x24')](function(_0xd08a6f){return _0xd08a6f;});}return null;};}function removeEntity(_0x5b6cd6,_0x21b0cd){return function(_0x144706){if(_0x144706){return _0x144706[_0xa02f('0x25')]()['then'](function(){_0x5b6cd6['status'](0xcc)[_0xa02f('0x1a')]();});}};}function handleEntityNotFound(_0x5ba602,_0x28b1e9){return function(_0x347c0c){if(!_0x347c0c){_0x5ba602['sendStatus'](0x194);}return _0x347c0c;};}function handleError(_0x3159d3,_0x4f2cdf){_0x4f2cdf=_0x4f2cdf||0x1f4;return function(_0x243029){logger['error'](_0x243029[_0xa02f('0x26')]);if(_0x243029['name']){delete _0x243029[_0xa02f('0x27')];}_0x3159d3[_0xa02f('0x19')](_0x4f2cdf)[_0xa02f('0x28')](_0x243029);};}exports[_0xa02f('0x29')]=function(_0x3ffd4f,_0x18fcd4){var _0x2f1904={},_0x10fb9f={},_0x5a57e6={'count':0x0,'rows':[]};var _0x45dfc9=_[_0xa02f('0x2a')](db['Attachment'][_0xa02f('0x2b')],function(_0x37c562){return{'name':_0x37c562[_0xa02f('0x2c')],'type':_0x37c562[_0xa02f('0x2d')][_0xa02f('0x2e')]};});_0x10fb9f[_0xa02f('0x2f')]=_['map'](_0x45dfc9,_0xa02f('0x27'));_0x10fb9f[_0xa02f('0x30')]=_[_0xa02f('0x31')](_0x3ffd4f[_0xa02f('0x30')]);_0x10fb9f['filters']=_[_0xa02f('0x32')](_0x10fb9f[_0xa02f('0x2f')],_0x10fb9f[_0xa02f('0x30')]);_0x2f1904[_0xa02f('0x33')]=_[_0xa02f('0x32')](_0x10fb9f[_0xa02f('0x2f')],qs['fields'](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x34')]));_0x2f1904[_0xa02f('0x33')]=_0x2f1904[_0xa02f('0x33')][_0xa02f('0x35')]?_0x2f1904[_0xa02f('0x33')]:_0x10fb9f['model'];if(!_0x3ffd4f[_0xa02f('0x30')]['hasOwnProperty'](_0xa02f('0x36'))){_0x2f1904[_0xa02f('0x1c')]=qs[_0xa02f('0x1c')](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x1c')]);_0x2f1904['offset']=qs[_0xa02f('0x1e')](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x1e')]);}_0x2f1904[_0xa02f('0x37')]=qs[_0xa02f('0x38')](_0x3ffd4f[_0xa02f('0x30')]['sort']);_0x2f1904[_0xa02f('0x39')]=qs[_0xa02f('0x3a')](_[_0xa02f('0x3b')](_0x3ffd4f['query'],_0x10fb9f['filters']),_0x45dfc9);if(_0x3ffd4f[_0xa02f('0x30')]['filter']){_0x2f1904[_0xa02f('0x39')]=_[_0xa02f('0x3c')](_0x2f1904[_0xa02f('0x39')],{'$or':_[_0xa02f('0x2a')](_0x45dfc9,function(_0x5aea98){if(_0x5aea98[_0xa02f('0x2d')]!==_0xa02f('0x3d')){var _0x5e956a={};_0x5e956a[_0x5aea98[_0xa02f('0x27')]]={'$like':'%'+_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x3e')]+'%'};return _0x5e956a;}})});}_0x2f1904=_[_0xa02f('0x3c')]({},_0x2f1904,_0x3ffd4f[_0xa02f('0x3f')]);var _0x2ca393={'where':_0x2f1904[_0xa02f('0x39')]};return db[_0xa02f('0x40')][_0xa02f('0x1d')](_0x2ca393)[_0xa02f('0x24')](function(_0x2006d5){_0x5a57e6[_0xa02f('0x1d')]=_0x2006d5;if(_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x41')]){_0x2f1904[_0xa02f('0x42')]=[{'all':!![]}];}return db[_0xa02f('0x40')][_0xa02f('0x43')](_0x2f1904);})[_0xa02f('0x24')](function(_0x53fdba){_0x5a57e6['rows']=_0x53fdba;return _0x5a57e6;})[_0xa02f('0x24')](respondWithFilteredResult(_0x18fcd4,_0x2f1904))[_0xa02f('0x44')](handleError(_0x18fcd4,null));};exports[_0xa02f('0x45')]=function(_0x438f96,_0x586efe){var _0x75d221={'raw':!![],'where':{'id':_0x438f96[_0xa02f('0x46')]['id']}},_0x2fd19f={};_0x2fd19f[_0xa02f('0x2f')]=_[_0xa02f('0x31')](db[_0xa02f('0x40')][_0xa02f('0x2b')]);_0x2fd19f[_0xa02f('0x30')]=_[_0xa02f('0x31')](_0x438f96['query']);_0x2fd19f[_0xa02f('0x3a')]=_[_0xa02f('0x32')](_0x2fd19f[_0xa02f('0x2f')],_0x2fd19f['query']);_0x75d221[_0xa02f('0x33')]=_[_0xa02f('0x32')](_0x2fd19f[_0xa02f('0x2f')],qs[_0xa02f('0x34')](_0x438f96[_0xa02f('0x30')][_0xa02f('0x34')]));_0x75d221[_0xa02f('0x33')]=_0x75d221[_0xa02f('0x33')][_0xa02f('0x35')]?_0x75d221[_0xa02f('0x33')]:_0x2fd19f[_0xa02f('0x2f')];if(_0x438f96[_0xa02f('0x30')]['includeAll']){_0x75d221[_0xa02f('0x42')]=[{'all':!![]}];}_0x75d221=_[_0xa02f('0x3c')]({},_0x75d221,_0x438f96[_0xa02f('0x3f')]);return db[_0xa02f('0x40')][_0xa02f('0x47')](_0x75d221)[_0xa02f('0x24')](handleEntityNotFound(_0x586efe,null))[_0xa02f('0x24')](respondWithResult(_0x586efe,null))['catch'](handleError(_0x586efe,null));};exports[_0xa02f('0x48')]=function(_0xea664f,_0xbceec5){var _0x597328={'where':{'id':_0xea664f['params']['id']}},_0x5d52ec={};_0x5d52ec['model']=_[_0xa02f('0x31')](db[_0xa02f('0x40')][_0xa02f('0x2b')]);_0x597328['attributes']=_[_0xa02f('0x32')](_0x5d52ec[_0xa02f('0x2f')],qs['fields'](_0xea664f['query'][_0xa02f('0x34')]));_0x597328[_0xa02f('0x33')]=_0x597328[_0xa02f('0x33')][_0xa02f('0x35')]?_0x597328[_0xa02f('0x33')]:_0x5d52ec['model'];if(_0xea664f['query'][_0xa02f('0x41')]){_0x597328[_0xa02f('0x42')]=[{'all':!![]}];}_0x597328=_[_0xa02f('0x3c')]({},_0x597328,_0xea664f[_0xa02f('0x3f')]);return db[_0xa02f('0x40')]['find'](_0x597328)[_0xa02f('0x24')](handleEntityNotFound(_0xbceec5,null))['then'](function(_0x11215d){if(_0x11215d){var _0x3fac8e=_0x11215d[_0xa02f('0x49')]({'plain':!![]});_0x3fac8e=qs[_0xa02f('0x4a')](_0x3fac8e,['id',_0xa02f('0x4b'),'updatedAt']);_0xea664f['body']=_[_0xa02f('0x4a')](_0xea664f[_0xa02f('0x4c')],['id',_0xa02f('0x4b'),_0xa02f('0x4d')]);return db[_0xa02f('0x40')][_0xa02f('0x4e')](_[_0xa02f('0x3c')](_0x3fac8e,_0xea664f[_0xa02f('0x4c')]),{'include':_0xea664f[_0xa02f('0x30')][_0xa02f('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xbceec5,0xc9))[_0xa02f('0x44')](handleError(_0xbceec5,null));};exports[_0xa02f('0x23')]=function(_0x29d1db,_0x55fbf6){if(_0x29d1db[_0xa02f('0x4c')]['id']){delete _0x29d1db[_0xa02f('0x4c')]['id'];}return db['Attachment']['find']({'where':{'id':_0x29d1db['params']['id']}})['then'](handleEntityNotFound(_0x55fbf6,null))['then'](saveUpdates(_0x29d1db['body'],null))[_0xa02f('0x24')](respondWithResult(_0x55fbf6,null))[_0xa02f('0x44')](handleError(_0x55fbf6,null));};exports['destroy']=function(_0x39aa98,_0x21d0ad){return db['Attachment']['find']({'where':{'id':_0x39aa98[_0xa02f('0x46')]['id']}})[_0xa02f('0x24')](handleEntityNotFound(_0x21d0ad,null))[_0xa02f('0x24')](removeEntity(_0x21d0ad,null))[_0xa02f('0x44')](handleError(_0x21d0ad,null));};exports[_0xa02f('0x4e')]=function(_0x577ad3,_0x8b7f1e,_0x1646be){_0x577ad3[_0xa02f('0x4c')]['name']=_0x577ad3[_0xa02f('0x4f')][_0xa02f('0x50')];_0x577ad3[_0xa02f('0x4c')][_0xa02f('0x51')]=_0x577ad3[_0xa02f('0x4f')]['filename'];_0x577ad3[_0xa02f('0x4c')][_0xa02f('0x2d')]=_0x577ad3[_0xa02f('0x4f')][_0xa02f('0x52')];return db[_0xa02f('0x40')]['create'](_0x577ad3['body'])[_0xa02f('0x24')](respondWithResult(_0x8b7f1e,0xc9))[_0xa02f('0x44')](handleError(_0x8b7f1e,null));};exports[_0xa02f('0x53')]=function(_0x4bb97a,_0x2a11c6,_0x33d4ed){return db[_0xa02f('0x40')][_0xa02f('0x54')]({'where':{'id':_0x4bb97a[_0xa02f('0x46')]['id']},'raw':!![]})[_0xa02f('0x24')](handleEntityNotFound(_0x2a11c6,null))[_0xa02f('0x24')](function(_0x5f420e){if(_0x5f420e){var _0x522134=_0x5f420e[_0xa02f('0x55')]!==null;var _0x4e9b4a=path['join'](config['root'],_0xa02f('0x56'));if(_0x522134){_0x4e9b4a=path[_0xa02f('0x57')](_0x4e9b4a,_0xa02f('0x58'));}var _0x45ecaa=path['join'](_0x4e9b4a,_0x5f420e[_0xa02f('0x51')]);return _0x2a11c6[_0xa02f('0x53')](_0x45ecaa);}})[_0xa02f('0x44')](handleError(_0x2a11c6,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6d0c44e..0c003e5 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 _0x0f99=['api','moment','bluebird','request-promise','path','rimraf','exports','Attachment','attachments','lodash','../../config/logger'];(function(_0x3bd478,_0x1bb19a){var _0x5d4211=function(_0xa26806){while(--_0xa26806){_0x3bd478['push'](_0x3bd478['shift']());}};_0x5d4211(++_0x1bb19a);}(_0x0f99,0x148));var _0x90f9=function(_0x2c6be1,_0xecba08){_0x2c6be1=_0x2c6be1-0x0;var _0x187d8f=_0x0f99[_0x2c6be1];return _0x187d8f;};'use strict';var _=require(_0x90f9('0x0'));var util=require('util');var logger=require(_0x90f9('0x1'))(_0x90f9('0x2'));var moment=require(_0x90f9('0x3'));var BPromise=require(_0x90f9('0x4'));var rp=require(_0x90f9('0x5'));var fs=require('fs');var path=require(_0x90f9('0x6'));var rimraf=require(_0x90f9('0x7'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x90f9('0x8')]=function(_0x321b3d,_0x1acf61){return _0x321b3d['define'](_0x90f9('0x9'),attributes,{'tableName':_0x90f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4abf=['attachments','lodash','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x4cc069,_0x5761b0){var _0x19220a=function(_0x3b6f95){while(--_0x3b6f95){_0x4cc069['push'](_0x4cc069['shift']());}};_0x19220a(++_0x5761b0);}(_0x4abf,0xe7));var _0xf4ab=function(_0x41c746,_0x59ddf0){_0x41c746=_0x41c746-0x0;var _0x2d7282=_0x4abf[_0x41c746];return _0x2d7282;};'use strict';var _=require(_0xf4ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4ab('0x1'));var moment=require('moment');var BPromise=require(_0xf4ab('0x2'));var rp=require(_0xf4ab('0x3'));var fs=require('fs');var path=require(_0xf4ab('0x4'));var rimraf=require('rimraf');var config=require(_0xf4ab('0x5'));var attributes=require(_0xf4ab('0x6'));module[_0xf4ab('0x7')]=function(_0x28fd92,_0x173c22){return _0x28fd92['define'](_0xf4ab('0x8'),attributes,{'tableName':_0xf4ab('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 9cc4d5c..cfeee14 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 _0x2bc6=['CreateAttachment','Attachment','options','raw','catch','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x2bc6,0x163));var _0x62bc=function(_0x41d468,_0x51b397){_0x41d468=_0x41d468-0x0;var _0x3bf7ad=_0x2bc6[_0x41d468];return _0x3bf7ad;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('Attachment,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('Attachment,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['create'](_0xc95407['body'],{'raw':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x380621){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x380621));_0x1d3d8f(_0x380621);})[_0x62bc('0x18')](function(_0x28757d){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x28757d[_0x62bc('0x12')],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x28757d['message']));});});}; \ No newline at end of file +var _0xc1c4=['Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment'];(function(_0x3cb809,_0xa0bde0){var _0x472bbc=function(_0x3f6862){while(--_0x3f6862){_0x3cb809['push'](_0x3cb809['shift']());}};_0x472bbc(++_0xa0bde0);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0xd52b70,_0x3ba248){_0xd52b70=_0xd52b70-0x0;var _0x2e851b=_0xc1c4[_0xd52b70];return _0x2e851b;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var moment=require(_0x4c1c('0x2'));var BPromise=require(_0x4c1c('0x3'));var rs=require(_0x4c1c('0x4'));var fs=require('fs');var Redis=require(_0x4c1c('0x5'));var db=require(_0x4c1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1c('0x7'))(_0x4c1c('0x8'));var config=require(_0x4c1c('0x9'));var jayson=require(_0x4c1c('0xa'));var client=jayson['client'][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4f,_0x5863d0,_0x20e276){return new BPromise(function(_0x3337e4,_0x486065){return client[_0x4c1c('0xc')](_0x4f5a4f,_0x20e276)[_0x4c1c('0xd')](function(_0x445441){logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,'request\x20sent');logger['debug'](_0x4c1c('0x10'),_0x5863d0,_0x4c1c('0x11'),JSON[_0x4c1c('0x12')](_0x445441));if(_0x445441[_0x4c1c('0x13')]){if(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x14')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x486065(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);}logger[_0x4c1c('0x13')]('Attachment,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x3337e4(_0x445441['error'][_0x4c1c('0x15')]);}else{logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,_0x4c1c('0x11'));_0x3337e4(_0x445441[_0x4c1c('0x16')][_0x4c1c('0x15')]);}})[_0x4c1c('0x17')](function(_0x33641d){logger[_0x4c1c('0x13')](_0x4c1c('0xf'),_0x5863d0,_0x33641d);_0x486065(_0x33641d);});});}exports[_0x4c1c('0x18')]=function(_0x5a9217){var _0x1fad89=this;return new Promise(function(_0x213019,_0x64fe4b){return db[_0x4c1c('0x19')][_0x4c1c('0x1a')](_0x5a9217[_0x4c1c('0x1b')],{'raw':_0x5a9217[_0x4c1c('0x1c')]?_0x5a9217[_0x4c1c('0x1c')][_0x4c1c('0x1d')]===undefined?!![]:![]:!![]})[_0x4c1c('0xd')](function(_0x58aca9){logger['info'](_0x4c1c('0x18'),_0x5a9217);logger['debug'](_0x4c1c('0x18'),_0x5a9217,JSON[_0x4c1c('0x12')](_0x58aca9));_0x213019(_0x58aca9);})['catch'](function(_0x23377c){logger['error']('CreateAttachment',_0x23377c[_0x4c1c('0x15')],_0x5a9217);_0x64fe4b(_0x1fad89[_0x4c1c('0x13')](0x1f4,_0x23377c[_0x4c1c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 81a1ba6..e530bdc 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x435f66,_0x14851f){var _0x59aa4a=function(_0x360649){while(--_0x360649){_0x435f66['push'](_0x435f66['shift']());}};_0x59aa4a(++_0x14851f);}(_0x757a,0xde));var _0xa757=function(_0x15c537,_0x2f6931){_0x15c537=_0x15c537-0x0;var _0x418e4e=_0x757a[_0x15c537];return _0x418e4e;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5d6aca,_0x2e52e8){var _0x26e98e=function(_0x37ef79){while(--_0x37ef79){_0x5d6aca['push'](_0x5d6aca['shift']());}};_0x26e98e(++_0x2e52e8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ac42c,_0x400eff){_0x2ac42c=_0x2ac42c-0x0;var _0x29b7f3=_0xb10b[_0x2ac42c];return _0x29b7f3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index b358bf9..bed6aeb 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index b375924..0ab3eb0 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 _0xe78a=['login','exports','Router','post'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xe78a,0x19a));var _0xae78=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe78a[_0x122ef9];return _0x42fba0;};'use strict';var express=require('express');var router=express[_0xae78('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xae78('0x1')]('/',controller[_0xae78('0x2')]);module[_0xae78('0x3')]=router; \ No newline at end of file +var _0x6de5=['post','exports','Router'];(function(_0x1e878b,_0x48ab1c){var _0x1752e3=function(_0x32c696){while(--_0x32c696){_0x1e878b['push'](_0x1e878b['shift']());}};_0x1752e3(++_0x48ab1c);}(_0x6de5,0x161));var _0x56de=function(_0x3db257,_0x244919){_0x3db257=_0x3db257-0x0;var _0x33e2a7=_0x6de5[_0x3db257];return _0x33e2a7;};'use strict';var express=require('express');var router=express[_0x56de('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x56de('0x1')]('/',controller['login']);module[_0x56de('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0174249..153f3b6 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x7a54,0x106));var _0x47a5=function(_0x5094b2,_0x58ac9){_0x5094b2=_0x5094b2-0x0;var _0x57d87f=_0x7a54[_0x5094b2];return _0x57d87f;};'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 f5c1e07..6193f0e 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 _0x4bc3=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','../user/user.controller.js'];(function(_0x56e656,_0x5c394c){var _0x1fe819=function(_0x16cd9e){while(--_0x16cd9e){_0x56e656['push'](_0x56e656['shift']());}};_0x1fe819(++_0x5c394c);}(_0x4bc3,0x130));var _0x34bc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4bc3[_0x46698a];return _0x356db0;};'use strict';var express=require(_0x34bc('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x34bc('0x1'));var authService=require(_0x34bc('0x2'));router[_0x34bc('0x3')]('/',controller[_0x34bc('0x4')]);router[_0x34bc('0x3')](_0x34bc('0x5'),controller[_0x34bc('0x6')],authService[_0x34bc('0x7')],userController[_0x34bc('0x4')],authService[_0x34bc('0x8')]);module['exports']=router; \ No newline at end of file +var _0x999b=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','login','setTokenCookie','exports','passport','./authGoogle.controller'];(function(_0x516746,_0xf34c3f){var _0x20b386=function(_0xba4d6){while(--_0xba4d6){_0x516746['push'](_0x516746['shift']());}};_0x20b386(++_0xf34c3f);}(_0x999b,0xe4));var _0xb999=function(_0x88a36a,_0x130ebd){_0x88a36a=_0x88a36a-0x0;var _0x36886e=_0x999b[_0x88a36a];return _0x36886e;};'use strict';var express=require('express');var passport=require(_0xb999('0x0'));var router=express['Router']();var controller=require(_0xb999('0x1'));var userController=require(_0xb999('0x2'));var authService=require(_0xb999('0x3'));router[_0xb999('0x4')]('/',controller['login']);router['get'](_0xb999('0x5'),controller[_0xb999('0x6')],authService['isMiddleware'],userController[_0xb999('0x7')],authService[_0xb999('0x8')]);module[_0xb999('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 0a9a6b1..bfce891 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 _0xf67d=['MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local-login','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','name','password','salt','role','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch'];(function(_0x3f9924,_0x2b66d6){var _0x1fb85e=function(_0x2ca373){while(--_0x2ca373){_0x3f9924['push'](_0x3f9924['shift']());}};_0x1fb85e(++_0x2b66d6);}(_0xf67d,0x1d0));var _0xdf67=function(_0x329318,_0x404671){_0x329318=_0x329318-0x0;var _0x2fa87f=_0xf67d[_0x329318];return _0x2fa87f;};'use strict';var util=require(_0xdf67('0x0'));var passport=require(_0xdf67('0x1'));var LocalStrategy=require(_0xdf67('0x2'))[_0xdf67('0x3')];var jayson=require(_0xdf67('0x4'));var _=require(_0xdf67('0x5'));var rs=require('randomstring');var moment=require(_0xdf67('0x6'));var db=require(_0xdf67('0x7'))['db'];var authService=require(_0xdf67('0x8'));var utils=require(_0xdf67('0x9'));var client=jayson['client'][_0xdf67('0xa')]({'port':0x232b});function localAuthenticate(_0x418c13,_0x4395f1,_0xcb6cd1,_0x530c5f){var _0x33a100,_0x4d192b;return db[_0xdf67('0xb')][_0xdf67('0xc')]({'where':{'id':0x1},'attributes':[_0xdf67('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x55fc59){_0x33a100=_0x55fc59;return _0x418c13[_0xdf67('0xc')]({'attributes':['id',_0xdf67('0xe'),_0xdf67('0xf'),_0xdf67('0x10'),_0xdf67('0x11'),'disabled','blocked','blockedAt',_0xdf67('0x12')],'where':{'name':_0x4395f1,'role':{'$or':[_0xdf67('0x13'),_0xdf67('0x14'),_0xdf67('0x15')]}}});})[_0xdf67('0x16')](function(_0x325453){if(!_0x325453||_0x325453&&_0x325453[_0xdf67('0xe')]!==_0x4395f1){throw new Error(_0xdf67('0x17'));}else{_0x4d192b=_0x325453;return _0x4d192b;}})[_0xdf67('0x16')](function(){_0x4d192b[_0xdf67('0x18')](_0xcb6cd1,function(_0x4562b5,_0x2a1d68){var _0x500a38=_0x4d192b[_0xdf67('0x12')]+0x1;if(_0x4562b5){return _0x530c5f(_0x4562b5);}else if(!_0x2a1d68){if(_0x4d192b[_0xdf67('0x19')]){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else if(_0x33a100['allowedLoginAttempts']>0x0){if(_0x4d192b['blocked']){if(_0x33a100[_0xdf67('0x1a')]>0x0){if(moment(_0x4d192b[_0xdf67('0x1b')])[_0xdf67('0x1c')](_0x33a100[_0xdf67('0x1a')],_0xdf67('0x1d'))>moment()){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else{return utils[_0xdf67('0x1e')](_0x4d192b,_0x500a38,![],null)[_0xdf67('0x16')](function(){return _0x530c5f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{if(_0x500a38>=_0x33a100[_0xdf67('0xd')]){return utils[_0xdf67('0x1e')](_0x4d192b,0x0,!![],moment())['then'](function(){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});});}else{return utils[_0xdf67('0x1e')](_0x4d192b,_0x500a38,![],null)['then'](function(){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});});}}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{if(_0x4d192b[_0xdf67('0x19')]){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else if(_0x33a100[_0xdf67('0xd')]>0x0){if(_0x4d192b[_0xdf67('0x1f')]){if(_0x33a100['blockDuration']>0x0){if(moment(_0x4d192b[_0xdf67('0x1b')])[_0xdf67('0x1c')](_0x33a100[_0xdf67('0x1a')],_0xdf67('0x1d'))>moment()){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else{return utils[_0xdf67('0x1e')](_0x4d192b,0x0,![],null)['then'](function(){return utils[_0xdf67('0x20')](_0x4d192b);})[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);});}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{return utils[_0xdf67('0x1e')](_0x4d192b,0x0,![],null)[_0xdf67('0x16')](function(){return utils[_0xdf67('0x20')](_0x4d192b);})[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);})[_0xdf67('0x21')](function(_0x50dd37){return _0x530c5f(null,![],_0x50dd37);});}}else{if(_0x4d192b['blocked']){return _0x530c5f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xdf67('0x20')](_0x4d192b)[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);});}}}});})[_0xdf67('0x21')](function(_0x2ae4cb){return _0x530c5f(null,![],_0x2ae4cb);});}function sendServiceMail(_0x4dda82){return db[_0xdf67('0x22')][_0xdf67('0x23')]({'where':{'service':!![]},'attributes':['id',_0xdf67('0xe'),_0xdf67('0x24')],'include':[{'model':db['MailServerOut'],'as':_0xdf67('0x25')}]})[_0xdf67('0x16')](function(_0x456dbb){if(!_0x456dbb){throw new Error(_0xdf67('0x26'));}var _0x55d811={'tls':{'rejectUnauthorized':![]}};if(_0x456dbb[_0xdf67('0x25')][_0xdf67('0x27')]){_0x55d811['service']=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x27')];}else{_0x55d811[_0xdf67('0x28')]=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x28')];_0x55d811['port']=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x29')];_0x55d811[_0xdf67('0x2a')]=_0x456dbb['Smtp'][_0xdf67('0x2a')];}if(_0x456dbb[_0xdf67('0x25')][_0xdf67('0x2b')]){_0x55d811[_0xdf67('0x2c')]={'user':_0x456dbb['Smtp'][_0xdf67('0x14')],'pass':_0x456dbb['Smtp'][_0xdf67('0x2d')]};}var _0xaab50d={'account':_0x55d811,'message':_[_0xdf67('0x2e')]({'from':util[_0xdf67('0x2f')](_0xdf67('0x30'),_0x456dbb['name'],_0x456dbb[_0xdf67('0x24')]||_0x456dbb['Smtp']['user'])},_0x4dda82)};return client[_0xdf67('0x31')](_0xdf67('0x32'),_0xaab50d);})[_0xdf67('0x16')](function(_0x36a842){if(_0x36a842[_0xdf67('0x33')]){throw new Error(util[_0xdf67('0x2f')](_0xdf67('0x34'),_0x36a842[_0xdf67('0x33')][_0xdf67('0x35')]||JSON['stringify'](_0x36a842[_0xdf67('0x33')])));}return!![];});}function handleError(_0x55ec37,_0x5f0c42,_0x2103de){return _0x55ec37[_0xdf67('0x36')](_0x5f0c42||0x1f4)[_0xdf67('0x37')]({'message':_0x2103de?_0x2103de[_0xdf67('0x35')]||_0x2103de:''});}exports['login']=function(_0x22597e,_0x589501,_0x491916){passport[_0xdf67('0x18')](_0xdf67('0x38'),function(_0xcb2404,_0x41b768,_0x14345b){var _0x14df0d=_0xcb2404||_0x14345b;if(_0x14df0d){return handleError(_0x589501,0x191,_0x14df0d);}if(!_0x41b768){return handleError(_0x589501,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2773ad={'payload':{'id':_0x41b768['id'],'role':_0x41b768[_0xdf67('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xdf67('0x39')](_0x2773ad)['then'](function(_0x4bb181){_0x589501[_0xdf67('0x3a')]({'id':_0x41b768['id'],'token':_0x4bb181,'statusCall':'','isAlreadyLogged':_0x41b768['online']});});}})(_0x22597e,_0x589501,_0x491916);};exports['forgot']=function(_0x520c00,_0x4d7372,_0x15ab66){if(!_0x520c00[_0xdf67('0x3b')]['email']){return handleError(_0x4d7372,0x1f4,{'message':_0xdf67('0x3c')});}var _0x57c9dd=rs[_0xdf67('0x3d')]();_0x520c00['body'][_0xdf67('0x24')]=_0x520c00[_0xdf67('0x3b')][_0xdf67('0x24')][_0xdf67('0x3e')]()[_0xdf67('0x3f')]();var _0x486d41;return db[_0xdf67('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xdf67('0x1a')],'raw':!![]})[_0xdf67('0x16')](function(_0x314c47){_0x486d41=_0x314c47;return db[_0xdf67('0x40')]['find']({'where':{'email':_0x520c00[_0xdf67('0x3b')][_0xdf67('0x24')]}});})[_0xdf67('0x16')](function(_0x28422d){if(!_0x28422d){throw new Error(_0xdf67('0x41'));}if(_0x28422d['disabled']){throw new Error(_0xdf67('0x42'));}if(_0x28422d['blocked']){if(moment(_0x28422d['blockedAt'])[_0xdf67('0x1c')](_0x486d41[_0xdf67('0x1a')],'minutes')>moment()){throw new Error(_0xdf67('0x43'));}else{_0x28422d['blocked']=![];_0x28422d['blockedAt']=null;}}_0x28422d['resetPasswordToken']=_0x57c9dd;_0x28422d[_0xdf67('0x44')]=Date[_0xdf67('0x45')]()+0x36ee80;return _0x28422d[_0xdf67('0x46')]();})[_0xdf67('0x16')](function(){return sendServiceMail({'to':_0x520c00[_0xdf67('0x3b')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xdf67('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x520c00[_0xdf67('0x48')][_0xdf67('0x28')]+'/reset/'+_0x57c9dd+'\x0a\x0a'+_0xdf67('0x49')});})[_0xdf67('0x16')](function(){_0x4d7372[_0xdf67('0x36')](0xc8)[_0xdf67('0x37')]({'message':_0xdf67('0x4a')});})[_0xdf67('0x21')](function(_0x2463d6){return handleError(_0x4d7372,0x1f4,_0x2463d6);});};exports[_0xdf67('0x4b')]=function(_0x1365e3,_0x54694e,_0x291f1d){return db[_0xdf67('0x40')][_0xdf67('0x23')]({'where':{'resetPasswordToken':_0x1365e3['params'][_0xdf67('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xdf67('0x45')]()}}})[_0xdf67('0x16')](function(_0x3d2953){if(!_0x3d2953){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xdf67('0xb')]['findOne']({'attributes':['id',_0xdf67('0x4d'),_0xdf67('0x4e'),_0xdf67('0x4f')]})[_0xdf67('0x16')](function(_0x20c9fb){if(_0x20c9fb[_0xdf67('0x4d')])authService['validatePasswordPattern'](_0x1365e3[_0xdf67('0x3b')][_0xdf67('0xf')]);if(!_0x20c9fb['enforcePasswordHistory']||!_0x3d2953['previousPasswords'])return _0x3d2953;authService['validatePasswordHistory'](_0x1365e3['body']['password'],_0x3d2953[_0xdf67('0x50')],_0x20c9fb['passwordHistoryLimit']);return _0x3d2953;})[_0xdf67('0x16')](function(){_0x3d2953[_0xdf67('0xf')]=_0x1365e3[_0xdf67('0x3b')]['password'];_0x3d2953[_0xdf67('0x51')]=null;_0x3d2953['resetPasswordExpires']=null;return _0x3d2953[_0xdf67('0x46')]();});})[_0xdf67('0x16')](function(){_0x54694e[_0xdf67('0x36')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xdf67('0x21')](function(_0x3df994){return handleError(_0x54694e,0x1f4,_0x3df994);});};passport[_0xdf67('0x52')](_0xdf67('0x38'),new LocalStrategy({'usernameField':_0xdf67('0xe'),'passwordField':_0xdf67('0xf')},function(_0x4deed1,_0x47ffca,_0x5409f6){return localAuthenticate(db[_0xdf67('0x40')],_0x4deed1,_0x47ffca,_0x5409f6);})); \ No newline at end of file +var _0x44c3=['moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','admin','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','name','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','merge','format','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','passport','passport-local','Strategy','lodash','randomstring'];(function(_0x26f4a8,_0x9bdd19){var _0x2c3ad6=function(_0x14df2d){while(--_0x14df2d){_0x26f4a8['push'](_0x26f4a8['shift']());}};_0x2c3ad6(++_0x9bdd19);}(_0x44c3,0x14f));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var passport=require(_0x344c('0x0'));var LocalStrategy=require(_0x344c('0x1'))[_0x344c('0x2')];var jayson=require('jayson/promise');var _=require(_0x344c('0x3'));var rs=require(_0x344c('0x4'));var moment=require(_0x344c('0x5'));var db=require(_0x344c('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x344c('0x7'));var client=jayson[_0x344c('0x8')][_0x344c('0x9')]({'port':0x232b});function localAuthenticate(_0x4fce38,_0x3b11a6,_0xedf30d,_0x3e7138){var _0x4f0311,_0x1331f8;return db[_0x344c('0xa')][_0x344c('0xb')]({'where':{'id':0x1},'attributes':[_0x344c('0xc'),_0x344c('0xd')],'raw':!![]})[_0x344c('0xe')](function(_0x4644b7){_0x4f0311=_0x4644b7;return _0x4fce38[_0x344c('0xb')]({'attributes':['id','name',_0x344c('0xf'),_0x344c('0x10'),'role',_0x344c('0x11'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x3b11a6,'role':{'$or':[_0x344c('0x12'),_0x344c('0x13'),_0x344c('0x14')]}}});})[_0x344c('0xe')](function(_0x208b8b){if(!_0x208b8b||_0x208b8b&&_0x208b8b['name']!==_0x3b11a6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1331f8=_0x208b8b;return _0x1331f8;}})['then'](function(){_0x1331f8[_0x344c('0x15')](_0xedf30d,function(_0xfbc051,_0x352a3f){var _0x2cf2a7=_0x1331f8[_0x344c('0x16')]+0x1;if(_0xfbc051){return _0x3e7138(_0xfbc051);}else if(!_0x352a3f){if(_0x1331f8[_0x344c('0x11')]){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else if(_0x4f0311[_0x344c('0xc')]>0x0){if(_0x1331f8[_0x344c('0x18')]){if(_0x4f0311['blockDuration']>0x0){if(moment(_0x1331f8[_0x344c('0x19')])['add'](_0x4f0311[_0x344c('0xd')],_0x344c('0x1a'))>moment()){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils['clearBlockUser'](_0x1331f8,_0x2cf2a7,![],null)[_0x344c('0xe')](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{if(_0x2cf2a7>=_0x4f0311[_0x344c('0xc')]){return utils[_0x344c('0x1b')](_0x1331f8,0x0,!![],moment())['then'](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}else{return utils['clearBlockUser'](_0x1331f8,_0x2cf2a7,![],null)[_0x344c('0xe')](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{if(_0x1331f8[_0x344c('0x11')]){return _0x3e7138(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4f0311[_0x344c('0xc')]>0x0){if(_0x1331f8[_0x344c('0x18')]){if(_0x4f0311['blockDuration']>0x0){if(moment(_0x1331f8[_0x344c('0x19')])[_0x344c('0x1c')](_0x4f0311['blockDuration'],_0x344c('0x1a'))>moment()){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils[_0x344c('0x1b')](_0x1331f8,0x0,![],null)['then'](function(){return utils[_0x344c('0x1d')](_0x1331f8);})[_0x344c('0xe')](function(){return _0x3e7138(null,_0x1331f8);});}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{return utils[_0x344c('0x1b')](_0x1331f8,0x0,![],null)[_0x344c('0xe')](function(){return utils[_0x344c('0x1d')](_0x1331f8);})[_0x344c('0xe')](function(){return _0x3e7138(null,_0x1331f8);})[_0x344c('0x1e')](function(_0x2c3b99){return _0x3e7138(null,![],_0x2c3b99);});}}else{if(_0x1331f8[_0x344c('0x18')]){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils[_0x344c('0x1d')](_0x1331f8)['then'](function(){return _0x3e7138(null,_0x1331f8);});}}}});})['catch'](function(_0x13d329){return _0x3e7138(null,![],_0x13d329);});}function sendServiceMail(_0x177b17){return db[_0x344c('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x344c('0x20'),'email'],'include':[{'model':db[_0x344c('0x21')],'as':'Smtp'}]})[_0x344c('0xe')](function(_0x35a00d){if(!_0x35a00d){throw new Error(_0x344c('0x22'));}var _0x25ffb2={'tls':{'rejectUnauthorized':![]}};if(_0x35a00d[_0x344c('0x23')][_0x344c('0x24')]){_0x25ffb2[_0x344c('0x24')]=_0x35a00d[_0x344c('0x23')][_0x344c('0x24')];}else{_0x25ffb2[_0x344c('0x25')]=_0x35a00d['Smtp'][_0x344c('0x25')];_0x25ffb2[_0x344c('0x26')]=_0x35a00d['Smtp'][_0x344c('0x26')];_0x25ffb2['secure']=_0x35a00d[_0x344c('0x23')][_0x344c('0x27')];}if(_0x35a00d['Smtp'][_0x344c('0x28')]){_0x25ffb2[_0x344c('0x29')]={'user':_0x35a00d[_0x344c('0x23')][_0x344c('0x13')],'pass':_0x35a00d[_0x344c('0x23')]['pass']};}var _0x14b071={'account':_0x25ffb2,'message':_[_0x344c('0x2a')]({'from':util[_0x344c('0x2b')]('\x22%s\x22\x20<%s>',_0x35a00d[_0x344c('0x20')],_0x35a00d[_0x344c('0x2c')]||_0x35a00d[_0x344c('0x23')]['user'])},_0x177b17)};return client[_0x344c('0x2d')](_0x344c('0x2e'),_0x14b071);})[_0x344c('0xe')](function(_0x454d34){if(_0x454d34['error']){throw new Error(util[_0x344c('0x2b')](_0x344c('0x2f'),_0x454d34[_0x344c('0x30')][_0x344c('0x31')]||JSON['stringify'](_0x454d34['error'])));}return!![];});}function handleError(_0x223563,_0x342fac,_0x23f799){return _0x223563['status'](_0x342fac||0x1f4)[_0x344c('0x32')]({'message':_0x23f799?_0x23f799[_0x344c('0x31')]||_0x23f799:''});}exports[_0x344c('0x33')]=function(_0x5785df,_0x5f7e36,_0xd90fa3){passport['authenticate'](_0x344c('0x34'),function(_0x5d5578,_0x11db4d,_0xcec739){var _0x2fab18=_0x5d5578||_0xcec739;if(_0x2fab18){return handleError(_0x5f7e36,0x191,_0x2fab18);}if(!_0x11db4d){return handleError(_0x5f7e36,0x194,{'message':_0x344c('0x35')});}else{var _0x1b3e99={'payload':{'id':_0x11db4d['id'],'role':_0x11db4d[_0x344c('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0x344c('0x37')](_0x1b3e99)['then'](function(_0x4104c2){_0x5f7e36['json']({'id':_0x11db4d['id'],'token':_0x4104c2,'statusCall':'','isAlreadyLogged':_0x11db4d[_0x344c('0x38')]});});}})(_0x5785df,_0x5f7e36,_0xd90fa3);};exports['forgot']=function(_0xb6ddee,_0x5347b6,_0x6b7ff3){if(!_0xb6ddee[_0x344c('0x39')][_0x344c('0x2c')]){return handleError(_0x5347b6,0x1f4,{'message':_0x344c('0x3a')});}var _0x19d921=rs[_0x344c('0x3b')]();_0xb6ddee[_0x344c('0x39')]['email']=_0xb6ddee['body'][_0x344c('0x2c')][_0x344c('0x3c')]()[_0x344c('0x3d')]();var _0xbd8e7e;return db[_0x344c('0xa')][_0x344c('0xb')]({'where':{'id':0x1},'attributes':[_0x344c('0xc'),'blockDuration'],'raw':!![]})[_0x344c('0xe')](function(_0xf514dd){_0xbd8e7e=_0xf514dd;return db[_0x344c('0x3e')][_0x344c('0x3f')]({'where':{'email':_0xb6ddee[_0x344c('0x39')][_0x344c('0x2c')]}});})[_0x344c('0xe')](function(_0x3ab504){if(!_0x3ab504){throw new Error(_0x344c('0x40'));}if(_0x3ab504[_0x344c('0x11')]){throw new Error(_0x344c('0x41'));}if(_0x3ab504[_0x344c('0x18')]){if(moment(_0x3ab504[_0x344c('0x19')])[_0x344c('0x1c')](_0xbd8e7e['blockDuration'],_0x344c('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3ab504[_0x344c('0x18')]=![];_0x3ab504[_0x344c('0x19')]=null;}}_0x3ab504['resetPasswordToken']=_0x19d921;_0x3ab504[_0x344c('0x42')]=Date['now']()+0x36ee80;return _0x3ab504[_0x344c('0x43')]();})[_0x344c('0xe')](function(){return sendServiceMail({'to':_0xb6ddee['body'][_0x344c('0x2c')],'subject':_0x344c('0x44'),'text':_0x344c('0x45')+_0x344c('0x46')+_0x344c('0x47')+_0xb6ddee[_0x344c('0x48')]['host']+_0x344c('0x49')+_0x19d921+'\x0a\x0a'+_0x344c('0x4a')});})[_0x344c('0xe')](function(){_0x5347b6[_0x344c('0x4b')](0xc8)[_0x344c('0x32')]({'message':'Reset\x20Email\x20sent!'});})[_0x344c('0x1e')](function(_0xc1c5fe){return handleError(_0x5347b6,0x1f4,_0xc1c5fe);});};exports['reset']=function(_0x53963e,_0x18577e,_0x556548){return db[_0x344c('0x3e')][_0x344c('0x3f')]({'where':{'resetPasswordToken':_0x53963e[_0x344c('0x4c')][_0x344c('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2481d0){if(!_0x2481d0){throw new Error(_0x344c('0x4e'));}return db[_0x344c('0xa')][_0x344c('0xb')]({'attributes':['id','securePassword',_0x344c('0x4f'),_0x344c('0x50')]})['then'](function(_0x297925){if(_0x297925[_0x344c('0x51')])authService[_0x344c('0x52')](_0x53963e[_0x344c('0x39')][_0x344c('0xf')]);if(!_0x297925[_0x344c('0x4f')]||!_0x2481d0[_0x344c('0x53')])return _0x2481d0;authService['validatePasswordHistory'](_0x53963e[_0x344c('0x39')][_0x344c('0xf')],_0x2481d0[_0x344c('0x53')],_0x297925[_0x344c('0x50')]);return _0x2481d0;})[_0x344c('0xe')](function(){_0x2481d0['password']=_0x53963e['body'][_0x344c('0xf')];_0x2481d0['resetPasswordToken']=null;_0x2481d0[_0x344c('0x42')]=null;return _0x2481d0[_0x344c('0x43')]();});})[_0x344c('0xe')](function(){_0x18577e[_0x344c('0x4b')](0xc8)[_0x344c('0x32')]({'message':_0x344c('0x54')});})[_0x344c('0x1e')](function(_0x125c4a){return handleError(_0x18577e,0x1f4,_0x125c4a);});};passport['use'](_0x344c('0x34'),new LocalStrategy({'usernameField':_0x344c('0x20'),'passwordField':_0x344c('0xf')},function(_0x4fe5b2,_0x1f0794,_0x326ffc){return localAuthenticate(db['User'],_0x4fe5b2,_0x1f0794,_0x326ffc);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 577fcff..c263678 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 _0xd1be=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0xdf5b1e,_0x35a3f4){var _0x3df3e0=function(_0x4b784a){while(--_0x4b784a){_0xdf5b1e['push'](_0xdf5b1e['shift']());}};_0x3df3e0(++_0x35a3f4);}(_0xd1be,0x1f2));var _0xed1b=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xd1be[_0x486f1d];return _0x5a2c2d;};'use strict';var express=require(_0xed1b('0x0'));var router=express[_0xed1b('0x1')]();var controller=require(_0xed1b('0x2'));router[_0xed1b('0x3')]('/',controller[_0xed1b('0x4')]);router[_0xed1b('0x3')]('/forgot',controller[_0xed1b('0x5')]);router['post']('/reset/:token',controller[_0xed1b('0x6')]);module[_0xed1b('0x7')]=router; \ No newline at end of file +var _0xa068=['login','forgot','/reset/:token','express','Router','./authLocal.controller','post'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xa068,0xc0));var _0x8a06=function(_0x32dae5,_0x1689b2){_0x32dae5=_0x32dae5-0x0;var _0x5d1a40=_0xa068[_0x32dae5];return _0x5d1a40;};'use strict';var express=require(_0x8a06('0x0'));var router=express[_0x8a06('0x1')]();var controller=require(_0x8a06('0x2'));router[_0x8a06('0x3')]('/',controller[_0x8a06('0x4')]);router[_0x8a06('0x3')]('/forgot',controller[_0x8a06('0x5')]);router[_0x8a06('0x3')](_0x8a06('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 66c035d..b3327d5 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 _0x2911=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x1c4d73,_0x2c23b1){var _0x598326=function(_0x32e995){while(--_0x32e995){_0x1c4d73['push'](_0x1c4d73['shift']());}};_0x598326(++_0x2c23b1);}(_0x2911,0xf2));var _0x1291=function(_0x1e4ec0,_0xac7bca){_0x1e4ec0=_0x1e4ec0-0x0;var _0x5579dd=_0x2911[_0x1e4ec0];return _0x5579dd;};'use strict';var Sequelize=require(_0x1291('0x0'));module['exports']={'name':{'type':Sequelize[_0x1291('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1291('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1291('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x426f=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x426f,0xf3));var _0xf426=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0x426f[_0x2b85d5];return _0xe8c96f;};'use strict';var Sequelize=require('sequelize');module[_0xf426('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xf426('0x1')]},'description':{'type':Sequelize[_0xf426('0x1')]},'status':{'type':Sequelize[_0xf426('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf426('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index bfbe8e3..cee8116 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 _0xed46=['rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','Automation','rawAttributes','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','fields','includeAll','find','create','body','addConditions','Condition','omit','ids','length','map','getConditions','addActions','Action','getActions','eml-format'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xed46,0x1df));var _0x6ed4=function(_0x5a2ccb,_0x4e11be){_0x5a2ccb=_0x5a2ccb-0x0;var _0x3c0045=_0xed46[_0x5a2ccb];return _0x3c0045;};'use strict';var emlformat=require(_0x6ed4('0x0'));var rimraf=require(_0x6ed4('0x1'));var zipdir=require(_0x6ed4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ed4('0x3'));var moment=require(_0x6ed4('0x4'));var BPromise=require(_0x6ed4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ed4('0x6'));var sox=require(_0x6ed4('0x7'));var csv=require(_0x6ed4('0x8'));var ejs=require(_0x6ed4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ed4('0xa'));var squel=require(_0x6ed4('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ed4('0xc'));var deskjs=require(_0x6ed4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6ed4('0xe'));var Papa=require('papaparse');var Redis=require(_0x6ed4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6ed4('0x10'));var as=require(_0x6ed4('0x11'));var hardwareService=require(_0x6ed4('0x12'));var logger=require('../../config/logger')(_0x6ed4('0x13'));var utils=require(_0x6ed4('0x14'));var config=require(_0x6ed4('0x15'));var licenseUtil=require(_0x6ed4('0x16'));var db=require(_0x6ed4('0x17'))['db'];function respondWithStatusCode(_0x4a816c,_0x4dc6b3){_0x4dc6b3=_0x4dc6b3||0xcc;return function(_0x452119){if(_0x452119){return _0x4a816c[_0x6ed4('0x18')](_0x4dc6b3);}return _0x4a816c[_0x6ed4('0x19')](_0x4dc6b3)[_0x6ed4('0x1a')]();};}function respondWithResult(_0x1675e1,_0x3c2f3d){_0x3c2f3d=_0x3c2f3d||0xc8;return function(_0x37c33e){if(_0x37c33e){return _0x1675e1['status'](_0x3c2f3d)['json'](_0x37c33e);}};}function respondWithFilteredResult(_0x1a250e,_0x49c293){return function(_0x3ef7ac){if(_0x3ef7ac){var _0x5c87ca=typeof _0x49c293['offset']===_0x6ed4('0x1b')&&typeof _0x49c293[_0x6ed4('0x1c')]===_0x6ed4('0x1b');var _0x1f7c27=_0x3ef7ac[_0x6ed4('0x1d')];var _0xd520b3=_0x5c87ca?0x0:_0x49c293[_0x6ed4('0x1e')];var _0x5e1469=_0x5c87ca?_0x3ef7ac[_0x6ed4('0x1d')]:_0x49c293[_0x6ed4('0x1e')]+_0x49c293[_0x6ed4('0x1c')];var _0x57e386;if(_0x5e1469>=_0x1f7c27){_0x5e1469=_0x1f7c27;_0x57e386=0xc8;}else{_0x57e386=0xce;}_0x1a250e[_0x6ed4('0x19')](_0x57e386);return _0x1a250e['set'](_0x6ed4('0x1f'),_0xd520b3+'-'+_0x5e1469+'/'+_0x1f7c27)[_0x6ed4('0x20')](_0x3ef7ac);}return null;};}function patchUpdates(_0x51ed63){return function(_0x514fec){try{jsonpatch[_0x6ed4('0x21')](_0x514fec,_0x51ed63,!![]);}catch(_0x35a327){return BPromise[_0x6ed4('0x22')](_0x35a327);}return _0x514fec['save']();};}function saveUpdates(_0x58c5e2,_0x454932){return function(_0x5efdb1){if(_0x5efdb1){return _0x5efdb1[_0x6ed4('0x23')](_0x58c5e2)[_0x6ed4('0x24')](function(_0x36cbda){return _0x36cbda;});}return null;};}function removeEntity(_0x5360b1,_0x2d1501){return function(_0x4a1e01){if(_0x4a1e01){return _0x4a1e01[_0x6ed4('0x25')]()[_0x6ed4('0x24')](function(){_0x5360b1[_0x6ed4('0x19')](0xcc)[_0x6ed4('0x1a')]();});}};}function handleEntityNotFound(_0x3f45ef,_0x2f64f9){return function(_0x212d5b){if(!_0x212d5b){_0x3f45ef[_0x6ed4('0x18')](0x194);}return _0x212d5b;};}function handleError(_0x58fec2,_0xa1a052){_0xa1a052=_0xa1a052||0x1f4;return function(_0x368cf0){logger[_0x6ed4('0x26')](_0x368cf0['stack']);if(_0x368cf0[_0x6ed4('0x27')]){delete _0x368cf0[_0x6ed4('0x27')];}_0x58fec2['status'](_0xa1a052)[_0x6ed4('0x28')](_0x368cf0);};}exports[_0x6ed4('0x29')]=function(_0x169bad,_0x54be03){var _0x3566f7={},_0x22c95a={},_0x190367={'count':0x0,'rows':[]};var _0x436a1c=_['map'](db[_0x6ed4('0x2a')][_0x6ed4('0x2b')],function(_0x24a006){return{'name':_0x24a006['fieldName'],'type':_0x24a006['type']['key']};});_0x22c95a[_0x6ed4('0x2c')]=_['map'](_0x436a1c,_0x6ed4('0x27'));_0x22c95a[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x169bad[_0x6ed4('0x2d')]);_0x22c95a['filters']=_[_0x6ed4('0x2f')](_0x22c95a[_0x6ed4('0x2c')],_0x22c95a[_0x6ed4('0x2d')]);_0x3566f7[_0x6ed4('0x30')]=_['intersection'](_0x22c95a[_0x6ed4('0x2c')],qs['fields'](_0x169bad['query']['fields']));_0x3566f7[_0x6ed4('0x30')]=_0x3566f7[_0x6ed4('0x30')]['length']?_0x3566f7[_0x6ed4('0x30')]:_0x22c95a[_0x6ed4('0x2c')];if(!_0x169bad['query'][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x3566f7[_0x6ed4('0x1c')]=qs['limit'](_0x169bad[_0x6ed4('0x2d')]['limit']);_0x3566f7[_0x6ed4('0x1e')]=qs[_0x6ed4('0x1e')](_0x169bad['query'][_0x6ed4('0x1e')]);}_0x3566f7[_0x6ed4('0x33')]=qs['sort'](_0x169bad['query'][_0x6ed4('0x34')]);_0x3566f7[_0x6ed4('0x35')]=qs['filters'](_[_0x6ed4('0x36')](_0x169bad['query'],_0x22c95a[_0x6ed4('0x37')]),_0x436a1c);if(_0x169bad[_0x6ed4('0x2d')][_0x6ed4('0x38')]){_0x3566f7[_0x6ed4('0x35')]=_[_0x6ed4('0x39')](_0x3566f7[_0x6ed4('0x35')],{'$or':_['map'](_0x436a1c,function(_0x4ad4bc){if(_0x4ad4bc[_0x6ed4('0x3a')]!==_0x6ed4('0x3b')){var _0x51e8c9={};_0x51e8c9[_0x4ad4bc[_0x6ed4('0x27')]]={'$like':'%'+_0x169bad[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x51e8c9;}})});}_0x3566f7=_[_0x6ed4('0x39')]({},_0x3566f7,_0x169bad[_0x6ed4('0x3c')]);var _0x2b84c5={'where':_0x3566f7[_0x6ed4('0x35')]};return db[_0x6ed4('0x2a')][_0x6ed4('0x1d')](_0x2b84c5)[_0x6ed4('0x24')](function(_0x37a318){_0x190367[_0x6ed4('0x1d')]=_0x37a318;if(_0x169bad[_0x6ed4('0x2d')]['includeAll']){_0x3566f7[_0x6ed4('0x3d')]=[{'all':!![]}];}return db['Automation'][_0x6ed4('0x3e')](_0x3566f7);})[_0x6ed4('0x24')](function(_0xf422ba){_0x190367['rows']=_0xf422ba;return _0x190367;})[_0x6ed4('0x24')](respondWithFilteredResult(_0x54be03,_0x3566f7))[_0x6ed4('0x3f')](handleError(_0x54be03,null));};exports['show']=function(_0xf83cdb,_0x4461ec){var _0x482268={'raw':![],'where':{'id':_0xf83cdb[_0x6ed4('0x40')]['id']}},_0x39fbc9={};_0x39fbc9[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x2a')][_0x6ed4('0x2b')]);_0x39fbc9['query']=_['keys'](_0xf83cdb['query']);_0x39fbc9[_0x6ed4('0x37')]=_[_0x6ed4('0x2f')](_0x39fbc9[_0x6ed4('0x2c')],_0x39fbc9[_0x6ed4('0x2d')]);_0x482268[_0x6ed4('0x30')]=_['intersection'](_0x39fbc9[_0x6ed4('0x2c')],qs[_0x6ed4('0x41')](_0xf83cdb[_0x6ed4('0x2d')][_0x6ed4('0x41')]));_0x482268[_0x6ed4('0x30')]=_0x482268[_0x6ed4('0x30')]['length']?_0x482268[_0x6ed4('0x30')]:_0x39fbc9['model'];if(_0xf83cdb['query'][_0x6ed4('0x42')]){_0x482268[_0x6ed4('0x3d')]=[{'all':!![]}];}_0x482268=_[_0x6ed4('0x39')]({},_0x482268,_0xf83cdb[_0x6ed4('0x3c')]);return db[_0x6ed4('0x2a')][_0x6ed4('0x43')](_0x482268)[_0x6ed4('0x24')](handleEntityNotFound(_0x4461ec,null))[_0x6ed4('0x24')](respondWithResult(_0x4461ec,null))[_0x6ed4('0x3f')](handleError(_0x4461ec,null));};exports[_0x6ed4('0x44')]=function(_0x581103,_0x2787ca){return db['Automation'][_0x6ed4('0x44')](_0x581103[_0x6ed4('0x45')],{})[_0x6ed4('0x24')](respondWithResult(_0x2787ca,0xc9))['catch'](handleError(_0x2787ca,null));};exports[_0x6ed4('0x23')]=function(_0x29ed05,_0x5cff25){if(_0x29ed05[_0x6ed4('0x45')]['id']){delete _0x29ed05[_0x6ed4('0x45')]['id'];}return db['Automation'][_0x6ed4('0x43')]({'where':{'id':_0x29ed05[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x5cff25,null))['then'](saveUpdates(_0x29ed05['body'],null))[_0x6ed4('0x24')](respondWithResult(_0x5cff25,null))['catch'](handleError(_0x5cff25,null));};exports[_0x6ed4('0x25')]=function(_0x4aaa3d,_0x1ef738){return db[_0x6ed4('0x2a')]['find']({'where':{'id':_0x4aaa3d['params']['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x1ef738,null))[_0x6ed4('0x24')](removeEntity(_0x1ef738,null))[_0x6ed4('0x3f')](handleError(_0x1ef738,null));};exports[_0x6ed4('0x46')]=function(_0x4c8ac1,_0x45205f,_0x458c48){return db[_0x6ed4('0x47')][_0x6ed4('0x43')]({'where':{'id':_0x4c8ac1['params']['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x45205f,null))[_0x6ed4('0x24')](function(_0x3a6b76){if(_0x3a6b76){return _0x3a6b76['addConditions'](_0x4c8ac1[_0x6ed4('0x45')]['ids'],_[_0x6ed4('0x48')](_0x4c8ac1[_0x6ed4('0x45')],[_0x6ed4('0x49'),'id'])||{});}})[_0x6ed4('0x24')](respondWithResult(_0x45205f,null))[_0x6ed4('0x3f')](handleError(_0x45205f,null));};exports['getConditions']=function(_0x427545,_0x3c6fe9,_0x4831e0){var _0x5a6dbe={};var _0x2528d7={};var _0x4b820a;var _0x236371;return db[_0x6ed4('0x2a')]['findOne']({'where':{'id':_0x427545[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x3c6fe9,null))['then'](function(_0x3d0efa){if(_0x3d0efa){_0x4b820a=_0x3d0efa;_0x2528d7[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x47')]['rawAttributes']);_0x2528d7[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x427545[_0x6ed4('0x2d')]);_0x2528d7['filters']=_[_0x6ed4('0x2f')](_0x2528d7[_0x6ed4('0x2c')],_0x2528d7[_0x6ed4('0x2d')]);_0x5a6dbe['attributes']=_[_0x6ed4('0x2f')](_0x2528d7['model'],qs[_0x6ed4('0x41')](_0x427545['query'][_0x6ed4('0x41')]));_0x5a6dbe[_0x6ed4('0x30')]=_0x5a6dbe[_0x6ed4('0x30')][_0x6ed4('0x4a')]?_0x5a6dbe[_0x6ed4('0x30')]:_0x2528d7[_0x6ed4('0x2c')];_0x5a6dbe[_0x6ed4('0x33')]=qs[_0x6ed4('0x34')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x34')]);_0x5a6dbe[_0x6ed4('0x35')]=qs[_0x6ed4('0x37')](_[_0x6ed4('0x36')](_0x427545[_0x6ed4('0x2d')],_0x2528d7[_0x6ed4('0x37')]));if(_0x427545['query'][_0x6ed4('0x38')]){_0x5a6dbe['where']=_['merge'](_0x5a6dbe[_0x6ed4('0x35')],{'$or':_[_0x6ed4('0x4b')](_0x5a6dbe[_0x6ed4('0x30')],function(_0x4a8228){var _0x5f4a2f={};_0x5f4a2f[_0x4a8228]={'$like':'%'+_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x5f4a2f;})});}_0x5a6dbe=_[_0x6ed4('0x39')]({},_0x5a6dbe,_0x427545['options']);return _0x4b820a[_0x6ed4('0x4c')](_0x5a6dbe);}})['then'](function(_0x5d8432){if(_0x5d8432){_0x236371=_0x5d8432[_0x6ed4('0x4a')];if(!_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x5a6dbe[_0x6ed4('0x1c')]=qs[_0x6ed4('0x1c')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x1c')]);_0x5a6dbe['offset']=qs[_0x6ed4('0x1e')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x1e')]);}return _0x4b820a[_0x6ed4('0x4c')](_0x5a6dbe);}})['then'](function(_0x11735e){if(_0x11735e){return _0x11735e?{'count':_0x236371,'rows':_0x11735e}:null;}})[_0x6ed4('0x24')](respondWithResult(_0x3c6fe9,null))[_0x6ed4('0x3f')](handleError(_0x3c6fe9,null));};exports[_0x6ed4('0x4d')]=function(_0x3f360e,_0x227ad5,_0x56c437){return db[_0x6ed4('0x4e')]['find']({'where':{'id':_0x3f360e['params']['id']}})['then'](handleEntityNotFound(_0x227ad5,null))[_0x6ed4('0x24')](function(_0x93d648){if(_0x93d648){return _0x93d648['addActions'](_0x3f360e[_0x6ed4('0x45')][_0x6ed4('0x49')],_[_0x6ed4('0x48')](_0x3f360e[_0x6ed4('0x45')],[_0x6ed4('0x49'),'id'])||{});}})[_0x6ed4('0x24')](respondWithResult(_0x227ad5,null))[_0x6ed4('0x3f')](handleError(_0x227ad5,null));};exports[_0x6ed4('0x4f')]=function(_0x43bd2f,_0x44f077,_0x3cbd1e){var _0x236bd3={};var _0x8ab214={};var _0x360bb2;var _0x318d74;return db['Automation']['findOne']({'where':{'id':_0x43bd2f[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x44f077,null))['then'](function(_0x320fc5){if(_0x320fc5){_0x360bb2=_0x320fc5;_0x8ab214[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x4e')][_0x6ed4('0x2b')]);_0x8ab214[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x43bd2f[_0x6ed4('0x2d')]);_0x8ab214[_0x6ed4('0x37')]=_[_0x6ed4('0x2f')](_0x8ab214['model'],_0x8ab214['query']);_0x236bd3[_0x6ed4('0x30')]=_['intersection'](_0x8ab214['model'],qs[_0x6ed4('0x41')](_0x43bd2f['query'][_0x6ed4('0x41')]));_0x236bd3[_0x6ed4('0x30')]=_0x236bd3[_0x6ed4('0x30')][_0x6ed4('0x4a')]?_0x236bd3[_0x6ed4('0x30')]:_0x8ab214[_0x6ed4('0x2c')];_0x236bd3[_0x6ed4('0x33')]=qs[_0x6ed4('0x34')](_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x34')]);_0x236bd3[_0x6ed4('0x35')]=qs[_0x6ed4('0x37')](_[_0x6ed4('0x36')](_0x43bd2f['query'],_0x8ab214[_0x6ed4('0x37')]));if(_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x38')]){_0x236bd3['where']=_[_0x6ed4('0x39')](_0x236bd3[_0x6ed4('0x35')],{'$or':_['map'](_0x236bd3[_0x6ed4('0x30')],function(_0x3db0d9){var _0x3c6834={};_0x3c6834[_0x3db0d9]={'$like':'%'+_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x3c6834;})});}_0x236bd3=_[_0x6ed4('0x39')]({},_0x236bd3,_0x43bd2f[_0x6ed4('0x3c')]);return _0x360bb2['getActions'](_0x236bd3);}})[_0x6ed4('0x24')](function(_0x10f970){if(_0x10f970){_0x318d74=_0x10f970[_0x6ed4('0x4a')];if(!_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x236bd3[_0x6ed4('0x1c')]=qs['limit'](_0x43bd2f[_0x6ed4('0x2d')]['limit']);_0x236bd3['offset']=qs[_0x6ed4('0x1e')](_0x43bd2f['query'][_0x6ed4('0x1e')]);}return _0x360bb2[_0x6ed4('0x4f')](_0x236bd3);}})[_0x6ed4('0x24')](function(_0x17858d){if(_0x17858d){return _0x17858d?{'count':_0x318d74,'rows':_0x17858d}:null;}})[_0x6ed4('0x24')](respondWithResult(_0x44f077,null))['catch'](handleError(_0x44f077,null));}; \ No newline at end of file +var _0x9423=['stack','name','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','order','nolimit','Action','addActions','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9423,0x168));var _0x3942=function(_0x5a48c8,_0x540758){_0x5a48c8=_0x5a48c8-0x0;var _0x585c36=_0x9423[_0x5a48c8];return _0x585c36;};'use strict';var emlformat=require(_0x3942('0x0'));var rimraf=require(_0x3942('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3942('0x2'));var rp=require('request-promise');var moment=require(_0x3942('0x3'));var BPromise=require(_0x3942('0x4'));var Mustache=require('mustache');var util=require(_0x3942('0x5'));var path=require('path');var sox=require(_0x3942('0x6'));var csv=require(_0x3942('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3942('0x8'));var _=require(_0x3942('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3942('0xa'));var deskjs=require(_0x3942('0xb'));var toCsv=require(_0x3942('0x7'));var querystring=require(_0x3942('0xc'));var Papa=require(_0x3942('0xd'));var Redis=require(_0x3942('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3942('0xf'));var as=require(_0x3942('0x10'));var hardwareService=require(_0x3942('0x11'));var logger=require(_0x3942('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3942('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3942('0x14'))['db'];function respondWithStatusCode(_0x203d71,_0x261bf2){_0x261bf2=_0x261bf2||0xcc;return function(_0x14f2f9){if(_0x14f2f9){return _0x203d71['sendStatus'](_0x261bf2);}return _0x203d71[_0x3942('0x15')](_0x261bf2)['end']();};}function respondWithResult(_0x5e7101,_0x38cde7){_0x38cde7=_0x38cde7||0xc8;return function(_0x95afb4){if(_0x95afb4){return _0x5e7101['status'](_0x38cde7)[_0x3942('0x16')](_0x95afb4);}};}function respondWithFilteredResult(_0x529e1a,_0x1266ce){return function(_0x3e55eb){if(_0x3e55eb){var _0x51f5f7=typeof _0x1266ce['offset']===_0x3942('0x17')&&typeof _0x1266ce[_0x3942('0x18')]==='undefined';var _0x4373f2=_0x3e55eb[_0x3942('0x19')];var _0x1f3dd9=_0x51f5f7?0x0:_0x1266ce[_0x3942('0x1a')];var _0x42a1f2=_0x51f5f7?_0x3e55eb[_0x3942('0x19')]:_0x1266ce[_0x3942('0x1a')]+_0x1266ce[_0x3942('0x18')];var _0x1232b6;if(_0x42a1f2>=_0x4373f2){_0x42a1f2=_0x4373f2;_0x1232b6=0xc8;}else{_0x1232b6=0xce;}_0x529e1a[_0x3942('0x15')](_0x1232b6);return _0x529e1a[_0x3942('0x1b')](_0x3942('0x1c'),_0x1f3dd9+'-'+_0x42a1f2+'/'+_0x4373f2)[_0x3942('0x16')](_0x3e55eb);}return null;};}function patchUpdates(_0x3c5a43){return function(_0xb3d622){try{jsonpatch[_0x3942('0x1d')](_0xb3d622,_0x3c5a43,!![]);}catch(_0x2a71cb){return BPromise['reject'](_0x2a71cb);}return _0xb3d622[_0x3942('0x1e')]();};}function saveUpdates(_0x5f1da6,_0x3c96a0){return function(_0x111e0e){if(_0x111e0e){return _0x111e0e['update'](_0x5f1da6)[_0x3942('0x1f')](function(_0x2a041a){return _0x2a041a;});}return null;};}function removeEntity(_0x4fbe82,_0x5a9725){return function(_0x42099d){if(_0x42099d){return _0x42099d[_0x3942('0x20')]()[_0x3942('0x1f')](function(){_0x4fbe82[_0x3942('0x15')](0xcc)[_0x3942('0x21')]();});}};}function handleEntityNotFound(_0x4170ce,_0x267196){return function(_0x44631c){if(!_0x44631c){_0x4170ce[_0x3942('0x22')](0x194);}return _0x44631c;};}function handleError(_0x26b3e5,_0x978e71){_0x978e71=_0x978e71||0x1f4;return function(_0x2b613e){logger['error'](_0x2b613e[_0x3942('0x23')]);if(_0x2b613e[_0x3942('0x24')]){delete _0x2b613e[_0x3942('0x24')];}_0x26b3e5[_0x3942('0x15')](_0x978e71)['send'](_0x2b613e);};}exports['index']=function(_0x1e18b1,_0x28d491){var _0xb60d1c={},_0x29b9bf={},_0x4e8654={'count':0x0,'rows':[]};var _0x14c04d=_[_0x3942('0x25')](db[_0x3942('0x26')][_0x3942('0x27')],function(_0xf02a61){return{'name':_0xf02a61[_0x3942('0x28')],'type':_0xf02a61[_0x3942('0x29')]['key']};});_0x29b9bf[_0x3942('0x2a')]=_[_0x3942('0x25')](_0x14c04d,_0x3942('0x24'));_0x29b9bf[_0x3942('0x2b')]=_['keys'](_0x1e18b1['query']);_0x29b9bf[_0x3942('0x2c')]=_[_0x3942('0x2d')](_0x29b9bf[_0x3942('0x2a')],_0x29b9bf[_0x3942('0x2b')]);_0xb60d1c[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x29b9bf['model'],qs['fields'](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x2f')]));_0xb60d1c[_0x3942('0x2e')]=_0xb60d1c['attributes'][_0x3942('0x30')]?_0xb60d1c[_0x3942('0x2e')]:_0x29b9bf[_0x3942('0x2a')];if(!_0x1e18b1[_0x3942('0x2b')]['hasOwnProperty']('nolimit')){_0xb60d1c[_0x3942('0x18')]=qs[_0x3942('0x18')](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x18')]);_0xb60d1c[_0x3942('0x1a')]=qs['offset'](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x1a')]);}_0xb60d1c['order']=qs[_0x3942('0x31')](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x31')]);_0xb60d1c[_0x3942('0x32')]=qs[_0x3942('0x2c')](_[_0x3942('0x33')](_0x1e18b1[_0x3942('0x2b')],_0x29b9bf[_0x3942('0x2c')]),_0x14c04d);if(_0x1e18b1['query'][_0x3942('0x34')]){_0xb60d1c[_0x3942('0x32')]=_['merge'](_0xb60d1c['where'],{'$or':_[_0x3942('0x25')](_0x14c04d,function(_0x5bff1d){if(_0x5bff1d['type']!==_0x3942('0x35')){var _0xecd92e={};_0xecd92e[_0x5bff1d[_0x3942('0x24')]]={'$like':'%'+_0x1e18b1[_0x3942('0x2b')][_0x3942('0x34')]+'%'};return _0xecd92e;}})});}_0xb60d1c=_[_0x3942('0x36')]({},_0xb60d1c,_0x1e18b1[_0x3942('0x37')]);var _0x646f00={'where':_0xb60d1c[_0x3942('0x32')]};return db[_0x3942('0x26')][_0x3942('0x19')](_0x646f00)[_0x3942('0x1f')](function(_0x5e2b1b){_0x4e8654[_0x3942('0x19')]=_0x5e2b1b;if(_0x1e18b1['query'][_0x3942('0x38')]){_0xb60d1c[_0x3942('0x39')]=[{'all':!![]}];}return db['Automation'][_0x3942('0x3a')](_0xb60d1c);})[_0x3942('0x1f')](function(_0x502678){_0x4e8654[_0x3942('0x3b')]=_0x502678;return _0x4e8654;})[_0x3942('0x1f')](respondWithFilteredResult(_0x28d491,_0xb60d1c))['catch'](handleError(_0x28d491,null));};exports[_0x3942('0x3c')]=function(_0x253683,_0xde1b36){var _0xf55f68={'raw':![],'where':{'id':_0x253683[_0x3942('0x3d')]['id']}},_0x229195={};_0x229195[_0x3942('0x2a')]=_[_0x3942('0x3e')](db['Automation'][_0x3942('0x27')]);_0x229195[_0x3942('0x2b')]=_['keys'](_0x253683[_0x3942('0x2b')]);_0x229195[_0x3942('0x2c')]=_[_0x3942('0x2d')](_0x229195[_0x3942('0x2a')],_0x229195['query']);_0xf55f68[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x229195['model'],qs[_0x3942('0x2f')](_0x253683[_0x3942('0x2b')][_0x3942('0x2f')]));_0xf55f68['attributes']=_0xf55f68[_0x3942('0x2e')]['length']?_0xf55f68[_0x3942('0x2e')]:_0x229195['model'];if(_0x253683[_0x3942('0x2b')][_0x3942('0x38')]){_0xf55f68[_0x3942('0x39')]=[{'all':!![]}];}_0xf55f68=_[_0x3942('0x36')]({},_0xf55f68,_0x253683[_0x3942('0x37')]);return db['Automation'][_0x3942('0x3f')](_0xf55f68)[_0x3942('0x1f')](handleEntityNotFound(_0xde1b36,null))[_0x3942('0x1f')](respondWithResult(_0xde1b36,null))[_0x3942('0x40')](handleError(_0xde1b36,null));};exports[_0x3942('0x41')]=function(_0x168e43,_0x19e89b){return db[_0x3942('0x26')][_0x3942('0x41')](_0x168e43[_0x3942('0x42')],{})[_0x3942('0x1f')](respondWithResult(_0x19e89b,0xc9))[_0x3942('0x40')](handleError(_0x19e89b,null));};exports[_0x3942('0x43')]=function(_0x186777,_0x13d31c){if(_0x186777[_0x3942('0x42')]['id']){delete _0x186777[_0x3942('0x42')]['id'];}return db[_0x3942('0x26')][_0x3942('0x3f')]({'where':{'id':_0x186777[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x13d31c,null))[_0x3942('0x1f')](saveUpdates(_0x186777[_0x3942('0x42')],null))[_0x3942('0x1f')](respondWithResult(_0x13d31c,null))[_0x3942('0x40')](handleError(_0x13d31c,null));};exports[_0x3942('0x20')]=function(_0x37f168,_0x176ecf){return db[_0x3942('0x26')][_0x3942('0x3f')]({'where':{'id':_0x37f168[_0x3942('0x3d')]['id']}})['then'](handleEntityNotFound(_0x176ecf,null))[_0x3942('0x1f')](removeEntity(_0x176ecf,null))['catch'](handleError(_0x176ecf,null));};exports[_0x3942('0x44')]=function(_0x533af2,_0x7df920,_0x369bb1){return db[_0x3942('0x45')][_0x3942('0x3f')]({'where':{'id':_0x533af2[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x7df920,null))[_0x3942('0x1f')](function(_0x137173){if(_0x137173){return _0x137173['addConditions'](_0x533af2['body'][_0x3942('0x46')],_[_0x3942('0x47')](_0x533af2[_0x3942('0x42')],['ids','id'])||{});}})[_0x3942('0x1f')](respondWithResult(_0x7df920,null))[_0x3942('0x40')](handleError(_0x7df920,null));};exports[_0x3942('0x48')]=function(_0x2d530d,_0x16ecc4,_0x1e2662){var _0x11c84d={};var _0x307170={};var _0x5f20da;var _0x161f7b;return db[_0x3942('0x26')][_0x3942('0x49')]({'where':{'id':_0x2d530d['params']['id']}})['then'](handleEntityNotFound(_0x16ecc4,null))[_0x3942('0x1f')](function(_0x5eddff){if(_0x5eddff){_0x5f20da=_0x5eddff;_0x307170[_0x3942('0x2a')]=_['keys'](db['Condition'][_0x3942('0x27')]);_0x307170[_0x3942('0x2b')]=_[_0x3942('0x3e')](_0x2d530d[_0x3942('0x2b')]);_0x307170[_0x3942('0x2c')]=_['intersection'](_0x307170[_0x3942('0x2a')],_0x307170[_0x3942('0x2b')]);_0x11c84d[_0x3942('0x2e')]=_['intersection'](_0x307170[_0x3942('0x2a')],qs['fields'](_0x2d530d[_0x3942('0x2b')]['fields']));_0x11c84d[_0x3942('0x2e')]=_0x11c84d[_0x3942('0x2e')][_0x3942('0x30')]?_0x11c84d[_0x3942('0x2e')]:_0x307170[_0x3942('0x2a')];_0x11c84d[_0x3942('0x4a')]=qs[_0x3942('0x31')](_0x2d530d[_0x3942('0x2b')]['sort']);_0x11c84d[_0x3942('0x32')]=qs[_0x3942('0x2c')](_['pick'](_0x2d530d['query'],_0x307170[_0x3942('0x2c')]));if(_0x2d530d['query'][_0x3942('0x34')]){_0x11c84d[_0x3942('0x32')]=_['merge'](_0x11c84d[_0x3942('0x32')],{'$or':_[_0x3942('0x25')](_0x11c84d['attributes'],function(_0x420180){var _0x13dfd={};_0x13dfd[_0x420180]={'$like':'%'+_0x2d530d[_0x3942('0x2b')]['filter']+'%'};return _0x13dfd;})});}_0x11c84d=_[_0x3942('0x36')]({},_0x11c84d,_0x2d530d[_0x3942('0x37')]);return _0x5f20da[_0x3942('0x48')](_0x11c84d);}})[_0x3942('0x1f')](function(_0x4be7bc){if(_0x4be7bc){_0x161f7b=_0x4be7bc[_0x3942('0x30')];if(!_0x2d530d[_0x3942('0x2b')]['hasOwnProperty'](_0x3942('0x4b'))){_0x11c84d[_0x3942('0x18')]=qs[_0x3942('0x18')](_0x2d530d[_0x3942('0x2b')][_0x3942('0x18')]);_0x11c84d[_0x3942('0x1a')]=qs[_0x3942('0x1a')](_0x2d530d['query'][_0x3942('0x1a')]);}return _0x5f20da[_0x3942('0x48')](_0x11c84d);}})[_0x3942('0x1f')](function(_0x76898){if(_0x76898){return _0x76898?{'count':_0x161f7b,'rows':_0x76898}:null;}})[_0x3942('0x1f')](respondWithResult(_0x16ecc4,null))[_0x3942('0x40')](handleError(_0x16ecc4,null));};exports['addActions']=function(_0x21932c,_0x3f8b44,_0x4699ea){return db[_0x3942('0x4c')][_0x3942('0x3f')]({'where':{'id':_0x21932c[_0x3942('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3f8b44,null))['then'](function(_0xedb022){if(_0xedb022){return _0xedb022[_0x3942('0x4d')](_0x21932c[_0x3942('0x42')][_0x3942('0x46')],_[_0x3942('0x47')](_0x21932c[_0x3942('0x42')],[_0x3942('0x46'),'id'])||{});}})[_0x3942('0x1f')](respondWithResult(_0x3f8b44,null))[_0x3942('0x40')](handleError(_0x3f8b44,null));};exports[_0x3942('0x4e')]=function(_0x1394f0,_0x3878f4,_0x5908b4){var _0x471009={};var _0x5f59b0={};var _0x43c627;var _0x5c034b;return db['Automation'][_0x3942('0x49')]({'where':{'id':_0x1394f0[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x3878f4,null))['then'](function(_0x34c906){if(_0x34c906){_0x43c627=_0x34c906;_0x5f59b0[_0x3942('0x2a')]=_[_0x3942('0x3e')](db['Action'][_0x3942('0x27')]);_0x5f59b0[_0x3942('0x2b')]=_[_0x3942('0x3e')](_0x1394f0[_0x3942('0x2b')]);_0x5f59b0[_0x3942('0x2c')]=_['intersection'](_0x5f59b0['model'],_0x5f59b0['query']);_0x471009[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x5f59b0[_0x3942('0x2a')],qs['fields'](_0x1394f0['query'][_0x3942('0x2f')]));_0x471009[_0x3942('0x2e')]=_0x471009['attributes'][_0x3942('0x30')]?_0x471009[_0x3942('0x2e')]:_0x5f59b0[_0x3942('0x2a')];_0x471009['order']=qs[_0x3942('0x31')](_0x1394f0['query'][_0x3942('0x31')]);_0x471009[_0x3942('0x32')]=qs['filters'](_['pick'](_0x1394f0[_0x3942('0x2b')],_0x5f59b0[_0x3942('0x2c')]));if(_0x1394f0[_0x3942('0x2b')]['filter']){_0x471009[_0x3942('0x32')]=_[_0x3942('0x36')](_0x471009['where'],{'$or':_[_0x3942('0x25')](_0x471009['attributes'],function(_0x26ce0d){var _0x2046b2={};_0x2046b2[_0x26ce0d]={'$like':'%'+_0x1394f0[_0x3942('0x2b')][_0x3942('0x34')]+'%'};return _0x2046b2;})});}_0x471009=_[_0x3942('0x36')]({},_0x471009,_0x1394f0[_0x3942('0x37')]);return _0x43c627['getActions'](_0x471009);}})[_0x3942('0x1f')](function(_0x325559){if(_0x325559){_0x5c034b=_0x325559['length'];if(!_0x1394f0['query']['hasOwnProperty'](_0x3942('0x4b'))){_0x471009['limit']=qs['limit'](_0x1394f0[_0x3942('0x2b')][_0x3942('0x18')]);_0x471009['offset']=qs[_0x3942('0x1a')](_0x1394f0[_0x3942('0x2b')]['offset']);}return _0x43c627[_0x3942('0x4e')](_0x471009);}})[_0x3942('0x1f')](function(_0x409c9c){if(_0x409c9c){return _0x409c9c?{'count':_0x5c034b,'rows':_0x409c9c}:null;}})['then'](respondWithResult(_0x3878f4,null))[_0x3942('0x40')](handleError(_0x3878f4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 8a42c0b..04b3169 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 _0x7eee=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations','lodash','util'];(function(_0x3eab6e,_0x170491){var _0x277a41=function(_0x39d0dd){while(--_0x39d0dd){_0x3eab6e['push'](_0x3eab6e['shift']());}};_0x277a41(++_0x170491);}(_0x7eee,0x11c));var _0xe7ee=function(_0x5294ed,_0x4023dc){_0x5294ed=_0x5294ed-0x0;var _0x170be8=_0x7eee[_0x5294ed];return _0x170be8;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var logger=require(_0xe7ee('0x2'))(_0xe7ee('0x3'));var moment=require(_0xe7ee('0x4'));var BPromise=require(_0xe7ee('0x5'));var rp=require(_0xe7ee('0x6'));var fs=require('fs');var path=require(_0xe7ee('0x7'));var rimraf=require(_0xe7ee('0x8'));var config=require(_0xe7ee('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x139d09,_0x59a394){return _0x139d09[_0xe7ee('0xa')](_0xe7ee('0xb'),attributes,{'tableName':_0xe7ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe300=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations'];(function(_0x21fea7,_0x2e5cc2){var _0x12fa81=function(_0x53e986){while(--_0x53e986){_0x21fea7['push'](_0x21fea7['shift']());}};_0x12fa81(++_0x2e5cc2);}(_0xe300,0x179));var _0x0e30=function(_0x1c266d,_0x5374f5){_0x1c266d=_0x1c266d-0x0;var _0x39af77=_0xe300[_0x1c266d];return _0x39af77;};'use strict';var _=require(_0x0e30('0x0'));var util=require('util');var logger=require(_0x0e30('0x1'))(_0x0e30('0x2'));var moment=require(_0x0e30('0x3'));var BPromise=require(_0x0e30('0x4'));var rp=require(_0x0e30('0x5'));var fs=require('fs');var path=require(_0x0e30('0x6'));var rimraf=require(_0x0e30('0x7'));var config=require(_0x0e30('0x8'));var attributes=require(_0x0e30('0x9'));module['exports']=function(_0x3f81b3,_0x1f9112){return _0x3f81b3[_0x0e30('0xa')](_0x0e30('0xb'),attributes,{'tableName':_0x0e30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 79a3cf9..f540f71 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 _0x806d=['code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x1bf76e,_0x23aa8b){var _0x58f276=function(_0xd84b5f){while(--_0xd84b5f){_0x1bf76e['push'](_0x1bf76e['shift']());}};_0x58f276(++_0x23aa8b);}(_0x806d,0x131));var _0xd806=function(_0x3e9c22,_0x595b1e){_0x3e9c22=_0x3e9c22-0x0;var _0x40e8e6=_0x806d[_0x3e9c22];return _0x40e8e6;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var moment=require(_0xd806('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd806('0x3'))['db'];var utils=require(_0xd806('0x4'));var logger=require('../../config/logger')(_0xd806('0x5'));var config=require('../../config/environment');var jayson=require(_0xd806('0x6'));var client=jayson[_0xd806('0x7')][_0xd806('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26135a,_0x3a3446,_0x3873bf){return new BPromise(function(_0x1c1932,_0x4c8dea){return client[_0xd806('0x9')](_0x26135a,_0x3873bf)[_0xd806('0xa')](function(_0x902695){logger[_0xd806('0xb')]('Automation,\x20%s,\x20%s',_0x3a3446,_0xd806('0xc'));logger['debug'](_0xd806('0xd'),_0x3a3446,_0xd806('0xc'),JSON['stringify'](_0x902695));if(_0x902695[_0xd806('0xe')]){if(_0x902695[_0xd806('0xe')][_0xd806('0xf')]===0x1f4){logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x902695[_0xd806('0xe')][_0xd806('0x11')]);return _0x4c8dea(_0x902695[_0xd806('0xe')][_0xd806('0x11')]);}logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x902695['error'][_0xd806('0x11')]);return _0x1c1932(_0x902695[_0xd806('0xe')][_0xd806('0x11')]);}else{logger['info'](_0xd806('0x10'),_0x3a3446,'request\x20sent');_0x1c1932(_0x902695[_0xd806('0x12')][_0xd806('0x11')]);}})[_0xd806('0x13')](function(_0x138725){logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x138725);_0x4c8dea(_0x138725);});});} \ No newline at end of file +var _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3eba8f,_0x331c74){var _0x6d9a4f=function(_0x1a4b38){while(--_0x1a4b38){_0x3eba8f['push'](_0x3eba8f['shift']());}};_0x6d9a4f(++_0x331c74);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4cd682,_0x1c3756){_0x4cd682=_0x4cd682-0x0;var _0x3f513d=_0x5d0a[_0x4cd682];return _0x3f513d;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c6c3da4..bbeba36 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x1ca0d5,_0x3960bd){var _0x3aad05=function(_0x163d9b){while(--_0x163d9b){_0x1ca0d5['push'](_0x1ca0d5['shift']());}};_0x3aad05(++_0x3960bd);}(_0xac52,0x122));var _0x2ac5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xac52[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x58e9=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x58e9,0x15e));var _0x958e=function(_0x1b01cc,_0x43c731){_0x1b01cc=_0x1b01cc-0x0;var _0x5ebefc=_0x58e9[_0x1b01cc];return _0x5ebefc;};'use strict';var multer=require(_0x958e('0x0'));var util=require(_0x958e('0x1'));var path=require('path');var timeout=require(_0x958e('0x2'));var express=require('express');var router=express[_0x958e('0x3')]();var fs_extra=require(_0x958e('0x4'));var auth=require(_0x958e('0x5'));var interaction=require(_0x958e('0x6'));var config=require(_0x958e('0x7'));var controller=require('./automation.controller');router[_0x958e('0x8')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0xa')]);router['get'](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0xc')]);router[_0x958e('0x8')](_0x958e('0xd'),auth[_0x958e('0x9')](),controller[_0x958e('0xe')]);router[_0x958e('0x8')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x10')]);router[_0x958e('0x11')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0x12')]);router[_0x958e('0x11')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x958e('0x13')]);router[_0x958e('0x11')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x14')]);router[_0x958e('0x15')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller['update']);router[_0x958e('0x16')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0x17')]);module[_0x958e('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 660c823..57da5ef 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 _0x8b00=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x8b00,0x100));var _0x08b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b00[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x08b0('0x0')]={'name':{'type':Sequelize[_0x08b0('0x1')],'unique':_0x08b0('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x08b0('0x3')),'allowNull':![],'defaultValue':_0x08b0('0x3')},'description':{'type':Sequelize[_0x08b0('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x08b0('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x08b0('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x08b0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x08b0('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'comment':_0x08b0('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x08b0('0xe')},'dialTimezone':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x08b0('0xf'),'never',_0x08b0('0x10')),'defaultValue':_0x08b0('0xf')},'dialAMDActive':{'type':Sequelize[_0x08b0('0x11')],'defaultValue':0x0,'comment':_0x08b0('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x08b0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x08b0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x08b0('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08b0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x08b0('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x08b0('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x08b0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08b0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x08b0('0x1a')]('DESC',_0x08b0('0x1b')),'defaultValue':_0x08b0('0x1c')},'dialPrefix':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x08b0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08b0('0x1d')},'dialCutDigit':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08b0('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x28')}}; \ No newline at end of file +var _0x8c59=['ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x8c59,0x194));var _0x98c5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8c59[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x98c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x98c5('0x1')],'unique':_0x98c5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x98c5('0x3')](_0x98c5('0x4')),'allowNull':![],'defaultValue':_0x98c5('0x4')},'description':{'type':Sequelize[_0x98c5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x98c5('0x5')},'limitCalls':{'type':Sequelize[_0x98c5('0x6')](0x4)[_0x98c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x98c5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x98c5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x98c5('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'comment':_0x98c5('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x98c5('0xe')},'dialTimezone':{'type':Sequelize[_0x98c5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x98c5('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x98c5('0x3')](_0x98c5('0x10'),_0x98c5('0x11'),_0x98c5('0x12')),'defaultValue':_0x98c5('0x10')},'dialAMDActive':{'type':Sequelize[_0x98c5('0x13')],'defaultValue':0x0,'comment':_0x98c5('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x98c5('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x98c5('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x98c5('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x98c5('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x98c5('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x98c5('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x98c5('0x3')]('DESC',_0x98c5('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x98c5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x98c5('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ae71a29..b91bfc3 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 _0xd3ce=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','offset','Content-Range','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','send','index','Campaign','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','name','filter','options','count','includeAll','rows','show','params','rawAttributes','intersection','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','order','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','scheduledAt','CmListId','toString','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs'];(function(_0x3be8f8,_0x5b530e){var _0x1ea2d9=function(_0x2f4212){while(--_0x2f4212){_0x3be8f8['push'](_0x3be8f8['shift']());}};_0x1ea2d9(++_0x5b530e);}(_0xd3ce,0x10b));var _0xed3c=function(_0x37987d,_0x342669){_0x37987d=_0x37987d-0x0;var _0x212968=_0xd3ce[_0x37987d];return _0x212968;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3c('0x0'));var zipdir=require(_0xed3c('0x1'));var jsonpatch=require(_0xed3c('0x2'));var rp=require('request-promise');var moment=require(_0xed3c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xed3c('0x4'));var util=require(_0xed3c('0x5'));var path=require(_0xed3c('0x6'));var sox=require(_0xed3c('0x7'));var csv=require('to-csv');var ejs=require(_0xed3c('0x8'));var fs=require('fs');var fs_extra=require(_0xed3c('0x9'));var _=require(_0xed3c('0xa'));var squel=require(_0xed3c('0xb'));var crypto=require(_0xed3c('0xc'));var jsforce=require(_0xed3c('0xd'));var deskjs=require(_0xed3c('0xe'));var toCsv=require(_0xed3c('0xf'));var querystring=require(_0xed3c('0x10'));var Papa=require(_0xed3c('0x11'));var Redis=require(_0xed3c('0x12'));var authService=require(_0xed3c('0x13'));var qs=require(_0xed3c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed3c('0x15'));var logger=require(_0xed3c('0x16'))(_0xed3c('0x17'));var utils=require(_0xed3c('0x18'));var config=require(_0xed3c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1226f0,_0x3431c1){_0x3431c1=_0x3431c1||0xcc;return function(_0x3740ab){if(_0x3740ab){return _0x1226f0['sendStatus'](_0x3431c1);}return _0x1226f0[_0xed3c('0x1a')](_0x3431c1)[_0xed3c('0x1b')]();};}function respondWithResult(_0x413a32,_0x2e16a7){_0x2e16a7=_0x2e16a7||0xc8;return function(_0x1ad2d8){if(_0x1ad2d8){return _0x413a32[_0xed3c('0x1a')](_0x2e16a7)[_0xed3c('0x1c')](_0x1ad2d8);}};}function respondWithFilteredResult(_0x5d576b,_0xfb1468){return function(_0xae4e9a){if(_0xae4e9a){var _0x47395a=typeof _0xfb1468['offset']===_0xed3c('0x1d')&&typeof _0xfb1468[_0xed3c('0x1e')]==='undefined';var _0x20d9b5=_0xae4e9a['count'];var _0x23e61b=_0x47395a?0x0:_0xfb1468[_0xed3c('0x1f')];var _0x4edf32=_0x47395a?_0xae4e9a['count']:_0xfb1468['offset']+_0xfb1468[_0xed3c('0x1e')];var _0x5a2300;if(_0x4edf32>=_0x20d9b5){_0x4edf32=_0x20d9b5;_0x5a2300=0xc8;}else{_0x5a2300=0xce;}_0x5d576b[_0xed3c('0x1a')](_0x5a2300);return _0x5d576b['set'](_0xed3c('0x20'),_0x23e61b+'-'+_0x4edf32+'/'+_0x20d9b5)[_0xed3c('0x1c')](_0xae4e9a);}return null;};}function patchUpdates(_0x3d4679){return function(_0x22ee81){try{jsonpatch[_0xed3c('0x21')](_0x22ee81,_0x3d4679,!![]);}catch(_0x4ead1d){return BPromise['reject'](_0x4ead1d);}return _0x22ee81['save']();};}function saveUpdates(_0xfe2f7a,_0x9b41c2){return function(_0x244c88){if(_0x244c88){return _0x244c88[_0xed3c('0x22')](_0xfe2f7a)[_0xed3c('0x23')](function(_0x482552){return _0x482552;});}return null;};}function removeEntity(_0x498dc4,_0x3349b8){return function(_0x433d08){if(_0x433d08){return _0x433d08[_0xed3c('0x24')]()[_0xed3c('0x23')](function(){var _0x5d7bd0=_0x433d08[_0xed3c('0x25')]({'plain':!![]});var _0x466365=_0xed3c('0x26');return db[_0xed3c('0x27')]['destroy']({'where':{'type':_0x466365,'resourceId':_0x5d7bd0['id']}})[_0xed3c('0x23')](function(){return _0x433d08;});})[_0xed3c('0x23')](function(){_0x498dc4[_0xed3c('0x1a')](0xcc)[_0xed3c('0x1b')]();});}};}function handleEntityNotFound(_0x47d587,_0x35c340){return function(_0x43065f){if(!_0x43065f){_0x47d587['sendStatus'](0x194);}return _0x43065f;};}function handleError(_0x25d452,_0x3c030b){_0x3c030b=_0x3c030b||0x1f4;return function(_0x10e95d){logger[_0xed3c('0x28')](_0x10e95d[_0xed3c('0x29')]);if(_0x10e95d['name']){delete _0x10e95d['name'];}_0x25d452[_0xed3c('0x1a')](_0x3c030b)[_0xed3c('0x2a')](_0x10e95d);};}exports[_0xed3c('0x2b')]=function(_0x2252a8,_0x4fd7cb){var _0x12a914={},_0x284031={},_0xbfceac={'count':0x0,'rows':[]};var _0x18a142=_['map'](db[_0xed3c('0x2c')]['rawAttributes'],function(_0x1881c0){return{'name':_0x1881c0[_0xed3c('0x2d')],'type':_0x1881c0[_0xed3c('0x2e')][_0xed3c('0x2f')]};});_0x284031['model']=_[_0xed3c('0x30')](_0x18a142,'name');_0x284031[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x2252a8[_0xed3c('0x31')]);_0x284031[_0xed3c('0x33')]=_['intersection'](_0x284031[_0xed3c('0x34')],_0x284031[_0xed3c('0x31')]);_0x12a914[_0xed3c('0x35')]=_['intersection'](_0x284031[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x2252a8['query']['fields']));_0x12a914['attributes']=_0x12a914[_0xed3c('0x35')][_0xed3c('0x37')]?_0x12a914[_0xed3c('0x35')]:_0x284031['model'];if(!_0x2252a8[_0xed3c('0x31')][_0xed3c('0x38')]('nolimit')){_0x12a914[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x2252a8[_0xed3c('0x31')]['limit']);_0x12a914['offset']=qs['offset'](_0x2252a8[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x12a914['order']=qs[_0xed3c('0x39')](_0x2252a8['query'][_0xed3c('0x39')]);_0x12a914[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x2252a8['query'],_0x284031[_0xed3c('0x33')]),_0x18a142);if(_0x2252a8[_0xed3c('0x31')]['filter']){_0x12a914[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x12a914['where'],{'$or':_[_0xed3c('0x30')](_0x18a142,function(_0x2620d2){if(_0x2620d2['type']!==_0xed3c('0x3d')){var _0x1d02b9={};_0x1d02b9[_0x2620d2[_0xed3c('0x3e')]]={'$like':'%'+_0x2252a8[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x1d02b9;}})});}_0x12a914=_[_0xed3c('0x3c')]({},_0x12a914,_0x2252a8[_0xed3c('0x40')]);var _0x1bbb6f={'where':_0x12a914[_0xed3c('0x3a')]};return db[_0xed3c('0x2c')]['count'](_0x1bbb6f)['then'](function(_0x4f08c2){_0xbfceac[_0xed3c('0x41')]=_0x4f08c2;if(_0x2252a8[_0xed3c('0x31')][_0xed3c('0x42')]){_0x12a914['include']=[{'all':!![]}];}return db[_0xed3c('0x2c')]['findAll'](_0x12a914);})[_0xed3c('0x23')](function(_0x231f33){_0xbfceac[_0xed3c('0x43')]=_0x231f33;return _0xbfceac;})[_0xed3c('0x23')](respondWithFilteredResult(_0x4fd7cb,_0x12a914))['catch'](handleError(_0x4fd7cb,null));};exports[_0xed3c('0x44')]=function(_0x1cedbb,_0x35c0d0){var _0x4ce638={'raw':![],'where':{'id':_0x1cedbb[_0xed3c('0x45')]['id']}},_0x25669e={};_0x25669e[_0xed3c('0x34')]=_[_0xed3c('0x32')](db['Campaign'][_0xed3c('0x46')]);_0x25669e[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x1cedbb['query']);_0x25669e[_0xed3c('0x33')]=_['intersection'](_0x25669e[_0xed3c('0x34')],_0x25669e[_0xed3c('0x31')]);_0x4ce638[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x25669e[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x1cedbb[_0xed3c('0x31')][_0xed3c('0x36')]));_0x4ce638[_0xed3c('0x35')]=_0x4ce638[_0xed3c('0x35')]['length']?_0x4ce638[_0xed3c('0x35')]:_0x25669e[_0xed3c('0x34')];if(_0x1cedbb[_0xed3c('0x31')][_0xed3c('0x42')]){_0x4ce638[_0xed3c('0x48')]=[{'all':!![]}];}_0x4ce638=_[_0xed3c('0x3c')]({},_0x4ce638,_0x1cedbb[_0xed3c('0x40')]);return db[_0xed3c('0x2c')][_0xed3c('0x49')](_0x4ce638)[_0xed3c('0x23')](handleEntityNotFound(_0x35c0d0,null))['then'](respondWithResult(_0x35c0d0,null))[_0xed3c('0x4a')](handleError(_0x35c0d0,null));};exports[_0xed3c('0x4b')]=function(_0x4ecb29,_0x362ddb){return db[_0xed3c('0x2c')][_0xed3c('0x4b')](_0x4ecb29['body'],{})[_0xed3c('0x23')](function(_0x1e0b68){var _0xba4473=_0x4ecb29['user'][_0xed3c('0x25')]({'plain':!![]});if(!_0xba4473)throw new Error(_0xed3c('0x4c'));if(_0xba4473['role']==='user'){var _0x190f7c=_0x1e0b68['get']({'plain':!![]});var _0x1c0beb=_0xed3c('0x26');return db[_0xed3c('0x4d')][_0xed3c('0x49')]({'where':{'name':_0x1c0beb,'userProfileId':_0xba4473[_0xed3c('0x4e')]},'raw':!![]})[_0xed3c('0x23')](function(_0x46365c){if(_0x46365c&&_0x46365c[_0xed3c('0x4f')]===0x0){return db['UserProfileResource'][_0xed3c('0x4b')]({'name':_0x190f7c[_0xed3c('0x3e')],'resourceId':_0x190f7c['id'],'type':_0x46365c[_0xed3c('0x3e')],'sectionId':_0x46365c['id']},{})[_0xed3c('0x23')](function(){return _0x1e0b68;});}else{return _0x1e0b68;}})[_0xed3c('0x4a')](function(_0x385e7f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x385e7f);throw _0x385e7f;});}return _0x1e0b68;})[_0xed3c('0x23')](respondWithResult(_0x362ddb,0xc9))['catch'](handleError(_0x362ddb,null));};exports[_0xed3c('0x50')]=function(_0xc32fbf,_0x242b7e){var _0x21c995={'where':{'id':_0xc32fbf[_0xed3c('0x45')]['id']}},_0x4f81c9={};_0x4f81c9[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x2c')][_0xed3c('0x46')]);_0x21c995['attributes']=_[_0xed3c('0x47')](_0x4f81c9['model'],qs[_0xed3c('0x36')](_0xc32fbf[_0xed3c('0x31')]['fields']));_0x21c995[_0xed3c('0x35')]=_0x21c995[_0xed3c('0x35')]['length']?_0x21c995[_0xed3c('0x35')]:_0x4f81c9[_0xed3c('0x34')];if(_0xc32fbf[_0xed3c('0x31')][_0xed3c('0x42')]){_0x21c995[_0xed3c('0x48')]=[{'all':!![]}];}_0x21c995=_[_0xed3c('0x3c')]({},_0x21c995,_0xc32fbf['options']);return db[_0xed3c('0x2c')]['find'](_0x21c995)['then'](handleEntityNotFound(_0x242b7e,null))['then'](function(_0x5b90f2){if(_0x5b90f2){var _0x5e225d=_0x5b90f2[_0xed3c('0x25')]({'plain':!![]});_0x5e225d=qs[_0xed3c('0x51')](_0x5e225d,['id',_0xed3c('0x52'),_0xed3c('0x53')]);_0xc32fbf[_0xed3c('0x54')]=_[_0xed3c('0x51')](_0xc32fbf['body'],['id',_0xed3c('0x52'),_0xed3c('0x53')]);return db[_0xed3c('0x2c')][_0xed3c('0x4b')](_[_0xed3c('0x3c')](_0x5e225d,_0xc32fbf['body']),{'include':_0xc32fbf[_0xed3c('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xed3c('0x23')](function(_0x3fd9ee){var _0xb88f14=_0xc32fbf[_0xed3c('0x55')][_0xed3c('0x25')]({'plain':!![]});if(!_0xb88f14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb88f14[_0xed3c('0x56')]==='user'){var _0x4cab69=_0x3fd9ee[_0xed3c('0x25')]({'plain':!![]});var _0x533b83=_0xed3c('0x26');return db[_0xed3c('0x4d')][_0xed3c('0x49')]({'where':{'name':_0x533b83,'userProfileId':_0xb88f14[_0xed3c('0x4e')]},'raw':!![]})[_0xed3c('0x23')](function(_0x2e7385){if(_0x2e7385&&_0x2e7385[_0xed3c('0x4f')]===0x0){return db['UserProfileResource'][_0xed3c('0x4b')]({'name':_0x4cab69['name'],'resourceId':_0x4cab69['id'],'type':_0x2e7385['name'],'sectionId':_0x2e7385['id']},{})[_0xed3c('0x23')](function(){return _0x3fd9ee;});}else{return _0x3fd9ee;}})[_0xed3c('0x4a')](function(_0x25f42f){logger[_0xed3c('0x28')](_0xed3c('0x57'),_0x25f42f);throw _0x25f42f;});}return _0x3fd9ee;});}})['then'](respondWithResult(_0x242b7e,0xc9))[_0xed3c('0x4a')](handleError(_0x242b7e,null));};exports[_0xed3c('0x22')]=function(_0x23599c,_0x21e681){if(_0x23599c['body']['id']){delete _0x23599c[_0xed3c('0x54')]['id'];}return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x23599c['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x21e681,null))[_0xed3c('0x23')](saveUpdates(_0x23599c[_0xed3c('0x54')],null))[_0xed3c('0x23')](respondWithResult(_0x21e681,null))[_0xed3c('0x4a')](handleError(_0x21e681,null));};exports['destroy']=function(_0x341772,_0x314f3a){return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x341772['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x314f3a,null))['then'](removeEntity(_0x314f3a,null))['catch'](handleError(_0x314f3a,null));};exports[_0xed3c('0x58')]=function(_0x529141,_0x211610,_0x50ace1){var _0x481986={'raw':!![],'where':{}};var _0x1c83f2={};var _0x614ac9={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x529141['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x211610,null))[_0xed3c('0x23')](function(_0xd5103a){if(_0xd5103a){_0x1c83f2[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x5a')][_0xed3c('0x46')]);_0x1c83f2[_0xed3c('0x31')]=_['keys'](_0x529141[_0xed3c('0x31')]);_0x1c83f2[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x1c83f2[_0xed3c('0x34')],_0x1c83f2[_0xed3c('0x31')]);_0x481986[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x1c83f2[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x529141['query']['fields']));_0x481986[_0xed3c('0x35')]=_0x481986[_0xed3c('0x35')]['length']?_0x481986[_0xed3c('0x35')]:_0x1c83f2['model'];if(!_0x529141[_0xed3c('0x31')]['hasOwnProperty'](_0xed3c('0x5b'))){_0x481986[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x529141['query'][_0xed3c('0x1e')]);_0x481986[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x529141[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x481986['order']=qs[_0xed3c('0x39')](_0x529141[_0xed3c('0x31')]['sort']);_0x481986['where']=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x529141[_0xed3c('0x31')],_0x1c83f2[_0xed3c('0x33')]));_0x481986[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0xd5103a['id'];if(_0x529141[_0xed3c('0x31')]['filter']){_0x481986[_0xed3c('0x3a')]=_['merge'](_0x481986[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x481986[_0xed3c('0x35')],function(_0x30e994){var _0xe0baa={};_0xe0baa[_0x30e994]={'$like':'%'+_0x529141[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0xe0baa;})});}_0x481986=_[_0xed3c('0x3c')]({},_0x481986,_0x529141[_0xed3c('0x40')]);return db[_0xed3c('0x5a')]['count']({'where':_0x481986[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0x3c2bd9){_0x614ac9[_0xed3c('0x41')]=_0x3c2bd9;if(_0x529141[_0xed3c('0x31')][_0xed3c('0x42')]){_0x481986['include']=[{'all':!![]}];}return db[_0xed3c('0x5a')]['findAll'](_0x481986);})['then'](function(_0x1e6986){_0x614ac9[_0xed3c('0x43')]=_0x1e6986;return _0x614ac9;});}})['then'](respondWithFilteredResult(_0x211610,_0x481986))[_0xed3c('0x4a')](handleError(_0x211610,null));};exports[_0xed3c('0x5d')]=function(_0x5dd02f,_0x5551d2,_0x2ef592){var _0x55c291={'raw':!![],'where':{}};var _0x265214={};var _0x30054c={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x5dd02f[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5551d2,null))[_0xed3c('0x23')](function(_0x18523b){if(_0x18523b){_0x265214[_0xed3c('0x34')]=_['keys'](db[_0xed3c('0x5e')][_0xed3c('0x46')]);_0x265214[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x5dd02f[_0xed3c('0x31')]);_0x265214[_0xed3c('0x33')]=_['intersection'](_0x265214['model'],_0x265214[_0xed3c('0x31')]);_0x55c291[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x265214[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x5dd02f[_0xed3c('0x31')][_0xed3c('0x36')]));_0x55c291[_0xed3c('0x35')]=_0x55c291['attributes']['length']?_0x55c291[_0xed3c('0x35')]:_0x265214[_0xed3c('0x34')];if(!_0x5dd02f['query'][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x55c291[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x5dd02f['query'][_0xed3c('0x1e')]);_0x55c291['offset']=qs[_0xed3c('0x1f')](_0x5dd02f['query'][_0xed3c('0x1f')]);}_0x55c291[_0xed3c('0x5f')]=qs['sort'](_0x5dd02f['query'][_0xed3c('0x39')]);_0x55c291['where']=qs['filters'](_[_0xed3c('0x3b')](_0x5dd02f['query'],_0x265214[_0xed3c('0x33')]));_0x55c291['where'][_0xed3c('0x5c')]=_0x18523b['id'];if(_0x5dd02f[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x55c291[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x55c291[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x55c291['attributes'],function(_0x1dbca2){var _0x314569={};_0x314569[_0x1dbca2]={'$like':'%'+_0x5dd02f['query']['filter']+'%'};return _0x314569;})});}_0x55c291=_['merge']({},_0x55c291,_0x5dd02f['options']);return db[_0xed3c('0x5e')][_0xed3c('0x41')]({'where':_0x55c291[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0x1f7642){_0x30054c[_0xed3c('0x41')]=_0x1f7642;if(_0x5dd02f[_0xed3c('0x31')]['includeAll']){_0x55c291[_0xed3c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xed3c('0x60')](_0x55c291);})[_0xed3c('0x23')](function(_0x5dd325){_0x30054c[_0xed3c('0x43')]=_0x5dd325;return _0x30054c;});}})[_0xed3c('0x23')](respondWithFilteredResult(_0x5551d2,_0x55c291))[_0xed3c('0x4a')](handleError(_0x5551d2,null));};exports[_0xed3c('0x61')]=function(_0x3ce831,_0x531b25,_0x415e98){var _0x285626={'raw':!![],'where':{}};var _0x42e29d={};var _0x5ecbcd={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x3ce831['params']['id']}})['then'](handleEntityNotFound(_0x531b25,null))[_0xed3c('0x23')](function(_0x297c7c){if(_0x297c7c){_0x42e29d[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x62')]['rawAttributes']);_0x42e29d['query']=_['keys'](_0x3ce831[_0xed3c('0x31')]);_0x42e29d[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x42e29d[_0xed3c('0x34')],_0x42e29d['query']);_0x285626['attributes']=_[_0xed3c('0x47')](_0x42e29d[_0xed3c('0x34')],qs['fields'](_0x3ce831[_0xed3c('0x31')][_0xed3c('0x36')]));_0x285626['attributes']=_0x285626[_0xed3c('0x35')][_0xed3c('0x37')]?_0x285626[_0xed3c('0x35')]:_0x42e29d['model'];if(!_0x3ce831['query']['hasOwnProperty'](_0xed3c('0x5b'))){_0x285626[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x3ce831[_0xed3c('0x31')]['limit']);_0x285626['offset']=qs['offset'](_0x3ce831['query'][_0xed3c('0x1f')]);}_0x285626[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x3ce831[_0xed3c('0x31')]['sort']);_0x285626[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x3ce831[_0xed3c('0x31')],_0x42e29d['filters']));_0x285626[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0x297c7c['id'];if(_0x3ce831[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x285626[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x285626['where'],{'$or':_[_0xed3c('0x30')](_0x285626[_0xed3c('0x35')],function(_0x22ecba){var _0x43693e={};_0x43693e[_0x22ecba]={'$like':'%'+_0x3ce831['query']['filter']+'%'};return _0x43693e;})});}_0x285626=_['merge']({},_0x285626,_0x3ce831[_0xed3c('0x40')]);return db[_0xed3c('0x62')][_0xed3c('0x41')]({'where':_0x285626[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0xfcbc00){_0x5ecbcd[_0xed3c('0x41')]=_0xfcbc00;if(_0x3ce831[_0xed3c('0x31')][_0xed3c('0x42')]){_0x285626[_0xed3c('0x48')]=[{'all':!![]}];}return db[_0xed3c('0x62')][_0xed3c('0x60')](_0x285626);})['then'](function(_0x250267){_0x5ecbcd[_0xed3c('0x43')]=_0x250267;return _0x5ecbcd;});}})['then'](respondWithFilteredResult(_0x531b25,_0x285626))[_0xed3c('0x4a')](handleError(_0x531b25,null));};exports[_0xed3c('0x63')]=function(_0x379ae2,_0x2c4709,_0x5da6b5){var _0x17d0a7={'raw':!![],'where':{}};var _0x1e1fae={};var _0x3d31ca={'count':0x0,'rows':[]};return db['Campaign'][_0xed3c('0x59')]({'where':{'id':_0x379ae2[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c4709,null))['then'](function(_0x53cb05){if(_0x53cb05){_0x1e1fae[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x64')][_0xed3c('0x46')]);_0x1e1fae[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x379ae2['query']);_0x1e1fae[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x1e1fae[_0xed3c('0x34')],_0x1e1fae[_0xed3c('0x31')]);_0x17d0a7[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x1e1fae[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x379ae2['query']['fields']));_0x17d0a7[_0xed3c('0x35')]=_0x17d0a7['attributes'][_0xed3c('0x37')]?_0x17d0a7[_0xed3c('0x35')]:_0x1e1fae[_0xed3c('0x34')];if(!_0x379ae2[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x17d0a7['limit']=qs['limit'](_0x379ae2['query'][_0xed3c('0x1e')]);_0x17d0a7['offset']=qs[_0xed3c('0x1f')](_0x379ae2[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x17d0a7[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x379ae2[_0xed3c('0x31')]['sort']);_0x17d0a7[_0xed3c('0x3a')]=qs['filters'](_['pick'](_0x379ae2['query'],_0x1e1fae[_0xed3c('0x33')]));_0x17d0a7[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0x53cb05['id'];if(_0x379ae2[_0xed3c('0x31')]['filter']){_0x17d0a7[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x17d0a7['where'],{'$or':_[_0xed3c('0x30')](_0x17d0a7[_0xed3c('0x35')],function(_0x3e064b){var _0x527fb7={};_0x527fb7[_0x3e064b]={'$like':'%'+_0x379ae2['query'][_0xed3c('0x3f')]+'%'};return _0x527fb7;})});}_0x17d0a7=_[_0xed3c('0x3c')]({},_0x17d0a7,_0x379ae2[_0xed3c('0x40')]);return db[_0xed3c('0x64')][_0xed3c('0x41')]({'where':_0x17d0a7[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0xdcc1ec){_0x3d31ca[_0xed3c('0x41')]=_0xdcc1ec;if(_0x379ae2[_0xed3c('0x31')][_0xed3c('0x42')]){_0x17d0a7[_0xed3c('0x48')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xed3c('0x60')](_0x17d0a7);})['then'](function(_0x4f2391){_0x3d31ca[_0xed3c('0x43')]=_0x4f2391;return _0x3d31ca;});}})[_0xed3c('0x23')](respondWithFilteredResult(_0x2c4709,_0x17d0a7))[_0xed3c('0x4a')](handleError(_0x2c4709,null));};exports[_0xed3c('0x65')]=function(_0x397bb6,_0x211025,_0x15d323){var _0x2f59f7={};var _0x589bdd={};var _0x3b5515;var _0x5090f6;return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x397bb6[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x211025,null))[_0xed3c('0x23')](function(_0x5b07d5){if(_0x5b07d5){_0x3b5515=_0x5b07d5;_0x589bdd['model']=_['keys'](db[_0xed3c('0x66')][_0xed3c('0x46')]);_0x589bdd['query']=_[_0xed3c('0x32')](_0x397bb6[_0xed3c('0x31')]);_0x589bdd[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x589bdd[_0xed3c('0x34')],_0x589bdd[_0xed3c('0x31')]);_0x2f59f7[_0xed3c('0x35')]=_['intersection'](_0x589bdd[_0xed3c('0x34')],qs['fields'](_0x397bb6['query'][_0xed3c('0x36')]));_0x2f59f7['attributes']=_0x2f59f7[_0xed3c('0x35')]['length']?_0x2f59f7[_0xed3c('0x35')]:_0x589bdd[_0xed3c('0x34')];_0x2f59f7[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x39')]);_0x2f59f7[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x397bb6[_0xed3c('0x31')],_0x589bdd['filters']));if(_0x397bb6[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x2f59f7[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x2f59f7['where'],{'$or':_['map'](_0x2f59f7[_0xed3c('0x35')],function(_0x37277a){var _0x3e0737={};_0x3e0737[_0x37277a]={'$like':'%'+_0x397bb6[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x3e0737;})});}_0x2f59f7=_['merge']({},_0x2f59f7,_0x397bb6[_0xed3c('0x40')]);return _0x3b5515[_0xed3c('0x65')](_0x2f59f7);}})[_0xed3c('0x23')](function(_0x438103){if(_0x438103){_0x5090f6=_0x438103[_0xed3c('0x37')];if(!_0x397bb6[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x2f59f7[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x1e')]);_0x2f59f7[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x1f')]);}return _0x3b5515[_0xed3c('0x65')](_0x2f59f7);}})[_0xed3c('0x23')](function(_0x379430){if(_0x379430){return _0x379430?{'count':_0x5090f6,'rows':_0x379430}:null;}})['then'](respondWithResult(_0x211025,null))[_0xed3c('0x4a')](handleError(_0x211025,null));};exports['addLists']=function(_0x433791,_0x5f313e,_0x5d9700){var _0x4328f8,_0x4ae915;return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x433791[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x5f313e,null))[_0xed3c('0x23')](function(_0x52ca84){if(_0x52ca84){_0x4ae915=_0x52ca84;return _0x52ca84[_0xed3c('0x67')](_0x433791['body'][_0xed3c('0x68')],_[_0xed3c('0x51')](_0x433791[_0xed3c('0x54')],['ids','id'])||{});}return null;})[_0xed3c('0x69')](function(_0xbfbf44){var _0xc5eb3;_0x4328f8=_0xbfbf44||[];var _0x860a5a=[];if(_0xbfbf44){for(var _0x345429=0x0;_0x345429<_0xbfbf44[_0xed3c('0x37')];_0x345429+=0x1){var _0x1b107c=_0xbfbf44[_0x345429][_0xed3c('0x25')]({'plain':!![]});_0x4ae915[_0xed3c('0x6a')]=_0x433791['body'][_0xed3c('0x6a')]?_0x433791[_0xed3c('0x54')][_0xed3c('0x6a')]:_0x4ae915[_0xed3c('0x6a')];switch(_0x4ae915[_0xed3c('0x6a')]){case _0xed3c('0x6b'):_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')](['phone','scheduledAt',_0xed3c('0x6f'),_0xed3c('0x70'),'CampaignId',_0xed3c('0x52'),'updatedAt'],squel[_0xed3c('0x71')]()[_0xed3c('0x72')](_0xed3c('0x73'),_0xed3c('0x73'))[_0xed3c('0x72')]('NOW()',_0xed3c('0x74'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c[_0xed3c('0x75')]['toString'](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))['field'](_0xed3c('0x77'),_0xed3c('0x52'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x53'))['from'](_0xed3c('0x78'))[_0xed3c('0x3a')]('deletedAt\x20IS\x20NULL')[_0xed3c('0x3a')](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')](_0xed3c('0x7a'))['where'](_0xed3c('0x7b'),squel['select']()[_0xed3c('0x72')](_0xed3c('0x7c'))[_0xed3c('0x7d')]('cm_hopper_final')['where'](_0xed3c('0x7e'),_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]()))[_0xed3c('0x3a')](_0xed3c('0x7b'),squel[_0xed3c('0x71')]()[_0xed3c('0x72')](_0xed3c('0x7f'))[_0xed3c('0x7d')](_0xed3c('0x6d'))[_0xed3c('0x3a')]('CampaignId\x20=\x20?',_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]())))[_0xed3c('0x76')]();break;case _0xed3c('0x80'):_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')]([_0xed3c('0x73'),'scheduledAt',_0xed3c('0x6f'),'ListId',_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel[_0xed3c('0x71')]()['field']('phone',_0xed3c('0x73'))[_0xed3c('0x72')]('NOW()',_0xed3c('0x74'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c['CmListId'][_0xed3c('0x76')](),'ListId')[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),'CampaignId')['field'](_0xed3c('0x77'),_0xed3c('0x52'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x53'))[_0xed3c('0x7d')](_0xed3c('0x78'))['where'](_0xed3c('0x81'))['where'](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')](_0xed3c('0x7a'))[_0xed3c('0x3a')](_0xed3c('0x7b'),squel['select']()[_0xed3c('0x72')](_0xed3c('0x7f'))[_0xed3c('0x7d')](_0xed3c('0x6d'))['where'](_0xed3c('0x7e'),_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]())))[_0xed3c('0x76')]();break;default:_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')]([_0xed3c('0x73'),'scheduledAt',_0xed3c('0x6f'),_0xed3c('0x70'),_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel['select']()[_0xed3c('0x72')](_0xed3c('0x73'),_0xed3c('0x73'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x74'))['field']('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c[_0xed3c('0x75')]['toString'](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x52'))['field'](_0xed3c('0x77'),_0xed3c('0x53'))['from'](_0xed3c('0x78'))[_0xed3c('0x3a')](_0xed3c('0x81'))[_0xed3c('0x3a')](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xed3c('0x76')]();}_0x860a5a['push'](db[_0xed3c('0x82')][_0xed3c('0x31')](_0xc5eb3));}return BPromise[_0xed3c('0x83')](_0x860a5a);}})[_0xed3c('0x23')](function(){return _0x4328f8;})['then'](respondWithResult(_0x5f313e,null))['catch'](handleError(_0x5f313e,null));};exports['removeLists']=function(_0xc5b708,_0x4c62b0,_0x565848){return db[_0xed3c('0x2c')]['find']({'where':{'id':_0xc5b708[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x4c62b0,null))['then'](function(_0x38cb68){if(_0x38cb68){return _0x38cb68[_0xed3c('0x84')](_0xc5b708[_0xed3c('0x31')]['ids']);}})[_0xed3c('0x23')](function(_0x1a7be3){if(_0x1a7be3){return db['CmHopper'][_0xed3c('0x24')]({'where':{'ListId':_0xc5b708[_0xed3c('0x31')]['ids'],'CampaignId':_0xc5b708[_0xed3c('0x45')]['id']}})['then'](function(){return _0x1a7be3;});}})[_0xed3c('0x23')](respondWithStatusCode(_0x4c62b0,null))[_0xed3c('0x4a')](handleError(_0x4c62b0,null));};exports[_0xed3c('0x85')]=function(_0x4e2da1,_0x200d64,_0x4f5b8f){var _0x11c6e2={};var _0x54279e={};var _0xde9633;var _0x6ca510;return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x4e2da1[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x200d64,null))[_0xed3c('0x23')](function(_0x11f32b){if(_0x11f32b){_0xde9633=_0x11f32b;_0x54279e[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x66')][_0xed3c('0x46')]);_0x54279e['query']=_[_0xed3c('0x32')](_0x4e2da1[_0xed3c('0x31')]);_0x54279e[_0xed3c('0x33')]=_['intersection'](_0x54279e[_0xed3c('0x34')],_0x54279e[_0xed3c('0x31')]);_0x11c6e2['attributes']=_[_0xed3c('0x47')](_0x54279e[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x36')]));_0x11c6e2[_0xed3c('0x35')]=_0x11c6e2[_0xed3c('0x35')][_0xed3c('0x37')]?_0x11c6e2[_0xed3c('0x35')]:_0x54279e[_0xed3c('0x34')];_0x11c6e2[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x4e2da1[_0xed3c('0x31')]['sort']);_0x11c6e2[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x4e2da1[_0xed3c('0x31')],_0x54279e[_0xed3c('0x33')]));if(_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x11c6e2[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x11c6e2[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x11c6e2[_0xed3c('0x35')],function(_0x268952){var _0x23773c={};_0x23773c[_0x268952]={'$like':'%'+_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x23773c;})});}_0x11c6e2=_[_0xed3c('0x3c')]({},_0x11c6e2,_0x4e2da1[_0xed3c('0x40')]);return _0xde9633[_0xed3c('0x85')](_0x11c6e2);}})[_0xed3c('0x23')](function(_0x4532a3){if(_0x4532a3){_0x6ca510=_0x4532a3[_0xed3c('0x37')];if(!_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x11c6e2[_0xed3c('0x1e')]=qs['limit'](_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x1e')]);_0x11c6e2[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x4e2da1[_0xed3c('0x31')]['offset']);}return _0xde9633[_0xed3c('0x85')](_0x11c6e2);}})['then'](function(_0x5b0a17){if(_0x5b0a17){return _0x5b0a17?{'count':_0x6ca510,'rows':_0x5b0a17}:null;}})['then'](respondWithResult(_0x200d64,null))[_0xed3c('0x4a')](handleError(_0x200d64,null));};exports['addBlackLists']=function(_0x21dae9,_0x5d6779,_0xcb04f7){var _0x15c696,_0x52803b;return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x21dae9[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x5d6779,null))['then'](function(_0x3eb847){if(_0x3eb847){_0x52803b=_0x3eb847;return _0x3eb847[_0xed3c('0x86')](_0x21dae9['body'][_0xed3c('0x68')],_['omit'](_0x21dae9[_0xed3c('0x54')],['ids','id'])||{});}return null;})[_0xed3c('0x69')](function(_0x849a7b){var _0x6484d7;_0x15c696=_0x849a7b||[];var _0x329fe7=[];if(_0x849a7b){for(var _0x1371cc=0x0;_0x1371cc<_0x849a7b[_0xed3c('0x37')];_0x1371cc+=0x1){var _0x16ecb7=_0x849a7b[_0x1371cc]['get']({'plain':!![]});_0x6484d7=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x87'))[_0xed3c('0x6e')]([_0xed3c('0x73'),_0xed3c('0x6f'),_0xed3c('0x70'),_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel[_0xed3c('0x71')]()[_0xed3c('0x72')]('phone',_0xed3c('0x73'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x16ecb7[_0xed3c('0x75')][_0xed3c('0x76')](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x21dae9['params']['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x52'))['field']('NOW()','updatedAt')['from']('cm_contacts')[_0xed3c('0x3a')](_0xed3c('0x81'))[_0xed3c('0x3a')]('ListId\x20=\x20?',_0x16ecb7[_0xed3c('0x75')]['toString']())[_0xed3c('0x3a')](_0xed3c('0x7a')))[_0xed3c('0x76')]();_0x329fe7[_0xed3c('0x88')](db[_0xed3c('0x82')][_0xed3c('0x31')](_0x6484d7));}return BPromise[_0xed3c('0x83')](_0x329fe7);}})[_0xed3c('0x23')](function(){return _0x15c696;})[_0xed3c('0x23')](respondWithResult(_0x5d6779,null))[_0xed3c('0x4a')](handleError(_0x5d6779,null));};exports[_0xed3c('0x89')]=function(_0x24181c,_0x14032c,_0x2cf939){return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x24181c[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x14032c,null))[_0xed3c('0x23')](function(_0xec931a){if(_0xec931a){return _0xec931a[_0xed3c('0x89')](_0x24181c[_0xed3c('0x31')][_0xed3c('0x68')]);}})[_0xed3c('0x23')](function(_0x3c3bca){if(_0x3c3bca){return db[_0xed3c('0x64')][_0xed3c('0x24')]({'where':{'ListId':_0x24181c['query'][_0xed3c('0x68')],'CampaignId':_0x24181c['params']['id']}})[_0xed3c('0x23')](function(){return _0x3c3bca;});}})[_0xed3c('0x23')](respondWithStatusCode(_0x14032c,null))[_0xed3c('0x4a')](handleError(_0x14032c,null));}; \ No newline at end of file +var _0xb4f5=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','UserProfileSection','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','pick','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','field','phone','NOW()','ContactId','CmListId','ListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','ids','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format'];(function(_0x20f049,_0x3e4a13){var _0x1f166b=function(_0xaf3021){while(--_0xaf3021){_0x20f049['push'](_0x20f049['shift']());}};_0x1f166b(++_0x3e4a13);}(_0xb4f5,0x8c));var _0x5b4f=function(_0x49b72e,_0x4db0de){_0x49b72e=_0x49b72e-0x0;var _0x30a4d8=_0xb4f5[_0x49b72e];return _0x30a4d8;};'use strict';var emlformat=require(_0x5b4f('0x0'));var rimraf=require(_0x5b4f('0x1'));var zipdir=require(_0x5b4f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b4f('0x3'));var moment=require('moment');var BPromise=require(_0x5b4f('0x4'));var Mustache=require(_0x5b4f('0x5'));var util=require('util');var path=require(_0x5b4f('0x6'));var sox=require(_0x5b4f('0x7'));var csv=require(_0x5b4f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b4f('0x9'));var _=require(_0x5b4f('0xa'));var squel=require(_0x5b4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b4f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b4f('0xd'));var Papa=require(_0x5b4f('0xe'));var Redis=require('ioredis');var authService=require(_0x5b4f('0xf'));var qs=require(_0x5b4f('0x10'));var as=require(_0x5b4f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b4f('0x12'))(_0x5b4f('0x13'));var utils=require(_0x5b4f('0x14'));var config=require(_0x5b4f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b4f('0x16'))['db'];function respondWithStatusCode(_0x59660e,_0x43b408){_0x43b408=_0x43b408||0xcc;return function(_0x335c98){if(_0x335c98){return _0x59660e[_0x5b4f('0x17')](_0x43b408);}return _0x59660e[_0x5b4f('0x18')](_0x43b408)['end']();};}function respondWithResult(_0x39718d,_0xc15709){_0xc15709=_0xc15709||0xc8;return function(_0x30b8a0){if(_0x30b8a0){return _0x39718d['status'](_0xc15709)[_0x5b4f('0x19')](_0x30b8a0);}};}function respondWithFilteredResult(_0x37904a,_0x4484e6){return function(_0xda439f){if(_0xda439f){var _0x5469db=typeof _0x4484e6[_0x5b4f('0x1a')]===_0x5b4f('0x1b')&&typeof _0x4484e6[_0x5b4f('0x1c')]==='undefined';var _0x1c341d=_0xda439f['count'];var _0x24356a=_0x5469db?0x0:_0x4484e6[_0x5b4f('0x1a')];var _0xea3fb3=_0x5469db?_0xda439f['count']:_0x4484e6[_0x5b4f('0x1a')]+_0x4484e6[_0x5b4f('0x1c')];var _0x8459e7;if(_0xea3fb3>=_0x1c341d){_0xea3fb3=_0x1c341d;_0x8459e7=0xc8;}else{_0x8459e7=0xce;}_0x37904a[_0x5b4f('0x18')](_0x8459e7);return _0x37904a[_0x5b4f('0x1d')](_0x5b4f('0x1e'),_0x24356a+'-'+_0xea3fb3+'/'+_0x1c341d)[_0x5b4f('0x19')](_0xda439f);}return null;};}function patchUpdates(_0x411f9b){return function(_0x28b2ab){try{jsonpatch[_0x5b4f('0x1f')](_0x28b2ab,_0x411f9b,!![]);}catch(_0x3de80c){return BPromise[_0x5b4f('0x20')](_0x3de80c);}return _0x28b2ab[_0x5b4f('0x21')]();};}function saveUpdates(_0x1117d4,_0x416237){return function(_0x3ebb5b){if(_0x3ebb5b){return _0x3ebb5b[_0x5b4f('0x22')](_0x1117d4)[_0x5b4f('0x23')](function(_0xec72e5){return _0xec72e5;});}return null;};}function removeEntity(_0x2d90fc,_0x53ce51){return function(_0x3507d2){if(_0x3507d2){return _0x3507d2[_0x5b4f('0x24')]()[_0x5b4f('0x23')](function(){var _0x1088e9=_0x3507d2[_0x5b4f('0x25')]({'plain':!![]});var _0x59aab9=_0x5b4f('0x26');return db[_0x5b4f('0x27')][_0x5b4f('0x24')]({'where':{'type':_0x59aab9,'resourceId':_0x1088e9['id']}})[_0x5b4f('0x23')](function(){return _0x3507d2;});})[_0x5b4f('0x23')](function(){_0x2d90fc['status'](0xcc)[_0x5b4f('0x28')]();});}};}function handleEntityNotFound(_0xc2c136,_0x372195){return function(_0xfa385c){if(!_0xfa385c){_0xc2c136[_0x5b4f('0x17')](0x194);}return _0xfa385c;};}function handleError(_0x575f51,_0x4df7e7){_0x4df7e7=_0x4df7e7||0x1f4;return function(_0x28ea4b){logger[_0x5b4f('0x29')](_0x28ea4b[_0x5b4f('0x2a')]);if(_0x28ea4b[_0x5b4f('0x2b')]){delete _0x28ea4b['name'];}_0x575f51[_0x5b4f('0x18')](_0x4df7e7)[_0x5b4f('0x2c')](_0x28ea4b);};}exports[_0x5b4f('0x2d')]=function(_0x2730ae,_0x423a73){var _0x138575={},_0x2d863b={},_0x352ad4={'count':0x0,'rows':[]};var _0x20b13b=_['map'](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')],function(_0x480cd1){return{'name':_0x480cd1[_0x5b4f('0x30')],'type':_0x480cd1[_0x5b4f('0x31')][_0x5b4f('0x32')]};});_0x2d863b[_0x5b4f('0x33')]=_[_0x5b4f('0x34')](_0x20b13b,_0x5b4f('0x2b'));_0x2d863b[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x2730ae['query']);_0x2d863b[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x2d863b['model'],_0x2d863b['query']);_0x138575[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x2d863b[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3a')]));_0x138575[_0x5b4f('0x39')]=_0x138575[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x138575[_0x5b4f('0x39')]:_0x2d863b[_0x5b4f('0x33')];if(!_0x2730ae[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x138575[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x138575[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x138575['order']=qs[_0x5b4f('0x3d')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3d')]);_0x138575[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x2730ae[_0x5b4f('0x35')],_0x2d863b['filters']),_0x20b13b);if(_0x2730ae['query'][_0x5b4f('0x3f')]){_0x138575[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x138575['where'],{'$or':_[_0x5b4f('0x34')](_0x20b13b,function(_0x38945d){if(_0x38945d[_0x5b4f('0x31')]!==_0x5b4f('0x41')){var _0x51b687={};_0x51b687[_0x38945d[_0x5b4f('0x2b')]]={'$like':'%'+_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x51b687;}})});}_0x138575=_[_0x5b4f('0x40')]({},_0x138575,_0x2730ae[_0x5b4f('0x42')]);var _0x1d7571={'where':_0x138575[_0x5b4f('0x3e')]};return db['Campaign'][_0x5b4f('0x43')](_0x1d7571)['then'](function(_0xc8a54e){_0x352ad4[_0x5b4f('0x43')]=_0xc8a54e;if(_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x138575[_0x5b4f('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x5b4f('0x46')](_0x138575);})['then'](function(_0x3ecca9){_0x352ad4[_0x5b4f('0x47')]=_0x3ecca9;return _0x352ad4;})[_0x5b4f('0x23')](respondWithFilteredResult(_0x423a73,_0x138575))['catch'](handleError(_0x423a73,null));};exports[_0x5b4f('0x48')]=function(_0x432e02,_0x368fe6){var _0x3fa629={'raw':![],'where':{'id':_0x432e02[_0x5b4f('0x49')]['id']}},_0x1d7241={};_0x1d7241['model']=_[_0x5b4f('0x36')](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')]);_0x1d7241[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x432e02[_0x5b4f('0x35')]);_0x1d7241[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x1d7241[_0x5b4f('0x33')],_0x1d7241[_0x5b4f('0x35')]);_0x3fa629[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x1d7241[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x432e02[_0x5b4f('0x35')]['fields']));_0x3fa629[_0x5b4f('0x39')]=_0x3fa629[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x3fa629[_0x5b4f('0x39')]:_0x1d7241[_0x5b4f('0x33')];if(_0x432e02[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x3fa629[_0x5b4f('0x45')]=[{'all':!![]}];}_0x3fa629=_[_0x5b4f('0x40')]({},_0x3fa629,_0x432e02[_0x5b4f('0x42')]);return db['Campaign'][_0x5b4f('0x4a')](_0x3fa629)[_0x5b4f('0x23')](handleEntityNotFound(_0x368fe6,null))[_0x5b4f('0x23')](respondWithResult(_0x368fe6,null))[_0x5b4f('0x4b')](handleError(_0x368fe6,null));};exports[_0x5b4f('0x4c')]=function(_0x5577f6,_0x19d08f){return db[_0x5b4f('0x2e')][_0x5b4f('0x4c')](_0x5577f6['body'],{})[_0x5b4f('0x23')](function(_0x4054a6){var _0x361f8c=_0x5577f6[_0x5b4f('0x4d')][_0x5b4f('0x25')]({'plain':!![]});if(!_0x361f8c)throw new Error(_0x5b4f('0x4e'));if(_0x361f8c[_0x5b4f('0x4f')]===_0x5b4f('0x4d')){var _0x35bf6d=_0x4054a6['get']({'plain':!![]});var _0x33ae77=_0x5b4f('0x26');return db['UserProfileSection'][_0x5b4f('0x4a')]({'where':{'name':_0x33ae77,'userProfileId':_0x361f8c[_0x5b4f('0x50')]},'raw':!![]})['then'](function(_0xdcb883){if(_0xdcb883&&_0xdcb883[_0x5b4f('0x51')]===0x0){return db[_0x5b4f('0x27')][_0x5b4f('0x4c')]({'name':_0x35bf6d['name'],'resourceId':_0x35bf6d['id'],'type':_0xdcb883[_0x5b4f('0x2b')],'sectionId':_0xdcb883['id']},{})['then'](function(){return _0x4054a6;});}else{return _0x4054a6;}})[_0x5b4f('0x4b')](function(_0x16220a){logger['error'](_0x5b4f('0x52'),_0x16220a);throw _0x16220a;});}return _0x4054a6;})['then'](respondWithResult(_0x19d08f,0xc9))[_0x5b4f('0x4b')](handleError(_0x19d08f,null));};exports[_0x5b4f('0x53')]=function(_0x54788c,_0x284048){var _0x3f3d5e={'where':{'id':_0x54788c[_0x5b4f('0x49')]['id']}},_0x111ab2={};_0x111ab2[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')]);_0x3f3d5e[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x111ab2[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x54788c[_0x5b4f('0x35')]['fields']));_0x3f3d5e['attributes']=_0x3f3d5e[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x3f3d5e['attributes']:_0x111ab2['model'];if(_0x54788c[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x3f3d5e['include']=[{'all':!![]}];}_0x3f3d5e=_[_0x5b4f('0x40')]({},_0x3f3d5e,_0x54788c[_0x5b4f('0x42')]);return db[_0x5b4f('0x2e')]['find'](_0x3f3d5e)[_0x5b4f('0x23')](handleEntityNotFound(_0x284048,null))[_0x5b4f('0x23')](function(_0x50a11d){if(_0x50a11d){var _0x650ed6=_0x50a11d[_0x5b4f('0x25')]({'plain':!![]});_0x650ed6=qs[_0x5b4f('0x54')](_0x650ed6,['id',_0x5b4f('0x55'),_0x5b4f('0x56')]);_0x54788c[_0x5b4f('0x57')]=_['omit'](_0x54788c[_0x5b4f('0x57')],['id',_0x5b4f('0x55'),'updatedAt']);return db[_0x5b4f('0x2e')][_0x5b4f('0x4c')](_['merge'](_0x650ed6,_0x54788c[_0x5b4f('0x57')]),{'include':_0x54788c[_0x5b4f('0x35')][_0x5b4f('0x44')]?[{'all':!![]}]:undefined})[_0x5b4f('0x23')](function(_0x1ecd19){var _0x193852=_0x54788c['user'][_0x5b4f('0x25')]({'plain':!![]});if(!_0x193852)throw new Error(_0x5b4f('0x4e'));if(_0x193852['role']==='user'){var _0x2cf7b9=_0x1ecd19[_0x5b4f('0x25')]({'plain':!![]});var _0x1804d2='IvrCampaigns';return db[_0x5b4f('0x58')][_0x5b4f('0x4a')]({'where':{'name':_0x1804d2,'userProfileId':_0x193852[_0x5b4f('0x50')]},'raw':!![]})[_0x5b4f('0x23')](function(_0x523a0a){if(_0x523a0a&&_0x523a0a[_0x5b4f('0x51')]===0x0){return db[_0x5b4f('0x27')]['create']({'name':_0x2cf7b9[_0x5b4f('0x2b')],'resourceId':_0x2cf7b9['id'],'type':_0x523a0a[_0x5b4f('0x2b')],'sectionId':_0x523a0a['id']},{})[_0x5b4f('0x23')](function(){return _0x1ecd19;});}else{return _0x1ecd19;}})[_0x5b4f('0x4b')](function(_0x3a67d0){logger['error'](_0x5b4f('0x52'),_0x3a67d0);throw _0x3a67d0;});}return _0x1ecd19;});}})[_0x5b4f('0x23')](respondWithResult(_0x284048,0xc9))[_0x5b4f('0x4b')](handleError(_0x284048,null));};exports[_0x5b4f('0x22')]=function(_0x3dff79,_0x1016f6){if(_0x3dff79['body']['id']){delete _0x3dff79['body']['id'];}return db['Campaign'][_0x5b4f('0x4a')]({'where':{'id':_0x3dff79[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1016f6,null))[_0x5b4f('0x23')](saveUpdates(_0x3dff79[_0x5b4f('0x57')],null))[_0x5b4f('0x23')](respondWithResult(_0x1016f6,null))[_0x5b4f('0x4b')](handleError(_0x1016f6,null));};exports['destroy']=function(_0x4d6173,_0x1b9f94){return db[_0x5b4f('0x2e')]['find']({'where':{'id':_0x4d6173[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1b9f94,null))[_0x5b4f('0x23')](removeEntity(_0x1b9f94,null))['catch'](handleError(_0x1b9f94,null));};exports[_0x5b4f('0x59')]=function(_0x59ff20,_0x2f47e2,_0xd16513){var _0x5efaa0={'raw':!![],'where':{}};var _0x1b188a={};var _0x31d0bf={'count':0x0,'rows':[]};return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x59ff20[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x2f47e2,null))[_0x5b4f('0x23')](function(_0x2fde94){if(_0x2fde94){_0x1b188a[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x5b')]['rawAttributes']);_0x1b188a[_0x5b4f('0x35')]=_['keys'](_0x59ff20[_0x5b4f('0x35')]);_0x1b188a[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x1b188a[_0x5b4f('0x33')],_0x1b188a['query']);_0x5efaa0['attributes']=_[_0x5b4f('0x38')](_0x1b188a[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x59ff20['query']['fields']));_0x5efaa0[_0x5b4f('0x39')]=_0x5efaa0['attributes'][_0x5b4f('0x3b')]?_0x5efaa0['attributes']:_0x1b188a[_0x5b4f('0x33')];if(!_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x5c')]('nolimit')){_0x5efaa0[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x5efaa0[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x59ff20['query'][_0x5b4f('0x1a')]);}_0x5efaa0[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x59ff20['query'][_0x5b4f('0x3d')]);_0x5efaa0[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x59ff20['query'],_0x1b188a[_0x5b4f('0x37')]));_0x5efaa0[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x2fde94['id'];if(_0x59ff20['query'][_0x5b4f('0x3f')]){_0x5efaa0['where']=_[_0x5b4f('0x40')](_0x5efaa0[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x5efaa0[_0x5b4f('0x39')],function(_0x451357){var _0x3f8078={};_0x3f8078[_0x451357]={'$like':'%'+_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x3f8078;})});}_0x5efaa0=_['merge']({},_0x5efaa0,_0x59ff20[_0x5b4f('0x42')]);return db[_0x5b4f('0x5b')]['count']({'where':_0x5efaa0[_0x5b4f('0x3e')]})['then'](function(_0x5894a6){_0x31d0bf[_0x5b4f('0x43')]=_0x5894a6;if(_0x59ff20['query'][_0x5b4f('0x44')]){_0x5efaa0[_0x5b4f('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x5b4f('0x46')](_0x5efaa0);})[_0x5b4f('0x23')](function(_0x14889b){_0x31d0bf[_0x5b4f('0x47')]=_0x14889b;return _0x31d0bf;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x2f47e2,_0x5efaa0))[_0x5b4f('0x4b')](handleError(_0x2f47e2,null));};exports[_0x5b4f('0x5f')]=function(_0x3837cd,_0x1f1f82,_0x5b22d1){var _0x4b946c={'raw':!![],'where':{}};var _0x5b6385={};var _0x23575a={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3837cd[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1f1f82,null))[_0x5b4f('0x23')](function(_0x56ef75){if(_0x56ef75){_0x5b6385[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db['CmHopperHistory'][_0x5b4f('0x2f')]);_0x5b6385['query']=_[_0x5b4f('0x36')](_0x3837cd[_0x5b4f('0x35')]);_0x5b6385[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x5b6385['model'],_0x5b6385['query']);_0x4b946c[_0x5b4f('0x39')]=_['intersection'](_0x5b6385[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x3a')]));_0x4b946c[_0x5b4f('0x39')]=_0x4b946c[_0x5b4f('0x39')]['length']?_0x4b946c[_0x5b4f('0x39')]:_0x5b6385[_0x5b4f('0x33')];if(!_0x3837cd[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x4b946c[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x3837cd['query']['limit']);_0x4b946c[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x3837cd['query'][_0x5b4f('0x1a')]);}_0x4b946c[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x3837cd['query'][_0x5b4f('0x3d')]);_0x4b946c[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x3837cd[_0x5b4f('0x35')],_0x5b6385['filters']));_0x4b946c[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x56ef75['id'];if(_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x4b946c[_0x5b4f('0x3e')]=_['merge'](_0x4b946c[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x4b946c['attributes'],function(_0xebd735){var _0x2c2480={};_0x2c2480[_0xebd735]={'$like':'%'+_0x3837cd['query'][_0x5b4f('0x3f')]+'%'};return _0x2c2480;})});}_0x4b946c=_['merge']({},_0x4b946c,_0x3837cd[_0x5b4f('0x42')]);return db[_0x5b4f('0x61')][_0x5b4f('0x43')]({'where':_0x4b946c['where']})[_0x5b4f('0x23')](function(_0x14cf72){_0x23575a[_0x5b4f('0x43')]=_0x14cf72;if(_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x4b946c[_0x5b4f('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5b4f('0x46')](_0x4b946c);})[_0x5b4f('0x23')](function(_0x1a3857){_0x23575a[_0x5b4f('0x47')]=_0x1a3857;return _0x23575a;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x1f1f82,_0x4b946c))['catch'](handleError(_0x1f1f82,null));};exports[_0x5b4f('0x62')]=function(_0x2a5809,_0x347797,_0x4c72ce){var _0x2db555={'raw':!![],'where':{}};var _0x5c3923={};var _0x112537={'count':0x0,'rows':[]};return db['Campaign'][_0x5b4f('0x5a')]({'where':{'id':_0x2a5809[_0x5b4f('0x49')]['id']}})['then'](handleEntityNotFound(_0x347797,null))['then'](function(_0x3dfa5c){if(_0x3dfa5c){_0x5c3923[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x63')][_0x5b4f('0x2f')]);_0x5c3923[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x2a5809[_0x5b4f('0x35')]);_0x5c3923[_0x5b4f('0x37')]=_['intersection'](_0x5c3923[_0x5b4f('0x33')],_0x5c3923[_0x5b4f('0x35')]);_0x2db555['attributes']=_['intersection'](_0x5c3923['model'],qs[_0x5b4f('0x3a')](_0x2a5809[_0x5b4f('0x35')]['fields']));_0x2db555['attributes']=_0x2db555[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x2db555['attributes']:_0x5c3923['model'];if(!_0x2a5809[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x2db555['limit']=qs[_0x5b4f('0x1c')](_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x2db555[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x2db555[_0x5b4f('0x5d')]=qs['sort'](_0x2a5809['query']['sort']);_0x2db555[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x2a5809[_0x5b4f('0x35')],_0x5c3923[_0x5b4f('0x37')]));_0x2db555['where'][_0x5b4f('0x5e')]=_0x3dfa5c['id'];if(_0x2a5809['query'][_0x5b4f('0x3f')]){_0x2db555[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x2db555[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x2db555[_0x5b4f('0x39')],function(_0xcd2924){var _0x206cdd={};_0x206cdd[_0xcd2924]={'$like':'%'+_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x206cdd;})});}_0x2db555=_[_0x5b4f('0x40')]({},_0x2db555,_0x2a5809['options']);return db[_0x5b4f('0x63')][_0x5b4f('0x43')]({'where':_0x2db555['where']})[_0x5b4f('0x23')](function(_0x4c6f7b){_0x112537[_0x5b4f('0x43')]=_0x4c6f7b;if(_0x2a5809['query']['includeAll']){_0x2db555[_0x5b4f('0x45')]=[{'all':!![]}];}return db[_0x5b4f('0x63')]['findAll'](_0x2db555);})[_0x5b4f('0x23')](function(_0x535568){_0x112537[_0x5b4f('0x47')]=_0x535568;return _0x112537;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x347797,_0x2db555))['catch'](handleError(_0x347797,null));};exports[_0x5b4f('0x64')]=function(_0x28896b,_0x5c9b49,_0x4e38f4){var _0x44a4ac={'raw':!![],'where':{}};var _0x2849c7={};var _0x9f66d1={'count':0x0,'rows':[]};return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x28896b['params']['id']}})['then'](handleEntityNotFound(_0x5c9b49,null))[_0x5b4f('0x23')](function(_0x16a14b){if(_0x16a14b){_0x2849c7['model']=_[_0x5b4f('0x36')](db[_0x5b4f('0x65')][_0x5b4f('0x2f')]);_0x2849c7[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x28896b[_0x5b4f('0x35')]);_0x2849c7[_0x5b4f('0x37')]=_['intersection'](_0x2849c7['model'],_0x2849c7[_0x5b4f('0x35')]);_0x44a4ac[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x2849c7[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x28896b['query'][_0x5b4f('0x3a')]));_0x44a4ac['attributes']=_0x44a4ac[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x44a4ac[_0x5b4f('0x39')]:_0x2849c7['model'];if(!_0x28896b[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x44a4ac[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x28896b['query'][_0x5b4f('0x1c')]);_0x44a4ac[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x44a4ac[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x3d')]);_0x44a4ac[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x28896b[_0x5b4f('0x35')],_0x2849c7[_0x5b4f('0x37')]));_0x44a4ac[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x16a14b['id'];if(_0x28896b[_0x5b4f('0x35')]['filter']){_0x44a4ac[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x44a4ac[_0x5b4f('0x3e')],{'$or':_['map'](_0x44a4ac[_0x5b4f('0x39')],function(_0x5123fc){var _0x3cc05a={};_0x3cc05a[_0x5123fc]={'$like':'%'+_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x3cc05a;})});}_0x44a4ac=_[_0x5b4f('0x40')]({},_0x44a4ac,_0x28896b[_0x5b4f('0x42')]);return db[_0x5b4f('0x65')][_0x5b4f('0x43')]({'where':_0x44a4ac['where']})[_0x5b4f('0x23')](function(_0x46ca5a){_0x9f66d1['count']=_0x46ca5a;if(_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x44a4ac[_0x5b4f('0x45')]=[{'all':!![]}];}return db[_0x5b4f('0x65')][_0x5b4f('0x46')](_0x44a4ac);})[_0x5b4f('0x23')](function(_0xffaf20){_0x9f66d1['rows']=_0xffaf20;return _0x9f66d1;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x5c9b49,_0x44a4ac))['catch'](handleError(_0x5c9b49,null));};exports[_0x5b4f('0x66')]=function(_0x385765,_0x27d396,_0x36568a){var _0x21be17={};var _0x5eb600={};var _0xdca3cd;var _0x7eb279;return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x385765[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x27d396,null))[_0x5b4f('0x23')](function(_0x267ec5){if(_0x267ec5){_0xdca3cd=_0x267ec5;_0x5eb600['model']=_[_0x5b4f('0x36')](db['CmList'][_0x5b4f('0x2f')]);_0x5eb600['query']=_['keys'](_0x385765[_0x5b4f('0x35')]);_0x5eb600[_0x5b4f('0x37')]=_['intersection'](_0x5eb600[_0x5b4f('0x33')],_0x5eb600[_0x5b4f('0x35')]);_0x21be17[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x5eb600[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x385765['query'][_0x5b4f('0x3a')]));_0x21be17[_0x5b4f('0x39')]=_0x21be17[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x21be17[_0x5b4f('0x39')]:_0x5eb600[_0x5b4f('0x33')];_0x21be17[_0x5b4f('0x5d')]=qs['sort'](_0x385765['query'][_0x5b4f('0x3d')]);_0x21be17['where']=qs[_0x5b4f('0x37')](_['pick'](_0x385765['query'],_0x5eb600[_0x5b4f('0x37')]));if(_0x385765[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x21be17[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x21be17[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x21be17[_0x5b4f('0x39')],function(_0x1df48b){var _0x23213d={};_0x23213d[_0x1df48b]={'$like':'%'+_0x385765['query']['filter']+'%'};return _0x23213d;})});}_0x21be17=_[_0x5b4f('0x40')]({},_0x21be17,_0x385765[_0x5b4f('0x42')]);return _0xdca3cd[_0x5b4f('0x66')](_0x21be17);}})[_0x5b4f('0x23')](function(_0x5bc788){if(_0x5bc788){_0x7eb279=_0x5bc788[_0x5b4f('0x3b')];if(!_0x385765[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x21be17[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x385765[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x21be17[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x385765[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}return _0xdca3cd['getLists'](_0x21be17);}})['then'](function(_0x1d9e2c){if(_0x1d9e2c){return _0x1d9e2c?{'count':_0x7eb279,'rows':_0x1d9e2c}:null;}})[_0x5b4f('0x23')](respondWithResult(_0x27d396,null))[_0x5b4f('0x4b')](handleError(_0x27d396,null));};exports[_0x5b4f('0x67')]=function(_0x871c1e,_0x25bd8d,_0x5c8393){var _0x46d50a,_0x1d3db2;return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0x871c1e[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x25bd8d,null))[_0x5b4f('0x23')](function(_0x5df3ef){if(_0x5df3ef){_0x1d3db2=_0x5df3ef;return _0x5df3ef[_0x5b4f('0x67')](_0x871c1e[_0x5b4f('0x57')]['ids'],_['omit'](_0x871c1e[_0x5b4f('0x57')],['ids','id'])||{});}return null;})[_0x5b4f('0x68')](function(_0x214446){var _0xca9c14;_0x46d50a=_0x214446||[];var _0x2e734a=[];if(_0x214446){for(var _0x3cc3b8=0x0;_0x3cc3b8<_0x214446[_0x5b4f('0x3b')];_0x3cc3b8+=0x1){var _0x509cf=_0x214446[_0x3cc3b8]['get']({'plain':!![]});_0x1d3db2[_0x5b4f('0x69')]=_0x871c1e[_0x5b4f('0x57')]['dialCheckDuplicateType']?_0x871c1e[_0x5b4f('0x57')][_0x5b4f('0x69')]:_0x1d3db2[_0x5b4f('0x69')];switch(_0x1d3db2[_0x5b4f('0x69')]){case _0x5b4f('0x6a'):_0xca9c14=squel[_0x5b4f('0x6b')]()[_0x5b4f('0x6c')](_0x5b4f('0x6d'))[_0x5b4f('0x6e')](['phone',_0x5b4f('0x6f'),'ContactId','ListId',_0x5b4f('0x5e'),_0x5b4f('0x55'),_0x5b4f('0x56')],squel['select']()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'scheduledAt')['field']('id',_0x5b4f('0x73'))['field'](_0x509cf[_0x5b4f('0x74')]['toString'](),_0x5b4f('0x75'))['field'](_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')]('NOW()',_0x5b4f('0x56'))[_0x5b4f('0x77')](_0x5b4f('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')]['toString']())['where'](_0x5b4f('0x7a'))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7d'))[_0x5b4f('0x77')](_0x5b4f('0x7e'))[_0x5b4f('0x3e')]('CampaignId\x20=\x20?',_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]()))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7f'))[_0x5b4f('0x77')](_0x5b4f('0x6d'))[_0x5b4f('0x3e')](_0x5b4f('0x80'),_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]())))[_0x5b4f('0x76')]();break;case _0x5b4f('0x81'):_0xca9c14=squel[_0x5b4f('0x6b')]()['into']('cm_hopper')['fromQuery']([_0x5b4f('0x71'),'scheduledAt',_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),'createdAt',_0x5b4f('0x56')],squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x6f'))[_0x5b4f('0x70')]('id',_0x5b4f('0x73'))[_0x5b4f('0x70')](_0x509cf['CmListId']['toString'](),'ListId')['field'](_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'updatedAt')[_0x5b4f('0x77')](_0x5b4f('0x78'))[_0x5b4f('0x3e')](_0x5b4f('0x82'))['where'](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')]())[_0x5b4f('0x3e')](_0x5b4f('0x7a'))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7f'))[_0x5b4f('0x77')](_0x5b4f('0x6d'))['where'](_0x5b4f('0x80'),_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]())))[_0x5b4f('0x76')]();break;default:_0xca9c14=squel[_0x5b4f('0x6b')]()[_0x5b4f('0x6c')](_0x5b4f('0x6d'))['fromQuery']([_0x5b4f('0x71'),_0x5b4f('0x6f'),_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),'createdAt','updatedAt'],squel['select']()[_0x5b4f('0x70')](_0x5b4f('0x71'),'phone')[_0x5b4f('0x70')](_0x5b4f('0x72'),'scheduledAt')[_0x5b4f('0x70')]('id','ContactId')['field'](_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')](),_0x5b4f('0x75'))[_0x5b4f('0x70')](_0x871c1e[_0x5b4f('0x49')]['id']['toString'](),_0x5b4f('0x5e'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'createdAt')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x56'))['from'](_0x5b4f('0x78'))[_0x5b4f('0x3e')]('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')]())['where'](_0x5b4f('0x7a')))[_0x5b4f('0x76')]();}_0x2e734a[_0x5b4f('0x83')](db[_0x5b4f('0x84')][_0x5b4f('0x35')](_0xca9c14));}return BPromise[_0x5b4f('0x85')](_0x2e734a);}})['then'](function(){return _0x46d50a;})[_0x5b4f('0x23')](respondWithResult(_0x25bd8d,null))[_0x5b4f('0x4b')](handleError(_0x25bd8d,null));};exports[_0x5b4f('0x86')]=function(_0x3e5093,_0x3752e2,_0x4b7cae){return db[_0x5b4f('0x2e')]['find']({'where':{'id':_0x3e5093['params']['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x3752e2,null))[_0x5b4f('0x23')](function(_0x3672d4){if(_0x3672d4){return _0x3672d4[_0x5b4f('0x86')](_0x3e5093[_0x5b4f('0x35')]['ids']);}})[_0x5b4f('0x23')](function(_0x3bc726){if(_0x3bc726){return db[_0x5b4f('0x5b')][_0x5b4f('0x24')]({'where':{'ListId':_0x3e5093['query'][_0x5b4f('0x87')],'CampaignId':_0x3e5093['params']['id']}})['then'](function(){return _0x3bc726;});}})[_0x5b4f('0x23')](respondWithStatusCode(_0x3752e2,null))['catch'](handleError(_0x3752e2,null));};exports[_0x5b4f('0x88')]=function(_0x2e3e3d,_0x387972,_0xeb63e){var _0x8079dc={};var _0x47a9a3={};var _0x1e8056;var _0x61a11a;return db[_0x5b4f('0x2e')]['findOne']({'where':{'id':_0x2e3e3d[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x387972,null))[_0x5b4f('0x23')](function(_0x3210b1){if(_0x3210b1){_0x1e8056=_0x3210b1;_0x47a9a3[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x89')]['rawAttributes']);_0x47a9a3[_0x5b4f('0x35')]=_['keys'](_0x2e3e3d[_0x5b4f('0x35')]);_0x47a9a3[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x47a9a3['model'],_0x47a9a3['query']);_0x8079dc[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x47a9a3[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x2e3e3d['query'][_0x5b4f('0x3a')]));_0x8079dc[_0x5b4f('0x39')]=_0x8079dc[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x8079dc['attributes']:_0x47a9a3[_0x5b4f('0x33')];_0x8079dc['order']=qs[_0x5b4f('0x3d')](_0x2e3e3d['query'][_0x5b4f('0x3d')]);_0x8079dc[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x2e3e3d[_0x5b4f('0x35')],_0x47a9a3['filters']));if(_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x8079dc[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x8079dc[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x8079dc['attributes'],function(_0x1b4920){var _0x2933f8={};_0x2933f8[_0x1b4920]={'$like':'%'+_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x2933f8;})});}_0x8079dc=_[_0x5b4f('0x40')]({},_0x8079dc,_0x2e3e3d[_0x5b4f('0x42')]);return _0x1e8056['getBlackLists'](_0x8079dc);}})['then'](function(_0x5b9270){if(_0x5b9270){_0x61a11a=_0x5b9270[_0x5b4f('0x3b')];if(!_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x5c')](_0x5b4f('0x3c'))){_0x8079dc['limit']=qs[_0x5b4f('0x1c')](_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x8079dc['offset']=qs[_0x5b4f('0x1a')](_0x2e3e3d[_0x5b4f('0x35')]['offset']);}return _0x1e8056['getBlackLists'](_0x8079dc);}})[_0x5b4f('0x23')](function(_0x56c4fb){if(_0x56c4fb){return _0x56c4fb?{'count':_0x61a11a,'rows':_0x56c4fb}:null;}})['then'](respondWithResult(_0x387972,null))[_0x5b4f('0x4b')](handleError(_0x387972,null));};exports[_0x5b4f('0x8a')]=function(_0xe71dd4,_0x50d7b8,_0x5603cb){var _0xab6400,_0x385c20;return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0xe71dd4[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x50d7b8,null))[_0x5b4f('0x23')](function(_0x2ffaf9){if(_0x2ffaf9){_0x385c20=_0x2ffaf9;return _0x2ffaf9[_0x5b4f('0x8a')](_0xe71dd4[_0x5b4f('0x57')]['ids'],_[_0x5b4f('0x54')](_0xe71dd4[_0x5b4f('0x57')],[_0x5b4f('0x87'),'id'])||{});}return null;})['spread'](function(_0x29bbdf){var _0x4f411c;_0xab6400=_0x29bbdf||[];var _0x59d412=[];if(_0x29bbdf){for(var _0x514d48=0x0;_0x514d48<_0x29bbdf['length'];_0x514d48+=0x1){var _0x2aea92=_0x29bbdf[_0x514d48][_0x5b4f('0x25')]({'plain':!![]});_0x4f411c=squel['insert']()['into'](_0x5b4f('0x8b'))[_0x5b4f('0x6e')]([_0x5b4f('0x71'),_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),_0x5b4f('0x55'),_0x5b4f('0x56')],squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')]('id','ContactId')[_0x5b4f('0x70')](_0x2aea92['CmListId'][_0x5b4f('0x76')](),_0x5b4f('0x75'))[_0x5b4f('0x70')](_0xe71dd4['params']['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')]('NOW()','updatedAt')[_0x5b4f('0x77')](_0x5b4f('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x2aea92[_0x5b4f('0x74')][_0x5b4f('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5b4f('0x76')]();_0x59d412['push'](db[_0x5b4f('0x84')][_0x5b4f('0x35')](_0x4f411c));}return BPromise[_0x5b4f('0x85')](_0x59d412);}})['then'](function(){return _0xab6400;})[_0x5b4f('0x23')](respondWithResult(_0x50d7b8,null))[_0x5b4f('0x4b')](handleError(_0x50d7b8,null));};exports[_0x5b4f('0x8c')]=function(_0x3f639c,_0xfd309d,_0x25487c){return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0x3f639c[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0xfd309d,null))[_0x5b4f('0x23')](function(_0xab1db6){if(_0xab1db6){return _0xab1db6[_0x5b4f('0x8c')](_0x3f639c[_0x5b4f('0x35')][_0x5b4f('0x87')]);}})[_0x5b4f('0x23')](function(_0x59f1a6){if(_0x59f1a6){return db[_0x5b4f('0x65')][_0x5b4f('0x24')]({'where':{'ListId':_0x3f639c[_0x5b4f('0x35')]['ids'],'CampaignId':_0x3f639c['params']['id']}})[_0x5b4f('0x23')](function(){return _0x59f1a6;});}})[_0x5b4f('0x23')](respondWithStatusCode(_0xfd309d,null))[_0x5b4f('0x4b')](handleError(_0xfd309d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 72637cc..d092595 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2b4bae,_0xf2ad5d){var _0x4b73c9=function(_0x294f34){while(--_0x294f34){_0x2b4bae['push'](_0x2b4bae['shift']());}};_0x4b73c9(++_0xf2ad5d);}(_0x7a54,0x106));var _0x47a5=function(_0x23832f,_0x3b714d){_0x23832f=_0x23832f-0x0;var _0x828436=_0x7a54[_0x23832f];return _0x828436;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x213300,_0x20e270){var _0x4a7e7d=function(_0x291e35){while(--_0x291e35){_0x213300['push'](_0x213300['shift']());}};_0x4a7e7d(++_0x20e270);}(_0x7a54,0x106));var _0x47a5=function(_0x5e8f3c,_0x21d46d){_0x5e8f3c=_0x5e8f3c-0x0;var _0x317907=_0x7a54[_0x5e8f3c];return _0x317907;};'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 2550bf7..d27d20a 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 _0x0f73=['raw','where','include','map','model','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options'];(function(_0x535128,_0x24e02b){var _0x1de4a8=function(_0x384d63){while(--_0x384d63){_0x535128['push'](_0x535128['shift']());}};_0x1de4a8(++_0x24e02b);}(_0x0f73,0x146));var _0x30f7=function(_0x44887e,_0x5bcf96){_0x44887e=_0x44887e-0x0;var _0x504975=_0x0f73[_0x44887e];return _0x504975;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var moment=require(_0x30f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30f7('0x3'));var db=require(_0x30f7('0x4'))['db'];var utils=require(_0x30f7('0x5'));var logger=require(_0x30f7('0x6'))(_0x30f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x30f7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38ad1d,_0x1c90cb,_0x2de5e7){return new BPromise(function(_0x7e377e,_0x5c5cf3){return client[_0x30f7('0x9')](_0x38ad1d,_0x2de5e7)[_0x30f7('0xa')](function(_0x5eedb2){logger[_0x30f7('0xb')]('Campaign,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');logger[_0x30f7('0xc')](_0x30f7('0xd'),_0x1c90cb,_0x30f7('0xe'),JSON[_0x30f7('0xf')](_0x5eedb2));if(_0x5eedb2['error']){if(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x11')]===0x1f4){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x5c5cf3(_0x5eedb2['error'][_0x30f7('0x13')]);}logger[_0x30f7('0x10')]('Campaign,\x20%s,\x20%s',_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x7e377e(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);}else{logger[_0x30f7('0xb')]('Campaign,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');_0x7e377e(_0x5eedb2[_0x30f7('0x14')][_0x30f7('0x13')]);}})[_0x30f7('0x15')](function(_0x1a5565){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x1a5565);_0x5c5cf3(_0x1a5565);});});}exports[_0x30f7('0x16')]=function(_0x1efb71){var _0x1083e3=this;return new Promise(function(_0x1e7777,_0x21f3d1){return db[_0x30f7('0x17')][_0x30f7('0x18')]({'raw':_0x1efb71[_0x30f7('0x19')]?_0x1efb71['options'][_0x30f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')][_0x30f7('0x1b')]||null:null,'attributes':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')]['attributes']||null:null,'limit':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')]['limit']||null:null,'include':_0x1efb71['options']?_0x1efb71[_0x30f7('0x19')]['include']?_['map'](_0x1efb71['options'][_0x30f7('0x1c')],function(_0x261116){return{'model':db[_0x261116['model']],'as':_0x261116['as'],'attributes':_0x261116['attributes'],'include':_0x261116[_0x30f7('0x1c')]?_[_0x30f7('0x1d')](_0x261116['include'],function(_0x393d2f){return{'model':db[_0x393d2f[_0x30f7('0x1e')]],'as':_0x393d2f['as'],'attributes':_0x393d2f[_0x30f7('0x1f')],'include':_0x393d2f['include']?_[_0x30f7('0x1d')](_0x393d2f[_0x30f7('0x1c')],function(_0x540caf){return{'model':db[_0x540caf[_0x30f7('0x1e')]],'as':_0x540caf['as'],'attributes':_0x540caf[_0x30f7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23d3ae){logger[_0x30f7('0xb')]('GetCampaign',_0x1efb71);logger[_0x30f7('0xc')]('GetCampaign',_0x1efb71,JSON[_0x30f7('0xf')](_0x23d3ae));_0x1e7777(_0x23d3ae);})[_0x30f7('0x15')](function(_0x21bb2a){logger[_0x30f7('0x10')](_0x30f7('0x16'),_0x21bb2a[_0x30f7('0x13')],_0x1efb71);_0x21f3d1(_0x1083e3[_0x30f7('0x10')](0x1f4,_0x21bb2a[_0x30f7('0x13')]));});});}; \ No newline at end of file +var _0xbe02=['then','stringify','error','code','Campaign,\x20%s,\x20%s','message','request\x20sent','catch','GetCampaign','Campaign','findAll','options','raw','limit','include','map','model','attributes','info','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2c020c,_0x3c49fe){var _0x38be07=function(_0x374a84){while(--_0x374a84){_0x2c020c['push'](_0x2c020c['shift']());}};_0x38be07(++_0x3c49fe);}(_0xbe02,0x146));var _0x2be0=function(_0x50959f,_0x1eeb24){_0x50959f=_0x50959f-0x0;var _0x572e0a=_0xbe02[_0x50959f];return _0x572e0a;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be0('0x4'));var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson[_0x2be0('0xb')][_0x2be0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e872c,_0x4ca22f,_0x176f12){return new BPromise(function(_0xdfef68,_0x1ac0a3){return client[_0x2be0('0xd')](_0x4e872c,_0x176f12)[_0x2be0('0xe')](function(_0x45d9f5){logger['info']('Campaign,\x20%s,\x20%s',_0x4ca22f,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4ca22f,'request\x20sent',JSON[_0x2be0('0xf')](_0x45d9f5));if(_0x45d9f5[_0x2be0('0x10')]){if(_0x45d9f5['error'][_0x2be0('0x11')]===0x1f4){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);return _0x1ac0a3(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')]['message']);return _0xdfef68(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}else{logger['info'](_0x2be0('0x12'),_0x4ca22f,_0x2be0('0x14'));_0xdfef68(_0x45d9f5['result'][_0x2be0('0x13')]);}})[_0x2be0('0x15')](function(_0x137ce9){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x137ce9);_0x1ac0a3(_0x137ce9);});});}exports[_0x2be0('0x16')]=function(_0x48d386){var _0x415894=this;return new Promise(function(_0x3f8dba,_0x35da90){return db[_0x2be0('0x17')][_0x2be0('0x18')]({'raw':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')]['where']||null:null,'attributes':_0x48d386['options']?_0x48d386[_0x2be0('0x19')]['attributes']||null:null,'limit':_0x48d386['options']?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1b')]||null:null,'include':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')],function(_0x494fb4){return{'model':db[_0x494fb4[_0x2be0('0x1e')]],'as':_0x494fb4['as'],'attributes':_0x494fb4['attributes'],'include':_0x494fb4['include']?_[_0x2be0('0x1d')](_0x494fb4[_0x2be0('0x1c')],function(_0x166aa1){return{'model':db[_0x166aa1[_0x2be0('0x1e')]],'as':_0x166aa1['as'],'attributes':_0x166aa1[_0x2be0('0x1f')],'include':_0x166aa1[_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x166aa1['include'],function(_0x1c24be){return{'model':db[_0x1c24be[_0x2be0('0x1e')]],'as':_0x1c24be['as'],'attributes':_0x1c24be['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd3eb){logger[_0x2be0('0x20')]('GetCampaign',_0x48d386);logger[_0x2be0('0x21')](_0x2be0('0x16'),_0x48d386,JSON[_0x2be0('0xf')](_0x1fd3eb));_0x3f8dba(_0x1fd3eb);})[_0x2be0('0x15')](function(_0x3b97c0){logger[_0x2be0('0x10')](_0x2be0('0x16'),_0x3b97c0['message'],_0x48d386);_0x35da90(_0x415894[_0x2be0('0x10')](0x1f4,_0x3b97c0['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3734158..b92a76b 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 _0x8453=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists'];(function(_0x4225aa,_0x582bf2){var _0x3f8fab=function(_0x498647){while(--_0x498647){_0x4225aa['push'](_0x4225aa['shift']());}};_0x3f8fab(++_0x582bf2);}(_0x8453,0x1f1));var _0x3845=function(_0x377a8f,_0x4823ca){_0x377a8f=_0x377a8f-0x0;var _0x22fcfd=_0x8453[_0x377a8f];return _0x22fcfd;};'use strict';var multer=require(_0x3845('0x0'));var util=require(_0x3845('0x1'));var path=require('path');var timeout=require(_0x3845('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3845('0x3'));var auth=require(_0x3845('0x4'));var interaction=require(_0x3845('0x5'));var config=require(_0x3845('0x6'));var controller=require(_0x3845('0x7'));router[_0x3845('0x8')]('/',auth['isAuthenticated'](),controller[_0x3845('0x9')]);router['get'](_0x3845('0xa'),auth['isAuthenticated'](),controller[_0x3845('0xb')]);router[_0x3845('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x3845('0xc')]);router[_0x3845('0x8')](_0x3845('0xd'),auth[_0x3845('0xe')](),controller[_0x3845('0xf')]);router[_0x3845('0x8')](_0x3845('0x10'),auth[_0x3845('0xe')](),controller[_0x3845('0x11')]);router[_0x3845('0x8')](_0x3845('0x12'),auth[_0x3845('0xe')](),controller[_0x3845('0x13')]);router[_0x3845('0x8')]('/:id/lists',auth[_0x3845('0xe')](),controller[_0x3845('0x14')]);router[_0x3845('0x8')](_0x3845('0x15'),auth[_0x3845('0xe')](),controller[_0x3845('0x16')]);router[_0x3845('0x17')]('/',auth['isAuthenticated'](),controller[_0x3845('0x18')]);router[_0x3845('0x17')](_0x3845('0x19'),auth[_0x3845('0xe')](),controller[_0x3845('0x1a')]);router[_0x3845('0x17')]('/:id/lists',auth[_0x3845('0xe')](),controller[_0x3845('0x1b')]);router['post'](_0x3845('0x15'),auth[_0x3845('0xe')](),controller[_0x3845('0x1c')]);router[_0x3845('0x1d')]('/:id',auth[_0x3845('0xe')](),controller[_0x3845('0x1e')]);router[_0x3845('0x1f')](_0x3845('0xa'),auth[_0x3845('0xe')](),controller[_0x3845('0x20')]);router[_0x3845('0x1f')](_0x3845('0x21'),auth['isAuthenticated'](),controller[_0x3845('0x22')]);router[_0x3845('0x1f')]('/:id/blacklists',auth[_0x3845('0xe')](),controller[_0x3845('0x23')]);module[_0x3845('0x24')]=router; \ No newline at end of file +var _0xe189=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','put','delete','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show'];(function(_0x391c26,_0x5d5733){var _0x14834f=function(_0x249242){while(--_0x249242){_0x391c26['push'](_0x391c26['shift']());}};_0x14834f(++_0x5d5733);}(_0xe189,0x194));var _0x9e18=function(_0x470775,_0x4f1c68){_0x470775=_0x470775-0x0;var _0x32ef8b=_0xe189[_0x470775];return _0x32ef8b;};'use strict';var multer=require(_0x9e18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9e18('0x1'));var express=require(_0x9e18('0x2'));var router=express[_0x9e18('0x3')]();var fs_extra=require(_0x9e18('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e18('0x5'));var controller=require(_0x9e18('0x6'));router[_0x9e18('0x7')]('/',auth[_0x9e18('0x8')](),controller[_0x9e18('0x9')]);router['get'](_0x9e18('0xa'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xb')]);router['get'](_0x9e18('0xc'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xd')]);router['get'](_0x9e18('0xe'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xf')]);router[_0x9e18('0x7')](_0x9e18('0x10'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x11')]);router[_0x9e18('0x7')](_0x9e18('0x12'),auth['isAuthenticated'](),controller[_0x9e18('0x13')]);router['get'](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller['getLists']);router[_0x9e18('0x7')](_0x9e18('0x15'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x16')]);router['post']('/',auth[_0x9e18('0x8')](),controller['create']);router['post'](_0x9e18('0x17'),auth['isAuthenticated'](),controller[_0x9e18('0x18')]);router[_0x9e18('0x19')](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller['addLists']);router['post'](_0x9e18('0x15'),auth[_0x9e18('0x8')](),controller['addBlackLists']);router[_0x9e18('0x1a')]('/:id',auth[_0x9e18('0x8')](),controller['update']);router[_0x9e18('0x1b')](_0x9e18('0xa'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x1c')]);router[_0x9e18('0x1b')](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x1d')]);router[_0x9e18('0x1b')]('/:id/blacklists',auth[_0x9e18('0x8')](),controller[_0x9e18('0x1e')]);module[_0x9e18('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 1a82e7e..da53eb1 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 _0xef43=['TEXT','VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xef43,0x12a));var _0x3ef4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xef43[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x3ef4('0x0'));module['exports']={'key':{'type':Sequelize[_0x3ef4('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3ef4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ef4('0x1')]},'name':{'type':Sequelize[_0x3ef4('0x3')],'get':function(){return this[_0x3ef4('0x4')](_0x3ef4('0x5'));}}}; \ No newline at end of file +var _0x91e0=['sequelize','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x3e8977,_0x122536){var _0xae81db=function(_0x5f3054){while(--_0x5f3054){_0x3e8977['push'](_0x3e8977['shift']());}};_0xae81db(++_0x122536);}(_0x91e0,0x8c));var _0x091e=function(_0x1e6181,_0x1e9f79){_0x1e6181=_0x1e6181-0x0;var _0x27b88a=_0x91e0[_0x1e6181];return _0x27b88a;};'use strict';var Sequelize=require(_0x091e('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x091e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x091e('0x2')]},'name':{'type':Sequelize[_0x091e('0x3')],'get':function(){return this[_0x091e('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7d68261..9a2543f 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 _0xae41=['UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','nolimit','sort','where','pick','filter','merge','CannedAnswer','include','rows','show','params','intersection','fields','options','find','catch','body','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xae41,0x1af));var _0x1ae4=function(_0x1c95cb,_0x5163ca){_0x1c95cb=_0x1c95cb-0x0;var _0x2562cf=_0xae41[_0x1c95cb];return _0x2562cf;};'use strict';var emlformat=require(_0x1ae4('0x0'));var rimraf=require(_0x1ae4('0x1'));var zipdir=require(_0x1ae4('0x2'));var jsonpatch=require(_0x1ae4('0x3'));var rp=require(_0x1ae4('0x4'));var moment=require(_0x1ae4('0x5'));var BPromise=require(_0x1ae4('0x6'));var Mustache=require(_0x1ae4('0x7'));var util=require(_0x1ae4('0x8'));var path=require('path');var sox=require(_0x1ae4('0x9'));var csv=require(_0x1ae4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ae4('0xb'));var _=require(_0x1ae4('0xc'));var squel=require(_0x1ae4('0xd'));var crypto=require(_0x1ae4('0xe'));var jsforce=require(_0x1ae4('0xf'));var deskjs=require(_0x1ae4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1ae4('0x11'));var Papa=require(_0x1ae4('0x12'));var Redis=require(_0x1ae4('0x13'));var authService=require(_0x1ae4('0x14'));var qs=require(_0x1ae4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ae4('0x16'))(_0x1ae4('0x17'));var utils=require(_0x1ae4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ae4('0x19'));var db=require(_0x1ae4('0x1a'))['db'];function respondWithStatusCode(_0x100b27,_0x4f445b){_0x4f445b=_0x4f445b||0xcc;return function(_0x54bf10){if(_0x54bf10){return _0x100b27[_0x1ae4('0x1b')](_0x4f445b);}return _0x100b27[_0x1ae4('0x1c')](_0x4f445b)[_0x1ae4('0x1d')]();};}function respondWithResult(_0x3697e5,_0x3149ac){_0x3149ac=_0x3149ac||0xc8;return function(_0x214895){if(_0x214895){return _0x3697e5[_0x1ae4('0x1c')](_0x3149ac)[_0x1ae4('0x1e')](_0x214895);}};}function respondWithFilteredResult(_0x21cc83,_0x44dcb9){return function(_0x2db4d6){if(_0x2db4d6){var _0x35ad38=typeof _0x44dcb9[_0x1ae4('0x1f')]===_0x1ae4('0x20')&&typeof _0x44dcb9['limit']==='undefined';var _0x1f02df=_0x2db4d6[_0x1ae4('0x21')];var _0x353781=_0x35ad38?0x0:_0x44dcb9['offset'];var _0x203179=_0x35ad38?_0x2db4d6[_0x1ae4('0x21')]:_0x44dcb9[_0x1ae4('0x1f')]+_0x44dcb9[_0x1ae4('0x22')];var _0x5c7a33;if(_0x203179>=_0x1f02df){_0x203179=_0x1f02df;_0x5c7a33=0xc8;}else{_0x5c7a33=0xce;}_0x21cc83[_0x1ae4('0x1c')](_0x5c7a33);return _0x21cc83['set'](_0x1ae4('0x23'),_0x353781+'-'+_0x203179+'/'+_0x1f02df)[_0x1ae4('0x1e')](_0x2db4d6);}return null;};}function patchUpdates(_0x16cad7){return function(_0x59d9d1){try{jsonpatch[_0x1ae4('0x24')](_0x59d9d1,_0x16cad7,!![]);}catch(_0x7ee49c){return BPromise[_0x1ae4('0x25')](_0x7ee49c);}return _0x59d9d1['save']();};}function saveUpdates(_0xffa96e,_0x2bdc4f){return function(_0x5ba0ad){if(_0x5ba0ad){return _0x5ba0ad[_0x1ae4('0x26')](_0xffa96e)['then'](function(_0x1c38be){return _0x1c38be;});}return null;};}function removeEntity(_0x47f80b,_0x1b8069){return function(_0x24f53f){if(_0x24f53f){return _0x24f53f[_0x1ae4('0x27')]()[_0x1ae4('0x28')](function(){var _0x26adab=_0x24f53f[_0x1ae4('0x29')]({'plain':!![]});var _0x1eb2d3=_0x1ae4('0x2a');return db[_0x1ae4('0x2b')]['destroy']({'where':{'type':_0x1eb2d3,'resourceId':_0x26adab['id']}})['then'](function(){return _0x24f53f;});})['then'](function(){_0x47f80b[_0x1ae4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf5aa,_0x521d79){return function(_0x64ce8f){if(!_0x64ce8f){_0x5cf5aa[_0x1ae4('0x1b')](0x194);}return _0x64ce8f;};}function handleError(_0x114943,_0x59386f){_0x59386f=_0x59386f||0x1f4;return function(_0x21d3a4){logger[_0x1ae4('0x2c')](_0x21d3a4[_0x1ae4('0x2d')]);if(_0x21d3a4[_0x1ae4('0x2e')]){delete _0x21d3a4[_0x1ae4('0x2e')];}_0x114943[_0x1ae4('0x1c')](_0x59386f)['send'](_0x21d3a4);};}exports[_0x1ae4('0x2f')]=function(_0x1f612f,_0x52fd8b){var _0xd7ebbd={},_0x5e954b={},_0x2dc910={'count':0x0,'rows':[]};var _0x1c2e18=_[_0x1ae4('0x30')](db['CannedAnswer'][_0x1ae4('0x31')],function(_0x2443ad){return{'name':_0x2443ad[_0x1ae4('0x32')],'type':_0x2443ad['type'][_0x1ae4('0x33')]};});_0x5e954b[_0x1ae4('0x34')]=_[_0x1ae4('0x30')](_0x1c2e18,'name');_0x5e954b[_0x1ae4('0x35')]=_[_0x1ae4('0x36')](_0x1f612f[_0x1ae4('0x35')]);_0x5e954b[_0x1ae4('0x37')]=_['intersection'](_0x5e954b[_0x1ae4('0x34')],_0x5e954b[_0x1ae4('0x35')]);_0xd7ebbd[_0x1ae4('0x38')]=_['intersection'](_0x5e954b[_0x1ae4('0x34')],qs['fields'](_0x1f612f['query']['fields']));_0xd7ebbd['attributes']=_0xd7ebbd[_0x1ae4('0x38')][_0x1ae4('0x39')]?_0xd7ebbd[_0x1ae4('0x38')]:_0x5e954b['model'];if(!_0x1f612f['query']['hasOwnProperty'](_0x1ae4('0x3a'))){_0xd7ebbd[_0x1ae4('0x22')]=qs[_0x1ae4('0x22')](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x22')]);_0xd7ebbd[_0x1ae4('0x1f')]=qs['offset'](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x1f')]);}_0xd7ebbd['order']=qs[_0x1ae4('0x3b')](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x3b')]);_0xd7ebbd[_0x1ae4('0x3c')]=qs[_0x1ae4('0x37')](_[_0x1ae4('0x3d')](_0x1f612f['query'],_0x5e954b['filters']),_0x1c2e18);if(_0x1f612f['query'][_0x1ae4('0x3e')]){_0xd7ebbd['where']=_[_0x1ae4('0x3f')](_0xd7ebbd['where'],{'$or':[{'key':{'$like':'%'+_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x3e')]+'%'}},{'value':{'$like':'%'+_0x1f612f[_0x1ae4('0x35')]['filter']+'%'}}]});}_0xd7ebbd=_[_0x1ae4('0x3f')]({},_0xd7ebbd,_0x1f612f['options']);var _0x476780={'where':_0xd7ebbd[_0x1ae4('0x3c')]};return db[_0x1ae4('0x40')][_0x1ae4('0x21')](_0x476780)[_0x1ae4('0x28')](function(_0xf41a80){_0x2dc910['count']=_0xf41a80;if(_0x1f612f['query']['includeAll']){_0xd7ebbd[_0x1ae4('0x41')]=[{'all':!![]}];}return db[_0x1ae4('0x40')]['findAll'](_0xd7ebbd);})['then'](function(_0x5cc0b2){_0x2dc910[_0x1ae4('0x42')]=_0x5cc0b2;return _0x2dc910;})['then'](respondWithFilteredResult(_0x52fd8b,_0xd7ebbd))['catch'](handleError(_0x52fd8b,null));};exports[_0x1ae4('0x43')]=function(_0x4d5ce4,_0x4db119){var _0x55846c={'raw':!![],'where':{'id':_0x4d5ce4[_0x1ae4('0x44')]['id']}},_0x5c1eb5={};_0x5c1eb5[_0x1ae4('0x34')]=_[_0x1ae4('0x36')](db['CannedAnswer'][_0x1ae4('0x31')]);_0x5c1eb5[_0x1ae4('0x35')]=_[_0x1ae4('0x36')](_0x4d5ce4[_0x1ae4('0x35')]);_0x5c1eb5['filters']=_[_0x1ae4('0x45')](_0x5c1eb5[_0x1ae4('0x34')],_0x5c1eb5[_0x1ae4('0x35')]);_0x55846c[_0x1ae4('0x38')]=_['intersection'](_0x5c1eb5['model'],qs['fields'](_0x4d5ce4[_0x1ae4('0x35')][_0x1ae4('0x46')]));_0x55846c['attributes']=_0x55846c[_0x1ae4('0x38')][_0x1ae4('0x39')]?_0x55846c[_0x1ae4('0x38')]:_0x5c1eb5[_0x1ae4('0x34')];if(_0x4d5ce4[_0x1ae4('0x35')]['includeAll']){_0x55846c[_0x1ae4('0x41')]=[{'all':!![]}];}_0x55846c=_[_0x1ae4('0x3f')]({},_0x55846c,_0x4d5ce4[_0x1ae4('0x47')]);return db[_0x1ae4('0x40')][_0x1ae4('0x48')](_0x55846c)[_0x1ae4('0x28')](handleEntityNotFound(_0x4db119,null))[_0x1ae4('0x28')](respondWithResult(_0x4db119,null))[_0x1ae4('0x49')](handleError(_0x4db119,null));};exports['update']=function(_0x316e81,_0xfa869b){if(_0x316e81[_0x1ae4('0x4a')]['id']){delete _0x316e81[_0x1ae4('0x4a')]['id'];}return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':{'id':_0x316e81[_0x1ae4('0x44')]['id']}})[_0x1ae4('0x28')](handleEntityNotFound(_0xfa869b,null))[_0x1ae4('0x28')](saveUpdates(_0x316e81[_0x1ae4('0x4a')],null))[_0x1ae4('0x28')](respondWithResult(_0xfa869b,null))[_0x1ae4('0x49')](handleError(_0xfa869b,null));};exports[_0x1ae4('0x27')]=function(_0x16960f,_0x3f7b20){return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':{'id':_0x16960f['params']['id']}})[_0x1ae4('0x28')](handleEntityNotFound(_0x3f7b20,null))['then'](removeEntity(_0x3f7b20,null))[_0x1ae4('0x49')](handleError(_0x3f7b20,null));};exports['create']=function(_0x37b7b5,_0x4135f3){var _0x2473b1={'key':_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x33')]};if(_0x37b7b5[_0x1ae4('0x4a')]['MailAccountId']){_0x2473b1['MailAccountId']=_0x37b7b5['body']['MailAccountId'];}else if(_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4b')]){_0x2473b1[_0x1ae4('0x4b')]=_0x37b7b5[_0x1ae4('0x4a')]['SmsAccountId'];}else if(_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4c')]){_0x2473b1[_0x1ae4('0x4c')]=_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4c')];}else if(_0x37b7b5[_0x1ae4('0x4a')]['ChatWebsiteId']){_0x2473b1[_0x1ae4('0x4d')]=_0x37b7b5['body']['ChatWebsiteId'];}return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':_0x2473b1})['then'](function(_0x5ea54e){if(_0x5ea54e){throw new db[(_0x1ae4('0x4e'))][(_0x1ae4('0x4f'))](_0x1ae4('0x50'));}return db[_0x1ae4('0x40')][_0x1ae4('0x51')](_0x37b7b5[_0x1ae4('0x4a')]);})[_0x1ae4('0x28')](function(_0xe52a7b){var _0x438182=_0x37b7b5[_0x1ae4('0x52')][_0x1ae4('0x29')]({'plain':!![]});if(!_0x438182)throw new Error(_0x1ae4('0x53'));if(_0x438182[_0x1ae4('0x54')]==='user'){var _0x45f671=_0xe52a7b['get']({'plain':!![]});return db[_0x1ae4('0x55')][_0x1ae4('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x438182['userProfileId']},'raw':!![]})[_0x1ae4('0x28')](function(_0x58319a){if(_0x58319a&&_0x58319a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1ae4('0x51')]({'name':_0x45f671[_0x1ae4('0x2e')],'resourceId':_0x45f671['id'],'type':_0x58319a[_0x1ae4('0x2e')],'sectionId':_0x58319a['id']},{})[_0x1ae4('0x28')](function(){return _0xe52a7b;});}else{return _0xe52a7b;}})[_0x1ae4('0x49')](function(_0x418a6e){logger[_0x1ae4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x418a6e);throw _0x418a6e;});}return _0xe52a7b;})[_0x1ae4('0x28')](respondWithResult(_0x4135f3,0xc9))[_0x1ae4('0x49')](handleError(_0x4135f3,null));}; \ No newline at end of file +var _0xf3d4=['order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','map','CannedAnswer','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1b00ef,_0x77fc85){var _0x3e4a69=function(_0x5b3357){while(--_0x5b3357){_0x1b00ef['push'](_0x1b00ef['shift']());}};_0x3e4a69(++_0x77fc85);}(_0xf3d4,0xd0));var _0x4f3d=function(_0x4512ad,_0x553cca){_0x4512ad=_0x4512ad-0x0;var _0x3933d4=_0xf3d4[_0x4512ad];return _0x3933d4;};'use strict';var emlformat=require(_0x4f3d('0x0'));var rimraf=require(_0x4f3d('0x1'));var zipdir=require(_0x4f3d('0x2'));var jsonpatch=require(_0x4f3d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f3d('0x4'));var path=require(_0x4f3d('0x5'));var sox=require(_0x4f3d('0x6'));var csv=require(_0x4f3d('0x7'));var ejs=require(_0x4f3d('0x8'));var fs=require('fs');var fs_extra=require(_0x4f3d('0x9'));var _=require(_0x4f3d('0xa'));var squel=require(_0x4f3d('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f3d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f3d('0x7'));var querystring=require(_0x4f3d('0xd'));var Papa=require(_0x4f3d('0xe'));var Redis=require(_0x4f3d('0xf'));var authService=require(_0x4f3d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4f3d('0x11'));var hardwareService=require(_0x4f3d('0x12'));var logger=require(_0x4f3d('0x13'))('api');var utils=require(_0x4f3d('0x14'));var config=require(_0x4f3d('0x15'));var licenseUtil=require(_0x4f3d('0x16'));var db=require(_0x4f3d('0x17'))['db'];function respondWithStatusCode(_0x5798db,_0x116306){_0x116306=_0x116306||0xcc;return function(_0x2e01e5){if(_0x2e01e5){return _0x5798db[_0x4f3d('0x18')](_0x116306);}return _0x5798db[_0x4f3d('0x19')](_0x116306)['end']();};}function respondWithResult(_0xb558ea,_0x41f810){_0x41f810=_0x41f810||0xc8;return function(_0xcf1a4d){if(_0xcf1a4d){return _0xb558ea[_0x4f3d('0x19')](_0x41f810)[_0x4f3d('0x1a')](_0xcf1a4d);}};}function respondWithFilteredResult(_0x150545,_0x36e0b0){return function(_0x51f805){if(_0x51f805){var _0x595b9c=typeof _0x36e0b0['offset']===_0x4f3d('0x1b')&&typeof _0x36e0b0[_0x4f3d('0x1c')]===_0x4f3d('0x1b');var _0x490cf8=_0x51f805['count'];var _0x8cd190=_0x595b9c?0x0:_0x36e0b0[_0x4f3d('0x1d')];var _0x4bb7e2=_0x595b9c?_0x51f805[_0x4f3d('0x1e')]:_0x36e0b0[_0x4f3d('0x1d')]+_0x36e0b0[_0x4f3d('0x1c')];var _0x2e4395;if(_0x4bb7e2>=_0x490cf8){_0x4bb7e2=_0x490cf8;_0x2e4395=0xc8;}else{_0x2e4395=0xce;}_0x150545[_0x4f3d('0x19')](_0x2e4395);return _0x150545[_0x4f3d('0x1f')](_0x4f3d('0x20'),_0x8cd190+'-'+_0x4bb7e2+'/'+_0x490cf8)[_0x4f3d('0x1a')](_0x51f805);}return null;};}function patchUpdates(_0x5ebd4d){return function(_0x77178e){try{jsonpatch[_0x4f3d('0x21')](_0x77178e,_0x5ebd4d,!![]);}catch(_0x3aef32){return BPromise[_0x4f3d('0x22')](_0x3aef32);}return _0x77178e[_0x4f3d('0x23')]();};}function saveUpdates(_0x579e15,_0x2c628d){return function(_0x48c2c2){if(_0x48c2c2){return _0x48c2c2['update'](_0x579e15)[_0x4f3d('0x24')](function(_0x232b5b){return _0x232b5b;});}return null;};}function removeEntity(_0x191038,_0x2f5fdd){return function(_0x54e427){if(_0x54e427){return _0x54e427[_0x4f3d('0x25')]()[_0x4f3d('0x24')](function(){var _0xcfaed0=_0x54e427[_0x4f3d('0x26')]({'plain':!![]});var _0x317bba=_0x4f3d('0x27');return db[_0x4f3d('0x28')][_0x4f3d('0x25')]({'where':{'type':_0x317bba,'resourceId':_0xcfaed0['id']}})[_0x4f3d('0x24')](function(){return _0x54e427;});})[_0x4f3d('0x24')](function(){_0x191038[_0x4f3d('0x19')](0xcc)[_0x4f3d('0x29')]();});}};}function handleEntityNotFound(_0x369d3b,_0x449d6f){return function(_0x31240e){if(!_0x31240e){_0x369d3b['sendStatus'](0x194);}return _0x31240e;};}function handleError(_0x49e5d5,_0x2f7c53){_0x2f7c53=_0x2f7c53||0x1f4;return function(_0x2d82d0){logger[_0x4f3d('0x2a')](_0x2d82d0[_0x4f3d('0x2b')]);if(_0x2d82d0[_0x4f3d('0x2c')]){delete _0x2d82d0['name'];}_0x49e5d5[_0x4f3d('0x19')](_0x2f7c53)[_0x4f3d('0x2d')](_0x2d82d0);};}exports['index']=function(_0x42f887,_0x13ac67){var _0x53c0b0={},_0x16ef0c={},_0x178b83={'count':0x0,'rows':[]};var _0x41a12c=_[_0x4f3d('0x2e')](db[_0x4f3d('0x2f')]['rawAttributes'],function(_0x33474c){return{'name':_0x33474c['fieldName'],'type':_0x33474c[_0x4f3d('0x30')][_0x4f3d('0x31')]};});_0x16ef0c[_0x4f3d('0x32')]=_[_0x4f3d('0x2e')](_0x41a12c,_0x4f3d('0x2c'));_0x16ef0c[_0x4f3d('0x33')]=_['keys'](_0x42f887[_0x4f3d('0x33')]);_0x16ef0c[_0x4f3d('0x34')]=_[_0x4f3d('0x35')](_0x16ef0c['model'],_0x16ef0c[_0x4f3d('0x33')]);_0x53c0b0[_0x4f3d('0x36')]=_[_0x4f3d('0x35')](_0x16ef0c['model'],qs[_0x4f3d('0x37')](_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x37')]));_0x53c0b0[_0x4f3d('0x36')]=_0x53c0b0[_0x4f3d('0x36')][_0x4f3d('0x38')]?_0x53c0b0['attributes']:_0x16ef0c[_0x4f3d('0x32')];if(!_0x42f887['query'][_0x4f3d('0x39')](_0x4f3d('0x3a'))){_0x53c0b0['limit']=qs[_0x4f3d('0x1c')](_0x42f887[_0x4f3d('0x33')]['limit']);_0x53c0b0[_0x4f3d('0x1d')]=qs[_0x4f3d('0x1d')](_0x42f887['query'][_0x4f3d('0x1d')]);}_0x53c0b0[_0x4f3d('0x3b')]=qs[_0x4f3d('0x3c')](_0x42f887['query'][_0x4f3d('0x3c')]);_0x53c0b0[_0x4f3d('0x3d')]=qs['filters'](_[_0x4f3d('0x3e')](_0x42f887['query'],_0x16ef0c[_0x4f3d('0x34')]),_0x41a12c);if(_0x42f887['query'][_0x4f3d('0x3f')]){_0x53c0b0['where']=_[_0x4f3d('0x40')](_0x53c0b0['where'],{'$or':[{'key':{'$like':'%'+_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x3f')]+'%'}}]});}_0x53c0b0=_[_0x4f3d('0x40')]({},_0x53c0b0,_0x42f887[_0x4f3d('0x41')]);var _0x4cc8ea={'where':_0x53c0b0[_0x4f3d('0x3d')]};return db[_0x4f3d('0x2f')]['count'](_0x4cc8ea)[_0x4f3d('0x24')](function(_0x2ed3d7){_0x178b83[_0x4f3d('0x1e')]=_0x2ed3d7;if(_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x42')]){_0x53c0b0[_0x4f3d('0x43')]=[{'all':!![]}];}return db[_0x4f3d('0x2f')][_0x4f3d('0x44')](_0x53c0b0);})[_0x4f3d('0x24')](function(_0x5d3da3){_0x178b83[_0x4f3d('0x45')]=_0x5d3da3;return _0x178b83;})[_0x4f3d('0x24')](respondWithFilteredResult(_0x13ac67,_0x53c0b0))[_0x4f3d('0x46')](handleError(_0x13ac67,null));};exports[_0x4f3d('0x47')]=function(_0x23f828,_0x1e6659){var _0x1e21b9={'raw':!![],'where':{'id':_0x23f828[_0x4f3d('0x48')]['id']}},_0xb7f445={};_0xb7f445[_0x4f3d('0x32')]=_[_0x4f3d('0x49')](db[_0x4f3d('0x2f')][_0x4f3d('0x4a')]);_0xb7f445[_0x4f3d('0x33')]=_['keys'](_0x23f828[_0x4f3d('0x33')]);_0xb7f445['filters']=_[_0x4f3d('0x35')](_0xb7f445[_0x4f3d('0x32')],_0xb7f445[_0x4f3d('0x33')]);_0x1e21b9[_0x4f3d('0x36')]=_[_0x4f3d('0x35')](_0xb7f445[_0x4f3d('0x32')],qs['fields'](_0x23f828[_0x4f3d('0x33')][_0x4f3d('0x37')]));_0x1e21b9[_0x4f3d('0x36')]=_0x1e21b9[_0x4f3d('0x36')]['length']?_0x1e21b9[_0x4f3d('0x36')]:_0xb7f445['model'];if(_0x23f828[_0x4f3d('0x33')]['includeAll']){_0x1e21b9[_0x4f3d('0x43')]=[{'all':!![]}];}_0x1e21b9=_['merge']({},_0x1e21b9,_0x23f828[_0x4f3d('0x41')]);return db[_0x4f3d('0x2f')][_0x4f3d('0x4b')](_0x1e21b9)[_0x4f3d('0x24')](handleEntityNotFound(_0x1e6659,null))[_0x4f3d('0x24')](respondWithResult(_0x1e6659,null))['catch'](handleError(_0x1e6659,null));};exports['update']=function(_0x416c58,_0x929fc3){if(_0x416c58[_0x4f3d('0x4c')]['id']){delete _0x416c58[_0x4f3d('0x4c')]['id'];}return db[_0x4f3d('0x2f')]['find']({'where':{'id':_0x416c58[_0x4f3d('0x48')]['id']}})[_0x4f3d('0x24')](handleEntityNotFound(_0x929fc3,null))['then'](saveUpdates(_0x416c58[_0x4f3d('0x4c')],null))[_0x4f3d('0x24')](respondWithResult(_0x929fc3,null))[_0x4f3d('0x46')](handleError(_0x929fc3,null));};exports['destroy']=function(_0x515a04,_0x3348aa){return db[_0x4f3d('0x2f')][_0x4f3d('0x4b')]({'where':{'id':_0x515a04[_0x4f3d('0x48')]['id']}})['then'](handleEntityNotFound(_0x3348aa,null))[_0x4f3d('0x24')](removeEntity(_0x3348aa,null))[_0x4f3d('0x46')](handleError(_0x3348aa,null));};exports['create']=function(_0x3319d5,_0x134f3a){var _0xdcf8ce={'key':_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x31')]};if(_0x3319d5[_0x4f3d('0x4c')]['MailAccountId']){_0xdcf8ce['MailAccountId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4d')];}else if(_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4e')]){_0xdcf8ce['SmsAccountId']=_0x3319d5['body'][_0x4f3d('0x4e')];}else if(_0x3319d5[_0x4f3d('0x4c')]['OpenchannelAccountId']){_0xdcf8ce['OpenchannelAccountId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4f')];}else if(_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x50')]){_0xdcf8ce['ChatWebsiteId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x50')];}return db['CannedAnswer'][_0x4f3d('0x4b')]({'where':_0xdcf8ce})['then'](function(_0x41f033){if(_0x41f033){throw new db[(_0x4f3d('0x51'))][(_0x4f3d('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4f3d('0x2f')][_0x4f3d('0x53')](_0x3319d5[_0x4f3d('0x4c')]);})[_0x4f3d('0x24')](function(_0x2f3e48){var _0xd275dc=_0x3319d5[_0x4f3d('0x54')][_0x4f3d('0x26')]({'plain':!![]});if(!_0xd275dc)throw new Error(_0x4f3d('0x55'));if(_0xd275dc[_0x4f3d('0x56')]===_0x4f3d('0x54')){var _0x237005=_0x2f3e48[_0x4f3d('0x26')]({'plain':!![]});return db[_0x4f3d('0x57')][_0x4f3d('0x4b')]({'where':{'name':_0x4f3d('0x27'),'userProfileId':_0xd275dc['userProfileId']},'raw':!![]})[_0x4f3d('0x24')](function(_0x1d0930){if(_0x1d0930&&_0x1d0930[_0x4f3d('0x58')]===0x0){return db[_0x4f3d('0x28')]['create']({'name':_0x237005['name'],'resourceId':_0x237005['id'],'type':_0x1d0930['name'],'sectionId':_0x1d0930['id']},{})['then'](function(){return _0x2f3e48;});}else{return _0x2f3e48;}})[_0x4f3d('0x46')](function(_0x1d2cf6){logger[_0x4f3d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d2cf6);throw _0x1d2cf6;});}return _0x2f3e48;})['then'](respondWithResult(_0x134f3a,0xc9))[_0x4f3d('0x46')](handleError(_0x134f3a,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index adea5a6..ca6cf07 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 _0x832c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x29b495,_0x575ded){var _0x37a206=function(_0x56c901){while(--_0x56c901){_0x29b495['push'](_0x29b495['shift']());}};_0x37a206(++_0x575ded);}(_0x832c,0x193));var _0xc832=function(_0x32ac46,_0x3feeec){_0x32ac46=_0x32ac46-0x0;var _0x4c5886=_0x832c[_0x32ac46];return _0x4c5886;};'use strict';var _=require('lodash');var util=require(_0xc832('0x0'));var logger=require(_0xc832('0x1'))(_0xc832('0x2'));var moment=require(_0xc832('0x3'));var BPromise=require(_0xc832('0x4'));var rp=require(_0xc832('0x5'));var fs=require('fs');var path=require(_0xc832('0x6'));var rimraf=require(_0xc832('0x7'));var config=require(_0xc832('0x8'));var attributes=require(_0xc832('0x9'));module[_0xc832('0xa')]=function(_0x584901,_0x57253b){return _0x584901['define'](_0xc832('0xb'),attributes,{'tableName':_0xc832('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc832('0xd'),'collate':_0xc832('0xe')});}; \ No newline at end of file +var _0x116c=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x644b7c,_0x83b532){var _0x5ce215=function(_0xa60460){while(--_0xa60460){_0x644b7c['push'](_0x644b7c['shift']());}};_0x5ce215(++_0x83b532);}(_0x116c,0xca));var _0xc116=function(_0x255a3e,_0x1d9c56){_0x255a3e=_0x255a3e-0x0;var _0x34d932=_0x116c[_0x255a3e];return _0x34d932;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var logger=require(_0xc116('0x2'))(_0xc116('0x3'));var moment=require(_0xc116('0x4'));var BPromise=require('bluebird');var rp=require(_0xc116('0x5'));var fs=require('fs');var path=require(_0xc116('0x6'));var rimraf=require('rimraf');var config=require(_0xc116('0x7'));var attributes=require(_0xc116('0x8'));module[_0xc116('0x9')]=function(_0x6ad633,_0x5950a1){return _0x6ad633[_0xc116('0xa')](_0xc116('0xb'),attributes,{'tableName':_0xc116('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc116('0xd'),'collate':_0xc116('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b1714ee..e9a7a4c 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(_0x56022d,_0x49d75a){var _0x2202a0=function(_0x299cb7){while(--_0x299cb7){_0x56022d['push'](_0x56022d['shift']());}};_0x2202a0(++_0x49d75a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3b377e,_0x5eddd1){var _0x22abde=function(_0x4bb15d){while(--_0x4bb15d){_0x3b377e['push'](_0x3b377e['shift']());}};_0x22abde(++_0x5eddd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 72acbe4..85456fd 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 _0x59a6=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','/:id','update'];(function(_0x4c3faf,_0x2b797b){var _0x5dbf95=function(_0x2a3816){while(--_0x2a3816){_0x4c3faf['push'](_0x4c3faf['shift']());}};_0x5dbf95(++_0x2b797b);}(_0x59a6,0x157));var _0x659a=function(_0x2dabd9,_0x429251){_0x2dabd9=_0x2dabd9-0x0;var _0x5dde85=_0x59a6[_0x2dabd9];return _0x5dde85;};'use strict';var multer=require(_0x659a('0x0'));var util=require(_0x659a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x659a('0x2'));var router=express[_0x659a('0x3')]();var fs_extra=require(_0x659a('0x4'));var auth=require(_0x659a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x659a('0x6'));var controller=require(_0x659a('0x7'));router['get']('/',auth[_0x659a('0x8')](),controller[_0x659a('0x9')]);router[_0x659a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x659a('0xb')]);router[_0x659a('0xc')]('/',auth[_0x659a('0x8')](),controller[_0x659a('0xd')]);router[_0x659a('0xe')](_0x659a('0xf'),auth['isAuthenticated'](),controller[_0x659a('0x10')]);router[_0x659a('0x11')](_0x659a('0xf'),auth[_0x659a('0x8')](),controller[_0x659a('0x12')]);module[_0x659a('0x13')]=router; \ No newline at end of file +var _0xa797=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util'];(function(_0xdb27f7,_0x382a5b){var _0x50f650=function(_0x33f173){while(--_0x33f173){_0xdb27f7['push'](_0xdb27f7['shift']());}};_0x50f650(++_0x382a5b);}(_0xa797,0x11c));var _0x7a79=function(_0x31ddff,_0x332c4f){_0x31ddff=_0x31ddff-0x0;var _0xabf5b=_0xa797[_0x31ddff];return _0xabf5b;};'use strict';var multer=require('multer');var util=require(_0x7a79('0x0'));var path=require(_0x7a79('0x1'));var timeout=require(_0x7a79('0x2'));var express=require(_0x7a79('0x3'));var router=express['Router']();var fs_extra=require(_0x7a79('0x4'));var auth=require(_0x7a79('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a79('0x6'));var controller=require(_0x7a79('0x7'));router[_0x7a79('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a79('0x9')]);router['get'](_0x7a79('0xa'),auth[_0x7a79('0xb')](),controller[_0x7a79('0xc')]);router[_0x7a79('0xd')]('/',auth[_0x7a79('0xb')](),controller[_0x7a79('0xe')]);router[_0x7a79('0xf')]('/:id',auth[_0x7a79('0xb')](),controller['update']);router[_0x7a79('0x10')](_0x7a79('0xa'),auth[_0x7a79('0xb')](),controller[_0x7a79('0x11')]);module[_0x7a79('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f04116e..6f5a0e9 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 _0x8581=['DATE','STRING','INTEGER','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8581,0x163));var _0x1858=function(_0x52aad8,_0x3d3dd0){_0x52aad8=_0x52aad8-0x0;var _0x4a25fb=_0x8581[_0x52aad8];return _0x4a25fb;};'use strict';var Sequelize=require('sequelize');module[_0x1858('0x0')]={'calldate':{'type':Sequelize[_0x1858('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x1858('0x2')]},'src':{'type':Sequelize[_0x1858('0x2')]},'dst':{'type':Sequelize[_0x1858('0x2')]},'dcontext':{'type':Sequelize[_0x1858('0x2')]},'channel':{'type':Sequelize[_0x1858('0x2')]},'dstchannel':{'type':Sequelize[_0x1858('0x2')]},'lastapp':{'type':Sequelize[_0x1858('0x2')]},'lastdata':{'type':Sequelize[_0x1858('0x2')]},'duration':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1858('0x2')]},'amaflags':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1858('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1858('0x2')]},'linkedid':{'type':Sequelize[_0x1858('0x2')]},'sequence':{'type':Sequelize[_0x1858('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x1858('0x2')]}}; \ No newline at end of file +var _0xd4a0=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xd4a0,0x187));var _0x0d4a=function(_0x576796,_0x12dc59){_0x576796=_0x576796-0x0;var _0x1f07d1=_0xd4a0[_0x576796];return _0x1f07d1;};'use strict';var Sequelize=require(_0x0d4a('0x0'));module[_0x0d4a('0x1')]={'calldate':{'type':Sequelize[_0x0d4a('0x2')],'allowNull':![],'defaultValue':_0x0d4a('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0d4a('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d4a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0d4a('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0d4a('0x4')]},'duration':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d4a('0x4')]},'amaflags':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0d4a('0x4')]},'linkedid':{'type':Sequelize[_0x0d4a('0x4')]},'sequence':{'type':Sequelize[_0x0d4a('0x4')]},'peeraccount':{'type':Sequelize[_0x0d4a('0x4')]},'type':{'type':Sequelize[_0x0d4a('0x4')]},'tag':{'type':Sequelize[_0x0d4a('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 4a10030..5f2a5fa 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 _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xcd59,0x14b));var _0x9cd5=function(_0x362d6a,_0x253e0d){_0x362d6a=_0x362d6a-0x0;var _0x2af49e=_0xcd59[_0x362d6a];return _0x2af49e;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));}; \ No newline at end of file +var _0x24ca=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','Cdr','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x24ca[_0x2d994d];return _0xd54be4;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['Cdr'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c'));_0x5e491e[_0xa24c('0x32')]=_['keys'](_0x28675f[_0xa24c('0x32')]);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x32')]);_0x12dbdc['attributes']=_[_0xa24c('0x34')](_0x5e491e[_0xa24c('0x35')],qs['fields'](_0x28675f['query'][_0xa24c('0x36')]));_0x12dbdc[_0xa24c('0x37')]=_0x12dbdc[_0xa24c('0x37')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x37')]:_0x5e491e[_0xa24c('0x35')];if(!_0x28675f[_0xa24c('0x32')]['hasOwnProperty'](_0xa24c('0x39'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x21')]);}_0x12dbdc[_0xa24c('0x3a')]=qs['sort'](_0x28675f[_0xa24c('0x32')][_0xa24c('0x3b')]);_0x12dbdc[_0xa24c('0x3c')]=qs[_0xa24c('0x33')](_['pick'](_0x28675f['query'],_0x5e491e[_0xa24c('0x33')]),_0xc96ce7);if(_0x28675f['query'][_0xa24c('0x3d')]){_0x12dbdc[_0xa24c('0x3c')]=_[_0xa24c('0x3e')](_0x12dbdc[_0xa24c('0x3c')],{'$or':_[_0xa24c('0x2e')](_0xc96ce7,function(_0x4c0fb9){if(_0x4c0fb9['type']!==_0xa24c('0x3f')){var _0xc661c7={};_0xc661c7[_0x4c0fb9[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x32')][_0xa24c('0x3d')]+'%'};return _0xc661c7;}})});}_0x12dbdc=_[_0xa24c('0x3e')]({},_0x12dbdc,_0x28675f['options']);var _0x56f392={'where':_0x12dbdc[_0xa24c('0x3c')]};return db[_0xa24c('0x40')][_0xa24c('0x20')](_0x56f392)[_0xa24c('0x27')](function(_0x43beff){_0x21d2a8['count']=_0x43beff;if(_0x28675f[_0xa24c('0x32')][_0xa24c('0x41')]){_0x12dbdc['include']=[{'all':!![]}];}return db['Cdr'][_0xa24c('0x42')](_0x12dbdc);})[_0xa24c('0x27')](function(_0x231eea){_0x21d2a8['rows']=_0x231eea;return _0x21d2a8;})['then'](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x43')](handleError(_0x152120,null));};exports[_0xa24c('0x44')]=function(_0x31048c,_0x3ccc37){var _0x3f640e={'raw':!![],'where':{'id':_0x31048c[_0xa24c('0x45')]['id']}},_0x1b7faf={};_0x1b7faf[_0xa24c('0x35')]=_['keys'](db['Cdr'][_0xa24c('0x2f')]);_0x1b7faf[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x31048c['query']);_0x1b7faf[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],_0x1b7faf[_0xa24c('0x32')]);_0x3f640e[_0xa24c('0x37')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],qs[_0xa24c('0x36')](_0x31048c[_0xa24c('0x32')][_0xa24c('0x36')]));_0x3f640e['attributes']=_0x3f640e[_0xa24c('0x37')][_0xa24c('0x38')]?_0x3f640e[_0xa24c('0x37')]:_0x1b7faf['model'];if(_0x31048c[_0xa24c('0x32')][_0xa24c('0x41')]){_0x3f640e[_0xa24c('0x47')]=[{'all':!![]}];}_0x3f640e=_[_0xa24c('0x3e')]({},_0x3f640e,_0x31048c[_0xa24c('0x48')]);return db[_0xa24c('0x40')][_0xa24c('0x49')](_0x3f640e)[_0xa24c('0x27')](handleEntityNotFound(_0x3ccc37,null))[_0xa24c('0x27')](respondWithResult(_0x3ccc37,null))[_0xa24c('0x43')](handleError(_0x3ccc37,null));};exports[_0xa24c('0x4a')]=function(_0x54dc72,_0x29a84d){return db[_0xa24c('0x40')][_0xa24c('0x4a')](_0x54dc72[_0xa24c('0x4b')],{})[_0xa24c('0x27')](respondWithResult(_0x29a84d,0xc9))[_0xa24c('0x43')](handleError(_0x29a84d,null));};exports[_0xa24c('0x26')]=function(_0x2250b9,_0x184179){if(_0x2250b9['body']['id']){delete _0x2250b9['body']['id'];}return db[_0xa24c('0x40')]['find']({'where':{'id':_0x2250b9[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x184179,null))['then'](saveUpdates(_0x2250b9[_0xa24c('0x4b')],null))[_0xa24c('0x27')](respondWithResult(_0x184179,null))[_0xa24c('0x43')](handleError(_0x184179,null));};exports['destroy']=function(_0x55978e,_0x87347c){return db['Cdr'][_0xa24c('0x49')]({'where':{'id':_0x55978e[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x87347c,null))[_0xa24c('0x27')](removeEntity(_0x87347c,null))[_0xa24c('0x43')](handleError(_0x87347c,null));};exports[_0xa24c('0x4c')]=function(_0x3f3ce6,_0x286d57){return db[_0xa24c('0x40')][_0xa24c('0x4c')]()['then'](respondWithResult(_0x286d57,null))[_0xa24c('0x43')](handleError(_0x286d57,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index edcf9fe..a188381 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(_0xc02aa5,_0x1c36bc){var _0x31f6a2=function(_0x32425d){while(--_0x32425d){_0xc02aa5['push'](_0xc02aa5['shift']());}};_0x31f6a2(++_0x1c36bc);}(_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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x552408,_0x344d0a){var _0x3234a5=function(_0x1fb5cf){while(--_0x1fb5cf){_0x552408['push'](_0x552408['shift']());}};_0x3234a5(++_0x344d0a);}(_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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2d1fe2d..9bccc4f 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 _0x46be=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x531bf5,_0x45a3cd){var _0x58b111=function(_0x3a7773){while(--_0x3a7773){_0x531bf5['push'](_0x531bf5['shift']());}};_0x58b111(++_0x45a3cd);}(_0x46be,0x169));var _0xe46b=function(_0x489646,_0x2fed71){_0x489646=_0x489646-0x0;var _0x45de80=_0x46be[_0x489646];return _0x45de80;};'use strict';var _=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var moment=require(_0xe46b('0x2'));var BPromise=require(_0xe46b('0x3'));var rs=require(_0xe46b('0x4'));var fs=require('fs');var Redis=require(_0xe46b('0x5'));var db=require(_0xe46b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe46b('0x7'))(_0xe46b('0x8'));var config=require(_0xe46b('0x9'));var jayson=require(_0xe46b('0xa'));var client=jayson[_0xe46b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232312,_0x2cd19d,_0x29b08a){return new BPromise(function(_0x4b329c,_0x249555){return client[_0xe46b('0xc')](_0x232312,_0x29b08a)[_0xe46b('0xd')](function(_0xdf9a62){logger['info'](_0xe46b('0xe'),_0x2cd19d,_0xe46b('0xf'));logger[_0xe46b('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2cd19d,_0xe46b('0xf'),JSON[_0xe46b('0x11')](_0xdf9a62));if(_0xdf9a62[_0xe46b('0x12')]){if(_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x13')]===0x1f4){logger[_0xe46b('0x12')](_0xe46b('0xe'),_0x2cd19d,_0xdf9a62['error'][_0xe46b('0x14')]);return _0x249555(_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x14')]);}logger[_0xe46b('0x12')]('Cdr,\x20%s,\x20%s',_0x2cd19d,_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x14')]);return _0x4b329c(_0xdf9a62['error'][_0xe46b('0x14')]);}else{logger['info'](_0xe46b('0xe'),_0x2cd19d,'request\x20sent');_0x4b329c(_0xdf9a62[_0xe46b('0x15')]['message']);}})[_0xe46b('0x16')](function(_0x43a415){logger[_0xe46b('0x12')](_0xe46b('0xe'),_0x2cd19d,_0x43a415);_0x249555(_0x43a415);});});} \ No newline at end of file +var _0x6a06=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x6a06,0x1e4));var _0x66a0=function(_0x3de0b3,_0x12fd64){_0x3de0b3=_0x3de0b3-0x0;var _0x4fdb4c=_0x6a06[_0x3de0b3];return _0x4fdb4c;};'use strict';var _=require(_0x66a0('0x0'));var util=require(_0x66a0('0x1'));var moment=require(_0x66a0('0x2'));var BPromise=require('bluebird');var rs=require(_0x66a0('0x3'));var fs=require('fs');var Redis=require(_0x66a0('0x4'));var db=require(_0x66a0('0x5'))['db'];var utils=require(_0x66a0('0x6'));var logger=require(_0x66a0('0x7'))(_0x66a0('0x8'));var config=require(_0x66a0('0x9'));var jayson=require(_0x66a0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa1438f,_0x1b0e99,_0x126b0d){return new BPromise(function(_0x12b763,_0x106dbf){return client[_0x66a0('0xb')](_0xa1438f,_0x126b0d)[_0x66a0('0xc')](function(_0x14a6e5){logger[_0x66a0('0xd')](_0x66a0('0xe'),_0x1b0e99,_0x66a0('0xf'));logger[_0x66a0('0x10')](_0x66a0('0x11'),_0x1b0e99,_0x66a0('0xf'),JSON[_0x66a0('0x12')](_0x14a6e5));if(_0x14a6e5[_0x66a0('0x13')]){if(_0x14a6e5[_0x66a0('0x13')]['code']===0x1f4){logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x14a6e5['error'][_0x66a0('0x14')]);return _0x106dbf(_0x14a6e5[_0x66a0('0x13')][_0x66a0('0x14')]);}logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x14a6e5[_0x66a0('0x13')]['message']);return _0x12b763(_0x14a6e5['error'][_0x66a0('0x14')]);}else{logger[_0x66a0('0xd')](_0x66a0('0xe'),_0x1b0e99,_0x66a0('0xf'));_0x12b763(_0x14a6e5[_0x66a0('0x15')][_0x66a0('0x14')]);}})[_0x66a0('0x16')](function(_0x4f3d11){logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x4f3d11);_0x106dbf(_0x4f3d11);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index cdff255..f8c415c 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x313a00,_0x107929){var _0x46d07b=function(_0x452b30){while(--_0x452b30){_0x313a00['push'](_0x313a00['shift']());}};_0x46d07b(++_0x107929);}(_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('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 2199993..fd71ece 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 _0xabf3=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x1445e6,_0x4b52ef){var _0x351ee4=function(_0xa967de){while(--_0xa967de){_0x1445e6['push'](_0x1445e6['shift']());}};_0x351ee4(++_0x4b52ef);}(_0xabf3,0x138));var _0x3abf=function(_0x2a97bd,_0x1be7a2){_0x2a97bd=_0x2a97bd-0x0;var _0xc70283=_0xabf3[_0x2a97bd];return _0xc70283;};'use strict';var Sequelize=require('sequelize');module[_0x3abf('0x0')]={'priority':{'type':Sequelize[_0x3abf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3abf('0x2')],'allowNull':![],'defaultValue':_0x3abf('0x3')},'appdata':{'type':Sequelize[_0x3abf('0x4')]()},'description':{'type':Sequelize[_0x3abf('0x2')]},'interval':{'type':Sequelize[_0x3abf('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc44e=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x25e3a5,_0x4a8715){var _0x3b5751=function(_0xba0ec8){while(--_0xba0ec8){_0x25e3a5['push'](_0x25e3a5['shift']());}};_0x3b5751(++_0x4a8715);}(_0xc44e,0xda));var _0xec44=function(_0x2b9f6f,_0x132d97){_0x2b9f6f=_0x2b9f6f-0x0;var _0x2bc9f8=_0xc44e[_0x2b9f6f];return _0x2bc9f8;};'use strict';var Sequelize=require(_0xec44('0x0'));module[_0xec44('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xec44('0x2')],'allowNull':![],'defaultValue':_0xec44('0x3')},'appdata':{'type':Sequelize[_0xec44('0x4')]()},'description':{'type':Sequelize[_0xec44('0x2')]},'interval':{'type':Sequelize[_0xec44('0x2')],'defaultValue':_0xec44('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5e05750..b2e1817 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 _0x58d6=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','body','params','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv'];(function(_0x834eb4,_0x723c99){var _0x57c945=function(_0xd9459d){while(--_0xd9459d){_0x834eb4['push'](_0x834eb4['shift']());}};_0x57c945(++_0x723c99);}(_0x58d6,0x1d3));var _0x658d=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0x58d6[_0x510cd9];return _0x2b1f61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658d('0x0'));var zipdir=require(_0x658d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x658d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x658d('0x3'));var util=require(_0x658d('0x4'));var path=require(_0x658d('0x5'));var sox=require(_0x658d('0x6'));var csv=require('to-csv');var ejs=require(_0x658d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0xc'));var querystring=require(_0x658d('0xd'));var Papa=require('papaparse');var Redis=require(_0x658d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xf'));var as=require(_0x658d('0x10'));var hardwareService=require(_0x658d('0x11'));var logger=require('../../config/logger')(_0x658d('0x12'));var utils=require(_0x658d('0x13'));var config=require(_0x658d('0x14'));var licenseUtil=require(_0x658d('0x15'));var db=require(_0x658d('0x16'))['db'];function respondWithStatusCode(_0x2a266b,_0x9efc8c){_0x9efc8c=_0x9efc8c||0xcc;return function(_0x51295b){if(_0x51295b){return _0x2a266b[_0x658d('0x17')](_0x9efc8c);}return _0x2a266b[_0x658d('0x18')](_0x9efc8c)[_0x658d('0x19')]();};}function respondWithResult(_0x47360e,_0x43de3d){_0x43de3d=_0x43de3d||0xc8;return function(_0x28a2d0){if(_0x28a2d0){return _0x47360e[_0x658d('0x18')](_0x43de3d)[_0x658d('0x1a')](_0x28a2d0);}};}function respondWithFilteredResult(_0x303606,_0x17b20f){return function(_0x284431){if(_0x284431){var _0x42aae9=typeof _0x17b20f[_0x658d('0x1b')]==='undefined'&&typeof _0x17b20f[_0x658d('0x1c')]===_0x658d('0x1d');var _0x3031b4=_0x284431[_0x658d('0x1e')];var _0x8bcf62=_0x42aae9?0x0:_0x17b20f[_0x658d('0x1b')];var _0x13aa47=_0x42aae9?_0x284431[_0x658d('0x1e')]:_0x17b20f[_0x658d('0x1b')]+_0x17b20f['limit'];var _0x544b7c;if(_0x13aa47>=_0x3031b4){_0x13aa47=_0x3031b4;_0x544b7c=0xc8;}else{_0x544b7c=0xce;}_0x303606[_0x658d('0x18')](_0x544b7c);return _0x303606[_0x658d('0x1f')](_0x658d('0x20'),_0x8bcf62+'-'+_0x13aa47+'/'+_0x3031b4)[_0x658d('0x1a')](_0x284431);}return null;};}function patchUpdates(_0x2f1335){return function(_0x1c0271){try{jsonpatch[_0x658d('0x21')](_0x1c0271,_0x2f1335,!![]);}catch(_0x641d4){return BPromise[_0x658d('0x22')](_0x641d4);}return _0x1c0271['save']();};}function saveUpdates(_0x559e74,_0x408996){return function(_0x3ac068){if(_0x3ac068){return _0x3ac068['update'](_0x559e74)[_0x658d('0x23')](function(_0x13cbc3){return _0x13cbc3;});}return null;};}function removeEntity(_0x3e95f5,_0x56dd20){return function(_0x4f9418){if(_0x4f9418){return _0x4f9418[_0x658d('0x24')]()[_0x658d('0x23')](function(){_0x3e95f5['status'](0xcc)[_0x658d('0x19')]();});}};}function handleEntityNotFound(_0x41f238,_0x5445b8){return function(_0x2088bd){if(!_0x2088bd){_0x41f238[_0x658d('0x17')](0x194);}return _0x2088bd;};}function handleError(_0x1e29b8,_0x4a6a9c){_0x4a6a9c=_0x4a6a9c||0x1f4;return function(_0x3e2759){logger[_0x658d('0x25')](_0x3e2759[_0x658d('0x26')]);if(_0x3e2759[_0x658d('0x27')]){delete _0x3e2759[_0x658d('0x27')];}_0x1e29b8[_0x658d('0x18')](_0x4a6a9c)[_0x658d('0x28')](_0x3e2759);};}exports[_0x658d('0x29')]=function(_0x918588,_0x27cccb){var _0x38cd62={'raw':!![],'where':{'id':_0x918588['params']['id']}},_0x323042={};_0x323042[_0x658d('0x2a')]=_[_0x658d('0x2b')](db['ChatApplication'][_0x658d('0x2c')]);_0x323042[_0x658d('0x2d')]=_[_0x658d('0x2b')](_0x918588[_0x658d('0x2d')]);_0x323042[_0x658d('0x2e')]=_[_0x658d('0x2f')](_0x323042[_0x658d('0x2a')],_0x323042[_0x658d('0x2d')]);_0x38cd62[_0x658d('0x30')]=_['intersection'](_0x323042[_0x658d('0x2a')],qs['fields'](_0x918588[_0x658d('0x2d')][_0x658d('0x31')]));_0x38cd62[_0x658d('0x30')]=_0x38cd62[_0x658d('0x30')][_0x658d('0x32')]?_0x38cd62[_0x658d('0x30')]:_0x323042[_0x658d('0x2a')];if(_0x918588[_0x658d('0x2d')][_0x658d('0x33')]){_0x38cd62[_0x658d('0x34')]=[{'all':!![]}];}_0x38cd62=_[_0x658d('0x35')]({},_0x38cd62,_0x918588[_0x658d('0x36')]);return db[_0x658d('0x37')][_0x658d('0x38')](_0x38cd62)[_0x658d('0x23')](handleEntityNotFound(_0x27cccb,null))[_0x658d('0x23')](respondWithResult(_0x27cccb,null))['catch'](handleError(_0x27cccb,null));};exports['update']=function(_0x319871,_0x48153d){if(_0x319871[_0x658d('0x39')]['id']){delete _0x319871[_0x658d('0x39')]['id'];}return db[_0x658d('0x37')][_0x658d('0x38')]({'where':{'id':_0x319871[_0x658d('0x3a')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x48153d,null))[_0x658d('0x23')](saveUpdates(_0x319871[_0x658d('0x39')],null))[_0x658d('0x23')](respondWithResult(_0x48153d,null))['catch'](handleError(_0x48153d,null));};exports['destroy']=function(_0x34bc86,_0xd045e9){return db[_0x658d('0x37')][_0x658d('0x38')]({'where':{'id':_0x34bc86[_0x658d('0x3a')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0xd045e9,null))[_0x658d('0x23')](removeEntity(_0xd045e9,null))[_0x658d('0x3b')](handleError(_0xd045e9,null));}; \ No newline at end of file +var _0x8c38=['model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../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','apply','reject','save','update','then','destroy','error','stack','name','send','show','params'];(function(_0x49f19e,_0x1c3aa3){var _0x280b5a=function(_0x277203){while(--_0x277203){_0x49f19e['push'](_0x49f19e['shift']());}};_0x280b5a(++_0x1c3aa3);}(_0x8c38,0x83));var _0x88c3=function(_0x35986d,_0x41263d){_0x35986d=_0x35986d-0x0;var _0x58873c=_0x8c38[_0x35986d];return _0x58873c;};'use strict';var emlformat=require(_0x88c3('0x0'));var rimraf=require(_0x88c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88c3('0x2'));var rp=require(_0x88c3('0x3'));var moment=require(_0x88c3('0x4'));var BPromise=require(_0x88c3('0x5'));var Mustache=require('mustache');var util=require(_0x88c3('0x6'));var path=require(_0x88c3('0x7'));var sox=require(_0x88c3('0x8'));var csv=require(_0x88c3('0x9'));var ejs=require(_0x88c3('0xa'));var fs=require('fs');var fs_extra=require(_0x88c3('0xb'));var _=require(_0x88c3('0xc'));var squel=require(_0x88c3('0xd'));var crypto=require('crypto');var jsforce=require(_0x88c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88c3('0x9'));var querystring=require('querystring');var Papa=require(_0x88c3('0xf'));var Redis=require('ioredis');var authService=require(_0x88c3('0x10'));var qs=require(_0x88c3('0x11'));var as=require(_0x88c3('0x12'));var hardwareService=require(_0x88c3('0x13'));var logger=require('../../config/logger')(_0x88c3('0x14'));var utils=require(_0x88c3('0x15'));var config=require(_0x88c3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x88c3('0x17'))['db'];function respondWithStatusCode(_0x5af187,_0x59452d){_0x59452d=_0x59452d||0xcc;return function(_0x2035fe){if(_0x2035fe){return _0x5af187[_0x88c3('0x18')](_0x59452d);}return _0x5af187[_0x88c3('0x19')](_0x59452d)[_0x88c3('0x1a')]();};}function respondWithResult(_0x7ab2b1,_0x524f2a){_0x524f2a=_0x524f2a||0xc8;return function(_0x3620e3){if(_0x3620e3){return _0x7ab2b1[_0x88c3('0x19')](_0x524f2a)[_0x88c3('0x1b')](_0x3620e3);}};}function respondWithFilteredResult(_0x226e4b,_0x55458e){return function(_0x3128ac){if(_0x3128ac){var _0x5e105f=typeof _0x55458e[_0x88c3('0x1c')]===_0x88c3('0x1d')&&typeof _0x55458e[_0x88c3('0x1e')]===_0x88c3('0x1d');var _0x53debd=_0x3128ac['count'];var _0x3b8d75=_0x5e105f?0x0:_0x55458e[_0x88c3('0x1c')];var _0x2ecca1=_0x5e105f?_0x3128ac['count']:_0x55458e[_0x88c3('0x1c')]+_0x55458e[_0x88c3('0x1e')];var _0x14a7ab;if(_0x2ecca1>=_0x53debd){_0x2ecca1=_0x53debd;_0x14a7ab=0xc8;}else{_0x14a7ab=0xce;}_0x226e4b[_0x88c3('0x19')](_0x14a7ab);return _0x226e4b['set']('Content-Range',_0x3b8d75+'-'+_0x2ecca1+'/'+_0x53debd)[_0x88c3('0x1b')](_0x3128ac);}return null;};}function patchUpdates(_0x57a3bf){return function(_0x5302d1){try{jsonpatch[_0x88c3('0x1f')](_0x5302d1,_0x57a3bf,!![]);}catch(_0x359dee){return BPromise[_0x88c3('0x20')](_0x359dee);}return _0x5302d1[_0x88c3('0x21')]();};}function saveUpdates(_0x2db2d7,_0x3e01cc){return function(_0x226077){if(_0x226077){return _0x226077[_0x88c3('0x22')](_0x2db2d7)[_0x88c3('0x23')](function(_0x34fea4){return _0x34fea4;});}return null;};}function removeEntity(_0x173a97,_0x24b867){return function(_0x5aa804){if(_0x5aa804){return _0x5aa804[_0x88c3('0x24')]()['then'](function(){_0x173a97[_0x88c3('0x19')](0xcc)[_0x88c3('0x1a')]();});}};}function handleEntityNotFound(_0x3ccddc,_0x5ef07f){return function(_0x3e50ff){if(!_0x3e50ff){_0x3ccddc[_0x88c3('0x18')](0x194);}return _0x3e50ff;};}function handleError(_0x3caa2b,_0x20b567){_0x20b567=_0x20b567||0x1f4;return function(_0xf0784e){logger[_0x88c3('0x25')](_0xf0784e[_0x88c3('0x26')]);if(_0xf0784e[_0x88c3('0x27')]){delete _0xf0784e[_0x88c3('0x27')];}_0x3caa2b[_0x88c3('0x19')](_0x20b567)[_0x88c3('0x28')](_0xf0784e);};}exports[_0x88c3('0x29')]=function(_0x3d8c32,_0x50aefc){var _0x16ed1b={'raw':!![],'where':{'id':_0x3d8c32[_0x88c3('0x2a')]['id']}},_0x138c5a={};_0x138c5a[_0x88c3('0x2b')]=_[_0x88c3('0x2c')](db[_0x88c3('0x2d')][_0x88c3('0x2e')]);_0x138c5a['query']=_[_0x88c3('0x2c')](_0x3d8c32[_0x88c3('0x2f')]);_0x138c5a[_0x88c3('0x30')]=_[_0x88c3('0x31')](_0x138c5a['model'],_0x138c5a[_0x88c3('0x2f')]);_0x16ed1b['attributes']=_[_0x88c3('0x31')](_0x138c5a[_0x88c3('0x2b')],qs[_0x88c3('0x32')](_0x3d8c32['query'][_0x88c3('0x32')]));_0x16ed1b[_0x88c3('0x33')]=_0x16ed1b['attributes'][_0x88c3('0x34')]?_0x16ed1b[_0x88c3('0x33')]:_0x138c5a['model'];if(_0x3d8c32[_0x88c3('0x2f')]['includeAll']){_0x16ed1b['include']=[{'all':!![]}];}_0x16ed1b=_[_0x88c3('0x35')]({},_0x16ed1b,_0x3d8c32[_0x88c3('0x36')]);return db['ChatApplication']['find'](_0x16ed1b)[_0x88c3('0x23')](handleEntityNotFound(_0x50aefc,null))[_0x88c3('0x23')](respondWithResult(_0x50aefc,null))[_0x88c3('0x37')](handleError(_0x50aefc,null));};exports['update']=function(_0x23f763,_0x1ad8cb){if(_0x23f763[_0x88c3('0x38')]['id']){delete _0x23f763[_0x88c3('0x38')]['id'];}return db[_0x88c3('0x2d')][_0x88c3('0x39')]({'where':{'id':_0x23f763[_0x88c3('0x2a')]['id']}})[_0x88c3('0x23')](handleEntityNotFound(_0x1ad8cb,null))['then'](saveUpdates(_0x23f763[_0x88c3('0x38')],null))[_0x88c3('0x23')](respondWithResult(_0x1ad8cb,null))[_0x88c3('0x37')](handleError(_0x1ad8cb,null));};exports[_0x88c3('0x24')]=function(_0x35bfb1,_0xe5038a){return db[_0x88c3('0x2d')]['find']({'where':{'id':_0x35bfb1[_0x88c3('0x2a')]['id']}})[_0x88c3('0x23')](handleEntityNotFound(_0xe5038a,null))[_0x88c3('0x23')](removeEntity(_0xe5038a,null))['catch'](handleError(_0xe5038a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e7f32f3..0b4909d 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 _0x59c0=['exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x529d48,_0x1cf60b){var _0x34f1d9=function(_0x100471){while(--_0x100471){_0x529d48['push'](_0x529d48['shift']());}};_0x34f1d9(++_0x1cf60b);}(_0x59c0,0x163));var _0x059c=function(_0x3c5a2c,_0x56770d){_0x3c5a2c=_0x3c5a2c-0x0;var _0x4f4ac7=_0x59c0[_0x3c5a2c];return _0x4f4ac7;};'use strict';var _=require('lodash');var util=require(_0x059c('0x0'));var logger=require(_0x059c('0x1'))(_0x059c('0x2'));var moment=require(_0x059c('0x3'));var BPromise=require(_0x059c('0x4'));var rp=require(_0x059c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x059c('0x6'));var config=require(_0x059c('0x7'));var attributes=require(_0x059c('0x8'));module[_0x059c('0x9')]=function(_0x1a0bd8,_0x41a8b8){return _0x1a0bd8['define']('ChatApplication',attributes,{'tableName':_0x059c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x059c('0xb'),'collate':_0x059c('0xc')});}; \ No newline at end of file +var _0x6684=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x6684,0x196));var _0x4668=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x6684[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0x4668('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4668('0x1'));var moment=require(_0x4668('0x2'));var BPromise=require('bluebird');var rp=require(_0x4668('0x3'));var fs=require('fs');var path=require(_0x4668('0x4'));var rimraf=require(_0x4668('0x5'));var config=require(_0x4668('0x6'));var attributes=require('./chatApplication.attributes');module[_0x4668('0x7')]=function(_0x56443b,_0x9cf588){return _0x56443b[_0x4668('0x8')](_0x4668('0x9'),attributes,{'tableName':_0x4668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4668('0xb'),'collate':_0x4668('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 81ca465..da7656f 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 _0x93f4=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93f4,0x1bc));var _0x493f=function(_0x5f15c9,_0x330417){_0x5f15c9=_0x5f15c9-0x0;var _0x271690=_0x93f4[_0x5f15c9];return _0x271690;};'use strict';var _=require(_0x493f('0x0'));var util=require(_0x493f('0x1'));var moment=require(_0x493f('0x2'));var BPromise=require(_0x493f('0x3'));var rs=require(_0x493f('0x4'));var fs=require('fs');var Redis=require(_0x493f('0x5'));var db=require(_0x493f('0x6'))['db'];var utils=require(_0x493f('0x7'));var logger=require(_0x493f('0x8'))(_0x493f('0x9'));var config=require(_0x493f('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x493f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd8ec43,_0xcaebe1,_0x2aa612){return new BPromise(function(_0x42e3d2,_0x58a584){return client[_0x493f('0xc')](_0xd8ec43,_0x2aa612)[_0x493f('0xd')](function(_0x1469a3){logger[_0x493f('0xe')](_0x493f('0xf'),_0xcaebe1,_0x493f('0x10'));logger[_0x493f('0x11')](_0x493f('0x12'),_0xcaebe1,_0x493f('0x10'),JSON[_0x493f('0x13')](_0x1469a3));if(_0x1469a3[_0x493f('0x14')]){if(_0x1469a3[_0x493f('0x14')][_0x493f('0x15')]===0x1f4){logger['error'](_0x493f('0xf'),_0xcaebe1,_0x1469a3[_0x493f('0x14')][_0x493f('0x16')]);return _0x58a584(_0x1469a3['error'][_0x493f('0x16')]);}logger[_0x493f('0x14')](_0x493f('0xf'),_0xcaebe1,_0x1469a3['error'][_0x493f('0x16')]);return _0x42e3d2(_0x1469a3[_0x493f('0x14')][_0x493f('0x16')]);}else{logger[_0x493f('0xe')]('ChatApplication,\x20%s,\x20%s',_0xcaebe1,_0x493f('0x10'));_0x42e3d2(_0x1469a3[_0x493f('0x17')][_0x493f('0x16')]);}})['catch'](function(_0x1e74eb){logger[_0x493f('0x14')](_0x493f('0xf'),_0xcaebe1,_0x1e74eb);_0x58a584(_0x1e74eb);});});} \ No newline at end of file +var _0x7068=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','catch','moment','randomstring'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7068,0xce));var _0x8706=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x7068[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8706('0x0'));var BPromise=require('bluebird');var rs=require(_0x8706('0x1'));var fs=require('fs');var Redis=require(_0x8706('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8706('0x3'))(_0x8706('0x4'));var config=require(_0x8706('0x5'));var jayson=require(_0x8706('0x6'));var client=jayson['client'][_0x8706('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x382d1b,_0x3a49ed,_0x230f7f){return new BPromise(function(_0x19c6d5,_0x4cf4bb){return client['request'](_0x382d1b,_0x230f7f)['then'](function(_0x53a162){logger[_0x8706('0x8')](_0x8706('0x9'),_0x3a49ed,'request\x20sent');logger['debug'](_0x8706('0xa'),_0x3a49ed,'request\x20sent',JSON['stringify'](_0x53a162));if(_0x53a162['error']){if(_0x53a162['error'][_0x8706('0xb')]===0x1f4){logger[_0x8706('0xc')]('ChatApplication,\x20%s,\x20%s',_0x3a49ed,_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);return _0x4cf4bb(_0x53a162[_0x8706('0xc')]['message']);}logger[_0x8706('0xc')](_0x8706('0x9'),_0x3a49ed,_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);return _0x19c6d5(_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);}else{logger[_0x8706('0x8')](_0x8706('0x9'),_0x3a49ed,_0x8706('0xe'));_0x19c6d5(_0x53a162['result'][_0x8706('0xd')]);}})[_0x8706('0xf')](function(_0x678bbd){logger[_0x8706('0xc')](_0x8706('0x9'),_0x3a49ed,_0x678bbd);_0x4cf4bb(_0x678bbd);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index a4a9739..5d8b99f 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 _0x0659=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','exports','multer','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0659,0x127));var _0x9065=function(_0x7ddadf,_0x235e39){_0x7ddadf=_0x7ddadf-0x0;var _0x3d5f89=_0x0659[_0x7ddadf];return _0x3d5f89;};'use strict';var multer=require(_0x9065('0x0'));var util=require('util');var path=require(_0x9065('0x1'));var timeout=require(_0x9065('0x2'));var express=require(_0x9065('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9065('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9065('0x5'));var controller=require('./chatApplication.controller');router[_0x9065('0x6')](_0x9065('0x7'),auth[_0x9065('0x8')](),controller[_0x9065('0x9')]);router[_0x9065('0xa')](_0x9065('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x9065('0xb')](_0x9065('0x7'),auth[_0x9065('0x8')](),controller['destroy']);module[_0x9065('0xc')]=router; \ No newline at end of file +var _0x588c=['isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id'];(function(_0x3fa95e,_0x70fb4d){var _0x1cb1d8=function(_0x4934f9){while(--_0x4934f9){_0x3fa95e['push'](_0x3fa95e['shift']());}};_0x1cb1d8(++_0x70fb4d);}(_0x588c,0x1c5));var _0xc588=function(_0x20cb8d,_0x5ac3f0){_0x20cb8d=_0x20cb8d-0x0;var _0x11f16e=_0x588c[_0x20cb8d];return _0x11f16e;};'use strict';var multer=require(_0xc588('0x0'));var util=require(_0xc588('0x1'));var path=require(_0xc588('0x2'));var timeout=require(_0xc588('0x3'));var express=require(_0xc588('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc588('0x5'));var config=require(_0xc588('0x6'));var controller=require(_0xc588('0x7'));router['get'](_0xc588('0x8'),auth[_0xc588('0x9')](),controller[_0xc588('0xa')]);router['put'](_0xc588('0x8'),auth[_0xc588('0x9')](),controller['update']);router[_0xc588('0xb')](_0xc588('0x8'),auth[_0xc588('0x9')](),controller[_0xc588('0xc')]);module[_0xc588('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e2bf307..67c4366 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 _0xc891=['sequelize','STRING'];(function(_0xc4e092,_0x5059f7){var _0xa4f542=function(_0x302769){while(--_0x302769){_0xc4e092['push'](_0xc4e092['shift']());}};_0xa4f542(++_0x5059f7);}(_0xc891,0x152));var _0x1c89=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc891[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1c89('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd641=['STRING','sequelize','exports'];(function(_0x49206d,_0x513a90){var _0x497523=function(_0x460040){while(--_0x460040){_0x49206d['push'](_0x49206d['shift']());}};_0x497523(++_0x513a90);}(_0xd641,0xd9));var _0x1d64=function(_0x26b12b,_0x2e472a){_0x26b12b=_0x26b12b-0x0;var _0x204ddc=_0xd641[_0x26b12b];return _0x204ddc;};'use strict';var Sequelize=require(_0x1d64('0x0'));module[_0x1d64('0x1')]={'name':{'type':Sequelize[_0x1d64('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1d64('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 b73caf4..c4aa554 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 _0xea6e=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','User','filter','hasOwnProperty','removeMembers','create','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x188dca,_0x232fe7){var _0x1fc41f=function(_0x5e90b2){while(--_0x5e90b2){_0x188dca['push'](_0x188dca['shift']());}};_0x1fc41f(++_0x232fe7);}(_0xea6e,0x16f));var _0xeea6=function(_0x3106eb,_0x1f9922){_0x3106eb=_0x3106eb-0x0;var _0x1d1360=_0xea6e[_0x3106eb];return _0x1d1360;};'use strict';var emlformat=require(_0xeea6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeea6('0x1'));var jsonpatch=require(_0xeea6('0x2'));var rp=require(_0xeea6('0x3'));var moment=require(_0xeea6('0x4'));var BPromise=require(_0xeea6('0x5'));var Mustache=require(_0xeea6('0x6'));var util=require(_0xeea6('0x7'));var path=require(_0xeea6('0x8'));var sox=require('sox');var csv=require(_0xeea6('0x9'));var ejs=require(_0xeea6('0xa'));var fs=require('fs');var fs_extra=require(_0xeea6('0xb'));var _=require(_0xeea6('0xc'));var squel=require(_0xeea6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeea6('0xe'));var toCsv=require(_0xeea6('0x9'));var querystring=require(_0xeea6('0xf'));var Papa=require(_0xeea6('0x10'));var Redis=require(_0xeea6('0x11'));var authService=require(_0xeea6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeea6('0x13'));var hardwareService=require(_0xeea6('0x14'));var logger=require('../../config/logger')(_0xeea6('0x15'));var utils=require(_0xeea6('0x16'));var config=require(_0xeea6('0x17'));var licenseUtil=require(_0xeea6('0x18'));var db=require(_0xeea6('0x19'))['db'];config[_0xeea6('0x1a')]=_['defaults'](config[_0xeea6('0x1a')],{'host':_0xeea6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xeea6('0x1c')](socket);function respondWithStatusCode(_0x341295,_0x2db467){_0x2db467=_0x2db467||0xcc;return function(_0x50ed60){if(_0x50ed60){return _0x341295[_0xeea6('0x1d')](_0x2db467);}return _0x341295[_0xeea6('0x1e')](_0x2db467)[_0xeea6('0x1f')]();};}function respondWithResult(_0x4147bc,_0x1c91ea){_0x1c91ea=_0x1c91ea||0xc8;return function(_0x539bb4){if(_0x539bb4){return _0x4147bc[_0xeea6('0x1e')](_0x1c91ea)[_0xeea6('0x20')](_0x539bb4);}};}function respondWithFilteredResult(_0x27b487,_0x2fe582){return function(_0xf70735){if(_0xf70735){var _0x3efc2e=typeof _0x2fe582[_0xeea6('0x21')]===_0xeea6('0x22')&&typeof _0x2fe582[_0xeea6('0x23')]==='undefined';var _0x31515a=_0xf70735['count'];var _0x36e13f=_0x3efc2e?0x0:_0x2fe582[_0xeea6('0x21')];var _0xb57e87=_0x3efc2e?_0xf70735[_0xeea6('0x24')]:_0x2fe582[_0xeea6('0x21')]+_0x2fe582[_0xeea6('0x23')];var _0x155a4b;if(_0xb57e87>=_0x31515a){_0xb57e87=_0x31515a;_0x155a4b=0xc8;}else{_0x155a4b=0xce;}_0x27b487[_0xeea6('0x1e')](_0x155a4b);return _0x27b487[_0xeea6('0x25')]('Content-Range',_0x36e13f+'-'+_0xb57e87+'/'+_0x31515a)['json'](_0xf70735);}return null;};}function patchUpdates(_0x48c3d6){return function(_0xb4a1aa){try{jsonpatch[_0xeea6('0x26')](_0xb4a1aa,_0x48c3d6,!![]);}catch(_0x1a94a3){return BPromise[_0xeea6('0x27')](_0x1a94a3);}return _0xb4a1aa[_0xeea6('0x28')]();};}function saveUpdates(_0xbf4a10,_0x381f8e){return function(_0x408cd3){if(_0x408cd3){return _0x408cd3[_0xeea6('0x29')](_0xbf4a10)[_0xeea6('0x2a')](function(_0x3569e2){return _0x3569e2;});}return null;};}function removeEntity(_0x3e63d1,_0x2e5244){return function(_0x1f97bb){if(_0x1f97bb){return _0x1f97bb['destroy']()[_0xeea6('0x2a')](function(){_0x3e63d1[_0xeea6('0x1e')](0xcc)[_0xeea6('0x1f')]();});}};}function handleEntityNotFound(_0x1372fa,_0x1907e5){return function(_0x25cf23){if(!_0x25cf23){_0x1372fa[_0xeea6('0x1d')](0x194);}return _0x25cf23;};}function handleError(_0x47ae96,_0x1ccf7a){_0x1ccf7a=_0x1ccf7a||0x1f4;return function(_0xe95bcb){logger[_0xeea6('0x2b')](_0xe95bcb[_0xeea6('0x2c')]);if(_0xe95bcb['name']){delete _0xe95bcb[_0xeea6('0x2d')];}_0x47ae96['status'](_0x1ccf7a)[_0xeea6('0x2e')](_0xe95bcb);};}exports[_0xeea6('0x2f')]=function(_0x553c11,_0x54eb0b){var _0x4dfe08={},_0x5e7f55={},_0x1e838f={'count':0x0,'rows':[]};var _0x122da2=_['map'](db[_0xeea6('0x30')][_0xeea6('0x31')],function(_0x405727){return{'name':_0x405727[_0xeea6('0x32')],'type':_0x405727[_0xeea6('0x33')][_0xeea6('0x34')]};});_0x5e7f55[_0xeea6('0x35')]=_[_0xeea6('0x36')](_0x122da2,'name');_0x5e7f55[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x553c11[_0xeea6('0x37')]);_0x5e7f55[_0xeea6('0x39')]=_['intersection'](_0x5e7f55[_0xeea6('0x35')],_0x5e7f55[_0xeea6('0x37')]);_0x4dfe08[_0xeea6('0x3a')]=_[_0xeea6('0x3b')](_0x5e7f55[_0xeea6('0x35')],qs[_0xeea6('0x3c')](_0x553c11[_0xeea6('0x37')][_0xeea6('0x3c')]));_0x4dfe08[_0xeea6('0x3a')]=_0x4dfe08[_0xeea6('0x3a')][_0xeea6('0x3d')]?_0x4dfe08[_0xeea6('0x3a')]:_0x5e7f55[_0xeea6('0x35')];if(!_0x553c11['query']['hasOwnProperty'](_0xeea6('0x3e'))){_0x4dfe08[_0xeea6('0x23')]=qs[_0xeea6('0x23')](_0x553c11[_0xeea6('0x37')][_0xeea6('0x23')]);_0x4dfe08[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x553c11['query'][_0xeea6('0x21')]);}_0x4dfe08[_0xeea6('0x3f')]=qs['sort'](_0x553c11['query'][_0xeea6('0x40')]);_0x4dfe08[_0xeea6('0x41')]=qs[_0xeea6('0x39')](_[_0xeea6('0x42')](_0x553c11['query'],_0x5e7f55[_0xeea6('0x39')]),_0x122da2);if(_0x553c11['query']['filter']){_0x4dfe08[_0xeea6('0x41')]=_[_0xeea6('0x43')](_0x4dfe08[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x122da2,function(_0x39178e){if(_0x39178e[_0xeea6('0x33')]!==_0xeea6('0x44')){var _0x82e43b={};_0x82e43b[_0x39178e[_0xeea6('0x2d')]]={'$like':'%'+_0x553c11[_0xeea6('0x37')]['filter']+'%'};return _0x82e43b;}})});}_0x4dfe08=_[_0xeea6('0x43')]({},_0x4dfe08,_0x553c11[_0xeea6('0x45')]);var _0x315f0f={'where':_0x4dfe08[_0xeea6('0x41')]};return db[_0xeea6('0x30')][_0xeea6('0x24')](_0x315f0f)[_0xeea6('0x2a')](function(_0x2af8a7){_0x1e838f[_0xeea6('0x24')]=_0x2af8a7;if(_0x553c11[_0xeea6('0x37')][_0xeea6('0x46')]){_0x4dfe08[_0xeea6('0x47')]=[{'all':!![]}];}return db[_0xeea6('0x30')]['findAll'](_0x4dfe08);})['then'](function(_0x16f92f){_0x1e838f[_0xeea6('0x48')]=_0x16f92f;return _0x1e838f;})[_0xeea6('0x2a')](respondWithFilteredResult(_0x54eb0b,_0x4dfe08))[_0xeea6('0x49')](handleError(_0x54eb0b,null));};exports[_0xeea6('0x4a')]=function(_0x4d0207,_0x4c9bc0){var _0x1e10b4={'raw':!![],'where':{'id':_0x4d0207[_0xeea6('0x4b')]['id']}},_0x6bbc7a={};_0x6bbc7a['model']=_['keys'](db[_0xeea6('0x30')][_0xeea6('0x31')]);_0x6bbc7a['query']=_[_0xeea6('0x38')](_0x4d0207[_0xeea6('0x37')]);_0x6bbc7a['filters']=_[_0xeea6('0x3b')](_0x6bbc7a[_0xeea6('0x35')],_0x6bbc7a[_0xeea6('0x37')]);_0x1e10b4[_0xeea6('0x3a')]=_['intersection'](_0x6bbc7a[_0xeea6('0x35')],qs['fields'](_0x4d0207[_0xeea6('0x37')]['fields']));_0x1e10b4[_0xeea6('0x3a')]=_0x1e10b4['attributes'][_0xeea6('0x3d')]?_0x1e10b4[_0xeea6('0x3a')]:_0x6bbc7a[_0xeea6('0x35')];if(_0x4d0207['query'][_0xeea6('0x46')]){_0x1e10b4[_0xeea6('0x47')]=[{'all':!![]}];}_0x1e10b4=_[_0xeea6('0x43')]({},_0x1e10b4,_0x4d0207[_0xeea6('0x45')]);return db['ChatGroup'][_0xeea6('0x4c')](_0x1e10b4)[_0xeea6('0x2a')](handleEntityNotFound(_0x4c9bc0,null))['then'](respondWithResult(_0x4c9bc0,null))[_0xeea6('0x49')](handleError(_0x4c9bc0,null));};exports['create']=function(_0x647e19,_0x1d5166){return db[_0xeea6('0x30')]['create'](_0x647e19[_0xeea6('0x4d')],{})[_0xeea6('0x2a')](respondWithResult(_0x1d5166,0xc9))['catch'](handleError(_0x1d5166,null));};exports['update']=function(_0x36ddb2,_0x56d26a){if(_0x36ddb2['body']['id']){delete _0x36ddb2[_0xeea6('0x4d')]['id'];}return db[_0xeea6('0x30')][_0xeea6('0x4c')]({'where':{'id':_0x36ddb2[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x56d26a,null))[_0xeea6('0x2a')](saveUpdates(_0x36ddb2[_0xeea6('0x4d')],null))[_0xeea6('0x2a')](respondWithResult(_0x56d26a,null))['catch'](handleError(_0x56d26a,null));};exports[_0xeea6('0x4e')]=function(_0x12ffbf,_0x10cdbb){return db[_0xeea6('0x30')][_0xeea6('0x4c')]({'where':{'id':_0x12ffbf[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x10cdbb,null))[_0xeea6('0x2a')](removeEntity(_0x10cdbb,null))[_0xeea6('0x49')](handleError(_0x10cdbb,null));};exports[_0xeea6('0x4f')]=function(_0x182e90,_0x30ec33){return db['ChatGroup'][_0xeea6('0x4f')]()[_0xeea6('0x2a')](respondWithResult(_0x30ec33,null))[_0xeea6('0x49')](handleError(_0x30ec33,null));};exports[_0xeea6('0x50')]=function(_0x509336,_0x3a4183,_0x5cb6d1){return db[_0xeea6('0x51')]['count']({'where':{'ChatGroupId':_0x509336[_0xeea6('0x4b')]['id'],'ToId':_0x509336['user']['id'],'read':![]}})[_0xeea6('0x2a')](function(_0x5df920){return{'id':_[_0xeea6('0x52')](_0x509336[_0xeea6('0x4b')]['id']),'count':_0x5df920};})['then'](respondWithResult(_0x3a4183,null))[_0xeea6('0x49')](handleError(_0x3a4183,null));};exports[_0xeea6('0x53')]=function(_0x10e22e,_0x44f5b6,_0x2dc232){return db[_0xeea6('0x30')]['find']({'where':{'id':_0x10e22e[_0xeea6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44f5b6,null))[_0xeea6('0x2a')](function(_0x5c4931){if(_0x5c4931){return _0x5c4931[_0xeea6('0x53')](_0x10e22e[_0xeea6('0x4d')]['ids'],_[_0xeea6('0x54')](_0x10e22e[_0xeea6('0x4d')],[_0xeea6('0x55'),'id'])||{});}})[_0xeea6('0x2a')](respondWithResult(_0x44f5b6,null))[_0xeea6('0x49')](handleError(_0x44f5b6,null));};exports[_0xeea6('0x56')]=function(_0x131a26,_0x28dd5c,_0x21f913){var _0x2ccd70={};var _0x5a8db6={};var _0x39e3ad;var _0x41b69d;return db[_0xeea6('0x30')]['findOne']({'where':{'id':_0x131a26[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x28dd5c,null))[_0xeea6('0x2a')](function(_0x5ab8b1){if(_0x5ab8b1){_0x39e3ad=_0x5ab8b1;_0x5a8db6[_0xeea6('0x35')]=_[_0xeea6('0x38')](db[_0xeea6('0x57')][_0xeea6('0x31')]);_0x5a8db6[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x131a26[_0xeea6('0x37')]);_0x5a8db6[_0xeea6('0x39')]=_['intersection'](_0x5a8db6['model'],_0x5a8db6[_0xeea6('0x37')]);_0x2ccd70[_0xeea6('0x3a')]=_[_0xeea6('0x3b')](_0x5a8db6[_0xeea6('0x35')],qs[_0xeea6('0x3c')](_0x131a26[_0xeea6('0x37')][_0xeea6('0x3c')]));_0x2ccd70[_0xeea6('0x3a')]=_0x2ccd70['attributes'][_0xeea6('0x3d')]?_0x2ccd70[_0xeea6('0x3a')]:_0x5a8db6['model'];_0x2ccd70[_0xeea6('0x3f')]=qs['sort'](_0x131a26['query']['sort']);_0x2ccd70[_0xeea6('0x41')]=qs[_0xeea6('0x39')](_[_0xeea6('0x42')](_0x131a26[_0xeea6('0x37')],_0x5a8db6[_0xeea6('0x39')]));if(_0x131a26[_0xeea6('0x37')][_0xeea6('0x58')]){_0x2ccd70[_0xeea6('0x41')]=_[_0xeea6('0x43')](_0x2ccd70[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x2ccd70[_0xeea6('0x3a')],function(_0x66e675){var _0x38b899={};_0x38b899[_0x66e675]={'$like':'%'+_0x131a26[_0xeea6('0x37')][_0xeea6('0x58')]+'%'};return _0x38b899;})});}_0x2ccd70=_[_0xeea6('0x43')]({},_0x2ccd70,_0x131a26[_0xeea6('0x45')]);return _0x39e3ad['getMembers'](_0x2ccd70);}})[_0xeea6('0x2a')](function(_0x7e986e){if(_0x7e986e){_0x41b69d=_0x7e986e[_0xeea6('0x3d')];if(!_0x131a26[_0xeea6('0x37')][_0xeea6('0x59')](_0xeea6('0x3e'))){_0x2ccd70['limit']=qs[_0xeea6('0x23')](_0x131a26[_0xeea6('0x37')][_0xeea6('0x23')]);_0x2ccd70[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x131a26[_0xeea6('0x37')]['offset']);}return _0x39e3ad[_0xeea6('0x56')](_0x2ccd70);}})[_0xeea6('0x2a')](function(_0x271e31){if(_0x271e31){return _0x271e31?{'count':_0x41b69d,'rows':_0x271e31}:null;}})['then'](respondWithResult(_0x28dd5c,null))[_0xeea6('0x49')](handleError(_0x28dd5c,null));};exports[_0xeea6('0x5a')]=function(_0x37fcc3,_0x5ef5ae,_0x6591ad){return db[_0xeea6('0x30')]['find']({'where':{'id':_0x37fcc3[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x5ef5ae,null))[_0xeea6('0x2a')](function(_0x2f8692){if(_0x2f8692){return _0x2f8692[_0xeea6('0x5a')](_0x37fcc3[_0xeea6('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x5ef5ae,null))['catch'](handleError(_0x5ef5ae,null));};exports['addMessage']=function(_0x51c886,_0x3e13eb,_0xad27a2){if(_0x51c886['body']['id']){delete _0x51c886[_0xeea6('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x51c886[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x3e13eb,null))[_0xeea6('0x2a')](function(_0xea93eb){if(_0xea93eb){_0x51c886[_0xeea6('0x4d')]['ChatGroupId']=_0xea93eb['id'];return db[_0xeea6('0x51')][_0xeea6('0x5b')](_0x51c886['body']);}})[_0xeea6('0x2a')](respondWithResult(_0x3e13eb,null))['catch'](handleError(_0x3e13eb,null));};exports['getMessages']=function(_0x6f4c53,_0x18dd47,_0x1d8257){var _0x335190={};var _0x312bc2={};var _0xe5b6f3;var _0x1b052a;return db[_0xeea6('0x30')]['findOne']({'where':{'id':_0x6f4c53['params']['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x18dd47,null))[_0xeea6('0x2a')](function(_0x25bee3){if(_0x25bee3){_0xe5b6f3=_0x25bee3;_0x312bc2[_0xeea6('0x35')]=_[_0xeea6('0x38')](db['ChatInternalMessage'][_0xeea6('0x31')]);_0x312bc2[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x6f4c53[_0xeea6('0x37')]);_0x312bc2[_0xeea6('0x39')]=_['intersection'](_0x312bc2[_0xeea6('0x35')],_0x312bc2[_0xeea6('0x37')]);_0x335190['attributes']=_[_0xeea6('0x3b')](_0x312bc2['model'],qs[_0xeea6('0x3c')](_0x6f4c53[_0xeea6('0x37')]['fields']));_0x335190[_0xeea6('0x3a')]=_0x335190[_0xeea6('0x3a')][_0xeea6('0x3d')]?_0x335190[_0xeea6('0x3a')]:_0x312bc2[_0xeea6('0x35')];_0x335190[_0xeea6('0x3f')]=qs['sort'](_0x6f4c53[_0xeea6('0x37')]['sort']);_0x335190['where']=qs['filters'](_[_0xeea6('0x42')](_0x6f4c53[_0xeea6('0x37')],_0x312bc2['filters']));if(_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x58')]){_0x335190['where']=_['merge'](_0x335190[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x335190[_0xeea6('0x3a')],function(_0x6644a1){var _0x10b94a={};_0x10b94a[_0x6644a1]={'$like':'%'+_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x58')]+'%'};return _0x10b94a;})});}if(_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x5c')]){var _0x34153e=_0x6f4c53[_0xeea6('0x37')]['$gte'][_0xeea6('0x5d')](',');var _0x22510d={};_0x22510d[_0x34153e[0x0]]={'$gte':moment(_0x34153e[0x1])['format'](_0xeea6('0x5e'))};_0x335190[_0xeea6('0x41')]=_['merge'](_0x335190[_0xeea6('0x41')],_0x22510d);}_0x335190=_[_0xeea6('0x43')]({},_0x335190,_0x6f4c53[_0xeea6('0x45')]);return _0xe5b6f3['getMessages'](_0x335190);}})[_0xeea6('0x2a')](function(_0x4840fe){if(_0x4840fe){_0x1b052a=_0x4840fe['length'];if(!_0x6f4c53[_0xeea6('0x37')]['hasOwnProperty']('nolimit')){_0x335190['limit']=qs[_0xeea6('0x23')](_0x6f4c53[_0xeea6('0x37')]['limit']);_0x335190[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x6f4c53['query'][_0xeea6('0x21')]);}return _0xe5b6f3[_0xeea6('0x5f')](_0x335190);}})[_0xeea6('0x2a')](function(_0x2fffc8){if(_0x2fffc8){return _0x2fffc8?{'count':_0x1b052a,'rows':_0x2fffc8}:null;}})['then'](respondWithResult(_0x18dd47,null))['catch'](handleError(_0x18dd47,null));}; \ No newline at end of file +var _0x8cd9=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','ChatGroup','rawAttributes','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','include','rows','params','intersection','includeAll','options','body','catch','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','create','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','hasOwnProperty','fast-json-patch','request-promise','bluebird','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','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x8cd9,0x1ac));var _0x98cd=function(_0x59fba1,_0x1d039d){_0x59fba1=_0x59fba1-0x0;var _0x3586c1=_0x8cd9[_0x59fba1];return _0x3586c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x98cd('0x0'));var rp=require(_0x98cd('0x1'));var moment=require('moment');var BPromise=require(_0x98cd('0x2'));var Mustache=require('mustache');var util=require(_0x98cd('0x3'));var path=require(_0x98cd('0x4'));var sox=require('sox');var csv=require(_0x98cd('0x5'));var ejs=require(_0x98cd('0x6'));var fs=require('fs');var fs_extra=require(_0x98cd('0x7'));var _=require(_0x98cd('0x8'));var squel=require(_0x98cd('0x9'));var crypto=require(_0x98cd('0xa'));var jsforce=require(_0x98cd('0xb'));var deskjs=require(_0x98cd('0xc'));var toCsv=require(_0x98cd('0x5'));var querystring=require(_0x98cd('0xd'));var Papa=require(_0x98cd('0xe'));var Redis=require(_0x98cd('0xf'));var authService=require(_0x98cd('0x10'));var qs=require(_0x98cd('0x11'));var as=require(_0x98cd('0x12'));var hardwareService=require(_0x98cd('0x13'));var logger=require(_0x98cd('0x14'))('api');var utils=require(_0x98cd('0x15'));var config=require(_0x98cd('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x98cd('0x17')]=_['defaults'](config['redis'],{'host':_0x98cd('0x18'),'port':0x18eb});var socket=require(_0x98cd('0x19'))(new Redis(config[_0x98cd('0x17')]));require(_0x98cd('0x1a'))['register'](socket);function respondWithStatusCode(_0x468db9,_0x44b70e){_0x44b70e=_0x44b70e||0xcc;return function(_0x235fd7){if(_0x235fd7){return _0x468db9[_0x98cd('0x1b')](_0x44b70e);}return _0x468db9[_0x98cd('0x1c')](_0x44b70e)[_0x98cd('0x1d')]();};}function respondWithResult(_0x4b7b1e,_0x34a758){_0x34a758=_0x34a758||0xc8;return function(_0x44a1e7){if(_0x44a1e7){return _0x4b7b1e[_0x98cd('0x1c')](_0x34a758)[_0x98cd('0x1e')](_0x44a1e7);}};}function respondWithFilteredResult(_0x4fcc7e,_0x2d7eb1){return function(_0x21715c){if(_0x21715c){var _0x4fe7eb=typeof _0x2d7eb1[_0x98cd('0x1f')]===_0x98cd('0x20')&&typeof _0x2d7eb1['limit']===_0x98cd('0x20');var _0x58f7af=_0x21715c[_0x98cd('0x21')];var _0x2f5c81=_0x4fe7eb?0x0:_0x2d7eb1[_0x98cd('0x1f')];var _0x399c14=_0x4fe7eb?_0x21715c['count']:_0x2d7eb1[_0x98cd('0x1f')]+_0x2d7eb1['limit'];var _0x2c65b4;if(_0x399c14>=_0x58f7af){_0x399c14=_0x58f7af;_0x2c65b4=0xc8;}else{_0x2c65b4=0xce;}_0x4fcc7e[_0x98cd('0x1c')](_0x2c65b4);return _0x4fcc7e[_0x98cd('0x22')](_0x98cd('0x23'),_0x2f5c81+'-'+_0x399c14+'/'+_0x58f7af)[_0x98cd('0x1e')](_0x21715c);}return null;};}function patchUpdates(_0x19df6c){return function(_0x3441a4){try{jsonpatch[_0x98cd('0x24')](_0x3441a4,_0x19df6c,!![]);}catch(_0x51b9be){return BPromise['reject'](_0x51b9be);}return _0x3441a4[_0x98cd('0x25')]();};}function saveUpdates(_0x17da82,_0x181c61){return function(_0x2d0f29){if(_0x2d0f29){return _0x2d0f29[_0x98cd('0x26')](_0x17da82)[_0x98cd('0x27')](function(_0x447f2b){return _0x447f2b;});}return null;};}function removeEntity(_0x70fc4b,_0x3588d9){return function(_0x3335ea){if(_0x3335ea){return _0x3335ea[_0x98cd('0x28')]()[_0x98cd('0x27')](function(){_0x70fc4b[_0x98cd('0x1c')](0xcc)[_0x98cd('0x1d')]();});}};}function handleEntityNotFound(_0x20bd7d,_0x1d6a22){return function(_0x49e0dc){if(!_0x49e0dc){_0x20bd7d[_0x98cd('0x1b')](0x194);}return _0x49e0dc;};}function handleError(_0x2d7f4,_0x538210){_0x538210=_0x538210||0x1f4;return function(_0x107d85){logger[_0x98cd('0x29')](_0x107d85['stack']);if(_0x107d85[_0x98cd('0x2a')]){delete _0x107d85[_0x98cd('0x2a')];}_0x2d7f4['status'](_0x538210)['send'](_0x107d85);};}exports[_0x98cd('0x2b')]=function(_0x315409,_0x5f5dcc){var _0x1126c5={},_0xd6068d={},_0x6183c4={'count':0x0,'rows':[]};var _0x4a7f20=_['map'](db[_0x98cd('0x2c')][_0x98cd('0x2d')],function(_0x4937ae){return{'name':_0x4937ae['fieldName'],'type':_0x4937ae['type']['key']};});_0xd6068d[_0x98cd('0x2e')]=_['map'](_0x4a7f20,_0x98cd('0x2a'));_0xd6068d[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x315409[_0x98cd('0x2f')]);_0xd6068d[_0x98cd('0x31')]=_['intersection'](_0xd6068d[_0x98cd('0x2e')],_0xd6068d[_0x98cd('0x2f')]);_0x1126c5[_0x98cd('0x32')]=_['intersection'](_0xd6068d[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x1126c5[_0x98cd('0x32')]=_0x1126c5[_0x98cd('0x32')][_0x98cd('0x34')]?_0x1126c5['attributes']:_0xd6068d[_0x98cd('0x2e')];if(!_0x315409['query']['hasOwnProperty'](_0x98cd('0x35'))){_0x1126c5['limit']=qs['limit'](_0x315409[_0x98cd('0x2f')][_0x98cd('0x36')]);_0x1126c5[_0x98cd('0x1f')]=qs[_0x98cd('0x1f')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x1f')]);}_0x1126c5[_0x98cd('0x37')]=qs[_0x98cd('0x38')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x38')]);_0x1126c5[_0x98cd('0x39')]=qs[_0x98cd('0x31')](_[_0x98cd('0x3a')](_0x315409[_0x98cd('0x2f')],_0xd6068d[_0x98cd('0x31')]),_0x4a7f20);if(_0x315409['query'][_0x98cd('0x3b')]){_0x1126c5['where']=_[_0x98cd('0x3c')](_0x1126c5[_0x98cd('0x39')],{'$or':_[_0x98cd('0x3d')](_0x4a7f20,function(_0x17877d){if(_0x17877d[_0x98cd('0x3e')]!=='VIRTUAL'){var _0x53c68c={};_0x53c68c[_0x17877d['name']]={'$like':'%'+_0x315409['query']['filter']+'%'};return _0x53c68c;}})});}_0x1126c5=_[_0x98cd('0x3c')]({},_0x1126c5,_0x315409['options']);var _0x22d6fe={'where':_0x1126c5[_0x98cd('0x39')]};return db[_0x98cd('0x2c')]['count'](_0x22d6fe)[_0x98cd('0x27')](function(_0x27151e){_0x6183c4[_0x98cd('0x21')]=_0x27151e;if(_0x315409['query']['includeAll']){_0x1126c5[_0x98cd('0x3f')]=[{'all':!![]}];}return db[_0x98cd('0x2c')]['findAll'](_0x1126c5);})['then'](function(_0x209b20){_0x6183c4[_0x98cd('0x40')]=_0x209b20;return _0x6183c4;})['then'](respondWithFilteredResult(_0x5f5dcc,_0x1126c5))['catch'](handleError(_0x5f5dcc,null));};exports['show']=function(_0x146dd7,_0x1f834f){var _0x338428={'raw':!![],'where':{'id':_0x146dd7[_0x98cd('0x41')]['id']}},_0x1f34a2={};_0x1f34a2[_0x98cd('0x2e')]=_[_0x98cd('0x30')](db['ChatGroup'][_0x98cd('0x2d')]);_0x1f34a2[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x146dd7[_0x98cd('0x2f')]);_0x1f34a2[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x1f34a2[_0x98cd('0x2e')],_0x1f34a2[_0x98cd('0x2f')]);_0x338428['attributes']=_[_0x98cd('0x42')](_0x1f34a2[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0x146dd7[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x338428[_0x98cd('0x32')]=_0x338428['attributes'][_0x98cd('0x34')]?_0x338428['attributes']:_0x1f34a2[_0x98cd('0x2e')];if(_0x146dd7[_0x98cd('0x2f')][_0x98cd('0x43')]){_0x338428[_0x98cd('0x3f')]=[{'all':!![]}];}_0x338428=_[_0x98cd('0x3c')]({},_0x338428,_0x146dd7[_0x98cd('0x44')]);return db[_0x98cd('0x2c')]['find'](_0x338428)[_0x98cd('0x27')](handleEntityNotFound(_0x1f834f,null))[_0x98cd('0x27')](respondWithResult(_0x1f834f,null))['catch'](handleError(_0x1f834f,null));};exports['create']=function(_0x530376,_0x21f46a){return db[_0x98cd('0x2c')]['create'](_0x530376[_0x98cd('0x45')],{})[_0x98cd('0x27')](respondWithResult(_0x21f46a,0xc9))[_0x98cd('0x46')](handleError(_0x21f46a,null));};exports['update']=function(_0x42ca9a,_0x30a968){if(_0x42ca9a['body']['id']){delete _0x42ca9a[_0x98cd('0x45')]['id'];}return db['ChatGroup'][_0x98cd('0x47')]({'where':{'id':_0x42ca9a[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x30a968,null))[_0x98cd('0x27')](saveUpdates(_0x42ca9a['body'],null))[_0x98cd('0x27')](respondWithResult(_0x30a968,null))[_0x98cd('0x46')](handleError(_0x30a968,null));};exports[_0x98cd('0x28')]=function(_0x233be1,_0x11adf2){return db['ChatGroup'][_0x98cd('0x47')]({'where':{'id':_0x233be1[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x11adf2,null))[_0x98cd('0x27')](removeEntity(_0x11adf2,null))[_0x98cd('0x46')](handleError(_0x11adf2,null));};exports[_0x98cd('0x48')]=function(_0x48f9c4,_0xeef0ac){return db['ChatGroup'][_0x98cd('0x48')]()[_0x98cd('0x27')](respondWithResult(_0xeef0ac,null))['catch'](handleError(_0xeef0ac,null));};exports[_0x98cd('0x49')]=function(_0x3160c3,_0x2d3115,_0x82eaf7){return db[_0x98cd('0x4a')][_0x98cd('0x21')]({'where':{'ChatGroupId':_0x3160c3[_0x98cd('0x41')]['id'],'ToId':_0x3160c3['user']['id'],'read':![]}})['then'](function(_0x1466e5){return{'id':_[_0x98cd('0x4b')](_0x3160c3[_0x98cd('0x41')]['id']),'count':_0x1466e5};})[_0x98cd('0x27')](respondWithResult(_0x2d3115,null))[_0x98cd('0x46')](handleError(_0x2d3115,null));};exports[_0x98cd('0x4c')]=function(_0x2d83c4,_0x5b99a6,_0x493ccf){return db[_0x98cd('0x2c')][_0x98cd('0x47')]({'where':{'id':_0x2d83c4[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x5b99a6,null))[_0x98cd('0x27')](function(_0x5ebc8a){if(_0x5ebc8a){return _0x5ebc8a[_0x98cd('0x4c')](_0x2d83c4[_0x98cd('0x45')][_0x98cd('0x4d')],_['omit'](_0x2d83c4['body'],['ids','id'])||{});}})[_0x98cd('0x27')](respondWithResult(_0x5b99a6,null))[_0x98cd('0x46')](handleError(_0x5b99a6,null));};exports[_0x98cd('0x4e')]=function(_0xacd4eb,_0x1cf35b,_0x2201df){var _0x22952e={};var _0x3ea973={};var _0x432153;var _0x11bf53;return db[_0x98cd('0x2c')][_0x98cd('0x4f')]({'where':{'id':_0xacd4eb['params']['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x1cf35b,null))[_0x98cd('0x27')](function(_0x314cac){if(_0x314cac){_0x432153=_0x314cac;_0x3ea973[_0x98cd('0x2e')]=_[_0x98cd('0x30')](db[_0x98cd('0x50')][_0x98cd('0x2d')]);_0x3ea973[_0x98cd('0x2f')]=_['keys'](_0xacd4eb[_0x98cd('0x2f')]);_0x3ea973[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x3ea973[_0x98cd('0x2e')],_0x3ea973[_0x98cd('0x2f')]);_0x22952e[_0x98cd('0x32')]=_['intersection'](_0x3ea973[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0xacd4eb[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x22952e[_0x98cd('0x32')]=_0x22952e[_0x98cd('0x32')][_0x98cd('0x34')]?_0x22952e[_0x98cd('0x32')]:_0x3ea973[_0x98cd('0x2e')];_0x22952e[_0x98cd('0x37')]=qs['sort'](_0xacd4eb['query'][_0x98cd('0x38')]);_0x22952e[_0x98cd('0x39')]=qs[_0x98cd('0x31')](_[_0x98cd('0x3a')](_0xacd4eb[_0x98cd('0x2f')],_0x3ea973[_0x98cd('0x31')]));if(_0xacd4eb['query'][_0x98cd('0x3b')]){_0x22952e['where']=_[_0x98cd('0x3c')](_0x22952e[_0x98cd('0x39')],{'$or':_[_0x98cd('0x3d')](_0x22952e[_0x98cd('0x32')],function(_0x4240ef){var _0x651bc6={};_0x651bc6[_0x4240ef]={'$like':'%'+_0xacd4eb['query']['filter']+'%'};return _0x651bc6;})});}_0x22952e=_[_0x98cd('0x3c')]({},_0x22952e,_0xacd4eb[_0x98cd('0x44')]);return _0x432153[_0x98cd('0x4e')](_0x22952e);}})[_0x98cd('0x27')](function(_0xa2afa1){if(_0xa2afa1){_0x11bf53=_0xa2afa1[_0x98cd('0x34')];if(!_0xacd4eb[_0x98cd('0x2f')]['hasOwnProperty'](_0x98cd('0x35'))){_0x22952e[_0x98cd('0x36')]=qs[_0x98cd('0x36')](_0xacd4eb['query'][_0x98cd('0x36')]);_0x22952e['offset']=qs[_0x98cd('0x1f')](_0xacd4eb['query'][_0x98cd('0x1f')]);}return _0x432153['getMembers'](_0x22952e);}})['then'](function(_0x3bd5c1){if(_0x3bd5c1){return _0x3bd5c1?{'count':_0x11bf53,'rows':_0x3bd5c1}:null;}})[_0x98cd('0x27')](respondWithResult(_0x1cf35b,null))[_0x98cd('0x46')](handleError(_0x1cf35b,null));};exports[_0x98cd('0x51')]=function(_0x3e112d,_0x536792,_0x4faba5){return db[_0x98cd('0x2c')]['find']({'where':{'id':_0x3e112d[_0x98cd('0x41')]['id']}})['then'](handleEntityNotFound(_0x536792,null))[_0x98cd('0x27')](function(_0x321e84){if(_0x321e84){return _0x321e84['removeMembers'](_0x3e112d[_0x98cd('0x2f')]['ids']);}})['then'](respondWithStatusCode(_0x536792,null))[_0x98cd('0x46')](handleError(_0x536792,null));};exports[_0x98cd('0x52')]=function(_0xfbd3c5,_0x33dad8,_0x5914e0){if(_0xfbd3c5[_0x98cd('0x45')]['id']){delete _0xfbd3c5[_0x98cd('0x45')]['id'];}return db[_0x98cd('0x2c')][_0x98cd('0x47')]({'where':{'id':_0xfbd3c5[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x33dad8,null))[_0x98cd('0x27')](function(_0x2c36bb){if(_0x2c36bb){_0xfbd3c5[_0x98cd('0x45')][_0x98cd('0x53')]=_0x2c36bb['id'];return db[_0x98cd('0x4a')][_0x98cd('0x54')](_0xfbd3c5[_0x98cd('0x45')]);}})['then'](respondWithResult(_0x33dad8,null))[_0x98cd('0x46')](handleError(_0x33dad8,null));};exports['getMessages']=function(_0x25f461,_0x5b8361,_0x53cd6c){var _0x24fc34={};var _0x3faad1={};var _0x24546c;var _0xeee438;return db[_0x98cd('0x2c')][_0x98cd('0x4f')]({'where':{'id':_0x25f461['params']['id']}})['then'](handleEntityNotFound(_0x5b8361,null))[_0x98cd('0x27')](function(_0x598173){if(_0x598173){_0x24546c=_0x598173;_0x3faad1['model']=_[_0x98cd('0x30')](db[_0x98cd('0x4a')][_0x98cd('0x2d')]);_0x3faad1[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x25f461[_0x98cd('0x2f')]);_0x3faad1[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x3faad1[_0x98cd('0x2e')],_0x3faad1[_0x98cd('0x2f')]);_0x24fc34[_0x98cd('0x32')]=_[_0x98cd('0x42')](_0x3faad1['model'],qs[_0x98cd('0x33')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x24fc34[_0x98cd('0x32')]=_0x24fc34[_0x98cd('0x32')][_0x98cd('0x34')]?_0x24fc34[_0x98cd('0x32')]:_0x3faad1[_0x98cd('0x2e')];_0x24fc34[_0x98cd('0x37')]=qs[_0x98cd('0x38')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x38')]);_0x24fc34[_0x98cd('0x39')]=qs['filters'](_['pick'](_0x25f461[_0x98cd('0x2f')],_0x3faad1[_0x98cd('0x31')]));if(_0x25f461['query'][_0x98cd('0x3b')]){_0x24fc34[_0x98cd('0x39')]=_[_0x98cd('0x3c')](_0x24fc34['where'],{'$or':_['map'](_0x24fc34[_0x98cd('0x32')],function(_0x474c05){var _0x17b8d1={};_0x17b8d1[_0x474c05]={'$like':'%'+_0x25f461['query'][_0x98cd('0x3b')]+'%'};return _0x17b8d1;})});}if(_0x25f461['query'][_0x98cd('0x55')]){var _0x3a4cd2=_0x25f461[_0x98cd('0x2f')][_0x98cd('0x55')][_0x98cd('0x56')](',');var _0x114eec={};_0x114eec[_0x3a4cd2[0x0]]={'$gte':moment(_0x3a4cd2[0x1])[_0x98cd('0x57')](_0x98cd('0x58'))};_0x24fc34[_0x98cd('0x39')]=_['merge'](_0x24fc34[_0x98cd('0x39')],_0x114eec);}_0x24fc34=_[_0x98cd('0x3c')]({},_0x24fc34,_0x25f461['options']);return _0x24546c[_0x98cd('0x59')](_0x24fc34);}})[_0x98cd('0x27')](function(_0xf15a9f){if(_0xf15a9f){_0xeee438=_0xf15a9f['length'];if(!_0x25f461[_0x98cd('0x2f')][_0x98cd('0x5a')](_0x98cd('0x35'))){_0x24fc34[_0x98cd('0x36')]=qs[_0x98cd('0x36')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x36')]);_0x24fc34[_0x98cd('0x1f')]=qs[_0x98cd('0x1f')](_0x25f461['query'][_0x98cd('0x1f')]);}return _0x24546c[_0x98cd('0x59')](_0x24fc34);}})['then'](function(_0x2e1fb4){if(_0x2e1fb4){return _0x2e1fb4?{'count':_0xeee438,'rows':_0x2e1fb4}:null;}})[_0x98cd('0x27')](respondWithResult(_0x5b8361,null))[_0x98cd('0x46')](handleError(_0x5b8361,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d7d8286..6ef7049 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 _0x225b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x225b,0xb1));var _0xb225=function(_0x24e48c,_0x23242d){_0x24e48c=_0x24e48c-0x0;var _0x525a4b=_0x225b[_0x24e48c];return _0x525a4b;};'use strict';var EventEmitter=require(_0xb225('0x0'));var ChatGroup=require(_0xb225('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb225('0x2')](0x0);var events={'afterCreate':_0xb225('0x3'),'afterUpdate':'update','afterDestroy':_0xb225('0x4')};function emitEvent(_0x5aa828){return function(_0x38f4aa,_0x5d0e82,_0x144e6c){ChatGroupEvents[_0xb225('0x5')](_0x5aa828+':'+_0x38f4aa['id'],_0x38f4aa);ChatGroupEvents[_0xb225('0x5')](_0x5aa828,_0x38f4aa);_0x144e6c(null);};}for(var e in events){if(events[_0xb225('0x6')](e)){var event=events[e];ChatGroup[_0xb225('0x7')](e,emitEvent(event));}}module[_0xb225('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xcec8=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xcec8,0x10c));var _0x8cec=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xcec8[_0x74745d];return _0x174ab3;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8cec('0x0'))['db'][_0x8cec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8cec('0x2')](0x0);var events={'afterCreate':_0x8cec('0x3'),'afterUpdate':'update','afterDestroy':_0x8cec('0x4')};function emitEvent(_0x5cce98){return function(_0x3063a5,_0x18dcea,_0x28abdd){ChatGroupEvents['emit'](_0x5cce98+':'+_0x3063a5['id'],_0x3063a5);ChatGroupEvents[_0x8cec('0x5')](_0x5cce98,_0x3063a5);_0x28abdd(null);};}for(var e in events){if(events[_0x8cec('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8cec('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 035a4da..97731aa 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 _0x0d41=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xcc18a5,_0x4dbb0a){var _0x314c9b=function(_0x4b9582){while(--_0x4b9582){_0xcc18a5['push'](_0xcc18a5['shift']());}};_0x314c9b(++_0x4dbb0a);}(_0x0d41,0x1f4));var _0x10d4=function(_0x33f50f,_0x42cc1e){_0x33f50f=_0x33f50f-0x0;var _0x3f23d9=_0x0d41[_0x33f50f];return _0x3f23d9;};'use strict';var _=require('lodash');var util=require(_0x10d4('0x0'));var logger=require(_0x10d4('0x1'))('api');var moment=require(_0x10d4('0x2'));var BPromise=require(_0x10d4('0x3'));var rp=require(_0x10d4('0x4'));var fs=require('fs');var path=require(_0x10d4('0x5'));var rimraf=require(_0x10d4('0x6'));var config=require(_0x10d4('0x7'));var attributes=require(_0x10d4('0x8'));module[_0x10d4('0x9')]=function(_0x348ee8,_0x41d81c){return _0x348ee8[_0x10d4('0xa')](_0x10d4('0xb'),attributes,{'tableName':_0x10d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5e1=['request-promise','path','exports','define','chat_groups','moment','bluebird'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb5e1,0x12b));var _0x1b5e=function(_0x4242d1,_0x924773){_0x4242d1=_0x4242d1-0x0;var _0x1086e4=_0xb5e1[_0x4242d1];return _0x1086e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1b5e('0x0'));var BPromise=require(_0x1b5e('0x1'));var rp=require(_0x1b5e('0x2'));var fs=require('fs');var path=require(_0x1b5e('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x1b5e('0x4')]=function(_0x84b825,_0x36a47b){return _0x84b825[_0x1b5e('0x5')]('ChatGroup',attributes,{'tableName':_0x1b5e('0x6'),'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 253a629..ceec3a8 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 _0xc4a1=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','request\x20sent'];(function(_0x21f483,_0x404ec9){var _0x592dba=function(_0xb86757){while(--_0xb86757){_0x21f483['push'](_0x21f483['shift']());}};_0x592dba(++_0x404ec9);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x48008f,_0x1be1e4){_0x48008f=_0x48008f-0x0;var _0x50bf09=_0xc4a1[_0x48008f];return _0x50bf09;};'use strict';var _=require(_0x1c4a('0x0'));var util=require('util');var moment=require(_0x1c4a('0x1'));var BPromise=require(_0x1c4a('0x2'));var rs=require(_0x1c4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c4a('0x4'))['db'];var utils=require(_0x1c4a('0x5'));var logger=require(_0x1c4a('0x6'))(_0x1c4a('0x7'));var config=require(_0x1c4a('0x8'));var jayson=require(_0x1c4a('0x9'));var client=jayson[_0x1c4a('0xa')][_0x1c4a('0xb')]({'port':0x232a});config[_0x1c4a('0xc')]=_[_0x1c4a('0xd')](config[_0x1c4a('0xc')],{'host':_0x1c4a('0xe'),'port':0x18eb});var socket=require(_0x1c4a('0xf'))(new Redis(config['redis']));require(_0x1c4a('0x10'))[_0x1c4a('0x11')](socket);function respondWithRpcPromise(_0x48c4bb,_0x59599c,_0x5702b2){return new BPromise(function(_0x570b00,_0x25f7eb){return client[_0x1c4a('0x12')](_0x48c4bb,_0x5702b2)['then'](function(_0x3b6ec5){logger[_0x1c4a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x59599c,'request\x20sent');logger[_0x1c4a('0x14')](_0x1c4a('0x15'),_0x59599c,'request\x20sent',JSON['stringify'](_0x3b6ec5));if(_0x3b6ec5[_0x1c4a('0x16')]){if(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x17')]===0x1f4){logger[_0x1c4a('0x16')](_0x1c4a('0x18'),_0x59599c,_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);return _0x25f7eb(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);}logger[_0x1c4a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x59599c,_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);return _0x570b00(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x59599c,_0x1c4a('0x1a'));_0x570b00(_0x3b6ec5[_0x1c4a('0x1b')][_0x1c4a('0x19')]);}})[_0x1c4a('0x1c')](function(_0x4a5055){logger[_0x1c4a('0x16')](_0x1c4a('0x18'),_0x59599c,_0x4a5055);_0x25f7eb(_0x4a5055);});});} \ No newline at end of file +var _0xf2ca=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf2ca[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./chatGroup.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('ChatGroup,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1b30390..e05c04a 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 _0x4205=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x423c53,_0x20608b){var _0xf74506=function(_0x489dc5){while(--_0x489dc5){_0x423c53['push'](_0x423c53['shift']());}};_0xf74506(++_0x20608b);}(_0x4205,0x1a5));var _0x5420=function(_0x5b524f,_0x28555b){_0x5b524f=_0x5b524f-0x0;var _0x4ae43d=_0x4205[_0x5b524f];return _0x4ae43d;};'use strict';var ChatGroupEvents=require(_0x5420('0x0'));var events=[_0x5420('0x1'),_0x5420('0x2'),_0x5420('0x3')];function createListener(_0x2c21d7,_0x46dc93){return function(_0x5a311b){_0x46dc93[_0x5420('0x4')](_0x2c21d7,_0x5a311b);};}function removeListener(_0x36715d,_0x5d4d09){return function(){ChatGroupEvents[_0x5420('0x5')](_0x36715d,_0x5d4d09);};}exports[_0x5420('0x6')]=function(_0xedcb93){for(var _0x7f261=0x0,_0x1907ad=events[_0x5420('0x7')];_0x7f261<_0x1907ad;_0x7f261++){var _0x303a16=events[_0x7f261];var _0x1333d1=createListener(_0x5420('0x8')+_0x303a16,_0xedcb93);ChatGroupEvents['on'](_0x303a16,_0x1333d1);}}; \ No newline at end of file +var _0xf76e=['removeListener','register','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x21c31e,_0xc15d0e){var _0x2a756a=function(_0x2fbe23){while(--_0x2fbe23){_0x21c31e['push'](_0x21c31e['shift']());}};_0x2a756a(++_0xc15d0e);}(_0xf76e,0xff));var _0xef76=function(_0x950d19,_0x5459a6){_0x950d19=_0x950d19-0x0;var _0x4ef20c=_0xf76e[_0x950d19];return _0x4ef20c;};'use strict';var ChatGroupEvents=require(_0xef76('0x0'));var events=['save',_0xef76('0x1'),_0xef76('0x2')];function createListener(_0x5976e0,_0xca16f0){return function(_0x3c3b49){_0xca16f0[_0xef76('0x3')](_0x5976e0,_0x3c3b49);};}function removeListener(_0x4a345e,_0x3022c1){return function(){ChatGroupEvents[_0xef76('0x4')](_0x4a345e,_0x3022c1);};}exports[_0xef76('0x5')]=function(_0x495759){for(var _0xc969a0=0x0,_0x5c79f8=events['length'];_0xc969a0<_0x5c79f8;_0xc969a0++){var _0x4c2766=events[_0xc969a0];var _0x145908=createListener(_0xef76('0x6')+_0x4c2766,_0x495759);ChatGroupEvents['on'](_0x4c2766,_0x145908);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0062157..6a6b467 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 _0x1708=['/:id/messages','getMessages','post','addMembers','addMessage','delete','destroy','removeMembers','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','/:id/members','getMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1708,0x1a9));var _0x8170=function(_0x3b3de1,_0x4c0436){_0x3b3de1=_0x3b3de1-0x0;var _0x16e843=_0x1708[_0x3b3de1];return _0x16e843;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8170('0x0'));var express=require(_0x8170('0x1'));var router=express[_0x8170('0x2')]();var fs_extra=require(_0x8170('0x3'));var auth=require(_0x8170('0x4'));var interaction=require(_0x8170('0x5'));var config=require(_0x8170('0x6'));var controller=require(_0x8170('0x7'));router[_0x8170('0x8')]('/',auth[_0x8170('0x9')](),controller[_0x8170('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x8170('0xb')]);router[_0x8170('0x8')](_0x8170('0xc'),auth[_0x8170('0x9')](),controller[_0x8170('0xd')]);router['get'](_0x8170('0xe'),auth[_0x8170('0x9')](),controller['getUnread']);router[_0x8170('0x8')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x10')]);router[_0x8170('0x8')](_0x8170('0x11'),auth[_0x8170('0x9')](),controller[_0x8170('0x12')]);router[_0x8170('0x13')]('/',auth[_0x8170('0x9')](),controller['create']);router[_0x8170('0x13')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x14')]);router[_0x8170('0x13')](_0x8170('0x11'),auth[_0x8170('0x9')](),controller[_0x8170('0x15')]);router['put'](_0x8170('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8170('0x16')](_0x8170('0xc'),auth['isAuthenticated'](),controller[_0x8170('0x17')]);router[_0x8170('0x16')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x18')]);module[_0x8170('0x19')]=router; \ No newline at end of file +var _0xb498=['/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x8fe40d,_0x7972a2){var _0x44a656=function(_0xdfd41c){while(--_0xdfd41c){_0x8fe40d['push'](_0x8fe40d['shift']());}};_0x44a656(++_0x7972a2);}(_0xb498,0x1f1));var _0x8b49=function(_0x12e8a6,_0x5e6f48){_0x12e8a6=_0x12e8a6-0x0;var _0x1d03b8=_0xb498[_0x12e8a6];return _0x1d03b8;};'use strict';var multer=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var path=require(_0x8b49('0x2'));var timeout=require(_0x8b49('0x3'));var express=require(_0x8b49('0x4'));var router=express[_0x8b49('0x5')]();var fs_extra=require(_0x8b49('0x6'));var auth=require(_0x8b49('0x7'));var interaction=require(_0x8b49('0x8'));var config=require(_0x8b49('0x9'));var controller=require(_0x8b49('0xa'));router[_0x8b49('0xb')]('/',auth[_0x8b49('0xc')](),controller['index']);router['get'](_0x8b49('0xd'),auth[_0x8b49('0xc')](),controller[_0x8b49('0xe')]);router[_0x8b49('0xb')](_0x8b49('0xf'),auth['isAuthenticated'](),controller[_0x8b49('0x10')]);router[_0x8b49('0xb')](_0x8b49('0x11'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x12')]);router[_0x8b49('0xb')](_0x8b49('0x13'),auth['isAuthenticated'](),controller[_0x8b49('0x14')]);router['get'](_0x8b49('0x15'),auth[_0x8b49('0xc')](),controller['getMessages']);router['post']('/',auth[_0x8b49('0xc')](),controller[_0x8b49('0x16')]);router[_0x8b49('0x17')](_0x8b49('0x13'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x18')]);router[_0x8b49('0x17')]('/:id/messages',auth[_0x8b49('0xc')](),controller['addMessage']);router['put'](_0x8b49('0xf'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x19')]);router[_0x8b49('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x8b49('0x1b')]);router[_0x8b49('0x1a')](_0x8b49('0x13'),auth['isAuthenticated'](),controller[_0x8b49('0x1c')]);module[_0x8b49('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ea32ebf..1c701a3 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 _0xe5b5=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x50bccc,_0x23702f){var _0x61bcfe=function(_0x1a0932){while(--_0x1a0932){_0x50bccc['push'](_0x50bccc['shift']());}};_0x61bcfe(++_0x23702f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xe5b5[_0x3eb713];return _0x1d7128;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'closed':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5e5b('0x3')]},'ratingType':{'type':Sequelize[_0x5e5b('0x4')](_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x5')},'ratingMessage':{'type':Sequelize[_0x5e5b('0x7')]},'pathTranscript':{'type':Sequelize[_0x5e5b('0x7')]},'mailTranscript':{'type':Sequelize[_0x5e5b('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5e5b('0x9')]},'disposition':{'type':Sequelize[_0x5e5b('0x8')]},'secondDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'thirdDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'note':{'type':Sequelize[_0x5e5b('0x8')]},'browserName':{'type':Sequelize[_0x5e5b('0x8')]},'browserVersion':{'type':Sequelize[_0x5e5b('0x8')]},'osName':{'type':Sequelize[_0x5e5b('0x8')]},'osVersion':{'type':Sequelize[_0x5e5b('0x8')]},'deviceModel':{'type':Sequelize[_0x5e5b('0x8')]},'deviceVendor':{'type':Sequelize[_0x5e5b('0x8')]},'deviceType':{'type':Sequelize[_0x5e5b('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5e5b('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x5e5b('0xa'))},'read1stAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x5e5b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x5e5b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc584=['TEXT','DATE','STRING','long','ENUM','out','exports','BOOLEAN','star'];(function(_0x4165cc,_0x1b4780){var _0x5e3a4c=function(_0x38b884){while(--_0x38b884){_0x4165cc['push'](_0x4165cc['shift']());}};_0x5e3a4c(++_0x1b4780);}(_0xc584,0xa8));var _0x4c58=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xc584[_0x56daff];return _0x132c82;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'closed':{'type':Sequelize[_0x4c58('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x4c58('0x2'),'thumb'),'defaultValue':_0x4c58('0x2')},'ratingMessage':{'type':Sequelize[_0x4c58('0x3')]},'pathTranscript':{'type':Sequelize[_0x4c58('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4c58('0x4')]},'disposition':{'type':Sequelize[_0x4c58('0x5')]},'secondDisposition':{'type':Sequelize[_0x4c58('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4c58('0x5')]},'note':{'type':Sequelize[_0x4c58('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4c58('0x5')]},'deviceModel':{'type':Sequelize[_0x4c58('0x5')]},'deviceVendor':{'type':Sequelize[_0x4c58('0x5')]},'deviceType':{'type':Sequelize[_0x4c58('0x5')]},'referer':{'type':Sequelize[_0x4c58('0x3')]},'customerIp':{'type':Sequelize[_0x4c58('0x5')]},'formData':{'type':Sequelize[_0x4c58('0x3')](_0x4c58('0x6'))},'read1stAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4c58('0x7')]('in',_0x4c58('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4c58('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c9c0a95..2972147 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 _0xa315=['answered','unmanaged','abandoned','total','closed','UserId','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','select','field','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','originalname','basename','file','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','pass','sendMail','Mail\x20Transcript','addMessage','ids','getMessages','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','omit','spread','color','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','Contact','lastName','secret','Account','get','mkdirSync','Chat','Owner','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','direction','out','firstName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','limit','count','offset','set','apply','save','update','destroy','name','send','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xa315,0xf6));var _0x5a31=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xa315[_0x20bc10];return _0x3bd5ce;};'use strict';var emlformat=require(_0x5a31('0x0'));var rimraf=require(_0x5a31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a31('0x2'));var rp=require(_0x5a31('0x3'));var moment=require(_0x5a31('0x4'));var BPromise=require(_0x5a31('0x5'));var Mustache=require(_0x5a31('0x6'));var util=require(_0x5a31('0x7'));var path=require('path');var sox=require(_0x5a31('0x8'));var csv=require(_0x5a31('0x9'));var ejs=require(_0x5a31('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a31('0xb'));var squel=require('squel');var crypto=require(_0x5a31('0xc'));var jsforce=require(_0x5a31('0xd'));var deskjs=require(_0x5a31('0xe'));var toCsv=require(_0x5a31('0x9'));var querystring=require(_0x5a31('0xf'));var Papa=require(_0x5a31('0x10'));var Redis=require(_0x5a31('0x11'));var authService=require(_0x5a31('0x12'));var qs=require(_0x5a31('0x13'));var as=require(_0x5a31('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a31('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5a31('0x16'));var db=require(_0x5a31('0x17'))['db'];config[_0x5a31('0x18')]=_[_0x5a31('0x19')](config['redis'],{'host':_0x5a31('0x1a'),'port':0x18eb});var socket=require(_0x5a31('0x1b'))(new Redis(config[_0x5a31('0x18')]));require(_0x5a31('0x1c'))[_0x5a31('0x1d')](socket);var jayson=require(_0x5a31('0x1e'));var client=jayson[_0x5a31('0x1f')][_0x5a31('0x20')]({'port':0x232b});var client9004=jayson[_0x5a31('0x1f')][_0x5a31('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x51e355,_0x475c30,_0xd586d,_0x4fd379){return new BPromise(function(_0x1e2d1f,_0x1f9ca6){var _0x366584=_0x4fd379||client;return _0x366584[_0x5a31('0x21')](_0x51e355,_0xd586d)[_0x5a31('0x22')](function(_0x89ac2b){logger[_0x5a31('0x23')](_0x5a31('0x24'),_0x475c30,_0x5a31('0x25'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x475c30,_0x5a31('0x25'),JSON[_0x5a31('0x26')](_0x89ac2b));if(_0x89ac2b[_0x5a31('0x27')]){if(_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x28')]===0x1f4){logger['error'](_0x5a31('0x24'),_0x475c30,_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);return _0x1f9ca6(_0x89ac2b['error'][_0x5a31('0x29')]);}logger[_0x5a31('0x27')](_0x5a31('0x24'),_0x475c30,_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);return _0x1e2d1f(_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);}else{logger[_0x5a31('0x23')](_0x5a31('0x24'),_0x475c30,_0x5a31('0x25'));_0x1e2d1f(_0x89ac2b[_0x5a31('0x2a')]['message']);}})['catch'](function(_0x9a42ac){logger[_0x5a31('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x475c30,_0x9a42ac);_0x1f9ca6(_0x9a42ac);});});}function respondWithStatusCode(_0x50c1cf,_0x12f3bc){_0x12f3bc=_0x12f3bc||0xcc;return function(_0x12b099){if(_0x12b099){return _0x50c1cf[_0x5a31('0x2b')](_0x12f3bc);}return _0x50c1cf[_0x5a31('0x2c')](_0x12f3bc)[_0x5a31('0x2d')]();};}function respondWithResult(_0x302ac3,_0x4a925a){_0x4a925a=_0x4a925a||0xc8;return function(_0x54ca2a){if(_0x54ca2a){return _0x302ac3['status'](_0x4a925a)[_0x5a31('0x2e')](_0x54ca2a);}};}function respondWithFilteredResult(_0x317497,_0x49de25){return function(_0xabc77b){if(_0xabc77b){var _0x5e2a3a=typeof _0x49de25['offset']==='undefined'&&typeof _0x49de25[_0x5a31('0x2f')]==='undefined';var _0x48b074=_0xabc77b['count'];var _0x304d67=_0x5e2a3a?0x0:_0x49de25['offset'];var _0x55610a=_0x5e2a3a?_0xabc77b[_0x5a31('0x30')]:_0x49de25[_0x5a31('0x31')]+_0x49de25[_0x5a31('0x2f')];var _0x48844f;if(_0x55610a>=_0x48b074){_0x55610a=_0x48b074;_0x48844f=0xc8;}else{_0x48844f=0xce;}_0x317497[_0x5a31('0x2c')](_0x48844f);return _0x317497[_0x5a31('0x32')]('Content-Range',_0x304d67+'-'+_0x55610a+'/'+_0x48b074)[_0x5a31('0x2e')](_0xabc77b);}return null;};}function patchUpdates(_0xf56128){return function(_0x2eb458){try{jsonpatch[_0x5a31('0x33')](_0x2eb458,_0xf56128,!![]);}catch(_0x400180){return BPromise['reject'](_0x400180);}return _0x2eb458[_0x5a31('0x34')]();};}function saveUpdates(_0x5d3296,_0x2d48cf){return function(_0x1c7b08){if(_0x1c7b08){return _0x1c7b08[_0x5a31('0x35')](_0x5d3296)['then'](function(_0x18d0a8){return _0x18d0a8;});}return null;};}function removeEntity(_0x147c23,_0x361279){return function(_0x158d72){if(_0x158d72){return _0x158d72[_0x5a31('0x36')]()['then'](function(){_0x147c23[_0x5a31('0x2c')](0xcc)[_0x5a31('0x2d')]();});}};}function handleEntityNotFound(_0x342e53,_0x119663){return function(_0x58cc1a){if(!_0x58cc1a){_0x342e53[_0x5a31('0x2b')](0x194);}return _0x58cc1a;};}function handleError(_0xc312ca,_0x28312e){_0x28312e=_0x28312e||0x1f4;return function(_0x5c5a4f){logger[_0x5a31('0x27')](_0x5c5a4f['stack']);if(_0x5c5a4f['name']){delete _0x5c5a4f[_0x5a31('0x37')];}_0xc312ca[_0x5a31('0x2c')](_0x28312e)[_0x5a31('0x38')](_0x5c5a4f);};}function getMustacheRender(_0x3e3b6f,_0x420e5f){return Mustache['render'](_0x3e3b6f,_[_0x5a31('0x39')](_0x420e5f['body'],{'contact':_0x420e5f[_0x5a31('0x3a')],'message':_0x420e5f[_0x5a31('0x29')],'agent':_0x420e5f[_0x5a31('0x3b')],'interaction':_0x420e5f[_0x5a31('0x3c')],'account':_0x420e5f[_0x5a31('0x3d')]}))||'';}function getInteractionUsers(_0x2fd36b,_0x5daa85){return new BPromise(function(_0x423771,_0xcdc6e0){try{if(_0x5daa85[_0x2fd36b['id']]){_0x2fd36b[_0x5a31('0x3e')]=_[_0x5a31('0x3f')](_0x5daa85[_0x2fd36b['id']],function(_0x479505){return{'id':_0x479505['id'],'fullname':_0x479505['fullname']};});}}catch(_0x1fa2fb){_0xcdc6e0(_0x1fa2fb);}_0x423771(_0x2fd36b);});}function getInteractionTags(_0x3606ee,_0xb36ffb){return new BPromise(function(_0x7a47c5,_0x2f8fe7){try{if(_0x3606ee[_0x5a31('0x40')]){_0x3606ee[_0x5a31('0x41')]=[];_0x3606ee[_0x5a31('0x40')][_0x5a31('0x42')](',')[_0x5a31('0x43')](function(_0x1a41dd){_0x3606ee['Tags'][_0x5a31('0x44')](_0xb36ffb[_0x1a41dd]);});}delete _0x3606ee[_0x5a31('0x40')];}catch(_0x53f162){_0x2f8fe7(_0x53f162);}_0x7a47c5(_0x3606ee);});}function updateChatInteraction(_0x5ec545,_0x31870e,_0x122e4d){return new BPromise(function(_0x4844e7,_0x2237df){return getInteractionUsers(_0x5ec545,_0x122e4d)[_0x5a31('0x22')](function(_0x36d7db){return getInteractionTags(_0x36d7db,_0x31870e);})[_0x5a31('0x22')](function(_0x7c5462){return getStateInteraction(_0x7c5462);})['then'](function(_0xec7ee1){_0x4844e7(_0xec7ee1);})[_0x5a31('0x45')](function(_0x3e4257){_0x2237df(_0x3e4257);});});}function getStateInteraction(_0x4183bf){return new BPromise(function(_0x692ce4){_0x4183bf[_0x5a31('0x46')]=0x0;_0x4183bf[_0x5a31('0x47')]=0x0;_0x4183bf[_0x5a31('0x48')]=0x0;_0x4183bf[_0x5a31('0x49')]=0x0;_0x4183bf[_0x5a31('0x4a')]=0x0;_0x4183bf[_0x5a31('0x4b')]=0x0;if(!_0x4183bf[_0x5a31('0x4c')]&&!_0x4183bf[_0x5a31('0x4d')]){_0x4183bf['waiting']+=0x1;}if(!_0x4183bf['closed']&&_0x4183bf[_0x5a31('0x4d')]){_0x4183bf[_0x5a31('0x47')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf[_0x5a31('0x46')]-=0x1;}}if(_0x4183bf[_0x5a31('0x4c')]&&_0x4183bf['disposition']===_0x5a31('0x4a')){_0x4183bf[_0x5a31('0x4a')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf[_0x5a31('0x46')]-=0x1;}}else if(_0x4183bf[_0x5a31('0x4c')]&&!_0x4183bf[_0x5a31('0x4d')]&&_0x4183bf['disposition']){_0x4183bf[_0x5a31('0x49')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf['waiting']-=0x1;}}else if(_0x4183bf[_0x5a31('0x4c')]&&_0x4183bf[_0x5a31('0x4d')]){_0x4183bf[_0x5a31('0x48')]+=0x1;if(_0x4183bf['talking']){_0x4183bf[_0x5a31('0x47')]-=0x1;}}_0x4183bf[_0x5a31('0x4b')]+=0x1;_0x692ce4(_0x4183bf);});}exports[_0x5a31('0x4e')]=function(_0x3b47e0,_0x4e5235){var _0x372eba={},_0x9183d8={},_0x14abae={'count':0x0,'rows':[]};var _0x19457c=_[_0x5a31('0x3f')](db[_0x5a31('0x4f')][_0x5a31('0x50')],function(_0x58dff7){return{'name':_0x58dff7[_0x5a31('0x51')],'type':_0x58dff7[_0x5a31('0x52')][_0x5a31('0x53')]};});_0x9183d8[_0x5a31('0x54')]=_[_0x5a31('0x3f')](_0x19457c,_0x5a31('0x37'));_0x9183d8[_0x5a31('0x55')]=_[_0x5a31('0x56')](_0x3b47e0[_0x5a31('0x55')]);_0x9183d8[_0x5a31('0x57')]=_[_0x5a31('0x58')](_0x9183d8[_0x5a31('0x54')],_0x9183d8[_0x5a31('0x55')]);_0x372eba[_0x5a31('0x59')]=_['intersection'](_0x9183d8[_0x5a31('0x54')],qs[_0x5a31('0x5a')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x5a')]));_0x372eba[_0x5a31('0x59')]=_0x372eba[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x372eba[_0x5a31('0x59')]:_0x9183d8[_0x5a31('0x54')];if(!_0x3b47e0[_0x5a31('0x55')]['hasOwnProperty'](_0x5a31('0x5c'))){_0x372eba[_0x5a31('0x2f')]=qs[_0x5a31('0x2f')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x2f')]);_0x372eba['offset']=qs[_0x5a31('0x31')](_0x3b47e0['query'][_0x5a31('0x31')]);}_0x372eba['order']=qs['sort'](_0x3b47e0['query'][_0x5a31('0x5d')]);_0x372eba[_0x5a31('0x5e')]=qs['filters'](_['pick'](_0x3b47e0[_0x5a31('0x55')],_0x9183d8[_0x5a31('0x57')]),_0x19457c);var _0xb54574=[];var _0x22648c=squel[_0x5a31('0x5f')]()[_0x5a31('0x60')]('id')[_0x5a31('0x60')](_0x5a31('0x37'))[_0x5a31('0x60')]('color')['from']('tools_tags');var _0xbaf699=squel['select']()['field']('u.id')[_0x5a31('0x60')]('u.fullname')[_0x5a31('0x60')](_0x5a31('0x61'))['from'](_0x5a31('0x62'),'ui')[_0x5a31('0x63')](_0x5a31('0x64'),'u',_0x5a31('0x65'));var _0x50d8db=squel[_0x5a31('0x5f')]()['from']('chat_interactions','i')[_0x5a31('0x63')](_0x5a31('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x5a31('0x67'))['left_join'](_0x5a31('0x68'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x5a31('0x63')](_0x5a31('0x69'),'me',_0x5a31('0x6a'))[_0x5a31('0x63')](_0x5a31('0x6b'),'it',_0x5a31('0x6c'))[_0x5a31('0x63')](_0x5a31('0x6d'),'t',_0x5a31('0x6e'));var _0x564ae9=squel[_0x5a31('0x6f')]();var _0x3c8048=[];var _0xeb3a1=squel[_0x5a31('0x6f')]();var _0x1c4714;if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x70')]){_0x1c4714=as[_0x5a31('0x71')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x70')]);var _0x269c68=_0x1c4714[_0x5a31('0x72')];for(var _0x213906=0x0;_0x213906<_0x1c4714[_0x5a31('0x73')][_0x5a31('0x5b')];_0x213906++){var _0x3447fe=_0x1c4714[_0x5a31('0x73')][_0x213906];var _0x49f21f='i';var _0x211c9f=_[_0x5a31('0x74')](_0x19457c,['name',_0x3447fe[_0x5a31('0x60')]]);if(!_0x211c9f){switch(_0x3447fe[_0x5a31('0x60')]){case _0x5a31('0x75'):if(_0x3447fe[_0x5a31('0x76')]==0x1){_0x50d8db['having']('`'+_0x3447fe[_0x5a31('0x60')]+_0x5a31('0x77'));}else{_0x50d8db[_0x5a31('0x78')]('`'+_0x3447fe[_0x5a31('0x60')]+_0x5a31('0x79'));}break;case'Contact':if(_0x3447fe['operator']===_0x5a31('0x7a')){if(_0x3447fe[_0x5a31('0x76')][_0x5a31('0x42')]('\x20')[_0x5a31('0x5b')]>0x1){_0x564ae9[_0x269c68](_0x5a31('0x7b'),qs[_0x5a31('0x7c')](_0x3447fe[_0x5a31('0x76')]),null);}else{var _0x4d85c3='%'+_0x3447fe[_0x5a31('0x76')]+'%';_0x564ae9[_0x269c68](_0x5a31('0x7d'),_0x4d85c3,_0x4d85c3,_0x4d85c3);}}else{_0x211c9f=_[_0x5a31('0x74')](_0x19457c,[_0x5a31('0x37'),'ContactId']);_0x3447fe[_0x5a31('0x60')]=_0x5a31('0x7e');_0xf2a06d=as[_0x5a31('0x7f')](_0x49f21f,_0x211c9f[_0x5a31('0x52')],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x2d')]);}break;case _0x5a31('0x82'):var _0xa4445e=_0x3447fe[_0x5a31('0x76')][_0x5a31('0x42')](',')[_0x5a31('0x3f')](function(_0x423a34){return Number(_0x423a34);});_0xa4445e['forEach'](function(_0x5c94eb){_0xeb3a1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c94eb+',%');});_0x3c8048=_[_0x5a31('0x83')](_0x3c8048,_0xa4445e);break;case _0x5a31('0x84'):if(_0x3447fe[_0x5a31('0x85')]==='$substring'){_0x564ae9[_0x269c68](_0x5a31('0x86'),'%'+_0x3447fe[_0x5a31('0x76')]+'%',null);}else{_0x211c9f=_[_0x5a31('0x74')](_0x19457c,[_0x5a31('0x37'),_0x5a31('0x4d')]);_0x3447fe[_0x5a31('0x60')]=_0x5a31('0x4d');_0xf2a06d=as['buildExpression'](_0x49f21f,_0x211c9f[_0x5a31('0x52')],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d['value'][_0x5a31('0x81')],_0xf2a06d['value'][_0x5a31('0x2d')]);}break;case _0x5a31('0x87'):_0xf2a06d=as[_0x5a31('0x7f')]('me',null,_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d['value'][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x2d')]);break;}}else{var _0xf2a06d=as[_0x5a31('0x7f')](_0x49f21f,_0x211c9f['type'],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')]['end']);}}}else{var _0x1f7c31=_(_0x3b47e0[_0x5a31('0x55')])[_0x5a31('0x56')]()['map'](function(_0x36d78a){return _[_0x5a31('0x88')](_0x19457c,[_0x5a31('0x37'),_0x36d78a])?_0x36d78a:undefined;})[_0x5a31('0x89')]()[_0x5a31('0x76')]();if(!_[_0x5a31('0x8a')](_0x1f7c31)){_0x1f7c31[_0x5a31('0x43')](function(_0x5e3ba1){if(_0x5e3ba1==='ChatWebsiteId'){_0x50d8db['where'](_0x5a31('0x8b'),[]['concat'](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1]));}else if(_0x5e3ba1==='createdAt'){var _0x34fe44=JSON[_0x5a31('0x8c')](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1])[_0x5a31('0x8d')];var _0x47ca24=JSON[_0x5a31('0x8c')](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1])[_0x5a31('0x8e')];_0x50d8db[_0x5a31('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x34fe44,_0x47ca24);}else{if(_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1]===_0x5a31('0x8f')){_0x50d8db['where']('i.'+_0x5e3ba1+_0x5a31('0x90'));}else{_0x50d8db[_0x5a31('0x5e')]('i.'+_0x5e3ba1+'\x20=\x20?',_0x3b47e0['query'][_0x5e3ba1]);}}});}if(_0x3b47e0[_0x5a31('0x55')]['read']){if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x91')]==0x1){_0x50d8db[_0x5a31('0x78')]('`unreadMessages`\x20=\x200');}else{_0x50d8db[_0x5a31('0x78')](_0x5a31('0x92'));}}if(_0x3b47e0['query']['tag']){_0x3c8048=_[_0x5a31('0x93')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')])?_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')]:new Array(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')]);_0x3c8048[_0x5a31('0x43')](function(_0x44565c){_0xeb3a1['or'](_0x5a31('0x95'),'%,'+_0x44565c+',%');});}if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x96')]){var _0x1ce6ee=_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x96')][_0x5a31('0x97')]('\x5c','\x5c\x5c')[_0x5a31('0x97')](/'/g,'\x27\x27');if(qs[_0x5a31('0x98')](_0x1ce6ee)){_0x564ae9['or'](_0x5a31('0x99'),_0x1ce6ee+'%');}else{_0x564ae9['or'](_0x5a31('0x9a'),qs['getFullTextValue'](_0x1ce6ee))['or'](_0x5a31('0x9b'),_0x1ce6ee+'%');}}}_0x50d8db['where'](_0x564ae9);_0x50d8db[_0x5a31('0x9c')](_0x5a31('0x9d'));var _0x57e33c={'type':db[_0x5a31('0x9e')]['QueryTypes'][_0x5a31('0x9f')],'raw':!![]};var _0x4f9d62=_0x50d8db['clone']();_0x4f9d62['field'](_0x5a31('0x9d'));_0x4f9d62[_0x5a31('0x60')](_0x5a31('0xa0'),_0x5a31('0x75'));if(_0x372eba['order']){_0x372eba[_0x5a31('0xa1')][_0x5a31('0x43')](function(_0x4c8a47){var _0x4eedff=_0x4c8a47[0x0]===_0x5a31('0xa2')?_0x4c8a47[0x0]:'i.'+_0x4c8a47[0x0];_0x50d8db[_0x5a31('0xa1')](_0x4eedff,_0x4c8a47[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5a31('0x8a')](_0x3c8048)){_0x50d8db[_0x5a31('0x78')](_0xeb3a1);_0x4f9d62['where'](_0x5a31('0xa3'),_0x3c8048);}BPromise[_0x5a31('0xa4')]()[_0x5a31('0x22')](function(){if(!_0x1c4714){if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0xa5')])return;_0x4f9d62[_0x5a31('0x5e')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x50d8db[_0x5a31('0x5e')](_0x5a31('0xa6'));return;}if(_0x3b47e0['user'][_0x5a31('0xa7')]!==_0x5a31('0x3b'))return;return _0x3b47e0[_0x5a31('0xa8')][_0x5a31('0xa9')]({'attributes':['id'],'raw':!![]})[_0x5a31('0x22')](function(_0x23dcdc){if(_[_0x5a31('0x8a')](_0x23dcdc)){_0x4f9d62[_0x5a31('0x5e')](_0x5a31('0xaa'));_0x50d8db['where'](_0x5a31('0xaa'));}else{_0x4f9d62[_0x5a31('0x5e')](_0x5a31('0x8b'),_['map'](_0x23dcdc,'id'));_0x50d8db[_0x5a31('0x5e')](_0x5a31('0x8b'),_[_0x5a31('0x3f')](_0x23dcdc,'id'));}});})[_0x5a31('0x22')](function(){if(_0x3b47e0[_0x5a31('0xa8')][_0x5a31('0xa7')]===_0x5a31('0x3b')&&!_0x1c4714&&!_0x3b47e0[_0x5a31('0x55')]['ChatWebsiteId'])return[];return db[_0x5a31('0xab')][_0x5a31('0x55')](_0x4f9d62['toString'](),_0x57e33c);})['then'](function(_0x450ed9){_0x14abae['count']=_0x450ed9[_0x5a31('0x5b')];if(_0x14abae[_0x5a31('0x30')]===0x0)return[];return db['sequelize'][_0x5a31('0x55')](_0x22648c[_0x5a31('0xac')](),_0x57e33c)[_0x5a31('0x22')](function(_0x70a06b){_0xb54574=_['keyBy'](_0x70a06b,'id');_0x57e33c=_[_0x5a31('0x39')](_0x57e33c,{'model':db[_0x5a31('0x4f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x5a')]){_0x372eba[_0x5a31('0x59')][_0x5a31('0x43')](function(_0x1ea63a){_0x50d8db['field']('i.'+_0x1ea63a);});}else{_0x50d8db[_0x5a31('0x60')](_0x5a31('0xa0'),_0x5a31('0x75'));_0x50d8db['field'](_0x5a31('0xad'),_0x5a31('0xae'));_0x50d8db[_0x5a31('0x60')]('a.mandatoryDisposition',_0x5a31('0xaf'));_0x50d8db['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','contactName');_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb0'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb1'),_0x5a31('0xb2'));_0x50d8db['field'](_0x5a31('0xb3'),_0x5a31('0xb4'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb5'),_0x5a31('0xb6'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb7'),_0x5a31('0xb8'));_0x50d8db['field']('c.mobile',_0x5a31('0xb9'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xba'),'Contact.fax');_0x50d8db['field']('o.fullname',_0x5a31('0xbb'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xbc'),'Owner.internal');_0x50d8db[_0x5a31('0x60')](_0x5a31('0xbd'),'TagIds');}if(_0x372eba['limit'])_0x50d8db[_0x5a31('0x2f')](_0x372eba['limit']);if(_0x372eba[_0x5a31('0x31')])_0x50d8db[_0x5a31('0x31')](_0x372eba[_0x5a31('0x31')]);return db[_0x5a31('0xab')][_0x5a31('0x55')](_0x50d8db[_0x5a31('0xac')](),_0x57e33c);})[_0x5a31('0x22')](function(_0x118a95){if(_0x118a95['length']>0x0)_0xbaf699[_0x5a31('0x5e')](_0x5a31('0xbe'),_[_0x5a31('0x3f')](_0x118a95,'id'));return db['sequelize']['query'](_0xbaf699[_0x5a31('0xac')](),_0x57e33c)[_0x5a31('0x22')](function(_0x3ea57c){var _0x22f5e6=_['groupBy'](_0x3ea57c,_0x5a31('0xbf'));var _0x13ea99=[];_0x118a95['forEach'](function(_0x39f200){_0x13ea99[_0x5a31('0x44')](updateChatInteraction(_0x39f200,_0xb54574,_0x22f5e6));});return BPromise[_0x5a31('0xc0')](_0x13ea99);});});})['then'](function(_0x3ffa11){_0x14abae[_0x5a31('0xc1')]=_0x3ffa11;return _0x14abae;})[_0x5a31('0x22')](respondWithFilteredResult(_0x4e5235,_0x372eba))[_0x5a31('0x45')](handleError(_0x4e5235,null));};exports['show']=function(_0x55e8c4,_0x527fc5){var _0x1f1509={'raw':![],'where':{'id':_0x55e8c4[_0x5a31('0xc2')]['id']}},_0x2ee67c={};_0x2ee67c[_0x5a31('0x54')]=_[_0x5a31('0x56')](db[_0x5a31('0x4f')]['rawAttributes']);_0x2ee67c[_0x5a31('0x55')]=_['keys'](_0x55e8c4[_0x5a31('0x55')]);_0x2ee67c[_0x5a31('0x57')]=_[_0x5a31('0x58')](_0x2ee67c[_0x5a31('0x54')],_0x2ee67c['query']);_0x1f1509[_0x5a31('0x59')]=_[_0x5a31('0x58')](_0x2ee67c['model'],qs['fields'](_0x55e8c4[_0x5a31('0x55')]['fields']));_0x1f1509[_0x5a31('0x59')]=_0x1f1509[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x1f1509[_0x5a31('0x59')]:_0x2ee67c['model'];if(_0x55e8c4[_0x5a31('0x55')][_0x5a31('0xc3')]){_0x1f1509[_0x5a31('0xc4')]=[{'all':!![]}];}_0x1f1509=_[_0x5a31('0x39')]({},_0x1f1509,_0x55e8c4['options']);return db[_0x5a31('0x4f')]['find'](_0x1f1509)[_0x5a31('0x22')](handleEntityNotFound(_0x527fc5,null))[_0x5a31('0x22')](respondWithResult(_0x527fc5,null))[_0x5a31('0x45')](handleError(_0x527fc5,null));};exports[_0x5a31('0xc5')]=function(_0x73178a,_0x4b86c3){return db['ChatInteraction']['create'](_0x73178a['body'],{})[_0x5a31('0x22')](respondWithResult(_0x4b86c3,0xc9))[_0x5a31('0x45')](handleError(_0x4b86c3,null));};exports[_0x5a31('0x35')]=function(_0x1f3b00,_0x171945){if(_0x1f3b00['body']['id']){delete _0x1f3b00[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')]['find']({'where':{'id':_0x1f3b00[_0x5a31('0xc2')]['id']}})['then'](handleEntityNotFound(_0x171945,null))[_0x5a31('0x22')](saveUpdates(_0x1f3b00['body'],null))[_0x5a31('0x22')](respondWithResult(_0x171945,null))[_0x5a31('0x45')](handleError(_0x171945,null));};exports[_0x5a31('0x36')]=function(_0x4e10aa,_0x4dc4b7){return db[_0x5a31('0x4f')]['find']({'where':{'id':_0x4e10aa[_0x5a31('0xc2')]['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x4dc4b7,null))[_0x5a31('0x22')](removeEntity(_0x4dc4b7,null))[_0x5a31('0x45')](handleError(_0x4dc4b7,null));};exports[_0x5a31('0xc6')]=function(_0x1db4b4,_0x2af5b){return db[_0x5a31('0x4f')][_0x5a31('0xc6')]()['then'](respondWithResult(_0x2af5b,null))[_0x5a31('0x45')](handleError(_0x2af5b,null));};exports[_0x5a31('0xc7')]=function(_0x58ea2a,_0x53065c){var _0x54912a=_0x58ea2a[_0x5a31('0xc2')]['id'];var _0x4cd718;var _0x297442;var _0x56f5b6;return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x54912a}})[_0x5a31('0x22')](function(_0x4d997d){_0x4cd718=_0x4d997d;return db[_0x5a31('0xc9')][_0x5a31('0xc8')]({'where':{'id':_0x4d997d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x5a31('0xca'),_0x5a31('0xcb'),_0x5a31('0xcc'),_0x5a31('0xcd')],'raw':!![]});})[_0x5a31('0x22')](function(_0x5c72ae){if(_0x5c72ae&&_0x5c72ae[_0x5a31('0xce')]&&_0x5c72ae[_0x5a31('0xca')]){_0x297442=_0x5c72ae;var _0x2019bf={'interaction':{'id':_0x54912a},'agent':{'id':_0x58ea2a[_0x5a31('0xa8')]['id'],'name':_0x58ea2a[_0x5a31('0xa8')][_0x5a31('0x37')],'fullname':_0x58ea2a['user'][_0x5a31('0xcf')],'email':_0x58ea2a[_0x5a31('0xa8')][_0x5a31('0xd0')]},'contact':_0x58ea2a[_0x5a31('0x87')][_0x5a31('0x3a')],'account':_0x58ea2a[_0x5a31('0x87')]['account']};var _0x1ed1c4={'rejectUnauthorized':![],'method':_0x5a31('0xd1'),'url':_0x5a31('0xd2'),'headers':{'X-APIKEY':_0x5c72ae[_0x5a31('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x58ea2a[_0x5a31('0xa8')]['email']],'buttons':null,'topic':_0x297442[_0x5a31('0xcb')],'note':_[_0x5a31('0xd3')](_0x297442[_0x5a31('0xcc')])?null:getMustacheRender(_0x297442['vidaooNote'],_0x2019bf),'metadata':null},'redirect':_0x5a31('0xd4'),'json':!![]};try{if(!_[_0x5a31('0xd3')](_0x297442[_0x5a31('0xcd')])){var _0x293be3=getMustacheRender(_0x297442[_0x5a31('0xcd')],_0x2019bf);var _0x4370b1=JSON[_0x5a31('0x8c')](_0x293be3);_0x1ed1c4[_0x5a31('0x87')]['metadata']=_0x4370b1;}}catch(_0x358a0e){throw new db[(_0x5a31('0x9e'))]['ValidationError'](_0x5a31('0xd5'));}return rp(_0x1ed1c4);}else{throw new db[(_0x5a31('0x9e'))]['ValidationError'](_0x5a31('0xd6'));}})[_0x5a31('0x22')](function(_0x2ef4c0){_0x56f5b6=_0x2ef4c0;if(_0x56f5b6['id']){var _0x13a055={'body':_0x56f5b6[_0x5a31('0xd7')],'ChatWebsiteId':_0x297442['id'],'ChatInteractionId':_0x4cd718['id'],'direction':'out','UserId':_0x58ea2a[_0x5a31('0xa8')]['id']};return db[_0x5a31('0xd8')][_0x5a31('0xc5')](_0x13a055,{});}else{throw new db[(_0x5a31('0x9e'))][(_0x5a31('0xd9'))](_0x5a31('0xda'));}})[_0x5a31('0x22')](function(){return _0x4cd718[_0x5a31('0xdb')]({'vidaooSessionId':_0x56f5b6['id']});})[_0x5a31('0x22')](respondWithResult(_0x53065c,null))[_0x5a31('0x45')](handleError(_0x53065c,null));};exports[_0x5a31('0xdc')]=function(_0x19b120,_0x2d1764){if(_0x19b120[_0x5a31('0x87')]['id']){delete _0x19b120[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x19b120[_0x5a31('0xc2')]['id']},'include':[{'model':db[_0x5a31('0xdd')],'as':'Contact'}]})[_0x5a31('0x22')](handleEntityNotFound(_0x2d1764,null))['then'](saveUpdates(_0x19b120['body'],null))[_0x5a31('0x22')](respondWithResult(_0x2d1764,null))[_0x5a31('0x45')](handleError(_0x2d1764,null));};exports[_0x5a31('0xde')]=function(_0x2370ae,_0x361842,_0x35affa){if(_0x2370ae[_0x5a31('0x87')]['id']){delete _0x2370ae[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x2370ae[_0x5a31('0xc2')]['id']}})['then'](function(_0x40f1de){if(!_0x40f1de){logger[_0x5a31('0x27')](_0x5a31('0xdf'),'abandon',0x194,_0x5a31('0xe0'));_0x361842[_0x5a31('0x2b')](0x194);}else{if(_0x40f1de[_0x5a31('0x4d')]){throw new db['Sequelize'][(_0x5a31('0xd9'))]('Interaction\x20already\x20assigned');}}return _0x40f1de;})[_0x5a31('0x22')](function(_0x2ec76a){if(_0x2ec76a){return _0x2ec76a['update']({'closed':_0x2370ae['body']['closed'],'disposition':_0x2370ae[_0x5a31('0x87')][_0x5a31('0xe1')]})[_0x5a31('0x22')](function(_0x102d5a){return _0x102d5a;});}})['then'](function(_0x62564){return respondWithRpcPromise(_0x5a31('0xe2'),_0x5a31('0xde'),_0x2370ae['body'],client9004);})[_0x5a31('0x22')](respondWithResult(_0x361842,null))[_0x5a31('0x45')](handleError(_0x361842,null));};exports['attachmentUpload']=function(_0x55d046,_0x355937,_0x417d50){_0x55d046['body']['name']=_0x55d046['file'][_0x5a31('0xe3')];_0x55d046[_0x5a31('0x87')][_0x5a31('0xe4')]=_0x55d046[_0x5a31('0xe5')]['filename'];_0x55d046[_0x5a31('0x87')][_0x5a31('0x52')]=_0x55d046['file']['mimetype'];return db[_0x5a31('0xe6')][_0x5a31('0xc5')](_0x55d046[_0x5a31('0x87')])[_0x5a31('0x22')](respondWithResult(_0x355937,0xc9))['catch'](handleError(_0x355937,null));};exports[_0x5a31('0xe7')]=function(_0x3841c2,_0xcf1110,_0x53f4f6){return db['ChatInteraction'][_0x5a31('0xc8')]({'where':{'id':_0x3841c2[_0x5a31('0xc2')]['id']},'raw':!![]})[_0x5a31('0x22')](handleEntityNotFound(_0xcf1110,null))[_0x5a31('0x22')](function(_0x201ece){if(_0x201ece){if(_0x201ece['closed']){return _0xcf1110[_0x5a31('0x2c')](0x193)[_0x5a31('0x2e')]({'status':0x193,'message':_0x5a31('0xe8')});}return db[_0x5a31('0xe6')]['findOne']({'where':{'id':_0x3841c2[_0x5a31('0x55')][_0x5a31('0xe9')]},'raw':!![]})['then'](handleEntityNotFound(_0xcf1110,null));}})[_0x5a31('0x22')](function(_0x2e2842){if(_0x2e2842){var _0x213213=_0x2e2842[_0x5a31('0xea')]!==null;var _0x240dcd=path['join'](config[_0x5a31('0xeb')],_0x5a31('0xec'));if(_0x213213){_0x240dcd=path['join'](_0x240dcd,'offline-chat/');}var _0x4164b7=path[_0x5a31('0xed')](_0x240dcd,_0x2e2842[_0x5a31('0xe4')]);return _0xcf1110[_0x5a31('0xee')](_0x4164b7);}})[_0x5a31('0x45')](handleError(_0xcf1110,null));};exports[_0x5a31('0xef')]=function(_0x565498,_0x3b0272){var _0x34fc17=null;var _0xeab0e8=null;var _0x35060d=null;var _0x3dc6c7=null;if(_0x565498[_0x5a31('0x87')]['id']){delete _0x565498[_0x5a31('0x87')]['id'];}if(_0x565498[_0x5a31('0x87')][_0x5a31('0xf0')]){_0x3dc6c7=path[_0x5a31('0xed')](config[_0x5a31('0xeb')],_0x5a31('0xf1'),util[_0x5a31('0xf2')]('transcript-%s.txt',Date[_0x5a31('0xf3')]()));_0x565498[_0x5a31('0x87')][_0x5a31('0xf4')]=_0x3dc6c7;}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x565498[_0x5a31('0xc2')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x5a31('0xf5'),'include':[{'model':db[_0x5a31('0x84')],'as':_0x5a31('0x84')}]}]})['then'](handleEntityNotFound(_0x3b0272,null))[_0x5a31('0x22')](saveUpdates(_0x565498[_0x5a31('0x87')],null))[_0x5a31('0x22')](function(_0x50c3d8){if(_0x50c3d8){_0x34fc17=_0x50c3d8;return db['ChatWebsite'][_0x5a31('0x74')]({'where':{'id':_0x34fc17[_0x5a31('0xa5')]}});}})[_0x5a31('0x22')](function(_0x4a2aa6){if(_0x4a2aa6){_0x35060d=_0x4a2aa6;return db[_0x5a31('0xdd')][_0x5a31('0x74')]({'where':{'id':_0x34fc17[_0x5a31('0x7e')]}});}})[_0x5a31('0x22')](function(_0x591a10){if(_0x591a10){_0xeab0e8=_0x591a10;if(_0x3dc6c7){var _0xa8b6ba=null;for(var _0x1453ea=0x1;_0x1453ea<_0x34fc17['Messages']['length'];++_0x1453ea){_0xa8b6ba=_0x34fc17[_0x5a31('0xf5')][_0x1453ea];var _0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?util[_0x5a31('0xf2')]('%s%d',_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');var _0xe38492=_0x565498[_0x5a31('0x87')][_0x5a31('0xf8')]||util[_0x5a31('0xf2')](_0x5a31('0xf9'),_0x5a31('0xfa'),_0xa8b6ba['ContactId']);switch(_0x35060d[_0x5a31('0xfb')]){case _0x5a31('0xfc'):_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?util['format'](_0x5a31('0xf9'),_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');break;case'agent_alias':_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?_0xa8b6ba[_0x5a31('0x84')][_0x5a31('0xfd')]||_0xa8b6ba[_0x5a31('0x84')]['fullname']:_0x5a31('0xf7');break;case _0x5a31('0xfe'):_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?_0xa8b6ba[_0x5a31('0x84')][_0x5a31('0xcf')]:_0x5a31('0xf7');break;default:_0x2535eb=_0xa8b6ba['UserId']?util[_0x5a31('0xf2')](_0x5a31('0xf9'),_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');}var _0x13c764=util[_0x5a31('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0xa8b6ba[_0x5a31('0xff')])[_0x5a31('0xf2')](_0x5a31('0x100')),_0xa8b6ba['direction']==='in'?_0xe38492:_0x2535eb,_0xa8b6ba[_0x5a31('0x87')]);if(!_0xa8b6ba['secret']){fs[_0x5a31('0x101')](_0x3dc6c7,_0x13c764);}}return db['MailAccount'][_0x5a31('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x5a31('0x102')],'as':_0x5a31('0x103'),'raw':!![]}]});}}})['then'](function(_0x24009a){if(_0x24009a&&_0x24009a[_0x5a31('0x103')]&&_0x565498[_0x5a31('0x87')]){var _0x931876={'tls':{'rejectUnauthorized':![]}};if(_0x24009a[_0x5a31('0x103')][_0x5a31('0x104')]){_0x931876[_0x5a31('0x104')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x104')];}else{_0x931876[_0x5a31('0x105')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x105')];_0x931876[_0x5a31('0x106')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x106')];_0x931876[_0x5a31('0x107')]=_0x24009a[_0x5a31('0x103')]['secure'];}if(_0x24009a['Smtp'][_0x5a31('0x108')]){_0x931876['auth']={'user':_0x24009a[_0x5a31('0x103')][_0x5a31('0xa8')],'pass':_0x24009a[_0x5a31('0x103')][_0x5a31('0x109')]};}return respondWithRpcPromise('SendMail',_0x5a31('0x10a'),{'account':_0x931876,'message':{'from':util[_0x5a31('0xf2')]('\x22%s\x22\x20<%s>',_0x24009a[_0x5a31('0x37')],_0x24009a[_0x5a31('0xd0')]||_0x24009a[_0x5a31('0x103')][_0x5a31('0xa8')]),'to':_0x565498['body'][_0x5a31('0xf0')],'subject':_0x5a31('0x10b'),'text':util[_0x5a31('0xf2')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x565498[_0x5a31('0x87')][_0x5a31('0xf0')]),'attachments':[{'path':_0x3dc6c7}]}})[_0x5a31('0x22')](function(){return _0x34fc17;})['catch'](function(_0xa6922d){console['error'](_0xa6922d);});}else{return _0x34fc17;}})[_0x5a31('0x22')](respondWithStatusCode(_0x3b0272,0xc8))[_0x5a31('0x45')](handleError(_0x3b0272,null));};exports[_0x5a31('0x10c')]=function(_0x31193a,_0x1025f0,_0x4b1633){return db[_0x5a31('0xd8')][_0x5a31('0x74')]({'where':{'id':_0x31193a[_0x5a31('0xc2')]['id']}})['then'](handleEntityNotFound(_0x1025f0,null))[_0x5a31('0x22')](function(_0xcee649){if(_0xcee649){return _0xcee649['addMessage'](_0x31193a[_0x5a31('0x87')][_0x5a31('0x10d')],_['omit'](_0x31193a[_0x5a31('0x87')],[_0x5a31('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x1025f0,null))['catch'](handleError(_0x1025f0,null));};exports[_0x5a31('0x10e')]=function(_0x17941f,_0x49b5d0,_0x211995){var _0x45a73f={'raw':![],'where':{}};var _0x4a8a12={};var _0xf8492a={'count':0x0,'rows':[]};return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x17941f[_0x5a31('0xc2')]['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x49b5d0,null))[_0x5a31('0x22')](function(_0x192cef){if(_0x192cef){_0x4a8a12[_0x5a31('0x54')]=_[_0x5a31('0x56')](db[_0x5a31('0xd8')][_0x5a31('0x50')]);_0x4a8a12['query']=_[_0x5a31('0x56')](_0x17941f[_0x5a31('0x55')]);_0x4a8a12[_0x5a31('0x57')]=_['intersection'](_0x4a8a12[_0x5a31('0x54')],_0x4a8a12[_0x5a31('0x55')]);_0x45a73f['attributes']=_[_0x5a31('0x58')](_0x4a8a12[_0x5a31('0x54')],qs['fields'](_0x17941f['query'][_0x5a31('0x5a')]));_0x45a73f[_0x5a31('0x59')]=_0x45a73f[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x45a73f['attributes']:_0x4a8a12[_0x5a31('0x54')];if(!_0x17941f[_0x5a31('0x55')][_0x5a31('0x10f')]('nolimit')){_0x45a73f['limit']=qs[_0x5a31('0x2f')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x2f')]);_0x45a73f[_0x5a31('0x31')]=qs[_0x5a31('0x31')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x31')]);}_0x45a73f['order']=qs[_0x5a31('0x5d')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x5d')]);_0x45a73f[_0x5a31('0x5e')]=qs[_0x5a31('0x57')](_[_0x5a31('0x110')](_0x17941f['query'],_0x4a8a12[_0x5a31('0x57')]));_0x45a73f['where']['ChatInteractionId']=_0x192cef['id'];if(_0x17941f[_0x5a31('0x55')][_0x5a31('0x96')]){_0x45a73f[_0x5a31('0x5e')]=_[_0x5a31('0x39')](_0x45a73f[_0x5a31('0x5e')],{'$or':_[_0x5a31('0x3f')](_0x45a73f['attributes'],function(_0x1e5b53){var _0x438862={};_0x438862[_0x1e5b53]={'$like':'%'+_0x17941f[_0x5a31('0x55')][_0x5a31('0x96')]+'%'};return _0x438862;})});}if(_0x17941f[_0x5a31('0x55')][_0x5a31('0x8d')]){var _0x279a80=_0x17941f[_0x5a31('0x55')][_0x5a31('0x8d')][_0x5a31('0x42')](',');var _0x60ad75={};_0x60ad75[_0x279a80[0x0]]={'$gte':moment(_0x279a80[0x1])[_0x5a31('0xf2')](_0x5a31('0x111'))};_0x45a73f[_0x5a31('0x5e')]=_[_0x5a31('0x39')](_0x45a73f['where'],_0x60ad75);}_0x45a73f=_[_0x5a31('0x39')]({},_0x45a73f,_0x17941f['options']);return db[_0x5a31('0xd8')][_0x5a31('0x30')]({'where':_0x45a73f[_0x5a31('0x5e')]})[_0x5a31('0x22')](function(_0x29695c){_0xf8492a['count']=_0x29695c;if(_0x17941f[_0x5a31('0x55')][_0x5a31('0xc3')]){_0x45a73f['include']=[{'all':!![]}];}return db[_0x5a31('0xd8')][_0x5a31('0x112')](_0x45a73f);})[_0x5a31('0x22')](function(_0x2f4354){_0xf8492a[_0x5a31('0xc1')]=_0x2f4354;return _0xf8492a;});}})[_0x5a31('0x22')](respondWithFilteredResult(_0x49b5d0,_0x45a73f))[_0x5a31('0x45')](handleError(_0x49b5d0,null));};exports[_0x5a31('0x113')]=function(_0x4d1d03,_0x70d81b,_0x1254d0){var _0x25e0dd={'where':{}},_0x145130={},_0x2efa3f={'count':0x0,'rows':[]};return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x4d1d03['params']['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x70d81b,null))[_0x5a31('0x22')](function(_0xff2c2a){if(_0xff2c2a){_0x145130['model']=_[_0x5a31('0x56')](db[_0x5a31('0xd8')][_0x5a31('0x50')]);_0x145130[_0x5a31('0x55')]=_[_0x5a31('0x56')](_0x4d1d03[_0x5a31('0x55')]);_0x145130[_0x5a31('0x57')]=_['intersection'](_0x145130[_0x5a31('0x54')],_0x145130['query']);_0x25e0dd[_0x5a31('0x59')]=_[_0x5a31('0x58')](_0x145130[_0x5a31('0x54')],qs[_0x5a31('0x5a')](_0x4d1d03['query'][_0x5a31('0x5a')]));_0x25e0dd[_0x5a31('0x59')]=_0x25e0dd['attributes'][_0x5a31('0x5b')]?_0x25e0dd[_0x5a31('0x59')]:_0x145130[_0x5a31('0x54')];if(!_0x4d1d03[_0x5a31('0x55')][_0x5a31('0x10f')](_0x5a31('0x5c'))){_0x25e0dd[_0x5a31('0x2f')]=qs[_0x5a31('0x2f')](_0x4d1d03['query'][_0x5a31('0x2f')]);_0x25e0dd['offset']=qs[_0x5a31('0x31')](_0x4d1d03[_0x5a31('0x55')][_0x5a31('0x31')]);}_0x25e0dd[_0x5a31('0xa1')]=qs[_0x5a31('0x5d')](_0x4d1d03[_0x5a31('0x55')]['sort']);_0x25e0dd['where']=qs[_0x5a31('0x57')](_['pick'](_0x4d1d03[_0x5a31('0x55')],_0x145130[_0x5a31('0x57')]));_0x25e0dd[_0x5a31('0x5e')][_0x5a31('0xbf')]=_0xff2c2a['id'];if(_0x4d1d03['query'][_0x5a31('0x96')]){_0x25e0dd['where']=_['merge'](_0x25e0dd['where'],{'$or':_[_0x5a31('0x3f')](_0x25e0dd[_0x5a31('0x59')],function(_0x17b996){var _0x26a1b7={};_0x26a1b7[_0x17b996]={'$like':'%'+_0x4d1d03[_0x5a31('0x55')]['filter']+'%'};return _0x26a1b7;})});}_0x25e0dd[_0x5a31('0x5e')]['secret']=![];if(_0x4d1d03[_0x5a31('0x55')]['id']){_0x25e0dd[_0x5a31('0x5e')]['id']={'$gt':_0x4d1d03[_0x5a31('0x55')]['id']};}_0x25e0dd=_[_0x5a31('0x39')]({},_0x25e0dd,_0x4d1d03['options']);return db['ChatMessage'][_0x5a31('0x30')]({'where':_0x25e0dd['where']})[_0x5a31('0x22')](function(_0x30c4a2){_0x2efa3f['count']=_0x30c4a2;_0x25e0dd['include']=[];if(_0x4d1d03[_0x5a31('0x55')]['includeAgent']){_0x25e0dd[_0x5a31('0xc4')]['push']({'model':db['User'],'as':_0x5a31('0x84'),'attributes':['id',_0x5a31('0xcf'),'alias']});}if(_0x4d1d03['query']['includeAll']){_0x25e0dd['include']=[{'all':!![]}];}return db[_0x5a31('0xd8')][_0x5a31('0x112')](_0x25e0dd);})['then'](function(_0x52bd57){_0x2efa3f['rows']=_0x52bd57;return _0x2efa3f;});}})[_0x5a31('0x22')](respondWithFilteredResult(_0x70d81b,_0x25e0dd))[_0x5a31('0x45')](handleError(_0x70d81b,null));};exports[_0x5a31('0x114')]=function(_0x249472,_0x189068,_0x50d48a){return db['ChatInteraction'][_0x5a31('0x74')]({'where':{'id':_0x249472['params']['id']}})['then'](handleEntityNotFound(_0x189068,null))[_0x5a31('0x22')](function(_0x2ef50e){if(_0x2ef50e){return _0x2ef50e['setTags'](_0x249472[_0x5a31('0x87')]['ids'],_[_0x5a31('0x115')](_0x249472[_0x5a31('0x87')],[_0x5a31('0x10d'),'id'])||{})[_0x5a31('0x116')](function(){return db[_0x5a31('0x82')]['findAll']({'attributes':['id',_0x5a31('0x37'),_0x5a31('0x117')],'where':{'id':_0x249472[_0x5a31('0x87')]['ids']}});})[_0x5a31('0x22')](function(_0x2ff4c5){socket['emit'](_0x5a31('0x118'),{'id':Number(_0x249472[_0x5a31('0xc2')]['id']),'tags':_0x2ff4c5||[]});return{'id':Number(_0x249472[_0x5a31('0xc2')]['id']),'tags':_0x2ff4c5||[]};});}})[_0x5a31('0x22')](respondWithResult(_0x189068,null))[_0x5a31('0x45')](handleError(_0x189068,null));};exports[_0x5a31('0x119')]=function(_0x2140d0,_0x11c943,_0x27eca2){return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x2140d0['params']['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x11c943,null))[_0x5a31('0x22')](function(_0x520b88){if(_0x520b88){return _0x520b88[_0x5a31('0x119')](_0x2140d0[_0x5a31('0x55')]['ids']);}})[_0x5a31('0x22')](respondWithStatusCode(_0x11c943,null))['catch'](handleError(_0x11c943,null));};exports[_0x5a31('0xee')]=function(_0x481164,_0x664448){var _0x3cb41f=moment()[_0x5a31('0x11a')]()[_0x5a31('0xac')]();var _0x2f4b2e=path['join'](config['root'],'server',_0x5a31('0x11b'),'tmp');var _0x3ccf4b=path['join'](config[_0x5a31('0xeb')],_0x5a31('0x11c'),'files',_0x5a31('0x11d'));var _0x55acb3=path[_0x5a31('0xed')](_0x2f4b2e,_0x3cb41f);var _0x5cf66b=util[_0x5a31('0xf2')](_0x5a31('0x11e'),_0x481164[_0x5a31('0xc2')]['id'],_0x3cb41f);var _0xdd2884=path['join'](_0x2f4b2e,_0x5cf66b);var _0x4e9338=[];_0x4e9338['push']({'model':db['User'],'as':_0x5a31('0x84'),'attributes':['id',_0x5a31('0xcf')],'raw':!![]});_0x4e9338[_0x5a31('0x44')]({'model':db[_0x5a31('0xdd')],'as':_0x5a31('0x11f'),'attributes':['id','firstName',_0x5a31('0x120')],'raw':!![]});if(_0x481164[_0x5a31('0x55')][_0x5a31('0x11d')]){_0x4e9338[_0x5a31('0x44')]({'model':db[_0x5a31('0xe6')],'as':_0x5a31('0xe6'),'raw':!![]});}var _0x20b252=[{'model':db[_0x5a31('0xd8')],'as':_0x5a31('0xf5'),'attributes':['id','body',_0x5a31('0xff'),'direction',_0x5a31('0x121'),'read'],'include':_0x4e9338}];_0x20b252['push']({'model':db[_0x5a31('0xc9')],'as':_0x5a31('0x122'),'attributes':['id',_0x5a31('0x37')]});_0x20b252[_0x5a31('0x44')]({'model':db[_0x5a31('0x84')],'as':'Owner','attributes':['id',_0x5a31('0xcf')]});return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x481164[_0x5a31('0xc2')]['id']},'include':_0x20b252})[_0x5a31('0x22')](handleEntityNotFound(_0x664448,null))[_0x5a31('0x22')](function(_0x42abf8){if(_0x42abf8){var _0x48fb7d=_0x42abf8[_0x5a31('0x123')]({'plain':!![]});fs[_0x5a31('0x124')](_0x55acb3);var _0x221417={'channel':_0x5a31('0x125'),'account':_0x48fb7d[_0x5a31('0x122')][_0x5a31('0x37')],'agent':_0x48fb7d[_0x5a31('0x126')]?_0x48fb7d[_0x5a31('0x126')][_0x5a31('0xcf')]:'N.A.','createdAt':moment(_0x48fb7d['createdAt'])[_0x5a31('0xf2')](_0x5a31('0x111'))['toString'](),'closedAt':_0x48fb7d[_0x5a31('0x4c')]?moment(_0x48fb7d[_0x5a31('0x127')])['format'](_0x5a31('0x111'))[_0x5a31('0xac')]():'','disposition':_0x48fb7d[_0x5a31('0xe1')],'chatInfo':{'browser':_0x48fb7d[_0x5a31('0x128')],'os':_0x48fb7d[_0x5a31('0x129')],'referer':_0x48fb7d[_0x5a31('0x12a')],'customerIp':_0x48fb7d[_0x5a31('0x12b')],'customerPort':_0x48fb7d[_0x5a31('0x12c')]?_0x48fb7d[_0x5a31('0x12c')]:_0x5a31('0x12d')},'messages':_(_0x48fb7d['Messages'])[_0x5a31('0x12e')]()[_0x5a31('0x96')]({'secret':![]})[_0x5a31('0x3f')](function(_0x56d760){if(_0x56d760['Attachment']){var _0x3a4e47=path[_0x5a31('0xed')](_0x3ccf4b,_0x56d760[_0x5a31('0xe6')][_0x5a31('0xe4')]);if(fs[_0x5a31('0x12f')](_0x3a4e47)){fs[_0x5a31('0x130')](_0x3a4e47)[_0x5a31('0x131')](fs[_0x5a31('0x132')](path['join'](_0x55acb3,_0x56d760[_0x5a31('0xe6')]['basename'])));}}return{'date':moment(_0x56d760[_0x5a31('0xff')])['format'](_0x5a31('0x111'))[_0x5a31('0xac')](),'sender':_0x56d760[_0x5a31('0x133')]===_0x5a31('0x134')?_0x56d760[_0x5a31('0x84')]?_0x56d760[_0x5a31('0x84')]['fullname']:_0x5a31('0xf7'):_0x56d760[_0x5a31('0x11f')][_0x5a31('0x135')]+(_0x56d760[_0x5a31('0x11f')][_0x5a31('0x120')]?'\x20'+_0x56d760[_0x5a31('0x11f')][_0x5a31('0x120')]:''),'body':_0x56d760[_0x5a31('0xe6')]?_0x56d760['Attachment'][_0x5a31('0xe4')]:_0x56d760[_0x5a31('0x87')],'direction':_0x56d760[_0x5a31('0x133')]===_0x5a31('0x134')?'A':'C','secret':_0x56d760['secret'],'read':_0x56d760['read'],'attachment':_0x56d760[_0x5a31('0xe6')]};})[_0x5a31('0x76')]()};return ejs['renderFile'](path[_0x5a31('0xed')](config[_0x5a31('0xeb')],_0x5a31('0x11c'),_0x5a31('0x136'),_0x5a31('0x137')),{'interaction':_0x221417})['then'](function(_0x33f34d){var _0x14356f=path['join'](_0x55acb3,_0x5a31('0x138')+_0x48fb7d['id']+'-'+_0x3cb41f+_0x5a31('0x139'));var _0x42f579={'path':_0x14356f,'channel':_0x5a31('0x125'),'interactionId':_0x48fb7d['id']};return pdf[_0x5a31('0x13a')](_0x33f34d,_0x42f579);})[_0x5a31('0x22')](function(){return new BPromise(function(_0x57099b,_0x2af211){zipdir(_0x55acb3,{'saveTo':_0xdd2884},function(_0x5782c5,_0x2e48cd){if(_0x5782c5)return _0x2af211(_0x5782c5);return _0x57099b(_0x2e48cd);});})['then'](function(){return new BPromise(function(_0x5d0bb3,_0x428cc0){rimraf(_0x55acb3,function(_0x1afa74){if(_0x1afa74)_0x428cc0(_0x1afa74);return _0x5d0bb3();});});})[_0x5a31('0x22')](function(){return _0x664448[_0x5a31('0xee')](_0xdd2884,_0x5cf66b,function(_0x55face){if(_0x55face){console[_0x5a31('0x13b')](_0x5a31('0x13c'),_0x55face);}else{fs[_0x5a31('0x13d')](_0xdd2884);}});});});}else{return _0x664448['sendStatus'](0xc8);}})[_0x5a31('0x45')](handleError(_0x664448,null));}; \ No newline at end of file +var _0x9c28=['Users','map','TagIds','split','Tags','waiting','talking','answered','abandoned','total','closed','UserId','disposition','ChatInteraction','rawAttributes','fieldName','type','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','union','User','$substring','body','compact','isEmpty','ChatWebsiteId','where','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','having','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','intersection','includeAll','include','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','customer','Visitor','agentIdentifier','website_alias','alias','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','options','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','unix','server','lastName','Owner','get','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','direction','out','System','firstName','renderFile','views','.pdf','log','err','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','render','merge','contact','agent','interaction'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x9c28,0x104));var _0x89c2=function(_0x4ef5fb,_0x4d4c8a){_0x4ef5fb=_0x4ef5fb-0x0;var _0x506096=_0x9c28[_0x4ef5fb];return _0x506096;};'use strict';var emlformat=require(_0x89c2('0x0'));var rimraf=require(_0x89c2('0x1'));var zipdir=require(_0x89c2('0x2'));var jsonpatch=require(_0x89c2('0x3'));var rp=require(_0x89c2('0x4'));var moment=require(_0x89c2('0x5'));var BPromise=require(_0x89c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89c2('0x7'));var sox=require(_0x89c2('0x8'));var csv=require(_0x89c2('0x9'));var ejs=require(_0x89c2('0xa'));var fs=require('fs');var fs_extra=require(_0x89c2('0xb'));var _=require(_0x89c2('0xc'));var squel=require(_0x89c2('0xd'));var crypto=require(_0x89c2('0xe'));var jsforce=require(_0x89c2('0xf'));var deskjs=require(_0x89c2('0x10'));var toCsv=require(_0x89c2('0x9'));var querystring=require(_0x89c2('0x11'));var Papa=require('papaparse');var Redis=require(_0x89c2('0x12'));var authService=require(_0x89c2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x89c2('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x89c2('0x15'));var logger=require('../../config/logger')(_0x89c2('0x16'));var utils=require('../../config/utils');var config=require(_0x89c2('0x17'));var licenseUtil=require(_0x89c2('0x18'));var db=require(_0x89c2('0x19'))['db'];config['redis']=_[_0x89c2('0x1a')](config[_0x89c2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x89c2('0x1c'))(new Redis(config[_0x89c2('0x1b')]));require(_0x89c2('0x1d'))[_0x89c2('0x1e')](socket);var jayson=require(_0x89c2('0x1f'));var client=jayson[_0x89c2('0x20')][_0x89c2('0x21')]({'port':0x232b});var client9004=jayson['client'][_0x89c2('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x3b0c20,_0x291d9a,_0x12b724,_0x2fd2d5){return new BPromise(function(_0x43ea5,_0x495fa2){var _0x2c6248=_0x2fd2d5||client;return _0x2c6248[_0x89c2('0x22')](_0x3b0c20,_0x12b724)[_0x89c2('0x23')](function(_0x12cbc4){logger[_0x89c2('0x24')](_0x89c2('0x25'),_0x291d9a,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x291d9a,_0x89c2('0x26'),JSON[_0x89c2('0x27')](_0x12cbc4));if(_0x12cbc4[_0x89c2('0x28')]){if(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x29')]===0x1f4){logger[_0x89c2('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x291d9a,_0x12cbc4[_0x89c2('0x28')]['message']);return _0x495fa2(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);}logger[_0x89c2('0x28')](_0x89c2('0x25'),_0x291d9a,_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);return _0x43ea5(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);}else{logger[_0x89c2('0x24')](_0x89c2('0x25'),_0x291d9a,_0x89c2('0x26'));_0x43ea5(_0x12cbc4[_0x89c2('0x2b')][_0x89c2('0x2a')]);}})[_0x89c2('0x2c')](function(_0xeb5b6d){logger[_0x89c2('0x28')](_0x89c2('0x25'),_0x291d9a,_0xeb5b6d);_0x495fa2(_0xeb5b6d);});});}function respondWithStatusCode(_0x151728,_0x566fcd){_0x566fcd=_0x566fcd||0xcc;return function(_0x10c355){if(_0x10c355){return _0x151728['sendStatus'](_0x566fcd);}return _0x151728[_0x89c2('0x2d')](_0x566fcd)[_0x89c2('0x2e')]();};}function respondWithResult(_0x213a5d,_0x2ffa51){_0x2ffa51=_0x2ffa51||0xc8;return function(_0x3f86af){if(_0x3f86af){return _0x213a5d[_0x89c2('0x2d')](_0x2ffa51)['json'](_0x3f86af);}};}function respondWithFilteredResult(_0x50c57f,_0xb471c2){return function(_0xb4114c){if(_0xb4114c){var _0x4b0fe5=typeof _0xb471c2[_0x89c2('0x2f')]==='undefined'&&typeof _0xb471c2[_0x89c2('0x30')]===_0x89c2('0x31');var _0x486ccf=_0xb4114c[_0x89c2('0x32')];var _0x1a7c69=_0x4b0fe5?0x0:_0xb471c2[_0x89c2('0x2f')];var _0x4e9af7=_0x4b0fe5?_0xb4114c['count']:_0xb471c2[_0x89c2('0x2f')]+_0xb471c2[_0x89c2('0x30')];var _0x19a96b;if(_0x4e9af7>=_0x486ccf){_0x4e9af7=_0x486ccf;_0x19a96b=0xc8;}else{_0x19a96b=0xce;}_0x50c57f['status'](_0x19a96b);return _0x50c57f[_0x89c2('0x33')](_0x89c2('0x34'),_0x1a7c69+'-'+_0x4e9af7+'/'+_0x486ccf)[_0x89c2('0x35')](_0xb4114c);}return null;};}function patchUpdates(_0x16f4b2){return function(_0x37a552){try{jsonpatch[_0x89c2('0x36')](_0x37a552,_0x16f4b2,!![]);}catch(_0x29bac4){return BPromise[_0x89c2('0x37')](_0x29bac4);}return _0x37a552[_0x89c2('0x38')]();};}function saveUpdates(_0x4f1e2b,_0x2dbaa0){return function(_0x3513b3){if(_0x3513b3){return _0x3513b3[_0x89c2('0x39')](_0x4f1e2b)[_0x89c2('0x23')](function(_0x194acf){return _0x194acf;});}return null;};}function removeEntity(_0x50481c,_0x146287){return function(_0x100596){if(_0x100596){return _0x100596[_0x89c2('0x3a')]()['then'](function(){_0x50481c[_0x89c2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d10f,_0x31fdf2){return function(_0x4845e3){if(!_0x4845e3){_0x16d10f['sendStatus'](0x194);}return _0x4845e3;};}function handleError(_0x48197b,_0x2fb119){_0x2fb119=_0x2fb119||0x1f4;return function(_0x65e7f4){logger[_0x89c2('0x28')](_0x65e7f4[_0x89c2('0x3b')]);if(_0x65e7f4[_0x89c2('0x3c')]){delete _0x65e7f4[_0x89c2('0x3c')];}_0x48197b[_0x89c2('0x2d')](_0x2fb119)[_0x89c2('0x3d')](_0x65e7f4);};}function getMustacheRender(_0xcb9379,_0x39e20d){return Mustache[_0x89c2('0x3e')](_0xcb9379,_[_0x89c2('0x3f')](_0x39e20d['body'],{'contact':_0x39e20d[_0x89c2('0x40')],'message':_0x39e20d[_0x89c2('0x2a')],'agent':_0x39e20d[_0x89c2('0x41')],'interaction':_0x39e20d[_0x89c2('0x42')],'account':_0x39e20d['account']}))||'';}function getInteractionUsers(_0x8b1c3b,_0x1c27dc){return new BPromise(function(_0x455a08,_0x1bd72f){try{if(_0x1c27dc[_0x8b1c3b['id']]){_0x8b1c3b[_0x89c2('0x43')]=_[_0x89c2('0x44')](_0x1c27dc[_0x8b1c3b['id']],function(_0x1f6d5b){return{'id':_0x1f6d5b['id'],'fullname':_0x1f6d5b['fullname']};});}}catch(_0x31d9c5){_0x1bd72f(_0x31d9c5);}_0x455a08(_0x8b1c3b);});}function getInteractionTags(_0x209e87,_0x54ab17){return new BPromise(function(_0x479a68,_0x3d9300){try{if(_0x209e87['TagIds']){_0x209e87['Tags']=[];_0x209e87[_0x89c2('0x45')][_0x89c2('0x46')](',')['forEach'](function(_0x2546a8){_0x209e87[_0x89c2('0x47')]['push'](_0x54ab17[_0x2546a8]);});}delete _0x209e87['TagIds'];}catch(_0x10ce7d){_0x3d9300(_0x10ce7d);}_0x479a68(_0x209e87);});}function updateChatInteraction(_0x1b15b6,_0x12e5bd,_0x45fc28){return new BPromise(function(_0x94a598,_0x597c49){return getInteractionUsers(_0x1b15b6,_0x45fc28)[_0x89c2('0x23')](function(_0x4333cb){return getInteractionTags(_0x4333cb,_0x12e5bd);})[_0x89c2('0x23')](function(_0x409bfe){return getStateInteraction(_0x409bfe);})[_0x89c2('0x23')](function(_0x1db0d1){_0x94a598(_0x1db0d1);})[_0x89c2('0x2c')](function(_0x2b8ebb){_0x597c49(_0x2b8ebb);});});}function getStateInteraction(_0x44c26c){return new BPromise(function(_0x3b0ed1){_0x44c26c[_0x89c2('0x48')]=0x0;_0x44c26c[_0x89c2('0x49')]=0x0;_0x44c26c[_0x89c2('0x4a')]=0x0;_0x44c26c['unmanaged']=0x0;_0x44c26c[_0x89c2('0x4b')]=0x0;_0x44c26c[_0x89c2('0x4c')]=0x0;if(!_0x44c26c[_0x89c2('0x4d')]&&!_0x44c26c[_0x89c2('0x4e')]){_0x44c26c[_0x89c2('0x48')]+=0x1;}if(!_0x44c26c[_0x89c2('0x4d')]&&_0x44c26c[_0x89c2('0x4e')]){_0x44c26c['talking']+=0x1;if(_0x44c26c['waiting']){_0x44c26c['waiting']-=0x1;}}if(_0x44c26c['closed']&&_0x44c26c['disposition']===_0x89c2('0x4b')){_0x44c26c['abandoned']+=0x1;if(_0x44c26c[_0x89c2('0x48')]){_0x44c26c['waiting']-=0x1;}}else if(_0x44c26c[_0x89c2('0x4d')]&&!_0x44c26c[_0x89c2('0x4e')]&&_0x44c26c[_0x89c2('0x4f')]){_0x44c26c['unmanaged']+=0x1;if(_0x44c26c[_0x89c2('0x48')]){_0x44c26c[_0x89c2('0x48')]-=0x1;}}else if(_0x44c26c[_0x89c2('0x4d')]&&_0x44c26c['UserId']){_0x44c26c[_0x89c2('0x4a')]+=0x1;if(_0x44c26c[_0x89c2('0x49')]){_0x44c26c[_0x89c2('0x49')]-=0x1;}}_0x44c26c[_0x89c2('0x4c')]+=0x1;_0x3b0ed1(_0x44c26c);});}exports['index']=function(_0x411319,_0x462876){var _0x22b372={},_0x64c25f={},_0x3414f2={'count':0x0,'rows':[]};var _0x263cb5=_[_0x89c2('0x44')](db[_0x89c2('0x50')][_0x89c2('0x51')],function(_0x5328b5){return{'name':_0x5328b5[_0x89c2('0x52')],'type':_0x5328b5[_0x89c2('0x53')]['key']};});_0x64c25f['model']=_[_0x89c2('0x44')](_0x263cb5,_0x89c2('0x3c'));_0x64c25f['query']=_[_0x89c2('0x54')](_0x411319[_0x89c2('0x55')]);_0x64c25f['filters']=_['intersection'](_0x64c25f[_0x89c2('0x56')],_0x64c25f['query']);_0x22b372[_0x89c2('0x57')]=_['intersection'](_0x64c25f[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x411319[_0x89c2('0x55')][_0x89c2('0x58')]));_0x22b372[_0x89c2('0x57')]=_0x22b372['attributes'][_0x89c2('0x59')]?_0x22b372[_0x89c2('0x57')]:_0x64c25f['model'];if(!_0x411319[_0x89c2('0x55')][_0x89c2('0x5a')](_0x89c2('0x5b'))){_0x22b372[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x411319[_0x89c2('0x55')][_0x89c2('0x30')]);_0x22b372[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x411319[_0x89c2('0x55')][_0x89c2('0x2f')]);}_0x22b372[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x411319[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x22b372['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x411319['query'],_0x64c25f[_0x89c2('0x5e')]),_0x263cb5);var _0x204819=[];var _0x450f3f=squel['select']()[_0x89c2('0x60')]('id')[_0x89c2('0x60')](_0x89c2('0x3c'))[_0x89c2('0x60')](_0x89c2('0x61'))[_0x89c2('0x62')](_0x89c2('0x63'));var _0x9d8748=squel[_0x89c2('0x64')]()[_0x89c2('0x60')](_0x89c2('0x65'))[_0x89c2('0x60')](_0x89c2('0x66'))[_0x89c2('0x60')](_0x89c2('0x67'))[_0x89c2('0x62')](_0x89c2('0x68'),'ui')[_0x89c2('0x69')](_0x89c2('0x6a'),'u',_0x89c2('0x6b'));var _0xa257e3=squel['select']()[_0x89c2('0x62')]('chat_interactions','i')[_0x89c2('0x69')]('cm_contacts','c',_0x89c2('0x6c'))['left_join'](_0x89c2('0x6a'),'o',_0x89c2('0x6d'))[_0x89c2('0x69')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x89c2('0x69')](_0x89c2('0x6e'),'me',_0x89c2('0x6f'))[_0x89c2('0x69')](_0x89c2('0x70'),'it',_0x89c2('0x71'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3c30aa=squel[_0x89c2('0x72')]();var _0x40fd54=[];var _0x374798=squel[_0x89c2('0x72')]();var _0x15406c;if(_0x411319[_0x89c2('0x55')][_0x89c2('0x73')]){_0x15406c=as[_0x89c2('0x74')](_0x411319[_0x89c2('0x55')][_0x89c2('0x73')]);var _0x24d31b=_0x15406c[_0x89c2('0x75')];for(var _0x517f4f=0x0;_0x517f4f<_0x15406c[_0x89c2('0x76')]['length'];_0x517f4f++){var _0x160648=_0x15406c['conditions'][_0x517f4f];var _0x17a5fd='i';var _0x2c2673=_[_0x89c2('0x77')](_0x263cb5,[_0x89c2('0x3c'),_0x160648[_0x89c2('0x60')]]);if(!_0x2c2673){switch(_0x160648[_0x89c2('0x60')]){case'unreadMessages':if(_0x160648[_0x89c2('0x78')]==0x1){_0xa257e3['having']('`'+_0x160648[_0x89c2('0x60')]+_0x89c2('0x79'));}else{_0xa257e3['having']('`'+_0x160648['field']+'`\x20>\x200');}break;case _0x89c2('0x7a'):if(_0x160648[_0x89c2('0x7b')]==='$substring'){if(_0x160648['value']['split']('\x20')[_0x89c2('0x59')]>0x1){_0x3c30aa[_0x24d31b](_0x89c2('0x7c'),qs[_0x89c2('0x7d')](_0x160648[_0x89c2('0x78')]),null);}else{var _0x77f4e4='%'+_0x160648[_0x89c2('0x78')]+'%';_0x3c30aa[_0x24d31b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x77f4e4,_0x77f4e4,_0x77f4e4);}}else{_0x2c2673=_[_0x89c2('0x77')](_0x263cb5,[_0x89c2('0x3c'),_0x89c2('0x7e')]);_0x160648['field']=_0x89c2('0x7e');_0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673['type'],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')][_0x89c2('0x81')],_0x440473[_0x89c2('0x78')]['end']);}break;case _0x89c2('0x82'):var _0x37c3f4=_0x160648['value'][_0x89c2('0x46')](',')[_0x89c2('0x44')](function(_0x87c736){return Number(_0x87c736);});_0x37c3f4[_0x89c2('0x83')](function(_0x1383c0){_0x374798['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1383c0+',%');});_0x40fd54=_[_0x89c2('0x84')](_0x40fd54,_0x37c3f4);break;case _0x89c2('0x85'):if(_0x160648[_0x89c2('0x7b')]===_0x89c2('0x86')){_0x3c30aa[_0x24d31b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x160648[_0x89c2('0x78')]+'%',null);}else{_0x2c2673=_[_0x89c2('0x77')](_0x263cb5,['name','UserId']);_0x160648['field']=_0x89c2('0x4e');_0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673[_0x89c2('0x53')],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473['value']['start'],_0x440473[_0x89c2('0x78')]['end']);}break;case _0x89c2('0x87'):_0x440473=as[_0x89c2('0x7f')]('me',null,_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')][_0x89c2('0x81')],_0x440473['value'][_0x89c2('0x2e')]);break;}}else{var _0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673[_0x89c2('0x53')],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')]['start'],_0x440473[_0x89c2('0x78')][_0x89c2('0x2e')]);}}}else{var _0xa72ade=_(_0x411319['query'])['keys']()['map'](function(_0x216a7e){return _['some'](_0x263cb5,['name',_0x216a7e])?_0x216a7e:undefined;})[_0x89c2('0x88')]()[_0x89c2('0x78')]();if(!_[_0x89c2('0x89')](_0xa72ade)){_0xa72ade[_0x89c2('0x83')](function(_0x1c0b1a){if(_0x1c0b1a===_0x89c2('0x8a')){_0xa257e3[_0x89c2('0x8b')]('i.ChatWebsiteId\x20IN\x20?',[][_0x89c2('0x8c')](_0x411319[_0x89c2('0x55')][_0x1c0b1a]));}else if(_0x1c0b1a===_0x89c2('0x8d')){var _0x9d1116=JSON['parse'](_0x411319['query'][_0x1c0b1a])[_0x89c2('0x8e')];var _0x532a23=JSON[_0x89c2('0x8f')](_0x411319[_0x89c2('0x55')][_0x1c0b1a])[_0x89c2('0x90')];_0xa257e3[_0x89c2('0x8b')](_0x89c2('0x91'),_0x9d1116,_0x532a23);}else{if(_0x411319[_0x89c2('0x55')][_0x1c0b1a]==='null'){_0xa257e3[_0x89c2('0x8b')]('i.'+_0x1c0b1a+'\x20IS\x20NULL');}else{_0xa257e3[_0x89c2('0x8b')]('i.'+_0x1c0b1a+_0x89c2('0x92'),_0x411319[_0x89c2('0x55')][_0x1c0b1a]);}}});}if(_0x411319[_0x89c2('0x55')]['read']){if(_0x411319[_0x89c2('0x55')][_0x89c2('0x93')]==0x1){_0xa257e3['having'](_0x89c2('0x94'));}else{_0xa257e3['having'](_0x89c2('0x95'));}}if(_0x411319['query'][_0x89c2('0x96')]){_0x40fd54=_['isArray'](_0x411319[_0x89c2('0x55')]['tag'])?_0x411319[_0x89c2('0x55')]['tag']:new Array(_0x411319[_0x89c2('0x55')][_0x89c2('0x96')]);_0x40fd54[_0x89c2('0x83')](function(_0x56715e){_0x374798['or'](_0x89c2('0x97'),'%,'+_0x56715e+',%');});}if(_0x411319[_0x89c2('0x55')][_0x89c2('0x98')]){var _0x574427=_0x411319[_0x89c2('0x55')][_0x89c2('0x98')][_0x89c2('0x99')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x89c2('0x9a')](_0x574427)){_0x3c30aa['or'](_0x89c2('0x9b'),_0x574427+'%');}else{_0x3c30aa['or'](_0x89c2('0x9c'),qs[_0x89c2('0x7d')](_0x574427))['or'](_0x89c2('0x9d'),_0x574427+'%');}}}_0xa257e3['where'](_0x3c30aa);_0xa257e3[_0x89c2('0x9e')](_0x89c2('0x9f'));var _0x1aa623={'type':db[_0x89c2('0xa0')][_0x89c2('0xa1')][_0x89c2('0xa2')],'raw':!![]};var _0x20a427=_0xa257e3[_0x89c2('0xa3')]();_0x20a427[_0x89c2('0x60')]('i.id');_0x20a427[_0x89c2('0x60')](_0x89c2('0xa4'),_0x89c2('0xa5'));if(_0x22b372[_0x89c2('0x5c')]){_0x22b372[_0x89c2('0x5c')][_0x89c2('0x83')](function(_0x59c921){var _0x43dfd3=_0x59c921[0x0]==='contactName'?_0x59c921[0x0]:'i.'+_0x59c921[0x0];_0xa257e3['order'](_0x43dfd3,_0x59c921[0x1]===_0x89c2('0xa6')?![]:!![]);});}if(!_[_0x89c2('0x89')](_0x40fd54)){_0xa257e3[_0x89c2('0xa7')](_0x374798);_0x20a427[_0x89c2('0x8b')](_0x89c2('0xa8'),_0x40fd54);}BPromise[_0x89c2('0xa9')]()['then'](function(){if(!_0x15406c){if(_0x411319[_0x89c2('0x55')][_0x89c2('0x8a')])return;_0x20a427[_0x89c2('0x8b')](_0x89c2('0xaa'));_0xa257e3[_0x89c2('0x8b')](_0x89c2('0xaa'));return;}if(_0x411319[_0x89c2('0xab')][_0x89c2('0xac')]!==_0x89c2('0x41'))return;return _0x411319[_0x89c2('0xab')][_0x89c2('0xad')]({'attributes':['id'],'raw':!![]})[_0x89c2('0x23')](function(_0x48a1f3){if(_[_0x89c2('0x89')](_0x48a1f3)){_0x20a427[_0x89c2('0x8b')](_0x89c2('0xae'));_0xa257e3['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x20a427[_0x89c2('0x8b')](_0x89c2('0xaf'),_[_0x89c2('0x44')](_0x48a1f3,'id'));_0xa257e3[_0x89c2('0x8b')](_0x89c2('0xaf'),_['map'](_0x48a1f3,'id'));}});})[_0x89c2('0x23')](function(){if(_0x411319[_0x89c2('0xab')][_0x89c2('0xac')]==='agent'&&!_0x15406c&&!_0x411319[_0x89c2('0x55')][_0x89c2('0x8a')])return[];return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x20a427['toString'](),_0x1aa623);})[_0x89c2('0x23')](function(_0x3d78b0){_0x3414f2[_0x89c2('0x32')]=_0x3d78b0[_0x89c2('0x59')];if(_0x3414f2['count']===0x0)return[];return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x450f3f[_0x89c2('0xb1')](),_0x1aa623)[_0x89c2('0x23')](function(_0x6baf74){_0x204819=_[_0x89c2('0xb2')](_0x6baf74,'id');_0x1aa623=_['merge'](_0x1aa623,{'model':db[_0x89c2('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x411319[_0x89c2('0x55')][_0x89c2('0x58')]){_0x22b372[_0x89c2('0x57')][_0x89c2('0x83')](function(_0x3f0818){_0xa257e3[_0x89c2('0x60')]('i.'+_0x3f0818);});}else{_0xa257e3[_0x89c2('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x89c2('0xa5'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb3'),_0x89c2('0xb4'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb5'),_0x89c2('0xb6'));_0xa257e3['field'](_0x89c2('0xb7'),_0x89c2('0xb8'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb9'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xba'),_0x89c2('0xbb'));_0xa257e3[_0x89c2('0x60')]('c.lastName',_0x89c2('0xbc'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xbd'),_0x89c2('0xbe'));_0xa257e3['field']('c.phone',_0x89c2('0xbf'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc0'),_0x89c2('0xc1'));_0xa257e3['field'](_0x89c2('0xc2'),'Contact.fax');_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc3'),'Owner.fullname');_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc4'),_0x89c2('0xc5'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc6'),_0x89c2('0x45'));}if(_0x22b372['limit'])_0xa257e3[_0x89c2('0x30')](_0x22b372[_0x89c2('0x30')]);if(_0x22b372['offset'])_0xa257e3[_0x89c2('0x2f')](_0x22b372[_0x89c2('0x2f')]);return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0xa257e3[_0x89c2('0xb1')](),_0x1aa623);})['then'](function(_0x28aae1){if(_0x28aae1[_0x89c2('0x59')]>0x0)_0x9d8748[_0x89c2('0x8b')](_0x89c2('0xc7'),_[_0x89c2('0x44')](_0x28aae1,'id'));return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x9d8748[_0x89c2('0xb1')](),_0x1aa623)[_0x89c2('0x23')](function(_0xfde8cf){var _0x46693a=_[_0x89c2('0xc8')](_0xfde8cf,_0x89c2('0xc9'));var _0x434e57=[];_0x28aae1[_0x89c2('0x83')](function(_0x383f05){_0x434e57[_0x89c2('0xca')](updateChatInteraction(_0x383f05,_0x204819,_0x46693a));});return BPromise[_0x89c2('0xcb')](_0x434e57);});});})[_0x89c2('0x23')](function(_0xe84e59){_0x3414f2[_0x89c2('0xcc')]=_0xe84e59;return _0x3414f2;})[_0x89c2('0x23')](respondWithFilteredResult(_0x462876,_0x22b372))['catch'](handleError(_0x462876,null));};exports['show']=function(_0x51fc47,_0x5251ef){var _0x477ad4={'raw':![],'where':{'id':_0x51fc47[_0x89c2('0xcd')]['id']}},_0x485b7c={};_0x485b7c['model']=_['keys'](db[_0x89c2('0x50')][_0x89c2('0x51')]);_0x485b7c['query']=_[_0x89c2('0x54')](_0x51fc47[_0x89c2('0x55')]);_0x485b7c[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x485b7c[_0x89c2('0x56')],_0x485b7c['query']);_0x477ad4[_0x89c2('0x57')]=_[_0x89c2('0xce')](_0x485b7c[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x51fc47[_0x89c2('0x55')][_0x89c2('0x58')]));_0x477ad4[_0x89c2('0x57')]=_0x477ad4[_0x89c2('0x57')][_0x89c2('0x59')]?_0x477ad4[_0x89c2('0x57')]:_0x485b7c[_0x89c2('0x56')];if(_0x51fc47[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x477ad4[_0x89c2('0xd0')]=[{'all':!![]}];}_0x477ad4=_[_0x89c2('0x3f')]({},_0x477ad4,_0x51fc47['options']);return db[_0x89c2('0x50')][_0x89c2('0x77')](_0x477ad4)['then'](handleEntityNotFound(_0x5251ef,null))[_0x89c2('0x23')](respondWithResult(_0x5251ef,null))[_0x89c2('0x2c')](handleError(_0x5251ef,null));};exports[_0x89c2('0xd1')]=function(_0x1ed96d,_0x1edee1){return db[_0x89c2('0x50')]['create'](_0x1ed96d['body'],{})[_0x89c2('0x23')](respondWithResult(_0x1edee1,0xc9))[_0x89c2('0x2c')](handleError(_0x1edee1,null));};exports[_0x89c2('0x39')]=function(_0x205aa0,_0x50be85){if(_0x205aa0[_0x89c2('0x87')]['id']){delete _0x205aa0[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x205aa0[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x50be85,null))['then'](saveUpdates(_0x205aa0[_0x89c2('0x87')],null))[_0x89c2('0x23')](respondWithResult(_0x50be85,null))[_0x89c2('0x2c')](handleError(_0x50be85,null));};exports[_0x89c2('0x3a')]=function(_0x5cc289,_0x1e2425){return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x5cc289[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x1e2425,null))[_0x89c2('0x23')](removeEntity(_0x1e2425,null))['catch'](handleError(_0x1e2425,null));};exports[_0x89c2('0xd2')]=function(_0x30ebb7,_0x4ea2db){return db[_0x89c2('0x50')][_0x89c2('0xd2')]()['then'](respondWithResult(_0x4ea2db,null))[_0x89c2('0x2c')](handleError(_0x4ea2db,null));};exports[_0x89c2('0xd3')]=function(_0x1c7995,_0x54315e){var _0x53857f=_0x1c7995['params']['id'];var _0x4aa9d9;var _0x195ab6;var _0x5ac656;return db['ChatInteraction']['findOne']({'where':{'id':_0x53857f}})[_0x89c2('0x23')](function(_0x4292e9){_0x4aa9d9=_0x4292e9;return db[_0x89c2('0xd4')][_0x89c2('0xd5')]({'where':{'id':_0x4292e9[_0x89c2('0x8a')]},'attributes':['id',_0x89c2('0xd6'),_0x89c2('0xd7'),'vidaooTopic',_0x89c2('0xd8'),'vidaooMetadata'],'raw':!![]});})[_0x89c2('0x23')](function(_0x5f3ee8){if(_0x5f3ee8&&_0x5f3ee8[_0x89c2('0xd6')]&&_0x5f3ee8[_0x89c2('0xd7')]){_0x195ab6=_0x5f3ee8;var _0x665661={'interaction':{'id':_0x53857f},'agent':{'id':_0x1c7995[_0x89c2('0xab')]['id'],'name':_0x1c7995['user']['name'],'fullname':_0x1c7995[_0x89c2('0xab')][_0x89c2('0xd9')],'email':_0x1c7995['user'][_0x89c2('0xda')]},'contact':_0x1c7995[_0x89c2('0x87')][_0x89c2('0x40')],'account':_0x1c7995[_0x89c2('0x87')][_0x89c2('0xdb')]};var _0x1d0a03={'rejectUnauthorized':![],'method':_0x89c2('0xdc'),'url':_0x89c2('0xdd'),'headers':{'X-APIKEY':_0x5f3ee8['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c7995[_0x89c2('0xab')][_0x89c2('0xda')]],'buttons':null,'topic':_0x195ab6[_0x89c2('0xde')],'note':_['isNull'](_0x195ab6[_0x89c2('0xd8')])?null:getMustacheRender(_0x195ab6[_0x89c2('0xd8')],_0x665661),'metadata':null},'redirect':_0x89c2('0xdf'),'json':!![]};try{if(!_[_0x89c2('0xe0')](_0x195ab6[_0x89c2('0xe1')])){var _0x1b200b=getMustacheRender(_0x195ab6[_0x89c2('0xe1')],_0x665661);var _0x25fd16=JSON[_0x89c2('0x8f')](_0x1b200b);_0x1d0a03['body']['metadata']=_0x25fd16;}}catch(_0xec4261){throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1d0a03);}else{throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xe3'));}})[_0x89c2('0x23')](function(_0x3ec064){_0x5ac656=_0x3ec064;if(_0x5ac656['id']){var _0x50c6ff={'body':_0x5ac656[_0x89c2('0xe4')],'ChatWebsiteId':_0x195ab6['id'],'ChatInteractionId':_0x4aa9d9['id'],'direction':'out','UserId':_0x1c7995[_0x89c2('0xab')]['id']};return db[_0x89c2('0xe5')]['create'](_0x50c6ff,{});}else{throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xe6'));}})[_0x89c2('0x23')](function(){return _0x4aa9d9[_0x89c2('0xe7')]({'vidaooSessionId':_0x5ac656['id']});})['then'](respondWithResult(_0x54315e,null))[_0x89c2('0x2c')](handleError(_0x54315e,null));};exports[_0x89c2('0xe8')]=function(_0x11cbfe,_0x4db820){if(_0x11cbfe[_0x89c2('0x87')]['id']){delete _0x11cbfe[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x11cbfe[_0x89c2('0xcd')]['id']},'include':[{'model':db[_0x89c2('0xe9')],'as':_0x89c2('0x7a')}]})['then'](handleEntityNotFound(_0x4db820,null))[_0x89c2('0x23')](saveUpdates(_0x11cbfe['body'],null))[_0x89c2('0x23')](respondWithResult(_0x4db820,null))[_0x89c2('0x2c')](handleError(_0x4db820,null));};exports[_0x89c2('0xea')]=function(_0x1b4636,_0xfbaa6a,_0x2a3db7){if(_0x1b4636['body']['id']){delete _0x1b4636[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x1b4636[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](function(_0x4f055f){if(!_0x4f055f){logger[_0x89c2('0x28')](_0x89c2('0xeb'),_0x89c2('0xea'),0x194,_0x89c2('0xec'));_0xfbaa6a['sendStatus'](0x194);}else{if(_0x4f055f[_0x89c2('0x4e')]){throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xed'));}}return _0x4f055f;})[_0x89c2('0x23')](function(_0xad0ed){if(_0xad0ed){return _0xad0ed[_0x89c2('0x39')]({'closed':_0x1b4636[_0x89c2('0x87')][_0x89c2('0x4d')],'disposition':_0x1b4636[_0x89c2('0x87')][_0x89c2('0x4f')]})[_0x89c2('0x23')](function(_0xa2af0c){return _0xa2af0c;});}})[_0x89c2('0x23')](function(_0x4092b9){return respondWithRpcPromise(_0x89c2('0xee'),_0x89c2('0xea'),_0x1b4636[_0x89c2('0x87')],client9004);})[_0x89c2('0x23')](respondWithResult(_0xfbaa6a,null))[_0x89c2('0x2c')](handleError(_0xfbaa6a,null));};exports[_0x89c2('0xef')]=function(_0xb033f8,_0x2ad21b,_0x5e2214){_0xb033f8[_0x89c2('0x87')][_0x89c2('0x3c')]=_0xb033f8[_0x89c2('0xf0')][_0x89c2('0xf1')];_0xb033f8[_0x89c2('0x87')][_0x89c2('0xf2')]=_0xb033f8['file'][_0x89c2('0xf3')];_0xb033f8[_0x89c2('0x87')][_0x89c2('0x53')]=_0xb033f8[_0x89c2('0xf0')][_0x89c2('0xf4')];return db[_0x89c2('0xf5')][_0x89c2('0xd1')](_0xb033f8['body'])[_0x89c2('0x23')](respondWithResult(_0x2ad21b,0xc9))[_0x89c2('0x2c')](handleError(_0x2ad21b,null));};exports[_0x89c2('0xf6')]=function(_0x44123a,_0x33c362,_0x346ed7){return db[_0x89c2('0x50')][_0x89c2('0xd5')]({'where':{'id':_0x44123a[_0x89c2('0xcd')]['id']},'raw':!![]})[_0x89c2('0x23')](handleEntityNotFound(_0x33c362,null))[_0x89c2('0x23')](function(_0x1fbbf2){if(_0x1fbbf2){if(_0x1fbbf2['closed']){return _0x33c362[_0x89c2('0x2d')](0x193)[_0x89c2('0x35')]({'status':0x193,'message':_0x89c2('0xf7')});}return db['Attachment'][_0x89c2('0xd5')]({'where':{'id':_0x44123a['query'][_0x89c2('0xf8')]},'raw':!![]})[_0x89c2('0x23')](handleEntityNotFound(_0x33c362,null));}})[_0x89c2('0x23')](function(_0x1d5a3c){if(_0x1d5a3c){var _0x43c7e4=_0x1d5a3c[_0x89c2('0xf9')]!==null;var _0x231911=path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],_0x89c2('0xfc'));if(_0x43c7e4){_0x231911=path[_0x89c2('0xfa')](_0x231911,_0x89c2('0xfd'));}var _0x50d082=path[_0x89c2('0xfa')](_0x231911,_0x1d5a3c[_0x89c2('0xf2')]);return _0x33c362[_0x89c2('0xfe')](_0x50d082);}})[_0x89c2('0x2c')](handleError(_0x33c362,null));};exports['close']=function(_0x2a5bfd,_0x42c416){var _0x200b52=null;var _0x1d1bde=null;var _0x5a119e=null;var _0x67343a=null;if(_0x2a5bfd['body']['id']){delete _0x2a5bfd[_0x89c2('0x87')]['id'];}if(_0x2a5bfd['body']['mailTranscript']){_0x67343a=path['join'](config[_0x89c2('0xfb')],_0x89c2('0xff'),util[_0x89c2('0x100')](_0x89c2('0x101'),Date[_0x89c2('0x102')]()));_0x2a5bfd[_0x89c2('0x87')][_0x89c2('0x103')]=_0x67343a;}return db['ChatInteraction'][_0x89c2('0x77')]({'where':{'id':_0x2a5bfd[_0x89c2('0xcd')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x89c2('0x104'),'include':[{'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85')}]}]})['then'](handleEntityNotFound(_0x42c416,null))[_0x89c2('0x23')](saveUpdates(_0x2a5bfd[_0x89c2('0x87')],null))['then'](function(_0xb6b67b){if(_0xb6b67b){_0x200b52=_0xb6b67b;return db[_0x89c2('0xd4')][_0x89c2('0x77')]({'where':{'id':_0x200b52[_0x89c2('0x8a')]}});}})[_0x89c2('0x23')](function(_0x178b96){if(_0x178b96){_0x5a119e=_0x178b96;return db['CmContact'][_0x89c2('0x77')]({'where':{'id':_0x200b52[_0x89c2('0x7e')]}});}})[_0x89c2('0x23')](function(_0x4d3bc4){if(_0x4d3bc4){_0x1d1bde=_0x4d3bc4;if(_0x67343a){var _0x2c97a3=null;for(var _0x1e3f95=0x1;_0x1e3f95<_0x200b52[_0x89c2('0x104')][_0x89c2('0x59')];++_0x1e3f95){_0x2c97a3=_0x200b52[_0x89c2('0x104')][_0x1e3f95];var _0x5cc4b8=_0x2c97a3['UserId']?util['format'](_0x89c2('0x105'),_0x5a119e['agentAlias'],_0x2c97a3[_0x89c2('0x4e')]):'System';var _0x4de87a=_0x2a5bfd['body'][_0x89c2('0x106')]||util[_0x89c2('0x100')](_0x89c2('0x105'),_0x89c2('0x107'),_0x2c97a3[_0x89c2('0x7e')]);switch(_0x5a119e[_0x89c2('0x108')]){case _0x89c2('0x109'):_0x5cc4b8=_0x2c97a3['UserId']?util['format'](_0x89c2('0x105'),_0x5a119e['agentAlias'],_0x2c97a3[_0x89c2('0x4e')]):'System';break;case'agent_alias':_0x5cc4b8=_0x2c97a3[_0x89c2('0x4e')]?_0x2c97a3['User'][_0x89c2('0x10a')]||_0x2c97a3['User'][_0x89c2('0xd9')]:'System';break;case'agent_fullname':_0x5cc4b8=_0x2c97a3['UserId']?_0x2c97a3[_0x89c2('0x85')]['fullname']:'System';break;default:_0x5cc4b8=_0x2c97a3[_0x89c2('0x4e')]?util['format'](_0x89c2('0x105'),_0x5a119e[_0x89c2('0x10b')],_0x2c97a3[_0x89c2('0x4e')]):'System';}var _0x281ac7=util[_0x89c2('0x100')](_0x89c2('0x10c'),moment(_0x2c97a3['createdAt'])['format'](_0x89c2('0x10d')),_0x2c97a3['direction']==='in'?_0x4de87a:_0x5cc4b8,_0x2c97a3['body']);if(!_0x2c97a3[_0x89c2('0x10e')]){fs[_0x89c2('0x10f')](_0x67343a,_0x281ac7);}}return db[_0x89c2('0x110')][_0x89c2('0xd5')]({'where':{'service':!![]},'include':[{'model':db[_0x89c2('0x111')],'as':_0x89c2('0x112'),'raw':!![]}]});}}})[_0x89c2('0x23')](function(_0x30a373){if(_0x30a373&&_0x30a373[_0x89c2('0x112')]&&_0x2a5bfd[_0x89c2('0x87')]){var _0xcadb9b={'tls':{'rejectUnauthorized':![]}};if(_0x30a373[_0x89c2('0x112')][_0x89c2('0x113')]){_0xcadb9b[_0x89c2('0x113')]=_0x30a373['Smtp']['service'];}else{_0xcadb9b[_0x89c2('0x114')]=_0x30a373['Smtp'][_0x89c2('0x114')];_0xcadb9b[_0x89c2('0x115')]=_0x30a373[_0x89c2('0x112')][_0x89c2('0x115')];_0xcadb9b[_0x89c2('0x116')]=_0x30a373[_0x89c2('0x112')][_0x89c2('0x116')];}if(_0x30a373[_0x89c2('0x112')][_0x89c2('0x117')]){_0xcadb9b[_0x89c2('0x118')]={'user':_0x30a373['Smtp'][_0x89c2('0xab')],'pass':_0x30a373[_0x89c2('0x112')][_0x89c2('0x119')]};}return respondWithRpcPromise('SendMail',_0x89c2('0x11a'),{'account':_0xcadb9b,'message':{'from':util[_0x89c2('0x100')]('\x22%s\x22\x20<%s>',_0x30a373[_0x89c2('0x3c')],_0x30a373['email']||_0x30a373[_0x89c2('0x112')][_0x89c2('0xab')]),'to':_0x2a5bfd['body'][_0x89c2('0x11b')],'subject':_0x89c2('0x11c'),'text':util[_0x89c2('0x100')](_0x89c2('0x11d'),_0x2a5bfd[_0x89c2('0x87')][_0x89c2('0x11b')]),'attachments':[{'path':_0x67343a}]}})[_0x89c2('0x23')](function(){return _0x200b52;})[_0x89c2('0x2c')](function(_0x13b238){console[_0x89c2('0x28')](_0x13b238);});}else{return _0x200b52;}})[_0x89c2('0x23')](respondWithStatusCode(_0x42c416,0xc8))[_0x89c2('0x2c')](handleError(_0x42c416,null));};exports[_0x89c2('0x11e')]=function(_0x432ed5,_0x9c167f,_0x1e3ea9){return db['ChatMessage'][_0x89c2('0x77')]({'where':{'id':_0x432ed5[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x9c167f,null))[_0x89c2('0x23')](function(_0x357eb3){if(_0x357eb3){return _0x357eb3[_0x89c2('0x11e')](_0x432ed5[_0x89c2('0x87')]['ids'],_[_0x89c2('0x11f')](_0x432ed5[_0x89c2('0x87')],[_0x89c2('0x120'),'id'])||{});}})[_0x89c2('0x23')](respondWithResult(_0x9c167f,null))[_0x89c2('0x2c')](handleError(_0x9c167f,null));};exports[_0x89c2('0x121')]=function(_0x1e40b3,_0x3b5bf0,_0x2de895){var _0x295736={'raw':![],'where':{}};var _0x542c35={};var _0x72f079={'count':0x0,'rows':[]};return db[_0x89c2('0x50')][_0x89c2('0xd5')]({'where':{'id':_0x1e40b3[_0x89c2('0xcd')]['id']}})['then'](handleEntityNotFound(_0x3b5bf0,null))['then'](function(_0x123ad2){if(_0x123ad2){_0x542c35['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x542c35[_0x89c2('0x55')]=_[_0x89c2('0x54')](_0x1e40b3['query']);_0x542c35[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x542c35[_0x89c2('0x56')],_0x542c35['query']);_0x295736[_0x89c2('0x57')]=_['intersection'](_0x542c35[_0x89c2('0x56')],qs['fields'](_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x58')]));_0x295736[_0x89c2('0x57')]=_0x295736[_0x89c2('0x57')][_0x89c2('0x59')]?_0x295736['attributes']:_0x542c35[_0x89c2('0x56')];if(!_0x1e40b3[_0x89c2('0x55')]['hasOwnProperty'](_0x89c2('0x5b'))){_0x295736[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x1e40b3['query'][_0x89c2('0x30')]);_0x295736[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x1e40b3[_0x89c2('0x55')]['offset']);}_0x295736[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x295736['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x1e40b3[_0x89c2('0x55')],_0x542c35[_0x89c2('0x5e')]));_0x295736[_0x89c2('0x8b')][_0x89c2('0xc9')]=_0x123ad2['id'];if(_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x98')]){_0x295736[_0x89c2('0x8b')]=_[_0x89c2('0x3f')](_0x295736['where'],{'$or':_[_0x89c2('0x44')](_0x295736[_0x89c2('0x57')],function(_0x137fa3){var _0xe573bf={};_0xe573bf[_0x137fa3]={'$like':'%'+_0x1e40b3[_0x89c2('0x55')]['filter']+'%'};return _0xe573bf;})});}if(_0x1e40b3['query']['$gte']){var _0x4a802f=_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x8e')]['split'](',');var _0x3272b1={};_0x3272b1[_0x4a802f[0x0]]={'$gte':moment(_0x4a802f[0x1])[_0x89c2('0x100')]('YYYY-MM-DD\x20HH:mm:ss')};_0x295736['where']=_[_0x89c2('0x3f')](_0x295736['where'],_0x3272b1);}_0x295736=_[_0x89c2('0x3f')]({},_0x295736,_0x1e40b3['options']);return db[_0x89c2('0xe5')][_0x89c2('0x32')]({'where':_0x295736[_0x89c2('0x8b')]})['then'](function(_0x3b904c){_0x72f079[_0x89c2('0x32')]=_0x3b904c;if(_0x1e40b3[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x295736[_0x89c2('0xd0')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x295736);})[_0x89c2('0x23')](function(_0xd31952){_0x72f079[_0x89c2('0xcc')]=_0xd31952;return _0x72f079;});}})[_0x89c2('0x23')](respondWithFilteredResult(_0x3b5bf0,_0x295736))[_0x89c2('0x2c')](handleError(_0x3b5bf0,null));};exports['getMyMessages']=function(_0x2a0bd6,_0x41de56,_0x5d72b5){var _0x3a08e6={'where':{}},_0x31699d={},_0x4787a6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x89c2('0xd5')]({'where':{'id':_0x2a0bd6[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x41de56,null))[_0x89c2('0x23')](function(_0x5e8006){if(_0x5e8006){_0x31699d[_0x89c2('0x56')]=_[_0x89c2('0x54')](db[_0x89c2('0xe5')][_0x89c2('0x51')]);_0x31699d[_0x89c2('0x55')]=_[_0x89c2('0x54')](_0x2a0bd6[_0x89c2('0x55')]);_0x31699d[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x31699d[_0x89c2('0x56')],_0x31699d['query']);_0x3a08e6[_0x89c2('0x57')]=_[_0x89c2('0xce')](_0x31699d[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x58')]));_0x3a08e6[_0x89c2('0x57')]=_0x3a08e6[_0x89c2('0x57')][_0x89c2('0x59')]?_0x3a08e6[_0x89c2('0x57')]:_0x31699d[_0x89c2('0x56')];if(!_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x5a')](_0x89c2('0x5b'))){_0x3a08e6[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x30')]);_0x3a08e6[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x2f')]);}_0x3a08e6[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x3a08e6['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x2a0bd6[_0x89c2('0x55')],_0x31699d[_0x89c2('0x5e')]));_0x3a08e6[_0x89c2('0x8b')]['ChatInteractionId']=_0x5e8006['id'];if(_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x98')]){_0x3a08e6[_0x89c2('0x8b')]=_[_0x89c2('0x3f')](_0x3a08e6[_0x89c2('0x8b')],{'$or':_['map'](_0x3a08e6[_0x89c2('0x57')],function(_0x1907ac){var _0x110386={};_0x110386[_0x1907ac]={'$like':'%'+_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x98')]+'%'};return _0x110386;})});}_0x3a08e6[_0x89c2('0x8b')][_0x89c2('0x10e')]=![];if(_0x2a0bd6[_0x89c2('0x55')]['id']){_0x3a08e6[_0x89c2('0x8b')]['id']={'$gt':_0x2a0bd6[_0x89c2('0x55')]['id']};}_0x3a08e6=_[_0x89c2('0x3f')]({},_0x3a08e6,_0x2a0bd6[_0x89c2('0x122')]);return db[_0x89c2('0xe5')][_0x89c2('0x32')]({'where':_0x3a08e6[_0x89c2('0x8b')]})[_0x89c2('0x23')](function(_0x5a718b){_0x4787a6[_0x89c2('0x32')]=_0x5a718b;_0x3a08e6[_0x89c2('0xd0')]=[];if(_0x2a0bd6['query'][_0x89c2('0x123')]){_0x3a08e6[_0x89c2('0xd0')]['push']({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85'),'attributes':['id',_0x89c2('0xd9'),'alias']});}if(_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x3a08e6[_0x89c2('0xd0')]=[{'all':!![]}];}return db[_0x89c2('0xe5')][_0x89c2('0x124')](_0x3a08e6);})['then'](function(_0x3500b9){_0x4787a6[_0x89c2('0xcc')]=_0x3500b9;return _0x4787a6;});}})['then'](respondWithFilteredResult(_0x41de56,_0x3a08e6))[_0x89c2('0x2c')](handleError(_0x41de56,null));};exports[_0x89c2('0x125')]=function(_0x24fa43,_0x5cbbe0,_0xa32a){return db['ChatInteraction']['find']({'where':{'id':_0x24fa43[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x5cbbe0,null))[_0x89c2('0x23')](function(_0x2f33a0){if(_0x2f33a0){return _0x2f33a0[_0x89c2('0x126')](_0x24fa43[_0x89c2('0x87')][_0x89c2('0x120')],_[_0x89c2('0x11f')](_0x24fa43[_0x89c2('0x87')],[_0x89c2('0x120'),'id'])||{})[_0x89c2('0x127')](function(){return db[_0x89c2('0x82')]['findAll']({'attributes':['id','name',_0x89c2('0x61')],'where':{'id':_0x24fa43[_0x89c2('0x87')][_0x89c2('0x120')]}});})[_0x89c2('0x23')](function(_0xb004fa){socket[_0x89c2('0x128')]('chatInteractionTags:save',{'id':Number(_0x24fa43[_0x89c2('0xcd')]['id']),'tags':_0xb004fa||[]});return{'id':Number(_0x24fa43[_0x89c2('0xcd')]['id']),'tags':_0xb004fa||[]};});}})[_0x89c2('0x23')](respondWithResult(_0x5cbbe0,null))['catch'](handleError(_0x5cbbe0,null));};exports[_0x89c2('0x129')]=function(_0x24e019,_0x1932eb,_0xc2a389){return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x24e019['params']['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x1932eb,null))[_0x89c2('0x23')](function(_0x31d2d6){if(_0x31d2d6){return _0x31d2d6[_0x89c2('0x129')](_0x24e019['query'][_0x89c2('0x120')]);}})['then'](respondWithStatusCode(_0x1932eb,null))['catch'](handleError(_0x1932eb,null));};exports['download']=function(_0x16f45c,_0x4ce18c){var _0x1a3cfc=moment()[_0x89c2('0x12a')]()[_0x89c2('0xb1')]();var _0x4a16ac=path[_0x89c2('0xfa')](config['root'],_0x89c2('0x12b'),'files','tmp');var _0x4a8fe1=path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],'server','files','attachments');var _0xf9f176=path[_0x89c2('0xfa')](_0x4a16ac,_0x1a3cfc);var _0x14a6ca=util['format']('transcript-%d-%s.zip',_0x16f45c['params']['id'],_0x1a3cfc);var _0x579ef1=path['join'](_0x4a16ac,_0x14a6ca);var _0x13ecf4=[];_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85'),'attributes':['id','fullname'],'raw':!![]});_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0xe9')],'as':_0x89c2('0x7a'),'attributes':['id','firstName',_0x89c2('0x12c')],'raw':!![]});if(_0x16f45c['query']['attachments']){_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0xf5')],'as':_0x89c2('0xf5'),'raw':!![]});}var _0x43cefb=[{'model':db[_0x89c2('0xe5')],'as':_0x89c2('0x104'),'attributes':['id',_0x89c2('0x87'),_0x89c2('0x8d'),'direction',_0x89c2('0x10e'),_0x89c2('0x93')],'include':_0x13ecf4}];_0x43cefb[_0x89c2('0xca')]({'model':db[_0x89c2('0xd4')],'as':'Account','attributes':['id','name']});_0x43cefb[_0x89c2('0xca')]({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x12d'),'attributes':['id','fullname']});return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x16f45c[_0x89c2('0xcd')]['id']},'include':_0x43cefb})[_0x89c2('0x23')](handleEntityNotFound(_0x4ce18c,null))[_0x89c2('0x23')](function(_0x1cb342){if(_0x1cb342){var _0x9b2797=_0x1cb342[_0x89c2('0x12e')]({'plain':!![]});fs[_0x89c2('0x12f')](_0xf9f176);var _0x3b1484={'channel':_0x89c2('0x130'),'account':_0x9b2797[_0x89c2('0x131')][_0x89c2('0x3c')],'agent':_0x9b2797[_0x89c2('0x12d')]?_0x9b2797[_0x89c2('0x12d')][_0x89c2('0xd9')]:_0x89c2('0x132'),'createdAt':moment(_0x9b2797['createdAt'])[_0x89c2('0x100')](_0x89c2('0x133'))[_0x89c2('0xb1')](),'closedAt':_0x9b2797['closed']?moment(_0x9b2797[_0x89c2('0x134')])['format'](_0x89c2('0x133'))[_0x89c2('0xb1')]():'','disposition':_0x9b2797[_0x89c2('0x4f')],'chatInfo':{'browser':_0x9b2797[_0x89c2('0x135')],'os':_0x9b2797['osName'],'referer':_0x9b2797[_0x89c2('0x136')],'customerIp':_0x9b2797[_0x89c2('0x137')],'customerPort':_0x9b2797[_0x89c2('0x138')]?_0x9b2797['customerPort']:_0x89c2('0x132')},'messages':_(_0x9b2797['Messages'])[_0x89c2('0x139')]()[_0x89c2('0x98')]({'secret':![]})[_0x89c2('0x44')](function(_0x1e401b){if(_0x1e401b[_0x89c2('0xf5')]){var _0x2734a4=path[_0x89c2('0xfa')](_0x4a8fe1,_0x1e401b[_0x89c2('0xf5')][_0x89c2('0xf2')]);if(fs['existsSync'](_0x2734a4)){fs[_0x89c2('0x13a')](_0x2734a4)[_0x89c2('0x13b')](fs[_0x89c2('0x13c')](path['join'](_0xf9f176,_0x1e401b['Attachment'][_0x89c2('0xf2')])));}}return{'date':moment(_0x1e401b[_0x89c2('0x8d')])[_0x89c2('0x100')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1e401b[_0x89c2('0x13d')]===_0x89c2('0x13e')?_0x1e401b[_0x89c2('0x85')]?_0x1e401b[_0x89c2('0x85')][_0x89c2('0xd9')]:_0x89c2('0x13f'):_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x140')]+(_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x12c')]?'\x20'+_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x12c')]:''),'body':_0x1e401b['Attachment']?_0x1e401b[_0x89c2('0xf5')][_0x89c2('0xf2')]:_0x1e401b['body'],'direction':_0x1e401b['direction']==='out'?'A':'C','secret':_0x1e401b[_0x89c2('0x10e')],'read':_0x1e401b[_0x89c2('0x93')],'attachment':_0x1e401b[_0x89c2('0xf5')]};})['value']()};return ejs[_0x89c2('0x141')](path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],_0x89c2('0x12b'),_0x89c2('0x142'),'downloadInteraction.ejs'),{'interaction':_0x3b1484})[_0x89c2('0x23')](function(_0xa280ee){var _0x2bd853=path['join'](_0xf9f176,'transcript-'+_0x9b2797['id']+'-'+_0x1a3cfc+_0x89c2('0x143'));var _0x3bdb2f={'path':_0x2bd853,'channel':'Chat','interactionId':_0x9b2797['id']};return pdf['createPdfFromHTML'](_0xa280ee,_0x3bdb2f);})['then'](function(){return new BPromise(function(_0x2ddcea,_0x43b456){zipdir(_0xf9f176,{'saveTo':_0x579ef1},function(_0x26f75c,_0x406872){if(_0x26f75c)return _0x43b456(_0x26f75c);return _0x2ddcea(_0x406872);});})['then'](function(){return new BPromise(function(_0x59b00b,_0x432750){rimraf(_0xf9f176,function(_0xadb9ce){if(_0xadb9ce)_0x432750(_0xadb9ce);return _0x59b00b();});});})[_0x89c2('0x23')](function(){return _0x4ce18c[_0x89c2('0xfe')](_0x579ef1,_0x14a6ca,function(_0x3aae4e){if(_0x3aae4e){console[_0x89c2('0x144')](_0x89c2('0x145'),_0x3aae4e);}else{fs['unlinkSync'](_0x579ef1);}});});});}else{return _0x4ce18c[_0x89c2('0x146')](0xc8);}})[_0x89c2('0x2c')](handleError(_0x4ce18c,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 73c955e..942830e 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 _0xe0a9=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x1153b2,_0x4d86c7){var _0x3d8849=function(_0xc15480){while(--_0xc15480){_0x1153b2['push'](_0x1153b2['shift']());}};_0x3d8849(++_0x4d86c7);}(_0xe0a9,0x147));var _0x9e0a=function(_0xd0fe83,_0x291378){_0xd0fe83=_0xd0fe83-0x0;var _0x578343=_0xe0a9[_0xd0fe83];return _0x578343;};'use strict';var EventEmitter=require(_0x9e0a('0x0'));var ChatInteraction=require(_0x9e0a('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x9e0a('0x1'))['db'][_0x9e0a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9e0a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e0a('0x4'),'afterDestroy':_0x9e0a('0x5')};function emitEvent(_0x2073e1){return function(_0x41fe0d,_0x595499,_0x4a4a02){_0x41fe0d[_0x9e0a('0x6')]({'attributes':['id'],'raw':!![]})[_0x9e0a('0x7')](function(_0x1976b5){_0x41fe0d[_0x9e0a('0x8')](_0x9e0a('0x9'),_0x1976b5[_0x9e0a('0xa')](function(_0x1f552e){return{'id':_0x1f552e['id']};}));return ChatMessage[_0x9e0a('0xb')]({'where':{'ChatInteractionId':_0x41fe0d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e0a('0x7')](function(_0x197717){_0x41fe0d[_0x9e0a('0x8')](_0x9e0a('0xc'),_0x197717[_0x9e0a('0xd')]);ChatInteractionEvents[_0x9e0a('0xe')](_0x2073e1+':'+_0x41fe0d['id'],_0x41fe0d);ChatInteractionEvents[_0x9e0a('0xe')](_0x2073e1,_0x41fe0d);_0x4a4a02(null);})[_0x9e0a('0xf')](_0x4a4a02(null));};}for(var e in events){if(events[_0x9e0a('0x10')](e)){var event=events[e];ChatInteraction[_0x9e0a('0x11')](e,emitEvent(event));}}module[_0x9e0a('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xcc94=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x36c44c,_0x4d7903){var _0x5b3d18=function(_0x1e2c71){while(--_0x1e2c71){_0x36c44c['push'](_0x36c44c['shift']());}};_0x5b3d18(++_0x4d7903);}(_0xcc94,0xbb));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x4cc9('0x0'));var ChatInteraction=require(_0x4cc9('0x1'))['db'][_0x4cc9('0x2')];var ChatMessage=require(_0x4cc9('0x1'))['db'][_0x4cc9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4cc9('0x4')](0x0);var events={'afterCreate':_0x4cc9('0x5'),'afterUpdate':_0x4cc9('0x6'),'afterDestroy':_0x4cc9('0x7')};function emitEvent(_0x185147){return function(_0x1b970e,_0x4443fc,_0x22ecb6){_0x1b970e['getUsers']({'attributes':['id'],'raw':!![]})[_0x4cc9('0x8')](function(_0x45b86a){_0x1b970e['setDataValue'](_0x4cc9('0x9'),_0x45b86a[_0x4cc9('0xa')](function(_0x532dca){return{'id':_0x532dca['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1b970e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4cc9('0x8')](function(_0x516369){_0x1b970e['setDataValue'](_0x4cc9('0xb'),_0x516369['length']);ChatInteractionEvents['emit'](_0x185147+':'+_0x1b970e['id'],_0x1b970e);ChatInteractionEvents[_0x4cc9('0xc')](_0x185147,_0x1b970e);_0x22ecb6(null);})[_0x4cc9('0xd')](_0x22ecb6(null));};}for(var e in events){if(events[_0x4cc9('0xe')](e)){var event=events[e];ChatInteraction[_0x4cc9('0xf')](e,emitEvent(event));}}module[_0x4cc9('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 766593d..066c325 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 _0x8c30=['closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','path','rimraf','../../config/environment','exports','define','chat_interactions'];(function(_0x491d42,_0x298349){var _0x5390fa=function(_0x16fafa){while(--_0x16fafa){_0x491d42['push'](_0x491d42['shift']());}};_0x5390fa(++_0x298349);}(_0x8c30,0x157));var _0x08c3=function(_0x260ca5,_0x6276b5){_0x260ca5=_0x260ca5-0x0;var _0xb0d5da=_0x8c30[_0x260ca5];return _0xb0d5da;};'use strict';var _=require(_0x08c3('0x0'));var util=require('util');var logger=require(_0x08c3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08c3('0x2'));var rimraf=require(_0x08c3('0x3'));var config=require(_0x08c3('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x08c3('0x5')]=function(_0x248ae2,_0x3597d9){return _0x248ae2[_0x08c3('0x6')]('ChatInteraction',attributes,{'tableName':_0x08c3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34af77,_0x5dbb1d,_0x1ea228){if(_0x34af77['changed'](_0x08c3('0x8'))){_0x34af77[_0x08c3('0x9')]=moment()[_0x08c3('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ea228(null,_0x34af77);}},'charset':_0x08c3('0xb'),'collate':_0x08c3('0xc')});}; \ No newline at end of file +var _0xceea=['./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','utf8mb4','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceea,0x182));var _0xacee=function(_0x54c902,_0x16cc09){_0x54c902=_0x54c902-0x0;var _0x400037=_0xceea[_0x54c902];return _0x400037;};'use strict';var _=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var logger=require(_0xacee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacee('0x3'));var fs=require('fs');var path=require(_0xacee('0x4'));var rimraf=require(_0xacee('0x5'));var config=require('../../config/environment');var attributes=require(_0xacee('0x6'));module[_0xacee('0x7')]=function(_0x3fccae,_0x43344f){return _0x3fccae[_0xacee('0x8')]('ChatInteraction',attributes,{'tableName':_0xacee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ddb0d,_0x4af2d9,_0xd9db7a){if(_0x4ddb0d[_0xacee('0xa')](_0xacee('0xb'))){_0x4ddb0d[_0xacee('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xd9db7a(null,_0x4ddb0d);}},'charset':_0xacee('0xd'),'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 47b6e8a..13e4432 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 _0x3762=['spread','AddTags','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','limit','AddTagsToChatInteraction','addTags','ids','omit'];(function(_0x251336,_0x163f73){var _0x271321=function(_0x4e1c36){while(--_0x4e1c36){_0x251336['push'](_0x251336['shift']());}};_0x271321(++_0x163f73);}(_0x3762,0x160));var _0x2376=function(_0x257c39,_0x52a7a3){_0x257c39=_0x257c39-0x0;var _0x4d1a98=_0x3762[_0x257c39];return _0x4d1a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2376('0x0'));var BPromise=require('bluebird');var rs=require(_0x2376('0x1'));var fs=require('fs');var Redis=require(_0x2376('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2376('0x3'))('rpc');var config=require(_0x2376('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2376('0x5')][_0x2376('0x6')]({'port':0x232a});config['redis']=_[_0x2376('0x7')](config[_0x2376('0x8')],{'host':_0x2376('0x9'),'port':0x18eb});var socket=require(_0x2376('0xa'))(new Redis(config[_0x2376('0x8')]));require('./chatInteraction.socket')[_0x2376('0xb')](socket);function respondWithRpcPromise(_0x4e192f,_0x3ca76c,_0xf2b9ac){return new BPromise(function(_0x43e8f,_0x24eba7){return client['request'](_0x4e192f,_0xf2b9ac)['then'](function(_0x538026){logger['info'](_0x2376('0xc'),_0x3ca76c,_0x2376('0xd'));logger[_0x2376('0xe')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ca76c,_0x2376('0xd'),JSON[_0x2376('0xf')](_0x538026));if(_0x538026[_0x2376('0x10')]){if(_0x538026['error'][_0x2376('0x11')]===0x1f4){logger[_0x2376('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x3ca76c,_0x538026[_0x2376('0x10')]['message']);return _0x24eba7(_0x538026['error'][_0x2376('0x12')]);}logger[_0x2376('0x10')](_0x2376('0xc'),_0x3ca76c,_0x538026[_0x2376('0x10')][_0x2376('0x12')]);return _0x43e8f(_0x538026['error'][_0x2376('0x12')]);}else{logger[_0x2376('0x13')](_0x2376('0xc'),_0x3ca76c,_0x2376('0xd'));_0x43e8f(_0x538026[_0x2376('0x14')][_0x2376('0x12')]);}})[_0x2376('0x15')](function(_0x47a050){logger[_0x2376('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x3ca76c,_0x47a050);_0x24eba7(_0x47a050);});});}exports[_0x2376('0x16')]=function(_0x3def36){var _0x48df83=this;return new Promise(function(_0x24271b,_0x4d35c2){return db[_0x2376('0x17')]['update'](_0x3def36[_0x2376('0x18')],{'raw':_0x3def36[_0x2376('0x19')]?_0x3def36[_0x2376('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3def36['options']?_0x3def36[_0x2376('0x19')][_0x2376('0x1a')]||null:null,'attributes':_0x3def36[_0x2376('0x19')]?_0x3def36[_0x2376('0x19')][_0x2376('0x1b')]||null:null,'limit':_0x3def36[_0x2376('0x19')]?_0x3def36['options'][_0x2376('0x1c')]||null:null})['then'](function(_0x2ca562){logger[_0x2376('0x13')]('UpdateChatInteraction',_0x3def36);logger[_0x2376('0xe')](_0x2376('0x16'),_0x3def36,JSON[_0x2376('0xf')](_0x2ca562));_0x24271b(_0x2ca562);})[_0x2376('0x15')](function(_0x338f28){logger[_0x2376('0x10')](_0x2376('0x16'),_0x338f28['message'],_0x3def36);_0x4d35c2(_0x48df83['error'](0x1f4,_0x338f28['message']));});});};exports[_0x2376('0x1d')]=function(_0x4d172f){return new Promise(function(_0xea4d07,_0x192a98){return db[_0x2376('0x17')]['find']({'where':_0x4d172f[_0x2376('0x19')]?_0x4d172f[_0x2376('0x19')][_0x2376('0x1a')]||null:null})['then'](function(_0x50da87){if(_0x50da87){return _0x50da87[_0x2376('0x1e')](_0x4d172f[_0x2376('0x18')][_0x2376('0x1f')],_[_0x2376('0x20')](_0x4d172f['body'],[_0x2376('0x1f'),'id'])||{});}})[_0x2376('0x21')](function(_0x5f535c){logger[_0x2376('0x13')](_0x2376('0x22'),_0x4d172f);logger[_0x2376('0xe')](_0x2376('0x22'),_0x4d172f,JSON[_0x2376('0xf')](_0x5f535c));_0xea4d07(_0x5f535c);})[_0x2376('0x15')](function(_0x19b185){logger[_0x2376('0x10')](_0x2376('0x22'),_0x19b185[_0x2376('0x12')],_0x4d172f);_0x192a98(_this[_0x2376('0x10')](0x1f4,_0x19b185[_0x2376('0x12')]));});});}; \ No newline at end of file +var _0xbb79=['../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','ChatInteraction','find','ids','omit','AddTags','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0xbb79,0xe6));var _0x9bb7=function(_0x3432bb,_0x33ecb4){_0x3432bb=_0x3432bb-0x0;var _0x453937=_0xbb79[_0x3432bb];return _0x453937;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9bb7('0x0'));var BPromise=require('bluebird');var rs=require(_0x9bb7('0x1'));var fs=require('fs');var Redis=require(_0x9bb7('0x2'));var db=require(_0x9bb7('0x3'))['db'];var utils=require(_0x9bb7('0x4'));var logger=require(_0x9bb7('0x5'))(_0x9bb7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9bb7('0x7')][_0x9bb7('0x8')]({'port':0x232a});config['redis']=_[_0x9bb7('0x9')](config[_0x9bb7('0xa')],{'host':_0x9bb7('0xb'),'port':0x18eb});var socket=require(_0x9bb7('0xc'))(new Redis(config[_0x9bb7('0xa')]));require(_0x9bb7('0xd'))[_0x9bb7('0xe')](socket);function respondWithRpcPromise(_0x16a89f,_0x246414,_0x748146){return new BPromise(function(_0x525267,_0x5d620c){return client[_0x9bb7('0xf')](_0x16a89f,_0x748146)[_0x9bb7('0x10')](function(_0x36b89a){logger[_0x9bb7('0x11')](_0x9bb7('0x12'),_0x246414,'request\x20sent');logger[_0x9bb7('0x13')](_0x9bb7('0x14'),_0x246414,_0x9bb7('0x15'),JSON['stringify'](_0x36b89a));if(_0x36b89a[_0x9bb7('0x16')]){if(_0x36b89a[_0x9bb7('0x16')]['code']===0x1f4){logger[_0x9bb7('0x16')](_0x9bb7('0x12'),_0x246414,_0x36b89a[_0x9bb7('0x16')][_0x9bb7('0x17')]);return _0x5d620c(_0x36b89a['error'][_0x9bb7('0x17')]);}logger[_0x9bb7('0x16')](_0x9bb7('0x12'),_0x246414,_0x36b89a[_0x9bb7('0x16')]['message']);return _0x525267(_0x36b89a[_0x9bb7('0x16')][_0x9bb7('0x17')]);}else{logger[_0x9bb7('0x11')](_0x9bb7('0x12'),_0x246414,_0x9bb7('0x15'));_0x525267(_0x36b89a['result'][_0x9bb7('0x17')]);}})[_0x9bb7('0x18')](function(_0x118868){logger[_0x9bb7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x246414,_0x118868);_0x5d620c(_0x118868);});});}exports[_0x9bb7('0x19')]=function(_0x47fff4){var _0x2cfb84=this;return new Promise(function(_0x456f77,_0x49429d){return db['ChatInteraction'][_0x9bb7('0x1a')](_0x47fff4[_0x9bb7('0x1b')],{'raw':_0x47fff4['options']?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47fff4['options']?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1e')]||null:null,'attributes':_0x47fff4[_0x9bb7('0x1c')]?_0x47fff4[_0x9bb7('0x1c')]['attributes']||null:null,'limit':_0x47fff4[_0x9bb7('0x1c')]?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1f')]||null:null})[_0x9bb7('0x10')](function(_0x363bc2){logger[_0x9bb7('0x11')]('UpdateChatInteraction',_0x47fff4);logger['debug'](_0x9bb7('0x19'),_0x47fff4,JSON[_0x9bb7('0x20')](_0x363bc2));_0x456f77(_0x363bc2);})[_0x9bb7('0x18')](function(_0x5db07b){logger[_0x9bb7('0x16')]('UpdateChatInteraction',_0x5db07b[_0x9bb7('0x17')],_0x47fff4);_0x49429d(_0x2cfb84[_0x9bb7('0x16')](0x1f4,_0x5db07b[_0x9bb7('0x17')]));});});};exports[_0x9bb7('0x21')]=function(_0x21696e){return new Promise(function(_0x58fc25,_0x2df05e){return db[_0x9bb7('0x22')][_0x9bb7('0x23')]({'where':_0x21696e[_0x9bb7('0x1c')]?_0x21696e[_0x9bb7('0x1c')]['where']||null:null})['then'](function(_0x96c5b8){if(_0x96c5b8){return _0x96c5b8['addTags'](_0x21696e['body'][_0x9bb7('0x24')],_[_0x9bb7('0x25')](_0x21696e[_0x9bb7('0x1b')],[_0x9bb7('0x24'),'id'])||{});}})['spread'](function(_0x4aa4d3){logger[_0x9bb7('0x11')]('AddTags',_0x21696e);logger['debug'](_0x9bb7('0x26'),_0x21696e,JSON[_0x9bb7('0x20')](_0x4aa4d3));_0x58fc25(_0x4aa4d3);})[_0x9bb7('0x18')](function(_0x3e1d24){logger['error'](_0x9bb7('0x26'),_0x3e1d24[_0x9bb7('0x17')],_0x21696e);_0x2df05e(_this['error'](0x1f4,_0x3e1d24[_0x9bb7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 693b27d..db47e5c 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 _0x1285=['emit','length','chatInteraction:','save','update'];(function(_0x36f9dd,_0x33e0f5){var _0x7e5fac=function(_0x30a0ad){while(--_0x30a0ad){_0x36f9dd['push'](_0x36f9dd['shift']());}};_0x7e5fac(++_0x33e0f5);}(_0x1285,0x148));var _0x5128=function(_0x32e972,_0x4f19ae){_0x32e972=_0x32e972-0x0;var _0x35443e=_0x1285[_0x32e972];return _0x35443e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x5128('0x0'),'remove',_0x5128('0x1')];function createListener(_0xb91690,_0x1544d6){return function(_0x2984fd){_0x1544d6[_0x5128('0x2')](_0xb91690,_0x2984fd);};}function removeListener(_0x362881,_0x52f1c0){return function(){ChatInteractionEvents['removeListener'](_0x362881,_0x52f1c0);};}exports['register']=function(_0x447887){for(var _0x1a3541=0x0,_0x10cb07=events[_0x5128('0x3')];_0x1a3541<_0x10cb07;_0x1a3541++){var _0x5bb408=events[_0x1a3541];var _0x35410b=createListener(_0x5128('0x4')+_0x5bb408,_0x447887);ChatInteractionEvents['on'](_0x5bb408,_0x35410b);}}; \ No newline at end of file +var _0x4ddb=['save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x55de6d,_0x1eee4a){var _0xfe762c=function(_0x31be88){while(--_0x31be88){_0x55de6d['push'](_0x55de6d['shift']());}};_0xfe762c(++_0x1eee4a);}(_0x4ddb,0x168));var _0xb4dd=function(_0x1a4cac,_0x116f47){_0x1a4cac=_0x1a4cac-0x0;var _0x142f2f=_0x4ddb[_0x1a4cac];return _0x142f2f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb4dd('0x0'),_0xb4dd('0x1'),_0xb4dd('0x2')];function createListener(_0x3ae1e4,_0x145fc3){return function(_0x2a4d94){_0x145fc3[_0xb4dd('0x3')](_0x3ae1e4,_0x2a4d94);};}function removeListener(_0x562ef3,_0x489307){return function(){ChatInteractionEvents[_0xb4dd('0x4')](_0x562ef3,_0x489307);};}exports[_0xb4dd('0x5')]=function(_0x39d2a4){for(var _0x4e7d49=0x0,_0x8f8708=events[_0xb4dd('0x6')];_0x4e7d49<_0x8f8708;_0x4e7d49++){var _0x1fb8c8=events[_0x4e7d49];var _0x1b0c5c=createListener(_0xb4dd('0x7')+_0x1fb8c8,_0x39d2a4);ChatInteractionEvents['on'](_0x1fb8c8,_0x1b0c5c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3d738a8..c5053ee 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 _0x5274=['root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x5274,0x1e5));var _0x4527=function(_0x40f09a,_0x3743b6){_0x40f09a=_0x40f09a-0x0;var _0x2eb96c=_0x5274[_0x40f09a];return _0x2eb96c;};'use strict';var multer=require(_0x4527('0x0'));var util=require('util');var path=require(_0x4527('0x1'));var timeout=require(_0x4527('0x2'));var express=require(_0x4527('0x3'));var router=express[_0x4527('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4527('0x5'));var config=require(_0x4527('0x6'));var controller=require('./chatInteraction.controller');router[_0x4527('0x7')]('/',auth['isAuthenticated'](),controller[_0x4527('0x8')]);router['get'](_0x4527('0x9'),auth[_0x4527('0xa')](),controller[_0x4527('0xb')]);router[_0x4527('0x7')](_0x4527('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x4527('0xd')]);router[_0x4527('0x7')](_0x4527('0xe'),auth[_0x4527('0xf')](),controller[_0x4527('0x10')]);router[_0x4527('0x7')]('/:id/messages',auth[_0x4527('0xa')](),controller[_0x4527('0x11')]);router[_0x4527('0x7')](_0x4527('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x4527('0x7')](_0x4527('0x13'),auth[_0x4527('0xa')](),controller['download']);router[_0x4527('0x14')]('/',auth[_0x4527('0xa')](),controller[_0x4527('0x15')]);router[_0x4527('0x14')](_0x4527('0x16'),auth[_0x4527('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4527('0x17')]({'destination':function(_0x1d9901,_0x4a6340,_0x48eb9c){_0x48eb9c(null,path[_0x4527('0x18')](config[_0x4527('0x19')],'server/files/attachments/'));},'filename':function(_0x45b2eb,_0xae7e29,_0x60a625){_0x60a625(null,util[_0x4527('0x1a')](_0x4527('0x1b'),Date['now'](),_0xae7e29[_0x4527('0x1c')][_0x4527('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4527('0x14')](_0x4527('0x1e'),upload[_0x4527('0x1f')]('file'),controller[_0x4527('0x20')]);router[_0x4527('0x14')](_0x4527('0x21'),auth[_0x4527('0xf')](),controller[_0x4527('0x22')]);router[_0x4527('0x14')](_0x4527('0x23'),auth[_0x4527('0xa')](),interaction[_0x4527('0x24')]('chat',_0x4527('0x25')),controller[_0x4527('0x26')]);router[_0x4527('0x27')](_0x4527('0xc'),auth['isAuthenticated'](),interaction[_0x4527('0x24')](_0x4527('0x28'),_0x4527('0x29')),controller[_0x4527('0x2a')]);router[_0x4527('0x27')](_0x4527('0x2b'),controller[_0x4527('0x2c')]);router[_0x4527('0x27')](_0x4527('0x2d'),auth[_0x4527('0xf')](),controller[_0x4527('0x2e')]);router[_0x4527('0x27')]('/:id/close',controller['close']);router[_0x4527('0x2f')](_0x4527('0xc'),auth[_0x4527('0xa')](),interaction['tracked']('chat',_0x4527('0x30')),controller[_0x4527('0x31')]);router[_0x4527('0x2f')]('/:id/tags',auth[_0x4527('0xa')](),controller['removeTags']);module[_0x4527('0x32')]=router; \ No newline at end of file +var _0x957c=['addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','format','now','/:id/attachment_upload','single','attachmentUpload'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x957c,0x1b3));var _0xc957=function(_0x383a11,_0x32b5c1){_0x383a11=_0x383a11-0x0;var _0xcb47ca=_0x957c[_0x383a11];return _0xcb47ca;};'use strict';var multer=require('multer');var util=require(_0xc957('0x0'));var path=require(_0xc957('0x1'));var timeout=require('connect-timeout');var express=require(_0xc957('0x2'));var router=express[_0xc957('0x3')]();var fs_extra=require(_0xc957('0x4'));var auth=require(_0xc957('0x5'));var interaction=require(_0xc957('0x6'));var config=require(_0xc957('0x7'));var controller=require(_0xc957('0x8'));router[_0xc957('0x9')]('/',auth[_0xc957('0xa')](),controller['index']);router['get'](_0xc957('0xb'),auth[_0xc957('0xa')](),controller[_0xc957('0xc')]);router['get']('/:id',auth[_0xc957('0xd')](),controller[_0xc957('0xe')]);router[_0xc957('0x9')](_0xc957('0xf'),auth[_0xc957('0xd')](),controller[_0xc957('0x10')]);router[_0xc957('0x9')](_0xc957('0x11'),auth['isAuthenticated'](),controller[_0xc957('0x12')]);router[_0xc957('0x9')](_0xc957('0x13'),auth[_0xc957('0xd')](),controller[_0xc957('0x14')]);router[_0xc957('0x9')](_0xc957('0x15'),auth[_0xc957('0xa')](),controller[_0xc957('0x16')]);router[_0xc957('0x17')]('/',auth['isAuthenticated'](),controller[_0xc957('0x18')]);router['post']('/:id/vidaoo',auth[_0xc957('0xa')](),controller[_0xc957('0x19')]);var upload=multer({'storage':multer[_0xc957('0x1a')]({'destination':function(_0x52c03f,_0x20c539,_0x52eac3){_0x52eac3(null,path[_0xc957('0x1b')](config['root'],'server/files/attachments/'));},'filename':function(_0x35b35c,_0x4365b3,_0x591297){_0x591297(null,util[_0xc957('0x1c')]('%s-%s',Date[_0xc957('0x1d')](),_0x4365b3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc957('0x17')](_0xc957('0x1e'),upload[_0xc957('0x1f')]('file'),controller[_0xc957('0x20')]);router[_0xc957('0x17')](_0xc957('0x11'),auth[_0xc957('0xd')](),controller[_0xc957('0x21')]);router[_0xc957('0x17')](_0xc957('0x22'),auth[_0xc957('0xa')](),interaction[_0xc957('0x23')](_0xc957('0x24'),'chatinteraction:addtags'),controller[_0xc957('0x25')]);router[_0xc957('0x26')](_0xc957('0x27'),auth[_0xc957('0xa')](),interaction['tracked'](_0xc957('0x24'),_0xc957('0x28')),controller[_0xc957('0x29')]);router['put']('/:id/custom_update',controller[_0xc957('0x2a')]);router[_0xc957('0x26')](_0xc957('0x2b'),auth[_0xc957('0xd')](),controller[_0xc957('0x2c')]);router['put'](_0xc957('0x2d'),controller[_0xc957('0x2e')]);router[_0xc957('0x2f')](_0xc957('0x27'),auth[_0xc957('0xa')](),interaction['tracked']('chat',_0xc957('0x30')),controller[_0xc957('0x31')]);router[_0xc957('0x2f')](_0xc957('0x22'),auth[_0xc957('0xa')](),controller[_0xc957('0x32')]);module[_0xc957('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d4f6371..2140584 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 _0x8104=['medium','INTEGER','sequelize','exports'];(function(_0x29ced0,_0x152d0b){var _0x1b068e=function(_0x2ff695){while(--_0x2ff695){_0x29ced0['push'](_0x29ced0['shift']());}};_0x1b068e(++_0x152d0b);}(_0x8104,0x11a));var _0x4810=function(_0x227d77,_0x353e99){_0x227d77=_0x227d77-0x0;var _0x4e44fb=_0x8104[_0x227d77];return _0x4e44fb;};'use strict';var Sequelize=require(_0x4810('0x0'));module[_0x4810('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4810('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4810('0x3')]}}; \ No newline at end of file +var _0x5558=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0xb2a0a8,_0x50666a){var _0x4668cd=function(_0x3b6ec7){while(--_0x3b6ec7){_0xb2a0a8['push'](_0xb2a0a8['shift']());}};_0x4668cd(++_0x50666a);}(_0x5558,0x197));var _0x8555=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5558[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x8555('0x0'));module['exports']={'body':{'type':Sequelize[_0x8555('0x1')](_0x8555('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8555('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8555('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0e2ea36..e4d0bf7 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 _0x1e30=['socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','keys','find','create','update','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x1e30,0xc3));var _0x01e3=function(_0x67b465,_0x255653){_0x67b465=_0x67b465-0x0;var _0x3ed15f=_0x1e30[_0x67b465];return _0x3ed15f;};'use strict';var emlformat=require(_0x01e3('0x0'));var rimraf=require(_0x01e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01e3('0x2'));var rp=require(_0x01e3('0x3'));var moment=require(_0x01e3('0x4'));var BPromise=require(_0x01e3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01e3('0x6'));var sox=require(_0x01e3('0x7'));var csv=require(_0x01e3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01e3('0x9'));var _=require(_0x01e3('0xa'));var squel=require(_0x01e3('0xb'));var crypto=require(_0x01e3('0xc'));var jsforce=require(_0x01e3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x01e3('0xe'));var Papa=require(_0x01e3('0xf'));var Redis=require(_0x01e3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x01e3('0x11'));var hardwareService=require(_0x01e3('0x12'));var logger=require(_0x01e3('0x13'))(_0x01e3('0x14'));var utils=require(_0x01e3('0x15'));var config=require(_0x01e3('0x16'));var licenseUtil=require(_0x01e3('0x17'));var db=require('../../mysqldb')['db'];config[_0x01e3('0x18')]=_[_0x01e3('0x19')](config[_0x01e3('0x18')],{'host':_0x01e3('0x1a'),'port':0x18eb});var socket=require(_0x01e3('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x01e3('0x1c')](socket);function respondWithStatusCode(_0x57e0f7,_0x1798e0){_0x1798e0=_0x1798e0||0xcc;return function(_0x330e9a){if(_0x330e9a){return _0x57e0f7[_0x01e3('0x1d')](_0x1798e0);}return _0x57e0f7[_0x01e3('0x1e')](_0x1798e0)[_0x01e3('0x1f')]();};}function respondWithResult(_0x14afe9,_0x4c94f4){_0x4c94f4=_0x4c94f4||0xc8;return function(_0x73d201){if(_0x73d201){return _0x14afe9[_0x01e3('0x1e')](_0x4c94f4)[_0x01e3('0x20')](_0x73d201);}};}function respondWithFilteredResult(_0x23c431,_0x1b8213){return function(_0x2811fc){if(_0x2811fc){var _0x10e975=typeof _0x1b8213[_0x01e3('0x21')]==='undefined'&&typeof _0x1b8213[_0x01e3('0x22')]===_0x01e3('0x23');var _0x1328cc=_0x2811fc[_0x01e3('0x24')];var _0xa33cb8=_0x10e975?0x0:_0x1b8213[_0x01e3('0x21')];var _0x5cb307=_0x10e975?_0x2811fc['count']:_0x1b8213[_0x01e3('0x21')]+_0x1b8213[_0x01e3('0x22')];var _0x542501;if(_0x5cb307>=_0x1328cc){_0x5cb307=_0x1328cc;_0x542501=0xc8;}else{_0x542501=0xce;}_0x23c431[_0x01e3('0x1e')](_0x542501);return _0x23c431[_0x01e3('0x25')](_0x01e3('0x26'),_0xa33cb8+'-'+_0x5cb307+'/'+_0x1328cc)[_0x01e3('0x20')](_0x2811fc);}return null;};}function patchUpdates(_0x44bc65){return function(_0x537a8b){try{jsonpatch['apply'](_0x537a8b,_0x44bc65,!![]);}catch(_0x5ef9cc){return BPromise[_0x01e3('0x27')](_0x5ef9cc);}return _0x537a8b[_0x01e3('0x28')]();};}function saveUpdates(_0x5c69ad,_0x2883e6){return function(_0x2b7e60){if(_0x2b7e60){return _0x2b7e60['update'](_0x5c69ad)[_0x01e3('0x29')](function(_0x27f295){return _0x27f295;});}return null;};}function removeEntity(_0x479c92,_0x4cd2f8){return function(_0x508b51){if(_0x508b51){return _0x508b51['destroy']()[_0x01e3('0x29')](function(){_0x479c92[_0x01e3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52f07e,_0x19471c){return function(_0x2a994c){if(!_0x2a994c){_0x52f07e['sendStatus'](0x194);}return _0x2a994c;};}function handleError(_0x3efd18,_0x456feb){_0x456feb=_0x456feb||0x1f4;return function(_0x3a7b67){logger[_0x01e3('0x2a')](_0x3a7b67[_0x01e3('0x2b')]);if(_0x3a7b67[_0x01e3('0x2c')]){delete _0x3a7b67[_0x01e3('0x2c')];}_0x3efd18[_0x01e3('0x1e')](_0x456feb)[_0x01e3('0x2d')](_0x3a7b67);};}exports[_0x01e3('0x2e')]=function(_0x42ed22,_0x1fe60a){var _0x219aeb={},_0x325be6={},_0x138649={'count':0x0,'rows':[]};var _0x3faa80=_[_0x01e3('0x2f')](db[_0x01e3('0x30')][_0x01e3('0x31')],function(_0x3f1a79){return{'name':_0x3f1a79['fieldName'],'type':_0x3f1a79[_0x01e3('0x32')][_0x01e3('0x33')]};});_0x325be6[_0x01e3('0x34')]=_[_0x01e3('0x2f')](_0x3faa80,_0x01e3('0x2c'));_0x325be6[_0x01e3('0x35')]=_['keys'](_0x42ed22[_0x01e3('0x35')]);_0x325be6[_0x01e3('0x36')]=_[_0x01e3('0x37')](_0x325be6[_0x01e3('0x34')],_0x325be6[_0x01e3('0x35')]);_0x219aeb[_0x01e3('0x38')]=_[_0x01e3('0x37')](_0x325be6[_0x01e3('0x34')],qs[_0x01e3('0x39')](_0x42ed22[_0x01e3('0x35')]['fields']));_0x219aeb[_0x01e3('0x38')]=_0x219aeb['attributes'][_0x01e3('0x3a')]?_0x219aeb[_0x01e3('0x38')]:_0x325be6['model'];if(!_0x42ed22['query'][_0x01e3('0x3b')](_0x01e3('0x3c'))){_0x219aeb['limit']=qs[_0x01e3('0x22')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x22')]);_0x219aeb['offset']=qs[_0x01e3('0x21')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x21')]);}_0x219aeb[_0x01e3('0x3d')]=qs[_0x01e3('0x3e')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x3e')]);_0x219aeb[_0x01e3('0x3f')]=qs[_0x01e3('0x36')](_[_0x01e3('0x40')](_0x42ed22[_0x01e3('0x35')],_0x325be6['filters']),_0x3faa80);if(_0x42ed22[_0x01e3('0x35')][_0x01e3('0x41')]){_0x219aeb['where']=_[_0x01e3('0x42')](_0x219aeb['where'],{'$or':_[_0x01e3('0x2f')](_0x3faa80,function(_0x295dee){if(_0x295dee[_0x01e3('0x32')]!=='VIRTUAL'){var _0x13a7db={};_0x13a7db[_0x295dee[_0x01e3('0x2c')]]={'$like':'%'+_0x42ed22[_0x01e3('0x35')][_0x01e3('0x41')]+'%'};return _0x13a7db;}})});}_0x219aeb=_[_0x01e3('0x42')]({},_0x219aeb,_0x42ed22[_0x01e3('0x43')]);var _0x2172e3={'where':_0x219aeb[_0x01e3('0x3f')]};return db[_0x01e3('0x30')][_0x01e3('0x24')](_0x2172e3)[_0x01e3('0x29')](function(_0x29796b){_0x138649['count']=_0x29796b;if(_0x42ed22[_0x01e3('0x35')]['includeAll']){_0x219aeb[_0x01e3('0x44')]=[{'all':!![]}];}return db[_0x01e3('0x30')][_0x01e3('0x45')](_0x219aeb);})[_0x01e3('0x29')](function(_0x4e2761){_0x138649['rows']=_0x4e2761;return _0x138649;})[_0x01e3('0x29')](respondWithFilteredResult(_0x1fe60a,_0x219aeb))[_0x01e3('0x46')](handleError(_0x1fe60a,null));};exports[_0x01e3('0x47')]=function(_0x1b502d,_0xb5edeb){var _0x53c2a7={'raw':!![],'where':{'id':_0x1b502d[_0x01e3('0x48')]['id']}},_0x2ed542={};_0x2ed542[_0x01e3('0x34')]=_['keys'](db[_0x01e3('0x30')]['rawAttributes']);_0x2ed542[_0x01e3('0x35')]=_[_0x01e3('0x49')](_0x1b502d[_0x01e3('0x35')]);_0x2ed542[_0x01e3('0x36')]=_[_0x01e3('0x37')](_0x2ed542[_0x01e3('0x34')],_0x2ed542['query']);_0x53c2a7[_0x01e3('0x38')]=_['intersection'](_0x2ed542[_0x01e3('0x34')],qs['fields'](_0x1b502d[_0x01e3('0x35')]['fields']));_0x53c2a7['attributes']=_0x53c2a7[_0x01e3('0x38')][_0x01e3('0x3a')]?_0x53c2a7[_0x01e3('0x38')]:_0x2ed542['model'];if(_0x1b502d[_0x01e3('0x35')]['includeAll']){_0x53c2a7['include']=[{'all':!![]}];}_0x53c2a7=_['merge']({},_0x53c2a7,_0x1b502d[_0x01e3('0x43')]);return db['ChatInternalMessage'][_0x01e3('0x4a')](_0x53c2a7)[_0x01e3('0x29')](handleEntityNotFound(_0xb5edeb,null))[_0x01e3('0x29')](respondWithResult(_0xb5edeb,null))[_0x01e3('0x46')](handleError(_0xb5edeb,null));};exports[_0x01e3('0x4b')]=function(_0x560a20,_0x29e2f1){return db[_0x01e3('0x30')][_0x01e3('0x4b')](_0x560a20['body'],{})[_0x01e3('0x29')](respondWithResult(_0x29e2f1,0xc9))['catch'](handleError(_0x29e2f1,null));};exports[_0x01e3('0x4c')]=function(_0x4ffee2,_0x3c02cc){if(_0x4ffee2[_0x01e3('0x4d')]['id']){delete _0x4ffee2[_0x01e3('0x4d')]['id'];}return db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'id':_0x4ffee2['params']['id']}})[_0x01e3('0x29')](handleEntityNotFound(_0x3c02cc,null))[_0x01e3('0x29')](saveUpdates(_0x4ffee2[_0x01e3('0x4d')],null))[_0x01e3('0x29')](respondWithResult(_0x3c02cc,null))['catch'](handleError(_0x3c02cc,null));};exports[_0x01e3('0x4e')]=function(_0x373f65,_0x46ca6c){return db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'id':_0x373f65['params']['id']}})['then'](handleEntityNotFound(_0x46ca6c,null))['then'](removeEntity(_0x46ca6c,null))[_0x01e3('0x46')](handleError(_0x46ca6c,null));};exports[_0x01e3('0x4f')]=function(_0xd6b895,_0x523580){return db[_0x01e3('0x30')][_0x01e3('0x4f')]()[_0x01e3('0x29')](respondWithResult(_0x523580,null))[_0x01e3('0x46')](handleError(_0x523580,null));};function wrapUser(_0x3a4ca6){return function(_0x472409){var _0x47a106=_0x3a4ca6[_0x01e3('0x50')]({'plain':!![]});_0x47a106[_0x01e3('0x51')]=[];if(_0x472409){_0x47a106[_0x01e3('0x52')]=_0x472409[_0x01e3('0x53')];_0x47a106[_0x01e3('0x54')]=_0x472409;}else{_0x47a106[_0x01e3('0x52')]=moment(0x0)['format'](_0x01e3('0x55'));_0x47a106['lastMessage']={};}return _0x47a106;};}exports[_0x01e3('0x56')]=function(_0xc0d5c9,_0x11dcb3,_0x13d617){var _0x2a2f63=[];return db[_0x01e3('0x57')][_0x01e3('0x45')]({'where':{'role':[_0x01e3('0x58'),_0x01e3('0x59'),_0x01e3('0x5a')]},'attributes':['id',_0x01e3('0x5b'),_0x01e3('0x2c'),_0x01e3('0x5c'),_0x01e3('0x5d'),_0x01e3('0x5e'),_0x01e3('0x5f'),_0x01e3('0x60'),_0x01e3('0x61'),_0x01e3('0x62')],'order':qs[_0x01e3('0x3e')](_0x01e3('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x01e3('0x64'),'attributes':['id',_0x01e3('0x2c'),'type'],'through':{'attributes':[]}}]})[_0x01e3('0x29')](function(_0x356016){if(_0x356016){var _0x1b6c6b=_0xc0d5c9['user'][_0x01e3('0x50')]({'plain':!![]});if(!_0x1b6c6b)throw new Error(_0x01e3('0x65'));if(_0x1b6c6b[_0x01e3('0x5c')]==='user'){return db[_0x01e3('0x66')][_0x01e3('0x4a')]({'where':{'name':'Agents','userProfileId':_0x1b6c6b[_0x01e3('0x67')]},'raw':!![]})['then'](function(_0x41aed3){if(_0x41aed3){if(_0x41aed3[_0x01e3('0x68')]===0x0){return db['UserProfileResource'][_0x01e3('0x45')]({'where':{'sectionId':_0x41aed3['id']},'raw':!![]})[_0x01e3('0x29')](function(_0x1e7690){var _0x536b51=[];if(_['isEmpty'](_0x1e7690)){_0x536b51=_[_0x01e3('0x41')](_0x356016,function(_0xfe4d03){if(_0xfe4d03[_0x01e3('0x5c')]!==_0x01e3('0x58')){return _0xfe4d03;}});return _0x536b51;}else{for(var _0x47c7cb=0x0;_0x47c7cb<_0x356016[_0x01e3('0x3a')];_0x47c7cb++){var _0x285a29=_0x356016[_0x47c7cb];if(_0x285a29[_0x01e3('0x5c')]==='agent'){var _0x5bd1df=_[_0x01e3('0x4a')](_0x1e7690,function(_0x423780){return _0x423780[_0x01e3('0x69')]===_0x285a29['id'];});if(_0x5bd1df)_0x536b51[_0x01e3('0x6a')](_0x285a29);}else{_0x536b51['push'](_0x285a29);}}return _0x536b51;}});}else{return _0x356016;}}else{var _0x229969=_[_0x01e3('0x41')](_0x356016,function(_0x367ea3){if(_0x367ea3[_0x01e3('0x5c')]!==_0x01e3('0x58')){return _0x367ea3;}});return _0x229969;}});}else{return _0x356016;}}})[_0x01e3('0x29')](function(_0x1fb4c9){var _0x1bfeff=[];if(_0x1fb4c9){_0x2a2f63=_0x1fb4c9;for(var _0x9ada18=0x0;_0x9ada18<_0x1fb4c9[_0x01e3('0x3a')];_0x9ada18+=0x1){_0x2a2f63[_0x9ada18][_0x01e3('0x51')]=[];_0x1bfeff['push'](db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'FromId':[_0xc0d5c9[_0x01e3('0x5a')]['id'],_0x1fb4c9[_0x9ada18]['id']],'ToId':[_0xc0d5c9['user']['id'],_0x1fb4c9[_0x9ada18]['id']],'ChatGroupId':null},'attributes':['id',_0x01e3('0x53'),_0x01e3('0x6b'),'ToId',_0x01e3('0x6c'),'body'],'order':qs[_0x01e3('0x3e')](_0x01e3('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1fb4c9[_0x9ada18])));}return BPromise[_0x01e3('0x6e')](_0x1bfeff);}return[];})['then'](function(_0x40860b){return{'rows':_0x40860b,'count':_0x40860b['length']};})['then'](respondWithResult(_0x11dcb3,null))[_0x01e3('0x46')](handleError(_0x11dcb3,null));}; \ No newline at end of file +var _0x216e=['lastLoginAt','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','agent','resourceId','push','messages','ToId','read','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','internal','online'];(function(_0x4a9a1b,_0x2abd10){var _0x351223=function(_0x28cc64){while(--_0x28cc64){_0x4a9a1b['push'](_0x4a9a1b['shift']());}};_0x351223(++_0x2abd10);}(_0x216e,0x1d4));var _0xe216=function(_0xcf0981,_0x18f749){_0xcf0981=_0xcf0981-0x0;var _0x230ffe=_0x216e[_0xcf0981];return _0x230ffe;};'use strict';var emlformat=require(_0xe216('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe216('0x1'));var jsonpatch=require(_0xe216('0x2'));var rp=require('request-promise');var moment=require(_0xe216('0x3'));var BPromise=require(_0xe216('0x4'));var Mustache=require(_0xe216('0x5'));var util=require(_0xe216('0x6'));var path=require(_0xe216('0x7'));var sox=require(_0xe216('0x8'));var csv=require(_0xe216('0x9'));var ejs=require(_0xe216('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe216('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe216('0xc'));var deskjs=require(_0xe216('0xd'));var toCsv=require(_0xe216('0x9'));var querystring=require('querystring');var Papa=require(_0xe216('0xe'));var Redis=require(_0xe216('0xf'));var authService=require(_0xe216('0x10'));var qs=require(_0xe216('0x11'));var as=require(_0xe216('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe216('0x13'))(_0xe216('0x14'));var utils=require(_0xe216('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe216('0x16'));var db=require(_0xe216('0x17'))['db'];config['redis']=_[_0xe216('0x18')](config['redis'],{'host':_0xe216('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe216('0x1a'))[_0xe216('0x1b')](socket);function respondWithStatusCode(_0x301d52,_0x3d494a){_0x3d494a=_0x3d494a||0xcc;return function(_0x9a1522){if(_0x9a1522){return _0x301d52[_0xe216('0x1c')](_0x3d494a);}return _0x301d52[_0xe216('0x1d')](_0x3d494a)[_0xe216('0x1e')]();};}function respondWithResult(_0x497607,_0xdaf350){_0xdaf350=_0xdaf350||0xc8;return function(_0xa41f42){if(_0xa41f42){return _0x497607['status'](_0xdaf350)[_0xe216('0x1f')](_0xa41f42);}};}function respondWithFilteredResult(_0x3c2e2e,_0x40aaa6){return function(_0x1e4c25){if(_0x1e4c25){var _0x146598=typeof _0x40aaa6['offset']==='undefined'&&typeof _0x40aaa6['limit']===_0xe216('0x20');var _0x70eb01=_0x1e4c25[_0xe216('0x21')];var _0x14c4c9=_0x146598?0x0:_0x40aaa6['offset'];var _0x28e7ba=_0x146598?_0x1e4c25[_0xe216('0x21')]:_0x40aaa6[_0xe216('0x22')]+_0x40aaa6['limit'];var _0x5ceeaf;if(_0x28e7ba>=_0x70eb01){_0x28e7ba=_0x70eb01;_0x5ceeaf=0xc8;}else{_0x5ceeaf=0xce;}_0x3c2e2e[_0xe216('0x1d')](_0x5ceeaf);return _0x3c2e2e[_0xe216('0x23')]('Content-Range',_0x14c4c9+'-'+_0x28e7ba+'/'+_0x70eb01)['json'](_0x1e4c25);}return null;};}function patchUpdates(_0x59a48d){return function(_0x3462bf){try{jsonpatch[_0xe216('0x24')](_0x3462bf,_0x59a48d,!![]);}catch(_0x31e2eb){return BPromise[_0xe216('0x25')](_0x31e2eb);}return _0x3462bf[_0xe216('0x26')]();};}function saveUpdates(_0x2837e0,_0x13391b){return function(_0x468b66){if(_0x468b66){return _0x468b66['update'](_0x2837e0)['then'](function(_0x2aca42){return _0x2aca42;});}return null;};}function removeEntity(_0x5349d3,_0x4ec48d){return function(_0x3970dd){if(_0x3970dd){return _0x3970dd[_0xe216('0x27')]()[_0xe216('0x28')](function(){_0x5349d3[_0xe216('0x1d')](0xcc)[_0xe216('0x1e')]();});}};}function handleEntityNotFound(_0x5c7ed6,_0x3275bc){return function(_0x58f36f){if(!_0x58f36f){_0x5c7ed6['sendStatus'](0x194);}return _0x58f36f;};}function handleError(_0x27363c,_0x342031){_0x342031=_0x342031||0x1f4;return function(_0x1b5cb5){logger[_0xe216('0x29')](_0x1b5cb5[_0xe216('0x2a')]);if(_0x1b5cb5[_0xe216('0x2b')]){delete _0x1b5cb5[_0xe216('0x2b')];}_0x27363c[_0xe216('0x1d')](_0x342031)[_0xe216('0x2c')](_0x1b5cb5);};}exports[_0xe216('0x2d')]=function(_0xdc0ada,_0x491ed8){var _0xcb65bd={},_0x29bd4a={},_0x26223f={'count':0x0,'rows':[]};var _0x20d03e=_[_0xe216('0x2e')](db['ChatInternalMessage']['rawAttributes'],function(_0x3d645b){return{'name':_0x3d645b[_0xe216('0x2f')],'type':_0x3d645b['type'][_0xe216('0x30')]};});_0x29bd4a[_0xe216('0x31')]=_[_0xe216('0x2e')](_0x20d03e,_0xe216('0x2b'));_0x29bd4a[_0xe216('0x32')]=_[_0xe216('0x33')](_0xdc0ada['query']);_0x29bd4a[_0xe216('0x34')]=_[_0xe216('0x35')](_0x29bd4a['model'],_0x29bd4a[_0xe216('0x32')]);_0xcb65bd[_0xe216('0x36')]=_[_0xe216('0x35')](_0x29bd4a['model'],qs[_0xe216('0x37')](_0xdc0ada[_0xe216('0x32')][_0xe216('0x37')]));_0xcb65bd['attributes']=_0xcb65bd['attributes'][_0xe216('0x38')]?_0xcb65bd['attributes']:_0x29bd4a[_0xe216('0x31')];if(!_0xdc0ada['query'][_0xe216('0x39')](_0xe216('0x3a'))){_0xcb65bd[_0xe216('0x3b')]=qs[_0xe216('0x3b')](_0xdc0ada[_0xe216('0x32')][_0xe216('0x3b')]);_0xcb65bd[_0xe216('0x22')]=qs['offset'](_0xdc0ada['query']['offset']);}_0xcb65bd[_0xe216('0x3c')]=qs['sort'](_0xdc0ada[_0xe216('0x32')][_0xe216('0x3d')]);_0xcb65bd['where']=qs[_0xe216('0x34')](_[_0xe216('0x3e')](_0xdc0ada[_0xe216('0x32')],_0x29bd4a[_0xe216('0x34')]),_0x20d03e);if(_0xdc0ada[_0xe216('0x32')][_0xe216('0x3f')]){_0xcb65bd[_0xe216('0x40')]=_[_0xe216('0x41')](_0xcb65bd[_0xe216('0x40')],{'$or':_[_0xe216('0x2e')](_0x20d03e,function(_0x3f489f){if(_0x3f489f[_0xe216('0x42')]!==_0xe216('0x43')){var _0x330264={};_0x330264[_0x3f489f[_0xe216('0x2b')]]={'$like':'%'+_0xdc0ada[_0xe216('0x32')][_0xe216('0x3f')]+'%'};return _0x330264;}})});}_0xcb65bd=_['merge']({},_0xcb65bd,_0xdc0ada[_0xe216('0x44')]);var _0x51ec93={'where':_0xcb65bd['where']};return db[_0xe216('0x45')][_0xe216('0x21')](_0x51ec93)['then'](function(_0xcbdd3){_0x26223f['count']=_0xcbdd3;if(_0xdc0ada[_0xe216('0x32')][_0xe216('0x46')]){_0xcb65bd[_0xe216('0x47')]=[{'all':!![]}];}return db[_0xe216('0x45')][_0xe216('0x48')](_0xcb65bd);})[_0xe216('0x28')](function(_0x526e49){_0x26223f[_0xe216('0x49')]=_0x526e49;return _0x26223f;})[_0xe216('0x28')](respondWithFilteredResult(_0x491ed8,_0xcb65bd))[_0xe216('0x4a')](handleError(_0x491ed8,null));};exports[_0xe216('0x4b')]=function(_0x1966e7,_0x15fea8){var _0x19da24={'raw':!![],'where':{'id':_0x1966e7['params']['id']}},_0x1c770b={};_0x1c770b[_0xe216('0x31')]=_['keys'](db[_0xe216('0x45')][_0xe216('0x4c')]);_0x1c770b[_0xe216('0x32')]=_[_0xe216('0x33')](_0x1966e7[_0xe216('0x32')]);_0x1c770b[_0xe216('0x34')]=_['intersection'](_0x1c770b[_0xe216('0x31')],_0x1c770b[_0xe216('0x32')]);_0x19da24[_0xe216('0x36')]=_[_0xe216('0x35')](_0x1c770b[_0xe216('0x31')],qs['fields'](_0x1966e7[_0xe216('0x32')][_0xe216('0x37')]));_0x19da24[_0xe216('0x36')]=_0x19da24['attributes']['length']?_0x19da24[_0xe216('0x36')]:_0x1c770b[_0xe216('0x31')];if(_0x1966e7[_0xe216('0x32')][_0xe216('0x46')]){_0x19da24['include']=[{'all':!![]}];}_0x19da24=_[_0xe216('0x41')]({},_0x19da24,_0x1966e7[_0xe216('0x44')]);return db[_0xe216('0x45')][_0xe216('0x4d')](_0x19da24)[_0xe216('0x28')](handleEntityNotFound(_0x15fea8,null))[_0xe216('0x28')](respondWithResult(_0x15fea8,null))[_0xe216('0x4a')](handleError(_0x15fea8,null));};exports['create']=function(_0x2a9616,_0x3155bc){return db['ChatInternalMessage'][_0xe216('0x4e')](_0x2a9616['body'],{})[_0xe216('0x28')](respondWithResult(_0x3155bc,0xc9))[_0xe216('0x4a')](handleError(_0x3155bc,null));};exports[_0xe216('0x4f')]=function(_0x501738,_0x24662e){if(_0x501738['body']['id']){delete _0x501738[_0xe216('0x50')]['id'];}return db[_0xe216('0x45')]['find']({'where':{'id':_0x501738[_0xe216('0x51')]['id']}})['then'](handleEntityNotFound(_0x24662e,null))[_0xe216('0x28')](saveUpdates(_0x501738[_0xe216('0x50')],null))[_0xe216('0x28')](respondWithResult(_0x24662e,null))[_0xe216('0x4a')](handleError(_0x24662e,null));};exports[_0xe216('0x27')]=function(_0x41d203,_0xe68bb0){return db[_0xe216('0x45')][_0xe216('0x4d')]({'where':{'id':_0x41d203[_0xe216('0x51')]['id']}})[_0xe216('0x28')](handleEntityNotFound(_0xe68bb0,null))[_0xe216('0x28')](removeEntity(_0xe68bb0,null))['catch'](handleError(_0xe68bb0,null));};exports['describe']=function(_0x18534a,_0x3d80a3){return db['ChatInternalMessage'][_0xe216('0x52')]()[_0xe216('0x28')](respondWithResult(_0x3d80a3,null))[_0xe216('0x4a')](handleError(_0x3d80a3,null));};function wrapUser(_0x284da2){return function(_0x40c38e){var _0x125b05=_0x284da2[_0xe216('0x53')]({'plain':!![]});_0x125b05['messages']=[];if(_0x40c38e){_0x125b05[_0xe216('0x54')]=_0x40c38e[_0xe216('0x55')];_0x125b05[_0xe216('0x56')]=_0x40c38e;}else{_0x125b05[_0xe216('0x54')]=moment(0x0)[_0xe216('0x57')](_0xe216('0x58'));_0x125b05[_0xe216('0x56')]={};}return _0x125b05;};}exports[_0xe216('0x59')]=function(_0x580e92,_0x497e26,_0x5ea3f1){var _0x371d1f=[];return db[_0xe216('0x5a')][_0xe216('0x48')]({'where':{'role':['agent',_0xe216('0x5b'),'user']},'attributes':['id',_0xe216('0x5c'),_0xe216('0x2b'),_0xe216('0x5d'),_0xe216('0x5e'),_0xe216('0x5f'),_0xe216('0x60'),_0xe216('0x61'),'allowmessenger',_0xe216('0x62')],'order':qs[_0xe216('0x3d')](_0xe216('0x63')),'include':[{'model':db[_0xe216('0x64')],'as':'VoiceQueues','attributes':['id',_0xe216('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xe216('0x28')](function(_0x2da4cb){if(_0x2da4cb){var _0x431fe2=_0x580e92[_0xe216('0x65')][_0xe216('0x53')]({'plain':!![]});if(!_0x431fe2)throw new Error(_0xe216('0x66'));if(_0x431fe2[_0xe216('0x5d')]===_0xe216('0x65')){return db[_0xe216('0x67')][_0xe216('0x4d')]({'where':{'name':'Agents','userProfileId':_0x431fe2[_0xe216('0x68')]},'raw':!![]})[_0xe216('0x28')](function(_0x3d1118){if(_0x3d1118){if(_0x3d1118[_0xe216('0x69')]===0x0){return db['UserProfileResource'][_0xe216('0x48')]({'where':{'sectionId':_0x3d1118['id']},'raw':!![]})[_0xe216('0x28')](function(_0x2af181){var _0x344b5a=[];if(_['isEmpty'](_0x2af181)){_0x344b5a=_[_0xe216('0x3f')](_0x2da4cb,function(_0x1bca92){if(_0x1bca92['role']!==_0xe216('0x6a')){return _0x1bca92;}});return _0x344b5a;}else{for(var _0x3738ed=0x0;_0x3738ed<_0x2da4cb['length'];_0x3738ed++){var _0x417511=_0x2da4cb[_0x3738ed];if(_0x417511[_0xe216('0x5d')]===_0xe216('0x6a')){var _0x343d32=_[_0xe216('0x4d')](_0x2af181,function(_0x2df35e){return _0x2df35e[_0xe216('0x6b')]===_0x417511['id'];});if(_0x343d32)_0x344b5a[_0xe216('0x6c')](_0x417511);}else{_0x344b5a[_0xe216('0x6c')](_0x417511);}}return _0x344b5a;}});}else{return _0x2da4cb;}}else{var _0x3a5329=_[_0xe216('0x3f')](_0x2da4cb,function(_0x19c932){if(_0x19c932[_0xe216('0x5d')]!==_0xe216('0x6a')){return _0x19c932;}});return _0x3a5329;}});}else{return _0x2da4cb;}}})[_0xe216('0x28')](function(_0x1f6ec6){var _0xa4dcd9=[];if(_0x1f6ec6){_0x371d1f=_0x1f6ec6;for(var _0x217f47=0x0;_0x217f47<_0x1f6ec6[_0xe216('0x38')];_0x217f47+=0x1){_0x371d1f[_0x217f47][_0xe216('0x6d')]=[];_0xa4dcd9[_0xe216('0x6c')](db[_0xe216('0x45')][_0xe216('0x4d')]({'where':{'FromId':[_0x580e92[_0xe216('0x65')]['id'],_0x1f6ec6[_0x217f47]['id']],'ToId':[_0x580e92['user']['id'],_0x1f6ec6[_0x217f47]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xe216('0x6e'),_0xe216('0x6f'),_0xe216('0x50')],'order':qs[_0xe216('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe216('0x28')](wrapUser(_0x1f6ec6[_0x217f47])));}return BPromise[_0xe216('0x70')](_0xa4dcd9);}return[];})[_0xe216('0x28')](function(_0x13830f){return{'rows':_0x13830f,'count':_0x13830f['length']};})['then'](respondWithResult(_0x497e26,null))[_0xe216('0x4a')](handleError(_0x497e26,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 84ef18f..5ae355e 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 _0x8761=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x8761,0x168));var _0x1876=function(_0x12657c,_0x4bbd51){_0x12657c=_0x12657c-0x0;var _0x275d02=_0x8761[_0x12657c];return _0x275d02;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1876('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1876('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1876('0x2'),'afterDestroy':'remove'};function emitEvent(_0x35d258){return function(_0x4d19ee,_0x2e69ee,_0x3c30f1){ChatInternalMessageEvents[_0x1876('0x3')](_0x35d258+':'+_0x4d19ee['id'],_0x4d19ee);ChatInternalMessageEvents[_0x1876('0x3')](_0x35d258,_0x4d19ee);_0x3c30f1(null);};}for(var e in events){if(events[_0x1876('0x4')](e)){var event=events[e];ChatInternalMessage[_0x1876('0x5')](e,emitEvent(event));}}module[_0x1876('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x195f=['ChatInternalMessage','setMaxListeners','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x492421,_0x44a7d8){var _0x19e9fe=function(_0x122778){while(--_0x122778){_0x492421['push'](_0x492421['shift']());}};_0x19e9fe(++_0x44a7d8);}(_0x195f,0x101));var _0xf195=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x195f[_0x310a1b];return _0xdea206;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf195('0x0'))['db'][_0xf195('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf195('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24da94){return function(_0x4045dd,_0x4bcda6,_0x5cee49){ChatInternalMessageEvents[_0xf195('0x3')](_0x24da94+':'+_0x4045dd['id'],_0x4045dd);ChatInternalMessageEvents[_0xf195('0x3')](_0x24da94,_0x4045dd);_0x5cee49(null);};}for(var e in events){if(events[_0xf195('0x4')](e)){var event=events[e];ChatInternalMessage[_0xf195('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 51b1038..aa19c48 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 _0x7293=['ChatInternalMessage','utf8mb4','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x28e235,_0x4bd222){var _0x15c352=function(_0xa7aeb4){while(--_0xa7aeb4){_0x28e235['push'](_0x28e235['shift']());}};_0x15c352(++_0x4bd222);}(_0x7293,0x16a));var _0x3729=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7293[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3729('0x0'));var util=require(_0x3729('0x1'));var logger=require('../../config/logger')(_0x3729('0x2'));var moment=require('moment');var BPromise=require(_0x3729('0x3'));var rp=require(_0x3729('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3729('0x5'));var config=require(_0x3729('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x3729('0x7')]=function(_0x10dafb,_0x363ce3){return _0x10dafb['define'](_0x3729('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3729('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x46fa=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x526450,_0x31d37b){var _0x1101d5=function(_0x1f7510){while(--_0x1f7510){_0x526450['push'](_0x526450['shift']());}};_0x1101d5(++_0x31d37b);}(_0x46fa,0xe8));var _0xa46f=function(_0x3e9662,_0x5a4dce){_0x3e9662=_0x3e9662-0x0;var _0x219fbc=_0x46fa[_0x3e9662];return _0x219fbc;};'use strict';var _=require(_0xa46f('0x0'));var util=require(_0xa46f('0x1'));var logger=require(_0xa46f('0x2'))(_0xa46f('0x3'));var moment=require('moment');var BPromise=require(_0xa46f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa46f('0x5'));var rimraf=require(_0xa46f('0x6'));var config=require(_0xa46f('0x7'));var attributes=require(_0xa46f('0x8'));module['exports']=function(_0x2d79c2,_0x3e1155){return _0x2d79c2[_0xa46f('0x9')](_0xa46f('0xa'),attributes,{'tableName':_0xa46f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa46f('0xc'),'collate':_0xa46f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a51b25c..c9b4aed 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 _0xfccc=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x40d544,_0x36e18b){var _0x1efbb0=function(_0x1132ba){while(--_0x1132ba){_0x40d544['push'](_0x40d544['shift']());}};_0x1efbb0(++_0x36e18b);}(_0xfccc,0xa4));var _0xcfcc=function(_0x270761,_0x4dd1f9){_0x270761=_0x270761-0x0;var _0x3904f8=_0xfccc[_0x270761];return _0x3904f8;};'use strict';var _=require(_0xcfcc('0x0'));var util=require('util');var moment=require(_0xcfcc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfcc('0x2'));var db=require(_0xcfcc('0x3'))['db'];var utils=require(_0xcfcc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcfcc('0x5'));var jayson=require(_0xcfcc('0x6'));var client=jayson[_0xcfcc('0x7')][_0xcfcc('0x8')]({'port':0x232a});config[_0xcfcc('0x9')]=_[_0xcfcc('0xa')](config[_0xcfcc('0x9')],{'host':_0xcfcc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfcc('0x9')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3dd3f8,_0x493ae5,_0x4ff9c3){return new BPromise(function(_0x52aa07,_0x3300a8){return client[_0xcfcc('0xc')](_0x3dd3f8,_0x4ff9c3)[_0xcfcc('0xd')](function(_0x53622e){logger[_0xcfcc('0xe')](_0xcfcc('0xf'),_0x493ae5,_0xcfcc('0x10'));logger['debug'](_0xcfcc('0x11'),_0x493ae5,_0xcfcc('0x10'),JSON[_0xcfcc('0x12')](_0x53622e));if(_0x53622e['error']){if(_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x14')]===0x1f4){logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x15')]);return _0x3300a8(_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x15')]);}logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x53622e['error'][_0xcfcc('0x15')]);return _0x52aa07(_0x53622e['error']['message']);}else{logger[_0xcfcc('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x493ae5,'request\x20sent');_0x52aa07(_0x53622e[_0xcfcc('0x16')][_0xcfcc('0x15')]);}})[_0xcfcc('0x17')](function(_0x1b3e54){logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x1b3e54);_0x3300a8(_0x1b3e54);});});} \ No newline at end of file +var _0xe430=['http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf72136,_0x367342){var _0x4c98b6=function(_0x3df50d){while(--_0x3df50d){_0xf72136['push'](_0xf72136['shift']());}};_0x4c98b6(++_0x367342);}(_0xe430,0x1da));var _0x0e43=function(_0x79bbdd,_0x41414e){_0x79bbdd=_0x79bbdd-0x0;var _0x4d0257=_0xe430[_0x79bbdd];return _0x4d0257;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0e43('0x0'));var rs=require(_0x0e43('0x1'));var fs=require('fs');var Redis=require(_0x0e43('0x2'));var db=require(_0x0e43('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e43('0x4'))(_0x0e43('0x5'));var config=require(_0x0e43('0x6'));var jayson=require(_0x0e43('0x7'));var client=jayson[_0x0e43('0x8')][_0x0e43('0x9')]({'port':0x232a});config[_0x0e43('0xa')]=_[_0x0e43('0xb')](config[_0x0e43('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e43('0xc'))(new Redis(config[_0x0e43('0xa')]));require(_0x0e43('0xd'))['register'](socket);function respondWithRpcPromise(_0x52f956,_0x11772a,_0x6f1d72){return new BPromise(function(_0x20763d,_0xea9265){return client['request'](_0x52f956,_0x6f1d72)['then'](function(_0x512a96){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x11772a,_0x0e43('0xe'));logger[_0x0e43('0xf')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x11772a,_0x0e43('0xe'),JSON[_0x0e43('0x10')](_0x512a96));if(_0x512a96[_0x0e43('0x11')]){if(_0x512a96[_0x0e43('0x11')]['code']===0x1f4){logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x512a96[_0x0e43('0x11')]['message']);return _0xea9265(_0x512a96[_0x0e43('0x11')][_0x0e43('0x13')]);}logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x512a96['error'][_0x0e43('0x13')]);return _0x20763d(_0x512a96[_0x0e43('0x11')][_0x0e43('0x13')]);}else{logger[_0x0e43('0x14')](_0x0e43('0x12'),_0x11772a,_0x0e43('0xe'));_0x20763d(_0x512a96[_0x0e43('0x15')][_0x0e43('0x13')]);}})[_0x0e43('0x16')](function(_0x367aea){logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x367aea);_0xea9265(_0x367aea);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ea96b1e..eb7e72a 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 _0xaa6b=['register','length','chatInternalMessage:','save','update','emit','removeListener'];(function(_0x57c669,_0x4d61df){var _0x517fdd=function(_0x26a01c){while(--_0x26a01c){_0x57c669['push'](_0x57c669['shift']());}};_0x517fdd(++_0x4d61df);}(_0xaa6b,0x1d1));var _0xbaa6=function(_0x532510,_0x323d0b){_0x532510=_0x532510-0x0;var _0x5a7ae3=_0xaa6b[_0x532510];return _0x5a7ae3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xbaa6('0x0'),'remove',_0xbaa6('0x1')];function createListener(_0x3a4ab2,_0x54bb9c){return function(_0x438d4e){_0x54bb9c[_0xbaa6('0x2')](_0x3a4ab2,_0x438d4e);};}function removeListener(_0x458c07,_0x14ee5a){return function(){ChatInternalMessageEvents[_0xbaa6('0x3')](_0x458c07,_0x14ee5a);};}exports[_0xbaa6('0x4')]=function(_0x40c7b3){for(var _0x5d59c4=0x0,_0x1211f9=events[_0xbaa6('0x5')];_0x5d59c4<_0x1211f9;_0x5d59c4++){var _0x28f739=events[_0x5d59c4];var _0x2e4d38=createListener(_0xbaa6('0x6')+_0x28f739,_0x40c7b3);ChatInternalMessageEvents['on'](_0x28f739,_0x2e4d38);}}; \ No newline at end of file +var _0x4d83=['remove','update','emit','./chatInternalMessage.events','save'];(function(_0x5d0e1a,_0x1284e1){var _0x490a10=function(_0x29ab9c){while(--_0x29ab9c){_0x5d0e1a['push'](_0x5d0e1a['shift']());}};_0x490a10(++_0x1284e1);}(_0x4d83,0x76));var _0x34d8=function(_0x3024ce,_0x441227){_0x3024ce=_0x3024ce-0x0;var _0x560230=_0x4d83[_0x3024ce];return _0x560230;};'use strict';var ChatInternalMessageEvents=require(_0x34d8('0x0'));var events=[_0x34d8('0x1'),_0x34d8('0x2'),_0x34d8('0x3')];function createListener(_0x3777c0,_0x41cd63){return function(_0x5c4d6c){_0x41cd63[_0x34d8('0x4')](_0x3777c0,_0x5c4d6c);};}function removeListener(_0x2b7e67,_0x5da85b){return function(){ChatInternalMessageEvents['removeListener'](_0x2b7e67,_0x5da85b);};}exports['register']=function(_0xc95115){for(var _0x9dd769=0x0,_0x97e4b2=events['length'];_0x9dd769<_0x97e4b2;_0x9dd769++){var _0x195e05=events[_0x9dd769];var _0x4ad8bd=createListener('chatInternalMessage:'+_0x195e05,_0xc95115);ChatInternalMessageEvents['on'](_0x195e05,_0x4ad8bd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8417299..2cff2e6 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 _0x11be=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','getUsers','post','create','put','/:id','update','destroy'];(function(_0xd19f95,_0x383c85){var _0x201ca1=function(_0x54fd86){while(--_0x54fd86){_0xd19f95['push'](_0xd19f95['shift']());}};_0x201ca1(++_0x383c85);}(_0x11be,0x91));var _0xe11b=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x11be[_0x296809];return _0x18c0d3;};'use strict';var multer=require(_0xe11b('0x0'));var util=require(_0xe11b('0x1'));var path=require(_0xe11b('0x2'));var timeout=require(_0xe11b('0x3'));var express=require(_0xe11b('0x4'));var router=express[_0xe11b('0x5')]();var fs_extra=require(_0xe11b('0x6'));var auth=require(_0xe11b('0x7'));var interaction=require(_0xe11b('0x8'));var config=require(_0xe11b('0x9'));var controller=require(_0xe11b('0xa'));router[_0xe11b('0xb')]('/',auth['isAuthenticated'](),controller[_0xe11b('0xc')]);router[_0xe11b('0xb')](_0xe11b('0xd'),auth[_0xe11b('0xe')](),controller[_0xe11b('0xf')]);router[_0xe11b('0xb')]('/users',auth[_0xe11b('0xe')](),controller[_0xe11b('0x10')]);router[_0xe11b('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe11b('0x11')]('/',auth[_0xe11b('0xe')](),controller[_0xe11b('0x12')]);router[_0xe11b('0x13')](_0xe11b('0x14'),controller[_0xe11b('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe11b('0x16')]);module[_0xe11b('0x17')]=router; \ No newline at end of file +var _0x597d=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','post','create'];(function(_0x5b6d2a,_0x2a4e3b){var _0x536640=function(_0x38f760){while(--_0x38f760){_0x5b6d2a['push'](_0x5b6d2a['shift']());}};_0x536640(++_0x2a4e3b);}(_0x597d,0xe7));var _0xd597=function(_0x1a925e,_0x4a96de){_0x1a925e=_0x1a925e-0x0;var _0x4db9b6=_0x597d[_0x1a925e];return _0x4db9b6;};'use strict';var multer=require(_0xd597('0x0'));var util=require(_0xd597('0x1'));var path=require(_0xd597('0x2'));var timeout=require(_0xd597('0x3'));var express=require(_0xd597('0x4'));var router=express[_0xd597('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd597('0x6'));var config=require('../../config/environment');var controller=require(_0xd597('0x7'));router[_0xd597('0x8')]('/',auth[_0xd597('0x9')](),controller['index']);router[_0xd597('0x8')](_0xd597('0xa'),auth[_0xd597('0x9')](),controller[_0xd597('0xb')]);router['get'](_0xd597('0xc'),auth[_0xd597('0x9')](),controller['getUsers']);router[_0xd597('0x8')](_0xd597('0xd'),auth[_0xd597('0x9')](),controller['show']);router[_0xd597('0xe')]('/',auth[_0xd597('0x9')](),controller[_0xd597('0xf')]);router[_0xd597('0x10')](_0xd597('0xd'),controller['update']);router[_0xd597('0x11')](_0xd597('0xd'),auth[_0xd597('0x9')](),controller[_0xd597('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 40b2219..48222b3 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 _0xf17f=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf17f,0x113));var _0xff17=function(_0x13c38a,_0x522286){_0x13c38a=_0x13c38a-0x0;var _0x5c658a=_0xf17f[_0x13c38a];return _0x5c658a;};'use strict';var Sequelize=require(_0xff17('0x0'));module[_0xff17('0x1')]={'body':{'type':Sequelize[_0xff17('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xff17('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xff17('0x4')),'defaultValue':_0xff17('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xff17('0x5')]},'providerName':{'type':Sequelize[_0xff17('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x266850,_0x821b6b){var _0x3708bc=function(_0x3983c2){while(--_0x3983c2){_0x266850['push'](_0x266850['shift']());}};_0x3708bc(++_0x821b6b);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xe2ab[_0x113a6c];return _0x1ac632;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 30efd3b..1afcc21 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 _0x232f=['jayson/promise','http','client','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','catch','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','end','sendStatus','stack','name','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ChatMessage','include','findAll','rows','show','params','keys','includeAll','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE: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','Sequelize','QueryTypes','SELECT','contact','agent','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','fullname','email','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x373ff7,_0x61c967){var _0x1c135c=function(_0x243b07){while(--_0x243b07){_0x373ff7['push'](_0x373ff7['shift']());}};_0x1c135c(++_0x61c967);}(_0x232f,0x171));var _0xf232=function(_0x595b9b,_0xa58ff){_0x595b9b=_0x595b9b-0x0;var _0x3be4c6=_0x232f[_0x595b9b];return _0x3be4c6;};'use strict';var emlformat=require(_0xf232('0x0'));var rimraf=require(_0xf232('0x1'));var zipdir=require(_0xf232('0x2'));var jsonpatch=require(_0xf232('0x3'));var rp=require(_0xf232('0x4'));var moment=require(_0xf232('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf232('0x6'));var path=require('path');var sox=require(_0xf232('0x7'));var csv=require(_0xf232('0x8'));var ejs=require(_0xf232('0x9'));var fs=require('fs');var fs_extra=require(_0xf232('0xa'));var _=require(_0xf232('0xb'));var squel=require(_0xf232('0xc'));var crypto=require(_0xf232('0xd'));var jsforce=require(_0xf232('0xe'));var deskjs=require(_0xf232('0xf'));var toCsv=require(_0xf232('0x8'));var querystring=require(_0xf232('0x10'));var Papa=require(_0xf232('0x11'));var Redis=require(_0xf232('0x12'));var authService=require(_0xf232('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf232('0x14'));var hardwareService=require(_0xf232('0x15'));var logger=require(_0xf232('0x16'))(_0xf232('0x17'));var utils=require(_0xf232('0x18'));var config=require(_0xf232('0x19'));var licenseUtil=require(_0xf232('0x1a'));var db=require('../../mysqldb')['db'];config[_0xf232('0x1b')]=_[_0xf232('0x1c')](config['redis'],{'host':_0xf232('0x1d'),'port':0x18eb});var socket=require(_0xf232('0x1e'))(new Redis(config['redis']));require(_0xf232('0x1f'))[_0xf232('0x20')](socket);var jayson=require(_0xf232('0x21'));var client=jayson['client'][_0xf232('0x22')]({'port':0x232c});var client9002=jayson[_0xf232('0x23')][_0xf232('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x40c91b,_0x3e17b6,_0x3a07a1,_0x2fa425){return new BPromise(function(_0x480c9e,_0x41ea5d){var _0xed8d03=_0x2fa425||client;return _0xed8d03[_0xf232('0x24')](_0x40c91b,_0x3a07a1)[_0xf232('0x25')](function(_0x141eab){logger[_0xf232('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3e17b6,_0xf232('0x27'));logger['debug'](_0xf232('0x28'),_0x3e17b6,_0xf232('0x27'),JSON[_0xf232('0x29')](_0x141eab));if(_0x141eab['error']){if(_0x141eab['error']['code']===0x1f4){logger[_0xf232('0x2a')](_0xf232('0x2b'),_0x3e17b6,_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);return _0x41ea5d(_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);}logger[_0xf232('0x2a')](_0xf232('0x2b'),_0x3e17b6,_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);return _0x480c9e(_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);}else{logger[_0xf232('0x26')](_0xf232('0x2b'),_0x3e17b6,_0xf232('0x27'));_0x480c9e(_0x141eab['result'][_0xf232('0x2c')]);}})[_0xf232('0x2d')](function(_0x183bff){logger['error'](_0xf232('0x2b'),_0x3e17b6,_0x183bff);_0x41ea5d(_0x183bff);});});}function respondWithStatusCode(_0x597e35,_0x362d15){_0x362d15=_0x362d15||0xcc;return function(_0x1ff7da){if(_0x1ff7da){return _0x597e35['sendStatus'](_0x362d15);}return _0x597e35['status'](_0x362d15)['end']();};}function respondWithResult(_0x4ecdad,_0x3b5fdd){_0x3b5fdd=_0x3b5fdd||0xc8;return function(_0x44a230){if(_0x44a230){return _0x4ecdad[_0xf232('0x2e')](_0x3b5fdd)['json'](_0x44a230);}};}function respondWithFilteredResult(_0x12727e,_0x49791d){return function(_0x490f91){if(_0x490f91){var _0x3b5524=typeof _0x49791d[_0xf232('0x2f')]===_0xf232('0x30')&&typeof _0x49791d['limit']===_0xf232('0x30');var _0x14ad85=_0x490f91['count'];var _0x1c81f1=_0x3b5524?0x0:_0x49791d['offset'];var _0x2be79c=_0x3b5524?_0x490f91[_0xf232('0x31')]:_0x49791d[_0xf232('0x2f')]+_0x49791d[_0xf232('0x32')];var _0x2f3334;if(_0x2be79c>=_0x14ad85){_0x2be79c=_0x14ad85;_0x2f3334=0xc8;}else{_0x2f3334=0xce;}_0x12727e['status'](_0x2f3334);return _0x12727e[_0xf232('0x33')](_0xf232('0x34'),_0x1c81f1+'-'+_0x2be79c+'/'+_0x14ad85)[_0xf232('0x35')](_0x490f91);}return null;};}function patchUpdates(_0x445480){return function(_0x15218f){try{jsonpatch[_0xf232('0x36')](_0x15218f,_0x445480,!![]);}catch(_0x5ba6c8){return BPromise[_0xf232('0x37')](_0x5ba6c8);}return _0x15218f[_0xf232('0x38')]();};}function saveUpdates(_0x21ba52,_0x1d0c0b){return function(_0x2f7372){if(_0x2f7372){return _0x2f7372[_0xf232('0x39')](_0x21ba52)[_0xf232('0x25')](function(_0x3b9a09){return _0x3b9a09;});}return null;};}function removeEntity(_0x46273f,_0x1d8261){return function(_0x260765){if(_0x260765){return _0x260765['destroy']()['then'](function(){_0x46273f['status'](0xcc)[_0xf232('0x3a')]();});}};}function handleEntityNotFound(_0x2380da,_0x3ef5f6){return function(_0x530c90){if(!_0x530c90){_0x2380da[_0xf232('0x3b')](0x194);}return _0x530c90;};}function handleError(_0x2d0282,_0x5549c0){_0x5549c0=_0x5549c0||0x1f4;return function(_0x1d3062){logger[_0xf232('0x2a')](_0x1d3062[_0xf232('0x3c')]);if(_0x1d3062[_0xf232('0x3d')]){delete _0x1d3062['name'];}_0x2d0282['status'](_0x5549c0)['send'](_0x1d3062);};}exports['index']=function(_0x43678a,_0x56cce8){var _0xe803f={},_0x3e09b3={},_0x473044={'count':0x0,'rows':[]};var _0x1467f3=_[_0xf232('0x3e')](db['ChatMessage'][_0xf232('0x3f')],function(_0x27d9b5){return{'name':_0x27d9b5['fieldName'],'type':_0x27d9b5['type'][_0xf232('0x40')]};});_0x3e09b3['model']=_[_0xf232('0x3e')](_0x1467f3,_0xf232('0x3d'));_0x3e09b3['query']=_['keys'](_0x43678a[_0xf232('0x41')]);_0x3e09b3[_0xf232('0x42')]=_[_0xf232('0x43')](_0x3e09b3[_0xf232('0x44')],_0x3e09b3[_0xf232('0x41')]);_0xe803f[_0xf232('0x45')]=_['intersection'](_0x3e09b3[_0xf232('0x44')],qs[_0xf232('0x46')](_0x43678a[_0xf232('0x41')][_0xf232('0x46')]));_0xe803f[_0xf232('0x45')]=_0xe803f[_0xf232('0x45')][_0xf232('0x47')]?_0xe803f['attributes']:_0x3e09b3['model'];if(!_0x43678a[_0xf232('0x41')][_0xf232('0x48')]('nolimit')){_0xe803f['limit']=qs[_0xf232('0x32')](_0x43678a[_0xf232('0x41')]['limit']);_0xe803f[_0xf232('0x2f')]=qs[_0xf232('0x2f')](_0x43678a[_0xf232('0x41')][_0xf232('0x2f')]);}_0xe803f[_0xf232('0x49')]=qs['sort'](_0x43678a[_0xf232('0x41')][_0xf232('0x4a')]);_0xe803f[_0xf232('0x4b')]=qs[_0xf232('0x42')](_[_0xf232('0x4c')](_0x43678a['query'],_0x3e09b3[_0xf232('0x42')]),_0x1467f3);if(_0x43678a[_0xf232('0x41')][_0xf232('0x4d')]){_0xe803f['where']=_[_0xf232('0x4e')](_0xe803f[_0xf232('0x4b')],{'$or':_['map'](_0x1467f3,function(_0x1ec7e3){if(_0x1ec7e3['type']!==_0xf232('0x4f')){var _0x54acce={};_0x54acce[_0x1ec7e3[_0xf232('0x3d')]]={'$like':'%'+_0x43678a[_0xf232('0x41')][_0xf232('0x4d')]+'%'};return _0x54acce;}})});}_0xe803f=_[_0xf232('0x4e')]({},_0xe803f,_0x43678a['options']);var _0x2f022e={'where':_0xe803f[_0xf232('0x4b')]};return db[_0xf232('0x50')][_0xf232('0x31')](_0x2f022e)[_0xf232('0x25')](function(_0x1fe08e){_0x473044[_0xf232('0x31')]=_0x1fe08e;if(_0x43678a[_0xf232('0x41')]['includeAll']){_0xe803f[_0xf232('0x51')]=[{'all':!![]}];}return db[_0xf232('0x50')][_0xf232('0x52')](_0xe803f);})[_0xf232('0x25')](function(_0x251687){_0x473044[_0xf232('0x53')]=_0x251687;return _0x473044;})[_0xf232('0x25')](respondWithFilteredResult(_0x56cce8,_0xe803f))['catch'](handleError(_0x56cce8,null));};exports[_0xf232('0x54')]=function(_0x2b7358,_0xf935e0){var _0x4f6fff={'raw':!![],'where':{'id':_0x2b7358[_0xf232('0x55')]['id']}},_0x3b8262={};_0x3b8262[_0xf232('0x44')]=_[_0xf232('0x56')](db['ChatMessage'][_0xf232('0x3f')]);_0x3b8262[_0xf232('0x41')]=_[_0xf232('0x56')](_0x2b7358[_0xf232('0x41')]);_0x3b8262[_0xf232('0x42')]=_[_0xf232('0x43')](_0x3b8262[_0xf232('0x44')],_0x3b8262[_0xf232('0x41')]);_0x4f6fff[_0xf232('0x45')]=_[_0xf232('0x43')](_0x3b8262['model'],qs[_0xf232('0x46')](_0x2b7358[_0xf232('0x41')][_0xf232('0x46')]));_0x4f6fff[_0xf232('0x45')]=_0x4f6fff[_0xf232('0x45')][_0xf232('0x47')]?_0x4f6fff['attributes']:_0x3b8262[_0xf232('0x44')];if(_0x2b7358[_0xf232('0x41')][_0xf232('0x57')]){_0x4f6fff[_0xf232('0x51')]=[{'all':!![]}];}_0x4f6fff=_[_0xf232('0x4e')]({},_0x4f6fff,_0x2b7358['options']);return db[_0xf232('0x50')][_0xf232('0x58')](_0x4f6fff)[_0xf232('0x25')](handleEntityNotFound(_0xf935e0,null))[_0xf232('0x25')](respondWithResult(_0xf935e0,null))[_0xf232('0x2d')](handleError(_0xf935e0,null));};exports[_0xf232('0x59')]=function(_0x36f6eb,_0x59eda3){return db[_0xf232('0x50')][_0xf232('0x59')](_0x36f6eb[_0xf232('0x5a')],{})['then'](respondWithResult(_0x59eda3,0xc9))['catch'](handleError(_0x59eda3,null));};exports[_0xf232('0x39')]=function(_0x268f61,_0x348616){if(_0x268f61[_0xf232('0x5a')]['id']){delete _0x268f61[_0xf232('0x5a')]['id'];}return db[_0xf232('0x50')]['find']({'where':{'id':_0x268f61[_0xf232('0x55')]['id']}})['then'](handleEntityNotFound(_0x348616,null))[_0xf232('0x25')](saveUpdates(_0x268f61['body'],null))['then'](respondWithResult(_0x348616,null))[_0xf232('0x2d')](handleError(_0x348616,null));};exports['destroy']=function(_0x309f29,_0x21d372){return db[_0xf232('0x50')]['find']({'where':{'id':_0x309f29['params']['id']}})[_0xf232('0x25')](handleEntityNotFound(_0x21d372,null))['then'](removeEntity(_0x21d372,null))['catch'](handleError(_0x21d372,null));};exports[_0xf232('0x5b')]=function(_0x1e07bc,_0xb239ca){return db[_0xf232('0x50')]['describe']()['then'](respondWithResult(_0xb239ca,null))[_0xf232('0x2d')](handleError(_0xb239ca,null));};var interaction_log=require(_0xf232('0x16'))('chat-interactions');exports[_0xf232('0x5c')]=function(_0x49a552,_0x3ec337,_0x4ad014){var _0x1656f9={'agent':{},'channel':'chat'};if(_0x49a552[_0xf232('0x5a')]['id']){delete _0x49a552[_0xf232('0x5a')]['id'];}_0x49a552[_0xf232('0x5a')][_0xf232('0x5d')]=!![];_0x49a552[_0xf232('0x5a')][_0xf232('0x5e')]=moment()[_0xf232('0x5f')](_0xf232('0x60'));_0x49a552[_0xf232('0x5a')][_0xf232('0x61')]=_0x49a552['body'][_0xf232('0x61')]||_0x49a552[_0xf232('0x62')]['id'];_0x1656f9['agent']['id']=_0x49a552[_0xf232('0x5a')][_0xf232('0x61')];return db[_0xf232('0x50')][_0xf232('0x58')]({'where':{'id':_0x49a552['params']['id'],'UserId':null}})[_0xf232('0x25')](handleEntityNotFound(_0x3ec337,null))[_0xf232('0x25')](saveUpdates(_0x49a552[_0xf232('0x5a')],null))[_0xf232('0x25')](function(_0x27f87d){if(_0x27f87d){_0x1656f9[_0xf232('0x2c')]=_0x27f87d[_0xf232('0x63')]({'plain':!![]});return db[_0xf232('0x64')][_0xf232('0x58')]({'where':{'id':_0x27f87d[_0xf232('0x65')]}});}return null;})[_0xf232('0x25')](handleEntityNotFound(_0x3ec337,null))[_0xf232('0x25')](function(_0x3a0af8){if(_0x3a0af8){return _0x3a0af8[_0xf232('0x39')]({'UserId':_0x49a552[_0xf232('0x5a')][_0xf232('0x61')],'read1stAt':_[_0xf232('0x66')](_0x3a0af8[_0xf232('0x67')])?moment()[_0xf232('0x5f')](_0xf232('0x60')):undefined});}return null;})[_0xf232('0x25')](function(_0xa8ba7d){if(_0xa8ba7d){_0x1656f9[_0xf232('0x68')]=_0xa8ba7d[_0xf232('0x63')]({'plain':!![]});interaction_log['info'](_0xf232('0x69'),_0x49a552[_0xf232('0x62')]['id'],_0x49a552[_0xf232('0x62')]['name'],_0x49a552[_0xf232('0x62')][_0xf232('0x6a')],_0x1656f9[_0xf232('0x68')]['id'],_0x49a552[_0xf232('0x5a')]?JSON[_0xf232('0x29')](_0x49a552['body']):_0xf232('0x6b'));return respondWithRpcPromise(_0xf232('0x6c'),'acceptMessage',_0x1656f9);}return null;})[_0xf232('0x25')](function(_0x131256){var _0x56f7f7=_0xf232('0x6d')+_0x131256[_0xf232('0x2c')][_0xf232('0x6e')];return db[_0xf232('0x6f')][_0xf232('0x41')](_0x56f7f7,{'type':db[_0xf232('0x70')][_0xf232('0x71')][_0xf232('0x72')],'raw':!![]})[_0xf232('0x25')](function(_0x17253f){return _0x17253f;});})[_0xf232('0x25')](function(_0x3afeee){if(_0x3afeee){_0x1656f9[_0xf232('0x2c')][_0xf232('0x73')]=_0x3afeee[0x0];if(!_0x49a552[_0xf232('0x5a')][_0xf232('0x61')])return;return db['User'][_0xf232('0x58')]({'where':{'id':_0x49a552[_0xf232('0x5a')]['UserId'],'role':_0xf232('0x74')},'attributes':['id','name','fullname','email',_0xf232('0x75')],'raw':!![]});}return null;})[_0xf232('0x25')](function(_0x131f7e){if(!_0x131f7e)return null;_0x1656f9[_0xf232('0x2c')][_0xf232('0x74')]=_0x131f7e;return _0x1656f9;})[_0xf232('0x25')](function(_0x17d99c){if(_0x17d99c){if(_0x49a552[_0xf232('0x5a')][_0xf232('0x76')]){_0x1656f9[_0xf232('0x2c')]['interface']=util[_0xf232('0x5f')](_0xf232('0x77'),_0x49a552[_0xf232('0x62')][_0xf232('0x3d')]);_0x1656f9[_0xf232('0x2c')][_0xf232('0x78')]=_0x1656f9[_0xf232('0x78')];_0x1656f9['message'][_0xf232('0x79')]=_0x1656f9[_0xf232('0x78')];_0x1656f9[_0xf232('0x2c')][_0xf232('0x7a')]=_0xf232('0x5c');return respondWithRpcPromise(_0xf232('0x7b'),_0xf232('0x7b'),{'event':_0xf232('0x7c'),'message':_[_0xf232('0x4e')](_0x1656f9[_0xf232('0x2c')],JSON['parse'](_0x1656f9[_0xf232('0x68')][_0xf232('0x7d')]))},client9002)['then'](function(){return _0x1656f9;});}return _0x1656f9;}return null;})[_0xf232('0x25')](respondWithResult(_0x3ec337,null))[_0xf232('0x2d')](handleError(_0x3ec337,null));};var interaction_log=require(_0xf232('0x16'))('chat-interactions');exports['reject']=function(_0x412ba6,_0x1082d7,_0x538c5c){var _0x35f4cf={'agent':{},'channel':_0xf232('0x7e')};if(_0x412ba6['body']['id']){delete _0x412ba6[_0xf232('0x5a')]['id'];}_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')]=_0x412ba6['body']['UserId']||_0x412ba6[_0xf232('0x62')]['id'];_0x35f4cf[_0xf232('0x74')]['id']=_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')];return db[_0xf232('0x50')][_0xf232('0x58')]({'where':{'id':_0x412ba6['params']['id'],'UserId':null}})[_0xf232('0x25')](handleEntityNotFound(_0x1082d7,null))['then'](function(_0x394d07){if(_0x394d07){_0x35f4cf[_0xf232('0x2c')]=_0x394d07['get']({'plain':!![]});return db['ChatInteraction'][_0xf232('0x58')]({'where':{'id':_0x394d07[_0xf232('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x1082d7,null))['then'](function(_0x402330){if(_0x402330){_0x35f4cf['interaction']=_0x402330[_0xf232('0x63')]({'plain':!![]});interaction_log[_0xf232('0x26')](_0xf232('0x7f'),_0x412ba6[_0xf232('0x62')]['id'],_0x412ba6['user'][_0xf232('0x3d')],_0x412ba6['user'][_0xf232('0x6a')],_0x35f4cf[_0xf232('0x68')]['id'],_0x412ba6[_0xf232('0x5a')]?JSON[_0xf232('0x29')](_0x412ba6[_0xf232('0x5a')]):_0xf232('0x6b'));return respondWithRpcPromise(_0xf232('0x80'),'rejectMessage',_0x35f4cf);}return null;})[_0xf232('0x25')](function(_0x50abd6){var _0x9cb318=_0xf232('0x6d')+_0x50abd6[_0xf232('0x2c')][_0xf232('0x6e')];return db['sequelize']['query'](_0x9cb318,{'type':db[_0xf232('0x70')][_0xf232('0x71')][_0xf232('0x72')],'raw':!![]})[_0xf232('0x25')](function(_0x38bcee){return _0x38bcee;});})[_0xf232('0x25')](function(_0xd7d28e){if(_0xd7d28e){_0x35f4cf['message'][_0xf232('0x73')]=_0xd7d28e[0x0];if(!_0x412ba6[_0xf232('0x5a')]['UserId'])return;return db[_0xf232('0x81')][_0xf232('0x58')]({'where':{'id':_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')],'role':_0xf232('0x74')},'attributes':['id',_0xf232('0x3d'),_0xf232('0x82'),_0xf232('0x83'),_0xf232('0x75')],'raw':!![]});}return null;})[_0xf232('0x25')](function(_0x3fb8f2){if(!_0x3fb8f2)return null;_0x35f4cf['message'][_0xf232('0x74')]=_0x3fb8f2;return _0x35f4cf;})[_0xf232('0x25')](function(_0x144c07){if(_0x144c07){_0x144c07[_0xf232('0x2c')]['interface']=util['format'](_0xf232('0x77'),_0x412ba6[_0xf232('0x62')]['name']);_0x144c07['message'][_0xf232('0x78')]=_0x35f4cf['channel'];_0x144c07['message'][_0xf232('0x79')]=_0x35f4cf['channel'];_0x144c07[_0xf232('0x2c')]['event']=_0xf232('0x37');respondWithRpcPromise(_0xf232('0x7b'),_0xf232('0x7b'),{'event':_0xf232('0x84'),'message':_['merge'](_0x35f4cf[_0xf232('0x2c')],JSON[_0xf232('0x85')](_0x35f4cf['interaction']['formData']))},client9002);return _0x35f4cf;}return null;})['then'](respondWithResult(_0x1082d7,null))[_0xf232('0x2d')](handleError(_0x1082d7,null));}; \ No newline at end of file +var _0x7961=['accept','EventManager','acceptmessage','parse','interaction','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','SELECT','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','body','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','format','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event'];(function(_0x591cb6,_0x533df6){var _0x1457e7=function(_0x3d5d73){while(--_0x3d5d73){_0x591cb6['push'](_0x591cb6['shift']());}};_0x1457e7(++_0x533df6);}(_0x7961,0x119));var _0x1796=function(_0x169b28,_0x2a391a){_0x169b28=_0x169b28-0x0;var _0xcb8384=_0x7961[_0x169b28];return _0xcb8384;};'use strict';var emlformat=require(_0x1796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1796('0x1'));var jsonpatch=require(_0x1796('0x2'));var rp=require(_0x1796('0x3'));var moment=require('moment');var BPromise=require(_0x1796('0x4'));var Mustache=require('mustache');var util=require(_0x1796('0x5'));var path=require('path');var sox=require(_0x1796('0x6'));var csv=require(_0x1796('0x7'));var ejs=require(_0x1796('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1796('0x9'));var squel=require(_0x1796('0xa'));var crypto=require(_0x1796('0xb'));var jsforce=require(_0x1796('0xc'));var deskjs=require(_0x1796('0xd'));var toCsv=require(_0x1796('0x7'));var querystring=require('querystring');var Papa=require(_0x1796('0xe'));var Redis=require(_0x1796('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1796('0x10'));var hardwareService=require(_0x1796('0x11'));var logger=require(_0x1796('0x12'))(_0x1796('0x13'));var utils=require(_0x1796('0x14'));var config=require(_0x1796('0x15'));var licenseUtil=require(_0x1796('0x16'));var db=require(_0x1796('0x17'))['db'];config[_0x1796('0x18')]=_['defaults'](config[_0x1796('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1796('0x19'))(new Redis(config[_0x1796('0x18')]));require('./chatMessage.socket')[_0x1796('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1796('0x1b')]({'port':0x232c});var client9002=jayson[_0x1796('0x1c')][_0x1796('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23f11a,_0x13b4bb,_0x48fb41,_0x59ebf0){return new BPromise(function(_0x1b0a8c,_0x210d37){var _0x533260=_0x59ebf0||client;return _0x533260[_0x1796('0x1d')](_0x23f11a,_0x48fb41)[_0x1796('0x1e')](function(_0x1897af){logger[_0x1796('0x1f')](_0x1796('0x20'),_0x13b4bb,_0x1796('0x21'));logger[_0x1796('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x13b4bb,_0x1796('0x21'),JSON[_0x1796('0x23')](_0x1897af));if(_0x1897af[_0x1796('0x24')]){if(_0x1897af['error'][_0x1796('0x25')]===0x1f4){logger['error'](_0x1796('0x20'),_0x13b4bb,_0x1897af['error'][_0x1796('0x26')]);return _0x210d37(_0x1897af['error'][_0x1796('0x26')]);}logger['error'](_0x1796('0x20'),_0x13b4bb,_0x1897af[_0x1796('0x24')]['message']);return _0x1b0a8c(_0x1897af['error'][_0x1796('0x26')]);}else{logger['info'](_0x1796('0x20'),_0x13b4bb,_0x1796('0x21'));_0x1b0a8c(_0x1897af[_0x1796('0x27')]['message']);}})[_0x1796('0x28')](function(_0x43bc9c){logger[_0x1796('0x24')]('ChatMessage,\x20%s,\x20%s',_0x13b4bb,_0x43bc9c);_0x210d37(_0x43bc9c);});});}function respondWithStatusCode(_0x47ef7b,_0x12393b){_0x12393b=_0x12393b||0xcc;return function(_0x3a44dd){if(_0x3a44dd){return _0x47ef7b[_0x1796('0x29')](_0x12393b);}return _0x47ef7b[_0x1796('0x2a')](_0x12393b)[_0x1796('0x2b')]();};}function respondWithResult(_0x470e57,_0x48b00d){_0x48b00d=_0x48b00d||0xc8;return function(_0x306b83){if(_0x306b83){return _0x470e57[_0x1796('0x2a')](_0x48b00d)[_0x1796('0x2c')](_0x306b83);}};}function respondWithFilteredResult(_0x2feda9,_0x5a31fb){return function(_0xb57139){if(_0xb57139){var _0x56b95c=typeof _0x5a31fb[_0x1796('0x2d')]===_0x1796('0x2e')&&typeof _0x5a31fb['limit']===_0x1796('0x2e');var _0x269657=_0xb57139[_0x1796('0x2f')];var _0x21ed08=_0x56b95c?0x0:_0x5a31fb['offset'];var _0x457644=_0x56b95c?_0xb57139[_0x1796('0x2f')]:_0x5a31fb['offset']+_0x5a31fb['limit'];var _0x11f7a9;if(_0x457644>=_0x269657){_0x457644=_0x269657;_0x11f7a9=0xc8;}else{_0x11f7a9=0xce;}_0x2feda9[_0x1796('0x2a')](_0x11f7a9);return _0x2feda9['set'](_0x1796('0x30'),_0x21ed08+'-'+_0x457644+'/'+_0x269657)[_0x1796('0x2c')](_0xb57139);}return null;};}function patchUpdates(_0x556d27){return function(_0xc374a1){try{jsonpatch['apply'](_0xc374a1,_0x556d27,!![]);}catch(_0x453e41){return BPromise['reject'](_0x453e41);}return _0xc374a1['save']();};}function saveUpdates(_0x2036d1,_0x4c6bf9){return function(_0x34284c){if(_0x34284c){return _0x34284c[_0x1796('0x31')](_0x2036d1)[_0x1796('0x1e')](function(_0x7c8e2a){return _0x7c8e2a;});}return null;};}function removeEntity(_0x1b5dc3,_0x22c5bc){return function(_0x73030c){if(_0x73030c){return _0x73030c[_0x1796('0x32')]()[_0x1796('0x1e')](function(){_0x1b5dc3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ee58,_0x1c1e20){return function(_0x7c014d){if(!_0x7c014d){_0x29ee58['sendStatus'](0x194);}return _0x7c014d;};}function handleError(_0x3e9689,_0x35cc98){_0x35cc98=_0x35cc98||0x1f4;return function(_0x3f07f0){logger['error'](_0x3f07f0[_0x1796('0x33')]);if(_0x3f07f0[_0x1796('0x34')]){delete _0x3f07f0[_0x1796('0x34')];}_0x3e9689[_0x1796('0x2a')](_0x35cc98)[_0x1796('0x35')](_0x3f07f0);};}exports[_0x1796('0x36')]=function(_0x542027,_0x3f2741){var _0x5aa9a8={},_0x3e8cf8={},_0x4a2637={'count':0x0,'rows':[]};var _0x43a410=_['map'](db[_0x1796('0x37')][_0x1796('0x38')],function(_0x4fc782){return{'name':_0x4fc782[_0x1796('0x39')],'type':_0x4fc782[_0x1796('0x3a')][_0x1796('0x3b')]};});_0x3e8cf8[_0x1796('0x3c')]=_[_0x1796('0x3d')](_0x43a410,_0x1796('0x34'));_0x3e8cf8['query']=_[_0x1796('0x3e')](_0x542027[_0x1796('0x3f')]);_0x3e8cf8[_0x1796('0x40')]=_[_0x1796('0x41')](_0x3e8cf8['model'],_0x3e8cf8['query']);_0x5aa9a8[_0x1796('0x42')]=_['intersection'](_0x3e8cf8[_0x1796('0x3c')],qs[_0x1796('0x43')](_0x542027['query'][_0x1796('0x43')]));_0x5aa9a8['attributes']=_0x5aa9a8['attributes']['length']?_0x5aa9a8['attributes']:_0x3e8cf8['model'];if(!_0x542027[_0x1796('0x3f')][_0x1796('0x44')]('nolimit')){_0x5aa9a8['limit']=qs[_0x1796('0x45')](_0x542027[_0x1796('0x3f')][_0x1796('0x45')]);_0x5aa9a8[_0x1796('0x2d')]=qs[_0x1796('0x2d')](_0x542027[_0x1796('0x3f')]['offset']);}_0x5aa9a8[_0x1796('0x46')]=qs[_0x1796('0x47')](_0x542027['query'][_0x1796('0x47')]);_0x5aa9a8[_0x1796('0x48')]=qs['filters'](_[_0x1796('0x49')](_0x542027['query'],_0x3e8cf8[_0x1796('0x40')]),_0x43a410);if(_0x542027['query']['filter']){_0x5aa9a8[_0x1796('0x48')]=_[_0x1796('0x4a')](_0x5aa9a8[_0x1796('0x48')],{'$or':_[_0x1796('0x3d')](_0x43a410,function(_0xb7af24){if(_0xb7af24['type']!==_0x1796('0x4b')){var _0x380336={};_0x380336[_0xb7af24[_0x1796('0x34')]]={'$like':'%'+_0x542027[_0x1796('0x3f')][_0x1796('0x4c')]+'%'};return _0x380336;}})});}_0x5aa9a8=_[_0x1796('0x4a')]({},_0x5aa9a8,_0x542027[_0x1796('0x4d')]);var _0x3ea6f7={'where':_0x5aa9a8[_0x1796('0x48')]};return db['ChatMessage'][_0x1796('0x2f')](_0x3ea6f7)[_0x1796('0x1e')](function(_0x659dd5){_0x4a2637['count']=_0x659dd5;if(_0x542027['query'][_0x1796('0x4e')]){_0x5aa9a8[_0x1796('0x4f')]=[{'all':!![]}];}return db[_0x1796('0x37')][_0x1796('0x50')](_0x5aa9a8);})['then'](function(_0x3cf6b8){_0x4a2637[_0x1796('0x51')]=_0x3cf6b8;return _0x4a2637;})[_0x1796('0x1e')](respondWithFilteredResult(_0x3f2741,_0x5aa9a8))[_0x1796('0x28')](handleError(_0x3f2741,null));};exports[_0x1796('0x52')]=function(_0x5e1ef5,_0x58a310){var _0x1eb5ba={'raw':!![],'where':{'id':_0x5e1ef5[_0x1796('0x53')]['id']}},_0x3f0f92={};_0x3f0f92[_0x1796('0x3c')]=_['keys'](db[_0x1796('0x37')][_0x1796('0x38')]);_0x3f0f92[_0x1796('0x3f')]=_[_0x1796('0x3e')](_0x5e1ef5['query']);_0x3f0f92[_0x1796('0x40')]=_[_0x1796('0x41')](_0x3f0f92[_0x1796('0x3c')],_0x3f0f92['query']);_0x1eb5ba[_0x1796('0x42')]=_['intersection'](_0x3f0f92[_0x1796('0x3c')],qs['fields'](_0x5e1ef5[_0x1796('0x3f')]['fields']));_0x1eb5ba['attributes']=_0x1eb5ba[_0x1796('0x42')][_0x1796('0x54')]?_0x1eb5ba[_0x1796('0x42')]:_0x3f0f92[_0x1796('0x3c')];if(_0x5e1ef5[_0x1796('0x3f')][_0x1796('0x4e')]){_0x1eb5ba[_0x1796('0x4f')]=[{'all':!![]}];}_0x1eb5ba=_['merge']({},_0x1eb5ba,_0x5e1ef5[_0x1796('0x4d')]);return db['ChatMessage'][_0x1796('0x55')](_0x1eb5ba)[_0x1796('0x1e')](handleEntityNotFound(_0x58a310,null))['then'](respondWithResult(_0x58a310,null))[_0x1796('0x28')](handleError(_0x58a310,null));};exports['create']=function(_0x2aa68e,_0x4b14bc){return db['ChatMessage']['create'](_0x2aa68e[_0x1796('0x56')],{})[_0x1796('0x1e')](respondWithResult(_0x4b14bc,0xc9))[_0x1796('0x28')](handleError(_0x4b14bc,null));};exports[_0x1796('0x31')]=function(_0x1146c9,_0x37cd70){if(_0x1146c9[_0x1796('0x56')]['id']){delete _0x1146c9[_0x1796('0x56')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x1146c9[_0x1796('0x53')]['id']}})[_0x1796('0x1e')](handleEntityNotFound(_0x37cd70,null))[_0x1796('0x1e')](saveUpdates(_0x1146c9[_0x1796('0x56')],null))[_0x1796('0x1e')](respondWithResult(_0x37cd70,null))[_0x1796('0x28')](handleError(_0x37cd70,null));};exports[_0x1796('0x32')]=function(_0x5b8cf9,_0x56c883){return db[_0x1796('0x37')]['find']({'where':{'id':_0x5b8cf9[_0x1796('0x53')]['id']}})[_0x1796('0x1e')](handleEntityNotFound(_0x56c883,null))[_0x1796('0x1e')](removeEntity(_0x56c883,null))['catch'](handleError(_0x56c883,null));};exports[_0x1796('0x57')]=function(_0x3b963f,_0x50c78a){return db[_0x1796('0x37')][_0x1796('0x57')]()[_0x1796('0x1e')](respondWithResult(_0x50c78a,null))['catch'](handleError(_0x50c78a,null));};var interaction_log=require(_0x1796('0x12'))(_0x1796('0x58'));exports['accept']=function(_0xdb5752,_0xb2c9d4,_0x14fb47){var _0x3e4c73={'agent':{},'channel':_0x1796('0x59')};if(_0xdb5752[_0x1796('0x56')]['id']){delete _0xdb5752[_0x1796('0x56')]['id'];}_0xdb5752[_0x1796('0x56')][_0x1796('0x5a')]=!![];_0xdb5752['body'][_0x1796('0x5b')]=moment()['format'](_0x1796('0x5c'));_0xdb5752[_0x1796('0x56')]['UserId']=_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')]||_0xdb5752[_0x1796('0x5e')]['id'];_0x3e4c73[_0x1796('0x5f')]['id']=_0xdb5752['body']['UserId'];return db[_0x1796('0x37')][_0x1796('0x55')]({'where':{'id':_0xdb5752[_0x1796('0x53')]['id'],'UserId':null}})[_0x1796('0x1e')](handleEntityNotFound(_0xb2c9d4,null))[_0x1796('0x1e')](saveUpdates(_0xdb5752[_0x1796('0x56')],null))[_0x1796('0x1e')](function(_0x517900){if(_0x517900){_0x3e4c73[_0x1796('0x26')]=_0x517900['get']({'plain':!![]});return db[_0x1796('0x60')][_0x1796('0x55')]({'where':{'id':_0x517900[_0x1796('0x61')]}});}return null;})[_0x1796('0x1e')](handleEntityNotFound(_0xb2c9d4,null))[_0x1796('0x1e')](function(_0x41ac9e){if(_0x41ac9e){return _0x41ac9e[_0x1796('0x31')]({'UserId':_0xdb5752[_0x1796('0x56')]['UserId'],'read1stAt':_[_0x1796('0x62')](_0x41ac9e['read1stAt'])?moment()[_0x1796('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xeacc73){if(_0xeacc73){_0x3e4c73['interaction']=_0xeacc73[_0x1796('0x64')]({'plain':!![]});interaction_log[_0x1796('0x1f')](_0x1796('0x65'),_0xdb5752[_0x1796('0x5e')]['id'],_0xdb5752[_0x1796('0x5e')][_0x1796('0x34')],_0xdb5752[_0x1796('0x5e')][_0x1796('0x66')],_0x3e4c73['interaction']['id'],_0xdb5752[_0x1796('0x56')]?JSON['stringify'](_0xdb5752[_0x1796('0x56')]):_0x1796('0x67'));return respondWithRpcPromise(_0x1796('0x68'),_0x1796('0x69'),_0x3e4c73);}return null;})[_0x1796('0x1e')](function(_0x532c2e){var _0x161432=_0x1796('0x6a')+_0x532c2e[_0x1796('0x26')]['ContactId'];return db['sequelize']['query'](_0x161432,{'type':db['Sequelize'][_0x1796('0x6b')]['SELECT'],'raw':!![]})[_0x1796('0x1e')](function(_0x5c764a){return _0x5c764a;});})[_0x1796('0x1e')](function(_0x83b1f2){if(_0x83b1f2){_0x3e4c73[_0x1796('0x26')][_0x1796('0x6c')]=_0x83b1f2[0x0];if(!_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')])return;return db[_0x1796('0x6d')]['find']({'where':{'id':_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')],'role':'agent'},'attributes':['id','name',_0x1796('0x6e'),_0x1796('0x6f'),_0x1796('0x70')],'raw':!![]});}return null;})[_0x1796('0x1e')](function(_0x1126b6){if(!_0x1126b6)return null;_0x3e4c73[_0x1796('0x26')][_0x1796('0x5f')]=_0x1126b6;return _0x3e4c73;})[_0x1796('0x1e')](function(_0x3acbdc){if(_0x3acbdc){if(_0xdb5752[_0x1796('0x56')][_0x1796('0x71')]){_0x3e4c73[_0x1796('0x26')][_0x1796('0x72')]=util[_0x1796('0x63')](_0x1796('0x73'),_0xdb5752[_0x1796('0x5e')]['name']);_0x3e4c73[_0x1796('0x26')][_0x1796('0x74')]=_0x3e4c73[_0x1796('0x74')];_0x3e4c73[_0x1796('0x26')]['motionChannel']=_0x3e4c73['channel'];_0x3e4c73[_0x1796('0x26')][_0x1796('0x75')]=_0x1796('0x76');return respondWithRpcPromise(_0x1796('0x77'),_0x1796('0x77'),{'event':_0x1796('0x78'),'message':_[_0x1796('0x4a')](_0x3e4c73[_0x1796('0x26')],JSON[_0x1796('0x79')](_0x3e4c73[_0x1796('0x7a')][_0x1796('0x7b')]))},client9002)[_0x1796('0x1e')](function(){return _0x3e4c73;});}return _0x3e4c73;}return null;})[_0x1796('0x1e')](respondWithResult(_0xb2c9d4,null))[_0x1796('0x28')](handleError(_0xb2c9d4,null));};var interaction_log=require('../../config/logger')(_0x1796('0x58'));exports[_0x1796('0x7c')]=function(_0x1e16f8,_0x41050c,_0x25556b){var _0x148af7={'agent':{},'channel':_0x1796('0x59')};if(_0x1e16f8[_0x1796('0x56')]['id']){delete _0x1e16f8[_0x1796('0x56')]['id'];}_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')]=_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')]||_0x1e16f8[_0x1796('0x5e')]['id'];_0x148af7[_0x1796('0x5f')]['id']=_0x1e16f8['body'][_0x1796('0x5d')];return db[_0x1796('0x37')][_0x1796('0x55')]({'where':{'id':_0x1e16f8[_0x1796('0x53')]['id'],'UserId':null}})[_0x1796('0x1e')](handleEntityNotFound(_0x41050c,null))[_0x1796('0x1e')](function(_0x2446b8){if(_0x2446b8){_0x148af7['message']=_0x2446b8[_0x1796('0x64')]({'plain':!![]});return db[_0x1796('0x60')][_0x1796('0x55')]({'where':{'id':_0x2446b8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x41050c,null))[_0x1796('0x1e')](function(_0x3d5eba){if(_0x3d5eba){_0x148af7['interaction']=_0x3d5eba['get']({'plain':!![]});interaction_log[_0x1796('0x1f')](_0x1796('0x7d'),_0x1e16f8[_0x1796('0x5e')]['id'],_0x1e16f8[_0x1796('0x5e')]['name'],_0x1e16f8[_0x1796('0x5e')]['role'],_0x148af7['interaction']['id'],_0x1e16f8[_0x1796('0x56')]?JSON[_0x1796('0x23')](_0x1e16f8[_0x1796('0x56')]):_0x1796('0x67'));return respondWithRpcPromise(_0x1796('0x7e'),'rejectMessage',_0x148af7);}return null;})[_0x1796('0x1e')](function(_0xce646d){var _0x56d49d=_0x1796('0x6a')+_0xce646d[_0x1796('0x26')][_0x1796('0x7f')];return db[_0x1796('0x80')][_0x1796('0x3f')](_0x56d49d,{'type':db[_0x1796('0x81')]['QueryTypes'][_0x1796('0x82')],'raw':!![]})[_0x1796('0x1e')](function(_0x5032f3){return _0x5032f3;});})['then'](function(_0x22195c){if(_0x22195c){_0x148af7[_0x1796('0x26')]['contact']=_0x22195c[0x0];if(!_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')])return;return db['User']['find']({'where':{'id':_0x1e16f8['body']['UserId'],'role':_0x1796('0x5f')},'attributes':['id',_0x1796('0x34'),_0x1796('0x6e'),'email',_0x1796('0x70')],'raw':!![]});}return null;})[_0x1796('0x1e')](function(_0x3df92b){if(!_0x3df92b)return null;_0x148af7[_0x1796('0x26')][_0x1796('0x5f')]=_0x3df92b;return _0x148af7;})[_0x1796('0x1e')](function(_0x1b404a){if(_0x1b404a){_0x1b404a[_0x1796('0x26')][_0x1796('0x72')]=util['format'](_0x1796('0x73'),_0x1e16f8[_0x1796('0x5e')][_0x1796('0x34')]);_0x1b404a[_0x1796('0x26')]['channel']=_0x148af7[_0x1796('0x74')];_0x1b404a[_0x1796('0x26')][_0x1796('0x83')]=_0x148af7[_0x1796('0x74')];_0x1b404a[_0x1796('0x26')][_0x1796('0x75')]=_0x1796('0x7c');respondWithRpcPromise(_0x1796('0x77'),'EventManager',{'event':_0x1796('0x84'),'message':_['merge'](_0x148af7['message'],JSON[_0x1796('0x79')](_0x148af7['interaction'][_0x1796('0x7b')]))},client9002);return _0x148af7;}return null;})[_0x1796('0x1e')](respondWithResult(_0x41050c,null))[_0x1796('0x28')](handleError(_0x41050c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 85424fa..813b22a 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 _0x1f14=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','update'];(function(_0x124558,_0x17080e){var _0x5d9675=function(_0x1ddd42){while(--_0x1ddd42){_0x124558['push'](_0x124558['shift']());}};_0x5d9675(++_0x17080e);}(_0x1f14,0x14d));var _0x41f1=function(_0x4676cd,_0x8157b6){_0x4676cd=_0x4676cd-0x0;var _0x5f2bf5=_0x1f14[_0x4676cd];return _0x5f2bf5;};'use strict';var EventEmitter=require(_0x41f1('0x0'));var ChatMessage=require(_0x41f1('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x41f1('0x2'),'afterDestroy':_0x41f1('0x3')};function emitEvent(_0x4d2ec8){return function(_0x300b04,_0x5cba45,_0x5ddeed){ChatMessageEvents[_0x41f1('0x4')](_0x4d2ec8+':'+_0x300b04['id'],_0x300b04);ChatMessageEvents['emit'](_0x4d2ec8,_0x300b04);_0x5ddeed(null);};}for(var e in events){if(events[_0x41f1('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x41f1('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x3b88=['hook','exports','events','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x84ada4,_0x4b6de9){var _0x136066=function(_0x2656ce){while(--_0x2656ce){_0x84ada4['push'](_0x84ada4['shift']());}};_0x136066(++_0x4b6de9);}(_0x3b88,0x172));var _0x83b8=function(_0x33e935,_0x2a90ae){_0x33e935=_0x33e935-0x0;var _0x567143=_0x3b88[_0x33e935];return _0x567143;};'use strict';var EventEmitter=require(_0x83b8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x83b8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x83b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83b8('0x3'),'afterDestroy':_0x83b8('0x4')};function emitEvent(_0x32261a){return function(_0x2e4b9c,_0x3bcbff,_0x2af705){ChatMessageEvents[_0x83b8('0x5')](_0x32261a+':'+_0x2e4b9c['id'],_0x2e4b9c);ChatMessageEvents[_0x83b8('0x5')](_0x32261a,_0x2e4b9c);_0x2af705(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x83b8('0x6')](e,emitEvent(event));}}module[_0x83b8('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 386bf74..ccf6597 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 _0xe1bc=['../../config/environment','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x516faa,_0x5c5d62){var _0x537efa=function(_0x17c109){while(--_0x17c109){_0x516faa['push'](_0x516faa['shift']());}};_0x537efa(++_0x5c5d62);}(_0xe1bc,0xf4));var _0xce1b=function(_0x439afa,_0x2818a2){_0x439afa=_0x439afa-0x0;var _0x2182be=_0xe1bc[_0x439afa];return _0x2182be;};'use strict';var _=require('lodash');var util=require(_0xce1b('0x0'));var logger=require(_0xce1b('0x1'))(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require(_0xce1b('0x4'));var rp=require(_0xce1b('0x5'));var fs=require('fs');var path=require(_0xce1b('0x6'));var rimraf=require(_0xce1b('0x7'));var config=require(_0xce1b('0x8'));var attributes=require(_0xce1b('0x9'));module[_0xce1b('0xa')]=function(_0x2700a0,_0x286300){return _0x2700a0['define']('ChatMessage',attributes,{'tableName':_0xce1b('0xb'),'paranoid':![],'indexes':[{'name':_0xce1b('0xc'),'fields':[_0xce1b('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fe824,_0xe4c88c,_0xc258d9){var _0x453586=_0x2700a0[_0xce1b('0xe')];var _0x3d43ea=_0x3fe824[_0xce1b('0xf')]({'plain':!![]});if(_0x3d43ea[_0xce1b('0x10')][_0xce1b('0x11')]()==='in'||_0x3d43ea[_0xce1b('0x10')]['toLowerCase']()==='out'&&!_0x3d43ea['secret']&&!_[_0xce1b('0x12')](_0x3d43ea['UserId'])){_0x453586[_0xce1b('0x13')][_0xce1b('0x14')]({'where':{'id':_0x3d43ea['ChatInteractionId']}})[_0xce1b('0x15')](function(_0x10976b){if(_0x10976b){_0x10976b[_0xce1b('0x16')]({'lastMsgAt':_0x3d43ea[_0xce1b('0x17')],'lastMsgDirection':_0x3d43ea[_0xce1b('0x10')][_0xce1b('0x11')]()});}})[_0xce1b('0x18')](function(_0x1eef17){console[_0xce1b('0x19')](_0x1eef17);});}_0xc258d9();}},'charset':_0xce1b('0x1a'),'collate':_0xce1b('0x1b')});}; \ No newline at end of file +var _0xaaf2=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4'];(function(_0x38daeb,_0x1219e8){var _0x811714=function(_0x4506ca){while(--_0x4506ca){_0x38daeb['push'](_0x38daeb['shift']());}};_0x811714(++_0x1219e8);}(_0xaaf2,0x169));var _0x2aaf=function(_0xeaa661,_0xe50acb){_0xeaa661=_0xeaa661-0x0;var _0x2855d9=_0xaaf2[_0xeaa661];return _0x2855d9;};'use strict';var _=require('lodash');var util=require(_0x2aaf('0x0'));var logger=require(_0x2aaf('0x1'))('api');var moment=require(_0x2aaf('0x2'));var BPromise=require(_0x2aaf('0x3'));var rp=require(_0x2aaf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2aaf('0x5'));var config=require(_0x2aaf('0x6'));var attributes=require(_0x2aaf('0x7'));module['exports']=function(_0x12aac5,_0x3313ff){return _0x12aac5[_0x2aaf('0x8')](_0x2aaf('0x9'),attributes,{'tableName':_0x2aaf('0xa'),'paranoid':![],'indexes':[{'name':_0x2aaf('0xb'),'fields':[_0x2aaf('0xc')],'type':_0x2aaf('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b2bb9,_0x46b7dc,_0x167397){var _0x5b3157=_0x12aac5[_0x2aaf('0xe')];var _0x2a3bc8=_0x4b2bb9[_0x2aaf('0xf')]({'plain':!![]});if(_0x2a3bc8[_0x2aaf('0x10')]['toLowerCase']()==='in'||_0x2a3bc8[_0x2aaf('0x10')][_0x2aaf('0x11')]()===_0x2aaf('0x12')&&!_0x2a3bc8['secret']&&!_[_0x2aaf('0x13')](_0x2a3bc8[_0x2aaf('0x14')])){_0x5b3157[_0x2aaf('0x15')][_0x2aaf('0x16')]({'where':{'id':_0x2a3bc8['ChatInteractionId']}})[_0x2aaf('0x17')](function(_0x179351){if(_0x179351){_0x179351[_0x2aaf('0x18')]({'lastMsgAt':_0x2a3bc8[_0x2aaf('0x19')],'lastMsgDirection':_0x2a3bc8['direction'][_0x2aaf('0x11')]()});}})[_0x2aaf('0x1a')](function(_0x2ef758){console[_0x2aaf('0x1b')](_0x2ef758);});}_0x167397();}},'charset':_0x2aaf('0x1c'),'collate':_0x2aaf('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 8277800..96b6f80 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 _0x255b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c1f19,_0x430612){var _0x49b6af=function(_0x72662a){while(--_0x72662a){_0x4c1f19['push'](_0x4c1f19['shift']());}};_0x49b6af(++_0x430612);}(_0x255b,0xc4));var _0xb255=function(_0x2de229,_0x1f0025){_0x2de229=_0x2de229-0x0;var _0x59ed5d=_0x255b[_0x2de229];return _0x59ed5d;};'use strict';var _=require(_0xb255('0x0'));var util=require(_0xb255('0x1'));var moment=require(_0xb255('0x2'));var BPromise=require(_0xb255('0x3'));var rs=require(_0xb255('0x4'));var fs=require('fs');var Redis=require(_0xb255('0x5'));var db=require(_0xb255('0x6'))['db'];var utils=require(_0xb255('0x7'));var logger=require(_0xb255('0x8'))(_0xb255('0x9'));var config=require(_0xb255('0xa'));var jayson=require(_0xb255('0xb'));var client=jayson[_0xb255('0xc')][_0xb255('0xd')]({'port':0x232a});config[_0xb255('0xe')]=_[_0xb255('0xf')](config[_0xb255('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xb255('0x10'))(new Redis(config[_0xb255('0xe')]));require('./chatMessage.socket')[_0xb255('0x11')](socket);function respondWithRpcPromise(_0x5c8950,_0x1a782e,_0x182d91){return new BPromise(function(_0x35cab7,_0x26112a){return client['request'](_0x5c8950,_0x182d91)['then'](function(_0x4e0d4d){logger[_0xb255('0x12')](_0xb255('0x13'),_0x1a782e,_0xb255('0x14'));logger[_0xb255('0x15')](_0xb255('0x16'),_0x1a782e,_0xb255('0x14'),JSON[_0xb255('0x17')](_0x4e0d4d));if(_0x4e0d4d[_0xb255('0x18')]){if(_0x4e0d4d[_0xb255('0x18')]['code']===0x1f4){logger['error'](_0xb255('0x13'),_0x1a782e,_0x4e0d4d['error'][_0xb255('0x19')]);return _0x26112a(_0x4e0d4d['error'][_0xb255('0x19')]);}logger['error'](_0xb255('0x13'),_0x1a782e,_0x4e0d4d[_0xb255('0x18')][_0xb255('0x19')]);return _0x35cab7(_0x4e0d4d[_0xb255('0x18')][_0xb255('0x19')]);}else{logger[_0xb255('0x12')](_0xb255('0x13'),_0x1a782e,_0xb255('0x14'));_0x35cab7(_0x4e0d4d[_0xb255('0x1a')]['message']);}})[_0xb255('0x1b')](function(_0x2e948d){logger[_0xb255('0x18')](_0xb255('0x13'),_0x1a782e,_0x2e948d);_0x26112a(_0x2e948d);});});}exports[_0xb255('0x1c')]=function(_0x5d0a54){var _0x190a96=this;return new Promise(function(_0xc3645,_0x37ebb6){return db['ChatMessage'][_0xb255('0x1d')](_0x5d0a54[_0xb255('0x1e')],{'raw':_0x5d0a54['options']?_0x5d0a54[_0xb255('0x1f')][_0xb255('0x20')]===undefined?!![]:![]:!![]})[_0xb255('0x21')](function(_0x2ac29f){logger[_0xb255('0x12')]('CreateChatMessage',_0x5d0a54);logger['debug']('CreateChatMessage',_0x5d0a54,JSON['stringify'](_0x2ac29f));_0xc3645(_0x2ac29f);})['catch'](function(_0x3f7bdd){logger[_0xb255('0x18')](_0xb255('0x1c'),_0x3f7bdd[_0xb255('0x19')],_0x5d0a54);_0x37ebb6(_0x190a96[_0xb255('0x18')](0x1f4,_0x3f7bdd[_0xb255('0x19')]));});});}; \ No newline at end of file +var _0xb622=['create','body','options','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage'];(function(_0x1c92ff,_0x2a8111){var _0x3506e4=function(_0x217675){while(--_0x217675){_0x1c92ff['push'](_0x1c92ff['shift']());}};_0x3506e4(++_0x2a8111);}(_0xb622,0x10c));var _0x2b62=function(_0x31cbb4,_0x4d0f4a){_0x31cbb4=_0x31cbb4-0x0;var _0x340f5a=_0xb622[_0x31cbb4];return _0x340f5a;};'use strict';var _=require(_0x2b62('0x0'));var util=require('util');var moment=require(_0x2b62('0x1'));var BPromise=require(_0x2b62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b62('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b62('0x4'));var logger=require(_0x2b62('0x5'))(_0x2b62('0x6'));var config=require(_0x2b62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b62('0x8')][_0x2b62('0x9')]({'port':0x232a});config[_0x2b62('0xa')]=_[_0x2b62('0xb')](config[_0x2b62('0xa')],{'host':_0x2b62('0xc'),'port':0x18eb});var socket=require(_0x2b62('0xd'))(new Redis(config[_0x2b62('0xa')]));require(_0x2b62('0xe'))[_0x2b62('0xf')](socket);function respondWithRpcPromise(_0x314859,_0x4d792b,_0x2aef4a){return new BPromise(function(_0x2cb613,_0x478f84){return client[_0x2b62('0x10')](_0x314859,_0x2aef4a)[_0x2b62('0x11')](function(_0x4adfae){logger[_0x2b62('0x12')](_0x2b62('0x13'),_0x4d792b,_0x2b62('0x14'));logger[_0x2b62('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4d792b,_0x2b62('0x14'),JSON[_0x2b62('0x16')](_0x4adfae));if(_0x4adfae[_0x2b62('0x17')]){if(_0x4adfae[_0x2b62('0x17')]['code']===0x1f4){logger[_0x2b62('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4d792b,_0x4adfae[_0x2b62('0x17')][_0x2b62('0x18')]);return _0x478f84(_0x4adfae[_0x2b62('0x17')][_0x2b62('0x18')]);}logger[_0x2b62('0x17')](_0x2b62('0x13'),_0x4d792b,_0x4adfae[_0x2b62('0x17')]['message']);return _0x2cb613(_0x4adfae['error'][_0x2b62('0x18')]);}else{logger['info'](_0x2b62('0x13'),_0x4d792b,'request\x20sent');_0x2cb613(_0x4adfae[_0x2b62('0x19')][_0x2b62('0x18')]);}})[_0x2b62('0x1a')](function(_0x36793f){logger['error'](_0x2b62('0x13'),_0x4d792b,_0x36793f);_0x478f84(_0x36793f);});});}exports[_0x2b62('0x1b')]=function(_0x131611){var _0x2ebd97=this;return new Promise(function(_0x4887c2,_0x133902){return db[_0x2b62('0x1c')][_0x2b62('0x1d')](_0x131611[_0x2b62('0x1e')],{'raw':_0x131611[_0x2b62('0x1f')]?_0x131611[_0x2b62('0x1f')][_0x2b62('0x20')]===undefined?!![]:![]:!![]})[_0x2b62('0x11')](function(_0x51ccf9){logger['info'](_0x2b62('0x1b'),_0x131611);logger['debug'](_0x2b62('0x1b'),_0x131611,JSON[_0x2b62('0x16')](_0x51ccf9));_0x4887c2(_0x51ccf9);})['catch'](function(_0xef4add){logger[_0x2b62('0x17')](_0x2b62('0x1b'),_0xef4add[_0x2b62('0x18')],_0x131611);_0x133902(_0x2ebd97[_0x2b62('0x17')](0x1f4,_0xef4add['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ed76e4e..e1714cb 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 _0x291c=['save','remove','update','emit','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x291c,0x137));var _0xc291=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x291c[_0x3e5086];return _0xfeb102;};'use strict';var ChatMessageEvents=require(_0xc291('0x0'));var events=[_0xc291('0x1'),_0xc291('0x2'),_0xc291('0x3')];function createListener(_0xfdfc37,_0x253ebb){return function(_0xc32916){_0x253ebb[_0xc291('0x4')](_0xfdfc37,_0xc32916);};}function removeListener(_0xafdfee,_0x118ddf){return function(){ChatMessageEvents[_0xc291('0x5')](_0xafdfee,_0x118ddf);};}exports['register']=function(_0x2c96a8){for(var _0x5f2563=0x0,_0x5a7459=events[_0xc291('0x6')];_0x5f2563<_0x5a7459;_0x5f2563++){var _0x2d3526=events[_0x5f2563];var _0x42a6ac=createListener(_0xc291('0x7')+_0x2d3526,_0x2c96a8);ChatMessageEvents['on'](_0x2d3526,_0x42a6ac);}}; \ No newline at end of file +var _0xfcbd=['length','chatMessage:','./chatMessage.events','update','emit','removeListener','register'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xfcbd,0x160));var _0xdfcb=function(_0x4f6309,_0xe71e00){_0x4f6309=_0x4f6309-0x0;var _0x1c43af=_0xfcbd[_0x4f6309];return _0x1c43af;};'use strict';var ChatMessageEvents=require(_0xdfcb('0x0'));var events=['save','remove',_0xdfcb('0x1')];function createListener(_0x3df05b,_0x2785df){return function(_0x3ec4cc){_0x2785df[_0xdfcb('0x2')](_0x3df05b,_0x3ec4cc);};}function removeListener(_0xde9380,_0x545391){return function(){ChatMessageEvents[_0xdfcb('0x3')](_0xde9380,_0x545391);};}exports[_0xdfcb('0x4')]=function(_0x4bdf76){for(var _0x5615a6=0x0,_0x46956c=events[_0xdfcb('0x5')];_0x5615a6<_0x46956c;_0x5615a6++){var _0xb8de95=events[_0x5615a6];var _0x3c5431=createListener(_0xdfcb('0x6')+_0xb8de95,_0x4bdf76);ChatMessageEvents['on'](_0xb8de95,_0x3c5431);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 174cab1..0bca806 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 _0x6a78=['put','update','/:id/accept','accept','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x6a78,0x1f3));var _0x86a7=function(_0x1e94b2,_0xb0cf92){_0x1e94b2=_0x1e94b2-0x0;var _0x196398=_0x6a78[_0x1e94b2];return _0x196398;};'use strict';var multer=require(_0x86a7('0x0'));var util=require(_0x86a7('0x1'));var path=require(_0x86a7('0x2'));var timeout=require(_0x86a7('0x3'));var express=require(_0x86a7('0x4'));var router=express[_0x86a7('0x5')]();var fs_extra=require(_0x86a7('0x6'));var auth=require(_0x86a7('0x7'));var interaction=require(_0x86a7('0x8'));var config=require(_0x86a7('0x9'));var controller=require(_0x86a7('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x86a7('0xb')]);router[_0x86a7('0xc')](_0x86a7('0xd'),auth[_0x86a7('0xe')](),controller[_0x86a7('0xf')]);router[_0x86a7('0xc')](_0x86a7('0x10'),auth[_0x86a7('0xe')](),controller[_0x86a7('0x11')]);router[_0x86a7('0x12')]('/',auth['isAuthenticated'](),interaction[_0x86a7('0x13')](_0x86a7('0x14'),_0x86a7('0x15')),controller[_0x86a7('0x16')]);router[_0x86a7('0x17')](_0x86a7('0x10'),controller[_0x86a7('0x18')]);router[_0x86a7('0x17')](_0x86a7('0x19'),auth[_0x86a7('0xe')](),controller[_0x86a7('0x1a')]);router[_0x86a7('0x17')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x86a7('0x1b')]('/:id',auth[_0x86a7('0xe')](),controller['destroy']);module[_0x86a7('0x1c')]=router; \ No newline at end of file +var _0x8651=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','put','update','/:id/accept','destroy','exports','multer','util'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x8651,0xdf));var _0x1865=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x8651[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x1865('0x0'));var util=require(_0x1865('0x1'));var path=require(_0x1865('0x2'));var timeout=require(_0x1865('0x3'));var express=require(_0x1865('0x4'));var router=express['Router']();var fs_extra=require(_0x1865('0x5'));var auth=require(_0x1865('0x6'));var interaction=require(_0x1865('0x7'));var config=require(_0x1865('0x8'));var controller=require(_0x1865('0x9'));router[_0x1865('0xa')]('/',auth[_0x1865('0xb')](),controller[_0x1865('0xc')]);router['get'](_0x1865('0xd'),auth['isAuthenticated'](),controller[_0x1865('0xe')]);router[_0x1865('0xa')](_0x1865('0xf'),auth['isAuthenticated'](),controller[_0x1865('0x10')]);router[_0x1865('0x11')]('/',auth[_0x1865('0xb')](),interaction[_0x1865('0x12')](_0x1865('0x13'),'chatmessage:create'),controller['create']);router[_0x1865('0x14')](_0x1865('0xf'),controller[_0x1865('0x15')]);router[_0x1865('0x14')](_0x1865('0x16'),auth[_0x1865('0xb')](),controller['accept']);router[_0x1865('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x1865('0xf'),auth[_0x1865('0xb')](),controller[_0x1865('0x17')]);module[_0x1865('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f4d42c2..1dc0170 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 _0xf03e=['medium'];(function(_0x48b5e7,_0x8b9553){var _0x58e96b=function(_0xb0e1e0){while(--_0xb0e1e0){_0x48b5e7['push'](_0x48b5e7['shift']());}};_0x58e96b(++_0x8b9553);}(_0xf03e,0x106));var _0xef03=function(_0x11ea52,_0x49d894){_0x11ea52=_0x11ea52-0x0;var _0x18589b=_0xf03e[_0x11ea52];return _0x18589b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xef03('0x0')),'allowNull':![]}}; \ No newline at end of file +var _0xac2c=['TEXT','medium'];(function(_0x1802a7,_0x11ba60){var _0x12ffa2=function(_0x75c617){while(--_0x75c617){_0x1802a7['push'](_0x1802a7['shift']());}};_0x12ffa2(++_0x11ba60);}(_0xac2c,0x1c6));var _0xcac2=function(_0x20dd9b,_0x3c0fb8){_0x20dd9b=_0x20dd9b-0x0;var _0x2de3b0=_0xac2c[_0x20dd9b];return _0x2de3b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xcac2('0x0')](_0xcac2('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 083031f..e7dba90 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(_0x230add,_0x436a86){var _0x3350d1=function(_0x3361e2){while(--_0x3361e2){_0x230add['push'](_0x230add['shift']());}};_0x3350d1(++_0x436a86);}(_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 _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(_0x392473,_0x2c6c9a){var _0x3fc0da=function(_0x3bc381){while(--_0x3bc381){_0x392473['push'](_0x392473['shift']());}};_0x3fc0da(++_0x2c6c9a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 58f7376..5e4cbf4 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 _0x0970=['chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage'];(function(_0x2d71ca,_0x50d676){var _0x575916=function(_0x451236){while(--_0x451236){_0x2d71ca['push'](_0x2d71ca['shift']());}};_0x575916(++_0x50d676);}(_0x0970,0x11a));var _0x0097=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0970[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0097('0x0'));var util=require(_0x0097('0x1'));var logger=require(_0x0097('0x2'))(_0x0097('0x3'));var moment=require(_0x0097('0x4'));var BPromise=require('bluebird');var rp=require(_0x0097('0x5'));var fs=require('fs');var path=require(_0x0097('0x6'));var rimraf=require(_0x0097('0x7'));var config=require(_0x0097('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x0097('0x9')]=function(_0x3b0f98,_0x14290d){return _0x3b0f98[_0x0097('0xa')](_0x0097('0xb'),attributes,{'tableName':_0x0097('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0097('0xd')});}; \ No newline at end of file +var _0xde7f=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xde7f,0x1df));var _0xfde7=function(_0xd01a4c,_0x5cc431){_0xd01a4c=_0xd01a4c-0x0;var _0x52ad11=_0xde7f[_0xd01a4c];return _0x52ad11;};'use strict';var _=require(_0xfde7('0x0'));var util=require(_0xfde7('0x1'));var logger=require('../../config/logger')(_0xfde7('0x2'));var moment=require(_0xfde7('0x3'));var BPromise=require('bluebird');var rp=require(_0xfde7('0x4'));var fs=require('fs');var path=require(_0xfde7('0x5'));var rimraf=require(_0xfde7('0x6'));var config=require('../../config/environment');var attributes=require(_0xfde7('0x7'));module[_0xfde7('0x8')]=function(_0x4e80b1,_0x5bb38b){return _0x4e80b1[_0xfde7('0x9')](_0xfde7('0xa'),attributes,{'tableName':_0xfde7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfde7('0xc'),'collate':_0xfde7('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index bfcfe5a..2c04d16 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 _0xd89f=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0xaacc7b,_0xea57f4){var _0x2b902a=function(_0x4d9308){while(--_0x4d9308){_0xaacc7b['push'](_0xaacc7b['shift']());}};_0x2b902a(++_0xea57f4);}(_0xd89f,0x191));var _0xfd89=function(_0x1aed5a,_0x4634c8){_0x1aed5a=_0x1aed5a-0x0;var _0x29cd86=_0xd89f[_0x1aed5a];return _0x29cd86;};'use strict';var _=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var moment=require(_0xfd89('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd89('0x3'));var fs=require('fs');var Redis=require(_0xfd89('0x4'));var db=require(_0xfd89('0x5'))['db'];var utils=require(_0xfd89('0x6'));var logger=require(_0xfd89('0x7'))(_0xfd89('0x8'));var config=require('../../config/environment');var jayson=require(_0xfd89('0x9'));var client=jayson[_0xfd89('0xa')][_0xfd89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31322a,_0x3745e2,_0x2c02ed){return new BPromise(function(_0x2cccba,_0x163b36){return client[_0xfd89('0xc')](_0x31322a,_0x2c02ed)[_0xfd89('0xd')](function(_0x3379d3){logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,_0xfd89('0x10'));logger[_0xfd89('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3745e2,_0xfd89('0x10'),JSON[_0xfd89('0x12')](_0x3379d3));if(_0x3379d3['error']){if(_0x3379d3['error'][_0xfd89('0x13')]===0x1f4){logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x163b36(_0x3379d3[_0xfd89('0x14')]['message']);}logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x2cccba(_0x3379d3['error']['message']);}else{logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,'request\x20sent');_0x2cccba(_0x3379d3['result'][_0xfd89('0x15')]);}})[_0xfd89('0x16')](function(_0x3e0363){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3745e2,_0x3e0363);_0x163b36(_0x3e0363);});});} \ No newline at end of file +var _0xa13d=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa13d,0x154));var _0xda13=function(_0x98e17,_0x34f728){_0x98e17=_0x98e17-0x0;var _0x56170f=_0xa13d[_0x98e17];return _0x56170f;};'use strict';var _=require(_0xda13('0x0'));var util=require('util');var moment=require(_0xda13('0x1'));var BPromise=require(_0xda13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda13('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda13('0x4'));var logger=require(_0xda13('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda13('0x6'));var client=jayson[_0xda13('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48cd5f,_0x461ca0,_0x2584c5){return new BPromise(function(_0x51fa1b,_0x2f1510){return client[_0xda13('0x8')](_0x48cd5f,_0x2584c5)[_0xda13('0x9')](function(_0x3536c1){logger[_0xda13('0xa')](_0xda13('0xb'),_0x461ca0,_0xda13('0xc'));logger[_0xda13('0xd')](_0xda13('0xe'),_0x461ca0,_0xda13('0xc'),JSON[_0xda13('0xf')](_0x3536c1));if(_0x3536c1[_0xda13('0x10')]){if(_0x3536c1[_0xda13('0x10')][_0xda13('0x11')]===0x1f4){logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x3536c1[_0xda13('0x10')]['message']);return _0x2f1510(_0x3536c1[_0xda13('0x10')]['message']);}logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x3536c1['error'][_0xda13('0x12')]);return _0x51fa1b(_0x3536c1[_0xda13('0x10')][_0xda13('0x12')]);}else{logger[_0xda13('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x461ca0,_0xda13('0xc'));_0x51fa1b(_0x3536c1[_0xda13('0x13')]['message']);}})[_0xda13('0x14')](function(_0x4d17a9){logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x4d17a9);_0x2f1510(_0x4d17a9);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ea18af3..baa150a 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 _0x85d2=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x276534,_0xa635a9){var _0x252114=function(_0x5686f5){while(--_0x5686f5){_0x276534['push'](_0x276534['shift']());}};_0x252114(++_0xa635a9);}(_0x85d2,0x188));var _0x285d=function(_0x343d77,_0x1f8cf8){_0x343d77=_0x343d77-0x0;var _0x2f1882=_0x85d2[_0x343d77];return _0x2f1882;};'use strict';var multer=require(_0x285d('0x0'));var util=require('util');var path=require(_0x285d('0x1'));var timeout=require(_0x285d('0x2'));var express=require(_0x285d('0x3'));var router=express[_0x285d('0x4')]();var fs_extra=require(_0x285d('0x5'));var auth=require(_0x285d('0x6'));var interaction=require(_0x285d('0x7'));var config=require(_0x285d('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x285d('0x9')]('/',auth[_0x285d('0xa')](),controller[_0x285d('0xb')]);router[_0x285d('0x9')](_0x285d('0xc'),auth['isAuthenticated'](),controller[_0x285d('0xd')]);router[_0x285d('0x9')](_0x285d('0xe'),auth['isAuthenticated'](),controller[_0x285d('0xf')]);router['post']('/',auth[_0x285d('0xa')](),controller[_0x285d('0x10')]);router['put'](_0x285d('0xe'),auth[_0x285d('0xa')](),controller[_0x285d('0x11')]);router[_0x285d('0x12')](_0x285d('0xe'),auth[_0x285d('0xa')](),controller[_0x285d('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc33e=['show','post','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x165e09,_0x1ca790){var _0x2f5093=function(_0x2664e4){while(--_0x2664e4){_0x165e09['push'](_0x165e09['shift']());}};_0x2f5093(++_0x1ca790);}(_0xc33e,0xee));var _0xec33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xec33('0x0'));var path=require(_0xec33('0x1'));var timeout=require('connect-timeout');var express=require(_0xec33('0x2'));var router=express[_0xec33('0x3')]();var fs_extra=require(_0xec33('0x4'));var auth=require(_0xec33('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec33('0x6'));var controller=require(_0xec33('0x7'));router[_0xec33('0x8')]('/',auth[_0xec33('0x9')](),controller[_0xec33('0xa')]);router['get'](_0xec33('0xb'),auth['isAuthenticated'](),controller[_0xec33('0xc')]);router['get'](_0xec33('0xd'),auth['isAuthenticated'](),controller[_0xec33('0xe')]);router[_0xec33('0xf')]('/',auth['isAuthenticated'](),controller[_0xec33('0x10')]);router[_0xec33('0x11')]('/:id',auth[_0xec33('0x9')](),controller[_0xec33('0x12')]);router['delete'](_0xec33('0xd'),auth[_0xec33('0x9')](),controller[_0xec33('0x13')]);module[_0xec33('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index cbd849d..201fba2 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 _0x1952=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x149f85,_0x4a3a54){var _0x177f93=function(_0x5f1384){while(--_0x5f1384){_0x149f85['push'](_0x149f85['shift']());}};_0x177f93(++_0x4a3a54);}(_0x1952,0x83));var _0x2195=function(_0xb94148,_0x391540){_0xb94148=_0xb94148-0x0;var _0x46ca63=_0x1952[_0xb94148];return _0x46ca63;};'use strict';var Sequelize=require(_0x2195('0x0'));module[_0x2195('0x1')]={'name':{'type':Sequelize[_0x2195('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2195('0x3')](_0x2195('0x4'),_0x2195('0x5')),'defaultValue':_0x2195('0x4')},'selector':{'type':Sequelize[_0x2195('0x2')]},'timeout':{'type':Sequelize[_0x2195('0x6')]}}; \ No newline at end of file +var _0x459e=['mouseOver','timeout','sequelize','exports','STRING'];(function(_0x26ce19,_0x56cb79){var _0x3b923e=function(_0x54b832){while(--_0x54b832){_0x26ce19['push'](_0x26ce19['shift']());}};_0x3b923e(++_0x56cb79);}(_0x459e,0x1c9));var _0xe459=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x459e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe459('0x0'));module[_0xe459('0x1')]={'name':{'type':Sequelize[_0xe459('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe459('0x3'),_0xe459('0x4')),'defaultValue':_0xe459('0x3')},'selector':{'type':Sequelize[_0xe459('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 55864fe..00a2f0b 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 _0x3c6c=['include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x456b00,_0x5f3ffb){_0x456b00=_0x456b00-0x0;var _0xf9f87c=_0x3c6c[_0x456b00];return _0xf9f87c;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={'raw':!![],'where':{'id':_0x2e4094[_0xc3c6('0x29')]['id']}},_0xb047b1={};_0xb047b1[_0xc3c6('0x2a')]=_[_0xc3c6('0x2b')](db['ChatProactiveAction'][_0xc3c6('0x2c')]);_0xb047b1[_0xc3c6('0x2d')]=_[_0xc3c6('0x2b')](_0x2e4094[_0xc3c6('0x2d')]);_0xb047b1[_0xc3c6('0x2e')]=_[_0xc3c6('0x2f')](_0xb047b1['model'],_0xb047b1[_0xc3c6('0x2d')]);_0x478a4b[_0xc3c6('0x30')]=_[_0xc3c6('0x2f')](_0xb047b1[_0xc3c6('0x2a')],qs[_0xc3c6('0x31')](_0x2e4094['query'][_0xc3c6('0x31')]));_0x478a4b[_0xc3c6('0x30')]=_0x478a4b[_0xc3c6('0x30')][_0xc3c6('0x32')]?_0x478a4b[_0xc3c6('0x30')]:_0xb047b1[_0xc3c6('0x2a')];if(_0x2e4094[_0xc3c6('0x2d')]['includeAll']){_0x478a4b[_0xc3c6('0x33')]=[{'all':!![]}];}_0x478a4b=_['merge']({},_0x478a4b,_0x2e4094[_0xc3c6('0x34')]);return db[_0xc3c6('0x35')][_0xc3c6('0x36')](_0x478a4b)[_0xc3c6('0x23')](handleEntityNotFound(_0x1f1d36,null))[_0xc3c6('0x23')](respondWithResult(_0x1f1d36,null))[_0xc3c6('0x37')](handleError(_0x1f1d36,null));};exports['create']=function(_0x36562e,_0x2bba67){return db['ChatProactiveAction'][_0xc3c6('0x38')](_0x36562e[_0xc3c6('0x39')],{})[_0xc3c6('0x23')](respondWithResult(_0x2bba67,0xc9))[_0xc3c6('0x37')](handleError(_0x2bba67,null));};exports[_0xc3c6('0x21')]=function(_0x377a2f,_0x21163c){if(_0x377a2f['body']['id']){delete _0x377a2f['body']['id'];}return db[_0xc3c6('0x35')][_0xc3c6('0x36')]({'where':{'id':_0x377a2f[_0xc3c6('0x29')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x21163c,null))[_0xc3c6('0x23')](saveUpdates(_0x377a2f['body'],null))[_0xc3c6('0x23')](respondWithResult(_0x21163c,null))[_0xc3c6('0x37')](handleError(_0x21163c,null));};exports[_0xc3c6('0x22')]=function(_0x4aae1e,_0x1eb423){return db[_0xc3c6('0x35')][_0xc3c6('0x36')]({'where':{'id':_0x4aae1e[_0xc3c6('0x29')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x1eb423,null))['then'](removeEntity(_0x1eb423,null))[_0xc3c6('0x37')](handleError(_0x1eb423,null));}; \ No newline at end of file +var _0x0686=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x799571,_0x574f6e){var _0x2ecb3c=function(_0x4d0efc){while(--_0x4d0efc){_0x799571['push'](_0x799571['shift']());}};_0x2ecb3c(++_0x574f6e);}(_0x0686,0x123));var _0x6068=function(_0xdb72e3,_0xf56de){_0xdb72e3=_0xdb72e3-0x0;var _0x372af7=_0x0686[_0xdb72e3];return _0x372af7;};'use strict';var emlformat=require(_0x6068('0x0'));var rimraf=require(_0x6068('0x1'));var zipdir=require(_0x6068('0x2'));var jsonpatch=require(_0x6068('0x3'));var rp=require(_0x6068('0x4'));var moment=require(_0x6068('0x5'));var BPromise=require(_0x6068('0x6'));var Mustache=require('mustache');var util=require(_0x6068('0x7'));var path=require(_0x6068('0x8'));var sox=require(_0x6068('0x9'));var csv=require(_0x6068('0xa'));var ejs=require(_0x6068('0xb'));var fs=require('fs');var fs_extra=require(_0x6068('0xc'));var _=require(_0x6068('0xd'));var squel=require(_0x6068('0xe'));var crypto=require(_0x6068('0xf'));var jsforce=require(_0x6068('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6068('0xa'));var querystring=require(_0x6068('0x11'));var Papa=require(_0x6068('0x12'));var Redis=require(_0x6068('0x13'));var authService=require(_0x6068('0x14'));var qs=require(_0x6068('0x15'));var as=require(_0x6068('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6068('0x17'))(_0x6068('0x18'));var utils=require(_0x6068('0x19'));var config=require(_0x6068('0x1a'));var licenseUtil=require(_0x6068('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8918,_0x3a67ec){_0x3a67ec=_0x3a67ec||0xcc;return function(_0x5eba85){if(_0x5eba85){return _0x1f8918[_0x6068('0x1c')](_0x3a67ec);}return _0x1f8918[_0x6068('0x1d')](_0x3a67ec)[_0x6068('0x1e')]();};}function respondWithResult(_0x31b190,_0x1257b2){_0x1257b2=_0x1257b2||0xc8;return function(_0x1eb53c){if(_0x1eb53c){return _0x31b190[_0x6068('0x1d')](_0x1257b2)[_0x6068('0x1f')](_0x1eb53c);}};}function respondWithFilteredResult(_0xcb09de,_0x5d50c5){return function(_0x45a455){if(_0x45a455){var _0x1416b7=typeof _0x5d50c5['offset']===_0x6068('0x20')&&typeof _0x5d50c5[_0x6068('0x21')]===_0x6068('0x20');var _0x321d80=_0x45a455['count'];var _0x47e38a=_0x1416b7?0x0:_0x5d50c5[_0x6068('0x22')];var _0x1f0e7e=_0x1416b7?_0x45a455[_0x6068('0x23')]:_0x5d50c5[_0x6068('0x22')]+_0x5d50c5['limit'];var _0x4d5a09;if(_0x1f0e7e>=_0x321d80){_0x1f0e7e=_0x321d80;_0x4d5a09=0xc8;}else{_0x4d5a09=0xce;}_0xcb09de[_0x6068('0x1d')](_0x4d5a09);return _0xcb09de[_0x6068('0x24')](_0x6068('0x25'),_0x47e38a+'-'+_0x1f0e7e+'/'+_0x321d80)[_0x6068('0x1f')](_0x45a455);}return null;};}function patchUpdates(_0x247c2d){return function(_0x149512){try{jsonpatch[_0x6068('0x26')](_0x149512,_0x247c2d,!![]);}catch(_0x4ee2eb){return BPromise['reject'](_0x4ee2eb);}return _0x149512['save']();};}function saveUpdates(_0x3fea81,_0x138946){return function(_0x1b4f91){if(_0x1b4f91){return _0x1b4f91[_0x6068('0x27')](_0x3fea81)[_0x6068('0x28')](function(_0xa6c2a0){return _0xa6c2a0;});}return null;};}function removeEntity(_0x1046f3,_0x132793){return function(_0x5cf58c){if(_0x5cf58c){return _0x5cf58c[_0x6068('0x29')]()[_0x6068('0x28')](function(){_0x1046f3['status'](0xcc)[_0x6068('0x1e')]();});}};}function handleEntityNotFound(_0x57783a,_0x11f226){return function(_0x464999){if(!_0x464999){_0x57783a[_0x6068('0x1c')](0x194);}return _0x464999;};}function handleError(_0x59cfeb,_0x26b754){_0x26b754=_0x26b754||0x1f4;return function(_0x5a880b){logger[_0x6068('0x2a')](_0x5a880b[_0x6068('0x2b')]);if(_0x5a880b[_0x6068('0x2c')]){delete _0x5a880b[_0x6068('0x2c')];}_0x59cfeb[_0x6068('0x1d')](_0x26b754)[_0x6068('0x2d')](_0x5a880b);};}exports[_0x6068('0x2e')]=function(_0x360ffc,_0x20fc70){var _0xcdc594={'raw':!![],'where':{'id':_0x360ffc[_0x6068('0x2f')]['id']}},_0x49adb6={};_0x49adb6[_0x6068('0x30')]=_[_0x6068('0x31')](db[_0x6068('0x32')][_0x6068('0x33')]);_0x49adb6[_0x6068('0x34')]=_[_0x6068('0x31')](_0x360ffc[_0x6068('0x34')]);_0x49adb6['filters']=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],_0x49adb6[_0x6068('0x34')]);_0xcdc594[_0x6068('0x36')]=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],qs[_0x6068('0x37')](_0x360ffc[_0x6068('0x34')]['fields']));_0xcdc594[_0x6068('0x36')]=_0xcdc594[_0x6068('0x36')][_0x6068('0x38')]?_0xcdc594[_0x6068('0x36')]:_0x49adb6[_0x6068('0x30')];if(_0x360ffc[_0x6068('0x34')]['includeAll']){_0xcdc594['include']=[{'all':!![]}];}_0xcdc594=_[_0x6068('0x39')]({},_0xcdc594,_0x360ffc['options']);return db['ChatProactiveAction'][_0x6068('0x3a')](_0xcdc594)[_0x6068('0x28')](handleEntityNotFound(_0x20fc70,null))['then'](respondWithResult(_0x20fc70,null))[_0x6068('0x3b')](handleError(_0x20fc70,null));};exports[_0x6068('0x3c')]=function(_0x22aadb,_0x44abfd){return db[_0x6068('0x32')][_0x6068('0x3c')](_0x22aadb['body'],{})[_0x6068('0x28')](respondWithResult(_0x44abfd,0xc9))[_0x6068('0x3b')](handleError(_0x44abfd,null));};exports[_0x6068('0x27')]=function(_0x2d8674,_0x10e384){if(_0x2d8674[_0x6068('0x3d')]['id']){delete _0x2d8674[_0x6068('0x3d')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2d8674[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10e384,null))[_0x6068('0x28')](saveUpdates(_0x2d8674[_0x6068('0x3d')],null))[_0x6068('0x28')](respondWithResult(_0x10e384,null))[_0x6068('0x3b')](handleError(_0x10e384,null));};exports[_0x6068('0x29')]=function(_0x4f1dd0,_0x2c350d){return db[_0x6068('0x32')]['find']({'where':{'id':_0x4f1dd0[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2c350d,null))['then'](removeEntity(_0x2c350d,null))[_0x6068('0x3b')](handleError(_0x2c350d,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 4712737..786dc64 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 _0x000a=['ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4e1cec,_0x1aced8){var _0x1b2b31=function(_0x491ba0){while(--_0x491ba0){_0x4e1cec['push'](_0x4e1cec['shift']());}};_0x1b2b31(++_0x1aced8);}(_0x000a,0x1e2));var _0xa000=function(_0x3fa46b,_0x4157b7){_0x3fa46b=_0x3fa46b-0x0;var _0x5e387c=_0x000a[_0x3fa46b];return _0x5e387c;};'use strict';var _=require(_0xa000('0x0'));var util=require(_0xa000('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa000('0x2'));var BPromise=require(_0xa000('0x3'));var rp=require(_0xa000('0x4'));var fs=require('fs');var path=require(_0xa000('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x2267c8,_0x50968a){return _0x2267c8['define'](_0xa000('0x6'),attributes,{'tableName':_0xa000('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5873=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2df6a7,_0x5780b6){var _0x3cfcb1=function(_0x24bd4b){while(--_0x24bd4b){_0x2df6a7['push'](_0x2df6a7['shift']());}};_0x3cfcb1(++_0x5780b6);}(_0x5873,0x174));var _0x3587=function(_0x3c4063,_0x373d54){_0x3c4063=_0x3c4063-0x0;var _0xf65271=_0x5873[_0x3c4063];return _0xf65271;};'use strict';var _=require(_0x3587('0x0'));var util=require(_0x3587('0x1'));var logger=require(_0x3587('0x2'))(_0x3587('0x3'));var moment=require(_0x3587('0x4'));var BPromise=require(_0x3587('0x5'));var rp=require(_0x3587('0x6'));var fs=require('fs');var path=require(_0x3587('0x7'));var rimraf=require(_0x3587('0x8'));var config=require(_0x3587('0x9'));var attributes=require(_0x3587('0xa'));module['exports']=function(_0xb6efd9,_0x25926d){return _0xb6efd9[_0x3587('0xb')](_0x3587('0xc'),attributes,{'tableName':_0x3587('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index bcd04a0..2bb6286 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 _0xeeaa=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x5efaf0,_0x22e6c0){var _0x151ff1=function(_0x40434f){while(--_0x40434f){_0x5efaf0['push'](_0x5efaf0['shift']());}};_0x151ff1(++_0x22e6c0);}(_0xeeaa,0xac));var _0xaeea=function(_0x29695e,_0x2e81a6){_0x29695e=_0x29695e-0x0;var _0x5d0716=_0xeeaa[_0x29695e];return _0x5d0716;};'use strict';var _=require(_0xaeea('0x0'));var util=require(_0xaeea('0x1'));var moment=require(_0xaeea('0x2'));var BPromise=require('bluebird');var rs=require(_0xaeea('0x3'));var fs=require('fs');var Redis=require(_0xaeea('0x4'));var db=require(_0xaeea('0x5'))['db'];var utils=require(_0xaeea('0x6'));var logger=require('../../config/logger')(_0xaeea('0x7'));var config=require(_0xaeea('0x8'));var jayson=require(_0xaeea('0x9'));var client=jayson['client'][_0xaeea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453796,_0x4a81b1,_0x425404){return new BPromise(function(_0x2ea3ff,_0x539663){return client['request'](_0x453796,_0x425404)[_0xaeea('0xb')](function(_0x69845d){logger['info'](_0xaeea('0xc'),_0x4a81b1,_0xaeea('0xd'));logger[_0xaeea('0xe')](_0xaeea('0xf'),_0x4a81b1,_0xaeea('0xd'),JSON[_0xaeea('0x10')](_0x69845d));if(_0x69845d[_0xaeea('0x11')]){if(_0x69845d[_0xaeea('0x11')]['code']===0x1f4){logger[_0xaeea('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a81b1,_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);return _0x539663(_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);}logger[_0xaeea('0x11')](_0xaeea('0xc'),_0x4a81b1,_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);return _0x2ea3ff(_0x69845d[_0xaeea('0x11')]['message']);}else{logger[_0xaeea('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a81b1,_0xaeea('0xd'));_0x2ea3ff(_0x69845d[_0xaeea('0x14')][_0xaeea('0x12')]);}})[_0xaeea('0x15')](function(_0x2ed758){logger['error'](_0xaeea('0xc'),_0x4a81b1,_0x2ed758);_0x539663(_0x2ed758);});});} \ No newline at end of file +var _0x9d18=['rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x861e2,_0x3439db){var _0x8d264=function(_0x2ced74){while(--_0x2ced74){_0x861e2['push'](_0x861e2['shift']());}};_0x8d264(++_0x3439db);}(_0x9d18,0x150));var _0x89d1=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0x9d18[_0x4f66c2];return _0x447633;};'use strict';var _=require(_0x89d1('0x0'));var util=require(_0x89d1('0x1'));var moment=require('moment');var BPromise=require(_0x89d1('0x2'));var rs=require(_0x89d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89d1('0x4'))['db'];var utils=require(_0x89d1('0x5'));var logger=require('../../config/logger')(_0x89d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x89d1('0x7'));var client=jayson[_0x89d1('0x8')][_0x89d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cedb7,_0xcb4319,_0x515dc4){return new BPromise(function(_0x4c30c6,_0x467fa3){return client['request'](_0x3cedb7,_0x515dc4)[_0x89d1('0xa')](function(_0x3d0b3d){logger[_0x89d1('0xb')](_0x89d1('0xc'),_0xcb4319,_0x89d1('0xd'));logger['debug'](_0x89d1('0xe'),_0xcb4319,'request\x20sent',JSON['stringify'](_0x3d0b3d));if(_0x3d0b3d[_0x89d1('0xf')]){if(_0x3d0b3d[_0x89d1('0xf')][_0x89d1('0x10')]===0x1f4){logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x3d0b3d['error'][_0x89d1('0x11')]);return _0x467fa3(_0x3d0b3d['error']['message']);}logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x3d0b3d[_0x89d1('0xf')][_0x89d1('0x11')]);return _0x4c30c6(_0x3d0b3d[_0x89d1('0xf')]['message']);}else{logger[_0x89d1('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0xcb4319,_0x89d1('0xd'));_0x4c30c6(_0x3d0b3d['result'][_0x89d1('0x11')]);}})[_0x89d1('0x12')](function(_0x14e490){logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x14e490);_0x467fa3(_0x14e490);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f42a19c..7c19f57 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 _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x7c09,0x102));var _0x97c0=function(_0x53f32e,_0x567f93){_0x53f32e=_0x53f32e-0x0;var _0x56ed42=_0x7c09[_0x53f32e];return _0x56ed42;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router; \ No newline at end of file +var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x43cc3b,_0x2f3963){var _0x44fe5e=function(_0x101a19){while(--_0x101a19){_0x43cc3b['push'](_0x43cc3b['shift']());}};_0x44fe5e(++_0x2f3963);}(_0x7c09,0x102));var _0x97c0=function(_0xf3faf1,_0x445650){_0xf3faf1=_0xf3faf1-0x0;var _0x55b2c9=_0x7c09[_0xf3faf1];return _0x55b2c9;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a68efd5..12a7168 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 _0x875c=['exports','STRING','name','rrmemory','beepall','roundrobin','sequelize'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0x875c,0x84));var _0xc875=function(_0xf609,_0x3353f8){_0xf609=_0xf609-0x0;var _0x207fd6=_0x875c[_0xf609];return _0x207fd6;};'use strict';var Sequelize=require(_0xc875('0x0'));module[_0xc875('0x1')]={'name':{'type':Sequelize[_0xc875('0x2')],'unique':_0xc875('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc875('0x4'),_0xc875('0x5'),_0xc875('0x6'))}}; \ No newline at end of file +var _0xfab2=['exports','STRING','ENUM','beepall','roundrobin'];(function(_0x191924,_0x12af30){var _0x12c4d9=function(_0x1ee0bb){while(--_0x1ee0bb){_0x191924['push'](_0x191924['shift']());}};_0x12c4d9(++_0x12af30);}(_0xfab2,0xdc));var _0x2fab=function(_0x281270,_0x36cf85){_0x281270=_0x281270-0x0;var _0x387fd5=_0xfab2[_0x281270];return _0x387fd5;};'use strict';var Sequelize=require('sequelize');module[_0x2fab('0x0')]={'name':{'type':Sequelize[_0x2fab('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fab('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2fab('0x2')]('rrmemory',_0x2fab('0x3'),_0x2fab('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c162dfb..87912dc 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 _0x5ce9=['where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','updatedAt','createdAt','SIP','chatPause','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x3028c1,_0x4bfb71){var _0x3e508a=function(_0x5ceb03){while(--_0x5ceb03){_0x3028c1['push'](_0x3028c1['shift']());}};_0x3e508a(++_0x4bfb71);}(_0x5ce9,0x165));var _0x95ce=function(_0x20e756,_0x5f4537){_0x20e756=_0x20e756-0x0;var _0xa60cd1=_0x5ce9[_0x20e756];return _0xa60cd1;};'use strict';var emlformat=require(_0x95ce('0x0'));var rimraf=require(_0x95ce('0x1'));var zipdir=require(_0x95ce('0x2'));var jsonpatch=require(_0x95ce('0x3'));var rp=require('request-promise');var moment=require(_0x95ce('0x4'));var BPromise=require(_0x95ce('0x5'));var Mustache=require(_0x95ce('0x6'));var util=require(_0x95ce('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x95ce('0x8'));var ejs=require(_0x95ce('0x9'));var fs=require('fs');var fs_extra=require(_0x95ce('0xa'));var _=require(_0x95ce('0xb'));var squel=require(_0x95ce('0xc'));var crypto=require(_0x95ce('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95ce('0x8'));var querystring=require(_0x95ce('0xe'));var Papa=require(_0x95ce('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95ce('0x10'));var as=require(_0x95ce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ce('0x12'))(_0x95ce('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x95ce('0x14'))['db'];config['redis']=_[_0x95ce('0x15')](config[_0x95ce('0x16')],{'host':_0x95ce('0x17'),'port':0x18eb});var socket=require(_0x95ce('0x18'))(new Redis(config[_0x95ce('0x16')]));require(_0x95ce('0x19'))[_0x95ce('0x1a')](socket);var jayson=require(_0x95ce('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31882f,_0x5aea46,_0x4a9515,_0x143458){return new BPromise(function(_0x3fc34b,_0x1c4425){var _0x4b2e24=_0x143458||client;return _0x4b2e24[_0x95ce('0x1c')](_0x31882f,_0x4a9515)[_0x95ce('0x1d')](function(_0x2922f7){logger[_0x95ce('0x1e')](_0x95ce('0x1f'),_0x5aea46,_0x95ce('0x20'));logger[_0x95ce('0x21')](_0x95ce('0x22'),_0x5aea46,'request\x20sent',JSON[_0x95ce('0x23')](_0x2922f7));if(_0x2922f7['error']){if(_0x2922f7[_0x95ce('0x24')][_0x95ce('0x25')]===0x1f4){logger['error'](_0x95ce('0x1f'),_0x5aea46,_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);return _0x1c4425(_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);}logger[_0x95ce('0x24')](_0x95ce('0x1f'),_0x5aea46,_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);return _0x3fc34b(_0x2922f7[_0x95ce('0x24')]['message']);}else{logger[_0x95ce('0x1e')](_0x95ce('0x1f'),_0x5aea46,'request\x20sent');_0x3fc34b(_0x2922f7[_0x95ce('0x27')][_0x95ce('0x26')]);}})[_0x95ce('0x28')](function(_0xdfdad9){logger[_0x95ce('0x24')](_0x95ce('0x1f'),_0x5aea46,_0xdfdad9);_0x1c4425(_0xdfdad9);});});}function respondWithStatusCode(_0x167a9d,_0x1a9a1b){_0x1a9a1b=_0x1a9a1b||0xcc;return function(_0x3c9f1c){if(_0x3c9f1c){return _0x167a9d[_0x95ce('0x29')](_0x1a9a1b);}return _0x167a9d[_0x95ce('0x2a')](_0x1a9a1b)[_0x95ce('0x2b')]();};}function respondWithResult(_0x7ef273,_0x1135b3){_0x1135b3=_0x1135b3||0xc8;return function(_0x53683d){if(_0x53683d){return _0x7ef273[_0x95ce('0x2a')](_0x1135b3)[_0x95ce('0x2c')](_0x53683d);}};}function respondWithFilteredResult(_0x212e86,_0x2be246){return function(_0x499ef1){if(_0x499ef1){var _0x380772=typeof _0x2be246['offset']==='undefined'&&typeof _0x2be246[_0x95ce('0x2d')]==='undefined';var _0x565e6e=_0x499ef1[_0x95ce('0x2e')];var _0x5c70a9=_0x380772?0x0:_0x2be246['offset'];var _0x425724=_0x380772?_0x499ef1[_0x95ce('0x2e')]:_0x2be246[_0x95ce('0x2f')]+_0x2be246[_0x95ce('0x2d')];var _0x4613ae;if(_0x425724>=_0x565e6e){_0x425724=_0x565e6e;_0x4613ae=0xc8;}else{_0x4613ae=0xce;}_0x212e86[_0x95ce('0x2a')](_0x4613ae);return _0x212e86[_0x95ce('0x30')](_0x95ce('0x31'),_0x5c70a9+'-'+_0x425724+'/'+_0x565e6e)[_0x95ce('0x2c')](_0x499ef1);}return null;};}function patchUpdates(_0x45c084){return function(_0x173967){try{jsonpatch['apply'](_0x173967,_0x45c084,!![]);}catch(_0x53388f){return BPromise[_0x95ce('0x32')](_0x53388f);}return _0x173967[_0x95ce('0x33')]();};}function saveUpdates(_0x1c3946,_0xc9570a){return function(_0x6f3f72){if(_0x6f3f72){return _0x6f3f72[_0x95ce('0x34')](_0x1c3946)[_0x95ce('0x1d')](function(_0x53eef3){return _0x53eef3;});}return null;};}function removeEntity(_0x32b253,_0x48829b){return function(_0x4d97f8){if(_0x4d97f8){return _0x4d97f8['destroy']()[_0x95ce('0x1d')](function(){var _0x5dc56b=_0x4d97f8[_0x95ce('0x35')]({'plain':!![]});var _0x249686=_0x95ce('0x36');return db[_0x95ce('0x37')][_0x95ce('0x38')]({'where':{'type':_0x249686,'resourceId':_0x5dc56b['id']}})[_0x95ce('0x1d')](function(){return _0x4d97f8;});})[_0x95ce('0x1d')](function(){_0x32b253[_0x95ce('0x2a')](0xcc)[_0x95ce('0x2b')]();});}};}function handleEntityNotFound(_0x5a7a80,_0x116bcd){return function(_0x409c86){if(!_0x409c86){_0x5a7a80[_0x95ce('0x29')](0x194);}return _0x409c86;};}function handleError(_0x165e74,_0x104a96){_0x104a96=_0x104a96||0x1f4;return function(_0x35a781){logger[_0x95ce('0x24')](_0x35a781[_0x95ce('0x39')]);if(_0x35a781[_0x95ce('0x3a')]){delete _0x35a781[_0x95ce('0x3a')];}_0x165e74['status'](_0x104a96)[_0x95ce('0x3b')](_0x35a781);};}exports['index']=function(_0x1df593,_0x3c8cba){var _0x4a0c3b={},_0x1f2ae2={},_0x1f2b8c={'count':0x0,'rows':[]};var _0x3efe50=_[_0x95ce('0x3c')](db[_0x95ce('0x3d')][_0x95ce('0x3e')],function(_0x3e941d){return{'name':_0x3e941d[_0x95ce('0x3f')],'type':_0x3e941d['type'][_0x95ce('0x40')]};});_0x1f2ae2[_0x95ce('0x41')]=_['map'](_0x3efe50,_0x95ce('0x3a'));_0x1f2ae2[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x1df593[_0x95ce('0x42')]);_0x1f2ae2[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x1f2ae2[_0x95ce('0x41')],_0x1f2ae2[_0x95ce('0x42')]);_0x4a0c3b[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1f2ae2[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x1df593[_0x95ce('0x42')]['fields']));_0x4a0c3b[_0x95ce('0x46')]=_0x4a0c3b['attributes']['length']?_0x4a0c3b['attributes']:_0x1f2ae2['model'];if(!_0x1df593[_0x95ce('0x42')][_0x95ce('0x48')]('nolimit')){_0x4a0c3b[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x2d')]);_0x4a0c3b[_0x95ce('0x2f')]=qs[_0x95ce('0x2f')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x2f')]);}_0x4a0c3b[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x4a')]);_0x4a0c3b[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x1df593[_0x95ce('0x42')],_0x1f2ae2['filters']),_0x3efe50);if(_0x1df593[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x4a0c3b['where']=_[_0x95ce('0x4e')](_0x4a0c3b['where'],{'$or':_[_0x95ce('0x3c')](_0x3efe50,function(_0xc15435){if(_0xc15435[_0x95ce('0x4f')]!=='VIRTUAL'){var _0x1714d2={};_0x1714d2[_0xc15435[_0x95ce('0x3a')]]={'$like':'%'+_0x1df593[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x1714d2;}})});}_0x4a0c3b=_[_0x95ce('0x4e')]({},_0x4a0c3b,_0x1df593[_0x95ce('0x50')]);var _0x8e2c71={'where':_0x4a0c3b['where']};return db[_0x95ce('0x3d')][_0x95ce('0x2e')](_0x8e2c71)['then'](function(_0x140a77){_0x1f2b8c['count']=_0x140a77;if(_0x1df593['query'][_0x95ce('0x51')]){_0x4a0c3b[_0x95ce('0x52')]=[{'all':!![]}];}return db[_0x95ce('0x3d')][_0x95ce('0x53')](_0x4a0c3b);})[_0x95ce('0x1d')](function(_0x144b49){_0x1f2b8c[_0x95ce('0x54')]=_0x144b49;return _0x1f2b8c;})[_0x95ce('0x1d')](respondWithFilteredResult(_0x3c8cba,_0x4a0c3b))[_0x95ce('0x28')](handleError(_0x3c8cba,null));};exports[_0x95ce('0x55')]=function(_0x1a1f81,_0xc54da3){var _0x76919d={'raw':!![],'where':{'id':_0x1a1f81[_0x95ce('0x56')]['id']}},_0x1ccd76={};_0x1ccd76[_0x95ce('0x41')]=_['keys'](db[_0x95ce('0x3d')][_0x95ce('0x3e')]);_0x1ccd76['query']=_['keys'](_0x1a1f81[_0x95ce('0x42')]);_0x1ccd76[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x1ccd76[_0x95ce('0x41')],_0x1ccd76[_0x95ce('0x42')]);_0x76919d[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1ccd76[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x1a1f81['query'][_0x95ce('0x47')]));_0x76919d['attributes']=_0x76919d[_0x95ce('0x46')][_0x95ce('0x57')]?_0x76919d[_0x95ce('0x46')]:_0x1ccd76['model'];if(_0x1a1f81[_0x95ce('0x42')][_0x95ce('0x51')]){_0x76919d['include']=[{'all':!![]}];}_0x76919d=_['merge']({},_0x76919d,_0x1a1f81['options']);return db[_0x95ce('0x3d')][_0x95ce('0x58')](_0x76919d)['then'](handleEntityNotFound(_0xc54da3,null))[_0x95ce('0x1d')](respondWithResult(_0xc54da3,null))[_0x95ce('0x28')](handleError(_0xc54da3,null));};exports[_0x95ce('0x59')]=function(_0x2da4af,_0x2f5784){return db['ChatQueue'][_0x95ce('0x59')](_0x2da4af[_0x95ce('0x5a')],{})[_0x95ce('0x1d')](function(_0x7765e9){var _0x4a6da8=_0x2da4af[_0x95ce('0x5b')][_0x95ce('0x35')]({'plain':!![]});if(!_0x4a6da8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a6da8[_0x95ce('0x5c')]===_0x95ce('0x5b')){var _0x3dbf87=_0x7765e9['get']({'plain':!![]});var _0x2919cb=_0x95ce('0x36');return db[_0x95ce('0x5d')][_0x95ce('0x58')]({'where':{'name':_0x2919cb,'userProfileId':_0x4a6da8['userProfileId']},'raw':!![]})[_0x95ce('0x1d')](function(_0x47d898){if(_0x47d898&&_0x47d898[_0x95ce('0x5e')]===0x0){return db[_0x95ce('0x37')][_0x95ce('0x59')]({'name':_0x3dbf87[_0x95ce('0x3a')],'resourceId':_0x3dbf87['id'],'type':_0x47d898[_0x95ce('0x3a')],'sectionId':_0x47d898['id']},{})[_0x95ce('0x1d')](function(){return _0x7765e9;});}else{return _0x7765e9;}})[_0x95ce('0x28')](function(_0x35418a){logger[_0x95ce('0x24')](_0x95ce('0x5f'),_0x35418a);throw _0x35418a;});}return _0x7765e9;})[_0x95ce('0x1d')](respondWithResult(_0x2f5784,0xc9))[_0x95ce('0x28')](handleError(_0x2f5784,null));};exports[_0x95ce('0x34')]=function(_0x35c611,_0x3d8c90){if(_0x35c611[_0x95ce('0x5a')]['id']){delete _0x35c611['body']['id'];}return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x35c611[_0x95ce('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d8c90,null))[_0x95ce('0x1d')](saveUpdates(_0x35c611[_0x95ce('0x5a')],null))[_0x95ce('0x1d')](respondWithResult(_0x3d8c90,null))[_0x95ce('0x28')](handleError(_0x3d8c90,null));};exports['destroy']=function(_0x41813e,_0x4051cd){return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x41813e['params']['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x4051cd,null))[_0x95ce('0x1d')](removeEntity(_0x4051cd,null))[_0x95ce('0x28')](handleError(_0x4051cd,null));};exports[_0x95ce('0x60')]=function(_0x1cddfb,_0x3862a7){return db[_0x95ce('0x3d')][_0x95ce('0x60')]()['then'](respondWithResult(_0x3862a7,null))[_0x95ce('0x28')](handleError(_0x3862a7,null));};exports[_0x95ce('0x61')]=function(_0x48d209,_0x48d631,_0x5f5dd9){var _0x42eb74={'raw':!![],'where':{}},_0x1b70ae={},_0x3e391b;return db[_0x95ce('0x3d')][_0x95ce('0x62')]({'where':{'id':_0x48d209[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x48d631,null))['then'](function(_0x59f4b4){if(_0x59f4b4){_0x3e391b=_0x59f4b4[_0x95ce('0x35')]({'plain':!![]});_0x1b70ae[_0x95ce('0x41')]=_['keys'](db[_0x95ce('0x63')]['rawAttributes']);_0x1b70ae[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x48d209[_0x95ce('0x42')]);_0x1b70ae['filters']=_[_0x95ce('0x45')](_0x1b70ae['model'],_0x1b70ae[_0x95ce('0x42')]);_0x42eb74[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1b70ae[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x48d209[_0x95ce('0x42')][_0x95ce('0x47')]));_0x42eb74[_0x95ce('0x46')]=_0x42eb74[_0x95ce('0x46')][_0x95ce('0x57')]?_0x42eb74[_0x95ce('0x46')]:_0x1b70ae[_0x95ce('0x41')];if(!_0x48d209['query'][_0x95ce('0x48')](_0x95ce('0x64'))){_0x42eb74[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x48d209['query'][_0x95ce('0x2d')]);_0x42eb74[_0x95ce('0x2f')]=qs['offset'](_0x48d209[_0x95ce('0x42')][_0x95ce('0x2f')]);}_0x42eb74[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x48d209[_0x95ce('0x42')]['sort']);_0x42eb74[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x48d209['query'],_0x1b70ae[_0x95ce('0x44')]));_0x42eb74['where'][_0x95ce('0x65')]=_0x59f4b4['id'];if(_0x48d209[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x42eb74[_0x95ce('0x4b')]=_['merge'](_0x42eb74[_0x95ce('0x4b')],{'$or':_['map'](_0x42eb74[_0x95ce('0x46')],function(_0x41112c){var _0x5a50a4={};_0x5a50a4[_0x41112c]={'$like':'%'+_0x48d209[_0x95ce('0x42')]['filter']+'%'};return _0x5a50a4;})});}_0x42eb74=_[_0x95ce('0x4e')]({},_0x42eb74,_0x48d209['options']);return db['UserChatQueue']['findAll'](_0x42eb74);}})[_0x95ce('0x1d')](function(_0x57a69b){if(_0x57a69b){return db[_0x95ce('0x66')][_0x95ce('0x67')]({'where':{'id':_[_0x95ce('0x3c')](_0x57a69b,'UserId'),'role':'agent'},'attributes':['id',_0x95ce('0x3a'),'chatPause',_0x95ce('0x68'),_0x95ce('0x69')]});}})[_0x95ce('0x1d')](function(_0x46f5cb){if(_0x46f5cb){return{'count':_0x46f5cb['count'],'rows':_[_0x95ce('0x3c')](_0x46f5cb['rows'],function(_0xa79d68){return{'membername':_0xa79d68['name'],'UserId':_0xa79d68['id'],'queue_name':_0x3e391b['name'],'ChatQueueId':_0x3e391b['id'],'interface':util['format']('%s/%s',_0x95ce('0x6a'),_0xa79d68[_0x95ce('0x3a')]),'penalty':0x0,'paused':_0xa79d68[_0x95ce('0x6b')],'createdAt':_0xa79d68[_0x95ce('0x69')],'updatedAt':_0xa79d68[_0x95ce('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x95ce('0x1d')](respondWithFilteredResult(_0x48d631,_0x42eb74))[_0x95ce('0x28')](handleError(_0x48d631,null));};exports['getTeams']=function(_0x10609f,_0x4bb8a4,_0xf42b88){var _0x56fa0c={};var _0x495010={};var _0x224732;var _0x34ebef;return db['ChatQueue'][_0x95ce('0x62')]({'where':{'id':_0x10609f[_0x95ce('0x56')]['id']}})['then'](handleEntityNotFound(_0x4bb8a4,null))[_0x95ce('0x1d')](function(_0x5e24e5){if(_0x5e24e5){_0x224732=_0x5e24e5;_0x495010['model']=_[_0x95ce('0x43')](db[_0x95ce('0x6c')]['rawAttributes']);_0x495010['query']=_[_0x95ce('0x43')](_0x10609f[_0x95ce('0x42')]);_0x495010[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x495010[_0x95ce('0x41')],_0x495010[_0x95ce('0x42')]);_0x56fa0c['attributes']=_[_0x95ce('0x45')](_0x495010[_0x95ce('0x41')],qs['fields'](_0x10609f[_0x95ce('0x42')][_0x95ce('0x47')]));_0x56fa0c[_0x95ce('0x46')]=_0x56fa0c['attributes']['length']?_0x56fa0c[_0x95ce('0x46')]:_0x495010[_0x95ce('0x41')];_0x56fa0c['order']=qs[_0x95ce('0x4a')](_0x10609f[_0x95ce('0x42')]['sort']);_0x56fa0c[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x10609f[_0x95ce('0x42')],_0x495010[_0x95ce('0x44')]));if(_0x10609f[_0x95ce('0x42')]['filter']){_0x56fa0c['where']=_[_0x95ce('0x4e')](_0x56fa0c[_0x95ce('0x4b')],{'$or':_[_0x95ce('0x3c')](_0x56fa0c[_0x95ce('0x46')],function(_0x1b5a34){var _0x5c65ef={};_0x5c65ef[_0x1b5a34]={'$like':'%'+_0x10609f[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x5c65ef;})});}_0x56fa0c=_['merge']({},_0x56fa0c,_0x10609f[_0x95ce('0x50')]);return _0x224732[_0x95ce('0x6d')](_0x56fa0c);}})[_0x95ce('0x1d')](function(_0x174d9e){if(_0x174d9e){_0x34ebef=_0x174d9e[_0x95ce('0x57')];if(!_0x10609f['query']['hasOwnProperty']('nolimit')){_0x56fa0c[_0x95ce('0x2d')]=qs['limit'](_0x10609f[_0x95ce('0x42')]['limit']);_0x56fa0c[_0x95ce('0x2f')]=qs['offset'](_0x10609f[_0x95ce('0x42')][_0x95ce('0x2f')]);}return _0x224732[_0x95ce('0x6d')](_0x56fa0c);}})[_0x95ce('0x1d')](function(_0x12d75e){if(_0x12d75e){return _0x12d75e?{'count':_0x34ebef,'rows':_0x12d75e}:null;}})[_0x95ce('0x1d')](respondWithResult(_0x4bb8a4,null))['catch'](handleError(_0x4bb8a4,null));};exports[_0x95ce('0x6e')]=function(_0x4383ec,_0x207737,_0xd99c66){var _0x2fe2b2=_0x4383ec[_0x95ce('0x5a')][_0x95ce('0x6f')];return db['Team'][_0x95ce('0x53')]({'where':{'id':_0x2fe2b2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x95ce('0x70'),'attributes':['id',_0x95ce('0x3a'),'online',_0x95ce('0x71'),_0x95ce('0x72')],'raw':!![]}]})[_0x95ce('0x1d')](function(_0x85dfd){if(_0x85dfd){var _0x1f53d5=_['flatMap'](_0x85dfd,function(_0x46fbc1){var _0x2cc728=_0x46fbc1[_0x95ce('0x35')]({'plain':!![]});return _0x2cc728[_0x95ce('0x70')];});return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x4383ec['params']['id']}})['then'](function(_0x2e141a){return db[_0x95ce('0x73')][_0x95ce('0x74')](function(_0x583c1b){return _0x2e141a[_0x95ce('0x6e')](_0x2fe2b2,{'transaction':_0x583c1b})[_0x95ce('0x1d')](function(){return BPromise[_0x95ce('0x75')](_0x1f53d5,function(_0x2cbfdd){return db[_0x95ce('0x63')]['findOrCreate']({'where':{'UserId':_0x2cbfdd['id'],'ChatQueueId':_0x4383ec[_0x95ce('0x56')]['id']},'transaction':_0x583c1b});});})[_0x95ce('0x1d')](function(){_0x1f53d5[_0x95ce('0x76')](function(_0x258755){socket[_0x95ce('0x77')](_0x95ce('0x78'),{'UserId':_0x258755['id'],'ChatQueueId':_0x2e141a['id']});});});});});}})['then'](respondWithStatusCode(_0x207737,null))[_0x95ce('0x28')](handleError(_0x207737,null));};exports[_0x95ce('0x79')]=function(_0x8a7e2a,_0x19c799,_0x35adfd){return db[_0x95ce('0x6c')][_0x95ce('0x53')]({'where':{'id':_0x8a7e2a['query'][_0x95ce('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x95ce('0x66')],'as':_0x95ce('0x70'),'attributes':['id'],'raw':!![]}]})[_0x95ce('0x1d')](handleEntityNotFound(_0x19c799,null))['then'](function(_0x4c0fa6){var _0x29a7b6=_[_0x95ce('0x3c')](_0x4c0fa6,'id');var _0x45c322=[];var _0x4493f3=[];var _0x3ae7e7=squel[_0x95ce('0x7a')]();_0x3ae7e7['field'](_0x95ce('0x7b'))[_0x95ce('0x7c')](_0x95ce('0x7d'),'tq')[_0x95ce('0x7e')](_0x95ce('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x95ce('0x80'),_0x8a7e2a['params']['id']);for(var _0x2fcbca=0x0;_0x2fcbca<_0x4c0fa6[_0x95ce('0x57')];_0x2fcbca+=0x1){let _0x477bd4=_0x4c0fa6[_0x2fcbca];for(var _0x58a03c=0x0;_0x58a03c<_0x477bd4[_0x95ce('0x70')][_0x95ce('0x57')];_0x58a03c+=0x1){let _0x350a58=_0x477bd4[_0x95ce('0x70')][_0x58a03c];var _0x45518f=_0x3ae7e7['clone']();_0x45518f[_0x95ce('0x4b')](_0x95ce('0x81'),_0x350a58['id']);_0x4493f3[_0x95ce('0x82')](db[_0x95ce('0x73')]['query'](_0x45518f[_0x95ce('0x83')](),{'type':db[_0x95ce('0x73')][_0x95ce('0x84')][_0x95ce('0x85')]})[_0x95ce('0x1d')](function(_0x41cc4e){if(_0x41cc4e[_0x95ce('0x57')]===0x1){return _0x350a58['id'];}else{var _0x5126f0=_[_0x95ce('0x86')](_[_0x95ce('0x3c')](_0x41cc4e,_0x95ce('0x87')),function(_0x55631e){return _[_0x95ce('0x88')](_0x29a7b6,_0x55631e);});if(_0x5126f0){return _0x350a58['id'];}}}));}}return BPromise['all'](_0x4493f3)[_0x95ce('0x1d')](function(_0x3b8d8d){_0x45c322=_(_0x45c322)[_0x95ce('0x89')](_0x3b8d8d)['compact']()[_0x95ce('0x8a')]();return db[_0x95ce('0x3d')]['find']({'where':{'id':_0x8a7e2a[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](function(_0x458315){return db[_0x95ce('0x73')][_0x95ce('0x74')](function(_0x3ac651){return _0x458315[_0x95ce('0x79')](_0x8a7e2a[_0x95ce('0x42')][_0x95ce('0x6f')],{'transaction':_0x3ac651})['then'](function(){if(!_['isEmpty'](_0x45c322)){return _0x458315[_0x95ce('0x8b')](_0x45c322,{'transaction':_0x3ac651});}})[_0x95ce('0x1d')](function(){_0x45c322['forEach'](function(_0x321a4c){socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':_0x321a4c,'ChatQueueId':_0x458315['id']});});});});});});})['then'](respondWithStatusCode(_0x19c799,null))[_0x95ce('0x28')](handleError(_0x19c799,null));};exports[_0x95ce('0x8d')]=function(_0x7b427e,_0x4c7735,_0x3c29c2){return db['ChatQueue'][_0x95ce('0x58')]({'where':{'id':_0x7b427e[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x4c7735,null))['then'](function(_0x38963b){if(_0x38963b){return _0x38963b['addAgents'](_0x7b427e[_0x95ce('0x5a')]['ids'],_['omit'](_0x7b427e['body'],[_0x95ce('0x6f'),'id'])||{})['spread'](function(_0x302266){for(var _0x25097e=0x0;_0x25097e<_0x7b427e[_0x95ce('0x5a')][_0x95ce('0x6f')]['length'];_0x25097e+=0x1){socket[_0x95ce('0x77')](_0x95ce('0x78'),{'UserId':Number(_0x7b427e[_0x95ce('0x5a')][_0x95ce('0x6f')][_0x25097e]),'ChatQueueId':Number(_0x7b427e[_0x95ce('0x56')]['id'])});}return _0x302266;});}})[_0x95ce('0x1d')](respondWithResult(_0x4c7735,null))[_0x95ce('0x28')](handleError(_0x4c7735,null));};exports['removeAgents']=function(_0x2e1a4e,_0x5145ef,_0x533081){return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x2e1a4e[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x5145ef,null))[_0x95ce('0x1d')](function(_0x5008b0){if(_0x5008b0){return _0x5008b0['removeAgents'](_0x2e1a4e[_0x95ce('0x42')]['ids'])[_0x95ce('0x1d')](function(){if(_[_0x95ce('0x8e')](_0x2e1a4e['query'][_0x95ce('0x6f')])){for(var _0x4aa4c6=0x0;_0x4aa4c6<_0x2e1a4e[_0x95ce('0x42')]['ids'][_0x95ce('0x57')];_0x4aa4c6+=0x1){socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':Number(_0x2e1a4e['query'][_0x95ce('0x6f')][_0x4aa4c6]),'ChatQueueId':Number(_0x2e1a4e[_0x95ce('0x56')]['id'])});}}else{socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':Number(_0x2e1a4e[_0x95ce('0x42')][_0x95ce('0x6f')]),'ChatQueueId':Number(_0x2e1a4e['params']['id'])});}});}})[_0x95ce('0x1d')](respondWithStatusCode(_0x5145ef,null))['catch'](handleError(_0x5145ef,null));};exports[_0x95ce('0x8f')]=function(_0x898a8a,_0x312fe6,_0x9af4c){var _0x374749={};var _0x1cc3bb={};var _0x3cbc19;var _0x29e74c;return db[_0x95ce('0x3d')][_0x95ce('0x62')]({'where':{'id':_0x898a8a[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x312fe6,null))[_0x95ce('0x1d')](function(_0x10b632){if(_0x10b632){_0x3cbc19=_0x10b632;_0x1cc3bb['model']=_[_0x95ce('0x43')](db[_0x95ce('0x66')]['rawAttributes']);_0x1cc3bb[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x898a8a['query']);_0x1cc3bb['filters']=_[_0x95ce('0x45')](_0x1cc3bb[_0x95ce('0x41')],_0x1cc3bb[_0x95ce('0x42')]);_0x374749['attributes']=_[_0x95ce('0x45')](_0x1cc3bb[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x898a8a[_0x95ce('0x42')][_0x95ce('0x47')]));_0x374749[_0x95ce('0x46')]=_0x374749['attributes'][_0x95ce('0x57')]?_0x374749[_0x95ce('0x46')]:_0x1cc3bb['model'];_0x374749[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4a')]);_0x374749['where']=qs['filters'](_[_0x95ce('0x4c')](_0x898a8a[_0x95ce('0x42')],_0x1cc3bb[_0x95ce('0x44')]));if(_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x374749[_0x95ce('0x4b')]=_[_0x95ce('0x4e')](_0x374749[_0x95ce('0x4b')],{'$or':_[_0x95ce('0x3c')](_0x374749[_0x95ce('0x46')],function(_0x53cca0){var _0x2569f6={};_0x2569f6[_0x53cca0]={'$like':'%'+_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x2569f6;})});}_0x374749=_['merge']({},_0x374749,_0x898a8a[_0x95ce('0x50')]);return _0x3cbc19['getAgents'](_0x374749);}})[_0x95ce('0x1d')](function(_0x511bc7){if(_0x511bc7){_0x29e74c=_0x511bc7['length'];if(!_0x898a8a[_0x95ce('0x42')]['hasOwnProperty'](_0x95ce('0x64'))){_0x374749[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x898a8a[_0x95ce('0x42')]['limit']);_0x374749[_0x95ce('0x2f')]=qs[_0x95ce('0x2f')](_0x898a8a['query'][_0x95ce('0x2f')]);}return _0x3cbc19[_0x95ce('0x8f')](_0x374749);}})[_0x95ce('0x1d')](function(_0x42ae70){if(_0x42ae70){return _0x42ae70?{'count':_0x29e74c,'rows':_0x42ae70}:null;}})[_0x95ce('0x1d')](respondWithResult(_0x312fe6,null))[_0x95ce('0x28')](handleError(_0x312fe6,null));}; \ No newline at end of file +var _0x7b46=['addAgents','omit','spread','emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','count','Content-Range','apply','save','update','destroy','then','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','findOne','ChatQueueId','filter','UserChatQueue','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','hasOwnProperty','Agents','online','voicePause','interface','sequelize','addTeams','each','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents'];(function(_0x6ed59f,_0x39a351){var _0x244693=function(_0xd49169){while(--_0xd49169){_0x6ed59f['push'](_0x6ed59f['shift']());}};_0x244693(++_0x39a351);}(_0x7b46,0x128));var _0x67b4=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x7b46[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require(_0x67b4('0x0'));var rimraf=require(_0x67b4('0x1'));var zipdir=require(_0x67b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67b4('0x3'));var moment=require(_0x67b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67b4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x67b4('0x6'));var ejs=require(_0x67b4('0x7'));var fs=require('fs');var fs_extra=require(_0x67b4('0x8'));var _=require(_0x67b4('0x9'));var squel=require('squel');var crypto=require(_0x67b4('0xa'));var jsforce=require(_0x67b4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x67b4('0x6'));var querystring=require(_0x67b4('0xc'));var Papa=require(_0x67b4('0xd'));var Redis=require(_0x67b4('0xe'));var authService=require(_0x67b4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x67b4('0x10'));var hardwareService=require(_0x67b4('0x11'));var logger=require(_0x67b4('0x12'))('api');var utils=require(_0x67b4('0x13'));var config=require(_0x67b4('0x14'));var licenseUtil=require(_0x67b4('0x15'));var db=require('../../mysqldb')['db'];config[_0x67b4('0x16')]=_[_0x67b4('0x17')](config['redis'],{'host':_0x67b4('0x18'),'port':0x18eb});var socket=require(_0x67b4('0x19'))(new Redis(config[_0x67b4('0x16')]));require('./chatQueue.socket')[_0x67b4('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x67b4('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x286e51,_0x3369fb,_0x591d9e,_0x5ee243){return new BPromise(function(_0x3c36cb,_0x2f74a9){var _0x53a470=_0x5ee243||client;return _0x53a470[_0x67b4('0x1c')](_0x286e51,_0x591d9e)['then'](function(_0x5ee959){logger['info'](_0x67b4('0x1d'),_0x3369fb,_0x67b4('0x1e'));logger[_0x67b4('0x1f')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3369fb,_0x67b4('0x1e'),JSON[_0x67b4('0x20')](_0x5ee959));if(_0x5ee959[_0x67b4('0x21')]){if(_0x5ee959['error'][_0x67b4('0x22')]===0x1f4){logger[_0x67b4('0x21')](_0x67b4('0x1d'),_0x3369fb,_0x5ee959['error'][_0x67b4('0x23')]);return _0x2f74a9(_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);}logger[_0x67b4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x3369fb,_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);return _0x3c36cb(_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);}else{logger[_0x67b4('0x24')](_0x67b4('0x1d'),_0x3369fb,'request\x20sent');_0x3c36cb(_0x5ee959[_0x67b4('0x25')]['message']);}})['catch'](function(_0x94199c){logger[_0x67b4('0x21')](_0x67b4('0x1d'),_0x3369fb,_0x94199c);_0x2f74a9(_0x94199c);});});}function respondWithStatusCode(_0x17599d,_0x3473c4){_0x3473c4=_0x3473c4||0xcc;return function(_0x37cb37){if(_0x37cb37){return _0x17599d[_0x67b4('0x26')](_0x3473c4);}return _0x17599d[_0x67b4('0x27')](_0x3473c4)['end']();};}function respondWithResult(_0x1eab58,_0x227824){_0x227824=_0x227824||0xc8;return function(_0x38e559){if(_0x38e559){return _0x1eab58['status'](_0x227824)['json'](_0x38e559);}};}function respondWithFilteredResult(_0x4558b0,_0x7a04a1){return function(_0x57ca15){if(_0x57ca15){var _0x244f34=typeof _0x7a04a1[_0x67b4('0x28')]===_0x67b4('0x29')&&typeof _0x7a04a1['limit']===_0x67b4('0x29');var _0x2496f5=_0x57ca15[_0x67b4('0x2a')];var _0x21fe0f=_0x244f34?0x0:_0x7a04a1['offset'];var _0x47a1ff=_0x244f34?_0x57ca15[_0x67b4('0x2a')]:_0x7a04a1['offset']+_0x7a04a1['limit'];var _0x4df54d;if(_0x47a1ff>=_0x2496f5){_0x47a1ff=_0x2496f5;_0x4df54d=0xc8;}else{_0x4df54d=0xce;}_0x4558b0[_0x67b4('0x27')](_0x4df54d);return _0x4558b0['set'](_0x67b4('0x2b'),_0x21fe0f+'-'+_0x47a1ff+'/'+_0x2496f5)['json'](_0x57ca15);}return null;};}function patchUpdates(_0x2c1004){return function(_0x4e9873){try{jsonpatch[_0x67b4('0x2c')](_0x4e9873,_0x2c1004,!![]);}catch(_0x559d7a){return BPromise['reject'](_0x559d7a);}return _0x4e9873[_0x67b4('0x2d')]();};}function saveUpdates(_0x3914f0,_0x44a33f){return function(_0x417ec5){if(_0x417ec5){return _0x417ec5[_0x67b4('0x2e')](_0x3914f0)['then'](function(_0x2b8c1d){return _0x2b8c1d;});}return null;};}function removeEntity(_0xf5220b,_0x20289d){return function(_0xb84b95){if(_0xb84b95){return _0xb84b95[_0x67b4('0x2f')]()[_0x67b4('0x30')](function(){var _0x1f1b5b=_0xb84b95['get']({'plain':!![]});var _0x1a6d27=_0x67b4('0x31');return db[_0x67b4('0x32')][_0x67b4('0x2f')]({'where':{'type':_0x1a6d27,'resourceId':_0x1f1b5b['id']}})[_0x67b4('0x30')](function(){return _0xb84b95;});})[_0x67b4('0x30')](function(){_0xf5220b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd065b,_0x13c211){return function(_0x3f96a8){if(!_0x3f96a8){_0xcd065b[_0x67b4('0x26')](0x194);}return _0x3f96a8;};}function handleError(_0x23bc93,_0x22afa8){_0x22afa8=_0x22afa8||0x1f4;return function(_0x5ba6d4){logger[_0x67b4('0x21')](_0x5ba6d4[_0x67b4('0x33')]);if(_0x5ba6d4[_0x67b4('0x34')]){delete _0x5ba6d4['name'];}_0x23bc93[_0x67b4('0x27')](_0x22afa8)[_0x67b4('0x35')](_0x5ba6d4);};}exports[_0x67b4('0x36')]=function(_0x2a9b7e,_0x3ff2c6){var _0x260728={},_0x4675d1={},_0x72bc9c={'count':0x0,'rows':[]};var _0x1f723b=_[_0x67b4('0x37')](db[_0x67b4('0x38')][_0x67b4('0x39')],function(_0x324513){return{'name':_0x324513['fieldName'],'type':_0x324513[_0x67b4('0x3a')][_0x67b4('0x3b')]};});_0x4675d1[_0x67b4('0x3c')]=_['map'](_0x1f723b,_0x67b4('0x34'));_0x4675d1[_0x67b4('0x3d')]=_[_0x67b4('0x3e')](_0x2a9b7e[_0x67b4('0x3d')]);_0x4675d1[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4675d1['model'],_0x4675d1[_0x67b4('0x3d')]);_0x260728[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x4675d1[_0x67b4('0x3c')],qs[_0x67b4('0x42')](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x260728[_0x67b4('0x41')]=_0x260728[_0x67b4('0x41')][_0x67b4('0x43')]?_0x260728[_0x67b4('0x41')]:_0x4675d1[_0x67b4('0x3c')];if(!_0x2a9b7e[_0x67b4('0x3d')]['hasOwnProperty'](_0x67b4('0x44'))){_0x260728[_0x67b4('0x45')]=qs['limit'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x45')]);_0x260728[_0x67b4('0x28')]=qs['offset'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x28')]);}_0x260728[_0x67b4('0x46')]=qs['sort'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x260728[_0x67b4('0x48')]=qs['filters'](_[_0x67b4('0x49')](_0x2a9b7e[_0x67b4('0x3d')],_0x4675d1['filters']),_0x1f723b);if(_0x2a9b7e['query']['filter']){_0x260728[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x260728['where'],{'$or':_[_0x67b4('0x37')](_0x1f723b,function(_0x5a577f){if(_0x5a577f[_0x67b4('0x3a')]!==_0x67b4('0x4b')){var _0x4ead7b={};_0x4ead7b[_0x5a577f['name']]={'$like':'%'+_0x2a9b7e['query']['filter']+'%'};return _0x4ead7b;}})});}_0x260728=_[_0x67b4('0x4a')]({},_0x260728,_0x2a9b7e[_0x67b4('0x4c')]);var _0xca7f50={'where':_0x260728[_0x67b4('0x48')]};return db[_0x67b4('0x38')][_0x67b4('0x2a')](_0xca7f50)[_0x67b4('0x30')](function(_0x5ea60b){_0x72bc9c['count']=_0x5ea60b;if(_0x2a9b7e['query'][_0x67b4('0x4d')]){_0x260728[_0x67b4('0x4e')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x260728);})[_0x67b4('0x30')](function(_0x11603b){_0x72bc9c['rows']=_0x11603b;return _0x72bc9c;})[_0x67b4('0x30')](respondWithFilteredResult(_0x3ff2c6,_0x260728))[_0x67b4('0x4f')](handleError(_0x3ff2c6,null));};exports['show']=function(_0x393bf6,_0x486ea0){var _0x4dee6c={'raw':!![],'where':{'id':_0x393bf6[_0x67b4('0x50')]['id']}},_0x1eb7ff={};_0x1eb7ff[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db[_0x67b4('0x38')][_0x67b4('0x39')]);_0x1eb7ff[_0x67b4('0x3d')]=_['keys'](_0x393bf6[_0x67b4('0x3d')]);_0x1eb7ff[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x1eb7ff[_0x67b4('0x3c')],_0x1eb7ff['query']);_0x4dee6c[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x1eb7ff['model'],qs[_0x67b4('0x42')](_0x393bf6[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x4dee6c[_0x67b4('0x41')]=_0x4dee6c['attributes'][_0x67b4('0x43')]?_0x4dee6c[_0x67b4('0x41')]:_0x1eb7ff[_0x67b4('0x3c')];if(_0x393bf6[_0x67b4('0x3d')][_0x67b4('0x4d')]){_0x4dee6c['include']=[{'all':!![]}];}_0x4dee6c=_[_0x67b4('0x4a')]({},_0x4dee6c,_0x393bf6[_0x67b4('0x4c')]);return db[_0x67b4('0x38')][_0x67b4('0x51')](_0x4dee6c)[_0x67b4('0x30')](handleEntityNotFound(_0x486ea0,null))[_0x67b4('0x30')](respondWithResult(_0x486ea0,null))[_0x67b4('0x4f')](handleError(_0x486ea0,null));};exports[_0x67b4('0x52')]=function(_0x227c41,_0xabe44a){return db[_0x67b4('0x38')][_0x67b4('0x52')](_0x227c41['body'],{})['then'](function(_0xc33ddc){var _0x117ad3=_0x227c41[_0x67b4('0x53')][_0x67b4('0x54')]({'plain':!![]});if(!_0x117ad3)throw new Error(_0x67b4('0x55'));if(_0x117ad3[_0x67b4('0x56')]===_0x67b4('0x53')){var _0x54ab73=_0xc33ddc[_0x67b4('0x54')]({'plain':!![]});var _0xb38112=_0x67b4('0x31');return db[_0x67b4('0x57')]['find']({'where':{'name':_0xb38112,'userProfileId':_0x117ad3[_0x67b4('0x58')]},'raw':!![]})[_0x67b4('0x30')](function(_0x70331){if(_0x70331&&_0x70331[_0x67b4('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x54ab73[_0x67b4('0x34')],'resourceId':_0x54ab73['id'],'type':_0x70331[_0x67b4('0x34')],'sectionId':_0x70331['id']},{})['then'](function(){return _0xc33ddc;});}else{return _0xc33ddc;}})[_0x67b4('0x4f')](function(_0x44216a){logger[_0x67b4('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44216a);throw _0x44216a;});}return _0xc33ddc;})[_0x67b4('0x30')](respondWithResult(_0xabe44a,0xc9))[_0x67b4('0x4f')](handleError(_0xabe44a,null));};exports[_0x67b4('0x2e')]=function(_0x456a70,_0x3f9152){if(_0x456a70[_0x67b4('0x5a')]['id']){delete _0x456a70[_0x67b4('0x5a')]['id'];}return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x456a70[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x3f9152,null))['then'](saveUpdates(_0x456a70[_0x67b4('0x5a')],null))[_0x67b4('0x30')](respondWithResult(_0x3f9152,null))[_0x67b4('0x4f')](handleError(_0x3f9152,null));};exports[_0x67b4('0x2f')]=function(_0x5c1f9c,_0x3a252c){return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x5c1f9c['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x3a252c,null))[_0x67b4('0x30')](removeEntity(_0x3a252c,null))['catch'](handleError(_0x3a252c,null));};exports['describe']=function(_0x18048c,_0x1db81c){return db[_0x67b4('0x38')][_0x67b4('0x5b')]()[_0x67b4('0x30')](respondWithResult(_0x1db81c,null))['catch'](handleError(_0x1db81c,null));};exports['getMembers']=function(_0x4a2863,_0x4b8ac1,_0x3d0eea){var _0x3e8519={'raw':!![],'where':{}},_0x14b867={},_0x445a5d;return db[_0x67b4('0x38')][_0x67b4('0x5c')]({'where':{'id':_0x4a2863['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x4b8ac1,null))[_0x67b4('0x30')](function(_0x2401c1){if(_0x2401c1){_0x445a5d=_0x2401c1[_0x67b4('0x54')]({'plain':!![]});_0x14b867[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db['UserChatQueue'][_0x67b4('0x39')]);_0x14b867[_0x67b4('0x3d')]=_['keys'](_0x4a2863[_0x67b4('0x3d')]);_0x14b867[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x14b867['model'],_0x14b867[_0x67b4('0x3d')]);_0x3e8519[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x14b867[_0x67b4('0x3c')],qs['fields'](_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x3e8519[_0x67b4('0x41')]=_0x3e8519[_0x67b4('0x41')][_0x67b4('0x43')]?_0x3e8519['attributes']:_0x14b867[_0x67b4('0x3c')];if(!_0x4a2863[_0x67b4('0x3d')]['hasOwnProperty']('nolimit')){_0x3e8519[_0x67b4('0x45')]=qs[_0x67b4('0x45')](_0x4a2863[_0x67b4('0x3d')]['limit']);_0x3e8519[_0x67b4('0x28')]=qs[_0x67b4('0x28')](_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x28')]);}_0x3e8519['order']=qs[_0x67b4('0x47')](_0x4a2863[_0x67b4('0x3d')]['sort']);_0x3e8519[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_[_0x67b4('0x49')](_0x4a2863[_0x67b4('0x3d')],_0x14b867[_0x67b4('0x3f')]));_0x3e8519[_0x67b4('0x48')][_0x67b4('0x5d')]=_0x2401c1['id'];if(_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x5e')]){_0x3e8519[_0x67b4('0x48')]=_['merge'](_0x3e8519['where'],{'$or':_[_0x67b4('0x37')](_0x3e8519[_0x67b4('0x41')],function(_0x5ddcd6){var _0x44eab7={};_0x44eab7[_0x5ddcd6]={'$like':'%'+_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x5e')]+'%'};return _0x44eab7;})});}_0x3e8519=_[_0x67b4('0x4a')]({},_0x3e8519,_0x4a2863[_0x67b4('0x4c')]);return db[_0x67b4('0x5f')][_0x67b4('0x60')](_0x3e8519);}})[_0x67b4('0x30')](function(_0x3a8706){if(_0x3a8706){return db[_0x67b4('0x61')][_0x67b4('0x62')]({'where':{'id':_[_0x67b4('0x37')](_0x3a8706,'UserId'),'role':_0x67b4('0x63')},'attributes':['id',_0x67b4('0x34'),_0x67b4('0x64'),_0x67b4('0x65'),_0x67b4('0x66')]});}})['then'](function(_0x3b6cc1){if(_0x3b6cc1){return{'count':_0x3b6cc1[_0x67b4('0x2a')],'rows':_[_0x67b4('0x37')](_0x3b6cc1[_0x67b4('0x67')],function(_0x55a966){return{'membername':_0x55a966['name'],'UserId':_0x55a966['id'],'queue_name':_0x445a5d[_0x67b4('0x34')],'ChatQueueId':_0x445a5d['id'],'interface':util['format'](_0x67b4('0x68'),'SIP',_0x55a966[_0x67b4('0x34')]),'penalty':0x0,'paused':_0x55a966[_0x67b4('0x64')],'createdAt':_0x55a966[_0x67b4('0x66')],'updatedAt':_0x55a966['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x67b4('0x30')](respondWithFilteredResult(_0x4b8ac1,_0x3e8519))[_0x67b4('0x4f')](handleError(_0x4b8ac1,null));};exports[_0x67b4('0x69')]=function(_0xbf67c0,_0x6a667a,_0x1556ae){var _0x173523={};var _0x4efde2={};var _0x41884b;var _0x5d4e7c;return db[_0x67b4('0x38')][_0x67b4('0x5c')]({'where':{'id':_0xbf67c0['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x6a667a,null))[_0x67b4('0x30')](function(_0x507583){if(_0x507583){_0x41884b=_0x507583;_0x4efde2[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db[_0x67b4('0x6a')][_0x67b4('0x39')]);_0x4efde2['query']=_[_0x67b4('0x3e')](_0xbf67c0[_0x67b4('0x3d')]);_0x4efde2[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4efde2[_0x67b4('0x3c')],_0x4efde2[_0x67b4('0x3d')]);_0x173523[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x4efde2[_0x67b4('0x3c')],qs['fields'](_0xbf67c0[_0x67b4('0x3d')]['fields']));_0x173523[_0x67b4('0x41')]=_0x173523[_0x67b4('0x41')][_0x67b4('0x43')]?_0x173523[_0x67b4('0x41')]:_0x4efde2[_0x67b4('0x3c')];_0x173523[_0x67b4('0x46')]=qs[_0x67b4('0x47')](_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x173523[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_['pick'](_0xbf67c0[_0x67b4('0x3d')],_0x4efde2['filters']));if(_0xbf67c0['query']['filter']){_0x173523[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x173523[_0x67b4('0x48')],{'$or':_[_0x67b4('0x37')](_0x173523['attributes'],function(_0x48876e){var _0x2a288e={};_0x2a288e[_0x48876e]={'$like':'%'+_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x5e')]+'%'};return _0x2a288e;})});}_0x173523=_[_0x67b4('0x4a')]({},_0x173523,_0xbf67c0[_0x67b4('0x4c')]);return _0x41884b['getTeams'](_0x173523);}})[_0x67b4('0x30')](function(_0x429005){if(_0x429005){_0x5d4e7c=_0x429005[_0x67b4('0x43')];if(!_0xbf67c0['query'][_0x67b4('0x6b')](_0x67b4('0x44'))){_0x173523[_0x67b4('0x45')]=qs['limit'](_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x45')]);_0x173523['offset']=qs[_0x67b4('0x28')](_0xbf67c0[_0x67b4('0x3d')]['offset']);}return _0x41884b[_0x67b4('0x69')](_0x173523);}})[_0x67b4('0x30')](function(_0x1e71fb){if(_0x1e71fb){return _0x1e71fb?{'count':_0x5d4e7c,'rows':_0x1e71fb}:null;}})[_0x67b4('0x30')](respondWithResult(_0x6a667a,null))[_0x67b4('0x4f')](handleError(_0x6a667a,null));};exports['addTeams']=function(_0x1546f4,_0x5c4535,_0xa0884f){var _0x46edb7=_0x1546f4[_0x67b4('0x5a')]['ids'];return db[_0x67b4('0x6a')][_0x67b4('0x60')]({'where':{'id':_0x46edb7},'attributes':['id'],'include':[{'model':db[_0x67b4('0x61')],'as':_0x67b4('0x6c'),'attributes':['id',_0x67b4('0x34'),_0x67b4('0x6d'),_0x67b4('0x6e'),_0x67b4('0x6f')],'raw':!![]}]})[_0x67b4('0x30')](function(_0x503385){if(_0x503385){var _0x5bf2be=_['flatMap'](_0x503385,function(_0x30be10){var _0xf044cd=_0x30be10['get']({'plain':!![]});return _0xf044cd[_0x67b4('0x6c')];});return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x1546f4[_0x67b4('0x50')]['id']}})['then'](function(_0x135faa){return db[_0x67b4('0x70')]['transaction'](function(_0xecd9d7){return _0x135faa[_0x67b4('0x71')](_0x46edb7,{'transaction':_0xecd9d7})[_0x67b4('0x30')](function(){return BPromise[_0x67b4('0x72')](_0x5bf2be,function(_0x57db92){return db[_0x67b4('0x5f')]['findOrCreate']({'where':{'UserId':_0x57db92['id'],'ChatQueueId':_0x1546f4[_0x67b4('0x50')]['id']},'transaction':_0xecd9d7});});})['then'](function(){_0x5bf2be['forEach'](function(_0xf808bb){socket['emit']('userChatQueue:save',{'UserId':_0xf808bb['id'],'ChatQueueId':_0x135faa['id']});});});});});}})[_0x67b4('0x30')](respondWithStatusCode(_0x5c4535,null))[_0x67b4('0x4f')](handleError(_0x5c4535,null));};exports[_0x67b4('0x73')]=function(_0x3e9a94,_0xa95397,_0x8422c1){return db[_0x67b4('0x6a')][_0x67b4('0x60')]({'where':{'id':_0x3e9a94[_0x67b4('0x3d')][_0x67b4('0x74')]},'attributes':['id'],'include':[{'model':db[_0x67b4('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa95397,null))[_0x67b4('0x30')](function(_0x197e0e){var _0x283215=_[_0x67b4('0x37')](_0x197e0e,'id');var _0x597939=[];var _0xeb4c4a=[];var _0x236bf0=squel[_0x67b4('0x75')]();_0x236bf0[_0x67b4('0x76')](_0x67b4('0x77'))[_0x67b4('0x78')](_0x67b4('0x79'),'tq')[_0x67b4('0x7a')]('user_has_teams','ut',_0x67b4('0x7b'))[_0x67b4('0x48')](_0x67b4('0x7c'),_0x3e9a94[_0x67b4('0x50')]['id']);for(var _0x40ed79=0x0;_0x40ed79<_0x197e0e[_0x67b4('0x43')];_0x40ed79+=0x1){let _0x545a28=_0x197e0e[_0x40ed79];for(var _0x584309=0x0;_0x584309<_0x545a28['Agents'][_0x67b4('0x43')];_0x584309+=0x1){let _0x1c2dc5=_0x545a28[_0x67b4('0x6c')][_0x584309];var _0x527a00=_0x236bf0['clone']();_0x527a00[_0x67b4('0x48')](_0x67b4('0x7d'),_0x1c2dc5['id']);_0xeb4c4a[_0x67b4('0x7e')](db['sequelize'][_0x67b4('0x3d')](_0x527a00[_0x67b4('0x7f')](),{'type':db[_0x67b4('0x70')][_0x67b4('0x80')][_0x67b4('0x81')]})[_0x67b4('0x30')](function(_0xc4da17){if(_0xc4da17[_0x67b4('0x43')]===0x1){return _0x1c2dc5['id'];}else{var _0x3dd6c5=_[_0x67b4('0x82')](_[_0x67b4('0x37')](_0xc4da17,_0x67b4('0x83')),function(_0x472a92){return _[_0x67b4('0x84')](_0x283215,_0x472a92);});if(_0x3dd6c5){return _0x1c2dc5['id'];}}}));}}return BPromise['all'](_0xeb4c4a)[_0x67b4('0x30')](function(_0x374cd7){_0x597939=_(_0x597939)['union'](_0x374cd7)['compact']()[_0x67b4('0x85')]();return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3e9a94[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](function(_0x3e624f){return db[_0x67b4('0x70')]['transaction'](function(_0x15f413){return _0x3e624f[_0x67b4('0x73')](_0x3e9a94[_0x67b4('0x3d')][_0x67b4('0x74')],{'transaction':_0x15f413})['then'](function(){if(!_[_0x67b4('0x86')](_0x597939)){return _0x3e624f[_0x67b4('0x87')](_0x597939,{'transaction':_0x15f413});}})['then'](function(){_0x597939['forEach'](function(_0x23808c){socket['emit']('userChatQueue:remove',{'UserId':_0x23808c,'ChatQueueId':_0x3e624f['id']});});});});});});})[_0x67b4('0x30')](respondWithStatusCode(_0xa95397,null))[_0x67b4('0x4f')](handleError(_0xa95397,null));};exports[_0x67b4('0x88')]=function(_0x3bdd3f,_0x2ec9ee,_0x9b62d9){return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3bdd3f[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x2ec9ee,null))[_0x67b4('0x30')](function(_0x30bb1e){if(_0x30bb1e){return _0x30bb1e[_0x67b4('0x88')](_0x3bdd3f[_0x67b4('0x5a')][_0x67b4('0x74')],_[_0x67b4('0x89')](_0x3bdd3f[_0x67b4('0x5a')],[_0x67b4('0x74'),'id'])||{})[_0x67b4('0x8a')](function(_0x1ab132){for(var _0x4f32d7=0x0;_0x4f32d7<_0x3bdd3f[_0x67b4('0x5a')]['ids']['length'];_0x4f32d7+=0x1){socket[_0x67b4('0x8b')](_0x67b4('0x8c'),{'UserId':Number(_0x3bdd3f[_0x67b4('0x5a')]['ids'][_0x4f32d7]),'ChatQueueId':Number(_0x3bdd3f['params']['id'])});}return _0x1ab132;});}})[_0x67b4('0x30')](respondWithResult(_0x2ec9ee,null))[_0x67b4('0x4f')](handleError(_0x2ec9ee,null));};exports[_0x67b4('0x87')]=function(_0x3cfce4,_0x13eedc,_0x6188f7){return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3cfce4[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x13eedc,null))[_0x67b4('0x30')](function(_0x34999d){if(_0x34999d){return _0x34999d[_0x67b4('0x87')](_0x3cfce4['query'][_0x67b4('0x74')])[_0x67b4('0x30')](function(){if(_[_0x67b4('0x8d')](_0x3cfce4['query']['ids'])){for(var _0x32ce8c=0x0;_0x32ce8c<_0x3cfce4['query']['ids'][_0x67b4('0x43')];_0x32ce8c+=0x1){socket[_0x67b4('0x8b')](_0x67b4('0x8e'),{'UserId':Number(_0x3cfce4[_0x67b4('0x3d')][_0x67b4('0x74')][_0x32ce8c]),'ChatQueueId':Number(_0x3cfce4['params']['id'])});}}else{socket[_0x67b4('0x8b')]('userChatQueue:remove',{'UserId':Number(_0x3cfce4['query'][_0x67b4('0x74')]),'ChatQueueId':Number(_0x3cfce4[_0x67b4('0x50')]['id'])});}});}})[_0x67b4('0x30')](respondWithStatusCode(_0x13eedc,null))[_0x67b4('0x4f')](handleError(_0x13eedc,null));};exports[_0x67b4('0x8f')]=function(_0x43365b,_0x4f7868,_0x17fc52){var _0x6ed856={};var _0x4065ed={};var _0xf4146a;var _0x47df50;return db['ChatQueue'][_0x67b4('0x5c')]({'where':{'id':_0x43365b['params']['id']}})['then'](handleEntityNotFound(_0x4f7868,null))[_0x67b4('0x30')](function(_0x54b3aa){if(_0x54b3aa){_0xf4146a=_0x54b3aa;_0x4065ed['model']=_[_0x67b4('0x3e')](db['User'][_0x67b4('0x39')]);_0x4065ed[_0x67b4('0x3d')]=_['keys'](_0x43365b[_0x67b4('0x3d')]);_0x4065ed[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4065ed[_0x67b4('0x3c')],_0x4065ed[_0x67b4('0x3d')]);_0x6ed856[_0x67b4('0x41')]=_['intersection'](_0x4065ed[_0x67b4('0x3c')],qs['fields'](_0x43365b[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x6ed856[_0x67b4('0x41')]=_0x6ed856['attributes'][_0x67b4('0x43')]?_0x6ed856[_0x67b4('0x41')]:_0x4065ed[_0x67b4('0x3c')];_0x6ed856['order']=qs['sort'](_0x43365b[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x6ed856[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_[_0x67b4('0x49')](_0x43365b['query'],_0x4065ed['filters']));if(_0x43365b[_0x67b4('0x3d')][_0x67b4('0x5e')]){_0x6ed856[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x6ed856[_0x67b4('0x48')],{'$or':_['map'](_0x6ed856[_0x67b4('0x41')],function(_0x570d1c){var _0x3a1d33={};_0x3a1d33[_0x570d1c]={'$like':'%'+_0x43365b[_0x67b4('0x3d')]['filter']+'%'};return _0x3a1d33;})});}_0x6ed856=_[_0x67b4('0x4a')]({},_0x6ed856,_0x43365b[_0x67b4('0x4c')]);return _0xf4146a[_0x67b4('0x8f')](_0x6ed856);}})['then'](function(_0x4baa0e){if(_0x4baa0e){_0x47df50=_0x4baa0e[_0x67b4('0x43')];if(!_0x43365b[_0x67b4('0x3d')]['hasOwnProperty'](_0x67b4('0x44'))){_0x6ed856[_0x67b4('0x45')]=qs[_0x67b4('0x45')](_0x43365b['query'][_0x67b4('0x45')]);_0x6ed856['offset']=qs[_0x67b4('0x28')](_0x43365b[_0x67b4('0x3d')]['offset']);}return _0xf4146a['getAgents'](_0x6ed856);}})[_0x67b4('0x30')](function(_0x371ce8){if(_0x371ce8){return _0x371ce8?{'count':_0x47df50,'rows':_0x371ce8}:null;}})[_0x67b4('0x30')](respondWithResult(_0x4f7868,null))[_0x67b4('0x4f')](handleError(_0x4f7868,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index cd25965..99a7974 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 _0xa8f0=['remove','emit','hook','events','../../mysqldb','ChatQueue','save','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa8f0,0x123));var _0x0a8f=function(_0xcd26a9,_0x512e77){_0xcd26a9=_0xcd26a9-0x0;var _0x3afcbc=_0xa8f0[_0xcd26a9];return _0x3afcbc;};'use strict';var EventEmitter=require(_0x0a8f('0x0'));var ChatQueue=require(_0x0a8f('0x1'))['db'][_0x0a8f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a8f('0x3'),'afterUpdate':_0x0a8f('0x4'),'afterDestroy':_0x0a8f('0x5')};function emitEvent(_0x40c423){return function(_0x2e72fe,_0xce0ba0,_0x2333fc){ChatQueueEvents[_0x0a8f('0x6')](_0x40c423+':'+_0x2e72fe['id'],_0x2e72fe);ChatQueueEvents[_0x0a8f('0x6')](_0x40c423,_0x2e72fe);_0x2333fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0a8f('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x9bbf=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x24f5cf,_0x11986d){var _0x323c71=function(_0x446288){while(--_0x446288){_0x24f5cf['push'](_0x24f5cf['shift']());}};_0x323c71(++_0x11986d);}(_0x9bbf,0x111));var _0xf9bb=function(_0x5b20e7,_0x4fdd80){_0x5b20e7=_0x5b20e7-0x0;var _0x38a218=_0x9bbf[_0x5b20e7];return _0x38a218;};'use strict';var EventEmitter=require(_0xf9bb('0x0'));var ChatQueue=require(_0xf9bb('0x1'))['db'][_0xf9bb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9bb('0x3'),'afterUpdate':_0xf9bb('0x4'),'afterDestroy':_0xf9bb('0x5')};function emitEvent(_0x18a886){return function(_0x27e06d,_0x459537,_0x15e4c6){ChatQueueEvents[_0xf9bb('0x6')](_0x18a886+':'+_0x27e06d['id'],_0x27e06d);ChatQueueEvents[_0xf9bb('0x6')](_0x18a886,_0x27e06d);_0x15e4c6(null);};}for(var e in events){if(events[_0xf9bb('0x7')](e)){var event=events[e];ChatQueue[_0xf9bb('0x8')](e,emitEvent(event));}}module[_0xf9bb('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 4e3a55a..3093177 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 _0x254f=['chat_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x4bdfd1,_0x1edd5a){var _0x44957f=function(_0x61bbf4){while(--_0x61bbf4){_0x4bdfd1['push'](_0x4bdfd1['shift']());}};_0x44957f(++_0x1edd5a);}(_0x254f,0x1f0));var _0xf254=function(_0x2d852d,_0x3c6deb){_0x2d852d=_0x2d852d-0x0;var _0x3bf2d9=_0x254f[_0x2d852d];return _0x3bf2d9;};'use strict';var _=require(_0xf254('0x0'));var util=require(_0xf254('0x1'));var logger=require('../../config/logger')(_0xf254('0x2'));var moment=require(_0xf254('0x3'));var BPromise=require(_0xf254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf254('0x5'));var rimraf=require(_0xf254('0x6'));var config=require(_0xf254('0x7'));var attributes=require(_0xf254('0x8'));module[_0xf254('0x9')]=function(_0x4363e,_0x1dad15){return _0x4363e['define']('ChatQueue',attributes,{'tableName':_0xf254('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe536=['moment','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0x54977a,_0x5bbdc9){var _0x1c65b4=function(_0x22645d){while(--_0x22645d){_0x54977a['push'](_0x54977a['shift']());}};_0x1c65b4(++_0x5bbdc9);}(_0xe536,0x101));var _0x6e53=function(_0x149c07,_0x181628){_0x149c07=_0x149c07-0x0;var _0x158124=_0xe536[_0x149c07];return _0x158124;};'use strict';var _=require(_0x6e53('0x0'));var util=require(_0x6e53('0x1'));var logger=require(_0x6e53('0x2'))('api');var moment=require(_0x6e53('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e53('0x4'));var fs=require('fs');var path=require(_0x6e53('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e53('0x6'));module[_0x6e53('0x7')]=function(_0x5477ce,_0x2bbf42){return _0x5477ce[_0x6e53('0x8')](_0x6e53('0x9'),attributes,{'tableName':'chat_queues','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 3c945ce..d98fc15 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 _0xab40=['GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowChatQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xab40,0xcd));var _0x0ab4=function(_0x26b98d,_0x34ce51){_0x26b98d=_0x26b98d-0x0;var _0x1152a1=_0xab40[_0x26b98d];return _0x1152a1;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')]({'raw':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1c')]||null:null,'attributes':_0x4e7852['options']?_0x4e7852['options'][_0x0ab4('0x1d')]||null:null,'limit':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1e')]||null:null,'include':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4e7852['options']['include'],function(_0x176ff1){return{'model':db[_0x176ff1[_0x0ab4('0x21')]],'as':_0x176ff1['as'],'attributes':_0x176ff1[_0x0ab4('0x1d')],'include':_0x176ff1['include']?_['map'](_0x176ff1['include'],function(_0x19ecc6){return{'model':db[_0x19ecc6['model']],'as':_0x19ecc6['as'],'attributes':_0x19ecc6[_0x0ab4('0x1d')],'include':_0x19ecc6[_0x0ab4('0x1f')]?_['map'](_0x19ecc6['include'],function(_0x4d0cc1){return{'model':db[_0x4d0cc1[_0x0ab4('0x21')]],'as':_0x4d0cc1['as'],'attributes':_0x4d0cc1[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0x3f61cb){logger[_0x0ab4('0x22')]('GetChatQueue',_0x4e7852);logger['debug']('GetChatQueue',_0x4e7852,JSON[_0x0ab4('0x12')](_0x3f61cb));_0xdb0797(_0x3f61cb);})[_0x0ab4('0x23')](function(_0x155d96){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x155d96['message'],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x155d96[_0x0ab4('0x15')]));});});};exports[_0x0ab4('0x24')]=function(_0x361f7c){var _0x4819be=this;return new Promise(function(_0x48e430,_0x1b19db){return db['ChatQueue'][_0x0ab4('0x25')]({'raw':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')]['where']||null:null,'attributes':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1d')]||null:null,'include':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c['options']['include']?_[_0x0ab4('0x20')](_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1f')],function(_0x4fca1b){return{'model':db[_0x4fca1b['model']],'as':_0x4fca1b['as'],'attributes':_0x4fca1b['attributes'],'include':_0x4fca1b[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4fca1b[_0x0ab4('0x1f')],function(_0x53d1fc){return{'model':db[_0x53d1fc['model']],'as':_0x53d1fc['as'],'attributes':_0x53d1fc['attributes'],'include':_0x53d1fc[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x53d1fc[_0x0ab4('0x1f')],function(_0x39d99b){return{'model':db[_0x39d99b[_0x0ab4('0x21')]],'as':_0x39d99b['as'],'attributes':_0x39d99b[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0xfb7f92){logger[_0x0ab4('0x22')](_0x0ab4('0x24'),_0x361f7c);logger['debug'](_0x0ab4('0x24'),_0x361f7c,JSON[_0x0ab4('0x12')](_0xfb7f92));_0x48e430(_0xfb7f92);})[_0x0ab4('0x23')](function(_0x97d4ad){logger[_0x0ab4('0x13')](_0x0ab4('0x24'),_0x97d4ad[_0x0ab4('0x15')],_0x361f7c);_0x1b19db(_0x4819be[_0x0ab4('0x13')](0x1f4,_0x97d4ad[_0x0ab4('0x15')]));});});}; \ No newline at end of file +var _0xca73=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','catch','ChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2730c9,_0x4b9f79){var _0x2f1cf5=function(_0x4bf349){while(--_0x4bf349){_0x2730c9['push'](_0x2730c9['shift']());}};_0x2f1cf5(++_0x4b9f79);}(_0xca73,0x1ee));var _0x3ca7=function(_0x49d48d,_0xf1fdaa){_0x49d48d=_0x49d48d-0x0;var _0x46e093=_0xca73[_0x49d48d];return _0x46e093;};'use strict';var _=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var moment=require('moment');var BPromise=require(_0x3ca7('0x2'));var rs=require(_0x3ca7('0x3'));var fs=require('fs');var Redis=require(_0x3ca7('0x4'));var db=require(_0x3ca7('0x5'))['db'];var utils=require(_0x3ca7('0x6'));var logger=require(_0x3ca7('0x7'))(_0x3ca7('0x8'));var config=require(_0x3ca7('0x9'));var jayson=require(_0x3ca7('0xa'));var client=jayson[_0x3ca7('0xb')]['http']({'port':0x232a});config[_0x3ca7('0xc')]=_[_0x3ca7('0xd')](config[_0x3ca7('0xc')],{'host':_0x3ca7('0xe'),'port':0x18eb});var socket=require(_0x3ca7('0xf'))(new Redis(config[_0x3ca7('0xc')]));require('./chatQueue.socket')[_0x3ca7('0x10')](socket);function respondWithRpcPromise(_0xf5217a,_0x484546,_0x5acbe2){return new BPromise(function(_0x33f89c,_0x1fbfe7){return client[_0x3ca7('0x11')](_0xf5217a,_0x5acbe2)[_0x3ca7('0x12')](function(_0x186739){logger[_0x3ca7('0x13')](_0x3ca7('0x14'),_0x484546,_0x3ca7('0x15'));logger[_0x3ca7('0x16')](_0x3ca7('0x17'),_0x484546,_0x3ca7('0x15'),JSON[_0x3ca7('0x18')](_0x186739));if(_0x186739[_0x3ca7('0x19')]){if(_0x186739['error'][_0x3ca7('0x1a')]===0x1f4){logger[_0x3ca7('0x19')]('ChatQueue,\x20%s,\x20%s',_0x484546,_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);return _0x1fbfe7(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}logger['error'](_0x3ca7('0x14'),_0x484546,_0x186739['error'][_0x3ca7('0x1b')]);return _0x33f89c(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}else{logger['info'](_0x3ca7('0x14'),_0x484546,'request\x20sent');_0x33f89c(_0x186739['result'][_0x3ca7('0x1b')]);}})['catch'](function(_0x40d7f0){logger['error']('ChatQueue,\x20%s,\x20%s',_0x484546,_0x40d7f0);_0x1fbfe7(_0x40d7f0);});});}exports[_0x3ca7('0x1c')]=function(_0x181849){var _0x2d2882=this;return new Promise(function(_0x49f0ad,_0x2f28cb){return db['ChatQueue'][_0x3ca7('0x1d')]({'raw':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x181849['options']?_0x181849['options'][_0x3ca7('0x20')]||null:null,'attributes':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')]['attributes']||null:null,'limit':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x21')]||null:null,'include':_0x181849[_0x3ca7('0x1e')]?_0x181849['options']['include']?_[_0x3ca7('0x22')](_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x23')],function(_0x2fbd3a){return{'model':db[_0x2fbd3a[_0x3ca7('0x24')]],'as':_0x2fbd3a['as'],'attributes':_0x2fbd3a[_0x3ca7('0x25')],'include':_0x2fbd3a[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x2fbd3a[_0x3ca7('0x23')],function(_0x236e7d){return{'model':db[_0x236e7d[_0x3ca7('0x24')]],'as':_0x236e7d['as'],'attributes':_0x236e7d[_0x3ca7('0x25')],'include':_0x236e7d[_0x3ca7('0x23')]?_['map'](_0x236e7d[_0x3ca7('0x23')],function(_0x308541){return{'model':db[_0x308541[_0x3ca7('0x24')]],'as':_0x308541['as'],'attributes':_0x308541[_0x3ca7('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30aa21){logger['info']('GetChatQueue',_0x181849);logger[_0x3ca7('0x16')]('GetChatQueue',_0x181849,JSON[_0x3ca7('0x18')](_0x30aa21));_0x49f0ad(_0x30aa21);})[_0x3ca7('0x26')](function(_0x1a579d){logger['error']('GetChatQueue',_0x1a579d[_0x3ca7('0x1b')],_0x181849);_0x2f28cb(_0x2d2882['error'](0x1f4,_0x1a579d[_0x3ca7('0x1b')]));});});};exports['ShowChatQueue']=function(_0x597bd3){var _0x3bd2de=this;return new Promise(function(_0x402489,_0x5e2816){return db[_0x3ca7('0x27')][_0x3ca7('0x28')]({'raw':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x20')]||null:null,'attributes':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')]['attributes']||null:null,'include':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3['options'][_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x597bd3[_0x3ca7('0x1e')]['include'],function(_0x4a597c){return{'model':db[_0x4a597c['model']],'as':_0x4a597c['as'],'attributes':_0x4a597c[_0x3ca7('0x25')],'include':_0x4a597c[_0x3ca7('0x23')]?_['map'](_0x4a597c[_0x3ca7('0x23')],function(_0x5a1c27){return{'model':db[_0x5a1c27[_0x3ca7('0x24')]],'as':_0x5a1c27['as'],'attributes':_0x5a1c27[_0x3ca7('0x25')],'include':_0x5a1c27[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x5a1c27[_0x3ca7('0x23')],function(_0xd4cb0a){return{'model':db[_0xd4cb0a['model']],'as':_0xd4cb0a['as'],'attributes':_0xd4cb0a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d948a){logger['info'](_0x3ca7('0x29'),_0x597bd3);logger[_0x3ca7('0x16')](_0x3ca7('0x29'),_0x597bd3,JSON[_0x3ca7('0x18')](_0x3d948a));_0x402489(_0x3d948a);})['catch'](function(_0x12c47a){logger[_0x3ca7('0x19')](_0x3ca7('0x29'),_0x12c47a[_0x3ca7('0x1b')],_0x597bd3);_0x5e2816(_0x3bd2de['error'](0x1f4,_0x12c47a[_0x3ca7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5f13fd0..0933e6f 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 _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1e1a38,_0x3af90b){var _0x5d64b7=function(_0x1ce709){while(--_0x1ce709){_0x1e1a38['push'](_0x1e1a38['shift']());}};_0x5d64b7(++_0x3af90b);}(_0x6334,0x119));var _0x4633=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x6334[_0x18cd5b];return _0x5eaa52;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}}; \ No newline at end of file +var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x20d86c,_0x496aa2){var _0x67fd03=function(_0x165533){while(--_0x165533){_0x20d86c['push'](_0x20d86c['shift']());}};_0x67fd03(++_0x496aa2);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x44f353,_0x5b6c2f){_0x44f353=_0x44f353-0x0;var _0x26a635=_0xd0bb[_0x44f353];return _0x26a635;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4ef7379..bf6dd8e 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x5fc3[_0x2d6197];return _0x4d0e75;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x51f775,_0x1c15da){var _0xc3b3a9=function(_0x8bef41){while(--_0x8bef41){_0x51f775['push'](_0x51f775['shift']());}};_0xc3b3a9(++_0x1c15da);}(_0x814b,0x1a2));var _0xb814=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0x814b[_0x7ea1fb];return _0x478241;};'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('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2661185..67bf75e 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 _0x36dc=['sequelize','exports','STRING','DATE'];(function(_0x3e738d,_0x2c71dd){var _0xa4840a=function(_0x3f1c43){while(--_0x3f1c43){_0x3e738d['push'](_0x3e738d['shift']());}};_0xa4840a(++_0x2c71dd);}(_0x36dc,0x8c));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var moment=require('moment');var Sequelize=require(_0xc36d('0x0'));module[_0xc36d('0x1')]={'uniqueid':{'type':Sequelize[_0xc36d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc36d('0x3')]},'leaveAt':{'type':Sequelize[_0xc36d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc36d('0x2')]}}; \ No newline at end of file +var _0x397b=['exports','STRING','DATE','moment','sequelize'];(function(_0x25eb4a,_0x504440){var _0x4aa8e2=function(_0x532252){while(--_0x532252){_0x25eb4a['push'](_0x25eb4a['shift']());}};_0x4aa8e2(++_0x504440);}(_0x397b,0x17f));var _0xb397=function(_0x21dafb,_0x35d6e7){_0x21dafb=_0x21dafb-0x0;var _0x30a449=_0x397b[_0x21dafb];return _0x30a449;};'use strict';var moment=require(_0xb397('0x0'));var Sequelize=require(_0xb397('0x1'));module[_0xb397('0x2')]={'uniqueid':{'type':Sequelize[_0xb397('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb397('0x3')]},'joinAt':{'type':Sequelize[_0xb397('0x4')]},'leaveAt':{'type':Sequelize[_0xb397('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb397('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index ad6d5c5..751d7fb 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 _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1f336d,_0x5d0bee){var _0x49199d=function(_0x3ea45c){while(--_0x3ea45c){_0x1f336d['push'](_0x1f336d['shift']());}};_0x49199d(++_0x5d0bee);}(_0x3837,0x1d1));var _0x7383=function(_0x341781,_0x207d7e){_0x341781=_0x341781-0x0;var _0x2f9145=_0x3837[_0x341781];return _0x2f9145;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['ChatQueueReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['ChatQueueReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['ChatQueueReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));}; \ No newline at end of file +var _0x96e0=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','show','params','keys','include','options','catch','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse'];(function(_0x48ff3c,_0x516bb9){var _0x20c8db=function(_0x30ee36){while(--_0x30ee36){_0x48ff3c['push'](_0x48ff3c['shift']());}};_0x20c8db(++_0x516bb9);}(_0x96e0,0x7e));var _0x096e=function(_0x1281b2,_0x163c8e){_0x1281b2=_0x1281b2-0x0;var _0xb57d78=_0x96e0[_0x1281b2];return _0xb57d78;};'use strict';var emlformat=require(_0x096e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x096e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x096e('0x2'));var BPromise=require(_0x096e('0x3'));var Mustache=require(_0x096e('0x4'));var util=require(_0x096e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x096e('0x6'));var fs=require('fs');var fs_extra=require(_0x096e('0x7'));var _=require(_0x096e('0x8'));var squel=require(_0x096e('0x9'));var crypto=require(_0x096e('0xa'));var jsforce=require(_0x096e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x096e('0xc'));var querystring=require('querystring');var Papa=require(_0x096e('0xd'));var Redis=require(_0x096e('0xe'));var authService=require(_0x096e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x096e('0x10'));var hardwareService=require(_0x096e('0x11'));var logger=require(_0x096e('0x12'))('api');var utils=require(_0x096e('0x13'));var config=require(_0x096e('0x14'));var licenseUtil=require(_0x096e('0x15'));var db=require(_0x096e('0x16'))['db'];function respondWithStatusCode(_0x1b5058,_0xdf4398){_0xdf4398=_0xdf4398||0xcc;return function(_0xaf8fce){if(_0xaf8fce){return _0x1b5058['sendStatus'](_0xdf4398);}return _0x1b5058[_0x096e('0x17')](_0xdf4398)[_0x096e('0x18')]();};}function respondWithResult(_0x597d9c,_0x73ac62){_0x73ac62=_0x73ac62||0xc8;return function(_0x18fe8f){if(_0x18fe8f){return _0x597d9c[_0x096e('0x17')](_0x73ac62)[_0x096e('0x19')](_0x18fe8f);}};}function respondWithFilteredResult(_0x5df693,_0x1da677){return function(_0xbf0294){if(_0xbf0294){var _0x53e483=typeof _0x1da677[_0x096e('0x1a')]==='undefined'&&typeof _0x1da677[_0x096e('0x1b')]===_0x096e('0x1c');var _0x1bf7c5=_0xbf0294[_0x096e('0x1d')];var _0x396f57=_0x53e483?0x0:_0x1da677[_0x096e('0x1a')];var _0x32da71=_0x53e483?_0xbf0294['count']:_0x1da677['offset']+_0x1da677['limit'];var _0x29a380;if(_0x32da71>=_0x1bf7c5){_0x32da71=_0x1bf7c5;_0x29a380=0xc8;}else{_0x29a380=0xce;}_0x5df693[_0x096e('0x17')](_0x29a380);return _0x5df693['set'](_0x096e('0x1e'),_0x396f57+'-'+_0x32da71+'/'+_0x1bf7c5)[_0x096e('0x19')](_0xbf0294);}return null;};}function patchUpdates(_0x4fdbcd){return function(_0x3a99fb){try{jsonpatch['apply'](_0x3a99fb,_0x4fdbcd,!![]);}catch(_0x4c92ab){return BPromise[_0x096e('0x1f')](_0x4c92ab);}return _0x3a99fb[_0x096e('0x20')]();};}function saveUpdates(_0x508663,_0x22e788){return function(_0x63bce1){if(_0x63bce1){return _0x63bce1[_0x096e('0x21')](_0x508663)['then'](function(_0x508232){return _0x508232;});}return null;};}function removeEntity(_0x310556,_0x4124b8){return function(_0x2affa2){if(_0x2affa2){return _0x2affa2[_0x096e('0x22')]()[_0x096e('0x23')](function(){_0x310556['status'](0xcc)[_0x096e('0x18')]();});}};}function handleEntityNotFound(_0x5f5189,_0x2a368a){return function(_0xccfaac){if(!_0xccfaac){_0x5f5189[_0x096e('0x24')](0x194);}return _0xccfaac;};}function handleError(_0x4d2941,_0xdb7a74){_0xdb7a74=_0xdb7a74||0x1f4;return function(_0x56a2c3){logger['error'](_0x56a2c3[_0x096e('0x25')]);if(_0x56a2c3[_0x096e('0x26')]){delete _0x56a2c3[_0x096e('0x26')];}_0x4d2941[_0x096e('0x17')](_0xdb7a74)[_0x096e('0x27')](_0x56a2c3);};}exports['index']=function(_0x3cbcac,_0x3a9d96){var _0x3686d7={},_0xe9a941={},_0x579c81={'count':0x0,'rows':[]};var _0x59c684=_[_0x096e('0x28')](db[_0x096e('0x29')][_0x096e('0x2a')],function(_0x686649){return{'name':_0x686649[_0x096e('0x2b')],'type':_0x686649[_0x096e('0x2c')][_0x096e('0x2d')]};});_0xe9a941[_0x096e('0x2e')]=_['map'](_0x59c684,_0x096e('0x26'));_0xe9a941[_0x096e('0x2f')]=_['keys'](_0x3cbcac[_0x096e('0x2f')]);_0xe9a941[_0x096e('0x30')]=_[_0x096e('0x31')](_0xe9a941[_0x096e('0x2e')],_0xe9a941['query']);_0x3686d7[_0x096e('0x32')]=_[_0x096e('0x31')](_0xe9a941[_0x096e('0x2e')],qs[_0x096e('0x33')](_0x3cbcac[_0x096e('0x2f')]['fields']));_0x3686d7[_0x096e('0x32')]=_0x3686d7[_0x096e('0x32')][_0x096e('0x34')]?_0x3686d7['attributes']:_0xe9a941[_0x096e('0x2e')];if(!_0x3cbcac['query']['hasOwnProperty']('nolimit')){_0x3686d7[_0x096e('0x1b')]=qs[_0x096e('0x1b')](_0x3cbcac[_0x096e('0x2f')][_0x096e('0x1b')]);_0x3686d7[_0x096e('0x1a')]=qs[_0x096e('0x1a')](_0x3cbcac['query'][_0x096e('0x1a')]);}_0x3686d7[_0x096e('0x35')]=qs['sort'](_0x3cbcac[_0x096e('0x2f')][_0x096e('0x36')]);_0x3686d7[_0x096e('0x37')]=qs['filters'](_[_0x096e('0x38')](_0x3cbcac['query'],_0xe9a941[_0x096e('0x30')]),_0x59c684);if(_0x3cbcac[_0x096e('0x2f')][_0x096e('0x39')]){_0x3686d7[_0x096e('0x37')]=_[_0x096e('0x3a')](_0x3686d7[_0x096e('0x37')],{'$or':_[_0x096e('0x28')](_0x59c684,function(_0x277b56){if(_0x277b56[_0x096e('0x2c')]!==_0x096e('0x3b')){var _0x5c8006={};_0x5c8006[_0x277b56[_0x096e('0x26')]]={'$like':'%'+_0x3cbcac['query'][_0x096e('0x39')]+'%'};return _0x5c8006;}})});}_0x3686d7=_['merge']({},_0x3686d7,_0x3cbcac['options']);var _0x7a4d5a={'where':_0x3686d7['where']};return db[_0x096e('0x29')][_0x096e('0x1d')](_0x7a4d5a)['then'](function(_0x101550){_0x579c81[_0x096e('0x1d')]=_0x101550;if(_0x3cbcac[_0x096e('0x2f')][_0x096e('0x3c')]){_0x3686d7['include']=[{'all':!![]}];}return db[_0x096e('0x29')]['findAll'](_0x3686d7);})[_0x096e('0x23')](function(_0x3dc295){_0x579c81['rows']=_0x3dc295;return _0x579c81;})[_0x096e('0x23')](respondWithFilteredResult(_0x3a9d96,_0x3686d7))['catch'](handleError(_0x3a9d96,null));};exports[_0x096e('0x3d')]=function(_0x8317c1,_0x4b1618){var _0x4f9794={'raw':!![],'where':{'id':_0x8317c1[_0x096e('0x3e')]['id']}},_0x5bd8d3={};_0x5bd8d3[_0x096e('0x2e')]=_[_0x096e('0x3f')](db[_0x096e('0x29')][_0x096e('0x2a')]);_0x5bd8d3[_0x096e('0x2f')]=_[_0x096e('0x3f')](_0x8317c1[_0x096e('0x2f')]);_0x5bd8d3['filters']=_[_0x096e('0x31')](_0x5bd8d3[_0x096e('0x2e')],_0x5bd8d3[_0x096e('0x2f')]);_0x4f9794[_0x096e('0x32')]=_[_0x096e('0x31')](_0x5bd8d3[_0x096e('0x2e')],qs[_0x096e('0x33')](_0x8317c1['query'][_0x096e('0x33')]));_0x4f9794[_0x096e('0x32')]=_0x4f9794[_0x096e('0x32')]['length']?_0x4f9794[_0x096e('0x32')]:_0x5bd8d3[_0x096e('0x2e')];if(_0x8317c1[_0x096e('0x2f')]['includeAll']){_0x4f9794[_0x096e('0x40')]=[{'all':!![]}];}_0x4f9794=_['merge']({},_0x4f9794,_0x8317c1[_0x096e('0x41')]);return db[_0x096e('0x29')]['find'](_0x4f9794)[_0x096e('0x23')](handleEntityNotFound(_0x4b1618,null))['then'](respondWithResult(_0x4b1618,null))[_0x096e('0x42')](handleError(_0x4b1618,null));};exports[_0x096e('0x43')]=function(_0x2e6997,_0x1db2ae){return db['ChatQueueReport'][_0x096e('0x43')](_0x2e6997[_0x096e('0x44')],{})[_0x096e('0x23')](respondWithResult(_0x1db2ae,0xc9))[_0x096e('0x42')](handleError(_0x1db2ae,null));};exports[_0x096e('0x21')]=function(_0x2a849b,_0x1becda){if(_0x2a849b[_0x096e('0x44')]['id']){delete _0x2a849b[_0x096e('0x44')]['id'];}return db[_0x096e('0x29')]['find']({'where':{'id':_0x2a849b[_0x096e('0x3e')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x1becda,null))['then'](saveUpdates(_0x2a849b[_0x096e('0x44')],null))['then'](respondWithResult(_0x1becda,null))[_0x096e('0x42')](handleError(_0x1becda,null));};exports[_0x096e('0x22')]=function(_0x43cebc,_0x4609bb){return db[_0x096e('0x29')]['find']({'where':{'id':_0x43cebc[_0x096e('0x3e')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x4609bb,null))[_0x096e('0x23')](removeEntity(_0x4609bb,null))[_0x096e('0x42')](handleError(_0x4609bb,null));};exports['describe']=function(_0x19c6f4,_0x1d4640){return db['ChatQueueReport'][_0x096e('0x45')]()[_0x096e('0x23')](respondWithResult(_0x1d4640,null))['catch'](handleError(_0x1d4640,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index efff00a..45e219a 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x6620b8,_0x8b3d5e){var _0x33de50=function(_0x2f1f07){while(--_0x2f1f07){_0x6620b8['push'](_0x6620b8['shift']());}};_0x33de50(++_0x8b3d5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x37870d,_0x356e02){_0x37870d=_0x37870d-0x0;var _0x1ae695=_0xb10b[_0x37870d];return _0x1ae695;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 21896fa..7704998 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 _0xbb05=['body','where','attributes','limit','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xbb05,0xa5));var _0x5bb0=function(_0x1f14fb,_0x2a81b3){_0x1f14fb=_0x1f14fb-0x0;var _0xa0ea2a=_0xbb05[_0x1f14fb];return _0xa0ea2a;};'use strict';var _=require('lodash');var util=require(_0x5bb0('0x0'));var moment=require(_0x5bb0('0x1'));var BPromise=require(_0x5bb0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bb0('0x3'));var db=require(_0x5bb0('0x4'))['db'];var utils=require(_0x5bb0('0x5'));var logger=require(_0x5bb0('0x6'))(_0x5bb0('0x7'));var config=require(_0x5bb0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5bb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ab813,_0x102e05,_0x5af534){return new BPromise(function(_0x21941c,_0x40e82c){return client[_0x5bb0('0xa')](_0x5ab813,_0x5af534)[_0x5bb0('0xb')](function(_0x1c61cb){logger[_0x5bb0('0xc')](_0x5bb0('0xd'),_0x102e05,_0x5bb0('0xe'));logger['debug'](_0x5bb0('0xf'),_0x102e05,_0x5bb0('0xe'),JSON['stringify'](_0x1c61cb));if(_0x1c61cb[_0x5bb0('0x10')]){if(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x11')]===0x1f4){logger[_0x5bb0('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x102e05,_0x1c61cb[_0x5bb0('0x10')]['message']);return _0x40e82c(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x12')]);}logger[_0x5bb0('0x10')](_0x5bb0('0xd'),_0x102e05,_0x1c61cb['error']['message']);return _0x21941c(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x12')]);}else{logger[_0x5bb0('0xc')](_0x5bb0('0xd'),_0x102e05,_0x5bb0('0xe'));_0x21941c(_0x1c61cb['result']['message']);}})[_0x5bb0('0x13')](function(_0xad590b){logger[_0x5bb0('0x10')](_0x5bb0('0xd'),_0x102e05,_0xad590b);_0x40e82c(_0xad590b);});});}exports[_0x5bb0('0x14')]=function(_0x99a9b9){var _0x36657d=this;return new Promise(function(_0x416c6e,_0x429a23){return db[_0x5bb0('0x15')][_0x5bb0('0x16')](_0x99a9b9['body'],{'raw':_0x99a9b9['options']?_0x99a9b9[_0x5bb0('0x17')][_0x5bb0('0x18')]===undefined?!![]:![]:!![]})[_0x5bb0('0xb')](function(_0x2bb5d6){logger['info'](_0x5bb0('0x14'),_0x99a9b9);logger['debug'](_0x5bb0('0x14'),_0x99a9b9,JSON['stringify'](_0x2bb5d6));_0x416c6e(_0x2bb5d6);})[_0x5bb0('0x13')](function(_0x16e496){logger[_0x5bb0('0x10')](_0x5bb0('0x14'),_0x16e496['message'],_0x99a9b9);_0x429a23(_0x36657d[_0x5bb0('0x10')](0x1f4,_0x16e496['message']));});});};exports[_0x5bb0('0x19')]=function(_0x398cb3){var _0x181dec=this;return new Promise(function(_0x6bb3e5,_0x528286){return db[_0x5bb0('0x15')][_0x5bb0('0x1a')](_0x398cb3[_0x5bb0('0x1b')],{'raw':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x1c')]||null:null,'attributes':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3['options'][_0x5bb0('0x1d')]||null:null,'limit':_0x398cb3['options']?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x1e')]||null:null})[_0x5bb0('0xb')](function(_0x5a03a9){logger[_0x5bb0('0xc')]('UpdateChatQueueReport',_0x398cb3);logger[_0x5bb0('0x1f')](_0x5bb0('0x19'),_0x398cb3,JSON['stringify'](_0x5a03a9));_0x6bb3e5(_0x5a03a9);})[_0x5bb0('0x13')](function(_0x25095b){logger[_0x5bb0('0x10')](_0x5bb0('0x19'),_0x25095b[_0x5bb0('0x12')],_0x398cb3);_0x528286(_0x181dec[_0x5bb0('0x10')](0x1f4,_0x25095b['message']));});});}; \ No newline at end of file +var _0x3186=['request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x2727e1,_0x302d6e){var _0x4de837=function(_0xa2e933){while(--_0xa2e933){_0x2727e1['push'](_0x2727e1['shift']());}};_0x4de837(++_0x302d6e);}(_0x3186,0x1ab));var _0x6318=function(_0x27614f,_0x5eac70){_0x27614f=_0x27614f-0x0;var _0x2d3d70=_0x3186[_0x27614f];return _0x2d3d70;};'use strict';var _=require(_0x6318('0x0'));var util=require(_0x6318('0x1'));var moment=require('moment');var BPromise=require(_0x6318('0x2'));var rs=require(_0x6318('0x3'));var fs=require('fs');var Redis=require(_0x6318('0x4'));var db=require(_0x6318('0x5'))['db'];var utils=require(_0x6318('0x6'));var logger=require(_0x6318('0x7'))(_0x6318('0x8'));var config=require(_0x6318('0x9'));var jayson=require(_0x6318('0xa'));var client=jayson[_0x6318('0xb')][_0x6318('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57ccc4,_0x20fbaa,_0x35fd94){return new BPromise(function(_0x5c4aef,_0x40b0aa){return client[_0x6318('0xd')](_0x57ccc4,_0x35fd94)[_0x6318('0xe')](function(_0x436e5e){logger[_0x6318('0xf')](_0x6318('0x10'),_0x20fbaa,_0x6318('0x11'));logger['debug'](_0x6318('0x12'),_0x20fbaa,_0x6318('0x11'),JSON[_0x6318('0x13')](_0x436e5e));if(_0x436e5e[_0x6318('0x14')]){if(_0x436e5e['error'][_0x6318('0x15')]===0x1f4){logger['error'](_0x6318('0x10'),_0x20fbaa,_0x436e5e['error']['message']);return _0x40b0aa(_0x436e5e[_0x6318('0x14')]['message']);}logger['error'](_0x6318('0x10'),_0x20fbaa,_0x436e5e[_0x6318('0x14')][_0x6318('0x16')]);return _0x5c4aef(_0x436e5e['error'][_0x6318('0x16')]);}else{logger['info'](_0x6318('0x10'),_0x20fbaa,_0x6318('0x11'));_0x5c4aef(_0x436e5e[_0x6318('0x17')][_0x6318('0x16')]);}})[_0x6318('0x18')](function(_0x5a029b){logger[_0x6318('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x20fbaa,_0x5a029b);_0x40b0aa(_0x5a029b);});});}exports[_0x6318('0x19')]=function(_0xad4f3e){var _0x32aede=this;return new Promise(function(_0x3afed0,_0x17dd6c){return db[_0x6318('0x1a')][_0x6318('0x1b')](_0xad4f3e[_0x6318('0x1c')],{'raw':_0xad4f3e[_0x6318('0x1d')]?_0xad4f3e[_0x6318('0x1d')][_0x6318('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x12ca95){logger[_0x6318('0xf')]('CreateChatQueueReport',_0xad4f3e);logger[_0x6318('0x1f')](_0x6318('0x19'),_0xad4f3e,JSON['stringify'](_0x12ca95));_0x3afed0(_0x12ca95);})[_0x6318('0x18')](function(_0xed023c){logger[_0x6318('0x14')](_0x6318('0x19'),_0xed023c['message'],_0xad4f3e);_0x17dd6c(_0x32aede[_0x6318('0x14')](0x1f4,_0xed023c[_0x6318('0x16')]));});});};exports[_0x6318('0x20')]=function(_0x22b81e){var _0x1ba69e=this;return new Promise(function(_0x1951d1,_0x426cbe){return db[_0x6318('0x1a')][_0x6318('0x21')](_0x22b81e['body'],{'raw':_0x22b81e[_0x6318('0x1d')]?_0x22b81e['options'][_0x6318('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22b81e['options']?_0x22b81e[_0x6318('0x1d')][_0x6318('0x22')]||null:null,'attributes':_0x22b81e[_0x6318('0x1d')]?_0x22b81e[_0x6318('0x1d')][_0x6318('0x23')]||null:null,'limit':_0x22b81e[_0x6318('0x1d')]?_0x22b81e[_0x6318('0x1d')][_0x6318('0x24')]||null:null})['then'](function(_0x4671af){logger[_0x6318('0xf')](_0x6318('0x20'),_0x22b81e);logger[_0x6318('0x1f')](_0x6318('0x20'),_0x22b81e,JSON[_0x6318('0x13')](_0x4671af));_0x1951d1(_0x4671af);})[_0x6318('0x18')](function(_0x5b44ad){logger[_0x6318('0x14')](_0x6318('0x20'),_0x5b44ad[_0x6318('0x16')],_0x22b81e);_0x426cbe(_0x1ba69e[_0x6318('0x14')](0x1f4,_0x5b44ad[_0x6318('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 155a03d..32812f4 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 _0x2b30=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/describe','isAuthenticated','describe','post','create','put','/:id','delete','exports','multer','path'];(function(_0x31de4e,_0x4024d8){var _0x3108d7=function(_0xe7593e){while(--_0xe7593e){_0x31de4e['push'](_0x31de4e['shift']());}};_0x3108d7(++_0x4024d8);}(_0x2b30,0x185));var _0x02b3=function(_0x54bc4b,_0x47747a){_0x54bc4b=_0x54bc4b-0x0;var _0x1a9163=_0x2b30[_0x54bc4b];return _0x1a9163;};'use strict';var multer=require(_0x02b3('0x0'));var util=require('util');var path=require(_0x02b3('0x1'));var timeout=require(_0x02b3('0x2'));var express=require(_0x02b3('0x3'));var router=express[_0x02b3('0x4')]();var fs_extra=require(_0x02b3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02b3('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x02b3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x02b3('0x7')](_0x02b3('0x8'),auth[_0x02b3('0x9')](),controller[_0x02b3('0xa')]);router['get']('/:id',auth[_0x02b3('0x9')](),controller['show']);router[_0x02b3('0xb')]('/',auth['isAuthenticated'](),controller[_0x02b3('0xc')]);router[_0x02b3('0xd')](_0x02b3('0xe'),auth[_0x02b3('0x9')](),controller['update']);router[_0x02b3('0xf')](_0x02b3('0xe'),auth[_0x02b3('0x9')](),controller['destroy']);module[_0x02b3('0x10')]=router; \ No newline at end of file +var _0x7f4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','util','path','connect-timeout','express'];(function(_0x13c844,_0x29f63f){var _0x550c66=function(_0x338287){while(--_0x338287){_0x13c844['push'](_0x13c844['shift']());}};_0x550c66(++_0x29f63f);}(_0x7f4c,0x9c));var _0xc7f4=function(_0x11f490,_0x3d7d36){_0x11f490=_0x11f490-0x0;var _0xf7b340=_0x7f4c[_0x11f490];return _0xf7b340;};'use strict';var multer=require('multer');var util=require(_0xc7f4('0x0'));var path=require(_0xc7f4('0x1'));var timeout=require(_0xc7f4('0x2'));var express=require(_0xc7f4('0x3'));var router=express[_0xc7f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7f4('0x5'));var interaction=require(_0xc7f4('0x6'));var config=require(_0xc7f4('0x7'));var controller=require(_0xc7f4('0x8'));router[_0xc7f4('0x9')]('/',auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xb')]);router[_0xc7f4('0x9')](_0xc7f4('0xc'),auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xd')]);router[_0xc7f4('0x9')]('/:id',auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xe')]);router[_0xc7f4('0xf')]('/',auth[_0xc7f4('0xa')](),controller['create']);router[_0xc7f4('0x10')](_0xc7f4('0x11'),auth[_0xc7f4('0xa')](),controller[_0xc7f4('0x12')]);router[_0xc7f4('0x13')]('/:id',auth[_0xc7f4('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f2efc1a..efa0c03 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1e1eec,_0x171a37){var _0x1be328=function(_0x49f547){while(--_0x49f547){_0x1e1eec['push'](_0x1e1eec['shift']());}};_0x1be328(++_0x171a37);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xcb91[_0x57e00e];return _0x415e60;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x568776,_0x1b5fc2){var _0x18393c=function(_0x5d7f3b){while(--_0x5d7f3b){_0x568776['push'](_0x568776['shift']());}};_0x18393c(++_0x1b5fc2);}(_0xaa88,0x137));var _0x8aa8=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xaa88[_0x24259d];return _0x5a701;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e14ed3e..ffa9e15 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 _0x3f94=['merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','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','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','json','reject','save','update','destroy','then','end','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x11099f,_0x1b7880){var _0x20d9da=function(_0x146ae2){while(--_0x146ae2){_0x11099f['push'](_0x11099f['shift']());}};_0x20d9da(++_0x1b7880);}(_0x3f94,0xf1));var _0x43f9=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x3f94[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0x43f9('0x0'));var rimraf=require(_0x43f9('0x1'));var zipdir=require(_0x43f9('0x2'));var jsonpatch=require(_0x43f9('0x3'));var rp=require(_0x43f9('0x4'));var moment=require(_0x43f9('0x5'));var BPromise=require(_0x43f9('0x6'));var Mustache=require(_0x43f9('0x7'));var util=require(_0x43f9('0x8'));var path=require(_0x43f9('0x9'));var sox=require(_0x43f9('0xa'));var csv=require(_0x43f9('0xb'));var ejs=require(_0x43f9('0xc'));var fs=require('fs');var fs_extra=require(_0x43f9('0xd'));var _=require(_0x43f9('0xe'));var squel=require(_0x43f9('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x43f9('0xb'));var querystring=require(_0x43f9('0x10'));var Papa=require(_0x43f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43f9('0x12'));var as=require(_0x43f9('0x13'));var hardwareService=require(_0x43f9('0x14'));var logger=require('../../config/logger')(_0x43f9('0x15'));var utils=require(_0x43f9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x43f9('0x17'));var db=require(_0x43f9('0x18'))['db'];function respondWithStatusCode(_0x27167f,_0x14263e){_0x14263e=_0x14263e||0xcc;return function(_0x5b2cf4){if(_0x5b2cf4){return _0x27167f[_0x43f9('0x19')](_0x14263e);}return _0x27167f[_0x43f9('0x1a')](_0x14263e)['end']();};}function respondWithResult(_0x31e525,_0x2c1341){_0x2c1341=_0x2c1341||0xc8;return function(_0x4535b1){if(_0x4535b1){return _0x31e525[_0x43f9('0x1a')](_0x2c1341)['json'](_0x4535b1);}};}function respondWithFilteredResult(_0x381d2d,_0x1eae00){return function(_0x91fa1e){if(_0x91fa1e){var _0x199fa8=typeof _0x1eae00['offset']===_0x43f9('0x1b')&&typeof _0x1eae00['limit']===_0x43f9('0x1b');var _0x57a398=_0x91fa1e[_0x43f9('0x1c')];var _0x1e58a=_0x199fa8?0x0:_0x1eae00['offset'];var _0x63dd0=_0x199fa8?_0x91fa1e[_0x43f9('0x1c')]:_0x1eae00[_0x43f9('0x1d')]+_0x1eae00['limit'];var _0x4d5f0e;if(_0x63dd0>=_0x57a398){_0x63dd0=_0x57a398;_0x4d5f0e=0xc8;}else{_0x4d5f0e=0xce;}_0x381d2d[_0x43f9('0x1a')](_0x4d5f0e);return _0x381d2d[_0x43f9('0x1e')]('Content-Range',_0x1e58a+'-'+_0x63dd0+'/'+_0x57a398)[_0x43f9('0x1f')](_0x91fa1e);}return null;};}function patchUpdates(_0x1f4808){return function(_0x5ccfc8){try{jsonpatch['apply'](_0x5ccfc8,_0x1f4808,!![]);}catch(_0x248893){return BPromise[_0x43f9('0x20')](_0x248893);}return _0x5ccfc8[_0x43f9('0x21')]();};}function saveUpdates(_0x5a37a6,_0x42fbdf){return function(_0x4ce653){if(_0x4ce653){return _0x4ce653[_0x43f9('0x22')](_0x5a37a6)['then'](function(_0x54c6d4){return _0x54c6d4;});}return null;};}function removeEntity(_0x145f31,_0x357fb0){return function(_0x4a9847){if(_0x4a9847){return _0x4a9847[_0x43f9('0x23')]()[_0x43f9('0x24')](function(){_0x145f31[_0x43f9('0x1a')](0xcc)[_0x43f9('0x25')]();});}};}function handleEntityNotFound(_0x285a13,_0xcd4e0b){return function(_0x7ca993){if(!_0x7ca993){_0x285a13[_0x43f9('0x19')](0x194);}return _0x7ca993;};}function handleError(_0x3a5b72,_0x5a2ecf){_0x5a2ecf=_0x5a2ecf||0x1f4;return function(_0x4e1ddf){logger[_0x43f9('0x26')](_0x4e1ddf['stack']);if(_0x4e1ddf[_0x43f9('0x27')]){delete _0x4e1ddf[_0x43f9('0x27')];}_0x3a5b72[_0x43f9('0x1a')](_0x5a2ecf)[_0x43f9('0x28')](_0x4e1ddf);};}exports[_0x43f9('0x29')]=function(_0xc11aea,_0x4ef2a9){var _0x43cf23={},_0x58813a={},_0x1d0796={'count':0x0,'rows':[]};var _0x397531=_[_0x43f9('0x2a')](db[_0x43f9('0x2b')][_0x43f9('0x2c')],function(_0x18e5b8){return{'name':_0x18e5b8[_0x43f9('0x2d')],'type':_0x18e5b8[_0x43f9('0x2e')][_0x43f9('0x2f')]};});_0x58813a[_0x43f9('0x30')]=_['map'](_0x397531,_0x43f9('0x27'));_0x58813a[_0x43f9('0x31')]=_[_0x43f9('0x32')](_0xc11aea[_0x43f9('0x31')]);_0x58813a[_0x43f9('0x33')]=_[_0x43f9('0x34')](_0x58813a[_0x43f9('0x30')],_0x58813a[_0x43f9('0x31')]);_0x43cf23[_0x43f9('0x35')]=_[_0x43f9('0x34')](_0x58813a[_0x43f9('0x30')],qs[_0x43f9('0x36')](_0xc11aea[_0x43f9('0x31')]['fields']));_0x43cf23[_0x43f9('0x35')]=_0x43cf23[_0x43f9('0x35')][_0x43f9('0x37')]?_0x43cf23[_0x43f9('0x35')]:_0x58813a[_0x43f9('0x30')];if(!_0xc11aea['query'][_0x43f9('0x38')](_0x43f9('0x39'))){_0x43cf23[_0x43f9('0x3a')]=qs[_0x43f9('0x3a')](_0xc11aea[_0x43f9('0x31')]['limit']);_0x43cf23[_0x43f9('0x1d')]=qs[_0x43f9('0x1d')](_0xc11aea[_0x43f9('0x31')]['offset']);}_0x43cf23[_0x43f9('0x3b')]=qs['sort'](_0xc11aea['query'][_0x43f9('0x3c')]);_0x43cf23[_0x43f9('0x3d')]=qs['filters'](_['pick'](_0xc11aea[_0x43f9('0x31')],_0x58813a['filters']),_0x397531);if(_0xc11aea[_0x43f9('0x31')][_0x43f9('0x3e')]){_0x43cf23[_0x43f9('0x3d')]=_[_0x43f9('0x3f')](_0x43cf23['where'],{'$or':_[_0x43f9('0x2a')](_0x397531,function(_0x368855){if(_0x368855[_0x43f9('0x2e')]!==_0x43f9('0x40')){var _0x580145={};_0x580145[_0x368855[_0x43f9('0x27')]]={'$like':'%'+_0xc11aea['query']['filter']+'%'};return _0x580145;}})});}_0x43cf23=_[_0x43f9('0x3f')]({},_0x43cf23,_0xc11aea[_0x43f9('0x41')]);var _0x2a57bf={'where':_0x43cf23['where']};return db['ChatTransferReport']['count'](_0x2a57bf)[_0x43f9('0x24')](function(_0x88b822){_0x1d0796[_0x43f9('0x1c')]=_0x88b822;if(_0xc11aea['query'][_0x43f9('0x42')]){_0x43cf23[_0x43f9('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x43f9('0x44')](_0x43cf23);})['then'](function(_0x9f5807){_0x1d0796['rows']=_0x9f5807;return _0x1d0796;})[_0x43f9('0x24')](respondWithFilteredResult(_0x4ef2a9,_0x43cf23))[_0x43f9('0x45')](handleError(_0x4ef2a9,null));};exports[_0x43f9('0x46')]=function(_0x53bc6b,_0x2cc64a){var _0x4a2dd3={'raw':!![],'where':{'id':_0x53bc6b[_0x43f9('0x47')]['id']}},_0x182e89={};_0x182e89[_0x43f9('0x30')]=_[_0x43f9('0x32')](db['ChatTransferReport'][_0x43f9('0x2c')]);_0x182e89[_0x43f9('0x31')]=_[_0x43f9('0x32')](_0x53bc6b[_0x43f9('0x31')]);_0x182e89[_0x43f9('0x33')]=_[_0x43f9('0x34')](_0x182e89[_0x43f9('0x30')],_0x182e89[_0x43f9('0x31')]);_0x4a2dd3[_0x43f9('0x35')]=_[_0x43f9('0x34')](_0x182e89[_0x43f9('0x30')],qs['fields'](_0x53bc6b[_0x43f9('0x31')][_0x43f9('0x36')]));_0x4a2dd3[_0x43f9('0x35')]=_0x4a2dd3['attributes'][_0x43f9('0x37')]?_0x4a2dd3[_0x43f9('0x35')]:_0x182e89[_0x43f9('0x30')];if(_0x53bc6b[_0x43f9('0x31')][_0x43f9('0x42')]){_0x4a2dd3[_0x43f9('0x43')]=[{'all':!![]}];}_0x4a2dd3=_[_0x43f9('0x3f')]({},_0x4a2dd3,_0x53bc6b[_0x43f9('0x41')]);return db[_0x43f9('0x2b')][_0x43f9('0x48')](_0x4a2dd3)['then'](handleEntityNotFound(_0x2cc64a,null))['then'](respondWithResult(_0x2cc64a,null))['catch'](handleError(_0x2cc64a,null));};exports[_0x43f9('0x49')]=function(_0x3031d1,_0x1718a1){return db[_0x43f9('0x2b')]['create'](_0x3031d1['body'],{})[_0x43f9('0x24')](respondWithResult(_0x1718a1,0xc9))['catch'](handleError(_0x1718a1,null));};exports[_0x43f9('0x22')]=function(_0x161381,_0x23b6df){if(_0x161381[_0x43f9('0x4a')]['id']){delete _0x161381[_0x43f9('0x4a')]['id'];}return db[_0x43f9('0x2b')][_0x43f9('0x48')]({'where':{'id':_0x161381[_0x43f9('0x47')]['id']}})[_0x43f9('0x24')](handleEntityNotFound(_0x23b6df,null))[_0x43f9('0x24')](saveUpdates(_0x161381['body'],null))['then'](respondWithResult(_0x23b6df,null))['catch'](handleError(_0x23b6df,null));};exports['destroy']=function(_0x380080,_0x4c0730){return db[_0x43f9('0x2b')]['find']({'where':{'id':_0x380080[_0x43f9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c0730,null))[_0x43f9('0x24')](removeEntity(_0x4c0730,null))[_0x43f9('0x45')](handleError(_0x4c0730,null));};exports[_0x43f9('0x4b')]=function(_0x17eeb8,_0x25ee53){return db[_0x43f9('0x2b')][_0x43f9('0x4b')]()[_0x43f9('0x24')](respondWithResult(_0x25ee53,null))[_0x43f9('0x45')](handleError(_0x25ee53,null));}; \ No newline at end of file +var _0x096d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','ChatTransferReport','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','describe','eml-format','rimraf','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x096d,0x119));var _0xd096=function(_0x13ce0f,_0x354d4c){_0x13ce0f=_0x13ce0f-0x0;var _0x1beae8=_0x096d[_0x13ce0f];return _0x1beae8;};'use strict';var emlformat=require(_0xd096('0x0'));var rimraf=require(_0xd096('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd096('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd096('0x3'));var util=require(_0xd096('0x4'));var path=require('path');var sox=require(_0xd096('0x5'));var csv=require(_0xd096('0x6'));var ejs=require(_0xd096('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd096('0x8'));var squel=require('squel');var crypto=require(_0xd096('0x9'));var jsforce=require(_0xd096('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd096('0xb'));var Papa=require(_0xd096('0xc'));var Redis=require(_0xd096('0xd'));var authService=require(_0xd096('0xe'));var qs=require(_0xd096('0xf'));var as=require(_0xd096('0x10'));var hardwareService=require(_0xd096('0x11'));var logger=require(_0xd096('0x12'))('api');var utils=require(_0xd096('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd096('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7b621,_0x37a7da){_0x37a7da=_0x37a7da||0xcc;return function(_0x4a2be5){if(_0x4a2be5){return _0x7b621[_0xd096('0x15')](_0x37a7da);}return _0x7b621['status'](_0x37a7da)[_0xd096('0x16')]();};}function respondWithResult(_0x4e124a,_0x22d7a0){_0x22d7a0=_0x22d7a0||0xc8;return function(_0x541a6e){if(_0x541a6e){return _0x4e124a['status'](_0x22d7a0)[_0xd096('0x17')](_0x541a6e);}};}function respondWithFilteredResult(_0x602d0b,_0x5f376c){return function(_0x3ba7f7){if(_0x3ba7f7){var _0x386386=typeof _0x5f376c['offset']===_0xd096('0x18')&&typeof _0x5f376c['limit']==='undefined';var _0x4305b2=_0x3ba7f7[_0xd096('0x19')];var _0x3a1aff=_0x386386?0x0:_0x5f376c[_0xd096('0x1a')];var _0x5d926a=_0x386386?_0x3ba7f7[_0xd096('0x19')]:_0x5f376c[_0xd096('0x1a')]+_0x5f376c[_0xd096('0x1b')];var _0x599824;if(_0x5d926a>=_0x4305b2){_0x5d926a=_0x4305b2;_0x599824=0xc8;}else{_0x599824=0xce;}_0x602d0b[_0xd096('0x1c')](_0x599824);return _0x602d0b[_0xd096('0x1d')](_0xd096('0x1e'),_0x3a1aff+'-'+_0x5d926a+'/'+_0x4305b2)[_0xd096('0x17')](_0x3ba7f7);}return null;};}function patchUpdates(_0x1ec2cf){return function(_0x1acd2e){try{jsonpatch[_0xd096('0x1f')](_0x1acd2e,_0x1ec2cf,!![]);}catch(_0x1a672d){return BPromise[_0xd096('0x20')](_0x1a672d);}return _0x1acd2e[_0xd096('0x21')]();};}function saveUpdates(_0x32890,_0x574fca){return function(_0x154480){if(_0x154480){return _0x154480[_0xd096('0x22')](_0x32890)['then'](function(_0x1c0165){return _0x1c0165;});}return null;};}function removeEntity(_0x3a6739,_0x1b114b){return function(_0x13b0c4){if(_0x13b0c4){return _0x13b0c4[_0xd096('0x23')]()[_0xd096('0x24')](function(){_0x3a6739['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36325b,_0x2727d7){return function(_0x12a89f){if(!_0x12a89f){_0x36325b[_0xd096('0x15')](0x194);}return _0x12a89f;};}function handleError(_0x3dc206,_0x5b21c1){_0x5b21c1=_0x5b21c1||0x1f4;return function(_0x3854fe){logger[_0xd096('0x25')](_0x3854fe[_0xd096('0x26')]);if(_0x3854fe[_0xd096('0x27')]){delete _0x3854fe[_0xd096('0x27')];}_0x3dc206[_0xd096('0x1c')](_0x5b21c1)['send'](_0x3854fe);};}exports[_0xd096('0x28')]=function(_0x581de2,_0xb08a7d){var _0x1cdafb={},_0x2dd412={},_0x3d19ca={'count':0x0,'rows':[]};var _0x24f1af=_['map'](db[_0xd096('0x29')][_0xd096('0x2a')],function(_0x4b8204){return{'name':_0x4b8204['fieldName'],'type':_0x4b8204[_0xd096('0x2b')][_0xd096('0x2c')]};});_0x2dd412['model']=_['map'](_0x24f1af,_0xd096('0x27'));_0x2dd412['query']=_['keys'](_0x581de2[_0xd096('0x2d')]);_0x2dd412[_0xd096('0x2e')]=_[_0xd096('0x2f')](_0x2dd412[_0xd096('0x30')],_0x2dd412['query']);_0x1cdafb['attributes']=_[_0xd096('0x2f')](_0x2dd412['model'],qs[_0xd096('0x31')](_0x581de2[_0xd096('0x2d')][_0xd096('0x31')]));_0x1cdafb[_0xd096('0x32')]=_0x1cdafb[_0xd096('0x32')]['length']?_0x1cdafb[_0xd096('0x32')]:_0x2dd412[_0xd096('0x30')];if(!_0x581de2[_0xd096('0x2d')][_0xd096('0x33')]('nolimit')){_0x1cdafb[_0xd096('0x1b')]=qs[_0xd096('0x1b')](_0x581de2[_0xd096('0x2d')][_0xd096('0x1b')]);_0x1cdafb['offset']=qs['offset'](_0x581de2[_0xd096('0x2d')]['offset']);}_0x1cdafb['order']=qs[_0xd096('0x34')](_0x581de2[_0xd096('0x2d')][_0xd096('0x34')]);_0x1cdafb[_0xd096('0x35')]=qs['filters'](_[_0xd096('0x36')](_0x581de2[_0xd096('0x2d')],_0x2dd412[_0xd096('0x2e')]),_0x24f1af);if(_0x581de2[_0xd096('0x2d')][_0xd096('0x37')]){_0x1cdafb[_0xd096('0x35')]=_[_0xd096('0x38')](_0x1cdafb[_0xd096('0x35')],{'$or':_[_0xd096('0x39')](_0x24f1af,function(_0x2a3d7f){if(_0x2a3d7f[_0xd096('0x2b')]!==_0xd096('0x3a')){var _0x459f76={};_0x459f76[_0x2a3d7f[_0xd096('0x27')]]={'$like':'%'+_0x581de2[_0xd096('0x2d')]['filter']+'%'};return _0x459f76;}})});}_0x1cdafb=_[_0xd096('0x38')]({},_0x1cdafb,_0x581de2['options']);var _0x366db4={'where':_0x1cdafb[_0xd096('0x35')]};return db[_0xd096('0x29')][_0xd096('0x19')](_0x366db4)[_0xd096('0x24')](function(_0x57a48c){_0x3d19ca[_0xd096('0x19')]=_0x57a48c;if(_0x581de2['query'][_0xd096('0x3b')]){_0x1cdafb[_0xd096('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xd096('0x3d')](_0x1cdafb);})[_0xd096('0x24')](function(_0x91a6c4){_0x3d19ca[_0xd096('0x3e')]=_0x91a6c4;return _0x3d19ca;})[_0xd096('0x24')](respondWithFilteredResult(_0xb08a7d,_0x1cdafb))[_0xd096('0x3f')](handleError(_0xb08a7d,null));};exports[_0xd096('0x40')]=function(_0x539626,_0x196845){var _0x3b7de2={'raw':!![],'where':{'id':_0x539626[_0xd096('0x41')]['id']}},_0x421d11={};_0x421d11[_0xd096('0x30')]=_[_0xd096('0x42')](db[_0xd096('0x29')][_0xd096('0x2a')]);_0x421d11['query']=_[_0xd096('0x42')](_0x539626[_0xd096('0x2d')]);_0x421d11[_0xd096('0x2e')]=_[_0xd096('0x2f')](_0x421d11['model'],_0x421d11['query']);_0x3b7de2[_0xd096('0x32')]=_['intersection'](_0x421d11['model'],qs[_0xd096('0x31')](_0x539626[_0xd096('0x2d')]['fields']));_0x3b7de2[_0xd096('0x32')]=_0x3b7de2[_0xd096('0x32')][_0xd096('0x43')]?_0x3b7de2['attributes']:_0x421d11[_0xd096('0x30')];if(_0x539626[_0xd096('0x2d')][_0xd096('0x3b')]){_0x3b7de2['include']=[{'all':!![]}];}_0x3b7de2=_[_0xd096('0x38')]({},_0x3b7de2,_0x539626[_0xd096('0x44')]);return db[_0xd096('0x29')][_0xd096('0x45')](_0x3b7de2)[_0xd096('0x24')](handleEntityNotFound(_0x196845,null))[_0xd096('0x24')](respondWithResult(_0x196845,null))[_0xd096('0x3f')](handleError(_0x196845,null));};exports[_0xd096('0x46')]=function(_0x368bfa,_0x316cb8){return db[_0xd096('0x29')][_0xd096('0x46')](_0x368bfa[_0xd096('0x47')],{})[_0xd096('0x24')](respondWithResult(_0x316cb8,0xc9))[_0xd096('0x3f')](handleError(_0x316cb8,null));};exports[_0xd096('0x22')]=function(_0x358849,_0x59a5ec){if(_0x358849[_0xd096('0x47')]['id']){delete _0x358849[_0xd096('0x47')]['id'];}return db['ChatTransferReport'][_0xd096('0x45')]({'where':{'id':_0x358849['params']['id']}})[_0xd096('0x24')](handleEntityNotFound(_0x59a5ec,null))['then'](saveUpdates(_0x358849['body'],null))[_0xd096('0x24')](respondWithResult(_0x59a5ec,null))['catch'](handleError(_0x59a5ec,null));};exports[_0xd096('0x23')]=function(_0x98b72c,_0x5bf97f){return db[_0xd096('0x29')]['find']({'where':{'id':_0x98b72c['params']['id']}})[_0xd096('0x24')](handleEntityNotFound(_0x5bf97f,null))[_0xd096('0x24')](removeEntity(_0x5bf97f,null))[_0xd096('0x3f')](handleError(_0x5bf97f,null));};exports[_0xd096('0x48')]=function(_0x5ccd59,_0x7bc285){return db[_0xd096('0x29')][_0xd096('0x48')]()[_0xd096('0x24')](respondWithResult(_0x7bc285,null))[_0xd096('0x3f')](handleError(_0x7bc285,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 8e53b0e..a3ed815 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 _0x526b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x526b,0x6c));var _0xb526=function(_0x1d2d07,_0x2eb1d2){_0x1d2d07=_0x1d2d07-0x0;var _0x43eb31=_0x526b[_0x1d2d07];return _0x43eb31;};'use strict';var _=require('lodash');var util=require(_0xb526('0x0'));var logger=require(_0xb526('0x1'))(_0xb526('0x2'));var moment=require(_0xb526('0x3'));var BPromise=require(_0xb526('0x4'));var rp=require(_0xb526('0x5'));var fs=require('fs');var path=require(_0xb526('0x6'));var rimraf=require(_0xb526('0x7'));var config=require('../../config/environment');var attributes=require(_0xb526('0x8'));module[_0xb526('0x9')]=function(_0x325cdd,_0x3ae05b){return _0x325cdd['define'](_0xb526('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb526('0xb'),'fields':[_0xb526('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffe3=['uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x12f4bf,_0x3e09a0){var _0x315542=function(_0x27c97d){while(--_0x27c97d){_0x12f4bf['push'](_0x12f4bf['shift']());}};_0x315542(++_0x3e09a0);}(_0xffe3,0x146));var _0x3ffe=function(_0x31a901,_0x44e9bd){_0x31a901=_0x31a901-0x0;var _0x1f3b59=_0xffe3[_0x31a901];return _0x1f3b59;};'use strict';var _=require(_0x3ffe('0x0'));var util=require(_0x3ffe('0x1'));var logger=require(_0x3ffe('0x2'))(_0x3ffe('0x3'));var moment=require('moment');var BPromise=require(_0x3ffe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ffe('0x5'));var rimraf=require(_0x3ffe('0x6'));var config=require(_0x3ffe('0x7'));var attributes=require(_0x3ffe('0x8'));module['exports']=function(_0x314ad3,_0x2ec4d1){return _0x314ad3[_0x3ffe('0x9')](_0x3ffe('0xa'),attributes,{'tableName':_0x3ffe('0xb'),'paranoid':![],'indexes':[{'name':_0x3ffe('0xc'),'fields':[_0x3ffe('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 6737e7c..6437d2d 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 _0x155b=['rpc','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3eb22e,_0x26ce67){var _0x223c55=function(_0x20f59d){while(--_0x20f59d){_0x3eb22e['push'](_0x3eb22e['shift']());}};_0x223c55(++_0x26ce67);}(_0x155b,0x1dc));var _0xb155=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0x155b[_0x2299e8];return _0x433c0e;};'use strict';var _=require(_0xb155('0x0'));var util=require(_0xb155('0x1'));var moment=require(_0xb155('0x2'));var BPromise=require('bluebird');var rs=require(_0xb155('0x3'));var fs=require('fs');var Redis=require(_0xb155('0x4'));var db=require(_0xb155('0x5'))['db'];var utils=require(_0xb155('0x6'));var logger=require(_0xb155('0x7'))(_0xb155('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb155('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x454c30,_0x39859b,_0x16d609){return new BPromise(function(_0xac3d99,_0xf601de){return client[_0xb155('0xa')](_0x454c30,_0x16d609)[_0xb155('0xb')](function(_0x5698a6){logger[_0xb155('0xc')](_0xb155('0xd'),_0x39859b,_0xb155('0xe'));logger[_0xb155('0xf')](_0xb155('0x10'),_0x39859b,_0xb155('0xe'),JSON[_0xb155('0x11')](_0x5698a6));if(_0x5698a6['error']){if(_0x5698a6[_0xb155('0x12')]['code']===0x1f4){logger['error'](_0xb155('0xd'),_0x39859b,_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);return _0xf601de(_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);}logger['error'](_0xb155('0xd'),_0x39859b,_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);return _0xac3d99(_0x5698a6[_0xb155('0x12')]['message']);}else{logger[_0xb155('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x39859b,_0xb155('0xe'));_0xac3d99(_0x5698a6[_0xb155('0x14')][_0xb155('0x13')]);}})[_0xb155('0x15')](function(_0x3ffe19){logger[_0xb155('0x12')](_0xb155('0xd'),_0x39859b,_0x3ffe19);_0xf601de(_0x3ffe19);});});} \ No newline at end of file +var _0x3646=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dacf8,_0x4d6188){var _0x9cb0fa=function(_0x1098bd){while(--_0x1098bd){_0x3dacf8['push'](_0x3dacf8['shift']());}};_0x9cb0fa(++_0x4d6188);}(_0x3646,0xa1));var _0x6364=function(_0x2dc1e8,_0x21ab55){_0x2dc1e8=_0x2dc1e8-0x0;var _0x48e9c2=_0x3646[_0x2dc1e8];return _0x48e9c2;};'use strict';var _=require(_0x6364('0x0'));var util=require('util');var moment=require(_0x6364('0x1'));var BPromise=require(_0x6364('0x2'));var rs=require(_0x6364('0x3'));var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))(_0x6364('0x8'));var config=require(_0x6364('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6364('0xa')][_0x6364('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b36b9,_0x88aea9,_0x25cb8a){return new BPromise(function(_0x38155e,_0x40fc04){return client[_0x6364('0xc')](_0x4b36b9,_0x25cb8a)['then'](function(_0x75660e){logger[_0x6364('0xd')](_0x6364('0xe'),_0x88aea9,_0x6364('0xf'));logger[_0x6364('0x10')](_0x6364('0x11'),_0x88aea9,_0x6364('0xf'),JSON['stringify'](_0x75660e));if(_0x75660e['error']){if(_0x75660e[_0x6364('0x12')][_0x6364('0x13')]===0x1f4){logger[_0x6364('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x88aea9,_0x75660e[_0x6364('0x12')][_0x6364('0x14')]);return _0x40fc04(_0x75660e[_0x6364('0x12')]['message']);}logger[_0x6364('0x12')](_0x6364('0xe'),_0x88aea9,_0x75660e[_0x6364('0x12')]['message']);return _0x38155e(_0x75660e[_0x6364('0x12')][_0x6364('0x14')]);}else{logger[_0x6364('0xd')](_0x6364('0xe'),_0x88aea9,'request\x20sent');_0x38155e(_0x75660e[_0x6364('0x15')]['message']);}})[_0x6364('0x16')](function(_0x440c14){logger[_0x6364('0x12')](_0x6364('0xe'),_0x88aea9,_0x440c14);_0x40fc04(_0x440c14);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 1434726..5101aa0 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 _0x9a5c=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','util','express','Router'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9a5c,0xda));var _0xc9a5=function(_0x380b08,_0x1df63a){_0x380b08=_0x380b08-0x0;var _0x22f65d=_0x9a5c[_0x380b08];return _0x22f65d;};'use strict';var multer=require('multer');var util=require(_0xc9a5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9a5('0x1'));var router=express[_0xc9a5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc9a5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc9a5('0x4'));var controller=require(_0xc9a5('0x5'));router[_0xc9a5('0x6')]('/',auth['isAuthenticated'](),controller[_0xc9a5('0x7')]);router[_0xc9a5('0x6')](_0xc9a5('0x8'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xa')]);router[_0xc9a5('0x6')](_0xc9a5('0xb'),auth['isAuthenticated'](),controller[_0xc9a5('0xc')]);router['post']('/',auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xd')]);router[_0xc9a5('0xe')](_0xc9a5('0xb'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xf')]);router['delete'](_0xc9a5('0xb'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4b8e=['destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x4e71ac,_0x42aced){var _0x11d76c=function(_0xcf5279){while(--_0xcf5279){_0x4e71ac['push'](_0x4e71ac['shift']());}};_0x11d76c(++_0x42aced);}(_0x4b8e,0xfd));var _0xe4b8=function(_0x1501e2,_0x271210){_0x1501e2=_0x1501e2-0x0;var _0xfce8c5=_0x4b8e[_0x1501e2];return _0xfce8c5;};'use strict';var multer=require(_0xe4b8('0x0'));var util=require(_0xe4b8('0x1'));var path=require(_0xe4b8('0x2'));var timeout=require(_0xe4b8('0x3'));var express=require(_0xe4b8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe4b8('0x5'));var config=require('../../config/environment');var controller=require(_0xe4b8('0x6'));router[_0xe4b8('0x7')]('/',auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe4b8('0xa')]);router[_0xe4b8('0x7')](_0xe4b8('0xb'),auth['isAuthenticated'](),controller[_0xe4b8('0xc')]);router[_0xe4b8('0xd')]('/',auth['isAuthenticated'](),controller[_0xe4b8('0xe')]);router[_0xe4b8('0xf')](_0xe4b8('0xb'),auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x10')]);router['delete']('/:id',auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c9edfdc..5c42df4 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 _0x0aab=['Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0x0aab,0x1a3));var _0xb0aa=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x0aab[_0x4fbb15];return _0x436338;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb0aa('0x0')]={'name':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb0aa('0x2')},'description':{'type':Sequelize[_0xb0aa('0x1')]},'mapKey':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x3')},'mapKeyOffline':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb0aa('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb0aa('0x8')](_0xb0aa('0x9'),'squared'),'defaultValue':_0xb0aa('0x9')},'header_online':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xa')},'start_chat_button':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xb')},'offline_chat_button':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xc')},'header_offline':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb0aa('0xf')]},'closingQuestion':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x12')},'noteTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x13')},'placeholderMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x15')},'closingMessageButton':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x16')},'conditionAgreement':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x17')},'ratingType':{'type':Sequelize[_0xb0aa('0x8')](_0xb0aa('0x18'),_0xb0aa('0x19')),'defaultValue':_0xb0aa('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb0aa('0x1a'),'variable':null,'config':{'placeholder':_0xb0aa('0x1b'),'type':'text','required':!![]},'props':{'title':_0xb0aa('0x1b'),'helpText':''}},{'type':_0xb0aa('0x1a'),'props':{'title':_0xb0aa('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0aa('0x3'),'type':_0xb0aa('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb0aa('0x1c')](_0xb0aa('0x1d'))?JSON['parse'](this['getDataValue'](_0xb0aa('0x1d'))):{};},'set':function(_0x548bbc){return this[_0xb0aa('0x1e')](_0xb0aa('0x1d'),JSON[_0xb0aa('0x1f')](_0x548bbc));}},'offlineForm':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return JSON[_0xb0aa('0x1f')]({'items':[{'type':_0xb0aa('0x1a'),'props':{'title':_0xb0aa('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0aa('0x3'),'type':_0xb0aa('0x3')},'variable':null},{'type':_0xb0aa('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xb0aa('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb0aa('0x1c')](_0xb0aa('0x22'))?JSON[_0xb0aa('0x23')](this['getDataValue']('offlineForm')):{};},'set':function(_0x24f178){return this[_0xb0aa('0x1e')](_0xb0aa('0x22'),JSON[_0xb0aa('0x1f')](_0x24f178));}},'token':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':function(){return rs[_0xb0aa('0x24')]();}},'autoclose':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb0aa('0x1')]},'forwardOffline':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb0aa('0x1')]},'waitingTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x25')},'waitingMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x16')},'sendUnmanaged':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb0aa('0x1')]},'notificationTemplate':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb0aa('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x29')},'defaultTitle':{'type':Sequelize[_0xb0aa('0x1')]},'customerAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x2b')},'systemAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb0aa('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![],'comment':_0xb0aa('0x2d'),'set':function(_0x178d85){if(!_0x178d85)this[_0xb0aa('0x1e')](_0xb0aa('0x2e'),null);this[_0xb0aa('0x1e')](_0xb0aa('0x2f'),_0x178d85);}},'vidaooEscalation':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb0aa('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf790=['stringify','input','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star'];(function(_0xb4df0a,_0x23498c){var _0x3e2db7=function(_0x56377){while(--_0x56377){_0xb4df0a['push'](_0xb4df0a['shift']());}};_0x3e2db7(++_0x23498c);}(_0xf790,0x82));var _0x0f79=function(_0x5485e1,_0x35fecb){_0x5485e1=_0x5485e1-0x0;var _0x42c8bf=_0xf790[_0x5485e1];return _0x42c8bf;};'use strict';var Sequelize=require(_0x0f79('0x0'));var rs=require(_0x0f79('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'unique':_0x0f79('0x3')},'description':{'type':Sequelize[_0x0f79('0x2')]},'mapKey':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x4')},'key':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x5')},'customerAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':_0x0f79('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0f79('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':_0x0f79('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0f79('0x2')]},'animation':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0f79('0x9')](_0x0f79('0xa'),_0x0f79('0xb')),'defaultValue':_0x0f79('0xa')},'header_online':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xc')},'start_chat_button':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xd')},'offline_chat_button':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xe')},'header_offline':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xf')},'download_transcript':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0f79('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x13')},'noteTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x14')},'closingMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x15')},'closingMessageButton':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xe')},'skipMessageButton':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x16')},'conditionAgreement':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x17')},'ratingType':{'type':Sequelize[_0x0f79('0x9')]('star',_0x0f79('0x18')),'defaultValue':_0x0f79('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0f79('0x12')],'defaultValue':function(){return JSON[_0x0f79('0x1a')]({'items':[{'type':_0x0f79('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x0f79('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x0f79('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0f79('0x4'),'type':_0x0f79('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0f79('0x1d')](_0x0f79('0x1e'))?JSON['parse'](this[_0x0f79('0x1d')]('onlineForm')):{};},'set':function(_0x2c9e17){return this[_0x0f79('0x1f')](_0x0f79('0x1e'),JSON[_0x0f79('0x1a')](_0x2c9e17));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0f79('0x1a')]({'items':[{'type':_0x0f79('0x1b'),'props':{'title':_0x0f79('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0f79('0x4'),'type':_0x0f79('0x4')},'variable':null},{'type':_0x0f79('0x20'),'config':{'placeholder':_0x0f79('0x21')},'props':{'title':_0x0f79('0x21'),'helpText':_0x0f79('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x0f79('0x1d')](_0x0f79('0x23'))?JSON['parse'](this['getDataValue'](_0x0f79('0x23'))):{};},'set':function(_0x42f5c0){return this[_0x0f79('0x1f')](_0x0f79('0x23'),JSON['stringify'](_0x42f5c0));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0f79('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0f79('0x2')]},'forwardOffline':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0f79('0x2')]},'waitingTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x25')},'waitingMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x29')},'skipUnmanaged':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0f79('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2b')},'verticalAlignment':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2c')},'messagesAlignment':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2d')},'defaultTitle':{'type':Sequelize[_0x0f79('0x2')]},'customerAvatar':{'type':Sequelize[_0x0f79('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0f79('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f79('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2f')},'systemAvatar':{'type':Sequelize[_0x0f79('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f79('0x10')],'comment':_0x0f79('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0f79('0x31'),'set':function(_0x93a88c){if(!_0x93a88c)this[_0x0f79('0x1f')](_0x0f79('0x32'),null);this[_0x0f79('0x1f')]('mandatoryDisposition',_0x93a88c);}},'vidaooEscalation':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0f79('0x2')]},'vidaooTopic':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':function(){return _0x0f79('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0f79('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 942f2e5..88ec6cf 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 _0xce5c=['externalUrl','ContactId','interaction','spread','contact','messageId','created','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','attachments','sequelize','transaction','bulkCreate','Smtp','forwardOffline','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','files','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','getLicense','virtual','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','getFields','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','order','findAll','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','includes','mapKey','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','List','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction'];(function(_0x47aa0e,_0x19013c){var _0x20f39f=function(_0x58f261){while(--_0x58f261){_0x47aa0e['push'](_0x47aa0e['shift']());}};_0x20f39f(++_0x19013c);}(_0xce5c,0x79));var _0xcce5=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xce5c[_0xdf3db6];return _0x4b7a65;};'use strict';var BPromise=require(_0xcce5('0x0'));var Mustache=require('mustache');var util=require(_0xcce5('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcce5('0x2'));var _=require(_0xcce5('0x3'));var querystring=require(_0xcce5('0x4'));var Redis=require('ioredis');var qs=require(_0xcce5('0x5'));var logger=require(_0xcce5('0x6'))(_0xcce5('0x7'));var config=require(_0xcce5('0x8'));var db=require(_0xcce5('0x9'))['db'];config[_0xcce5('0xa')]=_[_0xcce5('0xb')](config[_0xcce5('0xa')],{'host':_0xcce5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcce5('0xa')]));require(_0xcce5('0xd'))[_0xcce5('0xe')](socket);var jayson=require(_0xcce5('0xf'));var client=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232c});var client9002=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232a});var client9003=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232b});var client9001=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x3c9da4,_0x595d39,_0x2e0107,_0x5970ab){return new BPromise(function(_0x4b0646,_0x44c437){var _0x2318b7=_0x5970ab||client;return _0x2318b7['request'](_0x3c9da4,_0x2e0107)[_0xcce5('0x12')](function(_0x29a501){logger[_0xcce5('0x13')](_0xcce5('0x14'),_0x595d39,'request\x20sent');logger[_0xcce5('0x15')](_0xcce5('0x16'),_0x595d39,_0xcce5('0x17'),JSON[_0xcce5('0x18')](_0x29a501));if(_0x29a501[_0xcce5('0x19')]){if(_0x29a501[_0xcce5('0x19')][_0xcce5('0x1a')]===0x1f4){logger[_0xcce5('0x19')](_0xcce5('0x14'),_0x595d39,_0x29a501[_0xcce5('0x19')]['message']);return _0x44c437(_0x29a501[_0xcce5('0x19')][_0xcce5('0x1b')]);}logger['error'](_0xcce5('0x14'),_0x595d39,_0x29a501[_0xcce5('0x19')][_0xcce5('0x1b')]);return _0x4b0646(_0x29a501[_0xcce5('0x19')]['message']);}else{logger[_0xcce5('0x13')](_0xcce5('0x14'),_0x595d39,'request\x20sent');_0x4b0646(_0x29a501[_0xcce5('0x1c')][_0xcce5('0x1b')]);}})[_0xcce5('0x1d')](function(_0x3be8d0){logger[_0xcce5('0x19')](_0xcce5('0x14'),_0x595d39,_0x3be8d0);_0x44c437(_0x3be8d0);});});}function respondWithStatusCode(_0x490fd2,_0x2b855b){_0x2b855b=_0x2b855b||0xcc;return function(_0x5b05ce){if(_0x5b05ce){return _0x490fd2['sendStatus'](_0x2b855b);}return _0x490fd2['status'](_0x2b855b)['end']();};}function respondWithResult(_0x124919,_0x179f04){_0x179f04=_0x179f04||0xc8;return function(_0x926f78){if(_0x926f78){return _0x124919[_0xcce5('0x1e')](_0x179f04)[_0xcce5('0x1f')](_0x926f78);}};}function respondWithFilteredResult(_0x389d10,_0x33ca89){return function(_0x5e801a){if(_0x5e801a){var _0x2b8ea9=typeof _0x33ca89[_0xcce5('0x20')]==='undefined'&&typeof _0x33ca89['limit']===_0xcce5('0x21');var _0x15c7d8=_0x5e801a[_0xcce5('0x22')];var _0x1ef891=_0x2b8ea9?0x0:_0x33ca89[_0xcce5('0x20')];var _0x2faaf6=_0x2b8ea9?_0x5e801a[_0xcce5('0x22')]:_0x33ca89[_0xcce5('0x20')]+_0x33ca89[_0xcce5('0x23')];var _0x24b318;if(_0x2faaf6>=_0x15c7d8){_0x2faaf6=_0x15c7d8;_0x24b318=0xc8;}else{_0x24b318=0xce;}_0x389d10[_0xcce5('0x1e')](_0x24b318);return _0x389d10[_0xcce5('0x24')](_0xcce5('0x25'),_0x1ef891+'-'+_0x2faaf6+'/'+_0x15c7d8)[_0xcce5('0x1f')](_0x5e801a);}return null;};}function saveUpdates(_0x19b4e4){return function(_0x4db26f){if(_0x4db26f){return _0x4db26f[_0xcce5('0x26')](_0x19b4e4)[_0xcce5('0x12')](function(_0x59710a){return _0x59710a;});}return null;};}function removeEntity(_0x40b50d){return function(_0x57a240){if(_0x57a240){return _0x57a240[_0xcce5('0x27')]()[_0xcce5('0x12')](function(){var _0x519224=_0x57a240[_0xcce5('0x28')]({'plain':!![]});var _0x14d3f5=_0xcce5('0x29');return db[_0xcce5('0x2a')]['destroy']({'where':{'type':_0x14d3f5,'resourceId':_0x519224['id']}})[_0xcce5('0x12')](function(){return _0x57a240;});})[_0xcce5('0x12')](function(){_0x40b50d[_0xcce5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208540){return function(_0x58f79e){if(!_0x58f79e){_0x208540[_0xcce5('0x2b')](0x194);}return _0x58f79e;};}function handleError(_0x268621,_0x4a2acc){_0x4a2acc=_0x4a2acc||0x1f4;return function(_0x28fc1d){logger[_0xcce5('0x19')](_0x28fc1d[_0xcce5('0x2c')]);if(_0x28fc1d[_0xcce5('0x2d')]){delete _0x28fc1d[_0xcce5('0x2d')];}_0x268621[_0xcce5('0x1e')](_0x4a2acc)[_0xcce5('0x2e')](_0x28fc1d);};}exports['index']=function(_0x496098,_0x2e3248){var _0x1ff671={'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]},_0x500e7e={},_0x34885d={'count':0x0,'rows':[]};var _0x3043f0=_['map'](db[_0xcce5('0x31')][_0xcce5('0x32')],function(_0x39f4cc){return{'name':_0x39f4cc[_0xcce5('0x33')],'type':_0x39f4cc['type'][_0xcce5('0x34')]};});_0x500e7e[_0xcce5('0x35')]=_['map'](_0x3043f0,_0xcce5('0x2d'));_0x500e7e[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x496098[_0xcce5('0x36')]);_0x500e7e[_0xcce5('0x38')]=_['intersection'](_0x500e7e[_0xcce5('0x35')],_0x500e7e['query']);_0x1ff671[_0xcce5('0x39')]=_['intersection'](_0x500e7e[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x496098[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x1ff671[_0xcce5('0x39')]=_0x1ff671['attributes'][_0xcce5('0x3b')]?_0x1ff671[_0xcce5('0x39')]:_0x500e7e['model'];if(!_0x496098[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x1ff671[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x496098[_0xcce5('0x36')][_0xcce5('0x23')]);_0x1ff671['offset']=qs['offset'](_0x496098[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x1ff671['order']=qs[_0xcce5('0x3e')](_0x496098[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x1ff671[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x496098['query'],_0x500e7e['filters']),_0x3043f0);if(_0x496098[_0xcce5('0x36')][_0xcce5('0x41')]){_0x1ff671['where']=_['merge'](_0x1ff671[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x3043f0,function(_0x4b2057){if(_0x4b2057[_0xcce5('0x43')]!==_0xcce5('0x44')){var _0x5b2234={};_0x5b2234[_0x4b2057[_0xcce5('0x2d')]]={'$like':'%'+_0x496098['query'][_0xcce5('0x41')]+'%'};return _0x5b2234;}})});}_0x1ff671=_[_0xcce5('0x45')]({},_0x1ff671,_0x496098[_0xcce5('0x46')]);var _0x354177={'where':_0x1ff671[_0xcce5('0x3f')]};return db['ChatWebsite'][_0xcce5('0x22')](_0x354177)[_0xcce5('0x12')](function(_0x3ac449){_0x34885d[_0xcce5('0x22')]=_0x3ac449;if(_0x496098[_0xcce5('0x36')][_0xcce5('0x47')]){_0x1ff671[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x31')]['findAll'](_0x1ff671);})[_0xcce5('0x12')](function(_0xd25a21){_0x34885d[_0xcce5('0x49')]=_0xd25a21;return _0x34885d;})[_0xcce5('0x12')](respondWithFilteredResult(_0x2e3248,_0x1ff671))[_0xcce5('0x1d')](handleError(_0x2e3248,null));};exports[_0xcce5('0x4a')]=function(_0x4be509,_0x2493e0){var _0x3602bd={'raw':![],'where':{'id':_0x4be509[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]},_0x36ffab={};_0x36ffab[_0xcce5('0x35')]=_['keys'](db[_0xcce5('0x31')][_0xcce5('0x32')]);_0x36ffab[_0xcce5('0x36')]=_['keys'](_0x4be509[_0xcce5('0x36')]);_0x36ffab[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x36ffab[_0xcce5('0x35')],_0x36ffab[_0xcce5('0x36')]);_0x3602bd['attributes']=_[_0xcce5('0x4c')](_0x36ffab[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x4be509['query'][_0xcce5('0x3a')]));_0x3602bd[_0xcce5('0x39')]=_0x3602bd[_0xcce5('0x39')]['length']?_0x3602bd[_0xcce5('0x39')]:_0x36ffab[_0xcce5('0x35')];if(_0x4be509['query'][_0xcce5('0x47')]){_0x3602bd[_0xcce5('0x48')]=[{'all':!![]}];}_0x3602bd=_[_0xcce5('0x45')]({},_0x3602bd,_0x4be509[_0xcce5('0x46')]);return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x3602bd)[_0xcce5('0x12')](handleEntityNotFound(_0x2493e0,null))[_0xcce5('0x12')](respondWithResult(_0x2493e0,null))[_0xcce5('0x1d')](handleError(_0x2493e0,null));};exports[_0xcce5('0x4e')]=function(_0x5e096,_0x5de0f5){return db[_0xcce5('0x31')][_0xcce5('0x4e')](_0x5e096[_0xcce5('0x4f')],{})[_0xcce5('0x12')](function(_0x495431){var _0x8cfe01=_0x5e096[_0xcce5('0x50')]['get']({'plain':!![]});if(!_0x8cfe01)throw new Error(_0xcce5('0x51'));if(_0x8cfe01['role']==='user'){var _0x443e74=_0x495431[_0xcce5('0x28')]({'plain':!![]});var _0x4b8915=_0xcce5('0x29');return db[_0xcce5('0x52')][_0xcce5('0x4d')]({'where':{'name':_0x4b8915,'userProfileId':_0x8cfe01[_0xcce5('0x53')]},'raw':!![]})[_0xcce5('0x12')](function(_0x26f423){if(_0x26f423&&_0x26f423['autoAssociation']===0x0){return db['UserProfileResource'][_0xcce5('0x4e')]({'name':_0x443e74[_0xcce5('0x2d')],'resourceId':_0x443e74['id'],'type':_0x26f423['name'],'sectionId':_0x26f423['id']},{})[_0xcce5('0x12')](function(){return _0x495431;});}else{return _0x495431;}})[_0xcce5('0x1d')](function(_0x4d76d6){logger[_0xcce5('0x19')](_0xcce5('0x54'),_0x4d76d6);throw _0x4d76d6;});}return _0x495431;})[_0xcce5('0x12')](respondWithResult(_0x5de0f5,0xc9))[_0xcce5('0x1d')](handleError(_0x5de0f5,null));};exports[_0xcce5('0x26')]=function(_0x38dd9b,_0x1d3124){if(_0x38dd9b[_0xcce5('0x4f')]['id']){delete _0x38dd9b[_0xcce5('0x4f')]['id'];}return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x38dd9b['params']['id']},'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]})[_0xcce5('0x12')](handleEntityNotFound(_0x1d3124,null))[_0xcce5('0x12')](saveUpdates(_0x38dd9b[_0xcce5('0x4f')],null))[_0xcce5('0x12')](respondWithResult(_0x1d3124,null))['catch'](handleError(_0x1d3124,null));};exports['destroy']=function(_0x47f32a,_0x172e2f){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x47f32a[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x172e2f,null))[_0xcce5('0x12')](removeEntity(_0x172e2f,null))[_0xcce5('0x1d')](handleError(_0x172e2f,null));};exports[_0xcce5('0x55')]=function(_0x776d9a,_0x1731d6){return db['ChatWebsite']['describe']()[_0xcce5('0x12')](respondWithResult(_0x1731d6,null))[_0xcce5('0x1d')](handleError(_0x1731d6,null));};exports[_0xcce5('0x56')]=function(_0x5b7e28,_0x4d84ec){if(_0x5b7e28[_0xcce5('0x4f')]['id']){delete _0x5b7e28[_0xcce5('0x4f')]['id'];}return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x5b7e28[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4d84ec,null))[_0xcce5('0x12')](function(_0xfa5f2){if(_0xfa5f2){_0x5b7e28[_0xcce5('0x4f')][_0xcce5('0x57')]=_0xfa5f2['id'];return db[_0xcce5('0x58')][_0xcce5('0x4e')](_0x5b7e28[_0xcce5('0x4f')]);}})[_0xcce5('0x12')](respondWithResult(_0x4d84ec,null))[_0xcce5('0x1d')](handleError(_0x4d84ec,null));};exports['getDispositions']=function(_0x4800b2,_0x445f5b){var _0x5b85af={'raw':![],'where':{}};var _0x4d774a={};var _0x470b99={'count':0x0,'rows':[]};return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x4800b2['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x445f5b,null))[_0xcce5('0x12')](function(_0x488aa0){if(_0x488aa0){_0x4d774a[_0xcce5('0x35')]=_['keys'](db['Disposition'][_0xcce5('0x32')]);_0x4d774a[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x4800b2[_0xcce5('0x36')]);_0x4d774a['filters']=_[_0xcce5('0x4c')](_0x4d774a[_0xcce5('0x35')],_0x4d774a['query']);_0x5b85af[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x4d774a[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x4800b2[_0xcce5('0x36')]['fields']));_0x5b85af[_0xcce5('0x39')]=_0x5b85af['attributes']['length']?_0x5b85af[_0xcce5('0x39')]:_0x4d774a['model'];if(!_0x4800b2[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0x5b85af[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x4800b2[_0xcce5('0x36')][_0xcce5('0x23')]);_0x5b85af['offset']=qs['offset'](_0x4800b2['query'][_0xcce5('0x20')]);}_0x5b85af[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x4800b2['query']['sort']);_0x5b85af['where']=qs[_0xcce5('0x38')](_['pick'](_0x4800b2['query'],_0x4d774a[_0xcce5('0x38')]));_0x5b85af['where'][_0xcce5('0x57')]=_0x488aa0['id'];if(_0x4800b2[_0xcce5('0x36')][_0xcce5('0x41')]){_0x5b85af[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x5b85af[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x5b85af[_0xcce5('0x39')],function(_0x37254b){var _0xd7e08d={};_0xd7e08d[_0x37254b]={'$like':'%'+_0x4800b2[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0xd7e08d;})});}_0x5b85af=_[_0xcce5('0x45')]({},_0x5b85af,_0x4800b2[_0xcce5('0x46')]);return db[_0xcce5('0x58')][_0xcce5('0x22')]({'where':_0x5b85af[_0xcce5('0x3f')]})['then'](function(_0x478d9f){_0x470b99['count']=_0x478d9f;if(_0x4800b2['query'][_0xcce5('0x47')]){_0x5b85af[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x58')][_0xcce5('0x5b')](_0x5b85af);})[_0xcce5('0x12')](function(_0x326932){_0x470b99['rows']=_0x326932;return _0x470b99;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x445f5b,_0x5b85af))[_0xcce5('0x1d')](handleError(_0x445f5b,null));};exports['removeDispositions']=function(_0x25c61f,_0x4fe9c7){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x25c61f[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4fe9c7,null))[_0xcce5('0x12')](function(_0x321c39){if(_0x321c39){return _0x321c39['removeDispositions'](_0x25c61f[_0xcce5('0x36')][_0xcce5('0x5c')]);}})[_0xcce5('0x12')](respondWithStatusCode(_0x4fe9c7,null))['catch'](handleError(_0x4fe9c7,null));};exports[_0xcce5('0x5d')]=function(_0x3f0fa5,_0x49d431){if(_0x3f0fa5[_0xcce5('0x4f')]['id']){delete _0x3f0fa5[_0xcce5('0x4f')]['id'];}return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x3f0fa5['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x49d431,null))[_0xcce5('0x12')](function(_0x1b5c99){if(_0x1b5c99){_0x3f0fa5[_0xcce5('0x4f')]['ChatWebsiteId']=_0x1b5c99['id'];return db[_0xcce5('0x5e')]['create'](_0x3f0fa5[_0xcce5('0x4f')]);}})['then'](respondWithResult(_0x49d431,null))['catch'](handleError(_0x49d431,null));};exports[_0xcce5('0x5f')]=function(_0x2e89ba,_0x4ada7a){var _0x29ee05={'raw':![],'where':{}};var _0x4d7e57={};var _0x7a98fd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x2e89ba[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4ada7a,null))[_0xcce5('0x12')](function(_0x3744f6){if(_0x3744f6){_0x4d7e57[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0x5e')][_0xcce5('0x32')]);_0x4d7e57['query']=_[_0xcce5('0x37')](_0x2e89ba['query']);_0x4d7e57[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x4d7e57[_0xcce5('0x35')],_0x4d7e57['query']);_0x29ee05[_0xcce5('0x39')]=_['intersection'](_0x4d7e57[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x2e89ba['query'][_0xcce5('0x3a')]));_0x29ee05[_0xcce5('0x39')]=_0x29ee05[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x29ee05[_0xcce5('0x39')]:_0x4d7e57[_0xcce5('0x35')];if(!_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x3c')]('nolimit')){_0x29ee05['limit']=qs[_0xcce5('0x23')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x23')]);_0x29ee05['offset']=qs[_0xcce5('0x20')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x29ee05['order']=qs[_0xcce5('0x3e')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x29ee05[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x2e89ba[_0xcce5('0x36')],_0x4d7e57[_0xcce5('0x38')]));_0x29ee05['where'][_0xcce5('0x57')]=_0x3744f6['id'];if(_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x41')]){_0x29ee05[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x29ee05[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x29ee05['attributes'],function(_0x51aac2){var _0x335c84={};_0x335c84[_0x51aac2]={'$like':'%'+_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x335c84;})});}_0x29ee05=_[_0xcce5('0x45')]({},_0x29ee05,_0x2e89ba['options']);return db[_0xcce5('0x5e')]['count']({'where':_0x29ee05[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x197430){_0x7a98fd['count']=_0x197430;if(_0x2e89ba['query']['includeAll']){_0x29ee05[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x5e')]['findAll'](_0x29ee05);})['then'](function(_0x1be070){_0x7a98fd['rows']=_0x1be070;return _0x7a98fd;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x4ada7a,_0x29ee05))[_0xcce5('0x1d')](handleError(_0x4ada7a,null));};exports[_0xcce5('0x60')]=function(_0x174934,_0xbab02c){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x174934['params']['id']}})['then'](handleEntityNotFound(_0xbab02c,null))[_0xcce5('0x12')](function(_0x436a13){if(_0x436a13){return _0x436a13[_0xcce5('0x60')](_0x174934[_0xcce5('0x36')][_0xcce5('0x5c')]);}})[_0xcce5('0x12')](respondWithStatusCode(_0xbab02c,null))[_0xcce5('0x1d')](handleError(_0xbab02c,null));};exports[_0xcce5('0x61')]=function(_0x453f34,_0x47d634){_0x453f34[_0xcce5('0x4f')][_0xcce5('0x62')]=_0x453f34['file'][_0xcce5('0x63')];return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x453f34[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47d634,null))['then'](saveUpdates(_0x453f34['body'],null))['then'](respondWithResult(_0x47d634,null))[_0xcce5('0x1d')](handleError(_0x47d634,null));};exports[_0xcce5('0x64')]=function(_0x39dbd5,_0x571461){_0x39dbd5[_0xcce5('0x4f')][_0xcce5('0x65')]=_0x39dbd5[_0xcce5('0x66')][_0xcce5('0x63')];return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x39dbd5[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x571461,null))[_0xcce5('0x12')](saveUpdates(_0x39dbd5['body'],null))['then'](respondWithResult(_0x571461,null))['catch'](handleError(_0x571461,null));};exports['addCustomerAvatar']=function(_0x493b41,_0x1abc2e){_0x493b41['body']['customerAvatar']=_0x493b41['file'][_0xcce5('0x63')];return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x493b41[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x1abc2e,null))[_0xcce5('0x12')](saveUpdates(_0x493b41[_0xcce5('0x4f')],null))[_0xcce5('0x12')](respondWithResult(_0x1abc2e,null))['catch'](handleError(_0x1abc2e,null));};exports[_0xcce5('0x67')]=function(_0x56648a,_0x51d572){_0x56648a[_0xcce5('0x4f')][_0xcce5('0x68')]=_0x56648a[_0xcce5('0x66')][_0xcce5('0x63')];return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x56648a[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x51d572,null))[_0xcce5('0x12')](saveUpdates(_0x56648a[_0xcce5('0x4f')],null))['then'](respondWithResult(_0x51d572,null))[_0xcce5('0x1d')](handleError(_0x51d572,null));};exports['getLogo']=function(_0x4b5bae,_0x490aaa){var _0x5491e5=path[_0xcce5('0x69')](config['root'],_0xcce5('0x6a'));var _0x38dfd6={'where':{'id':_0x4b5bae[_0xcce5('0x4b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x565c60=![];return require(_0xcce5('0x6b'))['getLicense']()[_0xcce5('0x12')](function(_0x29a3a9){if(_0x29a3a9){_0x565c60=_0x29a3a9[_0xcce5('0x6c')];}})[_0xcce5('0x12')](function(){return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x38dfd6);})[_0xcce5('0x12')](handleEntityNotFound(_0x490aaa,null))['then'](function(_0x3a74ed){if(_0x3a74ed){if(!_[_0xcce5('0x6d')](_0x3a74ed[_0xcce5('0x62')])){if(fs['existsSync'](path['join'](config[_0xcce5('0x6e')],'server/files/images/logos/',_0x3a74ed[_0xcce5('0x62')]))&&_0x565c60){_0x5491e5=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x6f'),_0x3a74ed['sitepic']);}}return _0x490aaa[_0xcce5('0x70')](_0x5491e5);}})[_0xcce5('0x1d')](handleError(_0x490aaa,null));};exports[_0xcce5('0x71')]=function(_0x3c1b4c,_0x376237){var _0x269e30=path['join'](config[_0xcce5('0x6e')],_0xcce5('0x72'));var _0x5ea9df={'where':{'id':_0x3c1b4c[_0xcce5('0x4b')]['id']},'attributes':['id',_0xcce5('0x65')],'raw':!![]};return db['ChatWebsite'][_0xcce5('0x4d')](_0x5ea9df)['then'](handleEntityNotFound(_0x376237,null))['then'](function(_0x26924e){if(_0x26924e){if(!_['isNil'](_0x26924e['agentAvatar'])){if(fs[_0xcce5('0x73')](path['join'](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x26924e[_0xcce5('0x65')]))){_0x269e30=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x26924e[_0xcce5('0x65')]);}}return _0x376237[_0xcce5('0x70')](_0x269e30);}})[_0xcce5('0x1d')](handleError(_0x376237,null));};exports[_0xcce5('0x75')]=function(_0x18956b,_0x540685){var _0x2b39a8=path[_0xcce5('0x69')](config['root'],_0xcce5('0x76'));var _0x4f2172={'where':{'id':_0x18956b[_0xcce5('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcce5('0x77')],'raw':!![]};return db['ChatWebsite'][_0xcce5('0x4d')](_0x4f2172)[_0xcce5('0x12')](handleEntityNotFound(_0x540685,null))[_0xcce5('0x12')](function(_0x48e415){if(_0x48e415){if(!_[_0xcce5('0x6d')](_0x48e415[_0xcce5('0x78')])){if(fs[_0xcce5('0x73')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x48e415[_0xcce5('0x78')]))&&_0x48e415['showCustomerAvatar']){_0x2b39a8=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x48e415[_0xcce5('0x78')]);}}return _0x540685['download'](_0x2b39a8);}})[_0xcce5('0x1d')](handleError(_0x540685,null));};exports[_0xcce5('0x79')]=function(_0x28881f,_0x4015f1){var _0x3e150b=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x7a'));var _0x4d7bea={'where':{'id':_0x28881f[_0xcce5('0x4b')]['id']},'attributes':['id',_0xcce5('0x68')],'raw':!![]};return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x4d7bea)['then'](handleEntityNotFound(_0x4015f1,null))[_0xcce5('0x12')](function(_0x2bd55f){if(_0x2bd55f){if(!_[_0xcce5('0x6d')](_0x2bd55f[_0xcce5('0x68')])){if(fs[_0xcce5('0x73')](path['join'](config[_0xcce5('0x6e')],'server/files/images/avatars/',_0x2bd55f[_0xcce5('0x68')]))){_0x3e150b=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x2bd55f[_0xcce5('0x68')]);}}return _0x4015f1[_0xcce5('0x70')](_0x3e150b);}})[_0xcce5('0x1d')](handleError(_0x4015f1,null));};exports[_0xcce5('0x7b')]=function(_0x139705,_0x23d460){var _0x3f6602=require(_0xcce5('0x7c'));var _0x3698ea=new _0x3f6602();var _0x565c45=_0x3698ea[_0xcce5('0x7d')](_0x139705[_0xcce5('0x7e')][_0xcce5('0x7f')])[_0xcce5('0x80')]();var _0x1026f5={'body':_0x139705['body'],'channel':_0xcce5('0x81')};var _0xe29954=[];var _0x4cdb57=[];var _0x46c0bc={};var _0x238c4f=![];return db[_0xcce5('0x82')][_0xcce5('0x55')]()[_0xcce5('0x12')](function(_0x491dfa){if(!_0x491dfa){throw new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0x85'));}_0xe29954=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x491dfa),[_0xcce5('0x87'),_0xcce5('0x88')]);_0x4cdb57=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x491dfa),[_0xcce5('0x87'),'updatedAt',_0xcce5('0x89'),_0xcce5('0x8a')]);if(_0x139705['body']['id']){delete _0x139705[_0xcce5('0x4f')]['id'];}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')])){throw new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))]('from\x20is\x20mandatory');}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')]['body'])||_0x139705['body']['body']===''){throw new db['Sequelize'][(_0xcce5('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')]['mapKey'])){throw new db['Sequelize'][(_0xcce5('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cdb57);}if(!_[_0xcce5('0x8c')](_0x4cdb57,_0x139705['body'][_0xcce5('0x8d')])){throw new db['Sequelize'][(_0xcce5('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cdb57);}_0x46c0bc[_0x139705[_0xcce5('0x4f')][_0xcce5('0x8d')]]=_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')];})['then'](function(){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x139705[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0x8e')],'as':'List','include':[{'model':db[_0xcce5('0x82')],'as':_0xcce5('0x8f'),'where':_0x46c0bc,'limit':0x1,'order':[[_0xcce5('0x88'),_0xcce5('0x90')]]}]},{'model':db[_0xcce5('0x91')],'as':_0xcce5('0x92')}]});})[_0xcce5('0x12')](handleEntityNotFound(_0x23d460,null))[_0xcce5('0x12')](function(_0x582014){if(_0x582014&&_0x582014['List']){_0x1026f5[_0xcce5('0x93')]=_0x582014;_0x1026f5[_0xcce5('0x94')]=_0x582014[_0xcce5('0x92')];_0x1026f5[_0xcce5('0x95')]=_0x582014['List'];_0x1026f5['applications']=_[_0xcce5('0x96')](_0x1026f5[_0xcce5('0x94')],[_0xcce5('0x97')],[_0xcce5('0x98')]);if(_0x1026f5['account']['Applications']){delete _0x1026f5[_0xcce5('0x93')][_0xcce5('0x92')];}if(_0x1026f5[_0xcce5('0x93')][_0xcce5('0x99')]&&_0x1026f5['account']['List'][_0xcce5('0x8f')][_0xcce5('0x3b')]){return _0x1026f5[_0xcce5('0x93')][_0xcce5('0x99')][_0xcce5('0x8f')][0x0];}var _0x4b3f2c=_[_0xcce5('0xb')](_0x139705[_0xcce5('0x4f')],{'firstName':_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')],'ListId':_0x582014[_0xcce5('0x8a')]});_0x4b3f2c[_0x139705[_0xcce5('0x4f')][_0xcce5('0x8d')]]=_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')];return db['CmContact']['create'](_0x4b3f2c,{'fields':_0xe29954,'raw':!![]});}})['then'](handleEntityNotFound(_0x23d460,null))[_0xcce5('0x12')](function(_0x135191){_0x1026f5['contact']=_0x135191;var _0x4a2ec7=_0x139705[_0xcce5('0x4f')][_0xcce5('0x9a')];if(_0x139705[_0xcce5('0x7e')]['cf-connecting-ip']){_0x4a2ec7=_0x139705[_0xcce5('0x7e')][_0xcce5('0x9b')];}else if(_0x139705[_0xcce5('0x7e')][_0xcce5('0x9c')]){_0x4a2ec7=_[_0xcce5('0x9d')](_0x139705[_0xcce5('0x7e')][_0xcce5('0x9c')][_0xcce5('0x9e')](','));}if(_0x135191){var _0x3bb666={'ContactId':_0x135191['id'],'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'from':(_0x135191[_0xcce5('0x9f')]||'')+'\x20'+(_0x135191[_0xcce5('0xa0')]||''),'customerIp':_0x4a2ec7,'customerPort':_0x139705[_0xcce5('0x7e')][_0xcce5('0xa1')]?_0x139705['headers'][_0xcce5('0xa1')]:null,'referer':_0x139705[_0xcce5('0x4f')][_0xcce5('0xa2')],'browserName':_0x565c45[_0xcce5('0xa3')][_0xcce5('0x2d')]&&_0x565c45[_0xcce5('0xa3')][_0xcce5('0xa4')]?util['format'](_0xcce5('0xa5'),_0x565c45[_0xcce5('0xa3')][_0xcce5('0x2d')],_0x565c45[_0xcce5('0xa3')][_0xcce5('0xa4')]):_0xcce5('0xa6'),'browserVersion':_0x565c45[_0xcce5('0xa3')]['version']||'unknown','osName':util[_0xcce5('0xa7')](_0xcce5('0xa5'),_0x565c45['os']['name'],_0x565c45['os']['version']),'osVersion':_0x565c45['os'][_0xcce5('0xa4')],'deviceModel':_0x565c45[_0xcce5('0xa8')][_0xcce5('0x35')]&&_0x565c45[_0xcce5('0xa8')]['vendor']?util[_0xcce5('0xa7')](_0xcce5('0xa9'),_0x565c45[_0xcce5('0xa8')]['model'],_0x565c45[_0xcce5('0xa8')][_0xcce5('0xaa')],_0x565c45[_0xcce5('0xa8')][_0xcce5('0x43')]):null,'deviceVendor':_0x565c45['device'][_0xcce5('0xaa')],'deviceType':_0x565c45[_0xcce5('0xa8')]['type'],'formData':JSON[_0xcce5('0x18')](_0x139705[_0xcce5('0x4f')])};var _0x2ee595={'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'closed':![]};if(_0x139705[_0xcce5('0x4f')]['threadId']){_0x2ee595['threadId']=_0x139705['body'][_0xcce5('0xab')];return db[_0xcce5('0xac')][_0xcce5('0x4d')]({'where':_0x2ee595})[_0xcce5('0x12')](function(_0xc76329){if(_0xc76329){return[_0xc76329,![]];}_0x3bb666[_0xcce5('0xab')]=_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')];_0x3bb666[_0xcce5('0xad')]=_0x139705[_0xcce5('0x4f')][_0xcce5('0xad')];return db[_0xcce5('0xac')][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x10cb17){return[_0x10cb17,!![]];});});}_0x2ee595[_0xcce5('0xae')]=_0x135191['id'];if(_0x139705[_0xcce5('0x4f')]['interaction']&&_0x139705[_0xcce5('0x4f')]['interaction']['id']){_0x2ee595['id']=_0x139705[_0xcce5('0x4f')][_0xcce5('0xaf')]['id'];return db['ChatInteraction']['find']({'where':_0x2ee595})['then'](function(_0x136994){if(_0x136994){return[_0x136994,![]];}return db['ChatInteraction'][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x46dc83){return[_0x46dc83,!![]];});});}return db[_0xcce5('0xac')][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x3f2812){return[_0x3f2812,!![]];});}})[_0xcce5('0xb0')](function(_0xb82ac,_0x204633){if(_0xb82ac){_0x238c4f=_0x204633;if(!_0x204633){var _0x4309d3={'from':(_0x1026f5['contact'][_0xcce5('0x9f')]||'')+'\x20'+(_0x1026f5[_0xcce5('0xb1')][_0xcce5('0xa0')]||'')};if(_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')]&&_0x139705[_0xcce5('0x4f')][_0xcce5('0xb2')]&&_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')]!=_0x139705[_0xcce5('0x4f')][_0xcce5('0xb2')]){_0x4309d3['threadId']=_0x139705['body'][_0xcce5('0xb2')];}return _0xb82ac[_0xcce5('0x26')](_0x4309d3);}else{return _0xb82ac;}}})[_0xcce5('0x12')](function(_0x1556f6){_0x1026f5[_0xcce5('0xaf')]=_0x1556f6['get']({'plain':!![]});_0x1026f5[_0xcce5('0xaf')][_0xcce5('0xb3')]=_0x238c4f;if(_0x1026f5['interaction'][_0xcce5('0xb3')]){if(_0x1026f5[_0xcce5('0x93')]['autoclose']){_0x1026f5[_0xcce5('0x94')][_0xcce5('0xb4')]({'id':0x0,'priority':_0x1026f5[_0xcce5('0x94')][_0xcce5('0x3b')]+0x1,'app':'close','appdata':_0xcce5('0xb5'),'interval':_0xcce5('0xb6')});}}return db['ChatMessage'][_0xcce5('0x4e')]({'body':_0x139705[_0xcce5('0x4f')][_0xcce5('0x4f')],'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'ChatInteractionId':_0x1556f6['id'],'direction':'in','ContactId':_0x1026f5[_0xcce5('0xb1')]['id'],'AttachmentId':_0x139705['body'][_0xcce5('0xb7')]});})['then'](function(_0x407bf1){_0x1026f5['message']=_0x407bf1;if(_0x1026f5[_0xcce5('0xaf')][_0xcce5('0xb8')]){return db[_0xcce5('0xb9')][_0xcce5('0x4d')]({'attributes':['id',_0xcce5('0x2d')],'where':{'id':_0x1026f5['interaction']['UserId']}})[_0xcce5('0x12')](function(_0x42b199){if(_0x42b199){_0x1026f5[_0xcce5('0x94')][_0xcce5('0xba')]({'id':0x0,'priority':0x0,'app':_0xcce5('0xbb'),'appdata':_0x42b199[_0xcce5('0x2d')]+','+(_0x1026f5['account'][_0xcce5('0xbc')]||0xa),'interval':_0xcce5('0xb6')});_0x1026f5[_0xcce5('0xbd')]=!![];}return respondWithRpcPromise(_0xcce5('0xbe'),_0xcce5('0xbf'),_0x1026f5);});}return respondWithRpcPromise('Start',_0xcce5('0xbf'),_0x1026f5);})['then'](function(_0xfe4404){respondWithRpcPromise(_0xcce5('0xc0'),_0xcce5('0xc0'),{'event':_0xcce5('0x7b'),'message':_0xfe4404},client9002);return _0xfe4404;})[_0xcce5('0x12')](respondWithResult(_0x23d460,null))[_0xcce5('0x1d')](handleError(_0x23d460,null));};exports[_0xcce5('0xc1')]=function(_0x242a44,_0x4726b1){var _0x5e9995,_0x4dbcff,_0x5547ec;var _0x42bebc=[];var _0x2f697b={};var _0x9108e4=_0x242a44['files']||[];var _0x50333c=[];var _0x483f53;return db[_0xcce5('0x82')][_0xcce5('0x55')]()[_0xcce5('0x12')](function(_0x52100c){if(!_0x52100c){throw new db[(_0xcce5('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x42bebc=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x52100c),['createdAt',_0xcce5('0x88'),_0xcce5('0x89'),_0xcce5('0x8a')]);if(_0x242a44[_0xcce5('0x4f')]['id']){delete _0x242a44[_0xcce5('0x4f')]['id'];}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')]['from'])){throw _0x4726b1['status'](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0xc2')));}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')])||_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')]===''){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')])){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x42bebc));}if(!_[_0xcce5('0x8c')](_0x42bebc,_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')])){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0xc4')+_0x42bebc));}_0x2f697b[_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')]]=_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')];})['then'](function(){return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x242a44[_0xcce5('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcce5('0x99')},{'model':db[_0xcce5('0xc5')],'as':_0xcce5('0xc5')}]});})[_0xcce5('0x12')](handleEntityNotFound(_0x4726b1,null))[_0xcce5('0x12')](function(_0x58da85){if(_0x58da85&&_0x58da85[_0xcce5('0x99')]){_0x4dbcff=_0x58da85;var _0x2dcd53=_[_0xcce5('0xb')](_0x242a44[_0xcce5('0x4f')],{'firstName':_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')],'phone':_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')],'ListId':_0x58da85[_0xcce5('0x8a')]});_0x2dcd53[_0x242a44[_0xcce5('0x4f')]['mapKeyOffline']]=_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')];return db[_0xcce5('0x82')][_0xcce5('0xc6')]({'where':_0x2f697b,'defaults':_0x2dcd53});}})[_0xcce5('0xb0')](function(_0x4857ea){if(_0x4857ea){_0x5547ec=_0x4857ea;var _0x468b09=fs[_0xcce5('0xc7')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0xc8')),_0xcce5('0xc9'));var _0x2cda81=ejs[_0xcce5('0xca')](_0x468b09,{'body':_[_0xcce5('0xcb')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')]),'bodyTitle':_0x4dbcff['offlineMessageBody']});return db[_0xcce5('0xcc')][_0xcce5('0x4e')]({'body':_0x2cda81,'ContactId':_0x4857ea['id'],'ChatWebsiteId':_0x4dbcff['id']});}})[_0xcce5('0x12')](function(_0x3a5a69){_0x483f53=_0x3a5a69;if(_0x9108e4[_0xcce5('0x3b')]){var _0x4f1288=_0x9108e4[_0xcce5('0x42')](function(_0x4e2639){return{'name':_0x4e2639[_0xcce5('0xcd')],'basename':_0x4e2639[_0xcce5('0x63')],'type':_0x4e2639['mimetype'],'ChatOfflineMessageId':_0x3a5a69['id']};});_0x50333c=_0x4f1288['map'](_0x2f8b32=>{var _0x17cb7a={'filename':_0x2f8b32[_0xcce5('0x2d')],'path':path['join'](config[_0xcce5('0x6e')],_0xcce5('0xce'),'files',_0xcce5('0xcf'),'offline-chat',_0x2f8b32['basename'])};return _0x17cb7a;});if(!_0x4dbcff['openNewInteraction']){return db[_0xcce5('0xd0')][_0xcce5('0xd1')](function(_0xd1aa7c){return db['Attachment'][_0xcce5('0xd2')](_0x4f1288,{'transaction':_0xd1aa7c});});}}})[_0xcce5('0x12')](function(){if(_0x483f53){_0x5e9995=_0x483f53;return db[_0xcce5('0xc5')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x46b6fb){if(_0x46b6fb&&_0x46b6fb[_0xcce5('0xd3')]&&_0x4dbcff[_0xcce5('0xd4')]&&_0x4dbcff['forwardOfflineAddress']){var _0x8595d4={'tls':{'rejectUnauthorized':![]}};if(_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd5')]){_0x8595d4['service']=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd5')];}else{_0x8595d4['host']=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd6')];_0x8595d4[_0xcce5('0xd7')]=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd7')];_0x8595d4['secure']=_0x46b6fb[_0xcce5('0xd3')]['secure'];}if(_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd8')]){_0x8595d4[_0xcce5('0xd9')]={'user':_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0x50')],'pass':_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xda')]};}return respondWithRpcPromise(_0xcce5('0xdb'),_0xcce5('0xdc'),{'account':_0x8595d4,'message':{'from':util[_0xcce5('0xa7')](_0xcce5('0xdd'),_0x46b6fb[_0xcce5('0x2d')],_0x46b6fb[_0xcce5('0xde')]||_0x46b6fb['Smtp'][_0xcce5('0x50')]),'to':_0x4dbcff[_0xcce5('0xdf')],'subject':_0x4dbcff[_0xcce5('0xe0')],'html':_0x5e9995[_0xcce5('0x4f')],'attachments':_0x50333c}},client9003)['then'](function(){return _0x5e9995;})[_0xcce5('0x1d')](function(_0x3c602f){console['error'](_0x3c602f);});}})[_0xcce5('0x12')](function(){if(_0x4dbcff&&_0x4dbcff['openNewInteraction']&&_0x4dbcff[_0xcce5('0xe1')]){var _0x1d5206=[];if(_0x9108e4[_0xcce5('0x3b')]){_0x1d5206=_0x9108e4[_0xcce5('0x42')](function(_0x7a4877){return{'name':_0x7a4877[_0xcce5('0xcd')],'basename':_0x7a4877[_0xcce5('0x63')],'type':_0x7a4877['mimetype'],'ChatOfflineMessageId':_0x483f53['id']};});}var _0x8942ba;if(!_['isNil'](_0x4dbcff[_0xcce5('0xe2')])){var _0x25b640=_[_0xcce5('0x42')](_0x242a44['body'],function(_0x2fdff0){return _0x2fdff0;});var _0x4030fb=_[_0xcce5('0xe3')](_0x25b640)[0x0];var _0x5930a8=_[_0xcce5('0xe4')](_0x4030fb,function(_0x43e657){return _0x43e657;});_0x8942ba=_0x5930a8[0x1][_0x4dbcff[_0xcce5('0xe2')]];}var _0x3dc0e8={'from':_0x5547ec[_0xcce5('0xde')],'firstName':_0x5547ec[_0xcce5('0x9f')],'lastName':_0x5547ec[_0xcce5('0xa0')],'mapKey':_0xcce5('0xde'),'message':{'from':_0x5547ec[_0xcce5('0xde')],'to':_0x4dbcff['MailAccount'][_0xcce5('0xde')],'cc':'','subject':_[_0xcce5('0x6d')](_0x8942ba)?_0x4dbcff[_0xcce5('0xe0')]:_0x8942ba,'messageId':'','sentAt':new Date(),'attach':_0x1d5206['length'],'attachments':_0x1d5206,'originChannel':_0xcce5('0xe5'),'ChatWebsiteId':_0x4dbcff['id'],'ChatOfflineMessageId':_0x5e9995['id'],'originTo':_0x4dbcff['MailAccount'][_0xcce5('0xde')]},'body':_0x5e9995[_0xcce5('0x4f')]};var _0x162c48={'account':{'id':_0x4dbcff[_0xcce5('0xe1')]},'body':_0x3dc0e8,'log':_0xcce5('0xe6')};return respondWithRpcPromise(_0xcce5('0xe6'),'notifyMail',_0x162c48,client9001)[_0xcce5('0x12')](function(){return _0x5e9995;})[_0xcce5('0x1d')](function(_0x59c349){console['error'](_0x59c349);});}return;})[_0xcce5('0x12')](function(){if(_0x5e9995){return _0x5e9995;}})[_0xcce5('0x12')](respondWithResult(_0x4726b1,null))['catch'](function(_0x2eac92){console[_0xcce5('0x19')](_0xcce5('0x1d'),_0x2eac92);for(var _0x5846cb of _0x9108e4){var _0x3b9cb0=path['join'](config[_0xcce5('0x6e')],'server',_0xcce5('0xe7'),_0xcce5('0xcf'),_0xcce5('0xe8'),_0x5846cb[_0xcce5('0x63')]);fs_extra[_0xcce5('0xe9')](_0x3b9cb0)[_0xcce5('0x1d')](function(_0x390469){console[_0xcce5('0x19')](_0xcce5('0xea'),_0x3b9cb0,_0x390469);});}});};exports[_0xcce5('0xeb')]=function(_0x5b30bb,_0x3d18b0){return db['ChatInteraction']['find']({'where':{'id':_0x5b30bb['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x3d18b0,null))[_0xcce5('0x12')](function(_0x1aa05c){if(_0x1aa05c){return _0x1aa05c[_0xcce5('0xeb')](_0x5b30bb['body']['ids'],_[_0xcce5('0xec')](_0x5b30bb['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3d18b0,null))[_0xcce5('0x1d')](handleError(_0x3d18b0,null));};exports['getInteractions']=function(_0x560d61,_0x18c935){var _0x17f415={'raw':![],'where':{}};var _0x4caf87={};var _0x2c7acc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x560d61[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18c935,null))[_0xcce5('0x12')](function(_0x58c062){if(_0x58c062){_0x4caf87[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0xac')]['rawAttributes']);_0x4caf87[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x560d61[_0xcce5('0x36')]);_0x4caf87[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x4caf87[_0xcce5('0x35')],_0x4caf87['query']);_0x17f415[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x4caf87[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x560d61[_0xcce5('0x36')]['fields']));_0x17f415[_0xcce5('0x39')]=_0x17f415[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x17f415[_0xcce5('0x39')]:_0x4caf87[_0xcce5('0x35')];if(!_0x560d61[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x17f415[_0xcce5('0x23')]=qs['limit'](_0x560d61[_0xcce5('0x36')][_0xcce5('0x23')]);_0x17f415[_0xcce5('0x20')]=qs['offset'](_0x560d61[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x17f415[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x560d61[_0xcce5('0x36')]['sort']);_0x17f415[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x560d61[_0xcce5('0x36')],_0x4caf87[_0xcce5('0x38')]));_0x17f415[_0xcce5('0x3f')][_0xcce5('0x57')]=_0x58c062['id'];if(_0x560d61[_0xcce5('0x36')][_0xcce5('0x41')]){_0x17f415[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x17f415[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x17f415['attributes'],function(_0x489a58){var _0x4d3c75={};_0x4d3c75[_0x489a58]={'$like':'%'+_0x560d61[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x4d3c75;})});}_0x17f415=_[_0xcce5('0x45')]({},_0x17f415,_0x560d61[_0xcce5('0x46')]);return db['ChatInteraction']['count']({'where':_0x17f415[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x32c5e8){_0x2c7acc[_0xcce5('0x22')]=_0x32c5e8;if(_0x560d61[_0xcce5('0x36')]['includeAll']){_0x17f415['include']=[{'model':db['CmContact'],'as':_0xcce5('0xed'),'required':![]},{'model':db[_0xcce5('0xb9')],'as':'Owner','attributes':['name','fullname',_0xcce5('0xee')],'required':![]},{'model':db[_0xcce5('0xef')],'as':_0xcce5('0xf0'),'attributes':['id','name',_0xcce5('0xf1')],'where':_0x560d61[_0xcce5('0x36')][_0xcce5('0xf2')]?{'id':_0x560d61[_0xcce5('0x36')]['tag']}:undefined,'required':_0x560d61[_0xcce5('0x36')][_0xcce5('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0xcce5('0x5b')](_0x17f415);})[_0xcce5('0x12')](function(_0x531f34){_0x2c7acc['rows']=_0x531f34;return _0x2c7acc;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x18c935,_0x17f415))[_0xcce5('0x1d')](handleError(_0x18c935,null));};function iftimePromise(_0x486a90,_0x1fc92e){return respondWithRpcPromise(_0xcce5('0xf3'),'getSnippet',{'command':_0x1fc92e[_0xcce5('0xf4')]?util[_0xcce5('0xa7')](_0xcce5('0xf5'),_0x486a90[_0xcce5('0xf6')],_0x1fc92e['timezone']):util[_0xcce5('0xa7')](_0xcce5('0xf7'),_0x486a90[_0xcce5('0xf6')])},client9002)[_0xcce5('0x12')](function(_0x949d75){var _0x6876af=_0x949d75&&_0x949d75[_0xcce5('0xf8')](_0xcce5('0xf9'))>=0x0?!![]:![];logger[_0xcce5('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1fc92e['id'],_0x486a90['id'],_0x486a90[_0xcce5('0xf6')],_0x6876af?'ONLINE':_0xcce5('0xfa'),_0x1fc92e['timezone']?_0x1fc92e[_0xcce5('0xf4')]:_0xcce5('0xfb'));return _0x6876af;})['catch'](function(_0x239c83){logger[_0xcce5('0x19')](_0xcce5('0xfc'),_0x1fc92e['id'],_0x486a90['id'],_0x486a90[_0xcce5('0xf6')],util[_0xcce5('0xfd')](_0x239c83,{'showHidden':![],'depth':null}),_0x1fc92e[_0xcce5('0xf4')]?_0x1fc92e[_0xcce5('0xf4')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1fc10e,_0x48b8d1){var _0x9041d9=0x0;var _0x13bdc1=0x0;var _0x2a32bf=![];var _0x2a155d;var _0xd1bf3c;return db[_0xcce5('0x31')]['find']({'where':{'id':_0x1fc10e[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0xfe')],'as':_0xcce5('0xfe'),'include':[{'model':db[_0xcce5('0xfe')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xcce5('0x12')](handleEntityNotFound(_0x48b8d1,null))[_0xcce5('0x12')](function(_0x5aa9f1){if(_0x5aa9f1){_0x2a155d=_0x5aa9f1;return _0x5aa9f1[_0xcce5('0xff')]({'raw':!![]});}})[_0xcce5('0x12')](function(_0xeac7d1){if(_0x2a155d){if(_0xeac7d1){_0xd1bf3c=_0xeac7d1;}}return require(_0xcce5('0x6b'))[_0xcce5('0x100')]();})[_0xcce5('0x12')](function(_0x223b74){if(_0x223b74){_0x13bdc1=_0x223b74[_0xcce5('0x101')];_0x2a32bf=_0x223b74[_0xcce5('0x6c')];}})[_0xcce5('0x12')](function(){return db[_0xcce5('0xac')][_0xcce5('0x22')]({'where':{'closed':![]}});})[_0xcce5('0x12')](function(_0x2bca8d){_0x9041d9=_0x2bca8d;if(_0x13bdc1&&_0x2bca8d>_0x13bdc1){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0xea236f){if(_0xea236f){_0xea236f['increment'](_0xcce5('0x102'));}});}})[_0xcce5('0x12')](function(){if(_0x2a155d[_0xcce5('0xfe')]&&_0x2a155d['Interval'][_0xcce5('0x103')]){var _0x4f72d5=[];for(var _0x561a2b=0x0;_0x561a2b<_0x2a155d[_0xcce5('0xfe')][_0xcce5('0x103')][_0xcce5('0x3b')];_0x561a2b++){var _0x3a555f=_0x2a155d[_0xcce5('0xfe')][_0xcce5('0x103')][_0x561a2b][_0xcce5('0x28')]({'plain':!![]});_0x4f72d5[_0xcce5('0xb4')](iftimePromise(_0x3a555f,_0x2a155d));}return BPromise['all'](_0x4f72d5)['then'](function(_0x3d99df){return _[_0xcce5('0x104')](_0x3d99df);});}else{return!![];}})[_0xcce5('0x12')](function(_0x13c1c4){var _0x281330=fs[_0xcce5('0xc7')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x105')),_0xcce5('0xc9'));var _0x14fea1={'remote':_0x2a155d[_0xcce5('0x106')],'query':querystring['stringify'](_['merge'](_0x2a155d[_0xcce5('0x28')]({'plain':!![]}),{'customerIp':_0x1fc10e[_0xcce5('0x7e')]['x-forwarded-for']||_0x1fc10e['headers'][_0xcce5('0x107')]||_0x1fc10e[_0xcce5('0x108')][_0xcce5('0x109')]||_0x1fc10e['ip'],'referer':_0x1fc10e[_0xcce5('0x7e')][_0xcce5('0xa2')],'openedInteractions':_0x9041d9,'maxInteractions':_0x13bdc1,'virtual':_0x2a32bf['virtual'],'online':_0x13c1c4,'custom':_0x2a32bf}))[_0xcce5('0x10a')](/'/g,'\x5c\x27')};_0x48b8d1[_0xcce5('0x2e')](ejs['render'](Mustache[_0xcce5('0xca')](_0x281330,_0x14fea1),{'proactiveActions':_0xd1bf3c,'alignment':_0x2a155d[_0xcce5('0x10b')],'verticalAlignment':_0x2a155d[_0xcce5('0x10c')],'div_color':_0x2a155d[_0xcce5('0xf1')],'labelText':_0x2a155d[_0xcce5('0x10d')],'text_color':_0x2a155d[_0xcce5('0x10e')],'button_color':_0x2a155d[_0xcce5('0x10f')],'background_color':_0x2a155d[_0xcce5('0x110')]}));})[_0xcce5('0x1d')](handleError(_0x48b8d1,null));};exports[_0xcce5('0x111')]=function(_0x43e5c9,_0x2baa54){var _0x173a04=_0x43e5c9[_0xcce5('0x4b')]['id'];var _0x7a34d7=_0x43e5c9[_0xcce5('0x4f')];var _0x10e703=0xc8;var _0x59eaa8=null;return db[_0xcce5('0xd0')][_0xcce5('0xd1')]({'isolationLevel':db[_0xcce5('0xd0')][_0xcce5('0x112')][_0xcce5('0x113')]['READ_COMMITTED']},function(_0x6826d4){return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x173a04},'transaction':_0x6826d4})['then'](function(_0x1bf2d2){if(_0x1bf2d2){return db[_0xcce5('0x91')][_0xcce5('0x27')]({'where':{'ChatWebsiteId':_0x173a04},'transaction':_0x6826d4})[_0xcce5('0x12')](function(){var _0x145ef6=_['map'](_0x7a34d7,function(_0x2f52f1){_0x2f52f1[_0xcce5('0x57')]=_0x173a04;return _0x2f52f1;});return db[_0xcce5('0x91')]['bulkCreate'](_0x145ef6,{'transaction':_0x6826d4});});}else{_0x10e703=0x194;_0x59eaa8=[];}});})['then'](function(){if(_0x10e703!==0x194){return db[_0xcce5('0x91')][_0xcce5('0x114')]({'where':{'ChatWebsiteId':_0x173a04},'order':'priority'})[_0xcce5('0x12')](function(_0x3edba9){_0x59eaa8=_0x3edba9;});}})[_0xcce5('0x1d')](function(_0x390f8b){_0x10e703=0x1f4;logger[_0xcce5('0x19')](_0x390f8b[_0xcce5('0x2c')]);if(_0x390f8b[_0xcce5('0x2d')]){delete _0x390f8b[_0xcce5('0x2d')];}_0x59eaa8=_0x390f8b;})[_0xcce5('0x115')](function(){if(_0x59eaa8===null){_0x2baa54[_0xcce5('0x2b')](_0x10e703);}else{if(_0x10e703===0x1f4){_0x2baa54[_0xcce5('0x1e')](_0x10e703)[_0xcce5('0x2e')](_0x59eaa8);}else{_0x2baa54[_0xcce5('0x1e')](_0x10e703)['json'](_0x59eaa8);}}});};exports[_0xcce5('0x116')]=function(_0x5a8118,_0x4a88e7){var _0x15a4ba={};var _0x3f970f={};var _0x2b35b6;var _0x119cdc;return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x5a8118['params']['id']}})['then'](handleEntityNotFound(_0x4a88e7,null))[_0xcce5('0x12')](function(_0x9102c1){if(_0x9102c1){_0x2b35b6=_0x9102c1;_0x3f970f[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatApplication'][_0xcce5('0x32')]);_0x3f970f[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x5a8118[_0xcce5('0x36')]);_0x3f970f[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x3f970f[_0xcce5('0x35')],_0x3f970f[_0xcce5('0x36')]);_0x15a4ba[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x3f970f['model'],qs[_0xcce5('0x3a')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x15a4ba[_0xcce5('0x39')]=_0x15a4ba[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x15a4ba[_0xcce5('0x39')]:_0x3f970f[_0xcce5('0x35')];_0x15a4ba[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x15a4ba[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x5a8118[_0xcce5('0x36')],_0x3f970f[_0xcce5('0x38')]));if(_0x5a8118[_0xcce5('0x36')]['filter']){_0x15a4ba[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x15a4ba[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x15a4ba[_0xcce5('0x39')],function(_0x221517){var _0x2caf59={};_0x2caf59[_0x221517]={'$like':'%'+_0x5a8118[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x2caf59;})});}_0x15a4ba=_[_0xcce5('0x45')]({},_0x15a4ba,_0x5a8118[_0xcce5('0x46')]);return _0x2b35b6[_0xcce5('0x116')](_0x15a4ba);}})[_0xcce5('0x12')](function(_0x3aa024){if(_0x3aa024){_0x119cdc=_0x3aa024[_0xcce5('0x3b')];if(!_0x5a8118[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0x15a4ba['limit']=qs[_0xcce5('0x23')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x23')]);_0x15a4ba[_0xcce5('0x20')]=qs[_0xcce5('0x20')](_0x5a8118[_0xcce5('0x36')]['offset']);}return _0x2b35b6['getApplications'](_0x15a4ba);}})[_0xcce5('0x12')](function(_0x25a0dc){if(_0x25a0dc){return _0x25a0dc?{'count':_0x119cdc,'rows':_0x25a0dc}:null;}})['then'](respondWithResult(_0x4a88e7,null))['catch'](handleError(_0x4a88e7,null));};exports[_0xcce5('0x117')]=function(_0x50c456,_0x2b08f5){return db['chatProactiveAction'][_0xcce5('0x4d')]({'where':{'id':_0x50c456[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x2b08f5,null))[_0xcce5('0x12')](function(_0x28f470){if(_0x28f470){return _0x28f470[_0xcce5('0x117')](_0x50c456[_0xcce5('0x4f')][_0xcce5('0x5c')],_['omit'](_0x50c456['body'],[_0xcce5('0x5c'),'id'])||{});}})[_0xcce5('0x12')](respondWithResult(_0x2b08f5,null))[_0xcce5('0x1d')](handleError(_0x2b08f5,null));};exports['getProactiveActions']=function(_0x3bbe81,_0x55689d){var _0xaa30f3={};var _0xf85b1={};var _0x378a48;var _0x168d80;return db[_0xcce5('0x31')]['findOne']({'where':{'id':_0x3bbe81[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x55689d,null))[_0xcce5('0x12')](function(_0x120840){if(_0x120840){_0x378a48=_0x120840;_0xf85b1[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatProactiveAction'][_0xcce5('0x32')]);_0xf85b1['query']=_[_0xcce5('0x37')](_0x3bbe81[_0xcce5('0x36')]);_0xf85b1[_0xcce5('0x38')]=_['intersection'](_0xf85b1['model'],_0xf85b1[_0xcce5('0x36')]);_0xaa30f3[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0xf85b1['model'],qs[_0xcce5('0x3a')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x3a')]));_0xaa30f3['attributes']=_0xaa30f3[_0xcce5('0x39')][_0xcce5('0x3b')]?_0xaa30f3[_0xcce5('0x39')]:_0xf85b1[_0xcce5('0x35')];_0xaa30f3[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x3bbe81['query'][_0xcce5('0x3e')]);_0xaa30f3[_0xcce5('0x3f')]=qs['filters'](_[_0xcce5('0x40')](_0x3bbe81[_0xcce5('0x36')],_0xf85b1['filters']));if(_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x41')]){_0xaa30f3['where']=_[_0xcce5('0x45')](_0xaa30f3['where'],{'$or':_[_0xcce5('0x42')](_0xaa30f3[_0xcce5('0x39')],function(_0x4762ff){var _0x46bbe7={};_0x46bbe7[_0x4762ff]={'$like':'%'+_0x3bbe81['query']['filter']+'%'};return _0x46bbe7;})});}_0xaa30f3=_[_0xcce5('0x45')]({},_0xaa30f3,_0x3bbe81[_0xcce5('0x46')]);return _0x378a48['getProactiveActions'](_0xaa30f3);}})[_0xcce5('0x12')](function(_0x1df666){if(_0x1df666){_0x168d80=_0x1df666[_0xcce5('0x3b')];if(!_0x3bbe81[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0xaa30f3[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x23')]);_0xaa30f3['offset']=qs[_0xcce5('0x20')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x20')]);}return _0x378a48[_0xcce5('0xff')](_0xaa30f3);}})[_0xcce5('0x12')](function(_0x3be3e4){if(_0x3be3e4){return _0x3be3e4?{'count':_0x168d80,'rows':_0x3be3e4}:null;}})[_0xcce5('0x12')](respondWithResult(_0x55689d,null))[_0xcce5('0x1d')](handleError(_0x55689d,null));};exports[_0xcce5('0x118')]=function(_0x14e567,_0x2066f8){var _0xd28f29=_0x14e567[_0xcce5('0x36')]['online']==='false'?_0xcce5('0x119'):_0xcce5('0x11a');return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'attributes':['id',_0xd28f29],'where':{'id':_0x14e567[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x2066f8,null))[_0xcce5('0x12')](function(_0x3a7e81){if(_0x3a7e81){var _0x17e94d=_0x3a7e81[_0xd28f29];var _0x214be7=_0x17e94d&&_0x17e94d['items']?_0x17e94d['items']:[];_0x2066f8[_0xcce5('0x2e')]({'fromKey':_[_0xcce5('0x6d')](_0x17e94d[_0xcce5('0x11b')])?undefined:_0x17e94d[_0xcce5('0x11b')],'count':_0x214be7['length'],'rows':_0x214be7});}})['catch'](handleError(_0x2066f8,null));};exports[_0xcce5('0x11c')]=function(_0x58c4c6,_0x414b1c){var _0x88e40c={'raw':![],'where':{}};var _0x174f6b={};var _0x3937f2={'count':0x0,'rows':[]};return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x58c4c6['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x414b1c,null))[_0xcce5('0x12')](function(_0x11eceb){if(_0x11eceb){_0x174f6b[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatOfflineMessage']['rawAttributes']);_0x174f6b[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x58c4c6['query']);_0x174f6b[_0xcce5('0x38')]=_['intersection'](_0x174f6b[_0xcce5('0x35')],_0x174f6b[_0xcce5('0x36')]);_0x88e40c[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x174f6b['model'],qs[_0xcce5('0x3a')](_0x58c4c6['query'][_0xcce5('0x3a')]));_0x88e40c[_0xcce5('0x39')]=_0x88e40c[_0xcce5('0x39')]['length']?_0x88e40c[_0xcce5('0x39')]:_0x174f6b[_0xcce5('0x35')];if(!_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x3c')]('nolimit')){_0x88e40c[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x58c4c6[_0xcce5('0x36')]['limit']);_0x88e40c['offset']=qs['offset'](_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x88e40c[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x58c4c6['query'][_0xcce5('0x3e')]);_0x88e40c[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x58c4c6['query'],_0x174f6b[_0xcce5('0x38')]));_0x88e40c[_0xcce5('0x3f')][_0xcce5('0x57')]=_0x11eceb['id'];if(_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x41')]){_0x88e40c['where']=_['merge'](_0x88e40c[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x88e40c[_0xcce5('0x39')],function(_0x50a729){var _0x32e261={};_0x32e261[_0x50a729]={'$like':'%'+_0x58c4c6['query'][_0xcce5('0x41')]+'%'};return _0x32e261;})});}_0x88e40c=_[_0xcce5('0x45')]({},_0x88e40c,_0x58c4c6[_0xcce5('0x46')]);return db['ChatOfflineMessage'][_0xcce5('0x22')]({'where':_0x88e40c[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x1c2cc5){_0x3937f2[_0xcce5('0x22')]=_0x1c2cc5;if(_0x58c4c6[_0xcce5('0x36')]['includeAll']){_0x88e40c[_0xcce5('0x48')]=[{'all':!![]}];}else{_0x88e40c[_0xcce5('0x48')]=[{'model':db[_0xcce5('0x82')],'as':'Contact','required':![]},{'model':db[_0xcce5('0x11d')],'as':_0xcce5('0x11e'),'required':![]}];}return db[_0xcce5('0xcc')][_0xcce5('0x5b')](_0x88e40c);})[_0xcce5('0x12')](function(_0x1a489f){_0x3937f2['rows']=_0x1a489f;return _0x3937f2;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x414b1c,_0x88e40c))[_0xcce5('0x1d')](handleError(_0x414b1c,null));};exports[_0xcce5('0x11f')]=function(_0x202ace,_0x4f1240){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x202ace[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4f1240,null))[_0xcce5('0x12')](function(_0x33bf86){if(_0x33bf86){return _0x33bf86[_0xcce5('0x11f')](_0x202ace['body']['ids'],_['omit'](_0x202ace['body'],[_0xcce5('0x5c'),'id'])||{})[_0xcce5('0xb0')](function(_0x56401d){for(var _0x52356f=0x0;_0x52356f<_0x202ace['body']['ids']['length'];_0x52356f+=0x1){socket[_0xcce5('0x120')](_0xcce5('0x121'),{'UserId':Number(_0x202ace[_0xcce5('0x4f')][_0xcce5('0x5c')][_0x52356f]),'ChatWebsiteId':Number(_0x202ace[_0xcce5('0x4b')]['id'])});}return _0x56401d;});}})[_0xcce5('0x12')](respondWithResult(_0x4f1240,null))[_0xcce5('0x1d')](handleError(_0x4f1240,null));};exports[_0xcce5('0x122')]=function(_0x361ef8,_0x41a9b0){return db[_0xcce5('0x31')]['find']({'where':{'id':_0x361ef8[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x41a9b0,null))['then'](function(_0x8a7050){if(_0x8a7050){return _0x8a7050[_0xcce5('0x122')](_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')])['then'](function(){if(_[_0xcce5('0x123')](_0x361ef8['query'][_0xcce5('0x5c')])){for(var _0xba0491=0x0;_0xba0491<_0x361ef8[_0xcce5('0x36')]['ids'][_0xcce5('0x3b')];_0xba0491+=0x1){socket[_0xcce5('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')][_0xba0491]),'ChatWebsiteId':Number(_0x361ef8[_0xcce5('0x4b')]['id'])});}}else{socket['emit'](_0xcce5('0x124'),{'UserId':Number(_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')]),'ChatWebsiteId':Number(_0x361ef8[_0xcce5('0x4b')]['id'])});}});}})[_0xcce5('0x12')](respondWithStatusCode(_0x41a9b0,null))[_0xcce5('0x1d')](handleError(_0x41a9b0,null));};exports[_0xcce5('0x125')]=function(_0x20e8c9,_0x59d5af){var _0x14ab79={};var _0x140f86={};var _0x1d8be5;var _0x5f283e;return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x20e8c9[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x59d5af,null))[_0xcce5('0x12')](function(_0x30ff66){if(_0x30ff66){_0x1d8be5=_0x30ff66;_0x140f86[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0xb9')][_0xcce5('0x32')]);_0x140f86['query']=_['keys'](_0x20e8c9[_0xcce5('0x36')]);_0x140f86[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x140f86[_0xcce5('0x35')],_0x140f86['query']);_0x14ab79[_0xcce5('0x39')]=_['intersection'](_0x140f86[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x14ab79[_0xcce5('0x39')]=_0x14ab79['attributes'][_0xcce5('0x3b')]?_0x14ab79['attributes']:_0x140f86[_0xcce5('0x35')];_0x14ab79[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x14ab79[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_['pick'](_0x20e8c9[_0xcce5('0x36')],_0x140f86[_0xcce5('0x38')]));if(_0x20e8c9['query'][_0xcce5('0x41')]){_0x14ab79[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x14ab79[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x14ab79[_0xcce5('0x39')],function(_0x2e495d){var _0x3554dc={};_0x3554dc[_0x2e495d]={'$like':'%'+_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x3554dc;})});}_0x14ab79=_['merge']({},_0x14ab79,_0x20e8c9['options']);return _0x1d8be5[_0xcce5('0x125')](_0x14ab79);}})['then'](function(_0x91c828){if(_0x91c828){_0x5f283e=_0x91c828[_0xcce5('0x3b')];if(!_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x14ab79[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x20e8c9[_0xcce5('0x36')]['limit']);_0x14ab79[_0xcce5('0x20')]=qs['offset'](_0x20e8c9['query'][_0xcce5('0x20')]);}return _0x1d8be5[_0xcce5('0x125')](_0x14ab79);}})[_0xcce5('0x12')](function(_0x142c64){if(_0x142c64){return _0x142c64?{'count':_0x5f283e,'rows':_0x142c64}:null;}})[_0xcce5('0x12')](respondWithResult(_0x59d5af,null))[_0xcce5('0x1d')](handleError(_0x59d5af,null));}; \ No newline at end of file +var _0x753c=['push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','CmContact','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','finally','getApplications','addProactiveActions','ChatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','update','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','ChatWebsite','count','includeAll','rows','show','params','Pause','length','include','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','sort','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','mapKey','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose'];(function(_0x58e1e4,_0x4e68bd){var _0x3ca204=function(_0x141fa1){while(--_0x141fa1){_0x58e1e4['push'](_0x58e1e4['shift']());}};_0x3ca204(++_0x4e68bd);}(_0x753c,0x79));var _0xc753=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x753c[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0xc753('0x0'));var Mustache=require(_0xc753('0x1'));var util=require(_0xc753('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc753('0x3'));var _=require(_0xc753('0x4'));var querystring=require(_0xc753('0x5'));var Redis=require('ioredis');var qs=require(_0xc753('0x6'));var logger=require(_0xc753('0x7'))(_0xc753('0x8'));var config=require(_0xc753('0x9'));var db=require(_0xc753('0xa'))['db'];config['redis']=_[_0xc753('0xb')](config[_0xc753('0xc')],{'host':_0xc753('0xd'),'port':0x18eb});var socket=require(_0xc753('0xe'))(new Redis(config[_0xc753('0xc')]));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232c});var client9002=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232a});var client9003=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232b});var client9001=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x1b8999,_0x58b9bc,_0x3105ce,_0x39ac72){return new BPromise(function(_0x3433d1,_0x5e63fb){var _0x4f7d6d=_0x39ac72||client;return _0x4f7d6d[_0xc753('0x11')](_0x1b8999,_0x3105ce)['then'](function(_0x5bc4a0){logger[_0xc753('0x12')](_0xc753('0x13'),_0x58b9bc,_0xc753('0x14'));logger[_0xc753('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x58b9bc,_0xc753('0x14'),JSON[_0xc753('0x16')](_0x5bc4a0));if(_0x5bc4a0[_0xc753('0x17')]){if(_0x5bc4a0['error'][_0xc753('0x18')]===0x1f4){logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);return _0x5e63fb(_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);}logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);return _0x3433d1(_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);}else{logger[_0xc753('0x12')](_0xc753('0x13'),_0x58b9bc,_0xc753('0x14'));_0x3433d1(_0x5bc4a0[_0xc753('0x1a')][_0xc753('0x19')]);}})[_0xc753('0x1b')](function(_0x6c9be7){logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x6c9be7);_0x5e63fb(_0x6c9be7);});});}function respondWithStatusCode(_0x58eaca,_0x68bb91){_0x68bb91=_0x68bb91||0xcc;return function(_0x18b944){if(_0x18b944){return _0x58eaca[_0xc753('0x1c')](_0x68bb91);}return _0x58eaca[_0xc753('0x1d')](_0x68bb91)[_0xc753('0x1e')]();};}function respondWithResult(_0x2f15e0,_0x12038f){_0x12038f=_0x12038f||0xc8;return function(_0x4bfc4d){if(_0x4bfc4d){return _0x2f15e0[_0xc753('0x1d')](_0x12038f)[_0xc753('0x1f')](_0x4bfc4d);}};}function respondWithFilteredResult(_0x1e5fa1,_0x166107){return function(_0x3d3046){if(_0x3d3046){var _0x198c89=typeof _0x166107[_0xc753('0x20')]===_0xc753('0x21')&&typeof _0x166107[_0xc753('0x22')]==='undefined';var _0x512db1=_0x3d3046['count'];var _0x4334ad=_0x198c89?0x0:_0x166107[_0xc753('0x20')];var _0x1e0cda=_0x198c89?_0x3d3046['count']:_0x166107[_0xc753('0x20')]+_0x166107[_0xc753('0x22')];var _0xaf3391;if(_0x1e0cda>=_0x512db1){_0x1e0cda=_0x512db1;_0xaf3391=0xc8;}else{_0xaf3391=0xce;}_0x1e5fa1[_0xc753('0x1d')](_0xaf3391);return _0x1e5fa1['set']('Content-Range',_0x4334ad+'-'+_0x1e0cda+'/'+_0x512db1)[_0xc753('0x1f')](_0x3d3046);}return null;};}function saveUpdates(_0x234b02){return function(_0x2b40e7){if(_0x2b40e7){return _0x2b40e7[_0xc753('0x23')](_0x234b02)[_0xc753('0x24')](function(_0xee9d7){return _0xee9d7;});}return null;};}function removeEntity(_0x2be1e0){return function(_0x149680){if(_0x149680){return _0x149680['destroy']()[_0xc753('0x24')](function(){var _0x3cafaf=_0x149680[_0xc753('0x25')]({'plain':!![]});var _0x2717aa=_0xc753('0x26');return db[_0xc753('0x27')][_0xc753('0x28')]({'where':{'type':_0x2717aa,'resourceId':_0x3cafaf['id']}})['then'](function(){return _0x149680;});})['then'](function(){_0x2be1e0[_0xc753('0x1d')](0xcc)[_0xc753('0x1e')]();});}};}function handleEntityNotFound(_0x59b0ef){return function(_0x1afd63){if(!_0x1afd63){_0x59b0ef[_0xc753('0x1c')](0x194);}return _0x1afd63;};}function handleError(_0x59dbad,_0x2d33fc){_0x2d33fc=_0x2d33fc||0x1f4;return function(_0x21b94b){logger[_0xc753('0x17')](_0x21b94b[_0xc753('0x29')]);if(_0x21b94b[_0xc753('0x2a')]){delete _0x21b94b[_0xc753('0x2a')];}_0x59dbad[_0xc753('0x1d')](_0x2d33fc)['send'](_0x21b94b);};}exports[_0xc753('0x2b')]=function(_0x349470,_0x5538a7){var _0x508a5e={'include':[{'model':db['Pause'],'as':_0xc753('0x2c')}]},_0x4b25c0={},_0x51b59e={'count':0x0,'rows':[]};var _0x593e55=_[_0xc753('0x2d')](db['ChatWebsite'][_0xc753('0x2e')],function(_0x3e3fc9){return{'name':_0x3e3fc9[_0xc753('0x2f')],'type':_0x3e3fc9[_0xc753('0x30')][_0xc753('0x31')]};});_0x4b25c0[_0xc753('0x32')]=_[_0xc753('0x2d')](_0x593e55,_0xc753('0x2a'));_0x4b25c0[_0xc753('0x33')]=_[_0xc753('0x34')](_0x349470['query']);_0x4b25c0['filters']=_[_0xc753('0x35')](_0x4b25c0['model'],_0x4b25c0['query']);_0x508a5e[_0xc753('0x36')]=_[_0xc753('0x35')](_0x4b25c0[_0xc753('0x32')],qs[_0xc753('0x37')](_0x349470[_0xc753('0x33')][_0xc753('0x37')]));_0x508a5e[_0xc753('0x36')]=_0x508a5e[_0xc753('0x36')]['length']?_0x508a5e[_0xc753('0x36')]:_0x4b25c0['model'];if(!_0x349470[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x508a5e[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x349470[_0xc753('0x33')][_0xc753('0x22')]);_0x508a5e[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x349470['query'][_0xc753('0x20')]);}_0x508a5e[_0xc753('0x3a')]=qs['sort'](_0x349470[_0xc753('0x33')]['sort']);_0x508a5e[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x349470[_0xc753('0x33')],_0x4b25c0[_0xc753('0x3c')]),_0x593e55);if(_0x349470['query'][_0xc753('0x3e')]){_0x508a5e[_0xc753('0x3b')]=_[_0xc753('0x3f')](_0x508a5e[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x593e55,function(_0x14291f){if(_0x14291f[_0xc753('0x30')]!=='VIRTUAL'){var _0x21ccdc={};_0x21ccdc[_0x14291f[_0xc753('0x2a')]]={'$like':'%'+_0x349470[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x21ccdc;}})});}_0x508a5e=_['merge']({},_0x508a5e,_0x349470[_0xc753('0x40')]);var _0xee8223={'where':_0x508a5e['where']};return db[_0xc753('0x41')][_0xc753('0x42')](_0xee8223)[_0xc753('0x24')](function(_0x586b5b){_0x51b59e['count']=_0x586b5b;if(_0x349470['query'][_0xc753('0x43')]){_0x508a5e['include']=[{'all':!![]}];}return db[_0xc753('0x41')]['findAll'](_0x508a5e);})['then'](function(_0x9157e8){_0x51b59e[_0xc753('0x44')]=_0x9157e8;return _0x51b59e;})[_0xc753('0x24')](respondWithFilteredResult(_0x5538a7,_0x508a5e))[_0xc753('0x1b')](handleError(_0x5538a7,null));};exports[_0xc753('0x45')]=function(_0x2d8ba5,_0x2e4002){var _0x345e4c={'raw':![],'where':{'id':_0x2d8ba5[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x47')],'as':_0xc753('0x2c')}]},_0xbb08c1={};_0xbb08c1[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x41')][_0xc753('0x2e')]);_0xbb08c1[_0xc753('0x33')]=_[_0xc753('0x34')](_0x2d8ba5[_0xc753('0x33')]);_0xbb08c1[_0xc753('0x3c')]=_[_0xc753('0x35')](_0xbb08c1[_0xc753('0x32')],_0xbb08c1['query']);_0x345e4c[_0xc753('0x36')]=_[_0xc753('0x35')](_0xbb08c1[_0xc753('0x32')],qs[_0xc753('0x37')](_0x2d8ba5['query'][_0xc753('0x37')]));_0x345e4c['attributes']=_0x345e4c['attributes'][_0xc753('0x48')]?_0x345e4c['attributes']:_0xbb08c1[_0xc753('0x32')];if(_0x2d8ba5[_0xc753('0x33')]['includeAll']){_0x345e4c[_0xc753('0x49')]=[{'all':!![]}];}_0x345e4c=_[_0xc753('0x3f')]({},_0x345e4c,_0x2d8ba5['options']);return db['ChatWebsite'][_0xc753('0x4a')](_0x345e4c)[_0xc753('0x24')](handleEntityNotFound(_0x2e4002,null))['then'](respondWithResult(_0x2e4002,null))['catch'](handleError(_0x2e4002,null));};exports['create']=function(_0x577294,_0x593d0d){return db['ChatWebsite'][_0xc753('0x4b')](_0x577294['body'],{})[_0xc753('0x24')](function(_0x34b311){var _0x1009d6=_0x577294[_0xc753('0x4c')]['get']({'plain':!![]});if(!_0x1009d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1009d6['role']===_0xc753('0x4c')){var _0x35858e=_0x34b311[_0xc753('0x25')]({'plain':!![]});var _0x273703='ChatWebsites';return db[_0xc753('0x4d')][_0xc753('0x4a')]({'where':{'name':_0x273703,'userProfileId':_0x1009d6['userProfileId']},'raw':!![]})[_0xc753('0x24')](function(_0x5a488e){if(_0x5a488e&&_0x5a488e[_0xc753('0x4e')]===0x0){return db[_0xc753('0x27')][_0xc753('0x4b')]({'name':_0x35858e['name'],'resourceId':_0x35858e['id'],'type':_0x5a488e['name'],'sectionId':_0x5a488e['id']},{})[_0xc753('0x24')](function(){return _0x34b311;});}else{return _0x34b311;}})[_0xc753('0x1b')](function(_0x51ee88){logger[_0xc753('0x17')](_0xc753('0x4f'),_0x51ee88);throw _0x51ee88;});}return _0x34b311;})[_0xc753('0x24')](respondWithResult(_0x593d0d,0xc9))[_0xc753('0x1b')](handleError(_0x593d0d,null));};exports[_0xc753('0x23')]=function(_0x215300,_0x311f0f){if(_0x215300[_0xc753('0x50')]['id']){delete _0x215300['body']['id'];}return db[_0xc753('0x41')]['find']({'where':{'id':_0x215300[_0xc753('0x46')]['id']},'include':[{'model':db['Pause'],'as':_0xc753('0x2c')}]})['then'](handleEntityNotFound(_0x311f0f,null))[_0xc753('0x24')](saveUpdates(_0x215300['body'],null))[_0xc753('0x24')](respondWithResult(_0x311f0f,null))[_0xc753('0x1b')](handleError(_0x311f0f,null));};exports[_0xc753('0x28')]=function(_0x4205ad,_0x476b60){return db[_0xc753('0x41')]['find']({'where':{'id':_0x4205ad[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x476b60,null))[_0xc753('0x24')](removeEntity(_0x476b60,null))[_0xc753('0x1b')](handleError(_0x476b60,null));};exports[_0xc753('0x51')]=function(_0x3b6af7,_0x77ea59){return db[_0xc753('0x41')]['describe']()[_0xc753('0x24')](respondWithResult(_0x77ea59,null))[_0xc753('0x1b')](handleError(_0x77ea59,null));};exports[_0xc753('0x52')]=function(_0x19ec52,_0x581137){if(_0x19ec52['body']['id']){delete _0x19ec52['body']['id'];}return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x19ec52[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x581137,null))[_0xc753('0x24')](function(_0xddf999){if(_0xddf999){_0x19ec52[_0xc753('0x50')][_0xc753('0x53')]=_0xddf999['id'];return db[_0xc753('0x54')][_0xc753('0x4b')](_0x19ec52[_0xc753('0x50')]);}})['then'](respondWithResult(_0x581137,null))[_0xc753('0x1b')](handleError(_0x581137,null));};exports['getDispositions']=function(_0x49bbde,_0x3b87cc){var _0x587656={'raw':![],'where':{}};var _0x50c40b={};var _0x161942={'count':0x0,'rows':[]};return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x49bbde[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b87cc,null))[_0xc753('0x24')](function(_0x13d1d6){if(_0x13d1d6){_0x50c40b[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x54')][_0xc753('0x2e')]);_0x50c40b[_0xc753('0x33')]=_[_0xc753('0x34')](_0x49bbde['query']);_0x50c40b[_0xc753('0x3c')]=_[_0xc753('0x35')](_0x50c40b['model'],_0x50c40b[_0xc753('0x33')]);_0x587656['attributes']=_[_0xc753('0x35')](_0x50c40b[_0xc753('0x32')],qs['fields'](_0x49bbde[_0xc753('0x33')][_0xc753('0x37')]));_0x587656[_0xc753('0x36')]=_0x587656[_0xc753('0x36')][_0xc753('0x48')]?_0x587656[_0xc753('0x36')]:_0x50c40b[_0xc753('0x32')];if(!_0x49bbde['query']['hasOwnProperty']('nolimit')){_0x587656[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x49bbde[_0xc753('0x33')][_0xc753('0x22')]);_0x587656[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x49bbde[_0xc753('0x33')][_0xc753('0x20')]);}_0x587656['order']=qs[_0xc753('0x56')](_0x49bbde[_0xc753('0x33')][_0xc753('0x56')]);_0x587656[_0xc753('0x3b')]=qs['filters'](_[_0xc753('0x3d')](_0x49bbde['query'],_0x50c40b['filters']));_0x587656[_0xc753('0x3b')][_0xc753('0x53')]=_0x13d1d6['id'];if(_0x49bbde[_0xc753('0x33')]['filter']){_0x587656['where']=_[_0xc753('0x3f')](_0x587656[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x587656[_0xc753('0x36')],function(_0x5b4784){var _0x101f11={};_0x101f11[_0x5b4784]={'$like':'%'+_0x49bbde[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x101f11;})});}_0x587656=_[_0xc753('0x3f')]({},_0x587656,_0x49bbde[_0xc753('0x40')]);return db[_0xc753('0x54')]['count']({'where':_0x587656[_0xc753('0x3b')]})['then'](function(_0x534422){_0x161942[_0xc753('0x42')]=_0x534422;if(_0x49bbde[_0xc753('0x33')][_0xc753('0x43')]){_0x587656[_0xc753('0x49')]=[{'all':!![]}];}return db[_0xc753('0x54')][_0xc753('0x57')](_0x587656);})[_0xc753('0x24')](function(_0x535a57){_0x161942['rows']=_0x535a57;return _0x161942;});}})['then'](respondWithFilteredResult(_0x3b87cc,_0x587656))[_0xc753('0x1b')](handleError(_0x3b87cc,null));};exports[_0xc753('0x58')]=function(_0x570fb3,_0x53b520){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x570fb3[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x53b520,null))['then'](function(_0x42db37){if(_0x42db37){return _0x42db37[_0xc753('0x58')](_0x570fb3[_0xc753('0x33')][_0xc753('0x59')]);}})['then'](respondWithStatusCode(_0x53b520,null))[_0xc753('0x1b')](handleError(_0x53b520,null));};exports[_0xc753('0x5a')]=function(_0x51eee9,_0x373f78){if(_0x51eee9[_0xc753('0x50')]['id']){delete _0x51eee9[_0xc753('0x50')]['id'];}return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x51eee9[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x373f78,null))[_0xc753('0x24')](function(_0x36bb37){if(_0x36bb37){_0x51eee9[_0xc753('0x50')][_0xc753('0x53')]=_0x36bb37['id'];return db[_0xc753('0x5b')]['create'](_0x51eee9[_0xc753('0x50')]);}})[_0xc753('0x24')](respondWithResult(_0x373f78,null))[_0xc753('0x1b')](handleError(_0x373f78,null));};exports['getAnswers']=function(_0x4ee865,_0x199aa8){var _0x2437f4={'raw':![],'where':{}};var _0x1c63cb={};var _0x39eff5={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x4ee865[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x199aa8,null))['then'](function(_0x4014d6){if(_0x4014d6){_0x1c63cb[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x5b')][_0xc753('0x2e')]);_0x1c63cb[_0xc753('0x33')]=_[_0xc753('0x34')](_0x4ee865['query']);_0x1c63cb[_0xc753('0x3c')]=_['intersection'](_0x1c63cb[_0xc753('0x32')],_0x1c63cb[_0xc753('0x33')]);_0x2437f4[_0xc753('0x36')]=_[_0xc753('0x35')](_0x1c63cb['model'],qs[_0xc753('0x37')](_0x4ee865[_0xc753('0x33')][_0xc753('0x37')]));_0x2437f4[_0xc753('0x36')]=_0x2437f4[_0xc753('0x36')][_0xc753('0x48')]?_0x2437f4[_0xc753('0x36')]:_0x1c63cb['model'];if(!_0x4ee865[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x2437f4[_0xc753('0x22')]=qs['limit'](_0x4ee865[_0xc753('0x33')][_0xc753('0x22')]);_0x2437f4['offset']=qs[_0xc753('0x20')](_0x4ee865['query'][_0xc753('0x20')]);}_0x2437f4[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x4ee865[_0xc753('0x33')][_0xc753('0x56')]);_0x2437f4[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x4ee865[_0xc753('0x33')],_0x1c63cb[_0xc753('0x3c')]));_0x2437f4['where'][_0xc753('0x53')]=_0x4014d6['id'];if(_0x4ee865[_0xc753('0x33')][_0xc753('0x3e')]){_0x2437f4[_0xc753('0x3b')]=_['merge'](_0x2437f4['where'],{'$or':_[_0xc753('0x2d')](_0x2437f4[_0xc753('0x36')],function(_0x92321e){var _0x624c1a={};_0x624c1a[_0x92321e]={'$like':'%'+_0x4ee865['query'][_0xc753('0x3e')]+'%'};return _0x624c1a;})});}_0x2437f4=_[_0xc753('0x3f')]({},_0x2437f4,_0x4ee865[_0xc753('0x40')]);return db['CannedAnswer'][_0xc753('0x42')]({'where':_0x2437f4[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x16c8ed){_0x39eff5[_0xc753('0x42')]=_0x16c8ed;if(_0x4ee865[_0xc753('0x33')]['includeAll']){_0x2437f4['include']=[{'all':!![]}];}return db[_0xc753('0x5b')][_0xc753('0x57')](_0x2437f4);})[_0xc753('0x24')](function(_0x4df94e){_0x39eff5[_0xc753('0x44')]=_0x4df94e;return _0x39eff5;});}})[_0xc753('0x24')](respondWithFilteredResult(_0x199aa8,_0x2437f4))['catch'](handleError(_0x199aa8,null));};exports[_0xc753('0x5c')]=function(_0x1e6411,_0x51bcb1){return db['ChatWebsite']['find']({'where':{'id':_0x1e6411[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x51bcb1,null))[_0xc753('0x24')](function(_0x4dfd93){if(_0x4dfd93){return _0x4dfd93[_0xc753('0x5c')](_0x1e6411[_0xc753('0x33')][_0xc753('0x59')]);}})['then'](respondWithStatusCode(_0x51bcb1,null))[_0xc753('0x1b')](handleError(_0x51bcb1,null));};exports[_0xc753('0x5d')]=function(_0x2ad6fd,_0x387ea6){_0x2ad6fd[_0xc753('0x50')][_0xc753('0x5e')]=_0x2ad6fd['file'][_0xc753('0x5f')];return db['ChatWebsite']['find']({'where':{'id':_0x2ad6fd['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x387ea6,null))[_0xc753('0x24')](saveUpdates(_0x2ad6fd[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x387ea6,null))['catch'](handleError(_0x387ea6,null));};exports[_0xc753('0x60')]=function(_0x4038a6,_0x50463b){_0x4038a6[_0xc753('0x50')][_0xc753('0x61')]=_0x4038a6['file'][_0xc753('0x5f')];return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x4038a6[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x50463b,null))['then'](saveUpdates(_0x4038a6[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x50463b,null))[_0xc753('0x1b')](handleError(_0x50463b,null));};exports[_0xc753('0x62')]=function(_0x2d2b9f,_0x2062a7){_0x2d2b9f[_0xc753('0x50')][_0xc753('0x63')]=_0x2d2b9f['file'][_0xc753('0x5f')];return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x2d2b9f['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x2062a7,null))[_0xc753('0x24')](saveUpdates(_0x2d2b9f[_0xc753('0x50')],null))['then'](respondWithResult(_0x2062a7,null))[_0xc753('0x1b')](handleError(_0x2062a7,null));};exports[_0xc753('0x64')]=function(_0x1beded,_0x5a1df3){_0x1beded[_0xc753('0x50')][_0xc753('0x65')]=_0x1beded[_0xc753('0x66')]['filename'];return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x1beded[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x5a1df3,null))[_0xc753('0x24')](saveUpdates(_0x1beded[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x5a1df3,null))[_0xc753('0x1b')](handleError(_0x5a1df3,null));};exports[_0xc753('0x67')]=function(_0x1fbccd,_0x1bd03d){var _0x31f5d5=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x6a'));var _0x5b3968={'where':{'id':_0x1fbccd[_0xc753('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x531e12=![];return require(_0xc753('0x6b'))[_0xc753('0x6c')]()[_0xc753('0x24')](function(_0x2f3c22){if(_0x2f3c22){_0x531e12=_0x2f3c22[_0xc753('0x6d')];}})['then'](function(){return db[_0xc753('0x41')][_0xc753('0x4a')](_0x5b3968);})['then'](handleEntityNotFound(_0x1bd03d,null))[_0xc753('0x24')](function(_0x587dc9){if(_0x587dc9){if(!_['isNil'](_0x587dc9[_0xc753('0x5e')])){if(fs['existsSync'](path['join'](config[_0xc753('0x69')],_0xc753('0x6e'),_0x587dc9[_0xc753('0x5e')]))&&_0x531e12){_0x31f5d5=path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/images/logos/',_0x587dc9[_0xc753('0x5e')]);}}return _0x1bd03d[_0xc753('0x6f')](_0x31f5d5);}})[_0xc753('0x1b')](handleError(_0x1bd03d,null));};exports[_0xc753('0x70')]=function(_0x173915,_0x5493a7){var _0x1db273=path[_0xc753('0x68')](config['root'],_0xc753('0x71'));var _0x25f4bb={'where':{'id':_0x173915[_0xc753('0x46')]['id']},'attributes':['id',_0xc753('0x61')],'raw':!![]};return db['ChatWebsite']['find'](_0x25f4bb)[_0xc753('0x24')](handleEntityNotFound(_0x5493a7,null))[_0xc753('0x24')](function(_0x16838f){if(_0x16838f){if(!_[_0xc753('0x72')](_0x16838f[_0xc753('0x61')])){if(fs['existsSync'](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x16838f['agentAvatar']))){_0x1db273=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x16838f[_0xc753('0x61')]);}}return _0x5493a7[_0xc753('0x6f')](_0x1db273);}})[_0xc753('0x1b')](handleError(_0x5493a7,null));};exports['getCustomerAvatar']=function(_0x5bb74b,_0x20c34f){var _0x88b8fe=path['join'](config[_0xc753('0x69')],_0xc753('0x74'));var _0x267ace={'where':{'id':_0x5bb74b[_0xc753('0x46')]['id']},'attributes':['id',_0xc753('0x63'),_0xc753('0x75')],'raw':!![]};return db['ChatWebsite'][_0xc753('0x4a')](_0x267ace)[_0xc753('0x24')](handleEntityNotFound(_0x20c34f,null))['then'](function(_0x34bc98){if(_0x34bc98){if(!_['isNil'](_0x34bc98[_0xc753('0x63')])){if(fs[_0xc753('0x76')](path[_0xc753('0x68')](config['root'],'server/files/images/avatars/',_0x34bc98[_0xc753('0x63')]))&&_0x34bc98[_0xc753('0x75')]){_0x88b8fe=path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/images/avatars/',_0x34bc98[_0xc753('0x63')]);}}return _0x20c34f['download'](_0x88b8fe);}})[_0xc753('0x1b')](handleError(_0x20c34f,null));};exports[_0xc753('0x77')]=function(_0x1fbc2b,_0x486a34){var _0x57b917=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x78'));var _0x5ac792={'where':{'id':_0x1fbc2b[_0xc753('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xc753('0x41')]['find'](_0x5ac792)[_0xc753('0x24')](handleEntityNotFound(_0x486a34,null))[_0xc753('0x24')](function(_0x25e9d9){if(_0x25e9d9){if(!_[_0xc753('0x72')](_0x25e9d9[_0xc753('0x65')])){if(fs[_0xc753('0x76')](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x25e9d9['systemAvatar']))){_0x57b917=path[_0xc753('0x68')](config['root'],_0xc753('0x73'),_0x25e9d9[_0xc753('0x65')]);}}return _0x486a34[_0xc753('0x6f')](_0x57b917);}})['catch'](handleError(_0x486a34,null));};exports['notify']=function(_0x2bcc7d,_0x158306){var _0x27e5ae=require(_0xc753('0x79'));var _0x48c506=new _0x27e5ae();var _0x1def3b=_0x48c506[_0xc753('0x7a')](_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x7c')])['getResult']();var _0x304877={'body':_0x2bcc7d[_0xc753('0x50')],'channel':_0xc753('0x7d')};var _0x1fd009=[];var _0x225780=[];var _0x418ba0={};var _0x51d25c=![];return db['CmContact'][_0xc753('0x51')]()[_0xc753('0x24')](function(_0x57b57a){if(!_0x57b57a){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0x80'));}_0x1fd009=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x57b57a),[_0xc753('0x82'),_0xc753('0x83')]);_0x225780=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x57b57a),['createdAt',_0xc753('0x83'),'CompanyId',_0xc753('0x84')]);if(_0x2bcc7d[_0xc753('0x50')]['id']){delete _0x2bcc7d[_0xc753('0x50')]['id'];}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')][_0xc753('0x85')])){throw new db[(_0xc753('0x7e'))]['ValidationError'](_0xc753('0x86'));}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')][_0xc753('0x50')])||_0x2bcc7d[_0xc753('0x50')][_0xc753('0x50')]===''){throw new db[(_0xc753('0x7e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')]['mapKey'])){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x225780);}if(!_[_0xc753('0x87')](_0x225780,_0x2bcc7d[_0xc753('0x50')]['mapKey'])){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0x88')+_0x225780);}_0x418ba0[_0x2bcc7d[_0xc753('0x50')]['mapKey']]=_0x2bcc7d['body'][_0xc753('0x85')];})[_0xc753('0x24')](function(){return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x2bcc7d[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x89')],'as':_0xc753('0x8a'),'include':[{'model':db['CmContact'],'as':_0xc753('0x8b'),'where':_0x418ba0,'limit':0x1,'order':[['updatedAt',_0xc753('0x8c')]]}]},{'model':db[_0xc753('0x8d')],'as':_0xc753('0x8e')}]});})[_0xc753('0x24')](handleEntityNotFound(_0x158306,null))[_0xc753('0x24')](function(_0x1d8d10){if(_0x1d8d10&&_0x1d8d10['List']){_0x304877[_0xc753('0x8f')]=_0x1d8d10;_0x304877[_0xc753('0x90')]=_0x1d8d10[_0xc753('0x8e')];_0x304877[_0xc753('0x91')]=_0x1d8d10[_0xc753('0x8a')];_0x304877[_0xc753('0x90')]=_[_0xc753('0x92')](_0x304877[_0xc753('0x90')],['priority'],[_0xc753('0x93')]);if(_0x304877[_0xc753('0x8f')][_0xc753('0x8e')]){delete _0x304877[_0xc753('0x8f')][_0xc753('0x8e')];}if(_0x304877[_0xc753('0x8f')][_0xc753('0x8a')]&&_0x304877[_0xc753('0x8f')][_0xc753('0x8a')][_0xc753('0x8b')][_0xc753('0x48')]){return _0x304877['account'][_0xc753('0x8a')]['Contacts'][0x0];}var _0x5b1dd0=_[_0xc753('0xb')](_0x2bcc7d[_0xc753('0x50')],{'firstName':_0x2bcc7d[_0xc753('0x50')][_0xc753('0x85')],'ListId':_0x1d8d10[_0xc753('0x84')]});_0x5b1dd0[_0x2bcc7d[_0xc753('0x50')][_0xc753('0x94')]]=_0x2bcc7d['body']['from'];return db['CmContact']['create'](_0x5b1dd0,{'fields':_0x1fd009,'raw':!![]});}})['then'](handleEntityNotFound(_0x158306,null))[_0xc753('0x24')](function(_0x54d87d){_0x304877[_0xc753('0x95')]=_0x54d87d;var _0x5936f5=_0x2bcc7d[_0xc753('0x50')][_0xc753('0x96')];if(_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x97')]){_0x5936f5=_0x2bcc7d[_0xc753('0x7b')]['cf-connecting-ip'];}else if(_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x98')]){_0x5936f5=_[_0xc753('0x99')](_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x98')][_0xc753('0x9a')](','));}if(_0x54d87d){var _0x59bd7b={'ContactId':_0x54d87d['id'],'ChatWebsiteId':_0x2bcc7d[_0xc753('0x46')]['id'],'from':(_0x54d87d['firstName']||'')+'\x20'+(_0x54d87d[_0xc753('0x9b')]||''),'customerIp':_0x5936f5,'customerPort':_0x2bcc7d[_0xc753('0x7b')]['x-real-port']?_0x2bcc7d[_0xc753('0x7b')]['x-real-port']:null,'referer':_0x2bcc7d['body']['referer'],'browserName':_0x1def3b[_0xc753('0x9c')][_0xc753('0x2a')]&&_0x1def3b[_0xc753('0x9c')][_0xc753('0x9d')]?util[_0xc753('0x9e')]('%s\x20%s',_0x1def3b[_0xc753('0x9c')][_0xc753('0x2a')],_0x1def3b[_0xc753('0x9c')]['version']):_0xc753('0x9f'),'browserVersion':_0x1def3b[_0xc753('0x9c')]['version']||_0xc753('0x9f'),'osName':util[_0xc753('0x9e')](_0xc753('0xa0'),_0x1def3b['os'][_0xc753('0x2a')],_0x1def3b['os'][_0xc753('0x9d')]),'osVersion':_0x1def3b['os'][_0xc753('0x9d')],'deviceModel':_0x1def3b['device']['model']&&_0x1def3b[_0xc753('0xa1')][_0xc753('0xa2')]?util[_0xc753('0x9e')](_0xc753('0xa3'),_0x1def3b['device'][_0xc753('0x32')],_0x1def3b[_0xc753('0xa1')][_0xc753('0xa2')],_0x1def3b[_0xc753('0xa1')]['type']):null,'deviceVendor':_0x1def3b[_0xc753('0xa1')]['vendor'],'deviceType':_0x1def3b[_0xc753('0xa1')][_0xc753('0x30')],'formData':JSON['stringify'](_0x2bcc7d[_0xc753('0x50')])};var _0xb90ecf={'ChatWebsiteId':_0x2bcc7d['params']['id'],'closed':![]};if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]){_0xb90ecf[_0xc753('0xa4')]=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')];return db[_0xc753('0xa5')]['find']({'where':_0xb90ecf})[_0xc753('0x24')](function(_0x5b5cb5){if(_0x5b5cb5){return[_0x5b5cb5,![]];}_0x59bd7b[_0xc753('0xa4')]=_0x2bcc7d['body'][_0xc753('0xa4')];_0x59bd7b['externalUrl']=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa6')];return db['ChatInteraction']['create'](_0x59bd7b)[_0xc753('0x24')](function(_0xb7b079){return[_0xb7b079,!![]];});});}_0xb90ecf[_0xc753('0xa7')]=_0x54d87d['id'];if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]['id']){_0xb90ecf['id']=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]['id'];return db[_0xc753('0xa5')]['find']({'where':_0xb90ecf})[_0xc753('0x24')](function(_0x34f18c){if(_0x34f18c){return[_0x34f18c,![]];}return db['ChatInteraction'][_0xc753('0x4b')](_0x59bd7b)[_0xc753('0x24')](function(_0x260885){return[_0x260885,!![]];});});}return db[_0xc753('0xa5')][_0xc753('0x4b')](_0x59bd7b)[_0xc753('0x24')](function(_0xf78c65){return[_0xf78c65,!![]];});}})[_0xc753('0xa9')](function(_0x1e279c,_0x39ead2){if(_0x1e279c){_0x51d25c=_0x39ead2;if(!_0x39ead2){var _0x3c4a8c={'from':(_0x304877[_0xc753('0x95')][_0xc753('0xaa')]||'')+'\x20'+(_0x304877[_0xc753('0x95')][_0xc753('0x9b')]||'')};if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xab')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]!=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xab')]){_0x3c4a8c[_0xc753('0xa4')]=_0x2bcc7d['body'][_0xc753('0xab')];}return _0x1e279c[_0xc753('0x23')](_0x3c4a8c);}else{return _0x1e279c;}}})[_0xc753('0x24')](function(_0x557afc){_0x304877[_0xc753('0xa8')]=_0x557afc['get']({'plain':!![]});_0x304877[_0xc753('0xa8')][_0xc753('0xac')]=_0x51d25c;if(_0x304877['interaction']['created']){if(_0x304877[_0xc753('0x8f')][_0xc753('0xad')]){_0x304877[_0xc753('0x90')][_0xc753('0xae')]({'id':0x0,'priority':_0x304877[_0xc753('0x90')][_0xc753('0x48')]+0x1,'app':_0xc753('0xaf'),'appdata':_0xc753('0xb0'),'interval':'*,*,*,*'});}}return db[_0xc753('0xb1')][_0xc753('0x4b')]({'body':_0x2bcc7d[_0xc753('0x50')]['body'],'ChatWebsiteId':_0x2bcc7d[_0xc753('0x46')]['id'],'ChatInteractionId':_0x557afc['id'],'direction':'in','ContactId':_0x304877['contact']['id'],'AttachmentId':_0x2bcc7d[_0xc753('0x50')][_0xc753('0xb2')]});})['then'](function(_0x18ea19){_0x304877['message']=_0x18ea19;if(_0x304877[_0xc753('0xa8')][_0xc753('0xb3')]){return db[_0xc753('0xb4')][_0xc753('0x4a')]({'attributes':['id',_0xc753('0x2a')],'where':{'id':_0x304877[_0xc753('0xa8')][_0xc753('0xb3')]}})[_0xc753('0x24')](function(_0x175711){if(_0x175711){_0x304877[_0xc753('0x90')][_0xc753('0xb5')]({'id':0x0,'priority':0x0,'app':_0xc753('0xb6'),'appdata':_0x175711['name']+','+(_0x304877[_0xc753('0x8f')][_0xc753('0xb7')]||0xa),'interval':'*,*,*,*'});_0x304877[_0xc753('0xb8')]=!![];}return respondWithRpcPromise(_0xc753('0xb9'),_0xc753('0xba'),_0x304877);});}return respondWithRpcPromise(_0xc753('0xb9'),_0xc753('0xba'),_0x304877);})[_0xc753('0x24')](function(_0x195e50){respondWithRpcPromise(_0xc753('0xbb'),'EventManager',{'event':_0xc753('0xbc'),'message':_0x195e50},client9002);return _0x195e50;})[_0xc753('0x24')](respondWithResult(_0x158306,null))[_0xc753('0x1b')](handleError(_0x158306,null));};exports['offline']=function(_0x5681ba,_0x330f36){var _0x385b62,_0x2b90a8,_0x4efcbb;var _0x2b8a15=[];var _0x504596={};var _0x50dd48=_0x5681ba[_0xc753('0xbd')]||[];var _0x453799=[];var _0x411d41;return db[_0xc753('0xbe')][_0xc753('0x51')]()[_0xc753('0x24')](function(_0x426ce7){if(!_0x426ce7){throw new db['Sequelize'][(_0xc753('0x7f'))](_0xc753('0x80'));}_0x2b8a15=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x426ce7),[_0xc753('0x82'),_0xc753('0x83'),'CompanyId',_0xc753('0x84')]);if(_0x5681ba[_0xc753('0x50')]['id']){delete _0x5681ba['body']['id'];}if(_[_0xc753('0x72')](_0x5681ba[_0xc753('0x50')]['from'])){throw _0x330f36['status'](0x1f4)[_0xc753('0xbf')](new db['Sequelize']['ValidationError'](_0xc753('0x86')));}if(_['isNil'](_0x5681ba[_0xc753('0x50')][_0xc753('0x50')])||_0x5681ba[_0xc753('0x50')]['body']===''){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0xc0')));}if(_[_0xc753('0x72')](_0x5681ba[_0xc753('0x50')]['mapKeyOffline'])){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))]['ValidationError'](_0xc753('0xc1')+_0x2b8a15));}if(!_[_0xc753('0x87')](_0x2b8a15,_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')])){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0xc3')+_0x2b8a15));}_0x504596[_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')]]=_0x5681ba['body'][_0xc753('0x85')];})['then'](function(){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x5681ba[_0xc753('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0xc753('0x8a')},{'model':db[_0xc753('0xc4')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x330f36,null))[_0xc753('0x24')](function(_0x594942){if(_0x594942&&_0x594942[_0xc753('0x8a')]){_0x2b90a8=_0x594942;var _0x58b8dd=_[_0xc753('0xb')](_0x5681ba[_0xc753('0x50')],{'firstName':_0x5681ba['body'][_0xc753('0x85')],'phone':_0x5681ba[_0xc753('0x50')][_0xc753('0x85')],'ListId':_0x594942[_0xc753('0x84')]});_0x58b8dd[_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')]]=_0x5681ba['body'][_0xc753('0x85')];return db[_0xc753('0xbe')]['findOrCreate']({'where':_0x504596,'defaults':_0x58b8dd});}})[_0xc753('0xa9')](function(_0x1e2120){if(_0x1e2120){_0x4efcbb=_0x1e2120;var _0x4e1d22=fs[_0xc753('0xc5')](path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0xc753('0xc6'));var _0x3c9a39=ejs[_0xc753('0xc7')](_0x4e1d22,{'body':_[_0xc753('0xc8')](_0x5681ba[_0xc753('0x50')][_0xc753('0x50')]),'bodyTitle':_0x2b90a8['offlineMessageBody']});return db[_0xc753('0xc9')][_0xc753('0x4b')]({'body':_0x3c9a39,'ContactId':_0x1e2120['id'],'ChatWebsiteId':_0x2b90a8['id']});}})[_0xc753('0x24')](function(_0x524374){_0x411d41=_0x524374;if(_0x50dd48['length']){var _0x338922=_0x50dd48['map'](function(_0x2099a0){return{'name':_0x2099a0[_0xc753('0xca')],'basename':_0x2099a0[_0xc753('0x5f')],'type':_0x2099a0[_0xc753('0xcb')],'ChatOfflineMessageId':_0x524374['id']};});_0x453799=_0x338922['map'](_0x39a050=>{var _0x27b9e2={'filename':_0x39a050['name'],'path':path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0xcc'),'files',_0xc753('0xcd'),'offline-chat',_0x39a050[_0xc753('0xce')])};return _0x27b9e2;});if(!_0x2b90a8['openNewInteraction']){return db[_0xc753('0xcf')]['transaction'](function(_0x381896){return db[_0xc753('0xd0')][_0xc753('0xd1')](_0x338922,{'transaction':_0x381896});});}}})[_0xc753('0x24')](function(){if(_0x411d41){_0x385b62=_0x411d41;return db[_0xc753('0xc4')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xc753('0xd2')],'as':_0xc753('0xd3'),'raw':!![]}]});}})['then'](function(_0x6b74c9){if(_0x6b74c9&&_0x6b74c9[_0xc753('0xd3')]&&_0x2b90a8[_0xc753('0xd4')]&&_0x2b90a8[_0xc753('0xd5')]){var _0x333233={'tls':{'rejectUnauthorized':![]}};if(_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd6')]){_0x333233[_0xc753('0xd6')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd6')];}else{_0x333233[_0xc753('0xd7')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd7')];_0x333233[_0xc753('0xd8')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd8')];_0x333233[_0xc753('0xd9')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd9')];}if(_0x6b74c9[_0xc753('0xd3')][_0xc753('0xda')]){_0x333233['auth']={'user':_0x6b74c9[_0xc753('0xd3')][_0xc753('0x4c')],'pass':_0x6b74c9[_0xc753('0xd3')][_0xc753('0xdb')]};}return respondWithRpcPromise(_0xc753('0xdc'),_0xc753('0xdd'),{'account':_0x333233,'message':{'from':util[_0xc753('0x9e')](_0xc753('0xde'),_0x6b74c9['name'],_0x6b74c9[_0xc753('0xdf')]||_0x6b74c9[_0xc753('0xd3')][_0xc753('0x4c')]),'to':_0x2b90a8['forwardOfflineAddress'],'subject':_0x2b90a8[_0xc753('0xe0')],'html':_0x385b62['body'],'attachments':_0x453799}},client9003)[_0xc753('0x24')](function(){return _0x385b62;})[_0xc753('0x1b')](function(_0xccb20d){console[_0xc753('0x17')](_0xccb20d);});}})[_0xc753('0x24')](function(){if(_0x2b90a8&&_0x2b90a8['openNewInteraction']&&_0x2b90a8[_0xc753('0xe1')]){var _0x376a2c=[];if(_0x50dd48[_0xc753('0x48')]){_0x376a2c=_0x50dd48[_0xc753('0x2d')](function(_0x4f9fcc){return{'name':_0x4f9fcc['originalname'],'basename':_0x4f9fcc[_0xc753('0x5f')],'type':_0x4f9fcc[_0xc753('0xcb')],'ChatOfflineMessageId':_0x411d41['id']};});}var _0x538af7;if(!_[_0xc753('0x72')](_0x2b90a8[_0xc753('0xe2')])){var _0x426e85=_[_0xc753('0x2d')](_0x5681ba['body'],function(_0x2a1302){return _0x2a1302;});var _0x5aff08=_[_0xc753('0xe3')](_0x426e85)[0x0];var _0x5390f5=_[_0xc753('0xe4')](_0x5aff08,function(_0x428878){return _0x428878;});_0x538af7=_0x5390f5[0x1][_0x2b90a8[_0xc753('0xe2')]];}var _0x152b2e={'from':_0x4efcbb[_0xc753('0xdf')],'firstName':_0x4efcbb[_0xc753('0xaa')],'lastName':_0x4efcbb[_0xc753('0x9b')],'mapKey':_0xc753('0xdf'),'message':{'from':_0x4efcbb[_0xc753('0xdf')],'to':_0x2b90a8[_0xc753('0xc4')][_0xc753('0xdf')],'cc':'','subject':_['isNil'](_0x538af7)?_0x2b90a8[_0xc753('0xe0')]:_0x538af7,'messageId':'','sentAt':new Date(),'attach':_0x376a2c[_0xc753('0x48')],'attachments':_0x376a2c,'originChannel':_0xc753('0xe5'),'ChatWebsiteId':_0x2b90a8['id'],'ChatOfflineMessageId':_0x385b62['id'],'originTo':_0x2b90a8[_0xc753('0xc4')][_0xc753('0xdf')]},'body':_0x385b62[_0xc753('0x50')]};var _0x72dc47={'account':{'id':_0x2b90a8[_0xc753('0xe1')]},'body':_0x152b2e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc753('0xe6'),_0xc753('0xe7'),_0x72dc47,client9001)[_0xc753('0x24')](function(){return _0x385b62;})['catch'](function(_0xc7a2f5){console[_0xc753('0x17')](_0xc7a2f5);});}return;})['then'](function(){if(_0x385b62){return _0x385b62;}})['then'](respondWithResult(_0x330f36,null))[_0xc753('0x1b')](function(_0x21a518){console[_0xc753('0x17')]('catch',_0x21a518);for(var _0x348b1c of _0x50dd48){var _0x44c7ca=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0xcc'),_0xc753('0xbd'),_0xc753('0xcd'),_0xc753('0xe8'),_0x348b1c['filename']);fs_extra[_0xc753('0xe9')](_0x44c7ca)[_0xc753('0x1b')](function(_0x5e0ff0){console[_0xc753('0x17')]('Could\x20not\x20remove\x20attachment\x20file',_0x44c7ca,_0x5e0ff0);});}});};exports[_0xc753('0xea')]=function(_0x457d48,_0x18b299){return db[_0xc753('0xa5')]['find']({'where':{'id':_0x457d48[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x18b299,null))['then'](function(_0x5a6d29){if(_0x5a6d29){return _0x5a6d29[_0xc753('0xea')](_0x457d48[_0xc753('0x50')][_0xc753('0x59')],_[_0xc753('0xeb')](_0x457d48[_0xc753('0x50')],[_0xc753('0x59'),'id'])||{});}})['then'](respondWithResult(_0x18b299,null))[_0xc753('0x1b')](handleError(_0x18b299,null));};exports[_0xc753('0xec')]=function(_0x1e9589,_0x41f8f7){var _0x366533={'raw':![],'where':{}};var _0x36eb9a={};var _0x43832b={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x1e9589['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x41f8f7,null))[_0xc753('0x24')](function(_0x1f5108){if(_0x1f5108){_0x36eb9a['model']=_[_0xc753('0x34')](db['ChatInteraction']['rawAttributes']);_0x36eb9a[_0xc753('0x33')]=_[_0xc753('0x34')](_0x1e9589[_0xc753('0x33')]);_0x36eb9a[_0xc753('0x3c')]=_['intersection'](_0x36eb9a[_0xc753('0x32')],_0x36eb9a['query']);_0x366533[_0xc753('0x36')]=_[_0xc753('0x35')](_0x36eb9a[_0xc753('0x32')],qs[_0xc753('0x37')](_0x1e9589[_0xc753('0x33')]['fields']));_0x366533['attributes']=_0x366533[_0xc753('0x36')][_0xc753('0x48')]?_0x366533['attributes']:_0x36eb9a[_0xc753('0x32')];if(!_0x1e9589[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x366533[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x1e9589[_0xc753('0x33')][_0xc753('0x22')]);_0x366533[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x1e9589['query'][_0xc753('0x20')]);}_0x366533[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x1e9589[_0xc753('0x33')][_0xc753('0x56')]);_0x366533[_0xc753('0x3b')]=qs['filters'](_['pick'](_0x1e9589['query'],_0x36eb9a[_0xc753('0x3c')]));_0x366533[_0xc753('0x3b')][_0xc753('0x53')]=_0x1f5108['id'];if(_0x1e9589[_0xc753('0x33')][_0xc753('0x3e')]){_0x366533[_0xc753('0x3b')]=_[_0xc753('0x3f')](_0x366533[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x366533[_0xc753('0x36')],function(_0x45c532){var _0x2cabf2={};_0x2cabf2[_0x45c532]={'$like':'%'+_0x1e9589['query'][_0xc753('0x3e')]+'%'};return _0x2cabf2;})});}_0x366533=_[_0xc753('0x3f')]({},_0x366533,_0x1e9589[_0xc753('0x40')]);return db[_0xc753('0xa5')][_0xc753('0x42')]({'where':_0x366533[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x19dd4c){_0x43832b['count']=_0x19dd4c;if(_0x1e9589[_0xc753('0x33')][_0xc753('0x43')]){_0x366533['include']=[{'model':db[_0xc753('0xbe')],'as':_0xc753('0xed'),'required':![]},{'model':db['User'],'as':_0xc753('0xee'),'attributes':[_0xc753('0x2a'),_0xc753('0xef'),_0xc753('0xf0')],'required':![]},{'model':db[_0xc753('0xf1')],'as':_0xc753('0xf2'),'attributes':['id',_0xc753('0x2a'),_0xc753('0xf3')],'where':_0x1e9589['query'][_0xc753('0xf4')]?{'id':_0x1e9589[_0xc753('0x33')][_0xc753('0xf4')]}:undefined,'required':_0x1e9589[_0xc753('0x33')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xc753('0x57')](_0x366533);})[_0xc753('0x24')](function(_0x992e18){_0x43832b[_0xc753('0x44')]=_0x992e18;return _0x43832b;});}})['then'](respondWithFilteredResult(_0x41f8f7,_0x366533))[_0xc753('0x1b')](handleError(_0x41f8f7,null));};function iftimePromise(_0x210318,_0x1b058e){return respondWithRpcPromise(_0xc753('0xf5'),_0xc753('0xf6'),{'command':_0x1b058e[_0xc753('0xf7')]?util[_0xc753('0x9e')](_0xc753('0xf8'),_0x210318[_0xc753('0xf9')],_0x1b058e[_0xc753('0xf7')]):util[_0xc753('0x9e')]('iftime\x20%s',_0x210318[_0xc753('0xf9')])},client9002)[_0xc753('0x24')](function(_0x2d3428){var _0x49d0df=_0x2d3428&&_0x2d3428[_0xc753('0xfa')](_0xc753('0xfb'))>=0x0?!![]:![];logger[_0xc753('0x12')](_0xc753('0xfc'),_0x1b058e['id'],_0x210318['id'],_0x210318[_0xc753('0xf9')],_0x49d0df?_0xc753('0xfd'):'OFFLINE',_0x1b058e[_0xc753('0xf7')]?_0x1b058e['timezone']:_0xc753('0xfe'));return _0x49d0df;})[_0xc753('0x1b')](function(_0x9f38c){logger['error'](_0xc753('0xfc'),_0x1b058e['id'],_0x210318['id'],_0x210318[_0xc753('0xf9')],util[_0xc753('0xff')](_0x9f38c,{'showHidden':![],'depth':null}),_0x1b058e[_0xc753('0xf7')]?_0x1b058e['timezone']:'No\x20timezone');return![];});}exports[_0xc753('0xf6')]=function(_0x3a780b,_0x111046){var _0x10b0b8=0x0;var _0x4bbcb9=0x0;var _0x17d3de=![];var _0x36f9cd;var _0x2303ac;return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x3a780b[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x100')],'as':_0xc753('0x100'),'include':[{'model':db[_0xc753('0x100')],'as':_0xc753('0x101'),'attributes':['id',_0xc753('0xf9')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x111046,null))['then'](function(_0xaead9a){if(_0xaead9a){_0x36f9cd=_0xaead9a;return _0xaead9a['getProactiveActions']({'raw':!![]});}})['then'](function(_0xf1fc27){if(_0x36f9cd){if(_0xf1fc27){_0x2303ac=_0xf1fc27;}}return require(_0xc753('0x6b'))[_0xc753('0x6c')]();})[_0xc753('0x24')](function(_0x1a2712){if(_0x1a2712){_0x4bbcb9=_0x1a2712[_0xc753('0x102')];_0x17d3de=_0x1a2712['custom'];}})['then'](function(){return db[_0xc753('0xa5')][_0xc753('0x42')]({'where':{'closed':![]}});})['then'](function(_0xe6a64a){_0x10b0b8=_0xe6a64a;if(_0x4bbcb9&&_0xe6a64a>_0x4bbcb9){return db[_0xc753('0x103')][_0xc753('0x55')]({'where':{'id':0x1}})[_0xc753('0x24')](function(_0x379531){if(_0x379531){_0x379531[_0xc753('0x104')](_0xc753('0x105'));}});}})[_0xc753('0x24')](function(){if(_0x36f9cd[_0xc753('0x100')]&&_0x36f9cd[_0xc753('0x100')]['Intervals']){var _0x4f6787=[];for(var _0x20460b=0x0;_0x20460b<_0x36f9cd['Interval'][_0xc753('0x101')][_0xc753('0x48')];_0x20460b++){var _0xe90d89=_0x36f9cd[_0xc753('0x100')]['Intervals'][_0x20460b]['get']({'plain':!![]});_0x4f6787['push'](iftimePromise(_0xe90d89,_0x36f9cd));}return BPromise[_0xc753('0x106')](_0x4f6787)[_0xc753('0x24')](function(_0x320c4f){return _['some'](_0x320c4f);});}else{return!![];}})[_0xc753('0x24')](function(_0x1857bb){var _0x4e7f45=fs[_0xc753('0xc5')](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x107')),'utf8');var _0x14b7ea={'remote':_0x36f9cd['remote'],'query':querystring[_0xc753('0x16')](_[_0xc753('0x3f')](_0x36f9cd[_0xc753('0x25')]({'plain':!![]}),{'customerIp':_0x3a780b[_0xc753('0x7b')][_0xc753('0x98')]||_0x3a780b[_0xc753('0x7b')]['x-real-ip']||_0x3a780b['connection'][_0xc753('0x108')]||_0x3a780b['ip'],'referer':_0x3a780b[_0xc753('0x7b')]['referer'],'openedInteractions':_0x10b0b8,'maxInteractions':_0x4bbcb9,'virtual':_0x17d3de['virtual'],'online':_0x1857bb,'custom':_0x17d3de}))[_0xc753('0x109')](/'/g,'\x5c\x27')};_0x111046[_0xc753('0xbf')](ejs[_0xc753('0xc7')](Mustache['render'](_0x4e7f45,_0x14b7ea),{'proactiveActions':_0x2303ac,'alignment':_0x36f9cd[_0xc753('0x10a')],'verticalAlignment':_0x36f9cd[_0xc753('0x10b')],'div_color':_0x36f9cd[_0xc753('0xf3')],'labelText':_0x36f9cd[_0xc753('0x10c')],'text_color':_0x36f9cd[_0xc753('0x10d')],'button_color':_0x36f9cd[_0xc753('0x10e')],'background_color':_0x36f9cd['backgroundColor']}));})[_0xc753('0x1b')](handleError(_0x111046,null));};exports['addApplications']=function(_0x102248,_0x91abf4){var _0x164359=_0x102248[_0xc753('0x46')]['id'];var _0x41a850=_0x102248[_0xc753('0x50')];var _0xba8a0c=0xc8;var _0x3cafd2=null;return db[_0xc753('0xcf')][_0xc753('0x10f')]({'isolationLevel':db[_0xc753('0xcf')][_0xc753('0x110')][_0xc753('0x111')]['READ_COMMITTED']},function(_0x19008b){return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x164359},'transaction':_0x19008b})[_0xc753('0x24')](function(_0x3c4ebd){if(_0x3c4ebd){return db[_0xc753('0x8d')][_0xc753('0x28')]({'where':{'ChatWebsiteId':_0x164359},'transaction':_0x19008b})[_0xc753('0x24')](function(){var _0x310819=_[_0xc753('0x2d')](_0x41a850,function(_0x8b0ef4){_0x8b0ef4['ChatWebsiteId']=_0x164359;return _0x8b0ef4;});return db[_0xc753('0x8d')][_0xc753('0xd1')](_0x310819,{'transaction':_0x19008b});});}else{_0xba8a0c=0x194;_0x3cafd2=[];}});})[_0xc753('0x24')](function(){if(_0xba8a0c!==0x194){return db['ChatApplication'][_0xc753('0x112')]({'where':{'ChatWebsiteId':_0x164359},'order':_0xc753('0x113')})['then'](function(_0x380a28){_0x3cafd2=_0x380a28;});}})[_0xc753('0x1b')](function(_0x5a000e){_0xba8a0c=0x1f4;logger[_0xc753('0x17')](_0x5a000e[_0xc753('0x29')]);if(_0x5a000e[_0xc753('0x2a')]){delete _0x5a000e['name'];}_0x3cafd2=_0x5a000e;})[_0xc753('0x114')](function(){if(_0x3cafd2===null){_0x91abf4[_0xc753('0x1c')](_0xba8a0c);}else{if(_0xba8a0c===0x1f4){_0x91abf4[_0xc753('0x1d')](_0xba8a0c)['send'](_0x3cafd2);}else{_0x91abf4['status'](_0xba8a0c)[_0xc753('0x1f')](_0x3cafd2);}}});};exports[_0xc753('0x115')]=function(_0x895c39,_0x14488d){var _0x5b9474={};var _0x7c6642={};var _0xf61e01;var _0x439a07;return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x895c39[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x14488d,null))[_0xc753('0x24')](function(_0x29ea30){if(_0x29ea30){_0xf61e01=_0x29ea30;_0x7c6642[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x8d')][_0xc753('0x2e')]);_0x7c6642['query']=_[_0xc753('0x34')](_0x895c39[_0xc753('0x33')]);_0x7c6642['filters']=_[_0xc753('0x35')](_0x7c6642[_0xc753('0x32')],_0x7c6642['query']);_0x5b9474[_0xc753('0x36')]=_[_0xc753('0x35')](_0x7c6642[_0xc753('0x32')],qs['fields'](_0x895c39['query'][_0xc753('0x37')]));_0x5b9474['attributes']=_0x5b9474['attributes'][_0xc753('0x48')]?_0x5b9474['attributes']:_0x7c6642[_0xc753('0x32')];_0x5b9474[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x895c39['query'][_0xc753('0x56')]);_0x5b9474[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_['pick'](_0x895c39['query'],_0x7c6642['filters']));if(_0x895c39[_0xc753('0x33')]['filter']){_0x5b9474['where']=_['merge'](_0x5b9474[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x5b9474[_0xc753('0x36')],function(_0x8ef140){var _0x488b35={};_0x488b35[_0x8ef140]={'$like':'%'+_0x895c39[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x488b35;})});}_0x5b9474=_[_0xc753('0x3f')]({},_0x5b9474,_0x895c39[_0xc753('0x40')]);return _0xf61e01[_0xc753('0x115')](_0x5b9474);}})[_0xc753('0x24')](function(_0x499fc9){if(_0x499fc9){_0x439a07=_0x499fc9[_0xc753('0x48')];if(!_0x895c39[_0xc753('0x33')][_0xc753('0x38')]('nolimit')){_0x5b9474[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x895c39['query'][_0xc753('0x22')]);_0x5b9474['offset']=qs[_0xc753('0x20')](_0x895c39[_0xc753('0x33')][_0xc753('0x20')]);}return _0xf61e01[_0xc753('0x115')](_0x5b9474);}})[_0xc753('0x24')](function(_0x5ed6a7){if(_0x5ed6a7){return _0x5ed6a7?{'count':_0x439a07,'rows':_0x5ed6a7}:null;}})[_0xc753('0x24')](respondWithResult(_0x14488d,null))['catch'](handleError(_0x14488d,null));};exports['addProactiveActions']=function(_0x4bbd26,_0x3d367b){return db['chatProactiveAction'][_0xc753('0x4a')]({'where':{'id':_0x4bbd26[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x3d367b,null))[_0xc753('0x24')](function(_0x21891d){if(_0x21891d){return _0x21891d[_0xc753('0x116')](_0x4bbd26[_0xc753('0x50')][_0xc753('0x59')],_['omit'](_0x4bbd26[_0xc753('0x50')],['ids','id'])||{});}})[_0xc753('0x24')](respondWithResult(_0x3d367b,null))[_0xc753('0x1b')](handleError(_0x3d367b,null));};exports['getProactiveActions']=function(_0x34f68c,_0x3cafa1){var _0x1a73ee={};var _0x1fde30={};var _0x49dba3;var _0x56d96f;return db['ChatWebsite']['findOne']({'where':{'id':_0x34f68c[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x3cafa1,null))[_0xc753('0x24')](function(_0x2f5724){if(_0x2f5724){_0x49dba3=_0x2f5724;_0x1fde30[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x117')][_0xc753('0x2e')]);_0x1fde30[_0xc753('0x33')]=_['keys'](_0x34f68c[_0xc753('0x33')]);_0x1fde30['filters']=_[_0xc753('0x35')](_0x1fde30[_0xc753('0x32')],_0x1fde30[_0xc753('0x33')]);_0x1a73ee[_0xc753('0x36')]=_[_0xc753('0x35')](_0x1fde30[_0xc753('0x32')],qs[_0xc753('0x37')](_0x34f68c[_0xc753('0x33')][_0xc753('0x37')]));_0x1a73ee[_0xc753('0x36')]=_0x1a73ee[_0xc753('0x36')][_0xc753('0x48')]?_0x1a73ee[_0xc753('0x36')]:_0x1fde30[_0xc753('0x32')];_0x1a73ee['order']=qs['sort'](_0x34f68c[_0xc753('0x33')][_0xc753('0x56')]);_0x1a73ee[_0xc753('0x3b')]=qs['filters'](_[_0xc753('0x3d')](_0x34f68c['query'],_0x1fde30[_0xc753('0x3c')]));if(_0x34f68c[_0xc753('0x33')][_0xc753('0x3e')]){_0x1a73ee['where']=_[_0xc753('0x3f')](_0x1a73ee[_0xc753('0x3b')],{'$or':_['map'](_0x1a73ee[_0xc753('0x36')],function(_0x110aff){var _0x3832e6={};_0x3832e6[_0x110aff]={'$like':'%'+_0x34f68c[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x3832e6;})});}_0x1a73ee=_[_0xc753('0x3f')]({},_0x1a73ee,_0x34f68c[_0xc753('0x40')]);return _0x49dba3[_0xc753('0x118')](_0x1a73ee);}})[_0xc753('0x24')](function(_0x2e77a4){if(_0x2e77a4){_0x56d96f=_0x2e77a4['length'];if(!_0x34f68c['query'][_0xc753('0x38')](_0xc753('0x39'))){_0x1a73ee[_0xc753('0x22')]=qs['limit'](_0x34f68c[_0xc753('0x33')][_0xc753('0x22')]);_0x1a73ee['offset']=qs[_0xc753('0x20')](_0x34f68c[_0xc753('0x33')][_0xc753('0x20')]);}return _0x49dba3[_0xc753('0x118')](_0x1a73ee);}})[_0xc753('0x24')](function(_0x25f2bc){if(_0x25f2bc){return _0x25f2bc?{'count':_0x56d96f,'rows':_0x25f2bc}:null;}})[_0xc753('0x24')](respondWithResult(_0x3cafa1,null))['catch'](handleError(_0x3cafa1,null));};exports[_0xc753('0x119')]=function(_0x332daf,_0x522574){var _0x1bc5ea=_0x332daf['query']['online']===_0xc753('0x11a')?_0xc753('0x11b'):_0xc753('0x11c');return db[_0xc753('0x41')]['find']({'attributes':['id',_0x1bc5ea],'where':{'id':_0x332daf['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x522574,null))[_0xc753('0x24')](function(_0x3165a1){if(_0x3165a1){var _0x49793e=_0x3165a1[_0x1bc5ea];var _0x4da69e=_0x49793e&&_0x49793e[_0xc753('0x11d')]?_0x49793e[_0xc753('0x11d')]:[];_0x522574[_0xc753('0xbf')]({'fromKey':_['isNil'](_0x49793e[_0xc753('0x11e')])?undefined:_0x49793e[_0xc753('0x11e')],'count':_0x4da69e[_0xc753('0x48')],'rows':_0x4da69e});}})['catch'](handleError(_0x522574,null));};exports['getOfflineMessages']=function(_0x424e65,_0x254460){var _0x44e4bc={'raw':![],'where':{}};var _0x56d089={};var _0x2f6207={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x424e65['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x254460,null))[_0xc753('0x24')](function(_0x475771){if(_0x475771){_0x56d089[_0xc753('0x32')]=_[_0xc753('0x34')](db['ChatOfflineMessage']['rawAttributes']);_0x56d089[_0xc753('0x33')]=_['keys'](_0x424e65['query']);_0x56d089[_0xc753('0x3c')]=_['intersection'](_0x56d089[_0xc753('0x32')],_0x56d089[_0xc753('0x33')]);_0x44e4bc['attributes']=_[_0xc753('0x35')](_0x56d089[_0xc753('0x32')],qs[_0xc753('0x37')](_0x424e65[_0xc753('0x33')][_0xc753('0x37')]));_0x44e4bc[_0xc753('0x36')]=_0x44e4bc[_0xc753('0x36')][_0xc753('0x48')]?_0x44e4bc[_0xc753('0x36')]:_0x56d089[_0xc753('0x32')];if(!_0x424e65[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x44e4bc[_0xc753('0x22')]=qs['limit'](_0x424e65[_0xc753('0x33')]['limit']);_0x44e4bc[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x424e65['query']['offset']);}_0x44e4bc['order']=qs[_0xc753('0x56')](_0x424e65[_0xc753('0x33')][_0xc753('0x56')]);_0x44e4bc[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x424e65[_0xc753('0x33')],_0x56d089[_0xc753('0x3c')]));_0x44e4bc[_0xc753('0x3b')][_0xc753('0x53')]=_0x475771['id'];if(_0x424e65[_0xc753('0x33')][_0xc753('0x3e')]){_0x44e4bc['where']=_[_0xc753('0x3f')](_0x44e4bc[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x44e4bc[_0xc753('0x36')],function(_0x5593dd){var _0x56bb53={};_0x56bb53[_0x5593dd]={'$like':'%'+_0x424e65['query'][_0xc753('0x3e')]+'%'};return _0x56bb53;})});}_0x44e4bc=_[_0xc753('0x3f')]({},_0x44e4bc,_0x424e65[_0xc753('0x40')]);return db[_0xc753('0xc9')][_0xc753('0x42')]({'where':_0x44e4bc[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x4e16eb){_0x2f6207['count']=_0x4e16eb;if(_0x424e65[_0xc753('0x33')][_0xc753('0x43')]){_0x44e4bc[_0xc753('0x49')]=[{'all':!![]}];}else{_0x44e4bc[_0xc753('0x49')]=[{'model':db[_0xc753('0xbe')],'as':'Contact','required':![]},{'model':db[_0xc753('0xd0')],'as':_0xc753('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xc753('0x57')](_0x44e4bc);})[_0xc753('0x24')](function(_0xb54e8){_0x2f6207[_0xc753('0x44')]=_0xb54e8;return _0x2f6207;});}})[_0xc753('0x24')](respondWithFilteredResult(_0x254460,_0x44e4bc))[_0xc753('0x1b')](handleError(_0x254460,null));};exports[_0xc753('0x120')]=function(_0x16cb4f,_0x1b7a4c){return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x16cb4f[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x1b7a4c,null))[_0xc753('0x24')](function(_0x539bd9){if(_0x539bd9){return _0x539bd9['addAgents'](_0x16cb4f[_0xc753('0x50')][_0xc753('0x59')],_[_0xc753('0xeb')](_0x16cb4f[_0xc753('0x50')],[_0xc753('0x59'),'id'])||{})[_0xc753('0xa9')](function(_0xb050a1){for(var _0x47793c=0x0;_0x47793c<_0x16cb4f['body']['ids'][_0xc753('0x48')];_0x47793c+=0x1){socket[_0xc753('0x121')](_0xc753('0x122'),{'UserId':Number(_0x16cb4f['body'][_0xc753('0x59')][_0x47793c]),'ChatWebsiteId':Number(_0x16cb4f[_0xc753('0x46')]['id'])});}return _0xb050a1;});}})['then'](respondWithResult(_0x1b7a4c,null))['catch'](handleError(_0x1b7a4c,null));};exports['removeAgents']=function(_0x2a3974,_0x2cc29f){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x2a3974[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cc29f,null))[_0xc753('0x24')](function(_0x333e94){if(_0x333e94){return _0x333e94[_0xc753('0x123')](_0x2a3974['query'][_0xc753('0x59')])[_0xc753('0x24')](function(){if(_[_0xc753('0x124')](_0x2a3974[_0xc753('0x33')][_0xc753('0x59')])){for(var _0x20471d=0x0;_0x20471d<_0x2a3974[_0xc753('0x33')][_0xc753('0x59')][_0xc753('0x48')];_0x20471d+=0x1){socket['emit'](_0xc753('0x125'),{'UserId':Number(_0x2a3974[_0xc753('0x33')][_0xc753('0x59')][_0x20471d]),'ChatWebsiteId':Number(_0x2a3974['params']['id'])});}}else{socket[_0xc753('0x121')](_0xc753('0x125'),{'UserId':Number(_0x2a3974[_0xc753('0x33')]['ids']),'ChatWebsiteId':Number(_0x2a3974[_0xc753('0x46')]['id'])});}});}})[_0xc753('0x24')](respondWithStatusCode(_0x2cc29f,null))['catch'](handleError(_0x2cc29f,null));};exports['getAgents']=function(_0x2eae06,_0x3047fe){var _0x255c65={};var _0x351946={};var _0x5d357d;var _0x11368f;return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x2eae06['params']['id']}})['then'](handleEntityNotFound(_0x3047fe,null))['then'](function(_0x644f1a){if(_0x644f1a){_0x5d357d=_0x644f1a;_0x351946[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0xb4')][_0xc753('0x2e')]);_0x351946[_0xc753('0x33')]=_['keys'](_0x2eae06[_0xc753('0x33')]);_0x351946[_0xc753('0x3c')]=_[_0xc753('0x35')](_0x351946[_0xc753('0x32')],_0x351946['query']);_0x255c65['attributes']=_[_0xc753('0x35')](_0x351946['model'],qs[_0xc753('0x37')](_0x2eae06[_0xc753('0x33')][_0xc753('0x37')]));_0x255c65['attributes']=_0x255c65[_0xc753('0x36')]['length']?_0x255c65[_0xc753('0x36')]:_0x351946['model'];_0x255c65[_0xc753('0x3a')]=qs['sort'](_0x2eae06['query']['sort']);_0x255c65[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x2eae06[_0xc753('0x33')],_0x351946['filters']));if(_0x2eae06[_0xc753('0x33')][_0xc753('0x3e')]){_0x255c65['where']=_['merge'](_0x255c65[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x255c65[_0xc753('0x36')],function(_0x56a341){var _0x22f8f6={};_0x22f8f6[_0x56a341]={'$like':'%'+_0x2eae06[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x22f8f6;})});}_0x255c65=_[_0xc753('0x3f')]({},_0x255c65,_0x2eae06['options']);return _0x5d357d[_0xc753('0x126')](_0x255c65);}})['then'](function(_0x4e0886){if(_0x4e0886){_0x11368f=_0x4e0886['length'];if(!_0x2eae06[_0xc753('0x33')]['hasOwnProperty'](_0xc753('0x39'))){_0x255c65[_0xc753('0x22')]=qs['limit'](_0x2eae06[_0xc753('0x33')][_0xc753('0x22')]);_0x255c65[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x2eae06[_0xc753('0x33')][_0xc753('0x20')]);}return _0x5d357d['getAgents'](_0x255c65);}})[_0xc753('0x24')](function(_0x55f97b){if(_0x55f97b){return _0x55f97b?{'count':_0x11368f,'rows':_0x55f97b}:null;}})[_0xc753('0x24')](respondWithResult(_0x3047fe,null))[_0xc753('0x1b')](handleError(_0x3047fe,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5dbbb78..c66db95 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 _0x6631=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x288788,_0x13b561){var _0x71cb99=function(_0x2d2b6e){while(--_0x2d2b6e){_0x288788['push'](_0x288788['shift']());}};_0x71cb99(++_0x13b561);}(_0x6631,0x134));var _0x1663=function(_0x148bc3,_0x56c8bc){_0x148bc3=_0x148bc3-0x0;var _0x440ddb=_0x6631[_0x148bc3];return _0x440ddb;};'use strict';var EventEmitter=require(_0x1663('0x0'));var ChatWebsite=require(_0x1663('0x1'))['db'][_0x1663('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1663('0x3')](0x0);var events={'afterCreate':_0x1663('0x4'),'afterUpdate':_0x1663('0x5'),'afterDestroy':'remove'};function emitEvent(_0x492d72){return function(_0x1e2fcc,_0x232bfe,_0x2b5af7){ChatWebsiteEvents[_0x1663('0x6')](_0x492d72+':'+_0x1e2fcc['id'],_0x1e2fcc);ChatWebsiteEvents[_0x1663('0x6')](_0x492d72,_0x1e2fcc);_0x2b5af7(null);};}for(var e in events){if(events[_0x1663('0x7')](e)){var event=events[e];ChatWebsite[_0x1663('0x8')](e,emitEvent(event));}}module[_0x1663('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe799=['events','ChatWebsite','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x57664a,_0x3267d4){var _0x3d33ab=function(_0x465711){while(--_0x465711){_0x57664a['push'](_0x57664a['shift']());}};_0x3d33ab(++_0x3267d4);}(_0xe799,0x170));var _0x9e79=function(_0x506b74,_0x1b5e55){_0x506b74=_0x506b74-0x0;var _0x2de602=_0xe799[_0x506b74];return _0x2de602;};'use strict';var EventEmitter=require(_0x9e79('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x9e79('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e79('0x2'),'afterUpdate':_0x9e79('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34a40e){return function(_0x3f0a4f,_0x809ffd,_0x4cfc04){ChatWebsiteEvents[_0x9e79('0x4')](_0x34a40e+':'+_0x3f0a4f['id'],_0x3f0a4f);ChatWebsiteEvents['emit'](_0x34a40e,_0x3f0a4f);_0x4cfc04(null);};}for(var e in events){if(events[_0x9e79('0x5')](e)){var event=events[e];ChatWebsite[_0x9e79('0x6')](e,emitEvent(event));}}module[_0x9e79('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 11145dd..1c93888 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 _0x226e=['bluebird','request-promise','path','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x7c3e6e,_0x4d7763){var _0x37915a=function(_0x3c4c98){while(--_0x3c4c98){_0x7c3e6e['push'](_0x7c3e6e['shift']());}};_0x37915a(++_0x4d7763);}(_0x226e,0x189));var _0xe226=function(_0x14f552,_0x385ce3){_0x14f552=_0x14f552-0x0;var _0x549e86=_0x226e[_0x14f552];return _0x549e86;};'use strict';var _=require(_0xe226('0x0'));var util=require(_0xe226('0x1'));var logger=require(_0xe226('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe226('0x3'));var rp=require(_0xe226('0x4'));var fs=require('fs');var path=require(_0xe226('0x5'));var rimraf=require('rimraf');var config=require(_0xe226('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xe226('0x7')]=function(_0x512856,_0x9be9e4){return _0x512856[_0xe226('0x8')](_0xe226('0x9'),attributes,{'tableName':_0xe226('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c1f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5c1f,0x8d));var _0xf5c1=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0x5c1f[_0x2c3255];return _0x282aba;};'use strict';var _=require(_0xf5c1('0x0'));var util=require(_0xf5c1('0x1'));var logger=require('../../config/logger')(_0xf5c1('0x2'));var moment=require(_0xf5c1('0x3'));var BPromise=require(_0xf5c1('0x4'));var rp=require(_0xf5c1('0x5'));var fs=require('fs');var path=require(_0xf5c1('0x6'));var rimraf=require(_0xf5c1('0x7'));var config=require(_0xf5c1('0x8'));var attributes=require('./chatWebsite.attributes');module[_0xf5c1('0x9')]=function(_0x20c1ce,_0x2fb75c){return _0x20c1ce[_0xf5c1('0xa')](_0xf5c1('0xb'),attributes,{'tableName':_0xf5c1('0xc'),'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 1bc4846..cf18dfc 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 _0xcb98=['./chatWebsite.socket','register','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0xcb98,0x1e0));var _0x8cb9=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xcb98[_0x3afe18];return _0x19ed1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cb9('0x0'));var BPromise=require(_0x8cb9('0x1'));var rs=require(_0x8cb9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb9('0x3'))['db'];var utils=require(_0x8cb9('0x4'));var logger=require(_0x8cb9('0x5'))(_0x8cb9('0x6'));var config=require(_0x8cb9('0x7'));var jayson=require(_0x8cb9('0x8'));var client=jayson[_0x8cb9('0x9')][_0x8cb9('0xa')]({'port':0x232a});config[_0x8cb9('0xb')]=_[_0x8cb9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8cb9('0xd'))(new Redis(config[_0x8cb9('0xb')]));require(_0x8cb9('0xe'))[_0x8cb9('0xf')](socket);function respondWithRpcPromise(_0x477c09,_0x105056,_0x890e38){return new BPromise(function(_0x590d48,_0xdb4036){return client[_0x8cb9('0x10')](_0x477c09,_0x890e38)[_0x8cb9('0x11')](function(_0x4604ee){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x105056,_0x8cb9('0x12'));logger['debug'](_0x8cb9('0x13'),_0x105056,_0x8cb9('0x12'),JSON[_0x8cb9('0x14')](_0x4604ee));if(_0x4604ee[_0x8cb9('0x15')]){if(_0x4604ee['error']['code']===0x1f4){logger[_0x8cb9('0x15')](_0x8cb9('0x16'),_0x105056,_0x4604ee[_0x8cb9('0x15')][_0x8cb9('0x17')]);return _0xdb4036(_0x4604ee[_0x8cb9('0x15')][_0x8cb9('0x17')]);}logger[_0x8cb9('0x15')](_0x8cb9('0x16'),_0x105056,_0x4604ee['error'][_0x8cb9('0x17')]);return _0x590d48(_0x4604ee['error'][_0x8cb9('0x17')]);}else{logger[_0x8cb9('0x18')](_0x8cb9('0x16'),_0x105056,_0x8cb9('0x12'));_0x590d48(_0x4604ee['result'][_0x8cb9('0x17')]);}})[_0x8cb9('0x19')](function(_0x10655b){logger[_0x8cb9('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x105056,_0x10655b);_0xdb4036(_0x10655b);});});} \ No newline at end of file +var _0x75f8=['info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','request','then'];(function(_0x19c821,_0x74eeec){var _0x4e0faf=function(_0x415170){while(--_0x415170){_0x19c821['push'](_0x19c821['shift']());}};_0x4e0faf(++_0x74eeec);}(_0x75f8,0x142));var _0x875f=function(_0x2ffbce,_0x3b242d){_0x2ffbce=_0x2ffbce-0x0;var _0xd8005b=_0x75f8[_0x2ffbce];return _0xd8005b;};'use strict';var _=require(_0x875f('0x0'));var util=require(_0x875f('0x1'));var moment=require(_0x875f('0x2'));var BPromise=require(_0x875f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x875f('0x4'));var db=require(_0x875f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x875f('0x6'))('rpc');var config=require(_0x875f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x875f('0x8')]({'port':0x232a});config[_0x875f('0x9')]=_[_0x875f('0xa')](config[_0x875f('0x9')],{'host':_0x875f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x875f('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5c3a51,_0x19774d,_0x274476){return new BPromise(function(_0x1aca5e,_0x488fdf){return client[_0x875f('0xc')](_0x5c3a51,_0x274476)[_0x875f('0xd')](function(_0x2b5bdb){logger[_0x875f('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x19774d,'request\x20sent');logger[_0x875f('0xf')](_0x875f('0x10'),_0x19774d,_0x875f('0x11'),JSON['stringify'](_0x2b5bdb));if(_0x2b5bdb[_0x875f('0x12')]){if(_0x2b5bdb[_0x875f('0x12')][_0x875f('0x13')]===0x1f4){logger[_0x875f('0x12')](_0x875f('0x14'),_0x19774d,_0x2b5bdb['error']['message']);return _0x488fdf(_0x2b5bdb['error'][_0x875f('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x19774d,_0x2b5bdb['error']['message']);return _0x1aca5e(_0x2b5bdb['error'][_0x875f('0x15')]);}else{logger['info'](_0x875f('0x14'),_0x19774d,_0x875f('0x11'));_0x1aca5e(_0x2b5bdb[_0x875f('0x16')][_0x875f('0x15')]);}})[_0x875f('0x17')](function(_0x3b9d0c){logger['error'](_0x875f('0x14'),_0x19774d,_0x3b9d0c);_0x488fdf(_0x3b9d0c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 82067ac..05270b2 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 _0x239f=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x239f,0x15b));var _0xf239=function(_0x1ff925,_0x4f8b30){_0x1ff925=_0x1ff925-0x0;var _0x2cd901=_0x239f[_0x1ff925];return _0x2cd901;};'use strict';var ChatWebsiteEvents=require(_0xf239('0x0'));var events=[_0xf239('0x1'),_0xf239('0x2'),_0xf239('0x3')];function createListener(_0x58a367,_0x378fe6){return function(_0x1bca08){_0x378fe6[_0xf239('0x4')](_0x58a367,_0x1bca08);};}function removeListener(_0x1927cb,_0x112d15){return function(){ChatWebsiteEvents[_0xf239('0x5')](_0x1927cb,_0x112d15);};}exports[_0xf239('0x6')]=function(_0xb9178c){for(var _0x2aad67=0x0,_0x499a33=events['length'];_0x2aad67<_0x499a33;_0x2aad67++){var _0x193908=events[_0x2aad67];var _0x1d7cce=createListener(_0xf239('0x7')+_0x193908,_0xb9178c);ChatWebsiteEvents['on'](_0x193908,_0x1d7cce);}}; \ No newline at end of file +var _0xfe8f=['save','remove','emit','removeListener','./chatWebsite.events'];(function(_0x22e902,_0x2f3c51){var _0x1f54cb=function(_0x321c17){while(--_0x321c17){_0x22e902['push'](_0x22e902['shift']());}};_0x1f54cb(++_0x2f3c51);}(_0xfe8f,0x1c1));var _0xffe8=function(_0x13f923,_0x42ea82){_0x13f923=_0x13f923-0x0;var _0x1b03be=_0xfe8f[_0x13f923];return _0x1b03be;};'use strict';var ChatWebsiteEvents=require(_0xffe8('0x0'));var events=[_0xffe8('0x1'),_0xffe8('0x2'),'update'];function createListener(_0x56e49b,_0x5f07ec){return function(_0x33e27b){_0x5f07ec[_0xffe8('0x3')](_0x56e49b,_0x33e27b);};}function removeListener(_0x341350,_0x254e8e){return function(){ChatWebsiteEvents[_0xffe8('0x4')](_0x341350,_0x254e8e);};}exports['register']=function(_0x47e7d8){for(var _0x1090ce=0x0,_0x240d30=events['length'];_0x1090ce<_0x240d30;_0x1090ce++){var _0x5b796c=events[_0x1090ce];var _0x176c83=createListener('chatWebsite:'+_0x5b796c,_0x47e7d8);ChatWebsiteEvents['on'](_0x5b796c,_0x176c83);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2929303..97e5352 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 _0xac3a=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','create','addDisposition','diskStorage','join','root','server/files/images/logos/','originalname','post','/:id/logo','single','addLogo','format','%s-%s','now','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getSnippet','/:id/applications','getApplications'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0xac3a,0xfb));var _0xaac3=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0xac3a[_0x54de5d];return _0x1b349e;};'use strict';var multer=require(_0xaac3('0x0'));var util=require(_0xaac3('0x1'));var path=require(_0xaac3('0x2'));var timeout=require('connect-timeout');var express=require(_0xaac3('0x3'));var router=express[_0xaac3('0x4')]();var fs_extra=require(_0xaac3('0x5'));var auth=require(_0xaac3('0x6'));var interaction=require(_0xaac3('0x7'));var config=require(_0xaac3('0x8'));var controller=require(_0xaac3('0x9'));router[_0xaac3('0xa')]('/',auth[_0xaac3('0xb')](),controller['index']);router['get']('/describe',auth[_0xaac3('0xb')](),controller['describe']);router[_0xaac3('0xa')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller['show']);router['get'](_0xaac3('0xd'),auth[_0xaac3('0xb')](),controller[_0xaac3('0xe')]);router[_0xaac3('0xa')](_0xaac3('0xf'),auth[_0xaac3('0xb')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0xaac3('0xa')](_0xaac3('0x10'),controller[_0xaac3('0x11')]);router[_0xaac3('0xa')](_0xaac3('0x12'),controller[_0xaac3('0x13')]);router['get'](_0xaac3('0x14'),controller['getSystemAvatar']);router[_0xaac3('0xa')](_0xaac3('0x15'),auth[_0xaac3('0xb')](),controller['getInteractions']);router[_0xaac3('0xa')]('/:id/snippet',controller[_0xaac3('0x16')]);router[_0xaac3('0xa')](_0xaac3('0x17'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x18')]);router[_0xaac3('0xa')](_0xaac3('0x19'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x1a')]);router[_0xaac3('0xa')](_0xaac3('0x1b'),controller[_0xaac3('0x1c')]);router[_0xaac3('0xa')](_0xaac3('0x1d'),auth[_0xaac3('0xb')](),controller['getOfflineMessages']);router[_0xaac3('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xaac3('0x1e')]);router['post'](_0xaac3('0xd'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x1f')]);router['post']('/:id/canned_answers',auth[_0xaac3('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x305409,_0x5d1258,_0x14fd67){_0x14fd67(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],_0xaac3('0x23')));},'filename':function(_0x365afa,_0x45b0f1,_0x236a0d){_0x236a0d(null,util['format']('%s-%s',Date['now'](),_0x45b0f1[_0xaac3('0x24')]));}})});router[_0xaac3('0x25')](_0xaac3('0x26'),upload[_0xaac3('0x27')]('file'),controller[_0xaac3('0x28')]);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x2e99e2,_0x53edd0,_0x439c13){_0x439c13(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],'server/files/images/avatars/'));},'filename':function(_0x3872d8,_0xd7469,_0x56e921){_0x56e921(null,util[_0xaac3('0x29')](_0xaac3('0x2a'),Date[_0xaac3('0x2b')](),_0xd7469['originalname']));}})});router[_0xaac3('0x25')]('/:id/avatar',upload[_0xaac3('0x27')](_0xaac3('0x2c')),controller[_0xaac3('0x2d')]);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x4deb9a,_0x285a24,_0x1027aa){_0x1027aa(null,path['join'](config[_0xaac3('0x22')],_0xaac3('0x2e')));},'filename':function(_0x206b2e,_0x8fc907,_0x5e14e1){_0x5e14e1(null,util[_0xaac3('0x29')]('%s-%s',Date[_0xaac3('0x2b')](),_0x8fc907[_0xaac3('0x24')]));}})});router[_0xaac3('0x25')](_0xaac3('0x12'),upload[_0xaac3('0x27')](_0xaac3('0x2c')),controller[_0xaac3('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x234577,_0x151e84,_0x60623a){_0x60623a(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],'server/files/images/avatars/'));},'filename':function(_0x57d934,_0x12b9a5,_0x4957a6){_0x4957a6(null,util[_0xaac3('0x29')]('%s-%s',Date['now'](),_0x12b9a5[_0xaac3('0x24')]));}})});router['post'](_0xaac3('0x14'),upload['single']('file'),controller[_0xaac3('0x30')]);router[_0xaac3('0x25')](_0xaac3('0x31'),controller[_0xaac3('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x22fb06,_0x37f7d8,_0x45ab47){const _0xab57cd=path[_0xaac3('0x21')](config[_0xaac3('0x22')],_0xaac3('0x33'),_0xaac3('0x34'),_0xaac3('0x35'));fs_extra[_0xaac3('0x36')](_0xab57cd,function(){_0x45ab47(null,_0xab57cd);});},'filename':function(_0x1113e5,_0x5cdfd8,_0x86413f){const _0xbef213=_0x5cdfd8[_0xaac3('0x24')][_0xaac3('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x380ff9=path[_0xaac3('0x38')](_0xbef213);const _0x4d3da0=Date['now']()+'-'+_0xbef213[_0xaac3('0x37')](_0x380ff9,'')+_0x380ff9;_0x86413f(null,_0x4d3da0);}})});router[_0xaac3('0x25')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xaac3('0x39')]);router['post'](_0xaac3('0x15'),auth[_0xaac3('0xb')](),controller['addInteraction']);router['post'](_0xaac3('0x17'),auth['isAuthenticated'](),controller[_0xaac3('0x3a')]);router[_0xaac3('0x25')](_0xaac3('0x19'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3b')]);router[_0xaac3('0x25')](_0xaac3('0x3c'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3d')]);router[_0xaac3('0x3e')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3f')]);router[_0xaac3('0x40')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x41')]);router[_0xaac3('0x40')](_0xaac3('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xaac3('0x40')]('/:id/canned_answers',auth[_0xaac3('0xb')](),controller[_0xaac3('0x42')]);router[_0xaac3('0x40')](_0xaac3('0x3c'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x43')]);module[_0xaac3('0x44')]=router; \ No newline at end of file +var _0x564e=['single','file','addLogo','join','server/files/images/avatars/','format','originalname','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','put','/:id','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now'];(function(_0x46d4a8,_0x5c4ced){var _0x4911c5=function(_0x63e12){while(--_0x63e12){_0x46d4a8['push'](_0x46d4a8['shift']());}};_0x4911c5(++_0x5c4ced);}(_0x564e,0x6b));var _0xe564=function(_0x30f889,_0x20a97d){_0x30f889=_0x30f889-0x0;var _0x3c7cf1=_0x564e[_0x30f889];return _0x3c7cf1;};'use strict';var multer=require('multer');var util=require(_0xe564('0x0'));var path=require(_0xe564('0x1'));var timeout=require(_0xe564('0x2'));var express=require(_0xe564('0x3'));var router=express[_0xe564('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe564('0x5'));var interaction=require(_0xe564('0x6'));var config=require(_0xe564('0x7'));var controller=require(_0xe564('0x8'));router[_0xe564('0x9')]('/',auth[_0xe564('0xa')](),controller['index']);router[_0xe564('0x9')](_0xe564('0xb'),auth[_0xe564('0xa')](),controller[_0xe564('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe564('0xd')]);router['get'](_0xe564('0xe'),auth['isAuthenticated'](),controller[_0xe564('0xf')]);router[_0xe564('0x9')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x11')]);router[_0xe564('0x9')](_0xe564('0x12'),controller[_0xe564('0x13')]);router[_0xe564('0x9')](_0xe564('0x14'),controller['getAvatar']);router['get'](_0xe564('0x15'),controller[_0xe564('0x16')]);router[_0xe564('0x9')](_0xe564('0x17'),controller[_0xe564('0x18')]);router[_0xe564('0x9')](_0xe564('0x19'),auth[_0xe564('0xa')](),controller['getInteractions']);router[_0xe564('0x9')](_0xe564('0x1a'),controller[_0xe564('0x1b')]);router[_0xe564('0x9')]('/:id/applications',auth[_0xe564('0xa')](),controller[_0xe564('0x1c')]);router['get'](_0xe564('0x1d'),auth[_0xe564('0xa')](),controller[_0xe564('0x1e')]);router['get'](_0xe564('0x1f'),controller[_0xe564('0x20')]);router['get'](_0xe564('0x21'),auth['isAuthenticated'](),controller[_0xe564('0x22')]);router[_0xe564('0x9')](_0xe564('0x23'),auth['isAuthenticated'](),controller[_0xe564('0x24')]);router[_0xe564('0x25')]('/',auth['isAuthenticated'](),controller[_0xe564('0x26')]);router[_0xe564('0x25')](_0xe564('0xe'),auth['isAuthenticated'](),controller[_0xe564('0x27')]);router[_0xe564('0x25')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x28')]);var upload=multer({'storage':multer[_0xe564('0x29')]({'destination':function(_0x30b470,_0x15189e,_0x488583){_0x488583(null,path['join'](config[_0xe564('0x2a')],'server/files/images/logos/'));},'filename':function(_0xb153c4,_0x20220a,_0xa97d6e){_0xa97d6e(null,util['format'](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0x20220a['originalname']));}})});router[_0xe564('0x25')](_0xe564('0x12'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x2f')]);var upload=multer({'storage':multer[_0xe564('0x29')]({'destination':function(_0x1b918f,_0x3562bb,_0x2cd176){_0x2cd176(null,path[_0xe564('0x30')](config['root'],_0xe564('0x31')));},'filename':function(_0x5c677a,_0x4d6ee8,_0x1693f9){_0x1693f9(null,util[_0xe564('0x32')](_0xe564('0x2b'),Date['now'](),_0x4d6ee8[_0xe564('0x33')]));}})});router['post'](_0xe564('0x14'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xaeeff8,_0x4b2e4d,_0x29c6d9){_0x29c6d9(null,path['join'](config[_0xe564('0x2a')],_0xe564('0x31')));},'filename':function(_0x1e1d29,_0x12ce73,_0x22a6fe){_0x22a6fe(null,util[_0xe564('0x32')](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0x12ce73[_0xe564('0x33')]));}})});router['post']('/:id/customer_avatar',upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x227c7b,_0x450fcb,_0x65af46){_0x65af46(null,path['join'](config[_0xe564('0x2a')],_0xe564('0x31')));},'filename':function(_0x4b13af,_0xc81bc9,_0xd09019){_0xd09019(null,util['format'](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0xc81bc9[_0xe564('0x33')]));}})});router[_0xe564('0x25')](_0xe564('0x17'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller['addSystemAvatar']);router[_0xe564('0x25')](_0xe564('0x36'),controller[_0xe564('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x7f5643,_0x2f282b,_0x10c64a){const _0x45cbee=path[_0xe564('0x30')](config[_0xe564('0x2a')],_0xe564('0x38'),_0xe564('0x39'),_0xe564('0x3a'));fs_extra[_0xe564('0x3b')](_0x45cbee,function(){_0x10c64a(null,_0x45cbee);});},'filename':function(_0x243e20,_0x4faf90,_0x5ba1ea){const _0x1d8b51=_0x4faf90[_0xe564('0x33')][_0xe564('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x120028=path[_0xe564('0x3d')](_0x1d8b51);const _0x3b4048=Date[_0xe564('0x2c')]()+'-'+_0x1d8b51['replace'](_0x120028,'')+_0x120028;_0x5ba1ea(null,_0x3b4048);}})});router['post'](_0xe564('0x3e'),offlineUploadMulter[_0xe564('0x3f')](),controller[_0xe564('0x40')]);router[_0xe564('0x25')](_0xe564('0x19'),auth[_0xe564('0xa')](),controller[_0xe564('0x41')]);router[_0xe564('0x25')](_0xe564('0x42'),auth['isAuthenticated'](),controller[_0xe564('0x43')]);router[_0xe564('0x25')](_0xe564('0x1d'),auth[_0xe564('0xa')](),controller[_0xe564('0x44')]);router[_0xe564('0x25')](_0xe564('0x23'),auth[_0xe564('0xa')](),controller['addAgents']);router[_0xe564('0x45')](_0xe564('0x46'),auth[_0xe564('0xa')](),controller['update']);router[_0xe564('0x47')](_0xe564('0x46'),auth['isAuthenticated'](),controller[_0xe564('0x48')]);router['delete'](_0xe564('0xe'),auth[_0xe564('0xa')](),controller['removeDispositions']);router[_0xe564('0x47')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x49')]);router[_0xe564('0x47')](_0xe564('0x23'),auth[_0xe564('0xa')](),controller[_0xe564('0x4a')]);module[_0xe564('0x4b')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index aaacc96..0d8995d 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 _0xd7c3=['ENUM','AmazonAWS','Google','sequelize','exports','STRING'];(function(_0x25edbe,_0x4a3c89){var _0x1bf84d=function(_0x250dc3){while(--_0x250dc3){_0x25edbe['push'](_0x25edbe['shift']());}};_0x1bf84d(++_0x4a3c89);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x4215c8,_0x1b5a76){_0x4215c8=_0x4215c8-0x0;var _0x29c5f1=_0xd7c3[_0x4215c8];return _0x29c5f1;};'use strict';var Sequelize=require(_0x3d7c('0x0'));module[_0x3d7c('0x1')]={'name':{'type':Sequelize[_0x3d7c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3d7c('0x3')](_0x3d7c('0x4'),_0x3d7c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3d7c('0x2')]},'data2':{'type':Sequelize[_0x3d7c('0x2')]}}; \ No newline at end of file +var _0x7f59=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0xb1b616,_0x3b9023){var _0x1259b0=function(_0xb2e638){while(--_0xb2e638){_0xb1b616['push'](_0xb1b616['shift']());}};_0x1259b0(++_0x3b9023);}(_0x7f59,0x12e));var _0x97f5=function(_0xabb07c,_0x573bcf){_0xabb07c=_0xabb07c-0x0;var _0x36ac5b=_0x7f59[_0xabb07c];return _0x36ac5b;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x97f5('0x2')](_0x97f5('0x3'),_0x97f5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x97f5('0x5')]},'data2':{'type':Sequelize[_0x97f5('0x5')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 3823a65..64a3424 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x442670,_0x51282f){var _0x150d64=function(_0x273161){while(--_0x273161){_0x442670['push'](_0x442670['shift']());}};_0x150d64(++_0x51282f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x0b0e[_0x3d8ba1];return _0x87804e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xadb5,0xad));var _0x5adb=function(_0x221e22,_0x1290f8){_0x221e22=_0x221e22-0x0;var _0x40bcdb=_0xadb5[_0x221e22];return _0x40bcdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 8ac9672..0957ec9 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 _0x7f73=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7f73,0x9a));var _0x37f7=function(_0x547207,_0x1186b7){_0x547207=_0x547207-0x0;var _0x1f0a5f=_0x7f73[_0x547207];return _0x1f0a5f;};'use strict';var _=require(_0x37f7('0x0'));var util=require(_0x37f7('0x1'));var logger=require(_0x37f7('0x2'))(_0x37f7('0x3'));var moment=require('moment');var BPromise=require(_0x37f7('0x4'));var rp=require(_0x37f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37f7('0x6'));var config=require(_0x37f7('0x7'));var attributes=require(_0x37f7('0x8'));module['exports']=function(_0x27d04d,_0x2f0e89){return _0x27d04d[_0x37f7('0x9')](_0x37f7('0xa'),attributes,{'tableName':_0x37f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c12=['util','api','path','rimraf','./cloudProvider.attributes','exports','CloudProvider','cloud_providers'];(function(_0x712393,_0x5ba83a){var _0xc2c9b9=function(_0x20ed98){while(--_0x20ed98){_0x712393['push'](_0x712393['shift']());}};_0xc2c9b9(++_0x5ba83a);}(_0x1c12,0x160));var _0x21c1=function(_0xac774c,_0x12a68c){_0xac774c=_0xac774c-0x0;var _0x26362a=_0x1c12[_0xac774c];return _0x26362a;};'use strict';var _=require('lodash');var util=require(_0x21c1('0x0'));var logger=require('../../config/logger')(_0x21c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x21c1('0x2'));var rimraf=require(_0x21c1('0x3'));var config=require('../../config/environment');var attributes=require(_0x21c1('0x4'));module[_0x21c1('0x5')]=function(_0x531236,_0x3d0328){return _0x531236['define'](_0x21c1('0x6'),attributes,{'tableName':_0x21c1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2409a8d..097f5de 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 _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x5b9a31,_0x5422e0){var _0x369e8f=function(_0x5543d5){while(--_0x5543d5){_0x5b9a31['push'](_0x5b9a31['shift']());}};_0x369e8f(++_0x5422e0);}(_0x5d0a,0x175));var _0xa5d0=function(_0x26a817,_0x2ee676){_0x26a817=_0x26a817-0x0;var _0x1137b8=_0x5d0a[_0x26a817];return _0x1137b8;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});} \ No newline at end of file +var _0xc7da=['request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7da,0xf2));var _0xac7d=function(_0x3edc31,_0x5c6cb9){_0x3edc31=_0x3edc31-0x0;var _0x149b24=_0xc7da[_0x3edc31];return _0x149b24;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 1b21687..698edc9 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 _0xfe7c=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x2319b3,_0x2e8acb){var _0x465a8d=function(_0x322ad8){while(--_0x322ad8){_0x2319b3['push'](_0x2319b3['shift']());}};_0x465a8d(++_0x2e8acb);}(_0xfe7c,0xc8));var _0xcfe7=function(_0x8cee87,_0x4ecb70){_0x8cee87=_0x8cee87-0x0;var _0x339b4e=_0xfe7c[_0x8cee87];return _0x339b4e;};'use strict';var multer=require(_0xcfe7('0x0'));var util=require(_0xcfe7('0x1'));var path=require(_0xcfe7('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfe7('0x3'));var router=express[_0xcfe7('0x4')]();var fs_extra=require(_0xcfe7('0x5'));var auth=require(_0xcfe7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcfe7('0x7'));var controller=require(_0xcfe7('0x8'));router[_0xcfe7('0x9')]('/',auth[_0xcfe7('0xa')](),controller[_0xcfe7('0xb')]);router['get'](_0xcfe7('0xc'),auth[_0xcfe7('0xa')](),controller[_0xcfe7('0xd')]);router[_0xcfe7('0xe')]('/',auth[_0xcfe7('0xa')](),controller['create']);router[_0xcfe7('0xf')](_0xcfe7('0xc'),auth[_0xcfe7('0xa')](),controller[_0xcfe7('0x10')]);router[_0xcfe7('0x11')]('/:id',auth[_0xcfe7('0xa')](),controller[_0xcfe7('0x12')]);module[_0xcfe7('0x13')]=router; \ No newline at end of file +var _0x9953=['isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller'];(function(_0x314107,_0xe0b6b6){var _0x17f4a3=function(_0x1210cd){while(--_0x1210cd){_0x314107['push'](_0x314107['shift']());}};_0x17f4a3(++_0xe0b6b6);}(_0x9953,0x1d7));var _0x3995=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x9953[_0xd8aad0];return _0x570860;};'use strict';var multer=require('multer');var util=require(_0x3995('0x0'));var path=require(_0x3995('0x1'));var timeout=require(_0x3995('0x2'));var express=require('express');var router=express[_0x3995('0x3')]();var fs_extra=require(_0x3995('0x4'));var auth=require(_0x3995('0x5'));var interaction=require(_0x3995('0x6'));var config=require(_0x3995('0x7'));var controller=require(_0x3995('0x8'));router['get']('/',auth[_0x3995('0x9')](),controller[_0x3995('0xa')]);router[_0x3995('0xb')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0xd')]);router[_0x3995('0xe')]('/',auth[_0x3995('0x9')](),controller['create']);router[_0x3995('0xf')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0x10')]);router[_0x3995('0x11')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0x12')]);module[_0x3995('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 69bf9d0..7b2e1c8 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 _0x95d0=['STRING','sequelize','exports','name'];(function(_0xba0c2,_0x54cc50){var _0x5a9fa0=function(_0x577bcb){while(--_0x577bcb){_0xba0c2['push'](_0xba0c2['shift']());}};_0x5a9fa0(++_0x54cc50);}(_0x95d0,0x1d1));var _0x095d=function(_0x8a75ee,_0x589093){_0x8a75ee=_0x8a75ee-0x0;var _0x42003f=_0x95d0[_0x8a75ee];return _0x42003f;};'use strict';var Sequelize=require(_0x095d('0x0'));module[_0x095d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x095d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x095d('0x3')]},'companyId':{'type':Sequelize[_0x095d('0x3')]},'website':{'type':Sequelize[_0x095d('0x3')]},'phone':{'type':Sequelize[_0x095d('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x095d('0x3')]},'street':{'type':Sequelize[_0x095d('0x3')]},'postalCode':{'type':Sequelize[_0x095d('0x3')]},'city':{'type':Sequelize[_0x095d('0x3')]},'country':{'type':Sequelize[_0x095d('0x3')]},'email':{'type':Sequelize[_0x095d('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x095d('0x3')]},'sStreet':{'type':Sequelize[_0x095d('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x095d('0x3')]}}; \ No newline at end of file +var _0x71f7=['exports','name','STRING','sequelize'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x71f7,0x1a7));var _0x771f=function(_0x58d397,_0x3b2609){_0x58d397=_0x58d397-0x0;var _0x4ade02=_0x71f7[_0x58d397];return _0x4ade02;};'use strict';var Sequelize=require(_0x771f('0x0'));module[_0x771f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x771f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x771f('0x3')]},'companyId':{'type':Sequelize[_0x771f('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x771f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x771f('0x3')]},'city':{'type':Sequelize[_0x771f('0x3')]},'country':{'type':Sequelize[_0x771f('0x3')]},'email':{'type':Sequelize[_0x771f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x771f('0x3')]},'sStreet':{'type':Sequelize[_0x771f('0x3')]},'sPostalCode':{'type':Sequelize[_0x771f('0x3')]},'sCity':{'type':Sequelize[_0x771f('0x3')]},'sCountry':{'type':Sequelize[_0x771f('0x3')]},'description':{'type':Sequelize[_0x771f('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 8634868..b963a67 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 _0x4c0f=['fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','role','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','getContacts','findOne','CmContact','map','nolimit','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','then','get','UserProfileResource','destroy','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c0f,0xd1));var _0xf4c0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4c0f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf4c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf4c0('0x1'));var rp=require(_0xf4c0('0x2'));var moment=require('moment');var BPromise=require(_0xf4c0('0x3'));var Mustache=require('mustache');var util=require(_0xf4c0('0x4'));var path=require(_0xf4c0('0x5'));var sox=require(_0xf4c0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4c0('0x7'));var _=require(_0xf4c0('0x8'));var squel=require(_0xf4c0('0x9'));var crypto=require(_0xf4c0('0xa'));var jsforce=require(_0xf4c0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4c0('0xc'));var Papa=require(_0xf4c0('0xd'));var Redis=require('ioredis');var authService=require(_0xf4c0('0xe'));var qs=require(_0xf4c0('0xf'));var as=require(_0xf4c0('0x10'));var hardwareService=require(_0xf4c0('0x11'));var logger=require(_0xf4c0('0x12'))(_0xf4c0('0x13'));var utils=require('../../config/utils');var config=require(_0xf4c0('0x14'));var licenseUtil=require(_0xf4c0('0x15'));var db=require(_0xf4c0('0x16'))['db'];function respondWithStatusCode(_0x191856,_0x19d026){_0x19d026=_0x19d026||0xcc;return function(_0x47d806){if(_0x47d806){return _0x191856[_0xf4c0('0x17')](_0x19d026);}return _0x191856[_0xf4c0('0x18')](_0x19d026)[_0xf4c0('0x19')]();};}function respondWithResult(_0x2b9dc7,_0x15d9ef){_0x15d9ef=_0x15d9ef||0xc8;return function(_0x4b2316){if(_0x4b2316){return _0x2b9dc7[_0xf4c0('0x18')](_0x15d9ef)[_0xf4c0('0x1a')](_0x4b2316);}};}function respondWithFilteredResult(_0x4e1202,_0x4fdff7){return function(_0x501b88){if(_0x501b88){var _0x4841aa=typeof _0x4fdff7[_0xf4c0('0x1b')]==='undefined'&&typeof _0x4fdff7[_0xf4c0('0x1c')]===_0xf4c0('0x1d');var _0x3a94ba=_0x501b88[_0xf4c0('0x1e')];var _0x10e4c9=_0x4841aa?0x0:_0x4fdff7[_0xf4c0('0x1b')];var _0x265329=_0x4841aa?_0x501b88[_0xf4c0('0x1e')]:_0x4fdff7[_0xf4c0('0x1b')]+_0x4fdff7['limit'];var _0x26bcc8;if(_0x265329>=_0x3a94ba){_0x265329=_0x3a94ba;_0x26bcc8=0xc8;}else{_0x26bcc8=0xce;}_0x4e1202[_0xf4c0('0x18')](_0x26bcc8);return _0x4e1202[_0xf4c0('0x1f')](_0xf4c0('0x20'),_0x10e4c9+'-'+_0x265329+'/'+_0x3a94ba)[_0xf4c0('0x1a')](_0x501b88);}return null;};}function patchUpdates(_0x51af25){return function(_0x411544){try{jsonpatch[_0xf4c0('0x21')](_0x411544,_0x51af25,!![]);}catch(_0x168a3f){return BPromise['reject'](_0x168a3f);}return _0x411544[_0xf4c0('0x22')]();};}function saveUpdates(_0x3a1be0,_0x210412){return function(_0x156ab4){if(_0x156ab4){return _0x156ab4['update'](_0x3a1be0)['then'](function(_0x544e6f){return _0x544e6f;});}return null;};}function removeEntity(_0x5c3066,_0xdddf07){return function(_0x3c65dc){if(_0x3c65dc){return _0x3c65dc['destroy']()[_0xf4c0('0x23')](function(){var _0x32d7bd=_0x3c65dc[_0xf4c0('0x24')]({'plain':!![]});var _0x3bbfb8='Companies';return db[_0xf4c0('0x25')][_0xf4c0('0x26')]({'where':{'type':_0x3bbfb8,'resourceId':_0x32d7bd['id']}})[_0xf4c0('0x23')](function(){return _0x3c65dc;});})[_0xf4c0('0x23')](function(){_0x5c3066['status'](0xcc)[_0xf4c0('0x19')]();});}};}function handleEntityNotFound(_0x35a5af,_0x194112){return function(_0x177067){if(!_0x177067){_0x35a5af[_0xf4c0('0x17')](0x194);}return _0x177067;};}function handleError(_0x59b253,_0x28a201){_0x28a201=_0x28a201||0x1f4;return function(_0x258bab){logger[_0xf4c0('0x27')](_0x258bab[_0xf4c0('0x28')]);if(_0x258bab[_0xf4c0('0x29')]){delete _0x258bab[_0xf4c0('0x29')];}_0x59b253[_0xf4c0('0x18')](_0x28a201)[_0xf4c0('0x2a')](_0x258bab);};}exports[_0xf4c0('0x2b')]=function(_0x3f5acb,_0x48c853){var _0x5c1a66={},_0x4d2d06={},_0x210ac9={'count':0x0,'rows':[]};return db[_0xf4c0('0x2c')][_0xf4c0('0x2d')]()['then'](function(_0x1350cf){_0x4d2d06[_0xf4c0('0x2e')]=_[_0xf4c0('0x2f')](_0x1350cf);_0x4d2d06[_0xf4c0('0x30')]=_[_0xf4c0('0x2f')](_0x3f5acb['query']);_0x4d2d06[_0xf4c0('0x31')]=_[_0xf4c0('0x32')](_0x4d2d06[_0xf4c0('0x2e')],_0x4d2d06[_0xf4c0('0x30')]);_0x5c1a66[_0xf4c0('0x33')]=_['intersection'](_0x4d2d06[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x34')]));_0x5c1a66[_0xf4c0('0x33')]=_0x5c1a66[_0xf4c0('0x33')][_0xf4c0('0x35')]?_0x5c1a66[_0xf4c0('0x33')]:_0x4d2d06['model'];if(!_0x3f5acb[_0xf4c0('0x30')]['hasOwnProperty']('nolimit')){_0x5c1a66[_0xf4c0('0x1c')]=qs[_0xf4c0('0x1c')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x1c')]);_0x5c1a66[_0xf4c0('0x1b')]=qs[_0xf4c0('0x1b')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x1b')]);}_0x5c1a66[_0xf4c0('0x36')]=qs[_0xf4c0('0x37')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x37')]);_0x5c1a66[_0xf4c0('0x38')]=qs['filters'](_[_0xf4c0('0x39')](_0x3f5acb['query'],_0x4d2d06[_0xf4c0('0x31')]),_0x1350cf);if(_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3a')]){_0x5c1a66[_0xf4c0('0x38')]=_[_0xf4c0('0x3b')](_0x5c1a66['where'],{'$or':_['map'](_0x5c1a66[_0xf4c0('0x33')],function(_0x481923){var _0x5d8c22={};_0x5d8c22[_0x481923]={'$like':'%'+_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3a')]+'%'};return _0x5d8c22;})});}_0x5c1a66=_[_0xf4c0('0x3b')]({},_0x5c1a66,_0x3f5acb[_0xf4c0('0x3c')]);var _0x28f59b={'where':_0x5c1a66['where']};return db[_0xf4c0('0x2c')]['count'](_0x28f59b)[_0xf4c0('0x23')](function(_0x1d6aa3){_0x210ac9[_0xf4c0('0x1e')]=_0x1d6aa3;if(_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3d')]){_0x5c1a66[_0xf4c0('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x5c1a66);})[_0xf4c0('0x23')](function(_0x96c13b){_0x210ac9[_0xf4c0('0x3f')]=_0x96c13b;return _0x210ac9;})[_0xf4c0('0x23')](respondWithFilteredResult(_0x48c853,_0x5c1a66))[_0xf4c0('0x40')](handleError(_0x48c853,null));})[_0xf4c0('0x40')](handleError(_0x48c853,null));};exports[_0xf4c0('0x41')]=function(_0x68a7d9,_0x13ca46){var _0x5242bb={'raw':![],'where':{'id':_0x68a7d9[_0xf4c0('0x42')]['id']}},_0x3abe87={};_0x3abe87['model']=_['keys'](db[_0xf4c0('0x2c')][_0xf4c0('0x43')]);_0x3abe87[_0xf4c0('0x30')]=_['keys'](_0x68a7d9[_0xf4c0('0x30')]);_0x3abe87[_0xf4c0('0x31')]=_['intersection'](_0x3abe87['model'],_0x3abe87[_0xf4c0('0x30')]);_0x5242bb[_0xf4c0('0x33')]=_['intersection'](_0x3abe87[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x68a7d9['query']['fields']));_0x5242bb[_0xf4c0('0x33')]=_0x5242bb[_0xf4c0('0x33')][_0xf4c0('0x35')]?_0x5242bb['attributes']:_0x3abe87[_0xf4c0('0x2e')];if(_0x68a7d9['query']['includeAll']){_0x5242bb[_0xf4c0('0x3e')]=[{'all':!![]}];}_0x5242bb=_[_0xf4c0('0x3b')]({},_0x5242bb,_0x68a7d9[_0xf4c0('0x3c')]);return db[_0xf4c0('0x2c')]['find'](_0x5242bb)[_0xf4c0('0x23')](handleEntityNotFound(_0x13ca46,null))[_0xf4c0('0x23')](respondWithResult(_0x13ca46,null))['catch'](handleError(_0x13ca46,null));};exports['create']=function(_0x23ed75,_0x4524ff){return db['CmCompany'][_0xf4c0('0x44')](_0x23ed75[_0xf4c0('0x45')],{})[_0xf4c0('0x23')](function(_0x9204e7){var _0x7c0533=_0x23ed75['user'][_0xf4c0('0x24')]({'plain':!![]});if(!_0x7c0533)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7c0533[_0xf4c0('0x46')]===_0xf4c0('0x47')){var _0x3d52f7=_0x9204e7[_0xf4c0('0x24')]({'plain':!![]});var _0x378260=_0xf4c0('0x48');return db[_0xf4c0('0x49')][_0xf4c0('0x4a')]({'where':{'name':_0x378260,'userProfileId':_0x7c0533[_0xf4c0('0x4b')]},'raw':!![]})['then'](function(_0xc9a9e7){if(_0xc9a9e7&&_0xc9a9e7[_0xf4c0('0x4c')]===0x0){return db[_0xf4c0('0x25')][_0xf4c0('0x44')]({'name':_0x3d52f7[_0xf4c0('0x29')],'resourceId':_0x3d52f7['id'],'type':_0xc9a9e7[_0xf4c0('0x29')],'sectionId':_0xc9a9e7['id']},{})[_0xf4c0('0x23')](function(){return _0x9204e7;});}else{return _0x9204e7;}})[_0xf4c0('0x40')](function(_0x429f80){logger[_0xf4c0('0x27')](_0xf4c0('0x4d'),_0x429f80);throw _0x429f80;});}return _0x9204e7;})[_0xf4c0('0x23')](respondWithResult(_0x4524ff,0xc9))[_0xf4c0('0x40')](handleError(_0x4524ff,null));};exports[_0xf4c0('0x4e')]=function(_0x4b9178,_0x20eb99){if(_0x4b9178[_0xf4c0('0x45')]['id']){delete _0x4b9178[_0xf4c0('0x45')]['id'];}return db[_0xf4c0('0x2c')][_0xf4c0('0x4a')]({'where':{'id':_0x4b9178['params']['id']}})[_0xf4c0('0x23')](handleEntityNotFound(_0x20eb99,null))[_0xf4c0('0x23')](saveUpdates(_0x4b9178[_0xf4c0('0x45')],null))['then'](respondWithResult(_0x20eb99,null))[_0xf4c0('0x40')](handleError(_0x20eb99,null));};exports['destroy']=function(_0x595694,_0xa3da64){return db['CmCompany']['find']({'where':{'id':_0x595694[_0xf4c0('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3da64,null))['then'](removeEntity(_0xa3da64,null))[_0xf4c0('0x40')](handleError(_0xa3da64,null));};exports[_0xf4c0('0x2d')]=function(_0x30e30b,_0x163e11){return db[_0xf4c0('0x2c')]['describe']()[_0xf4c0('0x23')](respondWithResult(_0x163e11,null))[_0xf4c0('0x40')](handleError(_0x163e11,null));};exports['addContacts']=function(_0x1d00e6,_0x2964d9,_0x5cf736){return db['CmContact'][_0xf4c0('0x4a')]({'where':{'id':_0x1d00e6['params']['id']}})[_0xf4c0('0x23')](handleEntityNotFound(_0x2964d9,null))['then'](function(_0xffa75d){if(_0xffa75d){return _0xffa75d[_0xf4c0('0x4f')](_0x1d00e6['body'][_0xf4c0('0x50')],_[_0xf4c0('0x51')](_0x1d00e6[_0xf4c0('0x45')],[_0xf4c0('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2964d9,null))[_0xf4c0('0x40')](handleError(_0x2964d9,null));};exports[_0xf4c0('0x52')]=function(_0x1a8193,_0x862e95,_0x191d40){var _0x5d4740={};var _0x204375={};var _0x5d3301;var _0x42f22d;return db[_0xf4c0('0x2c')][_0xf4c0('0x53')]({'where':{'id':_0x1a8193['params']['id']}})['then'](handleEntityNotFound(_0x862e95,null))[_0xf4c0('0x23')](function(_0x30cf30){if(_0x30cf30){_0x5d3301=_0x30cf30;_0x204375[_0xf4c0('0x2e')]=_[_0xf4c0('0x2f')](db[_0xf4c0('0x54')]['rawAttributes']);_0x204375['query']=_[_0xf4c0('0x2f')](_0x1a8193[_0xf4c0('0x30')]);_0x204375['filters']=_['intersection'](_0x204375[_0xf4c0('0x2e')],_0x204375[_0xf4c0('0x30')]);_0x5d4740[_0xf4c0('0x33')]=_[_0xf4c0('0x32')](_0x204375[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x1a8193['query'][_0xf4c0('0x34')]));_0x5d4740[_0xf4c0('0x33')]=_0x5d4740[_0xf4c0('0x33')]['length']?_0x5d4740['attributes']:_0x204375[_0xf4c0('0x2e')];_0x5d4740[_0xf4c0('0x36')]=qs['sort'](_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x37')]);_0x5d4740[_0xf4c0('0x38')]=qs['filters'](_['pick'](_0x1a8193[_0xf4c0('0x30')],_0x204375[_0xf4c0('0x31')]));if(_0x1a8193[_0xf4c0('0x30')]['filter']){_0x5d4740[_0xf4c0('0x38')]=_[_0xf4c0('0x3b')](_0x5d4740['where'],{'$or':_[_0xf4c0('0x55')](_0x5d4740['attributes'],function(_0x35060d){var _0x521efc={};_0x521efc[_0x35060d]={'$like':'%'+_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x3a')]+'%'};return _0x521efc;})});}_0x5d4740=_[_0xf4c0('0x3b')]({},_0x5d4740,_0x1a8193['options']);return _0x5d3301['getContacts'](_0x5d4740);}})['then'](function(_0x1aec80){if(_0x1aec80){_0x42f22d=_0x1aec80['length'];if(!_0x1a8193[_0xf4c0('0x30')]['hasOwnProperty'](_0xf4c0('0x56'))){_0x5d4740[_0xf4c0('0x1c')]=qs[_0xf4c0('0x1c')](_0x1a8193[_0xf4c0('0x30')]['limit']);_0x5d4740[_0xf4c0('0x1b')]=qs[_0xf4c0('0x1b')](_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x1b')]);}return _0x5d3301[_0xf4c0('0x52')](_0x5d4740);}})[_0xf4c0('0x23')](function(_0x2d4817){if(_0x2d4817){return _0x2d4817?{'count':_0x42f22d,'rows':_0x2d4817}:null;}})[_0xf4c0('0x23')](respondWithResult(_0x862e95,null))[_0xf4c0('0x40')](handleError(_0x862e95,null));}; \ No newline at end of file +var _0x4681=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','params','addContacts','ids','omit','getContacts','CmContact','rawAttributes','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','destroy','then','get','Companies','UserProfileResource','end','name','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','includeAll','include','rows','catch','options','find','create','body'];(function(_0x4e8aa0,_0x5e9443){var _0x10ca5f=function(_0x186c72){while(--_0x186c72){_0x4e8aa0['push'](_0x4e8aa0['shift']());}};_0x10ca5f(++_0x5e9443);}(_0x4681,0x14e));var _0x1468=function(_0x3ce196,_0x5185a2){_0x3ce196=_0x3ce196-0x0;var _0x4e8a4a=_0x4681[_0x3ce196];return _0x4e8a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1468('0x0'));var zipdir=require(_0x1468('0x1'));var jsonpatch=require(_0x1468('0x2'));var rp=require(_0x1468('0x3'));var moment=require('moment');var BPromise=require(_0x1468('0x4'));var Mustache=require(_0x1468('0x5'));var util=require(_0x1468('0x6'));var path=require(_0x1468('0x7'));var sox=require('sox');var csv=require(_0x1468('0x8'));var ejs=require(_0x1468('0x9'));var fs=require('fs');var fs_extra=require(_0x1468('0xa'));var _=require(_0x1468('0xb'));var squel=require(_0x1468('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1468('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1468('0xe'));var Papa=require(_0x1468('0xf'));var Redis=require('ioredis');var authService=require(_0x1468('0x10'));var qs=require(_0x1468('0x11'));var as=require(_0x1468('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1468('0x13'));var licenseUtil=require(_0x1468('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c74c3,_0x4b21d7){_0x4b21d7=_0x4b21d7||0xcc;return function(_0x408917){if(_0x408917){return _0x1c74c3[_0x1468('0x15')](_0x4b21d7);}return _0x1c74c3['status'](_0x4b21d7)['end']();};}function respondWithResult(_0x23d4a8,_0x5e4fed){_0x5e4fed=_0x5e4fed||0xc8;return function(_0x4a634b){if(_0x4a634b){return _0x23d4a8['status'](_0x5e4fed)[_0x1468('0x16')](_0x4a634b);}};}function respondWithFilteredResult(_0x3a4739,_0x5eb1ee){return function(_0x429041){if(_0x429041){var _0x1ce35e=typeof _0x5eb1ee[_0x1468('0x17')]===_0x1468('0x18')&&typeof _0x5eb1ee['limit']===_0x1468('0x18');var _0x433c07=_0x429041[_0x1468('0x19')];var _0x40696e=_0x1ce35e?0x0:_0x5eb1ee[_0x1468('0x17')];var _0x47fcaf=_0x1ce35e?_0x429041[_0x1468('0x19')]:_0x5eb1ee[_0x1468('0x17')]+_0x5eb1ee[_0x1468('0x1a')];var _0x324bf1;if(_0x47fcaf>=_0x433c07){_0x47fcaf=_0x433c07;_0x324bf1=0xc8;}else{_0x324bf1=0xce;}_0x3a4739[_0x1468('0x1b')](_0x324bf1);return _0x3a4739['set'](_0x1468('0x1c'),_0x40696e+'-'+_0x47fcaf+'/'+_0x433c07)[_0x1468('0x16')](_0x429041);}return null;};}function patchUpdates(_0x4810f5){return function(_0x5c9198){try{jsonpatch[_0x1468('0x1d')](_0x5c9198,_0x4810f5,!![]);}catch(_0x25b021){return BPromise[_0x1468('0x1e')](_0x25b021);}return _0x5c9198['save']();};}function saveUpdates(_0x4876f6,_0x3e4415){return function(_0x11c8f1){if(_0x11c8f1){return _0x11c8f1[_0x1468('0x1f')](_0x4876f6)['then'](function(_0x1bbe68){return _0x1bbe68;});}return null;};}function removeEntity(_0x4a0772,_0x5cd5a7){return function(_0x529597){if(_0x529597){return _0x529597[_0x1468('0x20')]()[_0x1468('0x21')](function(){var _0xb6384d=_0x529597[_0x1468('0x22')]({'plain':!![]});var _0x553f4b=_0x1468('0x23');return db[_0x1468('0x24')][_0x1468('0x20')]({'where':{'type':_0x553f4b,'resourceId':_0xb6384d['id']}})[_0x1468('0x21')](function(){return _0x529597;});})[_0x1468('0x21')](function(){_0x4a0772[_0x1468('0x1b')](0xcc)[_0x1468('0x25')]();});}};}function handleEntityNotFound(_0x43a1ab,_0x5232ae){return function(_0x44cc69){if(!_0x44cc69){_0x43a1ab[_0x1468('0x15')](0x194);}return _0x44cc69;};}function handleError(_0x44ba7e,_0x36a381){_0x36a381=_0x36a381||0x1f4;return function(_0x2c18ba){logger['error'](_0x2c18ba['stack']);if(_0x2c18ba[_0x1468('0x26')]){delete _0x2c18ba['name'];}_0x44ba7e[_0x1468('0x1b')](_0x36a381)['send'](_0x2c18ba);};}exports[_0x1468('0x27')]=function(_0x1a6a6e,_0x5f5a62){var _0x2ff155={},_0x4f7a7a={},_0x24c47e={'count':0x0,'rows':[]};return db[_0x1468('0x28')][_0x1468('0x29')]()[_0x1468('0x21')](function(_0x372594){_0x4f7a7a[_0x1468('0x2a')]=_[_0x1468('0x2b')](_0x372594);_0x4f7a7a[_0x1468('0x2c')]=_[_0x1468('0x2b')](_0x1a6a6e[_0x1468('0x2c')]);_0x4f7a7a[_0x1468('0x2d')]=_['intersection'](_0x4f7a7a[_0x1468('0x2a')],_0x4f7a7a[_0x1468('0x2c')]);_0x2ff155['attributes']=_[_0x1468('0x2e')](_0x4f7a7a[_0x1468('0x2a')],qs['fields'](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x2f')]));_0x2ff155['attributes']=_0x2ff155[_0x1468('0x30')][_0x1468('0x31')]?_0x2ff155['attributes']:_0x4f7a7a[_0x1468('0x2a')];if(!_0x1a6a6e['query'][_0x1468('0x32')](_0x1468('0x33'))){_0x2ff155[_0x1468('0x1a')]=qs[_0x1468('0x1a')](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x1a')]);_0x2ff155[_0x1468('0x17')]=qs[_0x1468('0x17')](_0x1a6a6e['query'][_0x1468('0x17')]);}_0x2ff155['order']=qs[_0x1468('0x34')](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x34')]);_0x2ff155[_0x1468('0x35')]=qs[_0x1468('0x2d')](_[_0x1468('0x36')](_0x1a6a6e['query'],_0x4f7a7a[_0x1468('0x2d')]),_0x372594);if(_0x1a6a6e[_0x1468('0x2c')]['filter']){_0x2ff155[_0x1468('0x35')]=_[_0x1468('0x37')](_0x2ff155[_0x1468('0x35')],{'$or':_[_0x1468('0x38')](_0x2ff155[_0x1468('0x30')],function(_0x338a5e){var _0x57c51e={};_0x57c51e[_0x338a5e]={'$like':'%'+_0x1a6a6e['query'][_0x1468('0x39')]+'%'};return _0x57c51e;})});}_0x2ff155=_[_0x1468('0x37')]({},_0x2ff155,_0x1a6a6e['options']);var _0x2a8955={'where':_0x2ff155[_0x1468('0x35')]};return db[_0x1468('0x28')][_0x1468('0x19')](_0x2a8955)['then'](function(_0x20157d){_0x24c47e[_0x1468('0x19')]=_0x20157d;if(_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x3a')]){_0x2ff155[_0x1468('0x3b')]=[{'all':!![]}];}return db[_0x1468('0x28')]['findAll'](_0x2ff155);})[_0x1468('0x21')](function(_0x49f70e){_0x24c47e[_0x1468('0x3c')]=_0x49f70e;return _0x24c47e;})['then'](respondWithFilteredResult(_0x5f5a62,_0x2ff155))[_0x1468('0x3d')](handleError(_0x5f5a62,null));})[_0x1468('0x3d')](handleError(_0x5f5a62,null));};exports['show']=function(_0x5e3b08,_0xab75ef){var _0x2e79b9={'raw':![],'where':{'id':_0x5e3b08['params']['id']}},_0x313902={};_0x313902[_0x1468('0x2a')]=_[_0x1468('0x2b')](db[_0x1468('0x28')]['rawAttributes']);_0x313902[_0x1468('0x2c')]=_[_0x1468('0x2b')](_0x5e3b08[_0x1468('0x2c')]);_0x313902[_0x1468('0x2d')]=_['intersection'](_0x313902['model'],_0x313902[_0x1468('0x2c')]);_0x2e79b9[_0x1468('0x30')]=_[_0x1468('0x2e')](_0x313902['model'],qs[_0x1468('0x2f')](_0x5e3b08[_0x1468('0x2c')]['fields']));_0x2e79b9[_0x1468('0x30')]=_0x2e79b9[_0x1468('0x30')][_0x1468('0x31')]?_0x2e79b9[_0x1468('0x30')]:_0x313902[_0x1468('0x2a')];if(_0x5e3b08[_0x1468('0x2c')]['includeAll']){_0x2e79b9[_0x1468('0x3b')]=[{'all':!![]}];}_0x2e79b9=_[_0x1468('0x37')]({},_0x2e79b9,_0x5e3b08[_0x1468('0x3e')]);return db['CmCompany'][_0x1468('0x3f')](_0x2e79b9)[_0x1468('0x21')](handleEntityNotFound(_0xab75ef,null))[_0x1468('0x21')](respondWithResult(_0xab75ef,null))['catch'](handleError(_0xab75ef,null));};exports[_0x1468('0x40')]=function(_0x49db6a,_0x574e46){return db[_0x1468('0x28')]['create'](_0x49db6a[_0x1468('0x41')],{})['then'](function(_0x264453){var _0x19e237=_0x49db6a[_0x1468('0x42')][_0x1468('0x22')]({'plain':!![]});if(!_0x19e237)throw new Error(_0x1468('0x43'));if(_0x19e237[_0x1468('0x44')]==='user'){var _0x487f44=_0x264453[_0x1468('0x22')]({'plain':!![]});var _0x40c1a8=_0x1468('0x23');return db['UserProfileSection'][_0x1468('0x3f')]({'where':{'name':_0x40c1a8,'userProfileId':_0x19e237[_0x1468('0x45')]},'raw':!![]})['then'](function(_0x48d0fc){if(_0x48d0fc&&_0x48d0fc[_0x1468('0x46')]===0x0){return db[_0x1468('0x24')]['create']({'name':_0x487f44[_0x1468('0x26')],'resourceId':_0x487f44['id'],'type':_0x48d0fc[_0x1468('0x26')],'sectionId':_0x48d0fc['id']},{})[_0x1468('0x21')](function(){return _0x264453;});}else{return _0x264453;}})[_0x1468('0x3d')](function(_0xd1082a){logger[_0x1468('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1082a);throw _0xd1082a;});}return _0x264453;})['then'](respondWithResult(_0x574e46,0xc9))[_0x1468('0x3d')](handleError(_0x574e46,null));};exports['update']=function(_0x274162,_0x33beea){if(_0x274162[_0x1468('0x41')]['id']){delete _0x274162[_0x1468('0x41')]['id'];}return db[_0x1468('0x28')][_0x1468('0x3f')]({'where':{'id':_0x274162[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x33beea,null))[_0x1468('0x21')](saveUpdates(_0x274162[_0x1468('0x41')],null))[_0x1468('0x21')](respondWithResult(_0x33beea,null))[_0x1468('0x3d')](handleError(_0x33beea,null));};exports[_0x1468('0x20')]=function(_0x4f4b26,_0x1f4cb1){return db[_0x1468('0x28')][_0x1468('0x3f')]({'where':{'id':_0x4f4b26[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x1f4cb1,null))['then'](removeEntity(_0x1f4cb1,null))[_0x1468('0x3d')](handleError(_0x1f4cb1,null));};exports[_0x1468('0x29')]=function(_0x4b79c0,_0x4c667a){return db[_0x1468('0x28')][_0x1468('0x29')]()[_0x1468('0x21')](respondWithResult(_0x4c667a,null))[_0x1468('0x3d')](handleError(_0x4c667a,null));};exports[_0x1468('0x49')]=function(_0x57000c,_0x32609e,_0x54ad08){return db['CmContact']['find']({'where':{'id':_0x57000c[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x32609e,null))[_0x1468('0x21')](function(_0x3fa08e){if(_0x3fa08e){return _0x3fa08e[_0x1468('0x49')](_0x57000c[_0x1468('0x41')][_0x1468('0x4a')],_[_0x1468('0x4b')](_0x57000c[_0x1468('0x41')],[_0x1468('0x4a'),'id'])||{});}})[_0x1468('0x21')](respondWithResult(_0x32609e,null))[_0x1468('0x3d')](handleError(_0x32609e,null));};exports[_0x1468('0x4c')]=function(_0x3975ff,_0x34017e,_0x4361ff){var _0x528295={};var _0x2ea241={};var _0x15efcf;var _0x3b0aa7;return db['CmCompany']['findOne']({'where':{'id':_0x3975ff[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x34017e,null))[_0x1468('0x21')](function(_0x4e0cbb){if(_0x4e0cbb){_0x15efcf=_0x4e0cbb;_0x2ea241[_0x1468('0x2a')]=_['keys'](db[_0x1468('0x4d')][_0x1468('0x4e')]);_0x2ea241[_0x1468('0x2c')]=_['keys'](_0x3975ff[_0x1468('0x2c')]);_0x2ea241[_0x1468('0x2d')]=_['intersection'](_0x2ea241[_0x1468('0x2a')],_0x2ea241['query']);_0x528295[_0x1468('0x30')]=_[_0x1468('0x2e')](_0x2ea241[_0x1468('0x2a')],qs[_0x1468('0x2f')](_0x3975ff['query'][_0x1468('0x2f')]));_0x528295[_0x1468('0x30')]=_0x528295['attributes'][_0x1468('0x31')]?_0x528295[_0x1468('0x30')]:_0x2ea241[_0x1468('0x2a')];_0x528295[_0x1468('0x4f')]=qs['sort'](_0x3975ff['query']['sort']);_0x528295[_0x1468('0x35')]=qs[_0x1468('0x2d')](_[_0x1468('0x36')](_0x3975ff[_0x1468('0x2c')],_0x2ea241[_0x1468('0x2d')]));if(_0x3975ff[_0x1468('0x2c')][_0x1468('0x39')]){_0x528295[_0x1468('0x35')]=_[_0x1468('0x37')](_0x528295[_0x1468('0x35')],{'$or':_['map'](_0x528295[_0x1468('0x30')],function(_0x1bb78f){var _0x195a05={};_0x195a05[_0x1bb78f]={'$like':'%'+_0x3975ff[_0x1468('0x2c')][_0x1468('0x39')]+'%'};return _0x195a05;})});}_0x528295=_[_0x1468('0x37')]({},_0x528295,_0x3975ff[_0x1468('0x3e')]);return _0x15efcf[_0x1468('0x4c')](_0x528295);}})[_0x1468('0x21')](function(_0x322d18){if(_0x322d18){_0x3b0aa7=_0x322d18['length'];if(!_0x3975ff['query'][_0x1468('0x32')](_0x1468('0x33'))){_0x528295['limit']=qs['limit'](_0x3975ff[_0x1468('0x2c')][_0x1468('0x1a')]);_0x528295[_0x1468('0x17')]=qs['offset'](_0x3975ff[_0x1468('0x2c')][_0x1468('0x17')]);}return _0x15efcf[_0x1468('0x4c')](_0x528295);}})[_0x1468('0x21')](function(_0x37c4e5){if(_0x37c4e5){return _0x37c4e5?{'count':_0x3b0aa7,'rows':_0x37c4e5}:null;}})[_0x1468('0x21')](respondWithResult(_0x34017e,null))['catch'](handleError(_0x34017e,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 37ff864..3836bc7 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 _0xd70b=['moment','request-promise','path','rimraf','../../config/environment','CmCompany','lodash','util','../../config/logger','api'];(function(_0xcd9263,_0x452ad4){var _0x3565a7=function(_0x139dba){while(--_0x139dba){_0xcd9263['push'](_0xcd9263['shift']());}};_0x3565a7(++_0x452ad4);}(_0xd70b,0xba));var _0xbd70=function(_0x360c92,_0x5ed443){_0x360c92=_0x360c92-0x0;var _0x429495=_0xd70b[_0x360c92];return _0x429495;};'use strict';var _=require(_0xbd70('0x0'));var util=require(_0xbd70('0x1'));var logger=require(_0xbd70('0x2'))(_0xbd70('0x3'));var moment=require(_0xbd70('0x4'));var BPromise=require('bluebird');var rp=require(_0xbd70('0x5'));var fs=require('fs');var path=require(_0xbd70('0x6'));var rimraf=require(_0xbd70('0x7'));var config=require(_0xbd70('0x8'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x463117,_0x4d752b){return _0x463117['define'](_0xbd70('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e3f=['path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','api','moment','bluebird','request-promise'];(function(_0xf45b9e,_0x11b1e0){var _0x3dc216=function(_0x45fc54){while(--_0x45fc54){_0xf45b9e['push'](_0xf45b9e['shift']());}};_0x3dc216(++_0x11b1e0);}(_0x3e3f,0x1e9));var _0xf3e3=function(_0x429028,_0x4c7451){_0x429028=_0x429028-0x0;var _0x1a6157=_0x3e3f[_0x429028];return _0x1a6157;};'use strict';var _=require(_0xf3e3('0x0'));var util=require(_0xf3e3('0x1'));var logger=require('../../config/logger')(_0xf3e3('0x2'));var moment=require(_0xf3e3('0x3'));var BPromise=require(_0xf3e3('0x4'));var rp=require(_0xf3e3('0x5'));var fs=require('fs');var path=require(_0xf3e3('0x6'));var rimraf=require(_0xf3e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3e3('0x8'));module[_0xf3e3('0x9')]=function(_0x208927,_0x593c40){return _0x208927['define']('CmCompany',attributes,{'tableName':_0xf3e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index adf4758..6ae50f8 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 _0x387c=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46cf08,_0x489118){var _0x46df90=function(_0x3ca0da){while(--_0x3ca0da){_0x46cf08['push'](_0x46cf08['shift']());}};_0x46df90(++_0x489118);}(_0x387c,0xf5));var _0xc387=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x387c[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xc387('0x0'));var util=require(_0xc387('0x1'));var moment=require('moment');var BPromise=require(_0xc387('0x2'));var rs=require(_0xc387('0x3'));var fs=require('fs');var Redis=require(_0xc387('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc387('0x5'));var logger=require(_0xc387('0x6'))('rpc');var config=require(_0xc387('0x7'));var jayson=require(_0xc387('0x8'));var client=jayson[_0xc387('0x9')][_0xc387('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed482,_0x37a911,_0x4e9b4b){return new BPromise(function(_0x716d0c,_0x1fc0b6){return client[_0xc387('0xb')](_0x3ed482,_0x4e9b4b)[_0xc387('0xc')](function(_0x5839f7){logger[_0xc387('0xd')](_0xc387('0xe'),_0x37a911,_0xc387('0xf'));logger[_0xc387('0x10')](_0xc387('0x11'),_0x37a911,_0xc387('0xf'),JSON[_0xc387('0x12')](_0x5839f7));if(_0x5839f7[_0xc387('0x13')]){if(_0x5839f7['error'][_0xc387('0x14')]===0x1f4){logger[_0xc387('0x13')](_0xc387('0xe'),_0x37a911,_0x5839f7[_0xc387('0x13')]['message']);return _0x1fc0b6(_0x5839f7[_0xc387('0x13')][_0xc387('0x15')]);}logger[_0xc387('0x13')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0x5839f7['error'][_0xc387('0x15')]);return _0x716d0c(_0x5839f7[_0xc387('0x13')]['message']);}else{logger[_0xc387('0xd')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0xc387('0xf'));_0x716d0c(_0x5839f7[_0xc387('0x16')][_0xc387('0x15')]);}})[_0xc387('0x17')](function(_0x5ae4e3){logger[_0xc387('0x13')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0x5ae4e3);_0x1fc0b6(_0x5ae4e3);});});} \ No newline at end of file +var _0xdbc1=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info'];(function(_0x590a28,_0x1fbd84){var _0x2fdcf5=function(_0x252985){while(--_0x252985){_0x590a28['push'](_0x590a28['shift']());}};_0x2fdcf5(++_0x1fbd84);}(_0xdbc1,0x17e));var _0x1dbc=function(_0x1ca7ed,_0x2cccb4){_0x1ca7ed=_0x1ca7ed-0x0;var _0x5d706a=_0xdbc1[_0x1ca7ed];return _0x5d706a;};'use strict';var _=require(_0x1dbc('0x0'));var util=require('util');var moment=require(_0x1dbc('0x1'));var BPromise=require(_0x1dbc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dbc('0x3'))['db'];var utils=require(_0x1dbc('0x4'));var logger=require(_0x1dbc('0x5'))(_0x1dbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x1dbc('0x7'));var client=jayson[_0x1dbc('0x8')][_0x1dbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x871d94,_0x2a2931,_0x120c09){return new BPromise(function(_0x27ce01,_0x26fcf7){return client['request'](_0x871d94,_0x120c09)['then'](function(_0x299266){logger['info']('CmCompany,\x20%s,\x20%s',_0x2a2931,'request\x20sent');logger['debug'](_0x1dbc('0xa'),_0x2a2931,_0x1dbc('0xb'),JSON[_0x1dbc('0xc')](_0x299266));if(_0x299266[_0x1dbc('0xd')]){if(_0x299266['error'][_0x1dbc('0xe')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x2a2931,_0x299266[_0x1dbc('0xd')]['message']);return _0x26fcf7(_0x299266['error'][_0x1dbc('0xf')]);}logger[_0x1dbc('0xd')](_0x1dbc('0x10'),_0x2a2931,_0x299266[_0x1dbc('0xd')][_0x1dbc('0xf')]);return _0x27ce01(_0x299266['error'][_0x1dbc('0xf')]);}else{logger[_0x1dbc('0x11')]('CmCompany,\x20%s,\x20%s',_0x2a2931,_0x1dbc('0xb'));_0x27ce01(_0x299266[_0x1dbc('0x12')][_0x1dbc('0xf')]);}})[_0x1dbc('0x13')](function(_0xe65a87){logger[_0x1dbc('0xd')](_0x1dbc('0x10'),_0x2a2931,_0xe65a87);_0x26fcf7(_0xe65a87);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4e0ffc0..77b6b1a 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 _0x0cc2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','update','delete','multer'];(function(_0x4f3b92,_0x1211a0){var _0x143ae7=function(_0x187368){while(--_0x187368){_0x4f3b92['push'](_0x4f3b92['shift']());}};_0x143ae7(++_0x1211a0);}(_0x0cc2,0x107));var _0x20cc=function(_0x389bb1,_0x218a7c){_0x389bb1=_0x389bb1-0x0;var _0x9d847f=_0x0cc2[_0x389bb1];return _0x9d847f;};'use strict';var multer=require(_0x20cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x20cc('0x1'));var express=require(_0x20cc('0x2'));var router=express[_0x20cc('0x3')]();var fs_extra=require(_0x20cc('0x4'));var auth=require(_0x20cc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20cc('0x6'));var controller=require(_0x20cc('0x7'));router[_0x20cc('0x8')]('/',auth[_0x20cc('0x9')](),controller[_0x20cc('0xa')]);router['get'](_0x20cc('0xb'),auth[_0x20cc('0x9')](),controller[_0x20cc('0xc')]);router[_0x20cc('0x8')](_0x20cc('0xd'),auth['isAuthenticated'](),controller[_0x20cc('0xe')]);router['get']('/:id/contacts',auth[_0x20cc('0x9')](),controller[_0x20cc('0xf')]);router[_0x20cc('0x10')]('/',auth[_0x20cc('0x9')](),controller['create']);router[_0x20cc('0x10')](_0x20cc('0x11'),auth['isAuthenticated'](),controller[_0x20cc('0x12')]);router[_0x20cc('0x13')]('/:id',auth[_0x20cc('0x9')](),controller[_0x20cc('0x14')]);router[_0x20cc('0x15')](_0x20cc('0xd'),auth[_0x20cc('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x510b=['post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id/contacts','getContacts'];(function(_0x29468e,_0x18c839){var _0x5afbfc=function(_0x48cd51){while(--_0x48cd51){_0x29468e['push'](_0x29468e['shift']());}};_0x5afbfc(++_0x18c839);}(_0x510b,0xea));var _0xb510=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x510b[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb510('0x0'));var util=require('util');var path=require(_0xb510('0x1'));var timeout=require(_0xb510('0x2'));var express=require(_0xb510('0x3'));var router=express['Router']();var fs_extra=require(_0xb510('0x4'));var auth=require(_0xb510('0x5'));var interaction=require(_0xb510('0x6'));var config=require(_0xb510('0x7'));var controller=require(_0xb510('0x8'));router[_0xb510('0x9')]('/',auth[_0xb510('0xa')](),controller[_0xb510('0xb')]);router[_0xb510('0x9')](_0xb510('0xc'),auth[_0xb510('0xa')](),controller[_0xb510('0xd')]);router[_0xb510('0x9')]('/:id',auth[_0xb510('0xa')](),controller['show']);router[_0xb510('0x9')](_0xb510('0xe'),auth[_0xb510('0xa')](),controller[_0xb510('0xf')]);router[_0xb510('0x10')]('/',auth[_0xb510('0xa')](),controller[_0xb510('0x11')]);router[_0xb510('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xb510('0x12')]);router[_0xb510('0x13')](_0xb510('0x14'),auth['isAuthenticated'](),controller[_0xb510('0x15')]);router[_0xb510('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb510('0x17')]);module[_0xb510('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 81401b6..e404cf3 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 _0xa71e=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x7b1f55,_0x3944dd){var _0x43989f=function(_0x1f7397){while(--_0x1f7397){_0x7b1f55['push'](_0x7b1f55['shift']());}};_0x43989f(++_0x3944dd);}(_0xa71e,0x152));var _0xea71=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0xa71e[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0xea71('0x0'));var Sequelize=require(_0xea71('0x1'));module[_0xea71('0x2')]={'firstName':{'type':Sequelize[_0xea71('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xea71('0x3')]},'postalCode':{'type':Sequelize[_0xea71('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xea71('0x3')]},'dateOfBirth':{'type':Sequelize[_0xea71('0x3')]},'description':{'type':Sequelize[_0xea71('0x4')]},'phone':{'type':Sequelize[_0xea71('0x3')]},'mobile':{'type':Sequelize[_0xea71('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xea71('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xea71('0x3')]},'fb_data':{'type':Sequelize[_0xea71('0x3')]},'twitter':{'type':Sequelize[_0xea71('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xea71('0x3')]},'viber':{'type':Sequelize[_0xea71('0x3')]},'line':{'type':Sequelize[_0xea71('0x3')]},'wechat':{'type':Sequelize[_0xea71('0x3')]},'telegram':{'type':Sequelize[_0xea71('0x3')]},'UserId':{'type':Sequelize[_0xea71('0x5')]},'priority':{'type':Sequelize[_0xea71('0x5')](0x2)[_0xea71('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xea71('0x7')],'defaultValue':Sequelize[_0xea71('0x8')]}}; \ No newline at end of file +var _0x2d01=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x1c067a,_0x33714b){var _0x551198=function(_0xae48ec){while(--_0xae48ec){_0x1c067a['push'](_0x1c067a['shift']());}};_0x551198(++_0x33714b);}(_0x2d01,0xf1));var _0x12d0=function(_0x2acef2,_0x3697dd){_0x2acef2=_0x2acef2-0x0;var _0x1f9fc2=_0x2d01[_0x2acef2];return _0x1f9fc2;};'use strict';var _=require(_0x12d0('0x0'));var Sequelize=require(_0x12d0('0x1'));module[_0x12d0('0x2')]={'firstName':{'type':Sequelize[_0x12d0('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x12d0('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x12d0('0x3')]},'description':{'type':Sequelize[_0x12d0('0x4')]},'phone':{'type':Sequelize[_0x12d0('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x12d0('0x3')]},'url':{'type':Sequelize[_0x12d0('0x3')]},'facebook':{'type':Sequelize[_0x12d0('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x12d0('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x12d0('0x3')]},'viber':{'type':Sequelize[_0x12d0('0x3')]},'line':{'type':Sequelize[_0x12d0('0x3')]},'wechat':{'type':Sequelize[_0x12d0('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x12d0('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x12d0('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x12d0('0x7')],'defaultValue':Sequelize[_0x12d0('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5b216a5..db76b7a 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 _0xd46c=['some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.lastName','c.phone','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','push','rows','tags','columnName','displayName','findAll','custom','catch','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','$and','format','cf_%d','omit','pickBy','table','cm_contacts','id\x20=\x20?','toParam','values','phone','CmHopper','getTags','findOne','rawAttributes','options','nolimit','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','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','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','binding','fork','stringify','start\x20child\x20process\x20correctly!','exit','mail','chat','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userSecondDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','osName','referer','subject','substatus','externalUrl','threadId','flatten','reverse','slice','moment','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','CmCustomField','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','from','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','text','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','filter','replace','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.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','agent'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0xd46c,0xa6));var _0xcd46=function(_0x1cfa1d,_0x126daf){_0x1cfa1d=_0x1cfa1d-0x0;var _0xe5cfa2=_0xd46c[_0x1cfa1d];return _0xe5cfa2;};'use strict';var moment=require(_0xcd46('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcd46('0x1'));var fs=require('fs');var _=require(_0xcd46('0x2'));var squel=require(_0xcd46('0x3'));var Papa=require(_0xcd46('0x4'));var Redis=require(_0xcd46('0x5'));var qs=require('../../components/parsers/qs');var as=require(_0xcd46('0x6'));var logger=require(_0xcd46('0x7'))(_0xcd46('0x8'));var config=require(_0xcd46('0x9'));var db=require(_0xcd46('0xa'))['db'];config[_0xcd46('0xb')]=_[_0xcd46('0xc')](config['redis'],{'host':_0xcd46('0xd'),'port':0x18eb});var socket=require(_0xcd46('0xe'))(new Redis(config[_0xcd46('0xb')]));require(_0xcd46('0xf'))[_0xcd46('0x10')](socket);function respondWithResult(_0x2769c1,_0x557bdd){_0x557bdd=_0x557bdd||0xc8;return function(_0xca47ba){if(_0xca47ba){return _0x2769c1[_0xcd46('0x11')](_0x557bdd)[_0xcd46('0x12')](_0xca47ba);}};}function respondWithFilteredResult(_0x2adfaa,_0x45728d){return function(_0x12dd9f){if(_0x12dd9f){var _0x31186a=typeof _0x45728d['offset']==='undefined'&&typeof _0x45728d['limit']===_0xcd46('0x13');var _0x365230=_0x12dd9f[_0xcd46('0x14')];var _0x57e9e6=_0x31186a?0x0:_0x45728d[_0xcd46('0x15')];var _0x562674=_0x31186a?_0x12dd9f[_0xcd46('0x14')]:_0x45728d[_0xcd46('0x15')]+_0x45728d[_0xcd46('0x16')];var _0x31758a;if(_0x562674>=_0x365230){_0x562674=_0x365230;_0x31758a=0xc8;}else{_0x31758a=0xce;}_0x2adfaa[_0xcd46('0x11')](_0x31758a);return _0x2adfaa[_0xcd46('0x17')](_0xcd46('0x18'),_0x57e9e6+'-'+_0x562674+'/'+_0x365230)['json'](_0x12dd9f);}return null;};}function saveUpdates(_0x412430){return function(_0x395f68){if(_0x395f68){return _0x395f68[_0xcd46('0x19')](_0x412430)[_0xcd46('0x1a')](function(_0x249dca){return _0x249dca;});}return null;};}function removeEntity(_0x3d0234){return function(_0x3cf68){if(_0x3cf68){return _0x3cf68[_0xcd46('0x1b')]()[_0xcd46('0x1a')](function(){_0x3d0234[_0xcd46('0x11')](0xcc)[_0xcd46('0x1c')]();});}};}function handleEntityNotFound(_0x448c5d){return function(_0x90fd4c){if(!_0x90fd4c){_0x448c5d[_0xcd46('0x1d')](0x194);}return _0x90fd4c;};}function handleError(_0xc7a061,_0x229da3){_0x229da3=_0x229da3||0x1f4;return function(_0x475b6d){logger[_0xcd46('0x1e')](_0x475b6d[_0xcd46('0x1f')]);if(_0x475b6d['name']){delete _0x475b6d[_0xcd46('0x20')];}_0xc7a061[_0xcd46('0x11')](_0x229da3)[_0xcd46('0x21')](_0x475b6d);};}exports[_0xcd46('0x22')]=function(_0x273b05,_0x1fc400){var _0x67c6d6={},_0x33adb0={},_0x36976c={'count':0x0,'rows':[]};return db[_0xcd46('0x23')][_0xcd46('0x24')]()[_0xcd46('0x1a')](function(_0x149895){var _0x385a2e=[];for(var _0x50c7a5=0x0;_0x50c7a50x1){_0x137a8f['or'](_0xcd46('0x60'),qs[_0xcd46('0x61')](_0x43011c),null);}else{if(qs[_0xcd46('0x62')](_0x43011c)){_0x137a8f['or'](_0xcd46('0x63'),_0x43011c+'%');_0x137a8f['or'](_0xcd46('0x64'),_0x43011c+'%');_0x137a8f['or'](_0xcd46('0x65'),_0x43011c+'%');_0x137a8f['or'](_0xcd46('0x66'),_0x43011c+'%');}else if(qs[_0xcd46('0x67')](_0x43011c)){_0x137a8f['or'](_0xcd46('0x68'),_0x43011c+'%');}else{_0x137a8f['or'](_0xcd46('0x69'),'%'+_0x43011c+'%');_0x137a8f['or'](_0xcd46('0x6a'),'%'+_0x43011c+'%');_0x137a8f['or'](_0xcd46('0x68'),'%'+_0x43011c+'%');}}}}_0x2ef600[_0xcd46('0x37')](_0x137a8f);_0x2ef600[_0xcd46('0x6b')](_0xcd46('0x6c'));var _0x54277c={'type':db[_0xcd46('0x6d')][_0xcd46('0x6e')][_0xcd46('0x6f')],'raw':!![]};var _0x31051d=_0x2ef600[_0xcd46('0x70')]()[_0xcd46('0x39')](_0xcd46('0x6c'));if(_0x67c6d6[_0xcd46('0x35')]){_0x67c6d6[_0xcd46('0x35')][_0xcd46('0x4a')](function(_0x4d6a4b){_0x2ef600['order']('c.'+_0x4d6a4b[0x0],_0x4d6a4b[0x1]===_0xcd46('0x71')?![]:!![]);});}if(!_[_0xcd46('0x57')](_0x2a9d87)){_0x2ef600['having'](_0x2f9c66);_0x31051d[_0xcd46('0x37')](_0xcd46('0x72'),_0x2a9d87);}BPromise['resolve']()[_0xcd46('0x1a')](function(){if(!_0x38ff70)return;if(_0x273b05['user']['role']!==_0xcd46('0x73'))return;if(!_[_0xcd46('0x74')](_0x38ff70['conditions'],[_0xcd46('0x39'),_0xcd46('0x4d')])){return _0x273b05[_0xcd46('0x75')][_0xcd46('0x76')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5006d7){if(_['isEmpty'](_0x5006d7)){_0x31051d[_0xcd46('0x37')](_0xcd46('0x77'));_0x2ef600[_0xcd46('0x37')](_0xcd46('0x77'));}else{_0x31051d[_0xcd46('0x37')]('c.ListId\x20IN\x20?',_[_0xcd46('0x49')](_0x5006d7,'id'));_0x2ef600['where'](_0xcd46('0x59'),_[_0xcd46('0x49')](_0x5006d7,'id'));}});}})[_0xcd46('0x1a')](function(){if(_0x273b05['user']['role']==='agent'&&!_0x38ff70&&!_0x273b05[_0xcd46('0x2f')][_0xcd46('0x58')])return[];return db[_0xcd46('0x78')][_0xcd46('0x2f')](_0x31051d[_0xcd46('0x79')](),_0x54277c);})[_0xcd46('0x1a')](function(_0x3c90a1){_0x36976c[_0xcd46('0x14')]=_0x3c90a1['length'];if(_0x36976c['count']===0x0)return[];return db['sequelize']['query'](_0x3a8087[_0xcd46('0x79')](),_0x54277c)[_0xcd46('0x1a')](function(_0x8d4b62){_0x56587d=_['keyBy'](_0x8d4b62,'id');_0x54277c=_[_0xcd46('0x7a')](_0x54277c,{'model':db[_0xcd46('0x23')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x273b05['query'][_0xcd46('0x33')]){_0x67c6d6[_0xcd46('0x32')][_0xcd46('0x4a')](function(_0x563c3c){_0x2ef600[_0xcd46('0x39')]('c.'+_0x563c3c);});}else{_0x2ef600['field']('c.id');_0x2ef600['field']('c.firstName');_0x2ef600[_0xcd46('0x39')](_0xcd46('0x7b'));_0x2ef600[_0xcd46('0x39')](_0xcd46('0x7c'));_0x2ef600[_0xcd46('0x39')]('c.mobile');_0x2ef600[_0xcd46('0x39')]('c.fax');_0x2ef600['field'](_0xcd46('0x7d'));_0x2ef600[_0xcd46('0x39')](_0xcd46('0x7e'));_0x2ef600[_0xcd46('0x39')](_0xcd46('0x7f'));_0x2ef600[_0xcd46('0x39')](_0xcd46('0x80'));_0x2ef600[_0xcd46('0x39')]('c.CompanyId');_0x2ef600[_0xcd46('0x39')](_0xcd46('0x81'),_0xcd46('0x82'));}if(_0x67c6d6['limit'])_0x2ef600[_0xcd46('0x16')](_0x67c6d6[_0xcd46('0x16')]);if(_0x67c6d6['offset'])_0x2ef600[_0xcd46('0x15')](_0x67c6d6[_0xcd46('0x15')]);return db[_0xcd46('0x78')][_0xcd46('0x2f')](_0x2ef600[_0xcd46('0x79')](),_0x54277c);});})['then'](function(_0x394b14){_0x394b14[_0xcd46('0x4a')](function(_0x10386c){if(_0x10386c[_0xcd46('0x82')]){_0x10386c['Tags']=[];_0x10386c[_0xcd46('0x82')]['split'](',')[_0xcd46('0x4a')](function(_0x566f76){_0x10386c[_0xcd46('0x83')][_0xcd46('0x84')](_0x56587d[_0x566f76]);});}delete _0x10386c[_0xcd46('0x82')];});_0x36976c[_0xcd46('0x85')]=_0x394b14;return _0x36976c;})[_0xcd46('0x1a')](respondWithFilteredResult(_0x1fc400,_0x67c6d6));})['catch'](handleError(_0x1fc400,null));};exports['destroy']=function(_0x489eeb,_0x5dfb29){return db['CmContact'][_0xcd46('0x46')]({'where':{'id':_0x489eeb['params']['id']}})['then'](handleEntityNotFound(_0x5dfb29,null))[_0xcd46('0x1a')](removeEntity(_0x5dfb29,null))['catch'](handleError(_0x5dfb29,null));};exports['describe']=function(_0xfe14d9,_0x209b15){return db['CmContact'][_0xcd46('0x24')]()[_0xcd46('0x1a')](function(_0x5e6ef4){delete _0x5e6ef4[_0xcd46('0x86')];for(var _0x187fb5=0x0;_0x187fb5=_0x1b4901){_0x9cbfc0=_0x1b4901;_0x119d16=0xc8;}else{_0x119d16=0xce;}_0x47d0a1[_0x9018('0x10')](_0x119d16);return _0x47d0a1['set'](_0x9018('0x16'),_0x2802ee+'-'+_0x9cbfc0+'/'+_0x1b4901)[_0x9018('0x11')](_0x1876ec);}return null;};}function saveUpdates(_0x5121e4){return function(_0x2cf378){if(_0x2cf378){return _0x2cf378[_0x9018('0x17')](_0x5121e4)[_0x9018('0x18')](function(_0x25c723){return _0x25c723;});}return null;};}function removeEntity(_0x85944f){return function(_0x49ad2c){if(_0x49ad2c){return _0x49ad2c[_0x9018('0x19')]()[_0x9018('0x18')](function(){_0x85944f[_0x9018('0x10')](0xcc)[_0x9018('0x1a')]();});}};}function handleEntityNotFound(_0x3ac4c2){return function(_0x7708cf){if(!_0x7708cf){_0x3ac4c2['sendStatus'](0x194);}return _0x7708cf;};}function handleError(_0x193df1,_0x162bff){_0x162bff=_0x162bff||0x1f4;return function(_0x3fb795){logger[_0x9018('0x1b')](_0x3fb795[_0x9018('0x1c')]);if(_0x3fb795[_0x9018('0x1d')]){delete _0x3fb795[_0x9018('0x1d')];}_0x193df1[_0x9018('0x10')](_0x162bff)['send'](_0x3fb795);};}exports[_0x9018('0x1e')]=function(_0x2199d8,_0x8eab74){var _0x2be9f1={},_0x340d6b={},_0x48e4ae={'count':0x0,'rows':[]};return db[_0x9018('0x1f')]['describe']()['then'](function(_0x10ae02){var _0x31f6c8=[];for(var _0x53d4d7=0x0;_0x53d4d70x1){_0x2ac0a5['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9018('0x60')](_0x2b1e26),null);}else{if(qs[_0x9018('0x61')](_0x2b1e26)){_0x2ac0a5['or']('c.id\x20LIKE\x20?',_0x2b1e26+'%');_0x2ac0a5['or'](_0x9018('0x62'),_0x2b1e26+'%');_0x2ac0a5['or']('c.mobile\x20LIKE\x20?',_0x2b1e26+'%');_0x2ac0a5['or'](_0x9018('0x63'),_0x2b1e26+'%');}else if(qs[_0x9018('0x64')](_0x2b1e26)){_0x2ac0a5['or'](_0x9018('0x65'),_0x2b1e26+'%');}else{_0x2ac0a5['or']('c.firstName\x20LIKE\x20?','%'+_0x2b1e26+'%');_0x2ac0a5['or']('c.lastName\x20LIKE\x20?','%'+_0x2b1e26+'%');_0x2ac0a5['or'](_0x9018('0x65'),'%'+_0x2b1e26+'%');}}}}_0x23394f['where'](_0x2ac0a5);_0x23394f[_0x9018('0x66')](_0x9018('0x67'));var _0x313d4d={'type':db[_0x9018('0x68')]['QueryTypes'][_0x9018('0x69')],'raw':!![]};var _0x378b80=_0x23394f[_0x9018('0x6a')]()[_0x9018('0x36')]('c.id');if(_0x2be9f1[_0x9018('0x31')]){_0x2be9f1[_0x9018('0x31')][_0x9018('0x47')](function(_0x430375){_0x23394f[_0x9018('0x31')]('c.'+_0x430375[0x0],_0x430375[0x1]===_0x9018('0x6b')?![]:!![]);});}if(!_[_0x9018('0x57')](_0x2d1831)){_0x23394f[_0x9018('0x6c')](_0x22c634);_0x378b80['where'](_0x9018('0x6d'),_0x2d1831);}BPromise[_0x9018('0x6e')]()[_0x9018('0x18')](function(){if(!_0xa8c312)return;if(_0x2199d8[_0x9018('0x6f')][_0x9018('0x70')]!==_0x9018('0x71'))return;if(!_['some'](_0xa8c312[_0x9018('0x43')],[_0x9018('0x36'),_0x9018('0x4a')])){return _0x2199d8['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x9018('0x18')](function(_0x42c363){if(_[_0x9018('0x57')](_0x42c363)){_0x378b80[_0x9018('0x33')](_0x9018('0x72'));_0x23394f['where'](_0x9018('0x72'));}else{_0x378b80[_0x9018('0x33')]('c.ListId\x20IN\x20?',_[_0x9018('0x54')](_0x42c363,'id'));_0x23394f[_0x9018('0x33')](_0x9018('0x59'),_[_0x9018('0x54')](_0x42c363,'id'));}});}})[_0x9018('0x18')](function(){if(_0x2199d8['user'][_0x9018('0x70')]===_0x9018('0x71')&&!_0xa8c312&&!_0x2199d8['query'][_0x9018('0x58')])return[];return db[_0x9018('0x73')][_0x9018('0x2b')](_0x378b80[_0x9018('0x74')](),_0x313d4d);})[_0x9018('0x18')](function(_0x5c7bb9){_0x48e4ae['count']=_0x5c7bb9['length'];if(_0x48e4ae[_0x9018('0x15')]===0x0)return[];return db[_0x9018('0x73')][_0x9018('0x2b')](_0x51b82f[_0x9018('0x74')](),_0x313d4d)[_0x9018('0x18')](function(_0x12d586){_0x352aec=_['keyBy'](_0x12d586,'id');_0x313d4d=_[_0x9018('0x75')](_0x313d4d,{'model':db[_0x9018('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2199d8[_0x9018('0x2b')]['fields']){_0x2be9f1[_0x9018('0x2f')][_0x9018('0x47')](function(_0x5bc9aa){_0x23394f[_0x9018('0x36')]('c.'+_0x5bc9aa);});}else{_0x23394f[_0x9018('0x36')]('c.id');_0x23394f[_0x9018('0x36')](_0x9018('0x76'));_0x23394f[_0x9018('0x36')](_0x9018('0x77'));_0x23394f[_0x9018('0x36')](_0x9018('0x78'));_0x23394f[_0x9018('0x36')](_0x9018('0x79'));_0x23394f['field'](_0x9018('0x7a'));_0x23394f[_0x9018('0x36')]('c.email');_0x23394f[_0x9018('0x36')](_0x9018('0x7b'));_0x23394f[_0x9018('0x36')]('c.createdAt');_0x23394f[_0x9018('0x36')](_0x9018('0x7c'));_0x23394f[_0x9018('0x36')](_0x9018('0x7d'));_0x23394f['field'](_0x9018('0x7e'),'TagIds');}if(_0x2be9f1[_0x9018('0x14')])_0x23394f['limit'](_0x2be9f1[_0x9018('0x14')]);if(_0x2be9f1[_0x9018('0x12')])_0x23394f[_0x9018('0x12')](_0x2be9f1[_0x9018('0x12')]);return db[_0x9018('0x73')]['query'](_0x23394f[_0x9018('0x74')](),_0x313d4d);});})[_0x9018('0x18')](function(_0x2e465c){_0x2e465c[_0x9018('0x47')](function(_0x4e13e4){if(_0x4e13e4[_0x9018('0x7f')]){_0x4e13e4[_0x9018('0x80')]=[];_0x4e13e4['TagIds'][_0x9018('0x5f')](',')[_0x9018('0x47')](function(_0x33191f){_0x4e13e4[_0x9018('0x80')][_0x9018('0x23')](_0x352aec[_0x33191f]);});}delete _0x4e13e4[_0x9018('0x7f')];});_0x48e4ae[_0x9018('0x81')]=_0x2e465c;return _0x48e4ae;})[_0x9018('0x18')](respondWithFilteredResult(_0x8eab74,_0x2be9f1));})[_0x9018('0x82')](handleError(_0x8eab74,null));};exports[_0x9018('0x19')]=function(_0x4e858f,_0x41cbb4){return db['CmContact']['find']({'where':{'id':_0x4e858f[_0x9018('0x83')]['id']}})[_0x9018('0x18')](handleEntityNotFound(_0x41cbb4,null))[_0x9018('0x18')](removeEntity(_0x41cbb4,null))['catch'](handleError(_0x41cbb4,null));};exports[_0x9018('0x84')]=function(_0x301bfd,_0x4caa92){return db['CmContact'][_0x9018('0x84')]()[_0x9018('0x18')](function(_0x43167a){delete _0x43167a['tags'];for(var _0x4ceb6b=0x0;_0x4ceb6b{}\s\\|]/g,'-');_0x5be6b0(null,util[_0x436f('0x1d')](_0x436f('0x1e'),path[_0x436f('0x1f')](_0x33a9ed[_0x436f('0x1c')],path['extname'](_0x33a9ed[_0x436f('0x1c')])),Date['now'](),path[_0x436f('0x20')](_0x33a9ed[_0x436f('0x1c')])));}})});router[_0x436f('0x12')]('/csv',upload[_0x436f('0x21')](_0x436f('0x22')),controller[_0x436f('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43ed42,_0x375b20,_0x41d64e){_0x41d64e(null,path[_0x436f('0x19')](config['root'],_0x436f('0x1b')));},'filename':function(_0xf97672,_0x317321,_0x351009){_0x317321['originalname']=_0x317321[_0x436f('0x1c')][_0x436f('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x351009(null,util['format']('%s-%s%s',path['basename'](_0x317321[_0x436f('0x1c')],path[_0x436f('0x20')](_0x317321[_0x436f('0x1c')])),Date['now'](),path[_0x436f('0x20')](_0x317321[_0x436f('0x1c')])));}})});router['post'](_0x436f('0x25'),upload[_0x436f('0x21')](_0x436f('0x22')),controller[_0x436f('0x26')]);router['post'](_0x436f('0x27'),auth['isAuthenticated'](),controller[_0x436f('0x28')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x436f('0x29')]);router[_0x436f('0x2a')]('/:id',auth[_0x436f('0x7')](),controller[_0x436f('0x2b')]);module[_0x436f('0x2c')]=router; \ No newline at end of file +var _0x3915=['../../config/environment','./cmContact.controller','get','index','/describe','isAuthenticated','/:id','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','basename','extname','/csv','single','file','now','upload','/upload/:id','import','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a7e45,_0x2ba299){var _0x469637=function(_0x4ad4b2){while(--_0x4ad4b2){_0x4a7e45['push'](_0x4a7e45['shift']());}};_0x469637(++_0x2ba299);}(_0x3915,0x11e));var _0x5391=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x3915[_0x56e32e];return _0x2a757b;};'use strict';var multer=require('multer');var util=require(_0x5391('0x0'));var path=require(_0x5391('0x1'));var timeout=require(_0x5391('0x2'));var express=require(_0x5391('0x3'));var router=express[_0x5391('0x4')]();var fs_extra=require(_0x5391('0x5'));var auth=require(_0x5391('0x6'));var interaction=require(_0x5391('0x7'));var config=require(_0x5391('0x8'));var controller=require(_0x5391('0x9'));router[_0x5391('0xa')]('/',auth['isAuthenticated'](),controller[_0x5391('0xb')]);router[_0x5391('0xa')](_0x5391('0xc'),auth[_0x5391('0xd')](),controller['describe']);router[_0x5391('0xa')](_0x5391('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5391('0xa')](_0x5391('0xf'),auth[_0x5391('0xd')](),controller['getTags']);router['get'](_0x5391('0x10'),auth[_0x5391('0xd')](),controller[_0x5391('0x11')]);router[_0x5391('0xa')](_0x5391('0x12'),auth[_0x5391('0xd')](),controller[_0x5391('0x13')]);router[_0x5391('0xa')](_0x5391('0x14'),auth[_0x5391('0xd')](),controller[_0x5391('0x15')]);router[_0x5391('0xa')]('/:id/jscripty_sessions',auth[_0x5391('0xd')](),controller[_0x5391('0x16')]);router[_0x5391('0xa')](_0x5391('0x17'),auth[_0x5391('0xd')](),controller['getJourney']);router[_0x5391('0x18')](_0x5391('0x19'),auth[_0x5391('0xd')](),controller[_0x5391('0x1a')]);router['post']('/',auth[_0x5391('0xd')](),controller[_0x5391('0x1b')]);router[_0x5391('0x18')](_0x5391('0x1c'),auth[_0x5391('0xd')](),controller[_0x5391('0x1d')]);router[_0x5391('0x18')](_0x5391('0xf'),auth[_0x5391('0xd')](),controller['setTags']);var upload=multer({'storage':multer[_0x5391('0x1e')]({'destination':function(_0x595ec0,_0x38350a,_0x1dc69a){_0x1dc69a(null,path[_0x5391('0x1f')](config[_0x5391('0x20')],_0x5391('0x21')));},'filename':function(_0x1cdd20,_0xe56254,_0x56e6ca){_0xe56254[_0x5391('0x22')]=_0xe56254['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56e6ca(null,util[_0x5391('0x23')](_0x5391('0x24'),path[_0x5391('0x25')](_0xe56254[_0x5391('0x22')],path[_0x5391('0x26')](_0xe56254[_0x5391('0x22')])),Date['now'](),path[_0x5391('0x26')](_0xe56254[_0x5391('0x22')])));}})});router['post'](_0x5391('0x27'),upload[_0x5391('0x28')](_0x5391('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x5391('0x1e')]({'destination':function(_0x57e07c,_0xe13bdb,_0x39b7ee){_0x39b7ee(null,path[_0x5391('0x1f')](config[_0x5391('0x20')],'server/files/tmp'));},'filename':function(_0x3e101d,_0x29e856,_0x776851){_0x29e856['originalname']=_0x29e856[_0x5391('0x22')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x776851(null,util['format'](_0x5391('0x24'),path['basename'](_0x29e856[_0x5391('0x22')],path['extname'](_0x29e856[_0x5391('0x22')])),Date[_0x5391('0x2a')](),path[_0x5391('0x26')](_0x29e856[_0x5391('0x22')])));}})});router[_0x5391('0x18')]('/upload',upload[_0x5391('0x28')](_0x5391('0x29')),controller[_0x5391('0x2b')]);router[_0x5391('0x18')](_0x5391('0x2c'),auth[_0x5391('0xd')](),controller[_0x5391('0x2d')]);router[_0x5391('0x2e')](_0x5391('0xe'),auth[_0x5391('0xd')](),controller['update']);router[_0x5391('0x2f')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5391('0x30')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ea2b620..f959ea8 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 _0x5842=['name','TEXT','long','type','select','parse','values','isArray','BOOLEAN','voice','lodash','exports','getDataValue','alias','STRING','setDataValue'];(function(_0x91cc04,_0x48e6a6){var _0x26b085=function(_0x2720bf){while(--_0x2720bf){_0x91cc04['push'](_0x91cc04['shift']());}};_0x26b085(++_0x48e6a6);}(_0x5842,0xba));var _0x2584=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5842[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2584('0x0'));module[_0x2584('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b1e96){return this[_0x2584('0x2')](_0x2584('0x3'));}},'alias':{'type':Sequelize[_0x2584('0x4')],'allowNull':![],'set':function(_0x28dc8a){this[_0x2584('0x5')](_0x2584('0x3'),_0x28dc8a?_0x28dc8a:this['getDataValue'](_0x2584('0x6')));}},'type':{'type':Sequelize[_0x2584('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x2584('0x7')](_0x2584('0x8')),'get':function(){if(this[_0x2584('0x2')](_0x2584('0x9'))===_0x2584('0xa')){return JSON[_0x2584('0xb')](this[_0x2584('0x2')](_0x2584('0xc')));}else{return this[_0x2584('0x2')](_0x2584('0xc'));}},'set':function(_0x1fb0e1){if(Array[_0x2584('0xd')](_0x1fb0e1)){this[_0x2584('0x5')](_0x2584('0xc'),JSON['stringify'](_0x1fb0e1));}else{this[_0x2584('0x5')](_0x2584('0xc'),_0x1fb0e1);}}},'required':{'type':Sequelize[_0x2584('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2584('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x2584('0xf'))}}; \ No newline at end of file +var _0x0b56=['voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values','stringify','BOOLEAN','ENUM'];(function(_0x184928,_0x590a72){var _0x40255f=function(_0x5013e6){while(--_0x5013e6){_0x184928['push'](_0x184928['shift']());}};_0x40255f(++_0x590a72);}(_0x0b56,0xef));var _0x60b5=function(_0x38d9fd,_0x3ee826){_0x38d9fd=_0x38d9fd-0x0;var _0x4b57e8=_0x0b56[_0x38d9fd];return _0x4b57e8;};'use strict';var Sequelize=require(_0x60b5('0x0'));var _=require(_0x60b5('0x1'));module[_0x60b5('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b19ad){return this[_0x60b5('0x3')](_0x60b5('0x4'));}},'alias':{'type':Sequelize[_0x60b5('0x5')],'allowNull':![],'set':function(_0x13ecc5){this[_0x60b5('0x6')]('alias',_0x13ecc5?_0x13ecc5:this[_0x60b5('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x60b5('0x7')](_0x60b5('0x8')),'get':function(){if(this[_0x60b5('0x3')](_0x60b5('0x9'))===_0x60b5('0xa')){return JSON[_0x60b5('0xb')](this[_0x60b5('0x3')](_0x60b5('0xc')));}else{return this['getDataValue'](_0x60b5('0xc'));}},'set':function(_0x23c062){if(Array['isArray'](_0x23c062)){this['setDataValue'](_0x60b5('0xc'),JSON[_0x60b5('0xd')](_0x23c062));}else{this[_0x60b5('0x6')](_0x60b5('0xc'),_0x23c062);}}},'required':{'type':Sequelize[_0x60b5('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x60b5('0xf')](_0x60b5('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1fe9fd2..b4d7644 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 _0x78b8=['cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','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','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','CmCustomField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','rawAttributes','options','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn'];(function(_0x3eb450,_0x592b0a){var _0x2c4cfd=function(_0x34f5dc){while(--_0x34f5dc){_0x3eb450['push'](_0x3eb450['shift']());}};_0x2c4cfd(++_0x592b0a);}(_0x78b8,0x16b));var _0x878b=function(_0x775a25,_0x52deec){_0x775a25=_0x775a25-0x0;var _0x42a9aa=_0x78b8[_0x775a25];return _0x42a9aa;};'use strict';var emlformat=require(_0x878b('0x0'));var rimraf=require(_0x878b('0x1'));var zipdir=require(_0x878b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x878b('0x3'));var moment=require(_0x878b('0x4'));var BPromise=require(_0x878b('0x5'));var Mustache=require('mustache');var util=require(_0x878b('0x6'));var path=require(_0x878b('0x7'));var sox=require(_0x878b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x878b('0x9'));var _=require(_0x878b('0xa'));var squel=require(_0x878b('0xb'));var crypto=require(_0x878b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x878b('0xd'));var toCsv=require(_0x878b('0xe'));var querystring=require(_0x878b('0xf'));var Papa=require(_0x878b('0x10'));var Redis=require(_0x878b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x878b('0x12'));var as=require(_0x878b('0x13'));var hardwareService=require(_0x878b('0x14'));var logger=require(_0x878b('0x15'))(_0x878b('0x16'));var utils=require(_0x878b('0x17'));var config=require(_0x878b('0x18'));var licenseUtil=require(_0x878b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa079ec,_0x2cede2){_0x2cede2=_0x2cede2||0xcc;return function(_0x43a352){if(_0x43a352){return _0xa079ec[_0x878b('0x1a')](_0x2cede2);}return _0xa079ec[_0x878b('0x1b')](_0x2cede2)[_0x878b('0x1c')]();};}function respondWithResult(_0x3aa520,_0x3dbc5b){_0x3dbc5b=_0x3dbc5b||0xc8;return function(_0x314a30){if(_0x314a30){return _0x3aa520[_0x878b('0x1b')](_0x3dbc5b)[_0x878b('0x1d')](_0x314a30);}};}function respondWithFilteredResult(_0x25f89d,_0xd13fed){return function(_0x333796){if(_0x333796){var _0x12ffa2=typeof _0xd13fed['offset']===_0x878b('0x1e')&&typeof _0xd13fed[_0x878b('0x1f')]==='undefined';var _0x584df4=_0x333796['count'];var _0x36d296=_0x12ffa2?0x0:_0xd13fed[_0x878b('0x20')];var _0x10ba22=_0x12ffa2?_0x333796[_0x878b('0x21')]:_0xd13fed[_0x878b('0x20')]+_0xd13fed[_0x878b('0x1f')];var _0x1112c6;if(_0x10ba22>=_0x584df4){_0x10ba22=_0x584df4;_0x1112c6=0xc8;}else{_0x1112c6=0xce;}_0x25f89d[_0x878b('0x1b')](_0x1112c6);return _0x25f89d[_0x878b('0x22')](_0x878b('0x23'),_0x36d296+'-'+_0x10ba22+'/'+_0x584df4)[_0x878b('0x1d')](_0x333796);}return null;};}function patchUpdates(_0x30e7af){return function(_0x1973ca){try{jsonpatch[_0x878b('0x24')](_0x1973ca,_0x30e7af,!![]);}catch(_0x2637a9){return BPromise[_0x878b('0x25')](_0x2637a9);}return _0x1973ca[_0x878b('0x26')]();};}function saveUpdates(_0x40ac26,_0x1b234a){return function(_0x4c05ec){if(_0x4c05ec){return _0x4c05ec['update'](_0x40ac26)['then'](function(_0x34fb23){return _0x34fb23;});}return null;};}function removeEntity(_0x3ce920,_0xec3b4c){return function(_0xadd464){if(_0xadd464){return _0xadd464[_0x878b('0x27')]()[_0x878b('0x28')](function(){_0x3ce920[_0x878b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64326e,_0x486232){return function(_0x3524d1){if(!_0x3524d1){_0x64326e['sendStatus'](0x194);}return _0x3524d1;};}function handleError(_0x48dc1b,_0x3e10df){_0x3e10df=_0x3e10df||0x1f4;return function(_0x274b27){logger['error'](_0x274b27[_0x878b('0x29')]);if(_0x274b27[_0x878b('0x2a')]){delete _0x274b27[_0x878b('0x2a')];}_0x48dc1b['status'](_0x3e10df)[_0x878b('0x2b')](_0x274b27);};}exports[_0x878b('0x2c')]=function(_0x237185,_0x50c0e4){var _0x51c74e={},_0x11702d={},_0x45f70b={'count':0x0,'rows':[]};var _0x4792b1=_[_0x878b('0x2d')](db[_0x878b('0x2e')]['rawAttributes'],function(_0x51dbee){return{'name':_0x51dbee[_0x878b('0x2f')],'type':_0x51dbee[_0x878b('0x30')]['key']};});_0x11702d[_0x878b('0x31')]=_['differenceBy'](_[_0x878b('0x2d')](_0x4792b1,_0x878b('0x2a')),['name']);_0x11702d[_0x878b('0x32')]=_[_0x878b('0x33')](_0x237185[_0x878b('0x32')]);_0x11702d[_0x878b('0x34')]=_[_0x878b('0x35')](_0x11702d[_0x878b('0x31')],_0x11702d['query']);_0x51c74e[_0x878b('0x36')]=_[_0x878b('0x35')](_0x11702d[_0x878b('0x31')],qs[_0x878b('0x37')](_0x237185[_0x878b('0x32')]['fields']));_0x51c74e['attributes']=_0x51c74e['attributes'][_0x878b('0x38')]?_0x51c74e[_0x878b('0x36')]:_0x11702d[_0x878b('0x31')];if(!_0x237185[_0x878b('0x32')][_0x878b('0x39')](_0x878b('0x3a'))){_0x51c74e[_0x878b('0x1f')]=qs[_0x878b('0x1f')](_0x237185['query'][_0x878b('0x1f')]);_0x51c74e[_0x878b('0x20')]=qs[_0x878b('0x20')](_0x237185[_0x878b('0x32')][_0x878b('0x20')]);}_0x51c74e[_0x878b('0x3b')]=qs[_0x878b('0x3c')](_0x237185[_0x878b('0x32')][_0x878b('0x3c')]);_0x51c74e['where']=qs[_0x878b('0x34')](_['pick'](_0x237185[_0x878b('0x32')],_0x11702d[_0x878b('0x34')]),_0x4792b1);if(_0x237185[_0x878b('0x32')][_0x878b('0x3d')]){_0x51c74e[_0x878b('0x3e')]=_[_0x878b('0x3f')](_0x51c74e[_0x878b('0x3e')],{'$or':_[_0x878b('0x2d')](_0x4792b1,function(_0x78074d){if(_0x78074d[_0x878b('0x30')]!==_0x878b('0x40')){var _0x47c2cc={};_0x47c2cc[_0x78074d[_0x878b('0x2a')]]={'$like':'%'+_0x237185[_0x878b('0x32')]['filter']+'%'};return _0x47c2cc;}})});}_0x51c74e=_[_0x878b('0x3f')]({},_0x51c74e,_0x237185['options']);var _0x5441d0={'where':_0x51c74e['where']};return db[_0x878b('0x2e')][_0x878b('0x21')](_0x5441d0)[_0x878b('0x28')](function(_0x3c2e82){_0x45f70b[_0x878b('0x21')]=_0x3c2e82;if(_0x237185['query'][_0x878b('0x41')]){_0x51c74e[_0x878b('0x42')]=[{'all':!![]}];}return db[_0x878b('0x2e')][_0x878b('0x43')](_0x51c74e);})[_0x878b('0x28')](function(_0x45a8f2){_0x45f70b['rows']=_0x45a8f2;return _0x45f70b;})[_0x878b('0x28')](respondWithFilteredResult(_0x50c0e4,_0x51c74e))[_0x878b('0x44')](handleError(_0x50c0e4,null));};exports[_0x878b('0x45')]=function(_0x3d8b75,_0x316173){var _0x68d8e4={'raw':!![],'where':{'id':_0x3d8b75['params']['id']}},_0x83634a={};_0x83634a[_0x878b('0x31')]=_[_0x878b('0x33')](db[_0x878b('0x2e')][_0x878b('0x46')]);_0x83634a[_0x878b('0x32')]=_[_0x878b('0x33')](_0x3d8b75[_0x878b('0x32')]);_0x83634a[_0x878b('0x34')]=_[_0x878b('0x35')](_0x83634a['model'],_0x83634a[_0x878b('0x32')]);_0x68d8e4[_0x878b('0x36')]=_[_0x878b('0x35')](_0x83634a[_0x878b('0x31')],qs[_0x878b('0x37')](_0x3d8b75[_0x878b('0x32')][_0x878b('0x37')]));_0x68d8e4[_0x878b('0x36')]=_0x68d8e4[_0x878b('0x36')][_0x878b('0x38')]?_0x68d8e4[_0x878b('0x36')]:_0x83634a[_0x878b('0x31')];if(_0x3d8b75[_0x878b('0x32')][_0x878b('0x41')]){_0x68d8e4[_0x878b('0x42')]=[{'all':!![]}];}_0x68d8e4=_[_0x878b('0x3f')]({},_0x68d8e4,_0x3d8b75[_0x878b('0x47')]);return db['CmCustomField']['find'](_0x68d8e4)[_0x878b('0x28')](handleEntityNotFound(_0x316173,null))[_0x878b('0x28')](respondWithResult(_0x316173,null))['catch'](handleError(_0x316173,null));};exports['update']=function(_0x297cd7,_0x2bc8b4){if(_0x297cd7['body']['id']){delete _0x297cd7[_0x878b('0x48')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x297cd7['params']['id']}})[_0x878b('0x28')](handleEntityNotFound(_0x2bc8b4,null))[_0x878b('0x28')](saveUpdates(_0x297cd7[_0x878b('0x48')],null))[_0x878b('0x28')](respondWithResult(_0x2bc8b4,null))[_0x878b('0x44')](handleError(_0x2bc8b4,null));};exports['destroy']=function(_0xe445f0,_0x5ebc01){return db[_0x878b('0x2e')]['find']({'where':{'id':_0xe445f0[_0x878b('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ebc01,null))['then'](removeEntity(_0x5ebc01,null))[_0x878b('0x44')](handleError(_0x5ebc01,null));};exports[_0x878b('0x4a')]=function(_0x3a13f8,_0x1b4a85){var _0x23fc77;return db[_0x878b('0x4b')][_0x878b('0x4c')](function(_0x2df97a){return db[_0x878b('0x2e')]['create'](_0x3a13f8[_0x878b('0x48')],{'transaction':_0x2df97a})[_0x878b('0x28')](function(_0x59da7f){_0x23fc77=_0x59da7f;var _0x4b9af0={'type':db[_0x878b('0x4d')][_0x878b('0x4e')],'transaction':_0x2df97a};switch(_0x3a13f8[_0x878b('0x48')][_0x878b('0x30')]){case _0x878b('0x4f'):_0x4b9af0[_0x878b('0x30')]=db[_0x878b('0x4d')]['TEXT'];break;case _0x878b('0x50'):_0x4b9af0[_0x878b('0x30')]=db[_0x878b('0x4d')][_0x878b('0x51')];break;case _0x878b('0x52'):_0x4b9af0['type']=db[_0x878b('0x4d')][_0x878b('0x53')];_0x4b9af0[_0x878b('0x54')]=![];break;default:}return db[_0x878b('0x4b')][_0x878b('0x55')][_0x878b('0x56')](_0x878b('0x57'),util[_0x878b('0x58')](_0x878b('0x59'),_0x23fc77['id']),_0x4b9af0);})[_0x878b('0x28')](function(){return _0x23fc77;});})[_0x878b('0x28')](respondWithResult(_0x1b4a85,0xc9))[_0x878b('0x44')](handleError(_0x1b4a85,null));}; \ No newline at end of file +var _0x063f=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','reject','update','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','findAll','then','rows','catch','show','keys','intersection','include','find','body','params','transaction','create','Sequelize','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','cf_%d','rimraf','zip-dir'];(function(_0x4c6112,_0x3ad976){var _0x43a114=function(_0x2a6895){while(--_0x2a6895){_0x4c6112['push'](_0x4c6112['shift']());}};_0x43a114(++_0x3ad976);}(_0x063f,0x1a2));var _0xf063=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x063f[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf063('0x0'));var zipdir=require(_0xf063('0x1'));var jsonpatch=require(_0xf063('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf063('0x3'));var Mustache=require(_0xf063('0x4'));var util=require(_0xf063('0x5'));var path=require(_0xf063('0x6'));var sox=require(_0xf063('0x7'));var csv=require(_0xf063('0x8'));var ejs=require(_0xf063('0x9'));var fs=require('fs');var fs_extra=require(_0xf063('0xa'));var _=require(_0xf063('0xb'));var squel=require(_0xf063('0xc'));var crypto=require('crypto');var jsforce=require(_0xf063('0xd'));var deskjs=require(_0xf063('0xe'));var toCsv=require(_0xf063('0x8'));var querystring=require(_0xf063('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf063('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf063('0x11'));var logger=require(_0xf063('0x12'))('api');var utils=require(_0xf063('0x13'));var config=require(_0xf063('0x14'));var licenseUtil=require(_0xf063('0x15'));var db=require(_0xf063('0x16'))['db'];function respondWithStatusCode(_0x8c4a57,_0x19f8cd){_0x19f8cd=_0x19f8cd||0xcc;return function(_0x1d1af6){if(_0x1d1af6){return _0x8c4a57['sendStatus'](_0x19f8cd);}return _0x8c4a57[_0xf063('0x17')](_0x19f8cd)[_0xf063('0x18')]();};}function respondWithResult(_0x1beb0a,_0x412df8){_0x412df8=_0x412df8||0xc8;return function(_0x47634e){if(_0x47634e){return _0x1beb0a[_0xf063('0x17')](_0x412df8)[_0xf063('0x19')](_0x47634e);}};}function respondWithFilteredResult(_0x51e053,_0x230aad){return function(_0x5192d6){if(_0x5192d6){var _0xc43ff5=typeof _0x230aad[_0xf063('0x1a')]===_0xf063('0x1b')&&typeof _0x230aad[_0xf063('0x1c')]===_0xf063('0x1b');var _0xc8ae24=_0x5192d6['count'];var _0x91abf8=_0xc43ff5?0x0:_0x230aad[_0xf063('0x1a')];var _0x5165aa=_0xc43ff5?_0x5192d6['count']:_0x230aad[_0xf063('0x1a')]+_0x230aad[_0xf063('0x1c')];var _0x4ea04b;if(_0x5165aa>=_0xc8ae24){_0x5165aa=_0xc8ae24;_0x4ea04b=0xc8;}else{_0x4ea04b=0xce;}_0x51e053[_0xf063('0x17')](_0x4ea04b);return _0x51e053[_0xf063('0x1d')]('Content-Range',_0x91abf8+'-'+_0x5165aa+'/'+_0xc8ae24)[_0xf063('0x19')](_0x5192d6);}return null;};}function patchUpdates(_0x3cfb9c){return function(_0x142614){try{jsonpatch['apply'](_0x142614,_0x3cfb9c,!![]);}catch(_0x20752b){return BPromise[_0xf063('0x1e')](_0x20752b);}return _0x142614['save']();};}function saveUpdates(_0x2bbc1c,_0x115b1f){return function(_0x328698){if(_0x328698){return _0x328698[_0xf063('0x1f')](_0x2bbc1c)['then'](function(_0x507d10){return _0x507d10;});}return null;};}function removeEntity(_0x291000,_0xc8f4a9){return function(_0x544388){if(_0x544388){return _0x544388['destroy']()['then'](function(){_0x291000['status'](0xcc)[_0xf063('0x18')]();});}};}function handleEntityNotFound(_0x4e3b6a,_0x21354e){return function(_0x5ccc61){if(!_0x5ccc61){_0x4e3b6a[_0xf063('0x20')](0x194);}return _0x5ccc61;};}function handleError(_0xa11d1a,_0x2a0162){_0x2a0162=_0x2a0162||0x1f4;return function(_0x1682f6){logger[_0xf063('0x21')](_0x1682f6[_0xf063('0x22')]);if(_0x1682f6[_0xf063('0x23')]){delete _0x1682f6['name'];}_0xa11d1a[_0xf063('0x17')](_0x2a0162)[_0xf063('0x24')](_0x1682f6);};}exports[_0xf063('0x25')]=function(_0x5c2e2b,_0x4a72e8){var _0x4260b9={},_0x1919d1={},_0xcc0eb5={'count':0x0,'rows':[]};var _0x2c1a9c=_[_0xf063('0x26')](db[_0xf063('0x27')][_0xf063('0x28')],function(_0x1f863a){return{'name':_0x1f863a[_0xf063('0x29')],'type':_0x1f863a[_0xf063('0x2a')][_0xf063('0x2b')]};});_0x1919d1['model']=_['differenceBy'](_[_0xf063('0x26')](_0x2c1a9c,_0xf063('0x23')),[_0xf063('0x23')]);_0x1919d1[_0xf063('0x2c')]=_['keys'](_0x5c2e2b[_0xf063('0x2c')]);_0x1919d1['filters']=_['intersection'](_0x1919d1['model'],_0x1919d1[_0xf063('0x2c')]);_0x4260b9['attributes']=_['intersection'](_0x1919d1[_0xf063('0x2d')],qs['fields'](_0x5c2e2b['query'][_0xf063('0x2e')]));_0x4260b9[_0xf063('0x2f')]=_0x4260b9[_0xf063('0x2f')][_0xf063('0x30')]?_0x4260b9[_0xf063('0x2f')]:_0x1919d1[_0xf063('0x2d')];if(!_0x5c2e2b['query'][_0xf063('0x31')](_0xf063('0x32'))){_0x4260b9[_0xf063('0x1c')]=qs[_0xf063('0x1c')](_0x5c2e2b[_0xf063('0x2c')]['limit']);_0x4260b9[_0xf063('0x1a')]=qs[_0xf063('0x1a')](_0x5c2e2b[_0xf063('0x2c')][_0xf063('0x1a')]);}_0x4260b9[_0xf063('0x33')]=qs[_0xf063('0x34')](_0x5c2e2b[_0xf063('0x2c')][_0xf063('0x34')]);_0x4260b9['where']=qs[_0xf063('0x35')](_[_0xf063('0x36')](_0x5c2e2b['query'],_0x1919d1[_0xf063('0x35')]),_0x2c1a9c);if(_0x5c2e2b[_0xf063('0x2c')][_0xf063('0x37')]){_0x4260b9[_0xf063('0x38')]=_['merge'](_0x4260b9[_0xf063('0x38')],{'$or':_[_0xf063('0x26')](_0x2c1a9c,function(_0x4cf4ec){if(_0x4cf4ec[_0xf063('0x2a')]!=='VIRTUAL'){var _0xb3c0ea={};_0xb3c0ea[_0x4cf4ec[_0xf063('0x23')]]={'$like':'%'+_0x5c2e2b['query'][_0xf063('0x37')]+'%'};return _0xb3c0ea;}})});}_0x4260b9=_[_0xf063('0x39')]({},_0x4260b9,_0x5c2e2b[_0xf063('0x3a')]);var _0x19cdd4={'where':_0x4260b9[_0xf063('0x38')]};return db[_0xf063('0x27')]['count'](_0x19cdd4)['then'](function(_0x3fb906){_0xcc0eb5[_0xf063('0x3b')]=_0x3fb906;if(_0x5c2e2b[_0xf063('0x2c')][_0xf063('0x3c')]){_0x4260b9['include']=[{'all':!![]}];}return db['CmCustomField'][_0xf063('0x3d')](_0x4260b9);})[_0xf063('0x3e')](function(_0x2f8e1a){_0xcc0eb5[_0xf063('0x3f')]=_0x2f8e1a;return _0xcc0eb5;})[_0xf063('0x3e')](respondWithFilteredResult(_0x4a72e8,_0x4260b9))[_0xf063('0x40')](handleError(_0x4a72e8,null));};exports[_0xf063('0x41')]=function(_0x5f3474,_0x261757){var _0x45f167={'raw':!![],'where':{'id':_0x5f3474['params']['id']}},_0x156086={};_0x156086[_0xf063('0x2d')]=_['keys'](db[_0xf063('0x27')]['rawAttributes']);_0x156086['query']=_[_0xf063('0x42')](_0x5f3474[_0xf063('0x2c')]);_0x156086[_0xf063('0x35')]=_[_0xf063('0x43')](_0x156086[_0xf063('0x2d')],_0x156086[_0xf063('0x2c')]);_0x45f167[_0xf063('0x2f')]=_[_0xf063('0x43')](_0x156086[_0xf063('0x2d')],qs[_0xf063('0x2e')](_0x5f3474['query']['fields']));_0x45f167['attributes']=_0x45f167[_0xf063('0x2f')][_0xf063('0x30')]?_0x45f167[_0xf063('0x2f')]:_0x156086[_0xf063('0x2d')];if(_0x5f3474[_0xf063('0x2c')][_0xf063('0x3c')]){_0x45f167[_0xf063('0x44')]=[{'all':!![]}];}_0x45f167=_['merge']({},_0x45f167,_0x5f3474['options']);return db['CmCustomField'][_0xf063('0x45')](_0x45f167)[_0xf063('0x3e')](handleEntityNotFound(_0x261757,null))[_0xf063('0x3e')](respondWithResult(_0x261757,null))[_0xf063('0x40')](handleError(_0x261757,null));};exports[_0xf063('0x1f')]=function(_0x374994,_0x3b14fe){if(_0x374994[_0xf063('0x46')]['id']){delete _0x374994[_0xf063('0x46')]['id'];}return db[_0xf063('0x27')][_0xf063('0x45')]({'where':{'id':_0x374994[_0xf063('0x47')]['id']}})[_0xf063('0x3e')](handleEntityNotFound(_0x3b14fe,null))[_0xf063('0x3e')](saveUpdates(_0x374994[_0xf063('0x46')],null))[_0xf063('0x3e')](respondWithResult(_0x3b14fe,null))[_0xf063('0x40')](handleError(_0x3b14fe,null));};exports['destroy']=function(_0x4a345b,_0x153329){return db[_0xf063('0x27')]['find']({'where':{'id':_0x4a345b[_0xf063('0x47')]['id']}})[_0xf063('0x3e')](handleEntityNotFound(_0x153329,null))[_0xf063('0x3e')](removeEntity(_0x153329,null))[_0xf063('0x40')](handleError(_0x153329,null));};exports['create']=function(_0x78ba13,_0x17d189){var _0x55f684;return db['sequelize'][_0xf063('0x48')](function(_0x2b09ad){return db['CmCustomField'][_0xf063('0x49')](_0x78ba13[_0xf063('0x46')],{'transaction':_0x2b09ad})[_0xf063('0x3e')](function(_0x582fc0){_0x55f684=_0x582fc0;var _0x350853={'type':db[_0xf063('0x4a')]['TEXT'],'transaction':_0x2b09ad};switch(_0x78ba13['body'][_0xf063('0x2a')]){case _0xf063('0x4b'):_0x350853[_0xf063('0x2a')]=db[_0xf063('0x4a')]['TEXT'];break;case _0xf063('0x4c'):_0x350853[_0xf063('0x2a')]=db[_0xf063('0x4a')][_0xf063('0x4d')];break;case'switch':_0x350853[_0xf063('0x2a')]=db['Sequelize'][_0xf063('0x4e')];_0x350853[_0xf063('0x4f')]=![];break;default:}return db[_0xf063('0x50')]['queryInterface'][_0xf063('0x51')](_0xf063('0x52'),util['format'](_0xf063('0x53'),_0x55f684['id']),_0x350853);})['then'](function(){return _0x55f684;});})[_0xf063('0x3e')](respondWithResult(_0x17d189,0xc9))['catch'](handleError(_0x17d189,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 77689a0..8ac3b12 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 _0xcb28=['define','CmCustomField','cm_custom_fields','lodash','util','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x4e6517,_0x650264){var _0x3e5faa=function(_0x21a9e6){while(--_0x21a9e6){_0x4e6517['push'](_0x4e6517['shift']());}};_0x3e5faa(++_0x650264);}(_0xcb28,0x179));var _0x8cb2=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xcb28[_0x4a8bad];return _0x30cf32;};'use strict';var _=require(_0x8cb2('0x0'));var util=require(_0x8cb2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cb2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8cb2('0x3'));var fs=require('fs');var path=require(_0x8cb2('0x4'));var rimraf=require('rimraf');var config=require(_0x8cb2('0x5'));var attributes=require(_0x8cb2('0x6'));module[_0x8cb2('0x7')]=function(_0x2f52c4,_0x342014){return _0x2f52c4[_0x8cb2('0x8')](_0x8cb2('0x9'),attributes,{'tableName':_0x8cb2('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e3f=['bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6e3f,0x1b5));var _0xf6e3=function(_0x5b01c2,_0x42cea7){_0x5b01c2=_0x5b01c2-0x0;var _0x5ca308=_0x6e3f[_0x5b01c2];return _0x5ca308;};'use strict';var _=require(_0xf6e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6e3('0x1'));var moment=require(_0xf6e3('0x2'));var BPromise=require(_0xf6e3('0x3'));var rp=require(_0xf6e3('0x4'));var fs=require('fs');var path=require(_0xf6e3('0x5'));var rimraf=require('rimraf');var config=require(_0xf6e3('0x6'));var attributes=require(_0xf6e3('0x7'));module['exports']=function(_0x4fdb04,_0x56d87a){return _0x4fdb04[_0xf6e3('0x8')](_0xf6e3('0x9'),attributes,{'tableName':_0xf6e3('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 075794c..5c928a1 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 _0x8dfe=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x13c91f,_0x1ce241){var _0xec6fba=function(_0x293290){while(--_0x293290){_0x13c91f['push'](_0x13c91f['shift']());}};_0xec6fba(++_0x1ce241);}(_0x8dfe,0x72));var _0xe8df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8dfe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe8df('0x0'));var moment=require(_0xe8df('0x1'));var BPromise=require(_0xe8df('0x2'));var rs=require(_0xe8df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8df('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8df('0x5'));var config=require(_0xe8df('0x6'));var jayson=require(_0xe8df('0x7'));var client=jayson[_0xe8df('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b44a3,_0x451292,_0x14aeda){return new BPromise(function(_0xe76f12,_0x2003fb){return client[_0xe8df('0x9')](_0x2b44a3,_0x14aeda)[_0xe8df('0xa')](function(_0x477d52){logger[_0xe8df('0xb')](_0xe8df('0xc'),_0x451292,_0xe8df('0xd'));logger['debug'](_0xe8df('0xe'),_0x451292,_0xe8df('0xd'),JSON['stringify'](_0x477d52));if(_0x477d52['error']){if(_0x477d52['error'][_0xe8df('0xf')]===0x1f4){logger[_0xe8df('0x10')]('CmCustomField,\x20%s,\x20%s',_0x451292,_0x477d52[_0xe8df('0x10')][_0xe8df('0x11')]);return _0x2003fb(_0x477d52[_0xe8df('0x10')]['message']);}logger[_0xe8df('0x10')](_0xe8df('0xc'),_0x451292,_0x477d52['error'][_0xe8df('0x11')]);return _0xe76f12(_0x477d52[_0xe8df('0x10')]['message']);}else{logger[_0xe8df('0xb')](_0xe8df('0xc'),_0x451292,_0xe8df('0xd'));_0xe76f12(_0x477d52['result'][_0xe8df('0x11')]);}})[_0xe8df('0x12')](function(_0x1c612f){logger[_0xe8df('0x10')](_0xe8df('0xc'),_0x451292,_0x1c612f);_0x2003fb(_0x1c612f);});});} \ No newline at end of file +var _0xb183=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x46ff15,_0x137738){var _0x748ef2=function(_0x1418ab){while(--_0x1418ab){_0x46ff15['push'](_0x46ff15['shift']());}};_0x748ef2(++_0x137738);}(_0xb183,0x1cd));var _0x3b18=function(_0x81957a,_0x115bf4){_0x81957a=_0x81957a-0x0;var _0xc33ddd=_0xb183[_0x81957a];return _0xc33ddd;};'use strict';var _=require(_0x3b18('0x0'));var util=require(_0x3b18('0x1'));var moment=require(_0x3b18('0x2'));var BPromise=require(_0x3b18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b18('0x4'));var db=require(_0x3b18('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3b18('0x6'));var client=jayson[_0x3b18('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf13,_0x379544,_0x129280){return new BPromise(function(_0x193f7c,_0x151887){return client['request'](_0x32bf13,_0x129280)['then'](function(_0x48c356){logger[_0x3b18('0x8')](_0x3b18('0x9'),_0x379544,_0x3b18('0xa'));logger['debug'](_0x3b18('0xb'),_0x379544,_0x3b18('0xa'),JSON['stringify'](_0x48c356));if(_0x48c356[_0x3b18('0xc')]){if(_0x48c356[_0x3b18('0xc')][_0x3b18('0xd')]===0x1f4){logger[_0x3b18('0xc')](_0x3b18('0x9'),_0x379544,_0x48c356['error'][_0x3b18('0xe')]);return _0x151887(_0x48c356['error'][_0x3b18('0xe')]);}logger[_0x3b18('0xc')](_0x3b18('0x9'),_0x379544,_0x48c356[_0x3b18('0xc')][_0x3b18('0xe')]);return _0x193f7c(_0x48c356[_0x3b18('0xc')]['message']);}else{logger['info'](_0x3b18('0x9'),_0x379544,_0x3b18('0xa'));_0x193f7c(_0x48c356[_0x3b18('0xf')]['message']);}})[_0x3b18('0x10')](function(_0x4652fd){logger[_0x3b18('0xc')](_0x3b18('0x9'),_0x379544,_0x4652fd);_0x151887(_0x4652fd);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 263c5d4..e86797e 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 _0x16d8=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','delete'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x16d8,0xa3));var _0x816d=function(_0x14eaed,_0x505d19){_0x14eaed=_0x14eaed-0x0;var _0x169b56=_0x16d8[_0x14eaed];return _0x169b56;};'use strict';var multer=require('multer');var util=require(_0x816d('0x0'));var path=require(_0x816d('0x1'));var timeout=require(_0x816d('0x2'));var express=require(_0x816d('0x3'));var router=express[_0x816d('0x4')]();var fs_extra=require(_0x816d('0x5'));var auth=require(_0x816d('0x6'));var interaction=require(_0x816d('0x7'));var config=require(_0x816d('0x8'));var controller=require('./cmCustomField.controller');router[_0x816d('0x9')]('/',auth['isAuthenticated'](),controller[_0x816d('0xa')]);router[_0x816d('0x9')](_0x816d('0xb'),auth[_0x816d('0xc')](),controller[_0x816d('0xd')]);router['post']('/',auth[_0x816d('0xc')](),controller[_0x816d('0xe')]);router[_0x816d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x816d('0x10')](_0x816d('0xb'),auth[_0x816d('0xc')](),controller[_0x816d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x770d=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x5eeddf,_0xeb81ad){var _0x5f0f38=function(_0x115cd0){while(--_0x115cd0){_0x5eeddf['push'](_0x5eeddf['shift']());}};_0x5f0f38(++_0xeb81ad);}(_0x770d,0x122));var _0xd770=function(_0x16c06e,_0x4a4a06){_0x16c06e=_0x16c06e-0x0;var _0x3ce423=_0x770d[_0x16c06e];return _0x3ce423;};'use strict';var multer=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var path=require(_0xd770('0x2'));var timeout=require(_0xd770('0x3'));var express=require(_0xd770('0x4'));var router=express[_0xd770('0x5')]();var fs_extra=require(_0xd770('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd770('0x7'));var config=require(_0xd770('0x8'));var controller=require(_0xd770('0x9'));router[_0xd770('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd770('0xa')](_0xd770('0xb'),auth[_0xd770('0xc')](),controller[_0xd770('0xd')]);router[_0xd770('0xe')]('/',auth[_0xd770('0xc')](),controller[_0xd770('0xf')]);router['put'](_0xd770('0xb'),auth[_0xd770('0xc')](),controller[_0xd770('0x10')]);router[_0xd770('0x11')](_0xd770('0xb'),auth['isAuthenticated'](),controller[_0xd770('0x12')]);module[_0xd770('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e976f95..d8587c0 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 _0x56e6=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','STRING'];(function(_0x1425fe,_0x220e62){var _0x3f4975=function(_0x7c8dbe){while(--_0x7c8dbe){_0x1425fe['push'](_0x1425fe['shift']());}};_0x3f4975(++_0x220e62);}(_0x56e6,0x18a));var _0x656e=function(_0x544cc7,_0x5b02fb){_0x544cc7=_0x544cc7-0x0;var _0x3896d0=_0x56e6[_0x544cc7];return _0x3896d0;};'use strict';var moment=require(_0x656e('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x656e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x656e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x656e('0x3')],'defaultValue':moment()[_0x656e('0x4')](_0x656e('0x5'))},'countbusyretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x656e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x656e('0x3')]},'priority':{'type':Sequelize[_0x656e('0x6')](0x2)[_0x656e('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x656e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x656e('0x6')],'unique':_0x656e('0x8')},'ListId':{'type':Sequelize[_0x656e('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x656e('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x656e('0x6')],'unique':_0x656e('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x656e('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd49=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcd49,0x138));var _0x9cd4=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0xcd49[_0x87239];return _0x53af1e;};'use strict';var moment=require(_0x9cd4('0x0'));var Sequelize=require(_0x9cd4('0x1'));module[_0x9cd4('0x2')]={'phone':{'type':Sequelize[_0x9cd4('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9cd4('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9cd4('0x5')],'defaultValue':moment()[_0x9cd4('0x6')](_0x9cd4('0x7'))},'countbusyretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9cd4('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9cd4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9cd4('0x5')]},'priority':{'type':Sequelize[_0x9cd4('0x8')](0x2)[_0x9cd4('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9cd4('0x8')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x9cd4('0xa')},'UserId':{'type':Sequelize[_0x9cd4('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x9cd4('0x8')],'unique':_0x9cd4('0xa')},'CampaignId':{'type':Sequelize[_0x9cd4('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9cd4('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index e6fa94f..0324ae7 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 _0x8b6b=['path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopper','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','findAll','rows','catch','show','params','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getVoiceQueues','preview','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','isEmpty','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Company','CmList','List','dialActive','getOpenContacts','outbound','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8b6b,0x8e));var _0xb8b6=function(_0x45a08b,_0x14c134){_0x45a08b=_0x45a08b-0x0;var _0xac8e84=_0x8b6b[_0x45a08b];return _0xac8e84;};'use strict';var emlformat=require(_0xb8b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8b6('0x1'));var jsonpatch=require(_0xb8b6('0x2'));var rp=require(_0xb8b6('0x3'));var moment=require(_0xb8b6('0x4'));var BPromise=require(_0xb8b6('0x5'));var Mustache=require(_0xb8b6('0x6'));var util=require('util');var path=require(_0xb8b6('0x7'));var sox=require(_0xb8b6('0x8'));var csv=require(_0xb8b6('0x9'));var ejs=require(_0xb8b6('0xa'));var fs=require('fs');var fs_extra=require(_0xb8b6('0xb'));var _=require('lodash');var squel=require(_0xb8b6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8b6('0x9'));var querystring=require(_0xb8b6('0xd'));var Papa=require(_0xb8b6('0xe'));var Redis=require(_0xb8b6('0xf'));var authService=require(_0xb8b6('0x10'));var qs=require(_0xb8b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8b6('0x12'))(_0xb8b6('0x13'));var utils=require(_0xb8b6('0x14'));var config=require(_0xb8b6('0x15'));var licenseUtil=require(_0xb8b6('0x16'));var db=require(_0xb8b6('0x17'))['db'];function respondWithStatusCode(_0x350cf2,_0x3d3a8e){_0x3d3a8e=_0x3d3a8e||0xcc;return function(_0x378264){if(_0x378264){return _0x350cf2[_0xb8b6('0x18')](_0x3d3a8e);}return _0x350cf2[_0xb8b6('0x19')](_0x3d3a8e)[_0xb8b6('0x1a')]();};}function respondWithResult(_0x3c39a2,_0x255f24){_0x255f24=_0x255f24||0xc8;return function(_0x405755){if(_0x405755){return _0x3c39a2[_0xb8b6('0x19')](_0x255f24)['json'](_0x405755);}};}function respondWithFilteredResult(_0x3deb37,_0x4fca3a){return function(_0x20ef92){if(_0x20ef92){var _0x45b9eb=typeof _0x4fca3a['offset']===_0xb8b6('0x1b')&&typeof _0x4fca3a[_0xb8b6('0x1c')]===_0xb8b6('0x1b');var _0x34d958=_0x20ef92['count'];var _0x3fe51c=_0x45b9eb?0x0:_0x4fca3a['offset'];var _0x514205=_0x45b9eb?_0x20ef92['count']:_0x4fca3a[_0xb8b6('0x1d')]+_0x4fca3a['limit'];var _0x433ae7;if(_0x514205>=_0x34d958){_0x514205=_0x34d958;_0x433ae7=0xc8;}else{_0x433ae7=0xce;}_0x3deb37[_0xb8b6('0x19')](_0x433ae7);return _0x3deb37[_0xb8b6('0x1e')](_0xb8b6('0x1f'),_0x3fe51c+'-'+_0x514205+'/'+_0x34d958)[_0xb8b6('0x20')](_0x20ef92);}return null;};}function patchUpdates(_0x571282){return function(_0x36155d){try{jsonpatch[_0xb8b6('0x21')](_0x36155d,_0x571282,!![]);}catch(_0x7e85e){return BPromise[_0xb8b6('0x22')](_0x7e85e);}return _0x36155d[_0xb8b6('0x23')]();};}function saveUpdates(_0x249983,_0x18f1d8){return function(_0x4995a8){if(_0x4995a8){return _0x4995a8[_0xb8b6('0x24')](_0x249983)[_0xb8b6('0x25')](function(_0x5b95e3){return _0x5b95e3;});}return null;};}function removeEntity(_0x37bd67,_0x21c44b){return function(_0x694d09){if(_0x694d09){return _0x694d09[_0xb8b6('0x26')]()[_0xb8b6('0x25')](function(){_0x37bd67[_0xb8b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41d0cb,_0x2895c7){return function(_0x2da9ee){if(!_0x2da9ee){_0x41d0cb['sendStatus'](0x194);}return _0x2da9ee;};}function handleError(_0x38fb75,_0x4cedf1){_0x4cedf1=_0x4cedf1||0x1f4;return function(_0x2a0932){logger['error'](_0x2a0932[_0xb8b6('0x27')]);if(_0x2a0932[_0xb8b6('0x28')]){delete _0x2a0932[_0xb8b6('0x28')];}_0x38fb75[_0xb8b6('0x19')](_0x4cedf1)[_0xb8b6('0x29')](_0x2a0932);};}exports[_0xb8b6('0x2a')]=function(_0x238fc2,_0xfb1f9f){var _0x9a6a14={},_0xc48a44={},_0x578097={'count':0x0,'rows':[]};var _0x5c6e61=_[_0xb8b6('0x2b')](db[_0xb8b6('0x2c')]['rawAttributes'],function(_0x1309bc){return{'name':_0x1309bc[_0xb8b6('0x2d')],'type':_0x1309bc[_0xb8b6('0x2e')][_0xb8b6('0x2f')]};});_0xc48a44[_0xb8b6('0x30')]=_['map'](_0x5c6e61,_0xb8b6('0x28'));_0xc48a44[_0xb8b6('0x31')]=_[_0xb8b6('0x32')](_0x238fc2['query']);_0xc48a44[_0xb8b6('0x33')]=_[_0xb8b6('0x34')](_0xc48a44[_0xb8b6('0x30')],_0xc48a44[_0xb8b6('0x31')]);_0xc48a44[_0xb8b6('0x33')]=_[_0xb8b6('0x35')](_0xc48a44[_0xb8b6('0x33')],[_0xb8b6('0x36'),_0xb8b6('0x37'),_0xb8b6('0x38'),_0xb8b6('0x39'),'$lt',_0xb8b6('0x3a'),'$ne',_0xb8b6('0x3b'),_0xb8b6('0x3c'),_0xb8b6('0x3d'),_0xb8b6('0x3e'),_0xb8b6('0x3f'),_0xb8b6('0x40'),_0xb8b6('0x41'),_0xb8b6('0x42'),_0xb8b6('0x43'),_0xb8b6('0x44'),_0xb8b6('0x41'),_0xb8b6('0x45'),'$contains',_0xb8b6('0x46'),'$any']);_0x9a6a14['attributes']=_[_0xb8b6('0x34')](_0xc48a44[_0xb8b6('0x30')],qs[_0xb8b6('0x47')](_0x238fc2[_0xb8b6('0x31')][_0xb8b6('0x47')]));_0x9a6a14['attributes']=_0x9a6a14['attributes'][_0xb8b6('0x48')]?_0x9a6a14[_0xb8b6('0x49')]:_0xc48a44['model'];if(!_0x238fc2[_0xb8b6('0x31')][_0xb8b6('0x4a')](_0xb8b6('0x4b'))){_0x9a6a14[_0xb8b6('0x1c')]=qs[_0xb8b6('0x1c')](_0x238fc2[_0xb8b6('0x31')]['limit']);_0x9a6a14['offset']=qs[_0xb8b6('0x1d')](_0x238fc2[_0xb8b6('0x31')]['offset']);}_0x9a6a14[_0xb8b6('0x4c')]=qs[_0xb8b6('0x4d')](_0x238fc2[_0xb8b6('0x31')][_0xb8b6('0x4d')]);_0x9a6a14['where']=qs[_0xb8b6('0x33')](_[_0xb8b6('0x4e')](_0x238fc2[_0xb8b6('0x31')],_0xc48a44['filters']),_0x5c6e61);if(_0x238fc2['query'][_0xb8b6('0x4f')]){_0x9a6a14['where']=_['merge'](_0x9a6a14[_0xb8b6('0x50')],{'$or':_[_0xb8b6('0x2b')](_0x5c6e61,function(_0x960ffb){if(_0x960ffb[_0xb8b6('0x2e')]!=='VIRTUAL'){var _0x41c853={};_0x41c853[_0x960ffb[_0xb8b6('0x28')]]={'$like':'%'+_0x238fc2['query']['filter']+'%'};return _0x41c853;}})});}_0x9a6a14=_[_0xb8b6('0x51')]({},_0x9a6a14,_0x238fc2[_0xb8b6('0x52')]);var _0x2724b0={'where':_0x9a6a14[_0xb8b6('0x50')]};return db['CmHopper'][_0xb8b6('0x53')](_0x2724b0)['then'](function(_0x1ed289){_0x578097['count']=_0x1ed289;if(_0x238fc2[_0xb8b6('0x31')][_0xb8b6('0x54')]){_0x9a6a14['include']=[{'all':!![]}];}return db[_0xb8b6('0x2c')][_0xb8b6('0x55')](_0x9a6a14);})[_0xb8b6('0x25')](function(_0x5219ea){_0x578097[_0xb8b6('0x56')]=_0x5219ea;return _0x578097;})[_0xb8b6('0x25')](respondWithFilteredResult(_0xfb1f9f,_0x9a6a14))[_0xb8b6('0x57')](handleError(_0xfb1f9f,null));};exports[_0xb8b6('0x58')]=function(_0x247999,_0x7abaeb){var _0x15df7a={'raw':!![],'where':{'id':_0x247999[_0xb8b6('0x59')]['id']}},_0x4430b2={};_0x4430b2['model']=_[_0xb8b6('0x32')](db[_0xb8b6('0x2c')]['rawAttributes']);_0x4430b2[_0xb8b6('0x31')]=_['keys'](_0x247999['query']);_0x4430b2[_0xb8b6('0x33')]=_[_0xb8b6('0x34')](_0x4430b2[_0xb8b6('0x30')],_0x4430b2[_0xb8b6('0x31')]);_0x15df7a['attributes']=_['intersection'](_0x4430b2['model'],qs[_0xb8b6('0x47')](_0x247999[_0xb8b6('0x31')]['fields']));_0x15df7a[_0xb8b6('0x49')]=_0x15df7a[_0xb8b6('0x49')][_0xb8b6('0x48')]?_0x15df7a[_0xb8b6('0x49')]:_0x4430b2[_0xb8b6('0x30')];if(_0x247999[_0xb8b6('0x31')]['includeAll']){_0x15df7a['include']=[{'all':!![]}];}_0x15df7a=_['merge']({},_0x15df7a,_0x247999[_0xb8b6('0x52')]);return db['CmHopper'][_0xb8b6('0x5a')](_0x15df7a)['then'](handleEntityNotFound(_0x7abaeb,null))['then'](respondWithResult(_0x7abaeb,null))['catch'](handleError(_0x7abaeb,null));};exports[_0xb8b6('0x5b')]=function(_0xff1bd4,_0x52939d){return db[_0xb8b6('0x2c')][_0xb8b6('0x5b')](_0xff1bd4[_0xb8b6('0x5c')],{})[_0xb8b6('0x25')](respondWithResult(_0x52939d,0xc9))['catch'](handleError(_0x52939d,null));};exports[_0xb8b6('0x24')]=function(_0x4b091f,_0x658be8){if(_0x4b091f[_0xb8b6('0x5c')]['id']){delete _0x4b091f[_0xb8b6('0x5c')]['id'];}return db['CmHopper'][_0xb8b6('0x5a')]({'where':{'id':_0x4b091f[_0xb8b6('0x59')]['id']}})[_0xb8b6('0x25')](handleEntityNotFound(_0x658be8,null))[_0xb8b6('0x25')](saveUpdates(_0x4b091f[_0xb8b6('0x5c')],null))[_0xb8b6('0x25')](respondWithResult(_0x658be8,null))[_0xb8b6('0x57')](handleError(_0x658be8,null));};exports[_0xb8b6('0x5d')]=function(_0x3d2a69,_0x43b3eb){return db[_0xb8b6('0x2c')][_0xb8b6('0x5d')]()['then'](respondWithResult(_0x43b3eb,null))[_0xb8b6('0x57')](handleError(_0x43b3eb,null));};exports[_0xb8b6('0x26')]=function(_0x15f3c0,_0xc4d60a){var _0x225faa;return db['CmHopper']['find']({'where':{'id':_0x15f3c0[_0xb8b6('0x59')]['id']}})[_0xb8b6('0x25')](handleEntityNotFound(_0xc4d60a,null))[_0xb8b6('0x25')](function(_0x334fe8){if(_0x334fe8){return _0x334fe8['destroy']()[_0xb8b6('0x25')](function(_0x1426b2){return _0x1426b2;});}})[_0xb8b6('0x25')](function(_0x1e8331){_0x225faa=_0x1e8331;if(_0x1e8331){if(_0x1e8331[_0xb8b6('0x5e')]||_0x1e8331[_0xb8b6('0x5f')]){return db[_0x1e8331['VoiceQueueId']?_0xb8b6('0x60'):'Campaign'][_0xb8b6('0x5a')]({'where':{'id':_0x1e8331[_0xb8b6('0x5e')]?_0x1e8331[_0xb8b6('0x5e')]:_0x1e8331[_0xb8b6('0x5f')]},'attributes':['id',_0xb8b6('0x28')],'raw':!![]});}}})[_0xb8b6('0x25')](function(_0x40a3ed){var _0x29c6b3={};if(_0x40a3ed){_['merge'](_0x29c6b3,_[_0xb8b6('0x61')](_0x225faa[_0xb8b6('0x62')],[_0xb8b6('0x63'),_0xb8b6('0x64'),'id']));_0x29c6b3[_0xb8b6('0x65')]=0x15;_0x29c6b3[_0xb8b6('0x66')]=_0xb8b6('0x67');_0x29c6b3['campaign']=_0x40a3ed[_0xb8b6('0x28')];_0x29c6b3[_0xb8b6('0x68')]=_0x15f3c0[_0xb8b6('0x69')][_0xb8b6('0x28')];_0x29c6b3[_0xb8b6('0x6a')]=_0x15f3c0['user']['id'];_0x29c6b3[_0xb8b6('0x67')]=!![];_0x29c6b3[_0xb8b6('0x6b')]=moment()[_0xb8b6('0x6c')](_0xb8b6('0x6d'));_0x29c6b3['calleridnum']=_0x225faa['phone'];_0x29c6b3[_0xb8b6('0x6e')]=_0x225faa[_0xb8b6('0x5e')]?_0xb8b6('0x6f'):_0xb8b6('0x70');return db[_0xb8b6('0x71')][_0xb8b6('0x5a')]({'where':{'id':_0x29c6b3[_0xb8b6('0x72')]},'attributes':[_0xb8b6('0x73'),_0xb8b6('0x74')]})[_0xb8b6('0x25')](function(_0x11af0e){if(!_['isNil'](_0xc4d60a)&&!_[_0xb8b6('0x75')](_0x11af0e[_0xb8b6('0x73')])){_0x29c6b3[_0xb8b6('0x76')]=_0x11af0e['firstName'];if(!_[_0xb8b6('0x75')](_0x11af0e[_0xb8b6('0x74')])){_0x29c6b3[_0xb8b6('0x76')]+='\x20'+_0x11af0e['lastName'];}}})[_0xb8b6('0x77')](function(){return db[_0xb8b6('0x78')]['create'](_0x29c6b3);});}})['then'](function(){return _0xc4d60a['status'](0xcc)['end']();})[_0xb8b6('0x57')](handleError(_0xc4d60a,null));};exports['getPreview']=function(_0x3e45fa,_0x29d470,_0x3a6b19){var _0x5b21a8=[];return db[_0xb8b6('0x71')][_0xb8b6('0x5d')]()[_0xb8b6('0x25')](function(_0x39e16){_0x5b21a8=_[_0xb8b6('0x32')](_0x39e16);return _0x3e45fa['user'][_0xb8b6('0x79')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xb8b6('0x7a')},'attributes':['id','dialOrderByScheduledAt',_0xb8b6('0x7b')],'raw':!![]});})['then'](function(_0x4c7122){if(_0x4c7122&&_0x4c7122[_0xb8b6('0x48')]){return db['sequelize']['transaction'](function(_0x1be25b){var _0xd6774={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb8b6('0x6c')](_0xb8b6('0x6d'))},'VoiceQueueId':{'$in':_[_0xb8b6('0x2b')](_0x4c7122,'id')},'$or':[{'UserId':null},{'UserId':_0x3e45fa[_0xb8b6('0x69')]['id']}]};var _0xf95cb8={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4c7122)[_0xb8b6('0x4f')](['dialPreviewAutoRecallMe',0x0])[_0xb8b6('0x2b')]('id')[_0xb8b6('0x7c')]()},'$or':[{'UserId':null},{'UserId':_0x3e45fa['user']['id']}]};var _0x17a7f2={'$or':[_0xd6774,_0xf95cb8]};var _0x28c594=[];if(_0x3e45fa[_0xb8b6('0x5c')][_0xb8b6('0x7d')]&&_0x3e45fa[_0xb8b6('0x5c')]['direction']===_0xb8b6('0x7e')){if(!_['isEmpty'](_0x3e45fa[_0xb8b6('0x5c')][_0xb8b6('0x7f')])){_0x17a7f2['id']={'$in':_0x3e45fa[_0xb8b6('0x5c')][_0xb8b6('0x7f')]};}_0x28c594=[[_0xb8b6('0x80'),_0xb8b6('0x81')],[_0xb8b6('0x82'),_0x4c7122[0x0]['dialOrderByScheduledAt']===_0xb8b6('0x81')?_0xb8b6('0x83'):_0xb8b6('0x81')],db[_0xb8b6('0x84')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xb8b6('0x83')]];}else{if(!_[_0xb8b6('0x85')](_0x3e45fa[_0xb8b6('0x5c')][_0xb8b6('0x7f')])){_0x17a7f2['id']={'$notIn':_0x3e45fa[_0xb8b6('0x5c')][_0xb8b6('0x7f')]};}_0x28c594=[[_0xb8b6('0x80'),_0xb8b6('0x83')],['scheduledAt',_0x4c7122[0x0][_0xb8b6('0x86')]],db[_0xb8b6('0x84')][_0xb8b6('0x87')](_0xb8b6('0x88')),['id',_0xb8b6('0x81')]];}return db[_0xb8b6('0x2c')][_0xb8b6('0x89')]({'attributes':['id',_0xb8b6('0x8a'),'recallme'],'where':_0x17a7f2,'order':_0x28c594,'transaction':_0x1be25b,'lock':_0x1be25b[_0xb8b6('0x8b')]['UPDATE'],'include':[{'model':db[_0xb8b6('0x71')],'as':'Contact','attributes':_0x5b21a8,'include':[{'model':db['CmCompany'],'as':_0xb8b6('0x8c'),'attributes':['id',_0xb8b6('0x28')]}]},{'model':db[_0xb8b6('0x8d')],'as':_0xb8b6('0x8e'),'attributes':['id',_0xb8b6('0x28')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0xb8b6('0x8f')]}]})[_0xb8b6('0x25')](function(_0x5ec19e){if(_0x5ec19e){return _0x5ec19e['update']({'UserId':_0x3e45fa[_0xb8b6('0x69')]['id']},{'transaction':_0x1be25b});}});});}})['then'](handleEntityNotFound(_0x29d470,null))[_0xb8b6('0x25')](respondWithResult(_0x29d470,null))[_0xb8b6('0x57')](handleError(_0x29d470,null));};exports[_0xb8b6('0x90')]=function(_0x1a2d03,_0x53cd74,_0xe396f7){return _0x1a2d03['user'][_0xb8b6('0x79')]({'where':{'type':_0xb8b6('0x91'),'dialActive':!![],'dialMethod':_0xb8b6('0x7a')},'attributes':['id'],'raw':!![]})['then'](function(_0x22b5ee){if(_0x22b5ee&&_0x22b5ee[_0xb8b6('0x48')]){return db[_0xb8b6('0x2c')][_0xb8b6('0x53')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb8b6('0x6c')](_0xb8b6('0x6d'))},'VoiceQueueId':{'$in':_[_0xb8b6('0x2b')](_0x22b5ee,'id')},'$or':[{'UserId':null},{'UserId':_0x1a2d03['user']['id']}]}});}return 0x0;})[_0xb8b6('0x25')](function(_0x3d186d){if(!_['isNil'](_0x3d186d)&&_['isNumber'](_0x3d186d)){return _0x53cd74['status'](0xc8)[_0xb8b6('0x20')]({'contacts':_0x3d186d});}else{logger[_0xb8b6('0x92')](_0xb8b6('0x93'),'getOpenContacts',0x194,_0xb8b6('0x94'));_0x53cd74[_0xb8b6('0x18')](0x194);}})[_0xb8b6('0x57')](handleError(_0x53cd74,null));}; \ No newline at end of file +var _0x0689=['name','send','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','fields','length','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','find','dataValues','state','statedesc','deleted','campaign','membername','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','entity\x20not\x20found','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x57c076,_0x51bda7){var _0x42ce8c=function(_0x26c169){while(--_0x26c169){_0x57c076['push'](_0x57c076['shift']());}};_0x42ce8c(++_0x51bda7);}(_0x0689,0x10f));var _0x9068=function(_0x4fde83,_0x2d9011){_0x4fde83=_0x4fde83-0x0;var _0x3b33e3=_0x0689[_0x4fde83];return _0x3b33e3;};'use strict';var emlformat=require(_0x9068('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9068('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9068('0x2'));var moment=require(_0x9068('0x3'));var BPromise=require(_0x9068('0x4'));var Mustache=require('mustache');var util=require(_0x9068('0x5'));var path=require('path');var sox=require(_0x9068('0x6'));var csv=require(_0x9068('0x7'));var ejs=require(_0x9068('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9068('0x9'));var crypto=require(_0x9068('0xa'));var jsforce=require(_0x9068('0xb'));var deskjs=require(_0x9068('0xc'));var toCsv=require(_0x9068('0x7'));var querystring=require(_0x9068('0xd'));var Papa=require(_0x9068('0xe'));var Redis=require(_0x9068('0xf'));var authService=require(_0x9068('0x10'));var qs=require(_0x9068('0x11'));var as=require(_0x9068('0x12'));var hardwareService=require(_0x9068('0x13'));var logger=require(_0x9068('0x14'))(_0x9068('0x15'));var utils=require(_0x9068('0x16'));var config=require(_0x9068('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9068('0x18'))['db'];function respondWithStatusCode(_0x15abc6,_0xea5afb){_0xea5afb=_0xea5afb||0xcc;return function(_0x49c05a){if(_0x49c05a){return _0x15abc6['sendStatus'](_0xea5afb);}return _0x15abc6[_0x9068('0x19')](_0xea5afb)[_0x9068('0x1a')]();};}function respondWithResult(_0x44bdeb,_0x28dc21){_0x28dc21=_0x28dc21||0xc8;return function(_0x23c32a){if(_0x23c32a){return _0x44bdeb[_0x9068('0x19')](_0x28dc21)[_0x9068('0x1b')](_0x23c32a);}};}function respondWithFilteredResult(_0x32d811,_0xadca5a){return function(_0x321806){if(_0x321806){var _0x583eee=typeof _0xadca5a[_0x9068('0x1c')]===_0x9068('0x1d')&&typeof _0xadca5a[_0x9068('0x1e')]==='undefined';var _0x598a47=_0x321806[_0x9068('0x1f')];var _0x2275d3=_0x583eee?0x0:_0xadca5a['offset'];var _0x32381b=_0x583eee?_0x321806[_0x9068('0x1f')]:_0xadca5a[_0x9068('0x1c')]+_0xadca5a[_0x9068('0x1e')];var _0x4405f8;if(_0x32381b>=_0x598a47){_0x32381b=_0x598a47;_0x4405f8=0xc8;}else{_0x4405f8=0xce;}_0x32d811[_0x9068('0x19')](_0x4405f8);return _0x32d811[_0x9068('0x20')](_0x9068('0x21'),_0x2275d3+'-'+_0x32381b+'/'+_0x598a47)[_0x9068('0x1b')](_0x321806);}return null;};}function patchUpdates(_0x13d9a6){return function(_0x123f3f){try{jsonpatch[_0x9068('0x22')](_0x123f3f,_0x13d9a6,!![]);}catch(_0x4967b8){return BPromise[_0x9068('0x23')](_0x4967b8);}return _0x123f3f[_0x9068('0x24')]();};}function saveUpdates(_0x5c4e3d,_0x4ac806){return function(_0x4f4ac2){if(_0x4f4ac2){return _0x4f4ac2[_0x9068('0x25')](_0x5c4e3d)[_0x9068('0x26')](function(_0x50e2b4){return _0x50e2b4;});}return null;};}function removeEntity(_0x47d337,_0xe2f9e0){return function(_0x76b5ec){if(_0x76b5ec){return _0x76b5ec[_0x9068('0x27')]()[_0x9068('0x26')](function(){_0x47d337[_0x9068('0x19')](0xcc)[_0x9068('0x1a')]();});}};}function handleEntityNotFound(_0x523692,_0x211c76){return function(_0x51df0b){if(!_0x51df0b){_0x523692[_0x9068('0x28')](0x194);}return _0x51df0b;};}function handleError(_0x519548,_0xfc9edb){_0xfc9edb=_0xfc9edb||0x1f4;return function(_0x5b3449){logger[_0x9068('0x29')](_0x5b3449[_0x9068('0x2a')]);if(_0x5b3449[_0x9068('0x2b')]){delete _0x5b3449[_0x9068('0x2b')];}_0x519548['status'](_0xfc9edb)[_0x9068('0x2c')](_0x5b3449);};}exports['index']=function(_0x4dc4d7,_0x5edc44){var _0x3d12ef={},_0x51e7da={},_0x5eca60={'count':0x0,'rows':[]};var _0x46cb9f=_['map'](db[_0x9068('0x2d')][_0x9068('0x2e')],function(_0x52a2ad){return{'name':_0x52a2ad[_0x9068('0x2f')],'type':_0x52a2ad[_0x9068('0x30')][_0x9068('0x31')]};});_0x51e7da[_0x9068('0x32')]=_[_0x9068('0x33')](_0x46cb9f,_0x9068('0x2b'));_0x51e7da[_0x9068('0x34')]=_[_0x9068('0x35')](_0x4dc4d7[_0x9068('0x34')]);_0x51e7da['filters']=_[_0x9068('0x36')](_0x51e7da[_0x9068('0x32')],_0x51e7da[_0x9068('0x34')]);_0x51e7da[_0x9068('0x37')]=_[_0x9068('0x38')](_0x51e7da[_0x9068('0x37')],[_0x9068('0x39'),_0x9068('0x3a'),_0x9068('0x3b'),_0x9068('0x3c'),_0x9068('0x3d'),_0x9068('0x3e'),_0x9068('0x3f'),_0x9068('0x40'),_0x9068('0x41'),'$between',_0x9068('0x42'),_0x9068('0x43'),_0x9068('0x44'),_0x9068('0x45'),'$notLike',_0x9068('0x46'),_0x9068('0x47'),'$like',_0x9068('0x48'),_0x9068('0x49'),_0x9068('0x4a'),_0x9068('0x4b')]);_0x3d12ef[_0x9068('0x4c')]=_[_0x9068('0x36')](_0x51e7da['model'],qs['fields'](_0x4dc4d7[_0x9068('0x34')]['fields']));_0x3d12ef[_0x9068('0x4c')]=_0x3d12ef[_0x9068('0x4c')]['length']?_0x3d12ef[_0x9068('0x4c')]:_0x51e7da[_0x9068('0x32')];if(!_0x4dc4d7['query'][_0x9068('0x4d')](_0x9068('0x4e'))){_0x3d12ef[_0x9068('0x1e')]=qs[_0x9068('0x1e')](_0x4dc4d7['query'][_0x9068('0x1e')]);_0x3d12ef[_0x9068('0x1c')]=qs['offset'](_0x4dc4d7[_0x9068('0x34')][_0x9068('0x1c')]);}_0x3d12ef['order']=qs[_0x9068('0x4f')](_0x4dc4d7[_0x9068('0x34')][_0x9068('0x4f')]);_0x3d12ef[_0x9068('0x50')]=qs[_0x9068('0x37')](_[_0x9068('0x51')](_0x4dc4d7[_0x9068('0x34')],_0x51e7da[_0x9068('0x37')]),_0x46cb9f);if(_0x4dc4d7[_0x9068('0x34')]['filter']){_0x3d12ef[_0x9068('0x50')]=_[_0x9068('0x52')](_0x3d12ef[_0x9068('0x50')],{'$or':_['map'](_0x46cb9f,function(_0x1d933c){if(_0x1d933c[_0x9068('0x30')]!=='VIRTUAL'){var _0x2b6032={};_0x2b6032[_0x1d933c[_0x9068('0x2b')]]={'$like':'%'+_0x4dc4d7['query']['filter']+'%'};return _0x2b6032;}})});}_0x3d12ef=_[_0x9068('0x52')]({},_0x3d12ef,_0x4dc4d7[_0x9068('0x53')]);var _0x19304a={'where':_0x3d12ef[_0x9068('0x50')]};return db[_0x9068('0x2d')][_0x9068('0x1f')](_0x19304a)['then'](function(_0x2e1570){_0x5eca60[_0x9068('0x1f')]=_0x2e1570;if(_0x4dc4d7['query'][_0x9068('0x54')]){_0x3d12ef[_0x9068('0x55')]=[{'all':!![]}];}return db[_0x9068('0x2d')][_0x9068('0x56')](_0x3d12ef);})[_0x9068('0x26')](function(_0x5091f7){_0x5eca60[_0x9068('0x57')]=_0x5091f7;return _0x5eca60;})['then'](respondWithFilteredResult(_0x5edc44,_0x3d12ef))[_0x9068('0x58')](handleError(_0x5edc44,null));};exports[_0x9068('0x59')]=function(_0x2068f6,_0xd24a54){var _0x4565b6={'raw':!![],'where':{'id':_0x2068f6['params']['id']}},_0x188b28={};_0x188b28[_0x9068('0x32')]=_[_0x9068('0x35')](db[_0x9068('0x2d')][_0x9068('0x2e')]);_0x188b28[_0x9068('0x34')]=_[_0x9068('0x35')](_0x2068f6[_0x9068('0x34')]);_0x188b28[_0x9068('0x37')]=_[_0x9068('0x36')](_0x188b28[_0x9068('0x32')],_0x188b28[_0x9068('0x34')]);_0x4565b6[_0x9068('0x4c')]=_['intersection'](_0x188b28[_0x9068('0x32')],qs[_0x9068('0x5a')](_0x2068f6[_0x9068('0x34')][_0x9068('0x5a')]));_0x4565b6[_0x9068('0x4c')]=_0x4565b6[_0x9068('0x4c')][_0x9068('0x5b')]?_0x4565b6[_0x9068('0x4c')]:_0x188b28[_0x9068('0x32')];if(_0x2068f6[_0x9068('0x34')][_0x9068('0x54')]){_0x4565b6[_0x9068('0x55')]=[{'all':!![]}];}_0x4565b6=_[_0x9068('0x52')]({},_0x4565b6,_0x2068f6['options']);return db['CmHopper']['find'](_0x4565b6)[_0x9068('0x26')](handleEntityNotFound(_0xd24a54,null))['then'](respondWithResult(_0xd24a54,null))['catch'](handleError(_0xd24a54,null));};exports[_0x9068('0x5c')]=function(_0x2485ae,_0x738dc2){return db[_0x9068('0x2d')]['create'](_0x2485ae[_0x9068('0x5d')],{})[_0x9068('0x26')](respondWithResult(_0x738dc2,0xc9))[_0x9068('0x58')](handleError(_0x738dc2,null));};exports['update']=function(_0x4ea1a9,_0x4c85a5){if(_0x4ea1a9['body']['id']){delete _0x4ea1a9[_0x9068('0x5d')]['id'];}return db[_0x9068('0x2d')]['find']({'where':{'id':_0x4ea1a9[_0x9068('0x5e')]['id']}})[_0x9068('0x26')](handleEntityNotFound(_0x4c85a5,null))[_0x9068('0x26')](saveUpdates(_0x4ea1a9[_0x9068('0x5d')],null))[_0x9068('0x26')](respondWithResult(_0x4c85a5,null))[_0x9068('0x58')](handleError(_0x4c85a5,null));};exports[_0x9068('0x5f')]=function(_0x8f9dd0,_0x52de60){return db[_0x9068('0x2d')]['describe']()[_0x9068('0x26')](respondWithResult(_0x52de60,null))[_0x9068('0x58')](handleError(_0x52de60,null));};exports[_0x9068('0x27')]=function(_0x8512c6,_0x42919e){var _0x8ac3a4;return db['CmHopper']['find']({'where':{'id':_0x8512c6[_0x9068('0x5e')]['id']}})[_0x9068('0x26')](handleEntityNotFound(_0x42919e,null))[_0x9068('0x26')](function(_0x32a56f){if(_0x32a56f){return _0x32a56f[_0x9068('0x27')]()[_0x9068('0x26')](function(_0x3b86e1){return _0x3b86e1;});}})[_0x9068('0x26')](function(_0x1a2748){_0x8ac3a4=_0x1a2748;if(_0x1a2748){if(_0x1a2748[_0x9068('0x60')]||_0x1a2748[_0x9068('0x61')]){return db[_0x1a2748['VoiceQueueId']?_0x9068('0x62'):_0x9068('0x63')][_0x9068('0x64')]({'where':{'id':_0x1a2748[_0x9068('0x60')]?_0x1a2748[_0x9068('0x60')]:_0x1a2748[_0x9068('0x61')]},'attributes':['id',_0x9068('0x2b')],'raw':!![]});}}})[_0x9068('0x26')](function(_0xc45159){var _0x4ab417={};if(_0xc45159){_[_0x9068('0x52')](_0x4ab417,_['omit'](_0x8ac3a4[_0x9068('0x65')],['createdAt','updatedAt','id']));_0x4ab417[_0x9068('0x66')]=0x15;_0x4ab417[_0x9068('0x67')]=_0x9068('0x68');_0x4ab417[_0x9068('0x69')]=_0xc45159[_0x9068('0x2b')];_0x4ab417[_0x9068('0x6a')]=_0x8512c6[_0x9068('0x6b')]['name'];_0x4ab417['UserId']=_0x8512c6[_0x9068('0x6b')]['id'];_0x4ab417[_0x9068('0x68')]=!![];_0x4ab417['deletedat']=moment()[_0x9068('0x6c')](_0x9068('0x6d'));_0x4ab417[_0x9068('0x6e')]=_0x8ac3a4[_0x9068('0x6f')];_0x4ab417[_0x9068('0x70')]=_0x8ac3a4[_0x9068('0x60')]?_0x9068('0x71'):_0x9068('0x72');return db[_0x9068('0x73')]['find']({'where':{'id':_0x4ab417[_0x9068('0x74')]},'attributes':[_0x9068('0x75'),'lastName']})[_0x9068('0x26')](function(_0x6e00a8){if(!_[_0x9068('0x76')](_0x42919e)&&!_['isNil'](_0x6e00a8[_0x9068('0x75')])){_0x4ab417['calleridname']=_0x6e00a8[_0x9068('0x75')];if(!_[_0x9068('0x76')](_0x6e00a8[_0x9068('0x77')])){_0x4ab417[_0x9068('0x78')]+='\x20'+_0x6e00a8['lastName'];}}})[_0x9068('0x79')](function(){return db[_0x9068('0x7a')][_0x9068('0x5c')](_0x4ab417);});}})[_0x9068('0x26')](function(){return _0x42919e['status'](0xcc)[_0x9068('0x1a')]();})[_0x9068('0x58')](handleError(_0x42919e,null));};exports[_0x9068('0x7b')]=function(_0x3e149d,_0x432413,_0x419462){var _0x33375d=[];return db[_0x9068('0x73')]['describe']()['then'](function(_0x82654b){_0x33375d=_[_0x9068('0x35')](_0x82654b);return _0x3e149d[_0x9068('0x6b')][_0x9068('0x7c')]({'where':{'type':_0x9068('0x7d'),'dialActive':!![],'dialMethod':_0x9068('0x7e')},'attributes':['id',_0x9068('0x7f'),_0x9068('0x80')],'raw':!![]});})[_0x9068('0x26')](function(_0x3e84c2){if(_0x3e84c2&&_0x3e84c2[_0x9068('0x5b')]){return db[_0x9068('0x81')][_0x9068('0x82')](function(_0x51b241){var _0x33a3f4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9068('0x6c')](_0x9068('0x6d'))},'VoiceQueueId':{'$in':_['map'](_0x3e84c2,'id')},'$or':[{'UserId':null},{'UserId':_0x3e149d['user']['id']}]};var _0x2469ff={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3e84c2)['filter']([_0x9068('0x80'),0x0])['map']('id')[_0x9068('0x83')]()},'$or':[{'UserId':null},{'UserId':_0x3e149d[_0x9068('0x6b')]['id']}]};var _0x5792ee={'$or':[_0x33a3f4,_0x2469ff]};var _0x43cf94=[];if(_0x3e149d[_0x9068('0x5d')]['direction']&&_0x3e149d[_0x9068('0x5d')][_0x9068('0x84')]==='prev'){if(!_[_0x9068('0x85')](_0x3e149d[_0x9068('0x5d')][_0x9068('0x86')])){_0x5792ee['id']={'$in':_0x3e149d['body'][_0x9068('0x86')]};}_0x43cf94=[[_0x9068('0x87'),'ASC'],['scheduledAt',_0x3e84c2[0x0][_0x9068('0x7f')]===_0x9068('0x88')?_0x9068('0x89'):_0x9068('0x88')],db[_0x9068('0x81')][_0x9068('0x8a')](_0x9068('0x8b')),['id',_0x9068('0x89')]];}else{if(!_[_0x9068('0x85')](_0x3e149d[_0x9068('0x5d')][_0x9068('0x86')])){_0x5792ee['id']={'$notIn':_0x3e149d[_0x9068('0x5d')][_0x9068('0x86')]};}_0x43cf94=[[_0x9068('0x87'),_0x9068('0x89')],[_0x9068('0x8c'),_0x3e84c2[0x0]['dialOrderByScheduledAt']],db[_0x9068('0x81')][_0x9068('0x8a')](_0x9068('0x8d')),['id',_0x9068('0x88')]];}return db[_0x9068('0x2d')][_0x9068('0x8e')]({'attributes':['id',_0x9068('0x8f'),_0x9068('0x90')],'where':_0x5792ee,'order':_0x43cf94,'transaction':_0x51b241,'lock':_0x51b241[_0x9068('0x91')][_0x9068('0x92')],'include':[{'model':db[_0x9068('0x73')],'as':_0x9068('0x93'),'attributes':_0x33375d,'include':[{'model':db[_0x9068('0x94')],'as':_0x9068('0x95'),'attributes':['id',_0x9068('0x2b')]}]},{'model':db[_0x9068('0x96')],'as':_0x9068('0x97'),'attributes':['id',_0x9068('0x2b')]},{'model':db[_0x9068('0x62')],'as':_0x9068('0x98'),'attributes':['id',_0x9068('0x2b'),_0x9068('0x99')]}]})[_0x9068('0x26')](function(_0x3b3736){if(_0x3b3736){return _0x3b3736['update']({'UserId':_0x3e149d[_0x9068('0x6b')]['id']},{'transaction':_0x51b241});}});});}})[_0x9068('0x26')](handleEntityNotFound(_0x432413,null))[_0x9068('0x26')](respondWithResult(_0x432413,null))['catch'](handleError(_0x432413,null));};exports[_0x9068('0x9a')]=function(_0x1ce599,_0x3fac51,_0x284a4a){return _0x1ce599[_0x9068('0x6b')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x9068('0x26')](function(_0x48b272){if(_0x48b272&&_0x48b272[_0x9068('0x5b')]){return db[_0x9068('0x2d')][_0x9068('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9068('0x6d'))},'VoiceQueueId':{'$in':_[_0x9068('0x33')](_0x48b272,'id')},'$or':[{'UserId':null},{'UserId':_0x1ce599['user']['id']}]}});}return 0x0;})[_0x9068('0x26')](function(_0x2837fc){if(!_['isNil'](_0x2837fc)&&_[_0x9068('0x9b')](_0x2837fc)){return _0x3fac51[_0x9068('0x19')](0xc8)['json']({'contacts':_0x2837fc});}else{logger[_0x9068('0x29')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x9068('0x9c'));_0x3fac51['sendStatus'](0x194);}})[_0x9068('0x58')](handleError(_0x3fac51,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index b55880a..2ee227e 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 _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xda19,0xd5));var _0x9da1=function(_0x518b0b,_0x22a272){_0x518b0b=_0x518b0b-0x0;var _0x37bf43=_0xda19[_0x518b0b];return _0x37bf43;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x87f381,_0x2ab3d8){var _0x3f96cd=function(_0xc189d4){while(--_0xc189d4){_0x87f381['push'](_0x87f381['shift']());}};_0x3f96cd(++_0x2ab3d8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4276d0,_0x23f6a2){_0x4276d0=_0x4276d0-0x0;var _0x1e6929=_0xdbf5[_0x4276d0];return _0x1e6929;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5dbf('0xc')]},{'name':'phone','fields':[_0x5dbf('0xd')]},{'name':_0x5dbf('0xe'),'fields':[_0x5dbf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6a22475..9e47475 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 _0x69d5=['attributes','limit','include','map','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','active','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','Agent','UserId','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','UPDATE','length','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where'];(function(_0x23fbe2,_0x4b8a8d){var _0x553438=function(_0x24e9dc){while(--_0x24e9dc){_0x23fbe2['push'](_0x23fbe2['shift']());}};_0x553438(++_0x4b8a8d);}(_0x69d5,0x15a));var _0x569d=function(_0x249029,_0x2fd994){_0x249029=_0x249029-0x0;var _0x236f57=_0x69d5[_0x249029];return _0x236f57;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var moment=require(_0x569d('0x2'));var BPromise=require(_0x569d('0x3'));var rs=require(_0x569d('0x4'));var fs=require('fs');var Redis=require(_0x569d('0x5'));var db=require(_0x569d('0x6'))['db'];var utils=require(_0x569d('0x7'));var logger=require(_0x569d('0x8'))('rpc');var config=require(_0x569d('0x9'));var jayson=require(_0x569d('0xa'));var client=jayson[_0x569d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47151d,_0x590dd2,_0xc94209){return new BPromise(function(_0x296fa1,_0x24e5af){return client['request'](_0x47151d,_0xc94209)[_0x569d('0xc')](function(_0x2031ce){logger[_0x569d('0xd')](_0x569d('0xe'),_0x590dd2,_0x569d('0xf'));logger[_0x569d('0x10')](_0x569d('0x11'),_0x590dd2,_0x569d('0xf'),JSON[_0x569d('0x12')](_0x2031ce));if(_0x2031ce[_0x569d('0x13')]){if(_0x2031ce[_0x569d('0x13')]['code']===0x1f4){logger[_0x569d('0x13')]('CmHopper,\x20%s,\x20%s',_0x590dd2,_0x2031ce['error'][_0x569d('0x14')]);return _0x24e5af(_0x2031ce['error']['message']);}logger[_0x569d('0x13')]('CmHopper,\x20%s,\x20%s',_0x590dd2,_0x2031ce[_0x569d('0x13')][_0x569d('0x14')]);return _0x296fa1(_0x2031ce[_0x569d('0x13')][_0x569d('0x14')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x590dd2,_0x569d('0xf'));_0x296fa1(_0x2031ce[_0x569d('0x15')][_0x569d('0x14')]);}})[_0x569d('0x16')](function(_0x18b5a6){logger['error']('CmHopper,\x20%s,\x20%s',_0x590dd2,_0x18b5a6);_0x24e5af(_0x18b5a6);});});}exports[_0x569d('0x17')]=function(_0x3a20ba){var _0x5cae31=this;return new Promise(function(_0x332205,_0x545153){return db[_0x569d('0x18')][_0x569d('0x19')]({'raw':_0x3a20ba['options']?_0x3a20ba[_0x569d('0x1a')][_0x569d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a20ba[_0x569d('0x1a')]?_0x3a20ba[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':_0x3a20ba[_0x569d('0x1a')]?_0x3a20ba['options'][_0x569d('0x1d')]||null:null,'limit':_0x3a20ba[_0x569d('0x1a')]?_0x3a20ba[_0x569d('0x1a')][_0x569d('0x1e')]||null:null,'include':_0x3a20ba['options']?_0x3a20ba[_0x569d('0x1a')][_0x569d('0x1f')]?_[_0x569d('0x20')](_0x3a20ba['options']['include'],function(_0x49c037){return{'model':db[_0x49c037[_0x569d('0x21')]],'as':_0x49c037['as'],'attributes':_0x49c037['attributes'],'include':_0x49c037[_0x569d('0x1f')]?_[_0x569d('0x20')](_0x49c037[_0x569d('0x1f')],function(_0x537d29){return{'model':db[_0x537d29['model']],'as':_0x537d29['as'],'attributes':_0x537d29[_0x569d('0x1d')],'include':_0x537d29[_0x569d('0x1f')]?_[_0x569d('0x20')](_0x537d29[_0x569d('0x1f')],function(_0x49a6b6){return{'model':db[_0x49a6b6[_0x569d('0x21')]],'as':_0x49a6b6['as'],'attributes':_0x49a6b6['attributes']};}):[]};}):[]};}):[]:[]})[_0x569d('0xc')](function(_0x498b82){logger[_0x569d('0xd')](_0x569d('0x17'),_0x3a20ba);logger[_0x569d('0x10')](_0x569d('0x17'),_0x3a20ba,JSON[_0x569d('0x12')](_0x498b82));_0x332205(_0x498b82);})[_0x569d('0x16')](function(_0xe2cb08){logger[_0x569d('0x13')]('GetCmHopper',_0xe2cb08[_0x569d('0x14')],_0x3a20ba);_0x545153(_0x5cae31['error'](0x1f4,_0xe2cb08[_0x569d('0x14')]));});});};exports[_0x569d('0x22')]=function(_0x22507d){var _0x2b9ebc=this;return new Promise(function(_0x3df8a5,_0x3bb8d9){return db[_0x569d('0x18')][_0x569d('0x23')]({'raw':_0x22507d[_0x569d('0x1a')]?_0x22507d['options'][_0x569d('0x1b')]===undefined?!![]:![]:!![],'where':_0x22507d[_0x569d('0x1a')]?_0x22507d[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':_0x22507d[_0x569d('0x1a')]?_0x22507d['options'][_0x569d('0x1d')]||null:null,'include':_0x22507d[_0x569d('0x1a')]?_0x22507d[_0x569d('0x1a')][_0x569d('0x1f')]?_['map'](_0x22507d[_0x569d('0x1a')]['include'],function(_0x5b5d7f){return{'model':db[_0x5b5d7f[_0x569d('0x21')]],'as':_0x5b5d7f['as'],'attributes':_0x5b5d7f[_0x569d('0x1d')],'include':_0x5b5d7f[_0x569d('0x1f')]?_['map'](_0x5b5d7f[_0x569d('0x1f')],function(_0xe35c5d){return{'model':db[_0xe35c5d[_0x569d('0x21')]],'as':_0xe35c5d['as'],'attributes':_0xe35c5d[_0x569d('0x1d')],'include':_0xe35c5d[_0x569d('0x1f')]?_['map'](_0xe35c5d[_0x569d('0x1f')],function(_0xd55dd0){return{'model':db[_0xd55dd0[_0x569d('0x21')]],'as':_0xd55dd0['as'],'attributes':_0xd55dd0[_0x569d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6dcf){logger['info'](_0x569d('0x22'),_0x22507d);logger[_0x569d('0x10')](_0x569d('0x22'),_0x22507d,JSON[_0x569d('0x12')](_0x4b6dcf));_0x3df8a5(_0x4b6dcf);})['catch'](function(_0x5e3aee){logger[_0x569d('0x13')]('ShowCmHopper',_0x5e3aee[_0x569d('0x14')],_0x22507d);_0x3bb8d9(_0x2b9ebc[_0x569d('0x13')](0x1f4,_0x5e3aee[_0x569d('0x14')]));});});};exports[_0x569d('0x24')]=function(_0x429c59){var _0x2135a0=this;return new Promise(function(_0x2a4ee7,_0x4557b9){return db[_0x569d('0x18')][_0x569d('0x25')](_0x429c59[_0x569d('0x26')],{'raw':_0x429c59[_0x569d('0x1a')]?_0x429c59[_0x569d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x569d('0xc')](function(_0x1adf98){logger[_0x569d('0xd')]('CreateCmHopper',_0x429c59);logger[_0x569d('0x10')](_0x569d('0x24'),_0x429c59,JSON[_0x569d('0x12')](_0x1adf98));_0x2a4ee7(_0x1adf98);})[_0x569d('0x16')](function(_0x344088){logger['error']('CreateCmHopper',_0x344088['message'],_0x429c59);_0x4557b9(_0x2135a0[_0x569d('0x13')](0x1f4,_0x344088[_0x569d('0x14')]));});});};exports[_0x569d('0x27')]=function(_0x349aae){var _0x2643f1=this;return new Promise(function(_0x321dda,_0xab026a){return db['CmHopper'][_0x569d('0x28')](_0x349aae['body'],{'raw':_0x349aae[_0x569d('0x1a')]?_0x349aae['options'][_0x569d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x349aae[_0x569d('0x1a')]?_0x349aae[_0x569d('0x1a')]['where']||null:null,'attributes':_0x349aae[_0x569d('0x1a')]?_0x349aae[_0x569d('0x1a')][_0x569d('0x1d')]||null:null,'limit':_0x349aae[_0x569d('0x1a')]?_0x349aae[_0x569d('0x1a')][_0x569d('0x1e')]||null:null})[_0x569d('0xc')](function(_0x5f5619){logger[_0x569d('0xd')](_0x569d('0x27'),_0x349aae);logger[_0x569d('0xd')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x349aae[_0x569d('0x1a')][_0x569d('0x1c')]),_0x349aae[_0x569d('0x26')][_0x569d('0x29')]);logger[_0x569d('0x10')](_0x569d('0x27'),_0x349aae,JSON[_0x569d('0x12')](_0x5f5619));_0x321dda(_0x5f5619);})['catch'](function(_0x519a6e){logger['error'](_0x569d('0x27'),_0x519a6e[_0x569d('0x14')],_0x349aae);_0xab026a(_0x2643f1['error'](0x1f4,_0x519a6e[_0x569d('0x14')]));});});};exports['DestroyCmHopper']=function(_0x326496){var _0x3589dc=this;return new Promise(function(_0x2cb2a7,_0x3c51b8){return db[_0x569d('0x18')]['destroy']({'where':_0x326496[_0x569d('0x1a')]?_0x326496['options'][_0x569d('0x1c')]||null:null})[_0x569d('0xc')](function(_0x11d50d){logger[_0x569d('0xd')](_0x569d('0x2a'),_0x326496);logger[_0x569d('0x10')]('DestroyCmHopper',_0x326496,JSON['stringify'](_0x11d50d));_0x2cb2a7(_0x11d50d);})[_0x569d('0x16')](function(_0x50e77e){logger[_0x569d('0x13')]('DestroyCmHopper',_0x50e77e[_0x569d('0x14')],_0x326496);_0x3c51b8(_0x3589dc[_0x569d('0x13')](0x1f4,_0x50e77e[_0x569d('0x14')]));});});};exports['GetContactDialer']=function(_0xd434f1){var _0x51c937=this;return new Promise(function(_0x5c5fd5,_0x86bcaf){return db[_0x569d('0x2b')][_0x569d('0x2c')]()[_0x569d('0xc')](function(_0xb6df3){return db[_0x569d('0x2d')][_0x569d('0x2e')](function(_0x10052d){return db[_0x569d('0x18')]['findAll']({'where':_0xd434f1[_0x569d('0x1a')]?_0xd434f1[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':_0xd434f1[_0x569d('0x1a')]?_0xd434f1[_0x569d('0x1a')][_0x569d('0x1d')]||null:null,'limit':_0xd434f1[_0x569d('0x1a')]?_0xd434f1[_0x569d('0x1a')][_0x569d('0x1e')]||null:null,'order':_0xd434f1[_0x569d('0x1a')]?_0xd434f1[_0x569d('0x1a')][_0x569d('0x2f')]||null:null,'transaction':_0x10052d,'lock':_0x10052d[_0x569d('0x30')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x569d('0x31'),'attributes':_[_0x569d('0x32')](_0xb6df3)},{'model':db[_0x569d('0x33')],'as':_0x569d('0x34'),'attributes':['id','name','voicePause']}]})[_0x569d('0xc')](function(_0xe975ce){var _0x1fb850=[];var _0x459e55=[];for(var _0x5597fd=0x0;_0x5597fd<_0xe975ce['length'];_0x5597fd+=0x1){var _0x280918=_0xe975ce[_0x5597fd][_0x569d('0x35')];if(_0x280918===null){_0x1fb850[_0x569d('0x36')](_0xe975ce[_0x5597fd]['update'](_0xd434f1[_0x569d('0x26')],{'transaction':_0x10052d}));}else if(!_0x459e55[_0x569d('0x37')](_0x280918)){_0x459e55[_0x569d('0x36')](_0x280918);_0x1fb850['push'](_0xe975ce[_0x5597fd][_0x569d('0x28')](_0xd434f1[_0x569d('0x26')],{'transaction':_0x10052d}));}}return BPromise[_0x569d('0x38')](_0x1fb850);});})[_0x569d('0xc')](function(_0x11f753){logger[_0x569d('0xd')](_0x569d('0x39'),_0xd434f1);if(_0x11f753['length']>0x0){logger[_0x569d('0xd')](_0x569d('0x3a'),_0x11f753[0x0][_0x569d('0x3b')]['id'],_0x11f753[0x0][_0x569d('0x3b')][_0x569d('0x3c')],_0x11f753[0x0][_0x569d('0x3b')][_0x569d('0x29')]);}logger['debug']('GetContactDialer',_0xd434f1,JSON['stringify'](_0x11f753));_0x5c5fd5(_0x11f753);})[_0x569d('0x16')](function(_0x3fcaa4){logger[_0x569d('0x13')]('GetContactDialer',_0x3fcaa4[_0x569d('0x14')],_0xd434f1);_0x86bcaf(_0x51c937[_0x569d('0x13')](0x1f4,_0x3fcaa4[_0x569d('0x14')]));});});});};exports[_0x569d('0x3d')]=function(_0x267079){var _0x66ae9=this;return new Promise(function(_0x2a4046,_0x5d74fd){return db[_0x569d('0x2d')][_0x569d('0x2e')](function(_0x1a5548){return db['CmHopperFinal']['create'](_0x267079[_0x569d('0x26')],{'raw':_0x267079['options']?_0x267079[_0x569d('0x1a')][_0x569d('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x1a5548})[_0x569d('0xc')](function(){logger[_0x569d('0xd')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x569d('0x12')](_0x267079[_0x569d('0x1a')][_0x569d('0x1c')]),_0x267079['options'][_0x569d('0x1c')]['active']);return db[_0x569d('0x18')][_0x569d('0x3e')]({'where':_0x267079[_0x569d('0x1a')]?_0x267079[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'transaction':_0x1a5548});});})[_0x569d('0xc')](function(_0x3b8b79){logger['info']('MoveContactManagedDialer',_0x267079);logger[_0x569d('0x10')](_0x569d('0x3d'),_0x267079,JSON[_0x569d('0x12')](_0x3b8b79));_0x2a4046(_0x3b8b79);})[_0x569d('0x16')](function(_0x507d37){logger[_0x569d('0x13')](_0x569d('0x3d'),_0x507d37[_0x569d('0x14')],_0x267079);_0x5d74fd(_0x66ae9['error'](0x1f4,_0x507d37[_0x569d('0x14')]));});});};exports[_0x569d('0x3f')]=function(_0x4571a5){var _0x5023b9=this;return new Promise(function(_0x346da1,_0x384da7){return db[_0x569d('0x18')]['findAll']({'raw':_0x4571a5[_0x569d('0x1a')]?_0x4571a5[_0x569d('0x1a')][_0x569d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4571a5['options']?_0x4571a5[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':[[db[_0x569d('0x2d')]['fn'](_0x569d('0x40'),db['sequelize']['fn']('IF',db[_0x569d('0x2d')][_0x569d('0x41')](_0x569d('0x42')+util[_0x569d('0x43')]('\x22%s\x22',moment()[_0x569d('0x43')](_0x569d('0x44')))+'\x20,\x201,\x20null'))),_0x569d('0x45')]]})['then'](function(_0x4a8dfe){logger[_0x569d('0xd')](_0x569d('0x3f'),_0x4571a5);logger['debug'](_0x569d('0x3f'),_0x4571a5,JSON[_0x569d('0x12')](_0x4a8dfe));_0x346da1(_0x4a8dfe);})[_0x569d('0x16')](function(_0x23ddc4){logger[_0x569d('0x13')](_0x569d('0x3f'),_0x23ddc4[_0x569d('0x14')],_0x4571a5);_0x384da7(_0x5023b9['error'](0x1f4,_0x23ddc4[_0x569d('0x14')]));});});};exports[_0x569d('0x46')]=function(_0x47c383){var _0x59d8cd=this;return new Promise(function(_0x14a9b5,_0xeedd45){return db[_0x569d('0x2b')][_0x569d('0x2c')]()[_0x569d('0xc')](function(_0x2d78ea){return db[_0x569d('0x2d')][_0x569d('0x2e')](function(_0x5ec527){return db[_0x569d('0x18')][_0x569d('0x19')]({'where':_0x47c383[_0x569d('0x1a')]?_0x47c383[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':_0x47c383[_0x569d('0x1a')]?_0x47c383[_0x569d('0x1a')]['attributes']||null:null,'limit':0x1,'order':_0x47c383[_0x569d('0x1a')]?_0x47c383[_0x569d('0x1a')][_0x569d('0x2f')]||null:null,'group':db[_0x569d('0x18')]['UserId'],'transaction':_0x5ec527,'lock':_0x5ec527[_0x569d('0x30')][_0x569d('0x47')],'include':_0x47c383[_0x569d('0x1a')]?_0x47c383[_0x569d('0x1a')][_0x569d('0x1f')]?_[_0x569d('0x20')](_0x47c383['options'][_0x569d('0x1f')],function(_0x1eb6dc){return{'model':db[_0x1eb6dc[_0x569d('0x21')]],'as':_0x1eb6dc['as'],'attributes':_0x1eb6dc[_0x569d('0x1d')],'include':_0x1eb6dc['include']?_['map'](_0x1eb6dc[_0x569d('0x1f')],function(_0x6cad2a){return{'model':db[_0x6cad2a[_0x569d('0x21')]],'as':_0x6cad2a['as'],'attributes':_0x6cad2a[_0x569d('0x1d')],'include':_0x6cad2a[_0x569d('0x1f')]?_[_0x569d('0x20')](_0x6cad2a[_0x569d('0x1f')],function(_0x86a644){return{'model':db[_0x86a644[_0x569d('0x21')]],'as':_0x86a644['as'],'attributes':_0x86a644[_0x569d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb65b8a){var _0x1ce99c=[];for(var _0x583354=0x0;_0x583354<_0xb65b8a[_0x569d('0x48')];_0x583354+=0x1){_0x1ce99c[_0x569d('0x36')](_0xb65b8a[_0x583354][_0x569d('0x28')](_0x47c383['body'],{'transaction':_0x5ec527}));}return BPromise['all'](_0x1ce99c);});})[_0x569d('0xc')](function(_0x5e3827){logger[_0x569d('0xd')](_0x569d('0x46'),_0x47c383);logger[_0x569d('0x10')]('GetContactRecallMe',_0x47c383,JSON[_0x569d('0x12')](_0x5e3827));_0x14a9b5(_0x5e3827);})[_0x569d('0x16')](function(_0x26f685){logger['error'](_0x569d('0x46'),_0x26f685[_0x569d('0x14')],_0x47c383);_0xeedd45(_0x59d8cd[_0x569d('0x13')](0x1f4,_0x26f685['message']));});});});};exports[_0x569d('0x49')]=function(_0x17611e){var _0x566f93=this;return new Promise(function(_0x4fb7ad,_0x1b94c6){db['CmContact']['describe']()['then'](function(_0x42694b){return db[_0x569d('0x18')][_0x569d('0x19')]({'raw':_0x17611e[_0x569d('0x1a')]?_0x17611e[_0x569d('0x1a')][_0x569d('0x1b')]===undefined?!![]:![]:!![],'where':_0x17611e[_0x569d('0x1a')]?_0x17611e[_0x569d('0x1a')][_0x569d('0x1c')]||null:null,'attributes':_0x17611e[_0x569d('0x1a')]?_0x17611e['options'][_0x569d('0x1d')]||null:null,'limit':_0x17611e[_0x569d('0x1a')]?_0x17611e[_0x569d('0x1a')][_0x569d('0x1e')]||null:null,'include':_0x17611e['options']?_0x17611e[_0x569d('0x1a')][_0x569d('0x1f')]?_[_0x569d('0x20')](_0x17611e['options']['include'],function(_0x3420c9){return{'model':db[_0x3420c9['model']],'as':_0x3420c9['as'],'attributes':_0x3420c9['as']===_0x569d('0x31')?_[_0x569d('0x32')](_0x42694b):_0x3420c9['attributes'],'include':_0x3420c9[_0x569d('0x1f')]?_[_0x569d('0x20')](_0x3420c9[_0x569d('0x1f')],function(_0x549111){return{'model':db[_0x549111[_0x569d('0x21')]],'as':_0x549111['as'],'attributes':_0x549111[_0x569d('0x1d')],'include':_0x549111[_0x569d('0x1f')]?_[_0x569d('0x20')](_0x549111[_0x569d('0x1f')],function(_0x163455){return{'model':db[_0x163455[_0x569d('0x21')]],'as':_0x163455['as'],'attributes':_0x163455['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cb2d2){logger['info'](_0x569d('0x17'),_0x17611e);logger[_0x569d('0x10')](_0x569d('0x17'),_0x17611e,JSON[_0x569d('0x12')](_0x4cb2d2));_0x4fb7ad(_0x4cb2d2);})[_0x569d('0x16')](function(_0x2161ab){logger[_0x569d('0x13')](_0x569d('0x17'),_0x2161ab[_0x569d('0x14')],_0x17611e);_0x1b94c6(_0x566f93[_0x569d('0x13')](0x1f4,_0x2161ab['message']));});});});};exports['ResetActiveCalls']=function(_0x51b0ed){var _0xdb81f4=this;return new Promise(function(_0x3ed54a,_0x2413a9){return db[_0x569d('0x2d')]['transaction'](function(_0x31beda){return db['CmHopper']['update']({'active':![]},{'where':{},'transaction':_0x31beda})['then'](function(_0x4f161b){logger[_0x569d('0xd')](_0x569d('0x4a'),_0x51b0ed);logger['debug'](_0x569d('0x4a'),_0x51b0ed,JSON[_0x569d('0x12')](_0x4f161b));_0x3ed54a(_0x4f161b);})[_0x569d('0x16')](function(_0x4213b4){logger[_0x569d('0x13')](_0x569d('0x4a'),_0x4213b4[_0x569d('0x14')],_0x51b0ed);_0x2413a9(_0xdb81f4[_0x569d('0x13')](0x1f4,_0x4213b4[_0x569d('0x14')]));});});});}; \ No newline at end of file +var _0x2f63=['limit','include','model','map','info','ShowCmHopper','find','where','CreateCmHopper','create','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','update','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','order','LOCK','all','GetContactRecallMe','GetCmHopperPreview','Contact','ResetActiveCalls','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCmHopper','CmHopper','options','raw','attributes'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2f63,0x116));var _0x32f6=function(_0x5a1d97,_0x265b5a){_0x5a1d97=_0x5a1d97-0x0;var _0x401646=_0x2f63[_0x5a1d97];return _0x401646;};'use strict';var _=require('lodash');var util=require(_0x32f6('0x0'));var moment=require(_0x32f6('0x1'));var BPromise=require(_0x32f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f6('0x3'));var db=require(_0x32f6('0x4'))['db'];var utils=require(_0x32f6('0x5'));var logger=require('../../config/logger')(_0x32f6('0x6'));var config=require(_0x32f6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x32f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43ed77,_0x425e70,_0x5719e8){return new BPromise(function(_0x1b84e1,_0x2c2fdf){return client[_0x32f6('0x9')](_0x43ed77,_0x5719e8)[_0x32f6('0xa')](function(_0x1fcb20){logger['info'](_0x32f6('0xb'),_0x425e70,_0x32f6('0xc'));logger[_0x32f6('0xd')](_0x32f6('0xe'),_0x425e70,_0x32f6('0xc'),JSON[_0x32f6('0xf')](_0x1fcb20));if(_0x1fcb20['error']){if(_0x1fcb20['error'][_0x32f6('0x10')]===0x1f4){logger[_0x32f6('0x11')](_0x32f6('0xb'),_0x425e70,_0x1fcb20[_0x32f6('0x11')][_0x32f6('0x12')]);return _0x2c2fdf(_0x1fcb20[_0x32f6('0x11')]['message']);}logger['error'](_0x32f6('0xb'),_0x425e70,_0x1fcb20[_0x32f6('0x11')][_0x32f6('0x12')]);return _0x1b84e1(_0x1fcb20['error'][_0x32f6('0x12')]);}else{logger['info'](_0x32f6('0xb'),_0x425e70,'request\x20sent');_0x1b84e1(_0x1fcb20[_0x32f6('0x13')][_0x32f6('0x12')]);}})[_0x32f6('0x14')](function(_0x3c8c25){logger[_0x32f6('0x11')](_0x32f6('0xb'),_0x425e70,_0x3c8c25);_0x2c2fdf(_0x3c8c25);});});}exports[_0x32f6('0x15')]=function(_0x577932){var _0x59611d=this;return new Promise(function(_0x586ada,_0x53edc2){return db[_0x32f6('0x16')]['findAll']({'raw':_0x577932[_0x32f6('0x17')]?_0x577932[_0x32f6('0x17')][_0x32f6('0x18')]===undefined?!![]:![]:!![],'where':_0x577932[_0x32f6('0x17')]?_0x577932['options']['where']||null:null,'attributes':_0x577932[_0x32f6('0x17')]?_0x577932['options'][_0x32f6('0x19')]||null:null,'limit':_0x577932[_0x32f6('0x17')]?_0x577932['options'][_0x32f6('0x1a')]||null:null,'include':_0x577932[_0x32f6('0x17')]?_0x577932[_0x32f6('0x17')][_0x32f6('0x1b')]?_['map'](_0x577932[_0x32f6('0x17')]['include'],function(_0x2d09ba){return{'model':db[_0x2d09ba[_0x32f6('0x1c')]],'as':_0x2d09ba['as'],'attributes':_0x2d09ba[_0x32f6('0x19')],'include':_0x2d09ba['include']?_[_0x32f6('0x1d')](_0x2d09ba[_0x32f6('0x1b')],function(_0x3ae117){return{'model':db[_0x3ae117[_0x32f6('0x1c')]],'as':_0x3ae117['as'],'attributes':_0x3ae117[_0x32f6('0x19')],'include':_0x3ae117['include']?_[_0x32f6('0x1d')](_0x3ae117['include'],function(_0x59288b){return{'model':db[_0x59288b[_0x32f6('0x1c')]],'as':_0x59288b['as'],'attributes':_0x59288b['attributes']};}):[]};}):[]};}):[]:[]})[_0x32f6('0xa')](function(_0x76e88f){logger[_0x32f6('0x1e')](_0x32f6('0x15'),_0x577932);logger[_0x32f6('0xd')](_0x32f6('0x15'),_0x577932,JSON[_0x32f6('0xf')](_0x76e88f));_0x586ada(_0x76e88f);})[_0x32f6('0x14')](function(_0x46d083){logger[_0x32f6('0x11')](_0x32f6('0x15'),_0x46d083[_0x32f6('0x12')],_0x577932);_0x53edc2(_0x59611d[_0x32f6('0x11')](0x1f4,_0x46d083[_0x32f6('0x12')]));});});};exports[_0x32f6('0x1f')]=function(_0x2afe28){var _0x919e66=this;return new Promise(function(_0x1d341d,_0x507605){return db[_0x32f6('0x16')][_0x32f6('0x20')]({'raw':_0x2afe28[_0x32f6('0x17')]?_0x2afe28['options'][_0x32f6('0x18')]===undefined?!![]:![]:!![],'where':_0x2afe28['options']?_0x2afe28['options'][_0x32f6('0x21')]||null:null,'attributes':_0x2afe28[_0x32f6('0x17')]?_0x2afe28[_0x32f6('0x17')][_0x32f6('0x19')]||null:null,'include':_0x2afe28[_0x32f6('0x17')]?_0x2afe28[_0x32f6('0x17')][_0x32f6('0x1b')]?_[_0x32f6('0x1d')](_0x2afe28[_0x32f6('0x17')][_0x32f6('0x1b')],function(_0xeb2de6){return{'model':db[_0xeb2de6[_0x32f6('0x1c')]],'as':_0xeb2de6['as'],'attributes':_0xeb2de6['attributes'],'include':_0xeb2de6['include']?_[_0x32f6('0x1d')](_0xeb2de6[_0x32f6('0x1b')],function(_0x2ffe94){return{'model':db[_0x2ffe94[_0x32f6('0x1c')]],'as':_0x2ffe94['as'],'attributes':_0x2ffe94[_0x32f6('0x19')],'include':_0x2ffe94[_0x32f6('0x1b')]?_[_0x32f6('0x1d')](_0x2ffe94[_0x32f6('0x1b')],function(_0x1e0e0b){return{'model':db[_0x1e0e0b[_0x32f6('0x1c')]],'as':_0x1e0e0b['as'],'attributes':_0x1e0e0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x32f6('0xa')](function(_0x3dbb70){logger[_0x32f6('0x1e')](_0x32f6('0x1f'),_0x2afe28);logger[_0x32f6('0xd')](_0x32f6('0x1f'),_0x2afe28,JSON[_0x32f6('0xf')](_0x3dbb70));_0x1d341d(_0x3dbb70);})['catch'](function(_0x324169){logger[_0x32f6('0x11')]('ShowCmHopper',_0x324169['message'],_0x2afe28);_0x507605(_0x919e66[_0x32f6('0x11')](0x1f4,_0x324169['message']));});});};exports[_0x32f6('0x22')]=function(_0x2425a7){var _0x41348e=this;return new Promise(function(_0xd420fd,_0x211b52){return db[_0x32f6('0x16')][_0x32f6('0x23')](_0x2425a7['body'],{'raw':_0x2425a7['options']?_0x2425a7[_0x32f6('0x17')][_0x32f6('0x18')]===undefined?!![]:![]:!![]})[_0x32f6('0xa')](function(_0x49b152){logger[_0x32f6('0x1e')](_0x32f6('0x22'),_0x2425a7);logger[_0x32f6('0xd')](_0x32f6('0x22'),_0x2425a7,JSON[_0x32f6('0xf')](_0x49b152));_0xd420fd(_0x49b152);})[_0x32f6('0x14')](function(_0x36442f){logger[_0x32f6('0x11')](_0x32f6('0x22'),_0x36442f[_0x32f6('0x12')],_0x2425a7);_0x211b52(_0x41348e[_0x32f6('0x11')](0x1f4,_0x36442f['message']));});});};exports[_0x32f6('0x24')]=function(_0x27f31d){var _0x876a78=this;return new Promise(function(_0x70daf7,_0x48317a){return db[_0x32f6('0x16')]['update'](_0x27f31d[_0x32f6('0x25')],{'raw':_0x27f31d[_0x32f6('0x17')]?_0x27f31d[_0x32f6('0x17')][_0x32f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f31d['options']?_0x27f31d[_0x32f6('0x17')][_0x32f6('0x21')]||null:null,'attributes':_0x27f31d[_0x32f6('0x17')]?_0x27f31d[_0x32f6('0x17')]['attributes']||null:null,'limit':_0x27f31d['options']?_0x27f31d[_0x32f6('0x17')][_0x32f6('0x1a')]||null:null})[_0x32f6('0xa')](function(_0x6493f8){logger['info'](_0x32f6('0x24'),_0x27f31d);logger[_0x32f6('0x1e')](_0x32f6('0x26'),JSON[_0x32f6('0xf')](_0x27f31d['options']['where']),_0x27f31d['body'][_0x32f6('0x27')]);logger['debug'](_0x32f6('0x24'),_0x27f31d,JSON[_0x32f6('0xf')](_0x6493f8));_0x70daf7(_0x6493f8);})[_0x32f6('0x14')](function(_0x5d19e9){logger[_0x32f6('0x11')](_0x32f6('0x24'),_0x5d19e9[_0x32f6('0x12')],_0x27f31d);_0x48317a(_0x876a78[_0x32f6('0x11')](0x1f4,_0x5d19e9[_0x32f6('0x12')]));});});};exports[_0x32f6('0x28')]=function(_0x337532){var _0x2e1326=this;return new Promise(function(_0x1e0c3f,_0x19e095){return db[_0x32f6('0x16')][_0x32f6('0x29')]({'where':_0x337532[_0x32f6('0x17')]?_0x337532[_0x32f6('0x17')]['where']||null:null})[_0x32f6('0xa')](function(_0x126d11){logger['info'](_0x32f6('0x28'),_0x337532);logger['debug']('DestroyCmHopper',_0x337532,JSON['stringify'](_0x126d11));_0x1e0c3f(_0x126d11);})[_0x32f6('0x14')](function(_0x142162){logger['error'](_0x32f6('0x28'),_0x142162[_0x32f6('0x12')],_0x337532);_0x19e095(_0x2e1326[_0x32f6('0x11')](0x1f4,_0x142162['message']));});});};exports[_0x32f6('0x2a')]=function(_0x18121){var _0x444b75=this;return new Promise(function(_0x3d8adf,_0x2f15d8){return db[_0x32f6('0x2b')][_0x32f6('0x2c')]()['then'](function(_0x5b4c83){return db[_0x32f6('0x2d')][_0x32f6('0x2e')](function(_0x37db5e){return db[_0x32f6('0x16')][_0x32f6('0x2f')]({'where':_0x18121['options']?_0x18121[_0x32f6('0x17')]['where']||null:null,'attributes':_0x18121[_0x32f6('0x17')]?_0x18121[_0x32f6('0x17')][_0x32f6('0x19')]||null:null,'limit':_0x18121[_0x32f6('0x17')]?_0x18121[_0x32f6('0x17')][_0x32f6('0x1a')]||null:null,'order':_0x18121[_0x32f6('0x17')]?_0x18121[_0x32f6('0x17')]['order']||null:null,'transaction':_0x37db5e,'lock':_0x37db5e['LOCK'][_0x32f6('0x30')],'include':[{'model':db[_0x32f6('0x2b')],'as':'Contact','attributes':_[_0x32f6('0x31')](_0x5b4c83)},{'model':db[_0x32f6('0x32')],'as':_0x32f6('0x33'),'attributes':['id',_0x32f6('0x34'),_0x32f6('0x35')]}]})[_0x32f6('0xa')](function(_0x6cb068){var _0x5dcbf9=[];var _0x4056e7=[];for(var _0x1e5755=0x0;_0x1e5755<_0x6cb068[_0x32f6('0x36')];_0x1e5755+=0x1){var _0x17f49f=_0x6cb068[_0x1e5755][_0x32f6('0x37')];if(_0x17f49f===null){_0x5dcbf9[_0x32f6('0x38')](_0x6cb068[_0x1e5755][_0x32f6('0x39')](_0x18121[_0x32f6('0x25')],{'transaction':_0x37db5e}));}else if(!_0x4056e7['includes'](_0x17f49f)){_0x4056e7[_0x32f6('0x38')](_0x17f49f);_0x5dcbf9[_0x32f6('0x38')](_0x6cb068[_0x1e5755][_0x32f6('0x39')](_0x18121[_0x32f6('0x25')],{'transaction':_0x37db5e}));}}return BPromise['all'](_0x5dcbf9);});})[_0x32f6('0xa')](function(_0x282a7a){logger[_0x32f6('0x1e')](_0x32f6('0x2a'),_0x18121);if(_0x282a7a[_0x32f6('0x36')]>0x0){logger['info'](_0x32f6('0x3a'),_0x282a7a[0x0]['dataValues']['id'],_0x282a7a[0x0][_0x32f6('0x3b')][_0x32f6('0x3c')],_0x282a7a[0x0]['dataValues'][_0x32f6('0x27')]);}logger[_0x32f6('0xd')]('GetContactDialer',_0x18121,JSON[_0x32f6('0xf')](_0x282a7a));_0x3d8adf(_0x282a7a);})[_0x32f6('0x14')](function(_0x33442f){logger[_0x32f6('0x11')]('GetContactDialer',_0x33442f[_0x32f6('0x12')],_0x18121);_0x2f15d8(_0x444b75[_0x32f6('0x11')](0x1f4,_0x33442f[_0x32f6('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x535f6d){var _0x5f3eeb=this;return new Promise(function(_0x3250a4,_0x1d9440){return db[_0x32f6('0x2d')]['transaction'](function(_0x163346){return db['CmHopperFinal'][_0x32f6('0x23')](_0x535f6d[_0x32f6('0x25')],{'raw':_0x535f6d[_0x32f6('0x17')]?_0x535f6d[_0x32f6('0x17')][_0x32f6('0x18')]===undefined?!![]:![]:!![],'transaction':_0x163346})[_0x32f6('0xa')](function(){logger[_0x32f6('0x1e')](_0x32f6('0x3d'),JSON['stringify'](_0x535f6d['options'][_0x32f6('0x21')]),_0x535f6d['options'][_0x32f6('0x21')]['active']);return db['CmHopper'][_0x32f6('0x29')]({'where':_0x535f6d[_0x32f6('0x17')]?_0x535f6d[_0x32f6('0x17')][_0x32f6('0x21')]||null:null,'transaction':_0x163346});});})[_0x32f6('0xa')](function(_0x557d11){logger[_0x32f6('0x1e')](_0x32f6('0x3e'),_0x535f6d);logger[_0x32f6('0xd')](_0x32f6('0x3e'),_0x535f6d,JSON[_0x32f6('0xf')](_0x557d11));_0x3250a4(_0x557d11);})['catch'](function(_0x5778e4){logger['error'](_0x32f6('0x3e'),_0x5778e4[_0x32f6('0x12')],_0x535f6d);_0x1d9440(_0x5f3eeb[_0x32f6('0x11')](0x1f4,_0x5778e4[_0x32f6('0x12')]));});});};exports[_0x32f6('0x3f')]=function(_0x31090d){var _0x5753a9=this;return new Promise(function(_0x6cf116,_0x1afaeb){return db[_0x32f6('0x16')][_0x32f6('0x2f')]({'raw':_0x31090d[_0x32f6('0x17')]?_0x31090d['options'][_0x32f6('0x18')]===undefined?!![]:![]:!![],'where':_0x31090d[_0x32f6('0x17')]?_0x31090d[_0x32f6('0x17')]['where']||null:null,'attributes':[[db[_0x32f6('0x2d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x32f6('0x2d')][_0x32f6('0x40')]('`scheduledat`\x20>=\x20'+util[_0x32f6('0x41')](_0x32f6('0x42'),moment()[_0x32f6('0x41')](_0x32f6('0x43')))+'\x20,\x201,\x20null'))),_0x32f6('0x44')]]})['then'](function(_0x1d92e3){logger['info'](_0x32f6('0x3f'),_0x31090d);logger['debug'](_0x32f6('0x3f'),_0x31090d,JSON['stringify'](_0x1d92e3));_0x6cf116(_0x1d92e3);})[_0x32f6('0x14')](function(_0x11aa24){logger['error']('CountReScheduled',_0x11aa24['message'],_0x31090d);_0x1afaeb(_0x5753a9['error'](0x1f4,_0x11aa24[_0x32f6('0x12')]));});});};exports['GetContactRecallMe']=function(_0x22f81c){var _0x36c4c0=this;return new Promise(function(_0xe206c6,_0xbe3f24){return db['CmContact'][_0x32f6('0x2c')]()[_0x32f6('0xa')](function(_0x3961f2){return db[_0x32f6('0x2d')][_0x32f6('0x2e')](function(_0x1c86c5){return db[_0x32f6('0x16')][_0x32f6('0x2f')]({'where':_0x22f81c['options']?_0x22f81c[_0x32f6('0x17')]['where']||null:null,'attributes':_0x22f81c[_0x32f6('0x17')]?_0x22f81c[_0x32f6('0x17')][_0x32f6('0x19')]||null:null,'limit':0x1,'order':_0x22f81c[_0x32f6('0x17')]?_0x22f81c[_0x32f6('0x17')][_0x32f6('0x45')]||null:null,'group':db['CmHopper'][_0x32f6('0x37')],'transaction':_0x1c86c5,'lock':_0x1c86c5[_0x32f6('0x46')][_0x32f6('0x30')],'include':_0x22f81c[_0x32f6('0x17')]?_0x22f81c[_0x32f6('0x17')][_0x32f6('0x1b')]?_['map'](_0x22f81c[_0x32f6('0x17')][_0x32f6('0x1b')],function(_0x390001){return{'model':db[_0x390001[_0x32f6('0x1c')]],'as':_0x390001['as'],'attributes':_0x390001[_0x32f6('0x19')],'include':_0x390001[_0x32f6('0x1b')]?_[_0x32f6('0x1d')](_0x390001[_0x32f6('0x1b')],function(_0x39038b){return{'model':db[_0x39038b[_0x32f6('0x1c')]],'as':_0x39038b['as'],'attributes':_0x39038b[_0x32f6('0x19')],'include':_0x39038b['include']?_[_0x32f6('0x1d')](_0x39038b[_0x32f6('0x1b')],function(_0x18d212){return{'model':db[_0x18d212['model']],'as':_0x18d212['as'],'attributes':_0x18d212['attributes']};}):[]};}):[]};}):[]:[]})[_0x32f6('0xa')](function(_0x484a29){var _0x2967dc=[];for(var _0x2b30d9=0x0;_0x2b30d9<_0x484a29[_0x32f6('0x36')];_0x2b30d9+=0x1){_0x2967dc[_0x32f6('0x38')](_0x484a29[_0x2b30d9][_0x32f6('0x39')](_0x22f81c[_0x32f6('0x25')],{'transaction':_0x1c86c5}));}return BPromise[_0x32f6('0x47')](_0x2967dc);});})[_0x32f6('0xa')](function(_0x232256){logger[_0x32f6('0x1e')](_0x32f6('0x48'),_0x22f81c);logger[_0x32f6('0xd')](_0x32f6('0x48'),_0x22f81c,JSON['stringify'](_0x232256));_0xe206c6(_0x232256);})[_0x32f6('0x14')](function(_0x1ae91a){logger[_0x32f6('0x11')](_0x32f6('0x48'),_0x1ae91a[_0x32f6('0x12')],_0x22f81c);_0xbe3f24(_0x36c4c0[_0x32f6('0x11')](0x1f4,_0x1ae91a['message']));});});});};exports[_0x32f6('0x49')]=function(_0xdf17d2){var _0x3b48b3=this;return new Promise(function(_0x38b55a,_0x530a5f){db[_0x32f6('0x2b')]['describe']()[_0x32f6('0xa')](function(_0x2dd84a){return db[_0x32f6('0x16')][_0x32f6('0x2f')]({'raw':_0xdf17d2['options']?_0xdf17d2[_0x32f6('0x17')][_0x32f6('0x18')]===undefined?!![]:![]:!![],'where':_0xdf17d2[_0x32f6('0x17')]?_0xdf17d2['options'][_0x32f6('0x21')]||null:null,'attributes':_0xdf17d2['options']?_0xdf17d2[_0x32f6('0x17')][_0x32f6('0x19')]||null:null,'limit':_0xdf17d2[_0x32f6('0x17')]?_0xdf17d2[_0x32f6('0x17')][_0x32f6('0x1a')]||null:null,'include':_0xdf17d2['options']?_0xdf17d2[_0x32f6('0x17')][_0x32f6('0x1b')]?_[_0x32f6('0x1d')](_0xdf17d2['options'][_0x32f6('0x1b')],function(_0x16d3bd){return{'model':db[_0x16d3bd[_0x32f6('0x1c')]],'as':_0x16d3bd['as'],'attributes':_0x16d3bd['as']===_0x32f6('0x4a')?_['keys'](_0x2dd84a):_0x16d3bd[_0x32f6('0x19')],'include':_0x16d3bd[_0x32f6('0x1b')]?_[_0x32f6('0x1d')](_0x16d3bd[_0x32f6('0x1b')],function(_0x2c0bc3){return{'model':db[_0x2c0bc3[_0x32f6('0x1c')]],'as':_0x2c0bc3['as'],'attributes':_0x2c0bc3[_0x32f6('0x19')],'include':_0x2c0bc3[_0x32f6('0x1b')]?_['map'](_0x2c0bc3[_0x32f6('0x1b')],function(_0x3b357f){return{'model':db[_0x3b357f[_0x32f6('0x1c')]],'as':_0x3b357f['as'],'attributes':_0x3b357f[_0x32f6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x32f6('0xa')](function(_0x4e48d5){logger[_0x32f6('0x1e')](_0x32f6('0x15'),_0xdf17d2);logger[_0x32f6('0xd')](_0x32f6('0x15'),_0xdf17d2,JSON['stringify'](_0x4e48d5));_0x38b55a(_0x4e48d5);})[_0x32f6('0x14')](function(_0x5b446c){logger['error'](_0x32f6('0x15'),_0x5b446c[_0x32f6('0x12')],_0xdf17d2);_0x530a5f(_0x3b48b3[_0x32f6('0x11')](0x1f4,_0x5b446c[_0x32f6('0x12')]));});});});};exports[_0x32f6('0x4b')]=function(_0x244122){var _0x6d7b9e=this;return new Promise(function(_0x5b9c29,_0x24febb){return db[_0x32f6('0x2d')][_0x32f6('0x2e')](function(_0x475194){return db[_0x32f6('0x16')][_0x32f6('0x39')]({'active':![]},{'where':{},'transaction':_0x475194})[_0x32f6('0xa')](function(_0x1c3599){logger['info'](_0x32f6('0x4b'),_0x244122);logger[_0x32f6('0xd')](_0x32f6('0x4b'),_0x244122,JSON[_0x32f6('0xf')](_0x1c3599));_0x5b9c29(_0x1c3599);})[_0x32f6('0x14')](function(_0x4aea79){logger[_0x32f6('0x11')](_0x32f6('0x4b'),_0x4aea79[_0x32f6('0x12')],_0x244122);_0x24febb(_0x6d7b9e[_0x32f6('0x11')](0x1f4,_0x4aea79[_0x32f6('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 945e6b5..1b9dbde 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 _0xfd2b=['/:id','show','post','create','put','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','index','/describe','isAuthenticated','get','/opencontacts','getOpenContacts'];(function(_0xd46227,_0x18477f){var _0x2a980d=function(_0x34e452){while(--_0x34e452){_0xd46227['push'](_0xd46227['shift']());}};_0x2a980d(++_0x18477f);}(_0xfd2b,0x79));var _0xbfd2=function(_0x3732b9,_0x57bb2b){_0x3732b9=_0x3732b9-0x0;var _0x239023=_0xfd2b[_0x3732b9];return _0x239023;};'use strict';var multer=require(_0xbfd2('0x0'));var util=require('util');var path=require(_0xbfd2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbfd2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbfd2('0x3'));var interaction=require(_0xbfd2('0x4'));var config=require('../../config/environment');var controller=require(_0xbfd2('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xbfd2('0x6')]);router['get'](_0xbfd2('0x7'),auth[_0xbfd2('0x8')](),controller['describe']);router[_0xbfd2('0x9')](_0xbfd2('0xa'),auth[_0xbfd2('0x8')](),controller[_0xbfd2('0xb')]);router[_0xbfd2('0x9')](_0xbfd2('0xc'),auth[_0xbfd2('0x8')](),controller[_0xbfd2('0xd')]);router[_0xbfd2('0xe')]('/',auth[_0xbfd2('0x8')](),controller[_0xbfd2('0xf')]);router[_0xbfd2('0xe')]('/preview',auth['isAuthenticated'](),controller['getPreview']);router[_0xbfd2('0x10')](_0xbfd2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbfd2('0x11')](_0xbfd2('0xc'),auth[_0xbfd2('0x8')](),controller['destroy']);module[_0xbfd2('0x12')]=router; \ No newline at end of file +var _0x4d30=['isAuthenticated','index','/describe','describe','post','create','getPreview','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x4d30,0x156));var _0x04d3=function(_0x316c04,_0x2bd05d){_0x316c04=_0x316c04-0x0;var _0x533566=_0x4d30[_0x316c04];return _0x533566;};'use strict';var multer=require('multer');var util=require(_0x04d3('0x0'));var path=require(_0x04d3('0x1'));var timeout=require(_0x04d3('0x2'));var express=require(_0x04d3('0x3'));var router=express[_0x04d3('0x4')]();var fs_extra=require(_0x04d3('0x5'));var auth=require(_0x04d3('0x6'));var interaction=require(_0x04d3('0x7'));var config=require('../../config/environment');var controller=require(_0x04d3('0x8'));router[_0x04d3('0x9')]('/',auth[_0x04d3('0xa')](),controller[_0x04d3('0xb')]);router[_0x04d3('0x9')](_0x04d3('0xc'),auth['isAuthenticated'](),controller[_0x04d3('0xd')]);router[_0x04d3('0x9')]('/opencontacts',auth[_0x04d3('0xa')](),controller['getOpenContacts']);router[_0x04d3('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x04d3('0xe')]('/',auth['isAuthenticated'](),controller[_0x04d3('0xf')]);router[_0x04d3('0xe')]('/preview',auth[_0x04d3('0xa')](),controller[_0x04d3('0x10')]);router[_0x04d3('0x11')](_0x04d3('0x12'),auth[_0x04d3('0xa')](),controller[_0x04d3('0x13')]);router[_0x04d3('0x14')](_0x04d3('0x12'),auth['isAuthenticated'](),controller[_0x04d3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9c85b32..da4fc30 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 _0x2e88=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x2e88,0x95));var _0x82e8=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x2e88[_0x199572];return _0x13cfa3;};'use strict';var moment=require(_0x82e8('0x0'));var Sequelize=require(_0x82e8('0x1'));module[_0x82e8('0x2')]={'phone':{'type':Sequelize[_0x82e8('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x82e8('0x4')],'unique':_0x82e8('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x82e8('0x5')},'VoiceQueueId':{'type':Sequelize[_0x82e8('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x7a3e=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x95ad05,_0x3cadb6){var _0x2d79f4=function(_0x9868f2){while(--_0x9868f2){_0x95ad05['push'](_0x95ad05['shift']());}};_0x2d79f4(++_0x3cadb6);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x43682b,_0x1f7025){_0x43682b=_0x43682b-0x0;var _0x320cb1=_0x7a3e[_0x43682b];return _0x320cb1;};'use strict';var moment=require(_0xe7a3('0x0'));var Sequelize=require(_0xe7a3('0x1'));module[_0xe7a3('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe7a3('0x3')],'unique':_0xe7a3('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xe7a3('0x3')],'unique':_0xe7a3('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index a9c0d41..f464ae4 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 _0x855d=['find','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','count','set','reject','save','update','then','destroy','error','stack','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params'];(function(_0x516de5,_0x198a67){var _0x312d4f=function(_0x4df656){while(--_0x4df656){_0x516de5['push'](_0x516de5['shift']());}};_0x312d4f(++_0x198a67);}(_0x855d,0x8c));var _0xd855=function(_0x547927,_0x57b893){_0x547927=_0x547927-0x0;var _0x3d7fd4=_0x855d[_0x547927];return _0x3d7fd4;};'use strict';var emlformat=require(_0xd855('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd855('0x1'));var rp=require(_0xd855('0x2'));var moment=require(_0xd855('0x3'));var BPromise=require(_0xd855('0x4'));var Mustache=require('mustache');var util=require(_0xd855('0x5'));var path=require(_0xd855('0x6'));var sox=require('sox');var csv=require(_0xd855('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd855('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd855('0x9'));var deskjs=require(_0xd855('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd855('0xb'));var Redis=require(_0xd855('0xc'));var authService=require(_0xd855('0xd'));var qs=require(_0xd855('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd855('0xf'));var logger=require('../../config/logger')(_0xd855('0x10'));var utils=require('../../config/utils');var config=require(_0xd855('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xd855('0x12'))['db'];function respondWithStatusCode(_0x4cd71f,_0x377daa){_0x377daa=_0x377daa||0xcc;return function(_0x39d335){if(_0x39d335){return _0x4cd71f['sendStatus'](_0x377daa);}return _0x4cd71f['status'](_0x377daa)[_0xd855('0x13')]();};}function respondWithResult(_0x27030b,_0x425466){_0x425466=_0x425466||0xc8;return function(_0x1d1694){if(_0x1d1694){return _0x27030b[_0xd855('0x14')](_0x425466)[_0xd855('0x15')](_0x1d1694);}};}function respondWithFilteredResult(_0x5dc7e7,_0x2d188c){return function(_0x1741a9){if(_0x1741a9){var _0x81389d=typeof _0x2d188c[_0xd855('0x16')]==='undefined'&&typeof _0x2d188c[_0xd855('0x17')]==='undefined';var _0x20f28d=_0x1741a9[_0xd855('0x18')];var _0x59dfca=_0x81389d?0x0:_0x2d188c[_0xd855('0x16')];var _0x1d86a5=_0x81389d?_0x1741a9[_0xd855('0x18')]:_0x2d188c[_0xd855('0x16')]+_0x2d188c['limit'];var _0x5672de;if(_0x1d86a5>=_0x20f28d){_0x1d86a5=_0x20f28d;_0x5672de=0xc8;}else{_0x5672de=0xce;}_0x5dc7e7['status'](_0x5672de);return _0x5dc7e7[_0xd855('0x19')]('Content-Range',_0x59dfca+'-'+_0x1d86a5+'/'+_0x20f28d)[_0xd855('0x15')](_0x1741a9);}return null;};}function patchUpdates(_0x463f89){return function(_0x5ca5ac){try{jsonpatch['apply'](_0x5ca5ac,_0x463f89,!![]);}catch(_0x2aff40){return BPromise[_0xd855('0x1a')](_0x2aff40);}return _0x5ca5ac[_0xd855('0x1b')]();};}function saveUpdates(_0x172fc3,_0x4d9049){return function(_0x55c600){if(_0x55c600){return _0x55c600[_0xd855('0x1c')](_0x172fc3)[_0xd855('0x1d')](function(_0x45bcb2){return _0x45bcb2;});}return null;};}function removeEntity(_0x26b050,_0x19a54a){return function(_0x2a45ca){if(_0x2a45ca){return _0x2a45ca[_0xd855('0x1e')]()[_0xd855('0x1d')](function(){_0x26b050[_0xd855('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38d734,_0xc35553){return function(_0x555f4a){if(!_0x555f4a){_0x38d734['sendStatus'](0x194);}return _0x555f4a;};}function handleError(_0x6ef54d,_0x3334c2){_0x3334c2=_0x3334c2||0x1f4;return function(_0x49ae7e){logger[_0xd855('0x1f')](_0x49ae7e[_0xd855('0x20')]);if(_0x49ae7e['name']){delete _0x49ae7e['name'];}_0x6ef54d['status'](_0x3334c2)[_0xd855('0x21')](_0x49ae7e);};}exports[_0xd855('0x22')]=function(_0x237d71,_0x2f284c){var _0x4c5344={},_0x246cb9={},_0x27231d={'count':0x0,'rows':[]};var _0x21336e=_[_0xd855('0x23')](db[_0xd855('0x24')][_0xd855('0x25')],function(_0x44400a){return{'name':_0x44400a[_0xd855('0x26')],'type':_0x44400a['type'][_0xd855('0x27')]};});_0x246cb9[_0xd855('0x28')]=_['map'](_0x21336e,_0xd855('0x29'));_0x246cb9[_0xd855('0x2a')]=_[_0xd855('0x2b')](_0x237d71[_0xd855('0x2a')]);_0x246cb9[_0xd855('0x2c')]=_[_0xd855('0x2d')](_0x246cb9['model'],_0x246cb9['query']);_0x4c5344[_0xd855('0x2e')]=_[_0xd855('0x2d')](_0x246cb9['model'],qs[_0xd855('0x2f')](_0x237d71[_0xd855('0x2a')]['fields']));_0x4c5344['attributes']=_0x4c5344[_0xd855('0x2e')][_0xd855('0x30')]?_0x4c5344[_0xd855('0x2e')]:_0x246cb9['model'];if(!_0x237d71[_0xd855('0x2a')][_0xd855('0x31')](_0xd855('0x32'))){_0x4c5344['limit']=qs[_0xd855('0x17')](_0x237d71[_0xd855('0x2a')][_0xd855('0x17')]);_0x4c5344[_0xd855('0x16')]=qs[_0xd855('0x16')](_0x237d71[_0xd855('0x2a')][_0xd855('0x16')]);}_0x4c5344[_0xd855('0x33')]=qs[_0xd855('0x34')](_0x237d71[_0xd855('0x2a')][_0xd855('0x34')]);_0x4c5344[_0xd855('0x35')]=qs[_0xd855('0x2c')](_[_0xd855('0x36')](_0x237d71['query'],_0x246cb9[_0xd855('0x2c')]),_0x21336e);if(_0x237d71[_0xd855('0x2a')][_0xd855('0x37')]){_0x4c5344[_0xd855('0x35')]=_[_0xd855('0x38')](_0x4c5344[_0xd855('0x35')],{'$or':_['map'](_0x21336e,function(_0x3ac16b){if(_0x3ac16b['type']!==_0xd855('0x39')){var _0x2af919={};_0x2af919[_0x3ac16b[_0xd855('0x29')]]={'$like':'%'+_0x237d71[_0xd855('0x2a')]['filter']+'%'};return _0x2af919;}})});}_0x4c5344=_[_0xd855('0x38')]({},_0x4c5344,_0x237d71[_0xd855('0x3a')]);var _0x4acfdc={'where':_0x4c5344[_0xd855('0x35')]};return db[_0xd855('0x24')]['count'](_0x4acfdc)['then'](function(_0x2b8a44){_0x27231d[_0xd855('0x18')]=_0x2b8a44;if(_0x237d71[_0xd855('0x2a')][_0xd855('0x3b')]){_0x4c5344['include']=[{'all':!![]}];}return db[_0xd855('0x24')][_0xd855('0x3c')](_0x4c5344);})[_0xd855('0x1d')](function(_0xed54d1){_0x27231d[_0xd855('0x3d')]=_0xed54d1;return _0x27231d;})['then'](respondWithFilteredResult(_0x2f284c,_0x4c5344))['catch'](handleError(_0x2f284c,null));};exports[_0xd855('0x3e')]=function(_0x104e59,_0xbc2a3f){var _0x56f155={'raw':!![],'where':{'id':_0x104e59[_0xd855('0x3f')]['id']}},_0x12629a={};_0x12629a[_0xd855('0x28')]=_['keys'](db[_0xd855('0x24')][_0xd855('0x25')]);_0x12629a[_0xd855('0x2a')]=_[_0xd855('0x2b')](_0x104e59['query']);_0x12629a['filters']=_[_0xd855('0x2d')](_0x12629a['model'],_0x12629a[_0xd855('0x2a')]);_0x56f155[_0xd855('0x2e')]=_[_0xd855('0x2d')](_0x12629a[_0xd855('0x28')],qs[_0xd855('0x2f')](_0x104e59[_0xd855('0x2a')][_0xd855('0x2f')]));_0x56f155[_0xd855('0x2e')]=_0x56f155[_0xd855('0x2e')][_0xd855('0x30')]?_0x56f155[_0xd855('0x2e')]:_0x12629a['model'];if(_0x104e59[_0xd855('0x2a')][_0xd855('0x3b')]){_0x56f155['include']=[{'all':!![]}];}_0x56f155=_['merge']({},_0x56f155,_0x104e59[_0xd855('0x3a')]);return db[_0xd855('0x24')][_0xd855('0x40')](_0x56f155)['then'](handleEntityNotFound(_0xbc2a3f,null))['then'](respondWithResult(_0xbc2a3f,null))[_0xd855('0x41')](handleError(_0xbc2a3f,null));};exports[_0xd855('0x1c')]=function(_0x1a351c,_0x384835){if(_0x1a351c[_0xd855('0x42')]['id']){delete _0x1a351c[_0xd855('0x42')]['id'];}return db[_0xd855('0x24')]['find']({'where':{'id':_0x1a351c['params']['id']}})[_0xd855('0x1d')](handleEntityNotFound(_0x384835,null))[_0xd855('0x1d')](saveUpdates(_0x1a351c[_0xd855('0x42')],null))['then'](respondWithResult(_0x384835,null))[_0xd855('0x41')](handleError(_0x384835,null));};exports['destroy']=function(_0x1a1364,_0x442e99){return db[_0xd855('0x24')][_0xd855('0x40')]({'where':{'id':_0x1a1364[_0xd855('0x3f')]['id']}})[_0xd855('0x1d')](handleEntityNotFound(_0x442e99,null))[_0xd855('0x1d')](removeEntity(_0x442e99,null))[_0xd855('0x41')](handleError(_0x442e99,null));};exports[_0xd855('0x43')]=function(_0x506a75,_0x4ac5b3){return db[_0xd855('0x24')][_0xd855('0x43')]()[_0xd855('0x1d')](respondWithResult(_0x4ac5b3,null))[_0xd855('0x41')](handleError(_0x4ac5b3,null));}; \ No newline at end of file +var _0x6c58=['../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','model','attributes','intersection','length','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','findAll','rows','show','params','keys','fields','includeAll','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x533da7,_0x51e851){var _0x46f6b5=function(_0x35ab5d){while(--_0x35ab5d){_0x533da7['push'](_0x533da7['shift']());}};_0x46f6b5(++_0x51e851);}(_0x6c58,0x1ef));var _0x86c5=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x6c58[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x86c5('0x0'));var rimraf=require(_0x86c5('0x1'));var zipdir=require(_0x86c5('0x2'));var jsonpatch=require(_0x86c5('0x3'));var rp=require('request-promise');var moment=require(_0x86c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x86c5('0x5'));var path=require(_0x86c5('0x6'));var sox=require(_0x86c5('0x7'));var csv=require(_0x86c5('0x8'));var ejs=require(_0x86c5('0x9'));var fs=require('fs');var fs_extra=require(_0x86c5('0xa'));var _=require(_0x86c5('0xb'));var squel=require(_0x86c5('0xc'));var crypto=require('crypto');var jsforce=require(_0x86c5('0xd'));var deskjs=require(_0x86c5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x86c5('0xf'));var Papa=require(_0x86c5('0x10'));var Redis=require('ioredis');var authService=require(_0x86c5('0x11'));var qs=require(_0x86c5('0x12'));var as=require(_0x86c5('0x13'));var hardwareService=require(_0x86c5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x86c5('0x15'));var config=require(_0x86c5('0x16'));var licenseUtil=require(_0x86c5('0x17'));var db=require(_0x86c5('0x18'))['db'];function respondWithStatusCode(_0x361faf,_0x2ebe38){_0x2ebe38=_0x2ebe38||0xcc;return function(_0x19b11f){if(_0x19b11f){return _0x361faf['sendStatus'](_0x2ebe38);}return _0x361faf[_0x86c5('0x19')](_0x2ebe38)[_0x86c5('0x1a')]();};}function respondWithResult(_0x6f07ba,_0x14ed02){_0x14ed02=_0x14ed02||0xc8;return function(_0x4dea67){if(_0x4dea67){return _0x6f07ba[_0x86c5('0x19')](_0x14ed02)['json'](_0x4dea67);}};}function respondWithFilteredResult(_0x563f08,_0x1e0c4e){return function(_0x1afa9){if(_0x1afa9){var _0x4203c9=typeof _0x1e0c4e[_0x86c5('0x1b')]===_0x86c5('0x1c')&&typeof _0x1e0c4e[_0x86c5('0x1d')]===_0x86c5('0x1c');var _0x32ebc7=_0x1afa9[_0x86c5('0x1e')];var _0xc7e75d=_0x4203c9?0x0:_0x1e0c4e['offset'];var _0x3f587c=_0x4203c9?_0x1afa9[_0x86c5('0x1e')]:_0x1e0c4e['offset']+_0x1e0c4e[_0x86c5('0x1d')];var _0x4825fe;if(_0x3f587c>=_0x32ebc7){_0x3f587c=_0x32ebc7;_0x4825fe=0xc8;}else{_0x4825fe=0xce;}_0x563f08['status'](_0x4825fe);return _0x563f08['set']('Content-Range',_0xc7e75d+'-'+_0x3f587c+'/'+_0x32ebc7)[_0x86c5('0x1f')](_0x1afa9);}return null;};}function patchUpdates(_0x51c6a6){return function(_0x1de6c2){try{jsonpatch[_0x86c5('0x20')](_0x1de6c2,_0x51c6a6,!![]);}catch(_0x2bb04c){return BPromise[_0x86c5('0x21')](_0x2bb04c);}return _0x1de6c2[_0x86c5('0x22')]();};}function saveUpdates(_0x2ac890,_0x582a23){return function(_0xe89332){if(_0xe89332){return _0xe89332[_0x86c5('0x23')](_0x2ac890)[_0x86c5('0x24')](function(_0x521135){return _0x521135;});}return null;};}function removeEntity(_0x2a2a1a,_0x511c5b){return function(_0x1258ac){if(_0x1258ac){return _0x1258ac[_0x86c5('0x25')]()[_0x86c5('0x24')](function(){_0x2a2a1a['status'](0xcc)[_0x86c5('0x1a')]();});}};}function handleEntityNotFound(_0x33f16f,_0x18e651){return function(_0x442261){if(!_0x442261){_0x33f16f[_0x86c5('0x26')](0x194);}return _0x442261;};}function handleError(_0x2c451f,_0x43d390){_0x43d390=_0x43d390||0x1f4;return function(_0x1eb62e){logger[_0x86c5('0x27')](_0x1eb62e[_0x86c5('0x28')]);if(_0x1eb62e['name']){delete _0x1eb62e[_0x86c5('0x29')];}_0x2c451f[_0x86c5('0x19')](_0x43d390)[_0x86c5('0x2a')](_0x1eb62e);};}exports[_0x86c5('0x2b')]=function(_0xc5f30,_0x362196){var _0xe9a55c={},_0xfdb018={},_0x2a3717={'count':0x0,'rows':[]};var _0x4701f6=_[_0x86c5('0x2c')](db['CmHopperBlack'][_0x86c5('0x2d')],function(_0x567ed5){return{'name':_0x567ed5['fieldName'],'type':_0x567ed5[_0x86c5('0x2e')][_0x86c5('0x2f')]};});_0xfdb018['model']=_['map'](_0x4701f6,_0x86c5('0x29'));_0xfdb018[_0x86c5('0x30')]=_['keys'](_0xc5f30[_0x86c5('0x30')]);_0xfdb018[_0x86c5('0x31')]=_['intersection'](_0xfdb018[_0x86c5('0x32')],_0xfdb018['query']);_0xe9a55c[_0x86c5('0x33')]=_[_0x86c5('0x34')](_0xfdb018['model'],qs['fields'](_0xc5f30[_0x86c5('0x30')]['fields']));_0xe9a55c[_0x86c5('0x33')]=_0xe9a55c[_0x86c5('0x33')][_0x86c5('0x35')]?_0xe9a55c['attributes']:_0xfdb018[_0x86c5('0x32')];if(!_0xc5f30['query']['hasOwnProperty']('nolimit')){_0xe9a55c[_0x86c5('0x1d')]=qs[_0x86c5('0x1d')](_0xc5f30['query'][_0x86c5('0x1d')]);_0xe9a55c[_0x86c5('0x1b')]=qs[_0x86c5('0x1b')](_0xc5f30[_0x86c5('0x30')][_0x86c5('0x1b')]);}_0xe9a55c[_0x86c5('0x36')]=qs[_0x86c5('0x37')](_0xc5f30[_0x86c5('0x30')]['sort']);_0xe9a55c[_0x86c5('0x38')]=qs['filters'](_[_0x86c5('0x39')](_0xc5f30[_0x86c5('0x30')],_0xfdb018[_0x86c5('0x31')]),_0x4701f6);if(_0xc5f30['query'][_0x86c5('0x3a')]){_0xe9a55c[_0x86c5('0x38')]=_[_0x86c5('0x3b')](_0xe9a55c['where'],{'$or':_['map'](_0x4701f6,function(_0x4b2f64){if(_0x4b2f64[_0x86c5('0x2e')]!==_0x86c5('0x3c')){var _0x5a3738={};_0x5a3738[_0x4b2f64[_0x86c5('0x29')]]={'$like':'%'+_0xc5f30[_0x86c5('0x30')][_0x86c5('0x3a')]+'%'};return _0x5a3738;}})});}_0xe9a55c=_[_0x86c5('0x3b')]({},_0xe9a55c,_0xc5f30[_0x86c5('0x3d')]);var _0xa9ebb5={'where':_0xe9a55c['where']};return db[_0x86c5('0x3e')][_0x86c5('0x1e')](_0xa9ebb5)['then'](function(_0x4ead3e){_0x2a3717['count']=_0x4ead3e;if(_0xc5f30[_0x86c5('0x30')]['includeAll']){_0xe9a55c['include']=[{'all':!![]}];}return db[_0x86c5('0x3e')][_0x86c5('0x3f')](_0xe9a55c);})['then'](function(_0x40a6ad){_0x2a3717[_0x86c5('0x40')]=_0x40a6ad;return _0x2a3717;})[_0x86c5('0x24')](respondWithFilteredResult(_0x362196,_0xe9a55c))['catch'](handleError(_0x362196,null));};exports[_0x86c5('0x41')]=function(_0x52afec,_0x57bb62){var _0x527181={'raw':!![],'where':{'id':_0x52afec[_0x86c5('0x42')]['id']}},_0x59ce05={};_0x59ce05[_0x86c5('0x32')]=_['keys'](db[_0x86c5('0x3e')][_0x86c5('0x2d')]);_0x59ce05[_0x86c5('0x30')]=_[_0x86c5('0x43')](_0x52afec[_0x86c5('0x30')]);_0x59ce05[_0x86c5('0x31')]=_[_0x86c5('0x34')](_0x59ce05[_0x86c5('0x32')],_0x59ce05['query']);_0x527181[_0x86c5('0x33')]=_[_0x86c5('0x34')](_0x59ce05[_0x86c5('0x32')],qs[_0x86c5('0x44')](_0x52afec[_0x86c5('0x30')][_0x86c5('0x44')]));_0x527181[_0x86c5('0x33')]=_0x527181[_0x86c5('0x33')][_0x86c5('0x35')]?_0x527181[_0x86c5('0x33')]:_0x59ce05['model'];if(_0x52afec[_0x86c5('0x30')][_0x86c5('0x45')]){_0x527181['include']=[{'all':!![]}];}_0x527181=_[_0x86c5('0x3b')]({},_0x527181,_0x52afec['options']);return db[_0x86c5('0x3e')]['find'](_0x527181)[_0x86c5('0x24')](handleEntityNotFound(_0x57bb62,null))[_0x86c5('0x24')](respondWithResult(_0x57bb62,null))[_0x86c5('0x46')](handleError(_0x57bb62,null));};exports['update']=function(_0x17a61e,_0x11fff9){if(_0x17a61e[_0x86c5('0x47')]['id']){delete _0x17a61e[_0x86c5('0x47')]['id'];}return db[_0x86c5('0x3e')]['find']({'where':{'id':_0x17a61e[_0x86c5('0x42')]['id']}})[_0x86c5('0x24')](handleEntityNotFound(_0x11fff9,null))['then'](saveUpdates(_0x17a61e['body'],null))['then'](respondWithResult(_0x11fff9,null))[_0x86c5('0x46')](handleError(_0x11fff9,null));};exports['destroy']=function(_0x45bd7d,_0x276048){return db[_0x86c5('0x3e')][_0x86c5('0x48')]({'where':{'id':_0x45bd7d[_0x86c5('0x42')]['id']}})['then'](handleEntityNotFound(_0x276048,null))['then'](removeEntity(_0x276048,null))[_0x86c5('0x46')](handleError(_0x276048,null));};exports['describe']=function(_0x40f868,_0x28b8b9){return db[_0x86c5('0x3e')][_0x86c5('0x49')]()['then'](respondWithResult(_0x28b8b9,null))[_0x86c5('0x46')](handleError(_0x28b8b9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6aac61d..f6b0cf2 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 _0xe375=['path','rimraf','../../config/environment','define','CmHopperBlack','lodash','../../config/logger','api','moment','request-promise'];(function(_0x5281b5,_0x35d8e3){var _0x633a2e=function(_0x334ae4){while(--_0x334ae4){_0x5281b5['push'](_0x5281b5['shift']());}};_0x633a2e(++_0x35d8e3);}(_0xe375,0x11d));var _0x5e37=function(_0x52e4c6,_0x386a70){_0x52e4c6=_0x52e4c6-0x0;var _0x39c471=_0xe375[_0x52e4c6];return _0x39c471;};'use strict';var _=require(_0x5e37('0x0'));var util=require('util');var logger=require(_0x5e37('0x1'))(_0x5e37('0x2'));var moment=require(_0x5e37('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e37('0x4'));var fs=require('fs');var path=require(_0x5e37('0x5'));var rimraf=require(_0x5e37('0x6'));var config=require(_0x5e37('0x7'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x1bae49,_0xaec43){return _0x1bae49[_0x5e37('0x8')](_0x5e37('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fae=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','util','../../config/logger','moment','bluebird'];(function(_0x2087b9,_0x303348){var _0x28f0ae=function(_0x575592){while(--_0x575592){_0x2087b9['push'](_0x2087b9['shift']());}};_0x28f0ae(++_0x303348);}(_0x0fae,0x1a9));var _0xe0fa=function(_0x1c5b6e,_0x236153){_0x1c5b6e=_0x1c5b6e-0x0;var _0x2655f1=_0x0fae[_0x1c5b6e];return _0x2655f1;};'use strict';var _=require('lodash');var util=require(_0xe0fa('0x0'));var logger=require(_0xe0fa('0x1'))('api');var moment=require(_0xe0fa('0x2'));var BPromise=require(_0xe0fa('0x3'));var rp=require(_0xe0fa('0x4'));var fs=require('fs');var path=require(_0xe0fa('0x5'));var rimraf=require(_0xe0fa('0x6'));var config=require(_0xe0fa('0x7'));var attributes=require(_0xe0fa('0x8'));module[_0xe0fa('0x9')]=function(_0x126bae,_0x3c0962){return _0x126bae[_0xe0fa('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 15e3c0b..3f5996b 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 _0xe83a=['client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','map','include','model','debug','CmHopperBlack','body','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x575a1e,_0x199e02){var _0x335fe4=function(_0x170727){while(--_0x170727){_0x575a1e['push'](_0x575a1e['shift']());}};_0x335fe4(++_0x199e02);}(_0xe83a,0x18f));var _0xae83=function(_0x367816,_0x35633c){_0x367816=_0x367816-0x0;var _0x2cdde2=_0xe83a[_0x367816];return _0x2cdde2;};'use strict';var _=require(_0xae83('0x0'));var util=require('util');var moment=require(_0xae83('0x1'));var BPromise=require(_0xae83('0x2'));var rs=require(_0xae83('0x3'));var fs=require('fs');var Redis=require(_0xae83('0x4'));var db=require(_0xae83('0x5'))['db'];var utils=require(_0xae83('0x6'));var logger=require(_0xae83('0x7'))(_0xae83('0x8'));var config=require(_0xae83('0x9'));var jayson=require(_0xae83('0xa'));var client=jayson[_0xae83('0xb')][_0xae83('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdf3d51,_0x4a44ff,_0x23314d){return new BPromise(function(_0xd6899f,_0x53121f){return client[_0xae83('0xd')](_0xdf3d51,_0x23314d)[_0xae83('0xe')](function(_0x3edf5d){logger[_0xae83('0xf')](_0xae83('0x10'),_0x4a44ff,_0xae83('0x11'));logger['debug'](_0xae83('0x12'),_0x4a44ff,_0xae83('0x11'),JSON[_0xae83('0x13')](_0x3edf5d));if(_0x3edf5d['error']){if(_0x3edf5d[_0xae83('0x14')][_0xae83('0x15')]===0x1f4){logger[_0xae83('0x14')](_0xae83('0x10'),_0x4a44ff,_0x3edf5d['error'][_0xae83('0x16')]);return _0x53121f(_0x3edf5d[_0xae83('0x14')]['message']);}logger['error'](_0xae83('0x10'),_0x4a44ff,_0x3edf5d['error']['message']);return _0xd6899f(_0x3edf5d[_0xae83('0x14')][_0xae83('0x16')]);}else{logger[_0xae83('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x4a44ff,_0xae83('0x11'));_0xd6899f(_0x3edf5d[_0xae83('0x17')]['message']);}})[_0xae83('0x18')](function(_0x150183){logger[_0xae83('0x14')](_0xae83('0x10'),_0x4a44ff,_0x150183);_0x53121f(_0x150183);});});}exports[_0xae83('0x19')]=function(_0x550801){var _0x1d5e79=this;return new Promise(function(_0x5e91d6,_0x92264e){return db['CmHopperBlack'][_0xae83('0x1a')]({'raw':_0x550801[_0xae83('0x1b')]?_0x550801[_0xae83('0x1b')][_0xae83('0x1c')]===undefined?!![]:![]:!![],'where':_0x550801[_0xae83('0x1b')]?_0x550801['options'][_0xae83('0x1d')]||null:null,'attributes':_0x550801[_0xae83('0x1b')]?_0x550801[_0xae83('0x1b')][_0xae83('0x1e')]||null:null,'limit':_0x550801[_0xae83('0x1b')]?_0x550801[_0xae83('0x1b')]['limit']||null:null,'include':_0x550801['options']?_0x550801['options']['include']?_[_0xae83('0x1f')](_0x550801[_0xae83('0x1b')][_0xae83('0x20')],function(_0x22fab1){return{'model':db[_0x22fab1[_0xae83('0x21')]],'as':_0x22fab1['as'],'attributes':_0x22fab1[_0xae83('0x1e')],'include':_0x22fab1['include']?_['map'](_0x22fab1[_0xae83('0x20')],function(_0x3c4e12){return{'model':db[_0x3c4e12['model']],'as':_0x3c4e12['as'],'attributes':_0x3c4e12['attributes'],'include':_0x3c4e12[_0xae83('0x20')]?_['map'](_0x3c4e12[_0xae83('0x20')],function(_0x5c52ea){return{'model':db[_0x5c52ea[_0xae83('0x21')]],'as':_0x5c52ea['as'],'attributes':_0x5c52ea['attributes']};}):[]};}):[]};}):[]:[]})[_0xae83('0xe')](function(_0xe7a9ea){logger[_0xae83('0xf')](_0xae83('0x19'),_0x550801);logger[_0xae83('0x22')](_0xae83('0x19'),_0x550801,JSON[_0xae83('0x13')](_0xe7a9ea));_0x5e91d6(_0xe7a9ea);})[_0xae83('0x18')](function(_0x22bb37){logger[_0xae83('0x14')](_0xae83('0x19'),_0x22bb37['message'],_0x550801);_0x92264e(_0x1d5e79[_0xae83('0x14')](0x1f4,_0x22bb37['message']));});});};exports['UpdateCmHopperBlack']=function(_0x4254fd){var _0x436273=this;return new Promise(function(_0x54e0ea,_0x45d18b){return db[_0xae83('0x23')]['update'](_0x4254fd[_0xae83('0x24')],{'raw':_0x4254fd[_0xae83('0x1b')]?_0x4254fd['options'][_0xae83('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4254fd[_0xae83('0x1b')]?_0x4254fd['options']['where']||null:null,'attributes':_0x4254fd['options']?_0x4254fd[_0xae83('0x1b')]['attributes']||null:null,'limit':_0x4254fd[_0xae83('0x1b')]?_0x4254fd[_0xae83('0x1b')][_0xae83('0x25')]||null:null})['then'](function(_0x52dc6a){logger[_0xae83('0xf')]('UpdateCmHopperBlack',_0x4254fd);logger[_0xae83('0x22')](_0xae83('0x26'),_0x4254fd,JSON[_0xae83('0x13')](_0x52dc6a));_0x54e0ea(_0x52dc6a);})[_0xae83('0x18')](function(_0x26f136){logger[_0xae83('0x14')](_0xae83('0x26'),_0x26f136[_0xae83('0x16')],_0x4254fd);_0x45d18b(_0x436273[_0xae83('0x14')](0x1f4,_0x26f136[_0xae83('0x16')]));});});};exports[_0xae83('0x27')]=function(_0x37d264){var _0x23151a=this;return new Promise(function(_0x3456eb,_0x41ced1){return db[_0xae83('0x23')][_0xae83('0x28')]({'where':_0x37d264['options']?_0x37d264[_0xae83('0x1b')][_0xae83('0x1d')]||null:null})[_0xae83('0xe')](function(_0x582958){logger['info'](_0xae83('0x27'),_0x37d264);logger[_0xae83('0x22')](_0xae83('0x27'),_0x37d264,JSON[_0xae83('0x13')](_0x582958));_0x3456eb(_0x582958);})[_0xae83('0x18')](function(_0x291114){logger[_0xae83('0x14')](_0xae83('0x27'),_0x291114[_0xae83('0x16')],_0x37d264);_0x41ced1(_0x23151a[_0xae83('0x14')](0x1f4,_0x291114[_0xae83('0x16')]));});});}; \ No newline at end of file +var _0x9792=['UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','limit','map','include','model','attributes'];(function(_0x4bb3e0,_0x1e1dda){var _0x2ae0f6=function(_0x58710a){while(--_0x58710a){_0x4bb3e0['push'](_0x4bb3e0['shift']());}};_0x2ae0f6(++_0x1e1dda);}(_0x9792,0x1cc));var _0x2979=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9792[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2979('0x0'));var util=require('util');var moment=require(_0x2979('0x1'));var BPromise=require(_0x2979('0x2'));var rs=require(_0x2979('0x3'));var fs=require('fs');var Redis=require(_0x2979('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2979('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2979('0x6')][_0x2979('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34477f,_0x2abb59,_0x1755b8){return new BPromise(function(_0x10a164,_0x391bf9){return client[_0x2979('0x8')](_0x34477f,_0x1755b8)[_0x2979('0x9')](function(_0x3c9b63){logger[_0x2979('0xa')](_0x2979('0xb'),_0x2abb59,_0x2979('0xc'));logger[_0x2979('0xd')](_0x2979('0xe'),_0x2abb59,_0x2979('0xc'),JSON[_0x2979('0xf')](_0x3c9b63));if(_0x3c9b63[_0x2979('0x10')]){if(_0x3c9b63[_0x2979('0x10')][_0x2979('0x11')]===0x1f4){logger[_0x2979('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2abb59,_0x3c9b63['error'][_0x2979('0x12')]);return _0x391bf9(_0x3c9b63['error'][_0x2979('0x12')]);}logger['error'](_0x2979('0xb'),_0x2abb59,_0x3c9b63['error'][_0x2979('0x12')]);return _0x10a164(_0x3c9b63[_0x2979('0x10')]['message']);}else{logger[_0x2979('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x2abb59,_0x2979('0xc'));_0x10a164(_0x3c9b63[_0x2979('0x13')][_0x2979('0x12')]);}})[_0x2979('0x14')](function(_0x1aae9d){logger[_0x2979('0x10')](_0x2979('0xb'),_0x2abb59,_0x1aae9d);_0x391bf9(_0x1aae9d);});});}exports[_0x2979('0x15')]=function(_0x10e7e6){var _0x41d7cc=this;return new Promise(function(_0x54ff3f,_0x42a7f0){return db['CmHopperBlack'][_0x2979('0x16')]({'raw':_0x10e7e6[_0x2979('0x17')]?_0x10e7e6[_0x2979('0x17')][_0x2979('0x18')]===undefined?!![]:![]:!![],'where':_0x10e7e6[_0x2979('0x17')]?_0x10e7e6[_0x2979('0x17')]['where']||null:null,'attributes':_0x10e7e6[_0x2979('0x17')]?_0x10e7e6['options']['attributes']||null:null,'limit':_0x10e7e6[_0x2979('0x17')]?_0x10e7e6[_0x2979('0x17')][_0x2979('0x19')]||null:null,'include':_0x10e7e6[_0x2979('0x17')]?_0x10e7e6['options']['include']?_[_0x2979('0x1a')](_0x10e7e6[_0x2979('0x17')][_0x2979('0x1b')],function(_0x31b8d9){return{'model':db[_0x31b8d9[_0x2979('0x1c')]],'as':_0x31b8d9['as'],'attributes':_0x31b8d9[_0x2979('0x1d')],'include':_0x31b8d9['include']?_[_0x2979('0x1a')](_0x31b8d9[_0x2979('0x1b')],function(_0x398725){return{'model':db[_0x398725[_0x2979('0x1c')]],'as':_0x398725['as'],'attributes':_0x398725[_0x2979('0x1d')],'include':_0x398725[_0x2979('0x1b')]?_[_0x2979('0x1a')](_0x398725[_0x2979('0x1b')],function(_0x2627f1){return{'model':db[_0x2627f1[_0x2979('0x1c')]],'as':_0x2627f1['as'],'attributes':_0x2627f1[_0x2979('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da4dc){logger[_0x2979('0xa')]('GetCmHopperBlack',_0x10e7e6);logger[_0x2979('0xd')](_0x2979('0x15'),_0x10e7e6,JSON[_0x2979('0xf')](_0x3da4dc));_0x54ff3f(_0x3da4dc);})[_0x2979('0x14')](function(_0x378334){logger[_0x2979('0x10')]('GetCmHopperBlack',_0x378334[_0x2979('0x12')],_0x10e7e6);_0x42a7f0(_0x41d7cc['error'](0x1f4,_0x378334[_0x2979('0x12')]));});});};exports[_0x2979('0x1e')]=function(_0x1191e6){var _0x617ff8=this;return new Promise(function(_0x120cfc,_0x4977d4){return db['CmHopperBlack'][_0x2979('0x1f')](_0x1191e6[_0x2979('0x20')],{'raw':_0x1191e6[_0x2979('0x17')]?_0x1191e6[_0x2979('0x17')][_0x2979('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1191e6[_0x2979('0x17')]?_0x1191e6['options']['where']||null:null,'attributes':_0x1191e6[_0x2979('0x17')]?_0x1191e6[_0x2979('0x17')]['attributes']||null:null,'limit':_0x1191e6[_0x2979('0x17')]?_0x1191e6[_0x2979('0x17')][_0x2979('0x19')]||null:null})[_0x2979('0x9')](function(_0x465723){logger[_0x2979('0xa')](_0x2979('0x1e'),_0x1191e6);logger['debug'](_0x2979('0x1e'),_0x1191e6,JSON['stringify'](_0x465723));_0x120cfc(_0x465723);})['catch'](function(_0x375252){logger[_0x2979('0x10')](_0x2979('0x1e'),_0x375252[_0x2979('0x12')],_0x1191e6);_0x4977d4(_0x617ff8[_0x2979('0x10')](0x1f4,_0x375252[_0x2979('0x12')]));});});};exports[_0x2979('0x21')]=function(_0x537856){var _0x51357d=this;return new Promise(function(_0xd9a03f,_0x1e586b){return db['CmHopperBlack'][_0x2979('0x22')]({'where':_0x537856[_0x2979('0x17')]?_0x537856['options']['where']||null:null})[_0x2979('0x9')](function(_0x6fb26d){logger[_0x2979('0xa')](_0x2979('0x21'),_0x537856);logger[_0x2979('0xd')](_0x2979('0x21'),_0x537856,JSON[_0x2979('0xf')](_0x6fb26d));_0xd9a03f(_0x6fb26d);})[_0x2979('0x14')](function(_0xfaeb32){logger[_0x2979('0x10')](_0x2979('0x21'),_0xfaeb32['message'],_0x537856);_0x1e586b(_0x51357d[_0x2979('0x10')](0x1f4,_0xfaeb32['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d553a84..2814506 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 _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x329ef7,_0x28f839){var _0x3859f3=function(_0x353aca){while(--_0x353aca){_0x329ef7['push'](_0x329ef7['shift']());}};_0x3859f3(++_0x28f839);}(_0x2a07,0x74));var _0x72a0=function(_0x431480,_0x40c7a7){_0x431480=_0x431480-0x0;var _0x139af7=_0x2a07[_0x431480];return _0x139af7;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller['update']);router[_0x72a0('0x11')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);module[_0x72a0('0x13')]=router; \ No newline at end of file +var _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x5be638,_0x214fac){var _0x4cb864=function(_0x33a88a){while(--_0x33a88a){_0x5be638['push'](_0x5be638['shift']());}};_0x4cb864(++_0x214fac);}(_0x1db9,0x176));var _0x91db=function(_0x3f1ad6,_0x463a48){_0x3f1ad6=_0x3f1ad6-0x0;var _0x2a71e8=_0x1db9[_0x3f1ad6];return _0x2a71e8;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index f0cfebd..0665653 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 _0x8dd8=['endtime','setDataValue','followuptime','dispositionat','BOOLEAN','sequelize','INTEGER','STRING','DATE','getDataValue'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8dd8,0x131));var _0x88dd=function(_0xeb27d3,_0x4c6895){_0xeb27d3=_0xeb27d3-0x0;var _0x45f111=_0x8dd8[_0xeb27d3];return _0x45f111;};'use strict';var Sequelize=require(_0x88dd('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x88dd('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x88dd('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x88dd('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x88dd('0x2')]},'originatecalleridname':{'type':Sequelize[_0x88dd('0x2')]},'calleridnum':{'type':Sequelize[_0x88dd('0x2')]},'calleridname':{'type':Sequelize[_0x88dd('0x2')]},'starttime':{'type':Sequelize[_0x88dd('0x3')]},'responsetime':{'type':Sequelize[_0x88dd('0x3')]},'answertime':{'type':Sequelize[_0x88dd('0x3')]},'droptime':{'type':Sequelize[_0x88dd('0x3')]},'endtime':{'type':Sequelize[_0x88dd('0x3')]},'ringtime':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x88dd('0x2')]},'campaigntype':{'type':Sequelize[_0x88dd('0x2')]},'membername':{'type':Sequelize[_0x88dd('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x88dd('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x88dd('0x3')],'set':function(_0x50fc94){var _0x5aa18c=this[_0x88dd('0x4')](_0x88dd('0x5'));if(_0x5aa18c&&_0x50fc94){this[_0x88dd('0x6')](_0x88dd('0x7'),moment(_0x50fc94)['diff'](moment(_0x5aa18c),'seconds'));}return this[_0x88dd('0x6')](_0x88dd('0x8'),_0x50fc94);}},'amd':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x88dd('0x3')]},'callback':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x88dd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x88dd('0x3')]},'deleted':{'type':Sequelize[_0x88dd('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x88dd('0x3')]},'recallme':{'type':Sequelize[_0x88dd('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x88dd('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x88dd('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6797=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','diff','seconds'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6797,0xda));var _0x7679=function(_0x186419,_0x4e1a05){_0x186419=_0x186419-0x0;var _0x272f41=_0x6797[_0x186419];return _0x272f41;};'use strict';var Sequelize=require(_0x7679('0x0'));var moment=require(_0x7679('0x1'));module[_0x7679('0x2')]={'state':{'type':Sequelize[_0x7679('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x7679('0x4')]},'scheduledat':{'type':Sequelize[_0x7679('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7679('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x7679('0x4')]},'originatecalleridname':{'type':Sequelize[_0x7679('0x4')]},'calleridnum':{'type':Sequelize[_0x7679('0x4')]},'calleridname':{'type':Sequelize[_0x7679('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7679('0x5')]},'answertime':{'type':Sequelize[_0x7679('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7679('0x5')]},'ringtime':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7679('0x4')]},'campaign':{'type':Sequelize[_0x7679('0x4')]},'campaigntype':{'type':Sequelize[_0x7679('0x4')]},'membername':{'type':Sequelize[_0x7679('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7679('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7679('0x4')]},'dispositionat':{'type':Sequelize[_0x7679('0x5')],'set':function(_0x55df50){var _0x18a417=this['getDataValue'](_0x7679('0x6'));if(_0x18a417&&_0x55df50){this[_0x7679('0x7')]('followuptime',moment(_0x55df50)[_0x7679('0x8')](moment(_0x18a417),_0x7679('0x9')));}return this[_0x7679('0x7')](_0x7679('0xa'),_0x55df50);}},'amd':{'type':Sequelize[_0x7679('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7679('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x7679('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7679('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7679('0x5')]},'deleted':{'type':Sequelize[_0x7679('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x7679('0x5')]},'recallme':{'type':Sequelize[_0x7679('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7679('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7679('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 0b830f6..e09db99 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 _0x7a54=['calleridnum\x20NOT\x20IN\x20(?)','calleridnum','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','findOne','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','CmHopperFinal','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL'];(function(_0xdb62b2,_0x4bff8a){var _0x37fe34=function(_0x4deb32){while(--_0x4deb32){_0xdb62b2['push'](_0xdb62b2['shift']());}};_0x37fe34(++_0x4bff8a);}(_0x7a54,0x106));var _0x47a5=function(_0xc80e3f,_0x1c80b0){_0xc80e3f=_0xc80e3f-0x0;var _0x2ce687=_0x7a54[_0xc80e3f];return _0x2ce687;};'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['CmHopperFinal'][_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['CmHopperFinal']['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['describe']=function(_0x2d38de,_0x23bb04){return db['CmHopperFinal']['describe']()[_0x47a5('0x23')](respondWithResult(_0x23bb04,null))['catch'](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0xd93e37,_0x54c35f){if(_0xd93e37['body'][_0x47a5('0x47')]){delete _0xd93e37['body'][_0x47a5('0x47')];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'uniqueid':_0xd93e37[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x54c35f,null))[_0x47a5('0x23')](saveUpdates(_0xd93e37[_0x47a5('0x48')],null))['then'](respondWithResult(_0x54c35f,null))['catch'](handleError(_0x54c35f,null));};exports[_0x47a5('0x49')]=function(_0x411230,_0x1163e3,_0x9ea93e){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x411230[_0x47a5('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4c')))),'noSuchContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4d')))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x47a5('0x50')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x52')))),'dropContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x47a5('0x53')))),'abandonedContacts'],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2022,\x201,\x20null'))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x55')))),_0x47a5('0x56')]]})['then'](handleEntityNotFound(_0x1163e3,null))[_0x47a5('0x23')](respondWithResult(_0x1163e3,null))[_0x47a5('0x46')](handleError(_0x1163e3,null));};exports[_0x47a5('0x57')]=function(_0x5a33b8,_0x30ea7a,_0x4db625){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'CampaignId':_0x5a33b8[_0x47a5('0x41')]['id']},'attributes':[[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x58')))),'busyContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x59')))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x52')))),_0x47a5('0x5a')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize'][_0x47a5('0x4f')](_0x47a5('0x53')))),_0x47a5('0x5b')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x5c')))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x47a5('0x56')]]})[_0x47a5('0x23')](handleEntityNotFound(_0x30ea7a,null))[_0x47a5('0x23')](respondWithResult(_0x30ea7a,null))['catch'](handleError(_0x30ea7a,null));};exports[_0x47a5('0x5d')]=function(_0x2e46af,_0x36c67,_0x26f1ac){return db['VoiceQueue'][_0x47a5('0x45')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x43f649){var _0x4cf7c5;if(_0x43f649){_0x4cf7c5=squel[_0x47a5('0x5e')]()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery'](['phone','scheduledAt',_0x47a5('0x61'),_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),'updatedAt'],squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x67'),_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6a'))[_0x47a5('0x66')](_0x47a5('0x6b'),_0x47a5('0x61'))[_0x47a5('0x66')](_0x47a5('0x6c'),'ListId')[_0x47a5('0x66')]('ANY_VALUE(VoiceQueueId)',_0x47a5('0x63'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6d'))[_0x47a5('0x6e')](_0x47a5('0x6f'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x72'),_0x2e46af['body']['state']['toString']())['where'](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x68'))[_0x47a5('0x6e')](_0x47a5('0x60'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')](_0x47a5('0x74'),squel['select']()[_0x47a5('0x66')](_0x47a5('0x75'))[_0x47a5('0x6e')]('cm_hopper_final')[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')]('state\x20=\x204'))['group'](_0x47a5('0x61')))[_0x47a5('0x71')]();return db[_0x47a5('0x4b')][_0x47a5('0x2f')](_0x4cf7c5);}return[];})[_0x47a5('0x23')](respondWithResult(_0x36c67,null))[_0x47a5('0x46')](handleError(_0x36c67,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x592322,_0x3e0dbd,_0x4f2361){return db[_0x47a5('0x76')][_0x47a5('0x45')]({'where':{'id':_0x592322[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x3e0dbd,null))['then'](function(_0x3c66e3){var _0x550bde;if(_0x3c66e3){_0x550bde=squel['insert']()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery']([_0x47a5('0x68'),_0x47a5('0x6a'),_0x47a5('0x61'),'ListId',_0x47a5('0x77'),'createdAt',_0x47a5('0x6d')],squel[_0x47a5('0x65')]()[_0x47a5('0x66')]('ANY_VALUE(calleridnum)',_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),'scheduledAt')[_0x47a5('0x66')]('ANY_VALUE(ContactId)',_0x47a5('0x61'))['field'](_0x47a5('0x6c'),_0x47a5('0x62'))[_0x47a5('0x66')](_0x47a5('0x78'),'CampaignId')[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),'updatedAt')['from'](_0x47a5('0x6f'))['where'](_0x47a5('0x79'),_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())['where'](_0x47a5('0x72'),_0x592322[_0x47a5('0x48')]['state'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x47a5('0x66')](_0x47a5('0x68'))['from'](_0x47a5('0x60'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()['field'](_0x47a5('0x75'))['from'](_0x47a5('0x6f'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')](_0x47a5('0x7a')))[_0x47a5('0x7b')](_0x47a5('0x61')))['toString']();return db[_0x47a5('0x4b')]['query'](_0x550bde);}return[];})['then'](respondWithResult(_0x3e0dbd,null))[_0x47a5('0x46')](handleError(_0x3e0dbd,null));};exports[_0x47a5('0x7c')]=function(_0x352238,_0x96fb22,_0x380c8b){return db['CmHopper'][_0x47a5('0x7d')]({'where':{'VoiceQueueId':_0x352238[_0x47a5('0x48')][_0x47a5('0x63')],'CampaignId':_0x352238[_0x47a5('0x48')]['CampaignId'],'ContactId':_0x352238[_0x47a5('0x48')]['ContactId']}})[_0x47a5('0x23')](handleEntityNotFound(_0x96fb22,null))[_0x47a5('0x23')](function(_0x3f93f0){if(_0x3f93f0){return _0x3f93f0;}return null;})[_0x47a5('0x23')](respondWithResult(_0x96fb22,null))[_0x47a5('0x46')](handleError(_0x96fb22,null));}; \ No newline at end of file +var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x17925d,_0x46543f){var _0x5492b7=function(_0x413f0b){while(--_0x413f0b){_0x17925d['push'](_0x17925d['shift']());}};_0x5492b7(++_0x46543f);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4d0ac23..0d4e583 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 _0x8483=['rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','request-promise','path'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x8483,0x12e));var _0x3848=function(_0x11f152,_0x26a164){_0x11f152=_0x11f152-0x0;var _0x2a5cd2=_0x8483[_0x11f152];return _0x2a5cd2;};'use strict';var _=require('lodash');var util=require(_0x3848('0x0'));var logger=require(_0x3848('0x1'))(_0x3848('0x2'));var moment=require(_0x3848('0x3'));var BPromise=require('bluebird');var rp=require(_0x3848('0x4'));var fs=require('fs');var path=require(_0x3848('0x5'));var rimraf=require(_0x3848('0x6'));var config=require(_0x3848('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x3848('0x8')]=function(_0x1a2caa,_0x260a1a){return _0x1a2caa[_0x3848('0x9')](_0x3848('0xa'),attributes,{'tableName':_0x3848('0xb'),'paranoid':![],'indexes':[{'name':_0x3848('0xc'),'fields':[_0x3848('0xc')]},{'name':_0x3848('0xd'),'fields':[_0x3848('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa776=['rimraf','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x52ca8f,_0x227679){var _0x30ff3e=function(_0x24206d){while(--_0x24206d){_0x52ca8f['push'](_0x52ca8f['shift']());}};_0x30ff3e(++_0x227679);}(_0xa776,0xcb));var _0x6a77=function(_0x4b43aa,_0x2bfdc2){_0x4b43aa=_0x4b43aa-0x0;var _0x2aeed2=_0xa776[_0x4b43aa];return _0x2aeed2;};'use strict';var _=require(_0x6a77('0x0'));var util=require(_0x6a77('0x1'));var logger=require(_0x6a77('0x2'))(_0x6a77('0x3'));var moment=require(_0x6a77('0x4'));var BPromise=require(_0x6a77('0x5'));var rp=require(_0x6a77('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a77('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a77('0x8'));module[_0x6a77('0x9')]=function(_0xa1dad0,_0x39c692){return _0xa1dad0[_0x6a77('0xa')]('CmHopperFinal',attributes,{'tableName':_0x6a77('0xb'),'paranoid':![],'indexes':[{'name':_0x6a77('0xc'),'fields':[_0x6a77('0xc')]},{'name':_0x6a77('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index c21cca0..fdd0248 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x31f8d9,_0x5515e1){var _0x1a7482=function(_0x411d88){while(--_0x411d88){_0x31f8d9['push'](_0x31f8d9['shift']());}};_0x1a7482(++_0x5515e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ce715,_0x22e80c){_0x2ce715=_0x2ce715-0x0;var _0x41c7bb=_0xb10b[_0x2ce715];return _0x41c7bb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x43c115,_0x1d8aa1){var _0x55c19f=function(_0xbe0497){while(--_0xbe0497){_0x43c115['push'](_0x43c115['shift']());}};_0x55c19f(++_0x1d8aa1);}(_0xb10b,0x12a));var _0xbb10=function(_0x505088,_0x23a321){_0x505088=_0x505088-0x0;var _0x3eb2c9=_0xb10b[_0x505088];return _0x3eb2c9;};'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 8b69b50..2427a19 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 _0x1bb9=['index','get','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4e1ebc,_0x4d9c1d){var _0x164360=function(_0x37fcdb){while(--_0x37fcdb){_0x4e1ebc['push'](_0x4e1ebc['shift']());}};_0x164360(++_0x4d9c1d);}(_0x1bb9,0x17f));var _0x91bb=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x1bb9[_0x204eb7];return _0x37e444;};'use strict';var multer=require(_0x91bb('0x0'));var util=require(_0x91bb('0x1'));var path=require(_0x91bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x91bb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x91bb('0x4'));var interaction=require(_0x91bb('0x5'));var config=require(_0x91bb('0x6'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x91bb('0x7')]);router[_0x91bb('0x8')](_0x91bb('0x9'),auth[_0x91bb('0xa')](),controller[_0x91bb('0xb')]);router[_0x91bb('0x8')](_0x91bb('0xc'),auth['isAuthenticated'](),controller[_0x91bb('0xd')]);router[_0x91bb('0x8')](_0x91bb('0xe'),auth[_0x91bb('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x91bb('0x8')](_0x91bb('0xf'),auth[_0x91bb('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x91bb('0x10'),auth[_0x91bb('0xa')](),controller[_0x91bb('0x11')]);router[_0x91bb('0x12')](_0x91bb('0x13'),auth[_0x91bb('0xa')](),controller[_0x91bb('0x14')]);router[_0x91bb('0x12')](_0x91bb('0x15'),auth[_0x91bb('0xa')](),controller[_0x91bb('0x16')]);router[_0x91bb('0x17')](_0x91bb('0xc'),auth[_0x91bb('0xa')](),controller[_0x91bb('0x18')]);module[_0x91bb('0x19')]=router; \ No newline at end of file +var _0x9741=['../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x9741,0x1ee));var _0x1974=function(_0x3bbb74,_0x37720b){_0x3bbb74=_0x3bbb74-0x0;var _0x13bd8a=_0x9741[_0x3bbb74];return _0x13bd8a;};'use strict';var multer=require(_0x1974('0x0'));var util=require(_0x1974('0x1'));var path=require(_0x1974('0x2'));var timeout=require(_0x1974('0x3'));var express=require(_0x1974('0x4'));var router=express[_0x1974('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1974('0x6'));var interaction=require(_0x1974('0x7'));var config=require('../../config/environment');var controller=require(_0x1974('0x8'));router[_0x1974('0x9')]('/',auth[_0x1974('0xa')](),controller[_0x1974('0xb')]);router[_0x1974('0x9')](_0x1974('0xc'),auth[_0x1974('0xa')](),controller[_0x1974('0xd')]);router[_0x1974('0x9')]('/:id',auth[_0x1974('0xa')](),controller[_0x1974('0xe')]);router['get'](_0x1974('0xf'),auth[_0x1974('0xa')](),controller[_0x1974('0x10')]);router[_0x1974('0x9')](_0x1974('0x11'),auth[_0x1974('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1974('0x12')](_0x1974('0x13'),auth['isAuthenticated'](),controller[_0x1974('0x14')]);router['post'](_0x1974('0x15'),auth[_0x1974('0xa')](),controller[_0x1974('0x16')]);router[_0x1974('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x1974('0x17')]('/:id',auth[_0x1974('0xa')](),controller[_0x1974('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b9296b6..253d207 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 _0xd39a=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0xae1a00,_0x24dd7b){var _0x19e48b=function(_0x167987){while(--_0x167987){_0xae1a00['push'](_0xae1a00['shift']());}};_0x19e48b(++_0x24dd7b);}(_0xd39a,0x188));var _0xad39=function(_0x5393a6,_0x3c972d){_0x5393a6=_0x5393a6-0x0;var _0x477463=_0xd39a[_0x5393a6];return _0x477463;};'use strict';var Sequelize=require(_0xad39('0x0'));module[_0xad39('0x1')]={'state':{'type':Sequelize[_0xad39('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xad39('0x3')]},'scheduledat':{'type':Sequelize[_0xad39('0x4')]},'countbusyretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xad39('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xad39('0x3')]},'originatecalleridname':{'type':Sequelize[_0xad39('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xad39('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xad39('0x4')]},'answertime':{'type':Sequelize[_0xad39('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xad39('0x3')]},'campaign':{'type':Sequelize[_0xad39('0x3')]},'campaigntype':{'type':Sequelize[_0xad39('0x3')]},'membername':{'type':Sequelize[_0xad39('0x3')]},'reason':{'type':Sequelize[_0xad39('0x3')]},'amd':{'type':Sequelize[_0xad39('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xad39('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xad39('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xad39('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xad39('0x4')]},'recallme':{'type':Sequelize[_0xad39('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xad39('0x4')]},'edited':{'type':Sequelize[_0xad39('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xad39('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc34d=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x163e0b,_0x1ef704){var _0x2f89fe=function(_0x52b572){while(--_0x52b572){_0x163e0b['push'](_0x163e0b['shift']());}};_0x2f89fe(++_0x1ef704);}(_0xc34d,0x178));var _0xdc34=function(_0x5393e6,_0x2e7b91){_0x5393e6=_0x5393e6-0x0;var _0x579dd7=_0xc34d[_0x5393e6];return _0x579dd7;};'use strict';var Sequelize=require(_0xdc34('0x0'));module[_0xdc34('0x1')]={'state':{'type':Sequelize[_0xdc34('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdc34('0x3')]},'scheduledat':{'type':Sequelize[_0xdc34('0x4')]},'countbusyretry':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc34('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdc34('0x3')]},'calleridname':{'type':Sequelize[_0xdc34('0x3')]},'starttime':{'type':Sequelize[_0xdc34('0x4')]},'responsetime':{'type':Sequelize[_0xdc34('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xdc34('0x4')]},'ringtime':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdc34('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdc34('0x3')]},'membername':{'type':Sequelize[_0xdc34('0x3')]},'reason':{'type':Sequelize[_0xdc34('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xdc34('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc34('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdc34('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdc34('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 4955e2e..646f72e 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 _0x9057=['update','then','destroy','end','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','catch','create','body','describe','uniqueid','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x9057,0xc7));var _0x7905=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0x9057[_0x699200];return _0x266fd1;};'use strict';var emlformat=require(_0x7905('0x0'));var rimraf=require(_0x7905('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7905('0x2'));var rp=require(_0x7905('0x3'));var moment=require(_0x7905('0x4'));var BPromise=require(_0x7905('0x5'));var Mustache=require('mustache');var util=require(_0x7905('0x6'));var path=require(_0x7905('0x7'));var sox=require(_0x7905('0x8'));var csv=require(_0x7905('0x9'));var ejs=require(_0x7905('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7905('0xb'));var squel=require(_0x7905('0xc'));var crypto=require(_0x7905('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7905('0xe'));var toCsv=require(_0x7905('0x9'));var querystring=require(_0x7905('0xf'));var Papa=require(_0x7905('0x10'));var Redis=require(_0x7905('0x11'));var authService=require(_0x7905('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7905('0x13'));var hardwareService=require(_0x7905('0x14'));var logger=require(_0x7905('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7905('0x16'));var licenseUtil=require(_0x7905('0x17'));var db=require(_0x7905('0x18'))['db'];function respondWithStatusCode(_0x1031d8,_0x393d01){_0x393d01=_0x393d01||0xcc;return function(_0x5266d4){if(_0x5266d4){return _0x1031d8[_0x7905('0x19')](_0x393d01);}return _0x1031d8[_0x7905('0x1a')](_0x393d01)['end']();};}function respondWithResult(_0x43d220,_0x5bd221){_0x5bd221=_0x5bd221||0xc8;return function(_0x449ac8){if(_0x449ac8){return _0x43d220['status'](_0x5bd221)['json'](_0x449ac8);}};}function respondWithFilteredResult(_0x39a2d1,_0xdaffef){return function(_0x2f928d){if(_0x2f928d){var _0x122730=typeof _0xdaffef[_0x7905('0x1b')]==='undefined'&&typeof _0xdaffef[_0x7905('0x1c')]===_0x7905('0x1d');var _0x1d1964=_0x2f928d[_0x7905('0x1e')];var _0x818bc=_0x122730?0x0:_0xdaffef[_0x7905('0x1b')];var _0x337c0c=_0x122730?_0x2f928d['count']:_0xdaffef['offset']+_0xdaffef['limit'];var _0x4880a6;if(_0x337c0c>=_0x1d1964){_0x337c0c=_0x1d1964;_0x4880a6=0xc8;}else{_0x4880a6=0xce;}_0x39a2d1['status'](_0x4880a6);return _0x39a2d1[_0x7905('0x1f')]('Content-Range',_0x818bc+'-'+_0x337c0c+'/'+_0x1d1964)[_0x7905('0x20')](_0x2f928d);}return null;};}function patchUpdates(_0x480983){return function(_0xe9f295){try{jsonpatch[_0x7905('0x21')](_0xe9f295,_0x480983,!![]);}catch(_0x1140ed){return BPromise[_0x7905('0x22')](_0x1140ed);}return _0xe9f295['save']();};}function saveUpdates(_0x2445e3,_0x1f5702){return function(_0x141cc3){if(_0x141cc3){return _0x141cc3[_0x7905('0x23')](_0x2445e3)[_0x7905('0x24')](function(_0x376111){return _0x376111;});}return null;};}function removeEntity(_0xb175b,_0x22380a){return function(_0x87a4a0){if(_0x87a4a0){return _0x87a4a0[_0x7905('0x25')]()[_0x7905('0x24')](function(){_0xb175b[_0x7905('0x1a')](0xcc)[_0x7905('0x26')]();});}};}function handleEntityNotFound(_0x3cb005,_0x4ae685){return function(_0x1547dc){if(!_0x1547dc){_0x3cb005[_0x7905('0x19')](0x194);}return _0x1547dc;};}function handleError(_0x21232a,_0x1982e5){_0x1982e5=_0x1982e5||0x1f4;return function(_0x279ab1){logger['error'](_0x279ab1[_0x7905('0x27')]);if(_0x279ab1[_0x7905('0x28')]){delete _0x279ab1[_0x7905('0x28')];}_0x21232a[_0x7905('0x1a')](_0x1982e5)[_0x7905('0x29')](_0x279ab1);};}exports[_0x7905('0x2a')]=function(_0x26d1d8,_0x42ea78){var _0x4c7e84={},_0x583733={},_0x112b2c={'count':0x0,'rows':[]};var _0x5e5dbb=_[_0x7905('0x2b')](db[_0x7905('0x2c')][_0x7905('0x2d')],function(_0x5e874a){return{'name':_0x5e874a[_0x7905('0x2e')],'type':_0x5e874a[_0x7905('0x2f')][_0x7905('0x30')]};});_0x583733[_0x7905('0x31')]=_['map'](_0x5e5dbb,'name');_0x583733[_0x7905('0x32')]=_['keys'](_0x26d1d8[_0x7905('0x32')]);_0x583733['filters']=_[_0x7905('0x33')](_0x583733[_0x7905('0x31')],_0x583733['query']);_0x4c7e84['attributes']=_['intersection'](_0x583733['model'],qs[_0x7905('0x34')](_0x26d1d8[_0x7905('0x32')][_0x7905('0x34')]));_0x4c7e84['attributes']=_0x4c7e84[_0x7905('0x35')][_0x7905('0x36')]?_0x4c7e84['attributes']:_0x583733[_0x7905('0x31')];if(!_0x26d1d8[_0x7905('0x32')][_0x7905('0x37')](_0x7905('0x38'))){_0x4c7e84[_0x7905('0x1c')]=qs['limit'](_0x26d1d8[_0x7905('0x32')][_0x7905('0x1c')]);_0x4c7e84[_0x7905('0x1b')]=qs['offset'](_0x26d1d8['query'][_0x7905('0x1b')]);}_0x4c7e84[_0x7905('0x39')]=qs[_0x7905('0x3a')](_0x26d1d8[_0x7905('0x32')][_0x7905('0x3a')]);_0x4c7e84[_0x7905('0x3b')]=qs[_0x7905('0x3c')](_[_0x7905('0x3d')](_0x26d1d8['query'],_0x583733['filters']),_0x5e5dbb);if(_0x26d1d8[_0x7905('0x32')][_0x7905('0x3e')]){_0x4c7e84['where']=_['merge'](_0x4c7e84['where'],{'$or':_['map'](_0x5e5dbb,function(_0x5b8203){if(_0x5b8203[_0x7905('0x2f')]!=='VIRTUAL'){var _0x272517={};_0x272517[_0x5b8203[_0x7905('0x28')]]={'$like':'%'+_0x26d1d8['query']['filter']+'%'};return _0x272517;}})});}_0x4c7e84=_[_0x7905('0x3f')]({},_0x4c7e84,_0x26d1d8[_0x7905('0x40')]);var _0x16f098={'where':_0x4c7e84['where']};return db[_0x7905('0x2c')][_0x7905('0x1e')](_0x16f098)[_0x7905('0x24')](function(_0x241aa2){_0x112b2c[_0x7905('0x1e')]=_0x241aa2;if(_0x26d1d8[_0x7905('0x32')]['includeAll']){_0x4c7e84[_0x7905('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7905('0x42')](_0x4c7e84);})['then'](function(_0x5ec129){_0x112b2c[_0x7905('0x43')]=_0x5ec129;return _0x112b2c;})['then'](respondWithFilteredResult(_0x42ea78,_0x4c7e84))['catch'](handleError(_0x42ea78,null));};exports[_0x7905('0x44')]=function(_0x4dc00c,_0x492b9e){var _0x41c368={'raw':!![],'where':{'id':_0x4dc00c[_0x7905('0x45')]['id']}},_0x5c86fa={};_0x5c86fa[_0x7905('0x31')]=_[_0x7905('0x46')](db[_0x7905('0x2c')][_0x7905('0x2d')]);_0x5c86fa[_0x7905('0x32')]=_['keys'](_0x4dc00c[_0x7905('0x32')]);_0x5c86fa[_0x7905('0x3c')]=_[_0x7905('0x33')](_0x5c86fa['model'],_0x5c86fa['query']);_0x41c368[_0x7905('0x35')]=_[_0x7905('0x33')](_0x5c86fa[_0x7905('0x31')],qs[_0x7905('0x34')](_0x4dc00c['query']['fields']));_0x41c368[_0x7905('0x35')]=_0x41c368[_0x7905('0x35')][_0x7905('0x36')]?_0x41c368[_0x7905('0x35')]:_0x5c86fa[_0x7905('0x31')];if(_0x4dc00c[_0x7905('0x32')][_0x7905('0x47')]){_0x41c368[_0x7905('0x41')]=[{'all':!![]}];}_0x41c368=_['merge']({},_0x41c368,_0x4dc00c[_0x7905('0x40')]);return db[_0x7905('0x2c')]['find'](_0x41c368)[_0x7905('0x24')](handleEntityNotFound(_0x492b9e,null))[_0x7905('0x24')](respondWithResult(_0x492b9e,null))[_0x7905('0x48')](handleError(_0x492b9e,null));};exports[_0x7905('0x49')]=function(_0x56b41f,_0x5068e9){return db['CmHopperHistory'][_0x7905('0x49')](_0x56b41f[_0x7905('0x4a')],{})[_0x7905('0x24')](respondWithResult(_0x5068e9,0xc9))[_0x7905('0x48')](handleError(_0x5068e9,null));};exports[_0x7905('0x4b')]=function(_0x362dee,_0x51ccc5){return db[_0x7905('0x2c')][_0x7905('0x4b')]()[_0x7905('0x24')](respondWithResult(_0x51ccc5,null))['catch'](handleError(_0x51ccc5,null));};exports[_0x7905('0x23')]=function(_0x3a1c4b,_0x6e7656){if(_0x3a1c4b['body']['uniqueid']){delete _0x3a1c4b['body'][_0x7905('0x4c')];}return db['CmHopperHistory'][_0x7905('0x4d')]({'where':{'uniqueid':_0x3a1c4b['params']['id']}})[_0x7905('0x24')](handleEntityNotFound(_0x6e7656,null))[_0x7905('0x24')](saveUpdates(_0x3a1c4b['body'],null))[_0x7905('0x24')](respondWithResult(_0x6e7656,null))[_0x7905('0x48')](handleError(_0x6e7656,null));}; \ No newline at end of file +var _0x20a7=['CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','create','describe','body','uniqueid','find','eml-format','rimraf','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map'];(function(_0x2b727f,_0x38a5c3){var _0x593b24=function(_0x2c1606){while(--_0x2c1606){_0x2b727f['push'](_0x2b727f['shift']());}};_0x593b24(++_0x38a5c3);}(_0x20a7,0x14e));var _0x720a=function(_0x494b52,_0x347290){_0x494b52=_0x494b52-0x0;var _0x13150f=_0x20a7[_0x494b52];return _0x13150f;};'use strict';var emlformat=require(_0x720a('0x0'));var rimraf=require(_0x720a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x720a('0x2'));var BPromise=require(_0x720a('0x3'));var Mustache=require('mustache');var util=require(_0x720a('0x4'));var path=require(_0x720a('0x5'));var sox=require(_0x720a('0x6'));var csv=require('to-csv');var ejs=require(_0x720a('0x7'));var fs=require('fs');var fs_extra=require(_0x720a('0x8'));var _=require('lodash');var squel=require(_0x720a('0x9'));var crypto=require(_0x720a('0xa'));var jsforce=require(_0x720a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x720a('0xc'));var querystring=require(_0x720a('0xd'));var Papa=require(_0x720a('0xe'));var Redis=require(_0x720a('0xf'));var authService=require(_0x720a('0x10'));var qs=require(_0x720a('0x11'));var as=require(_0x720a('0x12'));var hardwareService=require(_0x720a('0x13'));var logger=require(_0x720a('0x14'))('api');var utils=require(_0x720a('0x15'));var config=require(_0x720a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x720a('0x17'))['db'];function respondWithStatusCode(_0x9c0df6,_0x138470){_0x138470=_0x138470||0xcc;return function(_0x1b295e){if(_0x1b295e){return _0x9c0df6['sendStatus'](_0x138470);}return _0x9c0df6[_0x720a('0x18')](_0x138470)[_0x720a('0x19')]();};}function respondWithResult(_0xaa6180,_0x15b033){_0x15b033=_0x15b033||0xc8;return function(_0xfb3458){if(_0xfb3458){return _0xaa6180[_0x720a('0x18')](_0x15b033)[_0x720a('0x1a')](_0xfb3458);}};}function respondWithFilteredResult(_0x10a8c2,_0x146671){return function(_0x312194){if(_0x312194){var _0x587a1d=typeof _0x146671[_0x720a('0x1b')]===_0x720a('0x1c')&&typeof _0x146671[_0x720a('0x1d')]==='undefined';var _0x2333fc=_0x312194[_0x720a('0x1e')];var _0x588078=_0x587a1d?0x0:_0x146671[_0x720a('0x1b')];var _0x5a9780=_0x587a1d?_0x312194[_0x720a('0x1e')]:_0x146671[_0x720a('0x1b')]+_0x146671[_0x720a('0x1d')];var _0xba1f56;if(_0x5a9780>=_0x2333fc){_0x5a9780=_0x2333fc;_0xba1f56=0xc8;}else{_0xba1f56=0xce;}_0x10a8c2[_0x720a('0x18')](_0xba1f56);return _0x10a8c2[_0x720a('0x1f')](_0x720a('0x20'),_0x588078+'-'+_0x5a9780+'/'+_0x2333fc)[_0x720a('0x1a')](_0x312194);}return null;};}function patchUpdates(_0x533901){return function(_0x541ca2){try{jsonpatch[_0x720a('0x21')](_0x541ca2,_0x533901,!![]);}catch(_0x407fff){return BPromise[_0x720a('0x22')](_0x407fff);}return _0x541ca2[_0x720a('0x23')]();};}function saveUpdates(_0x3d90f4,_0x1a3019){return function(_0x5b464d){if(_0x5b464d){return _0x5b464d[_0x720a('0x24')](_0x3d90f4)[_0x720a('0x25')](function(_0x32207e){return _0x32207e;});}return null;};}function removeEntity(_0x5127a3,_0x33bebd){return function(_0x4ec6e7){if(_0x4ec6e7){return _0x4ec6e7[_0x720a('0x26')]()[_0x720a('0x25')](function(){_0x5127a3[_0x720a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc189,_0x592a80){return function(_0x56d669){if(!_0x56d669){_0x3dc189[_0x720a('0x27')](0x194);}return _0x56d669;};}function handleError(_0x5a910d,_0x462850){_0x462850=_0x462850||0x1f4;return function(_0x43075a){logger[_0x720a('0x28')](_0x43075a[_0x720a('0x29')]);if(_0x43075a[_0x720a('0x2a')]){delete _0x43075a[_0x720a('0x2a')];}_0x5a910d[_0x720a('0x18')](_0x462850)[_0x720a('0x2b')](_0x43075a);};}exports[_0x720a('0x2c')]=function(_0x580461,_0xd85ef9){var _0x4bcd64={},_0x318272={},_0x345873={'count':0x0,'rows':[]};var _0x17f389=_[_0x720a('0x2d')](db[_0x720a('0x2e')][_0x720a('0x2f')],function(_0x2ac4db){return{'name':_0x2ac4db[_0x720a('0x30')],'type':_0x2ac4db[_0x720a('0x31')]['key']};});_0x318272[_0x720a('0x32')]=_[_0x720a('0x2d')](_0x17f389,'name');_0x318272[_0x720a('0x33')]=_[_0x720a('0x34')](_0x580461[_0x720a('0x33')]);_0x318272['filters']=_[_0x720a('0x35')](_0x318272['model'],_0x318272[_0x720a('0x33')]);_0x4bcd64[_0x720a('0x36')]=_['intersection'](_0x318272[_0x720a('0x32')],qs[_0x720a('0x37')](_0x580461[_0x720a('0x33')][_0x720a('0x37')]));_0x4bcd64['attributes']=_0x4bcd64[_0x720a('0x36')]['length']?_0x4bcd64[_0x720a('0x36')]:_0x318272[_0x720a('0x32')];if(!_0x580461[_0x720a('0x33')][_0x720a('0x38')](_0x720a('0x39'))){_0x4bcd64['limit']=qs[_0x720a('0x1d')](_0x580461['query'][_0x720a('0x1d')]);_0x4bcd64['offset']=qs[_0x720a('0x1b')](_0x580461['query'][_0x720a('0x1b')]);}_0x4bcd64['order']=qs[_0x720a('0x3a')](_0x580461[_0x720a('0x33')]['sort']);_0x4bcd64[_0x720a('0x3b')]=qs[_0x720a('0x3c')](_['pick'](_0x580461[_0x720a('0x33')],_0x318272[_0x720a('0x3c')]),_0x17f389);if(_0x580461[_0x720a('0x33')][_0x720a('0x3d')]){_0x4bcd64['where']=_[_0x720a('0x3e')](_0x4bcd64[_0x720a('0x3b')],{'$or':_[_0x720a('0x2d')](_0x17f389,function(_0x361020){if(_0x361020[_0x720a('0x31')]!=='VIRTUAL'){var _0xb29fae={};_0xb29fae[_0x361020[_0x720a('0x2a')]]={'$like':'%'+_0x580461['query'][_0x720a('0x3d')]+'%'};return _0xb29fae;}})});}_0x4bcd64=_[_0x720a('0x3e')]({},_0x4bcd64,_0x580461[_0x720a('0x3f')]);var _0x433833={'where':_0x4bcd64[_0x720a('0x3b')]};return db[_0x720a('0x2e')][_0x720a('0x1e')](_0x433833)[_0x720a('0x25')](function(_0x4fee39){_0x345873[_0x720a('0x1e')]=_0x4fee39;if(_0x580461['query'][_0x720a('0x40')]){_0x4bcd64[_0x720a('0x41')]=[{'all':!![]}];}return db[_0x720a('0x2e')][_0x720a('0x42')](_0x4bcd64);})['then'](function(_0x56ce49){_0x345873[_0x720a('0x43')]=_0x56ce49;return _0x345873;})['then'](respondWithFilteredResult(_0xd85ef9,_0x4bcd64))[_0x720a('0x44')](handleError(_0xd85ef9,null));};exports[_0x720a('0x45')]=function(_0x3f4716,_0x770af8){var _0x5276ca={'raw':!![],'where':{'id':_0x3f4716['params']['id']}},_0x580bc3={};_0x580bc3[_0x720a('0x32')]=_[_0x720a('0x34')](db[_0x720a('0x2e')][_0x720a('0x2f')]);_0x580bc3[_0x720a('0x33')]=_['keys'](_0x3f4716[_0x720a('0x33')]);_0x580bc3[_0x720a('0x3c')]=_[_0x720a('0x35')](_0x580bc3['model'],_0x580bc3[_0x720a('0x33')]);_0x5276ca[_0x720a('0x36')]=_['intersection'](_0x580bc3[_0x720a('0x32')],qs[_0x720a('0x37')](_0x3f4716[_0x720a('0x33')][_0x720a('0x37')]));_0x5276ca[_0x720a('0x36')]=_0x5276ca[_0x720a('0x36')][_0x720a('0x46')]?_0x5276ca[_0x720a('0x36')]:_0x580bc3['model'];if(_0x3f4716['query'][_0x720a('0x40')]){_0x5276ca['include']=[{'all':!![]}];}_0x5276ca=_[_0x720a('0x3e')]({},_0x5276ca,_0x3f4716[_0x720a('0x3f')]);return db[_0x720a('0x2e')]['find'](_0x5276ca)['then'](handleEntityNotFound(_0x770af8,null))[_0x720a('0x25')](respondWithResult(_0x770af8,null))[_0x720a('0x44')](handleError(_0x770af8,null));};exports[_0x720a('0x47')]=function(_0x36caaf,_0x5d4c56){return db[_0x720a('0x2e')][_0x720a('0x47')](_0x36caaf['body'],{})[_0x720a('0x25')](respondWithResult(_0x5d4c56,0xc9))[_0x720a('0x44')](handleError(_0x5d4c56,null));};exports[_0x720a('0x48')]=function(_0x69b4ec,_0xadb663){return db['CmHopperHistory'][_0x720a('0x48')]()[_0x720a('0x25')](respondWithResult(_0xadb663,null))['catch'](handleError(_0xadb663,null));};exports[_0x720a('0x24')]=function(_0x185ef1,_0x1d7152){if(_0x185ef1['body']['uniqueid']){delete _0x185ef1[_0x720a('0x49')][_0x720a('0x4a')];}return db[_0x720a('0x2e')][_0x720a('0x4b')]({'where':{'uniqueid':_0x185ef1['params']['id']}})['then'](handleEntityNotFound(_0x1d7152,null))['then'](saveUpdates(_0x185ef1[_0x720a('0x49')],null))[_0x720a('0x25')](respondWithResult(_0x1d7152,null))[_0x720a('0x44')](handleError(_0x1d7152,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 179e078..5462f26 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 _0xba6f=['cm_hopper_history','endtime','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x479111,_0x156642){var _0x39388f=function(_0x41526f){while(--_0x41526f){_0x479111['push'](_0x479111['shift']());}};_0x39388f(++_0x156642);}(_0xba6f,0x1d0));var _0xfba6=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0xba6f[_0x235563];return _0x219be0;};'use strict';var _=require(_0xfba6('0x0'));var util=require('util');var logger=require(_0xfba6('0x1'))(_0xfba6('0x2'));var moment=require(_0xfba6('0x3'));var BPromise=require(_0xfba6('0x4'));var rp=require(_0xfba6('0x5'));var fs=require('fs');var path=require(_0xfba6('0x6'));var rimraf=require(_0xfba6('0x7'));var config=require(_0xfba6('0x8'));var attributes=require(_0xfba6('0x9'));module[_0xfba6('0xa')]=function(_0x269363,_0x10310e){return _0x269363[_0xfba6('0xb')]('CmHopperHistory',attributes,{'tableName':_0xfba6('0xc'),'paranoid':![],'indexes':[{'name':_0xfba6('0xd'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xeae8=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeae8,0x66));var _0x8eae=function(_0x493a50,_0x2d8f49){_0x493a50=_0x493a50-0x0;var _0x1f0aa3=_0xeae8[_0x493a50];return _0x1f0aa3;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var logger=require(_0x8eae('0x2'))('api');var moment=require(_0x8eae('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eae('0x5'));var config=require(_0x8eae('0x6'));var attributes=require(_0x8eae('0x7'));module[_0x8eae('0x8')]=function(_0xcc5f34,_0x123053){return _0xcc5f34[_0x8eae('0x9')](_0x8eae('0xa'),attributes,{'tableName':_0x8eae('0xb'),'paranoid':![],'indexes':[{'name':_0x8eae('0xc'),'fields':[_0x8eae('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 4eb5bf6..3b752ff 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 _0xd01f=['AvgHandleTime','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','`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','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','catch'];(function(_0x215cf0,_0x1b417c){var _0x25eeb0=function(_0x415de8){while(--_0x415de8){_0x215cf0['push'](_0x215cf0['shift']());}};_0x25eeb0(++_0x1b417c);}(_0xd01f,0x1d6));var _0xfd01=function(_0x36b8da,_0x4162ce){_0x36b8da=_0x36b8da-0x0;var _0x4c95d5=_0xd01f[_0x36b8da];return _0x4c95d5;};'use strict';var _=require(_0xfd01('0x0'));var util=require('util');var moment=require(_0xfd01('0x1'));var BPromise=require('bluebird');var rs=require(_0xfd01('0x2'));var fs=require('fs');var Redis=require(_0xfd01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd01('0x4'));var logger=require('../../config/logger')(_0xfd01('0x5'));var config=require(_0xfd01('0x6'));var jayson=require(_0xfd01('0x7'));var client=jayson['client'][_0xfd01('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b1a99,_0x585168,_0x580990){return new BPromise(function(_0x36a127,_0x4593f0){return client[_0xfd01('0x9')](_0x2b1a99,_0x580990)[_0xfd01('0xa')](function(_0x2e2e38){logger[_0xfd01('0xb')](_0xfd01('0xc'),_0x585168,_0xfd01('0xd'));logger[_0xfd01('0xe')](_0xfd01('0xf'),_0x585168,_0xfd01('0xd'),JSON[_0xfd01('0x10')](_0x2e2e38));if(_0x2e2e38['error']){if(_0x2e2e38[_0xfd01('0x11')][_0xfd01('0x12')]===0x1f4){logger[_0xfd01('0x11')](_0xfd01('0xc'),_0x585168,_0x2e2e38[_0xfd01('0x11')][_0xfd01('0x13')]);return _0x4593f0(_0x2e2e38[_0xfd01('0x11')][_0xfd01('0x13')]);}logger[_0xfd01('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x585168,_0x2e2e38['error'][_0xfd01('0x13')]);return _0x36a127(_0x2e2e38[_0xfd01('0x11')][_0xfd01('0x13')]);}else{logger[_0xfd01('0xb')](_0xfd01('0xc'),_0x585168,_0xfd01('0xd'));_0x36a127(_0x2e2e38[_0xfd01('0x14')][_0xfd01('0x13')]);}})['catch'](function(_0x4d832a){logger['error'](_0xfd01('0xc'),_0x585168,_0x4d832a);_0x4593f0(_0x4d832a);});});}exports[_0xfd01('0x15')]=function(_0x41e195){var _0x1f10c6=this;return new Promise(function(_0x29e375,_0x2108a0){return db[_0xfd01('0x16')][_0xfd01('0x17')](_0x41e195['body'],{'raw':_0x41e195['options']?_0x41e195[_0xfd01('0x18')][_0xfd01('0x19')]===undefined?!![]:![]:!![]})[_0xfd01('0xa')](function(_0x136338){logger['info']('CreateCmHopperHistory',_0x41e195);logger[_0xfd01('0xe')](_0xfd01('0x15'),_0x41e195,JSON[_0xfd01('0x10')](_0x136338));_0x29e375(_0x136338);})[_0xfd01('0x1a')](function(_0x2dd343){logger['error'](_0xfd01('0x15'),_0x2dd343[_0xfd01('0x13')],_0x41e195);_0x2108a0(_0x1f10c6[_0xfd01('0x11')](0x1f4,_0x2dd343['message']));});});};exports[_0xfd01('0x1b')]=function(_0x5dcc54){var _0x3b2c22=this;return new Promise(function(_0x2f6dcd,_0x470244){return db[_0xfd01('0x16')]['findAll']({'raw':_0x5dcc54['options']?_0x5dcc54[_0xfd01('0x18')][_0xfd01('0x19')]===undefined?!![]:![]:!![],'where':_0x5dcc54[_0xfd01('0x18')]?_0x5dcc54[_0xfd01('0x18')][_0xfd01('0x1c')]||null:null,'attributes':[[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')][_0xfd01('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db['sequelize']['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x21')))),_0xfd01('0x22')],[db[_0xfd01('0x1d')]['fn']('COUNT',db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xfd01('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0xfd01('0x24')],[db['sequelize']['fn']('AVG',db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x25')))),_0xfd01('0x26')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x27'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x28')))),_0xfd01('0x29')]]})[_0xfd01('0xa')](function(_0x3685cd){logger[_0xfd01('0xb')](_0xfd01('0x1b'),_0x5dcc54);logger[_0xfd01('0xe')]('AvgHandleTime',_0x5dcc54,JSON[_0xfd01('0x10')](_0x3685cd));_0x2f6dcd(_0x3685cd);})[_0xfd01('0x1a')](function(_0x1b9b3b){logger[_0xfd01('0x11')](_0xfd01('0x1b'),_0x1b9b3b[_0xfd01('0x13')],_0x5dcc54);_0x470244(_0x3b2c22[_0xfd01('0x11')](0x1f4,_0x1b9b3b['message']));});});};exports[_0xfd01('0x2a')]=function(_0x469c09){var _0x298116=this;return new Promise(function(_0x3e0803,_0x33339b){return db[_0xfd01('0x16')][_0xfd01('0x2b')]({'raw':_0x469c09[_0xfd01('0x18')]?_0x469c09[_0xfd01('0x18')][_0xfd01('0x19')]===undefined?!![]:![]:!![],'where':_0x469c09[_0xfd01('0x18')]?_0x469c09[_0xfd01('0x18')][_0xfd01('0x1c')]||null:null,'attributes':[[_0xfd01('0x2c'),'name'],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x2d')))),_0xfd01('0x2e')],[db['sequelize']['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x2f')))),_0xfd01('0x30')],[db['sequelize']['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x21')))),'outboundAnswerCallsDay'],[db[_0xfd01('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfd01('0x1d')]['literal'](_0xfd01('0x31')))),_0xfd01('0x32')],[db[_0xfd01('0x1d')]['fn']('COUNT',db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x33')))),_0xfd01('0x34')],[db['sequelize']['fn'](_0xfd01('0x1e'),db['sequelize']['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x35')))),_0xfd01('0x36')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db['sequelize']['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db['sequelize'][_0xfd01('0x20')](_0xfd01('0x38')))),_0xfd01('0x39')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')]['literal'](_0xfd01('0x3a')))),_0xfd01('0x3b')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xfd01('0x20')](_0xfd01('0x3c')))),_0xfd01('0x3d')],[db[_0xfd01('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0xfd01('0x3e')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x3f')))),_0xfd01('0x40')],[db['sequelize']['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x41')))),_0xfd01('0x3e')],[db['sequelize']['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x42')))),_0xfd01('0x43')]],'group':[_0xfd01('0x2c')]})['then'](function(_0x5ccf6e){logger[_0xfd01('0xb')](_0xfd01('0x2a'),_0x469c09);logger[_0xfd01('0xe')](_0xfd01('0x2a'),_0x469c09,JSON[_0xfd01('0x10')](_0x5ccf6e));_0x3e0803(_0x5ccf6e);})[_0xfd01('0x1a')](function(_0x857530){logger[_0xfd01('0x11')](_0xfd01('0x2a'),_0x857530[_0xfd01('0x13')],_0x469c09);_0x33339b(_0x298116['error'](0x1f4,_0x857530['message']));});});};exports[_0xfd01('0x44')]=function(_0xa88b45){var _0x505426=this;return new Promise(function(_0x4ece45,_0x17abff){return db['CmHopperHistory'][_0xfd01('0x2b')]({'raw':_0xa88b45[_0xfd01('0x18')]?_0xa88b45[_0xfd01('0x18')][_0xfd01('0x19')]===undefined?!![]:![]:!![],'where':_0xa88b45[_0xfd01('0x18')]?_0xa88b45[_0xfd01('0x18')]['where']||null:null,'attributes':[['campaign',_0xfd01('0x45')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['col']('id')),_0xfd01('0x46')],[db[_0xfd01('0x1d')]['fn'](_0xfd01('0x1e'),db[_0xfd01('0x1d')]['fn']('IF',db[_0xfd01('0x1d')][_0xfd01('0x20')](_0xfd01('0x21')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xfd01('0xa')](function(_0x2d60e3){logger[_0xfd01('0xb')]('GetCampaignHopperHistory',_0xa88b45);logger[_0xfd01('0xe')]('GetCampaignHopperHistory',_0xa88b45,JSON[_0xfd01('0x10')](_0x2d60e3));_0x4ece45(_0x2d60e3);})[_0xfd01('0x1a')](function(_0x53fb98){logger['error']('GetCampaignHopperHistory',_0x53fb98[_0xfd01('0x13')],_0xa88b45);_0x17abff(_0x505426['error'](0x1f4,_0x53fb98['message']));});});}; \ No newline at end of file +var _0xb315=['raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','campaign','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','options'];(function(_0x19f06f,_0x165d25){var _0x5704ba=function(_0x2451eb){while(--_0x2451eb){_0x19f06f['push'](_0x19f06f['shift']());}};_0x5704ba(++_0x165d25);}(_0xb315,0x6f));var _0x5b31=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xb315[_0x350258];return _0x3714b3;};'use strict';var _=require(_0x5b31('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b31('0x1'));var rs=require(_0x5b31('0x2'));var fs=require('fs');var Redis=require(_0x5b31('0x3'));var db=require(_0x5b31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b31('0x5'))(_0x5b31('0x6'));var config=require(_0x5b31('0x7'));var jayson=require(_0x5b31('0x8'));var client=jayson['client'][_0x5b31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f8de,_0x23ad2e,_0x533b8a){return new BPromise(function(_0xc60941,_0x53c6ca){return client[_0x5b31('0xa')](_0x35f8de,_0x533b8a)[_0x5b31('0xb')](function(_0x162557){logger[_0x5b31('0xc')](_0x5b31('0xd'),_0x23ad2e,_0x5b31('0xe'));logger[_0x5b31('0xf')](_0x5b31('0x10'),_0x23ad2e,'request\x20sent',JSON['stringify'](_0x162557));if(_0x162557['error']){if(_0x162557[_0x5b31('0x11')]['code']===0x1f4){logger[_0x5b31('0x11')](_0x5b31('0xd'),_0x23ad2e,_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);return _0x53c6ca(_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);}logger[_0x5b31('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x23ad2e,_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);return _0xc60941(_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);}else{logger[_0x5b31('0xc')](_0x5b31('0xd'),_0x23ad2e,_0x5b31('0xe'));_0xc60941(_0x162557[_0x5b31('0x13')][_0x5b31('0x12')]);}})[_0x5b31('0x14')](function(_0x2e07cc){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x23ad2e,_0x2e07cc);_0x53c6ca(_0x2e07cc);});});}exports[_0x5b31('0x15')]=function(_0x10fc3f){var _0xb1d337=this;return new Promise(function(_0xeab57b,_0x3e875b){return db['CmHopperHistory']['create'](_0x10fc3f['body'],{'raw':_0x10fc3f[_0x5b31('0x16')]?_0x10fc3f[_0x5b31('0x16')][_0x5b31('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5abf97){logger[_0x5b31('0xc')](_0x5b31('0x15'),_0x10fc3f);logger[_0x5b31('0xf')](_0x5b31('0x15'),_0x10fc3f,JSON['stringify'](_0x5abf97));_0xeab57b(_0x5abf97);})['catch'](function(_0x454cdb){logger[_0x5b31('0x11')]('CreateCmHopperHistory',_0x454cdb[_0x5b31('0x12')],_0x10fc3f);_0x3e875b(_0xb1d337[_0x5b31('0x11')](0x1f4,_0x454cdb[_0x5b31('0x12')]));});});};exports[_0x5b31('0x18')]=function(_0x5a866d){var _0x2893d9=this;return new Promise(function(_0xc8b353,_0x36e27d){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x5a866d[_0x5b31('0x16')]?_0x5a866d[_0x5b31('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5a866d[_0x5b31('0x16')]?_0x5a866d[_0x5b31('0x16')][_0x5b31('0x1b')]||null:null,'attributes':[[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['col']('id')),_0x5b31('0x1e')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x21')))),_0x5b31('0x22')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x23')))),_0x5b31('0x24')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x25'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x26')))),_0x5b31('0x27')],[db[_0x5b31('0x1c')]['fn']('AVG',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x5b31('0x28')]]})[_0x5b31('0xb')](function(_0x192305){logger['info'](_0x5b31('0x18'),_0x5a866d);logger[_0x5b31('0xf')](_0x5b31('0x18'),_0x5a866d,JSON[_0x5b31('0x29')](_0x192305));_0xc8b353(_0x192305);})[_0x5b31('0x14')](function(_0x424047){logger[_0x5b31('0x11')]('AvgHandleTime',_0x424047['message'],_0x5a866d);_0x36e27d(_0x2893d9[_0x5b31('0x11')](0x1f4,_0x424047[_0x5b31('0x12')]));});});};exports[_0x5b31('0x2a')]=function(_0x372ef7){var _0x4b3bdf=this;return new Promise(function(_0x403960,_0x144ac8){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x372ef7[_0x5b31('0x16')]?_0x372ef7[_0x5b31('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x372ef7['options']?_0x372ef7[_0x5b31('0x16')][_0x5b31('0x1b')]||null:null,'attributes':[['campaign',_0x5b31('0x2b')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),_0x5b31('0x2c')],[db['sequelize']['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x2d')))),'outboundNoAnswerCallsDay'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x20')))),'outboundAnswerCallsDay'],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x2e')))),_0x5b31('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x30')))),_0x5b31('0x31')],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5b31('0x32')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x33')))),_0x5b31('0x34')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x35')))),_0x5b31('0x36')],[db[_0x5b31('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')]('`state`\x20=\x2013,\x201,\x20null'))),_0x5b31('0x37')],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x38')))),_0x5b31('0x39')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0x5b31('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x3b')))),_0x5b31('0x3c')],[db['sequelize']['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x3d')))),_0x5b31('0x3a')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x3e')))),_0x5b31('0x3f')]],'group':['campaign']})[_0x5b31('0xb')](function(_0x583451){logger[_0x5b31('0xc')](_0x5b31('0x2a'),_0x372ef7);logger[_0x5b31('0xf')]('GetVoiceQueueHopperHistory',_0x372ef7,JSON[_0x5b31('0x29')](_0x583451));_0x403960(_0x583451);})[_0x5b31('0x14')](function(_0x5b2230){logger[_0x5b31('0x11')]('GetVoiceQueueHopperHistory',_0x5b2230[_0x5b31('0x12')],_0x372ef7);_0x144ac8(_0x4b3bdf[_0x5b31('0x11')](0x1f4,_0x5b2230['message']));});});};exports[_0x5b31('0x40')]=function(_0x1e3803){var _0xc135af=this;return new Promise(function(_0x607771,_0x51138e){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x1e3803['options']?_0x1e3803[_0x5b31('0x16')][_0x5b31('0x17')]===undefined?!![]:![]:!![],'where':_0x1e3803[_0x5b31('0x16')]?_0x1e3803['options'][_0x5b31('0x1b')]||null:null,'attributes':[[_0x5b31('0x41'),_0x5b31('0x2b')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x20')))),_0x5b31('0x42')]],'group':[_0x5b31('0x41')]})[_0x5b31('0xb')](function(_0x4e4ce8){logger[_0x5b31('0xc')](_0x5b31('0x40'),_0x1e3803);logger[_0x5b31('0xf')]('GetCampaignHopperHistory',_0x1e3803,JSON['stringify'](_0x4e4ce8));_0x607771(_0x4e4ce8);})[_0x5b31('0x14')](function(_0x337566){logger['error'](_0x5b31('0x40'),_0x337566[_0x5b31('0x12')],_0x1e3803);_0x51138e(_0xc135af[_0x5b31('0x11')](0x1f4,_0x337566[_0x5b31('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index aadae03..1fcb00a 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 _0x3ca7=['update','util','path','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2fa1c2,_0x3aee5b){var _0x1c30bf=function(_0x4e7193){while(--_0x4e7193){_0x2fa1c2['push'](_0x2fa1c2['shift']());}};_0x1c30bf(++_0x3aee5b);}(_0x3ca7,0xd3));var _0x73ca=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x3ca7[_0x4d35f3];return _0x382fea;};'use strict';var multer=require('multer');var util=require(_0x73ca('0x0'));var path=require(_0x73ca('0x1'));var timeout=require('connect-timeout');var express=require(_0x73ca('0x2'));var router=express[_0x73ca('0x3')]();var fs_extra=require(_0x73ca('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x73ca('0x5'));var controller=require(_0x73ca('0x6'));router[_0x73ca('0x7')]('/',auth[_0x73ca('0x8')](),controller['index']);router[_0x73ca('0x7')](_0x73ca('0x9'),auth[_0x73ca('0x8')](),controller['describe']);router[_0x73ca('0x7')](_0x73ca('0xa'),auth[_0x73ca('0x8')](),controller['show']);router[_0x73ca('0xb')]('/',auth[_0x73ca('0x8')](),controller[_0x73ca('0xc')]);router['put'](_0x73ca('0xa'),auth[_0x73ca('0x8')](),controller[_0x73ca('0xd')]);module['exports']=router; \ No newline at end of file +var _0x027e=['connect-timeout','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','/:id','post','create','put','multer','util','path'];(function(_0x3bfd29,_0x407cd5){var _0x2e1a78=function(_0x420461){while(--_0x420461){_0x3bfd29['push'](_0x3bfd29['shift']());}};_0x2e1a78(++_0x407cd5);}(_0x027e,0xb3));var _0xe027=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x027e[_0x31bab3];return _0x4fd382;};'use strict';var multer=require(_0xe027('0x0'));var util=require(_0xe027('0x1'));var path=require(_0xe027('0x2'));var timeout=require(_0xe027('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe027('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe027('0x5'));var controller=require(_0xe027('0x6'));router[_0xe027('0x7')]('/',auth[_0xe027('0x8')](),controller['index']);router[_0xe027('0x7')](_0xe027('0x9'),auth[_0xe027('0x8')](),controller['describe']);router[_0xe027('0x7')](_0xe027('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe027('0xb')]('/',auth['isAuthenticated'](),controller[_0xe027('0xc')]);router[_0xe027('0xd')](_0xe027('0xa'),auth[_0xe027('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index e9e6373..39ce322 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 _0x1de4=['sequelize','exports','STRING','name'];(function(_0x215d2e,_0x5d89eb){var _0x36d849=function(_0x5c909b){while(--_0x5c909b){_0x215d2e['push'](_0x215d2e['shift']());}};_0x36d849(++_0x5d89eb);}(_0x1de4,0x94));var _0x41de=function(_0x5b6942,_0x256b8b){_0x5b6942=_0x5b6942-0x0;var _0x4cb51f=_0x1de4[_0x5b6942];return _0x4cb51f;};'use strict';var Sequelize=require(_0x41de('0x0'));module[_0x41de('0x1')]={'name':{'type':Sequelize[_0x41de('0x2')],'unique':_0x41de('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x41de('0x2')]}}; \ No newline at end of file +var _0x72a2=['STRING','name','exports'];(function(_0x35d40a,_0x3ccfe4){var _0x313cbe=function(_0x3a30dc){while(--_0x3a30dc){_0x35d40a['push'](_0x35d40a['shift']());}};_0x313cbe(++_0x3ccfe4);}(_0x72a2,0x161));var _0x272a=function(_0x3edd94,_0x22d8c3){_0x3edd94=_0x3edd94-0x0;var _0x3acf2b=_0x72a2[_0x3edd94];return _0x3acf2b;};'use strict';var Sequelize=require('sequelize');module[_0x272a('0x0')]={'name':{'type':Sequelize[_0x272a('0x1')],'unique':_0x272a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x272a('0x1')]},'dialPrefix':{'type':Sequelize[_0x272a('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e3bcbab..3d37605 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 _0xf350=['end','error','name','send','index','map','CmList','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ListId','getDispositions','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','getContactsCsv','cf_%d','raw','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','findOne','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf350,0xf3));var _0x0f35=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf350[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f35('0x1'));var jsonpatch=require(_0x0f35('0x2'));var rp=require('request-promise');var moment=require(_0x0f35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0f35('0x4'));var util=require('util');var path=require(_0x0f35('0x5'));var sox=require(_0x0f35('0x6'));var csv=require(_0x0f35('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f35('0x8'));var squel=require(_0x0f35('0x9'));var crypto=require(_0x0f35('0xa'));var jsforce=require(_0x0f35('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0f35('0x7'));var querystring=require(_0x0f35('0xc'));var Papa=require('papaparse');var Redis=require(_0x0f35('0xd'));var authService=require(_0x0f35('0xe'));var qs=require(_0x0f35('0xf'));var as=require(_0x0f35('0x10'));var hardwareService=require(_0x0f35('0x11'));var logger=require(_0x0f35('0x12'))(_0x0f35('0x13'));var utils=require(_0x0f35('0x14'));var config=require(_0x0f35('0x15'));var licenseUtil=require(_0x0f35('0x16'));var db=require(_0x0f35('0x17'))['db'];config[_0x0f35('0x18')]=_['defaults'](config[_0x0f35('0x18')],{'host':_0x0f35('0x19'),'port':0x18eb});var socket=require(_0x0f35('0x1a'))(new Redis(config[_0x0f35('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0xcc0398,_0x33757b){_0x33757b=_0x33757b||0xcc;return function(_0x1f52ec){if(_0x1f52ec){return _0xcc0398[_0x0f35('0x1b')](_0x33757b);}return _0xcc0398[_0x0f35('0x1c')](_0x33757b)['end']();};}function respondWithResult(_0x5d4fe9,_0x4a8c6a){_0x4a8c6a=_0x4a8c6a||0xc8;return function(_0x371063){if(_0x371063){return _0x5d4fe9['status'](_0x4a8c6a)[_0x0f35('0x1d')](_0x371063);}};}function respondWithFilteredResult(_0x92dddb,_0x13ed1e){return function(_0x4c19e9){if(_0x4c19e9){var _0x53489e=typeof _0x13ed1e[_0x0f35('0x1e')]===_0x0f35('0x1f')&&typeof _0x13ed1e['limit']===_0x0f35('0x1f');var _0x4beb1a=_0x4c19e9[_0x0f35('0x20')];var _0x4de078=_0x53489e?0x0:_0x13ed1e[_0x0f35('0x1e')];var _0x3d328c=_0x53489e?_0x4c19e9[_0x0f35('0x20')]:_0x13ed1e['offset']+_0x13ed1e[_0x0f35('0x21')];var _0x2102f0;if(_0x3d328c>=_0x4beb1a){_0x3d328c=_0x4beb1a;_0x2102f0=0xc8;}else{_0x2102f0=0xce;}_0x92dddb['status'](_0x2102f0);return _0x92dddb[_0x0f35('0x22')](_0x0f35('0x23'),_0x4de078+'-'+_0x3d328c+'/'+_0x4beb1a)[_0x0f35('0x1d')](_0x4c19e9);}return null;};}function patchUpdates(_0x4c77b6){return function(_0xd64ea4){try{jsonpatch[_0x0f35('0x24')](_0xd64ea4,_0x4c77b6,!![]);}catch(_0x24c433){return BPromise[_0x0f35('0x25')](_0x24c433);}return _0xd64ea4[_0x0f35('0x26')]();};}function saveUpdates(_0x3d3592,_0x2dca81){return function(_0x348e94){if(_0x348e94){return _0x348e94['update'](_0x3d3592)[_0x0f35('0x27')](function(_0x1c2281){return _0x1c2281;});}return null;};}function removeEntity(_0x3bbabb,_0x150d94){return function(_0x2d177f){if(_0x2d177f){return _0x2d177f[_0x0f35('0x28')]()['then'](function(){var _0x5a8fa0=_0x2d177f[_0x0f35('0x29')]({'plain':!![]});var _0x1e9719=_0x0f35('0x2a');return db['UserProfileResource'][_0x0f35('0x28')]({'where':{'type':_0x1e9719,'resourceId':_0x5a8fa0['id']}})[_0x0f35('0x27')](function(){return _0x2d177f;});})[_0x0f35('0x27')](function(){_0x3bbabb[_0x0f35('0x1c')](0xcc)[_0x0f35('0x2b')]();});}};}function handleEntityNotFound(_0x326fe3,_0x4ea89d){return function(_0x303e50){if(!_0x303e50){_0x326fe3['sendStatus'](0x194);}return _0x303e50;};}function handleError(_0x238dc4,_0x4c8ce6){_0x4c8ce6=_0x4c8ce6||0x1f4;return function(_0x1ae589){logger[_0x0f35('0x2c')](_0x1ae589['stack']);if(_0x1ae589['name']){delete _0x1ae589[_0x0f35('0x2d')];}_0x238dc4[_0x0f35('0x1c')](_0x4c8ce6)[_0x0f35('0x2e')](_0x1ae589);};}exports[_0x0f35('0x2f')]=function(_0x5ac4ae,_0x45e433){var _0x3c0915={},_0x3b5e07={},_0x3458df={'count':0x0,'rows':[]};var _0x5d878f=_[_0x0f35('0x30')](db[_0x0f35('0x31')][_0x0f35('0x32')],function(_0xd4e243){return{'name':_0xd4e243['fieldName'],'type':_0xd4e243[_0x0f35('0x33')][_0x0f35('0x34')]};});_0x3b5e07['model']=_[_0x0f35('0x30')](_0x5d878f,_0x0f35('0x2d'));_0x3b5e07[_0x0f35('0x35')]=_[_0x0f35('0x36')](_0x5ac4ae[_0x0f35('0x35')]);_0x3b5e07['filters']=_[_0x0f35('0x37')](_0x3b5e07[_0x0f35('0x38')],_0x3b5e07['query']);_0x3c0915[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x3b5e07[_0x0f35('0x38')],qs[_0x0f35('0x3a')](_0x5ac4ae[_0x0f35('0x35')][_0x0f35('0x3a')]));_0x3c0915[_0x0f35('0x39')]=_0x3c0915[_0x0f35('0x39')][_0x0f35('0x3b')]?_0x3c0915['attributes']:_0x3b5e07[_0x0f35('0x38')];if(!_0x5ac4ae[_0x0f35('0x35')][_0x0f35('0x3c')](_0x0f35('0x3d'))){_0x3c0915[_0x0f35('0x21')]=qs[_0x0f35('0x21')](_0x5ac4ae[_0x0f35('0x35')][_0x0f35('0x21')]);_0x3c0915[_0x0f35('0x1e')]=qs[_0x0f35('0x1e')](_0x5ac4ae[_0x0f35('0x35')][_0x0f35('0x1e')]);}_0x3c0915[_0x0f35('0x3e')]=qs[_0x0f35('0x3f')](_0x5ac4ae['query'][_0x0f35('0x3f')]);_0x3c0915['where']=qs[_0x0f35('0x40')](_[_0x0f35('0x41')](_0x5ac4ae[_0x0f35('0x35')],_0x3b5e07[_0x0f35('0x40')]),_0x5d878f);if(_0x5ac4ae[_0x0f35('0x35')]['filter']){_0x3c0915[_0x0f35('0x42')]=_[_0x0f35('0x43')](_0x3c0915['where'],{'$or':_['map'](_0x5d878f,function(_0x2cee48){if(_0x2cee48[_0x0f35('0x33')]!==_0x0f35('0x44')){var _0x7bb9d2={};_0x7bb9d2[_0x2cee48[_0x0f35('0x2d')]]={'$like':'%'+_0x5ac4ae[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0x7bb9d2;}})});}_0x3c0915=_[_0x0f35('0x43')]({},_0x3c0915,_0x5ac4ae[_0x0f35('0x46')]);var _0x27f5f3={'where':_0x3c0915[_0x0f35('0x42')]};return db[_0x0f35('0x31')]['count'](_0x27f5f3)[_0x0f35('0x27')](function(_0x17c264){_0x3458df[_0x0f35('0x20')]=_0x17c264;if(_0x5ac4ae['query'][_0x0f35('0x47')]){_0x3c0915['include']=[{'all':!![]}];}return db[_0x0f35('0x31')][_0x0f35('0x48')](_0x3c0915);})['then'](function(_0x2e8655){_0x3458df[_0x0f35('0x49')]=_0x2e8655;return _0x3458df;})[_0x0f35('0x27')](respondWithFilteredResult(_0x45e433,_0x3c0915))[_0x0f35('0x4a')](handleError(_0x45e433,null));};exports[_0x0f35('0x4b')]=function(_0x1affb6,_0x479611){var _0x2bcfb3={'raw':![],'where':{'id':_0x1affb6[_0x0f35('0x4c')]['id']}},_0x2fe09d={};_0x2fe09d[_0x0f35('0x38')]=_[_0x0f35('0x36')](db[_0x0f35('0x31')][_0x0f35('0x32')]);_0x2fe09d['query']=_[_0x0f35('0x36')](_0x1affb6['query']);_0x2fe09d[_0x0f35('0x40')]=_['intersection'](_0x2fe09d[_0x0f35('0x38')],_0x2fe09d['query']);_0x2bcfb3['attributes']=_[_0x0f35('0x37')](_0x2fe09d[_0x0f35('0x38')],qs[_0x0f35('0x3a')](_0x1affb6['query']['fields']));_0x2bcfb3[_0x0f35('0x39')]=_0x2bcfb3[_0x0f35('0x39')][_0x0f35('0x3b')]?_0x2bcfb3[_0x0f35('0x39')]:_0x2fe09d[_0x0f35('0x38')];if(_0x1affb6[_0x0f35('0x35')]['includeAll']){_0x2bcfb3[_0x0f35('0x4d')]=[{'all':!![]}];}_0x2bcfb3=_[_0x0f35('0x43')]({},_0x2bcfb3,_0x1affb6[_0x0f35('0x46')]);return db[_0x0f35('0x31')][_0x0f35('0x4e')](_0x2bcfb3)[_0x0f35('0x27')](handleEntityNotFound(_0x479611,null))[_0x0f35('0x27')](respondWithResult(_0x479611,null))[_0x0f35('0x4a')](handleError(_0x479611,null));};exports[_0x0f35('0x4f')]=function(_0x484ecb,_0x52be8e){return db['CmList'][_0x0f35('0x4f')](_0x484ecb['body'],{})[_0x0f35('0x27')](function(_0x5cb20d){var _0x49af0f=_0x484ecb['user'][_0x0f35('0x29')]({'plain':!![]});if(!_0x49af0f)throw new Error(_0x0f35('0x50'));if(_0x49af0f['role']==='user'){var _0x317a74=_0x5cb20d['get']({'plain':!![]});var _0x5edf96=_0x0f35('0x2a');return db[_0x0f35('0x51')][_0x0f35('0x4e')]({'where':{'name':_0x5edf96,'userProfileId':_0x49af0f[_0x0f35('0x52')]},'raw':!![]})[_0x0f35('0x27')](function(_0x394bae){if(_0x394bae&&_0x394bae[_0x0f35('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x317a74[_0x0f35('0x2d')],'resourceId':_0x317a74['id'],'type':_0x394bae['name'],'sectionId':_0x394bae['id']},{})[_0x0f35('0x27')](function(){return _0x5cb20d;});}else{return _0x5cb20d;}})['catch'](function(_0x2c06cf){logger['error'](_0x0f35('0x54'),_0x2c06cf);throw _0x2c06cf;});}return _0x5cb20d;})[_0x0f35('0x27')](respondWithResult(_0x52be8e,0xc9))[_0x0f35('0x4a')](handleError(_0x52be8e,null));};exports[_0x0f35('0x55')]=function(_0x2992d0,_0x470c88){if(_0x2992d0[_0x0f35('0x56')]['id']){delete _0x2992d0[_0x0f35('0x56')]['id'];}return db[_0x0f35('0x31')][_0x0f35('0x4e')]({'where':{'id':_0x2992d0[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x470c88,null))[_0x0f35('0x27')](saveUpdates(_0x2992d0['body'],null))[_0x0f35('0x27')](respondWithResult(_0x470c88,null))[_0x0f35('0x4a')](handleError(_0x470c88,null));};exports[_0x0f35('0x28')]=function(_0x28b859,_0x34086c){return db[_0x0f35('0x31')]['find']({'where':{'id':_0x28b859[_0x0f35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34086c,null))[_0x0f35('0x27')](removeEntity(_0x34086c,null))[_0x0f35('0x4a')](handleError(_0x34086c,null));};exports['describe']=function(_0x51e7b6,_0x51e4c4){return db[_0x0f35('0x31')][_0x0f35('0x57')]()[_0x0f35('0x27')](respondWithResult(_0x51e4c4,null))['catch'](handleError(_0x51e4c4,null));};exports[_0x0f35('0x58')]=function(_0x4b2783,_0x2fd288,_0x431d09){if(_0x4b2783[_0x0f35('0x56')]['id']){delete _0x4b2783[_0x0f35('0x56')]['id'];}return db[_0x0f35('0x31')]['find']({'where':{'id':_0x4b2783[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x2fd288,null))[_0x0f35('0x27')](function(_0xd59870){if(_0xd59870){_0x4b2783['body'][_0x0f35('0x59')]=_0xd59870['id'];return db['Disposition'][_0x0f35('0x4f')](_0x4b2783['body']);}})[_0x0f35('0x27')](respondWithResult(_0x2fd288,null))[_0x0f35('0x4a')](handleError(_0x2fd288,null));};exports[_0x0f35('0x5a')]=function(_0x364fc2,_0x5b185a,_0x4600f6){var _0x496d05={'raw':![],'where':{}};var _0x2328c8={};var _0x5c6b96={'count':0x0,'rows':[]};return db[_0x0f35('0x31')]['findOne']({'where':{'id':_0x364fc2[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x5b185a,null))[_0x0f35('0x27')](function(_0x26118c){if(_0x26118c){_0x2328c8['model']=_[_0x0f35('0x36')](db[_0x0f35('0x5b')][_0x0f35('0x32')]);_0x2328c8[_0x0f35('0x35')]=_[_0x0f35('0x36')](_0x364fc2[_0x0f35('0x35')]);_0x2328c8[_0x0f35('0x40')]=_[_0x0f35('0x37')](_0x2328c8[_0x0f35('0x38')],_0x2328c8[_0x0f35('0x35')]);_0x496d05[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x2328c8[_0x0f35('0x38')],qs['fields'](_0x364fc2[_0x0f35('0x35')][_0x0f35('0x3a')]));_0x496d05['attributes']=_0x496d05[_0x0f35('0x39')]['length']?_0x496d05['attributes']:_0x2328c8[_0x0f35('0x38')];if(!_0x364fc2[_0x0f35('0x35')][_0x0f35('0x3c')](_0x0f35('0x3d'))){_0x496d05[_0x0f35('0x21')]=qs[_0x0f35('0x21')](_0x364fc2['query'][_0x0f35('0x21')]);_0x496d05[_0x0f35('0x1e')]=qs[_0x0f35('0x1e')](_0x364fc2[_0x0f35('0x35')][_0x0f35('0x1e')]);}_0x496d05[_0x0f35('0x3e')]=qs['sort'](_0x364fc2['query'][_0x0f35('0x3f')]);_0x496d05[_0x0f35('0x42')]=qs[_0x0f35('0x40')](_[_0x0f35('0x41')](_0x364fc2[_0x0f35('0x35')],_0x2328c8['filters']));_0x496d05[_0x0f35('0x42')][_0x0f35('0x59')]=_0x26118c['id'];if(_0x364fc2[_0x0f35('0x35')][_0x0f35('0x45')]){_0x496d05[_0x0f35('0x42')]=_['merge'](_0x496d05[_0x0f35('0x42')],{'$or':_['map'](_0x496d05[_0x0f35('0x39')],function(_0x42b4e7){var _0xfd5443={};_0xfd5443[_0x42b4e7]={'$like':'%'+_0x364fc2[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0xfd5443;})});}_0x496d05=_[_0x0f35('0x43')]({},_0x496d05,_0x364fc2[_0x0f35('0x46')]);return db['Disposition']['count']({'where':_0x496d05[_0x0f35('0x42')]})[_0x0f35('0x27')](function(_0x396f29){_0x5c6b96[_0x0f35('0x20')]=_0x396f29;if(_0x364fc2['query'][_0x0f35('0x47')]){_0x496d05['include']=[{'all':!![]}];}return db['Disposition'][_0x0f35('0x48')](_0x496d05);})['then'](function(_0xc989f8){_0x5c6b96[_0x0f35('0x49')]=_0xc989f8;return _0x5c6b96;});}})['then'](respondWithFilteredResult(_0x5b185a,_0x496d05))[_0x0f35('0x4a')](handleError(_0x5b185a,null));};exports[_0x0f35('0x5c')]=function(_0x5f30e7,_0x489ff2,_0x2103ad){return db[_0x0f35('0x31')]['find']({'where':{'id':_0x5f30e7[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x489ff2,null))[_0x0f35('0x27')](function(_0x345aa5){if(_0x345aa5){return _0x345aa5[_0x0f35('0x5c')](_0x5f30e7[_0x0f35('0x35')][_0x0f35('0x5d')]);}})[_0x0f35('0x27')](respondWithStatusCode(_0x489ff2,null))[_0x0f35('0x4a')](handleError(_0x489ff2,null));};exports[_0x0f35('0x5e')]=function(_0x1c4cf3,_0x6625eb,_0xcbe296){return db[_0x0f35('0x31')]['find']({'where':{'id':_0x1c4cf3[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x6625eb,null))[_0x0f35('0x27')](function(_0x1a1ca5){if(_0x1a1ca5){var _0x1b2f3d=[];var _0x409caa={'success':[],'errors':[]};return db[_0x0f35('0x5f')][_0x0f35('0x57')]()[_0x0f35('0x27')](function(_0x1e3a00){if(_0x1c4cf3['body']['tags']&&_['isArray'](_0x1c4cf3[_0x0f35('0x56')][_0x0f35('0x60')])){if(_0x1c4cf3[_0x0f35('0x56')][_0x0f35('0x60')][_0x0f35('0x3b')]){_0x1c4cf3[_0x0f35('0x56')]['tags']=_0x1c4cf3[_0x0f35('0x56')][_0x0f35('0x60')]['join'](';')+';';}else{_0x1c4cf3['body'][_0x0f35('0x60')]=null;}}else{_0x1c4cf3[_0x0f35('0x56')][_0x0f35('0x60')]=null;}if(_0x1c4cf3[_0x0f35('0x56')]&&_[_0x0f35('0x61')](_0x1c4cf3['body'])){for(var _0x1ce807=0x0;_0x1ce807<_0x1c4cf3[_0x0f35('0x56')][_0x0f35('0x3b')];_0x1ce807+=0x1){_0x1c4cf3[_0x0f35('0x56')][_0x1ce807][_0x0f35('0x59')]=_0x1c4cf3[_0x0f35('0x4c')]['id'];_0x1b2f3d[_0x0f35('0x62')](_0x1c4cf3[_0x0f35('0x56')][_0x1ce807]);}return BPromise[_0x0f35('0x63')](_0x1b2f3d,function(_0xea1ffd){return db[_0x0f35('0x5f')][_0x0f35('0x4f')](_[_0x0f35('0x64')](_0xea1ffd,[_0x0f35('0x5d'),'id'])||{},{'fields':_[_0x0f35('0x36')](_0x1e3a00),'raw':!![]})[_0x0f35('0x27')](function(_0x5f495b){_0x409caa[_0x0f35('0x65')]['push'](_0x5f495b[_0x0f35('0x66')]);})[_0x0f35('0x4a')](function(_0x25c6ca){_0x409caa[_0x0f35('0x67')][_0x0f35('0x62')]({'data':_0xea1ffd,'error':_0x25c6ca['message']});});})[_0x0f35('0x27')](function(_0x3cd533){return _0x409caa;})['catch'](function(_0x3f0fbc){return _0x3f0fbc;});}else{_0x6625eb[_0x0f35('0x1c')](0x190)[_0x0f35('0x1d')]({'message':_0x0f35('0x68')});}});}})['then'](respondWithResult(_0x6625eb,null))[_0x0f35('0x4a')](handleError(_0x6625eb,null));};exports[_0x0f35('0x69')]=function(_0x24704c,_0x5d619c,_0x229ffa){var _0x1998bb;return db[_0x0f35('0x31')][_0x0f35('0x4e')]({'where':{'id':_0x24704c[_0x0f35('0x4c')]['id']},'include':[{'model':db[_0x0f35('0x6a')],'as':_0x0f35('0x6b')}]})[_0x0f35('0x27')](handleEntityNotFound(_0x5d619c,null))[_0x0f35('0x27')](function(_0x2a2cbb){if(_0x2a2cbb){_0x1998bb=_0x2a2cbb;return db[_0x0f35('0x5f')]['rawAttributes'];}})['then'](function(_0x5db8ec){if(_0x5db8ec){var _0x4aadcc={};var _0x553011={};_0x553011[_0x0f35('0x38')]=_[_0x0f35('0x6c')](_[_0x0f35('0x36')](_0x5db8ec),_[_0x0f35('0x30')](_0x1998bb[_0x0f35('0x6b')],function(_0x4f4593){return util[_0x0f35('0x6d')]('cf_%d',_0x4f4593['id']);}));_0x553011[_0x0f35('0x35')]=_['keys'](_0x24704c[_0x0f35('0x35')]);_0x553011[_0x0f35('0x40')]=_[_0x0f35('0x37')](_0x553011[_0x0f35('0x38')],_0x553011[_0x0f35('0x35')]);_0x4aadcc[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x553011[_0x0f35('0x38')],qs[_0x0f35('0x3a')](_0x24704c[_0x0f35('0x35')]['fields']));_0x4aadcc[_0x0f35('0x39')]=_0x4aadcc[_0x0f35('0x39')][_0x0f35('0x3b')]?_0x4aadcc['attributes']:_0x553011[_0x0f35('0x38')];if(!_0x24704c[_0x0f35('0x35')][_0x0f35('0x3c')](_0x0f35('0x3d'))){_0x4aadcc['limit']=qs['limit'](_0x24704c[_0x0f35('0x35')]['limit']);_0x4aadcc[_0x0f35('0x1e')]=qs[_0x0f35('0x1e')](_0x24704c[_0x0f35('0x35')][_0x0f35('0x1e')]);}_0x4aadcc[_0x0f35('0x3e')]=qs[_0x0f35('0x3f')](_0x24704c[_0x0f35('0x35')][_0x0f35('0x3f')]);_0x4aadcc['where']=qs[_0x0f35('0x40')](_[_0x0f35('0x41')](_0x24704c[_0x0f35('0x35')],_0x553011['filters']));_0x4aadcc['raw']=!![];if(_0x24704c[_0x0f35('0x35')][_0x0f35('0x45')]){_0x4aadcc[_0x0f35('0x42')]=_[_0x0f35('0x43')](_0x4aadcc[_0x0f35('0x42')],{'$or':_['map'](_0x4aadcc['attributes'],function(_0x488049){var _0x275533={};_0x275533[_0x488049]={'$like':'%'+_0x24704c[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0x275533;})});}_0x4aadcc=_[_0x0f35('0x43')]({},_0x4aadcc,_0x24704c['options']);return _0x1998bb[_0x0f35('0x69')](_0x4aadcc);}})[_0x0f35('0x27')](respondWithResult(_0x5d619c,null))[_0x0f35('0x4a')](handleError(_0x5d619c,null));};exports[_0x0f35('0x6e')]=function(_0x4987cb,_0x5d5d9b,_0x3e7b41){var _0x2da02b;return db['CmList']['find']({'where':{'id':_0x4987cb['params']['id']},'include':[{'model':db[_0x0f35('0x6a')],'as':_0x0f35('0x6b')}]})[_0x0f35('0x27')](handleEntityNotFound(_0x5d5d9b,null))[_0x0f35('0x27')](function(_0x5a8c9a){if(_0x5a8c9a){_0x2da02b=_0x5a8c9a;return db[_0x0f35('0x5f')][_0x0f35('0x32')];}})[_0x0f35('0x27')](function(_0x33f36a){if(_0x33f36a){var _0x1681d4={};var _0x22a7a3={};_0x22a7a3[_0x0f35('0x38')]=_[_0x0f35('0x6c')](_[_0x0f35('0x36')](_0x33f36a),_[_0x0f35('0x30')](_0x2da02b[_0x0f35('0x6b')],function(_0x45a7f3){return util[_0x0f35('0x6d')](_0x0f35('0x6f'),_0x45a7f3['id']);}));_0x22a7a3['query']=_['keys'](_0x4987cb['query']);_0x22a7a3[_0x0f35('0x40')]=_[_0x0f35('0x37')](_0x22a7a3['model'],_0x22a7a3[_0x0f35('0x35')]);_0x1681d4[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x22a7a3[_0x0f35('0x38')],qs['fields'](_0x4987cb[_0x0f35('0x35')]['fields']));_0x1681d4[_0x0f35('0x39')]=_0x1681d4['attributes']['length']?_0x1681d4['attributes']:_0x22a7a3[_0x0f35('0x38')];if(!_0x4987cb['query'][_0x0f35('0x3c')]('nolimit')){_0x1681d4[_0x0f35('0x21')]=qs[_0x0f35('0x21')](_0x4987cb[_0x0f35('0x35')]['limit']);_0x1681d4[_0x0f35('0x1e')]=qs['offset'](_0x4987cb['query'][_0x0f35('0x1e')]);}_0x1681d4[_0x0f35('0x3e')]=qs[_0x0f35('0x3f')](_0x4987cb[_0x0f35('0x35')][_0x0f35('0x3f')]);_0x1681d4[_0x0f35('0x42')]=qs[_0x0f35('0x40')](_['pick'](_0x4987cb['query'],_0x22a7a3[_0x0f35('0x40')]));_0x1681d4[_0x0f35('0x70')]=!![];if(_0x4987cb[_0x0f35('0x35')]['filter']){_0x1681d4[_0x0f35('0x42')]=_['merge'](_0x1681d4[_0x0f35('0x42')],{'$or':_[_0x0f35('0x30')](_0x1681d4['attributes'],function(_0x3bdf01){var _0x181df3={};_0x181df3[_0x3bdf01]={'$like':'%'+_0x4987cb[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0x181df3;})});}_0x1681d4=_[_0x0f35('0x43')]({},_0x1681d4,_0x4987cb['options']);return _0x2da02b[_0x0f35('0x69')](_0x1681d4);}})[_0x0f35('0x27')](function(_0x1733e0){if(!_['isEmpty'](_0x1733e0)){var _0x112307=toCsv(_0x1733e0);var _0x2da7ad=Date[_0x0f35('0x71')]();fs[_0x0f35('0x72')](util[_0x0f35('0x6d')](_0x0f35('0x73'),_0x2da02b['id'],_0x2da7ad),_0x112307);_0x5d5d9b['setHeader'](_0x0f35('0x74'),_0x0f35('0x75')+util[_0x0f35('0x6d')](_0x0f35('0x76'),_0x2da02b['id'],_0x2da7ad));_0x5d5d9b['setHeader'](_0x0f35('0x77'),_0x0f35('0x78'));return _0x5d5d9b[_0x0f35('0x79')](util[_0x0f35('0x6d')](_0x0f35('0x73'),_0x2da02b['id'],_0x2da7ad));}else{return _0x5d5d9b['sendStatus'](0xcc);}})['catch'](handleError(_0x5d5d9b,null));};exports['addCustomField']=function(_0xdd55c3,_0x4d5c74,_0x44438a){var _0x2bc402;delete _0xdd55c3[_0x0f35('0x56')]['id'];return db[_0x0f35('0x31')][_0x0f35('0x7a')]({'where':{'id':_0xdd55c3[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x4d5c74,null))[_0x0f35('0x27')](function(_0x9c04d8){if(_0x9c04d8){return db[_0x0f35('0x7b')][_0x0f35('0x7c')](function(_0x5a7696){return db[_0x0f35('0x6a')]['create'](_0xdd55c3[_0x0f35('0x56')],{'transaction':_0x5a7696})['then'](function(_0x34be49){_0x2bc402=_0x34be49;return _0x9c04d8[_0x0f35('0x7d')](_0x34be49,{'transaction':_0x5a7696});})[_0x0f35('0x27')](function(){var _0x315e65={'type':db['Sequelize'][_0x0f35('0x7e')],'transaction':_0x5a7696};switch(_0xdd55c3[_0x0f35('0x56')][_0x0f35('0x33')]){case _0x0f35('0x7f'):_0x315e65[_0x0f35('0x33')]=db[_0x0f35('0x80')][_0x0f35('0x7e')];break;case _0x0f35('0x81'):_0x315e65[_0x0f35('0x33')]=db[_0x0f35('0x80')][_0x0f35('0x82')];break;case'switch':_0x315e65['type']=db['Sequelize'][_0x0f35('0x83')];_0x315e65['defaultValue']=![];break;default:}return db[_0x0f35('0x7b')][_0x0f35('0x84')][_0x0f35('0x85')](_0x0f35('0x86'),util[_0x0f35('0x6d')](_0x0f35('0x87'),_0x2bc402['id']),_0x315e65);})['then'](function(){return _0x2bc402;});});}})['then'](respondWithResult(_0x4d5c74,null))['catch'](handleError(_0x4d5c74,null));};exports[_0x0f35('0x88')]=function(_0xbd8aa5,_0x3e129f,_0x1615e2){var _0x2ae93b={};var _0x48be13={};var _0x1ac57a;var _0x727ae7;return db['CmList'][_0x0f35('0x7a')]({'where':{'id':_0xbd8aa5[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x3e129f,null))['then'](function(_0x3dc6e3){if(_0x3dc6e3){_0x1ac57a=_0x3dc6e3;_0x48be13['model']=_[_0x0f35('0x36')](db[_0x0f35('0x6a')]['rawAttributes']);_0x48be13[_0x0f35('0x35')]=_['keys'](_0xbd8aa5[_0x0f35('0x35')]);_0x48be13[_0x0f35('0x40')]=_[_0x0f35('0x37')](_0x48be13['model'],_0x48be13[_0x0f35('0x35')]);_0x2ae93b[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x48be13['model'],qs[_0x0f35('0x3a')](_0xbd8aa5[_0x0f35('0x35')][_0x0f35('0x3a')]));_0x2ae93b[_0x0f35('0x39')]=_0x2ae93b[_0x0f35('0x39')]['length']?_0x2ae93b[_0x0f35('0x39')]:_0x48be13[_0x0f35('0x38')];_0x2ae93b['order']=qs['sort'](_0xbd8aa5[_0x0f35('0x35')][_0x0f35('0x3f')]);_0x2ae93b[_0x0f35('0x42')]=qs['filters'](_[_0x0f35('0x41')](_0xbd8aa5['query'],_0x48be13['filters']));_0x2ae93b[_0x0f35('0x42')]=_[_0x0f35('0x43')](_0x2ae93b['where'],{'$or':[{'ListId':_0x3dc6e3['id']},{'ListId':null}]});if(_0xbd8aa5[_0x0f35('0x35')][_0x0f35('0x45')]){_0x2ae93b[_0x0f35('0x42')]=_[_0x0f35('0x43')](_0x2ae93b[_0x0f35('0x42')],{'$or':_['map'](_0x2ae93b[_0x0f35('0x39')],function(_0x3f18eb){var _0x1ca6a6={};_0x1ca6a6[_0x3f18eb]={'$like':'%'+_0xbd8aa5[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0x1ca6a6;})});}_0x2ae93b=_[_0x0f35('0x43')]({},_0x2ae93b,_0xbd8aa5[_0x0f35('0x46')]);return db[_0x0f35('0x6a')]['findAndCountAll'](_0x2ae93b);}})['then'](respondWithResult(_0x3e129f,null))[_0x0f35('0x4a')](handleError(_0x3e129f,null));};exports[_0x0f35('0x89')]=function(_0x2fc011,_0x342cfa,_0x1f79c1){return db[_0x0f35('0x31')][_0x0f35('0x4e')]({'where':{'id':_0x2fc011[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x342cfa,null))[_0x0f35('0x27')](function(_0x3207a4){if(_0x3207a4){return _0x3207a4[_0x0f35('0x89')](_0x2fc011[_0x0f35('0x56')][_0x0f35('0x5d')],_[_0x0f35('0x64')](_0x2fc011['body'],[_0x0f35('0x5d'),'id'])||{})[_0x0f35('0x8a')](function(_0x22ff16){for(var _0x138621=0x0;_0x138621<_0x2fc011[_0x0f35('0x56')]['ids'][_0x0f35('0x3b')];_0x138621+=0x1){socket[_0x0f35('0x8b')](_0x0f35('0x8c'),{'UserId':Number(_0x2fc011['body']['ids'][_0x138621]),'CmListId':Number(_0x2fc011['params']['id'])});}return _0x22ff16;});}})[_0x0f35('0x27')](respondWithResult(_0x342cfa,null))[_0x0f35('0x4a')](handleError(_0x342cfa,null));};exports[_0x0f35('0x8d')]=function(_0x3adc92,_0x140561,_0x45a625){return db[_0x0f35('0x31')][_0x0f35('0x4e')]({'where':{'id':_0x3adc92[_0x0f35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x140561,null))[_0x0f35('0x27')](function(_0x58e1d4){if(_0x58e1d4){return _0x58e1d4[_0x0f35('0x8d')](_0x3adc92[_0x0f35('0x35')][_0x0f35('0x5d')])['then'](function(){if(_[_0x0f35('0x61')](_0x3adc92[_0x0f35('0x35')][_0x0f35('0x5d')])){for(var _0x2f392c=0x0;_0x2f392c<_0x3adc92[_0x0f35('0x35')][_0x0f35('0x5d')]['length'];_0x2f392c+=0x1){socket[_0x0f35('0x8b')](_0x0f35('0x8e'),{'UserId':Number(_0x3adc92['query'][_0x0f35('0x5d')][_0x2f392c]),'CmListId':Number(_0x3adc92[_0x0f35('0x4c')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x3adc92[_0x0f35('0x35')]['ids']),'CmListId':Number(_0x3adc92[_0x0f35('0x4c')]['id'])});}});}})[_0x0f35('0x27')](respondWithStatusCode(_0x140561,null))[_0x0f35('0x4a')](handleError(_0x140561,null));};exports['getAgents']=function(_0x84e52b,_0x4dcd05,_0x19d696){var _0x3725d0={};var _0x392f03={};var _0x4e72e8;var _0xa9e966;return db[_0x0f35('0x31')][_0x0f35('0x7a')]({'where':{'id':_0x84e52b[_0x0f35('0x4c')]['id']}})[_0x0f35('0x27')](handleEntityNotFound(_0x4dcd05,null))[_0x0f35('0x27')](function(_0x4d0685){if(_0x4d0685){_0x4e72e8=_0x4d0685;_0x392f03[_0x0f35('0x38')]=_[_0x0f35('0x36')](db['User']['rawAttributes']);_0x392f03[_0x0f35('0x35')]=_[_0x0f35('0x36')](_0x84e52b['query']);_0x392f03[_0x0f35('0x40')]=_[_0x0f35('0x37')](_0x392f03[_0x0f35('0x38')],_0x392f03[_0x0f35('0x35')]);_0x3725d0[_0x0f35('0x39')]=_[_0x0f35('0x37')](_0x392f03[_0x0f35('0x38')],qs[_0x0f35('0x3a')](_0x84e52b[_0x0f35('0x35')]['fields']));_0x3725d0[_0x0f35('0x39')]=_0x3725d0[_0x0f35('0x39')][_0x0f35('0x3b')]?_0x3725d0[_0x0f35('0x39')]:_0x392f03['model'];_0x3725d0[_0x0f35('0x3e')]=qs['sort'](_0x84e52b[_0x0f35('0x35')][_0x0f35('0x3f')]);_0x3725d0[_0x0f35('0x42')]=qs[_0x0f35('0x40')](_[_0x0f35('0x41')](_0x84e52b['query'],_0x392f03[_0x0f35('0x40')]));if(_0x84e52b[_0x0f35('0x35')]['filter']){_0x3725d0[_0x0f35('0x42')]=_[_0x0f35('0x43')](_0x3725d0[_0x0f35('0x42')],{'$or':_[_0x0f35('0x30')](_0x3725d0[_0x0f35('0x39')],function(_0x44faa7){var _0x291758={};_0x291758[_0x44faa7]={'$like':'%'+_0x84e52b[_0x0f35('0x35')][_0x0f35('0x45')]+'%'};return _0x291758;})});}_0x3725d0=_[_0x0f35('0x43')]({},_0x3725d0,_0x84e52b[_0x0f35('0x46')]);return _0x4e72e8['getAgents'](_0x3725d0);}})[_0x0f35('0x27')](function(_0x5671a7){if(_0x5671a7){_0xa9e966=_0x5671a7['length'];if(!_0x84e52b[_0x0f35('0x35')][_0x0f35('0x3c')]('nolimit')){_0x3725d0['limit']=qs[_0x0f35('0x21')](_0x84e52b[_0x0f35('0x35')][_0x0f35('0x21')]);_0x3725d0[_0x0f35('0x1e')]=qs['offset'](_0x84e52b[_0x0f35('0x35')][_0x0f35('0x1e')]);}return _0x4e72e8['getAgents'](_0x3725d0);}})['then'](function(_0x1cc8cd){if(_0x1cc8cd){return _0x1cc8cd?{'count':_0xa9e966,'rows':_0x1cc8cd}:null;}})['then'](respondWithResult(_0x4dcd05,null))[_0x0f35('0x4a')](handleError(_0x4dcd05,null));}; \ No newline at end of file +var _0x1c9c=['stack','name','send','index','map','CmList','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','ListId','findAll','removeDispositions','addContacts','CmContact','isArray','tags','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','addAgents','ids','spread','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','Lists'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x1c9c,0x67));var _0xc1c9=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x1c9c[_0x2defb5];return _0x229c53;};'use strict';var emlformat=require(_0xc1c9('0x0'));var rimraf=require(_0xc1c9('0x1'));var zipdir=require(_0xc1c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1c9('0x3'));var moment=require(_0xc1c9('0x4'));var BPromise=require(_0xc1c9('0x5'));var Mustache=require(_0xc1c9('0x6'));var util=require('util');var path=require(_0xc1c9('0x7'));var sox=require(_0xc1c9('0x8'));var csv=require(_0xc1c9('0x9'));var ejs=require(_0xc1c9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1c9('0xb'));var squel=require(_0xc1c9('0xc'));var crypto=require(_0xc1c9('0xd'));var jsforce=require(_0xc1c9('0xe'));var deskjs=require(_0xc1c9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc1c9('0x10'));var Papa=require(_0xc1c9('0x11'));var Redis=require(_0xc1c9('0x12'));var authService=require(_0xc1c9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c9('0x14'));var hardwareService=require(_0xc1c9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc1c9('0x16'));var config=require(_0xc1c9('0x17'));var licenseUtil=require(_0xc1c9('0x18'));var db=require(_0xc1c9('0x19'))['db'];config[_0xc1c9('0x1a')]=_[_0xc1c9('0x1b')](config[_0xc1c9('0x1a')],{'host':_0xc1c9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1c9('0x1a')]));require(_0xc1c9('0x1d'))[_0xc1c9('0x1e')](socket);function respondWithStatusCode(_0xa4c9b8,_0x4d3702){_0x4d3702=_0x4d3702||0xcc;return function(_0x5024c4){if(_0x5024c4){return _0xa4c9b8[_0xc1c9('0x1f')](_0x4d3702);}return _0xa4c9b8[_0xc1c9('0x20')](_0x4d3702)[_0xc1c9('0x21')]();};}function respondWithResult(_0x240b04,_0x315f35){_0x315f35=_0x315f35||0xc8;return function(_0x2de13a){if(_0x2de13a){return _0x240b04[_0xc1c9('0x20')](_0x315f35)[_0xc1c9('0x22')](_0x2de13a);}};}function respondWithFilteredResult(_0x9e3234,_0x43941a){return function(_0x3747e3){if(_0x3747e3){var _0x2ae228=typeof _0x43941a[_0xc1c9('0x23')]===_0xc1c9('0x24')&&typeof _0x43941a['limit']==='undefined';var _0xc79e8=_0x3747e3['count'];var _0x3e45a9=_0x2ae228?0x0:_0x43941a[_0xc1c9('0x23')];var _0x16d928=_0x2ae228?_0x3747e3['count']:_0x43941a[_0xc1c9('0x23')]+_0x43941a[_0xc1c9('0x25')];var _0x2bad5b;if(_0x16d928>=_0xc79e8){_0x16d928=_0xc79e8;_0x2bad5b=0xc8;}else{_0x2bad5b=0xce;}_0x9e3234[_0xc1c9('0x20')](_0x2bad5b);return _0x9e3234[_0xc1c9('0x26')](_0xc1c9('0x27'),_0x3e45a9+'-'+_0x16d928+'/'+_0xc79e8)[_0xc1c9('0x22')](_0x3747e3);}return null;};}function patchUpdates(_0x2fe089){return function(_0xcddf31){try{jsonpatch['apply'](_0xcddf31,_0x2fe089,!![]);}catch(_0x54673b){return BPromise[_0xc1c9('0x28')](_0x54673b);}return _0xcddf31[_0xc1c9('0x29')]();};}function saveUpdates(_0x5e1b7e,_0x12e297){return function(_0x5d07b4){if(_0x5d07b4){return _0x5d07b4['update'](_0x5e1b7e)[_0xc1c9('0x2a')](function(_0x58d760){return _0x58d760;});}return null;};}function removeEntity(_0x510b79,_0x30f816){return function(_0x4e43ab){if(_0x4e43ab){return _0x4e43ab[_0xc1c9('0x2b')]()['then'](function(){var _0x2c37e9=_0x4e43ab['get']({'plain':!![]});var _0x32f31b=_0xc1c9('0x2c');return db['UserProfileResource'][_0xc1c9('0x2b')]({'where':{'type':_0x32f31b,'resourceId':_0x2c37e9['id']}})[_0xc1c9('0x2a')](function(){return _0x4e43ab;});})['then'](function(){_0x510b79[_0xc1c9('0x20')](0xcc)[_0xc1c9('0x21')]();});}};}function handleEntityNotFound(_0x2db696,_0x306d4d){return function(_0x50e22f){if(!_0x50e22f){_0x2db696[_0xc1c9('0x1f')](0x194);}return _0x50e22f;};}function handleError(_0x503a0c,_0x521c91){_0x521c91=_0x521c91||0x1f4;return function(_0x81d856){logger['error'](_0x81d856[_0xc1c9('0x2d')]);if(_0x81d856[_0xc1c9('0x2e')]){delete _0x81d856[_0xc1c9('0x2e')];}_0x503a0c[_0xc1c9('0x20')](_0x521c91)[_0xc1c9('0x2f')](_0x81d856);};}exports[_0xc1c9('0x30')]=function(_0x320117,_0x109c0f){var _0x473a47={},_0xf8d412={},_0x3755f9={'count':0x0,'rows':[]};var _0x4504a4=_[_0xc1c9('0x31')](db[_0xc1c9('0x32')][_0xc1c9('0x33')],function(_0x524ddb){return{'name':_0x524ddb['fieldName'],'type':_0x524ddb['type']['key']};});_0xf8d412['model']=_['map'](_0x4504a4,_0xc1c9('0x2e'));_0xf8d412[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x320117[_0xc1c9('0x34')]);_0xf8d412[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0xf8d412[_0xc1c9('0x38')],_0xf8d412[_0xc1c9('0x34')]);_0x473a47[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0xf8d412[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x320117[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x473a47['attributes']=_0x473a47['attributes'][_0xc1c9('0x3b')]?_0x473a47[_0xc1c9('0x39')]:_0xf8d412[_0xc1c9('0x38')];if(!_0x320117[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x473a47[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x320117[_0xc1c9('0x34')]['limit']);_0x473a47[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x320117[_0xc1c9('0x34')][_0xc1c9('0x23')]);}_0x473a47[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x320117['query'][_0xc1c9('0x3f')]);_0x473a47[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x320117[_0xc1c9('0x34')],_0xf8d412['filters']),_0x4504a4);if(_0x320117[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x473a47['where']=_[_0xc1c9('0x43')](_0x473a47[_0xc1c9('0x40')],{'$or':_['map'](_0x4504a4,function(_0x10b51b){if(_0x10b51b['type']!=='VIRTUAL'){var _0x350f92={};_0x350f92[_0x10b51b[_0xc1c9('0x2e')]]={'$like':'%'+_0x320117[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x350f92;}})});}_0x473a47=_[_0xc1c9('0x43')]({},_0x473a47,_0x320117[_0xc1c9('0x44')]);var _0x4a4707={'where':_0x473a47[_0xc1c9('0x40')]};return db[_0xc1c9('0x32')][_0xc1c9('0x45')](_0x4a4707)[_0xc1c9('0x2a')](function(_0x35a850){_0x3755f9[_0xc1c9('0x45')]=_0x35a850;if(_0x320117[_0xc1c9('0x34')]['includeAll']){_0x473a47[_0xc1c9('0x46')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x473a47);})[_0xc1c9('0x2a')](function(_0x45c51a){_0x3755f9[_0xc1c9('0x47')]=_0x45c51a;return _0x3755f9;})[_0xc1c9('0x2a')](respondWithFilteredResult(_0x109c0f,_0x473a47))[_0xc1c9('0x48')](handleError(_0x109c0f,null));};exports[_0xc1c9('0x49')]=function(_0x23eb93,_0x1ac293){var _0x39a6e5={'raw':![],'where':{'id':_0x23eb93[_0xc1c9('0x4a')]['id']}},_0xf1ec54={};_0xf1ec54[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x32')]['rawAttributes']);_0xf1ec54[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x23eb93[_0xc1c9('0x34')]);_0xf1ec54[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0xf1ec54[_0xc1c9('0x38')],_0xf1ec54[_0xc1c9('0x34')]);_0x39a6e5[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0xf1ec54['model'],qs[_0xc1c9('0x3a')](_0x23eb93[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x39a6e5[_0xc1c9('0x39')]=_0x39a6e5[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x39a6e5[_0xc1c9('0x39')]:_0xf1ec54[_0xc1c9('0x38')];if(_0x23eb93[_0xc1c9('0x34')][_0xc1c9('0x4b')]){_0x39a6e5[_0xc1c9('0x46')]=[{'all':!![]}];}_0x39a6e5=_['merge']({},_0x39a6e5,_0x23eb93[_0xc1c9('0x44')]);return db[_0xc1c9('0x32')][_0xc1c9('0x4c')](_0x39a6e5)[_0xc1c9('0x2a')](handleEntityNotFound(_0x1ac293,null))[_0xc1c9('0x2a')](respondWithResult(_0x1ac293,null))[_0xc1c9('0x48')](handleError(_0x1ac293,null));};exports['create']=function(_0xbeb1bb,_0xa70803){return db['CmList'][_0xc1c9('0x4d')](_0xbeb1bb[_0xc1c9('0x4e')],{})[_0xc1c9('0x2a')](function(_0x1023cc){var _0x5334a5=_0xbeb1bb[_0xc1c9('0x4f')][_0xc1c9('0x50')]({'plain':!![]});if(!_0x5334a5)throw new Error(_0xc1c9('0x51'));if(_0x5334a5[_0xc1c9('0x52')]===_0xc1c9('0x4f')){var _0x21cdf6=_0x1023cc['get']({'plain':!![]});var _0x2414b9=_0xc1c9('0x2c');return db['UserProfileSection'][_0xc1c9('0x4c')]({'where':{'name':_0x2414b9,'userProfileId':_0x5334a5[_0xc1c9('0x53')]},'raw':!![]})[_0xc1c9('0x2a')](function(_0xb44c4d){if(_0xb44c4d&&_0xb44c4d[_0xc1c9('0x54')]===0x0){return db[_0xc1c9('0x55')][_0xc1c9('0x4d')]({'name':_0x21cdf6[_0xc1c9('0x2e')],'resourceId':_0x21cdf6['id'],'type':_0xb44c4d['name'],'sectionId':_0xb44c4d['id']},{})[_0xc1c9('0x2a')](function(){return _0x1023cc;});}else{return _0x1023cc;}})[_0xc1c9('0x48')](function(_0x2cb09c){logger[_0xc1c9('0x56')](_0xc1c9('0x57'),_0x2cb09c);throw _0x2cb09c;});}return _0x1023cc;})['then'](respondWithResult(_0xa70803,0xc9))[_0xc1c9('0x48')](handleError(_0xa70803,null));};exports[_0xc1c9('0x58')]=function(_0x58c2cc,_0x3cf5e8){if(_0x58c2cc[_0xc1c9('0x4e')]['id']){delete _0x58c2cc[_0xc1c9('0x4e')]['id'];}return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x58c2cc[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3cf5e8,null))[_0xc1c9('0x2a')](saveUpdates(_0x58c2cc[_0xc1c9('0x4e')],null))[_0xc1c9('0x2a')](respondWithResult(_0x3cf5e8,null))[_0xc1c9('0x48')](handleError(_0x3cf5e8,null));};exports[_0xc1c9('0x2b')]=function(_0x14a9ce,_0x14d7bf){return db['CmList'][_0xc1c9('0x4c')]({'where':{'id':_0x14a9ce[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x14d7bf,null))[_0xc1c9('0x2a')](removeEntity(_0x14d7bf,null))[_0xc1c9('0x48')](handleError(_0x14d7bf,null));};exports[_0xc1c9('0x59')]=function(_0x3617cb,_0x3825f1){return db[_0xc1c9('0x32')]['describe']()[_0xc1c9('0x2a')](respondWithResult(_0x3825f1,null))[_0xc1c9('0x48')](handleError(_0x3825f1,null));};exports['addDisposition']=function(_0x4a2ccd,_0x56744a,_0x3229d1){if(_0x4a2ccd[_0xc1c9('0x4e')]['id']){delete _0x4a2ccd[_0xc1c9('0x4e')]['id'];}return db['CmList'][_0xc1c9('0x4c')]({'where':{'id':_0x4a2ccd['params']['id']}})['then'](handleEntityNotFound(_0x56744a,null))['then'](function(_0x66ca25){if(_0x66ca25){_0x4a2ccd['body']['ListId']=_0x66ca25['id'];return db[_0xc1c9('0x5a')][_0xc1c9('0x4d')](_0x4a2ccd[_0xc1c9('0x4e')]);}})[_0xc1c9('0x2a')](respondWithResult(_0x56744a,null))[_0xc1c9('0x48')](handleError(_0x56744a,null));};exports[_0xc1c9('0x5b')]=function(_0x273dad,_0x2a3394,_0x5cda12){var _0x7ee89a={'raw':![],'where':{}};var _0x2112a1={};var _0x24f511={'count':0x0,'rows':[]};return db[_0xc1c9('0x32')][_0xc1c9('0x5c')]({'where':{'id':_0x273dad[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2a3394,null))['then'](function(_0x2f50ee){if(_0x2f50ee){_0x2112a1[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db['Disposition']['rawAttributes']);_0x2112a1['query']=_['keys'](_0x273dad['query']);_0x2112a1[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x2112a1['model'],_0x2112a1[_0xc1c9('0x34')]);_0x7ee89a['attributes']=_['intersection'](_0x2112a1['model'],qs['fields'](_0x273dad['query'][_0xc1c9('0x3a')]));_0x7ee89a['attributes']=_0x7ee89a[_0xc1c9('0x39')]['length']?_0x7ee89a[_0xc1c9('0x39')]:_0x2112a1[_0xc1c9('0x38')];if(!_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x7ee89a[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x7ee89a[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x273dad['query'][_0xc1c9('0x23')]);}_0x7ee89a[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x273dad[_0xc1c9('0x34')]['sort']);_0x7ee89a[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x273dad[_0xc1c9('0x34')],_0x2112a1[_0xc1c9('0x36')]));_0x7ee89a[_0xc1c9('0x40')][_0xc1c9('0x5d')]=_0x2f50ee['id'];if(_0x273dad['query'][_0xc1c9('0x42')]){_0x7ee89a[_0xc1c9('0x40')]=_['merge'](_0x7ee89a[_0xc1c9('0x40')],{'$or':_['map'](_0x7ee89a[_0xc1c9('0x39')],function(_0x5d4194){var _0x1dcf2e={};_0x1dcf2e[_0x5d4194]={'$like':'%'+_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x1dcf2e;})});}_0x7ee89a=_[_0xc1c9('0x43')]({},_0x7ee89a,_0x273dad['options']);return db['Disposition'][_0xc1c9('0x45')]({'where':_0x7ee89a['where']})['then'](function(_0x4c4929){_0x24f511[_0xc1c9('0x45')]=_0x4c4929;if(_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x4b')]){_0x7ee89a[_0xc1c9('0x46')]=[{'all':!![]}];}return db[_0xc1c9('0x5a')][_0xc1c9('0x5e')](_0x7ee89a);})[_0xc1c9('0x2a')](function(_0x27277c){_0x24f511[_0xc1c9('0x47')]=_0x27277c;return _0x24f511;});}})[_0xc1c9('0x2a')](respondWithFilteredResult(_0x2a3394,_0x7ee89a))['catch'](handleError(_0x2a3394,null));};exports['removeDispositions']=function(_0x1a6c4b,_0x6d6e01,_0x4277ba){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x1a6c4b[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x6d6e01,null))[_0xc1c9('0x2a')](function(_0x1a7fd5){if(_0x1a7fd5){return _0x1a7fd5[_0xc1c9('0x5f')](_0x1a6c4b[_0xc1c9('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x6d6e01,null))[_0xc1c9('0x48')](handleError(_0x6d6e01,null));};exports[_0xc1c9('0x60')]=function(_0x5c9f9f,_0xa96d80,_0xc3457a){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x5c9f9f['params']['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0xa96d80,null))[_0xc1c9('0x2a')](function(_0x285e3b){if(_0x285e3b){var _0x1d07ec=[];var _0x3a9677={'success':[],'errors':[]};return db[_0xc1c9('0x61')][_0xc1c9('0x59')]()[_0xc1c9('0x2a')](function(_0xa8fbff){if(_0x5c9f9f[_0xc1c9('0x4e')]['tags']&&_[_0xc1c9('0x62')](_0x5c9f9f[_0xc1c9('0x4e')]['tags'])){if(_0x5c9f9f[_0xc1c9('0x4e')][_0xc1c9('0x63')][_0xc1c9('0x3b')]){_0x5c9f9f['body'][_0xc1c9('0x63')]=_0x5c9f9f[_0xc1c9('0x4e')]['tags']['join'](';')+';';}else{_0x5c9f9f[_0xc1c9('0x4e')]['tags']=null;}}else{_0x5c9f9f['body']['tags']=null;}if(_0x5c9f9f[_0xc1c9('0x4e')]&&_[_0xc1c9('0x62')](_0x5c9f9f[_0xc1c9('0x4e')])){for(var _0x1d8731=0x0;_0x1d8731<_0x5c9f9f['body'][_0xc1c9('0x3b')];_0x1d8731+=0x1){_0x5c9f9f[_0xc1c9('0x4e')][_0x1d8731][_0xc1c9('0x5d')]=_0x5c9f9f[_0xc1c9('0x4a')]['id'];_0x1d07ec[_0xc1c9('0x64')](_0x5c9f9f[_0xc1c9('0x4e')][_0x1d8731]);}return BPromise[_0xc1c9('0x65')](_0x1d07ec,function(_0x3b16a4){return db[_0xc1c9('0x61')][_0xc1c9('0x4d')](_[_0xc1c9('0x66')](_0x3b16a4,['ids','id'])||{},{'fields':_[_0xc1c9('0x35')](_0xa8fbff),'raw':!![]})[_0xc1c9('0x2a')](function(_0x477824){_0x3a9677['success'][_0xc1c9('0x64')](_0x477824[_0xc1c9('0x67')]);})[_0xc1c9('0x48')](function(_0x997218){_0x3a9677[_0xc1c9('0x68')][_0xc1c9('0x64')]({'data':_0x3b16a4,'error':_0x997218[_0xc1c9('0x69')]});});})[_0xc1c9('0x2a')](function(_0xaf2025){return _0x3a9677;})[_0xc1c9('0x48')](function(_0x1b7474){return _0x1b7474;});}else{_0xa96d80[_0xc1c9('0x20')](0x190)[_0xc1c9('0x22')]({'message':_0xc1c9('0x6a')});}});}})[_0xc1c9('0x2a')](respondWithResult(_0xa96d80,null))[_0xc1c9('0x48')](handleError(_0xa96d80,null));};exports[_0xc1c9('0x6b')]=function(_0x29c5ac,_0x265d97,_0x1eba49){var _0x23d9a1;return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x29c5ac['params']['id']},'include':[{'model':db[_0xc1c9('0x6c')],'as':_0xc1c9('0x6d')}]})['then'](handleEntityNotFound(_0x265d97,null))[_0xc1c9('0x2a')](function(_0x140f9c){if(_0x140f9c){_0x23d9a1=_0x140f9c;return db[_0xc1c9('0x61')][_0xc1c9('0x33')];}})[_0xc1c9('0x2a')](function(_0x42e884){if(_0x42e884){var _0x383a04={};var _0x22b42c={};_0x22b42c['model']=_[_0xc1c9('0x6e')](_[_0xc1c9('0x35')](_0x42e884),_['map'](_0x23d9a1[_0xc1c9('0x6d')],function(_0x2b570f){return util[_0xc1c9('0x6f')](_0xc1c9('0x70'),_0x2b570f['id']);}));_0x22b42c[_0xc1c9('0x34')]=_['keys'](_0x29c5ac[_0xc1c9('0x34')]);_0x22b42c[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x22b42c[_0xc1c9('0x38')],_0x22b42c['query']);_0x383a04[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0x22b42c[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x29c5ac['query']['fields']));_0x383a04[_0xc1c9('0x39')]=_0x383a04[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x383a04[_0xc1c9('0x39')]:_0x22b42c[_0xc1c9('0x38')];if(!_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x3c')]('nolimit')){_0x383a04[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x383a04[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x29c5ac['query'][_0xc1c9('0x23')]);}_0x383a04[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x29c5ac[_0xc1c9('0x34')]['sort']);_0x383a04[_0xc1c9('0x40')]=qs['filters'](_['pick'](_0x29c5ac['query'],_0x22b42c['filters']));_0x383a04[_0xc1c9('0x71')]=!![];if(_0x29c5ac['query'][_0xc1c9('0x42')]){_0x383a04[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x383a04[_0xc1c9('0x40')],{'$or':_[_0xc1c9('0x31')](_0x383a04[_0xc1c9('0x39')],function(_0x4b510d){var _0x1439ad={};_0x1439ad[_0x4b510d]={'$like':'%'+_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x1439ad;})});}_0x383a04=_['merge']({},_0x383a04,_0x29c5ac[_0xc1c9('0x44')]);return _0x23d9a1[_0xc1c9('0x6b')](_0x383a04);}})[_0xc1c9('0x2a')](respondWithResult(_0x265d97,null))['catch'](handleError(_0x265d97,null));};exports[_0xc1c9('0x72')]=function(_0x2394bc,_0x11c66f,_0x4af6d7){var _0x54449d;return db[_0xc1c9('0x32')]['find']({'where':{'id':_0x2394bc[_0xc1c9('0x4a')]['id']},'include':[{'model':db[_0xc1c9('0x6c')],'as':_0xc1c9('0x6d')}]})[_0xc1c9('0x2a')](handleEntityNotFound(_0x11c66f,null))['then'](function(_0x5e2f61){if(_0x5e2f61){_0x54449d=_0x5e2f61;return db['CmContact']['rawAttributes'];}})[_0xc1c9('0x2a')](function(_0x382038){if(_0x382038){var _0x288d97={};var _0x21f6d6={};_0x21f6d6[_0xc1c9('0x38')]=_[_0xc1c9('0x6e')](_[_0xc1c9('0x35')](_0x382038),_['map'](_0x54449d[_0xc1c9('0x6d')],function(_0x1adb43){return util['format']('cf_%d',_0x1adb43['id']);}));_0x21f6d6[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x2394bc['query']);_0x21f6d6[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x21f6d6[_0xc1c9('0x38')],_0x21f6d6['query']);_0x288d97['attributes']=_[_0xc1c9('0x37')](_0x21f6d6['model'],qs[_0xc1c9('0x3a')](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x288d97[_0xc1c9('0x39')]=_0x288d97[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x288d97[_0xc1c9('0x39')]:_0x21f6d6[_0xc1c9('0x38')];if(!_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x288d97['limit']=qs['limit'](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x288d97['offset']=qs['offset'](_0x2394bc['query']['offset']);}_0x288d97[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3f')]);_0x288d97[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x2394bc[_0xc1c9('0x34')],_0x21f6d6[_0xc1c9('0x36')]));_0x288d97['raw']=!![];if(_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x288d97[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x288d97['where'],{'$or':_[_0xc1c9('0x31')](_0x288d97[_0xc1c9('0x39')],function(_0x31ebb9){var _0xa5840c={};_0xa5840c[_0x31ebb9]={'$like':'%'+_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0xa5840c;})});}_0x288d97=_[_0xc1c9('0x43')]({},_0x288d97,_0x2394bc['options']);return _0x54449d['getContacts'](_0x288d97);}})['then'](function(_0x724de2){if(!_['isEmpty'](_0x724de2)){var _0x29023f=toCsv(_0x724de2);var _0x57d5d1=Date[_0xc1c9('0x73')]();fs['writeFileSync'](util[_0xc1c9('0x6f')](_0xc1c9('0x74'),_0x54449d['id'],_0x57d5d1),_0x29023f);_0x11c66f[_0xc1c9('0x75')](_0xc1c9('0x76'),_0xc1c9('0x77')+util[_0xc1c9('0x6f')](_0xc1c9('0x78'),_0x54449d['id'],_0x57d5d1));_0x11c66f['setHeader'](_0xc1c9('0x79'),_0xc1c9('0x7a'));return _0x11c66f[_0xc1c9('0x7b')](util[_0xc1c9('0x6f')](_0xc1c9('0x74'),_0x54449d['id'],_0x57d5d1));}else{return _0x11c66f[_0xc1c9('0x1f')](0xcc);}})[_0xc1c9('0x48')](handleError(_0x11c66f,null));};exports[_0xc1c9('0x7c')]=function(_0x1c5591,_0x2ef6af,_0x1057c5){var _0x28fff1;delete _0x1c5591[_0xc1c9('0x4e')]['id'];return db[_0xc1c9('0x32')]['findOne']({'where':{'id':_0x1c5591[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2ef6af,null))[_0xc1c9('0x2a')](function(_0x2300c2){if(_0x2300c2){return db[_0xc1c9('0x7d')]['transaction'](function(_0x80d35c){return db[_0xc1c9('0x6c')][_0xc1c9('0x4d')](_0x1c5591[_0xc1c9('0x4e')],{'transaction':_0x80d35c})[_0xc1c9('0x2a')](function(_0xa5d6c9){_0x28fff1=_0xa5d6c9;return _0x2300c2[_0xc1c9('0x7e')](_0xa5d6c9,{'transaction':_0x80d35c});})[_0xc1c9('0x2a')](function(){var _0x16b129={'type':db[_0xc1c9('0x7f')][_0xc1c9('0x80')],'transaction':_0x80d35c};switch(_0x1c5591[_0xc1c9('0x4e')][_0xc1c9('0x81')]){case _0xc1c9('0x82'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x80')];break;case _0xc1c9('0x83'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x84')];break;case _0xc1c9('0x85'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x86')];_0x16b129[_0xc1c9('0x87')]=![];break;default:}return db[_0xc1c9('0x7d')][_0xc1c9('0x88')][_0xc1c9('0x89')]('cm_contacts',util['format'](_0xc1c9('0x8a'),_0x28fff1['id']),_0x16b129);})[_0xc1c9('0x2a')](function(){return _0x28fff1;});});}})['then'](respondWithResult(_0x2ef6af,null))['catch'](handleError(_0x2ef6af,null));};exports['getCustomFields']=function(_0x3e3265,_0x2e2699,_0x578ff5){var _0x23054f={};var _0x1a0b88={};var _0x33f05b;var _0x1a5719;return db[_0xc1c9('0x32')][_0xc1c9('0x5c')]({'where':{'id':_0x3e3265[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2e2699,null))[_0xc1c9('0x2a')](function(_0x113cbd){if(_0x113cbd){_0x33f05b=_0x113cbd;_0x1a0b88[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x6c')][_0xc1c9('0x33')]);_0x1a0b88[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x3e3265[_0xc1c9('0x34')]);_0x1a0b88[_0xc1c9('0x36')]=_['intersection'](_0x1a0b88[_0xc1c9('0x38')],_0x1a0b88['query']);_0x23054f['attributes']=_[_0xc1c9('0x37')](_0x1a0b88['model'],qs[_0xc1c9('0x3a')](_0x3e3265[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x23054f[_0xc1c9('0x39')]=_0x23054f[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x23054f[_0xc1c9('0x39')]:_0x1a0b88[_0xc1c9('0x38')];_0x23054f[_0xc1c9('0x3e')]=qs['sort'](_0x3e3265['query']['sort']);_0x23054f[_0xc1c9('0x40')]=qs['filters'](_[_0xc1c9('0x41')](_0x3e3265['query'],_0x1a0b88['filters']));_0x23054f['where']=_[_0xc1c9('0x43')](_0x23054f['where'],{'$or':[{'ListId':_0x113cbd['id']},{'ListId':null}]});if(_0x3e3265[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x23054f[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x23054f['where'],{'$or':_[_0xc1c9('0x31')](_0x23054f[_0xc1c9('0x39')],function(_0x82d6e9){var _0xbe3529={};_0xbe3529[_0x82d6e9]={'$like':'%'+_0x3e3265['query']['filter']+'%'};return _0xbe3529;})});}_0x23054f=_['merge']({},_0x23054f,_0x3e3265[_0xc1c9('0x44')]);return db[_0xc1c9('0x6c')]['findAndCountAll'](_0x23054f);}})[_0xc1c9('0x2a')](respondWithResult(_0x2e2699,null))[_0xc1c9('0x48')](handleError(_0x2e2699,null));};exports[_0xc1c9('0x8b')]=function(_0x558231,_0x545673,_0x34dc1e){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x558231[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x545673,null))[_0xc1c9('0x2a')](function(_0x1df121){if(_0x1df121){return _0x1df121[_0xc1c9('0x8b')](_0x558231[_0xc1c9('0x4e')]['ids'],_[_0xc1c9('0x66')](_0x558231[_0xc1c9('0x4e')],[_0xc1c9('0x8c'),'id'])||{})[_0xc1c9('0x8d')](function(_0x336de8){for(var _0x2177f4=0x0;_0x2177f4<_0x558231[_0xc1c9('0x4e')][_0xc1c9('0x8c')][_0xc1c9('0x3b')];_0x2177f4+=0x1){socket['emit'](_0xc1c9('0x8e'),{'UserId':Number(_0x558231[_0xc1c9('0x4e')][_0xc1c9('0x8c')][_0x2177f4]),'CmListId':Number(_0x558231['params']['id'])});}return _0x336de8;});}})[_0xc1c9('0x2a')](respondWithResult(_0x545673,null))[_0xc1c9('0x48')](handleError(_0x545673,null));};exports[_0xc1c9('0x8f')]=function(_0x2951b4,_0x2453f2,_0x33a997){return db[_0xc1c9('0x32')]['find']({'where':{'id':_0x2951b4[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2453f2,null))['then'](function(_0x2df445){if(_0x2df445){return _0x2df445[_0xc1c9('0x8f')](_0x2951b4[_0xc1c9('0x34')]['ids'])['then'](function(){if(_[_0xc1c9('0x62')](_0x2951b4['query'][_0xc1c9('0x8c')])){for(var _0x4de038=0x0;_0x4de038<_0x2951b4[_0xc1c9('0x34')]['ids'][_0xc1c9('0x3b')];_0x4de038+=0x1){socket[_0xc1c9('0x90')]('userCmList:remove',{'UserId':Number(_0x2951b4[_0xc1c9('0x34')]['ids'][_0x4de038]),'CmListId':Number(_0x2951b4[_0xc1c9('0x4a')]['id'])});}}else{socket[_0xc1c9('0x90')](_0xc1c9('0x91'),{'UserId':Number(_0x2951b4[_0xc1c9('0x34')][_0xc1c9('0x8c')]),'CmListId':Number(_0x2951b4['params']['id'])});}});}})[_0xc1c9('0x2a')](respondWithStatusCode(_0x2453f2,null))[_0xc1c9('0x48')](handleError(_0x2453f2,null));};exports['getAgents']=function(_0x4f0ddd,_0x315060,_0x1c5d45){var _0x1c36e0={};var _0x144f61={};var _0x285cf9;var _0x61f690;return db['CmList'][_0xc1c9('0x5c')]({'where':{'id':_0x4f0ddd[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x315060,null))[_0xc1c9('0x2a')](function(_0x45510e){if(_0x45510e){_0x285cf9=_0x45510e;_0x144f61[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x92')][_0xc1c9('0x33')]);_0x144f61[_0xc1c9('0x34')]=_['keys'](_0x4f0ddd[_0xc1c9('0x34')]);_0x144f61[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x144f61[_0xc1c9('0x38')],_0x144f61[_0xc1c9('0x34')]);_0x1c36e0[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0x144f61[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x4f0ddd['query'][_0xc1c9('0x3a')]));_0x1c36e0[_0xc1c9('0x39')]=_0x1c36e0[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x1c36e0[_0xc1c9('0x39')]:_0x144f61['model'];_0x1c36e0[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x3f')]);_0x1c36e0[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x4f0ddd[_0xc1c9('0x34')],_0x144f61[_0xc1c9('0x36')]));if(_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x1c36e0[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x1c36e0[_0xc1c9('0x40')],{'$or':_[_0xc1c9('0x31')](_0x1c36e0[_0xc1c9('0x39')],function(_0x364eba){var _0x591858={};_0x591858[_0x364eba]={'$like':'%'+_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x591858;})});}_0x1c36e0=_[_0xc1c9('0x43')]({},_0x1c36e0,_0x4f0ddd['options']);return _0x285cf9[_0xc1c9('0x93')](_0x1c36e0);}})[_0xc1c9('0x2a')](function(_0x4d01e3){if(_0x4d01e3){_0x61f690=_0x4d01e3['length'];if(!_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x1c36e0[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x1c36e0[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x4f0ddd['query'][_0xc1c9('0x23')]);}return _0x285cf9['getAgents'](_0x1c36e0);}})[_0xc1c9('0x2a')](function(_0x599477){if(_0x599477){return _0x599477?{'count':_0x61f690,'rows':_0x599477}:null;}})[_0xc1c9('0x2a')](respondWithResult(_0x315060,null))[_0xc1c9('0x48')](handleError(_0x315060,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4b1d74c..9e76ea4 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'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 +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x55ca,0x126));var _0xa55c=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x55ca[_0x22093a];return _0x2f4989;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 7b2221a..a8837ed 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x3e877e,_0x57f1c0){var _0x17d0c1=function(_0x4ba3ca){while(--_0x4ba3ca){_0x3e877e['push'](_0x3e877e['shift']());}};_0x17d0c1(++_0x57f1c0);}(_0x54ef,0x112));var _0xf54e=function(_0x1f0a60,_0x5bf73b){_0x1f0a60=_0x1f0a60-0x0;var _0x3390c0=_0x54ef[_0x1f0a60];return _0x3390c0;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x17a399,_0x59ee9a){var _0x103f1e=function(_0x2a5be3){while(--_0x2a5be3){_0x17a399['push'](_0x17a399['shift']());}};_0x103f1e(++_0x59ee9a);}(_0xf109,0xce));var _0x9f10=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xf109[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index cac78c0..0fdad84 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 _0x0972=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0972,0x9b));var _0x2097=function(_0x113173,_0x57f2e3){_0x113173=_0x113173-0x0;var _0x4deafd=_0x0972[_0x113173];return _0x4deafd;};'use strict';var _=require(_0x2097('0x0'));var util=require(_0x2097('0x1'));var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var rs=require(_0x2097('0x4'));var fs=require('fs');var Redis=require(_0x2097('0x5'));var db=require(_0x2097('0x6'))['db'];var utils=require(_0x2097('0x7'));var logger=require('../../config/logger')(_0x2097('0x8'));var config=require(_0x2097('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2097('0xa')]['http']({'port':0x232a});config[_0x2097('0xb')]=_[_0x2097('0xc')](config[_0x2097('0xb')],{'host':_0x2097('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2097('0xb')]));require('./cmList.socket')[_0x2097('0xe')](socket);function respondWithRpcPromise(_0x2b3a83,_0x499d7a,_0x3f0e3e){return new BPromise(function(_0xc1a3a6,_0x4d6b70){return client['request'](_0x2b3a83,_0x3f0e3e)[_0x2097('0xf')](function(_0x4baa9c){logger[_0x2097('0x10')](_0x2097('0x11'),_0x499d7a,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x499d7a,_0x2097('0x12'),JSON['stringify'](_0x4baa9c));if(_0x4baa9c[_0x2097('0x15')]){if(_0x4baa9c[_0x2097('0x15')][_0x2097('0x16')]===0x1f4){logger[_0x2097('0x15')]('CmList,\x20%s,\x20%s',_0x499d7a,_0x4baa9c[_0x2097('0x15')]['message']);return _0x4d6b70(_0x4baa9c['error'][_0x2097('0x17')]);}logger[_0x2097('0x15')]('CmList,\x20%s,\x20%s',_0x499d7a,_0x4baa9c[_0x2097('0x15')][_0x2097('0x17')]);return _0xc1a3a6(_0x4baa9c[_0x2097('0x15')][_0x2097('0x17')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x499d7a,_0x2097('0x12'));_0xc1a3a6(_0x4baa9c[_0x2097('0x18')][_0x2097('0x17')]);}})[_0x2097('0x19')](function(_0x5e567c){logger[_0x2097('0x15')](_0x2097('0x11'),_0x499d7a,_0x5e567c);_0x4d6b70(_0x5e567c);});});} \ No newline at end of file +var _0xb55a=['./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb55a,0x112));var _0xab55=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb55a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xab55('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xab55('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab55('0x2'));var logger=require(_0xab55('0x3'))(_0xab55('0x4'));var config=require(_0xab55('0x5'));var jayson=require(_0xab55('0x6'));var client=jayson[_0xab55('0x7')][_0xab55('0x8')]({'port':0x232a});config[_0xab55('0x9')]=_[_0xab55('0xa')](config['redis'],{'host':_0xab55('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xab55('0xc'))[_0xab55('0xd')](socket);function respondWithRpcPromise(_0x352d02,_0x579417,_0x2c6e2d){return new BPromise(function(_0x227d05,_0x89ef96){return client[_0xab55('0xe')](_0x352d02,_0x2c6e2d)[_0xab55('0xf')](function(_0x3ab630){logger[_0xab55('0x10')](_0xab55('0x11'),_0x579417,_0xab55('0x12'));logger[_0xab55('0x13')](_0xab55('0x14'),_0x579417,_0xab55('0x12'),JSON[_0xab55('0x15')](_0x3ab630));if(_0x3ab630[_0xab55('0x16')]){if(_0x3ab630[_0xab55('0x16')][_0xab55('0x17')]===0x1f4){logger[_0xab55('0x16')](_0xab55('0x11'),_0x579417,_0x3ab630[_0xab55('0x16')]['message']);return _0x89ef96(_0x3ab630[_0xab55('0x16')][_0xab55('0x18')]);}logger[_0xab55('0x16')](_0xab55('0x11'),_0x579417,_0x3ab630[_0xab55('0x16')]['message']);return _0x227d05(_0x3ab630[_0xab55('0x16')]['message']);}else{logger[_0xab55('0x10')](_0xab55('0x11'),_0x579417,_0xab55('0x12'));_0x227d05(_0x3ab630[_0xab55('0x19')][_0xab55('0x18')]);}})['catch'](function(_0x91a7e7){logger[_0xab55('0x16')](_0xab55('0x11'),_0x579417,_0x91a7e7);_0x89ef96(_0x91a7e7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 58454b2..bad77b4 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 _0x5292=['cmList:','./cmList.events','remove','update','removeListener','length'];(function(_0x275d8c,_0x3990cb){var _0x13baea=function(_0xd9e511){while(--_0xd9e511){_0x275d8c['push'](_0x275d8c['shift']());}};_0x13baea(++_0x3990cb);}(_0x5292,0xd3));var _0x2529=function(_0x1833cd,_0x369128){_0x1833cd=_0x1833cd-0x0;var _0x4360ac=_0x5292[_0x1833cd];return _0x4360ac;};'use strict';var CmListEvents=require(_0x2529('0x0'));var events=['save',_0x2529('0x1'),_0x2529('0x2')];function createListener(_0x3fe90d,_0x51c3ea){return function(_0x51b5fb){_0x51c3ea['emit'](_0x3fe90d,_0x51b5fb);};}function removeListener(_0x555728,_0x24399f){return function(){CmListEvents[_0x2529('0x3')](_0x555728,_0x24399f);};}exports['register']=function(_0x5ab567){for(var _0x2165ea=0x0,_0x1a5a3b=events[_0x2529('0x4')];_0x2165ea<_0x1a5a3b;_0x2165ea++){var _0xae44a5=events[_0x2165ea];var _0x266e9a=createListener(_0x2529('0x5')+_0xae44a5,_0x5ab567);CmListEvents['on'](_0xae44a5,_0x266e9a);}}; \ No newline at end of file +var _0x053a=['register','cmList:','./cmList.events','remove','emit','removeListener'];(function(_0x16fcfe,_0x33051f){var _0xb7c146=function(_0x45a779){while(--_0x45a779){_0x16fcfe['push'](_0x16fcfe['shift']());}};_0xb7c146(++_0x33051f);}(_0x053a,0x1ee));var _0xa053=function(_0x3a0775,_0x1b243c){_0x3a0775=_0x3a0775-0x0;var _0x5a3967=_0x053a[_0x3a0775];return _0x5a3967;};'use strict';var CmListEvents=require(_0xa053('0x0'));var events=['save',_0xa053('0x1'),'update'];function createListener(_0x4d5541,_0x2683a7){return function(_0x5d37a5){_0x2683a7[_0xa053('0x2')](_0x4d5541,_0x5d37a5);};}function removeListener(_0x388115,_0x3e2ea5){return function(){CmListEvents[_0xa053('0x3')](_0x388115,_0x3e2ea5);};}exports[_0xa053('0x4')]=function(_0x5543ee){for(var _0x4af515=0x0,_0x4f8696=events['length'];_0x4af515<_0x4f8696;_0x4af515++){var _0x581689=events[_0x4af515];var _0xae97e4=createListener(_0xa053('0x5')+_0x581689,_0x5543ee);CmListEvents['on'](_0x581689,_0xae97e4);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2ff95c5..8797b29 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 _0x761a=['/:id/users','post','create','/:id/dispositions','addDisposition','/:id/contacts','/:id/fields','addCustomField','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmList.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x761a,0x1b2));var _0xa761=function(_0x1e0d28,_0x2fd761){_0x1e0d28=_0x1e0d28-0x0;var _0x3defa3=_0x761a[_0x1e0d28];return _0x3defa3;};'use strict';var multer=require(_0xa761('0x0'));var util=require(_0xa761('0x1'));var path=require(_0xa761('0x2'));var timeout=require(_0xa761('0x3'));var express=require(_0xa761('0x4'));var router=express[_0xa761('0x5')]();var fs_extra=require(_0xa761('0x6'));var auth=require(_0xa761('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa761('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa761('0x9')]);router[_0xa761('0xa')](_0xa761('0xb'),auth[_0xa761('0xc')](),controller[_0xa761('0xd')]);router[_0xa761('0xa')](_0xa761('0xe'),auth[_0xa761('0xc')](),controller[_0xa761('0xf')]);router[_0xa761('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa761('0x10')]);router[_0xa761('0xa')]('/:id/contacts',auth[_0xa761('0xc')](),controller[_0xa761('0x11')]);router[_0xa761('0xa')](_0xa761('0x12'),auth[_0xa761('0xc')](),controller[_0xa761('0x13')]);router[_0xa761('0xa')]('/:id/fields',auth[_0xa761('0xc')](),controller[_0xa761('0x14')]);router[_0xa761('0xa')](_0xa761('0x15'),auth[_0xa761('0xc')](),controller['getAgents']);router[_0xa761('0x16')]('/',auth[_0xa761('0xc')](),controller[_0xa761('0x17')]);router[_0xa761('0x16')](_0xa761('0x18'),auth[_0xa761('0xc')](),controller[_0xa761('0x19')]);router[_0xa761('0x16')](_0xa761('0x1a'),auth[_0xa761('0xc')](),controller['addContacts']);router[_0xa761('0x16')](_0xa761('0x1b'),auth[_0xa761('0xc')](),controller[_0xa761('0x1c')]);router[_0xa761('0x16')](_0xa761('0x15'),auth[_0xa761('0xc')](),controller[_0xa761('0x1d')]);router[_0xa761('0x1e')](_0xa761('0xe'),auth['isAuthenticated'](),controller[_0xa761('0x1f')]);router[_0xa761('0x20')](_0xa761('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xa761('0x20')]('/:id/dispositions',auth[_0xa761('0xc')](),controller[_0xa761('0x21')]);router[_0xa761('0x20')](_0xa761('0x15'),auth[_0xa761('0xc')](),controller['removeAgents']);module[_0xa761('0x22')]=router; \ No newline at end of file +var _0xa4d4=['addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','create','post'];(function(_0x29b929,_0x2a4b10){var _0x3a8ce6=function(_0x1e2759){while(--_0x1e2759){_0x29b929['push'](_0x29b929['shift']());}};_0x3a8ce6(++_0x2a4b10);}(_0xa4d4,0x1ad));var _0x4a4d=function(_0x3059ee,_0x328803){_0x3059ee=_0x3059ee-0x0;var _0x2b8aa0=_0xa4d4[_0x3059ee];return _0x2b8aa0;};'use strict';var multer=require(_0x4a4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a4d('0x1'));var express=require(_0x4a4d('0x2'));var router=express['Router']();var fs_extra=require(_0x4a4d('0x3'));var auth=require(_0x4a4d('0x4'));var interaction=require(_0x4a4d('0x5'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x7')]);router[_0x4a4d('0x8')]('/describe',auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x9')]);router[_0x4a4d('0x8')](_0x4a4d('0xa'),auth[_0x4a4d('0x6')](),controller['show']);router['get'](_0x4a4d('0xb'),auth[_0x4a4d('0x6')](),controller[_0x4a4d('0xc')]);router[_0x4a4d('0x8')](_0x4a4d('0xd'),auth[_0x4a4d('0x6')](),controller[_0x4a4d('0xe')]);router[_0x4a4d('0x8')](_0x4a4d('0xf'),auth['isAuthenticated'](),controller[_0x4a4d('0x10')]);router[_0x4a4d('0x8')](_0x4a4d('0x11'),auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x12')]);router[_0x4a4d('0x8')]('/:id/users',auth[_0x4a4d('0x6')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x4a4d('0x13')]);router[_0x4a4d('0x14')](_0x4a4d('0xb'),auth[_0x4a4d('0x6')](),controller['addDisposition']);router[_0x4a4d('0x14')](_0x4a4d('0xd'),auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x15')]);router[_0x4a4d('0x14')]('/:id/fields',auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x16')]);router[_0x4a4d('0x14')]('/:id/users',auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x17')]);router[_0x4a4d('0x18')](_0x4a4d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4a4d('0x19')](_0x4a4d('0xa'),auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x1a')]);router[_0x4a4d('0x19')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4a4d('0x1b')]);router['delete']('/:id/users',auth[_0x4a4d('0x6')](),controller[_0x4a4d('0x1c')]);module[_0x4a4d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index f800de9..9600c47 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 _0x1283=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x2cfe89,_0xe3059){var _0xfc4ce6=function(_0x16dd78){while(--_0x16dd78){_0x2cfe89['push'](_0x2cfe89['shift']());}};_0xfc4ce6(++_0xe3059);}(_0x1283,0xbc));var _0x3128=function(_0xe9c8e4,_0x3aa2f6){_0xe9c8e4=_0xe9c8e4-0x0;var _0x2037fa=_0x1283[_0xe9c8e4];return _0x2037fa;};'use strict';var Sequelize=require(_0x3128('0x0'));module[_0x3128('0x1')]={'name':{'type':Sequelize[_0x3128('0x2')],'get':function(_0x43d657){return this['getDataValue'](_0x3128('0x3'));}},'field':{'type':Sequelize[_0x3128('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x3128('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x15a7=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x140fc9,_0x264fbe){var _0x30c32d=function(_0x2df097){while(--_0x2df097){_0x140fc9['push'](_0x140fc9['shift']());}};_0x30c32d(++_0x264fbe);}(_0x15a7,0x93));var _0x715a=function(_0xcd6aec,_0x2bfb6b){_0xcd6aec=_0xcd6aec-0x0;var _0xb36942=_0x15a7[_0xcd6aec];return _0xb36942;};'use strict';var Sequelize=require(_0x715a('0x0'));module[_0x715a('0x1')]={'name':{'type':Sequelize[_0x715a('0x2')],'get':function(_0x4f75a5){return this['getDataValue'](_0x715a('0x3'));}},'field':{'type':Sequelize[_0x715a('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x715a('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x715a('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 37d8c8a..4ba378a 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(_0x57143c,_0x1c9375){var _0x351b13=function(_0xb60f36){while(--_0xb60f36){_0x57143c['push'](_0x57143c['shift']());}};_0x351b13(++_0x1c9375);}(_0x7a54,0x106));var _0x47a5=function(_0x28d216,_0x212e68){_0x28d216=_0x28d216-0x0;var _0xef0027=_0x7a54[_0x28d216];return _0xef0027;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x26fdbd,_0x4377f2){var _0x3de333=function(_0x112169){while(--_0x112169){_0x26fdbd['push'](_0x26fdbd['shift']());}};_0x3de333(++_0x4377f2);}(_0x7a54,0x106));var _0x47a5=function(_0x119d29,_0x4b50d7){_0x119d29=_0x119d29-0x0;var _0x34e8f0=_0x7a54[_0x119d29];return _0x34e8f0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 325c0ec..e3f350a 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 _0x7e5b=['path','rimraf','../../config/environment','exports','Condition','lodash','api','moment','bluebird','request-promise'];(function(_0x652aaf,_0x517d84){var _0x285c4f=function(_0x226b8e){while(--_0x226b8e){_0x652aaf['push'](_0x652aaf['shift']());}};_0x285c4f(++_0x517d84);}(_0x7e5b,0xd7));var _0xb7e5=function(_0x4f0b54,_0x301666){_0x4f0b54=_0x4f0b54-0x0;var _0x3e2440=_0x7e5b[_0x4f0b54];return _0x3e2440;};'use strict';var _=require(_0xb7e5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb7e5('0x1'));var moment=require(_0xb7e5('0x2'));var BPromise=require(_0xb7e5('0x3'));var rp=require(_0xb7e5('0x4'));var fs=require('fs');var path=require(_0xb7e5('0x5'));var rimraf=require(_0xb7e5('0x6'));var config=require(_0xb7e5('0x7'));var attributes=require('./condition.attributes');module[_0xb7e5('0x8')]=function(_0x4f70fe,_0x4d47c4){return _0x4f70fe['define'](_0xb7e5('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b78=['rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6b78,0x13a));var _0x86b7=function(_0x2de1af,_0x5e3e2f){_0x2de1af=_0x2de1af-0x0;var _0x11bba1=_0x6b78[_0x2de1af];return _0x11bba1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x86b7('0x0'))(_0x86b7('0x1'));var moment=require('moment');var BPromise=require(_0x86b7('0x2'));var rp=require(_0x86b7('0x3'));var fs=require('fs');var path=require(_0x86b7('0x4'));var rimraf=require(_0x86b7('0x5'));var config=require(_0x86b7('0x6'));var attributes=require(_0x86b7('0x7'));module[_0x86b7('0x8')]=function(_0x4f851f,_0x6229a){return _0x4f851f['define'](_0x86b7('0x9'),attributes,{'tableName':_0x86b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index b451a86..128e90e 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 _0xa2ab=['debug','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0xf517c7,_0xc6712c){var _0xc0e14d=function(_0x1af3f4){while(--_0x1af3f4){_0xf517c7['push'](_0xf517c7['shift']());}};_0xc0e14d(++_0xc6712c);}(_0xa2ab,0x166));var _0xba2a=function(_0x3b58c9,_0x1f46c3){_0x3b58c9=_0x3b58c9-0x0;var _0x5b653a=_0xa2ab[_0x3b58c9];return _0x5b653a;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var BPromise=require(_0xba2a('0x3'));var rs=require(_0xba2a('0x4'));var fs=require('fs');var Redis=require(_0xba2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba2a('0x6'));var logger=require(_0xba2a('0x7'))('rpc');var config=require(_0xba2a('0x8'));var jayson=require(_0xba2a('0x9'));var client=jayson[_0xba2a('0xa')][_0xba2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da5c8,_0x2d7664,_0x479335){return new BPromise(function(_0x4e7873,_0x2875b7){return client[_0xba2a('0xc')](_0x4da5c8,_0x479335)[_0xba2a('0xd')](function(_0x31b1c1){logger['info'](_0xba2a('0xe'),_0x2d7664,_0xba2a('0xf'));logger[_0xba2a('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x2d7664,_0xba2a('0xf'),JSON['stringify'](_0x31b1c1));if(_0x31b1c1[_0xba2a('0x11')]){if(_0x31b1c1['error'][_0xba2a('0x12')]===0x1f4){logger[_0xba2a('0x11')](_0xba2a('0xe'),_0x2d7664,_0x31b1c1[_0xba2a('0x11')]['message']);return _0x2875b7(_0x31b1c1[_0xba2a('0x11')]['message']);}logger[_0xba2a('0x11')](_0xba2a('0xe'),_0x2d7664,_0x31b1c1['error']['message']);return _0x4e7873(_0x31b1c1['error'][_0xba2a('0x13')]);}else{logger[_0xba2a('0x14')](_0xba2a('0xe'),_0x2d7664,_0xba2a('0xf'));_0x4e7873(_0x31b1c1['result'][_0xba2a('0x13')]);}})[_0xba2a('0x15')](function(_0x1ef449){logger[_0xba2a('0x11')]('Condition,\x20%s,\x20%s',_0x2d7664,_0x1ef449);_0x2875b7(_0x1ef449);});});} \ No newline at end of file +var _0x2341=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x324781,_0x525358){var _0xecb472=function(_0x250763){while(--_0x250763){_0x324781['push'](_0x324781['shift']());}};_0xecb472(++_0x525358);}(_0x2341,0xa4));var _0x1234=function(_0x3d609e,_0x38e801){_0x3d609e=_0x3d609e-0x0;var _0x2eecf8=_0x2341[_0x3d609e];return _0x2eecf8;};'use strict';var _=require(_0x1234('0x0'));var util=require('util');var moment=require(_0x1234('0x1'));var BPromise=require(_0x1234('0x2'));var rs=require(_0x1234('0x3'));var fs=require('fs');var Redis=require(_0x1234('0x4'));var db=require(_0x1234('0x5'))['db'];var utils=require(_0x1234('0x6'));var logger=require('../../config/logger')(_0x1234('0x7'));var config=require(_0x1234('0x8'));var jayson=require(_0x1234('0x9'));var client=jayson[_0x1234('0xa')][_0x1234('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11a1bb,_0xa08483,_0x59deec){return new BPromise(function(_0x1e920b,_0x2d3a19){return client['request'](_0x11a1bb,_0x59deec)[_0x1234('0xc')](function(_0x23b9a5){logger[_0x1234('0xd')](_0x1234('0xe'),_0xa08483,_0x1234('0xf'));logger[_0x1234('0x10')](_0x1234('0x11'),_0xa08483,_0x1234('0xf'),JSON['stringify'](_0x23b9a5));if(_0x23b9a5[_0x1234('0x12')]){if(_0x23b9a5[_0x1234('0x12')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0xa08483,_0x23b9a5[_0x1234('0x12')]['message']);return _0x2d3a19(_0x23b9a5['error'][_0x1234('0x13')]);}logger[_0x1234('0x12')]('Condition,\x20%s,\x20%s',_0xa08483,_0x23b9a5[_0x1234('0x12')][_0x1234('0x13')]);return _0x1e920b(_0x23b9a5['error']['message']);}else{logger[_0x1234('0xd')]('Condition,\x20%s,\x20%s',_0xa08483,_0x1234('0xf'));_0x1e920b(_0x23b9a5['result']['message']);}})[_0x1234('0x14')](function(_0x4769cf){logger[_0x1234('0x12')](_0x1234('0xe'),_0xa08483,_0x4769cf);_0x2d3a19(_0x4769cf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 248936c..d010946 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 _0xbac7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0xbac7,0xb2));var _0x7bac=function(_0x1ca59a,_0x618f37){_0x1ca59a=_0x1ca59a-0x0;var _0x5f47c2=_0xbac7[_0x1ca59a];return _0x5f47c2;};'use strict';var multer=require(_0x7bac('0x0'));var util=require(_0x7bac('0x1'));var path=require(_0x7bac('0x2'));var timeout=require(_0x7bac('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7bac('0x4'));var interaction=require(_0x7bac('0x5'));var config=require(_0x7bac('0x6'));var controller=require(_0x7bac('0x7'));router['put'](_0x7bac('0x8'),auth[_0x7bac('0x9')](),controller[_0x7bac('0xa')]);router['delete'](_0x7bac('0x8'),auth['isAuthenticated'](),controller[_0x7bac('0xb')]);module[_0x7bac('0xc')]=router; \ No newline at end of file +var _0xd476=['./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d13d5,_0x12ef9e){var _0x2ab34a=function(_0x372ac2){while(--_0x372ac2){_0x4d13d5['push'](_0x4d13d5['shift']());}};_0x2ab34a(++_0x12ef9e);}(_0xd476,0x181));var _0x6d47=function(_0x33c4bf,_0x1a418d){_0x33c4bf=_0x33c4bf-0x0;var _0x2f9d27=_0xd476[_0x33c4bf];return _0x2f9d27;};'use strict';var multer=require(_0x6d47('0x0'));var util=require(_0x6d47('0x1'));var path=require(_0x6d47('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d47('0x3')]();var fs_extra=require(_0x6d47('0x4'));var auth=require(_0x6d47('0x5'));var interaction=require(_0x6d47('0x6'));var config=require('../../config/environment');var controller=require(_0x6d47('0x7'));router[_0x6d47('0x8')](_0x6d47('0x9'),auth[_0x6d47('0xa')](),controller[_0x6d47('0xb')]);router[_0x6d47('0xc')](_0x6d47('0x9'),auth['isAuthenticated'](),controller[_0x6d47('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 91c5cf8..8004858 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(_0x1f5d6c,_0x4840ee){var _0x2ed906=function(_0x4640a7){while(--_0x4640a7){_0x1f5d6c['push'](_0x1f5d6c['shift']());}};_0x2ed906(++_0x4840ee);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a8396,_0x280126){_0x1a8396=_0x1a8396-0x0;var _0x29ce3=_0xb10b[_0x1a8396];return _0x29ce3;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb7e7[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b9f7182..2c1fa79 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 _0x47c0=['attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','UserProfileResource','end','stack','name','send','index','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','userProfileId','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x47c0,0x99));var _0x047c=function(_0x3fa5e4,_0x33a68a){_0x3fa5e4=_0x3fa5e4-0x0;var _0x1bf5b1=_0x47c0[_0x3fa5e4];return _0x1bf5b1;};'use strict';var emlformat=require(_0x047c('0x0'));var rimraf=require(_0x047c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x047c('0x2'));var rp=require(_0x047c('0x3'));var moment=require(_0x047c('0x4'));var BPromise=require(_0x047c('0x5'));var Mustache=require(_0x047c('0x6'));var util=require(_0x047c('0x7'));var path=require(_0x047c('0x8'));var sox=require('sox');var csv=require(_0x047c('0x9'));var ejs=require(_0x047c('0xa'));var fs=require('fs');var fs_extra=require(_0x047c('0xb'));var _=require(_0x047c('0xc'));var squel=require(_0x047c('0xd'));var crypto=require(_0x047c('0xe'));var jsforce=require(_0x047c('0xf'));var deskjs=require(_0x047c('0x10'));var toCsv=require(_0x047c('0x9'));var querystring=require(_0x047c('0x11'));var Papa=require('papaparse');var Redis=require(_0x047c('0x12'));var authService=require(_0x047c('0x13'));var qs=require(_0x047c('0x14'));var as=require(_0x047c('0x15'));var hardwareService=require(_0x047c('0x16'));var logger=require(_0x047c('0x17'))(_0x047c('0x18'));var utils=require(_0x047c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x047c('0x1a'));var db=require(_0x047c('0x1b'))['db'];config['redis']=_['defaults'](config[_0x047c('0x1c')],{'host':_0x047c('0x1d'),'port':0x18eb});var socket=require(_0x047c('0x1e'))(new Redis(config[_0x047c('0x1c')]));require(_0x047c('0x1f'))[_0x047c('0x20')](socket);function respondWithStatusCode(_0x13ca36,_0x255aa2){_0x255aa2=_0x255aa2||0xcc;return function(_0x52b62b){if(_0x52b62b){return _0x13ca36['sendStatus'](_0x255aa2);}return _0x13ca36[_0x047c('0x21')](_0x255aa2)['end']();};}function respondWithResult(_0x30b35e,_0x308a67){_0x308a67=_0x308a67||0xc8;return function(_0x44df24){if(_0x44df24){return _0x30b35e[_0x047c('0x21')](_0x308a67)[_0x047c('0x22')](_0x44df24);}};}function respondWithFilteredResult(_0x464b91,_0x3039d8){return function(_0x549119){if(_0x549119){var _0x1f7278=typeof _0x3039d8[_0x047c('0x23')]===_0x047c('0x24')&&typeof _0x3039d8[_0x047c('0x25')]===_0x047c('0x24');var _0x4fcae4=_0x549119[_0x047c('0x26')];var _0x3231fd=_0x1f7278?0x0:_0x3039d8[_0x047c('0x23')];var _0x5ee2fd=_0x1f7278?_0x549119[_0x047c('0x26')]:_0x3039d8[_0x047c('0x23')]+_0x3039d8[_0x047c('0x25')];var _0x516973;if(_0x5ee2fd>=_0x4fcae4){_0x5ee2fd=_0x4fcae4;_0x516973=0xc8;}else{_0x516973=0xce;}_0x464b91[_0x047c('0x21')](_0x516973);return _0x464b91[_0x047c('0x27')]('Content-Range',_0x3231fd+'-'+_0x5ee2fd+'/'+_0x4fcae4)[_0x047c('0x22')](_0x549119);}return null;};}function patchUpdates(_0x2d1a64){return function(_0x117b3b){try{jsonpatch[_0x047c('0x28')](_0x117b3b,_0x2d1a64,!![]);}catch(_0x1ac411){return BPromise['reject'](_0x1ac411);}return _0x117b3b[_0x047c('0x29')]();};}function saveUpdates(_0x5ca5f2,_0x40b7a4){return function(_0x244b5b){if(_0x244b5b){return _0x244b5b[_0x047c('0x2a')](_0x5ca5f2)['then'](function(_0x5b9738){return _0x5b9738;});}return null;};}function removeEntity(_0x2ebaff,_0xbb6ca4){return function(_0x4f3287){if(_0x4f3287){return _0x4f3287[_0x047c('0x2b')]()[_0x047c('0x2c')](function(){var _0xa3c805=_0x4f3287['get']({'plain':!![]});var _0x476ab7='CustomDashboards';return db[_0x047c('0x2d')]['destroy']({'where':{'type':_0x476ab7,'resourceId':_0xa3c805['id']}})[_0x047c('0x2c')](function(){return _0x4f3287;});})[_0x047c('0x2c')](function(){_0x2ebaff[_0x047c('0x21')](0xcc)[_0x047c('0x2e')]();});}};}function handleEntityNotFound(_0x8799a,_0x995ff6){return function(_0x35eeb4){if(!_0x35eeb4){_0x8799a['sendStatus'](0x194);}return _0x35eeb4;};}function handleError(_0x1c6a8f,_0x4c7ef3){_0x4c7ef3=_0x4c7ef3||0x1f4;return function(_0x26b947){logger['error'](_0x26b947[_0x047c('0x2f')]);if(_0x26b947[_0x047c('0x30')]){delete _0x26b947[_0x047c('0x30')];}_0x1c6a8f[_0x047c('0x21')](_0x4c7ef3)[_0x047c('0x31')](_0x26b947);};}exports[_0x047c('0x32')]=function(_0x1b78b6,_0x13dfb4){var _0x397df={},_0x49911b={},_0x182482={'count':0x0,'rows':[]};var _0x351daa=_['map'](db[_0x047c('0x33')][_0x047c('0x34')],function(_0x3b7c26){return{'name':_0x3b7c26[_0x047c('0x35')],'type':_0x3b7c26['type'][_0x047c('0x36')]};});_0x49911b[_0x047c('0x37')]=_['map'](_0x351daa,_0x047c('0x30'));_0x49911b[_0x047c('0x38')]=_[_0x047c('0x39')](_0x1b78b6[_0x047c('0x38')]);_0x49911b[_0x047c('0x3a')]=_[_0x047c('0x3b')](_0x49911b[_0x047c('0x37')],_0x49911b[_0x047c('0x38')]);_0x397df['attributes']=_[_0x047c('0x3b')](_0x49911b[_0x047c('0x37')],qs[_0x047c('0x3c')](_0x1b78b6['query'][_0x047c('0x3c')]));_0x397df[_0x047c('0x3d')]=_0x397df['attributes'][_0x047c('0x3e')]?_0x397df[_0x047c('0x3d')]:_0x49911b[_0x047c('0x37')];if(!_0x1b78b6[_0x047c('0x38')][_0x047c('0x3f')](_0x047c('0x40'))){_0x397df[_0x047c('0x25')]=qs[_0x047c('0x25')](_0x1b78b6['query'][_0x047c('0x25')]);_0x397df[_0x047c('0x23')]=qs[_0x047c('0x23')](_0x1b78b6[_0x047c('0x38')][_0x047c('0x23')]);}_0x397df[_0x047c('0x41')]=qs[_0x047c('0x42')](_0x1b78b6[_0x047c('0x38')][_0x047c('0x42')]);_0x397df[_0x047c('0x43')]=qs[_0x047c('0x3a')](_[_0x047c('0x44')](_0x1b78b6[_0x047c('0x38')],_0x49911b['filters']),_0x351daa);if(_0x1b78b6[_0x047c('0x38')][_0x047c('0x45')]){_0x397df['where']=_[_0x047c('0x46')](_0x397df['where'],{'$or':_[_0x047c('0x47')](_0x351daa,function(_0x4cc0e7){if(_0x4cc0e7[_0x047c('0x48')]!==_0x047c('0x49')){var _0x6c9f92={};_0x6c9f92[_0x4cc0e7[_0x047c('0x30')]]={'$like':'%'+_0x1b78b6[_0x047c('0x38')][_0x047c('0x45')]+'%'};return _0x6c9f92;}})});}_0x397df=_[_0x047c('0x46')]({},_0x397df,_0x1b78b6[_0x047c('0x4a')]);var _0x113297={'where':_0x397df[_0x047c('0x43')]};return db[_0x047c('0x33')]['count'](_0x113297)[_0x047c('0x2c')](function(_0x4a6b95){_0x182482[_0x047c('0x26')]=_0x4a6b95;if(_0x1b78b6[_0x047c('0x38')][_0x047c('0x4b')]){_0x397df[_0x047c('0x4c')]=[{'all':!![]}];}return db[_0x047c('0x33')][_0x047c('0x4d')](_0x397df);})[_0x047c('0x2c')](function(_0x58aee1){_0x182482[_0x047c('0x4e')]=_0x58aee1;return _0x182482;})[_0x047c('0x2c')](respondWithFilteredResult(_0x13dfb4,_0x397df))[_0x047c('0x4f')](handleError(_0x13dfb4,null));};exports['show']=function(_0x1c1e77,_0x392a9a){var _0x58108e={'raw':![],'where':{'id':_0x1c1e77[_0x047c('0x50')]['id']}},_0xd76389={};_0xd76389[_0x047c('0x37')]=_[_0x047c('0x39')](db['Dashboard'][_0x047c('0x34')]);_0xd76389[_0x047c('0x38')]=_['keys'](_0x1c1e77[_0x047c('0x38')]);_0xd76389['filters']=_[_0x047c('0x3b')](_0xd76389['model'],_0xd76389['query']);_0x58108e[_0x047c('0x3d')]=_['intersection'](_0xd76389[_0x047c('0x37')],qs[_0x047c('0x3c')](_0x1c1e77['query'][_0x047c('0x3c')]));_0x58108e[_0x047c('0x3d')]=_0x58108e[_0x047c('0x3d')]['length']?_0x58108e[_0x047c('0x3d')]:_0xd76389[_0x047c('0x37')];if(_0x1c1e77[_0x047c('0x38')][_0x047c('0x4b')]){_0x58108e[_0x047c('0x4c')]=[{'all':!![]}];}_0x58108e=_[_0x047c('0x46')]({},_0x58108e,_0x1c1e77[_0x047c('0x4a')]);return db[_0x047c('0x33')][_0x047c('0x51')](_0x58108e)[_0x047c('0x2c')](handleEntityNotFound(_0x392a9a,null))[_0x047c('0x2c')](respondWithResult(_0x392a9a,null))[_0x047c('0x4f')](handleError(_0x392a9a,null));};exports['create']=function(_0x5497fd,_0x47e836){return db[_0x047c('0x33')][_0x047c('0x52')](_0x5497fd[_0x047c('0x53')],{})[_0x047c('0x2c')](function(_0x2311e5){var _0x4adfc9=_0x5497fd[_0x047c('0x54')][_0x047c('0x55')]({'plain':!![]});if(!_0x4adfc9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4adfc9[_0x047c('0x56')]===_0x047c('0x54')){var _0x401634=_0x2311e5['get']({'plain':!![]});var _0x2ccde9='CustomDashboards';return db[_0x047c('0x57')]['find']({'where':{'name':_0x2ccde9,'userProfileId':_0x4adfc9['userProfileId']},'raw':!![]})[_0x047c('0x2c')](function(_0x35ae15){if(_0x35ae15&&_0x35ae15[_0x047c('0x58')]===0x0){return db['UserProfileResource'][_0x047c('0x52')]({'name':_0x401634[_0x047c('0x30')],'resourceId':_0x401634['id'],'type':_0x35ae15[_0x047c('0x30')],'sectionId':_0x35ae15['id']},{})[_0x047c('0x2c')](function(){return _0x2311e5;});}else{return _0x2311e5;}})[_0x047c('0x4f')](function(_0x313ca3){logger[_0x047c('0x59')](_0x047c('0x5a'),_0x313ca3);throw _0x313ca3;});}return _0x2311e5;})[_0x047c('0x2c')](respondWithResult(_0x47e836,0xc9))[_0x047c('0x4f')](handleError(_0x47e836,null));};exports[_0x047c('0x5b')]=function(_0x28087c,_0x2da493){var _0x2c9981={'where':{'id':_0x28087c['params']['id']}},_0x1863ea={};_0x1863ea['model']=_[_0x047c('0x39')](db[_0x047c('0x33')]['rawAttributes']);_0x2c9981[_0x047c('0x3d')]=_[_0x047c('0x3b')](_0x1863ea['model'],qs[_0x047c('0x3c')](_0x28087c['query'][_0x047c('0x3c')]));_0x2c9981['attributes']=_0x2c9981[_0x047c('0x3d')]['length']?_0x2c9981[_0x047c('0x3d')]:_0x1863ea[_0x047c('0x37')];if(_0x28087c[_0x047c('0x38')][_0x047c('0x4b')]){_0x2c9981[_0x047c('0x4c')]=[{'all':!![]}];}_0x2c9981=_[_0x047c('0x46')]({},_0x2c9981,_0x28087c['options']);return db[_0x047c('0x33')][_0x047c('0x51')](_0x2c9981)[_0x047c('0x2c')](handleEntityNotFound(_0x2da493,null))[_0x047c('0x2c')](function(_0x954ed8){if(_0x954ed8){var _0x31749c=_0x954ed8['get']({'plain':!![]});_0x31749c=qs['omit'](_0x31749c,['id','createdAt','updatedAt']);_0x28087c['body']=_[_0x047c('0x5c')](_0x28087c[_0x047c('0x53')],['id',_0x047c('0x5d'),_0x047c('0x5e')]);return db[_0x047c('0x33')][_0x047c('0x52')](_['merge'](_0x31749c,_0x28087c['body']),{'include':_0x28087c[_0x047c('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x047c('0x2c')](function(_0x105a13){var _0x3b190f=_0x28087c[_0x047c('0x54')]['get']({'plain':!![]});if(!_0x3b190f)throw new Error(_0x047c('0x5f'));if(_0x3b190f[_0x047c('0x56')]===_0x047c('0x54')){var _0x4e927b=_0x105a13[_0x047c('0x55')]({'plain':!![]});var _0x340fea=_0x047c('0x60');return db['UserProfileSection']['find']({'where':{'name':_0x340fea,'userProfileId':_0x3b190f[_0x047c('0x61')]},'raw':!![]})['then'](function(_0x3254e0){if(_0x3254e0&&_0x3254e0[_0x047c('0x58')]===0x0){return db[_0x047c('0x2d')]['create']({'name':_0x4e927b['name'],'resourceId':_0x4e927b['id'],'type':_0x3254e0[_0x047c('0x30')],'sectionId':_0x3254e0['id']},{})[_0x047c('0x2c')](function(){return _0x105a13;});}else{return _0x105a13;}})[_0x047c('0x4f')](function(_0x528e14){logger[_0x047c('0x59')](_0x047c('0x5a'),_0x528e14);throw _0x528e14;});}return _0x105a13;});}})[_0x047c('0x2c')](respondWithResult(_0x2da493,0xc9))[_0x047c('0x4f')](handleError(_0x2da493,null));};exports['update']=function(_0x431bdf,_0x13d94e){if(_0x431bdf['body']['id']){delete _0x431bdf['body']['id'];}return db[_0x047c('0x33')][_0x047c('0x51')]({'where':{'id':_0x431bdf[_0x047c('0x50')]['id']}})['then'](handleEntityNotFound(_0x13d94e,null))['then'](saveUpdates(_0x431bdf['body'],null))[_0x047c('0x2c')](respondWithResult(_0x13d94e,null))[_0x047c('0x4f')](handleError(_0x13d94e,null));};exports[_0x047c('0x2b')]=function(_0x4e8ba1,_0x433ab6){return db[_0x047c('0x33')][_0x047c('0x51')]({'where':{'id':_0x4e8ba1['params']['id']}})[_0x047c('0x2c')](handleEntityNotFound(_0x433ab6,null))[_0x047c('0x2c')](removeEntity(_0x433ab6,null))['catch'](handleError(_0x433ab6,null));};function widgetAttributes(_0x2cff94){try{switch(_0x2cff94[_0x047c('0x48')]){case'iframe':return[{'name':_0x047c('0x62'),'value':_0x2cff94['attrUrl']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x0]?_0x2cff94[_0x047c('0x63')][0x0]['value']:undefined)||_0x047c('0x64')}];case _0x047c('0x65'):return[{'name':_0x047c('0x66'),'value':_0x2cff94[_0x047c('0x66')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94['attrs'][0x0]?_0x2cff94[_0x047c('0x63')][0x0][_0x047c('0x67')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x2cff94[_0x047c('0x68')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94['attrs'][0x0]?_0x2cff94[_0x047c('0x63')][0x0]['value']:undefined)||_0x047c('0x69')},{'name':_0x047c('0x6a'),'value':_0x2cff94[_0x047c('0x6a')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x1]?_0x2cff94['attrs'][0x1][_0x047c('0x67')]:undefined)||_0x047c('0x6b')},{'name':'attrFontSize','value':_0x2cff94[_0x047c('0x6c')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x2]?_0x2cff94[_0x047c('0x63')][0x2][_0x047c('0x67')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2cff94[_0x047c('0x6d')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x0]?_0x2cff94[_0x047c('0x63')][0x0][_0x047c('0x67')]:undefined)||_0x047c('0x6e')},{'name':'attrVoiceQueues','value':_0x2cff94['attrVoiceQueues']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x1]?_0x2cff94[_0x047c('0x63')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x2cff94[_0x047c('0x6c')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x2]?_0x2cff94['attrs'][0x2][_0x047c('0x67')]:undefined)||0x14},{'name':_0x047c('0x6f'),'value':_0x2cff94[_0x047c('0x6f')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x3]?_0x2cff94[_0x047c('0x63')][0x3][_0x047c('0x67')]:undefined)||_0x047c('0x70')},{'name':_0x047c('0x71'),'value':_0x2cff94[_0x047c('0x71')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x4]?_0x2cff94[_0x047c('0x63')][0x4][_0x047c('0x67')]:undefined)||''},{'name':_0x047c('0x72'),'value':_0x2cff94['attrFaxAccounts']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94['attrs'][0x5]?_0x2cff94[_0x047c('0x63')][0x5][_0x047c('0x67')]:undefined)||''},{'name':_0x047c('0x73'),'value':_0x2cff94['attrSmsAccounts']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94['attrs'][0x6]?_0x2cff94[_0x047c('0x63')][0x6]['value']:undefined)||''},{'name':_0x047c('0x74'),'value':_0x2cff94['attrOpenchannelAccounts']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94['attrs'][0x7]?_0x2cff94[_0x047c('0x63')][0x7]['value']:undefined)||''},{'name':_0x047c('0x75'),'value':_0x2cff94[_0x047c('0x75')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x8]?_0x2cff94[_0x047c('0x63')][0x8][_0x047c('0x67')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2cff94[_0x047c('0x76')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x9]?_0x2cff94[_0x047c('0x63')][0x9][_0x047c('0x67')]:undefined)||''}];case _0x047c('0x77'):case _0x047c('0x78'):return[{'name':'attrSerie1','value':_0x2cff94[_0x047c('0x79')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x0]?_0x2cff94[_0x047c('0x63')][0x0]['value']:undefined)||_0x047c('0x6e')},{'name':'attrSerie2','value':_0x2cff94['attrSerie2']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x1]?_0x2cff94[_0x047c('0x63')][0x1][_0x047c('0x67')]:undefined)||null},{'name':_0x047c('0x7a'),'value':_0x2cff94[_0x047c('0x7a')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x2]?_0x2cff94[_0x047c('0x63')][0x2][_0x047c('0x67')]:undefined)||null},{'name':_0x047c('0x7b'),'value':_0x2cff94[_0x047c('0x7b')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x3]?_0x2cff94[_0x047c('0x63')][0x3][_0x047c('0x67')]:undefined)||[]},{'name':_0x047c('0x6f'),'value':_0x2cff94['attrChannel']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x4]?_0x2cff94[_0x047c('0x63')][0x4][_0x047c('0x67')]:undefined)||_0x047c('0x70')},{'name':'attrEmailAccounts','value':_0x2cff94[_0x047c('0x71')]||(_0x2cff94['attrs']&&_0x2cff94[_0x047c('0x63')][0x5]?_0x2cff94[_0x047c('0x63')][0x5][_0x047c('0x67')]:undefined)||''},{'name':_0x047c('0x72'),'value':_0x2cff94[_0x047c('0x72')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x6]?_0x2cff94[_0x047c('0x63')][0x6][_0x047c('0x67')]:undefined)||''},{'name':_0x047c('0x73'),'value':_0x2cff94['attrSmsAccounts']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x7]?_0x2cff94[_0x047c('0x63')][0x7]['value']:undefined)||''},{'name':_0x047c('0x74'),'value':_0x2cff94['attrOpenchannelAccounts']||(_0x2cff94['attrs']&&_0x2cff94['attrs'][0x8]?_0x2cff94[_0x047c('0x63')][0x8][_0x047c('0x67')]:undefined)||''},{'name':_0x047c('0x75'),'value':_0x2cff94[_0x047c('0x75')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x9]?_0x2cff94['attrs'][0x9]['value']:undefined)||''},{'name':_0x047c('0x76'),'value':_0x2cff94[_0x047c('0x76')]||(_0x2cff94['attrs']&&_0x2cff94['attrs'][0xa]?_0x2cff94[_0x047c('0x63')][0xa][_0x047c('0x67')]:undefined)||''}];case _0x047c('0x7c'):return[{'name':_0x047c('0x7d'),'type':_0x2cff94[_0x047c('0x7e')]||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x0]?_0x2cff94[_0x047c('0x63')][0x0]['type']:undefined)||null,'value':_0x2cff94['attrReport']||(_0x2cff94[_0x047c('0x63')]&&_0x2cff94[_0x047c('0x63')][0x0]?_0x2cff94[_0x047c('0x63')][0x0][_0x047c('0x67')]:undefined)||null},{'name':_0x047c('0x7f'),'value':_0x2cff94[_0x047c('0x7f')]||(_0x2cff94['attrs']&&_0x2cff94['attrs'][0x1]?_0x2cff94['attrs'][0x1][_0x047c('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x5b9156){logger['error'](_0x047c('0x80'),JSON[_0x047c('0x81')](_0x5b9156));return[];}}exports[_0x047c('0x82')]=function(_0x5c55e6,_0x41f77e,_0x56a005){if(_0x5c55e6[_0x047c('0x53')]['id']){delete _0x5c55e6[_0x047c('0x53')]['id'];}return db[_0x047c('0x33')][_0x047c('0x51')]({'where':{'id':_0x5c55e6[_0x047c('0x50')]['id']}})[_0x047c('0x2c')](handleEntityNotFound(_0x41f77e,null))[_0x047c('0x2c')](function(_0x1a69c7){if(_0x1a69c7){_0x5c55e6['body'][_0x047c('0x83')]=_0x1a69c7['id'];_0x5c55e6[_0x047c('0x53')][_0x047c('0x63')]=widgetAttributes(_0x5c55e6['body']);return db[_0x047c('0x84')]['create'](_0x5c55e6[_0x047c('0x53')]);}})[_0x047c('0x2c')](respondWithResult(_0x41f77e,null))[_0x047c('0x4f')](handleError(_0x41f77e,null));};exports['getItems']=function(_0x362a71,_0x1d3d7e,_0x10ab13){var _0x386754={};var _0x1bc89b={};var _0x39411b;var _0x499b77;return db['Dashboard']['findOne']({'where':{'id':_0x362a71[_0x047c('0x50')]['id']}})[_0x047c('0x2c')](handleEntityNotFound(_0x1d3d7e,null))[_0x047c('0x2c')](function(_0x5232e2){if(_0x5232e2){_0x39411b=_0x5232e2;_0x1bc89b['model']=_[_0x047c('0x39')](db[_0x047c('0x84')][_0x047c('0x34')]);_0x1bc89b['query']=_[_0x047c('0x39')](_0x362a71[_0x047c('0x38')]);_0x1bc89b[_0x047c('0x3a')]=_[_0x047c('0x3b')](_0x1bc89b[_0x047c('0x37')],_0x1bc89b[_0x047c('0x38')]);_0x386754['attributes']=_[_0x047c('0x3b')](_0x1bc89b[_0x047c('0x37')],qs[_0x047c('0x3c')](_0x362a71[_0x047c('0x38')][_0x047c('0x3c')]));_0x386754[_0x047c('0x3d')]=_0x386754[_0x047c('0x3d')][_0x047c('0x3e')]?_0x386754['attributes']:_0x1bc89b[_0x047c('0x37')];_0x386754[_0x047c('0x41')]=qs[_0x047c('0x42')](_0x362a71[_0x047c('0x38')]['sort']);_0x386754[_0x047c('0x43')]=qs[_0x047c('0x3a')](_[_0x047c('0x44')](_0x362a71[_0x047c('0x38')],_0x1bc89b['filters']));if(_0x362a71[_0x047c('0x38')][_0x047c('0x45')]){_0x386754[_0x047c('0x43')]=_[_0x047c('0x46')](_0x386754[_0x047c('0x43')],{'$or':_[_0x047c('0x47')](_0x386754[_0x047c('0x3d')],function(_0xd220f7){var _0x4883e3={};_0x4883e3[_0xd220f7]={'$like':'%'+_0x362a71[_0x047c('0x38')][_0x047c('0x45')]+'%'};return _0x4883e3;})});}_0x386754=_['merge']({},_0x386754,_0x362a71[_0x047c('0x4a')]);return _0x39411b['getItems'](_0x386754);}})[_0x047c('0x2c')](function(_0x3db05d){if(_0x3db05d){_0x499b77=_0x3db05d[_0x047c('0x3e')];if(!_0x362a71[_0x047c('0x38')]['hasOwnProperty']('nolimit')){_0x386754['limit']=qs[_0x047c('0x25')](_0x362a71['query'][_0x047c('0x25')]);_0x386754[_0x047c('0x23')]=qs['offset'](_0x362a71['query'][_0x047c('0x23')]);}return _0x39411b[_0x047c('0x85')](_0x386754);}})[_0x047c('0x2c')](function(_0x305ae8){if(_0x305ae8){return _0x305ae8?{'count':_0x499b77,'rows':_0x305ae8}:null;}})[_0x047c('0x2c')](respondWithResult(_0x1d3d7e,null))['catch'](handleError(_0x1d3d7e,null));}; \ No newline at end of file +var _0x2931=['DashboardItem','findOne','getItems','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset','undefined','count','limit','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','map','Dashboard','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','clone','params','find','omit','createdAt','updatedAt','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','custom','attrPath','value','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','widgetAttributes:\x20%s','stringify','addItem'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x2931,0x84));var _0x1293=function(_0x5a0194,_0x5aee2c){_0x5a0194=_0x5a0194-0x0;var _0xcfdc25=_0x2931[_0x5a0194];return _0xcfdc25;};'use strict';var emlformat=require(_0x1293('0x0'));var rimraf=require(_0x1293('0x1'));var zipdir=require(_0x1293('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1293('0x3'));var moment=require(_0x1293('0x4'));var BPromise=require(_0x1293('0x5'));var Mustache=require(_0x1293('0x6'));var util=require(_0x1293('0x7'));var path=require(_0x1293('0x8'));var sox=require(_0x1293('0x9'));var csv=require(_0x1293('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1293('0xb'));var _=require(_0x1293('0xc'));var squel=require('squel');var crypto=require(_0x1293('0xd'));var jsforce=require(_0x1293('0xe'));var deskjs=require(_0x1293('0xf'));var toCsv=require(_0x1293('0xa'));var querystring=require('querystring');var Papa=require(_0x1293('0x10'));var Redis=require(_0x1293('0x11'));var authService=require(_0x1293('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1293('0x13'));var logger=require('../../config/logger')(_0x1293('0x14'));var utils=require('../../config/utils');var config=require(_0x1293('0x15'));var licenseUtil=require(_0x1293('0x16'));var db=require(_0x1293('0x17'))['db'];config[_0x1293('0x18')]=_['defaults'](config[_0x1293('0x18')],{'host':_0x1293('0x19'),'port':0x18eb});var socket=require(_0x1293('0x1a'))(new Redis(config[_0x1293('0x18')]));require(_0x1293('0x1b'))['register'](socket);function respondWithStatusCode(_0x32e614,_0x95f528){_0x95f528=_0x95f528||0xcc;return function(_0x4c5411){if(_0x4c5411){return _0x32e614[_0x1293('0x1c')](_0x95f528);}return _0x32e614[_0x1293('0x1d')](_0x95f528)['end']();};}function respondWithResult(_0x240422,_0x513e18){_0x513e18=_0x513e18||0xc8;return function(_0x4c1487){if(_0x4c1487){return _0x240422['status'](_0x513e18)[_0x1293('0x1e')](_0x4c1487);}};}function respondWithFilteredResult(_0x26d1d1,_0x5c86bd){return function(_0x71d2fb){if(_0x71d2fb){var _0x54f6ca=typeof _0x5c86bd[_0x1293('0x1f')]==='undefined'&&typeof _0x5c86bd['limit']===_0x1293('0x20');var _0x271362=_0x71d2fb[_0x1293('0x21')];var _0x4e29b5=_0x54f6ca?0x0:_0x5c86bd[_0x1293('0x1f')];var _0xb9be0b=_0x54f6ca?_0x71d2fb[_0x1293('0x21')]:_0x5c86bd['offset']+_0x5c86bd[_0x1293('0x22')];var _0x31ec20;if(_0xb9be0b>=_0x271362){_0xb9be0b=_0x271362;_0x31ec20=0xc8;}else{_0x31ec20=0xce;}_0x26d1d1[_0x1293('0x1d')](_0x31ec20);return _0x26d1d1['set']('Content-Range',_0x4e29b5+'-'+_0xb9be0b+'/'+_0x271362)[_0x1293('0x1e')](_0x71d2fb);}return null;};}function patchUpdates(_0x7b99ef){return function(_0xeb26dd){try{jsonpatch['apply'](_0xeb26dd,_0x7b99ef,!![]);}catch(_0x395f1a){return BPromise[_0x1293('0x23')](_0x395f1a);}return _0xeb26dd[_0x1293('0x24')]();};}function saveUpdates(_0x27541a,_0x11cdd7){return function(_0x59a108){if(_0x59a108){return _0x59a108[_0x1293('0x25')](_0x27541a)[_0x1293('0x26')](function(_0x172f3b){return _0x172f3b;});}return null;};}function removeEntity(_0x185d16,_0x13ebf5){return function(_0x39fd49){if(_0x39fd49){return _0x39fd49[_0x1293('0x27')]()[_0x1293('0x26')](function(){var _0x57dc88=_0x39fd49[_0x1293('0x28')]({'plain':!![]});var _0xb7405d=_0x1293('0x29');return db[_0x1293('0x2a')][_0x1293('0x27')]({'where':{'type':_0xb7405d,'resourceId':_0x57dc88['id']}})[_0x1293('0x26')](function(){return _0x39fd49;});})[_0x1293('0x26')](function(){_0x185d16[_0x1293('0x1d')](0xcc)[_0x1293('0x2b')]();});}};}function handleEntityNotFound(_0x57d215,_0x227aaf){return function(_0x517250){if(!_0x517250){_0x57d215['sendStatus'](0x194);}return _0x517250;};}function handleError(_0x2a5e29,_0x5eec2e){_0x5eec2e=_0x5eec2e||0x1f4;return function(_0x39f949){logger[_0x1293('0x2c')](_0x39f949[_0x1293('0x2d')]);if(_0x39f949[_0x1293('0x2e')]){delete _0x39f949[_0x1293('0x2e')];}_0x2a5e29['status'](_0x5eec2e)[_0x1293('0x2f')](_0x39f949);};}exports[_0x1293('0x30')]=function(_0x5a66ce,_0x4f29f3){var _0x3b0c22={},_0x2be188={},_0x409b34={'count':0x0,'rows':[]};var _0x2a27bf=_[_0x1293('0x31')](db[_0x1293('0x32')][_0x1293('0x33')],function(_0x40c8d7){return{'name':_0x40c8d7['fieldName'],'type':_0x40c8d7[_0x1293('0x34')][_0x1293('0x35')]};});_0x2be188[_0x1293('0x36')]=_['map'](_0x2a27bf,_0x1293('0x2e'));_0x2be188[_0x1293('0x37')]=_[_0x1293('0x38')](_0x5a66ce[_0x1293('0x37')]);_0x2be188['filters']=_['intersection'](_0x2be188[_0x1293('0x36')],_0x2be188[_0x1293('0x37')]);_0x3b0c22[_0x1293('0x39')]=_[_0x1293('0x3a')](_0x2be188[_0x1293('0x36')],qs[_0x1293('0x3b')](_0x5a66ce[_0x1293('0x37')][_0x1293('0x3b')]));_0x3b0c22['attributes']=_0x3b0c22[_0x1293('0x39')][_0x1293('0x3c')]?_0x3b0c22[_0x1293('0x39')]:_0x2be188[_0x1293('0x36')];if(!_0x5a66ce[_0x1293('0x37')]['hasOwnProperty'](_0x1293('0x3d'))){_0x3b0c22[_0x1293('0x22')]=qs[_0x1293('0x22')](_0x5a66ce[_0x1293('0x37')][_0x1293('0x22')]);_0x3b0c22['offset']=qs[_0x1293('0x1f')](_0x5a66ce[_0x1293('0x37')][_0x1293('0x1f')]);}_0x3b0c22[_0x1293('0x3e')]=qs[_0x1293('0x3f')](_0x5a66ce[_0x1293('0x37')]['sort']);_0x3b0c22[_0x1293('0x40')]=qs['filters'](_[_0x1293('0x41')](_0x5a66ce[_0x1293('0x37')],_0x2be188[_0x1293('0x42')]),_0x2a27bf);if(_0x5a66ce[_0x1293('0x37')][_0x1293('0x43')]){_0x3b0c22[_0x1293('0x40')]=_[_0x1293('0x44')](_0x3b0c22[_0x1293('0x40')],{'$or':_[_0x1293('0x31')](_0x2a27bf,function(_0x38a02d){if(_0x38a02d['type']!=='VIRTUAL'){var _0x1c3f00={};_0x1c3f00[_0x38a02d[_0x1293('0x2e')]]={'$like':'%'+_0x5a66ce[_0x1293('0x37')]['filter']+'%'};return _0x1c3f00;}})});}_0x3b0c22=_[_0x1293('0x44')]({},_0x3b0c22,_0x5a66ce['options']);var _0x508fb9={'where':_0x3b0c22['where']};return db[_0x1293('0x32')][_0x1293('0x21')](_0x508fb9)[_0x1293('0x26')](function(_0x318a28){_0x409b34['count']=_0x318a28;if(_0x5a66ce[_0x1293('0x37')]['includeAll']){_0x3b0c22[_0x1293('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0x1293('0x46')](_0x3b0c22);})[_0x1293('0x26')](function(_0x204628){_0x409b34[_0x1293('0x47')]=_0x204628;return _0x409b34;})['then'](respondWithFilteredResult(_0x4f29f3,_0x3b0c22))[_0x1293('0x48')](handleError(_0x4f29f3,null));};exports['show']=function(_0x160baa,_0x3d1806){var _0x34a137={'raw':![],'where':{'id':_0x160baa['params']['id']}},_0x1c6440={};_0x1c6440[_0x1293('0x36')]=_[_0x1293('0x38')](db[_0x1293('0x32')][_0x1293('0x33')]);_0x1c6440[_0x1293('0x37')]=_[_0x1293('0x38')](_0x160baa[_0x1293('0x37')]);_0x1c6440[_0x1293('0x42')]=_[_0x1293('0x3a')](_0x1c6440[_0x1293('0x36')],_0x1c6440[_0x1293('0x37')]);_0x34a137[_0x1293('0x39')]=_[_0x1293('0x3a')](_0x1c6440[_0x1293('0x36')],qs['fields'](_0x160baa[_0x1293('0x37')][_0x1293('0x3b')]));_0x34a137[_0x1293('0x39')]=_0x34a137[_0x1293('0x39')][_0x1293('0x3c')]?_0x34a137['attributes']:_0x1c6440[_0x1293('0x36')];if(_0x160baa[_0x1293('0x37')][_0x1293('0x49')]){_0x34a137['include']=[{'all':!![]}];}_0x34a137=_['merge']({},_0x34a137,_0x160baa[_0x1293('0x4a')]);return db[_0x1293('0x32')]['find'](_0x34a137)[_0x1293('0x26')](handleEntityNotFound(_0x3d1806,null))[_0x1293('0x26')](respondWithResult(_0x3d1806,null))[_0x1293('0x48')](handleError(_0x3d1806,null));};exports[_0x1293('0x4b')]=function(_0x3c046e,_0x2a9175){return db[_0x1293('0x32')][_0x1293('0x4b')](_0x3c046e['body'],{})[_0x1293('0x26')](function(_0x5eaffa){var _0x341f4b=_0x3c046e[_0x1293('0x4c')][_0x1293('0x28')]({'plain':!![]});if(!_0x341f4b)throw new Error(_0x1293('0x4d'));if(_0x341f4b['role']===_0x1293('0x4c')){var _0x2dc1fa=_0x5eaffa[_0x1293('0x28')]({'plain':!![]});var _0x4ad736=_0x1293('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x4ad736,'userProfileId':_0x341f4b['userProfileId']},'raw':!![]})[_0x1293('0x26')](function(_0x2c633f){if(_0x2c633f&&_0x2c633f[_0x1293('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2dc1fa['name'],'resourceId':_0x2dc1fa['id'],'type':_0x2c633f[_0x1293('0x2e')],'sectionId':_0x2c633f['id']},{})[_0x1293('0x26')](function(){return _0x5eaffa;});}else{return _0x5eaffa;}})[_0x1293('0x48')](function(_0x2370a8){logger[_0x1293('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2370a8);throw _0x2370a8;});}return _0x5eaffa;})['then'](respondWithResult(_0x2a9175,0xc9))[_0x1293('0x48')](handleError(_0x2a9175,null));};exports[_0x1293('0x4f')]=function(_0x2a52c5,_0x1c349f){var _0x170b03={'where':{'id':_0x2a52c5[_0x1293('0x50')]['id']}},_0x506294={};_0x506294['model']=_['keys'](db[_0x1293('0x32')][_0x1293('0x33')]);_0x170b03[_0x1293('0x39')]=_[_0x1293('0x3a')](_0x506294[_0x1293('0x36')],qs['fields'](_0x2a52c5[_0x1293('0x37')][_0x1293('0x3b')]));_0x170b03[_0x1293('0x39')]=_0x170b03['attributes'][_0x1293('0x3c')]?_0x170b03[_0x1293('0x39')]:_0x506294['model'];if(_0x2a52c5[_0x1293('0x37')][_0x1293('0x49')]){_0x170b03[_0x1293('0x45')]=[{'all':!![]}];}_0x170b03=_[_0x1293('0x44')]({},_0x170b03,_0x2a52c5[_0x1293('0x4a')]);return db[_0x1293('0x32')][_0x1293('0x51')](_0x170b03)[_0x1293('0x26')](handleEntityNotFound(_0x1c349f,null))[_0x1293('0x26')](function(_0x178443){if(_0x178443){var _0xf562f5=_0x178443['get']({'plain':!![]});_0xf562f5=qs[_0x1293('0x52')](_0xf562f5,['id',_0x1293('0x53'),_0x1293('0x54')]);_0x2a52c5[_0x1293('0x55')]=_[_0x1293('0x52')](_0x2a52c5['body'],['id',_0x1293('0x53'),'updatedAt']);return db[_0x1293('0x32')][_0x1293('0x4b')](_[_0x1293('0x44')](_0xf562f5,_0x2a52c5[_0x1293('0x55')]),{'include':_0x2a52c5[_0x1293('0x37')][_0x1293('0x49')]?[{'all':!![]}]:undefined})[_0x1293('0x26')](function(_0x1bdc22){var _0x5435cb=_0x2a52c5[_0x1293('0x4c')][_0x1293('0x28')]({'plain':!![]});if(!_0x5435cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5435cb[_0x1293('0x56')]===_0x1293('0x4c')){var _0x953573=_0x1bdc22[_0x1293('0x28')]({'plain':!![]});var _0x1575f5='CustomDashboards';return db[_0x1293('0x57')]['find']({'where':{'name':_0x1575f5,'userProfileId':_0x5435cb[_0x1293('0x58')]},'raw':!![]})[_0x1293('0x26')](function(_0x17d078){if(_0x17d078&&_0x17d078[_0x1293('0x4e')]===0x0){return db[_0x1293('0x2a')][_0x1293('0x4b')]({'name':_0x953573[_0x1293('0x2e')],'resourceId':_0x953573['id'],'type':_0x17d078[_0x1293('0x2e')],'sectionId':_0x17d078['id']},{})['then'](function(){return _0x1bdc22;});}else{return _0x1bdc22;}})[_0x1293('0x48')](function(_0x4372b9){logger[_0x1293('0x2c')](_0x1293('0x59'),_0x4372b9);throw _0x4372b9;});}return _0x1bdc22;});}})[_0x1293('0x26')](respondWithResult(_0x1c349f,0xc9))['catch'](handleError(_0x1c349f,null));};exports[_0x1293('0x25')]=function(_0x3de18d,_0x3c13d5){if(_0x3de18d['body']['id']){delete _0x3de18d[_0x1293('0x55')]['id'];}return db[_0x1293('0x32')][_0x1293('0x51')]({'where':{'id':_0x3de18d[_0x1293('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c13d5,null))[_0x1293('0x26')](saveUpdates(_0x3de18d[_0x1293('0x55')],null))[_0x1293('0x26')](respondWithResult(_0x3c13d5,null))[_0x1293('0x48')](handleError(_0x3c13d5,null));};exports[_0x1293('0x27')]=function(_0x513a40,_0x4bcc2e){return db[_0x1293('0x32')][_0x1293('0x51')]({'where':{'id':_0x513a40[_0x1293('0x50')]['id']}})['then'](handleEntityNotFound(_0x4bcc2e,null))[_0x1293('0x26')](removeEntity(_0x4bcc2e,null))['catch'](handleError(_0x4bcc2e,null));};function widgetAttributes(_0x4bd9d9){try{switch(_0x4bd9d9[_0x1293('0x34')]){case'iframe':return[{'name':_0x1293('0x5a'),'value':_0x4bd9d9['attrUrl']||(_0x4bd9d9['attrs']&&_0x4bd9d9[_0x1293('0x5b')][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0]['value']:undefined)||'https://'}];case _0x1293('0x5c'):return[{'name':_0x1293('0x5d'),'value':_0x4bd9d9[_0x1293('0x5d')]||(_0x4bd9d9['attrs']&&_0x4bd9d9['attrs'][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0][_0x1293('0x5e')]:undefined)||''}];case _0x1293('0x5f'):return[{'name':_0x1293('0x60'),'value':_0x4bd9d9['attrHourFormat']||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0]['value']:undefined)||_0x1293('0x61')},{'name':_0x1293('0x62'),'value':_0x4bd9d9[_0x1293('0x62')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x1]?_0x4bd9d9[_0x1293('0x5b')][0x1][_0x1293('0x5e')]:undefined)||_0x1293('0x63')},{'name':_0x1293('0x64'),'value':_0x4bd9d9[_0x1293('0x64')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x2]?_0x4bd9d9[_0x1293('0x5b')][0x2][_0x1293('0x5e')]:undefined)||0xc}];case _0x1293('0x65'):return[{'name':_0x1293('0x66'),'value':_0x4bd9d9['attrMetric']||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0][_0x1293('0x5e')]:undefined)||_0x1293('0x67')},{'name':_0x1293('0x68'),'value':_0x4bd9d9[_0x1293('0x68')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x1]?_0x4bd9d9[_0x1293('0x5b')][0x1][_0x1293('0x5e')]:undefined)||[]},{'name':_0x1293('0x64'),'value':_0x4bd9d9[_0x1293('0x64')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x2]?_0x4bd9d9[_0x1293('0x5b')][0x2][_0x1293('0x5e')]:undefined)||0x14},{'name':_0x1293('0x69'),'value':_0x4bd9d9[_0x1293('0x69')]||(_0x4bd9d9['attrs']&&_0x4bd9d9[_0x1293('0x5b')][0x3]?_0x4bd9d9[_0x1293('0x5b')][0x3][_0x1293('0x5e')]:undefined)||_0x1293('0x6a')},{'name':_0x1293('0x6b'),'value':_0x4bd9d9[_0x1293('0x6b')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x4]?_0x4bd9d9[_0x1293('0x5b')][0x4]['value']:undefined)||''},{'name':_0x1293('0x6c'),'value':_0x4bd9d9[_0x1293('0x6c')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x5]?_0x4bd9d9['attrs'][0x5][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6d'),'value':_0x4bd9d9[_0x1293('0x6d')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x6]?_0x4bd9d9[_0x1293('0x5b')][0x6][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6e'),'value':_0x4bd9d9[_0x1293('0x6e')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x7]?_0x4bd9d9['attrs'][0x7][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6f'),'value':_0x4bd9d9[_0x1293('0x6f')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x8]?_0x4bd9d9[_0x1293('0x5b')][0x8][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x70'),'value':_0x4bd9d9[_0x1293('0x70')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x9]?_0x4bd9d9[_0x1293('0x5b')][0x9][_0x1293('0x5e')]:undefined)||''}];case _0x1293('0x71'):case _0x1293('0x72'):return[{'name':_0x1293('0x73'),'value':_0x4bd9d9[_0x1293('0x73')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0][_0x1293('0x5e')]:undefined)||'total'},{'name':_0x1293('0x74'),'value':_0x4bd9d9[_0x1293('0x74')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x1]?_0x4bd9d9['attrs'][0x1][_0x1293('0x5e')]:undefined)||null},{'name':_0x1293('0x75'),'value':_0x4bd9d9[_0x1293('0x75')]||(_0x4bd9d9['attrs']&&_0x4bd9d9[_0x1293('0x5b')][0x2]?_0x4bd9d9[_0x1293('0x5b')][0x2][_0x1293('0x5e')]:undefined)||null},{'name':_0x1293('0x68'),'value':_0x4bd9d9[_0x1293('0x68')]||(_0x4bd9d9['attrs']&&_0x4bd9d9[_0x1293('0x5b')][0x3]?_0x4bd9d9[_0x1293('0x5b')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x4bd9d9[_0x1293('0x69')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x4]?_0x4bd9d9['attrs'][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x4bd9d9[_0x1293('0x6b')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x5]?_0x4bd9d9[_0x1293('0x5b')][0x5][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6c'),'value':_0x4bd9d9[_0x1293('0x6c')]||(_0x4bd9d9['attrs']&&_0x4bd9d9['attrs'][0x6]?_0x4bd9d9['attrs'][0x6][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6d'),'value':_0x4bd9d9[_0x1293('0x6d')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x7]?_0x4bd9d9[_0x1293('0x5b')][0x7][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6e'),'value':_0x4bd9d9['attrOpenchannelAccounts']||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x8]?_0x4bd9d9[_0x1293('0x5b')][0x8][_0x1293('0x5e')]:undefined)||''},{'name':_0x1293('0x6f'),'value':_0x4bd9d9['attrWhatsappAccounts']||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0x9]?_0x4bd9d9[_0x1293('0x5b')][0x9][_0x1293('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4bd9d9[_0x1293('0x70')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9[_0x1293('0x5b')][0xa]?_0x4bd9d9[_0x1293('0x5b')][0xa][_0x1293('0x5e')]:undefined)||''}];case _0x1293('0x76'):return[{'name':_0x1293('0x77'),'type':_0x4bd9d9[_0x1293('0x78')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x0]?_0x4bd9d9[_0x1293('0x5b')][0x0][_0x1293('0x34')]:undefined)||null,'value':_0x4bd9d9[_0x1293('0x77')]||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x0]?_0x4bd9d9['attrs'][0x0][_0x1293('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x4bd9d9['attrRefresh']||(_0x4bd9d9[_0x1293('0x5b')]&&_0x4bd9d9['attrs'][0x1]?_0x4bd9d9['attrs'][0x1][_0x1293('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x56c2e8){logger[_0x1293('0x2c')](_0x1293('0x79'),JSON[_0x1293('0x7a')](_0x56c2e8));return[];}}exports[_0x1293('0x7b')]=function(_0xa73591,_0x53d393,_0x50eaff){if(_0xa73591[_0x1293('0x55')]['id']){delete _0xa73591[_0x1293('0x55')]['id'];}return db[_0x1293('0x32')]['find']({'where':{'id':_0xa73591['params']['id']}})[_0x1293('0x26')](handleEntityNotFound(_0x53d393,null))['then'](function(_0x60348b){if(_0x60348b){_0xa73591['body']['DashboardId']=_0x60348b['id'];_0xa73591[_0x1293('0x55')][_0x1293('0x5b')]=widgetAttributes(_0xa73591[_0x1293('0x55')]);return db[_0x1293('0x7c')][_0x1293('0x4b')](_0xa73591[_0x1293('0x55')]);}})[_0x1293('0x26')](respondWithResult(_0x53d393,null))['catch'](handleError(_0x53d393,null));};exports['getItems']=function(_0x27fc2b,_0x131b5d,_0x1ddf36){var _0x51c896={};var _0x3504c9={};var _0x48320e;var _0x5e514b;return db[_0x1293('0x32')][_0x1293('0x7d')]({'where':{'id':_0x27fc2b[_0x1293('0x50')]['id']}})[_0x1293('0x26')](handleEntityNotFound(_0x131b5d,null))[_0x1293('0x26')](function(_0x4fa0cf){if(_0x4fa0cf){_0x48320e=_0x4fa0cf;_0x3504c9[_0x1293('0x36')]=_[_0x1293('0x38')](db['DashboardItem'][_0x1293('0x33')]);_0x3504c9[_0x1293('0x37')]=_[_0x1293('0x38')](_0x27fc2b[_0x1293('0x37')]);_0x3504c9[_0x1293('0x42')]=_[_0x1293('0x3a')](_0x3504c9[_0x1293('0x36')],_0x3504c9[_0x1293('0x37')]);_0x51c896[_0x1293('0x39')]=_[_0x1293('0x3a')](_0x3504c9['model'],qs[_0x1293('0x3b')](_0x27fc2b[_0x1293('0x37')][_0x1293('0x3b')]));_0x51c896[_0x1293('0x39')]=_0x51c896[_0x1293('0x39')]['length']?_0x51c896[_0x1293('0x39')]:_0x3504c9['model'];_0x51c896[_0x1293('0x3e')]=qs['sort'](_0x27fc2b[_0x1293('0x37')][_0x1293('0x3f')]);_0x51c896[_0x1293('0x40')]=qs[_0x1293('0x42')](_[_0x1293('0x41')](_0x27fc2b[_0x1293('0x37')],_0x3504c9[_0x1293('0x42')]));if(_0x27fc2b['query'][_0x1293('0x43')]){_0x51c896['where']=_[_0x1293('0x44')](_0x51c896[_0x1293('0x40')],{'$or':_[_0x1293('0x31')](_0x51c896[_0x1293('0x39')],function(_0x194f5c){var _0x436da4={};_0x436da4[_0x194f5c]={'$like':'%'+_0x27fc2b['query'][_0x1293('0x43')]+'%'};return _0x436da4;})});}_0x51c896=_[_0x1293('0x44')]({},_0x51c896,_0x27fc2b[_0x1293('0x4a')]);return _0x48320e[_0x1293('0x7e')](_0x51c896);}})[_0x1293('0x26')](function(_0x1cf541){if(_0x1cf541){_0x5e514b=_0x1cf541[_0x1293('0x3c')];if(!_0x27fc2b['query'][_0x1293('0x7f')](_0x1293('0x3d'))){_0x51c896[_0x1293('0x22')]=qs[_0x1293('0x22')](_0x27fc2b[_0x1293('0x37')][_0x1293('0x22')]);_0x51c896[_0x1293('0x1f')]=qs[_0x1293('0x1f')](_0x27fc2b['query']['offset']);}return _0x48320e['getItems'](_0x51c896);}})[_0x1293('0x26')](function(_0x2147cd){if(_0x2147cd){return _0x2147cd?{'count':_0x5e514b,'rows':_0x2147cd}:null;}})[_0x1293('0x26')](respondWithResult(_0x131b5d,null))[_0x1293('0x48')](handleError(_0x131b5d,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c8f21df..f6863da 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 _0x00d9=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x31e94f,_0x42ecd6){var _0x1b8494=function(_0x5da15c){while(--_0x5da15c){_0x31e94f['push'](_0x31e94f['shift']());}};_0x1b8494(++_0x42ecd6);}(_0x00d9,0x154));var _0x900d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x00d9[_0x243b2f];return _0xcb3c2d;};'use strict';var EventEmitter=require(_0x900d('0x0'));var Dashboard=require(_0x900d('0x1'))['db'][_0x900d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x900d('0x3')](0x0);var events={'afterCreate':_0x900d('0x4'),'afterUpdate':_0x900d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3429f5){return function(_0x358e7e,_0x3f5564,_0x2efdd4){DashboardEvents[_0x900d('0x6')](_0x3429f5+':'+_0x358e7e['id'],_0x358e7e);DashboardEvents[_0x900d('0x6')](_0x3429f5,_0x358e7e);_0x2efdd4(null);};}for(var e in events){if(events[_0x900d('0x7')](e)){var event=events[e];Dashboard[_0x900d('0x8')](e,emitEvent(event));}}module[_0x900d('0x9')]=DashboardEvents; \ No newline at end of file +var _0xc592=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc592,0x18c));var _0x2c59=function(_0x48d517,_0x521d87){_0x48d517=_0x48d517-0x0;var _0x123db7=_0xc592[_0x48d517];return _0x123db7;};'use strict';var EventEmitter=require(_0x2c59('0x0'));var Dashboard=require(_0x2c59('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x2c59('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c59('0x3'),'afterDestroy':_0x2c59('0x4')};function emitEvent(_0x33782b){return function(_0x20923a,_0x2244f1,_0xcb96ea){DashboardEvents['emit'](_0x33782b+':'+_0x20923a['id'],_0x20923a);DashboardEvents[_0x2c59('0x5')](_0x33782b,_0x20923a);_0xcb96ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x2c59('0x6')](e,emitEvent(event));}}module[_0x2c59('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5aabfb6..f82ec9e 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 _0xd9d3=['bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x1f468f,_0x8dd853){var _0x2270d3=function(_0x181fb5){while(--_0x181fb5){_0x1f468f['push'](_0x1f468f['shift']());}};_0x2270d3(++_0x8dd853);}(_0xd9d3,0x11a));var _0x3d9d=function(_0x493bc4,_0x5abb89){_0x493bc4=_0x493bc4-0x0;var _0x2d0b8e=_0xd9d3[_0x493bc4];return _0x2d0b8e;};'use strict';var _=require(_0x3d9d('0x0'));var util=require(_0x3d9d('0x1'));var logger=require(_0x3d9d('0x2'))(_0x3d9d('0x3'));var moment=require('moment');var BPromise=require(_0x3d9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9d('0x5'));var rimraf=require(_0x3d9d('0x6'));var config=require(_0x3d9d('0x7'));var attributes=require(_0x3d9d('0x8'));module[_0x3d9d('0x9')]=function(_0xce009a,_0x517f04){return _0xce009a[_0x3d9d('0xa')](_0x3d9d('0xb'),attributes,{'tableName':_0x3d9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb626=['Dashboard','dashboards','util','../../config/logger','moment','rimraf','./dashboard.attributes'];(function(_0x3329f2,_0x569730){var _0x587274=function(_0x2478b2){while(--_0x2478b2){_0x3329f2['push'](_0x3329f2['shift']());}};_0x587274(++_0x569730);}(_0xb626,0xbf));var _0x6b62=function(_0x359051,_0x4e0d30){_0x359051=_0x359051-0x0;var _0x245ec9=_0xb626[_0x359051];return _0x245ec9;};'use strict';var _=require('lodash');var util=require(_0x6b62('0x0'));var logger=require(_0x6b62('0x1'))('api');var moment=require(_0x6b62('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b62('0x3'));var config=require('../../config/environment');var attributes=require(_0x6b62('0x4'));module['exports']=function(_0x49624a,_0x26f818){return _0x49624a['define'](_0x6b62('0x5'),attributes,{'tableName':_0x6b62('0x6'),'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 296d386..1d9e2d8 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 _0x3e68=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ae975,_0x70b40e){var _0x2576ca=function(_0x1b4e97){while(--_0x1b4e97){_0x1ae975['push'](_0x1ae975['shift']());}};_0x2576ca(++_0x70b40e);}(_0x3e68,0x1d4));var _0x83e6=function(_0x2594f4,_0x3d81a2){_0x2594f4=_0x2594f4-0x0;var _0x2e0e16=_0x3e68[_0x2594f4];return _0x2e0e16;};'use strict';var _=require(_0x83e6('0x0'));var util=require('util');var moment=require(_0x83e6('0x1'));var BPromise=require(_0x83e6('0x2'));var rs=require(_0x83e6('0x3'));var fs=require('fs');var Redis=require(_0x83e6('0x4'));var db=require(_0x83e6('0x5'))['db'];var utils=require(_0x83e6('0x6'));var logger=require(_0x83e6('0x7'))('rpc');var config=require(_0x83e6('0x8'));var jayson=require(_0x83e6('0x9'));var client=jayson['client'][_0x83e6('0xa')]({'port':0x232a});config[_0x83e6('0xb')]=_[_0x83e6('0xc')](config[_0x83e6('0xb')],{'host':_0x83e6('0xd'),'port':0x18eb});var socket=require(_0x83e6('0xe'))(new Redis(config['redis']));require(_0x83e6('0xf'))[_0x83e6('0x10')](socket);function respondWithRpcPromise(_0x47f9fa,_0x5bdf1f,_0x2fa04a){return new BPromise(function(_0x1d27ca,_0x14ee03){return client[_0x83e6('0x11')](_0x47f9fa,_0x2fa04a)[_0x83e6('0x12')](function(_0x1da239){logger[_0x83e6('0x13')](_0x83e6('0x14'),_0x5bdf1f,_0x83e6('0x15'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x5bdf1f,_0x83e6('0x15'),JSON['stringify'](_0x1da239));if(_0x1da239[_0x83e6('0x16')]){if(_0x1da239[_0x83e6('0x16')][_0x83e6('0x17')]===0x1f4){logger[_0x83e6('0x16')](_0x83e6('0x14'),_0x5bdf1f,_0x1da239['error']['message']);return _0x14ee03(_0x1da239[_0x83e6('0x16')][_0x83e6('0x18')]);}logger[_0x83e6('0x16')]('Dashboard,\x20%s,\x20%s',_0x5bdf1f,_0x1da239['error'][_0x83e6('0x18')]);return _0x1d27ca(_0x1da239[_0x83e6('0x16')]['message']);}else{logger[_0x83e6('0x13')](_0x83e6('0x14'),_0x5bdf1f,_0x83e6('0x15'));_0x1d27ca(_0x1da239['result'][_0x83e6('0x18')]);}})['catch'](function(_0x1df0bf){logger[_0x83e6('0x16')]('Dashboard,\x20%s,\x20%s',_0x5bdf1f,_0x1df0bf);_0x14ee03(_0x1df0bf);});});} \ No newline at end of file +var _0xe362=['socket.io-emitter','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xe362,0x194));var _0x2e36=function(_0x589589,_0x484d80){_0x589589=_0x589589-0x0;var _0x1ae411=_0xe362[_0x589589];return _0x1ae411;};'use strict';var _=require(_0x2e36('0x0'));var util=require('util');var moment=require(_0x2e36('0x1'));var BPromise=require(_0x2e36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e36('0x3'));var db=require(_0x2e36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e36('0x5'));var jayson=require(_0x2e36('0x6'));var client=jayson[_0x2e36('0x7')][_0x2e36('0x8')]({'port':0x232a});config[_0x2e36('0x9')]=_[_0x2e36('0xa')](config['redis'],{'host':_0x2e36('0xb'),'port':0x18eb});var socket=require(_0x2e36('0xc'))(new Redis(config[_0x2e36('0x9')]));require(_0x2e36('0xd'))['register'](socket);function respondWithRpcPromise(_0x4d0dd6,_0x219a8d,_0x4676c4){return new BPromise(function(_0x2eee80,_0x435926){return client[_0x2e36('0xe')](_0x4d0dd6,_0x4676c4)['then'](function(_0x15352d){logger[_0x2e36('0xf')](_0x2e36('0x10'),_0x219a8d,_0x2e36('0x11'));logger[_0x2e36('0x12')](_0x2e36('0x13'),_0x219a8d,_0x2e36('0x11'),JSON[_0x2e36('0x14')](_0x15352d));if(_0x15352d['error']){if(_0x15352d[_0x2e36('0x15')][_0x2e36('0x16')]===0x1f4){logger[_0x2e36('0x15')](_0x2e36('0x10'),_0x219a8d,_0x15352d[_0x2e36('0x15')][_0x2e36('0x17')]);return _0x435926(_0x15352d[_0x2e36('0x15')]['message']);}logger[_0x2e36('0x15')](_0x2e36('0x10'),_0x219a8d,_0x15352d[_0x2e36('0x15')]['message']);return _0x2eee80(_0x15352d['error']['message']);}else{logger[_0x2e36('0xf')](_0x2e36('0x10'),_0x219a8d,'request\x20sent');_0x2eee80(_0x15352d[_0x2e36('0x18')][_0x2e36('0x17')]);}})[_0x2e36('0x19')](function(_0x2270fa){logger[_0x2e36('0x15')](_0x2e36('0x10'),_0x219a8d,_0x2270fa);_0x435926(_0x2270fa);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 44f6c6b..cb60a59 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 _0xfaef=['dashboard:','./dashboard.events','save','remove','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaef,0x164));var _0xffae=function(_0x535c6d,_0x3a839e){_0x535c6d=_0x535c6d-0x0;var _0x2b8db5=_0xfaef[_0x535c6d];return _0x2b8db5;};'use strict';var DashboardEvents=require(_0xffae('0x0'));var events=[_0xffae('0x1'),_0xffae('0x2'),'update'];function createListener(_0x30ebce,_0x579933){return function(_0x2f7d69){_0x579933['emit'](_0x30ebce,_0x2f7d69);};}function removeListener(_0x9224f5,_0x3b599f){return function(){DashboardEvents[_0xffae('0x3')](_0x9224f5,_0x3b599f);};}exports['register']=function(_0x2811ab){for(var _0x1267fa=0x0,_0x27cf07=events['length'];_0x1267fa<_0x27cf07;_0x1267fa++){var _0x6709bb=events[_0x1267fa];var _0x18623c=createListener(_0xffae('0x4')+_0x6709bb,_0x2811ab);DashboardEvents['on'](_0x6709bb,_0x18623c);}}; \ No newline at end of file +var _0x2cc0=['register','length','dashboard:','update','emit'];(function(_0x551064,_0x59d985){var _0x5cca20=function(_0x53428a){while(--_0x53428a){_0x551064['push'](_0x551064['shift']());}};_0x5cca20(++_0x59d985);}(_0x2cc0,0x17f));var _0x02cc=function(_0xcda445,_0x51f2e1){_0xcda445=_0xcda445-0x0;var _0xa38402=_0x2cc0[_0xcda445];return _0xa38402;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x02cc('0x0')];function createListener(_0x254b1c,_0x33597e){return function(_0x2b6f59){_0x33597e[_0x02cc('0x1')](_0x254b1c,_0x2b6f59);};}function removeListener(_0x8321a6,_0x53c16d){return function(){DashboardEvents['removeListener'](_0x8321a6,_0x53c16d);};}exports[_0x02cc('0x2')]=function(_0x558cb2){for(var _0x26c4e2=0x0,_0x11f7a9=events[_0x02cc('0x3')];_0x26c4e2<_0x11f7a9;_0x26c4e2++){var _0x5ff27d=events[_0x26c4e2];var _0x4be08e=createListener(_0x02cc('0x4')+_0x5ff27d,_0x558cb2);DashboardEvents['on'](_0x5ff27d,_0x4be08e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e3ddc92..fd1c7c5 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 _0xd26f=['/:id/clone','clone','addItem','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/items','getItems','post'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0xd26f,0x1e6));var _0xfd26=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xd26f[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require('multer');var util=require(_0xfd26('0x0'));var path=require(_0xfd26('0x1'));var timeout=require(_0xfd26('0x2'));var express=require(_0xfd26('0x3'));var router=express['Router']();var fs_extra=require(_0xfd26('0x4'));var auth=require(_0xfd26('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd26('0x6'));var controller=require('./dashboard.controller');router[_0xfd26('0x7')]('/',auth[_0xfd26('0x8')](),controller['index']);router['get'](_0xfd26('0x9'),auth[_0xfd26('0x8')](),controller[_0xfd26('0xa')]);router[_0xfd26('0x7')](_0xfd26('0xb'),auth[_0xfd26('0x8')](),controller[_0xfd26('0xc')]);router[_0xfd26('0xd')]('/',auth[_0xfd26('0x8')](),controller['create']);router[_0xfd26('0xd')](_0xfd26('0xe'),auth[_0xfd26('0x8')](),controller[_0xfd26('0xf')]);router[_0xfd26('0xd')](_0xfd26('0xb'),auth[_0xfd26('0x8')](),controller[_0xfd26('0x10')]);router[_0xfd26('0x11')](_0xfd26('0x9'),auth['isAuthenticated'](),controller[_0xfd26('0x12')]);router[_0xfd26('0x13')](_0xfd26('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x976e=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/items','post','create','/:id/clone','clone','addItem','put','/:id','update','delete'];(function(_0x2e1653,_0x105732){var _0x5377a4=function(_0x53330d){while(--_0x53330d){_0x2e1653['push'](_0x2e1653['shift']());}};_0x5377a4(++_0x105732);}(_0x976e,0xca));var _0xe976=function(_0x2bc458,_0x10869e){_0x2bc458=_0x2bc458-0x0;var _0x1e46ba=_0x976e[_0x2bc458];return _0x1e46ba;};'use strict';var multer=require(_0xe976('0x0'));var util=require(_0xe976('0x1'));var path=require(_0xe976('0x2'));var timeout=require('connect-timeout');var express=require(_0xe976('0x3'));var router=express[_0xe976('0x4')]();var fs_extra=require(_0xe976('0x5'));var auth=require(_0xe976('0x6'));var interaction=require(_0xe976('0x7'));var config=require(_0xe976('0x8'));var controller=require('./dashboard.controller');router[_0xe976('0x9')]('/',auth[_0xe976('0xa')](),controller[_0xe976('0xb')]);router[_0xe976('0x9')]('/:id',auth[_0xe976('0xa')](),controller[_0xe976('0xc')]);router[_0xe976('0x9')](_0xe976('0xd'),auth[_0xe976('0xa')](),controller['getItems']);router[_0xe976('0xe')]('/',auth[_0xe976('0xa')](),controller[_0xe976('0xf')]);router[_0xe976('0xe')](_0xe976('0x10'),auth[_0xe976('0xa')](),controller[_0xe976('0x11')]);router[_0xe976('0xe')](_0xe976('0xd'),auth['isAuthenticated'](),controller[_0xe976('0x12')]);router[_0xe976('0x13')](_0xe976('0x14'),auth[_0xe976('0xa')](),controller[_0xe976('0x15')]);router[_0xe976('0x16')](_0xe976('0x14'),auth[_0xe976('0xa')](),controller[_0xe976('0x17')]);module[_0xe976('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c475541..9b6dddd 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 _0x2a07=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x3a9083,_0x3c9f8d){var _0x160306=function(_0x312020){while(--_0x312020){_0x3a9083['push'](_0x3a9083['shift']());}};_0x160306(++_0x3c9f8d);}(_0x2a07,0x74));var _0x72a0=function(_0x4baf98,_0xa7ebd9){_0x4baf98=_0x4baf98-0x0;var _0x5da718=_0x2a07[_0x4baf98];return _0x5da718;};'use strict';var Sequelize=require(_0x72a0('0x0'));var squel=require(_0x72a0('0x1'));var _=require(_0x72a0('0x2'));module[_0x72a0('0x3')]={'title':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x72a0('0x5')](_0x72a0('0x6')),'get':function(){try{return JSON[_0x72a0('0x7')](this[_0x72a0('0x8')](_0x72a0('0x9')));}catch(_0xce74c){return[];}},'set':function(_0x3ccf6d){try{this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')](_0x3ccf6d));}catch(_0x21c819){this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x72a0('0xc')]},'background':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':_0x72a0('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x72a0('0x4')]},'titleFontSize':{'type':Sequelize[_0x72a0('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'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 608ee6c..9497c8f 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 _0x2aa3=['HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','keys','DashboardItem','rawAttributes','query','filters','model','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat'];(function(_0x148ea8,_0x422282){var _0x5265cb=function(_0x9f6a0e){while(--_0x9f6a0e){_0x148ea8['push'](_0x148ea8['shift']());}};_0x5265cb(++_0x422282);}(_0x2aa3,0x83));var _0x32aa=function(_0x2f8cfd,_0x2850ee){_0x2f8cfd=_0x2f8cfd-0x0;var _0x44220a=_0x2aa3[_0x2f8cfd];return _0x44220a;};'use strict';var emlformat=require(_0x32aa('0x0'));var rimraf=require(_0x32aa('0x1'));var zipdir=require(_0x32aa('0x2'));var jsonpatch=require(_0x32aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x32aa('0x4'));var Mustache=require(_0x32aa('0x5'));var util=require(_0x32aa('0x6'));var path=require(_0x32aa('0x7'));var sox=require(_0x32aa('0x8'));var csv=require(_0x32aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32aa('0xa'));var _=require(_0x32aa('0xb'));var squel=require(_0x32aa('0xc'));var crypto=require(_0x32aa('0xd'));var jsforce=require(_0x32aa('0xe'));var deskjs=require(_0x32aa('0xf'));var toCsv=require(_0x32aa('0x9'));var querystring=require(_0x32aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x32aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x32aa('0x12'));var as=require(_0x32aa('0x13'));var hardwareService=require(_0x32aa('0x14'));var logger=require(_0x32aa('0x15'))('api');var utils=require(_0x32aa('0x16'));var config=require(_0x32aa('0x17'));var licenseUtil=require(_0x32aa('0x18'));var db=require('../../mysqldb')['db'];config[_0x32aa('0x19')]=_[_0x32aa('0x1a')](config[_0x32aa('0x19')],{'host':_0x32aa('0x1b'),'port':0x18eb});var socket=require(_0x32aa('0x1c'))(new Redis(config[_0x32aa('0x19')]));require(_0x32aa('0x1d'))[_0x32aa('0x1e')](socket);function respondWithStatusCode(_0x58d625,_0x274ae0){_0x274ae0=_0x274ae0||0xcc;return function(_0x230d19){if(_0x230d19){return _0x58d625[_0x32aa('0x1f')](_0x274ae0);}return _0x58d625[_0x32aa('0x20')](_0x274ae0)[_0x32aa('0x21')]();};}function respondWithResult(_0x47eadd,_0x2b1704){_0x2b1704=_0x2b1704||0xc8;return function(_0x251fa4){if(_0x251fa4){return _0x47eadd[_0x32aa('0x20')](_0x2b1704)[_0x32aa('0x22')](_0x251fa4);}};}function respondWithFilteredResult(_0x29c1c4,_0x4f2a1a){return function(_0x5196c0){if(_0x5196c0){var _0x3e0a23=typeof _0x4f2a1a[_0x32aa('0x23')]===_0x32aa('0x24')&&typeof _0x4f2a1a['limit']==='undefined';var _0x1a0262=_0x5196c0[_0x32aa('0x25')];var _0x1d7490=_0x3e0a23?0x0:_0x4f2a1a[_0x32aa('0x23')];var _0x37cef8=_0x3e0a23?_0x5196c0[_0x32aa('0x25')]:_0x4f2a1a['offset']+_0x4f2a1a[_0x32aa('0x26')];var _0x327831;if(_0x37cef8>=_0x1a0262){_0x37cef8=_0x1a0262;_0x327831=0xc8;}else{_0x327831=0xce;}_0x29c1c4[_0x32aa('0x20')](_0x327831);return _0x29c1c4[_0x32aa('0x27')](_0x32aa('0x28'),_0x1d7490+'-'+_0x37cef8+'/'+_0x1a0262)[_0x32aa('0x22')](_0x5196c0);}return null;};}function patchUpdates(_0x1ce405){return function(_0x229995){try{jsonpatch[_0x32aa('0x29')](_0x229995,_0x1ce405,!![]);}catch(_0x53c65a){return BPromise[_0x32aa('0x2a')](_0x53c65a);}return _0x229995['save']();};}function saveUpdates(_0x6766da,_0xb973f){return function(_0x5aabeb){if(_0x5aabeb){return _0x5aabeb['update'](_0x6766da)[_0x32aa('0x2b')](function(_0x313930){return _0x313930;});}return null;};}function removeEntity(_0x3ba6b2,_0x13d610){return function(_0x1f9789){if(_0x1f9789){return _0x1f9789[_0x32aa('0x2c')]()[_0x32aa('0x2b')](function(){_0x3ba6b2[_0x32aa('0x20')](0xcc)[_0x32aa('0x21')]();});}};}function handleEntityNotFound(_0x5750e2,_0x128774){return function(_0x2e3a5d){if(!_0x2e3a5d){_0x5750e2['sendStatus'](0x194);}return _0x2e3a5d;};}function handleError(_0x385707,_0x4ccb91){_0x4ccb91=_0x4ccb91||0x1f4;return function(_0x4f73d1){logger[_0x32aa('0x2d')](_0x4f73d1[_0x32aa('0x2e')]);if(_0x4f73d1[_0x32aa('0x2f')]){delete _0x4f73d1[_0x32aa('0x2f')];}_0x385707['status'](_0x4ccb91)[_0x32aa('0x30')](_0x4f73d1);};}exports[_0x32aa('0x31')]=function(_0xe8617c,_0x29706e){var _0x19efc6={'raw':![],'where':{'id':_0xe8617c['params']['id']}},_0x44887c={};_0x44887c['model']=_[_0x32aa('0x32')](db[_0x32aa('0x33')][_0x32aa('0x34')]);_0x44887c[_0x32aa('0x35')]=_['keys'](_0xe8617c['query']);_0x44887c[_0x32aa('0x36')]=_['intersection'](_0x44887c[_0x32aa('0x37')],_0x44887c[_0x32aa('0x35')]);_0x19efc6['attributes']=_[_0x32aa('0x38')](_0x44887c[_0x32aa('0x37')],qs['fields'](_0xe8617c[_0x32aa('0x35')][_0x32aa('0x39')]));_0x19efc6[_0x32aa('0x3a')]=_0x19efc6[_0x32aa('0x3a')][_0x32aa('0x3b')]?_0x19efc6[_0x32aa('0x3a')]:_0x44887c[_0x32aa('0x37')];if(_0xe8617c[_0x32aa('0x35')][_0x32aa('0x3c')]){_0x19efc6[_0x32aa('0x3d')]=[{'all':!![]}];}_0x19efc6=_[_0x32aa('0x3e')]({},_0x19efc6,_0xe8617c[_0x32aa('0x3f')]);return db[_0x32aa('0x33')][_0x32aa('0x40')](_0x19efc6)['then'](handleEntityNotFound(_0x29706e,null))[_0x32aa('0x2b')](respondWithResult(_0x29706e,null))[_0x32aa('0x41')](handleError(_0x29706e,null));};exports[_0x32aa('0x2c')]=function(_0x3a9d83,_0x193d10){return db['DashboardItem'][_0x32aa('0x40')]({'where':{'id':_0x3a9d83[_0x32aa('0x42')]['id']}})[_0x32aa('0x2b')](handleEntityNotFound(_0x193d10,null))[_0x32aa('0x2b')](removeEntity(_0x193d10,null))[_0x32aa('0x41')](handleError(_0x193d10,null));};function widgetAttributes(_0xa48198){try{switch(_0xa48198[_0x32aa('0x43')]){case _0x32aa('0x44'):return[{'name':_0x32aa('0x45'),'value':_0xa48198[_0x32aa('0x45')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x0]?_0xa48198['attrs'][0x0][_0x32aa('0x47')]:undefined)||_0x32aa('0x48')}];case _0x32aa('0x49'):return[{'name':_0x32aa('0x4a'),'value':_0xa48198[_0x32aa('0x4a')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x0]?_0xa48198['attrs'][0x0][_0x32aa('0x47')]:undefined)||''}];case _0x32aa('0x4b'):return[{'name':_0x32aa('0x4c'),'value':_0xa48198[_0x32aa('0x4c')]||(_0xa48198['attrs']&&_0xa48198[_0x32aa('0x46')][0x0]?_0xa48198['attrs'][0x0][_0x32aa('0x47')]:undefined)||_0x32aa('0x4d')},{'name':_0x32aa('0x4e'),'value':_0xa48198[_0x32aa('0x4e')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x1]?_0xa48198[_0x32aa('0x46')][0x1][_0x32aa('0x47')]:undefined)||_0x32aa('0x4f')},{'name':_0x32aa('0x50'),'value':_0xa48198['attrFontSize']||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x2]?_0xa48198[_0x32aa('0x46')][0x2][_0x32aa('0x47')]:undefined)||0xc}];case'counter':return[{'name':_0x32aa('0x51'),'value':_0xa48198[_0x32aa('0x51')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x0]?_0xa48198[_0x32aa('0x46')][0x0][_0x32aa('0x47')]:undefined)||_0x32aa('0x52')},{'name':_0x32aa('0x53'),'value':_0xa48198['attrVoiceQueues']||(_0xa48198['attrs']&&_0xa48198[_0x32aa('0x46')][0x1]?_0xa48198[_0x32aa('0x46')][0x1][_0x32aa('0x47')]:undefined)||[]},{'name':_0x32aa('0x50'),'value':_0xa48198[_0x32aa('0x50')]||(_0xa48198['attrs']&&_0xa48198[_0x32aa('0x46')][0x2]?_0xa48198[_0x32aa('0x46')][0x2][_0x32aa('0x47')]:undefined)||0x14},{'name':'attrChannel','value':_0xa48198[_0x32aa('0x54')]||(_0xa48198['attrs']&&_0xa48198['attrs'][0x3]?_0xa48198[_0x32aa('0x46')][0x3][_0x32aa('0x47')]:undefined)||_0x32aa('0x55')},{'name':'attrEmailAccounts','value':_0xa48198['attrEmailAccounts']||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x4]?_0xa48198[_0x32aa('0x46')][0x4][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x56'),'value':_0xa48198[_0x32aa('0x56')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x5]?_0xa48198[_0x32aa('0x46')][0x5][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x57'),'value':_0xa48198[_0x32aa('0x57')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x6]?_0xa48198['attrs'][0x6]['value']:undefined)||''},{'name':_0x32aa('0x58'),'value':_0xa48198[_0x32aa('0x58')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x7]?_0xa48198[_0x32aa('0x46')][0x7][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x59'),'value':_0xa48198[_0x32aa('0x59')]||(_0xa48198['attrs']&&_0xa48198['attrs'][0x8]?_0xa48198[_0x32aa('0x46')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0xa48198[_0x32aa('0x5a')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x9]?_0xa48198[_0x32aa('0x46')][0x9][_0x32aa('0x47')]:undefined)||''}];case _0x32aa('0x5b'):case'pie-chart':return[{'name':_0x32aa('0x5c'),'value':_0xa48198['attrSerie1']||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x0]?_0xa48198[_0x32aa('0x46')][0x0][_0x32aa('0x47')]:undefined)||_0x32aa('0x52')},{'name':_0x32aa('0x5d'),'value':_0xa48198[_0x32aa('0x5d')]||(_0xa48198['attrs']&&_0xa48198[_0x32aa('0x46')][0x1]?_0xa48198['attrs'][0x1]['value']:undefined)||null},{'name':_0x32aa('0x5e'),'value':_0xa48198['attrSerie3']||(_0xa48198['attrs']&&_0xa48198[_0x32aa('0x46')][0x2]?_0xa48198[_0x32aa('0x46')][0x2][_0x32aa('0x47')]:undefined)||null},{'name':_0x32aa('0x53'),'value':_0xa48198['attrVoiceQueues']||(_0xa48198['attrs']&&_0xa48198['attrs'][0x3]?_0xa48198[_0x32aa('0x46')][0x3][_0x32aa('0x47')]:undefined)||[]},{'name':'attrChannel','value':_0xa48198[_0x32aa('0x54')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x4]?_0xa48198[_0x32aa('0x46')][0x4][_0x32aa('0x47')]:undefined)||_0x32aa('0x55')},{'name':_0x32aa('0x5f'),'value':_0xa48198[_0x32aa('0x5f')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x5]?_0xa48198[_0x32aa('0x46')][0x5]['value']:undefined)||''},{'name':_0x32aa('0x56'),'value':_0xa48198['attrFaxAccounts']||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x6]?_0xa48198[_0x32aa('0x46')][0x6][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x57'),'value':_0xa48198[_0x32aa('0x57')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x7]?_0xa48198['attrs'][0x7][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x58'),'value':_0xa48198[_0x32aa('0x58')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x8]?_0xa48198['attrs'][0x8][_0x32aa('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xa48198[_0x32aa('0x59')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x9]?_0xa48198[_0x32aa('0x46')][0x9][_0x32aa('0x47')]:undefined)||''},{'name':_0x32aa('0x5a'),'value':_0xa48198[_0x32aa('0x5a')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0xa]?_0xa48198['attrs'][0xa][_0x32aa('0x47')]:undefined)||''}];case _0x32aa('0x60'):return[{'name':_0x32aa('0x61'),'type':_0xa48198[_0x32aa('0x62')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198['attrs'][0x0]?_0xa48198[_0x32aa('0x46')][0x0]['type']:undefined)||null,'value':_0xa48198[_0x32aa('0x61')]||(_0xa48198['attrs']&&_0xa48198['attrs'][0x0]?_0xa48198[_0x32aa('0x46')][0x0][_0x32aa('0x47')]:undefined)||null},{'name':_0x32aa('0x63'),'value':_0xa48198[_0x32aa('0x63')]||(_0xa48198[_0x32aa('0x46')]&&_0xa48198[_0x32aa('0x46')][0x1]?_0xa48198[_0x32aa('0x46')][0x1][_0x32aa('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x3f6b40){logger['error']('widgetAttributes:\x20%s',JSON[_0x32aa('0x64')](_0x3f6b40));return[];}}exports[_0x32aa('0x65')]=function(_0x329b6e,_0x4e6c1a){if(_0x329b6e['body']){_0x329b6e[_0x32aa('0x66')][_0x32aa('0x46')]=widgetAttributes(_0x329b6e[_0x32aa('0x66')]);}return db[_0x32aa('0x33')][_0x32aa('0x65')](_0x329b6e[_0x32aa('0x66')],{})['then'](respondWithResult(_0x4e6c1a,0xc9))[_0x32aa('0x41')](handleError(_0x4e6c1a,null));};exports[_0x32aa('0x67')]=function(_0x15bea7,_0x233f9b){if(_0x15bea7[_0x32aa('0x66')]['id']){delete _0x15bea7[_0x32aa('0x66')]['id'];}_0x15bea7[_0x32aa('0x66')][_0x32aa('0x46')]=widgetAttributes(_0x15bea7[_0x32aa('0x66')]);return db[_0x32aa('0x33')][_0x32aa('0x40')]({'where':{'id':_0x15bea7[_0x32aa('0x42')]['id']}})[_0x32aa('0x2b')](handleEntityNotFound(_0x233f9b,null))[_0x32aa('0x2b')](saveUpdates(_0x15bea7[_0x32aa('0x66')],null))[_0x32aa('0x2b')](respondWithResult(_0x233f9b,null))[_0x32aa('0x41')](handleError(_0x233f9b,null));}; \ No newline at end of file +var _0x71ab=['attrRefresh','widgetAttributes:\x20%s','stringify','body','create','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','params','keys','DashboardItem','rawAttributes','query','intersection','model','attributes','fields','length','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];config['redis']=_['defaults'](config[_0xb71a('0x19')],{'host':_0xb71a('0x1a'),'port':0x18eb});var socket=require(_0xb71a('0x1b'))(new Redis(config[_0xb71a('0x19')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x5364e3,_0x12900a){_0x12900a=_0x12900a||0xcc;return function(_0xc189cd){if(_0xc189cd){return _0x5364e3[_0xb71a('0x1c')](_0x12900a);}return _0x5364e3[_0xb71a('0x1d')](_0x12900a)[_0xb71a('0x1e')]();};}function respondWithResult(_0x1e9363,_0x31def2){_0x31def2=_0x31def2||0xc8;return function(_0x2ec64a){if(_0x2ec64a){return _0x1e9363[_0xb71a('0x1d')](_0x31def2)['json'](_0x2ec64a);}};}function respondWithFilteredResult(_0x1ca65e,_0x2d6369){return function(_0x374c8c){if(_0x374c8c){var _0x346524=typeof _0x2d6369[_0xb71a('0x1f')]===_0xb71a('0x20')&&typeof _0x2d6369[_0xb71a('0x21')]===_0xb71a('0x20');var _0x20bdfe=_0x374c8c[_0xb71a('0x22')];var _0x16394a=_0x346524?0x0:_0x2d6369['offset'];var _0x5bb77a=_0x346524?_0x374c8c[_0xb71a('0x22')]:_0x2d6369[_0xb71a('0x1f')]+_0x2d6369['limit'];var _0x4d8871;if(_0x5bb77a>=_0x20bdfe){_0x5bb77a=_0x20bdfe;_0x4d8871=0xc8;}else{_0x4d8871=0xce;}_0x1ca65e[_0xb71a('0x1d')](_0x4d8871);return _0x1ca65e['set'](_0xb71a('0x23'),_0x16394a+'-'+_0x5bb77a+'/'+_0x20bdfe)[_0xb71a('0x24')](_0x374c8c);}return null;};}function patchUpdates(_0x3ac77b){return function(_0x18fa8d){try{jsonpatch[_0xb71a('0x25')](_0x18fa8d,_0x3ac77b,!![]);}catch(_0x14b2a1){return BPromise[_0xb71a('0x26')](_0x14b2a1);}return _0x18fa8d[_0xb71a('0x27')]();};}function saveUpdates(_0x5f3f19,_0xd40f86){return function(_0x2c15bc){if(_0x2c15bc){return _0x2c15bc[_0xb71a('0x28')](_0x5f3f19)[_0xb71a('0x29')](function(_0x3401f7){return _0x3401f7;});}return null;};}function removeEntity(_0x1a010d,_0x20ed75){return function(_0xfc8df0){if(_0xfc8df0){return _0xfc8df0[_0xb71a('0x2a')]()[_0xb71a('0x29')](function(){_0x1a010d[_0xb71a('0x1d')](0xcc)[_0xb71a('0x1e')]();});}};}function handleEntityNotFound(_0x160f0f,_0x5ae0ed){return function(_0x2e8ea6){if(!_0x2e8ea6){_0x160f0f[_0xb71a('0x1c')](0x194);}return _0x2e8ea6;};}function handleError(_0x1689ce,_0x358954){_0x358954=_0x358954||0x1f4;return function(_0x2fbd73){logger[_0xb71a('0x2b')](_0x2fbd73[_0xb71a('0x2c')]);if(_0x2fbd73[_0xb71a('0x2d')]){delete _0x2fbd73[_0xb71a('0x2d')];}_0x1689ce[_0xb71a('0x1d')](_0x358954)[_0xb71a('0x2e')](_0x2fbd73);};}exports['show']=function(_0x56f5a4,_0x3112d3){var _0x5c2a45={'raw':![],'where':{'id':_0x56f5a4[_0xb71a('0x2f')]['id']}},_0x70299a={};_0x70299a['model']=_[_0xb71a('0x30')](db[_0xb71a('0x31')][_0xb71a('0x32')]);_0x70299a[_0xb71a('0x33')]=_[_0xb71a('0x30')](_0x56f5a4[_0xb71a('0x33')]);_0x70299a['filters']=_[_0xb71a('0x34')](_0x70299a[_0xb71a('0x35')],_0x70299a[_0xb71a('0x33')]);_0x5c2a45[_0xb71a('0x36')]=_['intersection'](_0x70299a[_0xb71a('0x35')],qs[_0xb71a('0x37')](_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x37')]));_0x5c2a45[_0xb71a('0x36')]=_0x5c2a45[_0xb71a('0x36')][_0xb71a('0x38')]?_0x5c2a45[_0xb71a('0x36')]:_0x70299a[_0xb71a('0x35')];if(_0x56f5a4[_0xb71a('0x33')]['includeAll']){_0x5c2a45['include']=[{'all':!![]}];}_0x5c2a45=_[_0xb71a('0x39')]({},_0x5c2a45,_0x56f5a4[_0xb71a('0x3a')]);return db[_0xb71a('0x31')][_0xb71a('0x3b')](_0x5c2a45)[_0xb71a('0x29')](handleEntityNotFound(_0x3112d3,null))[_0xb71a('0x29')](respondWithResult(_0x3112d3,null))[_0xb71a('0x3c')](handleError(_0x3112d3,null));};exports['destroy']=function(_0x990c82,_0x57ad22){return db[_0xb71a('0x31')][_0xb71a('0x3b')]({'where':{'id':_0x990c82[_0xb71a('0x2f')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x57ad22,null))['then'](removeEntity(_0x57ad22,null))[_0xb71a('0x3c')](handleError(_0x57ad22,null));};function widgetAttributes(_0x3ff4ed){try{switch(_0x3ff4ed[_0xb71a('0x3d')]){case _0xb71a('0x3e'):return[{'name':_0xb71a('0x3f'),'value':_0x3ff4ed[_0xb71a('0x3f')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x0]?_0x3ff4ed[_0xb71a('0x40')][0x0]['value']:undefined)||_0xb71a('0x41')}];case'custom':return[{'name':_0xb71a('0x42'),'value':_0x3ff4ed[_0xb71a('0x42')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x0]?_0x3ff4ed[_0xb71a('0x40')][0x0][_0xb71a('0x43')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x3ff4ed['attrHourFormat']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x0]?_0x3ff4ed[_0xb71a('0x40')][0x0][_0xb71a('0x43')]:undefined)||_0xb71a('0x44')},{'name':_0xb71a('0x45'),'value':_0x3ff4ed[_0xb71a('0x45')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x1]?_0x3ff4ed[_0xb71a('0x40')][0x1][_0xb71a('0x43')]:undefined)||_0xb71a('0x46')},{'name':_0xb71a('0x47'),'value':_0x3ff4ed[_0xb71a('0x47')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x2]?_0x3ff4ed[_0xb71a('0x40')][0x2][_0xb71a('0x43')]:undefined)||0xc}];case _0xb71a('0x48'):return[{'name':_0xb71a('0x49'),'value':_0x3ff4ed[_0xb71a('0x49')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x0]?_0x3ff4ed['attrs'][0x0]['value']:undefined)||_0xb71a('0x4a')},{'name':_0xb71a('0x4b'),'value':_0x3ff4ed[_0xb71a('0x4b')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x1]?_0x3ff4ed[_0xb71a('0x40')][0x1]['value']:undefined)||[]},{'name':_0xb71a('0x47'),'value':_0x3ff4ed[_0xb71a('0x47')]||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x2]?_0x3ff4ed[_0xb71a('0x40')][0x2][_0xb71a('0x43')]:undefined)||0x14},{'name':_0xb71a('0x4c'),'value':_0x3ff4ed['attrChannel']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x3]?_0x3ff4ed[_0xb71a('0x40')][0x3]['value']:undefined)||_0xb71a('0x4d')},{'name':_0xb71a('0x4e'),'value':_0x3ff4ed[_0xb71a('0x4e')]||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x4]?_0x3ff4ed[_0xb71a('0x40')][0x4][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x4f'),'value':_0x3ff4ed[_0xb71a('0x4f')]||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x5]?_0x3ff4ed[_0xb71a('0x40')][0x5][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x50'),'value':_0x3ff4ed['attrSmsAccounts']||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x6]?_0x3ff4ed[_0xb71a('0x40')][0x6][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x51'),'value':_0x3ff4ed[_0xb71a('0x51')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x7]?_0x3ff4ed[_0xb71a('0x40')][0x7][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x52'),'value':_0x3ff4ed['attrWhatsappAccounts']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x8]?_0x3ff4ed['attrs'][0x8][_0xb71a('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3ff4ed[_0xb71a('0x53')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x9]?_0x3ff4ed[_0xb71a('0x40')][0x9][_0xb71a('0x43')]:undefined)||''}];case'multibar-chart':case _0xb71a('0x54'):return[{'name':'attrSerie1','value':_0x3ff4ed[_0xb71a('0x55')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x0]?_0x3ff4ed['attrs'][0x0][_0xb71a('0x43')]:undefined)||_0xb71a('0x4a')},{'name':'attrSerie2','value':_0x3ff4ed['attrSerie2']||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x1]?_0x3ff4ed['attrs'][0x1]['value']:undefined)||null},{'name':_0xb71a('0x56'),'value':_0x3ff4ed[_0xb71a('0x56')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x2]?_0x3ff4ed['attrs'][0x2][_0xb71a('0x43')]:undefined)||null},{'name':_0xb71a('0x4b'),'value':_0x3ff4ed[_0xb71a('0x4b')]||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x3]?_0x3ff4ed[_0xb71a('0x40')][0x3]['value']:undefined)||[]},{'name':_0xb71a('0x4c'),'value':_0x3ff4ed[_0xb71a('0x4c')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x4]?_0x3ff4ed[_0xb71a('0x40')][0x4]['value']:undefined)||_0xb71a('0x4d')},{'name':_0xb71a('0x4e'),'value':_0x3ff4ed['attrEmailAccounts']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x5]?_0x3ff4ed[_0xb71a('0x40')][0x5][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x4f'),'value':_0x3ff4ed[_0xb71a('0x4f')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x6]?_0x3ff4ed['attrs'][0x6][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x50'),'value':_0x3ff4ed[_0xb71a('0x50')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x7]?_0x3ff4ed['attrs'][0x7]['value']:undefined)||''},{'name':_0xb71a('0x51'),'value':_0x3ff4ed[_0xb71a('0x51')]||(_0x3ff4ed['attrs']&&_0x3ff4ed[_0xb71a('0x40')][0x8]?_0x3ff4ed[_0xb71a('0x40')][0x8]['value']:undefined)||''},{'name':_0xb71a('0x52'),'value':_0x3ff4ed[_0xb71a('0x52')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x9]?_0x3ff4ed['attrs'][0x9][_0xb71a('0x43')]:undefined)||''},{'name':_0xb71a('0x53'),'value':_0x3ff4ed['attrChatWebsites']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0xa]?_0x3ff4ed[_0xb71a('0x40')][0xa][_0xb71a('0x43')]:undefined)||''}];case _0xb71a('0x57'):return[{'name':_0xb71a('0x58'),'type':_0x3ff4ed[_0xb71a('0x59')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed['attrs'][0x0]?_0x3ff4ed[_0xb71a('0x40')][0x0][_0xb71a('0x3d')]:undefined)||null,'value':_0x3ff4ed['attrReport']||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x0]?_0x3ff4ed['attrs'][0x0][_0xb71a('0x43')]:undefined)||null},{'name':_0xb71a('0x5a'),'value':_0x3ff4ed[_0xb71a('0x5a')]||(_0x3ff4ed[_0xb71a('0x40')]&&_0x3ff4ed[_0xb71a('0x40')][0x1]?_0x3ff4ed[_0xb71a('0x40')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x59b1b4){logger[_0xb71a('0x2b')](_0xb71a('0x5b'),JSON[_0xb71a('0x5c')](_0x59b1b4));return[];}}exports['create']=function(_0xe93fd,_0x5e58f7){if(_0xe93fd[_0xb71a('0x5d')]){_0xe93fd['body']['attrs']=widgetAttributes(_0xe93fd[_0xb71a('0x5d')]);}return db[_0xb71a('0x31')][_0xb71a('0x5e')](_0xe93fd[_0xb71a('0x5d')],{})[_0xb71a('0x29')](respondWithResult(_0x5e58f7,0xc9))['catch'](handleError(_0x5e58f7,null));};exports[_0xb71a('0x28')]=function(_0x58e746,_0x1adf18){if(_0x58e746[_0xb71a('0x5d')]['id']){delete _0x58e746[_0xb71a('0x5d')]['id'];}_0x58e746['body']['attrs']=widgetAttributes(_0x58e746[_0xb71a('0x5d')]);return db[_0xb71a('0x31')][_0xb71a('0x3b')]({'where':{'id':_0x58e746[_0xb71a('0x2f')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x1adf18,null))['then'](saveUpdates(_0x58e746[_0xb71a('0x5d')],null))[_0xb71a('0x29')](respondWithResult(_0x1adf18,null))[_0xb71a('0x3c')](handleError(_0x1adf18,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 49469d1..12369ed 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 _0x885a=['events','../../mysqldb','DashboardItem','update','emit','hook','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x885a,0x1ce));var _0xa885=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x885a[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0xa885('0x0'));var DashboardItem=require(_0xa885('0x1'))['db'][_0xa885('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa885('0x3'),'afterDestroy':'remove'};function emitEvent(_0x9284e){return function(_0x395cff,_0x4bfe4c,_0x555bd1){DashboardItemEvents[_0xa885('0x4')](_0x9284e+':'+_0x395cff['id'],_0x395cff);DashboardItemEvents[_0xa885('0x4')](_0x9284e,_0x395cff);_0x555bd1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xa885('0x5')](e,emitEvent(event));}}module[_0xa885('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x687a=['hook','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x687a,0xe8));var _0xa687=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x687a[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0xa687('0x0'));var DashboardItem=require(_0xa687('0x1'))['db'][_0xa687('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa687('0x3'),'afterUpdate':_0xa687('0x4'),'afterDestroy':_0xa687('0x5')};function emitEvent(_0x3bb399){return function(_0x12f2c1,_0x49263e,_0x48bf3e){DashboardItemEvents[_0xa687('0x6')](_0x3bb399+':'+_0x12f2c1['id'],_0x12f2c1);DashboardItemEvents[_0xa687('0x6')](_0x3bb399,_0x12f2c1);_0x48bf3e(null);};}for(var e in events){if(events[_0xa687('0x7')](e)){var event=events[e];DashboardItem[_0xa687('0x8')](e,emitEvent(event));}}module[_0xa687('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index cbcc848..5d843f7 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 _0x0b20=['util','api','path','../../config/environment','./dashboardItem.attributes','exports','dashboard_items'];(function(_0x283a7e,_0x3f0158){var _0x2ae9fa=function(_0x2d49d8){while(--_0x2d49d8){_0x283a7e['push'](_0x283a7e['shift']());}};_0x2ae9fa(++_0x3f0158);}(_0x0b20,0x134));var _0x00b2=function(_0x48e351,_0x20596e){_0x48e351=_0x48e351-0x0;var _0x345f5f=_0x0b20[_0x48e351];return _0x345f5f;};'use strict';var _=require('lodash');var util=require(_0x00b2('0x0'));var logger=require('../../config/logger')(_0x00b2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x00b2('0x2'));var rimraf=require('rimraf');var config=require(_0x00b2('0x3'));var attributes=require(_0x00b2('0x4'));module[_0x00b2('0x5')]=function(_0x4468c3,_0x3a7652){return _0x4468c3['define']('DashboardItem',attributes,{'tableName':_0x00b2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02c5=['api','request-promise','./dashboardItem.attributes','DashboardItem','dashboard_items','lodash','util'];(function(_0x5ca95e,_0x16b557){var _0x16485a=function(_0x21f402){while(--_0x21f402){_0x5ca95e['push'](_0x5ca95e['shift']());}};_0x16485a(++_0x16b557);}(_0x02c5,0x178));var _0x502c=function(_0x861e02,_0x33f772){_0x861e02=_0x861e02-0x0;var _0x48fc24=_0x02c5[_0x861e02];return _0x48fc24;};'use strict';var _=require(_0x502c('0x0'));var util=require(_0x502c('0x1'));var logger=require('../../config/logger')(_0x502c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x502c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x502c('0x4'));module['exports']=function(_0x59794a,_0x4f56db){return _0x59794a['define'](_0x502c('0x5'),attributes,{'tableName':_0x502c('0x6'),'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 f85a869..dc8eca4 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 _0x5a17=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5a17,0x18d));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75a1('0x0'));var util=require(_0x75a1('0x1'));var moment=require(_0x75a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x75a1('0x3'));var fs=require('fs');var Redis=require(_0x75a1('0x4'));var db=require(_0x75a1('0x5'))['db'];var utils=require(_0x75a1('0x6'));var logger=require(_0x75a1('0x7'))(_0x75a1('0x8'));var config=require(_0x75a1('0x9'));var jayson=require(_0x75a1('0xa'));var client=jayson[_0x75a1('0xb')][_0x75a1('0xc')]({'port':0x232a});config[_0x75a1('0xd')]=_['defaults'](config[_0x75a1('0xd')],{'host':_0x75a1('0xe'),'port':0x18eb});var socket=require(_0x75a1('0xf'))(new Redis(config[_0x75a1('0xd')]));require(_0x75a1('0x10'))[_0x75a1('0x11')](socket);function respondWithRpcPromise(_0x359d89,_0x82c9a6,_0x5d6615){return new BPromise(function(_0x381b72,_0x53c912){return client['request'](_0x359d89,_0x5d6615)['then'](function(_0x567c21){logger[_0x75a1('0x12')](_0x75a1('0x13'),_0x82c9a6,_0x75a1('0x14'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x82c9a6,_0x75a1('0x14'),JSON[_0x75a1('0x15')](_0x567c21));if(_0x567c21[_0x75a1('0x16')]){if(_0x567c21[_0x75a1('0x16')][_0x75a1('0x17')]===0x1f4){logger[_0x75a1('0x16')](_0x75a1('0x13'),_0x82c9a6,_0x567c21[_0x75a1('0x16')][_0x75a1('0x18')]);return _0x53c912(_0x567c21['error'][_0x75a1('0x18')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x82c9a6,_0x567c21[_0x75a1('0x16')]['message']);return _0x381b72(_0x567c21[_0x75a1('0x16')]['message']);}else{logger[_0x75a1('0x12')]('DashboardItem,\x20%s,\x20%s',_0x82c9a6,_0x75a1('0x14'));_0x381b72(_0x567c21[_0x75a1('0x19')]['message']);}})[_0x75a1('0x1a')](function(_0x2d46a7){logger[_0x75a1('0x16')](_0x75a1('0x13'),_0x82c9a6,_0x2d46a7);_0x53c912(_0x2d46a7);});});} \ No newline at end of file +var _0x7e65=['socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0xe742b6,_0x220f38){var _0x3cb710=function(_0x43e3e5){while(--_0x43e3e5){_0xe742b6['push'](_0xe742b6['shift']());}};_0x3cb710(++_0x220f38);}(_0x7e65,0x1f4));var _0x57e6=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x7e65[_0x5806c3];return _0x48ac77;};'use strict';var _=require(_0x57e6('0x0'));var util=require(_0x57e6('0x1'));var moment=require('moment');var BPromise=require(_0x57e6('0x2'));var rs=require(_0x57e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57e6('0x4'))['db'];var utils=require(_0x57e6('0x5'));var logger=require(_0x57e6('0x6'))(_0x57e6('0x7'));var config=require(_0x57e6('0x8'));var jayson=require(_0x57e6('0x9'));var client=jayson['client'][_0x57e6('0xa')]({'port':0x232a});config[_0x57e6('0xb')]=_['defaults'](config['redis'],{'host':_0x57e6('0xc'),'port':0x18eb});var socket=require(_0x57e6('0xd'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x57e6('0xe')](socket);function respondWithRpcPromise(_0x211c65,_0x3bf1cc,_0x3e43b6){return new BPromise(function(_0x26af7d,_0x3273bb){return client[_0x57e6('0xf')](_0x211c65,_0x3e43b6)[_0x57e6('0x10')](function(_0x4642de){logger[_0x57e6('0x11')](_0x57e6('0x12'),_0x3bf1cc,_0x57e6('0x13'));logger[_0x57e6('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3bf1cc,_0x57e6('0x13'),JSON[_0x57e6('0x15')](_0x4642de));if(_0x4642de[_0x57e6('0x16')]){if(_0x4642de[_0x57e6('0x16')][_0x57e6('0x17')]===0x1f4){logger['error'](_0x57e6('0x12'),_0x3bf1cc,_0x4642de[_0x57e6('0x16')][_0x57e6('0x18')]);return _0x3273bb(_0x4642de[_0x57e6('0x16')][_0x57e6('0x18')]);}logger['error'](_0x57e6('0x12'),_0x3bf1cc,_0x4642de[_0x57e6('0x16')][_0x57e6('0x18')]);return _0x26af7d(_0x4642de[_0x57e6('0x16')][_0x57e6('0x18')]);}else{logger[_0x57e6('0x11')](_0x57e6('0x12'),_0x3bf1cc,'request\x20sent');_0x26af7d(_0x4642de[_0x57e6('0x19')][_0x57e6('0x18')]);}})[_0x57e6('0x1a')](function(_0x108fa7){logger[_0x57e6('0x16')](_0x57e6('0x12'),_0x3bf1cc,_0x108fa7);_0x3273bb(_0x108fa7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 51c7567..494230d 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 _0x1809=['register','length','dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener'];(function(_0x595223,_0x101fe3){var _0x225784=function(_0x338939){while(--_0x338939){_0x595223['push'](_0x595223['shift']());}};_0x225784(++_0x101fe3);}(_0x1809,0x1e3));var _0x9180=function(_0x467dc5,_0x324670){_0x467dc5=_0x467dc5-0x0;var _0x580eca=_0x1809[_0x467dc5];return _0x580eca;};'use strict';var DashboardItemEvents=require(_0x9180('0x0'));var events=['save',_0x9180('0x1'),_0x9180('0x2')];function createListener(_0x599d33,_0xc48244){return function(_0x2e5f04){_0xc48244[_0x9180('0x3')](_0x599d33,_0x2e5f04);};}function removeListener(_0x163176,_0x1827c3){return function(){DashboardItemEvents[_0x9180('0x4')](_0x163176,_0x1827c3);};}exports[_0x9180('0x5')]=function(_0x3a1e9f){for(var _0x17eefa=0x0,_0x47250a=events[_0x9180('0x6')];_0x17eefa<_0x47250a;_0x17eefa++){var _0x1c3cf7=events[_0x17eefa];var _0x337985=createListener(_0x9180('0x7')+_0x1c3cf7,_0x3a1e9f);DashboardItemEvents['on'](_0x1c3cf7,_0x337985);}}; \ No newline at end of file +var _0xc982=['remove','update','emit','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x120313,_0x124d60){var _0x13c463=function(_0x5dde8f){while(--_0x5dde8f){_0x120313['push'](_0x120313['shift']());}};_0x13c463(++_0x124d60);}(_0xc982,0x86));var _0x2c98=function(_0x192b1c,_0x2d6f00){_0x192b1c=_0x192b1c-0x0;var _0x3c102f=_0xc982[_0x192b1c];return _0x3c102f;};'use strict';var DashboardItemEvents=require(_0x2c98('0x0'));var events=[_0x2c98('0x1'),_0x2c98('0x2'),_0x2c98('0x3')];function createListener(_0x4e70ba,_0x1e37ed){return function(_0x32a9f2){_0x1e37ed[_0x2c98('0x4')](_0x4e70ba,_0x32a9f2);};}function removeListener(_0x15fb76,_0x2bfb44){return function(){DashboardItemEvents['removeListener'](_0x15fb76,_0x2bfb44);};}exports[_0x2c98('0x5')]=function(_0x21b694){for(var _0x5d9706=0x0,_0xd4854c=events[_0x2c98('0x6')];_0x5d9706<_0xd4854c;_0x5d9706++){var _0x557540=events[_0x5d9706];var _0x75b04f=createListener(_0x2c98('0x7')+_0x557540,_0x21b694);DashboardItemEvents['on'](_0x557540,_0x75b04f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 7243332..01ed1fc 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 _0x130e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','post','isAuthenticated','put','delete','destroy'];(function(_0x204245,_0x4a4ffe){var _0x320ad6=function(_0x4f107f){while(--_0x4f107f){_0x204245['push'](_0x204245['shift']());}};_0x320ad6(++_0x4a4ffe);}(_0x130e,0x171));var _0xe130=function(_0x3fe833,_0x58ae75){_0x3fe833=_0x3fe833-0x0;var _0x491c9d=_0x130e[_0x3fe833];return _0x491c9d;};'use strict';var multer=require('multer');var util=require(_0xe130('0x0'));var path=require(_0xe130('0x1'));var timeout=require(_0xe130('0x2'));var express=require(_0xe130('0x3'));var router=express[_0xe130('0x4')]();var fs_extra=require(_0xe130('0x5'));var auth=require(_0xe130('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe130('0x7'));var controller=require('./dashboardItem.controller');router[_0xe130('0x8')](_0xe130('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe130('0xa')]('/',auth[_0xe130('0xb')](),controller['create']);router[_0xe130('0xc')](_0xe130('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe130('0xd')](_0xe130('0x9'),auth[_0xe130('0xb')](),controller[_0xe130('0xe')]);module[_0xe130('0xf')]=router; \ No newline at end of file +var _0xbee9=['isAuthenticated','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','post','create'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xbee9,0x1b8));var _0x9bee=function(_0x559733,_0x46d177){_0x559733=_0x559733-0x0;var _0x36a442=_0xbee9[_0x559733];return _0x36a442;};'use strict';var multer=require(_0x9bee('0x0'));var util=require('util');var path=require(_0x9bee('0x1'));var timeout=require('connect-timeout');var express=require(_0x9bee('0x2'));var router=express[_0x9bee('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9bee('0x4'));var config=require(_0x9bee('0x5'));var controller=require(_0x9bee('0x6'));router['get'](_0x9bee('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9bee('0x8')]('/',auth['isAuthenticated'](),controller[_0x9bee('0x9')]);router['put'](_0x9bee('0x7'),auth[_0x9bee('0xa')](),controller[_0x9bee('0xb')]);router[_0x9bee('0xc')](_0x9bee('0x7'),auth[_0x9bee('0xa')](),controller[_0x9bee('0xd')]);module[_0x9bee('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7e3a792..8591f37 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 _0x046b=['second','third','sequelize','STRING','ENUM','first'];(function(_0x2c9709,_0x37806c){var _0x46cd93=function(_0x49a767){while(--_0x49a767){_0x2c9709['push'](_0x2c9709['shift']());}};_0x46cd93(++_0x37806c);}(_0x046b,0x158));var _0xb046=function(_0x3901e3,_0x41d228){_0x3901e3=_0x3901e3-0x0;var _0x594592=_0x046b[_0x3901e3];return _0x594592;};'use strict';var Sequelize=require(_0xb046('0x0'));module['exports']={'name':{'type':Sequelize[_0xb046('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xb046('0x2')](_0xb046('0x3'),_0xb046('0x4'),_0xb046('0x5')),'allowNull':![],'defaultValue':_0xb046('0x3')},'description':{'type':Sequelize[_0xb046('0x1')]}}; \ No newline at end of file +var _0x4c79=['sequelize','exports','STRING','ENUM','first'];(function(_0x2f707a,_0x197be7){var _0x1ef99e=function(_0x38a2e7){while(--_0x38a2e7){_0x2f707a['push'](_0x2f707a['shift']());}};_0x1ef99e(++_0x197be7);}(_0x4c79,0xe1));var _0x94c7=function(_0x5c2600,_0xcf111){_0x5c2600=_0x5c2600-0x0;var _0x32de1f=_0x4c79[_0x5c2600];return _0x32de1f;};'use strict';var Sequelize=require(_0x94c7('0x0'));module[_0x94c7('0x1')]={'name':{'type':Sequelize[_0x94c7('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x94c7('0x3')](_0x94c7('0x4'),'second','third'),'allowNull':![],'defaultValue':_0x94c7('0x4')},'description':{'type':Sequelize[_0x94c7('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 49c6f92..c6b723f 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 _0xb959=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','then','get','Dispositions','error','stack','name','send','index','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb959,0xac));var _0x9b95=function(_0x53b893,_0x192172){_0x53b893=_0x53b893-0x0;var _0x24af7=_0xb959[_0x53b893];return _0x24af7;};'use strict';var emlformat=require(_0x9b95('0x0'));var rimraf=require(_0x9b95('0x1'));var zipdir=require(_0x9b95('0x2'));var jsonpatch=require(_0x9b95('0x3'));var rp=require(_0x9b95('0x4'));var moment=require(_0x9b95('0x5'));var BPromise=require(_0x9b95('0x6'));var Mustache=require(_0x9b95('0x7'));var util=require(_0x9b95('0x8'));var path=require(_0x9b95('0x9'));var sox=require(_0x9b95('0xa'));var csv=require(_0x9b95('0xb'));var ejs=require(_0x9b95('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b95('0xd'));var squel=require(_0x9b95('0xe'));var crypto=require(_0x9b95('0xf'));var jsforce=require(_0x9b95('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9b95('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b95('0x11'));var qs=require(_0x9b95('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b95('0x13'));var logger=require(_0x9b95('0x14'))(_0x9b95('0x15'));var utils=require('../../config/utils');var config=require(_0x9b95('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a12f2,_0x4b0710){_0x4b0710=_0x4b0710||0xcc;return function(_0x4bf97e){if(_0x4bf97e){return _0x1a12f2[_0x9b95('0x17')](_0x4b0710);}return _0x1a12f2[_0x9b95('0x18')](_0x4b0710)['end']();};}function respondWithResult(_0x58e186,_0x28afa9){_0x28afa9=_0x28afa9||0xc8;return function(_0x34b4e1){if(_0x34b4e1){return _0x58e186['status'](_0x28afa9)[_0x9b95('0x19')](_0x34b4e1);}};}function respondWithFilteredResult(_0xc659bb,_0x11fa7c){return function(_0x5c2db4){if(_0x5c2db4){var _0x2416d5=typeof _0x11fa7c['offset']===_0x9b95('0x1a')&&typeof _0x11fa7c['limit']===_0x9b95('0x1a');var _0x30b39a=_0x5c2db4[_0x9b95('0x1b')];var _0x45c82b=_0x2416d5?0x0:_0x11fa7c[_0x9b95('0x1c')];var _0x553fe6=_0x2416d5?_0x5c2db4['count']:_0x11fa7c[_0x9b95('0x1c')]+_0x11fa7c[_0x9b95('0x1d')];var _0x2f37dc;if(_0x553fe6>=_0x30b39a){_0x553fe6=_0x30b39a;_0x2f37dc=0xc8;}else{_0x2f37dc=0xce;}_0xc659bb[_0x9b95('0x18')](_0x2f37dc);return _0xc659bb[_0x9b95('0x1e')](_0x9b95('0x1f'),_0x45c82b+'-'+_0x553fe6+'/'+_0x30b39a)[_0x9b95('0x19')](_0x5c2db4);}return null;};}function patchUpdates(_0x9582d1){return function(_0x16b7b1){try{jsonpatch[_0x9b95('0x20')](_0x16b7b1,_0x9582d1,!![]);}catch(_0x11dc29){return BPromise['reject'](_0x11dc29);}return _0x16b7b1[_0x9b95('0x21')]();};}function saveUpdates(_0x554b2b,_0xd0ff57){return function(_0x2cccc3){if(_0x2cccc3){return _0x2cccc3['update'](_0x554b2b)['then'](function(_0x429bf5){return _0x429bf5;});}return null;};}function removeEntity(_0x2e2cf3,_0xd00463){return function(_0x103041){if(_0x103041){return _0x103041[_0x9b95('0x22')]()[_0x9b95('0x23')](function(){var _0x3c5dd2=_0x103041[_0x9b95('0x24')]({'plain':!![]});var _0x5bb6ec=_0x9b95('0x25');return db['UserProfileResource'][_0x9b95('0x22')]({'where':{'type':_0x5bb6ec,'resourceId':_0x3c5dd2['id']}})[_0x9b95('0x23')](function(){return _0x103041;});})['then'](function(){_0x2e2cf3[_0x9b95('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361cc3,_0x5c66fb){return function(_0x21a0d6){if(!_0x21a0d6){_0x361cc3[_0x9b95('0x17')](0x194);}return _0x21a0d6;};}function handleError(_0x22736b,_0x10c334){_0x10c334=_0x10c334||0x1f4;return function(_0xf699ca){logger[_0x9b95('0x26')](_0xf699ca[_0x9b95('0x27')]);if(_0xf699ca[_0x9b95('0x28')]){delete _0xf699ca[_0x9b95('0x28')];}_0x22736b['status'](_0x10c334)[_0x9b95('0x29')](_0xf699ca);};}exports[_0x9b95('0x2a')]=function(_0x4e843b,_0x5d2e0e){var _0x373d92={},_0x482534={},_0x3e3255={'count':0x0,'rows':[]};var _0x99c64=_['map'](db[_0x9b95('0x2b')][_0x9b95('0x2c')],function(_0xfe2375){return{'name':_0xfe2375['fieldName'],'type':_0xfe2375[_0x9b95('0x2d')][_0x9b95('0x2e')]};});_0x482534[_0x9b95('0x2f')]=_['map'](_0x99c64,'name');_0x482534[_0x9b95('0x30')]=_[_0x9b95('0x31')](_0x4e843b[_0x9b95('0x30')]);_0x482534[_0x9b95('0x32')]=_[_0x9b95('0x33')](_0x482534['model'],_0x482534[_0x9b95('0x30')]);_0x373d92[_0x9b95('0x34')]=_['intersection'](_0x482534['model'],qs[_0x9b95('0x35')](_0x4e843b[_0x9b95('0x30')]['fields']));_0x373d92[_0x9b95('0x34')]=_0x373d92[_0x9b95('0x34')][_0x9b95('0x36')]?_0x373d92[_0x9b95('0x34')]:_0x482534[_0x9b95('0x2f')];if(!_0x4e843b[_0x9b95('0x30')][_0x9b95('0x37')]('nolimit')){_0x373d92[_0x9b95('0x1d')]=qs['limit'](_0x4e843b[_0x9b95('0x30')][_0x9b95('0x1d')]);_0x373d92[_0x9b95('0x1c')]=qs[_0x9b95('0x1c')](_0x4e843b['query']['offset']);}_0x373d92[_0x9b95('0x38')]=qs[_0x9b95('0x39')](_0x4e843b[_0x9b95('0x30')][_0x9b95('0x39')]);_0x373d92[_0x9b95('0x3a')]=qs[_0x9b95('0x32')](_[_0x9b95('0x3b')](_0x4e843b['query'],_0x482534[_0x9b95('0x32')]),_0x99c64);if(_0x4e843b[_0x9b95('0x30')][_0x9b95('0x3c')]){_0x373d92[_0x9b95('0x3a')]=_[_0x9b95('0x3d')](_0x373d92[_0x9b95('0x3a')],{'$or':_['map'](_0x99c64,function(_0x4c4e9f){if(_0x4c4e9f[_0x9b95('0x2d')]!==_0x9b95('0x3e')){var _0x2486cc={};_0x2486cc[_0x4c4e9f[_0x9b95('0x28')]]={'$like':'%'+_0x4e843b[_0x9b95('0x30')][_0x9b95('0x3c')]+'%'};return _0x2486cc;}})});}_0x373d92=_[_0x9b95('0x3d')]({},_0x373d92,_0x4e843b[_0x9b95('0x3f')]);var _0x27cf35={'where':_0x373d92['where']};return db[_0x9b95('0x2b')][_0x9b95('0x1b')](_0x27cf35)['then'](function(_0x3a764e){_0x3e3255['count']=_0x3a764e;if(_0x4e843b[_0x9b95('0x30')][_0x9b95('0x40')]){_0x373d92[_0x9b95('0x41')]=[{'all':!![]}];}return db[_0x9b95('0x2b')][_0x9b95('0x42')](_0x373d92);})[_0x9b95('0x23')](function(_0x98c54f){_0x3e3255[_0x9b95('0x43')]=_0x98c54f;return _0x3e3255;})[_0x9b95('0x23')](respondWithFilteredResult(_0x5d2e0e,_0x373d92))[_0x9b95('0x44')](handleError(_0x5d2e0e,null));};exports[_0x9b95('0x45')]=function(_0x56b0e6,_0x6611b2){var _0x110047={'raw':!![],'where':{'id':_0x56b0e6[_0x9b95('0x46')]['id']}},_0xd24af={};_0xd24af[_0x9b95('0x2f')]=_[_0x9b95('0x31')](db[_0x9b95('0x2b')][_0x9b95('0x2c')]);_0xd24af[_0x9b95('0x30')]=_[_0x9b95('0x31')](_0x56b0e6[_0x9b95('0x30')]);_0xd24af['filters']=_[_0x9b95('0x33')](_0xd24af[_0x9b95('0x2f')],_0xd24af[_0x9b95('0x30')]);_0x110047['attributes']=_[_0x9b95('0x33')](_0xd24af['model'],qs[_0x9b95('0x35')](_0x56b0e6[_0x9b95('0x30')][_0x9b95('0x35')]));_0x110047[_0x9b95('0x34')]=_0x110047[_0x9b95('0x34')][_0x9b95('0x36')]?_0x110047['attributes']:_0xd24af[_0x9b95('0x2f')];if(_0x56b0e6['query']['includeAll']){_0x110047[_0x9b95('0x41')]=[{'all':!![]}];}_0x110047=_[_0x9b95('0x3d')]({},_0x110047,_0x56b0e6[_0x9b95('0x3f')]);return db['Disposition']['find'](_0x110047)[_0x9b95('0x23')](handleEntityNotFound(_0x6611b2,null))['then'](respondWithResult(_0x6611b2,null))[_0x9b95('0x44')](handleError(_0x6611b2,null));};exports[_0x9b95('0x47')]=function(_0x5339a9,_0x50e4fc){return db['Disposition'][_0x9b95('0x47')](_0x5339a9['body'],{})[_0x9b95('0x23')](function(_0x1a3716){var _0x5278ae=_0x5339a9[_0x9b95('0x48')]['get']({'plain':!![]});if(!_0x5278ae)throw new Error(_0x9b95('0x49'));if(_0x5278ae[_0x9b95('0x4a')]===_0x9b95('0x48')){var _0x1303f3=_0x1a3716[_0x9b95('0x24')]({'plain':!![]});var _0x540681='Dispositions';return db[_0x9b95('0x4b')][_0x9b95('0x4c')]({'where':{'name':_0x540681,'userProfileId':_0x5278ae[_0x9b95('0x4d')]},'raw':!![]})['then'](function(_0x420851){if(_0x420851&&_0x420851[_0x9b95('0x4e')]===0x0){return db[_0x9b95('0x4f')]['create']({'name':_0x1303f3[_0x9b95('0x28')],'resourceId':_0x1303f3['id'],'type':_0x420851['name'],'sectionId':_0x420851['id']},{})[_0x9b95('0x23')](function(){return _0x1a3716;});}else{return _0x1a3716;}})['catch'](function(_0x41d7ac){logger[_0x9b95('0x26')](_0x9b95('0x50'),_0x41d7ac);throw _0x41d7ac;});}return _0x1a3716;})[_0x9b95('0x23')](respondWithResult(_0x50e4fc,0xc9))[_0x9b95('0x44')](handleError(_0x50e4fc,null));};exports[_0x9b95('0x51')]=function(_0x4c0028,_0x7f2980){if(_0x4c0028[_0x9b95('0x52')]['id']){delete _0x4c0028[_0x9b95('0x52')]['id'];}return db[_0x9b95('0x2b')][_0x9b95('0x4c')]({'where':{'id':_0x4c0028[_0x9b95('0x46')]['id']}})[_0x9b95('0x23')](handleEntityNotFound(_0x7f2980,null))[_0x9b95('0x23')](saveUpdates(_0x4c0028['body'],null))[_0x9b95('0x23')](respondWithResult(_0x7f2980,null))['catch'](handleError(_0x7f2980,null));};exports[_0x9b95('0x22')]=function(_0x3980c2,_0x4c763e){return db['Disposition'][_0x9b95('0x4c')]({'where':{'id':_0x3980c2[_0x9b95('0x46')]['id']}})[_0x9b95('0x23')](handleEntityNotFound(_0x4c763e,null))[_0x9b95('0x23')](removeEntity(_0x4c763e,null))[_0x9b95('0x44')](handleError(_0x4c763e,null));}; \ No newline at end of file +var _0x17fa=['../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','end','sendStatus','error','name','index','Disposition','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','rows','catch','show','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils'];(function(_0x5b433b,_0x5dbfbd){var _0x3f1e4d=function(_0x480e36){while(--_0x480e36){_0x5b433b['push'](_0x5b433b['shift']());}};_0x3f1e4d(++_0x5dbfbd);}(_0x17fa,0x8c));var _0xa17f=function(_0x4301db,_0x19bd6f){_0x4301db=_0x4301db-0x0;var _0x52cb44=_0x17fa[_0x4301db];return _0x52cb44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa17f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa17f('0x1'));var rp=require(_0xa17f('0x2'));var moment=require(_0xa17f('0x3'));var BPromise=require(_0xa17f('0x4'));var Mustache=require(_0xa17f('0x5'));var util=require(_0xa17f('0x6'));var path=require('path');var sox=require(_0xa17f('0x7'));var csv=require(_0xa17f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa17f('0x9'));var _=require(_0xa17f('0xa'));var squel=require(_0xa17f('0xb'));var crypto=require(_0xa17f('0xc'));var jsforce=require(_0xa17f('0xd'));var deskjs=require(_0xa17f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa17f('0xf'));var Papa=require(_0xa17f('0x10'));var Redis=require(_0xa17f('0x11'));var authService=require(_0xa17f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa17f('0x13'));var logger=require('../../config/logger')(_0xa17f('0x14'));var utils=require(_0xa17f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa17f('0x16'))['db'];function respondWithStatusCode(_0x5926bd,_0x1b6fd7){_0x1b6fd7=_0x1b6fd7||0xcc;return function(_0x5f4461){if(_0x5f4461){return _0x5926bd['sendStatus'](_0x1b6fd7);}return _0x5926bd['status'](_0x1b6fd7)['end']();};}function respondWithResult(_0x4eb99f,_0x37d031){_0x37d031=_0x37d031||0xc8;return function(_0x4d0da7){if(_0x4d0da7){return _0x4eb99f[_0xa17f('0x17')](_0x37d031)[_0xa17f('0x18')](_0x4d0da7);}};}function respondWithFilteredResult(_0x429e52,_0x193e6c){return function(_0xe710ee){if(_0xe710ee){var _0x4ef0a4=typeof _0x193e6c[_0xa17f('0x19')]==='undefined'&&typeof _0x193e6c[_0xa17f('0x1a')]==='undefined';var _0x1b7708=_0xe710ee[_0xa17f('0x1b')];var _0x1dd257=_0x4ef0a4?0x0:_0x193e6c[_0xa17f('0x19')];var _0x4f14c1=_0x4ef0a4?_0xe710ee[_0xa17f('0x1b')]:_0x193e6c[_0xa17f('0x19')]+_0x193e6c[_0xa17f('0x1a')];var _0xc7478b;if(_0x4f14c1>=_0x1b7708){_0x4f14c1=_0x1b7708;_0xc7478b=0xc8;}else{_0xc7478b=0xce;}_0x429e52['status'](_0xc7478b);return _0x429e52[_0xa17f('0x1c')](_0xa17f('0x1d'),_0x1dd257+'-'+_0x4f14c1+'/'+_0x1b7708)[_0xa17f('0x18')](_0xe710ee);}return null;};}function patchUpdates(_0x3386dc){return function(_0x1345c9){try{jsonpatch[_0xa17f('0x1e')](_0x1345c9,_0x3386dc,!![]);}catch(_0x5477bd){return BPromise[_0xa17f('0x1f')](_0x5477bd);}return _0x1345c9[_0xa17f('0x20')]();};}function saveUpdates(_0x192687,_0x17d30f){return function(_0x353fc1){if(_0x353fc1){return _0x353fc1[_0xa17f('0x21')](_0x192687)[_0xa17f('0x22')](function(_0x58e4fe){return _0x58e4fe;});}return null;};}function removeEntity(_0x3aea97,_0x49af4b){return function(_0x3666ee){if(_0x3666ee){return _0x3666ee[_0xa17f('0x23')]()['then'](function(){var _0x406c89=_0x3666ee['get']({'plain':!![]});var _0x3f1575=_0xa17f('0x24');return db[_0xa17f('0x25')]['destroy']({'where':{'type':_0x3f1575,'resourceId':_0x406c89['id']}})[_0xa17f('0x22')](function(){return _0x3666ee;});})[_0xa17f('0x22')](function(){_0x3aea97['status'](0xcc)[_0xa17f('0x26')]();});}};}function handleEntityNotFound(_0x38bd76,_0x5e87d5){return function(_0x477d49){if(!_0x477d49){_0x38bd76[_0xa17f('0x27')](0x194);}return _0x477d49;};}function handleError(_0x113484,_0x4362ec){_0x4362ec=_0x4362ec||0x1f4;return function(_0x2a8dbc){logger[_0xa17f('0x28')](_0x2a8dbc['stack']);if(_0x2a8dbc[_0xa17f('0x29')]){delete _0x2a8dbc[_0xa17f('0x29')];}_0x113484[_0xa17f('0x17')](_0x4362ec)['send'](_0x2a8dbc);};}exports[_0xa17f('0x2a')]=function(_0x14883d,_0x5b11ac){var _0x2bcf88={},_0x491c39={},_0xf59ca={'count':0x0,'rows':[]};var _0x5e8b9d=_['map'](db[_0xa17f('0x2b')][_0xa17f('0x2c')],function(_0x427064){return{'name':_0x427064[_0xa17f('0x2d')],'type':_0x427064['type'][_0xa17f('0x2e')]};});_0x491c39['model']=_['map'](_0x5e8b9d,_0xa17f('0x29'));_0x491c39[_0xa17f('0x2f')]=_[_0xa17f('0x30')](_0x14883d[_0xa17f('0x2f')]);_0x491c39[_0xa17f('0x31')]=_[_0xa17f('0x32')](_0x491c39[_0xa17f('0x33')],_0x491c39['query']);_0x2bcf88['attributes']=_[_0xa17f('0x32')](_0x491c39[_0xa17f('0x33')],qs[_0xa17f('0x34')](_0x14883d[_0xa17f('0x2f')]['fields']));_0x2bcf88[_0xa17f('0x35')]=_0x2bcf88[_0xa17f('0x35')][_0xa17f('0x36')]?_0x2bcf88[_0xa17f('0x35')]:_0x491c39[_0xa17f('0x33')];if(!_0x14883d['query'][_0xa17f('0x37')](_0xa17f('0x38'))){_0x2bcf88['limit']=qs[_0xa17f('0x1a')](_0x14883d[_0xa17f('0x2f')][_0xa17f('0x1a')]);_0x2bcf88[_0xa17f('0x19')]=qs['offset'](_0x14883d['query'][_0xa17f('0x19')]);}_0x2bcf88[_0xa17f('0x39')]=qs[_0xa17f('0x3a')](_0x14883d['query'][_0xa17f('0x3a')]);_0x2bcf88[_0xa17f('0x3b')]=qs[_0xa17f('0x31')](_['pick'](_0x14883d['query'],_0x491c39[_0xa17f('0x31')]),_0x5e8b9d);if(_0x14883d['query'][_0xa17f('0x3c')]){_0x2bcf88[_0xa17f('0x3b')]=_[_0xa17f('0x3d')](_0x2bcf88[_0xa17f('0x3b')],{'$or':_[_0xa17f('0x3e')](_0x5e8b9d,function(_0x178fa8){if(_0x178fa8[_0xa17f('0x3f')]!==_0xa17f('0x40')){var _0x45a84b={};_0x45a84b[_0x178fa8[_0xa17f('0x29')]]={'$like':'%'+_0x14883d[_0xa17f('0x2f')][_0xa17f('0x3c')]+'%'};return _0x45a84b;}})});}_0x2bcf88=_['merge']({},_0x2bcf88,_0x14883d['options']);var _0x852ef1={'where':_0x2bcf88[_0xa17f('0x3b')]};return db['Disposition']['count'](_0x852ef1)['then'](function(_0x2a0a8c){_0xf59ca[_0xa17f('0x1b')]=_0x2a0a8c;if(_0x14883d[_0xa17f('0x2f')]['includeAll']){_0x2bcf88['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2bcf88);})[_0xa17f('0x22')](function(_0x5886c8){_0xf59ca[_0xa17f('0x41')]=_0x5886c8;return _0xf59ca;})[_0xa17f('0x22')](respondWithFilteredResult(_0x5b11ac,_0x2bcf88))[_0xa17f('0x42')](handleError(_0x5b11ac,null));};exports[_0xa17f('0x43')]=function(_0x3ead5e,_0x2bf14a){var _0x4280fc={'raw':!![],'where':{'id':_0x3ead5e[_0xa17f('0x44')]['id']}},_0x86c035={};_0x86c035[_0xa17f('0x33')]=_['keys'](db[_0xa17f('0x2b')][_0xa17f('0x2c')]);_0x86c035['query']=_[_0xa17f('0x30')](_0x3ead5e[_0xa17f('0x2f')]);_0x86c035[_0xa17f('0x31')]=_[_0xa17f('0x32')](_0x86c035['model'],_0x86c035[_0xa17f('0x2f')]);_0x4280fc[_0xa17f('0x35')]=_[_0xa17f('0x32')](_0x86c035[_0xa17f('0x33')],qs[_0xa17f('0x34')](_0x3ead5e[_0xa17f('0x2f')][_0xa17f('0x34')]));_0x4280fc[_0xa17f('0x35')]=_0x4280fc[_0xa17f('0x35')][_0xa17f('0x36')]?_0x4280fc[_0xa17f('0x35')]:_0x86c035[_0xa17f('0x33')];if(_0x3ead5e[_0xa17f('0x2f')]['includeAll']){_0x4280fc[_0xa17f('0x45')]=[{'all':!![]}];}_0x4280fc=_[_0xa17f('0x3d')]({},_0x4280fc,_0x3ead5e[_0xa17f('0x46')]);return db['Disposition'][_0xa17f('0x47')](_0x4280fc)[_0xa17f('0x22')](handleEntityNotFound(_0x2bf14a,null))[_0xa17f('0x22')](respondWithResult(_0x2bf14a,null))[_0xa17f('0x42')](handleError(_0x2bf14a,null));};exports['create']=function(_0x1f1ee0,_0xd8f3c2){return db['Disposition'][_0xa17f('0x48')](_0x1f1ee0[_0xa17f('0x49')],{})[_0xa17f('0x22')](function(_0x5a0405){var _0x2f33b4=_0x1f1ee0[_0xa17f('0x4a')][_0xa17f('0x4b')]({'plain':!![]});if(!_0x2f33b4)throw new Error(_0xa17f('0x4c'));if(_0x2f33b4[_0xa17f('0x4d')]===_0xa17f('0x4a')){var _0x1d05eb=_0x5a0405[_0xa17f('0x4b')]({'plain':!![]});var _0xbb0e9b=_0xa17f('0x24');return db['UserProfileSection'][_0xa17f('0x47')]({'where':{'name':_0xbb0e9b,'userProfileId':_0x2f33b4[_0xa17f('0x4e')]},'raw':!![]})['then'](function(_0x25dab0){if(_0x25dab0&&_0x25dab0[_0xa17f('0x4f')]===0x0){return db[_0xa17f('0x25')]['create']({'name':_0x1d05eb['name'],'resourceId':_0x1d05eb['id'],'type':_0x25dab0[_0xa17f('0x29')],'sectionId':_0x25dab0['id']},{})['then'](function(){return _0x5a0405;});}else{return _0x5a0405;}})[_0xa17f('0x42')](function(_0x5a0418){logger['error'](_0xa17f('0x50'),_0x5a0418);throw _0x5a0418;});}return _0x5a0405;})[_0xa17f('0x22')](respondWithResult(_0xd8f3c2,0xc9))[_0xa17f('0x42')](handleError(_0xd8f3c2,null));};exports[_0xa17f('0x21')]=function(_0x2c4024,_0x29190b){if(_0x2c4024[_0xa17f('0x49')]['id']){delete _0x2c4024[_0xa17f('0x49')]['id'];}return db[_0xa17f('0x2b')][_0xa17f('0x47')]({'where':{'id':_0x2c4024[_0xa17f('0x44')]['id']}})[_0xa17f('0x22')](handleEntityNotFound(_0x29190b,null))['then'](saveUpdates(_0x2c4024[_0xa17f('0x49')],null))[_0xa17f('0x22')](respondWithResult(_0x29190b,null))['catch'](handleError(_0x29190b,null));};exports['destroy']=function(_0x2bf51e,_0x48b1ed){return db[_0xa17f('0x2b')][_0xa17f('0x47')]({'where':{'id':_0x2bf51e[_0xa17f('0x44')]['id']}})['then'](handleEntityNotFound(_0x48b1ed,null))['then'](removeEntity(_0x48b1ed,null))[_0xa17f('0x42')](handleError(_0x48b1ed,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 5a976a7..cac313b 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 _0x5e1d=['name_sms','SmsAccountId','name_fax','name_openchannel','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId'];(function(_0x511c84,_0x12a819){var _0x13110e=function(_0x1f0bf8){while(--_0x1f0bf8){_0x511c84['push'](_0x511c84['shift']());}};_0x13110e(++_0x12a819);}(_0x5e1d,0x1d1));var _0xd5e1=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x5e1d[_0x37d0bc];return _0x170e60;};'use strict';var _=require(_0xd5e1('0x0'));var util=require('util');var logger=require(_0xd5e1('0x1'))(_0xd5e1('0x2'));var moment=require(_0xd5e1('0x3'));var BPromise=require(_0xd5e1('0x4'));var rp=require(_0xd5e1('0x5'));var fs=require('fs');var path=require(_0xd5e1('0x6'));var rimraf=require(_0xd5e1('0x7'));var config=require(_0xd5e1('0x8'));var attributes=require(_0xd5e1('0x9'));module[_0xd5e1('0xa')]=function(_0x19ed23,_0x378869){return _0x19ed23['define'](_0xd5e1('0xb'),attributes,{'tableName':_0xd5e1('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd5e1('0xd'),'fields':[_0xd5e1('0xe'),_0xd5e1('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0xd5e1('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xd5e1('0x10'),'fields':['name',_0xd5e1('0x11')]},{'unique':!![],'name':_0xd5e1('0x12'),'fields':[_0xd5e1('0xe'),_0xd5e1('0x13')]},{'unique':!![],'name':_0xd5e1('0x14'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xd5e1('0x15'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0xd5e1('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6d4=['ListId','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name'];(function(_0xa74da2,_0x4137fc){var _0x362e87=function(_0x578b46){while(--_0x578b46){_0xa74da2['push'](_0xa74da2['shift']());}};_0x362e87(++_0x4137fc);}(_0xd6d4,0x126));var _0x4d6d=function(_0x2a15f8,_0x48eda4){_0x2a15f8=_0x2a15f8-0x0;var _0x15bd72=_0xd6d4[_0x2a15f8];return _0x15bd72;};'use strict';var _=require(_0x4d6d('0x0'));var util=require(_0x4d6d('0x1'));var logger=require(_0x4d6d('0x2'))(_0x4d6d('0x3'));var moment=require(_0x4d6d('0x4'));var BPromise=require(_0x4d6d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d6d('0x6'));var config=require(_0x4d6d('0x7'));var attributes=require(_0x4d6d('0x8'));module[_0x4d6d('0x9')]=function(_0x39db08,_0x2d1a9f){return _0x39db08[_0x4d6d('0xa')](_0x4d6d('0xb'),attributes,{'tableName':_0x4d6d('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x4d6d('0xd'),_0x4d6d('0xe')]},{'unique':!![],'name':_0x4d6d('0xf'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x4d6d('0x10'),'fields':[_0x4d6d('0xd'),_0x4d6d('0x11')]},{'unique':!![],'name':_0x4d6d('0x12'),'fields':[_0x4d6d('0xd'),'SmsAccountId']},{'unique':!![],'name':_0x4d6d('0x13'),'fields':['name',_0x4d6d('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x4d6d('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4d6d('0x15'),'fields':[_0x4d6d('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ae76b4a..3e9cc0b 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(_0x5df70f,_0x4b6239){var _0x36b763=function(_0x367193){while(--_0x367193){_0x5df70f['push'](_0x5df70f['shift']());}};_0x36b763(++_0x4b6239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x56fafc,_0x1dbf83){var _0x2363ec=function(_0x4fa99e){while(--_0x4fa99e){_0x56fafc['push'](_0x56fafc['shift']());}};_0x2363ec(++_0x1dbf83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 958a703..0ee650a 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 _0x481b=['./disposition.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x127ed6,_0x2f903a){var _0x57bb14=function(_0x461c94){while(--_0x461c94){_0x127ed6['push'](_0x127ed6['shift']());}};_0x57bb14(++_0x2f903a);}(_0x481b,0x161));var _0xb481=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x481b[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xb481('0x0'));var util=require(_0xb481('0x1'));var path=require(_0xb481('0x2'));var timeout=require('connect-timeout');var express=require(_0xb481('0x3'));var router=express['Router']();var fs_extra=require(_0xb481('0x4'));var auth=require(_0xb481('0x5'));var interaction=require(_0xb481('0x6'));var config=require(_0xb481('0x7'));var controller=require(_0xb481('0x8'));router[_0xb481('0x9')]('/',auth['isAuthenticated'](),controller[_0xb481('0xa')]);router[_0xb481('0x9')](_0xb481('0xb'),auth[_0xb481('0xc')](),controller['show']);router[_0xb481('0xd')]('/',auth[_0xb481('0xc')](),controller[_0xb481('0xe')]);router[_0xb481('0xf')]('/:id',auth[_0xb481('0xc')](),controller[_0xb481('0x10')]);router[_0xb481('0x11')](_0xb481('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb481('0x12')]=router; \ No newline at end of file +var _0x1800=['fs-extra','../../components/auth/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router'];(function(_0x2eedf6,_0x300207){var _0x414e5c=function(_0xa35c71){while(--_0xa35c71){_0x2eedf6['push'](_0x2eedf6['shift']());}};_0x414e5c(++_0x300207);}(_0x1800,0x12f));var _0x0180=function(_0x1df1e6,_0x4b3692){_0x1df1e6=_0x1df1e6-0x0;var _0x463aaf=_0x1800[_0x1df1e6];return _0x463aaf;};'use strict';var multer=require(_0x0180('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0180('0x1'));var router=express[_0x0180('0x2')]();var fs_extra=require(_0x0180('0x3'));var auth=require(_0x0180('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0180('0x5'));router[_0x0180('0x6')]('/',auth[_0x0180('0x7')](),controller[_0x0180('0x8')]);router[_0x0180('0x6')](_0x0180('0x9'),auth[_0x0180('0x7')](),controller[_0x0180('0xa')]);router[_0x0180('0xb')]('/',auth[_0x0180('0x7')](),controller[_0x0180('0xc')]);router[_0x0180('0xd')](_0x0180('0x9'),auth[_0x0180('0x7')](),controller[_0x0180('0xe')]);router[_0x0180('0xf')](_0x0180('0x9'),auth[_0x0180('0x7')](),controller[_0x0180('0x10')]);module[_0x0180('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 596c92a..f66908b 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 _0x7ef8=['yes','localstationid','4800','7200','9600','12000','2400','14400','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0x7ef8,0x1f0));var _0x87ef=function(_0x4e8718,_0x51a62f){_0x4e8718=_0x4e8718-0x0;var _0x1234e9=_0x7ef8[_0x4e8718];return _0x1234e9;};'use strict';var Sequelize=require(_0x87ef('0x0'));module[_0x87ef('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x87ef('0x2')]},'ecm':{'type':Sequelize[_0x87ef('0x3')]('yes','no'),'defaultValue':_0x87ef('0x4')},'headerinfo':{'type':Sequelize[_0x87ef('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x87ef('0x5')},'minrate':{'type':Sequelize['ENUM']('2400',_0x87ef('0x6'),_0x87ef('0x7'),_0x87ef('0x8'),_0x87ef('0x9'),'14400'),'defaultValue':_0x87ef('0x6')},'maxrate':{'type':Sequelize[_0x87ef('0x3')](_0x87ef('0xa'),_0x87ef('0x6'),'7200',_0x87ef('0x8'),_0x87ef('0x9'),_0x87ef('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x87ef('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x87ef('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x87ef('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x87ef('0xc'),_0x87ef('0xd'),_0x87ef('0xe')),'defaultValue':_0x87ef('0xf')},'key':{'type':Sequelize[_0x87ef('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x87ef('0x10')],'defaultValue':function(){return _0x87ef('0x11');}},'notificationSound':{'type':Sequelize[_0x87ef('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x87ef('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x87ef('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x87ef('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x87ef('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x87ef('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x87ef('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x87ef('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x87ef('0x15'),'set':function(_0x215ab4){if(!_0x215ab4)this[_0x87ef('0x16')](_0x87ef('0x17'),null);this[_0x87ef('0x16')](_0x87ef('0x18'),_0x215ab4);}}}; \ No newline at end of file +var _0x5d24=['7200','9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800'];(function(_0x44fbec,_0x2af8fc){var _0x28a77c=function(_0x142559){while(--_0x142559){_0x44fbec['push'](_0x44fbec['shift']());}};_0x28a77c(++_0x2af8fc);}(_0x5d24,0x169));var _0x45d2=function(_0x573644,_0x4ddbf2){_0x573644=_0x573644-0x0;var _0x53b32f=_0x5d24[_0x573644];return _0x53b32f;};'use strict';var Sequelize=require('sequelize');module[_0x45d2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x45d2('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x45d2('0x2'),'no'),'defaultValue':_0x45d2('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x45d2('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x45d2('0x4')](_0x45d2('0x5'),_0x45d2('0x6'),_0x45d2('0x7'),_0x45d2('0x8'),_0x45d2('0x9'),_0x45d2('0xa')),'defaultValue':_0x45d2('0x6')},'maxrate':{'type':Sequelize[_0x45d2('0x4')](_0x45d2('0x5'),_0x45d2('0x6'),'7200',_0x45d2('0x8'),'12000',_0x45d2('0xa')),'defaultValue':_0x45d2('0xa')},'modem':{'type':Sequelize[_0x45d2('0x1')],'defaultValue':_0x45d2('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x45d2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x45d2('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x45d2('0x4')]('SIP',_0x45d2('0xd'),_0x45d2('0xe'),_0x45d2('0xf')),'defaultValue':_0x45d2('0x10')},'key':{'type':Sequelize[_0x45d2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x45d2('0x11')],'defaultValue':function(){return _0x45d2('0x12');}},'notificationSound':{'type':Sequelize[_0x45d2('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x45d2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x45d2('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x45d2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x45d2('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x45d2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x45d2('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x45d2('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x45d2('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3e1ae8){if(!_0x3e1ae8)this[_0x45d2('0x15')]('mandatoryDispositionPauseId',null);this[_0x45d2('0x15')](_0x45d2('0x16'),_0x3e1ae8);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index bd03028..b575173 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 _0x6165=['userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','Pause','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','FaxAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','ids','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','json','getApplications','context','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','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','addAccountApplications','VoiceExtension','updateAccountApplications','bulkCreate','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','FaxInteraction','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit'];(function(_0x151732,_0x82b764){var _0x1cda86=function(_0x2f8406){while(--_0x2f8406){_0x151732['push'](_0x151732['shift']());}};_0x1cda86(++_0x82b764);}(_0x6165,0xc9));var _0x5616=function(_0x1887a0,_0x34ea74){_0x1887a0=_0x1887a0-0x0;var _0x2f31ea=_0x6165[_0x1887a0];return _0x2f31ea;};'use strict';var emlformat=require(_0x5616('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5616('0x1'));var jsonpatch=require(_0x5616('0x2'));var rp=require(_0x5616('0x3'));var moment=require('moment');var BPromise=require(_0x5616('0x4'));var Mustache=require(_0x5616('0x5'));var util=require(_0x5616('0x6'));var path=require(_0x5616('0x7'));var sox=require(_0x5616('0x8'));var csv=require(_0x5616('0x9'));var ejs=require(_0x5616('0xa'));var fs=require('fs');var fs_extra=require(_0x5616('0xb'));var _=require(_0x5616('0xc'));var squel=require(_0x5616('0xd'));var crypto=require(_0x5616('0xe'));var jsforce=require(_0x5616('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5616('0x9'));var querystring=require(_0x5616('0x10'));var Papa=require(_0x5616('0x11'));var Redis=require('ioredis');var authService=require(_0x5616('0x12'));var qs=require(_0x5616('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5616('0x14'));var logger=require(_0x5616('0x15'))(_0x5616('0x16'));var utils=require('../../config/utils');var config=require(_0x5616('0x17'));var licenseUtil=require(_0x5616('0x18'));var db=require(_0x5616('0x19'))['db'];config['redis']=_[_0x5616('0x1a')](config[_0x5616('0x1b')],{'host':_0x5616('0x1c'),'port':0x18eb});var socket=require(_0x5616('0x1d'))(new Redis(config[_0x5616('0x1b')]));require(_0x5616('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5616('0x1f')][_0x5616('0x20')]({'port':0x232c});var client9002=jayson[_0x5616('0x1f')][_0x5616('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x303135,_0x2c0b5a,_0x272ec5,_0x3e6bed){return new BPromise(function(_0x48cadc,_0x61a591){var _0x40cb02=_0x3e6bed||client;return _0x40cb02[_0x5616('0x21')](_0x303135,_0x272ec5)['then'](function(_0x1b6dca){logger[_0x5616('0x22')](_0x5616('0x23'),_0x2c0b5a,_0x5616('0x24'));logger[_0x5616('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2c0b5a,'request\x20sent',JSON[_0x5616('0x26')](_0x1b6dca));if(_0x1b6dca[_0x5616('0x27')]){if(_0x1b6dca[_0x5616('0x27')][_0x5616('0x28')]===0x1f4){logger['error'](_0x5616('0x23'),_0x2c0b5a,_0x1b6dca[_0x5616('0x27')][_0x5616('0x29')]);return _0x61a591(_0x1b6dca[_0x5616('0x27')][_0x5616('0x29')]);}logger[_0x5616('0x27')](_0x5616('0x23'),_0x2c0b5a,_0x1b6dca[_0x5616('0x27')]['message']);return _0x48cadc(_0x1b6dca[_0x5616('0x27')][_0x5616('0x29')]);}else{logger[_0x5616('0x22')](_0x5616('0x23'),_0x2c0b5a,_0x5616('0x24'));_0x48cadc(_0x1b6dca[_0x5616('0x2a')]['message']);}})['catch'](function(_0x51d20f){logger[_0x5616('0x27')](_0x5616('0x23'),_0x2c0b5a,_0x51d20f);_0x61a591(_0x51d20f);});});}function respondWithStatusCode(_0x31d169,_0x173f66){_0x173f66=_0x173f66||0xcc;return function(_0x89f79a){if(_0x89f79a){return _0x31d169['sendStatus'](_0x173f66);}return _0x31d169['status'](_0x173f66)[_0x5616('0x2b')]();};}function respondWithResult(_0x39245e,_0x369f39){_0x369f39=_0x369f39||0xc8;return function(_0x346c23){if(_0x346c23){return _0x39245e[_0x5616('0x2c')](_0x369f39)['json'](_0x346c23);}};}function respondWithFilteredResult(_0x5bd886,_0x22ac0a){return function(_0x279400){if(_0x279400){var _0x19921f=typeof _0x22ac0a[_0x5616('0x2d')]===_0x5616('0x2e')&&typeof _0x22ac0a[_0x5616('0x2f')]===_0x5616('0x2e');var _0x499670=_0x279400[_0x5616('0x30')];var _0x14dd07=_0x19921f?0x0:_0x22ac0a[_0x5616('0x2d')];var _0x57c200=_0x19921f?_0x279400[_0x5616('0x30')]:_0x22ac0a[_0x5616('0x2d')]+_0x22ac0a[_0x5616('0x2f')];var _0x791742;if(_0x57c200>=_0x499670){_0x57c200=_0x499670;_0x791742=0xc8;}else{_0x791742=0xce;}_0x5bd886[_0x5616('0x2c')](_0x791742);return _0x5bd886['set'](_0x5616('0x31'),_0x14dd07+'-'+_0x57c200+'/'+_0x499670)['json'](_0x279400);}return null;};}function patchUpdates(_0x764916){return function(_0x523fca){try{jsonpatch[_0x5616('0x32')](_0x523fca,_0x764916,!![]);}catch(_0x536ef4){return BPromise[_0x5616('0x33')](_0x536ef4);}return _0x523fca[_0x5616('0x34')]();};}function saveUpdates(_0x4ebec5,_0x580227){return function(_0x56f749){if(_0x56f749){return _0x56f749[_0x5616('0x35')](_0x4ebec5)[_0x5616('0x36')](function(_0x31ed43){return _0x31ed43;});}return null;};}function removeEntity(_0x370c09,_0x53c534){return function(_0x56ca6e){if(_0x56ca6e){return _0x56ca6e['destroy']()[_0x5616('0x36')](function(){var _0x5ce49a=_0x56ca6e['get']({'plain':!![]});var _0x1f5518=_0x5616('0x37');return db[_0x5616('0x38')]['destroy']({'where':{'type':_0x1f5518,'resourceId':_0x5ce49a['id']}})[_0x5616('0x36')](function(){return _0x56ca6e;});})[_0x5616('0x36')](function(){_0x370c09[_0x5616('0x2c')](0xcc)[_0x5616('0x2b')]();});}};}function handleEntityNotFound(_0x2a62a4,_0x135f25){return function(_0x4ea513){if(!_0x4ea513){_0x2a62a4[_0x5616('0x39')](0x194);}return _0x4ea513;};}function handleError(_0x32367e,_0x45d5a1){_0x45d5a1=_0x45d5a1||0x1f4;return function(_0x4deab8){logger[_0x5616('0x27')](_0x4deab8[_0x5616('0x3a')]);if(_0x4deab8['name']){delete _0x4deab8[_0x5616('0x3b')];}_0x32367e['status'](_0x45d5a1)[_0x5616('0x3c')](_0x4deab8);};}exports[_0x5616('0x3d')]=function(_0x383a3d,_0xd5be1e){var _0x3dd4fc={'include':[{'model':db['Pause'],'as':_0x5616('0x3e')}]},_0x4bda0f={},_0xb680be={'count':0x0,'rows':[]};var _0x299f4d=_['map'](db[_0x5616('0x3f')][_0x5616('0x40')],function(_0x37ffb9){return{'name':_0x37ffb9['fieldName'],'type':_0x37ffb9[_0x5616('0x41')][_0x5616('0x42')]};});_0x4bda0f[_0x5616('0x43')]=_[_0x5616('0x44')](_0x299f4d,_0x5616('0x3b'));_0x4bda0f['query']=_[_0x5616('0x45')](_0x383a3d[_0x5616('0x46')]);_0x4bda0f[_0x5616('0x47')]=_[_0x5616('0x48')](_0x4bda0f[_0x5616('0x43')],_0x4bda0f['query']);_0x3dd4fc[_0x5616('0x49')]=_[_0x5616('0x48')](_0x4bda0f[_0x5616('0x43')],qs['fields'](_0x383a3d['query']['fields']));_0x3dd4fc['attributes']=_0x3dd4fc[_0x5616('0x49')][_0x5616('0x4a')]?_0x3dd4fc[_0x5616('0x49')]:_0x4bda0f[_0x5616('0x43')];if(!_0x383a3d[_0x5616('0x46')]['hasOwnProperty']('nolimit')){_0x3dd4fc[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0x383a3d[_0x5616('0x46')][_0x5616('0x2f')]);_0x3dd4fc[_0x5616('0x2d')]=qs[_0x5616('0x2d')](_0x383a3d[_0x5616('0x46')][_0x5616('0x2d')]);}_0x3dd4fc[_0x5616('0x4b')]=qs[_0x5616('0x4c')](_0x383a3d[_0x5616('0x46')][_0x5616('0x4c')]);_0x3dd4fc[_0x5616('0x4d')]=qs[_0x5616('0x47')](_[_0x5616('0x4e')](_0x383a3d[_0x5616('0x46')],_0x4bda0f['filters']),_0x299f4d);if(_0x383a3d['query'][_0x5616('0x4f')]){_0x3dd4fc[_0x5616('0x4d')]=_['merge'](_0x3dd4fc[_0x5616('0x4d')],{'$or':_[_0x5616('0x44')](_0x299f4d,function(_0x58d652){if(_0x58d652[_0x5616('0x41')]!==_0x5616('0x50')){var _0x417fca={};_0x417fca[_0x58d652['name']]={'$like':'%'+_0x383a3d[_0x5616('0x46')][_0x5616('0x4f')]+'%'};return _0x417fca;}})});}_0x3dd4fc=_[_0x5616('0x51')]({},_0x3dd4fc,_0x383a3d[_0x5616('0x52')]);var _0x2b3be2={'where':_0x3dd4fc[_0x5616('0x4d')]};return db['FaxAccount']['count'](_0x2b3be2)[_0x5616('0x36')](function(_0x3df8a4){_0xb680be['count']=_0x3df8a4;if(_0x383a3d[_0x5616('0x46')][_0x5616('0x53')]){_0x3dd4fc[_0x5616('0x54')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x3dd4fc);})[_0x5616('0x36')](function(_0x24ffd0){_0xb680be[_0x5616('0x55')]=_0x24ffd0;return _0xb680be;})[_0x5616('0x36')](respondWithFilteredResult(_0xd5be1e,_0x3dd4fc))[_0x5616('0x56')](handleError(_0xd5be1e,null));};exports['show']=function(_0x2dd666,_0x3479b2){var _0x26f40b={'raw':![],'where':{'id':_0x2dd666['params']['id']},'include':[{'model':db[_0x5616('0x57')],'as':_0x5616('0x3e')}]},_0x351867={};_0x351867[_0x5616('0x43')]=_[_0x5616('0x45')](db[_0x5616('0x3f')]['rawAttributes']);_0x351867[_0x5616('0x46')]=_[_0x5616('0x45')](_0x2dd666[_0x5616('0x46')]);_0x351867[_0x5616('0x47')]=_['intersection'](_0x351867['model'],_0x351867[_0x5616('0x46')]);_0x26f40b[_0x5616('0x49')]=_['intersection'](_0x351867[_0x5616('0x43')],qs[_0x5616('0x58')](_0x2dd666[_0x5616('0x46')][_0x5616('0x58')]));_0x26f40b[_0x5616('0x49')]=_0x26f40b[_0x5616('0x49')][_0x5616('0x4a')]?_0x26f40b['attributes']:_0x351867[_0x5616('0x43')];if(_0x2dd666['query'][_0x5616('0x53')]){_0x26f40b[_0x5616('0x54')]=[{'all':!![]}];}_0x26f40b=_[_0x5616('0x51')]({},_0x26f40b,_0x2dd666['options']);return db[_0x5616('0x3f')][_0x5616('0x59')](_0x26f40b)[_0x5616('0x36')](handleEntityNotFound(_0x3479b2,null))[_0x5616('0x36')](respondWithResult(_0x3479b2,null))['catch'](handleError(_0x3479b2,null));};exports[_0x5616('0x5a')]=function(_0x16e821,_0x54b62b){return db[_0x5616('0x3f')][_0x5616('0x5a')](_0x16e821[_0x5616('0x5b')],{})[_0x5616('0x36')](function(_0x3b21d6){var _0x514bed=_0x16e821[_0x5616('0x5c')][_0x5616('0x5d')]({'plain':!![]});if(!_0x514bed)throw new Error(_0x5616('0x5e'));if(_0x514bed['role']===_0x5616('0x5c')){var _0x259e06=_0x3b21d6[_0x5616('0x5d')]({'plain':!![]});var _0xfda880=_0x5616('0x37');return db[_0x5616('0x5f')][_0x5616('0x59')]({'where':{'name':_0xfda880,'userProfileId':_0x514bed[_0x5616('0x60')]},'raw':!![]})[_0x5616('0x36')](function(_0x35526c){if(_0x35526c&&_0x35526c[_0x5616('0x61')]===0x0){return db[_0x5616('0x38')]['create']({'name':_0x259e06[_0x5616('0x3b')],'resourceId':_0x259e06['id'],'type':_0x35526c[_0x5616('0x3b')],'sectionId':_0x35526c['id']},{})[_0x5616('0x36')](function(){return _0x3b21d6;});}else{return _0x3b21d6;}})['catch'](function(_0x1b3933){logger[_0x5616('0x27')](_0x5616('0x62'),_0x1b3933);throw _0x1b3933;});}return _0x3b21d6;})[_0x5616('0x36')](respondWithResult(_0x54b62b,0xc9))['catch'](handleError(_0x54b62b,null));};exports[_0x5616('0x35')]=function(_0x5ba218,_0xe58ad5){if(_0x5ba218[_0x5616('0x5b')]['id']){delete _0x5ba218[_0x5616('0x5b')]['id'];}return db[_0x5616('0x3f')]['find']({'where':{'id':_0x5ba218[_0x5616('0x63')]['id']},'include':[{'model':db[_0x5616('0x57')],'as':'mandatoryDispositionPause'}]})[_0x5616('0x36')](handleEntityNotFound(_0xe58ad5,null))['then'](saveUpdates(_0x5ba218['body'],null))['then'](respondWithResult(_0xe58ad5,null))[_0x5616('0x56')](handleError(_0xe58ad5,null));};exports[_0x5616('0x64')]=function(_0x51d2b7,_0x43da08){return db[_0x5616('0x3f')]['find']({'where':{'id':_0x51d2b7['params']['id']}})['then'](handleEntityNotFound(_0x43da08,null))['then'](removeEntity(_0x43da08,null))[_0x5616('0x56')](handleError(_0x43da08,null));};exports[_0x5616('0x65')]=function(_0x365bf5,_0x21c13f){return db[_0x5616('0x3f')][_0x5616('0x65')]()[_0x5616('0x36')](respondWithResult(_0x21c13f,null))['catch'](handleError(_0x21c13f,null));};exports[_0x5616('0x66')]=function(_0x23921,_0x387f06,_0x20a59b){if(_0x23921[_0x5616('0x5b')]['id']){delete _0x23921[_0x5616('0x5b')]['id'];}return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x23921[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x387f06,null))[_0x5616('0x36')](function(_0x134aa5){if(_0x134aa5){_0x23921[_0x5616('0x5b')]['FaxAccountId']=_0x134aa5['id'];return db[_0x5616('0x67')][_0x5616('0x5a')](_0x23921[_0x5616('0x5b')]);}})[_0x5616('0x36')](respondWithResult(_0x387f06,null))[_0x5616('0x56')](handleError(_0x387f06,null));};exports[_0x5616('0x68')]=function(_0xf2c210,_0x18749e,_0x4432d8){var _0x54287f={'raw':![],'where':{}};var _0x4dd78b={};var _0x27a6a0={'count':0x0,'rows':[]};return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0xf2c210[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x18749e,null))[_0x5616('0x36')](function(_0x23de48){if(_0x23de48){_0x4dd78b[_0x5616('0x43')]=_[_0x5616('0x45')](db['Disposition'][_0x5616('0x40')]);_0x4dd78b[_0x5616('0x46')]=_[_0x5616('0x45')](_0xf2c210[_0x5616('0x46')]);_0x4dd78b['filters']=_['intersection'](_0x4dd78b['model'],_0x4dd78b[_0x5616('0x46')]);_0x54287f[_0x5616('0x49')]=_['intersection'](_0x4dd78b[_0x5616('0x43')],qs['fields'](_0xf2c210[_0x5616('0x46')][_0x5616('0x58')]));_0x54287f[_0x5616('0x49')]=_0x54287f[_0x5616('0x49')]['length']?_0x54287f['attributes']:_0x4dd78b['model'];if(!_0xf2c210[_0x5616('0x46')][_0x5616('0x6a')](_0x5616('0x6b'))){_0x54287f[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0xf2c210[_0x5616('0x46')]['limit']);_0x54287f[_0x5616('0x2d')]=qs['offset'](_0xf2c210['query'][_0x5616('0x2d')]);}_0x54287f['order']=qs[_0x5616('0x4c')](_0xf2c210[_0x5616('0x46')][_0x5616('0x4c')]);_0x54287f[_0x5616('0x4d')]=qs['filters'](_['pick'](_0xf2c210[_0x5616('0x46')],_0x4dd78b[_0x5616('0x47')]));_0x54287f[_0x5616('0x4d')][_0x5616('0x6c')]=_0x23de48['id'];if(_0xf2c210[_0x5616('0x46')][_0x5616('0x4f')]){_0x54287f[_0x5616('0x4d')]=_[_0x5616('0x51')](_0x54287f['where'],{'$or':_[_0x5616('0x44')](_0x54287f[_0x5616('0x49')],function(_0x31fd41){var _0xaf794e={};_0xaf794e[_0x31fd41]={'$like':'%'+_0xf2c210[_0x5616('0x46')][_0x5616('0x4f')]+'%'};return _0xaf794e;})});}_0x54287f=_[_0x5616('0x51')]({},_0x54287f,_0xf2c210[_0x5616('0x52')]);return db[_0x5616('0x67')][_0x5616('0x30')]({'where':_0x54287f['where']})['then'](function(_0x5850b8){_0x27a6a0['count']=_0x5850b8;if(_0xf2c210[_0x5616('0x46')][_0x5616('0x53')]){_0x54287f[_0x5616('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x5616('0x6d')](_0x54287f);})[_0x5616('0x36')](function(_0x3b5daf){_0x27a6a0[_0x5616('0x55')]=_0x3b5daf;return _0x27a6a0;});}})['then'](respondWithFilteredResult(_0x18749e,_0x54287f))[_0x5616('0x56')](handleError(_0x18749e,null));};exports[_0x5616('0x6e')]=function(_0x1a8f32,_0x39d592,_0xf86657){return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x1a8f32['params']['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x39d592,null))[_0x5616('0x36')](function(_0x32629b){if(_0x32629b){return _0x32629b['removeDispositions'](_0x1a8f32[_0x5616('0x46')]['ids']);}})[_0x5616('0x36')](respondWithStatusCode(_0x39d592,null))[_0x5616('0x56')](handleError(_0x39d592,null));};exports[_0x5616('0x6f')]=function(_0x291e6b,_0x1071e0,_0x10099c){if(_0x291e6b[_0x5616('0x5b')]['id']){delete _0x291e6b[_0x5616('0x5b')]['id'];}return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x291e6b['params']['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x1071e0,null))['then'](function(_0x587945){if(_0x587945){_0x291e6b[_0x5616('0x5b')][_0x5616('0x6c')]=_0x587945['id'];return db[_0x5616('0x70')][_0x5616('0x5a')](_0x291e6b['body']);}})['then'](respondWithResult(_0x1071e0,null))['catch'](handleError(_0x1071e0,null));};exports[_0x5616('0x71')]=function(_0x2da322,_0x5e30d7,_0x1586a9){var _0x14e827={'raw':![],'where':{}};var _0x382d64={};var _0x9c226f={'count':0x0,'rows':[]};return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0x2da322[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x5e30d7,null))[_0x5616('0x36')](function(_0x281b36){if(_0x281b36){_0x382d64['model']=_[_0x5616('0x45')](db[_0x5616('0x70')][_0x5616('0x40')]);_0x382d64['query']=_[_0x5616('0x45')](_0x2da322['query']);_0x382d64[_0x5616('0x47')]=_['intersection'](_0x382d64['model'],_0x382d64[_0x5616('0x46')]);_0x14e827[_0x5616('0x49')]=_[_0x5616('0x48')](_0x382d64['model'],qs[_0x5616('0x58')](_0x2da322[_0x5616('0x46')][_0x5616('0x58')]));_0x14e827[_0x5616('0x49')]=_0x14e827[_0x5616('0x49')][_0x5616('0x4a')]?_0x14e827[_0x5616('0x49')]:_0x382d64[_0x5616('0x43')];if(!_0x2da322[_0x5616('0x46')][_0x5616('0x6a')](_0x5616('0x6b'))){_0x14e827[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0x2da322[_0x5616('0x46')][_0x5616('0x2f')]);_0x14e827[_0x5616('0x2d')]=qs[_0x5616('0x2d')](_0x2da322['query']['offset']);}_0x14e827[_0x5616('0x4b')]=qs[_0x5616('0x4c')](_0x2da322['query']['sort']);_0x14e827[_0x5616('0x4d')]=qs[_0x5616('0x47')](_[_0x5616('0x4e')](_0x2da322[_0x5616('0x46')],_0x382d64[_0x5616('0x47')]));_0x14e827[_0x5616('0x4d')]['FaxAccountId']=_0x281b36['id'];if(_0x2da322[_0x5616('0x46')][_0x5616('0x4f')]){_0x14e827[_0x5616('0x4d')]=_['merge'](_0x14e827[_0x5616('0x4d')],{'$or':_[_0x5616('0x44')](_0x14e827[_0x5616('0x49')],function(_0x161556){var _0x1e36ab={};_0x1e36ab[_0x161556]={'$like':'%'+_0x2da322['query'][_0x5616('0x4f')]+'%'};return _0x1e36ab;})});}_0x14e827=_['merge']({},_0x14e827,_0x2da322['options']);return db['CannedAnswer']['count']({'where':_0x14e827[_0x5616('0x4d')]})[_0x5616('0x36')](function(_0x92124c){_0x9c226f[_0x5616('0x30')]=_0x92124c;if(_0x2da322[_0x5616('0x46')][_0x5616('0x53')]){_0x14e827['include']=[{'all':!![]}];}return db[_0x5616('0x70')][_0x5616('0x6d')](_0x14e827);})[_0x5616('0x36')](function(_0x219154){_0x9c226f[_0x5616('0x55')]=_0x219154;return _0x9c226f;});}})['then'](respondWithFilteredResult(_0x5e30d7,_0x14e827))[_0x5616('0x56')](handleError(_0x5e30d7,null));};exports[_0x5616('0x72')]=function(_0x4b7272,_0x5ab735,_0x250b85){return db[_0x5616('0x3f')]['find']({'where':{'id':_0x4b7272[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x5ab735,null))[_0x5616('0x36')](function(_0x46e44e){if(_0x46e44e){return _0x46e44e[_0x5616('0x72')](_0x4b7272[_0x5616('0x46')]['ids']);}})[_0x5616('0x36')](respondWithStatusCode(_0x5ab735,null))[_0x5616('0x56')](handleError(_0x5ab735,null));};exports[_0x5616('0x73')]=function(_0x50ddcd,_0x31fcba,_0x44a0ee){return db['FaxInteraction'][_0x5616('0x59')]({'where':{'id':_0x50ddcd[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x31fcba,null))[_0x5616('0x36')](function(_0x167526){if(_0x167526){return _0x167526[_0x5616('0x73')](_0x50ddcd[_0x5616('0x5b')][_0x5616('0x74')],_[_0x5616('0x75')](_0x50ddcd[_0x5616('0x5b')],[_0x5616('0x74'),'id'])||{});}})[_0x5616('0x36')](respondWithResult(_0x31fcba,null))['catch'](handleError(_0x31fcba,null));};exports[_0x5616('0x76')]=function(_0x3524f0,_0x403e07,_0x4b8235){var _0x5d894c={'raw':![],'where':{}};var _0x233161={};var _0x35b505={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5616('0x69')]({'where':{'id':_0x3524f0['params']['id']}})['then'](handleEntityNotFound(_0x403e07,null))[_0x5616('0x36')](function(_0x3fe051){if(_0x3fe051){_0x233161['model']=_['keys'](db['FaxInteraction'][_0x5616('0x40')]);_0x233161['query']=_[_0x5616('0x45')](_0x3524f0['query']);_0x233161['filters']=_[_0x5616('0x48')](_0x233161[_0x5616('0x43')],_0x233161['query']);_0x5d894c[_0x5616('0x49')]=_[_0x5616('0x48')](_0x233161[_0x5616('0x43')],qs[_0x5616('0x58')](_0x3524f0['query'][_0x5616('0x58')]));_0x5d894c[_0x5616('0x49')]=_0x5d894c[_0x5616('0x49')][_0x5616('0x4a')]?_0x5d894c[_0x5616('0x49')]:_0x233161[_0x5616('0x43')];if(!_0x3524f0['query'][_0x5616('0x6a')](_0x5616('0x6b'))){_0x5d894c[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0x3524f0[_0x5616('0x46')][_0x5616('0x2f')]);_0x5d894c['offset']=qs[_0x5616('0x2d')](_0x3524f0[_0x5616('0x46')]['offset']);}_0x5d894c['order']=qs[_0x5616('0x4c')](_0x3524f0[_0x5616('0x46')][_0x5616('0x4c')]);_0x5d894c[_0x5616('0x4d')]=qs['filters'](_[_0x5616('0x4e')](_0x3524f0['query'],_0x233161['filters']));_0x5d894c[_0x5616('0x4d')][_0x5616('0x6c')]=_0x3fe051['id'];if(_0x3524f0[_0x5616('0x46')][_0x5616('0x4f')]){_0x5d894c[_0x5616('0x4d')]=_[_0x5616('0x51')](_0x5d894c['where'],{'$or':_[_0x5616('0x44')](_0x5d894c[_0x5616('0x49')],function(_0x5189a6){var _0x5338e2={};_0x5338e2[_0x5189a6]={'$like':'%'+_0x3524f0[_0x5616('0x46')][_0x5616('0x4f')]+'%'};return _0x5338e2;})});}_0x5d894c=_[_0x5616('0x51')]({},_0x5d894c,_0x3524f0[_0x5616('0x52')]);return db['FaxInteraction'][_0x5616('0x30')]({'where':_0x5d894c[_0x5616('0x4d')]})['then'](function(_0x574a6d){_0x35b505[_0x5616('0x30')]=_0x574a6d;if(_0x3524f0[_0x5616('0x46')]['includeAll']){_0x5d894c['include']=[{'model':db[_0x5616('0x77')],'as':_0x5616('0x78'),'required':![]},{'model':db[_0x5616('0x79')],'as':_0x5616('0x7a'),'attributes':[_0x5616('0x3b'),'fullname',_0x5616('0x7b')],'required':![]},{'model':db['Tag'],'as':_0x5616('0x7c'),'attributes':['id',_0x5616('0x3b'),_0x5616('0x7d')],'where':_0x3524f0['query']['tag']?{'id':_0x3524f0[_0x5616('0x46')][_0x5616('0x7e')]}:undefined,'required':_0x3524f0[_0x5616('0x46')][_0x5616('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x5616('0x6d')](_0x5d894c);})['then'](function(_0x28fe7c){_0x35b505[_0x5616('0x55')]=_0x28fe7c;return _0x35b505;});}})['then'](respondWithFilteredResult(_0x403e07,_0x5d894c))[_0x5616('0x56')](handleError(_0x403e07,null));};exports[_0x5616('0x7f')]=function(_0x4b76c0,_0x4ddabb){var _0x21cc54=_0x4b76c0[_0x5616('0x63')]['id'];var _0x547af0=_0x4b76c0[_0x5616('0x5b')];var _0x39572c=0xc8;var _0x385732=null;return db[_0x5616('0x80')][_0x5616('0x81')]({'isolationLevel':db['sequelize'][_0x5616('0x82')][_0x5616('0x83')][_0x5616('0x84')]},function(_0x4f3397){return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0x21cc54},'transaction':_0x4f3397})[_0x5616('0x36')](function(_0x29e758){if(_0x29e758){return db['FaxApplication'][_0x5616('0x64')]({'where':{'FaxAccountId':_0x21cc54},'transaction':_0x4f3397})[_0x5616('0x36')](function(){var _0x597611=_[_0x5616('0x44')](_0x547af0,function(_0x41c8c4){_0x41c8c4[_0x5616('0x6c')]=_0x21cc54;return _0x41c8c4;});return db[_0x5616('0x85')]['bulkCreate'](_0x597611,{'transaction':_0x4f3397});});}else{_0x39572c=0x194;_0x385732=[];}});})[_0x5616('0x36')](function(){if(_0x39572c!==0x194){return db['FaxApplication'][_0x5616('0x86')]({'where':{'FaxAccountId':_0x21cc54},'order':_0x5616('0x87')})[_0x5616('0x36')](function(_0xf95e0f){_0x385732=_0xf95e0f;});}})['catch'](function(_0x5a4aec){_0x39572c=0x1f4;logger[_0x5616('0x27')](_0x5a4aec[_0x5616('0x3a')]);if(_0x5a4aec[_0x5616('0x3b')]){delete _0x5a4aec[_0x5616('0x3b')];}_0x385732=_0x5a4aec;})[_0x5616('0x88')](function(){if(_0x385732===null){_0x4ddabb[_0x5616('0x39')](_0x39572c);}else{if(_0x39572c===0x1f4){_0x4ddabb[_0x5616('0x2c')](_0x39572c)[_0x5616('0x3c')](_0x385732);}else{_0x4ddabb[_0x5616('0x2c')](_0x39572c)[_0x5616('0x89')](_0x385732);}}});};exports[_0x5616('0x8a')]=function(_0x13dccf,_0x58a35b,_0x4ea9c1){var _0x41d18c={};var _0x195fdf={};var _0x313706;var _0x3e0f27;return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0x13dccf[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x58a35b,null))[_0x5616('0x36')](function(_0x6f0bbe){if(_0x6f0bbe){_0x313706=_0x6f0bbe;_0x195fdf[_0x5616('0x43')]=_[_0x5616('0x45')](db[_0x5616('0x85')][_0x5616('0x40')]);_0x195fdf[_0x5616('0x46')]=_[_0x5616('0x45')](_0x13dccf['query']);_0x195fdf['filters']=_[_0x5616('0x48')](_0x195fdf['model'],_0x195fdf[_0x5616('0x46')]);_0x41d18c[_0x5616('0x49')]=_[_0x5616('0x48')](_0x195fdf[_0x5616('0x43')],qs[_0x5616('0x58')](_0x13dccf[_0x5616('0x46')][_0x5616('0x58')]));_0x41d18c[_0x5616('0x49')]=_0x41d18c[_0x5616('0x49')][_0x5616('0x4a')]?_0x41d18c[_0x5616('0x49')]:_0x195fdf[_0x5616('0x43')];_0x41d18c[_0x5616('0x4b')]=qs['sort'](_0x13dccf['query'][_0x5616('0x4c')]);_0x41d18c[_0x5616('0x4d')]=qs[_0x5616('0x47')](_[_0x5616('0x4e')](_0x13dccf[_0x5616('0x46')],_0x195fdf[_0x5616('0x47')]));if(_0x13dccf['query'][_0x5616('0x4f')]){_0x41d18c[_0x5616('0x4d')]=_[_0x5616('0x51')](_0x41d18c[_0x5616('0x4d')],{'$or':_[_0x5616('0x44')](_0x41d18c[_0x5616('0x49')],function(_0x2fb982){var _0x579672={};_0x579672[_0x2fb982]={'$like':'%'+_0x13dccf[_0x5616('0x46')][_0x5616('0x4f')]+'%'};return _0x579672;})});}_0x41d18c=_[_0x5616('0x51')]({},_0x41d18c,_0x13dccf['options']);return _0x313706['getApplications'](_0x41d18c);}})[_0x5616('0x36')](function(_0x3e4a48){if(_0x3e4a48){_0x3e0f27=_0x3e4a48[_0x5616('0x4a')];if(!_0x13dccf['query'][_0x5616('0x6a')](_0x5616('0x6b'))){_0x41d18c[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0x13dccf[_0x5616('0x46')]['limit']);_0x41d18c[_0x5616('0x2d')]=qs[_0x5616('0x2d')](_0x13dccf[_0x5616('0x46')][_0x5616('0x2d')]);}return _0x313706['getApplications'](_0x41d18c);}})[_0x5616('0x36')](function(_0x40ad60){if(_0x40ad60){return _0x40ad60?{'count':_0x3e0f27,'rows':_0x40ad60}:null;}})[_0x5616('0x36')](respondWithResult(_0x58a35b,null))[_0x5616('0x56')](handleError(_0x58a35b,null));};function Extension(_0x1d3b69,_0x4e1630,_0x134de3,_0x53dd3d){this[_0x5616('0x8b')]='from-voip-provider';this['exten']=_0x1d3b69['localstationid'];this['app']=_0x53dd3d;this[_0x5616('0x41')]=_0x5616('0x8c');this[_0x5616('0x8d')]=_0x5616('0x8e');this['FaxAccountId']=_0x1d3b69['id'];this[_0x5616('0x87')]=_0x4e1630;this['appdata']=_0x134de3;}function createExtensionsReciveFax(_0x68b26c){var _0x46b2b5=0x1;var _0x37f0d7=[];_0x37f0d7[_0x5616('0x8f')](new Extension(_0x68b26c,_0x46b2b5,'',_0x5616('0x90')));_0x46b2b5+=0x1;_0x37f0d7['push'](new Extension(_0x68b26c,_0x46b2b5,_0x5616('0x91'),_0x5616('0x92')));_0x46b2b5+=0x1;for(var _0x1c4d05 in _0x68b26c){if(_0x68b26c[_0x5616('0x6a')](_0x1c4d05)&&(_0x1c4d05==='ecm'||_0x1c4d05==='localstationid'||_0x1c4d05===_0x5616('0x93')||_0x1c4d05===_0x5616('0x94')||_0x1c4d05===_0x5616('0x95')||_0x1c4d05===_0x5616('0x96')||_0x1c4d05===_0x5616('0x97')||_0x1c4d05==='modem'||_0x1c4d05===_0x5616('0x98'))){_0x37f0d7[_0x5616('0x8f')](new Extension(_0x68b26c,_0x46b2b5,_0x5616('0x99')+_0x1c4d05+')='+_0x68b26c[_0x1c4d05],'Set'));_0x46b2b5+=0x1;}}_0x37f0d7[_0x5616('0x8f')](new Extension(_0x68b26c,_0x46b2b5,'6',_0x5616('0x9a')));_0x46b2b5+=0x1;_0x37f0d7[_0x5616('0x8f')](new Extension(_0x68b26c,_0x46b2b5,_0x5616('0x9b'),'ReceiveFax'));_0x46b2b5=0x0;return _0x37f0d7;}exports[_0x5616('0x9c')]=function(_0x344270,_0x19b185,_0x48dc58){var _0x25fc61;return db[_0x5616('0x80')]['transaction'](function(_0x1bb323){return db[_0x5616('0x3f')][_0x5616('0x5a')](_0x344270[_0x5616('0x5b')],{'transaction':_0x1bb323})[_0x5616('0x36')](function(_0x5f3f7d){_0x25fc61=_0x5f3f7d[_0x5616('0x5d')]({'plain':!![]});return db[_0x5616('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0x25fc61),{'transaction':_0x1bb323});});})[_0x5616('0x36')](function(){return _0x25fc61;})[_0x5616('0x36')](respondWithResult(_0x19b185,null))[_0x5616('0x56')](handleError(_0x19b185,null));};exports[_0x5616('0x9e')]=function(_0x1ee067,_0x3582d4,_0x251ee2){var _0x1f7fdf;return db[_0x5616('0x80')][_0x5616('0x81')](function(_0x80422e){return db[_0x5616('0x3f')]['update'](_0x1ee067[_0x5616('0x5b')],{'where':{'id':_0x1ee067[_0x5616('0x5b')]['id']},'transaction':_0x80422e})[_0x5616('0x36')](function(_0x23da71){return db[_0x5616('0x9d')][_0x5616('0x64')]({'where':{'FaxAccountId':_0x1ee067['body']['id']},'transaction':_0x80422e})[_0x5616('0x36')](function(_0xc90b1){return db[_0x5616('0x9d')][_0x5616('0x9f')](createExtensionsReciveFax(_[_0x5616('0x75')](_0x1ee067[_0x5616('0x5b')],[_0x5616('0xa0'),_0x5616('0x42'),'createdAt',_0x5616('0xa1'),_0x5616('0xa2'),_0x5616('0xa3')])),{'transaction':_0x80422e});});});})[_0x5616('0x36')](function(){return db[_0x5616('0x3f')][_0x5616('0xa4')](_0x1ee067[_0x5616('0x5b')]['id']);})['then'](respondWithResult(_0x3582d4,null))['catch'](handleError(_0x3582d4,null));};exports['getMessages']=function(_0x3e88d5,_0x29774b,_0x4cdf51){var _0x5270c6={'raw':!![],'where':{}};var _0x589f8a={};var _0x11d901={'count':0x0,'rows':[]};return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0x3e88d5[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x29774b,null))[_0x5616('0x36')](function(_0x58a107){if(_0x58a107){_0x589f8a[_0x5616('0x43')]=_[_0x5616('0x45')](db[_0x5616('0xa5')][_0x5616('0x40')]);_0x589f8a['query']=_[_0x5616('0x45')](_0x3e88d5[_0x5616('0x46')]);_0x589f8a[_0x5616('0x47')]=_[_0x5616('0x48')](_0x589f8a[_0x5616('0x43')],_0x589f8a[_0x5616('0x46')]);_0x5270c6[_0x5616('0x49')]=_[_0x5616('0x48')](_0x589f8a[_0x5616('0x43')],qs[_0x5616('0x58')](_0x3e88d5[_0x5616('0x46')][_0x5616('0x58')]));_0x5270c6[_0x5616('0x49')]=_0x5270c6['attributes']['length']?_0x5270c6['attributes']:_0x589f8a[_0x5616('0x43')];if(!_0x3e88d5[_0x5616('0x46')][_0x5616('0x6a')]('nolimit')){_0x5270c6[_0x5616('0x2f')]=qs[_0x5616('0x2f')](_0x3e88d5[_0x5616('0x46')][_0x5616('0x2f')]);_0x5270c6[_0x5616('0x2d')]=qs['offset'](_0x3e88d5[_0x5616('0x46')][_0x5616('0x2d')]);}_0x5270c6[_0x5616('0x4b')]=qs['sort'](_0x3e88d5['query'][_0x5616('0x4c')]);_0x5270c6[_0x5616('0x4d')]=qs[_0x5616('0x47')](_[_0x5616('0x4e')](_0x3e88d5[_0x5616('0x46')],_0x589f8a[_0x5616('0x47')]));_0x5270c6[_0x5616('0x4d')][_0x5616('0x6c')]=_0x58a107['id'];if(_0x3e88d5[_0x5616('0x46')][_0x5616('0x4f')]){_0x5270c6[_0x5616('0x4d')]=_[_0x5616('0x51')](_0x5270c6['where'],{'$or':_[_0x5616('0x44')](_0x5270c6[_0x5616('0x49')],function(_0x2a6993){var _0x525ff6={};_0x525ff6[_0x2a6993]={'$like':'%'+_0x3e88d5['query'][_0x5616('0x4f')]+'%'};return _0x525ff6;})});}if(_0x3e88d5['query'][_0x5616('0xa6')]){var _0x54cd3b=_0x3e88d5['query'][_0x5616('0xa6')][_0x5616('0xa7')](',');var _0xd75a0f={};_0xd75a0f[_0x54cd3b[0x0]]={'$gte':moment(_0x54cd3b[0x1])[_0x5616('0xa8')](_0x5616('0xa9'))};_0x5270c6[_0x5616('0x4d')]=_['merge'](_0x5270c6['where'],_0xd75a0f);}_0x5270c6=_['merge']({},_0x5270c6,_0x3e88d5[_0x5616('0x52')]);return db[_0x5616('0xa5')][_0x5616('0x30')]({'where':_0x5270c6[_0x5616('0x4d')]})[_0x5616('0x36')](function(_0x301ee2){_0x11d901[_0x5616('0x30')]=_0x301ee2;if(_0x3e88d5[_0x5616('0x46')]['includeAll']){_0x5270c6[_0x5616('0x54')]=[{'all':!![]}];}return db[_0x5616('0xa5')][_0x5616('0x6d')](_0x5270c6);})[_0x5616('0x36')](function(_0x1d2208){_0x11d901[_0x5616('0x55')]=_0x1d2208;return _0x11d901;});}})['then'](respondWithFilteredResult(_0x29774b,_0x5270c6))[_0x5616('0x56')](handleError(_0x29774b,null));};exports[_0x5616('0x3c')]=function(_0x263f2d,_0x55ce90,_0x481cf6){var _0x211401,_0x23ca50={},_0x34962a;if(_0x263f2d[_0x5616('0x5b')]['to']){_0x34962a=_0x263f2d[_0x5616('0x5b')]['to'][0x0];}return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x263f2d[_0x5616('0x63')]['id']},'include':[{'model':db[_0x5616('0xaa')],'as':_0x5616('0xab'),'include':[{'model':db[_0x5616('0x77')],'as':_0x5616('0xac'),'where':{'fax':_0x34962a},'limit':0x1,'order':[[_0x5616('0xa1'),_0x5616('0xad')]]}]}]})[_0x5616('0x36')](handleEntityNotFound(_0x55ce90,null))['then'](function(_0xc10bef){_0x211401=_0xc10bef;if(_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')]&&_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][_0x5616('0x4a')]){for(var _0x48c9b9=0x0;_0x48c9b9<_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][_0x5616('0x4a')];_0x48c9b9+=0x1){_0x263f2d[_0x5616('0x5b')]['attachments'][_0x48c9b9]={'filename':_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][_0x48c9b9][_0x5616('0x3b')],'id':_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][_0x48c9b9]['id'],'path':path[_0x5616('0xaf')](config['root'],_0x5616('0xb0'),_0x263f2d['body'][_0x5616('0xae')][_0x48c9b9][_0x5616('0xb1')])};}}return respondWithRpcPromise('CheckAfterSend',_0x5616('0xb2'),{'FaxAccountId':_['isNil'](_0x263f2d[_0x5616('0x63')]['id'])?undefined:_0x263f2d['params']['id'],'path':_['isNil'](_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0][_0x5616('0x7')])?undefined:_0x263f2d[_0x5616('0x5b')]['attachments'][0x0][_0x5616('0x7')],'fax':_[_0x5616('0xb3')](_0x263f2d[_0x5616('0x5b')]['to'][0x0])?undefined:_0x263f2d[_0x5616('0x5b')]['to'][0x0]},client9002);})[_0x5616('0x36')](function(){if(_0x211401){if(_[_0x5616('0xb3')](_0x263f2d[_0x5616('0x5b')][_0x5616('0xb4')])){_0x263f2d[_0x5616('0x5b')][_0x5616('0xb4')]=util[_0x5616('0xa8')](_0x5616('0xb5'),_0x211401['name'],_0x211401['fax']);}if(_0x211401[_0x5616('0xab')]){if(_0x211401['List'][_0x5616('0xac')][_0x5616('0x4a')]){return _0x211401[_0x5616('0xab')][_0x5616('0xac')][0x0];}else{return db[_0x5616('0x77')][_0x5616('0x5a')](_[_0x5616('0x1a')](_0x263f2d[_0x5616('0x5b')],{'firstName':_0x263f2d['body']['to'][0x0],'phone':_0x263f2d[_0x5616('0x5b')]['to'][0x0],'fax':_0x263f2d['body']['to'][0x0],'ListId':_0x211401['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x5616('0x36')](function(_0x429f39){if(_0x429f39){return db[_0x5616('0xb6')][_0x5616('0x59')]({'where':{'ContactId':_0x429f39['id'],'closed':![],'FaxAccountId':_0x211401['id']}})[_0x5616('0x36')](function(_0x570b0f){if(_0x570b0f){return[_0x570b0f,![]];}return db['FaxInteraction'][_0x5616('0x5a')]({'UserId':_0x263f2d['user']['id'],'ContactId':_0x429f39['id'],'FaxAccountId':_0x211401['id'],'fax':_0x263f2d[_0x5616('0x5b')]['to'][0x0],'firstMsgDirection':_0x5616('0xb7'),'Messages':[_['merge'](_0x263f2d['body'],{'read':![],'body':_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0][_0x5616('0xb8')],'FaxAccountId':_0x211401['id'],'UserId':_0x263f2d['user']['id'],'ContactId':_0x429f39['id'],'AttachmentId':_0x263f2d['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x5616('0xa5')],'as':_0x5616('0xb9')}]})[_0x5616('0x36')](function(_0x48c8df){return[_0x48c8df,!![]];});});}else{throw new Error(_0x5616('0xba'));}})[_0x5616('0xbb')](function(_0x2bfedf,_0x7e5032){if(_0x7e5032){return _0x2bfedf;}return db[_0x5616('0xa5')][_0x5616('0x5a')]({'direction':_0x5616('0xb7'),'read':![],'body':_0x263f2d[_0x5616('0x5b')]['attachments'][0x0][_0x5616('0xb8')],'FaxAccountId':_0x211401['id'],'FaxInteractionId':_0x2bfedf['id'],'UserId':_0x263f2d[_0x5616('0x5c')]['id'],'ContactId':_0x2bfedf[_0x5616('0xbc')],'AttachmentId':_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0]['id']})[_0x5616('0x36')](function(_0x350cf1){_0x2bfedf[_0x5616('0xbd')]['Messages']=[];_0x2bfedf[_0x5616('0xbd')][_0x5616('0xb9')]['push'](_0x350cf1[_0x5616('0xbd')]);return _0x2bfedf;});})[_0x5616('0x36')](function(_0x1c4fcf){respondWithRpcPromise(_0x5616('0xbe'),'SendFax',{'FaxAccountId':_[_0x5616('0xb3')](_0x263f2d[_0x5616('0x63')]['id'])?undefined:_0x263f2d['params']['id'],'path':_[_0x5616('0xb3')](_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0][_0x5616('0x7')])?undefined:_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0][_0x5616('0x7')],'fax':_[_0x5616('0xb3')](_0x263f2d[_0x5616('0x5b')]['to'][0x0])?undefined:_0x263f2d[_0x5616('0x5b')]['to'][0x0],'AttachmentId':_0x263f2d[_0x5616('0x5b')][_0x5616('0xae')][0x0]['id']},client9002)[_0x5616('0x36')](function(_0x40705c){logger[_0x5616('0x22')]('SendFaxRpc,\x20%s',_0x40705c);})['catch'](function(_0x54ab73){logger[_0x5616('0x22')](_0x5616('0xbf'),_0x54ab73);});return _0x1c4fcf;})[_0x5616('0x36')](respondWithResult(_0x55ce90,null))[_0x5616('0x56')](handleError(_0x55ce90,null));};exports['addAgents']=function(_0x1d3bad,_0x41e465,_0x30a862){return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x1d3bad[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x41e465,null))[_0x5616('0x36')](function(_0x9d77b4){if(_0x9d77b4){return _0x9d77b4[_0x5616('0xc0')](_0x1d3bad['body']['ids'],_['omit'](_0x1d3bad['body'],['ids','id'])||{})[_0x5616('0xbb')](function(_0x5f464c){for(var _0x508b34=0x0;_0x508b34<_0x1d3bad[_0x5616('0x5b')][_0x5616('0x74')][_0x5616('0x4a')];_0x508b34+=0x1){socket['emit'](_0x5616('0xc1'),{'UserId':Number(_0x1d3bad['body'][_0x5616('0x74')][_0x508b34]),'FaxAccountId':Number(_0x1d3bad['params']['id'])});}return _0x5f464c;});}})[_0x5616('0x36')](respondWithResult(_0x41e465,null))[_0x5616('0x56')](handleError(_0x41e465,null));};exports[_0x5616('0xc2')]=function(_0x33b90e,_0x5158ce,_0xb636d9){return db[_0x5616('0x3f')][_0x5616('0x59')]({'where':{'id':_0x33b90e[_0x5616('0x63')]['id']}})[_0x5616('0x36')](handleEntityNotFound(_0x5158ce,null))[_0x5616('0x36')](function(_0x2e6c7b){if(_0x2e6c7b){return _0x2e6c7b[_0x5616('0xc2')](_0x33b90e['query'][_0x5616('0x74')])['then'](function(){if(_[_0x5616('0xc3')](_0x33b90e[_0x5616('0x46')][_0x5616('0x74')])){for(var _0x1d9dcf=0x0;_0x1d9dcf<_0x33b90e[_0x5616('0x46')][_0x5616('0x74')][_0x5616('0x4a')];_0x1d9dcf+=0x1){socket[_0x5616('0xc4')](_0x5616('0xc5'),{'UserId':Number(_0x33b90e[_0x5616('0x46')][_0x5616('0x74')][_0x1d9dcf]),'FaxAccountId':Number(_0x33b90e['params']['id'])});}}else{socket['emit'](_0x5616('0xc5'),{'UserId':Number(_0x33b90e['query']['ids']),'FaxAccountId':Number(_0x33b90e[_0x5616('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x5158ce,null))[_0x5616('0x56')](handleError(_0x5158ce,null));};exports[_0x5616('0xc6')]=function(_0x11ae3d,_0x28a941,_0x1654ff){var _0x301d46={};var _0x9e55df={};var _0x3bba20;var _0x194743;return db[_0x5616('0x3f')][_0x5616('0x69')]({'where':{'id':_0x11ae3d[_0x5616('0x63')]['id']}})['then'](handleEntityNotFound(_0x28a941,null))[_0x5616('0x36')](function(_0x4305b9){if(_0x4305b9){_0x3bba20=_0x4305b9;_0x9e55df['model']=_[_0x5616('0x45')](db[_0x5616('0x79')][_0x5616('0x40')]);_0x9e55df['query']=_[_0x5616('0x45')](_0x11ae3d['query']);_0x9e55df[_0x5616('0x47')]=_[_0x5616('0x48')](_0x9e55df['model'],_0x9e55df[_0x5616('0x46')]);_0x301d46[_0x5616('0x49')]=_[_0x5616('0x48')](_0x9e55df[_0x5616('0x43')],qs[_0x5616('0x58')](_0x11ae3d['query'][_0x5616('0x58')]));_0x301d46['attributes']=_0x301d46[_0x5616('0x49')][_0x5616('0x4a')]?_0x301d46['attributes']:_0x9e55df['model'];_0x301d46['order']=qs['sort'](_0x11ae3d[_0x5616('0x46')][_0x5616('0x4c')]);_0x301d46[_0x5616('0x4d')]=qs[_0x5616('0x47')](_[_0x5616('0x4e')](_0x11ae3d[_0x5616('0x46')],_0x9e55df[_0x5616('0x47')]));if(_0x11ae3d[_0x5616('0x46')]['filter']){_0x301d46[_0x5616('0x4d')]=_[_0x5616('0x51')](_0x301d46[_0x5616('0x4d')],{'$or':_[_0x5616('0x44')](_0x301d46[_0x5616('0x49')],function(_0x4eff53){var _0x323a1d={};_0x323a1d[_0x4eff53]={'$like':'%'+_0x11ae3d[_0x5616('0x46')][_0x5616('0x4f')]+'%'};return _0x323a1d;})});}_0x301d46=_[_0x5616('0x51')]({},_0x301d46,_0x11ae3d[_0x5616('0x52')]);return _0x3bba20[_0x5616('0xc6')](_0x301d46);}})['then'](function(_0x23e49c){if(_0x23e49c){_0x194743=_0x23e49c[_0x5616('0x4a')];if(!_0x11ae3d[_0x5616('0x46')][_0x5616('0x6a')]('nolimit')){_0x301d46[_0x5616('0x2f')]=qs['limit'](_0x11ae3d[_0x5616('0x46')][_0x5616('0x2f')]);_0x301d46['offset']=qs[_0x5616('0x2d')](_0x11ae3d['query'][_0x5616('0x2d')]);}return _0x3bba20[_0x5616('0xc6')](_0x301d46);}})[_0x5616('0x36')](function(_0x3c111e){if(_0x3c111e){return _0x3c111e?{'count':_0x194743,'rows':_0x3c111e}:null;}})[_0x5616('0x36')](respondWithResult(_0x28a941,null))['catch'](handleError(_0x28a941,null));}; \ No newline at end of file +var _0xc67c=['VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','body','destroy','describe','FaxAccountId','Disposition','findOne','length','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','from-voip-provider','exten','system','Fax\x20Extension','appdata','push','Answer','Set','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc67c,0x73));var _0xcc67=function(_0x126884,_0x130bd9){_0x126884=_0x126884-0x0;var _0x414f97=_0xc67c[_0x126884];return _0x414f97;};'use strict';var emlformat=require(_0xcc67('0x0'));var rimraf=require(_0xcc67('0x1'));var zipdir=require(_0xcc67('0x2'));var jsonpatch=require(_0xcc67('0x3'));var rp=require(_0xcc67('0x4'));var moment=require('moment');var BPromise=require(_0xcc67('0x5'));var Mustache=require(_0xcc67('0x6'));var util=require('util');var path=require(_0xcc67('0x7'));var sox=require(_0xcc67('0x8'));var csv=require('to-csv');var ejs=require(_0xcc67('0x9'));var fs=require('fs');var fs_extra=require(_0xcc67('0xa'));var _=require(_0xcc67('0xb'));var squel=require(_0xcc67('0xc'));var crypto=require(_0xcc67('0xd'));var jsforce=require(_0xcc67('0xe'));var deskjs=require(_0xcc67('0xf'));var toCsv=require(_0xcc67('0x10'));var querystring=require(_0xcc67('0x11'));var Papa=require(_0xcc67('0x12'));var Redis=require(_0xcc67('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcc67('0x14'));var hardwareService=require(_0xcc67('0x15'));var logger=require('../../config/logger')(_0xcc67('0x16'));var utils=require(_0xcc67('0x17'));var config=require(_0xcc67('0x18'));var licenseUtil=require(_0xcc67('0x19'));var db=require(_0xcc67('0x1a'))['db'];config[_0xcc67('0x1b')]=_[_0xcc67('0x1c')](config[_0xcc67('0x1b')],{'host':_0xcc67('0x1d'),'port':0x18eb});var socket=require(_0xcc67('0x1e'))(new Redis(config[_0xcc67('0x1b')]));require(_0xcc67('0x1f'))[_0xcc67('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcc67('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xcc67('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf23a,_0x18ed30,_0x4dd509,_0x15a6e1){return new BPromise(function(_0x4f544c,_0x2af709){var _0x594562=_0x15a6e1||client;return _0x594562[_0xcc67('0x22')](_0x5cf23a,_0x4dd509)[_0xcc67('0x23')](function(_0x3f2511){logger[_0xcc67('0x24')](_0xcc67('0x25'),_0x18ed30,'request\x20sent');logger[_0xcc67('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x18ed30,_0xcc67('0x27'),JSON['stringify'](_0x3f2511));if(_0x3f2511[_0xcc67('0x28')]){if(_0x3f2511[_0xcc67('0x28')]['code']===0x1f4){logger[_0xcc67('0x28')](_0xcc67('0x25'),_0x18ed30,_0x3f2511[_0xcc67('0x28')]['message']);return _0x2af709(_0x3f2511['error'][_0xcc67('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x18ed30,_0x3f2511['error'][_0xcc67('0x29')]);return _0x4f544c(_0x3f2511[_0xcc67('0x28')]['message']);}else{logger[_0xcc67('0x24')](_0xcc67('0x25'),_0x18ed30,_0xcc67('0x27'));_0x4f544c(_0x3f2511[_0xcc67('0x2a')]['message']);}})[_0xcc67('0x2b')](function(_0x36ef7e){logger['error'](_0xcc67('0x25'),_0x18ed30,_0x36ef7e);_0x2af709(_0x36ef7e);});});}function respondWithStatusCode(_0x39e161,_0x4f8991){_0x4f8991=_0x4f8991||0xcc;return function(_0x251ed7){if(_0x251ed7){return _0x39e161[_0xcc67('0x2c')](_0x4f8991);}return _0x39e161['status'](_0x4f8991)[_0xcc67('0x2d')]();};}function respondWithResult(_0x3e3633,_0x17cc69){_0x17cc69=_0x17cc69||0xc8;return function(_0x4f6f54){if(_0x4f6f54){return _0x3e3633['status'](_0x17cc69)[_0xcc67('0x2e')](_0x4f6f54);}};}function respondWithFilteredResult(_0x1c0704,_0x3ee8b9){return function(_0x1df557){if(_0x1df557){var _0x523535=typeof _0x3ee8b9[_0xcc67('0x2f')]===_0xcc67('0x30')&&typeof _0x3ee8b9[_0xcc67('0x31')]===_0xcc67('0x30');var _0x3df23d=_0x1df557[_0xcc67('0x32')];var _0x3f019d=_0x523535?0x0:_0x3ee8b9['offset'];var _0x5bbf3d=_0x523535?_0x1df557[_0xcc67('0x32')]:_0x3ee8b9[_0xcc67('0x2f')]+_0x3ee8b9[_0xcc67('0x31')];var _0x45d171;if(_0x5bbf3d>=_0x3df23d){_0x5bbf3d=_0x3df23d;_0x45d171=0xc8;}else{_0x45d171=0xce;}_0x1c0704[_0xcc67('0x33')](_0x45d171);return _0x1c0704[_0xcc67('0x34')](_0xcc67('0x35'),_0x3f019d+'-'+_0x5bbf3d+'/'+_0x3df23d)[_0xcc67('0x2e')](_0x1df557);}return null;};}function patchUpdates(_0x4fe079){return function(_0x522200){try{jsonpatch[_0xcc67('0x36')](_0x522200,_0x4fe079,!![]);}catch(_0x3b9c18){return BPromise[_0xcc67('0x37')](_0x3b9c18);}return _0x522200['save']();};}function saveUpdates(_0x1cd94c,_0x44d745){return function(_0x5c72e4){if(_0x5c72e4){return _0x5c72e4[_0xcc67('0x38')](_0x1cd94c)['then'](function(_0x54709a){return _0x54709a;});}return null;};}function removeEntity(_0x495808,_0x53ae00){return function(_0x54e61c){if(_0x54e61c){return _0x54e61c['destroy']()[_0xcc67('0x23')](function(){var _0x26464b=_0x54e61c['get']({'plain':!![]});var _0x344b42=_0xcc67('0x39');return db[_0xcc67('0x3a')]['destroy']({'where':{'type':_0x344b42,'resourceId':_0x26464b['id']}})[_0xcc67('0x23')](function(){return _0x54e61c;});})[_0xcc67('0x23')](function(){_0x495808[_0xcc67('0x33')](0xcc)[_0xcc67('0x2d')]();});}};}function handleEntityNotFound(_0x18b71e,_0x5400d3){return function(_0xe84631){if(!_0xe84631){_0x18b71e[_0xcc67('0x2c')](0x194);}return _0xe84631;};}function handleError(_0x45e88a,_0x48c8be){_0x48c8be=_0x48c8be||0x1f4;return function(_0x30dd1e){logger[_0xcc67('0x28')](_0x30dd1e[_0xcc67('0x3b')]);if(_0x30dd1e[_0xcc67('0x3c')]){delete _0x30dd1e['name'];}_0x45e88a[_0xcc67('0x33')](_0x48c8be)[_0xcc67('0x3d')](_0x30dd1e);};}exports[_0xcc67('0x3e')]=function(_0x25b965,_0xa24cd5){var _0x516c72={'include':[{'model':db[_0xcc67('0x3f')],'as':_0xcc67('0x40')}]},_0x2e77d4={},_0x493880={'count':0x0,'rows':[]};var _0x28054b=_[_0xcc67('0x41')](db[_0xcc67('0x42')][_0xcc67('0x43')],function(_0x2675b5){return{'name':_0x2675b5[_0xcc67('0x44')],'type':_0x2675b5[_0xcc67('0x45')]['key']};});_0x2e77d4[_0xcc67('0x46')]=_[_0xcc67('0x41')](_0x28054b,_0xcc67('0x3c'));_0x2e77d4[_0xcc67('0x47')]=_['keys'](_0x25b965[_0xcc67('0x47')]);_0x2e77d4['filters']=_[_0xcc67('0x48')](_0x2e77d4[_0xcc67('0x46')],_0x2e77d4[_0xcc67('0x47')]);_0x516c72[_0xcc67('0x49')]=_[_0xcc67('0x48')](_0x2e77d4['model'],qs[_0xcc67('0x4a')](_0x25b965['query']['fields']));_0x516c72[_0xcc67('0x49')]=_0x516c72['attributes']['length']?_0x516c72[_0xcc67('0x49')]:_0x2e77d4['model'];if(!_0x25b965['query'][_0xcc67('0x4b')](_0xcc67('0x4c'))){_0x516c72[_0xcc67('0x31')]=qs[_0xcc67('0x31')](_0x25b965[_0xcc67('0x47')]['limit']);_0x516c72[_0xcc67('0x2f')]=qs[_0xcc67('0x2f')](_0x25b965[_0xcc67('0x47')]['offset']);}_0x516c72[_0xcc67('0x4d')]=qs[_0xcc67('0x4e')](_0x25b965[_0xcc67('0x47')][_0xcc67('0x4e')]);_0x516c72[_0xcc67('0x4f')]=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x25b965['query'],_0x2e77d4['filters']),_0x28054b);if(_0x25b965[_0xcc67('0x47')][_0xcc67('0x52')]){_0x516c72[_0xcc67('0x4f')]=_[_0xcc67('0x53')](_0x516c72[_0xcc67('0x4f')],{'$or':_[_0xcc67('0x41')](_0x28054b,function(_0x5912f4){if(_0x5912f4[_0xcc67('0x45')]!==_0xcc67('0x54')){var _0x367f37={};_0x367f37[_0x5912f4[_0xcc67('0x3c')]]={'$like':'%'+_0x25b965[_0xcc67('0x47')][_0xcc67('0x52')]+'%'};return _0x367f37;}})});}_0x516c72=_[_0xcc67('0x53')]({},_0x516c72,_0x25b965[_0xcc67('0x55')]);var _0x2f91c0={'where':_0x516c72[_0xcc67('0x4f')]};return db[_0xcc67('0x42')][_0xcc67('0x32')](_0x2f91c0)[_0xcc67('0x23')](function(_0x417845){_0x493880[_0xcc67('0x32')]=_0x417845;if(_0x25b965[_0xcc67('0x47')][_0xcc67('0x56')]){_0x516c72[_0xcc67('0x57')]=[{'all':!![]}];}return db[_0xcc67('0x42')][_0xcc67('0x58')](_0x516c72);})[_0xcc67('0x23')](function(_0x952138){_0x493880[_0xcc67('0x59')]=_0x952138;return _0x493880;})[_0xcc67('0x23')](respondWithFilteredResult(_0xa24cd5,_0x516c72))[_0xcc67('0x2b')](handleError(_0xa24cd5,null));};exports['show']=function(_0x31fea5,_0x4afb48){var _0x38492d={'raw':![],'where':{'id':_0x31fea5[_0xcc67('0x5a')]['id']},'include':[{'model':db[_0xcc67('0x3f')],'as':'mandatoryDispositionPause'}]},_0x706a52={};_0x706a52[_0xcc67('0x46')]=_[_0xcc67('0x5b')](db['FaxAccount']['rawAttributes']);_0x706a52[_0xcc67('0x47')]=_[_0xcc67('0x5b')](_0x31fea5['query']);_0x706a52['filters']=_['intersection'](_0x706a52[_0xcc67('0x46')],_0x706a52['query']);_0x38492d['attributes']=_[_0xcc67('0x48')](_0x706a52[_0xcc67('0x46')],qs[_0xcc67('0x4a')](_0x31fea5['query'][_0xcc67('0x4a')]));_0x38492d['attributes']=_0x38492d['attributes']['length']?_0x38492d[_0xcc67('0x49')]:_0x706a52[_0xcc67('0x46')];if(_0x31fea5[_0xcc67('0x47')]['includeAll']){_0x38492d[_0xcc67('0x57')]=[{'all':!![]}];}_0x38492d=_[_0xcc67('0x53')]({},_0x38492d,_0x31fea5[_0xcc67('0x55')]);return db[_0xcc67('0x42')][_0xcc67('0x5c')](_0x38492d)[_0xcc67('0x23')](handleEntityNotFound(_0x4afb48,null))[_0xcc67('0x23')](respondWithResult(_0x4afb48,null))[_0xcc67('0x2b')](handleError(_0x4afb48,null));};exports['create']=function(_0x3e751a,_0x29bd28){return db[_0xcc67('0x42')]['create'](_0x3e751a['body'],{})[_0xcc67('0x23')](function(_0x40b723){var _0x3138e2=_0x3e751a[_0xcc67('0x5d')][_0xcc67('0x5e')]({'plain':!![]});if(!_0x3138e2)throw new Error(_0xcc67('0x5f'));if(_0x3138e2[_0xcc67('0x60')]==='user'){var _0x35466c=_0x40b723[_0xcc67('0x5e')]({'plain':!![]});var _0x28a0dd=_0xcc67('0x39');return db[_0xcc67('0x61')][_0xcc67('0x5c')]({'where':{'name':_0x28a0dd,'userProfileId':_0x3138e2[_0xcc67('0x62')]},'raw':!![]})[_0xcc67('0x23')](function(_0x415e0e){if(_0x415e0e&&_0x415e0e[_0xcc67('0x63')]===0x0){return db[_0xcc67('0x3a')][_0xcc67('0x64')]({'name':_0x35466c['name'],'resourceId':_0x35466c['id'],'type':_0x415e0e[_0xcc67('0x3c')],'sectionId':_0x415e0e['id']},{})[_0xcc67('0x23')](function(){return _0x40b723;});}else{return _0x40b723;}})[_0xcc67('0x2b')](function(_0x2a10e6){logger[_0xcc67('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a10e6);throw _0x2a10e6;});}return _0x40b723;})[_0xcc67('0x23')](respondWithResult(_0x29bd28,0xc9))[_0xcc67('0x2b')](handleError(_0x29bd28,null));};exports[_0xcc67('0x38')]=function(_0x22d88c,_0x5d23ce){if(_0x22d88c[_0xcc67('0x65')]['id']){delete _0x22d88c[_0xcc67('0x65')]['id'];}return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x22d88c[_0xcc67('0x5a')]['id']},'include':[{'model':db[_0xcc67('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xcc67('0x23')](handleEntityNotFound(_0x5d23ce,null))[_0xcc67('0x23')](saveUpdates(_0x22d88c[_0xcc67('0x65')],null))['then'](respondWithResult(_0x5d23ce,null))['catch'](handleError(_0x5d23ce,null));};exports[_0xcc67('0x66')]=function(_0x3b714d,_0x994167){return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x3b714d['params']['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x994167,null))[_0xcc67('0x23')](removeEntity(_0x994167,null))['catch'](handleError(_0x994167,null));};exports[_0xcc67('0x67')]=function(_0x390e32,_0x13bb68){return db[_0xcc67('0x42')][_0xcc67('0x67')]()['then'](respondWithResult(_0x13bb68,null))[_0xcc67('0x2b')](handleError(_0x13bb68,null));};exports['addDisposition']=function(_0x50e690,_0x463b10,_0x5c6670){if(_0x50e690[_0xcc67('0x65')]['id']){delete _0x50e690[_0xcc67('0x65')]['id'];}return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x50e690['params']['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x463b10,null))[_0xcc67('0x23')](function(_0x1543b2){if(_0x1543b2){_0x50e690[_0xcc67('0x65')][_0xcc67('0x68')]=_0x1543b2['id'];return db[_0xcc67('0x69')][_0xcc67('0x64')](_0x50e690['body']);}})[_0xcc67('0x23')](respondWithResult(_0x463b10,null))[_0xcc67('0x2b')](handleError(_0x463b10,null));};exports['getDispositions']=function(_0x1154ee,_0x3dc3e2,_0xe6e839){var _0x25dfe9={'raw':![],'where':{}};var _0x290a66={};var _0x331eb2={'count':0x0,'rows':[]};return db[_0xcc67('0x42')][_0xcc67('0x6a')]({'where':{'id':_0x1154ee[_0xcc67('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3dc3e2,null))[_0xcc67('0x23')](function(_0x4bd1ee){if(_0x4bd1ee){_0x290a66['model']=_[_0xcc67('0x5b')](db[_0xcc67('0x69')][_0xcc67('0x43')]);_0x290a66[_0xcc67('0x47')]=_['keys'](_0x1154ee[_0xcc67('0x47')]);_0x290a66[_0xcc67('0x50')]=_[_0xcc67('0x48')](_0x290a66[_0xcc67('0x46')],_0x290a66[_0xcc67('0x47')]);_0x25dfe9[_0xcc67('0x49')]=_[_0xcc67('0x48')](_0x290a66[_0xcc67('0x46')],qs[_0xcc67('0x4a')](_0x1154ee['query'][_0xcc67('0x4a')]));_0x25dfe9[_0xcc67('0x49')]=_0x25dfe9['attributes'][_0xcc67('0x6b')]?_0x25dfe9[_0xcc67('0x49')]:_0x290a66['model'];if(!_0x1154ee[_0xcc67('0x47')][_0xcc67('0x4b')](_0xcc67('0x4c'))){_0x25dfe9[_0xcc67('0x31')]=qs['limit'](_0x1154ee[_0xcc67('0x47')][_0xcc67('0x31')]);_0x25dfe9[_0xcc67('0x2f')]=qs['offset'](_0x1154ee[_0xcc67('0x47')][_0xcc67('0x2f')]);}_0x25dfe9[_0xcc67('0x4d')]=qs[_0xcc67('0x4e')](_0x1154ee[_0xcc67('0x47')][_0xcc67('0x4e')]);_0x25dfe9[_0xcc67('0x4f')]=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x1154ee['query'],_0x290a66[_0xcc67('0x50')]));_0x25dfe9[_0xcc67('0x4f')]['FaxAccountId']=_0x4bd1ee['id'];if(_0x1154ee[_0xcc67('0x47')][_0xcc67('0x52')]){_0x25dfe9[_0xcc67('0x4f')]=_[_0xcc67('0x53')](_0x25dfe9[_0xcc67('0x4f')],{'$or':_[_0xcc67('0x41')](_0x25dfe9[_0xcc67('0x49')],function(_0x56f183){var _0xedaba={};_0xedaba[_0x56f183]={'$like':'%'+_0x1154ee['query'][_0xcc67('0x52')]+'%'};return _0xedaba;})});}_0x25dfe9=_[_0xcc67('0x53')]({},_0x25dfe9,_0x1154ee[_0xcc67('0x55')]);return db[_0xcc67('0x69')][_0xcc67('0x32')]({'where':_0x25dfe9[_0xcc67('0x4f')]})['then'](function(_0x4e6cf1){_0x331eb2['count']=_0x4e6cf1;if(_0x1154ee['query'][_0xcc67('0x56')]){_0x25dfe9['include']=[{'all':!![]}];}return db[_0xcc67('0x69')][_0xcc67('0x58')](_0x25dfe9);})[_0xcc67('0x23')](function(_0x470698){_0x331eb2['rows']=_0x470698;return _0x331eb2;});}})[_0xcc67('0x23')](respondWithFilteredResult(_0x3dc3e2,_0x25dfe9))['catch'](handleError(_0x3dc3e2,null));};exports[_0xcc67('0x6c')]=function(_0x3e37c3,_0x5a1d49,_0x4ea1d2){return db[_0xcc67('0x42')]['find']({'where':{'id':_0x3e37c3['params']['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x5a1d49,null))[_0xcc67('0x23')](function(_0x3bf617){if(_0x3bf617){return _0x3bf617[_0xcc67('0x6c')](_0x3e37c3[_0xcc67('0x47')][_0xcc67('0x6d')]);}})[_0xcc67('0x23')](respondWithStatusCode(_0x5a1d49,null))[_0xcc67('0x2b')](handleError(_0x5a1d49,null));};exports[_0xcc67('0x6e')]=function(_0x36bacf,_0xd3d26a,_0x14ca05){if(_0x36bacf['body']['id']){delete _0x36bacf[_0xcc67('0x65')]['id'];}return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x36bacf[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0xd3d26a,null))[_0xcc67('0x23')](function(_0x59d6fc){if(_0x59d6fc){_0x36bacf[_0xcc67('0x65')][_0xcc67('0x68')]=_0x59d6fc['id'];return db['CannedAnswer']['create'](_0x36bacf[_0xcc67('0x65')]);}})['then'](respondWithResult(_0xd3d26a,null))[_0xcc67('0x2b')](handleError(_0xd3d26a,null));};exports[_0xcc67('0x6f')]=function(_0x353496,_0x48beb8,_0x23d2fc){var _0x1afd6b={'raw':![],'where':{}};var _0x533903={};var _0x560d38={'count':0x0,'rows':[]};return db[_0xcc67('0x42')][_0xcc67('0x6a')]({'where':{'id':_0x353496[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x48beb8,null))[_0xcc67('0x23')](function(_0x41447d){if(_0x41447d){_0x533903[_0xcc67('0x46')]=_[_0xcc67('0x5b')](db[_0xcc67('0x70')]['rawAttributes']);_0x533903[_0xcc67('0x47')]=_[_0xcc67('0x5b')](_0x353496[_0xcc67('0x47')]);_0x533903[_0xcc67('0x50')]=_[_0xcc67('0x48')](_0x533903['model'],_0x533903['query']);_0x1afd6b[_0xcc67('0x49')]=_[_0xcc67('0x48')](_0x533903[_0xcc67('0x46')],qs['fields'](_0x353496['query'][_0xcc67('0x4a')]));_0x1afd6b['attributes']=_0x1afd6b[_0xcc67('0x49')][_0xcc67('0x6b')]?_0x1afd6b['attributes']:_0x533903[_0xcc67('0x46')];if(!_0x353496['query'][_0xcc67('0x4b')]('nolimit')){_0x1afd6b[_0xcc67('0x31')]=qs[_0xcc67('0x31')](_0x353496[_0xcc67('0x47')][_0xcc67('0x31')]);_0x1afd6b[_0xcc67('0x2f')]=qs[_0xcc67('0x2f')](_0x353496[_0xcc67('0x47')][_0xcc67('0x2f')]);}_0x1afd6b['order']=qs[_0xcc67('0x4e')](_0x353496[_0xcc67('0x47')][_0xcc67('0x4e')]);_0x1afd6b[_0xcc67('0x4f')]=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x353496[_0xcc67('0x47')],_0x533903[_0xcc67('0x50')]));_0x1afd6b['where'][_0xcc67('0x68')]=_0x41447d['id'];if(_0x353496[_0xcc67('0x47')][_0xcc67('0x52')]){_0x1afd6b[_0xcc67('0x4f')]=_['merge'](_0x1afd6b[_0xcc67('0x4f')],{'$or':_[_0xcc67('0x41')](_0x1afd6b[_0xcc67('0x49')],function(_0x4a4603){var _0x1b4b68={};_0x1b4b68[_0x4a4603]={'$like':'%'+_0x353496[_0xcc67('0x47')][_0xcc67('0x52')]+'%'};return _0x1b4b68;})});}_0x1afd6b=_[_0xcc67('0x53')]({},_0x1afd6b,_0x353496[_0xcc67('0x55')]);return db[_0xcc67('0x70')][_0xcc67('0x32')]({'where':_0x1afd6b[_0xcc67('0x4f')]})[_0xcc67('0x23')](function(_0x2b8588){_0x560d38['count']=_0x2b8588;if(_0x353496[_0xcc67('0x47')]['includeAll']){_0x1afd6b[_0xcc67('0x57')]=[{'all':!![]}];}return db[_0xcc67('0x70')][_0xcc67('0x58')](_0x1afd6b);})[_0xcc67('0x23')](function(_0x37a05c){_0x560d38[_0xcc67('0x59')]=_0x37a05c;return _0x560d38;});}})[_0xcc67('0x23')](respondWithFilteredResult(_0x48beb8,_0x1afd6b))[_0xcc67('0x2b')](handleError(_0x48beb8,null));};exports[_0xcc67('0x71')]=function(_0x26a3dc,_0x4dd90a,_0x32223){return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x26a3dc[_0xcc67('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4dd90a,null))['then'](function(_0x23d17d){if(_0x23d17d){return _0x23d17d[_0xcc67('0x71')](_0x26a3dc[_0xcc67('0x47')][_0xcc67('0x6d')]);}})['then'](respondWithStatusCode(_0x4dd90a,null))[_0xcc67('0x2b')](handleError(_0x4dd90a,null));};exports[_0xcc67('0x72')]=function(_0x285ae6,_0x4cd4ca,_0x1d1c83){return db[_0xcc67('0x73')]['find']({'where':{'id':_0x285ae6[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x4cd4ca,null))[_0xcc67('0x23')](function(_0x2d1f22){if(_0x2d1f22){return _0x2d1f22[_0xcc67('0x72')](_0x285ae6[_0xcc67('0x65')][_0xcc67('0x6d')],_[_0xcc67('0x74')](_0x285ae6[_0xcc67('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x4cd4ca,null))[_0xcc67('0x2b')](handleError(_0x4cd4ca,null));};exports[_0xcc67('0x75')]=function(_0x4dcaaa,_0x226e19,_0x1afbc6){var _0x171947={'raw':![],'where':{}};var _0x8d4258={};var _0x2622fe={'count':0x0,'rows':[]};return db[_0xcc67('0x42')][_0xcc67('0x6a')]({'where':{'id':_0x4dcaaa[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x226e19,null))[_0xcc67('0x23')](function(_0x28a0ce){if(_0x28a0ce){_0x8d4258['model']=_[_0xcc67('0x5b')](db[_0xcc67('0x73')][_0xcc67('0x43')]);_0x8d4258[_0xcc67('0x47')]=_[_0xcc67('0x5b')](_0x4dcaaa[_0xcc67('0x47')]);_0x8d4258[_0xcc67('0x50')]=_[_0xcc67('0x48')](_0x8d4258[_0xcc67('0x46')],_0x8d4258[_0xcc67('0x47')]);_0x171947[_0xcc67('0x49')]=_['intersection'](_0x8d4258['model'],qs[_0xcc67('0x4a')](_0x4dcaaa[_0xcc67('0x47')][_0xcc67('0x4a')]));_0x171947[_0xcc67('0x49')]=_0x171947[_0xcc67('0x49')]['length']?_0x171947[_0xcc67('0x49')]:_0x8d4258['model'];if(!_0x4dcaaa['query']['hasOwnProperty'](_0xcc67('0x4c'))){_0x171947[_0xcc67('0x31')]=qs[_0xcc67('0x31')](_0x4dcaaa[_0xcc67('0x47')][_0xcc67('0x31')]);_0x171947[_0xcc67('0x2f')]=qs['offset'](_0x4dcaaa['query'][_0xcc67('0x2f')]);}_0x171947['order']=qs['sort'](_0x4dcaaa[_0xcc67('0x47')]['sort']);_0x171947['where']=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x4dcaaa[_0xcc67('0x47')],_0x8d4258[_0xcc67('0x50')]));_0x171947[_0xcc67('0x4f')][_0xcc67('0x68')]=_0x28a0ce['id'];if(_0x4dcaaa['query'][_0xcc67('0x52')]){_0x171947[_0xcc67('0x4f')]=_[_0xcc67('0x53')](_0x171947[_0xcc67('0x4f')],{'$or':_[_0xcc67('0x41')](_0x171947[_0xcc67('0x49')],function(_0x5a0842){var _0x5881c3={};_0x5881c3[_0x5a0842]={'$like':'%'+_0x4dcaaa['query'][_0xcc67('0x52')]+'%'};return _0x5881c3;})});}_0x171947=_[_0xcc67('0x53')]({},_0x171947,_0x4dcaaa[_0xcc67('0x55')]);return db[_0xcc67('0x73')][_0xcc67('0x32')]({'where':_0x171947[_0xcc67('0x4f')]})[_0xcc67('0x23')](function(_0x5c46c3){_0x2622fe['count']=_0x5c46c3;if(_0x4dcaaa['query'][_0xcc67('0x56')]){_0x171947[_0xcc67('0x57')]=[{'model':db[_0xcc67('0x76')],'as':_0xcc67('0x77'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xcc67('0x3c'),_0xcc67('0x78'),_0xcc67('0x79')],'required':![]},{'model':db[_0xcc67('0x7a')],'as':_0xcc67('0x7b'),'attributes':['id','name',_0xcc67('0x7c')],'where':_0x4dcaaa[_0xcc67('0x47')][_0xcc67('0x7d')]?{'id':_0x4dcaaa['query'][_0xcc67('0x7d')]}:undefined,'required':_0x4dcaaa[_0xcc67('0x47')]['tag']?!![]:![]}];}return db[_0xcc67('0x73')][_0xcc67('0x58')](_0x171947);})['then'](function(_0x102ae6){_0x2622fe[_0xcc67('0x59')]=_0x102ae6;return _0x2622fe;});}})[_0xcc67('0x23')](respondWithFilteredResult(_0x226e19,_0x171947))[_0xcc67('0x2b')](handleError(_0x226e19,null));};exports[_0xcc67('0x7e')]=function(_0xfb57ba,_0x179ce5){var _0x41fbbe=_0xfb57ba[_0xcc67('0x5a')]['id'];var _0x27c080=_0xfb57ba[_0xcc67('0x65')];var _0x121645=0xc8;var _0x22ec20=null;return db[_0xcc67('0x7f')][_0xcc67('0x80')]({'isolationLevel':db[_0xcc67('0x7f')][_0xcc67('0x81')][_0xcc67('0x82')][_0xcc67('0x83')]},function(_0x3d8086){return db['FaxAccount'][_0xcc67('0x6a')]({'where':{'id':_0x41fbbe},'transaction':_0x3d8086})[_0xcc67('0x23')](function(_0x44d010){if(_0x44d010){return db[_0xcc67('0x84')][_0xcc67('0x66')]({'where':{'FaxAccountId':_0x41fbbe},'transaction':_0x3d8086})[_0xcc67('0x23')](function(){var _0x5464ec=_[_0xcc67('0x41')](_0x27c080,function(_0x528aa8){_0x528aa8[_0xcc67('0x68')]=_0x41fbbe;return _0x528aa8;});return db[_0xcc67('0x84')][_0xcc67('0x85')](_0x5464ec,{'transaction':_0x3d8086});});}else{_0x121645=0x194;_0x22ec20=[];}});})['then'](function(){if(_0x121645!==0x194){return db[_0xcc67('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x41fbbe},'order':_0xcc67('0x86')})[_0xcc67('0x23')](function(_0x4f15a1){_0x22ec20=_0x4f15a1;});}})[_0xcc67('0x2b')](function(_0x56d467){_0x121645=0x1f4;logger[_0xcc67('0x28')](_0x56d467[_0xcc67('0x3b')]);if(_0x56d467[_0xcc67('0x3c')]){delete _0x56d467['name'];}_0x22ec20=_0x56d467;})[_0xcc67('0x87')](function(){if(_0x22ec20===null){_0x179ce5[_0xcc67('0x2c')](_0x121645);}else{if(_0x121645===0x1f4){_0x179ce5['status'](_0x121645)[_0xcc67('0x3d')](_0x22ec20);}else{_0x179ce5['status'](_0x121645)['json'](_0x22ec20);}}});};exports['getApplications']=function(_0x54e46e,_0x55f9cd,_0x3f6c30){var _0x1ae916={};var _0x2f410f={};var _0x22a697;var _0x27df94;return db[_0xcc67('0x42')][_0xcc67('0x6a')]({'where':{'id':_0x54e46e[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x55f9cd,null))[_0xcc67('0x23')](function(_0x213616){if(_0x213616){_0x22a697=_0x213616;_0x2f410f[_0xcc67('0x46')]=_[_0xcc67('0x5b')](db[_0xcc67('0x84')][_0xcc67('0x43')]);_0x2f410f[_0xcc67('0x47')]=_['keys'](_0x54e46e[_0xcc67('0x47')]);_0x2f410f[_0xcc67('0x50')]=_[_0xcc67('0x48')](_0x2f410f['model'],_0x2f410f[_0xcc67('0x47')]);_0x1ae916['attributes']=_[_0xcc67('0x48')](_0x2f410f[_0xcc67('0x46')],qs[_0xcc67('0x4a')](_0x54e46e['query'][_0xcc67('0x4a')]));_0x1ae916[_0xcc67('0x49')]=_0x1ae916['attributes'][_0xcc67('0x6b')]?_0x1ae916['attributes']:_0x2f410f[_0xcc67('0x46')];_0x1ae916[_0xcc67('0x4d')]=qs[_0xcc67('0x4e')](_0x54e46e['query'][_0xcc67('0x4e')]);_0x1ae916['where']=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x54e46e[_0xcc67('0x47')],_0x2f410f[_0xcc67('0x50')]));if(_0x54e46e[_0xcc67('0x47')][_0xcc67('0x52')]){_0x1ae916['where']=_[_0xcc67('0x53')](_0x1ae916['where'],{'$or':_[_0xcc67('0x41')](_0x1ae916[_0xcc67('0x49')],function(_0x1565ac){var _0x36013f={};_0x36013f[_0x1565ac]={'$like':'%'+_0x54e46e['query']['filter']+'%'};return _0x36013f;})});}_0x1ae916=_[_0xcc67('0x53')]({},_0x1ae916,_0x54e46e[_0xcc67('0x55')]);return _0x22a697[_0xcc67('0x88')](_0x1ae916);}})['then'](function(_0x2079a5){if(_0x2079a5){_0x27df94=_0x2079a5[_0xcc67('0x6b')];if(!_0x54e46e[_0xcc67('0x47')][_0xcc67('0x4b')](_0xcc67('0x4c'))){_0x1ae916[_0xcc67('0x31')]=qs[_0xcc67('0x31')](_0x54e46e[_0xcc67('0x47')][_0xcc67('0x31')]);_0x1ae916[_0xcc67('0x2f')]=qs['offset'](_0x54e46e[_0xcc67('0x47')][_0xcc67('0x2f')]);}return _0x22a697[_0xcc67('0x88')](_0x1ae916);}})[_0xcc67('0x23')](function(_0x30f0a2){if(_0x30f0a2){return _0x30f0a2?{'count':_0x27df94,'rows':_0x30f0a2}:null;}})[_0xcc67('0x23')](respondWithResult(_0x55f9cd,null))[_0xcc67('0x2b')](handleError(_0x55f9cd,null));};function Extension(_0x59dd30,_0x162622,_0x20e427,_0x5e31d8){this['context']=_0xcc67('0x89');this[_0xcc67('0x8a')]=_0x59dd30['localstationid'];this['app']=_0x5e31d8;this[_0xcc67('0x45')]=_0xcc67('0x8b');this['description']=_0xcc67('0x8c');this[_0xcc67('0x68')]=_0x59dd30['id'];this[_0xcc67('0x86')]=_0x162622;this[_0xcc67('0x8d')]=_0x20e427;}function createExtensionsReciveFax(_0x3c56d6){var _0x1f8e94=0x1;var _0x5e477f=[];_0x5e477f[_0xcc67('0x8e')](new Extension(_0x3c56d6,_0x1f8e94,'',_0xcc67('0x8f')));_0x1f8e94+=0x1;_0x5e477f[_0xcc67('0x8e')](new Extension(_0x3c56d6,_0x1f8e94,'CDR(type)=inbound-fax',_0xcc67('0x90')));_0x1f8e94+=0x1;for(var _0x3e8563 in _0x3c56d6){if(_0x3c56d6[_0xcc67('0x4b')](_0x3e8563)&&(_0x3e8563==='ecm'||_0x3e8563===_0xcc67('0x91')||_0x3e8563===_0xcc67('0x92')||_0x3e8563===_0xcc67('0x93')||_0x3e8563===_0xcc67('0x94')||_0x3e8563===_0xcc67('0x95')||_0x3e8563===_0xcc67('0x96')||_0x3e8563===_0xcc67('0x97')||_0x3e8563===_0xcc67('0x98'))){_0x5e477f[_0xcc67('0x8e')](new Extension(_0x3c56d6,_0x1f8e94,_0xcc67('0x99')+_0x3e8563+')='+_0x3c56d6[_0x3e8563],_0xcc67('0x90')));_0x1f8e94+=0x1;}}_0x5e477f[_0xcc67('0x8e')](new Extension(_0x3c56d6,_0x1f8e94,'6',_0xcc67('0x9a')));_0x1f8e94+=0x1;_0x5e477f[_0xcc67('0x8e')](new Extension(_0x3c56d6,_0x1f8e94,'/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'));_0x1f8e94=0x0;return _0x5e477f;}exports[_0xcc67('0x9b')]=function(_0x450308,_0x26e8f1,_0x59d1ab){var _0xed7263;return db[_0xcc67('0x7f')][_0xcc67('0x80')](function(_0x110c26){return db[_0xcc67('0x42')][_0xcc67('0x64')](_0x450308['body'],{'transaction':_0x110c26})['then'](function(_0x2d8951){_0xed7263=_0x2d8951[_0xcc67('0x5e')]({'plain':!![]});return db[_0xcc67('0x9c')][_0xcc67('0x85')](createExtensionsReciveFax(_0xed7263),{'transaction':_0x110c26});});})[_0xcc67('0x23')](function(){return _0xed7263;})[_0xcc67('0x23')](respondWithResult(_0x26e8f1,null))[_0xcc67('0x2b')](handleError(_0x26e8f1,null));};exports[_0xcc67('0x9d')]=function(_0x4d74b1,_0x110e10,_0x7e4118){var _0x1a09ca;return db[_0xcc67('0x7f')][_0xcc67('0x80')](function(_0x1c878d){return db[_0xcc67('0x42')][_0xcc67('0x38')](_0x4d74b1[_0xcc67('0x65')],{'where':{'id':_0x4d74b1['body']['id']},'transaction':_0x1c878d})[_0xcc67('0x23')](function(_0x5dde79){return db['VoiceExtension'][_0xcc67('0x66')]({'where':{'FaxAccountId':_0x4d74b1[_0xcc67('0x65')]['id']},'transaction':_0x1c878d})[_0xcc67('0x23')](function(_0x21a49){return db[_0xcc67('0x9c')][_0xcc67('0x85')](createExtensionsReciveFax(_[_0xcc67('0x74')](_0x4d74b1['body'],['tech',_0xcc67('0x9e'),_0xcc67('0x9f'),_0xcc67('0xa0'),_0xcc67('0xa1'),_0xcc67('0xa2')])),{'transaction':_0x1c878d});});});})[_0xcc67('0x23')](function(){return db[_0xcc67('0x42')][_0xcc67('0xa3')](_0x4d74b1[_0xcc67('0x65')]['id']);})[_0xcc67('0x23')](respondWithResult(_0x110e10,null))[_0xcc67('0x2b')](handleError(_0x110e10,null));};exports[_0xcc67('0xa4')]=function(_0x166760,_0x1b7df3,_0x3bb779){var _0x5acfe7={'raw':!![],'where':{}};var _0x5bb69d={};var _0x13031d={'count':0x0,'rows':[]};return db['FaxAccount'][_0xcc67('0x6a')]({'where':{'id':_0x166760[_0xcc67('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b7df3,null))[_0xcc67('0x23')](function(_0x2f74d5){if(_0x2f74d5){_0x5bb69d[_0xcc67('0x46')]=_[_0xcc67('0x5b')](db['FaxMessage'][_0xcc67('0x43')]);_0x5bb69d['query']=_[_0xcc67('0x5b')](_0x166760[_0xcc67('0x47')]);_0x5bb69d[_0xcc67('0x50')]=_['intersection'](_0x5bb69d[_0xcc67('0x46')],_0x5bb69d['query']);_0x5acfe7[_0xcc67('0x49')]=_[_0xcc67('0x48')](_0x5bb69d['model'],qs[_0xcc67('0x4a')](_0x166760[_0xcc67('0x47')][_0xcc67('0x4a')]));_0x5acfe7[_0xcc67('0x49')]=_0x5acfe7['attributes']['length']?_0x5acfe7['attributes']:_0x5bb69d[_0xcc67('0x46')];if(!_0x166760[_0xcc67('0x47')][_0xcc67('0x4b')](_0xcc67('0x4c'))){_0x5acfe7[_0xcc67('0x31')]=qs['limit'](_0x166760[_0xcc67('0x47')][_0xcc67('0x31')]);_0x5acfe7['offset']=qs['offset'](_0x166760[_0xcc67('0x47')]['offset']);}_0x5acfe7[_0xcc67('0x4d')]=qs['sort'](_0x166760[_0xcc67('0x47')][_0xcc67('0x4e')]);_0x5acfe7[_0xcc67('0x4f')]=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x166760[_0xcc67('0x47')],_0x5bb69d[_0xcc67('0x50')]));_0x5acfe7[_0xcc67('0x4f')][_0xcc67('0x68')]=_0x2f74d5['id'];if(_0x166760['query']['filter']){_0x5acfe7[_0xcc67('0x4f')]=_[_0xcc67('0x53')](_0x5acfe7[_0xcc67('0x4f')],{'$or':_['map'](_0x5acfe7[_0xcc67('0x49')],function(_0x540d04){var _0x173c28={};_0x173c28[_0x540d04]={'$like':'%'+_0x166760[_0xcc67('0x47')][_0xcc67('0x52')]+'%'};return _0x173c28;})});}if(_0x166760[_0xcc67('0x47')][_0xcc67('0xa5')]){var _0x2a38d2=_0x166760[_0xcc67('0x47')][_0xcc67('0xa5')][_0xcc67('0xa6')](',');var _0x2842f6={};_0x2842f6[_0x2a38d2[0x0]]={'$gte':moment(_0x2a38d2[0x1])[_0xcc67('0xa7')](_0xcc67('0xa8'))};_0x5acfe7[_0xcc67('0x4f')]=_['merge'](_0x5acfe7['where'],_0x2842f6);}_0x5acfe7=_['merge']({},_0x5acfe7,_0x166760[_0xcc67('0x55')]);return db[_0xcc67('0xa9')][_0xcc67('0x32')]({'where':_0x5acfe7[_0xcc67('0x4f')]})[_0xcc67('0x23')](function(_0x197ac0){_0x13031d['count']=_0x197ac0;if(_0x166760[_0xcc67('0x47')][_0xcc67('0x56')]){_0x5acfe7[_0xcc67('0x57')]=[{'all':!![]}];}return db[_0xcc67('0xa9')]['findAll'](_0x5acfe7);})[_0xcc67('0x23')](function(_0x1a1900){_0x13031d[_0xcc67('0x59')]=_0x1a1900;return _0x13031d;});}})['then'](respondWithFilteredResult(_0x1b7df3,_0x5acfe7))['catch'](handleError(_0x1b7df3,null));};exports[_0xcc67('0x3d')]=function(_0x2cd236,_0x271e12,_0xe5b8e8){var _0x20b2a1,_0x2d0aa4={},_0x9cea5a;if(_0x2cd236[_0xcc67('0x65')]['to']){_0x9cea5a=_0x2cd236[_0xcc67('0x65')]['to'][0x0];}return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x2cd236[_0xcc67('0x5a')]['id']},'include':[{'model':db[_0xcc67('0xaa')],'as':_0xcc67('0xab'),'include':[{'model':db[_0xcc67('0x76')],'as':'Contacts','where':{'fax':_0x9cea5a},'limit':0x1,'order':[[_0xcc67('0xa0'),_0xcc67('0xac')]]}]}]})[_0xcc67('0x23')](handleEntityNotFound(_0x271e12,null))['then'](function(_0x49d11a){_0x20b2a1=_0x49d11a;if(_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')]&&_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')]['length']){for(var _0x80bbd2=0x0;_0x80bbd2<_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')]['length'];_0x80bbd2+=0x1){_0x2cd236[_0xcc67('0x65')]['attachments'][_0x80bbd2]={'filename':_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][_0x80bbd2][_0xcc67('0x3c')],'id':_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][_0x80bbd2]['id'],'path':path[_0xcc67('0xae')](config[_0xcc67('0xaf')],'server/files/attachments',_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][_0x80bbd2][_0xcc67('0xb0')])};}}return respondWithRpcPromise(_0xcc67('0xb1'),_0xcc67('0xb1'),{'FaxAccountId':_[_0xcc67('0xb2')](_0x2cd236['params']['id'])?undefined:_0x2cd236[_0xcc67('0x5a')]['id'],'path':_[_0xcc67('0xb2')](_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][0x0][_0xcc67('0x7')])?undefined:_0x2cd236[_0xcc67('0x65')]['attachments'][0x0][_0xcc67('0x7')],'fax':_[_0xcc67('0xb2')](_0x2cd236[_0xcc67('0x65')]['to'][0x0])?undefined:_0x2cd236[_0xcc67('0x65')]['to'][0x0]},client9002);})[_0xcc67('0x23')](function(){if(_0x20b2a1){if(_[_0xcc67('0xb2')](_0x2cd236['body']['from'])){_0x2cd236[_0xcc67('0x65')][_0xcc67('0xb3')]=util['format'](_0xcc67('0xb4'),_0x20b2a1[_0xcc67('0x3c')],_0x20b2a1['fax']);}if(_0x20b2a1[_0xcc67('0xab')]){if(_0x20b2a1[_0xcc67('0xab')][_0xcc67('0xb5')][_0xcc67('0x6b')]){return _0x20b2a1['List'][_0xcc67('0xb5')][0x0];}else{return db['CmContact'][_0xcc67('0x64')](_['defaults'](_0x2cd236[_0xcc67('0x65')],{'firstName':_0x2cd236[_0xcc67('0x65')]['to'][0x0],'phone':_0x2cd236[_0xcc67('0x65')]['to'][0x0],'fax':_0x2cd236[_0xcc67('0x65')]['to'][0x0],'ListId':_0x20b2a1['ListId']}));}}else{throw new Error(_0xcc67('0xb6'));}}else{throw new Error(_0xcc67('0xb7'));}})['then'](function(_0x21da43){if(_0x21da43){return db[_0xcc67('0x73')][_0xcc67('0x5c')]({'where':{'ContactId':_0x21da43['id'],'closed':![],'FaxAccountId':_0x20b2a1['id']}})[_0xcc67('0x23')](function(_0x2d89a6){if(_0x2d89a6){return[_0x2d89a6,![]];}return db[_0xcc67('0x73')][_0xcc67('0x64')]({'UserId':_0x2cd236[_0xcc67('0x5d')]['id'],'ContactId':_0x21da43['id'],'FaxAccountId':_0x20b2a1['id'],'fax':_0x2cd236['body']['to'][0x0],'firstMsgDirection':_0xcc67('0xb8'),'Messages':[_[_0xcc67('0x53')](_0x2cd236['body'],{'read':![],'body':_0x2cd236['body'][_0xcc67('0xad')][0x0][_0xcc67('0xb9')],'FaxAccountId':_0x20b2a1['id'],'UserId':_0x2cd236[_0xcc67('0x5d')]['id'],'ContactId':_0x21da43['id'],'AttachmentId':_0x2cd236['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xcc67('0xba')}]})[_0xcc67('0x23')](function(_0x3cb9bd){return[_0x3cb9bd,!![]];});});}else{throw new Error(_0xcc67('0xbb'));}})['spread'](function(_0x29c6a8,_0x27b66f){if(_0x27b66f){return _0x29c6a8;}return db['FaxMessage'][_0xcc67('0x64')]({'direction':'out','read':![],'body':_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][0x0][_0xcc67('0xb9')],'FaxAccountId':_0x20b2a1['id'],'FaxInteractionId':_0x29c6a8['id'],'UserId':_0x2cd236[_0xcc67('0x5d')]['id'],'ContactId':_0x29c6a8['ContactId'],'AttachmentId':_0x2cd236[_0xcc67('0x65')][_0xcc67('0xad')][0x0]['id']})[_0xcc67('0x23')](function(_0x272dc0){_0x29c6a8[_0xcc67('0xbc')][_0xcc67('0xba')]=[];_0x29c6a8[_0xcc67('0xbc')][_0xcc67('0xba')][_0xcc67('0x8e')](_0x272dc0['dataValues']);return _0x29c6a8;});})[_0xcc67('0x23')](function(_0x5351d0){respondWithRpcPromise(_0xcc67('0xbd'),'SendFax',{'FaxAccountId':_[_0xcc67('0xb2')](_0x2cd236[_0xcc67('0x5a')]['id'])?undefined:_0x2cd236[_0xcc67('0x5a')]['id'],'path':_[_0xcc67('0xb2')](_0x2cd236['body'][_0xcc67('0xad')][0x0][_0xcc67('0x7')])?undefined:_0x2cd236[_0xcc67('0x65')]['attachments'][0x0]['path'],'fax':_[_0xcc67('0xb2')](_0x2cd236[_0xcc67('0x65')]['to'][0x0])?undefined:_0x2cd236[_0xcc67('0x65')]['to'][0x0],'AttachmentId':_0x2cd236['body']['attachments'][0x0]['id']},client9002)[_0xcc67('0x23')](function(_0x9e53e3){logger[_0xcc67('0x24')](_0xcc67('0xbe'),_0x9e53e3);})['catch'](function(_0xeb1297){logger[_0xcc67('0x24')](_0xcc67('0xbe'),_0xeb1297);});return _0x5351d0;})[_0xcc67('0x23')](respondWithResult(_0x271e12,null))[_0xcc67('0x2b')](handleError(_0x271e12,null));};exports[_0xcc67('0xbf')]=function(_0x396e5b,_0x30935d,_0x17063c){return db['FaxAccount'][_0xcc67('0x5c')]({'where':{'id':_0x396e5b[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x30935d,null))['then'](function(_0x3a6e88){if(_0x3a6e88){return _0x3a6e88[_0xcc67('0xbf')](_0x396e5b['body'][_0xcc67('0x6d')],_[_0xcc67('0x74')](_0x396e5b['body'],['ids','id'])||{})[_0xcc67('0xc0')](function(_0x3aede8){for(var _0x26d889=0x0;_0x26d889<_0x396e5b[_0xcc67('0x65')][_0xcc67('0x6d')][_0xcc67('0x6b')];_0x26d889+=0x1){socket['emit'](_0xcc67('0xc1'),{'UserId':Number(_0x396e5b[_0xcc67('0x65')][_0xcc67('0x6d')][_0x26d889]),'FaxAccountId':Number(_0x396e5b[_0xcc67('0x5a')]['id'])});}return _0x3aede8;});}})[_0xcc67('0x23')](respondWithResult(_0x30935d,null))[_0xcc67('0x2b')](handleError(_0x30935d,null));};exports[_0xcc67('0xc2')]=function(_0x2c4616,_0x25003b,_0x5df2fe){return db[_0xcc67('0x42')][_0xcc67('0x5c')]({'where':{'id':_0x2c4616[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x25003b,null))[_0xcc67('0x23')](function(_0x5a1c9a){if(_0x5a1c9a){return _0x5a1c9a[_0xcc67('0xc2')](_0x2c4616[_0xcc67('0x47')][_0xcc67('0x6d')])[_0xcc67('0x23')](function(){if(_[_0xcc67('0xc3')](_0x2c4616[_0xcc67('0x47')]['ids'])){for(var _0xa9277a=0x0;_0xa9277a<_0x2c4616['query'][_0xcc67('0x6d')][_0xcc67('0x6b')];_0xa9277a+=0x1){socket['emit'](_0xcc67('0xc4'),{'UserId':Number(_0x2c4616['query'][_0xcc67('0x6d')][_0xa9277a]),'FaxAccountId':Number(_0x2c4616[_0xcc67('0x5a')]['id'])});}}else{socket['emit'](_0xcc67('0xc4'),{'UserId':Number(_0x2c4616[_0xcc67('0x47')][_0xcc67('0x6d')]),'FaxAccountId':Number(_0x2c4616[_0xcc67('0x5a')]['id'])});}});}})[_0xcc67('0x23')](respondWithStatusCode(_0x25003b,null))[_0xcc67('0x2b')](handleError(_0x25003b,null));};exports[_0xcc67('0xc5')]=function(_0x4ed3dc,_0x4bc672,_0x517dd1){var _0x446987={};var _0x4b9c4f={};var _0x34baf9;var _0x32dbf0;return db[_0xcc67('0x42')][_0xcc67('0x6a')]({'where':{'id':_0x4ed3dc[_0xcc67('0x5a')]['id']}})[_0xcc67('0x23')](handleEntityNotFound(_0x4bc672,null))[_0xcc67('0x23')](function(_0xa9c124){if(_0xa9c124){_0x34baf9=_0xa9c124;_0x4b9c4f[_0xcc67('0x46')]=_[_0xcc67('0x5b')](db[_0xcc67('0xc6')][_0xcc67('0x43')]);_0x4b9c4f[_0xcc67('0x47')]=_[_0xcc67('0x5b')](_0x4ed3dc[_0xcc67('0x47')]);_0x4b9c4f['filters']=_['intersection'](_0x4b9c4f[_0xcc67('0x46')],_0x4b9c4f[_0xcc67('0x47')]);_0x446987[_0xcc67('0x49')]=_[_0xcc67('0x48')](_0x4b9c4f[_0xcc67('0x46')],qs[_0xcc67('0x4a')](_0x4ed3dc[_0xcc67('0x47')][_0xcc67('0x4a')]));_0x446987['attributes']=_0x446987[_0xcc67('0x49')][_0xcc67('0x6b')]?_0x446987[_0xcc67('0x49')]:_0x4b9c4f[_0xcc67('0x46')];_0x446987['order']=qs[_0xcc67('0x4e')](_0x4ed3dc['query'][_0xcc67('0x4e')]);_0x446987[_0xcc67('0x4f')]=qs[_0xcc67('0x50')](_[_0xcc67('0x51')](_0x4ed3dc['query'],_0x4b9c4f[_0xcc67('0x50')]));if(_0x4ed3dc[_0xcc67('0x47')][_0xcc67('0x52')]){_0x446987[_0xcc67('0x4f')]=_[_0xcc67('0x53')](_0x446987[_0xcc67('0x4f')],{'$or':_[_0xcc67('0x41')](_0x446987['attributes'],function(_0x345e85){var _0x3a081d={};_0x3a081d[_0x345e85]={'$like':'%'+_0x4ed3dc[_0xcc67('0x47')][_0xcc67('0x52')]+'%'};return _0x3a081d;})});}_0x446987=_[_0xcc67('0x53')]({},_0x446987,_0x4ed3dc['options']);return _0x34baf9[_0xcc67('0xc5')](_0x446987);}})[_0xcc67('0x23')](function(_0x29440f){if(_0x29440f){_0x32dbf0=_0x29440f[_0xcc67('0x6b')];if(!_0x4ed3dc['query']['hasOwnProperty'](_0xcc67('0x4c'))){_0x446987['limit']=qs[_0xcc67('0x31')](_0x4ed3dc[_0xcc67('0x47')][_0xcc67('0x31')]);_0x446987[_0xcc67('0x2f')]=qs['offset'](_0x4ed3dc[_0xcc67('0x47')][_0xcc67('0x2f')]);}return _0x34baf9[_0xcc67('0xc5')](_0x446987);}})[_0xcc67('0x23')](function(_0x4387e0){if(_0x4387e0){return _0x4387e0?{'count':_0x32dbf0,'rows':_0x4387e0}:null;}})['then'](respondWithResult(_0x4bc672,null))[_0xcc67('0x2b')](handleError(_0x4bc672,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 96d98ec..4da4f6e 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 _0x3f74=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x3f74,0x121));var _0x43f7=function(_0x5240c6,_0xd476e7){_0x5240c6=_0x5240c6-0x0;var _0x352dd4=_0x3f74[_0x5240c6];return _0x352dd4;};'use strict';var EventEmitter=require(_0x43f7('0x0'));var FaxAccount=require(_0x43f7('0x1'))['db'][_0x43f7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x43f7('0x3')](0x0);var events={'afterCreate':_0x43f7('0x4'),'afterUpdate':_0x43f7('0x5'),'afterDestroy':_0x43f7('0x6')};function emitEvent(_0x1a52d0){return function(_0x591452,_0x1f5e13,_0xe4010d){FaxAccountEvents['emit'](_0x1a52d0+':'+_0x591452['id'],_0x591452);FaxAccountEvents['emit'](_0x1a52d0,_0x591452);_0xe4010d(null);};}for(var e in events){if(events[_0x43f7('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x43f7('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x6659=['exports','../../mysqldb','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xaed8bf,_0x1f9b1a){var _0x2abf40=function(_0x3d8a12){while(--_0x3d8a12){_0xaed8bf['push'](_0xaed8bf['shift']());}};_0x2abf40(++_0x1f9b1a);}(_0x6659,0x171));var _0x9665=function(_0x1c1cfc,_0x1ba40a){_0x1c1cfc=_0x1c1cfc-0x0;var _0x5e0fad=_0x6659[_0x1c1cfc];return _0x5e0fad;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x9665('0x0'))['db'][_0x9665('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9665('0x2')](0x0);var events={'afterCreate':_0x9665('0x3'),'afterUpdate':'update','afterDestroy':_0x9665('0x4')};function emitEvent(_0x12583c){return function(_0x341630,_0xfa0fc3,_0x3a9e17){FaxAccountEvents[_0x9665('0x5')](_0x12583c+':'+_0x341630['id'],_0x341630);FaxAccountEvents['emit'](_0x12583c,_0x341630);_0x3a9e17(null);};}for(var e in events){if(events[_0x9665('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x9665('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 226a5af..ba89310 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 _0x6922=['path','rimraf','../../config/environment','define','fax_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x12d36b,_0x2ae690){var _0x56bf22=function(_0x4a3636){while(--_0x4a3636){_0x12d36b['push'](_0x12d36b['shift']());}};_0x56bf22(++_0x2ae690);}(_0x6922,0x131));var _0x2692=function(_0x11eef2,_0x3a866c){_0x11eef2=_0x11eef2-0x0;var _0x4d4200=_0x6922[_0x11eef2];return _0x4d4200;};'use strict';var _=require(_0x2692('0x0'));var util=require('util');var logger=require(_0x2692('0x1'))(_0x2692('0x2'));var moment=require('moment');var BPromise=require(_0x2692('0x3'));var rp=require(_0x2692('0x4'));var fs=require('fs');var path=require(_0x2692('0x5'));var rimraf=require(_0x2692('0x6'));var config=require(_0x2692('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x20452a,_0x5c4c69){return _0x20452a[_0x2692('0x8')]('FaxAccount',attributes,{'tableName':_0x2692('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e63=['../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cb5ff,_0x1ce603){var _0x1dd6a8=function(_0x3fe505){while(--_0x3fe505){_0x1cb5ff['push'](_0x1cb5ff['shift']());}};_0x1dd6a8(++_0x1ce603);}(_0x0e63,0xa1));var _0x30e6=function(_0x4532d7,_0x288a04){_0x4532d7=_0x4532d7-0x0;var _0x489031=_0x0e63[_0x4532d7];return _0x489031;};'use strict';var _=require('lodash');var util=require(_0x30e6('0x0'));var logger=require(_0x30e6('0x1'))('api');var moment=require(_0x30e6('0x2'));var BPromise=require(_0x30e6('0x3'));var rp=require(_0x30e6('0x4'));var fs=require('fs');var path=require(_0x30e6('0x5'));var rimraf=require(_0x30e6('0x6'));var config=require(_0x30e6('0x7'));var attributes=require(_0x30e6('0x8'));module[_0x30e6('0x9')]=function(_0x1197dd,_0x5e453c){return _0x1197dd['define'](_0x30e6('0xa'),attributes,{'tableName':_0x30e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index ca3b7d9..dfc1aab 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 _0xd43a=['./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','Applications','get','applications','list','List','priority','asc','length','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','create','UserId','User','unshift','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x4d3d62,_0x2c65a2){var _0x264a0e=function(_0x44d330){while(--_0x44d330){_0x4d3d62['push'](_0x4d3d62['shift']());}};_0x264a0e(++_0x2c65a2);}(_0xd43a,0x1ec));var _0xad43=function(_0x11d110,_0x5b48ae){_0x11d110=_0x11d110-0x0;var _0x25464b=_0xd43a[_0x11d110];return _0x25464b;};'use strict';var _=require(_0xad43('0x0'));var util=require(_0xad43('0x1'));var moment=require(_0xad43('0x2'));var BPromise=require('bluebird');var rs=require(_0xad43('0x3'));var fs=require('fs');var Redis=require(_0xad43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad43('0x5'));var logger=require(_0xad43('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad43('0x7'));var client=jayson[_0xad43('0x8')][_0xad43('0x9')]({'port':0x232c});config[_0xad43('0xa')]=_[_0xad43('0xb')](config[_0xad43('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad43('0xa')]));require(_0xad43('0xc'))['register'](socket);function respondWithRpcPromise(_0x39025e,_0x45124b,_0x37c443){return new BPromise(function(_0x33716f,_0x34222c){return client['request'](_0x39025e,_0x37c443)[_0xad43('0xd')](function(_0x18cf1b){logger[_0xad43('0xe')](_0xad43('0xf'),_0x45124b,_0xad43('0x10'));logger['debug'](_0xad43('0x11'),_0x45124b,_0xad43('0x10'),JSON['stringify'](_0x18cf1b));if(_0x18cf1b[_0xad43('0x12')]){if(_0x18cf1b[_0xad43('0x12')]['code']===0x1f4){logger[_0xad43('0x12')](_0xad43('0xf'),_0x45124b,_0x18cf1b['error']['message']);return _0x34222c(_0x18cf1b['error'][_0xad43('0x13')]);}logger[_0xad43('0x12')](_0xad43('0xf'),_0x45124b,_0x18cf1b[_0xad43('0x12')][_0xad43('0x13')]);return _0x33716f(_0x18cf1b[_0xad43('0x12')][_0xad43('0x13')]);}else{logger[_0xad43('0xe')](_0xad43('0xf'),_0x45124b,'request\x20sent');_0x33716f(_0x18cf1b[_0xad43('0x14')]['message']);}})[_0xad43('0x15')](function(_0x54585f){logger[_0xad43('0x12')](_0xad43('0xf'),_0x45124b,_0x54585f);_0x34222c(_0x54585f);});});}exports[_0xad43('0x16')]=function(_0x95f6fa){var _0x19639c=this;return new Promise(function(_0xa29760,_0x126cf7){return db[_0xad43('0x17')][_0xad43('0x18')]({'raw':_0x95f6fa[_0xad43('0x19')]?_0x95f6fa[_0xad43('0x19')][_0xad43('0x1a')]===undefined?!![]:![]:!![],'where':_0x95f6fa[_0xad43('0x19')]?_0x95f6fa[_0xad43('0x19')]['where']||null:null,'attributes':_0x95f6fa['options']?_0x95f6fa[_0xad43('0x19')][_0xad43('0x1b')]||null:null,'limit':_0x95f6fa['options']?_0x95f6fa['options'][_0xad43('0x1c')]||null:null,'include':_0x95f6fa['options']?_0x95f6fa[_0xad43('0x19')][_0xad43('0x1d')]?_[_0xad43('0x1e')](_0x95f6fa[_0xad43('0x19')][_0xad43('0x1d')],function(_0x59b99b){return{'model':db[_0x59b99b[_0xad43('0x1f')]],'as':_0x59b99b['as'],'attributes':_0x59b99b[_0xad43('0x1b')],'include':_0x59b99b[_0xad43('0x1d')]?_['map'](_0x59b99b[_0xad43('0x1d')],function(_0x4e0623){return{'model':db[_0x4e0623['model']],'as':_0x4e0623['as'],'attributes':_0x4e0623['attributes'],'include':_0x4e0623[_0xad43('0x1d')]?_[_0xad43('0x1e')](_0x4e0623[_0xad43('0x1d')],function(_0x371ca2){return{'model':db[_0x371ca2[_0xad43('0x1f')]],'as':_0x371ca2['as'],'attributes':_0x371ca2[_0xad43('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x343164){logger['info']('GetFaxAccount',_0x95f6fa);logger['debug']('GetFaxAccount',_0x95f6fa,JSON[_0xad43('0x20')](_0x343164));_0xa29760(_0x343164);})[_0xad43('0x15')](function(_0x9439a7){logger['error'](_0xad43('0x16'),_0x9439a7[_0xad43('0x13')],_0x95f6fa);_0x126cf7(_0x19639c[_0xad43('0x12')](0x1f4,_0x9439a7[_0xad43('0x13')]));});});};exports[_0xad43('0x21')]=function(_0x5b5638,_0x377853,_0x5ba4e6){var _0x2e76c0=this;return new Promise(function(_0x5ca71b,_0x592ade){var _0x54c564={'body':_0x5b5638[_0xad43('0x22')],'channel':_0xad43('0x23')};var _0x4d95ef=[];var _0x337407=[];var _0x3f694b={};return db[_0xad43('0x24')][_0xad43('0x25')]()[_0xad43('0xd')](function(_0x4a637b){if(!_0x4a637b){throw new db[(_0xad43('0x26'))][(_0xad43('0x27'))]('no\x20available\x20attributes');}_0x4d95ef=_[_0xad43('0x28')](_[_0xad43('0x29')](_0x4a637b),['createdAt',_0xad43('0x2a')]);_0x337407=_[_0xad43('0x28')](_[_0xad43('0x29')](_0x4a637b),[_0xad43('0x2b'),'updatedAt','CompanyId',_0xad43('0x2c')]);if(_0x5b5638[_0xad43('0x22')]['id']){delete _0x5b5638[_0xad43('0x22')]['id'];}if(_[_0xad43('0x2d')](_0x5b5638[_0xad43('0x22')][_0xad43('0x2e')])){throw new db['Sequelize'][(_0xad43('0x27'))](_0xad43('0x2f'));}if(_[_0xad43('0x2d')](_0x5b5638[_0xad43('0x22')][_0xad43('0x22')])||_0x5b5638[_0xad43('0x22')][_0xad43('0x22')]===''){throw new db['Sequelize'][(_0xad43('0x27'))](_0xad43('0x30'));}if(_['isNil'](_0x5b5638['body'][_0xad43('0x31')])){throw new db[(_0xad43('0x26'))][(_0xad43('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x337407);}if(!_[_0xad43('0x32')](_0x337407,_0x5b5638[_0xad43('0x22')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xad43('0x33')+_0x337407);}_0x3f694b[_0x5b5638[_0xad43('0x22')][_0xad43('0x31')]]=_0x5b5638[_0xad43('0x22')][_0xad43('0x2e')];})[_0xad43('0xd')](function(){return db['FaxAccount'][_0xad43('0x34')]({'where':{'id':_0x5b5638[_0xad43('0x35')]['id']},'include':[{'model':db[_0xad43('0x36')],'as':'List','include':[{'model':db['CmContact'],'as':_0xad43('0x37'),'where':_0x3f694b,'limit':0x1,'order':[[_0xad43('0x2a'),_0xad43('0x38')]]}]},{'model':db['FaxApplication'],'as':_0xad43('0x39')}]});})[_0xad43('0xd')](function(_0x47786d){if(_0x47786d&&_0x47786d['List']){var _0x2e274a=_0x47786d[_0xad43('0x3a')]({'plain':!![]});_0x54c564[_0xad43('0x35')]=_0x2e274a;_0x54c564[_0xad43('0x3b')]=_0x2e274a['Applications'];_0x54c564[_0xad43('0x3c')]=_0x2e274a[_0xad43('0x3d')];_0x54c564['applications']=_['orderBy'](_0x54c564[_0xad43('0x3b')],[_0xad43('0x3e')],[_0xad43('0x3f')]);if(_0x54c564[_0xad43('0x35')]['Applications']){delete _0x54c564[_0xad43('0x35')]['Applications'];}if(_0x54c564['account']['List']&&_0x54c564['account'][_0xad43('0x3d')][_0xad43('0x37')][_0xad43('0x40')]){return _0x54c564[_0xad43('0x35')][_0xad43('0x3d')]['Contacts'][0x0];}var _0x2bfd01=_[_0xad43('0xb')](_0x5b5638[_0xad43('0x22')],{'firstName':_0x5b5638[_0xad43('0x22')]['from'],'ListId':_0x2e274a[_0xad43('0x2c')]});_0x2bfd01[_0x5b5638['body'][_0xad43('0x31')]]=_0x5b5638[_0xad43('0x22')][_0xad43('0x2e')];return db[_0xad43('0x24')]['create'](_0x2bfd01,{'fields':_0x4d95ef,'raw':!![]});}})[_0xad43('0xd')](function(_0x5348e7){_0x54c564[_0xad43('0x41')]=_0x5348e7;if(_0x5348e7){var _0x4c28c7={'ContactId':_0x5348e7['id'],'FaxAccountId':_0x5b5638[_0xad43('0x35')]['id'],'fax':_0x5348e7[_0xad43('0x23')]};return db[_0xad43('0x42')][_0xad43('0x34')]({'where':{'ContactId':_0x5348e7['id'],'closed':![],'FaxAccountId':_0x5b5638[_0xad43('0x35')]['id']}})[_0xad43('0xd')](function(_0x2ecace){if(_0x2ecace){return[_0x2ecace,![]];}return db[_0xad43('0x42')]['create'](_0x4c28c7)['then'](function(_0x536994){return[_0x536994,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xad43('0x43')](function(_0x5a2802,_0x183e24){var _0x4f216f=_0x5a2802[_0xad43('0x3a')]({'plain':!![]});if(_0x183e24){if(_0x54c564[_0xad43('0x35')][_0xad43('0x44')]){_0x54c564[_0xad43('0x3b')][_0xad43('0x45')]({'id':0x0,'priority':_0x54c564[_0xad43('0x3b')][_0xad43('0x40')]+0x1,'app':_0xad43('0x46'),'appdata':_0xad43('0x47'),'interval':_0xad43('0x48')});}_0x4f216f[_0xad43('0x49')]=!![];}else{_0x4f216f['created']=![];}_0x54c564[_0xad43('0x4a')]=_0x4f216f;return db[_0xad43('0x4b')][_0xad43('0x4c')]({'body':_0x5b5638[_0xad43('0x22')][_0xad43('0x22')],'FaxAccountId':_0x5b5638[_0xad43('0x35')]['id'],'FaxInteractionId':_0x5a2802['id'],'direction':'in','ContactId':_0x5a2802['ContactId'],'AttachmentId':_0x5b5638[_0xad43('0x22')]['AttachmentId']});})[_0xad43('0xd')](function(_0x1957de){_0x54c564[_0xad43('0x13')]=_0x1957de;if(_0x54c564[_0xad43('0x4a')][_0xad43('0x4d')]){return db[_0xad43('0x4e')][_0xad43('0x34')]({'attributes':['id','name'],'where':{'id':_0x54c564['interaction'][_0xad43('0x4d')]}})[_0xad43('0xd')](function(_0x1a0b2e){if(_0x1a0b2e){_0x54c564[_0xad43('0x3b')][_0xad43('0x4f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a0b2e[_0xad43('0x50')]+','+(_0x54c564[_0xad43('0x35')][_0xad43('0x51')]||0xa),'interval':_0xad43('0x48')});}return respondWithRpcPromise('Start',_0xad43('0x52'),_0x54c564);});}return respondWithRpcPromise(_0xad43('0x53'),_0xad43('0x52'),_0x54c564);})['then'](function(_0x4fa37c){_0x5ca71b(_0x4fa37c);})[_0xad43('0x15')](function(_0x5413c4){_0x592ade(_0x2e76c0[_0xad43('0x12')](0x1f4,_0x5413c4['message']));});});}; \ No newline at end of file +var _0x4faf=['./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','include','map','model','attributes','GetFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','FaxAccount','account','CmList','List','Contacts','updatedAt','DESC','FaxApplication','Applications','applications','list','priority','asc','FaxInteraction','find','create','Contact\x20not\x20found','spread','get','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x6b3646,_0x4dc395){var _0x8c35fa=function(_0x5d0c00){while(--_0x5d0c00){_0x6b3646['push'](_0x6b3646['shift']());}};_0x8c35fa(++_0x4dc395);}(_0x4faf,0x102));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf4fa('0x0'));var util=require(_0xf4fa('0x1'));var moment=require(_0xf4fa('0x2'));var BPromise=require(_0xf4fa('0x3'));var rs=require(_0xf4fa('0x4'));var fs=require('fs');var Redis=require(_0xf4fa('0x5'));var db=require(_0xf4fa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf4fa('0x7'));var config=require('../../config/environment');var jayson=require(_0xf4fa('0x8'));var client=jayson[_0xf4fa('0x9')][_0xf4fa('0xa')]({'port':0x232c});config[_0xf4fa('0xb')]=_[_0xf4fa('0xc')](config[_0xf4fa('0xb')],{'host':_0xf4fa('0xd'),'port':0x18eb});var socket=require(_0xf4fa('0xe'))(new Redis(config['redis']));require(_0xf4fa('0xf'))[_0xf4fa('0x10')](socket);function respondWithRpcPromise(_0xb7a92,_0x383592,_0x1edd54){return new BPromise(function(_0x3309f3,_0x3f776c){return client[_0xf4fa('0x11')](_0xb7a92,_0x1edd54)[_0xf4fa('0x12')](function(_0x50f94d){logger[_0xf4fa('0x13')](_0xf4fa('0x14'),_0x383592,_0xf4fa('0x15'));logger['debug'](_0xf4fa('0x16'),_0x383592,_0xf4fa('0x15'),JSON[_0xf4fa('0x17')](_0x50f94d));if(_0x50f94d[_0xf4fa('0x18')]){if(_0x50f94d[_0xf4fa('0x18')]['code']===0x1f4){logger[_0xf4fa('0x18')](_0xf4fa('0x14'),_0x383592,_0x50f94d[_0xf4fa('0x18')][_0xf4fa('0x19')]);return _0x3f776c(_0x50f94d[_0xf4fa('0x18')]['message']);}logger[_0xf4fa('0x18')]('FaxAccount,\x20%s,\x20%s',_0x383592,_0x50f94d[_0xf4fa('0x18')]['message']);return _0x3309f3(_0x50f94d['error'][_0xf4fa('0x19')]);}else{logger[_0xf4fa('0x13')](_0xf4fa('0x14'),_0x383592,_0xf4fa('0x15'));_0x3309f3(_0x50f94d[_0xf4fa('0x1a')][_0xf4fa('0x19')]);}})[_0xf4fa('0x1b')](function(_0x34f76b){logger[_0xf4fa('0x18')](_0xf4fa('0x14'),_0x383592,_0x34f76b);_0x3f776c(_0x34f76b);});});}exports['GetFaxAccount']=function(_0x2229e8){var _0x220e8f=this;return new Promise(function(_0x59eb56,_0x34ac45){return db['FaxAccount'][_0xf4fa('0x1c')]({'raw':_0x2229e8[_0xf4fa('0x1d')]?_0x2229e8[_0xf4fa('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2229e8[_0xf4fa('0x1d')]?_0x2229e8[_0xf4fa('0x1d')][_0xf4fa('0x1e')]||null:null,'attributes':_0x2229e8[_0xf4fa('0x1d')]?_0x2229e8[_0xf4fa('0x1d')]['attributes']||null:null,'limit':_0x2229e8[_0xf4fa('0x1d')]?_0x2229e8[_0xf4fa('0x1d')]['limit']||null:null,'include':_0x2229e8['options']?_0x2229e8[_0xf4fa('0x1d')][_0xf4fa('0x1f')]?_[_0xf4fa('0x20')](_0x2229e8[_0xf4fa('0x1d')][_0xf4fa('0x1f')],function(_0x30bd93){return{'model':db[_0x30bd93[_0xf4fa('0x21')]],'as':_0x30bd93['as'],'attributes':_0x30bd93[_0xf4fa('0x22')],'include':_0x30bd93[_0xf4fa('0x1f')]?_[_0xf4fa('0x20')](_0x30bd93['include'],function(_0xfb6266){return{'model':db[_0xfb6266[_0xf4fa('0x21')]],'as':_0xfb6266['as'],'attributes':_0xfb6266[_0xf4fa('0x22')],'include':_0xfb6266[_0xf4fa('0x1f')]?_[_0xf4fa('0x20')](_0xfb6266['include'],function(_0x315202){return{'model':db[_0x315202[_0xf4fa('0x21')]],'as':_0x315202['as'],'attributes':_0x315202[_0xf4fa('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf4fa('0x12')](function(_0x364d79){logger[_0xf4fa('0x13')](_0xf4fa('0x23'),_0x2229e8);logger['debug'](_0xf4fa('0x23'),_0x2229e8,JSON[_0xf4fa('0x17')](_0x364d79));_0x59eb56(_0x364d79);})[_0xf4fa('0x1b')](function(_0x52bdf2){logger[_0xf4fa('0x18')](_0xf4fa('0x23'),_0x52bdf2['message'],_0x2229e8);_0x34ac45(_0x220e8f['error'](0x1f4,_0x52bdf2['message']));});});};exports['NotifyFaxAccount']=function(_0x5c27d9,_0x5cc44b,_0x15a0e5){var _0x43a17b=this;return new Promise(function(_0x122ba4,_0x42633b){var _0x4dc983={'body':_0x5c27d9[_0xf4fa('0x24')],'channel':_0xf4fa('0x25')};var _0x52506f=[];var _0x5ef966=[];var _0x395088={};return db[_0xf4fa('0x26')][_0xf4fa('0x27')]()[_0xf4fa('0x12')](function(_0x21efa6){if(!_0x21efa6){throw new db[(_0xf4fa('0x28'))]['ValidationError'](_0xf4fa('0x29'));}_0x52506f=_[_0xf4fa('0x2a')](_[_0xf4fa('0x2b')](_0x21efa6),['createdAt','updatedAt']);_0x5ef966=_[_0xf4fa('0x2a')](_[_0xf4fa('0x2b')](_0x21efa6),[_0xf4fa('0x2c'),'updatedAt',_0xf4fa('0x2d'),_0xf4fa('0x2e')]);if(_0x5c27d9[_0xf4fa('0x24')]['id']){delete _0x5c27d9['body']['id'];}if(_['isNil'](_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x2f')])){throw new db[(_0xf4fa('0x28'))][(_0xf4fa('0x30'))](_0xf4fa('0x31'));}if(_[_0xf4fa('0x32')](_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x24')])||_0x5c27d9[_0xf4fa('0x24')]['body']===''){throw new db['Sequelize'][(_0xf4fa('0x30'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf4fa('0x32')](_0x5c27d9[_0xf4fa('0x24')]['mapKey'])){throw new db[(_0xf4fa('0x28'))][(_0xf4fa('0x30'))](_0xf4fa('0x33')+_0x5ef966);}if(!_[_0xf4fa('0x34')](_0x5ef966,_0x5c27d9[_0xf4fa('0x24')]['mapKey'])){throw new db[(_0xf4fa('0x28'))][(_0xf4fa('0x30'))](_0xf4fa('0x35')+_0x5ef966);}_0x395088[_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x36')]]=_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x2f')];})[_0xf4fa('0x12')](function(){return db[_0xf4fa('0x37')]['find']({'where':{'id':_0x5c27d9[_0xf4fa('0x38')]['id']},'include':[{'model':db[_0xf4fa('0x39')],'as':_0xf4fa('0x3a'),'include':[{'model':db[_0xf4fa('0x26')],'as':_0xf4fa('0x3b'),'where':_0x395088,'limit':0x1,'order':[[_0xf4fa('0x3c'),_0xf4fa('0x3d')]]}]},{'model':db[_0xf4fa('0x3e')],'as':_0xf4fa('0x3f')}]});})[_0xf4fa('0x12')](function(_0x1156e4){if(_0x1156e4&&_0x1156e4[_0xf4fa('0x3a')]){var _0x2b0c53=_0x1156e4['get']({'plain':!![]});_0x4dc983[_0xf4fa('0x38')]=_0x2b0c53;_0x4dc983[_0xf4fa('0x40')]=_0x2b0c53[_0xf4fa('0x3f')];_0x4dc983[_0xf4fa('0x41')]=_0x2b0c53['List'];_0x4dc983[_0xf4fa('0x40')]=_['orderBy'](_0x4dc983[_0xf4fa('0x40')],[_0xf4fa('0x42')],[_0xf4fa('0x43')]);if(_0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x3f')]){delete _0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x3f')];}if(_0x4dc983[_0xf4fa('0x38')]['List']&&_0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x3a')][_0xf4fa('0x3b')]['length']){return _0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x3a')][_0xf4fa('0x3b')][0x0];}var _0x4f86f0=_[_0xf4fa('0xc')](_0x5c27d9[_0xf4fa('0x24')],{'firstName':_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x2f')],'ListId':_0x2b0c53[_0xf4fa('0x2e')]});_0x4f86f0[_0x5c27d9[_0xf4fa('0x24')]['mapKey']]=_0x5c27d9['body']['from'];return db[_0xf4fa('0x26')]['create'](_0x4f86f0,{'fields':_0x52506f,'raw':!![]});}})[_0xf4fa('0x12')](function(_0x5c41fa){_0x4dc983['contact']=_0x5c41fa;if(_0x5c41fa){var _0x68cad5={'ContactId':_0x5c41fa['id'],'FaxAccountId':_0x5c27d9[_0xf4fa('0x38')]['id'],'fax':_0x5c41fa[_0xf4fa('0x25')]};return db[_0xf4fa('0x44')][_0xf4fa('0x45')]({'where':{'ContactId':_0x5c41fa['id'],'closed':![],'FaxAccountId':_0x5c27d9[_0xf4fa('0x38')]['id']}})[_0xf4fa('0x12')](function(_0x41afa9){if(_0x41afa9){return[_0x41afa9,![]];}return db[_0xf4fa('0x44')][_0xf4fa('0x46')](_0x68cad5)[_0xf4fa('0x12')](function(_0x1f2469){return[_0x1f2469,!![]];});});}else{throw new Error(_0xf4fa('0x47'));}})[_0xf4fa('0x48')](function(_0x298aaf,_0x1eb3ca){var _0x29d1bc=_0x298aaf[_0xf4fa('0x49')]({'plain':!![]});if(_0x1eb3ca){if(_0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x4a')]){_0x4dc983[_0xf4fa('0x40')]['push']({'id':0x0,'priority':_0x4dc983[_0xf4fa('0x40')]['length']+0x1,'app':_0xf4fa('0x4b'),'appdata':_0xf4fa('0x4c'),'interval':_0xf4fa('0x4d')});}_0x29d1bc[_0xf4fa('0x4e')]=!![];}else{_0x29d1bc[_0xf4fa('0x4e')]=![];}_0x4dc983[_0xf4fa('0x4f')]=_0x29d1bc;return db[_0xf4fa('0x50')][_0xf4fa('0x46')]({'body':_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x24')],'FaxAccountId':_0x5c27d9[_0xf4fa('0x38')]['id'],'FaxInteractionId':_0x298aaf['id'],'direction':'in','ContactId':_0x298aaf[_0xf4fa('0x51')],'AttachmentId':_0x5c27d9[_0xf4fa('0x24')][_0xf4fa('0x52')]});})[_0xf4fa('0x12')](function(_0x22c5f3){_0x4dc983[_0xf4fa('0x19')]=_0x22c5f3;if(_0x4dc983[_0xf4fa('0x4f')][_0xf4fa('0x53')]){return db[_0xf4fa('0x54')]['find']({'attributes':['id','name'],'where':{'id':_0x4dc983['interaction'][_0xf4fa('0x53')]}})['then'](function(_0x2b3907){if(_0x2b3907){_0x4dc983[_0xf4fa('0x40')][_0xf4fa('0x55')]({'id':0x0,'priority':0x0,'app':_0xf4fa('0x56'),'appdata':_0x2b3907[_0xf4fa('0x57')]+','+(_0x4dc983[_0xf4fa('0x38')][_0xf4fa('0x58')]||0xa),'interval':_0xf4fa('0x4d')});}return respondWithRpcPromise(_0xf4fa('0x59'),_0xf4fa('0x5a'),_0x4dc983);});}return respondWithRpcPromise(_0xf4fa('0x59'),_0xf4fa('0x5a'),_0x4dc983);})[_0xf4fa('0x12')](function(_0x36de12){_0x122ba4(_0x36de12);})['catch'](function(_0xcb4c6c){_0x42633b(_0x43a17b[_0xf4fa('0x18')](0x1f4,_0xcb4c6c[_0xf4fa('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f385ed4..ec6d110 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 _0x8536=['remove','removeListener','length','faxAccount:','./faxAccount.events','save'];(function(_0x91afd1,_0x4c291f){var _0x4e16b2=function(_0x31db8c){while(--_0x31db8c){_0x91afd1['push'](_0x91afd1['shift']());}};_0x4e16b2(++_0x4c291f);}(_0x8536,0x9a));var _0x6853=function(_0xfe763b,_0x5343a7){_0xfe763b=_0xfe763b-0x0;var _0x3ef585=_0x8536[_0xfe763b];return _0x3ef585;};'use strict';var FaxAccountEvents=require(_0x6853('0x0'));var events=[_0x6853('0x1'),_0x6853('0x2'),'update'];function createListener(_0xa62289,_0xdf4552){return function(_0x2a35e1){_0xdf4552['emit'](_0xa62289,_0x2a35e1);};}function removeListener(_0x338fc0,_0x1feb4f){return function(){FaxAccountEvents[_0x6853('0x3')](_0x338fc0,_0x1feb4f);};}exports['register']=function(_0x219fa5){for(var _0x1ef072=0x0,_0x389c2b=events[_0x6853('0x4')];_0x1ef072<_0x389c2b;_0x1ef072++){var _0x2ce075=events[_0x1ef072];var _0x217e6d=createListener(_0x6853('0x5')+_0x2ce075,_0x219fa5);FaxAccountEvents['on'](_0x2ce075,_0x217e6d);}}; \ No newline at end of file +var _0xd0a4=['emit','removeListener','length','./faxAccount.events','save','remove','update'];(function(_0xed278b,_0x40ce37){var _0x267abb=function(_0x3a9cfd){while(--_0x3a9cfd){_0xed278b['push'](_0xed278b['shift']());}};_0x267abb(++_0x40ce37);}(_0xd0a4,0x184));var _0x4d0a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd0a4[_0x2dafbe];return _0x58a45a;};'use strict';var FaxAccountEvents=require(_0x4d0a('0x0'));var events=[_0x4d0a('0x1'),_0x4d0a('0x2'),_0x4d0a('0x3')];function createListener(_0x264f24,_0x1a6e02){return function(_0x484e9d){_0x1a6e02[_0x4d0a('0x4')](_0x264f24,_0x484e9d);};}function removeListener(_0x12522a,_0x3bca88){return function(){FaxAccountEvents[_0x4d0a('0x5')](_0x12522a,_0x3bca88);};}exports['register']=function(_0x3bf6d4){for(var _0xf33497=0x0,_0x984d1c=events[_0x4d0a('0x6')];_0xf33497<_0x984d1c;_0xf33497++){var _0x215e63=events[_0xf33497];var _0x2ab058=createListener('faxAccount:'+_0x215e63,_0x3bf6d4);FaxAccountEvents['on'](_0x215e63,_0x2ab058);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2b76f48..88d23e4 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(_0x5c4d79,_0x38ea0f){var _0x3ec5dc=function(_0x289087){while(--_0x289087){_0x5c4d79['push'](_0x5c4d79['shift']());}};_0x3ec5dc(++_0x38ea0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x3bd608,_0x4983d3){var _0x538339=function(_0x3f23fd){while(--_0x3f23fd){_0x3bd608['push'](_0x3bd608['shift']());}};_0x538339(++_0x4983d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 bb46c95..95df231 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 _0x5697=['noop','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x15a169,_0x17ea57){var _0x3d0fd1=function(_0x49f46a){while(--_0x49f46a){_0x15a169['push'](_0x15a169['shift']());}};_0x3d0fd1(++_0x17ea57);}(_0x5697,0xd5));var _0x7569=function(_0x2ed88f,_0x5bc5ae){_0x2ed88f=_0x2ed88f-0x0;var _0x17ca96=_0x5697[_0x2ed88f];return _0x17ca96;};'use strict';var Sequelize=require(_0x7569('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7569('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7569('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7569('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7569('0x4')}}; \ No newline at end of file +var _0xaf24=['exports','STRING','noop','sequelize'];(function(_0x33e135,_0xc1878){var _0x4207e7=function(_0x3473d0){while(--_0x3473d0){_0x33e135['push'](_0x33e135['shift']());}};_0x4207e7(++_0xc1878);}(_0xaf24,0x1c7));var _0x4af2=function(_0x42a18d,_0x3dc47f){_0x42a18d=_0x42a18d-0x0;var _0x194be3=_0xaf24[_0x42a18d];return _0x194be3;};'use strict';var Sequelize=require(_0x4af2('0x0'));module[_0x4af2('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4af2('0x2')],'allowNull':![],'defaultValue':_0x4af2('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4af2('0x2')]},'interval':{'type':Sequelize[_0x4af2('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 97c83b0..b4e998a 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 _0x3a02=['save','update','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3a02,0x1e9));var _0x23a0=function(_0x8534a1,_0x3d1f25){_0x8534a1=_0x8534a1-0x0;var _0x1527be=_0x3a02[_0x8534a1];return _0x1527be;};'use strict';var emlformat=require(_0x23a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23a0('0x1'));var jsonpatch=require(_0x23a0('0x2'));var rp=require(_0x23a0('0x3'));var moment=require(_0x23a0('0x4'));var BPromise=require(_0x23a0('0x5'));var Mustache=require(_0x23a0('0x6'));var util=require('util');var path=require(_0x23a0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x23a0('0x8'));var fs=require('fs');var fs_extra=require(_0x23a0('0x9'));var _=require(_0x23a0('0xa'));var squel=require(_0x23a0('0xb'));var crypto=require('crypto');var jsforce=require(_0x23a0('0xc'));var deskjs=require(_0x23a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x23a0('0xe'));var Papa=require(_0x23a0('0xf'));var Redis=require(_0x23a0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x23a0('0x11'));var as=require(_0x23a0('0x12'));var hardwareService=require(_0x23a0('0x13'));var logger=require(_0x23a0('0x14'))(_0x23a0('0x15'));var utils=require(_0x23a0('0x16'));var config=require(_0x23a0('0x17'));var licenseUtil=require(_0x23a0('0x18'));var db=require(_0x23a0('0x19'))['db'];function respondWithStatusCode(_0x2433b4,_0x651772){_0x651772=_0x651772||0xcc;return function(_0x26a37e){if(_0x26a37e){return _0x2433b4[_0x23a0('0x1a')](_0x651772);}return _0x2433b4[_0x23a0('0x1b')](_0x651772)['end']();};}function respondWithResult(_0x5aae44,_0x290c02){_0x290c02=_0x290c02||0xc8;return function(_0x43411b){if(_0x43411b){return _0x5aae44['status'](_0x290c02)[_0x23a0('0x1c')](_0x43411b);}};}function respondWithFilteredResult(_0x1511f4,_0x248b01){return function(_0x244221){if(_0x244221){var _0x5c6010=typeof _0x248b01['offset']===_0x23a0('0x1d')&&typeof _0x248b01[_0x23a0('0x1e')]==='undefined';var _0x4511c8=_0x244221[_0x23a0('0x1f')];var _0x13279e=_0x5c6010?0x0:_0x248b01[_0x23a0('0x20')];var _0x37cbb0=_0x5c6010?_0x244221[_0x23a0('0x1f')]:_0x248b01[_0x23a0('0x20')]+_0x248b01['limit'];var _0x13f45d;if(_0x37cbb0>=_0x4511c8){_0x37cbb0=_0x4511c8;_0x13f45d=0xc8;}else{_0x13f45d=0xce;}_0x1511f4[_0x23a0('0x1b')](_0x13f45d);return _0x1511f4[_0x23a0('0x21')](_0x23a0('0x22'),_0x13279e+'-'+_0x37cbb0+'/'+_0x4511c8)[_0x23a0('0x1c')](_0x244221);}return null;};}function patchUpdates(_0x4c11a5){return function(_0x2a56db){try{jsonpatch[_0x23a0('0x23')](_0x2a56db,_0x4c11a5,!![]);}catch(_0x3599b7){return BPromise['reject'](_0x3599b7);}return _0x2a56db[_0x23a0('0x24')]();};}function saveUpdates(_0x736798,_0x36d717){return function(_0x354ab9){if(_0x354ab9){return _0x354ab9[_0x23a0('0x25')](_0x736798)[_0x23a0('0x26')](function(_0x36a939){return _0x36a939;});}return null;};}function removeEntity(_0x53fe73,_0x3788a0){return function(_0x4b4c66){if(_0x4b4c66){return _0x4b4c66[_0x23a0('0x27')]()['then'](function(){_0x53fe73[_0x23a0('0x1b')](0xcc)[_0x23a0('0x28')]();});}};}function handleEntityNotFound(_0x846bd4,_0x95d422){return function(_0x4c1722){if(!_0x4c1722){_0x846bd4[_0x23a0('0x1a')](0x194);}return _0x4c1722;};}function handleError(_0xca584d,_0x2a0fff){_0x2a0fff=_0x2a0fff||0x1f4;return function(_0x4b8e60){logger[_0x23a0('0x29')](_0x4b8e60[_0x23a0('0x2a')]);if(_0x4b8e60[_0x23a0('0x2b')]){delete _0x4b8e60['name'];}_0xca584d[_0x23a0('0x1b')](_0x2a0fff)[_0x23a0('0x2c')](_0x4b8e60);};}exports[_0x23a0('0x2d')]=function(_0x1b23d3,_0x6aa985){var _0x4965c6={},_0x45b6d4={},_0x5a3df0={'count':0x0,'rows':[]};var _0x3815a3=_[_0x23a0('0x2e')](db[_0x23a0('0x2f')][_0x23a0('0x30')],function(_0x22ea00){return{'name':_0x22ea00['fieldName'],'type':_0x22ea00['type'][_0x23a0('0x31')]};});_0x45b6d4['model']=_[_0x23a0('0x2e')](_0x3815a3,_0x23a0('0x2b'));_0x45b6d4['query']=_[_0x23a0('0x32')](_0x1b23d3[_0x23a0('0x33')]);_0x45b6d4[_0x23a0('0x34')]=_[_0x23a0('0x35')](_0x45b6d4[_0x23a0('0x36')],_0x45b6d4[_0x23a0('0x33')]);_0x4965c6[_0x23a0('0x37')]=_[_0x23a0('0x35')](_0x45b6d4[_0x23a0('0x36')],qs[_0x23a0('0x38')](_0x1b23d3[_0x23a0('0x33')]['fields']));_0x4965c6[_0x23a0('0x37')]=_0x4965c6[_0x23a0('0x37')][_0x23a0('0x39')]?_0x4965c6['attributes']:_0x45b6d4[_0x23a0('0x36')];if(!_0x1b23d3['query'][_0x23a0('0x3a')]('nolimit')){_0x4965c6[_0x23a0('0x1e')]=qs[_0x23a0('0x1e')](_0x1b23d3[_0x23a0('0x33')][_0x23a0('0x1e')]);_0x4965c6[_0x23a0('0x20')]=qs['offset'](_0x1b23d3['query'][_0x23a0('0x20')]);}_0x4965c6['order']=qs[_0x23a0('0x3b')](_0x1b23d3[_0x23a0('0x33')]['sort']);_0x4965c6[_0x23a0('0x3c')]=qs[_0x23a0('0x34')](_['pick'](_0x1b23d3[_0x23a0('0x33')],_0x45b6d4['filters']),_0x3815a3);if(_0x1b23d3['query']['filter']){_0x4965c6[_0x23a0('0x3c')]=_[_0x23a0('0x3d')](_0x4965c6[_0x23a0('0x3c')],{'$or':_['map'](_0x3815a3,function(_0x4d3fc7){if(_0x4d3fc7[_0x23a0('0x3e')]!==_0x23a0('0x3f')){var _0x9d412f={};_0x9d412f[_0x4d3fc7[_0x23a0('0x2b')]]={'$like':'%'+_0x1b23d3[_0x23a0('0x33')][_0x23a0('0x40')]+'%'};return _0x9d412f;}})});}_0x4965c6=_['merge']({},_0x4965c6,_0x1b23d3[_0x23a0('0x41')]);var _0x283eb9={'where':_0x4965c6[_0x23a0('0x3c')]};return db[_0x23a0('0x2f')][_0x23a0('0x1f')](_0x283eb9)[_0x23a0('0x26')](function(_0xa4b1c){_0x5a3df0[_0x23a0('0x1f')]=_0xa4b1c;if(_0x1b23d3[_0x23a0('0x33')][_0x23a0('0x42')]){_0x4965c6['include']=[{'all':!![]}];}return db[_0x23a0('0x2f')][_0x23a0('0x43')](_0x4965c6);})[_0x23a0('0x26')](function(_0x41a1eb){_0x5a3df0[_0x23a0('0x44')]=_0x41a1eb;return _0x5a3df0;})['then'](respondWithFilteredResult(_0x6aa985,_0x4965c6))[_0x23a0('0x45')](handleError(_0x6aa985,null));};exports['show']=function(_0x1460c3,_0x482f93){var _0x23f29c={'raw':!![],'where':{'id':_0x1460c3[_0x23a0('0x46')]['id']}},_0x546f4f={};_0x546f4f[_0x23a0('0x36')]=_[_0x23a0('0x32')](db[_0x23a0('0x2f')][_0x23a0('0x30')]);_0x546f4f[_0x23a0('0x33')]=_[_0x23a0('0x32')](_0x1460c3[_0x23a0('0x33')]);_0x546f4f['filters']=_[_0x23a0('0x35')](_0x546f4f['model'],_0x546f4f['query']);_0x23f29c['attributes']=_[_0x23a0('0x35')](_0x546f4f[_0x23a0('0x36')],qs[_0x23a0('0x38')](_0x1460c3[_0x23a0('0x33')][_0x23a0('0x38')]));_0x23f29c[_0x23a0('0x37')]=_0x23f29c[_0x23a0('0x37')]['length']?_0x23f29c[_0x23a0('0x37')]:_0x546f4f[_0x23a0('0x36')];if(_0x1460c3[_0x23a0('0x33')][_0x23a0('0x42')]){_0x23f29c[_0x23a0('0x47')]=[{'all':!![]}];}_0x23f29c=_[_0x23a0('0x3d')]({},_0x23f29c,_0x1460c3[_0x23a0('0x41')]);return db[_0x23a0('0x2f')][_0x23a0('0x48')](_0x23f29c)[_0x23a0('0x26')](handleEntityNotFound(_0x482f93,null))[_0x23a0('0x26')](respondWithResult(_0x482f93,null))[_0x23a0('0x45')](handleError(_0x482f93,null));};exports[_0x23a0('0x49')]=function(_0x2dfaa0,_0x2be02e){return db['FaxApplication'][_0x23a0('0x49')](_0x2dfaa0['body'],{})[_0x23a0('0x26')](respondWithResult(_0x2be02e,0xc9))['catch'](handleError(_0x2be02e,null));};exports['update']=function(_0x2dd4ed,_0xb91a08){if(_0x2dd4ed[_0x23a0('0x4a')]['id']){delete _0x2dd4ed[_0x23a0('0x4a')]['id'];}return db[_0x23a0('0x2f')]['find']({'where':{'id':_0x2dd4ed[_0x23a0('0x46')]['id']}})[_0x23a0('0x26')](handleEntityNotFound(_0xb91a08,null))[_0x23a0('0x26')](saveUpdates(_0x2dd4ed[_0x23a0('0x4a')],null))['then'](respondWithResult(_0xb91a08,null))[_0x23a0('0x45')](handleError(_0xb91a08,null));};exports[_0x23a0('0x27')]=function(_0x11d321,_0x44753a){return db['FaxApplication'][_0x23a0('0x48')]({'where':{'id':_0x11d321[_0x23a0('0x46')]['id']}})[_0x23a0('0x26')](handleEntityNotFound(_0x44753a,null))[_0x23a0('0x26')](removeEntity(_0x44753a,null))['catch'](handleError(_0x44753a,null));}; \ No newline at end of file +var _0x7e22=['save','update','then','destroy','end','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7e22,0x1eb));var _0x27e2=function(_0x230f91,_0x255b31){_0x230f91=_0x230f91-0x0;var _0x47c1dd=_0x7e22[_0x230f91];return _0x47c1dd;};'use strict';var emlformat=require(_0x27e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27e2('0x1'));var jsonpatch=require(_0x27e2('0x2'));var rp=require('request-promise');var moment=require(_0x27e2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27e2('0x4'));var util=require(_0x27e2('0x5'));var path=require('path');var sox=require(_0x27e2('0x6'));var csv=require(_0x27e2('0x7'));var ejs=require(_0x27e2('0x8'));var fs=require('fs');var fs_extra=require(_0x27e2('0x9'));var _=require(_0x27e2('0xa'));var squel=require(_0x27e2('0xb'));var crypto=require(_0x27e2('0xc'));var jsforce=require(_0x27e2('0xd'));var deskjs=require(_0x27e2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x27e2('0xf'));var Papa=require(_0x27e2('0x10'));var Redis=require(_0x27e2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x27e2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27e2('0x13'))(_0x27e2('0x14'));var utils=require('../../config/utils');var config=require(_0x27e2('0x15'));var licenseUtil=require(_0x27e2('0x16'));var db=require(_0x27e2('0x17'))['db'];function respondWithStatusCode(_0x2385aa,_0x34d31f){_0x34d31f=_0x34d31f||0xcc;return function(_0xd67841){if(_0xd67841){return _0x2385aa['sendStatus'](_0x34d31f);}return _0x2385aa[_0x27e2('0x18')](_0x34d31f)['end']();};}function respondWithResult(_0xa41f5d,_0xa1ca62){_0xa1ca62=_0xa1ca62||0xc8;return function(_0x31f2d6){if(_0x31f2d6){return _0xa41f5d[_0x27e2('0x18')](_0xa1ca62)[_0x27e2('0x19')](_0x31f2d6);}};}function respondWithFilteredResult(_0x3f4bfe,_0x143e94){return function(_0x5da02a){if(_0x5da02a){var _0x57ee24=typeof _0x143e94[_0x27e2('0x1a')]===_0x27e2('0x1b')&&typeof _0x143e94[_0x27e2('0x1c')]===_0x27e2('0x1b');var _0x4e1180=_0x5da02a[_0x27e2('0x1d')];var _0x9706c9=_0x57ee24?0x0:_0x143e94[_0x27e2('0x1a')];var _0xa227f8=_0x57ee24?_0x5da02a[_0x27e2('0x1d')]:_0x143e94[_0x27e2('0x1a')]+_0x143e94[_0x27e2('0x1c')];var _0x5cad59;if(_0xa227f8>=_0x4e1180){_0xa227f8=_0x4e1180;_0x5cad59=0xc8;}else{_0x5cad59=0xce;}_0x3f4bfe[_0x27e2('0x18')](_0x5cad59);return _0x3f4bfe[_0x27e2('0x1e')](_0x27e2('0x1f'),_0x9706c9+'-'+_0xa227f8+'/'+_0x4e1180)['json'](_0x5da02a);}return null;};}function patchUpdates(_0x134013){return function(_0x53aa60){try{jsonpatch[_0x27e2('0x20')](_0x53aa60,_0x134013,!![]);}catch(_0x49d299){return BPromise[_0x27e2('0x21')](_0x49d299);}return _0x53aa60[_0x27e2('0x22')]();};}function saveUpdates(_0x514c6d,_0x1de2dd){return function(_0x15a216){if(_0x15a216){return _0x15a216[_0x27e2('0x23')](_0x514c6d)[_0x27e2('0x24')](function(_0x5e7794){return _0x5e7794;});}return null;};}function removeEntity(_0x1fe4c7,_0x2d6c42){return function(_0xc76699){if(_0xc76699){return _0xc76699[_0x27e2('0x25')]()[_0x27e2('0x24')](function(){_0x1fe4c7['status'](0xcc)[_0x27e2('0x26')]();});}};}function handleEntityNotFound(_0x393aa7,_0x23d0fe){return function(_0x13fb4e){if(!_0x13fb4e){_0x393aa7['sendStatus'](0x194);}return _0x13fb4e;};}function handleError(_0x43beb2,_0x18aa43){_0x18aa43=_0x18aa43||0x1f4;return function(_0x328811){logger['error'](_0x328811[_0x27e2('0x27')]);if(_0x328811[_0x27e2('0x28')]){delete _0x328811[_0x27e2('0x28')];}_0x43beb2[_0x27e2('0x18')](_0x18aa43)[_0x27e2('0x29')](_0x328811);};}exports[_0x27e2('0x2a')]=function(_0x5be45a,_0xb23912){var _0x553247={},_0x24171a={},_0x1e2c8d={'count':0x0,'rows':[]};var _0x2928ba=_[_0x27e2('0x2b')](db[_0x27e2('0x2c')][_0x27e2('0x2d')],function(_0x5d378f){return{'name':_0x5d378f[_0x27e2('0x2e')],'type':_0x5d378f['type'][_0x27e2('0x2f')]};});_0x24171a[_0x27e2('0x30')]=_['map'](_0x2928ba,'name');_0x24171a[_0x27e2('0x31')]=_[_0x27e2('0x32')](_0x5be45a[_0x27e2('0x31')]);_0x24171a['filters']=_['intersection'](_0x24171a[_0x27e2('0x30')],_0x24171a[_0x27e2('0x31')]);_0x553247['attributes']=_[_0x27e2('0x33')](_0x24171a['model'],qs[_0x27e2('0x34')](_0x5be45a[_0x27e2('0x31')][_0x27e2('0x34')]));_0x553247[_0x27e2('0x35')]=_0x553247[_0x27e2('0x35')][_0x27e2('0x36')]?_0x553247[_0x27e2('0x35')]:_0x24171a[_0x27e2('0x30')];if(!_0x5be45a[_0x27e2('0x31')][_0x27e2('0x37')](_0x27e2('0x38'))){_0x553247[_0x27e2('0x1c')]=qs[_0x27e2('0x1c')](_0x5be45a[_0x27e2('0x31')][_0x27e2('0x1c')]);_0x553247['offset']=qs[_0x27e2('0x1a')](_0x5be45a['query'][_0x27e2('0x1a')]);}_0x553247[_0x27e2('0x39')]=qs[_0x27e2('0x3a')](_0x5be45a[_0x27e2('0x31')][_0x27e2('0x3a')]);_0x553247[_0x27e2('0x3b')]=qs[_0x27e2('0x3c')](_[_0x27e2('0x3d')](_0x5be45a[_0x27e2('0x31')],_0x24171a[_0x27e2('0x3c')]),_0x2928ba);if(_0x5be45a['query']['filter']){_0x553247[_0x27e2('0x3b')]=_[_0x27e2('0x3e')](_0x553247[_0x27e2('0x3b')],{'$or':_[_0x27e2('0x2b')](_0x2928ba,function(_0x590233){if(_0x590233['type']!=='VIRTUAL'){var _0x5ad0e1={};_0x5ad0e1[_0x590233['name']]={'$like':'%'+_0x5be45a[_0x27e2('0x31')][_0x27e2('0x3f')]+'%'};return _0x5ad0e1;}})});}_0x553247=_[_0x27e2('0x3e')]({},_0x553247,_0x5be45a[_0x27e2('0x40')]);var _0x382c13={'where':_0x553247[_0x27e2('0x3b')]};return db['FaxApplication'][_0x27e2('0x1d')](_0x382c13)[_0x27e2('0x24')](function(_0x5ef183){_0x1e2c8d[_0x27e2('0x1d')]=_0x5ef183;if(_0x5be45a[_0x27e2('0x31')][_0x27e2('0x41')]){_0x553247[_0x27e2('0x42')]=[{'all':!![]}];}return db[_0x27e2('0x2c')][_0x27e2('0x43')](_0x553247);})[_0x27e2('0x24')](function(_0x3d936c){_0x1e2c8d[_0x27e2('0x44')]=_0x3d936c;return _0x1e2c8d;})[_0x27e2('0x24')](respondWithFilteredResult(_0xb23912,_0x553247))[_0x27e2('0x45')](handleError(_0xb23912,null));};exports[_0x27e2('0x46')]=function(_0x6e514a,_0x55ef85){var _0x67e475={'raw':!![],'where':{'id':_0x6e514a[_0x27e2('0x47')]['id']}},_0xed2855={};_0xed2855[_0x27e2('0x30')]=_[_0x27e2('0x32')](db[_0x27e2('0x2c')][_0x27e2('0x2d')]);_0xed2855['query']=_[_0x27e2('0x32')](_0x6e514a['query']);_0xed2855[_0x27e2('0x3c')]=_[_0x27e2('0x33')](_0xed2855['model'],_0xed2855['query']);_0x67e475[_0x27e2('0x35')]=_[_0x27e2('0x33')](_0xed2855[_0x27e2('0x30')],qs[_0x27e2('0x34')](_0x6e514a[_0x27e2('0x31')][_0x27e2('0x34')]));_0x67e475[_0x27e2('0x35')]=_0x67e475['attributes'][_0x27e2('0x36')]?_0x67e475['attributes']:_0xed2855['model'];if(_0x6e514a['query'][_0x27e2('0x41')]){_0x67e475[_0x27e2('0x42')]=[{'all':!![]}];}_0x67e475=_[_0x27e2('0x3e')]({},_0x67e475,_0x6e514a[_0x27e2('0x40')]);return db[_0x27e2('0x2c')][_0x27e2('0x48')](_0x67e475)[_0x27e2('0x24')](handleEntityNotFound(_0x55ef85,null))[_0x27e2('0x24')](respondWithResult(_0x55ef85,null))['catch'](handleError(_0x55ef85,null));};exports[_0x27e2('0x49')]=function(_0x46b1ac,_0x27bdde){return db[_0x27e2('0x2c')][_0x27e2('0x49')](_0x46b1ac['body'],{})['then'](respondWithResult(_0x27bdde,0xc9))[_0x27e2('0x45')](handleError(_0x27bdde,null));};exports['update']=function(_0x38f68f,_0x468451){if(_0x38f68f['body']['id']){delete _0x38f68f[_0x27e2('0x4a')]['id'];}return db[_0x27e2('0x2c')][_0x27e2('0x48')]({'where':{'id':_0x38f68f[_0x27e2('0x47')]['id']}})[_0x27e2('0x24')](handleEntityNotFound(_0x468451,null))[_0x27e2('0x24')](saveUpdates(_0x38f68f[_0x27e2('0x4a')],null))[_0x27e2('0x24')](respondWithResult(_0x468451,null))[_0x27e2('0x45')](handleError(_0x468451,null));};exports[_0x27e2('0x25')]=function(_0x2425ac,_0x3e7eb2){return db[_0x27e2('0x2c')]['find']({'where':{'id':_0x2425ac[_0x27e2('0x47')]['id']}})[_0x27e2('0x24')](handleEntityNotFound(_0x3e7eb2,null))[_0x27e2('0x24')](removeEntity(_0x3e7eb2,null))[_0x27e2('0x45')](handleError(_0x3e7eb2,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 5eb2d5c..097b37e 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 _0x008e=['../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf'];(function(_0x537b97,_0x3f5cc8){var _0x8d8eb9=function(_0x135f41){while(--_0x135f41){_0x537b97['push'](_0x537b97['shift']());}};_0x8d8eb9(++_0x3f5cc8);}(_0x008e,0x89));var _0xe008=function(_0x178296,_0x3e53e6){_0x178296=_0x178296-0x0;var _0x1e6fb9=_0x008e[_0x178296];return _0x1e6fb9;};'use strict';var _=require(_0xe008('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe008('0x1'));var moment=require(_0xe008('0x2'));var BPromise=require('bluebird');var rp=require(_0xe008('0x3'));var fs=require('fs');var path=require(_0xe008('0x4'));var rimraf=require(_0xe008('0x5'));var config=require(_0xe008('0x6'));var attributes=require(_0xe008('0x7'));module[_0xe008('0x8')]=function(_0x46a9ff,_0x53f164){return _0x46a9ff[_0xe008('0x9')]('FaxApplication',attributes,{'tableName':_0xe008('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe008('0xb'),'collate':_0xe008('0xc')});}; \ No newline at end of file +var _0x76fd=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x395dbd,_0x5affb3){var _0x52d9f6=function(_0x4abd92){while(--_0x4abd92){_0x395dbd['push'](_0x395dbd['shift']());}};_0x52d9f6(++_0x5affb3);}(_0x76fd,0x167));var _0xd76f=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x76fd[_0x282f9a];return _0x52528c;};'use strict';var _=require(_0xd76f('0x0'));var util=require(_0xd76f('0x1'));var logger=require(_0xd76f('0x2'))(_0xd76f('0x3'));var moment=require(_0xd76f('0x4'));var BPromise=require(_0xd76f('0x5'));var rp=require(_0xd76f('0x6'));var fs=require('fs');var path=require(_0xd76f('0x7'));var rimraf=require(_0xd76f('0x8'));var config=require('../../config/environment');var attributes=require(_0xd76f('0x9'));module['exports']=function(_0x74c176,_0x13ebbd){return _0x74c176[_0xd76f('0xa')](_0xd76f('0xb'),attributes,{'tableName':_0xd76f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd76f('0xd'),'collate':_0xd76f('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9dc0a8e..e4145b9 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 _0x649b=['client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','update','body','options','raw','where','limit','stringify','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x37fd3f,_0x44d01e){var _0x4c9572=function(_0x5f0685){while(--_0x5f0685){_0x37fd3f['push'](_0x37fd3f['shift']());}};_0x4c9572(++_0x44d01e);}(_0x649b,0x166));var _0xb649=function(_0x1330de,_0x42e856){_0x1330de=_0x1330de-0x0;var _0x4f5772=_0x649b[_0x1330de];return _0x4f5772;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb649('0x0'));var BPromise=require(_0xb649('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb649('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb649('0x3'))(_0xb649('0x4'));var config=require(_0xb649('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb649('0x6')][_0xb649('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x407bdb,_0x5c0b1c,_0x539d84){return new BPromise(function(_0x4227a6,_0x4c5c97){return client[_0xb649('0x8')](_0x407bdb,_0x539d84)[_0xb649('0x9')](function(_0x2d4886){logger[_0xb649('0xa')]('FaxApplication,\x20%s,\x20%s',_0x5c0b1c,_0xb649('0xb'));logger[_0xb649('0xc')](_0xb649('0xd'),_0x5c0b1c,_0xb649('0xb'),JSON['stringify'](_0x2d4886));if(_0x2d4886[_0xb649('0xe')]){if(_0x2d4886['error']['code']===0x1f4){logger['error'](_0xb649('0xf'),_0x5c0b1c,_0x2d4886[_0xb649('0xe')][_0xb649('0x10')]);return _0x4c5c97(_0x2d4886[_0xb649('0xe')]['message']);}logger[_0xb649('0xe')](_0xb649('0xf'),_0x5c0b1c,_0x2d4886[_0xb649('0xe')]['message']);return _0x4227a6(_0x2d4886[_0xb649('0xe')][_0xb649('0x10')]);}else{logger[_0xb649('0xa')](_0xb649('0xf'),_0x5c0b1c,_0xb649('0xb'));_0x4227a6(_0x2d4886['result'][_0xb649('0x10')]);}})[_0xb649('0x11')](function(_0x11e3c9){logger['error'](_0xb649('0xf'),_0x5c0b1c,_0x11e3c9);_0x4c5c97(_0x11e3c9);});});}exports[_0xb649('0x12')]=function(_0x4273c1){var _0x369e36=this;return new Promise(function(_0x1ee580,_0x51a56c){return db['FaxApplication'][_0xb649('0x13')](_0x4273c1[_0xb649('0x14')],{'raw':_0x4273c1[_0xb649('0x15')]?_0x4273c1[_0xb649('0x15')][_0xb649('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4273c1[_0xb649('0x15')]?_0x4273c1[_0xb649('0x15')][_0xb649('0x17')]||null:null,'attributes':_0x4273c1[_0xb649('0x15')]?_0x4273c1[_0xb649('0x15')]['attributes']||null:null,'limit':_0x4273c1['options']?_0x4273c1[_0xb649('0x15')][_0xb649('0x18')]||null:null})[_0xb649('0x9')](function(_0x246dfb){logger['info'](_0xb649('0x12'),_0x4273c1);logger[_0xb649('0xc')]('UpdateFaxApplication',_0x4273c1,JSON[_0xb649('0x19')](_0x246dfb));_0x1ee580(_0x246dfb);})[_0xb649('0x11')](function(_0x457bc6){logger[_0xb649('0xe')]('UpdateFaxApplication',_0x457bc6[_0xb649('0x10')],_0x4273c1);_0x51a56c(_0x369e36['error'](0x1f4,_0x457bc6['message']));});});}; \ No newline at end of file +var _0x0c3e=['then','catch','moment','randomstring','client','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxApplication','body','options','raw','where','attributes','limit'];(function(_0x478ac3,_0x277ee2){var _0x579c61=function(_0x590ce1){while(--_0x590ce1){_0x478ac3['push'](_0x478ac3['shift']());}};_0x579c61(++_0x277ee2);}(_0x0c3e,0x152));var _0xe0c3=function(_0x368a07,_0x1c73b9){_0x368a07=_0x368a07-0x0;var _0x15af57=_0x0c3e[_0x368a07];return _0x15af57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe0c3('0x0'));var BPromise=require('bluebird');var rs=require(_0xe0c3('0x1'));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('jayson/promise');var client=jayson[_0xe0c3('0x2')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9bab,_0x211b3e,_0x43fce3){return new BPromise(function(_0x9b04d8,_0x5c1c51){return client['request'](_0x1a9bab,_0x43fce3)['then'](function(_0x458d94){logger[_0xe0c3('0x3')](_0xe0c3('0x4'),_0x211b3e,'request\x20sent');logger[_0xe0c3('0x5')](_0xe0c3('0x6'),_0x211b3e,_0xe0c3('0x7'),JSON[_0xe0c3('0x8')](_0x458d94));if(_0x458d94['error']){if(_0x458d94[_0xe0c3('0x9')]['code']===0x1f4){logger[_0xe0c3('0x9')](_0xe0c3('0x4'),_0x211b3e,_0x458d94[_0xe0c3('0x9')][_0xe0c3('0xa')]);return _0x5c1c51(_0x458d94[_0xe0c3('0x9')][_0xe0c3('0xa')]);}logger['error'](_0xe0c3('0x4'),_0x211b3e,_0x458d94[_0xe0c3('0x9')][_0xe0c3('0xa')]);return _0x9b04d8(_0x458d94[_0xe0c3('0x9')][_0xe0c3('0xa')]);}else{logger['info'](_0xe0c3('0x4'),_0x211b3e,_0xe0c3('0x7'));_0x9b04d8(_0x458d94[_0xe0c3('0xb')][_0xe0c3('0xa')]);}})['catch'](function(_0x21d0bb){logger['error'](_0xe0c3('0x4'),_0x211b3e,_0x21d0bb);_0x5c1c51(_0x21d0bb);});});}exports[_0xe0c3('0xc')]=function(_0x37b318){var _0x539767=this;return new Promise(function(_0x4d87fe,_0x418e1f){return db['FaxApplication']['update'](_0x37b318[_0xe0c3('0xd')],{'raw':_0x37b318[_0xe0c3('0xe')]?_0x37b318[_0xe0c3('0xe')][_0xe0c3('0xf')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37b318[_0xe0c3('0xe')]?_0x37b318[_0xe0c3('0xe')][_0xe0c3('0x10')]||null:null,'attributes':_0x37b318[_0xe0c3('0xe')]?_0x37b318['options'][_0xe0c3('0x11')]||null:null,'limit':_0x37b318[_0xe0c3('0xe')]?_0x37b318['options'][_0xe0c3('0x12')]||null:null})[_0xe0c3('0x13')](function(_0x1d82d6){logger['info']('UpdateFaxApplication',_0x37b318);logger[_0xe0c3('0x5')](_0xe0c3('0xc'),_0x37b318,JSON['stringify'](_0x1d82d6));_0x4d87fe(_0x1d82d6);})[_0xe0c3('0x14')](function(_0x1c45b9){logger[_0xe0c3('0x9')](_0xe0c3('0xc'),_0x1c45b9[_0xe0c3('0xa')],_0x37b318);_0x418e1f(_0x539767['error'](0x1f4,_0x1c45b9[_0xe0c3('0xa')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 7526efb..19e896a 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 _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x461517,_0xf9097d){var _0x59ae52=function(_0x2be07f){while(--_0x2be07f){_0x461517['push'](_0x461517['shift']());}};_0x59ae52(++_0xf9097d);}(_0xb62e,0x1de));var _0xeb62=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb62e[_0x501510];return _0x1e6ee5;};'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')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file +var _0x13f6=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','post','create','put','update'];(function(_0x193a67,_0x56658a){var _0x52ff13=function(_0x4c5942){while(--_0x4c5942){_0x193a67['push'](_0x193a67['shift']());}};_0x52ff13(++_0x56658a);}(_0x13f6,0x124));var _0x613f=function(_0x3ca75e,_0x3c827e){_0x3ca75e=_0x3ca75e-0x0;var _0x3ca1d1=_0x13f6[_0x3ca75e];return _0x3ca1d1;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x613f('0xa')]('/',auth[_0x613f('0x8')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xd')]);router[_0x613f('0xe')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);module[_0x613f('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 22d708f..27e51c6 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 _0xfaf6=['out','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xfaf6,0x175));var _0x6faf=function(_0x53623e,_0x4f234a){_0x53623e=_0x53623e-0x0;var _0x3499c8=_0xfaf6[_0x53623e];return _0x3499c8;};'use strict';var Sequelize=require('sequelize');module[_0x6faf('0x0')]={'closed':{'type':Sequelize[_0x6faf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6faf('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6faf('0x2')]},'note':{'type':Sequelize[_0x6faf('0x2')]},'read1stAt':{'type':Sequelize[_0x6faf('0x3')]},'fax':{'type':Sequelize[_0x6faf('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6faf('0x4')]('in',_0x6faf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6faf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6faf('0x4')]('in',_0x6faf('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xec2f=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x5d08f7,_0x4c1f9d){var _0x4edfde=function(_0x24a5eb){while(--_0x24a5eb){_0x5d08f7['push'](_0x5d08f7['shift']());}};_0x4edfde(++_0x4c1f9d);}(_0xec2f,0x75));var _0xfec2=function(_0x3e4f00,_0x2c3955){_0x3e4f00=_0x3e4f00-0x0;var _0x54472c=_0xec2f[_0x3e4f00];return _0x54472c;};'use strict';var Sequelize=require(_0xfec2('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfec2('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfec2('0x2')]},'disposition':{'type':Sequelize[_0xfec2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfec2('0x3')]},'note':{'type':Sequelize[_0xfec2('0x3')]},'read1stAt':{'type':Sequelize[_0xfec2('0x2')]},'fax':{'type':Sequelize[_0xfec2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfec2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfec2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfec2('0x4')]('in',_0xfec2('0x5')),'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 b543c6d..02b6084 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 _0x9297=['closed','UserId','unmanaged','index','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','length','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','some','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','intersection','includeAll','include','options','create','update','describe','addMessage','FaxMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','total'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9297,0x179));var _0x7929=function(_0x40b453,_0x2f929d){_0x40b453=_0x40b453-0x0;var _0x5c26dd=_0x9297[_0x40b453];return _0x5c26dd;};'use strict';var emlformat=require(_0x7929('0x0'));var rimraf=require(_0x7929('0x1'));var zipdir=require(_0x7929('0x2'));var jsonpatch=require(_0x7929('0x3'));var rp=require(_0x7929('0x4'));var moment=require(_0x7929('0x5'));var BPromise=require(_0x7929('0x6'));var Mustache=require('mustache');var util=require(_0x7929('0x7'));var path=require('path');var sox=require(_0x7929('0x8'));var csv=require(_0x7929('0x9'));var ejs=require(_0x7929('0xa'));var fs=require('fs');var fs_extra=require(_0x7929('0xb'));var _=require(_0x7929('0xc'));var squel=require(_0x7929('0xd'));var crypto=require(_0x7929('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7929('0xf'));var toCsv=require(_0x7929('0x9'));var querystring=require(_0x7929('0x10'));var Papa=require(_0x7929('0x11'));var Redis=require('ioredis');var authService=require(_0x7929('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7929('0x13'));var hardwareService=require(_0x7929('0x14'));var logger=require('../../config/logger')(_0x7929('0x15'));var utils=require(_0x7929('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7929('0x17'));var db=require('../../mysqldb')['db'];config[_0x7929('0x18')]=_[_0x7929('0x19')](config[_0x7929('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x7929('0x1a'))(new Redis(config[_0x7929('0x18')]));require(_0x7929('0x1b'))[_0x7929('0x1c')](socket);function respondWithStatusCode(_0x19f686,_0x364689){_0x364689=_0x364689||0xcc;return function(_0x4629a2){if(_0x4629a2){return _0x19f686[_0x7929('0x1d')](_0x364689);}return _0x19f686[_0x7929('0x1e')](_0x364689)[_0x7929('0x1f')]();};}function respondWithResult(_0x1e315c,_0x12c8cf){_0x12c8cf=_0x12c8cf||0xc8;return function(_0x1cbecd){if(_0x1cbecd){return _0x1e315c[_0x7929('0x1e')](_0x12c8cf)[_0x7929('0x20')](_0x1cbecd);}};}function respondWithFilteredResult(_0x55f299,_0x48e81b){return function(_0x1d2488){if(_0x1d2488){var _0x551933=typeof _0x48e81b[_0x7929('0x21')]===_0x7929('0x22')&&typeof _0x48e81b[_0x7929('0x23')]===_0x7929('0x22');var _0x51dba9=_0x1d2488[_0x7929('0x24')];var _0x3625dd=_0x551933?0x0:_0x48e81b[_0x7929('0x21')];var _0x52108d=_0x551933?_0x1d2488[_0x7929('0x24')]:_0x48e81b['offset']+_0x48e81b[_0x7929('0x23')];var _0x1dd07f;if(_0x52108d>=_0x51dba9){_0x52108d=_0x51dba9;_0x1dd07f=0xc8;}else{_0x1dd07f=0xce;}_0x55f299[_0x7929('0x1e')](_0x1dd07f);return _0x55f299[_0x7929('0x25')](_0x7929('0x26'),_0x3625dd+'-'+_0x52108d+'/'+_0x51dba9)[_0x7929('0x20')](_0x1d2488);}return null;};}function patchUpdates(_0x5b5197){return function(_0x532281){try{jsonpatch[_0x7929('0x27')](_0x532281,_0x5b5197,!![]);}catch(_0xc43416){return BPromise[_0x7929('0x28')](_0xc43416);}return _0x532281[_0x7929('0x29')]();};}function saveUpdates(_0x459e11,_0x220f50){return function(_0x4609ce){if(_0x4609ce){return _0x4609ce['update'](_0x459e11)['then'](function(_0x4ec97e){return _0x4ec97e;});}return null;};}function removeEntity(_0x53ea1a,_0x2cf7a7){return function(_0x49a686){if(_0x49a686){return _0x49a686[_0x7929('0x2a')]()[_0x7929('0x2b')](function(){_0x53ea1a[_0x7929('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35d810,_0x55b0b6){return function(_0x45f0fe){if(!_0x45f0fe){_0x35d810[_0x7929('0x1d')](0x194);}return _0x45f0fe;};}function handleError(_0x2b9b42,_0x2978cd){_0x2978cd=_0x2978cd||0x1f4;return function(_0x30c09f){logger[_0x7929('0x2c')](_0x30c09f['stack']);if(_0x30c09f[_0x7929('0x2d')]){delete _0x30c09f[_0x7929('0x2d')];}_0x2b9b42[_0x7929('0x1e')](_0x2978cd)[_0x7929('0x2e')](_0x30c09f);};}function getInteractionUsers(_0x4ce189,_0x1a8c62){return new BPromise(function(_0x454fe1,_0x4c6e3f){try{if(_0x1a8c62[_0x4ce189['id']]){_0x4ce189['Users']=_[_0x7929('0x2f')](_0x1a8c62[_0x4ce189['id']],function(_0x543aa4){return{'id':_0x543aa4['id'],'fullname':_0x543aa4[_0x7929('0x30')]};});}}catch(_0x4ecc56){_0x4c6e3f(_0x4ecc56);}_0x454fe1(_0x4ce189);});}function getInteractionTags(_0x3a818d,_0x33f07f){return new BPromise(function(_0x2ae7bc,_0x405fb5){try{if(_0x3a818d[_0x7929('0x31')]){_0x3a818d[_0x7929('0x32')]=[];_0x3a818d[_0x7929('0x31')][_0x7929('0x33')](',')[_0x7929('0x34')](function(_0x369d44){_0x3a818d[_0x7929('0x32')][_0x7929('0x35')](_0x33f07f[_0x369d44]);});}delete _0x3a818d[_0x7929('0x31')];}catch(_0x443e02){_0x405fb5(_0x443e02);}_0x2ae7bc(_0x3a818d);});}function updateFaxInteraction(_0x327db2,_0x582278,_0x40c30e){return new BPromise(function(_0x39f10c,_0x514f85){return getInteractionUsers(_0x327db2,_0x40c30e)[_0x7929('0x2b')](function(_0x111032){return getInteractionTags(_0x111032,_0x582278);})[_0x7929('0x2b')](function(_0x15466a){return getStateInteraction(_0x15466a);})[_0x7929('0x2b')](function(_0x443638){_0x39f10c(_0x443638);})[_0x7929('0x36')](function(_0x101413){_0x514f85(_0x101413);});});}function getStateInteraction(_0xcc35ee){return new BPromise(function(_0x283698){_0xcc35ee[_0x7929('0x37')]=0x0;_0xcc35ee[_0x7929('0x38')]=0x0;_0xcc35ee[_0x7929('0x39')]=0x0;_0xcc35ee['unmanaged']=0x0;_0xcc35ee[_0x7929('0x3a')]=0x0;if(!_0xcc35ee[_0x7929('0x3b')]&&!_0xcc35ee[_0x7929('0x3c')]){_0xcc35ee[_0x7929('0x37')]+=0x1;}if(!_0xcc35ee[_0x7929('0x3b')]&&_0xcc35ee[_0x7929('0x3c')]){_0xcc35ee[_0x7929('0x38')]+=0x1;if(_0xcc35ee[_0x7929('0x37')]){_0xcc35ee['waiting']-=0x1;}}if(_0xcc35ee[_0x7929('0x3b')]&&_0xcc35ee['UserId']){_0xcc35ee[_0x7929('0x39')]+=0x1;if(_0xcc35ee[_0x7929('0x38')]){_0xcc35ee['talking']-=0x1;}}if(_0xcc35ee[_0x7929('0x3b')]&&!_0xcc35ee[_0x7929('0x3c')]){_0xcc35ee[_0x7929('0x3d')]+=0x1;if(_0xcc35ee['waiting']){_0xcc35ee[_0x7929('0x37')]-=0x1;}}_0xcc35ee['total']+=0x1;_0x283698(_0xcc35ee);});}exports[_0x7929('0x3e')]=function(_0x2b91bc,_0x555d6c){var _0x5c0cb6={},_0x55837e={},_0xb8034d={'count':0x0,'rows':[]};var _0x3e9743=_[_0x7929('0x2f')](db['FaxInteraction'][_0x7929('0x3f')],function(_0x2f5271){return{'name':_0x2f5271[_0x7929('0x40')],'type':_0x2f5271['type'][_0x7929('0x41')]};});_0x55837e[_0x7929('0x42')]=_[_0x7929('0x2f')](_0x3e9743,'name');_0x55837e['query']=_[_0x7929('0x43')](_0x2b91bc[_0x7929('0x44')]);_0x55837e[_0x7929('0x45')]=_['intersection'](_0x55837e[_0x7929('0x42')],_0x55837e[_0x7929('0x44')]);_0x5c0cb6[_0x7929('0x46')]=_['intersection'](_0x55837e[_0x7929('0x42')],qs['fields'](_0x2b91bc[_0x7929('0x44')][_0x7929('0x47')]));_0x5c0cb6[_0x7929('0x46')]=_0x5c0cb6[_0x7929('0x46')]['length']?_0x5c0cb6[_0x7929('0x46')]:_0x55837e[_0x7929('0x42')];if(!_0x2b91bc[_0x7929('0x44')][_0x7929('0x48')](_0x7929('0x49'))){_0x5c0cb6[_0x7929('0x23')]=qs[_0x7929('0x23')](_0x2b91bc['query'][_0x7929('0x23')]);_0x5c0cb6[_0x7929('0x21')]=qs[_0x7929('0x21')](_0x2b91bc[_0x7929('0x44')][_0x7929('0x21')]);}_0x5c0cb6['order']=qs['sort'](_0x2b91bc['query'][_0x7929('0x4a')]);_0x5c0cb6['where']=qs[_0x7929('0x45')](_[_0x7929('0x4b')](_0x2b91bc['query'],_0x55837e['filters']),_0x3e9743);var _0x1a4a03=[];var _0x3aaf51=squel[_0x7929('0x4c')]()[_0x7929('0x4d')]('id')[_0x7929('0x4d')](_0x7929('0x2d'))[_0x7929('0x4d')](_0x7929('0x4e'))[_0x7929('0x4f')](_0x7929('0x50'));var _0x37692b=squel['select']()[_0x7929('0x4d')]('u.id')['field'](_0x7929('0x51'))[_0x7929('0x4d')]('ui.FaxInteractionId')[_0x7929('0x4f')](_0x7929('0x52'),'ui')[_0x7929('0x53')](_0x7929('0x54'),'u',_0x7929('0x55'));var _0x328486=squel[_0x7929('0x4c')]()[_0x7929('0x4f')](_0x7929('0x56'),'i')[_0x7929('0x53')](_0x7929('0x57'),'c',_0x7929('0x58'))[_0x7929('0x53')]('users','o',_0x7929('0x59'))[_0x7929('0x53')](_0x7929('0x5a'),'a',_0x7929('0x5b'))[_0x7929('0x53')](_0x7929('0x5c'),'me',_0x7929('0x5d'))[_0x7929('0x53')](_0x7929('0x5e'),'it',_0x7929('0x5f'))[_0x7929('0x53')](_0x7929('0x50'),'t',_0x7929('0x60'));var _0xbb0844=squel['expr']();var _0x111c9a=[];var _0x265c6a=squel['expr']();var _0x713332;if(_0x2b91bc[_0x7929('0x44')]['search']){_0x713332=as[_0x7929('0x61')](_0x2b91bc[_0x7929('0x44')][_0x7929('0x62')]);var _0x4f6f8a=_0x713332[_0x7929('0x63')];for(var _0x4df74a=0x0;_0x4df74a<_0x713332['conditions'][_0x7929('0x64')];_0x4df74a++){var _0x4f53b2=_0x713332['conditions'][_0x4df74a];var _0x16162e='i';var _0x14c35c=_['find'](_0x3e9743,['name',_0x4f53b2['field']]);if(!_0x14c35c){switch(_0x4f53b2[_0x7929('0x4d')]){case'unreadMessages':if(_0x4f53b2[_0x7929('0x65')]==0x1){_0x328486[_0x7929('0x66')]('`'+_0x4f53b2[_0x7929('0x4d')]+_0x7929('0x67'));}else{_0x328486[_0x7929('0x66')]('`'+_0x4f53b2[_0x7929('0x4d')]+_0x7929('0x68'));}break;case _0x7929('0x69'):if(_0x4f53b2[_0x7929('0x6a')]===_0x7929('0x6b')){if(_0x4f53b2['value'][_0x7929('0x33')]('\x20')[_0x7929('0x64')]>0x1){_0xbb0844[_0x4f6f8a](_0x7929('0x6c'),qs['getFullTextValue'](_0x4f53b2['value']),null);}else{var _0x5a4be4='%'+_0x4f53b2[_0x7929('0x65')]+'%';_0xbb0844[_0x4f6f8a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5a4be4,_0x5a4be4,_0x5a4be4);}}else{_0x14c35c=_['find'](_0x3e9743,['name',_0x7929('0x6d')]);_0x4f53b2[_0x7929('0x4d')]=_0x7929('0x6d');_0x3c06b5=as[_0x7929('0x6e')](_0x16162e,_0x14c35c[_0x7929('0x6f')],_0x4f53b2);_0xbb0844[_0x4f6f8a](_0x3c06b5[_0x7929('0x70')],_0x3c06b5['value'][_0x7929('0x71')],_0x3c06b5['value'][_0x7929('0x1f')]);}break;case _0x7929('0x72'):var _0x39c31f=_0x4f53b2['value'][_0x7929('0x33')](',')[_0x7929('0x2f')](function(_0x3ec288){return Number(_0x3ec288);});_0x39c31f[_0x7929('0x34')](function(_0x2fa3e0){_0x265c6a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2fa3e0+',%');});_0x111c9a=_[_0x7929('0x73')](_0x111c9a,_0x39c31f);break;case'User':if(_0x4f53b2[_0x7929('0x6a')]===_0x7929('0x6b')){_0xbb0844[_0x4f6f8a](_0x7929('0x74'),'%'+_0x4f53b2[_0x7929('0x65')]+'%',null);}else{_0x14c35c=_[_0x7929('0x75')](_0x3e9743,[_0x7929('0x2d'),_0x7929('0x3c')]);_0x4f53b2['field']=_0x7929('0x3c');_0x3c06b5=as['buildExpression'](_0x16162e,_0x14c35c['type'],_0x4f53b2);_0xbb0844[_0x4f6f8a](_0x3c06b5['text'],_0x3c06b5['value'][_0x7929('0x71')],_0x3c06b5[_0x7929('0x65')][_0x7929('0x1f')]);}break;case _0x7929('0x76'):_0x3c06b5=as[_0x7929('0x6e')]('me',null,_0x4f53b2);_0xbb0844[_0x4f6f8a](_0x3c06b5[_0x7929('0x70')],_0x3c06b5['value']['start'],_0x3c06b5[_0x7929('0x65')][_0x7929('0x1f')]);break;}}else{var _0x3c06b5=as[_0x7929('0x6e')](_0x16162e,_0x14c35c[_0x7929('0x6f')],_0x4f53b2);_0xbb0844[_0x4f6f8a](_0x3c06b5['text'],_0x3c06b5[_0x7929('0x65')][_0x7929('0x71')],_0x3c06b5[_0x7929('0x65')][_0x7929('0x1f')]);}}}else{var _0x46f7ce=_(_0x2b91bc[_0x7929('0x44')])['keys']()[_0x7929('0x2f')](function(_0x12acf8){return _[_0x7929('0x77')](_0x3e9743,[_0x7929('0x2d'),_0x12acf8])?_0x12acf8:undefined;})['compact']()[_0x7929('0x65')]();if(!_['isEmpty'](_0x46f7ce)){_0x46f7ce[_0x7929('0x34')](function(_0x884fa){if(_0x884fa===_0x7929('0x78')){_0x328486[_0x7929('0x79')](_0x7929('0x7a'),[]['concat'](_0x2b91bc['query'][_0x884fa]));}else if(_0x884fa===_0x7929('0x7b')){var _0x50c722=JSON['parse'](_0x2b91bc[_0x7929('0x44')][_0x884fa])['$gte'];var _0x418984=JSON[_0x7929('0x7c')](_0x2b91bc[_0x7929('0x44')][_0x884fa])[_0x7929('0x7d')];_0x328486[_0x7929('0x79')](_0x7929('0x7e'),_0x50c722,_0x418984);}else{if(_0x2b91bc[_0x7929('0x44')][_0x884fa]==='null'){_0x328486['where']('i.'+_0x884fa+_0x7929('0x7f'));}else{_0x328486['where']('i.'+_0x884fa+_0x7929('0x80'),_0x2b91bc['query'][_0x884fa]);}}});}if(_0x2b91bc[_0x7929('0x44')][_0x7929('0x81')]){if(_0x2b91bc[_0x7929('0x44')][_0x7929('0x81')]==0x1){_0x328486[_0x7929('0x66')](_0x7929('0x82'));}else{_0x328486[_0x7929('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x2b91bc[_0x7929('0x44')][_0x7929('0x83')]){_0x111c9a=_['isArray'](_0x2b91bc[_0x7929('0x44')][_0x7929('0x83')])?_0x2b91bc[_0x7929('0x44')][_0x7929('0x83')]:new Array(_0x2b91bc[_0x7929('0x44')][_0x7929('0x83')]);_0x111c9a['forEach'](function(_0x1436c7){_0x265c6a['or'](_0x7929('0x84'),'%,'+_0x1436c7+',%');});}if(_0x2b91bc['query'][_0x7929('0x85')]){var _0x4c5f1b=_0x2b91bc[_0x7929('0x44')][_0x7929('0x85')][_0x7929('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7929('0x87')](_0x4c5f1b)){_0xbb0844['or'](_0x7929('0x88'),_0x4c5f1b+'%')['or']('i.fax\x20LIKE\x20?',_0x4c5f1b+'%');}_0xbb0844['or'](_0x7929('0x89'),_0x4c5f1b+'%');}}_0x328486[_0x7929('0x79')](_0xbb0844);_0x328486[_0x7929('0x8a')](_0x7929('0x8b'));var _0x2569c7={'type':db[_0x7929('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0xd67792=_0x328486[_0x7929('0x8d')]();_0xd67792['field'](_0x7929('0x8b'));_0xd67792[_0x7929('0x4d')](_0x7929('0x8e'),'unreadMessages');if(_0x5c0cb6['order']){_0x5c0cb6[_0x7929('0x8f')][_0x7929('0x34')](function(_0x54396c){var _0x2f26f=_0x54396c[0x0]===_0x7929('0x90')?_0x54396c[0x0]:'i.'+_0x54396c[0x0];_0x328486[_0x7929('0x8f')](_0x2f26f,_0x54396c[0x1]===_0x7929('0x91')?![]:!![]);});}if(!_[_0x7929('0x92')](_0x111c9a)){_0x328486[_0x7929('0x66')](_0x265c6a);_0xd67792[_0x7929('0x79')](_0x7929('0x93'),_0x111c9a);}BPromise[_0x7929('0x94')]()[_0x7929('0x2b')](function(){if(!_0x713332){if(_0x2b91bc[_0x7929('0x44')]['FaxAccountId'])return;_0xd67792[_0x7929('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x328486[_0x7929('0x79')](_0x7929('0x95'));return;}if(_0x2b91bc[_0x7929('0x96')][_0x7929('0x97')]!==_0x7929('0x98'))return;return _0x2b91bc[_0x7929('0x96')][_0x7929('0x99')]({'attributes':['id'],'raw':!![]})[_0x7929('0x2b')](function(_0x3a7183){if(_['isEmpty'](_0x3a7183)){_0xd67792['where'](_0x7929('0x9a'));_0x328486['where'](_0x7929('0x9a'));}else{_0xd67792[_0x7929('0x79')](_0x7929('0x7a'),_[_0x7929('0x2f')](_0x3a7183,'id'));_0x328486[_0x7929('0x79')](_0x7929('0x7a'),_[_0x7929('0x2f')](_0x3a7183,'id'));}});})['then'](function(){if(_0x2b91bc[_0x7929('0x96')][_0x7929('0x97')]===_0x7929('0x98')&&!_0x713332&&!_0x2b91bc[_0x7929('0x44')][_0x7929('0x78')])return[];return db[_0x7929('0x9b')]['query'](_0xd67792['toString'](),_0x2569c7);})['then'](function(_0x260d01){_0xb8034d[_0x7929('0x24')]=_0x260d01['length'];if(_0xb8034d[_0x7929('0x24')]===0x0)return[];return db[_0x7929('0x9b')]['query'](_0x3aaf51[_0x7929('0x9c')](),_0x2569c7)[_0x7929('0x2b')](function(_0x4bf94f){_0x1a4a03=_[_0x7929('0x9d')](_0x4bf94f,'id');_0x2569c7=_[_0x7929('0x9e')](_0x2569c7,{'model':db[_0x7929('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b91bc[_0x7929('0x44')][_0x7929('0x47')]){_0x5c0cb6[_0x7929('0x46')][_0x7929('0x34')](function(_0x3b2f8e){_0x328486[_0x7929('0x4d')]('i.'+_0x3b2f8e);});}else{_0x328486['field'](_0x7929('0x8e'),'unreadMessages');_0x328486[_0x7929('0x4d')](_0x7929('0xa0'),'Account.key');_0x328486[_0x7929('0x4d')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x328486[_0x7929('0x4d')](_0x7929('0xa1'),'contactName');_0x328486[_0x7929('0x4d')](_0x7929('0xa2'));_0x328486[_0x7929('0x4d')]('c.firstName',_0x7929('0xa3'));_0x328486[_0x7929('0x4d')](_0x7929('0xa4'),_0x7929('0xa5'));_0x328486[_0x7929('0x4d')](_0x7929('0xa6'),'Contact.email');_0x328486['field'](_0x7929('0xa7'),'Contact.phone');_0x328486[_0x7929('0x4d')]('c.mobile',_0x7929('0xa8'));_0x328486[_0x7929('0x4d')](_0x7929('0xa9'),_0x7929('0xaa'));_0x328486[_0x7929('0x4d')]('o.fullname','Owner.fullname');_0x328486['field'](_0x7929('0xab'),_0x7929('0xac'));_0x328486['field'](_0x7929('0xad'),'TagIds');}if(_0x5c0cb6[_0x7929('0x23')])_0x328486[_0x7929('0x23')](_0x5c0cb6[_0x7929('0x23')]);if(_0x5c0cb6[_0x7929('0x21')])_0x328486[_0x7929('0x21')](_0x5c0cb6['offset']);return db[_0x7929('0x9b')]['query'](_0x328486[_0x7929('0x9c')](),_0x2569c7);})[_0x7929('0x2b')](function(_0x5f35bf){if(_0x5f35bf[_0x7929('0x64')]>0x0)_0x37692b['where'](_0x7929('0xae'),_['map'](_0x5f35bf,'id'));return db['sequelize'][_0x7929('0x44')](_0x37692b[_0x7929('0x9c')](),_0x2569c7)[_0x7929('0x2b')](function(_0x6d373f){var _0x4ee64b=_[_0x7929('0xaf')](_0x6d373f,_0x7929('0xb0'));var _0x124b48=[];_0x5f35bf['forEach'](function(_0xa6de8e){_0x124b48['push'](updateFaxInteraction(_0xa6de8e,_0x1a4a03,_0x4ee64b));});return BPromise[_0x7929('0xb1')](_0x124b48);});});})[_0x7929('0x2b')](function(_0x40513c){_0xb8034d[_0x7929('0xb2')]=_0x40513c;return _0xb8034d;})[_0x7929('0x2b')](respondWithFilteredResult(_0x555d6c,_0x5c0cb6))[_0x7929('0x36')](handleError(_0x555d6c,null));};exports[_0x7929('0xb3')]=function(_0x87a25e,_0x53b663){var _0xa5c2ba={'raw':![],'where':{'id':_0x87a25e[_0x7929('0xb4')]['id']}},_0x35ebc2={};_0x35ebc2[_0x7929('0x42')]=_[_0x7929('0x43')](db[_0x7929('0x9f')][_0x7929('0x3f')]);_0x35ebc2[_0x7929('0x44')]=_['keys'](_0x87a25e[_0x7929('0x44')]);_0x35ebc2[_0x7929('0x45')]=_['intersection'](_0x35ebc2['model'],_0x35ebc2[_0x7929('0x44')]);_0xa5c2ba[_0x7929('0x46')]=_[_0x7929('0xb5')](_0x35ebc2[_0x7929('0x42')],qs[_0x7929('0x47')](_0x87a25e[_0x7929('0x44')][_0x7929('0x47')]));_0xa5c2ba[_0x7929('0x46')]=_0xa5c2ba[_0x7929('0x46')][_0x7929('0x64')]?_0xa5c2ba['attributes']:_0x35ebc2['model'];if(_0x87a25e[_0x7929('0x44')][_0x7929('0xb6')]){_0xa5c2ba[_0x7929('0xb7')]=[{'all':!![]}];}_0xa5c2ba=_[_0x7929('0x9e')]({},_0xa5c2ba,_0x87a25e[_0x7929('0xb8')]);return db['FaxInteraction'][_0x7929('0x75')](_0xa5c2ba)[_0x7929('0x2b')](handleEntityNotFound(_0x53b663,null))['then'](respondWithResult(_0x53b663,null))[_0x7929('0x36')](handleError(_0x53b663,null));};exports[_0x7929('0xb9')]=function(_0x3f01a2,_0x63171d){return db[_0x7929('0x9f')][_0x7929('0xb9')](_0x3f01a2['body'],{})[_0x7929('0x2b')](respondWithResult(_0x63171d,0xc9))[_0x7929('0x36')](handleError(_0x63171d,null));};exports[_0x7929('0xba')]=function(_0x260179,_0x54af0f){if(_0x260179['body']['id']){delete _0x260179[_0x7929('0x76')]['id'];}return db[_0x7929('0x9f')][_0x7929('0x75')]({'where':{'id':_0x260179['params']['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x54af0f,null))[_0x7929('0x2b')](saveUpdates(_0x260179[_0x7929('0x76')],null))['then'](respondWithResult(_0x54af0f,null))[_0x7929('0x36')](handleError(_0x54af0f,null));};exports[_0x7929('0x2a')]=function(_0x173489,_0x26a456){return db[_0x7929('0x9f')][_0x7929('0x75')]({'where':{'id':_0x173489['params']['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x26a456,null))[_0x7929('0x2b')](removeEntity(_0x26a456,null))[_0x7929('0x36')](handleError(_0x26a456,null));};exports[_0x7929('0xbb')]=function(_0x20681c,_0x244f50){return db[_0x7929('0x9f')][_0x7929('0xbb')]()[_0x7929('0x2b')](respondWithResult(_0x244f50,null))[_0x7929('0x36')](handleError(_0x244f50,null));};exports[_0x7929('0xbc')]=function(_0x49aa0f,_0x180745,_0xc5ea0c){return db[_0x7929('0xbd')][_0x7929('0x75')]({'where':{'id':_0x49aa0f[_0x7929('0xb4')]['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x180745,null))[_0x7929('0x2b')](function(_0x48c6a7){if(_0x48c6a7){return _0x48c6a7[_0x7929('0xbc')](_0x49aa0f[_0x7929('0x76')]['ids'],_['omit'](_0x49aa0f['body'],[_0x7929('0xbe'),'id'])||{});}})[_0x7929('0x2b')](respondWithResult(_0x180745,null))[_0x7929('0x36')](handleError(_0x180745,null));};exports[_0x7929('0xbf')]=function(_0x45a567,_0x4ab40b,_0x50d5b8){var _0x1464bb={'raw':![],'where':{}};var _0x32706c={};var _0x1c9a8b={'count':0x0,'rows':[]};return db[_0x7929('0x9f')][_0x7929('0xc0')]({'where':{'id':_0x45a567[_0x7929('0xb4')]['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x4ab40b,null))[_0x7929('0x2b')](function(_0xaa8b4a){if(_0xaa8b4a){_0x32706c[_0x7929('0x42')]=_[_0x7929('0x43')](db['FaxMessage'][_0x7929('0x3f')]);_0x32706c[_0x7929('0x44')]=_['keys'](_0x45a567['query']);_0x32706c[_0x7929('0x45')]=_['intersection'](_0x32706c['model'],_0x32706c[_0x7929('0x44')]);_0x1464bb[_0x7929('0x46')]=_[_0x7929('0xb5')](_0x32706c[_0x7929('0x42')],qs[_0x7929('0x47')](_0x45a567[_0x7929('0x44')][_0x7929('0x47')]));_0x1464bb[_0x7929('0x46')]=_0x1464bb[_0x7929('0x46')][_0x7929('0x64')]?_0x1464bb[_0x7929('0x46')]:_0x32706c[_0x7929('0x42')];if(!_0x45a567[_0x7929('0x44')][_0x7929('0x48')](_0x7929('0x49'))){_0x1464bb[_0x7929('0x23')]=qs[_0x7929('0x23')](_0x45a567[_0x7929('0x44')][_0x7929('0x23')]);_0x1464bb['offset']=qs['offset'](_0x45a567[_0x7929('0x44')][_0x7929('0x21')]);}_0x1464bb[_0x7929('0x8f')]=qs['sort'](_0x45a567[_0x7929('0x44')][_0x7929('0x4a')]);_0x1464bb[_0x7929('0x79')]=qs[_0x7929('0x45')](_[_0x7929('0x4b')](_0x45a567[_0x7929('0x44')],_0x32706c[_0x7929('0x45')]));_0x1464bb['where'][_0x7929('0xb0')]=_0xaa8b4a['id'];if(_0x45a567[_0x7929('0x44')]['filter']){_0x1464bb[_0x7929('0x79')]=_[_0x7929('0x9e')](_0x1464bb[_0x7929('0x79')],{'$or':_[_0x7929('0x2f')](_0x1464bb[_0x7929('0x46')],function(_0x290dca){var _0x38892b={};_0x38892b[_0x290dca]={'$like':'%'+_0x45a567[_0x7929('0x44')][_0x7929('0x85')]+'%'};return _0x38892b;})});}if(_0x45a567[_0x7929('0x44')][_0x7929('0xc1')]){var _0x4954a8=_0x45a567[_0x7929('0x44')][_0x7929('0xc1')][_0x7929('0x33')](',');var _0xafabc7={};_0xafabc7[_0x4954a8[0x0]]={'$gte':moment(_0x4954a8[0x1])[_0x7929('0xc2')](_0x7929('0xc3'))};_0x1464bb[_0x7929('0x79')]=_['merge'](_0x1464bb[_0x7929('0x79')],_0xafabc7);}_0x1464bb=_[_0x7929('0x9e')]({},_0x1464bb,_0x45a567[_0x7929('0xb8')]);return db['FaxMessage'][_0x7929('0x24')]({'where':_0x1464bb[_0x7929('0x79')]})['then'](function(_0x1d544f){_0x1c9a8b[_0x7929('0x24')]=_0x1d544f;if(_0x45a567[_0x7929('0x44')]['includeAll']){_0x1464bb[_0x7929('0xb7')]=[{'all':!![]}];}return db[_0x7929('0xbd')][_0x7929('0xc4')](_0x1464bb);})['then'](function(_0x112fed){_0x1c9a8b[_0x7929('0xb2')]=_0x112fed;return _0x1c9a8b;});}})[_0x7929('0x2b')](respondWithFilteredResult(_0x4ab40b,_0x1464bb))['catch'](handleError(_0x4ab40b,null));};exports['addTags']=function(_0x3aa106,_0x10089d,_0x2eceed){return db[_0x7929('0x9f')]['find']({'where':{'id':_0x3aa106['params']['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x10089d,null))[_0x7929('0x2b')](function(_0xda6df4){if(_0xda6df4){return _0xda6df4[_0x7929('0xc5')](_0x3aa106['body'][_0x7929('0xbe')],_['omit'](_0x3aa106[_0x7929('0x76')],[_0x7929('0xbe'),'id'])||{})['spread'](function(){return db[_0x7929('0x72')]['findAll']({'attributes':['id',_0x7929('0x2d'),'color'],'where':{'id':_0x3aa106[_0x7929('0x76')][_0x7929('0xbe')]}});})[_0x7929('0x2b')](function(_0x46dbd1){socket['emit']('faxInteractionTags:save',{'id':Number(_0x3aa106[_0x7929('0xb4')]['id']),'tags':_0x46dbd1||[]});return{'id':Number(_0x3aa106[_0x7929('0xb4')]['id']),'tags':_0x46dbd1||[]};});}})['then'](respondWithResult(_0x10089d,null))['catch'](handleError(_0x10089d,null));};exports[_0x7929('0xc6')]=function(_0x40db76,_0x107f4e,_0x216aca){return db[_0x7929('0x9f')][_0x7929('0x75')]({'where':{'id':_0x40db76[_0x7929('0xb4')]['id']}})[_0x7929('0x2b')](handleEntityNotFound(_0x107f4e,null))[_0x7929('0x2b')](function(_0x4e5d2f){if(_0x4e5d2f){return _0x4e5d2f[_0x7929('0xc6')](_0x40db76[_0x7929('0x44')]['ids']);}})[_0x7929('0x2b')](respondWithStatusCode(_0x107f4e,null))[_0x7929('0x36')](handleError(_0x107f4e,null));};exports[_0x7929('0xc7')]=function(_0x4d9f7b,_0xe09b42){var _0x26df45=moment()[_0x7929('0xc8')]()['toString']();var _0x17545d=path[_0x7929('0xc9')](config[_0x7929('0xca')],_0x7929('0xcb'),_0x7929('0xcc'),_0x7929('0xcd'));var _0x24d505=path[_0x7929('0xc9')](config[_0x7929('0xca')],_0x7929('0xcb'),'files',_0x7929('0xce'));var _0x196253=path['join'](_0x17545d,_0x26df45);var _0x224048=util['format'](_0x7929('0xcf'),_0x4d9f7b[_0x7929('0xb4')]['id'],_0x26df45);var _0x567de5=path[_0x7929('0xc9')](_0x17545d,_0x224048);var _0x51389b=[];_0x51389b[_0x7929('0x35')]({'model':db[_0x7929('0xd0')],'as':_0x7929('0xd0'),'raw':!![]});var _0x4a1757=[{'model':db[_0x7929('0xbd')],'as':_0x7929('0xd1'),'attributes':['id',_0x7929('0x76'),_0x7929('0x7b')],'include':_0x51389b}];return db[_0x7929('0x9f')][_0x7929('0x75')]({'where':{'id':_0x4d9f7b['params']['id']},'include':_0x4a1757})[_0x7929('0x2b')](handleEntityNotFound(_0xe09b42,null))[_0x7929('0x2b')](function(_0x309592){if(_0x309592&&_0x309592['Messages']){var _0x1711cb=_0x309592[_0x7929('0xd2')]({'plain':!![]});fs[_0x7929('0xd3')](_0x196253);for(var _0x3712fb=0x0;_0x3712fb<_0x1711cb[_0x7929('0xd1')][_0x7929('0x64')];_0x3712fb++){var _0x506692=_0x1711cb[_0x7929('0xd1')][_0x3712fb][_0x7929('0xd0')];if(_0x506692){var _0x3d98a3=path['join'](_0x24d505,_0x506692[_0x7929('0xd4')]);if(fs[_0x7929('0xd5')](_0x3d98a3)){fs[_0x7929('0xd6')](_0x3d98a3)[_0x7929('0xd7')](fs['createWriteStream'](path['join'](_0x196253,_0x506692[_0x7929('0xd4')])));}}}return BPromise[_0x7929('0x94')]()[_0x7929('0x2b')](function(){return new BPromise(function(_0x461ff4,_0x105d67){zipdir(_0x196253,{'saveTo':_0x567de5},function(_0x1a4f93,_0x578257){if(_0x1a4f93)return _0x105d67(_0x1a4f93);return _0x461ff4(_0x578257);});})[_0x7929('0x2b')](function(){return new BPromise(function(_0x14cfca,_0x46ca4e){rimraf(_0x196253,function(_0x376f94){if(_0x376f94)_0x46ca4e(_0x376f94);return _0x14cfca();});});})[_0x7929('0x2b')](function(){return _0xe09b42['download'](_0x567de5,_0x224048,function(_0x5580a0){if(_0x5580a0){console[_0x7929('0xd8')](_0x7929('0xd9'),_0x5580a0);}else{fs['unlinkSync'](_0x567de5);}});});});}else{return _0xe09b42[_0x7929('0x1d')](0xc8);}})[_0x7929('0x36')](handleError(_0xe09b42,null));}; \ No newline at end of file +var _0x35e9=['options','create','destroy','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','pick','format','includeAll','rows','spread','Tag','findAll','emit','faxInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','Users','map','fullname','TagIds','split','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','field','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','end','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','agent','toString','sequelize','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','show','params','include'];(function(_0x1d6f9d,_0x52dd8c){var _0x1dcae7=function(_0x2002a4){while(--_0x2002a4){_0x1d6f9d['push'](_0x1d6f9d['shift']());}};_0x1dcae7(++_0x52dd8c);}(_0x35e9,0x104));var _0x935e=function(_0x3b3a52,_0x16e5a6){_0x3b3a52=_0x3b3a52-0x0;var _0x5aae33=_0x35e9[_0x3b3a52];return _0x5aae33;};'use strict';var emlformat=require(_0x935e('0x0'));var rimraf=require(_0x935e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x935e('0x2'));var rp=require(_0x935e('0x3'));var moment=require(_0x935e('0x4'));var BPromise=require(_0x935e('0x5'));var Mustache=require(_0x935e('0x6'));var util=require('util');var path=require(_0x935e('0x7'));var sox=require(_0x935e('0x8'));var csv=require('to-csv');var ejs=require(_0x935e('0x9'));var fs=require('fs');var fs_extra=require(_0x935e('0xa'));var _=require(_0x935e('0xb'));var squel=require(_0x935e('0xc'));var crypto=require(_0x935e('0xd'));var jsforce=require(_0x935e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x935e('0xf'));var querystring=require(_0x935e('0x10'));var Papa=require(_0x935e('0x11'));var Redis=require('ioredis');var authService=require(_0x935e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x935e('0x13'));var logger=require(_0x935e('0x14'))(_0x935e('0x15'));var utils=require(_0x935e('0x16'));var config=require(_0x935e('0x17'));var licenseUtil=require(_0x935e('0x18'));var db=require(_0x935e('0x19'))['db'];config[_0x935e('0x1a')]=_[_0x935e('0x1b')](config['redis'],{'host':_0x935e('0x1c'),'port':0x18eb});var socket=require(_0x935e('0x1d'))(new Redis(config[_0x935e('0x1a')]));require(_0x935e('0x1e'))[_0x935e('0x1f')](socket);function respondWithStatusCode(_0x4439a0,_0x3964b2){_0x3964b2=_0x3964b2||0xcc;return function(_0xce36f6){if(_0xce36f6){return _0x4439a0[_0x935e('0x20')](_0x3964b2);}return _0x4439a0[_0x935e('0x21')](_0x3964b2)['end']();};}function respondWithResult(_0x48369e,_0x5edd9d){_0x5edd9d=_0x5edd9d||0xc8;return function(_0x12555a){if(_0x12555a){return _0x48369e[_0x935e('0x21')](_0x5edd9d)[_0x935e('0x22')](_0x12555a);}};}function respondWithFilteredResult(_0x389db9,_0x52e06a){return function(_0x112606){if(_0x112606){var _0x2314c3=typeof _0x52e06a['offset']==='undefined'&&typeof _0x52e06a['limit']==='undefined';var _0x18285b=_0x112606[_0x935e('0x23')];var _0x54ede1=_0x2314c3?0x0:_0x52e06a['offset'];var _0x4295e0=_0x2314c3?_0x112606[_0x935e('0x23')]:_0x52e06a['offset']+_0x52e06a[_0x935e('0x24')];var _0x253bf9;if(_0x4295e0>=_0x18285b){_0x4295e0=_0x18285b;_0x253bf9=0xc8;}else{_0x253bf9=0xce;}_0x389db9[_0x935e('0x21')](_0x253bf9);return _0x389db9[_0x935e('0x25')](_0x935e('0x26'),_0x54ede1+'-'+_0x4295e0+'/'+_0x18285b)[_0x935e('0x22')](_0x112606);}return null;};}function patchUpdates(_0x836658){return function(_0x3d6f30){try{jsonpatch[_0x935e('0x27')](_0x3d6f30,_0x836658,!![]);}catch(_0x5bf661){return BPromise[_0x935e('0x28')](_0x5bf661);}return _0x3d6f30[_0x935e('0x29')]();};}function saveUpdates(_0x8f8ddf,_0x444926){return function(_0x46d7bb){if(_0x46d7bb){return _0x46d7bb[_0x935e('0x2a')](_0x8f8ddf)[_0x935e('0x2b')](function(_0x50981d){return _0x50981d;});}return null;};}function removeEntity(_0x2bad1e,_0x587ba4){return function(_0x611c95){if(_0x611c95){return _0x611c95['destroy']()[_0x935e('0x2b')](function(){_0x2bad1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4c0e3,_0x20eb1c){return function(_0x42a43c){if(!_0x42a43c){_0xa4c0e3[_0x935e('0x20')](0x194);}return _0x42a43c;};}function handleError(_0x28c0a7,_0x4631bd){_0x4631bd=_0x4631bd||0x1f4;return function(_0x3580fa){logger[_0x935e('0x2c')](_0x3580fa['stack']);if(_0x3580fa[_0x935e('0x2d')]){delete _0x3580fa['name'];}_0x28c0a7[_0x935e('0x21')](_0x4631bd)[_0x935e('0x2e')](_0x3580fa);};}function getInteractionUsers(_0x4a5c88,_0x2b39a2){return new BPromise(function(_0x3e8bba,_0x553801){try{if(_0x2b39a2[_0x4a5c88['id']]){_0x4a5c88[_0x935e('0x2f')]=_[_0x935e('0x30')](_0x2b39a2[_0x4a5c88['id']],function(_0x20f4e6){return{'id':_0x20f4e6['id'],'fullname':_0x20f4e6[_0x935e('0x31')]};});}}catch(_0x21f03f){_0x553801(_0x21f03f);}_0x3e8bba(_0x4a5c88);});}function getInteractionTags(_0x15961b,_0x4e82d5){return new BPromise(function(_0x35757b,_0x5acebc){try{if(_0x15961b['TagIds']){_0x15961b['Tags']=[];_0x15961b[_0x935e('0x32')][_0x935e('0x33')](',')['forEach'](function(_0x1e6648){_0x15961b[_0x935e('0x34')][_0x935e('0x35')](_0x4e82d5[_0x1e6648]);});}delete _0x15961b['TagIds'];}catch(_0x5cde14){_0x5acebc(_0x5cde14);}_0x35757b(_0x15961b);});}function updateFaxInteraction(_0x48716e,_0x5ed5fa,_0x2afaac){return new BPromise(function(_0xffdcb0,_0x185965){return getInteractionUsers(_0x48716e,_0x2afaac)[_0x935e('0x2b')](function(_0x9b461a){return getInteractionTags(_0x9b461a,_0x5ed5fa);})[_0x935e('0x2b')](function(_0x5e1338){return getStateInteraction(_0x5e1338);})[_0x935e('0x2b')](function(_0x118719){_0xffdcb0(_0x118719);})[_0x935e('0x36')](function(_0x5de01b){_0x185965(_0x5de01b);});});}function getStateInteraction(_0x43e187){return new BPromise(function(_0x12a0e8){_0x43e187[_0x935e('0x37')]=0x0;_0x43e187[_0x935e('0x38')]=0x0;_0x43e187[_0x935e('0x39')]=0x0;_0x43e187[_0x935e('0x3a')]=0x0;_0x43e187[_0x935e('0x3b')]=0x0;if(!_0x43e187[_0x935e('0x3c')]&&!_0x43e187[_0x935e('0x3d')]){_0x43e187[_0x935e('0x37')]+=0x1;}if(!_0x43e187['closed']&&_0x43e187[_0x935e('0x3d')]){_0x43e187[_0x935e('0x38')]+=0x1;if(_0x43e187[_0x935e('0x37')]){_0x43e187['waiting']-=0x1;}}if(_0x43e187[_0x935e('0x3c')]&&_0x43e187['UserId']){_0x43e187[_0x935e('0x39')]+=0x1;if(_0x43e187[_0x935e('0x38')]){_0x43e187['talking']-=0x1;}}if(_0x43e187[_0x935e('0x3c')]&&!_0x43e187[_0x935e('0x3d')]){_0x43e187[_0x935e('0x3a')]+=0x1;if(_0x43e187[_0x935e('0x37')]){_0x43e187[_0x935e('0x37')]-=0x1;}}_0x43e187[_0x935e('0x3b')]+=0x1;_0x12a0e8(_0x43e187);});}exports[_0x935e('0x3e')]=function(_0x12ffc8,_0x2aca3c){var _0x9e250a={},_0xe8902f={},_0x5e853c={'count':0x0,'rows':[]};var _0x48a9bd=_[_0x935e('0x30')](db[_0x935e('0x3f')][_0x935e('0x40')],function(_0x57e703){return{'name':_0x57e703[_0x935e('0x41')],'type':_0x57e703[_0x935e('0x42')][_0x935e('0x43')]};});_0xe8902f[_0x935e('0x44')]=_['map'](_0x48a9bd,_0x935e('0x2d'));_0xe8902f['query']=_[_0x935e('0x45')](_0x12ffc8[_0x935e('0x46')]);_0xe8902f[_0x935e('0x47')]=_[_0x935e('0x48')](_0xe8902f[_0x935e('0x44')],_0xe8902f['query']);_0x9e250a[_0x935e('0x49')]=_[_0x935e('0x48')](_0xe8902f[_0x935e('0x44')],qs[_0x935e('0x4a')](_0x12ffc8[_0x935e('0x46')][_0x935e('0x4a')]));_0x9e250a[_0x935e('0x49')]=_0x9e250a['attributes'][_0x935e('0x4b')]?_0x9e250a[_0x935e('0x49')]:_0xe8902f[_0x935e('0x44')];if(!_0x12ffc8[_0x935e('0x46')][_0x935e('0x4c')]('nolimit')){_0x9e250a[_0x935e('0x24')]=qs[_0x935e('0x24')](_0x12ffc8[_0x935e('0x46')]['limit']);_0x9e250a[_0x935e('0x4d')]=qs['offset'](_0x12ffc8[_0x935e('0x46')][_0x935e('0x4d')]);}_0x9e250a[_0x935e('0x4e')]=qs[_0x935e('0x4f')](_0x12ffc8[_0x935e('0x46')][_0x935e('0x4f')]);_0x9e250a[_0x935e('0x50')]=qs[_0x935e('0x47')](_['pick'](_0x12ffc8[_0x935e('0x46')],_0xe8902f[_0x935e('0x47')]),_0x48a9bd);var _0x5322aa=[];var _0x4f771f=squel['select']()[_0x935e('0x51')]('id')[_0x935e('0x51')]('name')['field']('color')[_0x935e('0x52')](_0x935e('0x53'));var _0x5c0a02=squel[_0x935e('0x54')]()['field'](_0x935e('0x55'))[_0x935e('0x51')](_0x935e('0x56'))[_0x935e('0x51')](_0x935e('0x57'))['from'](_0x935e('0x58'),'ui')[_0x935e('0x59')](_0x935e('0x5a'),'u',_0x935e('0x5b'));var _0x18ebe7=squel[_0x935e('0x54')]()[_0x935e('0x52')](_0x935e('0x5c'),'i')[_0x935e('0x59')]('cm_contacts','c',_0x935e('0x5d'))[_0x935e('0x59')]('users','o',_0x935e('0x5e'))[_0x935e('0x59')]('fax_accounts','a',_0x935e('0x5f'))[_0x935e('0x59')]('fax_messages','me',_0x935e('0x60'))[_0x935e('0x59')](_0x935e('0x61'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x935e('0x62'));var _0x29c228=squel[_0x935e('0x63')]();var _0x39a4db=[];var _0x4035fe=squel['expr']();var _0x3ec05c;if(_0x12ffc8['query']['search']){_0x3ec05c=as[_0x935e('0x64')](_0x12ffc8['query']['search']);var _0x2bcec8=_0x3ec05c[_0x935e('0x65')];for(var _0x3af08e=0x0;_0x3af08e<_0x3ec05c[_0x935e('0x66')]['length'];_0x3af08e++){var _0x51f658=_0x3ec05c[_0x935e('0x66')][_0x3af08e];var _0x445f58='i';var _0x37d7c3=_['find'](_0x48a9bd,[_0x935e('0x2d'),_0x51f658[_0x935e('0x51')]]);if(!_0x37d7c3){switch(_0x51f658[_0x935e('0x51')]){case _0x935e('0x67'):if(_0x51f658[_0x935e('0x68')]==0x1){_0x18ebe7[_0x935e('0x69')]('`'+_0x51f658[_0x935e('0x51')]+_0x935e('0x6a'));}else{_0x18ebe7[_0x935e('0x69')]('`'+_0x51f658['field']+_0x935e('0x6b'));}break;case'Contact':if(_0x51f658['operator']===_0x935e('0x6c')){if(_0x51f658[_0x935e('0x68')][_0x935e('0x33')]('\x20')[_0x935e('0x4b')]>0x1){_0x29c228[_0x2bcec8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x935e('0x6d')](_0x51f658['value']),null);}else{var _0x3c74a6='%'+_0x51f658[_0x935e('0x68')]+'%';_0x29c228[_0x2bcec8](_0x935e('0x6e'),_0x3c74a6,_0x3c74a6,_0x3c74a6);}}else{_0x37d7c3=_[_0x935e('0x6f')](_0x48a9bd,['name',_0x935e('0x70')]);_0x51f658[_0x935e('0x51')]=_0x935e('0x70');_0x616514=as[_0x935e('0x71')](_0x445f58,_0x37d7c3['type'],_0x51f658);_0x29c228[_0x2bcec8](_0x616514['text'],_0x616514['value']['start'],_0x616514['value'][_0x935e('0x72')]);}break;case'Tag':var _0x45839d=_0x51f658[_0x935e('0x68')][_0x935e('0x33')](',')[_0x935e('0x30')](function(_0x3e3246){return Number(_0x3e3246);});_0x45839d[_0x935e('0x73')](function(_0x5dce68){_0x4035fe['or'](_0x935e('0x74'),'%,'+_0x5dce68+',%');});_0x39a4db=_[_0x935e('0x75')](_0x39a4db,_0x45839d);break;case _0x935e('0x76'):if(_0x51f658[_0x935e('0x77')]==='$substring'){_0x29c228[_0x2bcec8](_0x935e('0x78'),'%'+_0x51f658[_0x935e('0x68')]+'%',null);}else{_0x37d7c3=_[_0x935e('0x6f')](_0x48a9bd,['name','UserId']);_0x51f658[_0x935e('0x51')]=_0x935e('0x3d');_0x616514=as[_0x935e('0x71')](_0x445f58,_0x37d7c3[_0x935e('0x42')],_0x51f658);_0x29c228[_0x2bcec8](_0x616514[_0x935e('0x79')],_0x616514[_0x935e('0x68')][_0x935e('0x7a')],_0x616514['value'][_0x935e('0x72')]);}break;case _0x935e('0x7b'):_0x616514=as['buildExpression']('me',null,_0x51f658);_0x29c228[_0x2bcec8](_0x616514['text'],_0x616514[_0x935e('0x68')][_0x935e('0x7a')],_0x616514['value']['end']);break;}}else{var _0x616514=as[_0x935e('0x71')](_0x445f58,_0x37d7c3[_0x935e('0x42')],_0x51f658);_0x29c228[_0x2bcec8](_0x616514[_0x935e('0x79')],_0x616514[_0x935e('0x68')][_0x935e('0x7a')],_0x616514[_0x935e('0x68')][_0x935e('0x72')]);}}}else{var _0x413212=_(_0x12ffc8[_0x935e('0x46')])[_0x935e('0x45')]()[_0x935e('0x30')](function(_0x3cf9a4){return _[_0x935e('0x7c')](_0x48a9bd,[_0x935e('0x2d'),_0x3cf9a4])?_0x3cf9a4:undefined;})[_0x935e('0x7d')]()[_0x935e('0x68')]();if(!_[_0x935e('0x7e')](_0x413212)){_0x413212[_0x935e('0x73')](function(_0x39affc){if(_0x39affc===_0x935e('0x7f')){_0x18ebe7[_0x935e('0x50')](_0x935e('0x80'),[][_0x935e('0x81')](_0x12ffc8[_0x935e('0x46')][_0x39affc]));}else if(_0x39affc===_0x935e('0x82')){var _0x1a38ce=JSON[_0x935e('0x83')](_0x12ffc8['query'][_0x39affc])[_0x935e('0x84')];var _0x241fe3=JSON[_0x935e('0x83')](_0x12ffc8['query'][_0x39affc])['$lte'];_0x18ebe7['where'](_0x935e('0x85'),_0x1a38ce,_0x241fe3);}else{if(_0x12ffc8[_0x935e('0x46')][_0x39affc]===_0x935e('0x86')){_0x18ebe7[_0x935e('0x50')]('i.'+_0x39affc+_0x935e('0x87'));}else{_0x18ebe7[_0x935e('0x50')]('i.'+_0x39affc+'\x20=\x20?',_0x12ffc8[_0x935e('0x46')][_0x39affc]);}}});}if(_0x12ffc8[_0x935e('0x46')]['read']){if(_0x12ffc8['query'][_0x935e('0x88')]==0x1){_0x18ebe7[_0x935e('0x69')](_0x935e('0x89'));}else{_0x18ebe7[_0x935e('0x69')](_0x935e('0x8a'));}}if(_0x12ffc8[_0x935e('0x46')][_0x935e('0x8b')]){_0x39a4db=_[_0x935e('0x8c')](_0x12ffc8[_0x935e('0x46')][_0x935e('0x8b')])?_0x12ffc8[_0x935e('0x46')]['tag']:new Array(_0x12ffc8['query'][_0x935e('0x8b')]);_0x39a4db[_0x935e('0x73')](function(_0x3f5b03){_0x4035fe['or'](_0x935e('0x74'),'%,'+_0x3f5b03+',%');});}if(_0x12ffc8[_0x935e('0x46')]['filter']){var _0x2dd744=_0x12ffc8[_0x935e('0x46')][_0x935e('0x8d')][_0x935e('0x8e')]('\x5c','\x5c\x5c')[_0x935e('0x8e')](/'/g,'\x27\x27');if(qs[_0x935e('0x8f')](_0x2dd744)){_0x29c228['or'](_0x935e('0x90'),_0x2dd744+'%')['or']('i.fax\x20LIKE\x20?',_0x2dd744+'%');}_0x29c228['or'](_0x935e('0x91'),_0x2dd744+'%');}}_0x18ebe7[_0x935e('0x50')](_0x29c228);_0x18ebe7[_0x935e('0x92')](_0x935e('0x93'));var _0x4f4210={'type':db[_0x935e('0x94')]['QueryTypes'][_0x935e('0x95')],'raw':!![]};var _0x486262=_0x18ebe7['clone']();_0x486262[_0x935e('0x51')](_0x935e('0x93'));_0x486262[_0x935e('0x51')](_0x935e('0x96'),'unreadMessages');if(_0x9e250a[_0x935e('0x4e')]){_0x9e250a[_0x935e('0x4e')][_0x935e('0x73')](function(_0x1ddf3e){var _0x48ea92=_0x1ddf3e[0x0]===_0x935e('0x97')?_0x1ddf3e[0x0]:'i.'+_0x1ddf3e[0x0];_0x18ebe7['order'](_0x48ea92,_0x1ddf3e[0x1]===_0x935e('0x98')?![]:!![]);});}if(!_[_0x935e('0x7e')](_0x39a4db)){_0x18ebe7['having'](_0x4035fe);_0x486262[_0x935e('0x50')]('t.id\x20IN\x20?',_0x39a4db);}BPromise[_0x935e('0x99')]()[_0x935e('0x2b')](function(){if(!_0x3ec05c){if(_0x12ffc8[_0x935e('0x46')]['FaxAccountId'])return;_0x486262[_0x935e('0x50')](_0x935e('0x9a'));_0x18ebe7['where'](_0x935e('0x9a'));return;}if(_0x12ffc8[_0x935e('0x9b')]['role']!=='agent')return;return _0x12ffc8[_0x935e('0x9b')][_0x935e('0x9c')]({'attributes':['id'],'raw':!![]})[_0x935e('0x2b')](function(_0x44fb97){if(_[_0x935e('0x7e')](_0x44fb97)){_0x486262[_0x935e('0x50')](_0x935e('0x9d'));_0x18ebe7[_0x935e('0x50')](_0x935e('0x9d'));}else{_0x486262['where'](_0x935e('0x80'),_[_0x935e('0x30')](_0x44fb97,'id'));_0x18ebe7[_0x935e('0x50')](_0x935e('0x80'),_[_0x935e('0x30')](_0x44fb97,'id'));}});})[_0x935e('0x2b')](function(){if(_0x12ffc8[_0x935e('0x9b')][_0x935e('0x9e')]===_0x935e('0x9f')&&!_0x3ec05c&&!_0x12ffc8[_0x935e('0x46')]['FaxAccountId'])return[];return db['sequelize'][_0x935e('0x46')](_0x486262[_0x935e('0xa0')](),_0x4f4210);})[_0x935e('0x2b')](function(_0x2bf65d){_0x5e853c[_0x935e('0x23')]=_0x2bf65d[_0x935e('0x4b')];if(_0x5e853c[_0x935e('0x23')]===0x0)return[];return db[_0x935e('0xa1')][_0x935e('0x46')](_0x4f771f[_0x935e('0xa0')](),_0x4f4210)[_0x935e('0x2b')](function(_0x2de46d){_0x5322aa=_[_0x935e('0xa2')](_0x2de46d,'id');_0x4f4210=_[_0x935e('0xa3')](_0x4f4210,{'model':db[_0x935e('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12ffc8[_0x935e('0x46')][_0x935e('0x4a')]){_0x9e250a[_0x935e('0x49')][_0x935e('0x73')](function(_0x521d57){_0x18ebe7[_0x935e('0x51')]('i.'+_0x521d57);});}else{_0x18ebe7[_0x935e('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x935e('0x67'));_0x18ebe7[_0x935e('0x51')]('a.key','Account.key');_0x18ebe7[_0x935e('0x51')](_0x935e('0xa4'),_0x935e('0xa5'));_0x18ebe7[_0x935e('0x51')]('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',_0x935e('0x97'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xa6'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xa7'),_0x935e('0xa8'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xa9'),_0x935e('0xaa'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xab'),_0x935e('0xac'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xad'),_0x935e('0xae'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xaf'),'Contact.mobile');_0x18ebe7[_0x935e('0x51')]('c.fax',_0x935e('0xb0'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xb1'),'Owner.fullname');_0x18ebe7[_0x935e('0x51')](_0x935e('0xb2'),_0x935e('0xb3'));_0x18ebe7[_0x935e('0x51')](_0x935e('0xb4'),_0x935e('0x32'));}if(_0x9e250a[_0x935e('0x24')])_0x18ebe7['limit'](_0x9e250a[_0x935e('0x24')]);if(_0x9e250a[_0x935e('0x4d')])_0x18ebe7[_0x935e('0x4d')](_0x9e250a['offset']);return db['sequelize'][_0x935e('0x46')](_0x18ebe7[_0x935e('0xa0')](),_0x4f4210);})['then'](function(_0x1f9668){if(_0x1f9668[_0x935e('0x4b')]>0x0)_0x5c0a02[_0x935e('0x50')]('ui.FaxInteractionId\x20IN\x20?',_[_0x935e('0x30')](_0x1f9668,'id'));return db[_0x935e('0xa1')][_0x935e('0x46')](_0x5c0a02[_0x935e('0xa0')](),_0x4f4210)[_0x935e('0x2b')](function(_0x45beee){var _0x311541=_['groupBy'](_0x45beee,_0x935e('0xb5'));var _0x125a1d=[];_0x1f9668[_0x935e('0x73')](function(_0xff6c08){_0x125a1d['push'](updateFaxInteraction(_0xff6c08,_0x5322aa,_0x311541));});return BPromise[_0x935e('0xb6')](_0x125a1d);});});})[_0x935e('0x2b')](function(_0x162ea3){_0x5e853c['rows']=_0x162ea3;return _0x5e853c;})[_0x935e('0x2b')](respondWithFilteredResult(_0x2aca3c,_0x9e250a))[_0x935e('0x36')](handleError(_0x2aca3c,null));};exports[_0x935e('0xb7')]=function(_0x5d06ba,_0x19df6e){var _0x266e69={'raw':![],'where':{'id':_0x5d06ba[_0x935e('0xb8')]['id']}},_0x2711da={};_0x2711da[_0x935e('0x44')]=_[_0x935e('0x45')](db[_0x935e('0x3f')]['rawAttributes']);_0x2711da[_0x935e('0x46')]=_[_0x935e('0x45')](_0x5d06ba[_0x935e('0x46')]);_0x2711da[_0x935e('0x47')]=_[_0x935e('0x48')](_0x2711da[_0x935e('0x44')],_0x2711da['query']);_0x266e69[_0x935e('0x49')]=_['intersection'](_0x2711da[_0x935e('0x44')],qs[_0x935e('0x4a')](_0x5d06ba[_0x935e('0x46')][_0x935e('0x4a')]));_0x266e69[_0x935e('0x49')]=_0x266e69[_0x935e('0x49')]['length']?_0x266e69[_0x935e('0x49')]:_0x2711da[_0x935e('0x44')];if(_0x5d06ba['query']['includeAll']){_0x266e69[_0x935e('0xb9')]=[{'all':!![]}];}_0x266e69=_['merge']({},_0x266e69,_0x5d06ba[_0x935e('0xba')]);return db[_0x935e('0x3f')][_0x935e('0x6f')](_0x266e69)[_0x935e('0x2b')](handleEntityNotFound(_0x19df6e,null))[_0x935e('0x2b')](respondWithResult(_0x19df6e,null))[_0x935e('0x36')](handleError(_0x19df6e,null));};exports[_0x935e('0xbb')]=function(_0x120dac,_0x251cdb){return db[_0x935e('0x3f')][_0x935e('0xbb')](_0x120dac[_0x935e('0x7b')],{})['then'](respondWithResult(_0x251cdb,0xc9))[_0x935e('0x36')](handleError(_0x251cdb,null));};exports[_0x935e('0x2a')]=function(_0x1ebe4d,_0xc7e675){if(_0x1ebe4d[_0x935e('0x7b')]['id']){delete _0x1ebe4d[_0x935e('0x7b')]['id'];}return db[_0x935e('0x3f')][_0x935e('0x6f')]({'where':{'id':_0x1ebe4d[_0x935e('0xb8')]['id']}})[_0x935e('0x2b')](handleEntityNotFound(_0xc7e675,null))[_0x935e('0x2b')](saveUpdates(_0x1ebe4d[_0x935e('0x7b')],null))[_0x935e('0x2b')](respondWithResult(_0xc7e675,null))[_0x935e('0x36')](handleError(_0xc7e675,null));};exports[_0x935e('0xbc')]=function(_0x55476f,_0x386df1){return db[_0x935e('0x3f')][_0x935e('0x6f')]({'where':{'id':_0x55476f[_0x935e('0xb8')]['id']}})[_0x935e('0x2b')](handleEntityNotFound(_0x386df1,null))['then'](removeEntity(_0x386df1,null))[_0x935e('0x36')](handleError(_0x386df1,null));};exports['describe']=function(_0x256c6f,_0x23a657){return db[_0x935e('0x3f')][_0x935e('0xbd')]()[_0x935e('0x2b')](respondWithResult(_0x23a657,null))[_0x935e('0x36')](handleError(_0x23a657,null));};exports['addMessage']=function(_0xfde96a,_0x2c744d,_0x3c0590){return db[_0x935e('0xbe')][_0x935e('0x6f')]({'where':{'id':_0xfde96a[_0x935e('0xb8')]['id']}})[_0x935e('0x2b')](handleEntityNotFound(_0x2c744d,null))['then'](function(_0x368ef3){if(_0x368ef3){return _0x368ef3[_0x935e('0xbf')](_0xfde96a[_0x935e('0x7b')][_0x935e('0xc0')],_[_0x935e('0xc1')](_0xfde96a[_0x935e('0x7b')],[_0x935e('0xc0'),'id'])||{});}})[_0x935e('0x2b')](respondWithResult(_0x2c744d,null))[_0x935e('0x36')](handleError(_0x2c744d,null));};exports[_0x935e('0xc2')]=function(_0x422aec,_0x5bb108,_0x5eaabf){var _0x23f43f={'raw':![],'where':{}};var _0x38fe10={};var _0xbd95de={'count':0x0,'rows':[]};return db[_0x935e('0x3f')][_0x935e('0xc3')]({'where':{'id':_0x422aec[_0x935e('0xb8')]['id']}})[_0x935e('0x2b')](handleEntityNotFound(_0x5bb108,null))['then'](function(_0x5b5db1){if(_0x5b5db1){_0x38fe10[_0x935e('0x44')]=_['keys'](db['FaxMessage'][_0x935e('0x40')]);_0x38fe10[_0x935e('0x46')]=_[_0x935e('0x45')](_0x422aec[_0x935e('0x46')]);_0x38fe10[_0x935e('0x47')]=_[_0x935e('0x48')](_0x38fe10['model'],_0x38fe10[_0x935e('0x46')]);_0x23f43f['attributes']=_['intersection'](_0x38fe10['model'],qs[_0x935e('0x4a')](_0x422aec[_0x935e('0x46')][_0x935e('0x4a')]));_0x23f43f[_0x935e('0x49')]=_0x23f43f[_0x935e('0x49')]['length']?_0x23f43f['attributes']:_0x38fe10[_0x935e('0x44')];if(!_0x422aec[_0x935e('0x46')][_0x935e('0x4c')]('nolimit')){_0x23f43f[_0x935e('0x24')]=qs[_0x935e('0x24')](_0x422aec[_0x935e('0x46')][_0x935e('0x24')]);_0x23f43f[_0x935e('0x4d')]=qs[_0x935e('0x4d')](_0x422aec[_0x935e('0x46')][_0x935e('0x4d')]);}_0x23f43f[_0x935e('0x4e')]=qs['sort'](_0x422aec[_0x935e('0x46')]['sort']);_0x23f43f[_0x935e('0x50')]=qs['filters'](_[_0x935e('0xc4')](_0x422aec[_0x935e('0x46')],_0x38fe10[_0x935e('0x47')]));_0x23f43f[_0x935e('0x50')]['FaxInteractionId']=_0x5b5db1['id'];if(_0x422aec[_0x935e('0x46')]['filter']){_0x23f43f['where']=_[_0x935e('0xa3')](_0x23f43f[_0x935e('0x50')],{'$or':_[_0x935e('0x30')](_0x23f43f[_0x935e('0x49')],function(_0xc6809a){var _0xbbb92f={};_0xbbb92f[_0xc6809a]={'$like':'%'+_0x422aec[_0x935e('0x46')]['filter']+'%'};return _0xbbb92f;})});}if(_0x422aec['query'][_0x935e('0x84')]){var _0x2aacc9=_0x422aec['query'][_0x935e('0x84')][_0x935e('0x33')](',');var _0x3a4c54={};_0x3a4c54[_0x2aacc9[0x0]]={'$gte':moment(_0x2aacc9[0x1])[_0x935e('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x23f43f[_0x935e('0x50')]=_[_0x935e('0xa3')](_0x23f43f[_0x935e('0x50')],_0x3a4c54);}_0x23f43f=_[_0x935e('0xa3')]({},_0x23f43f,_0x422aec[_0x935e('0xba')]);return db['FaxMessage'][_0x935e('0x23')]({'where':_0x23f43f['where']})['then'](function(_0x1b2648){_0xbd95de[_0x935e('0x23')]=_0x1b2648;if(_0x422aec[_0x935e('0x46')][_0x935e('0xc6')]){_0x23f43f[_0x935e('0xb9')]=[{'all':!![]}];}return db[_0x935e('0xbe')]['findAll'](_0x23f43f);})[_0x935e('0x2b')](function(_0x2d173b){_0xbd95de[_0x935e('0xc7')]=_0x2d173b;return _0xbd95de;});}})[_0x935e('0x2b')](respondWithFilteredResult(_0x5bb108,_0x23f43f))[_0x935e('0x36')](handleError(_0x5bb108,null));};exports['addTags']=function(_0x2bf553,_0x4ac5d5,_0x1e3ecc){return db[_0x935e('0x3f')]['find']({'where':{'id':_0x2bf553['params']['id']}})[_0x935e('0x2b')](handleEntityNotFound(_0x4ac5d5,null))['then'](function(_0x5508a5){if(_0x5508a5){return _0x5508a5['setTags'](_0x2bf553[_0x935e('0x7b')]['ids'],_['omit'](_0x2bf553[_0x935e('0x7b')],[_0x935e('0xc0'),'id'])||{})[_0x935e('0xc8')](function(){return db[_0x935e('0xc9')][_0x935e('0xca')]({'attributes':['id',_0x935e('0x2d'),'color'],'where':{'id':_0x2bf553['body'][_0x935e('0xc0')]}});})['then'](function(_0x3dc294){socket[_0x935e('0xcb')](_0x935e('0xcc'),{'id':Number(_0x2bf553[_0x935e('0xb8')]['id']),'tags':_0x3dc294||[]});return{'id':Number(_0x2bf553[_0x935e('0xb8')]['id']),'tags':_0x3dc294||[]};});}})[_0x935e('0x2b')](respondWithResult(_0x4ac5d5,null))[_0x935e('0x36')](handleError(_0x4ac5d5,null));};exports['removeTags']=function(_0x16d8e0,_0x3c52a6,_0x419b08){return db[_0x935e('0x3f')][_0x935e('0x6f')]({'where':{'id':_0x16d8e0[_0x935e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x3c52a6,null))[_0x935e('0x2b')](function(_0x705e3d){if(_0x705e3d){return _0x705e3d[_0x935e('0xcd')](_0x16d8e0[_0x935e('0x46')][_0x935e('0xc0')]);}})[_0x935e('0x2b')](respondWithStatusCode(_0x3c52a6,null))['catch'](handleError(_0x3c52a6,null));};exports[_0x935e('0xce')]=function(_0x3b685a,_0x19f40a){var _0x507de7=moment()['unix']()['toString']();var _0x27d194=path['join'](config[_0x935e('0xcf')],_0x935e('0xd0'),_0x935e('0xd1'),_0x935e('0xd2'));var _0x37f1ac=path[_0x935e('0xd3')](config['root'],_0x935e('0xd0'),'files',_0x935e('0xd4'));var _0x1ec5d2=path['join'](_0x27d194,_0x507de7);var _0x4a0fed=util['format']('transcript-%d-%s.zip',_0x3b685a['params']['id'],_0x507de7);var _0x29e8a3=path[_0x935e('0xd3')](_0x27d194,_0x4a0fed);var _0x3ea73f=[];_0x3ea73f[_0x935e('0x35')]({'model':db['Attachment'],'as':_0x935e('0xd5'),'raw':!![]});var _0x54f13b=[{'model':db[_0x935e('0xbe')],'as':_0x935e('0xd6'),'attributes':['id','body','createdAt'],'include':_0x3ea73f}];return db['FaxInteraction']['find']({'where':{'id':_0x3b685a[_0x935e('0xb8')]['id']},'include':_0x54f13b})[_0x935e('0x2b')](handleEntityNotFound(_0x19f40a,null))[_0x935e('0x2b')](function(_0x1dc9a3){if(_0x1dc9a3&&_0x1dc9a3[_0x935e('0xd6')]){var _0x3efb05=_0x1dc9a3['get']({'plain':!![]});fs['mkdirSync'](_0x1ec5d2);for(var _0x229641=0x0;_0x229641<_0x3efb05['Messages'][_0x935e('0x4b')];_0x229641++){var _0x13d8c0=_0x3efb05['Messages'][_0x229641][_0x935e('0xd5')];if(_0x13d8c0){var _0x293011=path[_0x935e('0xd3')](_0x37f1ac,_0x13d8c0[_0x935e('0xd7')]);if(fs[_0x935e('0xd8')](_0x293011)){fs[_0x935e('0xd9')](_0x293011)[_0x935e('0xda')](fs[_0x935e('0xdb')](path[_0x935e('0xd3')](_0x1ec5d2,_0x13d8c0['basename'])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x5d4157,_0x27f884){zipdir(_0x1ec5d2,{'saveTo':_0x29e8a3},function(_0x2fb003,_0x26952d){if(_0x2fb003)return _0x27f884(_0x2fb003);return _0x5d4157(_0x26952d);});})['then'](function(){return new BPromise(function(_0xb67227,_0x54851f){rimraf(_0x1ec5d2,function(_0x258f6c){if(_0x258f6c)_0x54851f(_0x258f6c);return _0xb67227();});});})[_0x935e('0x2b')](function(){return _0x19f40a[_0x935e('0xce')](_0x29e8a3,_0x4a0fed,function(_0x45f369){if(_0x45f369){console[_0x935e('0xdc')](_0x935e('0xdd'),_0x45f369);}else{fs[_0x935e('0xde')](_0x29e8a3);}});});});}else{return _0x19f40a['sendStatus'](0xc8);}})[_0x935e('0x36')](handleError(_0x19f40a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index bda2ac1..2adfd43 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 _0x2432=['setMaxListeners','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x185574,_0x380824){var _0x45d738=function(_0x31a966){while(--_0x31a966){_0x185574['push'](_0x185574['shift']());}};_0x45d738(++_0x380824);}(_0x2432,0x13c));var _0x2243=function(_0x3d7090,_0x1e656e){_0x3d7090=_0x3d7090-0x0;var _0x464acc=_0x2432[_0x3d7090];return _0x464acc;};'use strict';var EventEmitter=require(_0x2243('0x0'));var FaxInteraction=require(_0x2243('0x1'))['db'][_0x2243('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x2243('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2243('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2243('0x5')};function emitEvent(_0x39d9c1){return function(_0x93c18c,_0x57055b,_0x10e532){_0x93c18c[_0x2243('0x6')]({'attributes':['id'],'raw':!![]})[_0x2243('0x7')](function(_0x2bd71f){_0x93c18c['setDataValue'](_0x2243('0x8'),_0x2bd71f[_0x2243('0x9')](function(_0x283ef4){return{'id':_0x283ef4['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x93c18c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2243('0x7')](function(_0x7f1874){_0x93c18c[_0x2243('0xa')](_0x2243('0xb'),_0x7f1874['length']);FaxInteractionEvents[_0x2243('0xc')](_0x39d9c1+':'+_0x93c18c['id'],_0x93c18c);FaxInteractionEvents[_0x2243('0xc')](_0x39d9c1,_0x93c18c);_0x10e532(null);})[_0x2243('0xd')](_0x10e532(null));};}for(var e in events){if(events[_0x2243('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x2243('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x46b5=['events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x5ce0d6,_0x3059f3){var _0x14510a=function(_0x4db4ad){while(--_0x4db4ad){_0x5ce0d6['push'](_0x5ce0d6['shift']());}};_0x14510a(++_0x3059f3);}(_0x46b5,0x66));var _0x546b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x46b5[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x546b('0x0'));var FaxInteraction=require(_0x546b('0x1'))['db'][_0x546b('0x2')];var FaxMessage=require(_0x546b('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x546b('0x3')](0x0);var events={'afterCreate':_0x546b('0x4'),'afterUpdate':_0x546b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4557b1){return function(_0xda807c,_0x1cfcee,_0x3ed26a){_0xda807c[_0x546b('0x6')]({'attributes':['id'],'raw':!![]})[_0x546b('0x7')](function(_0x245559){_0xda807c[_0x546b('0x8')](_0x546b('0x9'),_0x245559['map'](function(_0x1ab503){return{'id':_0x1ab503['id']};}));return FaxMessage[_0x546b('0xa')]({'where':{'FaxInteractionId':_0xda807c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x546b('0x7')](function(_0x41866a){_0xda807c[_0x546b('0x8')](_0x546b('0xb'),_0x41866a[_0x546b('0xc')]);FaxInteractionEvents[_0x546b('0xd')](_0x4557b1+':'+_0xda807c['id'],_0xda807c);FaxInteractionEvents[_0x546b('0xd')](_0x4557b1,_0xda807c);_0x3ed26a(null);})[_0x546b('0xe')](_0x3ed26a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x546b('0xf')](e,emitEvent(event));}}module[_0x546b('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b4e1b0d..79d1683 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 _0x9672=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x590472,_0xc506d){var _0x390e38=function(_0x13744b){while(--_0x13744b){_0x590472['push'](_0x590472['shift']());}};_0x390e38(++_0xc506d);}(_0x9672,0xee));var _0x2967=function(_0xf63dff,_0x411c2c){_0xf63dff=_0xf63dff-0x0;var _0x252c13=_0x9672[_0xf63dff];return _0x252c13;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var logger=require('../../config/logger')(_0x2967('0x2'));var moment=require(_0x2967('0x3'));var BPromise=require(_0x2967('0x4'));var rp=require(_0x2967('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var attributes=require(_0x2967('0x8'));module['exports']=function(_0x4baad7,_0x24424d){return _0x4baad7[_0x2967('0x9')](_0x2967('0xa'),attributes,{'tableName':_0x2967('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bcd7e,_0xf353b6,_0x45ebae){if(_0x3bcd7e[_0x2967('0xc')]('closed')){_0x3bcd7e[_0x2967('0xd')]=moment()[_0x2967('0xe')](_0x2967('0xf'));}_0x45ebae(null,_0x3bcd7e);}}});}; \ No newline at end of file +var _0x9689=['format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','fax_interactions','changed','closed','closedAt'];(function(_0x246b4a,_0x544bc8){var _0x31fe68=function(_0x5c72dd){while(--_0x5c72dd){_0x246b4a['push'](_0x246b4a['shift']());}};_0x31fe68(++_0x544bc8);}(_0x9689,0xd4));var _0x9968=function(_0x44ea2b,_0x57b6fc){_0x44ea2b=_0x44ea2b-0x0;var _0x939105=_0x9689[_0x44ea2b];return _0x939105;};'use strict';var _=require('lodash');var util=require(_0x9968('0x0'));var logger=require('../../config/logger')(_0x9968('0x1'));var moment=require(_0x9968('0x2'));var BPromise=require(_0x9968('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9968('0x4'));var rimraf=require(_0x9968('0x5'));var config=require(_0x9968('0x6'));var attributes=require(_0x9968('0x7'));module['exports']=function(_0x1ba3af,_0xdf7da1){return _0x1ba3af['define']('FaxInteraction',attributes,{'tableName':_0x9968('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c02f1,_0x2e1b9a,_0x24393c){if(_0x1c02f1[_0x9968('0x9')](_0x9968('0xa'))){_0x1c02f1[_0x9968('0xb')]=moment()[_0x9968('0xc')](_0x9968('0xd'));}_0x24393c(null,_0x1c02f1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d1ab228..1c6ff37 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 _0x4993=['defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','limit','debug','stringify','AddTagsToFaxInteraction','find','where','ids','omit','body','spread','info','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4993,0x199));var _0x3499=function(_0x23ed5d,_0x25c460){_0x23ed5d=_0x23ed5d-0x0;var _0x12fbdd=_0x4993[_0x23ed5d];return _0x12fbdd;};'use strict';var _=require(_0x3499('0x0'));var util=require('util');var moment=require(_0x3499('0x1'));var BPromise=require('bluebird');var rs=require(_0x3499('0x2'));var fs=require('fs');var Redis=require(_0x3499('0x3'));var db=require(_0x3499('0x4'))['db'];var utils=require(_0x3499('0x5'));var logger=require(_0x3499('0x6'))(_0x3499('0x7'));var config=require(_0x3499('0x8'));var jayson=require(_0x3499('0x9'));var client=jayson[_0x3499('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3499('0xb')](config[_0x3499('0xc')],{'host':_0x3499('0xd'),'port':0x18eb});var socket=require(_0x3499('0xe'))(new Redis(config[_0x3499('0xc')]));require(_0x3499('0xf'))['register'](socket);function respondWithRpcPromise(_0x3374a3,_0x18bd17,_0x3e0ede){return new BPromise(function(_0x4b7212,_0x3cbfff){return client[_0x3499('0x10')](_0x3374a3,_0x3e0ede)[_0x3499('0x11')](function(_0x505d89){logger['info'](_0x3499('0x12'),_0x18bd17,_0x3499('0x13'));logger['debug'](_0x3499('0x14'),_0x18bd17,_0x3499('0x13'),JSON['stringify'](_0x505d89));if(_0x505d89[_0x3499('0x15')]){if(_0x505d89['error'][_0x3499('0x16')]===0x1f4){logger['error'](_0x3499('0x12'),_0x18bd17,_0x505d89['error'][_0x3499('0x17')]);return _0x3cbfff(_0x505d89['error']['message']);}logger['error'](_0x3499('0x12'),_0x18bd17,_0x505d89[_0x3499('0x15')][_0x3499('0x17')]);return _0x4b7212(_0x505d89['error'][_0x3499('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x18bd17,_0x3499('0x13'));_0x4b7212(_0x505d89['result'][_0x3499('0x17')]);}})[_0x3499('0x18')](function(_0x8414fb){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x18bd17,_0x8414fb);_0x3cbfff(_0x8414fb);});});}exports[_0x3499('0x19')]=function(_0x441db3){var _0x3168a0=this;return new Promise(function(_0x3d2b08,_0x21f7ca){return db[_0x3499('0x1a')][_0x3499('0x1b')](_0x441db3['body'],{'raw':_0x441db3[_0x3499('0x1c')]?_0x441db3[_0x3499('0x1c')][_0x3499('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441db3[_0x3499('0x1c')]?_0x441db3['options']['where']||null:null,'attributes':_0x441db3[_0x3499('0x1c')]?_0x441db3['options']['attributes']||null:null,'limit':_0x441db3['options']?_0x441db3['options'][_0x3499('0x1e')]||null:null})['then'](function(_0x540d9c){logger['info']('UpdateFaxInteraction',_0x441db3);logger[_0x3499('0x1f')](_0x3499('0x19'),_0x441db3,JSON[_0x3499('0x20')](_0x540d9c));_0x3d2b08(_0x540d9c);})['catch'](function(_0x3046df){logger[_0x3499('0x15')](_0x3499('0x19'),_0x3046df[_0x3499('0x17')],_0x441db3);_0x21f7ca(_0x3168a0['error'](0x1f4,_0x3046df[_0x3499('0x17')]));});});};exports[_0x3499('0x21')]=function(_0x760482){return new Promise(function(_0x6a5bf8,_0x370d7c){return db['FaxInteraction'][_0x3499('0x22')]({'where':_0x760482[_0x3499('0x1c')]?_0x760482[_0x3499('0x1c')][_0x3499('0x23')]||null:null})[_0x3499('0x11')](function(_0x281207){if(_0x281207){return _0x281207['addTags'](_0x760482['body'][_0x3499('0x24')],_[_0x3499('0x25')](_0x760482[_0x3499('0x26')],[_0x3499('0x24'),'id'])||{});}})[_0x3499('0x27')](function(_0x70aa8b){logger[_0x3499('0x28')](_0x3499('0x29'),_0x760482);logger[_0x3499('0x1f')](_0x3499('0x29'),_0x760482,JSON[_0x3499('0x20')](_0x70aa8b));_0x6a5bf8(_0x70aa8b);})['catch'](function(_0x111292){logger[_0x3499('0x15')]('AddTags',_0x111292[_0x3499('0x17')],_0x760482);_0x370d7c(_this[_0x3499('0x15')](0x1f4,_0x111292[_0x3499('0x17')]));});});}; \ No newline at end of file +var _0x60a3=['util','moment','bluebird','ioredis','../../config/logger','client','http','redis','socket.io-emitter','./faxInteraction.socket','register','request','then','info','debug','request\x20sent','error','message','result','catch','FaxInteraction,\x20%s,\x20%s','update','body','options','where','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x239583,_0x3f26cc){var _0x2dcb82=function(_0x4b1da2){while(--_0x4b1da2){_0x239583['push'](_0x239583['shift']());}};_0x2dcb82(++_0x3f26cc);}(_0x60a3,0xd2));var _0x360a=function(_0x511877,_0x547752){_0x511877=_0x511877-0x0;var _0x5b47f6=_0x60a3[_0x511877];return _0x5b47f6;};'use strict';var _=require('lodash');var util=require(_0x360a('0x0'));var moment=require(_0x360a('0x1'));var BPromise=require(_0x360a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x360a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x360a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x360a('0x5')][_0x360a('0x6')]({'port':0x232a});config[_0x360a('0x7')]=_['defaults'](config[_0x360a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x360a('0x8'))(new Redis(config[_0x360a('0x7')]));require(_0x360a('0x9'))[_0x360a('0xa')](socket);function respondWithRpcPromise(_0x555506,_0x4b025f,_0x2045e3){return new BPromise(function(_0x3db280,_0x4f8543){return client[_0x360a('0xb')](_0x555506,_0x2045e3)[_0x360a('0xc')](function(_0x215524){logger[_0x360a('0xd')]('FaxInteraction,\x20%s,\x20%s',_0x4b025f,'request\x20sent');logger[_0x360a('0xe')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4b025f,_0x360a('0xf'),JSON['stringify'](_0x215524));if(_0x215524[_0x360a('0x10')]){if(_0x215524[_0x360a('0x10')]['code']===0x1f4){logger[_0x360a('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x4b025f,_0x215524[_0x360a('0x10')][_0x360a('0x11')]);return _0x4f8543(_0x215524['error'][_0x360a('0x11')]);}logger[_0x360a('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x4b025f,_0x215524[_0x360a('0x10')][_0x360a('0x11')]);return _0x3db280(_0x215524[_0x360a('0x10')]['message']);}else{logger[_0x360a('0xd')]('FaxInteraction,\x20%s,\x20%s',_0x4b025f,_0x360a('0xf'));_0x3db280(_0x215524[_0x360a('0x12')]['message']);}})[_0x360a('0x13')](function(_0x5a1369){logger[_0x360a('0x10')](_0x360a('0x14'),_0x4b025f,_0x5a1369);_0x4f8543(_0x5a1369);});});}exports['UpdateFaxInteraction']=function(_0x46e7d3){var _0x334038=this;return new Promise(function(_0x3a3e2f,_0x2dccae){return db['FaxInteraction'][_0x360a('0x15')](_0x46e7d3[_0x360a('0x16')],{'raw':_0x46e7d3[_0x360a('0x17')]?_0x46e7d3[_0x360a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e7d3[_0x360a('0x17')]?_0x46e7d3[_0x360a('0x17')][_0x360a('0x18')]||null:null,'attributes':_0x46e7d3[_0x360a('0x17')]?_0x46e7d3[_0x360a('0x17')]['attributes']||null:null,'limit':_0x46e7d3['options']?_0x46e7d3[_0x360a('0x17')]['limit']||null:null})[_0x360a('0xc')](function(_0x41bbe4){logger[_0x360a('0xd')](_0x360a('0x19'),_0x46e7d3);logger[_0x360a('0xe')]('UpdateFaxInteraction',_0x46e7d3,JSON[_0x360a('0x1a')](_0x41bbe4));_0x3a3e2f(_0x41bbe4);})[_0x360a('0x13')](function(_0x34450b){logger[_0x360a('0x10')](_0x360a('0x19'),_0x34450b[_0x360a('0x11')],_0x46e7d3);_0x2dccae(_0x334038[_0x360a('0x10')](0x1f4,_0x34450b[_0x360a('0x11')]));});});};exports[_0x360a('0x1b')]=function(_0x1c40f0){return new Promise(function(_0xde00f7,_0x7945f){return db[_0x360a('0x1c')][_0x360a('0x1d')]({'where':_0x1c40f0[_0x360a('0x17')]?_0x1c40f0['options'][_0x360a('0x18')]||null:null})[_0x360a('0xc')](function(_0x21f449){if(_0x21f449){return _0x21f449[_0x360a('0x1e')](_0x1c40f0[_0x360a('0x16')][_0x360a('0x1f')],_[_0x360a('0x20')](_0x1c40f0[_0x360a('0x16')],[_0x360a('0x1f'),'id'])||{});}})[_0x360a('0x21')](function(_0xe7969c){logger[_0x360a('0xd')](_0x360a('0x22'),_0x1c40f0);logger['debug'](_0x360a('0x22'),_0x1c40f0,JSON[_0x360a('0x1a')](_0xe7969c));_0xde00f7(_0xe7969c);})[_0x360a('0x13')](function(_0x16e541){logger[_0x360a('0x10')](_0x360a('0x22'),_0x16e541[_0x360a('0x11')],_0x1c40f0);_0x7945f(_this[_0x360a('0x10')](0x1f4,_0x16e541[_0x360a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 5ef7c92..7ef78f3 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 _0xf0c4=['./faxInteraction.events','remove','update','length','faxInteraction:'];(function(_0x45cb5f,_0x2113f8){var _0x3a3da2=function(_0x56881b){while(--_0x56881b){_0x45cb5f['push'](_0x45cb5f['shift']());}};_0x3a3da2(++_0x2113f8);}(_0xf0c4,0x17c));var _0x4f0c=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xf0c4[_0x54b062];return _0x255e41;};'use strict';var FaxInteractionEvents=require(_0x4f0c('0x0'));var events=['save',_0x4f0c('0x1'),_0x4f0c('0x2')];function createListener(_0x4ea327,_0x49c5eb){return function(_0x3bbf61){_0x49c5eb['emit'](_0x4ea327,_0x3bbf61);};}function removeListener(_0x4c8cb5,_0xa6ad09){return function(){FaxInteractionEvents['removeListener'](_0x4c8cb5,_0xa6ad09);};}exports['register']=function(_0x5b5b5d){for(var _0x5bc45d=0x0,_0x404448=events[_0x4f0c('0x3')];_0x5bc45d<_0x404448;_0x5bc45d++){var _0x5bd308=events[_0x5bc45d];var _0xeeb88f=createListener(_0x4f0c('0x4')+_0x5bd308,_0x5b5b5d);FaxInteractionEvents['on'](_0x5bd308,_0xeeb88f);}}; \ No newline at end of file +var _0x0970=['./faxInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x4060e2,_0x4ff45e){var _0x16e715=function(_0x2d46fa){while(--_0x2d46fa){_0x4060e2['push'](_0x4060e2['shift']());}};_0x16e715(++_0x4ff45e);}(_0x0970,0x12d));var _0x0097=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0970[_0x40a045];return _0x1a687c;};'use strict';var FaxInteractionEvents=require(_0x0097('0x0'));var events=[_0x0097('0x1'),_0x0097('0x2'),_0x0097('0x3')];function createListener(_0xc3440,_0x295b6d){return function(_0x3e8456){_0x295b6d[_0x0097('0x4')](_0xc3440,_0x3e8456);};}function removeListener(_0x6ff9c5,_0x4eda63){return function(){FaxInteractionEvents[_0x0097('0x5')](_0x6ff9c5,_0x4eda63);};}exports['register']=function(_0x486ba0){for(var _0x20c753=0x0,_0x11687=events[_0x0097('0x6')];_0x20c753<_0x11687;_0x20c753++){var _0x322c77=events[_0x20c753];var _0x2c1315=createListener('faxInteraction:'+_0x322c77,_0x486ba0);FaxInteractionEvents['on'](_0x322c77,_0x2c1315);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 184cd5a..56cb05b 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 _0x27bb=['tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags'];(function(_0x14a05c,_0x304800){var _0x4199e=function(_0x4c95b7){while(--_0x4c95b7){_0x14a05c['push'](_0x14a05c['shift']());}};_0x4199e(++_0x304800);}(_0x27bb,0x19f));var _0xb27b=function(_0x4500fb,_0x1db8d1){_0x4500fb=_0x4500fb-0x0;var _0x1db173=_0x27bb[_0x4500fb];return _0x1db173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb27b('0x0'));var timeout=require(_0xb27b('0x1'));var express=require(_0xb27b('0x2'));var router=express['Router']();var fs_extra=require(_0xb27b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb27b('0x4'));var config=require(_0xb27b('0x5'));var controller=require(_0xb27b('0x6'));router[_0xb27b('0x7')]('/',auth[_0xb27b('0x8')](),controller['index']);router['get'](_0xb27b('0x9'),auth[_0xb27b('0x8')](),controller[_0xb27b('0xa')]);router[_0xb27b('0x7')](_0xb27b('0xb'),auth['isAuthenticated'](),controller[_0xb27b('0xc')]);router[_0xb27b('0x7')](_0xb27b('0xd'),auth[_0xb27b('0x8')](),controller[_0xb27b('0xe')]);router[_0xb27b('0x7')](_0xb27b('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xb27b('0x10')]('/',auth[_0xb27b('0x8')](),controller[_0xb27b('0x11')]);router['post'](_0xb27b('0xd'),auth[_0xb27b('0x8')](),controller['addMessage']);router[_0xb27b('0x10')](_0xb27b('0x12'),auth[_0xb27b('0x8')](),interaction[_0xb27b('0x13')](_0xb27b('0x14'),_0xb27b('0x15')),controller[_0xb27b('0x16')]);router[_0xb27b('0x17')]('/:id',auth[_0xb27b('0x8')](),interaction['tracked'](_0xb27b('0x14'),_0xb27b('0x18')),controller[_0xb27b('0x19')]);router[_0xb27b('0x1a')](_0xb27b('0xb'),auth[_0xb27b('0x8')](),interaction[_0xb27b('0x13')](_0xb27b('0x14'),_0xb27b('0x1b')),controller[_0xb27b('0x1c')]);router[_0xb27b('0x1a')]('/:id/tags',auth[_0xb27b('0x8')](),controller[_0xb27b('0x1d')]);module[_0xb27b('0x1e')]=router; \ No newline at end of file +var _0x6d2a=['path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','fax','put','/:id','tracked','update','delete','faxinteraction:destroy','destroy','exports','multer','util'];(function(_0x1304ef,_0x5a1e5c){var _0x3289d8=function(_0x429567){while(--_0x429567){_0x1304ef['push'](_0x1304ef['shift']());}};_0x3289d8(++_0x5a1e5c);}(_0x6d2a,0x12a));var _0xa6d2=function(_0x56b04e,_0x471ebc){_0x56b04e=_0x56b04e-0x0;var _0x4149b9=_0x6d2a[_0x56b04e];return _0x4149b9;};'use strict';var multer=require(_0xa6d2('0x0'));var util=require(_0xa6d2('0x1'));var path=require(_0xa6d2('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6d2('0x3'));var router=express['Router']();var fs_extra=require(_0xa6d2('0x4'));var auth=require(_0xa6d2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa6d2('0x6'));var controller=require('./faxInteraction.controller');router[_0xa6d2('0x7')]('/',auth[_0xa6d2('0x8')](),controller[_0xa6d2('0x9')]);router[_0xa6d2('0x7')](_0xa6d2('0xa'),auth[_0xa6d2('0x8')](),controller[_0xa6d2('0xb')]);router[_0xa6d2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa6d2('0xc')]);router[_0xa6d2('0x7')](_0xa6d2('0xd'),auth['isAuthenticated'](),controller[_0xa6d2('0xe')]);router[_0xa6d2('0x7')](_0xa6d2('0xf'),auth['isAuthenticated'](),controller[_0xa6d2('0x10')]);router[_0xa6d2('0x11')]('/',auth['isAuthenticated'](),controller[_0xa6d2('0x12')]);router[_0xa6d2('0x11')](_0xa6d2('0xd'),auth[_0xa6d2('0x8')](),controller[_0xa6d2('0x13')]);router[_0xa6d2('0x11')](_0xa6d2('0x14'),auth[_0xa6d2('0x8')](),interaction['tracked'](_0xa6d2('0x15'),'faxinteraction:addtags'),controller['addTags']);router[_0xa6d2('0x16')](_0xa6d2('0x17'),auth[_0xa6d2('0x8')](),interaction[_0xa6d2('0x18')]('fax','faxinteraction:update'),controller[_0xa6d2('0x19')]);router[_0xa6d2('0x1a')](_0xa6d2('0x17'),auth[_0xa6d2('0x8')](),interaction[_0xa6d2('0x18')](_0xa6d2('0x15'),_0xa6d2('0x1b')),controller[_0xa6d2('0x1c')]);router[_0xa6d2('0x1a')]('/:id/tags',auth[_0xa6d2('0x8')](),controller['removeTags']);module[_0xa6d2('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 6152b2e..dd80789 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 _0x22fb=['ENUM','out','TEXT','BOOLEAN'];(function(_0x2d595e,_0x1301ad){var _0x461b02=function(_0x320dfe){while(--_0x320dfe){_0x2d595e['push'](_0x2d595e['shift']());}};_0x461b02(++_0x1301ad);}(_0x22fb,0x192));var _0xb22f=function(_0x5f1898,_0x160136){_0x5f1898=_0x5f1898-0x0;var _0xb15436=_0x22fb[_0x5f1898];return _0xb15436;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb22f('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb22f('0x2')]('in',_0xb22f('0x3')),'defaultValue':_0xb22f('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xcb99=['TEXT','ENUM','out','DATE','sequelize'];(function(_0x1c1eed,_0x2114f3){var _0x4aa260=function(_0x24bc0d){while(--_0x24bc0d){_0x1c1eed['push'](_0x1c1eed['shift']());}};_0x4aa260(++_0x2114f3);}(_0xcb99,0x8b));var _0x9cb9=function(_0x54c191,_0x4a04ef){_0x54c191=_0x54c191-0x0;var _0x40ee4a=_0xcb99[_0x54c191];return _0x40ee4a;};'use strict';var Sequelize=require(_0x9cb9('0x0'));module['exports']={'body':{'type':Sequelize[_0x9cb9('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9cb9('0x2')]('in',_0x9cb9('0x3')),'defaultValue':_0x9cb9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x9cb9('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index c91f49c..b6ba5de 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 _0xfd5c=['rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','basename','download','join','server','attachments','Attachment','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','info','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','fax-interactions','null','RejectMessage','rejectMessage','SELECT','email'];(function(_0x316e16,_0x2c2cd0){var _0x21950c=function(_0x7cdb26){while(--_0x7cdb26){_0x316e16['push'](_0x316e16['shift']());}};_0x21950c(++_0x2c2cd0);}(_0xfd5c,0x12c));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcfd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfd5('0x1'));var jsonpatch=require(_0xcfd5('0x2'));var rp=require(_0xcfd5('0x3'));var moment=require(_0xcfd5('0x4'));var BPromise=require(_0xcfd5('0x5'));var Mustache=require(_0xcfd5('0x6'));var util=require(_0xcfd5('0x7'));var path=require(_0xcfd5('0x8'));var sox=require(_0xcfd5('0x9'));var csv=require('to-csv');var ejs=require(_0xcfd5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfd5('0xb'));var squel=require(_0xcfd5('0xc'));var crypto=require(_0xcfd5('0xd'));var jsforce=require(_0xcfd5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcfd5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcfd5('0x10'));var as=require(_0xcfd5('0x11'));var hardwareService=require(_0xcfd5('0x12'));var logger=require(_0xcfd5('0x13'))('api');var utils=require(_0xcfd5('0x14'));var config=require(_0xcfd5('0x15'));var licenseUtil=require(_0xcfd5('0x16'));var db=require(_0xcfd5('0x17'))['db'];config[_0xcfd5('0x18')]=_[_0xcfd5('0x19')](config[_0xcfd5('0x18')],{'host':_0xcfd5('0x1a'),'port':0x18eb});var socket=require(_0xcfd5('0x1b'))(new Redis(config['redis']));require(_0xcfd5('0x1c'))[_0xcfd5('0x1d')](socket);var jayson=require(_0xcfd5('0x1e'));var client=jayson['client'][_0xcfd5('0x1f')]({'port':0x232c});var client9002=jayson[_0xcfd5('0x20')][_0xcfd5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xb1faf3,_0x3541b5,_0x1f63d7,_0x171e96){return new BPromise(function(_0x292937,_0x24571f){var _0x25161b=_0x171e96||client;return _0x25161b[_0xcfd5('0x21')](_0xb1faf3,_0x1f63d7)[_0xcfd5('0x22')](function(_0x51e248){logger['info'](_0xcfd5('0x23'),_0x3541b5,_0xcfd5('0x24'));logger[_0xcfd5('0x25')](_0xcfd5('0x26'),_0x3541b5,'request\x20sent',JSON[_0xcfd5('0x27')](_0x51e248));if(_0x51e248['error']){if(_0x51e248['error'][_0xcfd5('0x28')]===0x1f4){logger[_0xcfd5('0x29')](_0xcfd5('0x23'),_0x3541b5,_0x51e248['error'][_0xcfd5('0x2a')]);return _0x24571f(_0x51e248[_0xcfd5('0x29')][_0xcfd5('0x2a')]);}logger[_0xcfd5('0x29')](_0xcfd5('0x23'),_0x3541b5,_0x51e248[_0xcfd5('0x29')][_0xcfd5('0x2a')]);return _0x292937(_0x51e248[_0xcfd5('0x29')]['message']);}else{logger['info'](_0xcfd5('0x23'),_0x3541b5,'request\x20sent');_0x292937(_0x51e248[_0xcfd5('0x2b')][_0xcfd5('0x2a')]);}})[_0xcfd5('0x2c')](function(_0xa138c3){logger[_0xcfd5('0x29')](_0xcfd5('0x23'),_0x3541b5,_0xa138c3);_0x24571f(_0xa138c3);});});}function respondWithStatusCode(_0x2cbcce,_0x14fcff){_0x14fcff=_0x14fcff||0xcc;return function(_0x11580b){if(_0x11580b){return _0x2cbcce[_0xcfd5('0x2d')](_0x14fcff);}return _0x2cbcce[_0xcfd5('0x2e')](_0x14fcff)[_0xcfd5('0x2f')]();};}function respondWithResult(_0x329b42,_0x234c10){_0x234c10=_0x234c10||0xc8;return function(_0x11a20a){if(_0x11a20a){return _0x329b42[_0xcfd5('0x2e')](_0x234c10)[_0xcfd5('0x30')](_0x11a20a);}};}function respondWithFilteredResult(_0x339d41,_0x3fd458){return function(_0x38ff5e){if(_0x38ff5e){var _0x246dc0=typeof _0x3fd458[_0xcfd5('0x31')]==='undefined'&&typeof _0x3fd458[_0xcfd5('0x32')]===_0xcfd5('0x33');var _0x182ac9=_0x38ff5e[_0xcfd5('0x34')];var _0x479f0b=_0x246dc0?0x0:_0x3fd458[_0xcfd5('0x31')];var _0x573162=_0x246dc0?_0x38ff5e[_0xcfd5('0x34')]:_0x3fd458[_0xcfd5('0x31')]+_0x3fd458[_0xcfd5('0x32')];var _0x2f4876;if(_0x573162>=_0x182ac9){_0x573162=_0x182ac9;_0x2f4876=0xc8;}else{_0x2f4876=0xce;}_0x339d41[_0xcfd5('0x2e')](_0x2f4876);return _0x339d41[_0xcfd5('0x35')](_0xcfd5('0x36'),_0x479f0b+'-'+_0x573162+'/'+_0x182ac9)[_0xcfd5('0x30')](_0x38ff5e);}return null;};}function patchUpdates(_0x4f30e0){return function(_0x204304){try{jsonpatch['apply'](_0x204304,_0x4f30e0,!![]);}catch(_0x53606a){return BPromise[_0xcfd5('0x37')](_0x53606a);}return _0x204304[_0xcfd5('0x38')]();};}function saveUpdates(_0x2cfd91,_0x3616a3){return function(_0x2c5984){if(_0x2c5984){return _0x2c5984[_0xcfd5('0x39')](_0x2cfd91)[_0xcfd5('0x22')](function(_0x247a9e){return _0x247a9e;});}return null;};}function removeEntity(_0x351af0,_0xc2e5c8){return function(_0x8abc6){if(_0x8abc6){return _0x8abc6[_0xcfd5('0x3a')]()[_0xcfd5('0x22')](function(){_0x351af0[_0xcfd5('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2a88,_0x3a5466){return function(_0x1af399){if(!_0x1af399){_0x5c2a88[_0xcfd5('0x2d')](0x194);}return _0x1af399;};}function handleError(_0x1189d2,_0xb56481){_0xb56481=_0xb56481||0x1f4;return function(_0x33d7e9){logger[_0xcfd5('0x29')](_0x33d7e9['stack']);if(_0x33d7e9[_0xcfd5('0x3b')]){delete _0x33d7e9[_0xcfd5('0x3b')];}_0x1189d2['status'](_0xb56481)[_0xcfd5('0x3c')](_0x33d7e9);};}exports[_0xcfd5('0x3d')]=function(_0x925356,_0x79c04c){var _0x3f961c={},_0x14b3f1={},_0x25b5c4={'count':0x0,'rows':[]};var _0x5cb6b7=_[_0xcfd5('0x3e')](db[_0xcfd5('0x3f')][_0xcfd5('0x40')],function(_0x3527a9){return{'name':_0x3527a9[_0xcfd5('0x41')],'type':_0x3527a9[_0xcfd5('0x42')]['key']};});_0x14b3f1[_0xcfd5('0x43')]=_[_0xcfd5('0x3e')](_0x5cb6b7,_0xcfd5('0x3b'));_0x14b3f1['query']=_[_0xcfd5('0x44')](_0x925356[_0xcfd5('0x45')]);_0x14b3f1[_0xcfd5('0x46')]=_['intersection'](_0x14b3f1[_0xcfd5('0x43')],_0x14b3f1[_0xcfd5('0x45')]);_0x3f961c[_0xcfd5('0x47')]=_[_0xcfd5('0x48')](_0x14b3f1[_0xcfd5('0x43')],qs[_0xcfd5('0x49')](_0x925356['query'][_0xcfd5('0x49')]));_0x3f961c[_0xcfd5('0x47')]=_0x3f961c[_0xcfd5('0x47')][_0xcfd5('0x4a')]?_0x3f961c['attributes']:_0x14b3f1[_0xcfd5('0x43')];if(!_0x925356[_0xcfd5('0x45')]['hasOwnProperty'](_0xcfd5('0x4b'))){_0x3f961c[_0xcfd5('0x32')]=qs[_0xcfd5('0x32')](_0x925356[_0xcfd5('0x45')]['limit']);_0x3f961c[_0xcfd5('0x31')]=qs[_0xcfd5('0x31')](_0x925356[_0xcfd5('0x45')]['offset']);}_0x3f961c[_0xcfd5('0x4c')]=qs[_0xcfd5('0x4d')](_0x925356['query'][_0xcfd5('0x4d')]);_0x3f961c[_0xcfd5('0x4e')]=qs[_0xcfd5('0x46')](_[_0xcfd5('0x4f')](_0x925356['query'],_0x14b3f1[_0xcfd5('0x46')]),_0x5cb6b7);if(_0x925356[_0xcfd5('0x45')][_0xcfd5('0x50')]){_0x3f961c['where']=_[_0xcfd5('0x51')](_0x3f961c[_0xcfd5('0x4e')],{'$or':_[_0xcfd5('0x3e')](_0x5cb6b7,function(_0x2fb4f5){if(_0x2fb4f5['type']!==_0xcfd5('0x52')){var _0x35567b={};_0x35567b[_0x2fb4f5[_0xcfd5('0x3b')]]={'$like':'%'+_0x925356[_0xcfd5('0x45')][_0xcfd5('0x50')]+'%'};return _0x35567b;}})});}_0x3f961c=_['merge']({},_0x3f961c,_0x925356[_0xcfd5('0x53')]);var _0x4cbd4a={'where':_0x3f961c['where']};return db['FaxMessage'][_0xcfd5('0x34')](_0x4cbd4a)['then'](function(_0x48e448){_0x25b5c4[_0xcfd5('0x34')]=_0x48e448;if(_0x925356[_0xcfd5('0x45')][_0xcfd5('0x54')]){_0x3f961c[_0xcfd5('0x55')]=[{'all':!![]}];}return db[_0xcfd5('0x3f')][_0xcfd5('0x56')](_0x3f961c);})[_0xcfd5('0x22')](function(_0x1d4ce2){_0x25b5c4['rows']=_0x1d4ce2;return _0x25b5c4;})[_0xcfd5('0x22')](respondWithFilteredResult(_0x79c04c,_0x3f961c))[_0xcfd5('0x2c')](handleError(_0x79c04c,null));};exports[_0xcfd5('0x57')]=function(_0x222b52,_0xc8d9ef){var _0x4569fb={'raw':!![],'where':{'id':_0x222b52[_0xcfd5('0x58')]['id']}},_0x1422d7={};_0x1422d7[_0xcfd5('0x43')]=_[_0xcfd5('0x44')](db['FaxMessage']['rawAttributes']);_0x1422d7[_0xcfd5('0x45')]=_[_0xcfd5('0x44')](_0x222b52[_0xcfd5('0x45')]);_0x1422d7[_0xcfd5('0x46')]=_[_0xcfd5('0x48')](_0x1422d7[_0xcfd5('0x43')],_0x1422d7[_0xcfd5('0x45')]);_0x4569fb[_0xcfd5('0x47')]=_['intersection'](_0x1422d7[_0xcfd5('0x43')],qs['fields'](_0x222b52['query'][_0xcfd5('0x49')]));_0x4569fb[_0xcfd5('0x47')]=_0x4569fb['attributes']['length']?_0x4569fb[_0xcfd5('0x47')]:_0x1422d7[_0xcfd5('0x43')];if(_0x222b52[_0xcfd5('0x45')]['includeAll']){_0x4569fb[_0xcfd5('0x55')]=[{'all':!![]}];}_0x4569fb=_[_0xcfd5('0x51')]({},_0x4569fb,_0x222b52[_0xcfd5('0x53')]);return db[_0xcfd5('0x3f')][_0xcfd5('0x59')](_0x4569fb)[_0xcfd5('0x22')](handleEntityNotFound(_0xc8d9ef,null))[_0xcfd5('0x22')](respondWithResult(_0xc8d9ef,null))[_0xcfd5('0x2c')](handleError(_0xc8d9ef,null));};exports[_0xcfd5('0x39')]=function(_0x39ba69,_0x351472){if(_0x39ba69['body']['id']){delete _0x39ba69[_0xcfd5('0x5a')]['id'];}return db[_0xcfd5('0x3f')][_0xcfd5('0x59')]({'where':{'id':_0x39ba69[_0xcfd5('0x58')]['id']}})['then'](handleEntityNotFound(_0x351472,null))[_0xcfd5('0x22')](saveUpdates(_0x39ba69[_0xcfd5('0x5a')],null))[_0xcfd5('0x22')](respondWithResult(_0x351472,null))['catch'](handleError(_0x351472,null));};exports[_0xcfd5('0x3a')]=function(_0x587496,_0x42b230){return db[_0xcfd5('0x3f')]['find']({'where':{'id':_0x587496[_0xcfd5('0x58')]['id']}})[_0xcfd5('0x22')](handleEntityNotFound(_0x42b230,null))['then'](removeEntity(_0x42b230,null))[_0xcfd5('0x2c')](handleError(_0x42b230,null));};exports[_0xcfd5('0x5b')]=function(_0x553f6c,_0x82249c){return db[_0xcfd5('0x3f')]['describe']()[_0xcfd5('0x22')](respondWithResult(_0x82249c,null))['catch'](handleError(_0x82249c,null));};var interaction_log=require(_0xcfd5('0x13'))('fax-interactions');exports['accept']=function(_0x49fce5,_0x58d966,_0x1911a1){var _0x5b6da7={'agent':{},'channel':_0xcfd5('0x5c')};if(_0x49fce5[_0xcfd5('0x5a')]['id']){delete _0x49fce5[_0xcfd5('0x5a')]['id'];}_0x49fce5['body'][_0xcfd5('0x5d')]=!![];_0x49fce5[_0xcfd5('0x5a')][_0xcfd5('0x5e')]=moment()[_0xcfd5('0x5f')](_0xcfd5('0x60'));_0x49fce5[_0xcfd5('0x5a')]['UserId']=_0x49fce5[_0xcfd5('0x5a')][_0xcfd5('0x61')]||_0x49fce5[_0xcfd5('0x62')]['id'];_0x5b6da7[_0xcfd5('0x63')]['id']=_0x49fce5[_0xcfd5('0x5a')][_0xcfd5('0x61')];return db[_0xcfd5('0x3f')][_0xcfd5('0x59')]({'where':{'id':_0x49fce5['params']['id'],'UserId':null}})[_0xcfd5('0x22')](handleEntityNotFound(_0x58d966,null))[_0xcfd5('0x22')](saveUpdates(_0x49fce5[_0xcfd5('0x5a')],null))[_0xcfd5('0x22')](function(_0x23d7fc){if(_0x23d7fc){_0x5b6da7[_0xcfd5('0x2a')]=_0x23d7fc[_0xcfd5('0x64')]({'plain':!![]});return db[_0xcfd5('0x65')][_0xcfd5('0x59')]({'where':{'id':_0x23d7fc[_0xcfd5('0x66')]}});}return null;})[_0xcfd5('0x22')](handleEntityNotFound(_0x58d966,null))[_0xcfd5('0x22')](function(_0x5e2503){if(_0x5e2503){return _0x5e2503[_0xcfd5('0x39')]({'UserId':_0x49fce5['body'][_0xcfd5('0x61')],'read1stAt':_[_0xcfd5('0x67')](_0x5e2503[_0xcfd5('0x68')])?moment()[_0xcfd5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcfd5('0x22')](function(_0x362f25){if(_0x362f25){_0x5b6da7[_0xcfd5('0x69')]=_0x362f25['get']({'plain':!![]});interaction_log[_0xcfd5('0x6a')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x49fce5['user']['id'],_0x49fce5[_0xcfd5('0x62')][_0xcfd5('0x3b')],_0x49fce5[_0xcfd5('0x62')][_0xcfd5('0x6b')],_0x5b6da7[_0xcfd5('0x69')]['id'],_0x49fce5[_0xcfd5('0x5a')]?JSON['stringify'](_0x49fce5[_0xcfd5('0x5a')]):'null');return respondWithRpcPromise(_0xcfd5('0x6c'),_0xcfd5('0x6d'),_0x5b6da7);}return null;})[_0xcfd5('0x22')](function(_0x40d333){var _0x4773fc=_0xcfd5('0x6e')+_0x40d333['message'][_0xcfd5('0x6f')];return db['sequelize'][_0xcfd5('0x45')](_0x4773fc,{'type':db[_0xcfd5('0x70')][_0xcfd5('0x71')]['SELECT'],'raw':!![]})[_0xcfd5('0x22')](function(_0x401724){return _0x401724;});})[_0xcfd5('0x22')](function(_0x3a7fc7){if(_0x3a7fc7){_0x5b6da7[_0xcfd5('0x2a')][_0xcfd5('0x72')]=_0x3a7fc7[0x0];if(!_0x49fce5[_0xcfd5('0x5a')][_0xcfd5('0x61')])return;return db[_0xcfd5('0x73')]['find']({'where':{'id':_0x49fce5[_0xcfd5('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xcfd5('0x3b'),_0xcfd5('0x74'),'email',_0xcfd5('0x75')],'raw':!![]});}return null;})[_0xcfd5('0x22')](function(_0x11ea2f){if(!_0x11ea2f)return null;_0x5b6da7[_0xcfd5('0x2a')][_0xcfd5('0x63')]=_0x11ea2f;return _0x5b6da7;})['then'](function(_0x57243c){if(_0x57243c){if(_0x49fce5[_0xcfd5('0x5a')][_0xcfd5('0x76')]){_0x5b6da7[_0xcfd5('0x2a')][_0xcfd5('0x77')]=util[_0xcfd5('0x5f')](_0xcfd5('0x78'),_0x49fce5['user'][_0xcfd5('0x3b')]);_0x5b6da7[_0xcfd5('0x2a')][_0xcfd5('0x79')]=_0x5b6da7[_0xcfd5('0x79')];_0x5b6da7[_0xcfd5('0x2a')][_0xcfd5('0x7a')]=_0x5b6da7[_0xcfd5('0x79')];_0x5b6da7['message'][_0xcfd5('0x7b')]=_0xcfd5('0x7c');return respondWithRpcPromise(_0xcfd5('0x7d'),_0xcfd5('0x7d'),{'event':'acceptmessage','message':_0x5b6da7[_0xcfd5('0x2a')]},client9002)[_0xcfd5('0x22')](function(){return _0x5b6da7;});}return _0x5b6da7;}return null;})[_0xcfd5('0x22')](respondWithResult(_0x58d966,null))[_0xcfd5('0x2c')](handleError(_0x58d966,null));};var interaction_log=require('../../config/logger')(_0xcfd5('0x7e'));exports['reject']=function(_0x951657,_0x5abb64,_0x8a150f){var _0x410726={'agent':{},'channel':'fax'};if(_0x951657[_0xcfd5('0x5a')]['id']){delete _0x951657[_0xcfd5('0x5a')]['id'];}_0x951657[_0xcfd5('0x5a')][_0xcfd5('0x61')]=_0x951657['body'][_0xcfd5('0x61')]||_0x951657[_0xcfd5('0x62')]['id'];_0x410726[_0xcfd5('0x63')]['id']=_0x951657[_0xcfd5('0x5a')]['UserId'];return db[_0xcfd5('0x3f')][_0xcfd5('0x59')]({'where':{'id':_0x951657['params']['id'],'UserId':null}})[_0xcfd5('0x22')](handleEntityNotFound(_0x5abb64,null))['then'](function(_0x41ea78){if(_0x41ea78){_0x410726[_0xcfd5('0x2a')]=_0x41ea78[_0xcfd5('0x64')]({'plain':!![]});return db[_0xcfd5('0x65')][_0xcfd5('0x59')]({'where':{'id':_0x41ea78[_0xcfd5('0x66')]}});}return null;})[_0xcfd5('0x22')](handleEntityNotFound(_0x5abb64,null))[_0xcfd5('0x22')](function(_0x2c1335){if(_0x2c1335){_0x410726[_0xcfd5('0x69')]=_0x2c1335[_0xcfd5('0x64')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x951657[_0xcfd5('0x62')]['id'],_0x951657[_0xcfd5('0x62')][_0xcfd5('0x3b')],_0x951657[_0xcfd5('0x62')]['role'],_0x410726[_0xcfd5('0x69')]['id'],_0x951657[_0xcfd5('0x5a')]?JSON[_0xcfd5('0x27')](_0x951657[_0xcfd5('0x5a')]):_0xcfd5('0x7f'));return respondWithRpcPromise(_0xcfd5('0x80'),_0xcfd5('0x81'),_0x410726);}return null;})[_0xcfd5('0x22')](function(_0x5bb9df){var _0x100d07=_0xcfd5('0x6e')+_0x5bb9df[_0xcfd5('0x2a')]['ContactId'];return db['sequelize'][_0xcfd5('0x45')](_0x100d07,{'type':db[_0xcfd5('0x70')]['QueryTypes'][_0xcfd5('0x82')],'raw':!![]})['then'](function(_0x2bd1a0){return _0x2bd1a0;});})['then'](function(_0x3546e8){if(_0x3546e8){_0x410726['message'][_0xcfd5('0x72')]=_0x3546e8[0x0];if(!_0x951657[_0xcfd5('0x5a')][_0xcfd5('0x61')])return;return db[_0xcfd5('0x73')][_0xcfd5('0x59')]({'where':{'id':_0x951657[_0xcfd5('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name',_0xcfd5('0x74'),_0xcfd5('0x83'),'internal'],'raw':!![]});}return null;})[_0xcfd5('0x22')](function(_0x36b9e5){if(!_0x36b9e5)return null;_0x410726[_0xcfd5('0x2a')]['agent']=_0x36b9e5;return _0x410726;})[_0xcfd5('0x22')](function(_0x25f28f){if(_0x25f28f){_0x25f28f[_0xcfd5('0x2a')][_0xcfd5('0x77')]=util[_0xcfd5('0x5f')](_0xcfd5('0x78'),_0x951657[_0xcfd5('0x62')][_0xcfd5('0x3b')]);_0x25f28f[_0xcfd5('0x2a')][_0xcfd5('0x79')]=_0x410726['channel'];_0x25f28f['message'][_0xcfd5('0x7a')]=_0x410726['channel'];_0x25f28f['message'][_0xcfd5('0x7b')]=_0xcfd5('0x37');respondWithRpcPromise(_0xcfd5('0x7d'),_0xcfd5('0x7d'),{'event':_0xcfd5('0x84'),'message':_0x25f28f[_0xcfd5('0x2a')]},client9002);return _0x410726;}return null;})[_0xcfd5('0x22')](respondWithResult(_0x5abb64,null))['catch'](handleError(_0x5abb64,null));};exports[_0xcfd5('0x85')]=function(_0x498156,_0x9aae94){var _0x213989;return db[_0xcfd5('0x3f')][_0xcfd5('0x85')](_0x498156['body'],{})[_0xcfd5('0x22')](function(_0x44d4b4){_0x213989=_0x44d4b4;return db[_0xcfd5('0x86')][_0xcfd5('0x87')]({'where':{'id':_0x213989[_0xcfd5('0x6f')]}});})[_0xcfd5('0x22')](function(_0x1e2898){if(_[_0xcfd5('0x67')](_0x1e2898)){return;}else{_0x213989['fax']=_0x1e2898[_0xcfd5('0x5c')];return db['Attachment'][_0xcfd5('0x87')]({'where':{'id':_0x213989[_0xcfd5('0x88')]}});}})['then'](function(_0x7d87a4){return respondWithRpcPromise(_0xcfd5('0x89'),_0xcfd5('0x89'),{'FaxAccountId':_['isNil'](_0x498156[_0xcfd5('0x5a')])?undefined:_0x498156[_0xcfd5('0x5a')]['FaxAccountId'],'path':_[_0xcfd5('0x67')](_0x7d87a4)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x7d87a4[_0xcfd5('0x8a')]),'fax':_[_0xcfd5('0x67')](_0x213989[_0xcfd5('0x5c')])?undefined:_0x213989[_0xcfd5('0x5c')],'AttachmentId':_0x213989[_0xcfd5('0x88')]},client9002);})['then'](respondWithResult(_0x9aae94,0xc9))[_0xcfd5('0x2c')](handleError(_0x9aae94,null));};exports[_0xcfd5('0x8b')]=function(_0x8c0ebe,_0x2bad01){var _0x3d4a33=path[_0xcfd5('0x8c')](config['root'],_0xcfd5('0x8d'),'files',_0xcfd5('0x8e'));return db[_0xcfd5('0x3f')][_0xcfd5('0x59')]({'where':{'id':_0x8c0ebe[_0xcfd5('0x58')]['id']},'include':[{'model':db[_0xcfd5('0x8f')],'as':'Attachment'}]})[_0xcfd5('0x22')](handleEntityNotFound(_0x2bad01,null))[_0xcfd5('0x22')](function(_0x43571c){if(_0x43571c){return _0x2bad01[_0xcfd5('0x8b')](path['join'](_0x3d4a33,_0x43571c[_0xcfd5('0x8f')][_0xcfd5('0x8a')]));}})[_0xcfd5('0x2c')](handleError(_0x2bad01,null));}; \ No newline at end of file +var _0x53ee=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','params','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','QueryTypes','rejectmessage','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','server','files','basename','eml-format','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where'];(function(_0x170b20,_0x13bbc0){var _0x4f55f9=function(_0x3363db){while(--_0x3363db){_0x170b20['push'](_0x170b20['shift']());}};_0x4f55f9(++_0x13bbc0);}(_0x53ee,0xce));var _0xe53e=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x53ee[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0xe53e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe53e('0x1'));var moment=require('moment');var BPromise=require(_0xe53e('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe53e('0x3'));var sox=require(_0xe53e('0x4'));var csv=require(_0xe53e('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe53e('0x6'));var _=require(_0xe53e('0x7'));var squel=require(_0xe53e('0x8'));var crypto=require(_0xe53e('0x9'));var jsforce=require(_0xe53e('0xa'));var deskjs=require(_0xe53e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe53e('0xc'));var Papa=require(_0xe53e('0xd'));var Redis=require(_0xe53e('0xe'));var authService=require(_0xe53e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe53e('0x10'));var hardwareService=require(_0xe53e('0x11'));var logger=require(_0xe53e('0x12'))(_0xe53e('0x13'));var utils=require(_0xe53e('0x14'));var config=require(_0xe53e('0x15'));var licenseUtil=require(_0xe53e('0x16'));var db=require(_0xe53e('0x17'))['db'];config[_0xe53e('0x18')]=_[_0xe53e('0x19')](config[_0xe53e('0x18')],{'host':_0xe53e('0x1a'),'port':0x18eb});var socket=require(_0xe53e('0x1b'))(new Redis(config[_0xe53e('0x18')]));require(_0xe53e('0x1c'))[_0xe53e('0x1d')](socket);var jayson=require(_0xe53e('0x1e'));var client=jayson[_0xe53e('0x1f')][_0xe53e('0x20')]({'port':0x232c});var client9002=jayson[_0xe53e('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fcd0,_0x436a95,_0xa0aad6,_0x8f6d24){return new BPromise(function(_0x363d5c,_0xefb029){var _0x5bd0fb=_0x8f6d24||client;return _0x5bd0fb['request'](_0x57fcd0,_0xa0aad6)[_0xe53e('0x21')](function(_0x5e7e9c){logger[_0xe53e('0x22')](_0xe53e('0x23'),_0x436a95,'request\x20sent');logger[_0xe53e('0x24')](_0xe53e('0x25'),_0x436a95,_0xe53e('0x26'),JSON[_0xe53e('0x27')](_0x5e7e9c));if(_0x5e7e9c[_0xe53e('0x28')]){if(_0x5e7e9c[_0xe53e('0x28')][_0xe53e('0x29')]===0x1f4){logger[_0xe53e('0x28')]('FaxMessage,\x20%s,\x20%s',_0x436a95,_0x5e7e9c[_0xe53e('0x28')]['message']);return _0xefb029(_0x5e7e9c['error'][_0xe53e('0x2a')]);}logger['error'](_0xe53e('0x23'),_0x436a95,_0x5e7e9c[_0xe53e('0x28')][_0xe53e('0x2a')]);return _0x363d5c(_0x5e7e9c['error'][_0xe53e('0x2a')]);}else{logger['info'](_0xe53e('0x23'),_0x436a95,_0xe53e('0x26'));_0x363d5c(_0x5e7e9c['result']['message']);}})[_0xe53e('0x2b')](function(_0x1a9f0f){logger['error'](_0xe53e('0x23'),_0x436a95,_0x1a9f0f);_0xefb029(_0x1a9f0f);});});}function respondWithStatusCode(_0x371787,_0x4eb579){_0x4eb579=_0x4eb579||0xcc;return function(_0x242953){if(_0x242953){return _0x371787[_0xe53e('0x2c')](_0x4eb579);}return _0x371787['status'](_0x4eb579)['end']();};}function respondWithResult(_0x48e619,_0x13f5bc){_0x13f5bc=_0x13f5bc||0xc8;return function(_0x3fbc8f){if(_0x3fbc8f){return _0x48e619[_0xe53e('0x2d')](_0x13f5bc)[_0xe53e('0x2e')](_0x3fbc8f);}};}function respondWithFilteredResult(_0x425315,_0x2fb5f6){return function(_0x4fe8db){if(_0x4fe8db){var _0x4766f7=typeof _0x2fb5f6[_0xe53e('0x2f')]===_0xe53e('0x30')&&typeof _0x2fb5f6['limit']===_0xe53e('0x30');var _0x2653e3=_0x4fe8db[_0xe53e('0x31')];var _0x3258d7=_0x4766f7?0x0:_0x2fb5f6[_0xe53e('0x2f')];var _0x44cdfb=_0x4766f7?_0x4fe8db[_0xe53e('0x31')]:_0x2fb5f6[_0xe53e('0x2f')]+_0x2fb5f6[_0xe53e('0x32')];var _0x38b87b;if(_0x44cdfb>=_0x2653e3){_0x44cdfb=_0x2653e3;_0x38b87b=0xc8;}else{_0x38b87b=0xce;}_0x425315['status'](_0x38b87b);return _0x425315[_0xe53e('0x33')](_0xe53e('0x34'),_0x3258d7+'-'+_0x44cdfb+'/'+_0x2653e3)[_0xe53e('0x2e')](_0x4fe8db);}return null;};}function patchUpdates(_0x4d06f8){return function(_0x11cb42){try{jsonpatch['apply'](_0x11cb42,_0x4d06f8,!![]);}catch(_0x529e03){return BPromise[_0xe53e('0x35')](_0x529e03);}return _0x11cb42['save']();};}function saveUpdates(_0x3502e5,_0x257419){return function(_0x36a208){if(_0x36a208){return _0x36a208[_0xe53e('0x36')](_0x3502e5)['then'](function(_0x593add){return _0x593add;});}return null;};}function removeEntity(_0xed1db4,_0x1c3dca){return function(_0x5dbe38){if(_0x5dbe38){return _0x5dbe38['destroy']()[_0xe53e('0x21')](function(){_0xed1db4[_0xe53e('0x2d')](0xcc)[_0xe53e('0x37')]();});}};}function handleEntityNotFound(_0x58ed52,_0x29ae5f){return function(_0x58dc2b){if(!_0x58dc2b){_0x58ed52[_0xe53e('0x2c')](0x194);}return _0x58dc2b;};}function handleError(_0x504ba3,_0x23647f){_0x23647f=_0x23647f||0x1f4;return function(_0xea3c45){logger['error'](_0xea3c45[_0xe53e('0x38')]);if(_0xea3c45[_0xe53e('0x39')]){delete _0xea3c45['name'];}_0x504ba3[_0xe53e('0x2d')](_0x23647f)[_0xe53e('0x3a')](_0xea3c45);};}exports[_0xe53e('0x3b')]=function(_0x27fcbd,_0x15965a){var _0x4af728={},_0x2b2a8d={},_0x3c8b08={'count':0x0,'rows':[]};var _0x347b75=_[_0xe53e('0x3c')](db[_0xe53e('0x3d')][_0xe53e('0x3e')],function(_0x2a6e79){return{'name':_0x2a6e79[_0xe53e('0x3f')],'type':_0x2a6e79[_0xe53e('0x40')][_0xe53e('0x41')]};});_0x2b2a8d[_0xe53e('0x42')]=_[_0xe53e('0x3c')](_0x347b75,'name');_0x2b2a8d[_0xe53e('0x43')]=_[_0xe53e('0x44')](_0x27fcbd[_0xe53e('0x43')]);_0x2b2a8d[_0xe53e('0x45')]=_[_0xe53e('0x46')](_0x2b2a8d[_0xe53e('0x42')],_0x2b2a8d['query']);_0x4af728['attributes']=_[_0xe53e('0x46')](_0x2b2a8d[_0xe53e('0x42')],qs[_0xe53e('0x47')](_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x47')]));_0x4af728[_0xe53e('0x48')]=_0x4af728[_0xe53e('0x48')][_0xe53e('0x49')]?_0x4af728[_0xe53e('0x48')]:_0x2b2a8d[_0xe53e('0x42')];if(!_0x27fcbd[_0xe53e('0x43')]['hasOwnProperty']('nolimit')){_0x4af728['limit']=qs[_0xe53e('0x32')](_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x32')]);_0x4af728['offset']=qs[_0xe53e('0x2f')](_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x2f')]);}_0x4af728['order']=qs['sort'](_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x4a')]);_0x4af728[_0xe53e('0x4b')]=qs[_0xe53e('0x45')](_[_0xe53e('0x4c')](_0x27fcbd[_0xe53e('0x43')],_0x2b2a8d['filters']),_0x347b75);if(_0x27fcbd['query'][_0xe53e('0x4d')]){_0x4af728['where']=_[_0xe53e('0x4e')](_0x4af728[_0xe53e('0x4b')],{'$or':_[_0xe53e('0x3c')](_0x347b75,function(_0x3b907d){if(_0x3b907d['type']!==_0xe53e('0x4f')){var _0x2bbb4={};_0x2bbb4[_0x3b907d[_0xe53e('0x39')]]={'$like':'%'+_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x4d')]+'%'};return _0x2bbb4;}})});}_0x4af728=_[_0xe53e('0x4e')]({},_0x4af728,_0x27fcbd[_0xe53e('0x50')]);var _0xf821c5={'where':_0x4af728[_0xe53e('0x4b')]};return db[_0xe53e('0x3d')]['count'](_0xf821c5)[_0xe53e('0x21')](function(_0x495845){_0x3c8b08['count']=_0x495845;if(_0x27fcbd[_0xe53e('0x43')][_0xe53e('0x51')]){_0x4af728[_0xe53e('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xe53e('0x53')](_0x4af728);})[_0xe53e('0x21')](function(_0x3d6f21){_0x3c8b08[_0xe53e('0x54')]=_0x3d6f21;return _0x3c8b08;})[_0xe53e('0x21')](respondWithFilteredResult(_0x15965a,_0x4af728))['catch'](handleError(_0x15965a,null));};exports[_0xe53e('0x55')]=function(_0x2fcfe5,_0x165e02){var _0x584aef={'raw':!![],'where':{'id':_0x2fcfe5['params']['id']}},_0x17dd8c={};_0x17dd8c[_0xe53e('0x42')]=_[_0xe53e('0x44')](db[_0xe53e('0x3d')][_0xe53e('0x3e')]);_0x17dd8c[_0xe53e('0x43')]=_[_0xe53e('0x44')](_0x2fcfe5[_0xe53e('0x43')]);_0x17dd8c[_0xe53e('0x45')]=_[_0xe53e('0x46')](_0x17dd8c['model'],_0x17dd8c[_0xe53e('0x43')]);_0x584aef[_0xe53e('0x48')]=_[_0xe53e('0x46')](_0x17dd8c[_0xe53e('0x42')],qs['fields'](_0x2fcfe5[_0xe53e('0x43')]['fields']));_0x584aef['attributes']=_0x584aef[_0xe53e('0x48')][_0xe53e('0x49')]?_0x584aef[_0xe53e('0x48')]:_0x17dd8c['model'];if(_0x2fcfe5['query'][_0xe53e('0x51')]){_0x584aef[_0xe53e('0x52')]=[{'all':!![]}];}_0x584aef=_[_0xe53e('0x4e')]({},_0x584aef,_0x2fcfe5[_0xe53e('0x50')]);return db[_0xe53e('0x3d')][_0xe53e('0x56')](_0x584aef)[_0xe53e('0x21')](handleEntityNotFound(_0x165e02,null))[_0xe53e('0x21')](respondWithResult(_0x165e02,null))[_0xe53e('0x2b')](handleError(_0x165e02,null));};exports['update']=function(_0x40f8ac,_0x1261ca){if(_0x40f8ac[_0xe53e('0x57')]['id']){delete _0x40f8ac[_0xe53e('0x57')]['id'];}return db[_0xe53e('0x3d')][_0xe53e('0x56')]({'where':{'id':_0x40f8ac['params']['id']}})['then'](handleEntityNotFound(_0x1261ca,null))[_0xe53e('0x21')](saveUpdates(_0x40f8ac[_0xe53e('0x57')],null))[_0xe53e('0x21')](respondWithResult(_0x1261ca,null))[_0xe53e('0x2b')](handleError(_0x1261ca,null));};exports['destroy']=function(_0xe047ac,_0x30259e){return db[_0xe53e('0x3d')][_0xe53e('0x56')]({'where':{'id':_0xe047ac['params']['id']}})['then'](handleEntityNotFound(_0x30259e,null))[_0xe53e('0x21')](removeEntity(_0x30259e,null))[_0xe53e('0x2b')](handleError(_0x30259e,null));};exports[_0xe53e('0x58')]=function(_0x4fd203,_0x5dc386){return db[_0xe53e('0x3d')][_0xe53e('0x58')]()[_0xe53e('0x21')](respondWithResult(_0x5dc386,null))[_0xe53e('0x2b')](handleError(_0x5dc386,null));};var interaction_log=require(_0xe53e('0x12'))(_0xe53e('0x59'));exports[_0xe53e('0x5a')]=function(_0x41ac9d,_0x54bba4,_0x3bc098){var _0x20c825={'agent':{},'channel':_0xe53e('0x5b')};if(_0x41ac9d[_0xe53e('0x57')]['id']){delete _0x41ac9d[_0xe53e('0x57')]['id'];}_0x41ac9d[_0xe53e('0x57')]['read']=!![];_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x5c')]=moment()[_0xe53e('0x5d')](_0xe53e('0x5e'));_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x5f')]=_0x41ac9d['body']['UserId']||_0x41ac9d[_0xe53e('0x60')]['id'];_0x20c825['agent']['id']=_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x5f')];return db[_0xe53e('0x3d')][_0xe53e('0x56')]({'where':{'id':_0x41ac9d[_0xe53e('0x61')]['id'],'UserId':null}})[_0xe53e('0x21')](handleEntityNotFound(_0x54bba4,null))[_0xe53e('0x21')](saveUpdates(_0x41ac9d['body'],null))[_0xe53e('0x21')](function(_0x44db37){if(_0x44db37){_0x20c825[_0xe53e('0x2a')]=_0x44db37[_0xe53e('0x62')]({'plain':!![]});return db[_0xe53e('0x63')]['find']({'where':{'id':_0x44db37[_0xe53e('0x64')]}});}return null;})[_0xe53e('0x21')](handleEntityNotFound(_0x54bba4,null))[_0xe53e('0x21')](function(_0x5293b1){if(_0x5293b1){return _0x5293b1[_0xe53e('0x36')]({'UserId':_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x5f')],'read1stAt':_[_0xe53e('0x65')](_0x5293b1[_0xe53e('0x66')])?moment()[_0xe53e('0x5d')](_0xe53e('0x5e')):undefined});}return null;})[_0xe53e('0x21')](function(_0x3746b3){if(_0x3746b3){_0x20c825['interaction']=_0x3746b3[_0xe53e('0x62')]({'plain':!![]});interaction_log[_0xe53e('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41ac9d['user']['id'],_0x41ac9d[_0xe53e('0x60')][_0xe53e('0x39')],_0x41ac9d[_0xe53e('0x60')][_0xe53e('0x67')],_0x20c825['interaction']['id'],_0x41ac9d[_0xe53e('0x57')]?JSON[_0xe53e('0x27')](_0x41ac9d[_0xe53e('0x57')]):_0xe53e('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x20c825);}return null;})[_0xe53e('0x21')](function(_0x9a1cf3){var _0x1d58d1=_0xe53e('0x69')+_0x9a1cf3[_0xe53e('0x2a')][_0xe53e('0x6a')];return db[_0xe53e('0x6b')]['query'](_0x1d58d1,{'type':db['Sequelize']['QueryTypes'][_0xe53e('0x6c')],'raw':!![]})['then'](function(_0xb91025){return _0xb91025;});})['then'](function(_0x400a93){if(_0x400a93){_0x20c825['message'][_0xe53e('0x6d')]=_0x400a93[0x0];if(!_0x41ac9d['body'][_0xe53e('0x5f')])return;return db[_0xe53e('0x6e')][_0xe53e('0x56')]({'where':{'id':_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x5f')],'role':_0xe53e('0x6f')},'attributes':['id',_0xe53e('0x39'),_0xe53e('0x70'),_0xe53e('0x71'),_0xe53e('0x72')],'raw':!![]});}return null;})[_0xe53e('0x21')](function(_0x2f17ec){if(!_0x2f17ec)return null;_0x20c825[_0xe53e('0x2a')][_0xe53e('0x6f')]=_0x2f17ec;return _0x20c825;})[_0xe53e('0x21')](function(_0x46cbdd){if(_0x46cbdd){if(_0x41ac9d[_0xe53e('0x57')][_0xe53e('0x73')]){_0x20c825[_0xe53e('0x2a')][_0xe53e('0x74')]=util[_0xe53e('0x5d')](_0xe53e('0x75'),_0x41ac9d['user'][_0xe53e('0x39')]);_0x20c825[_0xe53e('0x2a')][_0xe53e('0x76')]=_0x20c825[_0xe53e('0x76')];_0x20c825['message'][_0xe53e('0x77')]=_0x20c825[_0xe53e('0x76')];_0x20c825[_0xe53e('0x2a')][_0xe53e('0x78')]=_0xe53e('0x5a');return respondWithRpcPromise('EventManager',_0xe53e('0x79'),{'event':_0xe53e('0x7a'),'message':_0x20c825['message']},client9002)[_0xe53e('0x21')](function(){return _0x20c825;});}return _0x20c825;}return null;})[_0xe53e('0x21')](respondWithResult(_0x54bba4,null))[_0xe53e('0x2b')](handleError(_0x54bba4,null));};var interaction_log=require(_0xe53e('0x12'))(_0xe53e('0x59'));exports[_0xe53e('0x35')]=function(_0x8edaef,_0x367956,_0x2c7b02){var _0x115bb1={'agent':{},'channel':_0xe53e('0x5b')};if(_0x8edaef[_0xe53e('0x57')]['id']){delete _0x8edaef['body']['id'];}_0x8edaef[_0xe53e('0x57')]['UserId']=_0x8edaef['body'][_0xe53e('0x5f')]||_0x8edaef[_0xe53e('0x60')]['id'];_0x115bb1['agent']['id']=_0x8edaef[_0xe53e('0x57')]['UserId'];return db['FaxMessage'][_0xe53e('0x56')]({'where':{'id':_0x8edaef[_0xe53e('0x61')]['id'],'UserId':null}})[_0xe53e('0x21')](handleEntityNotFound(_0x367956,null))[_0xe53e('0x21')](function(_0x2944ae){if(_0x2944ae){_0x115bb1[_0xe53e('0x2a')]=_0x2944ae[_0xe53e('0x62')]({'plain':!![]});return db['FaxInteraction'][_0xe53e('0x56')]({'where':{'id':_0x2944ae[_0xe53e('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x367956,null))[_0xe53e('0x21')](function(_0x3e6ad9){if(_0x3e6ad9){_0x115bb1[_0xe53e('0x7b')]=_0x3e6ad9[_0xe53e('0x62')]({'plain':!![]});interaction_log[_0xe53e('0x22')](_0xe53e('0x7c'),_0x8edaef[_0xe53e('0x60')]['id'],_0x8edaef[_0xe53e('0x60')]['name'],_0x8edaef[_0xe53e('0x60')][_0xe53e('0x67')],_0x115bb1[_0xe53e('0x7b')]['id'],_0x8edaef['body']?JSON[_0xe53e('0x27')](_0x8edaef[_0xe53e('0x57')]):_0xe53e('0x68'));return respondWithRpcPromise('RejectMessage',_0xe53e('0x7d'),_0x115bb1);}return null;})[_0xe53e('0x21')](function(_0x588837){var _0x487995=_0xe53e('0x69')+_0x588837[_0xe53e('0x2a')][_0xe53e('0x6a')];return db['sequelize'][_0xe53e('0x43')](_0x487995,{'type':db[_0xe53e('0x7e')][_0xe53e('0x7f')][_0xe53e('0x6c')],'raw':!![]})['then'](function(_0x29ceb7){return _0x29ceb7;});})['then'](function(_0x3d02c5){if(_0x3d02c5){_0x115bb1[_0xe53e('0x2a')][_0xe53e('0x6d')]=_0x3d02c5[0x0];if(!_0x8edaef['body'][_0xe53e('0x5f')])return;return db['User'][_0xe53e('0x56')]({'where':{'id':_0x8edaef[_0xe53e('0x57')][_0xe53e('0x5f')],'role':_0xe53e('0x6f')},'attributes':['id',_0xe53e('0x39'),_0xe53e('0x70'),_0xe53e('0x71'),_0xe53e('0x72')],'raw':!![]});}return null;})['then'](function(_0x4ec886){if(!_0x4ec886)return null;_0x115bb1[_0xe53e('0x2a')][_0xe53e('0x6f')]=_0x4ec886;return _0x115bb1;})[_0xe53e('0x21')](function(_0x3f0f9b){if(_0x3f0f9b){_0x3f0f9b[_0xe53e('0x2a')][_0xe53e('0x74')]=util[_0xe53e('0x5d')](_0xe53e('0x75'),_0x8edaef[_0xe53e('0x60')][_0xe53e('0x39')]);_0x3f0f9b[_0xe53e('0x2a')]['channel']=_0x115bb1[_0xe53e('0x76')];_0x3f0f9b['message'][_0xe53e('0x77')]=_0x115bb1[_0xe53e('0x76')];_0x3f0f9b[_0xe53e('0x2a')][_0xe53e('0x78')]=_0xe53e('0x35');respondWithRpcPromise(_0xe53e('0x79'),_0xe53e('0x79'),{'event':_0xe53e('0x80'),'message':_0x3f0f9b[_0xe53e('0x2a')]},client9002);return _0x115bb1;}return null;})[_0xe53e('0x21')](respondWithResult(_0x367956,null))[_0xe53e('0x2b')](handleError(_0x367956,null));};exports['create']=function(_0x49e4eb,_0x44bf52){var _0x35cf76;return db[_0xe53e('0x3d')]['create'](_0x49e4eb[_0xe53e('0x57')],{})[_0xe53e('0x21')](function(_0x2d7acd){_0x35cf76=_0x2d7acd;return db[_0xe53e('0x81')][_0xe53e('0x82')]({'where':{'id':_0x35cf76[_0xe53e('0x6a')]}});})[_0xe53e('0x21')](function(_0xcce099){if(_[_0xe53e('0x65')](_0xcce099)){return;}else{_0x35cf76[_0xe53e('0x5b')]=_0xcce099[_0xe53e('0x5b')];return db[_0xe53e('0x83')][_0xe53e('0x82')]({'where':{'id':_0x35cf76[_0xe53e('0x84')]}});}})[_0xe53e('0x21')](function(_0x211ede){return respondWithRpcPromise(_0xe53e('0x85'),_0xe53e('0x85'),{'FaxAccountId':_['isNil'](_0x49e4eb[_0xe53e('0x57')])?undefined:_0x49e4eb['body'][_0xe53e('0x86')],'path':_[_0xe53e('0x65')](_0x211ede)?undefined:util['format'](_0xe53e('0x87'),_0x211ede['basename']),'fax':_[_0xe53e('0x65')](_0x35cf76[_0xe53e('0x5b')])?undefined:_0x35cf76[_0xe53e('0x5b')],'AttachmentId':_0x35cf76[_0xe53e('0x84')]},client9002);})[_0xe53e('0x21')](respondWithResult(_0x44bf52,0xc9))['catch'](handleError(_0x44bf52,null));};exports[_0xe53e('0x88')]=function(_0x3321d7,_0x3e7872){var _0x5c2853=path[_0xe53e('0x89')](config['root'],_0xe53e('0x8a'),_0xe53e('0x8b'),'attachments');return db[_0xe53e('0x3d')]['find']({'where':{'id':_0x3321d7[_0xe53e('0x61')]['id']},'include':[{'model':db[_0xe53e('0x83')],'as':_0xe53e('0x83')}]})['then'](handleEntityNotFound(_0x3e7872,null))['then'](function(_0x5a46f3){if(_0x5a46f3){return _0x3e7872[_0xe53e('0x88')](path[_0xe53e('0x89')](_0x5c2853,_0x5a46f3[_0xe53e('0x83')][_0xe53e('0x8c')]));}})['catch'](handleError(_0x3e7872,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index c194653..c5f2bf2 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 _0x1472=['FaxMessage','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x40632c,_0x1c08a1){var _0x5b119a=function(_0xc17e5b){while(--_0xc17e5b){_0x40632c['push'](_0x40632c['shift']());}};_0x5b119a(++_0x1c08a1);}(_0x1472,0x166));var _0x2147=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x1472[_0x446208];return _0xe49563;};'use strict';var EventEmitter=require(_0x2147('0x0'));var FaxMessage=require(_0x2147('0x1'))['db'][_0x2147('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x2147('0x3')](0x0);var events={'afterCreate':_0x2147('0x4'),'afterUpdate':_0x2147('0x5'),'afterDestroy':_0x2147('0x6')};function emitEvent(_0x803a6b){return function(_0x4de048,_0x516ff5,_0x1f5727){FaxMessageEvents[_0x2147('0x7')](_0x803a6b+':'+_0x4de048['id'],_0x4de048);FaxMessageEvents[_0x2147('0x7')](_0x803a6b,_0x4de048);_0x1f5727(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x2147('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x75b6=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x75b6,0x1a4));var _0x675b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75b6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x675b('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x675b('0x1')](0x0);var events={'afterCreate':_0x675b('0x2'),'afterUpdate':_0x675b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21c7a0){return function(_0x37de04,_0x1face0,_0x4944bd){FaxMessageEvents[_0x675b('0x4')](_0x21c7a0+':'+_0x37de04['id'],_0x37de04);FaxMessageEvents['emit'](_0x21c7a0,_0x37de04);_0x4944bd(null);};}for(var e in events){if(events[_0x675b('0x5')](e)){var event=events[e];FaxMessage[_0x675b('0x6')](e,emitEvent(event));}}module[_0x675b('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e4c47e8..af888b7 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 _0x57eb=['direction','toLowerCase','secret','isNil','UserId','findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get'];(function(_0x3b8a3a,_0x37cd27){var _0x4438f5=function(_0x20065e){while(--_0x20065e){_0x3b8a3a['push'](_0x3b8a3a['shift']());}};_0x4438f5(++_0x37cd27);}(_0x57eb,0x168));var _0xb57e=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0x57eb[_0x2242a1];return _0x2c298b;};'use strict';var _=require('lodash');var util=require(_0xb57e('0x0'));var logger=require(_0xb57e('0x1'))(_0xb57e('0x2'));var moment=require('moment');var BPromise=require(_0xb57e('0x3'));var rp=require(_0xb57e('0x4'));var fs=require('fs');var path=require(_0xb57e('0x5'));var rimraf=require(_0xb57e('0x6'));var config=require(_0xb57e('0x7'));var attributes=require(_0xb57e('0x8'));module[_0xb57e('0x9')]=function(_0x4fed3f,_0x3c7a04){return _0x4fed3f[_0xb57e('0xa')](_0xb57e('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xb57e('0xc'),'fields':[_0xb57e('0xd')],'type':_0xb57e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1803ac,_0x1cba5f,_0x87cf10){var _0x338191=_0x4fed3f[_0xb57e('0xf')];var _0x1f3e07=_0x1803ac[_0xb57e('0x10')]({'plain':!![]});if(_0x1f3e07[_0xb57e('0x11')][_0xb57e('0x12')]()==='in'||_0x1f3e07['direction'][_0xb57e('0x12')]()==='out'&&!_0x1f3e07[_0xb57e('0x13')]&&!_[_0xb57e('0x14')](_0x1f3e07[_0xb57e('0x15')])){_0x338191['FaxInteraction'][_0xb57e('0x16')]({'where':{'id':_0x1f3e07['FaxInteractionId']}})[_0xb57e('0x17')](function(_0x59f8b5){if(_0x59f8b5){_0x59f8b5[_0xb57e('0x18')]({'lastMsgAt':_0x1f3e07[_0xb57e('0x19')],'lastMsgDirection':_0x1f3e07[_0xb57e('0x11')][_0xb57e('0x12')]()});}})['catch'](function(_0x1ef024){console[_0xb57e('0x1a')](_0x1ef024);});}_0x87cf10();}},'charset':_0xb57e('0x1b'),'collate':_0xb57e('0x1c')});}; \ No newline at end of file +var _0x9846=['define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x5149c7,_0xfd2f67){var _0x5010b0=function(_0x408cb0){while(--_0x408cb0){_0x5149c7['push'](_0x5149c7['shift']());}};_0x5010b0(++_0xfd2f67);}(_0x9846,0x199));var _0x6984=function(_0x377e47,_0x1d19ca){_0x377e47=_0x377e47-0x0;var _0x1f240c=_0x9846[_0x377e47];return _0x1f240c;};'use strict';var _=require(_0x6984('0x0'));var util=require(_0x6984('0x1'));var logger=require(_0x6984('0x2'))(_0x6984('0x3'));var moment=require('moment');var BPromise=require(_0x6984('0x4'));var rp=require(_0x6984('0x5'));var fs=require('fs');var path=require(_0x6984('0x6'));var rimraf=require(_0x6984('0x7'));var config=require(_0x6984('0x8'));var attributes=require(_0x6984('0x9'));module[_0x6984('0xa')]=function(_0x50f50a,_0x274f42){return _0x50f50a[_0x6984('0xb')](_0x6984('0xc'),attributes,{'tableName':_0x6984('0xd'),'paranoid':![],'indexes':[{'name':_0x6984('0xe'),'fields':[_0x6984('0xf')],'type':_0x6984('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b4725,_0x49e4ec,_0x526094){var _0x1cf2a2=_0x50f50a['models'];var _0x1e76b6=_0x5b4725[_0x6984('0x11')]({'plain':!![]});if(_0x1e76b6[_0x6984('0x12')][_0x6984('0x13')]()==='in'||_0x1e76b6['direction'][_0x6984('0x13')]()===_0x6984('0x14')&&!_0x1e76b6['secret']&&!_[_0x6984('0x15')](_0x1e76b6[_0x6984('0x16')])){_0x1cf2a2[_0x6984('0x17')]['findOne']({'where':{'id':_0x1e76b6[_0x6984('0x18')]}})['then'](function(_0x1c6352){if(_0x1c6352){_0x1c6352[_0x6984('0x19')]({'lastMsgAt':_0x1e76b6[_0x6984('0x1a')],'lastMsgDirection':_0x1e76b6['direction'][_0x6984('0x13')]()});}})[_0x6984('0x1b')](function(_0x1babd6){console[_0x6984('0x1c')](_0x1babd6);});}_0x526094();}},'charset':'utf8mb4','collate':_0x6984('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 292035e..2a3230e 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 _0x81bd=['debug','request\x20sent','stringify','error','message','result','catch','CreateFaxMessage','create','body','options','raw','FaxMessage','update','limit','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s'];(function(_0xcf22e1,_0x1ac215){var _0x1be441=function(_0x28f4f6){while(--_0x28f4f6){_0xcf22e1['push'](_0xcf22e1['shift']());}};_0x1be441(++_0x1ac215);}(_0x81bd,0x7c));var _0xd81b=function(_0xb89931,_0x461b9e){_0xb89931=_0xb89931-0x0;var _0x324b86=_0x81bd[_0xb89931];return _0x324b86;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});config[_0xd81b('0xc')]=_['defaults'](config['redis'],{'host':_0xd81b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0xc')]));require(_0xd81b('0xe'))[_0xd81b('0xf')](socket);function respondWithRpcPromise(_0x86dab6,_0x17fba4,_0x1ff60f){return new BPromise(function(_0x4391be,_0x17e09f){return client[_0xd81b('0x10')](_0x86dab6,_0x1ff60f)[_0xd81b('0x11')](function(_0x215b92){logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,'request\x20sent');logger[_0xd81b('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x17fba4,_0xd81b('0x15'),JSON[_0xd81b('0x16')](_0x215b92));if(_0x215b92['error']){if(_0x215b92[_0xd81b('0x17')]['code']===0x1f4){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);return _0x17e09f(_0x215b92[_0xd81b('0x17')]['message']);}logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92['error'][_0xd81b('0x18')]);return _0x4391be(_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);}else{logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,_0xd81b('0x15'));_0x4391be(_0x215b92[_0xd81b('0x19')][_0xd81b('0x18')]);}})[_0xd81b('0x1a')](function(_0x285164){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x285164);_0x17e09f(_0x285164);});});}exports[_0xd81b('0x1b')]=function(_0x3518f0){var _0x156894=this;return new Promise(function(_0x4f8c0b,_0x5f101a){return db['FaxMessage'][_0xd81b('0x1c')](_0x3518f0[_0xd81b('0x1d')],{'raw':_0x3518f0[_0xd81b('0x1e')]?_0x3518f0['options'][_0xd81b('0x1f')]===undefined?!![]:![]:!![]})[_0xd81b('0x11')](function(_0x542ee2){logger[_0xd81b('0x12')](_0xd81b('0x1b'),_0x3518f0);logger[_0xd81b('0x14')](_0xd81b('0x1b'),_0x3518f0,JSON[_0xd81b('0x16')](_0x542ee2));_0x4f8c0b(_0x542ee2);})[_0xd81b('0x1a')](function(_0x255011){logger[_0xd81b('0x17')](_0xd81b('0x1b'),_0x255011[_0xd81b('0x18')],_0x3518f0);_0x5f101a(_0x156894[_0xd81b('0x17')](0x1f4,_0x255011[_0xd81b('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x28768f){var _0x99dbc9=this;return new Promise(function(_0xe3637a,_0x31b9fd){return db[_0xd81b('0x20')][_0xd81b('0x21')](_0x28768f[_0xd81b('0x1d')],{'raw':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28768f[_0xd81b('0x1e')]?_0x28768f['options']['where']||null:null,'attributes':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['attributes']||null:null,'limit':_0x28768f['options']?_0x28768f[_0xd81b('0x1e')][_0xd81b('0x22')]||null:null})[_0xd81b('0x11')](function(_0x289f54){logger[_0xd81b('0x12')](_0xd81b('0x23'),_0x28768f);logger['debug'](_0xd81b('0x23'),_0x28768f,JSON[_0xd81b('0x16')](_0x289f54));_0xe3637a(_0x289f54);})['catch'](function(_0x56d80b){logger[_0xd81b('0x17')](_0xd81b('0x23'),_0x56d80b['message'],_0x28768f);_0x31b9fd(_0x99dbc9['error'](0x1f4,_0x56d80b['message']));});});}; \ No newline at end of file +var _0xb458=['info','result','catch','FaxMessage','create','body','options','then','CreateFaxMessage','update','raw','where','attributes','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','register','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb458,0x103));var _0x8b45=function(_0x2c1767,_0x540dd9){_0x2c1767=_0x2c1767-0x0;var _0x923631=_0xb458[_0x2c1767];return _0x923631;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});config[_0x8b45('0x9')]=_[_0x8b45('0xa')](config[_0x8b45('0x9')],{'host':_0x8b45('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b45('0x9')]));require(_0x8b45('0xc'))[_0x8b45('0xd')](socket);function respondWithRpcPromise(_0x2bc809,_0x2f7117,_0x499899){return new BPromise(function(_0x2a4c83,_0x7cc49b){return client['request'](_0x2bc809,_0x499899)['then'](function(_0x5bb708){logger['info'](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));logger[_0x8b45('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f7117,_0x8b45('0xf'),JSON[_0x8b45('0x11')](_0x5bb708));if(_0x5bb708[_0x8b45('0x12')]){if(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x13')]===0x1f4){logger[_0x8b45('0x12')]('FaxMessage,\x20%s,\x20%s',_0x2f7117,_0x5bb708['error'][_0x8b45('0x14')]);return _0x7cc49b(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);return _0x2a4c83(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}else{logger[_0x8b45('0x15')](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));_0x2a4c83(_0x5bb708[_0x8b45('0x16')][_0x8b45('0x14')]);}})[_0x8b45('0x17')](function(_0x31c6b4){logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x31c6b4);_0x7cc49b(_0x31c6b4);});});}exports['CreateFaxMessage']=function(_0x25e8a1){var _0x2db2d1=this;return new Promise(function(_0x1767d5,_0x46e21a){return db[_0x8b45('0x18')][_0x8b45('0x19')](_0x25e8a1[_0x8b45('0x1a')],{'raw':_0x25e8a1[_0x8b45('0x1b')]?_0x25e8a1['options']['raw']===undefined?!![]:![]:!![]})[_0x8b45('0x1c')](function(_0x580e17){logger[_0x8b45('0x15')](_0x8b45('0x1d'),_0x25e8a1);logger[_0x8b45('0x10')](_0x8b45('0x1d'),_0x25e8a1,JSON[_0x8b45('0x11')](_0x580e17));_0x1767d5(_0x580e17);})[_0x8b45('0x17')](function(_0x32b12b){logger['error']('CreateFaxMessage',_0x32b12b[_0x8b45('0x14')],_0x25e8a1);_0x46e21a(_0x2db2d1[_0x8b45('0x12')](0x1f4,_0x32b12b['message']));});});};exports['UpdateFaxMessage']=function(_0x129c35){var _0x32f6f0=this;return new Promise(function(_0x2ca2d9,_0x2f37bc){return db['FaxMessage'][_0x8b45('0x1e')](_0x129c35[_0x8b45('0x1a')],{'raw':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x20')]||null:null,'attributes':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x21')]||null:null,'limit':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')]['limit']||null:null})[_0x8b45('0x1c')](function(_0x36db96){logger[_0x8b45('0x15')](_0x8b45('0x22'),_0x129c35);logger[_0x8b45('0x10')](_0x8b45('0x22'),_0x129c35,JSON[_0x8b45('0x11')](_0x36db96));_0x2ca2d9(_0x36db96);})[_0x8b45('0x17')](function(_0x5d8938){logger[_0x8b45('0x12')](_0x8b45('0x22'),_0x5d8938[_0x8b45('0x14')],_0x129c35);_0x2f37bc(_0x32f6f0[_0x8b45('0x12')](0x1f4,_0x5d8938[_0x8b45('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index df54f4d..5350ba8 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 _0x6a3a=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','register'];(function(_0x54c01b,_0x546f07){var _0x12cc02=function(_0x1d575b){while(--_0x1d575b){_0x54c01b['push'](_0x54c01b['shift']());}};_0x12cc02(++_0x546f07);}(_0x6a3a,0x112));var _0xa6a3=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x6a3a[_0x19b3f9];return _0x18c3f6;};'use strict';var FaxMessageEvents=require(_0xa6a3('0x0'));var events=[_0xa6a3('0x1'),_0xa6a3('0x2'),_0xa6a3('0x3')];function createListener(_0x2ef997,_0x5dcdc2){return function(_0x36da52){_0x5dcdc2[_0xa6a3('0x4')](_0x2ef997,_0x36da52);};}function removeListener(_0x213664,_0x26316a){return function(){FaxMessageEvents['removeListener'](_0x213664,_0x26316a);};}exports[_0xa6a3('0x5')]=function(_0x5cf238){for(var _0x208384=0x0,_0x5290d6=events[_0xa6a3('0x6')];_0x208384<_0x5290d6;_0x208384++){var _0x4c760e=events[_0x208384];var _0x4de1f5=createListener(_0xa6a3('0x7')+_0x4c760e,_0x5cf238);FaxMessageEvents['on'](_0x4c760e,_0x4de1f5);}}; \ No newline at end of file +var _0xb510=['faxMessage:','./faxMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x18c567,_0x54ca65){var _0x19d089=function(_0x3dd64c){while(--_0x3dd64c){_0x18c567['push'](_0x18c567['shift']());}};_0x19d089(++_0x54ca65);}(_0xb510,0x69));var _0x0b51=function(_0x3e2f1a,_0x2386e7){_0x3e2f1a=_0x3e2f1a-0x0;var _0x357fa2=_0xb510[_0x3e2f1a];return _0x357fa2;};'use strict';var FaxMessageEvents=require(_0x0b51('0x0'));var events=['save',_0x0b51('0x1'),_0x0b51('0x2')];function createListener(_0x4fb31b,_0x1077a9){return function(_0x4193de){_0x1077a9[_0x0b51('0x3')](_0x4fb31b,_0x4193de);};}function removeListener(_0x4b7bae,_0x48559a){return function(){FaxMessageEvents[_0x0b51('0x4')](_0x4b7bae,_0x48559a);};}exports[_0x0b51('0x5')]=function(_0x193e85){for(var _0x24665b=0x0,_0x1c9ae5=events[_0x0b51('0x6')];_0x24665b<_0x1c9ae5;_0x24665b++){var _0x53c2d9=events[_0x24665b];var _0x4bfbda=createListener(_0x0b51('0x7')+_0x53c2d9,_0x193e85);FaxMessageEvents['on'](_0x53c2d9,_0x4bfbda);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index c1341e5..923c02a 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 _0xac4a=['../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','describe','download','post','tracked','fax','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3b5cc1,_0x5aaf30){var _0x21d23f=function(_0x3e9844){while(--_0x3e9844){_0x3b5cc1['push'](_0x3b5cc1['shift']());}};_0x21d23f(++_0x5aaf30);}(_0xac4a,0x13f));var _0xaac4=function(_0x44426c,_0x306ab6){_0x44426c=_0x44426c-0x0;var _0x5eedfc=_0xac4a[_0x44426c];return _0x5eedfc;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xd')]('/',auth[_0xaac4('0x9')](),interaction[_0xaac4('0xe')](_0xaac4('0xf'),'faxmessage:create'),controller['create']);router[_0xaac4('0x10')](_0xaac4('0x11'),auth[_0xaac4('0x9')](),controller['update']);router[_0xaac4('0x10')](_0xaac4('0x12'),auth['isAuthenticated'](),controller[_0xaac4('0x13')]);router[_0xaac4('0x10')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x11'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file +var _0xbb53=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','tracked','faxmessage:create','put','update','/:id/accept','accept','reject','destroy'];(function(_0x76fdaf,_0x1a8ded){var _0x3fc6bd=function(_0x4b1d68){while(--_0x4b1d68){_0x76fdaf['push'](_0x76fdaf['shift']());}};_0x3fc6bd(++_0x1a8ded);}(_0xbb53,0x121));var _0x3bb5=function(_0x49933f,_0x440075){_0x49933f=_0x49933f-0x0;var _0x2a1050=_0xbb53[_0x49933f];return _0x2a1050;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./faxMessage.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),auth[_0x3bb5('0xa')](),controller['describe']);router['get']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xe')]);router[_0x3bb5('0xc')]('/:id/download',auth[_0x3bb5('0xa')](),controller['download']);router['post']('/',auth[_0x3bb5('0xa')](),interaction[_0x3bb5('0xf')]('fax',_0x3bb5('0x10')),controller['create']);router[_0x3bb5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x12')]);router[_0x3bb5('0x11')](_0x3bb5('0x13'),auth['isAuthenticated'](),controller[_0x3bb5('0x14')]);router[_0x3bb5('0x11')]('/:id/reject',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x16')]);module[_0x3bb5('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 5861feb..ae72493 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 _0x9bc1=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5000c4,_0x583855){var _0xebca2d=function(_0x1d9610){while(--_0x1d9610){_0x5000c4['push'](_0x5000c4['shift']());}};_0xebca2d(++_0x583855);}(_0x9bc1,0x163));var _0x19bc=function(_0x568e7c,_0x5ea152){_0x568e7c=_0x568e7c-0x0;var _0x4682a7=_0x9bc1[_0x568e7c];return _0x4682a7;};'use strict';var Sequelize=require(_0x19bc('0x0'));module[_0x19bc('0x1')]={'name':{'type':Sequelize[_0x19bc('0x2')],'unique':_0x19bc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x19bc('0x2')]},'timeout':{'type':Sequelize[_0x19bc('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x19bc('0x5'),_0x19bc('0x6'),_0x19bc('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x19bc('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9876=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3d7811,_0x59daeb){var _0x927cfa=function(_0x5ce736){while(--_0x5ce736){_0x3d7811['push'](_0x3d7811['shift']());}};_0x927cfa(++_0x59daeb);}(_0x9876,0x159));var _0x6987=function(_0x125bb5,_0xc9e346){_0x125bb5=_0x125bb5-0x0;var _0x531de6=_0x9876[_0x125bb5];return _0x531de6;};'use strict';var Sequelize=require(_0x6987('0x0'));module[_0x6987('0x1')]={'name':{'type':Sequelize[_0x6987('0x2')],'unique':_0x6987('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6987('0x2')]},'timeout':{'type':Sequelize[_0x6987('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6987('0x5')](_0x6987('0x6'),_0x6987('0x7'),_0x6987('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index a0ba312..8c51449 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 _0xd597=['reject','save','destroy','FaxQueues','then','stack','name','send','index','map','FaxQueue','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','rawAttributes','pick','UserFaxQueue','User','findAndCountAll','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','sequelize','findOrCreate','forEach','emit','userFaxQueue:save','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','addAgents','omit','removeAgents','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd597,0x65));var _0x7d59=function(_0x311e8b,_0xe5aa24){_0x311e8b=_0x311e8b-0x0;var _0x5b9ec2=_0xd597[_0x311e8b];return _0x5b9ec2;};'use strict';var emlformat=require(_0x7d59('0x0'));var rimraf=require(_0x7d59('0x1'));var zipdir=require(_0x7d59('0x2'));var jsonpatch=require(_0x7d59('0x3'));var rp=require(_0x7d59('0x4'));var moment=require(_0x7d59('0x5'));var BPromise=require(_0x7d59('0x6'));var Mustache=require(_0x7d59('0x7'));var util=require(_0x7d59('0x8'));var path=require(_0x7d59('0x9'));var sox=require(_0x7d59('0xa'));var csv=require(_0x7d59('0xb'));var ejs=require(_0x7d59('0xc'));var fs=require('fs');var fs_extra=require(_0x7d59('0xd'));var _=require(_0x7d59('0xe'));var squel=require(_0x7d59('0xf'));var crypto=require(_0x7d59('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x7d59('0x11'));var toCsv=require(_0x7d59('0xb'));var querystring=require(_0x7d59('0x12'));var Papa=require(_0x7d59('0x13'));var Redis=require('ioredis');var authService=require(_0x7d59('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d59('0x15'));var hardwareService=require(_0x7d59('0x16'));var logger=require(_0x7d59('0x17'))(_0x7d59('0x18'));var utils=require(_0x7d59('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7d59('0x1a'));var db=require('../../mysqldb')['db'];config[_0x7d59('0x1b')]=_[_0x7d59('0x1c')](config[_0x7d59('0x1b')],{'host':_0x7d59('0x1d'),'port':0x18eb});var socket=require(_0x7d59('0x1e'))(new Redis(config[_0x7d59('0x1b')]));require(_0x7d59('0x1f'))[_0x7d59('0x20')](socket);function respondWithStatusCode(_0x482e87,_0x5035fa){_0x5035fa=_0x5035fa||0xcc;return function(_0x14a133){if(_0x14a133){return _0x482e87[_0x7d59('0x21')](_0x5035fa);}return _0x482e87[_0x7d59('0x22')](_0x5035fa)['end']();};}function respondWithResult(_0x176443,_0xd7fce6){_0xd7fce6=_0xd7fce6||0xc8;return function(_0x416499){if(_0x416499){return _0x176443['status'](_0xd7fce6)['json'](_0x416499);}};}function respondWithFilteredResult(_0x217c28,_0x1da8de){return function(_0x3b2047){if(_0x3b2047){var _0x2adff8=typeof _0x1da8de[_0x7d59('0x23')]===_0x7d59('0x24')&&typeof _0x1da8de[_0x7d59('0x25')]===_0x7d59('0x24');var _0x363480=_0x3b2047[_0x7d59('0x26')];var _0x15b47f=_0x2adff8?0x0:_0x1da8de[_0x7d59('0x23')];var _0x2e6434=_0x2adff8?_0x3b2047[_0x7d59('0x26')]:_0x1da8de['offset']+_0x1da8de[_0x7d59('0x25')];var _0x47137d;if(_0x2e6434>=_0x363480){_0x2e6434=_0x363480;_0x47137d=0xc8;}else{_0x47137d=0xce;}_0x217c28[_0x7d59('0x22')](_0x47137d);return _0x217c28[_0x7d59('0x27')](_0x7d59('0x28'),_0x15b47f+'-'+_0x2e6434+'/'+_0x363480)[_0x7d59('0x29')](_0x3b2047);}return null;};}function patchUpdates(_0x666da7){return function(_0x1bd8a8){try{jsonpatch[_0x7d59('0x2a')](_0x1bd8a8,_0x666da7,!![]);}catch(_0xeac66){return BPromise[_0x7d59('0x2b')](_0xeac66);}return _0x1bd8a8[_0x7d59('0x2c')]();};}function saveUpdates(_0x416d0a,_0x28a585){return function(_0x4eb534){if(_0x4eb534){return _0x4eb534['update'](_0x416d0a)['then'](function(_0x1e3772){return _0x1e3772;});}return null;};}function removeEntity(_0xca34a,_0x2e6ec7){return function(_0x5e983c){if(_0x5e983c){return _0x5e983c[_0x7d59('0x2d')]()['then'](function(){var _0x31de74=_0x5e983c['get']({'plain':!![]});var _0x49cd26=_0x7d59('0x2e');return db['UserProfileResource'][_0x7d59('0x2d')]({'where':{'type':_0x49cd26,'resourceId':_0x31de74['id']}})[_0x7d59('0x2f')](function(){return _0x5e983c;});})[_0x7d59('0x2f')](function(){_0xca34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x243fb3,_0x2056a3){return function(_0x2d8095){if(!_0x2d8095){_0x243fb3['sendStatus'](0x194);}return _0x2d8095;};}function handleError(_0x3506e1,_0x3dae1f){_0x3dae1f=_0x3dae1f||0x1f4;return function(_0xc5ab5c){logger['error'](_0xc5ab5c[_0x7d59('0x30')]);if(_0xc5ab5c[_0x7d59('0x31')]){delete _0xc5ab5c[_0x7d59('0x31')];}_0x3506e1['status'](_0x3dae1f)[_0x7d59('0x32')](_0xc5ab5c);};}exports[_0x7d59('0x33')]=function(_0x12565c,_0x2ab796){var _0x1ab6cc={},_0xd11f7e={},_0x412328={'count':0x0,'rows':[]};var _0x200b3d=_[_0x7d59('0x34')](db[_0x7d59('0x35')]['rawAttributes'],function(_0x2d6651){return{'name':_0x2d6651['fieldName'],'type':_0x2d6651[_0x7d59('0x36')][_0x7d59('0x37')]};});_0xd11f7e['model']=_[_0x7d59('0x34')](_0x200b3d,'name');_0xd11f7e[_0x7d59('0x38')]=_[_0x7d59('0x39')](_0x12565c[_0x7d59('0x38')]);_0xd11f7e[_0x7d59('0x3a')]=_[_0x7d59('0x3b')](_0xd11f7e[_0x7d59('0x3c')],_0xd11f7e[_0x7d59('0x38')]);_0x1ab6cc[_0x7d59('0x3d')]=_[_0x7d59('0x3b')](_0xd11f7e['model'],qs[_0x7d59('0x3e')](_0x12565c[_0x7d59('0x38')]['fields']));_0x1ab6cc[_0x7d59('0x3d')]=_0x1ab6cc[_0x7d59('0x3d')][_0x7d59('0x3f')]?_0x1ab6cc[_0x7d59('0x3d')]:_0xd11f7e[_0x7d59('0x3c')];if(!_0x12565c['query'][_0x7d59('0x40')](_0x7d59('0x41'))){_0x1ab6cc[_0x7d59('0x25')]=qs[_0x7d59('0x25')](_0x12565c[_0x7d59('0x38')]['limit']);_0x1ab6cc[_0x7d59('0x23')]=qs[_0x7d59('0x23')](_0x12565c[_0x7d59('0x38')]['offset']);}_0x1ab6cc[_0x7d59('0x42')]=qs['sort'](_0x12565c[_0x7d59('0x38')][_0x7d59('0x43')]);_0x1ab6cc[_0x7d59('0x44')]=qs[_0x7d59('0x3a')](_['pick'](_0x12565c['query'],_0xd11f7e['filters']),_0x200b3d);if(_0x12565c[_0x7d59('0x38')]['filter']){_0x1ab6cc['where']=_['merge'](_0x1ab6cc[_0x7d59('0x44')],{'$or':_[_0x7d59('0x34')](_0x200b3d,function(_0x44d9a){if(_0x44d9a['type']!==_0x7d59('0x45')){var _0x209d18={};_0x209d18[_0x44d9a['name']]={'$like':'%'+_0x12565c[_0x7d59('0x38')][_0x7d59('0x46')]+'%'};return _0x209d18;}})});}_0x1ab6cc=_[_0x7d59('0x47')]({},_0x1ab6cc,_0x12565c['options']);var _0x9ba565={'where':_0x1ab6cc['where']};return db[_0x7d59('0x35')]['count'](_0x9ba565)[_0x7d59('0x2f')](function(_0x1b352a){_0x412328[_0x7d59('0x26')]=_0x1b352a;if(_0x12565c[_0x7d59('0x38')][_0x7d59('0x48')]){_0x1ab6cc['include']=[{'all':!![]}];}return db[_0x7d59('0x35')][_0x7d59('0x49')](_0x1ab6cc);})[_0x7d59('0x2f')](function(_0x5a2c86){_0x412328[_0x7d59('0x4a')]=_0x5a2c86;return _0x412328;})[_0x7d59('0x2f')](respondWithFilteredResult(_0x2ab796,_0x1ab6cc))[_0x7d59('0x4b')](handleError(_0x2ab796,null));};exports['show']=function(_0x3f7395,_0x187dba){var _0x4258e9={'raw':!![],'where':{'id':_0x3f7395[_0x7d59('0x4c')]['id']}},_0x416889={};_0x416889[_0x7d59('0x3c')]=_[_0x7d59('0x39')](db[_0x7d59('0x35')]['rawAttributes']);_0x416889[_0x7d59('0x38')]=_['keys'](_0x3f7395[_0x7d59('0x38')]);_0x416889[_0x7d59('0x3a')]=_['intersection'](_0x416889[_0x7d59('0x3c')],_0x416889[_0x7d59('0x38')]);_0x4258e9['attributes']=_[_0x7d59('0x3b')](_0x416889[_0x7d59('0x3c')],qs[_0x7d59('0x3e')](_0x3f7395[_0x7d59('0x38')][_0x7d59('0x3e')]));_0x4258e9[_0x7d59('0x3d')]=_0x4258e9[_0x7d59('0x3d')]['length']?_0x4258e9[_0x7d59('0x3d')]:_0x416889[_0x7d59('0x3c')];if(_0x3f7395[_0x7d59('0x38')][_0x7d59('0x48')]){_0x4258e9[_0x7d59('0x4d')]=[{'all':!![]}];}_0x4258e9=_[_0x7d59('0x47')]({},_0x4258e9,_0x3f7395[_0x7d59('0x4e')]);return db[_0x7d59('0x35')][_0x7d59('0x4f')](_0x4258e9)[_0x7d59('0x2f')](handleEntityNotFound(_0x187dba,null))['then'](respondWithResult(_0x187dba,null))[_0x7d59('0x4b')](handleError(_0x187dba,null));};exports['create']=function(_0x57baa8,_0x1cd3df){return db['FaxQueue'][_0x7d59('0x50')](_0x57baa8[_0x7d59('0x51')],{})[_0x7d59('0x2f')](function(_0x2f029e){var _0x525123=_0x57baa8[_0x7d59('0x52')][_0x7d59('0x53')]({'plain':!![]});if(!_0x525123)throw new Error(_0x7d59('0x54'));if(_0x525123['role']===_0x7d59('0x52')){var _0x295d7a=_0x2f029e[_0x7d59('0x53')]({'plain':!![]});var _0x5e9fe7=_0x7d59('0x2e');return db[_0x7d59('0x55')]['find']({'where':{'name':_0x5e9fe7,'userProfileId':_0x525123[_0x7d59('0x56')]},'raw':!![]})[_0x7d59('0x2f')](function(_0x1dac30){if(_0x1dac30&&_0x1dac30['autoAssociation']===0x0){return db[_0x7d59('0x57')]['create']({'name':_0x295d7a[_0x7d59('0x31')],'resourceId':_0x295d7a['id'],'type':_0x1dac30[_0x7d59('0x31')],'sectionId':_0x1dac30['id']},{})[_0x7d59('0x2f')](function(){return _0x2f029e;});}else{return _0x2f029e;}})[_0x7d59('0x4b')](function(_0x327380){logger[_0x7d59('0x58')](_0x7d59('0x59'),_0x327380);throw _0x327380;});}return _0x2f029e;})[_0x7d59('0x2f')](respondWithResult(_0x1cd3df,0xc9))[_0x7d59('0x4b')](handleError(_0x1cd3df,null));};exports[_0x7d59('0x5a')]=function(_0x46c319,_0x138cf0){if(_0x46c319[_0x7d59('0x51')]['id']){delete _0x46c319[_0x7d59('0x51')]['id'];}return db[_0x7d59('0x35')][_0x7d59('0x4f')]({'where':{'id':_0x46c319[_0x7d59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x138cf0,null))['then'](saveUpdates(_0x46c319['body'],null))[_0x7d59('0x2f')](respondWithResult(_0x138cf0,null))[_0x7d59('0x4b')](handleError(_0x138cf0,null));};exports[_0x7d59('0x2d')]=function(_0x2950fa,_0x25b42d){return db['FaxQueue'][_0x7d59('0x4f')]({'where':{'id':_0x2950fa[_0x7d59('0x4c')]['id']}})[_0x7d59('0x2f')](handleEntityNotFound(_0x25b42d,null))['then'](removeEntity(_0x25b42d,null))[_0x7d59('0x4b')](handleError(_0x25b42d,null));};exports[_0x7d59('0x5b')]=function(_0x25049e,_0x1f26bb){return db[_0x7d59('0x35')][_0x7d59('0x5b')]()[_0x7d59('0x2f')](respondWithResult(_0x1f26bb,null))[_0x7d59('0x4b')](handleError(_0x1f26bb,null));};exports[_0x7d59('0x5c')]=function(_0x1cd814,_0x26895b,_0x4d45b7){var _0x10869b={'raw':!![],'where':{}},_0x1a468c={},_0x3c6ee7;return db[_0x7d59('0x35')][_0x7d59('0x5d')]({'where':{'id':_0x1cd814[_0x7d59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26895b,null))[_0x7d59('0x2f')](function(_0x4ef7b8){if(_0x4ef7b8){_0x3c6ee7=_0x4ef7b8[_0x7d59('0x53')]({'plain':!![]});_0x1a468c[_0x7d59('0x3c')]=_[_0x7d59('0x39')](db['UserFaxQueue'][_0x7d59('0x5e')]);_0x1a468c[_0x7d59('0x38')]=_[_0x7d59('0x39')](_0x1cd814[_0x7d59('0x38')]);_0x1a468c[_0x7d59('0x3a')]=_[_0x7d59('0x3b')](_0x1a468c['model'],_0x1a468c[_0x7d59('0x38')]);_0x10869b[_0x7d59('0x3d')]=_[_0x7d59('0x3b')](_0x1a468c[_0x7d59('0x3c')],qs[_0x7d59('0x3e')](_0x1cd814[_0x7d59('0x38')]['fields']));_0x10869b[_0x7d59('0x3d')]=_0x10869b[_0x7d59('0x3d')][_0x7d59('0x3f')]?_0x10869b[_0x7d59('0x3d')]:_0x1a468c['model'];if(!_0x1cd814[_0x7d59('0x38')][_0x7d59('0x40')](_0x7d59('0x41'))){_0x10869b[_0x7d59('0x25')]=qs['limit'](_0x1cd814[_0x7d59('0x38')][_0x7d59('0x25')]);_0x10869b['offset']=qs[_0x7d59('0x23')](_0x1cd814['query']['offset']);}_0x10869b[_0x7d59('0x42')]=qs[_0x7d59('0x43')](_0x1cd814['query']['sort']);_0x10869b[_0x7d59('0x44')]=qs[_0x7d59('0x3a')](_[_0x7d59('0x5f')](_0x1cd814['query'],_0x1a468c['filters']));_0x10869b[_0x7d59('0x44')]['FaxQueueId']=_0x4ef7b8['id'];if(_0x1cd814[_0x7d59('0x38')]['filter']){_0x10869b[_0x7d59('0x44')]=_[_0x7d59('0x47')](_0x10869b[_0x7d59('0x44')],{'$or':_[_0x7d59('0x34')](_0x10869b[_0x7d59('0x3d')],function(_0x3d47ef){var _0x472c0d={};_0x472c0d[_0x3d47ef]={'$like':'%'+_0x1cd814[_0x7d59('0x38')][_0x7d59('0x46')]+'%'};return _0x472c0d;})});}_0x10869b=_[_0x7d59('0x47')]({},_0x10869b,_0x1cd814[_0x7d59('0x4e')]);return db[_0x7d59('0x60')][_0x7d59('0x49')](_0x10869b);}})[_0x7d59('0x2f')](function(_0x1769cd){if(_0x1769cd){return db[_0x7d59('0x61')][_0x7d59('0x62')]({'where':{'id':_[_0x7d59('0x34')](_0x1769cd,'UserId'),'role':'agent'},'attributes':['id',_0x7d59('0x31'),_0x7d59('0x63'),_0x7d59('0x64'),'createdAt']});}})[_0x7d59('0x2f')](function(_0x5963e2){if(_0x5963e2){return{'count':_0x5963e2[_0x7d59('0x26')],'rows':_[_0x7d59('0x34')](_0x5963e2[_0x7d59('0x4a')],function(_0x25d4e5){return{'membername':_0x25d4e5['name'],'UserId':_0x25d4e5['id'],'queue_name':_0x3c6ee7[_0x7d59('0x31')],'FaxQueueId':_0x3c6ee7['id'],'interface':util[_0x7d59('0x65')](_0x7d59('0x66'),_0x7d59('0x67'),_0x25d4e5[_0x7d59('0x31')]),'penalty':0x0,'paused':_0x25d4e5['faxPause'],'createdAt':_0x25d4e5[_0x7d59('0x68')],'updatedAt':_0x25d4e5[_0x7d59('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7d59('0x2f')](respondWithFilteredResult(_0x26895b,_0x10869b))[_0x7d59('0x4b')](handleError(_0x26895b,null));};exports[_0x7d59('0x69')]=function(_0x4a5231,_0x75274e,_0x45b043){var _0x1c93ca={};var _0xb24073={};var _0x7b74b;var _0x5c18a6;return db[_0x7d59('0x35')]['findOne']({'where':{'id':_0x4a5231[_0x7d59('0x4c')]['id']}})[_0x7d59('0x2f')](handleEntityNotFound(_0x75274e,null))[_0x7d59('0x2f')](function(_0x4ca875){if(_0x4ca875){_0x7b74b=_0x4ca875;_0xb24073[_0x7d59('0x3c')]=_[_0x7d59('0x39')](db[_0x7d59('0x6a')]['rawAttributes']);_0xb24073[_0x7d59('0x38')]=_[_0x7d59('0x39')](_0x4a5231['query']);_0xb24073[_0x7d59('0x3a')]=_[_0x7d59('0x3b')](_0xb24073[_0x7d59('0x3c')],_0xb24073[_0x7d59('0x38')]);_0x1c93ca[_0x7d59('0x3d')]=_[_0x7d59('0x3b')](_0xb24073[_0x7d59('0x3c')],qs[_0x7d59('0x3e')](_0x4a5231['query'][_0x7d59('0x3e')]));_0x1c93ca['attributes']=_0x1c93ca[_0x7d59('0x3d')][_0x7d59('0x3f')]?_0x1c93ca[_0x7d59('0x3d')]:_0xb24073['model'];_0x1c93ca[_0x7d59('0x42')]=qs[_0x7d59('0x43')](_0x4a5231['query'][_0x7d59('0x43')]);_0x1c93ca[_0x7d59('0x44')]=qs[_0x7d59('0x3a')](_['pick'](_0x4a5231[_0x7d59('0x38')],_0xb24073[_0x7d59('0x3a')]));if(_0x4a5231[_0x7d59('0x38')][_0x7d59('0x46')]){_0x1c93ca[_0x7d59('0x44')]=_['merge'](_0x1c93ca['where'],{'$or':_['map'](_0x1c93ca[_0x7d59('0x3d')],function(_0x46a326){var _0x4f4b35={};_0x4f4b35[_0x46a326]={'$like':'%'+_0x4a5231[_0x7d59('0x38')][_0x7d59('0x46')]+'%'};return _0x4f4b35;})});}_0x1c93ca=_[_0x7d59('0x47')]({},_0x1c93ca,_0x4a5231[_0x7d59('0x4e')]);return _0x7b74b[_0x7d59('0x69')](_0x1c93ca);}})[_0x7d59('0x2f')](function(_0x24ab54){if(_0x24ab54){_0x5c18a6=_0x24ab54[_0x7d59('0x3f')];if(!_0x4a5231[_0x7d59('0x38')][_0x7d59('0x40')](_0x7d59('0x41'))){_0x1c93ca[_0x7d59('0x25')]=qs[_0x7d59('0x25')](_0x4a5231['query']['limit']);_0x1c93ca[_0x7d59('0x23')]=qs[_0x7d59('0x23')](_0x4a5231[_0x7d59('0x38')][_0x7d59('0x23')]);}return _0x7b74b[_0x7d59('0x69')](_0x1c93ca);}})[_0x7d59('0x2f')](function(_0x4d6a63){if(_0x4d6a63){return _0x4d6a63?{'count':_0x5c18a6,'rows':_0x4d6a63}:null;}})['then'](respondWithResult(_0x75274e,null))['catch'](handleError(_0x75274e,null));};exports[_0x7d59('0x6b')]=function(_0x4c7a60,_0x170602,_0x3a381c){var _0x3f4d5c=_0x4c7a60[_0x7d59('0x51')][_0x7d59('0x6c')];return db[_0x7d59('0x6a')][_0x7d59('0x49')]({'where':{'id':_0x3f4d5c},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7d59('0x31'),_0x7d59('0x6d'),_0x7d59('0x6e'),_0x7d59('0x6f')],'raw':!![]}]})['then'](function(_0xd96353){if(_0xd96353){var _0x2954e2=_['flatMap'](_0xd96353,function(_0x5b1c8b){var _0x36d6fc=_0x5b1c8b[_0x7d59('0x53')]({'plain':!![]});return _0x36d6fc['Agents'];});return db['FaxQueue'][_0x7d59('0x4f')]({'where':{'id':_0x4c7a60['params']['id']}})['then'](function(_0x6c461c){return db[_0x7d59('0x70')]['transaction'](function(_0x4bde15){return _0x6c461c[_0x7d59('0x6b')](_0x3f4d5c,{'transaction':_0x4bde15})[_0x7d59('0x2f')](function(){return BPromise['each'](_0x2954e2,function(_0x4200ce){return db[_0x7d59('0x60')][_0x7d59('0x71')]({'where':{'UserId':_0x4200ce['id'],'FaxQueueId':_0x4c7a60['params']['id']},'transaction':_0x4bde15});});})[_0x7d59('0x2f')](function(){_0x2954e2[_0x7d59('0x72')](function(_0x29cd69){socket[_0x7d59('0x73')](_0x7d59('0x74'),{'UserId':_0x29cd69['id'],'FaxQueueId':_0x6c461c['id']});});});});});}})['then'](respondWithStatusCode(_0x170602,null))['catch'](handleError(_0x170602,null));};exports['removeTeams']=function(_0x26b118,_0x48ecc3,_0x9dc536){return db[_0x7d59('0x6a')][_0x7d59('0x49')]({'where':{'id':_0x26b118[_0x7d59('0x38')][_0x7d59('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x7d59('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7d59('0x2f')](handleEntityNotFound(_0x48ecc3,null))[_0x7d59('0x2f')](function(_0x2a3269){var _0x4cb6b3=_[_0x7d59('0x34')](_0x2a3269,'id');var _0x595e0a=[];var _0x441d50=[];var _0x8430a1=squel['select']();_0x8430a1[_0x7d59('0x75')](_0x7d59('0x76'))[_0x7d59('0x77')](_0x7d59('0x78'),'tq')[_0x7d59('0x79')]('user_has_teams','ut',_0x7d59('0x7a'))[_0x7d59('0x44')]('FaxQueueId\x20=\x20?',_0x26b118[_0x7d59('0x4c')]['id']);for(var _0x1ae474=0x0;_0x1ae474<_0x2a3269[_0x7d59('0x3f')];_0x1ae474+=0x1){let _0x502f7f=_0x2a3269[_0x1ae474];for(var _0xea1980=0x0;_0xea1980<_0x502f7f[_0x7d59('0x7b')]['length'];_0xea1980+=0x1){let _0x3899b2=_0x502f7f[_0x7d59('0x7b')][_0xea1980];var _0xb196d9=_0x8430a1[_0x7d59('0x7c')]();_0xb196d9[_0x7d59('0x44')](_0x7d59('0x7d'),_0x3899b2['id']);_0x441d50[_0x7d59('0x7e')](db[_0x7d59('0x70')]['query'](_0xb196d9[_0x7d59('0x7f')](),{'type':db[_0x7d59('0x70')][_0x7d59('0x80')][_0x7d59('0x81')]})[_0x7d59('0x2f')](function(_0x49a5af){if(_0x49a5af['length']===0x1){return _0x3899b2['id'];}else{var _0x26b365=_[_0x7d59('0x82')](_[_0x7d59('0x34')](_0x49a5af,_0x7d59('0x83')),function(_0x3e5b9d){return _[_0x7d59('0x84')](_0x4cb6b3,_0x3e5b9d);});if(_0x26b365){return _0x3899b2['id'];}}}));}}return BPromise[_0x7d59('0x85')](_0x441d50)[_0x7d59('0x2f')](function(_0x5701dc){_0x595e0a=_(_0x595e0a)[_0x7d59('0x86')](_0x5701dc)[_0x7d59('0x87')]()[_0x7d59('0x88')]();return db[_0x7d59('0x35')][_0x7d59('0x4f')]({'where':{'id':_0x26b118[_0x7d59('0x4c')]['id']}})[_0x7d59('0x2f')](function(_0x31dab7){return db[_0x7d59('0x70')][_0x7d59('0x89')](function(_0x3ffaba){return _0x31dab7[_0x7d59('0x8a')](_0x26b118[_0x7d59('0x38')][_0x7d59('0x6c')],{'transaction':_0x3ffaba})[_0x7d59('0x2f')](function(){if(!_['isEmpty'](_0x595e0a)){return _0x31dab7['removeAgents'](_0x595e0a,{'transaction':_0x3ffaba});}})[_0x7d59('0x2f')](function(){_0x595e0a['forEach'](function(_0x442db4){socket[_0x7d59('0x73')]('userFaxQueue:remove',{'UserId':_0x442db4,'FaxQueueId':_0x31dab7['id']});});});});});});})[_0x7d59('0x2f')](respondWithStatusCode(_0x48ecc3,null))['catch'](handleError(_0x48ecc3,null));};exports[_0x7d59('0x8b')]=function(_0x50bd2f,_0x5613fa,_0x944a8){return db['FaxQueue'][_0x7d59('0x4f')]({'where':{'id':_0x50bd2f['params']['id']}})[_0x7d59('0x2f')](handleEntityNotFound(_0x5613fa,null))[_0x7d59('0x2f')](function(_0x4aeeb9){if(_0x4aeeb9){return _0x4aeeb9[_0x7d59('0x8b')](_0x50bd2f[_0x7d59('0x51')]['ids'],_[_0x7d59('0x8c')](_0x50bd2f[_0x7d59('0x51')],[_0x7d59('0x6c'),'id'])||{})['spread'](function(_0x4f2ed2){for(var _0x53c4d0=0x0;_0x53c4d0<_0x50bd2f['body']['ids']['length'];_0x53c4d0+=0x1){socket['emit'](_0x7d59('0x74'),{'UserId':Number(_0x50bd2f['body'][_0x7d59('0x6c')][_0x53c4d0]),'FaxQueueId':Number(_0x50bd2f[_0x7d59('0x4c')]['id'])});}return _0x4f2ed2;});}})[_0x7d59('0x2f')](respondWithResult(_0x5613fa,null))['catch'](handleError(_0x5613fa,null));};exports[_0x7d59('0x8d')]=function(_0x31623d,_0x2d7090,_0xb40f3c){return db['FaxQueue'][_0x7d59('0x4f')]({'where':{'id':_0x31623d[_0x7d59('0x4c')]['id']}})[_0x7d59('0x2f')](handleEntityNotFound(_0x2d7090,null))[_0x7d59('0x2f')](function(_0x2f7b80){if(_0x2f7b80){return _0x2f7b80[_0x7d59('0x8d')](_0x31623d[_0x7d59('0x38')][_0x7d59('0x6c')])[_0x7d59('0x2f')](function(){if(_['isArray'](_0x31623d['query'][_0x7d59('0x6c')])){for(var _0x58849f=0x0;_0x58849f<_0x31623d[_0x7d59('0x38')][_0x7d59('0x6c')]['length'];_0x58849f+=0x1){socket[_0x7d59('0x73')](_0x7d59('0x8e'),{'UserId':Number(_0x31623d[_0x7d59('0x38')]['ids'][_0x58849f]),'FaxQueueId':Number(_0x31623d[_0x7d59('0x4c')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x31623d[_0x7d59('0x38')][_0x7d59('0x6c')]),'FaxQueueId':Number(_0x31623d[_0x7d59('0x4c')]['id'])});}});}})[_0x7d59('0x2f')](respondWithStatusCode(_0x2d7090,null))['catch'](handleError(_0x2d7090,null));};exports[_0x7d59('0x8f')]=function(_0x5040ee,_0x5da45e,_0x16d766){var _0x27589c={};var _0xe43a3a={};var _0x2bfeca;var _0x522b4c;return db[_0x7d59('0x35')][_0x7d59('0x5d')]({'where':{'id':_0x5040ee[_0x7d59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5da45e,null))['then'](function(_0x5033aa){if(_0x5033aa){_0x2bfeca=_0x5033aa;_0xe43a3a[_0x7d59('0x3c')]=_['keys'](db[_0x7d59('0x61')]['rawAttributes']);_0xe43a3a['query']=_['keys'](_0x5040ee[_0x7d59('0x38')]);_0xe43a3a[_0x7d59('0x3a')]=_[_0x7d59('0x3b')](_0xe43a3a[_0x7d59('0x3c')],_0xe43a3a[_0x7d59('0x38')]);_0x27589c[_0x7d59('0x3d')]=_[_0x7d59('0x3b')](_0xe43a3a[_0x7d59('0x3c')],qs[_0x7d59('0x3e')](_0x5040ee[_0x7d59('0x38')][_0x7d59('0x3e')]));_0x27589c[_0x7d59('0x3d')]=_0x27589c['attributes'][_0x7d59('0x3f')]?_0x27589c['attributes']:_0xe43a3a['model'];_0x27589c[_0x7d59('0x42')]=qs[_0x7d59('0x43')](_0x5040ee[_0x7d59('0x38')]['sort']);_0x27589c[_0x7d59('0x44')]=qs[_0x7d59('0x3a')](_['pick'](_0x5040ee[_0x7d59('0x38')],_0xe43a3a[_0x7d59('0x3a')]));if(_0x5040ee['query'][_0x7d59('0x46')]){_0x27589c[_0x7d59('0x44')]=_[_0x7d59('0x47')](_0x27589c[_0x7d59('0x44')],{'$or':_['map'](_0x27589c[_0x7d59('0x3d')],function(_0x4a4be8){var _0x36d3b1={};_0x36d3b1[_0x4a4be8]={'$like':'%'+_0x5040ee['query'][_0x7d59('0x46')]+'%'};return _0x36d3b1;})});}_0x27589c=_['merge']({},_0x27589c,_0x5040ee[_0x7d59('0x4e')]);return _0x2bfeca[_0x7d59('0x8f')](_0x27589c);}})[_0x7d59('0x2f')](function(_0x2531ed){if(_0x2531ed){_0x522b4c=_0x2531ed[_0x7d59('0x3f')];if(!_0x5040ee[_0x7d59('0x38')][_0x7d59('0x40')](_0x7d59('0x41'))){_0x27589c[_0x7d59('0x25')]=qs['limit'](_0x5040ee[_0x7d59('0x38')][_0x7d59('0x25')]);_0x27589c['offset']=qs[_0x7d59('0x23')](_0x5040ee[_0x7d59('0x38')][_0x7d59('0x23')]);}return _0x2bfeca[_0x7d59('0x8f')](_0x27589c);}})['then'](function(_0x29749e){if(_0x29749e){return _0x29749e?{'count':_0x522b4c,'rows':_0x29749e}:null;}})[_0x7d59('0x2f')](respondWithResult(_0x5da45e,null))['catch'](handleError(_0x5da45e,null));}; \ No newline at end of file +var _0x5b36=['union','value','removeAgents','emit','userFaxQueue:remove','addAgents','isArray','getAgents','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','FaxQueues','sendStatus','error','name','send','index','map','rawAttributes','key','query','keys','filters','model','intersection','fields','length','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','FaxQueue','includeAll','findAll','rows','catch','show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','hasOwnProperty','order','pick','FaxQueueId','User','agent','createdAt','format','faxPause','getTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','TeamId','includes','all'];(function(_0x339838,_0x21229b){var _0x414471=function(_0xbfb32d){while(--_0xbfb32d){_0x339838['push'](_0x339838['shift']());}};_0x414471(++_0x21229b);}(_0x5b36,0x197));var _0x65b3=function(_0xe2390d,_0x504be9){_0xe2390d=_0xe2390d-0x0;var _0x5c59a8=_0x5b36[_0xe2390d];return _0x5c59a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65b3('0x0'));var zipdir=require(_0x65b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x65b3('0x2'));var BPromise=require(_0x65b3('0x3'));var Mustache=require('mustache');var util=require(_0x65b3('0x4'));var path=require('path');var sox=require(_0x65b3('0x5'));var csv=require(_0x65b3('0x6'));var ejs=require(_0x65b3('0x7'));var fs=require('fs');var fs_extra=require(_0x65b3('0x8'));var _=require('lodash');var squel=require(_0x65b3('0x9'));var crypto=require(_0x65b3('0xa'));var jsforce=require(_0x65b3('0xb'));var deskjs=require(_0x65b3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x65b3('0xd'));var Papa=require(_0x65b3('0xe'));var Redis=require('ioredis');var authService=require(_0x65b3('0xf'));var qs=require(_0x65b3('0x10'));var as=require(_0x65b3('0x11'));var hardwareService=require(_0x65b3('0x12'));var logger=require(_0x65b3('0x13'))(_0x65b3('0x14'));var utils=require(_0x65b3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x65b3('0x16'));var db=require('../../mysqldb')['db'];config[_0x65b3('0x17')]=_[_0x65b3('0x18')](config['redis'],{'host':_0x65b3('0x19'),'port':0x18eb});var socket=require(_0x65b3('0x1a'))(new Redis(config[_0x65b3('0x17')]));require(_0x65b3('0x1b'))[_0x65b3('0x1c')](socket);function respondWithStatusCode(_0x548430,_0x5b99ff){_0x5b99ff=_0x5b99ff||0xcc;return function(_0x3aa986){if(_0x3aa986){return _0x548430['sendStatus'](_0x5b99ff);}return _0x548430[_0x65b3('0x1d')](_0x5b99ff)[_0x65b3('0x1e')]();};}function respondWithResult(_0x1ad70f,_0x3c83d7){_0x3c83d7=_0x3c83d7||0xc8;return function(_0x4a3acd){if(_0x4a3acd){return _0x1ad70f[_0x65b3('0x1d')](_0x3c83d7)[_0x65b3('0x1f')](_0x4a3acd);}};}function respondWithFilteredResult(_0xe6b017,_0x5e6f7d){return function(_0x21500a){if(_0x21500a){var _0x2906e5=typeof _0x5e6f7d[_0x65b3('0x20')]===_0x65b3('0x21')&&typeof _0x5e6f7d['limit']===_0x65b3('0x21');var _0x24794f=_0x21500a[_0x65b3('0x22')];var _0x5d7772=_0x2906e5?0x0:_0x5e6f7d[_0x65b3('0x20')];var _0xb60fd2=_0x2906e5?_0x21500a[_0x65b3('0x22')]:_0x5e6f7d[_0x65b3('0x20')]+_0x5e6f7d[_0x65b3('0x23')];var _0x2af15e;if(_0xb60fd2>=_0x24794f){_0xb60fd2=_0x24794f;_0x2af15e=0xc8;}else{_0x2af15e=0xce;}_0xe6b017[_0x65b3('0x1d')](_0x2af15e);return _0xe6b017[_0x65b3('0x24')]('Content-Range',_0x5d7772+'-'+_0xb60fd2+'/'+_0x24794f)[_0x65b3('0x1f')](_0x21500a);}return null;};}function patchUpdates(_0x585390){return function(_0x8067d7){try{jsonpatch[_0x65b3('0x25')](_0x8067d7,_0x585390,!![]);}catch(_0x176b1b){return BPromise[_0x65b3('0x26')](_0x176b1b);}return _0x8067d7[_0x65b3('0x27')]();};}function saveUpdates(_0x5793ed,_0x35de05){return function(_0x4d9a2f){if(_0x4d9a2f){return _0x4d9a2f[_0x65b3('0x28')](_0x5793ed)[_0x65b3('0x29')](function(_0x18c2dc){return _0x18c2dc;});}return null;};}function removeEntity(_0x101e5b,_0x41dd22){return function(_0x4dc8d6){if(_0x4dc8d6){return _0x4dc8d6[_0x65b3('0x2a')]()['then'](function(){var _0x7c3d25=_0x4dc8d6[_0x65b3('0x2b')]({'plain':!![]});var _0x16f12f=_0x65b3('0x2c');return db['UserProfileResource'][_0x65b3('0x2a')]({'where':{'type':_0x16f12f,'resourceId':_0x7c3d25['id']}})['then'](function(){return _0x4dc8d6;});})[_0x65b3('0x29')](function(){_0x101e5b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7b06,_0x4fc40e){return function(_0x386790){if(!_0x386790){_0x4f7b06[_0x65b3('0x2d')](0x194);}return _0x386790;};}function handleError(_0x196b94,_0xb4e34a){_0xb4e34a=_0xb4e34a||0x1f4;return function(_0x33f95d){logger[_0x65b3('0x2e')](_0x33f95d['stack']);if(_0x33f95d[_0x65b3('0x2f')]){delete _0x33f95d[_0x65b3('0x2f')];}_0x196b94[_0x65b3('0x1d')](_0xb4e34a)[_0x65b3('0x30')](_0x33f95d);};}exports[_0x65b3('0x31')]=function(_0x31788e,_0x1c876b){var _0x1611d5={},_0xbeea83={},_0x2a6716={'count':0x0,'rows':[]};var _0x57b6cf=_[_0x65b3('0x32')](db['FaxQueue'][_0x65b3('0x33')],function(_0x3642b7){return{'name':_0x3642b7['fieldName'],'type':_0x3642b7['type'][_0x65b3('0x34')]};});_0xbeea83['model']=_[_0x65b3('0x32')](_0x57b6cf,_0x65b3('0x2f'));_0xbeea83[_0x65b3('0x35')]=_[_0x65b3('0x36')](_0x31788e[_0x65b3('0x35')]);_0xbeea83[_0x65b3('0x37')]=_['intersection'](_0xbeea83[_0x65b3('0x38')],_0xbeea83[_0x65b3('0x35')]);_0x1611d5['attributes']=_[_0x65b3('0x39')](_0xbeea83['model'],qs[_0x65b3('0x3a')](_0x31788e[_0x65b3('0x35')][_0x65b3('0x3a')]));_0x1611d5['attributes']=_0x1611d5['attributes'][_0x65b3('0x3b')]?_0x1611d5[_0x65b3('0x3c')]:_0xbeea83[_0x65b3('0x38')];if(!_0x31788e['query']['hasOwnProperty'](_0x65b3('0x3d'))){_0x1611d5[_0x65b3('0x23')]=qs['limit'](_0x31788e[_0x65b3('0x35')][_0x65b3('0x23')]);_0x1611d5['offset']=qs[_0x65b3('0x20')](_0x31788e['query'][_0x65b3('0x20')]);}_0x1611d5['order']=qs['sort'](_0x31788e[_0x65b3('0x35')][_0x65b3('0x3e')]);_0x1611d5[_0x65b3('0x3f')]=qs[_0x65b3('0x37')](_['pick'](_0x31788e['query'],_0xbeea83['filters']),_0x57b6cf);if(_0x31788e['query'][_0x65b3('0x40')]){_0x1611d5[_0x65b3('0x3f')]=_[_0x65b3('0x41')](_0x1611d5[_0x65b3('0x3f')],{'$or':_[_0x65b3('0x32')](_0x57b6cf,function(_0x348c00){if(_0x348c00['type']!==_0x65b3('0x42')){var _0x48555f={};_0x48555f[_0x348c00[_0x65b3('0x2f')]]={'$like':'%'+_0x31788e[_0x65b3('0x35')][_0x65b3('0x40')]+'%'};return _0x48555f;}})});}_0x1611d5=_['merge']({},_0x1611d5,_0x31788e[_0x65b3('0x43')]);var _0x5d75d6={'where':_0x1611d5[_0x65b3('0x3f')]};return db[_0x65b3('0x44')][_0x65b3('0x22')](_0x5d75d6)[_0x65b3('0x29')](function(_0x53e5cd){_0x2a6716[_0x65b3('0x22')]=_0x53e5cd;if(_0x31788e[_0x65b3('0x35')][_0x65b3('0x45')]){_0x1611d5['include']=[{'all':!![]}];}return db['FaxQueue'][_0x65b3('0x46')](_0x1611d5);})['then'](function(_0x568ded){_0x2a6716[_0x65b3('0x47')]=_0x568ded;return _0x2a6716;})[_0x65b3('0x29')](respondWithFilteredResult(_0x1c876b,_0x1611d5))[_0x65b3('0x48')](handleError(_0x1c876b,null));};exports[_0x65b3('0x49')]=function(_0x3aaeaa,_0xfe24ad){var _0x26f017={'raw':!![],'where':{'id':_0x3aaeaa[_0x65b3('0x4a')]['id']}},_0x12dd9c={};_0x12dd9c['model']=_[_0x65b3('0x36')](db['FaxQueue']['rawAttributes']);_0x12dd9c['query']=_[_0x65b3('0x36')](_0x3aaeaa[_0x65b3('0x35')]);_0x12dd9c[_0x65b3('0x37')]=_['intersection'](_0x12dd9c['model'],_0x12dd9c[_0x65b3('0x35')]);_0x26f017['attributes']=_[_0x65b3('0x39')](_0x12dd9c[_0x65b3('0x38')],qs[_0x65b3('0x3a')](_0x3aaeaa['query'][_0x65b3('0x3a')]));_0x26f017[_0x65b3('0x3c')]=_0x26f017['attributes']['length']?_0x26f017[_0x65b3('0x3c')]:_0x12dd9c[_0x65b3('0x38')];if(_0x3aaeaa[_0x65b3('0x35')][_0x65b3('0x45')]){_0x26f017[_0x65b3('0x4b')]=[{'all':!![]}];}_0x26f017=_[_0x65b3('0x41')]({},_0x26f017,_0x3aaeaa[_0x65b3('0x43')]);return db[_0x65b3('0x44')][_0x65b3('0x4c')](_0x26f017)[_0x65b3('0x29')](handleEntityNotFound(_0xfe24ad,null))[_0x65b3('0x29')](respondWithResult(_0xfe24ad,null))[_0x65b3('0x48')](handleError(_0xfe24ad,null));};exports['create']=function(_0x588b04,_0x1c2efb){return db[_0x65b3('0x44')]['create'](_0x588b04[_0x65b3('0x4d')],{})[_0x65b3('0x29')](function(_0x473d95){var _0x35fb87=_0x588b04[_0x65b3('0x4e')][_0x65b3('0x2b')]({'plain':!![]});if(!_0x35fb87)throw new Error(_0x65b3('0x4f'));if(_0x35fb87[_0x65b3('0x50')]===_0x65b3('0x4e')){var _0x18909f=_0x473d95[_0x65b3('0x2b')]({'plain':!![]});var _0x3375ce='FaxQueues';return db[_0x65b3('0x51')][_0x65b3('0x4c')]({'where':{'name':_0x3375ce,'userProfileId':_0x35fb87[_0x65b3('0x52')]},'raw':!![]})[_0x65b3('0x29')](function(_0x26c6ef){if(_0x26c6ef&&_0x26c6ef[_0x65b3('0x53')]===0x0){return db['UserProfileResource'][_0x65b3('0x54')]({'name':_0x18909f[_0x65b3('0x2f')],'resourceId':_0x18909f['id'],'type':_0x26c6ef[_0x65b3('0x2f')],'sectionId':_0x26c6ef['id']},{})['then'](function(){return _0x473d95;});}else{return _0x473d95;}})['catch'](function(_0x187698){logger[_0x65b3('0x2e')](_0x65b3('0x55'),_0x187698);throw _0x187698;});}return _0x473d95;})['then'](respondWithResult(_0x1c2efb,0xc9))[_0x65b3('0x48')](handleError(_0x1c2efb,null));};exports[_0x65b3('0x28')]=function(_0x436c9b,_0x21b004){if(_0x436c9b['body']['id']){delete _0x436c9b['body']['id'];}return db[_0x65b3('0x44')]['find']({'where':{'id':_0x436c9b[_0x65b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21b004,null))[_0x65b3('0x29')](saveUpdates(_0x436c9b[_0x65b3('0x4d')],null))[_0x65b3('0x29')](respondWithResult(_0x21b004,null))[_0x65b3('0x48')](handleError(_0x21b004,null));};exports[_0x65b3('0x2a')]=function(_0x18a56a,_0x37f7c8){return db[_0x65b3('0x44')][_0x65b3('0x4c')]({'where':{'id':_0x18a56a[_0x65b3('0x4a')]['id']}})[_0x65b3('0x29')](handleEntityNotFound(_0x37f7c8,null))[_0x65b3('0x29')](removeEntity(_0x37f7c8,null))[_0x65b3('0x48')](handleError(_0x37f7c8,null));};exports[_0x65b3('0x56')]=function(_0x743863,_0x2ec2af){return db[_0x65b3('0x44')]['describe']()['then'](respondWithResult(_0x2ec2af,null))[_0x65b3('0x48')](handleError(_0x2ec2af,null));};exports['getMembers']=function(_0x1341d1,_0x2dae2f,_0x891591){var _0x126490={'raw':!![],'where':{}},_0x174686={},_0x376a43;return db['FaxQueue'][_0x65b3('0x57')]({'where':{'id':_0x1341d1['params']['id']}})[_0x65b3('0x29')](handleEntityNotFound(_0x2dae2f,null))['then'](function(_0x3cf6fa){if(_0x3cf6fa){_0x376a43=_0x3cf6fa[_0x65b3('0x2b')]({'plain':!![]});_0x174686['model']=_[_0x65b3('0x36')](db[_0x65b3('0x58')][_0x65b3('0x33')]);_0x174686[_0x65b3('0x35')]=_[_0x65b3('0x36')](_0x1341d1['query']);_0x174686['filters']=_[_0x65b3('0x39')](_0x174686['model'],_0x174686[_0x65b3('0x35')]);_0x126490[_0x65b3('0x3c')]=_['intersection'](_0x174686['model'],qs[_0x65b3('0x3a')](_0x1341d1[_0x65b3('0x35')][_0x65b3('0x3a')]));_0x126490['attributes']=_0x126490['attributes'][_0x65b3('0x3b')]?_0x126490[_0x65b3('0x3c')]:_0x174686['model'];if(!_0x1341d1[_0x65b3('0x35')][_0x65b3('0x59')](_0x65b3('0x3d'))){_0x126490['limit']=qs[_0x65b3('0x23')](_0x1341d1[_0x65b3('0x35')][_0x65b3('0x23')]);_0x126490[_0x65b3('0x20')]=qs[_0x65b3('0x20')](_0x1341d1[_0x65b3('0x35')][_0x65b3('0x20')]);}_0x126490[_0x65b3('0x5a')]=qs[_0x65b3('0x3e')](_0x1341d1[_0x65b3('0x35')]['sort']);_0x126490[_0x65b3('0x3f')]=qs['filters'](_[_0x65b3('0x5b')](_0x1341d1[_0x65b3('0x35')],_0x174686[_0x65b3('0x37')]));_0x126490[_0x65b3('0x3f')][_0x65b3('0x5c')]=_0x3cf6fa['id'];if(_0x1341d1['query'][_0x65b3('0x40')]){_0x126490['where']=_['merge'](_0x126490[_0x65b3('0x3f')],{'$or':_[_0x65b3('0x32')](_0x126490['attributes'],function(_0x463ddd){var _0x23ba8c={};_0x23ba8c[_0x463ddd]={'$like':'%'+_0x1341d1[_0x65b3('0x35')][_0x65b3('0x40')]+'%'};return _0x23ba8c;})});}_0x126490=_['merge']({},_0x126490,_0x1341d1[_0x65b3('0x43')]);return db['UserFaxQueue'][_0x65b3('0x46')](_0x126490);}})[_0x65b3('0x29')](function(_0x42a3d8){if(_0x42a3d8){return db[_0x65b3('0x5d')]['findAndCountAll']({'where':{'id':_[_0x65b3('0x32')](_0x42a3d8,'UserId'),'role':_0x65b3('0x5e')},'attributes':['id',_0x65b3('0x2f'),'faxPause','updatedAt',_0x65b3('0x5f')]});}})[_0x65b3('0x29')](function(_0x6a77a0){if(_0x6a77a0){return{'count':_0x6a77a0[_0x65b3('0x22')],'rows':_[_0x65b3('0x32')](_0x6a77a0[_0x65b3('0x47')],function(_0x1517ab){return{'membername':_0x1517ab[_0x65b3('0x2f')],'UserId':_0x1517ab['id'],'queue_name':_0x376a43['name'],'FaxQueueId':_0x376a43['id'],'interface':util[_0x65b3('0x60')]('%s/%s','SIP',_0x1517ab[_0x65b3('0x2f')]),'penalty':0x0,'paused':_0x1517ab[_0x65b3('0x61')],'createdAt':_0x1517ab['createdAt'],'updatedAt':_0x1517ab['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x65b3('0x29')](respondWithFilteredResult(_0x2dae2f,_0x126490))[_0x65b3('0x48')](handleError(_0x2dae2f,null));};exports[_0x65b3('0x62')]=function(_0xab1c72,_0x5d3564,_0x329096){var _0x4d1615={};var _0x17e493={};var _0x33b1ba;var _0x2b3bf4;return db[_0x65b3('0x44')][_0x65b3('0x57')]({'where':{'id':_0xab1c72[_0x65b3('0x4a')]['id']}})[_0x65b3('0x29')](handleEntityNotFound(_0x5d3564,null))['then'](function(_0x40286f){if(_0x40286f){_0x33b1ba=_0x40286f;_0x17e493[_0x65b3('0x38')]=_['keys'](db['Team'][_0x65b3('0x33')]);_0x17e493[_0x65b3('0x35')]=_[_0x65b3('0x36')](_0xab1c72[_0x65b3('0x35')]);_0x17e493['filters']=_[_0x65b3('0x39')](_0x17e493[_0x65b3('0x38')],_0x17e493[_0x65b3('0x35')]);_0x4d1615[_0x65b3('0x3c')]=_[_0x65b3('0x39')](_0x17e493[_0x65b3('0x38')],qs['fields'](_0xab1c72[_0x65b3('0x35')]['fields']));_0x4d1615['attributes']=_0x4d1615['attributes'][_0x65b3('0x3b')]?_0x4d1615[_0x65b3('0x3c')]:_0x17e493['model'];_0x4d1615[_0x65b3('0x5a')]=qs[_0x65b3('0x3e')](_0xab1c72[_0x65b3('0x35')]['sort']);_0x4d1615[_0x65b3('0x3f')]=qs[_0x65b3('0x37')](_[_0x65b3('0x5b')](_0xab1c72[_0x65b3('0x35')],_0x17e493[_0x65b3('0x37')]));if(_0xab1c72[_0x65b3('0x35')][_0x65b3('0x40')]){_0x4d1615[_0x65b3('0x3f')]=_[_0x65b3('0x41')](_0x4d1615['where'],{'$or':_[_0x65b3('0x32')](_0x4d1615[_0x65b3('0x3c')],function(_0xbe203c){var _0x2ea47c={};_0x2ea47c[_0xbe203c]={'$like':'%'+_0xab1c72[_0x65b3('0x35')][_0x65b3('0x40')]+'%'};return _0x2ea47c;})});}_0x4d1615=_[_0x65b3('0x41')]({},_0x4d1615,_0xab1c72['options']);return _0x33b1ba[_0x65b3('0x62')](_0x4d1615);}})[_0x65b3('0x29')](function(_0x164a4e){if(_0x164a4e){_0x2b3bf4=_0x164a4e[_0x65b3('0x3b')];if(!_0xab1c72[_0x65b3('0x35')][_0x65b3('0x59')](_0x65b3('0x3d'))){_0x4d1615['limit']=qs[_0x65b3('0x23')](_0xab1c72[_0x65b3('0x35')][_0x65b3('0x23')]);_0x4d1615[_0x65b3('0x20')]=qs['offset'](_0xab1c72[_0x65b3('0x35')][_0x65b3('0x20')]);}return _0x33b1ba[_0x65b3('0x62')](_0x4d1615);}})['then'](function(_0x4812aa){if(_0x4812aa){return _0x4812aa?{'count':_0x2b3bf4,'rows':_0x4812aa}:null;}})[_0x65b3('0x29')](respondWithResult(_0x5d3564,null))[_0x65b3('0x48')](handleError(_0x5d3564,null));};exports['addTeams']=function(_0x226956,_0x1689d1,_0x2a3db4){var _0x285fa3=_0x226956[_0x65b3('0x4d')][_0x65b3('0x63')];return db[_0x65b3('0x64')]['findAll']({'where':{'id':_0x285fa3},'attributes':['id'],'include':[{'model':db[_0x65b3('0x5d')],'as':_0x65b3('0x65'),'attributes':['id','name','online',_0x65b3('0x66'),_0x65b3('0x67')],'raw':!![]}]})[_0x65b3('0x29')](function(_0x4618d6){if(_0x4618d6){var _0x5e139f=_[_0x65b3('0x68')](_0x4618d6,function(_0x446914){var _0xc93e94=_0x446914[_0x65b3('0x2b')]({'plain':!![]});return _0xc93e94[_0x65b3('0x65')];});return db['FaxQueue'][_0x65b3('0x4c')]({'where':{'id':_0x226956[_0x65b3('0x4a')]['id']}})[_0x65b3('0x29')](function(_0x3cdca4){return db[_0x65b3('0x69')][_0x65b3('0x6a')](function(_0x2803ad){return _0x3cdca4[_0x65b3('0x6b')](_0x285fa3,{'transaction':_0x2803ad})[_0x65b3('0x29')](function(){return BPromise['each'](_0x5e139f,function(_0x4b72ab){return db['UserFaxQueue'][_0x65b3('0x6c')]({'where':{'UserId':_0x4b72ab['id'],'FaxQueueId':_0x226956['params']['id']},'transaction':_0x2803ad});});})[_0x65b3('0x29')](function(){_0x5e139f[_0x65b3('0x6d')](function(_0x18b9d5){socket['emit'](_0x65b3('0x6e'),{'UserId':_0x18b9d5['id'],'FaxQueueId':_0x3cdca4['id']});});});});});}})[_0x65b3('0x29')](respondWithStatusCode(_0x1689d1,null))[_0x65b3('0x48')](handleError(_0x1689d1,null));};exports[_0x65b3('0x6f')]=function(_0x1fe7e2,_0x28690b,_0x134ed0){return db['Team'][_0x65b3('0x46')]({'where':{'id':_0x1fe7e2[_0x65b3('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x65b3('0x65'),'attributes':['id'],'raw':!![]}]})[_0x65b3('0x29')](handleEntityNotFound(_0x28690b,null))[_0x65b3('0x29')](function(_0x5f18d2){var _0x5cffe1=_[_0x65b3('0x32')](_0x5f18d2,'id');var _0x5bbeb1=[];var _0x4a02df=[];var _0x17058c=squel[_0x65b3('0x70')]();_0x17058c[_0x65b3('0x71')]('tq.TeamId')['from'](_0x65b3('0x72'),'tq')[_0x65b3('0x73')](_0x65b3('0x74'),'ut',_0x65b3('0x75'))[_0x65b3('0x3f')](_0x65b3('0x76'),_0x1fe7e2['params']['id']);for(var _0x33b702=0x0;_0x33b702<_0x5f18d2[_0x65b3('0x3b')];_0x33b702+=0x1){let _0xcdea4f=_0x5f18d2[_0x33b702];for(var _0x57b77b=0x0;_0x57b77b<_0xcdea4f['Agents'][_0x65b3('0x3b')];_0x57b77b+=0x1){let _0x29846f=_0xcdea4f['Agents'][_0x57b77b];var _0x217c48=_0x17058c[_0x65b3('0x77')]();_0x217c48[_0x65b3('0x3f')](_0x65b3('0x78'),_0x29846f['id']);_0x4a02df['push'](db[_0x65b3('0x69')][_0x65b3('0x35')](_0x217c48['toString'](),{'type':db[_0x65b3('0x69')][_0x65b3('0x79')]['SELECT']})[_0x65b3('0x29')](function(_0x474e37){if(_0x474e37[_0x65b3('0x3b')]===0x1){return _0x29846f['id'];}else{var _0x520c43=_['every'](_[_0x65b3('0x32')](_0x474e37,_0x65b3('0x7a')),function(_0x47dcd8){return _[_0x65b3('0x7b')](_0x5cffe1,_0x47dcd8);});if(_0x520c43){return _0x29846f['id'];}}}));}}return BPromise[_0x65b3('0x7c')](_0x4a02df)[_0x65b3('0x29')](function(_0x370781){_0x5bbeb1=_(_0x5bbeb1)[_0x65b3('0x7d')](_0x370781)['compact']()[_0x65b3('0x7e')]();return db[_0x65b3('0x44')][_0x65b3('0x4c')]({'where':{'id':_0x1fe7e2[_0x65b3('0x4a')]['id']}})['then'](function(_0x5012ee){return db['sequelize'][_0x65b3('0x6a')](function(_0x32efc9){return _0x5012ee[_0x65b3('0x6f')](_0x1fe7e2[_0x65b3('0x35')][_0x65b3('0x63')],{'transaction':_0x32efc9})[_0x65b3('0x29')](function(){if(!_['isEmpty'](_0x5bbeb1)){return _0x5012ee[_0x65b3('0x7f')](_0x5bbeb1,{'transaction':_0x32efc9});}})[_0x65b3('0x29')](function(){_0x5bbeb1[_0x65b3('0x6d')](function(_0x2cc023){socket[_0x65b3('0x80')](_0x65b3('0x81'),{'UserId':_0x2cc023,'FaxQueueId':_0x5012ee['id']});});});});});});})[_0x65b3('0x29')](respondWithStatusCode(_0x28690b,null))[_0x65b3('0x48')](handleError(_0x28690b,null));};exports['addAgents']=function(_0x42545e,_0x56dae8,_0x593080){return db[_0x65b3('0x44')][_0x65b3('0x4c')]({'where':{'id':_0x42545e[_0x65b3('0x4a')]['id']}})[_0x65b3('0x29')](handleEntityNotFound(_0x56dae8,null))[_0x65b3('0x29')](function(_0x240ebd){if(_0x240ebd){return _0x240ebd[_0x65b3('0x82')](_0x42545e[_0x65b3('0x4d')][_0x65b3('0x63')],_['omit'](_0x42545e[_0x65b3('0x4d')],[_0x65b3('0x63'),'id'])||{})['spread'](function(_0x9227c7){for(var _0x448b7e=0x0;_0x448b7e<_0x42545e[_0x65b3('0x4d')][_0x65b3('0x63')]['length'];_0x448b7e+=0x1){socket[_0x65b3('0x80')](_0x65b3('0x6e'),{'UserId':Number(_0x42545e[_0x65b3('0x4d')][_0x65b3('0x63')][_0x448b7e]),'FaxQueueId':Number(_0x42545e[_0x65b3('0x4a')]['id'])});}return _0x9227c7;});}})[_0x65b3('0x29')](respondWithResult(_0x56dae8,null))[_0x65b3('0x48')](handleError(_0x56dae8,null));};exports[_0x65b3('0x7f')]=function(_0x8346ad,_0x2c9e1,_0x439656){return db[_0x65b3('0x44')]['find']({'where':{'id':_0x8346ad[_0x65b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c9e1,null))['then'](function(_0x3f3c39){if(_0x3f3c39){return _0x3f3c39[_0x65b3('0x7f')](_0x8346ad[_0x65b3('0x35')][_0x65b3('0x63')])[_0x65b3('0x29')](function(){if(_[_0x65b3('0x83')](_0x8346ad[_0x65b3('0x35')][_0x65b3('0x63')])){for(var _0xc4c749=0x0;_0xc4c749<_0x8346ad['query'][_0x65b3('0x63')][_0x65b3('0x3b')];_0xc4c749+=0x1){socket['emit'](_0x65b3('0x81'),{'UserId':Number(_0x8346ad[_0x65b3('0x35')][_0x65b3('0x63')][_0xc4c749]),'FaxQueueId':Number(_0x8346ad['params']['id'])});}}else{socket['emit'](_0x65b3('0x81'),{'UserId':Number(_0x8346ad[_0x65b3('0x35')][_0x65b3('0x63')]),'FaxQueueId':Number(_0x8346ad[_0x65b3('0x4a')]['id'])});}});}})[_0x65b3('0x29')](respondWithStatusCode(_0x2c9e1,null))['catch'](handleError(_0x2c9e1,null));};exports[_0x65b3('0x84')]=function(_0x118e92,_0x3dcf75,_0x3e2f41){var _0x5c4aec={};var _0x46ef16={};var _0x54dbf8;var _0x18ebfb;return db[_0x65b3('0x44')][_0x65b3('0x57')]({'where':{'id':_0x118e92[_0x65b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3dcf75,null))['then'](function(_0x3fa6b2){if(_0x3fa6b2){_0x54dbf8=_0x3fa6b2;_0x46ef16[_0x65b3('0x38')]=_[_0x65b3('0x36')](db[_0x65b3('0x5d')][_0x65b3('0x33')]);_0x46ef16[_0x65b3('0x35')]=_['keys'](_0x118e92[_0x65b3('0x35')]);_0x46ef16['filters']=_[_0x65b3('0x39')](_0x46ef16[_0x65b3('0x38')],_0x46ef16[_0x65b3('0x35')]);_0x5c4aec['attributes']=_[_0x65b3('0x39')](_0x46ef16[_0x65b3('0x38')],qs[_0x65b3('0x3a')](_0x118e92[_0x65b3('0x35')][_0x65b3('0x3a')]));_0x5c4aec[_0x65b3('0x3c')]=_0x5c4aec[_0x65b3('0x3c')][_0x65b3('0x3b')]?_0x5c4aec['attributes']:_0x46ef16['model'];_0x5c4aec['order']=qs[_0x65b3('0x3e')](_0x118e92[_0x65b3('0x35')]['sort']);_0x5c4aec[_0x65b3('0x3f')]=qs['filters'](_['pick'](_0x118e92[_0x65b3('0x35')],_0x46ef16[_0x65b3('0x37')]));if(_0x118e92['query'][_0x65b3('0x40')]){_0x5c4aec[_0x65b3('0x3f')]=_[_0x65b3('0x41')](_0x5c4aec['where'],{'$or':_[_0x65b3('0x32')](_0x5c4aec[_0x65b3('0x3c')],function(_0x3d0a2a){var _0x26229e={};_0x26229e[_0x3d0a2a]={'$like':'%'+_0x118e92[_0x65b3('0x35')][_0x65b3('0x40')]+'%'};return _0x26229e;})});}_0x5c4aec=_[_0x65b3('0x41')]({},_0x5c4aec,_0x118e92[_0x65b3('0x43')]);return _0x54dbf8[_0x65b3('0x84')](_0x5c4aec);}})[_0x65b3('0x29')](function(_0x52ad2d){if(_0x52ad2d){_0x18ebfb=_0x52ad2d[_0x65b3('0x3b')];if(!_0x118e92[_0x65b3('0x35')][_0x65b3('0x59')](_0x65b3('0x3d'))){_0x5c4aec[_0x65b3('0x23')]=qs[_0x65b3('0x23')](_0x118e92['query'][_0x65b3('0x23')]);_0x5c4aec[_0x65b3('0x20')]=qs['offset'](_0x118e92[_0x65b3('0x35')][_0x65b3('0x20')]);}return _0x54dbf8[_0x65b3('0x84')](_0x5c4aec);}})[_0x65b3('0x29')](function(_0x2d4d17){if(_0x2d4d17){return _0x2d4d17?{'count':_0x18ebfb,'rows':_0x2d4d17}:null;}})[_0x65b3('0x29')](respondWithResult(_0x3dcf75,null))[_0x65b3('0x48')](handleError(_0x3dcf75,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 125d516..898096c 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 _0xb756=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0xe8fc44,_0x3d49b5){var _0x5245c2=function(_0xcb5fd){while(--_0xcb5fd){_0xe8fc44['push'](_0xe8fc44['shift']());}};_0x5245c2(++_0x3d49b5);}(_0xb756,0x100));var _0x6b75=function(_0x28ca08,_0x1397ea){_0x28ca08=_0x28ca08-0x0;var _0x3af7dc=_0xb756[_0x28ca08];return _0x3af7dc;};'use strict';var EventEmitter=require(_0x6b75('0x0'));var FaxQueue=require(_0x6b75('0x1'))['db'][_0x6b75('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6b75('0x3')](0x0);var events={'afterCreate':_0x6b75('0x4'),'afterUpdate':'update','afterDestroy':_0x6b75('0x5')};function emitEvent(_0x2b76a5){return function(_0xe0e19b,_0x2ec1c1,_0x149f8f){FaxQueueEvents['emit'](_0x2b76a5+':'+_0xe0e19b['id'],_0xe0e19b);FaxQueueEvents[_0x6b75('0x6')](_0x2b76a5,_0xe0e19b);_0x149f8f(null);};}for(var e in events){if(events[_0x6b75('0x7')](e)){var event=events[e];FaxQueue[_0x6b75('0x8')](e,emitEvent(event));}}module[_0x6b75('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xc064=['remove','emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','save','update'];(function(_0x1efe8b,_0x3dd139){var _0x163bce=function(_0x1f857e){while(--_0x1f857e){_0x1efe8b['push'](_0x1efe8b['shift']());}};_0x163bce(++_0x3dd139);}(_0xc064,0x9c));var _0x4c06=function(_0x236edc,_0x574adc){_0x236edc=_0x236edc-0x0;var _0x3d9d91=_0xc064[_0x236edc];return _0x3d9d91;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x4c06('0x0'))['db'][_0x4c06('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c06('0x2'),'afterUpdate':_0x4c06('0x3'),'afterDestroy':_0x4c06('0x4')};function emitEvent(_0x2503d9){return function(_0x4dcc58,_0x2b97ab,_0x41c431){FaxQueueEvents[_0x4c06('0x5')](_0x2503d9+':'+_0x4dcc58['id'],_0x4dcc58);FaxQueueEvents['emit'](_0x2503d9,_0x4dcc58);_0x41c431(null);};}for(var e in events){if(events[_0x4c06('0x6')](e)){var event=events[e];FaxQueue[_0x4c06('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 80dd935..3044eea 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 _0x6831=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','util','api','bluebird'];(function(_0x2582c5,_0x169bea){var _0xda44c0=function(_0x7f2f24){while(--_0x7f2f24){_0x2582c5['push'](_0x2582c5['shift']());}};_0xda44c0(++_0x169bea);}(_0x6831,0x6b));var _0x1683=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6831[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x1683('0x0'));var logger=require('../../config/logger')(_0x1683('0x1'));var moment=require('moment');var BPromise=require(_0x1683('0x2'));var rp=require(_0x1683('0x3'));var fs=require('fs');var path=require(_0x1683('0x4'));var rimraf=require(_0x1683('0x5'));var config=require(_0x1683('0x6'));var attributes=require(_0x1683('0x7'));module[_0x1683('0x8')]=function(_0x50cea3,_0x4a9156){return _0x50cea3[_0x1683('0x9')](_0x1683('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9092=['api','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','../../config/logger'];(function(_0x2a13c4,_0x29fca8){var _0x1709b6=function(_0x4710a3){while(--_0x4710a3){_0x2a13c4['push'](_0x2a13c4['shift']());}};_0x1709b6(++_0x29fca8);}(_0x9092,0xa4));var _0x2909=function(_0x29580c,_0x51ec10){_0x29580c=_0x29580c-0x0;var _0x2d1713=_0x9092[_0x29580c];return _0x2d1713;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2909('0x0'))(_0x2909('0x1'));var moment=require('moment');var BPromise=require(_0x2909('0x2'));var rp=require(_0x2909('0x3'));var fs=require('fs');var path=require(_0x2909('0x4'));var rimraf=require('rimraf');var config=require(_0x2909('0x5'));var attributes=require(_0x2909('0x6'));module[_0x2909('0x7')]=function(_0x49823d,_0x4972a1){return _0x49823d[_0x2909('0x8')](_0x2909('0x9'),attributes,{'tableName':_0x2909('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 4ea391d..facc4ac 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 _0xcf53=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FaxQueue','findAll','options','raw','attributes','include','model','map','then','GetFaxQueue','ShowFaxQueue','lodash','util','moment','randomstring','ioredis'];(function(_0x500ec7,_0x4e7358){var _0x1519d2=function(_0x22737c){while(--_0x22737c){_0x500ec7['push'](_0x500ec7['shift']());}};_0x1519d2(++_0x4e7358);}(_0xcf53,0x93));var _0x3cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf53[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3cf5('0x0'));var util=require(_0x3cf5('0x1'));var moment=require(_0x3cf5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cf5('0x3'));var fs=require('fs');var Redis=require(_0x3cf5('0x4'));var db=require(_0x3cf5('0x5'))['db'];var utils=require(_0x3cf5('0x6'));var logger=require('../../config/logger')(_0x3cf5('0x7'));var config=require(_0x3cf5('0x8'));var jayson=require(_0x3cf5('0x9'));var client=jayson[_0x3cf5('0xa')][_0x3cf5('0xb')]({'port':0x232a});config['redis']=_[_0x3cf5('0xc')](config[_0x3cf5('0xd')],{'host':_0x3cf5('0xe'),'port':0x18eb});var socket=require(_0x3cf5('0xf'))(new Redis(config[_0x3cf5('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0xb45df6,_0x4a04c1,_0x36cdee){return new BPromise(function(_0x146909,_0x425ff3){return client[_0x3cf5('0x10')](_0xb45df6,_0x36cdee)['then'](function(_0x588436){logger[_0x3cf5('0x11')](_0x3cf5('0x12'),_0x4a04c1,'request\x20sent');logger[_0x3cf5('0x13')](_0x3cf5('0x14'),_0x4a04c1,_0x3cf5('0x15'),JSON[_0x3cf5('0x16')](_0x588436));if(_0x588436[_0x3cf5('0x17')]){if(_0x588436[_0x3cf5('0x17')][_0x3cf5('0x18')]===0x1f4){logger[_0x3cf5('0x17')](_0x3cf5('0x12'),_0x4a04c1,_0x588436[_0x3cf5('0x17')]['message']);return _0x425ff3(_0x588436[_0x3cf5('0x17')][_0x3cf5('0x19')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4a04c1,_0x588436[_0x3cf5('0x17')][_0x3cf5('0x19')]);return _0x146909(_0x588436['error']['message']);}else{logger[_0x3cf5('0x11')](_0x3cf5('0x12'),_0x4a04c1,'request\x20sent');_0x146909(_0x588436['result']['message']);}})[_0x3cf5('0x1a')](function(_0x45600f){logger['error'](_0x3cf5('0x12'),_0x4a04c1,_0x45600f);_0x425ff3(_0x45600f);});});}exports['GetFaxQueue']=function(_0x3a94a5){var _0x5e6f5a=this;return new Promise(function(_0x1eaaf0,_0x251cae){return db[_0x3cf5('0x1b')][_0x3cf5('0x1c')]({'raw':_0x3a94a5[_0x3cf5('0x1d')]?_0x3a94a5[_0x3cf5('0x1d')][_0x3cf5('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a94a5[_0x3cf5('0x1d')]?_0x3a94a5[_0x3cf5('0x1d')]['where']||null:null,'attributes':_0x3a94a5[_0x3cf5('0x1d')]?_0x3a94a5[_0x3cf5('0x1d')][_0x3cf5('0x1f')]||null:null,'limit':_0x3a94a5['options']?_0x3a94a5[_0x3cf5('0x1d')]['limit']||null:null,'include':_0x3a94a5[_0x3cf5('0x1d')]?_0x3a94a5[_0x3cf5('0x1d')][_0x3cf5('0x20')]?_['map'](_0x3a94a5[_0x3cf5('0x1d')][_0x3cf5('0x20')],function(_0x4e32b9){return{'model':db[_0x4e32b9[_0x3cf5('0x21')]],'as':_0x4e32b9['as'],'attributes':_0x4e32b9['attributes'],'include':_0x4e32b9[_0x3cf5('0x20')]?_[_0x3cf5('0x22')](_0x4e32b9[_0x3cf5('0x20')],function(_0x38d40d){return{'model':db[_0x38d40d['model']],'as':_0x38d40d['as'],'attributes':_0x38d40d[_0x3cf5('0x1f')],'include':_0x38d40d['include']?_[_0x3cf5('0x22')](_0x38d40d['include'],function(_0x274cab){return{'model':db[_0x274cab['model']],'as':_0x274cab['as'],'attributes':_0x274cab[_0x3cf5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3cf5('0x23')](function(_0x196f19){logger['info'](_0x3cf5('0x24'),_0x3a94a5);logger[_0x3cf5('0x13')](_0x3cf5('0x24'),_0x3a94a5,JSON['stringify'](_0x196f19));_0x1eaaf0(_0x196f19);})[_0x3cf5('0x1a')](function(_0x1a59e3){logger['error'](_0x3cf5('0x24'),_0x1a59e3[_0x3cf5('0x19')],_0x3a94a5);_0x251cae(_0x5e6f5a[_0x3cf5('0x17')](0x1f4,_0x1a59e3[_0x3cf5('0x19')]));});});};exports[_0x3cf5('0x25')]=function(_0x43d175){var _0x3f19d7=this;return new Promise(function(_0x4b8ce0,_0x2acf0e){return db[_0x3cf5('0x1b')]['find']({'raw':_0x43d175['options']?_0x43d175[_0x3cf5('0x1d')][_0x3cf5('0x1e')]===undefined?!![]:![]:!![],'where':_0x43d175[_0x3cf5('0x1d')]?_0x43d175[_0x3cf5('0x1d')]['where']||null:null,'attributes':_0x43d175[_0x3cf5('0x1d')]?_0x43d175[_0x3cf5('0x1d')]['attributes']||null:null,'include':_0x43d175[_0x3cf5('0x1d')]?_0x43d175[_0x3cf5('0x1d')][_0x3cf5('0x20')]?_[_0x3cf5('0x22')](_0x43d175[_0x3cf5('0x1d')]['include'],function(_0x33f620){return{'model':db[_0x33f620[_0x3cf5('0x21')]],'as':_0x33f620['as'],'attributes':_0x33f620[_0x3cf5('0x1f')],'include':_0x33f620[_0x3cf5('0x20')]?_[_0x3cf5('0x22')](_0x33f620['include'],function(_0x2390fd){return{'model':db[_0x2390fd[_0x3cf5('0x21')]],'as':_0x2390fd['as'],'attributes':_0x2390fd[_0x3cf5('0x1f')],'include':_0x2390fd['include']?_['map'](_0x2390fd[_0x3cf5('0x20')],function(_0x142d72){return{'model':db[_0x142d72[_0x3cf5('0x21')]],'as':_0x142d72['as'],'attributes':_0x142d72[_0x3cf5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e3b50){logger[_0x3cf5('0x11')]('ShowFaxQueue',_0x43d175);logger['debug'](_0x3cf5('0x25'),_0x43d175,JSON['stringify'](_0x2e3b50));_0x4b8ce0(_0x2e3b50);})[_0x3cf5('0x1a')](function(_0x1bd609){logger[_0x3cf5('0x17')](_0x3cf5('0x25'),_0x1bd609['message'],_0x43d175);_0x2acf0e(_0x3f19d7[_0x3cf5('0x17')](0x1f4,_0x1bd609[_0x3cf5('0x19')]));});});}; \ No newline at end of file +var _0xbb9b=['result','catch','GetFaxQueue','FaxQueue','findAll','options','where','include','map','model','attributes','debug','stringify','raw','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x45cdf2,_0x48753c){var _0xf809ce=function(_0xe238){while(--_0xe238){_0x45cdf2['push'](_0x45cdf2['shift']());}};_0xf809ce(++_0x48753c);}(_0xbb9b,0xe1));var _0xbbb9=function(_0x2a7812,_0x1ce83a){_0x2a7812=_0x2a7812-0x0;var _0x3e1342=_0xbb9b[_0x2a7812];return _0x3e1342;};'use strict';var _=require(_0xbbb9('0x0'));var util=require('util');var moment=require(_0xbbb9('0x1'));var BPromise=require(_0xbbb9('0x2'));var rs=require(_0xbbb9('0x3'));var fs=require('fs');var Redis=require(_0xbbb9('0x4'));var db=require(_0xbbb9('0x5'))['db'];var utils=require(_0xbbb9('0x6'));var logger=require(_0xbbb9('0x7'))(_0xbbb9('0x8'));var config=require(_0xbbb9('0x9'));var jayson=require(_0xbbb9('0xa'));var client=jayson[_0xbbb9('0xb')][_0xbbb9('0xc')]({'port':0x232a});config[_0xbbb9('0xd')]=_['defaults'](config[_0xbbb9('0xd')],{'host':_0xbbb9('0xe'),'port':0x18eb});var socket=require(_0xbbb9('0xf'))(new Redis(config[_0xbbb9('0xd')]));require(_0xbbb9('0x10'))[_0xbbb9('0x11')](socket);function respondWithRpcPromise(_0x2620ac,_0x2bf8e7,_0x22ca58){return new BPromise(function(_0x398d03,_0x2876f3){return client[_0xbbb9('0x12')](_0x2620ac,_0x22ca58)[_0xbbb9('0x13')](function(_0x251c53){logger['info'](_0xbbb9('0x14'),_0x2bf8e7,'request\x20sent');logger['debug'](_0xbbb9('0x15'),_0x2bf8e7,_0xbbb9('0x16'),JSON['stringify'](_0x251c53));if(_0x251c53[_0xbbb9('0x17')]){if(_0x251c53[_0xbbb9('0x17')][_0xbbb9('0x18')]===0x1f4){logger[_0xbbb9('0x17')]('FaxQueue,\x20%s,\x20%s',_0x2bf8e7,_0x251c53[_0xbbb9('0x17')][_0xbbb9('0x19')]);return _0x2876f3(_0x251c53[_0xbbb9('0x17')][_0xbbb9('0x19')]);}logger[_0xbbb9('0x17')](_0xbbb9('0x14'),_0x2bf8e7,_0x251c53[_0xbbb9('0x17')][_0xbbb9('0x19')]);return _0x398d03(_0x251c53[_0xbbb9('0x17')][_0xbbb9('0x19')]);}else{logger[_0xbbb9('0x1a')](_0xbbb9('0x14'),_0x2bf8e7,'request\x20sent');_0x398d03(_0x251c53[_0xbbb9('0x1b')]['message']);}})[_0xbbb9('0x1c')](function(_0x224b84){logger[_0xbbb9('0x17')](_0xbbb9('0x14'),_0x2bf8e7,_0x224b84);_0x2876f3(_0x224b84);});});}exports[_0xbbb9('0x1d')]=function(_0x158cf1){var _0x153090=this;return new Promise(function(_0x1ebb1a,_0x441fd3){return db[_0xbbb9('0x1e')][_0xbbb9('0x1f')]({'raw':_0x158cf1[_0xbbb9('0x20')]?_0x158cf1[_0xbbb9('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x158cf1[_0xbbb9('0x20')]?_0x158cf1[_0xbbb9('0x20')][_0xbbb9('0x21')]||null:null,'attributes':_0x158cf1[_0xbbb9('0x20')]?_0x158cf1[_0xbbb9('0x20')]['attributes']||null:null,'limit':_0x158cf1['options']?_0x158cf1[_0xbbb9('0x20')]['limit']||null:null,'include':_0x158cf1[_0xbbb9('0x20')]?_0x158cf1['options'][_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x158cf1['options'][_0xbbb9('0x22')],function(_0x4c350e){return{'model':db[_0x4c350e[_0xbbb9('0x24')]],'as':_0x4c350e['as'],'attributes':_0x4c350e['attributes'],'include':_0x4c350e[_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x4c350e['include'],function(_0x37bf4e){return{'model':db[_0x37bf4e['model']],'as':_0x37bf4e['as'],'attributes':_0x37bf4e[_0xbbb9('0x25')],'include':_0x37bf4e[_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x37bf4e[_0xbbb9('0x22')],function(_0x25b458){return{'model':db[_0x25b458[_0xbbb9('0x24')]],'as':_0x25b458['as'],'attributes':_0x25b458[_0xbbb9('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e427){logger[_0xbbb9('0x1a')](_0xbbb9('0x1d'),_0x158cf1);logger[_0xbbb9('0x26')]('GetFaxQueue',_0x158cf1,JSON[_0xbbb9('0x27')](_0x47e427));_0x1ebb1a(_0x47e427);})['catch'](function(_0x5708d8){logger[_0xbbb9('0x17')](_0xbbb9('0x1d'),_0x5708d8[_0xbbb9('0x19')],_0x158cf1);_0x441fd3(_0x153090[_0xbbb9('0x17')](0x1f4,_0x5708d8[_0xbbb9('0x19')]));});});};exports['ShowFaxQueue']=function(_0x44abf3){var _0x5199da=this;return new Promise(function(_0x38d317,_0x167f15){return db[_0xbbb9('0x1e')]['find']({'raw':_0x44abf3[_0xbbb9('0x20')]?_0x44abf3[_0xbbb9('0x20')][_0xbbb9('0x28')]===undefined?!![]:![]:!![],'where':_0x44abf3[_0xbbb9('0x20')]?_0x44abf3[_0xbbb9('0x20')][_0xbbb9('0x21')]||null:null,'attributes':_0x44abf3[_0xbbb9('0x20')]?_0x44abf3[_0xbbb9('0x20')]['attributes']||null:null,'include':_0x44abf3[_0xbbb9('0x20')]?_0x44abf3[_0xbbb9('0x20')][_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x44abf3[_0xbbb9('0x20')][_0xbbb9('0x22')],function(_0x1d4411){return{'model':db[_0x1d4411['model']],'as':_0x1d4411['as'],'attributes':_0x1d4411[_0xbbb9('0x25')],'include':_0x1d4411[_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x1d4411['include'],function(_0x595d34){return{'model':db[_0x595d34[_0xbbb9('0x24')]],'as':_0x595d34['as'],'attributes':_0x595d34['attributes'],'include':_0x595d34[_0xbbb9('0x22')]?_[_0xbbb9('0x23')](_0x595d34[_0xbbb9('0x22')],function(_0x44ad80){return{'model':db[_0x44ad80[_0xbbb9('0x24')]],'as':_0x44ad80['as'],'attributes':_0x44ad80['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbb9('0x13')](function(_0x17286b){logger[_0xbbb9('0x1a')](_0xbbb9('0x29'),_0x44abf3);logger[_0xbbb9('0x26')](_0xbbb9('0x29'),_0x44abf3,JSON[_0xbbb9('0x27')](_0x17286b));_0x38d317(_0x17286b);})[_0xbbb9('0x1c')](function(_0x5cfe85){logger[_0xbbb9('0x17')]('ShowFaxQueue',_0x5cfe85['message'],_0x44abf3);_0x167f15(_0x5199da['error'](0x1f4,_0x5cfe85['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index bdd1e46..fd376ad 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 _0x52f6=['removeListener','length','./faxQueue.events','save','emit'];(function(_0x52d416,_0x5060a5){var _0x4057d2=function(_0x2781a5){while(--_0x2781a5){_0x52d416['push'](_0x52d416['shift']());}};_0x4057d2(++_0x5060a5);}(_0x52f6,0x11f));var _0x652f=function(_0x5937f1,_0x5243d6){_0x5937f1=_0x5937f1-0x0;var _0x1b3deb=_0x52f6[_0x5937f1];return _0x1b3deb;};'use strict';var FaxQueueEvents=require(_0x652f('0x0'));var events=[_0x652f('0x1'),'remove','update'];function createListener(_0x3293c0,_0x42ff62){return function(_0x46b61d){_0x42ff62[_0x652f('0x2')](_0x3293c0,_0x46b61d);};}function removeListener(_0x2d674d,_0x50bbcf){return function(){FaxQueueEvents[_0x652f('0x3')](_0x2d674d,_0x50bbcf);};}exports['register']=function(_0x680040){for(var _0x1b7761=0x0,_0x414347=events[_0x652f('0x4')];_0x1b7761<_0x414347;_0x1b7761++){var _0x576b24=events[_0x1b7761];var _0x4b02f4=createListener('faxQueue:'+_0x576b24,_0x680040);FaxQueueEvents['on'](_0x576b24,_0x4b02f4);}}; \ No newline at end of file +var _0x9eb7=['removeListener','length','faxQueue:','remove','update','emit'];(function(_0x63d9a0,_0x236211){var _0x4b24b9=function(_0x1e70bf){while(--_0x1e70bf){_0x63d9a0['push'](_0x63d9a0['shift']());}};_0x4b24b9(++_0x236211);}(_0x9eb7,0x117));var _0x79eb=function(_0x9be01e,_0x39de52){_0x9be01e=_0x9be01e-0x0;var _0x1b9d90=_0x9eb7[_0x9be01e];return _0x1b9d90;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x79eb('0x0'),_0x79eb('0x1')];function createListener(_0x13115,_0x354996){return function(_0x48cea0){_0x354996[_0x79eb('0x2')](_0x13115,_0x48cea0);};}function removeListener(_0x59ba07,_0x53c385){return function(){FaxQueueEvents[_0x79eb('0x3')](_0x59ba07,_0x53c385);};}exports['register']=function(_0x44788c){for(var _0x492ad5=0x0,_0x333b61=events[_0x79eb('0x4')];_0x492ad5<_0x333b61;_0x492ad5++){var _0x55bfe7=events[_0x492ad5];var _0x131b99=createListener(_0x79eb('0x5')+_0x55bfe7,_0x44788c);FaxQueueEvents['on'](_0x55bfe7,_0x131b99);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a1de3ed..1358ec8 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 _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0xcf98,0x8d));var _0x8cf9=function(_0x213a92,_0x23ce0b){_0x213a92=_0x213a92-0x0;var _0x428586=_0xcf98[_0x213a92];return _0x428586;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file +var _0xf69c=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','removeTeams','delete','removeAgents','exports','multer'];(function(_0x15f1be,_0x41605b){var _0x363b03=function(_0x53c36b){while(--_0x53c36b){_0x15f1be['push'](_0x15f1be['shift']());}};_0x363b03(++_0x41605b);}(_0xf69c,0x151));var _0xcf69=function(_0x4b87a3,_0x3a698c){_0x4b87a3=_0x4b87a3-0x0;var _0x334112=_0xf69c[_0x4b87a3];return _0x334112;};'use strict';var multer=require(_0xcf69('0x0'));var util=require('util');var path=require(_0xcf69('0x1'));var timeout=require(_0xcf69('0x2'));var express=require('express');var router=express[_0xcf69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcf69('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcf69('0x5'));var controller=require('./faxQueue.controller');router[_0xcf69('0x6')]('/',auth[_0xcf69('0x7')](),controller[_0xcf69('0x8')]);router[_0xcf69('0x6')](_0xcf69('0x9'),auth['isAuthenticated'](),controller[_0xcf69('0xa')]);router[_0xcf69('0x6')](_0xcf69('0xb'),auth[_0xcf69('0x7')](),controller['show']);router[_0xcf69('0x6')](_0xcf69('0xc'),auth[_0xcf69('0x7')](),controller[_0xcf69('0xd')]);router[_0xcf69('0x6')](_0xcf69('0xe'),auth['isAuthenticated'](),controller[_0xcf69('0xf')]);router['get'](_0xcf69('0x10'),auth[_0xcf69('0x7')](),controller[_0xcf69('0x11')]);router[_0xcf69('0x12')]('/',auth[_0xcf69('0x7')](),controller[_0xcf69('0x13')]);router[_0xcf69('0x12')](_0xcf69('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth[_0xcf69('0x7')](),controller['addAgents']);router[_0xcf69('0x14')](_0xcf69('0xb'),auth[_0xcf69('0x7')](),controller[_0xcf69('0x15')]);router['delete'](_0xcf69('0xb'),auth[_0xcf69('0x7')](),controller['destroy']);router['delete'](_0xcf69('0xe'),auth[_0xcf69('0x7')](),controller[_0xcf69('0x16')]);router[_0xcf69('0x17')](_0xcf69('0x10'),auth[_0xcf69('0x7')](),controller[_0xcf69('0x18')]);module[_0xcf69('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d74283e..2f7bf47 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 _0x9f29=['moment','sequelize','exports','STRING','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9f29,0x64));var _0x99f2=function(_0x27f5df,_0x4c86c3){_0x27f5df=_0x27f5df-0x0;var _0x1e4012=_0x9f29[_0x27f5df];return _0x1e4012;};'use strict';var moment=require(_0x99f2('0x0'));var Sequelize=require(_0x99f2('0x1'));module[_0x99f2('0x2')]={'uniqueid':{'type':Sequelize[_0x99f2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x99f2('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x99f2('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x400b=['moment','sequelize','exports','STRING','DATE'];(function(_0x18ac40,_0x53b34a){var _0x2a726b=function(_0x528359){while(--_0x528359){_0x18ac40['push'](_0x18ac40['shift']());}};_0x2a726b(++_0x53b34a);}(_0x400b,0x1e5));var _0xb400=function(_0x2692ea,_0x3631b8){_0x2692ea=_0x2692ea-0x0;var _0x369cd8=_0x400b[_0x2692ea];return _0x369cd8;};'use strict';var moment=require(_0xb400('0x0'));var Sequelize=require(_0xb400('0x1'));module[_0xb400('0x2')]={'uniqueid':{'type':Sequelize[_0xb400('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb400('0x4')]},'leaveAt':{'type':Sequelize[_0xb400('0x4')]},'acceptAt':{'type':Sequelize[_0xb400('0x4')]},'exitAt':{'type':Sequelize[_0xb400('0x4')]},'reason':{'type':Sequelize[_0xb400('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 323aad4..97b03e7 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 _0x153f=['update','then','destroy','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save'];(function(_0x71d00d,_0x3c7fc3){var _0x578f51=function(_0x4f21ec){while(--_0x4f21ec){_0x71d00d['push'](_0x71d00d['shift']());}};_0x578f51(++_0x3c7fc3);}(_0x153f,0x15b));var _0xf153=function(_0x16ce33,_0x4f3c22){_0x16ce33=_0x16ce33-0x0;var _0x27eca1=_0x153f[_0x16ce33];return _0x27eca1;};'use strict';var emlformat=require(_0xf153('0x0'));var rimraf=require(_0xf153('0x1'));var zipdir=require(_0xf153('0x2'));var jsonpatch=require(_0xf153('0x3'));var rp=require(_0xf153('0x4'));var moment=require(_0xf153('0x5'));var BPromise=require(_0xf153('0x6'));var Mustache=require('mustache');var util=require(_0xf153('0x7'));var path=require('path');var sox=require(_0xf153('0x8'));var csv=require(_0xf153('0x9'));var ejs=require(_0xf153('0xa'));var fs=require('fs');var fs_extra=require(_0xf153('0xb'));var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0x9'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf153('0x19'));var db=require(_0xf153('0x1a'))['db'];function respondWithStatusCode(_0x65756d,_0x1cc666){_0x1cc666=_0x1cc666||0xcc;return function(_0x256b7d){if(_0x256b7d){return _0x65756d[_0xf153('0x1b')](_0x1cc666);}return _0x65756d[_0xf153('0x1c')](_0x1cc666)[_0xf153('0x1d')]();};}function respondWithResult(_0x3e34fb,_0x4c5283){_0x4c5283=_0x4c5283||0xc8;return function(_0x18be7e){if(_0x18be7e){return _0x3e34fb[_0xf153('0x1c')](_0x4c5283)[_0xf153('0x1e')](_0x18be7e);}};}function respondWithFilteredResult(_0x406e6f,_0x3afea2){return function(_0x68f436){if(_0x68f436){var _0x273a90=typeof _0x3afea2[_0xf153('0x1f')]==='undefined'&&typeof _0x3afea2[_0xf153('0x20')]==='undefined';var _0x37093a=_0x68f436[_0xf153('0x21')];var _0x138dbe=_0x273a90?0x0:_0x3afea2[_0xf153('0x1f')];var _0x4e790d=_0x273a90?_0x68f436[_0xf153('0x21')]:_0x3afea2[_0xf153('0x1f')]+_0x3afea2[_0xf153('0x20')];var _0x14b83f;if(_0x4e790d>=_0x37093a){_0x4e790d=_0x37093a;_0x14b83f=0xc8;}else{_0x14b83f=0xce;}_0x406e6f[_0xf153('0x1c')](_0x14b83f);return _0x406e6f[_0xf153('0x22')](_0xf153('0x23'),_0x138dbe+'-'+_0x4e790d+'/'+_0x37093a)[_0xf153('0x1e')](_0x68f436);}return null;};}function patchUpdates(_0x3735a7){return function(_0x1dd340){try{jsonpatch[_0xf153('0x24')](_0x1dd340,_0x3735a7,!![]);}catch(_0x3665a2){return BPromise['reject'](_0x3665a2);}return _0x1dd340[_0xf153('0x25')]();};}function saveUpdates(_0x395f28,_0x3d3e41){return function(_0x32e759){if(_0x32e759){return _0x32e759[_0xf153('0x26')](_0x395f28)[_0xf153('0x27')](function(_0x465d88){return _0x465d88;});}return null;};}function removeEntity(_0x4376f7,_0xf67cde){return function(_0x38190c){if(_0x38190c){return _0x38190c[_0xf153('0x28')]()[_0xf153('0x27')](function(){_0x4376f7[_0xf153('0x1c')](0xcc)[_0xf153('0x1d')]();});}};}function handleEntityNotFound(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(!_0x141ef4){_0xe490f8[_0xf153('0x1b')](0x194);}return _0x141ef4;};}function handleError(_0x23acc3,_0x17f7a4){_0x17f7a4=_0x17f7a4||0x1f4;return function(_0x48ebdc){logger[_0xf153('0x29')](_0x48ebdc[_0xf153('0x2a')]);if(_0x48ebdc['name']){delete _0x48ebdc[_0xf153('0x2b')];}_0x23acc3[_0xf153('0x1c')](_0x17f7a4)['send'](_0x48ebdc);};}exports[_0xf153('0x2c')]=function(_0x10295e,_0x261ac0){var _0x2b9a9c={},_0x339e96={},_0x258976={'count':0x0,'rows':[]};var _0x441436=_[_0xf153('0x2d')](db[_0xf153('0x2e')][_0xf153('0x2f')],function(_0x13b541){return{'name':_0x13b541[_0xf153('0x30')],'type':_0x13b541['type'][_0xf153('0x31')]};});_0x339e96[_0xf153('0x32')]=_[_0xf153('0x2d')](_0x441436,_0xf153('0x2b'));_0x339e96['query']=_['keys'](_0x10295e[_0xf153('0x33')]);_0x339e96['filters']=_['intersection'](_0x339e96[_0xf153('0x32')],_0x339e96['query']);_0x2b9a9c[_0xf153('0x34')]=_['intersection'](_0x339e96[_0xf153('0x32')],qs[_0xf153('0x35')](_0x10295e['query'][_0xf153('0x35')]));_0x2b9a9c[_0xf153('0x34')]=_0x2b9a9c[_0xf153('0x34')][_0xf153('0x36')]?_0x2b9a9c[_0xf153('0x34')]:_0x339e96[_0xf153('0x32')];if(!_0x10295e['query'][_0xf153('0x37')]('nolimit')){_0x2b9a9c[_0xf153('0x20')]=qs[_0xf153('0x20')](_0x10295e[_0xf153('0x33')][_0xf153('0x20')]);_0x2b9a9c[_0xf153('0x1f')]=qs[_0xf153('0x1f')](_0x10295e['query'][_0xf153('0x1f')]);}_0x2b9a9c[_0xf153('0x38')]=qs[_0xf153('0x39')](_0x10295e['query'][_0xf153('0x39')]);_0x2b9a9c[_0xf153('0x3a')]=qs[_0xf153('0x3b')](_[_0xf153('0x3c')](_0x10295e[_0xf153('0x33')],_0x339e96[_0xf153('0x3b')]),_0x441436);if(_0x10295e['query'][_0xf153('0x3d')]){_0x2b9a9c[_0xf153('0x3a')]=_['merge'](_0x2b9a9c[_0xf153('0x3a')],{'$or':_[_0xf153('0x2d')](_0x441436,function(_0x357666){if(_0x357666[_0xf153('0x3e')]!==_0xf153('0x3f')){var _0x42360a={};_0x42360a[_0x357666[_0xf153('0x2b')]]={'$like':'%'+_0x10295e['query'][_0xf153('0x3d')]+'%'};return _0x42360a;}})});}_0x2b9a9c=_[_0xf153('0x40')]({},_0x2b9a9c,_0x10295e[_0xf153('0x41')]);var _0x352e7c={'where':_0x2b9a9c[_0xf153('0x3a')]};return db[_0xf153('0x2e')]['count'](_0x352e7c)['then'](function(_0xa3922b){_0x258976['count']=_0xa3922b;if(_0x10295e[_0xf153('0x33')][_0xf153('0x42')]){_0x2b9a9c[_0xf153('0x43')]=[{'all':!![]}];}return db[_0xf153('0x2e')][_0xf153('0x44')](_0x2b9a9c);})[_0xf153('0x27')](function(_0x5599e5){_0x258976['rows']=_0x5599e5;return _0x258976;})[_0xf153('0x27')](respondWithFilteredResult(_0x261ac0,_0x2b9a9c))[_0xf153('0x45')](handleError(_0x261ac0,null));};exports['show']=function(_0x21529a,_0x1c77a6){var _0x1edf65={'raw':!![],'where':{'id':_0x21529a[_0xf153('0x46')]['id']}},_0x3a9cb2={};_0x3a9cb2[_0xf153('0x32')]=_[_0xf153('0x47')](db[_0xf153('0x2e')][_0xf153('0x2f')]);_0x3a9cb2[_0xf153('0x33')]=_[_0xf153('0x47')](_0x21529a[_0xf153('0x33')]);_0x3a9cb2['filters']=_[_0xf153('0x48')](_0x3a9cb2[_0xf153('0x32')],_0x3a9cb2[_0xf153('0x33')]);_0x1edf65['attributes']=_[_0xf153('0x48')](_0x3a9cb2[_0xf153('0x32')],qs['fields'](_0x21529a[_0xf153('0x33')]['fields']));_0x1edf65[_0xf153('0x34')]=_0x1edf65[_0xf153('0x34')][_0xf153('0x36')]?_0x1edf65['attributes']:_0x3a9cb2[_0xf153('0x32')];if(_0x21529a[_0xf153('0x33')][_0xf153('0x42')]){_0x1edf65[_0xf153('0x43')]=[{'all':!![]}];}_0x1edf65=_[_0xf153('0x40')]({},_0x1edf65,_0x21529a['options']);return db[_0xf153('0x2e')][_0xf153('0x49')](_0x1edf65)['then'](handleEntityNotFound(_0x1c77a6,null))[_0xf153('0x27')](respondWithResult(_0x1c77a6,null))[_0xf153('0x45')](handleError(_0x1c77a6,null));};exports[_0xf153('0x4a')]=function(_0x5599a6,_0x657403){return db[_0xf153('0x2e')][_0xf153('0x4a')](_0x5599a6[_0xf153('0x4b')],{})[_0xf153('0x27')](respondWithResult(_0x657403,0xc9))[_0xf153('0x45')](handleError(_0x657403,null));};exports[_0xf153('0x26')]=function(_0x33e48,_0x3b91ed){if(_0x33e48['body']['id']){delete _0x33e48[_0xf153('0x4b')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x33e48['params']['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x3b91ed,null))[_0xf153('0x27')](saveUpdates(_0x33e48['body'],null))[_0xf153('0x27')](respondWithResult(_0x3b91ed,null))[_0xf153('0x45')](handleError(_0x3b91ed,null));};exports['destroy']=function(_0x3f1ecb,_0xe6e023){return db[_0xf153('0x2e')][_0xf153('0x49')]({'where':{'id':_0x3f1ecb[_0xf153('0x46')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0xe6e023,null))['then'](removeEntity(_0xe6e023,null))[_0xf153('0x45')](handleError(_0xe6e023,null));};exports[_0xf153('0x4c')]=function(_0x4dca55,_0x566a65){return db[_0xf153('0x2e')][_0xf153('0x4c')]()[_0xf153('0x27')](respondWithResult(_0x566a65,null))[_0xf153('0x45')](handleError(_0x566a65,null));}; \ No newline at end of file +var _0xc9b7=['end','offset','count','limit','Content-Range','json','reject','save','update','then','destroy','stack','index','map','FaxQueueReport','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','keys','rawAttributes','include','find','create','body','catch','params','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x307aad,_0x270a9b){var _0x42eed6=function(_0x19f361){while(--_0x19f361){_0x307aad['push'](_0x307aad['shift']());}};_0x42eed6(++_0x270a9b);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x213969,_0x303344){_0x213969=_0x213969-0x0;var _0x5f4fca=_0xc9b7[_0x213969];return _0x5f4fca;};'use strict';var emlformat=require(_0x7c9b('0x0'));var rimraf=require(_0x7c9b('0x1'));var zipdir=require(_0x7c9b('0x2'));var jsonpatch=require(_0x7c9b('0x3'));var rp=require('request-promise');var moment=require(_0x7c9b('0x4'));var BPromise=require(_0x7c9b('0x5'));var Mustache=require('mustache');var util=require(_0x7c9b('0x6'));var path=require(_0x7c9b('0x7'));var sox=require(_0x7c9b('0x8'));var csv=require(_0x7c9b('0x9'));var ejs=require(_0x7c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x7c9b('0xb'));var _=require(_0x7c9b('0xc'));var squel=require(_0x7c9b('0xd'));var crypto=require(_0x7c9b('0xe'));var jsforce=require(_0x7c9b('0xf'));var deskjs=require(_0x7c9b('0x10'));var toCsv=require(_0x7c9b('0x9'));var querystring=require(_0x7c9b('0x11'));var Papa=require(_0x7c9b('0x12'));var Redis=require(_0x7c9b('0x13'));var authService=require(_0x7c9b('0x14'));var qs=require(_0x7c9b('0x15'));var as=require(_0x7c9b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c9b('0x17'))(_0x7c9b('0x18'));var utils=require(_0x7c9b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7c9b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6b13,_0x42362a){_0x42362a=_0x42362a||0xcc;return function(_0x4cdc09){if(_0x4cdc09){return _0x1e6b13[_0x7c9b('0x1b')](_0x42362a);}return _0x1e6b13[_0x7c9b('0x1c')](_0x42362a)[_0x7c9b('0x1d')]();};}function respondWithResult(_0x2e8001,_0x56f49d){_0x56f49d=_0x56f49d||0xc8;return function(_0x1ec7dd){if(_0x1ec7dd){return _0x2e8001[_0x7c9b('0x1c')](_0x56f49d)['json'](_0x1ec7dd);}};}function respondWithFilteredResult(_0x2f1ecb,_0x482e81){return function(_0x86a9ca){if(_0x86a9ca){var _0x2f1967=typeof _0x482e81[_0x7c9b('0x1e')]==='undefined'&&typeof _0x482e81['limit']==='undefined';var _0x3206b7=_0x86a9ca[_0x7c9b('0x1f')];var _0x2bb448=_0x2f1967?0x0:_0x482e81[_0x7c9b('0x1e')];var _0x18d6d5=_0x2f1967?_0x86a9ca[_0x7c9b('0x1f')]:_0x482e81['offset']+_0x482e81[_0x7c9b('0x20')];var _0x132dbe;if(_0x18d6d5>=_0x3206b7){_0x18d6d5=_0x3206b7;_0x132dbe=0xc8;}else{_0x132dbe=0xce;}_0x2f1ecb[_0x7c9b('0x1c')](_0x132dbe);return _0x2f1ecb['set'](_0x7c9b('0x21'),_0x2bb448+'-'+_0x18d6d5+'/'+_0x3206b7)[_0x7c9b('0x22')](_0x86a9ca);}return null;};}function patchUpdates(_0xb7c53e){return function(_0x456f81){try{jsonpatch['apply'](_0x456f81,_0xb7c53e,!![]);}catch(_0x4321c3){return BPromise[_0x7c9b('0x23')](_0x4321c3);}return _0x456f81[_0x7c9b('0x24')]();};}function saveUpdates(_0x4ca682,_0x1583ab){return function(_0x4d68be){if(_0x4d68be){return _0x4d68be[_0x7c9b('0x25')](_0x4ca682)[_0x7c9b('0x26')](function(_0x1f8b22){return _0x1f8b22;});}return null;};}function removeEntity(_0x3e4282,_0x1be41b){return function(_0x4c080c){if(_0x4c080c){return _0x4c080c[_0x7c9b('0x27')]()[_0x7c9b('0x26')](function(){_0x3e4282[_0x7c9b('0x1c')](0xcc)[_0x7c9b('0x1d')]();});}};}function handleEntityNotFound(_0x23be90,_0x17b63c){return function(_0x816979){if(!_0x816979){_0x23be90[_0x7c9b('0x1b')](0x194);}return _0x816979;};}function handleError(_0x269b60,_0x3750ce){_0x3750ce=_0x3750ce||0x1f4;return function(_0x47d843){logger['error'](_0x47d843[_0x7c9b('0x28')]);if(_0x47d843['name']){delete _0x47d843['name'];}_0x269b60[_0x7c9b('0x1c')](_0x3750ce)['send'](_0x47d843);};}exports[_0x7c9b('0x29')]=function(_0x17b477,_0x722b0d){var _0x17cf3c={},_0x2a7afe={},_0x2cbe6f={'count':0x0,'rows':[]};var _0x1bd094=_[_0x7c9b('0x2a')](db[_0x7c9b('0x2b')]['rawAttributes'],function(_0x405709){return{'name':_0x405709[_0x7c9b('0x2c')],'type':_0x405709[_0x7c9b('0x2d')][_0x7c9b('0x2e')]};});_0x2a7afe[_0x7c9b('0x2f')]=_[_0x7c9b('0x2a')](_0x1bd094,_0x7c9b('0x30'));_0x2a7afe[_0x7c9b('0x31')]=_['keys'](_0x17b477['query']);_0x2a7afe[_0x7c9b('0x32')]=_[_0x7c9b('0x33')](_0x2a7afe[_0x7c9b('0x2f')],_0x2a7afe[_0x7c9b('0x31')]);_0x17cf3c[_0x7c9b('0x34')]=_[_0x7c9b('0x33')](_0x2a7afe[_0x7c9b('0x2f')],qs[_0x7c9b('0x35')](_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x35')]));_0x17cf3c[_0x7c9b('0x34')]=_0x17cf3c[_0x7c9b('0x34')]['length']?_0x17cf3c[_0x7c9b('0x34')]:_0x2a7afe[_0x7c9b('0x2f')];if(!_0x17b477['query'][_0x7c9b('0x36')](_0x7c9b('0x37'))){_0x17cf3c[_0x7c9b('0x20')]=qs[_0x7c9b('0x20')](_0x17b477['query'][_0x7c9b('0x20')]);_0x17cf3c[_0x7c9b('0x1e')]=qs[_0x7c9b('0x1e')](_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x1e')]);}_0x17cf3c[_0x7c9b('0x38')]=qs[_0x7c9b('0x39')](_0x17b477['query'][_0x7c9b('0x39')]);_0x17cf3c['where']=qs['filters'](_[_0x7c9b('0x3a')](_0x17b477[_0x7c9b('0x31')],_0x2a7afe[_0x7c9b('0x32')]),_0x1bd094);if(_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x3b')]){_0x17cf3c[_0x7c9b('0x3c')]=_[_0x7c9b('0x3d')](_0x17cf3c[_0x7c9b('0x3c')],{'$or':_['map'](_0x1bd094,function(_0x559d99){if(_0x559d99[_0x7c9b('0x2d')]!==_0x7c9b('0x3e')){var _0x2a5fc4={};_0x2a5fc4[_0x559d99[_0x7c9b('0x30')]]={'$like':'%'+_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x3b')]+'%'};return _0x2a5fc4;}})});}_0x17cf3c=_[_0x7c9b('0x3d')]({},_0x17cf3c,_0x17b477[_0x7c9b('0x3f')]);var _0x1a21e2={'where':_0x17cf3c[_0x7c9b('0x3c')]};return db[_0x7c9b('0x2b')][_0x7c9b('0x1f')](_0x1a21e2)['then'](function(_0x21c04c){_0x2cbe6f[_0x7c9b('0x1f')]=_0x21c04c;if(_0x17b477[_0x7c9b('0x31')]['includeAll']){_0x17cf3c['include']=[{'all':!![]}];}return db[_0x7c9b('0x2b')][_0x7c9b('0x40')](_0x17cf3c);})[_0x7c9b('0x26')](function(_0x560bc3){_0x2cbe6f[_0x7c9b('0x41')]=_0x560bc3;return _0x2cbe6f;})['then'](respondWithFilteredResult(_0x722b0d,_0x17cf3c))['catch'](handleError(_0x722b0d,null));};exports[_0x7c9b('0x42')]=function(_0x4d070e,_0x36a4c8){var _0x1a4817={'raw':!![],'where':{'id':_0x4d070e['params']['id']}},_0xc2cae5={};_0xc2cae5[_0x7c9b('0x2f')]=_[_0x7c9b('0x43')](db[_0x7c9b('0x2b')][_0x7c9b('0x44')]);_0xc2cae5['query']=_[_0x7c9b('0x43')](_0x4d070e[_0x7c9b('0x31')]);_0xc2cae5[_0x7c9b('0x32')]=_[_0x7c9b('0x33')](_0xc2cae5[_0x7c9b('0x2f')],_0xc2cae5[_0x7c9b('0x31')]);_0x1a4817[_0x7c9b('0x34')]=_[_0x7c9b('0x33')](_0xc2cae5[_0x7c9b('0x2f')],qs[_0x7c9b('0x35')](_0x4d070e['query'][_0x7c9b('0x35')]));_0x1a4817['attributes']=_0x1a4817[_0x7c9b('0x34')]['length']?_0x1a4817[_0x7c9b('0x34')]:_0xc2cae5[_0x7c9b('0x2f')];if(_0x4d070e[_0x7c9b('0x31')]['includeAll']){_0x1a4817[_0x7c9b('0x45')]=[{'all':!![]}];}_0x1a4817=_['merge']({},_0x1a4817,_0x4d070e[_0x7c9b('0x3f')]);return db[_0x7c9b('0x2b')][_0x7c9b('0x46')](_0x1a4817)[_0x7c9b('0x26')](handleEntityNotFound(_0x36a4c8,null))[_0x7c9b('0x26')](respondWithResult(_0x36a4c8,null))['catch'](handleError(_0x36a4c8,null));};exports[_0x7c9b('0x47')]=function(_0x162537,_0x2ce1ce){return db[_0x7c9b('0x2b')][_0x7c9b('0x47')](_0x162537[_0x7c9b('0x48')],{})[_0x7c9b('0x26')](respondWithResult(_0x2ce1ce,0xc9))[_0x7c9b('0x49')](handleError(_0x2ce1ce,null));};exports['update']=function(_0x37428b,_0x4ab845){if(_0x37428b[_0x7c9b('0x48')]['id']){delete _0x37428b[_0x7c9b('0x48')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x37428b[_0x7c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ab845,null))['then'](saveUpdates(_0x37428b[_0x7c9b('0x48')],null))[_0x7c9b('0x26')](respondWithResult(_0x4ab845,null))[_0x7c9b('0x49')](handleError(_0x4ab845,null));};exports[_0x7c9b('0x27')]=function(_0x36131c,_0x2bfca0){return db[_0x7c9b('0x2b')]['find']({'where':{'id':_0x36131c[_0x7c9b('0x4a')]['id']}})[_0x7c9b('0x26')](handleEntityNotFound(_0x2bfca0,null))[_0x7c9b('0x26')](removeEntity(_0x2bfca0,null))[_0x7c9b('0x49')](handleError(_0x2bfca0,null));};exports[_0x7c9b('0x4b')]=function(_0x5c70b0,_0x359a6b){return db['FaxQueueReport'][_0x7c9b('0x4b')]()[_0x7c9b('0x26')](respondWithResult(_0x359a6b,null))[_0x7c9b('0x49')](handleError(_0x359a6b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index fe14474..92167bc 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x166a20,_0x2f5fc3){var _0xa25dae=function(_0x21379c){while(--_0x21379c){_0x166a20['push'](_0x166a20['shift']());}};_0xa25dae(++_0x2f5fc3);}(_0x1261,0x144));var _0x1126=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x1261[_0xb6e43];return _0x47c40f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x17ffae,_0x1d1197){var _0xce7ce7=function(_0x5876c8){while(--_0x5876c8){_0x17ffae['push'](_0x17ffae['shift']());}};_0xce7ce7(++_0x1d1197);}(_0xabce,0x103));var _0xeabc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xabce[_0x5b78e8];return _0xf2c321;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 83a5fb1..07a4764 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 _0xbb7a=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit'];(function(_0x4e4c03,_0x15f9b7){var _0x5e5192=function(_0x166ae9){while(--_0x166ae9){_0x4e4c03['push'](_0x4e4c03['shift']());}};_0x5e5192(++_0x15f9b7);}(_0xbb7a,0x108));var _0xabb7=function(_0x44b8af,_0x3c648a){_0x44b8af=_0x44b8af-0x0;var _0x52e59b=_0xbb7a[_0x44b8af];return _0x52e59b;};'use strict';var _=require(_0xabb7('0x0'));var util=require(_0xabb7('0x1'));var moment=require(_0xabb7('0x2'));var BPromise=require(_0xabb7('0x3'));var rs=require(_0xabb7('0x4'));var fs=require('fs');var Redis=require(_0xabb7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabb7('0x6'));var logger=require('../../config/logger')(_0xabb7('0x7'));var config=require(_0xabb7('0x8'));var jayson=require(_0xabb7('0x9'));var client=jayson[_0xabb7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575f94,_0x16f2ae,_0x2b9651){return new BPromise(function(_0x1aa435,_0x8e7f52){return client['request'](_0x575f94,_0x2b9651)[_0xabb7('0xb')](function(_0x30bd46){logger[_0xabb7('0xc')](_0xabb7('0xd'),_0x16f2ae,_0xabb7('0xe'));logger[_0xabb7('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x16f2ae,_0xabb7('0xe'),JSON[_0xabb7('0x10')](_0x30bd46));if(_0x30bd46[_0xabb7('0x11')]){if(_0x30bd46[_0xabb7('0x11')][_0xabb7('0x12')]===0x1f4){logger['error'](_0xabb7('0xd'),_0x16f2ae,_0x30bd46['error'][_0xabb7('0x13')]);return _0x8e7f52(_0x30bd46[_0xabb7('0x11')][_0xabb7('0x13')]);}logger[_0xabb7('0x11')](_0xabb7('0xd'),_0x16f2ae,_0x30bd46['error'][_0xabb7('0x13')]);return _0x1aa435(_0x30bd46[_0xabb7('0x11')][_0xabb7('0x13')]);}else{logger[_0xabb7('0xc')](_0xabb7('0xd'),_0x16f2ae,_0xabb7('0xe'));_0x1aa435(_0x30bd46[_0xabb7('0x14')]['message']);}})[_0xabb7('0x15')](function(_0x44fb52){logger[_0xabb7('0x11')](_0xabb7('0xd'),_0x16f2ae,_0x44fb52);_0x8e7f52(_0x44fb52);});});}exports['CreateFaxQueueReport']=function(_0x559c88){var _0x43288b=this;return new Promise(function(_0x2187a5,_0x2250e4){return db[_0xabb7('0x16')][_0xabb7('0x17')](_0x559c88[_0xabb7('0x18')],{'raw':_0x559c88[_0xabb7('0x19')]?_0x559c88['options'][_0xabb7('0x1a')]===undefined?!![]:![]:!![]})[_0xabb7('0xb')](function(_0x58704b){logger[_0xabb7('0xc')](_0xabb7('0x1b'),_0x559c88);logger['debug'](_0xabb7('0x1b'),_0x559c88,JSON[_0xabb7('0x10')](_0x58704b));_0x2187a5(_0x58704b);})[_0xabb7('0x15')](function(_0x3523f5){logger['error'](_0xabb7('0x1b'),_0x3523f5[_0xabb7('0x13')],_0x559c88);_0x2250e4(_0x43288b[_0xabb7('0x11')](0x1f4,_0x3523f5[_0xabb7('0x13')]));});});};exports[_0xabb7('0x1c')]=function(_0x495561){var _0xcf7938=this;return new Promise(function(_0x585a11,_0x109b30){return db[_0xabb7('0x16')][_0xabb7('0x1d')](_0x495561[_0xabb7('0x18')],{'raw':_0x495561[_0xabb7('0x19')]?_0x495561[_0xabb7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495561[_0xabb7('0x19')]?_0x495561['options'][_0xabb7('0x1e')]||null:null,'attributes':_0x495561[_0xabb7('0x19')]?_0x495561[_0xabb7('0x19')][_0xabb7('0x1f')]||null:null,'limit':_0x495561[_0xabb7('0x19')]?_0x495561[_0xabb7('0x19')][_0xabb7('0x20')]||null:null})[_0xabb7('0xb')](function(_0x508d71){logger['info']('UpdateFaxQueueReport',_0x495561);logger['debug'](_0xabb7('0x1c'),_0x495561,JSON[_0xabb7('0x10')](_0x508d71));_0x585a11(_0x508d71);})[_0xabb7('0x15')](function(_0xf765d8){logger[_0xabb7('0x11')](_0xabb7('0x1c'),_0xf765d8[_0xabb7('0x13')],_0x495561);_0x109b30(_0xcf7938[_0xabb7('0x11')](0x1f4,_0xf765d8[_0xabb7('0x13')]));});});}; \ No newline at end of file +var _0xd190=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateFaxQueueReport','FaxQueueReport','create','options','stringify','update','where','attributes','limit','UpdateFaxQueueReport','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s'];(function(_0x36ff86,_0x55c2c1){var _0x4bca97=function(_0x3ad445){while(--_0x3ad445){_0x36ff86['push'](_0x36ff86['shift']());}};_0x4bca97(++_0x55c2c1);}(_0xd190,0x10b));var _0x0d19=function(_0x325a33,_0x272e69){_0x325a33=_0x325a33-0x0;var _0x569bc3=_0xd190[_0x325a33];return _0x569bc3;};'use strict';var _=require('lodash');var util=require(_0x0d19('0x0'));var moment=require(_0x0d19('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d19('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d19('0x3'))['db'];var utils=require(_0x0d19('0x4'));var logger=require(_0x0d19('0x5'))(_0x0d19('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d19('0x7'));var client=jayson['client'][_0x0d19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561ac4,_0x3e0943,_0x112266){return new BPromise(function(_0x2fda87,_0x5022ee){return client[_0x0d19('0x9')](_0x561ac4,_0x112266)[_0x0d19('0xa')](function(_0x564bef){logger['info'](_0x0d19('0xb'),_0x3e0943,'request\x20sent');logger[_0x0d19('0xc')](_0x0d19('0xd'),_0x3e0943,_0x0d19('0xe'),JSON['stringify'](_0x564bef));if(_0x564bef[_0x0d19('0xf')]){if(_0x564bef['error'][_0x0d19('0x10')]===0x1f4){logger[_0x0d19('0xf')](_0x0d19('0xb'),_0x3e0943,_0x564bef[_0x0d19('0xf')][_0x0d19('0x11')]);return _0x5022ee(_0x564bef['error'][_0x0d19('0x11')]);}logger[_0x0d19('0xf')](_0x0d19('0xb'),_0x3e0943,_0x564bef[_0x0d19('0xf')][_0x0d19('0x11')]);return _0x2fda87(_0x564bef['error'][_0x0d19('0x11')]);}else{logger[_0x0d19('0x12')](_0x0d19('0xb'),_0x3e0943,_0x0d19('0xe'));_0x2fda87(_0x564bef[_0x0d19('0x13')]['message']);}})['catch'](function(_0x30eb7a){logger[_0x0d19('0xf')](_0x0d19('0xb'),_0x3e0943,_0x30eb7a);_0x5022ee(_0x30eb7a);});});}exports[_0x0d19('0x14')]=function(_0xc83343){var _0x28248e=this;return new Promise(function(_0x32bb25,_0x5e5357){return db[_0x0d19('0x15')][_0x0d19('0x16')](_0xc83343['body'],{'raw':_0xc83343[_0x0d19('0x17')]?_0xc83343[_0x0d19('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0d19('0xa')](function(_0x3f1d5d){logger[_0x0d19('0x12')]('CreateFaxQueueReport',_0xc83343);logger[_0x0d19('0xc')]('CreateFaxQueueReport',_0xc83343,JSON[_0x0d19('0x18')](_0x3f1d5d));_0x32bb25(_0x3f1d5d);})['catch'](function(_0x29a784){logger[_0x0d19('0xf')](_0x0d19('0x14'),_0x29a784['message'],_0xc83343);_0x5e5357(_0x28248e[_0x0d19('0xf')](0x1f4,_0x29a784[_0x0d19('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0xc60609){var _0x4ae2a7=this;return new Promise(function(_0x4fc910,_0x4cc9bd){return db['FaxQueueReport'][_0x0d19('0x19')](_0xc60609['body'],{'raw':_0xc60609[_0x0d19('0x17')]?_0xc60609['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc60609[_0x0d19('0x17')]?_0xc60609[_0x0d19('0x17')][_0x0d19('0x1a')]||null:null,'attributes':_0xc60609[_0x0d19('0x17')]?_0xc60609[_0x0d19('0x17')][_0x0d19('0x1b')]||null:null,'limit':_0xc60609[_0x0d19('0x17')]?_0xc60609[_0x0d19('0x17')][_0x0d19('0x1c')]||null:null})[_0x0d19('0xa')](function(_0x3c924d){logger['info'](_0x0d19('0x1d'),_0xc60609);logger[_0x0d19('0xc')](_0x0d19('0x1d'),_0xc60609,JSON[_0x0d19('0x18')](_0x3c924d));_0x4fc910(_0x3c924d);})[_0x0d19('0x1e')](function(_0x4d6332){logger[_0x0d19('0xf')](_0x0d19('0x1d'),_0x4d6332['message'],_0xc60609);_0x4cc9bd(_0x4ae2a7[_0x0d19('0xf')](0x1f4,_0x4d6332['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 5b51e24..eadc0f5 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 _0xe46d=['get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index'];(function(_0x4c7472,_0x5e085f){var _0x17b8db=function(_0x4b1db2){while(--_0x4b1db2){_0x4c7472['push'](_0x4c7472['shift']());}};_0x17b8db(++_0x5e085f);}(_0xe46d,0xf1));var _0xde46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe46d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde46('0x0'));var util=require(_0xde46('0x1'));var path=require(_0xde46('0x2'));var timeout=require(_0xde46('0x3'));var express=require(_0xde46('0x4'));var router=express[_0xde46('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xde46('0x6'));var interaction=require(_0xde46('0x7'));var config=require(_0xde46('0x8'));var controller=require(_0xde46('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xde46('0xa')]);router[_0xde46('0xb')]('/describe',auth[_0xde46('0xc')](),controller['describe']);router[_0xde46('0xb')](_0xde46('0xd'),auth[_0xde46('0xc')](),controller[_0xde46('0xe')]);router[_0xde46('0xf')]('/',auth[_0xde46('0xc')](),controller['create']);router[_0xde46('0x10')](_0xde46('0xd'),auth[_0xde46('0xc')](),controller[_0xde46('0x11')]);router[_0xde46('0x12')](_0xde46('0xd'),auth['isAuthenticated'](),controller[_0xde46('0x13')]);module[_0xde46('0x14')]=router; \ No newline at end of file +var _0x6fea=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x2f7a05,_0x2313ab){var _0x39a5ec=function(_0x65d947){while(--_0x65d947){_0x2f7a05['push'](_0x2f7a05['shift']());}};_0x39a5ec(++_0x2313ab);}(_0x6fea,0xdc));var _0xa6fe=function(_0x4fa559,_0x5e7a03){_0x4fa559=_0x4fa559-0x0;var _0x59a8ed=_0x6fea[_0x4fa559];return _0x59a8ed;};'use strict';var multer=require(_0xa6fe('0x0'));var util=require(_0xa6fe('0x1'));var path=require('path');var timeout=require(_0xa6fe('0x2'));var express=require('express');var router=express[_0xa6fe('0x3')]();var fs_extra=require(_0xa6fe('0x4'));var auth=require(_0xa6fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa6fe('0x6'));var controller=require(_0xa6fe('0x7'));router[_0xa6fe('0x8')]('/',auth[_0xa6fe('0x9')](),controller['index']);router[_0xa6fe('0x8')](_0xa6fe('0xa'),auth[_0xa6fe('0x9')](),controller[_0xa6fe('0xb')]);router[_0xa6fe('0x8')](_0xa6fe('0xc'),auth[_0xa6fe('0x9')](),controller[_0xa6fe('0xd')]);router['post']('/',auth[_0xa6fe('0x9')](),controller[_0xa6fe('0xe')]);router[_0xa6fe('0xf')](_0xa6fe('0xc'),auth[_0xa6fe('0x9')](),controller[_0xa6fe('0x10')]);router[_0xa6fe('0x11')]('/:id',auth[_0xa6fe('0x9')](),controller[_0xa6fe('0x12')]);module[_0xa6fe('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 8ec8f56..a1006b7 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x22d775,_0xd58866){var _0x229299=function(_0x4655fe){while(--_0x4655fe){_0x22d775['push'](_0x22d775['shift']());}};_0x229299(++_0xd58866);}(_0x4b84,0x1cc));var _0x44b8=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4b84[_0x8de54f];return _0x14cba4;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 3d0c6a0..a8c742c 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 _0x08b1=['destroy','end','sendStatus','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x3d4fb4,_0x5ad87f){var _0x44a806=function(_0x29deae){while(--_0x29deae){_0x3d4fb4['push'](_0x3d4fb4['shift']());}};_0x44a806(++_0x5ad87f);}(_0x08b1,0x14b));var _0x108b=function(_0x1369ae,_0x2e7ee7){_0x1369ae=_0x1369ae-0x0;var _0x3f76ba=_0x08b1[_0x1369ae];return _0x3f76ba;};'use strict';var emlformat=require(_0x108b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x108b('0x1'));var jsonpatch=require(_0x108b('0x2'));var rp=require(_0x108b('0x3'));var moment=require(_0x108b('0x4'));var BPromise=require(_0x108b('0x5'));var Mustache=require('mustache');var util=require(_0x108b('0x6'));var path=require(_0x108b('0x7'));var sox=require(_0x108b('0x8'));var csv=require(_0x108b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x108b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x108b('0xb'));var jsforce=require(_0x108b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x108b('0x9'));var querystring=require(_0x108b('0xd'));var Papa=require(_0x108b('0xe'));var Redis=require(_0x108b('0xf'));var authService=require(_0x108b('0x10'));var qs=require(_0x108b('0x11'));var as=require(_0x108b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x108b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x108b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1a2b,_0xc5eb94){_0xc5eb94=_0xc5eb94||0xcc;return function(_0x5e34fd){if(_0x5e34fd){return _0x1b1a2b['sendStatus'](_0xc5eb94);}return _0x1b1a2b[_0x108b('0x15')](_0xc5eb94)['end']();};}function respondWithResult(_0xfeba4e,_0x44b321){_0x44b321=_0x44b321||0xc8;return function(_0x2c85c3){if(_0x2c85c3){return _0xfeba4e[_0x108b('0x15')](_0x44b321)[_0x108b('0x16')](_0x2c85c3);}};}function respondWithFilteredResult(_0x265ab7,_0x3ebb24){return function(_0x115249){if(_0x115249){var _0xde481=typeof _0x3ebb24[_0x108b('0x17')]===_0x108b('0x18')&&typeof _0x3ebb24[_0x108b('0x19')]===_0x108b('0x18');var _0x48bc6f=_0x115249[_0x108b('0x1a')];var _0x1ded33=_0xde481?0x0:_0x3ebb24[_0x108b('0x17')];var _0x6a17fb=_0xde481?_0x115249['count']:_0x3ebb24[_0x108b('0x17')]+_0x3ebb24[_0x108b('0x19')];var _0x30957f;if(_0x6a17fb>=_0x48bc6f){_0x6a17fb=_0x48bc6f;_0x30957f=0xc8;}else{_0x30957f=0xce;}_0x265ab7['status'](_0x30957f);return _0x265ab7[_0x108b('0x1b')](_0x108b('0x1c'),_0x1ded33+'-'+_0x6a17fb+'/'+_0x48bc6f)[_0x108b('0x16')](_0x115249);}return null;};}function patchUpdates(_0x1021bf){return function(_0x40d839){try{jsonpatch[_0x108b('0x1d')](_0x40d839,_0x1021bf,!![]);}catch(_0x24c3f9){return BPromise[_0x108b('0x1e')](_0x24c3f9);}return _0x40d839[_0x108b('0x1f')]();};}function saveUpdates(_0x4b403a,_0x3421cd){return function(_0x497f90){if(_0x497f90){return _0x497f90[_0x108b('0x20')](_0x4b403a)[_0x108b('0x21')](function(_0x231830){return _0x231830;});}return null;};}function removeEntity(_0xc7554d,_0x306c06){return function(_0x177b76){if(_0x177b76){return _0x177b76[_0x108b('0x22')]()[_0x108b('0x21')](function(){_0xc7554d[_0x108b('0x15')](0xcc)[_0x108b('0x23')]();});}};}function handleEntityNotFound(_0x1d8532,_0x185a56){return function(_0x36fce9){if(!_0x36fce9){_0x1d8532[_0x108b('0x24')](0x194);}return _0x36fce9;};}function handleError(_0x1bea3b,_0x3f9bf0){_0x3f9bf0=_0x3f9bf0||0x1f4;return function(_0xd2fa02){logger[_0x108b('0x25')](_0xd2fa02['stack']);if(_0xd2fa02[_0x108b('0x26')]){delete _0xd2fa02[_0x108b('0x26')];}_0x1bea3b[_0x108b('0x15')](_0x3f9bf0)[_0x108b('0x27')](_0xd2fa02);};}exports[_0x108b('0x28')]=function(_0x2811b1,_0x25c9ca){var _0x52f27a={},_0x35c7cd={},_0x50ef8f={'count':0x0,'rows':[]};var _0x597255=_[_0x108b('0x29')](db[_0x108b('0x2a')][_0x108b('0x2b')],function(_0x342307){return{'name':_0x342307[_0x108b('0x2c')],'type':_0x342307[_0x108b('0x2d')][_0x108b('0x2e')]};});_0x35c7cd[_0x108b('0x2f')]=_[_0x108b('0x29')](_0x597255,_0x108b('0x26'));_0x35c7cd[_0x108b('0x30')]=_[_0x108b('0x31')](_0x2811b1[_0x108b('0x30')]);_0x35c7cd['filters']=_[_0x108b('0x32')](_0x35c7cd['model'],_0x35c7cd[_0x108b('0x30')]);_0x52f27a['attributes']=_[_0x108b('0x32')](_0x35c7cd[_0x108b('0x2f')],qs['fields'](_0x2811b1[_0x108b('0x30')]['fields']));_0x52f27a[_0x108b('0x33')]=_0x52f27a['attributes'][_0x108b('0x34')]?_0x52f27a[_0x108b('0x33')]:_0x35c7cd['model'];if(!_0x2811b1[_0x108b('0x30')][_0x108b('0x35')]('nolimit')){_0x52f27a[_0x108b('0x19')]=qs['limit'](_0x2811b1[_0x108b('0x30')][_0x108b('0x19')]);_0x52f27a[_0x108b('0x17')]=qs[_0x108b('0x17')](_0x2811b1[_0x108b('0x30')][_0x108b('0x17')]);}_0x52f27a[_0x108b('0x36')]=qs['sort'](_0x2811b1[_0x108b('0x30')][_0x108b('0x37')]);_0x52f27a[_0x108b('0x38')]=qs['filters'](_[_0x108b('0x39')](_0x2811b1[_0x108b('0x30')],_0x35c7cd[_0x108b('0x3a')]),_0x597255);if(_0x2811b1[_0x108b('0x30')][_0x108b('0x3b')]){_0x52f27a['where']=_[_0x108b('0x3c')](_0x52f27a[_0x108b('0x38')],{'$or':_[_0x108b('0x29')](_0x597255,function(_0x426730){if(_0x426730[_0x108b('0x2d')]!=='VIRTUAL'){var _0x18bc92={};_0x18bc92[_0x426730['name']]={'$like':'%'+_0x2811b1['query'][_0x108b('0x3b')]+'%'};return _0x18bc92;}})});}_0x52f27a=_[_0x108b('0x3c')]({},_0x52f27a,_0x2811b1[_0x108b('0x3d')]);var _0x29ba5c={'where':_0x52f27a[_0x108b('0x38')]};return db['FaxTransferReport'][_0x108b('0x1a')](_0x29ba5c)['then'](function(_0x1951c9){_0x50ef8f[_0x108b('0x1a')]=_0x1951c9;if(_0x2811b1['query'][_0x108b('0x3e')]){_0x52f27a[_0x108b('0x3f')]=[{'all':!![]}];}return db[_0x108b('0x2a')]['findAll'](_0x52f27a);})['then'](function(_0x3b41b5){_0x50ef8f[_0x108b('0x40')]=_0x3b41b5;return _0x50ef8f;})['then'](respondWithFilteredResult(_0x25c9ca,_0x52f27a))[_0x108b('0x41')](handleError(_0x25c9ca,null));};exports[_0x108b('0x42')]=function(_0x2a6d49,_0x1644d2){var _0xd5b8cd={'raw':!![],'where':{'id':_0x2a6d49[_0x108b('0x43')]['id']}},_0x14e26d={};_0x14e26d['model']=_[_0x108b('0x31')](db[_0x108b('0x2a')][_0x108b('0x2b')]);_0x14e26d[_0x108b('0x30')]=_[_0x108b('0x31')](_0x2a6d49[_0x108b('0x30')]);_0x14e26d[_0x108b('0x3a')]=_[_0x108b('0x32')](_0x14e26d[_0x108b('0x2f')],_0x14e26d[_0x108b('0x30')]);_0xd5b8cd['attributes']=_['intersection'](_0x14e26d[_0x108b('0x2f')],qs[_0x108b('0x44')](_0x2a6d49[_0x108b('0x30')][_0x108b('0x44')]));_0xd5b8cd['attributes']=_0xd5b8cd[_0x108b('0x33')]['length']?_0xd5b8cd[_0x108b('0x33')]:_0x14e26d['model'];if(_0x2a6d49[_0x108b('0x30')][_0x108b('0x3e')]){_0xd5b8cd[_0x108b('0x3f')]=[{'all':!![]}];}_0xd5b8cd=_[_0x108b('0x3c')]({},_0xd5b8cd,_0x2a6d49[_0x108b('0x3d')]);return db['FaxTransferReport'][_0x108b('0x45')](_0xd5b8cd)['then'](handleEntityNotFound(_0x1644d2,null))['then'](respondWithResult(_0x1644d2,null))[_0x108b('0x41')](handleError(_0x1644d2,null));};exports[_0x108b('0x46')]=function(_0x55c43d,_0x36bfed){return db[_0x108b('0x2a')]['create'](_0x55c43d['body'],{})[_0x108b('0x21')](respondWithResult(_0x36bfed,0xc9))['catch'](handleError(_0x36bfed,null));};exports['update']=function(_0x19ff02,_0x3f4ebf){if(_0x19ff02[_0x108b('0x47')]['id']){delete _0x19ff02[_0x108b('0x47')]['id'];}return db[_0x108b('0x2a')]['find']({'where':{'id':_0x19ff02[_0x108b('0x43')]['id']}})[_0x108b('0x21')](handleEntityNotFound(_0x3f4ebf,null))[_0x108b('0x21')](saveUpdates(_0x19ff02['body'],null))[_0x108b('0x21')](respondWithResult(_0x3f4ebf,null))[_0x108b('0x41')](handleError(_0x3f4ebf,null));};exports['destroy']=function(_0x5d40f1,_0x47a86a){return db[_0x108b('0x2a')][_0x108b('0x45')]({'where':{'id':_0x5d40f1['params']['id']}})[_0x108b('0x21')](handleEntityNotFound(_0x47a86a,null))[_0x108b('0x21')](removeEntity(_0x47a86a,null))[_0x108b('0x41')](handleError(_0x47a86a,null));};exports[_0x108b('0x48')]=function(_0x4cc863,_0x24e12f){return db[_0x108b('0x2a')][_0x108b('0x48')]()[_0x108b('0x21')](respondWithResult(_0x24e12f,null))[_0x108b('0x41')](handleError(_0x24e12f,null));}; \ No newline at end of file +var _0xf1dc=['request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch'];(function(_0x3f6d50,_0x2b09ba){var _0x41c69f=function(_0x4450c5){while(--_0x4450c5){_0x3f6d50['push'](_0x3f6d50['shift']());}};_0x41c69f(++_0x2b09ba);}(_0xf1dc,0x9d));var _0xcf1d=function(_0x5371af,_0x1763a3){_0x5371af=_0x5371af-0x0;var _0x58c9cf=_0xf1dc[_0x5371af];return _0x58c9cf;};'use strict';var emlformat=require(_0xcf1d('0x0'));var rimraf=require(_0xcf1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf1d('0x2'));var rp=require(_0xcf1d('0x3'));var moment=require(_0xcf1d('0x4'));var BPromise=require(_0xcf1d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcf1d('0x6'));var sox=require(_0xcf1d('0x7'));var csv=require(_0xcf1d('0x8'));var ejs=require(_0xcf1d('0x9'));var fs=require('fs');var fs_extra=require(_0xcf1d('0xa'));var _=require(_0xcf1d('0xb'));var squel=require(_0xcf1d('0xc'));var crypto=require(_0xcf1d('0xd'));var jsforce=require(_0xcf1d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcf1d('0x8'));var querystring=require(_0xcf1d('0xf'));var Papa=require(_0xcf1d('0x10'));var Redis=require(_0xcf1d('0x11'));var authService=require(_0xcf1d('0x12'));var qs=require(_0xcf1d('0x13'));var as=require(_0xcf1d('0x14'));var hardwareService=require(_0xcf1d('0x15'));var logger=require(_0xcf1d('0x16'))(_0xcf1d('0x17'));var utils=require(_0xcf1d('0x18'));var config=require(_0xcf1d('0x19'));var licenseUtil=require(_0xcf1d('0x1a'));var db=require(_0xcf1d('0x1b'))['db'];function respondWithStatusCode(_0x1d0466,_0x2276cb){_0x2276cb=_0x2276cb||0xcc;return function(_0x1c9629){if(_0x1c9629){return _0x1d0466[_0xcf1d('0x1c')](_0x2276cb);}return _0x1d0466[_0xcf1d('0x1d')](_0x2276cb)[_0xcf1d('0x1e')]();};}function respondWithResult(_0x5503a6,_0x3a5c3d){_0x3a5c3d=_0x3a5c3d||0xc8;return function(_0x3698a6){if(_0x3698a6){return _0x5503a6[_0xcf1d('0x1d')](_0x3a5c3d)[_0xcf1d('0x1f')](_0x3698a6);}};}function respondWithFilteredResult(_0xac267,_0x47aaf3){return function(_0x61a9d6){if(_0x61a9d6){var _0x29cebe=typeof _0x47aaf3[_0xcf1d('0x20')]==='undefined'&&typeof _0x47aaf3[_0xcf1d('0x21')]===_0xcf1d('0x22');var _0x1231ef=_0x61a9d6[_0xcf1d('0x23')];var _0x4c3c30=_0x29cebe?0x0:_0x47aaf3['offset'];var _0x82e75d=_0x29cebe?_0x61a9d6[_0xcf1d('0x23')]:_0x47aaf3['offset']+_0x47aaf3['limit'];var _0x37d416;if(_0x82e75d>=_0x1231ef){_0x82e75d=_0x1231ef;_0x37d416=0xc8;}else{_0x37d416=0xce;}_0xac267['status'](_0x37d416);return _0xac267[_0xcf1d('0x24')](_0xcf1d('0x25'),_0x4c3c30+'-'+_0x82e75d+'/'+_0x1231ef)[_0xcf1d('0x1f')](_0x61a9d6);}return null;};}function patchUpdates(_0x1853d2){return function(_0x32c408){try{jsonpatch[_0xcf1d('0x26')](_0x32c408,_0x1853d2,!![]);}catch(_0x19b6b2){return BPromise[_0xcf1d('0x27')](_0x19b6b2);}return _0x32c408[_0xcf1d('0x28')]();};}function saveUpdates(_0x581f15,_0x5b8122){return function(_0x55f090){if(_0x55f090){return _0x55f090[_0xcf1d('0x29')](_0x581f15)[_0xcf1d('0x2a')](function(_0x110283){return _0x110283;});}return null;};}function removeEntity(_0xa68483,_0x3c47a1){return function(_0xc0ed3c){if(_0xc0ed3c){return _0xc0ed3c[_0xcf1d('0x2b')]()[_0xcf1d('0x2a')](function(){_0xa68483['status'](0xcc)[_0xcf1d('0x1e')]();});}};}function handleEntityNotFound(_0x5c9fa5,_0x52c19a){return function(_0x4152b0){if(!_0x4152b0){_0x5c9fa5[_0xcf1d('0x1c')](0x194);}return _0x4152b0;};}function handleError(_0xc37ac8,_0x232689){_0x232689=_0x232689||0x1f4;return function(_0x511ce5){logger[_0xcf1d('0x2c')](_0x511ce5['stack']);if(_0x511ce5[_0xcf1d('0x2d')]){delete _0x511ce5[_0xcf1d('0x2d')];}_0xc37ac8[_0xcf1d('0x1d')](_0x232689)['send'](_0x511ce5);};}exports[_0xcf1d('0x2e')]=function(_0x859037,_0x43e6be){var _0x4e9f33={},_0x477cd9={},_0x4e7d39={'count':0x0,'rows':[]};var _0x5be7d8=_[_0xcf1d('0x2f')](db[_0xcf1d('0x30')][_0xcf1d('0x31')],function(_0x4b5e46){return{'name':_0x4b5e46[_0xcf1d('0x32')],'type':_0x4b5e46['type']['key']};});_0x477cd9['model']=_[_0xcf1d('0x2f')](_0x5be7d8,_0xcf1d('0x2d'));_0x477cd9['query']=_[_0xcf1d('0x33')](_0x859037[_0xcf1d('0x34')]);_0x477cd9[_0xcf1d('0x35')]=_[_0xcf1d('0x36')](_0x477cd9[_0xcf1d('0x37')],_0x477cd9[_0xcf1d('0x34')]);_0x4e9f33[_0xcf1d('0x38')]=_['intersection'](_0x477cd9[_0xcf1d('0x37')],qs['fields'](_0x859037[_0xcf1d('0x34')][_0xcf1d('0x39')]));_0x4e9f33['attributes']=_0x4e9f33[_0xcf1d('0x38')][_0xcf1d('0x3a')]?_0x4e9f33[_0xcf1d('0x38')]:_0x477cd9['model'];if(!_0x859037[_0xcf1d('0x34')]['hasOwnProperty'](_0xcf1d('0x3b'))){_0x4e9f33[_0xcf1d('0x21')]=qs[_0xcf1d('0x21')](_0x859037[_0xcf1d('0x34')][_0xcf1d('0x21')]);_0x4e9f33[_0xcf1d('0x20')]=qs['offset'](_0x859037[_0xcf1d('0x34')][_0xcf1d('0x20')]);}_0x4e9f33[_0xcf1d('0x3c')]=qs[_0xcf1d('0x3d')](_0x859037[_0xcf1d('0x34')][_0xcf1d('0x3d')]);_0x4e9f33[_0xcf1d('0x3e')]=qs['filters'](_[_0xcf1d('0x3f')](_0x859037[_0xcf1d('0x34')],_0x477cd9[_0xcf1d('0x35')]),_0x5be7d8);if(_0x859037[_0xcf1d('0x34')]['filter']){_0x4e9f33[_0xcf1d('0x3e')]=_['merge'](_0x4e9f33['where'],{'$or':_[_0xcf1d('0x2f')](_0x5be7d8,function(_0x3556fe){if(_0x3556fe[_0xcf1d('0x40')]!==_0xcf1d('0x41')){var _0x13cb9d={};_0x13cb9d[_0x3556fe['name']]={'$like':'%'+_0x859037[_0xcf1d('0x34')][_0xcf1d('0x42')]+'%'};return _0x13cb9d;}})});}_0x4e9f33=_[_0xcf1d('0x43')]({},_0x4e9f33,_0x859037[_0xcf1d('0x44')]);var _0xf40d17={'where':_0x4e9f33['where']};return db[_0xcf1d('0x30')][_0xcf1d('0x23')](_0xf40d17)[_0xcf1d('0x2a')](function(_0x5d90ec){_0x4e7d39[_0xcf1d('0x23')]=_0x5d90ec;if(_0x859037[_0xcf1d('0x34')]['includeAll']){_0x4e9f33[_0xcf1d('0x45')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xcf1d('0x46')](_0x4e9f33);})['then'](function(_0xc7ae5b){_0x4e7d39[_0xcf1d('0x47')]=_0xc7ae5b;return _0x4e7d39;})['then'](respondWithFilteredResult(_0x43e6be,_0x4e9f33))[_0xcf1d('0x48')](handleError(_0x43e6be,null));};exports[_0xcf1d('0x49')]=function(_0x3dba28,_0x12b236){var _0x149adb={'raw':!![],'where':{'id':_0x3dba28[_0xcf1d('0x4a')]['id']}},_0x1dfc8e={};_0x1dfc8e[_0xcf1d('0x37')]=_[_0xcf1d('0x33')](db[_0xcf1d('0x30')][_0xcf1d('0x31')]);_0x1dfc8e['query']=_[_0xcf1d('0x33')](_0x3dba28['query']);_0x1dfc8e[_0xcf1d('0x35')]=_['intersection'](_0x1dfc8e['model'],_0x1dfc8e['query']);_0x149adb[_0xcf1d('0x38')]=_[_0xcf1d('0x36')](_0x1dfc8e[_0xcf1d('0x37')],qs[_0xcf1d('0x39')](_0x3dba28[_0xcf1d('0x34')][_0xcf1d('0x39')]));_0x149adb[_0xcf1d('0x38')]=_0x149adb[_0xcf1d('0x38')][_0xcf1d('0x3a')]?_0x149adb[_0xcf1d('0x38')]:_0x1dfc8e['model'];if(_0x3dba28[_0xcf1d('0x34')][_0xcf1d('0x4b')]){_0x149adb['include']=[{'all':!![]}];}_0x149adb=_[_0xcf1d('0x43')]({},_0x149adb,_0x3dba28[_0xcf1d('0x44')]);return db[_0xcf1d('0x30')][_0xcf1d('0x4c')](_0x149adb)[_0xcf1d('0x2a')](handleEntityNotFound(_0x12b236,null))[_0xcf1d('0x2a')](respondWithResult(_0x12b236,null))[_0xcf1d('0x48')](handleError(_0x12b236,null));};exports['create']=function(_0x45a896,_0x2268ba){return db['FaxTransferReport'][_0xcf1d('0x4d')](_0x45a896[_0xcf1d('0x4e')],{})[_0xcf1d('0x2a')](respondWithResult(_0x2268ba,0xc9))['catch'](handleError(_0x2268ba,null));};exports[_0xcf1d('0x29')]=function(_0x112b6e,_0x47897b){if(_0x112b6e['body']['id']){delete _0x112b6e[_0xcf1d('0x4e')]['id'];}return db[_0xcf1d('0x30')][_0xcf1d('0x4c')]({'where':{'id':_0x112b6e[_0xcf1d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47897b,null))[_0xcf1d('0x2a')](saveUpdates(_0x112b6e[_0xcf1d('0x4e')],null))['then'](respondWithResult(_0x47897b,null))[_0xcf1d('0x48')](handleError(_0x47897b,null));};exports[_0xcf1d('0x2b')]=function(_0x5c3bff,_0x8274fe){return db[_0xcf1d('0x30')]['find']({'where':{'id':_0x5c3bff['params']['id']}})[_0xcf1d('0x2a')](handleEntityNotFound(_0x8274fe,null))[_0xcf1d('0x2a')](removeEntity(_0x8274fe,null))[_0xcf1d('0x48')](handleError(_0x8274fe,null));};exports[_0xcf1d('0x4f')]=function(_0x517076,_0x507f20){return db[_0xcf1d('0x30')][_0xcf1d('0x4f')]()[_0xcf1d('0x2a')](respondWithResult(_0x507f20,null))[_0xcf1d('0x48')](handleError(_0x507f20,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b0404b9..7116272 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 _0x644e=['uniqueid','util','moment','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x644e,0x97));var _0xe644=function(_0x121320,_0xa3b9d5){_0x121320=_0x121320-0x0;var _0x2f05c9=_0x644e[_0x121320];return _0x2f05c9;};'use strict';var _=require('lodash');var util=require(_0xe644('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe644('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe644('0x2'));var rimraf=require(_0xe644('0x3'));var config=require(_0xe644('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0xe644('0x5')]=function(_0x2c137c,_0x2d0ed2){return _0x2c137c[_0xe644('0x6')](_0xe644('0x7'),attributes,{'tableName':_0xe644('0x8'),'paranoid':![],'indexes':[{'name':_0xe644('0x9'),'fields':[_0xe644('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf248=['util','../../config/logger','api','moment','bluebird','request-promise','path','./faxTransferReport.attributes','define','uniqueid','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf248,0xfc));var _0x8f24=function(_0x138d3b,_0x59ca96){_0x138d3b=_0x138d3b-0x0;var _0x271495=_0xf248[_0x138d3b];return _0x271495;};'use strict';var _=require(_0x8f24('0x0'));var util=require(_0x8f24('0x1'));var logger=require(_0x8f24('0x2'))(_0x8f24('0x3'));var moment=require(_0x8f24('0x4'));var BPromise=require(_0x8f24('0x5'));var rp=require(_0x8f24('0x6'));var fs=require('fs');var path=require(_0x8f24('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f24('0x8'));module['exports']=function(_0x4696ea,_0x1236fe){return _0x4696ea[_0x8f24('0x9')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x8f24('0xa'),'fields':[_0x8f24('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 73ed95f..fbd8428 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 _0x38af=['jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x40e8b2,_0x436564){var _0x5a2c30=function(_0x364c42){while(--_0x364c42){_0x40e8b2['push'](_0x40e8b2['shift']());}};_0x5a2c30(++_0x436564);}(_0x38af,0x1b0));var _0xf38a=function(_0x44caac,_0x327ed7){_0x44caac=_0x44caac-0x0;var _0x1f9caf=_0x38af[_0x44caac];return _0x1f9caf;};'use strict';var _=require(_0xf38a('0x0'));var util=require(_0xf38a('0x1'));var moment=require(_0xf38a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf38a('0x3'));var fs=require('fs');var Redis=require(_0xf38a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf38a('0x5'));var logger=require(_0xf38a('0x6'))('rpc');var config=require(_0xf38a('0x7'));var jayson=require(_0xf38a('0x8'));var client=jayson[_0xf38a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbfdfd9,_0x1edb73,_0x193551){return new BPromise(function(_0x59042e,_0xe2e3b6){return client[_0xf38a('0xa')](_0xbfdfd9,_0x193551)[_0xf38a('0xb')](function(_0x33aba3){logger[_0xf38a('0xc')](_0xf38a('0xd'),_0x1edb73,_0xf38a('0xe'));logger[_0xf38a('0xf')](_0xf38a('0x10'),_0x1edb73,'request\x20sent',JSON[_0xf38a('0x11')](_0x33aba3));if(_0x33aba3['error']){if(_0x33aba3['error']['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1edb73,_0x33aba3[_0xf38a('0x12')]['message']);return _0xe2e3b6(_0x33aba3['error'][_0xf38a('0x13')]);}logger[_0xf38a('0x12')](_0xf38a('0xd'),_0x1edb73,_0x33aba3[_0xf38a('0x12')][_0xf38a('0x13')]);return _0x59042e(_0x33aba3[_0xf38a('0x12')][_0xf38a('0x13')]);}else{logger[_0xf38a('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x1edb73,_0xf38a('0xe'));_0x59042e(_0x33aba3[_0xf38a('0x14')][_0xf38a('0x13')]);}})[_0xf38a('0x15')](function(_0x354e5a){logger[_0xf38a('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x1edb73,_0x354e5a);_0xe2e3b6(_0x354e5a);});});} \ No newline at end of file +var _0xefa5=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x370701,_0x27353c){var _0x300809=function(_0x49fa27){while(--_0x49fa27){_0x370701['push'](_0x370701['shift']());}};_0x300809(++_0x27353c);}(_0xefa5,0x14e));var _0x5efa=function(_0x430469,_0x20e783){_0x430469=_0x430469-0x0;var _0x1ca55e=_0xefa5[_0x430469];return _0x1ca55e;};'use strict';var _=require(_0x5efa('0x0'));var util=require(_0x5efa('0x1'));var moment=require(_0x5efa('0x2'));var BPromise=require(_0x5efa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5efa('0x4'));var db=require(_0x5efa('0x5'))['db'];var utils=require(_0x5efa('0x6'));var logger=require(_0x5efa('0x7'))('rpc');var config=require(_0x5efa('0x8'));var jayson=require(_0x5efa('0x9'));var client=jayson['client'][_0x5efa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c2c94,_0xda4ad9,_0x54f4d7){return new BPromise(function(_0x5d4f21,_0x13b846){return client['request'](_0x3c2c94,_0x54f4d7)[_0x5efa('0xb')](function(_0x42e11d){logger['info'](_0x5efa('0xc'),_0xda4ad9,_0x5efa('0xd'));logger[_0x5efa('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xda4ad9,_0x5efa('0xd'),JSON[_0x5efa('0xf')](_0x42e11d));if(_0x42e11d['error']){if(_0x42e11d[_0x5efa('0x10')][_0x5efa('0x11')]===0x1f4){logger[_0x5efa('0x10')](_0x5efa('0xc'),_0xda4ad9,_0x42e11d['error']['message']);return _0x13b846(_0x42e11d[_0x5efa('0x10')][_0x5efa('0x12')]);}logger['error'](_0x5efa('0xc'),_0xda4ad9,_0x42e11d[_0x5efa('0x10')][_0x5efa('0x12')]);return _0x5d4f21(_0x42e11d[_0x5efa('0x10')][_0x5efa('0x12')]);}else{logger['info'](_0x5efa('0xc'),_0xda4ad9,_0x5efa('0xd'));_0x5d4f21(_0x42e11d[_0x5efa('0x13')][_0x5efa('0x12')]);}})[_0x5efa('0x14')](function(_0x47b50b){logger[_0x5efa('0x10')](_0x5efa('0xc'),_0xda4ad9,_0x47b50b);_0x13b846(_0x47b50b);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 994bcad..0b17632 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 _0x455a=['fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','util','path','connect-timeout'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x455a,0x74));var _0xa455=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0x455a[_0x28be72];return _0x46c5da;};'use strict';var multer=require('multer');var util=require(_0xa455('0x0'));var path=require(_0xa455('0x1'));var timeout=require(_0xa455('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa455('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa455('0x4'));var config=require(_0xa455('0x5'));var controller=require(_0xa455('0x6'));router[_0xa455('0x7')]('/',auth[_0xa455('0x8')](),controller['index']);router[_0xa455('0x7')](_0xa455('0x9'),auth[_0xa455('0x8')](),controller[_0xa455('0xa')]);router[_0xa455('0x7')]('/:id',auth[_0xa455('0x8')](),controller[_0xa455('0xb')]);router[_0xa455('0xc')]('/',auth[_0xa455('0x8')](),controller['create']);router[_0xa455('0xd')](_0xa455('0xe'),auth['isAuthenticated'](),controller[_0xa455('0xf')]);router[_0xa455('0x10')](_0xa455('0xe'),auth[_0xa455('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x62fd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','Router','fs-extra'];(function(_0x52ce0a,_0x300f8f){var _0x356df4=function(_0x35ef69){while(--_0x35ef69){_0x52ce0a['push'](_0x52ce0a['shift']());}};_0x356df4(++_0x300f8f);}(_0x62fd,0x1dc));var _0xd62f=function(_0x6ee03c,_0x5ad366){_0x6ee03c=_0x6ee03c-0x0;var _0x4b833a=_0x62fd[_0x6ee03c];return _0x4b833a;};'use strict';var multer=require('multer');var util=require(_0xd62f('0x0'));var path=require(_0xd62f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd62f('0x2')]();var fs_extra=require(_0xd62f('0x3'));var auth=require(_0xd62f('0x4'));var interaction=require(_0xd62f('0x5'));var config=require(_0xd62f('0x6'));var controller=require(_0xd62f('0x7'));router[_0xd62f('0x8')]('/',auth[_0xd62f('0x9')](),controller[_0xd62f('0xa')]);router[_0xd62f('0x8')](_0xd62f('0xb'),auth[_0xd62f('0x9')](),controller[_0xd62f('0xc')]);router[_0xd62f('0x8')](_0xd62f('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd62f('0x9')](),controller[_0xd62f('0xe')]);router[_0xd62f('0xf')](_0xd62f('0xd'),auth[_0xd62f('0x9')](),controller[_0xd62f('0x10')]);router[_0xd62f('0x11')](_0xd62f('0xd'),auth[_0xd62f('0x9')](),controller[_0xd62f('0x12')]);module[_0xd62f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a4985c0..ff4c12c 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 _0x37f0=['post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x311778,_0x11c811){var _0x47ff50=function(_0x210ded){while(--_0x210ded){_0x311778['push'](_0x311778['shift']());}};_0x47ff50(++_0x11c811);}(_0x37f0,0x85));var _0x037f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x37f0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x037f('0x0'));var util=require(_0x037f('0x1'));var path=require(_0x037f('0x2'));var timeout=require(_0x037f('0x3'));var express=require(_0x037f('0x4'));var router=express['Router']();var fs_extra=require(_0x037f('0x5'));var auth=require(_0x037f('0x6'));var interaction=require(_0x037f('0x7'));var config=require('../../config/environment');var controller=require(_0x037f('0x8'));router[_0x037f('0x9')]('/',auth[_0x037f('0xa')](),controller[_0x037f('0xb')]);router['get']('/:id',auth[_0x037f('0xa')](),controller[_0x037f('0xc')]);router[_0x037f('0x9')](_0x037f('0xd'),auth[_0x037f('0xa')](),controller[_0x037f('0xe')]);router[_0x037f('0x9')](_0x037f('0xf'),auth[_0x037f('0xa')](),controller[_0x037f('0x10')]);router[_0x037f('0x11')]('/',auth[_0x037f('0xa')](),controller['create']);router[_0x037f('0x11')](_0x037f('0xd'),auth[_0x037f('0xa')](),controller[_0x037f('0x12')]);router[_0x037f('0x13')](_0x037f('0x14'),auth[_0x037f('0xa')](),controller[_0x037f('0x15')]);router[_0x037f('0x16')]('/:id',auth[_0x037f('0xa')](),controller[_0x037f('0x17')]);module[_0x037f('0x18')]=router; \ No newline at end of file +var _0x4c18=['post','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','create'];(function(_0xd9fe58,_0x4b3f3c){var _0x1c3cfd=function(_0x48a235){while(--_0x48a235){_0xd9fe58['push'](_0xd9fe58['shift']());}};_0x1c3cfd(++_0x4b3f3c);}(_0x4c18,0x11a));var _0x84c1=function(_0x100eee,_0x358d22){_0x100eee=_0x100eee-0x0;var _0x3ebe45=_0x4c18[_0x100eee];return _0x3ebe45;};'use strict';var multer=require(_0x84c1('0x0'));var util=require(_0x84c1('0x1'));var path=require('path');var timeout=require(_0x84c1('0x2'));var express=require(_0x84c1('0x3'));var router=express[_0x84c1('0x4')]();var fs_extra=require(_0x84c1('0x5'));var auth=require(_0x84c1('0x6'));var interaction=require(_0x84c1('0x7'));var config=require(_0x84c1('0x8'));var controller=require(_0x84c1('0x9'));router[_0x84c1('0xa')]('/',auth[_0x84c1('0xb')](),controller['index']);router['get'](_0x84c1('0xc'),auth[_0x84c1('0xb')](),controller[_0x84c1('0xd')]);router[_0x84c1('0xa')]('/:id/configurations',auth[_0x84c1('0xb')](),controller[_0x84c1('0xe')]);router[_0x84c1('0xa')](_0x84c1('0xf'),auth[_0x84c1('0xb')](),controller[_0x84c1('0x10')]);router['post']('/',auth[_0x84c1('0xb')](),controller[_0x84c1('0x11')]);router[_0x84c1('0x12')](_0x84c1('0x13'),auth[_0x84c1('0xb')](),controller[_0x84c1('0x14')]);router[_0x84c1('0x15')](_0x84c1('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x84c1('0x16')]('/:id',auth[_0x84c1('0xb')](),controller[_0x84c1('0x17')]);module[_0x84c1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ded7670..69bef6a 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 _0x1a99=['integrationTab','sequelize','STRING','ENUM','basic'];(function(_0x9ea3b0,_0x1ee214){var _0x1a4484=function(_0x52abf6){while(--_0x52abf6){_0x9ea3b0['push'](_0x9ea3b0['shift']());}};_0x1a4484(++_0x1ee214);}(_0x1a99,0x88));var _0x91a9=function(_0x5d506b,_0x41b1ca){_0x5d506b=_0x5d506b-0x0;var _0x2a8f24=_0x1a99[_0x5d506b];return _0x2a8f24;};'use strict';var Sequelize=require(_0x91a9('0x0'));module['exports']={'name':{'type':Sequelize[_0x91a9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x91a9('0x1')]},'remoteUri':{'type':Sequelize[_0x91a9('0x1')]},'authType':{'type':Sequelize[_0x91a9('0x2')](_0x91a9('0x3')),'defaultValue':_0x91a9('0x3')},'password':{'type':Sequelize[_0x91a9('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x91a9('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x91a9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x91a9('0x2')](_0x91a9('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2f31=['ENUM','basic','integrationTab','newTab','sequelize','STRING'];(function(_0x2226ac,_0x3f1a6f){var _0x32356c=function(_0x10d645){while(--_0x10d645){_0x2226ac['push'](_0x2226ac['shift']());}};_0x32356c(++_0x3f1a6f);}(_0x2f31,0x166));var _0x12f3=function(_0x4221d0,_0x503fb1){_0x4221d0=_0x4221d0-0x0;var _0x432197=_0x2f31[_0x4221d0];return _0x432197;};'use strict';var Sequelize=require(_0x12f3('0x0'));module['exports']={'name':{'type':Sequelize[_0x12f3('0x1')]},'description':{'type':Sequelize[_0x12f3('0x1')]},'username':{'type':Sequelize[_0x12f3('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x12f3('0x2')](_0x12f3('0x3')),'defaultValue':_0x12f3('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x12f3('0x1')]},'consumerSecret':{'type':Sequelize[_0x12f3('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x12f3('0x1')]},'serverUrl':{'type':Sequelize[_0x12f3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x12f3('0x2')](_0x12f3('0x4'),_0x12f3('0x5')),'defaultValue':_0x12f3('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d73dbb3..e50a11d 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 _0x315d=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','map','DeskAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','DeskConfiguration','order','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','_embedded','entries','active','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4e3e1a,_0x345495){var _0x13bcee=function(_0x3ca999){while(--_0x3ca999){_0x4e3e1a['push'](_0x4e3e1a['shift']());}};_0x13bcee(++_0x345495);}(_0x315d,0x158));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd315('0x0'));var zipdir=require(_0xd315('0x1'));var jsonpatch=require(_0xd315('0x2'));var rp=require(_0xd315('0x3'));var moment=require(_0xd315('0x4'));var BPromise=require(_0xd315('0x5'));var Mustache=require(_0xd315('0x6'));var util=require(_0xd315('0x7'));var path=require(_0xd315('0x8'));var sox=require(_0xd315('0x9'));var csv=require(_0xd315('0xa'));var ejs=require(_0xd315('0xb'));var fs=require('fs');var fs_extra=require(_0xd315('0xc'));var _=require(_0xd315('0xd'));var squel=require(_0xd315('0xe'));var crypto=require(_0xd315('0xf'));var jsforce=require(_0xd315('0x10'));var deskjs=require(_0xd315('0x11'));var toCsv=require(_0xd315('0xa'));var querystring=require(_0xd315('0x12'));var Papa=require('papaparse');var Redis=require(_0xd315('0x13'));var authService=require(_0xd315('0x14'));var qs=require(_0xd315('0x15'));var as=require(_0xd315('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd315('0x17'))(_0xd315('0x18'));var utils=require(_0xd315('0x19'));var config=require(_0xd315('0x1a'));var licenseUtil=require(_0xd315('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd315('0x1c'));function respondWithStatusCode(_0xa7b524,_0xf2f0c8){_0xf2f0c8=_0xf2f0c8||0xcc;return function(_0x28f309){if(_0x28f309){return _0xa7b524[_0xd315('0x1d')](_0xf2f0c8);}return _0xa7b524[_0xd315('0x1e')](_0xf2f0c8)[_0xd315('0x1f')]();};}function respondWithResult(_0x8fdf7,_0x1c492b){_0x1c492b=_0x1c492b||0xc8;return function(_0x2e294a){if(_0x2e294a){return _0x8fdf7[_0xd315('0x1e')](_0x1c492b)[_0xd315('0x20')](_0x2e294a);}};}function respondWithFilteredResult(_0x2b9819,_0x3bda46){return function(_0x15e4db){if(_0x15e4db){var _0x554186=typeof _0x3bda46['offset']===_0xd315('0x21')&&typeof _0x3bda46[_0xd315('0x22')]===_0xd315('0x21');var _0x498184=_0x15e4db[_0xd315('0x23')];var _0x315d8c=_0x554186?0x0:_0x3bda46[_0xd315('0x24')];var _0x20966a=_0x554186?_0x15e4db['count']:_0x3bda46['offset']+_0x3bda46[_0xd315('0x22')];var _0x59c568;if(_0x20966a>=_0x498184){_0x20966a=_0x498184;_0x59c568=0xc8;}else{_0x59c568=0xce;}_0x2b9819[_0xd315('0x1e')](_0x59c568);return _0x2b9819[_0xd315('0x25')](_0xd315('0x26'),_0x315d8c+'-'+_0x20966a+'/'+_0x498184)[_0xd315('0x20')](_0x15e4db);}return null;};}function patchUpdates(_0x10ddb9){return function(_0x4f47ba){try{jsonpatch[_0xd315('0x27')](_0x4f47ba,_0x10ddb9,!![]);}catch(_0x1b565f){return BPromise['reject'](_0x1b565f);}return _0x4f47ba['save']();};}function saveUpdates(_0x81ebc0,_0x1d0b8e){return function(_0x428389){if(_0x428389){return _0x428389[_0xd315('0x28')](_0x81ebc0)[_0xd315('0x29')](function(_0x318f58){return _0x318f58;});}return null;};}function removeEntity(_0xd212a6,_0x52bc19){return function(_0x4003bd){if(_0x4003bd){return _0x4003bd[_0xd315('0x2a')]()['then'](function(){_0xd212a6[_0xd315('0x1e')](0xcc)[_0xd315('0x1f')]();});}};}function handleEntityNotFound(_0x143e4c,_0x2e88dd){return function(_0x13d72a){if(!_0x13d72a){_0x143e4c['sendStatus'](0x194);}return _0x13d72a;};}function handleError(_0x1627cc,_0x2766c1){_0x2766c1=_0x2766c1||0x1f4;return function(_0x535f84){logger['error'](_0x535f84[_0xd315('0x2b')]);if(_0x535f84[_0xd315('0x2c')]){delete _0x535f84['name'];}_0x1627cc[_0xd315('0x1e')](_0x2766c1)[_0xd315('0x2d')](_0x535f84);};}exports['index']=function(_0x175527,_0x3e0ff8){var _0xbb0e86={},_0xe91c={},_0xaa1c5d={'count':0x0,'rows':[]};var _0x51aacf=_[_0xd315('0x2e')](db[_0xd315('0x2f')][_0xd315('0x30')],function(_0x547741){return{'name':_0x547741['fieldName'],'type':_0x547741[_0xd315('0x31')][_0xd315('0x32')]};});_0xe91c[_0xd315('0x33')]=_[_0xd315('0x2e')](_0x51aacf,_0xd315('0x2c'));_0xe91c[_0xd315('0x34')]=_[_0xd315('0x35')](_0x175527['query']);_0xe91c['filters']=_[_0xd315('0x36')](_0xe91c[_0xd315('0x33')],_0xe91c[_0xd315('0x34')]);_0xbb0e86[_0xd315('0x37')]=_[_0xd315('0x36')](_0xe91c[_0xd315('0x33')],qs[_0xd315('0x38')](_0x175527['query']['fields']));_0xbb0e86['attributes']=_0xbb0e86[_0xd315('0x37')][_0xd315('0x39')]?_0xbb0e86['attributes']:_0xe91c[_0xd315('0x33')];if(!_0x175527[_0xd315('0x34')][_0xd315('0x3a')](_0xd315('0x3b'))){_0xbb0e86[_0xd315('0x22')]=qs[_0xd315('0x22')](_0x175527['query'][_0xd315('0x22')]);_0xbb0e86[_0xd315('0x24')]=qs['offset'](_0x175527['query'][_0xd315('0x24')]);}_0xbb0e86['order']=qs[_0xd315('0x3c')](_0x175527['query'][_0xd315('0x3c')]);_0xbb0e86[_0xd315('0x3d')]=qs[_0xd315('0x3e')](_[_0xd315('0x3f')](_0x175527[_0xd315('0x34')],_0xe91c[_0xd315('0x3e')]),_0x51aacf);if(_0x175527[_0xd315('0x34')]['filter']){_0xbb0e86['where']=_['merge'](_0xbb0e86['where'],{'$or':_[_0xd315('0x2e')](_0x51aacf,function(_0x4a9430){if(_0x4a9430['type']!==_0xd315('0x40')){var _0x288e96={};_0x288e96[_0x4a9430[_0xd315('0x2c')]]={'$like':'%'+_0x175527[_0xd315('0x34')]['filter']+'%'};return _0x288e96;}})});}_0xbb0e86=_[_0xd315('0x41')]({},_0xbb0e86,_0x175527[_0xd315('0x42')]);var _0x33829c={'where':_0xbb0e86[_0xd315('0x3d')]};return db[_0xd315('0x2f')][_0xd315('0x23')](_0x33829c)['then'](function(_0x1504fd){_0xaa1c5d[_0xd315('0x23')]=_0x1504fd;if(_0x175527['query'][_0xd315('0x43')]){_0xbb0e86[_0xd315('0x44')]=[{'all':!![]}];}return db[_0xd315('0x2f')][_0xd315('0x45')](_0xbb0e86);})[_0xd315('0x29')](function(_0x33c0df){_0xaa1c5d[_0xd315('0x46')]=_0x33c0df;return _0xaa1c5d;})[_0xd315('0x29')](respondWithFilteredResult(_0x3e0ff8,_0xbb0e86))[_0xd315('0x47')](handleError(_0x3e0ff8,null));};exports[_0xd315('0x48')]=function(_0x162c55,_0x71a0fb){var _0xd75a25={'raw':![],'where':{'id':_0x162c55[_0xd315('0x49')]['id']}},_0xf5a539={};_0xf5a539[_0xd315('0x33')]=_[_0xd315('0x35')](db[_0xd315('0x2f')]['rawAttributes']);_0xf5a539[_0xd315('0x34')]=_[_0xd315('0x35')](_0x162c55[_0xd315('0x34')]);_0xf5a539[_0xd315('0x3e')]=_['intersection'](_0xf5a539[_0xd315('0x33')],_0xf5a539[_0xd315('0x34')]);_0xd75a25[_0xd315('0x37')]=_[_0xd315('0x36')](_0xf5a539[_0xd315('0x33')],qs[_0xd315('0x38')](_0x162c55['query'][_0xd315('0x38')]));_0xd75a25[_0xd315('0x37')]=_0xd75a25[_0xd315('0x37')]['length']?_0xd75a25['attributes']:_0xf5a539['model'];if(_0x162c55[_0xd315('0x34')][_0xd315('0x43')]){_0xd75a25['include']=[{'all':!![]}];}_0xd75a25=_['merge']({},_0xd75a25,_0x162c55[_0xd315('0x42')]);return db[_0xd315('0x2f')][_0xd315('0x4a')](_0xd75a25)[_0xd315('0x29')](handleEntityNotFound(_0x71a0fb,null))[_0xd315('0x29')](respondWithResult(_0x71a0fb,null))[_0xd315('0x47')](handleError(_0x71a0fb,null));};exports[_0xd315('0x4b')]=function(_0x56be42,_0x5f197a){return db[_0xd315('0x2f')]['create'](_0x56be42[_0xd315('0x4c')],{})[_0xd315('0x29')](respondWithResult(_0x5f197a,0xc9))[_0xd315('0x47')](handleError(_0x5f197a,null));};exports[_0xd315('0x28')]=function(_0x1c0b2c,_0x588728){if(_0x1c0b2c[_0xd315('0x4c')]['id']){delete _0x1c0b2c[_0xd315('0x4c')]['id'];}return db[_0xd315('0x2f')][_0xd315('0x4a')]({'where':{'id':_0x1c0b2c[_0xd315('0x49')]['id']}})[_0xd315('0x29')](handleEntityNotFound(_0x588728,null))[_0xd315('0x29')](saveUpdates(_0x1c0b2c[_0xd315('0x4c')],null))[_0xd315('0x29')](respondWithResult(_0x588728,null))[_0xd315('0x47')](handleError(_0x588728,null));};exports[_0xd315('0x2a')]=function(_0x12b14f,_0x1767b7){return db[_0xd315('0x2f')][_0xd315('0x4a')]({'where':{'id':_0x12b14f[_0xd315('0x49')]['id']}})[_0xd315('0x29')](handleEntityNotFound(_0x1767b7,null))['then'](removeEntity(_0x1767b7,null))[_0xd315('0x47')](handleError(_0x1767b7,null));};exports['getConfigurations']=function(_0x20b94c,_0x138dd0,_0x38f19d){var _0x5f09ee={};var _0x4d576b={};var _0x4ab20c;var _0x13b73f;return db[_0xd315('0x2f')][_0xd315('0x4d')]({'where':{'id':_0x20b94c[_0xd315('0x49')]['id']}})[_0xd315('0x29')](handleEntityNotFound(_0x138dd0,null))[_0xd315('0x29')](function(_0x373223){if(_0x373223){_0x4ab20c=_0x373223;_0x4d576b[_0xd315('0x33')]=_[_0xd315('0x35')](db[_0xd315('0x4e')]['rawAttributes']);_0x4d576b[_0xd315('0x34')]=_['keys'](_0x20b94c[_0xd315('0x34')]);_0x4d576b['filters']=_[_0xd315('0x36')](_0x4d576b[_0xd315('0x33')],_0x4d576b[_0xd315('0x34')]);_0x5f09ee[_0xd315('0x37')]=_[_0xd315('0x36')](_0x4d576b['model'],qs[_0xd315('0x38')](_0x20b94c['query'][_0xd315('0x38')]));_0x5f09ee[_0xd315('0x37')]=_0x5f09ee[_0xd315('0x37')]['length']?_0x5f09ee[_0xd315('0x37')]:_0x4d576b[_0xd315('0x33')];_0x5f09ee[_0xd315('0x4f')]=qs[_0xd315('0x3c')](_0x20b94c[_0xd315('0x34')][_0xd315('0x3c')]);_0x5f09ee[_0xd315('0x3d')]=qs[_0xd315('0x3e')](_[_0xd315('0x3f')](_0x20b94c[_0xd315('0x34')],_0x4d576b[_0xd315('0x3e')]));if(_0x20b94c[_0xd315('0x34')][_0xd315('0x50')]){_0x5f09ee[_0xd315('0x3d')]=_[_0xd315('0x41')](_0x5f09ee[_0xd315('0x3d')],{'$or':_[_0xd315('0x2e')](_0x5f09ee[_0xd315('0x37')],function(_0x33f68b){var _0x4e8aab={};_0x4e8aab[_0x33f68b]={'$like':'%'+_0x20b94c[_0xd315('0x34')][_0xd315('0x50')]+'%'};return _0x4e8aab;})});}_0x5f09ee=_['merge']({},_0x5f09ee,_0x20b94c['options']);return _0x4ab20c[_0xd315('0x51')](_0x5f09ee);}})[_0xd315('0x29')](function(_0x10e01d){if(_0x10e01d){_0x13b73f=_0x10e01d[_0xd315('0x39')];if(!_0x20b94c['query']['hasOwnProperty'](_0xd315('0x3b'))){_0x5f09ee[_0xd315('0x22')]=qs[_0xd315('0x22')](_0x20b94c['query'][_0xd315('0x22')]);_0x5f09ee[_0xd315('0x24')]=qs[_0xd315('0x24')](_0x20b94c['query'][_0xd315('0x24')]);}return _0x4ab20c[_0xd315('0x51')](_0x5f09ee);}})[_0xd315('0x29')](function(_0x2a9cf0){if(_0x2a9cf0){return _0x2a9cf0?{'count':_0x13b73f,'rows':_0x2a9cf0}:null;}})[_0xd315('0x29')](respondWithResult(_0x138dd0,null))[_0xd315('0x47')](handleError(_0x138dd0,null));};exports[_0xd315('0x52')]=function(_0x1befa4,_0x315ba5,_0x547e57){if(_0x1befa4['body']['id']){delete _0x1befa4[_0xd315('0x4c')]['id'];}return db['DeskAccount'][_0xd315('0x4d')]({'where':{'id':_0x1befa4['params']['id']}})[_0xd315('0x29')](handleEntityNotFound(_0x315ba5,null))['then'](function(_0x486208){if(_0x486208){_0x1befa4['body'][_0xd315('0x53')]=_0x486208['id'];_0x1befa4[_0xd315('0x4c')][_0xd315('0x54')]=integrations[_0xd315('0x55')](_0x1befa4[_0xd315('0x4c')][_0xd315('0x56')],_0x1befa4[_0xd315('0x4c')]['type']);_0x1befa4[_0xd315('0x4c')][_0xd315('0x57')]=integrations[_0xd315('0x58')](_0x1befa4[_0xd315('0x4c')][_0xd315('0x56')],_0x1befa4['body']['type']);return db['DeskConfiguration'][_0xd315('0x4b')](_0x1befa4[_0xd315('0x4c')],{'include':[{'model':db[_0xd315('0x59')],'as':_0xd315('0x54')},{'model':db[_0xd315('0x59')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x315ba5,null))[_0xd315('0x47')](handleError(_0x315ba5,null));};exports[_0xd315('0x5a')]=function(_0xbdd71f,_0x276abc,_0x57252b){var _0x5658b3=[{'name':_0xd315('0x5b'),'label':_0xd315('0x5b'),'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 _0x41dcfd='';return db[_0xd315('0x2f')][_0xd315('0x4d')]({'where':{'id':_0xbdd71f[_0xd315('0x49')]['id']},'attributes':['id',_0xd315('0x5c'),_0xd315('0x5d'),_0xd315('0x5e'),_0xd315('0x5f'),'consumerKey','consumerSecret','token','tokenSecret']})['then'](handleEntityNotFound(_0x276abc,null))['then'](function(_0x4b43da){if(_0x4b43da){_0x41dcfd=_0x4b43da[_0xd315('0x5c')];var _0x2f55dd=_0x41dcfd[_0xd315('0x60')](-0x1);if(_0x2f55dd==='/'){_0x41dcfd=_0x41dcfd[_0xd315('0x61')](0x0,_0x41dcfd[_0xd315('0x62')](_0x2f55dd));}var _0x263b72={'method':_0xd315('0x63'),'uri':util[_0xd315('0x64')](_0xd315('0x65'),_0x41dcfd),'headers':{'Content-Type':_0xd315('0x66'),'Accept':_0xd315('0x66')},'json':!![]};if(_0x4b43da[_0xd315('0x5d')]===_0xd315('0x67')){_0x263b72[_0xd315('0x68')][_0xd315('0x69')]=util['format'](_0xd315('0x6a'),new Buffer(util[_0xd315('0x64')](_0xd315('0x6b'),_0x4b43da[_0xd315('0x5e')],_0x4b43da[_0xd315('0x5f')]))['toString'](_0xd315('0x6c')));}return rp(_0x263b72)[_0xd315('0x29')](function(_0x5eb948){return _0x5658b3['concat'](_[_0xd315('0x2e')](_0x5eb948[_0xd315('0x6d')][_0xd315('0x6e')],function(_0x40497d){return{'id':_0x40497d[_0xd315('0x2c')],'name':_0x40497d[_0xd315('0x2c')],'type':_0x40497d[_0xd315('0x31')],'active':_0x40497d[_0xd315('0x6f')],'label':_0x40497d['label'],'custom':!![]};}));});}})[_0xd315('0x29')](function(_0x55a13b){return{'count':_0x55a13b[_0xd315('0x39')],'rows':_0x55a13b};})[_0xd315('0x29')](respondWithResult(_0x276abc,null))[_0xd315('0x47')](function(_0x558fb0){var _0x48b366=_0xbdd71f[_0xd315('0x34')][_0xd315('0x70')]?0x1f4:_0x558fb0[_0xd315('0x71')]||0x1f4;logger[_0xd315('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x48b366,JSON[_0xd315('0x73')](_0x558fb0));delete _0x558fb0['name'];if(_0x48b366===0x191){_0x48b366=0x190;}_0x276abc[_0xd315('0x1e')](_0x48b366)['send'](_0xbdd71f[_0xd315('0x34')][_0xd315('0x70')]?{'message':_0xd315('0x74'),'statusCode':_0x558fb0[_0xd315('0x71')]}:_0x558fb0);});}; \ No newline at end of file +var _0xa785=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','save','update','then','destroy','error','stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','show','includeAll','include','find','create','body','catch','getConfigurations','findOne','params','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0xcf61cd,_0x4db4b6){var _0xb939a9=function(_0xabeb61){while(--_0xabeb61){_0xcf61cd['push'](_0xcf61cd['shift']());}};_0xb939a9(++_0x4db4b6);}(_0xa785,0x6d));var _0x5a78=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xa785[_0x1dfa63];return _0x26f2a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a78('0x0'));var zipdir=require(_0x5a78('0x1'));var jsonpatch=require(_0x5a78('0x2'));var rp=require(_0x5a78('0x3'));var moment=require('moment');var BPromise=require(_0x5a78('0x4'));var Mustache=require('mustache');var util=require(_0x5a78('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5a78('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a78('0x7'));var jsforce=require(_0x5a78('0x8'));var deskjs=require(_0x5a78('0x9'));var toCsv=require(_0x5a78('0x6'));var querystring=require(_0x5a78('0xa'));var Papa=require(_0x5a78('0xb'));var Redis=require(_0x5a78('0xc'));var authService=require(_0x5a78('0xd'));var qs=require(_0x5a78('0xe'));var as=require(_0x5a78('0xf'));var hardwareService=require(_0x5a78('0x10'));var logger=require(_0x5a78('0x11'))(_0x5a78('0x12'));var utils=require(_0x5a78('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5a78('0x14'));var db=require(_0x5a78('0x15'))['db'];var integrations=require(_0x5a78('0x16'));function respondWithStatusCode(_0x2ea9b1,_0x4b8dc8){_0x4b8dc8=_0x4b8dc8||0xcc;return function(_0x301d20){if(_0x301d20){return _0x2ea9b1[_0x5a78('0x17')](_0x4b8dc8);}return _0x2ea9b1[_0x5a78('0x18')](_0x4b8dc8)[_0x5a78('0x19')]();};}function respondWithResult(_0x3e21e8,_0x441e69){_0x441e69=_0x441e69||0xc8;return function(_0xed8b03){if(_0xed8b03){return _0x3e21e8['status'](_0x441e69)[_0x5a78('0x1a')](_0xed8b03);}};}function respondWithFilteredResult(_0x35c957,_0x458f63){return function(_0x54dae1){if(_0x54dae1){var _0x1588ac=typeof _0x458f63[_0x5a78('0x1b')]===_0x5a78('0x1c')&&typeof _0x458f63[_0x5a78('0x1d')]===_0x5a78('0x1c');var _0x1f8091=_0x54dae1['count'];var _0x37bf7a=_0x1588ac?0x0:_0x458f63[_0x5a78('0x1b')];var _0x9507ac=_0x1588ac?_0x54dae1['count']:_0x458f63['offset']+_0x458f63['limit'];var _0x5f5709;if(_0x9507ac>=_0x1f8091){_0x9507ac=_0x1f8091;_0x5f5709=0xc8;}else{_0x5f5709=0xce;}_0x35c957[_0x5a78('0x18')](_0x5f5709);return _0x35c957[_0x5a78('0x1e')]('Content-Range',_0x37bf7a+'-'+_0x9507ac+'/'+_0x1f8091)[_0x5a78('0x1a')](_0x54dae1);}return null;};}function patchUpdates(_0x4ec123){return function(_0x41f9a2){try{jsonpatch['apply'](_0x41f9a2,_0x4ec123,!![]);}catch(_0x4e2f90){return BPromise['reject'](_0x4e2f90);}return _0x41f9a2[_0x5a78('0x1f')]();};}function saveUpdates(_0x5b4c2e,_0x3b9f34){return function(_0x4a5de4){if(_0x4a5de4){return _0x4a5de4[_0x5a78('0x20')](_0x5b4c2e)[_0x5a78('0x21')](function(_0xae1073){return _0xae1073;});}return null;};}function removeEntity(_0x31d918,_0x9c0ecb){return function(_0x3d3483){if(_0x3d3483){return _0x3d3483[_0x5a78('0x22')]()[_0x5a78('0x21')](function(){_0x31d918[_0x5a78('0x18')](0xcc)[_0x5a78('0x19')]();});}};}function handleEntityNotFound(_0x3d9ab7,_0x1aa317){return function(_0x2d4f38){if(!_0x2d4f38){_0x3d9ab7['sendStatus'](0x194);}return _0x2d4f38;};}function handleError(_0x49887d,_0xaca1cb){_0xaca1cb=_0xaca1cb||0x1f4;return function(_0x19ae72){logger[_0x5a78('0x23')](_0x19ae72[_0x5a78('0x24')]);if(_0x19ae72[_0x5a78('0x25')]){delete _0x19ae72[_0x5a78('0x25')];}_0x49887d[_0x5a78('0x18')](_0xaca1cb)[_0x5a78('0x26')](_0x19ae72);};}exports['index']=function(_0x2d13e0,_0xb0ddbb){var _0x291283={},_0x49733e={},_0x217a16={'count':0x0,'rows':[]};var _0x4bf3d6=_['map'](db[_0x5a78('0x27')][_0x5a78('0x28')],function(_0x1eda9d){return{'name':_0x1eda9d[_0x5a78('0x29')],'type':_0x1eda9d[_0x5a78('0x2a')][_0x5a78('0x2b')]};});_0x49733e['model']=_[_0x5a78('0x2c')](_0x4bf3d6,_0x5a78('0x25'));_0x49733e[_0x5a78('0x2d')]=_[_0x5a78('0x2e')](_0x2d13e0[_0x5a78('0x2d')]);_0x49733e[_0x5a78('0x2f')]=_[_0x5a78('0x30')](_0x49733e[_0x5a78('0x31')],_0x49733e[_0x5a78('0x2d')]);_0x291283[_0x5a78('0x32')]=_[_0x5a78('0x30')](_0x49733e[_0x5a78('0x31')],qs[_0x5a78('0x33')](_0x2d13e0[_0x5a78('0x2d')][_0x5a78('0x33')]));_0x291283[_0x5a78('0x32')]=_0x291283[_0x5a78('0x32')][_0x5a78('0x34')]?_0x291283['attributes']:_0x49733e[_0x5a78('0x31')];if(!_0x2d13e0['query']['hasOwnProperty'](_0x5a78('0x35'))){_0x291283['limit']=qs['limit'](_0x2d13e0['query']['limit']);_0x291283['offset']=qs[_0x5a78('0x1b')](_0x2d13e0[_0x5a78('0x2d')][_0x5a78('0x1b')]);}_0x291283[_0x5a78('0x36')]=qs[_0x5a78('0x37')](_0x2d13e0[_0x5a78('0x2d')]['sort']);_0x291283[_0x5a78('0x38')]=qs['filters'](_[_0x5a78('0x39')](_0x2d13e0[_0x5a78('0x2d')],_0x49733e[_0x5a78('0x2f')]),_0x4bf3d6);if(_0x2d13e0[_0x5a78('0x2d')][_0x5a78('0x3a')]){_0x291283[_0x5a78('0x38')]=_['merge'](_0x291283[_0x5a78('0x38')],{'$or':_['map'](_0x4bf3d6,function(_0x4cd494){if(_0x4cd494[_0x5a78('0x2a')]!==_0x5a78('0x3b')){var _0x6370e5={};_0x6370e5[_0x4cd494[_0x5a78('0x25')]]={'$like':'%'+_0x2d13e0[_0x5a78('0x2d')][_0x5a78('0x3a')]+'%'};return _0x6370e5;}})});}_0x291283=_[_0x5a78('0x3c')]({},_0x291283,_0x2d13e0[_0x5a78('0x3d')]);var _0x2e6325={'where':_0x291283['where']};return db['DeskAccount'][_0x5a78('0x3e')](_0x2e6325)['then'](function(_0x3ca50d){_0x217a16['count']=_0x3ca50d;if(_0x2d13e0[_0x5a78('0x2d')]['includeAll']){_0x291283['include']=[{'all':!![]}];}return db[_0x5a78('0x27')]['findAll'](_0x291283);})[_0x5a78('0x21')](function(_0x54af53){_0x217a16['rows']=_0x54af53;return _0x217a16;})[_0x5a78('0x21')](respondWithFilteredResult(_0xb0ddbb,_0x291283))['catch'](handleError(_0xb0ddbb,null));};exports[_0x5a78('0x3f')]=function(_0x96e691,_0x45b64f){var _0x44627c={'raw':![],'where':{'id':_0x96e691['params']['id']}},_0x312fff={};_0x312fff[_0x5a78('0x31')]=_['keys'](db[_0x5a78('0x27')]['rawAttributes']);_0x312fff[_0x5a78('0x2d')]=_[_0x5a78('0x2e')](_0x96e691[_0x5a78('0x2d')]);_0x312fff[_0x5a78('0x2f')]=_[_0x5a78('0x30')](_0x312fff[_0x5a78('0x31')],_0x312fff[_0x5a78('0x2d')]);_0x44627c[_0x5a78('0x32')]=_[_0x5a78('0x30')](_0x312fff['model'],qs[_0x5a78('0x33')](_0x96e691[_0x5a78('0x2d')][_0x5a78('0x33')]));_0x44627c[_0x5a78('0x32')]=_0x44627c[_0x5a78('0x32')]['length']?_0x44627c['attributes']:_0x312fff[_0x5a78('0x31')];if(_0x96e691[_0x5a78('0x2d')][_0x5a78('0x40')]){_0x44627c[_0x5a78('0x41')]=[{'all':!![]}];}_0x44627c=_[_0x5a78('0x3c')]({},_0x44627c,_0x96e691[_0x5a78('0x3d')]);return db[_0x5a78('0x27')][_0x5a78('0x42')](_0x44627c)[_0x5a78('0x21')](handleEntityNotFound(_0x45b64f,null))[_0x5a78('0x21')](respondWithResult(_0x45b64f,null))['catch'](handleError(_0x45b64f,null));};exports[_0x5a78('0x43')]=function(_0x292789,_0x2453b5){return db[_0x5a78('0x27')][_0x5a78('0x43')](_0x292789[_0x5a78('0x44')],{})[_0x5a78('0x21')](respondWithResult(_0x2453b5,0xc9))['catch'](handleError(_0x2453b5,null));};exports[_0x5a78('0x20')]=function(_0x45132d,_0x3841da){if(_0x45132d['body']['id']){delete _0x45132d[_0x5a78('0x44')]['id'];}return db[_0x5a78('0x27')]['find']({'where':{'id':_0x45132d['params']['id']}})[_0x5a78('0x21')](handleEntityNotFound(_0x3841da,null))['then'](saveUpdates(_0x45132d[_0x5a78('0x44')],null))[_0x5a78('0x21')](respondWithResult(_0x3841da,null))[_0x5a78('0x45')](handleError(_0x3841da,null));};exports[_0x5a78('0x22')]=function(_0x1496a8,_0x162b8d){return db[_0x5a78('0x27')][_0x5a78('0x42')]({'where':{'id':_0x1496a8['params']['id']}})['then'](handleEntityNotFound(_0x162b8d,null))[_0x5a78('0x21')](removeEntity(_0x162b8d,null))[_0x5a78('0x45')](handleError(_0x162b8d,null));};exports[_0x5a78('0x46')]=function(_0x5a1627,_0x3a4788,_0x480d2b){var _0x5dabf3={};var _0x16a047={};var _0x15c99a;var _0x26f1ee;return db[_0x5a78('0x27')][_0x5a78('0x47')]({'where':{'id':_0x5a1627[_0x5a78('0x48')]['id']}})[_0x5a78('0x21')](handleEntityNotFound(_0x3a4788,null))['then'](function(_0x85724b){if(_0x85724b){_0x15c99a=_0x85724b;_0x16a047[_0x5a78('0x31')]=_['keys'](db[_0x5a78('0x49')][_0x5a78('0x28')]);_0x16a047[_0x5a78('0x2d')]=_[_0x5a78('0x2e')](_0x5a1627['query']);_0x16a047[_0x5a78('0x2f')]=_[_0x5a78('0x30')](_0x16a047[_0x5a78('0x31')],_0x16a047[_0x5a78('0x2d')]);_0x5dabf3[_0x5a78('0x32')]=_[_0x5a78('0x30')](_0x16a047[_0x5a78('0x31')],qs['fields'](_0x5a1627[_0x5a78('0x2d')][_0x5a78('0x33')]));_0x5dabf3[_0x5a78('0x32')]=_0x5dabf3[_0x5a78('0x32')][_0x5a78('0x34')]?_0x5dabf3[_0x5a78('0x32')]:_0x16a047[_0x5a78('0x31')];_0x5dabf3[_0x5a78('0x36')]=qs[_0x5a78('0x37')](_0x5a1627['query']['sort']);_0x5dabf3[_0x5a78('0x38')]=qs[_0x5a78('0x2f')](_[_0x5a78('0x39')](_0x5a1627['query'],_0x16a047[_0x5a78('0x2f')]));if(_0x5a1627[_0x5a78('0x2d')][_0x5a78('0x3a')]){_0x5dabf3[_0x5a78('0x38')]=_[_0x5a78('0x3c')](_0x5dabf3[_0x5a78('0x38')],{'$or':_['map'](_0x5dabf3['attributes'],function(_0x5f0668){var _0x7ac2a={};_0x7ac2a[_0x5f0668]={'$like':'%'+_0x5a1627[_0x5a78('0x2d')][_0x5a78('0x3a')]+'%'};return _0x7ac2a;})});}_0x5dabf3=_[_0x5a78('0x3c')]({},_0x5dabf3,_0x5a1627[_0x5a78('0x3d')]);return _0x15c99a[_0x5a78('0x46')](_0x5dabf3);}})[_0x5a78('0x21')](function(_0x3532c5){if(_0x3532c5){_0x26f1ee=_0x3532c5[_0x5a78('0x34')];if(!_0x5a1627[_0x5a78('0x2d')][_0x5a78('0x4a')]('nolimit')){_0x5dabf3[_0x5a78('0x1d')]=qs[_0x5a78('0x1d')](_0x5a1627[_0x5a78('0x2d')]['limit']);_0x5dabf3[_0x5a78('0x1b')]=qs[_0x5a78('0x1b')](_0x5a1627[_0x5a78('0x2d')][_0x5a78('0x1b')]);}return _0x15c99a[_0x5a78('0x46')](_0x5dabf3);}})[_0x5a78('0x21')](function(_0x56ef77){if(_0x56ef77){return _0x56ef77?{'count':_0x26f1ee,'rows':_0x56ef77}:null;}})[_0x5a78('0x21')](respondWithResult(_0x3a4788,null))['catch'](handleError(_0x3a4788,null));};exports[_0x5a78('0x4b')]=function(_0x49792f,_0x41e0b6,_0x43b9f0){if(_0x49792f[_0x5a78('0x44')]['id']){delete _0x49792f['body']['id'];}return db[_0x5a78('0x27')]['findOne']({'where':{'id':_0x49792f[_0x5a78('0x48')]['id']}})[_0x5a78('0x21')](handleEntityNotFound(_0x41e0b6,null))[_0x5a78('0x21')](function(_0x4ced21){if(_0x4ced21){_0x49792f[_0x5a78('0x44')][_0x5a78('0x4c')]=_0x4ced21['id'];_0x49792f[_0x5a78('0x44')][_0x5a78('0x4d')]=integrations['getSubjects'](_0x49792f[_0x5a78('0x44')][_0x5a78('0x4e')],_0x49792f[_0x5a78('0x44')][_0x5a78('0x2a')]);_0x49792f['body'][_0x5a78('0x4f')]=integrations[_0x5a78('0x50')](_0x49792f[_0x5a78('0x44')][_0x5a78('0x4e')],_0x49792f[_0x5a78('0x44')][_0x5a78('0x2a')]);return db['DeskConfiguration']['create'](_0x49792f[_0x5a78('0x44')],{'include':[{'model':db['DeskField'],'as':_0x5a78('0x4d')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0x5a78('0x21')](respondWithResult(_0x41e0b6,null))[_0x5a78('0x45')](handleError(_0x41e0b6,null));};exports[_0x5a78('0x51')]=function(_0x136568,_0x4b7f4b,_0x1260a2){var _0x57f93c=[{'name':_0x5a78('0x52'),'label':_0x5a78('0x52'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x79f48='';return db['DeskAccount'][_0x5a78('0x47')]({'where':{'id':_0x136568[_0x5a78('0x48')]['id']},'attributes':['id','remoteUri',_0x5a78('0x53'),_0x5a78('0x54'),_0x5a78('0x55'),_0x5a78('0x56'),'consumerSecret',_0x5a78('0x57'),_0x5a78('0x58')]})[_0x5a78('0x21')](handleEntityNotFound(_0x4b7f4b,null))['then'](function(_0x1a76e6){if(_0x1a76e6){_0x79f48=_0x1a76e6[_0x5a78('0x59')];var _0x46a987=_0x79f48[_0x5a78('0x5a')](-0x1);if(_0x46a987==='/'){_0x79f48=_0x79f48[_0x5a78('0x5b')](0x0,_0x79f48['lastIndexOf'](_0x46a987));}var _0x553041={'method':'GET','uri':util[_0x5a78('0x5c')](_0x5a78('0x5d'),_0x79f48),'headers':{'Content-Type':_0x5a78('0x5e'),'Accept':_0x5a78('0x5e')},'json':!![]};if(_0x1a76e6['authType']===_0x5a78('0x5f')){_0x553041['headers']['Authorization']=util['format'](_0x5a78('0x60'),new Buffer(util[_0x5a78('0x5c')](_0x5a78('0x61'),_0x1a76e6[_0x5a78('0x54')],_0x1a76e6[_0x5a78('0x55')]))[_0x5a78('0x62')](_0x5a78('0x63')));}return rp(_0x553041)[_0x5a78('0x21')](function(_0x4ac90a){return _0x57f93c[_0x5a78('0x64')](_[_0x5a78('0x2c')](_0x4ac90a[_0x5a78('0x65')]['entries'],function(_0x798fea){return{'id':_0x798fea[_0x5a78('0x25')],'name':_0x798fea[_0x5a78('0x25')],'type':_0x798fea[_0x5a78('0x2a')],'active':_0x798fea[_0x5a78('0x66')],'label':_0x798fea[_0x5a78('0x67')],'custom':!![]};}));});}})[_0x5a78('0x21')](function(_0x404614){return{'count':_0x404614[_0x5a78('0x34')],'rows':_0x404614};})['then'](respondWithResult(_0x4b7f4b,null))['catch'](function(_0x11d24b){var _0x4c54a9=_0x136568[_0x5a78('0x2d')][_0x5a78('0x68')]?0x1f4:_0x11d24b[_0x5a78('0x69')]||0x1f4;logger[_0x5a78('0x23')](_0x5a78('0x6a'),_0x5a78('0x51'),_0x4c54a9,JSON['stringify'](_0x11d24b));delete _0x11d24b[_0x5a78('0x25')];if(_0x4c54a9===0x191){_0x4c54a9=0x190;}_0x4b7f4b[_0x5a78('0x18')](_0x4c54a9)[_0x5a78('0x26')](_0x136568['query'][_0x5a78('0x68')]?{'message':_0x5a78('0x6b'),'statusCode':_0x11d24b[_0x5a78('0x69')]}:_0x11d24b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ab5987f..bb7c635 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 _0x8842=['path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','request-promise'];(function(_0x3bcbad,_0x2d92db){var _0x1bfb8b=function(_0x5a5ff0){while(--_0x5a5ff0){_0x3bcbad['push'](_0x3bcbad['shift']());}};_0x1bfb8b(++_0x2d92db);}(_0x8842,0x1ec));var _0x2884=function(_0x164951,_0x4c2c5d){_0x164951=_0x164951-0x0;var _0x448187=_0x8842[_0x164951];return _0x448187;};'use strict';var _=require('lodash');var util=require(_0x2884('0x0'));var logger=require(_0x2884('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2884('0x2'));var fs=require('fs');var path=require(_0x2884('0x3'));var rimraf=require(_0x2884('0x4'));var config=require('../../config/environment');var attributes=require(_0x2884('0x5'));var integrations=require(_0x2884('0x6'));module[_0x2884('0x7')]=function(_0x47c4f7,_0x34b0b4){return _0x47c4f7[_0x2884('0x8')](_0x2884('0x9'),attributes,{'tableName':_0x2884('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f4c=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x85908e,_0x2f557e){var _0xf789ae=function(_0x9adf27){while(--_0x9adf27){_0x85908e['push'](_0x85908e['shift']());}};_0xf789ae(++_0x2f557e);}(_0x2f4c,0x179));var _0xc2f4=function(_0x50c903,_0x2db713){_0x50c903=_0x50c903-0x0;var _0x535963=_0x2f4c[_0x50c903];return _0x535963;};'use strict';var _=require(_0xc2f4('0x0'));var util=require(_0xc2f4('0x1'));var logger=require(_0xc2f4('0x2'))(_0xc2f4('0x3'));var moment=require(_0xc2f4('0x4'));var BPromise=require(_0xc2f4('0x5'));var rp=require(_0xc2f4('0x6'));var fs=require('fs');var path=require(_0xc2f4('0x7'));var rimraf=require(_0xc2f4('0x8'));var config=require(_0xc2f4('0x9'));var attributes=require(_0xc2f4('0xa'));var integrations=require(_0xc2f4('0xb'));module[_0xc2f4('0xc')]=function(_0x2e6d1a,_0x409957){return _0x2e6d1a[_0xc2f4('0xd')](_0xc2f4('0xe'),attributes,{'tableName':_0xc2f4('0xf'),'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 31c18d7..2cbb706 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 _0xe861=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','where','limit','include','map','model','attributes','then','ShowDeskAccount','find','lodash','util'];(function(_0x1389b3,_0xa913b7){var _0x3d1d28=function(_0x4abe70){while(--_0x4abe70){_0x1389b3['push'](_0x1389b3['shift']());}};_0x3d1d28(++_0xa913b7);}(_0xe861,0x127));var _0x1e86=function(_0x5035e4,_0xf46d5d){_0x5035e4=_0x5035e4-0x0;var _0x166b7d=_0xe861[_0x5035e4];return _0x166b7d;};'use strict';var _=require(_0x1e86('0x0'));var util=require(_0x1e86('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e86('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e86('0x3'))['db'];var utils=require(_0x1e86('0x4'));var logger=require(_0x1e86('0x5'))('rpc');var config=require(_0x1e86('0x6'));var jayson=require(_0x1e86('0x7'));var client=jayson['client'][_0x1e86('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x455742,_0x246827,_0x98cbb3){return new BPromise(function(_0x2e4f2c,_0x4e2129){return client[_0x1e86('0x9')](_0x455742,_0x98cbb3)['then'](function(_0x17e792){logger[_0x1e86('0xa')](_0x1e86('0xb'),_0x246827,_0x1e86('0xc'));logger[_0x1e86('0xd')](_0x1e86('0xe'),_0x246827,_0x1e86('0xc'),JSON[_0x1e86('0xf')](_0x17e792));if(_0x17e792[_0x1e86('0x10')]){if(_0x17e792[_0x1e86('0x10')][_0x1e86('0x11')]===0x1f4){logger[_0x1e86('0x10')](_0x1e86('0xb'),_0x246827,_0x17e792['error'][_0x1e86('0x12')]);return _0x4e2129(_0x17e792[_0x1e86('0x10')][_0x1e86('0x12')]);}logger[_0x1e86('0x10')](_0x1e86('0xb'),_0x246827,_0x17e792['error'][_0x1e86('0x12')]);return _0x2e4f2c(_0x17e792[_0x1e86('0x10')][_0x1e86('0x12')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x246827,_0x1e86('0xc'));_0x2e4f2c(_0x17e792['result'][_0x1e86('0x12')]);}})[_0x1e86('0x13')](function(_0x3bd303){logger[_0x1e86('0x10')](_0x1e86('0xb'),_0x246827,_0x3bd303);_0x4e2129(_0x3bd303);});});}exports[_0x1e86('0x14')]=function(_0x3a735d){var _0x42bfdf=this;return new Promise(function(_0x3a6d3f,_0x4f1483){return db[_0x1e86('0x15')][_0x1e86('0x16')]({'raw':_0x3a735d[_0x1e86('0x17')]?_0x3a735d['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a735d[_0x1e86('0x17')]?_0x3a735d['options'][_0x1e86('0x18')]||null:null,'attributes':_0x3a735d[_0x1e86('0x17')]?_0x3a735d[_0x1e86('0x17')]['attributes']||null:null,'limit':_0x3a735d['options']?_0x3a735d[_0x1e86('0x17')][_0x1e86('0x19')]||null:null,'include':_0x3a735d[_0x1e86('0x17')]?_0x3a735d['options'][_0x1e86('0x1a')]?_[_0x1e86('0x1b')](_0x3a735d['options'][_0x1e86('0x1a')],function(_0x538952){return{'model':db[_0x538952[_0x1e86('0x1c')]],'as':_0x538952['as'],'attributes':_0x538952['attributes'],'include':_0x538952[_0x1e86('0x1a')]?_[_0x1e86('0x1b')](_0x538952[_0x1e86('0x1a')],function(_0x24caa5){return{'model':db[_0x24caa5[_0x1e86('0x1c')]],'as':_0x24caa5['as'],'attributes':_0x24caa5[_0x1e86('0x1d')],'include':_0x24caa5[_0x1e86('0x1a')]?_[_0x1e86('0x1b')](_0x24caa5[_0x1e86('0x1a')],function(_0x5819ca){return{'model':db[_0x5819ca['model']],'as':_0x5819ca['as'],'attributes':_0x5819ca[_0x1e86('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1e86('0x1e')](function(_0x36b850){logger[_0x1e86('0xa')](_0x1e86('0x14'),_0x3a735d);logger[_0x1e86('0xd')](_0x1e86('0x14'),_0x3a735d,JSON[_0x1e86('0xf')](_0x36b850));_0x3a6d3f(_0x36b850);})[_0x1e86('0x13')](function(_0x345f2d){logger[_0x1e86('0x10')](_0x1e86('0x14'),_0x345f2d[_0x1e86('0x12')],_0x3a735d);_0x4f1483(_0x42bfdf['error'](0x1f4,_0x345f2d[_0x1e86('0x12')]));});});};exports[_0x1e86('0x1f')]=function(_0x306624){var _0xf09130=this;return new Promise(function(_0x5ca2ed,_0x4378ab){return db[_0x1e86('0x15')][_0x1e86('0x20')]({'raw':_0x306624[_0x1e86('0x17')]?_0x306624[_0x1e86('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x306624[_0x1e86('0x17')]?_0x306624[_0x1e86('0x17')]['where']||null:null,'attributes':_0x306624[_0x1e86('0x17')]?_0x306624['options'][_0x1e86('0x1d')]||null:null,'include':_0x306624['options']?_0x306624[_0x1e86('0x17')][_0x1e86('0x1a')]?_['map'](_0x306624[_0x1e86('0x17')][_0x1e86('0x1a')],function(_0x21fd21){return{'model':db[_0x21fd21[_0x1e86('0x1c')]],'as':_0x21fd21['as'],'attributes':_0x21fd21[_0x1e86('0x1d')],'include':_0x21fd21['include']?_[_0x1e86('0x1b')](_0x21fd21['include'],function(_0xb2a5f6){return{'model':db[_0xb2a5f6[_0x1e86('0x1c')]],'as':_0xb2a5f6['as'],'attributes':_0xb2a5f6[_0x1e86('0x1d')],'include':_0xb2a5f6[_0x1e86('0x1a')]?_[_0x1e86('0x1b')](_0xb2a5f6[_0x1e86('0x1a')],function(_0x3dfefa){return{'model':db[_0x3dfefa['model']],'as':_0x3dfefa['as'],'attributes':_0x3dfefa[_0x1e86('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48aae6){logger[_0x1e86('0xa')](_0x1e86('0x1f'),_0x306624);logger[_0x1e86('0xd')]('ShowDeskAccount',_0x306624,JSON[_0x1e86('0xf')](_0x48aae6));_0x5ca2ed(_0x48aae6);})[_0x1e86('0x13')](function(_0xcba3f2){logger[_0x1e86('0x10')](_0x1e86('0x1f'),_0xcba3f2[_0x1e86('0x12')],_0x306624);_0x4378ab(_0xf09130['error'](0x1f4,_0xcba3f2['message']));});});}; \ No newline at end of file +var _0x2dc5=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','ShowDeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0x2dc5,0x83));var _0x52dc=function(_0x245c04,_0x493313){_0x245c04=_0x245c04-0x0;var _0xa8f987=_0x2dc5[_0x245c04];return _0xa8f987;};'use strict';var _=require(_0x52dc('0x0'));var util=require(_0x52dc('0x1'));var moment=require(_0x52dc('0x2'));var BPromise=require(_0x52dc('0x3'));var rs=require(_0x52dc('0x4'));var fs=require('fs');var Redis=require(_0x52dc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x52dc('0x6'))(_0x52dc('0x7'));var config=require(_0x52dc('0x8'));var jayson=require(_0x52dc('0x9'));var client=jayson['client'][_0x52dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bdb89,_0x11a06c,_0xee29e5){return new BPromise(function(_0x21491f,_0x30ac17){return client['request'](_0x5bdb89,_0xee29e5)[_0x52dc('0xb')](function(_0xcae5c4){logger['info'](_0x52dc('0xc'),_0x11a06c,_0x52dc('0xd'));logger[_0x52dc('0xe')](_0x52dc('0xf'),_0x11a06c,_0x52dc('0xd'),JSON[_0x52dc('0x10')](_0xcae5c4));if(_0xcae5c4[_0x52dc('0x11')]){if(_0xcae5c4[_0x52dc('0x11')]['code']===0x1f4){logger[_0x52dc('0x11')](_0x52dc('0xc'),_0x11a06c,_0xcae5c4[_0x52dc('0x11')]['message']);return _0x30ac17(_0xcae5c4[_0x52dc('0x11')][_0x52dc('0x12')]);}logger[_0x52dc('0x11')](_0x52dc('0xc'),_0x11a06c,_0xcae5c4['error'][_0x52dc('0x12')]);return _0x21491f(_0xcae5c4[_0x52dc('0x11')][_0x52dc('0x12')]);}else{logger[_0x52dc('0x13')](_0x52dc('0xc'),_0x11a06c,_0x52dc('0xd'));_0x21491f(_0xcae5c4[_0x52dc('0x14')]['message']);}})[_0x52dc('0x15')](function(_0x12359f){logger[_0x52dc('0x11')]('DeskAccount,\x20%s,\x20%s',_0x11a06c,_0x12359f);_0x30ac17(_0x12359f);});});}exports[_0x52dc('0x16')]=function(_0x2644c1){var _0x1621ab=this;return new Promise(function(_0x52908a,_0x2f9a0c){return db[_0x52dc('0x17')][_0x52dc('0x18')]({'raw':_0x2644c1['options']?_0x2644c1[_0x52dc('0x19')][_0x52dc('0x1a')]===undefined?!![]:![]:!![],'where':_0x2644c1[_0x52dc('0x19')]?_0x2644c1['options'][_0x52dc('0x1b')]||null:null,'attributes':_0x2644c1[_0x52dc('0x19')]?_0x2644c1['options'][_0x52dc('0x1c')]||null:null,'limit':_0x2644c1[_0x52dc('0x19')]?_0x2644c1['options'][_0x52dc('0x1d')]||null:null,'include':_0x2644c1[_0x52dc('0x19')]?_0x2644c1['options']['include']?_[_0x52dc('0x1e')](_0x2644c1[_0x52dc('0x19')]['include'],function(_0x159c77){return{'model':db[_0x159c77[_0x52dc('0x1f')]],'as':_0x159c77['as'],'attributes':_0x159c77[_0x52dc('0x1c')],'include':_0x159c77[_0x52dc('0x20')]?_['map'](_0x159c77[_0x52dc('0x20')],function(_0x2ccbdf){return{'model':db[_0x2ccbdf['model']],'as':_0x2ccbdf['as'],'attributes':_0x2ccbdf['attributes'],'include':_0x2ccbdf[_0x52dc('0x20')]?_[_0x52dc('0x1e')](_0x2ccbdf[_0x52dc('0x20')],function(_0x83df91){return{'model':db[_0x83df91['model']],'as':_0x83df91['as'],'attributes':_0x83df91[_0x52dc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x52dc('0xb')](function(_0x29d48e){logger['info'](_0x52dc('0x16'),_0x2644c1);logger['debug'](_0x52dc('0x16'),_0x2644c1,JSON['stringify'](_0x29d48e));_0x52908a(_0x29d48e);})[_0x52dc('0x15')](function(_0xff446e){logger[_0x52dc('0x11')](_0x52dc('0x16'),_0xff446e[_0x52dc('0x12')],_0x2644c1);_0x2f9a0c(_0x1621ab['error'](0x1f4,_0xff446e['message']));});});};exports[_0x52dc('0x21')]=function(_0x325511){var _0x23275e=this;return new Promise(function(_0x5c0b4f,_0x4b6a3c){return db['DeskAccount']['find']({'raw':_0x325511[_0x52dc('0x19')]?_0x325511['options']['raw']===undefined?!![]:![]:!![],'where':_0x325511[_0x52dc('0x19')]?_0x325511[_0x52dc('0x19')][_0x52dc('0x1b')]||null:null,'attributes':_0x325511[_0x52dc('0x19')]?_0x325511['options'][_0x52dc('0x1c')]||null:null,'include':_0x325511['options']?_0x325511['options']['include']?_[_0x52dc('0x1e')](_0x325511['options'][_0x52dc('0x20')],function(_0x390d1e){return{'model':db[_0x390d1e[_0x52dc('0x1f')]],'as':_0x390d1e['as'],'attributes':_0x390d1e[_0x52dc('0x1c')],'include':_0x390d1e[_0x52dc('0x20')]?_[_0x52dc('0x1e')](_0x390d1e['include'],function(_0x44bcf2){return{'model':db[_0x44bcf2[_0x52dc('0x1f')]],'as':_0x44bcf2['as'],'attributes':_0x44bcf2[_0x52dc('0x1c')],'include':_0x44bcf2[_0x52dc('0x20')]?_[_0x52dc('0x1e')](_0x44bcf2['include'],function(_0x5f5338){return{'model':db[_0x5f5338[_0x52dc('0x1f')]],'as':_0x5f5338['as'],'attributes':_0x5f5338[_0x52dc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x52dc('0xb')](function(_0xd62d8d){logger[_0x52dc('0x13')](_0x52dc('0x21'),_0x325511);logger[_0x52dc('0xe')]('ShowDeskAccount',_0x325511,JSON['stringify'](_0xd62d8d));_0x5c0b4f(_0xd62d8d);})[_0x52dc('0x15')](function(_0x123993){logger[_0x52dc('0x11')](_0x52dc('0x21'),_0x123993['message'],_0x325511);_0x4b6a3c(_0x23275e[_0x52dc('0x11')](0x1f4,_0x123993[_0x52dc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6a15462..998362b 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5a4169,_0x53aa8e){var _0x3e6b94=function(_0x1b7b60){while(--_0x1b7b60){_0x5a4169['push'](_0x5a4169['shift']());}};_0x3e6b94(++_0x53aa8e);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x37bf8d,_0x43bce8){var _0x580ada=function(_0x43df13){while(--_0x43df13){_0x37bf8d['push'](_0x37bf8d['shift']());}};_0x580ada(++_0x43bce8);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9dc2b3e..2fcd3fd 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 _0x0253=['STRING','sequelize','exports'];(function(_0x1c729d,_0x14e062){var _0x4b9548=function(_0x2607bc){while(--_0x2607bc){_0x1c729d['push'](_0x1c729d['shift']());}};_0x4b9548(++_0x14e062);}(_0x0253,0x1ae));var _0x3025=function(_0x1f14ad,_0x103ee7){_0x1f14ad=_0x1f14ad-0x0;var _0x23ae78=_0x0253[_0x1f14ad];return _0x23ae78;};'use strict';var Sequelize=require(_0x3025('0x0'));module[_0x3025('0x1')]={'name':{'type':Sequelize[_0x3025('0x2')]},'description':{'type':Sequelize[_0x3025('0x2')]}}; \ No newline at end of file +var _0xcdbf=['sequelize','exports','STRING'];(function(_0x533da3,_0x469556){var _0x2999bd=function(_0x2bb88d){while(--_0x2bb88d){_0x533da3['push'](_0x533da3['shift']());}};_0x2999bd(++_0x469556);}(_0xcdbf,0x1ad));var _0xfcdb=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcdbf[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0xfcdb('0x0'));module[_0xfcdb('0x1')]={'name':{'type':Sequelize[_0xfcdb('0x2')]},'description':{'type':Sequelize[_0xfcdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index a0383dd..42218d8 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 _0x9942=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','DeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','findOne','DeskField','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2c00e7,_0x507037){var _0x13fbca=function(_0x3e7556){while(--_0x3e7556){_0x2c00e7['push'](_0x2c00e7['shift']());}};_0x13fbca(++_0x507037);}(_0x9942,0x189));var _0x2994=function(_0x10dbab,_0x2e8174){_0x10dbab=_0x10dbab-0x0;var _0x408bfe=_0x9942[_0x10dbab];return _0x408bfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2994('0x0'));var zipdir=require(_0x2994('0x1'));var jsonpatch=require(_0x2994('0x2'));var rp=require('request-promise');var moment=require(_0x2994('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2994('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2994('0x5'));var ejs=require(_0x2994('0x6'));var fs=require('fs');var fs_extra=require(_0x2994('0x7'));var _=require(_0x2994('0x8'));var squel=require(_0x2994('0x9'));var crypto=require('crypto');var jsforce=require(_0x2994('0xa'));var deskjs=require(_0x2994('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2994('0xc'));var Redis=require(_0x2994('0xd'));var authService=require(_0x2994('0xe'));var qs=require(_0x2994('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2994('0x10'));var logger=require('../../config/logger')(_0x2994('0x11'));var utils=require(_0x2994('0x12'));var config=require(_0x2994('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2994('0x14'))['db'];function respondWithStatusCode(_0x47cc4b,_0x1402c4){_0x1402c4=_0x1402c4||0xcc;return function(_0x4e8abd){if(_0x4e8abd){return _0x47cc4b['sendStatus'](_0x1402c4);}return _0x47cc4b['status'](_0x1402c4)[_0x2994('0x15')]();};}function respondWithResult(_0x560091,_0xd7fc26){_0xd7fc26=_0xd7fc26||0xc8;return function(_0x3cfa61){if(_0x3cfa61){return _0x560091[_0x2994('0x16')](_0xd7fc26)['json'](_0x3cfa61);}};}function respondWithFilteredResult(_0x3ec2e4,_0x5391b4){return function(_0x1da41b){if(_0x1da41b){var _0x475783=typeof _0x5391b4[_0x2994('0x17')]===_0x2994('0x18')&&typeof _0x5391b4[_0x2994('0x19')]===_0x2994('0x18');var _0x303261=_0x1da41b[_0x2994('0x1a')];var _0x580848=_0x475783?0x0:_0x5391b4[_0x2994('0x17')];var _0x314877=_0x475783?_0x1da41b['count']:_0x5391b4['offset']+_0x5391b4[_0x2994('0x19')];var _0x389d83;if(_0x314877>=_0x303261){_0x314877=_0x303261;_0x389d83=0xc8;}else{_0x389d83=0xce;}_0x3ec2e4[_0x2994('0x16')](_0x389d83);return _0x3ec2e4[_0x2994('0x1b')](_0x2994('0x1c'),_0x580848+'-'+_0x314877+'/'+_0x303261)[_0x2994('0x1d')](_0x1da41b);}return null;};}function patchUpdates(_0x11a935){return function(_0x707edc){try{jsonpatch[_0x2994('0x1e')](_0x707edc,_0x11a935,!![]);}catch(_0x10d276){return BPromise[_0x2994('0x1f')](_0x10d276);}return _0x707edc[_0x2994('0x20')]();};}function saveUpdates(_0x55752a,_0x555778){return function(_0x26ee7c){if(_0x26ee7c){return _0x26ee7c[_0x2994('0x21')](_0x55752a)[_0x2994('0x22')](function(_0x3d737d){return _0x3d737d;});}return null;};}function removeEntity(_0x2efe9f,_0x5e8118){return function(_0x36fb12){if(_0x36fb12){return _0x36fb12[_0x2994('0x23')]()[_0x2994('0x22')](function(){_0x2efe9f[_0x2994('0x16')](0xcc)[_0x2994('0x15')]();});}};}function handleEntityNotFound(_0x4f4272,_0x391c83){return function(_0x4a6133){if(!_0x4a6133){_0x4f4272[_0x2994('0x24')](0x194);}return _0x4a6133;};}function handleError(_0x5f02a4,_0x38e544){_0x38e544=_0x38e544||0x1f4;return function(_0x4508ba){logger[_0x2994('0x25')](_0x4508ba['stack']);if(_0x4508ba['name']){delete _0x4508ba[_0x2994('0x26')];}_0x5f02a4[_0x2994('0x16')](_0x38e544)[_0x2994('0x27')](_0x4508ba);};}exports[_0x2994('0x28')]=function(_0x18b7e5,_0x4e5f72){var _0x1b64ca={},_0x842cdc={},_0x207313={'count':0x0,'rows':[]};var _0x23897f=_[_0x2994('0x29')](db[_0x2994('0x2a')][_0x2994('0x2b')],function(_0x2e7507){return{'name':_0x2e7507['fieldName'],'type':_0x2e7507[_0x2994('0x2c')][_0x2994('0x2d')]};});_0x842cdc['model']=_[_0x2994('0x29')](_0x23897f,'name');_0x842cdc[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x18b7e5[_0x2994('0x2e')]);_0x842cdc[_0x2994('0x30')]=_[_0x2994('0x31')](_0x842cdc[_0x2994('0x32')],_0x842cdc[_0x2994('0x2e')]);_0x1b64ca[_0x2994('0x33')]=_['intersection'](_0x842cdc[_0x2994('0x32')],qs[_0x2994('0x34')](_0x18b7e5[_0x2994('0x2e')]['fields']));_0x1b64ca[_0x2994('0x33')]=_0x1b64ca[_0x2994('0x33')][_0x2994('0x35')]?_0x1b64ca[_0x2994('0x33')]:_0x842cdc['model'];if(!_0x18b7e5[_0x2994('0x2e')][_0x2994('0x36')](_0x2994('0x37'))){_0x1b64ca[_0x2994('0x19')]=qs[_0x2994('0x19')](_0x18b7e5[_0x2994('0x2e')][_0x2994('0x19')]);_0x1b64ca['offset']=qs[_0x2994('0x17')](_0x18b7e5[_0x2994('0x2e')][_0x2994('0x17')]);}_0x1b64ca[_0x2994('0x38')]=qs[_0x2994('0x39')](_0x18b7e5[_0x2994('0x2e')][_0x2994('0x39')]);_0x1b64ca[_0x2994('0x3a')]=qs[_0x2994('0x30')](_['pick'](_0x18b7e5[_0x2994('0x2e')],_0x842cdc[_0x2994('0x30')]),_0x23897f);if(_0x18b7e5[_0x2994('0x2e')]['filter']){_0x1b64ca['where']=_[_0x2994('0x3b')](_0x1b64ca['where'],{'$or':_[_0x2994('0x29')](_0x23897f,function(_0xb48cbe){if(_0xb48cbe[_0x2994('0x2c')]!==_0x2994('0x3c')){var _0x56dbbd={};_0x56dbbd[_0xb48cbe['name']]={'$like':'%'+_0x18b7e5[_0x2994('0x2e')][_0x2994('0x3d')]+'%'};return _0x56dbbd;}})});}_0x1b64ca=_[_0x2994('0x3b')]({},_0x1b64ca,_0x18b7e5[_0x2994('0x3e')]);var _0x3e8de4={'where':_0x1b64ca[_0x2994('0x3a')]};return db['DeskConfiguration']['count'](_0x3e8de4)[_0x2994('0x22')](function(_0x535710){_0x207313[_0x2994('0x1a')]=_0x535710;if(_0x18b7e5[_0x2994('0x2e')][_0x2994('0x3f')]){_0x1b64ca[_0x2994('0x40')]=[{'all':!![]}];}return db[_0x2994('0x2a')]['findAll'](_0x1b64ca);})[_0x2994('0x22')](function(_0x564fc9){_0x207313[_0x2994('0x41')]=_0x564fc9;return _0x207313;})[_0x2994('0x22')](respondWithFilteredResult(_0x4e5f72,_0x1b64ca))[_0x2994('0x42')](handleError(_0x4e5f72,null));};exports[_0x2994('0x43')]=function(_0x2ae015,_0x4c01d0){var _0x39e68b={'raw':![],'where':{'id':_0x2ae015['params']['id']}},_0x58616c={};_0x58616c[_0x2994('0x32')]=_[_0x2994('0x2f')](db[_0x2994('0x2a')][_0x2994('0x2b')]);_0x58616c[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x2ae015[_0x2994('0x2e')]);_0x58616c[_0x2994('0x30')]=_['intersection'](_0x58616c['model'],_0x58616c[_0x2994('0x2e')]);_0x39e68b[_0x2994('0x33')]=_['intersection'](_0x58616c[_0x2994('0x32')],qs[_0x2994('0x34')](_0x2ae015[_0x2994('0x2e')]['fields']));_0x39e68b[_0x2994('0x33')]=_0x39e68b[_0x2994('0x33')]['length']?_0x39e68b[_0x2994('0x33')]:_0x58616c[_0x2994('0x32')];if(_0x2ae015[_0x2994('0x2e')]['includeAll']){_0x39e68b[_0x2994('0x40')]=[{'all':!![]}];}_0x39e68b=_[_0x2994('0x3b')]({},_0x39e68b,_0x2ae015['options']);return db[_0x2994('0x2a')][_0x2994('0x44')](_0x39e68b)[_0x2994('0x22')](handleEntityNotFound(_0x4c01d0,null))['then'](respondWithResult(_0x4c01d0,null))[_0x2994('0x42')](handleError(_0x4c01d0,null));};exports[_0x2994('0x45')]=function(_0x25e8f9,_0x1ad1b6){return db[_0x2994('0x2a')][_0x2994('0x45')](_0x25e8f9[_0x2994('0x46')],{})['then'](respondWithResult(_0x1ad1b6,0xc9))['catch'](handleError(_0x1ad1b6,null));};exports[_0x2994('0x21')]=function(_0x2873f1,_0x7a8c43){if(_0x2873f1[_0x2994('0x46')]['id']){delete _0x2873f1['body']['id'];}return db[_0x2994('0x2a')][_0x2994('0x44')]({'where':{'id':_0x2873f1[_0x2994('0x47')]['id']}})[_0x2994('0x22')](handleEntityNotFound(_0x7a8c43,null))[_0x2994('0x22')](saveUpdates(_0x2873f1[_0x2994('0x46')],null))['then'](respondWithResult(_0x7a8c43,null))['catch'](handleError(_0x7a8c43,null));};exports[_0x2994('0x23')]=function(_0x51bb34,_0x1dfc18){return db[_0x2994('0x2a')][_0x2994('0x44')]({'where':{'id':_0x51bb34[_0x2994('0x47')]['id']}})['then'](handleEntityNotFound(_0x1dfc18,null))[_0x2994('0x22')](removeEntity(_0x1dfc18,null))[_0x2994('0x42')](handleError(_0x1dfc18,null));};exports['getFields']=function(_0x128008,_0x5b5210,_0x1f5334){var _0x18d02e={};var _0x2e8d9d={};var _0x40f70e;var _0x3dd3d0;return db[_0x2994('0x2a')][_0x2994('0x48')]({'where':{'id':_0x128008[_0x2994('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b5210,null))[_0x2994('0x22')](function(_0x522295){if(_0x522295){_0x40f70e=_0x522295;_0x2e8d9d[_0x2994('0x32')]=_['keys'](db[_0x2994('0x49')]['rawAttributes']);_0x2e8d9d[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x128008[_0x2994('0x2e')]);_0x2e8d9d[_0x2994('0x30')]=_[_0x2994('0x31')](_0x2e8d9d[_0x2994('0x32')],_0x2e8d9d[_0x2994('0x2e')]);_0x18d02e['attributes']=_[_0x2994('0x31')](_0x2e8d9d[_0x2994('0x32')],qs[_0x2994('0x34')](_0x128008[_0x2994('0x2e')]['fields']));_0x18d02e[_0x2994('0x33')]=_0x18d02e[_0x2994('0x33')][_0x2994('0x35')]?_0x18d02e[_0x2994('0x33')]:_0x2e8d9d['model'];_0x18d02e[_0x2994('0x38')]=qs[_0x2994('0x39')](_0x128008[_0x2994('0x2e')]['sort']);_0x18d02e[_0x2994('0x3a')]=qs[_0x2994('0x30')](_[_0x2994('0x4a')](_0x128008['query'],_0x2e8d9d[_0x2994('0x30')]));if(_0x128008[_0x2994('0x2e')][_0x2994('0x3d')]){_0x18d02e[_0x2994('0x3a')]=_[_0x2994('0x3b')](_0x18d02e[_0x2994('0x3a')],{'$or':_[_0x2994('0x29')](_0x18d02e[_0x2994('0x33')],function(_0x1aca3b){var _0x43286b={};_0x43286b[_0x1aca3b]={'$like':'%'+_0x128008[_0x2994('0x2e')][_0x2994('0x3d')]+'%'};return _0x43286b;})});}_0x18d02e=_['merge']({},_0x18d02e,_0x128008[_0x2994('0x3e')]);return _0x40f70e[_0x2994('0x4b')](_0x18d02e);}})['then'](function(_0xf5a6f3){if(_0xf5a6f3){_0x3dd3d0=_0xf5a6f3['length'];if(!_0x128008[_0x2994('0x2e')][_0x2994('0x36')]('nolimit')){_0x18d02e[_0x2994('0x19')]=qs[_0x2994('0x19')](_0x128008[_0x2994('0x2e')][_0x2994('0x19')]);_0x18d02e['offset']=qs[_0x2994('0x17')](_0x128008[_0x2994('0x2e')][_0x2994('0x17')]);}return _0x40f70e[_0x2994('0x4b')](_0x18d02e);}})[_0x2994('0x22')](function(_0x2c0c31){if(_0x2c0c31){return _0x2c0c31?{'count':_0x3dd3d0,'rows':_0x2c0c31}:null;}})[_0x2994('0x22')](respondWithResult(_0x5b5210,null))['catch'](handleError(_0x5b5210,null));};exports['getSubjects']=function(_0x54c6cb,_0x170ffa,_0x3b68e4){var _0x1c30d6={};var _0x25a21e={};var _0x5042d0;var _0x243d79;return db['DeskConfiguration'][_0x2994('0x48')]({'where':{'id':_0x54c6cb[_0x2994('0x47')]['id']}})[_0x2994('0x22')](handleEntityNotFound(_0x170ffa,null))['then'](function(_0x688edd){if(_0x688edd){_0x5042d0=_0x688edd;_0x25a21e['model']=_[_0x2994('0x2f')](db[_0x2994('0x49')]['rawAttributes']);_0x25a21e[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x54c6cb[_0x2994('0x2e')]);_0x25a21e[_0x2994('0x30')]=_['intersection'](_0x25a21e[_0x2994('0x32')],_0x25a21e[_0x2994('0x2e')]);_0x1c30d6[_0x2994('0x33')]=_[_0x2994('0x31')](_0x25a21e[_0x2994('0x32')],qs[_0x2994('0x34')](_0x54c6cb[_0x2994('0x2e')][_0x2994('0x34')]));_0x1c30d6['attributes']=_0x1c30d6[_0x2994('0x33')]['length']?_0x1c30d6['attributes']:_0x25a21e[_0x2994('0x32')];_0x1c30d6[_0x2994('0x38')]=qs[_0x2994('0x39')](_0x54c6cb['query'][_0x2994('0x39')]);_0x1c30d6[_0x2994('0x3a')]=qs[_0x2994('0x30')](_['pick'](_0x54c6cb[_0x2994('0x2e')],_0x25a21e[_0x2994('0x30')]));if(_0x54c6cb['query'][_0x2994('0x3d')]){_0x1c30d6[_0x2994('0x3a')]=_[_0x2994('0x3b')](_0x1c30d6[_0x2994('0x3a')],{'$or':_[_0x2994('0x29')](_0x1c30d6[_0x2994('0x33')],function(_0x5588b4){var _0x5d612b={};_0x5d612b[_0x5588b4]={'$like':'%'+_0x54c6cb[_0x2994('0x2e')][_0x2994('0x3d')]+'%'};return _0x5d612b;})});}_0x1c30d6=_[_0x2994('0x3b')]({},_0x1c30d6,_0x54c6cb[_0x2994('0x3e')]);return _0x5042d0[_0x2994('0x4c')](_0x1c30d6);}})[_0x2994('0x22')](function(_0x3f64bb){if(_0x3f64bb){_0x243d79=_0x3f64bb[_0x2994('0x35')];if(!_0x54c6cb[_0x2994('0x2e')][_0x2994('0x36')](_0x2994('0x37'))){_0x1c30d6[_0x2994('0x19')]=qs[_0x2994('0x19')](_0x54c6cb[_0x2994('0x2e')][_0x2994('0x19')]);_0x1c30d6[_0x2994('0x17')]=qs[_0x2994('0x17')](_0x54c6cb[_0x2994('0x2e')][_0x2994('0x17')]);}return _0x5042d0[_0x2994('0x4c')](_0x1c30d6);}})['then'](function(_0x4836cc){if(_0x4836cc){return _0x4836cc?{'count':_0x243d79,'rows':_0x4836cc}:null;}})[_0x2994('0x22')](respondWithResult(_0x170ffa,null))[_0x2994('0x42')](handleError(_0x170ffa,null));};exports[_0x2994('0x4d')]=function(_0x1d2ce3,_0x18f143,_0x34fbba){var _0x39defd={};var _0x46cd72={};var _0x20ca25;var _0x4eeaaf;return db[_0x2994('0x2a')][_0x2994('0x48')]({'where':{'id':_0x1d2ce3[_0x2994('0x47')]['id']}})[_0x2994('0x22')](handleEntityNotFound(_0x18f143,null))[_0x2994('0x22')](function(_0x19add4){if(_0x19add4){_0x20ca25=_0x19add4;_0x46cd72[_0x2994('0x32')]=_[_0x2994('0x2f')](db['DeskField'][_0x2994('0x2b')]);_0x46cd72[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x1d2ce3[_0x2994('0x2e')]);_0x46cd72[_0x2994('0x30')]=_['intersection'](_0x46cd72[_0x2994('0x32')],_0x46cd72[_0x2994('0x2e')]);_0x39defd[_0x2994('0x33')]=_[_0x2994('0x31')](_0x46cd72[_0x2994('0x32')],qs['fields'](_0x1d2ce3[_0x2994('0x2e')][_0x2994('0x34')]));_0x39defd[_0x2994('0x33')]=_0x39defd[_0x2994('0x33')][_0x2994('0x35')]?_0x39defd[_0x2994('0x33')]:_0x46cd72['model'];_0x39defd[_0x2994('0x38')]=qs[_0x2994('0x39')](_0x1d2ce3[_0x2994('0x2e')]['sort']);_0x39defd[_0x2994('0x3a')]=qs[_0x2994('0x30')](_[_0x2994('0x4a')](_0x1d2ce3[_0x2994('0x2e')],_0x46cd72[_0x2994('0x30')]));if(_0x1d2ce3['query']['filter']){_0x39defd[_0x2994('0x3a')]=_['merge'](_0x39defd['where'],{'$or':_['map'](_0x39defd[_0x2994('0x33')],function(_0x1b8065){var _0x4935f5={};_0x4935f5[_0x1b8065]={'$like':'%'+_0x1d2ce3[_0x2994('0x2e')]['filter']+'%'};return _0x4935f5;})});}_0x39defd=_[_0x2994('0x3b')]({},_0x39defd,_0x1d2ce3[_0x2994('0x3e')]);return _0x20ca25[_0x2994('0x4d')](_0x39defd);}})['then'](function(_0x37d37b){if(_0x37d37b){_0x4eeaaf=_0x37d37b['length'];if(!_0x1d2ce3['query'][_0x2994('0x36')](_0x2994('0x37'))){_0x39defd[_0x2994('0x19')]=qs['limit'](_0x1d2ce3[_0x2994('0x2e')][_0x2994('0x19')]);_0x39defd['offset']=qs[_0x2994('0x17')](_0x1d2ce3[_0x2994('0x2e')][_0x2994('0x17')]);}return _0x20ca25[_0x2994('0x4d')](_0x39defd);}})['then'](function(_0x43e51b){if(_0x43e51b){return _0x43e51b?{'count':_0x4eeaaf,'rows':_0x43e51b}:null;}})[_0x2994('0x22')](respondWithResult(_0x18f143,null))[_0x2994('0x42')](handleError(_0x18f143,null));};exports[_0x2994('0x4e')]=function(_0x505871,_0x366a90,_0x19c673){var _0x264312={};var _0x3a2bf1={};var _0x29b789;var _0x20a542;return db[_0x2994('0x2a')]['findOne']({'where':{'id':_0x505871['params']['id']}})[_0x2994('0x22')](handleEntityNotFound(_0x366a90,null))[_0x2994('0x22')](function(_0xce322d){if(_0xce322d){_0x29b789=_0xce322d;_0x3a2bf1[_0x2994('0x32')]=_['keys'](db[_0x2994('0x4f')][_0x2994('0x2b')]);_0x3a2bf1[_0x2994('0x2e')]=_[_0x2994('0x2f')](_0x505871[_0x2994('0x2e')]);_0x3a2bf1[_0x2994('0x30')]=_[_0x2994('0x31')](_0x3a2bf1[_0x2994('0x32')],_0x3a2bf1[_0x2994('0x2e')]);_0x264312[_0x2994('0x33')]=_['intersection'](_0x3a2bf1[_0x2994('0x32')],qs['fields'](_0x505871['query']['fields']));_0x264312[_0x2994('0x33')]=_0x264312[_0x2994('0x33')][_0x2994('0x35')]?_0x264312[_0x2994('0x33')]:_0x3a2bf1['model'];_0x264312['order']=qs[_0x2994('0x39')](_0x505871['query'][_0x2994('0x39')]);_0x264312[_0x2994('0x3a')]=qs[_0x2994('0x30')](_[_0x2994('0x4a')](_0x505871[_0x2994('0x2e')],_0x3a2bf1[_0x2994('0x30')]));if(_0x505871['query'][_0x2994('0x3d')]){_0x264312['where']=_[_0x2994('0x3b')](_0x264312[_0x2994('0x3a')],{'$or':_[_0x2994('0x29')](_0x264312[_0x2994('0x33')],function(_0x84e29){var _0x446d3e={};_0x446d3e[_0x84e29]={'$like':'%'+_0x505871[_0x2994('0x2e')]['filter']+'%'};return _0x446d3e;})});}_0x264312=_[_0x2994('0x3b')]({},_0x264312,_0x505871[_0x2994('0x3e')]);return _0x29b789[_0x2994('0x4e')](_0x264312);}})[_0x2994('0x22')](function(_0x3d6d76){if(_0x3d6d76){_0x20a542=_0x3d6d76[_0x2994('0x35')];if(!_0x505871[_0x2994('0x2e')][_0x2994('0x36')](_0x2994('0x37'))){_0x264312['limit']=qs['limit'](_0x505871[_0x2994('0x2e')][_0x2994('0x19')]);_0x264312[_0x2994('0x17')]=qs['offset'](_0x505871[_0x2994('0x2e')][_0x2994('0x17')]);}return _0x29b789['getTags'](_0x264312);}})[_0x2994('0x22')](function(_0x26bea9){if(_0x26bea9){return _0x26bea9?{'count':_0x20a542,'rows':_0x26bea9}:null;}})[_0x2994('0x22')](respondWithResult(_0x366a90,null))['catch'](handleError(_0x366a90,null));};exports['setTags']=function(_0x153412,_0x1964b2,_0x45a064){if(_0x153412[_0x2994('0x46')]['id']){delete _0x153412['body']['id'];}return db['DeskConfiguration'][_0x2994('0x48')]({'where':{'id':_0x153412[_0x2994('0x47')]['id']}})[_0x2994('0x22')](handleEntityNotFound(_0x1964b2,null))[_0x2994('0x22')](function(_0x4e9fb1){if(_0x4e9fb1){return _0x4e9fb1[_0x2994('0x50')](_0x153412['body']['ids']||[]);}return null;})[_0x2994('0x22')](respondWithResult(_0x1964b2,null))[_0x2994('0x42')](handleError(_0x1964b2,null));}; \ No newline at end of file +var _0x3903=['length','options','find','create','body','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','catch','show','params','keys'];(function(_0x36806b,_0x296211){var _0x50a0dd=function(_0x57ceb7){while(--_0x57ceb7){_0x36806b['push'](_0x36806b['shift']());}};_0x50a0dd(++_0x296211);}(_0x3903,0xb3));var _0x3390=function(_0x3446e8,_0x59d7d3){_0x3446e8=_0x3446e8-0x0;var _0x5751a4=_0x3903[_0x3446e8];return _0x5751a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3390('0x0'));var zipdir=require(_0x3390('0x1'));var jsonpatch=require(_0x3390('0x2'));var rp=require(_0x3390('0x3'));var moment=require(_0x3390('0x4'));var BPromise=require(_0x3390('0x5'));var Mustache=require(_0x3390('0x6'));var util=require(_0x3390('0x7'));var path=require(_0x3390('0x8'));var sox=require(_0x3390('0x9'));var csv=require(_0x3390('0xa'));var ejs=require(_0x3390('0xb'));var fs=require('fs');var fs_extra=require(_0x3390('0xc'));var _=require(_0x3390('0xd'));var squel=require(_0x3390('0xe'));var crypto=require(_0x3390('0xf'));var jsforce=require(_0x3390('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3390('0xa'));var querystring=require(_0x3390('0x11'));var Papa=require(_0x3390('0x12'));var Redis=require(_0x3390('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3390('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3390('0x15'));var logger=require(_0x3390('0x16'))(_0x3390('0x17'));var utils=require(_0x3390('0x18'));var config=require(_0x3390('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3390('0x1a'))['db'];function respondWithStatusCode(_0xb8dac8,_0x14409d){_0x14409d=_0x14409d||0xcc;return function(_0x6d0eb7){if(_0x6d0eb7){return _0xb8dac8[_0x3390('0x1b')](_0x14409d);}return _0xb8dac8[_0x3390('0x1c')](_0x14409d)['end']();};}function respondWithResult(_0x24f8d2,_0x3c2ddb){_0x3c2ddb=_0x3c2ddb||0xc8;return function(_0x2cc417){if(_0x2cc417){return _0x24f8d2[_0x3390('0x1c')](_0x3c2ddb)['json'](_0x2cc417);}};}function respondWithFilteredResult(_0xbbdb77,_0x457a4e){return function(_0x28a75c){if(_0x28a75c){var _0x516937=typeof _0x457a4e[_0x3390('0x1d')]==='undefined'&&typeof _0x457a4e[_0x3390('0x1e')]==='undefined';var _0x54ca67=_0x28a75c[_0x3390('0x1f')];var _0xcacd13=_0x516937?0x0:_0x457a4e[_0x3390('0x1d')];var _0xf51d70=_0x516937?_0x28a75c[_0x3390('0x1f')]:_0x457a4e[_0x3390('0x1d')]+_0x457a4e[_0x3390('0x1e')];var _0x31e408;if(_0xf51d70>=_0x54ca67){_0xf51d70=_0x54ca67;_0x31e408=0xc8;}else{_0x31e408=0xce;}_0xbbdb77['status'](_0x31e408);return _0xbbdb77[_0x3390('0x20')](_0x3390('0x21'),_0xcacd13+'-'+_0xf51d70+'/'+_0x54ca67)['json'](_0x28a75c);}return null;};}function patchUpdates(_0x2abb00){return function(_0x509a26){try{jsonpatch[_0x3390('0x22')](_0x509a26,_0x2abb00,!![]);}catch(_0x561b8){return BPromise[_0x3390('0x23')](_0x561b8);}return _0x509a26[_0x3390('0x24')]();};}function saveUpdates(_0x51afbc,_0x4993ea){return function(_0x316c6a){if(_0x316c6a){return _0x316c6a[_0x3390('0x25')](_0x51afbc)[_0x3390('0x26')](function(_0x1b82a1){return _0x1b82a1;});}return null;};}function removeEntity(_0x11226b,_0x3876d0){return function(_0x53cad8){if(_0x53cad8){return _0x53cad8[_0x3390('0x27')]()[_0x3390('0x26')](function(){_0x11226b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc68f,_0x4a4939){return function(_0xfd588e){if(!_0xfd588e){_0x5cc68f[_0x3390('0x1b')](0x194);}return _0xfd588e;};}function handleError(_0x2a725f,_0x239def){_0x239def=_0x239def||0x1f4;return function(_0x1394cd){logger[_0x3390('0x28')](_0x1394cd[_0x3390('0x29')]);if(_0x1394cd[_0x3390('0x2a')]){delete _0x1394cd[_0x3390('0x2a')];}_0x2a725f['status'](_0x239def)[_0x3390('0x2b')](_0x1394cd);};}exports[_0x3390('0x2c')]=function(_0x11c3b0,_0x5d984f){var _0x3eeaa5={},_0x4d6b8c={},_0x30d969={'count':0x0,'rows':[]};var _0x528648=_[_0x3390('0x2d')](db[_0x3390('0x2e')][_0x3390('0x2f')],function(_0x3f4c87){return{'name':_0x3f4c87[_0x3390('0x30')],'type':_0x3f4c87[_0x3390('0x31')][_0x3390('0x32')]};});_0x4d6b8c['model']=_[_0x3390('0x2d')](_0x528648,'name');_0x4d6b8c[_0x3390('0x33')]=_['keys'](_0x11c3b0[_0x3390('0x33')]);_0x4d6b8c['filters']=_[_0x3390('0x34')](_0x4d6b8c[_0x3390('0x35')],_0x4d6b8c[_0x3390('0x33')]);_0x3eeaa5[_0x3390('0x36')]=_[_0x3390('0x34')](_0x4d6b8c[_0x3390('0x35')],qs[_0x3390('0x37')](_0x11c3b0[_0x3390('0x33')][_0x3390('0x37')]));_0x3eeaa5[_0x3390('0x36')]=_0x3eeaa5[_0x3390('0x36')]['length']?_0x3eeaa5[_0x3390('0x36')]:_0x4d6b8c['model'];if(!_0x11c3b0[_0x3390('0x33')][_0x3390('0x38')](_0x3390('0x39'))){_0x3eeaa5[_0x3390('0x1e')]=qs['limit'](_0x11c3b0[_0x3390('0x33')][_0x3390('0x1e')]);_0x3eeaa5[_0x3390('0x1d')]=qs[_0x3390('0x1d')](_0x11c3b0[_0x3390('0x33')]['offset']);}_0x3eeaa5[_0x3390('0x3a')]=qs[_0x3390('0x3b')](_0x11c3b0[_0x3390('0x33')][_0x3390('0x3b')]);_0x3eeaa5[_0x3390('0x3c')]=qs[_0x3390('0x3d')](_[_0x3390('0x3e')](_0x11c3b0[_0x3390('0x33')],_0x4d6b8c[_0x3390('0x3d')]),_0x528648);if(_0x11c3b0[_0x3390('0x33')][_0x3390('0x3f')]){_0x3eeaa5['where']=_[_0x3390('0x40')](_0x3eeaa5[_0x3390('0x3c')],{'$or':_[_0x3390('0x2d')](_0x528648,function(_0x388d5c){if(_0x388d5c[_0x3390('0x31')]!=='VIRTUAL'){var _0x41c95f={};_0x41c95f[_0x388d5c['name']]={'$like':'%'+_0x11c3b0['query']['filter']+'%'};return _0x41c95f;}})});}_0x3eeaa5=_['merge']({},_0x3eeaa5,_0x11c3b0['options']);var _0x269a89={'where':_0x3eeaa5[_0x3390('0x3c')]};return db[_0x3390('0x2e')][_0x3390('0x1f')](_0x269a89)[_0x3390('0x26')](function(_0x27ecdf){_0x30d969[_0x3390('0x1f')]=_0x27ecdf;if(_0x11c3b0[_0x3390('0x33')][_0x3390('0x41')]){_0x3eeaa5['include']=[{'all':!![]}];}return db[_0x3390('0x2e')]['findAll'](_0x3eeaa5);})[_0x3390('0x26')](function(_0x44772e){_0x30d969['rows']=_0x44772e;return _0x30d969;})['then'](respondWithFilteredResult(_0x5d984f,_0x3eeaa5))[_0x3390('0x42')](handleError(_0x5d984f,null));};exports[_0x3390('0x43')]=function(_0xfc813c,_0x43ebe7){var _0x14cbdd={'raw':![],'where':{'id':_0xfc813c[_0x3390('0x44')]['id']}},_0x1b2d22={};_0x1b2d22[_0x3390('0x35')]=_[_0x3390('0x45')](db[_0x3390('0x2e')][_0x3390('0x2f')]);_0x1b2d22[_0x3390('0x33')]=_['keys'](_0xfc813c[_0x3390('0x33')]);_0x1b2d22[_0x3390('0x3d')]=_['intersection'](_0x1b2d22[_0x3390('0x35')],_0x1b2d22[_0x3390('0x33')]);_0x14cbdd[_0x3390('0x36')]=_['intersection'](_0x1b2d22['model'],qs[_0x3390('0x37')](_0xfc813c[_0x3390('0x33')]['fields']));_0x14cbdd['attributes']=_0x14cbdd[_0x3390('0x36')][_0x3390('0x46')]?_0x14cbdd[_0x3390('0x36')]:_0x1b2d22['model'];if(_0xfc813c['query'][_0x3390('0x41')]){_0x14cbdd['include']=[{'all':!![]}];}_0x14cbdd=_['merge']({},_0x14cbdd,_0xfc813c[_0x3390('0x47')]);return db['DeskConfiguration'][_0x3390('0x48')](_0x14cbdd)[_0x3390('0x26')](handleEntityNotFound(_0x43ebe7,null))[_0x3390('0x26')](respondWithResult(_0x43ebe7,null))['catch'](handleError(_0x43ebe7,null));};exports[_0x3390('0x49')]=function(_0x4d5194,_0x50f3c8){return db[_0x3390('0x2e')][_0x3390('0x49')](_0x4d5194['body'],{})[_0x3390('0x26')](respondWithResult(_0x50f3c8,0xc9))[_0x3390('0x42')](handleError(_0x50f3c8,null));};exports[_0x3390('0x25')]=function(_0xb70910,_0x3d8a9e){if(_0xb70910[_0x3390('0x4a')]['id']){delete _0xb70910[_0x3390('0x4a')]['id'];}return db[_0x3390('0x2e')][_0x3390('0x48')]({'where':{'id':_0xb70910['params']['id']}})[_0x3390('0x26')](handleEntityNotFound(_0x3d8a9e,null))[_0x3390('0x26')](saveUpdates(_0xb70910[_0x3390('0x4a')],null))['then'](respondWithResult(_0x3d8a9e,null))[_0x3390('0x42')](handleError(_0x3d8a9e,null));};exports[_0x3390('0x27')]=function(_0x3bc11a,_0x7b5cf4){return db[_0x3390('0x2e')][_0x3390('0x48')]({'where':{'id':_0x3bc11a[_0x3390('0x44')]['id']}})[_0x3390('0x26')](handleEntityNotFound(_0x7b5cf4,null))[_0x3390('0x26')](removeEntity(_0x7b5cf4,null))[_0x3390('0x42')](handleError(_0x7b5cf4,null));};exports[_0x3390('0x4b')]=function(_0x2b9b59,_0x235e1e,_0x5987d4){var _0x1d6d37={};var _0x1fcd5b={};var _0x20aa06;var _0x46c09b;return db[_0x3390('0x2e')]['findOne']({'where':{'id':_0x2b9b59[_0x3390('0x44')]['id']}})['then'](handleEntityNotFound(_0x235e1e,null))['then'](function(_0x33ec52){if(_0x33ec52){_0x20aa06=_0x33ec52;_0x1fcd5b[_0x3390('0x35')]=_[_0x3390('0x45')](db[_0x3390('0x4c')]['rawAttributes']);_0x1fcd5b[_0x3390('0x33')]=_[_0x3390('0x45')](_0x2b9b59[_0x3390('0x33')]);_0x1fcd5b[_0x3390('0x3d')]=_[_0x3390('0x34')](_0x1fcd5b[_0x3390('0x35')],_0x1fcd5b[_0x3390('0x33')]);_0x1d6d37[_0x3390('0x36')]=_[_0x3390('0x34')](_0x1fcd5b[_0x3390('0x35')],qs[_0x3390('0x37')](_0x2b9b59[_0x3390('0x33')][_0x3390('0x37')]));_0x1d6d37[_0x3390('0x36')]=_0x1d6d37[_0x3390('0x36')][_0x3390('0x46')]?_0x1d6d37[_0x3390('0x36')]:_0x1fcd5b[_0x3390('0x35')];_0x1d6d37[_0x3390('0x3a')]=qs[_0x3390('0x3b')](_0x2b9b59['query']['sort']);_0x1d6d37[_0x3390('0x3c')]=qs[_0x3390('0x3d')](_[_0x3390('0x3e')](_0x2b9b59[_0x3390('0x33')],_0x1fcd5b[_0x3390('0x3d')]));if(_0x2b9b59[_0x3390('0x33')]['filter']){_0x1d6d37['where']=_[_0x3390('0x40')](_0x1d6d37[_0x3390('0x3c')],{'$or':_[_0x3390('0x2d')](_0x1d6d37[_0x3390('0x36')],function(_0x231b6b){var _0x4f8c8b={};_0x4f8c8b[_0x231b6b]={'$like':'%'+_0x2b9b59[_0x3390('0x33')][_0x3390('0x3f')]+'%'};return _0x4f8c8b;})});}_0x1d6d37=_[_0x3390('0x40')]({},_0x1d6d37,_0x2b9b59[_0x3390('0x47')]);return _0x20aa06[_0x3390('0x4b')](_0x1d6d37);}})[_0x3390('0x26')](function(_0x36f9e2){if(_0x36f9e2){_0x46c09b=_0x36f9e2[_0x3390('0x46')];if(!_0x2b9b59['query'][_0x3390('0x38')](_0x3390('0x39'))){_0x1d6d37[_0x3390('0x1e')]=qs[_0x3390('0x1e')](_0x2b9b59[_0x3390('0x33')][_0x3390('0x1e')]);_0x1d6d37[_0x3390('0x1d')]=qs[_0x3390('0x1d')](_0x2b9b59[_0x3390('0x33')][_0x3390('0x1d')]);}return _0x20aa06['getFields'](_0x1d6d37);}})[_0x3390('0x26')](function(_0x51c997){if(_0x51c997){return _0x51c997?{'count':_0x46c09b,'rows':_0x51c997}:null;}})['then'](respondWithResult(_0x235e1e,null))[_0x3390('0x42')](handleError(_0x235e1e,null));};exports[_0x3390('0x4d')]=function(_0x1e9056,_0x5a5d76,_0x343457){var _0xaa8444={};var _0x45f0c2={};var _0x5f4b4e;var _0x46c8fe;return db[_0x3390('0x2e')][_0x3390('0x4e')]({'where':{'id':_0x1e9056['params']['id']}})[_0x3390('0x26')](handleEntityNotFound(_0x5a5d76,null))[_0x3390('0x26')](function(_0x3ecf57){if(_0x3ecf57){_0x5f4b4e=_0x3ecf57;_0x45f0c2['model']=_[_0x3390('0x45')](db[_0x3390('0x4c')]['rawAttributes']);_0x45f0c2[_0x3390('0x33')]=_[_0x3390('0x45')](_0x1e9056[_0x3390('0x33')]);_0x45f0c2[_0x3390('0x3d')]=_[_0x3390('0x34')](_0x45f0c2['model'],_0x45f0c2[_0x3390('0x33')]);_0xaa8444[_0x3390('0x36')]=_['intersection'](_0x45f0c2['model'],qs[_0x3390('0x37')](_0x1e9056['query'][_0x3390('0x37')]));_0xaa8444[_0x3390('0x36')]=_0xaa8444[_0x3390('0x36')][_0x3390('0x46')]?_0xaa8444['attributes']:_0x45f0c2[_0x3390('0x35')];_0xaa8444[_0x3390('0x3a')]=qs[_0x3390('0x3b')](_0x1e9056['query'][_0x3390('0x3b')]);_0xaa8444[_0x3390('0x3c')]=qs[_0x3390('0x3d')](_[_0x3390('0x3e')](_0x1e9056[_0x3390('0x33')],_0x45f0c2[_0x3390('0x3d')]));if(_0x1e9056[_0x3390('0x33')][_0x3390('0x3f')]){_0xaa8444['where']=_[_0x3390('0x40')](_0xaa8444['where'],{'$or':_[_0x3390('0x2d')](_0xaa8444['attributes'],function(_0x26a929){var _0x423c6b={};_0x423c6b[_0x26a929]={'$like':'%'+_0x1e9056[_0x3390('0x33')]['filter']+'%'};return _0x423c6b;})});}_0xaa8444=_[_0x3390('0x40')]({},_0xaa8444,_0x1e9056['options']);return _0x5f4b4e[_0x3390('0x4d')](_0xaa8444);}})[_0x3390('0x26')](function(_0x3a1222){if(_0x3a1222){_0x46c8fe=_0x3a1222[_0x3390('0x46')];if(!_0x1e9056[_0x3390('0x33')][_0x3390('0x38')](_0x3390('0x39'))){_0xaa8444['limit']=qs[_0x3390('0x1e')](_0x1e9056[_0x3390('0x33')][_0x3390('0x1e')]);_0xaa8444[_0x3390('0x1d')]=qs[_0x3390('0x1d')](_0x1e9056[_0x3390('0x33')][_0x3390('0x1d')]);}return _0x5f4b4e[_0x3390('0x4d')](_0xaa8444);}})['then'](function(_0x379fe5){if(_0x379fe5){return _0x379fe5?{'count':_0x46c8fe,'rows':_0x379fe5}:null;}})[_0x3390('0x26')](respondWithResult(_0x5a5d76,null))[_0x3390('0x42')](handleError(_0x5a5d76,null));};exports['getDescriptions']=function(_0x1a0b15,_0x369329,_0x86c9a4){var _0x7b5422={};var _0x2621ff={};var _0x54a345;var _0x32d6e8;return db[_0x3390('0x2e')][_0x3390('0x4e')]({'where':{'id':_0x1a0b15['params']['id']}})[_0x3390('0x26')](handleEntityNotFound(_0x369329,null))['then'](function(_0x5b1bca){if(_0x5b1bca){_0x54a345=_0x5b1bca;_0x2621ff[_0x3390('0x35')]=_[_0x3390('0x45')](db['DeskField'][_0x3390('0x2f')]);_0x2621ff['query']=_[_0x3390('0x45')](_0x1a0b15[_0x3390('0x33')]);_0x2621ff['filters']=_['intersection'](_0x2621ff[_0x3390('0x35')],_0x2621ff[_0x3390('0x33')]);_0x7b5422['attributes']=_[_0x3390('0x34')](_0x2621ff[_0x3390('0x35')],qs[_0x3390('0x37')](_0x1a0b15[_0x3390('0x33')][_0x3390('0x37')]));_0x7b5422[_0x3390('0x36')]=_0x7b5422['attributes'][_0x3390('0x46')]?_0x7b5422[_0x3390('0x36')]:_0x2621ff[_0x3390('0x35')];_0x7b5422[_0x3390('0x3a')]=qs[_0x3390('0x3b')](_0x1a0b15[_0x3390('0x33')]['sort']);_0x7b5422[_0x3390('0x3c')]=qs[_0x3390('0x3d')](_['pick'](_0x1a0b15[_0x3390('0x33')],_0x2621ff[_0x3390('0x3d')]));if(_0x1a0b15[_0x3390('0x33')][_0x3390('0x3f')]){_0x7b5422[_0x3390('0x3c')]=_[_0x3390('0x40')](_0x7b5422['where'],{'$or':_[_0x3390('0x2d')](_0x7b5422[_0x3390('0x36')],function(_0x2c3b6e){var _0x165555={};_0x165555[_0x2c3b6e]={'$like':'%'+_0x1a0b15[_0x3390('0x33')]['filter']+'%'};return _0x165555;})});}_0x7b5422=_['merge']({},_0x7b5422,_0x1a0b15['options']);return _0x54a345[_0x3390('0x4f')](_0x7b5422);}})[_0x3390('0x26')](function(_0x405c9f){if(_0x405c9f){_0x32d6e8=_0x405c9f[_0x3390('0x46')];if(!_0x1a0b15[_0x3390('0x33')][_0x3390('0x38')](_0x3390('0x39'))){_0x7b5422[_0x3390('0x1e')]=qs[_0x3390('0x1e')](_0x1a0b15['query']['limit']);_0x7b5422['offset']=qs[_0x3390('0x1d')](_0x1a0b15[_0x3390('0x33')][_0x3390('0x1d')]);}return _0x54a345[_0x3390('0x4f')](_0x7b5422);}})[_0x3390('0x26')](function(_0x2f37f1){if(_0x2f37f1){return _0x2f37f1?{'count':_0x32d6e8,'rows':_0x2f37f1}:null;}})[_0x3390('0x26')](respondWithResult(_0x369329,null))['catch'](handleError(_0x369329,null));};exports[_0x3390('0x50')]=function(_0x1c5e05,_0x509623,_0x41e484){var _0x2b1da7={};var _0x39abbd={};var _0xbe62f5;var _0x891968;return db[_0x3390('0x2e')][_0x3390('0x4e')]({'where':{'id':_0x1c5e05[_0x3390('0x44')]['id']}})[_0x3390('0x26')](handleEntityNotFound(_0x509623,null))['then'](function(_0x464e33){if(_0x464e33){_0xbe62f5=_0x464e33;_0x39abbd[_0x3390('0x35')]=_[_0x3390('0x45')](db['Tag'][_0x3390('0x2f')]);_0x39abbd[_0x3390('0x33')]=_[_0x3390('0x45')](_0x1c5e05['query']);_0x39abbd[_0x3390('0x3d')]=_[_0x3390('0x34')](_0x39abbd[_0x3390('0x35')],_0x39abbd[_0x3390('0x33')]);_0x2b1da7[_0x3390('0x36')]=_[_0x3390('0x34')](_0x39abbd['model'],qs['fields'](_0x1c5e05[_0x3390('0x33')][_0x3390('0x37')]));_0x2b1da7['attributes']=_0x2b1da7[_0x3390('0x36')]['length']?_0x2b1da7[_0x3390('0x36')]:_0x39abbd[_0x3390('0x35')];_0x2b1da7[_0x3390('0x3a')]=qs[_0x3390('0x3b')](_0x1c5e05[_0x3390('0x33')]['sort']);_0x2b1da7[_0x3390('0x3c')]=qs[_0x3390('0x3d')](_['pick'](_0x1c5e05[_0x3390('0x33')],_0x39abbd[_0x3390('0x3d')]));if(_0x1c5e05[_0x3390('0x33')][_0x3390('0x3f')]){_0x2b1da7['where']=_['merge'](_0x2b1da7[_0x3390('0x3c')],{'$or':_[_0x3390('0x2d')](_0x2b1da7[_0x3390('0x36')],function(_0x4887ca){var _0x8142ef={};_0x8142ef[_0x4887ca]={'$like':'%'+_0x1c5e05['query'][_0x3390('0x3f')]+'%'};return _0x8142ef;})});}_0x2b1da7=_[_0x3390('0x40')]({},_0x2b1da7,_0x1c5e05[_0x3390('0x47')]);return _0xbe62f5[_0x3390('0x50')](_0x2b1da7);}})[_0x3390('0x26')](function(_0x18e84b){if(_0x18e84b){_0x891968=_0x18e84b[_0x3390('0x46')];if(!_0x1c5e05[_0x3390('0x33')][_0x3390('0x38')](_0x3390('0x39'))){_0x2b1da7[_0x3390('0x1e')]=qs[_0x3390('0x1e')](_0x1c5e05[_0x3390('0x33')][_0x3390('0x1e')]);_0x2b1da7[_0x3390('0x1d')]=qs[_0x3390('0x1d')](_0x1c5e05[_0x3390('0x33')]['offset']);}return _0xbe62f5['getTags'](_0x2b1da7);}})[_0x3390('0x26')](function(_0x59710a){if(_0x59710a){return _0x59710a?{'count':_0x891968,'rows':_0x59710a}:null;}})[_0x3390('0x26')](respondWithResult(_0x509623,null))['catch'](handleError(_0x509623,null));};exports[_0x3390('0x51')]=function(_0x14813e,_0xae0dfb,_0x1064d1){if(_0x14813e['body']['id']){delete _0x14813e['body']['id'];}return db[_0x3390('0x2e')]['findOne']({'where':{'id':_0x14813e[_0x3390('0x44')]['id']}})[_0x3390('0x26')](handleEntityNotFound(_0xae0dfb,null))[_0x3390('0x26')](function(_0x3f2335){if(_0x3f2335){return _0x3f2335[_0x3390('0x51')](_0x14813e['body'][_0x3390('0x52')]||[]);}return null;})[_0x3390('0x26')](respondWithResult(_0xae0dfb,null))[_0x3390('0x42')](handleError(_0xae0dfb,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 514c0e7..f0524b0 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 _0x2deb=['../../config/environment','DeskConfiguration','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x2deb,0xf2));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require(_0xb2de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require('rimraf');var config=require(_0xb2de('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x206c6a,_0x4c98a8){return _0x206c6a['define'](_0xb2de('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9435=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x9435,0x93));var _0x5943=function(_0x1eed72,_0x124372){_0x1eed72=_0x1eed72-0x0;var _0x3f3e71=_0x9435[_0x1eed72];return _0x3f3e71;};'use strict';var _=require(_0x5943('0x0'));var util=require(_0x5943('0x1'));var logger=require(_0x5943('0x2'))(_0x5943('0x3'));var moment=require('moment');var BPromise=require(_0x5943('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5943('0x5'));var rimraf=require(_0x5943('0x6'));var config=require(_0x5943('0x7'));var attributes=require(_0x5943('0x8'));module[_0x5943('0x9')]=function(_0x42f32e,_0x114c6c){return _0x42f32e[_0x5943('0xa')](_0x5943('0xb'),attributes,{'tableName':_0x5943('0xc'),'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 12225a7..316e97d 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 _0x6efe=['error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0x6efe,0xc6));var _0xe6ef=function(_0x29f596,_0x313c20){_0x29f596=_0x29f596-0x0;var _0x1d57f1=_0x6efe[_0x29f596];return _0x1d57f1;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var moment=require(_0xe6ef('0x2'));var BPromise=require(_0xe6ef('0x3'));var rs=require(_0xe6ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6ef('0x5'));var logger=require(_0xe6ef('0x6'))(_0xe6ef('0x7'));var config=require(_0xe6ef('0x8'));var jayson=require(_0xe6ef('0x9'));var client=jayson['client'][_0xe6ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422e13,_0x599b6c,_0x4a4bb9){return new BPromise(function(_0x51a9eb,_0x3256ff){return client[_0xe6ef('0xb')](_0x422e13,_0x4a4bb9)[_0xe6ef('0xc')](function(_0x4fca2f){logger[_0xe6ef('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x599b6c,_0xe6ef('0xe'));logger[_0xe6ef('0xf')](_0xe6ef('0x10'),_0x599b6c,_0xe6ef('0xe'),JSON[_0xe6ef('0x11')](_0x4fca2f));if(_0x4fca2f[_0xe6ef('0x12')]){if(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x13')]===0x1f4){logger['error'](_0xe6ef('0x14'),_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x3256ff(_0x4fca2f[_0xe6ef('0x12')]['message']);}logger[_0xe6ef('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x51a9eb(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);}else{logger[_0xe6ef('0xd')](_0xe6ef('0x14'),_0x599b6c,_0xe6ef('0xe'));_0x51a9eb(_0x4fca2f[_0xe6ef('0x16')][_0xe6ef('0x15')]);}})[_0xe6ef('0x17')](function(_0x5c32cc){logger[_0xe6ef('0x12')](_0xe6ef('0x14'),_0x599b6c,_0x5c32cc);_0x3256ff(_0x5c32cc);});});} \ No newline at end of file +var _0x273b=['../../config/logger','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils'];(function(_0xdc1f53,_0x59f577){var _0x2d2ff7=function(_0x321108){while(--_0x321108){_0xdc1f53['push'](_0xdc1f53['shift']());}};_0x2d2ff7(++_0x59f577);}(_0x273b,0xb8));var _0xb273=function(_0x4db1f3,_0x35ff04){_0x4db1f3=_0x4db1f3-0x0;var _0x3fd42c=_0x273b[_0x4db1f3];return _0x3fd42c;};'use strict';var _=require('lodash');var util=require(_0xb273('0x0'));var moment=require(_0xb273('0x1'));var BPromise=require(_0xb273('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb273('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb273('0x4'));var logger=require(_0xb273('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb273('0x6'));var client=jayson[_0xb273('0x7')][_0xb273('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x77595c,_0x1e7c53,_0x449db9){return new BPromise(function(_0x2a981a,_0x817eaf){return client[_0xb273('0x9')](_0x77595c,_0x449db9)[_0xb273('0xa')](function(_0x3c3e19){logger[_0xb273('0xb')](_0xb273('0xc'),_0x1e7c53,_0xb273('0xd'));logger[_0xb273('0xe')](_0xb273('0xf'),_0x1e7c53,_0xb273('0xd'),JSON[_0xb273('0x10')](_0x3c3e19));if(_0x3c3e19[_0xb273('0x11')]){if(_0x3c3e19['error'][_0xb273('0x12')]===0x1f4){logger[_0xb273('0x11')](_0xb273('0xc'),_0x1e7c53,_0x3c3e19[_0xb273('0x11')][_0xb273('0x13')]);return _0x817eaf(_0x3c3e19[_0xb273('0x11')]['message']);}logger[_0xb273('0x11')](_0xb273('0xc'),_0x1e7c53,_0x3c3e19[_0xb273('0x11')][_0xb273('0x13')]);return _0x2a981a(_0x3c3e19['error'][_0xb273('0x13')]);}else{logger[_0xb273('0xb')](_0xb273('0xc'),_0x1e7c53,'request\x20sent');_0x2a981a(_0x3c3e19['result'][_0xb273('0x13')]);}})[_0xb273('0x14')](function(_0x36bc0f){logger[_0xb273('0x11')](_0xb273('0xc'),_0x1e7c53,_0x36bc0f);_0x817eaf(_0x36bc0f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4dd327a..bca2e03 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 _0x2250=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x49ea5a,_0x8d4343){var _0x4ec681=function(_0x23af98){while(--_0x23af98){_0x49ea5a['push'](_0x49ea5a['shift']());}};_0x4ec681(++_0x8d4343);}(_0x2250,0x178));var _0x0225=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0x2250[_0x20a137];return _0x3dc414;};'use strict';var multer=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var path=require(_0x0225('0x2'));var timeout=require(_0x0225('0x3'));var express=require(_0x0225('0x4'));var router=express[_0x0225('0x5')]();var fs_extra=require(_0x0225('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var controller=require(_0x0225('0x9'));router[_0x0225('0xa')]('/',auth[_0x0225('0xb')](),controller[_0x0225('0xc')]);router[_0x0225('0xa')](_0x0225('0xd'),auth['isAuthenticated'](),controller[_0x0225('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0225('0xf')]);router[_0x0225('0x10')](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x11')]);router['delete'](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x12')]);module[_0x0225('0x13')]=router; \ No newline at end of file +var _0x11f3=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post','create'];(function(_0x377c6d,_0x2ef964){var _0x2ba7fd=function(_0x1ce9fd){while(--_0x1ce9fd){_0x377c6d['push'](_0x377c6d['shift']());}};_0x2ba7fd(++_0x2ef964);}(_0x11f3,0x149));var _0x311f=function(_0x36b4b5,_0xbd97e4){_0x36b4b5=_0x36b4b5-0x0;var _0x4b5bdd=_0x11f3[_0x36b4b5];return _0x4b5bdd;};'use strict';var multer=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var path=require(_0x311f('0x2'));var timeout=require('connect-timeout');var express=require(_0x311f('0x3'));var router=express['Router']();var fs_extra=require(_0x311f('0x4'));var auth=require(_0x311f('0x5'));var interaction=require(_0x311f('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x311f('0x7')]('/',auth['isAuthenticated'](),controller[_0x311f('0x8')]);router[_0x311f('0x7')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller['show']);router[_0x311f('0xb')]('/',auth[_0x311f('0xa')](),controller[_0x311f('0xc')]);router[_0x311f('0xd')](_0x311f('0x9'),auth['isAuthenticated'](),controller[_0x311f('0xe')]);router[_0x311f('0xf')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller[_0x311f('0x10')]);module[_0x311f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e0ca5eb..0f911a8 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 _0xd26a=['exports','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd26a,0x11f));var _0xad26=function(_0x2efa2e,_0x1d6290){_0x2efa2e=_0x2efa2e-0x0;var _0x59de8f=_0xd26a[_0x2efa2e];return _0x59de8f;};'use strict';var Sequelize=require(_0xad26('0x0'));module[_0xad26('0x1')]={'type':{'type':Sequelize['ENUM'](_0xad26('0x2'),_0xad26('0x3'),_0xad26('0x4'),'keyValue',_0xad26('0x5')),'defaultValue':_0xad26('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xad26('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xad26('0x3'),_0xad26('0x4'))},'keyContent':{'type':Sequelize[_0xad26('0x6')]},'idField':{'type':Sequelize[_0xad26('0x6')]},'nameField':{'type':Sequelize[_0xad26('0x6')]},'customField':{'type':Sequelize[_0xad26('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaaa9=['variable','customVariable','keyValue','picklist','STRING','ENUM','string','BOOLEAN','sequelize','exports'];(function(_0x5d718c,_0x14527e){var _0x2a2706=function(_0x2efb1b){while(--_0x2efb1b){_0x5d718c['push'](_0x5d718c['shift']());}};_0x2a2706(++_0x14527e);}(_0xaaa9,0x6c));var _0x9aaa=function(_0x753b31,_0x3e495a){_0x753b31=_0x753b31-0x0;var _0x177190=_0xaaa9[_0x753b31];return _0x177190;};'use strict';var Sequelize=require(_0x9aaa('0x0'));module[_0x9aaa('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x9aaa('0x2'),_0x9aaa('0x3'),_0x9aaa('0x4'),_0x9aaa('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9aaa('0x6')]},'key':{'type':Sequelize[_0x9aaa('0x6')]},'keyType':{'type':Sequelize[_0x9aaa('0x7')](_0x9aaa('0x8'),_0x9aaa('0x2'),_0x9aaa('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9aaa('0x6')]},'nameField':{'type':Sequelize[_0x9aaa('0x6')]},'customField':{'type':Sequelize[_0x9aaa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 92c390b..4f0d95c 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 _0x0a1c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4b0cb1,_0x55b028){var _0x55e8aa=function(_0x43d764){while(--_0x43d764){_0x4b0cb1['push'](_0x4b0cb1['shift']());}};_0x55e8aa(++_0x55b028);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x0a1c[_0x18a436];return _0x5c2cf8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0a1('0x0'));var jsonpatch=require(_0xc0a1('0x1'));var rp=require(_0xc0a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0a1('0x3'));var util=require(_0xc0a1('0x4'));var path=require(_0xc0a1('0x5'));var sox=require(_0xc0a1('0x6'));var csv=require(_0xc0a1('0x7'));var ejs=require(_0xc0a1('0x8'));var fs=require('fs');var fs_extra=require(_0xc0a1('0x9'));var _=require(_0xc0a1('0xa'));var squel=require(_0xc0a1('0xb'));var crypto=require(_0xc0a1('0xc'));var jsforce=require(_0xc0a1('0xd'));var deskjs=require(_0xc0a1('0xe'));var toCsv=require(_0xc0a1('0x7'));var querystring=require(_0xc0a1('0xf'));var Papa=require(_0xc0a1('0x10'));var Redis=require(_0xc0a1('0x11'));var authService=require(_0xc0a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc0a1('0x13'));var hardwareService=require(_0xc0a1('0x14'));var logger=require(_0xc0a1('0x15'))('api');var utils=require(_0xc0a1('0x16'));var config=require(_0xc0a1('0x17'));var licenseUtil=require(_0xc0a1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1565f4,_0x138338){_0x138338=_0x138338||0xcc;return function(_0x4969b9){if(_0x4969b9){return _0x1565f4[_0xc0a1('0x19')](_0x138338);}return _0x1565f4[_0xc0a1('0x1a')](_0x138338)[_0xc0a1('0x1b')]();};}function respondWithResult(_0x395ade,_0x32c3b9){_0x32c3b9=_0x32c3b9||0xc8;return function(_0x517689){if(_0x517689){return _0x395ade['status'](_0x32c3b9)[_0xc0a1('0x1c')](_0x517689);}};}function respondWithFilteredResult(_0x3f5ce8,_0x49a97c){return function(_0x5a3e1d){if(_0x5a3e1d){var _0x8aa354=typeof _0x49a97c[_0xc0a1('0x1d')]==='undefined'&&typeof _0x49a97c[_0xc0a1('0x1e')]===_0xc0a1('0x1f');var _0x27ad22=_0x5a3e1d[_0xc0a1('0x20')];var _0x234067=_0x8aa354?0x0:_0x49a97c[_0xc0a1('0x1d')];var _0x36620e=_0x8aa354?_0x5a3e1d[_0xc0a1('0x20')]:_0x49a97c[_0xc0a1('0x1d')]+_0x49a97c[_0xc0a1('0x1e')];var _0x1e02aa;if(_0x36620e>=_0x27ad22){_0x36620e=_0x27ad22;_0x1e02aa=0xc8;}else{_0x1e02aa=0xce;}_0x3f5ce8[_0xc0a1('0x1a')](_0x1e02aa);return _0x3f5ce8[_0xc0a1('0x21')](_0xc0a1('0x22'),_0x234067+'-'+_0x36620e+'/'+_0x27ad22)[_0xc0a1('0x1c')](_0x5a3e1d);}return null;};}function patchUpdates(_0x3e8940){return function(_0x563987){try{jsonpatch[_0xc0a1('0x23')](_0x563987,_0x3e8940,!![]);}catch(_0x4f0f02){return BPromise[_0xc0a1('0x24')](_0x4f0f02);}return _0x563987[_0xc0a1('0x25')]();};}function saveUpdates(_0x19e24b,_0x316f1a){return function(_0x40eaa4){if(_0x40eaa4){return _0x40eaa4['update'](_0x19e24b)[_0xc0a1('0x26')](function(_0x1ae706){return _0x1ae706;});}return null;};}function removeEntity(_0x247179,_0x3e7997){return function(_0xb78441){if(_0xb78441){return _0xb78441[_0xc0a1('0x27')]()[_0xc0a1('0x26')](function(){_0x247179[_0xc0a1('0x1a')](0xcc)[_0xc0a1('0x1b')]();});}};}function handleEntityNotFound(_0x161bff,_0x5d9925){return function(_0x569816){if(!_0x569816){_0x161bff[_0xc0a1('0x19')](0x194);}return _0x569816;};}function handleError(_0xcd9b89,_0x5b5d13){_0x5b5d13=_0x5b5d13||0x1f4;return function(_0x52ba51){logger[_0xc0a1('0x28')](_0x52ba51[_0xc0a1('0x29')]);if(_0x52ba51['name']){delete _0x52ba51[_0xc0a1('0x2a')];}_0xcd9b89[_0xc0a1('0x1a')](_0x5b5d13)[_0xc0a1('0x2b')](_0x52ba51);};}exports[_0xc0a1('0x2c')]=function(_0x8f4588,_0x1814ac){var _0x114f76={},_0x2bc99f={},_0x4b4c93={'count':0x0,'rows':[]};var _0x26604b=_[_0xc0a1('0x2d')](db[_0xc0a1('0x2e')][_0xc0a1('0x2f')],function(_0x254c32){return{'name':_0x254c32[_0xc0a1('0x30')],'type':_0x254c32['type']['key']};});_0x2bc99f[_0xc0a1('0x31')]=_[_0xc0a1('0x2d')](_0x26604b,'name');_0x2bc99f[_0xc0a1('0x32')]=_['keys'](_0x8f4588[_0xc0a1('0x32')]);_0x2bc99f['filters']=_[_0xc0a1('0x33')](_0x2bc99f[_0xc0a1('0x31')],_0x2bc99f[_0xc0a1('0x32')]);_0x114f76['attributes']=_[_0xc0a1('0x33')](_0x2bc99f['model'],qs[_0xc0a1('0x34')](_0x8f4588[_0xc0a1('0x32')]['fields']));_0x114f76[_0xc0a1('0x35')]=_0x114f76[_0xc0a1('0x35')][_0xc0a1('0x36')]?_0x114f76[_0xc0a1('0x35')]:_0x2bc99f[_0xc0a1('0x31')];if(!_0x8f4588[_0xc0a1('0x32')]['hasOwnProperty'](_0xc0a1('0x37'))){_0x114f76[_0xc0a1('0x1e')]=qs[_0xc0a1('0x1e')](_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x1e')]);_0x114f76[_0xc0a1('0x1d')]=qs['offset'](_0x8f4588['query'][_0xc0a1('0x1d')]);}_0x114f76[_0xc0a1('0x38')]=qs[_0xc0a1('0x39')](_0x8f4588['query']['sort']);_0x114f76[_0xc0a1('0x3a')]=qs[_0xc0a1('0x3b')](_[_0xc0a1('0x3c')](_0x8f4588['query'],_0x2bc99f[_0xc0a1('0x3b')]),_0x26604b);if(_0x8f4588[_0xc0a1('0x32')]['filter']){_0x114f76[_0xc0a1('0x3a')]=_[_0xc0a1('0x3d')](_0x114f76['where'],{'$or':_[_0xc0a1('0x2d')](_0x26604b,function(_0x32f40b){if(_0x32f40b[_0xc0a1('0x3e')]!==_0xc0a1('0x3f')){var _0x442c1c={};_0x442c1c[_0x32f40b[_0xc0a1('0x2a')]]={'$like':'%'+_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x40')]+'%'};return _0x442c1c;}})});}_0x114f76=_['merge']({},_0x114f76,_0x8f4588['options']);var _0x300df9={'where':_0x114f76[_0xc0a1('0x3a')]};return db['DeskField'][_0xc0a1('0x20')](_0x300df9)[_0xc0a1('0x26')](function(_0x273b64){_0x4b4c93[_0xc0a1('0x20')]=_0x273b64;if(_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x41')]){_0x114f76['include']=[{'all':!![]}];}return db[_0xc0a1('0x2e')][_0xc0a1('0x42')](_0x114f76);})['then'](function(_0x289501){_0x4b4c93[_0xc0a1('0x43')]=_0x289501;return _0x4b4c93;})[_0xc0a1('0x26')](respondWithFilteredResult(_0x1814ac,_0x114f76))[_0xc0a1('0x44')](handleError(_0x1814ac,null));};exports[_0xc0a1('0x45')]=function(_0x1b58ec,_0x41d73d){var _0x4d9b35={'raw':!![],'where':{'id':_0x1b58ec[_0xc0a1('0x46')]['id']}},_0x542fb3={};_0x542fb3['model']=_[_0xc0a1('0x47')](db['DeskField']['rawAttributes']);_0x542fb3[_0xc0a1('0x32')]=_[_0xc0a1('0x47')](_0x1b58ec[_0xc0a1('0x32')]);_0x542fb3[_0xc0a1('0x3b')]=_[_0xc0a1('0x33')](_0x542fb3[_0xc0a1('0x31')],_0x542fb3[_0xc0a1('0x32')]);_0x4d9b35[_0xc0a1('0x35')]=_[_0xc0a1('0x33')](_0x542fb3[_0xc0a1('0x31')],qs[_0xc0a1('0x34')](_0x1b58ec[_0xc0a1('0x32')][_0xc0a1('0x34')]));_0x4d9b35[_0xc0a1('0x35')]=_0x4d9b35[_0xc0a1('0x35')][_0xc0a1('0x36')]?_0x4d9b35['attributes']:_0x542fb3[_0xc0a1('0x31')];if(_0x1b58ec[_0xc0a1('0x32')]['includeAll']){_0x4d9b35['include']=[{'all':!![]}];}_0x4d9b35=_[_0xc0a1('0x3d')]({},_0x4d9b35,_0x1b58ec['options']);return db[_0xc0a1('0x2e')][_0xc0a1('0x48')](_0x4d9b35)[_0xc0a1('0x26')](handleEntityNotFound(_0x41d73d,null))['then'](respondWithResult(_0x41d73d,null))[_0xc0a1('0x44')](handleError(_0x41d73d,null));};exports[_0xc0a1('0x49')]=function(_0x5b1244,_0x934f6d){return db[_0xc0a1('0x2e')]['create'](_0x5b1244['body'],{})[_0xc0a1('0x26')](respondWithResult(_0x934f6d,0xc9))[_0xc0a1('0x44')](handleError(_0x934f6d,null));};exports['update']=function(_0x437380,_0x216a82){if(_0x437380[_0xc0a1('0x4a')]['id']){delete _0x437380[_0xc0a1('0x4a')]['id'];}return db['DeskField']['find']({'where':{'id':_0x437380[_0xc0a1('0x46')]['id']}})['then'](handleEntityNotFound(_0x216a82,null))[_0xc0a1('0x26')](saveUpdates(_0x437380['body'],null))[_0xc0a1('0x26')](respondWithResult(_0x216a82,null))['catch'](handleError(_0x216a82,null));};exports[_0xc0a1('0x27')]=function(_0x280bbc,_0x5b5069){return db[_0xc0a1('0x2e')][_0xc0a1('0x48')]({'where':{'id':_0x280bbc[_0xc0a1('0x46')]['id']}})[_0xc0a1('0x26')](handleEntityNotFound(_0x5b5069,null))[_0xc0a1('0x26')](removeEntity(_0x5b5069,null))['catch'](handleError(_0x5b5069,null));}; \ No newline at end of file +var _0xef96=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','DeskField','findAll','rows','show','params','intersection','find','catch','create','body','update','eml-format'];(function(_0xcd6b98,_0x5b36f2){var _0x3d2796=function(_0x13c1ee){while(--_0x13c1ee){_0xcd6b98['push'](_0xcd6b98['shift']());}};_0x3d2796(++_0x5b36f2);}(_0xef96,0x162));var _0x6ef9=function(_0x21de94,_0x468ab9){_0x21de94=_0x21de94-0x0;var _0x580426=_0xef96[_0x21de94];return _0x580426;};'use strict';var emlformat=require(_0x6ef9('0x0'));var rimraf=require(_0x6ef9('0x1'));var zipdir=require(_0x6ef9('0x2'));var jsonpatch=require(_0x6ef9('0x3'));var rp=require(_0x6ef9('0x4'));var moment=require(_0x6ef9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ef9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6ef9('0x7'));var ejs=require(_0x6ef9('0x8'));var fs=require('fs');var fs_extra=require(_0x6ef9('0x9'));var _=require('lodash');var squel=require(_0x6ef9('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ef9('0xb'));var deskjs=require(_0x6ef9('0xc'));var toCsv=require(_0x6ef9('0x7'));var querystring=require('querystring');var Papa=require(_0x6ef9('0xd'));var Redis=require('ioredis');var authService=require(_0x6ef9('0xe'));var qs=require(_0x6ef9('0xf'));var as=require(_0x6ef9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef9('0x11'))(_0x6ef9('0x12'));var utils=require(_0x6ef9('0x13'));var config=require(_0x6ef9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ef9('0x15'))['db'];function respondWithStatusCode(_0x428156,_0x2e732f){_0x2e732f=_0x2e732f||0xcc;return function(_0x100591){if(_0x100591){return _0x428156[_0x6ef9('0x16')](_0x2e732f);}return _0x428156[_0x6ef9('0x17')](_0x2e732f)[_0x6ef9('0x18')]();};}function respondWithResult(_0x5e2fc1,_0x24681e){_0x24681e=_0x24681e||0xc8;return function(_0x2942bc){if(_0x2942bc){return _0x5e2fc1[_0x6ef9('0x17')](_0x24681e)[_0x6ef9('0x19')](_0x2942bc);}};}function respondWithFilteredResult(_0xce5672,_0x297af7){return function(_0x2c373c){if(_0x2c373c){var _0x253b13=typeof _0x297af7[_0x6ef9('0x1a')]==='undefined'&&typeof _0x297af7[_0x6ef9('0x1b')]===_0x6ef9('0x1c');var _0x4fac02=_0x2c373c['count'];var _0x1cb130=_0x253b13?0x0:_0x297af7['offset'];var _0x1855e1=_0x253b13?_0x2c373c[_0x6ef9('0x1d')]:_0x297af7[_0x6ef9('0x1a')]+_0x297af7[_0x6ef9('0x1b')];var _0x1d975c;if(_0x1855e1>=_0x4fac02){_0x1855e1=_0x4fac02;_0x1d975c=0xc8;}else{_0x1d975c=0xce;}_0xce5672[_0x6ef9('0x17')](_0x1d975c);return _0xce5672['set']('Content-Range',_0x1cb130+'-'+_0x1855e1+'/'+_0x4fac02)[_0x6ef9('0x19')](_0x2c373c);}return null;};}function patchUpdates(_0x243de4){return function(_0x587d43){try{jsonpatch[_0x6ef9('0x1e')](_0x587d43,_0x243de4,!![]);}catch(_0x3e74d2){return BPromise[_0x6ef9('0x1f')](_0x3e74d2);}return _0x587d43[_0x6ef9('0x20')]();};}function saveUpdates(_0x168cd5,_0x1ef6ee){return function(_0x404515){if(_0x404515){return _0x404515['update'](_0x168cd5)['then'](function(_0xae1b6e){return _0xae1b6e;});}return null;};}function removeEntity(_0x35bc5e,_0x4d664d){return function(_0x49faeb){if(_0x49faeb){return _0x49faeb[_0x6ef9('0x21')]()['then'](function(){_0x35bc5e[_0x6ef9('0x17')](0xcc)[_0x6ef9('0x18')]();});}};}function handleEntityNotFound(_0xdbc856,_0x383197){return function(_0x1bdb00){if(!_0x1bdb00){_0xdbc856[_0x6ef9('0x16')](0x194);}return _0x1bdb00;};}function handleError(_0x196ec0,_0x4f6c85){_0x4f6c85=_0x4f6c85||0x1f4;return function(_0x2e503b){logger['error'](_0x2e503b[_0x6ef9('0x22')]);if(_0x2e503b[_0x6ef9('0x23')]){delete _0x2e503b[_0x6ef9('0x23')];}_0x196ec0[_0x6ef9('0x17')](_0x4f6c85)[_0x6ef9('0x24')](_0x2e503b);};}exports[_0x6ef9('0x25')]=function(_0x212d32,_0x4eb696){var _0x57f6f9={},_0x569649={},_0x50750d={'count':0x0,'rows':[]};var _0x5e0a13=_[_0x6ef9('0x26')](db['DeskField'][_0x6ef9('0x27')],function(_0x5a8f0c){return{'name':_0x5a8f0c[_0x6ef9('0x28')],'type':_0x5a8f0c[_0x6ef9('0x29')][_0x6ef9('0x2a')]};});_0x569649[_0x6ef9('0x2b')]=_['map'](_0x5e0a13,_0x6ef9('0x23'));_0x569649[_0x6ef9('0x2c')]=_[_0x6ef9('0x2d')](_0x212d32['query']);_0x569649[_0x6ef9('0x2e')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],_0x569649[_0x6ef9('0x2c')]);_0x57f6f9[_0x6ef9('0x2f')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],qs[_0x6ef9('0x30')](_0x212d32['query'][_0x6ef9('0x30')]));_0x57f6f9[_0x6ef9('0x2f')]=_0x57f6f9[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x57f6f9[_0x6ef9('0x2f')]:_0x569649[_0x6ef9('0x2b')];if(!_0x212d32['query']['hasOwnProperty']('nolimit')){_0x57f6f9['limit']=qs[_0x6ef9('0x1b')](_0x212d32['query']['limit']);_0x57f6f9[_0x6ef9('0x1a')]=qs[_0x6ef9('0x1a')](_0x212d32['query'][_0x6ef9('0x1a')]);}_0x57f6f9['order']=qs['sort'](_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x32')]);_0x57f6f9['where']=qs[_0x6ef9('0x2e')](_[_0x6ef9('0x33')](_0x212d32[_0x6ef9('0x2c')],_0x569649['filters']),_0x5e0a13);if(_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]){_0x57f6f9[_0x6ef9('0x35')]=_[_0x6ef9('0x36')](_0x57f6f9['where'],{'$or':_[_0x6ef9('0x26')](_0x5e0a13,function(_0x2d6370){if(_0x2d6370['type']!==_0x6ef9('0x37')){var _0x305c34={};_0x305c34[_0x2d6370['name']]={'$like':'%'+_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]+'%'};return _0x305c34;}})});}_0x57f6f9=_[_0x6ef9('0x36')]({},_0x57f6f9,_0x212d32[_0x6ef9('0x38')]);var _0x43a62b={'where':_0x57f6f9[_0x6ef9('0x35')]};return db['DeskField'][_0x6ef9('0x1d')](_0x43a62b)[_0x6ef9('0x39')](function(_0x5e275a){_0x50750d[_0x6ef9('0x1d')]=_0x5e275a;if(_0x212d32['query'][_0x6ef9('0x3a')]){_0x57f6f9[_0x6ef9('0x3b')]=[{'all':!![]}];}return db[_0x6ef9('0x3c')][_0x6ef9('0x3d')](_0x57f6f9);})[_0x6ef9('0x39')](function(_0x4e6f10){_0x50750d[_0x6ef9('0x3e')]=_0x4e6f10;return _0x50750d;})[_0x6ef9('0x39')](respondWithFilteredResult(_0x4eb696,_0x57f6f9))['catch'](handleError(_0x4eb696,null));};exports[_0x6ef9('0x3f')]=function(_0x150cf8,_0x42382e){var _0x335fbf={'raw':!![],'where':{'id':_0x150cf8[_0x6ef9('0x40')]['id']}},_0x4fcd39={};_0x4fcd39[_0x6ef9('0x2b')]=_[_0x6ef9('0x2d')](db[_0x6ef9('0x3c')][_0x6ef9('0x27')]);_0x4fcd39['query']=_['keys'](_0x150cf8['query']);_0x4fcd39[_0x6ef9('0x2e')]=_[_0x6ef9('0x41')](_0x4fcd39['model'],_0x4fcd39[_0x6ef9('0x2c')]);_0x335fbf[_0x6ef9('0x2f')]=_['intersection'](_0x4fcd39[_0x6ef9('0x2b')],qs['fields'](_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x30')]));_0x335fbf[_0x6ef9('0x2f')]=_0x335fbf[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x335fbf['attributes']:_0x4fcd39[_0x6ef9('0x2b')];if(_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x3a')]){_0x335fbf[_0x6ef9('0x3b')]=[{'all':!![]}];}_0x335fbf=_[_0x6ef9('0x36')]({},_0x335fbf,_0x150cf8[_0x6ef9('0x38')]);return db['DeskField'][_0x6ef9('0x42')](_0x335fbf)[_0x6ef9('0x39')](handleEntityNotFound(_0x42382e,null))[_0x6ef9('0x39')](respondWithResult(_0x42382e,null))[_0x6ef9('0x43')](handleError(_0x42382e,null));};exports[_0x6ef9('0x44')]=function(_0xdf2b5b,_0x2d3d8e){return db['DeskField'][_0x6ef9('0x44')](_0xdf2b5b[_0x6ef9('0x45')],{})[_0x6ef9('0x39')](respondWithResult(_0x2d3d8e,0xc9))[_0x6ef9('0x43')](handleError(_0x2d3d8e,null));};exports[_0x6ef9('0x46')]=function(_0x397258,_0x22cd98){if(_0x397258[_0x6ef9('0x45')]['id']){delete _0x397258['body']['id'];}return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x397258['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x22cd98,null))['then'](saveUpdates(_0x397258[_0x6ef9('0x45')],null))[_0x6ef9('0x39')](respondWithResult(_0x22cd98,null))['catch'](handleError(_0x22cd98,null));};exports[_0x6ef9('0x21')]=function(_0x39f1a8,_0x17cac8){return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x39f1a8['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x17cac8,null))[_0x6ef9('0x39')](removeEntity(_0x17cac8,null))[_0x6ef9('0x43')](handleError(_0x17cac8,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 15e0a5b..05685fd 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 _0x2dae=['desk_unique_index','idField','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields'];(function(_0x4c7c4a,_0x520920){var _0x4d78ae=function(_0x3bcee0){while(--_0x3bcee0){_0x4c7c4a['push'](_0x4c7c4a['shift']());}};_0x4d78ae(++_0x520920);}(_0x2dae,0x188));var _0xe2da=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x2dae[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0xe2da('0x0'));var util=require(_0xe2da('0x1'));var logger=require('../../config/logger')(_0xe2da('0x2'));var moment=require('moment');var BPromise=require(_0xe2da('0x3'));var rp=require(_0xe2da('0x4'));var fs=require('fs');var path=require(_0xe2da('0x5'));var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module['exports']=function(_0xbb2ba5,_0x5b9dfb){return _0xbb2ba5['define'](_0xe2da('0x9'),attributes,{'tableName':_0xe2da('0xa'),'paranoid':![],'indexes':[{'name':_0xe2da('0xb'),'fields':[_0xe2da('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbc9=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','desk_unique_index','idField','lodash'];(function(_0x40f9e9,_0xa9ace5){var _0x2df11b=function(_0x177e2b){while(--_0x177e2b){_0x40f9e9['push'](_0x40f9e9['shift']());}};_0x2df11b(++_0xa9ace5);}(_0xbbc9,0x16b));var _0x9bbc=function(_0x31080a,_0x55b5cd){_0x31080a=_0x31080a-0x0;var _0x58d2fc=_0xbbc9[_0x31080a];return _0x58d2fc;};'use strict';var _=require(_0x9bbc('0x0'));var util=require(_0x9bbc('0x1'));var logger=require(_0x9bbc('0x2'))(_0x9bbc('0x3'));var moment=require(_0x9bbc('0x4'));var BPromise=require('bluebird');var rp=require(_0x9bbc('0x5'));var fs=require('fs');var path=require(_0x9bbc('0x6'));var rimraf=require(_0x9bbc('0x7'));var config=require(_0x9bbc('0x8'));var attributes=require(_0x9bbc('0x9'));module['exports']=function(_0x3483a0,_0x765f57){return _0x3483a0[_0x9bbc('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x9bbc('0xb'),'fields':[_0x9bbc('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 738db68..fd6d0e6 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 _0xa492=['then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x5b0425,_0x8eee6a){var _0x5aa62c=function(_0x20d9cb){while(--_0x20d9cb){_0x5b0425['push'](_0x5b0425['shift']());}};_0x5aa62c(++_0x8eee6a);}(_0xa492,0x15e));var _0x2a49=function(_0x3caee1,_0x333961){_0x3caee1=_0x3caee1-0x0;var _0x4fe393=_0xa492[_0x3caee1];return _0x4fe393;};'use strict';var _=require(_0x2a49('0x0'));var util=require(_0x2a49('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a49('0x2'));var fs=require('fs');var Redis=require(_0x2a49('0x3'));var db=require(_0x2a49('0x4'))['db'];var utils=require(_0x2a49('0x5'));var logger=require('../../config/logger')(_0x2a49('0x6'));var config=require('../../config/environment');var jayson=require(_0x2a49('0x7'));var client=jayson['client'][_0x2a49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f0eae,_0x37fc61,_0x352bc5){return new BPromise(function(_0x55a462,_0x555aa8){return client[_0x2a49('0x9')](_0x5f0eae,_0x352bc5)[_0x2a49('0xa')](function(_0x1a6e8f){logger[_0x2a49('0xb')](_0x2a49('0xc'),_0x37fc61,'request\x20sent');logger[_0x2a49('0xd')](_0x2a49('0xe'),_0x37fc61,_0x2a49('0xf'),JSON[_0x2a49('0x10')](_0x1a6e8f));if(_0x1a6e8f[_0x2a49('0x11')]){if(_0x1a6e8f['error']['code']===0x1f4){logger[_0x2a49('0x11')]('DeskField,\x20%s,\x20%s',_0x37fc61,_0x1a6e8f[_0x2a49('0x11')][_0x2a49('0x12')]);return _0x555aa8(_0x1a6e8f['error'][_0x2a49('0x12')]);}logger[_0x2a49('0x11')](_0x2a49('0xc'),_0x37fc61,_0x1a6e8f[_0x2a49('0x11')][_0x2a49('0x12')]);return _0x55a462(_0x1a6e8f[_0x2a49('0x11')][_0x2a49('0x12')]);}else{logger[_0x2a49('0xb')](_0x2a49('0xc'),_0x37fc61,_0x2a49('0xf'));_0x55a462(_0x1a6e8f['result'][_0x2a49('0x12')]);}})[_0x2a49('0x13')](function(_0x3b8736){logger['error'](_0x2a49('0xc'),_0x37fc61,_0x3b8736);_0x555aa8(_0x3b8736);});});} \ No newline at end of file +var _0x2f5b=['../../config/logger','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5dae57,_0x568c15){var _0x31aaa4=function(_0x197223){while(--_0x197223){_0x5dae57['push'](_0x5dae57['shift']());}};_0x31aaa4(++_0x568c15);}(_0x2f5b,0x1dc));var _0xb2f5=function(_0x341d9d,_0x2dfe73){_0x341d9d=_0x341d9d-0x0;var _0x1845c3=_0x2f5b[_0x341d9d];return _0x1845c3;};'use strict';var _=require(_0xb2f5('0x0'));var util=require(_0xb2f5('0x1'));var moment=require(_0xb2f5('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2f5('0x3'));var fs=require('fs');var Redis=require(_0xb2f5('0x4'));var db=require(_0xb2f5('0x5'))['db'];var utils=require(_0xb2f5('0x6'));var logger=require(_0xb2f5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb2f5('0x8'));var client=jayson[_0xb2f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22d26d,_0x18cb42,_0x4f1aac){return new BPromise(function(_0x14eef7,_0x266ebb){return client[_0xb2f5('0xa')](_0x22d26d,_0x4f1aac)[_0xb2f5('0xb')](function(_0x23b2d8){logger[_0xb2f5('0xc')](_0xb2f5('0xd'),_0x18cb42,_0xb2f5('0xe'));logger[_0xb2f5('0xf')](_0xb2f5('0x10'),_0x18cb42,'request\x20sent',JSON[_0xb2f5('0x11')](_0x23b2d8));if(_0x23b2d8[_0xb2f5('0x12')]){if(_0x23b2d8[_0xb2f5('0x12')][_0xb2f5('0x13')]===0x1f4){logger[_0xb2f5('0x12')](_0xb2f5('0xd'),_0x18cb42,_0x23b2d8[_0xb2f5('0x12')][_0xb2f5('0x14')]);return _0x266ebb(_0x23b2d8[_0xb2f5('0x12')][_0xb2f5('0x14')]);}logger[_0xb2f5('0x12')](_0xb2f5('0xd'),_0x18cb42,_0x23b2d8['error']['message']);return _0x14eef7(_0x23b2d8[_0xb2f5('0x12')][_0xb2f5('0x14')]);}else{logger['info'](_0xb2f5('0xd'),_0x18cb42,_0xb2f5('0xe'));_0x14eef7(_0x23b2d8['result']['message']);}})['catch'](function(_0x139157){logger[_0xb2f5('0x12')]('DeskField,\x20%s,\x20%s',_0x18cb42,_0x139157);_0x266ebb(_0x139157);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d2a4616..e79fb83 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 _0xb471=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fcedb,_0x3a7c33){var _0x4309cd=function(_0x7460e1){while(--_0x7460e1){_0x4fcedb['push'](_0x4fcedb['shift']());}};_0x4309cd(++_0x3a7c33);}(_0xb471,0xf6));var _0x1b47=function(_0x338867,_0x2d49b1){_0x338867=_0x338867-0x0;var _0x4635aa=_0xb471[_0x338867];return _0x4635aa;};'use strict';var multer=require(_0x1b47('0x0'));var util=require('util');var path=require(_0x1b47('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b47('0x2'));var router=express[_0x1b47('0x3')]();var fs_extra=require(_0x1b47('0x4'));var auth=require(_0x1b47('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x1b47('0x6')]('/',auth[_0x1b47('0x7')](),controller[_0x1b47('0x8')]);router['get']('/:id',auth[_0x1b47('0x7')](),controller[_0x1b47('0x9')]);router[_0x1b47('0x6')](_0x1b47('0xa'),auth[_0x1b47('0x7')](),controller[_0x1b47('0xb')]);router[_0x1b47('0x6')](_0x1b47('0xc'),auth[_0x1b47('0x7')](),controller['getFields']);router[_0x1b47('0xd')]('/',auth['isAuthenticated'](),controller[_0x1b47('0xe')]);router['post']('/:id/configurations',auth[_0x1b47('0x7')](),controller[_0x1b47('0xf')]);router[_0x1b47('0x10')](_0x1b47('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1b47('0x12')](_0x1b47('0x11'),auth[_0x1b47('0x7')](),controller[_0x1b47('0x13')]);module[_0x1b47('0x14')]=router; \ No newline at end of file +var _0x4971=['show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x261284,_0x19ce2c){var _0x3940f1=function(_0x2858d1){while(--_0x2858d1){_0x261284['push'](_0x261284['shift']());}};_0x3940f1(++_0x19ce2c);}(_0x4971,0x16e));var _0x1497=function(_0x36d5d5,_0x1c1590){_0x36d5d5=_0x36d5d5-0x0;var _0x4eaa56=_0x4971[_0x36d5d5];return _0x4eaa56;};'use strict';var multer=require('multer');var util=require(_0x1497('0x0'));var path=require(_0x1497('0x1'));var timeout=require(_0x1497('0x2'));var express=require(_0x1497('0x3'));var router=express[_0x1497('0x4')]();var fs_extra=require(_0x1497('0x5'));var auth=require(_0x1497('0x6'));var interaction=require(_0x1497('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x1497('0x8')]('/',auth[_0x1497('0x9')](),controller[_0x1497('0xa')]);router[_0x1497('0x8')](_0x1497('0xb'),auth[_0x1497('0x9')](),controller[_0x1497('0xc')]);router['get'](_0x1497('0xd'),auth[_0x1497('0x9')](),controller[_0x1497('0xe')]);router[_0x1497('0x8')]('/:id/fields',auth[_0x1497('0x9')](),controller[_0x1497('0xf')]);router[_0x1497('0x10')]('/',auth[_0x1497('0x9')](),controller[_0x1497('0x11')]);router[_0x1497('0x10')]('/:id/configurations',auth[_0x1497('0x9')](),controller['addConfiguration']);router[_0x1497('0x12')](_0x1497('0xb'),auth['isAuthenticated'](),controller[_0x1497('0x13')]);router[_0x1497('0x14')](_0x1497('0xb'),auth[_0x1497('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 5d76417..ff1e413 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 _0x7e3a=['exports','STRING','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7e3a,0x1e5));var _0xa7e3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7e3a[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xa7e3('0x0'));module[_0xa7e3('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa7e3('0x2')]},'password':{'type':Sequelize[_0xa7e3('0x2')]},'remoteUri':{'type':Sequelize[_0xa7e3('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa7e3('0x2')]},'clientSecret':{'type':Sequelize[_0xa7e3('0x2')]},'serverUrl':{'type':Sequelize[_0xa7e3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa7e3('0x2')]}}; \ No newline at end of file +var _0x7f5f=['STRING','sequelize','exports'];(function(_0x23f91a,_0x1d39fb){var _0x543cd4=function(_0x224853){while(--_0x224853){_0x23f91a['push'](_0x23f91a['shift']());}};_0x543cd4(++_0x1d39fb);}(_0x7f5f,0xc1));var _0xf7f5=function(_0x220131,_0x48de07){_0x220131=_0x220131-0x0;var _0x1744dd=_0x7f5f[_0x220131];return _0x1744dd;};'use strict';var Sequelize=require(_0xf7f5('0x0'));module[_0xf7f5('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf7f5('0x2')]},'password':{'type':Sequelize[_0xf7f5('0x2')]},'remoteUri':{'type':Sequelize[_0xf7f5('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xf7f5('0x2')]},'clientSecret':{'type':Sequelize[_0xf7f5('0x2')]},'serverUrl':{'type':Sequelize[_0xf7f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf7f5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index fc2c7c1..803db49 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 _0x425d=['subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','error','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','catch','show','include','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname'];(function(_0x3558fa,_0x445d50){var _0x164408=function(_0x477423){while(--_0x477423){_0x3558fa['push'](_0x3558fa['shift']());}};_0x164408(++_0x445d50);}(_0x425d,0x1e0));var _0xd425=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0x425d[_0x59ee41];return _0x3ecd3e;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var integrations=require(_0xd425('0x1d'));function respondWithStatusCode(_0x3cacf7,_0x3b5de8){_0x3b5de8=_0x3b5de8||0xcc;return function(_0x18eafb){if(_0x18eafb){return _0x3cacf7['sendStatus'](_0x3b5de8);}return _0x3cacf7[_0xd425('0x1e')](_0x3b5de8)[_0xd425('0x1f')]();};}function respondWithResult(_0x336dc3,_0x5d3d60){_0x5d3d60=_0x5d3d60||0xc8;return function(_0x309263){if(_0x309263){return _0x336dc3[_0xd425('0x1e')](_0x5d3d60)[_0xd425('0x20')](_0x309263);}};}function respondWithFilteredResult(_0x41f34d,_0x1fc822){return function(_0x538a0a){if(_0x538a0a){var _0x278626=typeof _0x1fc822[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x1fc822[_0xd425('0x23')]==='undefined';var _0x19d7d4=_0x538a0a[_0xd425('0x24')];var _0x467a6c=_0x278626?0x0:_0x1fc822[_0xd425('0x21')];var _0x4e88fa=_0x278626?_0x538a0a['count']:_0x1fc822['offset']+_0x1fc822['limit'];var _0x427304;if(_0x4e88fa>=_0x19d7d4){_0x4e88fa=_0x19d7d4;_0x427304=0xc8;}else{_0x427304=0xce;}_0x41f34d[_0xd425('0x1e')](_0x427304);return _0x41f34d[_0xd425('0x25')]('Content-Range',_0x467a6c+'-'+_0x4e88fa+'/'+_0x19d7d4)[_0xd425('0x20')](_0x538a0a);}return null;};}function patchUpdates(_0x7e982e){return function(_0x5f1e7e){try{jsonpatch[_0xd425('0x26')](_0x5f1e7e,_0x7e982e,!![]);}catch(_0xf2d0ce){return BPromise[_0xd425('0x27')](_0xf2d0ce);}return _0x5f1e7e[_0xd425('0x28')]();};}function saveUpdates(_0x3e93db,_0xb240c4){return function(_0x2480a0){if(_0x2480a0){return _0x2480a0[_0xd425('0x29')](_0x3e93db)[_0xd425('0x2a')](function(_0x2b030b){return _0x2b030b;});}return null;};}function removeEntity(_0x151ad9,_0x40e84b){return function(_0x47f44a){if(_0x47f44a){return _0x47f44a[_0xd425('0x2b')]()[_0xd425('0x2a')](function(){_0x151ad9[_0xd425('0x1e')](0xcc)[_0xd425('0x1f')]();});}};}function handleEntityNotFound(_0x2afcdb,_0x400dd7){return function(_0x3c3402){if(!_0x3c3402){_0x2afcdb['sendStatus'](0x194);}return _0x3c3402;};}function handleError(_0x12f951,_0x177de2){_0x177de2=_0x177de2||0x1f4;return function(_0x1d8861){logger['error'](_0x1d8861[_0xd425('0x2c')]);if(_0x1d8861[_0xd425('0x2d')]){delete _0x1d8861[_0xd425('0x2d')];}_0x12f951[_0xd425('0x1e')](_0x177de2)[_0xd425('0x2e')](_0x1d8861);};}exports[_0xd425('0x2f')]=function(_0x2fd17a,_0x37b63c){var _0x24da23={},_0x1cac61={},_0x482ba6={'count':0x0,'rows':[]};var _0x471e3e=_[_0xd425('0x30')](db[_0xd425('0x31')][_0xd425('0x32')],function(_0x3275b1){return{'name':_0x3275b1[_0xd425('0x33')],'type':_0x3275b1[_0xd425('0x34')][_0xd425('0x35')]};});_0x1cac61[_0xd425('0x36')]=_[_0xd425('0x30')](_0x471e3e,_0xd425('0x2d'));_0x1cac61['query']=_[_0xd425('0x37')](_0x2fd17a[_0xd425('0x38')]);_0x1cac61[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x1cac61[_0xd425('0x36')],_0x1cac61['query']);_0x24da23[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x1cac61['model'],qs['fields'](_0x2fd17a['query'][_0xd425('0x3c')]));_0x24da23[_0xd425('0x3b')]=_0x24da23[_0xd425('0x3b')][_0xd425('0x3d')]?_0x24da23['attributes']:_0x1cac61[_0xd425('0x36')];if(!_0x2fd17a[_0xd425('0x38')][_0xd425('0x3e')](_0xd425('0x3f'))){_0x24da23[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x2fd17a[_0xd425('0x38')]['limit']);_0x24da23[_0xd425('0x21')]=qs['offset'](_0x2fd17a[_0xd425('0x38')][_0xd425('0x21')]);}_0x24da23[_0xd425('0x40')]=qs['sort'](_0x2fd17a[_0xd425('0x38')][_0xd425('0x41')]);_0x24da23[_0xd425('0x42')]=qs[_0xd425('0x39')](_['pick'](_0x2fd17a[_0xd425('0x38')],_0x1cac61[_0xd425('0x39')]),_0x471e3e);if(_0x2fd17a['query']['filter']){_0x24da23['where']=_[_0xd425('0x43')](_0x24da23[_0xd425('0x42')],{'$or':_[_0xd425('0x30')](_0x471e3e,function(_0x588688){if(_0x588688['type']!=='VIRTUAL'){var _0x2fcfb9={};_0x2fcfb9[_0x588688[_0xd425('0x2d')]]={'$like':'%'+_0x2fd17a[_0xd425('0x38')][_0xd425('0x44')]+'%'};return _0x2fcfb9;}})});}_0x24da23=_[_0xd425('0x43')]({},_0x24da23,_0x2fd17a[_0xd425('0x45')]);var _0xeda414={'where':_0x24da23['where']};return db[_0xd425('0x31')][_0xd425('0x24')](_0xeda414)[_0xd425('0x2a')](function(_0x552fd0){_0x482ba6[_0xd425('0x24')]=_0x552fd0;if(_0x2fd17a[_0xd425('0x38')][_0xd425('0x46')]){_0x24da23['include']=[{'all':!![]}];}return db[_0xd425('0x31')][_0xd425('0x47')](_0x24da23);})[_0xd425('0x2a')](function(_0x2d7a2f){_0x482ba6['rows']=_0x2d7a2f;return _0x482ba6;})[_0xd425('0x2a')](respondWithFilteredResult(_0x37b63c,_0x24da23))[_0xd425('0x48')](handleError(_0x37b63c,null));};exports[_0xd425('0x49')]=function(_0x41b25e,_0x3f24fb){var _0x2f6bf7={'raw':![],'where':{'id':_0x41b25e['params']['id']}},_0x2d799b={};_0x2d799b[_0xd425('0x36')]=_[_0xd425('0x37')](db['Dynamics365Account'][_0xd425('0x32')]);_0x2d799b['query']=_['keys'](_0x41b25e[_0xd425('0x38')]);_0x2d799b['filters']=_[_0xd425('0x3a')](_0x2d799b['model'],_0x2d799b[_0xd425('0x38')]);_0x2f6bf7[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x2d799b[_0xd425('0x36')],qs[_0xd425('0x3c')](_0x41b25e['query'][_0xd425('0x3c')]));_0x2f6bf7['attributes']=_0x2f6bf7[_0xd425('0x3b')]['length']?_0x2f6bf7[_0xd425('0x3b')]:_0x2d799b[_0xd425('0x36')];if(_0x41b25e[_0xd425('0x38')][_0xd425('0x46')]){_0x2f6bf7[_0xd425('0x4a')]=[{'all':!![]}];}_0x2f6bf7=_['merge']({},_0x2f6bf7,_0x41b25e[_0xd425('0x45')]);return db[_0xd425('0x31')][_0xd425('0x4b')](_0x2f6bf7)[_0xd425('0x2a')](handleEntityNotFound(_0x3f24fb,null))[_0xd425('0x2a')](respondWithResult(_0x3f24fb,null))['catch'](handleError(_0x3f24fb,null));};exports[_0xd425('0x4c')]=function(_0x177704,_0x1450f2){return db[_0xd425('0x31')][_0xd425('0x4c')](_0x177704[_0xd425('0x4d')],{})['then'](respondWithResult(_0x1450f2,0xc9))[_0xd425('0x48')](handleError(_0x1450f2,null));};exports[_0xd425('0x29')]=function(_0x5bfac6,_0x3f305){if(_0x5bfac6[_0xd425('0x4d')]['id']){delete _0x5bfac6[_0xd425('0x4d')]['id'];}return db[_0xd425('0x31')]['find']({'where':{'id':_0x5bfac6[_0xd425('0x4e')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x3f305,null))[_0xd425('0x2a')](saveUpdates(_0x5bfac6[_0xd425('0x4d')],null))[_0xd425('0x2a')](respondWithResult(_0x3f305,null))['catch'](handleError(_0x3f305,null));};exports['destroy']=function(_0x381bdb,_0x5496d8){return db[_0xd425('0x31')][_0xd425('0x4b')]({'where':{'id':_0x381bdb['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5496d8,null))['then'](removeEntity(_0x5496d8,null))['catch'](handleError(_0x5496d8,null));};exports[_0xd425('0x4f')]=function(_0x111905,_0xe6451f,_0x1bcd39){var _0x3981e6={};var _0x1eb482={};var _0xeb3586;var _0x4118fe;return db['Dynamics365Account'][_0xd425('0x50')]({'where':{'id':_0x111905[_0xd425('0x4e')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0xe6451f,null))[_0xd425('0x2a')](function(_0x7b1080){if(_0x7b1080){_0xeb3586=_0x7b1080;_0x1eb482[_0xd425('0x36')]=_[_0xd425('0x37')](db[_0xd425('0x51')]['rawAttributes']);_0x1eb482['query']=_['keys'](_0x111905[_0xd425('0x38')]);_0x1eb482[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x1eb482[_0xd425('0x36')],_0x1eb482['query']);_0x3981e6['attributes']=_['intersection'](_0x1eb482['model'],qs[_0xd425('0x3c')](_0x111905[_0xd425('0x38')]['fields']));_0x3981e6[_0xd425('0x3b')]=_0x3981e6[_0xd425('0x3b')][_0xd425('0x3d')]?_0x3981e6['attributes']:_0x1eb482['model'];_0x3981e6[_0xd425('0x40')]=qs['sort'](_0x111905['query']['sort']);_0x3981e6[_0xd425('0x42')]=qs[_0xd425('0x39')](_[_0xd425('0x52')](_0x111905['query'],_0x1eb482[_0xd425('0x39')]));if(_0x111905['query'][_0xd425('0x44')]){_0x3981e6[_0xd425('0x42')]=_[_0xd425('0x43')](_0x3981e6[_0xd425('0x42')],{'$or':_[_0xd425('0x30')](_0x3981e6[_0xd425('0x3b')],function(_0xa21f7c){var _0x3ca6a6={};_0x3ca6a6[_0xa21f7c]={'$like':'%'+_0x111905[_0xd425('0x38')]['filter']+'%'};return _0x3ca6a6;})});}_0x3981e6=_[_0xd425('0x43')]({},_0x3981e6,_0x111905[_0xd425('0x45')]);return _0xeb3586[_0xd425('0x4f')](_0x3981e6);}})[_0xd425('0x2a')](function(_0x5c4df8){if(_0x5c4df8){_0x4118fe=_0x5c4df8['length'];if(!_0x111905[_0xd425('0x38')][_0xd425('0x3e')](_0xd425('0x3f'))){_0x3981e6[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x111905[_0xd425('0x38')][_0xd425('0x23')]);_0x3981e6[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x111905[_0xd425('0x38')][_0xd425('0x21')]);}return _0xeb3586[_0xd425('0x4f')](_0x3981e6);}})[_0xd425('0x2a')](function(_0x28979e){if(_0x28979e){return _0x28979e?{'count':_0x4118fe,'rows':_0x28979e}:null;}})['then'](respondWithResult(_0xe6451f,null))[_0xd425('0x48')](handleError(_0xe6451f,null));};exports[_0xd425('0x53')]=function(_0xd2f2e8,_0x4fd793,_0x5aff3c){if(_0xd2f2e8['body']['id']){delete _0xd2f2e8[_0xd425('0x4d')]['id'];}return db[_0xd425('0x31')][_0xd425('0x50')]({'where':{'id':_0xd2f2e8['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x4fd793,null))['then'](function(_0x2811a4){if(_0x2811a4){_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x54')]=_0x2811a4['id'];_0xd2f2e8['body'][_0xd425('0x55')]=integrations[_0xd425('0x56')](_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x57')],_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x34')]);_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x58')]=integrations[_0xd425('0x59')](_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x57')],_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x34')]);return db[_0xd425('0x51')][_0xd425('0x4c')](_0xd2f2e8[_0xd425('0x4d')],{'include':[{'model':db[_0xd425('0x5a')],'as':_0xd425('0x55')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xd425('0x2a')](respondWithResult(_0x4fd793,null))['catch'](handleError(_0x4fd793,null));};exports[_0xd425('0x5b')]=function(_0x1e1a3f,_0xb407bb,_0x1ae1e3){var _0x4c7000=_0x1e1a3f[_0xd425('0x38')][_0xd425('0x5c')];var _0x50b81c=_0x4c7000===_0xd425('0x5d')?_0xd425('0x5e'):_0xd425('0x5f');var _0x4c9d96='';var _0x4c8d7f='';var _0x3ccffe='';var _0x5b1104='';var _0x5e76f5='';var _0x174081='';var _0x4a9215='';var _0x20f6ec='';var _0x46fd93=[_0xd425('0x60'),_0xd425('0x61'),_0xd425('0x62'),_0xd425('0x63'),_0xd425('0x64'),'subject',_0xd425('0x65'),_0xd425('0x66'),_0xd425('0x67'),_0xd425('0x68')];var _0xfcba08=['accountidname',_0xd425('0x69'),_0xd425('0x6a'),'billedserviceunits',_0xd425('0x6b'),_0xd425('0x6c'),'contractdetailidname',_0xd425('0x6d'),_0xd425('0x6e'),_0xd425('0x6f'),_0xd425('0x70'),_0xd425('0x71'),'createdon',_0xd425('0x72'),'createdonbehalfbyyominame',_0xd425('0x73'),_0xd425('0x74'),'customeridyominame',_0xd425('0x75'),_0xd425('0x76'),_0xd425('0x77'),_0xd425('0x78'),'escalatedon','exchangerate',_0xd425('0x79'),_0xd425('0x7a'),_0xd425('0x7b'),'influencescore',_0xd425('0x7c'),_0xd425('0x7d'),'masteridname',_0xd425('0x7e'),'modifiedbyexternalpartyyominame',_0xd425('0x7f'),_0xd425('0x80'),_0xd425('0x81'),_0xd425('0x82'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xd425('0x83'),_0xd425('0x84'),'onholdtime',_0xd425('0x85'),_0xd425('0x86'),'owneridtype',_0xd425('0x87'),_0xd425('0x88'),_0xd425('0x89'),_0xd425('0x8a'),_0xd425('0x8b'),_0xd425('0x8c'),_0xd425('0x8d'),'resolveby','resolvebykpiidname',_0xd425('0x8e'),'responsiblecontactidname',_0xd425('0x8f'),_0xd425('0x90'),'slainvokedidname',_0xd425('0x91'),_0xd425('0x92'),'statecode','statuscode',_0xd425('0x93'),_0xd425('0x94'),_0xd425('0x95'),_0xd425('0x96'),_0xd425('0x97'),_0xd425('0x98'),_0xd425('0x99')];var _0x4425a5=_0x46fd93['concat'](_0xfcba08);return db[_0xd425('0x31')][_0xd425('0x50')]({'where':{'id':_0x1e1a3f['params']['id']},'attributes':['id',_0xd425('0x9a'),_0xd425('0x9b'),_0xd425('0x9c'),_0xd425('0x9d'),_0xd425('0x9e'),_0xd425('0x9f')]})[_0xd425('0x2a')](handleEntityNotFound(_0xb407bb,null))[_0xd425('0x2a')](function(_0x334062){if(_0x334062){_0x20f6ec=_0x334062[_0xd425('0x9c')];var _0x14cebc=_0x20f6ec['slice'](-0x1);if(_0x14cebc==='/'){_0x20f6ec=_0x20f6ec[_0xd425('0xa0')](0x0,_0x20f6ec['lastIndexOf'](_0x14cebc));}_0x4a9215=util['format'](_0xd425('0xa1'),_0x20f6ec);var _0x533bf1={'method':_0xd425('0xa2'),'uri':_0xd425('0xa3')+_0x334062[_0xd425('0x9d')]+_0xd425('0xa4'),'form':{'client_id':_0x334062[_0xd425('0x9e')],'resource':_0x20f6ec,'username':_0x334062[_0xd425('0x9a')],'password':_0x334062[_0xd425('0x9b')],'grant_type':'password','client_secret':_0x334062[_0xd425('0x9f')]},'json':!![]};return rp(_0x533bf1);}})[_0xd425('0x2a')](function(_0x2ef6dc){_0x174081=_0x2ef6dc[_0xd425('0xa5')];var _0x3c40bd={'method':'GET','uri':encodeURI(_0x4a9215+_0xd425('0xa6')+_0x50b81c+'\x27'),'headers':{'Authorization':_0xd425('0xa7')+_0x174081,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0x3c40bd);})[_0xd425('0x2a')](function(_0x1a5f86){var _0x35d401=_0x1a5f86[_0xd425('0xa9')][0x0];var _0x4147eb=_0x35d401[_0xd425('0xaa')];var _0x334226={'method':_0xd425('0xab'),'uri':_0x4a9215+_0xd425('0xac')+_0x4147eb+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd425('0xa7')+_0x174081,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x334226);})[_0xd425('0x2a')](function(_0x18576e){_0x4c9d96=_0x18576e;_0x4c8d7f=_0x4c9d96[_0xd425('0xad')];_0x4c8d7f=_[_0xd425('0xae')](_0x4c8d7f,function(_0xf06395){return!_0x4425a5['includes'](_0xf06395[_0xd425('0xaf')]);});var _0x23fce6=[];var _0x28d433=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x1ea134){if(_0x1ea134[_0xd425('0xb1')]){var _0x5451a1=_0x1ea134['@odata.type'][_0xd425('0xa0')](_0x1ea134['@odata.type'][_0xd425('0xb2')]('.')+0x1);if(_0x5451a1===_0xd425('0xb3')){_0x23fce6['push'](getSelectList(_0x4a9215,_0x4c7000,_0x28d433,_0x4c9d96[_0xd425('0xaa')],_0x1ea134[_0xd425('0xaa')],_0x174081));}}});return Promise['all'](_0x23fce6);})[_0xd425('0x2a')](function(_0x8c2e48){_0x3ccffe=_0x8c2e48[0x0];var _0xca2955=[];var _0x2dcf7b=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x218f79){if(!_['isNil'](_0x218f79[_0xd425('0xb1')])){var _0x52d700=_0x218f79[_0xd425('0xb1')]['substring'](_0x218f79[_0xd425('0xb1')][_0xd425('0xb2')]('.')+0x1);if(_0x52d700===_0xd425('0xb4')){_0xca2955[_0xd425('0xb5')](getBooleanList(_0x4a9215,_0x4c7000,_0x2dcf7b,_0x4c9d96['MetadataId'],_0x218f79['MetadataId'],_0x174081));}}});return Promise['all'](_0xca2955);})['then'](function(_0x2bbad4){_0x5b1104=_0x2bbad4[0x0];var _0x54649c=[];var _0x48b98c=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x3ed4c2){if(_0x3ed4c2[_0xd425('0xb1')]){var _0x284f4b=_0x3ed4c2[_0xd425('0xb1')]['substring'](_0x3ed4c2[_0xd425('0xb1')][_0xd425('0xb2')]('.')+0x1);if(_0x284f4b===_0xd425('0xb6')||_0x284f4b===_0xd425('0xb7')||_0x284f4b===_0xd425('0xb8')||_0x284f4b==='IntegerAttributeMetadata'||_0x284f4b===_0xd425('0xb9')||_0x284f4b===_0xd425('0xba')||_0x284f4b===_0xd425('0xbb')||_0x284f4b==='EntityNameAttributeMetadata'||_0x284f4b===_0xd425('0xbc')||_0x284f4b===_0xd425('0xbd')){_0x54649c[_0xd425('0xb5')](getInputList(_0x4a9215,_0x4c7000,_0x284f4b,_0x48b98c,_0x4c9d96[_0xd425('0xaa')],_0x3ed4c2[_0xd425('0xaa')],_0x174081));}}});return Promise['all'](_0x54649c);})[_0xd425('0x2a')](function(_0x52016e){_0x5e76f5=_0x52016e[0x0];var _0xd086f1=_0x3ccffe[_0xd425('0xbe')](_0x5b1104)['concat'](_0x5e76f5);var _0x4de1d0={'count':_0xd086f1[_0xd425('0x3d')],'rows':_0xd086f1};return _0x4de1d0;})['then'](respondWithResult(_0xb407bb,null))[_0xd425('0x48')](function(_0x224eba){var _0x3308e1=_0x1e1a3f[_0xd425('0x38')]['test']?0x1f4:_0x224eba[_0xd425('0xbf')]||0x1f4;logger[_0xd425('0xc0')](_0x224eba[_0xd425('0x2c')]);delete _0x224eba[_0xd425('0x2d')];if(_0x3308e1===0x191){_0x3308e1=0x190;}_0xb407bb[_0xd425('0x1e')](_0x3308e1)[_0xd425('0x2e')](_0x1e1a3f['query'][_0xd425('0xc1')]?{'message':_0xd425('0xc2'),'statusCode':_0x224eba[_0xd425('0xbf')]}:_0x224eba);});};function getSelectList(_0x45dcba,_0x1c6f22,_0x1594e0,_0x5a6b44,_0x289aad,_0x2fd014){var _0x5bd5f0={'method':_0xd425('0xab'),'uri':_0x45dcba+_0xd425('0xac')+_0x5a6b44+')/Attributes('+_0x289aad+_0xd425('0xc3')+_0xd425('0xc4'),'headers':{'Authorization':_0xd425('0xa7')+_0x2fd014,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0x5bd5f0)['then'](function(_0x437aff){var _0x364b1c=[];var _0x587247=_0x437aff[_0xd425('0xc5')][_0xd425('0xc6')];_0x587247[_0xd425('0xb0')](function(_0x19af43){_0x364b1c[_0xd425('0xb5')]({'name':_0x19af43[_0xd425('0xc7')][_0xd425('0xc8')]['Label'],'value':String(_0x19af43[_0xd425('0xc9')])});});var _0x55d9d2={'id':_0x1c6f22+'_'+_0x437aff[_0xd425('0xaf')],'name':_0x437aff[_0xd425('0xca')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x364b1c};_0x1594e0[_0xd425('0xb5')](_0x55d9d2);return _0x1594e0;});}function getBooleanList(_0x166633,_0x26612e,_0x4de528,_0x30fb5d,_0x53a7f9,_0x55f08b){var _0xb8acb9={'method':_0xd425('0xab'),'uri':_0x166633+_0xd425('0xac')+_0x30fb5d+_0xd425('0xcb')+_0x53a7f9+_0xd425('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x55f08b,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0xb8acb9)[_0xd425('0x2a')](function(_0x19d488){var _0x542e6b=[];_0x542e6b[_0xd425('0xb5')]({'name':_0x19d488[_0xd425('0xc5')][_0xd425('0xcd')][_0xd425('0xc7')][_0xd425('0xc8')][_0xd425('0xc7')],'value':'true'},{'name':_0x19d488['OptionSet']['FalseOption'][_0xd425('0xc7')]['UserLocalizedLabel'][_0xd425('0xc7')],'value':_0xd425('0xce')});var _0x310085={'id':_0x26612e+'_'+_0x19d488[_0xd425('0xaf')],'name':_0x19d488[_0xd425('0xca')][_0xd425('0xc8')][_0xd425('0xc7')],'custom':![],'options':_0x542e6b};_0x4de528[_0xd425('0xb5')](_0x310085);return _0x4de528;});}function getInputList(_0x30defc,_0x465015,_0x234a9e,_0x4abc48,_0x381d0b,_0x2956ea,_0x112433){var _0x6e6f55={'method':_0xd425('0xab'),'uri':_0x30defc+_0xd425('0xac')+_0x381d0b+')/Attributes('+_0x2956ea+_0xd425('0xcf')+_0x234a9e+_0xd425('0xd0'),'headers':{'Authorization':_0xd425('0xa7')+_0x112433,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x6e6f55)[_0xd425('0x2a')](function(_0x45b627){var _0x47d918={'id':_0x465015+'_'+_0x45b627[_0xd425('0xaf')],'name':_0x45b627[_0xd425('0xca')]['UserLocalizedLabel']?_0x45b627[_0xd425('0xca')][_0xd425('0xc8')]['Label']:_0x45b627[_0xd425('0xaf')],'custom':![],'options':[]};_0x4abc48[_0xd425('0xb5')](_0x47d918);return _0x4abc48;});} \ No newline at end of file +var _0xee24=['Value','DisplayName','UserLocalizedLabel','Label','OptionSet','true','false',')/Microsoft.Dynamics.CRM.','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','Dynamics365Account','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','Dynamics365Configuration','rawAttributes','order','filter','getConfigurations','findOne','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','phonenumber','regardingobjectid','directioncode','accountidname','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','isNil','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options'];(function(_0x25e0c6,_0x5eb0bb){var _0x5a45b9=function(_0x329d6b){while(--_0x329d6b){_0x25e0c6['push'](_0x25e0c6['shift']());}};_0x5a45b9(++_0x5eb0bb);}(_0xee24,0x1a6));var _0x4ee2=function(_0x3c4505,_0xffe1f8){_0x3c4505=_0x3c4505-0x0;var _0x18f0cc=_0xee24[_0x3c4505];return _0x18f0cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ee2('0x0'));var zipdir=require(_0x4ee2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ee2('0x2'));var moment=require(_0x4ee2('0x3'));var BPromise=require(_0x4ee2('0x4'));var Mustache=require(_0x4ee2('0x5'));var util=require('util');var path=require(_0x4ee2('0x6'));var sox=require(_0x4ee2('0x7'));var csv=require(_0x4ee2('0x8'));var ejs=require(_0x4ee2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee2('0xa'));var squel=require(_0x4ee2('0xb'));var crypto=require(_0x4ee2('0xc'));var jsforce=require(_0x4ee2('0xd'));var deskjs=require(_0x4ee2('0xe'));var toCsv=require(_0x4ee2('0x8'));var querystring=require(_0x4ee2('0xf'));var Papa=require(_0x4ee2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4ee2('0x11'));var as=require(_0x4ee2('0x12'));var hardwareService=require(_0x4ee2('0x13'));var logger=require(_0x4ee2('0x14'))(_0x4ee2('0x15'));var utils=require('../../config/utils');var config=require(_0x4ee2('0x16'));var licenseUtil=require(_0x4ee2('0x17'));var db=require(_0x4ee2('0x18'))['db'];var integrations=require(_0x4ee2('0x19'));function respondWithStatusCode(_0x51f09d,_0x1f7125){_0x1f7125=_0x1f7125||0xcc;return function(_0x2e4f35){if(_0x2e4f35){return _0x51f09d[_0x4ee2('0x1a')](_0x1f7125);}return _0x51f09d[_0x4ee2('0x1b')](_0x1f7125)['end']();};}function respondWithResult(_0x481181,_0x2357c5){_0x2357c5=_0x2357c5||0xc8;return function(_0x2bf4c2){if(_0x2bf4c2){return _0x481181['status'](_0x2357c5)[_0x4ee2('0x1c')](_0x2bf4c2);}};}function respondWithFilteredResult(_0x231d5,_0x3c4279){return function(_0x1b95c5){if(_0x1b95c5){var _0x14bc72=typeof _0x3c4279[_0x4ee2('0x1d')]==='undefined'&&typeof _0x3c4279[_0x4ee2('0x1e')]===_0x4ee2('0x1f');var _0x3d0308=_0x1b95c5['count'];var _0x23df00=_0x14bc72?0x0:_0x3c4279[_0x4ee2('0x1d')];var _0x3ba412=_0x14bc72?_0x1b95c5[_0x4ee2('0x20')]:_0x3c4279[_0x4ee2('0x1d')]+_0x3c4279[_0x4ee2('0x1e')];var _0x2d2284;if(_0x3ba412>=_0x3d0308){_0x3ba412=_0x3d0308;_0x2d2284=0xc8;}else{_0x2d2284=0xce;}_0x231d5[_0x4ee2('0x1b')](_0x2d2284);return _0x231d5['set']('Content-Range',_0x23df00+'-'+_0x3ba412+'/'+_0x3d0308)[_0x4ee2('0x1c')](_0x1b95c5);}return null;};}function patchUpdates(_0x4901ff){return function(_0x34c281){try{jsonpatch[_0x4ee2('0x21')](_0x34c281,_0x4901ff,!![]);}catch(_0x1d9a37){return BPromise[_0x4ee2('0x22')](_0x1d9a37);}return _0x34c281[_0x4ee2('0x23')]();};}function saveUpdates(_0x53f246,_0x1d5037){return function(_0x4d74a0){if(_0x4d74a0){return _0x4d74a0[_0x4ee2('0x24')](_0x53f246)[_0x4ee2('0x25')](function(_0x2560fe){return _0x2560fe;});}return null;};}function removeEntity(_0x1f4f90,_0x1ca982){return function(_0x1f9750){if(_0x1f9750){return _0x1f9750[_0x4ee2('0x26')]()['then'](function(){_0x1f4f90[_0x4ee2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f27e,_0xebd95f){return function(_0x291734){if(!_0x291734){_0x58f27e[_0x4ee2('0x1a')](0x194);}return _0x291734;};}function handleError(_0x1f79af,_0x17119){_0x17119=_0x17119||0x1f4;return function(_0x575080){logger['error'](_0x575080[_0x4ee2('0x27')]);if(_0x575080[_0x4ee2('0x28')]){delete _0x575080['name'];}_0x1f79af[_0x4ee2('0x1b')](_0x17119)['send'](_0x575080);};}exports['index']=function(_0x4bcfde,_0x45dc43){var _0x970fa6={},_0x50da2d={},_0x3f68b9={'count':0x0,'rows':[]};var _0x6775f7=_['map'](db[_0x4ee2('0x29')]['rawAttributes'],function(_0x239ab7){return{'name':_0x239ab7[_0x4ee2('0x2a')],'type':_0x239ab7[_0x4ee2('0x2b')]['key']};});_0x50da2d['model']=_[_0x4ee2('0x2c')](_0x6775f7,_0x4ee2('0x28'));_0x50da2d[_0x4ee2('0x2d')]=_['keys'](_0x4bcfde[_0x4ee2('0x2d')]);_0x50da2d[_0x4ee2('0x2e')]=_[_0x4ee2('0x2f')](_0x50da2d[_0x4ee2('0x30')],_0x50da2d[_0x4ee2('0x2d')]);_0x970fa6[_0x4ee2('0x31')]=_[_0x4ee2('0x2f')](_0x50da2d[_0x4ee2('0x30')],qs[_0x4ee2('0x32')](_0x4bcfde[_0x4ee2('0x2d')][_0x4ee2('0x32')]));_0x970fa6[_0x4ee2('0x31')]=_0x970fa6['attributes'][_0x4ee2('0x33')]?_0x970fa6[_0x4ee2('0x31')]:_0x50da2d['model'];if(!_0x4bcfde[_0x4ee2('0x2d')][_0x4ee2('0x34')](_0x4ee2('0x35'))){_0x970fa6[_0x4ee2('0x1e')]=qs[_0x4ee2('0x1e')](_0x4bcfde[_0x4ee2('0x2d')][_0x4ee2('0x1e')]);_0x970fa6['offset']=qs[_0x4ee2('0x1d')](_0x4bcfde[_0x4ee2('0x2d')][_0x4ee2('0x1d')]);}_0x970fa6['order']=qs[_0x4ee2('0x36')](_0x4bcfde['query'][_0x4ee2('0x36')]);_0x970fa6[_0x4ee2('0x37')]=qs[_0x4ee2('0x2e')](_[_0x4ee2('0x38')](_0x4bcfde[_0x4ee2('0x2d')],_0x50da2d[_0x4ee2('0x2e')]),_0x6775f7);if(_0x4bcfde['query']['filter']){_0x970fa6[_0x4ee2('0x37')]=_[_0x4ee2('0x39')](_0x970fa6[_0x4ee2('0x37')],{'$or':_[_0x4ee2('0x2c')](_0x6775f7,function(_0x264fe3){if(_0x264fe3[_0x4ee2('0x2b')]!==_0x4ee2('0x3a')){var _0x29c4b3={};_0x29c4b3[_0x264fe3[_0x4ee2('0x28')]]={'$like':'%'+_0x4bcfde[_0x4ee2('0x2d')]['filter']+'%'};return _0x29c4b3;}})});}_0x970fa6=_['merge']({},_0x970fa6,_0x4bcfde[_0x4ee2('0x3b')]);var _0x2b54f1={'where':_0x970fa6[_0x4ee2('0x37')]};return db['Dynamics365Account'][_0x4ee2('0x20')](_0x2b54f1)[_0x4ee2('0x25')](function(_0x20d471){_0x3f68b9[_0x4ee2('0x20')]=_0x20d471;if(_0x4bcfde[_0x4ee2('0x2d')][_0x4ee2('0x3c')]){_0x970fa6[_0x4ee2('0x3d')]=[{'all':!![]}];}return db[_0x4ee2('0x29')][_0x4ee2('0x3e')](_0x970fa6);})[_0x4ee2('0x25')](function(_0x563d9f){_0x3f68b9['rows']=_0x563d9f;return _0x3f68b9;})[_0x4ee2('0x25')](respondWithFilteredResult(_0x45dc43,_0x970fa6))[_0x4ee2('0x3f')](handleError(_0x45dc43,null));};exports[_0x4ee2('0x40')]=function(_0x4f2808,_0x1ef1d5){var _0x56fd09={'raw':![],'where':{'id':_0x4f2808['params']['id']}},_0x34a074={};_0x34a074[_0x4ee2('0x30')]=_[_0x4ee2('0x41')](db[_0x4ee2('0x29')]['rawAttributes']);_0x34a074[_0x4ee2('0x2d')]=_['keys'](_0x4f2808[_0x4ee2('0x2d')]);_0x34a074[_0x4ee2('0x2e')]=_[_0x4ee2('0x2f')](_0x34a074[_0x4ee2('0x30')],_0x34a074['query']);_0x56fd09[_0x4ee2('0x31')]=_[_0x4ee2('0x2f')](_0x34a074['model'],qs[_0x4ee2('0x32')](_0x4f2808['query']['fields']));_0x56fd09[_0x4ee2('0x31')]=_0x56fd09['attributes'][_0x4ee2('0x33')]?_0x56fd09['attributes']:_0x34a074[_0x4ee2('0x30')];if(_0x4f2808[_0x4ee2('0x2d')][_0x4ee2('0x3c')]){_0x56fd09['include']=[{'all':!![]}];}_0x56fd09=_[_0x4ee2('0x39')]({},_0x56fd09,_0x4f2808[_0x4ee2('0x3b')]);return db[_0x4ee2('0x29')][_0x4ee2('0x42')](_0x56fd09)[_0x4ee2('0x25')](handleEntityNotFound(_0x1ef1d5,null))['then'](respondWithResult(_0x1ef1d5,null))[_0x4ee2('0x3f')](handleError(_0x1ef1d5,null));};exports[_0x4ee2('0x43')]=function(_0x535c11,_0x4c21f4){return db[_0x4ee2('0x29')]['create'](_0x535c11[_0x4ee2('0x44')],{})[_0x4ee2('0x25')](respondWithResult(_0x4c21f4,0xc9))['catch'](handleError(_0x4c21f4,null));};exports[_0x4ee2('0x24')]=function(_0x2bf21a,_0x29b3fe){if(_0x2bf21a['body']['id']){delete _0x2bf21a[_0x4ee2('0x44')]['id'];}return db[_0x4ee2('0x29')]['find']({'where':{'id':_0x2bf21a['params']['id']}})['then'](handleEntityNotFound(_0x29b3fe,null))['then'](saveUpdates(_0x2bf21a[_0x4ee2('0x44')],null))[_0x4ee2('0x25')](respondWithResult(_0x29b3fe,null))['catch'](handleError(_0x29b3fe,null));};exports[_0x4ee2('0x26')]=function(_0x3d25fb,_0x391424){return db[_0x4ee2('0x29')][_0x4ee2('0x42')]({'where':{'id':_0x3d25fb[_0x4ee2('0x45')]['id']}})[_0x4ee2('0x25')](handleEntityNotFound(_0x391424,null))['then'](removeEntity(_0x391424,null))[_0x4ee2('0x3f')](handleError(_0x391424,null));};exports['getConfigurations']=function(_0x13cb09,_0x14a86d,_0x5b8d0){var _0x56c1ca={};var _0x386a59={};var _0x309d65;var _0x304d64;return db['Dynamics365Account']['findOne']({'where':{'id':_0x13cb09[_0x4ee2('0x45')]['id']}})[_0x4ee2('0x25')](handleEntityNotFound(_0x14a86d,null))[_0x4ee2('0x25')](function(_0x3df5b3){if(_0x3df5b3){_0x309d65=_0x3df5b3;_0x386a59['model']=_[_0x4ee2('0x41')](db[_0x4ee2('0x46')][_0x4ee2('0x47')]);_0x386a59[_0x4ee2('0x2d')]=_[_0x4ee2('0x41')](_0x13cb09[_0x4ee2('0x2d')]);_0x386a59[_0x4ee2('0x2e')]=_[_0x4ee2('0x2f')](_0x386a59[_0x4ee2('0x30')],_0x386a59[_0x4ee2('0x2d')]);_0x56c1ca[_0x4ee2('0x31')]=_[_0x4ee2('0x2f')](_0x386a59['model'],qs['fields'](_0x13cb09[_0x4ee2('0x2d')][_0x4ee2('0x32')]));_0x56c1ca[_0x4ee2('0x31')]=_0x56c1ca['attributes']['length']?_0x56c1ca[_0x4ee2('0x31')]:_0x386a59[_0x4ee2('0x30')];_0x56c1ca[_0x4ee2('0x48')]=qs['sort'](_0x13cb09[_0x4ee2('0x2d')][_0x4ee2('0x36')]);_0x56c1ca[_0x4ee2('0x37')]=qs[_0x4ee2('0x2e')](_[_0x4ee2('0x38')](_0x13cb09['query'],_0x386a59['filters']));if(_0x13cb09[_0x4ee2('0x2d')][_0x4ee2('0x49')]){_0x56c1ca['where']=_[_0x4ee2('0x39')](_0x56c1ca[_0x4ee2('0x37')],{'$or':_[_0x4ee2('0x2c')](_0x56c1ca[_0x4ee2('0x31')],function(_0xc658bd){var _0x57e0fc={};_0x57e0fc[_0xc658bd]={'$like':'%'+_0x13cb09[_0x4ee2('0x2d')]['filter']+'%'};return _0x57e0fc;})});}_0x56c1ca=_[_0x4ee2('0x39')]({},_0x56c1ca,_0x13cb09[_0x4ee2('0x3b')]);return _0x309d65['getConfigurations'](_0x56c1ca);}})[_0x4ee2('0x25')](function(_0x17b21e){if(_0x17b21e){_0x304d64=_0x17b21e[_0x4ee2('0x33')];if(!_0x13cb09[_0x4ee2('0x2d')]['hasOwnProperty'](_0x4ee2('0x35'))){_0x56c1ca[_0x4ee2('0x1e')]=qs['limit'](_0x13cb09[_0x4ee2('0x2d')][_0x4ee2('0x1e')]);_0x56c1ca[_0x4ee2('0x1d')]=qs[_0x4ee2('0x1d')](_0x13cb09['query'][_0x4ee2('0x1d')]);}return _0x309d65[_0x4ee2('0x4a')](_0x56c1ca);}})[_0x4ee2('0x25')](function(_0xb0694a){if(_0xb0694a){return _0xb0694a?{'count':_0x304d64,'rows':_0xb0694a}:null;}})[_0x4ee2('0x25')](respondWithResult(_0x14a86d,null))[_0x4ee2('0x3f')](handleError(_0x14a86d,null));};exports['addConfiguration']=function(_0x211e6d,_0x19d41b,_0x814727){if(_0x211e6d[_0x4ee2('0x44')]['id']){delete _0x211e6d[_0x4ee2('0x44')]['id'];}return db[_0x4ee2('0x29')][_0x4ee2('0x4b')]({'where':{'id':_0x211e6d[_0x4ee2('0x45')]['id']}})['then'](handleEntityNotFound(_0x19d41b,null))['then'](function(_0x5de0d2){if(_0x5de0d2){_0x211e6d[_0x4ee2('0x44')]['AccountId']=_0x5de0d2['id'];_0x211e6d[_0x4ee2('0x44')][_0x4ee2('0x4c')]=integrations[_0x4ee2('0x4d')](_0x211e6d['body']['channel'],_0x211e6d[_0x4ee2('0x44')][_0x4ee2('0x2b')]);_0x211e6d[_0x4ee2('0x44')][_0x4ee2('0x4e')]=integrations[_0x4ee2('0x4f')](_0x211e6d[_0x4ee2('0x44')]['channel'],_0x211e6d[_0x4ee2('0x44')][_0x4ee2('0x2b')]);return db[_0x4ee2('0x46')][_0x4ee2('0x43')](_0x211e6d[_0x4ee2('0x44')],{'include':[{'model':db[_0x4ee2('0x50')],'as':_0x4ee2('0x4c')},{'model':db[_0x4ee2('0x50')],'as':_0x4ee2('0x4e')}]});}return null;})['then'](respondWithResult(_0x19d41b,null))['catch'](handleError(_0x19d41b,null));};exports[_0x4ee2('0x51')]=function(_0x4a3f7a,_0x46d1cb,_0x55e987){var _0x4f90fb=_0x4a3f7a[_0x4ee2('0x2d')][_0x4ee2('0x52')];var _0x5671d5=_0x4f90fb===_0x4ee2('0x53')?'Incident':_0x4ee2('0x54');var _0x3f23f1='';var _0x3aa69e='';var _0x54d595='';var _0x26cba5='';var _0x2eb937='';var _0x564200='';var _0x340905='';var _0x371466='';var _0x102682=[_0x4ee2('0x55'),_0x4ee2('0x56'),_0x4ee2('0x57'),_0x4ee2('0x58'),'caseorigincode','subject',_0x4ee2('0x59'),_0x4ee2('0x5a'),_0x4ee2('0x5b'),'phonecall_activity_parties'];var _0x341b16=[_0x4ee2('0x5c'),'accountidyominame','actualserviceunits',_0x4ee2('0x5d'),'contactidname',_0x4ee2('0x5e'),_0x4ee2('0x5f'),'contractidname',_0x4ee2('0x60'),_0x4ee2('0x61'),_0x4ee2('0x62'),_0x4ee2('0x63'),_0x4ee2('0x64'),_0x4ee2('0x65'),_0x4ee2('0x66'),_0x4ee2('0x67'),_0x4ee2('0x68'),_0x4ee2('0x69'),_0x4ee2('0x6a'),_0x4ee2('0x6b'),_0x4ee2('0x6c'),_0x4ee2('0x6d'),_0x4ee2('0x6e'),_0x4ee2('0x6f'),_0x4ee2('0x70'),_0x4ee2('0x71'),_0x4ee2('0x72'),_0x4ee2('0x73'),_0x4ee2('0x74'),_0x4ee2('0x75'),'masteridname',_0x4ee2('0x76'),_0x4ee2('0x77'),_0x4ee2('0x78'),_0x4ee2('0x79'),_0x4ee2('0x7a'),_0x4ee2('0x7b'),_0x4ee2('0x7c'),_0x4ee2('0x7d'),_0x4ee2('0x7e'),_0x4ee2('0x7f'),'onholdtime',_0x4ee2('0x80'),_0x4ee2('0x81'),_0x4ee2('0x82'),'owneridyominame',_0x4ee2('0x83'),_0x4ee2('0x84'),_0x4ee2('0x85'),_0x4ee2('0x86'),_0x4ee2('0x87'),_0x4ee2('0x88'),_0x4ee2('0x89'),_0x4ee2('0x8a'),_0x4ee2('0x8b'),_0x4ee2('0x8c'),_0x4ee2('0x8d'),'sentimentvalue',_0x4ee2('0x8e'),_0x4ee2('0x8f'),'socialprofileidname','statecode','statuscode',_0x4ee2('0x90'),_0x4ee2('0x91'),_0x4ee2('0x92'),_0x4ee2('0x93'),_0x4ee2('0x94'),_0x4ee2('0x95'),_0x4ee2('0x96')];var _0x24bb46=_0x102682[_0x4ee2('0x97')](_0x341b16);return db[_0x4ee2('0x29')][_0x4ee2('0x4b')]({'where':{'id':_0x4a3f7a['params']['id']},'attributes':['id',_0x4ee2('0x98'),'password',_0x4ee2('0x99'),_0x4ee2('0x9a'),_0x4ee2('0x9b'),_0x4ee2('0x9c')]})[_0x4ee2('0x25')](handleEntityNotFound(_0x46d1cb,null))[_0x4ee2('0x25')](function(_0x2bf6b9){if(_0x2bf6b9){_0x371466=_0x2bf6b9[_0x4ee2('0x99')];var _0xed8898=_0x371466[_0x4ee2('0x9d')](-0x1);if(_0xed8898==='/'){_0x371466=_0x371466[_0x4ee2('0x9e')](0x0,_0x371466[_0x4ee2('0x9f')](_0xed8898));}_0x340905=util[_0x4ee2('0xa0')](_0x4ee2('0xa1'),_0x371466);var _0x21c9af={'method':_0x4ee2('0xa2'),'uri':_0x4ee2('0xa3')+_0x2bf6b9['tenantId']+_0x4ee2('0xa4'),'form':{'client_id':_0x2bf6b9[_0x4ee2('0x9b')],'resource':_0x371466,'username':_0x2bf6b9[_0x4ee2('0x98')],'password':_0x2bf6b9[_0x4ee2('0xa5')],'grant_type':_0x4ee2('0xa5'),'client_secret':_0x2bf6b9['clientSecret']},'json':!![]};return rp(_0x21c9af);}})[_0x4ee2('0x25')](function(_0x14823f){_0x564200=_0x14823f[_0x4ee2('0xa6')];var _0x2d91f4={'method':'GET','uri':encodeURI(_0x340905+_0x4ee2('0xa7')+_0x5671d5+'\x27'),'headers':{'Authorization':_0x4ee2('0xa8')+_0x564200,'If-None-Match':null,'OData-Version':_0x4ee2('0xa9')},'json':!![]};return rp(_0x2d91f4);})['then'](function(_0x26409a){var _0x7f335=_0x26409a[_0x4ee2('0xaa')][0x0];var _0x427985=_0x7f335['MetadataId'];var _0x99bf15={'method':_0x4ee2('0xab'),'uri':_0x340905+_0x4ee2('0xac')+_0x427985+_0x4ee2('0xad'),'headers':{'Authorization':_0x4ee2('0xa8')+_0x564200,'If-None-Match':null,'OData-Version':_0x4ee2('0xa9')},'json':!![]};return rp(_0x99bf15);})[_0x4ee2('0x25')](function(_0x543282){_0x3f23f1=_0x543282;_0x3aa69e=_0x3f23f1[_0x4ee2('0xae')];_0x3aa69e=_[_0x4ee2('0xaf')](_0x3aa69e,function(_0x552e34){return!_0x24bb46[_0x4ee2('0xb0')](_0x552e34[_0x4ee2('0xb1')]);});var _0xa8d142=[];var _0x57cdd8=[];_0x3aa69e[_0x4ee2('0xb2')](function(_0x1994e0){if(_0x1994e0[_0x4ee2('0xb3')]){var _0x36400e=_0x1994e0['@odata.type'][_0x4ee2('0x9e')](_0x1994e0['@odata.type']['lastIndexOf']('.')+0x1);if(_0x36400e===_0x4ee2('0xb4')){_0xa8d142['push'](getSelectList(_0x340905,_0x4f90fb,_0x57cdd8,_0x3f23f1[_0x4ee2('0xb5')],_0x1994e0[_0x4ee2('0xb5')],_0x564200));}}});return Promise['all'](_0xa8d142);})[_0x4ee2('0x25')](function(_0x443c8a){_0x54d595=_0x443c8a[0x0];var _0x65b97a=[];var _0x5b8f7c=[];_0x3aa69e[_0x4ee2('0xb2')](function(_0x2d5c17){if(!_[_0x4ee2('0xb6')](_0x2d5c17['@odata.type'])){var _0xd8e8f7=_0x2d5c17[_0x4ee2('0xb3')]['substring'](_0x2d5c17[_0x4ee2('0xb3')][_0x4ee2('0x9f')]('.')+0x1);if(_0xd8e8f7==='BooleanAttributeMetadata'){_0x65b97a[_0x4ee2('0xb7')](getBooleanList(_0x340905,_0x4f90fb,_0x5b8f7c,_0x3f23f1['MetadataId'],_0x2d5c17[_0x4ee2('0xb5')],_0x564200));}}});return Promise[_0x4ee2('0xb8')](_0x65b97a);})[_0x4ee2('0x25')](function(_0x2ebafb){_0x26cba5=_0x2ebafb[0x0];var _0x3b8258=[];var _0x146aa3=[];_0x3aa69e[_0x4ee2('0xb2')](function(_0x37a383){if(_0x37a383['@odata.type']){var _0x42663f=_0x37a383[_0x4ee2('0xb3')][_0x4ee2('0x9e')](_0x37a383[_0x4ee2('0xb3')][_0x4ee2('0x9f')]('.')+0x1);if(_0x42663f==='StringAttributeMetadata'||_0x42663f===_0x4ee2('0xb9')||_0x42663f===_0x4ee2('0xba')||_0x42663f===_0x4ee2('0xbb')||_0x42663f==='MemoAttributeMetadata'||_0x42663f===_0x4ee2('0xbc')||_0x42663f==='StatusAttributeMetadata'||_0x42663f===_0x4ee2('0xbd')||_0x42663f===_0x4ee2('0xbe')||_0x42663f==='DecimalAttributeMetadata'){_0x3b8258[_0x4ee2('0xb7')](getInputList(_0x340905,_0x4f90fb,_0x42663f,_0x146aa3,_0x3f23f1[_0x4ee2('0xb5')],_0x37a383[_0x4ee2('0xb5')],_0x564200));}}});return Promise[_0x4ee2('0xb8')](_0x3b8258);})['then'](function(_0x457b79){_0x2eb937=_0x457b79[0x0];var _0x48200b=_0x54d595[_0x4ee2('0x97')](_0x26cba5)[_0x4ee2('0x97')](_0x2eb937);var _0x404994={'count':_0x48200b['length'],'rows':_0x48200b};return _0x404994;})[_0x4ee2('0x25')](respondWithResult(_0x46d1cb,null))['catch'](function(_0x46f54d){var _0x31e4c1=_0x4a3f7a[_0x4ee2('0x2d')][_0x4ee2('0xbf')]?0x1f4:_0x46f54d[_0x4ee2('0xc0')]||0x1f4;logger[_0x4ee2('0xc1')](_0x46f54d[_0x4ee2('0x27')]);delete _0x46f54d[_0x4ee2('0x28')];if(_0x31e4c1===0x191){_0x31e4c1=0x190;}_0x46d1cb[_0x4ee2('0x1b')](_0x31e4c1)[_0x4ee2('0xc2')](_0x4a3f7a[_0x4ee2('0x2d')]['test']?{'message':_0x4ee2('0xc3'),'statusCode':_0x46f54d[_0x4ee2('0xc0')]}:_0x46f54d);});};function getSelectList(_0x1155dc,_0x3db2cc,_0x536290,_0x407229,_0x2d37af,_0x19aae1){var _0x285c2b={'method':_0x4ee2('0xab'),'uri':_0x1155dc+_0x4ee2('0xac')+_0x407229+_0x4ee2('0xc4')+_0x2d37af+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x4ee2('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x19aae1,'If-None-Match':null,'OData-Version':_0x4ee2('0xa9')},'json':!![]};return rp(_0x285c2b)[_0x4ee2('0x25')](function(_0xfefc5e){var _0x1296ae=[];var _0x2d4ac2=_0xfefc5e['OptionSet'][_0x4ee2('0xc6')];_0x2d4ac2[_0x4ee2('0xb2')](function(_0x523086){_0x1296ae['push']({'name':_0x523086['Label']['UserLocalizedLabel']['Label'],'value':String(_0x523086[_0x4ee2('0xc7')])});});var _0x64640e={'id':_0x3db2cc+'_'+_0xfefc5e[_0x4ee2('0xb1')],'name':_0xfefc5e[_0x4ee2('0xc8')][_0x4ee2('0xc9')][_0x4ee2('0xca')],'custom':![],'options':_0x1296ae};_0x536290[_0x4ee2('0xb7')](_0x64640e);return _0x536290;});}function getBooleanList(_0x26769d,_0x895e40,_0x4e249a,_0x16a0be,_0x23ce68,_0x561549){var _0x174f80={'method':_0x4ee2('0xab'),'uri':_0x26769d+_0x4ee2('0xac')+_0x16a0be+_0x4ee2('0xc4')+_0x23ce68+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x4ee2('0xa8')+_0x561549,'If-None-Match':null,'OData-Version':_0x4ee2('0xa9')},'json':!![]};return rp(_0x174f80)[_0x4ee2('0x25')](function(_0x7467dc){var _0x563d5e=[];_0x563d5e[_0x4ee2('0xb7')]({'name':_0x7467dc[_0x4ee2('0xcb')]['TrueOption'][_0x4ee2('0xca')][_0x4ee2('0xc9')][_0x4ee2('0xca')],'value':_0x4ee2('0xcc')},{'name':_0x7467dc[_0x4ee2('0xcb')]['FalseOption'][_0x4ee2('0xca')][_0x4ee2('0xc9')][_0x4ee2('0xca')],'value':_0x4ee2('0xcd')});var _0x310ef5={'id':_0x895e40+'_'+_0x7467dc[_0x4ee2('0xb1')],'name':_0x7467dc[_0x4ee2('0xc8')][_0x4ee2('0xc9')][_0x4ee2('0xca')],'custom':![],'options':_0x563d5e};_0x4e249a[_0x4ee2('0xb7')](_0x310ef5);return _0x4e249a;});}function getInputList(_0x266036,_0xba4a17,_0x4cfe04,_0x153ba1,_0x3c7444,_0x4b6a7e,_0x233cb1){var _0x166fdf={'method':_0x4ee2('0xab'),'uri':_0x266036+_0x4ee2('0xac')+_0x3c7444+_0x4ee2('0xc4')+_0x4b6a7e+_0x4ee2('0xce')+_0x4cfe04+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x233cb1,'If-None-Match':null,'OData-Version':_0x4ee2('0xa9')},'json':!![]};return rp(_0x166fdf)[_0x4ee2('0x25')](function(_0x247f62){var _0x286b63={'id':_0xba4a17+'_'+_0x247f62[_0x4ee2('0xb1')],'name':_0x247f62[_0x4ee2('0xc8')]['UserLocalizedLabel']?_0x247f62['DisplayName'][_0x4ee2('0xc9')]['Label']:_0x247f62[_0x4ee2('0xb1')],'custom':![],'options':[]};_0x153ba1[_0x4ee2('0xb7')](_0x286b63);return _0x153ba1;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 67ecae1..ab05c49 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x1f0c3c,_0x5534ff){var _0x198208=function(_0x230cb1){while(--_0x230cb1){_0x1f0c3c['push'](_0x1f0c3c['shift']());}};_0x198208(++_0x5534ff);}(_0xe706,0xa3));var _0x6e70=function(_0x35f6b4,_0x505966){_0x35f6b4=_0x35f6b4-0x0;var _0x10f072=_0xe706[_0x35f6b4];return _0x10f072;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x22f683,_0x57def9){var _0x2be6d0=function(_0x3d892d){while(--_0x3d892d){_0x22f683['push'](_0x22f683['shift']());}};_0x2be6d0(++_0x57def9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 9b3d86e..9281515 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 _0xf9fc=['message','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Account,\x20%s,\x20%s'];(function(_0x2cce21,_0x4de1c9){var _0x123541=function(_0x364b4d){while(--_0x364b4d){_0x2cce21['push'](_0x2cce21['shift']());}};_0x123541(++_0x4de1c9);}(_0xf9fc,0x179));var _0xcf9f=function(_0x5c852e,_0x229f4f){_0x5c852e=_0x5c852e-0x0;var _0x3ecac9=_0xf9fc[_0x5c852e];return _0x3ecac9;};'use strict';var _=require(_0xcf9f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf9f('0x1'));var rs=require(_0xcf9f('0x2'));var fs=require('fs');var Redis=require(_0xcf9f('0x3'));var db=require(_0xcf9f('0x4'))['db'];var utils=require(_0xcf9f('0x5'));var logger=require(_0xcf9f('0x6'))(_0xcf9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcf9f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36c219,_0x1fe5e5,_0x4d129b){return new BPromise(function(_0x2d4ce7,_0xc3763a){return client[_0xcf9f('0x9')](_0x36c219,_0x4d129b)[_0xcf9f('0xa')](function(_0x1fdb6d){logger[_0xcf9f('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x1fe5e5,'request\x20sent');logger[_0xcf9f('0xc')](_0xcf9f('0xd'),_0x1fe5e5,_0xcf9f('0xe'),JSON[_0xcf9f('0xf')](_0x1fdb6d));if(_0x1fdb6d['error']){if(_0x1fdb6d[_0xcf9f('0x10')][_0xcf9f('0x11')]===0x1f4){logger[_0xcf9f('0x10')](_0xcf9f('0x12'),_0x1fe5e5,_0x1fdb6d[_0xcf9f('0x10')]['message']);return _0xc3763a(_0x1fdb6d[_0xcf9f('0x10')][_0xcf9f('0x13')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1fe5e5,_0x1fdb6d[_0xcf9f('0x10')][_0xcf9f('0x13')]);return _0x2d4ce7(_0x1fdb6d['error'][_0xcf9f('0x13')]);}else{logger[_0xcf9f('0xb')](_0xcf9f('0x12'),_0x1fe5e5,_0xcf9f('0xe'));_0x2d4ce7(_0x1fdb6d['result']['message']);}})[_0xcf9f('0x14')](function(_0x46a645){logger[_0xcf9f('0x10')](_0xcf9f('0x12'),_0x1fe5e5,_0x46a645);_0xc3763a(_0x46a645);});});}exports['GetDynamics365Account']=function(_0x161865){var _0x206fc7=this;return new Promise(function(_0x23a5e7,_0x51bddb){return db[_0xcf9f('0x15')][_0xcf9f('0x16')]({'raw':_0x161865['options']?_0x161865[_0xcf9f('0x17')][_0xcf9f('0x18')]===undefined?!![]:![]:!![],'where':_0x161865[_0xcf9f('0x17')]?_0x161865[_0xcf9f('0x17')][_0xcf9f('0x19')]||null:null,'attributes':_0x161865['options']?_0x161865[_0xcf9f('0x17')][_0xcf9f('0x1a')]||null:null,'limit':_0x161865[_0xcf9f('0x17')]?_0x161865['options']['limit']||null:null,'include':_0x161865[_0xcf9f('0x17')]?_0x161865[_0xcf9f('0x17')][_0xcf9f('0x1b')]?_[_0xcf9f('0x1c')](_0x161865[_0xcf9f('0x17')][_0xcf9f('0x1b')],function(_0x40f687){return{'model':db[_0x40f687[_0xcf9f('0x1d')]],'as':_0x40f687['as'],'attributes':_0x40f687[_0xcf9f('0x1a')],'include':_0x40f687[_0xcf9f('0x1b')]?_[_0xcf9f('0x1c')](_0x40f687[_0xcf9f('0x1b')],function(_0x3da72e){return{'model':db[_0x3da72e['model']],'as':_0x3da72e['as'],'attributes':_0x3da72e[_0xcf9f('0x1a')],'include':_0x3da72e[_0xcf9f('0x1b')]?_[_0xcf9f('0x1c')](_0x3da72e[_0xcf9f('0x1b')],function(_0x554cee){return{'model':db[_0x554cee[_0xcf9f('0x1d')]],'as':_0x554cee['as'],'attributes':_0x554cee[_0xcf9f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x148c97){logger[_0xcf9f('0xb')](_0xcf9f('0x1e'),_0x161865);logger[_0xcf9f('0xc')]('GetDynamics365Account',_0x161865,JSON['stringify'](_0x148c97));_0x23a5e7(_0x148c97);})[_0xcf9f('0x14')](function(_0x197d5f){logger[_0xcf9f('0x10')](_0xcf9f('0x1e'),_0x197d5f[_0xcf9f('0x13')],_0x161865);_0x51bddb(_0x206fc7['error'](0x1f4,_0x197d5f['message']));});});};exports[_0xcf9f('0x1f')]=function(_0x58e7a8){var _0x166ac2=this;return new Promise(function(_0x4f9c68,_0x188e2b){return db[_0xcf9f('0x15')][_0xcf9f('0x20')]({'raw':_0x58e7a8[_0xcf9f('0x17')]?_0x58e7a8['options'][_0xcf9f('0x18')]===undefined?!![]:![]:!![],'where':_0x58e7a8[_0xcf9f('0x17')]?_0x58e7a8[_0xcf9f('0x17')]['where']||null:null,'attributes':_0x58e7a8[_0xcf9f('0x17')]?_0x58e7a8[_0xcf9f('0x17')][_0xcf9f('0x1a')]||null:null,'include':_0x58e7a8[_0xcf9f('0x17')]?_0x58e7a8[_0xcf9f('0x17')][_0xcf9f('0x1b')]?_[_0xcf9f('0x1c')](_0x58e7a8[_0xcf9f('0x17')]['include'],function(_0x4a85b9){return{'model':db[_0x4a85b9[_0xcf9f('0x1d')]],'as':_0x4a85b9['as'],'attributes':_0x4a85b9[_0xcf9f('0x1a')],'include':_0x4a85b9['include']?_[_0xcf9f('0x1c')](_0x4a85b9['include'],function(_0x235568){return{'model':db[_0x235568[_0xcf9f('0x1d')]],'as':_0x235568['as'],'attributes':_0x235568['attributes'],'include':_0x235568['include']?_[_0xcf9f('0x1c')](_0x235568['include'],function(_0x1d0429){return{'model':db[_0x1d0429[_0xcf9f('0x1d')]],'as':_0x1d0429['as'],'attributes':_0x1d0429['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f131){logger[_0xcf9f('0xb')](_0xcf9f('0x1f'),_0x58e7a8);logger[_0xcf9f('0xc')](_0xcf9f('0x1f'),_0x58e7a8,JSON['stringify'](_0x42f131));_0x4f9c68(_0x42f131);})[_0xcf9f('0x14')](function(_0x10ed2c){logger[_0xcf9f('0x10')]('ShowDynamics365Account',_0x10ed2c[_0xcf9f('0x13')],_0x58e7a8);_0x188e2b(_0x166ac2[_0xcf9f('0x10')](0x1f4,_0x10ed2c[_0xcf9f('0x13')]));});});}; \ No newline at end of file +var _0x105a=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','include','model','attributes','map','ShowDynamics365Account','raw','lodash','util','moment'];(function(_0x479416,_0x4b6328){var _0x1ae1f3=function(_0xfaca6d){while(--_0xfaca6d){_0x479416['push'](_0x479416['shift']());}};_0x1ae1f3(++_0x4b6328);}(_0x105a,0x1a1));var _0xa105=function(_0x16b4ed,_0x5d5ac9){_0x16b4ed=_0x16b4ed-0x0;var _0x5d945d=_0x105a[_0x16b4ed];return _0x5d945d;};'use strict';var _=require(_0xa105('0x0'));var util=require(_0xa105('0x1'));var moment=require(_0xa105('0x2'));var BPromise=require(_0xa105('0x3'));var rs=require(_0xa105('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa105('0x5'))['db'];var utils=require(_0xa105('0x6'));var logger=require('../../config/logger')(_0xa105('0x7'));var config=require('../../config/environment');var jayson=require(_0xa105('0x8'));var client=jayson[_0xa105('0x9')][_0xa105('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x352300,_0x284983,_0x27da58){return new BPromise(function(_0xa04b,_0x5b8d61){return client[_0xa105('0xb')](_0x352300,_0x27da58)[_0xa105('0xc')](function(_0x3ca589){logger[_0xa105('0xd')](_0xa105('0xe'),_0x284983,_0xa105('0xf'));logger[_0xa105('0x10')](_0xa105('0x11'),_0x284983,_0xa105('0xf'),JSON[_0xa105('0x12')](_0x3ca589));if(_0x3ca589['error']){if(_0x3ca589['error'][_0xa105('0x13')]===0x1f4){logger[_0xa105('0x14')](_0xa105('0xe'),_0x284983,_0x3ca589[_0xa105('0x14')][_0xa105('0x15')]);return _0x5b8d61(_0x3ca589[_0xa105('0x14')]['message']);}logger[_0xa105('0x14')](_0xa105('0xe'),_0x284983,_0x3ca589[_0xa105('0x14')][_0xa105('0x15')]);return _0xa04b(_0x3ca589[_0xa105('0x14')][_0xa105('0x15')]);}else{logger[_0xa105('0xd')](_0xa105('0xe'),_0x284983,_0xa105('0xf'));_0xa04b(_0x3ca589[_0xa105('0x16')]['message']);}})[_0xa105('0x17')](function(_0x583d84){logger['error'](_0xa105('0xe'),_0x284983,_0x583d84);_0x5b8d61(_0x583d84);});});}exports[_0xa105('0x18')]=function(_0x4090b4){var _0x3ea8d7=this;return new Promise(function(_0x354aff,_0x5a367d){return db[_0xa105('0x19')][_0xa105('0x1a')]({'raw':_0x4090b4['options']?_0x4090b4[_0xa105('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4090b4[_0xa105('0x1b')]?_0x4090b4[_0xa105('0x1b')][_0xa105('0x1c')]||null:null,'attributes':_0x4090b4['options']?_0x4090b4[_0xa105('0x1b')]['attributes']||null:null,'limit':_0x4090b4['options']?_0x4090b4['options']['limit']||null:null,'include':_0x4090b4[_0xa105('0x1b')]?_0x4090b4[_0xa105('0x1b')]['include']?_['map'](_0x4090b4[_0xa105('0x1b')][_0xa105('0x1d')],function(_0x4478b1){return{'model':db[_0x4478b1[_0xa105('0x1e')]],'as':_0x4478b1['as'],'attributes':_0x4478b1[_0xa105('0x1f')],'include':_0x4478b1[_0xa105('0x1d')]?_[_0xa105('0x20')](_0x4478b1[_0xa105('0x1d')],function(_0x54e41a){return{'model':db[_0x54e41a[_0xa105('0x1e')]],'as':_0x54e41a['as'],'attributes':_0x54e41a[_0xa105('0x1f')],'include':_0x54e41a['include']?_[_0xa105('0x20')](_0x54e41a[_0xa105('0x1d')],function(_0x181848){return{'model':db[_0x181848[_0xa105('0x1e')]],'as':_0x181848['as'],'attributes':_0x181848[_0xa105('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa105('0xc')](function(_0x115225){logger[_0xa105('0xd')](_0xa105('0x18'),_0x4090b4);logger[_0xa105('0x10')](_0xa105('0x18'),_0x4090b4,JSON[_0xa105('0x12')](_0x115225));_0x354aff(_0x115225);})[_0xa105('0x17')](function(_0x3318d0){logger['error'](_0xa105('0x18'),_0x3318d0['message'],_0x4090b4);_0x5a367d(_0x3ea8d7['error'](0x1f4,_0x3318d0[_0xa105('0x15')]));});});};exports[_0xa105('0x21')]=function(_0x1b051b){var _0x33dafd=this;return new Promise(function(_0x1989bc,_0x28a323){return db['Dynamics365Account']['find']({'raw':_0x1b051b[_0xa105('0x1b')]?_0x1b051b[_0xa105('0x1b')][_0xa105('0x22')]===undefined?!![]:![]:!![],'where':_0x1b051b[_0xa105('0x1b')]?_0x1b051b[_0xa105('0x1b')][_0xa105('0x1c')]||null:null,'attributes':_0x1b051b['options']?_0x1b051b[_0xa105('0x1b')][_0xa105('0x1f')]||null:null,'include':_0x1b051b[_0xa105('0x1b')]?_0x1b051b['options'][_0xa105('0x1d')]?_[_0xa105('0x20')](_0x1b051b[_0xa105('0x1b')][_0xa105('0x1d')],function(_0x2d9266){return{'model':db[_0x2d9266[_0xa105('0x1e')]],'as':_0x2d9266['as'],'attributes':_0x2d9266['attributes'],'include':_0x2d9266[_0xa105('0x1d')]?_[_0xa105('0x20')](_0x2d9266[_0xa105('0x1d')],function(_0x12bec1){return{'model':db[_0x12bec1[_0xa105('0x1e')]],'as':_0x12bec1['as'],'attributes':_0x12bec1[_0xa105('0x1f')],'include':_0x12bec1[_0xa105('0x1d')]?_['map'](_0x12bec1['include'],function(_0x456d56){return{'model':db[_0x456d56[_0xa105('0x1e')]],'as':_0x456d56['as'],'attributes':_0x456d56[_0xa105('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa105('0xc')](function(_0x582bae){logger[_0xa105('0xd')]('ShowDynamics365Account',_0x1b051b);logger[_0xa105('0x10')](_0xa105('0x21'),_0x1b051b,JSON[_0xa105('0x12')](_0x582bae));_0x1989bc(_0x582bae);})[_0xa105('0x17')](function(_0x33281d){logger[_0xa105('0x14')](_0xa105('0x21'),_0x33281d['message'],_0x1b051b);_0x28a323(_0x33dafd[_0xa105('0x14')](0x1f4,_0x33281d[_0xa105('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 159f6d0..d7afe12 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 _0xc3fb=['create','update','delete','destroy','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2eb509,_0x28cb43){var _0x201213=function(_0x26f0eb){while(--_0x26f0eb){_0x2eb509['push'](_0x2eb509['shift']());}};_0x201213(++_0x28cb43);}(_0xc3fb,0x1ea));var _0xbc3f=function(_0x459abc,_0x42a0bd){_0x459abc=_0x459abc-0x0;var _0x57f8c2=_0xc3fb[_0x459abc];return _0x57f8c2;};'use strict';var multer=require('multer');var util=require(_0xbc3f('0x0'));var path=require('path');var timeout=require(_0xbc3f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc3f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xbc3f('0x3'));var config=require(_0xbc3f('0x4'));var controller=require(_0xbc3f('0x5'));router[_0xbc3f('0x6')]('/',auth[_0xbc3f('0x7')](),controller['index']);router[_0xbc3f('0x6')](_0xbc3f('0x8'),auth[_0xbc3f('0x7')](),controller[_0xbc3f('0x9')]);router[_0xbc3f('0x6')]('/:id/fields',auth[_0xbc3f('0x7')](),controller[_0xbc3f('0xa')]);router[_0xbc3f('0x6')](_0xbc3f('0xb'),auth['isAuthenticated'](),controller[_0xbc3f('0xc')]);router[_0xbc3f('0x6')]('/:id/descriptions',auth[_0xbc3f('0x7')](),controller[_0xbc3f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbc3f('0xe')]);router['put'](_0xbc3f('0x8'),auth['isAuthenticated'](),controller[_0xbc3f('0xf')]);router[_0xbc3f('0x10')](_0xbc3f('0x8'),auth[_0xbc3f('0x7')](),controller[_0xbc3f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6a47=['getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6a47,0x84));var _0x76a4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6a47[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var path=require(_0x76a4('0x2'));var timeout=require(_0x76a4('0x3'));var express=require(_0x76a4('0x4'));var router=express[_0x76a4('0x5')]();var fs_extra=require(_0x76a4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x76a4('0x7'));var config=require(_0x76a4('0x8'));var controller=require(_0x76a4('0x9'));router[_0x76a4('0xa')]('/',auth[_0x76a4('0xb')](),controller[_0x76a4('0xc')]);router['get'](_0x76a4('0xd'),auth[_0x76a4('0xb')](),controller[_0x76a4('0xe')]);router[_0x76a4('0xa')]('/:id/fields',auth[_0x76a4('0xb')](),controller[_0x76a4('0xf')]);router[_0x76a4('0xa')](_0x76a4('0x10'),auth[_0x76a4('0xb')](),controller['getSubjects']);router[_0x76a4('0xa')](_0x76a4('0x11'),auth[_0x76a4('0xb')](),controller[_0x76a4('0x12')]);router[_0x76a4('0x13')]('/',auth[_0x76a4('0xb')](),controller[_0x76a4('0x14')]);router[_0x76a4('0x15')](_0x76a4('0xd'),auth['isAuthenticated'](),controller[_0x76a4('0x16')]);router[_0x76a4('0x17')](_0x76a4('0xd'),auth[_0x76a4('0xb')](),controller['destroy']);module[_0x76a4('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 90bf348..18797c4 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 _0x6339=['STRING','ENUM','incident','nothing','contact','sequelize','exports'];(function(_0x37c6d6,_0x4d2725){var _0x213805=function(_0x4e44f8){while(--_0x4e44f8){_0x37c6d6['push'](_0x37c6d6['shift']());}};_0x213805(++_0x4d2725);}(_0x6339,0x1cc));var _0x9633=function(_0x11a4c6,_0x56a0d6){_0x11a4c6=_0x11a4c6-0x0;var _0x4c1c5c=_0x6339[_0x11a4c6];return _0x4c1c5c;};'use strict';var Sequelize=require(_0x9633('0x0'));module[_0x9633('0x1')]={'name':{'type':Sequelize[_0x9633('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9633('0x3')](_0x9633('0x4'),'phonecall'),'defaultValue':_0x9633('0x4')},'moduleCreate':{'type':Sequelize[_0x9633('0x3')]('contact',_0x9633('0x5')),'defaultValue':_0x9633('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xbe5a=['contact','exports','STRING','ENUM','phonecall','incident'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0xbe5a,0x1bd));var _0xabe5=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xbe5a[_0x3e2fcf];return _0x497db7;};'use strict';var Sequelize=require('sequelize');module[_0xabe5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xabe5('0x1')]},'ticketType':{'type':Sequelize[_0xabe5('0x2')]('incident',_0xabe5('0x3')),'defaultValue':_0xabe5('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact','nothing'),'defaultValue':_0xabe5('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 064c418..d510330 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 _0x766b=['end','sendStatus','error','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','find','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then'];(function(_0x298de3,_0x43e88d){var _0x2bcf0a=function(_0x4ac970){while(--_0x4ac970){_0x298de3['push'](_0x298de3['shift']());}};_0x2bcf0a(++_0x43e88d);}(_0x766b,0xc7));var _0xb766=function(_0x1bf0f3,_0x27f333){_0x1bf0f3=_0x1bf0f3-0x0;var _0x5e2aca=_0x766b[_0x1bf0f3];return _0x5e2aca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb766('0x0'));var zipdir=require(_0xb766('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb766('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb766('0x3'));var util=require(_0xb766('0x4'));var path=require('path');var sox=require(_0xb766('0x5'));var csv=require(_0xb766('0x6'));var ejs=require(_0xb766('0x7'));var fs=require('fs');var fs_extra=require(_0xb766('0x8'));var _=require(_0xb766('0x9'));var squel=require(_0xb766('0xa'));var crypto=require(_0xb766('0xb'));var jsforce=require(_0xb766('0xc'));var deskjs=require(_0xb766('0xd'));var toCsv=require(_0xb766('0x6'));var querystring=require(_0xb766('0xe'));var Papa=require(_0xb766('0xf'));var Redis=require(_0xb766('0x10'));var authService=require(_0xb766('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb766('0x12'));var logger=require(_0xb766('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb766('0x14'));var licenseUtil=require(_0xb766('0x15'));var db=require(_0xb766('0x16'))['db'];function respondWithStatusCode(_0xefd227,_0x4d075d){_0x4d075d=_0x4d075d||0xcc;return function(_0x2948bd){if(_0x2948bd){return _0xefd227['sendStatus'](_0x4d075d);}return _0xefd227[_0xb766('0x17')](_0x4d075d)['end']();};}function respondWithResult(_0x4094c1,_0x2f1c9d){_0x2f1c9d=_0x2f1c9d||0xc8;return function(_0x803bdb){if(_0x803bdb){return _0x4094c1[_0xb766('0x17')](_0x2f1c9d)['json'](_0x803bdb);}};}function respondWithFilteredResult(_0x5a0755,_0x214976){return function(_0x4740c4){if(_0x4740c4){var _0x1878d5=typeof _0x214976[_0xb766('0x18')]===_0xb766('0x19')&&typeof _0x214976[_0xb766('0x1a')]===_0xb766('0x19');var _0x604122=_0x4740c4[_0xb766('0x1b')];var _0x5781be=_0x1878d5?0x0:_0x214976[_0xb766('0x18')];var _0x1cc528=_0x1878d5?_0x4740c4[_0xb766('0x1b')]:_0x214976[_0xb766('0x18')]+_0x214976['limit'];var _0x3c7da1;if(_0x1cc528>=_0x604122){_0x1cc528=_0x604122;_0x3c7da1=0xc8;}else{_0x3c7da1=0xce;}_0x5a0755['status'](_0x3c7da1);return _0x5a0755[_0xb766('0x1c')](_0xb766('0x1d'),_0x5781be+'-'+_0x1cc528+'/'+_0x604122)[_0xb766('0x1e')](_0x4740c4);}return null;};}function patchUpdates(_0x507996){return function(_0x5adf55){try{jsonpatch[_0xb766('0x1f')](_0x5adf55,_0x507996,!![]);}catch(_0x2c23f8){return BPromise[_0xb766('0x20')](_0x2c23f8);}return _0x5adf55['save']();};}function saveUpdates(_0x50539d,_0x4e82ff){return function(_0x3cd3d0){if(_0x3cd3d0){return _0x3cd3d0[_0xb766('0x21')](_0x50539d)['then'](function(_0x4eea73){return _0x4eea73;});}return null;};}function removeEntity(_0x5f5a91,_0x24cdfd){return function(_0x2df700){if(_0x2df700){return _0x2df700['destroy']()[_0xb766('0x22')](function(){_0x5f5a91[_0xb766('0x17')](0xcc)[_0xb766('0x23')]();});}};}function handleEntityNotFound(_0x2937a4,_0x8ac034){return function(_0x19b7bb){if(!_0x19b7bb){_0x2937a4[_0xb766('0x24')](0x194);}return _0x19b7bb;};}function handleError(_0x579ec1,_0x1b6e59){_0x1b6e59=_0x1b6e59||0x1f4;return function(_0x411bce){logger[_0xb766('0x25')](_0x411bce['stack']);if(_0x411bce[_0xb766('0x26')]){delete _0x411bce[_0xb766('0x26')];}_0x579ec1[_0xb766('0x17')](_0x1b6e59)[_0xb766('0x27')](_0x411bce);};}exports['index']=function(_0x487bad,_0x1b82b1){var _0xcdac2a={},_0x2d2797={},_0x1a3db0={'count':0x0,'rows':[]};var _0x1a2732=_['map'](db[_0xb766('0x28')][_0xb766('0x29')],function(_0x1be3e9){return{'name':_0x1be3e9[_0xb766('0x2a')],'type':_0x1be3e9[_0xb766('0x2b')]['key']};});_0x2d2797[_0xb766('0x2c')]=_[_0xb766('0x2d')](_0x1a2732,'name');_0x2d2797[_0xb766('0x2e')]=_[_0xb766('0x2f')](_0x487bad[_0xb766('0x2e')]);_0x2d2797[_0xb766('0x30')]=_['intersection'](_0x2d2797[_0xb766('0x2c')],_0x2d2797[_0xb766('0x2e')]);_0xcdac2a[_0xb766('0x31')]=_[_0xb766('0x32')](_0x2d2797[_0xb766('0x2c')],qs[_0xb766('0x33')](_0x487bad['query'][_0xb766('0x33')]));_0xcdac2a[_0xb766('0x31')]=_0xcdac2a[_0xb766('0x31')][_0xb766('0x34')]?_0xcdac2a[_0xb766('0x31')]:_0x2d2797[_0xb766('0x2c')];if(!_0x487bad[_0xb766('0x2e')][_0xb766('0x35')](_0xb766('0x36'))){_0xcdac2a[_0xb766('0x1a')]=qs[_0xb766('0x1a')](_0x487bad['query'][_0xb766('0x1a')]);_0xcdac2a['offset']=qs[_0xb766('0x18')](_0x487bad[_0xb766('0x2e')]['offset']);}_0xcdac2a[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x487bad[_0xb766('0x2e')][_0xb766('0x38')]);_0xcdac2a[_0xb766('0x39')]=qs[_0xb766('0x30')](_[_0xb766('0x3a')](_0x487bad[_0xb766('0x2e')],_0x2d2797[_0xb766('0x30')]),_0x1a2732);if(_0x487bad[_0xb766('0x2e')][_0xb766('0x3b')]){_0xcdac2a['where']=_[_0xb766('0x3c')](_0xcdac2a[_0xb766('0x39')],{'$or':_['map'](_0x1a2732,function(_0x5102b8){if(_0x5102b8['type']!==_0xb766('0x3d')){var _0x40cbe5={};_0x40cbe5[_0x5102b8['name']]={'$like':'%'+_0x487bad[_0xb766('0x2e')][_0xb766('0x3b')]+'%'};return _0x40cbe5;}})});}_0xcdac2a=_[_0xb766('0x3c')]({},_0xcdac2a,_0x487bad['options']);var _0x182b20={'where':_0xcdac2a[_0xb766('0x39')]};return db[_0xb766('0x28')][_0xb766('0x1b')](_0x182b20)['then'](function(_0x2b0a07){_0x1a3db0[_0xb766('0x1b')]=_0x2b0a07;if(_0x487bad[_0xb766('0x2e')][_0xb766('0x3e')]){_0xcdac2a[_0xb766('0x3f')]=[{'all':!![]}];}return db[_0xb766('0x28')][_0xb766('0x40')](_0xcdac2a);})[_0xb766('0x22')](function(_0x1007bb){_0x1a3db0[_0xb766('0x41')]=_0x1007bb;return _0x1a3db0;})['then'](respondWithFilteredResult(_0x1b82b1,_0xcdac2a))[_0xb766('0x42')](handleError(_0x1b82b1,null));};exports['show']=function(_0x21abf5,_0x50c3d2){var _0xacdbd5={'raw':![],'where':{'id':_0x21abf5[_0xb766('0x43')]['id']}},_0x2e0f0e={};_0x2e0f0e[_0xb766('0x2c')]=_['keys'](db[_0xb766('0x28')][_0xb766('0x29')]);_0x2e0f0e[_0xb766('0x2e')]=_[_0xb766('0x2f')](_0x21abf5[_0xb766('0x2e')]);_0x2e0f0e[_0xb766('0x30')]=_[_0xb766('0x32')](_0x2e0f0e[_0xb766('0x2c')],_0x2e0f0e[_0xb766('0x2e')]);_0xacdbd5[_0xb766('0x31')]=_[_0xb766('0x32')](_0x2e0f0e[_0xb766('0x2c')],qs[_0xb766('0x33')](_0x21abf5[_0xb766('0x2e')][_0xb766('0x33')]));_0xacdbd5['attributes']=_0xacdbd5['attributes'][_0xb766('0x34')]?_0xacdbd5[_0xb766('0x31')]:_0x2e0f0e[_0xb766('0x2c')];if(_0x21abf5[_0xb766('0x2e')][_0xb766('0x3e')]){_0xacdbd5[_0xb766('0x3f')]=[{'all':!![]}];}_0xacdbd5=_[_0xb766('0x3c')]({},_0xacdbd5,_0x21abf5[_0xb766('0x44')]);return db[_0xb766('0x28')]['find'](_0xacdbd5)['then'](handleEntityNotFound(_0x50c3d2,null))[_0xb766('0x22')](respondWithResult(_0x50c3d2,null))[_0xb766('0x42')](handleError(_0x50c3d2,null));};exports[_0xb766('0x45')]=function(_0x91fa9a,_0x23a98a){return db['Dynamics365Configuration'][_0xb766('0x45')](_0x91fa9a[_0xb766('0x46')],{})['then'](respondWithResult(_0x23a98a,0xc9))[_0xb766('0x42')](handleError(_0x23a98a,null));};exports[_0xb766('0x21')]=function(_0x449a0d,_0xd0d983){if(_0x449a0d[_0xb766('0x46')]['id']){delete _0x449a0d[_0xb766('0x46')]['id'];}return db['Dynamics365Configuration'][_0xb766('0x47')]({'where':{'id':_0x449a0d[_0xb766('0x43')]['id']}})[_0xb766('0x22')](handleEntityNotFound(_0xd0d983,null))[_0xb766('0x22')](saveUpdates(_0x449a0d['body'],null))[_0xb766('0x22')](respondWithResult(_0xd0d983,null))['catch'](handleError(_0xd0d983,null));};exports[_0xb766('0x48')]=function(_0x355b7e,_0x5db21f){return db[_0xb766('0x28')][_0xb766('0x47')]({'where':{'id':_0x355b7e[_0xb766('0x43')]['id']}})[_0xb766('0x22')](handleEntityNotFound(_0x5db21f,null))['then'](removeEntity(_0x5db21f,null))['catch'](handleError(_0x5db21f,null));};exports[_0xb766('0x49')]=function(_0x2ea156,_0x5730bc,_0x224b16){var _0x215f78={};var _0x1ef899={};var _0x40c4cf;var _0x275205;return db['Dynamics365Configuration'][_0xb766('0x4a')]({'where':{'id':_0x2ea156[_0xb766('0x43')]['id']}})['then'](handleEntityNotFound(_0x5730bc,null))['then'](function(_0x433246){if(_0x433246){_0x40c4cf=_0x433246;_0x1ef899[_0xb766('0x2c')]=_[_0xb766('0x2f')](db['Dynamics365Field'][_0xb766('0x29')]);_0x1ef899['query']=_['keys'](_0x2ea156['query']);_0x1ef899[_0xb766('0x30')]=_[_0xb766('0x32')](_0x1ef899[_0xb766('0x2c')],_0x1ef899[_0xb766('0x2e')]);_0x215f78[_0xb766('0x31')]=_['intersection'](_0x1ef899['model'],qs[_0xb766('0x33')](_0x2ea156[_0xb766('0x2e')][_0xb766('0x33')]));_0x215f78[_0xb766('0x31')]=_0x215f78[_0xb766('0x31')][_0xb766('0x34')]?_0x215f78[_0xb766('0x31')]:_0x1ef899[_0xb766('0x2c')];_0x215f78[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x2ea156[_0xb766('0x2e')][_0xb766('0x38')]);_0x215f78[_0xb766('0x39')]=qs[_0xb766('0x30')](_[_0xb766('0x3a')](_0x2ea156['query'],_0x1ef899[_0xb766('0x30')]));if(_0x2ea156[_0xb766('0x2e')][_0xb766('0x3b')]){_0x215f78['where']=_[_0xb766('0x3c')](_0x215f78[_0xb766('0x39')],{'$or':_[_0xb766('0x2d')](_0x215f78[_0xb766('0x31')],function(_0x4b41a3){var _0x103452={};_0x103452[_0x4b41a3]={'$like':'%'+_0x2ea156[_0xb766('0x2e')][_0xb766('0x3b')]+'%'};return _0x103452;})});}_0x215f78=_['merge']({},_0x215f78,_0x2ea156[_0xb766('0x44')]);return _0x40c4cf['getFields'](_0x215f78);}})[_0xb766('0x22')](function(_0x176866){if(_0x176866){_0x275205=_0x176866[_0xb766('0x34')];if(!_0x2ea156['query'][_0xb766('0x35')](_0xb766('0x36'))){_0x215f78[_0xb766('0x1a')]=qs['limit'](_0x2ea156['query'][_0xb766('0x1a')]);_0x215f78['offset']=qs[_0xb766('0x18')](_0x2ea156['query']['offset']);}return _0x40c4cf[_0xb766('0x49')](_0x215f78);}})['then'](function(_0x2b6725){if(_0x2b6725){return _0x2b6725?{'count':_0x275205,'rows':_0x2b6725}:null;}})[_0xb766('0x22')](respondWithResult(_0x5730bc,null))['catch'](handleError(_0x5730bc,null));};exports['getSubjects']=function(_0x5bf696,_0x726ddf,_0x358c49){var _0x26c488={};var _0x3fc5e6={};var _0x25ae05;var _0x1005d9;return db[_0xb766('0x28')]['findOne']({'where':{'id':_0x5bf696[_0xb766('0x43')]['id']}})[_0xb766('0x22')](handleEntityNotFound(_0x726ddf,null))['then'](function(_0x3b16ee){if(_0x3b16ee){_0x25ae05=_0x3b16ee;_0x3fc5e6['model']=_[_0xb766('0x2f')](db[_0xb766('0x4b')][_0xb766('0x29')]);_0x3fc5e6[_0xb766('0x2e')]=_['keys'](_0x5bf696[_0xb766('0x2e')]);_0x3fc5e6[_0xb766('0x30')]=_[_0xb766('0x32')](_0x3fc5e6['model'],_0x3fc5e6[_0xb766('0x2e')]);_0x26c488[_0xb766('0x31')]=_[_0xb766('0x32')](_0x3fc5e6[_0xb766('0x2c')],qs[_0xb766('0x33')](_0x5bf696[_0xb766('0x2e')][_0xb766('0x33')]));_0x26c488['attributes']=_0x26c488[_0xb766('0x31')]['length']?_0x26c488['attributes']:_0x3fc5e6[_0xb766('0x2c')];_0x26c488[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x5bf696[_0xb766('0x2e')][_0xb766('0x38')]);_0x26c488[_0xb766('0x39')]=qs[_0xb766('0x30')](_['pick'](_0x5bf696['query'],_0x3fc5e6[_0xb766('0x30')]));if(_0x5bf696[_0xb766('0x2e')][_0xb766('0x3b')]){_0x26c488[_0xb766('0x39')]=_['merge'](_0x26c488[_0xb766('0x39')],{'$or':_['map'](_0x26c488[_0xb766('0x31')],function(_0x5958d9){var _0x3d0fe4={};_0x3d0fe4[_0x5958d9]={'$like':'%'+_0x5bf696[_0xb766('0x2e')][_0xb766('0x3b')]+'%'};return _0x3d0fe4;})});}_0x26c488=_[_0xb766('0x3c')]({},_0x26c488,_0x5bf696[_0xb766('0x44')]);return _0x25ae05[_0xb766('0x4c')](_0x26c488);}})[_0xb766('0x22')](function(_0xe4e15e){if(_0xe4e15e){_0x1005d9=_0xe4e15e[_0xb766('0x34')];if(!_0x5bf696[_0xb766('0x2e')][_0xb766('0x35')](_0xb766('0x36'))){_0x26c488[_0xb766('0x1a')]=qs[_0xb766('0x1a')](_0x5bf696[_0xb766('0x2e')][_0xb766('0x1a')]);_0x26c488[_0xb766('0x18')]=qs[_0xb766('0x18')](_0x5bf696[_0xb766('0x2e')][_0xb766('0x18')]);}return _0x25ae05['getSubjects'](_0x26c488);}})[_0xb766('0x22')](function(_0x87c65d){if(_0x87c65d){return _0x87c65d?{'count':_0x1005d9,'rows':_0x87c65d}:null;}})['then'](respondWithResult(_0x726ddf,null))[_0xb766('0x42')](handleError(_0x726ddf,null));};exports[_0xb766('0x4d')]=function(_0x4311d2,_0x5ef5f2,_0x45443d){var _0x8b3f4={};var _0x5b5915={};var _0x57074a;var _0x249f7b;return db[_0xb766('0x28')][_0xb766('0x4a')]({'where':{'id':_0x4311d2[_0xb766('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ef5f2,null))['then'](function(_0x4e6652){if(_0x4e6652){_0x57074a=_0x4e6652;_0x5b5915[_0xb766('0x2c')]=_[_0xb766('0x2f')](db[_0xb766('0x4b')][_0xb766('0x29')]);_0x5b5915[_0xb766('0x2e')]=_[_0xb766('0x2f')](_0x4311d2[_0xb766('0x2e')]);_0x5b5915[_0xb766('0x30')]=_[_0xb766('0x32')](_0x5b5915[_0xb766('0x2c')],_0x5b5915[_0xb766('0x2e')]);_0x8b3f4[_0xb766('0x31')]=_[_0xb766('0x32')](_0x5b5915[_0xb766('0x2c')],qs[_0xb766('0x33')](_0x4311d2[_0xb766('0x2e')][_0xb766('0x33')]));_0x8b3f4[_0xb766('0x31')]=_0x8b3f4['attributes'][_0xb766('0x34')]?_0x8b3f4[_0xb766('0x31')]:_0x5b5915[_0xb766('0x2c')];_0x8b3f4[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x4311d2['query'][_0xb766('0x38')]);_0x8b3f4[_0xb766('0x39')]=qs[_0xb766('0x30')](_[_0xb766('0x3a')](_0x4311d2[_0xb766('0x2e')],_0x5b5915[_0xb766('0x30')]));if(_0x4311d2[_0xb766('0x2e')][_0xb766('0x3b')]){_0x8b3f4[_0xb766('0x39')]=_[_0xb766('0x3c')](_0x8b3f4['where'],{'$or':_[_0xb766('0x2d')](_0x8b3f4[_0xb766('0x31')],function(_0x2bc370){var _0x4f26ca={};_0x4f26ca[_0x2bc370]={'$like':'%'+_0x4311d2['query'][_0xb766('0x3b')]+'%'};return _0x4f26ca;})});}_0x8b3f4=_[_0xb766('0x3c')]({},_0x8b3f4,_0x4311d2['options']);return _0x57074a['getDescriptions'](_0x8b3f4);}})[_0xb766('0x22')](function(_0x169c4b){if(_0x169c4b){_0x249f7b=_0x169c4b[_0xb766('0x34')];if(!_0x4311d2[_0xb766('0x2e')][_0xb766('0x35')](_0xb766('0x36'))){_0x8b3f4[_0xb766('0x1a')]=qs[_0xb766('0x1a')](_0x4311d2['query'][_0xb766('0x1a')]);_0x8b3f4['offset']=qs[_0xb766('0x18')](_0x4311d2[_0xb766('0x2e')]['offset']);}return _0x57074a['getDescriptions'](_0x8b3f4);}})[_0xb766('0x22')](function(_0x167ea7){if(_0x167ea7){return _0x167ea7?{'count':_0x249f7b,'rows':_0x167ea7}:null;}})['then'](respondWithResult(_0x5ef5f2,null))[_0xb766('0x42')](handleError(_0x5ef5f2,null));}; \ No newline at end of file +var _0x70bd=['getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','error','stack','name','send','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','Dynamics365Configuration','include','findAll','rows','includeAll','find','catch','create','body','destroy','params','getFields','findOne','Dynamics365Field','sort','getSubjects','rawAttributes'];(function(_0x21c662,_0x4cc5d0){var _0x3aaade=function(_0xc178d6){while(--_0xc178d6){_0x21c662['push'](_0x21c662['shift']());}};_0x3aaade(++_0x4cc5d0);}(_0x70bd,0x139));var _0xd70b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x70bd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xd70b('0x0'));var rimraf=require(_0xd70b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd70b('0x2'));var rp=require(_0xd70b('0x3'));var moment=require(_0xd70b('0x4'));var BPromise=require(_0xd70b('0x5'));var Mustache=require(_0xd70b('0x6'));var util=require('util');var path=require(_0xd70b('0x7'));var sox=require('sox');var csv=require(_0xd70b('0x8'));var ejs=require(_0xd70b('0x9'));var fs=require('fs');var fs_extra=require(_0xd70b('0xa'));var _=require(_0xd70b('0xb'));var squel=require(_0xd70b('0xc'));var crypto=require(_0xd70b('0xd'));var jsforce=require(_0xd70b('0xe'));var deskjs=require(_0xd70b('0xf'));var toCsv=require(_0xd70b('0x8'));var querystring=require('querystring');var Papa=require(_0xd70b('0x10'));var Redis=require(_0xd70b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd70b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd70b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd70b('0x14'));var db=require(_0xd70b('0x15'))['db'];function respondWithStatusCode(_0x5475db,_0x1c5888){_0x1c5888=_0x1c5888||0xcc;return function(_0x4731d2){if(_0x4731d2){return _0x5475db[_0xd70b('0x16')](_0x1c5888);}return _0x5475db[_0xd70b('0x17')](_0x1c5888)[_0xd70b('0x18')]();};}function respondWithResult(_0x2fd14c,_0x12da05){_0x12da05=_0x12da05||0xc8;return function(_0x1a75f4){if(_0x1a75f4){return _0x2fd14c[_0xd70b('0x17')](_0x12da05)[_0xd70b('0x19')](_0x1a75f4);}};}function respondWithFilteredResult(_0x19f0b0,_0x570db2){return function(_0x377fed){if(_0x377fed){var _0x2574a7=typeof _0x570db2['offset']==='undefined'&&typeof _0x570db2['limit']===_0xd70b('0x1a');var _0x269bf6=_0x377fed[_0xd70b('0x1b')];var _0x3d83bf=_0x2574a7?0x0:_0x570db2[_0xd70b('0x1c')];var _0x27faca=_0x2574a7?_0x377fed['count']:_0x570db2[_0xd70b('0x1c')]+_0x570db2[_0xd70b('0x1d')];var _0x43b42a;if(_0x27faca>=_0x269bf6){_0x27faca=_0x269bf6;_0x43b42a=0xc8;}else{_0x43b42a=0xce;}_0x19f0b0['status'](_0x43b42a);return _0x19f0b0['set']('Content-Range',_0x3d83bf+'-'+_0x27faca+'/'+_0x269bf6)[_0xd70b('0x19')](_0x377fed);}return null;};}function patchUpdates(_0x53ff0c){return function(_0x1c5957){try{jsonpatch[_0xd70b('0x1e')](_0x1c5957,_0x53ff0c,!![]);}catch(_0x5757f0){return BPromise[_0xd70b('0x1f')](_0x5757f0);}return _0x1c5957[_0xd70b('0x20')]();};}function saveUpdates(_0x18ecfd,_0x10df05){return function(_0x5ccd6c){if(_0x5ccd6c){return _0x5ccd6c[_0xd70b('0x21')](_0x18ecfd)[_0xd70b('0x22')](function(_0x93189b){return _0x93189b;});}return null;};}function removeEntity(_0x1503ab,_0xcfa74e){return function(_0x6b6db4){if(_0x6b6db4){return _0x6b6db4['destroy']()[_0xd70b('0x22')](function(){_0x1503ab[_0xd70b('0x17')](0xcc)[_0xd70b('0x18')]();});}};}function handleEntityNotFound(_0x7cd33d,_0x55d203){return function(_0x12bca3){if(!_0x12bca3){_0x7cd33d[_0xd70b('0x16')](0x194);}return _0x12bca3;};}function handleError(_0x4acaf1,_0x59721e){_0x59721e=_0x59721e||0x1f4;return function(_0x294d51){logger[_0xd70b('0x23')](_0x294d51[_0xd70b('0x24')]);if(_0x294d51[_0xd70b('0x25')]){delete _0x294d51[_0xd70b('0x25')];}_0x4acaf1[_0xd70b('0x17')](_0x59721e)[_0xd70b('0x26')](_0x294d51);};}exports['index']=function(_0x211bcb,_0x224f90){var _0xc5bc16={},_0x48a227={},_0xe5ed1a={'count':0x0,'rows':[]};var _0x33cfdc=_[_0xd70b('0x27')](db['Dynamics365Configuration']['rawAttributes'],function(_0x200fb8){return{'name':_0x200fb8[_0xd70b('0x28')],'type':_0x200fb8[_0xd70b('0x29')][_0xd70b('0x2a')]};});_0x48a227['model']=_['map'](_0x33cfdc,_0xd70b('0x25'));_0x48a227[_0xd70b('0x2b')]=_[_0xd70b('0x2c')](_0x211bcb[_0xd70b('0x2b')]);_0x48a227[_0xd70b('0x2d')]=_['intersection'](_0x48a227[_0xd70b('0x2e')],_0x48a227[_0xd70b('0x2b')]);_0xc5bc16[_0xd70b('0x2f')]=_[_0xd70b('0x30')](_0x48a227['model'],qs[_0xd70b('0x31')](_0x211bcb[_0xd70b('0x2b')]['fields']));_0xc5bc16[_0xd70b('0x2f')]=_0xc5bc16[_0xd70b('0x2f')][_0xd70b('0x32')]?_0xc5bc16['attributes']:_0x48a227[_0xd70b('0x2e')];if(!_0x211bcb[_0xd70b('0x2b')][_0xd70b('0x33')](_0xd70b('0x34'))){_0xc5bc16[_0xd70b('0x1d')]=qs[_0xd70b('0x1d')](_0x211bcb['query'][_0xd70b('0x1d')]);_0xc5bc16['offset']=qs['offset'](_0x211bcb['query']['offset']);}_0xc5bc16[_0xd70b('0x35')]=qs['sort'](_0x211bcb[_0xd70b('0x2b')]['sort']);_0xc5bc16[_0xd70b('0x36')]=qs[_0xd70b('0x2d')](_[_0xd70b('0x37')](_0x211bcb[_0xd70b('0x2b')],_0x48a227[_0xd70b('0x2d')]),_0x33cfdc);if(_0x211bcb['query']['filter']){_0xc5bc16[_0xd70b('0x36')]=_[_0xd70b('0x38')](_0xc5bc16[_0xd70b('0x36')],{'$or':_[_0xd70b('0x27')](_0x33cfdc,function(_0x119072){if(_0x119072[_0xd70b('0x29')]!==_0xd70b('0x39')){var _0xdb2404={};_0xdb2404[_0x119072[_0xd70b('0x25')]]={'$like':'%'+_0x211bcb[_0xd70b('0x2b')][_0xd70b('0x3a')]+'%'};return _0xdb2404;}})});}_0xc5bc16=_['merge']({},_0xc5bc16,_0x211bcb[_0xd70b('0x3b')]);var _0x2e4616={'where':_0xc5bc16[_0xd70b('0x36')]};return db[_0xd70b('0x3c')][_0xd70b('0x1b')](_0x2e4616)['then'](function(_0x4ee0c6){_0xe5ed1a[_0xd70b('0x1b')]=_0x4ee0c6;if(_0x211bcb[_0xd70b('0x2b')]['includeAll']){_0xc5bc16[_0xd70b('0x3d')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd70b('0x3e')](_0xc5bc16);})['then'](function(_0x3b2946){_0xe5ed1a[_0xd70b('0x3f')]=_0x3b2946;return _0xe5ed1a;})['then'](respondWithFilteredResult(_0x224f90,_0xc5bc16))['catch'](handleError(_0x224f90,null));};exports['show']=function(_0x4d2421,_0x1693f5){var _0x30cb87={'raw':![],'where':{'id':_0x4d2421['params']['id']}},_0x476dc2={};_0x476dc2[_0xd70b('0x2e')]=_[_0xd70b('0x2c')](db[_0xd70b('0x3c')]['rawAttributes']);_0x476dc2[_0xd70b('0x2b')]=_[_0xd70b('0x2c')](_0x4d2421[_0xd70b('0x2b')]);_0x476dc2['filters']=_['intersection'](_0x476dc2[_0xd70b('0x2e')],_0x476dc2[_0xd70b('0x2b')]);_0x30cb87['attributes']=_[_0xd70b('0x30')](_0x476dc2[_0xd70b('0x2e')],qs[_0xd70b('0x31')](_0x4d2421[_0xd70b('0x2b')][_0xd70b('0x31')]));_0x30cb87[_0xd70b('0x2f')]=_0x30cb87['attributes'][_0xd70b('0x32')]?_0x30cb87[_0xd70b('0x2f')]:_0x476dc2[_0xd70b('0x2e')];if(_0x4d2421[_0xd70b('0x2b')][_0xd70b('0x40')]){_0x30cb87['include']=[{'all':!![]}];}_0x30cb87=_[_0xd70b('0x38')]({},_0x30cb87,_0x4d2421[_0xd70b('0x3b')]);return db[_0xd70b('0x3c')][_0xd70b('0x41')](_0x30cb87)[_0xd70b('0x22')](handleEntityNotFound(_0x1693f5,null))[_0xd70b('0x22')](respondWithResult(_0x1693f5,null))[_0xd70b('0x42')](handleError(_0x1693f5,null));};exports[_0xd70b('0x43')]=function(_0x5e8237,_0x4ad002){return db[_0xd70b('0x3c')][_0xd70b('0x43')](_0x5e8237['body'],{})[_0xd70b('0x22')](respondWithResult(_0x4ad002,0xc9))['catch'](handleError(_0x4ad002,null));};exports[_0xd70b('0x21')]=function(_0x2c9ee3,_0x3994e1){if(_0x2c9ee3[_0xd70b('0x44')]['id']){delete _0x2c9ee3['body']['id'];}return db[_0xd70b('0x3c')][_0xd70b('0x41')]({'where':{'id':_0x2c9ee3['params']['id']}})[_0xd70b('0x22')](handleEntityNotFound(_0x3994e1,null))['then'](saveUpdates(_0x2c9ee3[_0xd70b('0x44')],null))[_0xd70b('0x22')](respondWithResult(_0x3994e1,null))[_0xd70b('0x42')](handleError(_0x3994e1,null));};exports[_0xd70b('0x45')]=function(_0x12c11b,_0x5f2b44){return db[_0xd70b('0x3c')][_0xd70b('0x41')]({'where':{'id':_0x12c11b[_0xd70b('0x46')]['id']}})[_0xd70b('0x22')](handleEntityNotFound(_0x5f2b44,null))['then'](removeEntity(_0x5f2b44,null))[_0xd70b('0x42')](handleError(_0x5f2b44,null));};exports[_0xd70b('0x47')]=function(_0x31ea60,_0x29fb7e,_0x3290b4){var _0x573b9f={};var _0x106a5e={};var _0x14a7d6;var _0x48cc22;return db[_0xd70b('0x3c')][_0xd70b('0x48')]({'where':{'id':_0x31ea60[_0xd70b('0x46')]['id']}})['then'](handleEntityNotFound(_0x29fb7e,null))['then'](function(_0x240cf2){if(_0x240cf2){_0x14a7d6=_0x240cf2;_0x106a5e[_0xd70b('0x2e')]=_[_0xd70b('0x2c')](db[_0xd70b('0x49')]['rawAttributes']);_0x106a5e[_0xd70b('0x2b')]=_[_0xd70b('0x2c')](_0x31ea60[_0xd70b('0x2b')]);_0x106a5e[_0xd70b('0x2d')]=_[_0xd70b('0x30')](_0x106a5e[_0xd70b('0x2e')],_0x106a5e[_0xd70b('0x2b')]);_0x573b9f[_0xd70b('0x2f')]=_['intersection'](_0x106a5e[_0xd70b('0x2e')],qs['fields'](_0x31ea60[_0xd70b('0x2b')]['fields']));_0x573b9f['attributes']=_0x573b9f['attributes'][_0xd70b('0x32')]?_0x573b9f[_0xd70b('0x2f')]:_0x106a5e[_0xd70b('0x2e')];_0x573b9f[_0xd70b('0x35')]=qs[_0xd70b('0x4a')](_0x31ea60[_0xd70b('0x2b')][_0xd70b('0x4a')]);_0x573b9f[_0xd70b('0x36')]=qs[_0xd70b('0x2d')](_[_0xd70b('0x37')](_0x31ea60[_0xd70b('0x2b')],_0x106a5e[_0xd70b('0x2d')]));if(_0x31ea60[_0xd70b('0x2b')]['filter']){_0x573b9f[_0xd70b('0x36')]=_['merge'](_0x573b9f[_0xd70b('0x36')],{'$or':_[_0xd70b('0x27')](_0x573b9f['attributes'],function(_0x30a536){var _0x14b5ae={};_0x14b5ae[_0x30a536]={'$like':'%'+_0x31ea60[_0xd70b('0x2b')][_0xd70b('0x3a')]+'%'};return _0x14b5ae;})});}_0x573b9f=_[_0xd70b('0x38')]({},_0x573b9f,_0x31ea60['options']);return _0x14a7d6[_0xd70b('0x47')](_0x573b9f);}})[_0xd70b('0x22')](function(_0x3527e4){if(_0x3527e4){_0x48cc22=_0x3527e4[_0xd70b('0x32')];if(!_0x31ea60['query']['hasOwnProperty'](_0xd70b('0x34'))){_0x573b9f[_0xd70b('0x1d')]=qs[_0xd70b('0x1d')](_0x31ea60[_0xd70b('0x2b')][_0xd70b('0x1d')]);_0x573b9f['offset']=qs[_0xd70b('0x1c')](_0x31ea60[_0xd70b('0x2b')][_0xd70b('0x1c')]);}return _0x14a7d6[_0xd70b('0x47')](_0x573b9f);}})[_0xd70b('0x22')](function(_0x7a6f1f){if(_0x7a6f1f){return _0x7a6f1f?{'count':_0x48cc22,'rows':_0x7a6f1f}:null;}})[_0xd70b('0x22')](respondWithResult(_0x29fb7e,null))[_0xd70b('0x42')](handleError(_0x29fb7e,null));};exports['getSubjects']=function(_0x342e6f,_0x9b7d54,_0x1ed2b6){var _0xfe6e6a={};var _0x49823f={};var _0x4f7c0a;var _0x36e08a;return db[_0xd70b('0x3c')][_0xd70b('0x48')]({'where':{'id':_0x342e6f[_0xd70b('0x46')]['id']}})[_0xd70b('0x22')](handleEntityNotFound(_0x9b7d54,null))[_0xd70b('0x22')](function(_0xe7801c){if(_0xe7801c){_0x4f7c0a=_0xe7801c;_0x49823f[_0xd70b('0x2e')]=_[_0xd70b('0x2c')](db['Dynamics365Field']['rawAttributes']);_0x49823f[_0xd70b('0x2b')]=_['keys'](_0x342e6f['query']);_0x49823f[_0xd70b('0x2d')]=_['intersection'](_0x49823f[_0xd70b('0x2e')],_0x49823f[_0xd70b('0x2b')]);_0xfe6e6a['attributes']=_[_0xd70b('0x30')](_0x49823f[_0xd70b('0x2e')],qs[_0xd70b('0x31')](_0x342e6f[_0xd70b('0x2b')]['fields']));_0xfe6e6a[_0xd70b('0x2f')]=_0xfe6e6a[_0xd70b('0x2f')][_0xd70b('0x32')]?_0xfe6e6a['attributes']:_0x49823f[_0xd70b('0x2e')];_0xfe6e6a['order']=qs['sort'](_0x342e6f[_0xd70b('0x2b')][_0xd70b('0x4a')]);_0xfe6e6a[_0xd70b('0x36')]=qs['filters'](_[_0xd70b('0x37')](_0x342e6f[_0xd70b('0x2b')],_0x49823f['filters']));if(_0x342e6f['query'][_0xd70b('0x3a')]){_0xfe6e6a['where']=_[_0xd70b('0x38')](_0xfe6e6a[_0xd70b('0x36')],{'$or':_[_0xd70b('0x27')](_0xfe6e6a[_0xd70b('0x2f')],function(_0x566e1c){var _0x4258ce={};_0x4258ce[_0x566e1c]={'$like':'%'+_0x342e6f[_0xd70b('0x2b')][_0xd70b('0x3a')]+'%'};return _0x4258ce;})});}_0xfe6e6a=_[_0xd70b('0x38')]({},_0xfe6e6a,_0x342e6f[_0xd70b('0x3b')]);return _0x4f7c0a[_0xd70b('0x4b')](_0xfe6e6a);}})[_0xd70b('0x22')](function(_0x2526c7){if(_0x2526c7){_0x36e08a=_0x2526c7[_0xd70b('0x32')];if(!_0x342e6f[_0xd70b('0x2b')]['hasOwnProperty']('nolimit')){_0xfe6e6a[_0xd70b('0x1d')]=qs[_0xd70b('0x1d')](_0x342e6f['query'][_0xd70b('0x1d')]);_0xfe6e6a[_0xd70b('0x1c')]=qs['offset'](_0x342e6f[_0xd70b('0x2b')][_0xd70b('0x1c')]);}return _0x4f7c0a[_0xd70b('0x4b')](_0xfe6e6a);}})['then'](function(_0x3b49cb){if(_0x3b49cb){return _0x3b49cb?{'count':_0x36e08a,'rows':_0x3b49cb}:null;}})[_0xd70b('0x22')](respondWithResult(_0x9b7d54,null))[_0xd70b('0x42')](handleError(_0x9b7d54,null));};exports['getDescriptions']=function(_0x1c7dd5,_0x3a57bc,_0xd3a7bf){var _0x541b72={};var _0x6509a8={};var _0x2d8b0f;var _0x41dcea;return db[_0xd70b('0x3c')][_0xd70b('0x48')]({'where':{'id':_0x1c7dd5[_0xd70b('0x46')]['id']}})[_0xd70b('0x22')](handleEntityNotFound(_0x3a57bc,null))[_0xd70b('0x22')](function(_0x23dc6f){if(_0x23dc6f){_0x2d8b0f=_0x23dc6f;_0x6509a8[_0xd70b('0x2e')]=_[_0xd70b('0x2c')](db[_0xd70b('0x49')][_0xd70b('0x4c')]);_0x6509a8[_0xd70b('0x2b')]=_['keys'](_0x1c7dd5[_0xd70b('0x2b')]);_0x6509a8[_0xd70b('0x2d')]=_[_0xd70b('0x30')](_0x6509a8[_0xd70b('0x2e')],_0x6509a8['query']);_0x541b72[_0xd70b('0x2f')]=_['intersection'](_0x6509a8['model'],qs[_0xd70b('0x31')](_0x1c7dd5[_0xd70b('0x2b')]['fields']));_0x541b72[_0xd70b('0x2f')]=_0x541b72['attributes'][_0xd70b('0x32')]?_0x541b72[_0xd70b('0x2f')]:_0x6509a8[_0xd70b('0x2e')];_0x541b72['order']=qs[_0xd70b('0x4a')](_0x1c7dd5['query']['sort']);_0x541b72[_0xd70b('0x36')]=qs[_0xd70b('0x2d')](_[_0xd70b('0x37')](_0x1c7dd5[_0xd70b('0x2b')],_0x6509a8[_0xd70b('0x2d')]));if(_0x1c7dd5[_0xd70b('0x2b')][_0xd70b('0x3a')]){_0x541b72[_0xd70b('0x36')]=_[_0xd70b('0x38')](_0x541b72[_0xd70b('0x36')],{'$or':_['map'](_0x541b72[_0xd70b('0x2f')],function(_0x40500b){var _0x350567={};_0x350567[_0x40500b]={'$like':'%'+_0x1c7dd5[_0xd70b('0x2b')][_0xd70b('0x3a')]+'%'};return _0x350567;})});}_0x541b72=_[_0xd70b('0x38')]({},_0x541b72,_0x1c7dd5['options']);return _0x2d8b0f[_0xd70b('0x4d')](_0x541b72);}})[_0xd70b('0x22')](function(_0x53ea36){if(_0x53ea36){_0x41dcea=_0x53ea36['length'];if(!_0x1c7dd5['query'][_0xd70b('0x33')](_0xd70b('0x34'))){_0x541b72[_0xd70b('0x1d')]=qs['limit'](_0x1c7dd5[_0xd70b('0x2b')]['limit']);_0x541b72[_0xd70b('0x1c')]=qs[_0xd70b('0x1c')](_0x1c7dd5[_0xd70b('0x2b')][_0xd70b('0x1c')]);}return _0x2d8b0f[_0xd70b('0x4d')](_0x541b72);}})[_0xd70b('0x22')](function(_0x492e00){if(_0x492e00){return _0x492e00?{'count':_0x41dcea,'rows':_0x492e00}:null;}})[_0xd70b('0x22')](respondWithResult(_0x3a57bc,null))['catch'](handleError(_0x3a57bc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9a618f2..c946295 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2b9f8e,_0x2ac519){var _0x118621=function(_0x444c4e){while(--_0x444c4e){_0x2b9f8e['push'](_0x2b9f8e['shift']());}};_0x118621(++_0x2ac519);}(_0xdace,0xc5));var _0xedac=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xdace[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x573c09,_0xc9c0){var _0x15e046=function(_0x88a736){while(--_0x88a736){_0x573c09['push'](_0x573c09['shift']());}};_0x15e046(++_0xc9c0);}(_0x5b02,0xe9));var _0x25b0=function(_0x51a130,_0x2bbb8d){_0x51a130=_0x51a130-0x0;var _0x900c03=_0x5b02[_0x51a130];return _0x900c03;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','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 5a6af03..eb3fdae 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 _0xdd2c=['Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd2c,0xc6));var _0xcdd2=function(_0x267691,_0x30eacf){_0x267691=_0x267691-0x0;var _0x82c191=_0xdd2c[_0x267691];return _0x82c191;};'use strict';var _=require('lodash');var util=require(_0xcdd2('0x0'));var moment=require(_0xcdd2('0x1'));var BPromise=require('bluebird');var rs=require(_0xcdd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdd2('0x3'))['db'];var utils=require(_0xcdd2('0x4'));var logger=require('../../config/logger')(_0xcdd2('0x5'));var config=require(_0xcdd2('0x6'));var jayson=require(_0xcdd2('0x7'));var client=jayson['client'][_0xcdd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x80f674,_0x33528a,_0x5f152c){return new BPromise(function(_0x2fae80,_0x2347d9){return client[_0xcdd2('0x9')](_0x80f674,_0x5f152c)[_0xcdd2('0xa')](function(_0x47d6ca){logger[_0xcdd2('0xb')](_0xcdd2('0xc'),_0x33528a,'request\x20sent');logger[_0xcdd2('0xd')](_0xcdd2('0xe'),_0x33528a,_0xcdd2('0xf'),JSON[_0xcdd2('0x10')](_0x47d6ca));if(_0x47d6ca[_0xcdd2('0x11')]){if(_0x47d6ca[_0xcdd2('0x11')][_0xcdd2('0x12')]===0x1f4){logger[_0xcdd2('0x11')](_0xcdd2('0xc'),_0x33528a,_0x47d6ca[_0xcdd2('0x11')][_0xcdd2('0x13')]);return _0x2347d9(_0x47d6ca[_0xcdd2('0x11')][_0xcdd2('0x13')]);}logger[_0xcdd2('0x11')](_0xcdd2('0xc'),_0x33528a,_0x47d6ca['error'][_0xcdd2('0x13')]);return _0x2fae80(_0x47d6ca[_0xcdd2('0x11')][_0xcdd2('0x13')]);}else{logger[_0xcdd2('0xb')](_0xcdd2('0xc'),_0x33528a,_0xcdd2('0xf'));_0x2fae80(_0x47d6ca['result'][_0xcdd2('0x13')]);}})[_0xcdd2('0x14')](function(_0x3e0a1b){logger[_0xcdd2('0x11')](_0xcdd2('0xc'),_0x33528a,_0x3e0a1b);_0x2347d9(_0x3e0a1b);});});} \ No newline at end of file +var _0x38c9=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x42cd2f,_0x4088fb){var _0x571015=function(_0x3c54ad){while(--_0x3c54ad){_0x42cd2f['push'](_0x42cd2f['shift']());}};_0x571015(++_0x4088fb);}(_0x38c9,0x95));var _0x938c=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x38c9[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0x938c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x938c('0x1'));var fs=require('fs');var Redis=require(_0x938c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x938c('0x3'));var logger=require(_0x938c('0x4'))(_0x938c('0x5'));var config=require(_0x938c('0x6'));var jayson=require(_0x938c('0x7'));var client=jayson['client'][_0x938c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30b732,_0x28f220,_0x1c9440){return new BPromise(function(_0x11e92b,_0x11225e){return client[_0x938c('0x9')](_0x30b732,_0x1c9440)['then'](function(_0x37ed50){logger[_0x938c('0xa')](_0x938c('0xb'),_0x28f220,_0x938c('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x28f220,'request\x20sent',JSON['stringify'](_0x37ed50));if(_0x37ed50['error']){if(_0x37ed50['error']['code']===0x1f4){logger[_0x938c('0xd')](_0x938c('0xb'),_0x28f220,_0x37ed50[_0x938c('0xd')][_0x938c('0xe')]);return _0x11225e(_0x37ed50[_0x938c('0xd')][_0x938c('0xe')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x28f220,_0x37ed50[_0x938c('0xd')][_0x938c('0xe')]);return _0x11e92b(_0x37ed50[_0x938c('0xd')][_0x938c('0xe')]);}else{logger[_0x938c('0xa')](_0x938c('0xb'),_0x28f220,_0x938c('0xc'));_0x11e92b(_0x37ed50['result'][_0x938c('0xe')]);}})[_0x938c('0xf')](function(_0x37412e){logger['error'](_0x938c('0xb'),_0x28f220,_0x37412e);_0x11225e(_0x37412e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5910f3f..db33488 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 _0xcbaf=['destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','show','post','create','put','delete'];(function(_0x503d37,_0x315c0a){var _0x5c1f2f=function(_0x44945e){while(--_0x44945e){_0x503d37['push'](_0x503d37['shift']());}};_0x5c1f2f(++_0x315c0a);}(_0xcbaf,0x111));var _0xfcba=function(_0x2666be,_0x196675){_0x2666be=_0x2666be-0x0;var _0x433228=_0xcbaf[_0x2666be];return _0x433228;};'use strict';var multer=require(_0xfcba('0x0'));var util=require(_0xfcba('0x1'));var path=require(_0xfcba('0x2'));var timeout=require(_0xfcba('0x3'));var express=require('express');var router=express[_0xfcba('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfcba('0x5'));var config=require(_0xfcba('0x6'));var controller=require(_0xfcba('0x7'));router['get']('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0x9')]);router[_0xfcba('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xfcba('0xb')]);router[_0xfcba('0xc')]('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0xd')]);router[_0xfcba('0xe')]('/:id',auth[_0xfcba('0x8')](),controller['update']);router[_0xfcba('0xf')]('/:id',auth[_0xfcba('0x8')](),controller[_0xfcba('0x10')]);module['exports']=router; \ No newline at end of file +var _0x19ae=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19ae,0x8b));var _0xe19a=function(_0x420995,_0x1039da){_0x420995=_0x420995-0x0;var _0xe368fa=_0x19ae[_0x420995];return _0xe368fa;};'use strict';var multer=require(_0xe19a('0x0'));var util=require(_0xe19a('0x1'));var path=require(_0xe19a('0x2'));var timeout=require(_0xe19a('0x3'));var express=require(_0xe19a('0x4'));var router=express[_0xe19a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe19a('0x6'));var interaction=require(_0xe19a('0x7'));var config=require(_0xe19a('0x8'));var controller=require('./intDynamics365Field.controller');router[_0xe19a('0x9')]('/',auth[_0xe19a('0xa')](),controller[_0xe19a('0xb')]);router[_0xe19a('0x9')](_0xe19a('0xc'),auth[_0xe19a('0xa')](),controller[_0xe19a('0xd')]);router[_0xe19a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe19a('0xf')](_0xe19a('0xc'),auth[_0xe19a('0xa')](),controller['update']);router[_0xe19a('0x10')]('/:id',auth[_0xe19a('0xa')](),controller[_0xe19a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8b21a11..0108518 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 _0x2902=['variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0xf197e,_0x310e4f){var _0x4b2994=function(_0x1571c2){while(--_0x1571c2){_0xf197e['push'](_0xf197e['shift']());}};_0x4b2994(++_0x310e4f);}(_0x2902,0x192));var _0x2290=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x2902[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x2290('0x0'));module[_0x2290('0x1')]={'type':{'type':Sequelize[_0x2290('0x2')]('string',_0x2290('0x3'),_0x2290('0x4'),_0x2290('0x5'),'picklist'),'defaultValue':_0x2290('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2290('0x7')]},'keyType':{'type':Sequelize[_0x2290('0x2')]('string',_0x2290('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x2290('0x7')]},'idField':{'type':Sequelize[_0x2290('0x7')]},'nameField':{'type':Sequelize[_0x2290('0x7')]},'customField':{'type':Sequelize[_0x2290('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2290('0x7')]}}; \ No newline at end of file +var _0x1a7b=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string'];(function(_0x5a257b,_0xa7d20b){var _0x3a8288=function(_0x5ceee2){while(--_0x5ceee2){_0x5a257b['push'](_0x5a257b['shift']());}};_0x3a8288(++_0xa7d20b);}(_0x1a7b,0x146));var _0xb1a7=function(_0x57d5c1,_0x55a5ef){_0x57d5c1=_0x57d5c1-0x0;var _0x4347c1=_0x1a7b[_0x57d5c1];return _0x4347c1;};'use strict';var Sequelize=require(_0xb1a7('0x0'));module[_0xb1a7('0x1')]={'type':{'type':Sequelize[_0xb1a7('0x2')]('string',_0xb1a7('0x3'),_0xb1a7('0x4'),'keyValue',_0xb1a7('0x5')),'defaultValue':_0xb1a7('0x6')},'content':{'type':Sequelize[_0xb1a7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb1a7('0x2')]('string',_0xb1a7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1a7('0x7')]},'idField':{'type':Sequelize[_0xb1a7('0x7')]},'nameField':{'type':Sequelize[_0xb1a7('0x7')]},'customField':{'type':Sequelize[_0xb1a7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb1a7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 56cfdf4..4eaa737 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 _0x0a9d=['query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','name','Dynamics365Field','rawAttributes','fieldName','key','model','map'];(function(_0x5623b3,_0x122032){var _0x3553e4=function(_0x6ff775){while(--_0x6ff775){_0x5623b3['push'](_0x5623b3['shift']());}};_0x3553e4(++_0x122032);}(_0x0a9d,0x177));var _0xd0a9=function(_0x2b50bf,_0x5f10a2){_0x2b50bf=_0x2b50bf-0x0;var _0x1d8da9=_0x0a9d[_0x2b50bf];return _0x1d8da9;};'use strict';var emlformat=require(_0xd0a9('0x0'));var rimraf=require(_0xd0a9('0x1'));var zipdir=require(_0xd0a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0a9('0x3'));var moment=require(_0xd0a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd0a9('0x5'));var util=require('util');var path=require(_0xd0a9('0x6'));var sox=require('sox');var csv=require(_0xd0a9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0a9('0x8'));var _=require('lodash');var squel=require(_0xd0a9('0x9'));var crypto=require(_0xd0a9('0xa'));var jsforce=require(_0xd0a9('0xb'));var deskjs=require(_0xd0a9('0xc'));var toCsv=require(_0xd0a9('0x7'));var querystring=require('querystring');var Papa=require(_0xd0a9('0xd'));var Redis=require(_0xd0a9('0xe'));var authService=require(_0xd0a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd0a9('0x10'));var hardwareService=require(_0xd0a9('0x11'));var logger=require(_0xd0a9('0x12'))('api');var utils=require(_0xd0a9('0x13'));var config=require(_0xd0a9('0x14'));var licenseUtil=require(_0xd0a9('0x15'));var db=require(_0xd0a9('0x16'))['db'];function respondWithStatusCode(_0x4befa9,_0x307304){_0x307304=_0x307304||0xcc;return function(_0x401019){if(_0x401019){return _0x4befa9['sendStatus'](_0x307304);}return _0x4befa9['status'](_0x307304)[_0xd0a9('0x17')]();};}function respondWithResult(_0x4b8c07,_0x202685){_0x202685=_0x202685||0xc8;return function(_0x2878ea){if(_0x2878ea){return _0x4b8c07[_0xd0a9('0x18')](_0x202685)[_0xd0a9('0x19')](_0x2878ea);}};}function respondWithFilteredResult(_0x43dd09,_0x2fdc14){return function(_0x705421){if(_0x705421){var _0x1180d2=typeof _0x2fdc14[_0xd0a9('0x1a')]===_0xd0a9('0x1b')&&typeof _0x2fdc14[_0xd0a9('0x1c')]===_0xd0a9('0x1b');var _0x105107=_0x705421[_0xd0a9('0x1d')];var _0x4e3c7d=_0x1180d2?0x0:_0x2fdc14[_0xd0a9('0x1a')];var _0x2bfa6b=_0x1180d2?_0x705421['count']:_0x2fdc14[_0xd0a9('0x1a')]+_0x2fdc14[_0xd0a9('0x1c')];var _0x33b676;if(_0x2bfa6b>=_0x105107){_0x2bfa6b=_0x105107;_0x33b676=0xc8;}else{_0x33b676=0xce;}_0x43dd09[_0xd0a9('0x18')](_0x33b676);return _0x43dd09[_0xd0a9('0x1e')](_0xd0a9('0x1f'),_0x4e3c7d+'-'+_0x2bfa6b+'/'+_0x105107)['json'](_0x705421);}return null;};}function patchUpdates(_0x4e77ee){return function(_0x32bcd7){try{jsonpatch['apply'](_0x32bcd7,_0x4e77ee,!![]);}catch(_0x194e47){return BPromise[_0xd0a9('0x20')](_0x194e47);}return _0x32bcd7[_0xd0a9('0x21')]();};}function saveUpdates(_0x11f93d,_0x74be1d){return function(_0x2e6233){if(_0x2e6233){return _0x2e6233[_0xd0a9('0x22')](_0x11f93d)['then'](function(_0x427b67){return _0x427b67;});}return null;};}function removeEntity(_0x18f5d1,_0x7faa59){return function(_0x708c42){if(_0x708c42){return _0x708c42['destroy']()[_0xd0a9('0x23')](function(){_0x18f5d1['status'](0xcc)[_0xd0a9('0x17')]();});}};}function handleEntityNotFound(_0x42cbcc,_0x31abb5){return function(_0x6a0b8d){if(!_0x6a0b8d){_0x42cbcc[_0xd0a9('0x24')](0x194);}return _0x6a0b8d;};}function handleError(_0x1d42e0,_0x49d48e){_0x49d48e=_0x49d48e||0x1f4;return function(_0xb8e150){logger[_0xd0a9('0x25')](_0xb8e150['stack']);if(_0xb8e150[_0xd0a9('0x26')]){delete _0xb8e150[_0xd0a9('0x26')];}_0x1d42e0[_0xd0a9('0x18')](_0x49d48e)['send'](_0xb8e150);};}exports['index']=function(_0x4da7a4,_0x47f338){var _0x384eb7={},_0x39bb52={},_0x315356={'count':0x0,'rows':[]};var _0x551737=_['map'](db[_0xd0a9('0x27')][_0xd0a9('0x28')],function(_0x3b98ac){return{'name':_0x3b98ac[_0xd0a9('0x29')],'type':_0x3b98ac['type'][_0xd0a9('0x2a')]};});_0x39bb52[_0xd0a9('0x2b')]=_[_0xd0a9('0x2c')](_0x551737,_0xd0a9('0x26'));_0x39bb52[_0xd0a9('0x2d')]=_['keys'](_0x4da7a4[_0xd0a9('0x2d')]);_0x39bb52[_0xd0a9('0x2e')]=_[_0xd0a9('0x2f')](_0x39bb52[_0xd0a9('0x2b')],_0x39bb52[_0xd0a9('0x2d')]);_0x384eb7[_0xd0a9('0x30')]=_['intersection'](_0x39bb52[_0xd0a9('0x2b')],qs[_0xd0a9('0x31')](_0x4da7a4[_0xd0a9('0x2d')][_0xd0a9('0x31')]));_0x384eb7[_0xd0a9('0x30')]=_0x384eb7[_0xd0a9('0x30')][_0xd0a9('0x32')]?_0x384eb7[_0xd0a9('0x30')]:_0x39bb52[_0xd0a9('0x2b')];if(!_0x4da7a4[_0xd0a9('0x2d')][_0xd0a9('0x33')]('nolimit')){_0x384eb7['limit']=qs[_0xd0a9('0x1c')](_0x4da7a4[_0xd0a9('0x2d')][_0xd0a9('0x1c')]);_0x384eb7[_0xd0a9('0x1a')]=qs['offset'](_0x4da7a4[_0xd0a9('0x2d')][_0xd0a9('0x1a')]);}_0x384eb7['order']=qs[_0xd0a9('0x34')](_0x4da7a4['query']['sort']);_0x384eb7[_0xd0a9('0x35')]=qs[_0xd0a9('0x2e')](_[_0xd0a9('0x36')](_0x4da7a4[_0xd0a9('0x2d')],_0x39bb52['filters']),_0x551737);if(_0x4da7a4[_0xd0a9('0x2d')]['filter']){_0x384eb7[_0xd0a9('0x35')]=_['merge'](_0x384eb7['where'],{'$or':_[_0xd0a9('0x2c')](_0x551737,function(_0x19095f){if(_0x19095f[_0xd0a9('0x37')]!==_0xd0a9('0x38')){var _0x621284={};_0x621284[_0x19095f['name']]={'$like':'%'+_0x4da7a4[_0xd0a9('0x2d')]['filter']+'%'};return _0x621284;}})});}_0x384eb7=_[_0xd0a9('0x39')]({},_0x384eb7,_0x4da7a4[_0xd0a9('0x3a')]);var _0x1c0774={'where':_0x384eb7['where']};return db[_0xd0a9('0x27')][_0xd0a9('0x1d')](_0x1c0774)[_0xd0a9('0x23')](function(_0x26a419){_0x315356[_0xd0a9('0x1d')]=_0x26a419;if(_0x4da7a4[_0xd0a9('0x2d')][_0xd0a9('0x3b')]){_0x384eb7[_0xd0a9('0x3c')]=[{'all':!![]}];}return db[_0xd0a9('0x27')]['findAll'](_0x384eb7);})[_0xd0a9('0x23')](function(_0x43be84){_0x315356[_0xd0a9('0x3d')]=_0x43be84;return _0x315356;})['then'](respondWithFilteredResult(_0x47f338,_0x384eb7))[_0xd0a9('0x3e')](handleError(_0x47f338,null));};exports[_0xd0a9('0x3f')]=function(_0x387eed,_0x45bb09){var _0xcce3c={'raw':!![],'where':{'id':_0x387eed[_0xd0a9('0x40')]['id']}},_0x33cc4f={};_0x33cc4f[_0xd0a9('0x2b')]=_[_0xd0a9('0x41')](db['Dynamics365Field']['rawAttributes']);_0x33cc4f[_0xd0a9('0x2d')]=_[_0xd0a9('0x41')](_0x387eed['query']);_0x33cc4f[_0xd0a9('0x2e')]=_[_0xd0a9('0x2f')](_0x33cc4f[_0xd0a9('0x2b')],_0x33cc4f[_0xd0a9('0x2d')]);_0xcce3c['attributes']=_['intersection'](_0x33cc4f[_0xd0a9('0x2b')],qs['fields'](_0x387eed[_0xd0a9('0x2d')][_0xd0a9('0x31')]));_0xcce3c[_0xd0a9('0x30')]=_0xcce3c[_0xd0a9('0x30')]['length']?_0xcce3c['attributes']:_0x33cc4f['model'];if(_0x387eed[_0xd0a9('0x2d')][_0xd0a9('0x3b')]){_0xcce3c[_0xd0a9('0x3c')]=[{'all':!![]}];}_0xcce3c=_[_0xd0a9('0x39')]({},_0xcce3c,_0x387eed[_0xd0a9('0x3a')]);return db[_0xd0a9('0x27')][_0xd0a9('0x42')](_0xcce3c)['then'](handleEntityNotFound(_0x45bb09,null))[_0xd0a9('0x23')](respondWithResult(_0x45bb09,null))[_0xd0a9('0x3e')](handleError(_0x45bb09,null));};exports['create']=function(_0x209616,_0x1b768b){return db[_0xd0a9('0x27')][_0xd0a9('0x43')](_0x209616[_0xd0a9('0x44')],{})[_0xd0a9('0x23')](respondWithResult(_0x1b768b,0xc9))[_0xd0a9('0x3e')](handleError(_0x1b768b,null));};exports['update']=function(_0x115e8f,_0xcc7e2a){if(_0x115e8f[_0xd0a9('0x44')]['id']){delete _0x115e8f[_0xd0a9('0x44')]['id'];}return db[_0xd0a9('0x27')][_0xd0a9('0x42')]({'where':{'id':_0x115e8f[_0xd0a9('0x40')]['id']}})[_0xd0a9('0x23')](handleEntityNotFound(_0xcc7e2a,null))[_0xd0a9('0x23')](saveUpdates(_0x115e8f[_0xd0a9('0x44')],null))[_0xd0a9('0x23')](respondWithResult(_0xcc7e2a,null))[_0xd0a9('0x3e')](handleError(_0xcc7e2a,null));};exports[_0xd0a9('0x45')]=function(_0x22e950,_0x4e3093){return db[_0xd0a9('0x27')][_0xd0a9('0x42')]({'where':{'id':_0x22e950[_0xd0a9('0x40')]['id']}})[_0xd0a9('0x23')](handleEntityNotFound(_0x4e3093,null))[_0xd0a9('0x23')](removeEntity(_0x4e3093,null))[_0xd0a9('0x3e')](handleError(_0x4e3093,null));}; \ No newline at end of file +var _0x12ad=['json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','end','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','length','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x49df4f,_0x6fe91c){var _0x5b4421=function(_0x18c748){while(--_0x18c748){_0x49df4f['push'](_0x49df4f['shift']());}};_0x5b4421(++_0x6fe91c);}(_0x12ad,0x1cd));var _0xd12a=function(_0x103762,_0x39d529){_0x103762=_0x103762-0x0;var _0x24844e=_0x12ad[_0x103762];return _0x24844e;};'use strict';var emlformat=require(_0xd12a('0x0'));var rimraf=require(_0xd12a('0x1'));var zipdir=require(_0xd12a('0x2'));var jsonpatch=require(_0xd12a('0x3'));var rp=require('request-promise');var moment=require(_0xd12a('0x4'));var BPromise=require(_0xd12a('0x5'));var Mustache=require(_0xd12a('0x6'));var util=require('util');var path=require(_0xd12a('0x7'));var sox=require(_0xd12a('0x8'));var csv=require(_0xd12a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd12a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd12a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd12a('0xc'));var toCsv=require(_0xd12a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd12a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd12a('0xe'));var hardwareService=require(_0xd12a('0xf'));var logger=require(_0xd12a('0x10'))(_0xd12a('0x11'));var utils=require(_0xd12a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd12a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52d857,_0x2960e0){_0x2960e0=_0x2960e0||0xcc;return function(_0x2b1fda){if(_0x2b1fda){return _0x52d857[_0xd12a('0x14')](_0x2960e0);}return _0x52d857[_0xd12a('0x15')](_0x2960e0)['end']();};}function respondWithResult(_0x1b6b00,_0x45bda8){_0x45bda8=_0x45bda8||0xc8;return function(_0x32c94f){if(_0x32c94f){return _0x1b6b00[_0xd12a('0x15')](_0x45bda8)[_0xd12a('0x16')](_0x32c94f);}};}function respondWithFilteredResult(_0x5ba7fc,_0x5822bf){return function(_0x287d2d){if(_0x287d2d){var _0x1ba5b5=typeof _0x5822bf[_0xd12a('0x17')]===_0xd12a('0x18')&&typeof _0x5822bf['limit']==='undefined';var _0x2c55fd=_0x287d2d[_0xd12a('0x19')];var _0x5b901d=_0x1ba5b5?0x0:_0x5822bf[_0xd12a('0x17')];var _0x145115=_0x1ba5b5?_0x287d2d[_0xd12a('0x19')]:_0x5822bf[_0xd12a('0x17')]+_0x5822bf[_0xd12a('0x1a')];var _0x3af1cb;if(_0x145115>=_0x2c55fd){_0x145115=_0x2c55fd;_0x3af1cb=0xc8;}else{_0x3af1cb=0xce;}_0x5ba7fc['status'](_0x3af1cb);return _0x5ba7fc[_0xd12a('0x1b')](_0xd12a('0x1c'),_0x5b901d+'-'+_0x145115+'/'+_0x2c55fd)[_0xd12a('0x16')](_0x287d2d);}return null;};}function patchUpdates(_0x240b20){return function(_0x5941a0){try{jsonpatch['apply'](_0x5941a0,_0x240b20,!![]);}catch(_0x27f5f8){return BPromise[_0xd12a('0x1d')](_0x27f5f8);}return _0x5941a0['save']();};}function saveUpdates(_0xf6ea25,_0x15ca51){return function(_0x461c8d){if(_0x461c8d){return _0x461c8d[_0xd12a('0x1e')](_0xf6ea25)[_0xd12a('0x1f')](function(_0x54c89d){return _0x54c89d;});}return null;};}function removeEntity(_0x55bb35,_0x5d5826){return function(_0x199cfb){if(_0x199cfb){return _0x199cfb[_0xd12a('0x20')]()[_0xd12a('0x1f')](function(){_0x55bb35[_0xd12a('0x15')](0xcc)[_0xd12a('0x21')]();});}};}function handleEntityNotFound(_0xe175d6,_0x3586cb){return function(_0x42937a){if(!_0x42937a){_0xe175d6[_0xd12a('0x14')](0x194);}return _0x42937a;};}function handleError(_0xe5a52a,_0x5aa92d){_0x5aa92d=_0x5aa92d||0x1f4;return function(_0x2cbf74){logger['error'](_0x2cbf74[_0xd12a('0x22')]);if(_0x2cbf74[_0xd12a('0x23')]){delete _0x2cbf74[_0xd12a('0x23')];}_0xe5a52a['status'](_0x5aa92d)[_0xd12a('0x24')](_0x2cbf74);};}exports['index']=function(_0x5f3295,_0x29b2e5){var _0xc1f7c5={},_0x3aea3b={},_0x9f0644={'count':0x0,'rows':[]};var _0x2dfde4=_[_0xd12a('0x25')](db[_0xd12a('0x26')][_0xd12a('0x27')],function(_0x877342){return{'name':_0x877342[_0xd12a('0x28')],'type':_0x877342[_0xd12a('0x29')]['key']};});_0x3aea3b[_0xd12a('0x2a')]=_[_0xd12a('0x25')](_0x2dfde4,_0xd12a('0x23'));_0x3aea3b[_0xd12a('0x2b')]=_[_0xd12a('0x2c')](_0x5f3295['query']);_0x3aea3b[_0xd12a('0x2d')]=_[_0xd12a('0x2e')](_0x3aea3b['model'],_0x3aea3b[_0xd12a('0x2b')]);_0xc1f7c5[_0xd12a('0x2f')]=_[_0xd12a('0x2e')](_0x3aea3b[_0xd12a('0x2a')],qs[_0xd12a('0x30')](_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x30')]));_0xc1f7c5[_0xd12a('0x2f')]=_0xc1f7c5[_0xd12a('0x2f')]['length']?_0xc1f7c5[_0xd12a('0x2f')]:_0x3aea3b[_0xd12a('0x2a')];if(!_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x31')](_0xd12a('0x32'))){_0xc1f7c5[_0xd12a('0x1a')]=qs[_0xd12a('0x1a')](_0x5f3295['query'][_0xd12a('0x1a')]);_0xc1f7c5[_0xd12a('0x17')]=qs[_0xd12a('0x17')](_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x17')]);}_0xc1f7c5[_0xd12a('0x33')]=qs[_0xd12a('0x34')](_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x34')]);_0xc1f7c5[_0xd12a('0x35')]=qs[_0xd12a('0x2d')](_[_0xd12a('0x36')](_0x5f3295[_0xd12a('0x2b')],_0x3aea3b[_0xd12a('0x2d')]),_0x2dfde4);if(_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x37')]){_0xc1f7c5['where']=_[_0xd12a('0x38')](_0xc1f7c5[_0xd12a('0x35')],{'$or':_[_0xd12a('0x25')](_0x2dfde4,function(_0x45a96d){if(_0x45a96d[_0xd12a('0x29')]!==_0xd12a('0x39')){var _0x53780a={};_0x53780a[_0x45a96d['name']]={'$like':'%'+_0x5f3295[_0xd12a('0x2b')][_0xd12a('0x37')]+'%'};return _0x53780a;}})});}_0xc1f7c5=_[_0xd12a('0x38')]({},_0xc1f7c5,_0x5f3295[_0xd12a('0x3a')]);var _0x21998e={'where':_0xc1f7c5[_0xd12a('0x35')]};return db['Dynamics365Field'][_0xd12a('0x19')](_0x21998e)[_0xd12a('0x1f')](function(_0x43e010){_0x9f0644[_0xd12a('0x19')]=_0x43e010;if(_0x5f3295['query'][_0xd12a('0x3b')]){_0xc1f7c5['include']=[{'all':!![]}];}return db[_0xd12a('0x26')][_0xd12a('0x3c')](_0xc1f7c5);})[_0xd12a('0x1f')](function(_0x54d31c){_0x9f0644['rows']=_0x54d31c;return _0x9f0644;})[_0xd12a('0x1f')](respondWithFilteredResult(_0x29b2e5,_0xc1f7c5))['catch'](handleError(_0x29b2e5,null));};exports[_0xd12a('0x3d')]=function(_0x4feabc,_0x4e375a){var _0x7f3b0b={'raw':!![],'where':{'id':_0x4feabc[_0xd12a('0x3e')]['id']}},_0x47030c={};_0x47030c[_0xd12a('0x2a')]=_[_0xd12a('0x2c')](db[_0xd12a('0x26')][_0xd12a('0x27')]);_0x47030c[_0xd12a('0x2b')]=_[_0xd12a('0x2c')](_0x4feabc['query']);_0x47030c[_0xd12a('0x2d')]=_[_0xd12a('0x2e')](_0x47030c[_0xd12a('0x2a')],_0x47030c[_0xd12a('0x2b')]);_0x7f3b0b[_0xd12a('0x2f')]=_[_0xd12a('0x2e')](_0x47030c[_0xd12a('0x2a')],qs[_0xd12a('0x30')](_0x4feabc[_0xd12a('0x2b')]['fields']));_0x7f3b0b['attributes']=_0x7f3b0b[_0xd12a('0x2f')][_0xd12a('0x3f')]?_0x7f3b0b['attributes']:_0x47030c[_0xd12a('0x2a')];if(_0x4feabc[_0xd12a('0x2b')][_0xd12a('0x3b')]){_0x7f3b0b[_0xd12a('0x40')]=[{'all':!![]}];}_0x7f3b0b=_[_0xd12a('0x38')]({},_0x7f3b0b,_0x4feabc['options']);return db[_0xd12a('0x26')]['find'](_0x7f3b0b)[_0xd12a('0x1f')](handleEntityNotFound(_0x4e375a,null))[_0xd12a('0x1f')](respondWithResult(_0x4e375a,null))[_0xd12a('0x41')](handleError(_0x4e375a,null));};exports[_0xd12a('0x42')]=function(_0x1b856c,_0x2c1a44){return db[_0xd12a('0x26')]['create'](_0x1b856c[_0xd12a('0x43')],{})['then'](respondWithResult(_0x2c1a44,0xc9))[_0xd12a('0x41')](handleError(_0x2c1a44,null));};exports['update']=function(_0x1c50ac,_0x18f3db){if(_0x1c50ac[_0xd12a('0x43')]['id']){delete _0x1c50ac[_0xd12a('0x43')]['id'];}return db[_0xd12a('0x26')]['find']({'where':{'id':_0x1c50ac[_0xd12a('0x3e')]['id']}})[_0xd12a('0x1f')](handleEntityNotFound(_0x18f3db,null))[_0xd12a('0x1f')](saveUpdates(_0x1c50ac['body'],null))[_0xd12a('0x1f')](respondWithResult(_0x18f3db,null))[_0xd12a('0x41')](handleError(_0x18f3db,null));};exports[_0xd12a('0x20')]=function(_0x747655,_0x51f969){return db['Dynamics365Field'][_0xd12a('0x44')]({'where':{'id':_0x747655[_0xd12a('0x3e')]['id']}})[_0xd12a('0x1f')](handleEntityNotFound(_0x51f969,null))[_0xd12a('0x1f')](removeEntity(_0x51f969,null))['catch'](handleError(_0x51f969,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2ddcda1..8270196 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 _0xffd8=['moment','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util'];(function(_0x53a934,_0xa6681d){var _0x86ddae=function(_0x2c8d5d){while(--_0x2c8d5d){_0x53a934['push'](_0x53a934['shift']());}};_0x86ddae(++_0xa6681d);}(_0xffd8,0x177));var _0x8ffd=function(_0x45e0f4,_0x357d06){_0x45e0f4=_0x45e0f4-0x0;var _0x2176d2=_0xffd8[_0x45e0f4];return _0x2176d2;};'use strict';var _=require(_0x8ffd('0x0'));var util=require(_0x8ffd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8ffd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ffd('0x3'));var rimraf=require('rimraf');var config=require(_0x8ffd('0x4'));var attributes=require(_0x8ffd('0x5'));module[_0x8ffd('0x6')]=function(_0x42c2ed,_0x5e6d9e){return _0x42c2ed[_0x8ffd('0x7')](_0x8ffd('0x8'),attributes,{'tableName':_0x8ffd('0x9'),'paranoid':![],'indexes':[{'name':_0x8ffd('0xa'),'fields':[_0x8ffd('0xb'),_0x8ffd('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2641=['api','bluebird','request-promise','path','./intDynamics365Field.attributes','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','util'];(function(_0x2db2cd,_0x284a02){var _0x9a711=function(_0xf066ea){while(--_0xf066ea){_0x2db2cd['push'](_0x2db2cd['shift']());}};_0x9a711(++_0x284a02);}(_0x2641,0xa8));var _0x1264=function(_0x81a24e,_0x2d8e66){_0x81a24e=_0x81a24e-0x0;var _0x1cd5c7=_0x2641[_0x81a24e];return _0x1cd5c7;};'use strict';var _=require(_0x1264('0x0'));var util=require(_0x1264('0x1'));var logger=require('../../config/logger')(_0x1264('0x2'));var moment=require('moment');var BPromise=require(_0x1264('0x3'));var rp=require(_0x1264('0x4'));var fs=require('fs');var path=require(_0x1264('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1264('0x6'));module['exports']=function(_0x8c4b0,_0x6d4d){return _0x8c4b0['define'](_0x1264('0x7'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1264('0x8'),'fields':['idField',_0x1264('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 57ac923..606fb1d 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 _0xdc6b=['info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16d7a6,_0x4dac64){var _0x397bc1=function(_0x60f652){while(--_0x60f652){_0x16d7a6['push'](_0x16d7a6['shift']());}};_0x397bc1(++_0x4dac64);}(_0xdc6b,0x133));var _0xbdc6=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0xdc6b[_0x595bd1];return _0xd0344f;};'use strict';var _=require(_0xbdc6('0x0'));var util=require('util');var moment=require(_0xbdc6('0x1'));var BPromise=require(_0xbdc6('0x2'));var rs=require(_0xbdc6('0x3'));var fs=require('fs');var Redis=require(_0xbdc6('0x4'));var db=require(_0xbdc6('0x5'))['db'];var utils=require(_0xbdc6('0x6'));var logger=require(_0xbdc6('0x7'))(_0xbdc6('0x8'));var config=require(_0xbdc6('0x9'));var jayson=require(_0xbdc6('0xa'));var client=jayson[_0xbdc6('0xb')][_0xbdc6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8a0aed,_0x447711,_0x499e23){return new BPromise(function(_0x44ff72,_0x1d9642){return client[_0xbdc6('0xd')](_0x8a0aed,_0x499e23)[_0xbdc6('0xe')](function(_0x4ca8a6){logger[_0xbdc6('0xf')](_0xbdc6('0x10'),_0x447711,'request\x20sent');logger['debug'](_0xbdc6('0x11'),_0x447711,_0xbdc6('0x12'),JSON[_0xbdc6('0x13')](_0x4ca8a6));if(_0x4ca8a6[_0xbdc6('0x14')]){if(_0x4ca8a6[_0xbdc6('0x14')]['code']===0x1f4){logger['error'](_0xbdc6('0x10'),_0x447711,_0x4ca8a6['error'][_0xbdc6('0x15')]);return _0x1d9642(_0x4ca8a6[_0xbdc6('0x14')][_0xbdc6('0x15')]);}logger['error'](_0xbdc6('0x10'),_0x447711,_0x4ca8a6['error'][_0xbdc6('0x15')]);return _0x44ff72(_0x4ca8a6['error'][_0xbdc6('0x15')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x447711,_0xbdc6('0x12'));_0x44ff72(_0x4ca8a6['result'][_0xbdc6('0x15')]);}})[_0xbdc6('0x16')](function(_0x16e39d){logger[_0xbdc6('0x14')](_0xbdc6('0x10'),_0x447711,_0x16e39d);_0x1d9642(_0x16e39d);});});} \ No newline at end of file +var _0x95f3=['then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request'];(function(_0x3832cb,_0x285065){var _0x5f1fae=function(_0x91f86c){while(--_0x91f86c){_0x3832cb['push'](_0x3832cb['shift']());}};_0x5f1fae(++_0x285065);}(_0x95f3,0x186));var _0x395f=function(_0x4868de,_0x4d07af){_0x4868de=_0x4868de-0x0;var _0x460e7b=_0x95f3[_0x4868de];return _0x460e7b;};'use strict';var _=require(_0x395f('0x0'));var util=require('util');var moment=require(_0x395f('0x1'));var BPromise=require(_0x395f('0x2'));var rs=require(_0x395f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x395f('0x4'));var config=require('../../config/environment');var jayson=require(_0x395f('0x5'));var client=jayson[_0x395f('0x6')][_0x395f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4376ed,_0x273555,_0x52354a){return new BPromise(function(_0x2e69a4,_0x3789a0){return client[_0x395f('0x8')](_0x4376ed,_0x52354a)[_0x395f('0x9')](function(_0x23a541){logger[_0x395f('0xa')](_0x395f('0xb'),_0x273555,_0x395f('0xc'));logger[_0x395f('0xd')](_0x395f('0xe'),_0x273555,_0x395f('0xc'),JSON[_0x395f('0xf')](_0x23a541));if(_0x23a541[_0x395f('0x10')]){if(_0x23a541[_0x395f('0x10')]['code']===0x1f4){logger[_0x395f('0x10')](_0x395f('0xb'),_0x273555,_0x23a541['error'][_0x395f('0x11')]);return _0x3789a0(_0x23a541[_0x395f('0x10')]['message']);}logger[_0x395f('0x10')](_0x395f('0xb'),_0x273555,_0x23a541[_0x395f('0x10')][_0x395f('0x11')]);return _0x2e69a4(_0x23a541['error'][_0x395f('0x11')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x273555,_0x395f('0xc'));_0x2e69a4(_0x23a541['result'][_0x395f('0x11')]);}})[_0x395f('0x12')](function(_0xdbca14){logger[_0x395f('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x273555,_0xdbca14);_0x3789a0(_0xdbca14);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 42c684d..74bb5ba 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 _0x3318=['/:id/configurations','isAuthenticated','getConfigurations','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','show'];(function(_0x2982d8,_0x5c202a){var _0x1a8b4d=function(_0x36a492){while(--_0x36a492){_0x2982d8['push'](_0x2982d8['shift']());}};_0x1a8b4d(++_0x5c202a);}(_0x3318,0x1ed));var _0x8331=function(_0x14bf9b,_0x5ad017){_0x14bf9b=_0x14bf9b-0x0;var _0x580609=_0x3318[_0x14bf9b];return _0x580609;};'use strict';var multer=require(_0x8331('0x0'));var util=require(_0x8331('0x1'));var path=require(_0x8331('0x2'));var timeout=require(_0x8331('0x3'));var express=require(_0x8331('0x4'));var router=express[_0x8331('0x5')]();var fs_extra=require(_0x8331('0x6'));var auth=require(_0x8331('0x7'));var interaction=require(_0x8331('0x8'));var config=require('../../config/environment');var controller=require(_0x8331('0x9'));router[_0x8331('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8331('0xa')](_0x8331('0xb'),auth['isAuthenticated'](),controller[_0x8331('0xc')]);router[_0x8331('0xa')](_0x8331('0xd'),auth[_0x8331('0xe')](),controller[_0x8331('0xf')]);router[_0x8331('0xa')]('/:id/fields',auth[_0x8331('0xe')](),controller[_0x8331('0x10')]);router[_0x8331('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x8331('0xe')](),controller[_0x8331('0x12')]);router['put']('/:id',auth[_0x8331('0xe')](),controller[_0x8331('0x13')]);router[_0x8331('0x14')](_0x8331('0xb'),auth[_0x8331('0xe')](),controller[_0x8331('0x15')]);module[_0x8331('0x16')]=router; \ No newline at end of file +var _0xb4b1=['create','addConfiguration','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb4b1,0x1e8));var _0x1b4b=function(_0xe55ab,_0x2169bd){_0xe55ab=_0xe55ab-0x0;var _0x1ce6e5=_0xb4b1[_0xe55ab];return _0x1ce6e5;};'use strict';var multer=require('multer');var util=require(_0x1b4b('0x0'));var path=require(_0x1b4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b4b('0x2'));var router=express[_0x1b4b('0x3')]();var fs_extra=require(_0x1b4b('0x4'));var auth=require(_0x1b4b('0x5'));var interaction=require(_0x1b4b('0x6'));var config=require(_0x1b4b('0x7'));var controller=require(_0x1b4b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1b4b('0x9')]);router[_0x1b4b('0xa')](_0x1b4b('0xb'),auth[_0x1b4b('0xc')](),controller[_0x1b4b('0xd')]);router[_0x1b4b('0xa')](_0x1b4b('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x1b4b('0xf'),auth[_0x1b4b('0xc')](),controller[_0x1b4b('0x10')]);router[_0x1b4b('0x11')]('/',auth[_0x1b4b('0xc')](),controller[_0x1b4b('0x12')]);router[_0x1b4b('0x11')](_0x1b4b('0xe'),auth['isAuthenticated'](),controller[_0x1b4b('0x13')]);router['put'](_0x1b4b('0xb'),auth[_0x1b4b('0xc')](),controller[_0x1b4b('0x14')]);router['delete'](_0x1b4b('0xb'),auth[_0x1b4b('0xc')](),controller[_0x1b4b('0x15')]);module[_0x1b4b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 60c7425..9c83e6d 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 _0x6a95=['exports','STRING','username','sequelize'];(function(_0x9102f8,_0x578620){var _0x356161=function(_0x424b5f){while(--_0x424b5f){_0x9102f8['push'](_0x9102f8['shift']());}};_0x356161(++_0x578620);}(_0x6a95,0x1db));var _0x56a9=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x6a95[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'name':{'type':Sequelize[_0x56a9('0x2')]},'description':{'type':Sequelize[_0x56a9('0x2')]},'username':{'type':Sequelize[_0x56a9('0x2')],'unique':_0x56a9('0x3')},'apiKey':{'type':Sequelize[_0x56a9('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x273190,_0x56c4f7){var _0x5ce622=function(_0x37554b){while(--_0x37554b){_0x273190['push'](_0x273190['shift']());}};_0x5ce622(++_0x56c4f7);}(_0xf61e,0x191));var _0xef61=function(_0x487e84,_0x3dedc4){_0x487e84=_0x487e84-0x0;var _0x53d171=_0xf61e[_0x487e84];return _0x53d171;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 919eae5..506a600 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 _0x639a=['test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','status','end','offset','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','options','includeAll','include','findAll','rows','params','length','merge','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize'];(function(_0x520380,_0x2e34ee){var _0x4c261=function(_0x4138c5){while(--_0x4138c5){_0x520380['push'](_0x520380['shift']());}};_0x4c261(++_0x2e34ee);}(_0x639a,0xec));var _0xa639=function(_0xe468a5,_0x541320){_0xe468a5=_0xe468a5-0x0;var _0x1a0b8e=_0x639a[_0xe468a5];return _0x1a0b8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2bf30f,_0xbd7aec){_0xbd7aec=_0xbd7aec||0xcc;return function(_0x5d0128){if(_0x5d0128){return _0x2bf30f['sendStatus'](_0xbd7aec);}return _0x2bf30f[_0xa639('0x1b')](_0xbd7aec)[_0xa639('0x1c')]();};}function respondWithResult(_0x4d4b66,_0x1df5dd){_0x1df5dd=_0x1df5dd||0xc8;return function(_0x2590af){if(_0x2590af){return _0x4d4b66[_0xa639('0x1b')](_0x1df5dd)['json'](_0x2590af);}};}function respondWithFilteredResult(_0xb15138,_0x24f1a9){return function(_0x96a92f){if(_0x96a92f){var _0xd769d3=typeof _0x24f1a9[_0xa639('0x1d')]==='undefined'&&typeof _0x24f1a9[_0xa639('0x1e')]==='undefined';var _0x12329b=_0x96a92f[_0xa639('0x1f')];var _0xbd8a9=_0xd769d3?0x0:_0x24f1a9[_0xa639('0x1d')];var _0x3a8ee9=_0xd769d3?_0x96a92f['count']:_0x24f1a9['offset']+_0x24f1a9[_0xa639('0x1e')];var _0x3540fb;if(_0x3a8ee9>=_0x12329b){_0x3a8ee9=_0x12329b;_0x3540fb=0xc8;}else{_0x3540fb=0xce;}_0xb15138[_0xa639('0x1b')](_0x3540fb);return _0xb15138[_0xa639('0x20')](_0xa639('0x21'),_0xbd8a9+'-'+_0x3a8ee9+'/'+_0x12329b)['json'](_0x96a92f);}return null;};}function patchUpdates(_0x5a939f){return function(_0x26bb52){try{jsonpatch['apply'](_0x26bb52,_0x5a939f,!![]);}catch(_0x497cfc){return BPromise['reject'](_0x497cfc);}return _0x26bb52[_0xa639('0x22')]();};}function saveUpdates(_0x28a11c,_0x13592d){return function(_0x5131a3){if(_0x5131a3){return _0x5131a3[_0xa639('0x23')](_0x28a11c)['then'](function(_0xe89eb9){return _0xe89eb9;});}return null;};}function removeEntity(_0x351a33,_0x55189d){return function(_0x582276){if(_0x582276){return _0x582276['destroy']()[_0xa639('0x24')](function(){_0x351a33['status'](0xcc)[_0xa639('0x1c')]();});}};}function handleEntityNotFound(_0x3d6e0c,_0x237da8){return function(_0x191335){if(!_0x191335){_0x3d6e0c['sendStatus'](0x194);}return _0x191335;};}function handleError(_0x314e07,_0x1a0d4e){_0x1a0d4e=_0x1a0d4e||0x1f4;return function(_0x16b63a){logger[_0xa639('0x25')](_0x16b63a[_0xa639('0x26')]);if(_0x16b63a[_0xa639('0x27')]){delete _0x16b63a[_0xa639('0x27')];}_0x314e07[_0xa639('0x1b')](_0x1a0d4e)[_0xa639('0x28')](_0x16b63a);};}exports[_0xa639('0x29')]=function(_0x4b7f2c,_0x2d315f){var _0x38ff11={},_0x32b011={},_0x390f30={'count':0x0,'rows':[]};var _0x2f2775=_['map'](db[_0xa639('0x2a')][_0xa639('0x2b')],function(_0x4e1fc8){return{'name':_0x4e1fc8[_0xa639('0x2c')],'type':_0x4e1fc8[_0xa639('0x2d')][_0xa639('0x2e')]};});_0x32b011[_0xa639('0x2f')]=_[_0xa639('0x30')](_0x2f2775,_0xa639('0x27'));_0x32b011[_0xa639('0x31')]=_[_0xa639('0x32')](_0x4b7f2c['query']);_0x32b011[_0xa639('0x33')]=_['intersection'](_0x32b011[_0xa639('0x2f')],_0x32b011[_0xa639('0x31')]);_0x38ff11['attributes']=_[_0xa639('0x34')](_0x32b011['model'],qs[_0xa639('0x35')](_0x4b7f2c['query'][_0xa639('0x35')]));_0x38ff11[_0xa639('0x36')]=_0x38ff11[_0xa639('0x36')]['length']?_0x38ff11[_0xa639('0x36')]:_0x32b011[_0xa639('0x2f')];if(!_0x4b7f2c[_0xa639('0x31')][_0xa639('0x37')](_0xa639('0x38'))){_0x38ff11[_0xa639('0x1e')]=qs[_0xa639('0x1e')](_0x4b7f2c[_0xa639('0x31')]['limit']);_0x38ff11[_0xa639('0x1d')]=qs['offset'](_0x4b7f2c[_0xa639('0x31')][_0xa639('0x1d')]);}_0x38ff11['order']=qs[_0xa639('0x39')](_0x4b7f2c[_0xa639('0x31')][_0xa639('0x39')]);_0x38ff11['where']=qs['filters'](_[_0xa639('0x3a')](_0x4b7f2c[_0xa639('0x31')],_0x32b011['filters']),_0x2f2775);if(_0x4b7f2c['query'][_0xa639('0x3b')]){_0x38ff11[_0xa639('0x3c')]=_['merge'](_0x38ff11['where'],{'$or':_['map'](_0x2f2775,function(_0x49b82c){if(_0x49b82c[_0xa639('0x2d')]!=='VIRTUAL'){var _0x3f022c={};_0x3f022c[_0x49b82c[_0xa639('0x27')]]={'$like':'%'+_0x4b7f2c[_0xa639('0x31')]['filter']+'%'};return _0x3f022c;}})});}_0x38ff11=_['merge']({},_0x38ff11,_0x4b7f2c[_0xa639('0x3d')]);var _0x53fb93={'where':_0x38ff11[_0xa639('0x3c')]};return db[_0xa639('0x2a')][_0xa639('0x1f')](_0x53fb93)[_0xa639('0x24')](function(_0x2909db){_0x390f30['count']=_0x2909db;if(_0x4b7f2c[_0xa639('0x31')][_0xa639('0x3e')]){_0x38ff11[_0xa639('0x3f')]=[{'all':!![]}];}return db[_0xa639('0x2a')][_0xa639('0x40')](_0x38ff11);})['then'](function(_0x58214b){_0x390f30[_0xa639('0x41')]=_0x58214b;return _0x390f30;})[_0xa639('0x24')](respondWithFilteredResult(_0x2d315f,_0x38ff11))['catch'](handleError(_0x2d315f,null));};exports['show']=function(_0x3410df,_0x2caa7d){var _0x32805c={'raw':![],'where':{'id':_0x3410df[_0xa639('0x42')]['id']}},_0x1c63dc={};_0x1c63dc[_0xa639('0x2f')]=_[_0xa639('0x32')](db[_0xa639('0x2a')][_0xa639('0x2b')]);_0x1c63dc['query']=_[_0xa639('0x32')](_0x3410df[_0xa639('0x31')]);_0x1c63dc[_0xa639('0x33')]=_[_0xa639('0x34')](_0x1c63dc[_0xa639('0x2f')],_0x1c63dc[_0xa639('0x31')]);_0x32805c[_0xa639('0x36')]=_['intersection'](_0x1c63dc[_0xa639('0x2f')],qs[_0xa639('0x35')](_0x3410df[_0xa639('0x31')]['fields']));_0x32805c['attributes']=_0x32805c['attributes'][_0xa639('0x43')]?_0x32805c['attributes']:_0x1c63dc[_0xa639('0x2f')];if(_0x3410df[_0xa639('0x31')][_0xa639('0x3e')]){_0x32805c[_0xa639('0x3f')]=[{'all':!![]}];}_0x32805c=_[_0xa639('0x44')]({},_0x32805c,_0x3410df[_0xa639('0x3d')]);return db[_0xa639('0x2a')][_0xa639('0x45')](_0x32805c)[_0xa639('0x24')](handleEntityNotFound(_0x2caa7d,null))[_0xa639('0x24')](respondWithResult(_0x2caa7d,null))[_0xa639('0x46')](handleError(_0x2caa7d,null));};exports[_0xa639('0x47')]=function(_0x4f3790,_0x2da8a3){return db[_0xa639('0x2a')][_0xa639('0x47')](_0x4f3790[_0xa639('0x48')],{})[_0xa639('0x24')](respondWithResult(_0x2da8a3,0xc9))[_0xa639('0x46')](handleError(_0x2da8a3,null));};exports['update']=function(_0x1532ac,_0x495643){if(_0x1532ac[_0xa639('0x48')]['id']){delete _0x1532ac[_0xa639('0x48')]['id'];}return db['FreshdeskAccount'][_0xa639('0x45')]({'where':{'id':_0x1532ac['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x495643,null))[_0xa639('0x24')](saveUpdates(_0x1532ac[_0xa639('0x48')],null))[_0xa639('0x24')](respondWithResult(_0x495643,null))[_0xa639('0x46')](handleError(_0x495643,null));};exports['destroy']=function(_0x52d5ab,_0x3d0fef){return db['FreshdeskAccount'][_0xa639('0x45')]({'where':{'id':_0x52d5ab[_0xa639('0x42')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x3d0fef,null))['then'](removeEntity(_0x3d0fef,null))[_0xa639('0x46')](handleError(_0x3d0fef,null));};exports[_0xa639('0x49')]=function(_0x348f92,_0x4f74f1,_0xff60c9){var _0x37bb97={};var _0x581b42={};var _0x14ffbf;var _0x14457c;return db[_0xa639('0x2a')][_0xa639('0x4a')]({'where':{'id':_0x348f92[_0xa639('0x42')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x4f74f1,null))[_0xa639('0x24')](function(_0x24b37e){if(_0x24b37e){_0x14ffbf=_0x24b37e;_0x581b42[_0xa639('0x2f')]=_['keys'](db[_0xa639('0x4b')][_0xa639('0x2b')]);_0x581b42[_0xa639('0x31')]=_['keys'](_0x348f92[_0xa639('0x31')]);_0x581b42[_0xa639('0x33')]=_[_0xa639('0x34')](_0x581b42[_0xa639('0x2f')],_0x581b42['query']);_0x37bb97[_0xa639('0x36')]=_[_0xa639('0x34')](_0x581b42['model'],qs[_0xa639('0x35')](_0x348f92['query'][_0xa639('0x35')]));_0x37bb97[_0xa639('0x36')]=_0x37bb97['attributes']['length']?_0x37bb97[_0xa639('0x36')]:_0x581b42[_0xa639('0x2f')];_0x37bb97[_0xa639('0x4c')]=qs['sort'](_0x348f92[_0xa639('0x31')][_0xa639('0x39')]);_0x37bb97[_0xa639('0x3c')]=qs[_0xa639('0x33')](_['pick'](_0x348f92[_0xa639('0x31')],_0x581b42[_0xa639('0x33')]));if(_0x348f92[_0xa639('0x31')][_0xa639('0x3b')]){_0x37bb97[_0xa639('0x3c')]=_[_0xa639('0x44')](_0x37bb97['where'],{'$or':_['map'](_0x37bb97['attributes'],function(_0x3d9c03){var _0x14d7c1={};_0x14d7c1[_0x3d9c03]={'$like':'%'+_0x348f92['query'][_0xa639('0x3b')]+'%'};return _0x14d7c1;})});}_0x37bb97=_[_0xa639('0x44')]({},_0x37bb97,_0x348f92['options']);return _0x14ffbf[_0xa639('0x49')](_0x37bb97);}})[_0xa639('0x24')](function(_0x7d7849){if(_0x7d7849){_0x14457c=_0x7d7849[_0xa639('0x43')];if(!_0x348f92['query']['hasOwnProperty']('nolimit')){_0x37bb97['limit']=qs[_0xa639('0x1e')](_0x348f92[_0xa639('0x31')][_0xa639('0x1e')]);_0x37bb97[_0xa639('0x1d')]=qs[_0xa639('0x1d')](_0x348f92[_0xa639('0x31')][_0xa639('0x1d')]);}return _0x14ffbf[_0xa639('0x49')](_0x37bb97);}})['then'](function(_0x30dead){if(_0x30dead){return _0x30dead?{'count':_0x14457c,'rows':_0x30dead}:null;}})['then'](respondWithResult(_0x4f74f1,null))[_0xa639('0x46')](handleError(_0x4f74f1,null));};exports['addConfiguration']=function(_0x4b7236,_0x3f1069,_0x31c522){if(_0x4b7236['body']['id']){delete _0x4b7236[_0xa639('0x48')]['id'];}return db[_0xa639('0x2a')][_0xa639('0x4a')]({'where':{'id':_0x4b7236[_0xa639('0x42')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x3f1069,null))['then'](function(_0x1efc06){if(_0x1efc06){_0x4b7236[_0xa639('0x48')][_0xa639('0x4d')]=_0x1efc06['id'];_0x4b7236[_0xa639('0x48')][_0xa639('0x4e')]=integrations[_0xa639('0x4f')](_0x4b7236[_0xa639('0x48')][_0xa639('0x50')],_0x4b7236[_0xa639('0x48')][_0xa639('0x2d')]);_0x4b7236['body'][_0xa639('0x51')]=integrations[_0xa639('0x52')](_0x4b7236['body'][_0xa639('0x50')],_0x4b7236['body'][_0xa639('0x2d')]);return db[_0xa639('0x4b')][_0xa639('0x47')](_0x4b7236[_0xa639('0x48')],{'include':[{'model':db[_0xa639('0x53')],'as':_0xa639('0x4e')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3f1069,null))['catch'](handleError(_0x3f1069,null));};exports[_0xa639('0x54')]=function(_0x17732d,_0x413c12,_0x37b6c8){var _0x696d12='';return db[_0xa639('0x2a')][_0xa639('0x4a')]({'where':{'id':_0x17732d['params']['id']},'attributes':['id',_0xa639('0x55'),_0xa639('0x56')]})[_0xa639('0x24')](handleEntityNotFound(_0x413c12,null))['then'](function(_0x1a0505){if(_0x1a0505){_0x696d12=_0x1a0505[_0xa639('0x55')];var _0x2d175a=_0x696d12[_0xa639('0x57')](-0x1);if(_0x2d175a==='/'){_0x696d12=_0x696d12[_0xa639('0x58')](0x0,_0x696d12[_0xa639('0x59')](_0x2d175a));}return rp({'method':_0xa639('0x5a'),'uri':util[_0xa639('0x5b')](_0xa639('0x5c'),_0x696d12,_0xa639('0x5d')),'headers':{'Authorization':util['format'](_0xa639('0x5e'),new Buffer(util[_0xa639('0x5b')](_0xa639('0x5f'),_0x1a0505[_0xa639('0x56')]))[_0xa639('0x60')]('base64'))},'json':!![]});}})[_0xa639('0x24')](function(_0x3e011a){if(_0x3e011a){var _0x11b34d=[_0xa639('0x61'),'subject',_0xa639('0x62'),_0xa639('0x63'),_0xa639('0x1b'),_0xa639('0x64'),_0xa639('0x65'),_0xa639('0x66'),_0xa639('0x67'),_0xa639('0x65'),'company'];_[_0xa639('0x68')](_0x3e011a,function(_0x4f44f1){return _0x11b34d[_0xa639('0x69')](_0x4f44f1[_0xa639('0x27')])||!_0x4f44f1[_0xa639('0x6a')]&&_0x4f44f1[_0xa639('0x2d')]!==_0xa639('0x6b')&&_0x4f44f1[_0xa639('0x2d')]!==_0xa639('0x6c');});return{'count':_0x3e011a[_0xa639('0x43')],'rows':_[_0xa639('0x30')](_0x3e011a,function(_0x147401){return{'id':_0x147401[_0xa639('0x27')],'name':_0x147401[_0xa639('0x6d')],'custom':!_0x147401['default'],'options':_0x147401[_0xa639('0x6e')]?_[_0xa639('0x30')](_0x147401[_0xa639('0x6e')],function(_0x37edef){return{'name':_[_0xa639('0x6f')](_0x37edef),'value':_0x37edef};}):[]};})};}})[_0xa639('0x24')](respondWithResult(_0x413c12,null))[_0xa639('0x46')](function(_0x4bacb4){var _0x5f3df0=_0x17732d['query'][_0xa639('0x70')]?0x1f4:_0x4bacb4[_0xa639('0x71')]||0x1f4;logger[_0xa639('0x25')](_0xa639('0x72'),_0xa639('0x54'),_0x5f3df0,JSON['stringify'](_0x4bacb4));delete _0x4bacb4[_0xa639('0x27')];if(_0x5f3df0===0x191){_0x5f3df0=0x190;}_0x413c12[_0xa639('0x1b')](_0x5f3df0)[_0xa639('0x28')](_0x17732d[_0xa639('0x31')]['test']?{'message':_0xa639('0x73'),'statusCode':_0x4bacb4[_0xa639('0x71')]}:_0x4bacb4);});}; \ No newline at end of file +var _0xc7a7=['slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','base64','requester','description','priority','group','source','company','remove','default','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','key','model','keys','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','rows','catch','show','intersection','fields','create','body','find','params','findOne','FreshdeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri'];(function(_0x1b24eb,_0x39029e){var _0x157b17=function(_0x2ddb83){while(--_0x2ddb83){_0x1b24eb['push'](_0x1b24eb['shift']());}};_0x157b17(++_0x39029e);}(_0xc7a7,0x171));var _0x7c7a=function(_0x24397c,_0x54e8f7){_0x24397c=_0x24397c-0x0;var _0x1d36ed=_0xc7a7[_0x24397c];return _0x1d36ed;};'use strict';var emlformat=require(_0x7c7a('0x0'));var rimraf=require(_0x7c7a('0x1'));var zipdir=require(_0x7c7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c7a('0x3'));var moment=require(_0x7c7a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7c7a('0x5'));var util=require(_0x7c7a('0x6'));var path=require(_0x7c7a('0x7'));var sox=require(_0x7c7a('0x8'));var csv=require(_0x7c7a('0x9'));var ejs=require(_0x7c7a('0xa'));var fs=require('fs');var fs_extra=require(_0x7c7a('0xb'));var _=require(_0x7c7a('0xc'));var squel=require('squel');var crypto=require(_0x7c7a('0xd'));var jsforce=require(_0x7c7a('0xe'));var deskjs=require(_0x7c7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7c7a('0x10'));var Papa=require(_0x7c7a('0x11'));var Redis=require(_0x7c7a('0x12'));var authService=require(_0x7c7a('0x13'));var qs=require(_0x7c7a('0x14'));var as=require(_0x7c7a('0x15'));var hardwareService=require(_0x7c7a('0x16'));var logger=require(_0x7c7a('0x17'))('api');var utils=require(_0x7c7a('0x18'));var config=require(_0x7c7a('0x19'));var licenseUtil=require(_0x7c7a('0x1a'));var db=require(_0x7c7a('0x1b'))['db'];var integrations=require(_0x7c7a('0x1c'));function respondWithStatusCode(_0x6c0e68,_0x3d29d0){_0x3d29d0=_0x3d29d0||0xcc;return function(_0x5431c7){if(_0x5431c7){return _0x6c0e68[_0x7c7a('0x1d')](_0x3d29d0);}return _0x6c0e68[_0x7c7a('0x1e')](_0x3d29d0)[_0x7c7a('0x1f')]();};}function respondWithResult(_0x279441,_0xd97646){_0xd97646=_0xd97646||0xc8;return function(_0x534cc5){if(_0x534cc5){return _0x279441[_0x7c7a('0x1e')](_0xd97646)['json'](_0x534cc5);}};}function respondWithFilteredResult(_0x3b874a,_0x210afe){return function(_0x7da88b){if(_0x7da88b){var _0x239fd0=typeof _0x210afe[_0x7c7a('0x20')]===_0x7c7a('0x21')&&typeof _0x210afe[_0x7c7a('0x22')]===_0x7c7a('0x21');var _0xebd6c7=_0x7da88b[_0x7c7a('0x23')];var _0x3ddc66=_0x239fd0?0x0:_0x210afe[_0x7c7a('0x20')];var _0x482fb1=_0x239fd0?_0x7da88b[_0x7c7a('0x23')]:_0x210afe[_0x7c7a('0x20')]+_0x210afe[_0x7c7a('0x22')];var _0x1c60ef;if(_0x482fb1>=_0xebd6c7){_0x482fb1=_0xebd6c7;_0x1c60ef=0xc8;}else{_0x1c60ef=0xce;}_0x3b874a['status'](_0x1c60ef);return _0x3b874a['set'](_0x7c7a('0x24'),_0x3ddc66+'-'+_0x482fb1+'/'+_0xebd6c7)['json'](_0x7da88b);}return null;};}function patchUpdates(_0x3a267a){return function(_0x58a1e6){try{jsonpatch[_0x7c7a('0x25')](_0x58a1e6,_0x3a267a,!![]);}catch(_0x5f0385){return BPromise[_0x7c7a('0x26')](_0x5f0385);}return _0x58a1e6[_0x7c7a('0x27')]();};}function saveUpdates(_0x51da41,_0x532bcb){return function(_0x991bfa){if(_0x991bfa){return _0x991bfa[_0x7c7a('0x28')](_0x51da41)[_0x7c7a('0x29')](function(_0x711df9){return _0x711df9;});}return null;};}function removeEntity(_0x4d45d6,_0x115289){return function(_0x10b787){if(_0x10b787){return _0x10b787['destroy']()['then'](function(){_0x4d45d6[_0x7c7a('0x1e')](0xcc)[_0x7c7a('0x1f')]();});}};}function handleEntityNotFound(_0x282e0e,_0x43a847){return function(_0x3e48ff){if(!_0x3e48ff){_0x282e0e[_0x7c7a('0x1d')](0x194);}return _0x3e48ff;};}function handleError(_0x3c0aab,_0x9d2c1e){_0x9d2c1e=_0x9d2c1e||0x1f4;return function(_0x2faec4){logger[_0x7c7a('0x2a')](_0x2faec4['stack']);if(_0x2faec4[_0x7c7a('0x2b')]){delete _0x2faec4['name'];}_0x3c0aab[_0x7c7a('0x1e')](_0x9d2c1e)[_0x7c7a('0x2c')](_0x2faec4);};}exports['index']=function(_0x469a99,_0x1fe1e7){var _0x20d28c={},_0x777d33={},_0x21ebd5={'count':0x0,'rows':[]};var _0x4c2865=_[_0x7c7a('0x2d')](db['FreshdeskAccount'][_0x7c7a('0x2e')],function(_0x20e45b){return{'name':_0x20e45b[_0x7c7a('0x2f')],'type':_0x20e45b['type'][_0x7c7a('0x30')]};});_0x777d33[_0x7c7a('0x31')]=_[_0x7c7a('0x2d')](_0x4c2865,_0x7c7a('0x2b'));_0x777d33['query']=_[_0x7c7a('0x32')](_0x469a99[_0x7c7a('0x33')]);_0x777d33['filters']=_['intersection'](_0x777d33[_0x7c7a('0x31')],_0x777d33[_0x7c7a('0x33')]);_0x20d28c[_0x7c7a('0x34')]=_['intersection'](_0x777d33[_0x7c7a('0x31')],qs['fields'](_0x469a99[_0x7c7a('0x33')]['fields']));_0x20d28c[_0x7c7a('0x34')]=_0x20d28c[_0x7c7a('0x34')][_0x7c7a('0x35')]?_0x20d28c[_0x7c7a('0x34')]:_0x777d33['model'];if(!_0x469a99[_0x7c7a('0x33')][_0x7c7a('0x36')](_0x7c7a('0x37'))){_0x20d28c[_0x7c7a('0x22')]=qs[_0x7c7a('0x22')](_0x469a99[_0x7c7a('0x33')][_0x7c7a('0x22')]);_0x20d28c['offset']=qs['offset'](_0x469a99[_0x7c7a('0x33')]['offset']);}_0x20d28c[_0x7c7a('0x38')]=qs[_0x7c7a('0x39')](_0x469a99[_0x7c7a('0x33')][_0x7c7a('0x39')]);_0x20d28c[_0x7c7a('0x3a')]=qs[_0x7c7a('0x3b')](_['pick'](_0x469a99[_0x7c7a('0x33')],_0x777d33['filters']),_0x4c2865);if(_0x469a99[_0x7c7a('0x33')][_0x7c7a('0x3c')]){_0x20d28c[_0x7c7a('0x3a')]=_[_0x7c7a('0x3d')](_0x20d28c[_0x7c7a('0x3a')],{'$or':_[_0x7c7a('0x2d')](_0x4c2865,function(_0x2e8ab2){if(_0x2e8ab2[_0x7c7a('0x3e')]!==_0x7c7a('0x3f')){var _0x567be0={};_0x567be0[_0x2e8ab2[_0x7c7a('0x2b')]]={'$like':'%'+_0x469a99[_0x7c7a('0x33')][_0x7c7a('0x3c')]+'%'};return _0x567be0;}})});}_0x20d28c=_[_0x7c7a('0x3d')]({},_0x20d28c,_0x469a99[_0x7c7a('0x40')]);var _0x2e24c1={'where':_0x20d28c[_0x7c7a('0x3a')]};return db[_0x7c7a('0x41')][_0x7c7a('0x23')](_0x2e24c1)[_0x7c7a('0x29')](function(_0xf35625){_0x21ebd5[_0x7c7a('0x23')]=_0xf35625;if(_0x469a99['query'][_0x7c7a('0x42')]){_0x20d28c[_0x7c7a('0x43')]=[{'all':!![]}];}return db[_0x7c7a('0x41')][_0x7c7a('0x44')](_0x20d28c);})['then'](function(_0x47bf2e){_0x21ebd5[_0x7c7a('0x45')]=_0x47bf2e;return _0x21ebd5;})[_0x7c7a('0x29')](respondWithFilteredResult(_0x1fe1e7,_0x20d28c))[_0x7c7a('0x46')](handleError(_0x1fe1e7,null));};exports[_0x7c7a('0x47')]=function(_0x545d70,_0x3fb0ab){var _0x4a856a={'raw':![],'where':{'id':_0x545d70['params']['id']}},_0x47114c={};_0x47114c[_0x7c7a('0x31')]=_[_0x7c7a('0x32')](db[_0x7c7a('0x41')][_0x7c7a('0x2e')]);_0x47114c[_0x7c7a('0x33')]=_[_0x7c7a('0x32')](_0x545d70['query']);_0x47114c[_0x7c7a('0x3b')]=_[_0x7c7a('0x48')](_0x47114c['model'],_0x47114c['query']);_0x4a856a['attributes']=_[_0x7c7a('0x48')](_0x47114c[_0x7c7a('0x31')],qs[_0x7c7a('0x49')](_0x545d70[_0x7c7a('0x33')][_0x7c7a('0x49')]));_0x4a856a['attributes']=_0x4a856a[_0x7c7a('0x34')]['length']?_0x4a856a['attributes']:_0x47114c[_0x7c7a('0x31')];if(_0x545d70[_0x7c7a('0x33')]['includeAll']){_0x4a856a[_0x7c7a('0x43')]=[{'all':!![]}];}_0x4a856a=_['merge']({},_0x4a856a,_0x545d70['options']);return db[_0x7c7a('0x41')]['find'](_0x4a856a)[_0x7c7a('0x29')](handleEntityNotFound(_0x3fb0ab,null))[_0x7c7a('0x29')](respondWithResult(_0x3fb0ab,null))['catch'](handleError(_0x3fb0ab,null));};exports[_0x7c7a('0x4a')]=function(_0x1e8c85,_0x5d2479){return db[_0x7c7a('0x41')][_0x7c7a('0x4a')](_0x1e8c85[_0x7c7a('0x4b')],{})['then'](respondWithResult(_0x5d2479,0xc9))[_0x7c7a('0x46')](handleError(_0x5d2479,null));};exports[_0x7c7a('0x28')]=function(_0xacd350,_0x5e2700){if(_0xacd350[_0x7c7a('0x4b')]['id']){delete _0xacd350[_0x7c7a('0x4b')]['id'];}return db[_0x7c7a('0x41')][_0x7c7a('0x4c')]({'where':{'id':_0xacd350[_0x7c7a('0x4d')]['id']}})[_0x7c7a('0x29')](handleEntityNotFound(_0x5e2700,null))['then'](saveUpdates(_0xacd350[_0x7c7a('0x4b')],null))[_0x7c7a('0x29')](respondWithResult(_0x5e2700,null))[_0x7c7a('0x46')](handleError(_0x5e2700,null));};exports['destroy']=function(_0x48d7e9,_0x3dae5d){return db['FreshdeskAccount'][_0x7c7a('0x4c')]({'where':{'id':_0x48d7e9['params']['id']}})[_0x7c7a('0x29')](handleEntityNotFound(_0x3dae5d,null))[_0x7c7a('0x29')](removeEntity(_0x3dae5d,null))['catch'](handleError(_0x3dae5d,null));};exports['getConfigurations']=function(_0x1e07da,_0x4434ef,_0x239e84){var _0xaa19b5={};var _0x8a80c3={};var _0x20a8a1;var _0x46ad1d;return db[_0x7c7a('0x41')][_0x7c7a('0x4e')]({'where':{'id':_0x1e07da[_0x7c7a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4434ef,null))[_0x7c7a('0x29')](function(_0x115355){if(_0x115355){_0x20a8a1=_0x115355;_0x8a80c3['model']=_['keys'](db[_0x7c7a('0x4f')][_0x7c7a('0x2e')]);_0x8a80c3['query']=_[_0x7c7a('0x32')](_0x1e07da[_0x7c7a('0x33')]);_0x8a80c3[_0x7c7a('0x3b')]=_[_0x7c7a('0x48')](_0x8a80c3['model'],_0x8a80c3['query']);_0xaa19b5[_0x7c7a('0x34')]=_['intersection'](_0x8a80c3[_0x7c7a('0x31')],qs['fields'](_0x1e07da[_0x7c7a('0x33')][_0x7c7a('0x49')]));_0xaa19b5[_0x7c7a('0x34')]=_0xaa19b5[_0x7c7a('0x34')][_0x7c7a('0x35')]?_0xaa19b5[_0x7c7a('0x34')]:_0x8a80c3[_0x7c7a('0x31')];_0xaa19b5['order']=qs[_0x7c7a('0x39')](_0x1e07da[_0x7c7a('0x33')][_0x7c7a('0x39')]);_0xaa19b5['where']=qs[_0x7c7a('0x3b')](_[_0x7c7a('0x50')](_0x1e07da[_0x7c7a('0x33')],_0x8a80c3[_0x7c7a('0x3b')]));if(_0x1e07da[_0x7c7a('0x33')][_0x7c7a('0x3c')]){_0xaa19b5[_0x7c7a('0x3a')]=_[_0x7c7a('0x3d')](_0xaa19b5[_0x7c7a('0x3a')],{'$or':_[_0x7c7a('0x2d')](_0xaa19b5['attributes'],function(_0x48e45b){var _0x363386={};_0x363386[_0x48e45b]={'$like':'%'+_0x1e07da['query'][_0x7c7a('0x3c')]+'%'};return _0x363386;})});}_0xaa19b5=_[_0x7c7a('0x3d')]({},_0xaa19b5,_0x1e07da['options']);return _0x20a8a1[_0x7c7a('0x51')](_0xaa19b5);}})['then'](function(_0x54a924){if(_0x54a924){_0x46ad1d=_0x54a924[_0x7c7a('0x35')];if(!_0x1e07da[_0x7c7a('0x33')]['hasOwnProperty'](_0x7c7a('0x37'))){_0xaa19b5[_0x7c7a('0x22')]=qs[_0x7c7a('0x22')](_0x1e07da['query'][_0x7c7a('0x22')]);_0xaa19b5['offset']=qs[_0x7c7a('0x20')](_0x1e07da[_0x7c7a('0x33')][_0x7c7a('0x20')]);}return _0x20a8a1['getConfigurations'](_0xaa19b5);}})[_0x7c7a('0x29')](function(_0xa3394d){if(_0xa3394d){return _0xa3394d?{'count':_0x46ad1d,'rows':_0xa3394d}:null;}})[_0x7c7a('0x29')](respondWithResult(_0x4434ef,null))[_0x7c7a('0x46')](handleError(_0x4434ef,null));};exports[_0x7c7a('0x52')]=function(_0x5310e7,_0x1a2625,_0x5a3755){if(_0x5310e7['body']['id']){delete _0x5310e7[_0x7c7a('0x4b')]['id'];}return db[_0x7c7a('0x41')][_0x7c7a('0x4e')]({'where':{'id':_0x5310e7[_0x7c7a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a2625,null))[_0x7c7a('0x29')](function(_0x9744c3){if(_0x9744c3){_0x5310e7[_0x7c7a('0x4b')][_0x7c7a('0x53')]=_0x9744c3['id'];_0x5310e7[_0x7c7a('0x4b')][_0x7c7a('0x54')]=integrations[_0x7c7a('0x55')](_0x5310e7[_0x7c7a('0x4b')][_0x7c7a('0x56')],_0x5310e7[_0x7c7a('0x4b')]['type']);_0x5310e7[_0x7c7a('0x4b')][_0x7c7a('0x57')]=integrations['getDescriptions'](_0x5310e7['body'][_0x7c7a('0x56')],_0x5310e7[_0x7c7a('0x4b')][_0x7c7a('0x3e')]);return db['FreshdeskConfiguration'][_0x7c7a('0x4a')](_0x5310e7[_0x7c7a('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x7c7a('0x58')],'as':_0x7c7a('0x57')}]});}return null;})['then'](respondWithResult(_0x1a2625,null))['catch'](handleError(_0x1a2625,null));};exports[_0x7c7a('0x59')]=function(_0x26828a,_0xa4c4c9,_0x3b5838){var _0x1e6d5f='';return db[_0x7c7a('0x41')][_0x7c7a('0x4e')]({'where':{'id':_0x26828a[_0x7c7a('0x4d')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0xa4c4c9,null))['then'](function(_0x12aeec){if(_0x12aeec){_0x1e6d5f=_0x12aeec[_0x7c7a('0x5a')];var _0x292ecf=_0x1e6d5f[_0x7c7a('0x5b')](-0x1);if(_0x292ecf==='/'){_0x1e6d5f=_0x1e6d5f[_0x7c7a('0x5c')](0x0,_0x1e6d5f[_0x7c7a('0x5d')](_0x292ecf));}return rp({'method':_0x7c7a('0x5e'),'uri':util['format'](_0x7c7a('0x5f'),_0x1e6d5f,_0x7c7a('0x60')),'headers':{'Authorization':util[_0x7c7a('0x61')]('Basic\x20%s',new Buffer(util[_0x7c7a('0x61')]('%s:X',_0x12aeec['apiKey']))['toString'](_0x7c7a('0x62')))},'json':!![]});}})[_0x7c7a('0x29')](function(_0x75ec42){if(_0x75ec42){var _0x5bfeca=[_0x7c7a('0x63'),'subject','agent',_0x7c7a('0x64'),_0x7c7a('0x1e'),_0x7c7a('0x65'),_0x7c7a('0x66'),_0x7c7a('0x67'),'ticket_type',_0x7c7a('0x66'),_0x7c7a('0x68')];_[_0x7c7a('0x69')](_0x75ec42,function(_0x462b71){return _0x5bfeca['includes'](_0x462b71[_0x7c7a('0x2b')])||!_0x462b71[_0x7c7a('0x6a')]&&_0x462b71[_0x7c7a('0x3e')]!=='custom_text'&&_0x462b71['type']!=='custom_dropdown';});return{'count':_0x75ec42['length'],'rows':_['map'](_0x75ec42,function(_0x29226a){return{'id':_0x29226a[_0x7c7a('0x2b')],'name':_0x29226a[_0x7c7a('0x6b')],'custom':!_0x29226a[_0x7c7a('0x6a')],'options':_0x29226a[_0x7c7a('0x6c')]?_[_0x7c7a('0x2d')](_0x29226a['choices'],function(_0x3155d5){return{'name':_[_0x7c7a('0x6d')](_0x3155d5),'value':_0x3155d5};}):[]};})};}})['then'](respondWithResult(_0xa4c4c9,null))[_0x7c7a('0x46')](function(_0x3f1da3){var _0x47de8c=_0x26828a[_0x7c7a('0x33')][_0x7c7a('0x6e')]?0x1f4:_0x3f1da3[_0x7c7a('0x6f')]||0x1f4;logger['error'](_0x7c7a('0x70'),_0x7c7a('0x59'),_0x47de8c,JSON[_0x7c7a('0x71')](_0x3f1da3));delete _0x3f1da3['name'];if(_0x47de8c===0x191){_0x47de8c=0x190;}_0xa4c4c9[_0x7c7a('0x1e')](_0x47de8c)[_0x7c7a('0x2c')](_0x26828a['query'][_0x7c7a('0x6e')]?{'message':_0x7c7a('0x72'),'statusCode':_0x3f1da3['statusCode']}:_0x3f1da3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a496610..5c862b4 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 _0x5118=['rimraf','../../config/environment','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x461b37,_0x356ee0){var _0x4dd174=function(_0x49ec05){while(--_0x49ec05){_0x461b37['push'](_0x461b37['shift']());}};_0x4dd174(++_0x356ee0);}(_0x5118,0x123));var _0x8511=function(_0x2dbe16,_0x13655b){_0x2dbe16=_0x2dbe16-0x0;var _0x3eb827=_0x5118[_0x2dbe16];return _0x3eb827;};'use strict';var _=require(_0x8511('0x0'));var util=require(_0x8511('0x1'));var logger=require(_0x8511('0x2'))(_0x8511('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8511('0x4'));var fs=require('fs');var path=require(_0x8511('0x5'));var rimraf=require(_0x8511('0x6'));var config=require(_0x8511('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x282100,_0x21e586){return _0x282100[_0x8511('0x8')](_0x8511('0x9'),attributes,{'tableName':_0x8511('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcde9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x397395,_0x7d9a5e){var _0x978f98=function(_0x4b2ddd){while(--_0x4b2ddd){_0x397395['push'](_0x397395['shift']());}};_0x978f98(++_0x7d9a5e);}(_0xcde9,0x11d));var _0x9cde=function(_0x629a75,_0x8b4ce3){_0x629a75=_0x629a75-0x0;var _0x44089b=_0xcde9[_0x629a75];return _0x44089b;};'use strict';var _=require(_0x9cde('0x0'));var util=require(_0x9cde('0x1'));var logger=require('../../config/logger')(_0x9cde('0x2'));var moment=require(_0x9cde('0x3'));var BPromise=require(_0x9cde('0x4'));var rp=require(_0x9cde('0x5'));var fs=require('fs');var path=require(_0x9cde('0x6'));var rimraf=require(_0x9cde('0x7'));var config=require(_0x9cde('0x8'));var attributes=require(_0x9cde('0x9'));var integrations=require(_0x9cde('0xa'));module[_0x9cde('0xb')]=function(_0xf32c84,_0x34ee8c){return _0xf32c84[_0x9cde('0xc')](_0x9cde('0xd'),attributes,{'tableName':_0x9cde('0xe'),'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 b944977..e265d0f 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 _0x0ba4=['jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','ShowFreshdeskAccount','find','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x0ba4,0x82));var _0x40ba=function(_0x28c6a2,_0x5e2df3){_0x28c6a2=_0x28c6a2-0x0;var _0x278cc0=_0x0ba4[_0x28c6a2];return _0x278cc0;};'use strict';var _=require(_0x40ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x40ba('0x1'));var rs=require(_0x40ba('0x2'));var fs=require('fs');var Redis=require(_0x40ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40ba('0x4'))('rpc');var config=require(_0x40ba('0x5'));var jayson=require(_0x40ba('0x6'));var client=jayson[_0x40ba('0x7')][_0x40ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x541790,_0xb07af8,_0x41f840){return new BPromise(function(_0x53cfdd,_0x53083d){return client[_0x40ba('0x9')](_0x541790,_0x41f840)[_0x40ba('0xa')](function(_0x330d43){logger[_0x40ba('0xb')](_0x40ba('0xc'),_0xb07af8,_0x40ba('0xd'));logger[_0x40ba('0xe')](_0x40ba('0xf'),_0xb07af8,_0x40ba('0xd'),JSON[_0x40ba('0x10')](_0x330d43));if(_0x330d43[_0x40ba('0x11')]){if(_0x330d43['error'][_0x40ba('0x12')]===0x1f4){logger[_0x40ba('0x11')](_0x40ba('0xc'),_0xb07af8,_0x330d43[_0x40ba('0x11')][_0x40ba('0x13')]);return _0x53083d(_0x330d43[_0x40ba('0x11')]['message']);}logger[_0x40ba('0x11')](_0x40ba('0xc'),_0xb07af8,_0x330d43[_0x40ba('0x11')][_0x40ba('0x13')]);return _0x53cfdd(_0x330d43[_0x40ba('0x11')][_0x40ba('0x13')]);}else{logger[_0x40ba('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0xb07af8,'request\x20sent');_0x53cfdd(_0x330d43[_0x40ba('0x14')][_0x40ba('0x13')]);}})[_0x40ba('0x15')](function(_0x3826e3){logger[_0x40ba('0x11')](_0x40ba('0xc'),_0xb07af8,_0x3826e3);_0x53083d(_0x3826e3);});});}exports[_0x40ba('0x16')]=function(_0xee8fe9){var _0x559e00=this;return new Promise(function(_0x7673cc,_0x2ab79d){return db[_0x40ba('0x17')][_0x40ba('0x18')]({'raw':_0xee8fe9[_0x40ba('0x19')]?_0xee8fe9[_0x40ba('0x19')][_0x40ba('0x1a')]===undefined?!![]:![]:!![],'where':_0xee8fe9[_0x40ba('0x19')]?_0xee8fe9[_0x40ba('0x19')][_0x40ba('0x1b')]||null:null,'attributes':_0xee8fe9[_0x40ba('0x19')]?_0xee8fe9[_0x40ba('0x19')][_0x40ba('0x1c')]||null:null,'limit':_0xee8fe9[_0x40ba('0x19')]?_0xee8fe9[_0x40ba('0x19')]['limit']||null:null,'include':_0xee8fe9['options']?_0xee8fe9[_0x40ba('0x19')]['include']?_['map'](_0xee8fe9[_0x40ba('0x19')][_0x40ba('0x1d')],function(_0x499b56){return{'model':db[_0x499b56[_0x40ba('0x1e')]],'as':_0x499b56['as'],'attributes':_0x499b56[_0x40ba('0x1c')],'include':_0x499b56[_0x40ba('0x1d')]?_[_0x40ba('0x1f')](_0x499b56[_0x40ba('0x1d')],function(_0x4cee1f){return{'model':db[_0x4cee1f['model']],'as':_0x4cee1f['as'],'attributes':_0x4cee1f[_0x40ba('0x1c')],'include':_0x4cee1f[_0x40ba('0x1d')]?_[_0x40ba('0x1f')](_0x4cee1f[_0x40ba('0x1d')],function(_0x3bff5b){return{'model':db[_0x3bff5b[_0x40ba('0x1e')]],'as':_0x3bff5b['as'],'attributes':_0x3bff5b[_0x40ba('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x40ba('0xa')](function(_0x3c63e7){logger[_0x40ba('0xb')](_0x40ba('0x16'),_0xee8fe9);logger[_0x40ba('0xe')](_0x40ba('0x16'),_0xee8fe9,JSON[_0x40ba('0x10')](_0x3c63e7));_0x7673cc(_0x3c63e7);})[_0x40ba('0x15')](function(_0x58d74d){logger['error'](_0x40ba('0x16'),_0x58d74d['message'],_0xee8fe9);_0x2ab79d(_0x559e00[_0x40ba('0x11')](0x1f4,_0x58d74d['message']));});});};exports[_0x40ba('0x20')]=function(_0x4f6223){var _0x1b1bec=this;return new Promise(function(_0x3f1f76,_0x2b742b){return db[_0x40ba('0x17')][_0x40ba('0x21')]({'raw':_0x4f6223[_0x40ba('0x19')]?_0x4f6223[_0x40ba('0x19')][_0x40ba('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f6223[_0x40ba('0x19')]?_0x4f6223['options'][_0x40ba('0x1b')]||null:null,'attributes':_0x4f6223['options']?_0x4f6223['options'][_0x40ba('0x1c')]||null:null,'include':_0x4f6223['options']?_0x4f6223[_0x40ba('0x19')][_0x40ba('0x1d')]?_['map'](_0x4f6223[_0x40ba('0x19')][_0x40ba('0x1d')],function(_0x5e5c86){return{'model':db[_0x5e5c86[_0x40ba('0x1e')]],'as':_0x5e5c86['as'],'attributes':_0x5e5c86[_0x40ba('0x1c')],'include':_0x5e5c86[_0x40ba('0x1d')]?_[_0x40ba('0x1f')](_0x5e5c86[_0x40ba('0x1d')],function(_0x4f41db){return{'model':db[_0x4f41db['model']],'as':_0x4f41db['as'],'attributes':_0x4f41db[_0x40ba('0x1c')],'include':_0x4f41db[_0x40ba('0x1d')]?_[_0x40ba('0x1f')](_0x4f41db[_0x40ba('0x1d')],function(_0x4ca723){return{'model':db[_0x4ca723[_0x40ba('0x1e')]],'as':_0x4ca723['as'],'attributes':_0x4ca723['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b3ee5){logger[_0x40ba('0xb')](_0x40ba('0x20'),_0x4f6223);logger['debug'](_0x40ba('0x20'),_0x4f6223,JSON[_0x40ba('0x10')](_0x5b3ee5));_0x3f1f76(_0x5b3ee5);})[_0x40ba('0x15')](function(_0x3c1359){logger[_0x40ba('0x11')](_0x40ba('0x20'),_0x3c1359['message'],_0x4f6223);_0x2b742b(_0x1b1bec['error'](0x1f4,_0x3c1359['message']));});});}; \ No newline at end of file +var _0x89b9=['jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','options','raw','where','attributes','limit','include','model','map','debug','ShowFreshdeskAccount','FreshdeskAccount','find','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x89b9,0x17a));var _0x989b=function(_0x2c116a,_0x493285){_0x2c116a=_0x2c116a-0x0;var _0x17b26f=_0x89b9[_0x2c116a];return _0x17b26f;};'use strict';var _=require(_0x989b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x989b('0x1'));var db=require(_0x989b('0x2'))['db'];var utils=require(_0x989b('0x3'));var logger=require(_0x989b('0x4'))('rpc');var config=require(_0x989b('0x5'));var jayson=require(_0x989b('0x6'));var client=jayson[_0x989b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12edb9,_0x5d06da,_0x2ce6a3){return new BPromise(function(_0x3bc1fd,_0x30ff2f){return client[_0x989b('0x8')](_0x12edb9,_0x2ce6a3)[_0x989b('0x9')](function(_0x2794aa){logger[_0x989b('0xa')](_0x989b('0xb'),_0x5d06da,_0x989b('0xc'));logger['debug'](_0x989b('0xd'),_0x5d06da,_0x989b('0xc'),JSON[_0x989b('0xe')](_0x2794aa));if(_0x2794aa[_0x989b('0xf')]){if(_0x2794aa[_0x989b('0xf')]['code']===0x1f4){logger[_0x989b('0xf')](_0x989b('0xb'),_0x5d06da,_0x2794aa[_0x989b('0xf')][_0x989b('0x10')]);return _0x30ff2f(_0x2794aa[_0x989b('0xf')][_0x989b('0x10')]);}logger['error'](_0x989b('0xb'),_0x5d06da,_0x2794aa[_0x989b('0xf')][_0x989b('0x10')]);return _0x3bc1fd(_0x2794aa['error']['message']);}else{logger[_0x989b('0xa')](_0x989b('0xb'),_0x5d06da,_0x989b('0xc'));_0x3bc1fd(_0x2794aa[_0x989b('0x11')][_0x989b('0x10')]);}})['catch'](function(_0x5d4a12){logger[_0x989b('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x5d06da,_0x5d4a12);_0x30ff2f(_0x5d4a12);});});}exports[_0x989b('0x12')]=function(_0x14ca23){var _0x344042=this;return new Promise(function(_0x208d7c,_0x5b02c4){return db['FreshdeskAccount']['findAll']({'raw':_0x14ca23[_0x989b('0x13')]?_0x14ca23[_0x989b('0x13')][_0x989b('0x14')]===undefined?!![]:![]:!![],'where':_0x14ca23[_0x989b('0x13')]?_0x14ca23[_0x989b('0x13')][_0x989b('0x15')]||null:null,'attributes':_0x14ca23['options']?_0x14ca23[_0x989b('0x13')][_0x989b('0x16')]||null:null,'limit':_0x14ca23[_0x989b('0x13')]?_0x14ca23[_0x989b('0x13')][_0x989b('0x17')]||null:null,'include':_0x14ca23[_0x989b('0x13')]?_0x14ca23[_0x989b('0x13')][_0x989b('0x18')]?_['map'](_0x14ca23[_0x989b('0x13')]['include'],function(_0x464c3e){return{'model':db[_0x464c3e[_0x989b('0x19')]],'as':_0x464c3e['as'],'attributes':_0x464c3e[_0x989b('0x16')],'include':_0x464c3e[_0x989b('0x18')]?_[_0x989b('0x1a')](_0x464c3e['include'],function(_0x5e2497){return{'model':db[_0x5e2497['model']],'as':_0x5e2497['as'],'attributes':_0x5e2497[_0x989b('0x16')],'include':_0x5e2497[_0x989b('0x18')]?_['map'](_0x5e2497[_0x989b('0x18')],function(_0x5aac8d){return{'model':db[_0x5aac8d[_0x989b('0x19')]],'as':_0x5aac8d['as'],'attributes':_0x5aac8d[_0x989b('0x16')]};}):[]};}):[]};}):[]:[]})[_0x989b('0x9')](function(_0x3754ea){logger[_0x989b('0xa')]('GetFreshdeskAccount',_0x14ca23);logger[_0x989b('0x1b')](_0x989b('0x12'),_0x14ca23,JSON[_0x989b('0xe')](_0x3754ea));_0x208d7c(_0x3754ea);})['catch'](function(_0x225455){logger[_0x989b('0xf')](_0x989b('0x12'),_0x225455['message'],_0x14ca23);_0x5b02c4(_0x344042[_0x989b('0xf')](0x1f4,_0x225455[_0x989b('0x10')]));});});};exports[_0x989b('0x1c')]=function(_0x4067dc){var _0x58b7a4=this;return new Promise(function(_0x54be9c,_0x188b5e){return db[_0x989b('0x1d')][_0x989b('0x1e')]({'raw':_0x4067dc['options']?_0x4067dc[_0x989b('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4067dc[_0x989b('0x13')]?_0x4067dc[_0x989b('0x13')][_0x989b('0x15')]||null:null,'attributes':_0x4067dc[_0x989b('0x13')]?_0x4067dc[_0x989b('0x13')]['attributes']||null:null,'include':_0x4067dc[_0x989b('0x13')]?_0x4067dc[_0x989b('0x13')][_0x989b('0x18')]?_['map'](_0x4067dc[_0x989b('0x13')][_0x989b('0x18')],function(_0x101ff6){return{'model':db[_0x101ff6[_0x989b('0x19')]],'as':_0x101ff6['as'],'attributes':_0x101ff6[_0x989b('0x16')],'include':_0x101ff6[_0x989b('0x18')]?_[_0x989b('0x1a')](_0x101ff6['include'],function(_0x3e2e2b){return{'model':db[_0x3e2e2b[_0x989b('0x19')]],'as':_0x3e2e2b['as'],'attributes':_0x3e2e2b[_0x989b('0x16')],'include':_0x3e2e2b['include']?_[_0x989b('0x1a')](_0x3e2e2b[_0x989b('0x18')],function(_0x363b0e){return{'model':db[_0x363b0e[_0x989b('0x19')]],'as':_0x363b0e['as'],'attributes':_0x363b0e[_0x989b('0x16')]};}):[]};}):[]};}):[]:[]})[_0x989b('0x9')](function(_0x2ed39e){logger['info'](_0x989b('0x1c'),_0x4067dc);logger[_0x989b('0x1b')]('ShowFreshdeskAccount',_0x4067dc,JSON[_0x989b('0xe')](_0x2ed39e));_0x54be9c(_0x2ed39e);})[_0x989b('0x1f')](function(_0x2ff785){logger[_0x989b('0xf')]('ShowFreshdeskAccount',_0x2ff785['message'],_0x4067dc);_0x188b5e(_0x58b7a4[_0x989b('0xf')](0x1f4,_0x2ff785[_0x989b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5611931..ba683b4 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 _0x8cb4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','util','path','connect-timeout','express'];(function(_0x3cf792,_0x58f8b3){var _0x33ff62=function(_0x469fab){while(--_0x469fab){_0x3cf792['push'](_0x3cf792['shift']());}};_0x33ff62(++_0x58f8b3);}(_0x8cb4,0x134));var _0x48cb=function(_0x10c140,_0x530693){_0x10c140=_0x10c140-0x0;var _0x272af6=_0x8cb4[_0x10c140];return _0x272af6;};'use strict';var multer=require('multer');var util=require(_0x48cb('0x0'));var path=require(_0x48cb('0x1'));var timeout=require(_0x48cb('0x2'));var express=require(_0x48cb('0x3'));var router=express[_0x48cb('0x4')]();var fs_extra=require(_0x48cb('0x5'));var auth=require(_0x48cb('0x6'));var interaction=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x48cb('0x9')]('/',auth[_0x48cb('0xa')](),controller['index']);router[_0x48cb('0x9')](_0x48cb('0xb'),auth[_0x48cb('0xa')](),controller[_0x48cb('0xc')]);router[_0x48cb('0x9')](_0x48cb('0xd'),auth[_0x48cb('0xa')](),controller['getFields']);router[_0x48cb('0x9')](_0x48cb('0xe'),auth[_0x48cb('0xa')](),controller[_0x48cb('0xf')]);router['get'](_0x48cb('0x10'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x11')]);router[_0x48cb('0x9')](_0x48cb('0x12'),auth[_0x48cb('0xa')](),controller['getTags']);router[_0x48cb('0x13')]('/',auth[_0x48cb('0xa')](),controller[_0x48cb('0x14')]);router[_0x48cb('0x13')](_0x48cb('0x12'),auth[_0x48cb('0xa')](),controller['setTags']);router[_0x48cb('0x15')](_0x48cb('0xb'),auth['isAuthenticated'](),controller[_0x48cb('0x16')]);router[_0x48cb('0x17')](_0x48cb('0xb'),auth[_0x48cb('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5424=['/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get'];(function(_0x235906,_0x1ef2af){var _0x40a0aa=function(_0x38dc8f){while(--_0x38dc8f){_0x235906['push'](_0x235906['shift']());}};_0x40a0aa(++_0x1ef2af);}(_0x5424,0x115));var _0x4542=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x5424[_0x1f5a63];return _0x30bb7a;};'use strict';var multer=require(_0x4542('0x0'));var util=require(_0x4542('0x1'));var path=require('path');var timeout=require(_0x4542('0x2'));var express=require('express');var router=express[_0x4542('0x3')]();var fs_extra=require(_0x4542('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4542('0x5'));var config=require(_0x4542('0x6'));var controller=require(_0x4542('0x7'));router['get']('/',auth[_0x4542('0x8')](),controller[_0x4542('0x9')]);router[_0x4542('0xa')](_0x4542('0xb'),auth[_0x4542('0x8')](),controller[_0x4542('0xc')]);router[_0x4542('0xa')](_0x4542('0xd'),auth[_0x4542('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x4542('0x8')](),controller[_0x4542('0xe')]);router['get'](_0x4542('0xf'),auth[_0x4542('0x8')](),controller[_0x4542('0x10')]);router[_0x4542('0xa')](_0x4542('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0x4542('0x12')]('/',auth['isAuthenticated'](),controller[_0x4542('0x13')]);router['post']('/:id/tags',auth[_0x4542('0x8')](),controller[_0x4542('0x14')]);router[_0x4542('0x15')]('/:id',auth[_0x4542('0x8')](),controller['update']);router[_0x4542('0x16')](_0x4542('0xb'),auth[_0x4542('0x8')](),controller[_0x4542('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 837966a..9c8068d 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 _0xfa6e=['STRING','sequelize'];(function(_0x3ffd3a,_0x59c27b){var _0x40d477=function(_0x1ff127){while(--_0x1ff127){_0x3ffd3a['push'](_0x3ffd3a['shift']());}};_0x40d477(++_0x59c27b);}(_0xfa6e,0x1cb));var _0xefa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa6e[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xefa6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefa6('0x1')]}}; \ No newline at end of file +var _0x9ba6=['STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9ba6,0x70));var _0x69ba=function(_0x27e530,_0x16ca05){_0x27e530=_0x27e530-0x0;var _0x2ccbec=_0x9ba6[_0x27e530];return _0x2ccbec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x69ba('0x0')]},'description':{'type':Sequelize[_0x69ba('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b562d84..3772632 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 _0xca43=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','FreshdeskConfiguration','length','find','catch','create','body','getFields','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','jsforce','desk.js','to-csv'];(function(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0xca43,0x9a));var _0x3ca4=function(_0x4c4fae,_0x20b39c){_0x4c4fae=_0x4c4fae-0x0;var _0x2a60d0=_0xca43[_0x4c4fae];return _0x2a60d0;};'use strict';var emlformat=require(_0x3ca4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ca4('0x1'));var jsonpatch=require(_0x3ca4('0x2'));var rp=require(_0x3ca4('0x3'));var moment=require(_0x3ca4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ca4('0x5'));var util=require('util');var path=require(_0x3ca4('0x6'));var sox=require(_0x3ca4('0x7'));var csv=require('to-csv');var ejs=require(_0x3ca4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ca4('0x9'));var deskjs=require(_0x3ca4('0xa'));var toCsv=require(_0x3ca4('0xb'));var querystring=require(_0x3ca4('0xc'));var Papa=require('papaparse');var Redis=require(_0x3ca4('0xd'));var authService=require(_0x3ca4('0xe'));var qs=require(_0x3ca4('0xf'));var as=require(_0x3ca4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ca4('0x11'))(_0x3ca4('0x12'));var utils=require(_0x3ca4('0x13'));var config=require(_0x3ca4('0x14'));var licenseUtil=require(_0x3ca4('0x15'));var db=require(_0x3ca4('0x16'))['db'];function respondWithStatusCode(_0x3ebeca,_0x348a8f){_0x348a8f=_0x348a8f||0xcc;return function(_0x43f310){if(_0x43f310){return _0x3ebeca[_0x3ca4('0x17')](_0x348a8f);}return _0x3ebeca['status'](_0x348a8f)['end']();};}function respondWithResult(_0x55a678,_0x4a7356){_0x4a7356=_0x4a7356||0xc8;return function(_0x5bd58b){if(_0x5bd58b){return _0x55a678[_0x3ca4('0x18')](_0x4a7356)[_0x3ca4('0x19')](_0x5bd58b);}};}function respondWithFilteredResult(_0x2e0401,_0x216e72){return function(_0xf440c2){if(_0xf440c2){var _0x3a6696=typeof _0x216e72['offset']===_0x3ca4('0x1a')&&typeof _0x216e72[_0x3ca4('0x1b')]==='undefined';var _0x25e12a=_0xf440c2[_0x3ca4('0x1c')];var _0x17585a=_0x3a6696?0x0:_0x216e72[_0x3ca4('0x1d')];var _0x262aab=_0x3a6696?_0xf440c2[_0x3ca4('0x1c')]:_0x216e72[_0x3ca4('0x1d')]+_0x216e72['limit'];var _0x344e0f;if(_0x262aab>=_0x25e12a){_0x262aab=_0x25e12a;_0x344e0f=0xc8;}else{_0x344e0f=0xce;}_0x2e0401[_0x3ca4('0x18')](_0x344e0f);return _0x2e0401['set']('Content-Range',_0x17585a+'-'+_0x262aab+'/'+_0x25e12a)['json'](_0xf440c2);}return null;};}function patchUpdates(_0x561543){return function(_0x2889f7){try{jsonpatch[_0x3ca4('0x1e')](_0x2889f7,_0x561543,!![]);}catch(_0x468c61){return BPromise[_0x3ca4('0x1f')](_0x468c61);}return _0x2889f7[_0x3ca4('0x20')]();};}function saveUpdates(_0x4ffb14,_0x4eb533){return function(_0x2b90f2){if(_0x2b90f2){return _0x2b90f2[_0x3ca4('0x21')](_0x4ffb14)[_0x3ca4('0x22')](function(_0x5a75df){return _0x5a75df;});}return null;};}function removeEntity(_0x1b4246,_0x206717){return function(_0x36624b){if(_0x36624b){return _0x36624b[_0x3ca4('0x23')]()[_0x3ca4('0x22')](function(){_0x1b4246[_0x3ca4('0x18')](0xcc)[_0x3ca4('0x24')]();});}};}function handleEntityNotFound(_0x99b4db,_0x1646fd){return function(_0x409b16){if(!_0x409b16){_0x99b4db[_0x3ca4('0x17')](0x194);}return _0x409b16;};}function handleError(_0x45520a,_0x30b324){_0x30b324=_0x30b324||0x1f4;return function(_0x1e6718){logger[_0x3ca4('0x25')](_0x1e6718[_0x3ca4('0x26')]);if(_0x1e6718[_0x3ca4('0x27')]){delete _0x1e6718[_0x3ca4('0x27')];}_0x45520a[_0x3ca4('0x18')](_0x30b324)[_0x3ca4('0x28')](_0x1e6718);};}exports[_0x3ca4('0x29')]=function(_0xb25334,_0x2b77be){var _0x4fd922={},_0x27789f={},_0x90eea1={'count':0x0,'rows':[]};var _0x303740=_[_0x3ca4('0x2a')](db['FreshdeskConfiguration'][_0x3ca4('0x2b')],function(_0x289f10){return{'name':_0x289f10['fieldName'],'type':_0x289f10['type'][_0x3ca4('0x2c')]};});_0x27789f[_0x3ca4('0x2d')]=_[_0x3ca4('0x2a')](_0x303740,_0x3ca4('0x27'));_0x27789f[_0x3ca4('0x2e')]=_[_0x3ca4('0x2f')](_0xb25334[_0x3ca4('0x2e')]);_0x27789f[_0x3ca4('0x30')]=_[_0x3ca4('0x31')](_0x27789f[_0x3ca4('0x2d')],_0x27789f[_0x3ca4('0x2e')]);_0x4fd922[_0x3ca4('0x32')]=_[_0x3ca4('0x31')](_0x27789f[_0x3ca4('0x2d')],qs[_0x3ca4('0x33')](_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x33')]));_0x4fd922[_0x3ca4('0x32')]=_0x4fd922[_0x3ca4('0x32')]['length']?_0x4fd922[_0x3ca4('0x32')]:_0x27789f['model'];if(!_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x34')](_0x3ca4('0x35'))){_0x4fd922[_0x3ca4('0x1b')]=qs[_0x3ca4('0x1b')](_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x1b')]);_0x4fd922[_0x3ca4('0x1d')]=qs['offset'](_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x1d')]);}_0x4fd922[_0x3ca4('0x36')]=qs['sort'](_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x37')]);_0x4fd922[_0x3ca4('0x38')]=qs[_0x3ca4('0x30')](_[_0x3ca4('0x39')](_0xb25334[_0x3ca4('0x2e')],_0x27789f[_0x3ca4('0x30')]),_0x303740);if(_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x3a')]){_0x4fd922[_0x3ca4('0x38')]=_[_0x3ca4('0x3b')](_0x4fd922[_0x3ca4('0x38')],{'$or':_['map'](_0x303740,function(_0x796b0d){if(_0x796b0d[_0x3ca4('0x3c')]!==_0x3ca4('0x3d')){var _0x44d53b={};_0x44d53b[_0x796b0d[_0x3ca4('0x27')]]={'$like':'%'+_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x3a')]+'%'};return _0x44d53b;}})});}_0x4fd922=_[_0x3ca4('0x3b')]({},_0x4fd922,_0xb25334[_0x3ca4('0x3e')]);var _0x261f28={'where':_0x4fd922['where']};return db['FreshdeskConfiguration']['count'](_0x261f28)[_0x3ca4('0x22')](function(_0x5bbb5e){_0x90eea1[_0x3ca4('0x1c')]=_0x5bbb5e;if(_0xb25334[_0x3ca4('0x2e')][_0x3ca4('0x3f')]){_0x4fd922[_0x3ca4('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x3ca4('0x41')](_0x4fd922);})['then'](function(_0x548996){_0x90eea1[_0x3ca4('0x42')]=_0x548996;return _0x90eea1;})[_0x3ca4('0x22')](respondWithFilteredResult(_0x2b77be,_0x4fd922))['catch'](handleError(_0x2b77be,null));};exports[_0x3ca4('0x43')]=function(_0x4dbfe0,_0x1784b3){var _0x524820={'raw':![],'where':{'id':_0x4dbfe0[_0x3ca4('0x44')]['id']}},_0x477688={};_0x477688[_0x3ca4('0x2d')]=_['keys'](db[_0x3ca4('0x45')][_0x3ca4('0x2b')]);_0x477688[_0x3ca4('0x2e')]=_[_0x3ca4('0x2f')](_0x4dbfe0[_0x3ca4('0x2e')]);_0x477688['filters']=_[_0x3ca4('0x31')](_0x477688[_0x3ca4('0x2d')],_0x477688[_0x3ca4('0x2e')]);_0x524820[_0x3ca4('0x32')]=_[_0x3ca4('0x31')](_0x477688['model'],qs[_0x3ca4('0x33')](_0x4dbfe0[_0x3ca4('0x2e')]['fields']));_0x524820[_0x3ca4('0x32')]=_0x524820[_0x3ca4('0x32')][_0x3ca4('0x46')]?_0x524820['attributes']:_0x477688[_0x3ca4('0x2d')];if(_0x4dbfe0[_0x3ca4('0x2e')][_0x3ca4('0x3f')]){_0x524820[_0x3ca4('0x40')]=[{'all':!![]}];}_0x524820=_[_0x3ca4('0x3b')]({},_0x524820,_0x4dbfe0[_0x3ca4('0x3e')]);return db[_0x3ca4('0x45')][_0x3ca4('0x47')](_0x524820)[_0x3ca4('0x22')](handleEntityNotFound(_0x1784b3,null))[_0x3ca4('0x22')](respondWithResult(_0x1784b3,null))[_0x3ca4('0x48')](handleError(_0x1784b3,null));};exports[_0x3ca4('0x49')]=function(_0x18142d,_0x5f2892){return db[_0x3ca4('0x45')][_0x3ca4('0x49')](_0x18142d[_0x3ca4('0x4a')],{})[_0x3ca4('0x22')](respondWithResult(_0x5f2892,0xc9))[_0x3ca4('0x48')](handleError(_0x5f2892,null));};exports[_0x3ca4('0x21')]=function(_0x3e120c,_0x569b6e){if(_0x3e120c[_0x3ca4('0x4a')]['id']){delete _0x3e120c[_0x3ca4('0x4a')]['id'];}return db[_0x3ca4('0x45')][_0x3ca4('0x47')]({'where':{'id':_0x3e120c[_0x3ca4('0x44')]['id']}})[_0x3ca4('0x22')](handleEntityNotFound(_0x569b6e,null))[_0x3ca4('0x22')](saveUpdates(_0x3e120c['body'],null))[_0x3ca4('0x22')](respondWithResult(_0x569b6e,null))[_0x3ca4('0x48')](handleError(_0x569b6e,null));};exports['destroy']=function(_0x5f4ccf,_0x8a7802){return db[_0x3ca4('0x45')][_0x3ca4('0x47')]({'where':{'id':_0x5f4ccf[_0x3ca4('0x44')]['id']}})['then'](handleEntityNotFound(_0x8a7802,null))[_0x3ca4('0x22')](removeEntity(_0x8a7802,null))[_0x3ca4('0x48')](handleError(_0x8a7802,null));};exports[_0x3ca4('0x4b')]=function(_0x53b5fa,_0x1975c1,_0x4fecd7){var _0x12fa45={};var _0x2b4e36={};var _0x3dc624;var _0x58547e;return db[_0x3ca4('0x45')]['findOne']({'where':{'id':_0x53b5fa[_0x3ca4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1975c1,null))['then'](function(_0x184dc2){if(_0x184dc2){_0x3dc624=_0x184dc2;_0x2b4e36[_0x3ca4('0x2d')]=_[_0x3ca4('0x2f')](db[_0x3ca4('0x4c')][_0x3ca4('0x2b')]);_0x2b4e36[_0x3ca4('0x2e')]=_[_0x3ca4('0x2f')](_0x53b5fa[_0x3ca4('0x2e')]);_0x2b4e36[_0x3ca4('0x30')]=_['intersection'](_0x2b4e36[_0x3ca4('0x2d')],_0x2b4e36[_0x3ca4('0x2e')]);_0x12fa45[_0x3ca4('0x32')]=_['intersection'](_0x2b4e36[_0x3ca4('0x2d')],qs[_0x3ca4('0x33')](_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x33')]));_0x12fa45[_0x3ca4('0x32')]=_0x12fa45[_0x3ca4('0x32')]['length']?_0x12fa45['attributes']:_0x2b4e36[_0x3ca4('0x2d')];_0x12fa45[_0x3ca4('0x36')]=qs[_0x3ca4('0x37')](_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x37')]);_0x12fa45[_0x3ca4('0x38')]=qs['filters'](_[_0x3ca4('0x39')](_0x53b5fa['query'],_0x2b4e36[_0x3ca4('0x30')]));if(_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x3a')]){_0x12fa45[_0x3ca4('0x38')]=_['merge'](_0x12fa45[_0x3ca4('0x38')],{'$or':_[_0x3ca4('0x2a')](_0x12fa45[_0x3ca4('0x32')],function(_0x3b8367){var _0x11d0fe={};_0x11d0fe[_0x3b8367]={'$like':'%'+_0x53b5fa[_0x3ca4('0x2e')]['filter']+'%'};return _0x11d0fe;})});}_0x12fa45=_[_0x3ca4('0x3b')]({},_0x12fa45,_0x53b5fa['options']);return _0x3dc624[_0x3ca4('0x4b')](_0x12fa45);}})[_0x3ca4('0x22')](function(_0x8a5f9){if(_0x8a5f9){_0x58547e=_0x8a5f9[_0x3ca4('0x46')];if(!_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x34')](_0x3ca4('0x35'))){_0x12fa45['limit']=qs[_0x3ca4('0x1b')](_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x1b')]);_0x12fa45[_0x3ca4('0x1d')]=qs['offset'](_0x53b5fa[_0x3ca4('0x2e')][_0x3ca4('0x1d')]);}return _0x3dc624[_0x3ca4('0x4b')](_0x12fa45);}})[_0x3ca4('0x22')](function(_0x27858e){if(_0x27858e){return _0x27858e?{'count':_0x58547e,'rows':_0x27858e}:null;}})['then'](respondWithResult(_0x1975c1,null))[_0x3ca4('0x48')](handleError(_0x1975c1,null));};exports[_0x3ca4('0x4d')]=function(_0x4f10b2,_0x5ea2fd,_0x2cc676){var _0x410242={};var _0x17fa25={};var _0x30bccc;var _0x1544e4;return db[_0x3ca4('0x45')]['findOne']({'where':{'id':_0x4f10b2['params']['id']}})[_0x3ca4('0x22')](handleEntityNotFound(_0x5ea2fd,null))[_0x3ca4('0x22')](function(_0x920967){if(_0x920967){_0x30bccc=_0x920967;_0x17fa25['model']=_['keys'](db['FreshdeskField']['rawAttributes']);_0x17fa25[_0x3ca4('0x2e')]=_['keys'](_0x4f10b2[_0x3ca4('0x2e')]);_0x17fa25[_0x3ca4('0x30')]=_['intersection'](_0x17fa25[_0x3ca4('0x2d')],_0x17fa25['query']);_0x410242[_0x3ca4('0x32')]=_[_0x3ca4('0x31')](_0x17fa25[_0x3ca4('0x2d')],qs[_0x3ca4('0x33')](_0x4f10b2[_0x3ca4('0x2e')]['fields']));_0x410242[_0x3ca4('0x32')]=_0x410242['attributes']['length']?_0x410242['attributes']:_0x17fa25[_0x3ca4('0x2d')];_0x410242[_0x3ca4('0x36')]=qs[_0x3ca4('0x37')](_0x4f10b2['query'][_0x3ca4('0x37')]);_0x410242[_0x3ca4('0x38')]=qs[_0x3ca4('0x30')](_['pick'](_0x4f10b2['query'],_0x17fa25[_0x3ca4('0x30')]));if(_0x4f10b2[_0x3ca4('0x2e')][_0x3ca4('0x3a')]){_0x410242[_0x3ca4('0x38')]=_['merge'](_0x410242[_0x3ca4('0x38')],{'$or':_[_0x3ca4('0x2a')](_0x410242[_0x3ca4('0x32')],function(_0x23e6f9){var _0x3449d9={};_0x3449d9[_0x23e6f9]={'$like':'%'+_0x4f10b2[_0x3ca4('0x2e')]['filter']+'%'};return _0x3449d9;})});}_0x410242=_[_0x3ca4('0x3b')]({},_0x410242,_0x4f10b2[_0x3ca4('0x3e')]);return _0x30bccc[_0x3ca4('0x4d')](_0x410242);}})['then'](function(_0xf464b2){if(_0xf464b2){_0x1544e4=_0xf464b2['length'];if(!_0x4f10b2['query']['hasOwnProperty'](_0x3ca4('0x35'))){_0x410242[_0x3ca4('0x1b')]=qs['limit'](_0x4f10b2[_0x3ca4('0x2e')][_0x3ca4('0x1b')]);_0x410242[_0x3ca4('0x1d')]=qs[_0x3ca4('0x1d')](_0x4f10b2[_0x3ca4('0x2e')][_0x3ca4('0x1d')]);}return _0x30bccc['getSubjects'](_0x410242);}})[_0x3ca4('0x22')](function(_0x192bd8){if(_0x192bd8){return _0x192bd8?{'count':_0x1544e4,'rows':_0x192bd8}:null;}})[_0x3ca4('0x22')](respondWithResult(_0x5ea2fd,null))['catch'](handleError(_0x5ea2fd,null));};exports['getDescriptions']=function(_0x42cbb7,_0x478947,_0x355a7c){var _0x4855ed={};var _0x262a27={};var _0x3c4d3f;var _0x5ca71d;return db[_0x3ca4('0x45')]['findOne']({'where':{'id':_0x42cbb7['params']['id']}})['then'](handleEntityNotFound(_0x478947,null))[_0x3ca4('0x22')](function(_0x42e3b5){if(_0x42e3b5){_0x3c4d3f=_0x42e3b5;_0x262a27['model']=_[_0x3ca4('0x2f')](db[_0x3ca4('0x4c')][_0x3ca4('0x2b')]);_0x262a27[_0x3ca4('0x2e')]=_['keys'](_0x42cbb7[_0x3ca4('0x2e')]);_0x262a27['filters']=_['intersection'](_0x262a27[_0x3ca4('0x2d')],_0x262a27[_0x3ca4('0x2e')]);_0x4855ed[_0x3ca4('0x32')]=_[_0x3ca4('0x31')](_0x262a27[_0x3ca4('0x2d')],qs[_0x3ca4('0x33')](_0x42cbb7['query'][_0x3ca4('0x33')]));_0x4855ed[_0x3ca4('0x32')]=_0x4855ed[_0x3ca4('0x32')]['length']?_0x4855ed[_0x3ca4('0x32')]:_0x262a27[_0x3ca4('0x2d')];_0x4855ed['order']=qs[_0x3ca4('0x37')](_0x42cbb7[_0x3ca4('0x2e')][_0x3ca4('0x37')]);_0x4855ed[_0x3ca4('0x38')]=qs[_0x3ca4('0x30')](_[_0x3ca4('0x39')](_0x42cbb7[_0x3ca4('0x2e')],_0x262a27['filters']));if(_0x42cbb7[_0x3ca4('0x2e')]['filter']){_0x4855ed[_0x3ca4('0x38')]=_[_0x3ca4('0x3b')](_0x4855ed[_0x3ca4('0x38')],{'$or':_[_0x3ca4('0x2a')](_0x4855ed[_0x3ca4('0x32')],function(_0x211783){var _0x283418={};_0x283418[_0x211783]={'$like':'%'+_0x42cbb7['query']['filter']+'%'};return _0x283418;})});}_0x4855ed=_[_0x3ca4('0x3b')]({},_0x4855ed,_0x42cbb7[_0x3ca4('0x3e')]);return _0x3c4d3f[_0x3ca4('0x4e')](_0x4855ed);}})['then'](function(_0x453f76){if(_0x453f76){_0x5ca71d=_0x453f76[_0x3ca4('0x46')];if(!_0x42cbb7[_0x3ca4('0x2e')][_0x3ca4('0x34')](_0x3ca4('0x35'))){_0x4855ed[_0x3ca4('0x1b')]=qs[_0x3ca4('0x1b')](_0x42cbb7['query'][_0x3ca4('0x1b')]);_0x4855ed['offset']=qs['offset'](_0x42cbb7['query']['offset']);}return _0x3c4d3f[_0x3ca4('0x4e')](_0x4855ed);}})[_0x3ca4('0x22')](function(_0x1d8ecb){if(_0x1d8ecb){return _0x1d8ecb?{'count':_0x5ca71d,'rows':_0x1d8ecb}:null;}})[_0x3ca4('0x22')](respondWithResult(_0x478947,null))[_0x3ca4('0x48')](handleError(_0x478947,null));};exports[_0x3ca4('0x4f')]=function(_0x21843b,_0x2e2296,_0x24a70c){var _0x362281={};var _0x597d9c={};var _0x4de3d0;var _0x4c4d3c;return db[_0x3ca4('0x45')]['findOne']({'where':{'id':_0x21843b['params']['id']}})[_0x3ca4('0x22')](handleEntityNotFound(_0x2e2296,null))[_0x3ca4('0x22')](function(_0x45d520){if(_0x45d520){_0x4de3d0=_0x45d520;_0x597d9c[_0x3ca4('0x2d')]=_['keys'](db[_0x3ca4('0x50')]['rawAttributes']);_0x597d9c['query']=_[_0x3ca4('0x2f')](_0x21843b[_0x3ca4('0x2e')]);_0x597d9c[_0x3ca4('0x30')]=_[_0x3ca4('0x31')](_0x597d9c[_0x3ca4('0x2d')],_0x597d9c[_0x3ca4('0x2e')]);_0x362281[_0x3ca4('0x32')]=_[_0x3ca4('0x31')](_0x597d9c[_0x3ca4('0x2d')],qs[_0x3ca4('0x33')](_0x21843b[_0x3ca4('0x2e')][_0x3ca4('0x33')]));_0x362281[_0x3ca4('0x32')]=_0x362281[_0x3ca4('0x32')]['length']?_0x362281['attributes']:_0x597d9c[_0x3ca4('0x2d')];_0x362281[_0x3ca4('0x36')]=qs[_0x3ca4('0x37')](_0x21843b[_0x3ca4('0x2e')]['sort']);_0x362281[_0x3ca4('0x38')]=qs[_0x3ca4('0x30')](_[_0x3ca4('0x39')](_0x21843b[_0x3ca4('0x2e')],_0x597d9c[_0x3ca4('0x30')]));if(_0x21843b[_0x3ca4('0x2e')]['filter']){_0x362281[_0x3ca4('0x38')]=_['merge'](_0x362281[_0x3ca4('0x38')],{'$or':_[_0x3ca4('0x2a')](_0x362281['attributes'],function(_0x3d7b44){var _0x4c8feb={};_0x4c8feb[_0x3d7b44]={'$like':'%'+_0x21843b['query']['filter']+'%'};return _0x4c8feb;})});}_0x362281=_['merge']({},_0x362281,_0x21843b[_0x3ca4('0x3e')]);return _0x4de3d0['getTags'](_0x362281);}})[_0x3ca4('0x22')](function(_0x2211ea){if(_0x2211ea){_0x4c4d3c=_0x2211ea[_0x3ca4('0x46')];if(!_0x21843b[_0x3ca4('0x2e')]['hasOwnProperty'](_0x3ca4('0x35'))){_0x362281[_0x3ca4('0x1b')]=qs[_0x3ca4('0x1b')](_0x21843b['query'][_0x3ca4('0x1b')]);_0x362281[_0x3ca4('0x1d')]=qs['offset'](_0x21843b[_0x3ca4('0x2e')][_0x3ca4('0x1d')]);}return _0x4de3d0[_0x3ca4('0x4f')](_0x362281);}})[_0x3ca4('0x22')](function(_0x13d1f9){if(_0x13d1f9){return _0x13d1f9?{'count':_0x4c4d3c,'rows':_0x13d1f9}:null;}})[_0x3ca4('0x22')](respondWithResult(_0x2e2296,null))[_0x3ca4('0x48')](handleError(_0x2e2296,null));};exports[_0x3ca4('0x51')]=function(_0x41c5f7,_0x8b45,_0x23a121){if(_0x41c5f7[_0x3ca4('0x4a')]['id']){delete _0x41c5f7[_0x3ca4('0x4a')]['id'];}return db[_0x3ca4('0x45')]['findOne']({'where':{'id':_0x41c5f7[_0x3ca4('0x44')]['id']}})[_0x3ca4('0x22')](handleEntityNotFound(_0x8b45,null))['then'](function(_0x3cbd26){if(_0x3cbd26){return _0x3cbd26['setTags'](_0x41c5f7[_0x3ca4('0x4a')][_0x3ca4('0x52')]||[]);}return null;})[_0x3ca4('0x22')](respondWithResult(_0x8b45,null))[_0x3ca4('0x48')](handleError(_0x8b45,null));}; \ No newline at end of file +var _0xcfbb=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','getSubjects','FreshdeskField','nolimit','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x289801,_0x3773a8){var _0x6f2b04=function(_0x1e0d2a){while(--_0x1e0d2a){_0x289801['push'](_0x289801['shift']());}};_0x6f2b04(++_0x3773a8);}(_0xcfbb,0x6c));var _0xbcfb=function(_0x1c7bcd,_0x478875){_0x1c7bcd=_0x1c7bcd-0x0;var _0x554320=_0xcfbb[_0x1c7bcd];return _0x554320;};'use strict';var emlformat=require(_0xbcfb('0x0'));var rimraf=require(_0xbcfb('0x1'));var zipdir=require(_0xbcfb('0x2'));var jsonpatch=require(_0xbcfb('0x3'));var rp=require(_0xbcfb('0x4'));var moment=require(_0xbcfb('0x5'));var BPromise=require(_0xbcfb('0x6'));var Mustache=require(_0xbcfb('0x7'));var util=require(_0xbcfb('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbcfb('0x9'));var fs=require('fs');var fs_extra=require(_0xbcfb('0xa'));var _=require(_0xbcfb('0xb'));var squel=require(_0xbcfb('0xc'));var crypto=require(_0xbcfb('0xd'));var jsforce=require(_0xbcfb('0xe'));var deskjs=require(_0xbcfb('0xf'));var toCsv=require(_0xbcfb('0x10'));var querystring=require('querystring');var Papa=require(_0xbcfb('0x11'));var Redis=require(_0xbcfb('0x12'));var authService=require(_0xbcfb('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcfb('0x14'));var logger=require(_0xbcfb('0x15'))(_0xbcfb('0x16'));var utils=require(_0xbcfb('0x17'));var config=require(_0xbcfb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcfb('0x19'))['db'];function respondWithStatusCode(_0x57c9e1,_0x416205){_0x416205=_0x416205||0xcc;return function(_0x131635){if(_0x131635){return _0x57c9e1[_0xbcfb('0x1a')](_0x416205);}return _0x57c9e1[_0xbcfb('0x1b')](_0x416205)[_0xbcfb('0x1c')]();};}function respondWithResult(_0x7edc30,_0x1a9d3a){_0x1a9d3a=_0x1a9d3a||0xc8;return function(_0x25ad0d){if(_0x25ad0d){return _0x7edc30[_0xbcfb('0x1b')](_0x1a9d3a)['json'](_0x25ad0d);}};}function respondWithFilteredResult(_0x3debda,_0x499e64){return function(_0x47189f){if(_0x47189f){var _0x150a21=typeof _0x499e64['offset']==='undefined'&&typeof _0x499e64[_0xbcfb('0x1d')]===_0xbcfb('0x1e');var _0x797da2=_0x47189f[_0xbcfb('0x1f')];var _0x2f8273=_0x150a21?0x0:_0x499e64[_0xbcfb('0x20')];var _0x216f6c=_0x150a21?_0x47189f[_0xbcfb('0x1f')]:_0x499e64[_0xbcfb('0x20')]+_0x499e64[_0xbcfb('0x1d')];var _0x432b47;if(_0x216f6c>=_0x797da2){_0x216f6c=_0x797da2;_0x432b47=0xc8;}else{_0x432b47=0xce;}_0x3debda['status'](_0x432b47);return _0x3debda['set']('Content-Range',_0x2f8273+'-'+_0x216f6c+'/'+_0x797da2)[_0xbcfb('0x21')](_0x47189f);}return null;};}function patchUpdates(_0x58a609){return function(_0x341c56){try{jsonpatch[_0xbcfb('0x22')](_0x341c56,_0x58a609,!![]);}catch(_0x1f4773){return BPromise[_0xbcfb('0x23')](_0x1f4773);}return _0x341c56[_0xbcfb('0x24')]();};}function saveUpdates(_0x5d7fd0,_0xb35cf2){return function(_0x442205){if(_0x442205){return _0x442205[_0xbcfb('0x25')](_0x5d7fd0)[_0xbcfb('0x26')](function(_0x16af99){return _0x16af99;});}return null;};}function removeEntity(_0x44efdd,_0x3ccfe7){return function(_0x3e4c21){if(_0x3e4c21){return _0x3e4c21[_0xbcfb('0x27')]()['then'](function(){_0x44efdd[_0xbcfb('0x1b')](0xcc)[_0xbcfb('0x1c')]();});}};}function handleEntityNotFound(_0xd68bd9,_0x297617){return function(_0x3fbc7a){if(!_0x3fbc7a){_0xd68bd9[_0xbcfb('0x1a')](0x194);}return _0x3fbc7a;};}function handleError(_0x1ed6aa,_0x32493f){_0x32493f=_0x32493f||0x1f4;return function(_0x1608db){logger[_0xbcfb('0x28')](_0x1608db[_0xbcfb('0x29')]);if(_0x1608db[_0xbcfb('0x2a')]){delete _0x1608db[_0xbcfb('0x2a')];}_0x1ed6aa[_0xbcfb('0x1b')](_0x32493f)[_0xbcfb('0x2b')](_0x1608db);};}exports[_0xbcfb('0x2c')]=function(_0x51d37f,_0x1eb1a4){var _0x2387a4={},_0xcf6c33={},_0x4f3aa5={'count':0x0,'rows':[]};var _0x378d22=_[_0xbcfb('0x2d')](db[_0xbcfb('0x2e')][_0xbcfb('0x2f')],function(_0x4922a8){return{'name':_0x4922a8[_0xbcfb('0x30')],'type':_0x4922a8[_0xbcfb('0x31')]['key']};});_0xcf6c33[_0xbcfb('0x32')]=_[_0xbcfb('0x2d')](_0x378d22,_0xbcfb('0x2a'));_0xcf6c33['query']=_[_0xbcfb('0x33')](_0x51d37f[_0xbcfb('0x34')]);_0xcf6c33[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0xcf6c33['model'],_0xcf6c33['query']);_0x2387a4[_0xbcfb('0x37')]=_['intersection'](_0xcf6c33[_0xbcfb('0x32')],qs['fields'](_0x51d37f[_0xbcfb('0x34')][_0xbcfb('0x38')]));_0x2387a4[_0xbcfb('0x37')]=_0x2387a4['attributes'][_0xbcfb('0x39')]?_0x2387a4[_0xbcfb('0x37')]:_0xcf6c33[_0xbcfb('0x32')];if(!_0x51d37f[_0xbcfb('0x34')][_0xbcfb('0x3a')]('nolimit')){_0x2387a4[_0xbcfb('0x1d')]=qs[_0xbcfb('0x1d')](_0x51d37f['query'][_0xbcfb('0x1d')]);_0x2387a4[_0xbcfb('0x20')]=qs[_0xbcfb('0x20')](_0x51d37f[_0xbcfb('0x34')]['offset']);}_0x2387a4[_0xbcfb('0x3b')]=qs[_0xbcfb('0x3c')](_0x51d37f[_0xbcfb('0x34')][_0xbcfb('0x3c')]);_0x2387a4[_0xbcfb('0x3d')]=qs[_0xbcfb('0x35')](_[_0xbcfb('0x3e')](_0x51d37f[_0xbcfb('0x34')],_0xcf6c33['filters']),_0x378d22);if(_0x51d37f[_0xbcfb('0x34')][_0xbcfb('0x3f')]){_0x2387a4[_0xbcfb('0x3d')]=_[_0xbcfb('0x40')](_0x2387a4[_0xbcfb('0x3d')],{'$or':_[_0xbcfb('0x2d')](_0x378d22,function(_0x5f0c61){if(_0x5f0c61[_0xbcfb('0x31')]!==_0xbcfb('0x41')){var _0xfb58b8={};_0xfb58b8[_0x5f0c61[_0xbcfb('0x2a')]]={'$like':'%'+_0x51d37f[_0xbcfb('0x34')][_0xbcfb('0x3f')]+'%'};return _0xfb58b8;}})});}_0x2387a4=_['merge']({},_0x2387a4,_0x51d37f[_0xbcfb('0x42')]);var _0x449a93={'where':_0x2387a4[_0xbcfb('0x3d')]};return db[_0xbcfb('0x2e')]['count'](_0x449a93)[_0xbcfb('0x26')](function(_0x4e1d03){_0x4f3aa5[_0xbcfb('0x1f')]=_0x4e1d03;if(_0x51d37f['query'][_0xbcfb('0x43')]){_0x2387a4[_0xbcfb('0x44')]=[{'all':!![]}];}return db[_0xbcfb('0x2e')]['findAll'](_0x2387a4);})[_0xbcfb('0x26')](function(_0x42a898){_0x4f3aa5[_0xbcfb('0x45')]=_0x42a898;return _0x4f3aa5;})['then'](respondWithFilteredResult(_0x1eb1a4,_0x2387a4))[_0xbcfb('0x46')](handleError(_0x1eb1a4,null));};exports[_0xbcfb('0x47')]=function(_0xa57f6d,_0x3615b8){var _0x163f5e={'raw':![],'where':{'id':_0xa57f6d[_0xbcfb('0x48')]['id']}},_0x3be7a4={};_0x3be7a4[_0xbcfb('0x32')]=_[_0xbcfb('0x33')](db['FreshdeskConfiguration'][_0xbcfb('0x2f')]);_0x3be7a4[_0xbcfb('0x34')]=_[_0xbcfb('0x33')](_0xa57f6d[_0xbcfb('0x34')]);_0x3be7a4[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0x3be7a4[_0xbcfb('0x32')],_0x3be7a4[_0xbcfb('0x34')]);_0x163f5e[_0xbcfb('0x37')]=_[_0xbcfb('0x36')](_0x3be7a4[_0xbcfb('0x32')],qs['fields'](_0xa57f6d[_0xbcfb('0x34')]['fields']));_0x163f5e[_0xbcfb('0x37')]=_0x163f5e[_0xbcfb('0x37')][_0xbcfb('0x39')]?_0x163f5e['attributes']:_0x3be7a4[_0xbcfb('0x32')];if(_0xa57f6d[_0xbcfb('0x34')][_0xbcfb('0x43')]){_0x163f5e[_0xbcfb('0x44')]=[{'all':!![]}];}_0x163f5e=_['merge']({},_0x163f5e,_0xa57f6d[_0xbcfb('0x42')]);return db[_0xbcfb('0x2e')][_0xbcfb('0x49')](_0x163f5e)['then'](handleEntityNotFound(_0x3615b8,null))[_0xbcfb('0x26')](respondWithResult(_0x3615b8,null))[_0xbcfb('0x46')](handleError(_0x3615b8,null));};exports[_0xbcfb('0x4a')]=function(_0x58045a,_0x14503c){return db['FreshdeskConfiguration'][_0xbcfb('0x4a')](_0x58045a[_0xbcfb('0x4b')],{})[_0xbcfb('0x26')](respondWithResult(_0x14503c,0xc9))[_0xbcfb('0x46')](handleError(_0x14503c,null));};exports[_0xbcfb('0x25')]=function(_0x20576a,_0x46d7c0){if(_0x20576a[_0xbcfb('0x4b')]['id']){delete _0x20576a[_0xbcfb('0x4b')]['id'];}return db[_0xbcfb('0x2e')][_0xbcfb('0x49')]({'where':{'id':_0x20576a['params']['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x46d7c0,null))[_0xbcfb('0x26')](saveUpdates(_0x20576a[_0xbcfb('0x4b')],null))[_0xbcfb('0x26')](respondWithResult(_0x46d7c0,null))[_0xbcfb('0x46')](handleError(_0x46d7c0,null));};exports[_0xbcfb('0x27')]=function(_0x2a175b,_0x15f3d3){return db[_0xbcfb('0x2e')][_0xbcfb('0x49')]({'where':{'id':_0x2a175b[_0xbcfb('0x48')]['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x15f3d3,null))[_0xbcfb('0x26')](removeEntity(_0x15f3d3,null))[_0xbcfb('0x46')](handleError(_0x15f3d3,null));};exports[_0xbcfb('0x4c')]=function(_0x2d77cb,_0x511983,_0x1b4cea){var _0x17f4c2={};var _0x5ba101={};var _0x5bd685;var _0x251d28;return db[_0xbcfb('0x2e')][_0xbcfb('0x4d')]({'where':{'id':_0x2d77cb['params']['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x511983,null))[_0xbcfb('0x26')](function(_0x55b339){if(_0x55b339){_0x5bd685=_0x55b339;_0x5ba101[_0xbcfb('0x32')]=_['keys'](db['FreshdeskField'][_0xbcfb('0x2f')]);_0x5ba101[_0xbcfb('0x34')]=_['keys'](_0x2d77cb[_0xbcfb('0x34')]);_0x5ba101[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0x5ba101[_0xbcfb('0x32')],_0x5ba101['query']);_0x17f4c2[_0xbcfb('0x37')]=_[_0xbcfb('0x36')](_0x5ba101[_0xbcfb('0x32')],qs['fields'](_0x2d77cb[_0xbcfb('0x34')]['fields']));_0x17f4c2[_0xbcfb('0x37')]=_0x17f4c2['attributes']['length']?_0x17f4c2['attributes']:_0x5ba101[_0xbcfb('0x32')];_0x17f4c2[_0xbcfb('0x3b')]=qs[_0xbcfb('0x3c')](_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x3c')]);_0x17f4c2[_0xbcfb('0x3d')]=qs[_0xbcfb('0x35')](_[_0xbcfb('0x3e')](_0x2d77cb['query'],_0x5ba101[_0xbcfb('0x35')]));if(_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x3f')]){_0x17f4c2[_0xbcfb('0x3d')]=_[_0xbcfb('0x40')](_0x17f4c2[_0xbcfb('0x3d')],{'$or':_[_0xbcfb('0x2d')](_0x17f4c2[_0xbcfb('0x37')],function(_0x4542ab){var _0x1fc61f={};_0x1fc61f[_0x4542ab]={'$like':'%'+_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x3f')]+'%'};return _0x1fc61f;})});}_0x17f4c2=_[_0xbcfb('0x40')]({},_0x17f4c2,_0x2d77cb[_0xbcfb('0x42')]);return _0x5bd685[_0xbcfb('0x4c')](_0x17f4c2);}})['then'](function(_0x967c9e){if(_0x967c9e){_0x251d28=_0x967c9e[_0xbcfb('0x39')];if(!_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x3a')]('nolimit')){_0x17f4c2[_0xbcfb('0x1d')]=qs[_0xbcfb('0x1d')](_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x1d')]);_0x17f4c2[_0xbcfb('0x20')]=qs[_0xbcfb('0x20')](_0x2d77cb[_0xbcfb('0x34')][_0xbcfb('0x20')]);}return _0x5bd685[_0xbcfb('0x4c')](_0x17f4c2);}})[_0xbcfb('0x26')](function(_0x3fe8cc){if(_0x3fe8cc){return _0x3fe8cc?{'count':_0x251d28,'rows':_0x3fe8cc}:null;}})[_0xbcfb('0x26')](respondWithResult(_0x511983,null))['catch'](handleError(_0x511983,null));};exports[_0xbcfb('0x4e')]=function(_0x400b66,_0x3d53d7,_0x382b24){var _0x18e927={};var _0x3bc9e0={};var _0x48d9d1;var _0x348dad;return db[_0xbcfb('0x2e')][_0xbcfb('0x4d')]({'where':{'id':_0x400b66[_0xbcfb('0x48')]['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x3d53d7,null))[_0xbcfb('0x26')](function(_0x4adcc3){if(_0x4adcc3){_0x48d9d1=_0x4adcc3;_0x3bc9e0[_0xbcfb('0x32')]=_[_0xbcfb('0x33')](db[_0xbcfb('0x4f')][_0xbcfb('0x2f')]);_0x3bc9e0[_0xbcfb('0x34')]=_[_0xbcfb('0x33')](_0x400b66[_0xbcfb('0x34')]);_0x3bc9e0[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0x3bc9e0[_0xbcfb('0x32')],_0x3bc9e0['query']);_0x18e927[_0xbcfb('0x37')]=_[_0xbcfb('0x36')](_0x3bc9e0[_0xbcfb('0x32')],qs[_0xbcfb('0x38')](_0x400b66[_0xbcfb('0x34')][_0xbcfb('0x38')]));_0x18e927[_0xbcfb('0x37')]=_0x18e927[_0xbcfb('0x37')][_0xbcfb('0x39')]?_0x18e927[_0xbcfb('0x37')]:_0x3bc9e0[_0xbcfb('0x32')];_0x18e927[_0xbcfb('0x3b')]=qs[_0xbcfb('0x3c')](_0x400b66[_0xbcfb('0x34')][_0xbcfb('0x3c')]);_0x18e927[_0xbcfb('0x3d')]=qs[_0xbcfb('0x35')](_[_0xbcfb('0x3e')](_0x400b66[_0xbcfb('0x34')],_0x3bc9e0['filters']));if(_0x400b66[_0xbcfb('0x34')][_0xbcfb('0x3f')]){_0x18e927[_0xbcfb('0x3d')]=_['merge'](_0x18e927[_0xbcfb('0x3d')],{'$or':_[_0xbcfb('0x2d')](_0x18e927[_0xbcfb('0x37')],function(_0x1fe24b){var _0x512af0={};_0x512af0[_0x1fe24b]={'$like':'%'+_0x400b66['query'][_0xbcfb('0x3f')]+'%'};return _0x512af0;})});}_0x18e927=_[_0xbcfb('0x40')]({},_0x18e927,_0x400b66['options']);return _0x48d9d1['getSubjects'](_0x18e927);}})[_0xbcfb('0x26')](function(_0x7c330b){if(_0x7c330b){_0x348dad=_0x7c330b[_0xbcfb('0x39')];if(!_0x400b66[_0xbcfb('0x34')][_0xbcfb('0x3a')](_0xbcfb('0x50'))){_0x18e927['limit']=qs[_0xbcfb('0x1d')](_0x400b66[_0xbcfb('0x34')]['limit']);_0x18e927['offset']=qs['offset'](_0x400b66[_0xbcfb('0x34')]['offset']);}return _0x48d9d1['getSubjects'](_0x18e927);}})[_0xbcfb('0x26')](function(_0xd77c46){if(_0xd77c46){return _0xd77c46?{'count':_0x348dad,'rows':_0xd77c46}:null;}})[_0xbcfb('0x26')](respondWithResult(_0x3d53d7,null))[_0xbcfb('0x46')](handleError(_0x3d53d7,null));};exports['getDescriptions']=function(_0x4135eb,_0x1532a5,_0x192ece){var _0x3b612c={};var _0xc0fc89={};var _0x18c143;var _0x463924;return db[_0xbcfb('0x2e')][_0xbcfb('0x4d')]({'where':{'id':_0x4135eb['params']['id']}})['then'](handleEntityNotFound(_0x1532a5,null))[_0xbcfb('0x26')](function(_0x5f1155){if(_0x5f1155){_0x18c143=_0x5f1155;_0xc0fc89[_0xbcfb('0x32')]=_['keys'](db[_0xbcfb('0x4f')][_0xbcfb('0x2f')]);_0xc0fc89[_0xbcfb('0x34')]=_[_0xbcfb('0x33')](_0x4135eb[_0xbcfb('0x34')]);_0xc0fc89[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0xc0fc89['model'],_0xc0fc89[_0xbcfb('0x34')]);_0x3b612c[_0xbcfb('0x37')]=_[_0xbcfb('0x36')](_0xc0fc89[_0xbcfb('0x32')],qs[_0xbcfb('0x38')](_0x4135eb['query'][_0xbcfb('0x38')]));_0x3b612c['attributes']=_0x3b612c[_0xbcfb('0x37')][_0xbcfb('0x39')]?_0x3b612c['attributes']:_0xc0fc89[_0xbcfb('0x32')];_0x3b612c[_0xbcfb('0x3b')]=qs[_0xbcfb('0x3c')](_0x4135eb[_0xbcfb('0x34')][_0xbcfb('0x3c')]);_0x3b612c[_0xbcfb('0x3d')]=qs[_0xbcfb('0x35')](_['pick'](_0x4135eb[_0xbcfb('0x34')],_0xc0fc89['filters']));if(_0x4135eb[_0xbcfb('0x34')][_0xbcfb('0x3f')]){_0x3b612c[_0xbcfb('0x3d')]=_[_0xbcfb('0x40')](_0x3b612c[_0xbcfb('0x3d')],{'$or':_[_0xbcfb('0x2d')](_0x3b612c[_0xbcfb('0x37')],function(_0x443d36){var _0x5d1807={};_0x5d1807[_0x443d36]={'$like':'%'+_0x4135eb[_0xbcfb('0x34')]['filter']+'%'};return _0x5d1807;})});}_0x3b612c=_[_0xbcfb('0x40')]({},_0x3b612c,_0x4135eb[_0xbcfb('0x42')]);return _0x18c143[_0xbcfb('0x51')](_0x3b612c);}})[_0xbcfb('0x26')](function(_0x384f08){if(_0x384f08){_0x463924=_0x384f08[_0xbcfb('0x39')];if(!_0x4135eb[_0xbcfb('0x34')][_0xbcfb('0x3a')]('nolimit')){_0x3b612c[_0xbcfb('0x1d')]=qs[_0xbcfb('0x1d')](_0x4135eb[_0xbcfb('0x34')][_0xbcfb('0x1d')]);_0x3b612c[_0xbcfb('0x20')]=qs[_0xbcfb('0x20')](_0x4135eb['query'][_0xbcfb('0x20')]);}return _0x18c143[_0xbcfb('0x51')](_0x3b612c);}})['then'](function(_0x2cc491){if(_0x2cc491){return _0x2cc491?{'count':_0x463924,'rows':_0x2cc491}:null;}})['then'](respondWithResult(_0x1532a5,null))[_0xbcfb('0x46')](handleError(_0x1532a5,null));};exports[_0xbcfb('0x52')]=function(_0x8e8879,_0x4689a5,_0x20a988){var _0x286adc={};var _0x2abf9c={};var _0x27478e;var _0x1244f0;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x8e8879[_0xbcfb('0x48')]['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x4689a5,null))['then'](function(_0x3a4983){if(_0x3a4983){_0x27478e=_0x3a4983;_0x2abf9c['model']=_['keys'](db['Tag']['rawAttributes']);_0x2abf9c[_0xbcfb('0x34')]=_['keys'](_0x8e8879[_0xbcfb('0x34')]);_0x2abf9c[_0xbcfb('0x35')]=_[_0xbcfb('0x36')](_0x2abf9c['model'],_0x2abf9c[_0xbcfb('0x34')]);_0x286adc[_0xbcfb('0x37')]=_['intersection'](_0x2abf9c['model'],qs[_0xbcfb('0x38')](_0x8e8879[_0xbcfb('0x34')][_0xbcfb('0x38')]));_0x286adc[_0xbcfb('0x37')]=_0x286adc[_0xbcfb('0x37')]['length']?_0x286adc[_0xbcfb('0x37')]:_0x2abf9c[_0xbcfb('0x32')];_0x286adc[_0xbcfb('0x3b')]=qs[_0xbcfb('0x3c')](_0x8e8879[_0xbcfb('0x34')][_0xbcfb('0x3c')]);_0x286adc['where']=qs[_0xbcfb('0x35')](_[_0xbcfb('0x3e')](_0x8e8879['query'],_0x2abf9c[_0xbcfb('0x35')]));if(_0x8e8879['query'][_0xbcfb('0x3f')]){_0x286adc[_0xbcfb('0x3d')]=_[_0xbcfb('0x40')](_0x286adc['where'],{'$or':_['map'](_0x286adc[_0xbcfb('0x37')],function(_0x10cde5){var _0x15f5e3={};_0x15f5e3[_0x10cde5]={'$like':'%'+_0x8e8879['query'][_0xbcfb('0x3f')]+'%'};return _0x15f5e3;})});}_0x286adc=_[_0xbcfb('0x40')]({},_0x286adc,_0x8e8879[_0xbcfb('0x42')]);return _0x27478e[_0xbcfb('0x52')](_0x286adc);}})['then'](function(_0x4476cb){if(_0x4476cb){_0x1244f0=_0x4476cb[_0xbcfb('0x39')];if(!_0x8e8879[_0xbcfb('0x34')][_0xbcfb('0x3a')](_0xbcfb('0x50'))){_0x286adc[_0xbcfb('0x1d')]=qs[_0xbcfb('0x1d')](_0x8e8879[_0xbcfb('0x34')]['limit']);_0x286adc['offset']=qs[_0xbcfb('0x20')](_0x8e8879['query']['offset']);}return _0x27478e[_0xbcfb('0x52')](_0x286adc);}})[_0xbcfb('0x26')](function(_0x140325){if(_0x140325){return _0x140325?{'count':_0x1244f0,'rows':_0x140325}:null;}})[_0xbcfb('0x26')](respondWithResult(_0x4689a5,null))['catch'](handleError(_0x4689a5,null));};exports[_0xbcfb('0x53')]=function(_0x39387c,_0x1e5d7c,_0x35af14){if(_0x39387c[_0xbcfb('0x4b')]['id']){delete _0x39387c['body']['id'];}return db[_0xbcfb('0x2e')][_0xbcfb('0x4d')]({'where':{'id':_0x39387c['params']['id']}})[_0xbcfb('0x26')](handleEntityNotFound(_0x1e5d7c,null))[_0xbcfb('0x26')](function(_0x483416){if(_0x483416){return _0x483416[_0xbcfb('0x53')](_0x39387c['body'][_0xbcfb('0x54')]||[]);}return null;})[_0xbcfb('0x26')](respondWithResult(_0x1e5d7c,null))[_0xbcfb('0x46')](handleError(_0x1e5d7c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 86021b4..d50c7b0 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 _0x2d91=['FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x472594,_0x2be815){var _0x5b8e17=function(_0x5558b3){while(--_0x5558b3){_0x472594['push'](_0x472594['shift']());}};_0x5b8e17(++_0x2be815);}(_0x2d91,0xe7));var _0x12d9=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x2d91[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x12d9('0x0'));var util=require(_0x12d9('0x1'));var logger=require(_0x12d9('0x2'))(_0x12d9('0x3'));var moment=require('moment');var BPromise=require(_0x12d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12d9('0x5'));var rimraf=require(_0x12d9('0x6'));var config=require(_0x12d9('0x7'));var attributes=require(_0x12d9('0x8'));module['exports']=function(_0x297d94,_0x6674c2){return _0x297d94['define'](_0x12d9('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf90b=['define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x383333,_0xe78bdd){var _0xea36fd=function(_0x15c271){while(--_0x15c271){_0x383333['push'](_0x383333['shift']());}};_0xea36fd(++_0xe78bdd);}(_0xf90b,0x1e3));var _0xbf90=function(_0x3b3026,_0xc177db){_0x3b3026=_0x3b3026-0x0;var _0x3c0d01=_0xf90b[_0x3b3026];return _0x3c0d01;};'use strict';var _=require(_0xbf90('0x0'));var util=require(_0xbf90('0x1'));var logger=require(_0xbf90('0x2'))(_0xbf90('0x3'));var moment=require(_0xbf90('0x4'));var BPromise=require(_0xbf90('0x5'));var rp=require(_0xbf90('0x6'));var fs=require('fs');var path=require(_0xbf90('0x7'));var rimraf=require(_0xbf90('0x8'));var config=require(_0xbf90('0x9'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xbf90('0xa')]=function(_0x6ba8b8,_0x421894){return _0x6ba8b8[_0xbf90('0xb')](_0xbf90('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 605d300..5fa9a7c 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 _0x87e9=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x87e9,0x1e9));var _0x987e=function(_0x4959e1,_0x1e450f){_0x4959e1=_0x4959e1-0x0;var _0x29e55c=_0x87e9[_0x4959e1];return _0x29e55c;};'use strict';var _=require(_0x987e('0x0'));var util=require(_0x987e('0x1'));var moment=require(_0x987e('0x2'));var BPromise=require(_0x987e('0x3'));var rs=require(_0x987e('0x4'));var fs=require('fs');var Redis=require(_0x987e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x987e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x987e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x987e('0x8')][_0x987e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e76f6,_0x33bf2a,_0x3aa74d){return new BPromise(function(_0x31a344,_0x366cbc){return client['request'](_0x1e76f6,_0x3aa74d)[_0x987e('0xa')](function(_0x26997c){logger[_0x987e('0xb')](_0x987e('0xc'),_0x33bf2a,_0x987e('0xd'));logger[_0x987e('0xe')](_0x987e('0xf'),_0x33bf2a,'request\x20sent',JSON['stringify'](_0x26997c));if(_0x26997c[_0x987e('0x10')]){if(_0x26997c['error'][_0x987e('0x11')]===0x1f4){logger[_0x987e('0x10')](_0x987e('0xc'),_0x33bf2a,_0x26997c[_0x987e('0x10')][_0x987e('0x12')]);return _0x366cbc(_0x26997c['error'][_0x987e('0x12')]);}logger[_0x987e('0x10')](_0x987e('0xc'),_0x33bf2a,_0x26997c[_0x987e('0x10')]['message']);return _0x31a344(_0x26997c[_0x987e('0x10')][_0x987e('0x12')]);}else{logger[_0x987e('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x33bf2a,_0x987e('0xd'));_0x31a344(_0x26997c[_0x987e('0x13')][_0x987e('0x12')]);}})[_0x987e('0x14')](function(_0x2cac53){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x33bf2a,_0x2cac53);_0x366cbc(_0x2cac53);});});} \ No newline at end of file +var _0xc2c8=['../../config/logger','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x29d59b,_0x2e93d2){var _0xb4880d=function(_0x250f47){while(--_0x250f47){_0x29d59b['push'](_0x29d59b['shift']());}};_0xb4880d(++_0x2e93d2);}(_0xc2c8,0x1d8));var _0x8c2c=function(_0x519b15,_0x59cc6){_0x519b15=_0x519b15-0x0;var _0x175217=_0xc2c8[_0x519b15];return _0x175217;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c2c('0x0'));var BPromise=require(_0x8c2c('0x1'));var rs=require(_0x8c2c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c2c('0x3'));var logger=require(_0x8c2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38f435,_0x564995,_0x505857){return new BPromise(function(_0xb13d07,_0x2a3ceb){return client[_0x8c2c('0x5')](_0x38f435,_0x505857)[_0x8c2c('0x6')](function(_0x3a130f){logger[_0x8c2c('0x7')](_0x8c2c('0x8'),_0x564995,'request\x20sent');logger[_0x8c2c('0x9')](_0x8c2c('0xa'),_0x564995,'request\x20sent',JSON[_0x8c2c('0xb')](_0x3a130f));if(_0x3a130f[_0x8c2c('0xc')]){if(_0x3a130f['error'][_0x8c2c('0xd')]===0x1f4){logger['error'](_0x8c2c('0x8'),_0x564995,_0x3a130f['error'][_0x8c2c('0xe')]);return _0x2a3ceb(_0x3a130f[_0x8c2c('0xc')][_0x8c2c('0xe')]);}logger[_0x8c2c('0xc')](_0x8c2c('0x8'),_0x564995,_0x3a130f[_0x8c2c('0xc')][_0x8c2c('0xe')]);return _0xb13d07(_0x3a130f[_0x8c2c('0xc')][_0x8c2c('0xe')]);}else{logger['info'](_0x8c2c('0x8'),_0x564995,_0x8c2c('0xf'));_0xb13d07(_0x3a130f['result'][_0x8c2c('0xe')]);}})[_0x8c2c('0x10')](function(_0x446d24){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x564995,_0x446d24);_0x2a3ceb(_0x446d24);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2fd5df8..0b15959 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 _0x3f64=['update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','/:id'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3f64,0xd0));var _0x43f6=function(_0x3cdf24,_0x4bc567){_0x3cdf24=_0x3cdf24-0x0;var _0x46cca3=_0x3f64[_0x3cdf24];return _0x46cca3;};'use strict';var multer=require('multer');var util=require(_0x43f6('0x0'));var path=require(_0x43f6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43f6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x43f6('0x3'));var interaction=require(_0x43f6('0x4'));var config=require(_0x43f6('0x5'));var controller=require(_0x43f6('0x6'));router[_0x43f6('0x7')]('/',auth[_0x43f6('0x8')](),controller[_0x43f6('0x9')]);router[_0x43f6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x43f6('0xa')]);router[_0x43f6('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x43f6('0xc'),auth[_0x43f6('0x8')](),controller[_0x43f6('0xd')]);router[_0x43f6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x43f6('0xf')]);module[_0x43f6('0x10')]=router; \ No newline at end of file +var _0x2b44=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x11732d,_0x4c580c){var _0x4e3e46=function(_0x571fe1){while(--_0x571fe1){_0x11732d['push'](_0x11732d['shift']());}};_0x4e3e46(++_0x4c580c);}(_0x2b44,0x163));var _0x42b4=function(_0x16974b,_0x2901a5){_0x16974b=_0x16974b-0x0;var _0x8ea49=_0x2b44[_0x16974b];return _0x8ea49;};'use strict';var multer=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var path=require('path');var timeout=require(_0x42b4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x42b4('0x3'));var auth=require(_0x42b4('0x4'));var interaction=require(_0x42b4('0x5'));var config=require(_0x42b4('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x42b4('0x7')]('/',auth[_0x42b4('0x8')](),controller['index']);router[_0x42b4('0x7')](_0x42b4('0x9'),auth[_0x42b4('0x8')](),controller[_0x42b4('0xa')]);router[_0x42b4('0xb')]('/',auth[_0x42b4('0x8')](),controller[_0x42b4('0xc')]);router[_0x42b4('0xd')]('/:id',auth[_0x42b4('0x8')](),controller['update']);router[_0x42b4('0xe')](_0x42b4('0x9'),auth[_0x42b4('0x8')](),controller[_0x42b4('0xf')]);module[_0x42b4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8b2fb41..750481e 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 _0x9ff7=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9ff7,0x9e));var _0x79ff=function(_0x56a974,_0x1b1dcb){_0x56a974=_0x56a974-0x0;var _0x1db1c1=_0x9ff7[_0x56a974];return _0x1db1c1;};'use strict';var Sequelize=require(_0x79ff('0x0'));module[_0x79ff('0x1')]={'type':{'type':Sequelize[_0x79ff('0x2')](_0x79ff('0x3'),_0x79ff('0x4'),_0x79ff('0x5'),_0x79ff('0x6'),_0x79ff('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x79ff('0x8')]},'key':{'type':Sequelize[_0x79ff('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x79ff('0x3'),_0x79ff('0x4'),_0x79ff('0x5'))},'keyContent':{'type':Sequelize[_0x79ff('0x8')]},'idField':{'type':Sequelize[_0x79ff('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x79ff('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x79ff('0x8')]}}; \ No newline at end of file +var _0xd555=['STRING','ENUM','variable','BOOLEAN','sequelize','exports','customVariable','string'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xd555,0x1cc));var _0x5d55=function(_0x11c221,_0x65c6a5){_0x11c221=_0x11c221-0x0;var _0x26deef=_0xd555[_0x11c221];return _0x26deef;};'use strict';var Sequelize=require(_0x5d55('0x0'));module[_0x5d55('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x5d55('0x2'),'keyValue','picklist'),'defaultValue':_0x5d55('0x3')},'content':{'type':Sequelize[_0x5d55('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5d55('0x5')](_0x5d55('0x3'),_0x5d55('0x6'),_0x5d55('0x2'))},'keyContent':{'type':Sequelize[_0x5d55('0x4')]},'idField':{'type':Sequelize[_0x5d55('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5d55('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d55('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 3dd9e3c..6309068 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8a=['hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','params','length','includeAll','include','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xad8a,0xb0));var _0xaad8=function(_0x100bff,_0x37ea7d){_0x100bff=_0x100bff-0x0;var _0x2c20ac=_0xad8a[_0x100bff];return _0x2c20ac;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x1bbac4,_0x217bfc){return function(_0x4193cb){if(!_0x4193cb){_0x1bbac4[_0xaad8('0x1b')](0x194);}return _0x4193cb;};}function handleError(_0x4485c3,_0x492a4a){_0x492a4a=_0x492a4a||0x1f4;return function(_0x3d254e){logger[_0xaad8('0x2a')](_0x3d254e[_0xaad8('0x2b')]);if(_0x3d254e['name']){delete _0x3d254e[_0xaad8('0x2c')];}_0x4485c3[_0xaad8('0x1c')](_0x492a4a)[_0xaad8('0x2d')](_0x3d254e);};}exports[_0xaad8('0x2e')]=function(_0x24c01d,_0x5434a9){var _0xafb149={},_0x43c489={},_0x1e253f={'count':0x0,'rows':[]};var _0x31ad19=_[_0xaad8('0x2f')](db['FreshdeskField'][_0xaad8('0x30')],function(_0x4030ea){return{'name':_0x4030ea[_0xaad8('0x31')],'type':_0x4030ea[_0xaad8('0x32')]['key']};});_0x43c489[_0xaad8('0x33')]=_[_0xaad8('0x2f')](_0x31ad19,_0xaad8('0x2c'));_0x43c489[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x24c01d['query']);_0x43c489[_0xaad8('0x36')]=_[_0xaad8('0x37')](_0x43c489['model'],_0x43c489['query']);_0xafb149[_0xaad8('0x38')]=_[_0xaad8('0x37')](_0x43c489[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x24c01d['query'][_0xaad8('0x39')]));_0xafb149[_0xaad8('0x38')]=_0xafb149['attributes']['length']?_0xafb149[_0xaad8('0x38')]:_0x43c489[_0xaad8('0x33')];if(!_0x24c01d['query'][_0xaad8('0x3a')]('nolimit')){_0xafb149['limit']=qs[_0xaad8('0x20')](_0x24c01d[_0xaad8('0x34')]['limit']);_0xafb149[_0xaad8('0x3b')]=qs[_0xaad8('0x3b')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3b')]);}_0xafb149['order']=qs[_0xaad8('0x3c')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3c')]);_0xafb149[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_[_0xaad8('0x3e')](_0x24c01d['query'],_0x43c489[_0xaad8('0x36')]),_0x31ad19);if(_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]){_0xafb149['where']=_[_0xaad8('0x40')](_0xafb149[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x2f')](_0x31ad19,function(_0x2864c4){if(_0x2864c4[_0xaad8('0x32')]!==_0xaad8('0x41')){var _0x3c699c={};_0x3c699c[_0x2864c4['name']]={'$like':'%'+_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]+'%'};return _0x3c699c;}})});}_0xafb149=_[_0xaad8('0x40')]({},_0xafb149,_0x24c01d[_0xaad8('0x42')]);var _0x3cb8ea={'where':_0xafb149[_0xaad8('0x3d')]};return db['FreshdeskField'][_0xaad8('0x21')](_0x3cb8ea)[_0xaad8('0x28')](function(_0x3ea87e){_0x1e253f[_0xaad8('0x21')]=_0x3ea87e;if(_0x24c01d['query']['includeAll']){_0xafb149['include']=[{'all':!![]}];}return db[_0xaad8('0x43')][_0xaad8('0x44')](_0xafb149);})[_0xaad8('0x28')](function(_0x5bb668){_0x1e253f[_0xaad8('0x45')]=_0x5bb668;return _0x1e253f;})[_0xaad8('0x28')](respondWithFilteredResult(_0x5434a9,_0xafb149))['catch'](handleError(_0x5434a9,null));};exports[_0xaad8('0x46')]=function(_0x11e67e,_0x2fd56a){var _0x292d4e={'raw':!![],'where':{'id':_0x11e67e[_0xaad8('0x47')]['id']}},_0x3933ac={};_0x3933ac[_0xaad8('0x33')]=_[_0xaad8('0x35')](db[_0xaad8('0x43')][_0xaad8('0x30')]);_0x3933ac[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x11e67e['query']);_0x3933ac['filters']=_['intersection'](_0x3933ac[_0xaad8('0x33')],_0x3933ac['query']);_0x292d4e[_0xaad8('0x38')]=_['intersection'](_0x3933ac['model'],qs[_0xaad8('0x39')](_0x11e67e['query'][_0xaad8('0x39')]));_0x292d4e[_0xaad8('0x38')]=_0x292d4e[_0xaad8('0x38')][_0xaad8('0x48')]?_0x292d4e[_0xaad8('0x38')]:_0x3933ac[_0xaad8('0x33')];if(_0x11e67e[_0xaad8('0x34')][_0xaad8('0x49')]){_0x292d4e[_0xaad8('0x4a')]=[{'all':!![]}];}_0x292d4e=_[_0xaad8('0x40')]({},_0x292d4e,_0x11e67e[_0xaad8('0x42')]);return db[_0xaad8('0x43')][_0xaad8('0x4b')](_0x292d4e)[_0xaad8('0x28')](handleEntityNotFound(_0x2fd56a,null))[_0xaad8('0x28')](respondWithResult(_0x2fd56a,null))['catch'](handleError(_0x2fd56a,null));};exports['create']=function(_0x46bf2a,_0x42cfa4){return db[_0xaad8('0x43')]['create'](_0x46bf2a['body'],{})[_0xaad8('0x28')](respondWithResult(_0x42cfa4,0xc9))['catch'](handleError(_0x42cfa4,null));};exports[_0xaad8('0x27')]=function(_0x1560ef,_0x313824){if(_0x1560ef[_0xaad8('0x4c')]['id']){delete _0x1560ef[_0xaad8('0x4c')]['id'];}return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x1560ef[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x313824,null))['then'](saveUpdates(_0x1560ef[_0xaad8('0x4c')],null))[_0xaad8('0x28')](respondWithResult(_0x313824,null))['catch'](handleError(_0x313824,null));};exports[_0xaad8('0x29')]=function(_0x5e5ef1,_0x2a2542){return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x5e5ef1[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x2a2542,null))[_0xaad8('0x28')](removeEntity(_0x2a2542,null))[_0xaad8('0x4d')](handleError(_0x2a2542,null));}; \ No newline at end of file +var _0x2356=['rimraf','zip-dir','moment','bluebird','path','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','reject','save','destroy','then','name','send','index','map','FreshdeskField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','options','find','create','body','update'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2356,0x14f));var _0x6235=function(_0x57c9c7,_0xb70a91){_0x57c9c7=_0x57c9c7-0x0;var _0x48ad8b=_0x2356[_0x57c9c7];return _0x48ad8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6235('0x0'));var zipdir=require(_0x6235('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6235('0x2'));var BPromise=require(_0x6235('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6235('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6235('0x5'));var fs=require('fs');var fs_extra=require(_0x6235('0x6'));var _=require(_0x6235('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6235('0x8'));var toCsv=require('to-csv');var querystring=require(_0x6235('0x9'));var Papa=require(_0x6235('0xa'));var Redis=require(_0x6235('0xb'));var authService=require(_0x6235('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6235('0xd'));var hardwareService=require(_0x6235('0xe'));var logger=require(_0x6235('0xf'))(_0x6235('0x10'));var utils=require(_0x6235('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6235('0x12'));var db=require(_0x6235('0x13'))['db'];function respondWithStatusCode(_0x1303e7,_0x6c422b){_0x6c422b=_0x6c422b||0xcc;return function(_0x48df2d){if(_0x48df2d){return _0x1303e7[_0x6235('0x14')](_0x6c422b);}return _0x1303e7[_0x6235('0x15')](_0x6c422b)['end']();};}function respondWithResult(_0x3f5b7d,_0x48e3a7){_0x48e3a7=_0x48e3a7||0xc8;return function(_0x35156f){if(_0x35156f){return _0x3f5b7d[_0x6235('0x15')](_0x48e3a7)['json'](_0x35156f);}};}function respondWithFilteredResult(_0x1cfd0b,_0x1f1c54){return function(_0x3f619b){if(_0x3f619b){var _0x3f32af=typeof _0x1f1c54['offset']===_0x6235('0x16')&&typeof _0x1f1c54[_0x6235('0x17')]===_0x6235('0x16');var _0x2e5a84=_0x3f619b[_0x6235('0x18')];var _0x2a3554=_0x3f32af?0x0:_0x1f1c54[_0x6235('0x19')];var _0x22f090=_0x3f32af?_0x3f619b[_0x6235('0x18')]:_0x1f1c54[_0x6235('0x19')]+_0x1f1c54['limit'];var _0x35103a;if(_0x22f090>=_0x2e5a84){_0x22f090=_0x2e5a84;_0x35103a=0xc8;}else{_0x35103a=0xce;}_0x1cfd0b[_0x6235('0x15')](_0x35103a);return _0x1cfd0b['set']('Content-Range',_0x2a3554+'-'+_0x22f090+'/'+_0x2e5a84)[_0x6235('0x1a')](_0x3f619b);}return null;};}function patchUpdates(_0x4f0aa2){return function(_0x5d3872){try{jsonpatch['apply'](_0x5d3872,_0x4f0aa2,!![]);}catch(_0x367207){return BPromise[_0x6235('0x1b')](_0x367207);}return _0x5d3872[_0x6235('0x1c')]();};}function saveUpdates(_0x1c60c7,_0x24c057){return function(_0x270c49){if(_0x270c49){return _0x270c49['update'](_0x1c60c7)['then'](function(_0x4663b3){return _0x4663b3;});}return null;};}function removeEntity(_0x5ac43d,_0x2189d0){return function(_0x1bed65){if(_0x1bed65){return _0x1bed65[_0x6235('0x1d')]()[_0x6235('0x1e')](function(){_0x5ac43d[_0x6235('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3d90,_0x1da380){return function(_0x168b01){if(!_0x168b01){_0x1e3d90[_0x6235('0x14')](0x194);}return _0x168b01;};}function handleError(_0x3eac45,_0x5a58d9){_0x5a58d9=_0x5a58d9||0x1f4;return function(_0x4b44f8){logger['error'](_0x4b44f8['stack']);if(_0x4b44f8[_0x6235('0x1f')]){delete _0x4b44f8[_0x6235('0x1f')];}_0x3eac45[_0x6235('0x15')](_0x5a58d9)[_0x6235('0x20')](_0x4b44f8);};}exports[_0x6235('0x21')]=function(_0x2acc8c,_0x59bb16){var _0x47e86b={},_0x5dc066={},_0x94db3c={'count':0x0,'rows':[]};var _0x50ea93=_[_0x6235('0x22')](db[_0x6235('0x23')]['rawAttributes'],function(_0x37580b){return{'name':_0x37580b[_0x6235('0x24')],'type':_0x37580b['type'][_0x6235('0x25')]};});_0x5dc066[_0x6235('0x26')]=_[_0x6235('0x22')](_0x50ea93,_0x6235('0x1f'));_0x5dc066[_0x6235('0x27')]=_[_0x6235('0x28')](_0x2acc8c[_0x6235('0x27')]);_0x5dc066[_0x6235('0x29')]=_[_0x6235('0x2a')](_0x5dc066[_0x6235('0x26')],_0x5dc066['query']);_0x47e86b[_0x6235('0x2b')]=_['intersection'](_0x5dc066['model'],qs[_0x6235('0x2c')](_0x2acc8c['query']['fields']));_0x47e86b[_0x6235('0x2b')]=_0x47e86b['attributes']['length']?_0x47e86b[_0x6235('0x2b')]:_0x5dc066[_0x6235('0x26')];if(!_0x2acc8c[_0x6235('0x27')]['hasOwnProperty'](_0x6235('0x2d'))){_0x47e86b[_0x6235('0x17')]=qs[_0x6235('0x17')](_0x2acc8c['query'][_0x6235('0x17')]);_0x47e86b['offset']=qs[_0x6235('0x19')](_0x2acc8c[_0x6235('0x27')][_0x6235('0x19')]);}_0x47e86b[_0x6235('0x2e')]=qs[_0x6235('0x2f')](_0x2acc8c['query'][_0x6235('0x2f')]);_0x47e86b['where']=qs[_0x6235('0x29')](_[_0x6235('0x30')](_0x2acc8c[_0x6235('0x27')],_0x5dc066[_0x6235('0x29')]),_0x50ea93);if(_0x2acc8c[_0x6235('0x27')]['filter']){_0x47e86b['where']=_[_0x6235('0x31')](_0x47e86b[_0x6235('0x32')],{'$or':_[_0x6235('0x22')](_0x50ea93,function(_0x41cdc2){if(_0x41cdc2[_0x6235('0x33')]!==_0x6235('0x34')){var _0xe277d0={};_0xe277d0[_0x41cdc2[_0x6235('0x1f')]]={'$like':'%'+_0x2acc8c[_0x6235('0x27')][_0x6235('0x35')]+'%'};return _0xe277d0;}})});}_0x47e86b=_['merge']({},_0x47e86b,_0x2acc8c['options']);var _0x4d1cac={'where':_0x47e86b['where']};return db['FreshdeskField'][_0x6235('0x18')](_0x4d1cac)[_0x6235('0x1e')](function(_0x290da6){_0x94db3c['count']=_0x290da6;if(_0x2acc8c[_0x6235('0x27')]['includeAll']){_0x47e86b[_0x6235('0x36')]=[{'all':!![]}];}return db[_0x6235('0x23')][_0x6235('0x37')](_0x47e86b);})[_0x6235('0x1e')](function(_0x36abb1){_0x94db3c[_0x6235('0x38')]=_0x36abb1;return _0x94db3c;})[_0x6235('0x1e')](respondWithFilteredResult(_0x59bb16,_0x47e86b))[_0x6235('0x39')](handleError(_0x59bb16,null));};exports['show']=function(_0x565c9f,_0x341fdc){var _0x54cbb1={'raw':!![],'where':{'id':_0x565c9f[_0x6235('0x3a')]['id']}},_0x173c62={};_0x173c62[_0x6235('0x26')]=_[_0x6235('0x28')](db[_0x6235('0x23')][_0x6235('0x3b')]);_0x173c62[_0x6235('0x27')]=_['keys'](_0x565c9f[_0x6235('0x27')]);_0x173c62[_0x6235('0x29')]=_[_0x6235('0x2a')](_0x173c62['model'],_0x173c62[_0x6235('0x27')]);_0x54cbb1[_0x6235('0x2b')]=_[_0x6235('0x2a')](_0x173c62[_0x6235('0x26')],qs[_0x6235('0x2c')](_0x565c9f[_0x6235('0x27')][_0x6235('0x2c')]));_0x54cbb1[_0x6235('0x2b')]=_0x54cbb1['attributes'][_0x6235('0x3c')]?_0x54cbb1[_0x6235('0x2b')]:_0x173c62[_0x6235('0x26')];if(_0x565c9f['query'][_0x6235('0x3d')]){_0x54cbb1[_0x6235('0x36')]=[{'all':!![]}];}_0x54cbb1=_[_0x6235('0x31')]({},_0x54cbb1,_0x565c9f[_0x6235('0x3e')]);return db[_0x6235('0x23')][_0x6235('0x3f')](_0x54cbb1)[_0x6235('0x1e')](handleEntityNotFound(_0x341fdc,null))[_0x6235('0x1e')](respondWithResult(_0x341fdc,null))[_0x6235('0x39')](handleError(_0x341fdc,null));};exports['create']=function(_0x148a78,_0x4f30c4){return db[_0x6235('0x23')][_0x6235('0x40')](_0x148a78[_0x6235('0x41')],{})['then'](respondWithResult(_0x4f30c4,0xc9))['catch'](handleError(_0x4f30c4,null));};exports[_0x6235('0x42')]=function(_0x433263,_0x4468d4){if(_0x433263[_0x6235('0x41')]['id']){delete _0x433263['body']['id'];}return db[_0x6235('0x23')][_0x6235('0x3f')]({'where':{'id':_0x433263['params']['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x4468d4,null))['then'](saveUpdates(_0x433263[_0x6235('0x41')],null))[_0x6235('0x1e')](respondWithResult(_0x4468d4,null))[_0x6235('0x39')](handleError(_0x4468d4,null));};exports['destroy']=function(_0x2aa5f9,_0x5bff03){return db['FreshdeskField']['find']({'where':{'id':_0x2aa5f9[_0x6235('0x3a')]['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x5bff03,null))[_0x6235('0x1e')](removeEntity(_0x5bff03,null))[_0x6235('0x39')](handleError(_0x5bff03,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6e91635..9b17f1a 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 _0xd4a0=['freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_freshdesk_fields'];(function(_0x53b22e,_0x5e248f){var _0x14a0a4=function(_0x5dcfb9){while(--_0x5dcfb9){_0x53b22e['push'](_0x53b22e['shift']());}};_0x14a0a4(++_0x5e248f);}(_0xd4a0,0x18b));var _0x0d4a=function(_0x42c56b,_0x3d3ece){_0x42c56b=_0x42c56b-0x0;var _0x106711=_0xd4a0[_0x42c56b];return _0x106711;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var logger=require(_0x0d4a('0x2'))(_0x0d4a('0x3'));var moment=require(_0x0d4a('0x4'));var BPromise=require(_0x0d4a('0x5'));var rp=require(_0x0d4a('0x6'));var fs=require('fs');var path=require(_0x0d4a('0x7'));var rimraf=require(_0x0d4a('0x8'));var config=require(_0x0d4a('0x9'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x266c53,_0x57bfbb){return _0x266c53['define']('FreshdeskField',attributes,{'tableName':_0x0d4a('0xa'),'paranoid':![],'indexes':[{'name':_0x0d4a('0xb'),'fields':[_0x0d4a('0xc'),_0x0d4a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f10=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','path','../../config/environment','./intFreshdeskField.attributes'];(function(_0x2484c6,_0x17dbbd){var _0x3d09a6=function(_0x4fa0a1){while(--_0x4fa0a1){_0x2484c6['push'](_0x2484c6['shift']());}};_0x3d09a6(++_0x17dbbd);}(_0x1f10,0x69));var _0x01f1=function(_0x1e9c74,_0x188101){_0x1e9c74=_0x1e9c74-0x0;var _0x5c8ed8=_0x1f10[_0x1e9c74];return _0x5c8ed8;};'use strict';var _=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var logger=require('../../config/logger')(_0x01f1('0x2'));var moment=require(_0x01f1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01f1('0x4'));var rimraf=require('rimraf');var config=require(_0x01f1('0x5'));var attributes=require(_0x01f1('0x6'));module[_0x01f1('0x7')]=function(_0x497ee1,_0x1800dd){return _0x497ee1[_0x01f1('0x8')](_0x01f1('0x9'),attributes,{'tableName':_0x01f1('0xa'),'paranoid':![],'indexes':[{'name':_0x01f1('0xb'),'fields':[_0x01f1('0xc'),_0x01f1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index b768b49..b292cb2 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 _0x6432=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x52f165,_0x160743){var _0x470dc2=function(_0x4521ab){while(--_0x4521ab){_0x52f165['push'](_0x52f165['shift']());}};_0x470dc2(++_0x160743);}(_0x6432,0x70));var _0x2643=function(_0x3a9666,_0x56ab3b){_0x3a9666=_0x3a9666-0x0;var _0x22dd3a=_0x6432[_0x3a9666];return _0x22dd3a;};'use strict';var _=require('lodash');var util=require(_0x2643('0x0'));var moment=require(_0x2643('0x1'));var BPromise=require(_0x2643('0x2'));var rs=require(_0x2643('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2643('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2643('0x5'));var config=require(_0x2643('0x6'));var jayson=require(_0x2643('0x7'));var client=jayson[_0x2643('0x8')][_0x2643('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x381605,_0x48ad63,_0x393b4e){return new BPromise(function(_0x4a480c,_0x1e28c8){return client[_0x2643('0xa')](_0x381605,_0x393b4e)[_0x2643('0xb')](function(_0x1b6917){logger[_0x2643('0xc')](_0x2643('0xd'),_0x48ad63,_0x2643('0xe'));logger[_0x2643('0xf')](_0x2643('0x10'),_0x48ad63,_0x2643('0xe'),JSON['stringify'](_0x1b6917));if(_0x1b6917[_0x2643('0x11')]){if(_0x1b6917[_0x2643('0x11')][_0x2643('0x12')]===0x1f4){logger[_0x2643('0x11')](_0x2643('0xd'),_0x48ad63,_0x1b6917[_0x2643('0x11')][_0x2643('0x13')]);return _0x1e28c8(_0x1b6917[_0x2643('0x11')][_0x2643('0x13')]);}logger[_0x2643('0x11')](_0x2643('0xd'),_0x48ad63,_0x1b6917[_0x2643('0x11')][_0x2643('0x13')]);return _0x4a480c(_0x1b6917[_0x2643('0x11')][_0x2643('0x13')]);}else{logger['info'](_0x2643('0xd'),_0x48ad63,_0x2643('0xe'));_0x4a480c(_0x1b6917[_0x2643('0x14')][_0x2643('0x13')]);}})[_0x2643('0x15')](function(_0x5bbb1a){logger[_0x2643('0x11')](_0x2643('0xd'),_0x48ad63,_0x5bbb1a);_0x1e28c8(_0x5bbb1a);});});} \ No newline at end of file +var _0x3136=['stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x616684,_0x1c4bd7){var _0xa3b939=function(_0x5751d4){while(--_0x5751d4){_0x616684['push'](_0x616684['shift']());}};_0xa3b939(++_0x1c4bd7);}(_0x3136,0x1e8));var _0x6313=function(_0x37f195,_0x1359c0){_0x37f195=_0x37f195-0x0;var _0x301b6e=_0x3136[_0x37f195];return _0x301b6e;};'use strict';var _=require(_0x6313('0x0'));var util=require('util');var moment=require(_0x6313('0x1'));var BPromise=require('bluebird');var rs=require(_0x6313('0x2'));var fs=require('fs');var Redis=require(_0x6313('0x3'));var db=require(_0x6313('0x4'))['db'];var utils=require(_0x6313('0x5'));var logger=require(_0x6313('0x6'))('rpc');var config=require(_0x6313('0x7'));var jayson=require(_0x6313('0x8'));var client=jayson['client'][_0x6313('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad0a6,_0x51a9a9,_0x38c990){return new BPromise(function(_0x2cec51,_0x24f579){return client[_0x6313('0xa')](_0x4ad0a6,_0x38c990)[_0x6313('0xb')](function(_0xb03ae5){logger[_0x6313('0xc')](_0x6313('0xd'),_0x51a9a9,_0x6313('0xe'));logger[_0x6313('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x51a9a9,'request\x20sent',JSON[_0x6313('0x10')](_0xb03ae5));if(_0xb03ae5['error']){if(_0xb03ae5[_0x6313('0x11')]['code']===0x1f4){logger[_0x6313('0x11')](_0x6313('0xd'),_0x51a9a9,_0xb03ae5[_0x6313('0x11')]['message']);return _0x24f579(_0xb03ae5[_0x6313('0x11')][_0x6313('0x12')]);}logger[_0x6313('0x11')](_0x6313('0xd'),_0x51a9a9,_0xb03ae5[_0x6313('0x11')][_0x6313('0x12')]);return _0x2cec51(_0xb03ae5[_0x6313('0x11')][_0x6313('0x12')]);}else{logger[_0x6313('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x51a9a9,_0x6313('0xe'));_0x2cec51(_0xb03ae5[_0x6313('0x13')]['message']);}})[_0x6313('0x14')](function(_0x4dcc90){logger['error'](_0x6313('0xd'),_0x51a9a9,_0x4dcc90);_0x24f579(_0x4dcc90);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index f6b3abd..06e5ceb 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 _0x63a5=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete'];(function(_0xd3dae2,_0x2c5561){var _0x5537be=function(_0x16affc){while(--_0x16affc){_0xd3dae2['push'](_0xd3dae2['shift']());}};_0x5537be(++_0x2c5561);}(_0x63a5,0x18e));var _0x563a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x63a5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var path=require(_0x563a('0x2'));var timeout=require('connect-timeout');var express=require(_0x563a('0x3'));var router=express['Router']();var fs_extra=require(_0x563a('0x4'));var auth=require(_0x563a('0x5'));var interaction=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x563a('0x8')](),controller['index']);router[_0x563a('0x9')](_0x563a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x563a('0x9')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller[_0x563a('0xc')]);router[_0x563a('0x9')](_0x563a('0xd'),auth[_0x563a('0x8')](),controller[_0x563a('0xe')]);router[_0x563a('0xf')]('/',auth[_0x563a('0x8')](),controller[_0x563a('0x10')]);router[_0x563a('0xf')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller['addConfiguration']);router[_0x563a('0x11')](_0x563a('0xa'),auth[_0x563a('0x8')](),controller[_0x563a('0x12')]);router[_0x563a('0x13')](_0x563a('0xa'),auth['isAuthenticated'](),controller[_0x563a('0x14')]);module[_0x563a('0x15')]=router; \ No newline at end of file +var _0x04b8=['get','index','/:id','show','isAuthenticated','getConfigurations','/:id/fields','post','create','/:id/configurations','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x04b8,0x159));var _0x804b=function(_0x451e90,_0x31e9ba){_0x451e90=_0x451e90-0x0;var _0x53c74a=_0x04b8[_0x451e90];return _0x53c74a;};'use strict';var multer=require('multer');var util=require(_0x804b('0x0'));var path=require('path');var timeout=require(_0x804b('0x1'));var express=require(_0x804b('0x2'));var router=express['Router']();var fs_extra=require(_0x804b('0x3'));var auth=require(_0x804b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x804b('0x5'));var controller=require(_0x804b('0x6'));router[_0x804b('0x7')]('/',auth['isAuthenticated'](),controller[_0x804b('0x8')]);router[_0x804b('0x7')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0xa')]);router[_0x804b('0x7')]('/:id/configurations',auth[_0x804b('0xb')](),controller[_0x804b('0xc')]);router[_0x804b('0x7')](_0x804b('0xd'),auth[_0x804b('0xb')](),controller['getFields']);router[_0x804b('0xe')]('/',auth[_0x804b('0xb')](),controller[_0x804b('0xf')]);router[_0x804b('0xe')](_0x804b('0x10'),auth[_0x804b('0xb')](),controller['addConfiguration']);router[_0x804b('0x11')]('/:id',auth[_0x804b('0xb')](),controller[_0x804b('0x12')]);router[_0x804b('0x13')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0x14')]);module[_0x804b('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 411fbe7..5464255 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 _0x430c=['sequelize','STRING','username'];(function(_0x7a74b4,_0xf68657){var _0x27e139=function(_0x20689a){while(--_0x20689a){_0x7a74b4['push'](_0x7a74b4['shift']());}};_0x27e139(++_0xf68657);}(_0x430c,0x1a1));var _0xc430=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x430c[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfb11=['sequelize','STRING','username'];(function(_0x554ef9,_0xdb9278){var _0x26600d=function(_0x47566a){while(--_0x47566a){_0x554ef9['push'](_0x554ef9['shift']());}};_0x26600d(++_0xdb9278);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xfb11[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x1fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fb1('0x1')]},'description':{'type':Sequelize[_0x1fb1('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1fb1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x1fb1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 0e82757..e6aab0f 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 _0x27d1=['FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','findOne','keys','FreshsalesConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x325450,_0x5ccb85){var _0x433f7=function(_0x17e86c){while(--_0x17e86c){_0x325450['push'](_0x325450['shift']());}};_0x433f7(++_0x5ccb85);}(_0x27d1,0x1a2));var _0x127d=function(_0x222a71,_0x515f47){_0x222a71=_0x222a71-0x0;var _0x1706eb=_0x27d1[_0x222a71];return _0x1706eb;};'use strict';var emlformat=require(_0x127d('0x0'));var rimraf=require(_0x127d('0x1'));var zipdir=require(_0x127d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x127d('0x3'));var moment=require(_0x127d('0x4'));var BPromise=require(_0x127d('0x5'));var Mustache=require('mustache');var util=require(_0x127d('0x6'));var path=require('path');var sox=require(_0x127d('0x7'));var csv=require(_0x127d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x127d('0x9'));var _=require(_0x127d('0xa'));var squel=require(_0x127d('0xb'));var crypto=require(_0x127d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x127d('0x8'));var querystring=require(_0x127d('0xd'));var Papa=require('papaparse');var Redis=require(_0x127d('0xe'));var authService=require(_0x127d('0xf'));var qs=require(_0x127d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x127d('0x11'));var logger=require(_0x127d('0x12'))(_0x127d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x127d('0x14'))['db'];var integrations=require(_0x127d('0x15'));function respondWithStatusCode(_0xe9e164,_0x59ef9d){_0x59ef9d=_0x59ef9d||0xcc;return function(_0x250251){if(_0x250251){return _0xe9e164[_0x127d('0x16')](_0x59ef9d);}return _0xe9e164[_0x127d('0x17')](_0x59ef9d)[_0x127d('0x18')]();};}function respondWithResult(_0x2f2c21,_0x310038){_0x310038=_0x310038||0xc8;return function(_0x203afb){if(_0x203afb){return _0x2f2c21[_0x127d('0x17')](_0x310038)['json'](_0x203afb);}};}function respondWithFilteredResult(_0x1ce09e,_0x34a431){return function(_0x257c6f){if(_0x257c6f){var _0x57e5cb=typeof _0x34a431[_0x127d('0x19')]===_0x127d('0x1a')&&typeof _0x34a431[_0x127d('0x1b')]===_0x127d('0x1a');var _0x59d806=_0x257c6f[_0x127d('0x1c')];var _0xf3a06c=_0x57e5cb?0x0:_0x34a431[_0x127d('0x19')];var _0x18257c=_0x57e5cb?_0x257c6f['count']:_0x34a431['offset']+_0x34a431[_0x127d('0x1b')];var _0x46e050;if(_0x18257c>=_0x59d806){_0x18257c=_0x59d806;_0x46e050=0xc8;}else{_0x46e050=0xce;}_0x1ce09e['status'](_0x46e050);return _0x1ce09e['set'](_0x127d('0x1d'),_0xf3a06c+'-'+_0x18257c+'/'+_0x59d806)[_0x127d('0x1e')](_0x257c6f);}return null;};}function patchUpdates(_0x530a77){return function(_0x359a7f){try{jsonpatch[_0x127d('0x1f')](_0x359a7f,_0x530a77,!![]);}catch(_0x50c80e){return BPromise[_0x127d('0x20')](_0x50c80e);}return _0x359a7f[_0x127d('0x21')]();};}function saveUpdates(_0x4ddb68,_0x393930){return function(_0x2c1ac2){if(_0x2c1ac2){return _0x2c1ac2[_0x127d('0x22')](_0x4ddb68)[_0x127d('0x23')](function(_0x3595e3){return _0x3595e3;});}return null;};}function removeEntity(_0x983345,_0x37de71){return function(_0x219a2a){if(_0x219a2a){return _0x219a2a[_0x127d('0x24')]()[_0x127d('0x23')](function(){_0x983345['status'](0xcc)[_0x127d('0x18')]();});}};}function handleEntityNotFound(_0xaa608a,_0x257975){return function(_0x1648c5){if(!_0x1648c5){_0xaa608a[_0x127d('0x16')](0x194);}return _0x1648c5;};}function handleError(_0x52bc2a,_0x32097b){_0x32097b=_0x32097b||0x1f4;return function(_0x31e0c0){logger['error'](_0x31e0c0[_0x127d('0x25')]);if(_0x31e0c0[_0x127d('0x26')]){delete _0x31e0c0[_0x127d('0x26')];}_0x52bc2a[_0x127d('0x17')](_0x32097b)[_0x127d('0x27')](_0x31e0c0);};}exports[_0x127d('0x28')]=function(_0x2f19f5,_0x431091){var _0x296248={},_0x2cbf2f={},_0x1343aa={'count':0x0,'rows':[]};var _0x194528=_[_0x127d('0x29')](db[_0x127d('0x2a')][_0x127d('0x2b')],function(_0xcbeb0f){return{'name':_0xcbeb0f[_0x127d('0x2c')],'type':_0xcbeb0f['type'][_0x127d('0x2d')]};});_0x2cbf2f[_0x127d('0x2e')]=_[_0x127d('0x29')](_0x194528,_0x127d('0x26'));_0x2cbf2f[_0x127d('0x2f')]=_['keys'](_0x2f19f5[_0x127d('0x2f')]);_0x2cbf2f['filters']=_[_0x127d('0x30')](_0x2cbf2f[_0x127d('0x2e')],_0x2cbf2f['query']);_0x296248[_0x127d('0x31')]=_['intersection'](_0x2cbf2f[_0x127d('0x2e')],qs[_0x127d('0x32')](_0x2f19f5['query'][_0x127d('0x32')]));_0x296248[_0x127d('0x31')]=_0x296248['attributes']['length']?_0x296248['attributes']:_0x2cbf2f[_0x127d('0x2e')];if(!_0x2f19f5['query'][_0x127d('0x33')](_0x127d('0x34'))){_0x296248[_0x127d('0x1b')]=qs[_0x127d('0x1b')](_0x2f19f5[_0x127d('0x2f')][_0x127d('0x1b')]);_0x296248[_0x127d('0x19')]=qs[_0x127d('0x19')](_0x2f19f5[_0x127d('0x2f')][_0x127d('0x19')]);}_0x296248[_0x127d('0x35')]=qs['sort'](_0x2f19f5[_0x127d('0x2f')][_0x127d('0x36')]);_0x296248[_0x127d('0x37')]=qs[_0x127d('0x38')](_[_0x127d('0x39')](_0x2f19f5['query'],_0x2cbf2f[_0x127d('0x38')]),_0x194528);if(_0x2f19f5[_0x127d('0x2f')]['filter']){_0x296248[_0x127d('0x37')]=_[_0x127d('0x3a')](_0x296248[_0x127d('0x37')],{'$or':_['map'](_0x194528,function(_0x1c8bc0){if(_0x1c8bc0[_0x127d('0x3b')]!==_0x127d('0x3c')){var _0x27407f={};_0x27407f[_0x1c8bc0[_0x127d('0x26')]]={'$like':'%'+_0x2f19f5[_0x127d('0x2f')][_0x127d('0x3d')]+'%'};return _0x27407f;}})});}_0x296248=_[_0x127d('0x3a')]({},_0x296248,_0x2f19f5[_0x127d('0x3e')]);var _0x54a49c={'where':_0x296248[_0x127d('0x37')]};return db['FreshsalesAccount'][_0x127d('0x1c')](_0x54a49c)[_0x127d('0x23')](function(_0x46e516){_0x1343aa[_0x127d('0x1c')]=_0x46e516;if(_0x2f19f5[_0x127d('0x2f')][_0x127d('0x3f')]){_0x296248[_0x127d('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x296248);})[_0x127d('0x23')](function(_0x1385b2){_0x1343aa[_0x127d('0x41')]=_0x1385b2;return _0x1343aa;})[_0x127d('0x23')](respondWithFilteredResult(_0x431091,_0x296248))[_0x127d('0x42')](handleError(_0x431091,null));};exports[_0x127d('0x43')]=function(_0x1bc1f6,_0x43f9c1){var _0x5e70dc={'raw':![],'where':{'id':_0x1bc1f6[_0x127d('0x44')]['id']}},_0x2467fb={};_0x2467fb[_0x127d('0x2e')]=_['keys'](db[_0x127d('0x2a')][_0x127d('0x2b')]);_0x2467fb['query']=_['keys'](_0x1bc1f6[_0x127d('0x2f')]);_0x2467fb[_0x127d('0x38')]=_['intersection'](_0x2467fb['model'],_0x2467fb['query']);_0x5e70dc[_0x127d('0x31')]=_['intersection'](_0x2467fb['model'],qs['fields'](_0x1bc1f6[_0x127d('0x2f')][_0x127d('0x32')]));_0x5e70dc[_0x127d('0x31')]=_0x5e70dc['attributes'][_0x127d('0x45')]?_0x5e70dc[_0x127d('0x31')]:_0x2467fb[_0x127d('0x2e')];if(_0x1bc1f6[_0x127d('0x2f')][_0x127d('0x3f')]){_0x5e70dc[_0x127d('0x40')]=[{'all':!![]}];}_0x5e70dc=_[_0x127d('0x3a')]({},_0x5e70dc,_0x1bc1f6['options']);return db[_0x127d('0x2a')][_0x127d('0x46')](_0x5e70dc)[_0x127d('0x23')](handleEntityNotFound(_0x43f9c1,null))[_0x127d('0x23')](respondWithResult(_0x43f9c1,null))['catch'](handleError(_0x43f9c1,null));};exports[_0x127d('0x47')]=function(_0x2db693,_0x599f29){return db[_0x127d('0x2a')][_0x127d('0x47')](_0x2db693['body'],{})[_0x127d('0x23')](respondWithResult(_0x599f29,0xc9))[_0x127d('0x42')](handleError(_0x599f29,null));};exports[_0x127d('0x22')]=function(_0x51a112,_0x374018){if(_0x51a112[_0x127d('0x48')]['id']){delete _0x51a112[_0x127d('0x48')]['id'];}return db['FreshsalesAccount'][_0x127d('0x46')]({'where':{'id':_0x51a112[_0x127d('0x44')]['id']}})[_0x127d('0x23')](handleEntityNotFound(_0x374018,null))[_0x127d('0x23')](saveUpdates(_0x51a112[_0x127d('0x48')],null))[_0x127d('0x23')](respondWithResult(_0x374018,null))[_0x127d('0x42')](handleError(_0x374018,null));};exports[_0x127d('0x24')]=function(_0x1f5bd7,_0x1010fa){return db[_0x127d('0x2a')][_0x127d('0x46')]({'where':{'id':_0x1f5bd7[_0x127d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1010fa,null))[_0x127d('0x23')](removeEntity(_0x1010fa,null))[_0x127d('0x42')](handleError(_0x1010fa,null));};exports['getConfigurations']=function(_0x2eeb33,_0x43c4a4,_0x3ee5ae){var _0x37d2f={};var _0x319be6={};var _0x44e67e;var _0x328980;return db['FreshsalesAccount'][_0x127d('0x49')]({'where':{'id':_0x2eeb33[_0x127d('0x44')]['id']}})[_0x127d('0x23')](handleEntityNotFound(_0x43c4a4,null))[_0x127d('0x23')](function(_0x4e341e){if(_0x4e341e){_0x44e67e=_0x4e341e;_0x319be6[_0x127d('0x2e')]=_[_0x127d('0x4a')](db[_0x127d('0x4b')][_0x127d('0x2b')]);_0x319be6[_0x127d('0x2f')]=_[_0x127d('0x4a')](_0x2eeb33[_0x127d('0x2f')]);_0x319be6[_0x127d('0x38')]=_['intersection'](_0x319be6[_0x127d('0x2e')],_0x319be6['query']);_0x37d2f['attributes']=_[_0x127d('0x30')](_0x319be6[_0x127d('0x2e')],qs[_0x127d('0x32')](_0x2eeb33['query'][_0x127d('0x32')]));_0x37d2f[_0x127d('0x31')]=_0x37d2f[_0x127d('0x31')]['length']?_0x37d2f['attributes']:_0x319be6[_0x127d('0x2e')];_0x37d2f[_0x127d('0x35')]=qs[_0x127d('0x36')](_0x2eeb33[_0x127d('0x2f')][_0x127d('0x36')]);_0x37d2f[_0x127d('0x37')]=qs['filters'](_[_0x127d('0x39')](_0x2eeb33['query'],_0x319be6[_0x127d('0x38')]));if(_0x2eeb33[_0x127d('0x2f')][_0x127d('0x3d')]){_0x37d2f[_0x127d('0x37')]=_['merge'](_0x37d2f[_0x127d('0x37')],{'$or':_['map'](_0x37d2f[_0x127d('0x31')],function(_0x8add0c){var _0x3b23ce={};_0x3b23ce[_0x8add0c]={'$like':'%'+_0x2eeb33['query'][_0x127d('0x3d')]+'%'};return _0x3b23ce;})});}_0x37d2f=_[_0x127d('0x3a')]({},_0x37d2f,_0x2eeb33['options']);return _0x44e67e[_0x127d('0x4c')](_0x37d2f);}})['then'](function(_0x85686e){if(_0x85686e){_0x328980=_0x85686e['length'];if(!_0x2eeb33['query']['hasOwnProperty']('nolimit')){_0x37d2f[_0x127d('0x1b')]=qs['limit'](_0x2eeb33[_0x127d('0x2f')]['limit']);_0x37d2f[_0x127d('0x19')]=qs[_0x127d('0x19')](_0x2eeb33[_0x127d('0x2f')]['offset']);}return _0x44e67e['getConfigurations'](_0x37d2f);}})[_0x127d('0x23')](function(_0x2d4376){if(_0x2d4376){return _0x2d4376?{'count':_0x328980,'rows':_0x2d4376}:null;}})['then'](respondWithResult(_0x43c4a4,null))[_0x127d('0x42')](handleError(_0x43c4a4,null));};exports['addConfiguration']=function(_0x256aac,_0x40b44e,_0x55192b){if(_0x256aac['body']['id']){delete _0x256aac[_0x127d('0x48')]['id'];}return db[_0x127d('0x2a')][_0x127d('0x49')]({'where':{'id':_0x256aac['params']['id']}})[_0x127d('0x23')](handleEntityNotFound(_0x40b44e,null))[_0x127d('0x23')](function(_0x42e7c9){if(_0x42e7c9){_0x256aac[_0x127d('0x48')][_0x127d('0x4d')]=_0x42e7c9['id'];_0x256aac[_0x127d('0x48')][_0x127d('0x4e')]=integrations[_0x127d('0x4f')](_0x256aac[_0x127d('0x48')][_0x127d('0x50')],_0x256aac[_0x127d('0x48')]['type']);_0x256aac[_0x127d('0x48')][_0x127d('0x51')]=integrations['getDescriptions'](_0x256aac[_0x127d('0x48')]['channel'],_0x256aac['body']['type']);return db['FreshsalesConfiguration'][_0x127d('0x47')](_0x256aac[_0x127d('0x48')],{'include':[{'model':db[_0x127d('0x52')],'as':_0x127d('0x4e')},{'model':db['FreshsalesField'],'as':_0x127d('0x51')}]});}return null;})[_0x127d('0x23')](respondWithResult(_0x40b44e,null))[_0x127d('0x42')](handleError(_0x40b44e,null));};exports[_0x127d('0x53')]=function(_0x1f0062,_0x4b27a8,_0x572135){var _0x95bc67='';var _0x2877af='';return db[_0x127d('0x2a')][_0x127d('0x49')]({'where':{'id':_0x1f0062[_0x127d('0x44')]['id']},'attributes':['id',_0x127d('0x54'),_0x127d('0x55'),_0x127d('0x56')]})[_0x127d('0x23')](handleEntityNotFound(_0x4b27a8,null))[_0x127d('0x23')](function(_0x5b4702){if(_0x5b4702){_0x2877af=_0x5b4702['username'];_0x95bc67=_0x5b4702[_0x127d('0x55')];var _0x5964eb=_0x5b4702['remoteUri'][_0x127d('0x57')](-0x1);if(_0x5964eb==='/'){_0x95bc67=_0x95bc67[_0x127d('0x58')](0x0,_0x95bc67[_0x127d('0x59')](_0x5964eb));}return rp({'method':'GET','uri':util['format'](_0x127d('0x5a'),_0x95bc67,_0x127d('0x5b')),'headers':{'Authorization':_0x127d('0x5c')+_0x5b4702[_0x127d('0x56')]},'json':!![]});}})[_0x127d('0x23')](function(_0x52e221){if(_0x52e221){var _0x86fb12=_0x52e221[_0x127d('0x5d')];var _0x190f21=![];var _0x3544f6=null;for(_0x3544f6=0x0;_0x3544f6<_0x86fb12[_0x127d('0x45')];_0x3544f6++){if(_0x86fb12[_0x3544f6][_0x127d('0x5e')]===_0x2877af){_0x190f21=!![];}}if(_0x190f21){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x127d('0x5f')});}}})[_0x127d('0x23')](respondWithResult(_0x4b27a8,null))[_0x127d('0x42')](function(_0x521344){var _0x2e0cfe=_0x1f0062[_0x127d('0x2f')][_0x127d('0x60')]?0x1f4:_0x521344[_0x127d('0x61')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x127d('0x53'),_0x2e0cfe,JSON[_0x127d('0x62')](_0x521344));delete _0x521344[_0x127d('0x26')];if(_0x2e0cfe===0x191){_0x2e0cfe=0x190;}_0x4b27a8[_0x127d('0x17')](_0x2e0cfe)['send'](_0x1f0062[_0x127d('0x2f')]['test']?{'message':_0x127d('0x63'),'statusCode':_0x521344[_0x127d('0x61')]}:_0x521344);});}; \ No newline at end of file +var _0x5e48=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','FreshsalesAccount','findAll','rows','catch','params','options','find','create','body','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x54ffac,_0x502742){var _0x351665=function(_0x4eaed1){while(--_0x4eaed1){_0x54ffac['push'](_0x54ffac['shift']());}};_0x351665(++_0x502742);}(_0x5e48,0xb7));var _0x85e4=function(_0x4ef8d0,_0x140a4a){_0x4ef8d0=_0x4ef8d0-0x0;var _0x496a12=_0x5e48[_0x4ef8d0];return _0x496a12;};'use strict';var emlformat=require(_0x85e4('0x0'));var rimraf=require(_0x85e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x85e4('0x2'));var moment=require('moment');var BPromise=require(_0x85e4('0x3'));var Mustache=require(_0x85e4('0x4'));var util=require('util');var path=require(_0x85e4('0x5'));var sox=require('sox');var csv=require(_0x85e4('0x6'));var ejs=require(_0x85e4('0x7'));var fs=require('fs');var fs_extra=require(_0x85e4('0x8'));var _=require(_0x85e4('0x9'));var squel=require(_0x85e4('0xa'));var crypto=require(_0x85e4('0xb'));var jsforce=require(_0x85e4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x85e4('0xd'));var Redis=require(_0x85e4('0xe'));var authService=require(_0x85e4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x85e4('0x10'));var hardwareService=require(_0x85e4('0x11'));var logger=require('../../config/logger')(_0x85e4('0x12'));var utils=require(_0x85e4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x85e4('0x14'));var db=require(_0x85e4('0x15'))['db'];var integrations=require(_0x85e4('0x16'));function respondWithStatusCode(_0x4d82ec,_0x34e531){_0x34e531=_0x34e531||0xcc;return function(_0x530a92){if(_0x530a92){return _0x4d82ec[_0x85e4('0x17')](_0x34e531);}return _0x4d82ec[_0x85e4('0x18')](_0x34e531)[_0x85e4('0x19')]();};}function respondWithResult(_0x27bd92,_0xb2fccc){_0xb2fccc=_0xb2fccc||0xc8;return function(_0x5f0b88){if(_0x5f0b88){return _0x27bd92[_0x85e4('0x18')](_0xb2fccc)[_0x85e4('0x1a')](_0x5f0b88);}};}function respondWithFilteredResult(_0x50fd66,_0x3204eb){return function(_0x115ed2){if(_0x115ed2){var _0x5ddf6f=typeof _0x3204eb['offset']===_0x85e4('0x1b')&&typeof _0x3204eb[_0x85e4('0x1c')]==='undefined';var _0x3e3cf9=_0x115ed2[_0x85e4('0x1d')];var _0xcf8cd8=_0x5ddf6f?0x0:_0x3204eb[_0x85e4('0x1e')];var _0x11259e=_0x5ddf6f?_0x115ed2[_0x85e4('0x1d')]:_0x3204eb[_0x85e4('0x1e')]+_0x3204eb[_0x85e4('0x1c')];var _0x42dfb9;if(_0x11259e>=_0x3e3cf9){_0x11259e=_0x3e3cf9;_0x42dfb9=0xc8;}else{_0x42dfb9=0xce;}_0x50fd66['status'](_0x42dfb9);return _0x50fd66[_0x85e4('0x1f')](_0x85e4('0x20'),_0xcf8cd8+'-'+_0x11259e+'/'+_0x3e3cf9)[_0x85e4('0x1a')](_0x115ed2);}return null;};}function patchUpdates(_0x4abd78){return function(_0x75ba69){try{jsonpatch[_0x85e4('0x21')](_0x75ba69,_0x4abd78,!![]);}catch(_0x115cf3){return BPromise[_0x85e4('0x22')](_0x115cf3);}return _0x75ba69[_0x85e4('0x23')]();};}function saveUpdates(_0x46eae9,_0x5f20a9){return function(_0xa3074f){if(_0xa3074f){return _0xa3074f[_0x85e4('0x24')](_0x46eae9)[_0x85e4('0x25')](function(_0x54271e){return _0x54271e;});}return null;};}function removeEntity(_0x42dc68,_0x1294f0){return function(_0x4d751a){if(_0x4d751a){return _0x4d751a[_0x85e4('0x26')]()[_0x85e4('0x25')](function(){_0x42dc68[_0x85e4('0x18')](0xcc)[_0x85e4('0x19')]();});}};}function handleEntityNotFound(_0x5a6fa2,_0x190add){return function(_0x34bdf7){if(!_0x34bdf7){_0x5a6fa2[_0x85e4('0x17')](0x194);}return _0x34bdf7;};}function handleError(_0x3e21c8,_0x2aaca8){_0x2aaca8=_0x2aaca8||0x1f4;return function(_0x117a35){logger[_0x85e4('0x27')](_0x117a35[_0x85e4('0x28')]);if(_0x117a35[_0x85e4('0x29')]){delete _0x117a35[_0x85e4('0x29')];}_0x3e21c8[_0x85e4('0x18')](_0x2aaca8)[_0x85e4('0x2a')](_0x117a35);};}exports[_0x85e4('0x2b')]=function(_0x3cc32a,_0x55b217){var _0x577aa5={},_0x36cbd0={},_0x5036e4={'count':0x0,'rows':[]};var _0xb49390=_[_0x85e4('0x2c')](db['FreshsalesAccount'][_0x85e4('0x2d')],function(_0x5bbfc0){return{'name':_0x5bbfc0[_0x85e4('0x2e')],'type':_0x5bbfc0[_0x85e4('0x2f')]['key']};});_0x36cbd0[_0x85e4('0x30')]=_[_0x85e4('0x2c')](_0xb49390,_0x85e4('0x29'));_0x36cbd0[_0x85e4('0x31')]=_[_0x85e4('0x32')](_0x3cc32a[_0x85e4('0x31')]);_0x36cbd0[_0x85e4('0x33')]=_[_0x85e4('0x34')](_0x36cbd0[_0x85e4('0x30')],_0x36cbd0['query']);_0x577aa5['attributes']=_['intersection'](_0x36cbd0['model'],qs[_0x85e4('0x35')](_0x3cc32a[_0x85e4('0x31')][_0x85e4('0x35')]));_0x577aa5[_0x85e4('0x36')]=_0x577aa5[_0x85e4('0x36')][_0x85e4('0x37')]?_0x577aa5[_0x85e4('0x36')]:_0x36cbd0[_0x85e4('0x30')];if(!_0x3cc32a[_0x85e4('0x31')][_0x85e4('0x38')](_0x85e4('0x39'))){_0x577aa5[_0x85e4('0x1c')]=qs[_0x85e4('0x1c')](_0x3cc32a[_0x85e4('0x31')][_0x85e4('0x1c')]);_0x577aa5[_0x85e4('0x1e')]=qs[_0x85e4('0x1e')](_0x3cc32a['query'][_0x85e4('0x1e')]);}_0x577aa5[_0x85e4('0x3a')]=qs[_0x85e4('0x3b')](_0x3cc32a['query'][_0x85e4('0x3b')]);_0x577aa5[_0x85e4('0x3c')]=qs[_0x85e4('0x33')](_[_0x85e4('0x3d')](_0x3cc32a[_0x85e4('0x31')],_0x36cbd0[_0x85e4('0x33')]),_0xb49390);if(_0x3cc32a[_0x85e4('0x31')][_0x85e4('0x3e')]){_0x577aa5[_0x85e4('0x3c')]=_['merge'](_0x577aa5['where'],{'$or':_[_0x85e4('0x2c')](_0xb49390,function(_0x58ada0){if(_0x58ada0['type']!=='VIRTUAL'){var _0x428a65={};_0x428a65[_0x58ada0[_0x85e4('0x29')]]={'$like':'%'+_0x3cc32a['query'][_0x85e4('0x3e')]+'%'};return _0x428a65;}})});}_0x577aa5=_[_0x85e4('0x3f')]({},_0x577aa5,_0x3cc32a['options']);var _0x1c0ec4={'where':_0x577aa5[_0x85e4('0x3c')]};return db['FreshsalesAccount']['count'](_0x1c0ec4)[_0x85e4('0x25')](function(_0x3890f9){_0x5036e4['count']=_0x3890f9;if(_0x3cc32a[_0x85e4('0x31')][_0x85e4('0x40')]){_0x577aa5[_0x85e4('0x41')]=[{'all':!![]}];}return db[_0x85e4('0x42')][_0x85e4('0x43')](_0x577aa5);})[_0x85e4('0x25')](function(_0x35e7e1){_0x5036e4[_0x85e4('0x44')]=_0x35e7e1;return _0x5036e4;})['then'](respondWithFilteredResult(_0x55b217,_0x577aa5))[_0x85e4('0x45')](handleError(_0x55b217,null));};exports['show']=function(_0x1be8b8,_0x24015f){var _0x405003={'raw':![],'where':{'id':_0x1be8b8[_0x85e4('0x46')]['id']}},_0x35d4fe={};_0x35d4fe[_0x85e4('0x30')]=_[_0x85e4('0x32')](db[_0x85e4('0x42')]['rawAttributes']);_0x35d4fe[_0x85e4('0x31')]=_[_0x85e4('0x32')](_0x1be8b8['query']);_0x35d4fe[_0x85e4('0x33')]=_[_0x85e4('0x34')](_0x35d4fe['model'],_0x35d4fe[_0x85e4('0x31')]);_0x405003['attributes']=_[_0x85e4('0x34')](_0x35d4fe['model'],qs[_0x85e4('0x35')](_0x1be8b8[_0x85e4('0x31')][_0x85e4('0x35')]));_0x405003['attributes']=_0x405003[_0x85e4('0x36')][_0x85e4('0x37')]?_0x405003['attributes']:_0x35d4fe[_0x85e4('0x30')];if(_0x1be8b8[_0x85e4('0x31')][_0x85e4('0x40')]){_0x405003[_0x85e4('0x41')]=[{'all':!![]}];}_0x405003=_[_0x85e4('0x3f')]({},_0x405003,_0x1be8b8[_0x85e4('0x47')]);return db[_0x85e4('0x42')][_0x85e4('0x48')](_0x405003)[_0x85e4('0x25')](handleEntityNotFound(_0x24015f,null))[_0x85e4('0x25')](respondWithResult(_0x24015f,null))['catch'](handleError(_0x24015f,null));};exports['create']=function(_0x392287,_0x5b0e54){return db[_0x85e4('0x42')][_0x85e4('0x49')](_0x392287[_0x85e4('0x4a')],{})[_0x85e4('0x25')](respondWithResult(_0x5b0e54,0xc9))[_0x85e4('0x45')](handleError(_0x5b0e54,null));};exports['update']=function(_0x346cc0,_0x19afcd){if(_0x346cc0['body']['id']){delete _0x346cc0[_0x85e4('0x4a')]['id'];}return db[_0x85e4('0x42')][_0x85e4('0x48')]({'where':{'id':_0x346cc0['params']['id']}})[_0x85e4('0x25')](handleEntityNotFound(_0x19afcd,null))[_0x85e4('0x25')](saveUpdates(_0x346cc0[_0x85e4('0x4a')],null))['then'](respondWithResult(_0x19afcd,null))['catch'](handleError(_0x19afcd,null));};exports[_0x85e4('0x26')]=function(_0x18fdad,_0x57f3d6){return db[_0x85e4('0x42')][_0x85e4('0x48')]({'where':{'id':_0x18fdad[_0x85e4('0x46')]['id']}})[_0x85e4('0x25')](handleEntityNotFound(_0x57f3d6,null))[_0x85e4('0x25')](removeEntity(_0x57f3d6,null))['catch'](handleError(_0x57f3d6,null));};exports[_0x85e4('0x4b')]=function(_0x1ccb4c,_0x26cffe,_0x377005){var _0x39ad50={};var _0x215ebf={};var _0x5c4502;var _0x237074;return db[_0x85e4('0x42')]['findOne']({'where':{'id':_0x1ccb4c[_0x85e4('0x46')]['id']}})[_0x85e4('0x25')](handleEntityNotFound(_0x26cffe,null))['then'](function(_0x425b19){if(_0x425b19){_0x5c4502=_0x425b19;_0x215ebf[_0x85e4('0x30')]=_[_0x85e4('0x32')](db[_0x85e4('0x4c')]['rawAttributes']);_0x215ebf[_0x85e4('0x31')]=_[_0x85e4('0x32')](_0x1ccb4c[_0x85e4('0x31')]);_0x215ebf[_0x85e4('0x33')]=_[_0x85e4('0x34')](_0x215ebf[_0x85e4('0x30')],_0x215ebf[_0x85e4('0x31')]);_0x39ad50[_0x85e4('0x36')]=_[_0x85e4('0x34')](_0x215ebf[_0x85e4('0x30')],qs['fields'](_0x1ccb4c[_0x85e4('0x31')][_0x85e4('0x35')]));_0x39ad50[_0x85e4('0x36')]=_0x39ad50['attributes']['length']?_0x39ad50[_0x85e4('0x36')]:_0x215ebf[_0x85e4('0x30')];_0x39ad50[_0x85e4('0x3a')]=qs[_0x85e4('0x3b')](_0x1ccb4c[_0x85e4('0x31')][_0x85e4('0x3b')]);_0x39ad50['where']=qs['filters'](_[_0x85e4('0x3d')](_0x1ccb4c[_0x85e4('0x31')],_0x215ebf[_0x85e4('0x33')]));if(_0x1ccb4c[_0x85e4('0x31')]['filter']){_0x39ad50[_0x85e4('0x3c')]=_['merge'](_0x39ad50[_0x85e4('0x3c')],{'$or':_[_0x85e4('0x2c')](_0x39ad50[_0x85e4('0x36')],function(_0x5862e1){var _0x55c08b={};_0x55c08b[_0x5862e1]={'$like':'%'+_0x1ccb4c[_0x85e4('0x31')][_0x85e4('0x3e')]+'%'};return _0x55c08b;})});}_0x39ad50=_[_0x85e4('0x3f')]({},_0x39ad50,_0x1ccb4c[_0x85e4('0x47')]);return _0x5c4502[_0x85e4('0x4b')](_0x39ad50);}})[_0x85e4('0x25')](function(_0x3fc7c8){if(_0x3fc7c8){_0x237074=_0x3fc7c8[_0x85e4('0x37')];if(!_0x1ccb4c['query']['hasOwnProperty'](_0x85e4('0x39'))){_0x39ad50[_0x85e4('0x1c')]=qs[_0x85e4('0x1c')](_0x1ccb4c[_0x85e4('0x31')][_0x85e4('0x1c')]);_0x39ad50[_0x85e4('0x1e')]=qs['offset'](_0x1ccb4c[_0x85e4('0x31')][_0x85e4('0x1e')]);}return _0x5c4502[_0x85e4('0x4b')](_0x39ad50);}})[_0x85e4('0x25')](function(_0x276eed){if(_0x276eed){return _0x276eed?{'count':_0x237074,'rows':_0x276eed}:null;}})[_0x85e4('0x25')](respondWithResult(_0x26cffe,null))['catch'](handleError(_0x26cffe,null));};exports[_0x85e4('0x4d')]=function(_0x5a287d,_0xd91ada,_0x255771){if(_0x5a287d[_0x85e4('0x4a')]['id']){delete _0x5a287d[_0x85e4('0x4a')]['id'];}return db[_0x85e4('0x42')][_0x85e4('0x4e')]({'where':{'id':_0x5a287d[_0x85e4('0x46')]['id']}})[_0x85e4('0x25')](handleEntityNotFound(_0xd91ada,null))[_0x85e4('0x25')](function(_0x5607ab){if(_0x5607ab){_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x4f')]=_0x5607ab['id'];_0x5a287d['body'][_0x85e4('0x50')]=integrations[_0x85e4('0x51')](_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x52')],_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x2f')]);_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x53')]=integrations['getDescriptions'](_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x52')],_0x5a287d[_0x85e4('0x4a')][_0x85e4('0x2f')]);return db[_0x85e4('0x4c')][_0x85e4('0x49')](_0x5a287d['body'],{'include':[{'model':db[_0x85e4('0x54')],'as':_0x85e4('0x50')},{'model':db['FreshsalesField'],'as':_0x85e4('0x53')}]});}return null;})[_0x85e4('0x25')](respondWithResult(_0xd91ada,null))[_0x85e4('0x45')](handleError(_0xd91ada,null));};exports[_0x85e4('0x55')]=function(_0x24969b,_0x52674f,_0x446e60){var _0x521e6f='';var _0x1b93bc='';return db[_0x85e4('0x42')]['findOne']({'where':{'id':_0x24969b[_0x85e4('0x46')]['id']},'attributes':['id','username',_0x85e4('0x56'),_0x85e4('0x57')]})['then'](handleEntityNotFound(_0x52674f,null))[_0x85e4('0x25')](function(_0x40b5cc){if(_0x40b5cc){_0x1b93bc=_0x40b5cc[_0x85e4('0x58')];_0x521e6f=_0x40b5cc['remoteUri'];var _0x2f0a8a=_0x40b5cc['remoteUri'][_0x85e4('0x59')](-0x1);if(_0x2f0a8a==='/'){_0x521e6f=_0x521e6f[_0x85e4('0x5a')](0x0,_0x521e6f['lastIndexOf'](_0x2f0a8a));}return rp({'method':_0x85e4('0x5b'),'uri':util[_0x85e4('0x5c')](_0x85e4('0x5d'),_0x521e6f,_0x85e4('0x5e')),'headers':{'Authorization':_0x85e4('0x5f')+_0x40b5cc['apiKey']},'json':!![]});}})[_0x85e4('0x25')](function(_0x4858a6){if(_0x4858a6){var _0x67134b=_0x4858a6[_0x85e4('0x60')];var _0x34db7f=![];var _0x11380e=null;for(_0x11380e=0x0;_0x11380e<_0x67134b['length'];_0x11380e++){if(_0x67134b[_0x11380e]['email']===_0x1b93bc){_0x34db7f=!![];}}if(_0x34db7f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x85e4('0x61')});}}})['then'](respondWithResult(_0x52674f,null))[_0x85e4('0x45')](function(_0x4001fc){var _0x46824a=_0x24969b[_0x85e4('0x31')][_0x85e4('0x62')]?0x1f4:_0x4001fc[_0x85e4('0x63')]||0x1f4;logger['error'](_0x85e4('0x64'),_0x85e4('0x55'),_0x46824a,JSON['stringify'](_0x4001fc));delete _0x4001fc[_0x85e4('0x29')];if(_0x46824a===0x191){_0x46824a=0x190;}_0x52674f[_0x85e4('0x18')](_0x46824a)['send'](_0x24969b[_0x85e4('0x31')]['test']?{'message':_0x85e4('0x65'),'statusCode':_0x4001fc[_0x85e4('0x63')]}:_0x4001fc);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0457cec..5f67fcb 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 _0xc4aa=['bluebird','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1b336a,_0x52c472){_0x1b336a=_0x1b336a-0x0;var _0x2a8371=_0x3f8a[_0x1b336a];return _0x2a8371;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('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 23b50df..3bcadc1 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 _0xd046=['ioredis','../../config/logger','../../config/environment','http','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','find','ShowFreshsalesAccount','util','moment','bluebird'];(function(_0x53f4ce,_0x164396){var _0x3ae279=function(_0x278f9d){while(--_0x278f9d){_0x53f4ce['push'](_0x53f4ce['shift']());}};_0x3ae279(++_0x164396);}(_0xd046,0x129));var _0x6d04=function(_0x520ffc,_0x409b7a){_0x520ffc=_0x520ffc-0x0;var _0x3fc46a=_0xd046[_0x520ffc];return _0x3fc46a;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});}exports[_0x6d04('0xf')]=function(_0x2bc798){var _0x3ad325=this;return new Promise(function(_0x4e93b5,_0x3657a1){return db[_0x6d04('0x10')][_0x6d04('0x11')]({'raw':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x15')]||null:null,'limit':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options'][_0x6d04('0x16')]||null:null,'include':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options']['include']?_[_0x6d04('0x17')](_0x2bc798[_0x6d04('0x12')][_0x6d04('0x18')],function(_0xe8f198){return{'model':db[_0xe8f198[_0x6d04('0x19')]],'as':_0xe8f198['as'],'attributes':_0xe8f198[_0x6d04('0x15')],'include':_0xe8f198[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0xe8f198[_0x6d04('0x18')],function(_0x38e90f){return{'model':db[_0x38e90f[_0x6d04('0x19')]],'as':_0x38e90f['as'],'attributes':_0x38e90f[_0x6d04('0x15')],'include':_0x38e90f[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x38e90f['include'],function(_0x1dc29b){return{'model':db[_0x1dc29b[_0x6d04('0x19')]],'as':_0x1dc29b['as'],'attributes':_0x1dc29b[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x4256a3){logger[_0x6d04('0xc')]('GetFreshsalesAccount',_0x2bc798);logger[_0x6d04('0x1b')](_0x6d04('0xf'),_0x2bc798,JSON[_0x6d04('0x9')](_0x4256a3));_0x4e93b5(_0x4256a3);})[_0x6d04('0xe')](function(_0x2ed2bb){logger['error']('GetFreshsalesAccount',_0x2ed2bb['message'],_0x2bc798);_0x3657a1(_0x3ad325['error'](0x1f4,_0x2ed2bb[_0x6d04('0xb')]));});});};exports['ShowFreshsalesAccount']=function(_0x43eb48){var _0x4ed123=this;return new Promise(function(_0x26be38,_0xee1291){return db[_0x6d04('0x10')][_0x6d04('0x1c')]({'raw':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x43eb48['options']?_0x43eb48['options'][_0x6d04('0x15')]||null:null,'include':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')]?_['map'](_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')],function(_0x40758d){return{'model':db[_0x40758d[_0x6d04('0x19')]],'as':_0x40758d['as'],'attributes':_0x40758d['attributes'],'include':_0x40758d[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x40758d[_0x6d04('0x18')],function(_0x184da2){return{'model':db[_0x184da2[_0x6d04('0x19')]],'as':_0x184da2['as'],'attributes':_0x184da2[_0x6d04('0x15')],'include':_0x184da2[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x184da2[_0x6d04('0x18')],function(_0x67e455){return{'model':db[_0x67e455[_0x6d04('0x19')]],'as':_0x67e455['as'],'attributes':_0x67e455[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x2c2203){logger[_0x6d04('0xc')]('ShowFreshsalesAccount',_0x43eb48);logger[_0x6d04('0x1b')]('ShowFreshsalesAccount',_0x43eb48,JSON[_0x6d04('0x9')](_0x2c2203));_0x26be38(_0x2c2203);})[_0x6d04('0xe')](function(_0x4c1908){logger[_0x6d04('0xa')](_0x6d04('0x1d'),_0x4c1908[_0x6d04('0xb')],_0x43eb48);_0xee1291(_0x4ed123[_0x6d04('0xa')](0x1f4,_0x4c1908[_0x6d04('0xb')]));});});}; \ No newline at end of file +var _0x7bd0=['limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FreshsalesAccount','findAll','options','raw','where','attributes'];(function(_0x3256b6,_0x379213){var _0x4f9a31=function(_0x33aedd){while(--_0x33aedd){_0x3256b6['push'](_0x3256b6['shift']());}};_0x4f9a31(++_0x379213);}(_0x7bd0,0x111));var _0x07bd=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x7bd0[_0x1f1e31];return _0x229b56;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=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')]('GetFreshsalesAccount',_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 diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b61347e..d8a1252 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 _0x53e1=['post','create','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x53e1,0x185));var _0x153e=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x53e1[_0x49aa7d];return _0xdd0d26;};'use strict';var multer=require('multer');var util=require(_0x153e('0x0'));var path=require(_0x153e('0x1'));var timeout=require(_0x153e('0x2'));var express=require('express');var router=express[_0x153e('0x3')]();var fs_extra=require(_0x153e('0x4'));var auth=require(_0x153e('0x5'));var interaction=require(_0x153e('0x6'));var config=require(_0x153e('0x7'));var controller=require(_0x153e('0x8'));router[_0x153e('0x9')]('/',auth[_0x153e('0xa')](),controller[_0x153e('0xb')]);router[_0x153e('0x9')](_0x153e('0xc'),auth[_0x153e('0xa')](),controller[_0x153e('0xd')]);router[_0x153e('0x9')](_0x153e('0xe'),auth['isAuthenticated'](),controller[_0x153e('0xf')]);router[_0x153e('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x153e('0x10')]);router[_0x153e('0x9')](_0x153e('0x11'),auth[_0x153e('0xa')](),controller[_0x153e('0x12')]);router[_0x153e('0x13')]('/',auth[_0x153e('0xa')](),controller[_0x153e('0x14')]);router[_0x153e('0x15')](_0x153e('0xc'),auth[_0x153e('0xa')](),controller[_0x153e('0x16')]);router['delete'](_0x153e('0xc'),auth[_0x153e('0xa')](),controller[_0x153e('0x17')]);module['exports']=router; \ No newline at end of file +var _0x94e8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2e0a3e,_0x5d6537){var _0x152b5c=function(_0x125c3e){while(--_0x125c3e){_0x2e0a3e['push'](_0x2e0a3e['shift']());}};_0x152b5c(++_0x5d6537);}(_0x94e8,0x104));var _0x894e=function(_0x58e32c,_0x309781){_0x58e32c=_0x58e32c-0x0;var _0x481e60=_0x94e8[_0x58e32c];return _0x481e60;};'use strict';var multer=require(_0x894e('0x0'));var util=require(_0x894e('0x1'));var path=require(_0x894e('0x2'));var timeout=require(_0x894e('0x3'));var express=require(_0x894e('0x4'));var router=express[_0x894e('0x5')]();var fs_extra=require(_0x894e('0x6'));var auth=require(_0x894e('0x7'));var interaction=require(_0x894e('0x8'));var config=require(_0x894e('0x9'));var controller=require(_0x894e('0xa'));router[_0x894e('0xb')]('/',auth[_0x894e('0xc')](),controller['index']);router['get'](_0x894e('0xd'),auth[_0x894e('0xc')](),controller[_0x894e('0xe')]);router['get'](_0x894e('0xf'),auth[_0x894e('0xc')](),controller[_0x894e('0x10')]);router[_0x894e('0xb')]('/:id/descriptions',auth[_0x894e('0xc')](),controller[_0x894e('0x11')]);router[_0x894e('0xb')]('/:id/fields',auth[_0x894e('0xc')](),controller[_0x894e('0x12')]);router[_0x894e('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x894e('0xd'),auth[_0x894e('0xc')](),controller[_0x894e('0x14')]);router[_0x894e('0x15')]('/:id',auth[_0x894e('0xc')](),controller[_0x894e('0x16')]);module[_0x894e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 9ffd331..6e7a0f9 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 _0xf159=['STRING','sequelize'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xf159,0x17f));var _0x9f15=function(_0x28ffea,_0x5adbfd){_0x28ffea=_0x28ffea-0x0;var _0x5cb3e5=_0xf159[_0x28ffea];return _0x5cb3e5;};'use strict';var Sequelize=require(_0x9f15('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f15('0x1')]}}; \ No newline at end of file +var _0xb1bc=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb1bc,0x85));var _0xcb1b=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xb1bc[_0x5e9876];return _0x576c48;};'use strict';var Sequelize=require(_0xcb1b('0x0'));module[_0xcb1b('0x1')]={'name':{'type':Sequelize[_0xcb1b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 247fcd5..75a0320 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 _0x605f=['filter','merge','VIRTUAL','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','order','length','nolimit','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x605f,0x65));var _0xf605=function(_0x16b1f7,_0x540f52){_0x16b1f7=_0x16b1f7-0x0;var _0x5b2799=_0x605f[_0x16b1f7];return _0x5b2799;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf605('0x0'));var zipdir=require(_0xf605('0x1'));var jsonpatch=require(_0xf605('0x2'));var rp=require(_0xf605('0x3'));var moment=require(_0xf605('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf605('0x5'));var path=require(_0xf605('0x6'));var sox=require('sox');var csv=require(_0xf605('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf605('0x8'));var _=require(_0xf605('0x9'));var squel=require(_0xf605('0xa'));var crypto=require(_0xf605('0xb'));var jsforce=require(_0xf605('0xc'));var deskjs=require(_0xf605('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf605('0xe'));var Papa=require(_0xf605('0xf'));var Redis=require(_0xf605('0x10'));var authService=require(_0xf605('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf605('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf605('0x13'))(_0xf605('0x14'));var utils=require(_0xf605('0x15'));var config=require(_0xf605('0x16'));var licenseUtil=require(_0xf605('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9e410c,_0x4034c2){_0x4034c2=_0x4034c2||0xcc;return function(_0x4f9f62){if(_0x4f9f62){return _0x9e410c[_0xf605('0x18')](_0x4034c2);}return _0x9e410c[_0xf605('0x19')](_0x4034c2)[_0xf605('0x1a')]();};}function respondWithResult(_0x5cda82,_0xf49236){_0xf49236=_0xf49236||0xc8;return function(_0x3ed13c){if(_0x3ed13c){return _0x5cda82['status'](_0xf49236)[_0xf605('0x1b')](_0x3ed13c);}};}function respondWithFilteredResult(_0xe08b32,_0x12040b){return function(_0x2ff17f){if(_0x2ff17f){var _0x4007dc=typeof _0x12040b[_0xf605('0x1c')]===_0xf605('0x1d')&&typeof _0x12040b[_0xf605('0x1e')]===_0xf605('0x1d');var _0x39a3d6=_0x2ff17f[_0xf605('0x1f')];var _0x29fad3=_0x4007dc?0x0:_0x12040b[_0xf605('0x1c')];var _0x5d548f=_0x4007dc?_0x2ff17f['count']:_0x12040b[_0xf605('0x1c')]+_0x12040b[_0xf605('0x1e')];var _0x2b71e9;if(_0x5d548f>=_0x39a3d6){_0x5d548f=_0x39a3d6;_0x2b71e9=0xc8;}else{_0x2b71e9=0xce;}_0xe08b32[_0xf605('0x19')](_0x2b71e9);return _0xe08b32['set']('Content-Range',_0x29fad3+'-'+_0x5d548f+'/'+_0x39a3d6)['json'](_0x2ff17f);}return null;};}function patchUpdates(_0x540263){return function(_0x21c64c){try{jsonpatch[_0xf605('0x20')](_0x21c64c,_0x540263,!![]);}catch(_0x329b24){return BPromise['reject'](_0x329b24);}return _0x21c64c[_0xf605('0x21')]();};}function saveUpdates(_0xd9c5ac,_0x4febb3){return function(_0x319846){if(_0x319846){return _0x319846[_0xf605('0x22')](_0xd9c5ac)['then'](function(_0x48f089){return _0x48f089;});}return null;};}function removeEntity(_0x407aa3,_0x2d4aef){return function(_0x5761ec){if(_0x5761ec){return _0x5761ec[_0xf605('0x23')]()[_0xf605('0x24')](function(){_0x407aa3[_0xf605('0x19')](0xcc)[_0xf605('0x1a')]();});}};}function handleEntityNotFound(_0xa4eb51,_0x541f26){return function(_0x51c14f){if(!_0x51c14f){_0xa4eb51[_0xf605('0x18')](0x194);}return _0x51c14f;};}function handleError(_0x2eab11,_0x17a6f4){_0x17a6f4=_0x17a6f4||0x1f4;return function(_0x1b294c){logger['error'](_0x1b294c['stack']);if(_0x1b294c[_0xf605('0x25')]){delete _0x1b294c[_0xf605('0x25')];}_0x2eab11[_0xf605('0x19')](_0x17a6f4)[_0xf605('0x26')](_0x1b294c);};}exports[_0xf605('0x27')]=function(_0x85ff4c,_0x576a17){var _0x23405f={},_0x16d105={},_0x5d9fb5={'count':0x0,'rows':[]};var _0x141078=_[_0xf605('0x28')](db['FreshsalesConfiguration'][_0xf605('0x29')],function(_0x19d1e9){return{'name':_0x19d1e9[_0xf605('0x2a')],'type':_0x19d1e9['type'][_0xf605('0x2b')]};});_0x16d105[_0xf605('0x2c')]=_[_0xf605('0x28')](_0x141078,_0xf605('0x25'));_0x16d105[_0xf605('0x2d')]=_[_0xf605('0x2e')](_0x85ff4c[_0xf605('0x2d')]);_0x16d105[_0xf605('0x2f')]=_[_0xf605('0x30')](_0x16d105['model'],_0x16d105[_0xf605('0x2d')]);_0x23405f[_0xf605('0x31')]=_[_0xf605('0x30')](_0x16d105['model'],qs['fields'](_0x85ff4c[_0xf605('0x2d')][_0xf605('0x32')]));_0x23405f[_0xf605('0x31')]=_0x23405f[_0xf605('0x31')]['length']?_0x23405f[_0xf605('0x31')]:_0x16d105[_0xf605('0x2c')];if(!_0x85ff4c[_0xf605('0x2d')][_0xf605('0x33')]('nolimit')){_0x23405f[_0xf605('0x1e')]=qs[_0xf605('0x1e')](_0x85ff4c[_0xf605('0x2d')][_0xf605('0x1e')]);_0x23405f[_0xf605('0x1c')]=qs['offset'](_0x85ff4c[_0xf605('0x2d')][_0xf605('0x1c')]);}_0x23405f['order']=qs[_0xf605('0x34')](_0x85ff4c['query'][_0xf605('0x34')]);_0x23405f[_0xf605('0x35')]=qs[_0xf605('0x2f')](_[_0xf605('0x36')](_0x85ff4c['query'],_0x16d105[_0xf605('0x2f')]),_0x141078);if(_0x85ff4c['query'][_0xf605('0x37')]){_0x23405f[_0xf605('0x35')]=_[_0xf605('0x38')](_0x23405f['where'],{'$or':_[_0xf605('0x28')](_0x141078,function(_0x50b4a8){if(_0x50b4a8['type']!==_0xf605('0x39')){var _0x43521f={};_0x43521f[_0x50b4a8[_0xf605('0x25')]]={'$like':'%'+_0x85ff4c[_0xf605('0x2d')][_0xf605('0x37')]+'%'};return _0x43521f;}})});}_0x23405f=_[_0xf605('0x38')]({},_0x23405f,_0x85ff4c[_0xf605('0x3a')]);var _0x5ad3a3={'where':_0x23405f[_0xf605('0x35')]};return db[_0xf605('0x3b')][_0xf605('0x1f')](_0x5ad3a3)[_0xf605('0x24')](function(_0x21c2b8){_0x5d9fb5[_0xf605('0x1f')]=_0x21c2b8;if(_0x85ff4c[_0xf605('0x2d')]['includeAll']){_0x23405f[_0xf605('0x3c')]=[{'all':!![]}];}return db[_0xf605('0x3b')][_0xf605('0x3d')](_0x23405f);})[_0xf605('0x24')](function(_0x32dfcb){_0x5d9fb5[_0xf605('0x3e')]=_0x32dfcb;return _0x5d9fb5;})['then'](respondWithFilteredResult(_0x576a17,_0x23405f))[_0xf605('0x3f')](handleError(_0x576a17,null));};exports[_0xf605('0x40')]=function(_0x1ed3e3,_0xedf639){var _0x14113e={'raw':![],'where':{'id':_0x1ed3e3[_0xf605('0x41')]['id']}},_0x4bb98a={};_0x4bb98a[_0xf605('0x2c')]=_[_0xf605('0x2e')](db[_0xf605('0x3b')][_0xf605('0x29')]);_0x4bb98a[_0xf605('0x2d')]=_[_0xf605('0x2e')](_0x1ed3e3[_0xf605('0x2d')]);_0x4bb98a[_0xf605('0x2f')]=_[_0xf605('0x30')](_0x4bb98a['model'],_0x4bb98a[_0xf605('0x2d')]);_0x14113e[_0xf605('0x31')]=_[_0xf605('0x30')](_0x4bb98a['model'],qs['fields'](_0x1ed3e3['query'][_0xf605('0x32')]));_0x14113e['attributes']=_0x14113e[_0xf605('0x31')]['length']?_0x14113e[_0xf605('0x31')]:_0x4bb98a[_0xf605('0x2c')];if(_0x1ed3e3['query'][_0xf605('0x42')]){_0x14113e[_0xf605('0x3c')]=[{'all':!![]}];}_0x14113e=_['merge']({},_0x14113e,_0x1ed3e3[_0xf605('0x3a')]);return db['FreshsalesConfiguration'][_0xf605('0x43')](_0x14113e)[_0xf605('0x24')](handleEntityNotFound(_0xedf639,null))[_0xf605('0x24')](respondWithResult(_0xedf639,null))[_0xf605('0x3f')](handleError(_0xedf639,null));};exports[_0xf605('0x44')]=function(_0x3f74b0,_0x578a3c){return db[_0xf605('0x3b')][_0xf605('0x44')](_0x3f74b0[_0xf605('0x45')],{})[_0xf605('0x24')](respondWithResult(_0x578a3c,0xc9))[_0xf605('0x3f')](handleError(_0x578a3c,null));};exports[_0xf605('0x22')]=function(_0x4a8689,_0x67bbd2){if(_0x4a8689[_0xf605('0x45')]['id']){delete _0x4a8689[_0xf605('0x45')]['id'];}return db[_0xf605('0x3b')]['find']({'where':{'id':_0x4a8689[_0xf605('0x41')]['id']}})['then'](handleEntityNotFound(_0x67bbd2,null))[_0xf605('0x24')](saveUpdates(_0x4a8689[_0xf605('0x45')],null))[_0xf605('0x24')](respondWithResult(_0x67bbd2,null))[_0xf605('0x3f')](handleError(_0x67bbd2,null));};exports[_0xf605('0x23')]=function(_0x38cb7c,_0xa8d1f0){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x38cb7c[_0xf605('0x41')]['id']}})[_0xf605('0x24')](handleEntityNotFound(_0xa8d1f0,null))['then'](removeEntity(_0xa8d1f0,null))[_0xf605('0x3f')](handleError(_0xa8d1f0,null));};exports[_0xf605('0x46')]=function(_0x5640ea,_0x3dc839,_0x32ed76){var _0x3d832a={};var _0x2c4d75={};var _0x59a091;var _0x3ba2c9;return db['FreshsalesConfiguration'][_0xf605('0x47')]({'where':{'id':_0x5640ea['params']['id']}})['then'](handleEntityNotFound(_0x3dc839,null))[_0xf605('0x24')](function(_0x39a07d){if(_0x39a07d){_0x59a091=_0x39a07d;_0x2c4d75[_0xf605('0x2c')]=_['keys'](db[_0xf605('0x48')][_0xf605('0x29')]);_0x2c4d75['query']=_[_0xf605('0x2e')](_0x5640ea[_0xf605('0x2d')]);_0x2c4d75[_0xf605('0x2f')]=_[_0xf605('0x30')](_0x2c4d75[_0xf605('0x2c')],_0x2c4d75['query']);_0x3d832a[_0xf605('0x31')]=_[_0xf605('0x30')](_0x2c4d75['model'],qs[_0xf605('0x32')](_0x5640ea[_0xf605('0x2d')][_0xf605('0x32')]));_0x3d832a['attributes']=_0x3d832a[_0xf605('0x31')]['length']?_0x3d832a[_0xf605('0x31')]:_0x2c4d75[_0xf605('0x2c')];_0x3d832a[_0xf605('0x49')]=qs[_0xf605('0x34')](_0x5640ea['query'][_0xf605('0x34')]);_0x3d832a[_0xf605('0x35')]=qs[_0xf605('0x2f')](_[_0xf605('0x36')](_0x5640ea[_0xf605('0x2d')],_0x2c4d75[_0xf605('0x2f')]));if(_0x5640ea['query'][_0xf605('0x37')]){_0x3d832a[_0xf605('0x35')]=_[_0xf605('0x38')](_0x3d832a[_0xf605('0x35')],{'$or':_['map'](_0x3d832a[_0xf605('0x31')],function(_0x13e1d3){var _0x45f33e={};_0x45f33e[_0x13e1d3]={'$like':'%'+_0x5640ea['query'][_0xf605('0x37')]+'%'};return _0x45f33e;})});}_0x3d832a=_['merge']({},_0x3d832a,_0x5640ea[_0xf605('0x3a')]);return _0x59a091['getSubjects'](_0x3d832a);}})['then'](function(_0x58c836){if(_0x58c836){_0x3ba2c9=_0x58c836[_0xf605('0x4a')];if(!_0x5640ea[_0xf605('0x2d')][_0xf605('0x33')](_0xf605('0x4b'))){_0x3d832a[_0xf605('0x1e')]=qs[_0xf605('0x1e')](_0x5640ea['query']['limit']);_0x3d832a[_0xf605('0x1c')]=qs[_0xf605('0x1c')](_0x5640ea[_0xf605('0x2d')][_0xf605('0x1c')]);}return _0x59a091['getSubjects'](_0x3d832a);}})['then'](function(_0x1e28a5){if(_0x1e28a5){return _0x1e28a5?{'count':_0x3ba2c9,'rows':_0x1e28a5}:null;}})[_0xf605('0x24')](respondWithResult(_0x3dc839,null))[_0xf605('0x3f')](handleError(_0x3dc839,null));};exports[_0xf605('0x4c')]=function(_0x12c7b7,_0x32b768,_0x59323b){var _0x7c4a7b={};var _0x36152c={};var _0xeefe87;var _0x10dbd3;return db[_0xf605('0x3b')][_0xf605('0x47')]({'where':{'id':_0x12c7b7[_0xf605('0x41')]['id']}})['then'](handleEntityNotFound(_0x32b768,null))[_0xf605('0x24')](function(_0x1b599d){if(_0x1b599d){_0xeefe87=_0x1b599d;_0x36152c[_0xf605('0x2c')]=_[_0xf605('0x2e')](db['FreshsalesField'][_0xf605('0x29')]);_0x36152c[_0xf605('0x2d')]=_[_0xf605('0x2e')](_0x12c7b7['query']);_0x36152c['filters']=_[_0xf605('0x30')](_0x36152c[_0xf605('0x2c')],_0x36152c[_0xf605('0x2d')]);_0x7c4a7b[_0xf605('0x31')]=_[_0xf605('0x30')](_0x36152c[_0xf605('0x2c')],qs['fields'](_0x12c7b7[_0xf605('0x2d')][_0xf605('0x32')]));_0x7c4a7b['attributes']=_0x7c4a7b[_0xf605('0x31')]['length']?_0x7c4a7b[_0xf605('0x31')]:_0x36152c[_0xf605('0x2c')];_0x7c4a7b[_0xf605('0x49')]=qs[_0xf605('0x34')](_0x12c7b7[_0xf605('0x2d')][_0xf605('0x34')]);_0x7c4a7b[_0xf605('0x35')]=qs[_0xf605('0x2f')](_[_0xf605('0x36')](_0x12c7b7[_0xf605('0x2d')],_0x36152c[_0xf605('0x2f')]));if(_0x12c7b7['query']['filter']){_0x7c4a7b[_0xf605('0x35')]=_[_0xf605('0x38')](_0x7c4a7b['where'],{'$or':_[_0xf605('0x28')](_0x7c4a7b[_0xf605('0x31')],function(_0x5d27be){var _0x71dd91={};_0x71dd91[_0x5d27be]={'$like':'%'+_0x12c7b7['query'][_0xf605('0x37')]+'%'};return _0x71dd91;})});}_0x7c4a7b=_[_0xf605('0x38')]({},_0x7c4a7b,_0x12c7b7[_0xf605('0x3a')]);return _0xeefe87[_0xf605('0x4c')](_0x7c4a7b);}})[_0xf605('0x24')](function(_0x3fb2cb){if(_0x3fb2cb){_0x10dbd3=_0x3fb2cb[_0xf605('0x4a')];if(!_0x12c7b7[_0xf605('0x2d')][_0xf605('0x33')]('nolimit')){_0x7c4a7b['limit']=qs['limit'](_0x12c7b7[_0xf605('0x2d')][_0xf605('0x1e')]);_0x7c4a7b[_0xf605('0x1c')]=qs[_0xf605('0x1c')](_0x12c7b7[_0xf605('0x2d')][_0xf605('0x1c')]);}return _0xeefe87[_0xf605('0x4c')](_0x7c4a7b);}})[_0xf605('0x24')](function(_0x7b5cd0){if(_0x7b5cd0){return _0x7b5cd0?{'count':_0x10dbd3,'rows':_0x7b5cd0}:null;}})[_0xf605('0x24')](respondWithResult(_0x32b768,null))[_0xf605('0x3f')](handleError(_0x32b768,null));};exports[_0xf605('0x4d')]=function(_0x3a2121,_0xe268ac,_0x3eb1fd){var _0x30f3a3={};var _0x514d66={};var _0x31b5bf;var _0x574477;return db['FreshsalesConfiguration'][_0xf605('0x47')]({'where':{'id':_0x3a2121['params']['id']}})[_0xf605('0x24')](handleEntityNotFound(_0xe268ac,null))[_0xf605('0x24')](function(_0x3803b1){if(_0x3803b1){_0x31b5bf=_0x3803b1;_0x514d66[_0xf605('0x2c')]=_['keys'](db[_0xf605('0x48')]['rawAttributes']);_0x514d66[_0xf605('0x2d')]=_['keys'](_0x3a2121[_0xf605('0x2d')]);_0x514d66[_0xf605('0x2f')]=_[_0xf605('0x30')](_0x514d66[_0xf605('0x2c')],_0x514d66[_0xf605('0x2d')]);_0x30f3a3[_0xf605('0x31')]=_[_0xf605('0x30')](_0x514d66[_0xf605('0x2c')],qs[_0xf605('0x32')](_0x3a2121[_0xf605('0x2d')][_0xf605('0x32')]));_0x30f3a3[_0xf605('0x31')]=_0x30f3a3['attributes'][_0xf605('0x4a')]?_0x30f3a3['attributes']:_0x514d66[_0xf605('0x2c')];_0x30f3a3['order']=qs[_0xf605('0x34')](_0x3a2121['query'][_0xf605('0x34')]);_0x30f3a3[_0xf605('0x35')]=qs['filters'](_[_0xf605('0x36')](_0x3a2121[_0xf605('0x2d')],_0x514d66[_0xf605('0x2f')]));if(_0x3a2121['query'][_0xf605('0x37')]){_0x30f3a3['where']=_[_0xf605('0x38')](_0x30f3a3[_0xf605('0x35')],{'$or':_['map'](_0x30f3a3['attributes'],function(_0x4f534e){var _0x1cb528={};_0x1cb528[_0x4f534e]={'$like':'%'+_0x3a2121['query'][_0xf605('0x37')]+'%'};return _0x1cb528;})});}_0x30f3a3=_['merge']({},_0x30f3a3,_0x3a2121[_0xf605('0x3a')]);return _0x31b5bf[_0xf605('0x4d')](_0x30f3a3);}})['then'](function(_0x8cd2f6){if(_0x8cd2f6){_0x574477=_0x8cd2f6[_0xf605('0x4a')];if(!_0x3a2121['query'][_0xf605('0x33')](_0xf605('0x4b'))){_0x30f3a3['limit']=qs[_0xf605('0x1e')](_0x3a2121['query']['limit']);_0x30f3a3[_0xf605('0x1c')]=qs['offset'](_0x3a2121[_0xf605('0x2d')]['offset']);}return _0x31b5bf[_0xf605('0x4d')](_0x30f3a3);}})[_0xf605('0x24')](function(_0x21a539){if(_0x21a539){return _0x21a539?{'count':_0x574477,'rows':_0x21a539}:null;}})[_0xf605('0x24')](respondWithResult(_0xe268ac,null))[_0xf605('0x3f')](handleError(_0xe268ac,null));}; \ No newline at end of file +var _0x20d2=['findAll','rows','show','params','find','catch','body','getSubjects','FreshsalesField','getDescriptions','getFields','findOne','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x520916,_0x2c2b6d){var _0xc7f3c1=function(_0x2d033b){while(--_0x2d033b){_0x520916['push'](_0x520916['shift']());}};_0xc7f3c1(++_0x2c2b6d);}(_0x20d2,0x1bf));var _0x220d=function(_0x9d2b29,_0x3bb0b6){_0x9d2b29=_0x9d2b29-0x0;var _0x23625b=_0x20d2[_0x9d2b29];return _0x23625b;};'use strict';var emlformat=require(_0x220d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x220d('0x1'));var jsonpatch=require(_0x220d('0x2'));var rp=require(_0x220d('0x3'));var moment=require(_0x220d('0x4'));var BPromise=require(_0x220d('0x5'));var Mustache=require(_0x220d('0x6'));var util=require(_0x220d('0x7'));var path=require(_0x220d('0x8'));var sox=require(_0x220d('0x9'));var csv=require(_0x220d('0xa'));var ejs=require(_0x220d('0xb'));var fs=require('fs');var fs_extra=require(_0x220d('0xc'));var _=require(_0x220d('0xd'));var squel=require(_0x220d('0xe'));var crypto=require(_0x220d('0xf'));var jsforce=require(_0x220d('0x10'));var deskjs=require(_0x220d('0x11'));var toCsv=require(_0x220d('0xa'));var querystring=require(_0x220d('0x12'));var Papa=require(_0x220d('0x13'));var Redis=require(_0x220d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x220d('0x15'));var as=require(_0x220d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x220d('0x17'))('api');var utils=require(_0x220d('0x18'));var config=require(_0x220d('0x19'));var licenseUtil=require(_0x220d('0x1a'));var db=require(_0x220d('0x1b'))['db'];function respondWithStatusCode(_0x44cf6f,_0x24c031){_0x24c031=_0x24c031||0xcc;return function(_0xc20914){if(_0xc20914){return _0x44cf6f[_0x220d('0x1c')](_0x24c031);}return _0x44cf6f['status'](_0x24c031)['end']();};}function respondWithResult(_0x219a00,_0x5c22c5){_0x5c22c5=_0x5c22c5||0xc8;return function(_0x4afebb){if(_0x4afebb){return _0x219a00[_0x220d('0x1d')](_0x5c22c5)[_0x220d('0x1e')](_0x4afebb);}};}function respondWithFilteredResult(_0x2fced1,_0x132b85){return function(_0x45d704){if(_0x45d704){var _0x163868=typeof _0x132b85[_0x220d('0x1f')]===_0x220d('0x20')&&typeof _0x132b85[_0x220d('0x21')]===_0x220d('0x20');var _0x4bf224=_0x45d704['count'];var _0x5e3198=_0x163868?0x0:_0x132b85[_0x220d('0x1f')];var _0x14c5e9=_0x163868?_0x45d704[_0x220d('0x22')]:_0x132b85['offset']+_0x132b85[_0x220d('0x21')];var _0x4c2c7c;if(_0x14c5e9>=_0x4bf224){_0x14c5e9=_0x4bf224;_0x4c2c7c=0xc8;}else{_0x4c2c7c=0xce;}_0x2fced1['status'](_0x4c2c7c);return _0x2fced1[_0x220d('0x23')](_0x220d('0x24'),_0x5e3198+'-'+_0x14c5e9+'/'+_0x4bf224)[_0x220d('0x1e')](_0x45d704);}return null;};}function patchUpdates(_0x2a9a3a){return function(_0x28f089){try{jsonpatch[_0x220d('0x25')](_0x28f089,_0x2a9a3a,!![]);}catch(_0x869cf1){return BPromise[_0x220d('0x26')](_0x869cf1);}return _0x28f089[_0x220d('0x27')]();};}function saveUpdates(_0xbcde5e,_0x5318e0){return function(_0x29fb9b){if(_0x29fb9b){return _0x29fb9b[_0x220d('0x28')](_0xbcde5e)[_0x220d('0x29')](function(_0x10f59a){return _0x10f59a;});}return null;};}function removeEntity(_0x273ed0,_0x140e6d){return function(_0x1cdc69){if(_0x1cdc69){return _0x1cdc69[_0x220d('0x2a')]()[_0x220d('0x29')](function(){_0x273ed0[_0x220d('0x1d')](0xcc)[_0x220d('0x2b')]();});}};}function handleEntityNotFound(_0x1977eb,_0x2712b4){return function(_0x3b8157){if(!_0x3b8157){_0x1977eb['sendStatus'](0x194);}return _0x3b8157;};}function handleError(_0x34e2f4,_0x4d8c22){_0x4d8c22=_0x4d8c22||0x1f4;return function(_0x3bae7b){logger[_0x220d('0x2c')](_0x3bae7b[_0x220d('0x2d')]);if(_0x3bae7b['name']){delete _0x3bae7b['name'];}_0x34e2f4[_0x220d('0x1d')](_0x4d8c22)[_0x220d('0x2e')](_0x3bae7b);};}exports[_0x220d('0x2f')]=function(_0x2dbd97,_0x40f596){var _0x13ddff={},_0x2b8726={},_0x2abaa1={'count':0x0,'rows':[]};var _0x13e9a5=_[_0x220d('0x30')](db[_0x220d('0x31')][_0x220d('0x32')],function(_0x2a07e6){return{'name':_0x2a07e6[_0x220d('0x33')],'type':_0x2a07e6[_0x220d('0x34')][_0x220d('0x35')]};});_0x2b8726[_0x220d('0x36')]=_[_0x220d('0x30')](_0x13e9a5,_0x220d('0x37'));_0x2b8726[_0x220d('0x38')]=_[_0x220d('0x39')](_0x2dbd97[_0x220d('0x38')]);_0x2b8726['filters']=_[_0x220d('0x3a')](_0x2b8726[_0x220d('0x36')],_0x2b8726[_0x220d('0x38')]);_0x13ddff[_0x220d('0x3b')]=_[_0x220d('0x3a')](_0x2b8726[_0x220d('0x36')],qs[_0x220d('0x3c')](_0x2dbd97[_0x220d('0x38')][_0x220d('0x3c')]));_0x13ddff[_0x220d('0x3b')]=_0x13ddff[_0x220d('0x3b')][_0x220d('0x3d')]?_0x13ddff[_0x220d('0x3b')]:_0x2b8726['model'];if(!_0x2dbd97['query'][_0x220d('0x3e')](_0x220d('0x3f'))){_0x13ddff[_0x220d('0x21')]=qs[_0x220d('0x21')](_0x2dbd97[_0x220d('0x38')][_0x220d('0x21')]);_0x13ddff[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x2dbd97[_0x220d('0x38')][_0x220d('0x1f')]);}_0x13ddff[_0x220d('0x40')]=qs[_0x220d('0x41')](_0x2dbd97[_0x220d('0x38')]['sort']);_0x13ddff[_0x220d('0x42')]=qs[_0x220d('0x43')](_[_0x220d('0x44')](_0x2dbd97['query'],_0x2b8726[_0x220d('0x43')]),_0x13e9a5);if(_0x2dbd97[_0x220d('0x38')][_0x220d('0x45')]){_0x13ddff[_0x220d('0x42')]=_['merge'](_0x13ddff[_0x220d('0x42')],{'$or':_['map'](_0x13e9a5,function(_0x2778e8){if(_0x2778e8[_0x220d('0x34')]!==_0x220d('0x46')){var _0x4cdec8={};_0x4cdec8[_0x2778e8[_0x220d('0x37')]]={'$like':'%'+_0x2dbd97[_0x220d('0x38')][_0x220d('0x45')]+'%'};return _0x4cdec8;}})});}_0x13ddff=_[_0x220d('0x47')]({},_0x13ddff,_0x2dbd97[_0x220d('0x48')]);var _0x24ef1b={'where':_0x13ddff[_0x220d('0x42')]};return db[_0x220d('0x31')][_0x220d('0x22')](_0x24ef1b)[_0x220d('0x29')](function(_0x53466c){_0x2abaa1[_0x220d('0x22')]=_0x53466c;if(_0x2dbd97[_0x220d('0x38')][_0x220d('0x49')]){_0x13ddff[_0x220d('0x4a')]=[{'all':!![]}];}return db[_0x220d('0x31')][_0x220d('0x4b')](_0x13ddff);})['then'](function(_0x41a5b5){_0x2abaa1[_0x220d('0x4c')]=_0x41a5b5;return _0x2abaa1;})[_0x220d('0x29')](respondWithFilteredResult(_0x40f596,_0x13ddff))['catch'](handleError(_0x40f596,null));};exports[_0x220d('0x4d')]=function(_0x1749c8,_0x49b17b){var _0x4c2d56={'raw':![],'where':{'id':_0x1749c8[_0x220d('0x4e')]['id']}},_0x53fbd3={};_0x53fbd3[_0x220d('0x36')]=_[_0x220d('0x39')](db[_0x220d('0x31')][_0x220d('0x32')]);_0x53fbd3['query']=_[_0x220d('0x39')](_0x1749c8[_0x220d('0x38')]);_0x53fbd3['filters']=_[_0x220d('0x3a')](_0x53fbd3[_0x220d('0x36')],_0x53fbd3[_0x220d('0x38')]);_0x4c2d56['attributes']=_[_0x220d('0x3a')](_0x53fbd3[_0x220d('0x36')],qs[_0x220d('0x3c')](_0x1749c8[_0x220d('0x38')][_0x220d('0x3c')]));_0x4c2d56[_0x220d('0x3b')]=_0x4c2d56['attributes'][_0x220d('0x3d')]?_0x4c2d56[_0x220d('0x3b')]:_0x53fbd3[_0x220d('0x36')];if(_0x1749c8[_0x220d('0x38')][_0x220d('0x49')]){_0x4c2d56[_0x220d('0x4a')]=[{'all':!![]}];}_0x4c2d56=_[_0x220d('0x47')]({},_0x4c2d56,_0x1749c8[_0x220d('0x48')]);return db[_0x220d('0x31')][_0x220d('0x4f')](_0x4c2d56)[_0x220d('0x29')](handleEntityNotFound(_0x49b17b,null))[_0x220d('0x29')](respondWithResult(_0x49b17b,null))[_0x220d('0x50')](handleError(_0x49b17b,null));};exports['create']=function(_0x3526c4,_0x337159){return db[_0x220d('0x31')]['create'](_0x3526c4[_0x220d('0x51')],{})[_0x220d('0x29')](respondWithResult(_0x337159,0xc9))['catch'](handleError(_0x337159,null));};exports[_0x220d('0x28')]=function(_0x41337e,_0xd924c){if(_0x41337e[_0x220d('0x51')]['id']){delete _0x41337e[_0x220d('0x51')]['id'];}return db['FreshsalesConfiguration'][_0x220d('0x4f')]({'where':{'id':_0x41337e['params']['id']}})[_0x220d('0x29')](handleEntityNotFound(_0xd924c,null))[_0x220d('0x29')](saveUpdates(_0x41337e['body'],null))[_0x220d('0x29')](respondWithResult(_0xd924c,null))['catch'](handleError(_0xd924c,null));};exports[_0x220d('0x2a')]=function(_0x33df37,_0x427567){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x33df37[_0x220d('0x4e')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x427567,null))[_0x220d('0x29')](removeEntity(_0x427567,null))[_0x220d('0x50')](handleError(_0x427567,null));};exports[_0x220d('0x52')]=function(_0x17dbf3,_0xce4f2d,_0x5b6956){var _0x4695ff={};var _0x15c376={};var _0x5946bf;var _0x15b089;return db[_0x220d('0x31')]['findOne']({'where':{'id':_0x17dbf3[_0x220d('0x4e')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0xce4f2d,null))[_0x220d('0x29')](function(_0x477084){if(_0x477084){_0x5946bf=_0x477084;_0x15c376[_0x220d('0x36')]=_[_0x220d('0x39')](db[_0x220d('0x53')][_0x220d('0x32')]);_0x15c376[_0x220d('0x38')]=_['keys'](_0x17dbf3[_0x220d('0x38')]);_0x15c376['filters']=_[_0x220d('0x3a')](_0x15c376[_0x220d('0x36')],_0x15c376[_0x220d('0x38')]);_0x4695ff['attributes']=_[_0x220d('0x3a')](_0x15c376['model'],qs[_0x220d('0x3c')](_0x17dbf3[_0x220d('0x38')]['fields']));_0x4695ff[_0x220d('0x3b')]=_0x4695ff[_0x220d('0x3b')]['length']?_0x4695ff[_0x220d('0x3b')]:_0x15c376[_0x220d('0x36')];_0x4695ff[_0x220d('0x40')]=qs['sort'](_0x17dbf3[_0x220d('0x38')]['sort']);_0x4695ff[_0x220d('0x42')]=qs['filters'](_[_0x220d('0x44')](_0x17dbf3[_0x220d('0x38')],_0x15c376[_0x220d('0x43')]));if(_0x17dbf3[_0x220d('0x38')][_0x220d('0x45')]){_0x4695ff[_0x220d('0x42')]=_[_0x220d('0x47')](_0x4695ff[_0x220d('0x42')],{'$or':_[_0x220d('0x30')](_0x4695ff['attributes'],function(_0x1033cc){var _0xc7e832={};_0xc7e832[_0x1033cc]={'$like':'%'+_0x17dbf3['query'][_0x220d('0x45')]+'%'};return _0xc7e832;})});}_0x4695ff=_[_0x220d('0x47')]({},_0x4695ff,_0x17dbf3[_0x220d('0x48')]);return _0x5946bf[_0x220d('0x52')](_0x4695ff);}})['then'](function(_0x152bb9){if(_0x152bb9){_0x15b089=_0x152bb9[_0x220d('0x3d')];if(!_0x17dbf3[_0x220d('0x38')]['hasOwnProperty'](_0x220d('0x3f'))){_0x4695ff[_0x220d('0x21')]=qs[_0x220d('0x21')](_0x17dbf3[_0x220d('0x38')][_0x220d('0x21')]);_0x4695ff[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x17dbf3[_0x220d('0x38')][_0x220d('0x1f')]);}return _0x5946bf['getSubjects'](_0x4695ff);}})[_0x220d('0x29')](function(_0x3ed7c8){if(_0x3ed7c8){return _0x3ed7c8?{'count':_0x15b089,'rows':_0x3ed7c8}:null;}})[_0x220d('0x29')](respondWithResult(_0xce4f2d,null))[_0x220d('0x50')](handleError(_0xce4f2d,null));};exports['getDescriptions']=function(_0x2fe811,_0x1f722c,_0x27a5f6){var _0x1ea256={};var _0x2b665c={};var _0x4414cc;var _0x2c31e6;return db[_0x220d('0x31')]['findOne']({'where':{'id':_0x2fe811[_0x220d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f722c,null))['then'](function(_0x184eb4){if(_0x184eb4){_0x4414cc=_0x184eb4;_0x2b665c[_0x220d('0x36')]=_[_0x220d('0x39')](db['FreshsalesField'][_0x220d('0x32')]);_0x2b665c[_0x220d('0x38')]=_[_0x220d('0x39')](_0x2fe811[_0x220d('0x38')]);_0x2b665c[_0x220d('0x43')]=_[_0x220d('0x3a')](_0x2b665c[_0x220d('0x36')],_0x2b665c['query']);_0x1ea256[_0x220d('0x3b')]=_[_0x220d('0x3a')](_0x2b665c['model'],qs['fields'](_0x2fe811[_0x220d('0x38')][_0x220d('0x3c')]));_0x1ea256[_0x220d('0x3b')]=_0x1ea256[_0x220d('0x3b')][_0x220d('0x3d')]?_0x1ea256[_0x220d('0x3b')]:_0x2b665c[_0x220d('0x36')];_0x1ea256[_0x220d('0x40')]=qs['sort'](_0x2fe811[_0x220d('0x38')][_0x220d('0x41')]);_0x1ea256['where']=qs['filters'](_[_0x220d('0x44')](_0x2fe811[_0x220d('0x38')],_0x2b665c['filters']));if(_0x2fe811[_0x220d('0x38')][_0x220d('0x45')]){_0x1ea256[_0x220d('0x42')]=_[_0x220d('0x47')](_0x1ea256['where'],{'$or':_[_0x220d('0x30')](_0x1ea256[_0x220d('0x3b')],function(_0x4b3eb9){var _0x2337b9={};_0x2337b9[_0x4b3eb9]={'$like':'%'+_0x2fe811[_0x220d('0x38')]['filter']+'%'};return _0x2337b9;})});}_0x1ea256=_[_0x220d('0x47')]({},_0x1ea256,_0x2fe811[_0x220d('0x48')]);return _0x4414cc[_0x220d('0x54')](_0x1ea256);}})[_0x220d('0x29')](function(_0x2d3f65){if(_0x2d3f65){_0x2c31e6=_0x2d3f65[_0x220d('0x3d')];if(!_0x2fe811[_0x220d('0x38')]['hasOwnProperty'](_0x220d('0x3f'))){_0x1ea256[_0x220d('0x21')]=qs[_0x220d('0x21')](_0x2fe811['query'][_0x220d('0x21')]);_0x1ea256['offset']=qs[_0x220d('0x1f')](_0x2fe811[_0x220d('0x38')]['offset']);}return _0x4414cc[_0x220d('0x54')](_0x1ea256);}})[_0x220d('0x29')](function(_0xebbff1){if(_0xebbff1){return _0xebbff1?{'count':_0x2c31e6,'rows':_0xebbff1}:null;}})[_0x220d('0x29')](respondWithResult(_0x1f722c,null))[_0x220d('0x50')](handleError(_0x1f722c,null));};exports[_0x220d('0x55')]=function(_0x357207,_0x3773dd,_0x4190d1){var _0xf8b18={};var _0x1162d9={};var _0x35a334;var _0x5db57c;return db[_0x220d('0x31')][_0x220d('0x56')]({'where':{'id':_0x357207[_0x220d('0x4e')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x3773dd,null))['then'](function(_0xfea9e9){if(_0xfea9e9){_0x35a334=_0xfea9e9;_0x1162d9['model']=_['keys'](db[_0x220d('0x53')]['rawAttributes']);_0x1162d9['query']=_[_0x220d('0x39')](_0x357207[_0x220d('0x38')]);_0x1162d9[_0x220d('0x43')]=_[_0x220d('0x3a')](_0x1162d9[_0x220d('0x36')],_0x1162d9[_0x220d('0x38')]);_0xf8b18[_0x220d('0x3b')]=_[_0x220d('0x3a')](_0x1162d9['model'],qs[_0x220d('0x3c')](_0x357207[_0x220d('0x38')][_0x220d('0x3c')]));_0xf8b18['attributes']=_0xf8b18[_0x220d('0x3b')]['length']?_0xf8b18['attributes']:_0x1162d9['model'];_0xf8b18[_0x220d('0x40')]=qs[_0x220d('0x41')](_0x357207[_0x220d('0x38')][_0x220d('0x41')]);_0xf8b18['where']=qs[_0x220d('0x43')](_['pick'](_0x357207[_0x220d('0x38')],_0x1162d9['filters']));if(_0x357207[_0x220d('0x38')]['filter']){_0xf8b18[_0x220d('0x42')]=_[_0x220d('0x47')](_0xf8b18[_0x220d('0x42')],{'$or':_[_0x220d('0x30')](_0xf8b18[_0x220d('0x3b')],function(_0x9c79cb){var _0x5bb72e={};_0x5bb72e[_0x9c79cb]={'$like':'%'+_0x357207['query'][_0x220d('0x45')]+'%'};return _0x5bb72e;})});}_0xf8b18=_['merge']({},_0xf8b18,_0x357207[_0x220d('0x48')]);return _0x35a334[_0x220d('0x55')](_0xf8b18);}})[_0x220d('0x29')](function(_0x105327){if(_0x105327){_0x5db57c=_0x105327[_0x220d('0x3d')];if(!_0x357207[_0x220d('0x38')][_0x220d('0x3e')]('nolimit')){_0xf8b18[_0x220d('0x21')]=qs[_0x220d('0x21')](_0x357207[_0x220d('0x38')][_0x220d('0x21')]);_0xf8b18[_0x220d('0x1f')]=qs['offset'](_0x357207[_0x220d('0x38')][_0x220d('0x1f')]);}return _0x35a334[_0x220d('0x55')](_0xf8b18);}})['then'](function(_0x22a59a){if(_0x22a59a){return _0x22a59a?{'count':_0x5db57c,'rows':_0x22a59a}:null;}})['then'](respondWithResult(_0x3773dd,null))[_0x220d('0x50')](handleError(_0x3773dd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f775b02..d91cc42 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 _0xc9ee=['../../config/logger','api','moment','bluebird','path','rimraf','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x3ab14c,_0x4093a1){var _0x423753=function(_0x278031){while(--_0x278031){_0x3ab14c['push'](_0x3ab14c['shift']());}};_0x423753(++_0x4093a1);}(_0xc9ee,0x17c));var _0xec9e=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xc9ee[_0x1757f2];return _0x5e7212;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xec9e('0x0'))(_0xec9e('0x1'));var moment=require(_0xec9e('0x2'));var BPromise=require(_0xec9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec9e('0x4'));var rimraf=require(_0xec9e('0x5'));var config=require('../../config/environment');var attributes=require(_0xec9e('0x6'));module['exports']=function(_0x503521,_0x42e17b){return _0x503521[_0xec9e('0x7')](_0xec9e('0x8'),attributes,{'tableName':_0xec9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe396=['./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','util','bluebird','path','../../config/environment'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xe396,0x1c3));var _0x6e39=function(_0x181585,_0x150524){_0x181585=_0x181585-0x0;var _0x5a611=_0xe396[_0x181585];return _0x5a611;};'use strict';var _=require(_0x6e39('0x0'));var util=require(_0x6e39('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6e39('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e39('0x3'));var rimraf=require('rimraf');var config=require(_0x6e39('0x4'));var attributes=require(_0x6e39('0x5'));module[_0x6e39('0x6')]=function(_0x419af9,_0x1bedcf){return _0x419af9['define'](_0x6e39('0x7'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index ccfcc72..8dd262b 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 _0x32ad=['jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0x32ad,0xff));var _0xd32a=function(_0x2411b1,_0x2cc24f){_0x2411b1=_0x2411b1-0x0;var _0x27ab58=_0x32ad[_0x2411b1];return _0x27ab58;};'use strict';var _=require(_0xd32a('0x0'));var util=require('util');var moment=require(_0xd32a('0x1'));var BPromise=require(_0xd32a('0x2'));var rs=require(_0xd32a('0x3'));var fs=require('fs');var Redis=require(_0xd32a('0x4'));var db=require(_0xd32a('0x5'))['db'];var utils=require(_0xd32a('0x6'));var logger=require('../../config/logger')(_0xd32a('0x7'));var config=require(_0xd32a('0x8'));var jayson=require(_0xd32a('0x9'));var client=jayson[_0xd32a('0xa')][_0xd32a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb1ce,_0x4607ef,_0x59f107){return new BPromise(function(_0x593884,_0x5473af){return client[_0xd32a('0xc')](_0x2cb1ce,_0x59f107)[_0xd32a('0xd')](function(_0x36c92e){logger['info'](_0xd32a('0xe'),_0x4607ef,'request\x20sent');logger[_0xd32a('0xf')](_0xd32a('0x10'),_0x4607ef,_0xd32a('0x11'),JSON[_0xd32a('0x12')](_0x36c92e));if(_0x36c92e[_0xd32a('0x13')]){if(_0x36c92e[_0xd32a('0x13')]['code']===0x1f4){logger[_0xd32a('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4607ef,_0x36c92e[_0xd32a('0x13')][_0xd32a('0x14')]);return _0x5473af(_0x36c92e[_0xd32a('0x13')][_0xd32a('0x14')]);}logger[_0xd32a('0x13')](_0xd32a('0xe'),_0x4607ef,_0x36c92e[_0xd32a('0x13')][_0xd32a('0x14')]);return _0x593884(_0x36c92e[_0xd32a('0x13')][_0xd32a('0x14')]);}else{logger[_0xd32a('0x15')](_0xd32a('0xe'),_0x4607ef,_0xd32a('0x11'));_0x593884(_0x36c92e[_0xd32a('0x16')][_0xd32a('0x14')]);}})[_0xd32a('0x17')](function(_0x18fef5){logger[_0xd32a('0x13')](_0xd32a('0xe'),_0x4607ef,_0x18fef5);_0x5473af(_0x18fef5);});});} \ No newline at end of file +var _0x6d23=['jayson/promise','client','http','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8aba1a,_0x106e8a){var _0x4dca9a=function(_0x3c57da){while(--_0x3c57da){_0x8aba1a['push'](_0x8aba1a['shift']());}};_0x4dca9a(++_0x106e8a);}(_0x6d23,0x1f2));var _0x36d2=function(_0x345880,_0x2ceb72){_0x345880=_0x345880-0x0;var _0x105c25=_0x6d23[_0x345880];return _0x105c25;};'use strict';var _=require('lodash');var util=require(_0x36d2('0x0'));var moment=require(_0x36d2('0x1'));var BPromise=require('bluebird');var rs=require(_0x36d2('0x2'));var fs=require('fs');var Redis=require(_0x36d2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36d2('0x4'));var logger=require(_0x36d2('0x5'))(_0x36d2('0x6'));var config=require(_0x36d2('0x7'));var jayson=require(_0x36d2('0x8'));var client=jayson[_0x36d2('0x9')][_0x36d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x554e8f,_0x571069,_0x5a9d63){return new BPromise(function(_0x49dc27,_0x5b5e3b){return client['request'](_0x554e8f,_0x5a9d63)[_0x36d2('0xb')](function(_0x24bf4d){logger['info'](_0x36d2('0xc'),_0x571069,_0x36d2('0xd'));logger[_0x36d2('0xe')](_0x36d2('0xf'),_0x571069,_0x36d2('0xd'),JSON[_0x36d2('0x10')](_0x24bf4d));if(_0x24bf4d[_0x36d2('0x11')]){if(_0x24bf4d[_0x36d2('0x11')][_0x36d2('0x12')]===0x1f4){logger[_0x36d2('0x11')](_0x36d2('0xc'),_0x571069,_0x24bf4d[_0x36d2('0x11')][_0x36d2('0x13')]);return _0x5b5e3b(_0x24bf4d[_0x36d2('0x11')][_0x36d2('0x13')]);}logger[_0x36d2('0x11')](_0x36d2('0xc'),_0x571069,_0x24bf4d[_0x36d2('0x11')][_0x36d2('0x13')]);return _0x49dc27(_0x24bf4d[_0x36d2('0x11')][_0x36d2('0x13')]);}else{logger[_0x36d2('0x14')](_0x36d2('0xc'),_0x571069,_0x36d2('0xd'));_0x49dc27(_0x24bf4d[_0x36d2('0x15')]['message']);}})[_0x36d2('0x16')](function(_0x1ce821){logger[_0x36d2('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x571069,_0x1ce821);_0x5b5e3b(_0x1ce821);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8fc144f..b19a2c5 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 _0x8e94=['../../components/auth/service','get','isAuthenticated','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1d0ca3,_0x571d08){var _0x16dcb2=function(_0x320d1f){while(--_0x320d1f){_0x1d0ca3['push'](_0x1d0ca3['shift']());}};_0x16dcb2(++_0x571d08);}(_0x8e94,0xf8));var _0x48e9=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0x8e94[_0x5b13c3];return _0x3d6780;};'use strict';var multer=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var path=require('path');var timeout=require(_0x48e9('0x2'));var express=require('express');var router=express[_0x48e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x48e9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x48e9('0x5')]('/',auth[_0x48e9('0x6')](),controller['index']);router[_0x48e9('0x5')]('/:id',auth[_0x48e9('0x6')](),controller['show']);router[_0x48e9('0x7')]('/',auth[_0x48e9('0x6')](),controller[_0x48e9('0x8')]);router[_0x48e9('0x9')]('/:id',auth[_0x48e9('0x6')](),controller[_0x48e9('0xa')]);router['delete'](_0x48e9('0xb'),auth['isAuthenticated'](),controller[_0x48e9('0xc')]);module[_0x48e9('0xd')]=router; \ No newline at end of file +var _0xfc1e=['show','post','create','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0xfc1e[_0x13594e];return _0x1a4f42;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xefc1('0x0'));var express=require(_0xefc1('0x1'));var router=express[_0xefc1('0x2')]();var fs_extra=require(_0xefc1('0x3'));var auth=require(_0xefc1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xefc1('0x5'));var controller=require(_0xefc1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xefc1('0x7')]);router[_0xefc1('0x8')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller[_0xefc1('0xb')]);router[_0xefc1('0xc')]('/',auth[_0xefc1('0xa')](),controller[_0xefc1('0xd')]);router[_0xefc1('0xe')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller['update']);router[_0xefc1('0xf')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller[_0xefc1('0x10')]);module[_0xefc1('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 76bc274..80184b5 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 _0x9025=['BOOLEAN','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9025,0x81));var _0x5902=function(_0x294fb5,_0x5cf6c0){_0x294fb5=_0x294fb5-0x0;var _0x487dc4=_0x9025[_0x294fb5];return _0x487dc4;};'use strict';var Sequelize=require('sequelize');module[_0x5902('0x0')]={'type':{'type':Sequelize[_0x5902('0x1')](_0x5902('0x2'),_0x5902('0x3'),_0x5902('0x4'),'keyValue',_0x5902('0x5')),'defaultValue':_0x5902('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5902('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5902('0x2'),_0x5902('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5902('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5902('0x6')]},'customField':{'type':Sequelize[_0x5902('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a91=['BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x130c74,_0x41fe6a){var _0x599093=function(_0x1becc7){while(--_0x1becc7){_0x130c74['push'](_0x130c74['shift']());}};_0x599093(++_0x41fe6a);}(_0x2a91,0xe2));var _0x12a9=function(_0x16a350,_0x1582f0){_0x16a350=_0x16a350-0x0;var _0x2d1ca4=_0x2a91[_0x16a350];return _0x2d1ca4;};'use strict';var Sequelize=require('sequelize');module[_0x12a9('0x0')]={'type':{'type':Sequelize[_0x12a9('0x1')]('string',_0x12a9('0x2'),_0x12a9('0x3'),_0x12a9('0x4'),_0x12a9('0x5')),'defaultValue':_0x12a9('0x6')},'content':{'type':Sequelize[_0x12a9('0x7')]},'key':{'type':Sequelize[_0x12a9('0x7')]},'keyType':{'type':Sequelize[_0x12a9('0x1')]('string',_0x12a9('0x2'),_0x12a9('0x3'))},'keyContent':{'type':Sequelize[_0x12a9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x12a9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x12a9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index e9e6947..c347e15 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 _0x2c74=['keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','type','key','model','query'];(function(_0x172be5,_0x51cae2){var _0x3662b1=function(_0x29db51){while(--_0x29db51){_0x172be5['push'](_0x172be5['shift']());}};_0x3662b1(++_0x51cae2);}(_0x2c74,0xb3));var _0x42c7=function(_0x1da436,_0x2fab9d){_0x1da436=_0x1da436-0x0;var _0xe4468d=_0x2c74[_0x1da436];return _0xe4468d;};'use strict';var emlformat=require(_0x42c7('0x0'));var rimraf=require(_0x42c7('0x1'));var zipdir=require(_0x42c7('0x2'));var jsonpatch=require(_0x42c7('0x3'));var rp=require(_0x42c7('0x4'));var moment=require(_0x42c7('0x5'));var BPromise=require(_0x42c7('0x6'));var Mustache=require(_0x42c7('0x7'));var util=require('util');var path=require(_0x42c7('0x8'));var sox=require(_0x42c7('0x9'));var csv=require(_0x42c7('0xa'));var ejs=require(_0x42c7('0xb'));var fs=require('fs');var fs_extra=require(_0x42c7('0xc'));var _=require('lodash');var squel=require(_0x42c7('0xd'));var crypto=require(_0x42c7('0xe'));var jsforce=require(_0x42c7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x42c7('0xa'));var querystring=require(_0x42c7('0x10'));var Papa=require(_0x42c7('0x11'));var Redis=require(_0x42c7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x42c7('0x13'));var as=require(_0x42c7('0x14'));var hardwareService=require(_0x42c7('0x15'));var logger=require(_0x42c7('0x16'))(_0x42c7('0x17'));var utils=require(_0x42c7('0x18'));var config=require(_0x42c7('0x19'));var licenseUtil=require(_0x42c7('0x1a'));var db=require(_0x42c7('0x1b'))['db'];function respondWithStatusCode(_0x17dffa,_0x1ac926){_0x1ac926=_0x1ac926||0xcc;return function(_0x15509d){if(_0x15509d){return _0x17dffa[_0x42c7('0x1c')](_0x1ac926);}return _0x17dffa[_0x42c7('0x1d')](_0x1ac926)[_0x42c7('0x1e')]();};}function respondWithResult(_0x42334a,_0x11df0c){_0x11df0c=_0x11df0c||0xc8;return function(_0x18479c){if(_0x18479c){return _0x42334a[_0x42c7('0x1d')](_0x11df0c)['json'](_0x18479c);}};}function respondWithFilteredResult(_0x465071,_0x2fa23a){return function(_0x19500e){if(_0x19500e){var _0xe9185a=typeof _0x2fa23a[_0x42c7('0x1f')]===_0x42c7('0x20')&&typeof _0x2fa23a[_0x42c7('0x21')]===_0x42c7('0x20');var _0x4df560=_0x19500e[_0x42c7('0x22')];var _0x48ecc1=_0xe9185a?0x0:_0x2fa23a[_0x42c7('0x1f')];var _0x2848e4=_0xe9185a?_0x19500e[_0x42c7('0x22')]:_0x2fa23a[_0x42c7('0x1f')]+_0x2fa23a['limit'];var _0x50ee51;if(_0x2848e4>=_0x4df560){_0x2848e4=_0x4df560;_0x50ee51=0xc8;}else{_0x50ee51=0xce;}_0x465071['status'](_0x50ee51);return _0x465071[_0x42c7('0x23')](_0x42c7('0x24'),_0x48ecc1+'-'+_0x2848e4+'/'+_0x4df560)['json'](_0x19500e);}return null;};}function patchUpdates(_0x24657e){return function(_0x31184a){try{jsonpatch['apply'](_0x31184a,_0x24657e,!![]);}catch(_0x59a9bd){return BPromise['reject'](_0x59a9bd);}return _0x31184a[_0x42c7('0x25')]();};}function saveUpdates(_0x2c9cd1,_0x27daef){return function(_0x293c22){if(_0x293c22){return _0x293c22[_0x42c7('0x26')](_0x2c9cd1)[_0x42c7('0x27')](function(_0xb705cc){return _0xb705cc;});}return null;};}function removeEntity(_0x257e17,_0x1ce80e){return function(_0x51073c){if(_0x51073c){return _0x51073c[_0x42c7('0x28')]()[_0x42c7('0x27')](function(){_0x257e17[_0x42c7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae485,_0x1b2b5f){return function(_0x217c61){if(!_0x217c61){_0x5ae485[_0x42c7('0x1c')](0x194);}return _0x217c61;};}function handleError(_0x598ce2,_0x5506c5){_0x5506c5=_0x5506c5||0x1f4;return function(_0x19a200){logger[_0x42c7('0x29')](_0x19a200['stack']);if(_0x19a200[_0x42c7('0x2a')]){delete _0x19a200[_0x42c7('0x2a')];}_0x598ce2[_0x42c7('0x1d')](_0x5506c5)[_0x42c7('0x2b')](_0x19a200);};}exports[_0x42c7('0x2c')]=function(_0x3c67af,_0x20ef9d){var _0x39eb1c={},_0x11a93b={},_0x1ff146={'count':0x0,'rows':[]};var _0x587616=_[_0x42c7('0x2d')](db[_0x42c7('0x2e')][_0x42c7('0x2f')],function(_0x5267bf){return{'name':_0x5267bf['fieldName'],'type':_0x5267bf[_0x42c7('0x30')][_0x42c7('0x31')]};});_0x11a93b[_0x42c7('0x32')]=_[_0x42c7('0x2d')](_0x587616,_0x42c7('0x2a'));_0x11a93b[_0x42c7('0x33')]=_[_0x42c7('0x34')](_0x3c67af[_0x42c7('0x33')]);_0x11a93b[_0x42c7('0x35')]=_[_0x42c7('0x36')](_0x11a93b[_0x42c7('0x32')],_0x11a93b[_0x42c7('0x33')]);_0x39eb1c['attributes']=_['intersection'](_0x11a93b[_0x42c7('0x32')],qs[_0x42c7('0x37')](_0x3c67af[_0x42c7('0x33')][_0x42c7('0x37')]));_0x39eb1c[_0x42c7('0x38')]=_0x39eb1c['attributes']['length']?_0x39eb1c[_0x42c7('0x38')]:_0x11a93b['model'];if(!_0x3c67af[_0x42c7('0x33')][_0x42c7('0x39')](_0x42c7('0x3a'))){_0x39eb1c['limit']=qs[_0x42c7('0x21')](_0x3c67af[_0x42c7('0x33')][_0x42c7('0x21')]);_0x39eb1c[_0x42c7('0x1f')]=qs[_0x42c7('0x1f')](_0x3c67af['query'][_0x42c7('0x1f')]);}_0x39eb1c[_0x42c7('0x3b')]=qs[_0x42c7('0x3c')](_0x3c67af['query'][_0x42c7('0x3c')]);_0x39eb1c[_0x42c7('0x3d')]=qs['filters'](_[_0x42c7('0x3e')](_0x3c67af[_0x42c7('0x33')],_0x11a93b[_0x42c7('0x35')]),_0x587616);if(_0x3c67af[_0x42c7('0x33')]['filter']){_0x39eb1c[_0x42c7('0x3d')]=_[_0x42c7('0x3f')](_0x39eb1c['where'],{'$or':_[_0x42c7('0x2d')](_0x587616,function(_0x198c72){if(_0x198c72[_0x42c7('0x30')]!==_0x42c7('0x40')){var _0x5865e8={};_0x5865e8[_0x198c72['name']]={'$like':'%'+_0x3c67af[_0x42c7('0x33')][_0x42c7('0x41')]+'%'};return _0x5865e8;}})});}_0x39eb1c=_[_0x42c7('0x3f')]({},_0x39eb1c,_0x3c67af['options']);var _0x385e86={'where':_0x39eb1c[_0x42c7('0x3d')]};return db[_0x42c7('0x2e')][_0x42c7('0x22')](_0x385e86)[_0x42c7('0x27')](function(_0x5b4956){_0x1ff146['count']=_0x5b4956;if(_0x3c67af[_0x42c7('0x33')][_0x42c7('0x42')]){_0x39eb1c[_0x42c7('0x43')]=[{'all':!![]}];}return db[_0x42c7('0x2e')][_0x42c7('0x44')](_0x39eb1c);})[_0x42c7('0x27')](function(_0x33e036){_0x1ff146[_0x42c7('0x45')]=_0x33e036;return _0x1ff146;})[_0x42c7('0x27')](respondWithFilteredResult(_0x20ef9d,_0x39eb1c))['catch'](handleError(_0x20ef9d,null));};exports[_0x42c7('0x46')]=function(_0x4e2781,_0x2ac57){var _0x4d307a={'raw':!![],'where':{'id':_0x4e2781[_0x42c7('0x47')]['id']}},_0x1b062e={};_0x1b062e[_0x42c7('0x32')]=_['keys'](db[_0x42c7('0x2e')][_0x42c7('0x2f')]);_0x1b062e['query']=_[_0x42c7('0x34')](_0x4e2781[_0x42c7('0x33')]);_0x1b062e['filters']=_['intersection'](_0x1b062e[_0x42c7('0x32')],_0x1b062e[_0x42c7('0x33')]);_0x4d307a[_0x42c7('0x38')]=_[_0x42c7('0x36')](_0x1b062e[_0x42c7('0x32')],qs['fields'](_0x4e2781[_0x42c7('0x33')][_0x42c7('0x37')]));_0x4d307a[_0x42c7('0x38')]=_0x4d307a[_0x42c7('0x38')][_0x42c7('0x48')]?_0x4d307a[_0x42c7('0x38')]:_0x1b062e['model'];if(_0x4e2781[_0x42c7('0x33')]['includeAll']){_0x4d307a['include']=[{'all':!![]}];}_0x4d307a=_[_0x42c7('0x3f')]({},_0x4d307a,_0x4e2781['options']);return db['FreshsalesField'][_0x42c7('0x49')](_0x4d307a)[_0x42c7('0x27')](handleEntityNotFound(_0x2ac57,null))['then'](respondWithResult(_0x2ac57,null))[_0x42c7('0x4a')](handleError(_0x2ac57,null));};exports[_0x42c7('0x4b')]=function(_0x1f641a,_0x32c4a1){return db['FreshsalesField']['create'](_0x1f641a[_0x42c7('0x4c')],{})[_0x42c7('0x27')](respondWithResult(_0x32c4a1,0xc9))[_0x42c7('0x4a')](handleError(_0x32c4a1,null));};exports[_0x42c7('0x26')]=function(_0x1b8d3c,_0x9aa044){if(_0x1b8d3c[_0x42c7('0x4c')]['id']){delete _0x1b8d3c['body']['id'];}return db[_0x42c7('0x2e')][_0x42c7('0x49')]({'where':{'id':_0x1b8d3c[_0x42c7('0x47')]['id']}})[_0x42c7('0x27')](handleEntityNotFound(_0x9aa044,null))[_0x42c7('0x27')](saveUpdates(_0x1b8d3c[_0x42c7('0x4c')],null))['then'](respondWithResult(_0x9aa044,null))[_0x42c7('0x4a')](handleError(_0x9aa044,null));};exports[_0x42c7('0x28')]=function(_0x5db92d,_0x165202){return db[_0x42c7('0x2e')][_0x42c7('0x49')]({'where':{'id':_0x5db92d['params']['id']}})[_0x42c7('0x27')](handleEntityNotFound(_0x165202,null))['then'](removeEntity(_0x165202,null))[_0x42c7('0x4a')](handleError(_0x165202,null));}; \ No newline at end of file +var _0xc80d=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','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','json','undefined','limit','count','offset','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','catch','show','includeAll','find','create','body','params','eml-format','rimraf'];(function(_0x4bd3f7,_0x3340c9){var _0x24834c=function(_0x54446c){while(--_0x54446c){_0x4bd3f7['push'](_0x4bd3f7['shift']());}};_0x24834c(++_0x3340c9);}(_0xc80d,0x161));var _0xdc80=function(_0x17f935,_0x2813f6){_0x17f935=_0x17f935-0x0;var _0x1d6fcc=_0xc80d[_0x17f935];return _0x1d6fcc;};'use strict';var emlformat=require(_0xdc80('0x0'));var rimraf=require(_0xdc80('0x1'));var zipdir=require(_0xdc80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc80('0x3'));var moment=require(_0xdc80('0x4'));var BPromise=require(_0xdc80('0x5'));var Mustache=require(_0xdc80('0x6'));var util=require(_0xdc80('0x7'));var path=require(_0xdc80('0x8'));var sox=require(_0xdc80('0x9'));var csv=require(_0xdc80('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc80('0xb'));var _=require(_0xdc80('0xc'));var squel=require('squel');var crypto=require(_0xdc80('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc80('0xa'));var querystring=require(_0xdc80('0xe'));var Papa=require(_0xdc80('0xf'));var Redis=require('ioredis');var authService=require(_0xdc80('0x10'));var qs=require(_0xdc80('0x11'));var as=require(_0xdc80('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc80('0x13'))(_0xdc80('0x14'));var utils=require(_0xdc80('0x15'));var config=require(_0xdc80('0x16'));var licenseUtil=require(_0xdc80('0x17'));var db=require(_0xdc80('0x18'))['db'];function respondWithStatusCode(_0x219472,_0x5f5cb4){_0x5f5cb4=_0x5f5cb4||0xcc;return function(_0x36bcff){if(_0x36bcff){return _0x219472[_0xdc80('0x19')](_0x5f5cb4);}return _0x219472[_0xdc80('0x1a')](_0x5f5cb4)[_0xdc80('0x1b')]();};}function respondWithResult(_0x5d6567,_0x3f3a15){_0x3f3a15=_0x3f3a15||0xc8;return function(_0x501784){if(_0x501784){return _0x5d6567[_0xdc80('0x1a')](_0x3f3a15)[_0xdc80('0x1c')](_0x501784);}};}function respondWithFilteredResult(_0xce5887,_0xbf5b74){return function(_0x1d3361){if(_0x1d3361){var _0xc023f5=typeof _0xbf5b74['offset']===_0xdc80('0x1d')&&typeof _0xbf5b74[_0xdc80('0x1e')]==='undefined';var _0x139b9c=_0x1d3361[_0xdc80('0x1f')];var _0x52e0b5=_0xc023f5?0x0:_0xbf5b74[_0xdc80('0x20')];var _0x426e8f=_0xc023f5?_0x1d3361['count']:_0xbf5b74[_0xdc80('0x20')]+_0xbf5b74[_0xdc80('0x1e')];var _0x51645f;if(_0x426e8f>=_0x139b9c){_0x426e8f=_0x139b9c;_0x51645f=0xc8;}else{_0x51645f=0xce;}_0xce5887[_0xdc80('0x1a')](_0x51645f);return _0xce5887['set']('Content-Range',_0x52e0b5+'-'+_0x426e8f+'/'+_0x139b9c)[_0xdc80('0x1c')](_0x1d3361);}return null;};}function patchUpdates(_0x36cad2){return function(_0x1be354){try{jsonpatch['apply'](_0x1be354,_0x36cad2,!![]);}catch(_0x2fd79d){return BPromise[_0xdc80('0x21')](_0x2fd79d);}return _0x1be354[_0xdc80('0x22')]();};}function saveUpdates(_0x4fb299,_0x2cebe7){return function(_0xd3b130){if(_0xd3b130){return _0xd3b130[_0xdc80('0x23')](_0x4fb299)['then'](function(_0x9e7571){return _0x9e7571;});}return null;};}function removeEntity(_0x47be06,_0x78afba){return function(_0x455563){if(_0x455563){return _0x455563[_0xdc80('0x24')]()[_0xdc80('0x25')](function(){_0x47be06[_0xdc80('0x1a')](0xcc)[_0xdc80('0x1b')]();});}};}function handleEntityNotFound(_0x5338d0,_0x517dbd){return function(_0x58730d){if(!_0x58730d){_0x5338d0[_0xdc80('0x19')](0x194);}return _0x58730d;};}function handleError(_0x42e64c,_0x547aad){_0x547aad=_0x547aad||0x1f4;return function(_0x5ccff8){logger[_0xdc80('0x26')](_0x5ccff8[_0xdc80('0x27')]);if(_0x5ccff8['name']){delete _0x5ccff8[_0xdc80('0x28')];}_0x42e64c['status'](_0x547aad)[_0xdc80('0x29')](_0x5ccff8);};}exports[_0xdc80('0x2a')]=function(_0x2983a3,_0xf461ac){var _0x2ca87c={},_0x4bee9d={},_0x1253d6={'count':0x0,'rows':[]};var _0x292ae0=_[_0xdc80('0x2b')](db[_0xdc80('0x2c')]['rawAttributes'],function(_0x5b2a8b){return{'name':_0x5b2a8b['fieldName'],'type':_0x5b2a8b['type'][_0xdc80('0x2d')]};});_0x4bee9d[_0xdc80('0x2e')]=_['map'](_0x292ae0,_0xdc80('0x28'));_0x4bee9d[_0xdc80('0x2f')]=_['keys'](_0x2983a3[_0xdc80('0x2f')]);_0x4bee9d[_0xdc80('0x30')]=_[_0xdc80('0x31')](_0x4bee9d[_0xdc80('0x2e')],_0x4bee9d[_0xdc80('0x2f')]);_0x2ca87c['attributes']=_['intersection'](_0x4bee9d[_0xdc80('0x2e')],qs[_0xdc80('0x32')](_0x2983a3[_0xdc80('0x2f')]['fields']));_0x2ca87c[_0xdc80('0x33')]=_0x2ca87c[_0xdc80('0x33')][_0xdc80('0x34')]?_0x2ca87c[_0xdc80('0x33')]:_0x4bee9d[_0xdc80('0x2e')];if(!_0x2983a3['query']['hasOwnProperty'](_0xdc80('0x35'))){_0x2ca87c[_0xdc80('0x1e')]=qs[_0xdc80('0x1e')](_0x2983a3[_0xdc80('0x2f')][_0xdc80('0x1e')]);_0x2ca87c[_0xdc80('0x20')]=qs['offset'](_0x2983a3[_0xdc80('0x2f')][_0xdc80('0x20')]);}_0x2ca87c[_0xdc80('0x36')]=qs[_0xdc80('0x37')](_0x2983a3['query']['sort']);_0x2ca87c[_0xdc80('0x38')]=qs[_0xdc80('0x30')](_[_0xdc80('0x39')](_0x2983a3[_0xdc80('0x2f')],_0x4bee9d[_0xdc80('0x30')]),_0x292ae0);if(_0x2983a3[_0xdc80('0x2f')][_0xdc80('0x3a')]){_0x2ca87c[_0xdc80('0x38')]=_[_0xdc80('0x3b')](_0x2ca87c[_0xdc80('0x38')],{'$or':_[_0xdc80('0x2b')](_0x292ae0,function(_0x48ed20){if(_0x48ed20[_0xdc80('0x3c')]!==_0xdc80('0x3d')){var _0x2a3d9d={};_0x2a3d9d[_0x48ed20[_0xdc80('0x28')]]={'$like':'%'+_0x2983a3[_0xdc80('0x2f')][_0xdc80('0x3a')]+'%'};return _0x2a3d9d;}})});}_0x2ca87c=_[_0xdc80('0x3b')]({},_0x2ca87c,_0x2983a3[_0xdc80('0x3e')]);var _0x3dbf25={'where':_0x2ca87c[_0xdc80('0x38')]};return db[_0xdc80('0x2c')][_0xdc80('0x1f')](_0x3dbf25)[_0xdc80('0x25')](function(_0x14b450){_0x1253d6['count']=_0x14b450;if(_0x2983a3[_0xdc80('0x2f')]['includeAll']){_0x2ca87c[_0xdc80('0x3f')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x2ca87c);})['then'](function(_0x43a67a){_0x1253d6['rows']=_0x43a67a;return _0x1253d6;})[_0xdc80('0x25')](respondWithFilteredResult(_0xf461ac,_0x2ca87c))[_0xdc80('0x40')](handleError(_0xf461ac,null));};exports[_0xdc80('0x41')]=function(_0x29f0bd,_0x4c7229){var _0x396073={'raw':!![],'where':{'id':_0x29f0bd['params']['id']}},_0x3df556={};_0x3df556[_0xdc80('0x2e')]=_['keys'](db[_0xdc80('0x2c')]['rawAttributes']);_0x3df556[_0xdc80('0x2f')]=_['keys'](_0x29f0bd[_0xdc80('0x2f')]);_0x3df556['filters']=_[_0xdc80('0x31')](_0x3df556[_0xdc80('0x2e')],_0x3df556[_0xdc80('0x2f')]);_0x396073['attributes']=_[_0xdc80('0x31')](_0x3df556[_0xdc80('0x2e')],qs[_0xdc80('0x32')](_0x29f0bd[_0xdc80('0x2f')]['fields']));_0x396073['attributes']=_0x396073[_0xdc80('0x33')]['length']?_0x396073['attributes']:_0x3df556[_0xdc80('0x2e')];if(_0x29f0bd[_0xdc80('0x2f')][_0xdc80('0x42')]){_0x396073['include']=[{'all':!![]}];}_0x396073=_['merge']({},_0x396073,_0x29f0bd[_0xdc80('0x3e')]);return db[_0xdc80('0x2c')][_0xdc80('0x43')](_0x396073)[_0xdc80('0x25')](handleEntityNotFound(_0x4c7229,null))[_0xdc80('0x25')](respondWithResult(_0x4c7229,null))['catch'](handleError(_0x4c7229,null));};exports[_0xdc80('0x44')]=function(_0x41c19b,_0x380e66){return db[_0xdc80('0x2c')][_0xdc80('0x44')](_0x41c19b['body'],{})[_0xdc80('0x25')](respondWithResult(_0x380e66,0xc9))[_0xdc80('0x40')](handleError(_0x380e66,null));};exports[_0xdc80('0x23')]=function(_0xe7e321,_0x4271c8){if(_0xe7e321[_0xdc80('0x45')]['id']){delete _0xe7e321[_0xdc80('0x45')]['id'];}return db[_0xdc80('0x2c')][_0xdc80('0x43')]({'where':{'id':_0xe7e321[_0xdc80('0x46')]['id']}})[_0xdc80('0x25')](handleEntityNotFound(_0x4271c8,null))[_0xdc80('0x25')](saveUpdates(_0xe7e321[_0xdc80('0x45')],null))[_0xdc80('0x25')](respondWithResult(_0x4271c8,null))[_0xdc80('0x40')](handleError(_0x4271c8,null));};exports['destroy']=function(_0x37e8ac,_0x1acd5e){return db[_0xdc80('0x2c')][_0xdc80('0x43')]({'where':{'id':_0x37e8ac[_0xdc80('0x46')]['id']}})[_0xdc80('0x25')](handleEntityNotFound(_0x1acd5e,null))[_0xdc80('0x25')](removeEntity(_0x1acd5e,null))[_0xdc80('0x40')](handleError(_0x1acd5e,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 70e2b18..f0e300c 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 _0xb5fa=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x47c0b6,_0x18ba1c){var _0x3c98c6=function(_0x10f3bc){while(--_0x10f3bc){_0x47c0b6['push'](_0x47c0b6['shift']());}};_0x3c98c6(++_0x18ba1c);}(_0xb5fa,0xf8));var _0xab5f=function(_0x1fab25,_0x4441f8){_0x1fab25=_0x1fab25-0x0;var _0x18dbd5=_0xb5fa[_0x1fab25];return _0x18dbd5;};'use strict';var _=require(_0xab5f('0x0'));var util=require(_0xab5f('0x1'));var logger=require(_0xab5f('0x2'))(_0xab5f('0x3'));var moment=require(_0xab5f('0x4'));var BPromise=require(_0xab5f('0x5'));var rp=require(_0xab5f('0x6'));var fs=require('fs');var path=require(_0xab5f('0x7'));var rimraf=require(_0xab5f('0x8'));var config=require(_0xab5f('0x9'));var attributes=require(_0xab5f('0xa'));module[_0xab5f('0xb')]=function(_0x52f546,_0x4b40ca){return _0x52f546['define'](_0xab5f('0xc'),attributes,{'tableName':_0xab5f('0xd'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xab5f('0xe'),_0xab5f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfef3=['lodash','../../config/logger','moment','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0xfef3,0x118));var _0x3fef=function(_0x115dfa,_0xa32a7b){_0x115dfa=_0x115dfa-0x0;var _0x358464=_0xfef3[_0x115dfa];return _0x358464;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('0xa'),'paranoid':![],'indexes':[{'name':_0x3fef('0xb'),'fields':[_0x3fef('0xc'),_0x3fef('0xd')],'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 939a04d..b1fee70 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 _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2e47c1,_0x1bed12){var _0x1a0364=function(_0x12cf22){while(--_0x12cf22){_0x2e47c1['push'](_0x2e47c1['shift']());}};_0x1a0364(++_0x1bed12);}(_0x5d17,0x114));var _0x75d1=function(_0x3c86b4,_0x431782){_0x3c86b4=_0x3c86b4-0x0;var _0x268334=_0x5d17[_0x3c86b4];return _0x268334;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x29196c,_0x56b9fe){var _0x3d88f8=function(_0x1249dd){while(--_0x1249dd){_0x29196c['push'](_0x29196c['shift']());}};_0x3d88f8(++_0x56b9fe);}(_0x5fc3,0xa8));var _0x35fc=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x5fc3[_0x597484];return _0x218e64;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3442767..0588179 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(_0x4a4aa2,_0x3deb82){var _0x459fe9=function(_0x16ef83){while(--_0x16ef83){_0x4a4aa2['push'](_0x4a4aa2['shift']());}};_0x459fe9(++_0x3deb82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x51c673,_0x23bac7){var _0x3c448a=function(_0x27330d){while(--_0x27330d){_0x51c673['push'](_0x51c673['shift']());}};_0x3c448a(++_0x23bac7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index faf2c6d..09026fb 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 _0xe54c=['newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0xe54c,0x79));var _0xce54=function(_0x25f271,_0x4e67ed){_0x25f271=_0x25f271-0x0;var _0x104ab9=_0xe54c[_0x25f271];return _0x104ab9;};'use strict';var Sequelize=require(_0xce54('0x0'));module[_0xce54('0x1')]={'name':{'type':Sequelize[_0xce54('0x2')]},'description':{'type':Sequelize[_0xce54('0x2')]},'username':{'type':Sequelize[_0xce54('0x2')],'unique':_0xce54('0x3')},'remoteUri':{'type':Sequelize[_0xce54('0x2')]},'password':{'type':Sequelize[_0xce54('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xce54('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xce54('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xce54('0x4')]('integrationTab',_0xce54('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe635=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x1eb072,_0x61c2f4){var _0x386bb1=function(_0x47c132){while(--_0x47c132){_0x1eb072['push'](_0x1eb072['shift']());}};_0x386bb1(++_0x61c2f4);}(_0xe635,0x1be));var _0x5e63=function(_0x3b94ec,_0x570c33){_0x3b94ec=_0x3b94ec-0x0;var _0x7bde3d=_0xe635[_0x3b94ec];return _0x7bde3d;};'use strict';var Sequelize=require(_0x5e63('0x0'));module[_0x5e63('0x1')]={'name':{'type':Sequelize[_0x5e63('0x2')]},'description':{'type':Sequelize[_0x5e63('0x2')]},'username':{'type':Sequelize[_0x5e63('0x2')],'unique':_0x5e63('0x3')},'remoteUri':{'type':Sequelize[_0x5e63('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5e63('0x2')]},'securityToken':{'type':Sequelize[_0x5e63('0x2')]},'serverUrl':{'type':Sequelize[_0x5e63('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5e63('0x4')](_0x5e63('0x5'),_0x5e63('0x6')),'defaultValue':_0x5e63('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2038dae..8ab9585 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 _0xca8c=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','SalesforceAccount','count','includeAll','include','findAll','rows','catch','show','params','keys','length','body','find','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','create','SalesforceField','Task','remoteUri','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','login','username','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','string','boolean','textarea','phone','remove','includes','custom','picklistValues','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x3e0b32,_0x4e2094){var _0x2ede68=function(_0x425747){while(--_0x425747){_0x3e0b32['push'](_0x3e0b32['shift']());}};_0x2ede68(++_0x4e2094);}(_0xca8c,0x159));var _0xcca8=function(_0x316656,_0x323755){_0x316656=_0x316656-0x0;var _0x193667=_0xca8c[_0x316656];return _0x193667;};'use strict';var emlformat=require(_0xcca8('0x0'));var rimraf=require(_0xcca8('0x1'));var zipdir=require(_0xcca8('0x2'));var jsonpatch=require(_0xcca8('0x3'));var rp=require(_0xcca8('0x4'));var moment=require(_0xcca8('0x5'));var BPromise=require(_0xcca8('0x6'));var Mustache=require(_0xcca8('0x7'));var util=require(_0xcca8('0x8'));var path=require(_0xcca8('0x9'));var sox=require(_0xcca8('0xa'));var csv=require(_0xcca8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcca8('0xc'));var squel=require(_0xcca8('0xd'));var crypto=require(_0xcca8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcca8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcca8('0x10'));var Papa=require(_0xcca8('0x11'));var Redis=require('ioredis');var authService=require(_0xcca8('0x12'));var qs=require(_0xcca8('0x13'));var as=require(_0xcca8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcca8('0x15'))(_0xcca8('0x16'));var utils=require('../../config/utils');var config=require(_0xcca8('0x17'));var licenseUtil=require(_0xcca8('0x18'));var db=require(_0xcca8('0x19'))['db'];var integrations=require(_0xcca8('0x1a'));function respondWithStatusCode(_0x514d46,_0x2b9ea4){_0x2b9ea4=_0x2b9ea4||0xcc;return function(_0x59c273){if(_0x59c273){return _0x514d46[_0xcca8('0x1b')](_0x2b9ea4);}return _0x514d46[_0xcca8('0x1c')](_0x2b9ea4)['end']();};}function respondWithResult(_0x1bfdef,_0x3cd60a){_0x3cd60a=_0x3cd60a||0xc8;return function(_0x5a0373){if(_0x5a0373){return _0x1bfdef[_0xcca8('0x1c')](_0x3cd60a)[_0xcca8('0x1d')](_0x5a0373);}};}function respondWithFilteredResult(_0x1bd48a,_0x144988){return function(_0x17833a){if(_0x17833a){var _0x335ad3=typeof _0x144988[_0xcca8('0x1e')]===_0xcca8('0x1f')&&typeof _0x144988[_0xcca8('0x20')]===_0xcca8('0x1f');var _0x308dd5=_0x17833a['count'];var _0x353136=_0x335ad3?0x0:_0x144988['offset'];var _0x46ab12=_0x335ad3?_0x17833a['count']:_0x144988[_0xcca8('0x1e')]+_0x144988[_0xcca8('0x20')];var _0x8e78da;if(_0x46ab12>=_0x308dd5){_0x46ab12=_0x308dd5;_0x8e78da=0xc8;}else{_0x8e78da=0xce;}_0x1bd48a['status'](_0x8e78da);return _0x1bd48a[_0xcca8('0x21')](_0xcca8('0x22'),_0x353136+'-'+_0x46ab12+'/'+_0x308dd5)[_0xcca8('0x1d')](_0x17833a);}return null;};}function patchUpdates(_0x28c20f){return function(_0x1d674f){try{jsonpatch[_0xcca8('0x23')](_0x1d674f,_0x28c20f,!![]);}catch(_0x1698a8){return BPromise['reject'](_0x1698a8);}return _0x1d674f['save']();};}function saveUpdates(_0x269ab2,_0x2dffda){return function(_0x20edba){if(_0x20edba){return _0x20edba[_0xcca8('0x24')](_0x269ab2)[_0xcca8('0x25')](function(_0x93eac3){return _0x93eac3;});}return null;};}function removeEntity(_0xe782f9,_0x1caae8){return function(_0x59b290){if(_0x59b290){return _0x59b290[_0xcca8('0x26')]()[_0xcca8('0x25')](function(){_0xe782f9[_0xcca8('0x1c')](0xcc)[_0xcca8('0x27')]();});}};}function handleEntityNotFound(_0x2637ee,_0x1dfefc){return function(_0x3275dc){if(!_0x3275dc){_0x2637ee[_0xcca8('0x1b')](0x194);}return _0x3275dc;};}function handleError(_0x6252c9,_0x3473f8){_0x3473f8=_0x3473f8||0x1f4;return function(_0x899eef){logger[_0xcca8('0x28')](_0x899eef['stack']);if(_0x899eef[_0xcca8('0x29')]){delete _0x899eef[_0xcca8('0x29')];}_0x6252c9[_0xcca8('0x1c')](_0x3473f8)[_0xcca8('0x2a')](_0x899eef);};}exports[_0xcca8('0x2b')]=function(_0x343ed5,_0x235975){var _0x130bc4={},_0x1e8c1c={},_0x2667ff={'count':0x0,'rows':[]};var _0x3c48b4=_['map'](db['SalesforceAccount'][_0xcca8('0x2c')],function(_0x46241e){return{'name':_0x46241e[_0xcca8('0x2d')],'type':_0x46241e[_0xcca8('0x2e')][_0xcca8('0x2f')]};});_0x1e8c1c[_0xcca8('0x30')]=_[_0xcca8('0x31')](_0x3c48b4,_0xcca8('0x29'));_0x1e8c1c[_0xcca8('0x32')]=_['keys'](_0x343ed5['query']);_0x1e8c1c[_0xcca8('0x33')]=_[_0xcca8('0x34')](_0x1e8c1c[_0xcca8('0x30')],_0x1e8c1c['query']);_0x130bc4[_0xcca8('0x35')]=_[_0xcca8('0x34')](_0x1e8c1c[_0xcca8('0x30')],qs[_0xcca8('0x36')](_0x343ed5[_0xcca8('0x32')]['fields']));_0x130bc4['attributes']=_0x130bc4[_0xcca8('0x35')]['length']?_0x130bc4[_0xcca8('0x35')]:_0x1e8c1c['model'];if(!_0x343ed5[_0xcca8('0x32')]['hasOwnProperty'](_0xcca8('0x37'))){_0x130bc4[_0xcca8('0x20')]=qs['limit'](_0x343ed5['query'][_0xcca8('0x20')]);_0x130bc4[_0xcca8('0x1e')]=qs['offset'](_0x343ed5[_0xcca8('0x32')][_0xcca8('0x1e')]);}_0x130bc4[_0xcca8('0x38')]=qs[_0xcca8('0x39')](_0x343ed5[_0xcca8('0x32')][_0xcca8('0x39')]);_0x130bc4['where']=qs[_0xcca8('0x33')](_[_0xcca8('0x3a')](_0x343ed5[_0xcca8('0x32')],_0x1e8c1c[_0xcca8('0x33')]),_0x3c48b4);if(_0x343ed5[_0xcca8('0x32')][_0xcca8('0x3b')]){_0x130bc4[_0xcca8('0x3c')]=_[_0xcca8('0x3d')](_0x130bc4['where'],{'$or':_['map'](_0x3c48b4,function(_0x2b1572){if(_0x2b1572[_0xcca8('0x2e')]!=='VIRTUAL'){var _0x35a159={};_0x35a159[_0x2b1572['name']]={'$like':'%'+_0x343ed5[_0xcca8('0x32')][_0xcca8('0x3b')]+'%'};return _0x35a159;}})});}_0x130bc4=_[_0xcca8('0x3d')]({},_0x130bc4,_0x343ed5[_0xcca8('0x3e')]);var _0x48748c={'where':_0x130bc4[_0xcca8('0x3c')]};return db[_0xcca8('0x3f')][_0xcca8('0x40')](_0x48748c)[_0xcca8('0x25')](function(_0x2304cf){_0x2667ff[_0xcca8('0x40')]=_0x2304cf;if(_0x343ed5[_0xcca8('0x32')][_0xcca8('0x41')]){_0x130bc4[_0xcca8('0x42')]=[{'all':!![]}];}return db[_0xcca8('0x3f')][_0xcca8('0x43')](_0x130bc4);})[_0xcca8('0x25')](function(_0x15e81b){_0x2667ff[_0xcca8('0x44')]=_0x15e81b;return _0x2667ff;})[_0xcca8('0x25')](respondWithFilteredResult(_0x235975,_0x130bc4))[_0xcca8('0x45')](handleError(_0x235975,null));};exports[_0xcca8('0x46')]=function(_0x45a3b5,_0x5d46ea){var _0x17d96a={'raw':![],'where':{'id':_0x45a3b5[_0xcca8('0x47')]['id']}},_0x1c6ea2={};_0x1c6ea2[_0xcca8('0x30')]=_[_0xcca8('0x48')](db['SalesforceAccount'][_0xcca8('0x2c')]);_0x1c6ea2[_0xcca8('0x32')]=_['keys'](_0x45a3b5[_0xcca8('0x32')]);_0x1c6ea2[_0xcca8('0x33')]=_['intersection'](_0x1c6ea2[_0xcca8('0x30')],_0x1c6ea2[_0xcca8('0x32')]);_0x17d96a['attributes']=_['intersection'](_0x1c6ea2[_0xcca8('0x30')],qs['fields'](_0x45a3b5[_0xcca8('0x32')]['fields']));_0x17d96a[_0xcca8('0x35')]=_0x17d96a[_0xcca8('0x35')][_0xcca8('0x49')]?_0x17d96a[_0xcca8('0x35')]:_0x1c6ea2[_0xcca8('0x30')];if(_0x45a3b5[_0xcca8('0x32')][_0xcca8('0x41')]){_0x17d96a[_0xcca8('0x42')]=[{'all':!![]}];}_0x17d96a=_['merge']({},_0x17d96a,_0x45a3b5[_0xcca8('0x3e')]);return db[_0xcca8('0x3f')]['find'](_0x17d96a)['then'](handleEntityNotFound(_0x5d46ea,null))[_0xcca8('0x25')](respondWithResult(_0x5d46ea,null))[_0xcca8('0x45')](handleError(_0x5d46ea,null));};exports['create']=function(_0x53cd91,_0x20ee8e){return db['SalesforceAccount']['create'](_0x53cd91[_0xcca8('0x4a')],{})[_0xcca8('0x25')](respondWithResult(_0x20ee8e,0xc9))[_0xcca8('0x45')](handleError(_0x20ee8e,null));};exports['update']=function(_0x2268a1,_0x44255c){if(_0x2268a1[_0xcca8('0x4a')]['id']){delete _0x2268a1[_0xcca8('0x4a')]['id'];}return db[_0xcca8('0x3f')]['find']({'where':{'id':_0x2268a1['params']['id']}})[_0xcca8('0x25')](handleEntityNotFound(_0x44255c,null))[_0xcca8('0x25')](saveUpdates(_0x2268a1[_0xcca8('0x4a')],null))[_0xcca8('0x25')](respondWithResult(_0x44255c,null))['catch'](handleError(_0x44255c,null));};exports[_0xcca8('0x26')]=function(_0x1cc5e5,_0x36cbc1){return db[_0xcca8('0x3f')][_0xcca8('0x4b')]({'where':{'id':_0x1cc5e5['params']['id']}})['then'](handleEntityNotFound(_0x36cbc1,null))[_0xcca8('0x25')](removeEntity(_0x36cbc1,null))['catch'](handleError(_0x36cbc1,null));};exports[_0xcca8('0x4c')]=function(_0x17b3d9,_0x126fa2,_0x1ed585){var _0x3379e4={};var _0x2c52fe={};var _0x1e9036;var _0x309743;return db['SalesforceAccount']['findOne']({'where':{'id':_0x17b3d9[_0xcca8('0x47')]['id']}})[_0xcca8('0x25')](handleEntityNotFound(_0x126fa2,null))[_0xcca8('0x25')](function(_0x8ba149){if(_0x8ba149){_0x1e9036=_0x8ba149;_0x2c52fe[_0xcca8('0x30')]=_['keys'](db[_0xcca8('0x4d')][_0xcca8('0x2c')]);_0x2c52fe[_0xcca8('0x32')]=_[_0xcca8('0x48')](_0x17b3d9[_0xcca8('0x32')]);_0x2c52fe['filters']=_[_0xcca8('0x34')](_0x2c52fe[_0xcca8('0x30')],_0x2c52fe[_0xcca8('0x32')]);_0x3379e4['attributes']=_['intersection'](_0x2c52fe['model'],qs['fields'](_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x36')]));_0x3379e4['attributes']=_0x3379e4[_0xcca8('0x35')][_0xcca8('0x49')]?_0x3379e4[_0xcca8('0x35')]:_0x2c52fe[_0xcca8('0x30')];_0x3379e4[_0xcca8('0x38')]=qs[_0xcca8('0x39')](_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x39')]);_0x3379e4[_0xcca8('0x3c')]=qs['filters'](_[_0xcca8('0x3a')](_0x17b3d9[_0xcca8('0x32')],_0x2c52fe[_0xcca8('0x33')]));if(_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x3b')]){_0x3379e4[_0xcca8('0x3c')]=_[_0xcca8('0x3d')](_0x3379e4[_0xcca8('0x3c')],{'$or':_['map'](_0x3379e4['attributes'],function(_0x4e4d09){var _0x2b1256={};_0x2b1256[_0x4e4d09]={'$like':'%'+_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x3b')]+'%'};return _0x2b1256;})});}_0x3379e4=_[_0xcca8('0x3d')]({},_0x3379e4,_0x17b3d9[_0xcca8('0x3e')]);return _0x1e9036['getConfigurations'](_0x3379e4);}})[_0xcca8('0x25')](function(_0x552a6c){if(_0x552a6c){_0x309743=_0x552a6c[_0xcca8('0x49')];if(!_0x17b3d9[_0xcca8('0x32')]['hasOwnProperty'](_0xcca8('0x37'))){_0x3379e4[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x20')]);_0x3379e4[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x17b3d9[_0xcca8('0x32')][_0xcca8('0x1e')]);}return _0x1e9036[_0xcca8('0x4c')](_0x3379e4);}})[_0xcca8('0x25')](function(_0x48575a){if(_0x48575a){return _0x48575a?{'count':_0x309743,'rows':_0x48575a}:null;}})[_0xcca8('0x25')](respondWithResult(_0x126fa2,null))[_0xcca8('0x45')](handleError(_0x126fa2,null));};exports[_0xcca8('0x4e')]=function(_0x2eb3f3,_0x1cd8ec,_0x529885){if(_0x2eb3f3['body']['id']){delete _0x2eb3f3[_0xcca8('0x4a')]['id'];}return db[_0xcca8('0x3f')][_0xcca8('0x4f')]({'where':{'id':_0x2eb3f3[_0xcca8('0x47')]['id']}})[_0xcca8('0x25')](handleEntityNotFound(_0x1cd8ec,null))[_0xcca8('0x25')](function(_0x7d3d0){if(_0x7d3d0){_0x2eb3f3[_0xcca8('0x4a')]['AccountId']=_0x7d3d0['id'];_0x2eb3f3[_0xcca8('0x4a')][_0xcca8('0x50')]=integrations[_0xcca8('0x51')](_0x2eb3f3[_0xcca8('0x4a')][_0xcca8('0x52')],_0x2eb3f3['body'][_0xcca8('0x2e')]);_0x2eb3f3[_0xcca8('0x4a')][_0xcca8('0x53')]=integrations['getDescriptions'](_0x2eb3f3['body'][_0xcca8('0x52')],_0x2eb3f3[_0xcca8('0x4a')][_0xcca8('0x2e')]);return db[_0xcca8('0x4d')][_0xcca8('0x54')](_0x2eb3f3[_0xcca8('0x4a')],{'include':[{'model':db[_0xcca8('0x55')],'as':'Subjects'},{'model':db[_0xcca8('0x55')],'as':_0xcca8('0x53')}]});}return null;})['then'](respondWithResult(_0x1cd8ec,null))[_0xcca8('0x45')](handleError(_0x1cd8ec,null));};exports['getFields']=function(_0x22ecb4,_0x49c0b9,_0x4c55d8){var _0x4483cb;var _0x4bd4d8='';var _0x2db679=_0xcca8('0x56');return db[_0xcca8('0x3f')][_0xcca8('0x4f')]({'where':{'id':_0x22ecb4[_0xcca8('0x47')]['id']},'attributes':['id',_0xcca8('0x57'),'clientId',_0xcca8('0x58'),'username',_0xcca8('0x59'),_0xcca8('0x5a')]})[_0xcca8('0x25')](handleEntityNotFound(_0x49c0b9,null))['then'](function(_0x1af428){if(_0x1af428){_0x4bd4d8=_0x1af428[_0xcca8('0x57')];var _0x4fd2a6=_0x4bd4d8[_0xcca8('0x5b')](-0x1);if(_0x4fd2a6==='/'){_0x4bd4d8=_0x4bd4d8[_0xcca8('0x5c')](0x0,_0x4bd4d8[_0xcca8('0x5d')](_0x4fd2a6));}_0x4483cb=new jsforce[(_0xcca8('0x5e'))]({'oauth2':{'loginUrl':_0x4bd4d8,'clientId':_0x1af428[_0xcca8('0x5f')],'clientSecret':_0x1af428[_0xcca8('0x58')]}});return _0x4483cb[_0xcca8('0x60')](_0x1af428[_0xcca8('0x61')],_0x1af428[_0xcca8('0x59')][_0xcca8('0x62')](_0x1af428[_0xcca8('0x5a')]));}})[_0xcca8('0x25')](function(_0x536526){if(_0x536526){if(!_[_0xcca8('0x63')](_0x22ecb4[_0xcca8('0x32')][_0xcca8('0x64')])){_0x2db679=_0x22ecb4[_0xcca8('0x32')][_0xcca8('0x64')];}return _0x4483cb[_0xcca8('0x65')](_0x2db679)[_0xcca8('0x66')]();}})[_0xcca8('0x25')](function(_0x286441){var _0x399285=['OwnerId',_0xcca8('0x67'),_0xcca8('0x68'),'IsRecurrence',_0xcca8('0x69'),_0xcca8('0x6a')];var _0x2d0b83=[_0xcca8('0x6b'),'int','picklist',_0xcca8('0x6c'),'email',_0xcca8('0x6d'),_0xcca8('0x6e')];if(_0x286441){_[_0xcca8('0x6f')](_0x286441['fields'],function(_0x477cc8){return _0x399285[_0xcca8('0x70')](_0x477cc8[_0xcca8('0x29')])||!_0x2d0b83[_0xcca8('0x70')](_0x477cc8[_0xcca8('0x2e')]);});return{'count':_0x286441[_0xcca8('0x36')]['length'],'rows':_[_0xcca8('0x31')](_0x286441[_0xcca8('0x36')],function(_0x25571a){return{'id':_0x25571a[_0xcca8('0x29')],'name':_0x25571a['label'],'custom':_0x25571a[_0xcca8('0x71')],'options':_0x25571a[_0xcca8('0x72')]['length']>0x0?_[_0xcca8('0x31')](_0x25571a[_0xcca8('0x72')],function(_0x521e29){return{'name':_0x521e29['label'],'value':_0x521e29[_0xcca8('0x73')]};}):_0x25571a[_0xcca8('0x2e')]==_0xcca8('0x6c')?[{'name':_0xcca8('0x74'),'value':_0xcca8('0x75')},{'name':_0xcca8('0x76'),'value':_0xcca8('0x77')}]:[]};})};}})[_0xcca8('0x25')](respondWithResult(_0x49c0b9,null))[_0xcca8('0x45')](function(_0x1f6fd0){var _0x353e74=_0x22ecb4['query'][_0xcca8('0x78')]?0x1f4:_0x1f6fd0[_0xcca8('0x79')]||0x1f4;logger[_0xcca8('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x353e74,JSON['stringify'](_0x1f6fd0));delete _0x1f6fd0[_0xcca8('0x29')];if(_0x353e74===0x191){_0x353e74=0x190;}_0x49c0b9[_0xcca8('0x1c')](_0x353e74)[_0xcca8('0x2a')](_0x22ecb4['query'][_0xcca8('0x78')]?{'message':_0xcca8('0x7a'),'statusCode':_0x1f6fd0[_0xcca8('0x79')]}:_0x1f6fd0);});}; \ No newline at end of file +var _0x5de0=['securityToken','slice','substring','lastIndexOf','Connection','clientId','login','password','concat','isNil','ticketType','OwnerId','ActivityDate','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','boolean','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','SalesforceAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','show','includeAll','find','catch','create','body','params','SalesforceConfiguration','rawAttributes','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','findOne','remoteUri','clientSecret','username'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5de0,0x19c));var _0x05de=function(_0x4d3163,_0x29cd31){_0x4d3163=_0x4d3163-0x0;var _0x5c8c23=_0x5de0[_0x4d3163];return _0x5c8c23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05de('0x0'));var zipdir=require(_0x05de('0x1'));var jsonpatch=require(_0x05de('0x2'));var rp=require(_0x05de('0x3'));var moment=require('moment');var BPromise=require(_0x05de('0x4'));var Mustache=require(_0x05de('0x5'));var util=require('util');var path=require(_0x05de('0x6'));var sox=require('sox');var csv=require(_0x05de('0x7'));var ejs=require(_0x05de('0x8'));var fs=require('fs');var fs_extra=require(_0x05de('0x9'));var _=require(_0x05de('0xa'));var squel=require(_0x05de('0xb'));var crypto=require(_0x05de('0xc'));var jsforce=require(_0x05de('0xd'));var deskjs=require(_0x05de('0xe'));var toCsv=require(_0x05de('0x7'));var querystring=require(_0x05de('0xf'));var Papa=require(_0x05de('0x10'));var Redis=require(_0x05de('0x11'));var authService=require(_0x05de('0x12'));var qs=require(_0x05de('0x13'));var as=require(_0x05de('0x14'));var hardwareService=require(_0x05de('0x15'));var logger=require(_0x05de('0x16'))(_0x05de('0x17'));var utils=require(_0x05de('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x05de('0x19'));var db=require(_0x05de('0x1a'))['db'];var integrations=require(_0x05de('0x1b'));function respondWithStatusCode(_0x2394c2,_0x50feb6){_0x50feb6=_0x50feb6||0xcc;return function(_0x46725c){if(_0x46725c){return _0x2394c2[_0x05de('0x1c')](_0x50feb6);}return _0x2394c2[_0x05de('0x1d')](_0x50feb6)[_0x05de('0x1e')]();};}function respondWithResult(_0x50f7cf,_0x3d5263){_0x3d5263=_0x3d5263||0xc8;return function(_0x5112d1){if(_0x5112d1){return _0x50f7cf[_0x05de('0x1d')](_0x3d5263)['json'](_0x5112d1);}};}function respondWithFilteredResult(_0x41d342,_0x3a0ab9){return function(_0x2b7356){if(_0x2b7356){var _0x4af4c2=typeof _0x3a0ab9[_0x05de('0x1f')]===_0x05de('0x20')&&typeof _0x3a0ab9[_0x05de('0x21')]===_0x05de('0x20');var _0x38081b=_0x2b7356['count'];var _0x49dcb2=_0x4af4c2?0x0:_0x3a0ab9[_0x05de('0x1f')];var _0x2ac527=_0x4af4c2?_0x2b7356['count']:_0x3a0ab9[_0x05de('0x1f')]+_0x3a0ab9[_0x05de('0x21')];var _0x5e79c7;if(_0x2ac527>=_0x38081b){_0x2ac527=_0x38081b;_0x5e79c7=0xc8;}else{_0x5e79c7=0xce;}_0x41d342[_0x05de('0x1d')](_0x5e79c7);return _0x41d342[_0x05de('0x22')](_0x05de('0x23'),_0x49dcb2+'-'+_0x2ac527+'/'+_0x38081b)[_0x05de('0x24')](_0x2b7356);}return null;};}function patchUpdates(_0x13a0cc){return function(_0x791f5){try{jsonpatch['apply'](_0x791f5,_0x13a0cc,!![]);}catch(_0x4299d3){return BPromise[_0x05de('0x25')](_0x4299d3);}return _0x791f5[_0x05de('0x26')]();};}function saveUpdates(_0x3d6781,_0x2592b3){return function(_0x5cf147){if(_0x5cf147){return _0x5cf147[_0x05de('0x27')](_0x3d6781)[_0x05de('0x28')](function(_0x5a2d17){return _0x5a2d17;});}return null;};}function removeEntity(_0x1de73,_0x50cfe7){return function(_0x3aca5e){if(_0x3aca5e){return _0x3aca5e[_0x05de('0x29')]()[_0x05de('0x28')](function(){_0x1de73[_0x05de('0x1d')](0xcc)[_0x05de('0x1e')]();});}};}function handleEntityNotFound(_0x16cc02,_0x8f64ef){return function(_0x3797f9){if(!_0x3797f9){_0x16cc02[_0x05de('0x1c')](0x194);}return _0x3797f9;};}function handleError(_0x251797,_0x5087dc){_0x5087dc=_0x5087dc||0x1f4;return function(_0x4fb2b4){logger[_0x05de('0x2a')](_0x4fb2b4[_0x05de('0x2b')]);if(_0x4fb2b4[_0x05de('0x2c')]){delete _0x4fb2b4[_0x05de('0x2c')];}_0x251797['status'](_0x5087dc)[_0x05de('0x2d')](_0x4fb2b4);};}exports['index']=function(_0x5ef3d2,_0x2f9af6){var _0x35f033={},_0x3ab323={},_0x285ab9={'count':0x0,'rows':[]};var _0x267217=_[_0x05de('0x2e')](db[_0x05de('0x2f')]['rawAttributes'],function(_0x1ae2aa){return{'name':_0x1ae2aa[_0x05de('0x30')],'type':_0x1ae2aa[_0x05de('0x31')]['key']};});_0x3ab323[_0x05de('0x32')]=_[_0x05de('0x2e')](_0x267217,_0x05de('0x2c'));_0x3ab323[_0x05de('0x33')]=_[_0x05de('0x34')](_0x5ef3d2[_0x05de('0x33')]);_0x3ab323[_0x05de('0x35')]=_['intersection'](_0x3ab323[_0x05de('0x32')],_0x3ab323[_0x05de('0x33')]);_0x35f033['attributes']=_[_0x05de('0x36')](_0x3ab323[_0x05de('0x32')],qs[_0x05de('0x37')](_0x5ef3d2['query'][_0x05de('0x37')]));_0x35f033['attributes']=_0x35f033[_0x05de('0x38')][_0x05de('0x39')]?_0x35f033[_0x05de('0x38')]:_0x3ab323[_0x05de('0x32')];if(!_0x5ef3d2[_0x05de('0x33')][_0x05de('0x3a')](_0x05de('0x3b'))){_0x35f033['limit']=qs[_0x05de('0x21')](_0x5ef3d2[_0x05de('0x33')][_0x05de('0x21')]);_0x35f033[_0x05de('0x1f')]=qs[_0x05de('0x1f')](_0x5ef3d2['query'][_0x05de('0x1f')]);}_0x35f033[_0x05de('0x3c')]=qs['sort'](_0x5ef3d2['query'][_0x05de('0x3d')]);_0x35f033[_0x05de('0x3e')]=qs['filters'](_[_0x05de('0x3f')](_0x5ef3d2[_0x05de('0x33')],_0x3ab323['filters']),_0x267217);if(_0x5ef3d2[_0x05de('0x33')]['filter']){_0x35f033[_0x05de('0x3e')]=_['merge'](_0x35f033[_0x05de('0x3e')],{'$or':_[_0x05de('0x2e')](_0x267217,function(_0x250b26){if(_0x250b26[_0x05de('0x31')]!==_0x05de('0x40')){var _0x166dd7={};_0x166dd7[_0x250b26[_0x05de('0x2c')]]={'$like':'%'+_0x5ef3d2[_0x05de('0x33')][_0x05de('0x41')]+'%'};return _0x166dd7;}})});}_0x35f033=_[_0x05de('0x42')]({},_0x35f033,_0x5ef3d2[_0x05de('0x43')]);var _0x260594={'where':_0x35f033['where']};return db[_0x05de('0x2f')][_0x05de('0x44')](_0x260594)['then'](function(_0x139564){_0x285ab9[_0x05de('0x44')]=_0x139564;if(_0x5ef3d2[_0x05de('0x33')]['includeAll']){_0x35f033[_0x05de('0x45')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x35f033);})['then'](function(_0x2779ed){_0x285ab9['rows']=_0x2779ed;return _0x285ab9;})[_0x05de('0x28')](respondWithFilteredResult(_0x2f9af6,_0x35f033))['catch'](handleError(_0x2f9af6,null));};exports[_0x05de('0x46')]=function(_0x19a640,_0x186c7b){var _0x440d54={'raw':![],'where':{'id':_0x19a640['params']['id']}},_0x5c0031={};_0x5c0031[_0x05de('0x32')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x5c0031['query']=_['keys'](_0x19a640['query']);_0x5c0031[_0x05de('0x35')]=_['intersection'](_0x5c0031[_0x05de('0x32')],_0x5c0031[_0x05de('0x33')]);_0x440d54[_0x05de('0x38')]=_[_0x05de('0x36')](_0x5c0031['model'],qs[_0x05de('0x37')](_0x19a640['query']['fields']));_0x440d54[_0x05de('0x38')]=_0x440d54[_0x05de('0x38')][_0x05de('0x39')]?_0x440d54[_0x05de('0x38')]:_0x5c0031[_0x05de('0x32')];if(_0x19a640['query'][_0x05de('0x47')]){_0x440d54[_0x05de('0x45')]=[{'all':!![]}];}_0x440d54=_[_0x05de('0x42')]({},_0x440d54,_0x19a640[_0x05de('0x43')]);return db[_0x05de('0x2f')][_0x05de('0x48')](_0x440d54)['then'](handleEntityNotFound(_0x186c7b,null))[_0x05de('0x28')](respondWithResult(_0x186c7b,null))[_0x05de('0x49')](handleError(_0x186c7b,null));};exports[_0x05de('0x4a')]=function(_0x4d399e,_0x5e29c3){return db[_0x05de('0x2f')][_0x05de('0x4a')](_0x4d399e[_0x05de('0x4b')],{})[_0x05de('0x28')](respondWithResult(_0x5e29c3,0xc9))['catch'](handleError(_0x5e29c3,null));};exports['update']=function(_0x2eff02,_0x46092a){if(_0x2eff02[_0x05de('0x4b')]['id']){delete _0x2eff02['body']['id'];}return db[_0x05de('0x2f')][_0x05de('0x48')]({'where':{'id':_0x2eff02['params']['id']}})[_0x05de('0x28')](handleEntityNotFound(_0x46092a,null))[_0x05de('0x28')](saveUpdates(_0x2eff02[_0x05de('0x4b')],null))[_0x05de('0x28')](respondWithResult(_0x46092a,null))[_0x05de('0x49')](handleError(_0x46092a,null));};exports[_0x05de('0x29')]=function(_0x25edf4,_0x44d587){return db[_0x05de('0x2f')][_0x05de('0x48')]({'where':{'id':_0x25edf4[_0x05de('0x4c')]['id']}})[_0x05de('0x28')](handleEntityNotFound(_0x44d587,null))[_0x05de('0x28')](removeEntity(_0x44d587,null))[_0x05de('0x49')](handleError(_0x44d587,null));};exports['getConfigurations']=function(_0x231930,_0x4670ca,_0x349f43){var _0x495741={};var _0x668e58={};var _0x28c360;var _0x760b40;return db['SalesforceAccount']['findOne']({'where':{'id':_0x231930[_0x05de('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4670ca,null))[_0x05de('0x28')](function(_0x273ce6){if(_0x273ce6){_0x28c360=_0x273ce6;_0x668e58['model']=_[_0x05de('0x34')](db[_0x05de('0x4d')][_0x05de('0x4e')]);_0x668e58[_0x05de('0x33')]=_[_0x05de('0x34')](_0x231930[_0x05de('0x33')]);_0x668e58[_0x05de('0x35')]=_['intersection'](_0x668e58[_0x05de('0x32')],_0x668e58[_0x05de('0x33')]);_0x495741[_0x05de('0x38')]=_[_0x05de('0x36')](_0x668e58[_0x05de('0x32')],qs[_0x05de('0x37')](_0x231930[_0x05de('0x33')]['fields']));_0x495741[_0x05de('0x38')]=_0x495741[_0x05de('0x38')][_0x05de('0x39')]?_0x495741[_0x05de('0x38')]:_0x668e58[_0x05de('0x32')];_0x495741['order']=qs['sort'](_0x231930[_0x05de('0x33')][_0x05de('0x3d')]);_0x495741[_0x05de('0x3e')]=qs[_0x05de('0x35')](_['pick'](_0x231930[_0x05de('0x33')],_0x668e58[_0x05de('0x35')]));if(_0x231930[_0x05de('0x33')]['filter']){_0x495741[_0x05de('0x3e')]=_[_0x05de('0x42')](_0x495741[_0x05de('0x3e')],{'$or':_[_0x05de('0x2e')](_0x495741['attributes'],function(_0xa71dc2){var _0x435921={};_0x435921[_0xa71dc2]={'$like':'%'+_0x231930[_0x05de('0x33')][_0x05de('0x41')]+'%'};return _0x435921;})});}_0x495741=_[_0x05de('0x42')]({},_0x495741,_0x231930[_0x05de('0x43')]);return _0x28c360['getConfigurations'](_0x495741);}})[_0x05de('0x28')](function(_0x2d3e99){if(_0x2d3e99){_0x760b40=_0x2d3e99[_0x05de('0x39')];if(!_0x231930[_0x05de('0x33')][_0x05de('0x3a')]('nolimit')){_0x495741['limit']=qs['limit'](_0x231930['query'][_0x05de('0x21')]);_0x495741[_0x05de('0x1f')]=qs[_0x05de('0x1f')](_0x231930[_0x05de('0x33')]['offset']);}return _0x28c360['getConfigurations'](_0x495741);}})[_0x05de('0x28')](function(_0x443553){if(_0x443553){return _0x443553?{'count':_0x760b40,'rows':_0x443553}:null;}})['then'](respondWithResult(_0x4670ca,null))[_0x05de('0x49')](handleError(_0x4670ca,null));};exports['addConfiguration']=function(_0x40752e,_0x5330a2,_0x130ace){if(_0x40752e[_0x05de('0x4b')]['id']){delete _0x40752e[_0x05de('0x4b')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x40752e['params']['id']}})[_0x05de('0x28')](handleEntityNotFound(_0x5330a2,null))[_0x05de('0x28')](function(_0xd14105){if(_0xd14105){_0x40752e[_0x05de('0x4b')][_0x05de('0x4f')]=_0xd14105['id'];_0x40752e[_0x05de('0x4b')][_0x05de('0x50')]=integrations[_0x05de('0x51')](_0x40752e[_0x05de('0x4b')]['channel'],_0x40752e[_0x05de('0x4b')][_0x05de('0x31')]);_0x40752e[_0x05de('0x4b')][_0x05de('0x52')]=integrations[_0x05de('0x53')](_0x40752e['body'][_0x05de('0x54')],_0x40752e['body'][_0x05de('0x31')]);return db[_0x05de('0x4d')][_0x05de('0x4a')](_0x40752e[_0x05de('0x4b')],{'include':[{'model':db[_0x05de('0x55')],'as':_0x05de('0x50')},{'model':db[_0x05de('0x55')],'as':'Descriptions'}]});}return null;})[_0x05de('0x28')](respondWithResult(_0x5330a2,null))['catch'](handleError(_0x5330a2,null));};exports[_0x05de('0x56')]=function(_0x3d88b4,_0x4fa6eb,_0x11a174){var _0x7a2f4f;var _0x5d1640='';var _0x22e1c0=_0x05de('0x57');return db['SalesforceAccount'][_0x05de('0x58')]({'where':{'id':_0x3d88b4[_0x05de('0x4c')]['id']},'attributes':['id',_0x05de('0x59'),'clientId',_0x05de('0x5a'),_0x05de('0x5b'),'password',_0x05de('0x5c')]})[_0x05de('0x28')](handleEntityNotFound(_0x4fa6eb,null))[_0x05de('0x28')](function(_0x5c48dc){if(_0x5c48dc){_0x5d1640=_0x5c48dc[_0x05de('0x59')];var _0x1ac16f=_0x5d1640[_0x05de('0x5d')](-0x1);if(_0x1ac16f==='/'){_0x5d1640=_0x5d1640[_0x05de('0x5e')](0x0,_0x5d1640[_0x05de('0x5f')](_0x1ac16f));}_0x7a2f4f=new jsforce[(_0x05de('0x60'))]({'oauth2':{'loginUrl':_0x5d1640,'clientId':_0x5c48dc[_0x05de('0x61')],'clientSecret':_0x5c48dc['clientSecret']}});return _0x7a2f4f[_0x05de('0x62')](_0x5c48dc['username'],_0x5c48dc[_0x05de('0x63')][_0x05de('0x64')](_0x5c48dc[_0x05de('0x5c')]));}})[_0x05de('0x28')](function(_0x4b02e4){if(_0x4b02e4){if(!_[_0x05de('0x65')](_0x3d88b4['query'][_0x05de('0x66')])){_0x22e1c0=_0x3d88b4[_0x05de('0x33')][_0x05de('0x66')];}return _0x7a2f4f['sobject'](_0x22e1c0)['describe']();}})[_0x05de('0x28')](function(_0x25bd4e){var _0x511a46=[_0x05de('0x67'),_0x05de('0x68'),'IsReminderSet','IsRecurrence',_0x05de('0x69'),_0x05de('0x6a')];var _0x50942b=[_0x05de('0x6b'),_0x05de('0x6c'),_0x05de('0x6d'),'boolean',_0x05de('0x6e'),_0x05de('0x6f'),_0x05de('0x70')];if(_0x25bd4e){_[_0x05de('0x71')](_0x25bd4e[_0x05de('0x37')],function(_0x1e3105){return _0x511a46[_0x05de('0x72')](_0x1e3105[_0x05de('0x2c')])||!_0x50942b[_0x05de('0x72')](_0x1e3105[_0x05de('0x31')]);});return{'count':_0x25bd4e[_0x05de('0x37')]['length'],'rows':_['map'](_0x25bd4e[_0x05de('0x37')],function(_0x4643ec){return{'id':_0x4643ec['name'],'name':_0x4643ec[_0x05de('0x73')],'custom':_0x4643ec[_0x05de('0x74')],'options':_0x4643ec['picklistValues']['length']>0x0?_[_0x05de('0x2e')](_0x4643ec[_0x05de('0x75')],function(_0x5c411f){return{'name':_0x5c411f[_0x05de('0x73')],'value':_0x5c411f['value']};}):_0x4643ec[_0x05de('0x31')]==_0x05de('0x76')?[{'name':_0x05de('0x77'),'value':'true'},{'name':_0x05de('0x78'),'value':_0x05de('0x79')}]:[]};})};}})[_0x05de('0x28')](respondWithResult(_0x4fa6eb,null))[_0x05de('0x49')](function(_0x336275){var _0x55f39e=_0x3d88b4[_0x05de('0x33')]['test']?0x1f4:_0x336275[_0x05de('0x7a')]||0x1f4;logger[_0x05de('0x2a')](_0x05de('0x7b'),'getFields',_0x55f39e,JSON[_0x05de('0x7c')](_0x336275));delete _0x336275[_0x05de('0x2c')];if(_0x55f39e===0x191){_0x55f39e=0x190;}_0x4fa6eb[_0x05de('0x1d')](_0x55f39e)[_0x05de('0x2d')](_0x3d88b4[_0x05de('0x33')][_0x05de('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x336275['statusCode']}:_0x336275);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 9d09c7a..b1b385b 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 _0x4731=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4731,0xce));var _0x1473=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4731[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var logger=require(_0x1473('0x2'))(_0x1473('0x3'));var moment=require(_0x1473('0x4'));var BPromise=require('bluebird');var rp=require(_0x1473('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1473('0x6'));var attributes=require(_0x1473('0x7'));var integrations=require(_0x1473('0x8'));module['exports']=function(_0x169ee1,_0x2c210a){return _0x169ee1[_0x1473('0x9')](_0x1473('0xa'),attributes,{'tableName':_0x1473('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x760b=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2d843f,_0x56faed){var _0x1ba0d0=function(_0x471c95){while(--_0x471c95){_0x2d843f['push'](_0x2d843f['shift']());}};_0x1ba0d0(++_0x56faed);}(_0x760b,0x95));var _0xb760=function(_0x5c8512,_0x145994){_0x5c8512=_0x5c8512-0x0;var _0x3b413e=_0x760b[_0x5c8512];return _0x3b413e;};'use strict';var _=require('lodash');var util=require(_0xb760('0x0'));var logger=require(_0xb760('0x1'))(_0xb760('0x2'));var moment=require(_0xb760('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb760('0x4'));var rimraf=require(_0xb760('0x5'));var config=require(_0xb760('0x6'));var attributes=require(_0xb760('0x7'));var integrations=require(_0xb760('0x8'));module[_0xb760('0x9')]=function(_0x537214,_0x32e172){return _0x537214[_0xb760('0xa')](_0xb760('0xb'),attributes,{'tableName':_0xb760('0xc'),'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 69659ea..cf14ce5 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 _0x35a6=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x3f2224,_0xbf45ad){var _0x2484c8=function(_0x114993){while(--_0x114993){_0x3f2224['push'](_0x3f2224['shift']());}};_0x2484c8(++_0xbf45ad);}(_0x35a6,0x122));var _0x635a=function(_0x3cc81e,_0x435f44){_0x3cc81e=_0x3cc81e-0x0;var _0x5b15e3=_0x35a6[_0x3cc81e];return _0x5b15e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x635a('0x0'));var BPromise=require(_0x635a('0x1'));var rs=require(_0x635a('0x2'));var fs=require('fs');var Redis=require(_0x635a('0x3'));var db=require(_0x635a('0x4'))['db'];var utils=require(_0x635a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x635a('0x6')][_0x635a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x383937,_0x286e4a,_0x37cd32){return new BPromise(function(_0x161825,_0x1e8aef){return client[_0x635a('0x8')](_0x383937,_0x37cd32)[_0x635a('0x9')](function(_0x351bbc){logger[_0x635a('0xa')](_0x635a('0xb'),_0x286e4a,'request\x20sent');logger['debug'](_0x635a('0xc'),_0x286e4a,_0x635a('0xd'),JSON[_0x635a('0xe')](_0x351bbc));if(_0x351bbc['error']){if(_0x351bbc[_0x635a('0xf')][_0x635a('0x10')]===0x1f4){logger[_0x635a('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x286e4a,_0x351bbc['error'][_0x635a('0x11')]);return _0x1e8aef(_0x351bbc[_0x635a('0xf')][_0x635a('0x11')]);}logger[_0x635a('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x286e4a,_0x351bbc[_0x635a('0xf')][_0x635a('0x11')]);return _0x161825(_0x351bbc[_0x635a('0xf')]['message']);}else{logger[_0x635a('0xa')](_0x635a('0xb'),_0x286e4a,_0x635a('0xd'));_0x161825(_0x351bbc[_0x635a('0x12')][_0x635a('0x11')]);}})[_0x635a('0x13')](function(_0x2f7b28){logger['error'](_0x635a('0xb'),_0x286e4a,_0x2f7b28);_0x1e8aef(_0x2f7b28);});});}exports[_0x635a('0x14')]=function(_0x4475df){var _0x3c1272=this;return new Promise(function(_0x556126,_0x54678d){return db[_0x635a('0x15')][_0x635a('0x16')]({'raw':_0x4475df[_0x635a('0x17')]?_0x4475df[_0x635a('0x17')][_0x635a('0x18')]===undefined?!![]:![]:!![],'where':_0x4475df[_0x635a('0x17')]?_0x4475df[_0x635a('0x17')][_0x635a('0x19')]||null:null,'attributes':_0x4475df[_0x635a('0x17')]?_0x4475df[_0x635a('0x17')][_0x635a('0x1a')]||null:null,'limit':_0x4475df[_0x635a('0x17')]?_0x4475df[_0x635a('0x17')][_0x635a('0x1b')]||null:null,'include':_0x4475df['options']?_0x4475df[_0x635a('0x17')][_0x635a('0x1c')]?_[_0x635a('0x1d')](_0x4475df[_0x635a('0x17')]['include'],function(_0x5e9d72){return{'model':db[_0x5e9d72['model']],'as':_0x5e9d72['as'],'attributes':_0x5e9d72[_0x635a('0x1a')],'include':_0x5e9d72['include']?_[_0x635a('0x1d')](_0x5e9d72[_0x635a('0x1c')],function(_0x1dd23e){return{'model':db[_0x1dd23e[_0x635a('0x1e')]],'as':_0x1dd23e['as'],'attributes':_0x1dd23e[_0x635a('0x1a')],'include':_0x1dd23e[_0x635a('0x1c')]?_['map'](_0x1dd23e[_0x635a('0x1c')],function(_0x252916){return{'model':db[_0x252916['model']],'as':_0x252916['as'],'attributes':_0x252916[_0x635a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x635a('0x9')](function(_0x4284b9){logger['info'](_0x635a('0x14'),_0x4475df);logger['debug'](_0x635a('0x14'),_0x4475df,JSON[_0x635a('0xe')](_0x4284b9));_0x556126(_0x4284b9);})['catch'](function(_0x5a1572){logger[_0x635a('0xf')](_0x635a('0x14'),_0x5a1572[_0x635a('0x11')],_0x4475df);_0x54678d(_0x3c1272[_0x635a('0xf')](0x1f4,_0x5a1572[_0x635a('0x11')]));});});};exports[_0x635a('0x1f')]=function(_0x37111e){var _0x5ca2b8=this;return new Promise(function(_0x55ddd1,_0x3927f4){return db[_0x635a('0x15')][_0x635a('0x20')]({'raw':_0x37111e[_0x635a('0x17')]?_0x37111e[_0x635a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37111e['options']?_0x37111e[_0x635a('0x17')][_0x635a('0x19')]||null:null,'attributes':_0x37111e[_0x635a('0x17')]?_0x37111e[_0x635a('0x17')][_0x635a('0x1a')]||null:null,'include':_0x37111e[_0x635a('0x17')]?_0x37111e['options'][_0x635a('0x1c')]?_['map'](_0x37111e[_0x635a('0x17')][_0x635a('0x1c')],function(_0x4e593d){return{'model':db[_0x4e593d['model']],'as':_0x4e593d['as'],'attributes':_0x4e593d[_0x635a('0x1a')],'include':_0x4e593d[_0x635a('0x1c')]?_['map'](_0x4e593d['include'],function(_0x586dbe){return{'model':db[_0x586dbe[_0x635a('0x1e')]],'as':_0x586dbe['as'],'attributes':_0x586dbe[_0x635a('0x1a')],'include':_0x586dbe[_0x635a('0x1c')]?_['map'](_0x586dbe['include'],function(_0x58f4a3){return{'model':db[_0x58f4a3[_0x635a('0x1e')]],'as':_0x58f4a3['as'],'attributes':_0x58f4a3[_0x635a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x635a('0x9')](function(_0x35fd5e){logger[_0x635a('0xa')]('ShowSalesforceAccount',_0x37111e);logger['debug']('ShowSalesforceAccount',_0x37111e,JSON['stringify'](_0x35fd5e));_0x55ddd1(_0x35fd5e);})[_0x635a('0x13')](function(_0x57161b){logger[_0x635a('0xf')](_0x635a('0x1f'),_0x57161b[_0x635a('0x11')],_0x37111e);_0x3927f4(_0x5ca2b8[_0x635a('0xf')](0x1f4,_0x57161b[_0x635a('0x11')]));});});}; \ No newline at end of file +var _0x32bb=['../../config/environment','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','model','map','then','catch','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3a5fa8,_0x3c733e){var _0x2566e6=function(_0x5c7bec){while(--_0x5c7bec){_0x3a5fa8['push'](_0x3a5fa8['shift']());}};_0x2566e6(++_0x3c733e);}(_0x32bb,0x87));var _0xb32b=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x32bb[_0x725b8e];return _0x43ac45;};'use strict';var _=require('lodash');var util=require(_0xb32b('0x0'));var moment=require(_0xb32b('0x1'));var BPromise=require(_0xb32b('0x2'));var rs=require(_0xb32b('0x3'));var fs=require('fs');var Redis=require(_0xb32b('0x4'));var db=require(_0xb32b('0x5'))['db'];var utils=require(_0xb32b('0x6'));var logger=require(_0xb32b('0x7'))(_0xb32b('0x8'));var config=require(_0xb32b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb32b('0xa')][_0xb32b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15951c,_0x119b5d,_0x3eefae){return new BPromise(function(_0x4ff2c5,_0x4c7e90){return client[_0xb32b('0xc')](_0x15951c,_0x3eefae)['then'](function(_0x26d6ff){logger['info'](_0xb32b('0xd'),_0x119b5d,_0xb32b('0xe'));logger[_0xb32b('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x119b5d,_0xb32b('0xe'),JSON[_0xb32b('0x10')](_0x26d6ff));if(_0x26d6ff['error']){if(_0x26d6ff[_0xb32b('0x11')][_0xb32b('0x12')]===0x1f4){logger['error'](_0xb32b('0xd'),_0x119b5d,_0x26d6ff['error']['message']);return _0x4c7e90(_0x26d6ff[_0xb32b('0x11')][_0xb32b('0x13')]);}logger['error'](_0xb32b('0xd'),_0x119b5d,_0x26d6ff[_0xb32b('0x11')]['message']);return _0x4ff2c5(_0x26d6ff['error'][_0xb32b('0x13')]);}else{logger[_0xb32b('0x14')](_0xb32b('0xd'),_0x119b5d,_0xb32b('0xe'));_0x4ff2c5(_0x26d6ff[_0xb32b('0x15')][_0xb32b('0x13')]);}})['catch'](function(_0x23a907){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x119b5d,_0x23a907);_0x4c7e90(_0x23a907);});});}exports[_0xb32b('0x16')]=function(_0xeb1b70){var _0xfdcc87=this;return new Promise(function(_0x973af1,_0x4bcd74){return db[_0xb32b('0x17')]['findAll']({'raw':_0xeb1b70[_0xb32b('0x18')]?_0xeb1b70[_0xb32b('0x18')][_0xb32b('0x19')]===undefined?!![]:![]:!![],'where':_0xeb1b70[_0xb32b('0x18')]?_0xeb1b70[_0xb32b('0x18')][_0xb32b('0x1a')]||null:null,'attributes':_0xeb1b70['options']?_0xeb1b70[_0xb32b('0x18')][_0xb32b('0x1b')]||null:null,'limit':_0xeb1b70[_0xb32b('0x18')]?_0xeb1b70['options'][_0xb32b('0x1c')]||null:null,'include':_0xeb1b70[_0xb32b('0x18')]?_0xeb1b70[_0xb32b('0x18')][_0xb32b('0x1d')]?_['map'](_0xeb1b70[_0xb32b('0x18')][_0xb32b('0x1d')],function(_0xc684f7){return{'model':db[_0xc684f7[_0xb32b('0x1e')]],'as':_0xc684f7['as'],'attributes':_0xc684f7[_0xb32b('0x1b')],'include':_0xc684f7['include']?_[_0xb32b('0x1f')](_0xc684f7[_0xb32b('0x1d')],function(_0x17963f){return{'model':db[_0x17963f[_0xb32b('0x1e')]],'as':_0x17963f['as'],'attributes':_0x17963f[_0xb32b('0x1b')],'include':_0x17963f[_0xb32b('0x1d')]?_['map'](_0x17963f['include'],function(_0x326ec1){return{'model':db[_0x326ec1[_0xb32b('0x1e')]],'as':_0x326ec1['as'],'attributes':_0x326ec1[_0xb32b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb32b('0x20')](function(_0x62997c){logger[_0xb32b('0x14')](_0xb32b('0x16'),_0xeb1b70);logger[_0xb32b('0xf')](_0xb32b('0x16'),_0xeb1b70,JSON[_0xb32b('0x10')](_0x62997c));_0x973af1(_0x62997c);})[_0xb32b('0x21')](function(_0x20061b){logger[_0xb32b('0x11')](_0xb32b('0x16'),_0x20061b['message'],_0xeb1b70);_0x4bcd74(_0xfdcc87[_0xb32b('0x11')](0x1f4,_0x20061b[_0xb32b('0x13')]));});});};exports[_0xb32b('0x22')]=function(_0x38c3ff){var _0x2c37e2=this;return new Promise(function(_0x3114d0,_0x5f4bca){return db['SalesforceAccount'][_0xb32b('0x23')]({'raw':_0x38c3ff[_0xb32b('0x18')]?_0x38c3ff[_0xb32b('0x18')][_0xb32b('0x19')]===undefined?!![]:![]:!![],'where':_0x38c3ff[_0xb32b('0x18')]?_0x38c3ff['options'][_0xb32b('0x1a')]||null:null,'attributes':_0x38c3ff[_0xb32b('0x18')]?_0x38c3ff[_0xb32b('0x18')][_0xb32b('0x1b')]||null:null,'include':_0x38c3ff['options']?_0x38c3ff[_0xb32b('0x18')][_0xb32b('0x1d')]?_[_0xb32b('0x1f')](_0x38c3ff[_0xb32b('0x18')][_0xb32b('0x1d')],function(_0x42850b){return{'model':db[_0x42850b[_0xb32b('0x1e')]],'as':_0x42850b['as'],'attributes':_0x42850b['attributes'],'include':_0x42850b[_0xb32b('0x1d')]?_['map'](_0x42850b['include'],function(_0x3d71ec){return{'model':db[_0x3d71ec[_0xb32b('0x1e')]],'as':_0x3d71ec['as'],'attributes':_0x3d71ec['attributes'],'include':_0x3d71ec[_0xb32b('0x1d')]?_[_0xb32b('0x1f')](_0x3d71ec['include'],function(_0x43533f){return{'model':db[_0x43533f[_0xb32b('0x1e')]],'as':_0x43533f['as'],'attributes':_0x43533f['attributes']};}):[]};}):[]};}):[]:[]})[_0xb32b('0x20')](function(_0x2fa35a){logger[_0xb32b('0x14')](_0xb32b('0x22'),_0x38c3ff);logger[_0xb32b('0xf')](_0xb32b('0x22'),_0x38c3ff,JSON['stringify'](_0x2fa35a));_0x3114d0(_0x2fa35a);})['catch'](function(_0x2a2a9f){logger[_0xb32b('0x11')](_0xb32b('0x22'),_0x2a2a9f['message'],_0x38c3ff);_0x5f4bca(_0x2c37e2[_0xb32b('0x11')](0x1f4,_0x2a2a9f[_0xb32b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 0860cfd..b0e879a 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x0b0e[_0x2afbb0];return _0x411ff2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5e949e,_0x1447fb){var _0x2b9d71=function(_0x4cfc93){while(--_0x4cfc93){_0x5e949e['push'](_0x5e949e['shift']());}};_0x2b9d71(++_0x1447fb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x33ca72,_0x38711f){_0x33ca72=_0x33ca72-0x0;var _0x120c96=_0x5f2f[_0x33ca72];return _0x120c96;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index ee74658..30149e4 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 _0x97be=['nothing','exports','STRING','ENUM','Case','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x363955,_0x598dcf){var _0x214d7f=function(_0x52857b){while(--_0x52857b){_0x363955['push'](_0x363955['shift']());}};_0x214d7f(++_0x598dcf);}(_0x97be,0x155));var _0xe97b=function(_0x240adc,_0x56a9cd){_0x240adc=_0x240adc-0x0;var _0x2c10d0=_0x97be[_0x240adc];return _0x2c10d0;};'use strict';var Sequelize=require('sequelize');module[_0xe97b('0x0')]={'name':{'type':Sequelize[_0xe97b('0x1')]},'description':{'type':Sequelize[_0xe97b('0x1')]},'ticketType':{'type':Sequelize[_0xe97b('0x2')]('Task',_0xe97b('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xe97b('0x2')](_0xe97b('0x4'),_0xe97b('0x5'),_0xe97b('0x6'),_0xe97b('0x7'),_0xe97b('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xe97b('0x2')](_0xe97b('0x9'),_0xe97b('0x5'),'lead',_0xe97b('0x8')),'defaultValue':_0xe97b('0x6')},'leadId':{'type':Sequelize[_0xe97b('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xe97b('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xe97b('0x1')]}}; \ No newline at end of file +var _0xc16f=['exports','STRING','ENUM','Task','contact','lead','account_contact_lead','account','contact_lead','nothing','sequelize'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xc16f,0xe6));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfc16('0x0'));module[_0xfc16('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfc16('0x2')]},'ticketType':{'type':Sequelize[_0xfc16('0x3')](_0xfc16('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xfc16('0x3')]('contact_lead',_0xfc16('0x5'),_0xfc16('0x6'),_0xfc16('0x7'),_0xfc16('0x8')),'defaultValue':_0xfc16('0x9')},'moduleCreate':{'type':Sequelize[_0xfc16('0x3')](_0xfc16('0xa'),_0xfc16('0x5'),_0xfc16('0x6'),_0xfc16('0x8')),'defaultValue':_0xfc16('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xfc16('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d39b923..be5715f 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 _0xfa5d=['send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','count','includeAll','include','catch','params','find','create','update','body','getFields','SalesforceField','getSubjects','findOne','getDescriptions','eml-format','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name'];(function(_0x1afcd3,_0x298004){var _0x46fd9e=function(_0x453127){while(--_0x453127){_0x1afcd3['push'](_0x1afcd3['shift']());}};_0x46fd9e(++_0x298004);}(_0xfa5d,0x19e));var _0xdfa5=function(_0x5a1161,_0x45b59b){_0x5a1161=_0x5a1161-0x0;var _0x29ff35=_0xfa5d[_0x5a1161];return _0x29ff35;};'use strict';var emlformat=require(_0xdfa5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfa5('0x1'));var moment=require(_0xdfa5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdfa5('0x3'));var path=require('path');var sox=require(_0xdfa5('0x4'));var csv=require(_0xdfa5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfa5('0x6'));var _=require('lodash');var squel=require(_0xdfa5('0x7'));var crypto=require(_0xdfa5('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xdfa5('0x9'));var toCsv=require('to-csv');var querystring=require(_0xdfa5('0xa'));var Papa=require(_0xdfa5('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa5('0xc'));var as=require(_0xdfa5('0xd'));var hardwareService=require(_0xdfa5('0xe'));var logger=require(_0xdfa5('0xf'))(_0xdfa5('0x10'));var utils=require(_0xdfa5('0x11'));var config=require(_0xdfa5('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dad71,_0x1df56b){_0x1df56b=_0x1df56b||0xcc;return function(_0x161ef2){if(_0x161ef2){return _0x3dad71[_0xdfa5('0x13')](_0x1df56b);}return _0x3dad71[_0xdfa5('0x14')](_0x1df56b)[_0xdfa5('0x15')]();};}function respondWithResult(_0x28ccf0,_0x240657){_0x240657=_0x240657||0xc8;return function(_0x3d5c9b){if(_0x3d5c9b){return _0x28ccf0[_0xdfa5('0x14')](_0x240657)[_0xdfa5('0x16')](_0x3d5c9b);}};}function respondWithFilteredResult(_0x48e6fc,_0x291ec2){return function(_0x1dc0e9){if(_0x1dc0e9){var _0x4d417e=typeof _0x291ec2[_0xdfa5('0x17')]===_0xdfa5('0x18')&&typeof _0x291ec2[_0xdfa5('0x19')]===_0xdfa5('0x18');var _0x3c9ca0=_0x1dc0e9['count'];var _0x2a98c4=_0x4d417e?0x0:_0x291ec2[_0xdfa5('0x17')];var _0xe8ba17=_0x4d417e?_0x1dc0e9['count']:_0x291ec2[_0xdfa5('0x17')]+_0x291ec2[_0xdfa5('0x19')];var _0x2b48f0;if(_0xe8ba17>=_0x3c9ca0){_0xe8ba17=_0x3c9ca0;_0x2b48f0=0xc8;}else{_0x2b48f0=0xce;}_0x48e6fc[_0xdfa5('0x14')](_0x2b48f0);return _0x48e6fc[_0xdfa5('0x1a')](_0xdfa5('0x1b'),_0x2a98c4+'-'+_0xe8ba17+'/'+_0x3c9ca0)[_0xdfa5('0x16')](_0x1dc0e9);}return null;};}function patchUpdates(_0x1dbe1e){return function(_0x551908){try{jsonpatch[_0xdfa5('0x1c')](_0x551908,_0x1dbe1e,!![]);}catch(_0x36ecbe){return BPromise[_0xdfa5('0x1d')](_0x36ecbe);}return _0x551908[_0xdfa5('0x1e')]();};}function saveUpdates(_0x46e49a,_0x49bad7){return function(_0xfc092b){if(_0xfc092b){return _0xfc092b['update'](_0x46e49a)[_0xdfa5('0x1f')](function(_0xe5eca1){return _0xe5eca1;});}return null;};}function removeEntity(_0x251656,_0xdb656e){return function(_0x428147){if(_0x428147){return _0x428147[_0xdfa5('0x20')]()[_0xdfa5('0x1f')](function(){_0x251656[_0xdfa5('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ce4f,_0x2c2497){return function(_0x2307cf){if(!_0x2307cf){_0x25ce4f['sendStatus'](0x194);}return _0x2307cf;};}function handleError(_0x1b7c20,_0xdeed53){_0xdeed53=_0xdeed53||0x1f4;return function(_0x41340f){logger[_0xdfa5('0x21')](_0x41340f[_0xdfa5('0x22')]);if(_0x41340f[_0xdfa5('0x23')]){delete _0x41340f[_0xdfa5('0x23')];}_0x1b7c20[_0xdfa5('0x14')](_0xdeed53)[_0xdfa5('0x24')](_0x41340f);};}exports[_0xdfa5('0x25')]=function(_0x1ec03a,_0x97be2f){var _0x34121a={},_0x503191={},_0x2564f0={'count':0x0,'rows':[]};var _0x5ef372=_['map'](db[_0xdfa5('0x26')][_0xdfa5('0x27')],function(_0x3cca04){return{'name':_0x3cca04[_0xdfa5('0x28')],'type':_0x3cca04[_0xdfa5('0x29')][_0xdfa5('0x2a')]};});_0x503191[_0xdfa5('0x2b')]=_[_0xdfa5('0x2c')](_0x5ef372,_0xdfa5('0x23'));_0x503191['query']=_[_0xdfa5('0x2d')](_0x1ec03a[_0xdfa5('0x2e')]);_0x503191[_0xdfa5('0x2f')]=_[_0xdfa5('0x30')](_0x503191[_0xdfa5('0x2b')],_0x503191['query']);_0x34121a['attributes']=_[_0xdfa5('0x30')](_0x503191[_0xdfa5('0x2b')],qs[_0xdfa5('0x31')](_0x1ec03a[_0xdfa5('0x2e')]['fields']));_0x34121a['attributes']=_0x34121a['attributes'][_0xdfa5('0x32')]?_0x34121a[_0xdfa5('0x33')]:_0x503191[_0xdfa5('0x2b')];if(!_0x1ec03a[_0xdfa5('0x2e')][_0xdfa5('0x34')](_0xdfa5('0x35'))){_0x34121a[_0xdfa5('0x19')]=qs[_0xdfa5('0x19')](_0x1ec03a[_0xdfa5('0x2e')]['limit']);_0x34121a[_0xdfa5('0x17')]=qs[_0xdfa5('0x17')](_0x1ec03a[_0xdfa5('0x2e')][_0xdfa5('0x17')]);}_0x34121a[_0xdfa5('0x36')]=qs[_0xdfa5('0x37')](_0x1ec03a[_0xdfa5('0x2e')]['sort']);_0x34121a['where']=qs[_0xdfa5('0x2f')](_[_0xdfa5('0x38')](_0x1ec03a[_0xdfa5('0x2e')],_0x503191[_0xdfa5('0x2f')]),_0x5ef372);if(_0x1ec03a[_0xdfa5('0x2e')][_0xdfa5('0x39')]){_0x34121a['where']=_[_0xdfa5('0x3a')](_0x34121a[_0xdfa5('0x3b')],{'$or':_[_0xdfa5('0x2c')](_0x5ef372,function(_0x242c4c){if(_0x242c4c[_0xdfa5('0x29')]!=='VIRTUAL'){var _0x407776={};_0x407776[_0x242c4c[_0xdfa5('0x23')]]={'$like':'%'+_0x1ec03a[_0xdfa5('0x2e')][_0xdfa5('0x39')]+'%'};return _0x407776;}})});}_0x34121a=_['merge']({},_0x34121a,_0x1ec03a[_0xdfa5('0x3c')]);var _0x5d65a4={'where':_0x34121a[_0xdfa5('0x3b')]};return db[_0xdfa5('0x26')][_0xdfa5('0x3d')](_0x5d65a4)[_0xdfa5('0x1f')](function(_0x4ebd53){_0x2564f0['count']=_0x4ebd53;if(_0x1ec03a[_0xdfa5('0x2e')][_0xdfa5('0x3e')]){_0x34121a[_0xdfa5('0x3f')]=[{'all':!![]}];}return db[_0xdfa5('0x26')]['findAll'](_0x34121a);})[_0xdfa5('0x1f')](function(_0x77c358){_0x2564f0['rows']=_0x77c358;return _0x2564f0;})[_0xdfa5('0x1f')](respondWithFilteredResult(_0x97be2f,_0x34121a))[_0xdfa5('0x40')](handleError(_0x97be2f,null));};exports['show']=function(_0x33db51,_0x2f9289){var _0x380982={'raw':![],'where':{'id':_0x33db51[_0xdfa5('0x41')]['id']}},_0x4f3969={};_0x4f3969['model']=_[_0xdfa5('0x2d')](db[_0xdfa5('0x26')][_0xdfa5('0x27')]);_0x4f3969[_0xdfa5('0x2e')]=_[_0xdfa5('0x2d')](_0x33db51[_0xdfa5('0x2e')]);_0x4f3969['filters']=_['intersection'](_0x4f3969[_0xdfa5('0x2b')],_0x4f3969[_0xdfa5('0x2e')]);_0x380982['attributes']=_['intersection'](_0x4f3969[_0xdfa5('0x2b')],qs[_0xdfa5('0x31')](_0x33db51[_0xdfa5('0x2e')][_0xdfa5('0x31')]));_0x380982[_0xdfa5('0x33')]=_0x380982['attributes'][_0xdfa5('0x32')]?_0x380982[_0xdfa5('0x33')]:_0x4f3969['model'];if(_0x33db51[_0xdfa5('0x2e')][_0xdfa5('0x3e')]){_0x380982['include']=[{'all':!![]}];}_0x380982=_[_0xdfa5('0x3a')]({},_0x380982,_0x33db51[_0xdfa5('0x3c')]);return db[_0xdfa5('0x26')][_0xdfa5('0x42')](_0x380982)[_0xdfa5('0x1f')](handleEntityNotFound(_0x2f9289,null))[_0xdfa5('0x1f')](respondWithResult(_0x2f9289,null))[_0xdfa5('0x40')](handleError(_0x2f9289,null));};exports['create']=function(_0x34d399,_0x7d30be){return db[_0xdfa5('0x26')][_0xdfa5('0x43')](_0x34d399['body'],{})[_0xdfa5('0x1f')](respondWithResult(_0x7d30be,0xc9))[_0xdfa5('0x40')](handleError(_0x7d30be,null));};exports[_0xdfa5('0x44')]=function(_0x41447b,_0x173479){if(_0x41447b[_0xdfa5('0x45')]['id']){delete _0x41447b['body']['id'];}return db['SalesforceConfiguration'][_0xdfa5('0x42')]({'where':{'id':_0x41447b[_0xdfa5('0x41')]['id']}})[_0xdfa5('0x1f')](handleEntityNotFound(_0x173479,null))[_0xdfa5('0x1f')](saveUpdates(_0x41447b[_0xdfa5('0x45')],null))[_0xdfa5('0x1f')](respondWithResult(_0x173479,null))['catch'](handleError(_0x173479,null));};exports['destroy']=function(_0x27de3d,_0x18b7a3){return db[_0xdfa5('0x26')][_0xdfa5('0x42')]({'where':{'id':_0x27de3d[_0xdfa5('0x41')]['id']}})['then'](handleEntityNotFound(_0x18b7a3,null))['then'](removeEntity(_0x18b7a3,null))['catch'](handleError(_0x18b7a3,null));};exports[_0xdfa5('0x46')]=function(_0x129959,_0x4fee6e,_0x4a849e){var _0x2fa238={};var _0x2eae00={};var _0x581656;var _0x327075;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x129959[_0xdfa5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fee6e,null))[_0xdfa5('0x1f')](function(_0x880a5a){if(_0x880a5a){_0x581656=_0x880a5a;_0x2eae00[_0xdfa5('0x2b')]=_['keys'](db[_0xdfa5('0x47')][_0xdfa5('0x27')]);_0x2eae00[_0xdfa5('0x2e')]=_[_0xdfa5('0x2d')](_0x129959['query']);_0x2eae00[_0xdfa5('0x2f')]=_[_0xdfa5('0x30')](_0x2eae00[_0xdfa5('0x2b')],_0x2eae00['query']);_0x2fa238[_0xdfa5('0x33')]=_['intersection'](_0x2eae00[_0xdfa5('0x2b')],qs['fields'](_0x129959['query'][_0xdfa5('0x31')]));_0x2fa238[_0xdfa5('0x33')]=_0x2fa238[_0xdfa5('0x33')][_0xdfa5('0x32')]?_0x2fa238['attributes']:_0x2eae00[_0xdfa5('0x2b')];_0x2fa238[_0xdfa5('0x36')]=qs['sort'](_0x129959[_0xdfa5('0x2e')]['sort']);_0x2fa238[_0xdfa5('0x3b')]=qs[_0xdfa5('0x2f')](_[_0xdfa5('0x38')](_0x129959[_0xdfa5('0x2e')],_0x2eae00[_0xdfa5('0x2f')]));if(_0x129959[_0xdfa5('0x2e')]['filter']){_0x2fa238['where']=_[_0xdfa5('0x3a')](_0x2fa238[_0xdfa5('0x3b')],{'$or':_[_0xdfa5('0x2c')](_0x2fa238['attributes'],function(_0x2ec612){var _0x58a174={};_0x58a174[_0x2ec612]={'$like':'%'+_0x129959[_0xdfa5('0x2e')][_0xdfa5('0x39')]+'%'};return _0x58a174;})});}_0x2fa238=_[_0xdfa5('0x3a')]({},_0x2fa238,_0x129959[_0xdfa5('0x3c')]);return _0x581656[_0xdfa5('0x46')](_0x2fa238);}})[_0xdfa5('0x1f')](function(_0x24e42e){if(_0x24e42e){_0x327075=_0x24e42e[_0xdfa5('0x32')];if(!_0x129959[_0xdfa5('0x2e')]['hasOwnProperty']('nolimit')){_0x2fa238['limit']=qs[_0xdfa5('0x19')](_0x129959[_0xdfa5('0x2e')][_0xdfa5('0x19')]);_0x2fa238[_0xdfa5('0x17')]=qs[_0xdfa5('0x17')](_0x129959['query'][_0xdfa5('0x17')]);}return _0x581656[_0xdfa5('0x46')](_0x2fa238);}})[_0xdfa5('0x1f')](function(_0x19bef1){if(_0x19bef1){return _0x19bef1?{'count':_0x327075,'rows':_0x19bef1}:null;}})[_0xdfa5('0x1f')](respondWithResult(_0x4fee6e,null))[_0xdfa5('0x40')](handleError(_0x4fee6e,null));};exports[_0xdfa5('0x48')]=function(_0x1b7390,_0x5d61a1,_0x503d5e){var _0x3530fe={};var _0x542606={};var _0x492eb2;var _0x2ec91a;return db[_0xdfa5('0x26')][_0xdfa5('0x49')]({'where':{'id':_0x1b7390[_0xdfa5('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d61a1,null))[_0xdfa5('0x1f')](function(_0x212b1d){if(_0x212b1d){_0x492eb2=_0x212b1d;_0x542606[_0xdfa5('0x2b')]=_[_0xdfa5('0x2d')](db[_0xdfa5('0x47')]['rawAttributes']);_0x542606[_0xdfa5('0x2e')]=_[_0xdfa5('0x2d')](_0x1b7390[_0xdfa5('0x2e')]);_0x542606[_0xdfa5('0x2f')]=_[_0xdfa5('0x30')](_0x542606[_0xdfa5('0x2b')],_0x542606['query']);_0x3530fe[_0xdfa5('0x33')]=_[_0xdfa5('0x30')](_0x542606[_0xdfa5('0x2b')],qs[_0xdfa5('0x31')](_0x1b7390[_0xdfa5('0x2e')][_0xdfa5('0x31')]));_0x3530fe[_0xdfa5('0x33')]=_0x3530fe['attributes'][_0xdfa5('0x32')]?_0x3530fe['attributes']:_0x542606[_0xdfa5('0x2b')];_0x3530fe[_0xdfa5('0x36')]=qs[_0xdfa5('0x37')](_0x1b7390['query']['sort']);_0x3530fe[_0xdfa5('0x3b')]=qs['filters'](_[_0xdfa5('0x38')](_0x1b7390[_0xdfa5('0x2e')],_0x542606['filters']));if(_0x1b7390[_0xdfa5('0x2e')][_0xdfa5('0x39')]){_0x3530fe[_0xdfa5('0x3b')]=_['merge'](_0x3530fe[_0xdfa5('0x3b')],{'$or':_[_0xdfa5('0x2c')](_0x3530fe[_0xdfa5('0x33')],function(_0x2a4911){var _0x461fb0={};_0x461fb0[_0x2a4911]={'$like':'%'+_0x1b7390['query'][_0xdfa5('0x39')]+'%'};return _0x461fb0;})});}_0x3530fe=_['merge']({},_0x3530fe,_0x1b7390[_0xdfa5('0x3c')]);return _0x492eb2[_0xdfa5('0x48')](_0x3530fe);}})[_0xdfa5('0x1f')](function(_0x55bd13){if(_0x55bd13){_0x2ec91a=_0x55bd13[_0xdfa5('0x32')];if(!_0x1b7390[_0xdfa5('0x2e')]['hasOwnProperty'](_0xdfa5('0x35'))){_0x3530fe['limit']=qs[_0xdfa5('0x19')](_0x1b7390['query']['limit']);_0x3530fe[_0xdfa5('0x17')]=qs[_0xdfa5('0x17')](_0x1b7390[_0xdfa5('0x2e')][_0xdfa5('0x17')]);}return _0x492eb2[_0xdfa5('0x48')](_0x3530fe);}})[_0xdfa5('0x1f')](function(_0x226279){if(_0x226279){return _0x226279?{'count':_0x2ec91a,'rows':_0x226279}:null;}})[_0xdfa5('0x1f')](respondWithResult(_0x5d61a1,null))['catch'](handleError(_0x5d61a1,null));};exports['getDescriptions']=function(_0x49d8fd,_0x2c7a47,_0x2ff6ac){var _0x54be4a={};var _0x40ba16={};var _0x35b92c;var _0x41d96e;return db[_0xdfa5('0x26')][_0xdfa5('0x49')]({'where':{'id':_0x49d8fd[_0xdfa5('0x41')]['id']}})[_0xdfa5('0x1f')](handleEntityNotFound(_0x2c7a47,null))[_0xdfa5('0x1f')](function(_0x48321f){if(_0x48321f){_0x35b92c=_0x48321f;_0x40ba16[_0xdfa5('0x2b')]=_[_0xdfa5('0x2d')](db[_0xdfa5('0x47')][_0xdfa5('0x27')]);_0x40ba16[_0xdfa5('0x2e')]=_[_0xdfa5('0x2d')](_0x49d8fd[_0xdfa5('0x2e')]);_0x40ba16[_0xdfa5('0x2f')]=_[_0xdfa5('0x30')](_0x40ba16[_0xdfa5('0x2b')],_0x40ba16[_0xdfa5('0x2e')]);_0x54be4a[_0xdfa5('0x33')]=_[_0xdfa5('0x30')](_0x40ba16['model'],qs[_0xdfa5('0x31')](_0x49d8fd[_0xdfa5('0x2e')][_0xdfa5('0x31')]));_0x54be4a[_0xdfa5('0x33')]=_0x54be4a[_0xdfa5('0x33')][_0xdfa5('0x32')]?_0x54be4a['attributes']:_0x40ba16[_0xdfa5('0x2b')];_0x54be4a['order']=qs[_0xdfa5('0x37')](_0x49d8fd[_0xdfa5('0x2e')][_0xdfa5('0x37')]);_0x54be4a[_0xdfa5('0x3b')]=qs[_0xdfa5('0x2f')](_['pick'](_0x49d8fd[_0xdfa5('0x2e')],_0x40ba16[_0xdfa5('0x2f')]));if(_0x49d8fd[_0xdfa5('0x2e')][_0xdfa5('0x39')]){_0x54be4a[_0xdfa5('0x3b')]=_['merge'](_0x54be4a['where'],{'$or':_[_0xdfa5('0x2c')](_0x54be4a['attributes'],function(_0x3bee17){var _0x568c39={};_0x568c39[_0x3bee17]={'$like':'%'+_0x49d8fd[_0xdfa5('0x2e')][_0xdfa5('0x39')]+'%'};return _0x568c39;})});}_0x54be4a=_[_0xdfa5('0x3a')]({},_0x54be4a,_0x49d8fd[_0xdfa5('0x3c')]);return _0x35b92c[_0xdfa5('0x4a')](_0x54be4a);}})[_0xdfa5('0x1f')](function(_0x3383b3){if(_0x3383b3){_0x41d96e=_0x3383b3[_0xdfa5('0x32')];if(!_0x49d8fd['query'][_0xdfa5('0x34')]('nolimit')){_0x54be4a[_0xdfa5('0x19')]=qs[_0xdfa5('0x19')](_0x49d8fd[_0xdfa5('0x2e')][_0xdfa5('0x19')]);_0x54be4a[_0xdfa5('0x17')]=qs[_0xdfa5('0x17')](_0x49d8fd[_0xdfa5('0x2e')]['offset']);}return _0x35b92c[_0xdfa5('0x4a')](_0x54be4a);}})[_0xdfa5('0x1f')](function(_0x1f439d){if(_0x1f439d){return _0x1f439d?{'count':_0x41d96e,'rows':_0x1f439d}:null;}})[_0xdfa5('0x1f')](respondWithResult(_0x2c7a47,null))[_0xdfa5('0x40')](handleError(_0x2c7a47,null));}; \ No newline at end of file +var _0xa8ad=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','map','SalesforceConfiguration','rawAttributes','fieldName'];(function(_0x59f5c8,_0x37651a){var _0x56d65c=function(_0x728324){while(--_0x728324){_0x59f5c8['push'](_0x59f5c8['shift']());}};_0x56d65c(++_0x37651a);}(_0xa8ad,0x10c));var _0xda8a=function(_0x2ab4e4,_0x4193e6){_0x2ab4e4=_0x2ab4e4-0x0;var _0x510696=_0xa8ad[_0x2ab4e4];return _0x510696;};'use strict';var emlformat=require(_0xda8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xda8a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda8a('0x3'));var path=require(_0xda8a('0x4'));var sox=require(_0xda8a('0x5'));var csv=require(_0xda8a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda8a('0x7'));var _=require(_0xda8a('0x8'));var squel=require(_0xda8a('0x9'));var crypto=require(_0xda8a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda8a('0xb'));var Papa=require(_0xda8a('0xc'));var Redis=require(_0xda8a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xda8a('0xe'));var as=require(_0xda8a('0xf'));var hardwareService=require(_0xda8a('0x10'));var logger=require(_0xda8a('0x11'))('api');var utils=require(_0xda8a('0x12'));var config=require(_0xda8a('0x13'));var licenseUtil=require(_0xda8a('0x14'));var db=require(_0xda8a('0x15'))['db'];function respondWithStatusCode(_0x23522c,_0x4ca84a){_0x4ca84a=_0x4ca84a||0xcc;return function(_0x211494){if(_0x211494){return _0x23522c['sendStatus'](_0x4ca84a);}return _0x23522c['status'](_0x4ca84a)[_0xda8a('0x16')]();};}function respondWithResult(_0x2953af,_0x40bff1){_0x40bff1=_0x40bff1||0xc8;return function(_0x13efc6){if(_0x13efc6){return _0x2953af[_0xda8a('0x17')](_0x40bff1)['json'](_0x13efc6);}};}function respondWithFilteredResult(_0x4cba3e,_0x3c7101){return function(_0x1c320f){if(_0x1c320f){var _0x542c19=typeof _0x3c7101[_0xda8a('0x18')]===_0xda8a('0x19')&&typeof _0x3c7101[_0xda8a('0x1a')]===_0xda8a('0x19');var _0x3a3317=_0x1c320f[_0xda8a('0x1b')];var _0x3b9e43=_0x542c19?0x0:_0x3c7101[_0xda8a('0x18')];var _0x1769ac=_0x542c19?_0x1c320f[_0xda8a('0x1b')]:_0x3c7101[_0xda8a('0x18')]+_0x3c7101['limit'];var _0x127ebf;if(_0x1769ac>=_0x3a3317){_0x1769ac=_0x3a3317;_0x127ebf=0xc8;}else{_0x127ebf=0xce;}_0x4cba3e['status'](_0x127ebf);return _0x4cba3e[_0xda8a('0x1c')](_0xda8a('0x1d'),_0x3b9e43+'-'+_0x1769ac+'/'+_0x3a3317)[_0xda8a('0x1e')](_0x1c320f);}return null;};}function patchUpdates(_0x215a73){return function(_0x23cba9){try{jsonpatch['apply'](_0x23cba9,_0x215a73,!![]);}catch(_0x273260){return BPromise[_0xda8a('0x1f')](_0x273260);}return _0x23cba9[_0xda8a('0x20')]();};}function saveUpdates(_0x565f3d,_0x288d7c){return function(_0x175cd3){if(_0x175cd3){return _0x175cd3[_0xda8a('0x21')](_0x565f3d)[_0xda8a('0x22')](function(_0x503cc2){return _0x503cc2;});}return null;};}function removeEntity(_0x24b0ff,_0x60636d){return function(_0x3718ac){if(_0x3718ac){return _0x3718ac[_0xda8a('0x23')]()['then'](function(){_0x24b0ff[_0xda8a('0x17')](0xcc)[_0xda8a('0x16')]();});}};}function handleEntityNotFound(_0x1454f3,_0x2e391d){return function(_0x3b87fb){if(!_0x3b87fb){_0x1454f3[_0xda8a('0x24')](0x194);}return _0x3b87fb;};}function handleError(_0x3c6e3f,_0x47d618){_0x47d618=_0x47d618||0x1f4;return function(_0x29c107){logger[_0xda8a('0x25')](_0x29c107['stack']);if(_0x29c107['name']){delete _0x29c107[_0xda8a('0x26')];}_0x3c6e3f['status'](_0x47d618)[_0xda8a('0x27')](_0x29c107);};}exports['index']=function(_0x5325b8,_0x220216){var _0x3e49ec={},_0x4a7d55={},_0x5c9f2b={'count':0x0,'rows':[]};var _0x44818d=_[_0xda8a('0x28')](db[_0xda8a('0x29')][_0xda8a('0x2a')],function(_0x4d9af8){return{'name':_0x4d9af8[_0xda8a('0x2b')],'type':_0x4d9af8[_0xda8a('0x2c')][_0xda8a('0x2d')]};});_0x4a7d55[_0xda8a('0x2e')]=_[_0xda8a('0x28')](_0x44818d,'name');_0x4a7d55[_0xda8a('0x2f')]=_[_0xda8a('0x30')](_0x5325b8[_0xda8a('0x2f')]);_0x4a7d55[_0xda8a('0x31')]=_[_0xda8a('0x32')](_0x4a7d55[_0xda8a('0x2e')],_0x4a7d55['query']);_0x3e49ec[_0xda8a('0x33')]=_['intersection'](_0x4a7d55[_0xda8a('0x2e')],qs[_0xda8a('0x34')](_0x5325b8['query'][_0xda8a('0x34')]));_0x3e49ec[_0xda8a('0x33')]=_0x3e49ec[_0xda8a('0x33')][_0xda8a('0x35')]?_0x3e49ec[_0xda8a('0x33')]:_0x4a7d55[_0xda8a('0x2e')];if(!_0x5325b8['query'][_0xda8a('0x36')](_0xda8a('0x37'))){_0x3e49ec['limit']=qs['limit'](_0x5325b8[_0xda8a('0x2f')][_0xda8a('0x1a')]);_0x3e49ec[_0xda8a('0x18')]=qs[_0xda8a('0x18')](_0x5325b8['query'][_0xda8a('0x18')]);}_0x3e49ec[_0xda8a('0x38')]=qs[_0xda8a('0x39')](_0x5325b8[_0xda8a('0x2f')][_0xda8a('0x39')]);_0x3e49ec[_0xda8a('0x3a')]=qs[_0xda8a('0x31')](_[_0xda8a('0x3b')](_0x5325b8[_0xda8a('0x2f')],_0x4a7d55[_0xda8a('0x31')]),_0x44818d);if(_0x5325b8[_0xda8a('0x2f')][_0xda8a('0x3c')]){_0x3e49ec['where']=_['merge'](_0x3e49ec['where'],{'$or':_[_0xda8a('0x28')](_0x44818d,function(_0x1e9dea){if(_0x1e9dea[_0xda8a('0x2c')]!=='VIRTUAL'){var _0x17b563={};_0x17b563[_0x1e9dea[_0xda8a('0x26')]]={'$like':'%'+_0x5325b8[_0xda8a('0x2f')][_0xda8a('0x3c')]+'%'};return _0x17b563;}})});}_0x3e49ec=_['merge']({},_0x3e49ec,_0x5325b8[_0xda8a('0x3d')]);var _0x1ec829={'where':_0x3e49ec[_0xda8a('0x3a')]};return db['SalesforceConfiguration'][_0xda8a('0x1b')](_0x1ec829)['then'](function(_0x38ac0c){_0x5c9f2b[_0xda8a('0x1b')]=_0x38ac0c;if(_0x5325b8[_0xda8a('0x2f')][_0xda8a('0x3e')]){_0x3e49ec[_0xda8a('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xda8a('0x40')](_0x3e49ec);})[_0xda8a('0x22')](function(_0x1b2cad){_0x5c9f2b[_0xda8a('0x41')]=_0x1b2cad;return _0x5c9f2b;})['then'](respondWithFilteredResult(_0x220216,_0x3e49ec))[_0xda8a('0x42')](handleError(_0x220216,null));};exports[_0xda8a('0x43')]=function(_0x33a364,_0x25a125){var _0x2a558d={'raw':![],'where':{'id':_0x33a364[_0xda8a('0x44')]['id']}},_0xfb1cb7={};_0xfb1cb7[_0xda8a('0x2e')]=_[_0xda8a('0x30')](db['SalesforceConfiguration']['rawAttributes']);_0xfb1cb7['query']=_['keys'](_0x33a364[_0xda8a('0x2f')]);_0xfb1cb7[_0xda8a('0x31')]=_['intersection'](_0xfb1cb7[_0xda8a('0x2e')],_0xfb1cb7[_0xda8a('0x2f')]);_0x2a558d[_0xda8a('0x33')]=_[_0xda8a('0x32')](_0xfb1cb7[_0xda8a('0x2e')],qs[_0xda8a('0x34')](_0x33a364['query'][_0xda8a('0x34')]));_0x2a558d[_0xda8a('0x33')]=_0x2a558d[_0xda8a('0x33')][_0xda8a('0x35')]?_0x2a558d[_0xda8a('0x33')]:_0xfb1cb7[_0xda8a('0x2e')];if(_0x33a364[_0xda8a('0x2f')]['includeAll']){_0x2a558d[_0xda8a('0x3f')]=[{'all':!![]}];}_0x2a558d=_[_0xda8a('0x45')]({},_0x2a558d,_0x33a364[_0xda8a('0x3d')]);return db[_0xda8a('0x29')][_0xda8a('0x46')](_0x2a558d)['then'](handleEntityNotFound(_0x25a125,null))[_0xda8a('0x22')](respondWithResult(_0x25a125,null))[_0xda8a('0x42')](handleError(_0x25a125,null));};exports[_0xda8a('0x47')]=function(_0x344319,_0x5d4efa){return db[_0xda8a('0x29')][_0xda8a('0x47')](_0x344319['body'],{})['then'](respondWithResult(_0x5d4efa,0xc9))[_0xda8a('0x42')](handleError(_0x5d4efa,null));};exports[_0xda8a('0x21')]=function(_0x52b958,_0xfcb208){if(_0x52b958[_0xda8a('0x48')]['id']){delete _0x52b958[_0xda8a('0x48')]['id'];}return db['SalesforceConfiguration'][_0xda8a('0x46')]({'where':{'id':_0x52b958[_0xda8a('0x44')]['id']}})[_0xda8a('0x22')](handleEntityNotFound(_0xfcb208,null))['then'](saveUpdates(_0x52b958[_0xda8a('0x48')],null))['then'](respondWithResult(_0xfcb208,null))[_0xda8a('0x42')](handleError(_0xfcb208,null));};exports['destroy']=function(_0x71f7ca,_0x3338df){return db[_0xda8a('0x29')]['find']({'where':{'id':_0x71f7ca[_0xda8a('0x44')]['id']}})[_0xda8a('0x22')](handleEntityNotFound(_0x3338df,null))[_0xda8a('0x22')](removeEntity(_0x3338df,null))[_0xda8a('0x42')](handleError(_0x3338df,null));};exports['getFields']=function(_0x4b2408,_0xfa8ba4,_0xec4299){var _0x595899={};var _0x5cd4ba={};var _0x35b58f;var _0x5ecce8;return db[_0xda8a('0x29')][_0xda8a('0x49')]({'where':{'id':_0x4b2408['params']['id']}})[_0xda8a('0x22')](handleEntityNotFound(_0xfa8ba4,null))[_0xda8a('0x22')](function(_0x255bfd){if(_0x255bfd){_0x35b58f=_0x255bfd;_0x5cd4ba[_0xda8a('0x2e')]=_[_0xda8a('0x30')](db[_0xda8a('0x4a')]['rawAttributes']);_0x5cd4ba[_0xda8a('0x2f')]=_[_0xda8a('0x30')](_0x4b2408['query']);_0x5cd4ba['filters']=_[_0xda8a('0x32')](_0x5cd4ba['model'],_0x5cd4ba[_0xda8a('0x2f')]);_0x595899[_0xda8a('0x33')]=_[_0xda8a('0x32')](_0x5cd4ba[_0xda8a('0x2e')],qs[_0xda8a('0x34')](_0x4b2408[_0xda8a('0x2f')][_0xda8a('0x34')]));_0x595899[_0xda8a('0x33')]=_0x595899[_0xda8a('0x33')][_0xda8a('0x35')]?_0x595899[_0xda8a('0x33')]:_0x5cd4ba[_0xda8a('0x2e')];_0x595899[_0xda8a('0x38')]=qs['sort'](_0x4b2408['query'][_0xda8a('0x39')]);_0x595899[_0xda8a('0x3a')]=qs['filters'](_[_0xda8a('0x3b')](_0x4b2408[_0xda8a('0x2f')],_0x5cd4ba['filters']));if(_0x4b2408[_0xda8a('0x2f')][_0xda8a('0x3c')]){_0x595899[_0xda8a('0x3a')]=_[_0xda8a('0x45')](_0x595899['where'],{'$or':_['map'](_0x595899['attributes'],function(_0x464a72){var _0x19392c={};_0x19392c[_0x464a72]={'$like':'%'+_0x4b2408[_0xda8a('0x2f')][_0xda8a('0x3c')]+'%'};return _0x19392c;})});}_0x595899=_[_0xda8a('0x45')]({},_0x595899,_0x4b2408[_0xda8a('0x3d')]);return _0x35b58f['getFields'](_0x595899);}})['then'](function(_0x587775){if(_0x587775){_0x5ecce8=_0x587775['length'];if(!_0x4b2408[_0xda8a('0x2f')][_0xda8a('0x36')]('nolimit')){_0x595899[_0xda8a('0x1a')]=qs[_0xda8a('0x1a')](_0x4b2408[_0xda8a('0x2f')]['limit']);_0x595899[_0xda8a('0x18')]=qs[_0xda8a('0x18')](_0x4b2408[_0xda8a('0x2f')][_0xda8a('0x18')]);}return _0x35b58f[_0xda8a('0x4b')](_0x595899);}})[_0xda8a('0x22')](function(_0xd9d035){if(_0xd9d035){return _0xd9d035?{'count':_0x5ecce8,'rows':_0xd9d035}:null;}})['then'](respondWithResult(_0xfa8ba4,null))[_0xda8a('0x42')](handleError(_0xfa8ba4,null));};exports['getSubjects']=function(_0x4476c6,_0x1e0cf4,_0x2f8ec4){var _0x38292f={};var _0x17c997={};var _0x45d8bb;var _0x2e2bff;return db[_0xda8a('0x29')][_0xda8a('0x49')]({'where':{'id':_0x4476c6[_0xda8a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e0cf4,null))['then'](function(_0x4b6ee0){if(_0x4b6ee0){_0x45d8bb=_0x4b6ee0;_0x17c997[_0xda8a('0x2e')]=_[_0xda8a('0x30')](db[_0xda8a('0x4a')]['rawAttributes']);_0x17c997['query']=_['keys'](_0x4476c6[_0xda8a('0x2f')]);_0x17c997[_0xda8a('0x31')]=_[_0xda8a('0x32')](_0x17c997[_0xda8a('0x2e')],_0x17c997['query']);_0x38292f[_0xda8a('0x33')]=_[_0xda8a('0x32')](_0x17c997[_0xda8a('0x2e')],qs['fields'](_0x4476c6['query']['fields']));_0x38292f[_0xda8a('0x33')]=_0x38292f[_0xda8a('0x33')][_0xda8a('0x35')]?_0x38292f[_0xda8a('0x33')]:_0x17c997['model'];_0x38292f[_0xda8a('0x38')]=qs[_0xda8a('0x39')](_0x4476c6[_0xda8a('0x2f')][_0xda8a('0x39')]);_0x38292f[_0xda8a('0x3a')]=qs[_0xda8a('0x31')](_['pick'](_0x4476c6[_0xda8a('0x2f')],_0x17c997[_0xda8a('0x31')]));if(_0x4476c6[_0xda8a('0x2f')][_0xda8a('0x3c')]){_0x38292f[_0xda8a('0x3a')]=_[_0xda8a('0x45')](_0x38292f['where'],{'$or':_[_0xda8a('0x28')](_0x38292f['attributes'],function(_0x5d84a5){var _0x4dfe57={};_0x4dfe57[_0x5d84a5]={'$like':'%'+_0x4476c6[_0xda8a('0x2f')][_0xda8a('0x3c')]+'%'};return _0x4dfe57;})});}_0x38292f=_['merge']({},_0x38292f,_0x4476c6[_0xda8a('0x3d')]);return _0x45d8bb[_0xda8a('0x4c')](_0x38292f);}})[_0xda8a('0x22')](function(_0x40648a){if(_0x40648a){_0x2e2bff=_0x40648a[_0xda8a('0x35')];if(!_0x4476c6['query'][_0xda8a('0x36')](_0xda8a('0x37'))){_0x38292f[_0xda8a('0x1a')]=qs[_0xda8a('0x1a')](_0x4476c6[_0xda8a('0x2f')][_0xda8a('0x1a')]);_0x38292f[_0xda8a('0x18')]=qs[_0xda8a('0x18')](_0x4476c6[_0xda8a('0x2f')][_0xda8a('0x18')]);}return _0x45d8bb[_0xda8a('0x4c')](_0x38292f);}})['then'](function(_0x30da03){if(_0x30da03){return _0x30da03?{'count':_0x2e2bff,'rows':_0x30da03}:null;}})[_0xda8a('0x22')](respondWithResult(_0x1e0cf4,null))[_0xda8a('0x42')](handleError(_0x1e0cf4,null));};exports['getDescriptions']=function(_0x480abe,_0x14c558,_0x342c9e){var _0x36b1f7={};var _0x4afd09={};var _0x3081ac;var _0x3654e0;return db[_0xda8a('0x29')]['findOne']({'where':{'id':_0x480abe['params']['id']}})['then'](handleEntityNotFound(_0x14c558,null))['then'](function(_0x5ab2a3){if(_0x5ab2a3){_0x3081ac=_0x5ab2a3;_0x4afd09[_0xda8a('0x2e')]=_[_0xda8a('0x30')](db[_0xda8a('0x4a')][_0xda8a('0x2a')]);_0x4afd09[_0xda8a('0x2f')]=_['keys'](_0x480abe[_0xda8a('0x2f')]);_0x4afd09[_0xda8a('0x31')]=_[_0xda8a('0x32')](_0x4afd09[_0xda8a('0x2e')],_0x4afd09[_0xda8a('0x2f')]);_0x36b1f7[_0xda8a('0x33')]=_[_0xda8a('0x32')](_0x4afd09[_0xda8a('0x2e')],qs['fields'](_0x480abe[_0xda8a('0x2f')][_0xda8a('0x34')]));_0x36b1f7[_0xda8a('0x33')]=_0x36b1f7[_0xda8a('0x33')][_0xda8a('0x35')]?_0x36b1f7[_0xda8a('0x33')]:_0x4afd09['model'];_0x36b1f7[_0xda8a('0x38')]=qs['sort'](_0x480abe[_0xda8a('0x2f')][_0xda8a('0x39')]);_0x36b1f7[_0xda8a('0x3a')]=qs[_0xda8a('0x31')](_[_0xda8a('0x3b')](_0x480abe[_0xda8a('0x2f')],_0x4afd09['filters']));if(_0x480abe[_0xda8a('0x2f')][_0xda8a('0x3c')]){_0x36b1f7[_0xda8a('0x3a')]=_[_0xda8a('0x45')](_0x36b1f7[_0xda8a('0x3a')],{'$or':_[_0xda8a('0x28')](_0x36b1f7[_0xda8a('0x33')],function(_0x3183ec){var _0x13b95b={};_0x13b95b[_0x3183ec]={'$like':'%'+_0x480abe[_0xda8a('0x2f')]['filter']+'%'};return _0x13b95b;})});}_0x36b1f7=_[_0xda8a('0x45')]({},_0x36b1f7,_0x480abe[_0xda8a('0x3d')]);return _0x3081ac[_0xda8a('0x4d')](_0x36b1f7);}})[_0xda8a('0x22')](function(_0x1bed30){if(_0x1bed30){_0x3654e0=_0x1bed30['length'];if(!_0x480abe[_0xda8a('0x2f')]['hasOwnProperty'](_0xda8a('0x37'))){_0x36b1f7[_0xda8a('0x1a')]=qs[_0xda8a('0x1a')](_0x480abe[_0xda8a('0x2f')][_0xda8a('0x1a')]);_0x36b1f7['offset']=qs['offset'](_0x480abe[_0xda8a('0x2f')]['offset']);}return _0x3081ac[_0xda8a('0x4d')](_0x36b1f7);}})['then'](function(_0x5a5e77){if(_0x5a5e77){return _0x5a5e77?{'count':_0x3654e0,'rows':_0x5a5e77}:null;}})['then'](respondWithResult(_0x14c558,null))[_0xda8a('0x42')](handleError(_0x14c558,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 372536e..34c252d 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 _0x8d78=['rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api','moment','request-promise','path'];(function(_0xe6164f,_0x47e826){var _0x557c61=function(_0x303455){while(--_0x303455){_0xe6164f['push'](_0xe6164f['shift']());}};_0x557c61(++_0x47e826);}(_0x8d78,0x1a8));var _0x88d7=function(_0x431b80,_0x589f64){_0x431b80=_0x431b80-0x0;var _0xc3d927=_0x8d78[_0x431b80];return _0xc3d927;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x88d7('0x0'))(_0x88d7('0x1'));var moment=require(_0x88d7('0x2'));var BPromise=require('bluebird');var rp=require(_0x88d7('0x3'));var fs=require('fs');var path=require(_0x88d7('0x4'));var rimraf=require(_0x88d7('0x5'));var config=require('../../config/environment');var attributes=require(_0x88d7('0x6'));module[_0x88d7('0x7')]=function(_0x5e3997,_0x29a9e1){return _0x5e3997[_0x88d7('0x8')](_0x88d7('0x9'),attributes,{'tableName':_0x88d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e6f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger'];(function(_0xf31a,_0x5f5b89){var _0x4df458=function(_0x1ceeaf){while(--_0x1ceeaf){_0xf31a['push'](_0xf31a['shift']());}};_0x4df458(++_0x5f5b89);}(_0x6e6f,0x76));var _0xf6e6=function(_0x3b2421,_0xf30f91){_0x3b2421=_0x3b2421-0x0;var _0x288bde=_0x6e6f[_0x3b2421];return _0x288bde;};'use strict';var _=require('lodash');var util=require(_0xf6e6('0x0'));var logger=require(_0xf6e6('0x1'))('api');var moment=require(_0xf6e6('0x2'));var BPromise=require(_0xf6e6('0x3'));var rp=require(_0xf6e6('0x4'));var fs=require('fs');var path=require(_0xf6e6('0x5'));var rimraf=require(_0xf6e6('0x6'));var config=require(_0xf6e6('0x7'));var attributes=require(_0xf6e6('0x8'));module['exports']=function(_0x3c9820,_0x3ca8a7){return _0x3c9820[_0xf6e6('0x9')](_0xf6e6('0xa'),attributes,{'tableName':_0xf6e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index e8f42a1..cc138bd 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 _0xefd3=['request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x1237d4,_0x20bbfc){var _0x441fb6=function(_0x31736b){while(--_0x31736b){_0x1237d4['push'](_0x1237d4['shift']());}};_0x441fb6(++_0x20bbfc);}(_0xefd3,0xe3));var _0x3efd=function(_0xb0e295,_0x1ce998){_0xb0e295=_0xb0e295-0x0;var _0x47688f=_0xefd3[_0xb0e295];return _0x47688f;};'use strict';var _=require(_0x3efd('0x0'));var util=require(_0x3efd('0x1'));var moment=require(_0x3efd('0x2'));var BPromise=require('bluebird');var rs=require(_0x3efd('0x3'));var fs=require('fs');var Redis=require(_0x3efd('0x4'));var db=require(_0x3efd('0x5'))['db'];var utils=require(_0x3efd('0x6'));var logger=require(_0x3efd('0x7'))(_0x3efd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3efd('0x9')][_0x3efd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42f4c0,_0x4ae1e7,_0xcd8138){return new BPromise(function(_0x38a1bc,_0x2a2031){return client['request'](_0x42f4c0,_0xcd8138)[_0x3efd('0xb')](function(_0x21fa54){logger[_0x3efd('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4ae1e7,_0x3efd('0xd'));logger[_0x3efd('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4ae1e7,_0x3efd('0xd'),JSON[_0x3efd('0xf')](_0x21fa54));if(_0x21fa54[_0x3efd('0x10')]){if(_0x21fa54[_0x3efd('0x10')][_0x3efd('0x11')]===0x1f4){logger[_0x3efd('0x10')](_0x3efd('0x12'),_0x4ae1e7,_0x21fa54[_0x3efd('0x10')]['message']);return _0x2a2031(_0x21fa54[_0x3efd('0x10')][_0x3efd('0x13')]);}logger['error'](_0x3efd('0x12'),_0x4ae1e7,_0x21fa54[_0x3efd('0x10')][_0x3efd('0x13')]);return _0x38a1bc(_0x21fa54['error']['message']);}else{logger['info'](_0x3efd('0x12'),_0x4ae1e7,_0x3efd('0xd'));_0x38a1bc(_0x21fa54['result'][_0x3efd('0x13')]);}})['catch'](function(_0x5ace80){logger[_0x3efd('0x10')](_0x3efd('0x12'),_0x4ae1e7,_0x5ace80);_0x2a2031(_0x5ace80);});});} \ No newline at end of file +var _0x3825=['client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5161e9,_0xc9b27d){var _0x5c8aaf=function(_0x5322b9){while(--_0x5322b9){_0x5161e9['push'](_0x5161e9['shift']());}};_0x5c8aaf(++_0xc9b27d);}(_0x3825,0xbd));var _0x5382=function(_0x5e5dac,_0xd06afc){_0x5e5dac=_0x5e5dac-0x0;var _0xc846b3=_0x3825[_0x5e5dac];return _0xc846b3;};'use strict';var _=require('lodash');var util=require(_0x5382('0x0'));var moment=require(_0x5382('0x1'));var BPromise=require(_0x5382('0x2'));var rs=require(_0x5382('0x3'));var fs=require('fs');var Redis=require(_0x5382('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5382('0x5'));var logger=require(_0x5382('0x6'))(_0x5382('0x7'));var config=require('../../config/environment');var jayson=require(_0x5382('0x8'));var client=jayson[_0x5382('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f08ea,_0x7a5c3c,_0x26f556){return new BPromise(function(_0x1729a3,_0x14e34e){return client[_0x5382('0xa')](_0x5f08ea,_0x26f556)[_0x5382('0xb')](function(_0xd8e5a){logger[_0x5382('0xc')](_0x5382('0xd'),_0x7a5c3c,_0x5382('0xe'));logger[_0x5382('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x7a5c3c,_0x5382('0xe'),JSON[_0x5382('0x10')](_0xd8e5a));if(_0xd8e5a[_0x5382('0x11')]){if(_0xd8e5a[_0x5382('0x11')][_0x5382('0x12')]===0x1f4){logger[_0x5382('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x7a5c3c,_0xd8e5a[_0x5382('0x11')][_0x5382('0x13')]);return _0x14e34e(_0xd8e5a[_0x5382('0x11')][_0x5382('0x13')]);}logger['error'](_0x5382('0xd'),_0x7a5c3c,_0xd8e5a[_0x5382('0x11')]['message']);return _0x1729a3(_0xd8e5a[_0x5382('0x11')][_0x5382('0x13')]);}else{logger[_0x5382('0xc')](_0x5382('0xd'),_0x7a5c3c,_0x5382('0xe'));_0x1729a3(_0xd8e5a[_0x5382('0x14')][_0x5382('0x13')]);}})[_0x5382('0x15')](function(_0x3428bd){logger[_0x5382('0x11')](_0x5382('0xd'),_0x7a5c3c,_0x3428bd);_0x14e34e(_0x3428bd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4844004..0dda6e9 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 _0xaa7e=['../../components/auth/service','../../config/environment','./intSalesforceField.controller','index','get','isAuthenticated','show','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3fa2b9,_0x58c137){var _0x3db589=function(_0x21f53c){while(--_0x21f53c){_0x3fa2b9['push'](_0x3fa2b9['shift']());}};_0x3db589(++_0x58c137);}(_0xaa7e,0x72));var _0xeaa7=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xaa7e[_0x2e76a7];return _0x454cde;};'use strict';var multer=require('multer');var util=require(_0xeaa7('0x0'));var path=require(_0xeaa7('0x1'));var timeout=require(_0xeaa7('0x2'));var express=require(_0xeaa7('0x3'));var router=express['Router']();var fs_extra=require(_0xeaa7('0x4'));var auth=require(_0xeaa7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeaa7('0x6'));var controller=require(_0xeaa7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xeaa7('0x8')]);router[_0xeaa7('0x9')]('/:id',auth[_0xeaa7('0xa')](),controller[_0xeaa7('0xb')]);router['post']('/',auth[_0xeaa7('0xa')](),controller['create']);router[_0xeaa7('0xc')](_0xeaa7('0xd'),auth[_0xeaa7('0xa')](),controller[_0xeaa7('0xe')]);router['delete']('/:id',auth[_0xeaa7('0xa')](),controller[_0xeaa7('0xf')]);module[_0xeaa7('0x10')]=router; \ No newline at end of file +var _0x12f6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','connect-timeout','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12f6,0x1ad));var _0x612f=function(_0xcc639b,_0x2806fa){_0xcc639b=_0xcc639b-0x0;var _0x426ed8=_0x12f6[_0xcc639b];return _0x426ed8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x612f('0x0'));var express=require('express');var router=express[_0x612f('0x1')]();var fs_extra=require(_0x612f('0x2'));var auth=require(_0x612f('0x3'));var interaction=require(_0x612f('0x4'));var config=require(_0x612f('0x5'));var controller=require(_0x612f('0x6'));router[_0x612f('0x7')]('/',auth[_0x612f('0x8')](),controller['index']);router['get'](_0x612f('0x9'),auth[_0x612f('0x8')](),controller[_0x612f('0xa')]);router[_0x612f('0xb')]('/',auth[_0x612f('0x8')](),controller[_0x612f('0xc')]);router[_0x612f('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x612f('0x9'),auth[_0x612f('0x8')](),controller[_0x612f('0xe')]);module[_0x612f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7976c9b..476f67b 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 _0x6e0a=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x2f8bc2,_0x57eb3a){var _0x1508e1=function(_0x484a7d){while(--_0x484a7d){_0x2f8bc2['push'](_0x2f8bc2['shift']());}};_0x1508e1(++_0x57eb3a);}(_0x6e0a,0x18d));var _0xa6e0=function(_0x789179,_0x455e5f){_0x789179=_0x789179-0x0;var _0x10878f=_0x6e0a[_0x789179];return _0x10878f;};'use strict';var Sequelize=require(_0xa6e0('0x0'));module[_0xa6e0('0x1')]={'type':{'type':Sequelize[_0xa6e0('0x2')](_0xa6e0('0x3'),_0xa6e0('0x4'),'customVariable',_0xa6e0('0x5'),_0xa6e0('0x6')),'defaultValue':_0xa6e0('0x3')},'content':{'type':Sequelize[_0xa6e0('0x7')]},'key':{'type':Sequelize[_0xa6e0('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xa6e0('0x3'),_0xa6e0('0x4'),_0xa6e0('0x8'))},'keyContent':{'type':Sequelize[_0xa6e0('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x70ac=['exports','ENUM','variable','customVariable','picklist','string','STRING','sequelize'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x70ac,0x127));var _0xc70a=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x70ac[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xc70a('0x0'));module[_0xc70a('0x1')]={'type':{'type':Sequelize[_0xc70a('0x2')]('string',_0xc70a('0x3'),_0xc70a('0x4'),'keyValue',_0xc70a('0x5')),'defaultValue':_0xc70a('0x6')},'content':{'type':Sequelize[_0xc70a('0x7')]},'key':{'type':Sequelize[_0xc70a('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc70a('0x6'),_0xc70a('0x3'),_0xc70a('0x4'))},'keyContent':{'type':Sequelize[_0xc70a('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c82362e..c6acd78 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 _0x19cf=['body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','length','merge','find','create'];(function(_0x46fe0c,_0x3ed0be){var _0x2c2b58=function(_0x1e4f5b){while(--_0x1e4f5b){_0x46fe0c['push'](_0x46fe0c['shift']());}};_0x2c2b58(++_0x3ed0be);}(_0x19cf,0x1e5));var _0xf19c=function(_0x303be4,_0x4dc935){_0x303be4=_0x303be4-0x0;var _0x5d13ec=_0x19cf[_0x303be4];return _0x5d13ec;};'use strict';var emlformat=require(_0xf19c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf19c('0x1'));var jsonpatch=require(_0xf19c('0x2'));var rp=require(_0xf19c('0x3'));var moment=require(_0xf19c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf19c('0x5'));var path=require(_0xf19c('0x6'));var sox=require('sox');var csv=require(_0xf19c('0x7'));var ejs=require(_0xf19c('0x8'));var fs=require('fs');var fs_extra=require(_0xf19c('0x9'));var _=require('lodash');var squel=require(_0xf19c('0xa'));var crypto=require('crypto');var jsforce=require(_0xf19c('0xb'));var deskjs=require(_0xf19c('0xc'));var toCsv=require(_0xf19c('0x7'));var querystring=require(_0xf19c('0xd'));var Papa=require('papaparse');var Redis=require(_0xf19c('0xe'));var authService=require(_0xf19c('0xf'));var qs=require(_0xf19c('0x10'));var as=require(_0xf19c('0x11'));var hardwareService=require(_0xf19c('0x12'));var logger=require(_0xf19c('0x13'))('api');var utils=require(_0xf19c('0x14'));var config=require(_0xf19c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf19c('0x16'))['db'];function respondWithStatusCode(_0x2690fc,_0x1d79ea){_0x1d79ea=_0x1d79ea||0xcc;return function(_0x498699){if(_0x498699){return _0x2690fc[_0xf19c('0x17')](_0x1d79ea);}return _0x2690fc[_0xf19c('0x18')](_0x1d79ea)[_0xf19c('0x19')]();};}function respondWithResult(_0x23f7ed,_0x457157){_0x457157=_0x457157||0xc8;return function(_0x5b358d){if(_0x5b358d){return _0x23f7ed[_0xf19c('0x18')](_0x457157)[_0xf19c('0x1a')](_0x5b358d);}};}function respondWithFilteredResult(_0x70aa2d,_0x39a7d9){return function(_0x2aff30){if(_0x2aff30){var _0x4e4a26=typeof _0x39a7d9['offset']===_0xf19c('0x1b')&&typeof _0x39a7d9[_0xf19c('0x1c')]===_0xf19c('0x1b');var _0x1708ef=_0x2aff30[_0xf19c('0x1d')];var _0x457a1e=_0x4e4a26?0x0:_0x39a7d9[_0xf19c('0x1e')];var _0x423caf=_0x4e4a26?_0x2aff30[_0xf19c('0x1d')]:_0x39a7d9['offset']+_0x39a7d9['limit'];var _0x526d8f;if(_0x423caf>=_0x1708ef){_0x423caf=_0x1708ef;_0x526d8f=0xc8;}else{_0x526d8f=0xce;}_0x70aa2d[_0xf19c('0x18')](_0x526d8f);return _0x70aa2d[_0xf19c('0x1f')]('Content-Range',_0x457a1e+'-'+_0x423caf+'/'+_0x1708ef)[_0xf19c('0x1a')](_0x2aff30);}return null;};}function patchUpdates(_0xa49c46){return function(_0x211329){try{jsonpatch[_0xf19c('0x20')](_0x211329,_0xa49c46,!![]);}catch(_0x5c9155){return BPromise['reject'](_0x5c9155);}return _0x211329['save']();};}function saveUpdates(_0x3b163a,_0x5cb841){return function(_0x4b7587){if(_0x4b7587){return _0x4b7587[_0xf19c('0x21')](_0x3b163a)[_0xf19c('0x22')](function(_0x208237){return _0x208237;});}return null;};}function removeEntity(_0x2bd536,_0x1c644c){return function(_0x4ec077){if(_0x4ec077){return _0x4ec077['destroy']()[_0xf19c('0x22')](function(){_0x2bd536[_0xf19c('0x18')](0xcc)[_0xf19c('0x19')]();});}};}function handleEntityNotFound(_0x4f28b9,_0x4d6de4){return function(_0x5962dc){if(!_0x5962dc){_0x4f28b9[_0xf19c('0x17')](0x194);}return _0x5962dc;};}function handleError(_0x53c28f,_0x4fd482){_0x4fd482=_0x4fd482||0x1f4;return function(_0x2adfd2){logger[_0xf19c('0x23')](_0x2adfd2[_0xf19c('0x24')]);if(_0x2adfd2['name']){delete _0x2adfd2[_0xf19c('0x25')];}_0x53c28f['status'](_0x4fd482)[_0xf19c('0x26')](_0x2adfd2);};}exports['index']=function(_0x102b0b,_0x44c648){var _0x5899a2={},_0x1b4a8c={},_0x3b9e71={'count':0x0,'rows':[]};var _0x4356c4=_[_0xf19c('0x27')](db[_0xf19c('0x28')][_0xf19c('0x29')],function(_0x3cb3e6){return{'name':_0x3cb3e6[_0xf19c('0x2a')],'type':_0x3cb3e6[_0xf19c('0x2b')]['key']};});_0x1b4a8c[_0xf19c('0x2c')]=_[_0xf19c('0x27')](_0x4356c4,'name');_0x1b4a8c[_0xf19c('0x2d')]=_['keys'](_0x102b0b[_0xf19c('0x2d')]);_0x1b4a8c[_0xf19c('0x2e')]=_[_0xf19c('0x2f')](_0x1b4a8c[_0xf19c('0x2c')],_0x1b4a8c[_0xf19c('0x2d')]);_0x5899a2[_0xf19c('0x30')]=_['intersection'](_0x1b4a8c[_0xf19c('0x2c')],qs[_0xf19c('0x31')](_0x102b0b[_0xf19c('0x2d')]['fields']));_0x5899a2[_0xf19c('0x30')]=_0x5899a2[_0xf19c('0x30')]['length']?_0x5899a2[_0xf19c('0x30')]:_0x1b4a8c[_0xf19c('0x2c')];if(!_0x102b0b['query'][_0xf19c('0x32')]('nolimit')){_0x5899a2[_0xf19c('0x1c')]=qs[_0xf19c('0x1c')](_0x102b0b[_0xf19c('0x2d')]['limit']);_0x5899a2[_0xf19c('0x1e')]=qs[_0xf19c('0x1e')](_0x102b0b[_0xf19c('0x2d')][_0xf19c('0x1e')]);}_0x5899a2[_0xf19c('0x33')]=qs['sort'](_0x102b0b[_0xf19c('0x2d')][_0xf19c('0x34')]);_0x5899a2['where']=qs[_0xf19c('0x2e')](_[_0xf19c('0x35')](_0x102b0b[_0xf19c('0x2d')],_0x1b4a8c[_0xf19c('0x2e')]),_0x4356c4);if(_0x102b0b['query']['filter']){_0x5899a2[_0xf19c('0x36')]=_['merge'](_0x5899a2[_0xf19c('0x36')],{'$or':_[_0xf19c('0x27')](_0x4356c4,function(_0x1a756d){if(_0x1a756d[_0xf19c('0x2b')]!==_0xf19c('0x37')){var _0x2bb63c={};_0x2bb63c[_0x1a756d[_0xf19c('0x25')]]={'$like':'%'+_0x102b0b['query'][_0xf19c('0x38')]+'%'};return _0x2bb63c;}})});}_0x5899a2=_['merge']({},_0x5899a2,_0x102b0b[_0xf19c('0x39')]);var _0x378e70={'where':_0x5899a2[_0xf19c('0x36')]};return db[_0xf19c('0x28')][_0xf19c('0x1d')](_0x378e70)[_0xf19c('0x22')](function(_0x3d5a97){_0x3b9e71[_0xf19c('0x1d')]=_0x3d5a97;if(_0x102b0b[_0xf19c('0x2d')][_0xf19c('0x3a')]){_0x5899a2['include']=[{'all':!![]}];}return db[_0xf19c('0x28')][_0xf19c('0x3b')](_0x5899a2);})[_0xf19c('0x22')](function(_0x26c62f){_0x3b9e71[_0xf19c('0x3c')]=_0x26c62f;return _0x3b9e71;})[_0xf19c('0x22')](respondWithFilteredResult(_0x44c648,_0x5899a2))[_0xf19c('0x3d')](handleError(_0x44c648,null));};exports['show']=function(_0x27116a,_0x4012f4){var _0x4ad5ee={'raw':!![],'where':{'id':_0x27116a['params']['id']}},_0x4ab69f={};_0x4ab69f[_0xf19c('0x2c')]=_[_0xf19c('0x3e')](db[_0xf19c('0x28')][_0xf19c('0x29')]);_0x4ab69f[_0xf19c('0x2d')]=_['keys'](_0x27116a[_0xf19c('0x2d')]);_0x4ab69f[_0xf19c('0x2e')]=_[_0xf19c('0x2f')](_0x4ab69f[_0xf19c('0x2c')],_0x4ab69f[_0xf19c('0x2d')]);_0x4ad5ee['attributes']=_['intersection'](_0x4ab69f[_0xf19c('0x2c')],qs[_0xf19c('0x31')](_0x27116a['query']['fields']));_0x4ad5ee[_0xf19c('0x30')]=_0x4ad5ee[_0xf19c('0x30')][_0xf19c('0x3f')]?_0x4ad5ee['attributes']:_0x4ab69f['model'];if(_0x27116a[_0xf19c('0x2d')][_0xf19c('0x3a')]){_0x4ad5ee['include']=[{'all':!![]}];}_0x4ad5ee=_[_0xf19c('0x40')]({},_0x4ad5ee,_0x27116a[_0xf19c('0x39')]);return db[_0xf19c('0x28')][_0xf19c('0x41')](_0x4ad5ee)[_0xf19c('0x22')](handleEntityNotFound(_0x4012f4,null))[_0xf19c('0x22')](respondWithResult(_0x4012f4,null))[_0xf19c('0x3d')](handleError(_0x4012f4,null));};exports[_0xf19c('0x42')]=function(_0x2aa069,_0xefa413){return db['SalesforceField'][_0xf19c('0x42')](_0x2aa069[_0xf19c('0x43')],{})['then'](respondWithResult(_0xefa413,0xc9))[_0xf19c('0x3d')](handleError(_0xefa413,null));};exports[_0xf19c('0x21')]=function(_0x2bfbf3,_0x494e5d){if(_0x2bfbf3['body']['id']){delete _0x2bfbf3['body']['id'];}return db[_0xf19c('0x28')][_0xf19c('0x41')]({'where':{'id':_0x2bfbf3['params']['id']}})[_0xf19c('0x22')](handleEntityNotFound(_0x494e5d,null))[_0xf19c('0x22')](saveUpdates(_0x2bfbf3[_0xf19c('0x43')],null))[_0xf19c('0x22')](respondWithResult(_0x494e5d,null))['catch'](handleError(_0x494e5d,null));};exports['destroy']=function(_0x3a9172,_0x5edb82){return db['SalesforceField'][_0xf19c('0x41')]({'where':{'id':_0x3a9172[_0xf19c('0x44')]['id']}})[_0xf19c('0x22')](handleEntityNotFound(_0x5edb82,null))[_0xf19c('0x22')](removeEntity(_0x5edb82,null))[_0xf19c('0x3d')](handleError(_0x5edb82,null));}; \ No newline at end of file +var _0x319d=['body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','include','rows','catch','params','includeAll','find','create'];(function(_0x189ba7,_0x460e01){var _0xbe7b76=function(_0x1f94db){while(--_0x1f94db){_0x189ba7['push'](_0x189ba7['shift']());}};_0xbe7b76(++_0x460e01);}(_0x319d,0x11d));var _0xd319=function(_0x515cff,_0x4fb356){_0x515cff=_0x515cff-0x0;var _0x128bf4=_0x319d[_0x515cff];return _0x128bf4;};'use strict';var emlformat=require(_0xd319('0x0'));var rimraf=require(_0xd319('0x1'));var zipdir=require(_0xd319('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd319('0x3'));var moment=require(_0xd319('0x4'));var BPromise=require(_0xd319('0x5'));var Mustache=require(_0xd319('0x6'));var util=require('util');var path=require(_0xd319('0x7'));var sox=require('sox');var csv=require(_0xd319('0x8'));var ejs=require(_0xd319('0x9'));var fs=require('fs');var fs_extra=require(_0xd319('0xa'));var _=require(_0xd319('0xb'));var squel=require(_0xd319('0xc'));var crypto=require(_0xd319('0xd'));var jsforce=require(_0xd319('0xe'));var deskjs=require(_0xd319('0xf'));var toCsv=require(_0xd319('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd319('0x10'));var authService=require(_0xd319('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd319('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd319('0x13'))(_0xd319('0x14'));var utils=require('../../config/utils');var config=require(_0xd319('0x15'));var licenseUtil=require(_0xd319('0x16'));var db=require(_0xd319('0x17'))['db'];function respondWithStatusCode(_0x3ac78c,_0x2891fb){_0x2891fb=_0x2891fb||0xcc;return function(_0x5a4324){if(_0x5a4324){return _0x3ac78c[_0xd319('0x18')](_0x2891fb);}return _0x3ac78c['status'](_0x2891fb)['end']();};}function respondWithResult(_0x59107c,_0x303738){_0x303738=_0x303738||0xc8;return function(_0x525af0){if(_0x525af0){return _0x59107c[_0xd319('0x19')](_0x303738)[_0xd319('0x1a')](_0x525af0);}};}function respondWithFilteredResult(_0x469de6,_0x262e9f){return function(_0x1df5a7){if(_0x1df5a7){var _0x3bb845=typeof _0x262e9f[_0xd319('0x1b')]===_0xd319('0x1c')&&typeof _0x262e9f[_0xd319('0x1d')]==='undefined';var _0x5831f0=_0x1df5a7[_0xd319('0x1e')];var _0x27a53a=_0x3bb845?0x0:_0x262e9f[_0xd319('0x1b')];var _0x3141b6=_0x3bb845?_0x1df5a7['count']:_0x262e9f['offset']+_0x262e9f[_0xd319('0x1d')];var _0x3ab558;if(_0x3141b6>=_0x5831f0){_0x3141b6=_0x5831f0;_0x3ab558=0xc8;}else{_0x3ab558=0xce;}_0x469de6[_0xd319('0x19')](_0x3ab558);return _0x469de6['set'](_0xd319('0x1f'),_0x27a53a+'-'+_0x3141b6+'/'+_0x5831f0)[_0xd319('0x1a')](_0x1df5a7);}return null;};}function patchUpdates(_0x58d415){return function(_0x5eb30f){try{jsonpatch[_0xd319('0x20')](_0x5eb30f,_0x58d415,!![]);}catch(_0x4b4bfd){return BPromise[_0xd319('0x21')](_0x4b4bfd);}return _0x5eb30f[_0xd319('0x22')]();};}function saveUpdates(_0x371281,_0xe50e85){return function(_0x591123){if(_0x591123){return _0x591123[_0xd319('0x23')](_0x371281)[_0xd319('0x24')](function(_0x2e3129){return _0x2e3129;});}return null;};}function removeEntity(_0xaa447a,_0x4c0e10){return function(_0x14250f){if(_0x14250f){return _0x14250f[_0xd319('0x25')]()[_0xd319('0x24')](function(){_0xaa447a[_0xd319('0x19')](0xcc)[_0xd319('0x26')]();});}};}function handleEntityNotFound(_0x5e04e9,_0x354273){return function(_0x283f14){if(!_0x283f14){_0x5e04e9['sendStatus'](0x194);}return _0x283f14;};}function handleError(_0x27f2ca,_0x2a992f){_0x2a992f=_0x2a992f||0x1f4;return function(_0x58e90e){logger['error'](_0x58e90e[_0xd319('0x27')]);if(_0x58e90e[_0xd319('0x28')]){delete _0x58e90e['name'];}_0x27f2ca['status'](_0x2a992f)['send'](_0x58e90e);};}exports[_0xd319('0x29')]=function(_0x38238e,_0x5130d9){var _0x31ca81={},_0x566b3e={},_0xd3945f={'count':0x0,'rows':[]};var _0x1a658f=_['map'](db['SalesforceField'][_0xd319('0x2a')],function(_0x2e9c48){return{'name':_0x2e9c48['fieldName'],'type':_0x2e9c48[_0xd319('0x2b')]['key']};});_0x566b3e[_0xd319('0x2c')]=_[_0xd319('0x2d')](_0x1a658f,_0xd319('0x28'));_0x566b3e[_0xd319('0x2e')]=_[_0xd319('0x2f')](_0x38238e[_0xd319('0x2e')]);_0x566b3e[_0xd319('0x30')]=_[_0xd319('0x31')](_0x566b3e[_0xd319('0x2c')],_0x566b3e[_0xd319('0x2e')]);_0x31ca81[_0xd319('0x32')]=_[_0xd319('0x31')](_0x566b3e[_0xd319('0x2c')],qs['fields'](_0x38238e[_0xd319('0x2e')][_0xd319('0x33')]));_0x31ca81[_0xd319('0x32')]=_0x31ca81[_0xd319('0x32')][_0xd319('0x34')]?_0x31ca81[_0xd319('0x32')]:_0x566b3e[_0xd319('0x2c')];if(!_0x38238e[_0xd319('0x2e')][_0xd319('0x35')]('nolimit')){_0x31ca81[_0xd319('0x1d')]=qs[_0xd319('0x1d')](_0x38238e[_0xd319('0x2e')][_0xd319('0x1d')]);_0x31ca81[_0xd319('0x1b')]=qs[_0xd319('0x1b')](_0x38238e['query']['offset']);}_0x31ca81[_0xd319('0x36')]=qs[_0xd319('0x37')](_0x38238e[_0xd319('0x2e')]['sort']);_0x31ca81[_0xd319('0x38')]=qs[_0xd319('0x30')](_[_0xd319('0x39')](_0x38238e[_0xd319('0x2e')],_0x566b3e[_0xd319('0x30')]),_0x1a658f);if(_0x38238e[_0xd319('0x2e')][_0xd319('0x3a')]){_0x31ca81['where']=_[_0xd319('0x3b')](_0x31ca81['where'],{'$or':_['map'](_0x1a658f,function(_0x58feff){if(_0x58feff['type']!==_0xd319('0x3c')){var _0xc561ea={};_0xc561ea[_0x58feff[_0xd319('0x28')]]={'$like':'%'+_0x38238e['query']['filter']+'%'};return _0xc561ea;}})});}_0x31ca81=_[_0xd319('0x3b')]({},_0x31ca81,_0x38238e[_0xd319('0x3d')]);var _0x26b639={'where':_0x31ca81[_0xd319('0x38')]};return db[_0xd319('0x3e')][_0xd319('0x1e')](_0x26b639)[_0xd319('0x24')](function(_0x445cde){_0xd3945f[_0xd319('0x1e')]=_0x445cde;if(_0x38238e[_0xd319('0x2e')]['includeAll']){_0x31ca81[_0xd319('0x3f')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x31ca81);})['then'](function(_0x6be60e){_0xd3945f[_0xd319('0x40')]=_0x6be60e;return _0xd3945f;})[_0xd319('0x24')](respondWithFilteredResult(_0x5130d9,_0x31ca81))[_0xd319('0x41')](handleError(_0x5130d9,null));};exports['show']=function(_0xc51367,_0x2154c2){var _0x2cd6b1={'raw':!![],'where':{'id':_0xc51367[_0xd319('0x42')]['id']}},_0x28c970={};_0x28c970[_0xd319('0x2c')]=_[_0xd319('0x2f')](db[_0xd319('0x3e')][_0xd319('0x2a')]);_0x28c970[_0xd319('0x2e')]=_[_0xd319('0x2f')](_0xc51367['query']);_0x28c970['filters']=_[_0xd319('0x31')](_0x28c970[_0xd319('0x2c')],_0x28c970[_0xd319('0x2e')]);_0x2cd6b1[_0xd319('0x32')]=_[_0xd319('0x31')](_0x28c970[_0xd319('0x2c')],qs[_0xd319('0x33')](_0xc51367['query'][_0xd319('0x33')]));_0x2cd6b1[_0xd319('0x32')]=_0x2cd6b1[_0xd319('0x32')][_0xd319('0x34')]?_0x2cd6b1[_0xd319('0x32')]:_0x28c970[_0xd319('0x2c')];if(_0xc51367[_0xd319('0x2e')][_0xd319('0x43')]){_0x2cd6b1[_0xd319('0x3f')]=[{'all':!![]}];}_0x2cd6b1=_['merge']({},_0x2cd6b1,_0xc51367[_0xd319('0x3d')]);return db['SalesforceField'][_0xd319('0x44')](_0x2cd6b1)['then'](handleEntityNotFound(_0x2154c2,null))['then'](respondWithResult(_0x2154c2,null))[_0xd319('0x41')](handleError(_0x2154c2,null));};exports[_0xd319('0x45')]=function(_0x4b9dae,_0x3c576a){return db[_0xd319('0x3e')]['create'](_0x4b9dae[_0xd319('0x46')],{})['then'](respondWithResult(_0x3c576a,0xc9))['catch'](handleError(_0x3c576a,null));};exports['update']=function(_0x5bf23a,_0x4b0ef5){if(_0x5bf23a[_0xd319('0x46')]['id']){delete _0x5bf23a['body']['id'];}return db['SalesforceField'][_0xd319('0x44')]({'where':{'id':_0x5bf23a['params']['id']}})['then'](handleEntityNotFound(_0x4b0ef5,null))[_0xd319('0x24')](saveUpdates(_0x5bf23a[_0xd319('0x46')],null))[_0xd319('0x24')](respondWithResult(_0x4b0ef5,null))[_0xd319('0x41')](handleError(_0x4b0ef5,null));};exports[_0xd319('0x25')]=function(_0x1840bc,_0x226b48){return db[_0xd319('0x3e')][_0xd319('0x44')]({'where':{'id':_0x1840bc[_0xd319('0x42')]['id']}})[_0xd319('0x24')](handleEntityNotFound(_0x226b48,null))[_0xd319('0x24')](removeEntity(_0x226b48,null))[_0xd319('0x41')](handleError(_0x226b48,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c275ad9..9ca80d6 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 _0x40f3=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','moment','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField'];(function(_0xfbfeb4,_0x5e25e3){var _0x4ef1ca=function(_0x4118f8){while(--_0x4118f8){_0xfbfeb4['push'](_0xfbfeb4['shift']());}};_0x4ef1ca(++_0x5e25e3);}(_0x40f3,0x1b4));var _0x340f=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x40f3[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x340f('0x0'))('api');var moment=require(_0x340f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x340f('0x2'));var rimraf=require(_0x340f('0x3'));var config=require(_0x340f('0x4'));var attributes=require(_0x340f('0x5'));module['exports']=function(_0x1ea4b7,_0x47eddf){return _0x1ea4b7[_0x340f('0x6')](_0x340f('0x7'),attributes,{'tableName':_0x340f('0x8'),'paranoid':![],'indexes':[{'name':_0x340f('0x9'),'fields':[_0x340f('0xa'),_0x340f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4240=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x3e151d,_0x5b96a8){var _0x10ad6a=function(_0x57fddf){while(--_0x57fddf){_0x3e151d['push'](_0x3e151d['shift']());}};_0x10ad6a(++_0x5b96a8);}(_0x4240,0xb4));var _0x0424=function(_0x373532,_0x1917de){_0x373532=_0x373532-0x0;var _0x104d8a=_0x4240[_0x373532];return _0x104d8a;};'use strict';var _=require('lodash');var util=require(_0x0424('0x0'));var logger=require('../../config/logger')(_0x0424('0x1'));var moment=require(_0x0424('0x2'));var BPromise=require(_0x0424('0x3'));var rp=require(_0x0424('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0424('0x5'));var config=require(_0x0424('0x6'));var attributes=require(_0x0424('0x7'));module[_0x0424('0x8')]=function(_0x24cfb4,_0x20bf76){return _0x24cfb4[_0x0424('0x9')](_0x0424('0xa'),attributes,{'tableName':_0x0424('0xb'),'paranoid':![],'indexes':[{'name':_0x0424('0xc'),'fields':[_0x0424('0xd'),_0x0424('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 10f7391..2c53274 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 _0x9ed2=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x7bd149,_0x2b2201){var _0x5a23c7=function(_0x580fec){while(--_0x580fec){_0x7bd149['push'](_0x7bd149['shift']());}};_0x5a23c7(++_0x2b2201);}(_0x9ed2,0x1bf));var _0x29ed=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x9ed2[_0x51fe5f];return _0x4abce9;};'use strict';var _=require(_0x29ed('0x0'));var util=require(_0x29ed('0x1'));var moment=require('moment');var BPromise=require(_0x29ed('0x2'));var rs=require(_0x29ed('0x3'));var fs=require('fs');var Redis=require(_0x29ed('0x4'));var db=require(_0x29ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29ed('0x6'))(_0x29ed('0x7'));var config=require(_0x29ed('0x8'));var jayson=require(_0x29ed('0x9'));var client=jayson[_0x29ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5238d5,_0x1de356,_0x219dd3){return new BPromise(function(_0x3aba3a,_0x5b3cf7){return client[_0x29ed('0xb')](_0x5238d5,_0x219dd3)[_0x29ed('0xc')](function(_0x204659){logger[_0x29ed('0xd')]('SalesforceField,\x20%s,\x20%s',_0x1de356,_0x29ed('0xe'));logger[_0x29ed('0xf')](_0x29ed('0x10'),_0x1de356,_0x29ed('0xe'),JSON[_0x29ed('0x11')](_0x204659));if(_0x204659[_0x29ed('0x12')]){if(_0x204659[_0x29ed('0x12')]['code']===0x1f4){logger['error'](_0x29ed('0x13'),_0x1de356,_0x204659[_0x29ed('0x12')][_0x29ed('0x14')]);return _0x5b3cf7(_0x204659[_0x29ed('0x12')]['message']);}logger[_0x29ed('0x12')](_0x29ed('0x13'),_0x1de356,_0x204659['error'][_0x29ed('0x14')]);return _0x3aba3a(_0x204659[_0x29ed('0x12')][_0x29ed('0x14')]);}else{logger[_0x29ed('0xd')](_0x29ed('0x13'),_0x1de356,_0x29ed('0xe'));_0x3aba3a(_0x204659[_0x29ed('0x15')][_0x29ed('0x14')]);}})['catch'](function(_0x3b9f2e){logger['error'](_0x29ed('0x13'),_0x1de356,_0x3b9f2e);_0x5b3cf7(_0x3b9f2e);});});} \ No newline at end of file +var _0xdedd=['../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x2bc690,_0x4c8cb9){var _0x125c53=function(_0x4d8ef9){while(--_0x4d8ef9){_0x2bc690['push'](_0x2bc690['shift']());}};_0x125c53(++_0x4c8cb9);}(_0xdedd,0x1b1));var _0xdded=function(_0x1406c9,_0x4ebab4){_0x1406c9=_0x1406c9-0x0;var _0x4763f9=_0xdedd[_0x1406c9];return _0x4763f9;};'use strict';var _=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var moment=require(_0xdded('0x2'));var BPromise=require(_0xdded('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdded('0x4'));var db=require(_0xdded('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdded('0x6'))('rpc');var config=require(_0xdded('0x7'));var jayson=require(_0xdded('0x8'));var client=jayson[_0xdded('0x9')][_0xdded('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xffcdcf,_0xee1977,_0x11d7d4){return new BPromise(function(_0x2dd91c,_0x5ed9c8){return client[_0xdded('0xb')](_0xffcdcf,_0x11d7d4)['then'](function(_0x58197e){logger[_0xdded('0xc')](_0xdded('0xd'),_0xee1977,_0xdded('0xe'));logger[_0xdded('0xf')](_0xdded('0x10'),_0xee1977,'request\x20sent',JSON[_0xdded('0x11')](_0x58197e));if(_0x58197e[_0xdded('0x12')]){if(_0x58197e[_0xdded('0x12')]['code']===0x1f4){logger['error'](_0xdded('0xd'),_0xee1977,_0x58197e['error']['message']);return _0x5ed9c8(_0x58197e['error'][_0xdded('0x13')]);}logger[_0xdded('0x12')]('SalesforceField,\x20%s,\x20%s',_0xee1977,_0x58197e[_0xdded('0x12')]['message']);return _0x2dd91c(_0x58197e[_0xdded('0x12')][_0xdded('0x13')]);}else{logger[_0xdded('0xc')](_0xdded('0xd'),_0xee1977,_0xdded('0xe'));_0x2dd91c(_0x58197e[_0xdded('0x14')][_0xdded('0x13')]);}})[_0xdded('0x15')](function(_0x547d94){logger[_0xdded('0x12')]('SalesforceField,\x20%s,\x20%s',_0xee1977,_0x547d94);_0x5ed9c8(_0x547d94);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index a043138..e6fc38a 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 _0x4f6f=['/:id','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','post','create','put'];(function(_0x2cc2fe,_0x23451c){var _0x4337cd=function(_0xf63299){while(--_0xf63299){_0x2cc2fe['push'](_0x2cc2fe['shift']());}};_0x4337cd(++_0x23451c);}(_0x4f6f,0x157));var _0xf4f6=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x4f6f[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var path=require(_0xf4f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xf4f6('0x3'));var router=express['Router']();var fs_extra=require(_0xf4f6('0x4'));var auth=require(_0xf4f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf4f6('0x6'));var controller=require(_0xf4f6('0x7'));router['get']('/',auth[_0xf4f6('0x8')](),controller[_0xf4f6('0x9')]);router[_0xf4f6('0xa')]('/:id',auth[_0xf4f6('0x8')](),controller['show']);router['get'](_0xf4f6('0xb'),auth[_0xf4f6('0x8')](),controller[_0xf4f6('0xc')]);router[_0xf4f6('0xa')](_0xf4f6('0xd'),auth[_0xf4f6('0x8')](),controller['getFields']);router[_0xf4f6('0xe')]('/',auth[_0xf4f6('0x8')](),controller[_0xf4f6('0xf')]);router[_0xf4f6('0xe')](_0xf4f6('0xb'),auth[_0xf4f6('0x8')](),controller['addConfiguration']);router[_0xf4f6('0x10')](_0xf4f6('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xf4f6('0x12')](_0xf4f6('0x11'),auth[_0xf4f6('0x8')](),controller['destroy']);module[_0xf4f6('0x13')]=router; \ No newline at end of file +var _0x32ee=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x32ee,0x10e));var _0xe32e=function(_0x4002c6,_0x3f44d3){_0x4002c6=_0x4002c6-0x0;var _0x53eb66=_0x32ee[_0x4002c6];return _0x53eb66;};'use strict';var multer=require('multer');var util=require(_0xe32e('0x0'));var path=require(_0xe32e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe32e('0x2'));var router=express[_0xe32e('0x3')]();var fs_extra=require(_0xe32e('0x4'));var auth=require(_0xe32e('0x5'));var interaction=require(_0xe32e('0x6'));var config=require(_0xe32e('0x7'));var controller=require(_0xe32e('0x8'));router[_0xe32e('0x9')]('/',auth[_0xe32e('0xa')](),controller[_0xe32e('0xb')]);router['get'](_0xe32e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe32e('0x9')](_0xe32e('0xd'),auth[_0xe32e('0xa')](),controller[_0xe32e('0xe')]);router['get'](_0xe32e('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xe32e('0x10')]('/',auth[_0xe32e('0xa')](),controller[_0xe32e('0x11')]);router[_0xe32e('0x10')]('/:id/configurations',auth[_0xe32e('0xa')](),controller[_0xe32e('0x12')]);router[_0xe32e('0x13')](_0xe32e('0xc'),auth['isAuthenticated'](),controller[_0xe32e('0x14')]);router['delete'](_0xe32e('0xc'),auth['isAuthenticated'](),controller[_0xe32e('0x15')]);module[_0xe32e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f38451b..d240b58 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 _0x5db3=['exports','STRING','username','remoteUri','sequelize'];(function(_0x176429,_0x3c5a0f){var _0x17b607=function(_0x20fc09){while(--_0x20fc09){_0x176429['push'](_0x176429['shift']());}};_0x17b607(++_0x3c5a0f);}(_0x5db3,0x103));var _0x35db=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x5db3[_0x41382c];return _0x4da35b;};'use strict';var Sequelize=require(_0x35db('0x0'));module[_0x35db('0x1')]={'name':{'type':Sequelize[_0x35db('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x35db('0x2')],'unique':_0x35db('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x35db('0x2')]},'remoteUri':{'type':Sequelize[_0x35db('0x2')],'unique':_0x35db('0x4')},'serverUrl':{'type':Sequelize[_0x35db('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xaac1=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1ae43a,_0x3e9a47){var _0x506eba=function(_0x8b373d){while(--_0x8b373d){_0x1ae43a['push'](_0x1ae43a['shift']());}};_0x506eba(++_0x3e9a47);}(_0xaac1,0x1b2));var _0x1aac=function(_0x275f3a,_0x59f599){_0x275f3a=_0x275f3a-0x0;var _0xe3c45d=_0xaac1[_0x275f3a];return _0xe3c45d;};'use strict';var Sequelize=require(_0x1aac('0x0'));module[_0x1aac('0x1')]={'name':{'type':Sequelize[_0x1aac('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1aac('0x2')],'unique':_0x1aac('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1aac('0x2')]},'remoteUri':{'type':Sequelize[_0x1aac('0x2')],'unique':_0x1aac('0x4')},'serverUrl':{'type':Sequelize[_0x1aac('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 49434f8..df2e0f8 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 _0x71eb=['length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','nolimit','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','child_incidents','approval_history','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','caller_id','short_description','correlation_display','work_start','additional_assignee_list','description','notify','sys_class_name','closed_by','parent_incident','sys_id','reopened_by','urgency','problem_id','company','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','stack','boolean','true','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields'];(function(_0x48bd63,_0x5f8e86){var _0x4eaade=function(_0x5cf196){while(--_0x5cf196){_0x48bd63['push'](_0x48bd63['shift']());}};_0x4eaade(++_0x5f8e86);}(_0x71eb,0x129));var _0xb71e=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x71eb[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0xb71e('0x0'));var rimraf=require(_0xb71e('0x1'));var zipdir=require(_0xb71e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb71e('0x3'));var moment=require('moment');var BPromise=require(_0xb71e('0x4'));var Mustache=require(_0xb71e('0x5'));var util=require('util');var path=require(_0xb71e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb71e('0x7'));var _=require(_0xb71e('0x8'));var squel=require('squel');var crypto=require(_0xb71e('0x9'));var jsforce=require(_0xb71e('0xa'));var deskjs=require(_0xb71e('0xb'));var toCsv=require(_0xb71e('0xc'));var querystring=require('querystring');var Papa=require(_0xb71e('0xd'));var Redis=require(_0xb71e('0xe'));var authService=require(_0xb71e('0xf'));var qs=require(_0xb71e('0x10'));var as=require(_0xb71e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb71e('0x12'))(_0xb71e('0x13'));var utils=require(_0xb71e('0x14'));var config=require(_0xb71e('0x15'));var licenseUtil=require(_0xb71e('0x16'));var db=require(_0xb71e('0x17'))['db'];var integrations=require(_0xb71e('0x18'));function respondWithStatusCode(_0x38ab1d,_0x575d42){_0x575d42=_0x575d42||0xcc;return function(_0x82e7d6){if(_0x82e7d6){return _0x38ab1d[_0xb71e('0x19')](_0x575d42);}return _0x38ab1d['status'](_0x575d42)[_0xb71e('0x1a')]();};}function respondWithResult(_0x2d10ed,_0x2be0a9){_0x2be0a9=_0x2be0a9||0xc8;return function(_0x106138){if(_0x106138){return _0x2d10ed[_0xb71e('0x1b')](_0x2be0a9)[_0xb71e('0x1c')](_0x106138);}};}function respondWithFilteredResult(_0x1b5097,_0x163bcf){return function(_0x5cebb2){if(_0x5cebb2){var _0x45e452=typeof _0x163bcf[_0xb71e('0x1d')]===_0xb71e('0x1e')&&typeof _0x163bcf[_0xb71e('0x1f')]===_0xb71e('0x1e');var _0x2aee91=_0x5cebb2['count'];var _0x15a861=_0x45e452?0x0:_0x163bcf[_0xb71e('0x1d')];var _0x5309bc=_0x45e452?_0x5cebb2[_0xb71e('0x20')]:_0x163bcf[_0xb71e('0x1d')]+_0x163bcf[_0xb71e('0x1f')];var _0x56e86a;if(_0x5309bc>=_0x2aee91){_0x5309bc=_0x2aee91;_0x56e86a=0xc8;}else{_0x56e86a=0xce;}_0x1b5097[_0xb71e('0x1b')](_0x56e86a);return _0x1b5097[_0xb71e('0x21')](_0xb71e('0x22'),_0x15a861+'-'+_0x5309bc+'/'+_0x2aee91)['json'](_0x5cebb2);}return null;};}function patchUpdates(_0x56d888){return function(_0x5544c7){try{jsonpatch[_0xb71e('0x23')](_0x5544c7,_0x56d888,!![]);}catch(_0x30464b){return BPromise[_0xb71e('0x24')](_0x30464b);}return _0x5544c7[_0xb71e('0x25')]();};}function saveUpdates(_0x227b37,_0x4694ba){return function(_0x174c64){if(_0x174c64){return _0x174c64[_0xb71e('0x26')](_0x227b37)['then'](function(_0x3d8679){return _0x3d8679;});}return null;};}function removeEntity(_0x57eeaa,_0x144245){return function(_0x131a38){if(_0x131a38){return _0x131a38['destroy']()[_0xb71e('0x27')](function(){_0x57eeaa[_0xb71e('0x1b')](0xcc)[_0xb71e('0x1a')]();});}};}function handleEntityNotFound(_0x1f04ca,_0x6d3d61){return function(_0xcc91f1){if(!_0xcc91f1){_0x1f04ca[_0xb71e('0x19')](0x194);}return _0xcc91f1;};}function handleError(_0x3fbc9c,_0x4d384f){_0x4d384f=_0x4d384f||0x1f4;return function(_0x42eeeb){logger[_0xb71e('0x28')](_0x42eeeb['stack']);if(_0x42eeeb['name']){delete _0x42eeeb[_0xb71e('0x29')];}_0x3fbc9c['status'](_0x4d384f)[_0xb71e('0x2a')](_0x42eeeb);};}exports[_0xb71e('0x2b')]=function(_0x4dc56b,_0x26243f){var _0x2f96bd={},_0x10a323={},_0x3887a2={'count':0x0,'rows':[]};var _0x1dea72=_[_0xb71e('0x2c')](db[_0xb71e('0x2d')][_0xb71e('0x2e')],function(_0x437b7e){return{'name':_0x437b7e[_0xb71e('0x2f')],'type':_0x437b7e[_0xb71e('0x30')]['key']};});_0x10a323[_0xb71e('0x31')]=_[_0xb71e('0x2c')](_0x1dea72,'name');_0x10a323[_0xb71e('0x32')]=_[_0xb71e('0x33')](_0x4dc56b[_0xb71e('0x32')]);_0x10a323['filters']=_[_0xb71e('0x34')](_0x10a323[_0xb71e('0x31')],_0x10a323['query']);_0x2f96bd[_0xb71e('0x35')]=_[_0xb71e('0x34')](_0x10a323[_0xb71e('0x31')],qs['fields'](_0x4dc56b[_0xb71e('0x32')][_0xb71e('0x36')]));_0x2f96bd[_0xb71e('0x35')]=_0x2f96bd[_0xb71e('0x35')][_0xb71e('0x37')]?_0x2f96bd['attributes']:_0x10a323[_0xb71e('0x31')];if(!_0x4dc56b['query'][_0xb71e('0x38')]('nolimit')){_0x2f96bd[_0xb71e('0x1f')]=qs[_0xb71e('0x1f')](_0x4dc56b['query'][_0xb71e('0x1f')]);_0x2f96bd[_0xb71e('0x1d')]=qs[_0xb71e('0x1d')](_0x4dc56b[_0xb71e('0x32')][_0xb71e('0x1d')]);}_0x2f96bd[_0xb71e('0x39')]=qs['sort'](_0x4dc56b[_0xb71e('0x32')][_0xb71e('0x3a')]);_0x2f96bd['where']=qs[_0xb71e('0x3b')](_[_0xb71e('0x3c')](_0x4dc56b[_0xb71e('0x32')],_0x10a323[_0xb71e('0x3b')]),_0x1dea72);if(_0x4dc56b['query'][_0xb71e('0x3d')]){_0x2f96bd[_0xb71e('0x3e')]=_[_0xb71e('0x3f')](_0x2f96bd['where'],{'$or':_['map'](_0x1dea72,function(_0x52749b){if(_0x52749b[_0xb71e('0x30')]!=='VIRTUAL'){var _0xe793ad={};_0xe793ad[_0x52749b[_0xb71e('0x29')]]={'$like':'%'+_0x4dc56b[_0xb71e('0x32')][_0xb71e('0x3d')]+'%'};return _0xe793ad;}})});}_0x2f96bd=_['merge']({},_0x2f96bd,_0x4dc56b[_0xb71e('0x40')]);var _0x3840d3={'where':_0x2f96bd[_0xb71e('0x3e')]};return db['ServicenowAccount'][_0xb71e('0x20')](_0x3840d3)[_0xb71e('0x27')](function(_0x3d2ff6){_0x3887a2['count']=_0x3d2ff6;if(_0x4dc56b['query']['includeAll']){_0x2f96bd[_0xb71e('0x41')]=[{'all':!![]}];}return db[_0xb71e('0x2d')][_0xb71e('0x42')](_0x2f96bd);})[_0xb71e('0x27')](function(_0x448027){_0x3887a2[_0xb71e('0x43')]=_0x448027;return _0x3887a2;})['then'](respondWithFilteredResult(_0x26243f,_0x2f96bd))[_0xb71e('0x44')](handleError(_0x26243f,null));};exports['show']=function(_0x56c179,_0x50402a){var _0x528519={'raw':![],'where':{'id':_0x56c179[_0xb71e('0x45')]['id']}},_0xc54cfa={};_0xc54cfa[_0xb71e('0x31')]=_[_0xb71e('0x33')](db[_0xb71e('0x2d')][_0xb71e('0x2e')]);_0xc54cfa[_0xb71e('0x32')]=_['keys'](_0x56c179[_0xb71e('0x32')]);_0xc54cfa['filters']=_['intersection'](_0xc54cfa[_0xb71e('0x31')],_0xc54cfa[_0xb71e('0x32')]);_0x528519['attributes']=_[_0xb71e('0x34')](_0xc54cfa[_0xb71e('0x31')],qs['fields'](_0x56c179[_0xb71e('0x32')][_0xb71e('0x36')]));_0x528519[_0xb71e('0x35')]=_0x528519[_0xb71e('0x35')][_0xb71e('0x37')]?_0x528519[_0xb71e('0x35')]:_0xc54cfa['model'];if(_0x56c179['query']['includeAll']){_0x528519[_0xb71e('0x41')]=[{'all':!![]}];}_0x528519=_['merge']({},_0x528519,_0x56c179[_0xb71e('0x40')]);return db['ServicenowAccount'][_0xb71e('0x46')](_0x528519)['then'](handleEntityNotFound(_0x50402a,null))['then'](respondWithResult(_0x50402a,null))['catch'](handleError(_0x50402a,null));};exports['create']=function(_0x116e2a,_0x58786d){return db['ServicenowAccount'][_0xb71e('0x47')](_0x116e2a['body'],{})[_0xb71e('0x27')](respondWithResult(_0x58786d,0xc9))[_0xb71e('0x44')](handleError(_0x58786d,null));};exports[_0xb71e('0x26')]=function(_0x3030f0,_0x2c5b36){if(_0x3030f0['body']['id']){delete _0x3030f0[_0xb71e('0x48')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x3030f0['params']['id']}})[_0xb71e('0x27')](handleEntityNotFound(_0x2c5b36,null))['then'](saveUpdates(_0x3030f0[_0xb71e('0x48')],null))['then'](respondWithResult(_0x2c5b36,null))[_0xb71e('0x44')](handleError(_0x2c5b36,null));};exports['destroy']=function(_0x12ce2c,_0x27c232){return db[_0xb71e('0x2d')][_0xb71e('0x46')]({'where':{'id':_0x12ce2c[_0xb71e('0x45')]['id']}})['then'](handleEntityNotFound(_0x27c232,null))[_0xb71e('0x27')](removeEntity(_0x27c232,null))[_0xb71e('0x44')](handleError(_0x27c232,null));};exports[_0xb71e('0x49')]=function(_0x77cfee,_0x595ff2,_0xa5c9ac){var _0x1a1547={};var _0x1b1e86={};var _0x340d99;var _0x44de2e;return db[_0xb71e('0x2d')][_0xb71e('0x4a')]({'where':{'id':_0x77cfee[_0xb71e('0x45')]['id']}})['then'](handleEntityNotFound(_0x595ff2,null))['then'](function(_0x34e09b){if(_0x34e09b){_0x340d99=_0x34e09b;_0x1b1e86['model']=_[_0xb71e('0x33')](db[_0xb71e('0x4b')]['rawAttributes']);_0x1b1e86[_0xb71e('0x32')]=_[_0xb71e('0x33')](_0x77cfee[_0xb71e('0x32')]);_0x1b1e86[_0xb71e('0x3b')]=_[_0xb71e('0x34')](_0x1b1e86['model'],_0x1b1e86[_0xb71e('0x32')]);_0x1a1547['attributes']=_[_0xb71e('0x34')](_0x1b1e86[_0xb71e('0x31')],qs[_0xb71e('0x36')](_0x77cfee['query'][_0xb71e('0x36')]));_0x1a1547[_0xb71e('0x35')]=_0x1a1547[_0xb71e('0x35')]['length']?_0x1a1547[_0xb71e('0x35')]:_0x1b1e86[_0xb71e('0x31')];_0x1a1547[_0xb71e('0x39')]=qs[_0xb71e('0x3a')](_0x77cfee[_0xb71e('0x32')][_0xb71e('0x3a')]);_0x1a1547['where']=qs['filters'](_[_0xb71e('0x3c')](_0x77cfee['query'],_0x1b1e86[_0xb71e('0x3b')]));if(_0x77cfee['query'][_0xb71e('0x3d')]){_0x1a1547[_0xb71e('0x3e')]=_[_0xb71e('0x3f')](_0x1a1547[_0xb71e('0x3e')],{'$or':_[_0xb71e('0x2c')](_0x1a1547[_0xb71e('0x35')],function(_0x19fb94){var _0x28b6e2={};_0x28b6e2[_0x19fb94]={'$like':'%'+_0x77cfee['query']['filter']+'%'};return _0x28b6e2;})});}_0x1a1547=_['merge']({},_0x1a1547,_0x77cfee['options']);return _0x340d99[_0xb71e('0x49')](_0x1a1547);}})[_0xb71e('0x27')](function(_0xc65505){if(_0xc65505){_0x44de2e=_0xc65505[_0xb71e('0x37')];if(!_0x77cfee['query'][_0xb71e('0x38')](_0xb71e('0x4c'))){_0x1a1547[_0xb71e('0x1f')]=qs['limit'](_0x77cfee[_0xb71e('0x32')][_0xb71e('0x1f')]);_0x1a1547[_0xb71e('0x1d')]=qs[_0xb71e('0x1d')](_0x77cfee[_0xb71e('0x32')][_0xb71e('0x1d')]);}return _0x340d99[_0xb71e('0x49')](_0x1a1547);}})[_0xb71e('0x27')](function(_0x4c37e1){if(_0x4c37e1){return _0x4c37e1?{'count':_0x44de2e,'rows':_0x4c37e1}:null;}})[_0xb71e('0x27')](respondWithResult(_0x595ff2,null))['catch'](handleError(_0x595ff2,null));};exports['addConfiguration']=function(_0x263f22,_0x45a682,_0x450ec5){if(_0x263f22[_0xb71e('0x48')]['id']){delete _0x263f22[_0xb71e('0x48')]['id'];}return db[_0xb71e('0x2d')][_0xb71e('0x4a')]({'where':{'id':_0x263f22[_0xb71e('0x45')]['id']}})[_0xb71e('0x27')](handleEntityNotFound(_0x45a682,null))[_0xb71e('0x27')](function(_0x5f365a){if(_0x5f365a){_0x263f22['body'][_0xb71e('0x4d')]=_0x5f365a['id'];_0x263f22['body'][_0xb71e('0x4e')]=integrations[_0xb71e('0x4f')](_0x263f22[_0xb71e('0x48')]['channel'],_0x263f22[_0xb71e('0x48')][_0xb71e('0x30')]);_0x263f22[_0xb71e('0x48')][_0xb71e('0x50')]=integrations['getDescriptions'](_0x263f22['body'][_0xb71e('0x51')],_0x263f22[_0xb71e('0x48')]['type']);return db[_0xb71e('0x4b')][_0xb71e('0x47')](_0x263f22[_0xb71e('0x48')],{'include':[{'model':db[_0xb71e('0x52')],'as':_0xb71e('0x4e')},{'model':db[_0xb71e('0x52')],'as':_0xb71e('0x50')}]});}return null;})[_0xb71e('0x27')](respondWithResult(_0x45a682,null))['catch'](handleError(_0x45a682,null));};exports[_0xb71e('0x53')]=function(_0x2756e5,_0x2301dd,_0x410512){var _0x17d5e4=['made_sla',_0xb71e('0x54'),_0xb71e('0x55'),_0xb71e('0x56'),_0xb71e('0x57'),'notify',_0xb71e('0x58'),_0xb71e('0x59'),_0xb71e('0x5a')];var _0x288ae6=[_0xb71e('0x5b'),_0xb71e('0x5c'),_0xb71e('0x5d'),_0xb71e('0x5e'),_0xb71e('0x5f'),'sys_updated_on',_0xb71e('0x60'),_0xb71e('0x54'),_0xb71e('0x61'),'number','resolved_by','sys_updated_by',_0xb71e('0x62'),_0xb71e('0x63'),_0xb71e('0x64'),_0xb71e('0x65'),_0xb71e('0x66'),_0xb71e('0x67'),_0xb71e('0x55'),_0xb71e('0x39'),_0xb71e('0x68'),_0xb71e('0x69'),_0xb71e('0x6a'),'delivery_plan',_0xb71e('0x6b'),_0xb71e('0x6c'),_0xb71e('0x6d'),_0xb71e('0x6e'),_0xb71e('0x6f'),_0xb71e('0x70'),'rfc',_0xb71e('0x71'),_0xb71e('0x72'),_0xb71e('0x73'),_0xb71e('0x74'),_0xb71e('0x75'),_0xb71e('0x76'),'reopened_time','resolved_at',_0xb71e('0x77'),'approval_set','subcategory','work_notes',_0xb71e('0x78'),'close_code',_0xb71e('0x79'),'delivery_task',_0xb71e('0x7a'),'assignment_group','business_stc',_0xb71e('0x7b'),_0xb71e('0x7c'),'calendar_duration',_0xb71e('0x7d'),_0xb71e('0x7e'),'close_notes',_0xb71e('0x7f'),'follow_up',_0xb71e('0x80'),_0xb71e('0x81'),'contact_type',_0xb71e('0x82'),'incident_state',_0xb71e('0x83'),_0xb71e('0x84'),_0xb71e('0x85'),'reassignment_count','activity_due',_0xb71e('0x86'),_0xb71e('0x59'),_0xb71e('0x87'),_0xb71e('0x88'),_0xb71e('0x89'),'comments_and_work_notes',_0xb71e('0x8a'),_0xb71e('0x8b'),_0xb71e('0x8c'),'sys_tags','escalation',_0xb71e('0x8d'),_0xb71e('0x8e'),_0xb71e('0x8f'),_0xb71e('0x5a')];var _0x482460='';var _0xc6979e='';var _0x33c4aa=[];var _0x101cb6='';var _0x4c9d67='';var _0x1677c3=[];var _0x56122e='';var _0x19743e='';var _0x53625f={};var _0x3c7c78='';return db[_0xb71e('0x2d')][_0xb71e('0x4a')]({'where':{'id':_0x2756e5[_0xb71e('0x45')]['id']},'attributes':['id',_0xb71e('0x90'),_0xb71e('0x91'),_0xb71e('0x92'),_0xb71e('0x93'),_0xb71e('0x94')]})[_0xb71e('0x27')](handleEntityNotFound(_0x2301dd,null))[_0xb71e('0x27')](function(_0x34b14f){if(_0x34b14f){_0x3c7c78=_0x34b14f[_0xb71e('0x93')];var _0x200300=_0x3c7c78[_0xb71e('0x95')](-0x1);if(_0x200300==='/'){_0x3c7c78=_0x3c7c78['substring'](0x0,_0x3c7c78[_0xb71e('0x96')](_0x200300));}_0x19743e=util['format']('%s/api/now/doc/table/schema/',_0x3c7c78);_0x56122e=util[_0xb71e('0x97')](_0xb71e('0x98'),_0x3c7c78);_0x53625f={'user':_0x34b14f[_0xb71e('0x90')],'pass':_0x34b14f[_0xb71e('0x91')]};var _0x257b0e={'method':'GET','uri':_0x19743e+'incident?sysparm_display_value=all','auth':_0x53625f,'json':!![]};return rp(_0x257b0e);}})[_0xb71e('0x27')](function(_0x59704b){if(_0x59704b[_0xb71e('0x99')][_0xb71e('0x37')]>0x0){_0x482460=_0x59704b[_0xb71e('0x99')];}console[_0xb71e('0x9a')](_0xb71e('0x9b'),_0x482460);_0x1677c3=[];_0xc6979e=Object[_0xb71e('0x9c')]([],_0x482460);_[_0xb71e('0x9d')](_0xc6979e,function(_0x2fc167){return!_0x17d5e4[_0xb71e('0x9e')](_0x2fc167[_0xb71e('0x29')]);});_0xc6979e[_0xb71e('0x9f')](function(_0xdeaeb0){var _0x390c1f=createFieldObject(_0x56122e,_0x53625f,_0xdeaeb0[_0xb71e('0xa0')],_0xdeaeb0[_0xb71e('0x29')],_0xdeaeb0[_0xb71e('0xa1')],![]);_0x1677c3[_0xb71e('0xa2')](_0x390c1f);});return Promise[_0xb71e('0xa3')](_0x1677c3);})[_0xb71e('0x27')](function(_0x44601a){_0x33c4aa=_0x44601a;_0x101cb6=Object[_0xb71e('0x9c')]([],_0x482460);console[_0xb71e('0x9a')](_0xb71e('0xa4'),_0x482460);_[_0xb71e('0x9d')](_0x101cb6,function(_0x7e703f){return _0x288ae6[_0xb71e('0x9e')](_0x7e703f[_0xb71e('0x29')]);});console[_0xb71e('0x9a')](_0xb71e('0xa5'),_0x101cb6);_0x1677c3=[];_0x101cb6[_0xb71e('0x9f')](function(_0x42f31c){var _0x324b77=createFieldObject(_0x56122e,_0x53625f,_0x42f31c[_0xb71e('0xa0')],_0x42f31c[_0xb71e('0x29')],_0x42f31c['label'],!![]);_0x1677c3[_0xb71e('0xa2')](_0x324b77);});return Promise[_0xb71e('0xa3')](_0x1677c3);})[_0xb71e('0x27')](function(_0x361729){_0x4c9d67=_0x361729;var _0x2d660d=_0x33c4aa['concat'](_0x4c9d67);return{'count':_0x2d660d[_0xb71e('0x37')],'rows':_0x2d660d};})[_0xb71e('0x27')](respondWithResult(_0x2301dd,null))[_0xb71e('0x44')](function(_0x3a4230){console['log'](_0xb71e('0xa6')+_0x3a4230);var _0x2e97a1=_0x2756e5[_0xb71e('0x32')][_0xb71e('0xa7')]?0x1f4:_0x3a4230[_0xb71e('0xa8')]||0x1f4;logger[_0xb71e('0x28')](_0x3a4230[_0xb71e('0xa9')]);delete _0x3a4230['name'];if(_0x2e97a1===0x191){_0x2e97a1=0x190;}_0x2301dd[_0xb71e('0x1b')](_0x2e97a1)[_0xb71e('0x2a')](_0x2756e5[_0xb71e('0x32')][_0xb71e('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x3a4230['statusCode']}:_0x3a4230);});};function createFieldObject(_0x400f33,_0x4c128b,_0x5d720a,_0x3f3d70,_0x1f58d8,_0x2edc4d){return new Promise(function(_0x1039b7,_0x96aed8){var _0x55364b={'id':_0x3f3d70,'name':_0x1f58d8,'custom':_0x2edc4d};if(_0x5d720a===_0xb71e('0xaa')){_0x55364b['options']=[{'name':'True','value':_0xb71e('0xab')},{'name':_0xb71e('0xac'),'value':'false'}];_0x1039b7(_0x55364b);}else{var _0x16174d={'method':_0xb71e('0xad'),'uri':_0x400f33+_0xb71e('0xae')+_0x3f3d70,'auth':_0x4c128b,'json':!![]};return rp(_0x16174d)['then'](function(_0x4d54a9){var _0x1ddb48=[];if(_0x4d54a9[_0xb71e('0x99')][_0xb71e('0x37')]>0x0){_0x4d54a9[_0xb71e('0x99')][_0xb71e('0x9f')](function(_0x51db4c){if(_0x51db4c[_0xb71e('0xaf')]==='false'){var _0x1a1526={'name':_0x51db4c[_0xb71e('0xa1')],'value':_0x51db4c['value']};_0x1ddb48[_0xb71e('0xa2')](_0x1a1526);}});}_0x55364b[_0xb71e('0x40')]=_0x1ddb48;if(_0x55364b[_0xb71e('0x40')][_0xb71e('0x37')]>0x0){_0x1039b7(_0x55364b);}else{if(_0x2edc4d==![]){_0x1039b7();}else{_0x1039b7(_0x55364b);}}});}});} \ No newline at end of file +var _0x9133=['opened_by','user_input','sys_created_on','sys_domain','sys_created_by','knowledge','closed_at','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','parent_incident','sys_id','problem_id','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','ServicenowAccount','includeAll','findAll','rows','show','params','keys','include','find','create','body','catch','update','getConfigurations','findOne','ServicenowConfiguration','order','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','ServicenowField','Subjects','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by'];(function(_0x43f9b4,_0x5e0e54){var _0x51950e=function(_0x4227ec){while(--_0x4227ec){_0x43f9b4['push'](_0x43f9b4['shift']());}};_0x51950e(++_0x5e0e54);}(_0x9133,0x1d3));var _0x3913=function(_0x1ec153,_0x6aa9de){_0x1ec153=_0x1ec153-0x0;var _0x24359b=_0x9133[_0x1ec153];return _0x24359b;};'use strict';var emlformat=require(_0x3913('0x0'));var rimraf=require(_0x3913('0x1'));var zipdir=require(_0x3913('0x2'));var jsonpatch=require(_0x3913('0x3'));var rp=require(_0x3913('0x4'));var moment=require(_0x3913('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3913('0x6'));var util=require(_0x3913('0x7'));var path=require(_0x3913('0x8'));var sox=require(_0x3913('0x9'));var csv=require(_0x3913('0xa'));var ejs=require(_0x3913('0xb'));var fs=require('fs');var fs_extra=require(_0x3913('0xc'));var _=require(_0x3913('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3913('0xe'));var deskjs=require(_0x3913('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3913('0x10'));var Papa=require(_0x3913('0x11'));var Redis=require(_0x3913('0x12'));var authService=require(_0x3913('0x13'));var qs=require(_0x3913('0x14'));var as=require(_0x3913('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3913('0x16'))(_0x3913('0x17'));var utils=require('../../config/utils');var config=require(_0x3913('0x18'));var licenseUtil=require(_0x3913('0x19'));var db=require(_0x3913('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16b86b,_0x25436b){_0x25436b=_0x25436b||0xcc;return function(_0x5375ef){if(_0x5375ef){return _0x16b86b['sendStatus'](_0x25436b);}return _0x16b86b[_0x3913('0x1b')](_0x25436b)[_0x3913('0x1c')]();};}function respondWithResult(_0x13e4f0,_0x37663c){_0x37663c=_0x37663c||0xc8;return function(_0xc94ea7){if(_0xc94ea7){return _0x13e4f0['status'](_0x37663c)[_0x3913('0x1d')](_0xc94ea7);}};}function respondWithFilteredResult(_0x1fcf68,_0x160a52){return function(_0x20bf5b){if(_0x20bf5b){var _0x96ae92=typeof _0x160a52[_0x3913('0x1e')]===_0x3913('0x1f')&&typeof _0x160a52[_0x3913('0x20')]===_0x3913('0x1f');var _0x276131=_0x20bf5b[_0x3913('0x21')];var _0x19db48=_0x96ae92?0x0:_0x160a52[_0x3913('0x1e')];var _0x14c972=_0x96ae92?_0x20bf5b[_0x3913('0x21')]:_0x160a52[_0x3913('0x1e')]+_0x160a52[_0x3913('0x20')];var _0x112806;if(_0x14c972>=_0x276131){_0x14c972=_0x276131;_0x112806=0xc8;}else{_0x112806=0xce;}_0x1fcf68[_0x3913('0x1b')](_0x112806);return _0x1fcf68[_0x3913('0x22')](_0x3913('0x23'),_0x19db48+'-'+_0x14c972+'/'+_0x276131)[_0x3913('0x1d')](_0x20bf5b);}return null;};}function patchUpdates(_0x4e38ee){return function(_0x9b66b3){try{jsonpatch[_0x3913('0x24')](_0x9b66b3,_0x4e38ee,!![]);}catch(_0x135f96){return BPromise['reject'](_0x135f96);}return _0x9b66b3[_0x3913('0x25')]();};}function saveUpdates(_0xea7cdd,_0x16b4d8){return function(_0x550852){if(_0x550852){return _0x550852['update'](_0xea7cdd)[_0x3913('0x26')](function(_0x1e320c){return _0x1e320c;});}return null;};}function removeEntity(_0x2aa9e6,_0x14e9a7){return function(_0x30ef6a){if(_0x30ef6a){return _0x30ef6a[_0x3913('0x27')]()[_0x3913('0x26')](function(){_0x2aa9e6[_0x3913('0x1b')](0xcc)[_0x3913('0x1c')]();});}};}function handleEntityNotFound(_0x356cd3,_0x1f3257){return function(_0x14cf3e){if(!_0x14cf3e){_0x356cd3[_0x3913('0x28')](0x194);}return _0x14cf3e;};}function handleError(_0x598798,_0x2677f6){_0x2677f6=_0x2677f6||0x1f4;return function(_0x9b1b32){logger['error'](_0x9b1b32[_0x3913('0x29')]);if(_0x9b1b32[_0x3913('0x2a')]){delete _0x9b1b32[_0x3913('0x2a')];}_0x598798[_0x3913('0x1b')](_0x2677f6)[_0x3913('0x2b')](_0x9b1b32);};}exports[_0x3913('0x2c')]=function(_0x3b607c,_0x4abe74){var _0x5419a2={},_0x3a3c70={},_0xc9a95e={'count':0x0,'rows':[]};var _0x15d179=_['map'](db['ServicenowAccount'][_0x3913('0x2d')],function(_0x4aa600){return{'name':_0x4aa600[_0x3913('0x2e')],'type':_0x4aa600[_0x3913('0x2f')][_0x3913('0x30')]};});_0x3a3c70[_0x3913('0x31')]=_['map'](_0x15d179,_0x3913('0x2a'));_0x3a3c70[_0x3913('0x32')]=_['keys'](_0x3b607c['query']);_0x3a3c70['filters']=_[_0x3913('0x33')](_0x3a3c70['model'],_0x3a3c70[_0x3913('0x32')]);_0x5419a2['attributes']=_[_0x3913('0x33')](_0x3a3c70['model'],qs['fields'](_0x3b607c[_0x3913('0x32')][_0x3913('0x34')]));_0x5419a2['attributes']=_0x5419a2[_0x3913('0x35')][_0x3913('0x36')]?_0x5419a2[_0x3913('0x35')]:_0x3a3c70[_0x3913('0x31')];if(!_0x3b607c['query'][_0x3913('0x37')]('nolimit')){_0x5419a2[_0x3913('0x20')]=qs[_0x3913('0x20')](_0x3b607c['query'][_0x3913('0x20')]);_0x5419a2[_0x3913('0x1e')]=qs['offset'](_0x3b607c['query'][_0x3913('0x1e')]);}_0x5419a2['order']=qs[_0x3913('0x38')](_0x3b607c[_0x3913('0x32')][_0x3913('0x38')]);_0x5419a2[_0x3913('0x39')]=qs[_0x3913('0x3a')](_[_0x3913('0x3b')](_0x3b607c[_0x3913('0x32')],_0x3a3c70[_0x3913('0x3a')]),_0x15d179);if(_0x3b607c[_0x3913('0x32')][_0x3913('0x3c')]){_0x5419a2[_0x3913('0x39')]=_[_0x3913('0x3d')](_0x5419a2[_0x3913('0x39')],{'$or':_[_0x3913('0x3e')](_0x15d179,function(_0x54c2b5){if(_0x54c2b5['type']!==_0x3913('0x3f')){var _0x861a0f={};_0x861a0f[_0x54c2b5['name']]={'$like':'%'+_0x3b607c[_0x3913('0x32')][_0x3913('0x3c')]+'%'};return _0x861a0f;}})});}_0x5419a2=_[_0x3913('0x3d')]({},_0x5419a2,_0x3b607c[_0x3913('0x40')]);var _0x48a2ed={'where':_0x5419a2[_0x3913('0x39')]};return db[_0x3913('0x41')][_0x3913('0x21')](_0x48a2ed)[_0x3913('0x26')](function(_0xfba2a7){_0xc9a95e['count']=_0xfba2a7;if(_0x3b607c[_0x3913('0x32')][_0x3913('0x42')]){_0x5419a2['include']=[{'all':!![]}];}return db[_0x3913('0x41')][_0x3913('0x43')](_0x5419a2);})[_0x3913('0x26')](function(_0x55914b){_0xc9a95e[_0x3913('0x44')]=_0x55914b;return _0xc9a95e;})['then'](respondWithFilteredResult(_0x4abe74,_0x5419a2))['catch'](handleError(_0x4abe74,null));};exports[_0x3913('0x45')]=function(_0x42d55b,_0x53be47){var _0x333b76={'raw':![],'where':{'id':_0x42d55b[_0x3913('0x46')]['id']}},_0x5eec02={};_0x5eec02['model']=_[_0x3913('0x47')](db[_0x3913('0x41')][_0x3913('0x2d')]);_0x5eec02[_0x3913('0x32')]=_[_0x3913('0x47')](_0x42d55b[_0x3913('0x32')]);_0x5eec02[_0x3913('0x3a')]=_[_0x3913('0x33')](_0x5eec02['model'],_0x5eec02[_0x3913('0x32')]);_0x333b76[_0x3913('0x35')]=_[_0x3913('0x33')](_0x5eec02[_0x3913('0x31')],qs[_0x3913('0x34')](_0x42d55b['query'][_0x3913('0x34')]));_0x333b76[_0x3913('0x35')]=_0x333b76[_0x3913('0x35')][_0x3913('0x36')]?_0x333b76[_0x3913('0x35')]:_0x5eec02[_0x3913('0x31')];if(_0x42d55b['query'][_0x3913('0x42')]){_0x333b76[_0x3913('0x48')]=[{'all':!![]}];}_0x333b76=_['merge']({},_0x333b76,_0x42d55b['options']);return db['ServicenowAccount'][_0x3913('0x49')](_0x333b76)['then'](handleEntityNotFound(_0x53be47,null))['then'](respondWithResult(_0x53be47,null))['catch'](handleError(_0x53be47,null));};exports[_0x3913('0x4a')]=function(_0x2ef6c6,_0x40e172){return db['ServicenowAccount'][_0x3913('0x4a')](_0x2ef6c6[_0x3913('0x4b')],{})['then'](respondWithResult(_0x40e172,0xc9))[_0x3913('0x4c')](handleError(_0x40e172,null));};exports[_0x3913('0x4d')]=function(_0x1cf632,_0x10161e){if(_0x1cf632['body']['id']){delete _0x1cf632[_0x3913('0x4b')]['id'];}return db['ServicenowAccount'][_0x3913('0x49')]({'where':{'id':_0x1cf632[_0x3913('0x46')]['id']}})['then'](handleEntityNotFound(_0x10161e,null))[_0x3913('0x26')](saveUpdates(_0x1cf632[_0x3913('0x4b')],null))[_0x3913('0x26')](respondWithResult(_0x10161e,null))[_0x3913('0x4c')](handleError(_0x10161e,null));};exports[_0x3913('0x27')]=function(_0x124bb3,_0x4efeec){return db[_0x3913('0x41')][_0x3913('0x49')]({'where':{'id':_0x124bb3['params']['id']}})[_0x3913('0x26')](handleEntityNotFound(_0x4efeec,null))[_0x3913('0x26')](removeEntity(_0x4efeec,null))[_0x3913('0x4c')](handleError(_0x4efeec,null));};exports[_0x3913('0x4e')]=function(_0x1b96f4,_0x5d5ffb,_0x630338){var _0x5ecea7={};var _0x54045b={};var _0xd45dac;var _0x3556f7;return db[_0x3913('0x41')][_0x3913('0x4f')]({'where':{'id':_0x1b96f4[_0x3913('0x46')]['id']}})[_0x3913('0x26')](handleEntityNotFound(_0x5d5ffb,null))['then'](function(_0x48cb6b){if(_0x48cb6b){_0xd45dac=_0x48cb6b;_0x54045b['model']=_[_0x3913('0x47')](db[_0x3913('0x50')][_0x3913('0x2d')]);_0x54045b[_0x3913('0x32')]=_[_0x3913('0x47')](_0x1b96f4[_0x3913('0x32')]);_0x54045b['filters']=_[_0x3913('0x33')](_0x54045b[_0x3913('0x31')],_0x54045b[_0x3913('0x32')]);_0x5ecea7[_0x3913('0x35')]=_[_0x3913('0x33')](_0x54045b[_0x3913('0x31')],qs[_0x3913('0x34')](_0x1b96f4[_0x3913('0x32')][_0x3913('0x34')]));_0x5ecea7[_0x3913('0x35')]=_0x5ecea7['attributes'][_0x3913('0x36')]?_0x5ecea7[_0x3913('0x35')]:_0x54045b['model'];_0x5ecea7[_0x3913('0x51')]=qs[_0x3913('0x38')](_0x1b96f4[_0x3913('0x32')][_0x3913('0x38')]);_0x5ecea7[_0x3913('0x39')]=qs['filters'](_[_0x3913('0x3b')](_0x1b96f4['query'],_0x54045b[_0x3913('0x3a')]));if(_0x1b96f4[_0x3913('0x32')]['filter']){_0x5ecea7[_0x3913('0x39')]=_[_0x3913('0x3d')](_0x5ecea7[_0x3913('0x39')],{'$or':_[_0x3913('0x3e')](_0x5ecea7['attributes'],function(_0x9319f0){var _0x1cdea9={};_0x1cdea9[_0x9319f0]={'$like':'%'+_0x1b96f4[_0x3913('0x32')]['filter']+'%'};return _0x1cdea9;})});}_0x5ecea7=_[_0x3913('0x3d')]({},_0x5ecea7,_0x1b96f4['options']);return _0xd45dac[_0x3913('0x4e')](_0x5ecea7);}})[_0x3913('0x26')](function(_0x3bfca8){if(_0x3bfca8){_0x3556f7=_0x3bfca8['length'];if(!_0x1b96f4[_0x3913('0x32')][_0x3913('0x37')](_0x3913('0x52'))){_0x5ecea7[_0x3913('0x20')]=qs[_0x3913('0x20')](_0x1b96f4[_0x3913('0x32')][_0x3913('0x20')]);_0x5ecea7[_0x3913('0x1e')]=qs[_0x3913('0x1e')](_0x1b96f4['query'][_0x3913('0x1e')]);}return _0xd45dac['getConfigurations'](_0x5ecea7);}})[_0x3913('0x26')](function(_0x3769a6){if(_0x3769a6){return _0x3769a6?{'count':_0x3556f7,'rows':_0x3769a6}:null;}})[_0x3913('0x26')](respondWithResult(_0x5d5ffb,null))[_0x3913('0x4c')](handleError(_0x5d5ffb,null));};exports[_0x3913('0x53')]=function(_0x3c30d3,_0x41c719,_0x75efc1){if(_0x3c30d3[_0x3913('0x4b')]['id']){delete _0x3c30d3[_0x3913('0x4b')]['id'];}return db[_0x3913('0x41')][_0x3913('0x4f')]({'where':{'id':_0x3c30d3['params']['id']}})[_0x3913('0x26')](handleEntityNotFound(_0x41c719,null))[_0x3913('0x26')](function(_0x1a8d55){if(_0x1a8d55){_0x3c30d3[_0x3913('0x4b')][_0x3913('0x54')]=_0x1a8d55['id'];_0x3c30d3['body']['Subjects']=integrations[_0x3913('0x55')](_0x3c30d3[_0x3913('0x4b')][_0x3913('0x56')],_0x3c30d3[_0x3913('0x4b')][_0x3913('0x2f')]);_0x3c30d3[_0x3913('0x4b')][_0x3913('0x57')]=integrations['getDescriptions'](_0x3c30d3[_0x3913('0x4b')][_0x3913('0x56')],_0x3c30d3['body']['type']);return db[_0x3913('0x50')][_0x3913('0x4a')](_0x3c30d3[_0x3913('0x4b')],{'include':[{'model':db[_0x3913('0x58')],'as':_0x3913('0x59')},{'model':db[_0x3913('0x58')],'as':_0x3913('0x57')}]});}return null;})[_0x3913('0x26')](respondWithResult(_0x41c719,null))[_0x3913('0x4c')](handleError(_0x41c719,null));};exports['getFields']=function(_0x261473,_0x23bf49,_0xdabe88){var _0x51e644=[_0x3913('0x5a'),_0x3913('0x5b'),'knowledge',_0x3913('0x5c'),_0x3913('0x5d'),_0x3913('0x5e'),_0x3913('0x5f'),_0x3913('0x60'),_0x3913('0x61')];var _0x15c7e9=['parent',_0x3913('0x5a'),'caused_by',_0x3913('0x62'),_0x3913('0x63'),_0x3913('0x64'),_0x3913('0x65'),_0x3913('0x5b'),_0x3913('0x66'),_0x3913('0x67'),_0x3913('0x68'),_0x3913('0x69'),_0x3913('0x6a'),_0x3913('0x6b'),_0x3913('0x6c'),_0x3913('0x6d'),'state',_0x3913('0x6e'),_0x3913('0x6f'),_0x3913('0x51'),'calendar_stc',_0x3913('0x70'),'cmdb_ci','delivery_plan',_0x3913('0x71'),_0x3913('0x72'),_0x3913('0x73'),_0x3913('0x74'),'priority',_0x3913('0x75'),_0x3913('0x76'),_0x3913('0x77'),_0x3913('0x78'),_0x3913('0x79'),_0x3913('0x7a'),_0x3913('0x7b'),_0x3913('0x7c'),_0x3913('0x7d'),_0x3913('0x7e'),_0x3913('0x7f'),_0x3913('0x80'),_0x3913('0x5c'),_0x3913('0x81'),_0x3913('0x82'),_0x3913('0x5d'),_0x3913('0x83'),_0x3913('0x84'),_0x3913('0x85'),_0x3913('0x86'),_0x3913('0x87'),_0x3913('0x88'),_0x3913('0x89'),'calendar_duration',_0x3913('0x5e'),_0x3913('0x8a'),_0x3913('0x8b'),_0x3913('0x8c'),'follow_up',_0x3913('0x8d'),_0x3913('0x8e'),'contact_type','reopened_by',_0x3913('0x5f'),'urgency',_0x3913('0x8f'),'company',_0x3913('0x90'),_0x3913('0x91'),_0x3913('0x92'),'severity',_0x3913('0x93'),'sla_due','approval',_0x3913('0x94'),_0x3913('0x95'),_0x3913('0x96'),_0x3913('0x97'),'sys_tags',_0x3913('0x98'),_0x3913('0x99'),'correlation_id',_0x3913('0x9a'),_0x3913('0x61')];var _0x5cedd1='';var _0x59b3f6='';var _0x371fe2=[];var _0x424a42='';var _0xdb3f2d='';var _0x702edb=[];var _0x89db8f='';var _0xe6babe='';var _0x52dc53={};var _0x1ae0ce='';return db[_0x3913('0x41')][_0x3913('0x4f')]({'where':{'id':_0x261473[_0x3913('0x46')]['id']},'attributes':['id',_0x3913('0x9b'),_0x3913('0x9c'),_0x3913('0x9d'),_0x3913('0x9e'),'serverUrl']})[_0x3913('0x26')](handleEntityNotFound(_0x23bf49,null))[_0x3913('0x26')](function(_0x324483){if(_0x324483){_0x1ae0ce=_0x324483[_0x3913('0x9e')];var _0x4a8067=_0x1ae0ce[_0x3913('0x9f')](-0x1);if(_0x4a8067==='/'){_0x1ae0ce=_0x1ae0ce[_0x3913('0xa0')](0x0,_0x1ae0ce[_0x3913('0xa1')](_0x4a8067));}_0xe6babe=util[_0x3913('0xa2')](_0x3913('0xa3'),_0x1ae0ce);_0x89db8f=util[_0x3913('0xa2')](_0x3913('0xa4'),_0x1ae0ce);_0x52dc53={'user':_0x324483['username'],'pass':_0x324483[_0x3913('0x9c')]};var _0x549d73={'method':'GET','uri':_0xe6babe+_0x3913('0xa5'),'auth':_0x52dc53,'json':!![]};return rp(_0x549d73);}})['then'](function(_0x4f1122){if(_0x4f1122['result'][_0x3913('0x36')]>0x0){_0x5cedd1=_0x4f1122[_0x3913('0xa6')];}console[_0x3913('0xa7')](_0x3913('0xa8'),_0x5cedd1);_0x702edb=[];_0x59b3f6=Object[_0x3913('0xa9')]([],_0x5cedd1);_[_0x3913('0xaa')](_0x59b3f6,function(_0x1461d5){return!_0x51e644[_0x3913('0xab')](_0x1461d5[_0x3913('0x2a')]);});_0x59b3f6[_0x3913('0xac')](function(_0x4e61b5){var _0x448fbb=createFieldObject(_0x89db8f,_0x52dc53,_0x4e61b5[_0x3913('0xad')],_0x4e61b5[_0x3913('0x2a')],_0x4e61b5[_0x3913('0xae')],![]);_0x702edb[_0x3913('0xaf')](_0x448fbb);});return Promise[_0x3913('0xb0')](_0x702edb);})[_0x3913('0x26')](function(_0x375088){_0x371fe2=_0x375088;_0x424a42=Object[_0x3913('0xa9')]([],_0x5cedd1);console[_0x3913('0xa7')](_0x3913('0xb1'),_0x5cedd1);_[_0x3913('0xaa')](_0x424a42,function(_0x43ce24){return _0x15c7e9[_0x3913('0xab')](_0x43ce24['name']);});console[_0x3913('0xa7')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x424a42);_0x702edb=[];_0x424a42[_0x3913('0xac')](function(_0x3095f9){var _0x5bc572=createFieldObject(_0x89db8f,_0x52dc53,_0x3095f9[_0x3913('0xad')],_0x3095f9['name'],_0x3095f9['label'],!![]);_0x702edb['push'](_0x5bc572);});return Promise[_0x3913('0xb0')](_0x702edb);})['then'](function(_0x9a2904){_0xdb3f2d=_0x9a2904;var _0x2a6fe0=_0x371fe2[_0x3913('0xb2')](_0xdb3f2d);return{'count':_0x2a6fe0[_0x3913('0x36')],'rows':_0x2a6fe0};})[_0x3913('0x26')](respondWithResult(_0x23bf49,null))['catch'](function(_0x199e60){console[_0x3913('0xa7')](_0x3913('0xb3')+_0x199e60);var _0x251c2a=_0x261473['query'][_0x3913('0xb4')]?0x1f4:_0x199e60[_0x3913('0xb5')]||0x1f4;logger['error'](_0x199e60['stack']);delete _0x199e60['name'];if(_0x251c2a===0x191){_0x251c2a=0x190;}_0x23bf49[_0x3913('0x1b')](_0x251c2a)[_0x3913('0x2b')](_0x261473['query'][_0x3913('0xb4')]?{'message':_0x3913('0xb6'),'statusCode':_0x199e60[_0x3913('0xb5')]}:_0x199e60);});};function createFieldObject(_0x36f253,_0x14c5d6,_0x4fda62,_0x2f2780,_0x431820,_0xbe7bd0){return new Promise(function(_0x92ab7d,_0x4a313e){var _0x5de1b3={'id':_0x2f2780,'name':_0x431820,'custom':_0xbe7bd0};if(_0x4fda62===_0x3913('0xb7')){_0x5de1b3[_0x3913('0x40')]=[{'name':_0x3913('0xb8'),'value':_0x3913('0xb9')},{'name':_0x3913('0xba'),'value':_0x3913('0xbb')}];_0x92ab7d(_0x5de1b3);}else{var _0x2dd7cf={'method':_0x3913('0xbc'),'uri':_0x36f253+_0x3913('0xbd')+_0x2f2780,'auth':_0x14c5d6,'json':!![]};return rp(_0x2dd7cf)['then'](function(_0x2b2ea0){var _0x9f3a14=[];if(_0x2b2ea0[_0x3913('0xa6')][_0x3913('0x36')]>0x0){_0x2b2ea0['result'][_0x3913('0xac')](function(_0x5c8e6e){if(_0x5c8e6e['inactive']===_0x3913('0xbb')){var _0x2eddfb={'name':_0x5c8e6e['label'],'value':_0x5c8e6e[_0x3913('0xbe')]};_0x9f3a14[_0x3913('0xaf')](_0x2eddfb);}});}_0x5de1b3['options']=_0x9f3a14;if(_0x5de1b3['options'][_0x3913('0x36')]>0x0){_0x92ab7d(_0x5de1b3);}else{if(_0xbe7bd0==![]){_0x92ab7d();}else{_0x92ab7d(_0x5de1b3);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index ad6a544..1b22d3f 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 _0x038b=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','util','../../config/logger','api','bluebird'];(function(_0x3be123,_0x350d38){var _0x1b3005=function(_0x13a5c9){while(--_0x13a5c9){_0x3be123['push'](_0x3be123['shift']());}};_0x1b3005(++_0x350d38);}(_0x038b,0x114));var _0xb038=function(_0x457ce0,_0x3da6b5){_0x457ce0=_0x457ce0-0x0;var _0x59b908=_0x038b[_0x457ce0];return _0x59b908;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));var integrations=require(_0xb038('0x7'));module['exports']=function(_0x54e1e7,_0x2e3e64){return _0x54e1e7[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5bc0ff,_0x51a0c1){var _0x32c7f3=function(_0x14197f){while(--_0x14197f){_0x5bc0ff['push'](_0x5bc0ff['shift']());}};_0x32c7f3(++_0x51a0c1);}(_0x31f0,0xb7));var _0x031f=function(_0x14755a,_0x283f57){_0x14755a=_0x14755a-0x0;var _0x560bbe=_0x31f0[_0x14755a];return _0x560bbe;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 448c3a6..2e5aeab 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 _0x8aa9=['map','model','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','find','raw','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','findAll','options','where','attributes','limit','include'];(function(_0x59634d,_0x383e2e){var _0xe03c5=function(_0x56f000){while(--_0x56f000){_0x59634d['push'](_0x59634d['shift']());}};_0xe03c5(++_0x383e2e);}(_0x8aa9,0xb2));var _0x98aa=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8aa9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x98aa('0x0'));var moment=require(_0x98aa('0x1'));var BPromise=require(_0x98aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x98aa('0x4'));var logger=require(_0x98aa('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98aa('0x6'));var client=jayson[_0x98aa('0x7')][_0x98aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49dbdd,_0x8456ba,_0x3ce91c){return new BPromise(function(_0x122f2d,_0x2db3bc){return client[_0x98aa('0x9')](_0x49dbdd,_0x3ce91c)[_0x98aa('0xa')](function(_0x4fec04){logger['info'](_0x98aa('0xb'),_0x8456ba,_0x98aa('0xc'));logger[_0x98aa('0xd')](_0x98aa('0xe'),_0x8456ba,_0x98aa('0xc'),JSON['stringify'](_0x4fec04));if(_0x4fec04[_0x98aa('0xf')]){if(_0x4fec04['error'][_0x98aa('0x10')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x8456ba,_0x4fec04[_0x98aa('0xf')][_0x98aa('0x11')]);return _0x2db3bc(_0x4fec04[_0x98aa('0xf')]['message']);}logger[_0x98aa('0xf')](_0x98aa('0xb'),_0x8456ba,_0x4fec04[_0x98aa('0xf')][_0x98aa('0x11')]);return _0x122f2d(_0x4fec04['error'][_0x98aa('0x11')]);}else{logger[_0x98aa('0x12')](_0x98aa('0xb'),_0x8456ba,_0x98aa('0xc'));_0x122f2d(_0x4fec04['result'][_0x98aa('0x11')]);}})[_0x98aa('0x13')](function(_0x3a6b85){logger[_0x98aa('0xf')](_0x98aa('0xb'),_0x8456ba,_0x3a6b85);_0x2db3bc(_0x3a6b85);});});}exports['GetServicenowAccount']=function(_0x5652d9){var _0x4d8f9f=this;return new Promise(function(_0x9a73f4,_0x34c2df){return db['ServicenowAccount'][_0x98aa('0x14')]({'raw':_0x5652d9['options']?_0x5652d9[_0x98aa('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5652d9['options']?_0x5652d9['options'][_0x98aa('0x16')]||null:null,'attributes':_0x5652d9[_0x98aa('0x15')]?_0x5652d9[_0x98aa('0x15')][_0x98aa('0x17')]||null:null,'limit':_0x5652d9[_0x98aa('0x15')]?_0x5652d9[_0x98aa('0x15')][_0x98aa('0x18')]||null:null,'include':_0x5652d9['options']?_0x5652d9[_0x98aa('0x15')][_0x98aa('0x19')]?_[_0x98aa('0x1a')](_0x5652d9[_0x98aa('0x15')][_0x98aa('0x19')],function(_0x29a93a){return{'model':db[_0x29a93a['model']],'as':_0x29a93a['as'],'attributes':_0x29a93a['attributes'],'include':_0x29a93a[_0x98aa('0x19')]?_[_0x98aa('0x1a')](_0x29a93a[_0x98aa('0x19')],function(_0x582be7){return{'model':db[_0x582be7['model']],'as':_0x582be7['as'],'attributes':_0x582be7['attributes'],'include':_0x582be7[_0x98aa('0x19')]?_['map'](_0x582be7[_0x98aa('0x19')],function(_0x297456){return{'model':db[_0x297456[_0x98aa('0x1b')]],'as':_0x297456['as'],'attributes':_0x297456['attributes']};}):[]};}):[]};}):[]:[]})[_0x98aa('0xa')](function(_0x4ca3be){logger['info'](_0x98aa('0x1c'),_0x5652d9);logger[_0x98aa('0xd')](_0x98aa('0x1c'),_0x5652d9,JSON['stringify'](_0x4ca3be));_0x9a73f4(_0x4ca3be);})['catch'](function(_0x3222af){logger[_0x98aa('0xf')](_0x98aa('0x1c'),_0x3222af['message'],_0x5652d9);_0x34c2df(_0x4d8f9f['error'](0x1f4,_0x3222af['message']));});});};exports[_0x98aa('0x1d')]=function(_0x3b57ac){var _0x403e2b=this;return new Promise(function(_0x34edcd,_0x124f52){return db[_0x98aa('0x1e')][_0x98aa('0x1f')]({'raw':_0x3b57ac[_0x98aa('0x15')]?_0x3b57ac[_0x98aa('0x15')][_0x98aa('0x20')]===undefined?!![]:![]:!![],'where':_0x3b57ac['options']?_0x3b57ac['options'][_0x98aa('0x16')]||null:null,'attributes':_0x3b57ac[_0x98aa('0x15')]?_0x3b57ac['options'][_0x98aa('0x17')]||null:null,'include':_0x3b57ac[_0x98aa('0x15')]?_0x3b57ac[_0x98aa('0x15')]['include']?_[_0x98aa('0x1a')](_0x3b57ac['options'][_0x98aa('0x19')],function(_0x59ca40){return{'model':db[_0x59ca40[_0x98aa('0x1b')]],'as':_0x59ca40['as'],'attributes':_0x59ca40[_0x98aa('0x17')],'include':_0x59ca40[_0x98aa('0x19')]?_[_0x98aa('0x1a')](_0x59ca40[_0x98aa('0x19')],function(_0x30d760){return{'model':db[_0x30d760[_0x98aa('0x1b')]],'as':_0x30d760['as'],'attributes':_0x30d760[_0x98aa('0x17')],'include':_0x30d760[_0x98aa('0x19')]?_['map'](_0x30d760[_0x98aa('0x19')],function(_0x428dcd){return{'model':db[_0x428dcd['model']],'as':_0x428dcd['as'],'attributes':_0x428dcd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17ee0e){logger['info']('ShowServicenowAccount',_0x3b57ac);logger[_0x98aa('0xd')](_0x98aa('0x1d'),_0x3b57ac,JSON[_0x98aa('0x21')](_0x17ee0e));_0x34edcd(_0x17ee0e);})[_0x98aa('0x13')](function(_0x1ff3f4){logger[_0x98aa('0xf')](_0x98aa('0x1d'),_0x1ff3f4[_0x98aa('0x11')],_0x3b57ac);_0x124f52(_0x403e2b[_0x98aa('0xf')](0x1f4,_0x1ff3f4[_0x98aa('0x11')]));});});}; \ No newline at end of file +var _0x0e4e=['attributes','limit','map','include','ShowServicenowAccount','model','lodash','util','moment','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetServicenowAccount','options','raw','where'];(function(_0x2b66a9,_0x4262de){var _0x347ed4=function(_0xbdb6fa){while(--_0xbdb6fa){_0x2b66a9['push'](_0x2b66a9['shift']());}};_0x347ed4(++_0x4262de);}(_0x0e4e,0x1d7));var _0xe0e4=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x0e4e[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xe0e4('0x0'));var util=require(_0xe0e4('0x1'));var moment=require(_0xe0e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe0e4('0x4'))('rpc');var config=require(_0xe0e4('0x5'));var jayson=require(_0xe0e4('0x6'));var client=jayson[_0xe0e4('0x7')][_0xe0e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdf69d2,_0x58ef5b,_0x428ff1){return new BPromise(function(_0x551d58,_0x4ab631){return client[_0xe0e4('0x9')](_0xdf69d2,_0x428ff1)[_0xe0e4('0xa')](function(_0x144d14){logger['info'](_0xe0e4('0xb'),_0x58ef5b,'request\x20sent');logger[_0xe0e4('0xc')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x58ef5b,_0xe0e4('0xd'),JSON[_0xe0e4('0xe')](_0x144d14));if(_0x144d14['error']){if(_0x144d14[_0xe0e4('0xf')][_0xe0e4('0x10')]===0x1f4){logger[_0xe0e4('0xf')](_0xe0e4('0xb'),_0x58ef5b,_0x144d14[_0xe0e4('0xf')][_0xe0e4('0x11')]);return _0x4ab631(_0x144d14[_0xe0e4('0xf')]['message']);}logger[_0xe0e4('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x58ef5b,_0x144d14[_0xe0e4('0xf')][_0xe0e4('0x11')]);return _0x551d58(_0x144d14[_0xe0e4('0xf')][_0xe0e4('0x11')]);}else{logger[_0xe0e4('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x58ef5b,'request\x20sent');_0x551d58(_0x144d14[_0xe0e4('0x13')][_0xe0e4('0x11')]);}})[_0xe0e4('0x14')](function(_0x2b8ee4){logger[_0xe0e4('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x58ef5b,_0x2b8ee4);_0x4ab631(_0x2b8ee4);});});}exports[_0xe0e4('0x15')]=function(_0x1d0c7d){var _0x1c0f7b=this;return new Promise(function(_0x265881,_0x45bbaa){return db['ServicenowAccount']['findAll']({'raw':_0x1d0c7d[_0xe0e4('0x16')]?_0x1d0c7d['options'][_0xe0e4('0x17')]===undefined?!![]:![]:!![],'where':_0x1d0c7d[_0xe0e4('0x16')]?_0x1d0c7d[_0xe0e4('0x16')][_0xe0e4('0x18')]||null:null,'attributes':_0x1d0c7d['options']?_0x1d0c7d[_0xe0e4('0x16')][_0xe0e4('0x19')]||null:null,'limit':_0x1d0c7d['options']?_0x1d0c7d['options'][_0xe0e4('0x1a')]||null:null,'include':_0x1d0c7d[_0xe0e4('0x16')]?_0x1d0c7d[_0xe0e4('0x16')]['include']?_[_0xe0e4('0x1b')](_0x1d0c7d[_0xe0e4('0x16')][_0xe0e4('0x1c')],function(_0x58f6ab){return{'model':db[_0x58f6ab['model']],'as':_0x58f6ab['as'],'attributes':_0x58f6ab[_0xe0e4('0x19')],'include':_0x58f6ab['include']?_[_0xe0e4('0x1b')](_0x58f6ab[_0xe0e4('0x1c')],function(_0x4f6378){return{'model':db[_0x4f6378['model']],'as':_0x4f6378['as'],'attributes':_0x4f6378[_0xe0e4('0x19')],'include':_0x4f6378['include']?_['map'](_0x4f6378[_0xe0e4('0x1c')],function(_0x366cb4){return{'model':db[_0x366cb4['model']],'as':_0x366cb4['as'],'attributes':_0x366cb4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe0e4('0xa')](function(_0x56dda6){logger[_0xe0e4('0x12')](_0xe0e4('0x15'),_0x1d0c7d);logger[_0xe0e4('0xc')]('GetServicenowAccount',_0x1d0c7d,JSON[_0xe0e4('0xe')](_0x56dda6));_0x265881(_0x56dda6);})[_0xe0e4('0x14')](function(_0x4afd59){logger[_0xe0e4('0xf')](_0xe0e4('0x15'),_0x4afd59['message'],_0x1d0c7d);_0x45bbaa(_0x1c0f7b[_0xe0e4('0xf')](0x1f4,_0x4afd59['message']));});});};exports[_0xe0e4('0x1d')]=function(_0x2c708a){var _0xa0025b=this;return new Promise(function(_0x1b2b8a,_0x50e769){return db['ServicenowAccount']['find']({'raw':_0x2c708a[_0xe0e4('0x16')]?_0x2c708a[_0xe0e4('0x16')][_0xe0e4('0x17')]===undefined?!![]:![]:!![],'where':_0x2c708a[_0xe0e4('0x16')]?_0x2c708a[_0xe0e4('0x16')][_0xe0e4('0x18')]||null:null,'attributes':_0x2c708a[_0xe0e4('0x16')]?_0x2c708a[_0xe0e4('0x16')][_0xe0e4('0x19')]||null:null,'include':_0x2c708a[_0xe0e4('0x16')]?_0x2c708a['options'][_0xe0e4('0x1c')]?_[_0xe0e4('0x1b')](_0x2c708a[_0xe0e4('0x16')]['include'],function(_0x4f7a35){return{'model':db[_0x4f7a35[_0xe0e4('0x1e')]],'as':_0x4f7a35['as'],'attributes':_0x4f7a35[_0xe0e4('0x19')],'include':_0x4f7a35[_0xe0e4('0x1c')]?_['map'](_0x4f7a35[_0xe0e4('0x1c')],function(_0x5d02d3){return{'model':db[_0x5d02d3[_0xe0e4('0x1e')]],'as':_0x5d02d3['as'],'attributes':_0x5d02d3[_0xe0e4('0x19')],'include':_0x5d02d3['include']?_[_0xe0e4('0x1b')](_0x5d02d3[_0xe0e4('0x1c')],function(_0x1ad7a5){return{'model':db[_0x1ad7a5['model']],'as':_0x1ad7a5['as'],'attributes':_0x1ad7a5[_0xe0e4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe0e4('0xa')](function(_0x332b3e){logger[_0xe0e4('0x12')](_0xe0e4('0x1d'),_0x2c708a);logger[_0xe0e4('0xc')](_0xe0e4('0x1d'),_0x2c708a,JSON[_0xe0e4('0xe')](_0x332b3e));_0x1b2b8a(_0x332b3e);})[_0xe0e4('0x14')](function(_0x3c6ab2){logger['error'](_0xe0e4('0x1d'),_0x3c6ab2[_0xe0e4('0x11')],_0x2c708a);_0x50e769(_0xa0025b[_0xe0e4('0xf')](0x1f4,_0x3c6ab2[_0xe0e4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 51fd73d..884fb85 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 _0xb186=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','post','create','put','/:id','delete'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xb186,0x18e));var _0x6b18=function(_0x2b9e3c,_0x385f13){_0x2b9e3c=_0x2b9e3c-0x0;var _0x481485=_0xb186[_0x2b9e3c];return _0x481485;};'use strict';var multer=require(_0x6b18('0x0'));var util=require(_0x6b18('0x1'));var path=require(_0x6b18('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b18('0x3'));var router=express[_0x6b18('0x4')]();var fs_extra=require(_0x6b18('0x5'));var auth=require(_0x6b18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b18('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x6b18('0x8')](),controller[_0x6b18('0x9')]);router[_0x6b18('0xa')]('/:id',auth[_0x6b18('0x8')](),controller[_0x6b18('0xb')]);router[_0x6b18('0xa')](_0x6b18('0xc'),auth[_0x6b18('0x8')](),controller[_0x6b18('0xd')]);router[_0x6b18('0xa')](_0x6b18('0xe'),auth[_0x6b18('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x6b18('0x8')](),controller['getDescriptions']);router[_0x6b18('0xf')]('/',auth[_0x6b18('0x8')](),controller[_0x6b18('0x10')]);router[_0x6b18('0x11')](_0x6b18('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x6b18('0x13')]('/:id',auth[_0x6b18('0x8')](),controller[_0x6b18('0x14')]);module[_0x6b18('0x15')]=router; \ No newline at end of file +var _0x30f6=['index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0x30f6,0xf3));var _0x630f=function(_0x38d977,_0x42be1d){_0x38d977=_0x38d977-0x0;var _0x355379=_0x30f6[_0x38d977];return _0x355379;};'use strict';var multer=require('multer');var util=require(_0x630f('0x0'));var path=require(_0x630f('0x1'));var timeout=require('connect-timeout');var express=require(_0x630f('0x2'));var router=express['Router']();var fs_extra=require(_0x630f('0x3'));var auth=require(_0x630f('0x4'));var interaction=require(_0x630f('0x5'));var config=require(_0x630f('0x6'));var controller=require(_0x630f('0x7'));router[_0x630f('0x8')]('/',auth[_0x630f('0x9')](),controller[_0x630f('0xa')]);router[_0x630f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x630f('0xb')]);router[_0x630f('0x8')](_0x630f('0xc'),auth[_0x630f('0x9')](),controller[_0x630f('0xd')]);router[_0x630f('0x8')](_0x630f('0xe'),auth[_0x630f('0x9')](),controller['getSubjects']);router[_0x630f('0x8')](_0x630f('0xf'),auth[_0x630f('0x9')](),controller[_0x630f('0x10')]);router['post']('/',auth[_0x630f('0x9')](),controller['create']);router[_0x630f('0x11')](_0x630f('0x12'),auth[_0x630f('0x9')](),controller[_0x630f('0x13')]);router[_0x630f('0x14')]('/:id',auth[_0x630f('0x9')](),controller[_0x630f('0x15')]);module[_0x630f('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 26b6594..1fe9aa7 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 _0xabf7=['exports','STRING'];(function(_0x19f866,_0xf68c27){var _0x59bf91=function(_0x315b27){while(--_0x315b27){_0x19f866['push'](_0x19f866['shift']());}};_0x59bf91(++_0xf68c27);}(_0xabf7,0x128));var _0x7abf=function(_0x565d9e,_0x1c4cab){_0x565d9e=_0x565d9e-0x0;var _0x3d4d01=_0xabf7[_0x565d9e];return _0x3d4d01;};'use strict';var Sequelize=require('sequelize');module[_0x7abf('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7abf('0x1')]}}; \ No newline at end of file +var _0x7eab=['exports','STRING','sequelize'];(function(_0x4b7e1c,_0x2c80ed){var _0x4fe3f2=function(_0x17a638){while(--_0x17a638){_0x4b7e1c['push'](_0x4b7e1c['shift']());}};_0x4fe3f2(++_0x2c80ed);}(_0x7eab,0x8f));var _0xb7ea=function(_0x38ead5,_0x5b4fa2){_0x38ead5=_0x38ead5-0x0;var _0x4e40bc=_0x7eab[_0x38ead5];return _0x4e40bc;};'use strict';var Sequelize=require(_0xb7ea('0x0'));module[_0xb7ea('0x1')]={'name':{'type':Sequelize[_0xb7ea('0x2')]},'description':{'type':Sequelize[_0xb7ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 00907c9..bf9e691 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 _0xf84d=['getFields','findOne','getSubjects','getDescriptions','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','map','ServicenowConfiguration','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','catch','ServicenowField','merge','options'];(function(_0x68d93,_0x54d341){var _0x4390fc=function(_0x47ccb5){while(--_0x47ccb5){_0x68d93['push'](_0x68d93['shift']());}};_0x4390fc(++_0x54d341);}(_0xf84d,0xe8));var _0xdf84=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0xf84d[_0x496738];return _0xee1381;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf84('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf84('0x1'));var moment=require('moment');var BPromise=require(_0xdf84('0x2'));var Mustache=require(_0xdf84('0x3'));var util=require(_0xdf84('0x4'));var path=require('path');var sox=require(_0xdf84('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf84('0x6'));var _=require(_0xdf84('0x7'));var squel=require(_0xdf84('0x8'));var crypto=require(_0xdf84('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf84('0xa'));var querystring=require('querystring');var Papa=require(_0xdf84('0xb'));var Redis=require(_0xdf84('0xc'));var authService=require(_0xdf84('0xd'));var qs=require(_0xdf84('0xe'));var as=require(_0xdf84('0xf'));var hardwareService=require(_0xdf84('0x10'));var logger=require(_0xdf84('0x11'))('api');var utils=require(_0xdf84('0x12'));var config=require(_0xdf84('0x13'));var licenseUtil=require(_0xdf84('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0e375,_0x25bbf1){_0x25bbf1=_0x25bbf1||0xcc;return function(_0x52ff25){if(_0x52ff25){return _0xd0e375[_0xdf84('0x15')](_0x25bbf1);}return _0xd0e375[_0xdf84('0x16')](_0x25bbf1)['end']();};}function respondWithResult(_0x22e093,_0x317d86){_0x317d86=_0x317d86||0xc8;return function(_0x8b32cb){if(_0x8b32cb){return _0x22e093[_0xdf84('0x16')](_0x317d86)[_0xdf84('0x17')](_0x8b32cb);}};}function respondWithFilteredResult(_0x5901a8,_0x59e076){return function(_0x838e0f){if(_0x838e0f){var _0x2baa72=typeof _0x59e076['offset']==='undefined'&&typeof _0x59e076['limit']==='undefined';var _0x50e6f6=_0x838e0f['count'];var _0x4dcb96=_0x2baa72?0x0:_0x59e076[_0xdf84('0x18')];var _0x455eac=_0x2baa72?_0x838e0f[_0xdf84('0x19')]:_0x59e076[_0xdf84('0x18')]+_0x59e076[_0xdf84('0x1a')];var _0x864c44;if(_0x455eac>=_0x50e6f6){_0x455eac=_0x50e6f6;_0x864c44=0xc8;}else{_0x864c44=0xce;}_0x5901a8[_0xdf84('0x16')](_0x864c44);return _0x5901a8[_0xdf84('0x1b')](_0xdf84('0x1c'),_0x4dcb96+'-'+_0x455eac+'/'+_0x50e6f6)[_0xdf84('0x17')](_0x838e0f);}return null;};}function patchUpdates(_0x2b6489){return function(_0x5f05c7){try{jsonpatch[_0xdf84('0x1d')](_0x5f05c7,_0x2b6489,!![]);}catch(_0x20e15f){return BPromise[_0xdf84('0x1e')](_0x20e15f);}return _0x5f05c7[_0xdf84('0x1f')]();};}function saveUpdates(_0x184b86,_0x578045){return function(_0x376ac5){if(_0x376ac5){return _0x376ac5[_0xdf84('0x20')](_0x184b86)[_0xdf84('0x21')](function(_0xc89880){return _0xc89880;});}return null;};}function removeEntity(_0x521108,_0x5cf0b2){return function(_0x44b3ae){if(_0x44b3ae){return _0x44b3ae[_0xdf84('0x22')]()[_0xdf84('0x21')](function(){_0x521108[_0xdf84('0x16')](0xcc)[_0xdf84('0x23')]();});}};}function handleEntityNotFound(_0x2218b8,_0x1651fc){return function(_0x138114){if(!_0x138114){_0x2218b8['sendStatus'](0x194);}return _0x138114;};}function handleError(_0x4a3760,_0x246eeb){_0x246eeb=_0x246eeb||0x1f4;return function(_0x295320){logger['error'](_0x295320[_0xdf84('0x24')]);if(_0x295320['name']){delete _0x295320['name'];}_0x4a3760[_0xdf84('0x16')](_0x246eeb)[_0xdf84('0x25')](_0x295320);};}exports['index']=function(_0x4c2fb1,_0x25560f){var _0x22b4ce={},_0x4809ee={},_0x50867d={'count':0x0,'rows':[]};var _0x395997=_[_0xdf84('0x26')](db[_0xdf84('0x27')][_0xdf84('0x28')],function(_0x5cf847){return{'name':_0x5cf847['fieldName'],'type':_0x5cf847[_0xdf84('0x29')]['key']};});_0x4809ee['model']=_[_0xdf84('0x26')](_0x395997,_0xdf84('0x2a'));_0x4809ee[_0xdf84('0x2b')]=_['keys'](_0x4c2fb1[_0xdf84('0x2b')]);_0x4809ee[_0xdf84('0x2c')]=_[_0xdf84('0x2d')](_0x4809ee[_0xdf84('0x2e')],_0x4809ee[_0xdf84('0x2b')]);_0x22b4ce[_0xdf84('0x2f')]=_['intersection'](_0x4809ee['model'],qs[_0xdf84('0x30')](_0x4c2fb1[_0xdf84('0x2b')][_0xdf84('0x30')]));_0x22b4ce[_0xdf84('0x2f')]=_0x22b4ce[_0xdf84('0x2f')]['length']?_0x22b4ce[_0xdf84('0x2f')]:_0x4809ee[_0xdf84('0x2e')];if(!_0x4c2fb1[_0xdf84('0x2b')][_0xdf84('0x31')](_0xdf84('0x32'))){_0x22b4ce[_0xdf84('0x1a')]=qs[_0xdf84('0x1a')](_0x4c2fb1[_0xdf84('0x2b')]['limit']);_0x22b4ce[_0xdf84('0x18')]=qs[_0xdf84('0x18')](_0x4c2fb1['query'][_0xdf84('0x18')]);}_0x22b4ce[_0xdf84('0x33')]=qs[_0xdf84('0x34')](_0x4c2fb1[_0xdf84('0x2b')][_0xdf84('0x34')]);_0x22b4ce[_0xdf84('0x35')]=qs[_0xdf84('0x2c')](_[_0xdf84('0x36')](_0x4c2fb1[_0xdf84('0x2b')],_0x4809ee[_0xdf84('0x2c')]),_0x395997);if(_0x4c2fb1[_0xdf84('0x2b')][_0xdf84('0x37')]){_0x22b4ce[_0xdf84('0x35')]=_['merge'](_0x22b4ce['where'],{'$or':_[_0xdf84('0x26')](_0x395997,function(_0x5bca9f){if(_0x5bca9f[_0xdf84('0x29')]!==_0xdf84('0x38')){var _0x5ebdd2={};_0x5ebdd2[_0x5bca9f['name']]={'$like':'%'+_0x4c2fb1[_0xdf84('0x2b')]['filter']+'%'};return _0x5ebdd2;}})});}_0x22b4ce=_['merge']({},_0x22b4ce,_0x4c2fb1['options']);var _0x47d34a={'where':_0x22b4ce['where']};return db[_0xdf84('0x27')][_0xdf84('0x19')](_0x47d34a)[_0xdf84('0x21')](function(_0x2d32e1){_0x50867d['count']=_0x2d32e1;if(_0x4c2fb1['query'][_0xdf84('0x39')]){_0x22b4ce[_0xdf84('0x3a')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xdf84('0x3b')](_0x22b4ce);})['then'](function(_0x3febb3){_0x50867d[_0xdf84('0x3c')]=_0x3febb3;return _0x50867d;})[_0xdf84('0x21')](respondWithFilteredResult(_0x25560f,_0x22b4ce))['catch'](handleError(_0x25560f,null));};exports[_0xdf84('0x3d')]=function(_0x3f4dbe,_0xf76113){var _0x3f391d={'raw':![],'where':{'id':_0x3f4dbe[_0xdf84('0x3e')]['id']}},_0x875793={};_0x875793[_0xdf84('0x2e')]=_['keys'](db[_0xdf84('0x27')][_0xdf84('0x28')]);_0x875793[_0xdf84('0x2b')]=_[_0xdf84('0x3f')](_0x3f4dbe[_0xdf84('0x2b')]);_0x875793['filters']=_[_0xdf84('0x2d')](_0x875793['model'],_0x875793[_0xdf84('0x2b')]);_0x3f391d[_0xdf84('0x2f')]=_[_0xdf84('0x2d')](_0x875793['model'],qs[_0xdf84('0x30')](_0x3f4dbe[_0xdf84('0x2b')][_0xdf84('0x30')]));_0x3f391d[_0xdf84('0x2f')]=_0x3f391d['attributes'][_0xdf84('0x40')]?_0x3f391d['attributes']:_0x875793[_0xdf84('0x2e')];if(_0x3f4dbe[_0xdf84('0x2b')][_0xdf84('0x39')]){_0x3f391d['include']=[{'all':!![]}];}_0x3f391d=_['merge']({},_0x3f391d,_0x3f4dbe['options']);return db[_0xdf84('0x27')][_0xdf84('0x41')](_0x3f391d)[_0xdf84('0x21')](handleEntityNotFound(_0xf76113,null))[_0xdf84('0x21')](respondWithResult(_0xf76113,null))['catch'](handleError(_0xf76113,null));};exports[_0xdf84('0x42')]=function(_0x3ea28b,_0x1aeb10){return db[_0xdf84('0x27')]['create'](_0x3ea28b[_0xdf84('0x43')],{})['then'](respondWithResult(_0x1aeb10,0xc9))['catch'](handleError(_0x1aeb10,null));};exports[_0xdf84('0x20')]=function(_0x4bb279,_0x391c15){if(_0x4bb279[_0xdf84('0x43')]['id']){delete _0x4bb279[_0xdf84('0x43')]['id'];}return db[_0xdf84('0x27')][_0xdf84('0x41')]({'where':{'id':_0x4bb279[_0xdf84('0x3e')]['id']}})[_0xdf84('0x21')](handleEntityNotFound(_0x391c15,null))[_0xdf84('0x21')](saveUpdates(_0x4bb279[_0xdf84('0x43')],null))[_0xdf84('0x21')](respondWithResult(_0x391c15,null))[_0xdf84('0x44')](handleError(_0x391c15,null));};exports[_0xdf84('0x22')]=function(_0x249d64,_0x11c798){return db[_0xdf84('0x27')][_0xdf84('0x41')]({'where':{'id':_0x249d64[_0xdf84('0x3e')]['id']}})['then'](handleEntityNotFound(_0x11c798,null))['then'](removeEntity(_0x11c798,null))[_0xdf84('0x44')](handleError(_0x11c798,null));};exports['getFields']=function(_0x427a4f,_0x248abd,_0x2c0096){var _0x51b11f={};var _0x5bd73c={};var _0x3e571a;var _0x379945;return db[_0xdf84('0x27')]['findOne']({'where':{'id':_0x427a4f[_0xdf84('0x3e')]['id']}})[_0xdf84('0x21')](handleEntityNotFound(_0x248abd,null))[_0xdf84('0x21')](function(_0x10ea0f){if(_0x10ea0f){_0x3e571a=_0x10ea0f;_0x5bd73c[_0xdf84('0x2e')]=_[_0xdf84('0x3f')](db[_0xdf84('0x45')]['rawAttributes']);_0x5bd73c[_0xdf84('0x2b')]=_['keys'](_0x427a4f[_0xdf84('0x2b')]);_0x5bd73c[_0xdf84('0x2c')]=_[_0xdf84('0x2d')](_0x5bd73c[_0xdf84('0x2e')],_0x5bd73c['query']);_0x51b11f[_0xdf84('0x2f')]=_[_0xdf84('0x2d')](_0x5bd73c[_0xdf84('0x2e')],qs['fields'](_0x427a4f[_0xdf84('0x2b')][_0xdf84('0x30')]));_0x51b11f[_0xdf84('0x2f')]=_0x51b11f[_0xdf84('0x2f')][_0xdf84('0x40')]?_0x51b11f['attributes']:_0x5bd73c[_0xdf84('0x2e')];_0x51b11f[_0xdf84('0x33')]=qs['sort'](_0x427a4f[_0xdf84('0x2b')][_0xdf84('0x34')]);_0x51b11f[_0xdf84('0x35')]=qs[_0xdf84('0x2c')](_['pick'](_0x427a4f[_0xdf84('0x2b')],_0x5bd73c['filters']));if(_0x427a4f['query'][_0xdf84('0x37')]){_0x51b11f[_0xdf84('0x35')]=_[_0xdf84('0x46')](_0x51b11f[_0xdf84('0x35')],{'$or':_[_0xdf84('0x26')](_0x51b11f['attributes'],function(_0x514008){var _0x3d4e25={};_0x3d4e25[_0x514008]={'$like':'%'+_0x427a4f['query']['filter']+'%'};return _0x3d4e25;})});}_0x51b11f=_['merge']({},_0x51b11f,_0x427a4f[_0xdf84('0x47')]);return _0x3e571a[_0xdf84('0x48')](_0x51b11f);}})[_0xdf84('0x21')](function(_0x42783e){if(_0x42783e){_0x379945=_0x42783e[_0xdf84('0x40')];if(!_0x427a4f[_0xdf84('0x2b')]['hasOwnProperty'](_0xdf84('0x32'))){_0x51b11f[_0xdf84('0x1a')]=qs['limit'](_0x427a4f['query']['limit']);_0x51b11f[_0xdf84('0x18')]=qs['offset'](_0x427a4f[_0xdf84('0x2b')][_0xdf84('0x18')]);}return _0x3e571a[_0xdf84('0x48')](_0x51b11f);}})[_0xdf84('0x21')](function(_0x1641a2){if(_0x1641a2){return _0x1641a2?{'count':_0x379945,'rows':_0x1641a2}:null;}})[_0xdf84('0x21')](respondWithResult(_0x248abd,null))[_0xdf84('0x44')](handleError(_0x248abd,null));};exports['getSubjects']=function(_0x78b6ae,_0x145d4d,_0x2710dc){var _0x250503={};var _0x1fbe42={};var _0xdbbcce;var _0x5bd61f;return db[_0xdf84('0x27')][_0xdf84('0x49')]({'where':{'id':_0x78b6ae[_0xdf84('0x3e')]['id']}})[_0xdf84('0x21')](handleEntityNotFound(_0x145d4d,null))[_0xdf84('0x21')](function(_0x2ce933){if(_0x2ce933){_0xdbbcce=_0x2ce933;_0x1fbe42[_0xdf84('0x2e')]=_['keys'](db[_0xdf84('0x45')][_0xdf84('0x28')]);_0x1fbe42[_0xdf84('0x2b')]=_[_0xdf84('0x3f')](_0x78b6ae[_0xdf84('0x2b')]);_0x1fbe42['filters']=_['intersection'](_0x1fbe42[_0xdf84('0x2e')],_0x1fbe42['query']);_0x250503[_0xdf84('0x2f')]=_[_0xdf84('0x2d')](_0x1fbe42[_0xdf84('0x2e')],qs[_0xdf84('0x30')](_0x78b6ae[_0xdf84('0x2b')]['fields']));_0x250503[_0xdf84('0x2f')]=_0x250503[_0xdf84('0x2f')]['length']?_0x250503['attributes']:_0x1fbe42[_0xdf84('0x2e')];_0x250503[_0xdf84('0x33')]=qs['sort'](_0x78b6ae[_0xdf84('0x2b')]['sort']);_0x250503[_0xdf84('0x35')]=qs[_0xdf84('0x2c')](_[_0xdf84('0x36')](_0x78b6ae['query'],_0x1fbe42['filters']));if(_0x78b6ae[_0xdf84('0x2b')]['filter']){_0x250503[_0xdf84('0x35')]=_[_0xdf84('0x46')](_0x250503[_0xdf84('0x35')],{'$or':_[_0xdf84('0x26')](_0x250503[_0xdf84('0x2f')],function(_0x30c5b0){var _0x2c8174={};_0x2c8174[_0x30c5b0]={'$like':'%'+_0x78b6ae[_0xdf84('0x2b')][_0xdf84('0x37')]+'%'};return _0x2c8174;})});}_0x250503=_[_0xdf84('0x46')]({},_0x250503,_0x78b6ae['options']);return _0xdbbcce['getSubjects'](_0x250503);}})['then'](function(_0x245bd6){if(_0x245bd6){_0x5bd61f=_0x245bd6[_0xdf84('0x40')];if(!_0x78b6ae[_0xdf84('0x2b')]['hasOwnProperty'](_0xdf84('0x32'))){_0x250503['limit']=qs[_0xdf84('0x1a')](_0x78b6ae[_0xdf84('0x2b')][_0xdf84('0x1a')]);_0x250503[_0xdf84('0x18')]=qs[_0xdf84('0x18')](_0x78b6ae[_0xdf84('0x2b')][_0xdf84('0x18')]);}return _0xdbbcce[_0xdf84('0x4a')](_0x250503);}})[_0xdf84('0x21')](function(_0x59cb57){if(_0x59cb57){return _0x59cb57?{'count':_0x5bd61f,'rows':_0x59cb57}:null;}})[_0xdf84('0x21')](respondWithResult(_0x145d4d,null))['catch'](handleError(_0x145d4d,null));};exports[_0xdf84('0x4b')]=function(_0x4accb2,_0x5db54a,_0x27d793){var _0x54e06b={};var _0x44bfe3={};var _0x521178;var _0x2a553f;return db[_0xdf84('0x27')]['findOne']({'where':{'id':_0x4accb2[_0xdf84('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5db54a,null))[_0xdf84('0x21')](function(_0x56f78e){if(_0x56f78e){_0x521178=_0x56f78e;_0x44bfe3[_0xdf84('0x2e')]=_[_0xdf84('0x3f')](db[_0xdf84('0x45')][_0xdf84('0x28')]);_0x44bfe3[_0xdf84('0x2b')]=_[_0xdf84('0x3f')](_0x4accb2[_0xdf84('0x2b')]);_0x44bfe3[_0xdf84('0x2c')]=_[_0xdf84('0x2d')](_0x44bfe3[_0xdf84('0x2e')],_0x44bfe3[_0xdf84('0x2b')]);_0x54e06b['attributes']=_['intersection'](_0x44bfe3[_0xdf84('0x2e')],qs[_0xdf84('0x30')](_0x4accb2['query'][_0xdf84('0x30')]));_0x54e06b[_0xdf84('0x2f')]=_0x54e06b[_0xdf84('0x2f')][_0xdf84('0x40')]?_0x54e06b[_0xdf84('0x2f')]:_0x44bfe3[_0xdf84('0x2e')];_0x54e06b[_0xdf84('0x33')]=qs[_0xdf84('0x34')](_0x4accb2[_0xdf84('0x2b')][_0xdf84('0x34')]);_0x54e06b[_0xdf84('0x35')]=qs[_0xdf84('0x2c')](_[_0xdf84('0x36')](_0x4accb2[_0xdf84('0x2b')],_0x44bfe3[_0xdf84('0x2c')]));if(_0x4accb2[_0xdf84('0x2b')][_0xdf84('0x37')]){_0x54e06b[_0xdf84('0x35')]=_[_0xdf84('0x46')](_0x54e06b['where'],{'$or':_[_0xdf84('0x26')](_0x54e06b[_0xdf84('0x2f')],function(_0x2cfd43){var _0xbaba7b={};_0xbaba7b[_0x2cfd43]={'$like':'%'+_0x4accb2[_0xdf84('0x2b')]['filter']+'%'};return _0xbaba7b;})});}_0x54e06b=_[_0xdf84('0x46')]({},_0x54e06b,_0x4accb2[_0xdf84('0x47')]);return _0x521178[_0xdf84('0x4b')](_0x54e06b);}})[_0xdf84('0x21')](function(_0x641f23){if(_0x641f23){_0x2a553f=_0x641f23[_0xdf84('0x40')];if(!_0x4accb2[_0xdf84('0x2b')][_0xdf84('0x31')](_0xdf84('0x32'))){_0x54e06b[_0xdf84('0x1a')]=qs[_0xdf84('0x1a')](_0x4accb2[_0xdf84('0x2b')][_0xdf84('0x1a')]);_0x54e06b[_0xdf84('0x18')]=qs['offset'](_0x4accb2[_0xdf84('0x2b')][_0xdf84('0x18')]);}return _0x521178[_0xdf84('0x4b')](_0x54e06b);}})[_0xdf84('0x21')](function(_0x51f2fc){if(_0x51f2fc){return _0x51f2fc?{'count':_0x2a553f,'rows':_0x51f2fc}:null;}})[_0xdf84('0x21')](respondWithResult(_0x5db54a,null))['catch'](handleError(_0x5db54a,null));}; \ No newline at end of file +var _0xe44c=['includeAll','include','findAll','show','params','catch','create','body','find','getFields','findOne','ServicenowField','order','sort','options','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL'];(function(_0xc9e961,_0x501980){var _0x529fa=function(_0x3076e4){while(--_0x3076e4){_0xc9e961['push'](_0xc9e961['shift']());}};_0x529fa(++_0x501980);}(_0xe44c,0x197));var _0xce44=function(_0xfc5a04,_0xb77332){_0xfc5a04=_0xfc5a04-0x0;var _0x24b690=_0xe44c[_0xfc5a04];return _0x24b690;};'use strict';var emlformat=require(_0xce44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce44('0x1'));var jsonpatch=require(_0xce44('0x2'));var rp=require('request-promise');var moment=require(_0xce44('0x3'));var BPromise=require(_0xce44('0x4'));var Mustache=require(_0xce44('0x5'));var util=require(_0xce44('0x6'));var path=require(_0xce44('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce44('0x8'));var fs=require('fs');var fs_extra=require(_0xce44('0x9'));var _=require(_0xce44('0xa'));var squel=require(_0xce44('0xb'));var crypto=require(_0xce44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce44('0xd'));var toCsv=require(_0xce44('0xe'));var querystring=require(_0xce44('0xf'));var Papa=require(_0xce44('0x10'));var Redis=require(_0xce44('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce44('0x12'));var hardwareService=require(_0xce44('0x13'));var logger=require(_0xce44('0x14'))('api');var utils=require(_0xce44('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xce44('0x16'));var db=require(_0xce44('0x17'))['db'];function respondWithStatusCode(_0x60c3ad,_0x491bae){_0x491bae=_0x491bae||0xcc;return function(_0x4bb575){if(_0x4bb575){return _0x60c3ad[_0xce44('0x18')](_0x491bae);}return _0x60c3ad['status'](_0x491bae)[_0xce44('0x19')]();};}function respondWithResult(_0x134ad7,_0x98b3f7){_0x98b3f7=_0x98b3f7||0xc8;return function(_0x7468f4){if(_0x7468f4){return _0x134ad7[_0xce44('0x1a')](_0x98b3f7)[_0xce44('0x1b')](_0x7468f4);}};}function respondWithFilteredResult(_0x21f5fa,_0x309887){return function(_0x15e426){if(_0x15e426){var _0x466ff2=typeof _0x309887[_0xce44('0x1c')]===_0xce44('0x1d')&&typeof _0x309887[_0xce44('0x1e')]==='undefined';var _0x4a4633=_0x15e426[_0xce44('0x1f')];var _0x48d1ee=_0x466ff2?0x0:_0x309887['offset'];var _0x44433c=_0x466ff2?_0x15e426[_0xce44('0x1f')]:_0x309887[_0xce44('0x1c')]+_0x309887[_0xce44('0x1e')];var _0x5e95bc;if(_0x44433c>=_0x4a4633){_0x44433c=_0x4a4633;_0x5e95bc=0xc8;}else{_0x5e95bc=0xce;}_0x21f5fa['status'](_0x5e95bc);return _0x21f5fa['set'](_0xce44('0x20'),_0x48d1ee+'-'+_0x44433c+'/'+_0x4a4633)[_0xce44('0x1b')](_0x15e426);}return null;};}function patchUpdates(_0x1a8afd){return function(_0x2db85c){try{jsonpatch['apply'](_0x2db85c,_0x1a8afd,!![]);}catch(_0x485e47){return BPromise[_0xce44('0x21')](_0x485e47);}return _0x2db85c[_0xce44('0x22')]();};}function saveUpdates(_0xa168e3,_0x500a22){return function(_0x5053de){if(_0x5053de){return _0x5053de[_0xce44('0x23')](_0xa168e3)[_0xce44('0x24')](function(_0x99825c){return _0x99825c;});}return null;};}function removeEntity(_0x6a5ba8,_0x1d6dba){return function(_0x2ba6ae){if(_0x2ba6ae){return _0x2ba6ae[_0xce44('0x25')]()[_0xce44('0x24')](function(){_0x6a5ba8[_0xce44('0x1a')](0xcc)[_0xce44('0x19')]();});}};}function handleEntityNotFound(_0x19884a,_0x9ddfdc){return function(_0x50e99e){if(!_0x50e99e){_0x19884a[_0xce44('0x18')](0x194);}return _0x50e99e;};}function handleError(_0x35a611,_0x87da4a){_0x87da4a=_0x87da4a||0x1f4;return function(_0x3115a7){logger['error'](_0x3115a7['stack']);if(_0x3115a7[_0xce44('0x26')]){delete _0x3115a7[_0xce44('0x26')];}_0x35a611[_0xce44('0x1a')](_0x87da4a)[_0xce44('0x27')](_0x3115a7);};}exports['index']=function(_0x25afad,_0x31b477){var _0x24ecf7={},_0x1c98eb={},_0x16fef5={'count':0x0,'rows':[]};var _0x538b15=_[_0xce44('0x28')](db[_0xce44('0x29')][_0xce44('0x2a')],function(_0x4a0527){return{'name':_0x4a0527[_0xce44('0x2b')],'type':_0x4a0527[_0xce44('0x2c')][_0xce44('0x2d')]};});_0x1c98eb[_0xce44('0x2e')]=_[_0xce44('0x28')](_0x538b15,'name');_0x1c98eb[_0xce44('0x2f')]=_[_0xce44('0x30')](_0x25afad[_0xce44('0x2f')]);_0x1c98eb[_0xce44('0x31')]=_[_0xce44('0x32')](_0x1c98eb[_0xce44('0x2e')],_0x1c98eb[_0xce44('0x2f')]);_0x24ecf7['attributes']=_[_0xce44('0x32')](_0x1c98eb['model'],qs[_0xce44('0x33')](_0x25afad['query'][_0xce44('0x33')]));_0x24ecf7[_0xce44('0x34')]=_0x24ecf7[_0xce44('0x34')][_0xce44('0x35')]?_0x24ecf7[_0xce44('0x34')]:_0x1c98eb[_0xce44('0x2e')];if(!_0x25afad[_0xce44('0x2f')][_0xce44('0x36')](_0xce44('0x37'))){_0x24ecf7[_0xce44('0x1e')]=qs['limit'](_0x25afad['query'][_0xce44('0x1e')]);_0x24ecf7[_0xce44('0x1c')]=qs['offset'](_0x25afad['query'][_0xce44('0x1c')]);}_0x24ecf7['order']=qs['sort'](_0x25afad['query']['sort']);_0x24ecf7[_0xce44('0x38')]=qs['filters'](_[_0xce44('0x39')](_0x25afad[_0xce44('0x2f')],_0x1c98eb[_0xce44('0x31')]),_0x538b15);if(_0x25afad[_0xce44('0x2f')][_0xce44('0x3a')]){_0x24ecf7[_0xce44('0x38')]=_[_0xce44('0x3b')](_0x24ecf7['where'],{'$or':_[_0xce44('0x28')](_0x538b15,function(_0x578a98){if(_0x578a98[_0xce44('0x2c')]!==_0xce44('0x3c')){var _0x1f8cb4={};_0x1f8cb4[_0x578a98[_0xce44('0x26')]]={'$like':'%'+_0x25afad[_0xce44('0x2f')][_0xce44('0x3a')]+'%'};return _0x1f8cb4;}})});}_0x24ecf7=_['merge']({},_0x24ecf7,_0x25afad['options']);var _0x228d9d={'where':_0x24ecf7['where']};return db['ServicenowConfiguration']['count'](_0x228d9d)[_0xce44('0x24')](function(_0x656b07){_0x16fef5[_0xce44('0x1f')]=_0x656b07;if(_0x25afad[_0xce44('0x2f')][_0xce44('0x3d')]){_0x24ecf7[_0xce44('0x3e')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xce44('0x3f')](_0x24ecf7);})[_0xce44('0x24')](function(_0x267d7a){_0x16fef5['rows']=_0x267d7a;return _0x16fef5;})[_0xce44('0x24')](respondWithFilteredResult(_0x31b477,_0x24ecf7))['catch'](handleError(_0x31b477,null));};exports[_0xce44('0x40')]=function(_0x904c8c,_0x2534a6){var _0x1876d5={'raw':![],'where':{'id':_0x904c8c[_0xce44('0x41')]['id']}},_0x1c9753={};_0x1c9753[_0xce44('0x2e')]=_[_0xce44('0x30')](db['ServicenowConfiguration'][_0xce44('0x2a')]);_0x1c9753['query']=_['keys'](_0x904c8c[_0xce44('0x2f')]);_0x1c9753['filters']=_[_0xce44('0x32')](_0x1c9753[_0xce44('0x2e')],_0x1c9753['query']);_0x1876d5[_0xce44('0x34')]=_[_0xce44('0x32')](_0x1c9753[_0xce44('0x2e')],qs[_0xce44('0x33')](_0x904c8c[_0xce44('0x2f')][_0xce44('0x33')]));_0x1876d5['attributes']=_0x1876d5['attributes'][_0xce44('0x35')]?_0x1876d5['attributes']:_0x1c9753[_0xce44('0x2e')];if(_0x904c8c[_0xce44('0x2f')][_0xce44('0x3d')]){_0x1876d5[_0xce44('0x3e')]=[{'all':!![]}];}_0x1876d5=_['merge']({},_0x1876d5,_0x904c8c['options']);return db[_0xce44('0x29')]['find'](_0x1876d5)[_0xce44('0x24')](handleEntityNotFound(_0x2534a6,null))[_0xce44('0x24')](respondWithResult(_0x2534a6,null))[_0xce44('0x42')](handleError(_0x2534a6,null));};exports['create']=function(_0x81843b,_0x1e5f8f){return db[_0xce44('0x29')][_0xce44('0x43')](_0x81843b[_0xce44('0x44')],{})[_0xce44('0x24')](respondWithResult(_0x1e5f8f,0xc9))[_0xce44('0x42')](handleError(_0x1e5f8f,null));};exports[_0xce44('0x23')]=function(_0x1fdbae,_0x5385c5){if(_0x1fdbae['body']['id']){delete _0x1fdbae[_0xce44('0x44')]['id'];}return db[_0xce44('0x29')][_0xce44('0x45')]({'where':{'id':_0x1fdbae[_0xce44('0x41')]['id']}})['then'](handleEntityNotFound(_0x5385c5,null))[_0xce44('0x24')](saveUpdates(_0x1fdbae[_0xce44('0x44')],null))[_0xce44('0x24')](respondWithResult(_0x5385c5,null))[_0xce44('0x42')](handleError(_0x5385c5,null));};exports['destroy']=function(_0x1ca179,_0x2d9d7a){return db['ServicenowConfiguration']['find']({'where':{'id':_0x1ca179[_0xce44('0x41')]['id']}})[_0xce44('0x24')](handleEntityNotFound(_0x2d9d7a,null))[_0xce44('0x24')](removeEntity(_0x2d9d7a,null))[_0xce44('0x42')](handleError(_0x2d9d7a,null));};exports[_0xce44('0x46')]=function(_0x50f4f8,_0x5064d2,_0x3e6983){var _0x24335b={};var _0x425e45={};var _0x129ffb;var _0x27653d;return db['ServicenowConfiguration'][_0xce44('0x47')]({'where':{'id':_0x50f4f8[_0xce44('0x41')]['id']}})[_0xce44('0x24')](handleEntityNotFound(_0x5064d2,null))['then'](function(_0x56d9f0){if(_0x56d9f0){_0x129ffb=_0x56d9f0;_0x425e45[_0xce44('0x2e')]=_['keys'](db[_0xce44('0x48')][_0xce44('0x2a')]);_0x425e45[_0xce44('0x2f')]=_[_0xce44('0x30')](_0x50f4f8[_0xce44('0x2f')]);_0x425e45[_0xce44('0x31')]=_['intersection'](_0x425e45[_0xce44('0x2e')],_0x425e45['query']);_0x24335b[_0xce44('0x34')]=_[_0xce44('0x32')](_0x425e45[_0xce44('0x2e')],qs[_0xce44('0x33')](_0x50f4f8['query'][_0xce44('0x33')]));_0x24335b[_0xce44('0x34')]=_0x24335b[_0xce44('0x34')]['length']?_0x24335b[_0xce44('0x34')]:_0x425e45[_0xce44('0x2e')];_0x24335b[_0xce44('0x49')]=qs['sort'](_0x50f4f8['query'][_0xce44('0x4a')]);_0x24335b[_0xce44('0x38')]=qs[_0xce44('0x31')](_[_0xce44('0x39')](_0x50f4f8[_0xce44('0x2f')],_0x425e45[_0xce44('0x31')]));if(_0x50f4f8['query'][_0xce44('0x3a')]){_0x24335b[_0xce44('0x38')]=_['merge'](_0x24335b['where'],{'$or':_['map'](_0x24335b[_0xce44('0x34')],function(_0xe2b9d3){var _0x30ed92={};_0x30ed92[_0xe2b9d3]={'$like':'%'+_0x50f4f8[_0xce44('0x2f')][_0xce44('0x3a')]+'%'};return _0x30ed92;})});}_0x24335b=_[_0xce44('0x3b')]({},_0x24335b,_0x50f4f8[_0xce44('0x4b')]);return _0x129ffb[_0xce44('0x46')](_0x24335b);}})[_0xce44('0x24')](function(_0x29a42a){if(_0x29a42a){_0x27653d=_0x29a42a[_0xce44('0x35')];if(!_0x50f4f8['query'][_0xce44('0x36')](_0xce44('0x37'))){_0x24335b[_0xce44('0x1e')]=qs['limit'](_0x50f4f8[_0xce44('0x2f')]['limit']);_0x24335b[_0xce44('0x1c')]=qs[_0xce44('0x1c')](_0x50f4f8[_0xce44('0x2f')]['offset']);}return _0x129ffb[_0xce44('0x46')](_0x24335b);}})['then'](function(_0xe04362){if(_0xe04362){return _0xe04362?{'count':_0x27653d,'rows':_0xe04362}:null;}})[_0xce44('0x24')](respondWithResult(_0x5064d2,null))[_0xce44('0x42')](handleError(_0x5064d2,null));};exports[_0xce44('0x4c')]=function(_0x2f2f90,_0x57e32c,_0x373fc0){var _0x16f41f={};var _0x41b923={};var _0x47e3ac;var _0x50c746;return db[_0xce44('0x29')][_0xce44('0x47')]({'where':{'id':_0x2f2f90[_0xce44('0x41')]['id']}})[_0xce44('0x24')](handleEntityNotFound(_0x57e32c,null))['then'](function(_0xc1038b){if(_0xc1038b){_0x47e3ac=_0xc1038b;_0x41b923[_0xce44('0x2e')]=_['keys'](db[_0xce44('0x48')][_0xce44('0x2a')]);_0x41b923[_0xce44('0x2f')]=_['keys'](_0x2f2f90[_0xce44('0x2f')]);_0x41b923[_0xce44('0x31')]=_['intersection'](_0x41b923['model'],_0x41b923[_0xce44('0x2f')]);_0x16f41f[_0xce44('0x34')]=_[_0xce44('0x32')](_0x41b923[_0xce44('0x2e')],qs['fields'](_0x2f2f90[_0xce44('0x2f')][_0xce44('0x33')]));_0x16f41f[_0xce44('0x34')]=_0x16f41f[_0xce44('0x34')][_0xce44('0x35')]?_0x16f41f[_0xce44('0x34')]:_0x41b923[_0xce44('0x2e')];_0x16f41f[_0xce44('0x49')]=qs['sort'](_0x2f2f90[_0xce44('0x2f')][_0xce44('0x4a')]);_0x16f41f['where']=qs[_0xce44('0x31')](_[_0xce44('0x39')](_0x2f2f90[_0xce44('0x2f')],_0x41b923[_0xce44('0x31')]));if(_0x2f2f90['query'][_0xce44('0x3a')]){_0x16f41f[_0xce44('0x38')]=_[_0xce44('0x3b')](_0x16f41f[_0xce44('0x38')],{'$or':_[_0xce44('0x28')](_0x16f41f[_0xce44('0x34')],function(_0x35e181){var _0x211589={};_0x211589[_0x35e181]={'$like':'%'+_0x2f2f90[_0xce44('0x2f')][_0xce44('0x3a')]+'%'};return _0x211589;})});}_0x16f41f=_[_0xce44('0x3b')]({},_0x16f41f,_0x2f2f90[_0xce44('0x4b')]);return _0x47e3ac[_0xce44('0x4c')](_0x16f41f);}})[_0xce44('0x24')](function(_0x4b6919){if(_0x4b6919){_0x50c746=_0x4b6919[_0xce44('0x35')];if(!_0x2f2f90['query'][_0xce44('0x36')]('nolimit')){_0x16f41f[_0xce44('0x1e')]=qs[_0xce44('0x1e')](_0x2f2f90['query'][_0xce44('0x1e')]);_0x16f41f[_0xce44('0x1c')]=qs['offset'](_0x2f2f90[_0xce44('0x2f')]['offset']);}return _0x47e3ac[_0xce44('0x4c')](_0x16f41f);}})['then'](function(_0x2533b3){if(_0x2533b3){return _0x2533b3?{'count':_0x50c746,'rows':_0x2533b3}:null;}})[_0xce44('0x24')](respondWithResult(_0x57e32c,null))[_0xce44('0x42')](handleError(_0x57e32c,null));};exports[_0xce44('0x4d')]=function(_0x9a73a2,_0x54e852,_0x41d654){var _0x36a86c={};var _0x4c1d2a={};var _0x27e48f;var _0x54d575;return db[_0xce44('0x29')][_0xce44('0x47')]({'where':{'id':_0x9a73a2[_0xce44('0x41')]['id']}})[_0xce44('0x24')](handleEntityNotFound(_0x54e852,null))[_0xce44('0x24')](function(_0x59d6a3){if(_0x59d6a3){_0x27e48f=_0x59d6a3;_0x4c1d2a[_0xce44('0x2e')]=_[_0xce44('0x30')](db[_0xce44('0x48')][_0xce44('0x2a')]);_0x4c1d2a[_0xce44('0x2f')]=_[_0xce44('0x30')](_0x9a73a2[_0xce44('0x2f')]);_0x4c1d2a['filters']=_[_0xce44('0x32')](_0x4c1d2a[_0xce44('0x2e')],_0x4c1d2a[_0xce44('0x2f')]);_0x36a86c[_0xce44('0x34')]=_[_0xce44('0x32')](_0x4c1d2a[_0xce44('0x2e')],qs[_0xce44('0x33')](_0x9a73a2[_0xce44('0x2f')]['fields']));_0x36a86c[_0xce44('0x34')]=_0x36a86c[_0xce44('0x34')][_0xce44('0x35')]?_0x36a86c[_0xce44('0x34')]:_0x4c1d2a['model'];_0x36a86c['order']=qs[_0xce44('0x4a')](_0x9a73a2[_0xce44('0x2f')][_0xce44('0x4a')]);_0x36a86c['where']=qs['filters'](_[_0xce44('0x39')](_0x9a73a2[_0xce44('0x2f')],_0x4c1d2a[_0xce44('0x31')]));if(_0x9a73a2[_0xce44('0x2f')][_0xce44('0x3a')]){_0x36a86c[_0xce44('0x38')]=_[_0xce44('0x3b')](_0x36a86c[_0xce44('0x38')],{'$or':_[_0xce44('0x28')](_0x36a86c[_0xce44('0x34')],function(_0x5a0c22){var _0x38a57d={};_0x38a57d[_0x5a0c22]={'$like':'%'+_0x9a73a2[_0xce44('0x2f')][_0xce44('0x3a')]+'%'};return _0x38a57d;})});}_0x36a86c=_[_0xce44('0x3b')]({},_0x36a86c,_0x9a73a2[_0xce44('0x4b')]);return _0x27e48f[_0xce44('0x4d')](_0x36a86c);}})[_0xce44('0x24')](function(_0x2bc34d){if(_0x2bc34d){_0x54d575=_0x2bc34d[_0xce44('0x35')];if(!_0x9a73a2[_0xce44('0x2f')][_0xce44('0x36')](_0xce44('0x37'))){_0x36a86c[_0xce44('0x1e')]=qs[_0xce44('0x1e')](_0x9a73a2[_0xce44('0x2f')][_0xce44('0x1e')]);_0x36a86c[_0xce44('0x1c')]=qs[_0xce44('0x1c')](_0x9a73a2['query'][_0xce44('0x1c')]);}return _0x27e48f[_0xce44('0x4d')](_0x36a86c);}})[_0xce44('0x24')](function(_0x276c45){if(_0x276c45){return _0x276c45?{'count':_0x54d575,'rows':_0x276c45}:null;}})['then'](respondWithResult(_0x54e852,null))[_0xce44('0x42')](handleError(_0x54e852,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f59273e..6a55138 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 _0x94df=['bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x582abc,_0x1f3e9f){var _0x5acb49=function(_0xfd5782){while(--_0xfd5782){_0x582abc['push'](_0x582abc['shift']());}};_0x5acb49(++_0x1f3e9f);}(_0x94df,0xa3));var _0xf94d=function(_0x54b211,_0x12e6ed){_0x54b211=_0x54b211-0x0;var _0xd65f7=_0x94df[_0x54b211];return _0xd65f7;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var logger=require(_0xf94d('0x2'))(_0xf94d('0x3'));var moment=require(_0xf94d('0x4'));var BPromise=require(_0xf94d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf94d('0x6'));var rimraf=require(_0xf94d('0x7'));var config=require(_0xf94d('0x8'));var attributes=require(_0xf94d('0x9'));module[_0xf94d('0xa')]=function(_0x32b0bd,_0x40bfd4){return _0x32b0bd[_0xf94d('0xb')](_0xf94d('0xc'),attributes,{'tableName':_0xf94d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceef=['rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','bluebird','path'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xceef,0xf6));var _0xfcee=function(_0x3fc75a,_0x1a125c){_0x3fc75a=_0x3fc75a-0x0;var _0x1d3083=_0xceef[_0x3fc75a];return _0x1d3083;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfcee('0x0'))(_0xfcee('0x1'));var moment=require('moment');var BPromise=require(_0xfcee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcee('0x3'));var rimraf=require(_0xfcee('0x4'));var config=require('../../config/environment');var attributes=require(_0xfcee('0x5'));module[_0xfcee('0x6')]=function(_0x4f3321,_0x59b784){return _0x4f3321[_0xfcee('0x7')](_0xfcee('0x8'),attributes,{'tableName':_0xfcee('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 abcffc3..c766d0f 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 _0xb05b=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4c3346,_0x432def){var _0xf3733a=function(_0x2ceaa5){while(--_0x2ceaa5){_0x4c3346['push'](_0x4c3346['shift']());}};_0xf3733a(++_0x432def);}(_0xb05b,0xd1));var _0xbb05=function(_0x2f58ea,_0x2c8f38){_0x2f58ea=_0x2f58ea-0x0;var _0x514770=_0xb05b[_0x2f58ea];return _0x514770;};'use strict';var _=require(_0xbb05('0x0'));var util=require('util');var moment=require(_0xbb05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb05('0x2'));var db=require(_0xbb05('0x3'))['db'];var utils=require(_0xbb05('0x4'));var logger=require('../../config/logger')(_0xbb05('0x5'));var config=require(_0xbb05('0x6'));var jayson=require(_0xbb05('0x7'));var client=jayson[_0xbb05('0x8')][_0xbb05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf4d8e7,_0x51d2b7,_0x1e8172){return new BPromise(function(_0x2faddd,_0x3d015b){return client[_0xbb05('0xa')](_0xf4d8e7,_0x1e8172)[_0xbb05('0xb')](function(_0x55d755){logger[_0xbb05('0xc')](_0xbb05('0xd'),_0x51d2b7,_0xbb05('0xe'));logger[_0xbb05('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x51d2b7,_0xbb05('0xe'),JSON[_0xbb05('0x10')](_0x55d755));if(_0x55d755[_0xbb05('0x11')]){if(_0x55d755[_0xbb05('0x11')][_0xbb05('0x12')]===0x1f4){logger[_0xbb05('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x51d2b7,_0x55d755[_0xbb05('0x11')][_0xbb05('0x13')]);return _0x3d015b(_0x55d755[_0xbb05('0x11')][_0xbb05('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x51d2b7,_0x55d755['error'][_0xbb05('0x13')]);return _0x2faddd(_0x55d755[_0xbb05('0x11')]['message']);}else{logger[_0xbb05('0xc')](_0xbb05('0xd'),_0x51d2b7,_0xbb05('0xe'));_0x2faddd(_0x55d755[_0xbb05('0x14')]['message']);}})[_0xbb05('0x15')](function(_0x4843df){logger['error'](_0xbb05('0xd'),_0x51d2b7,_0x4843df);_0x3d015b(_0x4843df);});});} \ No newline at end of file +var _0xd409=['../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x23c5dc,_0x250cb6){var _0x4ec9dc=function(_0x4b2f0c){while(--_0x4b2f0c){_0x23c5dc['push'](_0x23c5dc['shift']());}};_0x4ec9dc(++_0x250cb6);}(_0xd409,0x15f));var _0x9d40=function(_0x454876,_0x580571){_0x454876=_0x454876-0x0;var _0x1084e6=_0xd409[_0x454876];return _0x1084e6;};'use strict';var _=require('lodash');var util=require(_0x9d40('0x0'));var moment=require(_0x9d40('0x1'));var BPromise=require(_0x9d40('0x2'));var rs=require(_0x9d40('0x3'));var fs=require('fs');var Redis=require(_0x9d40('0x4'));var db=require(_0x9d40('0x5'))['db'];var utils=require(_0x9d40('0x6'));var logger=require('../../config/logger')(_0x9d40('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d40('0x8'));var client=jayson[_0x9d40('0x9')][_0x9d40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2298a1,_0x46e88,_0x23a53a){return new BPromise(function(_0x59b2a6,_0x10f982){return client[_0x9d40('0xb')](_0x2298a1,_0x23a53a)['then'](function(_0x4ff949){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x46e88,_0x9d40('0xc'));logger['debug'](_0x9d40('0xd'),_0x46e88,_0x9d40('0xc'),JSON[_0x9d40('0xe')](_0x4ff949));if(_0x4ff949[_0x9d40('0xf')]){if(_0x4ff949[_0x9d40('0xf')][_0x9d40('0x10')]===0x1f4){logger[_0x9d40('0xf')](_0x9d40('0x11'),_0x46e88,_0x4ff949[_0x9d40('0xf')][_0x9d40('0x12')]);return _0x10f982(_0x4ff949[_0x9d40('0xf')][_0x9d40('0x12')]);}logger[_0x9d40('0xf')](_0x9d40('0x11'),_0x46e88,_0x4ff949[_0x9d40('0xf')][_0x9d40('0x12')]);return _0x59b2a6(_0x4ff949['error'][_0x9d40('0x12')]);}else{logger[_0x9d40('0x13')](_0x9d40('0x11'),_0x46e88,_0x9d40('0xc'));_0x59b2a6(_0x4ff949['result']['message']);}})[_0x9d40('0x14')](function(_0x34822f){logger[_0x9d40('0xf')](_0x9d40('0x11'),_0x46e88,_0x34822f);_0x10f982(_0x34822f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6eae845..2096e02 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 _0x8ac7=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x4e6480,_0x1b33ed){var _0x4d89e3=function(_0x3cf305){while(--_0x3cf305){_0x4e6480['push'](_0x4e6480['shift']());}};_0x4d89e3(++_0x1b33ed);}(_0x8ac7,0xca));var _0x78ac=function(_0x7f763c,_0x1027ca){_0x7f763c=_0x7f763c-0x0;var _0x1e5a5a=_0x8ac7[_0x7f763c];return _0x1e5a5a;};'use strict';var multer=require(_0x78ac('0x0'));var util=require(_0x78ac('0x1'));var path=require(_0x78ac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x78ac('0x3')]();var fs_extra=require(_0x78ac('0x4'));var auth=require(_0x78ac('0x5'));var interaction=require(_0x78ac('0x6'));var config=require(_0x78ac('0x7'));var controller=require(_0x78ac('0x8'));router[_0x78ac('0x9')]('/',auth[_0x78ac('0xa')](),controller['index']);router[_0x78ac('0x9')](_0x78ac('0xb'),auth[_0x78ac('0xa')](),controller['show']);router['post']('/',auth[_0x78ac('0xa')](),controller['create']);router[_0x78ac('0xc')](_0x78ac('0xb'),auth['isAuthenticated'](),controller[_0x78ac('0xd')]);router[_0x78ac('0xe')](_0x78ac('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x78ac('0xf')]=router; \ No newline at end of file +var _0x35d4=['fs-extra','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','path','express'];(function(_0x19fd9b,_0x1b85ab){var _0x39d033=function(_0x24e62a){while(--_0x24e62a){_0x19fd9b['push'](_0x19fd9b['shift']());}};_0x39d033(++_0x1b85ab);}(_0x35d4,0xb2));var _0x435d=function(_0x18b99e,_0x3a5610){_0x18b99e=_0x18b99e-0x0;var _0x420b96=_0x35d4[_0x18b99e];return _0x420b96;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x435d('0x0'));var timeout=require('connect-timeout');var express=require(_0x435d('0x1'));var router=express['Router']();var fs_extra=require(_0x435d('0x2'));var auth=require(_0x435d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x435d('0x4'));router[_0x435d('0x5')]('/',auth[_0x435d('0x6')](),controller['index']);router['get']('/:id',auth[_0x435d('0x6')](),controller[_0x435d('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x435d('0x8')]);router[_0x435d('0x9')](_0x435d('0xa'),auth[_0x435d('0x6')](),controller[_0x435d('0xb')]);router[_0x435d('0xc')]('/:id',auth[_0x435d('0x6')](),controller[_0x435d('0xd')]);module[_0x435d('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index cca2455..b56448c 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 _0x1752=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','keyValue','picklist'];(function(_0x5b122f,_0x157617){var _0x28db9a=function(_0x393fed){while(--_0x393fed){_0x5b122f['push'](_0x5b122f['shift']());}};_0x28db9a(++_0x157617);}(_0x1752,0x9c));var _0x2175=function(_0x196b2f,_0xc6f295){_0x196b2f=_0x196b2f-0x0;var _0x2cfde5=_0x1752[_0x196b2f];return _0x2cfde5;};'use strict';var Sequelize=require(_0x2175('0x0'));module[_0x2175('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2175('0x2'),_0x2175('0x3'),'customVariable',_0x2175('0x4'),_0x2175('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2175('0x6')]},'key':{'type':Sequelize[_0x2175('0x6')]},'keyType':{'type':Sequelize[_0x2175('0x7')]('string',_0x2175('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2175('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2175('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2175('0x6')]}}; \ No newline at end of file +var _0x20c7=['string','variable','keyValue','STRING','customVariable','sequelize','exports','ENUM'];(function(_0x2d355e,_0x5ae7bc){var _0x2f60ab=function(_0x53b91e){while(--_0x53b91e){_0x2d355e['push'](_0x2d355e['shift']());}};_0x2f60ab(++_0x5ae7bc);}(_0x20c7,0x17d));var _0x720c=function(_0x4cb458,_0x279261){_0x4cb458=_0x4cb458-0x0;var _0x10f648=_0x20c7[_0x4cb458];return _0x10f648;};'use strict';var Sequelize=require(_0x720c('0x0'));module[_0x720c('0x1')]={'type':{'type':Sequelize[_0x720c('0x2')](_0x720c('0x3'),_0x720c('0x4'),'customVariable',_0x720c('0x5'),'picklist'),'defaultValue':_0x720c('0x3')},'content':{'type':Sequelize[_0x720c('0x6')]},'key':{'type':Sequelize[_0x720c('0x6')]},'keyType':{'type':Sequelize[_0x720c('0x2')]('string',_0x720c('0x4'),_0x720c('0x7'))},'keyContent':{'type':Sequelize[_0x720c('0x6')]},'idField':{'type':Sequelize[_0x720c('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x720c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index df61899..36a2432 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 _0xf500=['then','destroy','error','stack','name','index','map','ServicenowField','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','count','offset','set','Content-Range','apply','save','update'];(function(_0x31ba46,_0x4c6cf8){var _0xe34945=function(_0x33c8dc){while(--_0x33c8dc){_0x31ba46['push'](_0x31ba46['shift']());}};_0xe34945(++_0x4c6cf8);}(_0xf500,0xb8));var _0x0f50=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0xf500[_0x37ffea];return _0x2e2615;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f50('0x0'));var zipdir=require(_0x0f50('0x1'));var jsonpatch=require(_0x0f50('0x2'));var rp=require(_0x0f50('0x3'));var moment=require('moment');var BPromise=require(_0x0f50('0x4'));var Mustache=require(_0x0f50('0x5'));var util=require(_0x0f50('0x6'));var path=require(_0x0f50('0x7'));var sox=require('sox');var csv=require(_0x0f50('0x8'));var ejs=require(_0x0f50('0x9'));var fs=require('fs');var fs_extra=require(_0x0f50('0xa'));var _=require(_0x0f50('0xb'));var squel=require(_0x0f50('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0f50('0x8'));var querystring=require(_0x0f50('0xd'));var Papa=require(_0x0f50('0xe'));var Redis=require(_0x0f50('0xf'));var authService=require(_0x0f50('0x10'));var qs=require(_0x0f50('0x11'));var as=require(_0x0f50('0x12'));var hardwareService=require(_0x0f50('0x13'));var logger=require(_0x0f50('0x14'))(_0x0f50('0x15'));var utils=require('../../config/utils');var config=require(_0x0f50('0x16'));var licenseUtil=require(_0x0f50('0x17'));var db=require(_0x0f50('0x18'))['db'];function respondWithStatusCode(_0x2c44bf,_0x156604){_0x156604=_0x156604||0xcc;return function(_0x2c0fcc){if(_0x2c0fcc){return _0x2c44bf[_0x0f50('0x19')](_0x156604);}return _0x2c44bf[_0x0f50('0x1a')](_0x156604)[_0x0f50('0x1b')]();};}function respondWithResult(_0x4a5035,_0x5e0263){_0x5e0263=_0x5e0263||0xc8;return function(_0x6821a){if(_0x6821a){return _0x4a5035['status'](_0x5e0263)[_0x0f50('0x1c')](_0x6821a);}};}function respondWithFilteredResult(_0x2f8437,_0x2f4846){return function(_0x4c5c9c){if(_0x4c5c9c){var _0x58014c=typeof _0x2f4846['offset']===_0x0f50('0x1d')&&typeof _0x2f4846[_0x0f50('0x1e')]===_0x0f50('0x1d');var _0xa3b870=_0x4c5c9c[_0x0f50('0x1f')];var _0x56694b=_0x58014c?0x0:_0x2f4846[_0x0f50('0x20')];var _0x3b60c6=_0x58014c?_0x4c5c9c[_0x0f50('0x1f')]:_0x2f4846['offset']+_0x2f4846['limit'];var _0x57574f;if(_0x3b60c6>=_0xa3b870){_0x3b60c6=_0xa3b870;_0x57574f=0xc8;}else{_0x57574f=0xce;}_0x2f8437['status'](_0x57574f);return _0x2f8437[_0x0f50('0x21')](_0x0f50('0x22'),_0x56694b+'-'+_0x3b60c6+'/'+_0xa3b870)[_0x0f50('0x1c')](_0x4c5c9c);}return null;};}function patchUpdates(_0x13b444){return function(_0x3cadf6){try{jsonpatch[_0x0f50('0x23')](_0x3cadf6,_0x13b444,!![]);}catch(_0xb251e6){return BPromise['reject'](_0xb251e6);}return _0x3cadf6[_0x0f50('0x24')]();};}function saveUpdates(_0x2f831a,_0x25a90b){return function(_0x90e5e5){if(_0x90e5e5){return _0x90e5e5[_0x0f50('0x25')](_0x2f831a)[_0x0f50('0x26')](function(_0x4866b5){return _0x4866b5;});}return null;};}function removeEntity(_0x449c65,_0x25d1d4){return function(_0x372738){if(_0x372738){return _0x372738[_0x0f50('0x27')]()[_0x0f50('0x26')](function(){_0x449c65[_0x0f50('0x1a')](0xcc)[_0x0f50('0x1b')]();});}};}function handleEntityNotFound(_0x596149,_0x35e1e8){return function(_0x43745e){if(!_0x43745e){_0x596149[_0x0f50('0x19')](0x194);}return _0x43745e;};}function handleError(_0x393fca,_0x507e3c){_0x507e3c=_0x507e3c||0x1f4;return function(_0x3f7c0c){logger[_0x0f50('0x28')](_0x3f7c0c[_0x0f50('0x29')]);if(_0x3f7c0c[_0x0f50('0x2a')]){delete _0x3f7c0c[_0x0f50('0x2a')];}_0x393fca['status'](_0x507e3c)['send'](_0x3f7c0c);};}exports[_0x0f50('0x2b')]=function(_0x4e4b07,_0x35d369){var _0x4e930b={},_0x2bcd6b={},_0xdb263b={'count':0x0,'rows':[]};var _0x57f023=_[_0x0f50('0x2c')](db[_0x0f50('0x2d')]['rawAttributes'],function(_0x1858ce){return{'name':_0x1858ce[_0x0f50('0x2e')],'type':_0x1858ce[_0x0f50('0x2f')]['key']};});_0x2bcd6b[_0x0f50('0x30')]=_[_0x0f50('0x2c')](_0x57f023,_0x0f50('0x2a'));_0x2bcd6b[_0x0f50('0x31')]=_[_0x0f50('0x32')](_0x4e4b07[_0x0f50('0x31')]);_0x2bcd6b['filters']=_[_0x0f50('0x33')](_0x2bcd6b[_0x0f50('0x30')],_0x2bcd6b['query']);_0x4e930b[_0x0f50('0x34')]=_[_0x0f50('0x33')](_0x2bcd6b[_0x0f50('0x30')],qs[_0x0f50('0x35')](_0x4e4b07[_0x0f50('0x31')][_0x0f50('0x35')]));_0x4e930b[_0x0f50('0x34')]=_0x4e930b['attributes'][_0x0f50('0x36')]?_0x4e930b[_0x0f50('0x34')]:_0x2bcd6b[_0x0f50('0x30')];if(!_0x4e4b07['query'][_0x0f50('0x37')]('nolimit')){_0x4e930b[_0x0f50('0x1e')]=qs['limit'](_0x4e4b07['query'][_0x0f50('0x1e')]);_0x4e930b[_0x0f50('0x20')]=qs[_0x0f50('0x20')](_0x4e4b07[_0x0f50('0x31')][_0x0f50('0x20')]);}_0x4e930b[_0x0f50('0x38')]=qs[_0x0f50('0x39')](_0x4e4b07['query'][_0x0f50('0x39')]);_0x4e930b[_0x0f50('0x3a')]=qs[_0x0f50('0x3b')](_['pick'](_0x4e4b07[_0x0f50('0x31')],_0x2bcd6b[_0x0f50('0x3b')]),_0x57f023);if(_0x4e4b07['query'][_0x0f50('0x3c')]){_0x4e930b[_0x0f50('0x3a')]=_[_0x0f50('0x3d')](_0x4e930b[_0x0f50('0x3a')],{'$or':_[_0x0f50('0x2c')](_0x57f023,function(_0x2bf572){if(_0x2bf572[_0x0f50('0x2f')]!==_0x0f50('0x3e')){var _0x597e02={};_0x597e02[_0x2bf572[_0x0f50('0x2a')]]={'$like':'%'+_0x4e4b07['query'][_0x0f50('0x3c')]+'%'};return _0x597e02;}})});}_0x4e930b=_[_0x0f50('0x3d')]({},_0x4e930b,_0x4e4b07[_0x0f50('0x3f')]);var _0x3f2610={'where':_0x4e930b[_0x0f50('0x3a')]};return db[_0x0f50('0x2d')][_0x0f50('0x1f')](_0x3f2610)[_0x0f50('0x26')](function(_0x125bd0){_0xdb263b[_0x0f50('0x1f')]=_0x125bd0;if(_0x4e4b07[_0x0f50('0x31')]['includeAll']){_0x4e930b[_0x0f50('0x40')]=[{'all':!![]}];}return db[_0x0f50('0x2d')][_0x0f50('0x41')](_0x4e930b);})[_0x0f50('0x26')](function(_0x4e7f40){_0xdb263b['rows']=_0x4e7f40;return _0xdb263b;})[_0x0f50('0x26')](respondWithFilteredResult(_0x35d369,_0x4e930b))[_0x0f50('0x42')](handleError(_0x35d369,null));};exports[_0x0f50('0x43')]=function(_0x3eee78,_0x2d54c4){var _0x7de738={'raw':!![],'where':{'id':_0x3eee78[_0x0f50('0x44')]['id']}},_0x35de1f={};_0x35de1f[_0x0f50('0x30')]=_[_0x0f50('0x32')](db[_0x0f50('0x2d')][_0x0f50('0x45')]);_0x35de1f[_0x0f50('0x31')]=_[_0x0f50('0x32')](_0x3eee78['query']);_0x35de1f[_0x0f50('0x3b')]=_[_0x0f50('0x33')](_0x35de1f[_0x0f50('0x30')],_0x35de1f[_0x0f50('0x31')]);_0x7de738[_0x0f50('0x34')]=_['intersection'](_0x35de1f[_0x0f50('0x30')],qs[_0x0f50('0x35')](_0x3eee78[_0x0f50('0x31')][_0x0f50('0x35')]));_0x7de738['attributes']=_0x7de738[_0x0f50('0x34')][_0x0f50('0x36')]?_0x7de738[_0x0f50('0x34')]:_0x35de1f['model'];if(_0x3eee78[_0x0f50('0x31')][_0x0f50('0x46')]){_0x7de738[_0x0f50('0x40')]=[{'all':!![]}];}_0x7de738=_['merge']({},_0x7de738,_0x3eee78[_0x0f50('0x3f')]);return db[_0x0f50('0x2d')][_0x0f50('0x47')](_0x7de738)['then'](handleEntityNotFound(_0x2d54c4,null))['then'](respondWithResult(_0x2d54c4,null))[_0x0f50('0x42')](handleError(_0x2d54c4,null));};exports['create']=function(_0xf730d3,_0x20d0a8){return db[_0x0f50('0x2d')][_0x0f50('0x48')](_0xf730d3[_0x0f50('0x49')],{})[_0x0f50('0x26')](respondWithResult(_0x20d0a8,0xc9))['catch'](handleError(_0x20d0a8,null));};exports['update']=function(_0x3deb1c,_0x21bf67){if(_0x3deb1c[_0x0f50('0x49')]['id']){delete _0x3deb1c['body']['id'];}return db[_0x0f50('0x2d')]['find']({'where':{'id':_0x3deb1c[_0x0f50('0x44')]['id']}})[_0x0f50('0x26')](handleEntityNotFound(_0x21bf67,null))[_0x0f50('0x26')](saveUpdates(_0x3deb1c[_0x0f50('0x49')],null))['then'](respondWithResult(_0x21bf67,null))[_0x0f50('0x42')](handleError(_0x21bf67,null));};exports[_0x0f50('0x27')]=function(_0x33771c,_0x3a88d0){return db['ServicenowField'][_0x0f50('0x47')]({'where':{'id':_0x33771c[_0x0f50('0x44')]['id']}})[_0x0f50('0x26')](handleEntityNotFound(_0x3a88d0,null))[_0x0f50('0x26')](removeEntity(_0x3a88d0,null))[_0x0f50('0x42')](handleError(_0x3a88d0,null));}; \ No newline at end of file +var _0x459b=['name','send','ServicenowField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack'];(function(_0x328b81,_0x313a84){var _0x216cd5=function(_0xf7f484){while(--_0xf7f484){_0x328b81['push'](_0x328b81['shift']());}};_0x216cd5(++_0x313a84);}(_0x459b,0x19a));var _0xb459=function(_0x990631,_0x4afb50){_0x990631=_0x990631-0x0;var _0x1fa769=_0x459b[_0x990631];return _0x1fa769;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb459('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb459('0x1'));var rp=require(_0xb459('0x2'));var moment=require(_0xb459('0x3'));var BPromise=require(_0xb459('0x4'));var Mustache=require(_0xb459('0x5'));var util=require(_0xb459('0x6'));var path=require(_0xb459('0x7'));var sox=require(_0xb459('0x8'));var csv=require(_0xb459('0x9'));var ejs=require(_0xb459('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb459('0xb'));var squel=require(_0xb459('0xc'));var crypto=require('crypto');var jsforce=require(_0xb459('0xd'));var deskjs=require(_0xb459('0xe'));var toCsv=require(_0xb459('0x9'));var querystring=require(_0xb459('0xf'));var Papa=require('papaparse');var Redis=require(_0xb459('0x10'));var authService=require(_0xb459('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb459('0x12'));var logger=require('../../config/logger')(_0xb459('0x13'));var utils=require(_0xb459('0x14'));var config=require(_0xb459('0x15'));var licenseUtil=require(_0xb459('0x16'));var db=require(_0xb459('0x17'))['db'];function respondWithStatusCode(_0x3d7ff7,_0x514853){_0x514853=_0x514853||0xcc;return function(_0x18c898){if(_0x18c898){return _0x3d7ff7[_0xb459('0x18')](_0x514853);}return _0x3d7ff7['status'](_0x514853)['end']();};}function respondWithResult(_0x58f8a0,_0x24c2ca){_0x24c2ca=_0x24c2ca||0xc8;return function(_0x1b28b8){if(_0x1b28b8){return _0x58f8a0[_0xb459('0x19')](_0x24c2ca)[_0xb459('0x1a')](_0x1b28b8);}};}function respondWithFilteredResult(_0x5d8b53,_0x4c7037){return function(_0xc03589){if(_0xc03589){var _0x864764=typeof _0x4c7037[_0xb459('0x1b')]===_0xb459('0x1c')&&typeof _0x4c7037[_0xb459('0x1d')]===_0xb459('0x1c');var _0x38787b=_0xc03589[_0xb459('0x1e')];var _0x1b4184=_0x864764?0x0:_0x4c7037[_0xb459('0x1b')];var _0x47ebfb=_0x864764?_0xc03589['count']:_0x4c7037[_0xb459('0x1b')]+_0x4c7037[_0xb459('0x1d')];var _0x1751cc;if(_0x47ebfb>=_0x38787b){_0x47ebfb=_0x38787b;_0x1751cc=0xc8;}else{_0x1751cc=0xce;}_0x5d8b53[_0xb459('0x19')](_0x1751cc);return _0x5d8b53[_0xb459('0x1f')](_0xb459('0x20'),_0x1b4184+'-'+_0x47ebfb+'/'+_0x38787b)[_0xb459('0x1a')](_0xc03589);}return null;};}function patchUpdates(_0x3d3424){return function(_0x524b83){try{jsonpatch[_0xb459('0x21')](_0x524b83,_0x3d3424,!![]);}catch(_0x2dd513){return BPromise[_0xb459('0x22')](_0x2dd513);}return _0x524b83['save']();};}function saveUpdates(_0x37f56b,_0x6ca28b){return function(_0xc9c4c9){if(_0xc9c4c9){return _0xc9c4c9[_0xb459('0x23')](_0x37f56b)['then'](function(_0x4faeee){return _0x4faeee;});}return null;};}function removeEntity(_0x171cb3,_0x389f4c){return function(_0x220f7e){if(_0x220f7e){return _0x220f7e['destroy']()[_0xb459('0x24')](function(){_0x171cb3[_0xb459('0x19')](0xcc)[_0xb459('0x25')]();});}};}function handleEntityNotFound(_0x48ed4d,_0x5093f8){return function(_0x1b72d6){if(!_0x1b72d6){_0x48ed4d[_0xb459('0x18')](0x194);}return _0x1b72d6;};}function handleError(_0x591fef,_0x216fec){_0x216fec=_0x216fec||0x1f4;return function(_0x5c887a){logger[_0xb459('0x26')](_0x5c887a[_0xb459('0x27')]);if(_0x5c887a[_0xb459('0x28')]){delete _0x5c887a[_0xb459('0x28')];}_0x591fef[_0xb459('0x19')](_0x216fec)[_0xb459('0x29')](_0x5c887a);};}exports['index']=function(_0x3f6e81,_0x416d55){var _0x19f347={},_0x21ba77={},_0x3d55de={'count':0x0,'rows':[]};var _0x5db2cd=_['map'](db[_0xb459('0x2a')][_0xb459('0x2b')],function(_0x417761){return{'name':_0x417761['fieldName'],'type':_0x417761[_0xb459('0x2c')][_0xb459('0x2d')]};});_0x21ba77[_0xb459('0x2e')]=_['map'](_0x5db2cd,'name');_0x21ba77['query']=_[_0xb459('0x2f')](_0x3f6e81[_0xb459('0x30')]);_0x21ba77[_0xb459('0x31')]=_[_0xb459('0x32')](_0x21ba77[_0xb459('0x2e')],_0x21ba77[_0xb459('0x30')]);_0x19f347[_0xb459('0x33')]=_[_0xb459('0x32')](_0x21ba77[_0xb459('0x2e')],qs['fields'](_0x3f6e81[_0xb459('0x30')][_0xb459('0x34')]));_0x19f347[_0xb459('0x33')]=_0x19f347[_0xb459('0x33')][_0xb459('0x35')]?_0x19f347[_0xb459('0x33')]:_0x21ba77['model'];if(!_0x3f6e81[_0xb459('0x30')]['hasOwnProperty'](_0xb459('0x36'))){_0x19f347[_0xb459('0x1d')]=qs['limit'](_0x3f6e81[_0xb459('0x30')][_0xb459('0x1d')]);_0x19f347['offset']=qs[_0xb459('0x1b')](_0x3f6e81[_0xb459('0x30')][_0xb459('0x1b')]);}_0x19f347[_0xb459('0x37')]=qs[_0xb459('0x38')](_0x3f6e81[_0xb459('0x30')][_0xb459('0x38')]);_0x19f347[_0xb459('0x39')]=qs[_0xb459('0x31')](_[_0xb459('0x3a')](_0x3f6e81['query'],_0x21ba77[_0xb459('0x31')]),_0x5db2cd);if(_0x3f6e81['query'][_0xb459('0x3b')]){_0x19f347[_0xb459('0x39')]=_[_0xb459('0x3c')](_0x19f347['where'],{'$or':_[_0xb459('0x3d')](_0x5db2cd,function(_0x4f8eba){if(_0x4f8eba['type']!==_0xb459('0x3e')){var _0x4b04c5={};_0x4b04c5[_0x4f8eba[_0xb459('0x28')]]={'$like':'%'+_0x3f6e81[_0xb459('0x30')][_0xb459('0x3b')]+'%'};return _0x4b04c5;}})});}_0x19f347=_[_0xb459('0x3c')]({},_0x19f347,_0x3f6e81['options']);var _0x38edd3={'where':_0x19f347['where']};return db['ServicenowField']['count'](_0x38edd3)['then'](function(_0xea0716){_0x3d55de[_0xb459('0x1e')]=_0xea0716;if(_0x3f6e81[_0xb459('0x30')]['includeAll']){_0x19f347[_0xb459('0x3f')]=[{'all':!![]}];}return db['ServicenowField'][_0xb459('0x40')](_0x19f347);})[_0xb459('0x24')](function(_0x1310a5){_0x3d55de[_0xb459('0x41')]=_0x1310a5;return _0x3d55de;})[_0xb459('0x24')](respondWithFilteredResult(_0x416d55,_0x19f347))[_0xb459('0x42')](handleError(_0x416d55,null));};exports[_0xb459('0x43')]=function(_0x51624d,_0x38a997){var _0x301939={'raw':!![],'where':{'id':_0x51624d[_0xb459('0x44')]['id']}},_0x3de8e7={};_0x3de8e7[_0xb459('0x2e')]=_[_0xb459('0x2f')](db['ServicenowField'][_0xb459('0x2b')]);_0x3de8e7[_0xb459('0x30')]=_[_0xb459('0x2f')](_0x51624d[_0xb459('0x30')]);_0x3de8e7[_0xb459('0x31')]=_['intersection'](_0x3de8e7[_0xb459('0x2e')],_0x3de8e7[_0xb459('0x30')]);_0x301939['attributes']=_[_0xb459('0x32')](_0x3de8e7[_0xb459('0x2e')],qs[_0xb459('0x34')](_0x51624d['query'][_0xb459('0x34')]));_0x301939[_0xb459('0x33')]=_0x301939[_0xb459('0x33')][_0xb459('0x35')]?_0x301939[_0xb459('0x33')]:_0x3de8e7[_0xb459('0x2e')];if(_0x51624d[_0xb459('0x30')][_0xb459('0x45')]){_0x301939[_0xb459('0x3f')]=[{'all':!![]}];}_0x301939=_[_0xb459('0x3c')]({},_0x301939,_0x51624d[_0xb459('0x46')]);return db[_0xb459('0x2a')][_0xb459('0x47')](_0x301939)['then'](handleEntityNotFound(_0x38a997,null))[_0xb459('0x24')](respondWithResult(_0x38a997,null))[_0xb459('0x42')](handleError(_0x38a997,null));};exports[_0xb459('0x48')]=function(_0x2272cf,_0x4ca8ee){return db[_0xb459('0x2a')]['create'](_0x2272cf['body'],{})[_0xb459('0x24')](respondWithResult(_0x4ca8ee,0xc9))[_0xb459('0x42')](handleError(_0x4ca8ee,null));};exports[_0xb459('0x23')]=function(_0x423b2b,_0x231785){if(_0x423b2b['body']['id']){delete _0x423b2b[_0xb459('0x49')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x423b2b[_0xb459('0x44')]['id']}})[_0xb459('0x24')](handleEntityNotFound(_0x231785,null))[_0xb459('0x24')](saveUpdates(_0x423b2b[_0xb459('0x49')],null))['then'](respondWithResult(_0x231785,null))[_0xb459('0x42')](handleError(_0x231785,null));};exports[_0xb459('0x4a')]=function(_0x321d26,_0x44e45f){return db[_0xb459('0x2a')][_0xb459('0x47')]({'where':{'id':_0x321d26['params']['id']}})[_0xb459('0x24')](handleEntityNotFound(_0x44e45f,null))[_0xb459('0x24')](removeEntity(_0x44e45f,null))[_0xb459('0x42')](handleError(_0x44e45f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c768f0a..757934d 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 _0x24cd=['path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c6dad,_0x250cb7){var _0x23176a=function(_0x17af9c){while(--_0x17af9c){_0x3c6dad['push'](_0x3c6dad['shift']());}};_0x23176a(++_0x250cb7);}(_0x24cd,0x17a));var _0xd24c=function(_0x47b572,_0x34713f){_0x47b572=_0x47b572-0x0;var _0x571d93=_0x24cd[_0x47b572];return _0x571d93;};'use strict';var _=require('lodash');var util=require(_0xd24c('0x0'));var logger=require(_0xd24c('0x1'))(_0xd24c('0x2'));var moment=require(_0xd24c('0x3'));var BPromise=require(_0xd24c('0x4'));var rp=require(_0xd24c('0x5'));var fs=require('fs');var path=require(_0xd24c('0x6'));var rimraf=require(_0xd24c('0x7'));var config=require(_0xd24c('0x8'));var attributes=require(_0xd24c('0x9'));module[_0xd24c('0xa')]=function(_0x10d3ac,_0x41c6bd){return _0x10d3ac[_0xd24c('0xb')]('ServicenowField',attributes,{'tableName':_0xd24c('0xc'),'paranoid':![],'indexes':[{'name':_0xd24c('0xd'),'fields':[_0xd24c('0xe'),_0xd24c('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d1=['idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields'];(function(_0x2aa729,_0x321952){var _0x2f1dcc=function(_0x55cd93){while(--_0x55cd93){_0x2aa729['push'](_0x2aa729['shift']());}};_0x2f1dcc(++_0x321952);}(_0xa2d1,0x72));var _0x1a2d=function(_0x4a1b3c,_0x20aa97){_0x4a1b3c=_0x4a1b3c-0x0;var _0xe314d7=_0xa2d1[_0x4a1b3c];return _0xe314d7;};'use strict';var _=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var logger=require('../../config/logger')(_0x1a2d('0x2'));var moment=require(_0x1a2d('0x3'));var BPromise=require(_0x1a2d('0x4'));var rp=require(_0x1a2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a2d('0x6'));var config=require(_0x1a2d('0x7'));var attributes=require(_0x1a2d('0x8'));module['exports']=function(_0x16c4ab,_0x15013c){return _0x16c4ab[_0x1a2d('0x9')](_0x1a2d('0xa'),attributes,{'tableName':_0x1a2d('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1a2d('0xc'),_0x1a2d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 1573c70..b5a00dd 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4662fc,_0x2787f7){var _0x2026cb=function(_0xd60ea5){while(--_0xd60ea5){_0x4662fc['push'](_0x4662fc['shift']());}};_0x2026cb(++_0x2787f7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5ca49d,_0x108ae2){_0x5ca49d=_0x5ca49d-0x0;var _0x27a39c=_0xf4eb[_0x5ca49d];return _0x27a39c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0xea2757,_0x394521){var _0x3ed656=function(_0x46129f){while(--_0x46129f){_0xea2757['push'](_0xea2757['shift']());}};_0x3ed656(++_0x394521);}(_0xaa88,0x137));var _0x8aa8=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xaa88[_0x3dc538];return _0x72c2fd;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 0ec6e60..349bb79 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4a6a81,_0x5874d8){var _0x5545f5=function(_0x1b1c5e){while(--_0x1b1c5e){_0x4a6a81['push'](_0x4a6a81['shift']());}};_0x5545f5(++_0x5874d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x245a4f,_0x4f850d){var _0x3655ae=function(_0x5c802a){while(--_0x5c802a){_0x245a4f['push'](_0x245a4f['shift']());}};_0x3655ae(++_0x4f850d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 811bdd6..da7b669 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(_0x472dac,_0x53f400){var _0xefca08=function(_0x5a47d8){while(--_0x5a47d8){_0x472dac['push'](_0x472dac['shift']());}};_0xefca08(++_0x53f400);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x2f9607,_0x2f61a3){var _0x38bbe0=function(_0x2b08bc){while(--_0x2b08bc){_0x2f9607['push'](_0x2f9607['shift']());}};_0x38bbe0(++_0x2f61a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 0530adc..03c3dab 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 _0xa22a=['keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','getConfigurations','SugarcrmConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','POST','module_fields','includes','label','endsWith','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query'];(function(_0x10028e,_0x505f30){var _0x41b293=function(_0x52fee9){while(--_0x52fee9){_0x10028e['push'](_0x10028e['shift']());}};_0x41b293(++_0x505f30);}(_0xa22a,0xc0));var _0xaa22=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa22a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xaa22('0x0'));var rimraf=require(_0xaa22('0x1'));var zipdir=require(_0xaa22('0x2'));var jsonpatch=require(_0xaa22('0x3'));var rp=require(_0xaa22('0x4'));var moment=require(_0xaa22('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa22('0x6'));var util=require(_0xaa22('0x7'));var path=require(_0xaa22('0x8'));var sox=require(_0xaa22('0x9'));var csv=require(_0xaa22('0xa'));var ejs=require(_0xaa22('0xb'));var fs=require('fs');var fs_extra=require(_0xaa22('0xc'));var _=require(_0xaa22('0xd'));var squel=require(_0xaa22('0xe'));var crypto=require(_0xaa22('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xaa22('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa22('0x11'));var Redis=require('ioredis');var authService=require(_0xaa22('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa22('0x13'));var logger=require(_0xaa22('0x14'))('api');var utils=require(_0xaa22('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaa22('0x16'));var db=require(_0xaa22('0x17'))['db'];var integrations=require(_0xaa22('0x18'));function respondWithStatusCode(_0x2ea8cc,_0x33e745){_0x33e745=_0x33e745||0xcc;return function(_0x2d436e){if(_0x2d436e){return _0x2ea8cc[_0xaa22('0x19')](_0x33e745);}return _0x2ea8cc['status'](_0x33e745)[_0xaa22('0x1a')]();};}function respondWithResult(_0xf80c30,_0x58844a){_0x58844a=_0x58844a||0xc8;return function(_0x22ead0){if(_0x22ead0){return _0xf80c30['status'](_0x58844a)[_0xaa22('0x1b')](_0x22ead0);}};}function respondWithFilteredResult(_0x441140,_0x45e2c0){return function(_0x530bc1){if(_0x530bc1){var _0x48da53=typeof _0x45e2c0[_0xaa22('0x1c')]===_0xaa22('0x1d')&&typeof _0x45e2c0[_0xaa22('0x1e')]===_0xaa22('0x1d');var _0xb25eab=_0x530bc1['count'];var _0x5aeba4=_0x48da53?0x0:_0x45e2c0[_0xaa22('0x1c')];var _0x2d222e=_0x48da53?_0x530bc1[_0xaa22('0x1f')]:_0x45e2c0[_0xaa22('0x1c')]+_0x45e2c0['limit'];var _0x36a497;if(_0x2d222e>=_0xb25eab){_0x2d222e=_0xb25eab;_0x36a497=0xc8;}else{_0x36a497=0xce;}_0x441140[_0xaa22('0x20')](_0x36a497);return _0x441140[_0xaa22('0x21')](_0xaa22('0x22'),_0x5aeba4+'-'+_0x2d222e+'/'+_0xb25eab)[_0xaa22('0x1b')](_0x530bc1);}return null;};}function patchUpdates(_0x5648bb){return function(_0x43e9e9){try{jsonpatch[_0xaa22('0x23')](_0x43e9e9,_0x5648bb,!![]);}catch(_0x17b142){return BPromise[_0xaa22('0x24')](_0x17b142);}return _0x43e9e9[_0xaa22('0x25')]();};}function saveUpdates(_0x2681fc,_0x2414c3){return function(_0x2b6dfb){if(_0x2b6dfb){return _0x2b6dfb['update'](_0x2681fc)[_0xaa22('0x26')](function(_0x35cdec){return _0x35cdec;});}return null;};}function removeEntity(_0xae9eab,_0x43b32f){return function(_0x5b5bcf){if(_0x5b5bcf){return _0x5b5bcf[_0xaa22('0x27')]()[_0xaa22('0x26')](function(){_0xae9eab[_0xaa22('0x20')](0xcc)[_0xaa22('0x1a')]();});}};}function handleEntityNotFound(_0x25e9ac,_0x2f643d){return function(_0x5d9307){if(!_0x5d9307){_0x25e9ac[_0xaa22('0x19')](0x194);}return _0x5d9307;};}function handleError(_0x348a95,_0x22a614){_0x22a614=_0x22a614||0x1f4;return function(_0x35c21d){logger[_0xaa22('0x28')](_0x35c21d[_0xaa22('0x29')]);if(_0x35c21d[_0xaa22('0x2a')]){delete _0x35c21d['name'];}_0x348a95[_0xaa22('0x20')](_0x22a614)[_0xaa22('0x2b')](_0x35c21d);};}exports[_0xaa22('0x2c')]=function(_0x2ed748,_0x31c0e9){var _0x3f7741={},_0x58e81e={},_0x37167a={'count':0x0,'rows':[]};var _0x7fda2=_[_0xaa22('0x2d')](db[_0xaa22('0x2e')]['rawAttributes'],function(_0xa3d48f){return{'name':_0xa3d48f[_0xaa22('0x2f')],'type':_0xa3d48f[_0xaa22('0x30')][_0xaa22('0x31')]};});_0x58e81e[_0xaa22('0x32')]=_[_0xaa22('0x2d')](_0x7fda2,_0xaa22('0x2a'));_0x58e81e[_0xaa22('0x33')]=_[_0xaa22('0x34')](_0x2ed748[_0xaa22('0x33')]);_0x58e81e[_0xaa22('0x35')]=_[_0xaa22('0x36')](_0x58e81e[_0xaa22('0x32')],_0x58e81e[_0xaa22('0x33')]);_0x3f7741['attributes']=_['intersection'](_0x58e81e['model'],qs[_0xaa22('0x37')](_0x2ed748[_0xaa22('0x33')][_0xaa22('0x37')]));_0x3f7741[_0xaa22('0x38')]=_0x3f7741[_0xaa22('0x38')][_0xaa22('0x39')]?_0x3f7741[_0xaa22('0x38')]:_0x58e81e[_0xaa22('0x32')];if(!_0x2ed748[_0xaa22('0x33')]['hasOwnProperty']('nolimit')){_0x3f7741[_0xaa22('0x1e')]=qs[_0xaa22('0x1e')](_0x2ed748[_0xaa22('0x33')][_0xaa22('0x1e')]);_0x3f7741[_0xaa22('0x1c')]=qs[_0xaa22('0x1c')](_0x2ed748[_0xaa22('0x33')]['offset']);}_0x3f7741[_0xaa22('0x3a')]=qs[_0xaa22('0x3b')](_0x2ed748[_0xaa22('0x33')][_0xaa22('0x3b')]);_0x3f7741[_0xaa22('0x3c')]=qs[_0xaa22('0x35')](_['pick'](_0x2ed748[_0xaa22('0x33')],_0x58e81e['filters']),_0x7fda2);if(_0x2ed748[_0xaa22('0x33')]['filter']){_0x3f7741[_0xaa22('0x3c')]=_[_0xaa22('0x3d')](_0x3f7741[_0xaa22('0x3c')],{'$or':_['map'](_0x7fda2,function(_0x5d4a17){if(_0x5d4a17[_0xaa22('0x30')]!==_0xaa22('0x3e')){var _0x3301d2={};_0x3301d2[_0x5d4a17[_0xaa22('0x2a')]]={'$like':'%'+_0x2ed748['query']['filter']+'%'};return _0x3301d2;}})});}_0x3f7741=_[_0xaa22('0x3d')]({},_0x3f7741,_0x2ed748[_0xaa22('0x3f')]);var _0x20f956={'where':_0x3f7741[_0xaa22('0x3c')]};return db[_0xaa22('0x2e')]['count'](_0x20f956)[_0xaa22('0x26')](function(_0x4829a2){_0x37167a[_0xaa22('0x1f')]=_0x4829a2;if(_0x2ed748['query'][_0xaa22('0x40')]){_0x3f7741['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xaa22('0x41')](_0x3f7741);})[_0xaa22('0x26')](function(_0x14f46d){_0x37167a[_0xaa22('0x42')]=_0x14f46d;return _0x37167a;})[_0xaa22('0x26')](respondWithFilteredResult(_0x31c0e9,_0x3f7741))[_0xaa22('0x43')](handleError(_0x31c0e9,null));};exports[_0xaa22('0x44')]=function(_0x4b9de4,_0x16ebee){var _0x247c81={'raw':![],'where':{'id':_0x4b9de4[_0xaa22('0x45')]['id']}},_0x38f849={};_0x38f849['model']=_[_0xaa22('0x34')](db['SugarcrmAccount'][_0xaa22('0x46')]);_0x38f849[_0xaa22('0x33')]=_['keys'](_0x4b9de4[_0xaa22('0x33')]);_0x38f849['filters']=_[_0xaa22('0x36')](_0x38f849[_0xaa22('0x32')],_0x38f849[_0xaa22('0x33')]);_0x247c81[_0xaa22('0x38')]=_[_0xaa22('0x36')](_0x38f849[_0xaa22('0x32')],qs['fields'](_0x4b9de4[_0xaa22('0x33')][_0xaa22('0x37')]));_0x247c81[_0xaa22('0x38')]=_0x247c81[_0xaa22('0x38')][_0xaa22('0x39')]?_0x247c81[_0xaa22('0x38')]:_0x38f849['model'];if(_0x4b9de4['query'][_0xaa22('0x40')]){_0x247c81[_0xaa22('0x47')]=[{'all':!![]}];}_0x247c81=_[_0xaa22('0x3d')]({},_0x247c81,_0x4b9de4['options']);return db[_0xaa22('0x2e')][_0xaa22('0x48')](_0x247c81)[_0xaa22('0x26')](handleEntityNotFound(_0x16ebee,null))[_0xaa22('0x26')](respondWithResult(_0x16ebee,null))[_0xaa22('0x43')](handleError(_0x16ebee,null));};exports[_0xaa22('0x49')]=function(_0x402b33,_0x41055b){return db[_0xaa22('0x2e')]['create'](_0x402b33[_0xaa22('0x4a')],{})['then'](respondWithResult(_0x41055b,0xc9))['catch'](handleError(_0x41055b,null));};exports[_0xaa22('0x4b')]=function(_0x2f8083,_0x48d379){if(_0x2f8083[_0xaa22('0x4a')]['id']){delete _0x2f8083[_0xaa22('0x4a')]['id'];}return db[_0xaa22('0x2e')][_0xaa22('0x48')]({'where':{'id':_0x2f8083['params']['id']}})[_0xaa22('0x26')](handleEntityNotFound(_0x48d379,null))['then'](saveUpdates(_0x2f8083['body'],null))['then'](respondWithResult(_0x48d379,null))[_0xaa22('0x43')](handleError(_0x48d379,null));};exports[_0xaa22('0x27')]=function(_0x57ee24,_0x3cd222){return db[_0xaa22('0x2e')][_0xaa22('0x48')]({'where':{'id':_0x57ee24['params']['id']}})['then'](handleEntityNotFound(_0x3cd222,null))['then'](removeEntity(_0x3cd222,null))['catch'](handleError(_0x3cd222,null));};exports[_0xaa22('0x4c')]=function(_0x5cb2e8,_0x1713d8,_0xacaf02){var _0x4621d7={};var _0x28a114={};var _0x11db8d;var _0x3545d4;return db[_0xaa22('0x2e')]['findOne']({'where':{'id':_0x5cb2e8[_0xaa22('0x45')]['id']}})[_0xaa22('0x26')](handleEntityNotFound(_0x1713d8,null))[_0xaa22('0x26')](function(_0x3c62f3){if(_0x3c62f3){_0x11db8d=_0x3c62f3;_0x28a114['model']=_['keys'](db[_0xaa22('0x4d')]['rawAttributes']);_0x28a114[_0xaa22('0x33')]=_[_0xaa22('0x34')](_0x5cb2e8[_0xaa22('0x33')]);_0x28a114[_0xaa22('0x35')]=_[_0xaa22('0x36')](_0x28a114['model'],_0x28a114[_0xaa22('0x33')]);_0x4621d7[_0xaa22('0x38')]=_[_0xaa22('0x36')](_0x28a114[_0xaa22('0x32')],qs[_0xaa22('0x37')](_0x5cb2e8['query'][_0xaa22('0x37')]));_0x4621d7[_0xaa22('0x38')]=_0x4621d7[_0xaa22('0x38')][_0xaa22('0x39')]?_0x4621d7['attributes']:_0x28a114[_0xaa22('0x32')];_0x4621d7[_0xaa22('0x3a')]=qs[_0xaa22('0x3b')](_0x5cb2e8[_0xaa22('0x33')][_0xaa22('0x3b')]);_0x4621d7[_0xaa22('0x3c')]=qs[_0xaa22('0x35')](_[_0xaa22('0x4e')](_0x5cb2e8[_0xaa22('0x33')],_0x28a114[_0xaa22('0x35')]));if(_0x5cb2e8['query']['filter']){_0x4621d7[_0xaa22('0x3c')]=_[_0xaa22('0x3d')](_0x4621d7[_0xaa22('0x3c')],{'$or':_[_0xaa22('0x2d')](_0x4621d7[_0xaa22('0x38')],function(_0x4287a0){var _0x5c42ad={};_0x5c42ad[_0x4287a0]={'$like':'%'+_0x5cb2e8[_0xaa22('0x33')]['filter']+'%'};return _0x5c42ad;})});}_0x4621d7=_[_0xaa22('0x3d')]({},_0x4621d7,_0x5cb2e8[_0xaa22('0x3f')]);return _0x11db8d['getConfigurations'](_0x4621d7);}})[_0xaa22('0x26')](function(_0x306bba){if(_0x306bba){_0x3545d4=_0x306bba[_0xaa22('0x39')];if(!_0x5cb2e8[_0xaa22('0x33')][_0xaa22('0x4f')](_0xaa22('0x50'))){_0x4621d7['limit']=qs['limit'](_0x5cb2e8[_0xaa22('0x33')][_0xaa22('0x1e')]);_0x4621d7[_0xaa22('0x1c')]=qs[_0xaa22('0x1c')](_0x5cb2e8[_0xaa22('0x33')][_0xaa22('0x1c')]);}return _0x11db8d[_0xaa22('0x4c')](_0x4621d7);}})[_0xaa22('0x26')](function(_0x2fd1a9){if(_0x2fd1a9){return _0x2fd1a9?{'count':_0x3545d4,'rows':_0x2fd1a9}:null;}})[_0xaa22('0x26')](respondWithResult(_0x1713d8,null))['catch'](handleError(_0x1713d8,null));};exports[_0xaa22('0x51')]=function(_0x20ce7a,_0x1ad476,_0x38b600){if(_0x20ce7a[_0xaa22('0x4a')]['id']){delete _0x20ce7a[_0xaa22('0x4a')]['id'];}return db[_0xaa22('0x2e')][_0xaa22('0x52')]({'where':{'id':_0x20ce7a[_0xaa22('0x45')]['id']}})[_0xaa22('0x26')](handleEntityNotFound(_0x1ad476,null))[_0xaa22('0x26')](function(_0x53da4c){if(_0x53da4c){_0x20ce7a[_0xaa22('0x4a')][_0xaa22('0x53')]=_0x53da4c['id'];_0x20ce7a[_0xaa22('0x4a')][_0xaa22('0x54')]=integrations[_0xaa22('0x55')](_0x20ce7a[_0xaa22('0x4a')][_0xaa22('0x56')],_0x20ce7a[_0xaa22('0x4a')]['type']);_0x20ce7a[_0xaa22('0x4a')]['Descriptions']=integrations[_0xaa22('0x57')](_0x20ce7a[_0xaa22('0x4a')]['channel'],_0x20ce7a['body'][_0xaa22('0x30')]);return db[_0xaa22('0x4d')][_0xaa22('0x49')](_0x20ce7a[_0xaa22('0x4a')],{'include':[{'model':db['SugarcrmField'],'as':_0xaa22('0x54')},{'model':db[_0xaa22('0x58')],'as':'Descriptions'}]});}return null;})[_0xaa22('0x26')](respondWithResult(_0x1ad476,null))['catch'](handleError(_0x1ad476,null));};exports[_0xaa22('0x59')]=function(_0x2ca12f,_0x596e66,_0x1c70e6){var _0x5b443a='';var _0x19cf4f=['id',_0xaa22('0x2a'),_0xaa22('0x5a'),_0xaa22('0x5b'),_0xaa22('0x5c'),'date_start',_0xaa22('0x5d'),_0xaa22('0x5e'),_0xaa22('0x5f'),_0xaa22('0x60'),_0xaa22('0x61'),_0xaa22('0x62')];return db[_0xaa22('0x2e')][_0xaa22('0x52')]({'where':{'id':_0x2ca12f[_0xaa22('0x45')]['id']},'attributes':['id',_0xaa22('0x63'),_0xaa22('0x64'),_0xaa22('0x65')]})[_0xaa22('0x26')](handleEntityNotFound(_0x596e66,null))[_0xaa22('0x26')](function(_0x231006){if(_0x231006){_0x5b443a=_0x231006['remoteUri'];var _0x215cea=_0x5b443a['slice'](-0x1);if(_0x215cea==='/'){_0x5b443a=_0x5b443a[_0xaa22('0x66')](0x0,_0x5b443a[_0xaa22('0x67')](_0x215cea));}return rp({'method':'POST','uri':util[_0xaa22('0x68')](_0xaa22('0x69'),_0x5b443a,_0xaa22('0x6a')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xaa22('0x6b'),'rest_data':JSON[_0xaa22('0x6c')]({'user_auth':{'user_name':_0x231006[_0xaa22('0x63')],'password':_0x231006[_0xaa22('0x64')],'encryption':_0xaa22('0x6d')},'application':_0xaa22('0x6e')})}});}})[_0xaa22('0x26')](function(_0x54fd6f){if(_0x54fd6f&&_0x54fd6f[_0xaa22('0x2a')]!==_0xaa22('0x6f')&&_0x54fd6f[_0xaa22('0x2a')]!=='Password\x20Expired'){return rp({'method':_0xaa22('0x70'),'uri':util[_0xaa22('0x68')](_0xaa22('0x69'),_0x5b443a,_0xaa22('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xaa22('0x6b'),'response_type':_0xaa22('0x6b'),'rest_data':JSON[_0xaa22('0x6c')]({'session':_0x54fd6f['id'],'module_name':'Calls'})}})['then'](function(_0x9701eb){if(_0x9701eb){var _0x5d065c=_['values'](_0x9701eb[_0xaa22('0x71')]);_['remove'](_0x5d065c,function(_0x3ba1b3){return _0x19cf4f[_0xaa22('0x72')](_0x3ba1b3[_0xaa22('0x2a')]);});return{'count':_0x5d065c['length'],'rows':_[_0xaa22('0x2d')](_0x5d065c,function(_0x4de407){return{'id':_0x4de407[_0xaa22('0x2a')],'name':_0x4de407[_0xaa22('0x73')],'custom':_[_0xaa22('0x74')](_0x4de407[_0xaa22('0x2a')],'_c')?!![]:![],'options':_0x4de407[_0xaa22('0x3f')]?_[_0xaa22('0x2d')](_[_0xaa22('0x75')](_0x4de407[_0xaa22('0x3f')]),function(_0x142b57){return{'name':_0x142b57['value'],'value':_0x142b57[_0xaa22('0x2a')]};}):[]};})};}})['then'](respondWithResult(_0x596e66,null))[_0xaa22('0x43')](function(_0x3d3870){var _0x468ec8=_0x2ca12f[_0xaa22('0x33')][_0xaa22('0x76')]?0x1f4:_0x3d3870[_0xaa22('0x77')]||0x1f4;logger[_0xaa22('0x28')](_0xaa22('0x78'),'getFields',_0x468ec8,JSON[_0xaa22('0x6c')](_0x3d3870));delete _0x3d3870[_0xaa22('0x2a')];if(_0x468ec8===0x191){_0x468ec8=0x190;}_0x596e66[_0xaa22('0x20')](_0x468ec8)[_0xaa22('0x2b')](_0x2ca12f[_0xaa22('0x33')]['test']?{'message':_0xaa22('0x79'),'statusCode':_0x3d3870[_0xaa22('0x77')]}:_0x3d3870);});}else{var _0x896858=0x1f4;_0x596e66[_0xaa22('0x20')](_0x896858)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x800a=['api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','SugarcrmAccount','then','include','findAll','catch','show','params','includeAll','find','create','getConfigurations','findOne','SugarcrmConfiguration','length','body','AccountId','Subjects','getSubjects','Descriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_name','password','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','Invalid\x20Login','format','get_module_fields','stringify','Calls','values','module_fields','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x800a,0x13e));var _0xa800=function(_0x1dab8f,_0x3a92f2){_0x1dab8f=_0x1dab8f-0x0;var _0x5e7610=_0x800a[_0x1dab8f];return _0x5e7610;};'use strict';var emlformat=require(_0xa800('0x0'));var rimraf=require(_0xa800('0x1'));var zipdir=require(_0xa800('0x2'));var jsonpatch=require(_0xa800('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa800('0x4'));var Mustache=require('mustache');var util=require(_0xa800('0x5'));var path=require(_0xa800('0x6'));var sox=require(_0xa800('0x7'));var csv=require(_0xa800('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa800('0x9'));var squel=require(_0xa800('0xa'));var crypto=require(_0xa800('0xb'));var jsforce=require(_0xa800('0xc'));var deskjs=require(_0xa800('0xd'));var toCsv=require(_0xa800('0x8'));var querystring=require(_0xa800('0xe'));var Papa=require(_0xa800('0xf'));var Redis=require(_0xa800('0x10'));var authService=require(_0xa800('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa800('0x12'));var hardwareService=require(_0xa800('0x13'));var logger=require(_0xa800('0x14'))(_0xa800('0x15'));var utils=require(_0xa800('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa800('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa800('0x18'));function respondWithStatusCode(_0x2c0fb8,_0x4fe014){_0x4fe014=_0x4fe014||0xcc;return function(_0x3d8b40){if(_0x3d8b40){return _0x2c0fb8[_0xa800('0x19')](_0x4fe014);}return _0x2c0fb8[_0xa800('0x1a')](_0x4fe014)[_0xa800('0x1b')]();};}function respondWithResult(_0x2a26d5,_0x2401ad){_0x2401ad=_0x2401ad||0xc8;return function(_0xdfe63b){if(_0xdfe63b){return _0x2a26d5[_0xa800('0x1a')](_0x2401ad)[_0xa800('0x1c')](_0xdfe63b);}};}function respondWithFilteredResult(_0x5291b6,_0x39c308){return function(_0x280a2f){if(_0x280a2f){var _0x3224a5=typeof _0x39c308['offset']===_0xa800('0x1d')&&typeof _0x39c308[_0xa800('0x1e')]===_0xa800('0x1d');var _0x228143=_0x280a2f[_0xa800('0x1f')];var _0x3111ec=_0x3224a5?0x0:_0x39c308[_0xa800('0x20')];var _0x2e9bf7=_0x3224a5?_0x280a2f[_0xa800('0x1f')]:_0x39c308['offset']+_0x39c308[_0xa800('0x1e')];var _0x45c2fa;if(_0x2e9bf7>=_0x228143){_0x2e9bf7=_0x228143;_0x45c2fa=0xc8;}else{_0x45c2fa=0xce;}_0x5291b6['status'](_0x45c2fa);return _0x5291b6['set'](_0xa800('0x21'),_0x3111ec+'-'+_0x2e9bf7+'/'+_0x228143)[_0xa800('0x1c')](_0x280a2f);}return null;};}function patchUpdates(_0x3693c7){return function(_0x802500){try{jsonpatch[_0xa800('0x22')](_0x802500,_0x3693c7,!![]);}catch(_0x214b88){return BPromise[_0xa800('0x23')](_0x214b88);}return _0x802500[_0xa800('0x24')]();};}function saveUpdates(_0x1f5615,_0x5467db){return function(_0x9fcac9){if(_0x9fcac9){return _0x9fcac9[_0xa800('0x25')](_0x1f5615)['then'](function(_0x345315){return _0x345315;});}return null;};}function removeEntity(_0x12cec2,_0x11f317){return function(_0x27aca3){if(_0x27aca3){return _0x27aca3[_0xa800('0x26')]()['then'](function(){_0x12cec2[_0xa800('0x1a')](0xcc)[_0xa800('0x1b')]();});}};}function handleEntityNotFound(_0x53d35b,_0x5caac3){return function(_0x5c6689){if(!_0x5c6689){_0x53d35b[_0xa800('0x19')](0x194);}return _0x5c6689;};}function handleError(_0xeee632,_0xb92500){_0xb92500=_0xb92500||0x1f4;return function(_0x252a54){logger[_0xa800('0x27')](_0x252a54[_0xa800('0x28')]);if(_0x252a54[_0xa800('0x29')]){delete _0x252a54[_0xa800('0x29')];}_0xeee632[_0xa800('0x1a')](_0xb92500)[_0xa800('0x2a')](_0x252a54);};}exports['index']=function(_0x72c0a2,_0x54b441){var _0x1662d5={},_0x4dd447={},_0x3f098a={'count':0x0,'rows':[]};var _0x15e245=_[_0xa800('0x2b')](db['SugarcrmAccount'][_0xa800('0x2c')],function(_0x1d3ddb){return{'name':_0x1d3ddb[_0xa800('0x2d')],'type':_0x1d3ddb['type']['key']};});_0x4dd447['model']=_['map'](_0x15e245,_0xa800('0x29'));_0x4dd447['query']=_[_0xa800('0x2e')](_0x72c0a2['query']);_0x4dd447[_0xa800('0x2f')]=_[_0xa800('0x30')](_0x4dd447[_0xa800('0x31')],_0x4dd447[_0xa800('0x32')]);_0x1662d5[_0xa800('0x33')]=_['intersection'](_0x4dd447[_0xa800('0x31')],qs[_0xa800('0x34')](_0x72c0a2[_0xa800('0x32')]['fields']));_0x1662d5[_0xa800('0x33')]=_0x1662d5['attributes']['length']?_0x1662d5['attributes']:_0x4dd447[_0xa800('0x31')];if(!_0x72c0a2['query'][_0xa800('0x35')](_0xa800('0x36'))){_0x1662d5[_0xa800('0x1e')]=qs[_0xa800('0x1e')](_0x72c0a2[_0xa800('0x32')][_0xa800('0x1e')]);_0x1662d5[_0xa800('0x20')]=qs[_0xa800('0x20')](_0x72c0a2['query'][_0xa800('0x20')]);}_0x1662d5[_0xa800('0x37')]=qs[_0xa800('0x38')](_0x72c0a2[_0xa800('0x32')]['sort']);_0x1662d5[_0xa800('0x39')]=qs['filters'](_[_0xa800('0x3a')](_0x72c0a2[_0xa800('0x32')],_0x4dd447[_0xa800('0x2f')]),_0x15e245);if(_0x72c0a2[_0xa800('0x32')][_0xa800('0x3b')]){_0x1662d5[_0xa800('0x39')]=_['merge'](_0x1662d5['where'],{'$or':_[_0xa800('0x2b')](_0x15e245,function(_0x111048){if(_0x111048[_0xa800('0x3c')]!==_0xa800('0x3d')){var _0x5e1daf={};_0x5e1daf[_0x111048[_0xa800('0x29')]]={'$like':'%'+_0x72c0a2['query'][_0xa800('0x3b')]+'%'};return _0x5e1daf;}})});}_0x1662d5=_[_0xa800('0x3e')]({},_0x1662d5,_0x72c0a2[_0xa800('0x3f')]);var _0xa1a5df={'where':_0x1662d5[_0xa800('0x39')]};return db[_0xa800('0x40')][_0xa800('0x1f')](_0xa1a5df)[_0xa800('0x41')](function(_0x35dab4){_0x3f098a[_0xa800('0x1f')]=_0x35dab4;if(_0x72c0a2[_0xa800('0x32')]['includeAll']){_0x1662d5[_0xa800('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa800('0x43')](_0x1662d5);})[_0xa800('0x41')](function(_0x4665a6){_0x3f098a['rows']=_0x4665a6;return _0x3f098a;})[_0xa800('0x41')](respondWithFilteredResult(_0x54b441,_0x1662d5))[_0xa800('0x44')](handleError(_0x54b441,null));};exports[_0xa800('0x45')]=function(_0x44c65f,_0x2dfaf7){var _0x2afc84={'raw':![],'where':{'id':_0x44c65f[_0xa800('0x46')]['id']}},_0x1f9741={};_0x1f9741[_0xa800('0x31')]=_[_0xa800('0x2e')](db[_0xa800('0x40')][_0xa800('0x2c')]);_0x1f9741['query']=_[_0xa800('0x2e')](_0x44c65f[_0xa800('0x32')]);_0x1f9741[_0xa800('0x2f')]=_['intersection'](_0x1f9741[_0xa800('0x31')],_0x1f9741[_0xa800('0x32')]);_0x2afc84['attributes']=_['intersection'](_0x1f9741[_0xa800('0x31')],qs['fields'](_0x44c65f[_0xa800('0x32')][_0xa800('0x34')]));_0x2afc84[_0xa800('0x33')]=_0x2afc84['attributes']['length']?_0x2afc84['attributes']:_0x1f9741[_0xa800('0x31')];if(_0x44c65f[_0xa800('0x32')][_0xa800('0x47')]){_0x2afc84[_0xa800('0x42')]=[{'all':!![]}];}_0x2afc84=_[_0xa800('0x3e')]({},_0x2afc84,_0x44c65f[_0xa800('0x3f')]);return db[_0xa800('0x40')][_0xa800('0x48')](_0x2afc84)[_0xa800('0x41')](handleEntityNotFound(_0x2dfaf7,null))[_0xa800('0x41')](respondWithResult(_0x2dfaf7,null))[_0xa800('0x44')](handleError(_0x2dfaf7,null));};exports['create']=function(_0x244a89,_0x3cdcee){return db[_0xa800('0x40')][_0xa800('0x49')](_0x244a89['body'],{})[_0xa800('0x41')](respondWithResult(_0x3cdcee,0xc9))[_0xa800('0x44')](handleError(_0x3cdcee,null));};exports[_0xa800('0x25')]=function(_0x2986ed,_0x21af1a){if(_0x2986ed['body']['id']){delete _0x2986ed['body']['id'];}return db[_0xa800('0x40')][_0xa800('0x48')]({'where':{'id':_0x2986ed[_0xa800('0x46')]['id']}})[_0xa800('0x41')](handleEntityNotFound(_0x21af1a,null))[_0xa800('0x41')](saveUpdates(_0x2986ed['body'],null))[_0xa800('0x41')](respondWithResult(_0x21af1a,null))['catch'](handleError(_0x21af1a,null));};exports['destroy']=function(_0x1cedf5,_0x16d5e2){return db[_0xa800('0x40')][_0xa800('0x48')]({'where':{'id':_0x1cedf5[_0xa800('0x46')]['id']}})['then'](handleEntityNotFound(_0x16d5e2,null))[_0xa800('0x41')](removeEntity(_0x16d5e2,null))[_0xa800('0x44')](handleError(_0x16d5e2,null));};exports[_0xa800('0x4a')]=function(_0x5c9327,_0x847a8e,_0x52ee22){var _0x2f42a4={};var _0x34aaf7={};var _0x49e81a;var _0x169a90;return db['SugarcrmAccount'][_0xa800('0x4b')]({'where':{'id':_0x5c9327['params']['id']}})[_0xa800('0x41')](handleEntityNotFound(_0x847a8e,null))[_0xa800('0x41')](function(_0x18a319){if(_0x18a319){_0x49e81a=_0x18a319;_0x34aaf7[_0xa800('0x31')]=_[_0xa800('0x2e')](db[_0xa800('0x4c')]['rawAttributes']);_0x34aaf7['query']=_['keys'](_0x5c9327[_0xa800('0x32')]);_0x34aaf7['filters']=_['intersection'](_0x34aaf7[_0xa800('0x31')],_0x34aaf7[_0xa800('0x32')]);_0x2f42a4[_0xa800('0x33')]=_['intersection'](_0x34aaf7[_0xa800('0x31')],qs[_0xa800('0x34')](_0x5c9327[_0xa800('0x32')][_0xa800('0x34')]));_0x2f42a4[_0xa800('0x33')]=_0x2f42a4[_0xa800('0x33')][_0xa800('0x4d')]?_0x2f42a4[_0xa800('0x33')]:_0x34aaf7[_0xa800('0x31')];_0x2f42a4[_0xa800('0x37')]=qs['sort'](_0x5c9327['query'][_0xa800('0x38')]);_0x2f42a4[_0xa800('0x39')]=qs[_0xa800('0x2f')](_['pick'](_0x5c9327[_0xa800('0x32')],_0x34aaf7[_0xa800('0x2f')]));if(_0x5c9327['query'][_0xa800('0x3b')]){_0x2f42a4[_0xa800('0x39')]=_['merge'](_0x2f42a4[_0xa800('0x39')],{'$or':_[_0xa800('0x2b')](_0x2f42a4['attributes'],function(_0x50dedc){var _0x5acb2d={};_0x5acb2d[_0x50dedc]={'$like':'%'+_0x5c9327[_0xa800('0x32')][_0xa800('0x3b')]+'%'};return _0x5acb2d;})});}_0x2f42a4=_['merge']({},_0x2f42a4,_0x5c9327['options']);return _0x49e81a[_0xa800('0x4a')](_0x2f42a4);}})[_0xa800('0x41')](function(_0x5e9245){if(_0x5e9245){_0x169a90=_0x5e9245[_0xa800('0x4d')];if(!_0x5c9327[_0xa800('0x32')][_0xa800('0x35')]('nolimit')){_0x2f42a4[_0xa800('0x1e')]=qs[_0xa800('0x1e')](_0x5c9327['query'][_0xa800('0x1e')]);_0x2f42a4['offset']=qs[_0xa800('0x20')](_0x5c9327['query'][_0xa800('0x20')]);}return _0x49e81a[_0xa800('0x4a')](_0x2f42a4);}})['then'](function(_0x5e4abc){if(_0x5e4abc){return _0x5e4abc?{'count':_0x169a90,'rows':_0x5e4abc}:null;}})['then'](respondWithResult(_0x847a8e,null))['catch'](handleError(_0x847a8e,null));};exports['addConfiguration']=function(_0x59aba3,_0x2094d7,_0x20e9de){if(_0x59aba3[_0xa800('0x4e')]['id']){delete _0x59aba3[_0xa800('0x4e')]['id'];}return db[_0xa800('0x40')][_0xa800('0x4b')]({'where':{'id':_0x59aba3[_0xa800('0x46')]['id']}})[_0xa800('0x41')](handleEntityNotFound(_0x2094d7,null))['then'](function(_0x3f2439){if(_0x3f2439){_0x59aba3['body'][_0xa800('0x4f')]=_0x3f2439['id'];_0x59aba3[_0xa800('0x4e')][_0xa800('0x50')]=integrations[_0xa800('0x51')](_0x59aba3[_0xa800('0x4e')]['channel'],_0x59aba3[_0xa800('0x4e')][_0xa800('0x3c')]);_0x59aba3[_0xa800('0x4e')][_0xa800('0x52')]=integrations['getDescriptions'](_0x59aba3['body']['channel'],_0x59aba3['body'][_0xa800('0x3c')]);return db['SugarcrmConfiguration'][_0xa800('0x49')](_0x59aba3[_0xa800('0x4e')],{'include':[{'model':db['SugarcrmField'],'as':_0xa800('0x50')},{'model':db[_0xa800('0x53')],'as':_0xa800('0x52')}]});}return null;})[_0xa800('0x41')](respondWithResult(_0x2094d7,null))[_0xa800('0x44')](handleError(_0x2094d7,null));};exports[_0xa800('0x54')]=function(_0x35af8b,_0x39af53,_0x555e9a){var _0x2552f9='';var _0x4035f8=['id',_0xa800('0x29'),_0xa800('0x55'),'created_by',_0xa800('0x56'),_0xa800('0x57'),_0xa800('0x58'),_0xa800('0x59'),'parent_id','parent_type',_0xa800('0x5a'),'direction'];return db[_0xa800('0x40')][_0xa800('0x4b')]({'where':{'id':_0x35af8b['params']['id']},'attributes':['id','username',_0xa800('0x5b'),_0xa800('0x5c')]})[_0xa800('0x41')](handleEntityNotFound(_0x39af53,null))['then'](function(_0x7dbbae){if(_0x7dbbae){_0x2552f9=_0x7dbbae[_0xa800('0x5c')];var _0x48c1ab=_0x2552f9['slice'](-0x1);if(_0x48c1ab==='/'){_0x2552f9=_0x2552f9[_0xa800('0x5d')](0x0,_0x2552f9[_0xa800('0x5e')](_0x48c1ab));}return rp({'method':_0xa800('0x5f'),'uri':util['format'](_0xa800('0x60'),_0x2552f9,_0xa800('0x61')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xa800('0x62'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x7dbbae[_0xa800('0x63')],'password':_0x7dbbae[_0xa800('0x5b')],'encryption':_0xa800('0x64')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xa800('0x41')](function(_0x4ea14a){if(_0x4ea14a&&_0x4ea14a['name']!==_0xa800('0x65')&&_0x4ea14a[_0xa800('0x29')]!=='Password\x20Expired'){return rp({'method':_0xa800('0x5f'),'uri':util[_0xa800('0x66')](_0xa800('0x60'),_0x2552f9,_0xa800('0x61')),'json':!![],'form':{'method':_0xa800('0x67'),'input_type':_0xa800('0x62'),'response_type':'JSON','rest_data':JSON[_0xa800('0x68')]({'session':_0x4ea14a['id'],'module_name':_0xa800('0x69')})}})[_0xa800('0x41')](function(_0x1389d5){if(_0x1389d5){var _0x512ff9=_[_0xa800('0x6a')](_0x1389d5[_0xa800('0x6b')]);_['remove'](_0x512ff9,function(_0x4a3ba6){return _0x4035f8['includes'](_0x4a3ba6[_0xa800('0x29')]);});return{'count':_0x512ff9[_0xa800('0x4d')],'rows':_[_0xa800('0x2b')](_0x512ff9,function(_0x4ca282){return{'id':_0x4ca282['name'],'name':_0x4ca282['label'],'custom':_['endsWith'](_0x4ca282[_0xa800('0x29')],'_c')?!![]:![],'options':_0x4ca282[_0xa800('0x3f')]?_[_0xa800('0x2b')](_[_0xa800('0x6a')](_0x4ca282[_0xa800('0x3f')]),function(_0x465b57){return{'name':_0x465b57[_0xa800('0x6c')],'value':_0x465b57[_0xa800('0x29')]};}):[]};})};}})[_0xa800('0x41')](respondWithResult(_0x39af53,null))[_0xa800('0x44')](function(_0x39c61d){var _0x48453f=_0x35af8b[_0xa800('0x32')][_0xa800('0x6d')]?0x1f4:_0x39c61d['statusCode']||0x1f4;logger['error'](_0xa800('0x6e'),_0xa800('0x54'),_0x48453f,JSON[_0xa800('0x68')](_0x39c61d));delete _0x39c61d[_0xa800('0x29')];if(_0x48453f===0x191){_0x48453f=0x190;}_0x39af53['status'](_0x48453f)['send'](_0x35af8b['query']['test']?{'message':_0xa800('0x6f'),'statusCode':_0x39c61d[_0xa800('0x70')]}:_0x39c61d);});}else{var _0x4a0567=0x1f4;_0x39af53[_0xa800('0x1a')](_0x4a0567)[_0xa800('0x2a')]({'message':_0xa800('0x6f'),'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 18a0c73..10d5488 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 _0xdec1=['moment','bluebird','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','int_sugarcrm_accounts','lodash','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xdec1,0x11f));var _0x1dec=function(_0x26c0cb,_0x2713a9){_0x26c0cb=_0x26c0cb-0x0;var _0x5606c5=_0xdec1[_0x26c0cb];return _0x5606c5;};'use strict';var _=require(_0x1dec('0x0'));var util=require('util');var logger=require(_0x1dec('0x1'))(_0x1dec('0x2'));var moment=require(_0x1dec('0x3'));var BPromise=require(_0x1dec('0x4'));var rp=require(_0x1dec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dec('0x6'));var config=require('../../config/environment');var attributes=require(_0x1dec('0x7'));var integrations=require(_0x1dec('0x8'));module['exports']=function(_0x14cb62,_0x41a1f5){return _0x14cb62['define']('SugarcrmAccount',attributes,{'tableName':_0x1dec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd5=['rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xcbd5,0x1c0));var _0x5cbd=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xcbd5[_0x237546];return _0x233e29;};'use strict';var _=require(_0x5cbd('0x0'));var util=require(_0x5cbd('0x1'));var logger=require(_0x5cbd('0x2'))('api');var moment=require(_0x5cbd('0x3'));var BPromise=require(_0x5cbd('0x4'));var rp=require(_0x5cbd('0x5'));var fs=require('fs');var path=require(_0x5cbd('0x6'));var rimraf=require(_0x5cbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x5cbd('0x8'));var integrations=require(_0x5cbd('0x9'));module['exports']=function(_0x9da8a,_0x18b4e9){return _0x9da8a[_0x5cbd('0xa')](_0x5cbd('0xb'),attributes,{'tableName':_0x5cbd('0xc'),'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 300082c..fae45af 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 _0x956a=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SugarcrmAccount','findAll','raw','options','where','limit','include','map','model','attributes','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x44d28b,_0xfa0655){var _0x5ebe46=function(_0x417491){while(--_0x417491){_0x44d28b['push'](_0x44d28b['shift']());}};_0x5ebe46(++_0xfa0655);}(_0x956a,0x11a));var _0xa956=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x956a[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xa956('0x0'));var util=require(_0xa956('0x1'));var moment=require(_0xa956('0x2'));var BPromise=require('bluebird');var rs=require(_0xa956('0x3'));var fs=require('fs');var Redis=require(_0xa956('0x4'));var db=require(_0xa956('0x5'))['db'];var utils=require(_0xa956('0x6'));var logger=require(_0xa956('0x7'))(_0xa956('0x8'));var config=require(_0xa956('0x9'));var jayson=require(_0xa956('0xa'));var client=jayson[_0xa956('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3534cb,_0x4c3a61,_0x11a2f7){return new BPromise(function(_0x1c8b95,_0x5a0d08){return client[_0xa956('0xc')](_0x3534cb,_0x11a2f7)[_0xa956('0xd')](function(_0x2ef10e){logger[_0xa956('0xe')](_0xa956('0xf'),_0x4c3a61,_0xa956('0x10'));logger[_0xa956('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4c3a61,_0xa956('0x10'),JSON[_0xa956('0x12')](_0x2ef10e));if(_0x2ef10e['error']){if(_0x2ef10e[_0xa956('0x13')][_0xa956('0x14')]===0x1f4){logger['error'](_0xa956('0xf'),_0x4c3a61,_0x2ef10e[_0xa956('0x13')]['message']);return _0x5a0d08(_0x2ef10e[_0xa956('0x13')][_0xa956('0x15')]);}logger[_0xa956('0x13')](_0xa956('0xf'),_0x4c3a61,_0x2ef10e[_0xa956('0x13')]['message']);return _0x1c8b95(_0x2ef10e[_0xa956('0x13')][_0xa956('0x15')]);}else{logger[_0xa956('0xe')](_0xa956('0xf'),_0x4c3a61,_0xa956('0x10'));_0x1c8b95(_0x2ef10e[_0xa956('0x16')][_0xa956('0x15')]);}})[_0xa956('0x17')](function(_0x160577){logger[_0xa956('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x4c3a61,_0x160577);_0x5a0d08(_0x160577);});});}exports['GetSugarcrmAccount']=function(_0x5a5154){var _0xee6b1c=this;return new Promise(function(_0x4e9007,_0x1fbb72){return db[_0xa956('0x18')][_0xa956('0x19')]({'raw':_0x5a5154['options']?_0x5a5154['options'][_0xa956('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a5154['options']?_0x5a5154[_0xa956('0x1b')][_0xa956('0x1c')]||null:null,'attributes':_0x5a5154[_0xa956('0x1b')]?_0x5a5154[_0xa956('0x1b')]['attributes']||null:null,'limit':_0x5a5154['options']?_0x5a5154['options'][_0xa956('0x1d')]||null:null,'include':_0x5a5154['options']?_0x5a5154[_0xa956('0x1b')][_0xa956('0x1e')]?_[_0xa956('0x1f')](_0x5a5154[_0xa956('0x1b')][_0xa956('0x1e')],function(_0x1141bc){return{'model':db[_0x1141bc[_0xa956('0x20')]],'as':_0x1141bc['as'],'attributes':_0x1141bc[_0xa956('0x21')],'include':_0x1141bc[_0xa956('0x1e')]?_['map'](_0x1141bc[_0xa956('0x1e')],function(_0x2ef951){return{'model':db[_0x2ef951['model']],'as':_0x2ef951['as'],'attributes':_0x2ef951[_0xa956('0x21')],'include':_0x2ef951[_0xa956('0x1e')]?_[_0xa956('0x1f')](_0x2ef951[_0xa956('0x1e')],function(_0xa990c8){return{'model':db[_0xa990c8[_0xa956('0x20')]],'as':_0xa990c8['as'],'attributes':_0xa990c8[_0xa956('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e3ac5){logger[_0xa956('0xe')]('GetSugarcrmAccount',_0x5a5154);logger['debug'](_0xa956('0x22'),_0x5a5154,JSON['stringify'](_0x4e3ac5));_0x4e9007(_0x4e3ac5);})[_0xa956('0x17')](function(_0x300d8b){logger[_0xa956('0x13')](_0xa956('0x22'),_0x300d8b[_0xa956('0x15')],_0x5a5154);_0x1fbb72(_0xee6b1c[_0xa956('0x13')](0x1f4,_0x300d8b['message']));});});};exports[_0xa956('0x23')]=function(_0x38c2d1){var _0x2b1771=this;return new Promise(function(_0x4250fc,_0x28354b){return db[_0xa956('0x18')][_0xa956('0x24')]({'raw':_0x38c2d1[_0xa956('0x1b')]?_0x38c2d1[_0xa956('0x1b')][_0xa956('0x1a')]===undefined?!![]:![]:!![],'where':_0x38c2d1['options']?_0x38c2d1[_0xa956('0x1b')][_0xa956('0x1c')]||null:null,'attributes':_0x38c2d1[_0xa956('0x1b')]?_0x38c2d1[_0xa956('0x1b')]['attributes']||null:null,'include':_0x38c2d1[_0xa956('0x1b')]?_0x38c2d1[_0xa956('0x1b')][_0xa956('0x1e')]?_[_0xa956('0x1f')](_0x38c2d1[_0xa956('0x1b')]['include'],function(_0x1ef5e8){return{'model':db[_0x1ef5e8[_0xa956('0x20')]],'as':_0x1ef5e8['as'],'attributes':_0x1ef5e8[_0xa956('0x21')],'include':_0x1ef5e8[_0xa956('0x1e')]?_[_0xa956('0x1f')](_0x1ef5e8[_0xa956('0x1e')],function(_0x260c11){return{'model':db[_0x260c11[_0xa956('0x20')]],'as':_0x260c11['as'],'attributes':_0x260c11[_0xa956('0x21')],'include':_0x260c11[_0xa956('0x1e')]?_['map'](_0x260c11[_0xa956('0x1e')],function(_0x4e6d0d){return{'model':db[_0x4e6d0d[_0xa956('0x20')]],'as':_0x4e6d0d['as'],'attributes':_0x4e6d0d[_0xa956('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa956('0xd')](function(_0x423e93){logger[_0xa956('0xe')](_0xa956('0x23'),_0x38c2d1);logger[_0xa956('0x11')](_0xa956('0x23'),_0x38c2d1,JSON[_0xa956('0x12')](_0x423e93));_0x4250fc(_0x423e93);})['catch'](function(_0xbbbdd9){logger['error'](_0xa956('0x23'),_0xbbbdd9[_0xa956('0x15')],_0x38c2d1);_0x28354b(_0x2b1771[_0xa956('0x13')](0x1f4,_0xbbbdd9[_0xa956('0x15')]));});});}; \ No newline at end of file +var _0x280c=['ShowSugarcrmAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','where','include','map','model','attributes','then','GetSugarcrmAccount'];(function(_0x48e0f7,_0x3e1fc9){var _0x4f697a=function(_0x5dcf0b){while(--_0x5dcf0b){_0x48e0f7['push'](_0x48e0f7['shift']());}};_0x4f697a(++_0x3e1fc9);}(_0x280c,0x1b2));var _0xc280=function(_0xc105b1,_0x401b6e){_0xc105b1=_0xc105b1-0x0;var _0x33d44d=_0x280c[_0xc105b1];return _0x33d44d;};'use strict';var _=require('lodash');var util=require(_0xc280('0x0'));var moment=require(_0xc280('0x1'));var BPromise=require('bluebird');var rs=require(_0xc280('0x2'));var fs=require('fs');var Redis=require(_0xc280('0x3'));var db=require(_0xc280('0x4'))['db'];var utils=require(_0xc280('0x5'));var logger=require('../../config/logger')(_0xc280('0x6'));var config=require(_0xc280('0x7'));var jayson=require(_0xc280('0x8'));var client=jayson[_0xc280('0x9')][_0xc280('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11cefd,_0x3be20a,_0x9d6c84){return new BPromise(function(_0x1ca851,_0x5d40e5){return client[_0xc280('0xb')](_0x11cefd,_0x9d6c84)['then'](function(_0x4d68a4){logger[_0xc280('0xc')](_0xc280('0xd'),_0x3be20a,_0xc280('0xe'));logger[_0xc280('0xf')](_0xc280('0x10'),_0x3be20a,_0xc280('0xe'),JSON[_0xc280('0x11')](_0x4d68a4));if(_0x4d68a4['error']){if(_0x4d68a4[_0xc280('0x12')][_0xc280('0x13')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3be20a,_0x4d68a4['error']['message']);return _0x5d40e5(_0x4d68a4[_0xc280('0x12')]['message']);}logger[_0xc280('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3be20a,_0x4d68a4['error'][_0xc280('0x14')]);return _0x1ca851(_0x4d68a4[_0xc280('0x12')][_0xc280('0x14')]);}else{logger[_0xc280('0xc')](_0xc280('0xd'),_0x3be20a,'request\x20sent');_0x1ca851(_0x4d68a4[_0xc280('0x15')][_0xc280('0x14')]);}})[_0xc280('0x16')](function(_0x5c0ee8){logger['error'](_0xc280('0xd'),_0x3be20a,_0x5c0ee8);_0x5d40e5(_0x5c0ee8);});});}exports['GetSugarcrmAccount']=function(_0x621f74){var _0x14a69e=this;return new Promise(function(_0x5289cd,_0x46b76b){return db[_0xc280('0x17')][_0xc280('0x18')]({'raw':_0x621f74['options']?_0x621f74[_0xc280('0x19')][_0xc280('0x1a')]===undefined?!![]:![]:!![],'where':_0x621f74[_0xc280('0x19')]?_0x621f74[_0xc280('0x19')][_0xc280('0x1b')]||null:null,'attributes':_0x621f74[_0xc280('0x19')]?_0x621f74['options']['attributes']||null:null,'limit':_0x621f74[_0xc280('0x19')]?_0x621f74[_0xc280('0x19')]['limit']||null:null,'include':_0x621f74[_0xc280('0x19')]?_0x621f74[_0xc280('0x19')][_0xc280('0x1c')]?_[_0xc280('0x1d')](_0x621f74['options']['include'],function(_0x50b0a5){return{'model':db[_0x50b0a5[_0xc280('0x1e')]],'as':_0x50b0a5['as'],'attributes':_0x50b0a5[_0xc280('0x1f')],'include':_0x50b0a5[_0xc280('0x1c')]?_[_0xc280('0x1d')](_0x50b0a5[_0xc280('0x1c')],function(_0x41f65e){return{'model':db[_0x41f65e[_0xc280('0x1e')]],'as':_0x41f65e['as'],'attributes':_0x41f65e[_0xc280('0x1f')],'include':_0x41f65e[_0xc280('0x1c')]?_['map'](_0x41f65e['include'],function(_0x1d7ee5){return{'model':db[_0x1d7ee5[_0xc280('0x1e')]],'as':_0x1d7ee5['as'],'attributes':_0x1d7ee5[_0xc280('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc280('0x20')](function(_0x147233){logger[_0xc280('0xc')](_0xc280('0x21'),_0x621f74);logger['debug'](_0xc280('0x21'),_0x621f74,JSON[_0xc280('0x11')](_0x147233));_0x5289cd(_0x147233);})['catch'](function(_0x4bbc96){logger[_0xc280('0x12')](_0xc280('0x21'),_0x4bbc96[_0xc280('0x14')],_0x621f74);_0x46b76b(_0x14a69e[_0xc280('0x12')](0x1f4,_0x4bbc96['message']));});});};exports[_0xc280('0x22')]=function(_0x437ce1){var _0x3448fb=this;return new Promise(function(_0x1f8293,_0x55f0aa){return db[_0xc280('0x17')][_0xc280('0x23')]({'raw':_0x437ce1['options']?_0x437ce1[_0xc280('0x19')][_0xc280('0x1a')]===undefined?!![]:![]:!![],'where':_0x437ce1[_0xc280('0x19')]?_0x437ce1[_0xc280('0x19')][_0xc280('0x1b')]||null:null,'attributes':_0x437ce1[_0xc280('0x19')]?_0x437ce1[_0xc280('0x19')][_0xc280('0x1f')]||null:null,'include':_0x437ce1['options']?_0x437ce1[_0xc280('0x19')][_0xc280('0x1c')]?_[_0xc280('0x1d')](_0x437ce1['options'][_0xc280('0x1c')],function(_0x1313f8){return{'model':db[_0x1313f8[_0xc280('0x1e')]],'as':_0x1313f8['as'],'attributes':_0x1313f8[_0xc280('0x1f')],'include':_0x1313f8[_0xc280('0x1c')]?_[_0xc280('0x1d')](_0x1313f8[_0xc280('0x1c')],function(_0x5f09b1){return{'model':db[_0x5f09b1[_0xc280('0x1e')]],'as':_0x5f09b1['as'],'attributes':_0x5f09b1[_0xc280('0x1f')],'include':_0x5f09b1[_0xc280('0x1c')]?_[_0xc280('0x1d')](_0x5f09b1[_0xc280('0x1c')],function(_0x979228){return{'model':db[_0x979228['model']],'as':_0x979228['as'],'attributes':_0x979228[_0xc280('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc280('0x20')](function(_0x36b183){logger['info'](_0xc280('0x22'),_0x437ce1);logger[_0xc280('0xf')](_0xc280('0x22'),_0x437ce1,JSON[_0xc280('0x11')](_0x36b183));_0x1f8293(_0x36b183);})[_0xc280('0x16')](function(_0xc00cb7){logger['error'](_0xc280('0x22'),_0xc00cb7[_0xc280('0x14')],_0x437ce1);_0x55f0aa(_0x3448fb[_0xc280('0x12')](0x1f4,_0xc00cb7[_0xc280('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ea2bf76..2992511 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 _0xb8a3=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','getDescriptions','post','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1bca2e,_0x2e5dbc){var _0x11ab8d=function(_0x3e40d4){while(--_0x3e40d4){_0x1bca2e['push'](_0x1bca2e['shift']());}};_0x11ab8d(++_0x2e5dbc);}(_0xb8a3,0x1da));var _0x3b8a=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0xb8a3[_0x5f519b];return _0x2461e2;};'use strict';var multer=require('multer');var util=require(_0x3b8a('0x0'));var path=require(_0x3b8a('0x1'));var timeout=require(_0x3b8a('0x2'));var express=require(_0x3b8a('0x3'));var router=express[_0x3b8a('0x4')]();var fs_extra=require(_0x3b8a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b8a('0x6'));var config=require(_0x3b8a('0x7'));var controller=require(_0x3b8a('0x8'));router[_0x3b8a('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b8a('0xa')]);router[_0x3b8a('0x9')](_0x3b8a('0xb'),auth[_0x3b8a('0xc')](),controller[_0x3b8a('0xd')]);router[_0x3b8a('0x9')]('/:id/fields',auth[_0x3b8a('0xc')](),controller[_0x3b8a('0xe')]);router[_0x3b8a('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x3b8a('0x9')]('/:id/descriptions',auth[_0x3b8a('0xc')](),controller[_0x3b8a('0xf')]);router[_0x3b8a('0x10')]('/',auth[_0x3b8a('0xc')](),controller['create']);router[_0x3b8a('0x11')](_0x3b8a('0xb'),auth[_0x3b8a('0xc')](),controller['update']);router[_0x3b8a('0x12')](_0x3b8a('0xb'),auth['isAuthenticated'](),controller[_0x3b8a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1027=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x1027,0xe7));var _0x7102=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x1027[_0x47adb8];return _0x4689a8;};'use strict';var multer=require(_0x7102('0x0'));var util=require(_0x7102('0x1'));var path=require('path');var timeout=require(_0x7102('0x2'));var express=require('express');var router=express[_0x7102('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7102('0x4'));var interaction=require(_0x7102('0x5'));var config=require('../../config/environment');var controller=require(_0x7102('0x6'));router['get']('/',auth[_0x7102('0x7')](),controller[_0x7102('0x8')]);router[_0x7102('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7102('0x9')](_0x7102('0xa'),auth[_0x7102('0x7')](),controller[_0x7102('0xb')]);router['get']('/:id/subjects',auth[_0x7102('0x7')](),controller[_0x7102('0xc')]);router[_0x7102('0x9')](_0x7102('0xd'),auth[_0x7102('0x7')](),controller[_0x7102('0xe')]);router[_0x7102('0xf')]('/',auth[_0x7102('0x7')](),controller[_0x7102('0x10')]);router[_0x7102('0x11')]('/:id',auth[_0x7102('0x7')](),controller[_0x7102('0x12')]);router[_0x7102('0x13')](_0x7102('0x14'),auth[_0x7102('0x7')](),controller[_0x7102('0x15')]);module[_0x7102('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 607036f..fa9cd7c 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 _0x0d3b=['exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0d3b,0x1b4));var _0xb0d3=function(_0x5a8bf0,_0x35158c){_0x5a8bf0=_0x5a8bf0-0x0;var _0x130671=_0x0d3b[_0x5a8bf0];return _0x130671;};'use strict';var Sequelize=require('sequelize');module[_0xb0d3('0x0')]={'name':{'type':Sequelize[_0xb0d3('0x1')]},'description':{'type':Sequelize[_0xb0d3('0x1')]}}; \ No newline at end of file +var _0x97d0=['STRING','sequelize','exports'];(function(_0x544362,_0xc31c04){var _0x5c12f9=function(_0x365c8b){while(--_0x365c8b){_0x544362['push'](_0x544362['shift']());}};_0x5c12f9(++_0xc31c04);}(_0x97d0,0x12a));var _0x097d=function(_0x5682dc,_0x2a2ef1){_0x5682dc=_0x5682dc-0x0;var _0x2197ea=_0x97d0[_0x5682dc];return _0x2197ea;};'use strict';var Sequelize=require(_0x097d('0x0'));module[_0x097d('0x1')]={'name':{'type':Sequelize[_0x097d('0x2')]},'description':{'type':Sequelize[_0x097d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2acd086..5a93b9b 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 _0xc7f6=['where','filters','pick','filter','VIRTUAL','merge','options','SugarcrmConfiguration','includeAll','include','findAll','catch','show','find','create','body','params','getFields','findOne','SugarcrmField','order','hasOwnProperty','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7f6,0xbf));var _0x6c7f=function(_0x372454,_0x971c08){_0x372454=_0x372454-0x0;var _0x4226f4=_0xc7f6[_0x372454];return _0x4226f4;};'use strict';var emlformat=require(_0x6c7f('0x0'));var rimraf=require(_0x6c7f('0x1'));var zipdir=require(_0x6c7f('0x2'));var jsonpatch=require(_0x6c7f('0x3'));var rp=require('request-promise');var moment=require(_0x6c7f('0x4'));var BPromise=require(_0x6c7f('0x5'));var Mustache=require(_0x6c7f('0x6'));var util=require(_0x6c7f('0x7'));var path=require('path');var sox=require(_0x6c7f('0x8'));var csv=require(_0x6c7f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c7f('0xa'));var _=require(_0x6c7f('0xb'));var squel=require(_0x6c7f('0xc'));var crypto=require('crypto');var jsforce=require(_0x6c7f('0xd'));var deskjs=require(_0x6c7f('0xe'));var toCsv=require(_0x6c7f('0x9'));var querystring=require(_0x6c7f('0xf'));var Papa=require(_0x6c7f('0x10'));var Redis=require(_0x6c7f('0x11'));var authService=require(_0x6c7f('0x12'));var qs=require(_0x6c7f('0x13'));var as=require(_0x6c7f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c7f('0x15'))(_0x6c7f('0x16'));var utils=require(_0x6c7f('0x17'));var config=require(_0x6c7f('0x18'));var licenseUtil=require(_0x6c7f('0x19'));var db=require(_0x6c7f('0x1a'))['db'];function respondWithStatusCode(_0x34ccc0,_0x219c02){_0x219c02=_0x219c02||0xcc;return function(_0x4868bb){if(_0x4868bb){return _0x34ccc0[_0x6c7f('0x1b')](_0x219c02);}return _0x34ccc0['status'](_0x219c02)[_0x6c7f('0x1c')]();};}function respondWithResult(_0x473fec,_0x308435){_0x308435=_0x308435||0xc8;return function(_0x3451a4){if(_0x3451a4){return _0x473fec[_0x6c7f('0x1d')](_0x308435)['json'](_0x3451a4);}};}function respondWithFilteredResult(_0x2e4b17,_0x44383b){return function(_0x16b062){if(_0x16b062){var _0x4bee85=typeof _0x44383b['offset']==='undefined'&&typeof _0x44383b[_0x6c7f('0x1e')]===_0x6c7f('0x1f');var _0x995903=_0x16b062[_0x6c7f('0x20')];var _0x44314d=_0x4bee85?0x0:_0x44383b[_0x6c7f('0x21')];var _0x134b07=_0x4bee85?_0x16b062[_0x6c7f('0x20')]:_0x44383b[_0x6c7f('0x21')]+_0x44383b['limit'];var _0x3fc1f9;if(_0x134b07>=_0x995903){_0x134b07=_0x995903;_0x3fc1f9=0xc8;}else{_0x3fc1f9=0xce;}_0x2e4b17['status'](_0x3fc1f9);return _0x2e4b17['set'](_0x6c7f('0x22'),_0x44314d+'-'+_0x134b07+'/'+_0x995903)['json'](_0x16b062);}return null;};}function patchUpdates(_0x360719){return function(_0x52388f){try{jsonpatch[_0x6c7f('0x23')](_0x52388f,_0x360719,!![]);}catch(_0x493a3){return BPromise[_0x6c7f('0x24')](_0x493a3);}return _0x52388f[_0x6c7f('0x25')]();};}function saveUpdates(_0x11b250,_0x399eae){return function(_0x126317){if(_0x126317){return _0x126317[_0x6c7f('0x26')](_0x11b250)[_0x6c7f('0x27')](function(_0x519828){return _0x519828;});}return null;};}function removeEntity(_0x82e8cf,_0x164dc4){return function(_0x3baa29){if(_0x3baa29){return _0x3baa29[_0x6c7f('0x28')]()['then'](function(){_0x82e8cf['status'](0xcc)[_0x6c7f('0x1c')]();});}};}function handleEntityNotFound(_0x3f334f,_0x318882){return function(_0x66e03b){if(!_0x66e03b){_0x3f334f[_0x6c7f('0x1b')](0x194);}return _0x66e03b;};}function handleError(_0x14c99d,_0x354f2f){_0x354f2f=_0x354f2f||0x1f4;return function(_0x492a06){logger[_0x6c7f('0x29')](_0x492a06[_0x6c7f('0x2a')]);if(_0x492a06[_0x6c7f('0x2b')]){delete _0x492a06[_0x6c7f('0x2b')];}_0x14c99d[_0x6c7f('0x1d')](_0x354f2f)[_0x6c7f('0x2c')](_0x492a06);};}exports[_0x6c7f('0x2d')]=function(_0x22a75f,_0x25a58){var _0x46c250={},_0x470a97={},_0x37069a={'count':0x0,'rows':[]};var _0x262deb=_[_0x6c7f('0x2e')](db['SugarcrmConfiguration'][_0x6c7f('0x2f')],function(_0x4ab72a){return{'name':_0x4ab72a['fieldName'],'type':_0x4ab72a[_0x6c7f('0x30')][_0x6c7f('0x31')]};});_0x470a97[_0x6c7f('0x32')]=_[_0x6c7f('0x2e')](_0x262deb,'name');_0x470a97[_0x6c7f('0x33')]=_[_0x6c7f('0x34')](_0x22a75f['query']);_0x470a97['filters']=_[_0x6c7f('0x35')](_0x470a97[_0x6c7f('0x32')],_0x470a97[_0x6c7f('0x33')]);_0x46c250[_0x6c7f('0x36')]=_[_0x6c7f('0x35')](_0x470a97['model'],qs['fields'](_0x22a75f[_0x6c7f('0x33')][_0x6c7f('0x37')]));_0x46c250[_0x6c7f('0x36')]=_0x46c250[_0x6c7f('0x36')][_0x6c7f('0x38')]?_0x46c250[_0x6c7f('0x36')]:_0x470a97[_0x6c7f('0x32')];if(!_0x22a75f[_0x6c7f('0x33')]['hasOwnProperty']('nolimit')){_0x46c250['limit']=qs[_0x6c7f('0x1e')](_0x22a75f[_0x6c7f('0x33')][_0x6c7f('0x1e')]);_0x46c250[_0x6c7f('0x21')]=qs[_0x6c7f('0x21')](_0x22a75f[_0x6c7f('0x33')][_0x6c7f('0x21')]);}_0x46c250['order']=qs['sort'](_0x22a75f['query'][_0x6c7f('0x39')]);_0x46c250[_0x6c7f('0x3a')]=qs[_0x6c7f('0x3b')](_[_0x6c7f('0x3c')](_0x22a75f[_0x6c7f('0x33')],_0x470a97['filters']),_0x262deb);if(_0x22a75f[_0x6c7f('0x33')][_0x6c7f('0x3d')]){_0x46c250[_0x6c7f('0x3a')]=_['merge'](_0x46c250[_0x6c7f('0x3a')],{'$or':_[_0x6c7f('0x2e')](_0x262deb,function(_0x1d1971){if(_0x1d1971['type']!==_0x6c7f('0x3e')){var _0x53520e={};_0x53520e[_0x1d1971[_0x6c7f('0x2b')]]={'$like':'%'+_0x22a75f[_0x6c7f('0x33')][_0x6c7f('0x3d')]+'%'};return _0x53520e;}})});}_0x46c250=_[_0x6c7f('0x3f')]({},_0x46c250,_0x22a75f[_0x6c7f('0x40')]);var _0x3bc054={'where':_0x46c250[_0x6c7f('0x3a')]};return db[_0x6c7f('0x41')]['count'](_0x3bc054)[_0x6c7f('0x27')](function(_0x31778d){_0x37069a[_0x6c7f('0x20')]=_0x31778d;if(_0x22a75f['query'][_0x6c7f('0x42')]){_0x46c250[_0x6c7f('0x43')]=[{'all':!![]}];}return db[_0x6c7f('0x41')][_0x6c7f('0x44')](_0x46c250);})[_0x6c7f('0x27')](function(_0x5d0045){_0x37069a['rows']=_0x5d0045;return _0x37069a;})[_0x6c7f('0x27')](respondWithFilteredResult(_0x25a58,_0x46c250))[_0x6c7f('0x45')](handleError(_0x25a58,null));};exports[_0x6c7f('0x46')]=function(_0x194bfe,_0x175681){var _0x1b792a={'raw':![],'where':{'id':_0x194bfe['params']['id']}},_0x39658f={};_0x39658f[_0x6c7f('0x32')]=_[_0x6c7f('0x34')](db['SugarcrmConfiguration'][_0x6c7f('0x2f')]);_0x39658f['query']=_['keys'](_0x194bfe[_0x6c7f('0x33')]);_0x39658f[_0x6c7f('0x3b')]=_[_0x6c7f('0x35')](_0x39658f[_0x6c7f('0x32')],_0x39658f[_0x6c7f('0x33')]);_0x1b792a[_0x6c7f('0x36')]=_[_0x6c7f('0x35')](_0x39658f[_0x6c7f('0x32')],qs[_0x6c7f('0x37')](_0x194bfe[_0x6c7f('0x33')][_0x6c7f('0x37')]));_0x1b792a[_0x6c7f('0x36')]=_0x1b792a[_0x6c7f('0x36')][_0x6c7f('0x38')]?_0x1b792a[_0x6c7f('0x36')]:_0x39658f[_0x6c7f('0x32')];if(_0x194bfe[_0x6c7f('0x33')][_0x6c7f('0x42')]){_0x1b792a[_0x6c7f('0x43')]=[{'all':!![]}];}_0x1b792a=_[_0x6c7f('0x3f')]({},_0x1b792a,_0x194bfe['options']);return db[_0x6c7f('0x41')][_0x6c7f('0x47')](_0x1b792a)[_0x6c7f('0x27')](handleEntityNotFound(_0x175681,null))[_0x6c7f('0x27')](respondWithResult(_0x175681,null))[_0x6c7f('0x45')](handleError(_0x175681,null));};exports['create']=function(_0x2d3af9,_0xf6ddd0){return db[_0x6c7f('0x41')][_0x6c7f('0x48')](_0x2d3af9['body'],{})[_0x6c7f('0x27')](respondWithResult(_0xf6ddd0,0xc9))['catch'](handleError(_0xf6ddd0,null));};exports[_0x6c7f('0x26')]=function(_0x30dce5,_0x5c3f12){if(_0x30dce5[_0x6c7f('0x49')]['id']){delete _0x30dce5[_0x6c7f('0x49')]['id'];}return db['SugarcrmConfiguration'][_0x6c7f('0x47')]({'where':{'id':_0x30dce5[_0x6c7f('0x4a')]['id']}})[_0x6c7f('0x27')](handleEntityNotFound(_0x5c3f12,null))[_0x6c7f('0x27')](saveUpdates(_0x30dce5['body'],null))[_0x6c7f('0x27')](respondWithResult(_0x5c3f12,null))[_0x6c7f('0x45')](handleError(_0x5c3f12,null));};exports[_0x6c7f('0x28')]=function(_0x32cc12,_0x4efd52){return db[_0x6c7f('0x41')][_0x6c7f('0x47')]({'where':{'id':_0x32cc12[_0x6c7f('0x4a')]['id']}})[_0x6c7f('0x27')](handleEntityNotFound(_0x4efd52,null))['then'](removeEntity(_0x4efd52,null))[_0x6c7f('0x45')](handleError(_0x4efd52,null));};exports[_0x6c7f('0x4b')]=function(_0xcc58ed,_0x14dfcc,_0x5e3ca4){var _0x27fa41={};var _0x3ea0e4={};var _0x1123a5;var _0xa81bf2;return db[_0x6c7f('0x41')][_0x6c7f('0x4c')]({'where':{'id':_0xcc58ed['params']['id']}})[_0x6c7f('0x27')](handleEntityNotFound(_0x14dfcc,null))['then'](function(_0x39fc01){if(_0x39fc01){_0x1123a5=_0x39fc01;_0x3ea0e4[_0x6c7f('0x32')]=_[_0x6c7f('0x34')](db[_0x6c7f('0x4d')][_0x6c7f('0x2f')]);_0x3ea0e4[_0x6c7f('0x33')]=_[_0x6c7f('0x34')](_0xcc58ed['query']);_0x3ea0e4[_0x6c7f('0x3b')]=_['intersection'](_0x3ea0e4[_0x6c7f('0x32')],_0x3ea0e4[_0x6c7f('0x33')]);_0x27fa41[_0x6c7f('0x36')]=_['intersection'](_0x3ea0e4[_0x6c7f('0x32')],qs['fields'](_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x37')]));_0x27fa41[_0x6c7f('0x36')]=_0x27fa41[_0x6c7f('0x36')]['length']?_0x27fa41[_0x6c7f('0x36')]:_0x3ea0e4[_0x6c7f('0x32')];_0x27fa41[_0x6c7f('0x4e')]=qs[_0x6c7f('0x39')](_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x39')]);_0x27fa41[_0x6c7f('0x3a')]=qs[_0x6c7f('0x3b')](_['pick'](_0xcc58ed[_0x6c7f('0x33')],_0x3ea0e4[_0x6c7f('0x3b')]));if(_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x3d')]){_0x27fa41['where']=_['merge'](_0x27fa41[_0x6c7f('0x3a')],{'$or':_[_0x6c7f('0x2e')](_0x27fa41[_0x6c7f('0x36')],function(_0x419b15){var _0x26f486={};_0x26f486[_0x419b15]={'$like':'%'+_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x3d')]+'%'};return _0x26f486;})});}_0x27fa41=_['merge']({},_0x27fa41,_0xcc58ed[_0x6c7f('0x40')]);return _0x1123a5[_0x6c7f('0x4b')](_0x27fa41);}})[_0x6c7f('0x27')](function(_0x489d6b){if(_0x489d6b){_0xa81bf2=_0x489d6b[_0x6c7f('0x38')];if(!_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x4f')]('nolimit')){_0x27fa41[_0x6c7f('0x1e')]=qs[_0x6c7f('0x1e')](_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x1e')]);_0x27fa41[_0x6c7f('0x21')]=qs['offset'](_0xcc58ed[_0x6c7f('0x33')][_0x6c7f('0x21')]);}return _0x1123a5['getFields'](_0x27fa41);}})[_0x6c7f('0x27')](function(_0x59450d){if(_0x59450d){return _0x59450d?{'count':_0xa81bf2,'rows':_0x59450d}:null;}})[_0x6c7f('0x27')](respondWithResult(_0x14dfcc,null))['catch'](handleError(_0x14dfcc,null));};exports[_0x6c7f('0x50')]=function(_0x1ecd6c,_0x17c4a5,_0x597d53){var _0x5b1533={};var _0x19ca0d={};var _0x464345;var _0x1c91bf;return db[_0x6c7f('0x41')][_0x6c7f('0x4c')]({'where':{'id':_0x1ecd6c[_0x6c7f('0x4a')]['id']}})[_0x6c7f('0x27')](handleEntityNotFound(_0x17c4a5,null))[_0x6c7f('0x27')](function(_0x116ae4){if(_0x116ae4){_0x464345=_0x116ae4;_0x19ca0d[_0x6c7f('0x32')]=_[_0x6c7f('0x34')](db['SugarcrmField'][_0x6c7f('0x2f')]);_0x19ca0d['query']=_['keys'](_0x1ecd6c[_0x6c7f('0x33')]);_0x19ca0d[_0x6c7f('0x3b')]=_[_0x6c7f('0x35')](_0x19ca0d[_0x6c7f('0x32')],_0x19ca0d[_0x6c7f('0x33')]);_0x5b1533[_0x6c7f('0x36')]=_[_0x6c7f('0x35')](_0x19ca0d[_0x6c7f('0x32')],qs[_0x6c7f('0x37')](_0x1ecd6c[_0x6c7f('0x33')][_0x6c7f('0x37')]));_0x5b1533[_0x6c7f('0x36')]=_0x5b1533[_0x6c7f('0x36')][_0x6c7f('0x38')]?_0x5b1533['attributes']:_0x19ca0d['model'];_0x5b1533[_0x6c7f('0x4e')]=qs[_0x6c7f('0x39')](_0x1ecd6c[_0x6c7f('0x33')][_0x6c7f('0x39')]);_0x5b1533[_0x6c7f('0x3a')]=qs[_0x6c7f('0x3b')](_[_0x6c7f('0x3c')](_0x1ecd6c[_0x6c7f('0x33')],_0x19ca0d[_0x6c7f('0x3b')]));if(_0x1ecd6c[_0x6c7f('0x33')]['filter']){_0x5b1533[_0x6c7f('0x3a')]=_['merge'](_0x5b1533[_0x6c7f('0x3a')],{'$or':_['map'](_0x5b1533[_0x6c7f('0x36')],function(_0x2b109c){var _0x22f72c={};_0x22f72c[_0x2b109c]={'$like':'%'+_0x1ecd6c[_0x6c7f('0x33')]['filter']+'%'};return _0x22f72c;})});}_0x5b1533=_[_0x6c7f('0x3f')]({},_0x5b1533,_0x1ecd6c[_0x6c7f('0x40')]);return _0x464345[_0x6c7f('0x50')](_0x5b1533);}})[_0x6c7f('0x27')](function(_0x2eefb7){if(_0x2eefb7){_0x1c91bf=_0x2eefb7[_0x6c7f('0x38')];if(!_0x1ecd6c[_0x6c7f('0x33')]['hasOwnProperty'](_0x6c7f('0x51'))){_0x5b1533['limit']=qs[_0x6c7f('0x1e')](_0x1ecd6c['query'][_0x6c7f('0x1e')]);_0x5b1533[_0x6c7f('0x21')]=qs[_0x6c7f('0x21')](_0x1ecd6c[_0x6c7f('0x33')][_0x6c7f('0x21')]);}return _0x464345[_0x6c7f('0x50')](_0x5b1533);}})[_0x6c7f('0x27')](function(_0x2e0b76){if(_0x2e0b76){return _0x2e0b76?{'count':_0x1c91bf,'rows':_0x2e0b76}:null;}})['then'](respondWithResult(_0x17c4a5,null))['catch'](handleError(_0x17c4a5,null));};exports[_0x6c7f('0x52')]=function(_0x3bc10c,_0x50e951,_0x331bbc){var _0x3afd20={};var _0xa42a6={};var _0x572f4d;var _0x437285;return db[_0x6c7f('0x41')][_0x6c7f('0x4c')]({'where':{'id':_0x3bc10c[_0x6c7f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50e951,null))['then'](function(_0x4d90b2){if(_0x4d90b2){_0x572f4d=_0x4d90b2;_0xa42a6[_0x6c7f('0x32')]=_[_0x6c7f('0x34')](db[_0x6c7f('0x4d')][_0x6c7f('0x2f')]);_0xa42a6['query']=_[_0x6c7f('0x34')](_0x3bc10c['query']);_0xa42a6[_0x6c7f('0x3b')]=_[_0x6c7f('0x35')](_0xa42a6['model'],_0xa42a6[_0x6c7f('0x33')]);_0x3afd20[_0x6c7f('0x36')]=_['intersection'](_0xa42a6[_0x6c7f('0x32')],qs[_0x6c7f('0x37')](_0x3bc10c[_0x6c7f('0x33')][_0x6c7f('0x37')]));_0x3afd20[_0x6c7f('0x36')]=_0x3afd20[_0x6c7f('0x36')][_0x6c7f('0x38')]?_0x3afd20['attributes']:_0xa42a6[_0x6c7f('0x32')];_0x3afd20[_0x6c7f('0x4e')]=qs[_0x6c7f('0x39')](_0x3bc10c['query'][_0x6c7f('0x39')]);_0x3afd20[_0x6c7f('0x3a')]=qs[_0x6c7f('0x3b')](_[_0x6c7f('0x3c')](_0x3bc10c[_0x6c7f('0x33')],_0xa42a6[_0x6c7f('0x3b')]));if(_0x3bc10c[_0x6c7f('0x33')][_0x6c7f('0x3d')]){_0x3afd20[_0x6c7f('0x3a')]=_[_0x6c7f('0x3f')](_0x3afd20['where'],{'$or':_[_0x6c7f('0x2e')](_0x3afd20['attributes'],function(_0x219b7b){var _0x21af79={};_0x21af79[_0x219b7b]={'$like':'%'+_0x3bc10c['query'][_0x6c7f('0x3d')]+'%'};return _0x21af79;})});}_0x3afd20=_[_0x6c7f('0x3f')]({},_0x3afd20,_0x3bc10c[_0x6c7f('0x40')]);return _0x572f4d[_0x6c7f('0x52')](_0x3afd20);}})['then'](function(_0x53b242){if(_0x53b242){_0x437285=_0x53b242['length'];if(!_0x3bc10c['query'][_0x6c7f('0x4f')]('nolimit')){_0x3afd20[_0x6c7f('0x1e')]=qs[_0x6c7f('0x1e')](_0x3bc10c['query'][_0x6c7f('0x1e')]);_0x3afd20['offset']=qs[_0x6c7f('0x21')](_0x3bc10c[_0x6c7f('0x33')][_0x6c7f('0x21')]);}return _0x572f4d[_0x6c7f('0x52')](_0x3afd20);}})['then'](function(_0x5ab0c1){if(_0x5ab0c1){return _0x5ab0c1?{'count':_0x437285,'rows':_0x5ab0c1}:null;}})[_0x6c7f('0x27')](respondWithResult(_0x50e951,null))[_0x6c7f('0x45')](handleError(_0x50e951,null));}; \ No newline at end of file +var _0xedc3=['intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','destroy','findOne','getFields','getSubjects','SugarcrmField','order','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','model','query','attributes'];(function(_0x1aa59b,_0x26612c){var _0x33011c=function(_0x29d625){while(--_0x29d625){_0x1aa59b['push'](_0x1aa59b['shift']());}};_0x33011c(++_0x26612c);}(_0xedc3,0x19c));var _0x3edc=function(_0x1e5d90,_0x4577cc){_0x1e5d90=_0x1e5d90-0x0;var _0x2af2e6=_0xedc3[_0x1e5d90];return _0x2af2e6;};'use strict';var emlformat=require(_0x3edc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3edc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3edc('0x2'));var moment=require('moment');var BPromise=require(_0x3edc('0x3'));var Mustache=require(_0x3edc('0x4'));var util=require(_0x3edc('0x5'));var path=require(_0x3edc('0x6'));var sox=require(_0x3edc('0x7'));var csv=require(_0x3edc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3edc('0x9'));var crypto=require(_0x3edc('0xa'));var jsforce=require(_0x3edc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3edc('0x8'));var querystring=require(_0x3edc('0xc'));var Papa=require(_0x3edc('0xd'));var Redis=require(_0x3edc('0xe'));var authService=require(_0x3edc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3edc('0x10'));var logger=require(_0x3edc('0x11'))(_0x3edc('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3edc('0x13'));var db=require(_0x3edc('0x14'))['db'];function respondWithStatusCode(_0x6d742d,_0x466172){_0x466172=_0x466172||0xcc;return function(_0x5e041d){if(_0x5e041d){return _0x6d742d[_0x3edc('0x15')](_0x466172);}return _0x6d742d[_0x3edc('0x16')](_0x466172)[_0x3edc('0x17')]();};}function respondWithResult(_0x164a19,_0x34b0a2){_0x34b0a2=_0x34b0a2||0xc8;return function(_0x1a82ff){if(_0x1a82ff){return _0x164a19[_0x3edc('0x16')](_0x34b0a2)[_0x3edc('0x18')](_0x1a82ff);}};}function respondWithFilteredResult(_0x4ec952,_0x24fea0){return function(_0x48afe9){if(_0x48afe9){var _0x1a9905=typeof _0x24fea0[_0x3edc('0x19')]===_0x3edc('0x1a')&&typeof _0x24fea0[_0x3edc('0x1b')]===_0x3edc('0x1a');var _0x4a4a8c=_0x48afe9['count'];var _0x3bd5a7=_0x1a9905?0x0:_0x24fea0['offset'];var _0x4c1afc=_0x1a9905?_0x48afe9[_0x3edc('0x1c')]:_0x24fea0[_0x3edc('0x19')]+_0x24fea0[_0x3edc('0x1b')];var _0x17d8b7;if(_0x4c1afc>=_0x4a4a8c){_0x4c1afc=_0x4a4a8c;_0x17d8b7=0xc8;}else{_0x17d8b7=0xce;}_0x4ec952[_0x3edc('0x16')](_0x17d8b7);return _0x4ec952[_0x3edc('0x1d')](_0x3edc('0x1e'),_0x3bd5a7+'-'+_0x4c1afc+'/'+_0x4a4a8c)[_0x3edc('0x18')](_0x48afe9);}return null;};}function patchUpdates(_0x563f21){return function(_0x1dc7a0){try{jsonpatch['apply'](_0x1dc7a0,_0x563f21,!![]);}catch(_0x230cf2){return BPromise['reject'](_0x230cf2);}return _0x1dc7a0['save']();};}function saveUpdates(_0x11ed76,_0x5beda1){return function(_0x4e03b0){if(_0x4e03b0){return _0x4e03b0[_0x3edc('0x1f')](_0x11ed76)['then'](function(_0x1d7bce){return _0x1d7bce;});}return null;};}function removeEntity(_0x1fabd6,_0x259e71){return function(_0x33231b){if(_0x33231b){return _0x33231b['destroy']()[_0x3edc('0x20')](function(){_0x1fabd6[_0x3edc('0x16')](0xcc)[_0x3edc('0x17')]();});}};}function handleEntityNotFound(_0x5aa1b6,_0x20329c){return function(_0x44d53f){if(!_0x44d53f){_0x5aa1b6[_0x3edc('0x15')](0x194);}return _0x44d53f;};}function handleError(_0x3b6daa,_0x4edd47){_0x4edd47=_0x4edd47||0x1f4;return function(_0x47a824){logger[_0x3edc('0x21')](_0x47a824[_0x3edc('0x22')]);if(_0x47a824[_0x3edc('0x23')]){delete _0x47a824['name'];}_0x3b6daa[_0x3edc('0x16')](_0x4edd47)[_0x3edc('0x24')](_0x47a824);};}exports[_0x3edc('0x25')]=function(_0xa38dd8,_0x9c2d67){var _0x1d8f0a={},_0x5c3d4d={},_0x48b5a7={'count':0x0,'rows':[]};var _0x4ab808=_['map'](db[_0x3edc('0x26')][_0x3edc('0x27')],function(_0x5788fa){return{'name':_0x5788fa[_0x3edc('0x28')],'type':_0x5788fa['type']['key']};});_0x5c3d4d[_0x3edc('0x29')]=_['map'](_0x4ab808,'name');_0x5c3d4d[_0x3edc('0x2a')]=_['keys'](_0xa38dd8[_0x3edc('0x2a')]);_0x5c3d4d['filters']=_['intersection'](_0x5c3d4d[_0x3edc('0x29')],_0x5c3d4d[_0x3edc('0x2a')]);_0x1d8f0a[_0x3edc('0x2b')]=_[_0x3edc('0x2c')](_0x5c3d4d[_0x3edc('0x29')],qs[_0x3edc('0x2d')](_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x2d')]));_0x1d8f0a['attributes']=_0x1d8f0a['attributes']['length']?_0x1d8f0a['attributes']:_0x5c3d4d[_0x3edc('0x29')];if(!_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x2e')](_0x3edc('0x2f'))){_0x1d8f0a[_0x3edc('0x1b')]=qs[_0x3edc('0x1b')](_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x1b')]);_0x1d8f0a['offset']=qs['offset'](_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x19')]);}_0x1d8f0a['order']=qs[_0x3edc('0x30')](_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x30')]);_0x1d8f0a[_0x3edc('0x31')]=qs[_0x3edc('0x32')](_[_0x3edc('0x33')](_0xa38dd8[_0x3edc('0x2a')],_0x5c3d4d[_0x3edc('0x32')]),_0x4ab808);if(_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x34')]){_0x1d8f0a[_0x3edc('0x31')]=_['merge'](_0x1d8f0a['where'],{'$or':_[_0x3edc('0x35')](_0x4ab808,function(_0x5f2e27){if(_0x5f2e27[_0x3edc('0x36')]!==_0x3edc('0x37')){var _0xaf1214={};_0xaf1214[_0x5f2e27[_0x3edc('0x23')]]={'$like':'%'+_0xa38dd8[_0x3edc('0x2a')][_0x3edc('0x34')]+'%'};return _0xaf1214;}})});}_0x1d8f0a=_[_0x3edc('0x38')]({},_0x1d8f0a,_0xa38dd8[_0x3edc('0x39')]);var _0xdafa5b={'where':_0x1d8f0a[_0x3edc('0x31')]};return db['SugarcrmConfiguration'][_0x3edc('0x1c')](_0xdafa5b)[_0x3edc('0x20')](function(_0x69fa7d){_0x48b5a7[_0x3edc('0x1c')]=_0x69fa7d;if(_0xa38dd8[_0x3edc('0x2a')]['includeAll']){_0x1d8f0a[_0x3edc('0x3a')]=[{'all':!![]}];}return db[_0x3edc('0x26')][_0x3edc('0x3b')](_0x1d8f0a);})[_0x3edc('0x20')](function(_0x1ff190){_0x48b5a7['rows']=_0x1ff190;return _0x48b5a7;})[_0x3edc('0x20')](respondWithFilteredResult(_0x9c2d67,_0x1d8f0a))[_0x3edc('0x3c')](handleError(_0x9c2d67,null));};exports[_0x3edc('0x3d')]=function(_0x148a37,_0x758e6b){var _0x3536cf={'raw':![],'where':{'id':_0x148a37[_0x3edc('0x3e')]['id']}},_0x2332ad={};_0x2332ad['model']=_['keys'](db[_0x3edc('0x26')][_0x3edc('0x27')]);_0x2332ad[_0x3edc('0x2a')]=_[_0x3edc('0x3f')](_0x148a37[_0x3edc('0x2a')]);_0x2332ad[_0x3edc('0x32')]=_[_0x3edc('0x2c')](_0x2332ad[_0x3edc('0x29')],_0x2332ad['query']);_0x3536cf[_0x3edc('0x2b')]=_['intersection'](_0x2332ad[_0x3edc('0x29')],qs[_0x3edc('0x2d')](_0x148a37[_0x3edc('0x2a')][_0x3edc('0x2d')]));_0x3536cf[_0x3edc('0x2b')]=_0x3536cf[_0x3edc('0x2b')][_0x3edc('0x40')]?_0x3536cf[_0x3edc('0x2b')]:_0x2332ad['model'];if(_0x148a37[_0x3edc('0x2a')][_0x3edc('0x41')]){_0x3536cf[_0x3edc('0x3a')]=[{'all':!![]}];}_0x3536cf=_['merge']({},_0x3536cf,_0x148a37['options']);return db[_0x3edc('0x26')][_0x3edc('0x42')](_0x3536cf)[_0x3edc('0x20')](handleEntityNotFound(_0x758e6b,null))[_0x3edc('0x20')](respondWithResult(_0x758e6b,null))[_0x3edc('0x3c')](handleError(_0x758e6b,null));};exports[_0x3edc('0x43')]=function(_0x1adf55,_0x26c2b6){return db[_0x3edc('0x26')][_0x3edc('0x43')](_0x1adf55['body'],{})[_0x3edc('0x20')](respondWithResult(_0x26c2b6,0xc9))['catch'](handleError(_0x26c2b6,null));};exports[_0x3edc('0x1f')]=function(_0x42b641,_0x1c134f){if(_0x42b641[_0x3edc('0x44')]['id']){delete _0x42b641[_0x3edc('0x44')]['id'];}return db[_0x3edc('0x26')][_0x3edc('0x42')]({'where':{'id':_0x42b641[_0x3edc('0x3e')]['id']}})[_0x3edc('0x20')](handleEntityNotFound(_0x1c134f,null))['then'](saveUpdates(_0x42b641[_0x3edc('0x44')],null))['then'](respondWithResult(_0x1c134f,null))[_0x3edc('0x3c')](handleError(_0x1c134f,null));};exports[_0x3edc('0x45')]=function(_0x2e467a,_0x55aed9){return db[_0x3edc('0x26')]['find']({'where':{'id':_0x2e467a[_0x3edc('0x3e')]['id']}})[_0x3edc('0x20')](handleEntityNotFound(_0x55aed9,null))['then'](removeEntity(_0x55aed9,null))[_0x3edc('0x3c')](handleError(_0x55aed9,null));};exports['getFields']=function(_0x53b9fe,_0xb9875b,_0x3dee72){var _0x3441ba={};var _0x27bfea={};var _0xea0caa;var _0x4f236f;return db[_0x3edc('0x26')][_0x3edc('0x46')]({'where':{'id':_0x53b9fe[_0x3edc('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb9875b,null))['then'](function(_0x81a9d7){if(_0x81a9d7){_0xea0caa=_0x81a9d7;_0x27bfea[_0x3edc('0x29')]=_[_0x3edc('0x3f')](db['SugarcrmField'][_0x3edc('0x27')]);_0x27bfea['query']=_[_0x3edc('0x3f')](_0x53b9fe[_0x3edc('0x2a')]);_0x27bfea['filters']=_[_0x3edc('0x2c')](_0x27bfea['model'],_0x27bfea[_0x3edc('0x2a')]);_0x3441ba[_0x3edc('0x2b')]=_[_0x3edc('0x2c')](_0x27bfea[_0x3edc('0x29')],qs[_0x3edc('0x2d')](_0x53b9fe[_0x3edc('0x2a')][_0x3edc('0x2d')]));_0x3441ba[_0x3edc('0x2b')]=_0x3441ba['attributes'][_0x3edc('0x40')]?_0x3441ba['attributes']:_0x27bfea['model'];_0x3441ba['order']=qs[_0x3edc('0x30')](_0x53b9fe[_0x3edc('0x2a')]['sort']);_0x3441ba[_0x3edc('0x31')]=qs[_0x3edc('0x32')](_['pick'](_0x53b9fe[_0x3edc('0x2a')],_0x27bfea[_0x3edc('0x32')]));if(_0x53b9fe[_0x3edc('0x2a')][_0x3edc('0x34')]){_0x3441ba[_0x3edc('0x31')]=_[_0x3edc('0x38')](_0x3441ba[_0x3edc('0x31')],{'$or':_[_0x3edc('0x35')](_0x3441ba[_0x3edc('0x2b')],function(_0x48356e){var _0x5f199f={};_0x5f199f[_0x48356e]={'$like':'%'+_0x53b9fe[_0x3edc('0x2a')]['filter']+'%'};return _0x5f199f;})});}_0x3441ba=_[_0x3edc('0x38')]({},_0x3441ba,_0x53b9fe[_0x3edc('0x39')]);return _0xea0caa['getFields'](_0x3441ba);}})[_0x3edc('0x20')](function(_0x1c1a90){if(_0x1c1a90){_0x4f236f=_0x1c1a90[_0x3edc('0x40')];if(!_0x53b9fe[_0x3edc('0x2a')][_0x3edc('0x2e')](_0x3edc('0x2f'))){_0x3441ba[_0x3edc('0x1b')]=qs[_0x3edc('0x1b')](_0x53b9fe[_0x3edc('0x2a')][_0x3edc('0x1b')]);_0x3441ba['offset']=qs[_0x3edc('0x19')](_0x53b9fe['query'][_0x3edc('0x19')]);}return _0xea0caa[_0x3edc('0x47')](_0x3441ba);}})[_0x3edc('0x20')](function(_0x497226){if(_0x497226){return _0x497226?{'count':_0x4f236f,'rows':_0x497226}:null;}})['then'](respondWithResult(_0xb9875b,null))[_0x3edc('0x3c')](handleError(_0xb9875b,null));};exports[_0x3edc('0x48')]=function(_0x4d1fac,_0x348cb7,_0xdb5d3){var _0x8d3eb8={};var _0xf48ded={};var _0x2b4afa;var _0x3e2b9d;return db['SugarcrmConfiguration'][_0x3edc('0x46')]({'where':{'id':_0x4d1fac['params']['id']}})[_0x3edc('0x20')](handleEntityNotFound(_0x348cb7,null))[_0x3edc('0x20')](function(_0x3e623d){if(_0x3e623d){_0x2b4afa=_0x3e623d;_0xf48ded[_0x3edc('0x29')]=_[_0x3edc('0x3f')](db[_0x3edc('0x49')][_0x3edc('0x27')]);_0xf48ded[_0x3edc('0x2a')]=_[_0x3edc('0x3f')](_0x4d1fac[_0x3edc('0x2a')]);_0xf48ded[_0x3edc('0x32')]=_[_0x3edc('0x2c')](_0xf48ded[_0x3edc('0x29')],_0xf48ded['query']);_0x8d3eb8[_0x3edc('0x2b')]=_[_0x3edc('0x2c')](_0xf48ded[_0x3edc('0x29')],qs[_0x3edc('0x2d')](_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x2d')]));_0x8d3eb8['attributes']=_0x8d3eb8[_0x3edc('0x2b')][_0x3edc('0x40')]?_0x8d3eb8[_0x3edc('0x2b')]:_0xf48ded['model'];_0x8d3eb8[_0x3edc('0x4a')]=qs['sort'](_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x30')]);_0x8d3eb8[_0x3edc('0x31')]=qs[_0x3edc('0x32')](_[_0x3edc('0x33')](_0x4d1fac[_0x3edc('0x2a')],_0xf48ded['filters']));if(_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x34')]){_0x8d3eb8[_0x3edc('0x31')]=_[_0x3edc('0x38')](_0x8d3eb8[_0x3edc('0x31')],{'$or':_[_0x3edc('0x35')](_0x8d3eb8['attributes'],function(_0x5452d9){var _0x34e09b={};_0x34e09b[_0x5452d9]={'$like':'%'+_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x34')]+'%'};return _0x34e09b;})});}_0x8d3eb8=_['merge']({},_0x8d3eb8,_0x4d1fac[_0x3edc('0x39')]);return _0x2b4afa[_0x3edc('0x48')](_0x8d3eb8);}})[_0x3edc('0x20')](function(_0xbbc487){if(_0xbbc487){_0x3e2b9d=_0xbbc487[_0x3edc('0x40')];if(!_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x2e')](_0x3edc('0x2f'))){_0x8d3eb8[_0x3edc('0x1b')]=qs['limit'](_0x4d1fac[_0x3edc('0x2a')][_0x3edc('0x1b')]);_0x8d3eb8[_0x3edc('0x19')]=qs[_0x3edc('0x19')](_0x4d1fac['query'][_0x3edc('0x19')]);}return _0x2b4afa['getSubjects'](_0x8d3eb8);}})[_0x3edc('0x20')](function(_0x408f36){if(_0x408f36){return _0x408f36?{'count':_0x3e2b9d,'rows':_0x408f36}:null;}})[_0x3edc('0x20')](respondWithResult(_0x348cb7,null))[_0x3edc('0x3c')](handleError(_0x348cb7,null));};exports[_0x3edc('0x4b')]=function(_0x53fe33,_0x5c4596,_0x581268){var _0x39dc09={};var _0x4e024c={};var _0x355bd2;var _0x16280c;return db[_0x3edc('0x26')][_0x3edc('0x46')]({'where':{'id':_0x53fe33['params']['id']}})[_0x3edc('0x20')](handleEntityNotFound(_0x5c4596,null))['then'](function(_0x1e0086){if(_0x1e0086){_0x355bd2=_0x1e0086;_0x4e024c[_0x3edc('0x29')]=_['keys'](db['SugarcrmField'][_0x3edc('0x27')]);_0x4e024c[_0x3edc('0x2a')]=_[_0x3edc('0x3f')](_0x53fe33['query']);_0x4e024c['filters']=_[_0x3edc('0x2c')](_0x4e024c['model'],_0x4e024c[_0x3edc('0x2a')]);_0x39dc09[_0x3edc('0x2b')]=_[_0x3edc('0x2c')](_0x4e024c[_0x3edc('0x29')],qs['fields'](_0x53fe33[_0x3edc('0x2a')][_0x3edc('0x2d')]));_0x39dc09[_0x3edc('0x2b')]=_0x39dc09[_0x3edc('0x2b')][_0x3edc('0x40')]?_0x39dc09[_0x3edc('0x2b')]:_0x4e024c[_0x3edc('0x29')];_0x39dc09[_0x3edc('0x4a')]=qs[_0x3edc('0x30')](_0x53fe33[_0x3edc('0x2a')][_0x3edc('0x30')]);_0x39dc09[_0x3edc('0x31')]=qs[_0x3edc('0x32')](_[_0x3edc('0x33')](_0x53fe33['query'],_0x4e024c[_0x3edc('0x32')]));if(_0x53fe33[_0x3edc('0x2a')][_0x3edc('0x34')]){_0x39dc09[_0x3edc('0x31')]=_[_0x3edc('0x38')](_0x39dc09[_0x3edc('0x31')],{'$or':_[_0x3edc('0x35')](_0x39dc09[_0x3edc('0x2b')],function(_0x245e1e){var _0x37dcdc={};_0x37dcdc[_0x245e1e]={'$like':'%'+_0x53fe33[_0x3edc('0x2a')][_0x3edc('0x34')]+'%'};return _0x37dcdc;})});}_0x39dc09=_[_0x3edc('0x38')]({},_0x39dc09,_0x53fe33['options']);return _0x355bd2['getDescriptions'](_0x39dc09);}})[_0x3edc('0x20')](function(_0x9ff076){if(_0x9ff076){_0x16280c=_0x9ff076[_0x3edc('0x40')];if(!_0x53fe33[_0x3edc('0x2a')]['hasOwnProperty'](_0x3edc('0x2f'))){_0x39dc09['limit']=qs[_0x3edc('0x1b')](_0x53fe33['query']['limit']);_0x39dc09[_0x3edc('0x19')]=qs[_0x3edc('0x19')](_0x53fe33[_0x3edc('0x2a')][_0x3edc('0x19')]);}return _0x355bd2['getDescriptions'](_0x39dc09);}})['then'](function(_0x569d30){if(_0x569d30){return _0x569d30?{'count':_0x16280c,'rows':_0x569d30}:null;}})[_0x3edc('0x20')](respondWithResult(_0x5c4596,null))[_0x3edc('0x3c')](handleError(_0x5c4596,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 990fd86..e8365a2 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 _0x6498=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x224b7e,_0x531cda){var _0x4ab022=function(_0x5d79dd){while(--_0x5d79dd){_0x224b7e['push'](_0x224b7e['shift']());}};_0x4ab022(++_0x531cda);}(_0x6498,0x165));var _0x8649=function(_0x591565,_0x5371f8){_0x591565=_0x591565-0x0;var _0x17666b=_0x6498[_0x591565];return _0x17666b;};'use strict';var _=require(_0x8649('0x0'));var util=require(_0x8649('0x1'));var logger=require('../../config/logger')(_0x8649('0x2'));var moment=require(_0x8649('0x3'));var BPromise=require(_0x8649('0x4'));var rp=require(_0x8649('0x5'));var fs=require('fs');var path=require(_0x8649('0x6'));var rimraf=require(_0x8649('0x7'));var config=require(_0x8649('0x8'));var attributes=require(_0x8649('0x9'));module[_0x8649('0xa')]=function(_0x4404be,_0x22002f){return _0x4404be[_0x8649('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x8649('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e9e=['api','moment','bluebird','path','rimraf','../../config/environment','exports','SugarcrmConfiguration','util','../../config/logger'];(function(_0x5aa39b,_0x56742e){var _0x138b6a=function(_0x525e32){while(--_0x525e32){_0x5aa39b['push'](_0x5aa39b['shift']());}};_0x138b6a(++_0x56742e);}(_0x4e9e,0x1ca));var _0xe4e9=function(_0x5d7ff4,_0x1384c1){_0x5d7ff4=_0x5d7ff4-0x0;var _0x3edd41=_0x4e9e[_0x5d7ff4];return _0x3edd41;};'use strict';var _=require('lodash');var util=require(_0xe4e9('0x0'));var logger=require(_0xe4e9('0x1'))(_0xe4e9('0x2'));var moment=require(_0xe4e9('0x3'));var BPromise=require(_0xe4e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4e9('0x5'));var rimraf=require(_0xe4e9('0x6'));var config=require(_0xe4e9('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xe4e9('0x8')]=function(_0x565d40,_0x1f5d0a){return _0x565d40['define'](_0xe4e9('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 051edc9..44ca3c1 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 _0xa5e8=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0xa5e8,0x10c));var _0x8a5e=function(_0x14fe3e,_0x111552){_0x14fe3e=_0x14fe3e-0x0;var _0x49dc1e=_0xa5e8[_0x14fe3e];return _0x49dc1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a5e('0x0'));var BPromise=require(_0x8a5e('0x1'));var rs=require(_0x8a5e('0x2'));var fs=require('fs');var Redis=require(_0x8a5e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a5e('0x4'));var logger=require(_0x8a5e('0x5'))('rpc');var config=require(_0x8a5e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8a5e('0x7')][_0x8a5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3281a0,_0x2818fc,_0x59db99){return new BPromise(function(_0x1b9309,_0x423bb6){return client['request'](_0x3281a0,_0x59db99)['then'](function(_0x870e0e){logger[_0x8a5e('0x9')](_0x8a5e('0xa'),_0x2818fc,_0x8a5e('0xb'));logger[_0x8a5e('0xc')](_0x8a5e('0xd'),_0x2818fc,_0x8a5e('0xb'),JSON[_0x8a5e('0xe')](_0x870e0e));if(_0x870e0e['error']){if(_0x870e0e[_0x8a5e('0xf')][_0x8a5e('0x10')]===0x1f4){logger[_0x8a5e('0xf')](_0x8a5e('0xa'),_0x2818fc,_0x870e0e[_0x8a5e('0xf')][_0x8a5e('0x11')]);return _0x423bb6(_0x870e0e['error'][_0x8a5e('0x11')]);}logger['error'](_0x8a5e('0xa'),_0x2818fc,_0x870e0e[_0x8a5e('0xf')][_0x8a5e('0x11')]);return _0x1b9309(_0x870e0e['error'][_0x8a5e('0x11')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2818fc,_0x8a5e('0xb'));_0x1b9309(_0x870e0e[_0x8a5e('0x12')]['message']);}})[_0x8a5e('0x13')](function(_0x3319bf){logger['error'](_0x8a5e('0xa'),_0x2818fc,_0x3319bf);_0x423bb6(_0x3319bf);});});} \ No newline at end of file +var _0x536e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x1cab10,_0x1ca0d8){var _0x55a91e=function(_0x423845){while(--_0x423845){_0x1cab10['push'](_0x1cab10['shift']());}};_0x55a91e(++_0x1ca0d8);}(_0x536e,0x1cb));var _0xe536=function(_0x4e6eac,_0x3f4365){_0x4e6eac=_0x4e6eac-0x0;var _0x79f963=_0x536e[_0x4e6eac];return _0x79f963;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var moment=require(_0xe536('0x2'));var BPromise=require('bluebird');var rs=require(_0xe536('0x3'));var fs=require('fs');var Redis=require(_0xe536('0x4'));var db=require(_0xe536('0x5'))['db'];var utils=require(_0xe536('0x6'));var logger=require(_0xe536('0x7'))(_0xe536('0x8'));var config=require(_0xe536('0x9'));var jayson=require(_0xe536('0xa'));var client=jayson['client'][_0xe536('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x277c0a,_0x40f6b9,_0x1f80f3){return new BPromise(function(_0x17635a,_0x141495){return client['request'](_0x277c0a,_0x1f80f3)[_0xe536('0xc')](function(_0x1909c0){logger[_0xe536('0xd')](_0xe536('0xe'),_0x40f6b9,_0xe536('0xf'));logger['debug'](_0xe536('0x10'),_0x40f6b9,_0xe536('0xf'),JSON[_0xe536('0x11')](_0x1909c0));if(_0x1909c0['error']){if(_0x1909c0[_0xe536('0x12')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x40f6b9,_0x1909c0['error']['message']);return _0x141495(_0x1909c0['error'][_0xe536('0x13')]);}logger[_0xe536('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x40f6b9,_0x1909c0[_0xe536('0x12')][_0xe536('0x13')]);return _0x17635a(_0x1909c0[_0xe536('0x12')][_0xe536('0x13')]);}else{logger[_0xe536('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x40f6b9,_0xe536('0xf'));_0x17635a(_0x1909c0[_0xe536('0x14')][_0xe536('0x13')]);}})['catch'](function(_0x37f5b2){logger[_0xe536('0x12')](_0xe536('0xe'),_0x40f6b9,_0x37f5b2);_0x141495(_0x37f5b2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6a3fbab..a15448e 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 _0x78aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','delete','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x9046bc,_0x2204f7){var _0x37bec6=function(_0x4b73ac){while(--_0x4b73ac){_0x9046bc['push'](_0x9046bc['shift']());}};_0x37bec6(++_0x2204f7);}(_0x78aa,0x174));var _0xa78a=function(_0x36df85,_0x29087b){_0x36df85=_0x36df85-0x0;var _0x5baa98=_0x78aa[_0x36df85];return _0x5baa98;};'use strict';var multer=require('multer');var util=require(_0xa78a('0x0'));var path=require(_0xa78a('0x1'));var timeout=require(_0xa78a('0x2'));var express=require(_0xa78a('0x3'));var router=express[_0xa78a('0x4')]();var fs_extra=require(_0xa78a('0x5'));var auth=require(_0xa78a('0x6'));var interaction=require(_0xa78a('0x7'));var config=require(_0xa78a('0x8'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xa78a('0x9')](),controller[_0xa78a('0xa')]);router[_0xa78a('0xb')](_0xa78a('0xc'),auth[_0xa78a('0x9')](),controller[_0xa78a('0xd')]);router[_0xa78a('0xe')]('/',auth[_0xa78a('0x9')](),controller[_0xa78a('0xf')]);router['put'](_0xa78a('0xc'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x10')]);router[_0xa78a('0x11')](_0xa78a('0xc'),auth[_0xa78a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe045=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy'];(function(_0x5de3bd,_0x482f04){var _0x3d672b=function(_0x5e51ed){while(--_0x5e51ed){_0x5de3bd['push'](_0x5de3bd['shift']());}};_0x3d672b(++_0x482f04);}(_0xe045,0x78));var _0x5e04=function(_0x51961a,_0x2c4b18){_0x51961a=_0x51961a-0x0;var _0xe5722d=_0xe045[_0x51961a];return _0xe5722d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e04('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e04('0x1')]();var fs_extra=require(_0x5e04('0x2'));var auth=require(_0x5e04('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5e04('0x4'));var controller=require(_0x5e04('0x5'));router[_0x5e04('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e04('0x6')]('/:id',auth[_0x5e04('0x7')](),controller['show']);router[_0x5e04('0x8')]('/',auth[_0x5e04('0x7')](),controller[_0x5e04('0x9')]);router[_0x5e04('0xa')]('/:id',auth[_0x5e04('0x7')](),controller[_0x5e04('0xb')]);router[_0x5e04('0xc')](_0x5e04('0xd'),auth[_0x5e04('0x7')](),controller[_0x5e04('0xe')]);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 df306bd..505669f 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 _0x5c02=['keyValue','STRING','variable','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0xa3a9f4,_0x408b9d){var _0x428841=function(_0x5e0b22){while(--_0x5e0b22){_0xa3a9f4['push'](_0xa3a9f4['shift']());}};_0x428841(++_0x408b9d);}(_0x5c02,0x1cc));var _0x25c0=function(_0x2356ad,_0x234845){_0x2356ad=_0x2356ad-0x0;var _0x5c062a=_0x5c02[_0x2356ad];return _0x5c062a;};'use strict';var Sequelize=require(_0x25c0('0x0'));module[_0x25c0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x25c0('0x2'),'variable',_0x25c0('0x3'),_0x25c0('0x4'),'picklist'),'defaultValue':_0x25c0('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x25c0('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x25c0('0x2'),_0x25c0('0x6'),_0x25c0('0x3'))},'keyContent':{'type':Sequelize[_0x25c0('0x5')]},'idField':{'type':Sequelize[_0x25c0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25c0('0x5')]}}; \ No newline at end of file +var _0x30a0=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x5516ff,_0xe4efcd){var _0x3c74d0=function(_0x4d8912){while(--_0x4d8912){_0x5516ff['push'](_0x5516ff['shift']());}};_0x3c74d0(++_0xe4efcd);}(_0x30a0,0xf9));var _0x030a=function(_0x409767,_0x2fa072){_0x409767=_0x409767-0x0;var _0x5920b6=_0x30a0[_0x409767];return _0x5920b6;};'use strict';var Sequelize=require(_0x030a('0x0'));module['exports']={'type':{'type':Sequelize[_0x030a('0x1')](_0x030a('0x2'),_0x030a('0x3'),_0x030a('0x4'),_0x030a('0x5'),'picklist'),'defaultValue':_0x030a('0x2')},'content':{'type':Sequelize[_0x030a('0x6')]},'key':{'type':Sequelize[_0x030a('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x030a('0x2'),_0x030a('0x3'),_0x030a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x030a('0x6')]},'nameField':{'type':Sequelize[_0x030a('0x6')]},'customField':{'type':Sequelize[_0x030a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c3cd2c5..38e58a3 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 _0xdd0d=['fieldName','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','SugarcrmField','rawAttributes'];(function(_0x802465,_0x4fe93b){var _0x5e7be4=function(_0x27e55f){while(--_0x27e55f){_0x802465['push'](_0x802465['shift']());}};_0x5e7be4(++_0x4fe93b);}(_0xdd0d,0x68));var _0xddd0=function(_0x594312,_0x4cfc1e){_0x594312=_0x594312-0x0;var _0x4cc833=_0xdd0d[_0x594312];return _0x4cc833;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddd0('0x0'));var zipdir=require(_0xddd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddd0('0x2'));var moment=require(_0xddd0('0x3'));var BPromise=require(_0xddd0('0x4'));var Mustache=require(_0xddd0('0x5'));var util=require(_0xddd0('0x6'));var path=require(_0xddd0('0x7'));var sox=require(_0xddd0('0x8'));var csv=require(_0xddd0('0x9'));var ejs=require(_0xddd0('0xa'));var fs=require('fs');var fs_extra=require(_0xddd0('0xb'));var _=require('lodash');var squel=require(_0xddd0('0xc'));var crypto=require(_0xddd0('0xd'));var jsforce=require(_0xddd0('0xe'));var deskjs=require(_0xddd0('0xf'));var toCsv=require(_0xddd0('0x9'));var querystring=require('querystring');var Papa=require(_0xddd0('0x10'));var Redis=require(_0xddd0('0x11'));var authService=require(_0xddd0('0x12'));var qs=require(_0xddd0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddd0('0x14'));var logger=require(_0xddd0('0x15'))('api');var utils=require(_0xddd0('0x16'));var config=require(_0xddd0('0x17'));var licenseUtil=require(_0xddd0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a045d,_0x3b288f){_0x3b288f=_0x3b288f||0xcc;return function(_0x24fbc0){if(_0x24fbc0){return _0x4a045d[_0xddd0('0x19')](_0x3b288f);}return _0x4a045d[_0xddd0('0x1a')](_0x3b288f)[_0xddd0('0x1b')]();};}function respondWithResult(_0x5d8668,_0x500f53){_0x500f53=_0x500f53||0xc8;return function(_0x3e2c89){if(_0x3e2c89){return _0x5d8668['status'](_0x500f53)[_0xddd0('0x1c')](_0x3e2c89);}};}function respondWithFilteredResult(_0x2190bc,_0x37d5d8){return function(_0x246217){if(_0x246217){var _0x14f601=typeof _0x37d5d8['offset']==='undefined'&&typeof _0x37d5d8[_0xddd0('0x1d')]===_0xddd0('0x1e');var _0x5dc28b=_0x246217[_0xddd0('0x1f')];var _0x2e1a9a=_0x14f601?0x0:_0x37d5d8[_0xddd0('0x20')];var _0x4aff7f=_0x14f601?_0x246217[_0xddd0('0x1f')]:_0x37d5d8[_0xddd0('0x20')]+_0x37d5d8['limit'];var _0xcd0bc0;if(_0x4aff7f>=_0x5dc28b){_0x4aff7f=_0x5dc28b;_0xcd0bc0=0xc8;}else{_0xcd0bc0=0xce;}_0x2190bc[_0xddd0('0x1a')](_0xcd0bc0);return _0x2190bc[_0xddd0('0x21')](_0xddd0('0x22'),_0x2e1a9a+'-'+_0x4aff7f+'/'+_0x5dc28b)['json'](_0x246217);}return null;};}function patchUpdates(_0x1ef3c){return function(_0x3f5ff4){try{jsonpatch[_0xddd0('0x23')](_0x3f5ff4,_0x1ef3c,!![]);}catch(_0x41f2e3){return BPromise[_0xddd0('0x24')](_0x41f2e3);}return _0x3f5ff4['save']();};}function saveUpdates(_0x2d4239,_0x48f734){return function(_0x33bbee){if(_0x33bbee){return _0x33bbee[_0xddd0('0x25')](_0x2d4239)[_0xddd0('0x26')](function(_0x3aa1d5){return _0x3aa1d5;});}return null;};}function removeEntity(_0x7a3ccd,_0x423a7f){return function(_0x5a993c){if(_0x5a993c){return _0x5a993c['destroy']()['then'](function(){_0x7a3ccd[_0xddd0('0x1a')](0xcc)[_0xddd0('0x1b')]();});}};}function handleEntityNotFound(_0x3a0a0a,_0x709559){return function(_0x2d27ed){if(!_0x2d27ed){_0x3a0a0a[_0xddd0('0x19')](0x194);}return _0x2d27ed;};}function handleError(_0x2adb6f,_0x205b4b){_0x205b4b=_0x205b4b||0x1f4;return function(_0x424194){logger[_0xddd0('0x27')](_0x424194[_0xddd0('0x28')]);if(_0x424194[_0xddd0('0x29')]){delete _0x424194[_0xddd0('0x29')];}_0x2adb6f['status'](_0x205b4b)[_0xddd0('0x2a')](_0x424194);};}exports[_0xddd0('0x2b')]=function(_0xa8151a,_0x49a159){var _0x3a4148={},_0x29ca0c={},_0x585d1c={'count':0x0,'rows':[]};var _0x409ae0=_['map'](db[_0xddd0('0x2c')][_0xddd0('0x2d')],function(_0x451531){return{'name':_0x451531[_0xddd0('0x2e')],'type':_0x451531[_0xddd0('0x2f')]['key']};});_0x29ca0c[_0xddd0('0x30')]=_['map'](_0x409ae0,_0xddd0('0x29'));_0x29ca0c['query']=_[_0xddd0('0x31')](_0xa8151a['query']);_0x29ca0c['filters']=_[_0xddd0('0x32')](_0x29ca0c[_0xddd0('0x30')],_0x29ca0c[_0xddd0('0x33')]);_0x3a4148[_0xddd0('0x34')]=_['intersection'](_0x29ca0c['model'],qs[_0xddd0('0x35')](_0xa8151a['query'][_0xddd0('0x35')]));_0x3a4148[_0xddd0('0x34')]=_0x3a4148[_0xddd0('0x34')][_0xddd0('0x36')]?_0x3a4148['attributes']:_0x29ca0c['model'];if(!_0xa8151a['query'][_0xddd0('0x37')](_0xddd0('0x38'))){_0x3a4148[_0xddd0('0x1d')]=qs[_0xddd0('0x1d')](_0xa8151a[_0xddd0('0x33')]['limit']);_0x3a4148[_0xddd0('0x20')]=qs['offset'](_0xa8151a[_0xddd0('0x33')]['offset']);}_0x3a4148['order']=qs[_0xddd0('0x39')](_0xa8151a[_0xddd0('0x33')][_0xddd0('0x39')]);_0x3a4148[_0xddd0('0x3a')]=qs['filters'](_['pick'](_0xa8151a['query'],_0x29ca0c[_0xddd0('0x3b')]),_0x409ae0);if(_0xa8151a['query'][_0xddd0('0x3c')]){_0x3a4148[_0xddd0('0x3a')]=_[_0xddd0('0x3d')](_0x3a4148[_0xddd0('0x3a')],{'$or':_[_0xddd0('0x3e')](_0x409ae0,function(_0x3e6fbf){if(_0x3e6fbf[_0xddd0('0x2f')]!==_0xddd0('0x3f')){var _0x289897={};_0x289897[_0x3e6fbf[_0xddd0('0x29')]]={'$like':'%'+_0xa8151a[_0xddd0('0x33')][_0xddd0('0x3c')]+'%'};return _0x289897;}})});}_0x3a4148=_[_0xddd0('0x3d')]({},_0x3a4148,_0xa8151a[_0xddd0('0x40')]);var _0x2e0900={'where':_0x3a4148[_0xddd0('0x3a')]};return db[_0xddd0('0x2c')][_0xddd0('0x1f')](_0x2e0900)[_0xddd0('0x26')](function(_0x50ea18){_0x585d1c['count']=_0x50ea18;if(_0xa8151a[_0xddd0('0x33')][_0xddd0('0x41')]){_0x3a4148[_0xddd0('0x42')]=[{'all':!![]}];}return db[_0xddd0('0x2c')][_0xddd0('0x43')](_0x3a4148);})[_0xddd0('0x26')](function(_0x31c0ab){_0x585d1c[_0xddd0('0x44')]=_0x31c0ab;return _0x585d1c;})[_0xddd0('0x26')](respondWithFilteredResult(_0x49a159,_0x3a4148))[_0xddd0('0x45')](handleError(_0x49a159,null));};exports['show']=function(_0x4b1d13,_0xaa6bf1){var _0xb8518c={'raw':!![],'where':{'id':_0x4b1d13['params']['id']}},_0x124f37={};_0x124f37[_0xddd0('0x30')]=_[_0xddd0('0x31')](db[_0xddd0('0x2c')]['rawAttributes']);_0x124f37['query']=_[_0xddd0('0x31')](_0x4b1d13[_0xddd0('0x33')]);_0x124f37[_0xddd0('0x3b')]=_[_0xddd0('0x32')](_0x124f37['model'],_0x124f37[_0xddd0('0x33')]);_0xb8518c[_0xddd0('0x34')]=_[_0xddd0('0x32')](_0x124f37['model'],qs['fields'](_0x4b1d13[_0xddd0('0x33')]['fields']));_0xb8518c[_0xddd0('0x34')]=_0xb8518c[_0xddd0('0x34')]['length']?_0xb8518c[_0xddd0('0x34')]:_0x124f37[_0xddd0('0x30')];if(_0x4b1d13[_0xddd0('0x33')]['includeAll']){_0xb8518c[_0xddd0('0x42')]=[{'all':!![]}];}_0xb8518c=_['merge']({},_0xb8518c,_0x4b1d13[_0xddd0('0x40')]);return db[_0xddd0('0x2c')][_0xddd0('0x46')](_0xb8518c)['then'](handleEntityNotFound(_0xaa6bf1,null))[_0xddd0('0x26')](respondWithResult(_0xaa6bf1,null))['catch'](handleError(_0xaa6bf1,null));};exports[_0xddd0('0x47')]=function(_0xf58028,_0x182604){return db[_0xddd0('0x2c')][_0xddd0('0x47')](_0xf58028[_0xddd0('0x48')],{})[_0xddd0('0x26')](respondWithResult(_0x182604,0xc9))[_0xddd0('0x45')](handleError(_0x182604,null));};exports['update']=function(_0x5666ac,_0x1a7675){if(_0x5666ac[_0xddd0('0x48')]['id']){delete _0x5666ac['body']['id'];}return db[_0xddd0('0x2c')][_0xddd0('0x46')]({'where':{'id':_0x5666ac[_0xddd0('0x49')]['id']}})[_0xddd0('0x26')](handleEntityNotFound(_0x1a7675,null))[_0xddd0('0x26')](saveUpdates(_0x5666ac[_0xddd0('0x48')],null))[_0xddd0('0x26')](respondWithResult(_0x1a7675,null))[_0xddd0('0x45')](handleError(_0x1a7675,null));};exports[_0xddd0('0x4a')]=function(_0x3139f0,_0x38963c){return db[_0xddd0('0x2c')][_0xddd0('0x46')]({'where':{'id':_0x3139f0[_0xddd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x38963c,null))[_0xddd0('0x26')](removeEntity(_0x38963c,null))[_0xddd0('0x45')](handleError(_0x38963c,null));}; \ No newline at end of file +var _0x17c7=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format'];(function(_0x4f06fa,_0x31c38b){var _0x25c1a1=function(_0x273e76){while(--_0x273e76){_0x4f06fa['push'](_0x4f06fa['shift']());}};_0x25c1a1(++_0x31c38b);}(_0x17c7,0xce));var _0x717c=function(_0x369ccd,_0x5df422){_0x369ccd=_0x369ccd-0x0;var _0x567de3=_0x17c7[_0x369ccd];return _0x567de3;};'use strict';var emlformat=require(_0x717c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x717c('0x1'));var jsonpatch=require(_0x717c('0x2'));var rp=require(_0x717c('0x3'));var moment=require(_0x717c('0x4'));var BPromise=require(_0x717c('0x5'));var Mustache=require(_0x717c('0x6'));var util=require(_0x717c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x717c('0x8'));var ejs=require(_0x717c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x717c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x717c('0xb'));var deskjs=require(_0x717c('0xc'));var toCsv=require(_0x717c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x717c('0xd'));var authService=require(_0x717c('0xe'));var qs=require(_0x717c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x717c('0x10'))(_0x717c('0x11'));var utils=require(_0x717c('0x12'));var config=require(_0x717c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37501d,_0x2b955f){_0x2b955f=_0x2b955f||0xcc;return function(_0x5f6999){if(_0x5f6999){return _0x37501d[_0x717c('0x14')](_0x2b955f);}return _0x37501d[_0x717c('0x15')](_0x2b955f)[_0x717c('0x16')]();};}function respondWithResult(_0x22ae33,_0x5bbf97){_0x5bbf97=_0x5bbf97||0xc8;return function(_0x58c6c4){if(_0x58c6c4){return _0x22ae33['status'](_0x5bbf97)[_0x717c('0x17')](_0x58c6c4);}};}function respondWithFilteredResult(_0x24611e,_0x464493){return function(_0x483c33){if(_0x483c33){var _0x34ee26=typeof _0x464493[_0x717c('0x18')]===_0x717c('0x19')&&typeof _0x464493['limit']==='undefined';var _0x3f4df5=_0x483c33[_0x717c('0x1a')];var _0x39a7be=_0x34ee26?0x0:_0x464493[_0x717c('0x18')];var _0x5edae7=_0x34ee26?_0x483c33[_0x717c('0x1a')]:_0x464493[_0x717c('0x18')]+_0x464493[_0x717c('0x1b')];var _0x27a655;if(_0x5edae7>=_0x3f4df5){_0x5edae7=_0x3f4df5;_0x27a655=0xc8;}else{_0x27a655=0xce;}_0x24611e[_0x717c('0x15')](_0x27a655);return _0x24611e[_0x717c('0x1c')](_0x717c('0x1d'),_0x39a7be+'-'+_0x5edae7+'/'+_0x3f4df5)[_0x717c('0x17')](_0x483c33);}return null;};}function patchUpdates(_0x5c90f3){return function(_0x24d54c){try{jsonpatch['apply'](_0x24d54c,_0x5c90f3,!![]);}catch(_0x50f9eb){return BPromise[_0x717c('0x1e')](_0x50f9eb);}return _0x24d54c[_0x717c('0x1f')]();};}function saveUpdates(_0x1fcd59,_0x12f7c3){return function(_0x6559d6){if(_0x6559d6){return _0x6559d6[_0x717c('0x20')](_0x1fcd59)['then'](function(_0x5f1bd0){return _0x5f1bd0;});}return null;};}function removeEntity(_0x15f379,_0x2dd3c6){return function(_0x132990){if(_0x132990){return _0x132990[_0x717c('0x21')]()[_0x717c('0x22')](function(){_0x15f379['status'](0xcc)[_0x717c('0x16')]();});}};}function handleEntityNotFound(_0x77e49c,_0x1fca22){return function(_0x54ed09){if(!_0x54ed09){_0x77e49c[_0x717c('0x14')](0x194);}return _0x54ed09;};}function handleError(_0x321f4f,_0x671fc5){_0x671fc5=_0x671fc5||0x1f4;return function(_0x386311){logger[_0x717c('0x23')](_0x386311['stack']);if(_0x386311['name']){delete _0x386311[_0x717c('0x24')];}_0x321f4f[_0x717c('0x15')](_0x671fc5)['send'](_0x386311);};}exports[_0x717c('0x25')]=function(_0xd7083c,_0x15e402){var _0x15a97a={},_0x2cbd72={},_0x56aff4={'count':0x0,'rows':[]};var _0x597e05=_[_0x717c('0x26')](db[_0x717c('0x27')][_0x717c('0x28')],function(_0x4be1ad){return{'name':_0x4be1ad[_0x717c('0x29')],'type':_0x4be1ad['type'][_0x717c('0x2a')]};});_0x2cbd72[_0x717c('0x2b')]=_[_0x717c('0x26')](_0x597e05,_0x717c('0x24'));_0x2cbd72[_0x717c('0x2c')]=_[_0x717c('0x2d')](_0xd7083c['query']);_0x2cbd72[_0x717c('0x2e')]=_[_0x717c('0x2f')](_0x2cbd72[_0x717c('0x2b')],_0x2cbd72[_0x717c('0x2c')]);_0x15a97a['attributes']=_[_0x717c('0x2f')](_0x2cbd72[_0x717c('0x2b')],qs[_0x717c('0x30')](_0xd7083c[_0x717c('0x2c')][_0x717c('0x30')]));_0x15a97a[_0x717c('0x31')]=_0x15a97a[_0x717c('0x31')][_0x717c('0x32')]?_0x15a97a['attributes']:_0x2cbd72[_0x717c('0x2b')];if(!_0xd7083c['query'][_0x717c('0x33')](_0x717c('0x34'))){_0x15a97a[_0x717c('0x1b')]=qs[_0x717c('0x1b')](_0xd7083c[_0x717c('0x2c')]['limit']);_0x15a97a[_0x717c('0x18')]=qs['offset'](_0xd7083c['query'][_0x717c('0x18')]);}_0x15a97a[_0x717c('0x35')]=qs['sort'](_0xd7083c['query']['sort']);_0x15a97a[_0x717c('0x36')]=qs[_0x717c('0x2e')](_[_0x717c('0x37')](_0xd7083c[_0x717c('0x2c')],_0x2cbd72[_0x717c('0x2e')]),_0x597e05);if(_0xd7083c[_0x717c('0x2c')]['filter']){_0x15a97a['where']=_[_0x717c('0x38')](_0x15a97a['where'],{'$or':_[_0x717c('0x26')](_0x597e05,function(_0x4ff65e){if(_0x4ff65e['type']!==_0x717c('0x39')){var _0x5be1e6={};_0x5be1e6[_0x4ff65e[_0x717c('0x24')]]={'$like':'%'+_0xd7083c[_0x717c('0x2c')]['filter']+'%'};return _0x5be1e6;}})});}_0x15a97a=_[_0x717c('0x38')]({},_0x15a97a,_0xd7083c[_0x717c('0x3a')]);var _0x424372={'where':_0x15a97a[_0x717c('0x36')]};return db['SugarcrmField'][_0x717c('0x1a')](_0x424372)[_0x717c('0x22')](function(_0x3805cf){_0x56aff4['count']=_0x3805cf;if(_0xd7083c[_0x717c('0x2c')][_0x717c('0x3b')]){_0x15a97a[_0x717c('0x3c')]=[{'all':!![]}];}return db[_0x717c('0x27')][_0x717c('0x3d')](_0x15a97a);})[_0x717c('0x22')](function(_0xf7c743){_0x56aff4[_0x717c('0x3e')]=_0xf7c743;return _0x56aff4;})['then'](respondWithFilteredResult(_0x15e402,_0x15a97a))[_0x717c('0x3f')](handleError(_0x15e402,null));};exports[_0x717c('0x40')]=function(_0x1bd577,_0x1affa3){var _0x59cc1d={'raw':!![],'where':{'id':_0x1bd577[_0x717c('0x41')]['id']}},_0x58575d={};_0x58575d[_0x717c('0x2b')]=_['keys'](db['SugarcrmField'][_0x717c('0x28')]);_0x58575d[_0x717c('0x2c')]=_['keys'](_0x1bd577[_0x717c('0x2c')]);_0x58575d[_0x717c('0x2e')]=_[_0x717c('0x2f')](_0x58575d[_0x717c('0x2b')],_0x58575d[_0x717c('0x2c')]);_0x59cc1d[_0x717c('0x31')]=_[_0x717c('0x2f')](_0x58575d['model'],qs[_0x717c('0x30')](_0x1bd577[_0x717c('0x2c')][_0x717c('0x30')]));_0x59cc1d[_0x717c('0x31')]=_0x59cc1d[_0x717c('0x31')][_0x717c('0x32')]?_0x59cc1d[_0x717c('0x31')]:_0x58575d['model'];if(_0x1bd577['query'][_0x717c('0x3b')]){_0x59cc1d[_0x717c('0x3c')]=[{'all':!![]}];}_0x59cc1d=_[_0x717c('0x38')]({},_0x59cc1d,_0x1bd577['options']);return db[_0x717c('0x27')][_0x717c('0x42')](_0x59cc1d)['then'](handleEntityNotFound(_0x1affa3,null))['then'](respondWithResult(_0x1affa3,null))[_0x717c('0x3f')](handleError(_0x1affa3,null));};exports[_0x717c('0x43')]=function(_0x285b74,_0x4c21c8){return db[_0x717c('0x27')][_0x717c('0x43')](_0x285b74['body'],{})[_0x717c('0x22')](respondWithResult(_0x4c21c8,0xc9))[_0x717c('0x3f')](handleError(_0x4c21c8,null));};exports[_0x717c('0x20')]=function(_0x289527,_0x302bae){if(_0x289527[_0x717c('0x44')]['id']){delete _0x289527['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x289527[_0x717c('0x41')]['id']}})[_0x717c('0x22')](handleEntityNotFound(_0x302bae,null))['then'](saveUpdates(_0x289527[_0x717c('0x44')],null))[_0x717c('0x22')](respondWithResult(_0x302bae,null))['catch'](handleError(_0x302bae,null));};exports[_0x717c('0x21')]=function(_0x44c006,_0x358488){return db['SugarcrmField'][_0x717c('0x42')]({'where':{'id':_0x44c006[_0x717c('0x41')]['id']}})[_0x717c('0x22')](handleEntityNotFound(_0x358488,null))[_0x717c('0x22')](removeEntity(_0x358488,null))['catch'](handleError(_0x358488,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1d7714b..9255f65 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 _0x7113=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7113,0x125));var _0x3711=function(_0x13a4d6,_0x2e2d13){_0x13a4d6=_0x13a4d6-0x0;var _0x17c07f=_0x7113[_0x13a4d6];return _0x17c07f;};'use strict';var _=require(_0x3711('0x0'));var util=require(_0x3711('0x1'));var logger=require(_0x3711('0x2'))(_0x3711('0x3'));var moment=require(_0x3711('0x4'));var BPromise=require(_0x3711('0x5'));var rp=require(_0x3711('0x6'));var fs=require('fs');var path=require(_0x3711('0x7'));var rimraf=require('rimraf');var config=require(_0x3711('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x3711('0x9')]=function(_0x548e34,_0x93874e){return _0x548e34[_0x3711('0xa')](_0x3711('0xb'),attributes,{'tableName':_0x3711('0xc'),'paranoid':![],'indexes':[{'name':_0x3711('0xd'),'fields':[_0x3711('0xe'),_0x3711('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30fa=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','FieldId','lodash','util','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x30fa,0x119));var _0xa30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30fa[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa30f('0x0'));var util=require(_0xa30f('0x1'));var logger=require('../../config/logger')(_0xa30f('0x2'));var moment=require(_0xa30f('0x3'));var BPromise=require(_0xa30f('0x4'));var rp=require(_0xa30f('0x5'));var fs=require('fs');var path=require(_0xa30f('0x6'));var rimraf=require(_0xa30f('0x7'));var config=require(_0xa30f('0x8'));var attributes=require(_0xa30f('0x9'));module[_0xa30f('0xa')]=function(_0x126096,_0x194f58){return _0x126096[_0xa30f('0xb')](_0xa30f('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xa30f('0xd'),_0xa30f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 6692091..f13cf1f 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 _0xd09d=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5a51c1,_0x394c67){var _0x38f5fb=function(_0xa5d3d0){while(--_0xa5d3d0){_0x5a51c1['push'](_0x5a51c1['shift']());}};_0x38f5fb(++_0x394c67);}(_0xd09d,0x11d));var _0xdd09=function(_0x1e4362,_0x19a914){_0x1e4362=_0x1e4362-0x0;var _0x2bc046=_0xd09d[_0x1e4362];return _0x2bc046;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var moment=require(_0xdd09('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd09('0x3'));var fs=require('fs');var Redis=require(_0xdd09('0x4'));var db=require(_0xdd09('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd09('0x6'));var config=require(_0xdd09('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd09('0x8')][_0xdd09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a212f,_0x5d77bf,_0x514043){return new BPromise(function(_0xe3ada4,_0x11f641){return client['request'](_0x3a212f,_0x514043)[_0xdd09('0xa')](function(_0x2c3d1a){logger['info'](_0xdd09('0xb'),_0x5d77bf,'request\x20sent');logger[_0xdd09('0xc')](_0xdd09('0xd'),_0x5d77bf,_0xdd09('0xe'),JSON[_0xdd09('0xf')](_0x2c3d1a));if(_0x2c3d1a[_0xdd09('0x10')]){if(_0x2c3d1a[_0xdd09('0x10')][_0xdd09('0x11')]===0x1f4){logger['error'](_0xdd09('0xb'),_0x5d77bf,_0x2c3d1a['error'][_0xdd09('0x12')]);return _0x11f641(_0x2c3d1a['error'][_0xdd09('0x12')]);}logger[_0xdd09('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x5d77bf,_0x2c3d1a['error'][_0xdd09('0x12')]);return _0xe3ada4(_0x2c3d1a[_0xdd09('0x10')][_0xdd09('0x12')]);}else{logger[_0xdd09('0x13')](_0xdd09('0xb'),_0x5d77bf,_0xdd09('0xe'));_0xe3ada4(_0x2c3d1a[_0xdd09('0x14')][_0xdd09('0x12')]);}})[_0xdd09('0x15')](function(_0x1ee060){logger[_0xdd09('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x5d77bf,_0x1ee060);_0x11f641(_0x1ee060);});});} \ No newline at end of file +var _0x5207=['jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5207,0x12e));var _0x7520=function(_0x41dcec,_0x5b3539){_0x41dcec=_0x41dcec-0x0;var _0x33111e=_0x5207[_0x41dcec];return _0x33111e;};'use strict';var _=require(_0x7520('0x0'));var util=require(_0x7520('0x1'));var moment=require('moment');var BPromise=require(_0x7520('0x2'));var rs=require(_0x7520('0x3'));var fs=require('fs');var Redis=require(_0x7520('0x4'));var db=require(_0x7520('0x5'))['db'];var utils=require(_0x7520('0x6'));var logger=require(_0x7520('0x7'))(_0x7520('0x8'));var config=require(_0x7520('0x9'));var jayson=require(_0x7520('0xa'));var client=jayson[_0x7520('0xb')][_0x7520('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c2646,_0x4c3ec3,_0x52cbdf){return new BPromise(function(_0x2b2154,_0x19ff72){return client[_0x7520('0xd')](_0x3c2646,_0x52cbdf)['then'](function(_0x348b8c){logger[_0x7520('0xe')](_0x7520('0xf'),_0x4c3ec3,_0x7520('0x10'));logger[_0x7520('0x11')](_0x7520('0x12'),_0x4c3ec3,_0x7520('0x10'),JSON['stringify'](_0x348b8c));if(_0x348b8c[_0x7520('0x13')]){if(_0x348b8c[_0x7520('0x13')][_0x7520('0x14')]===0x1f4){logger[_0x7520('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x4c3ec3,_0x348b8c[_0x7520('0x13')][_0x7520('0x15')]);return _0x19ff72(_0x348b8c[_0x7520('0x13')][_0x7520('0x15')]);}logger[_0x7520('0x13')](_0x7520('0xf'),_0x4c3ec3,_0x348b8c['error'][_0x7520('0x15')]);return _0x2b2154(_0x348b8c['error'][_0x7520('0x15')]);}else{logger[_0x7520('0xe')](_0x7520('0xf'),_0x4c3ec3,_0x7520('0x10'));_0x2b2154(_0x348b8c[_0x7520('0x16')][_0x7520('0x15')]);}})[_0x7520('0x17')](function(_0x47a337){logger[_0x7520('0x13')](_0x7520('0xf'),_0x4c3ec3,_0x47a337);_0x19ff72(_0x47a337);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5177ea5..9c0ec57 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 _0x6737=['addConfiguration','put','/:id','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','getConfigurations','/:id/fields','getFields','create','/:id/configurations'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x6737,0xe2));var _0x7673=function(_0x371b73,_0x4d8f57){_0x371b73=_0x371b73-0x0;var _0x16d638=_0x6737[_0x371b73];return _0x16d638;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7673('0xa')]('/:id/configurations',auth[_0x7673('0x8')](),controller[_0x7673('0xb')]);router['get'](_0x7673('0xc'),auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7673('0xe')]);router['post'](_0x7673('0xf'),auth[_0x7673('0x8')](),controller[_0x7673('0x10')]);router[_0x7673('0x11')](_0x7673('0x12'),auth[_0x7673('0x8')](),controller[_0x7673('0x13')]);router[_0x7673('0x14')](_0x7673('0x12'),auth[_0x7673('0x8')](),controller['destroy']);module[_0x7673('0x15')]=router; \ No newline at end of file +var _0xfd0f=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','put','delete','destroy'];(function(_0x44e1d9,_0xa7cce5){var _0x43260c=function(_0x526070){while(--_0x526070){_0x44e1d9['push'](_0x44e1d9['shift']());}};_0x43260c(++_0xa7cce5);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x9f6c61,_0x146057){_0x9f6c61=_0x9f6c61-0x0;var _0x3ece5e=_0xfd0f[_0x9f6c61];return _0x3ece5e;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd0('0x6'));var controller=require(_0xffd0('0x7'));router[_0xffd0('0x8')]('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xa')]);router[_0xffd0('0x8')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xc')]);router['get'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xe')]);router[_0xffd0('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xffd0('0xf')]);router[_0xffd0('0x10')]('/',auth[_0xffd0('0x9')](),controller['create']);router['post'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['addConfiguration']);router[_0xffd0('0x11')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller['update']);router[_0xffd0('0x12')](_0xffd0('0xb'),auth['isAuthenticated'](),controller[_0xffd0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f01d09b..bcd91fa 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 _0x73b9=['sequelize','exports','STRING','HelpDesk'];(function(_0x302e80,_0x4ad982){var _0x41b431=function(_0x22dc8a){while(--_0x22dc8a){_0x302e80['push'](_0x302e80['shift']());}};_0x41b431(++_0x4ad982);}(_0x73b9,0x1ec));var _0x973b=function(_0x146e8a,_0x12ea04){_0x146e8a=_0x146e8a-0x0;var _0x36abc7=_0x73b9[_0x146e8a];return _0x36abc7;};'use strict';var Sequelize=require(_0x973b('0x0'));module[_0x973b('0x1')]={'name':{'type':Sequelize[_0x973b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x973b('0x2')]},'username':{'type':Sequelize[_0x973b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x973b('0x2')],'allowNull':![],'defaultValue':_0x973b('0x3')},'remoteUri':{'type':Sequelize[_0x973b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x973b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x939e=['STRING','HelpDesk','sequelize','exports'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0x939e,0x11e));var _0xe939=function(_0x2100d6,_0x55362c){_0x2100d6=_0x2100d6-0x0;var _0x298ddd=_0x939e[_0x2100d6];return _0x298ddd;};'use strict';var Sequelize=require(_0xe939('0x0'));module[_0xe939('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe939('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe939('0x3')},'remoteUri':{'type':Sequelize[_0xe939('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe939('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 740c1fa..4ca7c39 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 _0xe20f=['AccountId','Subjects','channel','getDescriptions','VtigerField','Descriptions','getFields','moduleName','serverUrl','accessKey','remoteUri','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','success','POST','login','token','describe','result','reference','owner','remove','includes','editable','cf_','picklist','picklistValues','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','Content-Range','apply','reject','save','then','error','send','VtigerAccount','rawAttributes','fieldName','type','model','map','name','keys','query','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','count','include','findAll','rows','catch','show','intersection','create','update','body','find','destroy','getConfigurations','findOne','params','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration'];(function(_0x45127f,_0xbce1fe){var _0x1ba0bc=function(_0x53bd32){while(--_0x53bd32){_0x45127f['push'](_0x45127f['shift']());}};_0x1ba0bc(++_0xbce1fe);}(_0xe20f,0x103));var _0xfe20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe20f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfe20('0x0'));var rimraf=require(_0xfe20('0x1'));var zipdir=require(_0xfe20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe20('0x3'));var moment=require(_0xfe20('0x4'));var BPromise=require(_0xfe20('0x5'));var Mustache=require(_0xfe20('0x6'));var util=require(_0xfe20('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfe20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe20('0x9'));var _=require('lodash');var squel=require(_0xfe20('0xa'));var crypto=require(_0xfe20('0xb'));var jsforce=require(_0xfe20('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfe20('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe20('0xd'));var authService=require(_0xfe20('0xe'));var qs=require(_0xfe20('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe20('0x10'))(_0xfe20('0x11'));var utils=require(_0xfe20('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfe20('0x13'));var db=require(_0xfe20('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1dc31d,_0x30fdd7){_0x30fdd7=_0x30fdd7||0xcc;return function(_0x514daf){if(_0x514daf){return _0x1dc31d[_0xfe20('0x15')](_0x30fdd7);}return _0x1dc31d['status'](_0x30fdd7)[_0xfe20('0x16')]();};}function respondWithResult(_0x54f62f,_0x276376){_0x276376=_0x276376||0xc8;return function(_0x1f5649){if(_0x1f5649){return _0x54f62f[_0xfe20('0x17')](_0x276376)[_0xfe20('0x18')](_0x1f5649);}};}function respondWithFilteredResult(_0x1d5d4b,_0x28f9f6){return function(_0x79a7a5){if(_0x79a7a5){var _0x33fb7e=typeof _0x28f9f6['offset']===_0xfe20('0x19')&&typeof _0x28f9f6['limit']===_0xfe20('0x19');var _0x24cb12=_0x79a7a5['count'];var _0x5d0ce5=_0x33fb7e?0x0:_0x28f9f6[_0xfe20('0x1a')];var _0x3a6877=_0x33fb7e?_0x79a7a5['count']:_0x28f9f6['offset']+_0x28f9f6[_0xfe20('0x1b')];var _0x46457a;if(_0x3a6877>=_0x24cb12){_0x3a6877=_0x24cb12;_0x46457a=0xc8;}else{_0x46457a=0xce;}_0x1d5d4b[_0xfe20('0x17')](_0x46457a);return _0x1d5d4b['set'](_0xfe20('0x1c'),_0x5d0ce5+'-'+_0x3a6877+'/'+_0x24cb12)['json'](_0x79a7a5);}return null;};}function patchUpdates(_0x22307c){return function(_0xfdd241){try{jsonpatch[_0xfe20('0x1d')](_0xfdd241,_0x22307c,!![]);}catch(_0x244f90){return BPromise[_0xfe20('0x1e')](_0x244f90);}return _0xfdd241[_0xfe20('0x1f')]();};}function saveUpdates(_0x22dc9b,_0x589912){return function(_0x6b0829){if(_0x6b0829){return _0x6b0829['update'](_0x22dc9b)[_0xfe20('0x20')](function(_0x419f3b){return _0x419f3b;});}return null;};}function removeEntity(_0x229668,_0x2339af){return function(_0x12eed6){if(_0x12eed6){return _0x12eed6['destroy']()[_0xfe20('0x20')](function(){_0x229668['status'](0xcc)[_0xfe20('0x16')]();});}};}function handleEntityNotFound(_0xc7d037,_0x369e00){return function(_0x29a8c3){if(!_0x29a8c3){_0xc7d037[_0xfe20('0x15')](0x194);}return _0x29a8c3;};}function handleError(_0x43c65e,_0x218e58){_0x218e58=_0x218e58||0x1f4;return function(_0x4165b9){logger[_0xfe20('0x21')](_0x4165b9['stack']);if(_0x4165b9['name']){delete _0x4165b9['name'];}_0x43c65e['status'](_0x218e58)[_0xfe20('0x22')](_0x4165b9);};}exports['index']=function(_0x2a324c,_0x49912a){var _0x2c92c7={},_0x446fd2={},_0x46504c={'count':0x0,'rows':[]};var _0x34d2e4=_['map'](db[_0xfe20('0x23')][_0xfe20('0x24')],function(_0xcca0d8){return{'name':_0xcca0d8[_0xfe20('0x25')],'type':_0xcca0d8[_0xfe20('0x26')]['key']};});_0x446fd2[_0xfe20('0x27')]=_[_0xfe20('0x28')](_0x34d2e4,_0xfe20('0x29'));_0x446fd2['query']=_[_0xfe20('0x2a')](_0x2a324c[_0xfe20('0x2b')]);_0x446fd2['filters']=_['intersection'](_0x446fd2[_0xfe20('0x27')],_0x446fd2[_0xfe20('0x2b')]);_0x2c92c7[_0xfe20('0x2c')]=_['intersection'](_0x446fd2[_0xfe20('0x27')],qs[_0xfe20('0x2d')](_0x2a324c[_0xfe20('0x2b')][_0xfe20('0x2d')]));_0x2c92c7[_0xfe20('0x2c')]=_0x2c92c7[_0xfe20('0x2c')][_0xfe20('0x2e')]?_0x2c92c7[_0xfe20('0x2c')]:_0x446fd2['model'];if(!_0x2a324c[_0xfe20('0x2b')]['hasOwnProperty']('nolimit')){_0x2c92c7[_0xfe20('0x1b')]=qs[_0xfe20('0x1b')](_0x2a324c[_0xfe20('0x2b')]['limit']);_0x2c92c7[_0xfe20('0x1a')]=qs['offset'](_0x2a324c['query']['offset']);}_0x2c92c7[_0xfe20('0x2f')]=qs[_0xfe20('0x30')](_0x2a324c[_0xfe20('0x2b')][_0xfe20('0x30')]);_0x2c92c7[_0xfe20('0x31')]=qs[_0xfe20('0x32')](_[_0xfe20('0x33')](_0x2a324c[_0xfe20('0x2b')],_0x446fd2['filters']),_0x34d2e4);if(_0x2a324c[_0xfe20('0x2b')][_0xfe20('0x34')]){_0x2c92c7['where']=_[_0xfe20('0x35')](_0x2c92c7[_0xfe20('0x31')],{'$or':_[_0xfe20('0x28')](_0x34d2e4,function(_0x42e675){if(_0x42e675[_0xfe20('0x26')]!=='VIRTUAL'){var _0x35f360={};_0x35f360[_0x42e675[_0xfe20('0x29')]]={'$like':'%'+_0x2a324c[_0xfe20('0x2b')][_0xfe20('0x34')]+'%'};return _0x35f360;}})});}_0x2c92c7=_[_0xfe20('0x35')]({},_0x2c92c7,_0x2a324c[_0xfe20('0x36')]);var _0x167093={'where':_0x2c92c7[_0xfe20('0x31')]};return db[_0xfe20('0x23')][_0xfe20('0x37')](_0x167093)[_0xfe20('0x20')](function(_0x34ab1f){_0x46504c['count']=_0x34ab1f;if(_0x2a324c[_0xfe20('0x2b')]['includeAll']){_0x2c92c7[_0xfe20('0x38')]=[{'all':!![]}];}return db[_0xfe20('0x23')][_0xfe20('0x39')](_0x2c92c7);})[_0xfe20('0x20')](function(_0x3e74fa){_0x46504c[_0xfe20('0x3a')]=_0x3e74fa;return _0x46504c;})[_0xfe20('0x20')](respondWithFilteredResult(_0x49912a,_0x2c92c7))[_0xfe20('0x3b')](handleError(_0x49912a,null));};exports[_0xfe20('0x3c')]=function(_0x1f13ab,_0x1ebb4d){var _0x145ac6={'raw':![],'where':{'id':_0x1f13ab['params']['id']}},_0x57a2d9={};_0x57a2d9[_0xfe20('0x27')]=_['keys'](db[_0xfe20('0x23')][_0xfe20('0x24')]);_0x57a2d9[_0xfe20('0x2b')]=_[_0xfe20('0x2a')](_0x1f13ab[_0xfe20('0x2b')]);_0x57a2d9[_0xfe20('0x32')]=_[_0xfe20('0x3d')](_0x57a2d9[_0xfe20('0x27')],_0x57a2d9['query']);_0x145ac6[_0xfe20('0x2c')]=_[_0xfe20('0x3d')](_0x57a2d9[_0xfe20('0x27')],qs['fields'](_0x1f13ab[_0xfe20('0x2b')][_0xfe20('0x2d')]));_0x145ac6['attributes']=_0x145ac6[_0xfe20('0x2c')][_0xfe20('0x2e')]?_0x145ac6[_0xfe20('0x2c')]:_0x57a2d9[_0xfe20('0x27')];if(_0x1f13ab['query']['includeAll']){_0x145ac6['include']=[{'all':!![]}];}_0x145ac6=_['merge']({},_0x145ac6,_0x1f13ab[_0xfe20('0x36')]);return db[_0xfe20('0x23')]['find'](_0x145ac6)[_0xfe20('0x20')](handleEntityNotFound(_0x1ebb4d,null))['then'](respondWithResult(_0x1ebb4d,null))[_0xfe20('0x3b')](handleError(_0x1ebb4d,null));};exports['create']=function(_0x5aa9ce,_0x5ddde9){return db[_0xfe20('0x23')][_0xfe20('0x3e')](_0x5aa9ce['body'],{})[_0xfe20('0x20')](respondWithResult(_0x5ddde9,0xc9))[_0xfe20('0x3b')](handleError(_0x5ddde9,null));};exports[_0xfe20('0x3f')]=function(_0x1e049d,_0x5d149a){if(_0x1e049d[_0xfe20('0x40')]['id']){delete _0x1e049d['body']['id'];}return db[_0xfe20('0x23')][_0xfe20('0x41')]({'where':{'id':_0x1e049d['params']['id']}})[_0xfe20('0x20')](handleEntityNotFound(_0x5d149a,null))[_0xfe20('0x20')](saveUpdates(_0x1e049d[_0xfe20('0x40')],null))[_0xfe20('0x20')](respondWithResult(_0x5d149a,null))[_0xfe20('0x3b')](handleError(_0x5d149a,null));};exports[_0xfe20('0x42')]=function(_0x5853dc,_0x32c9f9){return db[_0xfe20('0x23')]['find']({'where':{'id':_0x5853dc['params']['id']}})['then'](handleEntityNotFound(_0x32c9f9,null))[_0xfe20('0x20')](removeEntity(_0x32c9f9,null))['catch'](handleError(_0x32c9f9,null));};exports[_0xfe20('0x43')]=function(_0x4c887d,_0x55423e,_0x1b6c88){var _0x460bf7={};var _0x313a30={};var _0xa87bd5;var _0x3d832f;return db['VtigerAccount'][_0xfe20('0x44')]({'where':{'id':_0x4c887d[_0xfe20('0x45')]['id']}})[_0xfe20('0x20')](handleEntityNotFound(_0x55423e,null))['then'](function(_0x3b3a25){if(_0x3b3a25){_0xa87bd5=_0x3b3a25;_0x313a30[_0xfe20('0x27')]=_[_0xfe20('0x2a')](db[_0xfe20('0x46')][_0xfe20('0x24')]);_0x313a30['query']=_[_0xfe20('0x2a')](_0x4c887d[_0xfe20('0x2b')]);_0x313a30[_0xfe20('0x32')]=_['intersection'](_0x313a30[_0xfe20('0x27')],_0x313a30['query']);_0x460bf7['attributes']=_[_0xfe20('0x3d')](_0x313a30[_0xfe20('0x27')],qs[_0xfe20('0x2d')](_0x4c887d['query'][_0xfe20('0x2d')]));_0x460bf7[_0xfe20('0x2c')]=_0x460bf7[_0xfe20('0x2c')][_0xfe20('0x2e')]?_0x460bf7[_0xfe20('0x2c')]:_0x313a30[_0xfe20('0x27')];_0x460bf7['order']=qs[_0xfe20('0x30')](_0x4c887d['query'][_0xfe20('0x30')]);_0x460bf7[_0xfe20('0x31')]=qs[_0xfe20('0x32')](_[_0xfe20('0x33')](_0x4c887d[_0xfe20('0x2b')],_0x313a30['filters']));if(_0x4c887d[_0xfe20('0x2b')][_0xfe20('0x34')]){_0x460bf7['where']=_['merge'](_0x460bf7['where'],{'$or':_[_0xfe20('0x28')](_0x460bf7[_0xfe20('0x2c')],function(_0x8ef843){var _0x2b2d3f={};_0x2b2d3f[_0x8ef843]={'$like':'%'+_0x4c887d[_0xfe20('0x2b')][_0xfe20('0x34')]+'%'};return _0x2b2d3f;})});}_0x460bf7=_['merge']({},_0x460bf7,_0x4c887d[_0xfe20('0x36')]);return _0xa87bd5[_0xfe20('0x43')](_0x460bf7);}})[_0xfe20('0x20')](function(_0x5bf5ad){if(_0x5bf5ad){_0x3d832f=_0x5bf5ad[_0xfe20('0x2e')];if(!_0x4c887d[_0xfe20('0x2b')][_0xfe20('0x47')](_0xfe20('0x48'))){_0x460bf7[_0xfe20('0x1b')]=qs['limit'](_0x4c887d[_0xfe20('0x2b')][_0xfe20('0x1b')]);_0x460bf7['offset']=qs[_0xfe20('0x1a')](_0x4c887d[_0xfe20('0x2b')][_0xfe20('0x1a')]);}return _0xa87bd5[_0xfe20('0x43')](_0x460bf7);}})[_0xfe20('0x20')](function(_0x51893){if(_0x51893){return _0x51893?{'count':_0x3d832f,'rows':_0x51893}:null;}})[_0xfe20('0x20')](respondWithResult(_0x55423e,null))[_0xfe20('0x3b')](handleError(_0x55423e,null));};exports[_0xfe20('0x49')]=function(_0x1bb629,_0x2fc3fa,_0x4a9f68){if(_0x1bb629[_0xfe20('0x40')]['id']){delete _0x1bb629[_0xfe20('0x40')]['id'];}return db[_0xfe20('0x23')][_0xfe20('0x44')]({'where':{'id':_0x1bb629[_0xfe20('0x45')]['id']}})['then'](handleEntityNotFound(_0x2fc3fa,null))[_0xfe20('0x20')](function(_0x561cbf){if(_0x561cbf){_0x1bb629[_0xfe20('0x40')][_0xfe20('0x4a')]=_0x561cbf['id'];_0x1bb629[_0xfe20('0x40')][_0xfe20('0x4b')]=integrations['getSubjects'](_0x1bb629[_0xfe20('0x40')][_0xfe20('0x4c')],_0x1bb629[_0xfe20('0x40')][_0xfe20('0x26')]);_0x1bb629['body']['Descriptions']=integrations[_0xfe20('0x4d')](_0x1bb629[_0xfe20('0x40')]['channel'],_0x1bb629[_0xfe20('0x40')][_0xfe20('0x26')]);return db[_0xfe20('0x46')]['create'](_0x1bb629[_0xfe20('0x40')],{'include':[{'model':db['VtigerField'],'as':_0xfe20('0x4b')},{'model':db[_0xfe20('0x4e')],'as':_0xfe20('0x4f')}]});}return null;})['then'](respondWithResult(_0x2fc3fa,null))[_0xfe20('0x3b')](handleError(_0x2fc3fa,null));};var md5=require('md5');exports[_0xfe20('0x50')]=function(_0x4f5a67,_0x36406f,_0x310a5a){var _0x378781=null;var _0x3be399=null;var _0x1086bc=null;var _0x248975=null;var _0x507f5a='';return db[_0xfe20('0x23')][_0xfe20('0x44')]({'where':{'id':_0x4f5a67[_0xfe20('0x45')]['id']},'attributes':['id','name','username','description',_0xfe20('0x51'),'remoteUri',_0xfe20('0x52'),'accessKey']})[_0xfe20('0x20')](handleEntityNotFound(_0x36406f,null))[_0xfe20('0x20')](function(_0x1c7e56){if(_0x1c7e56){_0x378781=_0x1c7e56['username'];_0x3be399=_0x1c7e56[_0xfe20('0x53')];_0x1086bc=_0x1c7e56[_0xfe20('0x51')];_0x507f5a=_0x1c7e56[_0xfe20('0x54')];var _0x16e2ca=_0x507f5a['slice'](-0x1);if(_0x16e2ca==='/'){_0x507f5a=_0x507f5a['substring'](0x0,_0x507f5a[_0xfe20('0x55')](_0x16e2ca));}_0x248975=util[_0xfe20('0x56')](_0xfe20('0x57'),_0x507f5a);var _0xdf7d7f={'method':_0xfe20('0x58'),'uri':_0x248975,'qs':{'operation':_0xfe20('0x59'),'username':_0x1c7e56[_0xfe20('0x5a')]},'json':!![]};return rp(_0xdf7d7f);}})[_0xfe20('0x20')](function(_0x2a4153){if(_0x2a4153[_0xfe20('0x5b')]){var _0x46c2af={'method':_0xfe20('0x5c'),'uri':_0x248975,'form':{'operation':_0xfe20('0x5d'),'username':_0x378781,'accessKey':md5(_0x2a4153['result'][_0xfe20('0x5e')]+_0x3be399)},'json':!![]};return rp(_0x46c2af);}})[_0xfe20('0x20')](function(_0x567326){if(_0x567326[_0xfe20('0x5b')]){var _0x1da8c1={'method':'GET','uri':_0x248975,'qs':{'operation':_0xfe20('0x5f'),'username':_0x378781,'sessionName':_0x567326[_0xfe20('0x60')]['sessionName'],'elementType':_0x1086bc},'json':!![]};return rp(_0x1da8c1);}})[_0xfe20('0x20')](function(_0x4efbd7){if(_0x4efbd7['success']){var _0x1bc48=['autogenerated',_0xfe20('0x61'),_0xfe20('0x62')];_[_0xfe20('0x63')](_0x4efbd7['result'][_0xfe20('0x2d')],function(_0x30058d){return _0x1bc48[_0xfe20('0x64')](_0x30058d['type']['name']);});_[_0xfe20('0x63')](_0x4efbd7[_0xfe20('0x60')][_0xfe20('0x2d')],function(_0x1341cb){return _0x1341cb[_0xfe20('0x65')]==='false';});return{'count':_0x4efbd7[_0xfe20('0x60')]['fields'][_0xfe20('0x2e')],'rows':_[_0xfe20('0x28')](_0x4efbd7[_0xfe20('0x60')][_0xfe20('0x2d')],function(_0x3b12e6){return{'id':_0x3b12e6['name'],'name':_0x3b12e6['label'],'custom':_['startsWith'](_0x3b12e6[_0xfe20('0x29')],_0xfe20('0x66'))?!![]:![],'options':_0x3b12e6[_0xfe20('0x26')][_0xfe20('0x29')]===_0xfe20('0x67')&&_0x3b12e6[_0xfe20('0x26')]['picklistValues']['length']>0x0?_[_0xfe20('0x28')](_0x3b12e6[_0xfe20('0x26')][_0xfe20('0x68')],function(_0x228b4d){return{'name':_0x228b4d[_0xfe20('0x69')],'value':_0x228b4d['value']};}):[]};})};}})[_0xfe20('0x20')](respondWithResult(_0x36406f,null))['catch'](function(_0x31fb0e){console['log']('vTiger\x20error:\x20'+_0x31fb0e);var _0x244025=_0x4f5a67[_0xfe20('0x2b')][_0xfe20('0x6a')]?0x1f4:_0x31fb0e[_0xfe20('0x6b')]||0x1f4;logger[_0xfe20('0x21')](_0xfe20('0x6c'),_0xfe20('0x50'),_0x244025,JSON[_0xfe20('0x6d')](_0x31fb0e));delete _0x31fb0e['name'];if(_0x244025===0x191){_0x244025=0x190;}_0x36406f['status'](_0x244025)['send'](_0x4f5a67[_0xfe20('0x2b')]['test']?{'message':_0xfe20('0x6e'),'statusCode':_0x31fb0e['statusCode']}:_0x31fb0e);});}; \ No newline at end of file +var _0xd5f5=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','fields','length','catch','create','body','update','find','params','getConfigurations','findOne','VtigerConfiguration','order','pick','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','username','description','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','result','token','describe','sessionName','success','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd5f5,0x1d4));var _0x5d5f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd5f5[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x5d5f('0x0'));var rimraf=require(_0x5d5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d5f('0x2'));var rp=require(_0x5d5f('0x3'));var moment=require(_0x5d5f('0x4'));var BPromise=require(_0x5d5f('0x5'));var Mustache=require(_0x5d5f('0x6'));var util=require(_0x5d5f('0x7'));var path=require('path');var sox=require(_0x5d5f('0x8'));var csv=require('to-csv');var ejs=require(_0x5d5f('0x9'));var fs=require('fs');var fs_extra=require(_0x5d5f('0xa'));var _=require(_0x5d5f('0xb'));var squel=require(_0x5d5f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5d5f('0xd'));var querystring=require(_0x5d5f('0xe'));var Papa=require(_0x5d5f('0xf'));var Redis=require(_0x5d5f('0x10'));var authService=require(_0x5d5f('0x11'));var qs=require(_0x5d5f('0x12'));var as=require(_0x5d5f('0x13'));var hardwareService=require(_0x5d5f('0x14'));var logger=require(_0x5d5f('0x15'))(_0x5d5f('0x16'));var utils=require(_0x5d5f('0x17'));var config=require(_0x5d5f('0x18'));var licenseUtil=require(_0x5d5f('0x19'));var db=require(_0x5d5f('0x1a'))['db'];var integrations=require(_0x5d5f('0x1b'));function respondWithStatusCode(_0xf8d3fb,_0xea8faa){_0xea8faa=_0xea8faa||0xcc;return function(_0x3f78d8){if(_0x3f78d8){return _0xf8d3fb[_0x5d5f('0x1c')](_0xea8faa);}return _0xf8d3fb[_0x5d5f('0x1d')](_0xea8faa)[_0x5d5f('0x1e')]();};}function respondWithResult(_0x2d62db,_0x1fb477){_0x1fb477=_0x1fb477||0xc8;return function(_0x1a50e3){if(_0x1a50e3){return _0x2d62db[_0x5d5f('0x1d')](_0x1fb477)['json'](_0x1a50e3);}};}function respondWithFilteredResult(_0x1235dd,_0x29f241){return function(_0x12214e){if(_0x12214e){var _0x110952=typeof _0x29f241['offset']===_0x5d5f('0x1f')&&typeof _0x29f241[_0x5d5f('0x20')]===_0x5d5f('0x1f');var _0x169bb6=_0x12214e['count'];var _0x175b68=_0x110952?0x0:_0x29f241[_0x5d5f('0x21')];var _0x13bd68=_0x110952?_0x12214e[_0x5d5f('0x22')]:_0x29f241[_0x5d5f('0x21')]+_0x29f241['limit'];var _0x4de970;if(_0x13bd68>=_0x169bb6){_0x13bd68=_0x169bb6;_0x4de970=0xc8;}else{_0x4de970=0xce;}_0x1235dd[_0x5d5f('0x1d')](_0x4de970);return _0x1235dd[_0x5d5f('0x23')](_0x5d5f('0x24'),_0x175b68+'-'+_0x13bd68+'/'+_0x169bb6)[_0x5d5f('0x25')](_0x12214e);}return null;};}function patchUpdates(_0x478626){return function(_0x2cd11b){try{jsonpatch[_0x5d5f('0x26')](_0x2cd11b,_0x478626,!![]);}catch(_0x16584a){return BPromise[_0x5d5f('0x27')](_0x16584a);}return _0x2cd11b[_0x5d5f('0x28')]();};}function saveUpdates(_0x2fd153,_0x5f36e4){return function(_0x378a15){if(_0x378a15){return _0x378a15['update'](_0x2fd153)[_0x5d5f('0x29')](function(_0x4e6680){return _0x4e6680;});}return null;};}function removeEntity(_0x24cb25,_0x43a9d3){return function(_0x4cbd27){if(_0x4cbd27){return _0x4cbd27['destroy']()[_0x5d5f('0x29')](function(){_0x24cb25[_0x5d5f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc5f,_0x5a3f8f){return function(_0x47b3da){if(!_0x47b3da){_0x15dc5f['sendStatus'](0x194);}return _0x47b3da;};}function handleError(_0x524e1a,_0x4030bc){_0x4030bc=_0x4030bc||0x1f4;return function(_0x5d260e){logger['error'](_0x5d260e[_0x5d5f('0x2a')]);if(_0x5d260e[_0x5d5f('0x2b')]){delete _0x5d260e[_0x5d5f('0x2b')];}_0x524e1a[_0x5d5f('0x1d')](_0x4030bc)[_0x5d5f('0x2c')](_0x5d260e);};}exports[_0x5d5f('0x2d')]=function(_0x5de58d,_0x539cc0){var _0x3705db={},_0x40e7ed={},_0x43e2f8={'count':0x0,'rows':[]};var _0x2f96ca=_[_0x5d5f('0x2e')](db[_0x5d5f('0x2f')][_0x5d5f('0x30')],function(_0x5e2906){return{'name':_0x5e2906[_0x5d5f('0x31')],'type':_0x5e2906[_0x5d5f('0x32')][_0x5d5f('0x33')]};});_0x40e7ed[_0x5d5f('0x34')]=_[_0x5d5f('0x2e')](_0x2f96ca,_0x5d5f('0x2b'));_0x40e7ed[_0x5d5f('0x35')]=_[_0x5d5f('0x36')](_0x5de58d['query']);_0x40e7ed[_0x5d5f('0x37')]=_[_0x5d5f('0x38')](_0x40e7ed[_0x5d5f('0x34')],_0x40e7ed[_0x5d5f('0x35')]);_0x3705db[_0x5d5f('0x39')]=_[_0x5d5f('0x38')](_0x40e7ed['model'],qs['fields'](_0x5de58d['query']['fields']));_0x3705db[_0x5d5f('0x39')]=_0x3705db['attributes']['length']?_0x3705db[_0x5d5f('0x39')]:_0x40e7ed[_0x5d5f('0x34')];if(!_0x5de58d['query']['hasOwnProperty'](_0x5d5f('0x3a'))){_0x3705db[_0x5d5f('0x20')]=qs[_0x5d5f('0x20')](_0x5de58d['query'][_0x5d5f('0x20')]);_0x3705db['offset']=qs['offset'](_0x5de58d['query'][_0x5d5f('0x21')]);}_0x3705db['order']=qs[_0x5d5f('0x3b')](_0x5de58d[_0x5d5f('0x35')][_0x5d5f('0x3b')]);_0x3705db['where']=qs[_0x5d5f('0x37')](_['pick'](_0x5de58d[_0x5d5f('0x35')],_0x40e7ed[_0x5d5f('0x37')]),_0x2f96ca);if(_0x5de58d['query'][_0x5d5f('0x3c')]){_0x3705db[_0x5d5f('0x3d')]=_[_0x5d5f('0x3e')](_0x3705db[_0x5d5f('0x3d')],{'$or':_[_0x5d5f('0x2e')](_0x2f96ca,function(_0x38ddb6){if(_0x38ddb6[_0x5d5f('0x32')]!==_0x5d5f('0x3f')){var _0x2eb3a8={};_0x2eb3a8[_0x38ddb6[_0x5d5f('0x2b')]]={'$like':'%'+_0x5de58d[_0x5d5f('0x35')]['filter']+'%'};return _0x2eb3a8;}})});}_0x3705db=_['merge']({},_0x3705db,_0x5de58d[_0x5d5f('0x40')]);var _0x5b0ed0={'where':_0x3705db[_0x5d5f('0x3d')]};return db['VtigerAccount']['count'](_0x5b0ed0)[_0x5d5f('0x29')](function(_0x1cc9ee){_0x43e2f8[_0x5d5f('0x22')]=_0x1cc9ee;if(_0x5de58d['query'][_0x5d5f('0x41')]){_0x3705db[_0x5d5f('0x42')]=[{'all':!![]}];}return db[_0x5d5f('0x2f')][_0x5d5f('0x43')](_0x3705db);})[_0x5d5f('0x29')](function(_0x47f123){_0x43e2f8[_0x5d5f('0x44')]=_0x47f123;return _0x43e2f8;})[_0x5d5f('0x29')](respondWithFilteredResult(_0x539cc0,_0x3705db))['catch'](handleError(_0x539cc0,null));};exports['show']=function(_0x3e5160,_0x10b093){var _0x33a72f={'raw':![],'where':{'id':_0x3e5160['params']['id']}},_0x3efe33={};_0x3efe33[_0x5d5f('0x34')]=_[_0x5d5f('0x36')](db['VtigerAccount'][_0x5d5f('0x30')]);_0x3efe33[_0x5d5f('0x35')]=_[_0x5d5f('0x36')](_0x3e5160[_0x5d5f('0x35')]);_0x3efe33['filters']=_['intersection'](_0x3efe33[_0x5d5f('0x34')],_0x3efe33['query']);_0x33a72f[_0x5d5f('0x39')]=_[_0x5d5f('0x38')](_0x3efe33[_0x5d5f('0x34')],qs['fields'](_0x3e5160[_0x5d5f('0x35')][_0x5d5f('0x45')]));_0x33a72f['attributes']=_0x33a72f[_0x5d5f('0x39')][_0x5d5f('0x46')]?_0x33a72f[_0x5d5f('0x39')]:_0x3efe33['model'];if(_0x3e5160[_0x5d5f('0x35')][_0x5d5f('0x41')]){_0x33a72f['include']=[{'all':!![]}];}_0x33a72f=_['merge']({},_0x33a72f,_0x3e5160['options']);return db[_0x5d5f('0x2f')]['find'](_0x33a72f)[_0x5d5f('0x29')](handleEntityNotFound(_0x10b093,null))['then'](respondWithResult(_0x10b093,null))[_0x5d5f('0x47')](handleError(_0x10b093,null));};exports['create']=function(_0x58fc26,_0x3414ca){return db[_0x5d5f('0x2f')][_0x5d5f('0x48')](_0x58fc26[_0x5d5f('0x49')],{})['then'](respondWithResult(_0x3414ca,0xc9))['catch'](handleError(_0x3414ca,null));};exports[_0x5d5f('0x4a')]=function(_0xd521b3,_0xc318c9){if(_0xd521b3['body']['id']){delete _0xd521b3[_0x5d5f('0x49')]['id'];}return db[_0x5d5f('0x2f')][_0x5d5f('0x4b')]({'where':{'id':_0xd521b3[_0x5d5f('0x4c')]['id']}})[_0x5d5f('0x29')](handleEntityNotFound(_0xc318c9,null))[_0x5d5f('0x29')](saveUpdates(_0xd521b3[_0x5d5f('0x49')],null))['then'](respondWithResult(_0xc318c9,null))[_0x5d5f('0x47')](handleError(_0xc318c9,null));};exports['destroy']=function(_0x5d7e28,_0x2f6e9d){return db[_0x5d5f('0x2f')][_0x5d5f('0x4b')]({'where':{'id':_0x5d7e28[_0x5d5f('0x4c')]['id']}})[_0x5d5f('0x29')](handleEntityNotFound(_0x2f6e9d,null))[_0x5d5f('0x29')](removeEntity(_0x2f6e9d,null))[_0x5d5f('0x47')](handleError(_0x2f6e9d,null));};exports[_0x5d5f('0x4d')]=function(_0x2a181a,_0x4d1262,_0x40c915){var _0x585d26={};var _0x1e0d4b={};var _0x49d82f;var _0x2a38f5;return db[_0x5d5f('0x2f')][_0x5d5f('0x4e')]({'where':{'id':_0x2a181a[_0x5d5f('0x4c')]['id']}})[_0x5d5f('0x29')](handleEntityNotFound(_0x4d1262,null))[_0x5d5f('0x29')](function(_0xb44b27){if(_0xb44b27){_0x49d82f=_0xb44b27;_0x1e0d4b[_0x5d5f('0x34')]=_[_0x5d5f('0x36')](db[_0x5d5f('0x4f')][_0x5d5f('0x30')]);_0x1e0d4b[_0x5d5f('0x35')]=_['keys'](_0x2a181a[_0x5d5f('0x35')]);_0x1e0d4b[_0x5d5f('0x37')]=_['intersection'](_0x1e0d4b['model'],_0x1e0d4b['query']);_0x585d26[_0x5d5f('0x39')]=_[_0x5d5f('0x38')](_0x1e0d4b[_0x5d5f('0x34')],qs['fields'](_0x2a181a[_0x5d5f('0x35')][_0x5d5f('0x45')]));_0x585d26[_0x5d5f('0x39')]=_0x585d26[_0x5d5f('0x39')][_0x5d5f('0x46')]?_0x585d26[_0x5d5f('0x39')]:_0x1e0d4b[_0x5d5f('0x34')];_0x585d26[_0x5d5f('0x50')]=qs[_0x5d5f('0x3b')](_0x2a181a[_0x5d5f('0x35')]['sort']);_0x585d26['where']=qs[_0x5d5f('0x37')](_[_0x5d5f('0x51')](_0x2a181a[_0x5d5f('0x35')],_0x1e0d4b['filters']));if(_0x2a181a[_0x5d5f('0x35')][_0x5d5f('0x3c')]){_0x585d26[_0x5d5f('0x3d')]=_[_0x5d5f('0x3e')](_0x585d26[_0x5d5f('0x3d')],{'$or':_[_0x5d5f('0x2e')](_0x585d26[_0x5d5f('0x39')],function(_0x32045c){var _0x312f73={};_0x312f73[_0x32045c]={'$like':'%'+_0x2a181a['query'][_0x5d5f('0x3c')]+'%'};return _0x312f73;})});}_0x585d26=_[_0x5d5f('0x3e')]({},_0x585d26,_0x2a181a[_0x5d5f('0x40')]);return _0x49d82f[_0x5d5f('0x4d')](_0x585d26);}})[_0x5d5f('0x29')](function(_0x424165){if(_0x424165){_0x2a38f5=_0x424165[_0x5d5f('0x46')];if(!_0x2a181a['query'][_0x5d5f('0x52')](_0x5d5f('0x3a'))){_0x585d26[_0x5d5f('0x20')]=qs['limit'](_0x2a181a[_0x5d5f('0x35')][_0x5d5f('0x20')]);_0x585d26[_0x5d5f('0x21')]=qs[_0x5d5f('0x21')](_0x2a181a[_0x5d5f('0x35')]['offset']);}return _0x49d82f[_0x5d5f('0x4d')](_0x585d26);}})[_0x5d5f('0x29')](function(_0x197d17){if(_0x197d17){return _0x197d17?{'count':_0x2a38f5,'rows':_0x197d17}:null;}})[_0x5d5f('0x29')](respondWithResult(_0x4d1262,null))['catch'](handleError(_0x4d1262,null));};exports['addConfiguration']=function(_0x3ef515,_0x3e2241,_0x1490f2){if(_0x3ef515['body']['id']){delete _0x3ef515[_0x5d5f('0x49')]['id'];}return db[_0x5d5f('0x2f')][_0x5d5f('0x4e')]({'where':{'id':_0x3ef515['params']['id']}})['then'](handleEntityNotFound(_0x3e2241,null))['then'](function(_0x35d2cd){if(_0x35d2cd){_0x3ef515[_0x5d5f('0x49')]['AccountId']=_0x35d2cd['id'];_0x3ef515[_0x5d5f('0x49')][_0x5d5f('0x53')]=integrations[_0x5d5f('0x54')](_0x3ef515[_0x5d5f('0x49')][_0x5d5f('0x55')],_0x3ef515['body'][_0x5d5f('0x32')]);_0x3ef515[_0x5d5f('0x49')][_0x5d5f('0x56')]=integrations[_0x5d5f('0x57')](_0x3ef515[_0x5d5f('0x49')]['channel'],_0x3ef515[_0x5d5f('0x49')]['type']);return db[_0x5d5f('0x4f')][_0x5d5f('0x48')](_0x3ef515[_0x5d5f('0x49')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x5d5f('0x56')}]});}return null;})[_0x5d5f('0x29')](respondWithResult(_0x3e2241,null))['catch'](handleError(_0x3e2241,null));};var md5=require('md5');exports[_0x5d5f('0x58')]=function(_0x5f3c28,_0x51f491,_0x1bf100){var _0x3e1ed7=null;var _0x1fe057=null;var _0x1e68fa=null;var _0x2bf2b2=null;var _0x417475='';return db[_0x5d5f('0x2f')]['findOne']({'where':{'id':_0x5f3c28[_0x5d5f('0x4c')]['id']},'attributes':['id',_0x5d5f('0x2b'),_0x5d5f('0x59'),_0x5d5f('0x5a'),'moduleName',_0x5d5f('0x5b'),_0x5d5f('0x5c'),_0x5d5f('0x5d')]})['then'](handleEntityNotFound(_0x51f491,null))[_0x5d5f('0x29')](function(_0x56d61d){if(_0x56d61d){_0x3e1ed7=_0x56d61d['username'];_0x1fe057=_0x56d61d[_0x5d5f('0x5d')];_0x1e68fa=_0x56d61d['moduleName'];_0x417475=_0x56d61d[_0x5d5f('0x5b')];var _0x3d5a6d=_0x417475[_0x5d5f('0x5e')](-0x1);if(_0x3d5a6d==='/'){_0x417475=_0x417475[_0x5d5f('0x5f')](0x0,_0x417475[_0x5d5f('0x60')](_0x3d5a6d));}_0x2bf2b2=util[_0x5d5f('0x61')](_0x5d5f('0x62'),_0x417475);var _0x2d868c={'method':_0x5d5f('0x63'),'uri':_0x2bf2b2,'qs':{'operation':_0x5d5f('0x64'),'username':_0x56d61d[_0x5d5f('0x59')]},'json':!![]};return rp(_0x2d868c);}})[_0x5d5f('0x29')](function(_0x5c64bc){if(_0x5c64bc['success']){var _0xde195e={'method':'POST','uri':_0x2bf2b2,'form':{'operation':'login','username':_0x3e1ed7,'accessKey':md5(_0x5c64bc[_0x5d5f('0x65')][_0x5d5f('0x66')]+_0x1fe057)},'json':!![]};return rp(_0xde195e);}})[_0x5d5f('0x29')](function(_0x5345d7){if(_0x5345d7['success']){var _0x5a1289={'method':_0x5d5f('0x63'),'uri':_0x2bf2b2,'qs':{'operation':_0x5d5f('0x67'),'username':_0x3e1ed7,'sessionName':_0x5345d7['result'][_0x5d5f('0x68')],'elementType':_0x1e68fa},'json':!![]};return rp(_0x5a1289);}})[_0x5d5f('0x29')](function(_0x422270){if(_0x422270[_0x5d5f('0x69')]){var _0x20ebdc=[_0x5d5f('0x6a'),_0x5d5f('0x6b'),'owner'];_[_0x5d5f('0x6c')](_0x422270[_0x5d5f('0x65')]['fields'],function(_0x3e63a5){return _0x20ebdc[_0x5d5f('0x6d')](_0x3e63a5[_0x5d5f('0x32')][_0x5d5f('0x2b')]);});_['remove'](_0x422270['result'][_0x5d5f('0x45')],function(_0x9a142d){return _0x9a142d['editable']===_0x5d5f('0x6e');});return{'count':_0x422270['result']['fields'][_0x5d5f('0x46')],'rows':_[_0x5d5f('0x2e')](_0x422270[_0x5d5f('0x65')]['fields'],function(_0x2f45ad){return{'id':_0x2f45ad['name'],'name':_0x2f45ad[_0x5d5f('0x6f')],'custom':_[_0x5d5f('0x70')](_0x2f45ad['name'],_0x5d5f('0x71'))?!![]:![],'options':_0x2f45ad[_0x5d5f('0x32')][_0x5d5f('0x2b')]===_0x5d5f('0x72')&&_0x2f45ad[_0x5d5f('0x32')][_0x5d5f('0x73')][_0x5d5f('0x46')]>0x0?_[_0x5d5f('0x2e')](_0x2f45ad[_0x5d5f('0x32')][_0x5d5f('0x73')],function(_0x3833a4){return{'name':_0x3833a4[_0x5d5f('0x6f')],'value':_0x3833a4['value']};}):[]};})};}})['then'](respondWithResult(_0x51f491,null))[_0x5d5f('0x47')](function(_0x4b9ad0){console[_0x5d5f('0x74')](_0x5d5f('0x75')+_0x4b9ad0);var _0x54ca78=_0x5f3c28[_0x5d5f('0x35')][_0x5d5f('0x76')]?0x1f4:_0x4b9ad0['statusCode']||0x1f4;logger[_0x5d5f('0x77')](_0x5d5f('0x78'),_0x5d5f('0x58'),_0x54ca78,JSON[_0x5d5f('0x79')](_0x4b9ad0));delete _0x4b9ad0[_0x5d5f('0x2b')];if(_0x54ca78===0x191){_0x54ca78=0x190;}_0x51f491[_0x5d5f('0x1d')](_0x54ca78)['send'](_0x5f3c28[_0x5d5f('0x35')][_0x5d5f('0x76')]?{'message':_0x5d5f('0x7a'),'statusCode':_0x4b9ad0['statusCode']}:_0x4b9ad0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 57ba07a..696ad56 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 _0x8b6f=['moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x1825ea,_0x5a1518){var _0x8c04a2=function(_0x503c43){while(--_0x503c43){_0x1825ea['push'](_0x1825ea['shift']());}};_0x8c04a2(++_0x5a1518);}(_0x8b6f,0x13e));var _0xf8b6=function(_0x2276fb,_0x3e0eae){_0x2276fb=_0x2276fb-0x0;var _0x56b835=_0x8b6f[_0x2276fb];return _0x56b835;};'use strict';var _=require(_0xf8b6('0x0'));var util=require(_0xf8b6('0x1'));var logger=require(_0xf8b6('0x2'))(_0xf8b6('0x3'));var moment=require(_0xf8b6('0x4'));var BPromise=require(_0xf8b6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8b6('0x6'));var rimraf=require('rimraf');var config=require(_0xf8b6('0x7'));var attributes=require(_0xf8b6('0x8'));var integrations=require(_0xf8b6('0x9'));module[_0xf8b6('0xa')]=function(_0x184f42,_0x56c73b){return _0x184f42[_0xf8b6('0xb')](_0xf8b6('0xc'),attributes,{'tableName':_0xf8b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9b9=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd9b9,0x165));var _0x9d9b=function(_0xf58f67,_0x1f1008){_0xf58f67=_0xf58f67-0x0;var _0x1f09ea=_0xd9b9[_0xf58f67];return _0x1f09ea;};'use strict';var _=require(_0x9d9b('0x0'));var util=require(_0x9d9b('0x1'));var logger=require(_0x9d9b('0x2'))(_0x9d9b('0x3'));var moment=require(_0x9d9b('0x4'));var BPromise=require(_0x9d9b('0x5'));var rp=require(_0x9d9b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d9b('0x7'));var config=require(_0x9d9b('0x8'));var attributes=require(_0x9d9b('0x9'));var integrations=require(_0x9d9b('0xa'));module[_0x9d9b('0xb')]=function(_0x5669e8,_0x59d96b){return _0x5669e8[_0x9d9b('0xc')](_0x9d9b('0xd'),attributes,{'tableName':_0x9d9b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 7cf3c41..36ee3b6 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 _0x13f6=['debug','stringify','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5d8694,_0x12b8c2){var _0x442111=function(_0x52f1eb){while(--_0x52f1eb){_0x5d8694['push'](_0x5d8694['shift']());}};_0x442111(++_0x12b8c2);}(_0x13f6,0x124));var _0x613f=function(_0x5b687d,_0x5239fd){_0x5b687d=_0x5b687d-0x0;var _0x5c3d75=_0x13f6[_0x5b687d];return _0x5c3d75;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowVtigerAccount',_0x439478);logger[_0x613f('0xe')]('ShowVtigerAccount',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file +var _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeffd,0x6b));var _0xdeff=function(_0x25fa31,_0x72dc65){_0x25fa31=_0x25fa31-0x0;var _0x212d98=_0xeffd[_0x25fa31];return _0x212d98;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetVtigerAccount']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetVtigerAccount',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index fa327b4..bfca7b4 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 _0xb51d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x52d3a6,_0x368077){var _0x3d43e5=function(_0x5ccd83){while(--_0x5ccd83){_0x52d3a6['push'](_0x52d3a6['shift']());}};_0x3d43e5(++_0x368077);}(_0xb51d,0x1d9));var _0xdb51=function(_0x2bf1f3,_0x1d8737){_0x2bf1f3=_0x2bf1f3-0x0;var _0x3ad03c=_0xb51d[_0x2bf1f3];return _0x3ad03c;};'use strict';var multer=require(_0xdb51('0x0'));var util=require(_0xdb51('0x1'));var path=require(_0xdb51('0x2'));var timeout=require(_0xdb51('0x3'));var express=require(_0xdb51('0x4'));var router=express[_0xdb51('0x5')]();var fs_extra=require(_0xdb51('0x6'));var auth=require(_0xdb51('0x7'));var interaction=require(_0xdb51('0x8'));var config=require(_0xdb51('0x9'));var controller=require(_0xdb51('0xa'));router['get']('/',auth[_0xdb51('0xb')](),controller[_0xdb51('0xc')]);router[_0xdb51('0xd')]('/:id',auth[_0xdb51('0xb')](),controller[_0xdb51('0xe')]);router[_0xdb51('0xd')](_0xdb51('0xf'),auth[_0xdb51('0xb')](),controller[_0xdb51('0x10')]);router[_0xdb51('0xd')](_0xdb51('0x11'),auth['isAuthenticated'](),controller[_0xdb51('0x12')]);router[_0xdb51('0xd')](_0xdb51('0x13'),auth[_0xdb51('0xb')](),controller[_0xdb51('0x14')]);router[_0xdb51('0x15')]('/',auth['isAuthenticated'](),controller[_0xdb51('0x16')]);router[_0xdb51('0x17')](_0xdb51('0x18'),auth[_0xdb51('0xb')](),controller[_0xdb51('0x19')]);router['delete'](_0xdb51('0x18'),auth['isAuthenticated'](),controller[_0xdb51('0x1a')]);module[_0xdb51('0x1b')]=router; \ No newline at end of file +var _0x528c=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4d8740,_0x5354e0){var _0x45bebd=function(_0x19bbe5){while(--_0x19bbe5){_0x4d8740['push'](_0x4d8740['shift']());}};_0x45bebd(++_0x5354e0);}(_0x528c,0x19a));var _0xc528=function(_0x21b73b,_0x389295){_0x21b73b=_0x21b73b-0x0;var _0x918a42=_0x528c[_0x21b73b];return _0x918a42;};'use strict';var multer=require(_0xc528('0x0'));var util=require(_0xc528('0x1'));var path=require(_0xc528('0x2'));var timeout=require(_0xc528('0x3'));var express=require(_0xc528('0x4'));var router=express[_0xc528('0x5')]();var fs_extra=require(_0xc528('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc528('0x7'));var config=require(_0xc528('0x8'));var controller=require(_0xc528('0x9'));router['get']('/',auth[_0xc528('0xa')](),controller[_0xc528('0xb')]);router[_0xc528('0xc')](_0xc528('0xd'),auth[_0xc528('0xa')](),controller['show']);router[_0xc528('0xc')](_0xc528('0xe'),auth[_0xc528('0xa')](),controller[_0xc528('0xf')]);router[_0xc528('0xc')](_0xc528('0x10'),auth[_0xc528('0xa')](),controller[_0xc528('0x11')]);router[_0xc528('0xc')](_0xc528('0x12'),auth[_0xc528('0xa')](),controller['getDescriptions']);router[_0xc528('0x13')]('/',auth[_0xc528('0xa')](),controller[_0xc528('0x14')]);router[_0xc528('0x15')]('/:id',auth[_0xc528('0xa')](),controller[_0xc528('0x16')]);router[_0xc528('0x17')](_0xc528('0xd'),auth[_0xc528('0xa')](),controller[_0xc528('0x18')]);module[_0xc528('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 59712dc..1d672ad 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 _0xd60f=['sequelize','exports','STRING'];(function(_0x64d7cf,_0xfb45dc){var _0x173631=function(_0x38cb07){while(--_0x38cb07){_0x64d7cf['push'](_0x64d7cf['shift']());}};_0x173631(++_0xfb45dc);}(_0xd60f,0x72));var _0xfd60=function(_0x1481c4,_0x2bca76){_0x1481c4=_0x1481c4-0x0;var _0x1d9abf=_0xd60f[_0x1481c4];return _0x1d9abf;};'use strict';var Sequelize=require(_0xfd60('0x0'));module[_0xfd60('0x1')]={'name':{'type':Sequelize[_0xfd60('0x2')]},'description':{'type':Sequelize[_0xfd60('0x2')]}}; \ No newline at end of file +var _0xded6=['exports','STRING'];(function(_0x347c8c,_0x37aeed){var _0x1997a0=function(_0x53d991){while(--_0x53d991){_0x347c8c['push'](_0x347c8c['shift']());}};_0x1997a0(++_0x37aeed);}(_0xded6,0xdc));var _0x6ded=function(_0x246a9c,_0x4c8049){_0x246a9c=_0x246a9c-0x0;var _0x393e0f=_0xded6[_0x246a9c];return _0x393e0f;};'use strict';var Sequelize=require('sequelize');module[_0x6ded('0x0')]={'name':{'type':Sequelize[_0x6ded('0x1')]},'description':{'type':Sequelize[_0x6ded('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0b7b1e7..061cff7 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 _0x5c9b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','create','body','catch','getFields','pick','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis'];(function(_0x30aadd,_0x34adf4){var _0xb6cde1=function(_0x3e170a){while(--_0x3e170a){_0x30aadd['push'](_0x30aadd['shift']());}};_0xb6cde1(++_0x34adf4);}(_0x5c9b,0x13b));var _0xb5c9=function(_0x625348,_0x587c1f){_0x625348=_0x625348-0x0;var _0x43128e=_0x5c9b[_0x625348];return _0x43128e;};'use strict';var emlformat=require(_0xb5c9('0x0'));var rimraf=require(_0xb5c9('0x1'));var zipdir=require(_0xb5c9('0x2'));var jsonpatch=require(_0xb5c9('0x3'));var rp=require(_0xb5c9('0x4'));var moment=require(_0xb5c9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb5c9('0x6'));var util=require(_0xb5c9('0x7'));var path=require('path');var sox=require(_0xb5c9('0x8'));var csv=require(_0xb5c9('0x9'));var ejs=require(_0xb5c9('0xa'));var fs=require('fs');var fs_extra=require(_0xb5c9('0xb'));var _=require(_0xb5c9('0xc'));var squel=require(_0xb5c9('0xd'));var crypto=require('crypto');var jsforce=require(_0xb5c9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb5c9('0xf'));var Redis=require(_0xb5c9('0x10'));var authService=require(_0xb5c9('0x11'));var qs=require(_0xb5c9('0x12'));var as=require(_0xb5c9('0x13'));var hardwareService=require(_0xb5c9('0x14'));var logger=require(_0xb5c9('0x15'))(_0xb5c9('0x16'));var utils=require(_0xb5c9('0x17'));var config=require(_0xb5c9('0x18'));var licenseUtil=require(_0xb5c9('0x19'));var db=require(_0xb5c9('0x1a'))['db'];function respondWithStatusCode(_0x180234,_0x35ff66){_0x35ff66=_0x35ff66||0xcc;return function(_0x4a0abf){if(_0x4a0abf){return _0x180234['sendStatus'](_0x35ff66);}return _0x180234['status'](_0x35ff66)[_0xb5c9('0x1b')]();};}function respondWithResult(_0x19b581,_0x9356a4){_0x9356a4=_0x9356a4||0xc8;return function(_0x18f378){if(_0x18f378){return _0x19b581[_0xb5c9('0x1c')](_0x9356a4)[_0xb5c9('0x1d')](_0x18f378);}};}function respondWithFilteredResult(_0x1cb1e5,_0x3e67fd){return function(_0x3d403e){if(_0x3d403e){var _0x2be517=typeof _0x3e67fd[_0xb5c9('0x1e')]==='undefined'&&typeof _0x3e67fd[_0xb5c9('0x1f')]===_0xb5c9('0x20');var _0x4df8e7=_0x3d403e[_0xb5c9('0x21')];var _0x12eb18=_0x2be517?0x0:_0x3e67fd[_0xb5c9('0x1e')];var _0x516810=_0x2be517?_0x3d403e[_0xb5c9('0x21')]:_0x3e67fd['offset']+_0x3e67fd[_0xb5c9('0x1f')];var _0x296f97;if(_0x516810>=_0x4df8e7){_0x516810=_0x4df8e7;_0x296f97=0xc8;}else{_0x296f97=0xce;}_0x1cb1e5[_0xb5c9('0x1c')](_0x296f97);return _0x1cb1e5[_0xb5c9('0x22')](_0xb5c9('0x23'),_0x12eb18+'-'+_0x516810+'/'+_0x4df8e7)['json'](_0x3d403e);}return null;};}function patchUpdates(_0x222f6c){return function(_0x39b003){try{jsonpatch[_0xb5c9('0x24')](_0x39b003,_0x222f6c,!![]);}catch(_0x1de3ac){return BPromise[_0xb5c9('0x25')](_0x1de3ac);}return _0x39b003['save']();};}function saveUpdates(_0x347178,_0x56ce14){return function(_0x316736){if(_0x316736){return _0x316736[_0xb5c9('0x26')](_0x347178)[_0xb5c9('0x27')](function(_0x528e9c){return _0x528e9c;});}return null;};}function removeEntity(_0x406665,_0x24f3b7){return function(_0x3d59d7){if(_0x3d59d7){return _0x3d59d7[_0xb5c9('0x28')]()[_0xb5c9('0x27')](function(){_0x406665[_0xb5c9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7dce1a,_0x1b9f8b){return function(_0x2281af){if(!_0x2281af){_0x7dce1a[_0xb5c9('0x29')](0x194);}return _0x2281af;};}function handleError(_0x4416fd,_0x5a6cad){_0x5a6cad=_0x5a6cad||0x1f4;return function(_0x387ff3){logger[_0xb5c9('0x2a')](_0x387ff3[_0xb5c9('0x2b')]);if(_0x387ff3[_0xb5c9('0x2c')]){delete _0x387ff3[_0xb5c9('0x2c')];}_0x4416fd[_0xb5c9('0x1c')](_0x5a6cad)['send'](_0x387ff3);};}exports[_0xb5c9('0x2d')]=function(_0xca267f,_0x57335d){var _0x19846f={},_0x56537d={},_0x1bf54a={'count':0x0,'rows':[]};var _0x345547=_[_0xb5c9('0x2e')](db[_0xb5c9('0x2f')][_0xb5c9('0x30')],function(_0x56186a){return{'name':_0x56186a[_0xb5c9('0x31')],'type':_0x56186a[_0xb5c9('0x32')][_0xb5c9('0x33')]};});_0x56537d[_0xb5c9('0x34')]=_[_0xb5c9('0x2e')](_0x345547,_0xb5c9('0x2c'));_0x56537d['query']=_[_0xb5c9('0x35')](_0xca267f['query']);_0x56537d[_0xb5c9('0x36')]=_[_0xb5c9('0x37')](_0x56537d[_0xb5c9('0x34')],_0x56537d[_0xb5c9('0x38')]);_0x19846f[_0xb5c9('0x39')]=_[_0xb5c9('0x37')](_0x56537d[_0xb5c9('0x34')],qs[_0xb5c9('0x3a')](_0xca267f[_0xb5c9('0x38')][_0xb5c9('0x3a')]));_0x19846f[_0xb5c9('0x39')]=_0x19846f[_0xb5c9('0x39')]['length']?_0x19846f['attributes']:_0x56537d['model'];if(!_0xca267f[_0xb5c9('0x38')][_0xb5c9('0x3b')](_0xb5c9('0x3c'))){_0x19846f[_0xb5c9('0x1f')]=qs[_0xb5c9('0x1f')](_0xca267f['query']['limit']);_0x19846f[_0xb5c9('0x1e')]=qs['offset'](_0xca267f[_0xb5c9('0x38')][_0xb5c9('0x1e')]);}_0x19846f[_0xb5c9('0x3d')]=qs[_0xb5c9('0x3e')](_0xca267f[_0xb5c9('0x38')]['sort']);_0x19846f[_0xb5c9('0x3f')]=qs['filters'](_['pick'](_0xca267f[_0xb5c9('0x38')],_0x56537d['filters']),_0x345547);if(_0xca267f[_0xb5c9('0x38')]['filter']){_0x19846f[_0xb5c9('0x3f')]=_[_0xb5c9('0x40')](_0x19846f[_0xb5c9('0x3f')],{'$or':_['map'](_0x345547,function(_0xecec1e){if(_0xecec1e[_0xb5c9('0x32')]!==_0xb5c9('0x41')){var _0x2aa18e={};_0x2aa18e[_0xecec1e['name']]={'$like':'%'+_0xca267f[_0xb5c9('0x38')][_0xb5c9('0x42')]+'%'};return _0x2aa18e;}})});}_0x19846f=_[_0xb5c9('0x40')]({},_0x19846f,_0xca267f[_0xb5c9('0x43')]);var _0x94d351={'where':_0x19846f[_0xb5c9('0x3f')]};return db[_0xb5c9('0x2f')][_0xb5c9('0x21')](_0x94d351)['then'](function(_0x1586ae){_0x1bf54a[_0xb5c9('0x21')]=_0x1586ae;if(_0xca267f[_0xb5c9('0x38')][_0xb5c9('0x44')]){_0x19846f[_0xb5c9('0x45')]=[{'all':!![]}];}return db[_0xb5c9('0x2f')][_0xb5c9('0x46')](_0x19846f);})[_0xb5c9('0x27')](function(_0x50f94c){_0x1bf54a['rows']=_0x50f94c;return _0x1bf54a;})['then'](respondWithFilteredResult(_0x57335d,_0x19846f))['catch'](handleError(_0x57335d,null));};exports[_0xb5c9('0x47')]=function(_0x37b544,_0x42ae01){var _0x31a1ff={'raw':![],'where':{'id':_0x37b544[_0xb5c9('0x48')]['id']}},_0x330bee={};_0x330bee[_0xb5c9('0x34')]=_[_0xb5c9('0x35')](db[_0xb5c9('0x2f')][_0xb5c9('0x30')]);_0x330bee[_0xb5c9('0x38')]=_['keys'](_0x37b544[_0xb5c9('0x38')]);_0x330bee[_0xb5c9('0x36')]=_[_0xb5c9('0x37')](_0x330bee[_0xb5c9('0x34')],_0x330bee[_0xb5c9('0x38')]);_0x31a1ff[_0xb5c9('0x39')]=_[_0xb5c9('0x37')](_0x330bee[_0xb5c9('0x34')],qs[_0xb5c9('0x3a')](_0x37b544[_0xb5c9('0x38')]['fields']));_0x31a1ff['attributes']=_0x31a1ff[_0xb5c9('0x39')][_0xb5c9('0x49')]?_0x31a1ff[_0xb5c9('0x39')]:_0x330bee[_0xb5c9('0x34')];if(_0x37b544['query']['includeAll']){_0x31a1ff[_0xb5c9('0x45')]=[{'all':!![]}];}_0x31a1ff=_['merge']({},_0x31a1ff,_0x37b544[_0xb5c9('0x43')]);return db[_0xb5c9('0x2f')]['find'](_0x31a1ff)[_0xb5c9('0x27')](handleEntityNotFound(_0x42ae01,null))[_0xb5c9('0x27')](respondWithResult(_0x42ae01,null))['catch'](handleError(_0x42ae01,null));};exports[_0xb5c9('0x4a')]=function(_0x2b1988,_0x4acb6f){return db[_0xb5c9('0x2f')]['create'](_0x2b1988[_0xb5c9('0x4b')],{})[_0xb5c9('0x27')](respondWithResult(_0x4acb6f,0xc9))['catch'](handleError(_0x4acb6f,null));};exports[_0xb5c9('0x26')]=function(_0x41ccad,_0x13f7de){if(_0x41ccad[_0xb5c9('0x4b')]['id']){delete _0x41ccad[_0xb5c9('0x4b')]['id'];}return db[_0xb5c9('0x2f')]['find']({'where':{'id':_0x41ccad[_0xb5c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x13f7de,null))[_0xb5c9('0x27')](saveUpdates(_0x41ccad[_0xb5c9('0x4b')],null))[_0xb5c9('0x27')](respondWithResult(_0x13f7de,null))[_0xb5c9('0x4c')](handleError(_0x13f7de,null));};exports[_0xb5c9('0x28')]=function(_0x43afc8,_0x52e96a){return db[_0xb5c9('0x2f')]['find']({'where':{'id':_0x43afc8[_0xb5c9('0x48')]['id']}})[_0xb5c9('0x27')](handleEntityNotFound(_0x52e96a,null))[_0xb5c9('0x27')](removeEntity(_0x52e96a,null))[_0xb5c9('0x4c')](handleError(_0x52e96a,null));};exports[_0xb5c9('0x4d')]=function(_0x2ef856,_0x14b5f5,_0xef1ed2){var _0x1b6022={};var _0xbe2be4={};var _0x24b995;var _0x54af4d;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2ef856[_0xb5c9('0x48')]['id']}})[_0xb5c9('0x27')](handleEntityNotFound(_0x14b5f5,null))[_0xb5c9('0x27')](function(_0x27cdbc){if(_0x27cdbc){_0x24b995=_0x27cdbc;_0xbe2be4['model']=_[_0xb5c9('0x35')](db['VtigerField'][_0xb5c9('0x30')]);_0xbe2be4[_0xb5c9('0x38')]=_[_0xb5c9('0x35')](_0x2ef856[_0xb5c9('0x38')]);_0xbe2be4[_0xb5c9('0x36')]=_['intersection'](_0xbe2be4[_0xb5c9('0x34')],_0xbe2be4[_0xb5c9('0x38')]);_0x1b6022[_0xb5c9('0x39')]=_[_0xb5c9('0x37')](_0xbe2be4[_0xb5c9('0x34')],qs[_0xb5c9('0x3a')](_0x2ef856['query']['fields']));_0x1b6022[_0xb5c9('0x39')]=_0x1b6022['attributes'][_0xb5c9('0x49')]?_0x1b6022[_0xb5c9('0x39')]:_0xbe2be4[_0xb5c9('0x34')];_0x1b6022['order']=qs[_0xb5c9('0x3e')](_0x2ef856[_0xb5c9('0x38')][_0xb5c9('0x3e')]);_0x1b6022['where']=qs['filters'](_[_0xb5c9('0x4e')](_0x2ef856[_0xb5c9('0x38')],_0xbe2be4[_0xb5c9('0x36')]));if(_0x2ef856[_0xb5c9('0x38')][_0xb5c9('0x42')]){_0x1b6022['where']=_[_0xb5c9('0x40')](_0x1b6022[_0xb5c9('0x3f')],{'$or':_['map'](_0x1b6022[_0xb5c9('0x39')],function(_0x57e1b0){var _0x683a88={};_0x683a88[_0x57e1b0]={'$like':'%'+_0x2ef856[_0xb5c9('0x38')][_0xb5c9('0x42')]+'%'};return _0x683a88;})});}_0x1b6022=_[_0xb5c9('0x40')]({},_0x1b6022,_0x2ef856['options']);return _0x24b995[_0xb5c9('0x4d')](_0x1b6022);}})[_0xb5c9('0x27')](function(_0x5280da){if(_0x5280da){_0x54af4d=_0x5280da['length'];if(!_0x2ef856[_0xb5c9('0x38')][_0xb5c9('0x3b')](_0xb5c9('0x3c'))){_0x1b6022[_0xb5c9('0x1f')]=qs[_0xb5c9('0x1f')](_0x2ef856[_0xb5c9('0x38')][_0xb5c9('0x1f')]);_0x1b6022[_0xb5c9('0x1e')]=qs[_0xb5c9('0x1e')](_0x2ef856['query']['offset']);}return _0x24b995[_0xb5c9('0x4d')](_0x1b6022);}})[_0xb5c9('0x27')](function(_0x4dcbed){if(_0x4dcbed){return _0x4dcbed?{'count':_0x54af4d,'rows':_0x4dcbed}:null;}})['then'](respondWithResult(_0x14b5f5,null))[_0xb5c9('0x4c')](handleError(_0x14b5f5,null));};exports['getSubjects']=function(_0x21392b,_0x5e09a3,_0x507a5e){var _0x4187dc={};var _0x38e0c0={};var _0x1511fe;var _0xbd3e66;return db[_0xb5c9('0x2f')][_0xb5c9('0x4f')]({'where':{'id':_0x21392b['params']['id']}})[_0xb5c9('0x27')](handleEntityNotFound(_0x5e09a3,null))[_0xb5c9('0x27')](function(_0x39e71c){if(_0x39e71c){_0x1511fe=_0x39e71c;_0x38e0c0[_0xb5c9('0x34')]=_[_0xb5c9('0x35')](db[_0xb5c9('0x50')]['rawAttributes']);_0x38e0c0[_0xb5c9('0x38')]=_[_0xb5c9('0x35')](_0x21392b[_0xb5c9('0x38')]);_0x38e0c0[_0xb5c9('0x36')]=_[_0xb5c9('0x37')](_0x38e0c0[_0xb5c9('0x34')],_0x38e0c0[_0xb5c9('0x38')]);_0x4187dc[_0xb5c9('0x39')]=_['intersection'](_0x38e0c0['model'],qs[_0xb5c9('0x3a')](_0x21392b[_0xb5c9('0x38')][_0xb5c9('0x3a')]));_0x4187dc['attributes']=_0x4187dc[_0xb5c9('0x39')]['length']?_0x4187dc[_0xb5c9('0x39')]:_0x38e0c0[_0xb5c9('0x34')];_0x4187dc[_0xb5c9('0x3d')]=qs[_0xb5c9('0x3e')](_0x21392b[_0xb5c9('0x38')][_0xb5c9('0x3e')]);_0x4187dc[_0xb5c9('0x3f')]=qs[_0xb5c9('0x36')](_[_0xb5c9('0x4e')](_0x21392b[_0xb5c9('0x38')],_0x38e0c0[_0xb5c9('0x36')]));if(_0x21392b[_0xb5c9('0x38')][_0xb5c9('0x42')]){_0x4187dc['where']=_[_0xb5c9('0x40')](_0x4187dc[_0xb5c9('0x3f')],{'$or':_[_0xb5c9('0x2e')](_0x4187dc[_0xb5c9('0x39')],function(_0x3f1787){var _0x1f88ce={};_0x1f88ce[_0x3f1787]={'$like':'%'+_0x21392b[_0xb5c9('0x38')]['filter']+'%'};return _0x1f88ce;})});}_0x4187dc=_[_0xb5c9('0x40')]({},_0x4187dc,_0x21392b['options']);return _0x1511fe[_0xb5c9('0x51')](_0x4187dc);}})[_0xb5c9('0x27')](function(_0x2c21bb){if(_0x2c21bb){_0xbd3e66=_0x2c21bb['length'];if(!_0x21392b['query'][_0xb5c9('0x3b')]('nolimit')){_0x4187dc['limit']=qs[_0xb5c9('0x1f')](_0x21392b[_0xb5c9('0x38')][_0xb5c9('0x1f')]);_0x4187dc['offset']=qs[_0xb5c9('0x1e')](_0x21392b[_0xb5c9('0x38')]['offset']);}return _0x1511fe[_0xb5c9('0x51')](_0x4187dc);}})['then'](function(_0x1dd01f){if(_0x1dd01f){return _0x1dd01f?{'count':_0xbd3e66,'rows':_0x1dd01f}:null;}})[_0xb5c9('0x27')](respondWithResult(_0x5e09a3,null))['catch'](handleError(_0x5e09a3,null));};exports[_0xb5c9('0x52')]=function(_0x2b33f0,_0x3f1ad2,_0x5c55e8){var _0x10ceb2={};var _0x5ae4f4={};var _0xd0c25d;var _0x3f918e;return db[_0xb5c9('0x2f')][_0xb5c9('0x4f')]({'where':{'id':_0x2b33f0[_0xb5c9('0x48')]['id']}})[_0xb5c9('0x27')](handleEntityNotFound(_0x3f1ad2,null))['then'](function(_0x4a3faf){if(_0x4a3faf){_0xd0c25d=_0x4a3faf;_0x5ae4f4[_0xb5c9('0x34')]=_[_0xb5c9('0x35')](db['VtigerField']['rawAttributes']);_0x5ae4f4['query']=_[_0xb5c9('0x35')](_0x2b33f0['query']);_0x5ae4f4['filters']=_['intersection'](_0x5ae4f4[_0xb5c9('0x34')],_0x5ae4f4[_0xb5c9('0x38')]);_0x10ceb2[_0xb5c9('0x39')]=_[_0xb5c9('0x37')](_0x5ae4f4['model'],qs[_0xb5c9('0x3a')](_0x2b33f0[_0xb5c9('0x38')]['fields']));_0x10ceb2[_0xb5c9('0x39')]=_0x10ceb2[_0xb5c9('0x39')][_0xb5c9('0x49')]?_0x10ceb2['attributes']:_0x5ae4f4[_0xb5c9('0x34')];_0x10ceb2[_0xb5c9('0x3d')]=qs[_0xb5c9('0x3e')](_0x2b33f0[_0xb5c9('0x38')][_0xb5c9('0x3e')]);_0x10ceb2['where']=qs[_0xb5c9('0x36')](_[_0xb5c9('0x4e')](_0x2b33f0['query'],_0x5ae4f4[_0xb5c9('0x36')]));if(_0x2b33f0['query'][_0xb5c9('0x42')]){_0x10ceb2['where']=_[_0xb5c9('0x40')](_0x10ceb2[_0xb5c9('0x3f')],{'$or':_[_0xb5c9('0x2e')](_0x10ceb2[_0xb5c9('0x39')],function(_0x570f03){var _0x2f5998={};_0x2f5998[_0x570f03]={'$like':'%'+_0x2b33f0['query'][_0xb5c9('0x42')]+'%'};return _0x2f5998;})});}_0x10ceb2=_[_0xb5c9('0x40')]({},_0x10ceb2,_0x2b33f0[_0xb5c9('0x43')]);return _0xd0c25d[_0xb5c9('0x52')](_0x10ceb2);}})[_0xb5c9('0x27')](function(_0x38f00b){if(_0x38f00b){_0x3f918e=_0x38f00b[_0xb5c9('0x49')];if(!_0x2b33f0[_0xb5c9('0x38')]['hasOwnProperty'](_0xb5c9('0x3c'))){_0x10ceb2[_0xb5c9('0x1f')]=qs[_0xb5c9('0x1f')](_0x2b33f0[_0xb5c9('0x38')][_0xb5c9('0x1f')]);_0x10ceb2[_0xb5c9('0x1e')]=qs[_0xb5c9('0x1e')](_0x2b33f0[_0xb5c9('0x38')][_0xb5c9('0x1e')]);}return _0xd0c25d[_0xb5c9('0x52')](_0x10ceb2);}})[_0xb5c9('0x27')](function(_0x8e658d){if(_0x8e658d){return _0x8e658d?{'count':_0x3f918e,'rows':_0x8e658d}:null;}})[_0xb5c9('0x27')](respondWithResult(_0x3f1ad2,null))[_0xb5c9('0x4c')](handleError(_0x3f1ad2,null));}; \ No newline at end of file +var _0x7f8b=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','index','map','VtigerConfiguration','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','rawAttributes','find','body','catch','params','getFields','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x12ce0f,_0x394e74){var _0x5836ad=function(_0x483419){while(--_0x483419){_0x12ce0f['push'](_0x12ce0f['shift']());}};_0x5836ad(++_0x394e74);}(_0x7f8b,0x1ca));var _0xb7f8=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7f8b[_0x556927];return _0x5f1235;};'use strict';var emlformat=require(_0xb7f8('0x0'));var rimraf=require(_0xb7f8('0x1'));var zipdir=require(_0xb7f8('0x2'));var jsonpatch=require(_0xb7f8('0x3'));var rp=require('request-promise');var moment=require(_0xb7f8('0x4'));var BPromise=require(_0xb7f8('0x5'));var Mustache=require(_0xb7f8('0x6'));var util=require(_0xb7f8('0x7'));var path=require(_0xb7f8('0x8'));var sox=require(_0xb7f8('0x9'));var csv=require('to-csv');var ejs=require(_0xb7f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb7f8('0xb'));var crypto=require(_0xb7f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb7f8('0xd'));var toCsv=require(_0xb7f8('0xe'));var querystring=require(_0xb7f8('0xf'));var Papa=require('papaparse');var Redis=require(_0xb7f8('0x10'));var authService=require(_0xb7f8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb7f8('0x12'));var hardwareService=require(_0xb7f8('0x13'));var logger=require(_0xb7f8('0x14'))(_0xb7f8('0x15'));var utils=require(_0xb7f8('0x16'));var config=require(_0xb7f8('0x17'));var licenseUtil=require(_0xb7f8('0x18'));var db=require(_0xb7f8('0x19'))['db'];function respondWithStatusCode(_0x9e972,_0x54c4de){_0x54c4de=_0x54c4de||0xcc;return function(_0x1527eb){if(_0x1527eb){return _0x9e972[_0xb7f8('0x1a')](_0x54c4de);}return _0x9e972[_0xb7f8('0x1b')](_0x54c4de)[_0xb7f8('0x1c')]();};}function respondWithResult(_0x37d31c,_0x567ba5){_0x567ba5=_0x567ba5||0xc8;return function(_0x28608f){if(_0x28608f){return _0x37d31c[_0xb7f8('0x1b')](_0x567ba5)[_0xb7f8('0x1d')](_0x28608f);}};}function respondWithFilteredResult(_0x5b9706,_0x1a6a96){return function(_0x4bfb8d){if(_0x4bfb8d){var _0x5c6405=typeof _0x1a6a96[_0xb7f8('0x1e')]===_0xb7f8('0x1f')&&typeof _0x1a6a96[_0xb7f8('0x20')]===_0xb7f8('0x1f');var _0x1ded74=_0x4bfb8d['count'];var _0xfc7fba=_0x5c6405?0x0:_0x1a6a96[_0xb7f8('0x1e')];var _0x131b8f=_0x5c6405?_0x4bfb8d[_0xb7f8('0x21')]:_0x1a6a96['offset']+_0x1a6a96[_0xb7f8('0x20')];var _0x2a347b;if(_0x131b8f>=_0x1ded74){_0x131b8f=_0x1ded74;_0x2a347b=0xc8;}else{_0x2a347b=0xce;}_0x5b9706['status'](_0x2a347b);return _0x5b9706[_0xb7f8('0x22')](_0xb7f8('0x23'),_0xfc7fba+'-'+_0x131b8f+'/'+_0x1ded74)[_0xb7f8('0x1d')](_0x4bfb8d);}return null;};}function patchUpdates(_0x430e88){return function(_0x4e223b){try{jsonpatch[_0xb7f8('0x24')](_0x4e223b,_0x430e88,!![]);}catch(_0x4d0ef2){return BPromise['reject'](_0x4d0ef2);}return _0x4e223b[_0xb7f8('0x25')]();};}function saveUpdates(_0x9df876,_0x52353a){return function(_0x21891e){if(_0x21891e){return _0x21891e[_0xb7f8('0x26')](_0x9df876)['then'](function(_0x4e0ec2){return _0x4e0ec2;});}return null;};}function removeEntity(_0x52f5ab,_0xe551f0){return function(_0x5f06cc){if(_0x5f06cc){return _0x5f06cc[_0xb7f8('0x27')]()[_0xb7f8('0x28')](function(){_0x52f5ab[_0xb7f8('0x1b')](0xcc)[_0xb7f8('0x1c')]();});}};}function handleEntityNotFound(_0x510cda,_0x3d30e8){return function(_0x267a27){if(!_0x267a27){_0x510cda['sendStatus'](0x194);}return _0x267a27;};}function handleError(_0x23ec8c,_0x39ff72){_0x39ff72=_0x39ff72||0x1f4;return function(_0x3feac4){logger['error'](_0x3feac4[_0xb7f8('0x29')]);if(_0x3feac4[_0xb7f8('0x2a')]){delete _0x3feac4[_0xb7f8('0x2a')];}_0x23ec8c[_0xb7f8('0x1b')](_0x39ff72)['send'](_0x3feac4);};}exports[_0xb7f8('0x2b')]=function(_0x5b25bf,_0xaac8b7){var _0xdfc403={},_0x888218={},_0x1bb03b={'count':0x0,'rows':[]};var _0x5326aa=_[_0xb7f8('0x2c')](db[_0xb7f8('0x2d')]['rawAttributes'],function(_0x35811a){return{'name':_0x35811a[_0xb7f8('0x2e')],'type':_0x35811a[_0xb7f8('0x2f')][_0xb7f8('0x30')]};});_0x888218['model']=_[_0xb7f8('0x2c')](_0x5326aa,_0xb7f8('0x2a'));_0x888218[_0xb7f8('0x31')]=_[_0xb7f8('0x32')](_0x5b25bf['query']);_0x888218[_0xb7f8('0x33')]=_[_0xb7f8('0x34')](_0x888218['model'],_0x888218[_0xb7f8('0x31')]);_0xdfc403['attributes']=_[_0xb7f8('0x34')](_0x888218[_0xb7f8('0x35')],qs[_0xb7f8('0x36')](_0x5b25bf[_0xb7f8('0x31')][_0xb7f8('0x36')]));_0xdfc403[_0xb7f8('0x37')]=_0xdfc403[_0xb7f8('0x37')][_0xb7f8('0x38')]?_0xdfc403['attributes']:_0x888218['model'];if(!_0x5b25bf['query'][_0xb7f8('0x39')](_0xb7f8('0x3a'))){_0xdfc403[_0xb7f8('0x20')]=qs[_0xb7f8('0x20')](_0x5b25bf[_0xb7f8('0x31')][_0xb7f8('0x20')]);_0xdfc403[_0xb7f8('0x1e')]=qs['offset'](_0x5b25bf[_0xb7f8('0x31')][_0xb7f8('0x1e')]);}_0xdfc403[_0xb7f8('0x3b')]=qs[_0xb7f8('0x3c')](_0x5b25bf[_0xb7f8('0x31')][_0xb7f8('0x3c')]);_0xdfc403['where']=qs[_0xb7f8('0x33')](_[_0xb7f8('0x3d')](_0x5b25bf[_0xb7f8('0x31')],_0x888218[_0xb7f8('0x33')]),_0x5326aa);if(_0x5b25bf[_0xb7f8('0x31')]['filter']){_0xdfc403[_0xb7f8('0x3e')]=_[_0xb7f8('0x3f')](_0xdfc403[_0xb7f8('0x3e')],{'$or':_[_0xb7f8('0x2c')](_0x5326aa,function(_0x2508b6){if(_0x2508b6[_0xb7f8('0x2f')]!==_0xb7f8('0x40')){var _0x350c0b={};_0x350c0b[_0x2508b6[_0xb7f8('0x2a')]]={'$like':'%'+_0x5b25bf['query'][_0xb7f8('0x41')]+'%'};return _0x350c0b;}})});}_0xdfc403=_[_0xb7f8('0x3f')]({},_0xdfc403,_0x5b25bf[_0xb7f8('0x42')]);var _0x13971b={'where':_0xdfc403['where']};return db[_0xb7f8('0x2d')][_0xb7f8('0x21')](_0x13971b)['then'](function(_0x292457){_0x1bb03b[_0xb7f8('0x21')]=_0x292457;if(_0x5b25bf[_0xb7f8('0x31')]['includeAll']){_0xdfc403[_0xb7f8('0x43')]=[{'all':!![]}];}return db[_0xb7f8('0x2d')][_0xb7f8('0x44')](_0xdfc403);})[_0xb7f8('0x28')](function(_0x3ef4ef){_0x1bb03b[_0xb7f8('0x45')]=_0x3ef4ef;return _0x1bb03b;})[_0xb7f8('0x28')](respondWithFilteredResult(_0xaac8b7,_0xdfc403))['catch'](handleError(_0xaac8b7,null));};exports['show']=function(_0xf4ca57,_0x917bb5){var _0x1849a8={'raw':![],'where':{'id':_0xf4ca57['params']['id']}},_0x2252ba={};_0x2252ba[_0xb7f8('0x35')]=_['keys'](db['VtigerConfiguration'][_0xb7f8('0x46')]);_0x2252ba[_0xb7f8('0x31')]=_[_0xb7f8('0x32')](_0xf4ca57[_0xb7f8('0x31')]);_0x2252ba[_0xb7f8('0x33')]=_['intersection'](_0x2252ba[_0xb7f8('0x35')],_0x2252ba[_0xb7f8('0x31')]);_0x1849a8[_0xb7f8('0x37')]=_[_0xb7f8('0x34')](_0x2252ba['model'],qs['fields'](_0xf4ca57['query'][_0xb7f8('0x36')]));_0x1849a8[_0xb7f8('0x37')]=_0x1849a8[_0xb7f8('0x37')][_0xb7f8('0x38')]?_0x1849a8['attributes']:_0x2252ba['model'];if(_0xf4ca57['query']['includeAll']){_0x1849a8[_0xb7f8('0x43')]=[{'all':!![]}];}_0x1849a8=_[_0xb7f8('0x3f')]({},_0x1849a8,_0xf4ca57[_0xb7f8('0x42')]);return db[_0xb7f8('0x2d')][_0xb7f8('0x47')](_0x1849a8)[_0xb7f8('0x28')](handleEntityNotFound(_0x917bb5,null))[_0xb7f8('0x28')](respondWithResult(_0x917bb5,null))['catch'](handleError(_0x917bb5,null));};exports['create']=function(_0x3b3a96,_0x53d0a1){return db[_0xb7f8('0x2d')]['create'](_0x3b3a96[_0xb7f8('0x48')],{})[_0xb7f8('0x28')](respondWithResult(_0x53d0a1,0xc9))[_0xb7f8('0x49')](handleError(_0x53d0a1,null));};exports['update']=function(_0x226ece,_0x37e815){if(_0x226ece[_0xb7f8('0x48')]['id']){delete _0x226ece['body']['id'];}return db[_0xb7f8('0x2d')][_0xb7f8('0x47')]({'where':{'id':_0x226ece['params']['id']}})[_0xb7f8('0x28')](handleEntityNotFound(_0x37e815,null))[_0xb7f8('0x28')](saveUpdates(_0x226ece['body'],null))[_0xb7f8('0x28')](respondWithResult(_0x37e815,null))[_0xb7f8('0x49')](handleError(_0x37e815,null));};exports['destroy']=function(_0x3ade98,_0x307549){return db[_0xb7f8('0x2d')]['find']({'where':{'id':_0x3ade98[_0xb7f8('0x4a')]['id']}})[_0xb7f8('0x28')](handleEntityNotFound(_0x307549,null))[_0xb7f8('0x28')](removeEntity(_0x307549,null))['catch'](handleError(_0x307549,null));};exports[_0xb7f8('0x4b')]=function(_0x5890c5,_0x3bf12a,_0x278e15){var _0x28f0a2={};var _0x324803={};var _0x26e592;var _0x497c28;return db[_0xb7f8('0x2d')][_0xb7f8('0x4c')]({'where':{'id':_0x5890c5[_0xb7f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3bf12a,null))[_0xb7f8('0x28')](function(_0x31e783){if(_0x31e783){_0x26e592=_0x31e783;_0x324803['model']=_[_0xb7f8('0x32')](db['VtigerField'][_0xb7f8('0x46')]);_0x324803['query']=_['keys'](_0x5890c5[_0xb7f8('0x31')]);_0x324803[_0xb7f8('0x33')]=_[_0xb7f8('0x34')](_0x324803[_0xb7f8('0x35')],_0x324803[_0xb7f8('0x31')]);_0x28f0a2['attributes']=_[_0xb7f8('0x34')](_0x324803[_0xb7f8('0x35')],qs[_0xb7f8('0x36')](_0x5890c5[_0xb7f8('0x31')][_0xb7f8('0x36')]));_0x28f0a2[_0xb7f8('0x37')]=_0x28f0a2[_0xb7f8('0x37')][_0xb7f8('0x38')]?_0x28f0a2[_0xb7f8('0x37')]:_0x324803['model'];_0x28f0a2[_0xb7f8('0x3b')]=qs['sort'](_0x5890c5[_0xb7f8('0x31')]['sort']);_0x28f0a2['where']=qs[_0xb7f8('0x33')](_[_0xb7f8('0x3d')](_0x5890c5[_0xb7f8('0x31')],_0x324803[_0xb7f8('0x33')]));if(_0x5890c5[_0xb7f8('0x31')][_0xb7f8('0x41')]){_0x28f0a2[_0xb7f8('0x3e')]=_[_0xb7f8('0x3f')](_0x28f0a2['where'],{'$or':_[_0xb7f8('0x2c')](_0x28f0a2[_0xb7f8('0x37')],function(_0x5559c4){var _0x2d71c7={};_0x2d71c7[_0x5559c4]={'$like':'%'+_0x5890c5[_0xb7f8('0x31')]['filter']+'%'};return _0x2d71c7;})});}_0x28f0a2=_[_0xb7f8('0x3f')]({},_0x28f0a2,_0x5890c5[_0xb7f8('0x42')]);return _0x26e592[_0xb7f8('0x4b')](_0x28f0a2);}})[_0xb7f8('0x28')](function(_0x3f4ad1){if(_0x3f4ad1){_0x497c28=_0x3f4ad1[_0xb7f8('0x38')];if(!_0x5890c5[_0xb7f8('0x31')]['hasOwnProperty'](_0xb7f8('0x3a'))){_0x28f0a2[_0xb7f8('0x20')]=qs[_0xb7f8('0x20')](_0x5890c5[_0xb7f8('0x31')]['limit']);_0x28f0a2[_0xb7f8('0x1e')]=qs[_0xb7f8('0x1e')](_0x5890c5['query'][_0xb7f8('0x1e')]);}return _0x26e592['getFields'](_0x28f0a2);}})['then'](function(_0x1570ee){if(_0x1570ee){return _0x1570ee?{'count':_0x497c28,'rows':_0x1570ee}:null;}})[_0xb7f8('0x28')](respondWithResult(_0x3bf12a,null))[_0xb7f8('0x49')](handleError(_0x3bf12a,null));};exports[_0xb7f8('0x4d')]=function(_0x118b72,_0x195fa2,_0x7cd9a7){var _0x22c699={};var _0x46db48={};var _0xe2a842;var _0x2850e0;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x118b72[_0xb7f8('0x4a')]['id']}})[_0xb7f8('0x28')](handleEntityNotFound(_0x195fa2,null))[_0xb7f8('0x28')](function(_0xa0329b){if(_0xa0329b){_0xe2a842=_0xa0329b;_0x46db48[_0xb7f8('0x35')]=_['keys'](db[_0xb7f8('0x4e')][_0xb7f8('0x46')]);_0x46db48[_0xb7f8('0x31')]=_[_0xb7f8('0x32')](_0x118b72['query']);_0x46db48[_0xb7f8('0x33')]=_['intersection'](_0x46db48[_0xb7f8('0x35')],_0x46db48[_0xb7f8('0x31')]);_0x22c699[_0xb7f8('0x37')]=_[_0xb7f8('0x34')](_0x46db48[_0xb7f8('0x35')],qs[_0xb7f8('0x36')](_0x118b72[_0xb7f8('0x31')][_0xb7f8('0x36')]));_0x22c699[_0xb7f8('0x37')]=_0x22c699['attributes'][_0xb7f8('0x38')]?_0x22c699[_0xb7f8('0x37')]:_0x46db48[_0xb7f8('0x35')];_0x22c699[_0xb7f8('0x3b')]=qs[_0xb7f8('0x3c')](_0x118b72[_0xb7f8('0x31')][_0xb7f8('0x3c')]);_0x22c699[_0xb7f8('0x3e')]=qs[_0xb7f8('0x33')](_[_0xb7f8('0x3d')](_0x118b72[_0xb7f8('0x31')],_0x46db48[_0xb7f8('0x33')]));if(_0x118b72[_0xb7f8('0x31')][_0xb7f8('0x41')]){_0x22c699['where']=_['merge'](_0x22c699[_0xb7f8('0x3e')],{'$or':_[_0xb7f8('0x2c')](_0x22c699[_0xb7f8('0x37')],function(_0x2044b0){var _0x1f2f8b={};_0x1f2f8b[_0x2044b0]={'$like':'%'+_0x118b72[_0xb7f8('0x31')]['filter']+'%'};return _0x1f2f8b;})});}_0x22c699=_[_0xb7f8('0x3f')]({},_0x22c699,_0x118b72[_0xb7f8('0x42')]);return _0xe2a842[_0xb7f8('0x4d')](_0x22c699);}})[_0xb7f8('0x28')](function(_0x216f2f){if(_0x216f2f){_0x2850e0=_0x216f2f[_0xb7f8('0x38')];if(!_0x118b72[_0xb7f8('0x31')][_0xb7f8('0x39')](_0xb7f8('0x3a'))){_0x22c699[_0xb7f8('0x20')]=qs['limit'](_0x118b72['query']['limit']);_0x22c699[_0xb7f8('0x1e')]=qs[_0xb7f8('0x1e')](_0x118b72[_0xb7f8('0x31')][_0xb7f8('0x1e')]);}return _0xe2a842[_0xb7f8('0x4d')](_0x22c699);}})[_0xb7f8('0x28')](function(_0x26bd7c){if(_0x26bd7c){return _0x26bd7c?{'count':_0x2850e0,'rows':_0x26bd7c}:null;}})['then'](respondWithResult(_0x195fa2,null))[_0xb7f8('0x49')](handleError(_0x195fa2,null));};exports[_0xb7f8('0x4f')]=function(_0x6ba80,_0x1c010f,_0x406cf9){var _0x2ca7ed={};var _0x2463f3={};var _0x336f63;var _0x5bf8f9;return db[_0xb7f8('0x2d')]['findOne']({'where':{'id':_0x6ba80['params']['id']}})[_0xb7f8('0x28')](handleEntityNotFound(_0x1c010f,null))['then'](function(_0x3e0187){if(_0x3e0187){_0x336f63=_0x3e0187;_0x2463f3['model']=_[_0xb7f8('0x32')](db['VtigerField']['rawAttributes']);_0x2463f3[_0xb7f8('0x31')]=_[_0xb7f8('0x32')](_0x6ba80[_0xb7f8('0x31')]);_0x2463f3[_0xb7f8('0x33')]=_['intersection'](_0x2463f3[_0xb7f8('0x35')],_0x2463f3[_0xb7f8('0x31')]);_0x2ca7ed[_0xb7f8('0x37')]=_['intersection'](_0x2463f3[_0xb7f8('0x35')],qs['fields'](_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x36')]));_0x2ca7ed[_0xb7f8('0x37')]=_0x2ca7ed[_0xb7f8('0x37')][_0xb7f8('0x38')]?_0x2ca7ed[_0xb7f8('0x37')]:_0x2463f3[_0xb7f8('0x35')];_0x2ca7ed['order']=qs['sort'](_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x3c')]);_0x2ca7ed['where']=qs[_0xb7f8('0x33')](_[_0xb7f8('0x3d')](_0x6ba80[_0xb7f8('0x31')],_0x2463f3['filters']));if(_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x41')]){_0x2ca7ed[_0xb7f8('0x3e')]=_[_0xb7f8('0x3f')](_0x2ca7ed['where'],{'$or':_[_0xb7f8('0x2c')](_0x2ca7ed[_0xb7f8('0x37')],function(_0x3678f2){var _0x193ef5={};_0x193ef5[_0x3678f2]={'$like':'%'+_0x6ba80[_0xb7f8('0x31')]['filter']+'%'};return _0x193ef5;})});}_0x2ca7ed=_[_0xb7f8('0x3f')]({},_0x2ca7ed,_0x6ba80['options']);return _0x336f63[_0xb7f8('0x4f')](_0x2ca7ed);}})['then'](function(_0xb3d61a){if(_0xb3d61a){_0x5bf8f9=_0xb3d61a[_0xb7f8('0x38')];if(!_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x39')](_0xb7f8('0x3a'))){_0x2ca7ed[_0xb7f8('0x20')]=qs[_0xb7f8('0x20')](_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x20')]);_0x2ca7ed[_0xb7f8('0x1e')]=qs['offset'](_0x6ba80[_0xb7f8('0x31')][_0xb7f8('0x1e')]);}return _0x336f63[_0xb7f8('0x4f')](_0x2ca7ed);}})[_0xb7f8('0x28')](function(_0x13926e){if(_0x13926e){return _0x13926e?{'count':_0x5bf8f9,'rows':_0x13926e}:null;}})[_0xb7f8('0x28')](respondWithResult(_0x1c010f,null))[_0xb7f8('0x49')](handleError(_0x1c010f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 530c4d2..3258317 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 _0x9498=['define','VtigerConfiguration','int_vtiger_configurations','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x3562f5,_0x25803e){var _0x16e532=function(_0x30de29){while(--_0x30de29){_0x3562f5['push'](_0x3562f5['shift']());}};_0x16e532(++_0x25803e);}(_0x9498,0x1dc));var _0x8949=function(_0x2e4e93,_0xd629ee){_0x2e4e93=_0x2e4e93-0x0;var _0x5d6815=_0x9498[_0x2e4e93];return _0x5d6815;};'use strict';var _=require('lodash');var util=require(_0x8949('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8949('0x1'));var BPromise=require(_0x8949('0x2'));var rp=require(_0x8949('0x3'));var fs=require('fs');var path=require(_0x8949('0x4'));var rimraf=require(_0x8949('0x5'));var config=require(_0x8949('0x6'));var attributes=require(_0x8949('0x7'));module['exports']=function(_0x4948d2,_0x2a137d){return _0x4948d2[_0x8949('0x8')](_0x8949('0x9'),attributes,{'tableName':_0x8949('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35ce=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x388092,_0x1ee4c0){var _0x202172=function(_0x3e263d){while(--_0x3e263d){_0x388092['push'](_0x388092['shift']());}};_0x202172(++_0x1ee4c0);}(_0x35ce,0x1bf));var _0xe35c=function(_0x2ee62d,_0xeaba9d){_0x2ee62d=_0x2ee62d-0x0;var _0x5609cd=_0x35ce[_0x2ee62d];return _0x5609cd;};'use strict';var _=require(_0xe35c('0x0'));var util=require(_0xe35c('0x1'));var logger=require(_0xe35c('0x2'))(_0xe35c('0x3'));var moment=require(_0xe35c('0x4'));var BPromise=require(_0xe35c('0x5'));var rp=require(_0xe35c('0x6'));var fs=require('fs');var path=require(_0xe35c('0x7'));var rimraf=require(_0xe35c('0x8'));var config=require(_0xe35c('0x9'));var attributes=require(_0xe35c('0xa'));module[_0xe35c('0xb')]=function(_0x9a2008,_0x556083){return _0x9a2008['define'](_0xe35c('0xc'),attributes,{'tableName':_0xe35c('0xd'),'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 59a58b0..064a822 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 _0xee3f=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x4ae592,_0x5523e0){var _0x5e47f8=function(_0x1b77cf){while(--_0x1b77cf){_0x4ae592['push'](_0x4ae592['shift']());}};_0x5e47f8(++_0x5523e0);}(_0xee3f,0x109));var _0xfee3=function(_0x4fb23b,_0x1540cf){_0x4fb23b=_0x4fb23b-0x0;var _0x9b3d9a=_0xee3f[_0x4fb23b];return _0x9b3d9a;};'use strict';var _=require('lodash');var util=require(_0xfee3('0x0'));var moment=require(_0xfee3('0x1'));var BPromise=require(_0xfee3('0x2'));var rs=require(_0xfee3('0x3'));var fs=require('fs');var Redis=require(_0xfee3('0x4'));var db=require(_0xfee3('0x5'))['db'];var utils=require(_0xfee3('0x6'));var logger=require(_0xfee3('0x7'))(_0xfee3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541646,_0x556b32,_0x24f26a){return new BPromise(function(_0x21f44e,_0x4d15a1){return client[_0xfee3('0xa')](_0x541646,_0x24f26a)[_0xfee3('0xb')](function(_0x6fca4c){logger['info'](_0xfee3('0xc'),_0x556b32,_0xfee3('0xd'));logger[_0xfee3('0xe')](_0xfee3('0xf'),_0x556b32,'request\x20sent',JSON['stringify'](_0x6fca4c));if(_0x6fca4c[_0xfee3('0x10')]){if(_0x6fca4c['error'][_0xfee3('0x11')]===0x1f4){logger[_0xfee3('0x10')](_0xfee3('0xc'),_0x556b32,_0x6fca4c[_0xfee3('0x10')]['message']);return _0x4d15a1(_0x6fca4c['error']['message']);}logger[_0xfee3('0x10')](_0xfee3('0xc'),_0x556b32,_0x6fca4c[_0xfee3('0x10')][_0xfee3('0x12')]);return _0x21f44e(_0x6fca4c[_0xfee3('0x10')]['message']);}else{logger[_0xfee3('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x556b32,_0xfee3('0xd'));_0x21f44e(_0x6fca4c[_0xfee3('0x14')][_0xfee3('0x12')]);}})[_0xfee3('0x15')](function(_0x30ec27){logger[_0xfee3('0x10')](_0xfee3('0xc'),_0x556b32,_0x30ec27);_0x4d15a1(_0x30ec27);});});} \ No newline at end of file +var _0xb3a4=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x22f84c,_0x150580){var _0x30794a=function(_0x49e35b){while(--_0x49e35b){_0x22f84c['push'](_0x22f84c['shift']());}};_0x30794a(++_0x150580);}(_0xb3a4,0xb1));var _0x4b3a=function(_0x1e3429,_0x54fa5d){_0x1e3429=_0x1e3429-0x0;var _0x450c47=_0xb3a4[_0x1e3429];return _0x450c47;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b3a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b3a('0x1'))['db'];var utils=require(_0x4b3a('0x2'));var logger=require(_0x4b3a('0x3'))(_0x4b3a('0x4'));var config=require(_0x4b3a('0x5'));var jayson=require(_0x4b3a('0x6'));var client=jayson[_0x4b3a('0x7')][_0x4b3a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e4d48,_0x3ec045,_0x5c6aac){return new BPromise(function(_0x413f94,_0x46cbc6){return client[_0x4b3a('0x9')](_0x5e4d48,_0x5c6aac)[_0x4b3a('0xa')](function(_0x261003){logger[_0x4b3a('0xb')](_0x4b3a('0xc'),_0x3ec045,_0x4b3a('0xd'));logger[_0x4b3a('0xe')](_0x4b3a('0xf'),_0x3ec045,_0x4b3a('0xd'),JSON[_0x4b3a('0x10')](_0x261003));if(_0x261003[_0x4b3a('0x11')]){if(_0x261003[_0x4b3a('0x11')]['code']===0x1f4){logger['error'](_0x4b3a('0xc'),_0x3ec045,_0x261003[_0x4b3a('0x11')][_0x4b3a('0x12')]);return _0x46cbc6(_0x261003[_0x4b3a('0x11')][_0x4b3a('0x12')]);}logger[_0x4b3a('0x11')](_0x4b3a('0xc'),_0x3ec045,_0x261003[_0x4b3a('0x11')][_0x4b3a('0x12')]);return _0x413f94(_0x261003['error'][_0x4b3a('0x12')]);}else{logger[_0x4b3a('0xb')](_0x4b3a('0xc'),_0x3ec045,'request\x20sent');_0x413f94(_0x261003[_0x4b3a('0x13')]['message']);}})[_0x4b3a('0x14')](function(_0x2cdcb9){logger[_0x4b3a('0x11')](_0x4b3a('0xc'),_0x3ec045,_0x2cdcb9);_0x46cbc6(_0x2cdcb9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d3d47a5..51a31e6 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 _0xefef=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','create','put','isAuthenticated','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xefef,0x129));var _0xfefe=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xefef[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0xfefe('0x0'));var util=require(_0xfefe('0x1'));var path=require(_0xfefe('0x2'));var timeout=require(_0xfefe('0x3'));var express=require(_0xfefe('0x4'));var router=express[_0xfefe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfefe('0x6'));var interaction=require(_0xfefe('0x7'));var config=require(_0xfefe('0x8'));var controller=require('./intVtigerField.controller');router[_0xfefe('0x9')]('/',auth['isAuthenticated'](),controller[_0xfefe('0xa')]);router[_0xfefe('0x9')](_0xfefe('0xb'),auth['isAuthenticated'](),controller[_0xfefe('0xc')]);router[_0xfefe('0xd')]('/',auth['isAuthenticated'](),controller[_0xfefe('0xe')]);router[_0xfefe('0xf')](_0xfefe('0xb'),auth[_0xfefe('0x10')](),controller[_0xfefe('0x11')]);router[_0xfefe('0x12')](_0xfefe('0xb'),auth[_0xfefe('0x10')](),controller[_0xfefe('0x13')]);module[_0xfefe('0x14')]=router; \ No newline at end of file +var _0x77a9=['express','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x417357,_0x510671){var _0x363811=function(_0xf3bb84){while(--_0xf3bb84){_0x417357['push'](_0x417357['shift']());}};_0x363811(++_0x510671);}(_0x77a9,0x185));var _0x977a=function(_0x381796,_0x4eb447){_0x381796=_0x381796-0x0;var _0xa3964=_0x77a9[_0x381796];return _0xa3964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x977a('0x0'));var timeout=require(_0x977a('0x1'));var express=require(_0x977a('0x2'));var router=express[_0x977a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x977a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x977a('0x5'));var controller=require(_0x977a('0x6'));router['get']('/',auth[_0x977a('0x7')](),controller[_0x977a('0x8')]);router['get']('/:id',auth[_0x977a('0x7')](),controller[_0x977a('0x9')]);router['post']('/',auth[_0x977a('0x7')](),controller[_0x977a('0xa')]);router[_0x977a('0xb')](_0x977a('0xc'),auth[_0x977a('0x7')](),controller[_0x977a('0xd')]);router[_0x977a('0xe')](_0x977a('0xc'),auth[_0x977a('0x7')](),controller[_0x977a('0xf')]);module[_0x977a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index bdc3970..126020e 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 _0x1218=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5b5f70,_0xc951e6){var _0x3affc7=function(_0x449708){while(--_0x449708){_0x5b5f70['push'](_0x5b5f70['shift']());}};_0x3affc7(++_0xc951e6);}(_0x1218,0x15a));var _0x8121=function(_0x563ff2,_0x58103c){_0x563ff2=_0x563ff2-0x0;var _0x1642d0=_0x1218[_0x563ff2];return _0x1642d0;};'use strict';var Sequelize=require(_0x8121('0x0'));module[_0x8121('0x1')]={'type':{'type':Sequelize[_0x8121('0x2')](_0x8121('0x3'),_0x8121('0x4'),'customVariable','keyValue',_0x8121('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8121('0x6')]},'keyType':{'type':Sequelize[_0x8121('0x2')](_0x8121('0x3'),_0x8121('0x4'),_0x8121('0x7'))},'keyContent':{'type':Sequelize[_0x8121('0x6')]},'idField':{'type':Sequelize[_0x8121('0x6')]},'nameField':{'type':Sequelize[_0x8121('0x6')]},'customField':{'type':Sequelize[_0x8121('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8121('0x6')]}}; \ No newline at end of file +var _0xb84d=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0x34a436,_0x16f123){var _0x285656=function(_0x497155){while(--_0x497155){_0x34a436['push'](_0x34a436['shift']());}};_0x285656(++_0x16f123);}(_0xb84d,0xd6));var _0xdb84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb84d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdb84('0x0'));module['exports']={'type':{'type':Sequelize[_0xdb84('0x1')](_0xdb84('0x2'),'variable',_0xdb84('0x3'),_0xdb84('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdb84('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdb84('0x1')]('string',_0xdb84('0x6'),_0xdb84('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdb84('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdb84('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7083e0b..ac20e8a 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 _0x7c23=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5791de,_0x258ae9){var _0x2fc059=function(_0x51dcfe){while(--_0x51dcfe){_0x5791de['push'](_0x5791de['shift']());}};_0x2fc059(++_0x258ae9);}(_0x7c23,0x124));var _0x37c2=function(_0x5a3ff5,_0x102eea){_0x5a3ff5=_0x5a3ff5-0x0;var _0xe2034a=_0x7c23[_0x5a3ff5];return _0xe2034a;};'use strict';var emlformat=require(_0x37c2('0x0'));var rimraf=require(_0x37c2('0x1'));var zipdir=require(_0x37c2('0x2'));var jsonpatch=require(_0x37c2('0x3'));var rp=require('request-promise');var moment=require(_0x37c2('0x4'));var BPromise=require(_0x37c2('0x5'));var Mustache=require('mustache');var util=require(_0x37c2('0x6'));var path=require(_0x37c2('0x7'));var sox=require(_0x37c2('0x8'));var csv=require(_0x37c2('0x9'));var ejs=require(_0x37c2('0xa'));var fs=require('fs');var fs_extra=require(_0x37c2('0xb'));var _=require(_0x37c2('0xc'));var squel=require('squel');var crypto=require(_0x37c2('0xd'));var jsforce=require(_0x37c2('0xe'));var deskjs=require(_0x37c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x37c2('0x10'));var Papa=require(_0x37c2('0x11'));var Redis=require('ioredis');var authService=require(_0x37c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x37c2('0x13'));var hardwareService=require(_0x37c2('0x14'));var logger=require('../../config/logger')(_0x37c2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249856,_0xe1bcee){_0xe1bcee=_0xe1bcee||0xcc;return function(_0x5e6745){if(_0x5e6745){return _0x249856[_0x37c2('0x16')](_0xe1bcee);}return _0x249856[_0x37c2('0x17')](_0xe1bcee)[_0x37c2('0x18')]();};}function respondWithResult(_0x2a5856,_0x13391a){_0x13391a=_0x13391a||0xc8;return function(_0x3eabe4){if(_0x3eabe4){return _0x2a5856[_0x37c2('0x17')](_0x13391a)['json'](_0x3eabe4);}};}function respondWithFilteredResult(_0x51b6fa,_0x2cb7ea){return function(_0x2547da){if(_0x2547da){var _0x3560dc=typeof _0x2cb7ea[_0x37c2('0x19')]===_0x37c2('0x1a')&&typeof _0x2cb7ea[_0x37c2('0x1b')]===_0x37c2('0x1a');var _0x4fad39=_0x2547da[_0x37c2('0x1c')];var _0x6e28ae=_0x3560dc?0x0:_0x2cb7ea[_0x37c2('0x19')];var _0xa91ece=_0x3560dc?_0x2547da[_0x37c2('0x1c')]:_0x2cb7ea[_0x37c2('0x19')]+_0x2cb7ea[_0x37c2('0x1b')];var _0x419f0e;if(_0xa91ece>=_0x4fad39){_0xa91ece=_0x4fad39;_0x419f0e=0xc8;}else{_0x419f0e=0xce;}_0x51b6fa[_0x37c2('0x17')](_0x419f0e);return _0x51b6fa[_0x37c2('0x1d')](_0x37c2('0x1e'),_0x6e28ae+'-'+_0xa91ece+'/'+_0x4fad39)[_0x37c2('0x1f')](_0x2547da);}return null;};}function patchUpdates(_0x6cdd78){return function(_0x5e853d){try{jsonpatch[_0x37c2('0x20')](_0x5e853d,_0x6cdd78,!![]);}catch(_0x15b872){return BPromise['reject'](_0x15b872);}return _0x5e853d[_0x37c2('0x21')]();};}function saveUpdates(_0x40ca7e,_0x578121){return function(_0x835d97){if(_0x835d97){return _0x835d97[_0x37c2('0x22')](_0x40ca7e)[_0x37c2('0x23')](function(_0x27e886){return _0x27e886;});}return null;};}function removeEntity(_0x573a23,_0x4f0712){return function(_0x3fe765){if(_0x3fe765){return _0x3fe765[_0x37c2('0x24')]()['then'](function(){_0x573a23[_0x37c2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfffeb2,_0x5a4e13){return function(_0x276039){if(!_0x276039){_0xfffeb2[_0x37c2('0x16')](0x194);}return _0x276039;};}function handleError(_0x243336,_0x1f57e){_0x1f57e=_0x1f57e||0x1f4;return function(_0x2b4fbc){logger[_0x37c2('0x25')](_0x2b4fbc[_0x37c2('0x26')]);if(_0x2b4fbc[_0x37c2('0x27')]){delete _0x2b4fbc['name'];}_0x243336[_0x37c2('0x17')](_0x1f57e)['send'](_0x2b4fbc);};}exports['index']=function(_0x59aefb,_0x24bf08){var _0x4c0e4b={},_0x448dbe={},_0x54abcf={'count':0x0,'rows':[]};var _0x4cc10c=_[_0x37c2('0x28')](db[_0x37c2('0x29')][_0x37c2('0x2a')],function(_0xbb2d68){return{'name':_0xbb2d68[_0x37c2('0x2b')],'type':_0xbb2d68[_0x37c2('0x2c')][_0x37c2('0x2d')]};});_0x448dbe['model']=_[_0x37c2('0x28')](_0x4cc10c,_0x37c2('0x27'));_0x448dbe[_0x37c2('0x2e')]=_[_0x37c2('0x2f')](_0x59aefb['query']);_0x448dbe[_0x37c2('0x30')]=_['intersection'](_0x448dbe['model'],_0x448dbe[_0x37c2('0x2e')]);_0x4c0e4b[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0x448dbe['model'],qs[_0x37c2('0x33')](_0x59aefb['query']['fields']));_0x4c0e4b['attributes']=_0x4c0e4b[_0x37c2('0x31')][_0x37c2('0x34')]?_0x4c0e4b[_0x37c2('0x31')]:_0x448dbe[_0x37c2('0x35')];if(!_0x59aefb['query'][_0x37c2('0x36')](_0x37c2('0x37'))){_0x4c0e4b['limit']=qs[_0x37c2('0x1b')](_0x59aefb[_0x37c2('0x2e')]['limit']);_0x4c0e4b['offset']=qs[_0x37c2('0x19')](_0x59aefb[_0x37c2('0x2e')][_0x37c2('0x19')]);}_0x4c0e4b[_0x37c2('0x38')]=qs[_0x37c2('0x39')](_0x59aefb['query'][_0x37c2('0x39')]);_0x4c0e4b['where']=qs[_0x37c2('0x30')](_[_0x37c2('0x3a')](_0x59aefb['query'],_0x448dbe[_0x37c2('0x30')]),_0x4cc10c);if(_0x59aefb[_0x37c2('0x2e')][_0x37c2('0x3b')]){_0x4c0e4b[_0x37c2('0x3c')]=_[_0x37c2('0x3d')](_0x4c0e4b[_0x37c2('0x3c')],{'$or':_[_0x37c2('0x28')](_0x4cc10c,function(_0xa318d3){if(_0xa318d3[_0x37c2('0x2c')]!==_0x37c2('0x3e')){var _0x2c6bde={};_0x2c6bde[_0xa318d3[_0x37c2('0x27')]]={'$like':'%'+_0x59aefb[_0x37c2('0x2e')][_0x37c2('0x3b')]+'%'};return _0x2c6bde;}})});}_0x4c0e4b=_[_0x37c2('0x3d')]({},_0x4c0e4b,_0x59aefb[_0x37c2('0x3f')]);var _0x4a2490={'where':_0x4c0e4b[_0x37c2('0x3c')]};return db[_0x37c2('0x29')][_0x37c2('0x1c')](_0x4a2490)[_0x37c2('0x23')](function(_0x113734){_0x54abcf[_0x37c2('0x1c')]=_0x113734;if(_0x59aefb[_0x37c2('0x2e')]['includeAll']){_0x4c0e4b[_0x37c2('0x40')]=[{'all':!![]}];}return db[_0x37c2('0x29')][_0x37c2('0x41')](_0x4c0e4b);})[_0x37c2('0x23')](function(_0x26400c){_0x54abcf[_0x37c2('0x42')]=_0x26400c;return _0x54abcf;})['then'](respondWithFilteredResult(_0x24bf08,_0x4c0e4b))[_0x37c2('0x43')](handleError(_0x24bf08,null));};exports[_0x37c2('0x44')]=function(_0x322c52,_0x5c7ab8){var _0x176408={'raw':!![],'where':{'id':_0x322c52[_0x37c2('0x45')]['id']}},_0x1cb096={};_0x1cb096['model']=_['keys'](db['VtigerField'][_0x37c2('0x2a')]);_0x1cb096[_0x37c2('0x2e')]=_['keys'](_0x322c52[_0x37c2('0x2e')]);_0x1cb096['filters']=_['intersection'](_0x1cb096[_0x37c2('0x35')],_0x1cb096[_0x37c2('0x2e')]);_0x176408[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0x1cb096[_0x37c2('0x35')],qs[_0x37c2('0x33')](_0x322c52[_0x37c2('0x2e')][_0x37c2('0x33')]));_0x176408['attributes']=_0x176408[_0x37c2('0x31')][_0x37c2('0x34')]?_0x176408[_0x37c2('0x31')]:_0x1cb096[_0x37c2('0x35')];if(_0x322c52[_0x37c2('0x2e')][_0x37c2('0x46')]){_0x176408[_0x37c2('0x40')]=[{'all':!![]}];}_0x176408=_[_0x37c2('0x3d')]({},_0x176408,_0x322c52[_0x37c2('0x3f')]);return db['VtigerField']['find'](_0x176408)[_0x37c2('0x23')](handleEntityNotFound(_0x5c7ab8,null))[_0x37c2('0x23')](respondWithResult(_0x5c7ab8,null))[_0x37c2('0x43')](handleError(_0x5c7ab8,null));};exports[_0x37c2('0x47')]=function(_0x16dd8b,_0x571fc2){return db['VtigerField'][_0x37c2('0x47')](_0x16dd8b[_0x37c2('0x48')],{})[_0x37c2('0x23')](respondWithResult(_0x571fc2,0xc9))['catch'](handleError(_0x571fc2,null));};exports[_0x37c2('0x22')]=function(_0x4f0000,_0x37b1b3){if(_0x4f0000[_0x37c2('0x48')]['id']){delete _0x4f0000['body']['id'];}return db[_0x37c2('0x29')][_0x37c2('0x49')]({'where':{'id':_0x4f0000[_0x37c2('0x45')]['id']}})[_0x37c2('0x23')](handleEntityNotFound(_0x37b1b3,null))['then'](saveUpdates(_0x4f0000[_0x37c2('0x48')],null))[_0x37c2('0x23')](respondWithResult(_0x37b1b3,null))['catch'](handleError(_0x37b1b3,null));};exports[_0x37c2('0x24')]=function(_0x2f24d1,_0x2de2b3){return db[_0x37c2('0x29')][_0x37c2('0x49')]({'where':{'id':_0x2f24d1[_0x37c2('0x45')]['id']}})[_0x37c2('0x23')](handleEntityNotFound(_0x2de2b3,null))[_0x37c2('0x23')](removeEntity(_0x2de2b3,null))[_0x37c2('0x43')](handleError(_0x2de2b3,null));}; \ No newline at end of file +var _0x8b41=['json','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','VtigerField','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range'];(function(_0x202c99,_0x43d358){var _0x49a549=function(_0x585b01){while(--_0x585b01){_0x202c99['push'](_0x202c99['shift']());}};_0x49a549(++_0x43d358);}(_0x8b41,0x1eb));var _0x18b4=function(_0xe189e7,_0x323442){_0xe189e7=_0xe189e7-0x0;var _0x2168a6=_0x8b41[_0xe189e7];return _0x2168a6;};'use strict';var emlformat=require(_0x18b4('0x0'));var rimraf=require(_0x18b4('0x1'));var zipdir=require(_0x18b4('0x2'));var jsonpatch=require(_0x18b4('0x3'));var rp=require(_0x18b4('0x4'));var moment=require(_0x18b4('0x5'));var BPromise=require(_0x18b4('0x6'));var Mustache=require(_0x18b4('0x7'));var util=require(_0x18b4('0x8'));var path=require(_0x18b4('0x9'));var sox=require(_0x18b4('0xa'));var csv=require(_0x18b4('0xb'));var ejs=require(_0x18b4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18b4('0xd'));var squel=require(_0x18b4('0xe'));var crypto=require(_0x18b4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x18b4('0x10'));var toCsv=require(_0x18b4('0xb'));var querystring=require(_0x18b4('0x11'));var Papa=require(_0x18b4('0x12'));var Redis=require(_0x18b4('0x13'));var authService=require(_0x18b4('0x14'));var qs=require(_0x18b4('0x15'));var as=require(_0x18b4('0x16'));var hardwareService=require(_0x18b4('0x17'));var logger=require(_0x18b4('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x18b4('0x19'));var licenseUtil=require(_0x18b4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ff9a3,_0x7099c5){_0x7099c5=_0x7099c5||0xcc;return function(_0x27c75c){if(_0x27c75c){return _0x2ff9a3[_0x18b4('0x1b')](_0x7099c5);}return _0x2ff9a3['status'](_0x7099c5)['end']();};}function respondWithResult(_0x6bc34a,_0x5e2565){_0x5e2565=_0x5e2565||0xc8;return function(_0x4ebd7d){if(_0x4ebd7d){return _0x6bc34a[_0x18b4('0x1c')](_0x5e2565)['json'](_0x4ebd7d);}};}function respondWithFilteredResult(_0x198e1b,_0x5d92a2){return function(_0x2120a3){if(_0x2120a3){var _0x54dad1=typeof _0x5d92a2[_0x18b4('0x1d')]===_0x18b4('0x1e')&&typeof _0x5d92a2[_0x18b4('0x1f')]===_0x18b4('0x1e');var _0x2398be=_0x2120a3['count'];var _0x51906c=_0x54dad1?0x0:_0x5d92a2[_0x18b4('0x1d')];var _0x544b43=_0x54dad1?_0x2120a3[_0x18b4('0x20')]:_0x5d92a2[_0x18b4('0x1d')]+_0x5d92a2['limit'];var _0x460d9f;if(_0x544b43>=_0x2398be){_0x544b43=_0x2398be;_0x460d9f=0xc8;}else{_0x460d9f=0xce;}_0x198e1b['status'](_0x460d9f);return _0x198e1b['set'](_0x18b4('0x21'),_0x51906c+'-'+_0x544b43+'/'+_0x2398be)[_0x18b4('0x22')](_0x2120a3);}return null;};}function patchUpdates(_0x4eb0be){return function(_0x38e378){try{jsonpatch['apply'](_0x38e378,_0x4eb0be,!![]);}catch(_0x424137){return BPromise[_0x18b4('0x23')](_0x424137);}return _0x38e378[_0x18b4('0x24')]();};}function saveUpdates(_0x2c08f6,_0x3a4e7e){return function(_0x1a9087){if(_0x1a9087){return _0x1a9087[_0x18b4('0x25')](_0x2c08f6)[_0x18b4('0x26')](function(_0x311c20){return _0x311c20;});}return null;};}function removeEntity(_0x40fc83,_0x4532f1){return function(_0x280e56){if(_0x280e56){return _0x280e56[_0x18b4('0x27')]()[_0x18b4('0x26')](function(){_0x40fc83[_0x18b4('0x1c')](0xcc)[_0x18b4('0x28')]();});}};}function handleEntityNotFound(_0x1e74b7,_0x3aa1b1){return function(_0x150e7b){if(!_0x150e7b){_0x1e74b7[_0x18b4('0x1b')](0x194);}return _0x150e7b;};}function handleError(_0x90c716,_0x5bccb8){_0x5bccb8=_0x5bccb8||0x1f4;return function(_0x3a77ee){logger['error'](_0x3a77ee[_0x18b4('0x29')]);if(_0x3a77ee[_0x18b4('0x2a')]){delete _0x3a77ee[_0x18b4('0x2a')];}_0x90c716[_0x18b4('0x1c')](_0x5bccb8)[_0x18b4('0x2b')](_0x3a77ee);};}exports[_0x18b4('0x2c')]=function(_0x213382,_0x426664){var _0x1b11b0={},_0x3e6fd1={},_0x46ef54={'count':0x0,'rows':[]};var _0x17a1f6=_[_0x18b4('0x2d')](db['VtigerField'][_0x18b4('0x2e')],function(_0x8b93b8){return{'name':_0x8b93b8['fieldName'],'type':_0x8b93b8[_0x18b4('0x2f')][_0x18b4('0x30')]};});_0x3e6fd1['model']=_[_0x18b4('0x2d')](_0x17a1f6,_0x18b4('0x2a'));_0x3e6fd1[_0x18b4('0x31')]=_[_0x18b4('0x32')](_0x213382[_0x18b4('0x31')]);_0x3e6fd1[_0x18b4('0x33')]=_['intersection'](_0x3e6fd1[_0x18b4('0x34')],_0x3e6fd1[_0x18b4('0x31')]);_0x1b11b0[_0x18b4('0x35')]=_[_0x18b4('0x36')](_0x3e6fd1['model'],qs['fields'](_0x213382[_0x18b4('0x31')][_0x18b4('0x37')]));_0x1b11b0[_0x18b4('0x35')]=_0x1b11b0[_0x18b4('0x35')][_0x18b4('0x38')]?_0x1b11b0[_0x18b4('0x35')]:_0x3e6fd1[_0x18b4('0x34')];if(!_0x213382[_0x18b4('0x31')][_0x18b4('0x39')](_0x18b4('0x3a'))){_0x1b11b0[_0x18b4('0x1f')]=qs[_0x18b4('0x1f')](_0x213382[_0x18b4('0x31')][_0x18b4('0x1f')]);_0x1b11b0[_0x18b4('0x1d')]=qs[_0x18b4('0x1d')](_0x213382[_0x18b4('0x31')][_0x18b4('0x1d')]);}_0x1b11b0['order']=qs['sort'](_0x213382[_0x18b4('0x31')][_0x18b4('0x3b')]);_0x1b11b0[_0x18b4('0x3c')]=qs[_0x18b4('0x33')](_['pick'](_0x213382[_0x18b4('0x31')],_0x3e6fd1[_0x18b4('0x33')]),_0x17a1f6);if(_0x213382[_0x18b4('0x31')][_0x18b4('0x3d')]){_0x1b11b0[_0x18b4('0x3c')]=_['merge'](_0x1b11b0[_0x18b4('0x3c')],{'$or':_[_0x18b4('0x2d')](_0x17a1f6,function(_0x76bd2e){if(_0x76bd2e[_0x18b4('0x2f')]!==_0x18b4('0x3e')){var _0x5521bd={};_0x5521bd[_0x76bd2e[_0x18b4('0x2a')]]={'$like':'%'+_0x213382[_0x18b4('0x31')][_0x18b4('0x3d')]+'%'};return _0x5521bd;}})});}_0x1b11b0=_[_0x18b4('0x3f')]({},_0x1b11b0,_0x213382['options']);var _0x4f3f2a={'where':_0x1b11b0[_0x18b4('0x3c')]};return db['VtigerField'][_0x18b4('0x20')](_0x4f3f2a)[_0x18b4('0x26')](function(_0x3f00b5){_0x46ef54[_0x18b4('0x20')]=_0x3f00b5;if(_0x213382[_0x18b4('0x31')][_0x18b4('0x40')]){_0x1b11b0[_0x18b4('0x41')]=[{'all':!![]}];}return db[_0x18b4('0x42')][_0x18b4('0x43')](_0x1b11b0);})[_0x18b4('0x26')](function(_0x5b3a9c){_0x46ef54['rows']=_0x5b3a9c;return _0x46ef54;})[_0x18b4('0x26')](respondWithFilteredResult(_0x426664,_0x1b11b0))[_0x18b4('0x44')](handleError(_0x426664,null));};exports[_0x18b4('0x45')]=function(_0x3f187b,_0x32aeea){var _0xdd9032={'raw':!![],'where':{'id':_0x3f187b['params']['id']}},_0x58a126={};_0x58a126[_0x18b4('0x34')]=_[_0x18b4('0x32')](db['VtigerField']['rawAttributes']);_0x58a126[_0x18b4('0x31')]=_[_0x18b4('0x32')](_0x3f187b[_0x18b4('0x31')]);_0x58a126[_0x18b4('0x33')]=_[_0x18b4('0x36')](_0x58a126[_0x18b4('0x34')],_0x58a126[_0x18b4('0x31')]);_0xdd9032[_0x18b4('0x35')]=_[_0x18b4('0x36')](_0x58a126[_0x18b4('0x34')],qs['fields'](_0x3f187b['query']['fields']));_0xdd9032[_0x18b4('0x35')]=_0xdd9032[_0x18b4('0x35')]['length']?_0xdd9032[_0x18b4('0x35')]:_0x58a126[_0x18b4('0x34')];if(_0x3f187b[_0x18b4('0x31')]['includeAll']){_0xdd9032['include']=[{'all':!![]}];}_0xdd9032=_['merge']({},_0xdd9032,_0x3f187b[_0x18b4('0x46')]);return db[_0x18b4('0x42')][_0x18b4('0x47')](_0xdd9032)[_0x18b4('0x26')](handleEntityNotFound(_0x32aeea,null))[_0x18b4('0x26')](respondWithResult(_0x32aeea,null))['catch'](handleError(_0x32aeea,null));};exports['create']=function(_0x2b0d11,_0x3d07b7){return db[_0x18b4('0x42')][_0x18b4('0x48')](_0x2b0d11['body'],{})[_0x18b4('0x26')](respondWithResult(_0x3d07b7,0xc9))[_0x18b4('0x44')](handleError(_0x3d07b7,null));};exports[_0x18b4('0x25')]=function(_0x2214ca,_0xb681c9){if(_0x2214ca['body']['id']){delete _0x2214ca[_0x18b4('0x49')]['id'];}return db[_0x18b4('0x42')]['find']({'where':{'id':_0x2214ca[_0x18b4('0x4a')]['id']}})[_0x18b4('0x26')](handleEntityNotFound(_0xb681c9,null))[_0x18b4('0x26')](saveUpdates(_0x2214ca[_0x18b4('0x49')],null))[_0x18b4('0x26')](respondWithResult(_0xb681c9,null))[_0x18b4('0x44')](handleError(_0xb681c9,null));};exports[_0x18b4('0x27')]=function(_0x6a7228,_0x44edae){return db[_0x18b4('0x42')][_0x18b4('0x47')]({'where':{'id':_0x6a7228[_0x18b4('0x4a')]['id']}})[_0x18b4('0x26')](handleEntityNotFound(_0x44edae,null))['then'](removeEntity(_0x44edae,null))[_0x18b4('0x44')](handleError(_0x44edae,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index b0d3d2b..fb8f77f 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 _0x3dfc=['moment','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','../../config/logger','api'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x3dfc,0xd6));var _0xc3df=function(_0x37dac2,_0xdb5e75){_0x37dac2=_0x37dac2-0x0;var _0x351e15=_0x3dfc[_0x37dac2];return _0x351e15;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3df('0x0'))(_0xc3df('0x1'));var moment=require(_0xc3df('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3df('0x3'));var fs=require('fs');var path=require(_0xc3df('0x4'));var rimraf=require(_0xc3df('0x5'));var config=require(_0xc3df('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x225544,_0x3bdce0){return _0x225544[_0xc3df('0x7')](_0xc3df('0x8'),attributes,{'tableName':_0xc3df('0x9'),'paranoid':![],'indexes':[{'name':_0xc3df('0xa'),'fields':[_0xc3df('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6501=['exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x50c710,_0x504134){var _0x2d5f79=function(_0x73e66c){while(--_0x73e66c){_0x50c710['push'](_0x50c710['shift']());}};_0x2d5f79(++_0x504134);}(_0x6501,0x1b9));var _0x1650=function(_0x6ceb62,_0x486fb3){_0x6ceb62=_0x6ceb62-0x0;var _0x5b87ca=_0x6501[_0x6ceb62];return _0x5b87ca;};'use strict';var _=require(_0x1650('0x0'));var util=require(_0x1650('0x1'));var logger=require(_0x1650('0x2'))('api');var moment=require(_0x1650('0x3'));var BPromise=require('bluebird');var rp=require(_0x1650('0x4'));var fs=require('fs');var path=require(_0x1650('0x5'));var rimraf=require(_0x1650('0x6'));var config=require(_0x1650('0x7'));var attributes=require(_0x1650('0x8'));module[_0x1650('0x9')]=function(_0x127fb4,_0x38e133){return _0x127fb4[_0x1650('0xa')](_0x1650('0xb'),attributes,{'tableName':_0x1650('0xc'),'paranoid':![],'indexes':[{'name':_0x1650('0xd'),'fields':['idField',_0x1650('0xe')],'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 d47e2ba..896271e 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 _0x8e41=['stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46af9a,_0xd9a576){var _0x30c65f=function(_0x57c8c5){while(--_0x57c8c5){_0x46af9a['push'](_0x46af9a['shift']());}};_0x30c65f(++_0xd9a576);}(_0x8e41,0x1e5));var _0x18e4=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x8e41[_0x212b03];return _0x423115;};'use strict';var _=require(_0x18e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x18e4('0x1'));var fs=require('fs');var Redis=require(_0x18e4('0x2'));var db=require(_0x18e4('0x3'))['db'];var utils=require(_0x18e4('0x4'));var logger=require(_0x18e4('0x5'))(_0x18e4('0x6'));var config=require(_0x18e4('0x7'));var jayson=require(_0x18e4('0x8'));var client=jayson['client'][_0x18e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd555f,_0x4d2710,_0x5d66d3){return new BPromise(function(_0x56b9b5,_0x86e1d9){return client['request'](_0xbd555f,_0x5d66d3)[_0x18e4('0xa')](function(_0x50ce9f){logger[_0x18e4('0xb')](_0x18e4('0xc'),_0x4d2710,_0x18e4('0xd'));logger[_0x18e4('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4d2710,'request\x20sent',JSON[_0x18e4('0xf')](_0x50ce9f));if(_0x50ce9f[_0x18e4('0x10')]){if(_0x50ce9f[_0x18e4('0x10')]['code']===0x1f4){logger['error'](_0x18e4('0xc'),_0x4d2710,_0x50ce9f[_0x18e4('0x10')]['message']);return _0x86e1d9(_0x50ce9f['error']['message']);}logger[_0x18e4('0x10')]('VtigerField,\x20%s,\x20%s',_0x4d2710,_0x50ce9f[_0x18e4('0x10')]['message']);return _0x56b9b5(_0x50ce9f[_0x18e4('0x10')][_0x18e4('0x11')]);}else{logger['info'](_0x18e4('0xc'),_0x4d2710,_0x18e4('0xd'));_0x56b9b5(_0x50ce9f[_0x18e4('0x12')][_0x18e4('0x11')]);}})[_0x18e4('0x13')](function(_0x56e8d9){logger[_0x18e4('0x10')]('VtigerField,\x20%s,\x20%s',_0x4d2710,_0x56e8d9);_0x86e1d9(_0x56e8d9);});});} \ No newline at end of file +var _0x0caf=['code','message','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0caf,0xc1));var _0xf0ca=function(_0x193778,_0x53b793){_0x193778=_0x193778-0x0;var _0x31a36e=_0x0caf[_0x193778];return _0x31a36e;};'use strict';var _=require('lodash');var util=require(_0xf0ca('0x0'));var moment=require(_0xf0ca('0x1'));var BPromise=require(_0xf0ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0ca('0x4'))(_0xf0ca('0x5'));var config=require(_0xf0ca('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf0ca('0x7')][_0xf0ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27991e,_0x3af67f,_0x5e1cee){return new BPromise(function(_0x4cabe7,_0x554529){return client['request'](_0x27991e,_0x5e1cee)['then'](function(_0x392156){logger[_0xf0ca('0x9')](_0xf0ca('0xa'),_0x3af67f,_0xf0ca('0xb'));logger[_0xf0ca('0xc')](_0xf0ca('0xd'),_0x3af67f,'request\x20sent',JSON[_0xf0ca('0xe')](_0x392156));if(_0x392156[_0xf0ca('0xf')]){if(_0x392156[_0xf0ca('0xf')][_0xf0ca('0x10')]===0x1f4){logger[_0xf0ca('0xf')](_0xf0ca('0xa'),_0x3af67f,_0x392156['error'][_0xf0ca('0x11')]);return _0x554529(_0x392156['error']['message']);}logger[_0xf0ca('0xf')](_0xf0ca('0xa'),_0x3af67f,_0x392156[_0xf0ca('0xf')]['message']);return _0x4cabe7(_0x392156['error'][_0xf0ca('0x11')]);}else{logger[_0xf0ca('0x9')](_0xf0ca('0xa'),_0x3af67f,_0xf0ca('0xb'));_0x4cabe7(_0x392156['result'][_0xf0ca('0x11')]);}})[_0xf0ca('0x12')](function(_0x111246){logger[_0xf0ca('0xf')](_0xf0ca('0xa'),_0x3af67f,_0x111246);_0x554529(_0x111246);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ee46ab8..cbe924b 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 _0x9eac=['express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete','exports','util','path','connect-timeout'];(function(_0x27034c,_0x5b8019){var _0x599020=function(_0x5dcd62){while(--_0x5dcd62){_0x27034c['push'](_0x27034c['shift']());}};_0x599020(++_0x5b8019);}(_0x9eac,0x14d));var _0xc9ea=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x9eac[_0xe15270];return _0x1e813b;};'use strict';var multer=require('multer');var util=require(_0xc9ea('0x0'));var path=require(_0xc9ea('0x1'));var timeout=require(_0xc9ea('0x2'));var express=require(_0xc9ea('0x3'));var router=express[_0xc9ea('0x4')]();var fs_extra=require(_0xc9ea('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9ea('0x6'));var controller=require(_0xc9ea('0x7'));router[_0xc9ea('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9ea('0x9')]);router[_0xc9ea('0x8')](_0xc9ea('0xa'),auth[_0xc9ea('0xb')](),controller['show']);router[_0xc9ea('0x8')](_0xc9ea('0xc'),auth[_0xc9ea('0xb')](),controller[_0xc9ea('0xd')]);router[_0xc9ea('0x8')](_0xc9ea('0xe'),auth[_0xc9ea('0xb')](),controller[_0xc9ea('0xf')]);router[_0xc9ea('0x10')]('/',auth['isAuthenticated'](),controller[_0xc9ea('0x11')]);router[_0xc9ea('0x10')]('/:id/configurations',auth[_0xc9ea('0xb')](),controller['addConfiguration']);router['put'](_0xc9ea('0xa'),auth[_0xc9ea('0xb')](),controller[_0xc9ea('0x12')]);router[_0xc9ea('0x13')](_0xc9ea('0xa'),auth[_0xc9ea('0xb')](),controller['destroy']);module[_0xc9ea('0x14')]=router; \ No newline at end of file +var _0x8402=['./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5cc22b,_0x5b1dab){var _0x262d6d=function(_0x5aa8f4){while(--_0x5aa8f4){_0x5cc22b['push'](_0x5cc22b['shift']());}};_0x262d6d(++_0x5b1dab);}(_0x8402,0x1c5));var _0x2840=function(_0x2b72d4,_0x518d6c){_0x2b72d4=_0x2b72d4-0x0;var _0x27c618=_0x8402[_0x2b72d4];return _0x27c618;};'use strict';var multer=require('multer');var util=require(_0x2840('0x0'));var path=require(_0x2840('0x1'));var timeout=require(_0x2840('0x2'));var express=require(_0x2840('0x3'));var router=express['Router']();var fs_extra=require(_0x2840('0x4'));var auth=require(_0x2840('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2840('0x6'));var controller=require(_0x2840('0x7'));router['get']('/',auth[_0x2840('0x8')](),controller['index']);router[_0x2840('0x9')](_0x2840('0xa'),auth['isAuthenticated'](),controller[_0x2840('0xb')]);router[_0x2840('0x9')](_0x2840('0xc'),auth[_0x2840('0x8')](),controller['getConfigurations']);router[_0x2840('0x9')](_0x2840('0xd'),auth[_0x2840('0x8')](),controller['getFields']);router[_0x2840('0xe')]('/',auth[_0x2840('0x8')](),controller[_0x2840('0xf')]);router[_0x2840('0xe')](_0x2840('0xc'),auth['isAuthenticated'](),controller[_0x2840('0x10')]);router[_0x2840('0x11')]('/:id',auth[_0x2840('0x8')](),controller['update']);router[_0x2840('0x12')](_0x2840('0xa'),auth[_0x2840('0x8')](),controller[_0x2840('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e009f34..35bd5f5 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 _0xcaaf=['username','password','token','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xcaaf,0x66));var _0xfcaa=function(_0x4bdc9c,_0x43b666){_0x4bdc9c=_0x4bdc9c-0x0;var _0x32e430=_0xcaaf[_0x4bdc9c];return _0x32e430;};'use strict';var Sequelize=require(_0xfcaa('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcaa('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xfcaa('0x2')},'password':{'type':Sequelize[_0xfcaa('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfcaa('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0xfcaa('0x3'),_0xfcaa('0x4')),'defaultValue':_0xfcaa('0x3')},'serverUrl':{'type':Sequelize[_0xfcaa('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfcaa('0x5')](_0xfcaa('0x6'),_0xfcaa('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x5ff9=['STRING','ENUM','password','integrationTab','sequelize','exports'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x5ff9,0xa0));var _0x95ff=function(_0x25fbb8,_0x3b4224){_0x25fbb8=_0x25fbb8-0x0;var _0x52f795=_0x5ff9[_0x25fbb8];return _0x52f795;};'use strict';var Sequelize=require(_0x95ff('0x0'));module[_0x95ff('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x95ff('0x2')]},'username':{'type':Sequelize[_0x95ff('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x95ff('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x95ff('0x3')](_0x95ff('0x4'),'token'),'defaultValue':_0x95ff('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x95ff('0x3')](_0x95ff('0x5'),'newTab'),'defaultValue':_0x95ff('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7077e5e..b6dd1ed 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 _0xa902=['%s:%s','base64','%s/token:%s','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','sort','map','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','findOne','username','password','remoteUri','slice','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s'];(function(_0x5c0a9e,_0x404d6f){var _0x4e4452=function(_0x12fbdb){while(--_0x12fbdb){_0x5c0a9e['push'](_0x5c0a9e['shift']());}};_0x4e4452(++_0x404d6f);}(_0xa902,0x8d));var _0x2a90=function(_0x548b6a,_0x8ec5bf){_0x548b6a=_0x548b6a-0x0;var _0x298cab=_0xa902[_0x548b6a];return _0x298cab;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f6953,_0x57aee3){_0x57aee3=_0x57aee3||0xcc;return function(_0x407ce5){if(_0x407ce5){return _0x1f6953[_0x2a90('0x17')](_0x57aee3);}return _0x1f6953[_0x2a90('0x18')](_0x57aee3)['end']();};}function respondWithResult(_0x56d1b8,_0x57227c){_0x57227c=_0x57227c||0xc8;return function(_0x46cb32){if(_0x46cb32){return _0x56d1b8[_0x2a90('0x18')](_0x57227c)['json'](_0x46cb32);}};}function respondWithFilteredResult(_0x1ff63d,_0x21c648){return function(_0x312782){if(_0x312782){var _0x25bd0e=typeof _0x21c648[_0x2a90('0x19')]===_0x2a90('0x1a')&&typeof _0x21c648[_0x2a90('0x1b')]===_0x2a90('0x1a');var _0x43eea5=_0x312782['count'];var _0x162f0b=_0x25bd0e?0x0:_0x21c648[_0x2a90('0x19')];var _0x4190ff=_0x25bd0e?_0x312782['count']:_0x21c648[_0x2a90('0x19')]+_0x21c648[_0x2a90('0x1b')];var _0x148d18;if(_0x4190ff>=_0x43eea5){_0x4190ff=_0x43eea5;_0x148d18=0xc8;}else{_0x148d18=0xce;}_0x1ff63d[_0x2a90('0x18')](_0x148d18);return _0x1ff63d[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x162f0b+'-'+_0x4190ff+'/'+_0x43eea5)[_0x2a90('0x1e')](_0x312782);}return null;};}function patchUpdates(_0x114d42){return function(_0xf97adb){try{jsonpatch[_0x2a90('0x1f')](_0xf97adb,_0x114d42,!![]);}catch(_0x1340b9){return BPromise[_0x2a90('0x20')](_0x1340b9);}return _0xf97adb['save']();};}function saveUpdates(_0x3da7d0,_0x217873){return function(_0x2955a9){if(_0x2955a9){return _0x2955a9[_0x2a90('0x21')](_0x3da7d0)['then'](function(_0x180485){return _0x180485;});}return null;};}function removeEntity(_0xd033d,_0x4ed9e6){return function(_0x1bcfd7){if(_0x1bcfd7){return _0x1bcfd7[_0x2a90('0x22')]()[_0x2a90('0x23')](function(){_0xd033d[_0x2a90('0x18')](0xcc)[_0x2a90('0x24')]();});}};}function handleEntityNotFound(_0x1303d9,_0x29ed73){return function(_0x24a6d3){if(!_0x24a6d3){_0x1303d9['sendStatus'](0x194);}return _0x24a6d3;};}function handleError(_0x27f883,_0x17f978){_0x17f978=_0x17f978||0x1f4;return function(_0x3934d4){logger[_0x2a90('0x25')](_0x3934d4[_0x2a90('0x26')]);if(_0x3934d4['name']){delete _0x3934d4['name'];}_0x27f883[_0x2a90('0x18')](_0x17f978)['send'](_0x3934d4);};}exports['index']=function(_0x4969c3,_0x2d83b3){var _0x3c78f5={},_0x595638={},_0x5bd700={'count':0x0,'rows':[]};var _0x1add9a=_['map'](db[_0x2a90('0x27')][_0x2a90('0x28')],function(_0x3b580f){return{'name':_0x3b580f[_0x2a90('0x29')],'type':_0x3b580f[_0x2a90('0x2a')][_0x2a90('0x2b')]};});_0x595638[_0x2a90('0x2c')]=_['map'](_0x1add9a,_0x2a90('0x2d'));_0x595638[_0x2a90('0x2e')]=_[_0x2a90('0x2f')](_0x4969c3['query']);_0x595638[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],_0x595638[_0x2a90('0x2e')]);_0x3c78f5['attributes']=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],qs[_0x2a90('0x32')](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x3c78f5[_0x2a90('0x33')]=_0x3c78f5['attributes'][_0x2a90('0x34')]?_0x3c78f5[_0x2a90('0x33')]:_0x595638[_0x2a90('0x2c')];if(!_0x4969c3[_0x2a90('0x2e')]['hasOwnProperty'](_0x2a90('0x35'))){_0x3c78f5[_0x2a90('0x1b')]=qs['limit'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x1b')]);_0x3c78f5['offset']=qs['offset'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x19')]);}_0x3c78f5[_0x2a90('0x36')]=qs['sort'](_0x4969c3[_0x2a90('0x2e')]['sort']);_0x3c78f5[_0x2a90('0x37')]=qs['filters'](_[_0x2a90('0x38')](_0x4969c3['query'],_0x595638['filters']),_0x1add9a);if(_0x4969c3[_0x2a90('0x2e')]['filter']){_0x3c78f5[_0x2a90('0x37')]=_[_0x2a90('0x39')](_0x3c78f5[_0x2a90('0x37')],{'$or':_['map'](_0x1add9a,function(_0x57a2a5){if(_0x57a2a5[_0x2a90('0x2a')]!==_0x2a90('0x3a')){var _0x4eb7d9={};_0x4eb7d9[_0x57a2a5[_0x2a90('0x2d')]]={'$like':'%'+_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x4eb7d9;}})});}_0x3c78f5=_['merge']({},_0x3c78f5,_0x4969c3[_0x2a90('0x3c')]);var _0x1db9d8={'where':_0x3c78f5['where']};return db[_0x2a90('0x27')][_0x2a90('0x3d')](_0x1db9d8)[_0x2a90('0x23')](function(_0x28f289){_0x5bd700[_0x2a90('0x3d')]=_0x28f289;if(_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x3c78f5[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x27')][_0x2a90('0x40')](_0x3c78f5);})[_0x2a90('0x23')](function(_0x3dba8a){_0x5bd700[_0x2a90('0x41')]=_0x3dba8a;return _0x5bd700;})[_0x2a90('0x23')](respondWithFilteredResult(_0x2d83b3,_0x3c78f5))['catch'](handleError(_0x2d83b3,null));};exports[_0x2a90('0x42')]=function(_0x3a70fe,_0x528b41){var _0x1045bb={'raw':![],'where':{'id':_0x3a70fe[_0x2a90('0x43')]['id']}},_0x1e971c={};_0x1e971c[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskAccount'][_0x2a90('0x28')]);_0x1e971c['query']=_[_0x2a90('0x2f')](_0x3a70fe['query']);_0x1e971c[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],_0x1e971c[_0x2a90('0x2e')]);_0x1045bb[_0x2a90('0x33')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],qs['fields'](_0x3a70fe['query'][_0x2a90('0x32')]));_0x1045bb[_0x2a90('0x33')]=_0x1045bb[_0x2a90('0x33')][_0x2a90('0x34')]?_0x1045bb[_0x2a90('0x33')]:_0x1e971c[_0x2a90('0x2c')];if(_0x3a70fe[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x1045bb['include']=[{'all':!![]}];}_0x1045bb=_[_0x2a90('0x39')]({},_0x1045bb,_0x3a70fe['options']);return db[_0x2a90('0x27')][_0x2a90('0x44')](_0x1045bb)['then'](handleEntityNotFound(_0x528b41,null))[_0x2a90('0x23')](respondWithResult(_0x528b41,null))[_0x2a90('0x45')](handleError(_0x528b41,null));};exports[_0x2a90('0x46')]=function(_0x1d55db,_0x175d59){return db[_0x2a90('0x27')][_0x2a90('0x46')](_0x1d55db['body'],{})['then'](respondWithResult(_0x175d59,0xc9))[_0x2a90('0x45')](handleError(_0x175d59,null));};exports[_0x2a90('0x21')]=function(_0x42c890,_0x43266a){if(_0x42c890[_0x2a90('0x47')]['id']){delete _0x42c890['body']['id'];}return db['ZendeskAccount'][_0x2a90('0x44')]({'where':{'id':_0x42c890[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x43266a,null))['then'](saveUpdates(_0x42c890['body'],null))[_0x2a90('0x23')](respondWithResult(_0x43266a,null))['catch'](handleError(_0x43266a,null));};exports[_0x2a90('0x22')]=function(_0x3dfe72,_0x272d07){return db[_0x2a90('0x27')][_0x2a90('0x44')]({'where':{'id':_0x3dfe72[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x272d07,null))[_0x2a90('0x23')](removeEntity(_0x272d07,null))[_0x2a90('0x45')](handleError(_0x272d07,null));};exports['getConfigurations']=function(_0x265769,_0x4d1303,_0x4c8bae){var _0x46f687={};var _0xe47c6b={};var _0x5819ab;var _0x4c0cb2;return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0x265769[_0x2a90('0x43')]['id']}})[_0x2a90('0x23')](handleEntityNotFound(_0x4d1303,null))['then'](function(_0x366429){if(_0x366429){_0x5819ab=_0x366429;_0xe47c6b[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskConfiguration'][_0x2a90('0x28')]);_0xe47c6b[_0x2a90('0x2e')]=_['keys'](_0x265769['query']);_0xe47c6b[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0xe47c6b['model'],_0xe47c6b[_0x2a90('0x2e')]);_0x46f687['attributes']=_[_0x2a90('0x31')](_0xe47c6b['model'],qs[_0x2a90('0x32')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x46f687['attributes']=_0x46f687['attributes']['length']?_0x46f687[_0x2a90('0x33')]:_0xe47c6b[_0x2a90('0x2c')];_0x46f687[_0x2a90('0x36')]=qs[_0x2a90('0x48')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x48')]);_0x46f687[_0x2a90('0x37')]=qs[_0x2a90('0x30')](_[_0x2a90('0x38')](_0x265769[_0x2a90('0x2e')],_0xe47c6b[_0x2a90('0x30')]));if(_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]){_0x46f687['where']=_['merge'](_0x46f687['where'],{'$or':_[_0x2a90('0x49')](_0x46f687[_0x2a90('0x33')],function(_0x13270d){var _0x400aca={};_0x400aca[_0x13270d]={'$like':'%'+_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x400aca;})});}_0x46f687=_[_0x2a90('0x39')]({},_0x46f687,_0x265769[_0x2a90('0x3c')]);return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x50973b){if(_0x50973b){_0x4c0cb2=_0x50973b[_0x2a90('0x34')];if(!_0x265769[_0x2a90('0x2e')][_0x2a90('0x4b')](_0x2a90('0x35'))){_0x46f687[_0x2a90('0x1b')]=qs['limit'](_0x265769[_0x2a90('0x2e')]['limit']);_0x46f687[_0x2a90('0x19')]=qs[_0x2a90('0x19')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x19')]);}return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x44b211){if(_0x44b211){return _0x44b211?{'count':_0x4c0cb2,'rows':_0x44b211}:null;}})['then'](respondWithResult(_0x4d1303,null))[_0x2a90('0x45')](handleError(_0x4d1303,null));};exports[_0x2a90('0x4c')]=function(_0xf88bbb,_0x48f9fa,_0xa1234a){if(_0xf88bbb[_0x2a90('0x47')]['id']){delete _0xf88bbb[_0x2a90('0x47')]['id'];}return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0xf88bbb[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x48f9fa,null))[_0x2a90('0x23')](function(_0x94e9fb){if(_0x94e9fb){_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4d')]=_0x94e9fb['id'];_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4e')]=integrations['getSubjects'](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x2a')]);_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x50')]=integrations[_0x2a90('0x51')](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb['body'][_0x2a90('0x2a')]);return db[_0x2a90('0x52')][_0x2a90('0x46')](_0xf88bbb['body'],{'include':[{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x4e')},{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x50')}]});}return null;})[_0x2a90('0x23')](respondWithResult(_0x48f9fa,null))['catch'](handleError(_0x48f9fa,null));};exports[_0x2a90('0x54')]=function(_0x5e0bf2,_0x5a770b,_0x9fafd){var _0x4e1dcd='';return db['ZendeskAccount'][_0x2a90('0x55')]({'where':{'id':_0x5e0bf2['params']['id']},'attributes':['id',_0x2a90('0x56'),_0x2a90('0x57'),'token','authType',_0x2a90('0x58')]})['then'](handleEntityNotFound(_0x5a770b,null))['then'](function(_0xd52ae2){if(_0xd52ae2){_0x4e1dcd=_0xd52ae2[_0x2a90('0x58')];var _0x1db063=_0x4e1dcd[_0x2a90('0x59')](-0x1);if(_0x1db063==='/'){_0x4e1dcd=_0x4e1dcd['substring'](0x0,_0x4e1dcd['lastIndexOf'](_0x1db063));}var _0x370144={'method':_0x2a90('0x5a'),'uri':util[_0x2a90('0x5b')](_0x2a90('0x5c'),_0x4e1dcd,_0x2a90('0x5d')),'json':!![]};switch(_0xd52ae2[_0x2a90('0x5e')]){case _0x2a90('0x57'):_0x370144[_0x2a90('0x5f')]={'Authorization':util[_0x2a90('0x5b')](_0x2a90('0x60'),new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x61'),_0xd52ae2['username'],_0xd52ae2[_0x2a90('0x57')]))['toString'](_0x2a90('0x62')))};break;case'token':_0x370144[_0x2a90('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x63'),_0xd52ae2[_0x2a90('0x56')],_0xd52ae2[_0x2a90('0x64')]))['toString']('base64'))};break;default:throw new db[(_0x2a90('0x65'))][(_0x2a90('0x66'))](_0x2a90('0x67'));}return rp(_0x370144);}})[_0x2a90('0x23')](function(_0x59b9e6){if(_0x59b9e6){var _0x3b0d5e=[_0x2a90('0x68'),_0x2a90('0x69'),_0x2a90('0x6a'),_0x2a90('0x6b')];_[_0x2a90('0x6c')](_0x59b9e6[_0x2a90('0x5d')],function(_0x4d46f5){return _0x3b0d5e[_0x2a90('0x6d')](_0x4d46f5[_0x2a90('0x2a')]);});return{'count':_0x59b9e6[_0x2a90('0x5d')][_0x2a90('0x34')],'rows':_[_0x2a90('0x49')](_0x59b9e6[_0x2a90('0x5d')],function(_0x1bbadd){return{'id':_0x1bbadd['id'],'name':_0x1bbadd[_0x2a90('0x6e')]>0x7?_0x1bbadd['title']:_0x1bbadd[_0x2a90('0x2a')],'custom':_0x1bbadd[_0x2a90('0x6e')]>0x7?!![]:![],'options':_0x1bbadd['system_field_options']?_0x1bbadd[_0x2a90('0x6f')]:_0x1bbadd[_0x2a90('0x70')]?_0x1bbadd[_0x2a90('0x70')]:[]};})};}})[_0x2a90('0x23')](respondWithResult(_0x5a770b,null))[_0x2a90('0x45')](function(_0x16e9e7){var _0x4b4a47=_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?0x1f4:_0x16e9e7[_0x2a90('0x72')]||0x1f4;logger[_0x2a90('0x25')](_0x2a90('0x73'),_0x2a90('0x54'),_0x4b4a47,JSON[_0x2a90('0x74')](_0x16e9e7));delete _0x16e9e7[_0x2a90('0x2d')];if(_0x4b4a47===0x191){_0x4b4a47=0x190;}_0x5a770b['status'](_0x4b4a47)[_0x2a90('0x75')](_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?{'message':_0x2a90('0x76'),'statusCode':_0x16e9e7[_0x2a90('0x72')]}:_0x16e9e7);});}; \ No newline at end of file +var _0x9c00=['options','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','findOne','filter'];(function(_0x25ecab,_0x20fe8b){var _0x28555b=function(_0x2892df){while(--_0x2892df){_0x25ecab['push'](_0x25ecab['shift']());}};_0x28555b(++_0x20fe8b);}(_0x9c00,0x1a0));var _0x09c0=function(_0x12d917,_0x59ddd4){_0x12d917=_0x12d917-0x0;var _0x576d1a=_0x9c00[_0x12d917];return _0x576d1a;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];var integrations=require(_0x09c0('0x1b'));function respondWithStatusCode(_0x3b95cc,_0x331905){_0x331905=_0x331905||0xcc;return function(_0x6149a8){if(_0x6149a8){return _0x3b95cc[_0x09c0('0x1c')](_0x331905);}return _0x3b95cc[_0x09c0('0x1d')](_0x331905)[_0x09c0('0x1e')]();};}function respondWithResult(_0x16e490,_0x254598){_0x254598=_0x254598||0xc8;return function(_0x152140){if(_0x152140){return _0x16e490[_0x09c0('0x1d')](_0x254598)[_0x09c0('0x1f')](_0x152140);}};}function respondWithFilteredResult(_0x2fdf11,_0x4ff6b7){return function(_0x590129){if(_0x590129){var _0x558b4f=typeof _0x4ff6b7[_0x09c0('0x20')]===_0x09c0('0x21')&&typeof _0x4ff6b7[_0x09c0('0x22')]===_0x09c0('0x21');var _0x5dcab7=_0x590129[_0x09c0('0x23')];var _0x4aa8a5=_0x558b4f?0x0:_0x4ff6b7['offset'];var _0x2c12da=_0x558b4f?_0x590129['count']:_0x4ff6b7[_0x09c0('0x20')]+_0x4ff6b7[_0x09c0('0x22')];var _0x2da257;if(_0x2c12da>=_0x5dcab7){_0x2c12da=_0x5dcab7;_0x2da257=0xc8;}else{_0x2da257=0xce;}_0x2fdf11['status'](_0x2da257);return _0x2fdf11[_0x09c0('0x24')](_0x09c0('0x25'),_0x4aa8a5+'-'+_0x2c12da+'/'+_0x5dcab7)[_0x09c0('0x1f')](_0x590129);}return null;};}function patchUpdates(_0x3447c5){return function(_0x12bba7){try{jsonpatch[_0x09c0('0x26')](_0x12bba7,_0x3447c5,!![]);}catch(_0x8c6b9a){return BPromise['reject'](_0x8c6b9a);}return _0x12bba7[_0x09c0('0x27')]();};}function saveUpdates(_0x46f171,_0x473fbd){return function(_0x1d18e9){if(_0x1d18e9){return _0x1d18e9['update'](_0x46f171)['then'](function(_0x321bcc){return _0x321bcc;});}return null;};}function removeEntity(_0x25fdb5,_0x1e8a1c){return function(_0x3a5370){if(_0x3a5370){return _0x3a5370['destroy']()[_0x09c0('0x28')](function(){_0x25fdb5[_0x09c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(!_0x2e3d4d){_0x2c7202[_0x09c0('0x1c')](0x194);}return _0x2e3d4d;};}function handleError(_0x1f8131,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0x1f4;return function(_0x45cc64){logger[_0x09c0('0x29')](_0x45cc64[_0x09c0('0x2a')]);if(_0x45cc64[_0x09c0('0x2b')]){delete _0x45cc64[_0x09c0('0x2b')];}_0x1f8131['status'](_0x1d2d9d)[_0x09c0('0x2c')](_0x45cc64);};}exports[_0x09c0('0x2d')]=function(_0x53a7b8,_0x1d09e0){var _0x5aa0b9={},_0x3f5b10={},_0x4d6bdc={'count':0x0,'rows':[]};var _0x3ac8e4=_[_0x09c0('0x2e')](db[_0x09c0('0x2f')][_0x09c0('0x30')],function(_0x4e999a){return{'name':_0x4e999a['fieldName'],'type':_0x4e999a[_0x09c0('0x31')][_0x09c0('0x32')]};});_0x3f5b10[_0x09c0('0x33')]=_['map'](_0x3ac8e4,_0x09c0('0x2b'));_0x3f5b10['query']=_[_0x09c0('0x34')](_0x53a7b8[_0x09c0('0x35')]);_0x3f5b10[_0x09c0('0x36')]=_['intersection'](_0x3f5b10[_0x09c0('0x33')],_0x3f5b10[_0x09c0('0x35')]);_0x5aa0b9[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x3f5b10[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x53a7b8[_0x09c0('0x35')]['fields']));_0x5aa0b9[_0x09c0('0x37')]=_0x5aa0b9[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x5aa0b9[_0x09c0('0x37')]:_0x3f5b10[_0x09c0('0x33')];if(!_0x53a7b8['query'][_0x09c0('0x3b')](_0x09c0('0x3c'))){_0x5aa0b9[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0x53a7b8[_0x09c0('0x35')]['limit']);_0x5aa0b9[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x53a7b8[_0x09c0('0x35')][_0x09c0('0x20')]);}_0x5aa0b9[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0x53a7b8[_0x09c0('0x35')]['sort']);_0x5aa0b9[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0x53a7b8[_0x09c0('0x35')],_0x3f5b10[_0x09c0('0x36')]),_0x3ac8e4);if(_0x53a7b8['query']['filter']){_0x5aa0b9['where']=_['merge'](_0x5aa0b9[_0x09c0('0x3f')],{'$or':_[_0x09c0('0x2e')](_0x3ac8e4,function(_0xfd295b){if(_0xfd295b[_0x09c0('0x31')]!==_0x09c0('0x41')){var _0x4bd637={};_0x4bd637[_0xfd295b[_0x09c0('0x2b')]]={'$like':'%'+_0x53a7b8[_0x09c0('0x35')]['filter']+'%'};return _0x4bd637;}})});}_0x5aa0b9=_[_0x09c0('0x42')]({},_0x5aa0b9,_0x53a7b8['options']);var _0x3ee063={'where':_0x5aa0b9['where']};return db[_0x09c0('0x2f')][_0x09c0('0x23')](_0x3ee063)['then'](function(_0x26a21c){_0x4d6bdc[_0x09c0('0x23')]=_0x26a21c;if(_0x53a7b8['query'][_0x09c0('0x43')]){_0x5aa0b9[_0x09c0('0x44')]=[{'all':!![]}];}return db[_0x09c0('0x2f')][_0x09c0('0x45')](_0x5aa0b9);})[_0x09c0('0x28')](function(_0x34326c){_0x4d6bdc['rows']=_0x34326c;return _0x4d6bdc;})[_0x09c0('0x28')](respondWithFilteredResult(_0x1d09e0,_0x5aa0b9))[_0x09c0('0x46')](handleError(_0x1d09e0,null));};exports[_0x09c0('0x47')]=function(_0x57835c,_0x193ed2){var _0x30c0c5={'raw':![],'where':{'id':_0x57835c['params']['id']}},_0x447224={};_0x447224[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskAccount']['rawAttributes']);_0x447224[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0x57835c['query']);_0x447224[_0x09c0('0x36')]=_[_0x09c0('0x38')](_0x447224['model'],_0x447224[_0x09c0('0x35')]);_0x30c0c5[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x447224[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x57835c['query'][_0x09c0('0x39')]));_0x30c0c5['attributes']=_0x30c0c5['attributes'][_0x09c0('0x3a')]?_0x30c0c5[_0x09c0('0x37')]:_0x447224[_0x09c0('0x33')];if(_0x57835c[_0x09c0('0x35')][_0x09c0('0x43')]){_0x30c0c5[_0x09c0('0x44')]=[{'all':!![]}];}_0x30c0c5=_['merge']({},_0x30c0c5,_0x57835c['options']);return db['ZendeskAccount'][_0x09c0('0x48')](_0x30c0c5)[_0x09c0('0x28')](handleEntityNotFound(_0x193ed2,null))[_0x09c0('0x28')](respondWithResult(_0x193ed2,null))['catch'](handleError(_0x193ed2,null));};exports[_0x09c0('0x49')]=function(_0xff9650,_0x2016f1){return db[_0x09c0('0x2f')][_0x09c0('0x49')](_0xff9650[_0x09c0('0x4a')],{})[_0x09c0('0x28')](respondWithResult(_0x2016f1,0xc9))[_0x09c0('0x46')](handleError(_0x2016f1,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){if(_0x38085c[_0x09c0('0x4a')]['id']){delete _0x38085c[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x38085c[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x1b0198,null))[_0x09c0('0x28')](saveUpdates(_0x38085c[_0x09c0('0x4a')],null))[_0x09c0('0x28')](respondWithResult(_0x1b0198,null))['catch'](handleError(_0x1b0198,null));};exports[_0x09c0('0x4d')]=function(_0x44befb,_0x15b0a2){return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x44befb['params']['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x15b0a2,null))[_0x09c0('0x28')](removeEntity(_0x15b0a2,null))[_0x09c0('0x46')](handleError(_0x15b0a2,null));};exports['getConfigurations']=function(_0xe0b82a,_0x18c728,_0x14b701){var _0x25a36a={};var _0x55b0f0={};var _0xebfd6d;var _0x45ecd0;return db['ZendeskAccount'][_0x09c0('0x4e')]({'where':{'id':_0xe0b82a[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x18c728,null))[_0x09c0('0x28')](function(_0x21fe00){if(_0x21fe00){_0xebfd6d=_0x21fe00;_0x55b0f0[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskConfiguration']['rawAttributes']);_0x55b0f0[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0xe0b82a[_0x09c0('0x35')]);_0x55b0f0['filters']=_[_0x09c0('0x38')](_0x55b0f0['model'],_0x55b0f0[_0x09c0('0x35')]);_0x25a36a[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x55b0f0[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x39')]));_0x25a36a['attributes']=_0x25a36a[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x25a36a[_0x09c0('0x37')]:_0x55b0f0[_0x09c0('0x33')];_0x25a36a[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x3e')]);_0x25a36a[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0xe0b82a['query'],_0x55b0f0[_0x09c0('0x36')]));if(_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x4f')]){_0x25a36a[_0x09c0('0x3f')]=_['merge'](_0x25a36a[_0x09c0('0x3f')],{'$or':_['map'](_0x25a36a[_0x09c0('0x37')],function(_0x9a4f4){var _0x1cfdb3={};_0x1cfdb3[_0x9a4f4]={'$like':'%'+_0xe0b82a['query']['filter']+'%'};return _0x1cfdb3;})});}_0x25a36a=_[_0x09c0('0x42')]({},_0x25a36a,_0xe0b82a[_0x09c0('0x50')]);return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x4b65c7){if(_0x4b65c7){_0x45ecd0=_0x4b65c7[_0x09c0('0x3a')];if(!_0xe0b82a[_0x09c0('0x35')]['hasOwnProperty'](_0x09c0('0x3c'))){_0x25a36a[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0xe0b82a[_0x09c0('0x35')]['limit']);_0x25a36a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x20')]);}return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x30d976){if(_0x30d976){return _0x30d976?{'count':_0x45ecd0,'rows':_0x30d976}:null;}})[_0x09c0('0x28')](respondWithResult(_0x18c728,null))[_0x09c0('0x46')](handleError(_0x18c728,null));};exports[_0x09c0('0x52')]=function(_0x85adc7,_0x2906cb,_0x2d67e8){if(_0x85adc7['body']['id']){delete _0x85adc7[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x85adc7[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x2906cb,null))['then'](function(_0x1205da){if(_0x1205da){_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x53')]=_0x1205da['id'];_0x85adc7[_0x09c0('0x4a')]['Subjects']=integrations[_0x09c0('0x54')](_0x85adc7[_0x09c0('0x4a')]['channel'],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x55')]=integrations[_0x09c0('0x56')](_0x85adc7['body'][_0x09c0('0x57')],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);return db[_0x09c0('0x58')][_0x09c0('0x49')](_0x85adc7['body'],{'include':[{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x5a')},{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x55')}]});}return null;})[_0x09c0('0x28')](respondWithResult(_0x2906cb,null))[_0x09c0('0x46')](handleError(_0x2906cb,null));};exports['getFields']=function(_0x51fc84,_0x583c0d,_0x52fe65){var _0x7c1cb8='';return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x51fc84['params']['id']},'attributes':['id',_0x09c0('0x5b'),'password',_0x09c0('0x5c'),_0x09c0('0x5d'),'remoteUri']})[_0x09c0('0x28')](handleEntityNotFound(_0x583c0d,null))['then'](function(_0x4a42c4){if(_0x4a42c4){_0x7c1cb8=_0x4a42c4[_0x09c0('0x5e')];var _0x111647=_0x7c1cb8[_0x09c0('0x5f')](-0x1);if(_0x111647==='/'){_0x7c1cb8=_0x7c1cb8[_0x09c0('0x60')](0x0,_0x7c1cb8[_0x09c0('0x61')](_0x111647));}var _0x3ffd37={'method':_0x09c0('0x62'),'uri':util[_0x09c0('0x63')](_0x09c0('0x64'),_0x7c1cb8,_0x09c0('0x65')),'json':!![]};switch(_0x4a42c4['authType']){case _0x09c0('0x66'):_0x3ffd37[_0x09c0('0x67')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x68'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x66')]))[_0x09c0('0x69')](_0x09c0('0x6a')))};break;case _0x09c0('0x5c'):_0x3ffd37['headers']={'Authorization':util[_0x09c0('0x63')]('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x6b'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x5c')]))[_0x09c0('0x69')]('base64'))};break;default:throw new db[(_0x09c0('0x6c'))]['ValidationError'](_0x09c0('0x6d'));}return rp(_0x3ffd37);}})['then'](function(_0x35c446){if(_0x35c446){var _0x3e8b19=[_0x09c0('0x6e'),_0x09c0('0x6f'),_0x09c0('0x70'),_0x09c0('0x71')];_[_0x09c0('0x72')](_0x35c446['ticket_fields'],function(_0x4ab50d){return _0x3e8b19[_0x09c0('0x73')](_0x4ab50d[_0x09c0('0x31')]);});return{'count':_0x35c446[_0x09c0('0x65')][_0x09c0('0x3a')],'rows':_[_0x09c0('0x2e')](_0x35c446[_0x09c0('0x65')],function(_0x4060bb){return{'id':_0x4060bb['id'],'name':_0x4060bb[_0x09c0('0x74')]>0x7?_0x4060bb[_0x09c0('0x75')]:_0x4060bb[_0x09c0('0x31')],'custom':_0x4060bb['position']>0x7?!![]:![],'options':_0x4060bb['system_field_options']?_0x4060bb['system_field_options']:_0x4060bb[_0x09c0('0x76')]?_0x4060bb[_0x09c0('0x76')]:[]};})};}})[_0x09c0('0x28')](respondWithResult(_0x583c0d,null))['catch'](function(_0x5f1857){var _0x1618de=_0x51fc84['query'][_0x09c0('0x77')]?0x1f4:_0x5f1857[_0x09c0('0x78')]||0x1f4;logger['error'](_0x09c0('0x79'),'getFields',_0x1618de,JSON[_0x09c0('0x7a')](_0x5f1857));delete _0x5f1857[_0x09c0('0x2b')];if(_0x1618de===0x191){_0x1618de=0x190;}_0x583c0d[_0x09c0('0x1d')](_0x1618de)['send'](_0x51fc84[_0x09c0('0x35')][_0x09c0('0x77')]?{'message':_0x09c0('0x7b'),'statusCode':_0x5f1857[_0x09c0('0x78')]}:_0x5f1857);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4aba7d5..bdd0755 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 _0x664c=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','util','../../config/logger','moment'];(function(_0x417fa6,_0x2e7894){var _0x810c9c=function(_0x1627a3){while(--_0x1627a3){_0x417fa6['push'](_0x417fa6['shift']());}};_0x810c9c(++_0x2e7894);}(_0x664c,0x8c));var _0xc664=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x664c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc664('0x0'));var logger=require(_0xc664('0x1'))('api');var moment=require(_0xc664('0x2'));var BPromise=require(_0xc664('0x3'));var rp=require(_0xc664('0x4'));var fs=require('fs');var path=require(_0xc664('0x5'));var rimraf=require(_0xc664('0x6'));var config=require(_0xc664('0x7'));var attributes=require(_0xc664('0x8'));var integrations=require(_0xc664('0x9'));module['exports']=function(_0x35f8d4,_0x816ab8){return _0x35f8d4['define'](_0xc664('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa789=['define','int_zendesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x431247,_0x4777c7){var _0x361f2a=function(_0x11fe73){while(--_0x11fe73){_0x431247['push'](_0x431247['shift']());}};_0x361f2a(++_0x4777c7);}(_0xa789,0xf4));var _0x9a78=function(_0x1262b6,_0x3c53cb){_0x1262b6=_0x1262b6-0x0;var _0x11a3e2=_0xa789[_0x1262b6];return _0x11a3e2;};'use strict';var _=require('lodash');var util=require(_0x9a78('0x0'));var logger=require(_0x9a78('0x1'))(_0x9a78('0x2'));var moment=require('moment');var BPromise=require(_0x9a78('0x3'));var rp=require(_0x9a78('0x4'));var fs=require('fs');var path=require(_0x9a78('0x5'));var rimraf=require(_0x9a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a78('0x7'));var integrations=require(_0x9a78('0x8'));module['exports']=function(_0xbe429b,_0x5cb539){return _0xbe429b[_0x9a78('0x9')]('ZendeskAccount',attributes,{'tableName':_0x9a78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 5a6fba7..e692b30 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 _0xff9e=['options','where','attributes','limit','include','map','model','then','debug','GetZendeskAccount','ShowZendeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskAccount'];(function(_0x783b2b,_0x192339){var _0x6f7693=function(_0x573caa){while(--_0x573caa){_0x783b2b['push'](_0x783b2b['shift']());}};_0x6f7693(++_0x192339);}(_0xff9e,0x12d));var _0xeff9=function(_0x4a7a4a,_0x4584f7){_0x4a7a4a=_0x4a7a4a-0x0;var _0x3387f0=_0xff9e[_0x4a7a4a];return _0x3387f0;};'use strict';var _=require(_0xeff9('0x0'));var util=require(_0xeff9('0x1'));var moment=require(_0xeff9('0x2'));var BPromise=require(_0xeff9('0x3'));var rs=require(_0xeff9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeff9('0x5'))['db'];var utils=require(_0xeff9('0x6'));var logger=require('../../config/logger')(_0xeff9('0x7'));var config=require(_0xeff9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeff9('0x9')][_0xeff9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230f49,_0x50f6fc,_0x86fbf0){return new BPromise(function(_0x2ad14f,_0x1b497a){return client[_0xeff9('0xb')](_0x230f49,_0x86fbf0)['then'](function(_0x29c96a){logger[_0xeff9('0xc')](_0xeff9('0xd'),_0x50f6fc,_0xeff9('0xe'));logger['debug'](_0xeff9('0xf'),_0x50f6fc,'request\x20sent',JSON[_0xeff9('0x10')](_0x29c96a));if(_0x29c96a[_0xeff9('0x11')]){if(_0x29c96a[_0xeff9('0x11')][_0xeff9('0x12')]===0x1f4){logger[_0xeff9('0x11')](_0xeff9('0xd'),_0x50f6fc,_0x29c96a[_0xeff9('0x11')]['message']);return _0x1b497a(_0x29c96a[_0xeff9('0x11')][_0xeff9('0x13')]);}logger[_0xeff9('0x11')](_0xeff9('0xd'),_0x50f6fc,_0x29c96a['error']['message']);return _0x2ad14f(_0x29c96a[_0xeff9('0x11')][_0xeff9('0x13')]);}else{logger[_0xeff9('0xc')](_0xeff9('0xd'),_0x50f6fc,_0xeff9('0xe'));_0x2ad14f(_0x29c96a[_0xeff9('0x14')]['message']);}})[_0xeff9('0x15')](function(_0x5923b1){logger[_0xeff9('0x11')](_0xeff9('0xd'),_0x50f6fc,_0x5923b1);_0x1b497a(_0x5923b1);});});}exports['GetZendeskAccount']=function(_0x2a33be){var _0x153c9e=this;return new Promise(function(_0x524d06,_0x397030){return db[_0xeff9('0x16')]['findAll']({'raw':_0x2a33be['options']?_0x2a33be['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a33be[_0xeff9('0x17')]?_0x2a33be[_0xeff9('0x17')][_0xeff9('0x18')]||null:null,'attributes':_0x2a33be['options']?_0x2a33be[_0xeff9('0x17')][_0xeff9('0x19')]||null:null,'limit':_0x2a33be[_0xeff9('0x17')]?_0x2a33be['options'][_0xeff9('0x1a')]||null:null,'include':_0x2a33be[_0xeff9('0x17')]?_0x2a33be[_0xeff9('0x17')][_0xeff9('0x1b')]?_[_0xeff9('0x1c')](_0x2a33be['options'][_0xeff9('0x1b')],function(_0x28ed34){return{'model':db[_0x28ed34[_0xeff9('0x1d')]],'as':_0x28ed34['as'],'attributes':_0x28ed34[_0xeff9('0x19')],'include':_0x28ed34[_0xeff9('0x1b')]?_[_0xeff9('0x1c')](_0x28ed34['include'],function(_0x4a0e9e){return{'model':db[_0x4a0e9e[_0xeff9('0x1d')]],'as':_0x4a0e9e['as'],'attributes':_0x4a0e9e[_0xeff9('0x19')],'include':_0x4a0e9e[_0xeff9('0x1b')]?_[_0xeff9('0x1c')](_0x4a0e9e['include'],function(_0x897384){return{'model':db[_0x897384[_0xeff9('0x1d')]],'as':_0x897384['as'],'attributes':_0x897384['attributes']};}):[]};}):[]};}):[]:[]})[_0xeff9('0x1e')](function(_0xd8b1a9){logger[_0xeff9('0xc')]('GetZendeskAccount',_0x2a33be);logger[_0xeff9('0x1f')](_0xeff9('0x20'),_0x2a33be,JSON[_0xeff9('0x10')](_0xd8b1a9));_0x524d06(_0xd8b1a9);})[_0xeff9('0x15')](function(_0x4606eb){logger[_0xeff9('0x11')](_0xeff9('0x20'),_0x4606eb['message'],_0x2a33be);_0x397030(_0x153c9e[_0xeff9('0x11')](0x1f4,_0x4606eb[_0xeff9('0x13')]));});});};exports[_0xeff9('0x21')]=function(_0x4d81e5){var _0x596859=this;return new Promise(function(_0x9c0daa,_0x16cb0f){return db[_0xeff9('0x16')][_0xeff9('0x22')]({'raw':_0x4d81e5[_0xeff9('0x17')]?_0x4d81e5[_0xeff9('0x17')][_0xeff9('0x23')]===undefined?!![]:![]:!![],'where':_0x4d81e5[_0xeff9('0x17')]?_0x4d81e5[_0xeff9('0x17')]['where']||null:null,'attributes':_0x4d81e5['options']?_0x4d81e5[_0xeff9('0x17')][_0xeff9('0x19')]||null:null,'include':_0x4d81e5[_0xeff9('0x17')]?_0x4d81e5['options']['include']?_[_0xeff9('0x1c')](_0x4d81e5['options'][_0xeff9('0x1b')],function(_0x5be41b){return{'model':db[_0x5be41b[_0xeff9('0x1d')]],'as':_0x5be41b['as'],'attributes':_0x5be41b[_0xeff9('0x19')],'include':_0x5be41b[_0xeff9('0x1b')]?_['map'](_0x5be41b[_0xeff9('0x1b')],function(_0x50ff86){return{'model':db[_0x50ff86['model']],'as':_0x50ff86['as'],'attributes':_0x50ff86[_0xeff9('0x19')],'include':_0x50ff86[_0xeff9('0x1b')]?_[_0xeff9('0x1c')](_0x50ff86['include'],function(_0x127e7f){return{'model':db[_0x127e7f['model']],'as':_0x127e7f['as'],'attributes':_0x127e7f[_0xeff9('0x19')]};}):[]};}):[]};}):[]:[]})[_0xeff9('0x1e')](function(_0x1ca640){logger[_0xeff9('0xc')](_0xeff9('0x21'),_0x4d81e5);logger[_0xeff9('0x1f')](_0xeff9('0x21'),_0x4d81e5,JSON[_0xeff9('0x10')](_0x1ca640));_0x9c0daa(_0x1ca640);})['catch'](function(_0x3f59bf){logger[_0xeff9('0x11')](_0xeff9('0x21'),_0x3f59bf[_0xeff9('0x13')],_0x4d81e5);_0x16cb0f(_0x596859[_0xeff9('0x11')](0x1f4,_0x3f59bf['message']));});});}; \ No newline at end of file +var _0xcd9b=['jayson/promise','client','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetZendeskAccount','findAll','options','where','attributes','limit','include','model','map','then','ZendeskAccount','find','raw','debug','ShowZendeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xcd9b,0x14d));var _0xbcd9=function(_0x1b6c94,_0x3b8395){_0x1b6c94=_0x1b6c94-0x0;var _0x300153=_0xcd9b[_0x1b6c94];return _0x300153;};'use strict';var _=require(_0xbcd9('0x0'));var util=require(_0xbcd9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcd9('0x2'));var fs=require('fs');var Redis=require(_0xbcd9('0x3'));var db=require(_0xbcd9('0x4'))['db'];var utils=require(_0xbcd9('0x5'));var logger=require(_0xbcd9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcd9('0x7'));var client=jayson[_0xbcd9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2be8ed,_0x516ed0,_0x2460af){return new BPromise(function(_0x520b56,_0x385b0f){return client['request'](_0x2be8ed,_0x2460af)['then'](function(_0x5d508b){logger[_0xbcd9('0x9')](_0xbcd9('0xa'),_0x516ed0,'request\x20sent');logger['debug'](_0xbcd9('0xb'),_0x516ed0,'request\x20sent',JSON[_0xbcd9('0xc')](_0x5d508b));if(_0x5d508b[_0xbcd9('0xd')]){if(_0x5d508b[_0xbcd9('0xd')][_0xbcd9('0xe')]===0x1f4){logger[_0xbcd9('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x516ed0,_0x5d508b['error'][_0xbcd9('0xf')]);return _0x385b0f(_0x5d508b[_0xbcd9('0xd')][_0xbcd9('0xf')]);}logger[_0xbcd9('0xd')](_0xbcd9('0xa'),_0x516ed0,_0x5d508b[_0xbcd9('0xd')][_0xbcd9('0xf')]);return _0x520b56(_0x5d508b[_0xbcd9('0xd')]['message']);}else{logger[_0xbcd9('0x9')](_0xbcd9('0xa'),_0x516ed0,_0xbcd9('0x10'));_0x520b56(_0x5d508b[_0xbcd9('0x11')][_0xbcd9('0xf')]);}})[_0xbcd9('0x12')](function(_0x5298dd){logger[_0xbcd9('0xd')](_0xbcd9('0xa'),_0x516ed0,_0x5298dd);_0x385b0f(_0x5298dd);});});}exports[_0xbcd9('0x13')]=function(_0x550230){var _0x26ba1c=this;return new Promise(function(_0xad63e6,_0x545b1b){return db['ZendeskAccount'][_0xbcd9('0x14')]({'raw':_0x550230[_0xbcd9('0x15')]?_0x550230[_0xbcd9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x550230[_0xbcd9('0x15')]?_0x550230[_0xbcd9('0x15')][_0xbcd9('0x16')]||null:null,'attributes':_0x550230[_0xbcd9('0x15')]?_0x550230['options'][_0xbcd9('0x17')]||null:null,'limit':_0x550230['options']?_0x550230['options'][_0xbcd9('0x18')]||null:null,'include':_0x550230[_0xbcd9('0x15')]?_0x550230[_0xbcd9('0x15')][_0xbcd9('0x19')]?_['map'](_0x550230['options'][_0xbcd9('0x19')],function(_0x2de29b){return{'model':db[_0x2de29b[_0xbcd9('0x1a')]],'as':_0x2de29b['as'],'attributes':_0x2de29b[_0xbcd9('0x17')],'include':_0x2de29b['include']?_[_0xbcd9('0x1b')](_0x2de29b['include'],function(_0x9da343){return{'model':db[_0x9da343[_0xbcd9('0x1a')]],'as':_0x9da343['as'],'attributes':_0x9da343[_0xbcd9('0x17')],'include':_0x9da343[_0xbcd9('0x19')]?_[_0xbcd9('0x1b')](_0x9da343[_0xbcd9('0x19')],function(_0x2710a6){return{'model':db[_0x2710a6[_0xbcd9('0x1a')]],'as':_0x2710a6['as'],'attributes':_0x2710a6['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcd9('0x1c')](function(_0x115885){logger['info'](_0xbcd9('0x13'),_0x550230);logger['debug']('GetZendeskAccount',_0x550230,JSON[_0xbcd9('0xc')](_0x115885));_0xad63e6(_0x115885);})[_0xbcd9('0x12')](function(_0x337c29){logger[_0xbcd9('0xd')]('GetZendeskAccount',_0x337c29[_0xbcd9('0xf')],_0x550230);_0x545b1b(_0x26ba1c['error'](0x1f4,_0x337c29['message']));});});};exports['ShowZendeskAccount']=function(_0x5780ab){var _0x1ecb12=this;return new Promise(function(_0x3598c9,_0xeb83f0){return db[_0xbcd9('0x1d')][_0xbcd9('0x1e')]({'raw':_0x5780ab[_0xbcd9('0x15')]?_0x5780ab['options'][_0xbcd9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5780ab[_0xbcd9('0x15')]?_0x5780ab['options']['where']||null:null,'attributes':_0x5780ab[_0xbcd9('0x15')]?_0x5780ab[_0xbcd9('0x15')][_0xbcd9('0x17')]||null:null,'include':_0x5780ab['options']?_0x5780ab[_0xbcd9('0x15')][_0xbcd9('0x19')]?_[_0xbcd9('0x1b')](_0x5780ab[_0xbcd9('0x15')][_0xbcd9('0x19')],function(_0x36e4ee){return{'model':db[_0x36e4ee[_0xbcd9('0x1a')]],'as':_0x36e4ee['as'],'attributes':_0x36e4ee[_0xbcd9('0x17')],'include':_0x36e4ee['include']?_['map'](_0x36e4ee[_0xbcd9('0x19')],function(_0x491981){return{'model':db[_0x491981[_0xbcd9('0x1a')]],'as':_0x491981['as'],'attributes':_0x491981[_0xbcd9('0x17')],'include':_0x491981[_0xbcd9('0x19')]?_['map'](_0x491981[_0xbcd9('0x19')],function(_0x166266){return{'model':db[_0x166266['model']],'as':_0x166266['as'],'attributes':_0x166266['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcd9('0x1c')](function(_0x1edf91){logger[_0xbcd9('0x9')]('ShowZendeskAccount',_0x5780ab);logger[_0xbcd9('0x20')]('ShowZendeskAccount',_0x5780ab,JSON[_0xbcd9('0xc')](_0x1edf91));_0x3598c9(_0x1edf91);})[_0xbcd9('0x12')](function(_0x1ae6b9){logger[_0xbcd9('0xd')](_0xbcd9('0x21'),_0x1ae6b9[_0xbcd9('0xf')],_0x5780ab);_0xeb83f0(_0x1ecb12[_0xbcd9('0xd')](0x1f4,_0x1ae6b9[_0xbcd9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d46d04a..15694aa 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 _0x7916=['getDescriptions','get','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x26c2c0,_0xf435cd){var _0x599c35=function(_0x231d53){while(--_0x231d53){_0x26c2c0['push'](_0x26c2c0['shift']());}};_0x599c35(++_0xf435cd);}(_0x7916,0x128));var _0x6791=function(_0x277f99,_0x4d4894){_0x277f99=_0x277f99-0x0;var _0x28b7a3=_0x7916[_0x277f99];return _0x28b7a3;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id/fields',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')](_0x6791('0x12'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x14')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x15')]);router[_0x6791('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6791('0x16')]);router['put'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0x17')]);router[_0x6791('0x18')]('/:id',auth[_0x6791('0x8')](),controller['destroy']);module[_0x6791('0x19')]=router; \ No newline at end of file +var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x37b014,_0x34b911){var _0x2098f4=function(_0x295eb3){while(--_0x295eb3){_0x37b014['push'](_0x37b014['shift']());}};_0x2098f4(++_0x34b911);}(_0xf4eb,0xec));var _0xbf4e=function(_0x293695,_0x19faa4){_0x293695=_0x293695-0x0;var _0x166831=_0xf4eb[_0x293695];return _0x166831;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 203f077..2ac7604 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 _0x96c9=['exports','STRING'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0x96c9,0xc4));var _0x996c=function(_0x51a0f9,_0x25294e){_0x51a0f9=_0x51a0f9-0x0;var _0x42b01b=_0x96c9[_0x51a0f9];return _0x42b01b;};'use strict';var Sequelize=require('sequelize');module[_0x996c('0x0')]={'name':{'type':Sequelize[_0x996c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65ba=['STRING','sequelize','exports'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x65ba,0x169));var _0xa65b=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0x65ba[_0x299027];return _0x1bc622;};'use strict';var Sequelize=require(_0xa65b('0x0'));module[_0xa65b('0x1')]={'name':{'type':Sequelize[_0xa65b('0x2')]},'description':{'type':Sequelize[_0xa65b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e8cef50..f8a93d5 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 _0x3646=['pick','filter','merge','VIRTUAL','options','count','includeAll','include','then','rows','catch','params','find','create','update','body','getFields','ZendeskField','order','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x3646,0xc4));var _0x6364=function(_0x4ad0c6,_0x25681d){_0x4ad0c6=_0x4ad0c6-0x0;var _0x859edd=_0x3646[_0x4ad0c6];return _0x859edd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6364('0x0'));var rp=require(_0x6364('0x1'));var moment=require(_0x6364('0x2'));var BPromise=require(_0x6364('0x3'));var Mustache=require(_0x6364('0x4'));var util=require(_0x6364('0x5'));var path=require('path');var sox=require(_0x6364('0x6'));var csv=require(_0x6364('0x7'));var ejs=require(_0x6364('0x8'));var fs=require('fs');var fs_extra=require(_0x6364('0x9'));var _=require(_0x6364('0xa'));var squel=require(_0x6364('0xb'));var crypto=require(_0x6364('0xc'));var jsforce=require(_0x6364('0xd'));var deskjs=require(_0x6364('0xe'));var toCsv=require(_0x6364('0x7'));var querystring=require(_0x6364('0xf'));var Papa=require('papaparse');var Redis=require(_0x6364('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6364('0x11'));var hardwareService=require(_0x6364('0x12'));var logger=require('../../config/logger')(_0x6364('0x13'));var utils=require(_0x6364('0x14'));var config=require(_0x6364('0x15'));var licenseUtil=require(_0x6364('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1571db,_0x5bdcc4){_0x5bdcc4=_0x5bdcc4||0xcc;return function(_0x391308){if(_0x391308){return _0x1571db['sendStatus'](_0x5bdcc4);}return _0x1571db[_0x6364('0x17')](_0x5bdcc4)[_0x6364('0x18')]();};}function respondWithResult(_0x45c725,_0x3a3ee1){_0x3a3ee1=_0x3a3ee1||0xc8;return function(_0x18a402){if(_0x18a402){return _0x45c725[_0x6364('0x17')](_0x3a3ee1)['json'](_0x18a402);}};}function respondWithFilteredResult(_0x154821,_0x19e9e5){return function(_0x4f6cf4){if(_0x4f6cf4){var _0x22ab3b=typeof _0x19e9e5[_0x6364('0x19')]===_0x6364('0x1a')&&typeof _0x19e9e5[_0x6364('0x1b')]===_0x6364('0x1a');var _0x2fdd6d=_0x4f6cf4['count'];var _0x40f28f=_0x22ab3b?0x0:_0x19e9e5[_0x6364('0x19')];var _0x2445f7=_0x22ab3b?_0x4f6cf4['count']:_0x19e9e5[_0x6364('0x19')]+_0x19e9e5[_0x6364('0x1b')];var _0x59a6d1;if(_0x2445f7>=_0x2fdd6d){_0x2445f7=_0x2fdd6d;_0x59a6d1=0xc8;}else{_0x59a6d1=0xce;}_0x154821[_0x6364('0x17')](_0x59a6d1);return _0x154821[_0x6364('0x1c')](_0x6364('0x1d'),_0x40f28f+'-'+_0x2445f7+'/'+_0x2fdd6d)[_0x6364('0x1e')](_0x4f6cf4);}return null;};}function patchUpdates(_0x5d4bde){return function(_0x13da8a){try{jsonpatch[_0x6364('0x1f')](_0x13da8a,_0x5d4bde,!![]);}catch(_0x582557){return BPromise[_0x6364('0x20')](_0x582557);}return _0x13da8a[_0x6364('0x21')]();};}function saveUpdates(_0x26af2b,_0x4f7f32){return function(_0xdb3db1){if(_0xdb3db1){return _0xdb3db1['update'](_0x26af2b)['then'](function(_0x27802e){return _0x27802e;});}return null;};}function removeEntity(_0x5e6dcf,_0xb1538b){return function(_0x2cc15b){if(_0x2cc15b){return _0x2cc15b[_0x6364('0x22')]()['then'](function(){_0x5e6dcf[_0x6364('0x17')](0xcc)[_0x6364('0x18')]();});}};}function handleEntityNotFound(_0x1bdf13,_0x5b8f2f){return function(_0x40d45f){if(!_0x40d45f){_0x1bdf13[_0x6364('0x23')](0x194);}return _0x40d45f;};}function handleError(_0x102148,_0x1ee330){_0x1ee330=_0x1ee330||0x1f4;return function(_0x46b352){logger[_0x6364('0x24')](_0x46b352[_0x6364('0x25')]);if(_0x46b352[_0x6364('0x26')]){delete _0x46b352['name'];}_0x102148['status'](_0x1ee330)[_0x6364('0x27')](_0x46b352);};}exports[_0x6364('0x28')]=function(_0x38bef0,_0x3978a7){var _0x5bf36e={},_0x43ba30={},_0x4542a1={'count':0x0,'rows':[]};var _0x4a6b93=_[_0x6364('0x29')](db[_0x6364('0x2a')][_0x6364('0x2b')],function(_0x5ae325){return{'name':_0x5ae325[_0x6364('0x2c')],'type':_0x5ae325[_0x6364('0x2d')][_0x6364('0x2e')]};});_0x43ba30[_0x6364('0x2f')]=_[_0x6364('0x29')](_0x4a6b93,_0x6364('0x26'));_0x43ba30[_0x6364('0x30')]=_[_0x6364('0x31')](_0x38bef0[_0x6364('0x30')]);_0x43ba30[_0x6364('0x32')]=_[_0x6364('0x33')](_0x43ba30[_0x6364('0x2f')],_0x43ba30[_0x6364('0x30')]);_0x5bf36e[_0x6364('0x34')]=_[_0x6364('0x33')](_0x43ba30[_0x6364('0x2f')],qs[_0x6364('0x35')](_0x38bef0[_0x6364('0x30')]['fields']));_0x5bf36e[_0x6364('0x34')]=_0x5bf36e[_0x6364('0x34')][_0x6364('0x36')]?_0x5bf36e[_0x6364('0x34')]:_0x43ba30['model'];if(!_0x38bef0[_0x6364('0x30')][_0x6364('0x37')](_0x6364('0x38'))){_0x5bf36e[_0x6364('0x1b')]=qs['limit'](_0x38bef0['query'][_0x6364('0x1b')]);_0x5bf36e[_0x6364('0x19')]=qs[_0x6364('0x19')](_0x38bef0[_0x6364('0x30')][_0x6364('0x19')]);}_0x5bf36e['order']=qs[_0x6364('0x39')](_0x38bef0['query'][_0x6364('0x39')]);_0x5bf36e[_0x6364('0x3a')]=qs[_0x6364('0x32')](_[_0x6364('0x3b')](_0x38bef0[_0x6364('0x30')],_0x43ba30[_0x6364('0x32')]),_0x4a6b93);if(_0x38bef0[_0x6364('0x30')][_0x6364('0x3c')]){_0x5bf36e[_0x6364('0x3a')]=_[_0x6364('0x3d')](_0x5bf36e[_0x6364('0x3a')],{'$or':_[_0x6364('0x29')](_0x4a6b93,function(_0x3a3ea3){if(_0x3a3ea3[_0x6364('0x2d')]!==_0x6364('0x3e')){var _0x2962c5={};_0x2962c5[_0x3a3ea3['name']]={'$like':'%'+_0x38bef0[_0x6364('0x30')][_0x6364('0x3c')]+'%'};return _0x2962c5;}})});}_0x5bf36e=_[_0x6364('0x3d')]({},_0x5bf36e,_0x38bef0[_0x6364('0x3f')]);var _0x5cbd89={'where':_0x5bf36e[_0x6364('0x3a')]};return db[_0x6364('0x2a')][_0x6364('0x40')](_0x5cbd89)['then'](function(_0x2c5f49){_0x4542a1[_0x6364('0x40')]=_0x2c5f49;if(_0x38bef0[_0x6364('0x30')][_0x6364('0x41')]){_0x5bf36e[_0x6364('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x5bf36e);})[_0x6364('0x43')](function(_0x3a8099){_0x4542a1[_0x6364('0x44')]=_0x3a8099;return _0x4542a1;})[_0x6364('0x43')](respondWithFilteredResult(_0x3978a7,_0x5bf36e))[_0x6364('0x45')](handleError(_0x3978a7,null));};exports['show']=function(_0x9c8592,_0x1dcbca){var _0x43bed0={'raw':![],'where':{'id':_0x9c8592[_0x6364('0x46')]['id']}},_0x17023a={};_0x17023a[_0x6364('0x2f')]=_[_0x6364('0x31')](db[_0x6364('0x2a')][_0x6364('0x2b')]);_0x17023a[_0x6364('0x30')]=_[_0x6364('0x31')](_0x9c8592[_0x6364('0x30')]);_0x17023a['filters']=_['intersection'](_0x17023a[_0x6364('0x2f')],_0x17023a[_0x6364('0x30')]);_0x43bed0['attributes']=_['intersection'](_0x17023a[_0x6364('0x2f')],qs['fields'](_0x9c8592[_0x6364('0x30')][_0x6364('0x35')]));_0x43bed0[_0x6364('0x34')]=_0x43bed0['attributes'][_0x6364('0x36')]?_0x43bed0['attributes']:_0x17023a[_0x6364('0x2f')];if(_0x9c8592[_0x6364('0x30')][_0x6364('0x41')]){_0x43bed0[_0x6364('0x42')]=[{'all':!![]}];}_0x43bed0=_[_0x6364('0x3d')]({},_0x43bed0,_0x9c8592[_0x6364('0x3f')]);return db[_0x6364('0x2a')][_0x6364('0x47')](_0x43bed0)['then'](handleEntityNotFound(_0x1dcbca,null))[_0x6364('0x43')](respondWithResult(_0x1dcbca,null))['catch'](handleError(_0x1dcbca,null));};exports[_0x6364('0x48')]=function(_0x3aedec,_0x509f07){return db[_0x6364('0x2a')][_0x6364('0x48')](_0x3aedec['body'],{})[_0x6364('0x43')](respondWithResult(_0x509f07,0xc9))[_0x6364('0x45')](handleError(_0x509f07,null));};exports[_0x6364('0x49')]=function(_0x2d9a2f,_0x29f20c){if(_0x2d9a2f['body']['id']){delete _0x2d9a2f[_0x6364('0x4a')]['id'];}return db[_0x6364('0x2a')][_0x6364('0x47')]({'where':{'id':_0x2d9a2f[_0x6364('0x46')]['id']}})[_0x6364('0x43')](handleEntityNotFound(_0x29f20c,null))[_0x6364('0x43')](saveUpdates(_0x2d9a2f['body'],null))[_0x6364('0x43')](respondWithResult(_0x29f20c,null))[_0x6364('0x45')](handleError(_0x29f20c,null));};exports[_0x6364('0x22')]=function(_0x3c938d,_0x5add3c){return db[_0x6364('0x2a')][_0x6364('0x47')]({'where':{'id':_0x3c938d[_0x6364('0x46')]['id']}})[_0x6364('0x43')](handleEntityNotFound(_0x5add3c,null))[_0x6364('0x43')](removeEntity(_0x5add3c,null))[_0x6364('0x45')](handleError(_0x5add3c,null));};exports[_0x6364('0x4b')]=function(_0x57392b,_0x99c098,_0x994782){var _0x542a70={};var _0x305403={};var _0x4a7ec1;var _0x4fb938;return db[_0x6364('0x2a')]['findOne']({'where':{'id':_0x57392b[_0x6364('0x46')]['id']}})['then'](handleEntityNotFound(_0x99c098,null))[_0x6364('0x43')](function(_0xc8dc1a){if(_0xc8dc1a){_0x4a7ec1=_0xc8dc1a;_0x305403[_0x6364('0x2f')]=_[_0x6364('0x31')](db[_0x6364('0x4c')][_0x6364('0x2b')]);_0x305403['query']=_[_0x6364('0x31')](_0x57392b[_0x6364('0x30')]);_0x305403[_0x6364('0x32')]=_[_0x6364('0x33')](_0x305403['model'],_0x305403[_0x6364('0x30')]);_0x542a70[_0x6364('0x34')]=_['intersection'](_0x305403[_0x6364('0x2f')],qs[_0x6364('0x35')](_0x57392b[_0x6364('0x30')][_0x6364('0x35')]));_0x542a70[_0x6364('0x34')]=_0x542a70[_0x6364('0x34')][_0x6364('0x36')]?_0x542a70[_0x6364('0x34')]:_0x305403[_0x6364('0x2f')];_0x542a70[_0x6364('0x4d')]=qs[_0x6364('0x39')](_0x57392b[_0x6364('0x30')][_0x6364('0x39')]);_0x542a70[_0x6364('0x3a')]=qs[_0x6364('0x32')](_['pick'](_0x57392b[_0x6364('0x30')],_0x305403['filters']));if(_0x57392b['query'][_0x6364('0x3c')]){_0x542a70[_0x6364('0x3a')]=_['merge'](_0x542a70[_0x6364('0x3a')],{'$or':_[_0x6364('0x29')](_0x542a70[_0x6364('0x34')],function(_0x11d2ce){var _0x3701e7={};_0x3701e7[_0x11d2ce]={'$like':'%'+_0x57392b[_0x6364('0x30')][_0x6364('0x3c')]+'%'};return _0x3701e7;})});}_0x542a70=_[_0x6364('0x3d')]({},_0x542a70,_0x57392b[_0x6364('0x3f')]);return _0x4a7ec1['getFields'](_0x542a70);}})[_0x6364('0x43')](function(_0x57c053){if(_0x57c053){_0x4fb938=_0x57c053[_0x6364('0x36')];if(!_0x57392b[_0x6364('0x30')]['hasOwnProperty'](_0x6364('0x38'))){_0x542a70[_0x6364('0x1b')]=qs[_0x6364('0x1b')](_0x57392b[_0x6364('0x30')][_0x6364('0x1b')]);_0x542a70[_0x6364('0x19')]=qs[_0x6364('0x19')](_0x57392b[_0x6364('0x30')]['offset']);}return _0x4a7ec1[_0x6364('0x4b')](_0x542a70);}})[_0x6364('0x43')](function(_0x350bd9){if(_0x350bd9){return _0x350bd9?{'count':_0x4fb938,'rows':_0x350bd9}:null;}})[_0x6364('0x43')](respondWithResult(_0x99c098,null))[_0x6364('0x45')](handleError(_0x99c098,null));};exports[_0x6364('0x4e')]=function(_0x4e14a4,_0x21a671,_0x223296){var _0x1617a4={};var _0x3f0034={};var _0x3565a4;var _0x2d7e2d;return db[_0x6364('0x2a')][_0x6364('0x4f')]({'where':{'id':_0x4e14a4[_0x6364('0x46')]['id']}})[_0x6364('0x43')](handleEntityNotFound(_0x21a671,null))['then'](function(_0xe83535){if(_0xe83535){_0x3565a4=_0xe83535;_0x3f0034[_0x6364('0x2f')]=_[_0x6364('0x31')](db[_0x6364('0x4c')][_0x6364('0x2b')]);_0x3f0034[_0x6364('0x30')]=_[_0x6364('0x31')](_0x4e14a4[_0x6364('0x30')]);_0x3f0034[_0x6364('0x32')]=_[_0x6364('0x33')](_0x3f0034[_0x6364('0x2f')],_0x3f0034[_0x6364('0x30')]);_0x1617a4['attributes']=_[_0x6364('0x33')](_0x3f0034[_0x6364('0x2f')],qs[_0x6364('0x35')](_0x4e14a4[_0x6364('0x30')][_0x6364('0x35')]));_0x1617a4[_0x6364('0x34')]=_0x1617a4['attributes'][_0x6364('0x36')]?_0x1617a4[_0x6364('0x34')]:_0x3f0034[_0x6364('0x2f')];_0x1617a4['order']=qs[_0x6364('0x39')](_0x4e14a4[_0x6364('0x30')]['sort']);_0x1617a4[_0x6364('0x3a')]=qs[_0x6364('0x32')](_[_0x6364('0x3b')](_0x4e14a4[_0x6364('0x30')],_0x3f0034[_0x6364('0x32')]));if(_0x4e14a4[_0x6364('0x30')][_0x6364('0x3c')]){_0x1617a4[_0x6364('0x3a')]=_['merge'](_0x1617a4[_0x6364('0x3a')],{'$or':_['map'](_0x1617a4['attributes'],function(_0x1d9fab){var _0x1227f3={};_0x1227f3[_0x1d9fab]={'$like':'%'+_0x4e14a4[_0x6364('0x30')][_0x6364('0x3c')]+'%'};return _0x1227f3;})});}_0x1617a4=_[_0x6364('0x3d')]({},_0x1617a4,_0x4e14a4[_0x6364('0x3f')]);return _0x3565a4[_0x6364('0x4e')](_0x1617a4);}})[_0x6364('0x43')](function(_0x3c3294){if(_0x3c3294){_0x2d7e2d=_0x3c3294[_0x6364('0x36')];if(!_0x4e14a4[_0x6364('0x30')][_0x6364('0x37')](_0x6364('0x38'))){_0x1617a4[_0x6364('0x1b')]=qs[_0x6364('0x1b')](_0x4e14a4[_0x6364('0x30')]['limit']);_0x1617a4[_0x6364('0x19')]=qs[_0x6364('0x19')](_0x4e14a4['query']['offset']);}return _0x3565a4[_0x6364('0x4e')](_0x1617a4);}})[_0x6364('0x43')](function(_0x73361b){if(_0x73361b){return _0x73361b?{'count':_0x2d7e2d,'rows':_0x73361b}:null;}})['then'](respondWithResult(_0x21a671,null))[_0x6364('0x45')](handleError(_0x21a671,null));};exports['getDescriptions']=function(_0x3d1a07,_0x6b0ece,_0x280216){var _0xe9876f={};var _0x784e64={};var _0x331fca;var _0x53c792;return db[_0x6364('0x2a')][_0x6364('0x4f')]({'where':{'id':_0x3d1a07['params']['id']}})[_0x6364('0x43')](handleEntityNotFound(_0x6b0ece,null))['then'](function(_0x48e07d){if(_0x48e07d){_0x331fca=_0x48e07d;_0x784e64[_0x6364('0x2f')]=_[_0x6364('0x31')](db[_0x6364('0x4c')]['rawAttributes']);_0x784e64[_0x6364('0x30')]=_['keys'](_0x3d1a07[_0x6364('0x30')]);_0x784e64[_0x6364('0x32')]=_['intersection'](_0x784e64[_0x6364('0x2f')],_0x784e64[_0x6364('0x30')]);_0xe9876f[_0x6364('0x34')]=_['intersection'](_0x784e64[_0x6364('0x2f')],qs[_0x6364('0x35')](_0x3d1a07[_0x6364('0x30')][_0x6364('0x35')]));_0xe9876f[_0x6364('0x34')]=_0xe9876f[_0x6364('0x34')][_0x6364('0x36')]?_0xe9876f[_0x6364('0x34')]:_0x784e64[_0x6364('0x2f')];_0xe9876f[_0x6364('0x4d')]=qs[_0x6364('0x39')](_0x3d1a07[_0x6364('0x30')][_0x6364('0x39')]);_0xe9876f[_0x6364('0x3a')]=qs['filters'](_[_0x6364('0x3b')](_0x3d1a07[_0x6364('0x30')],_0x784e64[_0x6364('0x32')]));if(_0x3d1a07[_0x6364('0x30')][_0x6364('0x3c')]){_0xe9876f[_0x6364('0x3a')]=_[_0x6364('0x3d')](_0xe9876f[_0x6364('0x3a')],{'$or':_['map'](_0xe9876f['attributes'],function(_0x14b8c1){var _0x2ef99f={};_0x2ef99f[_0x14b8c1]={'$like':'%'+_0x3d1a07[_0x6364('0x30')][_0x6364('0x3c')]+'%'};return _0x2ef99f;})});}_0xe9876f=_[_0x6364('0x3d')]({},_0xe9876f,_0x3d1a07[_0x6364('0x3f')]);return _0x331fca[_0x6364('0x50')](_0xe9876f);}})[_0x6364('0x43')](function(_0x50a0b2){if(_0x50a0b2){_0x53c792=_0x50a0b2['length'];if(!_0x3d1a07[_0x6364('0x30')][_0x6364('0x37')](_0x6364('0x38'))){_0xe9876f[_0x6364('0x1b')]=qs[_0x6364('0x1b')](_0x3d1a07[_0x6364('0x30')][_0x6364('0x1b')]);_0xe9876f['offset']=qs[_0x6364('0x19')](_0x3d1a07['query'][_0x6364('0x19')]);}return _0x331fca[_0x6364('0x50')](_0xe9876f);}})[_0x6364('0x43')](function(_0x1bf36a){if(_0x1bf36a){return _0x1bf36a?{'count':_0x53c792,'rows':_0x1bf36a}:null;}})[_0x6364('0x43')](respondWithResult(_0x6b0ece,null))[_0x6364('0x45')](handleError(_0x6b0ece,null));};exports['getTags']=function(_0x2c20e1,_0x4c8ad4,_0x5ccdd8){var _0x5e1193={};var _0x1170e9={};var _0x13a12e;var _0x32953b;return db[_0x6364('0x2a')][_0x6364('0x4f')]({'where':{'id':_0x2c20e1[_0x6364('0x46')]['id']}})[_0x6364('0x43')](handleEntityNotFound(_0x4c8ad4,null))[_0x6364('0x43')](function(_0x728526){if(_0x728526){_0x13a12e=_0x728526;_0x1170e9[_0x6364('0x2f')]=_['keys'](db[_0x6364('0x51')][_0x6364('0x2b')]);_0x1170e9['query']=_[_0x6364('0x31')](_0x2c20e1[_0x6364('0x30')]);_0x1170e9[_0x6364('0x32')]=_[_0x6364('0x33')](_0x1170e9[_0x6364('0x2f')],_0x1170e9[_0x6364('0x30')]);_0x5e1193['attributes']=_[_0x6364('0x33')](_0x1170e9[_0x6364('0x2f')],qs[_0x6364('0x35')](_0x2c20e1['query'][_0x6364('0x35')]));_0x5e1193[_0x6364('0x34')]=_0x5e1193['attributes'][_0x6364('0x36')]?_0x5e1193['attributes']:_0x1170e9[_0x6364('0x2f')];_0x5e1193['order']=qs[_0x6364('0x39')](_0x2c20e1['query'][_0x6364('0x39')]);_0x5e1193[_0x6364('0x3a')]=qs[_0x6364('0x32')](_[_0x6364('0x3b')](_0x2c20e1[_0x6364('0x30')],_0x1170e9[_0x6364('0x32')]));if(_0x2c20e1[_0x6364('0x30')][_0x6364('0x3c')]){_0x5e1193[_0x6364('0x3a')]=_[_0x6364('0x3d')](_0x5e1193[_0x6364('0x3a')],{'$or':_[_0x6364('0x29')](_0x5e1193['attributes'],function(_0x1967e5){var _0x2b38db={};_0x2b38db[_0x1967e5]={'$like':'%'+_0x2c20e1[_0x6364('0x30')][_0x6364('0x3c')]+'%'};return _0x2b38db;})});}_0x5e1193=_[_0x6364('0x3d')]({},_0x5e1193,_0x2c20e1['options']);return _0x13a12e[_0x6364('0x52')](_0x5e1193);}})['then'](function(_0x284e24){if(_0x284e24){_0x32953b=_0x284e24[_0x6364('0x36')];if(!_0x2c20e1['query']['hasOwnProperty'](_0x6364('0x38'))){_0x5e1193['limit']=qs[_0x6364('0x1b')](_0x2c20e1['query'][_0x6364('0x1b')]);_0x5e1193[_0x6364('0x19')]=qs['offset'](_0x2c20e1[_0x6364('0x30')]['offset']);}return _0x13a12e[_0x6364('0x52')](_0x5e1193);}})['then'](function(_0x5114a6){if(_0x5114a6){return _0x5114a6?{'count':_0x32953b,'rows':_0x5114a6}:null;}})['then'](respondWithResult(_0x4c8ad4,null))[_0x6364('0x45')](handleError(_0x4c8ad4,null));};exports[_0x6364('0x53')]=function(_0x33e592,_0x572b9e,_0x52c200){if(_0x33e592[_0x6364('0x4a')]['id']){delete _0x33e592[_0x6364('0x4a')]['id'];}return db[_0x6364('0x2a')][_0x6364('0x4f')]({'where':{'id':_0x33e592[_0x6364('0x46')]['id']}})['then'](handleEntityNotFound(_0x572b9e,null))[_0x6364('0x43')](function(_0x4d8073){if(_0x4d8073){return _0x4d8073['setTags'](_0x33e592[_0x6364('0x4a')][_0x6364('0x54')]||[]);}return null;})[_0x6364('0x43')](respondWithResult(_0x572b9e,null))[_0x6364('0x45')](handleError(_0x572b9e,null));}; \ No newline at end of file +var _0xe6da=['query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','ZendeskField','getSubjects','hasOwnProperty','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type'];(function(_0x185d97,_0x21ea29){var _0x14f88c=function(_0x8a114d){while(--_0x8a114d){_0x185d97['push'](_0x185d97['shift']());}};_0x14f88c(++_0x21ea29);}(_0xe6da,0x132));var _0xae6d=function(_0x57a149,_0x36cfc5){_0x57a149=_0x57a149-0x0;var _0x19fb05=_0xe6da[_0x57a149];return _0x19fb05;};'use strict';var emlformat=require(_0xae6d('0x0'));var rimraf=require(_0xae6d('0x1'));var zipdir=require(_0xae6d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae6d('0x3'));var moment=require(_0xae6d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae6d('0x5'));var util=require(_0xae6d('0x6'));var path=require(_0xae6d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae6d('0x8'));var fs=require('fs');var fs_extra=require(_0xae6d('0x9'));var _=require(_0xae6d('0xa'));var squel=require(_0xae6d('0xb'));var crypto=require(_0xae6d('0xc'));var jsforce=require(_0xae6d('0xd'));var deskjs=require(_0xae6d('0xe'));var toCsv=require(_0xae6d('0xf'));var querystring=require(_0xae6d('0x10'));var Papa=require(_0xae6d('0x11'));var Redis=require(_0xae6d('0x12'));var authService=require(_0xae6d('0x13'));var qs=require(_0xae6d('0x14'));var as=require(_0xae6d('0x15'));var hardwareService=require(_0xae6d('0x16'));var logger=require(_0xae6d('0x17'))(_0xae6d('0x18'));var utils=require(_0xae6d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xae6d('0x1a'));var db=require(_0xae6d('0x1b'))['db'];function respondWithStatusCode(_0x15f838,_0xb29ead){_0xb29ead=_0xb29ead||0xcc;return function(_0x3c3bb8){if(_0x3c3bb8){return _0x15f838[_0xae6d('0x1c')](_0xb29ead);}return _0x15f838[_0xae6d('0x1d')](_0xb29ead)[_0xae6d('0x1e')]();};}function respondWithResult(_0x1bd2a6,_0x18f424){_0x18f424=_0x18f424||0xc8;return function(_0x2dfecc){if(_0x2dfecc){return _0x1bd2a6['status'](_0x18f424)[_0xae6d('0x1f')](_0x2dfecc);}};}function respondWithFilteredResult(_0x5efa36,_0x328efa){return function(_0x4c91d2){if(_0x4c91d2){var _0x48ef01=typeof _0x328efa['offset']===_0xae6d('0x20')&&typeof _0x328efa[_0xae6d('0x21')]===_0xae6d('0x20');var _0x499b6a=_0x4c91d2[_0xae6d('0x22')];var _0x530dc7=_0x48ef01?0x0:_0x328efa[_0xae6d('0x23')];var _0x16b14b=_0x48ef01?_0x4c91d2[_0xae6d('0x22')]:_0x328efa[_0xae6d('0x23')]+_0x328efa['limit'];var _0x329432;if(_0x16b14b>=_0x499b6a){_0x16b14b=_0x499b6a;_0x329432=0xc8;}else{_0x329432=0xce;}_0x5efa36[_0xae6d('0x1d')](_0x329432);return _0x5efa36[_0xae6d('0x24')](_0xae6d('0x25'),_0x530dc7+'-'+_0x16b14b+'/'+_0x499b6a)[_0xae6d('0x1f')](_0x4c91d2);}return null;};}function patchUpdates(_0x19ea17){return function(_0x2d9130){try{jsonpatch[_0xae6d('0x26')](_0x2d9130,_0x19ea17,!![]);}catch(_0xa0155e){return BPromise[_0xae6d('0x27')](_0xa0155e);}return _0x2d9130[_0xae6d('0x28')]();};}function saveUpdates(_0x3dcbe9,_0x561350){return function(_0x4a8049){if(_0x4a8049){return _0x4a8049[_0xae6d('0x29')](_0x3dcbe9)[_0xae6d('0x2a')](function(_0x51b177){return _0x51b177;});}return null;};}function removeEntity(_0x81fd6c,_0x4ba397){return function(_0x4a06df){if(_0x4a06df){return _0x4a06df[_0xae6d('0x2b')]()[_0xae6d('0x2a')](function(){_0x81fd6c['status'](0xcc)[_0xae6d('0x1e')]();});}};}function handleEntityNotFound(_0x3c05e8,_0x1f5b33){return function(_0x1aa5c2){if(!_0x1aa5c2){_0x3c05e8[_0xae6d('0x1c')](0x194);}return _0x1aa5c2;};}function handleError(_0x6568ee,_0x417975){_0x417975=_0x417975||0x1f4;return function(_0x34ae8d){logger[_0xae6d('0x2c')](_0x34ae8d[_0xae6d('0x2d')]);if(_0x34ae8d[_0xae6d('0x2e')]){delete _0x34ae8d[_0xae6d('0x2e')];}_0x6568ee[_0xae6d('0x1d')](_0x417975)[_0xae6d('0x2f')](_0x34ae8d);};}exports[_0xae6d('0x30')]=function(_0x156be6,_0x578831){var _0x5a4349={},_0x4b2fe4={},_0x254cf8={'count':0x0,'rows':[]};var _0x2fbdcc=_[_0xae6d('0x31')](db[_0xae6d('0x32')][_0xae6d('0x33')],function(_0x40b565){return{'name':_0x40b565[_0xae6d('0x34')],'type':_0x40b565[_0xae6d('0x35')]['key']};});_0x4b2fe4['model']=_[_0xae6d('0x31')](_0x2fbdcc,_0xae6d('0x2e'));_0x4b2fe4['query']=_['keys'](_0x156be6[_0xae6d('0x36')]);_0x4b2fe4[_0xae6d('0x37')]=_[_0xae6d('0x38')](_0x4b2fe4[_0xae6d('0x39')],_0x4b2fe4[_0xae6d('0x36')]);_0x5a4349[_0xae6d('0x3a')]=_[_0xae6d('0x38')](_0x4b2fe4[_0xae6d('0x39')],qs['fields'](_0x156be6[_0xae6d('0x36')][_0xae6d('0x3b')]));_0x5a4349['attributes']=_0x5a4349[_0xae6d('0x3a')][_0xae6d('0x3c')]?_0x5a4349[_0xae6d('0x3a')]:_0x4b2fe4[_0xae6d('0x39')];if(!_0x156be6['query']['hasOwnProperty'](_0xae6d('0x3d'))){_0x5a4349[_0xae6d('0x21')]=qs[_0xae6d('0x21')](_0x156be6[_0xae6d('0x36')][_0xae6d('0x21')]);_0x5a4349[_0xae6d('0x23')]=qs[_0xae6d('0x23')](_0x156be6[_0xae6d('0x36')][_0xae6d('0x23')]);}_0x5a4349[_0xae6d('0x3e')]=qs[_0xae6d('0x3f')](_0x156be6[_0xae6d('0x36')]['sort']);_0x5a4349[_0xae6d('0x40')]=qs[_0xae6d('0x37')](_[_0xae6d('0x41')](_0x156be6[_0xae6d('0x36')],_0x4b2fe4[_0xae6d('0x37')]),_0x2fbdcc);if(_0x156be6['query'][_0xae6d('0x42')]){_0x5a4349[_0xae6d('0x40')]=_[_0xae6d('0x43')](_0x5a4349[_0xae6d('0x40')],{'$or':_[_0xae6d('0x31')](_0x2fbdcc,function(_0x2349ee){if(_0x2349ee[_0xae6d('0x35')]!==_0xae6d('0x44')){var _0x467b10={};_0x467b10[_0x2349ee['name']]={'$like':'%'+_0x156be6[_0xae6d('0x36')][_0xae6d('0x42')]+'%'};return _0x467b10;}})});}_0x5a4349=_[_0xae6d('0x43')]({},_0x5a4349,_0x156be6[_0xae6d('0x45')]);var _0x43c933={'where':_0x5a4349['where']};return db['ZendeskConfiguration'][_0xae6d('0x22')](_0x43c933)[_0xae6d('0x2a')](function(_0x10f4f8){_0x254cf8[_0xae6d('0x22')]=_0x10f4f8;if(_0x156be6[_0xae6d('0x36')][_0xae6d('0x46')]){_0x5a4349[_0xae6d('0x47')]=[{'all':!![]}];}return db[_0xae6d('0x32')][_0xae6d('0x48')](_0x5a4349);})[_0xae6d('0x2a')](function(_0x254b24){_0x254cf8[_0xae6d('0x49')]=_0x254b24;return _0x254cf8;})[_0xae6d('0x2a')](respondWithFilteredResult(_0x578831,_0x5a4349))[_0xae6d('0x4a')](handleError(_0x578831,null));};exports[_0xae6d('0x4b')]=function(_0x2fbb8f,_0x499d7f){var _0x3b22d7={'raw':![],'where':{'id':_0x2fbb8f[_0xae6d('0x4c')]['id']}},_0x2d547e={};_0x2d547e['model']=_[_0xae6d('0x4d')](db[_0xae6d('0x32')][_0xae6d('0x33')]);_0x2d547e[_0xae6d('0x36')]=_[_0xae6d('0x4d')](_0x2fbb8f['query']);_0x2d547e[_0xae6d('0x37')]=_[_0xae6d('0x38')](_0x2d547e[_0xae6d('0x39')],_0x2d547e[_0xae6d('0x36')]);_0x3b22d7[_0xae6d('0x3a')]=_['intersection'](_0x2d547e['model'],qs['fields'](_0x2fbb8f[_0xae6d('0x36')]['fields']));_0x3b22d7['attributes']=_0x3b22d7[_0xae6d('0x3a')][_0xae6d('0x3c')]?_0x3b22d7[_0xae6d('0x3a')]:_0x2d547e[_0xae6d('0x39')];if(_0x2fbb8f[_0xae6d('0x36')][_0xae6d('0x46')]){_0x3b22d7[_0xae6d('0x47')]=[{'all':!![]}];}_0x3b22d7=_[_0xae6d('0x43')]({},_0x3b22d7,_0x2fbb8f[_0xae6d('0x45')]);return db[_0xae6d('0x32')][_0xae6d('0x4e')](_0x3b22d7)[_0xae6d('0x2a')](handleEntityNotFound(_0x499d7f,null))[_0xae6d('0x2a')](respondWithResult(_0x499d7f,null))[_0xae6d('0x4a')](handleError(_0x499d7f,null));};exports[_0xae6d('0x4f')]=function(_0x49e531,_0x4686bd){return db[_0xae6d('0x32')]['create'](_0x49e531[_0xae6d('0x50')],{})['then'](respondWithResult(_0x4686bd,0xc9))[_0xae6d('0x4a')](handleError(_0x4686bd,null));};exports[_0xae6d('0x29')]=function(_0x74041d,_0x1b0b88){if(_0x74041d[_0xae6d('0x50')]['id']){delete _0x74041d[_0xae6d('0x50')]['id'];}return db['ZendeskConfiguration'][_0xae6d('0x4e')]({'where':{'id':_0x74041d[_0xae6d('0x4c')]['id']}})[_0xae6d('0x2a')](handleEntityNotFound(_0x1b0b88,null))[_0xae6d('0x2a')](saveUpdates(_0x74041d[_0xae6d('0x50')],null))[_0xae6d('0x2a')](respondWithResult(_0x1b0b88,null))['catch'](handleError(_0x1b0b88,null));};exports[_0xae6d('0x2b')]=function(_0xd22f78,_0x52a4e6){return db[_0xae6d('0x32')][_0xae6d('0x4e')]({'where':{'id':_0xd22f78[_0xae6d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52a4e6,null))[_0xae6d('0x2a')](removeEntity(_0x52a4e6,null))[_0xae6d('0x4a')](handleError(_0x52a4e6,null));};exports[_0xae6d('0x51')]=function(_0x3b3301,_0x5bebfd,_0x3362bb){var _0x115d91={};var _0x552b69={};var _0x5c7509;var _0x3340e9;return db[_0xae6d('0x32')][_0xae6d('0x52')]({'where':{'id':_0x3b3301[_0xae6d('0x4c')]['id']}})[_0xae6d('0x2a')](handleEntityNotFound(_0x5bebfd,null))['then'](function(_0x1df65a){if(_0x1df65a){_0x5c7509=_0x1df65a;_0x552b69['model']=_[_0xae6d('0x4d')](db[_0xae6d('0x53')][_0xae6d('0x33')]);_0x552b69[_0xae6d('0x36')]=_[_0xae6d('0x4d')](_0x3b3301[_0xae6d('0x36')]);_0x552b69[_0xae6d('0x37')]=_[_0xae6d('0x38')](_0x552b69[_0xae6d('0x39')],_0x552b69[_0xae6d('0x36')]);_0x115d91[_0xae6d('0x3a')]=_[_0xae6d('0x38')](_0x552b69['model'],qs[_0xae6d('0x3b')](_0x3b3301[_0xae6d('0x36')][_0xae6d('0x3b')]));_0x115d91[_0xae6d('0x3a')]=_0x115d91[_0xae6d('0x3a')][_0xae6d('0x3c')]?_0x115d91['attributes']:_0x552b69['model'];_0x115d91['order']=qs[_0xae6d('0x3f')](_0x3b3301[_0xae6d('0x36')][_0xae6d('0x3f')]);_0x115d91[_0xae6d('0x40')]=qs['filters'](_['pick'](_0x3b3301[_0xae6d('0x36')],_0x552b69[_0xae6d('0x37')]));if(_0x3b3301[_0xae6d('0x36')][_0xae6d('0x42')]){_0x115d91[_0xae6d('0x40')]=_[_0xae6d('0x43')](_0x115d91[_0xae6d('0x40')],{'$or':_[_0xae6d('0x31')](_0x115d91[_0xae6d('0x3a')],function(_0x3140c4){var _0x4cc463={};_0x4cc463[_0x3140c4]={'$like':'%'+_0x3b3301[_0xae6d('0x36')][_0xae6d('0x42')]+'%'};return _0x4cc463;})});}_0x115d91=_[_0xae6d('0x43')]({},_0x115d91,_0x3b3301[_0xae6d('0x45')]);return _0x5c7509[_0xae6d('0x51')](_0x115d91);}})[_0xae6d('0x2a')](function(_0x1dd04e){if(_0x1dd04e){_0x3340e9=_0x1dd04e[_0xae6d('0x3c')];if(!_0x3b3301[_0xae6d('0x36')]['hasOwnProperty']('nolimit')){_0x115d91[_0xae6d('0x21')]=qs[_0xae6d('0x21')](_0x3b3301[_0xae6d('0x36')][_0xae6d('0x21')]);_0x115d91[_0xae6d('0x23')]=qs['offset'](_0x3b3301[_0xae6d('0x36')]['offset']);}return _0x5c7509[_0xae6d('0x51')](_0x115d91);}})[_0xae6d('0x2a')](function(_0x1dd156){if(_0x1dd156){return _0x1dd156?{'count':_0x3340e9,'rows':_0x1dd156}:null;}})[_0xae6d('0x2a')](respondWithResult(_0x5bebfd,null))[_0xae6d('0x4a')](handleError(_0x5bebfd,null));};exports[_0xae6d('0x54')]=function(_0x527510,_0x490a62,_0x4db90a){var _0xc0186a={};var _0x1e1ec0={};var _0x149ddb;var _0x2d1e94;return db[_0xae6d('0x32')]['findOne']({'where':{'id':_0x527510[_0xae6d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x490a62,null))[_0xae6d('0x2a')](function(_0x50d30e){if(_0x50d30e){_0x149ddb=_0x50d30e;_0x1e1ec0[_0xae6d('0x39')]=_[_0xae6d('0x4d')](db['ZendeskField'][_0xae6d('0x33')]);_0x1e1ec0['query']=_[_0xae6d('0x4d')](_0x527510[_0xae6d('0x36')]);_0x1e1ec0['filters']=_[_0xae6d('0x38')](_0x1e1ec0['model'],_0x1e1ec0[_0xae6d('0x36')]);_0xc0186a[_0xae6d('0x3a')]=_['intersection'](_0x1e1ec0[_0xae6d('0x39')],qs[_0xae6d('0x3b')](_0x527510[_0xae6d('0x36')][_0xae6d('0x3b')]));_0xc0186a[_0xae6d('0x3a')]=_0xc0186a[_0xae6d('0x3a')][_0xae6d('0x3c')]?_0xc0186a[_0xae6d('0x3a')]:_0x1e1ec0[_0xae6d('0x39')];_0xc0186a['order']=qs[_0xae6d('0x3f')](_0x527510[_0xae6d('0x36')][_0xae6d('0x3f')]);_0xc0186a[_0xae6d('0x40')]=qs[_0xae6d('0x37')](_[_0xae6d('0x41')](_0x527510[_0xae6d('0x36')],_0x1e1ec0['filters']));if(_0x527510['query'][_0xae6d('0x42')]){_0xc0186a[_0xae6d('0x40')]=_[_0xae6d('0x43')](_0xc0186a[_0xae6d('0x40')],{'$or':_['map'](_0xc0186a['attributes'],function(_0x1c3ebd){var _0x24acf4={};_0x24acf4[_0x1c3ebd]={'$like':'%'+_0x527510['query'][_0xae6d('0x42')]+'%'};return _0x24acf4;})});}_0xc0186a=_[_0xae6d('0x43')]({},_0xc0186a,_0x527510[_0xae6d('0x45')]);return _0x149ddb[_0xae6d('0x54')](_0xc0186a);}})[_0xae6d('0x2a')](function(_0xa61b5d){if(_0xa61b5d){_0x2d1e94=_0xa61b5d[_0xae6d('0x3c')];if(!_0x527510[_0xae6d('0x36')][_0xae6d('0x55')](_0xae6d('0x3d'))){_0xc0186a['limit']=qs[_0xae6d('0x21')](_0x527510[_0xae6d('0x36')][_0xae6d('0x21')]);_0xc0186a[_0xae6d('0x23')]=qs[_0xae6d('0x23')](_0x527510[_0xae6d('0x36')][_0xae6d('0x23')]);}return _0x149ddb[_0xae6d('0x54')](_0xc0186a);}})[_0xae6d('0x2a')](function(_0x565842){if(_0x565842){return _0x565842?{'count':_0x2d1e94,'rows':_0x565842}:null;}})[_0xae6d('0x2a')](respondWithResult(_0x490a62,null))[_0xae6d('0x4a')](handleError(_0x490a62,null));};exports[_0xae6d('0x56')]=function(_0x2dbc3f,_0xec6efd,_0x2c8e5c){var _0x303197={};var _0x17311c={};var _0x1bcf84;var _0x3fa4b9;return db[_0xae6d('0x32')][_0xae6d('0x52')]({'where':{'id':_0x2dbc3f[_0xae6d('0x4c')]['id']}})[_0xae6d('0x2a')](handleEntityNotFound(_0xec6efd,null))['then'](function(_0x1342a7){if(_0x1342a7){_0x1bcf84=_0x1342a7;_0x17311c[_0xae6d('0x39')]=_[_0xae6d('0x4d')](db[_0xae6d('0x53')][_0xae6d('0x33')]);_0x17311c[_0xae6d('0x36')]=_[_0xae6d('0x4d')](_0x2dbc3f['query']);_0x17311c[_0xae6d('0x37')]=_[_0xae6d('0x38')](_0x17311c[_0xae6d('0x39')],_0x17311c['query']);_0x303197[_0xae6d('0x3a')]=_[_0xae6d('0x38')](_0x17311c[_0xae6d('0x39')],qs['fields'](_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x3b')]));_0x303197['attributes']=_0x303197[_0xae6d('0x3a')][_0xae6d('0x3c')]?_0x303197['attributes']:_0x17311c[_0xae6d('0x39')];_0x303197['order']=qs[_0xae6d('0x3f')](_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x3f')]);_0x303197['where']=qs[_0xae6d('0x37')](_[_0xae6d('0x41')](_0x2dbc3f['query'],_0x17311c[_0xae6d('0x37')]));if(_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x42')]){_0x303197[_0xae6d('0x40')]=_[_0xae6d('0x43')](_0x303197[_0xae6d('0x40')],{'$or':_['map'](_0x303197[_0xae6d('0x3a')],function(_0x40eedb){var _0x118b36={};_0x118b36[_0x40eedb]={'$like':'%'+_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x42')]+'%'};return _0x118b36;})});}_0x303197=_['merge']({},_0x303197,_0x2dbc3f['options']);return _0x1bcf84[_0xae6d('0x56')](_0x303197);}})[_0xae6d('0x2a')](function(_0x25f444){if(_0x25f444){_0x3fa4b9=_0x25f444[_0xae6d('0x3c')];if(!_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x55')](_0xae6d('0x3d'))){_0x303197[_0xae6d('0x21')]=qs['limit'](_0x2dbc3f[_0xae6d('0x36')]['limit']);_0x303197[_0xae6d('0x23')]=qs[_0xae6d('0x23')](_0x2dbc3f[_0xae6d('0x36')][_0xae6d('0x23')]);}return _0x1bcf84[_0xae6d('0x56')](_0x303197);}})[_0xae6d('0x2a')](function(_0x1e8e56){if(_0x1e8e56){return _0x1e8e56?{'count':_0x3fa4b9,'rows':_0x1e8e56}:null;}})[_0xae6d('0x2a')](respondWithResult(_0xec6efd,null))['catch'](handleError(_0xec6efd,null));};exports['getTags']=function(_0x799ffe,_0x2a26c8,_0x1d8f1c){var _0x541cd3={};var _0x5b3c55={};var _0x1704e8;var _0x57c667;return db[_0xae6d('0x32')][_0xae6d('0x52')]({'where':{'id':_0x799ffe[_0xae6d('0x4c')]['id']}})[_0xae6d('0x2a')](handleEntityNotFound(_0x2a26c8,null))[_0xae6d('0x2a')](function(_0x4c9d24){if(_0x4c9d24){_0x1704e8=_0x4c9d24;_0x5b3c55[_0xae6d('0x39')]=_['keys'](db['Tag'][_0xae6d('0x33')]);_0x5b3c55[_0xae6d('0x36')]=_[_0xae6d('0x4d')](_0x799ffe[_0xae6d('0x36')]);_0x5b3c55['filters']=_[_0xae6d('0x38')](_0x5b3c55[_0xae6d('0x39')],_0x5b3c55[_0xae6d('0x36')]);_0x541cd3[_0xae6d('0x3a')]=_['intersection'](_0x5b3c55[_0xae6d('0x39')],qs[_0xae6d('0x3b')](_0x799ffe['query']['fields']));_0x541cd3['attributes']=_0x541cd3['attributes'][_0xae6d('0x3c')]?_0x541cd3['attributes']:_0x5b3c55[_0xae6d('0x39')];_0x541cd3[_0xae6d('0x3e')]=qs['sort'](_0x799ffe[_0xae6d('0x36')][_0xae6d('0x3f')]);_0x541cd3[_0xae6d('0x40')]=qs['filters'](_[_0xae6d('0x41')](_0x799ffe[_0xae6d('0x36')],_0x5b3c55[_0xae6d('0x37')]));if(_0x799ffe['query']['filter']){_0x541cd3['where']=_[_0xae6d('0x43')](_0x541cd3[_0xae6d('0x40')],{'$or':_[_0xae6d('0x31')](_0x541cd3['attributes'],function(_0x23280b){var _0xb4a0fc={};_0xb4a0fc[_0x23280b]={'$like':'%'+_0x799ffe[_0xae6d('0x36')][_0xae6d('0x42')]+'%'};return _0xb4a0fc;})});}_0x541cd3=_[_0xae6d('0x43')]({},_0x541cd3,_0x799ffe[_0xae6d('0x45')]);return _0x1704e8[_0xae6d('0x57')](_0x541cd3);}})[_0xae6d('0x2a')](function(_0xc766d2){if(_0xc766d2){_0x57c667=_0xc766d2[_0xae6d('0x3c')];if(!_0x799ffe[_0xae6d('0x36')][_0xae6d('0x55')]('nolimit')){_0x541cd3['limit']=qs[_0xae6d('0x21')](_0x799ffe['query'][_0xae6d('0x21')]);_0x541cd3['offset']=qs[_0xae6d('0x23')](_0x799ffe[_0xae6d('0x36')][_0xae6d('0x23')]);}return _0x1704e8[_0xae6d('0x57')](_0x541cd3);}})[_0xae6d('0x2a')](function(_0x99507b){if(_0x99507b){return _0x99507b?{'count':_0x57c667,'rows':_0x99507b}:null;}})['then'](respondWithResult(_0x2a26c8,null))[_0xae6d('0x4a')](handleError(_0x2a26c8,null));};exports[_0xae6d('0x58')]=function(_0x4a4c4e,_0x48ce1b,_0x18019c){if(_0x4a4c4e['body']['id']){delete _0x4a4c4e[_0xae6d('0x50')]['id'];}return db[_0xae6d('0x32')][_0xae6d('0x52')]({'where':{'id':_0x4a4c4e[_0xae6d('0x4c')]['id']}})[_0xae6d('0x2a')](handleEntityNotFound(_0x48ce1b,null))[_0xae6d('0x2a')](function(_0x3e2e27){if(_0x3e2e27){return _0x3e2e27['setTags'](_0x4a4c4e['body'][_0xae6d('0x59')]||[]);}return null;})['then'](respondWithResult(_0x48ce1b,null))['catch'](handleError(_0x48ce1b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4291e3b..5a6422f 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 _0xb688=['exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x805436,_0xe3108){var _0x35c953=function(_0x5b84ba){while(--_0x5b84ba){_0x805436['push'](_0x805436['shift']());}};_0x35c953(++_0xe3108);}(_0xb688,0xcf));var _0x8b68=function(_0x131007,_0x49d5cf){_0x131007=_0x131007-0x0;var _0x3130ae=_0xb688[_0x131007];return _0x3130ae;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5204=['request-promise','path','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x4e63f1,_0x34a2db){var _0xdbd910=function(_0x40261f){while(--_0x40261f){_0x4e63f1['push'](_0x4e63f1['shift']());}};_0xdbd910(++_0x34a2db);}(_0x5204,0xdf));var _0x4520=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x5204[_0x385c76];return _0x5c8367;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'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 b32cde5..ce1c4f8 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 _0xc322=['ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','info','result','message','catch','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then'];(function(_0x1300ec,_0x3ff267){var _0x2c13c9=function(_0x58d88){while(--_0x58d88){_0x1300ec['push'](_0x1300ec['shift']());}};_0x2c13c9(++_0x3ff267);}(_0xc322,0x1d2));var _0x2c32=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xc322[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x2c32('0x0'));var moment=require(_0x2c32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c32('0x2'));var db=require(_0x2c32('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c32('0x4'))('rpc');var config=require(_0x2c32('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2c32('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2deddf,_0x5b3963,_0x27b288){return new BPromise(function(_0x4d33ff,_0x1365f0){return client[_0x2c32('0x7')](_0x2deddf,_0x27b288)[_0x2c32('0x8')](function(_0x2b64bb){logger['info'](_0x2c32('0x9'),_0x5b3963,'request\x20sent');logger[_0x2c32('0xa')](_0x2c32('0xb'),_0x5b3963,_0x2c32('0xc'),JSON['stringify'](_0x2b64bb));if(_0x2b64bb[_0x2c32('0xd')]){if(_0x2b64bb['error'][_0x2c32('0xe')]===0x1f4){logger[_0x2c32('0xd')](_0x2c32('0x9'),_0x5b3963,_0x2b64bb[_0x2c32('0xd')]['message']);return _0x1365f0(_0x2b64bb[_0x2c32('0xd')]['message']);}logger[_0x2c32('0xd')](_0x2c32('0x9'),_0x5b3963,_0x2b64bb[_0x2c32('0xd')]['message']);return _0x4d33ff(_0x2b64bb['error']['message']);}else{logger[_0x2c32('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5b3963,_0x2c32('0xc'));_0x4d33ff(_0x2b64bb[_0x2c32('0x10')][_0x2c32('0x11')]);}})[_0x2c32('0x12')](function(_0x41d3f3){logger[_0x2c32('0xd')](_0x2c32('0x9'),_0x5b3963,_0x41d3f3);_0x1365f0(_0x41d3f3);});});} \ No newline at end of file +var _0x7deb=['request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','then','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x5d8c38,_0x528e1f){var _0x2f19af=function(_0x3d1b55){while(--_0x3d1b55){_0x5d8c38['push'](_0x5d8c38['shift']());}};_0x2f19af(++_0x528e1f);}(_0x7deb,0x1e8));var _0xb7de=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x7deb[_0x4849f6];return _0x1a3dcd;};'use strict';var _=require(_0xb7de('0x0'));var util=require(_0xb7de('0x1'));var moment=require(_0xb7de('0x2'));var BPromise=require(_0xb7de('0x3'));var rs=require(_0xb7de('0x4'));var fs=require('fs');var Redis=require(_0xb7de('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7de('0x6'));var logger=require('../../config/logger')(_0xb7de('0x7'));var config=require('../../config/environment');var jayson=require(_0xb7de('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbacb65,_0x3e27a8,_0x1dd596){return new BPromise(function(_0x3b6893,_0x4bdd06){return client[_0xb7de('0x9')](_0xbacb65,_0x1dd596)[_0xb7de('0xa')](function(_0x5d5cf5){logger['info'](_0xb7de('0xb'),_0x3e27a8,_0xb7de('0xc'));logger[_0xb7de('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3e27a8,_0xb7de('0xc'),JSON[_0xb7de('0xe')](_0x5d5cf5));if(_0x5d5cf5[_0xb7de('0xf')]){if(_0x5d5cf5['error'][_0xb7de('0x10')]===0x1f4){logger[_0xb7de('0xf')](_0xb7de('0xb'),_0x3e27a8,_0x5d5cf5[_0xb7de('0xf')][_0xb7de('0x11')]);return _0x4bdd06(_0x5d5cf5[_0xb7de('0xf')]['message']);}logger[_0xb7de('0xf')](_0xb7de('0xb'),_0x3e27a8,_0x5d5cf5[_0xb7de('0xf')][_0xb7de('0x11')]);return _0x3b6893(_0x5d5cf5['error']['message']);}else{logger[_0xb7de('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3e27a8,_0xb7de('0xc'));_0x3b6893(_0x5d5cf5[_0xb7de('0x13')]['message']);}})['catch'](function(_0x5ac245){logger[_0xb7de('0xf')](_0xb7de('0xb'),_0x3e27a8,_0x5ac245);_0x4bdd06(_0x5ac245);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index e7b5bca..d1a7333 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 _0x4a5d=['./intZendeskField.controller','get','isAuthenticated','/:id','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x918ecd,_0x71a479){var _0x37bfcc=function(_0x2bacb7){while(--_0x2bacb7){_0x918ecd['push'](_0x918ecd['shift']());}};_0x37bfcc(++_0x71a479);}(_0x4a5d,0x1ca));var _0xd4a5=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x4a5d[_0x313c96];return _0x522f53;};'use strict';var multer=require(_0xd4a5('0x0'));var util=require(_0xd4a5('0x1'));var path=require(_0xd4a5('0x2'));var timeout=require(_0xd4a5('0x3'));var express=require(_0xd4a5('0x4'));var router=express[_0xd4a5('0x5')]();var fs_extra=require(_0xd4a5('0x6'));var auth=require(_0xd4a5('0x7'));var interaction=require(_0xd4a5('0x8'));var config=require(_0xd4a5('0x9'));var controller=require(_0xd4a5('0xa'));router[_0xd4a5('0xb')]('/',auth[_0xd4a5('0xc')](),controller['index']);router[_0xd4a5('0xb')](_0xd4a5('0xd'),auth[_0xd4a5('0xc')](),controller['show']);router[_0xd4a5('0xe')]('/',auth[_0xd4a5('0xc')](),controller[_0xd4a5('0xf')]);router['put'](_0xd4a5('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd4a5('0x10')]('/:id',auth[_0xd4a5('0xc')](),controller['destroy']);module[_0xd4a5('0x11')]=router; \ No newline at end of file +var _0xb412=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb412,0x153));var _0x2b41=function(_0x411a71,_0x21b377){_0x411a71=_0x411a71-0x0;var _0x4ee93e=_0xb412[_0x411a71];return _0x4ee93e;};'use strict';var multer=require(_0x2b41('0x0'));var util=require(_0x2b41('0x1'));var path=require(_0x2b41('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b41('0x3'));var router=express[_0x2b41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b41('0x5'));var interaction=require(_0x2b41('0x6'));var config=require(_0x2b41('0x7'));var controller=require(_0x2b41('0x8'));router[_0x2b41('0x9')]('/',auth[_0x2b41('0xa')](),controller[_0x2b41('0xb')]);router[_0x2b41('0x9')](_0x2b41('0xc'),auth[_0x2b41('0xa')](),controller[_0x2b41('0xd')]);router[_0x2b41('0xe')]('/',auth[_0x2b41('0xa')](),controller[_0x2b41('0xf')]);router[_0x2b41('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2b41('0x11')]);router[_0x2b41('0x12')](_0x2b41('0xc'),auth[_0x2b41('0xa')](),controller[_0x2b41('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 6df79f4..5ad2411 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 _0x3b68=['sequelize','exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0xeb0019,_0x3a619e){var _0x37e243=function(_0x2e5345){while(--_0x2e5345){_0xeb0019['push'](_0xeb0019['shift']());}};_0x37e243(++_0x3a619e);}(_0x3b68,0x183));var _0x83b6=function(_0x4c972f,_0x1d85e1){_0x4c972f=_0x4c972f-0x0;var _0x22fd10=_0x3b68[_0x4c972f];return _0x22fd10;};'use strict';var Sequelize=require(_0x83b6('0x0'));module[_0x83b6('0x1')]={'type':{'type':Sequelize[_0x83b6('0x2')](_0x83b6('0x3'),_0x83b6('0x4'),'customVariable','keyValue',_0x83b6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x83b6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x83b6('0x2')](_0x83b6('0x3'),'variable',_0x83b6('0x7'))},'keyContent':{'type':Sequelize[_0x83b6('0x6')]},'idField':{'type':Sequelize[_0x83b6('0x6')]},'nameField':{'type':Sequelize[_0x83b6('0x6')]},'customField':{'type':Sequelize[_0x83b6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83b6('0x6')]}}; \ No newline at end of file +var _0x0f8b=['STRING','string','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x24030e,_0xfffd42){var _0x2d2c59=function(_0x4d2fd2){while(--_0x4d2fd2){_0x24030e['push'](_0x24030e['shift']());}};_0x2d2c59(++_0xfffd42);}(_0x0f8b,0x17c));var _0xb0f8=function(_0x27cd10,_0x2e8b70){_0x27cd10=_0x27cd10-0x0;var _0x3a9c5a=_0x0f8b[_0x27cd10];return _0x3a9c5a;};'use strict';var Sequelize=require(_0xb0f8('0x0'));module['exports']={'type':{'type':Sequelize[_0xb0f8('0x1')]('string',_0xb0f8('0x2'),_0xb0f8('0x3'),_0xb0f8('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb0f8('0x5')]},'key':{'type':Sequelize[_0xb0f8('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb0f8('0x6'),'variable',_0xb0f8('0x3'))},'keyContent':{'type':Sequelize[_0xb0f8('0x5')]},'idField':{'type':Sequelize[_0xb0f8('0x5')]},'nameField':{'type':Sequelize[_0xb0f8('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb0f8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5adb072..8962cb7 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 _0x428c=['index','ZendeskField','type','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x428c,0x1d4));var _0xc428=function(_0x4613be,_0x567b6f){_0x4613be=_0x4613be-0x0;var _0x25142f=_0x428c[_0x4613be];return _0x25142f;};'use strict';var emlformat=require(_0xc428('0x0'));var rimraf=require(_0xc428('0x1'));var zipdir=require(_0xc428('0x2'));var jsonpatch=require(_0xc428('0x3'));var rp=require(_0xc428('0x4'));var moment=require('moment');var BPromise=require(_0xc428('0x5'));var Mustache=require('mustache');var util=require(_0xc428('0x6'));var path=require('path');var sox=require(_0xc428('0x7'));var csv=require(_0xc428('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc428('0x9'));var _=require(_0xc428('0xa'));var squel=require(_0xc428('0xb'));var crypto=require(_0xc428('0xc'));var jsforce=require(_0xc428('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc428('0x8'));var querystring=require(_0xc428('0xe'));var Papa=require(_0xc428('0xf'));var Redis=require(_0xc428('0x10'));var authService=require(_0xc428('0x11'));var qs=require(_0xc428('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc428('0x13'));var logger=require(_0xc428('0x14'))(_0xc428('0x15'));var utils=require('../../config/utils');var config=require(_0xc428('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18e7c8,_0x3126b1){_0x3126b1=_0x3126b1||0xcc;return function(_0x4bb5bb){if(_0x4bb5bb){return _0x18e7c8[_0xc428('0x17')](_0x3126b1);}return _0x18e7c8[_0xc428('0x18')](_0x3126b1)[_0xc428('0x19')]();};}function respondWithResult(_0x33f67d,_0x4360e1){_0x4360e1=_0x4360e1||0xc8;return function(_0x2d301b){if(_0x2d301b){return _0x33f67d['status'](_0x4360e1)[_0xc428('0x1a')](_0x2d301b);}};}function respondWithFilteredResult(_0x56b8aa,_0x331b27){return function(_0x3dbe0a){if(_0x3dbe0a){var _0xe4f90a=typeof _0x331b27[_0xc428('0x1b')]===_0xc428('0x1c')&&typeof _0x331b27[_0xc428('0x1d')]===_0xc428('0x1c');var _0xf3da70=_0x3dbe0a[_0xc428('0x1e')];var _0x31e92c=_0xe4f90a?0x0:_0x331b27[_0xc428('0x1b')];var _0x51f23e=_0xe4f90a?_0x3dbe0a[_0xc428('0x1e')]:_0x331b27[_0xc428('0x1b')]+_0x331b27[_0xc428('0x1d')];var _0x3d81f2;if(_0x51f23e>=_0xf3da70){_0x51f23e=_0xf3da70;_0x3d81f2=0xc8;}else{_0x3d81f2=0xce;}_0x56b8aa[_0xc428('0x18')](_0x3d81f2);return _0x56b8aa[_0xc428('0x1f')](_0xc428('0x20'),_0x31e92c+'-'+_0x51f23e+'/'+_0xf3da70)[_0xc428('0x1a')](_0x3dbe0a);}return null;};}function patchUpdates(_0x311307){return function(_0x57fe56){try{jsonpatch[_0xc428('0x21')](_0x57fe56,_0x311307,!![]);}catch(_0x1af098){return BPromise[_0xc428('0x22')](_0x1af098);}return _0x57fe56[_0xc428('0x23')]();};}function saveUpdates(_0x10a157,_0x276710){return function(_0x20a66b){if(_0x20a66b){return _0x20a66b[_0xc428('0x24')](_0x10a157)['then'](function(_0x41d819){return _0x41d819;});}return null;};}function removeEntity(_0x470dbb,_0x363f0c){return function(_0x17f884){if(_0x17f884){return _0x17f884[_0xc428('0x25')]()[_0xc428('0x26')](function(){_0x470dbb[_0xc428('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34fddd,_0x1245a1){return function(_0x311188){if(!_0x311188){_0x34fddd[_0xc428('0x17')](0x194);}return _0x311188;};}function handleError(_0x37dced,_0x477cdf){_0x477cdf=_0x477cdf||0x1f4;return function(_0xd649c0){logger[_0xc428('0x27')](_0xd649c0[_0xc428('0x28')]);if(_0xd649c0[_0xc428('0x29')]){delete _0xd649c0['name'];}_0x37dced[_0xc428('0x18')](_0x477cdf)[_0xc428('0x2a')](_0xd649c0);};}exports[_0xc428('0x2b')]=function(_0x34801e,_0x440a0c){var _0x6a1689={},_0x231932={},_0x2a66c2={'count':0x0,'rows':[]};var _0x57904e=_['map'](db[_0xc428('0x2c')]['rawAttributes'],function(_0x10fcea){return{'name':_0x10fcea['fieldName'],'type':_0x10fcea[_0xc428('0x2d')][_0xc428('0x2e')]};});_0x231932['model']=_[_0xc428('0x2f')](_0x57904e,_0xc428('0x29'));_0x231932[_0xc428('0x30')]=_['keys'](_0x34801e[_0xc428('0x30')]);_0x231932[_0xc428('0x31')]=_[_0xc428('0x32')](_0x231932[_0xc428('0x33')],_0x231932[_0xc428('0x30')]);_0x6a1689[_0xc428('0x34')]=_[_0xc428('0x32')](_0x231932[_0xc428('0x33')],qs[_0xc428('0x35')](_0x34801e[_0xc428('0x30')][_0xc428('0x35')]));_0x6a1689['attributes']=_0x6a1689[_0xc428('0x34')][_0xc428('0x36')]?_0x6a1689[_0xc428('0x34')]:_0x231932['model'];if(!_0x34801e[_0xc428('0x30')]['hasOwnProperty'](_0xc428('0x37'))){_0x6a1689['limit']=qs[_0xc428('0x1d')](_0x34801e['query'][_0xc428('0x1d')]);_0x6a1689[_0xc428('0x1b')]=qs[_0xc428('0x1b')](_0x34801e[_0xc428('0x30')]['offset']);}_0x6a1689['order']=qs[_0xc428('0x38')](_0x34801e['query'][_0xc428('0x38')]);_0x6a1689[_0xc428('0x39')]=qs[_0xc428('0x31')](_[_0xc428('0x3a')](_0x34801e[_0xc428('0x30')],_0x231932[_0xc428('0x31')]),_0x57904e);if(_0x34801e[_0xc428('0x30')][_0xc428('0x3b')]){_0x6a1689['where']=_[_0xc428('0x3c')](_0x6a1689['where'],{'$or':_[_0xc428('0x2f')](_0x57904e,function(_0xa1bb77){if(_0xa1bb77[_0xc428('0x2d')]!=='VIRTUAL'){var _0x2eec1c={};_0x2eec1c[_0xa1bb77[_0xc428('0x29')]]={'$like':'%'+_0x34801e['query']['filter']+'%'};return _0x2eec1c;}})});}_0x6a1689=_[_0xc428('0x3c')]({},_0x6a1689,_0x34801e[_0xc428('0x3d')]);var _0x3af44d={'where':_0x6a1689[_0xc428('0x39')]};return db[_0xc428('0x2c')]['count'](_0x3af44d)[_0xc428('0x26')](function(_0x25e6b8){_0x2a66c2['count']=_0x25e6b8;if(_0x34801e[_0xc428('0x30')][_0xc428('0x3e')]){_0x6a1689[_0xc428('0x3f')]=[{'all':!![]}];}return db['ZendeskField'][_0xc428('0x40')](_0x6a1689);})[_0xc428('0x26')](function(_0x2176ea){_0x2a66c2[_0xc428('0x41')]=_0x2176ea;return _0x2a66c2;})[_0xc428('0x26')](respondWithFilteredResult(_0x440a0c,_0x6a1689))[_0xc428('0x42')](handleError(_0x440a0c,null));};exports[_0xc428('0x43')]=function(_0x3622be,_0x440ab0){var _0x2abae5={'raw':!![],'where':{'id':_0x3622be[_0xc428('0x44')]['id']}},_0x32d0ca={};_0x32d0ca[_0xc428('0x33')]=_[_0xc428('0x45')](db['ZendeskField']['rawAttributes']);_0x32d0ca[_0xc428('0x30')]=_['keys'](_0x3622be[_0xc428('0x30')]);_0x32d0ca[_0xc428('0x31')]=_['intersection'](_0x32d0ca[_0xc428('0x33')],_0x32d0ca[_0xc428('0x30')]);_0x2abae5[_0xc428('0x34')]=_[_0xc428('0x32')](_0x32d0ca[_0xc428('0x33')],qs[_0xc428('0x35')](_0x3622be[_0xc428('0x30')][_0xc428('0x35')]));_0x2abae5[_0xc428('0x34')]=_0x2abae5[_0xc428('0x34')][_0xc428('0x36')]?_0x2abae5['attributes']:_0x32d0ca['model'];if(_0x3622be[_0xc428('0x30')][_0xc428('0x3e')]){_0x2abae5[_0xc428('0x3f')]=[{'all':!![]}];}_0x2abae5=_[_0xc428('0x3c')]({},_0x2abae5,_0x3622be[_0xc428('0x3d')]);return db[_0xc428('0x2c')]['find'](_0x2abae5)[_0xc428('0x26')](handleEntityNotFound(_0x440ab0,null))['then'](respondWithResult(_0x440ab0,null))[_0xc428('0x42')](handleError(_0x440ab0,null));};exports[_0xc428('0x46')]=function(_0x3b7328,_0x1bce36){return db[_0xc428('0x2c')][_0xc428('0x46')](_0x3b7328['body'],{})[_0xc428('0x26')](respondWithResult(_0x1bce36,0xc9))[_0xc428('0x42')](handleError(_0x1bce36,null));};exports[_0xc428('0x24')]=function(_0x425e47,_0x4a74f4){if(_0x425e47['body']['id']){delete _0x425e47[_0xc428('0x47')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x425e47[_0xc428('0x44')]['id']}})[_0xc428('0x26')](handleEntityNotFound(_0x4a74f4,null))[_0xc428('0x26')](saveUpdates(_0x425e47[_0xc428('0x47')],null))['then'](respondWithResult(_0x4a74f4,null))[_0xc428('0x42')](handleError(_0x4a74f4,null));};exports[_0xc428('0x25')]=function(_0x319f51,_0x4a2f2f){return db['ZendeskField'][_0xc428('0x48')]({'where':{'id':_0x319f51[_0xc428('0x44')]['id']}})[_0xc428('0x26')](handleEntityNotFound(_0x4a2f2f,null))[_0xc428('0x26')](removeEntity(_0x4a2f2f,null))['catch'](handleError(_0x4a2f2f,null));}; \ No newline at end of file +var _0x2cb4=['include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','map','options','ZendeskField','includeAll'];(function(_0x536866,_0x54e594){var _0x3f8cee=function(_0x116c1e){while(--_0x116c1e){_0x536866['push'](_0x536866['shift']());}};_0x3f8cee(++_0x54e594);}(_0x2cb4,0x13e));var _0x42cb=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x2cb4[_0x2eec1f];return _0x543075;};'use strict';var emlformat=require(_0x42cb('0x0'));var rimraf=require(_0x42cb('0x1'));var zipdir=require(_0x42cb('0x2'));var jsonpatch=require(_0x42cb('0x3'));var rp=require(_0x42cb('0x4'));var moment=require(_0x42cb('0x5'));var BPromise=require(_0x42cb('0x6'));var Mustache=require('mustache');var util=require(_0x42cb('0x7'));var path=require(_0x42cb('0x8'));var sox=require(_0x42cb('0x9'));var csv=require(_0x42cb('0xa'));var ejs=require(_0x42cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42cb('0xc'));var squel=require(_0x42cb('0xd'));var crypto=require(_0x42cb('0xe'));var jsforce=require(_0x42cb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x42cb('0xa'));var querystring=require(_0x42cb('0x10'));var Papa=require(_0x42cb('0x11'));var Redis=require(_0x42cb('0x12'));var authService=require(_0x42cb('0x13'));var qs=require(_0x42cb('0x14'));var as=require(_0x42cb('0x15'));var hardwareService=require(_0x42cb('0x16'));var logger=require(_0x42cb('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x42cb('0x18'));var licenseUtil=require(_0x42cb('0x19'));var db=require(_0x42cb('0x1a'))['db'];function respondWithStatusCode(_0x417080,_0x2b6ee2){_0x2b6ee2=_0x2b6ee2||0xcc;return function(_0x6d1207){if(_0x6d1207){return _0x417080[_0x42cb('0x1b')](_0x2b6ee2);}return _0x417080[_0x42cb('0x1c')](_0x2b6ee2)[_0x42cb('0x1d')]();};}function respondWithResult(_0x497e60,_0xfb073a){_0xfb073a=_0xfb073a||0xc8;return function(_0x15b801){if(_0x15b801){return _0x497e60[_0x42cb('0x1c')](_0xfb073a)[_0x42cb('0x1e')](_0x15b801);}};}function respondWithFilteredResult(_0x29e947,_0x47f50c){return function(_0x125c0e){if(_0x125c0e){var _0x263888=typeof _0x47f50c[_0x42cb('0x1f')]===_0x42cb('0x20')&&typeof _0x47f50c[_0x42cb('0x21')]===_0x42cb('0x20');var _0x4df2ab=_0x125c0e[_0x42cb('0x22')];var _0x3104be=_0x263888?0x0:_0x47f50c[_0x42cb('0x1f')];var _0x5c5a6f=_0x263888?_0x125c0e['count']:_0x47f50c[_0x42cb('0x1f')]+_0x47f50c[_0x42cb('0x21')];var _0x130003;if(_0x5c5a6f>=_0x4df2ab){_0x5c5a6f=_0x4df2ab;_0x130003=0xc8;}else{_0x130003=0xce;}_0x29e947[_0x42cb('0x1c')](_0x130003);return _0x29e947[_0x42cb('0x23')]('Content-Range',_0x3104be+'-'+_0x5c5a6f+'/'+_0x4df2ab)[_0x42cb('0x1e')](_0x125c0e);}return null;};}function patchUpdates(_0x4919a3){return function(_0x46b1c9){try{jsonpatch[_0x42cb('0x24')](_0x46b1c9,_0x4919a3,!![]);}catch(_0x1f8cd2){return BPromise[_0x42cb('0x25')](_0x1f8cd2);}return _0x46b1c9[_0x42cb('0x26')]();};}function saveUpdates(_0x1ebc28,_0x33c8f9){return function(_0x13eebf){if(_0x13eebf){return _0x13eebf[_0x42cb('0x27')](_0x1ebc28)[_0x42cb('0x28')](function(_0x1fe157){return _0x1fe157;});}return null;};}function removeEntity(_0x22a76b,_0x23ced0){return function(_0x5df6e7){if(_0x5df6e7){return _0x5df6e7[_0x42cb('0x29')]()['then'](function(){_0x22a76b[_0x42cb('0x1c')](0xcc)[_0x42cb('0x1d')]();});}};}function handleEntityNotFound(_0x1a4fa1,_0x464a73){return function(_0x488401){if(!_0x488401){_0x1a4fa1[_0x42cb('0x1b')](0x194);}return _0x488401;};}function handleError(_0x257404,_0x304fe2){_0x304fe2=_0x304fe2||0x1f4;return function(_0x2053fc){logger[_0x42cb('0x2a')](_0x2053fc[_0x42cb('0x2b')]);if(_0x2053fc[_0x42cb('0x2c')]){delete _0x2053fc['name'];}_0x257404[_0x42cb('0x1c')](_0x304fe2)[_0x42cb('0x2d')](_0x2053fc);};}exports[_0x42cb('0x2e')]=function(_0x11b477,_0x3f76f2){var _0x16d034={},_0x3386c6={},_0x55b28b={'count':0x0,'rows':[]};var _0x2dd0ca=_['map'](db['ZendeskField'][_0x42cb('0x2f')],function(_0x54a047){return{'name':_0x54a047[_0x42cb('0x30')],'type':_0x54a047[_0x42cb('0x31')]['key']};});_0x3386c6[_0x42cb('0x32')]=_['map'](_0x2dd0ca,'name');_0x3386c6['query']=_[_0x42cb('0x33')](_0x11b477[_0x42cb('0x34')]);_0x3386c6['filters']=_[_0x42cb('0x35')](_0x3386c6[_0x42cb('0x32')],_0x3386c6[_0x42cb('0x34')]);_0x16d034[_0x42cb('0x36')]=_[_0x42cb('0x35')](_0x3386c6[_0x42cb('0x32')],qs['fields'](_0x11b477['query']['fields']));_0x16d034[_0x42cb('0x36')]=_0x16d034['attributes'][_0x42cb('0x37')]?_0x16d034[_0x42cb('0x36')]:_0x3386c6['model'];if(!_0x11b477[_0x42cb('0x34')][_0x42cb('0x38')]('nolimit')){_0x16d034[_0x42cb('0x21')]=qs[_0x42cb('0x21')](_0x11b477[_0x42cb('0x34')][_0x42cb('0x21')]);_0x16d034['offset']=qs[_0x42cb('0x1f')](_0x11b477['query'][_0x42cb('0x1f')]);}_0x16d034[_0x42cb('0x39')]=qs[_0x42cb('0x3a')](_0x11b477[_0x42cb('0x34')][_0x42cb('0x3a')]);_0x16d034[_0x42cb('0x3b')]=qs[_0x42cb('0x3c')](_['pick'](_0x11b477[_0x42cb('0x34')],_0x3386c6[_0x42cb('0x3c')]),_0x2dd0ca);if(_0x11b477[_0x42cb('0x34')][_0x42cb('0x3d')]){_0x16d034[_0x42cb('0x3b')]=_[_0x42cb('0x3e')](_0x16d034[_0x42cb('0x3b')],{'$or':_[_0x42cb('0x3f')](_0x2dd0ca,function(_0x387733){if(_0x387733['type']!=='VIRTUAL'){var _0x1e4000={};_0x1e4000[_0x387733[_0x42cb('0x2c')]]={'$like':'%'+_0x11b477['query']['filter']+'%'};return _0x1e4000;}})});}_0x16d034=_[_0x42cb('0x3e')]({},_0x16d034,_0x11b477[_0x42cb('0x40')]);var _0x118e15={'where':_0x16d034['where']};return db[_0x42cb('0x41')][_0x42cb('0x22')](_0x118e15)[_0x42cb('0x28')](function(_0x914b31){_0x55b28b[_0x42cb('0x22')]=_0x914b31;if(_0x11b477['query'][_0x42cb('0x42')]){_0x16d034[_0x42cb('0x43')]=[{'all':!![]}];}return db[_0x42cb('0x41')][_0x42cb('0x44')](_0x16d034);})[_0x42cb('0x28')](function(_0x39bd2c){_0x55b28b[_0x42cb('0x45')]=_0x39bd2c;return _0x55b28b;})[_0x42cb('0x28')](respondWithFilteredResult(_0x3f76f2,_0x16d034))[_0x42cb('0x46')](handleError(_0x3f76f2,null));};exports[_0x42cb('0x47')]=function(_0x1f7160,_0x3a0bf0){var _0x4f1519={'raw':!![],'where':{'id':_0x1f7160[_0x42cb('0x48')]['id']}},_0x264183={};_0x264183[_0x42cb('0x32')]=_[_0x42cb('0x33')](db['ZendeskField'][_0x42cb('0x2f')]);_0x264183['query']=_[_0x42cb('0x33')](_0x1f7160[_0x42cb('0x34')]);_0x264183['filters']=_[_0x42cb('0x35')](_0x264183[_0x42cb('0x32')],_0x264183['query']);_0x4f1519[_0x42cb('0x36')]=_[_0x42cb('0x35')](_0x264183[_0x42cb('0x32')],qs[_0x42cb('0x49')](_0x1f7160[_0x42cb('0x34')][_0x42cb('0x49')]));_0x4f1519[_0x42cb('0x36')]=_0x4f1519[_0x42cb('0x36')][_0x42cb('0x37')]?_0x4f1519[_0x42cb('0x36')]:_0x264183['model'];if(_0x1f7160[_0x42cb('0x34')][_0x42cb('0x42')]){_0x4f1519[_0x42cb('0x43')]=[{'all':!![]}];}_0x4f1519=_[_0x42cb('0x3e')]({},_0x4f1519,_0x1f7160[_0x42cb('0x40')]);return db[_0x42cb('0x41')][_0x42cb('0x4a')](_0x4f1519)[_0x42cb('0x28')](handleEntityNotFound(_0x3a0bf0,null))[_0x42cb('0x28')](respondWithResult(_0x3a0bf0,null))[_0x42cb('0x46')](handleError(_0x3a0bf0,null));};exports[_0x42cb('0x4b')]=function(_0x46f2de,_0x48e11c){return db[_0x42cb('0x41')][_0x42cb('0x4b')](_0x46f2de['body'],{})['then'](respondWithResult(_0x48e11c,0xc9))[_0x42cb('0x46')](handleError(_0x48e11c,null));};exports['update']=function(_0x2c8326,_0x35879d){if(_0x2c8326[_0x42cb('0x4c')]['id']){delete _0x2c8326[_0x42cb('0x4c')]['id'];}return db[_0x42cb('0x41')][_0x42cb('0x4a')]({'where':{'id':_0x2c8326[_0x42cb('0x48')]['id']}})['then'](handleEntityNotFound(_0x35879d,null))[_0x42cb('0x28')](saveUpdates(_0x2c8326[_0x42cb('0x4c')],null))['then'](respondWithResult(_0x35879d,null))[_0x42cb('0x46')](handleError(_0x35879d,null));};exports['destroy']=function(_0xf65178,_0x1c6278){return db[_0x42cb('0x41')][_0x42cb('0x4a')]({'where':{'id':_0xf65178[_0x42cb('0x48')]['id']}})[_0x42cb('0x28')](handleEntityNotFound(_0x1c6278,null))[_0x42cb('0x28')](removeEntity(_0x1c6278,null))[_0x42cb('0x46')](handleError(_0x1c6278,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 88a44af..df24933 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 _0xaacf=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x248746,_0x3a8a5a){var _0x25be45=function(_0x561042){while(--_0x561042){_0x248746['push'](_0x248746['shift']());}};_0x25be45(++_0x3a8a5a);}(_0xaacf,0x150));var _0xfaac=function(_0x87bd97,_0x1a9b27){_0x87bd97=_0x87bd97-0x0;var _0x115f77=_0xaacf[_0x87bd97];return _0x115f77;};'use strict';var _=require(_0xfaac('0x0'));var util=require('util');var logger=require(_0xfaac('0x1'))(_0xfaac('0x2'));var moment=require(_0xfaac('0x3'));var BPromise=require('bluebird');var rp=require(_0xfaac('0x4'));var fs=require('fs');var path=require(_0xfaac('0x5'));var rimraf=require(_0xfaac('0x6'));var config=require(_0xfaac('0x7'));var attributes=require(_0xfaac('0x8'));module[_0xfaac('0x9')]=function(_0x441fc4,_0x3aac67){return _0x441fc4[_0xfaac('0xa')](_0xfaac('0xb'),attributes,{'tableName':_0xfaac('0xc'),'paranoid':![],'indexes':[{'name':_0xfaac('0xd'),'fields':['idField',_0xfaac('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd70e=['path','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x2a2888,_0x1f17ad){var _0x45130c=function(_0xc0e5b0){while(--_0xc0e5b0){_0x2a2888['push'](_0x2a2888['shift']());}};_0x45130c(++_0x1f17ad);}(_0xd70e,0x174));var _0xed70=function(_0x27fd6d,_0x28c42e){_0x27fd6d=_0x27fd6d-0x0;var _0x4f81b8=_0xd70e[_0x27fd6d];return _0x4f81b8;};'use strict';var _=require('lodash');var util=require(_0xed70('0x0'));var logger=require(_0xed70('0x1'))(_0xed70('0x2'));var moment=require(_0xed70('0x3'));var BPromise=require(_0xed70('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed70('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed70('0x6'));module[_0xed70('0x7')]=function(_0x1a8674,_0x1f09f8){return _0x1a8674[_0xed70('0x8')](_0xed70('0x9'),attributes,{'tableName':_0xed70('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xed70('0xb'),_0xed70('0xc')],'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 13ccdea..7e245ee 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 _0x466b=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x2e914b,_0x5db528){var _0x57276f=function(_0x31e2bf){while(--_0x31e2bf){_0x2e914b['push'](_0x2e914b['shift']());}};_0x57276f(++_0x5db528);}(_0x466b,0xee));var _0xb466=function(_0x3f5ecb,_0x5d875c){_0x3f5ecb=_0x3f5ecb-0x0;var _0x3a99f5=_0x466b[_0x3f5ecb];return _0x3a99f5;};'use strict';var _=require(_0xb466('0x0'));var util=require(_0xb466('0x1'));var moment=require(_0xb466('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb466('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb466('0x4'));var logger=require(_0xb466('0x5'))(_0xb466('0x6'));var config=require(_0xb466('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb466('0x8')][_0xb466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23ac8c,_0x7914b0,_0xa1f2f7){return new BPromise(function(_0x28a295,_0x2b2124){return client[_0xb466('0xa')](_0x23ac8c,_0xa1f2f7)[_0xb466('0xb')](function(_0x14eafe){logger[_0xb466('0xc')](_0xb466('0xd'),_0x7914b0,_0xb466('0xe'));logger[_0xb466('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x7914b0,_0xb466('0xe'),JSON['stringify'](_0x14eafe));if(_0x14eafe[_0xb466('0x10')]){if(_0x14eafe[_0xb466('0x10')][_0xb466('0x11')]===0x1f4){logger['error'](_0xb466('0xd'),_0x7914b0,_0x14eafe['error'][_0xb466('0x12')]);return _0x2b2124(_0x14eafe['error'][_0xb466('0x12')]);}logger[_0xb466('0x10')](_0xb466('0xd'),_0x7914b0,_0x14eafe['error'][_0xb466('0x12')]);return _0x28a295(_0x14eafe['error'][_0xb466('0x12')]);}else{logger[_0xb466('0xc')]('ZendeskField,\x20%s,\x20%s',_0x7914b0,_0xb466('0xe'));_0x28a295(_0x14eafe[_0xb466('0x13')][_0xb466('0x12')]);}})[_0xb466('0x14')](function(_0x821f9d){logger[_0xb466('0x10')](_0xb466('0xd'),_0x7914b0,_0x821f9d);_0x2b2124(_0x821f9d);});});} \ No newline at end of file +var _0xc582=['debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x2ea50e,_0x2385e0){var _0x5a90df=function(_0x4adfeb){while(--_0x4adfeb){_0x2ea50e['push'](_0x2ea50e['shift']());}};_0x5a90df(++_0x2385e0);}(_0xc582,0x8b));var _0x2c58=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xc582[_0x616290];return _0x453879;};'use strict';var _=require(_0x2c58('0x0'));var util=require(_0x2c58('0x1'));var moment=require(_0x2c58('0x2'));var BPromise=require('bluebird');var rs=require(_0x2c58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c58('0x4'));var config=require(_0x2c58('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2c58('0x6')][_0x2c58('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x66e47c,_0x5a3756,_0x2d3c1c){return new BPromise(function(_0x15a44b,_0x5eec97){return client[_0x2c58('0x8')](_0x66e47c,_0x2d3c1c)[_0x2c58('0x9')](function(_0xc43bde){logger[_0x2c58('0xa')](_0x2c58('0xb'),_0x5a3756,_0x2c58('0xc'));logger[_0x2c58('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5a3756,'request\x20sent',JSON[_0x2c58('0xe')](_0xc43bde));if(_0xc43bde['error']){if(_0xc43bde[_0x2c58('0xf')]['code']===0x1f4){logger[_0x2c58('0xf')](_0x2c58('0xb'),_0x5a3756,_0xc43bde[_0x2c58('0xf')]['message']);return _0x5eec97(_0xc43bde[_0x2c58('0xf')][_0x2c58('0x10')]);}logger[_0x2c58('0xf')](_0x2c58('0xb'),_0x5a3756,_0xc43bde['error'][_0x2c58('0x10')]);return _0x15a44b(_0xc43bde[_0x2c58('0xf')][_0x2c58('0x10')]);}else{logger[_0x2c58('0xa')](_0x2c58('0xb'),_0x5a3756,_0x2c58('0xc'));_0x15a44b(_0xc43bde[_0x2c58('0x11')][_0x2c58('0x10')]);}})[_0x2c58('0x12')](function(_0x44d6b4){logger[_0x2c58('0xf')](_0x2c58('0xb'),_0x5a3756,_0x44d6b4);_0x5eec97(_0x44d6b4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f856c54..91b0090 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 _0x105c=['/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x23f12f,_0x48f457){var _0x563de4=function(_0x41f95e){while(--_0x41f95e){_0x23f12f['push'](_0x23f12f['shift']());}};_0x563de4(++_0x48f457);}(_0x105c,0x11b));var _0xc105=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x105c[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc105('0x0'));var timeout=require('connect-timeout');var express=require(_0xc105('0x1'));var router=express['Router']();var fs_extra=require(_0xc105('0x2'));var auth=require(_0xc105('0x3'));var interaction=require(_0xc105('0x4'));var config=require('../../config/environment');var controller=require(_0xc105('0x5'));router[_0xc105('0x6')]('/',auth[_0xc105('0x7')](),controller[_0xc105('0x8')]);router[_0xc105('0x6')](_0xc105('0x9'),auth[_0xc105('0x7')](),controller[_0xc105('0xa')]);router[_0xc105('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc105('0x6')](_0xc105('0xb'),auth[_0xc105('0x7')](),controller[_0xc105('0xc')]);router[_0xc105('0xd')]('/',auth[_0xc105('0x7')](),controller[_0xc105('0xe')]);router[_0xc105('0xd')](_0xc105('0xf'),auth[_0xc105('0x7')](),controller['addConfiguration']);router[_0xc105('0x10')](_0xc105('0x9'),auth[_0xc105('0x7')](),controller[_0xc105('0x11')]);router[_0xc105('0x12')](_0xc105('0x9'),auth['isAuthenticated'](),controller[_0xc105('0x13')]);module[_0xc105('0x14')]=router; \ No newline at end of file +var _0xdde1=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','exports'];(function(_0xfa1ecb,_0x1a282f){var _0x843898=function(_0x18aafd){while(--_0x18aafd){_0xfa1ecb['push'](_0xfa1ecb['shift']());}};_0x843898(++_0x1a282f);}(_0xdde1,0x14a));var _0x1dde=function(_0x5d75ff,_0x5bc7ac){_0x5d75ff=_0x5d75ff-0x0;var _0x1c1894=_0xdde1[_0x5d75ff];return _0x1c1894;};'use strict';var multer=require(_0x1dde('0x0'));var util=require(_0x1dde('0x1'));var path=require('path');var timeout=require(_0x1dde('0x2'));var express=require(_0x1dde('0x3'));var router=express['Router']();var fs_extra=require(_0x1dde('0x4'));var auth=require(_0x1dde('0x5'));var interaction=require(_0x1dde('0x6'));var config=require(_0x1dde('0x7'));var controller=require(_0x1dde('0x8'));router[_0x1dde('0x9')]('/',auth[_0x1dde('0xa')](),controller['index']);router[_0x1dde('0x9')](_0x1dde('0xb'),auth[_0x1dde('0xa')](),controller['show']);router['get'](_0x1dde('0xc'),auth[_0x1dde('0xa')](),controller[_0x1dde('0xd')]);router['get']('/:id/fields',auth[_0x1dde('0xa')](),controller[_0x1dde('0xe')]);router[_0x1dde('0xf')]('/',auth[_0x1dde('0xa')](),controller[_0x1dde('0x10')]);router['post'](_0x1dde('0xc'),auth['isAuthenticated'](),controller[_0x1dde('0x11')]);router[_0x1dde('0x12')](_0x1dde('0xb'),auth[_0x1dde('0xa')](),controller[_0x1dde('0x13')]);router['delete'](_0x1dde('0xb'),auth[_0x1dde('0xa')](),controller[_0x1dde('0x14')]);module[_0x1dde('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 a9a1d23..6d18c40 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 _0x1be1=['STRING'];(function(_0x2cc5ae,_0x4f1bc1){var _0xdffed7=function(_0x4335aa){while(--_0x4335aa){_0x2cc5ae['push'](_0x2cc5ae['shift']());}};_0xdffed7(++_0x4f1bc1);}(_0x1be1,0x192));var _0x11be=function(_0x376a49,_0x46b36e){_0x376a49=_0x376a49-0x0;var _0x4b966e=_0x1be1[_0x376a49];return _0x4b966e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11be('0x0')]},'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x11be('0x0')]},'clientId':{'type':Sequelize[_0x11be('0x0')]},'clientSecret':{'type':Sequelize[_0x11be('0x0')]},'serverUrl':{'type':Sequelize[_0x11be('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x2a6985,_0x2db91e){var _0x18b5fd=function(_0x561817){while(--_0x561817){_0x2a6985['push'](_0x2a6985['shift']());}};_0x18b5fd(++_0x2db91e);}(_0xdace,0xc5));var _0xedac=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0xdace[_0x4cfc1d];return _0x1c01a0;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'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 241f0e8..99227bc 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 _0xb396=['api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','ZohoAccount','rawAttributes','type','key','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','intersection','include','find','create','body','params','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientSecret','serverUrl','code','refreshToken','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes'];(function(_0x56d45a,_0x52e886){var _0x37d4c0=function(_0x205146){while(--_0x205146){_0x56d45a['push'](_0x56d45a['shift']());}};_0x37d4c0(++_0x52e886);}(_0xb396,0x19c));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b39('0x0'));var zipdir=require(_0x6b39('0x1'));var jsonpatch=require(_0x6b39('0x2'));var rp=require(_0x6b39('0x3'));var moment=require(_0x6b39('0x4'));var BPromise=require(_0x6b39('0x5'));var Mustache=require(_0x6b39('0x6'));var util=require(_0x6b39('0x7'));var path=require(_0x6b39('0x8'));var sox=require(_0x6b39('0x9'));var csv=require(_0x6b39('0xa'));var ejs=require(_0x6b39('0xb'));var fs=require('fs');var fs_extra=require(_0x6b39('0xc'));var _=require(_0x6b39('0xd'));var squel=require(_0x6b39('0xe'));var crypto=require(_0x6b39('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6b39('0x10'));var toCsv=require(_0x6b39('0xa'));var querystring=require(_0x6b39('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6b39('0x12'));var qs=require(_0x6b39('0x13'));var as=require(_0x6b39('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6b39('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b39('0x16'));var db=require(_0x6b39('0x17'))['db'];var integrations=require(_0x6b39('0x18'));function respondWithStatusCode(_0x1c8bca,_0xeefbd9){_0xeefbd9=_0xeefbd9||0xcc;return function(_0x124294){if(_0x124294){return _0x1c8bca[_0x6b39('0x19')](_0xeefbd9);}return _0x1c8bca['status'](_0xeefbd9)['end']();};}function respondWithResult(_0x31161c,_0x503da0){_0x503da0=_0x503da0||0xc8;return function(_0x8b10f5){if(_0x8b10f5){return _0x31161c[_0x6b39('0x1a')](_0x503da0)[_0x6b39('0x1b')](_0x8b10f5);}};}function respondWithFilteredResult(_0x1e4199,_0x1e04eb){return function(_0x577ce3){if(_0x577ce3){var _0xba6c2a=typeof _0x1e04eb[_0x6b39('0x1c')]===_0x6b39('0x1d')&&typeof _0x1e04eb[_0x6b39('0x1e')]===_0x6b39('0x1d');var _0x57c829=_0x577ce3[_0x6b39('0x1f')];var _0x46e784=_0xba6c2a?0x0:_0x1e04eb[_0x6b39('0x1c')];var _0x49cefa=_0xba6c2a?_0x577ce3[_0x6b39('0x1f')]:_0x1e04eb[_0x6b39('0x1c')]+_0x1e04eb[_0x6b39('0x1e')];var _0xe98cf7;if(_0x49cefa>=_0x57c829){_0x49cefa=_0x57c829;_0xe98cf7=0xc8;}else{_0xe98cf7=0xce;}_0x1e4199['status'](_0xe98cf7);return _0x1e4199[_0x6b39('0x20')](_0x6b39('0x21'),_0x46e784+'-'+_0x49cefa+'/'+_0x57c829)[_0x6b39('0x1b')](_0x577ce3);}return null;};}function patchUpdates(_0x2942ad){return function(_0x5b5c58){try{jsonpatch[_0x6b39('0x22')](_0x5b5c58,_0x2942ad,!![]);}catch(_0x28b477){return BPromise[_0x6b39('0x23')](_0x28b477);}return _0x5b5c58[_0x6b39('0x24')]();};}function saveUpdates(_0x14e361,_0x29b783){return function(_0x5bb695){if(_0x5bb695){return _0x5bb695[_0x6b39('0x25')](_0x14e361)[_0x6b39('0x26')](function(_0x533543){return _0x533543;});}return null;};}function removeEntity(_0x14114e,_0xd93932){return function(_0xe5690d){if(_0xe5690d){return _0xe5690d['destroy']()['then'](function(){_0x14114e[_0x6b39('0x1a')](0xcc)[_0x6b39('0x27')]();});}};}function handleEntityNotFound(_0x2ab923,_0x3e87f0){return function(_0x41343e){if(!_0x41343e){_0x2ab923[_0x6b39('0x19')](0x194);}return _0x41343e;};}function handleError(_0x3bacf6,_0x25754a){_0x25754a=_0x25754a||0x1f4;return function(_0x3bb84c){logger[_0x6b39('0x28')](_0x3bb84c['stack']);if(_0x3bb84c[_0x6b39('0x29')]){delete _0x3bb84c['name'];}_0x3bacf6[_0x6b39('0x1a')](_0x25754a)[_0x6b39('0x2a')](_0x3bb84c);};}exports[_0x6b39('0x2b')]=function(_0x1067ca,_0x5728f4){var _0x51baff={},_0x277eb4={},_0x23d60a={'count':0x0,'rows':[]};var _0xd3fae9=_[_0x6b39('0x2c')](db[_0x6b39('0x2d')][_0x6b39('0x2e')],function(_0x37ae0f){return{'name':_0x37ae0f['fieldName'],'type':_0x37ae0f[_0x6b39('0x2f')][_0x6b39('0x30')]};});_0x277eb4['model']=_[_0x6b39('0x2c')](_0xd3fae9,'name');_0x277eb4['query']=_[_0x6b39('0x31')](_0x1067ca[_0x6b39('0x32')]);_0x277eb4[_0x6b39('0x33')]=_['intersection'](_0x277eb4[_0x6b39('0x34')],_0x277eb4[_0x6b39('0x32')]);_0x51baff[_0x6b39('0x35')]=_['intersection'](_0x277eb4[_0x6b39('0x34')],qs['fields'](_0x1067ca[_0x6b39('0x32')][_0x6b39('0x36')]));_0x51baff[_0x6b39('0x35')]=_0x51baff['attributes'][_0x6b39('0x37')]?_0x51baff[_0x6b39('0x35')]:_0x277eb4[_0x6b39('0x34')];if(!_0x1067ca[_0x6b39('0x32')]['hasOwnProperty'](_0x6b39('0x38'))){_0x51baff['limit']=qs['limit'](_0x1067ca[_0x6b39('0x32')][_0x6b39('0x1e')]);_0x51baff[_0x6b39('0x1c')]=qs[_0x6b39('0x1c')](_0x1067ca[_0x6b39('0x32')]['offset']);}_0x51baff[_0x6b39('0x39')]=qs['sort'](_0x1067ca['query'][_0x6b39('0x3a')]);_0x51baff[_0x6b39('0x3b')]=qs[_0x6b39('0x33')](_[_0x6b39('0x3c')](_0x1067ca['query'],_0x277eb4[_0x6b39('0x33')]),_0xd3fae9);if(_0x1067ca[_0x6b39('0x32')]['filter']){_0x51baff[_0x6b39('0x3b')]=_['merge'](_0x51baff[_0x6b39('0x3b')],{'$or':_['map'](_0xd3fae9,function(_0x52ef93){if(_0x52ef93[_0x6b39('0x2f')]!==_0x6b39('0x3d')){var _0x1d9a2b={};_0x1d9a2b[_0x52ef93[_0x6b39('0x29')]]={'$like':'%'+_0x1067ca['query'][_0x6b39('0x3e')]+'%'};return _0x1d9a2b;}})});}_0x51baff=_[_0x6b39('0x3f')]({},_0x51baff,_0x1067ca[_0x6b39('0x40')]);var _0x10447d={'where':_0x51baff['where']};return db[_0x6b39('0x2d')][_0x6b39('0x1f')](_0x10447d)[_0x6b39('0x26')](function(_0x2e9e47){_0x23d60a['count']=_0x2e9e47;if(_0x1067ca[_0x6b39('0x32')][_0x6b39('0x41')]){_0x51baff['include']=[{'all':!![]}];}return db[_0x6b39('0x2d')]['findAll'](_0x51baff);})[_0x6b39('0x26')](function(_0x46d70e){_0x23d60a[_0x6b39('0x42')]=_0x46d70e;return _0x23d60a;})['then'](respondWithFilteredResult(_0x5728f4,_0x51baff))[_0x6b39('0x43')](handleError(_0x5728f4,null));};exports[_0x6b39('0x44')]=function(_0x426275,_0x50a6a6){var _0x228825={'raw':![],'where':{'id':_0x426275['params']['id']}},_0x16c030={};_0x16c030[_0x6b39('0x34')]=_[_0x6b39('0x31')](db[_0x6b39('0x2d')]['rawAttributes']);_0x16c030[_0x6b39('0x32')]=_[_0x6b39('0x31')](_0x426275[_0x6b39('0x32')]);_0x16c030['filters']=_['intersection'](_0x16c030[_0x6b39('0x34')],_0x16c030[_0x6b39('0x32')]);_0x228825['attributes']=_[_0x6b39('0x45')](_0x16c030['model'],qs[_0x6b39('0x36')](_0x426275[_0x6b39('0x32')][_0x6b39('0x36')]));_0x228825[_0x6b39('0x35')]=_0x228825[_0x6b39('0x35')][_0x6b39('0x37')]?_0x228825['attributes']:_0x16c030[_0x6b39('0x34')];if(_0x426275[_0x6b39('0x32')]['includeAll']){_0x228825[_0x6b39('0x46')]=[{'all':!![]}];}_0x228825=_[_0x6b39('0x3f')]({},_0x228825,_0x426275[_0x6b39('0x40')]);return db[_0x6b39('0x2d')][_0x6b39('0x47')](_0x228825)[_0x6b39('0x26')](handleEntityNotFound(_0x50a6a6,null))['then'](respondWithResult(_0x50a6a6,null))[_0x6b39('0x43')](handleError(_0x50a6a6,null));};exports[_0x6b39('0x48')]=function(_0x4d508c,_0xa174c9){return db['ZohoAccount']['create'](_0x4d508c[_0x6b39('0x49')],{})['then'](respondWithResult(_0xa174c9,0xc9))['catch'](handleError(_0xa174c9,null));};exports[_0x6b39('0x25')]=function(_0xaa06d0,_0xc1971b){if(_0xaa06d0[_0x6b39('0x49')]['id']){delete _0xaa06d0[_0x6b39('0x49')]['id'];}return db[_0x6b39('0x2d')]['find']({'where':{'id':_0xaa06d0['params']['id']}})[_0x6b39('0x26')](handleEntityNotFound(_0xc1971b,null))[_0x6b39('0x26')](saveUpdates(_0xaa06d0['body'],null))['then'](respondWithResult(_0xc1971b,null))[_0x6b39('0x43')](handleError(_0xc1971b,null));};exports['destroy']=function(_0x49abd2,_0x340a4d){return db[_0x6b39('0x2d')][_0x6b39('0x47')]({'where':{'id':_0x49abd2[_0x6b39('0x4a')]['id']}})[_0x6b39('0x26')](handleEntityNotFound(_0x340a4d,null))['then'](removeEntity(_0x340a4d,null))[_0x6b39('0x43')](handleError(_0x340a4d,null));};exports[_0x6b39('0x4b')]=function(_0x41d046,_0x1db818,_0x36cd00){var _0x2ff0cb={};var _0x2e2e26={};var _0x35715b;var _0x51e2d8;return db[_0x6b39('0x2d')][_0x6b39('0x4c')]({'where':{'id':_0x41d046[_0x6b39('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1db818,null))['then'](function(_0x2dcff3){if(_0x2dcff3){_0x35715b=_0x2dcff3;_0x2e2e26[_0x6b39('0x34')]=_[_0x6b39('0x31')](db['ZohoConfiguration'][_0x6b39('0x2e')]);_0x2e2e26[_0x6b39('0x32')]=_[_0x6b39('0x31')](_0x41d046[_0x6b39('0x32')]);_0x2e2e26[_0x6b39('0x33')]=_[_0x6b39('0x45')](_0x2e2e26[_0x6b39('0x34')],_0x2e2e26[_0x6b39('0x32')]);_0x2ff0cb[_0x6b39('0x35')]=_[_0x6b39('0x45')](_0x2e2e26[_0x6b39('0x34')],qs['fields'](_0x41d046[_0x6b39('0x32')][_0x6b39('0x36')]));_0x2ff0cb['attributes']=_0x2ff0cb[_0x6b39('0x35')]['length']?_0x2ff0cb[_0x6b39('0x35')]:_0x2e2e26[_0x6b39('0x34')];_0x2ff0cb[_0x6b39('0x39')]=qs[_0x6b39('0x3a')](_0x41d046[_0x6b39('0x32')][_0x6b39('0x3a')]);_0x2ff0cb['where']=qs[_0x6b39('0x33')](_[_0x6b39('0x3c')](_0x41d046[_0x6b39('0x32')],_0x2e2e26[_0x6b39('0x33')]));if(_0x41d046[_0x6b39('0x32')][_0x6b39('0x3e')]){_0x2ff0cb['where']=_[_0x6b39('0x3f')](_0x2ff0cb[_0x6b39('0x3b')],{'$or':_[_0x6b39('0x2c')](_0x2ff0cb[_0x6b39('0x35')],function(_0x1a6e75){var _0x50ce26={};_0x50ce26[_0x1a6e75]={'$like':'%'+_0x41d046[_0x6b39('0x32')][_0x6b39('0x3e')]+'%'};return _0x50ce26;})});}_0x2ff0cb=_[_0x6b39('0x3f')]({},_0x2ff0cb,_0x41d046[_0x6b39('0x40')]);return _0x35715b[_0x6b39('0x4b')](_0x2ff0cb);}})['then'](function(_0x58f8ef){if(_0x58f8ef){_0x51e2d8=_0x58f8ef[_0x6b39('0x37')];if(!_0x41d046['query'][_0x6b39('0x4d')]('nolimit')){_0x2ff0cb[_0x6b39('0x1e')]=qs[_0x6b39('0x1e')](_0x41d046['query'][_0x6b39('0x1e')]);_0x2ff0cb[_0x6b39('0x1c')]=qs['offset'](_0x41d046['query']['offset']);}return _0x35715b[_0x6b39('0x4b')](_0x2ff0cb);}})[_0x6b39('0x26')](function(_0x5bb597){if(_0x5bb597){return _0x5bb597?{'count':_0x51e2d8,'rows':_0x5bb597}:null;}})[_0x6b39('0x26')](respondWithResult(_0x1db818,null))['catch'](handleError(_0x1db818,null));};exports[_0x6b39('0x4e')]=function(_0x51ee1f,_0x2c7903,_0x254a04){if(_0x51ee1f[_0x6b39('0x49')]['id']){delete _0x51ee1f[_0x6b39('0x49')]['id'];}return db[_0x6b39('0x2d')]['findOne']({'where':{'id':_0x51ee1f[_0x6b39('0x4a')]['id']}})[_0x6b39('0x26')](handleEntityNotFound(_0x2c7903,null))[_0x6b39('0x26')](function(_0x5359dd){if(_0x5359dd){_0x51ee1f[_0x6b39('0x49')][_0x6b39('0x4f')]=_0x5359dd['id'];_0x51ee1f[_0x6b39('0x49')][_0x6b39('0x50')]=integrations['getSubjects'](_0x51ee1f['body'][_0x6b39('0x51')],_0x51ee1f['body'][_0x6b39('0x2f')]);_0x51ee1f[_0x6b39('0x49')][_0x6b39('0x52')]=integrations[_0x6b39('0x53')](_0x51ee1f[_0x6b39('0x49')][_0x6b39('0x51')],_0x51ee1f['body'][_0x6b39('0x2f')]);return db[_0x6b39('0x54')][_0x6b39('0x48')](_0x51ee1f[_0x6b39('0x49')],{'include':[{'model':db[_0x6b39('0x55')],'as':'Subjects'},{'model':db[_0x6b39('0x55')],'as':_0x6b39('0x52')}]});}return null;})[_0x6b39('0x26')](respondWithResult(_0x2c7903,null))[_0x6b39('0x43')](handleError(_0x2c7903,null));};function getAccessToken(_0x727cc0){return new Promise(function(_0x58fb34,_0x33669a){var _0x2395ea;switch(_0x727cc0[_0x6b39('0x56')]){case'US':_0x2395ea=_0x6b39('0x57');break;case'AU':_0x2395ea=_0x6b39('0x58');break;case'EU':_0x2395ea=_0x6b39('0x59');break;case'IN':_0x2395ea=_0x6b39('0x5a');break;case'CN':_0x2395ea=_0x6b39('0x5b');break;default:_0x2395ea='https://accounts.zoho.eu';break;}var _0x4950bb={'method':_0x6b39('0x5c'),'uri':_0x2395ea+'/oauth/v2/token','qs':{'refresh_token':_0x727cc0['refreshToken'],'client_id':_0x727cc0[_0x6b39('0x5d')],'client_secret':_0x727cc0['clientSecret'],'grant_type':_0x6b39('0x5e')},'json':!![]};return rp(_0x4950bb)['then'](function(_0x14131c){if(_0x14131c[_0x6b39('0x5f')]){_0x58fb34(_0x14131c['access_token']);}else{_0x33669a(_0x6b39('0x60'));}})[_0x6b39('0x43')](function(_0x4319bf){_0x33669a(_0x4319bf);});});}exports['getFields']=function(_0x416a00,_0x4a5ab0,_0x21cb2b){var _0x513bf4,_0x48f7b4,_0x514401,_0x32d539,_0x17fb9d;return db[_0x6b39('0x2d')]['findOne']({'where':{'id':_0x416a00[_0x6b39('0x4a')]['id']},'attributes':['id','host','zone','clientId',_0x6b39('0x61'),_0x6b39('0x62'),_0x6b39('0x63'),_0x6b39('0x64')]})[_0x6b39('0x26')](handleEntityNotFound(_0x4a5ab0,null))[_0x6b39('0x26')](function(_0x2c4c7d){_0x17fb9d=_0x2c4c7d;_0x513bf4=_0x17fb9d['host'];_0x48f7b4=_0x513bf4===_0x6b39('0x65')?'eu':_0x6b39('0x66');_0x514401=_0x17fb9d[_0x6b39('0x62')];var _0x40a1a1=_0x514401[_0x6b39('0x67')](-0x1);if(_0x40a1a1==='/'||_0x40a1a1==='\x5c'||_0x40a1a1===':'){_0x514401=_0x514401['substring'](0x0,_0x514401[_0x6b39('0x68')](_0x40a1a1));}if(!_0x17fb9d[_0x6b39('0x64')]){throw new Error(_0x6b39('0x69'));}return getAccessToken(_0x17fb9d);})[_0x6b39('0x26')](function(_0x422b11){if(_0x422b11){return rp({'method':'GET','uri':util[_0x6b39('0x6a')](_0x6b39('0x6b'),_0x48f7b4),'qs':{'module':_0x6b39('0x6c')},'headers':{'Authorization':_0x6b39('0x6d')+_0x422b11},'json':!![]});}})['then'](function(_0x201026){if(_0x201026){if(_0x201026[_0x6b39('0x6e')]&&_0x201026[_0x6b39('0x6e')][_0x6b39('0x28')]){throw new Error(_0x201026[_0x6b39('0x6e')][_0x6b39('0x28')]['message']);}var _0x168aa4=[];var _0x4e2005=[];var _0x93c9bc=[_0x6b39('0x6f'),_0x6b39('0x70'),_0x6b39('0x71'),_0x6b39('0x72'),_0x6b39('0x73'),_0x6b39('0x74'),_0x6b39('0x75'),_0x6b39('0x76')];_0x4e2005=_['remove'](_0x201026[_0x6b39('0x36')],function(_0x32f145){return _0x93c9bc[_0x6b39('0x77')](_0x32f145[_0x6b39('0x78')]);});for(var _0xa07b7=0x0;_0xa07b7<_0x4e2005[_0x6b39('0x37')];_0xa07b7++){if(_0x4e2005[_0xa07b7][_0x6b39('0x79')]===![]){_0x168aa4['push']({'id':_0x4e2005[_0xa07b7]['id'],'name':_0x4e2005[_0xa07b7][_0x6b39('0x7a')],'custom':_0x4e2005[_0xa07b7][_0x6b39('0x7b')],'options':_0x4e2005[_0xa07b7][_0x6b39('0x7c')]===_0x6b39('0x7d')&&_0x4e2005[_0xa07b7][_0x6b39('0x7e')][_0x6b39('0x37')]>-0x1?_[_0x6b39('0x2c')](_0x4e2005[_0xa07b7][_0x6b39('0x7e')],function(_0x4341ec){return{'name':_0x4341ec,'value':_0x4341ec};}):[]});}}return{'count':_0x168aa4[_0x6b39('0x37')],'rows':_0x168aa4};}else{return{'count':0x0,'rows':[]};}})[_0x6b39('0x26')](respondWithResult(_0x4a5ab0,null))[_0x6b39('0x43')](function(_0x22def1){var _0x227c66=_0x416a00[_0x6b39('0x32')][_0x6b39('0x7f')]?0x1f4:_0x22def1[_0x6b39('0x80')]||0x1f4;logger['error'](_0x6b39('0x81'),_0x6b39('0x82'),_0x227c66,JSON[_0x6b39('0x83')](_0x22def1));delete _0x22def1[_0x6b39('0x29')];if(_0x227c66===0x191){_0x227c66=0x190;}_0x4a5ab0[_0x6b39('0x1a')](_0x227c66)[_0x6b39('0x2a')](_0x416a00[_0x6b39('0x32')]['test']?{'message':_0x6b39('0x84'),'statusCode':_0x22def1[_0x6b39('0x80')]}:_0x22def1);});}; \ No newline at end of file +var _0x1f7f=['ZohoConfiguration','rawAttributes','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','code','com','slice','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoAccount','count','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne'];(function(_0x3a5024,_0x1f64a5){var _0x346f58=function(_0xed956f){while(--_0xed956f){_0x3a5024['push'](_0x3a5024['shift']());}};_0x346f58(++_0x1f64a5);}(_0x1f7f,0x124));var _0xf1f7=function(_0x516770,_0xb9ffc8){_0x516770=_0x516770-0x0;var _0x5008f8=_0x1f7f[_0x516770];return _0x5008f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1f7('0x0'));var zipdir=require(_0xf1f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1f7('0x2'));var moment=require(_0xf1f7('0x3'));var BPromise=require(_0xf1f7('0x4'));var Mustache=require(_0xf1f7('0x5'));var util=require(_0xf1f7('0x6'));var path=require(_0xf1f7('0x7'));var sox=require('sox');var csv=require(_0xf1f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1f7('0x9'));var _=require(_0xf1f7('0xa'));var squel=require('squel');var crypto=require(_0xf1f7('0xb'));var jsforce=require(_0xf1f7('0xc'));var deskjs=require(_0xf1f7('0xd'));var toCsv=require(_0xf1f7('0x8'));var querystring=require(_0xf1f7('0xe'));var Papa=require(_0xf1f7('0xf'));var Redis=require(_0xf1f7('0x10'));var authService=require(_0xf1f7('0x11'));var qs=require(_0xf1f7('0x12'));var as=require(_0xf1f7('0x13'));var hardwareService=require(_0xf1f7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf1f7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf1f7('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x25b8bf,_0x5b44af){_0x5b44af=_0x5b44af||0xcc;return function(_0x175a38){if(_0x175a38){return _0x25b8bf['sendStatus'](_0x5b44af);}return _0x25b8bf[_0xf1f7('0x17')](_0x5b44af)['end']();};}function respondWithResult(_0x5ee5e2,_0x53d865){_0x53d865=_0x53d865||0xc8;return function(_0x3ad632){if(_0x3ad632){return _0x5ee5e2['status'](_0x53d865)[_0xf1f7('0x18')](_0x3ad632);}};}function respondWithFilteredResult(_0x32871e,_0x4ae0ad){return function(_0x4ad983){if(_0x4ad983){var _0x5361a8=typeof _0x4ae0ad[_0xf1f7('0x19')]===_0xf1f7('0x1a')&&typeof _0x4ae0ad['limit']===_0xf1f7('0x1a');var _0x15cd40=_0x4ad983['count'];var _0x18fa1d=_0x5361a8?0x0:_0x4ae0ad['offset'];var _0x4d1824=_0x5361a8?_0x4ad983['count']:_0x4ae0ad[_0xf1f7('0x19')]+_0x4ae0ad[_0xf1f7('0x1b')];var _0x3ac713;if(_0x4d1824>=_0x15cd40){_0x4d1824=_0x15cd40;_0x3ac713=0xc8;}else{_0x3ac713=0xce;}_0x32871e[_0xf1f7('0x17')](_0x3ac713);return _0x32871e['set']('Content-Range',_0x18fa1d+'-'+_0x4d1824+'/'+_0x15cd40)[_0xf1f7('0x18')](_0x4ad983);}return null;};}function patchUpdates(_0x54cc3b){return function(_0x318e0e){try{jsonpatch[_0xf1f7('0x1c')](_0x318e0e,_0x54cc3b,!![]);}catch(_0x23c7c8){return BPromise[_0xf1f7('0x1d')](_0x23c7c8);}return _0x318e0e[_0xf1f7('0x1e')]();};}function saveUpdates(_0x19b720,_0x4cbf3b){return function(_0x1a6e75){if(_0x1a6e75){return _0x1a6e75[_0xf1f7('0x1f')](_0x19b720)[_0xf1f7('0x20')](function(_0x5df143){return _0x5df143;});}return null;};}function removeEntity(_0x2ba273,_0x2e8835){return function(_0x8bbd8c){if(_0x8bbd8c){return _0x8bbd8c[_0xf1f7('0x21')]()['then'](function(){_0x2ba273['status'](0xcc)[_0xf1f7('0x22')]();});}};}function handleEntityNotFound(_0x2aaccc,_0x7755b4){return function(_0x238541){if(!_0x238541){_0x2aaccc[_0xf1f7('0x23')](0x194);}return _0x238541;};}function handleError(_0x1c5b6c,_0x47d0f1){_0x47d0f1=_0x47d0f1||0x1f4;return function(_0x20b8f4){logger[_0xf1f7('0x24')](_0x20b8f4['stack']);if(_0x20b8f4[_0xf1f7('0x25')]){delete _0x20b8f4['name'];}_0x1c5b6c[_0xf1f7('0x17')](_0x47d0f1)[_0xf1f7('0x26')](_0x20b8f4);};}exports[_0xf1f7('0x27')]=function(_0x1322b9,_0x481cea){var _0x5d7431={},_0x308e22={},_0x53f729={'count':0x0,'rows':[]};var _0x528490=_['map'](db['ZohoAccount']['rawAttributes'],function(_0x1c788f){return{'name':_0x1c788f[_0xf1f7('0x28')],'type':_0x1c788f[_0xf1f7('0x29')][_0xf1f7('0x2a')]};});_0x308e22[_0xf1f7('0x2b')]=_[_0xf1f7('0x2c')](_0x528490,_0xf1f7('0x25'));_0x308e22[_0xf1f7('0x2d')]=_[_0xf1f7('0x2e')](_0x1322b9['query']);_0x308e22[_0xf1f7('0x2f')]=_[_0xf1f7('0x30')](_0x308e22['model'],_0x308e22['query']);_0x5d7431[_0xf1f7('0x31')]=_[_0xf1f7('0x30')](_0x308e22[_0xf1f7('0x2b')],qs[_0xf1f7('0x32')](_0x1322b9[_0xf1f7('0x2d')][_0xf1f7('0x32')]));_0x5d7431['attributes']=_0x5d7431[_0xf1f7('0x31')][_0xf1f7('0x33')]?_0x5d7431[_0xf1f7('0x31')]:_0x308e22[_0xf1f7('0x2b')];if(!_0x1322b9[_0xf1f7('0x2d')][_0xf1f7('0x34')](_0xf1f7('0x35'))){_0x5d7431[_0xf1f7('0x1b')]=qs[_0xf1f7('0x1b')](_0x1322b9['query'][_0xf1f7('0x1b')]);_0x5d7431[_0xf1f7('0x19')]=qs[_0xf1f7('0x19')](_0x1322b9[_0xf1f7('0x2d')][_0xf1f7('0x19')]);}_0x5d7431[_0xf1f7('0x36')]=qs[_0xf1f7('0x37')](_0x1322b9[_0xf1f7('0x2d')][_0xf1f7('0x37')]);_0x5d7431[_0xf1f7('0x38')]=qs[_0xf1f7('0x2f')](_[_0xf1f7('0x39')](_0x1322b9['query'],_0x308e22[_0xf1f7('0x2f')]),_0x528490);if(_0x1322b9['query'][_0xf1f7('0x3a')]){_0x5d7431[_0xf1f7('0x38')]=_[_0xf1f7('0x3b')](_0x5d7431[_0xf1f7('0x38')],{'$or':_[_0xf1f7('0x2c')](_0x528490,function(_0x34b3c5){if(_0x34b3c5['type']!=='VIRTUAL'){var _0x187478={};_0x187478[_0x34b3c5[_0xf1f7('0x25')]]={'$like':'%'+_0x1322b9['query'][_0xf1f7('0x3a')]+'%'};return _0x187478;}})});}_0x5d7431=_[_0xf1f7('0x3b')]({},_0x5d7431,_0x1322b9[_0xf1f7('0x3c')]);var _0x21d7d4={'where':_0x5d7431['where']};return db[_0xf1f7('0x3d')][_0xf1f7('0x3e')](_0x21d7d4)[_0xf1f7('0x20')](function(_0x3ef05b){_0x53f729[_0xf1f7('0x3e')]=_0x3ef05b;if(_0x1322b9[_0xf1f7('0x2d')][_0xf1f7('0x3f')]){_0x5d7431[_0xf1f7('0x40')]=[{'all':!![]}];}return db[_0xf1f7('0x3d')][_0xf1f7('0x41')](_0x5d7431);})[_0xf1f7('0x20')](function(_0x152a5a){_0x53f729['rows']=_0x152a5a;return _0x53f729;})['then'](respondWithFilteredResult(_0x481cea,_0x5d7431))[_0xf1f7('0x42')](handleError(_0x481cea,null));};exports[_0xf1f7('0x43')]=function(_0x5dfcdf,_0x3985fe){var _0x56229f={'raw':![],'where':{'id':_0x5dfcdf[_0xf1f7('0x44')]['id']}},_0x18a6ef={};_0x18a6ef[_0xf1f7('0x2b')]=_['keys'](db['ZohoAccount']['rawAttributes']);_0x18a6ef['query']=_['keys'](_0x5dfcdf['query']);_0x18a6ef['filters']=_[_0xf1f7('0x30')](_0x18a6ef[_0xf1f7('0x2b')],_0x18a6ef['query']);_0x56229f[_0xf1f7('0x31')]=_[_0xf1f7('0x30')](_0x18a6ef[_0xf1f7('0x2b')],qs[_0xf1f7('0x32')](_0x5dfcdf['query']['fields']));_0x56229f[_0xf1f7('0x31')]=_0x56229f[_0xf1f7('0x31')][_0xf1f7('0x33')]?_0x56229f[_0xf1f7('0x31')]:_0x18a6ef[_0xf1f7('0x2b')];if(_0x5dfcdf[_0xf1f7('0x2d')][_0xf1f7('0x3f')]){_0x56229f[_0xf1f7('0x40')]=[{'all':!![]}];}_0x56229f=_[_0xf1f7('0x3b')]({},_0x56229f,_0x5dfcdf[_0xf1f7('0x3c')]);return db[_0xf1f7('0x3d')][_0xf1f7('0x45')](_0x56229f)[_0xf1f7('0x20')](handleEntityNotFound(_0x3985fe,null))[_0xf1f7('0x20')](respondWithResult(_0x3985fe,null))[_0xf1f7('0x42')](handleError(_0x3985fe,null));};exports['create']=function(_0x4504cb,_0x6c2809){return db[_0xf1f7('0x3d')][_0xf1f7('0x46')](_0x4504cb[_0xf1f7('0x47')],{})[_0xf1f7('0x20')](respondWithResult(_0x6c2809,0xc9))['catch'](handleError(_0x6c2809,null));};exports[_0xf1f7('0x1f')]=function(_0x3a6b79,_0xf1f288){if(_0x3a6b79[_0xf1f7('0x47')]['id']){delete _0x3a6b79['body']['id'];}return db[_0xf1f7('0x3d')][_0xf1f7('0x45')]({'where':{'id':_0x3a6b79[_0xf1f7('0x44')]['id']}})[_0xf1f7('0x20')](handleEntityNotFound(_0xf1f288,null))[_0xf1f7('0x20')](saveUpdates(_0x3a6b79[_0xf1f7('0x47')],null))[_0xf1f7('0x20')](respondWithResult(_0xf1f288,null))[_0xf1f7('0x42')](handleError(_0xf1f288,null));};exports[_0xf1f7('0x21')]=function(_0x277a82,_0x58da31){return db['ZohoAccount'][_0xf1f7('0x45')]({'where':{'id':_0x277a82[_0xf1f7('0x44')]['id']}})[_0xf1f7('0x20')](handleEntityNotFound(_0x58da31,null))[_0xf1f7('0x20')](removeEntity(_0x58da31,null))[_0xf1f7('0x42')](handleError(_0x58da31,null));};exports[_0xf1f7('0x48')]=function(_0x4b88a0,_0x444ce9,_0x142c0e){var _0x5136d5={};var _0x577aff={};var _0x1c0519;var _0x413171;return db[_0xf1f7('0x3d')][_0xf1f7('0x49')]({'where':{'id':_0x4b88a0[_0xf1f7('0x44')]['id']}})['then'](handleEntityNotFound(_0x444ce9,null))['then'](function(_0x2124db){if(_0x2124db){_0x1c0519=_0x2124db;_0x577aff[_0xf1f7('0x2b')]=_[_0xf1f7('0x2e')](db[_0xf1f7('0x4a')][_0xf1f7('0x4b')]);_0x577aff[_0xf1f7('0x2d')]=_[_0xf1f7('0x2e')](_0x4b88a0['query']);_0x577aff[_0xf1f7('0x2f')]=_[_0xf1f7('0x30')](_0x577aff['model'],_0x577aff[_0xf1f7('0x2d')]);_0x5136d5['attributes']=_[_0xf1f7('0x30')](_0x577aff[_0xf1f7('0x2b')],qs[_0xf1f7('0x32')](_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x32')]));_0x5136d5[_0xf1f7('0x31')]=_0x5136d5[_0xf1f7('0x31')][_0xf1f7('0x33')]?_0x5136d5[_0xf1f7('0x31')]:_0x577aff[_0xf1f7('0x2b')];_0x5136d5[_0xf1f7('0x36')]=qs[_0xf1f7('0x37')](_0x4b88a0[_0xf1f7('0x2d')]['sort']);_0x5136d5[_0xf1f7('0x38')]=qs[_0xf1f7('0x2f')](_[_0xf1f7('0x39')](_0x4b88a0[_0xf1f7('0x2d')],_0x577aff[_0xf1f7('0x2f')]));if(_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x3a')]){_0x5136d5[_0xf1f7('0x38')]=_[_0xf1f7('0x3b')](_0x5136d5[_0xf1f7('0x38')],{'$or':_['map'](_0x5136d5['attributes'],function(_0x3bf86f){var _0x458864={};_0x458864[_0x3bf86f]={'$like':'%'+_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x3a')]+'%'};return _0x458864;})});}_0x5136d5=_[_0xf1f7('0x3b')]({},_0x5136d5,_0x4b88a0['options']);return _0x1c0519[_0xf1f7('0x48')](_0x5136d5);}})[_0xf1f7('0x20')](function(_0x1a0780){if(_0x1a0780){_0x413171=_0x1a0780[_0xf1f7('0x33')];if(!_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x34')](_0xf1f7('0x35'))){_0x5136d5[_0xf1f7('0x1b')]=qs[_0xf1f7('0x1b')](_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x1b')]);_0x5136d5[_0xf1f7('0x19')]=qs[_0xf1f7('0x19')](_0x4b88a0[_0xf1f7('0x2d')][_0xf1f7('0x19')]);}return _0x1c0519[_0xf1f7('0x48')](_0x5136d5);}})[_0xf1f7('0x20')](function(_0x4ab942){if(_0x4ab942){return _0x4ab942?{'count':_0x413171,'rows':_0x4ab942}:null;}})[_0xf1f7('0x20')](respondWithResult(_0x444ce9,null))[_0xf1f7('0x42')](handleError(_0x444ce9,null));};exports[_0xf1f7('0x4c')]=function(_0x2b7975,_0x359139,_0x2584f5){if(_0x2b7975[_0xf1f7('0x47')]['id']){delete _0x2b7975[_0xf1f7('0x47')]['id'];}return db['ZohoAccount'][_0xf1f7('0x49')]({'where':{'id':_0x2b7975[_0xf1f7('0x44')]['id']}})[_0xf1f7('0x20')](handleEntityNotFound(_0x359139,null))[_0xf1f7('0x20')](function(_0x498edf){if(_0x498edf){_0x2b7975[_0xf1f7('0x47')]['AccountId']=_0x498edf['id'];_0x2b7975[_0xf1f7('0x47')][_0xf1f7('0x4d')]=integrations[_0xf1f7('0x4e')](_0x2b7975['body'][_0xf1f7('0x4f')],_0x2b7975[_0xf1f7('0x47')][_0xf1f7('0x29')]);_0x2b7975['body'][_0xf1f7('0x50')]=integrations[_0xf1f7('0x51')](_0x2b7975[_0xf1f7('0x47')]['channel'],_0x2b7975[_0xf1f7('0x47')][_0xf1f7('0x29')]);return db['ZohoConfiguration'][_0xf1f7('0x46')](_0x2b7975[_0xf1f7('0x47')],{'include':[{'model':db[_0xf1f7('0x52')],'as':_0xf1f7('0x4d')},{'model':db[_0xf1f7('0x52')],'as':_0xf1f7('0x50')}]});}return null;})[_0xf1f7('0x20')](respondWithResult(_0x359139,null))[_0xf1f7('0x42')](handleError(_0x359139,null));};function getAccessToken(_0x5a6934){return new Promise(function(_0x14918c,_0x496052){var _0x2bca03;switch(_0x5a6934[_0xf1f7('0x53')]){case'US':_0x2bca03=_0xf1f7('0x54');break;case'AU':_0x2bca03='https://accounts.zoho.com.au';break;case'EU':_0x2bca03=_0xf1f7('0x55');break;case'IN':_0x2bca03='https://accounts.zoho.in';break;case'CN':_0x2bca03='https://accounts.zoho.com.cn';break;default:_0x2bca03=_0xf1f7('0x55');break;}var _0x42bb16={'method':'POST','uri':_0x2bca03+_0xf1f7('0x56'),'qs':{'refresh_token':_0x5a6934[_0xf1f7('0x57')],'client_id':_0x5a6934[_0xf1f7('0x58')],'client_secret':_0x5a6934['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x42bb16)['then'](function(_0xe3fe59){if(_0xe3fe59[_0xf1f7('0x59')]){_0x14918c(_0xe3fe59['access_token']);}else{_0x496052(_0xf1f7('0x5a'));}})['catch'](function(_0x2257a1){_0x496052(_0x2257a1);});});}exports['getFields']=function(_0x537b83,_0x303466,_0x34d20a){var _0x1f1e96,_0x467e0d,_0x3a9b5b,_0x23f25f,_0x22497c;return db[_0xf1f7('0x3d')][_0xf1f7('0x49')]({'where':{'id':_0x537b83[_0xf1f7('0x44')]['id']},'attributes':['id',_0xf1f7('0x5b'),_0xf1f7('0x53'),_0xf1f7('0x58'),_0xf1f7('0x5c'),_0xf1f7('0x5d'),_0xf1f7('0x5e'),_0xf1f7('0x57')]})[_0xf1f7('0x20')](handleEntityNotFound(_0x303466,null))[_0xf1f7('0x20')](function(_0xed662c){_0x22497c=_0xed662c;_0x1f1e96=_0x22497c[_0xf1f7('0x5b')];_0x467e0d=_0x1f1e96==='zoho.eu'?'eu':_0xf1f7('0x5f');_0x3a9b5b=_0x22497c[_0xf1f7('0x5d')];var _0x4f9bd1=_0x3a9b5b[_0xf1f7('0x60')](-0x1);if(_0x4f9bd1==='/'||_0x4f9bd1==='\x5c'||_0x4f9bd1===':'){_0x3a9b5b=_0x3a9b5b['substring'](0x0,_0x3a9b5b[_0xf1f7('0x61')](_0x4f9bd1));}if(!_0x22497c[_0xf1f7('0x57')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x22497c);})[_0xf1f7('0x20')](function(_0x4c7549){if(_0x4c7549){return rp({'method':_0xf1f7('0x62'),'uri':util[_0xf1f7('0x63')](_0xf1f7('0x64'),_0x467e0d),'qs':{'module':'Calls'},'headers':{'Authorization':_0xf1f7('0x65')+_0x4c7549},'json':!![]});}})[_0xf1f7('0x20')](function(_0x43c5f3){if(_0x43c5f3){if(_0x43c5f3[_0xf1f7('0x66')]&&_0x43c5f3[_0xf1f7('0x66')][_0xf1f7('0x24')]){throw new Error(_0x43c5f3[_0xf1f7('0x66')][_0xf1f7('0x24')][_0xf1f7('0x67')]);}var _0x396f46=[];var _0x44249a=[];var _0x361007=[_0xf1f7('0x68'),_0xf1f7('0x69'),_0xf1f7('0x6a'),_0xf1f7('0x6b'),_0xf1f7('0x6c'),_0xf1f7('0x6d'),'Call_Start_Time',_0xf1f7('0x6e')];_0x44249a=_[_0xf1f7('0x6f')](_0x43c5f3[_0xf1f7('0x32')],function(_0x56676f){return _0x361007['includes'](_0x56676f['api_name']);});for(var _0x4d1cfa=0x0;_0x4d1cfa<_0x44249a[_0xf1f7('0x33')];_0x4d1cfa++){if(_0x44249a[_0x4d1cfa]['system_mandatory']===![]){_0x396f46[_0xf1f7('0x70')]({'id':_0x44249a[_0x4d1cfa]['id'],'name':_0x44249a[_0x4d1cfa][_0xf1f7('0x71')],'custom':_0x44249a[_0x4d1cfa][_0xf1f7('0x72')],'options':_0x44249a[_0x4d1cfa][_0xf1f7('0x73')]===_0xf1f7('0x74')&&_0x44249a[_0x4d1cfa][_0xf1f7('0x75')][_0xf1f7('0x33')]>-0x1?_[_0xf1f7('0x2c')](_0x44249a[_0x4d1cfa][_0xf1f7('0x75')],function(_0x1e477b){return{'name':_0x1e477b,'value':_0x1e477b};}):[]});}}return{'count':_0x396f46['length'],'rows':_0x396f46};}else{return{'count':0x0,'rows':[]};}})[_0xf1f7('0x20')](respondWithResult(_0x303466,null))['catch'](function(_0x11a57f){var _0xeae347=_0x537b83[_0xf1f7('0x2d')][_0xf1f7('0x76')]?0x1f4:_0x11a57f[_0xf1f7('0x77')]||0x1f4;logger[_0xf1f7('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xf1f7('0x78'),_0xeae347,JSON[_0xf1f7('0x79')](_0x11a57f));delete _0x11a57f[_0xf1f7('0x25')];if(_0xeae347===0x191){_0xeae347=0x190;}_0x303466[_0xf1f7('0x17')](_0xeae347)['send'](_0x537b83[_0xf1f7('0x2d')][_0xf1f7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x11a57f['statusCode']}:_0x11a57f);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 2f83895..7d7601d 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 _0x01a4=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','slice','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refresh_token','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','code','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refreshToken','info','format'];(function(_0x5c1c64,_0x579832){var _0x45ded8=function(_0x4e3966){while(--_0x4e3966){_0x5c1c64['push'](_0x5c1c64['shift']());}};_0x45ded8(++_0x579832);}(_0x01a4,0xbb));var _0x401a=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x01a4[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x401a('0x0'));var util=require('util');var logger=require(_0x401a('0x1'))(_0x401a('0x2'));var moment=require('moment');var BPromise=require(_0x401a('0x3'));var rp=require(_0x401a('0x4'));var fs=require('fs');var path=require(_0x401a('0x5'));var rimraf=require(_0x401a('0x6'));var config=require(_0x401a('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x401a('0x8'));module[_0x401a('0x9')]=function(_0x33b988,_0x50a572){return _0x33b988[_0x401a('0xa')](_0x401a('0xb'),attributes,{'tableName':_0x401a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cbf78,_0x5056bb,_0x198281){if(_0x4cbf78[_0x401a('0xd')]('zone')||_0x4cbf78[_0x401a('0xd')](_0x401a('0xe'))||_0x4cbf78[_0x401a('0xd')]('clientId')||_0x4cbf78[_0x401a('0xd')](_0x401a('0xf'))||_0x4cbf78[_0x401a('0xd')](_0x401a('0x10'))||_0x4cbf78[_0x401a('0xd')]('host')){var _0x165271,_0x224329;_0x165271=_0x4cbf78[_0x401a('0xe')];var _0x24afef=_0x165271['slice'](-0x1);if(_0x24afef==='/'||_0x24afef==='\x5c'||_0x24afef===':'){_0x165271=_0x165271[_0x401a('0x11')](0x0,_0x165271[_0x401a('0x12')](_0x24afef));}switch(_0x4cbf78[_0x401a('0x13')]){case'US':_0x224329=_0x401a('0x14');break;case'AU':_0x224329=_0x401a('0x15');break;case'IN':_0x224329=_0x401a('0x16');break;case'CN':_0x224329='https://accounts.zoho.com.cn';break;default:_0x224329='https://accounts.zoho.eu';break;}var _0x2acfcf={'method':_0x401a('0x17'),'uri':_0x224329+_0x401a('0x18'),'form':{'grant_type':_0x401a('0x19'),'client_id':_0x4cbf78[_0x401a('0x1a')],'client_secret':_0x4cbf78[_0x401a('0xf')],'redirect_uri':_0x4cbf78[_0x401a('0xe')],'code':_0x4cbf78['code']},'headers':{'Content-Type':_0x401a('0x1b')}};return rp(_0x2acfcf)[_0x401a('0x1c')](function(_0x4338a5){var _0x587dd0=JSON[_0x401a('0x1d')](_0x4338a5);if(_0x587dd0['refresh_token']){_0x4cbf78[_0x401a('0x1e')]=_0x587dd0['refresh_token'];logger[_0x401a('0x1f')](util[_0x401a('0x20')](_0x401a('0x21'),_0x4cbf78['name'],_0x4cbf78['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4cbf78[_0x401a('0x22')],_0x4cbf78['id']),util[_0x401a('0x23')](_0x587dd0,{'showHidden':![],'depth':null}));}return _0x198281(null,_0x5056bb);})[_0x401a('0x24')](function(_0x1ec369){logger[_0x401a('0x25')](util[_0x401a('0x20')](_0x401a('0x26'),_0x4cbf78[_0x401a('0x22')],_0x4cbf78['id']),util[_0x401a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x198281(_0x1ec369);});}else{return _0x198281(null,_0x5056bb);}},'beforeUpdate':function(_0x3707a4,_0x2902b3,_0x468dcb){if(_0x3707a4['changed'](_0x401a('0x13'))||_0x3707a4[_0x401a('0xd')](_0x401a('0xe'))||_0x3707a4[_0x401a('0xd')]('clientId')||_0x3707a4['changed'](_0x401a('0xf'))||_0x3707a4[_0x401a('0xd')]('code')||_0x3707a4[_0x401a('0xd')](_0x401a('0x27'))){var _0x259f2d,_0x4aa41a;_0x259f2d=_0x3707a4['serverUrl'];var _0x30f444=_0x259f2d[_0x401a('0x28')](-0x1);if(_0x30f444==='/'||_0x30f444==='\x5c'||_0x30f444===':'){_0x259f2d=_0x259f2d[_0x401a('0x11')](0x0,_0x259f2d['lastIndexOf'](_0x30f444));}switch(_0x3707a4['zone']){case'US':_0x4aa41a=_0x401a('0x14');break;case'AU':_0x4aa41a=_0x401a('0x15');break;case'IN':_0x4aa41a=_0x401a('0x16');break;case'CN':_0x4aa41a=_0x401a('0x29');break;default:_0x4aa41a=_0x401a('0x2a');break;}var _0x5b0b7f={'method':_0x401a('0x17'),'uri':_0x4aa41a+'/oauth/v2/token','form':{'grant_type':_0x401a('0x19'),'client_id':_0x3707a4[_0x401a('0x1a')],'client_secret':_0x3707a4[_0x401a('0xf')],'redirect_uri':_0x3707a4['serverUrl'],'code':_0x3707a4[_0x401a('0x10')]},'headers':{'Content-Type':_0x401a('0x1b')}};return rp(_0x5b0b7f)[_0x401a('0x1c')](function(_0x191690){var _0x2eb3bc=JSON[_0x401a('0x1d')](_0x191690);if(_0x2eb3bc['refresh_token']){_0x3707a4[_0x401a('0x1e')]=_0x2eb3bc[_0x401a('0x2b')];logger[_0x401a('0x1f')](util['format'](_0x401a('0x21'),_0x3707a4['name'],_0x3707a4['id']));}else{logger['error'](util['format'](_0x401a('0x26'),_0x3707a4[_0x401a('0x22')],_0x3707a4['id']),util[_0x401a('0x23')](_0x2eb3bc,{'showHidden':![],'depth':null}));}return _0x468dcb(null,_0x2902b3);})[_0x401a('0x24')](function(_0x89cf6b){logger[_0x401a('0x25')](util[_0x401a('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3707a4[_0x401a('0x22')],_0x3707a4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x468dcb(_0x89cf6b);});}else{return _0x468dcb(null,_0x2902b3);}}}});}; \ No newline at end of file +var _0x1fd2=['zone','serverUrl','clientId','code','host','slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','parse','refresh_token','refreshToken','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','application/x-www-form-urlencoded','then','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed'];(function(_0xbe580b,_0x1239bb){var _0x2a731f=function(_0x57c70b){while(--_0x57c70b){_0xbe580b['push'](_0xbe580b['shift']());}};_0x2a731f(++_0x1239bb);}(_0x1fd2,0x184));var _0x21fd=function(_0x2bc572,_0x5ba389){_0x2bc572=_0x2bc572-0x0;var _0x22963e=_0x1fd2[_0x2bc572];return _0x22963e;};'use strict';var _=require(_0x21fd('0x0'));var util=require(_0x21fd('0x1'));var logger=require(_0x21fd('0x2'))(_0x21fd('0x3'));var moment=require(_0x21fd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21fd('0x5'));var config=require('../../config/environment');var attributes=require(_0x21fd('0x6'));var integrations=require(_0x21fd('0x7'));module['exports']=function(_0xeeef83,_0x3a988c){return _0xeeef83[_0x21fd('0x8')](_0x21fd('0x9'),attributes,{'tableName':_0x21fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36464a,_0xa0e16d,_0x2272fb){if(_0x36464a[_0x21fd('0xb')](_0x21fd('0xc'))||_0x36464a[_0x21fd('0xb')](_0x21fd('0xd'))||_0x36464a[_0x21fd('0xb')](_0x21fd('0xe'))||_0x36464a[_0x21fd('0xb')]('clientSecret')||_0x36464a[_0x21fd('0xb')](_0x21fd('0xf'))||_0x36464a['changed'](_0x21fd('0x10'))){var _0x1d09f7,_0x2ad3fa;_0x1d09f7=_0x36464a[_0x21fd('0xd')];var _0x19ec93=_0x1d09f7[_0x21fd('0x11')](-0x1);if(_0x19ec93==='/'||_0x19ec93==='\x5c'||_0x19ec93===':'){_0x1d09f7=_0x1d09f7['substring'](0x0,_0x1d09f7[_0x21fd('0x12')](_0x19ec93));}switch(_0x36464a['zone']){case'US':_0x2ad3fa='https://accounts.zoho.com';break;case'AU':_0x2ad3fa='https://accounts.zoho.com.au';break;case'IN':_0x2ad3fa=_0x21fd('0x13');break;case'CN':_0x2ad3fa=_0x21fd('0x14');break;default:_0x2ad3fa=_0x21fd('0x15');break;}var _0x175724={'method':_0x21fd('0x16'),'uri':_0x2ad3fa+_0x21fd('0x17'),'form':{'grant_type':_0x21fd('0x18'),'client_id':_0x36464a[_0x21fd('0xe')],'client_secret':_0x36464a[_0x21fd('0x19')],'redirect_uri':_0x36464a[_0x21fd('0xd')],'code':_0x36464a[_0x21fd('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x175724)['then'](function(_0x1ee82c){var _0x16ed50=JSON[_0x21fd('0x1a')](_0x1ee82c);if(_0x16ed50[_0x21fd('0x1b')]){_0x36464a[_0x21fd('0x1c')]=_0x16ed50[_0x21fd('0x1b')];logger['info'](util[_0x21fd('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x36464a[_0x21fd('0x1e')],_0x36464a['id']));}else{logger[_0x21fd('0x1f')](util[_0x21fd('0x1d')](_0x21fd('0x20'),_0x36464a[_0x21fd('0x1e')],_0x36464a['id']),util[_0x21fd('0x21')](_0x16ed50,{'showHidden':![],'depth':null}));}return _0x2272fb(null,_0xa0e16d);})['catch'](function(_0x3852f4){logger[_0x21fd('0x1f')](util[_0x21fd('0x1d')](_0x21fd('0x20'),_0x36464a[_0x21fd('0x1e')],_0x36464a['id']),util[_0x21fd('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2272fb(_0x3852f4);});}else{return _0x2272fb(null,_0xa0e16d);}},'beforeUpdate':function(_0x4b426b,_0x3f97ca,_0x515050){if(_0x4b426b[_0x21fd('0xb')]('zone')||_0x4b426b[_0x21fd('0xb')](_0x21fd('0xd'))||_0x4b426b[_0x21fd('0xb')](_0x21fd('0xe'))||_0x4b426b[_0x21fd('0xb')](_0x21fd('0x19'))||_0x4b426b[_0x21fd('0xb')](_0x21fd('0xf'))||_0x4b426b[_0x21fd('0xb')](_0x21fd('0x10'))){var _0x49cc9c,_0x324fc7;_0x49cc9c=_0x4b426b[_0x21fd('0xd')];var _0xe5242a=_0x49cc9c['slice'](-0x1);if(_0xe5242a==='/'||_0xe5242a==='\x5c'||_0xe5242a===':'){_0x49cc9c=_0x49cc9c[_0x21fd('0x22')](0x0,_0x49cc9c['lastIndexOf'](_0xe5242a));}switch(_0x4b426b['zone']){case'US':_0x324fc7=_0x21fd('0x23');break;case'AU':_0x324fc7=_0x21fd('0x24');break;case'IN':_0x324fc7=_0x21fd('0x13');break;case'CN':_0x324fc7=_0x21fd('0x14');break;default:_0x324fc7='https://accounts.zoho.eu';break;}var _0x4f087f={'method':_0x21fd('0x16'),'uri':_0x324fc7+_0x21fd('0x17'),'form':{'grant_type':_0x21fd('0x18'),'client_id':_0x4b426b[_0x21fd('0xe')],'client_secret':_0x4b426b[_0x21fd('0x19')],'redirect_uri':_0x4b426b[_0x21fd('0xd')],'code':_0x4b426b[_0x21fd('0xf')]},'headers':{'Content-Type':_0x21fd('0x25')}};return rp(_0x4f087f)[_0x21fd('0x26')](function(_0x42e688){var _0x3151cb=JSON['parse'](_0x42e688);if(_0x3151cb[_0x21fd('0x1b')]){_0x4b426b[_0x21fd('0x1c')]=_0x3151cb[_0x21fd('0x1b')];logger['info'](util[_0x21fd('0x1d')](_0x21fd('0x27'),_0x4b426b[_0x21fd('0x1e')],_0x4b426b['id']));}else{logger[_0x21fd('0x1f')](util[_0x21fd('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b426b[_0x21fd('0x1e')],_0x4b426b['id']),util[_0x21fd('0x21')](_0x3151cb,{'showHidden':![],'depth':null}));}return _0x515050(null,_0x3f97ca);})['catch'](function(_0x267ae5){logger[_0x21fd('0x1f')](util[_0x21fd('0x1d')](_0x21fd('0x20'),_0x4b426b['name'],_0x4b426b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x515050(_0x267ae5);});}else{return _0x515050(null,_0x3f97ca);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index facee8f..02b487a 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 _0x6efe=['then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','include','map','model','attributes','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x555ba9,_0x3a210e){var _0xe2fc83=function(_0x20200d){while(--_0x20200d){_0x555ba9['push'](_0x555ba9['shift']());}};_0xe2fc83(++_0x3a210e);}(_0x6efe,0xc6));var _0xe6ef=function(_0x472567,_0x19154e){_0x472567=_0x472567-0x0;var _0xb680e3=_0x6efe[_0x472567];return _0xb680e3;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var moment=require(_0xe6ef('0x2'));var BPromise=require(_0xe6ef('0x3'));var rs=require(_0xe6ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6ef('0x5'));var logger=require(_0xe6ef('0x6'))(_0xe6ef('0x7'));var config=require(_0xe6ef('0x8'));var jayson=require(_0xe6ef('0x9'));var client=jayson['client'][_0xe6ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422e13,_0x599b6c,_0x4a4bb9){return new BPromise(function(_0x51a9eb,_0x3256ff){return client[_0xe6ef('0xb')](_0x422e13,_0x4a4bb9)[_0xe6ef('0xc')](function(_0x4fca2f){logger[_0xe6ef('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x599b6c,_0xe6ef('0xe'));logger[_0xe6ef('0xf')](_0xe6ef('0x10'),_0x599b6c,_0xe6ef('0xe'),JSON[_0xe6ef('0x11')](_0x4fca2f));if(_0x4fca2f[_0xe6ef('0x12')]){if(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x13')]===0x1f4){logger['error'](_0xe6ef('0x14'),_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x3256ff(_0x4fca2f[_0xe6ef('0x12')]['message']);}logger[_0xe6ef('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x51a9eb(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);}else{logger[_0xe6ef('0xd')](_0xe6ef('0x14'),_0x599b6c,_0xe6ef('0xe'));_0x51a9eb(_0x4fca2f[_0xe6ef('0x16')][_0xe6ef('0x15')]);}})[_0xe6ef('0x17')](function(_0x5c32cc){logger[_0xe6ef('0x12')](_0xe6ef('0x14'),_0x599b6c,_0x5c32cc);_0x3256ff(_0x5c32cc);});});}exports[_0xe6ef('0x18')]=function(_0x491c6f){var _0x507186=this;return new Promise(function(_0x3e11ce,_0x4e58d5){return db[_0xe6ef('0x19')]['findAll']({'raw':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1c')]||null:null,'attributes':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')]['attributes']||null:null,'limit':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')]['limit']||null:null,'include':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x491c6f[_0xe6ef('0x1a')]['include'],function(_0xcc677f){return{'model':db[_0xcc677f[_0xe6ef('0x1f')]],'as':_0xcc677f['as'],'attributes':_0xcc677f[_0xe6ef('0x20')],'include':_0xcc677f['include']?_[_0xe6ef('0x1e')](_0xcc677f[_0xe6ef('0x1d')],function(_0x4dfd37){return{'model':db[_0x4dfd37[_0xe6ef('0x1f')]],'as':_0x4dfd37['as'],'attributes':_0x4dfd37[_0xe6ef('0x20')],'include':_0x4dfd37[_0xe6ef('0x1d')]?_['map'](_0x4dfd37[_0xe6ef('0x1d')],function(_0xd9ceb0){return{'model':db[_0xd9ceb0['model']],'as':_0xd9ceb0['as'],'attributes':_0xd9ceb0[_0xe6ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe6ef('0xc')](function(_0xce0b0){logger[_0xe6ef('0xd')](_0xe6ef('0x18'),_0x491c6f);logger['debug'](_0xe6ef('0x18'),_0x491c6f,JSON[_0xe6ef('0x11')](_0xce0b0));_0x3e11ce(_0xce0b0);})[_0xe6ef('0x17')](function(_0x2b840a){logger['error'](_0xe6ef('0x18'),_0x2b840a['message'],_0x491c6f);_0x4e58d5(_0x507186[_0xe6ef('0x12')](0x1f4,_0x2b840a[_0xe6ef('0x15')]));});});};exports[_0xe6ef('0x21')]=function(_0x2bb8ff){var _0xa1f514=this;return new Promise(function(_0x5860f8,_0x2ed679){return db[_0xe6ef('0x19')][_0xe6ef('0x22')]({'raw':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff['options']['where']||null:null,'attributes':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x20')]||null:null,'include':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x2bb8ff['options'][_0xe6ef('0x1d')],function(_0x28b7da){return{'model':db[_0x28b7da[_0xe6ef('0x1f')]],'as':_0x28b7da['as'],'attributes':_0x28b7da['attributes'],'include':_0x28b7da[_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x28b7da['include'],function(_0x2b2828){return{'model':db[_0x2b2828[_0xe6ef('0x1f')]],'as':_0x2b2828['as'],'attributes':_0x2b2828[_0xe6ef('0x20')],'include':_0x2b2828[_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x2b2828['include'],function(_0x10639c){return{'model':db[_0x10639c[_0xe6ef('0x1f')]],'as':_0x10639c['as'],'attributes':_0x10639c[_0xe6ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe6ef('0xc')](function(_0x306b50){logger[_0xe6ef('0xd')]('ShowZohoAccount',_0x2bb8ff);logger[_0xe6ef('0xf')](_0xe6ef('0x21'),_0x2bb8ff,JSON['stringify'](_0x306b50));_0x5860f8(_0x306b50);})[_0xe6ef('0x17')](function(_0x1f703c){logger['error'](_0xe6ef('0x21'),_0x1f703c[_0xe6ef('0x15')],_0x2bb8ff);_0x2ed679(_0xa1f514[_0xe6ef('0x12')](0x1f4,_0x1f703c[_0xe6ef('0x15')]));});});}; \ No newline at end of file +var _0xc2a2=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','stringify','ShowZohoAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x2ea536,_0x4b5e4f){var _0x1db3f5=function(_0x48c612){while(--_0x48c612){_0x2ea536['push'](_0x2ea536['shift']());}};_0x1db3f5(++_0x4b5e4f);}(_0xc2a2,0x84));var _0x2c2a=function(_0x4a2c30,_0x5e7b6e){_0x4a2c30=_0x4a2c30-0x0;var _0x43e855=_0xc2a2[_0x4a2c30];return _0x43e855;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var moment=require(_0x2c2a('0x2'));var BPromise=require(_0x2c2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2a('0x4'));var db=require(_0x2c2a('0x5'))['db'];var utils=require(_0x2c2a('0x6'));var logger=require('../../config/logger')(_0x2c2a('0x7'));var config=require(_0x2c2a('0x8'));var jayson=require(_0x2c2a('0x9'));var client=jayson[_0x2c2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f476,_0x53b0c0,_0x578a80){return new BPromise(function(_0x48a901,_0x5cc8c5){return client['request'](_0x52f476,_0x578a80)[_0x2c2a('0xb')](function(_0x48ba78){logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,_0x2c2a('0xe'));logger[_0x2c2a('0xf')](_0x2c2a('0x10'),_0x53b0c0,_0x2c2a('0xe'),JSON['stringify'](_0x48ba78));if(_0x48ba78['error']){if(_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x12')]===0x1f4){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x13')]);return _0x5cc8c5(_0x48ba78['error'][_0x2c2a('0x13')]);}logger[_0x2c2a('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x53b0c0,_0x48ba78[_0x2c2a('0x11')]['message']);return _0x48a901(_0x48ba78[_0x2c2a('0x11')]['message']);}else{logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,'request\x20sent');_0x48a901(_0x48ba78[_0x2c2a('0x14')][_0x2c2a('0x13')]);}})[_0x2c2a('0x15')](function(_0x7af854){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x7af854);_0x5cc8c5(_0x7af854);});});}exports['GetZohoAccount']=function(_0x53fe55){var _0x4149e2=this;return new Promise(function(_0x4a1382,_0x2a1d63){return db[_0x2c2a('0x16')][_0x2c2a('0x17')]({'raw':_0x53fe55[_0x2c2a('0x18')]?_0x53fe55[_0x2c2a('0x18')][_0x2c2a('0x19')]===undefined?!![]:![]:!![],'where':_0x53fe55[_0x2c2a('0x18')]?_0x53fe55[_0x2c2a('0x18')][_0x2c2a('0x1a')]||null:null,'attributes':_0x53fe55[_0x2c2a('0x18')]?_0x53fe55['options'][_0x2c2a('0x1b')]||null:null,'limit':_0x53fe55['options']?_0x53fe55[_0x2c2a('0x18')][_0x2c2a('0x1c')]||null:null,'include':_0x53fe55['options']?_0x53fe55[_0x2c2a('0x18')][_0x2c2a('0x1d')]?_[_0x2c2a('0x1e')](_0x53fe55['options'][_0x2c2a('0x1d')],function(_0x25788b){return{'model':db[_0x25788b[_0x2c2a('0x1f')]],'as':_0x25788b['as'],'attributes':_0x25788b[_0x2c2a('0x1b')],'include':_0x25788b[_0x2c2a('0x1d')]?_[_0x2c2a('0x1e')](_0x25788b[_0x2c2a('0x1d')],function(_0x459aee){return{'model':db[_0x459aee['model']],'as':_0x459aee['as'],'attributes':_0x459aee['attributes'],'include':_0x459aee['include']?_['map'](_0x459aee[_0x2c2a('0x1d')],function(_0xccbae4){return{'model':db[_0xccbae4[_0x2c2a('0x1f')]],'as':_0xccbae4['as'],'attributes':_0xccbae4[_0x2c2a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2c2a('0xb')](function(_0x43239d){logger['info']('GetZohoAccount',_0x53fe55);logger[_0x2c2a('0xf')](_0x2c2a('0x20'),_0x53fe55,JSON[_0x2c2a('0x21')](_0x43239d));_0x4a1382(_0x43239d);})[_0x2c2a('0x15')](function(_0x5c2fbb){logger[_0x2c2a('0x11')](_0x2c2a('0x20'),_0x5c2fbb[_0x2c2a('0x13')],_0x53fe55);_0x2a1d63(_0x4149e2[_0x2c2a('0x11')](0x1f4,_0x5c2fbb[_0x2c2a('0x13')]));});});};exports[_0x2c2a('0x22')]=function(_0x49e451){var _0x3be2b0=this;return new Promise(function(_0x5059b9,_0x261320){return db[_0x2c2a('0x16')][_0x2c2a('0x23')]({'raw':_0x49e451[_0x2c2a('0x18')]?_0x49e451[_0x2c2a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49e451[_0x2c2a('0x18')]?_0x49e451[_0x2c2a('0x18')][_0x2c2a('0x1a')]||null:null,'attributes':_0x49e451[_0x2c2a('0x18')]?_0x49e451[_0x2c2a('0x18')]['attributes']||null:null,'include':_0x49e451[_0x2c2a('0x18')]?_0x49e451[_0x2c2a('0x18')]['include']?_[_0x2c2a('0x1e')](_0x49e451['options'][_0x2c2a('0x1d')],function(_0xfd262b){return{'model':db[_0xfd262b[_0x2c2a('0x1f')]],'as':_0xfd262b['as'],'attributes':_0xfd262b[_0x2c2a('0x1b')],'include':_0xfd262b[_0x2c2a('0x1d')]?_[_0x2c2a('0x1e')](_0xfd262b[_0x2c2a('0x1d')],function(_0x59f906){return{'model':db[_0x59f906[_0x2c2a('0x1f')]],'as':_0x59f906['as'],'attributes':_0x59f906[_0x2c2a('0x1b')],'include':_0x59f906[_0x2c2a('0x1d')]?_['map'](_0x59f906['include'],function(_0x2c9deb){return{'model':db[_0x2c9deb['model']],'as':_0x2c9deb['as'],'attributes':_0x2c9deb[_0x2c2a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2c2a('0xb')](function(_0x126730){logger[_0x2c2a('0xc')](_0x2c2a('0x22'),_0x49e451);logger['debug'](_0x2c2a('0x22'),_0x49e451,JSON[_0x2c2a('0x21')](_0x126730));_0x5059b9(_0x126730);})[_0x2c2a('0x15')](function(_0x4289b2){logger[_0x2c2a('0x11')](_0x2c2a('0x22'),_0x4289b2[_0x2c2a('0x13')],_0x49e451);_0x261320(_0x3be2b0[_0x2c2a('0x11')](0x1f4,_0x4289b2[_0x2c2a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index fe3acc2..38d0517 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 _0xef49=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4d77c4,_0x52cacd){var _0x55081e=function(_0x3f5913){while(--_0x3f5913){_0x4d77c4['push'](_0x4d77c4['shift']());}};_0x55081e(++_0x52cacd);}(_0xef49,0x15f));var _0x9ef4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xef49[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x9ef4('0x0'));var util=require(_0x9ef4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ef4('0x2'));var router=express[_0x9ef4('0x3')]();var fs_extra=require(_0x9ef4('0x4'));var auth=require(_0x9ef4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ef4('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x9ef4('0x7')]('/',auth[_0x9ef4('0x8')](),controller[_0x9ef4('0x9')]);router[_0x9ef4('0x7')](_0x9ef4('0xa'),auth[_0x9ef4('0x8')](),controller[_0x9ef4('0xb')]);router['get'](_0x9ef4('0xc'),auth[_0x9ef4('0x8')](),controller[_0x9ef4('0xd')]);router[_0x9ef4('0x7')](_0x9ef4('0xe'),auth[_0x9ef4('0x8')](),controller[_0x9ef4('0xf')]);router[_0x9ef4('0x7')](_0x9ef4('0x10'),auth['isAuthenticated'](),controller[_0x9ef4('0x11')]);router[_0x9ef4('0x12')]('/',auth[_0x9ef4('0x8')](),controller[_0x9ef4('0x13')]);router[_0x9ef4('0x14')](_0x9ef4('0xa'),auth['isAuthenticated'](),controller[_0x9ef4('0x15')]);router[_0x9ef4('0x16')]('/:id',auth[_0x9ef4('0x8')](),controller['destroy']);module[_0x9ef4('0x17')]=router; \ No newline at end of file +var _0x2589=['../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path','express','fs-extra'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0x2589,0xac));var _0x9258=function(_0xa9a59d,_0x503b64){_0xa9a59d=_0xa9a59d-0x0;var _0x2885f0=_0x2589[_0xa9a59d];return _0x2885f0;};'use strict';var multer=require(_0x9258('0x0'));var util=require('util');var path=require(_0x9258('0x1'));var timeout=require('connect-timeout');var express=require(_0x9258('0x2'));var router=express['Router']();var fs_extra=require(_0x9258('0x3'));var auth=require(_0x9258('0x4'));var interaction=require(_0x9258('0x5'));var config=require('../../config/environment');var controller=require(_0x9258('0x6'));router[_0x9258('0x7')]('/',auth['isAuthenticated'](),controller[_0x9258('0x8')]);router[_0x9258('0x7')](_0x9258('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9258('0xa'),auth[_0x9258('0xb')](),controller['getFields']);router[_0x9258('0x7')](_0x9258('0xc'),auth[_0x9258('0xb')](),controller[_0x9258('0xd')]);router['get'](_0x9258('0xe'),auth[_0x9258('0xb')](),controller[_0x9258('0xf')]);router[_0x9258('0x10')]('/',auth[_0x9258('0xb')](),controller[_0x9258('0x11')]);router[_0x9258('0x12')]('/:id',auth[_0x9258('0xb')](),controller['update']);router[_0x9258('0x13')](_0x9258('0x9'),auth[_0x9258('0xb')](),controller[_0x9258('0x14')]);module[_0x9258('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 32671b4..da0d352 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 _0xcd88=['ENUM','contact','lead','contact_lead','exports','STRING'];(function(_0x3bc158,_0x436e3a){var _0x977671=function(_0xa675fa){while(--_0xa675fa){_0x3bc158['push'](_0x3bc158['shift']());}};_0x977671(++_0x436e3a);}(_0xcd88,0x8e));var _0x8cd8=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xcd88[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require('sequelize');module[_0x8cd8('0x0')]={'name':{'type':Sequelize[_0x8cd8('0x1')]},'moduleCreate':{'type':Sequelize[_0x8cd8('0x2')]('lead',_0x8cd8('0x3'),'nothing'),'defaultValue':_0x8cd8('0x4')},'moduleSearch':{'type':Sequelize[_0x8cd8('0x2')](_0x8cd8('0x5'),_0x8cd8('0x3'),_0x8cd8('0x4')),'defaultValue':_0x8cd8('0x5')},'description':{'type':Sequelize[_0x8cd8('0x1')]}}; \ No newline at end of file +var _0x6f2b=['contact_lead','lead','STRING','ENUM','contact'];(function(_0x19567e,_0x274d50){var _0x55237e=function(_0x4cfb28){while(--_0x4cfb28){_0x19567e['push'](_0x19567e['shift']());}};_0x55237e(++_0x274d50);}(_0x6f2b,0x1d8));var _0xb6f2=function(_0x189c0b,_0x73a7d4){_0x189c0b=_0x189c0b-0x0;var _0x43e0b3=_0x6f2b[_0x189c0b];return _0x43e0b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb6f2('0x0')]},'moduleCreate':{'type':Sequelize[_0xb6f2('0x1')]('lead',_0xb6f2('0x2'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xb6f2('0x1')](_0xb6f2('0x3'),_0xb6f2('0x2'),_0xb6f2('0x4')),'defaultValue':_0xb6f2('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5c86f12..e66f173 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 _0x8072=['request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','fields','find','create','body','getFields','findOne','keys','order','nolimit','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','fast-json-patch'];(function(_0x3a2d9b,_0x57b377){var _0x43c237=function(_0x3485fa){while(--_0x3485fa){_0x3a2d9b['push'](_0x3a2d9b['shift']());}};_0x43c237(++_0x57b377);}(_0x8072,0x97));var _0x2807=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x8072[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2807('0x0'));var zipdir=require(_0x2807('0x1'));var jsonpatch=require(_0x2807('0x2'));var rp=require(_0x2807('0x3'));var moment=require('moment');var BPromise=require(_0x2807('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2807('0x5'));var sox=require('sox');var csv=require(_0x2807('0x6'));var ejs=require(_0x2807('0x7'));var fs=require('fs');var fs_extra=require(_0x2807('0x8'));var _=require(_0x2807('0x9'));var squel=require(_0x2807('0xa'));var crypto=require(_0x2807('0xb'));var jsforce=require(_0x2807('0xc'));var deskjs=require(_0x2807('0xd'));var toCsv=require(_0x2807('0x6'));var querystring=require(_0x2807('0xe'));var Papa=require(_0x2807('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2807('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2807('0x11'))('api');var utils=require(_0x2807('0x12'));var config=require(_0x2807('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2807('0x14'))['db'];function respondWithStatusCode(_0x2e8976,_0x131a71){_0x131a71=_0x131a71||0xcc;return function(_0x4edeab){if(_0x4edeab){return _0x2e8976[_0x2807('0x15')](_0x131a71);}return _0x2e8976['status'](_0x131a71)[_0x2807('0x16')]();};}function respondWithResult(_0x474f14,_0x5b2991){_0x5b2991=_0x5b2991||0xc8;return function(_0x3799e6){if(_0x3799e6){return _0x474f14[_0x2807('0x17')](_0x5b2991)[_0x2807('0x18')](_0x3799e6);}};}function respondWithFilteredResult(_0x5e1d53,_0x5ccc82){return function(_0x53bcbc){if(_0x53bcbc){var _0x1f0866=typeof _0x5ccc82[_0x2807('0x19')]==='undefined'&&typeof _0x5ccc82[_0x2807('0x1a')]===_0x2807('0x1b');var _0x49c658=_0x53bcbc[_0x2807('0x1c')];var _0x46609d=_0x1f0866?0x0:_0x5ccc82[_0x2807('0x19')];var _0x4d2980=_0x1f0866?_0x53bcbc[_0x2807('0x1c')]:_0x5ccc82[_0x2807('0x19')]+_0x5ccc82[_0x2807('0x1a')];var _0x6a8b;if(_0x4d2980>=_0x49c658){_0x4d2980=_0x49c658;_0x6a8b=0xc8;}else{_0x6a8b=0xce;}_0x5e1d53[_0x2807('0x17')](_0x6a8b);return _0x5e1d53[_0x2807('0x1d')](_0x2807('0x1e'),_0x46609d+'-'+_0x4d2980+'/'+_0x49c658)[_0x2807('0x18')](_0x53bcbc);}return null;};}function patchUpdates(_0x4905b0){return function(_0x29574e){try{jsonpatch[_0x2807('0x1f')](_0x29574e,_0x4905b0,!![]);}catch(_0x3b9a54){return BPromise[_0x2807('0x20')](_0x3b9a54);}return _0x29574e['save']();};}function saveUpdates(_0x48f963,_0x59587e){return function(_0x4e0d11){if(_0x4e0d11){return _0x4e0d11[_0x2807('0x21')](_0x48f963)[_0x2807('0x22')](function(_0x2bd5aa){return _0x2bd5aa;});}return null;};}function removeEntity(_0x9609cb,_0xe2f428){return function(_0x5712cc){if(_0x5712cc){return _0x5712cc[_0x2807('0x23')]()[_0x2807('0x22')](function(){_0x9609cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xda4265,_0x5264f2){return function(_0x51689f){if(!_0x51689f){_0xda4265['sendStatus'](0x194);}return _0x51689f;};}function handleError(_0x791949,_0x10a44d){_0x10a44d=_0x10a44d||0x1f4;return function(_0x531ddd){logger[_0x2807('0x24')](_0x531ddd['stack']);if(_0x531ddd['name']){delete _0x531ddd['name'];}_0x791949[_0x2807('0x17')](_0x10a44d)['send'](_0x531ddd);};}exports[_0x2807('0x25')]=function(_0xdc7a8e,_0x3a3c00){var _0x268daa={},_0x25fc41={},_0x241e19={'count':0x0,'rows':[]};var _0x1a5cfb=_[_0x2807('0x26')](db[_0x2807('0x27')][_0x2807('0x28')],function(_0x3bca5a){return{'name':_0x3bca5a[_0x2807('0x29')],'type':_0x3bca5a[_0x2807('0x2a')][_0x2807('0x2b')]};});_0x25fc41[_0x2807('0x2c')]=_['map'](_0x1a5cfb,'name');_0x25fc41[_0x2807('0x2d')]=_['keys'](_0xdc7a8e[_0x2807('0x2d')]);_0x25fc41[_0x2807('0x2e')]=_['intersection'](_0x25fc41['model'],_0x25fc41[_0x2807('0x2d')]);_0x268daa['attributes']=_[_0x2807('0x2f')](_0x25fc41['model'],qs['fields'](_0xdc7a8e['query']['fields']));_0x268daa[_0x2807('0x30')]=_0x268daa[_0x2807('0x30')][_0x2807('0x31')]?_0x268daa['attributes']:_0x25fc41['model'];if(!_0xdc7a8e['query'][_0x2807('0x32')]('nolimit')){_0x268daa[_0x2807('0x1a')]=qs['limit'](_0xdc7a8e['query'][_0x2807('0x1a')]);_0x268daa[_0x2807('0x19')]=qs[_0x2807('0x19')](_0xdc7a8e['query'][_0x2807('0x19')]);}_0x268daa['order']=qs[_0x2807('0x33')](_0xdc7a8e[_0x2807('0x2d')]['sort']);_0x268daa['where']=qs[_0x2807('0x2e')](_[_0x2807('0x34')](_0xdc7a8e['query'],_0x25fc41[_0x2807('0x2e')]),_0x1a5cfb);if(_0xdc7a8e[_0x2807('0x2d')][_0x2807('0x35')]){_0x268daa[_0x2807('0x36')]=_[_0x2807('0x37')](_0x268daa[_0x2807('0x36')],{'$or':_[_0x2807('0x26')](_0x1a5cfb,function(_0x191595){if(_0x191595[_0x2807('0x2a')]!==_0x2807('0x38')){var _0x4c906e={};_0x4c906e[_0x191595[_0x2807('0x39')]]={'$like':'%'+_0xdc7a8e[_0x2807('0x2d')]['filter']+'%'};return _0x4c906e;}})});}_0x268daa=_[_0x2807('0x37')]({},_0x268daa,_0xdc7a8e[_0x2807('0x3a')]);var _0x21709c={'where':_0x268daa[_0x2807('0x36')]};return db[_0x2807('0x27')][_0x2807('0x1c')](_0x21709c)[_0x2807('0x22')](function(_0x3cabed){_0x241e19[_0x2807('0x1c')]=_0x3cabed;if(_0xdc7a8e['query'][_0x2807('0x3b')]){_0x268daa['include']=[{'all':!![]}];}return db[_0x2807('0x27')][_0x2807('0x3c')](_0x268daa);})[_0x2807('0x22')](function(_0xf7541){_0x241e19[_0x2807('0x3d')]=_0xf7541;return _0x241e19;})[_0x2807('0x22')](respondWithFilteredResult(_0x3a3c00,_0x268daa))[_0x2807('0x3e')](handleError(_0x3a3c00,null));};exports[_0x2807('0x3f')]=function(_0x34df37,_0x28dfb2){var _0x52e259={'raw':![],'where':{'id':_0x34df37[_0x2807('0x40')]['id']}},_0x297145={};_0x297145[_0x2807('0x2c')]=_['keys'](db[_0x2807('0x27')]['rawAttributes']);_0x297145[_0x2807('0x2d')]=_['keys'](_0x34df37[_0x2807('0x2d')]);_0x297145['filters']=_[_0x2807('0x2f')](_0x297145[_0x2807('0x2c')],_0x297145[_0x2807('0x2d')]);_0x52e259[_0x2807('0x30')]=_[_0x2807('0x2f')](_0x297145['model'],qs[_0x2807('0x41')](_0x34df37[_0x2807('0x2d')][_0x2807('0x41')]));_0x52e259[_0x2807('0x30')]=_0x52e259[_0x2807('0x30')][_0x2807('0x31')]?_0x52e259[_0x2807('0x30')]:_0x297145[_0x2807('0x2c')];if(_0x34df37[_0x2807('0x2d')][_0x2807('0x3b')]){_0x52e259['include']=[{'all':!![]}];}_0x52e259=_[_0x2807('0x37')]({},_0x52e259,_0x34df37[_0x2807('0x3a')]);return db['ZohoConfiguration'][_0x2807('0x42')](_0x52e259)[_0x2807('0x22')](handleEntityNotFound(_0x28dfb2,null))[_0x2807('0x22')](respondWithResult(_0x28dfb2,null))[_0x2807('0x3e')](handleError(_0x28dfb2,null));};exports[_0x2807('0x43')]=function(_0x3602ce,_0x3d6ac9){return db[_0x2807('0x27')][_0x2807('0x43')](_0x3602ce[_0x2807('0x44')],{})['then'](respondWithResult(_0x3d6ac9,0xc9))[_0x2807('0x3e')](handleError(_0x3d6ac9,null));};exports[_0x2807('0x21')]=function(_0x280ea4,_0x322715){if(_0x280ea4[_0x2807('0x44')]['id']){delete _0x280ea4[_0x2807('0x44')]['id'];}return db[_0x2807('0x27')]['find']({'where':{'id':_0x280ea4[_0x2807('0x40')]['id']}})['then'](handleEntityNotFound(_0x322715,null))[_0x2807('0x22')](saveUpdates(_0x280ea4['body'],null))[_0x2807('0x22')](respondWithResult(_0x322715,null))['catch'](handleError(_0x322715,null));};exports[_0x2807('0x23')]=function(_0x1d15cf,_0x33d9d7){return db['ZohoConfiguration'][_0x2807('0x42')]({'where':{'id':_0x1d15cf[_0x2807('0x40')]['id']}})[_0x2807('0x22')](handleEntityNotFound(_0x33d9d7,null))[_0x2807('0x22')](removeEntity(_0x33d9d7,null))[_0x2807('0x3e')](handleError(_0x33d9d7,null));};exports[_0x2807('0x45')]=function(_0x3d6626,_0x7c4dc6,_0x3016a1){var _0x578f3c={};var _0x69b665={};var _0x20f5c0;var _0x5c0e5e;return db['ZohoConfiguration'][_0x2807('0x46')]({'where':{'id':_0x3d6626['params']['id']}})[_0x2807('0x22')](handleEntityNotFound(_0x7c4dc6,null))['then'](function(_0x23e435){if(_0x23e435){_0x20f5c0=_0x23e435;_0x69b665[_0x2807('0x2c')]=_['keys'](db['ZohoField'][_0x2807('0x28')]);_0x69b665[_0x2807('0x2d')]=_[_0x2807('0x47')](_0x3d6626[_0x2807('0x2d')]);_0x69b665[_0x2807('0x2e')]=_[_0x2807('0x2f')](_0x69b665[_0x2807('0x2c')],_0x69b665['query']);_0x578f3c[_0x2807('0x30')]=_[_0x2807('0x2f')](_0x69b665[_0x2807('0x2c')],qs['fields'](_0x3d6626[_0x2807('0x2d')][_0x2807('0x41')]));_0x578f3c['attributes']=_0x578f3c[_0x2807('0x30')][_0x2807('0x31')]?_0x578f3c['attributes']:_0x69b665[_0x2807('0x2c')];_0x578f3c[_0x2807('0x48')]=qs['sort'](_0x3d6626[_0x2807('0x2d')][_0x2807('0x33')]);_0x578f3c[_0x2807('0x36')]=qs[_0x2807('0x2e')](_['pick'](_0x3d6626[_0x2807('0x2d')],_0x69b665[_0x2807('0x2e')]));if(_0x3d6626[_0x2807('0x2d')]['filter']){_0x578f3c[_0x2807('0x36')]=_[_0x2807('0x37')](_0x578f3c[_0x2807('0x36')],{'$or':_['map'](_0x578f3c['attributes'],function(_0x4aa09e){var _0x1dab59={};_0x1dab59[_0x4aa09e]={'$like':'%'+_0x3d6626[_0x2807('0x2d')]['filter']+'%'};return _0x1dab59;})});}_0x578f3c=_[_0x2807('0x37')]({},_0x578f3c,_0x3d6626[_0x2807('0x3a')]);return _0x20f5c0[_0x2807('0x45')](_0x578f3c);}})[_0x2807('0x22')](function(_0x56ffa8){if(_0x56ffa8){_0x5c0e5e=_0x56ffa8[_0x2807('0x31')];if(!_0x3d6626[_0x2807('0x2d')][_0x2807('0x32')](_0x2807('0x49'))){_0x578f3c[_0x2807('0x1a')]=qs['limit'](_0x3d6626['query'][_0x2807('0x1a')]);_0x578f3c[_0x2807('0x19')]=qs[_0x2807('0x19')](_0x3d6626[_0x2807('0x2d')]['offset']);}return _0x20f5c0['getFields'](_0x578f3c);}})[_0x2807('0x22')](function(_0x3b6ddf){if(_0x3b6ddf){return _0x3b6ddf?{'count':_0x5c0e5e,'rows':_0x3b6ddf}:null;}})['then'](respondWithResult(_0x7c4dc6,null))[_0x2807('0x3e')](handleError(_0x7c4dc6,null));};exports[_0x2807('0x4a')]=function(_0x165d83,_0x2ce7ea,_0x5c6858){var _0x30252b={};var _0x2b3ac3={};var _0x2f2503;var _0x109f92;return db['ZohoConfiguration'][_0x2807('0x46')]({'where':{'id':_0x165d83['params']['id']}})['then'](handleEntityNotFound(_0x2ce7ea,null))['then'](function(_0x181761){if(_0x181761){_0x2f2503=_0x181761;_0x2b3ac3[_0x2807('0x2c')]=_[_0x2807('0x47')](db[_0x2807('0x4b')]['rawAttributes']);_0x2b3ac3[_0x2807('0x2d')]=_[_0x2807('0x47')](_0x165d83['query']);_0x2b3ac3[_0x2807('0x2e')]=_[_0x2807('0x2f')](_0x2b3ac3[_0x2807('0x2c')],_0x2b3ac3[_0x2807('0x2d')]);_0x30252b['attributes']=_[_0x2807('0x2f')](_0x2b3ac3[_0x2807('0x2c')],qs[_0x2807('0x41')](_0x165d83[_0x2807('0x2d')]['fields']));_0x30252b[_0x2807('0x30')]=_0x30252b[_0x2807('0x30')][_0x2807('0x31')]?_0x30252b['attributes']:_0x2b3ac3[_0x2807('0x2c')];_0x30252b[_0x2807('0x48')]=qs['sort'](_0x165d83[_0x2807('0x2d')][_0x2807('0x33')]);_0x30252b[_0x2807('0x36')]=qs[_0x2807('0x2e')](_[_0x2807('0x34')](_0x165d83[_0x2807('0x2d')],_0x2b3ac3[_0x2807('0x2e')]));if(_0x165d83[_0x2807('0x2d')]['filter']){_0x30252b[_0x2807('0x36')]=_['merge'](_0x30252b[_0x2807('0x36')],{'$or':_[_0x2807('0x26')](_0x30252b[_0x2807('0x30')],function(_0x4be753){var _0x2fce80={};_0x2fce80[_0x4be753]={'$like':'%'+_0x165d83[_0x2807('0x2d')][_0x2807('0x35')]+'%'};return _0x2fce80;})});}_0x30252b=_[_0x2807('0x37')]({},_0x30252b,_0x165d83[_0x2807('0x3a')]);return _0x2f2503[_0x2807('0x4a')](_0x30252b);}})[_0x2807('0x22')](function(_0x13380c){if(_0x13380c){_0x109f92=_0x13380c[_0x2807('0x31')];if(!_0x165d83[_0x2807('0x2d')]['hasOwnProperty']('nolimit')){_0x30252b[_0x2807('0x1a')]=qs[_0x2807('0x1a')](_0x165d83[_0x2807('0x2d')][_0x2807('0x1a')]);_0x30252b['offset']=qs['offset'](_0x165d83[_0x2807('0x2d')][_0x2807('0x19')]);}return _0x2f2503['getSubjects'](_0x30252b);}})[_0x2807('0x22')](function(_0x261aad){if(_0x261aad){return _0x261aad?{'count':_0x109f92,'rows':_0x261aad}:null;}})['then'](respondWithResult(_0x2ce7ea,null))[_0x2807('0x3e')](handleError(_0x2ce7ea,null));};exports[_0x2807('0x4c')]=function(_0xa7b8ab,_0x1c4c4b,_0x7f3c5){var _0x1fd6af={};var _0x5d6dad={};var _0x4a4fa1;var _0x206292;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xa7b8ab[_0x2807('0x40')]['id']}})[_0x2807('0x22')](handleEntityNotFound(_0x1c4c4b,null))['then'](function(_0x358966){if(_0x358966){_0x4a4fa1=_0x358966;_0x5d6dad['model']=_[_0x2807('0x47')](db['ZohoField']['rawAttributes']);_0x5d6dad[_0x2807('0x2d')]=_['keys'](_0xa7b8ab[_0x2807('0x2d')]);_0x5d6dad[_0x2807('0x2e')]=_[_0x2807('0x2f')](_0x5d6dad['model'],_0x5d6dad['query']);_0x1fd6af[_0x2807('0x30')]=_[_0x2807('0x2f')](_0x5d6dad['model'],qs[_0x2807('0x41')](_0xa7b8ab[_0x2807('0x2d')][_0x2807('0x41')]));_0x1fd6af[_0x2807('0x30')]=_0x1fd6af[_0x2807('0x30')][_0x2807('0x31')]?_0x1fd6af[_0x2807('0x30')]:_0x5d6dad['model'];_0x1fd6af[_0x2807('0x48')]=qs[_0x2807('0x33')](_0xa7b8ab['query']['sort']);_0x1fd6af['where']=qs[_0x2807('0x2e')](_[_0x2807('0x34')](_0xa7b8ab[_0x2807('0x2d')],_0x5d6dad['filters']));if(_0xa7b8ab[_0x2807('0x2d')]['filter']){_0x1fd6af[_0x2807('0x36')]=_['merge'](_0x1fd6af[_0x2807('0x36')],{'$or':_['map'](_0x1fd6af[_0x2807('0x30')],function(_0xeaecca){var _0x531663={};_0x531663[_0xeaecca]={'$like':'%'+_0xa7b8ab[_0x2807('0x2d')][_0x2807('0x35')]+'%'};return _0x531663;})});}_0x1fd6af=_[_0x2807('0x37')]({},_0x1fd6af,_0xa7b8ab[_0x2807('0x3a')]);return _0x4a4fa1[_0x2807('0x4c')](_0x1fd6af);}})['then'](function(_0x59d634){if(_0x59d634){_0x206292=_0x59d634[_0x2807('0x31')];if(!_0xa7b8ab[_0x2807('0x2d')]['hasOwnProperty'](_0x2807('0x49'))){_0x1fd6af['limit']=qs[_0x2807('0x1a')](_0xa7b8ab[_0x2807('0x2d')][_0x2807('0x1a')]);_0x1fd6af['offset']=qs[_0x2807('0x19')](_0xa7b8ab[_0x2807('0x2d')][_0x2807('0x19')]);}return _0x4a4fa1[_0x2807('0x4c')](_0x1fd6af);}})[_0x2807('0x22')](function(_0x2af18c){if(_0x2af18c){return _0x2af18c?{'count':_0x206292,'rows':_0x2af18c}:null;}})[_0x2807('0x22')](respondWithResult(_0x1c4c4b,null))[_0x2807('0x3e')](handleError(_0x1c4c4b,null));}; \ No newline at end of file +var _0x77c4=['fieldName','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','nolimit','getFields','getSubjects','findOne','ZohoField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','send','map','ZohoConfiguration','rawAttributes'];(function(_0x267be6,_0x121425){var _0x1ce0cb=function(_0x3d3078){while(--_0x3d3078){_0x267be6['push'](_0x267be6['shift']());}};_0x1ce0cb(++_0x121425);}(_0x77c4,0xc5));var _0x477c=function(_0x61403b,_0x32f9f5){_0x61403b=_0x61403b-0x0;var _0x52267c=_0x77c4[_0x61403b];return _0x52267c;};'use strict';var emlformat=require(_0x477c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x477c('0x1'));var jsonpatch=require(_0x477c('0x2'));var rp=require(_0x477c('0x3'));var moment=require(_0x477c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x477c('0x5'));var path=require('path');var sox=require(_0x477c('0x6'));var csv=require(_0x477c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x477c('0x8'));var _=require(_0x477c('0x9'));var squel=require(_0x477c('0xa'));var crypto=require(_0x477c('0xb'));var jsforce=require(_0x477c('0xc'));var deskjs=require(_0x477c('0xd'));var toCsv=require(_0x477c('0x7'));var querystring=require(_0x477c('0xe'));var Papa=require('papaparse');var Redis=require(_0x477c('0xf'));var authService=require(_0x477c('0x10'));var qs=require(_0x477c('0x11'));var as=require(_0x477c('0x12'));var hardwareService=require(_0x477c('0x13'));var logger=require(_0x477c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x477c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x460d13,_0x466f45){_0x466f45=_0x466f45||0xcc;return function(_0x517c77){if(_0x517c77){return _0x460d13['sendStatus'](_0x466f45);}return _0x460d13[_0x477c('0x16')](_0x466f45)['end']();};}function respondWithResult(_0x12de20,_0x445fdd){_0x445fdd=_0x445fdd||0xc8;return function(_0x33fa72){if(_0x33fa72){return _0x12de20[_0x477c('0x16')](_0x445fdd)[_0x477c('0x17')](_0x33fa72);}};}function respondWithFilteredResult(_0x245caa,_0x29f781){return function(_0x39b601){if(_0x39b601){var _0x22d69d=typeof _0x29f781[_0x477c('0x18')]===_0x477c('0x19')&&typeof _0x29f781[_0x477c('0x1a')]===_0x477c('0x19');var _0x289e68=_0x39b601[_0x477c('0x1b')];var _0x5d5a6d=_0x22d69d?0x0:_0x29f781[_0x477c('0x18')];var _0x182100=_0x22d69d?_0x39b601['count']:_0x29f781[_0x477c('0x18')]+_0x29f781[_0x477c('0x1a')];var _0x2ef9d5;if(_0x182100>=_0x289e68){_0x182100=_0x289e68;_0x2ef9d5=0xc8;}else{_0x2ef9d5=0xce;}_0x245caa[_0x477c('0x16')](_0x2ef9d5);return _0x245caa[_0x477c('0x1c')](_0x477c('0x1d'),_0x5d5a6d+'-'+_0x182100+'/'+_0x289e68)['json'](_0x39b601);}return null;};}function patchUpdates(_0x13dcd0){return function(_0x50258a){try{jsonpatch[_0x477c('0x1e')](_0x50258a,_0x13dcd0,!![]);}catch(_0x4b7841){return BPromise['reject'](_0x4b7841);}return _0x50258a[_0x477c('0x1f')]();};}function saveUpdates(_0x1da055,_0x2f0c61){return function(_0x1d94e3){if(_0x1d94e3){return _0x1d94e3[_0x477c('0x20')](_0x1da055)[_0x477c('0x21')](function(_0x3756bb){return _0x3756bb;});}return null;};}function removeEntity(_0x48dc76,_0x388195){return function(_0x37c840){if(_0x37c840){return _0x37c840[_0x477c('0x22')]()[_0x477c('0x21')](function(){_0x48dc76['status'](0xcc)[_0x477c('0x23')]();});}};}function handleEntityNotFound(_0x4b5e04,_0x26b535){return function(_0x5decb9){if(!_0x5decb9){_0x4b5e04[_0x477c('0x24')](0x194);}return _0x5decb9;};}function handleError(_0x3855ba,_0x5f0b97){_0x5f0b97=_0x5f0b97||0x1f4;return function(_0x47245a){logger[_0x477c('0x25')](_0x47245a[_0x477c('0x26')]);if(_0x47245a['name']){delete _0x47245a['name'];}_0x3855ba['status'](_0x5f0b97)[_0x477c('0x27')](_0x47245a);};}exports['index']=function(_0x220e8e,_0x371745){var _0x355c1b={},_0x35ed61={},_0x46f42d={'count':0x0,'rows':[]};var _0x195906=_[_0x477c('0x28')](db[_0x477c('0x29')][_0x477c('0x2a')],function(_0x1d9eeb){return{'name':_0x1d9eeb[_0x477c('0x2b')],'type':_0x1d9eeb['type'][_0x477c('0x2c')]};});_0x35ed61[_0x477c('0x2d')]=_[_0x477c('0x28')](_0x195906,_0x477c('0x2e'));_0x35ed61[_0x477c('0x2f')]=_[_0x477c('0x30')](_0x220e8e[_0x477c('0x2f')]);_0x35ed61['filters']=_['intersection'](_0x35ed61[_0x477c('0x2d')],_0x35ed61[_0x477c('0x2f')]);_0x355c1b[_0x477c('0x31')]=_[_0x477c('0x32')](_0x35ed61[_0x477c('0x2d')],qs[_0x477c('0x33')](_0x220e8e['query'][_0x477c('0x33')]));_0x355c1b[_0x477c('0x31')]=_0x355c1b[_0x477c('0x31')][_0x477c('0x34')]?_0x355c1b[_0x477c('0x31')]:_0x35ed61[_0x477c('0x2d')];if(!_0x220e8e[_0x477c('0x2f')][_0x477c('0x35')]('nolimit')){_0x355c1b['limit']=qs[_0x477c('0x1a')](_0x220e8e[_0x477c('0x2f')][_0x477c('0x1a')]);_0x355c1b[_0x477c('0x18')]=qs[_0x477c('0x18')](_0x220e8e[_0x477c('0x2f')][_0x477c('0x18')]);}_0x355c1b[_0x477c('0x36')]=qs[_0x477c('0x37')](_0x220e8e[_0x477c('0x2f')][_0x477c('0x37')]);_0x355c1b[_0x477c('0x38')]=qs['filters'](_[_0x477c('0x39')](_0x220e8e[_0x477c('0x2f')],_0x35ed61[_0x477c('0x3a')]),_0x195906);if(_0x220e8e[_0x477c('0x2f')]['filter']){_0x355c1b['where']=_[_0x477c('0x3b')](_0x355c1b[_0x477c('0x38')],{'$or':_[_0x477c('0x28')](_0x195906,function(_0x18cb26){if(_0x18cb26[_0x477c('0x3c')]!==_0x477c('0x3d')){var _0x4fc1cd={};_0x4fc1cd[_0x18cb26[_0x477c('0x2e')]]={'$like':'%'+_0x220e8e[_0x477c('0x2f')][_0x477c('0x3e')]+'%'};return _0x4fc1cd;}})});}_0x355c1b=_['merge']({},_0x355c1b,_0x220e8e['options']);var _0x1eadbc={'where':_0x355c1b[_0x477c('0x38')]};return db[_0x477c('0x29')]['count'](_0x1eadbc)[_0x477c('0x21')](function(_0x52010c){_0x46f42d[_0x477c('0x1b')]=_0x52010c;if(_0x220e8e[_0x477c('0x2f')][_0x477c('0x3f')]){_0x355c1b[_0x477c('0x40')]=[{'all':!![]}];}return db[_0x477c('0x29')][_0x477c('0x41')](_0x355c1b);})[_0x477c('0x21')](function(_0x4a7254){_0x46f42d[_0x477c('0x42')]=_0x4a7254;return _0x46f42d;})[_0x477c('0x21')](respondWithFilteredResult(_0x371745,_0x355c1b))[_0x477c('0x43')](handleError(_0x371745,null));};exports[_0x477c('0x44')]=function(_0x92d91e,_0x1d6e94){var _0x2238bb={'raw':![],'where':{'id':_0x92d91e[_0x477c('0x45')]['id']}},_0xb7edd6={};_0xb7edd6[_0x477c('0x2d')]=_[_0x477c('0x30')](db[_0x477c('0x29')][_0x477c('0x2a')]);_0xb7edd6[_0x477c('0x2f')]=_[_0x477c('0x30')](_0x92d91e[_0x477c('0x2f')]);_0xb7edd6[_0x477c('0x3a')]=_['intersection'](_0xb7edd6[_0x477c('0x2d')],_0xb7edd6[_0x477c('0x2f')]);_0x2238bb[_0x477c('0x31')]=_[_0x477c('0x32')](_0xb7edd6[_0x477c('0x2d')],qs['fields'](_0x92d91e['query'][_0x477c('0x33')]));_0x2238bb['attributes']=_0x2238bb[_0x477c('0x31')][_0x477c('0x34')]?_0x2238bb['attributes']:_0xb7edd6[_0x477c('0x2d')];if(_0x92d91e[_0x477c('0x2f')][_0x477c('0x3f')]){_0x2238bb[_0x477c('0x40')]=[{'all':!![]}];}_0x2238bb=_['merge']({},_0x2238bb,_0x92d91e[_0x477c('0x46')]);return db[_0x477c('0x29')][_0x477c('0x47')](_0x2238bb)[_0x477c('0x21')](handleEntityNotFound(_0x1d6e94,null))['then'](respondWithResult(_0x1d6e94,null))[_0x477c('0x43')](handleError(_0x1d6e94,null));};exports[_0x477c('0x48')]=function(_0x9bdf97,_0x3ac91e){return db['ZohoConfiguration'][_0x477c('0x48')](_0x9bdf97[_0x477c('0x49')],{})[_0x477c('0x21')](respondWithResult(_0x3ac91e,0xc9))['catch'](handleError(_0x3ac91e,null));};exports[_0x477c('0x20')]=function(_0x3f385a,_0x3ff903){if(_0x3f385a['body']['id']){delete _0x3f385a['body']['id'];}return db[_0x477c('0x29')][_0x477c('0x47')]({'where':{'id':_0x3f385a['params']['id']}})[_0x477c('0x21')](handleEntityNotFound(_0x3ff903,null))['then'](saveUpdates(_0x3f385a[_0x477c('0x49')],null))[_0x477c('0x21')](respondWithResult(_0x3ff903,null))[_0x477c('0x43')](handleError(_0x3ff903,null));};exports['destroy']=function(_0x1961b6,_0x16aade){return db[_0x477c('0x29')][_0x477c('0x47')]({'where':{'id':_0x1961b6[_0x477c('0x45')]['id']}})['then'](handleEntityNotFound(_0x16aade,null))['then'](removeEntity(_0x16aade,null))[_0x477c('0x43')](handleError(_0x16aade,null));};exports['getFields']=function(_0x5b1b1c,_0x373647,_0x3c9bd6){var _0x1c6d1a={};var _0x2b084e={};var _0x43f1ec;var _0x222bb8;return db[_0x477c('0x29')]['findOne']({'where':{'id':_0x5b1b1c[_0x477c('0x45')]['id']}})[_0x477c('0x21')](handleEntityNotFound(_0x373647,null))[_0x477c('0x21')](function(_0x24210e){if(_0x24210e){_0x43f1ec=_0x24210e;_0x2b084e[_0x477c('0x2d')]=_['keys'](db['ZohoField'][_0x477c('0x2a')]);_0x2b084e[_0x477c('0x2f')]=_['keys'](_0x5b1b1c['query']);_0x2b084e['filters']=_[_0x477c('0x32')](_0x2b084e[_0x477c('0x2d')],_0x2b084e[_0x477c('0x2f')]);_0x1c6d1a[_0x477c('0x31')]=_[_0x477c('0x32')](_0x2b084e[_0x477c('0x2d')],qs[_0x477c('0x33')](_0x5b1b1c['query'][_0x477c('0x33')]));_0x1c6d1a[_0x477c('0x31')]=_0x1c6d1a[_0x477c('0x31')]['length']?_0x1c6d1a[_0x477c('0x31')]:_0x2b084e[_0x477c('0x2d')];_0x1c6d1a[_0x477c('0x36')]=qs['sort'](_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x37')]);_0x1c6d1a['where']=qs[_0x477c('0x3a')](_[_0x477c('0x39')](_0x5b1b1c[_0x477c('0x2f')],_0x2b084e[_0x477c('0x3a')]));if(_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x3e')]){_0x1c6d1a[_0x477c('0x38')]=_[_0x477c('0x3b')](_0x1c6d1a[_0x477c('0x38')],{'$or':_[_0x477c('0x28')](_0x1c6d1a[_0x477c('0x31')],function(_0x476355){var _0x1b078c={};_0x1b078c[_0x476355]={'$like':'%'+_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x3e')]+'%'};return _0x1b078c;})});}_0x1c6d1a=_['merge']({},_0x1c6d1a,_0x5b1b1c[_0x477c('0x46')]);return _0x43f1ec['getFields'](_0x1c6d1a);}})['then'](function(_0x5d845e){if(_0x5d845e){_0x222bb8=_0x5d845e[_0x477c('0x34')];if(!_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x35')](_0x477c('0x4a'))){_0x1c6d1a[_0x477c('0x1a')]=qs[_0x477c('0x1a')](_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x1a')]);_0x1c6d1a[_0x477c('0x18')]=qs[_0x477c('0x18')](_0x5b1b1c[_0x477c('0x2f')][_0x477c('0x18')]);}return _0x43f1ec[_0x477c('0x4b')](_0x1c6d1a);}})[_0x477c('0x21')](function(_0x373a54){if(_0x373a54){return _0x373a54?{'count':_0x222bb8,'rows':_0x373a54}:null;}})['then'](respondWithResult(_0x373647,null))['catch'](handleError(_0x373647,null));};exports[_0x477c('0x4c')]=function(_0x107214,_0x343bf4,_0x5b5e93){var _0x4803b6={};var _0x28c774={};var _0x5cfec1;var _0x343bba;return db[_0x477c('0x29')][_0x477c('0x4d')]({'where':{'id':_0x107214[_0x477c('0x45')]['id']}})['then'](handleEntityNotFound(_0x343bf4,null))[_0x477c('0x21')](function(_0xcac052){if(_0xcac052){_0x5cfec1=_0xcac052;_0x28c774[_0x477c('0x2d')]=_[_0x477c('0x30')](db[_0x477c('0x4e')][_0x477c('0x2a')]);_0x28c774['query']=_[_0x477c('0x30')](_0x107214[_0x477c('0x2f')]);_0x28c774[_0x477c('0x3a')]=_[_0x477c('0x32')](_0x28c774['model'],_0x28c774[_0x477c('0x2f')]);_0x4803b6[_0x477c('0x31')]=_[_0x477c('0x32')](_0x28c774[_0x477c('0x2d')],qs['fields'](_0x107214[_0x477c('0x2f')][_0x477c('0x33')]));_0x4803b6[_0x477c('0x31')]=_0x4803b6[_0x477c('0x31')][_0x477c('0x34')]?_0x4803b6[_0x477c('0x31')]:_0x28c774[_0x477c('0x2d')];_0x4803b6['order']=qs[_0x477c('0x37')](_0x107214[_0x477c('0x2f')][_0x477c('0x37')]);_0x4803b6[_0x477c('0x38')]=qs[_0x477c('0x3a')](_[_0x477c('0x39')](_0x107214[_0x477c('0x2f')],_0x28c774[_0x477c('0x3a')]));if(_0x107214[_0x477c('0x2f')][_0x477c('0x3e')]){_0x4803b6[_0x477c('0x38')]=_['merge'](_0x4803b6[_0x477c('0x38')],{'$or':_[_0x477c('0x28')](_0x4803b6[_0x477c('0x31')],function(_0x5e5ad4){var _0x30d4b3={};_0x30d4b3[_0x5e5ad4]={'$like':'%'+_0x107214['query'][_0x477c('0x3e')]+'%'};return _0x30d4b3;})});}_0x4803b6=_[_0x477c('0x3b')]({},_0x4803b6,_0x107214[_0x477c('0x46')]);return _0x5cfec1[_0x477c('0x4c')](_0x4803b6);}})[_0x477c('0x21')](function(_0x43588a){if(_0x43588a){_0x343bba=_0x43588a[_0x477c('0x34')];if(!_0x107214['query']['hasOwnProperty'](_0x477c('0x4a'))){_0x4803b6[_0x477c('0x1a')]=qs[_0x477c('0x1a')](_0x107214[_0x477c('0x2f')]['limit']);_0x4803b6['offset']=qs[_0x477c('0x18')](_0x107214[_0x477c('0x2f')][_0x477c('0x18')]);}return _0x5cfec1[_0x477c('0x4c')](_0x4803b6);}})[_0x477c('0x21')](function(_0x271b62){if(_0x271b62){return _0x271b62?{'count':_0x343bba,'rows':_0x271b62}:null;}})[_0x477c('0x21')](respondWithResult(_0x343bf4,null))[_0x477c('0x43')](handleError(_0x343bf4,null));};exports[_0x477c('0x4f')]=function(_0x3e9ceb,_0x34d758,_0xa38d6d){var _0x580059={};var _0x4af25d={};var _0x5e3f4e;var _0x377aa0;return db[_0x477c('0x29')]['findOne']({'where':{'id':_0x3e9ceb[_0x477c('0x45')]['id']}})[_0x477c('0x21')](handleEntityNotFound(_0x34d758,null))[_0x477c('0x21')](function(_0x2fec4f){if(_0x2fec4f){_0x5e3f4e=_0x2fec4f;_0x4af25d[_0x477c('0x2d')]=_[_0x477c('0x30')](db[_0x477c('0x4e')][_0x477c('0x2a')]);_0x4af25d['query']=_[_0x477c('0x30')](_0x3e9ceb[_0x477c('0x2f')]);_0x4af25d[_0x477c('0x3a')]=_[_0x477c('0x32')](_0x4af25d['model'],_0x4af25d[_0x477c('0x2f')]);_0x580059['attributes']=_[_0x477c('0x32')](_0x4af25d[_0x477c('0x2d')],qs['fields'](_0x3e9ceb[_0x477c('0x2f')][_0x477c('0x33')]));_0x580059[_0x477c('0x31')]=_0x580059['attributes'][_0x477c('0x34')]?_0x580059['attributes']:_0x4af25d[_0x477c('0x2d')];_0x580059[_0x477c('0x36')]=qs[_0x477c('0x37')](_0x3e9ceb['query'][_0x477c('0x37')]);_0x580059[_0x477c('0x38')]=qs[_0x477c('0x3a')](_[_0x477c('0x39')](_0x3e9ceb[_0x477c('0x2f')],_0x4af25d[_0x477c('0x3a')]));if(_0x3e9ceb[_0x477c('0x2f')][_0x477c('0x3e')]){_0x580059[_0x477c('0x38')]=_[_0x477c('0x3b')](_0x580059[_0x477c('0x38')],{'$or':_['map'](_0x580059[_0x477c('0x31')],function(_0x404303){var _0x1a525={};_0x1a525[_0x404303]={'$like':'%'+_0x3e9ceb[_0x477c('0x2f')]['filter']+'%'};return _0x1a525;})});}_0x580059=_[_0x477c('0x3b')]({},_0x580059,_0x3e9ceb[_0x477c('0x46')]);return _0x5e3f4e[_0x477c('0x4f')](_0x580059);}})[_0x477c('0x21')](function(_0x4ff9a4){if(_0x4ff9a4){_0x377aa0=_0x4ff9a4[_0x477c('0x34')];if(!_0x3e9ceb[_0x477c('0x2f')][_0x477c('0x35')]('nolimit')){_0x580059['limit']=qs[_0x477c('0x1a')](_0x3e9ceb[_0x477c('0x2f')]['limit']);_0x580059['offset']=qs['offset'](_0x3e9ceb[_0x477c('0x2f')][_0x477c('0x18')]);}return _0x5e3f4e[_0x477c('0x4f')](_0x580059);}})[_0x477c('0x21')](function(_0x471efa){if(_0x471efa){return _0x471efa?{'count':_0x377aa0,'rows':_0x471efa}:null;}})[_0x477c('0x21')](respondWithResult(_0x34d758,null))[_0x477c('0x43')](handleError(_0x34d758,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index be4400e..a0d2eb5 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 _0xeec4=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x39a61f,_0x561880){var _0x11f1de=function(_0x5ab766){while(--_0x5ab766){_0x39a61f['push'](_0x39a61f['shift']());}};_0x11f1de(++_0x561880);}(_0xeec4,0x1c9));var _0x4eec=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xeec4[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x4eec('0x0'));var util=require(_0x4eec('0x1'));var logger=require(_0x4eec('0x2'))(_0x4eec('0x3'));var moment=require(_0x4eec('0x4'));var BPromise=require(_0x4eec('0x5'));var rp=require(_0x4eec('0x6'));var fs=require('fs');var path=require(_0x4eec('0x7'));var rimraf=require(_0x4eec('0x8'));var config=require(_0x4eec('0x9'));var attributes=require(_0x4eec('0xa'));module[_0x4eec('0xb')]=function(_0x3247cd,_0x103c20){return _0x3247cd[_0x4eec('0xc')](_0x4eec('0xd'),attributes,{'tableName':_0x4eec('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8eb=['bluebird','request-promise','../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xb8eb,0x196));var _0xbb8e=function(_0x52a059,_0x41d411){_0x52a059=_0x52a059-0x0;var _0x3a90f5=_0xb8eb[_0x52a059];return _0x3a90f5;};'use strict';var _=require(_0xbb8e('0x0'));var util=require(_0xbb8e('0x1'));var logger=require('../../config/logger')(_0xbb8e('0x2'));var moment=require(_0xbb8e('0x3'));var BPromise=require(_0xbb8e('0x4'));var rp=require(_0xbb8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb8e('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0xbb8e('0x7')]=function(_0xe3d6d1,_0x41bd3d){return _0xe3d6d1['define'](_0xbb8e('0x8'),attributes,{'tableName':_0xbb8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index d00e9b5..15feb80 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 _0xf709=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0xf709,0x7b));var _0x9f70=function(_0x2fa30e,_0x49d40a){_0x2fa30e=_0x2fa30e-0x0;var _0x2c6efa=_0xf709[_0x2fa30e];return _0x2c6efa;};'use strict';var _=require(_0x9f70('0x0'));var util=require(_0x9f70('0x1'));var moment=require(_0x9f70('0x2'));var BPromise=require(_0x9f70('0x3'));var rs=require(_0x9f70('0x4'));var fs=require('fs');var Redis=require(_0x9f70('0x5'));var db=require(_0x9f70('0x6'))['db'];var utils=require(_0x9f70('0x7'));var logger=require(_0x9f70('0x8'))(_0x9f70('0x9'));var config=require(_0x9f70('0xa'));var jayson=require(_0x9f70('0xb'));var client=jayson[_0x9f70('0xc')][_0x9f70('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x34fa92,_0x3ffe38,_0x10538c){return new BPromise(function(_0x837672,_0x37088b){return client['request'](_0x34fa92,_0x10538c)['then'](function(_0x5103ba){logger[_0x9f70('0xe')](_0x9f70('0xf'),_0x3ffe38,'request\x20sent');logger[_0x9f70('0x10')](_0x9f70('0x11'),_0x3ffe38,_0x9f70('0x12'),JSON[_0x9f70('0x13')](_0x5103ba));if(_0x5103ba[_0x9f70('0x14')]){if(_0x5103ba['error']['code']===0x1f4){logger[_0x9f70('0x14')](_0x9f70('0xf'),_0x3ffe38,_0x5103ba[_0x9f70('0x14')][_0x9f70('0x15')]);return _0x37088b(_0x5103ba[_0x9f70('0x14')][_0x9f70('0x15')]);}logger[_0x9f70('0x14')](_0x9f70('0xf'),_0x3ffe38,_0x5103ba[_0x9f70('0x14')][_0x9f70('0x15')]);return _0x837672(_0x5103ba['error'][_0x9f70('0x15')]);}else{logger[_0x9f70('0xe')](_0x9f70('0xf'),_0x3ffe38,_0x9f70('0x12'));_0x837672(_0x5103ba[_0x9f70('0x16')][_0x9f70('0x15')]);}})[_0x9f70('0x17')](function(_0xfc6888){logger[_0x9f70('0x14')](_0x9f70('0xf'),_0x3ffe38,_0xfc6888);_0x37088b(_0xfc6888);});});} \ No newline at end of file +var _0xfd2b=['result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xfb0f6d,_0x232cf2){var _0x477197=function(_0x252e05){while(--_0x252e05){_0xfb0f6d['push'](_0xfb0f6d['shift']());}};_0x477197(++_0x232cf2);}(_0xfd2b,0x10c));var _0xbfd2=function(_0x28f195,_0x578277){_0x28f195=_0x28f195-0x0;var _0x3d8127=_0xfd2b[_0x28f195];return _0x3d8127;};'use strict';var _=require('lodash');var util=require(_0xbfd2('0x0'));var moment=require(_0xbfd2('0x1'));var BPromise=require(_0xbfd2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfd2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfd2('0x4'));var logger=require(_0xbfd2('0x5'))(_0xbfd2('0x6'));var config=require('../../config/environment');var jayson=require(_0xbfd2('0x7'));var client=jayson[_0xbfd2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x121626,_0x242604,_0x356e54){return new BPromise(function(_0x3e1389,_0x10cea5){return client['request'](_0x121626,_0x356e54)['then'](function(_0x88b432){logger[_0xbfd2('0x9')](_0xbfd2('0xa'),_0x242604,_0xbfd2('0xb'));logger[_0xbfd2('0xc')](_0xbfd2('0xd'),_0x242604,_0xbfd2('0xb'),JSON['stringify'](_0x88b432));if(_0x88b432['error']){if(_0x88b432[_0xbfd2('0xe')][_0xbfd2('0xf')]===0x1f4){logger[_0xbfd2('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x242604,_0x88b432[_0xbfd2('0xe')][_0xbfd2('0x10')]);return _0x10cea5(_0x88b432[_0xbfd2('0xe')][_0xbfd2('0x10')]);}logger['error'](_0xbfd2('0xa'),_0x242604,_0x88b432['error'][_0xbfd2('0x10')]);return _0x3e1389(_0x88b432[_0xbfd2('0xe')][_0xbfd2('0x10')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x242604,'request\x20sent');_0x3e1389(_0x88b432[_0xbfd2('0x11')][_0xbfd2('0x10')]);}})[_0xbfd2('0x12')](function(_0x6c6ff2){logger[_0xbfd2('0xe')](_0xbfd2('0xa'),_0x242604,_0x6c6ff2);_0x10cea5(_0x6c6ff2);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a4cefdb..20ddb3d 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 _0xc0d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x533512,_0x23758e){var _0x5f56f2=function(_0xab23b5){while(--_0xab23b5){_0x533512['push'](_0x533512['shift']());}};_0x5f56f2(++_0x23758e);}(_0xc0d4,0xa6));var _0x4c0d=function(_0x5e3191,_0x47fe85){_0x5e3191=_0x5e3191-0x0;var _0xc8d5e6=_0xc0d4[_0x5e3191];return _0xc8d5e6;};'use strict';var multer=require(_0x4c0d('0x0'));var util=require(_0x4c0d('0x1'));var path=require('path');var timeout=require(_0x4c0d('0x2'));var express=require('express');var router=express[_0x4c0d('0x3')]();var fs_extra=require(_0x4c0d('0x4'));var auth=require(_0x4c0d('0x5'));var interaction=require(_0x4c0d('0x6'));var config=require(_0x4c0d('0x7'));var controller=require(_0x4c0d('0x8'));router[_0x4c0d('0x9')]('/',auth['isAuthenticated'](),controller[_0x4c0d('0xa')]);router['get']('/:id',auth[_0x4c0d('0xb')](),controller[_0x4c0d('0xc')]);router[_0x4c0d('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c0d('0xe')]);router[_0x4c0d('0xf')](_0x4c0d('0x10'),auth[_0x4c0d('0xb')](),controller['update']);router[_0x4c0d('0x11')](_0x4c0d('0x10'),auth['isAuthenticated'](),controller[_0x4c0d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa6ca=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x29b84a,_0x11c563){var _0x4ad70b=function(_0x2329ac){while(--_0x2329ac){_0x29b84a['push'](_0x29b84a['shift']());}};_0x4ad70b(++_0x11c563);}(_0xa6ca,0x94));var _0xaa6c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa6ca[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0xaa6c('0x0'));var util=require(_0xaa6c('0x1'));var path=require('path');var timeout=require(_0xaa6c('0x2'));var express=require(_0xaa6c('0x3'));var router=express[_0xaa6c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa6c('0x5'));var interaction=require(_0xaa6c('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xaa6c('0x7')]('/',auth[_0xaa6c('0x8')](),controller[_0xaa6c('0x9')]);router[_0xaa6c('0x7')](_0xaa6c('0xa'),auth[_0xaa6c('0x8')](),controller[_0xaa6c('0xb')]);router[_0xaa6c('0xc')]('/',auth['isAuthenticated'](),controller[_0xaa6c('0xd')]);router[_0xaa6c('0xe')]('/:id',auth[_0xaa6c('0x8')](),controller[_0xaa6c('0xf')]);router[_0xaa6c('0x10')](_0xaa6c('0xa'),auth[_0xaa6c('0x8')](),controller[_0xaa6c('0x11')]);module[_0xaa6c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index c5f7cf6..e512eb4 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 _0x38cc=['BOOLEAN','sequelize','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0x464b90,_0x55bffd){var _0x29dbbf=function(_0x270e0d){while(--_0x270e0d){_0x464b90['push'](_0x464b90['shift']());}};_0x29dbbf(++_0x55bffd);}(_0x38cc,0x121));var _0xc38c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38cc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc38c('0x0'));module['exports']={'type':{'type':Sequelize[_0xc38c('0x1')](_0xc38c('0x2'),'variable','customVariable',_0xc38c('0x3'),_0xc38c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc38c('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xc38c('0x2'),_0xc38c('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xc38c('0x5')]},'idField':{'type':Sequelize[_0xc38c('0x5')]},'nameField':{'type':Sequelize[_0xc38c('0x5')]},'customField':{'type':Sequelize[_0xc38c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc38c('0x5')]}}; \ No newline at end of file +var _0x62f8=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5cceb8,_0xa8e57a){var _0xeaf4be=function(_0x154250){while(--_0x154250){_0x5cceb8['push'](_0x5cceb8['shift']());}};_0xeaf4be(++_0xa8e57a);}(_0x62f8,0x1da));var _0x862f=function(_0x3ac3eb,_0xdbf466){_0x3ac3eb=_0x3ac3eb-0x0;var _0x59e461=_0x62f8[_0x3ac3eb];return _0x59e461;};'use strict';var Sequelize=require(_0x862f('0x0'));module[_0x862f('0x1')]={'type':{'type':Sequelize[_0x862f('0x2')](_0x862f('0x3'),_0x862f('0x4'),_0x862f('0x5'),_0x862f('0x6'),_0x862f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x862f('0x8')]},'keyType':{'type':Sequelize[_0x862f('0x2')](_0x862f('0x3'),_0x862f('0x4'),_0x862f('0x5'))},'keyContent':{'type':Sequelize[_0x862f('0x8')]},'idField':{'type':Sequelize[_0x862f('0x8')]},'nameField':{'type':Sequelize[_0x862f('0x8')]},'customField':{'type':Sequelize[_0x862f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x862f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 24b05fa..791c8d9 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 _0x0dfa=['util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','map','query','keys','filters','model','attributes','intersection','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','fields','merge','find','catch','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3125a3,_0x3e1eea){var _0xa6b2cf=function(_0x3dbcd3){while(--_0x3dbcd3){_0x3125a3['push'](_0x3125a3['shift']());}};_0xa6b2cf(++_0x3e1eea);}(_0x0dfa,0x170));var _0xa0df=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0dfa[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xa0df('0x0'));var rimraf=require(_0xa0df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0df('0x2'));var rp=require(_0xa0df('0x3'));var moment=require(_0xa0df('0x4'));var BPromise=require(_0xa0df('0x5'));var Mustache=require(_0xa0df('0x6'));var util=require(_0xa0df('0x7'));var path=require(_0xa0df('0x8'));var sox=require(_0xa0df('0x9'));var csv=require('to-csv');var ejs=require(_0xa0df('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0df('0xb'));var squel=require(_0xa0df('0xc'));var crypto=require(_0xa0df('0xd'));var jsforce=require(_0xa0df('0xe'));var deskjs=require(_0xa0df('0xf'));var toCsv=require(_0xa0df('0x10'));var querystring=require(_0xa0df('0x11'));var Papa=require(_0xa0df('0x12'));var Redis=require(_0xa0df('0x13'));var authService=require(_0xa0df('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0df('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa0df('0x16'));var licenseUtil=require(_0xa0df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4309e3,_0x1df392){_0x1df392=_0x1df392||0xcc;return function(_0x3f1460){if(_0x3f1460){return _0x4309e3[_0xa0df('0x18')](_0x1df392);}return _0x4309e3[_0xa0df('0x19')](_0x1df392)[_0xa0df('0x1a')]();};}function respondWithResult(_0x37c14e,_0x3541f1){_0x3541f1=_0x3541f1||0xc8;return function(_0x502e9a){if(_0x502e9a){return _0x37c14e[_0xa0df('0x19')](_0x3541f1)[_0xa0df('0x1b')](_0x502e9a);}};}function respondWithFilteredResult(_0x5ad32f,_0x49a066){return function(_0x276fe5){if(_0x276fe5){var _0x46eab9=typeof _0x49a066[_0xa0df('0x1c')]===_0xa0df('0x1d')&&typeof _0x49a066[_0xa0df('0x1e')]===_0xa0df('0x1d');var _0x5af152=_0x276fe5[_0xa0df('0x1f')];var _0x1122c8=_0x46eab9?0x0:_0x49a066[_0xa0df('0x1c')];var _0x3a8b4c=_0x46eab9?_0x276fe5[_0xa0df('0x1f')]:_0x49a066[_0xa0df('0x1c')]+_0x49a066['limit'];var _0x4cbf3e;if(_0x3a8b4c>=_0x5af152){_0x3a8b4c=_0x5af152;_0x4cbf3e=0xc8;}else{_0x4cbf3e=0xce;}_0x5ad32f['status'](_0x4cbf3e);return _0x5ad32f[_0xa0df('0x20')](_0xa0df('0x21'),_0x1122c8+'-'+_0x3a8b4c+'/'+_0x5af152)[_0xa0df('0x1b')](_0x276fe5);}return null;};}function patchUpdates(_0x21a7fa){return function(_0x14867b){try{jsonpatch[_0xa0df('0x22')](_0x14867b,_0x21a7fa,!![]);}catch(_0x1b5318){return BPromise[_0xa0df('0x23')](_0x1b5318);}return _0x14867b[_0xa0df('0x24')]();};}function saveUpdates(_0x4e1ea9,_0x229be3){return function(_0x413139){if(_0x413139){return _0x413139['update'](_0x4e1ea9)[_0xa0df('0x25')](function(_0x3ae36d){return _0x3ae36d;});}return null;};}function removeEntity(_0x403bc6,_0x305de8){return function(_0x4e8b4a){if(_0x4e8b4a){return _0x4e8b4a[_0xa0df('0x26')]()[_0xa0df('0x25')](function(){_0x403bc6[_0xa0df('0x19')](0xcc)[_0xa0df('0x1a')]();});}};}function handleEntityNotFound(_0x512cb2,_0x38249b){return function(_0x38b298){if(!_0x38b298){_0x512cb2['sendStatus'](0x194);}return _0x38b298;};}function handleError(_0x216029,_0xd2e532){_0xd2e532=_0xd2e532||0x1f4;return function(_0x4d65ad){logger[_0xa0df('0x27')](_0x4d65ad[_0xa0df('0x28')]);if(_0x4d65ad[_0xa0df('0x29')]){delete _0x4d65ad[_0xa0df('0x29')];}_0x216029[_0xa0df('0x19')](_0xd2e532)[_0xa0df('0x2a')](_0x4d65ad);};}exports[_0xa0df('0x2b')]=function(_0xee7f9b,_0x1979dc){var _0x5dd3f7={},_0x1b216e={},_0x47b2a9={'count':0x0,'rows':[]};var _0x15e203=_['map'](db[_0xa0df('0x2c')][_0xa0df('0x2d')],function(_0x399d29){return{'name':_0x399d29[_0xa0df('0x2e')],'type':_0x399d29['type']['key']};});_0x1b216e['model']=_[_0xa0df('0x2f')](_0x15e203,_0xa0df('0x29'));_0x1b216e[_0xa0df('0x30')]=_[_0xa0df('0x31')](_0xee7f9b[_0xa0df('0x30')]);_0x1b216e[_0xa0df('0x32')]=_['intersection'](_0x1b216e[_0xa0df('0x33')],_0x1b216e[_0xa0df('0x30')]);_0x5dd3f7[_0xa0df('0x34')]=_[_0xa0df('0x35')](_0x1b216e['model'],qs['fields'](_0xee7f9b[_0xa0df('0x30')]['fields']));_0x5dd3f7[_0xa0df('0x34')]=_0x5dd3f7[_0xa0df('0x34')][_0xa0df('0x36')]?_0x5dd3f7[_0xa0df('0x34')]:_0x1b216e['model'];if(!_0xee7f9b[_0xa0df('0x30')]['hasOwnProperty']('nolimit')){_0x5dd3f7[_0xa0df('0x1e')]=qs[_0xa0df('0x1e')](_0xee7f9b[_0xa0df('0x30')][_0xa0df('0x1e')]);_0x5dd3f7[_0xa0df('0x1c')]=qs[_0xa0df('0x1c')](_0xee7f9b[_0xa0df('0x30')][_0xa0df('0x1c')]);}_0x5dd3f7[_0xa0df('0x37')]=qs[_0xa0df('0x38')](_0xee7f9b[_0xa0df('0x30')]['sort']);_0x5dd3f7[_0xa0df('0x39')]=qs[_0xa0df('0x32')](_[_0xa0df('0x3a')](_0xee7f9b['query'],_0x1b216e[_0xa0df('0x32')]),_0x15e203);if(_0xee7f9b[_0xa0df('0x30')][_0xa0df('0x3b')]){_0x5dd3f7['where']=_['merge'](_0x5dd3f7[_0xa0df('0x39')],{'$or':_[_0xa0df('0x2f')](_0x15e203,function(_0x2be9b6){if(_0x2be9b6[_0xa0df('0x3c')]!==_0xa0df('0x3d')){var _0x2f7afa={};_0x2f7afa[_0x2be9b6[_0xa0df('0x29')]]={'$like':'%'+_0xee7f9b[_0xa0df('0x30')][_0xa0df('0x3b')]+'%'};return _0x2f7afa;}})});}_0x5dd3f7=_['merge']({},_0x5dd3f7,_0xee7f9b[_0xa0df('0x3e')]);var _0x5f49c1={'where':_0x5dd3f7['where']};return db[_0xa0df('0x2c')][_0xa0df('0x1f')](_0x5f49c1)[_0xa0df('0x25')](function(_0x416a0d){_0x47b2a9[_0xa0df('0x1f')]=_0x416a0d;if(_0xee7f9b[_0xa0df('0x30')][_0xa0df('0x3f')]){_0x5dd3f7[_0xa0df('0x40')]=[{'all':!![]}];}return db[_0xa0df('0x2c')][_0xa0df('0x41')](_0x5dd3f7);})['then'](function(_0x4752e1){_0x47b2a9[_0xa0df('0x42')]=_0x4752e1;return _0x47b2a9;})[_0xa0df('0x25')](respondWithFilteredResult(_0x1979dc,_0x5dd3f7))['catch'](handleError(_0x1979dc,null));};exports['show']=function(_0x180486,_0x552dee){var _0x2bc08c={'raw':!![],'where':{'id':_0x180486['params']['id']}},_0x56bc77={};_0x56bc77[_0xa0df('0x33')]=_[_0xa0df('0x31')](db[_0xa0df('0x2c')][_0xa0df('0x2d')]);_0x56bc77[_0xa0df('0x30')]=_[_0xa0df('0x31')](_0x180486[_0xa0df('0x30')]);_0x56bc77[_0xa0df('0x32')]=_[_0xa0df('0x35')](_0x56bc77[_0xa0df('0x33')],_0x56bc77[_0xa0df('0x30')]);_0x2bc08c[_0xa0df('0x34')]=_[_0xa0df('0x35')](_0x56bc77['model'],qs[_0xa0df('0x43')](_0x180486['query']['fields']));_0x2bc08c[_0xa0df('0x34')]=_0x2bc08c['attributes'][_0xa0df('0x36')]?_0x2bc08c[_0xa0df('0x34')]:_0x56bc77['model'];if(_0x180486[_0xa0df('0x30')]['includeAll']){_0x2bc08c[_0xa0df('0x40')]=[{'all':!![]}];}_0x2bc08c=_[_0xa0df('0x44')]({},_0x2bc08c,_0x180486['options']);return db['ZohoField'][_0xa0df('0x45')](_0x2bc08c)[_0xa0df('0x25')](handleEntityNotFound(_0x552dee,null))[_0xa0df('0x25')](respondWithResult(_0x552dee,null))[_0xa0df('0x46')](handleError(_0x552dee,null));};exports[_0xa0df('0x47')]=function(_0x2ece0c,_0x490bde){return db['ZohoField'][_0xa0df('0x47')](_0x2ece0c[_0xa0df('0x48')],{})['then'](respondWithResult(_0x490bde,0xc9))[_0xa0df('0x46')](handleError(_0x490bde,null));};exports[_0xa0df('0x49')]=function(_0x48bdd0,_0x4745af){if(_0x48bdd0[_0xa0df('0x48')]['id']){delete _0x48bdd0[_0xa0df('0x48')]['id'];}return db[_0xa0df('0x2c')]['find']({'where':{'id':_0x48bdd0[_0xa0df('0x4a')]['id']}})[_0xa0df('0x25')](handleEntityNotFound(_0x4745af,null))[_0xa0df('0x25')](saveUpdates(_0x48bdd0[_0xa0df('0x48')],null))['then'](respondWithResult(_0x4745af,null))[_0xa0df('0x46')](handleError(_0x4745af,null));};exports[_0xa0df('0x26')]=function(_0x2585f9,_0x2f579c){return db[_0xa0df('0x2c')][_0xa0df('0x45')]({'where':{'id':_0x2585f9['params']['id']}})[_0xa0df('0x25')](handleEntityNotFound(_0x2f579c,null))[_0xa0df('0x25')](removeEntity(_0x2f579c,null))[_0xa0df('0x46')](handleError(_0x2f579c,null));}; \ No newline at end of file +var _0xc87b=['fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','keys','rawAttributes','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZohoField','fieldName','type','key','model','intersection','query','attributes'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc87b,0xb2));var _0xbc87=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xc87b[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require(_0xbc87('0x0'));var rimraf=require(_0xbc87('0x1'));var zipdir=require(_0xbc87('0x2'));var jsonpatch=require(_0xbc87('0x3'));var rp=require('request-promise');var moment=require(_0xbc87('0x4'));var BPromise=require(_0xbc87('0x5'));var Mustache=require(_0xbc87('0x6'));var util=require('util');var path=require(_0xbc87('0x7'));var sox=require(_0xbc87('0x8'));var csv=require(_0xbc87('0x9'));var ejs=require(_0xbc87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc87('0xb'));var squel=require(_0xbc87('0xc'));var crypto=require(_0xbc87('0xd'));var jsforce=require(_0xbc87('0xe'));var deskjs=require(_0xbc87('0xf'));var toCsv=require(_0xbc87('0x9'));var querystring=require(_0xbc87('0x10'));var Papa=require(_0xbc87('0x11'));var Redis=require(_0xbc87('0x12'));var authService=require(_0xbc87('0x13'));var qs=require(_0xbc87('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc87('0x15'));var logger=require('../../config/logger')(_0xbc87('0x16'));var utils=require(_0xbc87('0x17'));var config=require(_0xbc87('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc87('0x19'))['db'];function respondWithStatusCode(_0x3b1906,_0x51a0f0){_0x51a0f0=_0x51a0f0||0xcc;return function(_0x9d0643){if(_0x9d0643){return _0x3b1906[_0xbc87('0x1a')](_0x51a0f0);}return _0x3b1906['status'](_0x51a0f0)[_0xbc87('0x1b')]();};}function respondWithResult(_0x1a8760,_0x4feea6){_0x4feea6=_0x4feea6||0xc8;return function(_0x2b4778){if(_0x2b4778){return _0x1a8760[_0xbc87('0x1c')](_0x4feea6)[_0xbc87('0x1d')](_0x2b4778);}};}function respondWithFilteredResult(_0x472dab,_0x3afc9f){return function(_0x2c3488){if(_0x2c3488){var _0x56c22c=typeof _0x3afc9f['offset']===_0xbc87('0x1e')&&typeof _0x3afc9f[_0xbc87('0x1f')]===_0xbc87('0x1e');var _0x5e6700=_0x2c3488[_0xbc87('0x20')];var _0x461031=_0x56c22c?0x0:_0x3afc9f[_0xbc87('0x21')];var _0x5beeb1=_0x56c22c?_0x2c3488[_0xbc87('0x20')]:_0x3afc9f[_0xbc87('0x21')]+_0x3afc9f[_0xbc87('0x1f')];var _0x46068d;if(_0x5beeb1>=_0x5e6700){_0x5beeb1=_0x5e6700;_0x46068d=0xc8;}else{_0x46068d=0xce;}_0x472dab[_0xbc87('0x1c')](_0x46068d);return _0x472dab[_0xbc87('0x22')](_0xbc87('0x23'),_0x461031+'-'+_0x5beeb1+'/'+_0x5e6700)[_0xbc87('0x1d')](_0x2c3488);}return null;};}function patchUpdates(_0x51d0a4){return function(_0x52e885){try{jsonpatch[_0xbc87('0x24')](_0x52e885,_0x51d0a4,!![]);}catch(_0x22cbd9){return BPromise[_0xbc87('0x25')](_0x22cbd9);}return _0x52e885[_0xbc87('0x26')]();};}function saveUpdates(_0x320102,_0x1bc01e){return function(_0x3edfd5){if(_0x3edfd5){return _0x3edfd5[_0xbc87('0x27')](_0x320102)['then'](function(_0x54036c){return _0x54036c;});}return null;};}function removeEntity(_0x41d595,_0x5860e4){return function(_0x1c6ef8){if(_0x1c6ef8){return _0x1c6ef8[_0xbc87('0x28')]()[_0xbc87('0x29')](function(){_0x41d595['status'](0xcc)[_0xbc87('0x1b')]();});}};}function handleEntityNotFound(_0x3bf85d,_0x428ad4){return function(_0x2e58a9){if(!_0x2e58a9){_0x3bf85d[_0xbc87('0x1a')](0x194);}return _0x2e58a9;};}function handleError(_0x59744c,_0x25dee0){_0x25dee0=_0x25dee0||0x1f4;return function(_0x508991){logger[_0xbc87('0x2a')](_0x508991[_0xbc87('0x2b')]);if(_0x508991['name']){delete _0x508991[_0xbc87('0x2c')];}_0x59744c[_0xbc87('0x1c')](_0x25dee0)[_0xbc87('0x2d')](_0x508991);};}exports[_0xbc87('0x2e')]=function(_0x1b5fd6,_0x311cfd){var _0x25d49b={},_0x49a37c={},_0x344986={'count':0x0,'rows':[]};var _0x2764dd=_[_0xbc87('0x2f')](db[_0xbc87('0x30')]['rawAttributes'],function(_0x1fe23a){return{'name':_0x1fe23a[_0xbc87('0x31')],'type':_0x1fe23a[_0xbc87('0x32')][_0xbc87('0x33')]};});_0x49a37c[_0xbc87('0x34')]=_['map'](_0x2764dd,'name');_0x49a37c['query']=_['keys'](_0x1b5fd6['query']);_0x49a37c['filters']=_[_0xbc87('0x35')](_0x49a37c[_0xbc87('0x34')],_0x49a37c[_0xbc87('0x36')]);_0x25d49b[_0xbc87('0x37')]=_[_0xbc87('0x35')](_0x49a37c[_0xbc87('0x34')],qs['fields'](_0x1b5fd6[_0xbc87('0x36')][_0xbc87('0x38')]));_0x25d49b['attributes']=_0x25d49b[_0xbc87('0x37')][_0xbc87('0x39')]?_0x25d49b[_0xbc87('0x37')]:_0x49a37c[_0xbc87('0x34')];if(!_0x1b5fd6[_0xbc87('0x36')]['hasOwnProperty'](_0xbc87('0x3a'))){_0x25d49b[_0xbc87('0x1f')]=qs[_0xbc87('0x1f')](_0x1b5fd6[_0xbc87('0x36')][_0xbc87('0x1f')]);_0x25d49b['offset']=qs[_0xbc87('0x21')](_0x1b5fd6[_0xbc87('0x36')][_0xbc87('0x21')]);}_0x25d49b[_0xbc87('0x3b')]=qs[_0xbc87('0x3c')](_0x1b5fd6[_0xbc87('0x36')][_0xbc87('0x3c')]);_0x25d49b[_0xbc87('0x3d')]=qs[_0xbc87('0x3e')](_['pick'](_0x1b5fd6[_0xbc87('0x36')],_0x49a37c['filters']),_0x2764dd);if(_0x1b5fd6[_0xbc87('0x36')][_0xbc87('0x3f')]){_0x25d49b[_0xbc87('0x3d')]=_[_0xbc87('0x40')](_0x25d49b[_0xbc87('0x3d')],{'$or':_[_0xbc87('0x2f')](_0x2764dd,function(_0x30ff67){if(_0x30ff67[_0xbc87('0x32')]!==_0xbc87('0x41')){var _0x122001={};_0x122001[_0x30ff67[_0xbc87('0x2c')]]={'$like':'%'+_0x1b5fd6[_0xbc87('0x36')]['filter']+'%'};return _0x122001;}})});}_0x25d49b=_[_0xbc87('0x40')]({},_0x25d49b,_0x1b5fd6[_0xbc87('0x42')]);var _0xcd96f7={'where':_0x25d49b['where']};return db[_0xbc87('0x30')][_0xbc87('0x20')](_0xcd96f7)[_0xbc87('0x29')](function(_0x3cf4a5){_0x344986[_0xbc87('0x20')]=_0x3cf4a5;if(_0x1b5fd6['query'][_0xbc87('0x43')]){_0x25d49b[_0xbc87('0x44')]=[{'all':!![]}];}return db[_0xbc87('0x30')][_0xbc87('0x45')](_0x25d49b);})[_0xbc87('0x29')](function(_0x427a3b){_0x344986[_0xbc87('0x46')]=_0x427a3b;return _0x344986;})['then'](respondWithFilteredResult(_0x311cfd,_0x25d49b))['catch'](handleError(_0x311cfd,null));};exports['show']=function(_0x837d42,_0x14c856){var _0x4c287b={'raw':!![],'where':{'id':_0x837d42['params']['id']}},_0x1d73b0={};_0x1d73b0[_0xbc87('0x34')]=_[_0xbc87('0x47')](db['ZohoField'][_0xbc87('0x48')]);_0x1d73b0[_0xbc87('0x36')]=_[_0xbc87('0x47')](_0x837d42[_0xbc87('0x36')]);_0x1d73b0[_0xbc87('0x3e')]=_[_0xbc87('0x35')](_0x1d73b0['model'],_0x1d73b0[_0xbc87('0x36')]);_0x4c287b[_0xbc87('0x37')]=_[_0xbc87('0x35')](_0x1d73b0[_0xbc87('0x34')],qs[_0xbc87('0x38')](_0x837d42['query'][_0xbc87('0x38')]));_0x4c287b[_0xbc87('0x37')]=_0x4c287b['attributes']['length']?_0x4c287b[_0xbc87('0x37')]:_0x1d73b0['model'];if(_0x837d42[_0xbc87('0x36')][_0xbc87('0x43')]){_0x4c287b[_0xbc87('0x44')]=[{'all':!![]}];}_0x4c287b=_[_0xbc87('0x40')]({},_0x4c287b,_0x837d42[_0xbc87('0x42')]);return db['ZohoField'][_0xbc87('0x49')](_0x4c287b)['then'](handleEntityNotFound(_0x14c856,null))[_0xbc87('0x29')](respondWithResult(_0x14c856,null))[_0xbc87('0x4a')](handleError(_0x14c856,null));};exports[_0xbc87('0x4b')]=function(_0x125d2c,_0x21e627){return db[_0xbc87('0x30')][_0xbc87('0x4b')](_0x125d2c[_0xbc87('0x4c')],{})[_0xbc87('0x29')](respondWithResult(_0x21e627,0xc9))[_0xbc87('0x4a')](handleError(_0x21e627,null));};exports[_0xbc87('0x27')]=function(_0x2f66f1,_0x225fbe){if(_0x2f66f1[_0xbc87('0x4c')]['id']){delete _0x2f66f1[_0xbc87('0x4c')]['id'];}return db[_0xbc87('0x30')][_0xbc87('0x49')]({'where':{'id':_0x2f66f1['params']['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x225fbe,null))['then'](saveUpdates(_0x2f66f1[_0xbc87('0x4c')],null))['then'](respondWithResult(_0x225fbe,null))[_0xbc87('0x4a')](handleError(_0x225fbe,null));};exports[_0xbc87('0x28')]=function(_0x578d96,_0xc9ba1a){return db[_0xbc87('0x30')][_0xbc87('0x49')]({'where':{'id':_0x578d96[_0xbc87('0x4d')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0xc9ba1a,null))['then'](removeEntity(_0xc9ba1a,null))[_0xbc87('0x4a')](handleError(_0xc9ba1a,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 7af4424..1f52e6b 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 _0x9f0e=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x479aa0,_0x4dfdfa){var _0x47aa00=function(_0x1e6a68){while(--_0x1e6a68){_0x479aa0['push'](_0x479aa0['shift']());}};_0x47aa00(++_0x4dfdfa);}(_0x9f0e,0x116));var _0xe9f0=function(_0x27767b,_0x4d28b7){_0x27767b=_0x27767b-0x0;var _0x36895a=_0x9f0e[_0x27767b];return _0x36895a;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x50313d,_0x5b87c1){return _0x50313d[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xe9f0('0xd'),_0xe9f0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3f237f,_0xdd1575){var _0x3874ba=function(_0x2204ec){while(--_0x2204ec){_0x3f237f['push'](_0x3f237f['shift']());}};_0x3874ba(++_0xdd1575);}(_0x687b,0x14a));var _0xb687=function(_0x252805,_0x1d1e8e){_0x252805=_0x252805-0x0;var _0x3e74b9=_0x687b[_0x252805];return _0x3e74b9;};'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':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 096320a..b94f507 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 _0x0c9e=['http','request','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3e6647,_0x2c0d09){var _0x46bddd=function(_0xad96c0){while(--_0xad96c0){_0x3e6647['push'](_0x3e6647['shift']());}};_0x46bddd(++_0x2c0d09);}(_0x0c9e,0x98));var _0xe0c9=function(_0x36a3b1,_0x440543){_0x36a3b1=_0x36a3b1-0x0;var _0x4d0a61=_0x0c9e[_0x36a3b1];return _0x4d0a61;};'use strict';var _=require(_0xe0c9('0x0'));var util=require(_0xe0c9('0x1'));var moment=require(_0xe0c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0c9('0x3'));var logger=require(_0xe0c9('0x4'))(_0xe0c9('0x5'));var config=require('../../config/environment');var jayson=require(_0xe0c9('0x6'));var client=jayson[_0xe0c9('0x7')][_0xe0c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38046c,_0x3aacb3,_0x529dc3){return new BPromise(function(_0x2dc1df,_0x4d394f){return client[_0xe0c9('0x9')](_0x38046c,_0x529dc3)['then'](function(_0x26e26d){logger[_0xe0c9('0xa')]('ZohoField,\x20%s,\x20%s',_0x3aacb3,_0xe0c9('0xb'));logger['debug'](_0xe0c9('0xc'),_0x3aacb3,_0xe0c9('0xb'),JSON[_0xe0c9('0xd')](_0x26e26d));if(_0x26e26d[_0xe0c9('0xe')]){if(_0x26e26d['error'][_0xe0c9('0xf')]===0x1f4){logger['error'](_0xe0c9('0x10'),_0x3aacb3,_0x26e26d[_0xe0c9('0xe')]['message']);return _0x4d394f(_0x26e26d[_0xe0c9('0xe')][_0xe0c9('0x11')]);}logger[_0xe0c9('0xe')](_0xe0c9('0x10'),_0x3aacb3,_0x26e26d[_0xe0c9('0xe')][_0xe0c9('0x11')]);return _0x2dc1df(_0x26e26d['error'][_0xe0c9('0x11')]);}else{logger[_0xe0c9('0xa')](_0xe0c9('0x10'),_0x3aacb3,_0xe0c9('0xb'));_0x2dc1df(_0x26e26d[_0xe0c9('0x12')][_0xe0c9('0x11')]);}})[_0xe0c9('0x13')](function(_0x2be21e){logger[_0xe0c9('0xe')](_0xe0c9('0x10'),_0x3aacb3,_0x2be21e);_0x4d394f(_0x2be21e);});});} \ No newline at end of file +var _0x7489=['message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x464297,_0x58ba79){var _0x9aac10=function(_0x248ad5){while(--_0x248ad5){_0x464297['push'](_0x464297['shift']());}};_0x9aac10(++_0x58ba79);}(_0x7489,0x10d));var _0x9748=function(_0x54f7eb,_0x2bffc8){_0x54f7eb=_0x54f7eb-0x0;var _0x408734=_0x7489[_0x54f7eb];return _0x408734;};'use strict';var _=require(_0x9748('0x0'));var util=require('util');var moment=require(_0x9748('0x1'));var BPromise=require(_0x9748('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9748('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9748('0x4'))(_0x9748('0x5'));var config=require(_0x9748('0x6'));var jayson=require(_0x9748('0x7'));var client=jayson[_0x9748('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b877a,_0x3ea1e8,_0x1fc09c){return new BPromise(function(_0x26b419,_0x30ec3f){return client['request'](_0x5b877a,_0x1fc09c)[_0x9748('0x9')](function(_0x370364){logger['info'](_0x9748('0xa'),_0x3ea1e8,_0x9748('0xb'));logger['debug'](_0x9748('0xc'),_0x3ea1e8,_0x9748('0xb'),JSON[_0x9748('0xd')](_0x370364));if(_0x370364[_0x9748('0xe')]){if(_0x370364[_0x9748('0xe')][_0x9748('0xf')]===0x1f4){logger['error'](_0x9748('0xa'),_0x3ea1e8,_0x370364[_0x9748('0xe')]['message']);return _0x30ec3f(_0x370364[_0x9748('0xe')]['message']);}logger[_0x9748('0xe')](_0x9748('0xa'),_0x3ea1e8,_0x370364['error'][_0x9748('0x10')]);return _0x26b419(_0x370364[_0x9748('0xe')][_0x9748('0x10')]);}else{logger['info'](_0x9748('0xa'),_0x3ea1e8,_0x9748('0xb'));_0x26b419(_0x370364[_0x9748('0x11')][_0x9748('0x10')]);}})[_0x9748('0x12')](function(_0xd33cca){logger[_0x9748('0xe')](_0x9748('0xa'),_0x3ea1e8,_0xd33cca);_0x30ec3f(_0xd33cca);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b33444e..cf9885a 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_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 3861044..ab3275d 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 _0xd1da=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x261969,_0x7411e0){var _0x1a0ab3=function(_0x45f055){while(--_0x45f055){_0x261969['push'](_0x261969['shift']());}};_0x1a0ab3(++_0x7411e0);}(_0xd1da,0x162));var _0xad1d=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0xd1da[_0x32e264];return _0x1d7175;};'use strict';var Sequelize=require(_0xad1d('0x0'));module[_0xad1d('0x1')]={'name':{'type':Sequelize[_0xad1d('0x2')],'allowNull':![],'unique':_0xad1d('0x3')},'version':{'type':Sequelize[_0xad1d('0x2')],'allowNull':![],'unique':_0xad1d('0x3')},'main':{'type':Sequelize[_0xad1d('0x2')],'defaultValue':_0xad1d('0x4')},'filename':{'type':Sequelize[_0xad1d('0x2')]},'path':{'type':Sequelize[_0xad1d('0x2')]},'type':{'type':Sequelize[_0xad1d('0x2')]},'size':{'type':Sequelize[_0xad1d('0x5')]},'active':{'type':Sequelize[_0xad1d('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xad1d('0x2')],'unique':_0xad1d('0x7')},'description':{'type':Sequelize[_0xad1d('0x2')]},'title':{'type':Sequelize[_0xad1d('0x2')]},'remoteUri':{'type':Sequelize[_0xad1d('0x2')]},'link':{'type':Sequelize[_0xad1d('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc639=['sequelize','STRING','unique_name_and_version','app.js'];(function(_0x21cc3f,_0x4ac3e5){var _0x1a311c=function(_0x23a048){while(--_0x23a048){_0x21cc3f['push'](_0x21cc3f['shift']());}};_0x1a311c(++_0x4ac3e5);}(_0xc639,0xc0));var _0x9c63=function(_0x358f10,_0x1e73d4){_0x358f10=_0x358f10-0x0;var _0x51dc23=_0xc639[_0x358f10];return _0x51dc23;};'use strict';var Sequelize=require(_0x9c63('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c63('0x1')],'allowNull':![],'unique':_0x9c63('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9c63('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x9c63('0x3')},'filename':{'type':Sequelize[_0x9c63('0x1')]},'path':{'type':Sequelize[_0x9c63('0x1')]},'type':{'type':Sequelize[_0x9c63('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x9c63('0x1')]},'logo':{'type':Sequelize[_0x9c63('0x1')]},'state':{'type':Sequelize[_0x9c63('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x9c63('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 e0100dc..a5d3f79 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 _0x71ab=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','Integration','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key'];(function(_0x279f6d,_0x122316){var _0x5874a5=function(_0x4823ae){while(--_0x4823ae){_0x279f6d['push'](_0x279f6d['shift']());}};_0x5874a5(++_0x122316);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['Integration']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['Integration']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['Integration'][_0xb71a('0x47')](_0x1f29b7[_0xb71a('0x48')],{})[_0xb71a('0x24')](respondWithResult(_0x365bed,0xc9))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports['update']=function(_0x48fbde,_0x23b4c0){if(_0x48fbde[_0xb71a('0x48')]['id']){delete _0x48fbde[_0xb71a('0x48')]['id'];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'id':_0x48fbde[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x23b4c0,null))[_0xb71a('0x24')](saveUpdates(_0x48fbde[_0xb71a('0x48')],null))[_0xb71a('0x24')](respondWithResult(_0x23b4c0,null))['catch'](handleError(_0x23b4c0,null));};exports[_0xb71a('0x25')]=function(_0x2ce711,_0x500196){return db[_0xb71a('0x3f')]['find']({'where':{'id':_0x2ce711[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x500196,null))[_0xb71a('0x24')](removeEntity(_0x500196,null))[_0xb71a('0x42')](handleError(_0x500196,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xadb5,0xad));var _0x5adb=function(_0x214333,_0x381c51){_0x214333=_0x214333-0x0;var _0x38e65f=_0xadb5[_0x214333];return _0x38e65f;};'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['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 2de53c7..95cafde 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 _0x5b03=['exports','define','Integration','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x1519ec,_0x26ab64){var _0x4ebabc=function(_0x2f098d){while(--_0x2f098d){_0x1519ec['push'](_0x1519ec['shift']());}};_0x4ebabc(++_0x26ab64);}(_0x5b03,0x1bf));var _0x35b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b03[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x35b0('0x0'));var util=require('util');var logger=require(_0x35b0('0x1'))(_0x35b0('0x2'));var moment=require('moment');var BPromise=require(_0x35b0('0x3'));var rp=require(_0x35b0('0x4'));var fs=require('fs');var path=require(_0x35b0('0x5'));var rimraf=require(_0x35b0('0x6'));var config=require(_0x35b0('0x7'));var attributes=require(_0x35b0('0x8'));module[_0x35b0('0x9')]=function(_0x2e6c25,_0x885fba){return _0x2e6c25[_0x35b0('0xa')](_0x35b0('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x595b=['rimraf','../../config/environment','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2a5fef,_0x340ce3){var _0x562f5a=function(_0x39f6a1){while(--_0x39f6a1){_0x2a5fef['push'](_0x2a5fef['shift']());}};_0x562f5a(++_0x340ce3);}(_0x595b,0xa2));var _0xb595=function(_0x182760,_0x439a61){_0x182760=_0x182760-0x0;var _0xc3d3c=_0x595b[_0x182760];return _0xc3d3c;};'use strict';var _=require(_0xb595('0x0'));var util=require(_0xb595('0x1'));var logger=require(_0xb595('0x2'))(_0xb595('0x3'));var moment=require(_0xb595('0x4'));var BPromise=require(_0xb595('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb595('0x6'));var rimraf=require(_0xb595('0x7'));var config=require(_0xb595('0x8'));var attributes=require('./integration.attributes');module[_0xb595('0x9')]=function(_0x10ae05,_0x21368f){return _0x10ae05[_0xb595('0xa')](_0xb595('0xb'),attributes,{'tableName':_0xb595('0xc'),'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 9b38e35..912ae49 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 _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(_0x2a32e7,_0x4298df){var _0x40e78b=function(_0x6b87c){while(--_0x6b87c){_0x2a32e7['push'](_0x2a32e7['shift']());}};_0x40e78b(++_0x4298df);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x27f256,_0x2b857e){_0x27f256=_0x27f256-0x0;var _0x45eac2=_0xc6ac[_0x27f256];return _0x45eac2;};'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 +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x42b0a9,_0x276233){var _0x5e2f02=function(_0x1a9f83){while(--_0x1a9f83){_0x42b0a9['push'](_0x42b0a9['shift']());}};_0x5e2f02(++_0x276233);}(_0x1a85,0x178));var _0x51a8=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0x1a85[_0xa03344];return _0x38acfd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 320f449..87ef75e 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 _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xdb28,0x106));var _0x8db2=function(_0x90542f,_0x53df84){_0x90542f=_0x90542f-0x0;var _0x2ac669=_0xdb28[_0x90542f];return _0x2ac669;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xda2d,0x102));var _0xdda2=function(_0x1aa1d3,_0x56eeee){_0x1aa1d3=_0x1aa1d3-0x0;var _0x99c18e=_0xda2d[_0x1aa1d3];return _0x99c18e;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e4a2ba3..c62db12 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 _0x5106=['DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER'];(function(_0xe898ab,_0x8080d5){var _0x70b47e=function(_0x11b6f5){while(--_0x11b6f5){_0xe898ab['push'](_0xe898ab['shift']());}};_0x70b47e(++_0x8080d5);}(_0x5106,0x110));var _0x6510=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5106[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x6510('0x0'));module['exports']={'integration':{'type':Sequelize[_0x6510('0x1')]},'eventChannel':{'type':Sequelize[_0x6510('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x6510('0x1')]},'integrationId':{'type':Sequelize[_0x6510('0x2')]},'contacts':{'type':Sequelize[_0x6510('0x1')]},'uniqueid':{'type':Sequelize[_0x6510('0x1')]},'calleridnum':{'type':Sequelize[_0x6510('0x1')]},'calleridname':{'type':Sequelize[_0x6510('0x1')]},'queue':{'type':Sequelize[_0x6510('0x1')]},'interface':{'type':Sequelize[_0x6510('0x1')]},'membername':{'type':Sequelize[_0x6510('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6510('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6510('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6510('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6510('0x3')]},'talktime':{'type':Sequelize[_0x6510('0x2')]},'agentacw':{'type':Sequelize[_0x6510('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6510('0x2')]},'reason':{'type':Sequelize[_0x6510('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x6510('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6510('0x3')]},'agentdump':{'type':Sequelize[_0x6510('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6510('0x3')]},'lastevent':{'type':Sequelize[_0x6510('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6510('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6510('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6510('0x1')]},'language':{'type':Sequelize[_0x6510('0x1')]},'accountcode':{'type':Sequelize[_0x6510('0x1')]},'context':{'type':Sequelize[_0x6510('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6510('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6510('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6510('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6510('0x1')]},'destcalleridname':{'type':Sequelize[_0x6510('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6510('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6510('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6510('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6510('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6510('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x6510('0x5')]},'text':{'type':Sequelize[_0x6510('0x5')]},'status':{'type':Sequelize[_0x6510('0x6')](_0x6510('0x7'),_0x6510('0x8'),_0x6510('0x9'),_0x6510('0xa'))},'url':{'type':Sequelize[_0x6510('0x1')]},'app':{'type':Sequelize[_0x6510('0x1')]},'appdata':{'type':Sequelize[_0x6510('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8edc=['TEXT','ENUM','SENT','SENDING','FAILED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x5c7575,_0x2b8863){var _0xef50c4=function(_0x288c26){while(--_0x288c26){_0x5c7575['push'](_0x5c7575['shift']());}};_0xef50c4(++_0x2b8863);}(_0x8edc,0x102));var _0xc8ed=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8edc[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0xc8ed('0x0'));module[_0xc8ed('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xc8ed('0x2')]},'ticketId':{'type':Sequelize[_0xc8ed('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc8ed('0x2')]},'calleridnum':{'type':Sequelize[_0xc8ed('0x2')]},'calleridname':{'type':Sequelize[_0xc8ed('0x2')]},'queue':{'type':Sequelize[_0xc8ed('0x2')]},'interface':{'type':Sequelize[_0xc8ed('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc8ed('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc8ed('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xc8ed('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc8ed('0x3')]},'talktime':{'type':Sequelize[_0xc8ed('0x5')]},'agentacw':{'type':Sequelize[_0xc8ed('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xc8ed('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xc8ed('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc8ed('0x3')]},'lastevent':{'type':Sequelize[_0xc8ed('0x2')]},'channel':{'type':Sequelize[_0xc8ed('0x2')]},'channelstate':{'type':Sequelize[_0xc8ed('0x5')]},'channelstatedesc':{'type':Sequelize[_0xc8ed('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc8ed('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc8ed('0x2')]},'context':{'type':Sequelize[_0xc8ed('0x2')]},'exten':{'type':Sequelize[_0xc8ed('0x2')]},'priority':{'type':Sequelize[_0xc8ed('0x2')]},'destchannel':{'type':Sequelize[_0xc8ed('0x2')]},'destchannelstate':{'type':Sequelize[_0xc8ed('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc8ed('0x2')]},'destcalleridname':{'type':Sequelize[_0xc8ed('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc8ed('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc8ed('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc8ed('0x2')]},'destcontext':{'type':Sequelize[_0xc8ed('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xc8ed('0x2')]},'destuniqueid':{'type':Sequelize[_0xc8ed('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xc8ed('0x2')]},'subject':{'type':Sequelize[_0xc8ed('0x2')]},'from':{'type':Sequelize[_0xc8ed('0x2')]},'to':{'type':Sequelize[_0xc8ed('0x2')]},'cc':{'type':Sequelize[_0xc8ed('0x2')]},'attachment':{'type':Sequelize[_0xc8ed('0x6')]},'html':{'type':Sequelize[_0xc8ed('0x6')]},'text':{'type':Sequelize[_0xc8ed('0x6')]},'status':{'type':Sequelize[_0xc8ed('0x7')](_0xc8ed('0x8'),_0xc8ed('0x9'),'RECEIVED',_0xc8ed('0xa'))},'url':{'type':Sequelize[_0xc8ed('0x2')]},'app':{'type':Sequelize[_0xc8ed('0x2')]},'appdata':{'type':Sequelize[_0xc8ed('0x2')]},'projectId':{'type':Sequelize[_0xc8ed('0x5')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 64481c6..f4b8e2c 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 _0x4f3f=['limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x5db8e9,_0x45b82a){var _0x5a6888=function(_0x25e29d){while(--_0x25e29d){_0x5db8e9['push'](_0x5db8e9['shift']());}};_0x5a6888(++_0x45b82a);}(_0x4f3f,0x102));var _0xf4f3=function(_0x5ebea0,_0x590dfd){_0x5ebea0=_0x5ebea0-0x0;var _0x32434a=_0x4f3f[_0x5ebea0];return _0x32434a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4f3('0x0'));var zipdir=require(_0xf4f3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f3('0x2'));var moment=require('moment');var BPromise=require(_0xf4f3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf4f3('0x4'));var csv=require(_0xf4f3('0x5'));var ejs=require(_0xf4f3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4f3('0x7'));var squel=require(_0xf4f3('0x8'));var crypto=require(_0xf4f3('0x9'));var jsforce=require(_0xf4f3('0xa'));var deskjs=require(_0xf4f3('0xb'));var toCsv=require(_0xf4f3('0x5'));var querystring=require(_0xf4f3('0xc'));var Papa=require(_0xf4f3('0xd'));var Redis=require(_0xf4f3('0xe'));var authService=require(_0xf4f3('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4f3('0x10'))(_0xf4f3('0x11'));var utils=require(_0xf4f3('0x12'));var config=require(_0xf4f3('0x13'));var licenseUtil=require(_0xf4f3('0x14'));var db=require(_0xf4f3('0x15'))['db'];function respondWithStatusCode(_0x30baa5,_0x13557a){_0x13557a=_0x13557a||0xcc;return function(_0x2dc383){if(_0x2dc383){return _0x30baa5[_0xf4f3('0x16')](_0x13557a);}return _0x30baa5[_0xf4f3('0x17')](_0x13557a)['end']();};}function respondWithResult(_0x5d9749,_0x31bb8b){_0x31bb8b=_0x31bb8b||0xc8;return function(_0x3b751a){if(_0x3b751a){return _0x5d9749[_0xf4f3('0x17')](_0x31bb8b)['json'](_0x3b751a);}};}function respondWithFilteredResult(_0x2e50a0,_0x206d83){return function(_0xb27b6){if(_0xb27b6){var _0x33fbc2=typeof _0x206d83[_0xf4f3('0x18')]===_0xf4f3('0x19')&&typeof _0x206d83[_0xf4f3('0x1a')]==='undefined';var _0x4d05a5=_0xb27b6[_0xf4f3('0x1b')];var _0x58d012=_0x33fbc2?0x0:_0x206d83[_0xf4f3('0x18')];var _0x4c2ec2=_0x33fbc2?_0xb27b6[_0xf4f3('0x1b')]:_0x206d83['offset']+_0x206d83['limit'];var _0x359b39;if(_0x4c2ec2>=_0x4d05a5){_0x4c2ec2=_0x4d05a5;_0x359b39=0xc8;}else{_0x359b39=0xce;}_0x2e50a0[_0xf4f3('0x17')](_0x359b39);return _0x2e50a0['set']('Content-Range',_0x58d012+'-'+_0x4c2ec2+'/'+_0x4d05a5)[_0xf4f3('0x1c')](_0xb27b6);}return null;};}function patchUpdates(_0x169c8a){return function(_0x373d4a){try{jsonpatch[_0xf4f3('0x1d')](_0x373d4a,_0x169c8a,!![]);}catch(_0x1f2fd1){return BPromise[_0xf4f3('0x1e')](_0x1f2fd1);}return _0x373d4a[_0xf4f3('0x1f')]();};}function saveUpdates(_0x28273f,_0x11830f){return function(_0x1e9b39){if(_0x1e9b39){return _0x1e9b39[_0xf4f3('0x20')](_0x28273f)[_0xf4f3('0x21')](function(_0x8b5718){return _0x8b5718;});}return null;};}function removeEntity(_0x57abe5,_0x2dc416){return function(_0x1669e0){if(_0x1669e0){return _0x1669e0[_0xf4f3('0x22')]()['then'](function(){_0x57abe5[_0xf4f3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce704,_0x404798){return function(_0xbc6072){if(!_0xbc6072){_0x1ce704[_0xf4f3('0x16')](0x194);}return _0xbc6072;};}function handleError(_0x34b290,_0x34dc1f){_0x34dc1f=_0x34dc1f||0x1f4;return function(_0x5c51c3){logger[_0xf4f3('0x23')](_0x5c51c3[_0xf4f3('0x24')]);if(_0x5c51c3[_0xf4f3('0x25')]){delete _0x5c51c3[_0xf4f3('0x25')];}_0x34b290[_0xf4f3('0x17')](_0x34dc1f)[_0xf4f3('0x26')](_0x5c51c3);};}exports[_0xf4f3('0x27')]=function(_0x525927,_0x50c458){var _0x458908={},_0x901b8f={},_0x270613={'count':0x0,'rows':[]};var _0x64390d=_['map'](db[_0xf4f3('0x28')][_0xf4f3('0x29')],function(_0x40e74f){return{'name':_0x40e74f[_0xf4f3('0x2a')],'type':_0x40e74f['type'][_0xf4f3('0x2b')]};});_0x901b8f[_0xf4f3('0x2c')]=_[_0xf4f3('0x2d')](_0x64390d,_0xf4f3('0x25'));_0x901b8f[_0xf4f3('0x2e')]=_[_0xf4f3('0x2f')](_0x525927[_0xf4f3('0x2e')]);_0x901b8f[_0xf4f3('0x30')]=_['intersection'](_0x901b8f['model'],_0x901b8f['query']);_0x458908[_0xf4f3('0x31')]=_[_0xf4f3('0x32')](_0x901b8f[_0xf4f3('0x2c')],qs[_0xf4f3('0x33')](_0x525927[_0xf4f3('0x2e')]['fields']));_0x458908[_0xf4f3('0x31')]=_0x458908[_0xf4f3('0x31')]['length']?_0x458908[_0xf4f3('0x31')]:_0x901b8f[_0xf4f3('0x2c')];if(!_0x525927[_0xf4f3('0x2e')][_0xf4f3('0x34')]('nolimit')){_0x458908[_0xf4f3('0x1a')]=qs['limit'](_0x525927['query'][_0xf4f3('0x1a')]);_0x458908['offset']=qs['offset'](_0x525927[_0xf4f3('0x2e')]['offset']);}_0x458908[_0xf4f3('0x35')]=qs['sort'](_0x525927['query'][_0xf4f3('0x36')]);_0x458908[_0xf4f3('0x37')]=qs[_0xf4f3('0x30')](_[_0xf4f3('0x38')](_0x525927[_0xf4f3('0x2e')],_0x901b8f[_0xf4f3('0x30')]),_0x64390d);if(_0x525927[_0xf4f3('0x2e')][_0xf4f3('0x39')]){_0x458908[_0xf4f3('0x37')]=_[_0xf4f3('0x3a')](_0x458908[_0xf4f3('0x37')],{'$or':_['map'](_0x64390d,function(_0x5c2c64){if(_0x5c2c64['type']!=='VIRTUAL'){var _0x459d08={};_0x459d08[_0x5c2c64[_0xf4f3('0x25')]]={'$like':'%'+_0x525927[_0xf4f3('0x2e')]['filter']+'%'};return _0x459d08;}})});}_0x458908=_['merge']({},_0x458908,_0x525927[_0xf4f3('0x3b')]);var _0x11ce00={'where':_0x458908[_0xf4f3('0x37')]};return db[_0xf4f3('0x28')][_0xf4f3('0x1b')](_0x11ce00)[_0xf4f3('0x21')](function(_0x235ef9){_0x270613[_0xf4f3('0x1b')]=_0x235ef9;if(_0x525927['query'][_0xf4f3('0x3c')]){_0x458908[_0xf4f3('0x3d')]=[{'all':!![]}];}return db[_0xf4f3('0x28')]['findAll'](_0x458908);})[_0xf4f3('0x21')](function(_0x9d559f){_0x270613[_0xf4f3('0x3e')]=_0x9d559f;return _0x270613;})[_0xf4f3('0x21')](respondWithFilteredResult(_0x50c458,_0x458908))[_0xf4f3('0x3f')](handleError(_0x50c458,null));};exports[_0xf4f3('0x40')]=function(_0x15ac30,_0x51a657){var _0x4fe775={'raw':![],'where':{'id':_0x15ac30['params']['id']}},_0x132519={};_0x132519['model']=_['keys'](db['IntegrationReport'][_0xf4f3('0x29')]);_0x132519['query']=_[_0xf4f3('0x2f')](_0x15ac30[_0xf4f3('0x2e')]);_0x132519[_0xf4f3('0x30')]=_[_0xf4f3('0x32')](_0x132519[_0xf4f3('0x2c')],_0x132519[_0xf4f3('0x2e')]);_0x4fe775[_0xf4f3('0x31')]=_[_0xf4f3('0x32')](_0x132519[_0xf4f3('0x2c')],qs[_0xf4f3('0x33')](_0x15ac30['query'][_0xf4f3('0x33')]));_0x4fe775['attributes']=_0x4fe775[_0xf4f3('0x31')][_0xf4f3('0x41')]?_0x4fe775[_0xf4f3('0x31')]:_0x132519[_0xf4f3('0x2c')];if(_0x15ac30[_0xf4f3('0x2e')][_0xf4f3('0x3c')]){_0x4fe775['include']=[{'all':!![]}];}_0x4fe775=_[_0xf4f3('0x3a')]({},_0x4fe775,_0x15ac30[_0xf4f3('0x3b')]);return db['IntegrationReport'][_0xf4f3('0x42')](_0x4fe775)[_0xf4f3('0x21')](handleEntityNotFound(_0x51a657,null))[_0xf4f3('0x21')](respondWithResult(_0x51a657,null))[_0xf4f3('0x3f')](handleError(_0x51a657,null));};exports[_0xf4f3('0x43')]=function(_0x469248,_0x4bd2eb){return db[_0xf4f3('0x28')][_0xf4f3('0x43')](_0x469248[_0xf4f3('0x44')],{})['then'](respondWithResult(_0x4bd2eb,0xc9))['catch'](handleError(_0x4bd2eb,null));};exports[_0xf4f3('0x20')]=function(_0xafc60d,_0x490958){if(_0xafc60d[_0xf4f3('0x44')]['id']){delete _0xafc60d[_0xf4f3('0x44')]['id'];}return db['IntegrationReport'][_0xf4f3('0x42')]({'where':{'id':_0xafc60d[_0xf4f3('0x45')]['id']}})[_0xf4f3('0x21')](handleEntityNotFound(_0x490958,null))[_0xf4f3('0x21')](saveUpdates(_0xafc60d[_0xf4f3('0x44')],null))[_0xf4f3('0x21')](respondWithResult(_0x490958,null))['catch'](handleError(_0x490958,null));};exports[_0xf4f3('0x22')]=function(_0x5dc10a,_0x4576fa){return db[_0xf4f3('0x28')][_0xf4f3('0x42')]({'where':{'id':_0x5dc10a[_0xf4f3('0x45')]['id']}})[_0xf4f3('0x21')](handleEntityNotFound(_0x4576fa,null))[_0xf4f3('0x21')](removeEntity(_0x4576fa,null))['catch'](handleError(_0x4576fa,null));};exports[_0xf4f3('0x46')]=function(_0x1b6209,_0x5dc934){return db[_0xf4f3('0x28')][_0xf4f3('0x46')]()[_0xf4f3('0x21')](respondWithResult(_0x5dc934,null))[_0xf4f3('0x3f')](handleError(_0x5dc934,null));}; \ No newline at end of file +var _0xc764=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x353bbe,_0x160113){var _0x32eab7=function(_0x4c97bc){while(--_0x4c97bc){_0x353bbe['push'](_0x353bbe['shift']());}};_0x32eab7(++_0x160113);}(_0xc764,0xd2));var _0x4c76=function(_0x4a32b5,_0x29ad5e){_0x4a32b5=_0x4a32b5-0x0;var _0x184477=_0xc764[_0x4a32b5];return _0x184477;};'use strict';var emlformat=require(_0x4c76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c76('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c76('0x2'));var moment=require(_0x4c76('0x3'));var BPromise=require(_0x4c76('0x4'));var Mustache=require(_0x4c76('0x5'));var util=require(_0x4c76('0x6'));var path=require(_0x4c76('0x7'));var sox=require(_0x4c76('0x8'));var csv=require(_0x4c76('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c76('0xa'));var squel=require(_0x4c76('0xb'));var crypto=require(_0x4c76('0xc'));var jsforce=require(_0x4c76('0xd'));var deskjs=require(_0x4c76('0xe'));var toCsv=require(_0x4c76('0x9'));var querystring=require(_0x4c76('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c76('0x10'));var qs=require(_0x4c76('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4c76('0x12'));var config=require(_0x4c76('0x13'));var licenseUtil=require(_0x4c76('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59851e,_0x17ee77){_0x17ee77=_0x17ee77||0xcc;return function(_0x222cf6){if(_0x222cf6){return _0x59851e['sendStatus'](_0x17ee77);}return _0x59851e[_0x4c76('0x15')](_0x17ee77)['end']();};}function respondWithResult(_0x41483c,_0x20af72){_0x20af72=_0x20af72||0xc8;return function(_0xf19cbf){if(_0xf19cbf){return _0x41483c[_0x4c76('0x15')](_0x20af72)[_0x4c76('0x16')](_0xf19cbf);}};}function respondWithFilteredResult(_0xf08d97,_0x215394){return function(_0x167d64){if(_0x167d64){var _0x442c78=typeof _0x215394[_0x4c76('0x17')]===_0x4c76('0x18')&&typeof _0x215394[_0x4c76('0x19')]===_0x4c76('0x18');var _0x4969f5=_0x167d64['count'];var _0x31797d=_0x442c78?0x0:_0x215394[_0x4c76('0x17')];var _0x46efd7=_0x442c78?_0x167d64[_0x4c76('0x1a')]:_0x215394[_0x4c76('0x17')]+_0x215394[_0x4c76('0x19')];var _0x3f6196;if(_0x46efd7>=_0x4969f5){_0x46efd7=_0x4969f5;_0x3f6196=0xc8;}else{_0x3f6196=0xce;}_0xf08d97[_0x4c76('0x15')](_0x3f6196);return _0xf08d97[_0x4c76('0x1b')](_0x4c76('0x1c'),_0x31797d+'-'+_0x46efd7+'/'+_0x4969f5)['json'](_0x167d64);}return null;};}function patchUpdates(_0x6c5c7b){return function(_0x255cf8){try{jsonpatch[_0x4c76('0x1d')](_0x255cf8,_0x6c5c7b,!![]);}catch(_0x381196){return BPromise[_0x4c76('0x1e')](_0x381196);}return _0x255cf8[_0x4c76('0x1f')]();};}function saveUpdates(_0x334c59,_0x5c33fb){return function(_0x2a1d05){if(_0x2a1d05){return _0x2a1d05[_0x4c76('0x20')](_0x334c59)['then'](function(_0x38a423){return _0x38a423;});}return null;};}function removeEntity(_0x306d2b,_0xcb1bc6){return function(_0x54718d){if(_0x54718d){return _0x54718d[_0x4c76('0x21')]()[_0x4c76('0x22')](function(){_0x306d2b['status'](0xcc)[_0x4c76('0x23')]();});}};}function handleEntityNotFound(_0x489257,_0x470799){return function(_0xfe514f){if(!_0xfe514f){_0x489257[_0x4c76('0x24')](0x194);}return _0xfe514f;};}function handleError(_0x29abeb,_0x44f997){_0x44f997=_0x44f997||0x1f4;return function(_0xb39562){logger['error'](_0xb39562[_0x4c76('0x25')]);if(_0xb39562['name']){delete _0xb39562[_0x4c76('0x26')];}_0x29abeb[_0x4c76('0x15')](_0x44f997)[_0x4c76('0x27')](_0xb39562);};}exports[_0x4c76('0x28')]=function(_0x32d616,_0x2ed08b){var _0x4fc268={},_0x48e7a4={},_0x56d098={'count':0x0,'rows':[]};var _0x562dad=_[_0x4c76('0x29')](db[_0x4c76('0x2a')][_0x4c76('0x2b')],function(_0x4b893e){return{'name':_0x4b893e[_0x4c76('0x2c')],'type':_0x4b893e[_0x4c76('0x2d')][_0x4c76('0x2e')]};});_0x48e7a4[_0x4c76('0x2f')]=_[_0x4c76('0x29')](_0x562dad,'name');_0x48e7a4[_0x4c76('0x30')]=_['keys'](_0x32d616[_0x4c76('0x30')]);_0x48e7a4[_0x4c76('0x31')]=_['intersection'](_0x48e7a4[_0x4c76('0x2f')],_0x48e7a4['query']);_0x4fc268[_0x4c76('0x32')]=_['intersection'](_0x48e7a4[_0x4c76('0x2f')],qs[_0x4c76('0x33')](_0x32d616[_0x4c76('0x30')][_0x4c76('0x33')]));_0x4fc268[_0x4c76('0x32')]=_0x4fc268[_0x4c76('0x32')][_0x4c76('0x34')]?_0x4fc268[_0x4c76('0x32')]:_0x48e7a4[_0x4c76('0x2f')];if(!_0x32d616[_0x4c76('0x30')][_0x4c76('0x35')](_0x4c76('0x36'))){_0x4fc268['limit']=qs['limit'](_0x32d616['query']['limit']);_0x4fc268['offset']=qs[_0x4c76('0x17')](_0x32d616[_0x4c76('0x30')][_0x4c76('0x17')]);}_0x4fc268[_0x4c76('0x37')]=qs[_0x4c76('0x38')](_0x32d616[_0x4c76('0x30')][_0x4c76('0x38')]);_0x4fc268['where']=qs['filters'](_[_0x4c76('0x39')](_0x32d616[_0x4c76('0x30')],_0x48e7a4[_0x4c76('0x31')]),_0x562dad);if(_0x32d616['query'][_0x4c76('0x3a')]){_0x4fc268[_0x4c76('0x3b')]=_['merge'](_0x4fc268['where'],{'$or':_[_0x4c76('0x29')](_0x562dad,function(_0xdeed7){if(_0xdeed7[_0x4c76('0x2d')]!==_0x4c76('0x3c')){var _0x3068be={};_0x3068be[_0xdeed7['name']]={'$like':'%'+_0x32d616['query'][_0x4c76('0x3a')]+'%'};return _0x3068be;}})});}_0x4fc268=_[_0x4c76('0x3d')]({},_0x4fc268,_0x32d616[_0x4c76('0x3e')]);var _0x24cdb5={'where':_0x4fc268[_0x4c76('0x3b')]};return db[_0x4c76('0x2a')][_0x4c76('0x1a')](_0x24cdb5)[_0x4c76('0x22')](function(_0x40e7d2){_0x56d098['count']=_0x40e7d2;if(_0x32d616['query'][_0x4c76('0x3f')]){_0x4fc268[_0x4c76('0x40')]=[{'all':!![]}];}return db[_0x4c76('0x2a')][_0x4c76('0x41')](_0x4fc268);})[_0x4c76('0x22')](function(_0x14e206){_0x56d098[_0x4c76('0x42')]=_0x14e206;return _0x56d098;})[_0x4c76('0x22')](respondWithFilteredResult(_0x2ed08b,_0x4fc268))[_0x4c76('0x43')](handleError(_0x2ed08b,null));};exports['show']=function(_0x210484,_0xf3de90){var _0x15502d={'raw':![],'where':{'id':_0x210484[_0x4c76('0x44')]['id']}},_0x4e0b23={};_0x4e0b23['model']=_[_0x4c76('0x45')](db['IntegrationReport'][_0x4c76('0x2b')]);_0x4e0b23[_0x4c76('0x30')]=_[_0x4c76('0x45')](_0x210484[_0x4c76('0x30')]);_0x4e0b23[_0x4c76('0x31')]=_['intersection'](_0x4e0b23[_0x4c76('0x2f')],_0x4e0b23[_0x4c76('0x30')]);_0x15502d[_0x4c76('0x32')]=_['intersection'](_0x4e0b23[_0x4c76('0x2f')],qs['fields'](_0x210484[_0x4c76('0x30')][_0x4c76('0x33')]));_0x15502d[_0x4c76('0x32')]=_0x15502d[_0x4c76('0x32')][_0x4c76('0x34')]?_0x15502d['attributes']:_0x4e0b23[_0x4c76('0x2f')];if(_0x210484[_0x4c76('0x30')]['includeAll']){_0x15502d[_0x4c76('0x40')]=[{'all':!![]}];}_0x15502d=_[_0x4c76('0x3d')]({},_0x15502d,_0x210484[_0x4c76('0x3e')]);return db['IntegrationReport'][_0x4c76('0x46')](_0x15502d)[_0x4c76('0x22')](handleEntityNotFound(_0xf3de90,null))['then'](respondWithResult(_0xf3de90,null))['catch'](handleError(_0xf3de90,null));};exports[_0x4c76('0x47')]=function(_0x4b1013,_0x44cbdd){return db[_0x4c76('0x2a')][_0x4c76('0x47')](_0x4b1013[_0x4c76('0x48')],{})[_0x4c76('0x22')](respondWithResult(_0x44cbdd,0xc9))[_0x4c76('0x43')](handleError(_0x44cbdd,null));};exports[_0x4c76('0x20')]=function(_0x51f5a2,_0x4b5905){if(_0x51f5a2[_0x4c76('0x48')]['id']){delete _0x51f5a2[_0x4c76('0x48')]['id'];}return db[_0x4c76('0x2a')]['find']({'where':{'id':_0x51f5a2[_0x4c76('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b5905,null))[_0x4c76('0x22')](saveUpdates(_0x51f5a2[_0x4c76('0x48')],null))[_0x4c76('0x22')](respondWithResult(_0x4b5905,null))[_0x4c76('0x43')](handleError(_0x4b5905,null));};exports[_0x4c76('0x21')]=function(_0x2e20d2,_0x356a3f){return db[_0x4c76('0x2a')][_0x4c76('0x46')]({'where':{'id':_0x2e20d2['params']['id']}})[_0x4c76('0x22')](handleEntityNotFound(_0x356a3f,null))[_0x4c76('0x22')](removeEntity(_0x356a3f,null))[_0x4c76('0x43')](handleError(_0x356a3f,null));};exports['describe']=function(_0x2c1713,_0x549c42){return db[_0x4c76('0x2a')][_0x4c76('0x49')]()[_0x4c76('0x22')](respondWithResult(_0x549c42,null))[_0x4c76('0x43')](handleError(_0x549c42,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2717a87..ab3e4a2 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 _0xaeda=['path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger','api','moment','bluebird'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xaeda,0xd7));var _0xaaed=function(_0x4d3f8c,_0x5afe5){_0x4d3f8c=_0x4d3f8c-0x0;var _0x322ab8=_0xaeda[_0x4d3f8c];return _0x322ab8;};'use strict';var _=require('lodash');var util=require(_0xaaed('0x0'));var logger=require(_0xaaed('0x1'))(_0xaaed('0x2'));var moment=require(_0xaaed('0x3'));var BPromise=require(_0xaaed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaed('0x5'));var rimraf=require('rimraf');var config=require(_0xaaed('0x6'));var attributes=require(_0xaaed('0x7'));module[_0xaaed('0x8')]=function(_0x47bcee,_0x169151){return _0x47bcee[_0xaaed('0x9')](_0xaaed('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd0=['bluebird','request-promise','rimraf','./integrationReport.attributes','exports','define','report_integration','lodash','util','../../config/logger','api'];(function(_0x561d54,_0x5ba9a4){var _0x56157a=function(_0x1963fc){while(--_0x1963fc){_0x561d54['push'](_0x561d54['shift']());}};_0x56157a(++_0x5ba9a4);}(_0x8fd0,0x172));var _0x08fd=function(_0x8c7dcb,_0xea478d){_0x8c7dcb=_0x8c7dcb-0x0;var _0x3952e5=_0x8fd0[_0x8c7dcb];return _0x3952e5;};'use strict';var _=require(_0x08fd('0x0'));var util=require(_0x08fd('0x1'));var logger=require(_0x08fd('0x2'))(_0x08fd('0x3'));var moment=require('moment');var BPromise=require(_0x08fd('0x4'));var rp=require(_0x08fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08fd('0x6'));var config=require('../../config/environment');var attributes=require(_0x08fd('0x7'));module[_0x08fd('0x8')]=function(_0x128ae3,_0x4d7ba4){return _0x128ae3[_0x08fd('0x9')]('IntegrationReport',attributes,{'tableName':_0x08fd('0xa'),'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 d6b79d6..25b52c8 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x3c05ab,_0x3166f4){var _0x245f5d=function(_0x1085b1){while(--_0x1085b1){_0x3c05ab['push'](_0x3c05ab['shift']());}};_0x245f5d(++_0x3166f4);}(_0xba34,0x119));var _0x4ba3=function(_0x442255,_0x514b94){_0x442255=_0x442255-0x0;var _0x5be790=_0xba34[_0x442255];return _0x5be790;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 9cb59d4..57a6a77 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 _0x195f=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','/:id','delete'];(function(_0x2683a3,_0x1f7613){var _0x18255a=function(_0x19da4e){while(--_0x19da4e){_0x2683a3['push'](_0x2683a3['shift']());}};_0x18255a(++_0x1f7613);}(_0x195f,0x113));var _0xf195=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0x195f[_0x597e38];return _0x5305d2;};'use strict';var multer=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var path=require('path');var timeout=require(_0xf195('0x2'));var express=require(_0xf195('0x3'));var router=express['Router']();var fs_extra=require(_0xf195('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf195('0x5'));var config=require(_0xf195('0x6'));var controller=require(_0xf195('0x7'));router[_0xf195('0x8')]('/',auth[_0xf195('0x9')](),controller[_0xf195('0xa')]);router[_0xf195('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf195('0xb')]);router[_0xf195('0x8')](_0xf195('0xc'),auth[_0xf195('0x9')](),controller[_0xf195('0xd')]);router[_0xf195('0xe')]('/',auth[_0xf195('0x9')](),controller['create']);router[_0xf195('0xe')](_0xf195('0xc'),auth[_0xf195('0x9')](),controller['addInterval']);router[_0xf195('0xe')](_0xf195('0xf'),auth[_0xf195('0x9')](),controller[_0xf195('0x10')]);router['put'](_0xf195('0x11'),auth[_0xf195('0x9')](),controller['update']);router[_0xf195('0x12')]('/:id',auth[_0xf195('0x9')](),controller[_0xf195('0x13')]);module[_0xf195('0x14')]=router; \ No newline at end of file +var _0x8917=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x8917,0x1d7));var _0x7891=function(_0x7386e5,_0x3db435){_0x7386e5=_0x7386e5-0x0;var _0x488c18=_0x8917[_0x7386e5];return _0x488c18;};'use strict';var multer=require(_0x7891('0x0'));var util=require('util');var path=require(_0x7891('0x1'));var timeout=require(_0x7891('0x2'));var express=require(_0x7891('0x3'));var router=express[_0x7891('0x4')]();var fs_extra=require(_0x7891('0x5'));var auth=require(_0x7891('0x6'));var interaction=require(_0x7891('0x7'));var config=require(_0x7891('0x8'));var controller=require(_0x7891('0x9'));router['get']('/',auth[_0x7891('0xa')](),controller[_0x7891('0xb')]);router[_0x7891('0xc')](_0x7891('0xd'),auth[_0x7891('0xa')](),controller[_0x7891('0xe')]);router['get'](_0x7891('0xf'),auth['isAuthenticated'](),controller[_0x7891('0x10')]);router[_0x7891('0x11')]('/',auth[_0x7891('0xa')](),controller[_0x7891('0x12')]);router[_0x7891('0x11')]('/:id/sub_intervals',auth[_0x7891('0xa')](),controller[_0x7891('0x13')]);router[_0x7891('0x11')]('/:id/sub_intervals/create_many',auth[_0x7891('0xa')](),controller[_0x7891('0x14')]);router[_0x7891('0x15')](_0x7891('0xd'),auth[_0x7891('0xa')](),controller['update']);router[_0x7891('0x16')](_0x7891('0xd'),auth[_0x7891('0xa')](),controller[_0x7891('0x17')]);module[_0x7891('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 80d799f..d4dda05 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 _0x848c=['STRING','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x848c,0x187));var _0xc848=function(_0x5f10d9,_0x16a7d5){_0x5f10d9=_0x5f10d9-0x0;var _0x1c7ec4=_0x848c[_0x5f10d9];return _0x1c7ec4;};'use strict';var Sequelize=require('sequelize');module[_0xc848('0x0')]={'name':{'type':Sequelize[_0xc848('0x1')]},'description':{'type':Sequelize[_0xc848('0x1')]},'interval':{'type':Sequelize[_0xc848('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xbcf6=['STRING','sequelize','exports'];(function(_0x108eca,_0x5980bc){var _0x1157ba=function(_0x4f3194){while(--_0x4f3194){_0x108eca['push'](_0x108eca['shift']());}};_0x1157ba(++_0x5980bc);}(_0xbcf6,0xfd));var _0x6bcf=function(_0x157c81,_0x2c0224){_0x157c81=_0x157c81-0x0;var _0x1bfb12=_0xbcf6[_0x157c81];return _0x1bfb12;};'use strict';var Sequelize=require(_0x6bcf('0x0'));module[_0x6bcf('0x1')]={'name':{'type':Sequelize[_0x6bcf('0x2')]},'description':{'type':Sequelize[_0x6bcf('0x2')]},'interval':{'type':Sequelize[_0x6bcf('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index d772bde..57348fb 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 _0x6438=['findOne','options','nolimit','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6438,0xc2));var _0x8643=function(_0x5a69af,_0x24a0e8){_0x5a69af=_0x5a69af-0x0;var _0x59b0d5=_0x6438[_0x5a69af];return _0x59b0d5;};'use strict';var emlformat=require(_0x8643('0x0'));var rimraf=require(_0x8643('0x1'));var zipdir=require(_0x8643('0x2'));var jsonpatch=require(_0x8643('0x3'));var rp=require(_0x8643('0x4'));var moment=require(_0x8643('0x5'));var BPromise=require(_0x8643('0x6'));var Mustache=require(_0x8643('0x7'));var util=require(_0x8643('0x8'));var path=require(_0x8643('0x9'));var sox=require(_0x8643('0xa'));var csv=require(_0x8643('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8643('0xc'));var _=require('lodash');var squel=require(_0x8643('0xd'));var crypto=require(_0x8643('0xe'));var jsforce=require(_0x8643('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8643('0xb'));var querystring=require(_0x8643('0x10'));var Papa=require(_0x8643('0x11'));var Redis=require(_0x8643('0x12'));var authService=require(_0x8643('0x13'));var qs=require(_0x8643('0x14'));var as=require(_0x8643('0x15'));var hardwareService=require(_0x8643('0x16'));var logger=require(_0x8643('0x17'))(_0x8643('0x18'));var utils=require(_0x8643('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8643('0x1a'));var db=require(_0x8643('0x1b'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x56d161,_0x3a1b36){_0x3a1b36=_0x3a1b36||0xcc;return function(_0x4f43d2){if(_0x4f43d2){return _0x56d161[_0x8643('0x1c')](_0x3a1b36);}return _0x56d161[_0x8643('0x1d')](_0x3a1b36)[_0x8643('0x1e')]();};}function respondWithResult(_0x3842fc,_0x41a53b){_0x41a53b=_0x41a53b||0xc8;return function(_0x598d3b){if(_0x598d3b){return _0x3842fc[_0x8643('0x1d')](_0x41a53b)[_0x8643('0x1f')](_0x598d3b);}};}function respondWithFilteredResult(_0x5edfd0,_0x535414){return function(_0x2fe3c2){if(_0x2fe3c2){var _0x557ebe=typeof _0x535414[_0x8643('0x20')]===_0x8643('0x21')&&typeof _0x535414[_0x8643('0x22')]===_0x8643('0x21');var _0xb13bb5=_0x2fe3c2[_0x8643('0x23')];var _0x595201=_0x557ebe?0x0:_0x535414[_0x8643('0x20')];var _0x4208c5=_0x557ebe?_0x2fe3c2[_0x8643('0x23')]:_0x535414[_0x8643('0x20')]+_0x535414[_0x8643('0x22')];var _0x11fd90;if(_0x4208c5>=_0xb13bb5){_0x4208c5=_0xb13bb5;_0x11fd90=0xc8;}else{_0x11fd90=0xce;}_0x5edfd0['status'](_0x11fd90);return _0x5edfd0['set']('Content-Range',_0x595201+'-'+_0x4208c5+'/'+_0xb13bb5)['json'](_0x2fe3c2);}return null;};}function patchUpdates(_0x3007f8){return function(_0x3e02e5){try{jsonpatch[_0x8643('0x24')](_0x3e02e5,_0x3007f8,!![]);}catch(_0x281029){return BPromise[_0x8643('0x25')](_0x281029);}return _0x3e02e5['save']();};}function saveUpdates(_0x4ca1bd,_0x46c7ec){return function(_0x23b1d4){if(_0x23b1d4){return _0x23b1d4[_0x8643('0x26')](_0x4ca1bd)['then'](function(_0x22320c){return _0x22320c;});}return null;};}function removeEntity(_0x198def,_0x1f2eab){return function(_0x215fce){if(_0x215fce){return _0x215fce[_0x8643('0x27')]()[_0x8643('0x28')](function(){var _0x96cf5a=_0x215fce['get']({'plain':!![]});var _0x25bf96='Intervals';return db[_0x8643('0x29')][_0x8643('0x27')]({'where':{'type':_0x25bf96,'resourceId':_0x96cf5a['id']}})[_0x8643('0x28')](function(){return _0x215fce;});})[_0x8643('0x28')](function(){_0x198def[_0x8643('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39dd5a,_0x4dc105){return function(_0x5160ea){if(!_0x5160ea){_0x39dd5a[_0x8643('0x1c')](0x194);}return _0x5160ea;};}function handleError(_0x10b7b2,_0x4aeb97){_0x4aeb97=_0x4aeb97||0x1f4;return function(_0x1d98cf){logger[_0x8643('0x2a')](_0x1d98cf[_0x8643('0x2b')]);if(_0x1d98cf[_0x8643('0x2c')]){delete _0x1d98cf['name'];}_0x10b7b2[_0x8643('0x1d')](_0x4aeb97)['send'](_0x1d98cf);};}exports[_0x8643('0x2d')]=function(_0xbb11d3,_0x276851){var _0x15c511={},_0x1f73bd={},_0x240f94={'count':0x0,'rows':[]};var _0x37104c=_[_0x8643('0x2e')](db[_0x8643('0x2f')][_0x8643('0x30')],function(_0x56dc43){return{'name':_0x56dc43[_0x8643('0x31')],'type':_0x56dc43[_0x8643('0x32')][_0x8643('0x33')]};});_0x1f73bd['model']=_['map'](_0x37104c,'name');_0x1f73bd[_0x8643('0x34')]=_['keys'](_0xbb11d3[_0x8643('0x34')]);_0x1f73bd[_0x8643('0x35')]=_[_0x8643('0x36')](_0x1f73bd[_0x8643('0x37')],_0x1f73bd[_0x8643('0x34')]);_0x15c511[_0x8643('0x38')]=_[_0x8643('0x36')](_0x1f73bd['model'],qs[_0x8643('0x39')](_0xbb11d3[_0x8643('0x34')][_0x8643('0x39')]));_0x15c511[_0x8643('0x38')]=_0x15c511['attributes'][_0x8643('0x3a')]?_0x15c511[_0x8643('0x38')]:_0x1f73bd[_0x8643('0x37')];if(!_0xbb11d3[_0x8643('0x34')][_0x8643('0x3b')]('nolimit')){_0x15c511['limit']=qs[_0x8643('0x22')](_0xbb11d3[_0x8643('0x34')][_0x8643('0x22')]);_0x15c511[_0x8643('0x20')]=qs[_0x8643('0x20')](_0xbb11d3[_0x8643('0x34')][_0x8643('0x20')]);}_0x15c511[_0x8643('0x3c')]=qs[_0x8643('0x3d')](_0xbb11d3[_0x8643('0x34')][_0x8643('0x3d')]);_0x15c511[_0x8643('0x3e')]=qs[_0x8643('0x35')](_[_0x8643('0x3f')](_0xbb11d3[_0x8643('0x34')],_0x1f73bd['filters']),_0x37104c);if(_0xbb11d3['query']['filter']){_0x15c511['where']=_[_0x8643('0x40')](_0x15c511[_0x8643('0x3e')],{'$or':_[_0x8643('0x2e')](_0x37104c,function(_0x318d55){if(_0x318d55[_0x8643('0x32')]!=='VIRTUAL'){var _0x2ab23e={};_0x2ab23e[_0x318d55[_0x8643('0x2c')]]={'$like':'%'+_0xbb11d3[_0x8643('0x34')][_0x8643('0x41')]+'%'};return _0x2ab23e;}})});}_0x15c511=_[_0x8643('0x40')]({},_0x15c511,_0xbb11d3['options']);var _0x4b884b={'where':_0x15c511[_0x8643('0x3e')]};return db['Interval'][_0x8643('0x23')](_0x4b884b)[_0x8643('0x28')](function(_0x47fe74){_0x240f94[_0x8643('0x23')]=_0x47fe74;if(_0xbb11d3[_0x8643('0x34')][_0x8643('0x42')]){_0x15c511[_0x8643('0x43')]=[{'all':!![]}];}return db[_0x8643('0x2f')]['findAll'](_0x15c511);})[_0x8643('0x28')](function(_0x582d88){_0x240f94[_0x8643('0x44')]=_0x582d88;return _0x240f94;})[_0x8643('0x28')](respondWithFilteredResult(_0x276851,_0x15c511))[_0x8643('0x45')](handleError(_0x276851,null));};exports[_0x8643('0x46')]=function(_0x1a5d18,_0x5cc4c1){var _0x1a5e70={'raw':!![],'where':{'id':_0x1a5d18[_0x8643('0x47')]['id']}},_0x5c80f6={};_0x5c80f6[_0x8643('0x37')]=_[_0x8643('0x48')](db[_0x8643('0x2f')][_0x8643('0x30')]);_0x5c80f6[_0x8643('0x34')]=_[_0x8643('0x48')](_0x1a5d18[_0x8643('0x34')]);_0x5c80f6[_0x8643('0x35')]=_[_0x8643('0x36')](_0x5c80f6[_0x8643('0x37')],_0x5c80f6[_0x8643('0x34')]);_0x1a5e70[_0x8643('0x38')]=_[_0x8643('0x36')](_0x5c80f6[_0x8643('0x37')],qs[_0x8643('0x39')](_0x1a5d18[_0x8643('0x34')]['fields']));_0x1a5e70['attributes']=_0x1a5e70[_0x8643('0x38')]['length']?_0x1a5e70[_0x8643('0x38')]:_0x5c80f6[_0x8643('0x37')];if(_0x1a5d18[_0x8643('0x34')]['includeAll']){_0x1a5e70[_0x8643('0x43')]=[{'all':!![]}];}_0x1a5e70=_[_0x8643('0x40')]({},_0x1a5e70,_0x1a5d18['options']);return db[_0x8643('0x2f')][_0x8643('0x49')](_0x1a5e70)[_0x8643('0x28')](handleEntityNotFound(_0x5cc4c1,null))[_0x8643('0x28')](respondWithResult(_0x5cc4c1,null))[_0x8643('0x45')](handleError(_0x5cc4c1,null));};exports[_0x8643('0x4a')]=function(_0x3820ef,_0x5524e2){return db['Interval'][_0x8643('0x4a')](_0x3820ef[_0x8643('0x4b')],{})[_0x8643('0x28')](function(_0x1ebadc){var _0xafe08c=_0x3820ef['user'][_0x8643('0x4c')]({'plain':!![]});if(!_0xafe08c)throw new Error(_0x8643('0x4d'));if(_0xafe08c[_0x8643('0x4e')]===_0x8643('0x4f')){var _0x5a118a=_0x1ebadc[_0x8643('0x4c')]({'plain':!![]});var _0x1b7376=_0x8643('0x50');return db[_0x8643('0x51')][_0x8643('0x49')]({'where':{'name':_0x1b7376,'userProfileId':_0xafe08c[_0x8643('0x52')]},'raw':!![]})[_0x8643('0x28')](function(_0x405f96){if(_0x405f96&&_0x405f96[_0x8643('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a118a[_0x8643('0x2c')],'resourceId':_0x5a118a['id'],'type':_0x405f96[_0x8643('0x2c')],'sectionId':_0x405f96['id']},{})[_0x8643('0x28')](function(){return _0x1ebadc;});}else{return _0x1ebadc;}})['catch'](function(_0x5aef09){logger[_0x8643('0x2a')](_0x8643('0x54'),_0x5aef09);throw _0x5aef09;});}return _0x1ebadc;})[_0x8643('0x28')](respondWithResult(_0x5524e2,0xc9))[_0x8643('0x45')](handleError(_0x5524e2,null));};exports[_0x8643('0x26')]=function(_0x2f6898,_0x4d7720){if(_0x2f6898[_0x8643('0x4b')]['id']){delete _0x2f6898[_0x8643('0x4b')]['id'];}return db[_0x8643('0x2f')]['find']({'where':{'id':_0x2f6898[_0x8643('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d7720,null))[_0x8643('0x28')](saveUpdates(_0x2f6898['body'],null))[_0x8643('0x28')](respondWithResult(_0x4d7720,null))[_0x8643('0x45')](handleError(_0x4d7720,null));};exports[_0x8643('0x27')]=function(_0x2f3251,_0x37798a){return db[_0x8643('0x2f')]['find']({'where':{'id':_0x2f3251['params']['id']}})[_0x8643('0x28')](handleEntityNotFound(_0x37798a,null))[_0x8643('0x28')](removeEntity(_0x37798a,null))[_0x8643('0x45')](handleError(_0x37798a,null));};exports[_0x8643('0x55')]=function(_0x1706ec,_0x13c118,_0x11eb3d){if(_0x1706ec[_0x8643('0x4b')]['id']){delete _0x1706ec['body']['id'];}return db[_0x8643('0x2f')][_0x8643('0x49')]({'where':{'id':_0x1706ec[_0x8643('0x47')]['id']}})[_0x8643('0x28')](handleEntityNotFound(_0x13c118,null))[_0x8643('0x28')](function(_0x2d81d2){if(_0x2d81d2){_0x1706ec[_0x8643('0x4b')][_0x8643('0x56')]=_0x2d81d2['id'];return db['Interval'][_0x8643('0x4a')](_0x1706ec[_0x8643('0x4b')]);}})[_0x8643('0x28')](respondWithResult(_0x13c118,null))['catch'](handleError(_0x13c118,null));};exports[_0x8643('0x57')]=function(_0x2e598d,_0x275c40,_0x1724fb){var _0x344c7c={};var _0x164164={};var _0x152284;var _0x50f62c;return db['Interval'][_0x8643('0x58')]({'where':{'id':_0x2e598d[_0x8643('0x47')]['id']}})[_0x8643('0x28')](handleEntityNotFound(_0x275c40,null))[_0x8643('0x28')](function(_0x36e2da){if(_0x36e2da){_0x152284=_0x36e2da;_0x164164[_0x8643('0x37')]=_[_0x8643('0x48')](db[_0x8643('0x2f')][_0x8643('0x30')]);_0x164164['query']=_[_0x8643('0x48')](_0x2e598d[_0x8643('0x34')]);_0x164164[_0x8643('0x35')]=_[_0x8643('0x36')](_0x164164[_0x8643('0x37')],_0x164164[_0x8643('0x34')]);_0x344c7c[_0x8643('0x38')]=_[_0x8643('0x36')](_0x164164[_0x8643('0x37')],qs[_0x8643('0x39')](_0x2e598d[_0x8643('0x34')][_0x8643('0x39')]));_0x344c7c[_0x8643('0x38')]=_0x344c7c[_0x8643('0x38')][_0x8643('0x3a')]?_0x344c7c[_0x8643('0x38')]:_0x164164[_0x8643('0x37')];_0x344c7c[_0x8643('0x3c')]=qs['sort'](_0x2e598d[_0x8643('0x34')][_0x8643('0x3d')]);_0x344c7c[_0x8643('0x3e')]=qs['filters'](_[_0x8643('0x3f')](_0x2e598d[_0x8643('0x34')],_0x164164['filters']));if(_0x2e598d[_0x8643('0x34')][_0x8643('0x41')]){_0x344c7c[_0x8643('0x3e')]=_['merge'](_0x344c7c[_0x8643('0x3e')],{'$or':_[_0x8643('0x2e')](_0x344c7c['attributes'],function(_0x173145){var _0x31516c={};_0x31516c[_0x173145]={'$like':'%'+_0x2e598d[_0x8643('0x34')][_0x8643('0x41')]+'%'};return _0x31516c;})});}_0x344c7c=_[_0x8643('0x40')]({},_0x344c7c,_0x2e598d[_0x8643('0x59')]);return _0x152284[_0x8643('0x57')](_0x344c7c);}})[_0x8643('0x28')](function(_0x5b7e55){if(_0x5b7e55){_0x50f62c=_0x5b7e55[_0x8643('0x3a')];if(!_0x2e598d[_0x8643('0x34')][_0x8643('0x3b')](_0x8643('0x5a'))){_0x344c7c['limit']=qs['limit'](_0x2e598d[_0x8643('0x34')][_0x8643('0x22')]);_0x344c7c['offset']=qs['offset'](_0x2e598d[_0x8643('0x34')]['offset']);}return _0x152284[_0x8643('0x57')](_0x344c7c);}})['then'](function(_0x26fd6f){if(_0x26fd6f){return _0x26fd6f?{'count':_0x50f62c,'rows':_0x26fd6f}:null;}})[_0x8643('0x28')](respondWithResult(_0x275c40,null))[_0x8643('0x45')](handleError(_0x275c40,null));};exports['addIntervals']=function(_0x3c1522,_0x1d6076,_0x5c8b28){return db[_0x8643('0x2f')]['findOne']({'where':{'id':_0x3c1522[_0x8643('0x47')]['id']}})[_0x8643('0x28')](handleEntityNotFound(_0x1d6076,null))[_0x8643('0x28')](function(_0x2b531e){if(_0x2b531e){return db[_0x8643('0x5b')][_0x8643('0x5c')](function(_0x450bbd){return db[_0x8643('0x2f')][_0x8643('0x27')]({'where':{'IntervalId':_0x3c1522[_0x8643('0x47')]['id']},'transaction':_0x450bbd})[_0x8643('0x28')](function(_0x233792){var _0xe996d1=_[_0x8643('0x2e')](_0x3c1522[_0x8643('0x4b')],function(_0x9d806c){delete _0x9d806c['id'];_0x9d806c['IntervalId']=_0x3c1522[_0x8643('0x47')]['id'];return _0x9d806c;});return db[_0x8643('0x2f')][_0x8643('0x5d')](_0xe996d1,{'transaction':_0x450bbd});});})[_0x8643('0x28')](function(){return db[_0x8643('0x2f')]['findAll']({'where':{'IntervalId':_0x3c1522[_0x8643('0x47')]['id']}});});}})[_0x8643('0x28')](respondWithResult(_0x1d6076,null))[_0x8643('0x45')](handleError(_0x1d6076,null));}; \ No newline at end of file +var _0xaff9=['where','merge','VIRTUAL','Interval','includeAll','findAll','rows','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','rawAttributes','options','sequelize','bulkCreate','eml-format','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','error','stack','name','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xaff9,0x67));var _0x9aff=function(_0x371735,_0x4ac5d4){_0x371735=_0x371735-0x0;var _0x22a153=_0xaff9[_0x371735];return _0x22a153;};'use strict';var emlformat=require(_0x9aff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9aff('0x1'));var rp=require(_0x9aff('0x2'));var moment=require(_0x9aff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9aff('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9aff('0x5'));var ejs=require(_0x9aff('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9aff('0x7'));var squel=require(_0x9aff('0x8'));var crypto=require(_0x9aff('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9aff('0x5'));var querystring=require(_0x9aff('0xa'));var Papa=require(_0x9aff('0xb'));var Redis=require('ioredis');var authService=require(_0x9aff('0xc'));var qs=require(_0x9aff('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9aff('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x9aff('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0xa871fb,_0x9144e5){_0x9144e5=_0x9144e5||0xcc;return function(_0x56852b){if(_0x56852b){return _0xa871fb['sendStatus'](_0x9144e5);}return _0xa871fb[_0x9aff('0x10')](_0x9144e5)[_0x9aff('0x11')]();};}function respondWithResult(_0xc100f5,_0x2bb7e0){_0x2bb7e0=_0x2bb7e0||0xc8;return function(_0x39c893){if(_0x39c893){return _0xc100f5[_0x9aff('0x10')](_0x2bb7e0)[_0x9aff('0x12')](_0x39c893);}};}function respondWithFilteredResult(_0x2295c1,_0x5c0367){return function(_0x97efa8){if(_0x97efa8){var _0x4046bb=typeof _0x5c0367['offset']===_0x9aff('0x13')&&typeof _0x5c0367[_0x9aff('0x14')]===_0x9aff('0x13');var _0xc81687=_0x97efa8[_0x9aff('0x15')];var _0x5251be=_0x4046bb?0x0:_0x5c0367[_0x9aff('0x16')];var _0x2d816b=_0x4046bb?_0x97efa8['count']:_0x5c0367[_0x9aff('0x16')]+_0x5c0367[_0x9aff('0x14')];var _0x514a03;if(_0x2d816b>=_0xc81687){_0x2d816b=_0xc81687;_0x514a03=0xc8;}else{_0x514a03=0xce;}_0x2295c1[_0x9aff('0x10')](_0x514a03);return _0x2295c1[_0x9aff('0x17')]('Content-Range',_0x5251be+'-'+_0x2d816b+'/'+_0xc81687)[_0x9aff('0x12')](_0x97efa8);}return null;};}function patchUpdates(_0x4a707e){return function(_0x1bcad4){try{jsonpatch[_0x9aff('0x18')](_0x1bcad4,_0x4a707e,!![]);}catch(_0x23a94b){return BPromise[_0x9aff('0x19')](_0x23a94b);}return _0x1bcad4[_0x9aff('0x1a')]();};}function saveUpdates(_0xc0ec04,_0x9df17d){return function(_0xf1c5e8){if(_0xf1c5e8){return _0xf1c5e8['update'](_0xc0ec04)[_0x9aff('0x1b')](function(_0x322769){return _0x322769;});}return null;};}function removeEntity(_0x41a768,_0x2e66be){return function(_0xe94c1d){if(_0xe94c1d){return _0xe94c1d[_0x9aff('0x1c')]()[_0x9aff('0x1b')](function(){var _0x156a16=_0xe94c1d[_0x9aff('0x1d')]({'plain':!![]});var _0x53b2c4=_0x9aff('0x1e');return db[_0x9aff('0x1f')]['destroy']({'where':{'type':_0x53b2c4,'resourceId':_0x156a16['id']}})['then'](function(){return _0xe94c1d;});})[_0x9aff('0x1b')](function(){_0x41a768[_0x9aff('0x10')](0xcc)[_0x9aff('0x11')]();});}};}function handleEntityNotFound(_0x1fb5a5,_0xde048){return function(_0x3296ac){if(!_0x3296ac){_0x1fb5a5['sendStatus'](0x194);}return _0x3296ac;};}function handleError(_0x1b4db8,_0x25fc92){_0x25fc92=_0x25fc92||0x1f4;return function(_0x2edcaf){logger[_0x9aff('0x20')](_0x2edcaf[_0x9aff('0x21')]);if(_0x2edcaf[_0x9aff('0x22')]){delete _0x2edcaf[_0x9aff('0x22')];}_0x1b4db8[_0x9aff('0x10')](_0x25fc92)['send'](_0x2edcaf);};}exports['index']=function(_0x44ab19,_0x434d89){var _0x1079f3={},_0x24ff6c={},_0x34210b={'count':0x0,'rows':[]};var _0x3d260c=_[_0x9aff('0x23')](db['Interval']['rawAttributes'],function(_0x186c52){return{'name':_0x186c52[_0x9aff('0x24')],'type':_0x186c52[_0x9aff('0x25')][_0x9aff('0x26')]};});_0x24ff6c['model']=_[_0x9aff('0x23')](_0x3d260c,_0x9aff('0x22'));_0x24ff6c[_0x9aff('0x27')]=_[_0x9aff('0x28')](_0x44ab19[_0x9aff('0x27')]);_0x24ff6c['filters']=_[_0x9aff('0x29')](_0x24ff6c[_0x9aff('0x2a')],_0x24ff6c[_0x9aff('0x27')]);_0x1079f3['attributes']=_[_0x9aff('0x29')](_0x24ff6c['model'],qs[_0x9aff('0x2b')](_0x44ab19[_0x9aff('0x27')]['fields']));_0x1079f3[_0x9aff('0x2c')]=_0x1079f3[_0x9aff('0x2c')][_0x9aff('0x2d')]?_0x1079f3[_0x9aff('0x2c')]:_0x24ff6c['model'];if(!_0x44ab19['query'][_0x9aff('0x2e')](_0x9aff('0x2f'))){_0x1079f3[_0x9aff('0x14')]=qs[_0x9aff('0x14')](_0x44ab19['query'][_0x9aff('0x14')]);_0x1079f3[_0x9aff('0x16')]=qs[_0x9aff('0x16')](_0x44ab19[_0x9aff('0x27')][_0x9aff('0x16')]);}_0x1079f3[_0x9aff('0x30')]=qs[_0x9aff('0x31')](_0x44ab19['query'][_0x9aff('0x31')]);_0x1079f3['where']=qs['filters'](_[_0x9aff('0x32')](_0x44ab19['query'],_0x24ff6c[_0x9aff('0x33')]),_0x3d260c);if(_0x44ab19['query'][_0x9aff('0x34')]){_0x1079f3[_0x9aff('0x35')]=_[_0x9aff('0x36')](_0x1079f3[_0x9aff('0x35')],{'$or':_[_0x9aff('0x23')](_0x3d260c,function(_0xa2571d){if(_0xa2571d[_0x9aff('0x25')]!==_0x9aff('0x37')){var _0x37056e={};_0x37056e[_0xa2571d[_0x9aff('0x22')]]={'$like':'%'+_0x44ab19[_0x9aff('0x27')][_0x9aff('0x34')]+'%'};return _0x37056e;}})});}_0x1079f3=_[_0x9aff('0x36')]({},_0x1079f3,_0x44ab19['options']);var _0x4cb5bb={'where':_0x1079f3['where']};return db[_0x9aff('0x38')][_0x9aff('0x15')](_0x4cb5bb)[_0x9aff('0x1b')](function(_0x20ff3a){_0x34210b['count']=_0x20ff3a;if(_0x44ab19[_0x9aff('0x27')][_0x9aff('0x39')]){_0x1079f3['include']=[{'all':!![]}];}return db[_0x9aff('0x38')][_0x9aff('0x3a')](_0x1079f3);})['then'](function(_0x313fbd){_0x34210b[_0x9aff('0x3b')]=_0x313fbd;return _0x34210b;})[_0x9aff('0x1b')](respondWithFilteredResult(_0x434d89,_0x1079f3))['catch'](handleError(_0x434d89,null));};exports['show']=function(_0x504fcd,_0xf606dd){var _0x1d1df4={'raw':!![],'where':{'id':_0x504fcd[_0x9aff('0x3c')]['id']}},_0x5453ea={};_0x5453ea[_0x9aff('0x2a')]=_['keys'](db[_0x9aff('0x38')]['rawAttributes']);_0x5453ea[_0x9aff('0x27')]=_[_0x9aff('0x28')](_0x504fcd[_0x9aff('0x27')]);_0x5453ea[_0x9aff('0x33')]=_[_0x9aff('0x29')](_0x5453ea[_0x9aff('0x2a')],_0x5453ea[_0x9aff('0x27')]);_0x1d1df4[_0x9aff('0x2c')]=_[_0x9aff('0x29')](_0x5453ea[_0x9aff('0x2a')],qs[_0x9aff('0x2b')](_0x504fcd[_0x9aff('0x27')][_0x9aff('0x2b')]));_0x1d1df4[_0x9aff('0x2c')]=_0x1d1df4[_0x9aff('0x2c')][_0x9aff('0x2d')]?_0x1d1df4[_0x9aff('0x2c')]:_0x5453ea['model'];if(_0x504fcd[_0x9aff('0x27')][_0x9aff('0x39')]){_0x1d1df4[_0x9aff('0x3d')]=[{'all':!![]}];}_0x1d1df4=_['merge']({},_0x1d1df4,_0x504fcd['options']);return db[_0x9aff('0x38')][_0x9aff('0x3e')](_0x1d1df4)[_0x9aff('0x1b')](handleEntityNotFound(_0xf606dd,null))[_0x9aff('0x1b')](respondWithResult(_0xf606dd,null))[_0x9aff('0x3f')](handleError(_0xf606dd,null));};exports[_0x9aff('0x40')]=function(_0x538beb,_0x494fb3){return db['Interval'][_0x9aff('0x40')](_0x538beb[_0x9aff('0x41')],{})[_0x9aff('0x1b')](function(_0x2a9965){var _0xfda84b=_0x538beb[_0x9aff('0x42')][_0x9aff('0x1d')]({'plain':!![]});if(!_0xfda84b)throw new Error(_0x9aff('0x43'));if(_0xfda84b[_0x9aff('0x44')]===_0x9aff('0x42')){var _0x229fa5=_0x2a9965[_0x9aff('0x1d')]({'plain':!![]});var _0x957f14=_0x9aff('0x1e');return db['UserProfileSection'][_0x9aff('0x3e')]({'where':{'name':_0x957f14,'userProfileId':_0xfda84b['userProfileId']},'raw':!![]})[_0x9aff('0x1b')](function(_0x323a8e){if(_0x323a8e&&_0x323a8e[_0x9aff('0x45')]===0x0){return db['UserProfileResource'][_0x9aff('0x40')]({'name':_0x229fa5[_0x9aff('0x22')],'resourceId':_0x229fa5['id'],'type':_0x323a8e[_0x9aff('0x22')],'sectionId':_0x323a8e['id']},{})['then'](function(){return _0x2a9965;});}else{return _0x2a9965;}})[_0x9aff('0x3f')](function(_0xf08173){logger[_0x9aff('0x20')](_0x9aff('0x46'),_0xf08173);throw _0xf08173;});}return _0x2a9965;})['then'](respondWithResult(_0x494fb3,0xc9))[_0x9aff('0x3f')](handleError(_0x494fb3,null));};exports['update']=function(_0x136c6e,_0x509c8e){if(_0x136c6e[_0x9aff('0x41')]['id']){delete _0x136c6e['body']['id'];}return db[_0x9aff('0x38')]['find']({'where':{'id':_0x136c6e['params']['id']}})[_0x9aff('0x1b')](handleEntityNotFound(_0x509c8e,null))['then'](saveUpdates(_0x136c6e[_0x9aff('0x41')],null))[_0x9aff('0x1b')](respondWithResult(_0x509c8e,null))[_0x9aff('0x3f')](handleError(_0x509c8e,null));};exports[_0x9aff('0x1c')]=function(_0x43d72f,_0x4f3296){return db[_0x9aff('0x38')][_0x9aff('0x3e')]({'where':{'id':_0x43d72f[_0x9aff('0x3c')]['id']}})[_0x9aff('0x1b')](handleEntityNotFound(_0x4f3296,null))[_0x9aff('0x1b')](removeEntity(_0x4f3296,null))['catch'](handleError(_0x4f3296,null));};exports['addInterval']=function(_0x4348af,_0x113003,_0x2804bb){if(_0x4348af[_0x9aff('0x41')]['id']){delete _0x4348af[_0x9aff('0x41')]['id'];}return db['Interval']['find']({'where':{'id':_0x4348af[_0x9aff('0x3c')]['id']}})[_0x9aff('0x1b')](handleEntityNotFound(_0x113003,null))[_0x9aff('0x1b')](function(_0x5ca751){if(_0x5ca751){_0x4348af[_0x9aff('0x41')][_0x9aff('0x47')]=_0x5ca751['id'];return db[_0x9aff('0x38')][_0x9aff('0x40')](_0x4348af[_0x9aff('0x41')]);}})[_0x9aff('0x1b')](respondWithResult(_0x113003,null))['catch'](handleError(_0x113003,null));};exports[_0x9aff('0x48')]=function(_0x13f495,_0x10a1f7,_0x458f4f){var _0x570f32={};var _0x431451={};var _0x21a122;var _0x46cbcc;return db['Interval'][_0x9aff('0x49')]({'where':{'id':_0x13f495[_0x9aff('0x3c')]['id']}})[_0x9aff('0x1b')](handleEntityNotFound(_0x10a1f7,null))[_0x9aff('0x1b')](function(_0x6c7cb9){if(_0x6c7cb9){_0x21a122=_0x6c7cb9;_0x431451[_0x9aff('0x2a')]=_[_0x9aff('0x28')](db['Interval'][_0x9aff('0x4a')]);_0x431451[_0x9aff('0x27')]=_[_0x9aff('0x28')](_0x13f495[_0x9aff('0x27')]);_0x431451[_0x9aff('0x33')]=_[_0x9aff('0x29')](_0x431451['model'],_0x431451[_0x9aff('0x27')]);_0x570f32[_0x9aff('0x2c')]=_[_0x9aff('0x29')](_0x431451[_0x9aff('0x2a')],qs['fields'](_0x13f495[_0x9aff('0x27')][_0x9aff('0x2b')]));_0x570f32[_0x9aff('0x2c')]=_0x570f32['attributes'][_0x9aff('0x2d')]?_0x570f32[_0x9aff('0x2c')]:_0x431451[_0x9aff('0x2a')];_0x570f32[_0x9aff('0x30')]=qs['sort'](_0x13f495[_0x9aff('0x27')]['sort']);_0x570f32['where']=qs['filters'](_['pick'](_0x13f495[_0x9aff('0x27')],_0x431451['filters']));if(_0x13f495[_0x9aff('0x27')][_0x9aff('0x34')]){_0x570f32[_0x9aff('0x35')]=_[_0x9aff('0x36')](_0x570f32[_0x9aff('0x35')],{'$or':_['map'](_0x570f32[_0x9aff('0x2c')],function(_0x50f628){var _0x2e456e={};_0x2e456e[_0x50f628]={'$like':'%'+_0x13f495[_0x9aff('0x27')][_0x9aff('0x34')]+'%'};return _0x2e456e;})});}_0x570f32=_['merge']({},_0x570f32,_0x13f495[_0x9aff('0x4b')]);return _0x21a122[_0x9aff('0x48')](_0x570f32);}})[_0x9aff('0x1b')](function(_0x4d58f8){if(_0x4d58f8){_0x46cbcc=_0x4d58f8[_0x9aff('0x2d')];if(!_0x13f495['query'][_0x9aff('0x2e')](_0x9aff('0x2f'))){_0x570f32[_0x9aff('0x14')]=qs[_0x9aff('0x14')](_0x13f495[_0x9aff('0x27')][_0x9aff('0x14')]);_0x570f32[_0x9aff('0x16')]=qs[_0x9aff('0x16')](_0x13f495[_0x9aff('0x27')]['offset']);}return _0x21a122['getIntervals'](_0x570f32);}})[_0x9aff('0x1b')](function(_0x53d6d0){if(_0x53d6d0){return _0x53d6d0?{'count':_0x46cbcc,'rows':_0x53d6d0}:null;}})[_0x9aff('0x1b')](respondWithResult(_0x10a1f7,null))[_0x9aff('0x3f')](handleError(_0x10a1f7,null));};exports['addIntervals']=function(_0x15fc9c,_0x4cd673,_0x2ca252){return db[_0x9aff('0x38')][_0x9aff('0x49')]({'where':{'id':_0x15fc9c[_0x9aff('0x3c')]['id']}})[_0x9aff('0x1b')](handleEntityNotFound(_0x4cd673,null))['then'](function(_0x10c843){if(_0x10c843){return db[_0x9aff('0x4c')]['transaction'](function(_0x30c965){return db[_0x9aff('0x38')]['destroy']({'where':{'IntervalId':_0x15fc9c[_0x9aff('0x3c')]['id']},'transaction':_0x30c965})[_0x9aff('0x1b')](function(_0x1378a9){var _0x2ad970=_[_0x9aff('0x23')](_0x15fc9c[_0x9aff('0x41')],function(_0x5c6723){delete _0x5c6723['id'];_0x5c6723[_0x9aff('0x47')]=_0x15fc9c[_0x9aff('0x3c')]['id'];return _0x5c6723;});return db[_0x9aff('0x38')][_0x9aff('0x4d')](_0x2ad970,{'transaction':_0x30c965});});})['then'](function(){return db[_0x9aff('0x38')][_0x9aff('0x3a')]({'where':{'IntervalId':_0x15fc9c['params']['id']}});});}})[_0x9aff('0x1b')](respondWithResult(_0x4cd673,null))[_0x9aff('0x3f')](handleError(_0x4cd673,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 03e2add..19275c0 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 _0x9d1c=['Interval','tools_intervals','rewrite','lodash','api','moment','bluebird','request-promise','path','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x3fe26a,_0xe680e3){var _0x305900=function(_0x2bf94e){while(--_0x2bf94e){_0x3fe26a['push'](_0x3fe26a['shift']());}};_0x305900(++_0xe680e3);}(_0x9d1c,0xb9));var _0xc9d1=function(_0x39d60d,_0x5f14b6){_0x39d60d=_0x39d60d-0x0;var _0x1b086a=_0x9d1c[_0x39d60d];return _0x1b086a;};'use strict';var _=require(_0xc9d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9d1('0x1'));var moment=require(_0xc9d1('0x2'));var BPromise=require(_0xc9d1('0x3'));var rp=require(_0xc9d1('0x4'));var fs=require('fs');var path=require(_0xc9d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9d1('0x6'));var extensions=require(_0xc9d1('0x7'));module[_0xc9d1('0x8')]=function(_0x5b3012,_0x39e563){return _0x5b3012[_0xc9d1('0x9')](_0xc9d1('0xa'),attributes,{'tableName':_0xc9d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1607ec,_0xb5e0cd){extensions['rewrite'](_0x5b3012,_0x1607ec);},'afterBulkCreate':function(_0x38da4d,_0x36fcec,_0x5bbc6c){_0x5bbc6c();extensions[_0xc9d1('0xc')](_0x5b3012,_0x38da4d[0x0]);},'afterUpdate':function(_0x37711f,_0x243d67){extensions[_0xc9d1('0xc')](_0x5b3012,_0x37711f);},'afterDestroy':function(_0x5cb526,_0x43018a){extensions[_0xc9d1('0xc')](_0x5b3012,_0x5cb526);}}});}; \ No newline at end of file +var _0x2613=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x3fe7bb,_0x51f511){var _0x9c1448=function(_0x286a81){while(--_0x286a81){_0x3fe7bb['push'](_0x3fe7bb['shift']());}};_0x9c1448(++_0x51f511);}(_0x2613,0xc0));var _0x3261=function(_0x256c59,_0x261864){_0x256c59=_0x256c59-0x0;var _0x221202=_0x2613[_0x256c59];return _0x221202;};'use strict';var _=require('lodash');var util=require(_0x3261('0x0'));var logger=require(_0x3261('0x1'))(_0x3261('0x2'));var moment=require(_0x3261('0x3'));var BPromise=require(_0x3261('0x4'));var rp=require(_0x3261('0x5'));var fs=require('fs');var path=require(_0x3261('0x6'));var rimraf=require(_0x3261('0x7'));var config=require(_0x3261('0x8'));var attributes=require(_0x3261('0x9'));var extensions=require(_0x3261('0xa'));module[_0x3261('0xb')]=function(_0x529cd1,_0x1782b2){return _0x529cd1[_0x3261('0xc')](_0x3261('0xd'),attributes,{'tableName':_0x3261('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x88d80c,_0x208463){extensions[_0x3261('0xf')](_0x529cd1,_0x88d80c);},'afterBulkCreate':function(_0x51f6d8,_0x36038a,_0x27f99e){_0x27f99e();extensions['rewrite'](_0x529cd1,_0x51f6d8[0x0]);},'afterUpdate':function(_0x4a172b,_0x5a48ea){extensions['rewrite'](_0x529cd1,_0x4a172b);},'afterDestroy':function(_0x513a6c,_0xd711fb){extensions[_0x3261('0xf')](_0x529cd1,_0x513a6c);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6170011..42fba4c 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(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 bfd76a2..17f8b8a 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x426fc4,_0xbf39f6){var _0x554666=function(_0x4c47b3){while(--_0x4c47b3){_0x426fc4['push'](_0x426fc4['shift']());}};_0x554666(++_0xbf39f6);}(_0xdb28,0x106));var _0x8db2=function(_0x128b19,_0x26462f){_0x128b19=_0x128b19-0x0;var _0x21d618=_0xdb28[_0x128b19];return _0x21d618;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c0781,_0x4a19f1){_0x1c0781=_0x1c0781-0x0;var _0x1f577e=_0x0b0e[_0x1c0781];return _0x1f577e;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index ba93b33..acf4cd2 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 _0xf2b0=['customfield_11502','newToken','customfield_11503','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','email','oldToken'];(function(_0x415b8f,_0x32e74f){var _0x482349=function(_0x486b6e){while(--_0x486b6e){_0x415b8f['push'](_0x415b8f['shift']());}};_0x482349(++_0x32e74f);}(_0xf2b0,0x10f));var _0x0f2b=function(_0xd24322,_0x3183a5){_0xd24322=_0xd24322-0x0;var _0x12fd05=_0xf2b0[_0xd24322];return _0x12fd05;};'use strict';var BPromise=require(_0x0f2b('0x0'));var https=require(_0x0f2b('0x1'));var logger=require(_0x0f2b('0x2'))(_0x0f2b('0x3'));var USERNAME=_0x0f2b('0x4');var PASSWORD=_0x0f2b('0x5');function openIssue(_0x53f199,_0x281cfb){var _0x47d74b={'fields':{'project':{'key':_0x53f199[_0x0f2b('0x6')]||_0x0f2b('0x7')},'summary':(_0x53f199[_0x0f2b('0x8')]||'Report')+_0x0f2b('0x9')+_0x53f199['ip'],'description':_0x53f199[_0x0f2b('0xa')]||JSON[_0x0f2b('0xb')](_0x53f199),'issuetype':{'name':_0x53f199[_0x0f2b('0xc')]||_0x0f2b('0xd')}}};_0x47d74b[_0x0f2b('0xe')]['customfield_11500']=_0x53f199[_0x0f2b('0xf')];_0x47d74b['fields']['customfield_11501']=_0x53f199[_0x0f2b('0x10')];_0x47d74b[_0x0f2b('0xe')][_0x0f2b('0x11')]=_0x53f199[_0x0f2b('0x12')];_0x47d74b[_0x0f2b('0xe')][_0x0f2b('0x13')]=_0x53f199['name'];_0x47d74b[_0x0f2b('0xe')]['customfield_11504']=_0x53f199[_0x0f2b('0x14')];_0x47d74b[_0x0f2b('0xe')][_0x0f2b('0x15')]=_0x53f199['ip'];var _0x9d6a24={'host':_0x0f2b('0x16'),'port':0x1bb,'path':_0x0f2b('0x17'),'method':_0x0f2b('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0f2b('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x0f2b('0x1a'))}};var _0x3fdba2=JSON[_0x0f2b('0xb')](_0x47d74b);var _0x3eff5c=https[_0x0f2b('0x1b')](_0x9d6a24,function(_0x2c05bd){_0x2c05bd[_0x0f2b('0x1c')](_0x0f2b('0x1d'));var _0xf1e84b='';_0x2c05bd['on'](_0x0f2b('0x1e'),function(_0x2322a1){_0xf1e84b+=_0x2322a1;});_0x2c05bd['on'](_0x0f2b('0x1f'),function(){if(_0x281cfb){return _0x281cfb['status'](_0x2c05bd[_0x0f2b('0x20')])[_0x0f2b('0x21')](JSON[_0x0f2b('0x22')](_0xf1e84b));}});});_0x3eff5c['on'](_0x0f2b('0x23'),function(_0x461391){if(_0x281cfb){return _0x281cfb[_0x0f2b('0x24')](0x1f4)['json']({'errors':[{'message':_0x0f2b('0x25'),'type':_0x0f2b('0x26')}]});}});_0x3eff5c[_0x0f2b('0x27')](_0x3fdba2);_0x3eff5c[_0x0f2b('0x1f')]();}exports[_0x0f2b('0x28')]=openIssue;exports[_0x0f2b('0x29')]=function(_0x4f1b8d,_0x202cc5){_0x4f1b8d['body']['ip']=_0x4f1b8d[_0x0f2b('0x2a')][_0x0f2b('0x2b')]||_0x4f1b8d[_0x0f2b('0x2c')]['remoteAddress']||_0x4f1b8d[_0x0f2b('0x2d')][_0x0f2b('0x2e')]||_0x4f1b8d['connection'][_0x0f2b('0x2d')][_0x0f2b('0x2e')];return openIssue(_0x4f1b8d[_0x0f2b('0x2f')],_0x202cc5);}; \ No newline at end of file +var _0xc4f6=['statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','application/json','toString','base64','request','setEncoding','utf8','end','status'];(function(_0x266bc6,_0x2b6e66){var _0x757ea2=function(_0x497e3d){while(--_0x497e3d){_0x266bc6['push'](_0x266bc6['shift']());}};_0x757ea2(++_0x2b6e66);}(_0xc4f6,0x90));var _0x6c4f=function(_0xbfaaed,_0x4c2d88){_0xbfaaed=_0xbfaaed-0x0;var _0x5b98be=_0xc4f6[_0xbfaaed];return _0x5b98be;};'use strict';var BPromise=require(_0x6c4f('0x0'));var https=require(_0x6c4f('0x1'));var logger=require(_0x6c4f('0x2'))(_0x6c4f('0x3'));var USERNAME=_0x6c4f('0x4');var PASSWORD=_0x6c4f('0x5');function openIssue(_0x4c778a,_0x29e24f){var _0x828251={'fields':{'project':{'key':_0x4c778a[_0x6c4f('0x6')]||_0x6c4f('0x7')},'summary':(_0x4c778a[_0x6c4f('0x8')]||_0x6c4f('0x9'))+_0x6c4f('0xa')+_0x4c778a['ip'],'description':_0x4c778a[_0x6c4f('0xb')]||JSON[_0x6c4f('0xc')](_0x4c778a),'issuetype':{'name':_0x4c778a['issuetype']||_0x6c4f('0xd')}}};_0x828251[_0x6c4f('0xe')][_0x6c4f('0xf')]=_0x4c778a[_0x6c4f('0x10')];_0x828251[_0x6c4f('0xe')][_0x6c4f('0x11')]=_0x4c778a['oldToken'];_0x828251[_0x6c4f('0xe')]['customfield_11502']=_0x4c778a['newToken'];_0x828251['fields'][_0x6c4f('0x12')]=_0x4c778a[_0x6c4f('0x13')];_0x828251[_0x6c4f('0xe')][_0x6c4f('0x14')]=_0x4c778a[_0x6c4f('0x15')];_0x828251[_0x6c4f('0xe')][_0x6c4f('0x16')]=_0x4c778a['ip'];var _0x40b050={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x6c4f('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x6c4f('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6c4f('0x19')](_0x6c4f('0x1a'))}};var _0x963a64=JSON[_0x6c4f('0xc')](_0x828251);var _0x4233f3=https[_0x6c4f('0x1b')](_0x40b050,function(_0x25a8a7){_0x25a8a7[_0x6c4f('0x1c')](_0x6c4f('0x1d'));var _0x4eb90a='';_0x25a8a7['on']('data',function(_0x2b5aee){_0x4eb90a+=_0x2b5aee;});_0x25a8a7['on'](_0x6c4f('0x1e'),function(){if(_0x29e24f){return _0x29e24f[_0x6c4f('0x1f')](_0x25a8a7[_0x6c4f('0x20')])[_0x6c4f('0x21')](JSON[_0x6c4f('0x22')](_0x4eb90a));}});});_0x4233f3['on']('error',function(_0x54adcb){if(_0x29e24f){return _0x29e24f['status'](0x1f4)[_0x6c4f('0x21')]({'errors':[{'message':_0x6c4f('0x23'),'type':_0x6c4f('0x24')}]});}});_0x4233f3[_0x6c4f('0x25')](_0x963a64);_0x4233f3[_0x6c4f('0x1e')]();}exports[_0x6c4f('0x26')]=openIssue;exports[_0x6c4f('0x27')]=function(_0xef4009,_0x3679fb){_0xef4009[_0x6c4f('0x28')]['ip']=_0xef4009['headers']['x-forwarded-for']||_0xef4009[_0x6c4f('0x29')]['remoteAddress']||_0xef4009['socket'][_0x6c4f('0x2a')]||_0xef4009[_0x6c4f('0x29')][_0x6c4f('0x2b')][_0x6c4f('0x2a')];return openIssue(_0xef4009[_0x6c4f('0x28')],_0x3679fb);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d7fb4f5..f48332e 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 _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x32b0cd,_0x235b12){var _0x294508=function(_0x1e6121){while(--_0x1e6121){_0x32b0cd['push'](_0x32b0cd['shift']());}};_0x294508(++_0x235b12);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3a94dc,_0x1a5f9c){_0x3a94dc=_0x3a94dc-0x0;var _0x52c4bf=_0x9bde[_0x3a94dc];return _0x52c4bf;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40cd61,_0x36162c){var _0x120ce8=function(_0x59c7cc){while(--_0x59c7cc){_0x40cd61['push'](_0x40cd61['shift']());}};_0x120ce8(++_0x36162c);}(_0x1339,0x1ed));var _0x9133=function(_0x1237eb,_0x1831c8){_0x1237eb=_0x1237eb-0x0;var _0x342f3b=_0x1339[_0x1237eb];return _0x342f3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('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 03b27db..704cd11 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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x228a21,_0x34a225){_0x228a21=_0x228a21-0x0;var _0x464742=_0x7a54[_0x228a21];return _0x464742;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x5fbc04,_0x5d70d4){_0x5fbc04=_0x5fbc04-0x0;var _0x21a53a=_0x7a54[_0x5fbc04];return _0x21a53a;};'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 2013fb8..4569646 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 _0xa1f6=['error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xa1f6[_0x5b8b97];return _0x1fdf84;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['JscriptyAnswerReport'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['JscriptyAnswerReport'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));}; \ No newline at end of file +var _0xdbf5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport'];(function(_0x226262,_0x27a6a4){var _0x5c70d7=function(_0x33fee6){while(--_0x33fee6){_0x226262['push'](_0x226262['shift']());}};_0x5c70d7(++_0x27a6a4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x531fe4,_0xa07c88){_0x531fe4=_0x531fe4-0x0;var _0x2936bb=_0xdbf5[_0x531fe4];return _0x2936bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['map'](_0xc4748,'name');_0x2f71eb[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x471027[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x33')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],qs[_0x5dbf('0x34')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x5768b7[_0x5dbf('0x33')]=_0x5768b7[_0x5dbf('0x33')]['length']?_0x5768b7[_0x5dbf('0x33')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x5768b7['limit']=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x37')]);_0x5768b7[_0x5dbf('0x19')]=qs['offset'](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x31')](_[_0x5dbf('0x3b')](_0x471027[_0x5dbf('0x2f')],_0x2f71eb[_0x5dbf('0x31')]),_0xc4748);if(_0x471027['query'][_0x5dbf('0x3c')]){_0x5768b7[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x5768b7['where'],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x43954b){if(_0x43954b[_0x5dbf('0x2c')]!=='VIRTUAL'){var _0x444814={};_0x444814[_0x43954b[_0x5dbf('0x25')]]={'$like':'%'+_0x471027[_0x5dbf('0x2f')]['filter']+'%'};return _0x444814;}})});}_0x5768b7=_[_0x5dbf('0x3d')]({},_0x5768b7,_0x471027[_0x5dbf('0x3e')]);var _0x2ac162={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x2ac162)[_0x5dbf('0x20')](function(_0x2ed355){_0x24dc99['count']=_0x2ed355;if(_0x471027['query']['includeAll']){_0x5768b7['include']=[{'all':!![]}];}return db[_0x5dbf('0x29')][_0x5dbf('0x3f')](_0x5768b7);})['then'](function(_0x3ef0eb){_0x24dc99[_0x5dbf('0x40')]=_0x3ef0eb;return _0x24dc99;})['then'](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x41')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x42')]=function(_0x2ee717,_0x2ee6b9){var _0x21ae10={'raw':!![],'where':{'id':_0x2ee717[_0x5dbf('0x43')]['id']}},_0x7c390d={};_0x7c390d[_0x5dbf('0x2e')]=_[_0x5dbf('0x30')](db[_0x5dbf('0x29')]['rawAttributes']);_0x7c390d[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x2ee717[_0x5dbf('0x2f')]);_0x7c390d['filters']=_[_0x5dbf('0x32')](_0x7c390d[_0x5dbf('0x2e')],_0x7c390d[_0x5dbf('0x2f')]);_0x21ae10[_0x5dbf('0x33')]=_['intersection'](_0x7c390d[_0x5dbf('0x2e')],qs['fields'](_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x21ae10[_0x5dbf('0x33')]=_0x21ae10[_0x5dbf('0x33')]['length']?_0x21ae10['attributes']:_0x7c390d[_0x5dbf('0x2e')];if(_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x44')]){_0x21ae10['include']=[{'all':!![]}];}_0x21ae10=_[_0x5dbf('0x3d')]({},_0x21ae10,_0x2ee717['options']);return db['JscriptyAnswerReport']['find'](_0x21ae10)['then'](handleEntityNotFound(_0x2ee6b9,null))[_0x5dbf('0x20')](respondWithResult(_0x2ee6b9,null))[_0x5dbf('0x41')](handleError(_0x2ee6b9,null));};exports['create']=function(_0x47063d,_0x3ba5cb){return db['JscriptyAnswerReport'][_0x5dbf('0x45')](_0x47063d[_0x5dbf('0x46')],{})['then'](respondWithResult(_0x3ba5cb,0xc9))[_0x5dbf('0x41')](handleError(_0x3ba5cb,null));};exports['update']=function(_0x5ab862,_0x337897){if(_0x5ab862[_0x5dbf('0x46')]['id']){delete _0x5ab862[_0x5dbf('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5ab862[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x337897,null))[_0x5dbf('0x20')](saveUpdates(_0x5ab862[_0x5dbf('0x46')],null))[_0x5dbf('0x20')](respondWithResult(_0x337897,null))[_0x5dbf('0x41')](handleError(_0x337897,null));};exports[_0x5dbf('0x21')]=function(_0x319906,_0x4bc7eb){return db[_0x5dbf('0x29')][_0x5dbf('0x47')]({'where':{'id':_0x319906[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x4bc7eb,null))[_0x5dbf('0x20')](removeEntity(_0x4bc7eb,null))[_0x5dbf('0x41')](handleError(_0x4bc7eb,null));};exports[_0x5dbf('0x48')]=function(_0x59f825,_0x1b0b13){return db['JscriptyAnswerReport'][_0x5dbf('0x48')]()[_0x5dbf('0x20')](respondWithResult(_0x1b0b13,null))[_0x5dbf('0x41')](handleError(_0x1b0b13,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4343f68..ef1ac9f 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 _0xa519=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xa519,0x117));var _0x9a51=function(_0x1b553b,_0x5c8090){_0x1b553b=_0x1b553b-0x0;var _0x1a1161=_0xa519[_0x1b553b];return _0x1a1161;};'use strict';var _=require('lodash');var util=require(_0x9a51('0x0'));var logger=require(_0x9a51('0x1'))(_0x9a51('0x2'));var moment=require(_0x9a51('0x3'));var BPromise=require(_0x9a51('0x4'));var rp=require(_0x9a51('0x5'));var fs=require('fs');var path=require(_0x9a51('0x6'));var rimraf=require(_0x9a51('0x7'));var config=require(_0x9a51('0x8'));var attributes=require(_0x9a51('0x9'));module['exports']=function(_0x2d66fb,_0x1dff5a){return _0x2d66fb[_0x9a51('0xa')](_0x9a51('0xb'),attributes,{'tableName':_0x9a51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a29=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','api','moment','request-promise','path'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4a29,0x133));var _0x94a2=function(_0x857cb,_0x100962){_0x857cb=_0x857cb-0x0;var _0x5a7bc6=_0x4a29[_0x857cb];return _0x5a7bc6;};'use strict';var _=require('lodash');var util=require(_0x94a2('0x0'));var logger=require('../../config/logger')(_0x94a2('0x1'));var moment=require(_0x94a2('0x2'));var BPromise=require('bluebird');var rp=require(_0x94a2('0x3'));var fs=require('fs');var path=require(_0x94a2('0x4'));var rimraf=require(_0x94a2('0x5'));var config=require(_0x94a2('0x6'));var attributes=require(_0x94a2('0x7'));module[_0x94a2('0x8')]=function(_0x39c86a,_0x16118b){return _0x39c86a[_0x94a2('0x9')](_0x94a2('0xa'),attributes,{'tableName':_0x94a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 645a702..7e788b9 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 _0x5f89=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x53b199,_0x38ff21){var _0x1ba42d=function(_0x35dc53){while(--_0x35dc53){_0x53b199['push'](_0x53b199['shift']());}};_0x1ba42d(++_0x38ff21);}(_0x5f89,0x14a));var _0x95f8=function(_0x33c658,_0x49952c){_0x33c658=_0x33c658-0x0;var _0x2dd527=_0x5f89[_0x33c658];return _0x2dd527;};'use strict';var _=require(_0x95f8('0x0'));var util=require('util');var moment=require(_0x95f8('0x1'));var BPromise=require(_0x95f8('0x2'));var rs=require(_0x95f8('0x3'));var fs=require('fs');var Redis=require(_0x95f8('0x4'));var db=require(_0x95f8('0x5'))['db'];var utils=require(_0x95f8('0x6'));var logger=require(_0x95f8('0x7'))('rpc');var config=require(_0x95f8('0x8'));var jayson=require(_0x95f8('0x9'));var client=jayson[_0x95f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ba506,_0x130d47,_0x5211eb){return new BPromise(function(_0x98d7b,_0x22497e){return client[_0x95f8('0xb')](_0x2ba506,_0x5211eb)[_0x95f8('0xc')](function(_0x5d2981){logger['info'](_0x95f8('0xd'),_0x130d47,_0x95f8('0xe'));logger[_0x95f8('0xf')](_0x95f8('0x10'),_0x130d47,_0x95f8('0xe'),JSON[_0x95f8('0x11')](_0x5d2981));if(_0x5d2981[_0x95f8('0x12')]){if(_0x5d2981[_0x95f8('0x12')][_0x95f8('0x13')]===0x1f4){logger[_0x95f8('0x12')](_0x95f8('0xd'),_0x130d47,_0x5d2981['error'][_0x95f8('0x14')]);return _0x22497e(_0x5d2981[_0x95f8('0x12')][_0x95f8('0x14')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x130d47,_0x5d2981['error'][_0x95f8('0x14')]);return _0x98d7b(_0x5d2981[_0x95f8('0x12')][_0x95f8('0x14')]);}else{logger['info'](_0x95f8('0xd'),_0x130d47,_0x95f8('0xe'));_0x98d7b(_0x5d2981['result'][_0x95f8('0x14')]);}})[_0x95f8('0x15')](function(_0x5bfc30){logger[_0x95f8('0x12')](_0x95f8('0xd'),_0x130d47,_0x5bfc30);_0x22497e(_0x5bfc30);});});} \ No newline at end of file +var _0x0c16=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1131f6,_0x23df0e){var _0x338243=function(_0x3a45a0){while(--_0x3a45a0){_0x1131f6['push'](_0x1131f6['shift']());}};_0x338243(++_0x23df0e);}(_0x0c16,0x149));var _0x60c1=function(_0x196f6f,_0x4918bb){_0x196f6f=_0x196f6f-0x0;var _0x3d7f04=_0x0c16[_0x196f6f];return _0x3d7f04;};'use strict';var _=require(_0x60c1('0x0'));var util=require(_0x60c1('0x1'));var moment=require(_0x60c1('0x2'));var BPromise=require(_0x60c1('0x3'));var rs=require(_0x60c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60c1('0x5'))['db'];var utils=require(_0x60c1('0x6'));var logger=require(_0x60c1('0x7'))(_0x60c1('0x8'));var config=require(_0x60c1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x60c1('0xa')][_0x60c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13cd6a,_0x3c2e91,_0x4b72ad){return new BPromise(function(_0x77afd4,_0x553be4){return client[_0x60c1('0xc')](_0x13cd6a,_0x4b72ad)[_0x60c1('0xd')](function(_0x1c0b4a){logger[_0x60c1('0xe')](_0x60c1('0xf'),_0x3c2e91,_0x60c1('0x10'));logger[_0x60c1('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3c2e91,'request\x20sent',JSON[_0x60c1('0x12')](_0x1c0b4a));if(_0x1c0b4a[_0x60c1('0x13')]){if(_0x1c0b4a[_0x60c1('0x13')][_0x60c1('0x14')]===0x1f4){logger[_0x60c1('0x13')](_0x60c1('0xf'),_0x3c2e91,_0x1c0b4a[_0x60c1('0x13')]['message']);return _0x553be4(_0x1c0b4a[_0x60c1('0x13')][_0x60c1('0x15')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c2e91,_0x1c0b4a[_0x60c1('0x13')][_0x60c1('0x15')]);return _0x77afd4(_0x1c0b4a[_0x60c1('0x13')][_0x60c1('0x15')]);}else{logger[_0x60c1('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c2e91,_0x60c1('0x10'));_0x77afd4(_0x1c0b4a[_0x60c1('0x16')][_0x60c1('0x15')]);}})[_0x60c1('0x17')](function(_0x21bfc0){logger[_0x60c1('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c2e91,_0x21bfc0);_0x553be4(_0x21bfc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6524bab..6f0feda 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 _0x76f2=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','post','/:id/clone','clone'];(function(_0x1f1c61,_0x56823f){var _0x2c14a1=function(_0x54fd77){while(--_0x54fd77){_0x1f1c61['push'](_0x1f1c61['shift']());}};_0x2c14a1(++_0x56823f);}(_0x76f2,0xff));var _0x276f=function(_0x73e318,_0x199dcd){_0x73e318=_0x73e318-0x0;var _0x3ac574=_0x76f2[_0x73e318];return _0x3ac574;};'use strict';var multer=require(_0x276f('0x0'));var util=require('util');var path=require(_0x276f('0x1'));var timeout=require(_0x276f('0x2'));var express=require(_0x276f('0x3'));var router=express['Router']();var fs_extra=require(_0x276f('0x4'));var auth=require(_0x276f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x276f('0x6'));var controller=require(_0x276f('0x7'));router[_0x276f('0x8')]('/',auth[_0x276f('0x9')](),controller[_0x276f('0xa')]);router[_0x276f('0x8')](_0x276f('0xb'),auth[_0x276f('0x9')](),controller[_0x276f('0xc')]);router[_0x276f('0x8')](_0x276f('0xd'),auth[_0x276f('0x9')](),controller[_0x276f('0xe')]);router[_0x276f('0x8')]('/:id/answers',auth[_0x276f('0x9')](),controller[_0x276f('0xf')]);router[_0x276f('0x8')](_0x276f('0x10'),auth[_0x276f('0x9')](),timeout('30s'),controller['getSummary']);router[_0x276f('0x11')]('/',auth[_0x276f('0x9')](),controller['create']);router[_0x276f('0x11')](_0x276f('0x12'),auth[_0x276f('0x9')](),controller[_0x276f('0x13')]);router[_0x276f('0x14')]('/:id',auth[_0x276f('0x9')](),controller[_0x276f('0x15')]);router[_0x276f('0x16')]('/:id',auth[_0x276f('0x9')](),controller[_0x276f('0x17')]);module[_0x276f('0x18')]=router; \ No newline at end of file +var _0xe6da=['create','/:id/clone','clone','/:id','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post'];(function(_0x5dfbc3,_0x4dc1ff){var _0x1d4170=function(_0x36cc2c){while(--_0x36cc2c){_0x5dfbc3['push'](_0x5dfbc3['shift']());}};_0x1d4170(++_0x4dc1ff);}(_0xe6da,0x102));var _0xae6d=function(_0x6ce72c,_0x1980f0){_0x6ce72c=_0x6ce72c-0x0;var _0x12e0dc=_0xe6da[_0x6ce72c];return _0x12e0dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae6d('0x0'));var timeout=require(_0xae6d('0x1'));var express=require('express');var router=express[_0xae6d('0x2')]();var fs_extra=require(_0xae6d('0x3'));var auth=require(_0xae6d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xae6d('0x5'));var controller=require(_0xae6d('0x6'));router[_0xae6d('0x7')]('/',auth['isAuthenticated'](),controller[_0xae6d('0x8')]);router[_0xae6d('0x7')]('/:id',auth[_0xae6d('0x9')](),controller[_0xae6d('0xa')]);router[_0xae6d('0x7')](_0xae6d('0xb'),auth[_0xae6d('0x9')](),controller['getSessions']);router[_0xae6d('0x7')](_0xae6d('0xc'),auth['isAuthenticated'](),controller[_0xae6d('0xd')]);router[_0xae6d('0x7')](_0xae6d('0xe'),auth['isAuthenticated'](),timeout(_0xae6d('0xf')),controller[_0xae6d('0x10')]);router[_0xae6d('0x11')]('/',auth['isAuthenticated'](),controller[_0xae6d('0x12')]);router[_0xae6d('0x11')](_0xae6d('0x13'),auth[_0xae6d('0x9')](),controller[_0xae6d('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xae6d('0x15'),auth[_0xae6d('0x9')](),controller[_0xae6d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 38ea1e0..ec8a1bf 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 _0x4d67=['BOOLEAN','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d67,0x88));var _0x74d6=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x4d67[_0x263a2f];return _0x8020e8;};'use strict';var Sequelize=require('sequelize');var _=require(_0x74d6('0x0'));var util=require(_0x74d6('0x1'));module[_0x74d6('0x2')]={'name':{'type':Sequelize[_0x74d6('0x3')],'unique':_0x74d6('0x4')},'description':{'type':Sequelize[_0x74d6('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x74d6('0x5')),'set':function(_0x475816){if(_[_0x74d6('0x6')](_0x475816)){this[_0x74d6('0x7')]('formData',JSON[_0x74d6('0x8')](_0x475816));}else if(_[_0x74d6('0x9')](_0x475816)){this[_0x74d6('0x7')]('formData',_0x475816);}else{this[_0x74d6('0x7')](_0x74d6('0xa'),util[_0x74d6('0xb')](_0x74d6('0xc'),this['getDataValue']('name')||'',this[_0x74d6('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x74d6('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x74d6('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x00a1=['TEXT','long','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x00a1,0x83));var _0x100a=function(_0x41ecb0,_0x232c59){_0x41ecb0=_0x41ecb0-0x0;var _0x17b9e0=_0x00a1[_0x41ecb0];return _0x17b9e0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x100a('0x0'));var util=require(_0x100a('0x1'));module[_0x100a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x100a('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x100a('0x4')](_0x100a('0x5')),'set':function(_0x9d884c){if(_[_0x100a('0x6')](_0x9d884c)){this[_0x100a('0x7')](_0x100a('0x8'),JSON['stringify'](_0x9d884c));}else if(_[_0x100a('0x9')](_0x9d884c)){this['setDataValue'](_0x100a('0x8'),_0x9d884c);}else{this[_0x100a('0x7')](_0x100a('0x8'),util[_0x100a('0xa')](_0x100a('0xb'),this[_0x100a('0xc')](_0x100a('0x3'))||'',this[_0x100a('0xc')](_0x100a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x100a('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x100a('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e6e154a..a7e134e 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 _0x1e9c=['now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','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','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','offset','count','limit','Content-Range','json','apply','save','update','then','destroy','Projects','UserProfileResource','error','name','map','JscriptyProject','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','rows','show','find','catch','create','body','user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','createdAt','UserProfileSection','getSessions','findOne','ProjectId','filter','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','nolimit','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer'];(function(_0x14ad92,_0x3b4315){var _0x41ceae=function(_0x252cd1){while(--_0x252cd1){_0x14ad92['push'](_0x14ad92['shift']());}};_0x41ceae(++_0x3b4315);}(_0x1e9c,0x1d9));var _0xc1e9=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x1e9c[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0xc1e9('0x0'));var rimraf=require(_0xc1e9('0x1'));var zipdir=require(_0xc1e9('0x2'));var jsonpatch=require(_0xc1e9('0x3'));var rp=require(_0xc1e9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1e9('0x5'));var util=require(_0xc1e9('0x6'));var path=require(_0xc1e9('0x7'));var sox=require(_0xc1e9('0x8'));var csv=require(_0xc1e9('0x9'));var ejs=require(_0xc1e9('0xa'));var fs=require('fs');var fs_extra=require(_0xc1e9('0xb'));var _=require(_0xc1e9('0xc'));var squel=require(_0xc1e9('0xd'));var crypto=require(_0xc1e9('0xe'));var jsforce=require(_0xc1e9('0xf'));var deskjs=require(_0xc1e9('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc1e9('0x11'));var Papa=require('papaparse');var Redis=require(_0xc1e9('0x12'));var authService=require(_0xc1e9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc1e9('0x14'));var hardwareService=require(_0xc1e9('0x15'));var logger=require(_0xc1e9('0x16'))(_0xc1e9('0x17'));var utils=require(_0xc1e9('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52c9cc,_0x21d373){_0x21d373=_0x21d373||0xcc;return function(_0x2764e1){if(_0x2764e1){return _0x52c9cc[_0xc1e9('0x19')](_0x21d373);}return _0x52c9cc[_0xc1e9('0x1a')](_0x21d373)[_0xc1e9('0x1b')]();};}function respondWithResult(_0x4071df,_0x49ce67){_0x49ce67=_0x49ce67||0xc8;return function(_0x292260){if(_0x292260){return _0x4071df[_0xc1e9('0x1a')](_0x49ce67)['json'](_0x292260);}};}function respondWithFilteredResult(_0x45a1e1,_0x3891f0){return function(_0x53319c){if(_0x53319c){var _0x3e873b=typeof _0x3891f0['offset']==='undefined'&&typeof _0x3891f0['limit']===_0xc1e9('0x1c');var _0x2e257a=_0x53319c['count'];var _0xd7024a=_0x3e873b?0x0:_0x3891f0[_0xc1e9('0x1d')];var _0x3daaf7=_0x3e873b?_0x53319c[_0xc1e9('0x1e')]:_0x3891f0[_0xc1e9('0x1d')]+_0x3891f0[_0xc1e9('0x1f')];var _0x26d637;if(_0x3daaf7>=_0x2e257a){_0x3daaf7=_0x2e257a;_0x26d637=0xc8;}else{_0x26d637=0xce;}_0x45a1e1[_0xc1e9('0x1a')](_0x26d637);return _0x45a1e1['set'](_0xc1e9('0x20'),_0xd7024a+'-'+_0x3daaf7+'/'+_0x2e257a)[_0xc1e9('0x21')](_0x53319c);}return null;};}function patchUpdates(_0xaa1f74){return function(_0x367ac2){try{jsonpatch[_0xc1e9('0x22')](_0x367ac2,_0xaa1f74,!![]);}catch(_0x11a9c0){return BPromise['reject'](_0x11a9c0);}return _0x367ac2[_0xc1e9('0x23')]();};}function saveUpdates(_0x2de3fb,_0x570562){return function(_0x58cff3){if(_0x58cff3){return _0x58cff3[_0xc1e9('0x24')](_0x2de3fb)[_0xc1e9('0x25')](function(_0x382118){return _0x382118;});}return null;};}function removeEntity(_0x444111,_0x6d64d6){return function(_0xcb5a43){if(_0xcb5a43){return _0xcb5a43[_0xc1e9('0x26')]()[_0xc1e9('0x25')](function(){var _0x316f0b=_0xcb5a43['get']({'plain':!![]});var _0x81bec3=_0xc1e9('0x27');return db[_0xc1e9('0x28')]['destroy']({'where':{'type':_0x81bec3,'resourceId':_0x316f0b['id']}})[_0xc1e9('0x25')](function(){return _0xcb5a43;});})['then'](function(){_0x444111[_0xc1e9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcaa7ae,_0x2ca6f1){return function(_0x1bf3d0){if(!_0x1bf3d0){_0xcaa7ae[_0xc1e9('0x19')](0x194);}return _0x1bf3d0;};}function handleError(_0x2eebe7,_0x1daac0){_0x1daac0=_0x1daac0||0x1f4;return function(_0x33818b){logger[_0xc1e9('0x29')](_0x33818b['stack']);if(_0x33818b[_0xc1e9('0x2a')]){delete _0x33818b[_0xc1e9('0x2a')];}_0x2eebe7['status'](_0x1daac0)['send'](_0x33818b);};}exports['index']=function(_0x28b9a8,_0x187010){var _0x241e12={},_0x406d06={},_0x1e7599={'count':0x0,'rows':[]};var _0x27e228=_[_0xc1e9('0x2b')](db[_0xc1e9('0x2c')][_0xc1e9('0x2d')],function(_0x4600b2){return{'name':_0x4600b2['fieldName'],'type':_0x4600b2[_0xc1e9('0x2e')][_0xc1e9('0x2f')]};});_0x406d06[_0xc1e9('0x30')]=_[_0xc1e9('0x2b')](_0x27e228,_0xc1e9('0x2a'));_0x406d06['query']=_[_0xc1e9('0x31')](_0x28b9a8['query']);_0x406d06[_0xc1e9('0x32')]=_[_0xc1e9('0x33')](_0x406d06[_0xc1e9('0x30')],_0x406d06[_0xc1e9('0x34')]);_0x241e12[_0xc1e9('0x35')]=_['intersection'](_0x406d06[_0xc1e9('0x30')],qs[_0xc1e9('0x36')](_0x28b9a8['query'][_0xc1e9('0x36')]));_0x241e12[_0xc1e9('0x35')]=_0x241e12[_0xc1e9('0x35')][_0xc1e9('0x37')]?_0x241e12[_0xc1e9('0x35')]:_0x406d06['model'];if(!_0x28b9a8[_0xc1e9('0x34')][_0xc1e9('0x38')]('nolimit')){_0x241e12[_0xc1e9('0x1f')]=qs['limit'](_0x28b9a8[_0xc1e9('0x34')][_0xc1e9('0x1f')]);_0x241e12[_0xc1e9('0x1d')]=qs[_0xc1e9('0x1d')](_0x28b9a8[_0xc1e9('0x34')][_0xc1e9('0x1d')]);}_0x241e12[_0xc1e9('0x39')]=qs[_0xc1e9('0x3a')](_0x28b9a8['query']['sort']);_0x241e12[_0xc1e9('0x3b')]=qs[_0xc1e9('0x32')](_[_0xc1e9('0x3c')](_0x28b9a8[_0xc1e9('0x34')],_0x406d06[_0xc1e9('0x32')]),_0x27e228);if(_0x28b9a8[_0xc1e9('0x34')]['filter']){_0x241e12[_0xc1e9('0x3b')]=_[_0xc1e9('0x3d')](_0x241e12['where'],{'$or':_['map'](_0x27e228,function(_0x230311){if(_0x230311['type']!=='VIRTUAL'){var _0xbbef08={};_0xbbef08[_0x230311['name']]={'$like':'%'+_0x28b9a8[_0xc1e9('0x34')]['filter']+'%'};return _0xbbef08;}})});}_0x241e12=_[_0xc1e9('0x3d')]({},_0x241e12,_0x28b9a8[_0xc1e9('0x3e')]);var _0x5514bb={'where':_0x241e12['where']};return db[_0xc1e9('0x2c')][_0xc1e9('0x1e')](_0x5514bb)['then'](function(_0x11f678){_0x1e7599['count']=_0x11f678;if(_0x28b9a8[_0xc1e9('0x34')][_0xc1e9('0x3f')]){_0x241e12[_0xc1e9('0x40')]=[{'all':!![]}];}return db[_0xc1e9('0x2c')]['findAll'](_0x241e12);})['then'](function(_0x2011e0){_0x1e7599[_0xc1e9('0x41')]=_0x2011e0;return _0x1e7599;})['then'](respondWithFilteredResult(_0x187010,_0x241e12))['catch'](handleError(_0x187010,null));};exports[_0xc1e9('0x42')]=function(_0x3f97a6,_0x589f8e){var _0x21b71a={'raw':![],'where':{'id':_0x3f97a6['params']['id']}},_0x1a3e01={};_0x1a3e01['model']=_[_0xc1e9('0x31')](db[_0xc1e9('0x2c')][_0xc1e9('0x2d')]);_0x1a3e01[_0xc1e9('0x34')]=_[_0xc1e9('0x31')](_0x3f97a6[_0xc1e9('0x34')]);_0x1a3e01[_0xc1e9('0x32')]=_[_0xc1e9('0x33')](_0x1a3e01[_0xc1e9('0x30')],_0x1a3e01['query']);_0x21b71a['attributes']=_[_0xc1e9('0x33')](_0x1a3e01[_0xc1e9('0x30')],qs[_0xc1e9('0x36')](_0x3f97a6[_0xc1e9('0x34')][_0xc1e9('0x36')]));_0x21b71a[_0xc1e9('0x35')]=_0x21b71a[_0xc1e9('0x35')]['length']?_0x21b71a[_0xc1e9('0x35')]:_0x1a3e01[_0xc1e9('0x30')];if(_0x3f97a6['query'][_0xc1e9('0x3f')]){_0x21b71a[_0xc1e9('0x40')]=[{'all':!![]}];}_0x21b71a=_[_0xc1e9('0x3d')]({},_0x21b71a,_0x3f97a6[_0xc1e9('0x3e')]);return db[_0xc1e9('0x2c')][_0xc1e9('0x43')](_0x21b71a)['then'](handleEntityNotFound(_0x589f8e,null))[_0xc1e9('0x25')](respondWithResult(_0x589f8e,null))[_0xc1e9('0x44')](handleError(_0x589f8e,null));};exports[_0xc1e9('0x45')]=function(_0x3d5aeb,_0x40d612){return db[_0xc1e9('0x2c')][_0xc1e9('0x45')](_0x3d5aeb[_0xc1e9('0x46')],{})[_0xc1e9('0x25')](function(_0x442cfd){var _0x2c3c2d=_0x3d5aeb[_0xc1e9('0x47')]['get']({'plain':!![]});if(!_0x2c3c2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c3c2d[_0xc1e9('0x48')]===_0xc1e9('0x47')){var _0x2b5188=_0x442cfd[_0xc1e9('0x49')]({'plain':!![]});var _0x2672aa='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x2672aa,'userProfileId':_0x2c3c2d[_0xc1e9('0x4a')]},'raw':!![]})[_0xc1e9('0x25')](function(_0x3ec2b3){if(_0x3ec2b3&&_0x3ec2b3[_0xc1e9('0x4b')]===0x0){return db[_0xc1e9('0x28')][_0xc1e9('0x45')]({'name':_0x2b5188[_0xc1e9('0x2a')],'resourceId':_0x2b5188['id'],'type':_0x3ec2b3['name'],'sectionId':_0x3ec2b3['id']},{})[_0xc1e9('0x25')](function(){return _0x442cfd;});}else{return _0x442cfd;}})['catch'](function(_0xabe087){logger[_0xc1e9('0x29')](_0xc1e9('0x4c'),_0xabe087);throw _0xabe087;});}return _0x442cfd;})[_0xc1e9('0x25')](respondWithResult(_0x40d612,0xc9))[_0xc1e9('0x44')](handleError(_0x40d612,null));};exports[_0xc1e9('0x4d')]=function(_0x54fe39,_0x53b7ea){var _0x261291={'where':{'id':_0x54fe39[_0xc1e9('0x4e')]['id']}},_0x5405f1={};_0x5405f1[_0xc1e9('0x30')]=_[_0xc1e9('0x31')](db[_0xc1e9('0x2c')][_0xc1e9('0x2d')]);_0x261291[_0xc1e9('0x35')]=_[_0xc1e9('0x33')](_0x5405f1[_0xc1e9('0x30')],qs[_0xc1e9('0x36')](_0x54fe39[_0xc1e9('0x34')][_0xc1e9('0x36')]));_0x261291[_0xc1e9('0x35')]=_0x261291[_0xc1e9('0x35')][_0xc1e9('0x37')]?_0x261291[_0xc1e9('0x35')]:_0x5405f1[_0xc1e9('0x30')];if(_0x54fe39['query'][_0xc1e9('0x3f')]){_0x261291[_0xc1e9('0x40')]=[{'all':!![]}];}_0x261291=_[_0xc1e9('0x3d')]({},_0x261291,_0x54fe39[_0xc1e9('0x3e')]);return db[_0xc1e9('0x2c')][_0xc1e9('0x43')](_0x261291)['then'](handleEntityNotFound(_0x53b7ea,null))[_0xc1e9('0x25')](function(_0x47d680){if(_0x47d680){var _0x305eac=_0x47d680['get']({'plain':!![]});_0x305eac=qs['omit'](_0x305eac,['id','createdAt',_0xc1e9('0x4f')]);_0x54fe39['body']=_['omit'](_0x54fe39[_0xc1e9('0x46')],['id',_0xc1e9('0x50'),_0xc1e9('0x4f')]);return db[_0xc1e9('0x2c')]['create'](_[_0xc1e9('0x3d')](_0x305eac,_0x54fe39[_0xc1e9('0x46')]),{'include':_0x54fe39[_0xc1e9('0x34')][_0xc1e9('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x184d37){var _0x42e666=_0x54fe39[_0xc1e9('0x47')][_0xc1e9('0x49')]({'plain':!![]});if(!_0x42e666)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42e666[_0xc1e9('0x48')]==='user'){var _0x18ebf1=_0x184d37['get']({'plain':!![]});var _0x2bc1b0=_0xc1e9('0x27');return db[_0xc1e9('0x51')]['find']({'where':{'name':_0x2bc1b0,'userProfileId':_0x42e666[_0xc1e9('0x4a')]},'raw':!![]})[_0xc1e9('0x25')](function(_0xf92958){if(_0xf92958&&_0xf92958[_0xc1e9('0x4b')]===0x0){return db[_0xc1e9('0x28')][_0xc1e9('0x45')]({'name':_0x18ebf1[_0xc1e9('0x2a')],'resourceId':_0x18ebf1['id'],'type':_0xf92958[_0xc1e9('0x2a')],'sectionId':_0xf92958['id']},{})['then'](function(){return _0x184d37;});}else{return _0x184d37;}})[_0xc1e9('0x44')](function(_0x5a707e){logger[_0xc1e9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a707e);throw _0x5a707e;});}return _0x184d37;});}})[_0xc1e9('0x25')](respondWithResult(_0x53b7ea,0xc9))[_0xc1e9('0x44')](handleError(_0x53b7ea,null));};exports['update']=function(_0x3962f7,_0x11c41e){if(_0x3962f7['body']['id']){delete _0x3962f7['body']['id'];}return db['JscriptyProject'][_0xc1e9('0x43')]({'where':{'id':_0x3962f7[_0xc1e9('0x4e')]['id']}})[_0xc1e9('0x25')](handleEntityNotFound(_0x11c41e,null))[_0xc1e9('0x25')](saveUpdates(_0x3962f7['body'],null))[_0xc1e9('0x25')](respondWithResult(_0x11c41e,null))[_0xc1e9('0x44')](handleError(_0x11c41e,null));};exports['destroy']=function(_0x747eaf,_0x41cc72){return db[_0xc1e9('0x2c')][_0xc1e9('0x43')]({'where':{'id':_0x747eaf[_0xc1e9('0x4e')]['id']}})[_0xc1e9('0x25')](handleEntityNotFound(_0x41cc72,null))[_0xc1e9('0x25')](removeEntity(_0x41cc72,null))[_0xc1e9('0x44')](handleError(_0x41cc72,null));};exports[_0xc1e9('0x52')]=function(_0x566f9d,_0x189404,_0x132f23){var _0x5edac8={'raw':!![],'where':{}};var _0x5310b1={};var _0x26e433={'count':0x0,'rows':[]};return db[_0xc1e9('0x2c')][_0xc1e9('0x53')]({'where':{'id':_0x566f9d[_0xc1e9('0x4e')]['id']}})[_0xc1e9('0x25')](handleEntityNotFound(_0x189404,null))['then'](function(_0x2110b3){if(_0x2110b3){_0x5310b1['model']=_[_0xc1e9('0x31')](db['JscriptySessionReport'][_0xc1e9('0x2d')]);_0x5310b1[_0xc1e9('0x34')]=_[_0xc1e9('0x31')](_0x566f9d[_0xc1e9('0x34')]);_0x5310b1[_0xc1e9('0x32')]=_[_0xc1e9('0x33')](_0x5310b1['model'],_0x5310b1[_0xc1e9('0x34')]);_0x5edac8[_0xc1e9('0x35')]=_[_0xc1e9('0x33')](_0x5310b1[_0xc1e9('0x30')],qs[_0xc1e9('0x36')](_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x36')]));_0x5edac8[_0xc1e9('0x35')]=_0x5edac8[_0xc1e9('0x35')][_0xc1e9('0x37')]?_0x5edac8[_0xc1e9('0x35')]:_0x5310b1[_0xc1e9('0x30')];if(!_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x38')]('nolimit')){_0x5edac8[_0xc1e9('0x1f')]=qs['limit'](_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x1f')]);_0x5edac8[_0xc1e9('0x1d')]=qs[_0xc1e9('0x1d')](_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x1d')]);}_0x5edac8[_0xc1e9('0x39')]=qs[_0xc1e9('0x3a')](_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x3a')]);_0x5edac8[_0xc1e9('0x3b')]=qs[_0xc1e9('0x32')](_[_0xc1e9('0x3c')](_0x566f9d['query'],_0x5310b1[_0xc1e9('0x32')]));_0x5edac8['where'][_0xc1e9('0x54')]=_0x2110b3['id'];if(_0x566f9d[_0xc1e9('0x34')]['filter']){_0x5edac8['where']=_[_0xc1e9('0x3d')](_0x5edac8[_0xc1e9('0x3b')],{'$or':_[_0xc1e9('0x2b')](_0x5edac8['attributes'],function(_0x34ea1c){var _0x86fe04={};_0x86fe04[_0x34ea1c]={'$like':'%'+_0x566f9d[_0xc1e9('0x34')][_0xc1e9('0x55')]+'%'};return _0x86fe04;})});}_0x5edac8=_['merge']({},_0x5edac8,_0x566f9d[_0xc1e9('0x3e')]);return db['JscriptySessionReport']['count']({'where':_0x5edac8[_0xc1e9('0x3b')]})['then'](function(_0x4a0991){_0x26e433[_0xc1e9('0x1e')]=_0x4a0991;if(_0x566f9d['query'][_0xc1e9('0x3f')]){_0x5edac8['include']=[{'all':!![]}];}return db[_0xc1e9('0x56')][_0xc1e9('0x57')](_0x5edac8);})[_0xc1e9('0x25')](function(_0x56e86f){_0x26e433['rows']=_0x56e86f;return _0x26e433;});}})['then'](respondWithFilteredResult(_0x189404,_0x5edac8))[_0xc1e9('0x44')](handleError(_0x189404,null));};exports[_0xc1e9('0x58')]=function(_0x37f24a,_0x46228b,_0x544cab){var _0x25cdc5={'raw':!![],'where':{}};var _0x8a095b={};var _0xf51620={'count':0x0,'rows':[]};return db[_0xc1e9('0x2c')][_0xc1e9('0x53')]({'where':{'id':_0x37f24a[_0xc1e9('0x4e')]['id']}})[_0xc1e9('0x25')](handleEntityNotFound(_0x46228b,null))['then'](function(_0x213dbd){if(_0x213dbd){_0x8a095b[_0xc1e9('0x30')]=_[_0xc1e9('0x31')](db[_0xc1e9('0x59')][_0xc1e9('0x2d')]);_0x8a095b['query']=_['keys'](_0x37f24a[_0xc1e9('0x34')]);_0x8a095b['filters']=_[_0xc1e9('0x33')](_0x8a095b[_0xc1e9('0x30')],_0x8a095b[_0xc1e9('0x34')]);_0x25cdc5[_0xc1e9('0x35')]=_[_0xc1e9('0x33')](_0x8a095b[_0xc1e9('0x30')],qs[_0xc1e9('0x36')](_0x37f24a['query'][_0xc1e9('0x36')]));_0x25cdc5[_0xc1e9('0x35')]=_0x25cdc5[_0xc1e9('0x35')][_0xc1e9('0x37')]?_0x25cdc5[_0xc1e9('0x35')]:_0x8a095b[_0xc1e9('0x30')];if(!_0x37f24a['query']['hasOwnProperty'](_0xc1e9('0x5a'))){_0x25cdc5['limit']=qs['limit'](_0x37f24a[_0xc1e9('0x34')][_0xc1e9('0x1f')]);_0x25cdc5[_0xc1e9('0x1d')]=qs[_0xc1e9('0x1d')](_0x37f24a[_0xc1e9('0x34')]['offset']);}_0x25cdc5[_0xc1e9('0x39')]=qs[_0xc1e9('0x3a')](_0x37f24a[_0xc1e9('0x34')]['sort']);_0x25cdc5[_0xc1e9('0x3b')]=qs[_0xc1e9('0x32')](_[_0xc1e9('0x3c')](_0x37f24a['query'],_0x8a095b[_0xc1e9('0x32')]));_0x25cdc5['where'][_0xc1e9('0x54')]=_0x213dbd['id'];if(_0x37f24a['query'][_0xc1e9('0x55')]){_0x25cdc5['where']=_[_0xc1e9('0x3d')](_0x25cdc5['where'],{'$or':_[_0xc1e9('0x2b')](_0x25cdc5[_0xc1e9('0x35')],function(_0x4ff67a){var _0x25c303={};_0x25c303[_0x4ff67a]={'$like':'%'+_0x37f24a[_0xc1e9('0x34')]['filter']+'%'};return _0x25c303;})});}_0x25cdc5=_[_0xc1e9('0x3d')]({},_0x25cdc5,_0x37f24a['options']);return db[_0xc1e9('0x59')][_0xc1e9('0x1e')]({'where':_0x25cdc5[_0xc1e9('0x3b')]})[_0xc1e9('0x25')](function(_0x345fa4){_0xf51620[_0xc1e9('0x1e')]=_0x345fa4;if(_0x37f24a['query'][_0xc1e9('0x3f')]){_0x25cdc5['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc1e9('0x57')](_0x25cdc5);})['then'](function(_0x5cef1a){_0xf51620[_0xc1e9('0x41')]=_0x5cef1a;return _0xf51620;});}})['then'](respondWithFilteredResult(_0x46228b,_0x25cdc5))[_0xc1e9('0x44')](handleError(_0x46228b,null));};function char(_0x4f1c74){return _0xc1e9('0x5b')===typeof _0x4f1c74?String[_0xc1e9('0x5c')][_0xc1e9('0x22')](null,arguments):_0x4f1c74;}function needsEncapsulation(_0x3d2ecd){return!!_0x3d2ecd&&(_0x3d2ecd[_0xc1e9('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x3d2ecd[_0xc1e9('0x5d')]()[_0xc1e9('0x5e')](char(0xa))>=0x0||_0x3d2ecd[_0xc1e9('0x5d')]()[_0xc1e9('0x5e')](char(0x2c))>=0x0||_0x3d2ecd[_0xc1e9('0x5d')]()[_0xc1e9('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x435d2b){var _0x2d2b77=char(0x22),_0x2cadd2='\x5c'+char(0x22),_0x266941=_0x435d2b['toString']()[_0xc1e9('0x5f')](new RegExp(_0x2d2b77,'g'),_0x2cadd2);return _0x2d2b77+_0x266941+_0x2d2b77;}exports[_0xc1e9('0x60')]=function(_0x19a5be,_0x802029,_0xb507c9){var _0x12c5a3,_0x5d7b77;var _0x4855d7={'where':{'ProjectId':_0x19a5be['params']['id']}};if(_0x19a5be[_0xc1e9('0x34')][_0xc1e9('0x61')]){_0x4855d7[_0xc1e9('0x3b')][_0xc1e9('0x62')]=JSON[_0xc1e9('0x63')](_0x19a5be[_0xc1e9('0x34')][_0xc1e9('0x61')]);}return db['JscriptySessionReport'][_0xc1e9('0x57')](_0x4855d7)[_0xc1e9('0x25')](handleEntityNotFound(_0x802029,null))[_0xc1e9('0x25')](function(_0x120770){if(_0x120770){_0x12c5a3=_0x120770;return db[_0xc1e9('0x64')]['findAll']({'where':{'SessionId':{'$in':_[_0xc1e9('0x2b')](_0x12c5a3,'id')},'ProjectId':_0x19a5be['params']['id']},'order':_0xc1e9('0x65')});}})[_0xc1e9('0x25')](handleEntityNotFound(_0x802029,null))['then'](function(_0x27e368){if(_0x27e368){_0x5d7b77=_0x27e368;var _0x18eac8={};for(var _0x23d690=0x0,_0x3f23a0=_0x5d7b77[_0xc1e9('0x37')];_0x23d690<_0x3f23a0;_0x23d690++){if(!_0x18eac8[_0xc1e9('0x38')](_0x5d7b77[_0x23d690]['questionId'])){_0x18eac8[_0x5d7b77[_0x23d690][_0xc1e9('0x66')]]=needsEncapsulation(_0x5d7b77[_0x23d690][_0xc1e9('0x67')])?encapsulate(_0x5d7b77[_0x23d690][_0xc1e9('0x67')]):_0x5d7b77[_0x23d690][_0xc1e9('0x67')];}}var _0x3e0625=[],_0x3f860d={};for(var _0x3b02f8=0x0,_0x38f2db=_0x12c5a3[_0xc1e9('0x37')];_0x3b02f8<_0x38f2db;_0x3b02f8++){_0x3f860d={'ProjectId':_0x19a5be[_0xc1e9('0x4e')]['id'],'SessionId':_0x12c5a3[_0x3b02f8]['id'],'StartTime':moment(_0x12c5a3[_0x3b02f8][_0xc1e9('0x62')])['format'](_0xc1e9('0x68'))};for(var _0x3694cb=0x0,_0x495813=_0x5d7b77[_0xc1e9('0x37')];_0x3694cb<_0x495813;_0x3694cb++){if(_0x5d7b77[_0x3694cb][_0xc1e9('0x69')]==_0x12c5a3[_0x3b02f8]['id']&&_0x18eac8[_0xc1e9('0x38')](_0x5d7b77[_0x3694cb][_0xc1e9('0x66')])){_0x3f860d[_0x18eac8[_0x5d7b77[_0x3694cb][_0xc1e9('0x66')]]]=_0x5d7b77[_0x3694cb][_0xc1e9('0x6a')];}}for(var _0x253e7b in _0x18eac8){if(!_0x3f860d[_0xc1e9('0x38')](_0x18eac8[_0x253e7b])){_0x3f860d[_0x18eac8[_0x253e7b]]=null;}}_0x3e0625['push'](_0x3f860d);}return _0x3e0625;}})[_0xc1e9('0x25')](function(_0x5d87eb){if(!_['isEmpty'](_0x5d87eb)){var _0x2c71eb=toCsv(_0x5d87eb);var _0x224d2b=Date[_0xc1e9('0x6b')]();fs[_0xc1e9('0x6c')](util[_0xc1e9('0x6d')](_0xc1e9('0x6e'),_0x19a5be[_0xc1e9('0x4e')]['id'],_0x224d2b),_0x2c71eb);_0x802029[_0xc1e9('0x6f')]('Content-disposition',_0xc1e9('0x70')+util[_0xc1e9('0x6d')](_0xc1e9('0x71'),_0x19a5be[_0xc1e9('0x4e')]['id'],_0x224d2b));_0x802029[_0xc1e9('0x6f')](_0xc1e9('0x72'),'text/csv');return _0x802029[_0xc1e9('0x73')](util[_0xc1e9('0x6d')](_0xc1e9('0x6e'),_0x19a5be['params']['id'],_0x224d2b));}else{return _0x802029[_0xc1e9('0x19')](0xcc);}})[_0xc1e9('0x44')](handleError(_0x802029,null));}; \ No newline at end of file +var _0x3a0f=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Projects','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','findOne','JscriptySessionReport','nolimit','order','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','starttime','startTime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf'];(function(_0x537290,_0x1f9e4a){var _0x3a5fb3=function(_0x4bfeb7){while(--_0x4bfeb7){_0x537290['push'](_0x537290['shift']());}};_0x3a5fb3(++_0x1f9e4a);}(_0x3a0f,0x75));var _0xf3a0=function(_0x3b3f66,_0x380c16){_0x3b3f66=_0x3b3f66-0x0;var _0xc2762f=_0x3a0f[_0x3b3f66];return _0xc2762f;};'use strict';var emlformat=require(_0xf3a0('0x0'));var rimraf=require(_0xf3a0('0x1'));var zipdir=require(_0xf3a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3a0('0x3'));var moment=require(_0xf3a0('0x4'));var BPromise=require(_0xf3a0('0x5'));var Mustache=require(_0xf3a0('0x6'));var util=require(_0xf3a0('0x7'));var path=require(_0xf3a0('0x8'));var sox=require(_0xf3a0('0x9'));var csv=require(_0xf3a0('0xa'));var ejs=require(_0xf3a0('0xb'));var fs=require('fs');var fs_extra=require(_0xf3a0('0xc'));var _=require(_0xf3a0('0xd'));var squel=require(_0xf3a0('0xe'));var crypto=require(_0xf3a0('0xf'));var jsforce=require(_0xf3a0('0x10'));var deskjs=require(_0xf3a0('0x11'));var toCsv=require(_0xf3a0('0xa'));var querystring=require(_0xf3a0('0x12'));var Papa=require(_0xf3a0('0x13'));var Redis=require('ioredis');var authService=require(_0xf3a0('0x14'));var qs=require(_0xf3a0('0x15'));var as=require(_0xf3a0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3a0('0x17'))('api');var utils=require(_0xf3a0('0x18'));var config=require(_0xf3a0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3a0('0x1a'))['db'];function respondWithStatusCode(_0x4fa31b,_0x3a9749){_0x3a9749=_0x3a9749||0xcc;return function(_0xe36fea){if(_0xe36fea){return _0x4fa31b[_0xf3a0('0x1b')](_0x3a9749);}return _0x4fa31b[_0xf3a0('0x1c')](_0x3a9749)['end']();};}function respondWithResult(_0x485974,_0x30fa46){_0x30fa46=_0x30fa46||0xc8;return function(_0x197435){if(_0x197435){return _0x485974['status'](_0x30fa46)[_0xf3a0('0x1d')](_0x197435);}};}function respondWithFilteredResult(_0x449834,_0x225f41){return function(_0x18e8a9){if(_0x18e8a9){var _0x2d3bbc=typeof _0x225f41[_0xf3a0('0x1e')]===_0xf3a0('0x1f')&&typeof _0x225f41['limit']===_0xf3a0('0x1f');var _0x4fb12f=_0x18e8a9[_0xf3a0('0x20')];var _0x3a7ff1=_0x2d3bbc?0x0:_0x225f41[_0xf3a0('0x1e')];var _0x31c702=_0x2d3bbc?_0x18e8a9[_0xf3a0('0x20')]:_0x225f41[_0xf3a0('0x1e')]+_0x225f41[_0xf3a0('0x21')];var _0x3cd931;if(_0x31c702>=_0x4fb12f){_0x31c702=_0x4fb12f;_0x3cd931=0xc8;}else{_0x3cd931=0xce;}_0x449834[_0xf3a0('0x1c')](_0x3cd931);return _0x449834['set'](_0xf3a0('0x22'),_0x3a7ff1+'-'+_0x31c702+'/'+_0x4fb12f)[_0xf3a0('0x1d')](_0x18e8a9);}return null;};}function patchUpdates(_0x184618){return function(_0x2abfe0){try{jsonpatch[_0xf3a0('0x23')](_0x2abfe0,_0x184618,!![]);}catch(_0x4b0b74){return BPromise[_0xf3a0('0x24')](_0x4b0b74);}return _0x2abfe0[_0xf3a0('0x25')]();};}function saveUpdates(_0x4cb172,_0x21aa68){return function(_0x55fc7e){if(_0x55fc7e){return _0x55fc7e[_0xf3a0('0x26')](_0x4cb172)[_0xf3a0('0x27')](function(_0x9c13bd){return _0x9c13bd;});}return null;};}function removeEntity(_0x3a3138,_0x383ff2){return function(_0x476c05){if(_0x476c05){return _0x476c05[_0xf3a0('0x28')]()[_0xf3a0('0x27')](function(){var _0x18f030=_0x476c05[_0xf3a0('0x29')]({'plain':!![]});var _0x3615e7=_0xf3a0('0x2a');return db['UserProfileResource'][_0xf3a0('0x28')]({'where':{'type':_0x3615e7,'resourceId':_0x18f030['id']}})[_0xf3a0('0x27')](function(){return _0x476c05;});})[_0xf3a0('0x27')](function(){_0x3a3138[_0xf3a0('0x1c')](0xcc)[_0xf3a0('0x2b')]();});}};}function handleEntityNotFound(_0x30f704,_0xb22650){return function(_0x596712){if(!_0x596712){_0x30f704['sendStatus'](0x194);}return _0x596712;};}function handleError(_0x195d3c,_0x403ac8){_0x403ac8=_0x403ac8||0x1f4;return function(_0x43599b){logger[_0xf3a0('0x2c')](_0x43599b[_0xf3a0('0x2d')]);if(_0x43599b['name']){delete _0x43599b[_0xf3a0('0x2e')];}_0x195d3c[_0xf3a0('0x1c')](_0x403ac8)[_0xf3a0('0x2f')](_0x43599b);};}exports[_0xf3a0('0x30')]=function(_0x4fbfeb,_0x1e2a50){var _0x321d65={},_0x3cbeaf={},_0x24c5b9={'count':0x0,'rows':[]};var _0x448433=_[_0xf3a0('0x31')](db['JscriptyProject'][_0xf3a0('0x32')],function(_0x303494){return{'name':_0x303494[_0xf3a0('0x33')],'type':_0x303494[_0xf3a0('0x34')]['key']};});_0x3cbeaf[_0xf3a0('0x35')]=_[_0xf3a0('0x31')](_0x448433,_0xf3a0('0x2e'));_0x3cbeaf[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0x4fbfeb['query']);_0x3cbeaf[_0xf3a0('0x38')]=_[_0xf3a0('0x39')](_0x3cbeaf[_0xf3a0('0x35')],_0x3cbeaf[_0xf3a0('0x36')]);_0x321d65[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x3cbeaf[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x4fbfeb[_0xf3a0('0x36')]['fields']));_0x321d65[_0xf3a0('0x3a')]=_0x321d65[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x321d65[_0xf3a0('0x3a')]:_0x3cbeaf[_0xf3a0('0x35')];if(!_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x3d')]('nolimit')){_0x321d65[_0xf3a0('0x21')]=qs['limit'](_0x4fbfeb['query']['limit']);_0x321d65[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0x321d65['order']=qs[_0xf3a0('0x3e')](_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0x321d65['where']=qs[_0xf3a0('0x38')](_[_0xf3a0('0x3f')](_0x4fbfeb[_0xf3a0('0x36')],_0x3cbeaf['filters']),_0x448433);if(_0x4fbfeb[_0xf3a0('0x36')]['filter']){_0x321d65[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0x321d65[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0x448433,function(_0xb125cf){if(_0xb125cf['type']!==_0xf3a0('0x42')){var _0x2ea097={};_0x2ea097[_0xb125cf[_0xf3a0('0x2e')]]={'$like':'%'+_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x2ea097;}})});}_0x321d65=_[_0xf3a0('0x41')]({},_0x321d65,_0x4fbfeb[_0xf3a0('0x44')]);var _0xaf03a1={'where':_0x321d65[_0xf3a0('0x40')]};return db[_0xf3a0('0x45')][_0xf3a0('0x20')](_0xaf03a1)[_0xf3a0('0x27')](function(_0x22f080){_0x24c5b9[_0xf3a0('0x20')]=_0x22f080;if(_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0x321d65[_0xf3a0('0x47')]=[{'all':!![]}];}return db[_0xf3a0('0x45')][_0xf3a0('0x48')](_0x321d65);})[_0xf3a0('0x27')](function(_0x389a2a){_0x24c5b9[_0xf3a0('0x49')]=_0x389a2a;return _0x24c5b9;})[_0xf3a0('0x27')](respondWithFilteredResult(_0x1e2a50,_0x321d65))[_0xf3a0('0x4a')](handleError(_0x1e2a50,null));};exports[_0xf3a0('0x4b')]=function(_0x56bc57,_0x138be2){var _0x2a3247={'raw':![],'where':{'id':_0x56bc57[_0xf3a0('0x4c')]['id']}},_0x15f65d={};_0x15f65d['model']=_[_0xf3a0('0x37')](db['JscriptyProject'][_0xf3a0('0x32')]);_0x15f65d['query']=_['keys'](_0x56bc57[_0xf3a0('0x36')]);_0x15f65d[_0xf3a0('0x38')]=_[_0xf3a0('0x39')](_0x15f65d[_0xf3a0('0x35')],_0x15f65d[_0xf3a0('0x36')]);_0x2a3247[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x15f65d[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x56bc57[_0xf3a0('0x36')][_0xf3a0('0x3b')]));_0x2a3247[_0xf3a0('0x3a')]=_0x2a3247[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x2a3247['attributes']:_0x15f65d[_0xf3a0('0x35')];if(_0x56bc57['query'][_0xf3a0('0x46')]){_0x2a3247[_0xf3a0('0x47')]=[{'all':!![]}];}_0x2a3247=_[_0xf3a0('0x41')]({},_0x2a3247,_0x56bc57[_0xf3a0('0x44')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4d')](_0x2a3247)[_0xf3a0('0x27')](handleEntityNotFound(_0x138be2,null))['then'](respondWithResult(_0x138be2,null))[_0xf3a0('0x4a')](handleError(_0x138be2,null));};exports[_0xf3a0('0x4e')]=function(_0x4f4a7b,_0x189861){return db[_0xf3a0('0x45')][_0xf3a0('0x4e')](_0x4f4a7b[_0xf3a0('0x4f')],{})[_0xf3a0('0x27')](function(_0x223dcf){var _0x3746c1=_0x4f4a7b[_0xf3a0('0x50')][_0xf3a0('0x29')]({'plain':!![]});if(!_0x3746c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3746c1[_0xf3a0('0x51')]===_0xf3a0('0x50')){var _0x4e2eaf=_0x223dcf[_0xf3a0('0x29')]({'plain':!![]});var _0x1c7550=_0xf3a0('0x2a');return db[_0xf3a0('0x52')][_0xf3a0('0x4d')]({'where':{'name':_0x1c7550,'userProfileId':_0x3746c1[_0xf3a0('0x53')]},'raw':!![]})[_0xf3a0('0x27')](function(_0x3dac31){if(_0x3dac31&&_0x3dac31[_0xf3a0('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e2eaf['name'],'resourceId':_0x4e2eaf['id'],'type':_0x3dac31[_0xf3a0('0x2e')],'sectionId':_0x3dac31['id']},{})['then'](function(){return _0x223dcf;});}else{return _0x223dcf;}})[_0xf3a0('0x4a')](function(_0x9a3bcc){logger[_0xf3a0('0x2c')](_0xf3a0('0x55'),_0x9a3bcc);throw _0x9a3bcc;});}return _0x223dcf;})[_0xf3a0('0x27')](respondWithResult(_0x189861,0xc9))[_0xf3a0('0x4a')](handleError(_0x189861,null));};exports[_0xf3a0('0x56')]=function(_0x59626f,_0x58f42d){var _0x1ad008={'where':{'id':_0x59626f[_0xf3a0('0x4c')]['id']}},_0xa1a37b={};_0xa1a37b[_0xf3a0('0x35')]=_[_0xf3a0('0x37')](db[_0xf3a0('0x45')]['rawAttributes']);_0x1ad008['attributes']=_['intersection'](_0xa1a37b[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x59626f['query'][_0xf3a0('0x3b')]));_0x1ad008[_0xf3a0('0x3a')]=_0x1ad008[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x1ad008[_0xf3a0('0x3a')]:_0xa1a37b[_0xf3a0('0x35')];if(_0x59626f['query']['includeAll']){_0x1ad008[_0xf3a0('0x47')]=[{'all':!![]}];}_0x1ad008=_[_0xf3a0('0x41')]({},_0x1ad008,_0x59626f[_0xf3a0('0x44')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4d')](_0x1ad008)[_0xf3a0('0x27')](handleEntityNotFound(_0x58f42d,null))[_0xf3a0('0x27')](function(_0x6e87cf){if(_0x6e87cf){var _0x380cd0=_0x6e87cf[_0xf3a0('0x29')]({'plain':!![]});_0x380cd0=qs[_0xf3a0('0x57')](_0x380cd0,['id',_0xf3a0('0x58'),_0xf3a0('0x59')]);_0x59626f[_0xf3a0('0x4f')]=_[_0xf3a0('0x57')](_0x59626f[_0xf3a0('0x4f')],['id','createdAt',_0xf3a0('0x59')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4e')](_[_0xf3a0('0x41')](_0x380cd0,_0x59626f[_0xf3a0('0x4f')]),{'include':_0x59626f[_0xf3a0('0x36')][_0xf3a0('0x46')]?[{'all':!![]}]:undefined})[_0xf3a0('0x27')](function(_0x2b5bbd){var _0x12b146=_0x59626f[_0xf3a0('0x50')]['get']({'plain':!![]});if(!_0x12b146)throw new Error(_0xf3a0('0x5a'));if(_0x12b146['role']==='user'){var _0x1911ec=_0x2b5bbd[_0xf3a0('0x29')]({'plain':!![]});var _0x19223d='Projects';return db[_0xf3a0('0x52')][_0xf3a0('0x4d')]({'where':{'name':_0x19223d,'userProfileId':_0x12b146[_0xf3a0('0x53')]},'raw':!![]})[_0xf3a0('0x27')](function(_0x3396b6){if(_0x3396b6&&_0x3396b6['autoAssociation']===0x0){return db[_0xf3a0('0x5b')]['create']({'name':_0x1911ec['name'],'resourceId':_0x1911ec['id'],'type':_0x3396b6[_0xf3a0('0x2e')],'sectionId':_0x3396b6['id']},{})[_0xf3a0('0x27')](function(){return _0x2b5bbd;});}else{return _0x2b5bbd;}})[_0xf3a0('0x4a')](function(_0x152695){logger[_0xf3a0('0x2c')](_0xf3a0('0x55'),_0x152695);throw _0x152695;});}return _0x2b5bbd;});}})[_0xf3a0('0x27')](respondWithResult(_0x58f42d,0xc9))[_0xf3a0('0x4a')](handleError(_0x58f42d,null));};exports[_0xf3a0('0x26')]=function(_0x3c6bfa,_0xed6325){if(_0x3c6bfa[_0xf3a0('0x4f')]['id']){delete _0x3c6bfa[_0xf3a0('0x4f')]['id'];}return db[_0xf3a0('0x45')][_0xf3a0('0x4d')]({'where':{'id':_0x3c6bfa[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0xed6325,null))[_0xf3a0('0x27')](saveUpdates(_0x3c6bfa[_0xf3a0('0x4f')],null))[_0xf3a0('0x27')](respondWithResult(_0xed6325,null))['catch'](handleError(_0xed6325,null));};exports['destroy']=function(_0x7845c7,_0x17cd20){return db[_0xf3a0('0x45')][_0xf3a0('0x4d')]({'where':{'id':_0x7845c7['params']['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x17cd20,null))['then'](removeEntity(_0x17cd20,null))[_0xf3a0('0x4a')](handleError(_0x17cd20,null));};exports['getSessions']=function(_0xb65e85,_0x5673c8,_0x41d54c){var _0x381b4f={'raw':!![],'where':{}};var _0x1f869c={};var _0x172aaf={'count':0x0,'rows':[]};return db[_0xf3a0('0x45')][_0xf3a0('0x5c')]({'where':{'id':_0xb65e85[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x5673c8,null))[_0xf3a0('0x27')](function(_0xc12891){if(_0xc12891){_0x1f869c[_0xf3a0('0x35')]=_['keys'](db[_0xf3a0('0x5d')][_0xf3a0('0x32')]);_0x1f869c[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0xb65e85[_0xf3a0('0x36')]);_0x1f869c[_0xf3a0('0x38')]=_['intersection'](_0x1f869c[_0xf3a0('0x35')],_0x1f869c['query']);_0x381b4f[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x1f869c[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0xb65e85['query']['fields']));_0x381b4f[_0xf3a0('0x3a')]=_0x381b4f['attributes'][_0xf3a0('0x3c')]?_0x381b4f[_0xf3a0('0x3a')]:_0x1f869c[_0xf3a0('0x35')];if(!_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x3d')](_0xf3a0('0x5e'))){_0x381b4f[_0xf3a0('0x21')]=qs[_0xf3a0('0x21')](_0xb65e85['query'][_0xf3a0('0x21')]);_0x381b4f[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0x381b4f[_0xf3a0('0x5f')]=qs['sort'](_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0x381b4f[_0xf3a0('0x40')]=qs[_0xf3a0('0x38')](_[_0xf3a0('0x3f')](_0xb65e85[_0xf3a0('0x36')],_0x1f869c[_0xf3a0('0x38')]));_0x381b4f[_0xf3a0('0x40')][_0xf3a0('0x60')]=_0xc12891['id'];if(_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x43')]){_0x381b4f[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0x381b4f[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0x381b4f[_0xf3a0('0x3a')],function(_0x12cfea){var _0x27c657={};_0x27c657[_0x12cfea]={'$like':'%'+_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x27c657;})});}_0x381b4f=_[_0xf3a0('0x41')]({},_0x381b4f,_0xb65e85['options']);return db[_0xf3a0('0x5d')][_0xf3a0('0x20')]({'where':_0x381b4f[_0xf3a0('0x40')]})[_0xf3a0('0x27')](function(_0x59f7aa){_0x172aaf[_0xf3a0('0x20')]=_0x59f7aa;if(_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0x381b4f['include']=[{'all':!![]}];}return db[_0xf3a0('0x5d')][_0xf3a0('0x48')](_0x381b4f);})[_0xf3a0('0x27')](function(_0x4cd31e){_0x172aaf[_0xf3a0('0x49')]=_0x4cd31e;return _0x172aaf;});}})[_0xf3a0('0x27')](respondWithFilteredResult(_0x5673c8,_0x381b4f))[_0xf3a0('0x4a')](handleError(_0x5673c8,null));};exports[_0xf3a0('0x61')]=function(_0x1bb8c5,_0x4eb9f5,_0x332065){var _0xafc224={'raw':!![],'where':{}};var _0x56b0ad={};var _0x14af35={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf3a0('0x5c')]({'where':{'id':_0x1bb8c5[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x4eb9f5,null))[_0xf3a0('0x27')](function(_0x3a81d1){if(_0x3a81d1){_0x56b0ad[_0xf3a0('0x35')]=_[_0xf3a0('0x37')](db['JscriptyAnswerReport'][_0xf3a0('0x32')]);_0x56b0ad[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0x1bb8c5[_0xf3a0('0x36')]);_0x56b0ad[_0xf3a0('0x38')]=_['intersection'](_0x56b0ad['model'],_0x56b0ad['query']);_0xafc224[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x56b0ad[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x3b')]));_0xafc224[_0xf3a0('0x3a')]=_0xafc224[_0xf3a0('0x3a')]['length']?_0xafc224[_0xf3a0('0x3a')]:_0x56b0ad[_0xf3a0('0x35')];if(!_0x1bb8c5['query'][_0xf3a0('0x3d')]('nolimit')){_0xafc224[_0xf3a0('0x21')]=qs[_0xf3a0('0x21')](_0x1bb8c5[_0xf3a0('0x36')]['limit']);_0xafc224[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0xafc224[_0xf3a0('0x5f')]=qs['sort'](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0xafc224[_0xf3a0('0x40')]=qs['filters'](_[_0xf3a0('0x3f')](_0x1bb8c5[_0xf3a0('0x36')],_0x56b0ad[_0xf3a0('0x38')]));_0xafc224[_0xf3a0('0x40')][_0xf3a0('0x60')]=_0x3a81d1['id'];if(_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x43')]){_0xafc224[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0xafc224[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0xafc224['attributes'],function(_0x3b6abb){var _0x340560={};_0x340560[_0x3b6abb]={'$like':'%'+_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x340560;})});}_0xafc224=_[_0xf3a0('0x41')]({},_0xafc224,_0x1bb8c5[_0xf3a0('0x44')]);return db['JscriptyAnswerReport'][_0xf3a0('0x20')]({'where':_0xafc224[_0xf3a0('0x40')]})['then'](function(_0x5768de){_0x14af35['count']=_0x5768de;if(_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0xafc224['include']=[{'all':!![]}];}return db[_0xf3a0('0x62')][_0xf3a0('0x48')](_0xafc224);})[_0xf3a0('0x27')](function(_0x510357){_0x14af35[_0xf3a0('0x49')]=_0x510357;return _0x14af35;});}})[_0xf3a0('0x27')](respondWithFilteredResult(_0x4eb9f5,_0xafc224))[_0xf3a0('0x4a')](handleError(_0x4eb9f5,null));};function char(_0x17665a){return _0xf3a0('0x63')===typeof _0x17665a?String['fromCharCode'][_0xf3a0('0x23')](null,arguments):_0x17665a;}function needsEncapsulation(_0xae4df9){return!!_0xae4df9&&(_0xae4df9[_0xf3a0('0x64')]()[_0xf3a0('0x65')](char(0xd))>=0x0||_0xae4df9[_0xf3a0('0x64')]()['indexOf'](char(0xa))>=0x0||_0xae4df9[_0xf3a0('0x64')]()['indexOf'](char(0x2c))>=0x0||_0xae4df9[_0xf3a0('0x64')]()[_0xf3a0('0x65')](char(0x22))>=0x0);}function encapsulate(_0x1d5e5e){var _0x4161ae=char(0x22),_0x2a2a86='\x5c'+char(0x22),_0x5878b8=_0x1d5e5e[_0xf3a0('0x64')]()[_0xf3a0('0x66')](new RegExp(_0x4161ae,'g'),_0x2a2a86);return _0x4161ae+_0x5878b8+_0x4161ae;}exports['getSummary']=function(_0x478e4c,_0x2acbe6,_0x68bab0){var _0x2d7dff,_0x263017;var _0x9a106={'where':{'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id']}};if(_0x478e4c['query']['startTime']){_0x9a106[_0xf3a0('0x40')][_0xf3a0('0x67')]=JSON['parse'](_0x478e4c[_0xf3a0('0x36')][_0xf3a0('0x68')]);}return db[_0xf3a0('0x5d')][_0xf3a0('0x48')](_0x9a106)[_0xf3a0('0x27')](handleEntityNotFound(_0x2acbe6,null))['then'](function(_0x52ad94){if(_0x52ad94){_0x2d7dff=_0x52ad94;return db['JscriptyQuestionReport'][_0xf3a0('0x48')]({'where':{'SessionId':{'$in':_['map'](_0x2d7dff,'id')},'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id']},'order':'-createdAt'});}})[_0xf3a0('0x27')](handleEntityNotFound(_0x2acbe6,null))[_0xf3a0('0x27')](function(_0x11a560){if(_0x11a560){_0x263017=_0x11a560;var _0x3d83a7={};for(var _0x5abd99=0x0,_0x489db0=_0x263017[_0xf3a0('0x3c')];_0x5abd99<_0x489db0;_0x5abd99++){if(!_0x3d83a7['hasOwnProperty'](_0x263017[_0x5abd99][_0xf3a0('0x69')])){_0x3d83a7[_0x263017[_0x5abd99]['questionId']]=needsEncapsulation(_0x263017[_0x5abd99]['question'])?encapsulate(_0x263017[_0x5abd99][_0xf3a0('0x6a')]):_0x263017[_0x5abd99][_0xf3a0('0x6a')];}}var _0x535817=[],_0x5c58bf={};for(var _0x59d312=0x0,_0x3ea7b4=_0x2d7dff[_0xf3a0('0x3c')];_0x59d312<_0x3ea7b4;_0x59d312++){_0x5c58bf={'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id'],'SessionId':_0x2d7dff[_0x59d312]['id'],'StartTime':moment(_0x2d7dff[_0x59d312]['starttime'])[_0xf3a0('0x6b')](_0xf3a0('0x6c'))};for(var _0x16a79b=0x0,_0x1041ca=_0x263017[_0xf3a0('0x3c')];_0x16a79b<_0x1041ca;_0x16a79b++){if(_0x263017[_0x16a79b][_0xf3a0('0x6d')]==_0x2d7dff[_0x59d312]['id']&&_0x3d83a7[_0xf3a0('0x3d')](_0x263017[_0x16a79b]['questionId'])){_0x5c58bf[_0x3d83a7[_0x263017[_0x16a79b][_0xf3a0('0x69')]]]=_0x263017[_0x16a79b]['answer'];}}for(var _0x1b4954 in _0x3d83a7){if(!_0x5c58bf['hasOwnProperty'](_0x3d83a7[_0x1b4954])){_0x5c58bf[_0x3d83a7[_0x1b4954]]=null;}}_0x535817[_0xf3a0('0x6e')](_0x5c58bf);}return _0x535817;}})[_0xf3a0('0x27')](function(_0x1bdd22){if(!_['isEmpty'](_0x1bdd22)){var _0x2b421a=toCsv(_0x1bdd22);var _0x284e8d=Date[_0xf3a0('0x6f')]();fs['writeFileSync'](util[_0xf3a0('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d),_0x2b421a);_0x2acbe6[_0xf3a0('0x70')]('Content-disposition',_0xf3a0('0x71')+util[_0xf3a0('0x6b')](_0xf3a0('0x72'),_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d));_0x2acbe6[_0xf3a0('0x70')](_0xf3a0('0x73'),_0xf3a0('0x74'));return _0x2acbe6[_0xf3a0('0x75')](util[_0xf3a0('0x6b')](_0xf3a0('0x76'),_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d));}else{return _0x2acbe6[_0xf3a0('0x1b')](0xcc);}})['catch'](handleError(_0x2acbe6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index dcd0b09..5040873 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 _0x1af3=['exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x1af3,0x1ca));var _0x31af=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x1af3[_0x1655bb];return _0x5e2020;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var rp=require(_0x31af('0x6'));var fs=require('fs');var path=require(_0x31af('0x7'));var rimraf=require(_0x31af('0x8'));var config=require(_0x31af('0x9'));var attributes=require('./jscriptyProject.attributes');module[_0x31af('0xa')]=function(_0x416162,_0x1ac3f6){return _0x416162[_0x31af('0xb')]('JscriptyProject',attributes,{'tableName':_0x31af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1670=['lodash','util','api','bluebird','request-promise','path','rimraf','exports','define','JscriptyProject','jscripty_projects'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x1670,0x9a));var _0x0167=function(_0x19feff,_0x5548da){_0x19feff=_0x19feff-0x0;var _0x5c1369=_0x1670[_0x19feff];return _0x5c1369;};'use strict';var _=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var logger=require('../../config/logger')(_0x0167('0x2'));var moment=require('moment');var BPromise=require(_0x0167('0x3'));var rp=require(_0x0167('0x4'));var fs=require('fs');var path=require(_0x0167('0x5'));var rimraf=require(_0x0167('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x0167('0x7')]=function(_0x1ae650,_0x295e51){return _0x1ae650[_0x0167('0x8')](_0x0167('0x9'),attributes,{'tableName':_0x0167('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 4d4b562..4be6f60 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x54fe8a,_0x5a58bb){var _0x2bad30=function(_0x206f71){while(--_0x206f71){_0x54fe8a['push'](_0x54fe8a['shift']());}};_0x2bad30(++_0x5a58bb);}(_0xe706,0xa3));var _0x6e70=function(_0x1aab9d,_0x503b9e){_0x1aab9d=_0x1aab9d-0x0;var _0x3840b2=_0xe706[_0x1aab9d];return _0x3840b2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xb7e7=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x4d6e23,_0x81ed09){var _0x2bd0a0=function(_0x3b5240){while(--_0x3b5240){_0x4d6e23['push'](_0x4d6e23['shift']());}};_0x2bd0a0(++_0x81ed09);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 719b60a..b162c3d 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 _0xab34=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','exports'];(function(_0x142ba8,_0x37c133){var _0x3ff9e0=function(_0x49299c){while(--_0x49299c){_0x142ba8['push'](_0x142ba8['shift']());}};_0x3ff9e0(++_0x37c133);}(_0xab34,0x190));var _0x4ab3=function(_0x307904,_0x509b46){_0x307904=_0x307904-0x0;var _0x1b193f=_0xab34[_0x307904];return _0x1b193f;};'use strict';var multer=require(_0x4ab3('0x0'));var util=require(_0x4ab3('0x1'));var path=require(_0x4ab3('0x2'));var timeout=require(_0x4ab3('0x3'));var express=require(_0x4ab3('0x4'));var router=express[_0x4ab3('0x5')]();var fs_extra=require(_0x4ab3('0x6'));var auth=require(_0x4ab3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4ab3('0x8'));var controller=require(_0x4ab3('0x9'));router[_0x4ab3('0xa')]('/',auth[_0x4ab3('0xb')](),controller[_0x4ab3('0xc')]);router[_0x4ab3('0xa')](_0x4ab3('0xd'),auth[_0x4ab3('0xb')](),controller['describe']);router[_0x4ab3('0xa')](_0x4ab3('0xe'),auth[_0x4ab3('0xb')](),controller[_0x4ab3('0xf')]);router[_0x4ab3('0x10')]('/',auth['isAuthenticated'](),controller[_0x4ab3('0x11')]);router['put'](_0x4ab3('0xe'),auth['isAuthenticated'](),controller[_0x4ab3('0x12')]);router['delete'](_0x4ab3('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4ab3('0x13')]=router; \ No newline at end of file +var _0x52bd=['connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','delete','destroy','multer','util','path'];(function(_0x44353d,_0x267761){var _0x93dd90=function(_0x218cc1){while(--_0x218cc1){_0x44353d['push'](_0x44353d['shift']());}};_0x93dd90(++_0x267761);}(_0x52bd,0xb1));var _0xd52b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x52bd[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xd52b('0x0'));var util=require(_0xd52b('0x1'));var path=require(_0xd52b('0x2'));var timeout=require(_0xd52b('0x3'));var express=require(_0xd52b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd52b('0x5'));var config=require(_0xd52b('0x6'));var controller=require(_0xd52b('0x7'));router[_0xd52b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd52b('0x9')]);router['get']('/describe',auth[_0xd52b('0xa')](),controller[_0xd52b('0xb')]);router[_0xd52b('0x8')](_0xd52b('0xc'),auth[_0xd52b('0xa')](),controller[_0xd52b('0xd')]);router['post']('/',auth[_0xd52b('0xa')](),controller[_0xd52b('0xe')]);router[_0xd52b('0xf')](_0xd52b('0xc'),auth[_0xd52b('0xa')](),controller['update']);router[_0xd52b('0x10')](_0xd52b('0xc'),auth[_0xd52b('0xa')](),controller[_0xd52b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 1a11815..07b608a 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x2a6760,_0x4d6481){_0x2a6760=_0x2a6760-0x0;var _0x1f81d9=_0x7a54[_0x2a6760];return _0x1f81d9;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd273,_0x31b178){_0x1fd273=_0x1fd273-0x0;var _0x576b78=_0x7a54[_0x1fd273];return _0x576b78;};'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 550acb1..4488285 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 _0xb9d5=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','show','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','JscriptyQuestionReport','rawAttributes'];(function(_0xea0b68,_0x50bd53){var _0x596b78=function(_0x50f8aa){while(--_0x50f8aa){_0xea0b68['push'](_0xea0b68['shift']());}};_0x596b78(++_0x50bd53);}(_0xb9d5,0x120));var _0x5b9d=function(_0x184865,_0x1fc039){_0x184865=_0x184865-0x0;var _0x191de8=_0xb9d5[_0x184865];return _0x191de8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b9d('0x0'));var zipdir=require(_0x5b9d('0x1'));var jsonpatch=require(_0x5b9d('0x2'));var rp=require(_0x5b9d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b9d('0x4'));var util=require(_0x5b9d('0x5'));var path=require('path');var sox=require(_0x5b9d('0x6'));var csv=require(_0x5b9d('0x7'));var ejs=require(_0x5b9d('0x8'));var fs=require('fs');var fs_extra=require(_0x5b9d('0x9'));var _=require(_0x5b9d('0xa'));var squel=require('squel');var crypto=require(_0x5b9d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5b9d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5b9d('0xc'));var config=require(_0x5b9d('0xd'));var licenseUtil=require(_0x5b9d('0xe'));var db=require(_0x5b9d('0xf'))['db'];function respondWithStatusCode(_0x3e53f8,_0x5362e9){_0x5362e9=_0x5362e9||0xcc;return function(_0x5592c2){if(_0x5592c2){return _0x3e53f8['sendStatus'](_0x5362e9);}return _0x3e53f8[_0x5b9d('0x10')](_0x5362e9)[_0x5b9d('0x11')]();};}function respondWithResult(_0xdc3aac,_0x1f0ef9){_0x1f0ef9=_0x1f0ef9||0xc8;return function(_0x895de2){if(_0x895de2){return _0xdc3aac['status'](_0x1f0ef9)[_0x5b9d('0x12')](_0x895de2);}};}function respondWithFilteredResult(_0x57f3f9,_0x50d2e6){return function(_0x2a0508){if(_0x2a0508){var _0x365f78=typeof _0x50d2e6[_0x5b9d('0x13')]===_0x5b9d('0x14')&&typeof _0x50d2e6[_0x5b9d('0x15')]==='undefined';var _0x44f366=_0x2a0508[_0x5b9d('0x16')];var _0x13be9f=_0x365f78?0x0:_0x50d2e6[_0x5b9d('0x13')];var _0x29ab7=_0x365f78?_0x2a0508['count']:_0x50d2e6['offset']+_0x50d2e6['limit'];var _0x14154c;if(_0x29ab7>=_0x44f366){_0x29ab7=_0x44f366;_0x14154c=0xc8;}else{_0x14154c=0xce;}_0x57f3f9[_0x5b9d('0x10')](_0x14154c);return _0x57f3f9[_0x5b9d('0x17')](_0x5b9d('0x18'),_0x13be9f+'-'+_0x29ab7+'/'+_0x44f366)[_0x5b9d('0x12')](_0x2a0508);}return null;};}function patchUpdates(_0x4f8018){return function(_0x2b6703){try{jsonpatch[_0x5b9d('0x19')](_0x2b6703,_0x4f8018,!![]);}catch(_0x370427){return BPromise[_0x5b9d('0x1a')](_0x370427);}return _0x2b6703[_0x5b9d('0x1b')]();};}function saveUpdates(_0x26a9ae,_0x2d580b){return function(_0x2b82df){if(_0x2b82df){return _0x2b82df[_0x5b9d('0x1c')](_0x26a9ae)[_0x5b9d('0x1d')](function(_0x275de1){return _0x275de1;});}return null;};}function removeEntity(_0x2c78b1,_0x1c37bd){return function(_0x1185f8){if(_0x1185f8){return _0x1185f8[_0x5b9d('0x1e')]()['then'](function(){_0x2c78b1[_0x5b9d('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f90cf,_0x434125){return function(_0x22f6c1){if(!_0x22f6c1){_0x3f90cf[_0x5b9d('0x1f')](0x194);}return _0x22f6c1;};}function handleError(_0x3e32b2,_0x2118f6){_0x2118f6=_0x2118f6||0x1f4;return function(_0x1af0ea){logger['error'](_0x1af0ea['stack']);if(_0x1af0ea['name']){delete _0x1af0ea[_0x5b9d('0x20')];}_0x3e32b2[_0x5b9d('0x10')](_0x2118f6)[_0x5b9d('0x21')](_0x1af0ea);};}exports[_0x5b9d('0x22')]=function(_0x5edc2b,_0x3d4589){var _0x138dfe={},_0x6b1fda={},_0x32e982={'count':0x0,'rows':[]};var _0x1ddff1=_['map'](db[_0x5b9d('0x23')][_0x5b9d('0x24')],function(_0x49e704){return{'name':_0x49e704[_0x5b9d('0x25')],'type':_0x49e704[_0x5b9d('0x26')]['key']};});_0x6b1fda[_0x5b9d('0x27')]=_['map'](_0x1ddff1,_0x5b9d('0x20'));_0x6b1fda[_0x5b9d('0x28')]=_[_0x5b9d('0x29')](_0x5edc2b[_0x5b9d('0x28')]);_0x6b1fda[_0x5b9d('0x2a')]=_[_0x5b9d('0x2b')](_0x6b1fda[_0x5b9d('0x27')],_0x6b1fda[_0x5b9d('0x28')]);_0x138dfe[_0x5b9d('0x2c')]=_[_0x5b9d('0x2b')](_0x6b1fda[_0x5b9d('0x27')],qs[_0x5b9d('0x2d')](_0x5edc2b['query']['fields']));_0x138dfe['attributes']=_0x138dfe[_0x5b9d('0x2c')][_0x5b9d('0x2e')]?_0x138dfe[_0x5b9d('0x2c')]:_0x6b1fda[_0x5b9d('0x27')];if(!_0x5edc2b[_0x5b9d('0x28')]['hasOwnProperty']('nolimit')){_0x138dfe['limit']=qs[_0x5b9d('0x15')](_0x5edc2b[_0x5b9d('0x28')]['limit']);_0x138dfe[_0x5b9d('0x13')]=qs[_0x5b9d('0x13')](_0x5edc2b[_0x5b9d('0x28')][_0x5b9d('0x13')]);}_0x138dfe[_0x5b9d('0x2f')]=qs[_0x5b9d('0x30')](_0x5edc2b['query']['sort']);_0x138dfe[_0x5b9d('0x31')]=qs[_0x5b9d('0x2a')](_['pick'](_0x5edc2b[_0x5b9d('0x28')],_0x6b1fda['filters']),_0x1ddff1);if(_0x5edc2b[_0x5b9d('0x28')]['filter']){_0x138dfe[_0x5b9d('0x31')]=_[_0x5b9d('0x32')](_0x138dfe[_0x5b9d('0x31')],{'$or':_[_0x5b9d('0x33')](_0x1ddff1,function(_0x46e815){if(_0x46e815[_0x5b9d('0x26')]!==_0x5b9d('0x34')){var _0x1aef20={};_0x1aef20[_0x46e815[_0x5b9d('0x20')]]={'$like':'%'+_0x5edc2b['query'][_0x5b9d('0x35')]+'%'};return _0x1aef20;}})});}_0x138dfe=_['merge']({},_0x138dfe,_0x5edc2b[_0x5b9d('0x36')]);var _0xf1bca6={'where':_0x138dfe[_0x5b9d('0x31')]};return db[_0x5b9d('0x23')][_0x5b9d('0x16')](_0xf1bca6)[_0x5b9d('0x1d')](function(_0x4e4384){_0x32e982['count']=_0x4e4384;if(_0x5edc2b[_0x5b9d('0x28')][_0x5b9d('0x37')]){_0x138dfe['include']=[{'all':!![]}];}return db[_0x5b9d('0x23')][_0x5b9d('0x38')](_0x138dfe);})['then'](function(_0x39fa76){_0x32e982[_0x5b9d('0x39')]=_0x39fa76;return _0x32e982;})[_0x5b9d('0x1d')](respondWithFilteredResult(_0x3d4589,_0x138dfe))['catch'](handleError(_0x3d4589,null));};exports[_0x5b9d('0x3a')]=function(_0x581133,_0x581460){var _0x514aba={'raw':!![],'where':{'id':_0x581133['params']['id']}},_0x29664e={};_0x29664e[_0x5b9d('0x27')]=_[_0x5b9d('0x29')](db[_0x5b9d('0x23')][_0x5b9d('0x24')]);_0x29664e['query']=_['keys'](_0x581133['query']);_0x29664e['filters']=_['intersection'](_0x29664e['model'],_0x29664e[_0x5b9d('0x28')]);_0x514aba[_0x5b9d('0x2c')]=_[_0x5b9d('0x2b')](_0x29664e['model'],qs['fields'](_0x581133[_0x5b9d('0x28')][_0x5b9d('0x2d')]));_0x514aba[_0x5b9d('0x2c')]=_0x514aba[_0x5b9d('0x2c')][_0x5b9d('0x2e')]?_0x514aba[_0x5b9d('0x2c')]:_0x29664e[_0x5b9d('0x27')];if(_0x581133[_0x5b9d('0x28')]['includeAll']){_0x514aba['include']=[{'all':!![]}];}_0x514aba=_[_0x5b9d('0x32')]({},_0x514aba,_0x581133[_0x5b9d('0x36')]);return db[_0x5b9d('0x23')][_0x5b9d('0x3b')](_0x514aba)['then'](handleEntityNotFound(_0x581460,null))[_0x5b9d('0x1d')](respondWithResult(_0x581460,null))[_0x5b9d('0x3c')](handleError(_0x581460,null));};exports[_0x5b9d('0x3d')]=function(_0x4df711,_0x3dbdf3){return db['JscriptyQuestionReport'][_0x5b9d('0x3d')](_0x4df711[_0x5b9d('0x3e')],{})[_0x5b9d('0x1d')](respondWithResult(_0x3dbdf3,0xc9))[_0x5b9d('0x3c')](handleError(_0x3dbdf3,null));};exports[_0x5b9d('0x1c')]=function(_0x4e6be4,_0x1cb04e){if(_0x4e6be4[_0x5b9d('0x3e')]['id']){delete _0x4e6be4['body']['id'];}return db[_0x5b9d('0x23')][_0x5b9d('0x3b')]({'where':{'id':_0x4e6be4[_0x5b9d('0x3f')]['id']}})[_0x5b9d('0x1d')](handleEntityNotFound(_0x1cb04e,null))[_0x5b9d('0x1d')](saveUpdates(_0x4e6be4[_0x5b9d('0x3e')],null))[_0x5b9d('0x1d')](respondWithResult(_0x1cb04e,null))['catch'](handleError(_0x1cb04e,null));};exports[_0x5b9d('0x1e')]=function(_0x47f13e,_0x5bfa18){return db[_0x5b9d('0x23')]['find']({'where':{'id':_0x47f13e['params']['id']}})[_0x5b9d('0x1d')](handleEntityNotFound(_0x5bfa18,null))[_0x5b9d('0x1d')](removeEntity(_0x5bfa18,null))['catch'](handleError(_0x5bfa18,null));};exports[_0x5b9d('0x40')]=function(_0x18ee91,_0x221c1f){return db[_0x5b9d('0x23')]['describe']()[_0x5b9d('0x1d')](respondWithResult(_0x221c1f,null))['catch'](handleError(_0x221c1f,null));}; \ No newline at end of file +var _0xd1ad=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x3e88f0,_0x27d2b0){var _0x106a66=function(_0x4c2fab){while(--_0x4c2fab){_0x3e88f0['push'](_0x3e88f0['shift']());}};_0x106a66(++_0x27d2b0);}(_0xd1ad,0x162));var _0xdd1a=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xd1ad[_0x2459fd];return _0x364cd2;};'use strict';var emlformat=require(_0xdd1a('0x0'));var rimraf=require(_0xdd1a('0x1'));var zipdir=require(_0xdd1a('0x2'));var jsonpatch=require(_0xdd1a('0x3'));var rp=require('request-promise');var moment=require(_0xdd1a('0x4'));var BPromise=require(_0xdd1a('0x5'));var Mustache=require('mustache');var util=require(_0xdd1a('0x6'));var path=require(_0xdd1a('0x7'));var sox=require(_0xdd1a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd1a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdd1a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdd1a('0xb'));var toCsv=require(_0xdd1a('0xc'));var querystring=require(_0xdd1a('0xd'));var Papa=require(_0xdd1a('0xe'));var Redis=require(_0xdd1a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdd1a('0x10'));var as=require(_0xdd1a('0x11'));var hardwareService=require(_0xdd1a('0x12'));var logger=require(_0xdd1a('0x13'))(_0xdd1a('0x14'));var utils=require('../../config/utils');var config=require(_0xdd1a('0x15'));var licenseUtil=require(_0xdd1a('0x16'));var db=require(_0xdd1a('0x17'))['db'];function respondWithStatusCode(_0x58f8ae,_0x3051cd){_0x3051cd=_0x3051cd||0xcc;return function(_0x5eb7b6){if(_0x5eb7b6){return _0x58f8ae['sendStatus'](_0x3051cd);}return _0x58f8ae['status'](_0x3051cd)[_0xdd1a('0x18')]();};}function respondWithResult(_0x57cd0f,_0x5c9384){_0x5c9384=_0x5c9384||0xc8;return function(_0x212fd8){if(_0x212fd8){return _0x57cd0f[_0xdd1a('0x19')](_0x5c9384)[_0xdd1a('0x1a')](_0x212fd8);}};}function respondWithFilteredResult(_0x45eb1f,_0x349f49){return function(_0x4014a0){if(_0x4014a0){var _0x6e95f0=typeof _0x349f49[_0xdd1a('0x1b')]===_0xdd1a('0x1c')&&typeof _0x349f49['limit']===_0xdd1a('0x1c');var _0x3f6924=_0x4014a0['count'];var _0x1526ff=_0x6e95f0?0x0:_0x349f49[_0xdd1a('0x1b')];var _0x2260ca=_0x6e95f0?_0x4014a0[_0xdd1a('0x1d')]:_0x349f49[_0xdd1a('0x1b')]+_0x349f49['limit'];var _0x59d690;if(_0x2260ca>=_0x3f6924){_0x2260ca=_0x3f6924;_0x59d690=0xc8;}else{_0x59d690=0xce;}_0x45eb1f[_0xdd1a('0x19')](_0x59d690);return _0x45eb1f[_0xdd1a('0x1e')](_0xdd1a('0x1f'),_0x1526ff+'-'+_0x2260ca+'/'+_0x3f6924)['json'](_0x4014a0);}return null;};}function patchUpdates(_0xb448d9){return function(_0x21931f){try{jsonpatch[_0xdd1a('0x20')](_0x21931f,_0xb448d9,!![]);}catch(_0x2bc830){return BPromise[_0xdd1a('0x21')](_0x2bc830);}return _0x21931f[_0xdd1a('0x22')]();};}function saveUpdates(_0x1b8c45,_0x3771a7){return function(_0x4dbfd8){if(_0x4dbfd8){return _0x4dbfd8[_0xdd1a('0x23')](_0x1b8c45)['then'](function(_0x3be472){return _0x3be472;});}return null;};}function removeEntity(_0x3ffa2f,_0x960738){return function(_0x32a44a){if(_0x32a44a){return _0x32a44a[_0xdd1a('0x24')]()[_0xdd1a('0x25')](function(){_0x3ffa2f[_0xdd1a('0x19')](0xcc)[_0xdd1a('0x18')]();});}};}function handleEntityNotFound(_0x25e569,_0x14a89a){return function(_0x9b2e23){if(!_0x9b2e23){_0x25e569[_0xdd1a('0x26')](0x194);}return _0x9b2e23;};}function handleError(_0x467cb3,_0x2a9b06){_0x2a9b06=_0x2a9b06||0x1f4;return function(_0x4cc678){logger['error'](_0x4cc678[_0xdd1a('0x27')]);if(_0x4cc678['name']){delete _0x4cc678['name'];}_0x467cb3[_0xdd1a('0x19')](_0x2a9b06)[_0xdd1a('0x28')](_0x4cc678);};}exports[_0xdd1a('0x29')]=function(_0x26ff9b,_0x2116a7){var _0xb0213d={},_0x181e53={},_0x569ff5={'count':0x0,'rows':[]};var _0x3236f0=_['map'](db['JscriptyQuestionReport'][_0xdd1a('0x2a')],function(_0x5c5860){return{'name':_0x5c5860[_0xdd1a('0x2b')],'type':_0x5c5860[_0xdd1a('0x2c')][_0xdd1a('0x2d')]};});_0x181e53[_0xdd1a('0x2e')]=_[_0xdd1a('0x2f')](_0x3236f0,_0xdd1a('0x30'));_0x181e53[_0xdd1a('0x31')]=_['keys'](_0x26ff9b[_0xdd1a('0x31')]);_0x181e53[_0xdd1a('0x32')]=_[_0xdd1a('0x33')](_0x181e53['model'],_0x181e53[_0xdd1a('0x31')]);_0xb0213d['attributes']=_['intersection'](_0x181e53[_0xdd1a('0x2e')],qs[_0xdd1a('0x34')](_0x26ff9b[_0xdd1a('0x31')][_0xdd1a('0x34')]));_0xb0213d[_0xdd1a('0x35')]=_0xb0213d['attributes'][_0xdd1a('0x36')]?_0xb0213d[_0xdd1a('0x35')]:_0x181e53[_0xdd1a('0x2e')];if(!_0x26ff9b[_0xdd1a('0x31')][_0xdd1a('0x37')]('nolimit')){_0xb0213d[_0xdd1a('0x38')]=qs[_0xdd1a('0x38')](_0x26ff9b['query']['limit']);_0xb0213d[_0xdd1a('0x1b')]=qs['offset'](_0x26ff9b[_0xdd1a('0x31')][_0xdd1a('0x1b')]);}_0xb0213d[_0xdd1a('0x39')]=qs[_0xdd1a('0x3a')](_0x26ff9b[_0xdd1a('0x31')][_0xdd1a('0x3a')]);_0xb0213d[_0xdd1a('0x3b')]=qs[_0xdd1a('0x32')](_['pick'](_0x26ff9b[_0xdd1a('0x31')],_0x181e53['filters']),_0x3236f0);if(_0x26ff9b[_0xdd1a('0x31')]['filter']){_0xb0213d[_0xdd1a('0x3b')]=_[_0xdd1a('0x3c')](_0xb0213d['where'],{'$or':_['map'](_0x3236f0,function(_0x39f5bd){if(_0x39f5bd[_0xdd1a('0x2c')]!==_0xdd1a('0x3d')){var _0x21b8cc={};_0x21b8cc[_0x39f5bd[_0xdd1a('0x30')]]={'$like':'%'+_0x26ff9b[_0xdd1a('0x31')]['filter']+'%'};return _0x21b8cc;}})});}_0xb0213d=_[_0xdd1a('0x3c')]({},_0xb0213d,_0x26ff9b[_0xdd1a('0x3e')]);var _0x2be89c={'where':_0xb0213d[_0xdd1a('0x3b')]};return db[_0xdd1a('0x3f')][_0xdd1a('0x1d')](_0x2be89c)[_0xdd1a('0x25')](function(_0x389447){_0x569ff5[_0xdd1a('0x1d')]=_0x389447;if(_0x26ff9b[_0xdd1a('0x31')][_0xdd1a('0x40')]){_0xb0213d[_0xdd1a('0x41')]=[{'all':!![]}];}return db[_0xdd1a('0x3f')][_0xdd1a('0x42')](_0xb0213d);})[_0xdd1a('0x25')](function(_0x510ac4){_0x569ff5[_0xdd1a('0x43')]=_0x510ac4;return _0x569ff5;})[_0xdd1a('0x25')](respondWithFilteredResult(_0x2116a7,_0xb0213d))[_0xdd1a('0x44')](handleError(_0x2116a7,null));};exports['show']=function(_0x57de9b,_0x1e58e7){var _0x414f67={'raw':!![],'where':{'id':_0x57de9b['params']['id']}},_0x2171ce={};_0x2171ce['model']=_['keys'](db[_0xdd1a('0x3f')][_0xdd1a('0x2a')]);_0x2171ce[_0xdd1a('0x31')]=_['keys'](_0x57de9b[_0xdd1a('0x31')]);_0x2171ce[_0xdd1a('0x32')]=_[_0xdd1a('0x33')](_0x2171ce[_0xdd1a('0x2e')],_0x2171ce[_0xdd1a('0x31')]);_0x414f67[_0xdd1a('0x35')]=_[_0xdd1a('0x33')](_0x2171ce[_0xdd1a('0x2e')],qs[_0xdd1a('0x34')](_0x57de9b['query'][_0xdd1a('0x34')]));_0x414f67[_0xdd1a('0x35')]=_0x414f67[_0xdd1a('0x35')][_0xdd1a('0x36')]?_0x414f67['attributes']:_0x2171ce[_0xdd1a('0x2e')];if(_0x57de9b[_0xdd1a('0x31')][_0xdd1a('0x40')]){_0x414f67[_0xdd1a('0x41')]=[{'all':!![]}];}_0x414f67=_[_0xdd1a('0x3c')]({},_0x414f67,_0x57de9b['options']);return db['JscriptyQuestionReport'][_0xdd1a('0x45')](_0x414f67)[_0xdd1a('0x25')](handleEntityNotFound(_0x1e58e7,null))[_0xdd1a('0x25')](respondWithResult(_0x1e58e7,null))[_0xdd1a('0x44')](handleError(_0x1e58e7,null));};exports[_0xdd1a('0x46')]=function(_0x458f54,_0x418954){return db[_0xdd1a('0x3f')]['create'](_0x458f54['body'],{})[_0xdd1a('0x25')](respondWithResult(_0x418954,0xc9))[_0xdd1a('0x44')](handleError(_0x418954,null));};exports[_0xdd1a('0x23')]=function(_0x418a80,_0x313d91){if(_0x418a80[_0xdd1a('0x47')]['id']){delete _0x418a80[_0xdd1a('0x47')]['id'];}return db[_0xdd1a('0x3f')]['find']({'where':{'id':_0x418a80[_0xdd1a('0x48')]['id']}})[_0xdd1a('0x25')](handleEntityNotFound(_0x313d91,null))['then'](saveUpdates(_0x418a80[_0xdd1a('0x47')],null))[_0xdd1a('0x25')](respondWithResult(_0x313d91,null))['catch'](handleError(_0x313d91,null));};exports[_0xdd1a('0x24')]=function(_0x25d0ce,_0x4c5000){return db['JscriptyQuestionReport'][_0xdd1a('0x45')]({'where':{'id':_0x25d0ce[_0xdd1a('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c5000,null))[_0xdd1a('0x25')](removeEntity(_0x4c5000,null))[_0xdd1a('0x44')](handleError(_0x4c5000,null));};exports[_0xdd1a('0x49')]=function(_0x1cde3c,_0x53535b){return db[_0xdd1a('0x3f')][_0xdd1a('0x49')]()[_0xdd1a('0x25')](respondWithResult(_0x53535b,null))[_0xdd1a('0x44')](handleError(_0x53535b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 500897a..d067655 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 _0x63c8=['request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x4719e8,_0x2b83a3){var _0x5f530b=function(_0xe83d7d){while(--_0xe83d7d){_0x4719e8['push'](_0x4719e8['shift']());}};_0x5f530b(++_0x2b83a3);}(_0x63c8,0x73));var _0x863c=function(_0x3f496a,_0x388244){_0x3f496a=_0x3f496a-0x0;var _0x2b4890=_0x63c8[_0x3f496a];return _0x2b4890;};'use strict';var _=require(_0x863c('0x0'));var util=require(_0x863c('0x1'));var logger=require(_0x863c('0x2'))(_0x863c('0x3'));var moment=require('moment');var BPromise=require(_0x863c('0x4'));var rp=require(_0x863c('0x5'));var fs=require('fs');var path=require(_0x863c('0x6'));var rimraf=require(_0x863c('0x7'));var config=require('../../config/environment');var attributes=require(_0x863c('0x8'));module[_0x863c('0x9')]=function(_0x34a3d3,_0x4627f3){return _0x34a3d3[_0x863c('0xa')](_0x863c('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0197=['JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0197,0x174));var _0x7019=function(_0x2a8b10,_0x19af0f){_0x2a8b10=_0x2a8b10-0x0;var _0x3f3de6=_0x0197[_0x2a8b10];return _0x3f3de6;};'use strict';var _=require('lodash');var util=require(_0x7019('0x0'));var logger=require(_0x7019('0x1'))('api');var moment=require(_0x7019('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7019('0x3'));var rimraf=require(_0x7019('0x4'));var config=require(_0x7019('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x7019('0x6')]=function(_0x81383a,_0x4ed7e0){return _0x81383a[_0x7019('0x7')](_0x7019('0x8'),attributes,{'tableName':_0x7019('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 36cbc7b..08c9026 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 _0x903c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x4f427c,_0x31e58d){var _0x27c8e8=function(_0x8776a8){while(--_0x8776a8){_0x4f427c['push'](_0x4f427c['shift']());}};_0x27c8e8(++_0x31e58d);}(_0x903c,0x140));var _0xc903=function(_0x5419d9,_0x39c108){_0x5419d9=_0x5419d9-0x0;var _0x1615f3=_0x903c[_0x5419d9];return _0x1615f3;};'use strict';var _=require(_0xc903('0x0'));var util=require(_0xc903('0x1'));var moment=require('moment');var BPromise=require(_0xc903('0x2'));var rs=require(_0xc903('0x3'));var fs=require('fs');var Redis=require(_0xc903('0x4'));var db=require(_0xc903('0x5'))['db'];var utils=require(_0xc903('0x6'));var logger=require(_0xc903('0x7'))(_0xc903('0x8'));var config=require('../../config/environment');var jayson=require(_0xc903('0x9'));var client=jayson[_0xc903('0xa')][_0xc903('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324c3e,_0x3456fc,_0x5dceed){return new BPromise(function(_0x1fbd19,_0x17472c){return client['request'](_0x324c3e,_0x5dceed)[_0xc903('0xc')](function(_0x345c11){logger[_0xc903('0xd')](_0xc903('0xe'),_0x3456fc,_0xc903('0xf'));logger[_0xc903('0x10')](_0xc903('0x11'),_0x3456fc,_0xc903('0xf'),JSON[_0xc903('0x12')](_0x345c11));if(_0x345c11[_0xc903('0x13')]){if(_0x345c11[_0xc903('0x13')][_0xc903('0x14')]===0x1f4){logger[_0xc903('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3456fc,_0x345c11[_0xc903('0x13')][_0xc903('0x15')]);return _0x17472c(_0x345c11['error'][_0xc903('0x15')]);}logger[_0xc903('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3456fc,_0x345c11[_0xc903('0x13')]['message']);return _0x1fbd19(_0x345c11[_0xc903('0x13')][_0xc903('0x15')]);}else{logger[_0xc903('0xd')](_0xc903('0xe'),_0x3456fc,'request\x20sent');_0x1fbd19(_0x345c11[_0xc903('0x16')]['message']);}})['catch'](function(_0x5b1692){logger[_0xc903('0x13')](_0xc903('0xe'),_0x3456fc,_0x5b1692);_0x17472c(_0x5b1692);});});} \ No newline at end of file +var _0x70b0=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x42222d,_0x3c90f7){var _0x4a56fd=function(_0x22e7ed){while(--_0x22e7ed){_0x42222d['push'](_0x42222d['shift']());}};_0x4a56fd(++_0x3c90f7);}(_0x70b0,0xec));var _0x070b=function(_0x15a4dd,_0x187829){_0x15a4dd=_0x15a4dd-0x0;var _0x485988=_0x70b0[_0x15a4dd];return _0x485988;};'use strict';var _=require('lodash');var util=require(_0x070b('0x0'));var moment=require(_0x070b('0x1'));var BPromise=require(_0x070b('0x2'));var rs=require(_0x070b('0x3'));var fs=require('fs');var Redis=require(_0x070b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x070b('0x5'))('rpc');var config=require(_0x070b('0x6'));var jayson=require(_0x070b('0x7'));var client=jayson[_0x070b('0x8')][_0x070b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1358df,_0x47c387,_0x4f68d6){return new BPromise(function(_0x5f2339,_0x4b2a62){return client[_0x070b('0xa')](_0x1358df,_0x4f68d6)['then'](function(_0x477fa8){logger[_0x070b('0xb')](_0x070b('0xc'),_0x47c387,_0x070b('0xd'));logger['debug'](_0x070b('0xe'),_0x47c387,_0x070b('0xd'),JSON[_0x070b('0xf')](_0x477fa8));if(_0x477fa8['error']){if(_0x477fa8['error']['code']===0x1f4){logger[_0x070b('0x10')](_0x070b('0xc'),_0x47c387,_0x477fa8[_0x070b('0x10')]['message']);return _0x4b2a62(_0x477fa8['error'][_0x070b('0x11')]);}logger[_0x070b('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x47c387,_0x477fa8[_0x070b('0x10')]['message']);return _0x5f2339(_0x477fa8['error']['message']);}else{logger[_0x070b('0xb')](_0x070b('0xc'),_0x47c387,_0x070b('0xd'));_0x5f2339(_0x477fa8[_0x070b('0x12')][_0x070b('0x11')]);}})['catch'](function(_0x39d194){logger[_0x070b('0x10')](_0x070b('0xc'),_0x47c387,_0x39d194);_0x4b2a62(_0x39d194);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e85ed97..857e02f 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 _0xf5a2=['index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xf5a2,0x75));var _0x2f5a=function(_0x3b424d,_0x335cfe){_0x3b424d=_0x3b424d-0x0;var _0x59bcdd=_0xf5a2[_0x3b424d];return _0x59bcdd;};'use strict';var multer=require(_0x2f5a('0x0'));var util=require(_0x2f5a('0x1'));var path=require(_0x2f5a('0x2'));var timeout=require(_0x2f5a('0x3'));var express=require(_0x2f5a('0x4'));var router=express['Router']();var fs_extra=require(_0x2f5a('0x5'));var auth=require(_0x2f5a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f5a('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x2f5a('0x8')]('/',auth['isAuthenticated'](),controller[_0x2f5a('0x9')]);router[_0x2f5a('0x8')](_0x2f5a('0xa'),auth[_0x2f5a('0xb')](),controller[_0x2f5a('0xc')]);router[_0x2f5a('0x8')](_0x2f5a('0xd'),auth['isAuthenticated'](),controller[_0x2f5a('0xe')]);router['get'](_0x2f5a('0xf'),auth[_0x2f5a('0xb')](),controller['getQuestions']);router[_0x2f5a('0x10')]('/',auth[_0x2f5a('0xb')](),controller['create']);router['put'](_0x2f5a('0xd'),auth[_0x2f5a('0xb')](),controller[_0x2f5a('0x11')]);router[_0x2f5a('0x12')]('/:id',auth[_0x2f5a('0xb')](),controller[_0x2f5a('0x13')]);module[_0x2f5a('0x14')]=router; \ No newline at end of file +var _0xc894=['Router','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','getQuestions','create','update','delete','destroy','util','path','express'];(function(_0x4004c0,_0x4bdc8a){var _0x53b5a7=function(_0x1d3389){while(--_0x1d3389){_0x4004c0['push'](_0x4004c0['shift']());}};_0x53b5a7(++_0x4bdc8a);}(_0xc894,0xc5));var _0x4c89=function(_0x3fb8b5,_0x2dc61c){_0x3fb8b5=_0x3fb8b5-0x0;var _0x51190a=_0xc894[_0x3fb8b5];return _0x51190a;};'use strict';var multer=require('multer');var util=require(_0x4c89('0x0'));var path=require(_0x4c89('0x1'));var timeout=require('connect-timeout');var express=require(_0x4c89('0x2'));var router=express[_0x4c89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c89('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4c89('0x5'));var controller=require(_0x4c89('0x6'));router['get']('/',auth[_0x4c89('0x7')](),controller[_0x4c89('0x8')]);router[_0x4c89('0x9')](_0x4c89('0xa'),auth[_0x4c89('0x7')](),controller[_0x4c89('0xb')]);router[_0x4c89('0x9')](_0x4c89('0xc'),auth[_0x4c89('0x7')](),controller[_0x4c89('0xd')]);router['get'](_0x4c89('0xe'),auth[_0x4c89('0x7')](),controller[_0x4c89('0xf')]);router['post']('/',auth[_0x4c89('0x7')](),controller[_0x4c89('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4c89('0x11')]);router[_0x4c89('0x12')](_0x4c89('0xc'),auth['isAuthenticated'](),controller[_0x4c89('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d77cd49..92a4d2e 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 _0x86ed=['endtime','format','STRING','moment','sequelize','exports','DATE','setDataValue'];(function(_0xfd05e7,_0x2593b2){var _0x36e940=function(_0x2e92fc){while(--_0x2e92fc){_0xfd05e7['push'](_0xfd05e7['shift']());}};_0x36e940(++_0x2593b2);}(_0x86ed,0x143));var _0xd86e=function(_0x198596,_0x15b260){_0x198596=_0x198596-0x0;var _0x1084e2=_0x86ed[_0x198596];return _0x1084e2;};'use strict';var moment=require(_0xd86e('0x0'));var Sequelize=require(_0xd86e('0x1'));module[_0xd86e('0x2')]={'starttime':{'type':Sequelize[_0xd86e('0x3')],'set':function(_0x1b6937){this['setDataValue']('starttime',_0x1b6937);this[_0xd86e('0x4')](_0xd86e('0x5'),moment()[_0xd86e('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xd86e('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd86e('0x7')]},'uniqueid':{'type':Sequelize[_0xd86e('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0c6c=['YYYY-MM-DD\x20HH:mm:ss','STRING','moment','DATE','setDataValue','starttime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c6c,0x1e2));var _0xc0c6=function(_0x5871f9,_0x28ccb7){_0x5871f9=_0x5871f9-0x0;var _0x8fd1c0=_0x0c6c[_0x5871f9];return _0x8fd1c0;};'use strict';var moment=require(_0xc0c6('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xc0c6('0x1')],'set':function(_0x5460e9){this[_0xc0c6('0x2')](_0xc0c6('0x3'),_0x5460e9);this[_0xc0c6('0x2')]('endtime',moment()['format'](_0xc0c6('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xc0c6('0x5')]},'projectname':{'type':Sequelize[_0xc0c6('0x5')]},'queue':{'type':Sequelize[_0xc0c6('0x5')]},'uniqueid':{'type':Sequelize[_0xc0c6('0x5')]},'calleridname':{'type':Sequelize[_0xc0c6('0x5')]},'calleridnum':{'type':Sequelize[_0xc0c6('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 92af203..2e34ca1 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 _0x2392=['destroy','sendStatus','error','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','getQuestions','JscriptyQuestionReport','sort','SessionId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then'];(function(_0x3f4568,_0x9eb0ee){var _0xee2340=function(_0xdefabb){while(--_0xdefabb){_0x3f4568['push'](_0x3f4568['shift']());}};_0xee2340(++_0x9eb0ee);}(_0x2392,0x74));var _0x2239=function(_0x4918f9,_0x313ca3){_0x4918f9=_0x4918f9-0x0;var _0x21a112=_0x2392[_0x4918f9];return _0x21a112;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2239('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2239('0x1'));var rp=require(_0x2239('0x2'));var moment=require(_0x2239('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2239('0x4'));var util=require(_0x2239('0x5'));var path=require(_0x2239('0x6'));var sox=require(_0x2239('0x7'));var csv=require(_0x2239('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2239('0x9'));var _=require('lodash');var squel=require(_0x2239('0xa'));var crypto=require(_0x2239('0xb'));var jsforce=require(_0x2239('0xc'));var deskjs=require(_0x2239('0xd'));var toCsv=require(_0x2239('0x8'));var querystring=require('querystring');var Papa=require(_0x2239('0xe'));var Redis=require(_0x2239('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2239('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2239('0x11'));var logger=require(_0x2239('0x12'))(_0x2239('0x13'));var utils=require(_0x2239('0x14'));var config=require(_0x2239('0x15'));var licenseUtil=require(_0x2239('0x16'));var db=require(_0x2239('0x17'))['db'];function respondWithStatusCode(_0xa9fa57,_0x421b62){_0x421b62=_0x421b62||0xcc;return function(_0x154bbe){if(_0x154bbe){return _0xa9fa57['sendStatus'](_0x421b62);}return _0xa9fa57[_0x2239('0x18')](_0x421b62)['end']();};}function respondWithResult(_0x48dc7b,_0x51cb36){_0x51cb36=_0x51cb36||0xc8;return function(_0x38cd45){if(_0x38cd45){return _0x48dc7b[_0x2239('0x18')](_0x51cb36)['json'](_0x38cd45);}};}function respondWithFilteredResult(_0x5b9565,_0x544d34){return function(_0x240b69){if(_0x240b69){var _0x5c90b1=typeof _0x544d34[_0x2239('0x19')]===_0x2239('0x1a')&&typeof _0x544d34[_0x2239('0x1b')]===_0x2239('0x1a');var _0x5f4ae0=_0x240b69[_0x2239('0x1c')];var _0x4a8dc7=_0x5c90b1?0x0:_0x544d34[_0x2239('0x19')];var _0x400a50=_0x5c90b1?_0x240b69[_0x2239('0x1c')]:_0x544d34[_0x2239('0x19')]+_0x544d34[_0x2239('0x1b')];var _0x639469;if(_0x400a50>=_0x5f4ae0){_0x400a50=_0x5f4ae0;_0x639469=0xc8;}else{_0x639469=0xce;}_0x5b9565[_0x2239('0x18')](_0x639469);return _0x5b9565[_0x2239('0x1d')](_0x2239('0x1e'),_0x4a8dc7+'-'+_0x400a50+'/'+_0x5f4ae0)[_0x2239('0x1f')](_0x240b69);}return null;};}function patchUpdates(_0x295bcd){return function(_0x1babd1){try{jsonpatch[_0x2239('0x20')](_0x1babd1,_0x295bcd,!![]);}catch(_0x477df6){return BPromise[_0x2239('0x21')](_0x477df6);}return _0x1babd1['save']();};}function saveUpdates(_0x5c992e,_0x977f9f){return function(_0x123022){if(_0x123022){return _0x123022[_0x2239('0x22')](_0x5c992e)[_0x2239('0x23')](function(_0x547d23){return _0x547d23;});}return null;};}function removeEntity(_0x269c25,_0x182fea){return function(_0x4bb171){if(_0x4bb171){return _0x4bb171[_0x2239('0x24')]()['then'](function(){_0x269c25[_0x2239('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x472fc0,_0x5d36aa){return function(_0x107048){if(!_0x107048){_0x472fc0[_0x2239('0x25')](0x194);}return _0x107048;};}function handleError(_0x543ba2,_0x142fde){_0x142fde=_0x142fde||0x1f4;return function(_0x5e6955){logger[_0x2239('0x26')](_0x5e6955['stack']);if(_0x5e6955[_0x2239('0x27')]){delete _0x5e6955[_0x2239('0x27')];}_0x543ba2[_0x2239('0x18')](_0x142fde)[_0x2239('0x28')](_0x5e6955);};}exports['index']=function(_0x42fd54,_0x264daa){var _0x1e8929={},_0x2bbea1={},_0x505371={'count':0x0,'rows':[]};var _0x424c28=_[_0x2239('0x29')](db[_0x2239('0x2a')][_0x2239('0x2b')],function(_0x5ef1d4){return{'name':_0x5ef1d4[_0x2239('0x2c')],'type':_0x5ef1d4[_0x2239('0x2d')][_0x2239('0x2e')]};});_0x2bbea1[_0x2239('0x2f')]=_[_0x2239('0x29')](_0x424c28,'name');_0x2bbea1[_0x2239('0x30')]=_[_0x2239('0x31')](_0x42fd54[_0x2239('0x30')]);_0x2bbea1['filters']=_[_0x2239('0x32')](_0x2bbea1[_0x2239('0x2f')],_0x2bbea1[_0x2239('0x30')]);_0x1e8929[_0x2239('0x33')]=_['intersection'](_0x2bbea1[_0x2239('0x2f')],qs[_0x2239('0x34')](_0x42fd54[_0x2239('0x30')][_0x2239('0x34')]));_0x1e8929[_0x2239('0x33')]=_0x1e8929[_0x2239('0x33')][_0x2239('0x35')]?_0x1e8929[_0x2239('0x33')]:_0x2bbea1['model'];if(!_0x42fd54['query']['hasOwnProperty'](_0x2239('0x36'))){_0x1e8929[_0x2239('0x1b')]=qs['limit'](_0x42fd54[_0x2239('0x30')]['limit']);_0x1e8929[_0x2239('0x19')]=qs[_0x2239('0x19')](_0x42fd54[_0x2239('0x30')][_0x2239('0x19')]);}_0x1e8929['order']=qs['sort'](_0x42fd54['query']['sort']);_0x1e8929[_0x2239('0x37')]=qs['filters'](_[_0x2239('0x38')](_0x42fd54['query'],_0x2bbea1[_0x2239('0x39')]),_0x424c28);if(_0x42fd54[_0x2239('0x30')]['filter']){_0x1e8929[_0x2239('0x37')]=_['merge'](_0x1e8929[_0x2239('0x37')],{'$or':_[_0x2239('0x29')](_0x424c28,function(_0x11bd2a){if(_0x11bd2a[_0x2239('0x2d')]!==_0x2239('0x3a')){var _0x100b28={};_0x100b28[_0x11bd2a[_0x2239('0x27')]]={'$like':'%'+_0x42fd54[_0x2239('0x30')][_0x2239('0x3b')]+'%'};return _0x100b28;}})});}_0x1e8929=_[_0x2239('0x3c')]({},_0x1e8929,_0x42fd54[_0x2239('0x3d')]);var _0x514111={'where':_0x1e8929['where']};return db[_0x2239('0x2a')][_0x2239('0x1c')](_0x514111)[_0x2239('0x23')](function(_0x2f0d3b){_0x505371['count']=_0x2f0d3b;if(_0x42fd54[_0x2239('0x30')][_0x2239('0x3e')]){_0x1e8929[_0x2239('0x3f')]=[{'all':!![]}];}return db[_0x2239('0x2a')][_0x2239('0x40')](_0x1e8929);})[_0x2239('0x23')](function(_0x551ab0){_0x505371[_0x2239('0x41')]=_0x551ab0;return _0x505371;})['then'](respondWithFilteredResult(_0x264daa,_0x1e8929))['catch'](handleError(_0x264daa,null));};exports['show']=function(_0x3e1502,_0x3a437d){var _0x569165={'raw':!![],'where':{'id':_0x3e1502[_0x2239('0x42')]['id']}},_0x461f2f={};_0x461f2f['model']=_['keys'](db['JscriptySessionReport'][_0x2239('0x2b')]);_0x461f2f[_0x2239('0x30')]=_['keys'](_0x3e1502[_0x2239('0x30')]);_0x461f2f['filters']=_[_0x2239('0x32')](_0x461f2f['model'],_0x461f2f[_0x2239('0x30')]);_0x569165[_0x2239('0x33')]=_[_0x2239('0x32')](_0x461f2f[_0x2239('0x2f')],qs['fields'](_0x3e1502[_0x2239('0x30')][_0x2239('0x34')]));_0x569165['attributes']=_0x569165[_0x2239('0x33')][_0x2239('0x35')]?_0x569165['attributes']:_0x461f2f[_0x2239('0x2f')];if(_0x3e1502['query'][_0x2239('0x3e')]){_0x569165['include']=[{'all':!![]}];}_0x569165=_[_0x2239('0x3c')]({},_0x569165,_0x3e1502[_0x2239('0x3d')]);return db[_0x2239('0x2a')][_0x2239('0x43')](_0x569165)[_0x2239('0x23')](handleEntityNotFound(_0x3a437d,null))[_0x2239('0x23')](respondWithResult(_0x3a437d,null))[_0x2239('0x44')](handleError(_0x3a437d,null));};exports['create']=function(_0x52e442,_0x2d6500){return db[_0x2239('0x2a')][_0x2239('0x45')](_0x52e442[_0x2239('0x46')],{})[_0x2239('0x23')](respondWithResult(_0x2d6500,0xc9))[_0x2239('0x44')](handleError(_0x2d6500,null));};exports[_0x2239('0x22')]=function(_0x353551,_0x336b18){if(_0x353551[_0x2239('0x46')]['id']){delete _0x353551[_0x2239('0x46')]['id'];}return db[_0x2239('0x2a')][_0x2239('0x43')]({'where':{'id':_0x353551[_0x2239('0x42')]['id']}})[_0x2239('0x23')](handleEntityNotFound(_0x336b18,null))[_0x2239('0x23')](saveUpdates(_0x353551[_0x2239('0x46')],null))[_0x2239('0x23')](respondWithResult(_0x336b18,null))[_0x2239('0x44')](handleError(_0x336b18,null));};exports['destroy']=function(_0x289f5b,_0x511913){return db[_0x2239('0x2a')]['find']({'where':{'id':_0x289f5b[_0x2239('0x42')]['id']}})[_0x2239('0x23')](handleEntityNotFound(_0x511913,null))[_0x2239('0x23')](removeEntity(_0x511913,null))[_0x2239('0x44')](handleError(_0x511913,null));};exports['describe']=function(_0x1b965e,_0x275f35){return db['JscriptySessionReport'][_0x2239('0x47')]()[_0x2239('0x23')](respondWithResult(_0x275f35,null))['catch'](handleError(_0x275f35,null));};exports[_0x2239('0x48')]=function(_0x3ce153,_0x51c068,_0xe46913){var _0x363328={'raw':!![],'where':{}};var _0x597378={};var _0x550cc4={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x3ce153['params']['id']}})[_0x2239('0x23')](handleEntityNotFound(_0x51c068,null))[_0x2239('0x23')](function(_0x5812df){if(_0x5812df){_0x597378[_0x2239('0x2f')]=_[_0x2239('0x31')](db[_0x2239('0x49')][_0x2239('0x2b')]);_0x597378[_0x2239('0x30')]=_[_0x2239('0x31')](_0x3ce153[_0x2239('0x30')]);_0x597378[_0x2239('0x39')]=_[_0x2239('0x32')](_0x597378['model'],_0x597378[_0x2239('0x30')]);_0x363328[_0x2239('0x33')]=_['intersection'](_0x597378[_0x2239('0x2f')],qs[_0x2239('0x34')](_0x3ce153[_0x2239('0x30')][_0x2239('0x34')]));_0x363328[_0x2239('0x33')]=_0x363328['attributes'][_0x2239('0x35')]?_0x363328[_0x2239('0x33')]:_0x597378[_0x2239('0x2f')];if(!_0x3ce153[_0x2239('0x30')]['hasOwnProperty'](_0x2239('0x36'))){_0x363328[_0x2239('0x1b')]=qs[_0x2239('0x1b')](_0x3ce153[_0x2239('0x30')][_0x2239('0x1b')]);_0x363328[_0x2239('0x19')]=qs[_0x2239('0x19')](_0x3ce153['query'][_0x2239('0x19')]);}_0x363328['order']=qs['sort'](_0x3ce153[_0x2239('0x30')][_0x2239('0x4a')]);_0x363328[_0x2239('0x37')]=qs['filters'](_[_0x2239('0x38')](_0x3ce153[_0x2239('0x30')],_0x597378[_0x2239('0x39')]));_0x363328['where'][_0x2239('0x4b')]=_0x5812df['id'];if(_0x3ce153[_0x2239('0x30')][_0x2239('0x3b')]){_0x363328[_0x2239('0x37')]=_['merge'](_0x363328[_0x2239('0x37')],{'$or':_[_0x2239('0x29')](_0x363328[_0x2239('0x33')],function(_0x4a8eb9){var _0x4fbe9e={};_0x4fbe9e[_0x4a8eb9]={'$like':'%'+_0x3ce153['query'][_0x2239('0x3b')]+'%'};return _0x4fbe9e;})});}_0x363328=_['merge']({},_0x363328,_0x3ce153[_0x2239('0x3d')]);return db[_0x2239('0x49')][_0x2239('0x1c')]({'where':_0x363328['where']})[_0x2239('0x23')](function(_0x5db1d6){_0x550cc4['count']=_0x5db1d6;if(_0x3ce153['query'][_0x2239('0x3e')]){_0x363328['include']=[{'all':!![]}];}return db[_0x2239('0x49')][_0x2239('0x40')](_0x363328);})[_0x2239('0x23')](function(_0x2d7e1b){_0x550cc4[_0x2239('0x41')]=_0x2d7e1b;return _0x550cc4;});}})[_0x2239('0x23')](respondWithFilteredResult(_0x51c068,_0x363328))[_0x2239('0x44')](handleError(_0x51c068,null));}; \ No newline at end of file +var _0x6ee0=['merge','map','type','VIRTUAL','options','includeAll','include','catch','params','keys','fields','find','create','body','update','describe','SessionId','JscriptyQuestionReport','findAll','rows','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','error','stack','name','index','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5326ec,_0x1c4d75){var _0x573c5c=function(_0x2850b2){while(--_0x2850b2){_0x5326ec['push'](_0x5326ec['shift']());}};_0x573c5c(++_0x1c4d75);}(_0x6ee0,0xfb));var _0x06ee=function(_0x34dd6d,_0x36e420){_0x34dd6d=_0x34dd6d-0x0;var _0x56a0cb=_0x6ee0[_0x34dd6d];return _0x56a0cb;};'use strict';var emlformat=require(_0x06ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x06ee('0x1'));var rp=require(_0x06ee('0x2'));var moment=require(_0x06ee('0x3'));var BPromise=require(_0x06ee('0x4'));var Mustache=require(_0x06ee('0x5'));var util=require(_0x06ee('0x6'));var path=require(_0x06ee('0x7'));var sox=require('sox');var csv=require(_0x06ee('0x8'));var ejs=require(_0x06ee('0x9'));var fs=require('fs');var fs_extra=require(_0x06ee('0xa'));var _=require(_0x06ee('0xb'));var squel=require(_0x06ee('0xc'));var crypto=require('crypto');var jsforce=require(_0x06ee('0xd'));var deskjs=require(_0x06ee('0xe'));var toCsv=require(_0x06ee('0x8'));var querystring=require(_0x06ee('0xf'));var Papa=require(_0x06ee('0x10'));var Redis=require(_0x06ee('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x06ee('0x12'));var as=require(_0x06ee('0x13'));var hardwareService=require(_0x06ee('0x14'));var logger=require('../../config/logger')(_0x06ee('0x15'));var utils=require(_0x06ee('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x06ee('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5059db,_0x8be0f5){_0x8be0f5=_0x8be0f5||0xcc;return function(_0x53241d){if(_0x53241d){return _0x5059db[_0x06ee('0x18')](_0x8be0f5);}return _0x5059db['status'](_0x8be0f5)[_0x06ee('0x19')]();};}function respondWithResult(_0x4b1c0d,_0x17a30a){_0x17a30a=_0x17a30a||0xc8;return function(_0x13a722){if(_0x13a722){return _0x4b1c0d[_0x06ee('0x1a')](_0x17a30a)[_0x06ee('0x1b')](_0x13a722);}};}function respondWithFilteredResult(_0x2d2f36,_0x319255){return function(_0x38966){if(_0x38966){var _0x39df89=typeof _0x319255[_0x06ee('0x1c')]===_0x06ee('0x1d')&&typeof _0x319255['limit']===_0x06ee('0x1d');var _0x3feead=_0x38966['count'];var _0x70d2d7=_0x39df89?0x0:_0x319255[_0x06ee('0x1c')];var _0x2338a3=_0x39df89?_0x38966[_0x06ee('0x1e')]:_0x319255['offset']+_0x319255[_0x06ee('0x1f')];var _0x5e1781;if(_0x2338a3>=_0x3feead){_0x2338a3=_0x3feead;_0x5e1781=0xc8;}else{_0x5e1781=0xce;}_0x2d2f36[_0x06ee('0x1a')](_0x5e1781);return _0x2d2f36[_0x06ee('0x20')](_0x06ee('0x21'),_0x70d2d7+'-'+_0x2338a3+'/'+_0x3feead)[_0x06ee('0x1b')](_0x38966);}return null;};}function patchUpdates(_0x57275e){return function(_0x31aaa0){try{jsonpatch['apply'](_0x31aaa0,_0x57275e,!![]);}catch(_0x4829d6){return BPromise['reject'](_0x4829d6);}return _0x31aaa0['save']();};}function saveUpdates(_0x206243,_0x5cc2e2){return function(_0x267672){if(_0x267672){return _0x267672['update'](_0x206243)['then'](function(_0x586be0){return _0x586be0;});}return null;};}function removeEntity(_0x135a51,_0x443e0a){return function(_0x44c6e1){if(_0x44c6e1){return _0x44c6e1[_0x06ee('0x22')]()[_0x06ee('0x23')](function(){_0x135a51[_0x06ee('0x1a')](0xcc)[_0x06ee('0x19')]();});}};}function handleEntityNotFound(_0x3351f5,_0x125f9b){return function(_0x5d29b7){if(!_0x5d29b7){_0x3351f5[_0x06ee('0x18')](0x194);}return _0x5d29b7;};}function handleError(_0x212503,_0x19cfd0){_0x19cfd0=_0x19cfd0||0x1f4;return function(_0x35e1ae){logger[_0x06ee('0x24')](_0x35e1ae[_0x06ee('0x25')]);if(_0x35e1ae['name']){delete _0x35e1ae[_0x06ee('0x26')];}_0x212503[_0x06ee('0x1a')](_0x19cfd0)['send'](_0x35e1ae);};}exports[_0x06ee('0x27')]=function(_0x3215dd,_0x89cf78){var _0x267748={},_0x265615={},_0x17bd37={'count':0x0,'rows':[]};var _0x464579=_['map'](db[_0x06ee('0x28')][_0x06ee('0x29')],function(_0x4d4b25){return{'name':_0x4d4b25[_0x06ee('0x2a')],'type':_0x4d4b25['type'][_0x06ee('0x2b')]};});_0x265615[_0x06ee('0x2c')]=_['map'](_0x464579,_0x06ee('0x26'));_0x265615[_0x06ee('0x2d')]=_['keys'](_0x3215dd[_0x06ee('0x2d')]);_0x265615[_0x06ee('0x2e')]=_[_0x06ee('0x2f')](_0x265615['model'],_0x265615[_0x06ee('0x2d')]);_0x267748[_0x06ee('0x30')]=_['intersection'](_0x265615[_0x06ee('0x2c')],qs['fields'](_0x3215dd[_0x06ee('0x2d')]['fields']));_0x267748['attributes']=_0x267748[_0x06ee('0x30')][_0x06ee('0x31')]?_0x267748['attributes']:_0x265615[_0x06ee('0x2c')];if(!_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x32')](_0x06ee('0x33'))){_0x267748[_0x06ee('0x1f')]=qs[_0x06ee('0x1f')](_0x3215dd[_0x06ee('0x2d')]['limit']);_0x267748[_0x06ee('0x1c')]=qs['offset'](_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x1c')]);}_0x267748[_0x06ee('0x34')]=qs[_0x06ee('0x35')](_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x35')]);_0x267748[_0x06ee('0x36')]=qs['filters'](_[_0x06ee('0x37')](_0x3215dd[_0x06ee('0x2d')],_0x265615['filters']),_0x464579);if(_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x38')]){_0x267748[_0x06ee('0x36')]=_[_0x06ee('0x39')](_0x267748[_0x06ee('0x36')],{'$or':_[_0x06ee('0x3a')](_0x464579,function(_0x5b899b){if(_0x5b899b[_0x06ee('0x3b')]!==_0x06ee('0x3c')){var _0x5a5c97={};_0x5a5c97[_0x5b899b['name']]={'$like':'%'+_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x38')]+'%'};return _0x5a5c97;}})});}_0x267748=_['merge']({},_0x267748,_0x3215dd[_0x06ee('0x3d')]);var _0x38b8e1={'where':_0x267748['where']};return db[_0x06ee('0x28')][_0x06ee('0x1e')](_0x38b8e1)[_0x06ee('0x23')](function(_0x1c49f3){_0x17bd37['count']=_0x1c49f3;if(_0x3215dd[_0x06ee('0x2d')][_0x06ee('0x3e')]){_0x267748[_0x06ee('0x3f')]=[{'all':!![]}];}return db[_0x06ee('0x28')]['findAll'](_0x267748);})[_0x06ee('0x23')](function(_0x45a019){_0x17bd37['rows']=_0x45a019;return _0x17bd37;})[_0x06ee('0x23')](respondWithFilteredResult(_0x89cf78,_0x267748))[_0x06ee('0x40')](handleError(_0x89cf78,null));};exports['show']=function(_0x42863c,_0x15b411){var _0x5bf9e0={'raw':!![],'where':{'id':_0x42863c[_0x06ee('0x41')]['id']}},_0x1a92e9={};_0x1a92e9[_0x06ee('0x2c')]=_['keys'](db[_0x06ee('0x28')][_0x06ee('0x29')]);_0x1a92e9[_0x06ee('0x2d')]=_[_0x06ee('0x42')](_0x42863c[_0x06ee('0x2d')]);_0x1a92e9[_0x06ee('0x2e')]=_[_0x06ee('0x2f')](_0x1a92e9['model'],_0x1a92e9[_0x06ee('0x2d')]);_0x5bf9e0[_0x06ee('0x30')]=_['intersection'](_0x1a92e9['model'],qs[_0x06ee('0x43')](_0x42863c[_0x06ee('0x2d')][_0x06ee('0x43')]));_0x5bf9e0[_0x06ee('0x30')]=_0x5bf9e0[_0x06ee('0x30')][_0x06ee('0x31')]?_0x5bf9e0[_0x06ee('0x30')]:_0x1a92e9[_0x06ee('0x2c')];if(_0x42863c[_0x06ee('0x2d')][_0x06ee('0x3e')]){_0x5bf9e0['include']=[{'all':!![]}];}_0x5bf9e0=_[_0x06ee('0x39')]({},_0x5bf9e0,_0x42863c['options']);return db[_0x06ee('0x28')][_0x06ee('0x44')](_0x5bf9e0)[_0x06ee('0x23')](handleEntityNotFound(_0x15b411,null))['then'](respondWithResult(_0x15b411,null))[_0x06ee('0x40')](handleError(_0x15b411,null));};exports[_0x06ee('0x45')]=function(_0x2eec5b,_0x11c9a8){return db[_0x06ee('0x28')]['create'](_0x2eec5b[_0x06ee('0x46')],{})[_0x06ee('0x23')](respondWithResult(_0x11c9a8,0xc9))[_0x06ee('0x40')](handleError(_0x11c9a8,null));};exports[_0x06ee('0x47')]=function(_0x5225e5,_0x24dade){if(_0x5225e5[_0x06ee('0x46')]['id']){delete _0x5225e5[_0x06ee('0x46')]['id'];}return db['JscriptySessionReport'][_0x06ee('0x44')]({'where':{'id':_0x5225e5[_0x06ee('0x41')]['id']}})[_0x06ee('0x23')](handleEntityNotFound(_0x24dade,null))[_0x06ee('0x23')](saveUpdates(_0x5225e5[_0x06ee('0x46')],null))[_0x06ee('0x23')](respondWithResult(_0x24dade,null))[_0x06ee('0x40')](handleError(_0x24dade,null));};exports['destroy']=function(_0x392ca2,_0x4326b2){return db[_0x06ee('0x28')][_0x06ee('0x44')]({'where':{'id':_0x392ca2['params']['id']}})[_0x06ee('0x23')](handleEntityNotFound(_0x4326b2,null))[_0x06ee('0x23')](removeEntity(_0x4326b2,null))[_0x06ee('0x40')](handleError(_0x4326b2,null));};exports[_0x06ee('0x48')]=function(_0x124a7a,_0x5ae411){return db[_0x06ee('0x28')]['describe']()['then'](respondWithResult(_0x5ae411,null))['catch'](handleError(_0x5ae411,null));};exports['getQuestions']=function(_0x7ae104,_0xfe5147,_0x59f605){var _0x56724a={'raw':!![],'where':{}};var _0x2ac5={};var _0x30a28e={'count':0x0,'rows':[]};return db[_0x06ee('0x28')]['findOne']({'where':{'id':_0x7ae104[_0x06ee('0x41')]['id']}})[_0x06ee('0x23')](handleEntityNotFound(_0xfe5147,null))['then'](function(_0x4e405f){if(_0x4e405f){_0x2ac5[_0x06ee('0x2c')]=_[_0x06ee('0x42')](db['JscriptyQuestionReport'][_0x06ee('0x29')]);_0x2ac5[_0x06ee('0x2d')]=_[_0x06ee('0x42')](_0x7ae104['query']);_0x2ac5[_0x06ee('0x2e')]=_['intersection'](_0x2ac5[_0x06ee('0x2c')],_0x2ac5[_0x06ee('0x2d')]);_0x56724a[_0x06ee('0x30')]=_[_0x06ee('0x2f')](_0x2ac5[_0x06ee('0x2c')],qs[_0x06ee('0x43')](_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x43')]));_0x56724a[_0x06ee('0x30')]=_0x56724a[_0x06ee('0x30')]['length']?_0x56724a[_0x06ee('0x30')]:_0x2ac5[_0x06ee('0x2c')];if(!_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x32')](_0x06ee('0x33'))){_0x56724a[_0x06ee('0x1f')]=qs['limit'](_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x1f')]);_0x56724a[_0x06ee('0x1c')]=qs[_0x06ee('0x1c')](_0x7ae104['query'][_0x06ee('0x1c')]);}_0x56724a[_0x06ee('0x34')]=qs['sort'](_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x35')]);_0x56724a[_0x06ee('0x36')]=qs[_0x06ee('0x2e')](_[_0x06ee('0x37')](_0x7ae104['query'],_0x2ac5[_0x06ee('0x2e')]));_0x56724a[_0x06ee('0x36')][_0x06ee('0x49')]=_0x4e405f['id'];if(_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x38')]){_0x56724a[_0x06ee('0x36')]=_['merge'](_0x56724a[_0x06ee('0x36')],{'$or':_[_0x06ee('0x3a')](_0x56724a[_0x06ee('0x30')],function(_0x28abe2){var _0x557e12={};_0x557e12[_0x28abe2]={'$like':'%'+_0x7ae104[_0x06ee('0x2d')]['filter']+'%'};return _0x557e12;})});}_0x56724a=_[_0x06ee('0x39')]({},_0x56724a,_0x7ae104[_0x06ee('0x3d')]);return db[_0x06ee('0x4a')][_0x06ee('0x1e')]({'where':_0x56724a['where']})['then'](function(_0x468b02){_0x30a28e[_0x06ee('0x1e')]=_0x468b02;if(_0x7ae104[_0x06ee('0x2d')][_0x06ee('0x3e')]){_0x56724a[_0x06ee('0x3f')]=[{'all':!![]}];}return db[_0x06ee('0x4a')][_0x06ee('0x4b')](_0x56724a);})[_0x06ee('0x23')](function(_0x70f4dd){_0x30a28e[_0x06ee('0x4c')]=_0x70f4dd;return _0x30a28e;});}})[_0x06ee('0x23')](respondWithFilteredResult(_0xfe5147,_0x56724a))[_0x06ee('0x40')](handleError(_0xfe5147,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 69cd3f3..6bc456c 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 _0x25fa=['path','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2011cf,_0x2a1a5d){var _0x242337=function(_0x47cb85){while(--_0x47cb85){_0x2011cf['push'](_0x2011cf['shift']());}};_0x242337(++_0x2a1a5d);}(_0x25fa,0x109));var _0xa25f=function(_0x42ec5b,_0x27d538){_0x42ec5b=_0x42ec5b-0x0;var _0x423a3e=_0x25fa[_0x42ec5b];return _0x423a3e;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','JscriptySessionReport','report_jscripty_sessions','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptySessionReport.attributes','exports'];(function(_0x34a4fd,_0x5c07f2){var _0xf89bcb=function(_0x575bbe){while(--_0x575bbe){_0x34a4fd['push'](_0x34a4fd['shift']());}};_0xf89bcb(++_0x5c07f2);}(_0xacf4,0xe7));var _0x4acf=function(_0x90604a,_0x478069){_0x90604a=_0x90604a-0x0;var _0x5b517b=_0xacf4[_0x90604a];return _0x5b517b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 970c505..8684d21 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 _0x7ee1=['request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0x7ee1,0x8d));var _0x17ee=function(_0x284dd9,_0x244563){_0x284dd9=_0x284dd9-0x0;var _0x2703b3=_0x7ee1[_0x284dd9];return _0x2703b3;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ee('0x1'));var fs=require('fs');var Redis=require(_0x17ee('0x2'));var db=require(_0x17ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x4'))(_0x17ee('0x5'));var config=require(_0x17ee('0x6'));var jayson=require(_0x17ee('0x7'));var client=jayson['client'][_0x17ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b9eb,_0x54b4f6,_0x3f61af){return new BPromise(function(_0x57e1d1,_0x3d767b){return client[_0x17ee('0x9')](_0x29b9eb,_0x3f61af)[_0x17ee('0xa')](function(_0x4af369){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,_0x17ee('0xb'));logger['debug'](_0x17ee('0xc'),_0x54b4f6,_0x17ee('0xb'),JSON[_0x17ee('0xd')](_0x4af369));if(_0x4af369[_0x17ee('0xe')]){if(_0x4af369['error'][_0x17ee('0xf')]===0x1f4){logger['error'](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x3d767b(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x57e1d1(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,'request\x20sent');_0x57e1d1(_0x4af369['result'][_0x17ee('0x11')]);}})[_0x17ee('0x12')](function(_0x1b87c3){logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x1b87c3);_0x3d767b(_0x1b87c3);});});} \ No newline at end of file +var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1027cc,_0x132a7f){var _0x1fc43d=function(_0x44f641){while(--_0x44f641){_0x1027cc['push'](_0x1027cc['shift']());}};_0x1fc43d(++_0x132a7f);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e049acb..896f2ac 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 _0x1fec=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','put','/:id','isAuthenticated','update','util','path','connect-timeout','express'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1fec,0x1ea));var _0xc1fe=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1fec[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0xc1fe('0x0'));var path=require(_0xc1fe('0x1'));var timeout=require(_0xc1fe('0x2'));var express=require(_0xc1fe('0x3'));var router=express[_0xc1fe('0x4')]();var fs_extra=require(_0xc1fe('0x5'));var auth=require(_0xc1fe('0x6'));var interaction=require(_0xc1fe('0x7'));var config=require('../../config/environment');var controller=require(_0xc1fe('0x8'));router['get']('/',controller['index']);router[_0xc1fe('0x9')](_0xc1fe('0xa'),auth[_0xc1fe('0xb')](),controller[_0xc1fe('0xc')]);module['exports']=router; \ No newline at end of file +var _0x2fed=['path','connect-timeout','express','fs-extra','../../components/auth/service','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util'];(function(_0x23fdd1,_0x2ff416){var _0x5dc302=function(_0x286234){while(--_0x286234){_0x23fdd1['push'](_0x23fdd1['shift']());}};_0x5dc302(++_0x2ff416);}(_0x2fed,0x7c));var _0xd2fe=function(_0x208b0b,_0x327ea8){_0x208b0b=_0x208b0b-0x0;var _0x4dab2c=_0x2fed[_0x208b0b];return _0x4dab2c;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var fs_extra=require(_0xd2fe('0x5'));var auth=require(_0xd2fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',controller[_0xd2fe('0x9')]);router['put'](_0xd2fe('0xa'),auth[_0xd2fe('0xb')](),controller[_0xd2fe('0xc')]);module[_0xd2fe('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6a7f37f..606e8a1 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 _0xb87b=['TEXT','STRING','INTEGER','exports'];(function(_0x1baeec,_0x15bedd){var _0x579294=function(_0x5dc89a){while(--_0x5dc89a){_0x1baeec['push'](_0x1baeec['shift']());}};_0x579294(++_0x15bedd);}(_0xb87b,0xa7));var _0xbb87=function(_0x55d639,_0x3a34cf){_0x55d639=_0x55d639-0x0;var _0x48f544=_0xb87b[_0x55d639];return _0x48f544;};'use strict';var Sequelize=require('sequelize');module[_0xbb87('0x0')]={'license':{'type':Sequelize[_0xbb87('0x1')]},'data1':{'type':Sequelize[_0xbb87('0x2')]},'data2':{'type':Sequelize[_0xbb87('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xbb87('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xadb8=['STRING','sequelize','exports','TEXT'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xadb8,0xa9));var _0x8adb=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xadb8[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0x8adb('0x0'));module[_0x8adb('0x1')]={'license':{'type':Sequelize[_0x8adb('0x2')]},'data1':{'type':Sequelize[_0x8adb('0x3')]},'data2':{'type':Sequelize[_0x8adb('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 34d6439..882f0b3 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 _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','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','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x5e3877,_0x495db0){var _0x34f045=function(_0x496571){while(--_0x496571){_0x5e3877['push'](_0x5e3877['shift']());}};_0x34f045(++_0x495db0);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f37dd,_0x3fb389){_0x2f37dd=_0x2f37dd-0x0;var _0x8acc67=_0x2ef3[_0x2f37dd];return _0x8acc67;};'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);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file +var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x0295,0x1f0));var _0x5029=function(_0x111777,_0x43e893){_0x111777=_0x111777-0x0;var _0x18b652=_0x0295[_0x111777];return _0x18b652;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e147b0f..e83208e 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 _0x9f5a=['./license.attributes','define','License','util','request-promise','path','rimraf'];(function(_0x16bbde,_0x1720eb){var _0x397b05=function(_0x2db238){while(--_0x2db238){_0x16bbde['push'](_0x16bbde['shift']());}};_0x397b05(++_0x1720eb);}(_0x9f5a,0xf8));var _0xa9f5=function(_0x54fba4,_0x2ace28){_0x54fba4=_0x54fba4-0x0;var _0x5da0bb=_0x9f5a[_0x54fba4];return _0x5da0bb;};'use strict';var _=require('lodash');var util=require(_0xa9f5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9f5('0x1'));var fs=require('fs');var path=require(_0xa9f5('0x2'));var rimraf=require(_0xa9f5('0x3'));var config=require('../../config/environment');var attributes=require(_0xa9f5('0x4'));module['exports']=function(_0x5f43ed,_0x53a0ad){return _0x5f43ed[_0xa9f5('0x5')](_0xa9f5('0x6'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ed4=['bluebird','path','rimraf','../../config/environment','./license.attributes','define','License','license','lodash','../../config/logger','api','moment'];(function(_0x5e5d6f,_0x34b81b){var _0x2527cf=function(_0x363541){while(--_0x363541){_0x5e5d6f['push'](_0x5e5d6f['shift']());}};_0x2527cf(++_0x34b81b);}(_0x1ed4,0x1dc));var _0x41ed=function(_0x1d7cc1,_0x10b5cd){_0x1d7cc1=_0x1d7cc1-0x0;var _0x41e009=_0x1ed4[_0x1d7cc1];return _0x41e009;};'use strict';var _=require(_0x41ed('0x0'));var util=require('util');var logger=require(_0x41ed('0x1'))(_0x41ed('0x2'));var moment=require(_0x41ed('0x3'));var BPromise=require(_0x41ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41ed('0x5'));var rimraf=require(_0x41ed('0x6'));var config=require(_0x41ed('0x7'));var attributes=require(_0x41ed('0x8'));module['exports']=function(_0x5f13ee,_0x496d57){return _0x5f13ee[_0x41ed('0x9')](_0x41ed('0xa'),attributes,{'tableName':_0x41ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index b3f91e7..f0aa25a 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 _0x2a9d=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x3bcaeb,_0x39a754){var _0x20eb1d=function(_0x570dbb){while(--_0x570dbb){_0x3bcaeb['push'](_0x3bcaeb['shift']());}};_0x20eb1d(++_0x39a754);}(_0x2a9d,0x1f3));var _0xd2a9=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x2a9d[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0xd2a9('0x0'));var util=require(_0xd2a9('0x1'));var moment=require('moment');var BPromise=require(_0xd2a9('0x2'));var rs=require(_0xd2a9('0x3'));var fs=require('fs');var Redis=require(_0xd2a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2a9('0x5'));var logger=require(_0xd2a9('0x6'))(_0xd2a9('0x7'));var config=require(_0xd2a9('0x8'));var jayson=require(_0xd2a9('0x9'));var client=jayson[_0xd2a9('0xa')][_0xd2a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490e7b,_0x8301f9,_0x1f4029){return new BPromise(function(_0x34d76f,_0x1c27ff){return client[_0xd2a9('0xc')](_0x490e7b,_0x1f4029)[_0xd2a9('0xd')](function(_0x592dbd){logger[_0xd2a9('0xe')]('License,\x20%s,\x20%s',_0x8301f9,'request\x20sent');logger[_0xd2a9('0xf')](_0xd2a9('0x10'),_0x8301f9,'request\x20sent',JSON[_0xd2a9('0x11')](_0x592dbd));if(_0x592dbd['error']){if(_0x592dbd[_0xd2a9('0x12')][_0xd2a9('0x13')]===0x1f4){logger[_0xd2a9('0x12')](_0xd2a9('0x14'),_0x8301f9,_0x592dbd['error'][_0xd2a9('0x15')]);return _0x1c27ff(_0x592dbd['error']['message']);}logger[_0xd2a9('0x12')](_0xd2a9('0x14'),_0x8301f9,_0x592dbd[_0xd2a9('0x12')][_0xd2a9('0x15')]);return _0x34d76f(_0x592dbd[_0xd2a9('0x12')][_0xd2a9('0x15')]);}else{logger[_0xd2a9('0xe')](_0xd2a9('0x14'),_0x8301f9,_0xd2a9('0x16'));_0x34d76f(_0x592dbd[_0xd2a9('0x17')][_0xd2a9('0x15')]);}})[_0xd2a9('0x18')](function(_0xcc1be9){logger['error'](_0xd2a9('0x14'),_0x8301f9,_0xcc1be9);_0x1c27ff(_0xcc1be9);});});} \ No newline at end of file +var _0x157c=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4ab311,_0x51ac35){var _0x2c56c0=function(_0x17186d){while(--_0x17186d){_0x4ab311['push'](_0x4ab311['shift']());}};_0x2c56c0(++_0x51ac35);}(_0x157c,0x6b));var _0xc157=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x157c[_0x507403];return _0x1327c;};'use strict';var _=require(_0xc157('0x0'));var util=require(_0xc157('0x1'));var moment=require(_0xc157('0x2'));var BPromise=require(_0xc157('0x3'));var rs=require(_0xc157('0x4'));var fs=require('fs');var Redis=require(_0xc157('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc157('0x6'));var logger=require('../../config/logger')(_0xc157('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc157('0x8')][_0xc157('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbdb8df,_0x252ce4,_0x1e96eb){return new BPromise(function(_0x2473b4,_0x3e0139){return client['request'](_0xbdb8df,_0x1e96eb)[_0xc157('0xa')](function(_0x5bf1ed){logger['info'](_0xc157('0xb'),_0x252ce4,_0xc157('0xc'));logger[_0xc157('0xd')](_0xc157('0xe'),_0x252ce4,_0xc157('0xc'),JSON[_0xc157('0xf')](_0x5bf1ed));if(_0x5bf1ed[_0xc157('0x10')]){if(_0x5bf1ed[_0xc157('0x10')][_0xc157('0x11')]===0x1f4){logger[_0xc157('0x10')](_0xc157('0xb'),_0x252ce4,_0x5bf1ed[_0xc157('0x10')][_0xc157('0x12')]);return _0x3e0139(_0x5bf1ed[_0xc157('0x10')][_0xc157('0x12')]);}logger[_0xc157('0x10')](_0xc157('0xb'),_0x252ce4,_0x5bf1ed['error'][_0xc157('0x12')]);return _0x2473b4(_0x5bf1ed[_0xc157('0x10')][_0xc157('0x12')]);}else{logger[_0xc157('0x13')](_0xc157('0xb'),_0x252ce4,'request\x20sent');_0x2473b4(_0x5bf1ed['result'][_0xc157('0x12')]);}})[_0xc157('0x14')](function(_0x28a2cb){logger['error'](_0xc157('0xb'),_0x252ce4,_0x28a2cb);_0x3e0139(_0x28a2cb);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9388e32..bfb5cf2 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 _0x3492=['getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap'];(function(_0x9973e6,_0x1c8c6b){var _0x36ca8c=function(_0x387fb8){while(--_0x387fb8){_0x9973e6['push'](_0x9973e6['shift']());}};_0x36ca8c(++_0x1c8c6b);}(_0x3492,0x12b));var _0x2349=function(_0x24697e,_0x1d7031){_0x24697e=_0x24697e-0x0;var _0x5acb96=_0x3492[_0x24697e];return _0x5acb96;};'use strict';var multer=require(_0x2349('0x0'));var util=require(_0x2349('0x1'));var path=require(_0x2349('0x2'));var timeout=require(_0x2349('0x3'));var express=require(_0x2349('0x4'));var router=express[_0x2349('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2349('0x6'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router['get']('/',auth[_0x2349('0x7')](),controller[_0x2349('0x8')]);router[_0x2349('0x9')]('/describe',auth[_0x2349('0x7')](),controller['describe']);router[_0x2349('0x9')](_0x2349('0xa'),auth[_0x2349('0x7')](),controller[_0x2349('0xb')]);router[_0x2349('0x9')](_0x2349('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x2349('0x9')](_0x2349('0xd'),auth[_0x2349('0x7')](),controller[_0x2349('0xe')]);router[_0x2349('0x9')]('/:id/in_servers',auth[_0x2349('0x7')](),controller[_0x2349('0xf')]);router['get']('/:id/out_servers',auth[_0x2349('0x7')](),controller[_0x2349('0x10')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x2349('0x11')]);router[_0x2349('0x9')](_0x2349('0x12'),auth[_0x2349('0x7')](),controller[_0x2349('0x13')]);router[_0x2349('0x9')](_0x2349('0x14'),auth['isAuthenticated'](),controller[_0x2349('0x15')]);router[_0x2349('0x9')](_0x2349('0x16'),auth[_0x2349('0x7')](),controller['verifySmtp']);router[_0x2349('0x9')](_0x2349('0x17'),auth[_0x2349('0x7')](),controller['getAgents']);router[_0x2349('0x18')]('/:id/dispositions',auth[_0x2349('0x7')](),controller[_0x2349('0x19')]);router[_0x2349('0x18')](_0x2349('0xd'),auth[_0x2349('0x7')](),controller[_0x2349('0x1a')]);router[_0x2349('0x18')]('/',auth[_0x2349('0x7')](),controller[_0x2349('0x1b')]);router[_0x2349('0x18')](_0x2349('0x1c'),auth[_0x2349('0x7')](),controller[_0x2349('0x1d')]);router[_0x2349('0x18')](_0x2349('0x1e'),auth[_0x2349('0x7')](),controller[_0x2349('0x1f')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x2349('0x20')]);router['post']('/:id/applications',auth[_0x2349('0x7')](),controller[_0x2349('0x21')]);router[_0x2349('0x18')](_0x2349('0x22'),auth[_0x2349('0x7')](),controller['send']);router['post'](_0x2349('0x17'),auth[_0x2349('0x7')](),controller[_0x2349('0x23')]);router[_0x2349('0x24')](_0x2349('0xa'),auth[_0x2349('0x7')](),controller[_0x2349('0x25')]);router[_0x2349('0x26')](_0x2349('0xc'),auth['isAuthenticated'](),controller[_0x2349('0x27')]);router['delete'](_0x2349('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2349('0x26')](_0x2349('0x1c'),auth[_0x2349('0x7')](),controller[_0x2349('0x28')]);router['delete'](_0x2349('0x1e'),auth[_0x2349('0x7')](),controller[_0x2349('0x29')]);router[_0x2349('0x26')](_0x2349('0xa'),auth['isAuthenticated'](),controller[_0x2349('0x2a')]);router['delete'](_0x2349('0x17'),auth[_0x2349('0x7')](),controller[_0x2349('0x2b')]);module[_0x2349('0x2c')]=router; \ No newline at end of file +var _0x09ce=['post','addDisposition','/:id/canned_answers','addAnswer','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','/:id','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents'];(function(_0x51e136,_0x4eecfd){var _0x52b4f3=function(_0x2d0029){while(--_0x2d0029){_0x51e136['push'](_0x51e136['shift']());}};_0x52b4f3(++_0x4eecfd);}(_0x09ce,0x79));var _0xe09c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x09ce[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xe09c('0x0'));var util=require(_0xe09c('0x1'));var path=require('path');var timeout=require(_0xe09c('0x2'));var express=require(_0xe09c('0x3'));var router=express[_0xe09c('0x4')]();var fs_extra=require(_0xe09c('0x5'));var auth=require(_0xe09c('0x6'));var interaction=require(_0xe09c('0x7'));var config=require(_0xe09c('0x8'));var controller=require(_0xe09c('0x9'));router[_0xe09c('0xa')]('/',auth[_0xe09c('0xb')](),controller[_0xe09c('0xc')]);router[_0xe09c('0xa')](_0xe09c('0xd'),auth['isAuthenticated'](),controller[_0xe09c('0xe')]);router[_0xe09c('0xa')]('/:id',auth[_0xe09c('0xb')](),controller[_0xe09c('0xf')]);router['get'](_0xe09c('0x10'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x11')]);router[_0xe09c('0xa')]('/:id/canned_answers',auth[_0xe09c('0xb')](),controller[_0xe09c('0x12')]);router[_0xe09c('0xa')]('/:id/in_servers',auth[_0xe09c('0xb')](),controller['getImap']);router['get'](_0xe09c('0x13'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x14')]);router['get'](_0xe09c('0x15'),auth['isAuthenticated'](),controller[_0xe09c('0x16')]);router[_0xe09c('0xa')](_0xe09c('0x17'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x18')]);router['get'](_0xe09c('0x19'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x1a')]);router[_0xe09c('0xa')]('/:id/verify',auth[_0xe09c('0xb')](),controller['verifySmtp']);router[_0xe09c('0xa')](_0xe09c('0x1b'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x1c')]);router[_0xe09c('0x1d')]('/:id/dispositions',auth[_0xe09c('0xb')](),controller[_0xe09c('0x1e')]);router['post'](_0xe09c('0x1f'),auth['isAuthenticated'](),controller[_0xe09c('0x20')]);router[_0xe09c('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe09c('0x1d')](_0xe09c('0x21'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x22')]);router[_0xe09c('0x1d')]('/:id/out_servers',auth[_0xe09c('0xb')](),controller[_0xe09c('0x23')]);router[_0xe09c('0x1d')](_0xe09c('0x15'),auth['isAuthenticated'](),controller[_0xe09c('0x24')]);router[_0xe09c('0x1d')](_0xe09c('0x17'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x25')]);router['post'](_0xe09c('0x26'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x27')]);router[_0xe09c('0x1d')](_0xe09c('0x1b'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x28')]);router[_0xe09c('0x29')]('/:id',auth[_0xe09c('0xb')](),controller['update']);router[_0xe09c('0x2a')](_0xe09c('0x10'),auth['isAuthenticated'](),controller[_0xe09c('0x2b')]);router[_0xe09c('0x2a')](_0xe09c('0x1f'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x2c')]);router['delete'](_0xe09c('0x21'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x2d')]);router['delete'](_0xe09c('0x13'),auth[_0xe09c('0xb')](),controller['removeSmtp']);router[_0xe09c('0x2a')](_0xe09c('0x2e'),auth['isAuthenticated'](),controller[_0xe09c('0x2f')]);router[_0xe09c('0x2a')](_0xe09c('0x1b'),auth[_0xe09c('0xb')](),controller[_0xe09c('0x30')]);module[_0xe09c('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cf72b55..9e3de66 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 _0xb0b9=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x5f431f,_0x4a67c4){_0x5f431f=_0x5f431f-0x0;var _0x2be653=_0xb0b9[_0x5f431f];return _0x2be653;};'use strict';var Sequelize=require(_0x9b0b('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9b0b('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x9b0b('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9b0b('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x9b0b('0x3')]},'markAsUnread':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9b0b('0x1')],'allowNull':![],'defaultValue':_0x9b0b('0x4')},'fontSize':{'type':Sequelize[_0x9b0b('0x5')](0x2)[_0x9b0b('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9b0b('0x3')],'defaultValue':function(){return _0x9b0b('0x7');}},'notificationSound':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b0b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9b0b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b0b('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x9b0b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9b0b('0x9'),'set':function(_0x44c7e0){if(!_0x44c7e0)this[_0x9b0b('0xa')](_0x9b0b('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x44c7e0);}}}; \ No newline at end of file +var _0x83f1=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x3bee55,_0x4e25c8){var _0x5649d2=function(_0x13d730){while(--_0x13d730){_0x3bee55['push'](_0x3bee55['shift']());}};_0x5649d2(++_0x4e25c8);}(_0x83f1,0x1cc));var _0x183f=function(_0x5afce7,_0x3faa6a){_0x5afce7=_0x5afce7-0x0;var _0x21787e=_0x83f1[_0x5afce7];return _0x21787e;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'description':{'type':Sequelize[_0x183f('0x2')]},'name':{'type':Sequelize[_0x183f('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x183f('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x183f('0x4')]},'markAsUnread':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x183f('0x2')],'allowNull':![],'defaultValue':_0x183f('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x183f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x183f('0x4')],'defaultValue':function(){return _0x183f('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x183f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x183f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x183f('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x183f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x183f('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a1031){if(!_0x1a1031)this[_0x183f('0xa')](_0x183f('0xb'),null);this[_0x183f('0xa')](_0x183f('0xc'),_0x1a1031);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4c1eacc..3b15d0e 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 _0x5a0a=['auth','SendMail','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','Sequelize','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','MailAccounts','name','index','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MailServerIn','Pause','find','update','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','ids','getInteractions','MailInteraction','CmContact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure'];(function(_0x245c42,_0x1953e7){var _0x243649=function(_0x41d30e){while(--_0x41d30e){_0x245c42['push'](_0x245c42['shift']());}};_0x243649(++_0x1953e7);}(_0x5a0a,0x1a9));var _0xa5a0=function(_0x3ff108,_0x3698d7){_0x3ff108=_0x3ff108-0x0;var _0x3bc9ff=_0x5a0a[_0x3ff108];return _0x3bc9ff;};'use strict';var emlformat=require(_0xa5a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5a0('0x2'));var moment=require(_0xa5a0('0x3'));var BPromise=require(_0xa5a0('0x4'));var Mustache=require(_0xa5a0('0x5'));var util=require(_0xa5a0('0x6'));var path=require('path');var sox=require(_0xa5a0('0x7'));var csv=require('to-csv');var ejs=require(_0xa5a0('0x8'));var fs=require('fs');var fs_extra=require(_0xa5a0('0x9'));var _=require(_0xa5a0('0xa'));var squel=require(_0xa5a0('0xb'));var crypto=require(_0xa5a0('0xc'));var jsforce=require(_0xa5a0('0xd'));var deskjs=require(_0xa5a0('0xe'));var toCsv=require(_0xa5a0('0xf'));var querystring=require(_0xa5a0('0x10'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0xa5a0('0x11'));var Redis=require(_0xa5a0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa5a0('0x13'));var as=require(_0xa5a0('0x14'));var hardwareService=require(_0xa5a0('0x15'));var logger=require(_0xa5a0('0x16'))(_0xa5a0('0x17'));var utils=require(_0xa5a0('0x18'));var config=require(_0xa5a0('0x19'));var licenseUtil=require(_0xa5a0('0x1a'));var db=require(_0xa5a0('0x1b'))['db'];config['redis']=_[_0xa5a0('0x1c')](config[_0xa5a0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5a0('0x1e'))(new Redis(config[_0xa5a0('0x1d')]));require(_0xa5a0('0x1f'))[_0xa5a0('0x20')](socket);var jayson=require(_0xa5a0('0x21'));var client=jayson[_0xa5a0('0x22')][_0xa5a0('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x3557a1,_0x33a38e,_0x5eb409,_0x52611d){return new BPromise(function(_0x5a650f,_0x18bfac){var _0x58a90f=_0x52611d||client;return _0x58a90f['request'](_0x3557a1,_0x5eb409)[_0xa5a0('0x24')](function(_0x1aafb9){logger[_0xa5a0('0x25')]('MailAccount,\x20%s,\x20%s',_0x33a38e,'request\x20sent');logger[_0xa5a0('0x26')](_0xa5a0('0x27'),_0x33a38e,'request\x20sent',JSON['stringify'](_0x1aafb9));if(_0x1aafb9[_0xa5a0('0x28')]){if(_0x1aafb9[_0xa5a0('0x28')][_0xa5a0('0x29')]===0x1f4){logger[_0xa5a0('0x28')](_0xa5a0('0x2a'),_0x33a38e,_0x1aafb9[_0xa5a0('0x28')]['message']);return _0x18bfac(_0x1aafb9['error'][_0xa5a0('0x2b')]);}logger[_0xa5a0('0x28')](_0xa5a0('0x2a'),_0x33a38e,_0x1aafb9[_0xa5a0('0x28')][_0xa5a0('0x2b')]);return _0x5a650f(_0x1aafb9['error']['message']);}else{logger[_0xa5a0('0x25')]('MailAccount,\x20%s,\x20%s',_0x33a38e,_0xa5a0('0x2c'));_0x5a650f(_0x1aafb9[_0xa5a0('0x2d')]['message']);}})['catch'](function(_0x488e30){logger[_0xa5a0('0x28')](_0xa5a0('0x2a'),_0x33a38e,_0x488e30);_0x18bfac(_0x488e30);});});}function respondWithStatusCode(_0x5c3ea7,_0x5b89c5){_0x5b89c5=_0x5b89c5||0xcc;return function(_0x49e9b0){if(_0x49e9b0){return _0x5c3ea7[_0xa5a0('0x2e')](_0x5b89c5);}return _0x5c3ea7[_0xa5a0('0x2f')](_0x5b89c5)[_0xa5a0('0x30')]();};}function respondWithResult(_0x3fa34f,_0x118efd){_0x118efd=_0x118efd||0xc8;return function(_0x4fa9ef){if(_0x4fa9ef){return _0x3fa34f[_0xa5a0('0x2f')](_0x118efd)[_0xa5a0('0x31')](_0x4fa9ef);}};}function respondWithFilteredResult(_0x24ef8c,_0x5cd6a1){return function(_0x4bb3eb){if(_0x4bb3eb){var _0x1e7527=typeof _0x5cd6a1[_0xa5a0('0x32')]===_0xa5a0('0x33')&&typeof _0x5cd6a1['limit']===_0xa5a0('0x33');var _0x12f5b4=_0x4bb3eb[_0xa5a0('0x34')];var _0x1258d3=_0x1e7527?0x0:_0x5cd6a1[_0xa5a0('0x32')];var _0xe7953e=_0x1e7527?_0x4bb3eb[_0xa5a0('0x34')]:_0x5cd6a1['offset']+_0x5cd6a1[_0xa5a0('0x35')];var _0x620b97;if(_0xe7953e>=_0x12f5b4){_0xe7953e=_0x12f5b4;_0x620b97=0xc8;}else{_0x620b97=0xce;}_0x24ef8c[_0xa5a0('0x2f')](_0x620b97);return _0x24ef8c[_0xa5a0('0x36')](_0xa5a0('0x37'),_0x1258d3+'-'+_0xe7953e+'/'+_0x12f5b4)[_0xa5a0('0x31')](_0x4bb3eb);}return null;};}function patchUpdates(_0x30381a){return function(_0x1f2641){try{jsonpatch[_0xa5a0('0x38')](_0x1f2641,_0x30381a,!![]);}catch(_0x41fec6){return BPromise[_0xa5a0('0x39')](_0x41fec6);}return _0x1f2641[_0xa5a0('0x3a')]();};}function saveUpdates(_0x1b1780,_0x5f46d1){return function(_0x4f4ae6){if(_0x4f4ae6){return _0x4f4ae6['update'](_0x1b1780)[_0xa5a0('0x24')](function(_0x17b541){return _0x17b541;});}return null;};}function removeEntity(_0x13d20c,_0x3539ef){return function(_0x3e6d12){if(_0x3e6d12){return _0x3e6d12[_0xa5a0('0x3b')]()[_0xa5a0('0x24')](function(){var _0x2c0c86=_0x3e6d12['get']({'plain':!![]});var _0x41efa9=_0xa5a0('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0x41efa9,'resourceId':_0x2c0c86['id']}})[_0xa5a0('0x24')](function(){return _0x3e6d12;});})[_0xa5a0('0x24')](function(){_0x13d20c['status'](0xcc)[_0xa5a0('0x30')]();});}};}function handleEntityNotFound(_0x47ff9c,_0x5b1210){return function(_0x2463a5){if(!_0x2463a5){_0x47ff9c['sendStatus'](0x194);}return _0x2463a5;};}function handleError(_0x25f26f,_0x2d4ea3){_0x2d4ea3=_0x2d4ea3||0x1f4;return function(_0x194de5){logger[_0xa5a0('0x28')](_0x194de5['stack']);if(_0x194de5[_0xa5a0('0x3d')]){delete _0x194de5[_0xa5a0('0x3d')];}_0x25f26f[_0xa5a0('0x2f')](_0x2d4ea3)['send'](_0x194de5);};}exports[_0xa5a0('0x3e')]=function(_0x561fe2,_0x802c4f){var _0x4ac29a={'include':[{'model':db['MailServerIn'],'as':_0xa5a0('0x3f')},{'model':db[_0xa5a0('0x40')],'as':_0xa5a0('0x41')},{'model':db['Pause'],'as':_0xa5a0('0x42')}]},_0x26a860={},_0x159378={'count':0x0,'rows':[]};var _0x4a7db8=_[_0xa5a0('0x43')](db[_0xa5a0('0x44')][_0xa5a0('0x45')],function(_0x20eed5){return{'name':_0x20eed5['fieldName'],'type':_0x20eed5[_0xa5a0('0x46')]['key']};});_0x26a860[_0xa5a0('0x47')]=_['map'](_0x4a7db8,_0xa5a0('0x3d'));_0x26a860[_0xa5a0('0x48')]=_[_0xa5a0('0x49')](_0x561fe2[_0xa5a0('0x48')]);_0x26a860['filters']=_[_0xa5a0('0x4a')](_0x26a860[_0xa5a0('0x47')],_0x26a860['query']);_0x4ac29a[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x26a860[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0x561fe2[_0xa5a0('0x48')][_0xa5a0('0x4c')]));_0x4ac29a[_0xa5a0('0x4b')]=_0x4ac29a[_0xa5a0('0x4b')][_0xa5a0('0x4d')]?_0x4ac29a[_0xa5a0('0x4b')]:_0x26a860[_0xa5a0('0x47')];if(!_0x561fe2['query'][_0xa5a0('0x4e')](_0xa5a0('0x4f'))){_0x4ac29a[_0xa5a0('0x35')]=qs[_0xa5a0('0x35')](_0x561fe2[_0xa5a0('0x48')]['limit']);_0x4ac29a[_0xa5a0('0x32')]=qs[_0xa5a0('0x32')](_0x561fe2[_0xa5a0('0x48')][_0xa5a0('0x32')]);}_0x4ac29a[_0xa5a0('0x50')]=qs['sort'](_0x561fe2['query'][_0xa5a0('0x51')]);_0x4ac29a[_0xa5a0('0x52')]=qs[_0xa5a0('0x53')](_['pick'](_0x561fe2[_0xa5a0('0x48')],_0x26a860[_0xa5a0('0x53')]),_0x4a7db8);if(_0x561fe2[_0xa5a0('0x48')][_0xa5a0('0x54')]){_0x4ac29a['where']=_[_0xa5a0('0x55')](_0x4ac29a[_0xa5a0('0x52')],{'$or':_[_0xa5a0('0x43')](_0x4a7db8,function(_0x1e8e1a){if(_0x1e8e1a[_0xa5a0('0x46')]!==_0xa5a0('0x56')){var _0x2d2548={};_0x2d2548[_0x1e8e1a['name']]={'$like':'%'+_0x561fe2[_0xa5a0('0x48')][_0xa5a0('0x54')]+'%'};return _0x2d2548;}})});}_0x4ac29a=_['merge']({},_0x4ac29a,_0x561fe2[_0xa5a0('0x57')]);var _0x4632fe={'where':_0x4ac29a[_0xa5a0('0x52')]};return db[_0xa5a0('0x44')][_0xa5a0('0x34')](_0x4632fe)['then'](function(_0x287a76){_0x159378['count']=_0x287a76;if(_0x561fe2[_0xa5a0('0x48')][_0xa5a0('0x58')]){_0x4ac29a[_0xa5a0('0x59')]=[{'all':!![]}];}return db[_0xa5a0('0x44')][_0xa5a0('0x5a')](_0x4ac29a);})[_0xa5a0('0x24')](function(_0x42b01a){_0x159378[_0xa5a0('0x5b')]=_0x42b01a;return _0x159378;})[_0xa5a0('0x24')](respondWithFilteredResult(_0x802c4f,_0x4ac29a))[_0xa5a0('0x5c')](handleError(_0x802c4f,null));};exports[_0xa5a0('0x5d')]=function(_0x54364a,_0x59bb87){var _0x49038d={'raw':![],'where':{'id':_0x54364a[_0xa5a0('0x5e')]['id']},'include':[{'model':db[_0xa5a0('0x5f')],'as':'Imap'},{'model':db[_0xa5a0('0x40')],'as':'Smtp'},{'model':db[_0xa5a0('0x60')],'as':_0xa5a0('0x42')}]},_0x43b5bd={};_0x43b5bd[_0xa5a0('0x47')]=_[_0xa5a0('0x49')](db[_0xa5a0('0x44')][_0xa5a0('0x45')]);_0x43b5bd['query']=_[_0xa5a0('0x49')](_0x54364a['query']);_0x43b5bd[_0xa5a0('0x53')]=_[_0xa5a0('0x4a')](_0x43b5bd[_0xa5a0('0x47')],_0x43b5bd['query']);_0x49038d[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x43b5bd['model'],qs[_0xa5a0('0x4c')](_0x54364a[_0xa5a0('0x48')][_0xa5a0('0x4c')]));_0x49038d['attributes']=_0x49038d[_0xa5a0('0x4b')]['length']?_0x49038d[_0xa5a0('0x4b')]:_0x43b5bd[_0xa5a0('0x47')];if(_0x54364a[_0xa5a0('0x48')][_0xa5a0('0x58')]){_0x49038d[_0xa5a0('0x59')]=[{'all':!![]}];}_0x49038d=_['merge']({},_0x49038d,_0x54364a['options']);return db['MailAccount'][_0xa5a0('0x61')](_0x49038d)['then'](handleEntityNotFound(_0x59bb87,null))[_0xa5a0('0x24')](respondWithResult(_0x59bb87,null))[_0xa5a0('0x5c')](handleError(_0x59bb87,null));};exports[_0xa5a0('0x62')]=function(_0x20cb5d,_0x254ac0){if(_0x20cb5d[_0xa5a0('0x63')]['id']){delete _0x20cb5d['body']['id'];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x20cb5d[_0xa5a0('0x5e')]['id']},'include':[{'model':db[_0xa5a0('0x5f')],'as':_0xa5a0('0x3f')},{'model':db[_0xa5a0('0x40')],'as':_0xa5a0('0x41')},{'model':db[_0xa5a0('0x60')],'as':'mandatoryDispositionPause'}]})[_0xa5a0('0x24')](handleEntityNotFound(_0x254ac0,null))[_0xa5a0('0x24')](saveUpdates(_0x20cb5d[_0xa5a0('0x63')],null))[_0xa5a0('0x24')](function(_0x79af87){if(_0x79af87&&_0x20cb5d[_0xa5a0('0x63')]['Imap']){return db[_0xa5a0('0x5f')][_0xa5a0('0x62')](_0x20cb5d['body'][_0xa5a0('0x3f')],{'where':{'MailAccountId':_0x79af87['id']}})[_0xa5a0('0x24')](function(){return _0x79af87;});}return _0x79af87;})['then'](function(_0x638e6a){if(_0x638e6a&&_0x20cb5d[_0xa5a0('0x63')]['Smtp']){return db[_0xa5a0('0x40')][_0xa5a0('0x62')](_0x20cb5d['body'][_0xa5a0('0x41')],{'where':{'MailAccountId':_0x638e6a['id']}})[_0xa5a0('0x24')](function(){return _0x638e6a;});}return _0x638e6a;})['then'](respondWithResult(_0x254ac0,null))[_0xa5a0('0x5c')](handleError(_0x254ac0,null));};exports[_0xa5a0('0x64')]=function(_0xb098a4,_0x332944){return db[_0xa5a0('0x44')][_0xa5a0('0x64')]()[_0xa5a0('0x24')](respondWithResult(_0x332944,null))[_0xa5a0('0x5c')](handleError(_0x332944,null));};exports[_0xa5a0('0x65')]=function(_0x247dca,_0x5dfe72,_0x48fa58){if(_0x247dca[_0xa5a0('0x63')]['id']){delete _0x247dca['body']['id'];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x247dca['params']['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x5dfe72,null))['then'](function(_0x5c0f12){if(_0x5c0f12){_0x247dca[_0xa5a0('0x63')][_0xa5a0('0x66')]=_0x5c0f12['id'];return db[_0xa5a0('0x67')][_0xa5a0('0x68')](_0x247dca[_0xa5a0('0x63')]);}})[_0xa5a0('0x24')](respondWithResult(_0x5dfe72,null))[_0xa5a0('0x5c')](handleError(_0x5dfe72,null));};exports[_0xa5a0('0x69')]=function(_0xd0ba23,_0x3b0e26,_0xdd404f){var _0x3d75c8={'raw':![],'where':{}};var _0x13a6d8={};var _0x81a966={'count':0x0,'rows':[]};return db[_0xa5a0('0x44')]['findOne']({'where':{'id':_0xd0ba23[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x3b0e26,null))[_0xa5a0('0x24')](function(_0x1f72ca){if(_0x1f72ca){_0x13a6d8[_0xa5a0('0x47')]=_['keys'](db[_0xa5a0('0x67')][_0xa5a0('0x45')]);_0x13a6d8[_0xa5a0('0x48')]=_[_0xa5a0('0x49')](_0xd0ba23[_0xa5a0('0x48')]);_0x13a6d8['filters']=_[_0xa5a0('0x4a')](_0x13a6d8[_0xa5a0('0x47')],_0x13a6d8['query']);_0x3d75c8[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x13a6d8[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0xd0ba23['query']['fields']));_0x3d75c8[_0xa5a0('0x4b')]=_0x3d75c8[_0xa5a0('0x4b')][_0xa5a0('0x4d')]?_0x3d75c8[_0xa5a0('0x4b')]:_0x13a6d8[_0xa5a0('0x47')];if(!_0xd0ba23['query']['hasOwnProperty'](_0xa5a0('0x4f'))){_0x3d75c8[_0xa5a0('0x35')]=qs['limit'](_0xd0ba23[_0xa5a0('0x48')][_0xa5a0('0x35')]);_0x3d75c8[_0xa5a0('0x32')]=qs[_0xa5a0('0x32')](_0xd0ba23['query'][_0xa5a0('0x32')]);}_0x3d75c8[_0xa5a0('0x50')]=qs['sort'](_0xd0ba23[_0xa5a0('0x48')][_0xa5a0('0x51')]);_0x3d75c8[_0xa5a0('0x52')]=qs['filters'](_[_0xa5a0('0x6a')](_0xd0ba23['query'],_0x13a6d8['filters']));_0x3d75c8['where'][_0xa5a0('0x66')]=_0x1f72ca['id'];if(_0xd0ba23['query']['filter']){_0x3d75c8[_0xa5a0('0x52')]=_[_0xa5a0('0x55')](_0x3d75c8['where'],{'$or':_[_0xa5a0('0x43')](_0x3d75c8[_0xa5a0('0x4b')],function(_0x912db0){var _0x1ea9c7={};_0x1ea9c7[_0x912db0]={'$like':'%'+_0xd0ba23['query']['filter']+'%'};return _0x1ea9c7;})});}_0x3d75c8=_[_0xa5a0('0x55')]({},_0x3d75c8,_0xd0ba23[_0xa5a0('0x57')]);return db[_0xa5a0('0x67')][_0xa5a0('0x34')]({'where':_0x3d75c8[_0xa5a0('0x52')]})[_0xa5a0('0x24')](function(_0x5747c9){_0x81a966[_0xa5a0('0x34')]=_0x5747c9;if(_0xd0ba23[_0xa5a0('0x48')][_0xa5a0('0x58')]){_0x3d75c8['include']=[{'all':!![]}];}return db[_0xa5a0('0x67')][_0xa5a0('0x5a')](_0x3d75c8);})['then'](function(_0x28b3e8){_0x81a966[_0xa5a0('0x5b')]=_0x28b3e8;return _0x81a966;});}})[_0xa5a0('0x24')](respondWithFilteredResult(_0x3b0e26,_0x3d75c8))['catch'](handleError(_0x3b0e26,null));};exports[_0xa5a0('0x6b')]=function(_0x3cb639,_0x4e2b99,_0x43c7fd){return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x3cb639[_0xa5a0('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4e2b99,null))[_0xa5a0('0x24')](function(_0x135d37){if(_0x135d37){return _0x135d37[_0xa5a0('0x6b')](_0x3cb639['query']['ids']);}})[_0xa5a0('0x24')](respondWithStatusCode(_0x4e2b99,null))[_0xa5a0('0x5c')](handleError(_0x4e2b99,null));};exports[_0xa5a0('0x6c')]=function(_0xab8042,_0x5cb76f,_0x50a6ab){if(_0xab8042[_0xa5a0('0x63')]['id']){delete _0xab8042[_0xa5a0('0x63')]['id'];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0xab8042[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x5cb76f,null))[_0xa5a0('0x24')](function(_0x597d97){if(_0x597d97){_0xab8042[_0xa5a0('0x63')]['MailAccountId']=_0x597d97['id'];return db[_0xa5a0('0x6d')][_0xa5a0('0x68')](_0xab8042[_0xa5a0('0x63')]);}})[_0xa5a0('0x24')](respondWithResult(_0x5cb76f,null))[_0xa5a0('0x5c')](handleError(_0x5cb76f,null));};exports[_0xa5a0('0x6e')]=function(_0x5e7b2f,_0x2d6510,_0x155d38){var _0x3f0202={'raw':![],'where':{}};var _0x2c0106={};var _0x1cc1b1={'count':0x0,'rows':[]};return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x5e7b2f[_0xa5a0('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2d6510,null))[_0xa5a0('0x24')](function(_0x1ab60f){if(_0x1ab60f){_0x2c0106['model']=_['keys'](db[_0xa5a0('0x6d')][_0xa5a0('0x45')]);_0x2c0106['query']=_['keys'](_0x5e7b2f[_0xa5a0('0x48')]);_0x2c0106[_0xa5a0('0x53')]=_['intersection'](_0x2c0106['model'],_0x2c0106[_0xa5a0('0x48')]);_0x3f0202[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x2c0106['model'],qs[_0xa5a0('0x4c')](_0x5e7b2f[_0xa5a0('0x48')]['fields']));_0x3f0202[_0xa5a0('0x4b')]=_0x3f0202[_0xa5a0('0x4b')][_0xa5a0('0x4d')]?_0x3f0202['attributes']:_0x2c0106[_0xa5a0('0x47')];if(!_0x5e7b2f[_0xa5a0('0x48')]['hasOwnProperty'](_0xa5a0('0x4f'))){_0x3f0202['limit']=qs[_0xa5a0('0x35')](_0x5e7b2f[_0xa5a0('0x48')][_0xa5a0('0x35')]);_0x3f0202['offset']=qs[_0xa5a0('0x32')](_0x5e7b2f[_0xa5a0('0x48')][_0xa5a0('0x32')]);}_0x3f0202['order']=qs[_0xa5a0('0x51')](_0x5e7b2f[_0xa5a0('0x48')]['sort']);_0x3f0202[_0xa5a0('0x52')]=qs[_0xa5a0('0x53')](_[_0xa5a0('0x6a')](_0x5e7b2f[_0xa5a0('0x48')],_0x2c0106['filters']));_0x3f0202[_0xa5a0('0x52')][_0xa5a0('0x66')]=_0x1ab60f['id'];if(_0x5e7b2f['query'][_0xa5a0('0x54')]){_0x3f0202['where']=_[_0xa5a0('0x55')](_0x3f0202[_0xa5a0('0x52')],{'$or':_[_0xa5a0('0x43')](_0x3f0202[_0xa5a0('0x4b')],function(_0x47eb48){var _0x13c89c={};_0x13c89c[_0x47eb48]={'$like':'%'+_0x5e7b2f[_0xa5a0('0x48')][_0xa5a0('0x54')]+'%'};return _0x13c89c;})});}_0x3f0202=_[_0xa5a0('0x55')]({},_0x3f0202,_0x5e7b2f[_0xa5a0('0x57')]);return db[_0xa5a0('0x6d')]['count']({'where':_0x3f0202[_0xa5a0('0x52')]})[_0xa5a0('0x24')](function(_0x1018c3){_0x1cc1b1[_0xa5a0('0x34')]=_0x1018c3;if(_0x5e7b2f['query'][_0xa5a0('0x58')]){_0x3f0202['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3f0202);})[_0xa5a0('0x24')](function(_0x4b17d1){_0x1cc1b1[_0xa5a0('0x5b')]=_0x4b17d1;return _0x1cc1b1;});}})['then'](respondWithFilteredResult(_0x2d6510,_0x3f0202))[_0xa5a0('0x5c')](handleError(_0x2d6510,null));};exports['removeAnswers']=function(_0x242445,_0x40e429,_0x1e1f01){return db[_0xa5a0('0x44')]['find']({'where':{'id':_0x242445[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x40e429,null))[_0xa5a0('0x24')](function(_0x3503a7){if(_0x3503a7){return _0x3503a7[_0xa5a0('0x70')](_0x242445['query']['ids']);}})['then'](respondWithStatusCode(_0x40e429,null))[_0xa5a0('0x5c')](handleError(_0x40e429,null));};exports[_0xa5a0('0x68')]=function(_0x2b5dc1,_0x564858){var _0x3768d9={'name':_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x3d')],'key':_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x71')],'email':_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x72')],'ListId':_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x73')],'active':!_[_0xa5a0('0x74')](_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x75')])?_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x75')]:!![],'description':_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x76')]||null,'Imap':{},'Smtp':{}};if(_[_0xa5a0('0x74')](_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x77')])){if(_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x78')]){_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x79')]=_0x3768d9['Smtp'][_0xa5a0('0x79')]=_0x2b5dc1['body'][_0xa5a0('0x7a')];_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x7b')]=_0x3768d9[_0xa5a0('0x41')][_0xa5a0('0x7c')]=_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x7d')];}else{_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x7e')]=_0x3768d9[_0xa5a0('0x41')][_0xa5a0('0x7e')]=![];}_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x7f')]=_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x3f')][_0xa5a0('0x7f')];_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x80')]=_0x2b5dc1[_0xa5a0('0x63')]['Imap'][_0xa5a0('0x80')];_0x3768d9[_0xa5a0('0x41')][_0xa5a0('0x7f')]=_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x41')][_0xa5a0('0x7f')];_0x3768d9[_0xa5a0('0x41')]['port']=_0x2b5dc1['body'][_0xa5a0('0x41')][_0xa5a0('0x80')];}else{_0x3768d9[_0xa5a0('0x3f')][_0xa5a0('0x81')]=_0x3768d9[_0xa5a0('0x41')][_0xa5a0('0x81')]=_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x77')];_0x3768d9['Imap']['user']=_0x3768d9['Smtp']['user']=_0x2b5dc1[_0xa5a0('0x63')][_0xa5a0('0x7a')];_0x3768d9['Imap'][_0xa5a0('0x7b')]=_0x3768d9['Smtp']['pass']=_0x2b5dc1[_0xa5a0('0x63')]['cpassword'];}return db[_0xa5a0('0x44')][_0xa5a0('0x68')](_0x3768d9,{'include':[{'model':db[_0xa5a0('0x40')],'as':'Smtp'},{'model':db[_0xa5a0('0x5f')],'as':'Imap'}]})[_0xa5a0('0x24')](function(_0x3c81a2){var _0x20561e=_0x2b5dc1[_0xa5a0('0x79')]['get']({'plain':!![]});if(!_0x20561e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20561e['role']===_0xa5a0('0x79')){var _0x5c1ac6=_0x3c81a2['get']({'plain':!![]});return db[_0xa5a0('0x82')][_0xa5a0('0x61')]({'where':{'name':_0xa5a0('0x3c'),'userProfileId':_0x20561e[_0xa5a0('0x83')]},'raw':!![]})['then'](function(_0x1fd731){if(_0x1fd731&&_0x1fd731[_0xa5a0('0x84')]===0x0){return db[_0xa5a0('0x85')]['create']({'name':_0x5c1ac6['name'],'resourceId':_0x5c1ac6['id'],'type':_0x1fd731[_0xa5a0('0x3d')],'sectionId':_0x1fd731['id']},{})[_0xa5a0('0x24')](function(){return _0x3c81a2;});}else{return _0x3c81a2;}})[_0xa5a0('0x5c')](function(_0x4d0658){logger['error'](_0xa5a0('0x86'),_0x4d0658);throw _0x4d0658;});}return _0x3c81a2;})['then'](respondWithResult(_0x564858,0xc9))[_0xa5a0('0x5c')](handleError(_0x564858,null));};exports[_0xa5a0('0x87')]=function(_0x388e74,_0x5d8383,_0x306123){return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x388e74[_0xa5a0('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5d8383,null))[_0xa5a0('0x24')](function(_0x452062){if(_0x452062){return _0x452062[_0xa5a0('0x87')]();}return null;})[_0xa5a0('0x24')](respondWithResult(_0x5d8383,null))[_0xa5a0('0x5c')](handleError(_0x5d8383,null));};exports[_0xa5a0('0x88')]=function(_0x373278,_0x28ac55,_0x20ef14){if(_0x373278[_0xa5a0('0x63')]['id']){delete _0x373278[_0xa5a0('0x63')]['id'];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x373278[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x28ac55,null))[_0xa5a0('0x24')](function(_0x280f52){if(_0x280f52){_0x373278[_0xa5a0('0x63')]['MailAccountId']=_0x280f52['id'];return db[_0xa5a0('0x5f')][_0xa5a0('0x68')](_0x373278[_0xa5a0('0x63')]);}})[_0xa5a0('0x24')](respondWithResult(_0x28ac55,null))[_0xa5a0('0x5c')](handleError(_0x28ac55,null));};exports['removeImap']=function(_0x11f60b,_0x48420d,_0x442172){return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x11f60b['params']['id']}})['then'](handleEntityNotFound(_0x48420d,null))[_0xa5a0('0x24')](function(_0x3d3f2b){if(_0x3d3f2b){return _0x3d3f2b[_0xa5a0('0x89')](null);}return null;})[_0xa5a0('0x24')](respondWithStatusCode(_0x48420d,null))[_0xa5a0('0x5c')](handleError(_0x48420d,null));};exports[_0xa5a0('0x8a')]=function(_0x1eadc9,_0x9f53e4,_0x43fc73){return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x1eadc9[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x9f53e4,null))[_0xa5a0('0x24')](function(_0x29c809){if(_0x29c809){return _0x29c809[_0xa5a0('0x8a')]();}return null;})[_0xa5a0('0x24')](respondWithResult(_0x9f53e4,null))[_0xa5a0('0x5c')](handleError(_0x9f53e4,null));};exports[_0xa5a0('0x8b')]=function(_0x286268,_0x5a82f9,_0x3ee466){if(_0x286268[_0xa5a0('0x63')]['id']){delete _0x286268['body']['id'];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x286268['params']['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x5a82f9,null))[_0xa5a0('0x24')](function(_0x4d0e9a){if(_0x4d0e9a){_0x286268[_0xa5a0('0x63')][_0xa5a0('0x66')]=_0x4d0e9a['id'];return db[_0xa5a0('0x40')][_0xa5a0('0x68')](_0x286268[_0xa5a0('0x63')]);}})[_0xa5a0('0x24')](respondWithResult(_0x5a82f9,null))[_0xa5a0('0x5c')](handleError(_0x5a82f9,null));};exports[_0xa5a0('0x8c')]=function(_0x64a165,_0xa159b5,_0x354c24){return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x64a165[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0xa159b5,null))[_0xa5a0('0x24')](function(_0x105d7b){if(_0x105d7b){return _0x105d7b[_0xa5a0('0x8d')](null);}return null;})['then'](respondWithStatusCode(_0xa159b5,null))[_0xa5a0('0x5c')](handleError(_0xa159b5,null));};exports['addInteraction']=function(_0x1e7be2,_0x6d0286,_0x25a4e4){return db['MailInteraction'][_0xa5a0('0x61')]({'where':{'id':_0x1e7be2[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x6d0286,null))['then'](function(_0x457ae3){if(_0x457ae3){return _0x457ae3['addInteraction'](_0x1e7be2[_0xa5a0('0x63')][_0xa5a0('0x8e')],_['omit'](_0x1e7be2[_0xa5a0('0x63')],['ids','id'])||{});}})[_0xa5a0('0x24')](respondWithResult(_0x6d0286,null))[_0xa5a0('0x5c')](handleError(_0x6d0286,null));};exports[_0xa5a0('0x8f')]=function(_0x36cb63,_0x1468e0,_0x38abb5){var _0x10a3c6={'raw':![],'where':{}};var _0x205814={};var _0x219c2f={'count':0x0,'rows':[]};return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x36cb63[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x1468e0,null))[_0xa5a0('0x24')](function(_0x2066ed){if(_0x2066ed){_0x205814[_0xa5a0('0x47')]=_[_0xa5a0('0x49')](db['MailInteraction'][_0xa5a0('0x45')]);_0x205814[_0xa5a0('0x48')]=_[_0xa5a0('0x49')](_0x36cb63['query']);_0x205814[_0xa5a0('0x53')]=_[_0xa5a0('0x4a')](_0x205814[_0xa5a0('0x47')],_0x205814['query']);_0x10a3c6[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x205814[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0x36cb63[_0xa5a0('0x48')]['fields']));_0x10a3c6[_0xa5a0('0x4b')]=_0x10a3c6[_0xa5a0('0x4b')][_0xa5a0('0x4d')]?_0x10a3c6[_0xa5a0('0x4b')]:_0x205814[_0xa5a0('0x47')];if(!_0x36cb63[_0xa5a0('0x48')]['hasOwnProperty'](_0xa5a0('0x4f'))){_0x10a3c6['limit']=qs[_0xa5a0('0x35')](_0x36cb63[_0xa5a0('0x48')][_0xa5a0('0x35')]);_0x10a3c6[_0xa5a0('0x32')]=qs['offset'](_0x36cb63[_0xa5a0('0x48')][_0xa5a0('0x32')]);}_0x10a3c6['order']=qs['sort'](_0x36cb63['query']['sort']);_0x10a3c6[_0xa5a0('0x52')]=qs[_0xa5a0('0x53')](_[_0xa5a0('0x6a')](_0x36cb63[_0xa5a0('0x48')],_0x205814[_0xa5a0('0x53')]));_0x10a3c6[_0xa5a0('0x52')][_0xa5a0('0x66')]=_0x2066ed['id'];if(_0x36cb63['query']['filter']){_0x10a3c6[_0xa5a0('0x52')]=_[_0xa5a0('0x55')](_0x10a3c6['where'],{'$or':_[_0xa5a0('0x43')](_0x10a3c6[_0xa5a0('0x4b')],function(_0x527360){var _0x1c60b3={};_0x1c60b3[_0x527360]={'$like':'%'+_0x36cb63['query'][_0xa5a0('0x54')]+'%'};return _0x1c60b3;})});}_0x10a3c6=_['merge']({},_0x10a3c6,_0x36cb63[_0xa5a0('0x57')]);return db[_0xa5a0('0x90')][_0xa5a0('0x34')]({'where':_0x10a3c6['where']})[_0xa5a0('0x24')](function(_0x37a9b1){_0x219c2f[_0xa5a0('0x34')]=_0x37a9b1;if(_0x36cb63[_0xa5a0('0x48')][_0xa5a0('0x58')]){_0x10a3c6[_0xa5a0('0x59')]=[{'model':db[_0xa5a0('0x91')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa5a0('0x92'),'attributes':['name','fullname',_0xa5a0('0x93')],'required':![]},{'model':db[_0xa5a0('0x94')],'as':_0xa5a0('0x95'),'attributes':['id','name',_0xa5a0('0x96')],'where':_0x36cb63['query'][_0xa5a0('0x97')]?{'id':_0x36cb63[_0xa5a0('0x48')][_0xa5a0('0x97')]}:undefined,'required':_0x36cb63[_0xa5a0('0x48')][_0xa5a0('0x97')]?!![]:![]}];}return db['MailInteraction'][_0xa5a0('0x5a')](_0x10a3c6);})[_0xa5a0('0x24')](function(_0x2707ec){_0x219c2f[_0xa5a0('0x5b')]=_0x2707ec;return _0x219c2f;});}})['then'](respondWithFilteredResult(_0x1468e0,_0x10a3c6))['catch'](handleError(_0x1468e0,null));};exports[_0xa5a0('0x98')]=function addApplications(_0x3fd20d,_0x563b7b){var _0x2f15a5=_0x3fd20d['params']['id'];var _0x390e73=_0x3fd20d[_0xa5a0('0x63')];var _0x32b02f=0xc8;var _0x397f6e=null;return db[_0xa5a0('0x99')][_0xa5a0('0x9a')]({'isolationLevel':db[_0xa5a0('0x99')][_0xa5a0('0x9b')]['ISOLATION_LEVELS'][_0xa5a0('0x9c')]},function(_0x17fa15){return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x2f15a5},'transaction':_0x17fa15})[_0xa5a0('0x24')](function(_0x3effae){if(_0x3effae){return db[_0xa5a0('0x9d')][_0xa5a0('0x3b')]({'where':{'MailAccountId':_0x2f15a5},'transaction':_0x17fa15})['then'](function(){var _0x35d860=_[_0xa5a0('0x43')](_0x390e73,function(_0x524096){_0x524096['MailAccountId']=_0x2f15a5;return _0x524096;});return db[_0xa5a0('0x9d')][_0xa5a0('0x9e')](_0x35d860,{'transaction':_0x17fa15});});}else{_0x32b02f=0x194;_0x397f6e=[];}});})[_0xa5a0('0x24')](function(){if(_0x32b02f!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x2f15a5},'order':_0xa5a0('0x9f')})[_0xa5a0('0x24')](function(_0x3c5681){_0x397f6e=_0x3c5681;});}})[_0xa5a0('0x5c')](function(_0x22ea8e){_0x32b02f=0x1f4;logger['error'](_0x22ea8e[_0xa5a0('0xa0')]);if(_0x22ea8e[_0xa5a0('0x3d')]){delete _0x22ea8e[_0xa5a0('0x3d')];}_0x397f6e=_0x22ea8e;})[_0xa5a0('0xa1')](function(){if(_0x397f6e===null){_0x563b7b[_0xa5a0('0x2e')](_0x32b02f);}else{if(_0x32b02f===0x1f4){_0x563b7b['status'](_0x32b02f)[_0xa5a0('0xa2')](_0x397f6e);}else{_0x563b7b['status'](_0x32b02f)[_0xa5a0('0x31')](_0x397f6e);}}});};exports[_0xa5a0('0xa3')]=function(_0x2f67a1,_0x543b61,_0x2354dc){var _0x386b46={};var _0x40cee2={};var _0x200e12;var _0x198987;return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x2f67a1['params']['id']}})['then'](handleEntityNotFound(_0x543b61,null))[_0xa5a0('0x24')](function(_0x269248){if(_0x269248){_0x200e12=_0x269248;_0x40cee2[_0xa5a0('0x47')]=_['keys'](db[_0xa5a0('0x9d')][_0xa5a0('0x45')]);_0x40cee2['query']=_[_0xa5a0('0x49')](_0x2f67a1['query']);_0x40cee2[_0xa5a0('0x53')]=_[_0xa5a0('0x4a')](_0x40cee2[_0xa5a0('0x47')],_0x40cee2[_0xa5a0('0x48')]);_0x386b46[_0xa5a0('0x4b')]=_['intersection'](_0x40cee2[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0x2f67a1['query'][_0xa5a0('0x4c')]));_0x386b46[_0xa5a0('0x4b')]=_0x386b46['attributes']['length']?_0x386b46['attributes']:_0x40cee2['model'];_0x386b46[_0xa5a0('0x50')]=qs[_0xa5a0('0x51')](_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x51')]);_0x386b46[_0xa5a0('0x52')]=qs[_0xa5a0('0x53')](_['pick'](_0x2f67a1['query'],_0x40cee2['filters']));if(_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x54')]){_0x386b46['where']=_[_0xa5a0('0x55')](_0x386b46['where'],{'$or':_[_0xa5a0('0x43')](_0x386b46[_0xa5a0('0x4b')],function(_0xcc8cdf){var _0x444659={};_0x444659[_0xcc8cdf]={'$like':'%'+_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x54')]+'%'};return _0x444659;})});}_0x386b46=_[_0xa5a0('0x55')]({},_0x386b46,_0x2f67a1['options']);return _0x200e12[_0xa5a0('0xa3')](_0x386b46);}})['then'](function(_0xc89b0){if(_0xc89b0){_0x198987=_0xc89b0[_0xa5a0('0x4d')];if(!_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x4e')](_0xa5a0('0x4f'))){_0x386b46[_0xa5a0('0x35')]=qs[_0xa5a0('0x35')](_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x35')]);_0x386b46[_0xa5a0('0x32')]=qs[_0xa5a0('0x32')](_0x2f67a1[_0xa5a0('0x48')][_0xa5a0('0x32')]);}return _0x200e12[_0xa5a0('0xa3')](_0x386b46);}})['then'](function(_0x3c4d09){if(_0x3c4d09){return _0x3c4d09?{'count':_0x198987,'rows':_0x3c4d09}:null;}})[_0xa5a0('0x24')](respondWithResult(_0x543b61,null))[_0xa5a0('0x5c')](handleError(_0x543b61,null));};exports[_0xa5a0('0xa4')]=function(_0x3d3c83,_0x8716ad,_0x303e03){var _0x5d62ff={'raw':!![],'where':{}};var _0x508324={};var _0x3f6214={'count':0x0,'rows':[]};return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x3d3c83['params']['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x8716ad,null))['then'](function(_0x17113e){if(_0x17113e){_0x508324[_0xa5a0('0x47')]=_['keys'](db[_0xa5a0('0xa5')][_0xa5a0('0x45')]);_0x508324['query']=_[_0xa5a0('0x49')](_0x3d3c83[_0xa5a0('0x48')]);_0x508324['filters']=_[_0xa5a0('0x4a')](_0x508324[_0xa5a0('0x47')],_0x508324['query']);_0x5d62ff[_0xa5a0('0x4b')]=_[_0xa5a0('0x4a')](_0x508324[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0x4c')]));_0x5d62ff[_0xa5a0('0x4b')]=_0x5d62ff['attributes'][_0xa5a0('0x4d')]?_0x5d62ff[_0xa5a0('0x4b')]:_0x508324[_0xa5a0('0x47')];if(!_0x3d3c83[_0xa5a0('0x48')]['hasOwnProperty'](_0xa5a0('0x4f'))){_0x5d62ff['limit']=qs[_0xa5a0('0x35')](_0x3d3c83['query']['limit']);_0x5d62ff[_0xa5a0('0x32')]=qs[_0xa5a0('0x32')](_0x3d3c83['query']['offset']);}_0x5d62ff['order']=qs[_0xa5a0('0x51')](_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0x51')]);_0x5d62ff[_0xa5a0('0x52')]=qs[_0xa5a0('0x53')](_[_0xa5a0('0x6a')](_0x3d3c83[_0xa5a0('0x48')],_0x508324['filters']));_0x5d62ff[_0xa5a0('0x52')][_0xa5a0('0x66')]=_0x17113e['id'];if(_0x3d3c83['query'][_0xa5a0('0x54')]){_0x5d62ff[_0xa5a0('0x52')]=_[_0xa5a0('0x55')](_0x5d62ff[_0xa5a0('0x52')],{'$or':_[_0xa5a0('0x43')](_0x5d62ff['attributes'],function(_0x261b10){var _0x44e649={};_0x44e649[_0x261b10]={'$like':'%'+_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0x54')]+'%'};return _0x44e649;})});}if(_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0xa6')]){var _0x2fdff1=_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0xa6')][_0xa5a0('0xa7')](',');var _0x3f8aaf={};_0x3f8aaf[_0x2fdff1[0x0]]={'$gte':moment(_0x2fdff1[0x1])[_0xa5a0('0xa8')](_0xa5a0('0xa9'))};_0x5d62ff[_0xa5a0('0x52')]=_[_0xa5a0('0x55')](_0x5d62ff[_0xa5a0('0x52')],_0x3f8aaf);}_0x5d62ff=_['merge']({},_0x5d62ff,_0x3d3c83[_0xa5a0('0x57')]);return db[_0xa5a0('0xa5')][_0xa5a0('0x34')]({'where':_0x5d62ff[_0xa5a0('0x52')]})[_0xa5a0('0x24')](function(_0x115ee5){_0x3f6214[_0xa5a0('0x34')]=_0x115ee5;if(_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0x58')]){_0x5d62ff['include']=[{'all':!![]}];}return db[_0xa5a0('0xa5')][_0xa5a0('0x5a')](_0x5d62ff);})['then'](function(_0x176835){if(_0x3d3c83[_0xa5a0('0x48')][_0xa5a0('0xaa')]===_0xa5a0('0xab')){for(var _0x202afb=0x0;_0x202afb<_0x176835[_0xa5a0('0x4d')];_0x202afb++){_0x176835[_0x202afb]['body']=juice(_0x176835[_0x202afb][_0xa5a0('0x63')]);}}_0x3f6214[_0xa5a0('0x5b')]=_0x176835;return _0x3f6214;});}})[_0xa5a0('0x24')](respondWithFilteredResult(_0x8716ad,_0x5d62ff))[_0xa5a0('0x5c')](handleError(_0x8716ad,null));};exports[_0xa5a0('0xa2')]=function(_0x384a56,_0x20cac1,_0x352981){var _0x42bd91,_0xf00804={},_0x3bb6e8;if(_0x384a56['body']['to']){_0x3bb6e8=_0x384a56['body']['to'][_0xa5a0('0xa7')](',')[0x0];}return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x384a56[_0xa5a0('0x5e')]['id']},'include':[{'model':db[_0xa5a0('0xac')],'as':_0xa5a0('0xad'),'include':[{'model':db[_0xa5a0('0x91')],'as':_0xa5a0('0xae'),'where':{'email':_0x3bb6e8},'limit':0x1,'order':[[_0xa5a0('0xaf'),_0xa5a0('0xb0')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xa5a0('0x24')](handleEntityNotFound(_0x20cac1,null))['then'](function(_0x228a81){if(_0x228a81){_0x42bd91=_0x228a81;if(_0x228a81['Smtp']){if(_[_0xa5a0('0x74')](_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb1')])){_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb1')]=util[_0xa5a0('0xa8')](_0xa5a0('0xb2'),_0x228a81['name'],_0x228a81[_0xa5a0('0x72')]||_0x228a81[_0xa5a0('0x41')]['user']);}if(_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb3')]&&_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb3')]['length']){for(var _0x21e3ff=0x0;_0x21e3ff<_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb3')][_0xa5a0('0x4d')];_0x21e3ff+=0x1){_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb3')][_0x21e3ff]={'filename':_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb3')][_0x21e3ff][_0xa5a0('0x3d')],'path':path['join'](config[_0xa5a0('0xb4')],_0xa5a0('0xb5'),_0x384a56['body']['attachments'][_0x21e3ff][_0xa5a0('0xb6')])};}}var _0x3841f3={'tls':{'rejectUnauthorized':![]}};if(_[_0xa5a0('0x74')](_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x81')])){if(_0x228a81[_0xa5a0('0x41')]['authentication']){_0x3841f3['auth']={'user':_0x228a81[_0xa5a0('0x41')]['user'],'pass':_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x7c')]};}_0x3841f3['host']=_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x7f')];_0x3841f3['port']=_0x228a81[_0xa5a0('0x41')]['port'];_0x3841f3[_0xa5a0('0xb7')]=_0x228a81['Smtp'][_0xa5a0('0xb7')];}else{_0x3841f3[_0xa5a0('0x81')]=_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x81')];_0x3841f3[_0xa5a0('0xb8')]={'user':_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x79')],'pass':_0x228a81[_0xa5a0('0x41')][_0xa5a0('0x7c')]};}return respondWithRpcPromise(_0xa5a0('0xb9'),'sendMail',{'account':_0x3841f3,'message':_0x384a56['body']});}else{throw new Error('List\x20not\x20found');}}})[_0xa5a0('0x24')](function(_0xc859b0){if(_0xc859b0){_0xf00804=_0xc859b0;if(_0x42bd91[_0xa5a0('0xad')]){if(_0x42bd91['List']['Contacts'][_0xa5a0('0x4d')]){return _0x42bd91[_0xa5a0('0xad')][_0xa5a0('0xae')][0x0];}else{return db[_0xa5a0('0x91')][_0xa5a0('0x68')](_[_0xa5a0('0x1c')](_0x384a56[_0xa5a0('0x63')],{'firstName':_0x384a56[_0xa5a0('0x63')]['to'],'email':_0x384a56[_0xa5a0('0x63')]['to'],'phone':_0x384a56[_0xa5a0('0x63')]['to'],'ListId':_0x42bd91[_0xa5a0('0x73')]}));}}else{throw new Error(_0xa5a0('0xba'));}}})[_0xa5a0('0x24')](function(_0x42530c){if(_0x42530c){var _0x2f200e={'UserId':_0x384a56['user']['id'],'ContactId':_0x42530c['id'],'MailAccountId':_0x42bd91['id'],'inReplyTo':_0xf00804[_0xa5a0('0xbb')],'to':_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xb1')],'cc':_0x384a56[_0xa5a0('0x63')]['cc'],'subject':_0x384a56[_0xa5a0('0x63')][_0xa5a0('0xbc')],'attach':_0x384a56[_0xa5a0('0x63')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xa5a0('0xa8')](_0xa5a0('0xa9')),'lastMsgDirection':_0xa5a0('0xbd'),'Messages':[_['merge'](_0x384a56[_0xa5a0('0x63')],{'messageId':_0xf00804['messageId'],'sentAt':moment()['format'](_0xa5a0('0xa9')),'read':!![],'MailAccountId':_0x42bd91['id'],'UserId':_0x384a56['user']['id'],'ContactId':_0x42530c['id']})]};if(_0x384a56['body'][_0xa5a0('0xbe')]){_0x2f200e=_[_0xa5a0('0x55')](_0x2f200e,_0x384a56[_0xa5a0('0x63')]['Interaction']);}return db[_0xa5a0('0x90')][_0xa5a0('0x68')](_0x2f200e,{'include':[{'model':db[_0xa5a0('0xa5')],'as':_0xa5a0('0xbf')}]});}})[_0xa5a0('0x24')](respondWithResult(_0x20cac1,null))[_0xa5a0('0x5c')](handleError(_0x20cac1,null));};exports[_0xa5a0('0xc0')]=function(_0x41d53f,_0x11a1ee,_0x3af7c3){return db[_0xa5a0('0x44')][_0xa5a0('0x61')]({'where':{'id':_0x41d53f[_0xa5a0('0x5e')]['id']},'include':[{'model':db[_0xa5a0('0x40')],'as':'Smtp','raw':!![]}]})[_0xa5a0('0x24')](handleEntityNotFound(_0x11a1ee,null))[_0xa5a0('0x24')](function(_0x507917){if(_0x507917&&_0x507917[_0xa5a0('0x41')]){var _0x2edf83={'id':_0x507917['id'],'tls':{'rejectUnauthorized':![]}};if(_0x507917[_0xa5a0('0x41')][_0xa5a0('0x81')]){_0x2edf83['service']=_0x507917[_0xa5a0('0x41')]['service'];}else{_0x2edf83['host']=_0x507917[_0xa5a0('0x41')][_0xa5a0('0x7f')];_0x2edf83[_0xa5a0('0x80')]=_0x507917[_0xa5a0('0x41')][_0xa5a0('0x80')];_0x2edf83[_0xa5a0('0xb7')]=_0x507917['Smtp']['secure'];}if(_0x507917['Smtp'][_0xa5a0('0x7e')]){_0x2edf83[_0xa5a0('0xb8')]={'user':_0x507917['Smtp'][_0xa5a0('0x79')],'pass':_0x507917[_0xa5a0('0x41')][_0xa5a0('0x7c')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x2edf83});}})[_0xa5a0('0x24')](respondWithResult(_0x11a1ee,null))[_0xa5a0('0x5c')](handleError(_0x11a1ee,null));};exports[_0xa5a0('0x3b')]=function(_0x56097d,_0x63558e){return db[_0xa5a0('0x44')]['find']({'where':{'id':_0x56097d['params']['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x63558e,null))[_0xa5a0('0x24')](function(_0x70a810){if(_0x70a810&&_0x70a810[_0xa5a0('0x81')]){throw new db[(_0xa5a0('0xc1'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x70a810;})[_0xa5a0('0x24')](removeEntity(_0x63558e,null))['catch'](handleError(_0x63558e,null));};exports[_0xa5a0('0xc2')]=function(_0x37c8ae,_0x3d77bc,_0x285485){return db[_0xa5a0('0x44')]['find']({'where':{'id':_0x37c8ae[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x3d77bc,null))['then'](function(_0x303b86){if(_0x303b86){return _0x303b86[_0xa5a0('0xc2')](_0x37c8ae[_0xa5a0('0x63')][_0xa5a0('0x8e')],_[_0xa5a0('0xc3')](_0x37c8ae[_0xa5a0('0x63')],[_0xa5a0('0x8e'),'id'])||{})[_0xa5a0('0xc4')](function(_0x182601){for(var _0x18c92b=0x0;_0x18c92b<_0x37c8ae[_0xa5a0('0x63')][_0xa5a0('0x8e')]['length'];_0x18c92b+=0x1){socket[_0xa5a0('0xc5')](_0xa5a0('0xc6'),{'UserId':Number(_0x37c8ae[_0xa5a0('0x63')][_0xa5a0('0x8e')][_0x18c92b]),'MailAccountId':Number(_0x37c8ae[_0xa5a0('0x5e')]['id'])});}return _0x182601;});}})[_0xa5a0('0x24')](respondWithResult(_0x3d77bc,null))[_0xa5a0('0x5c')](handleError(_0x3d77bc,null));};exports[_0xa5a0('0xc7')]=function(_0x37621f,_0x13cef6,_0x15bb90){return db['MailAccount'][_0xa5a0('0x61')]({'where':{'id':_0x37621f['params']['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x13cef6,null))[_0xa5a0('0x24')](function(_0x5b5096){if(_0x5b5096){return _0x5b5096[_0xa5a0('0xc7')](_0x37621f['query'][_0xa5a0('0x8e')])[_0xa5a0('0x24')](function(){if(_[_0xa5a0('0xc8')](_0x37621f[_0xa5a0('0x48')][_0xa5a0('0x8e')])){for(var _0xc1ce7f=0x0;_0xc1ce7f<_0x37621f[_0xa5a0('0x48')][_0xa5a0('0x8e')]['length'];_0xc1ce7f+=0x1){socket['emit'](_0xa5a0('0xc9'),{'UserId':Number(_0x37621f['query'][_0xa5a0('0x8e')][_0xc1ce7f]),'MailAccountId':Number(_0x37621f[_0xa5a0('0x5e')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x37621f['query'][_0xa5a0('0x8e')]),'MailAccountId':Number(_0x37621f[_0xa5a0('0x5e')]['id'])});}});}})[_0xa5a0('0x24')](respondWithStatusCode(_0x13cef6,null))[_0xa5a0('0x5c')](handleError(_0x13cef6,null));};exports[_0xa5a0('0xca')]=function(_0x18c873,_0x472e5c,_0xc92b11){var _0x15b2a1={};var _0x283fb8={};var _0x29a34a;var _0x39b8a2;return db[_0xa5a0('0x44')][_0xa5a0('0x6f')]({'where':{'id':_0x18c873[_0xa5a0('0x5e')]['id']}})[_0xa5a0('0x24')](handleEntityNotFound(_0x472e5c,null))[_0xa5a0('0x24')](function(_0x21d809){if(_0x21d809){_0x29a34a=_0x21d809;_0x283fb8[_0xa5a0('0x47')]=_[_0xa5a0('0x49')](db['User'][_0xa5a0('0x45')]);_0x283fb8[_0xa5a0('0x48')]=_['keys'](_0x18c873[_0xa5a0('0x48')]);_0x283fb8[_0xa5a0('0x53')]=_[_0xa5a0('0x4a')](_0x283fb8['model'],_0x283fb8[_0xa5a0('0x48')]);_0x15b2a1[_0xa5a0('0x4b')]=_['intersection'](_0x283fb8[_0xa5a0('0x47')],qs[_0xa5a0('0x4c')](_0x18c873[_0xa5a0('0x48')][_0xa5a0('0x4c')]));_0x15b2a1[_0xa5a0('0x4b')]=_0x15b2a1[_0xa5a0('0x4b')]['length']?_0x15b2a1[_0xa5a0('0x4b')]:_0x283fb8[_0xa5a0('0x47')];_0x15b2a1[_0xa5a0('0x50')]=qs[_0xa5a0('0x51')](_0x18c873['query'][_0xa5a0('0x51')]);_0x15b2a1[_0xa5a0('0x52')]=qs['filters'](_[_0xa5a0('0x6a')](_0x18c873['query'],_0x283fb8['filters']));if(_0x18c873[_0xa5a0('0x48')]['filter']){_0x15b2a1['where']=_[_0xa5a0('0x55')](_0x15b2a1['where'],{'$or':_[_0xa5a0('0x43')](_0x15b2a1['attributes'],function(_0x56b293){var _0x245f02={};_0x245f02[_0x56b293]={'$like':'%'+_0x18c873[_0xa5a0('0x48')]['filter']+'%'};return _0x245f02;})});}_0x15b2a1=_[_0xa5a0('0x55')]({},_0x15b2a1,_0x18c873[_0xa5a0('0x57')]);return _0x29a34a[_0xa5a0('0xca')](_0x15b2a1);}})[_0xa5a0('0x24')](function(_0x10e20d){if(_0x10e20d){_0x39b8a2=_0x10e20d[_0xa5a0('0x4d')];if(!_0x18c873['query'][_0xa5a0('0x4e')](_0xa5a0('0x4f'))){_0x15b2a1[_0xa5a0('0x35')]=qs['limit'](_0x18c873[_0xa5a0('0x48')]['limit']);_0x15b2a1[_0xa5a0('0x32')]=qs['offset'](_0x18c873['query'][_0xa5a0('0x32')]);}return _0x29a34a[_0xa5a0('0xca')](_0x15b2a1);}})[_0xa5a0('0x24')](function(_0x58b64c){if(_0x58b64c){return _0x58b64c?{'count':_0x39b8a2,'rows':_0x58b64c}:null;}})[_0xa5a0('0x24')](respondWithResult(_0x472e5c,null))[_0xa5a0('0x5c')](handleError(_0x472e5c,null));}; \ No newline at end of file +var _0xc969=['desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','name','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','params','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','hasOwnProperty','pick','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','basename','secure','sendMail','List\x20not\x20found','List','messageId','subject','out','Interaction','Messages','auth','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce'];(function(_0x87d3ec,_0x387888){var _0x5f3f6f=function(_0x5492ac){while(--_0x5492ac){_0x87d3ec['push'](_0x87d3ec['shift']());}};_0x5f3f6f(++_0x387888);}(_0xc969,0x171));var _0x9c96=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc969[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0x9c96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9c96('0x1'));var rp=require('request-promise');var moment=require(_0x9c96('0x2'));var BPromise=require(_0x9c96('0x3'));var Mustache=require(_0x9c96('0x4'));var util=require(_0x9c96('0x5'));var path=require(_0x9c96('0x6'));var sox=require(_0x9c96('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c96('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c96('0x9'));var jsforce=require(_0x9c96('0xa'));var deskjs=require(_0x9c96('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9c96('0xc'));var Papa=require(_0x9c96('0xd'));var htmlToText=require(_0x9c96('0xe'));var juice=require('juice');var Redis=require(_0x9c96('0xf'));var authService=require(_0x9c96('0x10'));var qs=require(_0x9c96('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c96('0x12'));var logger=require(_0x9c96('0x13'))('api');var utils=require(_0x9c96('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9c96('0x15'));var db=require(_0x9c96('0x16'))['db'];config[_0x9c96('0x17')]=_[_0x9c96('0x18')](config[_0x9c96('0x17')],{'host':_0x9c96('0x19'),'port':0x18eb});var socket=require(_0x9c96('0x1a'))(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9c96('0x1b')][_0x9c96('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x6cf256,_0x10d857,_0x2b53e8,_0x389c28){return new BPromise(function(_0x55e391,_0x196ddc){var _0x51b23b=_0x389c28||client;return _0x51b23b['request'](_0x6cf256,_0x2b53e8)['then'](function(_0x37c572){logger[_0x9c96('0x1d')]('MailAccount,\x20%s,\x20%s',_0x10d857,_0x9c96('0x1e'));logger[_0x9c96('0x1f')](_0x9c96('0x20'),_0x10d857,_0x9c96('0x1e'),JSON['stringify'](_0x37c572));if(_0x37c572[_0x9c96('0x21')]){if(_0x37c572[_0x9c96('0x21')]['code']===0x1f4){logger[_0x9c96('0x21')](_0x9c96('0x22'),_0x10d857,_0x37c572[_0x9c96('0x21')]['message']);return _0x196ddc(_0x37c572[_0x9c96('0x21')][_0x9c96('0x23')]);}logger[_0x9c96('0x21')](_0x9c96('0x22'),_0x10d857,_0x37c572[_0x9c96('0x21')]['message']);return _0x55e391(_0x37c572[_0x9c96('0x21')]['message']);}else{logger[_0x9c96('0x1d')]('MailAccount,\x20%s,\x20%s',_0x10d857,_0x9c96('0x1e'));_0x55e391(_0x37c572[_0x9c96('0x24')][_0x9c96('0x23')]);}})[_0x9c96('0x25')](function(_0x32fa84){logger[_0x9c96('0x21')](_0x9c96('0x22'),_0x10d857,_0x32fa84);_0x196ddc(_0x32fa84);});});}function respondWithStatusCode(_0x12326e,_0x1c5cc7){_0x1c5cc7=_0x1c5cc7||0xcc;return function(_0x2c6e55){if(_0x2c6e55){return _0x12326e[_0x9c96('0x26')](_0x1c5cc7);}return _0x12326e[_0x9c96('0x27')](_0x1c5cc7)[_0x9c96('0x28')]();};}function respondWithResult(_0x34b744,_0x4e6920){_0x4e6920=_0x4e6920||0xc8;return function(_0x88849){if(_0x88849){return _0x34b744[_0x9c96('0x27')](_0x4e6920)['json'](_0x88849);}};}function respondWithFilteredResult(_0x4a9ead,_0x436302){return function(_0x2ede21){if(_0x2ede21){var _0x5abb8d=typeof _0x436302[_0x9c96('0x29')]==='undefined'&&typeof _0x436302['limit']===_0x9c96('0x2a');var _0x550a5f=_0x2ede21['count'];var _0x1fe271=_0x5abb8d?0x0:_0x436302[_0x9c96('0x29')];var _0x16c03d=_0x5abb8d?_0x2ede21[_0x9c96('0x2b')]:_0x436302[_0x9c96('0x29')]+_0x436302[_0x9c96('0x2c')];var _0x4e5180;if(_0x16c03d>=_0x550a5f){_0x16c03d=_0x550a5f;_0x4e5180=0xc8;}else{_0x4e5180=0xce;}_0x4a9ead[_0x9c96('0x27')](_0x4e5180);return _0x4a9ead['set'](_0x9c96('0x2d'),_0x1fe271+'-'+_0x16c03d+'/'+_0x550a5f)[_0x9c96('0x2e')](_0x2ede21);}return null;};}function patchUpdates(_0x2f549a){return function(_0x4bc073){try{jsonpatch[_0x9c96('0x2f')](_0x4bc073,_0x2f549a,!![]);}catch(_0x1bc30e){return BPromise['reject'](_0x1bc30e);}return _0x4bc073[_0x9c96('0x30')]();};}function saveUpdates(_0x83abb2,_0xf12e30){return function(_0x5940be){if(_0x5940be){return _0x5940be[_0x9c96('0x31')](_0x83abb2)[_0x9c96('0x32')](function(_0x2fd255){return _0x2fd255;});}return null;};}function removeEntity(_0x1c7b02,_0x2eb056){return function(_0x2c2ef5){if(_0x2c2ef5){return _0x2c2ef5[_0x9c96('0x33')]()[_0x9c96('0x32')](function(){var _0x39fe7e=_0x2c2ef5[_0x9c96('0x34')]({'plain':!![]});var _0x1618b0=_0x9c96('0x35');return db[_0x9c96('0x36')][_0x9c96('0x33')]({'where':{'type':_0x1618b0,'resourceId':_0x39fe7e['id']}})[_0x9c96('0x32')](function(){return _0x2c2ef5;});})[_0x9c96('0x32')](function(){_0x1c7b02[_0x9c96('0x27')](0xcc)[_0x9c96('0x28')]();});}};}function handleEntityNotFound(_0x19f1c1,_0x2a09ac){return function(_0x3cdd1d){if(!_0x3cdd1d){_0x19f1c1[_0x9c96('0x26')](0x194);}return _0x3cdd1d;};}function handleError(_0x44abab,_0x2a05de){_0x2a05de=_0x2a05de||0x1f4;return function(_0x3ec3b9){logger[_0x9c96('0x21')](_0x3ec3b9['stack']);if(_0x3ec3b9[_0x9c96('0x37')]){delete _0x3ec3b9['name'];}_0x44abab[_0x9c96('0x27')](_0x2a05de)['send'](_0x3ec3b9);};}exports['index']=function(_0x4dabab,_0xe6a253){var _0x59d1e3={'include':[{'model':db[_0x9c96('0x38')],'as':_0x9c96('0x39')},{'model':db[_0x9c96('0x3a')],'as':_0x9c96('0x3b')},{'model':db[_0x9c96('0x3c')],'as':_0x9c96('0x3d')}]},_0x383b69={},_0x5e4c06={'count':0x0,'rows':[]};var _0x25fb10=_['map'](db['MailAccount'][_0x9c96('0x3e')],function(_0x1d2ce2){return{'name':_0x1d2ce2[_0x9c96('0x3f')],'type':_0x1d2ce2[_0x9c96('0x40')][_0x9c96('0x41')]};});_0x383b69[_0x9c96('0x42')]=_[_0x9c96('0x43')](_0x25fb10,_0x9c96('0x37'));_0x383b69['query']=_[_0x9c96('0x44')](_0x4dabab['query']);_0x383b69[_0x9c96('0x45')]=_[_0x9c96('0x46')](_0x383b69[_0x9c96('0x42')],_0x383b69[_0x9c96('0x47')]);_0x59d1e3[_0x9c96('0x48')]=_[_0x9c96('0x46')](_0x383b69[_0x9c96('0x42')],qs[_0x9c96('0x49')](_0x4dabab[_0x9c96('0x47')][_0x9c96('0x49')]));_0x59d1e3[_0x9c96('0x48')]=_0x59d1e3['attributes'][_0x9c96('0x4a')]?_0x59d1e3[_0x9c96('0x48')]:_0x383b69[_0x9c96('0x42')];if(!_0x4dabab['query']['hasOwnProperty'](_0x9c96('0x4b'))){_0x59d1e3['limit']=qs[_0x9c96('0x2c')](_0x4dabab['query'][_0x9c96('0x2c')]);_0x59d1e3[_0x9c96('0x29')]=qs[_0x9c96('0x29')](_0x4dabab[_0x9c96('0x47')][_0x9c96('0x29')]);}_0x59d1e3[_0x9c96('0x4c')]=qs[_0x9c96('0x4d')](_0x4dabab['query']['sort']);_0x59d1e3['where']=qs[_0x9c96('0x45')](_['pick'](_0x4dabab['query'],_0x383b69[_0x9c96('0x45')]),_0x25fb10);if(_0x4dabab[_0x9c96('0x47')][_0x9c96('0x4e')]){_0x59d1e3[_0x9c96('0x4f')]=_[_0x9c96('0x50')](_0x59d1e3[_0x9c96('0x4f')],{'$or':_[_0x9c96('0x43')](_0x25fb10,function(_0x2ee835){if(_0x2ee835['type']!==_0x9c96('0x51')){var _0x3e041b={};_0x3e041b[_0x2ee835[_0x9c96('0x37')]]={'$like':'%'+_0x4dabab[_0x9c96('0x47')][_0x9c96('0x4e')]+'%'};return _0x3e041b;}})});}_0x59d1e3=_[_0x9c96('0x50')]({},_0x59d1e3,_0x4dabab[_0x9c96('0x52')]);var _0x181739={'where':_0x59d1e3[_0x9c96('0x4f')]};return db[_0x9c96('0x53')][_0x9c96('0x2b')](_0x181739)[_0x9c96('0x32')](function(_0x5a3b77){_0x5e4c06['count']=_0x5a3b77;if(_0x4dabab['query'][_0x9c96('0x54')]){_0x59d1e3[_0x9c96('0x55')]=[{'all':!![]}];}return db[_0x9c96('0x53')][_0x9c96('0x56')](_0x59d1e3);})[_0x9c96('0x32')](function(_0x5e882c){_0x5e4c06[_0x9c96('0x57')]=_0x5e882c;return _0x5e4c06;})[_0x9c96('0x32')](respondWithFilteredResult(_0xe6a253,_0x59d1e3))[_0x9c96('0x25')](handleError(_0xe6a253,null));};exports[_0x9c96('0x58')]=function(_0x320f54,_0x38dfcf){var _0x18927d={'raw':![],'where':{'id':_0x320f54[_0x9c96('0x59')]['id']},'include':[{'model':db[_0x9c96('0x38')],'as':_0x9c96('0x39')},{'model':db['MailServerOut'],'as':_0x9c96('0x3b')},{'model':db[_0x9c96('0x3c')],'as':'mandatoryDispositionPause'}]},_0x22a44b={};_0x22a44b[_0x9c96('0x42')]=_[_0x9c96('0x44')](db['MailAccount'][_0x9c96('0x3e')]);_0x22a44b[_0x9c96('0x47')]=_[_0x9c96('0x44')](_0x320f54['query']);_0x22a44b['filters']=_['intersection'](_0x22a44b[_0x9c96('0x42')],_0x22a44b[_0x9c96('0x47')]);_0x18927d[_0x9c96('0x48')]=_['intersection'](_0x22a44b['model'],qs[_0x9c96('0x49')](_0x320f54[_0x9c96('0x47')]['fields']));_0x18927d['attributes']=_0x18927d['attributes'][_0x9c96('0x4a')]?_0x18927d[_0x9c96('0x48')]:_0x22a44b['model'];if(_0x320f54['query'][_0x9c96('0x54')]){_0x18927d['include']=[{'all':!![]}];}_0x18927d=_[_0x9c96('0x50')]({},_0x18927d,_0x320f54[_0x9c96('0x52')]);return db[_0x9c96('0x53')][_0x9c96('0x5a')](_0x18927d)[_0x9c96('0x32')](handleEntityNotFound(_0x38dfcf,null))['then'](respondWithResult(_0x38dfcf,null))[_0x9c96('0x25')](handleError(_0x38dfcf,null));};exports[_0x9c96('0x31')]=function(_0x3937f3,_0x19f865){if(_0x3937f3[_0x9c96('0x5b')]['id']){delete _0x3937f3[_0x9c96('0x5b')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3937f3[_0x9c96('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x9c96('0x39')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x9c96('0x3c')],'as':_0x9c96('0x3d')}]})[_0x9c96('0x32')](handleEntityNotFound(_0x19f865,null))[_0x9c96('0x32')](saveUpdates(_0x3937f3[_0x9c96('0x5b')],null))[_0x9c96('0x32')](function(_0x11bb60){if(_0x11bb60&&_0x3937f3[_0x9c96('0x5b')]['Imap']){return db[_0x9c96('0x38')][_0x9c96('0x31')](_0x3937f3['body'][_0x9c96('0x39')],{'where':{'MailAccountId':_0x11bb60['id']}})['then'](function(){return _0x11bb60;});}return _0x11bb60;})['then'](function(_0x4855e2){if(_0x4855e2&&_0x3937f3[_0x9c96('0x5b')][_0x9c96('0x3b')]){return db[_0x9c96('0x3a')][_0x9c96('0x31')](_0x3937f3[_0x9c96('0x5b')][_0x9c96('0x3b')],{'where':{'MailAccountId':_0x4855e2['id']}})[_0x9c96('0x32')](function(){return _0x4855e2;});}return _0x4855e2;})['then'](respondWithResult(_0x19f865,null))[_0x9c96('0x25')](handleError(_0x19f865,null));};exports[_0x9c96('0x5c')]=function(_0x11b838,_0x4df510){return db['MailAccount'][_0x9c96('0x5c')]()[_0x9c96('0x32')](respondWithResult(_0x4df510,null))['catch'](handleError(_0x4df510,null));};exports[_0x9c96('0x5d')]=function(_0x3d3c3c,_0x3b861e,_0x3134f6){if(_0x3d3c3c[_0x9c96('0x5b')]['id']){delete _0x3d3c3c['body']['id'];}return db[_0x9c96('0x53')]['find']({'where':{'id':_0x3d3c3c[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x3b861e,null))['then'](function(_0x4c1aba){if(_0x4c1aba){_0x3d3c3c[_0x9c96('0x5b')]['MailAccountId']=_0x4c1aba['id'];return db[_0x9c96('0x5e')][_0x9c96('0x5f')](_0x3d3c3c[_0x9c96('0x5b')]);}})[_0x9c96('0x32')](respondWithResult(_0x3b861e,null))[_0x9c96('0x25')](handleError(_0x3b861e,null));};exports[_0x9c96('0x60')]=function(_0x20721d,_0x6de00a,_0xbbe131){var _0x9e5e66={'raw':![],'where':{}};var _0x462c35={};var _0x3d68e0={'count':0x0,'rows':[]};return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x20721d[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x6de00a,null))[_0x9c96('0x32')](function(_0x30dd35){if(_0x30dd35){_0x462c35[_0x9c96('0x42')]=_[_0x9c96('0x44')](db['Disposition']['rawAttributes']);_0x462c35[_0x9c96('0x47')]=_[_0x9c96('0x44')](_0x20721d[_0x9c96('0x47')]);_0x462c35['filters']=_[_0x9c96('0x46')](_0x462c35[_0x9c96('0x42')],_0x462c35[_0x9c96('0x47')]);_0x9e5e66[_0x9c96('0x48')]=_[_0x9c96('0x46')](_0x462c35[_0x9c96('0x42')],qs['fields'](_0x20721d[_0x9c96('0x47')][_0x9c96('0x49')]));_0x9e5e66[_0x9c96('0x48')]=_0x9e5e66[_0x9c96('0x48')][_0x9c96('0x4a')]?_0x9e5e66[_0x9c96('0x48')]:_0x462c35[_0x9c96('0x42')];if(!_0x20721d[_0x9c96('0x47')][_0x9c96('0x62')](_0x9c96('0x4b'))){_0x9e5e66[_0x9c96('0x2c')]=qs[_0x9c96('0x2c')](_0x20721d['query'][_0x9c96('0x2c')]);_0x9e5e66[_0x9c96('0x29')]=qs[_0x9c96('0x29')](_0x20721d[_0x9c96('0x47')][_0x9c96('0x29')]);}_0x9e5e66[_0x9c96('0x4c')]=qs[_0x9c96('0x4d')](_0x20721d[_0x9c96('0x47')][_0x9c96('0x4d')]);_0x9e5e66[_0x9c96('0x4f')]=qs[_0x9c96('0x45')](_[_0x9c96('0x63')](_0x20721d['query'],_0x462c35['filters']));_0x9e5e66[_0x9c96('0x4f')][_0x9c96('0x64')]=_0x30dd35['id'];if(_0x20721d['query'][_0x9c96('0x4e')]){_0x9e5e66[_0x9c96('0x4f')]=_[_0x9c96('0x50')](_0x9e5e66[_0x9c96('0x4f')],{'$or':_[_0x9c96('0x43')](_0x9e5e66[_0x9c96('0x48')],function(_0x1c609d){var _0x3b3e55={};_0x3b3e55[_0x1c609d]={'$like':'%'+_0x20721d[_0x9c96('0x47')]['filter']+'%'};return _0x3b3e55;})});}_0x9e5e66=_['merge']({},_0x9e5e66,_0x20721d[_0x9c96('0x52')]);return db[_0x9c96('0x5e')][_0x9c96('0x2b')]({'where':_0x9e5e66[_0x9c96('0x4f')]})[_0x9c96('0x32')](function(_0x1b848e){_0x3d68e0['count']=_0x1b848e;if(_0x20721d[_0x9c96('0x47')][_0x9c96('0x54')]){_0x9e5e66['include']=[{'all':!![]}];}return db[_0x9c96('0x5e')]['findAll'](_0x9e5e66);})[_0x9c96('0x32')](function(_0x145229){_0x3d68e0['rows']=_0x145229;return _0x3d68e0;});}})[_0x9c96('0x32')](respondWithFilteredResult(_0x6de00a,_0x9e5e66))[_0x9c96('0x25')](handleError(_0x6de00a,null));};exports[_0x9c96('0x65')]=function(_0x114fe5,_0x4f9181,_0x417160){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x114fe5[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x4f9181,null))['then'](function(_0x1b9c3c){if(_0x1b9c3c){return _0x1b9c3c['removeDispositions'](_0x114fe5[_0x9c96('0x47')][_0x9c96('0x66')]);}})[_0x9c96('0x32')](respondWithStatusCode(_0x4f9181,null))['catch'](handleError(_0x4f9181,null));};exports[_0x9c96('0x67')]=function(_0x4488f6,_0xd1a6b1,_0xbe7a48){if(_0x4488f6[_0x9c96('0x5b')]['id']){delete _0x4488f6[_0x9c96('0x5b')]['id'];}return db[_0x9c96('0x53')]['find']({'where':{'id':_0x4488f6[_0x9c96('0x59')]['id']}})['then'](handleEntityNotFound(_0xd1a6b1,null))[_0x9c96('0x32')](function(_0xea0a8c){if(_0xea0a8c){_0x4488f6[_0x9c96('0x5b')][_0x9c96('0x64')]=_0xea0a8c['id'];return db['CannedAnswer'][_0x9c96('0x5f')](_0x4488f6['body']);}})['then'](respondWithResult(_0xd1a6b1,null))['catch'](handleError(_0xd1a6b1,null));};exports['getAnswers']=function(_0x3074d4,_0x545669,_0x193744){var _0x439c91={'raw':![],'where':{}};var _0x597795={};var _0xcbca5f={'count':0x0,'rows':[]};return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x3074d4['params']['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x545669,null))['then'](function(_0x4963b6){if(_0x4963b6){_0x597795[_0x9c96('0x42')]=_[_0x9c96('0x44')](db['CannedAnswer'][_0x9c96('0x3e')]);_0x597795['query']=_[_0x9c96('0x44')](_0x3074d4[_0x9c96('0x47')]);_0x597795[_0x9c96('0x45')]=_[_0x9c96('0x46')](_0x597795['model'],_0x597795[_0x9c96('0x47')]);_0x439c91['attributes']=_[_0x9c96('0x46')](_0x597795['model'],qs[_0x9c96('0x49')](_0x3074d4[_0x9c96('0x47')][_0x9c96('0x49')]));_0x439c91['attributes']=_0x439c91['attributes'][_0x9c96('0x4a')]?_0x439c91['attributes']:_0x597795[_0x9c96('0x42')];if(!_0x3074d4['query'][_0x9c96('0x62')]('nolimit')){_0x439c91[_0x9c96('0x2c')]=qs[_0x9c96('0x2c')](_0x3074d4[_0x9c96('0x47')][_0x9c96('0x2c')]);_0x439c91['offset']=qs['offset'](_0x3074d4[_0x9c96('0x47')][_0x9c96('0x29')]);}_0x439c91[_0x9c96('0x4c')]=qs['sort'](_0x3074d4[_0x9c96('0x47')]['sort']);_0x439c91[_0x9c96('0x4f')]=qs[_0x9c96('0x45')](_[_0x9c96('0x63')](_0x3074d4['query'],_0x597795[_0x9c96('0x45')]));_0x439c91[_0x9c96('0x4f')][_0x9c96('0x64')]=_0x4963b6['id'];if(_0x3074d4[_0x9c96('0x47')][_0x9c96('0x4e')]){_0x439c91[_0x9c96('0x4f')]=_['merge'](_0x439c91[_0x9c96('0x4f')],{'$or':_[_0x9c96('0x43')](_0x439c91[_0x9c96('0x48')],function(_0x463d1d){var _0x56830a={};_0x56830a[_0x463d1d]={'$like':'%'+_0x3074d4[_0x9c96('0x47')][_0x9c96('0x4e')]+'%'};return _0x56830a;})});}_0x439c91=_[_0x9c96('0x50')]({},_0x439c91,_0x3074d4[_0x9c96('0x52')]);return db[_0x9c96('0x68')]['count']({'where':_0x439c91['where']})[_0x9c96('0x32')](function(_0x32d47a){_0xcbca5f[_0x9c96('0x2b')]=_0x32d47a;if(_0x3074d4[_0x9c96('0x47')][_0x9c96('0x54')]){_0x439c91[_0x9c96('0x55')]=[{'all':!![]}];}return db[_0x9c96('0x68')][_0x9c96('0x56')](_0x439c91);})[_0x9c96('0x32')](function(_0xe7a0b8){_0xcbca5f[_0x9c96('0x57')]=_0xe7a0b8;return _0xcbca5f;});}})[_0x9c96('0x32')](respondWithFilteredResult(_0x545669,_0x439c91))[_0x9c96('0x25')](handleError(_0x545669,null));};exports['removeAnswers']=function(_0x385dca,_0x395a10,_0x5899fe){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x385dca['params']['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x395a10,null))[_0x9c96('0x32')](function(_0x5195d4){if(_0x5195d4){return _0x5195d4[_0x9c96('0x69')](_0x385dca[_0x9c96('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x395a10,null))[_0x9c96('0x25')](handleError(_0x395a10,null));};exports['create']=function(_0x4fa3ae,_0x262efc){var _0x46baf0={'name':_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x37')],'key':_0x4fa3ae['body'][_0x9c96('0x41')],'email':_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6a')],'ListId':_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6b')],'active':!_[_0x9c96('0x6c')](_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6d')])?_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6d')]:!![],'description':_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x9c96('0x6c')](_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6f')])){if(_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x70')]){_0x46baf0[_0x9c96('0x39')]['user']=_0x46baf0['Smtp'][_0x9c96('0x71')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x72')];_0x46baf0['Imap']['password']=_0x46baf0['Smtp'][_0x9c96('0x73')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x74')];}else{_0x46baf0[_0x9c96('0x39')][_0x9c96('0x75')]=_0x46baf0[_0x9c96('0x3b')][_0x9c96('0x75')]=![];}_0x46baf0['Imap'][_0x9c96('0x76')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x39')][_0x9c96('0x76')];_0x46baf0[_0x9c96('0x39')][_0x9c96('0x77')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x39')][_0x9c96('0x77')];_0x46baf0[_0x9c96('0x3b')][_0x9c96('0x76')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x3b')][_0x9c96('0x76')];_0x46baf0[_0x9c96('0x3b')][_0x9c96('0x77')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x3b')][_0x9c96('0x77')];}else{_0x46baf0[_0x9c96('0x39')][_0x9c96('0x78')]=_0x46baf0[_0x9c96('0x3b')]['service']=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x6f')];_0x46baf0['Imap'][_0x9c96('0x71')]=_0x46baf0[_0x9c96('0x3b')]['user']=_0x4fa3ae[_0x9c96('0x5b')]['cuser'];_0x46baf0['Imap'][_0x9c96('0x79')]=_0x46baf0[_0x9c96('0x3b')][_0x9c96('0x73')]=_0x4fa3ae[_0x9c96('0x5b')][_0x9c96('0x74')];}return db['MailAccount'][_0x9c96('0x5f')](_0x46baf0,{'include':[{'model':db[_0x9c96('0x3a')],'as':_0x9c96('0x3b')},{'model':db[_0x9c96('0x38')],'as':_0x9c96('0x39')}]})[_0x9c96('0x32')](function(_0x1f5e08){var _0x250fdf=_0x4fa3ae[_0x9c96('0x71')][_0x9c96('0x34')]({'plain':!![]});if(!_0x250fdf)throw new Error(_0x9c96('0x7a'));if(_0x250fdf[_0x9c96('0x7b')]==='user'){var _0x4b5da9=_0x1f5e08[_0x9c96('0x34')]({'plain':!![]});return db[_0x9c96('0x7c')][_0x9c96('0x5a')]({'where':{'name':'MailAccounts','userProfileId':_0x250fdf['userProfileId']},'raw':!![]})[_0x9c96('0x32')](function(_0x1ec74b){if(_0x1ec74b&&_0x1ec74b['autoAssociation']===0x0){return db[_0x9c96('0x36')][_0x9c96('0x5f')]({'name':_0x4b5da9[_0x9c96('0x37')],'resourceId':_0x4b5da9['id'],'type':_0x1ec74b[_0x9c96('0x37')],'sectionId':_0x1ec74b['id']},{})[_0x9c96('0x32')](function(){return _0x1f5e08;});}else{return _0x1f5e08;}})[_0x9c96('0x25')](function(_0xe6d031){logger[_0x9c96('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe6d031);throw _0xe6d031;});}return _0x1f5e08;})[_0x9c96('0x32')](respondWithResult(_0x262efc,0xc9))[_0x9c96('0x25')](handleError(_0x262efc,null));};exports[_0x9c96('0x7d')]=function(_0x37b64a,_0x4a55a9,_0x4038e0){return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x37b64a[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x4a55a9,null))[_0x9c96('0x32')](function(_0x1457dc){if(_0x1457dc){return _0x1457dc[_0x9c96('0x7d')]();}return null;})[_0x9c96('0x32')](respondWithResult(_0x4a55a9,null))['catch'](handleError(_0x4a55a9,null));};exports[_0x9c96('0x7e')]=function(_0x3574a7,_0x5f0ee6,_0x4a79f0){if(_0x3574a7[_0x9c96('0x5b')]['id']){delete _0x3574a7['body']['id'];}return db[_0x9c96('0x53')]['find']({'where':{'id':_0x3574a7[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x5f0ee6,null))['then'](function(_0x52c89a){if(_0x52c89a){_0x3574a7[_0x9c96('0x5b')][_0x9c96('0x64')]=_0x52c89a['id'];return db['MailServerIn'][_0x9c96('0x5f')](_0x3574a7[_0x9c96('0x5b')]);}})[_0x9c96('0x32')](respondWithResult(_0x5f0ee6,null))[_0x9c96('0x25')](handleError(_0x5f0ee6,null));};exports[_0x9c96('0x7f')]=function(_0x6c05dd,_0x4f3eab,_0x27ca7a){return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x6c05dd[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x4f3eab,null))[_0x9c96('0x32')](function(_0x349e92){if(_0x349e92){return _0x349e92[_0x9c96('0x80')](null);}return null;})[_0x9c96('0x32')](respondWithStatusCode(_0x4f3eab,null))['catch'](handleError(_0x4f3eab,null));};exports[_0x9c96('0x81')]=function(_0x200572,_0x63a5da,_0x476a4f){return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x200572[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x63a5da,null))['then'](function(_0x224293){if(_0x224293){return _0x224293[_0x9c96('0x81')]();}return null;})['then'](respondWithResult(_0x63a5da,null))[_0x9c96('0x25')](handleError(_0x63a5da,null));};exports[_0x9c96('0x82')]=function(_0x69f3e2,_0x2bb092,_0x432721){if(_0x69f3e2[_0x9c96('0x5b')]['id']){delete _0x69f3e2[_0x9c96('0x5b')]['id'];}return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x69f3e2[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x2bb092,null))[_0x9c96('0x32')](function(_0x2f91fc){if(_0x2f91fc){_0x69f3e2[_0x9c96('0x5b')][_0x9c96('0x64')]=_0x2f91fc['id'];return db['MailServerOut'][_0x9c96('0x5f')](_0x69f3e2[_0x9c96('0x5b')]);}})[_0x9c96('0x32')](respondWithResult(_0x2bb092,null))[_0x9c96('0x25')](handleError(_0x2bb092,null));};exports['removeSmtp']=function(_0x99b539,_0x555bf7,_0x3f2faa){return db[_0x9c96('0x53')]['findOne']({'where':{'id':_0x99b539['params']['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x555bf7,null))['then'](function(_0x231834){if(_0x231834){return _0x231834['setSmtp'](null);}return null;})[_0x9c96('0x32')](respondWithStatusCode(_0x555bf7,null))[_0x9c96('0x25')](handleError(_0x555bf7,null));};exports[_0x9c96('0x83')]=function(_0x2426fb,_0x2d2d13,_0x452aa1){return db[_0x9c96('0x84')][_0x9c96('0x5a')]({'where':{'id':_0x2426fb[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x2d2d13,null))[_0x9c96('0x32')](function(_0x589013){if(_0x589013){return _0x589013[_0x9c96('0x83')](_0x2426fb[_0x9c96('0x5b')][_0x9c96('0x66')],_['omit'](_0x2426fb['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2d2d13,null))['catch'](handleError(_0x2d2d13,null));};exports[_0x9c96('0x85')]=function(_0x25e65b,_0xa6d9e7,_0x24393c){var _0x4845f2={'raw':![],'where':{}};var _0x244daa={};var _0x420ff7={'count':0x0,'rows':[]};return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x25e65b[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0xa6d9e7,null))[_0x9c96('0x32')](function(_0x2882b2){if(_0x2882b2){_0x244daa['model']=_['keys'](db[_0x9c96('0x84')][_0x9c96('0x3e')]);_0x244daa[_0x9c96('0x47')]=_[_0x9c96('0x44')](_0x25e65b[_0x9c96('0x47')]);_0x244daa[_0x9c96('0x45')]=_[_0x9c96('0x46')](_0x244daa[_0x9c96('0x42')],_0x244daa[_0x9c96('0x47')]);_0x4845f2[_0x9c96('0x48')]=_['intersection'](_0x244daa[_0x9c96('0x42')],qs[_0x9c96('0x49')](_0x25e65b[_0x9c96('0x47')]['fields']));_0x4845f2[_0x9c96('0x48')]=_0x4845f2[_0x9c96('0x48')][_0x9c96('0x4a')]?_0x4845f2[_0x9c96('0x48')]:_0x244daa[_0x9c96('0x42')];if(!_0x25e65b[_0x9c96('0x47')][_0x9c96('0x62')]('nolimit')){_0x4845f2[_0x9c96('0x2c')]=qs[_0x9c96('0x2c')](_0x25e65b[_0x9c96('0x47')][_0x9c96('0x2c')]);_0x4845f2[_0x9c96('0x29')]=qs[_0x9c96('0x29')](_0x25e65b[_0x9c96('0x47')][_0x9c96('0x29')]);}_0x4845f2[_0x9c96('0x4c')]=qs[_0x9c96('0x4d')](_0x25e65b[_0x9c96('0x47')][_0x9c96('0x4d')]);_0x4845f2[_0x9c96('0x4f')]=qs[_0x9c96('0x45')](_[_0x9c96('0x63')](_0x25e65b['query'],_0x244daa[_0x9c96('0x45')]));_0x4845f2[_0x9c96('0x4f')][_0x9c96('0x64')]=_0x2882b2['id'];if(_0x25e65b['query']['filter']){_0x4845f2['where']=_['merge'](_0x4845f2[_0x9c96('0x4f')],{'$or':_['map'](_0x4845f2['attributes'],function(_0x4c2b9c){var _0x32ebff={};_0x32ebff[_0x4c2b9c]={'$like':'%'+_0x25e65b['query'][_0x9c96('0x4e')]+'%'};return _0x32ebff;})});}_0x4845f2=_['merge']({},_0x4845f2,_0x25e65b['options']);return db[_0x9c96('0x84')][_0x9c96('0x2b')]({'where':_0x4845f2[_0x9c96('0x4f')]})[_0x9c96('0x32')](function(_0xe5cdc2){_0x420ff7[_0x9c96('0x2b')]=_0xe5cdc2;if(_0x25e65b[_0x9c96('0x47')][_0x9c96('0x54')]){_0x4845f2[_0x9c96('0x55')]=[{'model':db[_0x9c96('0x86')],'as':_0x9c96('0x87'),'required':![]},{'model':db['User'],'as':_0x9c96('0x88'),'attributes':[_0x9c96('0x37'),_0x9c96('0x89'),_0x9c96('0x8a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9c96('0x37'),_0x9c96('0x8b')],'where':_0x25e65b[_0x9c96('0x47')][_0x9c96('0x8c')]?{'id':_0x25e65b[_0x9c96('0x47')][_0x9c96('0x8c')]}:undefined,'required':_0x25e65b['query'][_0x9c96('0x8c')]?!![]:![]}];}return db[_0x9c96('0x84')][_0x9c96('0x56')](_0x4845f2);})['then'](function(_0x3666e1){_0x420ff7[_0x9c96('0x57')]=_0x3666e1;return _0x420ff7;});}})[_0x9c96('0x32')](respondWithFilteredResult(_0xa6d9e7,_0x4845f2))[_0x9c96('0x25')](handleError(_0xa6d9e7,null));};exports[_0x9c96('0x8d')]=function addApplications(_0x236afc,_0x191a17){var _0x4bcc06=_0x236afc[_0x9c96('0x59')]['id'];var _0x47d02c=_0x236afc['body'];var _0x57693a=0xc8;var _0x4290a5=null;return db[_0x9c96('0x8e')][_0x9c96('0x8f')]({'isolationLevel':db['sequelize'][_0x9c96('0x90')][_0x9c96('0x91')][_0x9c96('0x92')]},function(_0x5463e9){return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0x4bcc06},'transaction':_0x5463e9})['then'](function(_0x3c5fe5){if(_0x3c5fe5){return db[_0x9c96('0x93')]['destroy']({'where':{'MailAccountId':_0x4bcc06},'transaction':_0x5463e9})[_0x9c96('0x32')](function(){var _0x1ffd3f=_['map'](_0x47d02c,function(_0x1ffcdc){_0x1ffcdc[_0x9c96('0x64')]=_0x4bcc06;return _0x1ffcdc;});return db[_0x9c96('0x93')]['bulkCreate'](_0x1ffd3f,{'transaction':_0x5463e9});});}else{_0x57693a=0x194;_0x4290a5=[];}});})['then'](function(){if(_0x57693a!==0x194){return db[_0x9c96('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x4bcc06},'order':'priority'})['then'](function(_0x53dbf4){_0x4290a5=_0x53dbf4;});}})['catch'](function(_0x23f1bd){_0x57693a=0x1f4;logger[_0x9c96('0x21')](_0x23f1bd[_0x9c96('0x94')]);if(_0x23f1bd[_0x9c96('0x37')]){delete _0x23f1bd[_0x9c96('0x37')];}_0x4290a5=_0x23f1bd;})[_0x9c96('0x95')](function(){if(_0x4290a5===null){_0x191a17['sendStatus'](_0x57693a);}else{if(_0x57693a===0x1f4){_0x191a17[_0x9c96('0x27')](_0x57693a)[_0x9c96('0x96')](_0x4290a5);}else{_0x191a17[_0x9c96('0x27')](_0x57693a)[_0x9c96('0x2e')](_0x4290a5);}}});};exports[_0x9c96('0x97')]=function(_0x11ec32,_0x4cfa6d,_0x47d58e){var _0x58367a={};var _0x2e989d={};var _0x343747;var _0x192356;return db['MailAccount']['findOne']({'where':{'id':_0x11ec32[_0x9c96('0x59')]['id']}})['then'](handleEntityNotFound(_0x4cfa6d,null))[_0x9c96('0x32')](function(_0x1f78d3){if(_0x1f78d3){_0x343747=_0x1f78d3;_0x2e989d['model']=_[_0x9c96('0x44')](db[_0x9c96('0x93')]['rawAttributes']);_0x2e989d[_0x9c96('0x47')]=_[_0x9c96('0x44')](_0x11ec32[_0x9c96('0x47')]);_0x2e989d['filters']=_[_0x9c96('0x46')](_0x2e989d[_0x9c96('0x42')],_0x2e989d['query']);_0x58367a[_0x9c96('0x48')]=_['intersection'](_0x2e989d[_0x9c96('0x42')],qs['fields'](_0x11ec32[_0x9c96('0x47')]['fields']));_0x58367a[_0x9c96('0x48')]=_0x58367a[_0x9c96('0x48')][_0x9c96('0x4a')]?_0x58367a[_0x9c96('0x48')]:_0x2e989d[_0x9c96('0x42')];_0x58367a[_0x9c96('0x4c')]=qs[_0x9c96('0x4d')](_0x11ec32[_0x9c96('0x47')]['sort']);_0x58367a[_0x9c96('0x4f')]=qs['filters'](_[_0x9c96('0x63')](_0x11ec32[_0x9c96('0x47')],_0x2e989d['filters']));if(_0x11ec32[_0x9c96('0x47')][_0x9c96('0x4e')]){_0x58367a[_0x9c96('0x4f')]=_[_0x9c96('0x50')](_0x58367a[_0x9c96('0x4f')],{'$or':_['map'](_0x58367a['attributes'],function(_0x2370ae){var _0x32ad5c={};_0x32ad5c[_0x2370ae]={'$like':'%'+_0x11ec32[_0x9c96('0x47')][_0x9c96('0x4e')]+'%'};return _0x32ad5c;})});}_0x58367a=_['merge']({},_0x58367a,_0x11ec32[_0x9c96('0x52')]);return _0x343747[_0x9c96('0x97')](_0x58367a);}})[_0x9c96('0x32')](function(_0x12c9e2){if(_0x12c9e2){_0x192356=_0x12c9e2[_0x9c96('0x4a')];if(!_0x11ec32[_0x9c96('0x47')][_0x9c96('0x62')](_0x9c96('0x4b'))){_0x58367a[_0x9c96('0x2c')]=qs[_0x9c96('0x2c')](_0x11ec32['query'][_0x9c96('0x2c')]);_0x58367a['offset']=qs[_0x9c96('0x29')](_0x11ec32['query'][_0x9c96('0x29')]);}return _0x343747[_0x9c96('0x97')](_0x58367a);}})[_0x9c96('0x32')](function(_0x3aa987){if(_0x3aa987){return _0x3aa987?{'count':_0x192356,'rows':_0x3aa987}:null;}})[_0x9c96('0x32')](respondWithResult(_0x4cfa6d,null))[_0x9c96('0x25')](handleError(_0x4cfa6d,null));};exports[_0x9c96('0x98')]=function(_0xa44474,_0x260ec9,_0x36ca4f){var _0x3994dd={'raw':!![],'where':{}};var _0x134681={};var _0x1f5300={'count':0x0,'rows':[]};return db[_0x9c96('0x53')][_0x9c96('0x61')]({'where':{'id':_0xa44474[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x260ec9,null))['then'](function(_0x2daf52){if(_0x2daf52){_0x134681[_0x9c96('0x42')]=_[_0x9c96('0x44')](db[_0x9c96('0x99')]['rawAttributes']);_0x134681[_0x9c96('0x47')]=_['keys'](_0xa44474[_0x9c96('0x47')]);_0x134681[_0x9c96('0x45')]=_['intersection'](_0x134681[_0x9c96('0x42')],_0x134681['query']);_0x3994dd['attributes']=_[_0x9c96('0x46')](_0x134681[_0x9c96('0x42')],qs[_0x9c96('0x49')](_0xa44474[_0x9c96('0x47')]['fields']));_0x3994dd['attributes']=_0x3994dd[_0x9c96('0x48')][_0x9c96('0x4a')]?_0x3994dd[_0x9c96('0x48')]:_0x134681[_0x9c96('0x42')];if(!_0xa44474['query'][_0x9c96('0x62')]('nolimit')){_0x3994dd['limit']=qs[_0x9c96('0x2c')](_0xa44474[_0x9c96('0x47')][_0x9c96('0x2c')]);_0x3994dd[_0x9c96('0x29')]=qs[_0x9c96('0x29')](_0xa44474[_0x9c96('0x47')]['offset']);}_0x3994dd[_0x9c96('0x4c')]=qs[_0x9c96('0x4d')](_0xa44474[_0x9c96('0x47')][_0x9c96('0x4d')]);_0x3994dd[_0x9c96('0x4f')]=qs[_0x9c96('0x45')](_[_0x9c96('0x63')](_0xa44474[_0x9c96('0x47')],_0x134681[_0x9c96('0x45')]));_0x3994dd[_0x9c96('0x4f')][_0x9c96('0x64')]=_0x2daf52['id'];if(_0xa44474[_0x9c96('0x47')][_0x9c96('0x4e')]){_0x3994dd[_0x9c96('0x4f')]=_['merge'](_0x3994dd[_0x9c96('0x4f')],{'$or':_['map'](_0x3994dd[_0x9c96('0x48')],function(_0x1b3379){var _0x24e8fa={};_0x24e8fa[_0x1b3379]={'$like':'%'+_0xa44474[_0x9c96('0x47')][_0x9c96('0x4e')]+'%'};return _0x24e8fa;})});}if(_0xa44474[_0x9c96('0x47')][_0x9c96('0x9a')]){var _0x48b8c2=_0xa44474[_0x9c96('0x47')]['$gte'][_0x9c96('0x9b')](',');var _0x4c85c5={};_0x4c85c5[_0x48b8c2[0x0]]={'$gte':moment(_0x48b8c2[0x1])[_0x9c96('0x9c')](_0x9c96('0x9d'))};_0x3994dd[_0x9c96('0x4f')]=_[_0x9c96('0x50')](_0x3994dd['where'],_0x4c85c5);}_0x3994dd=_[_0x9c96('0x50')]({},_0x3994dd,_0xa44474[_0x9c96('0x52')]);return db[_0x9c96('0x99')][_0x9c96('0x2b')]({'where':_0x3994dd[_0x9c96('0x4f')]})[_0x9c96('0x32')](function(_0xd2ef28){_0x1f5300[_0x9c96('0x2b')]=_0xd2ef28;if(_0xa44474[_0x9c96('0x47')][_0x9c96('0x54')]){_0x3994dd[_0x9c96('0x55')]=[{'all':!![]}];}return db[_0x9c96('0x99')][_0x9c96('0x56')](_0x3994dd);})[_0x9c96('0x32')](function(_0xe7e2fd){if(_0xa44474[_0x9c96('0x47')][_0x9c96('0x9e')]==='true'){for(var _0xb7c2e9=0x0;_0xb7c2e9<_0xe7e2fd[_0x9c96('0x4a')];_0xb7c2e9++){_0xe7e2fd[_0xb7c2e9]['body']=juice(_0xe7e2fd[_0xb7c2e9]['body']);}}_0x1f5300[_0x9c96('0x57')]=_0xe7e2fd;return _0x1f5300;});}})['then'](respondWithFilteredResult(_0x260ec9,_0x3994dd))['catch'](handleError(_0x260ec9,null));};exports[_0x9c96('0x96')]=function(_0x5b8366,_0xa398da,_0x52a57e){var _0x36ebef,_0x4131a5={},_0x471fe3;if(_0x5b8366[_0x9c96('0x5b')]['to']){_0x471fe3=_0x5b8366[_0x9c96('0x5b')]['to'][_0x9c96('0x9b')](',')[0x0];}return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x5b8366[_0x9c96('0x59')]['id']},'include':[{'model':db[_0x9c96('0x9f')],'as':'List','include':[{'model':db[_0x9c96('0x86')],'as':_0x9c96('0xa0'),'where':{'email':_0x471fe3},'limit':0x1,'order':[[_0x9c96('0xa1'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x9c96('0x3b'),'raw':!![]}]})[_0x9c96('0x32')](handleEntityNotFound(_0xa398da,null))[_0x9c96('0x32')](function(_0x4ac833){if(_0x4ac833){_0x36ebef=_0x4ac833;if(_0x4ac833['Smtp']){if(_[_0x9c96('0x6c')](_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa2')])){_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa2')]=util[_0x9c96('0x9c')](_0x9c96('0xa3'),_0x4ac833['name'],_0x4ac833['email']||_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x71')]);}if(_0x5b8366['body'][_0x9c96('0xa4')]&&_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa4')][_0x9c96('0x4a')]){for(var _0x307d95=0x0;_0x307d95<_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa4')]['length'];_0x307d95+=0x1){_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa4')][_0x307d95]={'filename':_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa4')][_0x307d95][_0x9c96('0x37')],'path':path[_0x9c96('0xa5')](config[_0x9c96('0xa6')],'server/files/attachments',_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xa4')][_0x307d95][_0x9c96('0xa7')])};}}var _0x39923c={'tls':{'rejectUnauthorized':![]}};if(_[_0x9c96('0x6c')](_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x78')])){if(_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x75')]){_0x39923c['auth']={'user':_0x4ac833['Smtp']['user'],'pass':_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x73')]};}_0x39923c[_0x9c96('0x76')]=_0x4ac833['Smtp']['host'];_0x39923c[_0x9c96('0x77')]=_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x77')];_0x39923c[_0x9c96('0xa8')]=_0x4ac833[_0x9c96('0x3b')]['secure'];}else{_0x39923c[_0x9c96('0x78')]=_0x4ac833[_0x9c96('0x3b')]['service'];_0x39923c['auth']={'user':_0x4ac833[_0x9c96('0x3b')][_0x9c96('0x71')],'pass':_0x4ac833[_0x9c96('0x3b')]['pass']};}return respondWithRpcPromise('SendMail',_0x9c96('0xa9'),{'account':_0x39923c,'message':_0x5b8366[_0x9c96('0x5b')]});}else{throw new Error(_0x9c96('0xaa'));}}})[_0x9c96('0x32')](function(_0x435769){if(_0x435769){_0x4131a5=_0x435769;if(_0x36ebef[_0x9c96('0xab')]){if(_0x36ebef[_0x9c96('0xab')]['Contacts'][_0x9c96('0x4a')]){return _0x36ebef['List']['Contacts'][0x0];}else{return db['CmContact'][_0x9c96('0x5f')](_[_0x9c96('0x18')](_0x5b8366[_0x9c96('0x5b')],{'firstName':_0x5b8366[_0x9c96('0x5b')]['to'],'email':_0x5b8366[_0x9c96('0x5b')]['to'],'phone':_0x5b8366[_0x9c96('0x5b')]['to'],'ListId':_0x36ebef[_0x9c96('0x6b')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x9c96('0x32')](function(_0x5f00ad){if(_0x5f00ad){var _0x582adb={'UserId':_0x5b8366[_0x9c96('0x71')]['id'],'ContactId':_0x5f00ad['id'],'MailAccountId':_0x36ebef['id'],'inReplyTo':_0x4131a5[_0x9c96('0xac')],'to':_0x5b8366['body'][_0x9c96('0xa2')],'cc':_0x5b8366[_0x9c96('0x5b')]['cc'],'subject':_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xad')],'attach':_0x5b8366[_0x9c96('0x5b')]['attach'],'firstMsgDirection':_0x9c96('0xae'),'lastMsgAt':moment()['format'](_0x9c96('0x9d')),'lastMsgDirection':'out','Messages':[_[_0x9c96('0x50')](_0x5b8366[_0x9c96('0x5b')],{'messageId':_0x4131a5['messageId'],'sentAt':moment()[_0x9c96('0x9c')](_0x9c96('0x9d')),'read':!![],'MailAccountId':_0x36ebef['id'],'UserId':_0x5b8366[_0x9c96('0x71')]['id'],'ContactId':_0x5f00ad['id']})]};if(_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xaf')]){_0x582adb=_['merge'](_0x582adb,_0x5b8366[_0x9c96('0x5b')][_0x9c96('0xaf')]);}return db['MailInteraction'][_0x9c96('0x5f')](_0x582adb,{'include':[{'model':db[_0x9c96('0x99')],'as':_0x9c96('0xb0')}]});}})['then'](respondWithResult(_0xa398da,null))[_0x9c96('0x25')](handleError(_0xa398da,null));};exports['verifySmtp']=function(_0x558f75,_0x44c878,_0x2abd0e){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x558f75[_0x9c96('0x59')]['id']},'include':[{'model':db[_0x9c96('0x3a')],'as':'Smtp','raw':!![]}]})[_0x9c96('0x32')](handleEntityNotFound(_0x44c878,null))['then'](function(_0x113333){if(_0x113333&&_0x113333[_0x9c96('0x3b')]){var _0x48bf30={'id':_0x113333['id'],'tls':{'rejectUnauthorized':![]}};if(_0x113333[_0x9c96('0x3b')][_0x9c96('0x78')]){_0x48bf30['service']=_0x113333[_0x9c96('0x3b')][_0x9c96('0x78')];}else{_0x48bf30[_0x9c96('0x76')]=_0x113333[_0x9c96('0x3b')][_0x9c96('0x76')];_0x48bf30[_0x9c96('0x77')]=_0x113333[_0x9c96('0x3b')][_0x9c96('0x77')];_0x48bf30[_0x9c96('0xa8')]=_0x113333[_0x9c96('0x3b')][_0x9c96('0xa8')];}if(_0x113333[_0x9c96('0x3b')]['authentication']){_0x48bf30[_0x9c96('0xb1')]={'user':_0x113333[_0x9c96('0x3b')][_0x9c96('0x71')],'pass':_0x113333[_0x9c96('0x3b')][_0x9c96('0x73')]};}return respondWithRpcPromise(_0x9c96('0xb2'),_0x9c96('0xb3'),{'account':_0x48bf30});}})[_0x9c96('0x32')](respondWithResult(_0x44c878,null))[_0x9c96('0x25')](handleError(_0x44c878,null));};exports[_0x9c96('0x33')]=function(_0x3c9ce1,_0x39436a){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x3c9ce1[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x39436a,null))[_0x9c96('0x32')](function(_0xb68df5){if(_0xb68df5&&_0xb68df5[_0x9c96('0x78')]){throw new db['Sequelize'][(_0x9c96('0xb4'))](_0x9c96('0xb5'));}return _0xb68df5;})[_0x9c96('0x32')](removeEntity(_0x39436a,null))[_0x9c96('0x25')](handleError(_0x39436a,null));};exports[_0x9c96('0xb6')]=function(_0x4e4e81,_0x2692f7,_0x57fad7){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x4e4e81[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x2692f7,null))[_0x9c96('0x32')](function(_0x3e4be2){if(_0x3e4be2){return _0x3e4be2['addAgents'](_0x4e4e81['body'][_0x9c96('0x66')],_['omit'](_0x4e4e81['body'],[_0x9c96('0x66'),'id'])||{})[_0x9c96('0xb7')](function(_0x157ada){for(var _0x5dcf8f=0x0;_0x5dcf8f<_0x4e4e81['body'][_0x9c96('0x66')][_0x9c96('0x4a')];_0x5dcf8f+=0x1){socket[_0x9c96('0xb8')](_0x9c96('0xb9'),{'UserId':Number(_0x4e4e81[_0x9c96('0x5b')][_0x9c96('0x66')][_0x5dcf8f]),'MailAccountId':Number(_0x4e4e81[_0x9c96('0x59')]['id'])});}return _0x157ada;});}})['then'](respondWithResult(_0x2692f7,null))[_0x9c96('0x25')](handleError(_0x2692f7,null));};exports[_0x9c96('0xba')]=function(_0x2cff34,_0x5d7f79,_0x3bc181){return db[_0x9c96('0x53')][_0x9c96('0x5a')]({'where':{'id':_0x2cff34[_0x9c96('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d7f79,null))[_0x9c96('0x32')](function(_0x1585e8){if(_0x1585e8){return _0x1585e8[_0x9c96('0xba')](_0x2cff34[_0x9c96('0x47')][_0x9c96('0x66')])[_0x9c96('0x32')](function(){if(_[_0x9c96('0xbb')](_0x2cff34[_0x9c96('0x47')][_0x9c96('0x66')])){for(var _0x23a7e6=0x0;_0x23a7e6<_0x2cff34[_0x9c96('0x47')][_0x9c96('0x66')][_0x9c96('0x4a')];_0x23a7e6+=0x1){socket[_0x9c96('0xb8')](_0x9c96('0xbc'),{'UserId':Number(_0x2cff34[_0x9c96('0x47')][_0x9c96('0x66')][_0x23a7e6]),'MailAccountId':Number(_0x2cff34[_0x9c96('0x59')]['id'])});}}else{socket['emit'](_0x9c96('0xbc'),{'UserId':Number(_0x2cff34[_0x9c96('0x47')][_0x9c96('0x66')]),'MailAccountId':Number(_0x2cff34[_0x9c96('0x59')]['id'])});}});}})[_0x9c96('0x32')](respondWithStatusCode(_0x5d7f79,null))['catch'](handleError(_0x5d7f79,null));};exports[_0x9c96('0xbd')]=function(_0x4541bd,_0x4410fc,_0x3035e3){var _0x1ba719={};var _0x3c21b6={};var _0x2a02db;var _0x994d4e;return db[_0x9c96('0x53')]['findOne']({'where':{'id':_0x4541bd[_0x9c96('0x59')]['id']}})[_0x9c96('0x32')](handleEntityNotFound(_0x4410fc,null))[_0x9c96('0x32')](function(_0x2c91ed){if(_0x2c91ed){_0x2a02db=_0x2c91ed;_0x3c21b6['model']=_[_0x9c96('0x44')](db['User'][_0x9c96('0x3e')]);_0x3c21b6[_0x9c96('0x47')]=_['keys'](_0x4541bd['query']);_0x3c21b6[_0x9c96('0x45')]=_[_0x9c96('0x46')](_0x3c21b6['model'],_0x3c21b6[_0x9c96('0x47')]);_0x1ba719[_0x9c96('0x48')]=_['intersection'](_0x3c21b6[_0x9c96('0x42')],qs[_0x9c96('0x49')](_0x4541bd[_0x9c96('0x47')][_0x9c96('0x49')]));_0x1ba719['attributes']=_0x1ba719[_0x9c96('0x48')][_0x9c96('0x4a')]?_0x1ba719[_0x9c96('0x48')]:_0x3c21b6[_0x9c96('0x42')];_0x1ba719[_0x9c96('0x4c')]=qs['sort'](_0x4541bd['query'][_0x9c96('0x4d')]);_0x1ba719[_0x9c96('0x4f')]=qs[_0x9c96('0x45')](_[_0x9c96('0x63')](_0x4541bd[_0x9c96('0x47')],_0x3c21b6['filters']));if(_0x4541bd[_0x9c96('0x47')][_0x9c96('0x4e')]){_0x1ba719[_0x9c96('0x4f')]=_[_0x9c96('0x50')](_0x1ba719['where'],{'$or':_[_0x9c96('0x43')](_0x1ba719[_0x9c96('0x48')],function(_0x270f74){var _0x406efb={};_0x406efb[_0x270f74]={'$like':'%'+_0x4541bd['query']['filter']+'%'};return _0x406efb;})});}_0x1ba719=_['merge']({},_0x1ba719,_0x4541bd['options']);return _0x2a02db['getAgents'](_0x1ba719);}})[_0x9c96('0x32')](function(_0x2a744f){if(_0x2a744f){_0x994d4e=_0x2a744f[_0x9c96('0x4a')];if(!_0x4541bd[_0x9c96('0x47')][_0x9c96('0x62')](_0x9c96('0x4b'))){_0x1ba719['limit']=qs[_0x9c96('0x2c')](_0x4541bd[_0x9c96('0x47')][_0x9c96('0x2c')]);_0x1ba719[_0x9c96('0x29')]=qs[_0x9c96('0x29')](_0x4541bd[_0x9c96('0x47')][_0x9c96('0x29')]);}return _0x2a02db[_0x9c96('0xbd')](_0x1ba719);}})['then'](function(_0x4a0c09){if(_0x4a0c09){return _0x4a0c09?{'count':_0x994d4e,'rows':_0x4a0c09}:null;}})[_0x9c96('0x32')](respondWithResult(_0x4410fc,null))[_0x9c96('0x25')](handleError(_0x4410fc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e021255..3092f2e 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 _0x29b6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x29b6,0x17e));var _0x629b=function(_0xb1e68c,_0x469be7){_0xb1e68c=_0xb1e68c-0x0;var _0x30ccef=_0x29b6[_0xb1e68c];return _0x30ccef;};'use strict';var EventEmitter=require(_0x629b('0x0'));var MailAccount=require(_0x629b('0x1'))['db'][_0x629b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x629b('0x3')](0x0);var events={'afterCreate':_0x629b('0x4'),'afterUpdate':_0x629b('0x5'),'afterDestroy':_0x629b('0x6')};function emitEvent(_0x8f6ef0){return function(_0x25c9d9,_0x9108be,_0x5ade76){MailAccountEvents[_0x629b('0x7')](_0x8f6ef0+':'+_0x25c9d9['id'],_0x25c9d9);MailAccountEvents['emit'](_0x8f6ef0,_0x25c9d9);_0x5ade76(null);};}for(var e in events){if(events[_0x629b('0x8')](e)){var event=events[e];MailAccount[_0x629b('0x9')](e,emitEvent(event));}}module[_0x629b('0xa')]=MailAccountEvents; \ No newline at end of file +var _0x1537=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x1537,0x132));var _0x7153=function(_0x7b2e22,_0x338681){_0x7b2e22=_0x7b2e22-0x0;var _0x21dd3f=_0x1537[_0x7b2e22];return _0x21dd3f;};'use strict';var EventEmitter=require(_0x7153('0x0'));var MailAccount=require(_0x7153('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7153('0x2')](0x0);var events={'afterCreate':_0x7153('0x3'),'afterUpdate':_0x7153('0x4'),'afterDestroy':_0x7153('0x5')};function emitEvent(_0x34f38b){return function(_0x5048b8,_0x19112a,_0x5ec171){MailAccountEvents[_0x7153('0x6')](_0x34f38b+':'+_0x5048b8['id'],_0x5048b8);MailAccountEvents['emit'](_0x34f38b,_0x5048b8);_0x5ec171(null);};}for(var e in events){if(events[_0x7153('0x7')](e)){var event=events[e];MailAccount[_0x7153('0x8')](e,emitEvent(event));}}module[_0x7153('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 06e9bb7..0f9de8d 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 _0x6106=['request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x25c188,_0x52fea1){var _0x214852=function(_0x6a23c2){while(--_0x6a23c2){_0x25c188['push'](_0x25c188['shift']());}};_0x214852(++_0x52fea1);}(_0x6106,0xd8));var _0x6610=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x6106[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x6610('0x0'));var util=require('util');var logger=require(_0x6610('0x1'))(_0x6610('0x2'));var moment=require(_0x6610('0x3'));var BPromise=require(_0x6610('0x4'));var rp=require(_0x6610('0x5'));var fs=require('fs');var path=require(_0x6610('0x6'));var rimraf=require(_0x6610('0x7'));var config=require('../../config/environment');var attributes=require(_0x6610('0x8'));module[_0x6610('0x9')]=function(_0x45de3b,_0xefcc24){return _0x45de3b[_0x6610('0xa')](_0x6610('0xb'),attributes,{'tableName':_0x6610('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe641=['moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api'];(function(_0x5702e8,_0x5e445d){var _0x397331=function(_0x315dbb){while(--_0x315dbb){_0x5702e8['push'](_0x5702e8['shift']());}};_0x397331(++_0x5e445d);}(_0xe641,0x1aa));var _0x1e64=function(_0x545f6c,_0xd48453){_0x545f6c=_0x545f6c-0x0;var _0x1b9b42=_0xe641[_0x545f6c];return _0x1b9b42;};'use strict';var _=require(_0x1e64('0x0'));var util=require('util');var logger=require(_0x1e64('0x1'))(_0x1e64('0x2'));var moment=require(_0x1e64('0x3'));var BPromise=require(_0x1e64('0x4'));var rp=require(_0x1e64('0x5'));var fs=require('fs');var path=require(_0x1e64('0x6'));var rimraf=require(_0x1e64('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e64('0x8'));module[_0x1e64('0x9')]=function(_0x1c78d5,_0x3374f1){return _0x1c78d5[_0x1e64('0xa')](_0x1e64('0xb'),attributes,{'tableName':_0x1e64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7616b9d..de008e7 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 _0xdd1b=['from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','applications','list','orderBy','priority','autoclose','push','length','*,*,*,*','from','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','MailInteraction','Contact\x20not\x20found','spread','update','interaction','get','created','attachments','originTo','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','options','raw','where','attributes','include','map','model','then','ShowMailAccount','find','NotifyMailAccount','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','body','isNil'];(function(_0x1190b5,_0x46effd){var _0x222a5d=function(_0x22391b){while(--_0x22391b){_0x1190b5['push'](_0x1190b5['shift']());}};_0x222a5d(++_0x46effd);}(_0xdd1b,0x115));var _0xbdd1=function(_0x112444,_0x156f81){_0x112444=_0x112444-0x0;var _0x36e331=_0xdd1b[_0x112444];return _0x36e331;};'use strict';var _=require(_0xbdd1('0x0'));var util=require(_0xbdd1('0x1'));var moment=require(_0xbdd1('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdd1('0x3'));var fs=require('fs');var Redis=require(_0xbdd1('0x4'));var db=require(_0xbdd1('0x5'))['db'];var utils=require(_0xbdd1('0x6'));var logger=require(_0xbdd1('0x7'))(_0xbdd1('0x8'));var config=require(_0xbdd1('0x9'));var jayson=require(_0xbdd1('0xa'));var client=jayson[_0xbdd1('0xb')][_0xbdd1('0xc')]({'port':0x232c});config[_0xbdd1('0xd')]=_[_0xbdd1('0xe')](config['redis'],{'host':_0xbdd1('0xf'),'port':0x18eb});var socket=require(_0xbdd1('0x10'))(new Redis(config[_0xbdd1('0xd')]));require(_0xbdd1('0x11'))[_0xbdd1('0x12')](socket);function respondWithRpcPromise(_0x34dccf,_0x593e00,_0x2ea6d8){return new BPromise(function(_0x237923,_0x102353){return client[_0xbdd1('0x13')](_0x34dccf,_0x2ea6d8)['then'](function(_0x5f50f6){logger['info'](_0xbdd1('0x14'),_0x593e00,'request\x20sent');logger[_0xbdd1('0x15')](_0xbdd1('0x16'),_0x593e00,_0xbdd1('0x17'),JSON[_0xbdd1('0x18')](_0x5f50f6));if(_0x5f50f6[_0xbdd1('0x19')]){if(_0x5f50f6[_0xbdd1('0x19')][_0xbdd1('0x1a')]===0x1f4){logger[_0xbdd1('0x19')]('MailAccount,\x20%s,\x20%s',_0x593e00,_0x5f50f6[_0xbdd1('0x19')]['message']);return _0x102353(_0x5f50f6[_0xbdd1('0x19')][_0xbdd1('0x1b')]);}logger['error'](_0xbdd1('0x14'),_0x593e00,_0x5f50f6[_0xbdd1('0x19')]['message']);return _0x237923(_0x5f50f6[_0xbdd1('0x19')][_0xbdd1('0x1b')]);}else{logger['info'](_0xbdd1('0x14'),_0x593e00,'request\x20sent');_0x237923(_0x5f50f6[_0xbdd1('0x1c')][_0xbdd1('0x1b')]);}})[_0xbdd1('0x1d')](function(_0x47a1dc){logger[_0xbdd1('0x19')](_0xbdd1('0x14'),_0x593e00,_0x47a1dc);_0x102353(_0x47a1dc);});});}exports[_0xbdd1('0x1e')]=function(_0x3bbbe1){var _0x1d2a3a=this;return new Promise(function(_0x21499d,_0x4649e9){return db['MailAccount']['findAll']({'raw':_0x3bbbe1[_0xbdd1('0x1f')]?_0x3bbbe1[_0xbdd1('0x1f')][_0xbdd1('0x20')]===undefined?!![]:![]:!![],'where':_0x3bbbe1[_0xbdd1('0x1f')]?_0x3bbbe1[_0xbdd1('0x1f')][_0xbdd1('0x21')]||null:null,'attributes':_0x3bbbe1['options']?_0x3bbbe1[_0xbdd1('0x1f')][_0xbdd1('0x22')]||null:null,'limit':_0x3bbbe1[_0xbdd1('0x1f')]?_0x3bbbe1[_0xbdd1('0x1f')]['limit']||null:null,'include':_0x3bbbe1[_0xbdd1('0x1f')]?_0x3bbbe1[_0xbdd1('0x1f')][_0xbdd1('0x23')]?_[_0xbdd1('0x24')](_0x3bbbe1['options'][_0xbdd1('0x23')],function(_0x1891fe){return{'model':db[_0x1891fe[_0xbdd1('0x25')]],'as':_0x1891fe['as'],'attributes':_0x1891fe[_0xbdd1('0x22')],'include':_0x1891fe['include']?_[_0xbdd1('0x24')](_0x1891fe[_0xbdd1('0x23')],function(_0xfd8241){return{'model':db[_0xfd8241['model']],'as':_0xfd8241['as'],'attributes':_0xfd8241[_0xbdd1('0x22')],'include':_0xfd8241[_0xbdd1('0x23')]?_['map'](_0xfd8241['include'],function(_0x5dad4a){return{'model':db[_0x5dad4a[_0xbdd1('0x25')]],'as':_0x5dad4a['as'],'attributes':_0x5dad4a[_0xbdd1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbdd1('0x26')](function(_0x23218c){logger['info']('GetMailAccount',_0x3bbbe1);logger[_0xbdd1('0x15')](_0xbdd1('0x1e'),_0x3bbbe1,JSON[_0xbdd1('0x18')](_0x23218c));_0x21499d(_0x23218c);})[_0xbdd1('0x1d')](function(_0x2e4abd){logger['error'](_0xbdd1('0x1e'),_0x2e4abd[_0xbdd1('0x1b')],_0x3bbbe1);_0x4649e9(_0x1d2a3a[_0xbdd1('0x19')](0x1f4,_0x2e4abd[_0xbdd1('0x1b')]));});});};exports[_0xbdd1('0x27')]=function(_0x44e8ad){var _0x520d16=this;return new Promise(function(_0x1d9256,_0xd27495){return db['MailAccount'][_0xbdd1('0x28')]({'raw':_0x44e8ad[_0xbdd1('0x1f')]?_0x44e8ad[_0xbdd1('0x1f')][_0xbdd1('0x20')]===undefined?!![]:![]:!![],'where':_0x44e8ad[_0xbdd1('0x1f')]?_0x44e8ad[_0xbdd1('0x1f')][_0xbdd1('0x21')]||null:null,'attributes':_0x44e8ad['options']?_0x44e8ad[_0xbdd1('0x1f')][_0xbdd1('0x22')]||null:null,'include':_0x44e8ad['options']?_0x44e8ad['options']['include']?_[_0xbdd1('0x24')](_0x44e8ad[_0xbdd1('0x1f')][_0xbdd1('0x23')],function(_0x618c1a){return{'model':db[_0x618c1a[_0xbdd1('0x25')]],'as':_0x618c1a['as'],'attributes':_0x618c1a['attributes'],'include':_0x618c1a[_0xbdd1('0x23')]?_[_0xbdd1('0x24')](_0x618c1a['include'],function(_0x816422){return{'model':db[_0x816422[_0xbdd1('0x25')]],'as':_0x816422['as'],'attributes':_0x816422['attributes'],'include':_0x816422[_0xbdd1('0x23')]?_[_0xbdd1('0x24')](_0x816422['include'],function(_0x461c91){return{'model':db[_0x461c91[_0xbdd1('0x25')]],'as':_0x461c91['as'],'attributes':_0x461c91[_0xbdd1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbdd1('0x26')](function(_0x29d2ef){logger['info'](_0xbdd1('0x27'),_0x44e8ad);logger['debug'](_0xbdd1('0x27'),_0x44e8ad,JSON[_0xbdd1('0x18')](_0x29d2ef));_0x1d9256(_0x29d2ef);})[_0xbdd1('0x1d')](function(_0x538753){logger['error'](_0xbdd1('0x27'),_0x538753['message'],_0x44e8ad);_0xd27495(_0x520d16[_0xbdd1('0x19')](0x1f4,_0x538753[_0xbdd1('0x1b')]));});});};exports[_0xbdd1('0x29')]=function(_0x4d4b2a){var _0x22565f=this;return new Promise(function(_0x34bdd3,_0x17b89d){var _0x5e20ed={'body':_0x4d4b2a['body'],'channel':_0xbdd1('0x2a')};var _0x10bcac=_[_0xbdd1('0x2b')](_['keys'](db['CmContact'][_0xbdd1('0x2c')]),[_0xbdd1('0x2d'),_0xbdd1('0x2e'),_0xbdd1('0x2f'),'ListId']);var _0x176ad8=![];if(_0x4d4b2a[_0xbdd1('0x30')]['id']){delete _0x4d4b2a[_0xbdd1('0x30')]['id'];}if(_[_0xbdd1('0x31')](_0x4d4b2a[_0xbdd1('0x30')]['from'])){return _0x17b89d(_0x22565f[_0xbdd1('0x19')](0x1f4,_0xbdd1('0x32')));}if(_['isNil'](_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x30')])||_0x4d4b2a[_0xbdd1('0x30')]['body']===''){return _0x17b89d(_0x22565f['error'](0x1f4,_0xbdd1('0x33')));}if(_[_0xbdd1('0x31')](_0x4d4b2a['body'][_0xbdd1('0x34')])){return _0x17b89d(_0x22565f['error'](0x1f4,_0xbdd1('0x35')+_0x10bcac));}if(!_[_0xbdd1('0x36')](_0x10bcac,_0x4d4b2a['body']['mapKey'])){return _0x17b89d(_0x22565f[_0xbdd1('0x19')](0x1f4,_0xbdd1('0x37')+_0x10bcac));}var _0x5a5032={};_0x5a5032[_0x4d4b2a['body'][_0xbdd1('0x34')]]=_0x4d4b2a[_0xbdd1('0x30')]['from'];return db['MailAccount'][_0xbdd1('0x28')]({'where':{'id':_0x4d4b2a[_0xbdd1('0x38')]['id']},'include':[{'model':db[_0xbdd1('0x39')],'as':_0xbdd1('0x3a'),'include':[{'model':db[_0xbdd1('0x3b')],'as':_0xbdd1('0x3c'),'where':_0x5a5032,'limit':0x1,'order':[[_0xbdd1('0x2e'),_0xbdd1('0x3d')]]}]},{'model':db[_0xbdd1('0x3e')],'as':_0xbdd1('0x3f')},{'model':db[_0xbdd1('0x40')],'as':_0xbdd1('0x41')}]})[_0xbdd1('0x26')](function(_0x2e3714){if(_0x2e3714&&_0x2e3714['List']){var _0x42694d=_0x2e3714['get']({'plain':!![]});_0x5e20ed[_0xbdd1('0x38')]=_[_0xbdd1('0x42')](_0x42694d,[_0xbdd1('0x3f'),_0xbdd1('0x3a')]);_0x5e20ed[_0xbdd1('0x43')]=_0x42694d[_0xbdd1('0x3f')];_0x5e20ed[_0xbdd1('0x44')]=_0x42694d[_0xbdd1('0x3a')];_0x5e20ed[_0xbdd1('0x43')]=_[_0xbdd1('0x45')](_0x5e20ed[_0xbdd1('0x43')],[_0xbdd1('0x46')],['asc']);if(_0x5e20ed[_0xbdd1('0x38')]&&_0x5e20ed[_0xbdd1('0x38')][_0xbdd1('0x47')]){_0x5e20ed[_0xbdd1('0x43')][_0xbdd1('0x48')]({'id':0x0,'priority':_0x5e20ed[_0xbdd1('0x43')][_0xbdd1('0x49')]+0x1,'app':'close','appdata':_0xbdd1('0x47'),'interval':_0xbdd1('0x4a')});}if(_0x5e20ed[_0xbdd1('0x38')][_0xbdd1('0x3f')]){delete _0x5e20ed[_0xbdd1('0x38')][_0xbdd1('0x3f')];}if(_0x5e20ed[_0xbdd1('0x38')][_0xbdd1('0x3a')]){delete _0x5e20ed['account']['List'];}if(_0x42694d[_0xbdd1('0x3a')][_0xbdd1('0x3c')]['length']){return _0x42694d[_0xbdd1('0x3a')][_0xbdd1('0x3c')][0x0];}var _0x2f7be4=_[_0xbdd1('0xe')](_0x4d4b2a[_0xbdd1('0x30')],{'firstName':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x4b')],'ListId':_0x42694d[_0xbdd1('0x4c')]});_0x2f7be4[_0x4d4b2a['body'][_0xbdd1('0x34')]]=_0x4d4b2a['body'][_0xbdd1('0x4b')];return db[_0xbdd1('0x3b')][_0xbdd1('0x4d')](_0x2f7be4);}else{throw new Error(_0xbdd1('0x4e'));}})[_0xbdd1('0x26')](function(_0x1f6396){_0x5e20ed[_0xbdd1('0x4f')]=_0x1f6396;if(_0x1f6396){if(!_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x50')]){_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x50')]=rs[_0xbdd1('0x51')]()+'\x20'+_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x4b')];}var _0x4fc703={'ContactId':_0x1f6396['id'],'MailAccountId':_0x4d4b2a['account']['id'],'inReplyTo':_0x4d4b2a['body']['message'][_0xbdd1('0x50')],'to':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x4b')],'cc':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['cc'],'subject':_0x4d4b2a[_0xbdd1('0x30')]['message'][_0xbdd1('0x52')],'attach':_0x4d4b2a['body'][_0xbdd1('0x1b')][_0xbdd1('0x53')],'lastMsgAt':moment()[_0xbdd1('0x54')](_0xbdd1('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xbdd1('0x28')]({'where':{'closed':![],'MailAccountId':_0x4d4b2a[_0xbdd1('0x38')]['id']},'include':[{'model':db[_0xbdd1('0x56')],'as':_0xbdd1('0x57'),'attributes':[_0xbdd1('0x50')],'where':{'messageId':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['inReplyTo']}}]})[_0xbdd1('0x26')](function(_0x5c2816){if(_0x5c2816){return[_0x5c2816,![]];}return db[_0xbdd1('0x58')][_0xbdd1('0x4d')](_0x4fc703)[_0xbdd1('0x26')](function(_0x53b3c6){return[_0x53b3c6,!![]];});});}else{throw new Error(_0xbdd1('0x59'));}})[_0xbdd1('0x5a')](function(_0x2a5fbc,_0x464be1){if(_0x2a5fbc){_0x176ad8=_0x464be1;if(!_0x464be1){return _0x2a5fbc[_0xbdd1('0x5b')]({'inReplyTo':_0x4d4b2a[_0xbdd1('0x30')]['message'][_0xbdd1('0x50')],'to':_0x4d4b2a[_0xbdd1('0x30')]['message'][_0xbdd1('0x4b')],'cc':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['cc'],'subject':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x52')],'attach':_0x2a5fbc[_0xbdd1('0x53')]?_0x2a5fbc[_0xbdd1('0x53')]:_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x53')],'substatus':null,'substatusAt':moment()[_0xbdd1('0x54')](_0xbdd1('0x55')),'lastMsgAt':moment()[_0xbdd1('0x54')](_0xbdd1('0x55')),'lastMsgDirection':'in'});}else{return _0x2a5fbc;}}})[_0xbdd1('0x26')](function(_0x198d16){_0x5e20ed[_0xbdd1('0x5c')]=_0x198d16[_0xbdd1('0x5d')]({'plain':!![]});_0x5e20ed[_0xbdd1('0x5c')][_0xbdd1('0x5e')]=_0x176ad8;return db[_0xbdd1('0x56')][_0xbdd1('0x4d')]({'body':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x30')],'MailAccountId':_0x4d4b2a[_0xbdd1('0x38')]['id'],'MailInteractionId':_0x198d16['id'],'direction':'in','ContactId':_0x5e20ed[_0xbdd1('0x4f')]['id'],'messageId':_0x4d4b2a['body'][_0xbdd1('0x1b')][_0xbdd1('0x50')],'from':_0x4d4b2a['body'][_0xbdd1('0x1b')][_0xbdd1('0x4b')],'to':_0x4d4b2a[_0xbdd1('0x30')]['message']['to'],'cc':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['cc'],'subject':_0x4d4b2a[_0xbdd1('0x30')]['message'][_0xbdd1('0x52')],'attach':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x53')],'Attachments':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')][_0xbdd1('0x5f')],'originTo':_0x4d4b2a[_0xbdd1('0x30')]['message'][_0xbdd1('0x60')],'originCc':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['originCc'],'bcc':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['bcc'],'ChatWebsiteId':_0x4d4b2a['body']['message'][_0xbdd1('0x61')]||null,'originChannel':_0x4d4b2a['body'][_0xbdd1('0x1b')][_0xbdd1('0x62')]||_0xbdd1('0x63'),'ChatOfflineMessageId':_0x4d4b2a[_0xbdd1('0x30')][_0xbdd1('0x1b')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xbdd1('0x64')],'as':_0xbdd1('0x65')}]});})[_0xbdd1('0x26')](function(_0xcc8588){_0x5e20ed[_0xbdd1('0x1b')]=_0xcc8588;if(_0x5e20ed[_0xbdd1('0x5c')][_0xbdd1('0x66')]){return db[_0xbdd1('0x67')][_0xbdd1('0x28')]({'attributes':['id',_0xbdd1('0x68')],'where':{'id':_0x5e20ed['interaction'][_0xbdd1('0x66')]}})[_0xbdd1('0x26')](function(_0x1a0c29){if(_0x1a0c29){_0x5e20ed[_0xbdd1('0x43')][_0xbdd1('0x69')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a0c29['name']+','+(_0x5e20ed[_0xbdd1('0x38')][_0xbdd1('0x6a')]||0xa),'interval':_0xbdd1('0x4a')});}return respondWithRpcPromise(_0xbdd1('0x6b'),_0xbdd1('0x6c'),_0x5e20ed);});}return respondWithRpcPromise('Start','startRouting',_0x5e20ed);})[_0xbdd1('0x26')](function(_0x30f71c){_0x34bdd3(_0x30f71c);})['catch'](function(_0x2023c9){_0x17b89d(_0x22565f['error'](0x1f4,_0x2023c9[_0xbdd1('0x1b')]));});});}; \ No newline at end of file +var _0x6492=['close','defaults','List\x20not\x20found','contact','messageId','from','attach','format','MailInteraction','create','Contact\x20not\x20found','spread','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','findAll','options','where','attributes','limit','include','model','map','GetMailAccount','ShowMailAccount','find','raw','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','omit','list','applications','orderBy','asc','push'];(function(_0x8b987c,_0x5262e7){var _0x7b8b61=function(_0x3ede04){while(--_0x3ede04){_0x8b987c['push'](_0x8b987c['shift']());}};_0x7b8b61(++_0x5262e7);}(_0x6492,0x85));var _0x2649=function(_0x560ad9,_0x2a4336){_0x560ad9=_0x560ad9-0x0;var _0x31dc6b=_0x6492[_0x560ad9];return _0x31dc6b;};'use strict';var _=require(_0x2649('0x0'));var util=require(_0x2649('0x1'));var moment=require(_0x2649('0x2'));var BPromise=require(_0x2649('0x3'));var rs=require(_0x2649('0x4'));var fs=require('fs');var Redis=require(_0x2649('0x5'));var db=require(_0x2649('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2649('0x7'))(_0x2649('0x8'));var config=require(_0x2649('0x9'));var jayson=require(_0x2649('0xa'));var client=jayson['client'][_0x2649('0xb')]({'port':0x232c});config[_0x2649('0xc')]=_['defaults'](config[_0x2649('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2649('0xd'))(new Redis(config[_0x2649('0xc')]));require(_0x2649('0xe'))[_0x2649('0xf')](socket);function respondWithRpcPromise(_0x300d05,_0x140304,_0x427b85){return new BPromise(function(_0x2386d5,_0x462080){return client[_0x2649('0x10')](_0x300d05,_0x427b85)[_0x2649('0x11')](function(_0x1a8dfb){logger[_0x2649('0x12')](_0x2649('0x13'),_0x140304,'request\x20sent');logger[_0x2649('0x14')](_0x2649('0x15'),_0x140304,_0x2649('0x16'),JSON[_0x2649('0x17')](_0x1a8dfb));if(_0x1a8dfb[_0x2649('0x18')]){if(_0x1a8dfb[_0x2649('0x18')][_0x2649('0x19')]===0x1f4){logger[_0x2649('0x18')](_0x2649('0x13'),_0x140304,_0x1a8dfb[_0x2649('0x18')]['message']);return _0x462080(_0x1a8dfb['error'][_0x2649('0x1a')]);}logger[_0x2649('0x18')](_0x2649('0x13'),_0x140304,_0x1a8dfb[_0x2649('0x18')][_0x2649('0x1a')]);return _0x2386d5(_0x1a8dfb[_0x2649('0x18')][_0x2649('0x1a')]);}else{logger[_0x2649('0x12')](_0x2649('0x13'),_0x140304,_0x2649('0x16'));_0x2386d5(_0x1a8dfb[_0x2649('0x1b')][_0x2649('0x1a')]);}})[_0x2649('0x1c')](function(_0x2d5e6d){logger[_0x2649('0x18')](_0x2649('0x13'),_0x140304,_0x2d5e6d);_0x462080(_0x2d5e6d);});});}exports['GetMailAccount']=function(_0x2a4443){var _0xe54b29=this;return new Promise(function(_0x441685,_0x3d724d){return db[_0x2649('0x1d')][_0x2649('0x1e')]({'raw':_0x2a4443['options']?_0x2a4443[_0x2649('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2a4443[_0x2649('0x1f')]?_0x2a4443[_0x2649('0x1f')][_0x2649('0x20')]||null:null,'attributes':_0x2a4443[_0x2649('0x1f')]?_0x2a4443[_0x2649('0x1f')][_0x2649('0x21')]||null:null,'limit':_0x2a4443[_0x2649('0x1f')]?_0x2a4443[_0x2649('0x1f')][_0x2649('0x22')]||null:null,'include':_0x2a4443[_0x2649('0x1f')]?_0x2a4443[_0x2649('0x1f')][_0x2649('0x23')]?_['map'](_0x2a4443[_0x2649('0x1f')][_0x2649('0x23')],function(_0x48f77b){return{'model':db[_0x48f77b['model']],'as':_0x48f77b['as'],'attributes':_0x48f77b[_0x2649('0x21')],'include':_0x48f77b[_0x2649('0x23')]?_['map'](_0x48f77b[_0x2649('0x23')],function(_0x24f7f7){return{'model':db[_0x24f7f7[_0x2649('0x24')]],'as':_0x24f7f7['as'],'attributes':_0x24f7f7[_0x2649('0x21')],'include':_0x24f7f7['include']?_[_0x2649('0x25')](_0x24f7f7[_0x2649('0x23')],function(_0x8a949f){return{'model':db[_0x8a949f[_0x2649('0x24')]],'as':_0x8a949f['as'],'attributes':_0x8a949f[_0x2649('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2649('0x11')](function(_0x516d1a){logger[_0x2649('0x12')](_0x2649('0x26'),_0x2a4443);logger['debug'](_0x2649('0x26'),_0x2a4443,JSON[_0x2649('0x17')](_0x516d1a));_0x441685(_0x516d1a);})[_0x2649('0x1c')](function(_0x542687){logger['error'](_0x2649('0x26'),_0x542687[_0x2649('0x1a')],_0x2a4443);_0x3d724d(_0xe54b29[_0x2649('0x18')](0x1f4,_0x542687[_0x2649('0x1a')]));});});};exports[_0x2649('0x27')]=function(_0x57f64c){var _0x4dc986=this;return new Promise(function(_0x5e3b01,_0x446da9){return db['MailAccount'][_0x2649('0x28')]({'raw':_0x57f64c['options']?_0x57f64c['options'][_0x2649('0x29')]===undefined?!![]:![]:!![],'where':_0x57f64c[_0x2649('0x1f')]?_0x57f64c[_0x2649('0x1f')][_0x2649('0x20')]||null:null,'attributes':_0x57f64c[_0x2649('0x1f')]?_0x57f64c[_0x2649('0x1f')][_0x2649('0x21')]||null:null,'include':_0x57f64c[_0x2649('0x1f')]?_0x57f64c[_0x2649('0x1f')][_0x2649('0x23')]?_[_0x2649('0x25')](_0x57f64c['options']['include'],function(_0x32d9eb){return{'model':db[_0x32d9eb[_0x2649('0x24')]],'as':_0x32d9eb['as'],'attributes':_0x32d9eb['attributes'],'include':_0x32d9eb[_0x2649('0x23')]?_[_0x2649('0x25')](_0x32d9eb[_0x2649('0x23')],function(_0x2c46e9){return{'model':db[_0x2c46e9[_0x2649('0x24')]],'as':_0x2c46e9['as'],'attributes':_0x2c46e9[_0x2649('0x21')],'include':_0x2c46e9[_0x2649('0x23')]?_[_0x2649('0x25')](_0x2c46e9[_0x2649('0x23')],function(_0x1e0d23){return{'model':db[_0x1e0d23['model']],'as':_0x1e0d23['as'],'attributes':_0x1e0d23['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3467ae){logger[_0x2649('0x12')]('ShowMailAccount',_0x57f64c);logger[_0x2649('0x14')](_0x2649('0x27'),_0x57f64c,JSON[_0x2649('0x17')](_0x3467ae));_0x5e3b01(_0x3467ae);})[_0x2649('0x1c')](function(_0x15c6f8){logger[_0x2649('0x18')](_0x2649('0x27'),_0x15c6f8[_0x2649('0x1a')],_0x57f64c);_0x446da9(_0x4dc986['error'](0x1f4,_0x15c6f8['message']));});});};exports[_0x2649('0x2a')]=function(_0x1bbc56){var _0xc74ebd=this;return new Promise(function(_0x50ff59,_0x1fa5a0){var _0x9ac870={'body':_0x1bbc56[_0x2649('0x2b')],'channel':'mail'};var _0x1fb4ea=_[_0x2649('0x2c')](_[_0x2649('0x2d')](db[_0x2649('0x2e')][_0x2649('0x2f')]),[_0x2649('0x30'),_0x2649('0x31'),'CompanyId',_0x2649('0x32')]);var _0x28be91=![];if(_0x1bbc56[_0x2649('0x2b')]['id']){delete _0x1bbc56['body']['id'];}if(_[_0x2649('0x33')](_0x1bbc56[_0x2649('0x2b')]['from'])){return _0x1fa5a0(_0xc74ebd[_0x2649('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x2649('0x33')](_0x1bbc56[_0x2649('0x2b')][_0x2649('0x2b')])||_0x1bbc56['body'][_0x2649('0x2b')]===''){return _0x1fa5a0(_0xc74ebd[_0x2649('0x18')](0x1f4,_0x2649('0x34')));}if(_[_0x2649('0x33')](_0x1bbc56[_0x2649('0x2b')][_0x2649('0x35')])){return _0x1fa5a0(_0xc74ebd[_0x2649('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fb4ea));}if(!_[_0x2649('0x36')](_0x1fb4ea,_0x1bbc56[_0x2649('0x2b')][_0x2649('0x35')])){return _0x1fa5a0(_0xc74ebd[_0x2649('0x18')](0x1f4,_0x2649('0x37')+_0x1fb4ea));}var _0x175c70={};_0x175c70[_0x1bbc56['body'][_0x2649('0x35')]]=_0x1bbc56[_0x2649('0x2b')]['from'];return db[_0x2649('0x1d')][_0x2649('0x28')]({'where':{'id':_0x1bbc56[_0x2649('0x38')]['id']},'include':[{'model':db[_0x2649('0x39')],'as':_0x2649('0x3a'),'include':[{'model':db[_0x2649('0x2e')],'as':_0x2649('0x3b'),'where':_0x175c70,'limit':0x1,'order':[[_0x2649('0x31'),_0x2649('0x3c')]]}]},{'model':db[_0x2649('0x3d')],'as':_0x2649('0x3e')},{'model':db[_0x2649('0x3f')],'as':'Smtp'}]})[_0x2649('0x11')](function(_0x41b6a6){if(_0x41b6a6&&_0x41b6a6[_0x2649('0x3a')]){var _0x502884=_0x41b6a6[_0x2649('0x40')]({'plain':!![]});_0x9ac870[_0x2649('0x38')]=_[_0x2649('0x41')](_0x502884,[_0x2649('0x3e'),_0x2649('0x3a')]);_0x9ac870['applications']=_0x502884[_0x2649('0x3e')];_0x9ac870[_0x2649('0x42')]=_0x502884[_0x2649('0x3a')];_0x9ac870[_0x2649('0x43')]=_[_0x2649('0x44')](_0x9ac870['applications'],['priority'],[_0x2649('0x45')]);if(_0x9ac870['account']&&_0x9ac870[_0x2649('0x38')]['autoclose']){_0x9ac870[_0x2649('0x43')][_0x2649('0x46')]({'id':0x0,'priority':_0x9ac870[_0x2649('0x43')]['length']+0x1,'app':_0x2649('0x47'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x9ac870[_0x2649('0x38')]['Applications']){delete _0x9ac870['account'][_0x2649('0x3e')];}if(_0x9ac870[_0x2649('0x38')]['List']){delete _0x9ac870[_0x2649('0x38')][_0x2649('0x3a')];}if(_0x502884['List'][_0x2649('0x3b')]['length']){return _0x502884['List'][_0x2649('0x3b')][0x0];}var _0x19808f=_[_0x2649('0x48')](_0x1bbc56['body'],{'firstName':_0x1bbc56['body']['from'],'ListId':_0x502884[_0x2649('0x32')]});_0x19808f[_0x1bbc56[_0x2649('0x2b')][_0x2649('0x35')]]=_0x1bbc56['body']['from'];return db['CmContact']['create'](_0x19808f);}else{throw new Error(_0x2649('0x49'));}})[_0x2649('0x11')](function(_0xf30e33){_0x9ac870[_0x2649('0x4a')]=_0xf30e33;if(_0xf30e33){if(!_0x1bbc56[_0x2649('0x2b')]['message']['messageId']){_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x4b')]=rs['generate']()+'\x20'+_0x1bbc56['body']['message'][_0x2649('0x4c')];}var _0x509b68={'ContactId':_0xf30e33['id'],'MailAccountId':_0x1bbc56['account']['id'],'inReplyTo':_0x1bbc56['body'][_0x2649('0x1a')][_0x2649('0x4b')],'to':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x4c')],'cc':_0x1bbc56['body'][_0x2649('0x1a')]['cc'],'subject':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['subject'],'attach':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x4d')],'lastMsgAt':moment()[_0x2649('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x2649('0x4f')][_0x2649('0x28')]({'where':{'closed':![],'MailAccountId':_0x1bbc56[_0x2649('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x2649('0x4b')],'where':{'messageId':_0x1bbc56['body'][_0x2649('0x1a')]['inReplyTo']}}]})['then'](function(_0x1bb38c){if(_0x1bb38c){return[_0x1bb38c,![]];}return db[_0x2649('0x4f')][_0x2649('0x50')](_0x509b68)[_0x2649('0x11')](function(_0x2db8ea){return[_0x2db8ea,!![]];});});}else{throw new Error(_0x2649('0x51'));}})[_0x2649('0x52')](function(_0x43bfcd,_0x402f8f){if(_0x43bfcd){_0x28be91=_0x402f8f;if(!_0x402f8f){return _0x43bfcd['update']({'inReplyTo':_0x1bbc56['body'][_0x2649('0x1a')][_0x2649('0x4b')],'to':_0x1bbc56['body'][_0x2649('0x1a')]['from'],'cc':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['cc'],'subject':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x53')],'attach':_0x43bfcd[_0x2649('0x4d')]?_0x43bfcd['attach']:_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0x2649('0x54')),'lastMsgAt':moment()[_0x2649('0x4e')](_0x2649('0x54')),'lastMsgDirection':'in'});}else{return _0x43bfcd;}}})[_0x2649('0x11')](function(_0x3bee4a){_0x9ac870[_0x2649('0x55')]=_0x3bee4a['get']({'plain':!![]});_0x9ac870[_0x2649('0x55')][_0x2649('0x56')]=_0x28be91;return db['MailMessage'][_0x2649('0x50')]({'body':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x2b')],'MailAccountId':_0x1bbc56['account']['id'],'MailInteractionId':_0x3bee4a['id'],'direction':'in','ContactId':_0x9ac870[_0x2649('0x4a')]['id'],'messageId':_0x1bbc56[_0x2649('0x2b')]['message'][_0x2649('0x4b')],'from':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x4c')],'to':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['to'],'cc':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['cc'],'subject':_0x1bbc56[_0x2649('0x2b')]['message'][_0x2649('0x53')],'attach':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x4d')],'Attachments':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x57')],'originTo':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')][_0x2649('0x58')],'originCc':_0x1bbc56['body']['message']['originCc'],'bcc':_0x1bbc56['body']['message']['bcc'],'ChatWebsiteId':_0x1bbc56['body'][_0x2649('0x1a')][_0x2649('0x59')]||null,'originChannel':_0x1bbc56[_0x2649('0x2b')]['message'][_0x2649('0x5a')]||'Email','ChatOfflineMessageId':_0x1bbc56[_0x2649('0x2b')][_0x2649('0x1a')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x2649('0x5b')],'as':_0x2649('0x5c')}]});})[_0x2649('0x11')](function(_0x57ae1b){_0x9ac870[_0x2649('0x1a')]=_0x57ae1b;if(_0x9ac870[_0x2649('0x55')][_0x2649('0x5d')]){return db[_0x2649('0x5e')]['find']({'attributes':['id',_0x2649('0x5f')],'where':{'id':_0x9ac870[_0x2649('0x55')][_0x2649('0x5d')]}})['then'](function(_0x811fd2){if(_0x811fd2){_0x9ac870[_0x2649('0x43')][_0x2649('0x60')]({'id':0x0,'priority':0x0,'app':_0x2649('0x61'),'appdata':_0x811fd2[_0x2649('0x5f')]+','+(_0x9ac870[_0x2649('0x38')][_0x2649('0x62')]||0xa),'interval':_0x2649('0x63')});}return respondWithRpcPromise(_0x2649('0x64'),_0x2649('0x65'),_0x9ac870);});}return respondWithRpcPromise(_0x2649('0x64'),_0x2649('0x65'),_0x9ac870);})[_0x2649('0x11')](function(_0x2fb265){_0x50ff59(_0x2fb265);})['catch'](function(_0x5a2f4f){_0x1fa5a0(_0xc74ebd[_0x2649('0x18')](0x1f4,_0x5a2f4f[_0x2649('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f32530f..d6b78b6 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 _0xf503=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x38361d,_0x4bb677){var _0x59c659=function(_0x1fd5f0){while(--_0x1fd5f0){_0x38361d['push'](_0x38361d['shift']());}};_0x59c659(++_0x4bb677);}(_0xf503,0x11a));var _0x3f50=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0xf503[_0x108d5f];return _0x456ea3;};'use strict';var MailAccountEvents=require(_0x3f50('0x0'));var events=[_0x3f50('0x1'),_0x3f50('0x2'),_0x3f50('0x3')];function createListener(_0x10b774,_0x256cf6){return function(_0x43ff70){_0x256cf6[_0x3f50('0x4')](_0x10b774,_0x43ff70);};}function removeListener(_0x51152b,_0xc7f106){return function(){MailAccountEvents[_0x3f50('0x5')](_0x51152b,_0xc7f106);};}exports['register']=function(_0x4ef6da){for(var _0x4afb1a=0x0,_0x1291b7=events[_0x3f50('0x6')];_0x4afb1a<_0x1291b7;_0x4afb1a++){var _0x2d96ae=events[_0x4afb1a];var _0x268aee=createListener(_0x3f50('0x7')+_0x2d96ae,_0x4ef6da);MailAccountEvents['on'](_0x2d96ae,_0x268aee);}}; \ No newline at end of file +var _0x4d67=['remove','emit','register','length','./mailAccount.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d67,0x6a));var _0x74d6=function(_0x5ec469,_0x42f832){_0x5ec469=_0x5ec469-0x0;var _0x571a4b=_0x4d67[_0x5ec469];return _0x571a4b;};'use strict';var MailAccountEvents=require(_0x74d6('0x0'));var events=[_0x74d6('0x1'),_0x74d6('0x2'),'update'];function createListener(_0x9c29a5,_0x43404e){return function(_0x57efe4){_0x43404e[_0x74d6('0x3')](_0x9c29a5,_0x57efe4);};}function removeListener(_0x286f6c,_0xc76444){return function(){MailAccountEvents['removeListener'](_0x286f6c,_0xc76444);};}exports[_0x74d6('0x4')]=function(_0x38e186){for(var _0x1226c4=0x0,_0x3e3a06=events[_0x74d6('0x5')];_0x1226c4<_0x3e3a06;_0x1226c4++){var _0x2dd7a5=events[_0x1226c4];var _0x4567e7=createListener('mailAccount:'+_0x2dd7a5,_0x38e186);MailAccountEvents['on'](_0x2dd7a5,_0x4567e7);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index fdbb1bb..8db6765 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 _0xa99b=['delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa99b,0xd4));var _0xba99=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xa99b[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require('multer');var util=require(_0xba99('0x0'));var path=require(_0xba99('0x1'));var timeout=require('connect-timeout');var express=require(_0xba99('0x2'));var router=express[_0xba99('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xba99('0x4'));var interaction=require(_0xba99('0x5'));var config=require(_0xba99('0x6'));var controller=require(_0xba99('0x7'));router[_0xba99('0x8')](_0xba99('0x9'),auth[_0xba99('0xa')](),controller['show']);router[_0xba99('0xb')](_0xba99('0x9'),auth[_0xba99('0xa')](),controller[_0xba99('0xc')]);router[_0xba99('0xd')]('/:id',auth[_0xba99('0xa')](),controller['destroy']);module[_0xba99('0xe')]=router; \ No newline at end of file +var _0xffc9=['put','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x344dc8,_0xd5bfbe){var _0x547cc1=function(_0x530fe4){while(--_0x530fe4){_0x344dc8['push'](_0x344dc8['shift']());}};_0x547cc1(++_0xd5bfbe);}(_0xffc9,0xc7));var _0x9ffc=function(_0x45d675,_0x226c1c){_0x45d675=_0x45d675-0x0;var _0x81fd00=_0xffc9[_0x45d675];return _0x81fd00;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9ffc('0x0'));var express=require(_0x9ffc('0x1'));var router=express[_0x9ffc('0x2')]();var fs_extra=require(_0x9ffc('0x3'));var auth=require(_0x9ffc('0x4'));var interaction=require(_0x9ffc('0x5'));var config=require(_0x9ffc('0x6'));var controller=require('./mailApplication.controller');router[_0x9ffc('0x7')](_0x9ffc('0x8'),auth[_0x9ffc('0x9')](),controller[_0x9ffc('0xa')]);router[_0x9ffc('0xb')](_0x9ffc('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x9ffc('0x9')](),controller[_0x9ffc('0xc')]);module[_0x9ffc('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4a69288..ec96203 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 _0xf87a=['INTEGER','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xf87a,0x124));var _0xaf87=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf87a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xaf87('0x0'));module[_0xaf87('0x1')]={'priority':{'type':Sequelize[_0xaf87('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaf87('0x3')},'appdata':{'type':Sequelize[_0xaf87('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xaf87('0x5')}}; \ No newline at end of file +var _0x4055=['*,*,*,*','STRING','noop','TEXT'];(function(_0x4efd44,_0xf54eac){var _0x123afb=function(_0xd080a4){while(--_0xd080a4){_0x4efd44['push'](_0x4efd44['shift']());}};_0x123afb(++_0xf54eac);}(_0x4055,0xc1));var _0x5405=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0x4055[_0x124298];return _0x35ac24;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5405('0x0')],'allowNull':![],'defaultValue':_0x5405('0x1')},'appdata':{'type':Sequelize[_0x5405('0x2')]()},'description':{'type':Sequelize[_0x5405('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5405('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 44525ee..e7251ba 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x22e101,_0x412840){var _0xa51f61=function(_0x240122){while(--_0x240122){_0x22e101['push'](_0x22e101['shift']());}};_0xa51f61(++_0x412840);}(_0xe706,0xa3));var _0x6e70=function(_0x42d35d,_0x33e6fc){_0x42d35d=_0x42d35d-0x0;var _0x445dbc=_0xe706[_0x42d35d];return _0x445dbc;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x4bb975,_0x10f53b){var _0xe5c803=function(_0xb3187b){while(--_0xb3187b){_0x4bb975['push'](_0x4bb975['shift']());}};_0xe5c803(++_0x10f53b);}(_0xac4a,0x13f));var _0xaac4=function(_0x5c906e,_0x19662e){_0x5c906e=_0x5c906e-0x0;var _0x113caf=_0xac4a[_0x5c906e];return _0x113caf;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2445632..ec714a2 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 _0x0c7f=['../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1b8736,_0xeee7bc){var _0x43d1bb=function(_0x2f6f51){while(--_0x2f6f51){_0x1b8736['push'](_0x1b8736['shift']());}};_0x43d1bb(++_0xeee7bc);}(_0x0c7f,0xf3));var _0xf0c7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0c7f[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0c7('0x0'))('api');var moment=require(_0xf0c7('0x1'));var BPromise=require(_0xf0c7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf0c7('0x3'));var config=require(_0xf0c7('0x4'));var attributes=require('./mailApplication.attributes');module[_0xf0c7('0x5')]=function(_0x281a77,_0x47af29){return _0x281a77[_0xf0c7('0x6')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf0c7('0x7'),'collate':_0xf0c7('0x8')});}; \ No newline at end of file +var _0x3883=['../../config/logger','api','request-promise','path','rimraf','define','MailApplication','utf8mb4','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3883,0x15c));var _0x3388=function(_0x489973,_0x42c280){_0x489973=_0x489973-0x0;var _0x53fdf0=_0x3883[_0x489973];return _0x53fdf0;};'use strict';var _=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var logger=require(_0x3388('0x2'))(_0x3388('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3388('0x4'));var fs=require('fs');var path=require(_0x3388('0x5'));var rimraf=require(_0x3388('0x6'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x4929df,_0x2717ce){return _0x4929df[_0x3388('0x7')](_0x3388('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3388('0x9'),'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 41c0d77..5adaba1 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 _0x11f0=['raw','options','where','limit','stringify','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','body'];(function(_0x59992d,_0x2be6e8){var _0x45f8c3=function(_0x892c7e){while(--_0x892c7e){_0x59992d['push'](_0x59992d['shift']());}};_0x45f8c3(++_0x2be6e8);}(_0x11f0,0x164));var _0x011f=function(_0x29dda8,_0xb0e003){_0x29dda8=_0x29dda8-0x0;var _0x12e46d=_0x11f0[_0x29dda8];return _0x12e46d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x011f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x011f('0x1'));var db=require(_0x011f('0x2'))['db'];var utils=require(_0x011f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x011f('0x4'));var jayson=require(_0x011f('0x5'));var client=jayson['client'][_0x011f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x363535,_0x3d828d,_0x5aacc3){return new BPromise(function(_0x5b0203,_0x445f05){return client['request'](_0x363535,_0x5aacc3)[_0x011f('0x7')](function(_0x3a3dce){logger['info']('MailApplication,\x20%s,\x20%s',_0x3d828d,'request\x20sent');logger[_0x011f('0x8')](_0x011f('0x9'),_0x3d828d,'request\x20sent',JSON['stringify'](_0x3a3dce));if(_0x3a3dce[_0x011f('0xa')]){if(_0x3a3dce[_0x011f('0xa')][_0x011f('0xb')]===0x1f4){logger[_0x011f('0xa')](_0x011f('0xc'),_0x3d828d,_0x3a3dce[_0x011f('0xa')][_0x011f('0xd')]);return _0x445f05(_0x3a3dce['error'][_0x011f('0xd')]);}logger[_0x011f('0xa')]('MailApplication,\x20%s,\x20%s',_0x3d828d,_0x3a3dce[_0x011f('0xa')][_0x011f('0xd')]);return _0x5b0203(_0x3a3dce['error']['message']);}else{logger[_0x011f('0xe')](_0x011f('0xc'),_0x3d828d,'request\x20sent');_0x5b0203(_0x3a3dce[_0x011f('0xf')][_0x011f('0xd')]);}})['catch'](function(_0x5f450a){logger[_0x011f('0xa')]('MailApplication,\x20%s,\x20%s',_0x3d828d,_0x5f450a);_0x445f05(_0x5f450a);});});}exports[_0x011f('0x10')]=function(_0xd4ba86){var _0x32fc67=this;return new Promise(function(_0xdb3343,_0x1289a7){return db[_0x011f('0x11')]['update'](_0xd4ba86[_0x011f('0x12')],{'raw':_0xd4ba86['options']?_0xd4ba86['options'][_0x011f('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd4ba86[_0x011f('0x14')]?_0xd4ba86[_0x011f('0x14')][_0x011f('0x15')]||null:null,'attributes':_0xd4ba86[_0x011f('0x14')]?_0xd4ba86['options']['attributes']||null:null,'limit':_0xd4ba86[_0x011f('0x14')]?_0xd4ba86[_0x011f('0x14')][_0x011f('0x16')]||null:null})[_0x011f('0x7')](function(_0x2a7443){logger[_0x011f('0xe')]('UpdateMailApplication',_0xd4ba86);logger[_0x011f('0x8')]('UpdateMailApplication',_0xd4ba86,JSON[_0x011f('0x17')](_0x2a7443));_0xdb3343(_0x2a7443);})[_0x011f('0x18')](function(_0x4579bb){logger[_0x011f('0xa')]('UpdateMailApplication',_0x4579bb[_0x011f('0xd')],_0xd4ba86);_0x1289a7(_0x32fc67[_0x011f('0xa')](0x1f4,_0x4579bb[_0x011f('0xd')]));});});}; \ No newline at end of file +var _0x3678=['randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','util','bluebird'];(function(_0x2f302a,_0x216e97){var _0x5d16f2=function(_0x2cfc36){while(--_0x2cfc36){_0x2f302a['push'](_0x2f302a['shift']());}};_0x5d16f2(++_0x216e97);}(_0x3678,0x85));var _0x8367=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x3678[_0x234ce7];return _0x57c561;};'use strict';var _=require('lodash');var util=require(_0x8367('0x0'));var moment=require('moment');var BPromise=require(_0x8367('0x1'));var rs=require(_0x8367('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8367('0x3'));var logger=require('../../config/logger')(_0x8367('0x4'));var config=require(_0x8367('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8367('0x6')][_0x8367('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6d5a0e,_0x50dd49,_0x591505){return new BPromise(function(_0x56a5b9,_0x5b0599){return client[_0x8367('0x8')](_0x6d5a0e,_0x591505)[_0x8367('0x9')](function(_0x3b4857){logger['info'](_0x8367('0xa'),_0x50dd49,'request\x20sent');logger[_0x8367('0xb')](_0x8367('0xc'),_0x50dd49,_0x8367('0xd'),JSON[_0x8367('0xe')](_0x3b4857));if(_0x3b4857['error']){if(_0x3b4857[_0x8367('0xf')]['code']===0x1f4){logger[_0x8367('0xf')](_0x8367('0xa'),_0x50dd49,_0x3b4857[_0x8367('0xf')][_0x8367('0x10')]);return _0x5b0599(_0x3b4857[_0x8367('0xf')][_0x8367('0x10')]);}logger[_0x8367('0xf')](_0x8367('0xa'),_0x50dd49,_0x3b4857[_0x8367('0xf')][_0x8367('0x10')]);return _0x56a5b9(_0x3b4857[_0x8367('0xf')][_0x8367('0x10')]);}else{logger[_0x8367('0x11')]('MailApplication,\x20%s,\x20%s',_0x50dd49,'request\x20sent');_0x56a5b9(_0x3b4857[_0x8367('0x12')][_0x8367('0x10')]);}})[_0x8367('0x13')](function(_0x2579ca){logger[_0x8367('0xf')]('MailApplication,\x20%s,\x20%s',_0x50dd49,_0x2579ca);_0x5b0599(_0x2579ca);});});}exports[_0x8367('0x14')]=function(_0x52ad17){var _0x4b7372=this;return new Promise(function(_0xa5aa81,_0x2a6064){return db[_0x8367('0x15')]['update'](_0x52ad17[_0x8367('0x16')],{'raw':_0x52ad17[_0x8367('0x17')]?_0x52ad17[_0x8367('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ad17[_0x8367('0x17')]?_0x52ad17[_0x8367('0x17')][_0x8367('0x18')]||null:null,'attributes':_0x52ad17[_0x8367('0x17')]?_0x52ad17[_0x8367('0x17')][_0x8367('0x19')]||null:null,'limit':_0x52ad17['options']?_0x52ad17[_0x8367('0x17')][_0x8367('0x1a')]||null:null})[_0x8367('0x9')](function(_0x1fbf1c){logger[_0x8367('0x11')](_0x8367('0x14'),_0x52ad17);logger['debug'](_0x8367('0x14'),_0x52ad17,JSON['stringify'](_0x1fbf1c));_0xa5aa81(_0x1fbf1c);})[_0x8367('0x13')](function(_0x1bdedd){logger['error'](_0x8367('0x14'),_0x1bdedd[_0x8367('0x10')],_0x52ad17);_0x2a6064(_0x4b7372[_0x8367('0xf')](0x1f4,_0x1bdedd[_0x8367('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1e2f300..0a3c29f 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 _0xcf62=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf62,0x16e));var _0x2cf6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcf62[_0x4e676e];return _0x336a3c;};'use strict';var express=require(_0x2cf6('0x0'));var router=express[_0x2cf6('0x1')]();var auth=require(_0x2cf6('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x2cf6('0x3')]('/',auth[_0x2cf6('0x4')](),controller['index']);router[_0x2cf6('0x3')](_0x2cf6('0x5'),auth[_0x2cf6('0x4')](),controller[_0x2cf6('0x6')]);router[_0x2cf6('0x3')](_0x2cf6('0x7'),auth[_0x2cf6('0x4')](),controller[_0x2cf6('0x8')]);router['get'](_0x2cf6('0x9'),auth[_0x2cf6('0x4')](),controller[_0x2cf6('0xa')]);router[_0x2cf6('0x3')](_0x2cf6('0xb'),auth['isAuthenticated'](),controller[_0x2cf6('0xc')]);router[_0x2cf6('0xd')]('/',auth[_0x2cf6('0x4')](),controller[_0x2cf6('0xe')]);router[_0x2cf6('0xd')](_0x2cf6('0x9'),auth[_0x2cf6('0x4')](),controller[_0x2cf6('0xf')]);router[_0x2cf6('0xd')](_0x2cf6('0x10'),auth[_0x2cf6('0x4')](),interaction[_0x2cf6('0x11')]('mail',_0x2cf6('0x12')),controller[_0x2cf6('0x13')]);router[_0x2cf6('0x14')](_0x2cf6('0x7'),auth[_0x2cf6('0x4')](),interaction[_0x2cf6('0x11')]('mail',_0x2cf6('0x15')),controller[_0x2cf6('0x16')]);router[_0x2cf6('0x17')](_0x2cf6('0x7'),auth[_0x2cf6('0x4')](),interaction[_0x2cf6('0x11')](_0x2cf6('0x18'),_0x2cf6('0x19')),controller[_0x2cf6('0x1a')]);router[_0x2cf6('0x17')](_0x2cf6('0x10'),auth[_0x2cf6('0x4')](),controller[_0x2cf6('0x1b')]);module[_0x2cf6('0x1c')]=router; \ No newline at end of file +var _0x7dfa=['/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','exports','express','../../components/auth/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7dfa,0x98));var _0xa7df=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x7dfa[_0x5ebc04];return _0x17845c;};'use strict';var express=require(_0xa7df('0x0'));var router=express['Router']();var auth=require(_0xa7df('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0xa7df('0x2'));router[_0xa7df('0x3')]('/',auth['isAuthenticated'](),controller[_0xa7df('0x4')]);router['get'](_0xa7df('0x5'),auth[_0xa7df('0x6')](),controller[_0xa7df('0x7')]);router[_0xa7df('0x3')]('/:id',auth['isAuthenticated'](),controller[_0xa7df('0x8')]);router[_0xa7df('0x3')](_0xa7df('0x9'),auth[_0xa7df('0x6')](),controller[_0xa7df('0xa')]);router[_0xa7df('0x3')](_0xa7df('0xb'),auth['isAuthenticated'](),controller[_0xa7df('0xc')]);router[_0xa7df('0xd')]('/',auth[_0xa7df('0x6')](),controller[_0xa7df('0xe')]);router[_0xa7df('0xd')](_0xa7df('0x9'),auth[_0xa7df('0x6')](),controller[_0xa7df('0xf')]);router[_0xa7df('0xd')](_0xa7df('0x10'),auth['isAuthenticated'](),interaction[_0xa7df('0x11')](_0xa7df('0x12'),_0xa7df('0x13')),controller['addTags']);router[_0xa7df('0x14')]('/:id',auth[_0xa7df('0x6')](),interaction['tracked']('mail',_0xa7df('0x15')),controller[_0xa7df('0x16')]);router[_0xa7df('0x17')](_0xa7df('0x18'),auth[_0xa7df('0x6')](),interaction[_0xa7df('0x11')]('mail',_0xa7df('0x19')),controller[_0xa7df('0x1a')]);router[_0xa7df('0x17')](_0xa7df('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0xa7df('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index c12b98b..ad10286 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 _0x4b1f=['DATE','STRING','long','TEXT','out','sequelize','iconv','BOOLEAN'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4b1f,0x195));var _0xf4b1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b1f[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xf4b1('0x0'));var iconv=require(_0xf4b1('0x1'));module['exports']={'closed':{'type':Sequelize[_0xf4b1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf4b1('0x3')]},'disposition':{'type':Sequelize[_0xf4b1('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf4b1('0x4')]},'note':{'type':Sequelize[_0xf4b1('0x4')]},'inReplyTo':{'type':Sequelize[_0xf4b1('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xf4b1('0x5'))},'subject':{'type':Sequelize[_0xf4b1('0x6')]()},'attach':{'type':Sequelize[_0xf4b1('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf4b1('0x3')]},'substatus':{'type':Sequelize[_0xf4b1('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf4b1('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf4b1('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd10b=['iconv','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize'];(function(_0x4718c4,_0x522978){var _0x5f58a3=function(_0x1cd83c){while(--_0x1cd83c){_0x4718c4['push'](_0x4718c4['shift']());}};_0x5f58a3(++_0x522978);}(_0xd10b,0xd7));var _0xbd10=function(_0xa65ae8,_0x29dda7){_0xa65ae8=_0xa65ae8-0x0;var _0x200dd6=_0xd10b[_0xa65ae8];return _0x200dd6;};'use strict';var Sequelize=require(_0xbd10('0x0'));var iconv=require(_0xbd10('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbd10('0x2')]},'disposition':{'type':Sequelize[_0xbd10('0x3')]},'secondDisposition':{'type':Sequelize[_0xbd10('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbd10('0x3')]},'note':{'type':Sequelize[_0xbd10('0x3')]},'inReplyTo':{'type':Sequelize[_0xbd10('0x3')](0x1fe)},'to':{'type':Sequelize[_0xbd10('0x3')]},'cc':{'type':Sequelize[_0xbd10('0x4')](_0xbd10('0x5'))},'subject':{'type':Sequelize[_0xbd10('0x4')]()},'attach':{'type':Sequelize[_0xbd10('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbd10('0x2')]},'substatus':{'type':Sequelize[_0xbd10('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xbd10('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbd10('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbd10('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbd10('0x7')]('in',_0xbd10('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index bef1f23..61c3ac1 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 _0x6809=['../../components/parsers/qs','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','update','then','destroy','error','stack','send','Users','map','Tags','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','-id','catch','waiting','talking','closed','UserId','unmanaged','total','index','MailInteraction','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','start','some','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','rawAttributes','format','findAll','inlineCss','true','spread','removeTags','unix','join','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','mkdirSync','decode','headers','bcc','existsSync','build','writeFileSync','message%d.eml','eml-format','rimraf','moment','util','squel','juice','ioredis'];(function(_0x31c2c5,_0x47082c){var _0x471da4=function(_0x1c377a){while(--_0x1c377a){_0x31c2c5['push'](_0x31c2c5['shift']());}};_0x471da4(++_0x47082c);}(_0x6809,0xd7));var _0x9680=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0x6809[_0x493a51];return _0xc85756;};'use strict';var emlformat=require(_0x9680('0x0'));var rimraf=require(_0x9680('0x1'));var zipdir=require('zip-dir');var moment=require(_0x9680('0x2'));var BPromise=require('bluebird');var util=require(_0x9680('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x9680('0x4'));var juice=require(_0x9680('0x5'));var Redis=require(_0x9680('0x6'));var qs=require(_0x9680('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x9680('0x8'));var config=require('../../config/environment');var db=require(_0x9680('0x9'))['db'];var htmlEntities=require(_0x9680('0xa'));config[_0x9680('0xb')]=_['defaults'](config['redis'],{'host':_0x9680('0xc'),'port':0x18eb});var socket=require(_0x9680('0xd'))(new Redis(config[_0x9680('0xb')]));require(_0x9680('0xe'))[_0x9680('0xf')](socket);function respondWithStatusCode(_0xce357e,_0xb2db3c){_0xb2db3c=_0xb2db3c||0xcc;return function(_0x4d1687){if(_0x4d1687){return _0xce357e[_0x9680('0x10')](_0xb2db3c);}return _0xce357e[_0x9680('0x11')](_0xb2db3c)[_0x9680('0x12')]();};}function respondWithResult(_0x1c1856,_0x58583f){_0x58583f=_0x58583f||0xc8;return function(_0x3c3f31){if(_0x3c3f31){return _0x1c1856[_0x9680('0x11')](_0x58583f)[_0x9680('0x13')](_0x3c3f31);}};}function respondWithFilteredResult(_0x425605,_0x4ffe7e){return function(_0x2927df){if(_0x2927df){var _0x204b64=typeof _0x4ffe7e[_0x9680('0x14')]===_0x9680('0x15')&&typeof _0x4ffe7e['limit']==='undefined';var _0x1601d9=_0x2927df[_0x9680('0x16')];var _0x2981cf=_0x204b64?0x0:_0x4ffe7e['offset'];var _0x4506b9=_0x204b64?_0x2927df['count']:_0x4ffe7e['offset']+_0x4ffe7e['limit'];var _0x3382a0;if(_0x4506b9>=_0x1601d9){_0x4506b9=_0x1601d9;_0x3382a0=0xc8;}else{_0x3382a0=0xce;}_0x425605[_0x9680('0x11')](_0x3382a0);return _0x425605['set']('Content-Range',_0x2981cf+'-'+_0x4506b9+'/'+_0x1601d9)['json'](_0x2927df);}return null;};}function saveUpdates(_0x3410b2){return function(_0x5a5766){if(_0x5a5766){return _0x5a5766[_0x9680('0x17')](_0x3410b2)[_0x9680('0x18')](function(_0x8e735f){return _0x8e735f;});}return null;};}function removeEntity(_0x5c6c8c){return function(_0x564a03){if(_0x564a03){return _0x564a03[_0x9680('0x19')]()[_0x9680('0x18')](function(){_0x5c6c8c[_0x9680('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22b44c){return function(_0x3ad917){if(!_0x3ad917){_0x22b44c[_0x9680('0x10')](0x194);}return _0x3ad917;};}function handleError(_0x424d8f,_0x286d0d){_0x286d0d=_0x286d0d||0x1f4;return function(_0x27de7e){logger[_0x9680('0x1a')](_0x27de7e[_0x9680('0x1b')]);if(_0x27de7e['name']){delete _0x27de7e['name'];}_0x424d8f[_0x9680('0x11')](_0x286d0d)[_0x9680('0x1c')](_0x27de7e);};}function getInteractionUsers(_0x4bb9c7,_0x252047){return new BPromise(function(_0x4db4ff,_0x563610){try{if(_0x252047[_0x4bb9c7['id']]){_0x4bb9c7[_0x9680('0x1d')]=_[_0x9680('0x1e')](_0x252047[_0x4bb9c7['id']],function(_0x2fa5ab){return{'id':_0x2fa5ab['id'],'fullname':_0x2fa5ab['fullname']};});}}catch(_0x873fef){_0x563610(_0x873fef);}_0x4db4ff(_0x4bb9c7);});}function getInteractionTags(_0x413347,_0x4aa5d8){return new BPromise(function(_0x18f4b5,_0x22a58b){try{if(_0x413347['TagIds']){_0x413347[_0x9680('0x1f')]=[];_0x413347[_0x9680('0x20')][_0x9680('0x21')](',')[_0x9680('0x22')](function(_0x52bf7a){_0x413347['Tags'][_0x9680('0x23')](_0x4aa5d8[_0x52bf7a]);});}delete _0x413347[_0x9680('0x20')];}catch(_0x5bf778){_0x22a58b(_0x5bf778);}_0x18f4b5(_0x413347);});}function getLastMessageText(_0xf32a14){return new BPromise(function(_0x42694f,_0x5a7ed0){return db[_0x9680('0x24')][_0x9680('0x25')]({'where':{'$and':[{'MailInteractionId':_0xf32a14['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9680('0x26')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9680('0x27')],'order':_0x9680('0x28'),'raw':!![]})['then'](function(_0x2dc751){if(_0x2dc751&&_0x2dc751[_0x9680('0x27')]){_0xf32a14['lastMsgText']=_['trimStart'](_0x2dc751[_0x9680('0x27')]);}_0x42694f(_0xf32a14);})[_0x9680('0x29')](function(_0x1857fe){_0x5a7ed0(_0x1857fe);});});}function updateMailInteraction(_0x381aaa,_0x2658af,_0x4c8a2e,_0xe319d8){return new BPromise(function(_0x4679a3,_0x5584a7){return getInteractionUsers(_0x381aaa,_0x4c8a2e)[_0x9680('0x18')](function(_0x1bd1e7){return getInteractionTags(_0x1bd1e7,_0x2658af);})[_0x9680('0x18')](function(_0xdbe86a){return getStateInteraction(_0xdbe86a);})[_0x9680('0x18')](function(_0x319f03){if(_0xe319d8){_0x4679a3(getLastMessageText(_0x319f03));}else{_0x4679a3(_0x319f03);}})['catch'](function(_0x5aaac3){_0x5584a7(_0x5aaac3);});});}function getStateInteraction(_0xa2e490){return new BPromise(function(_0x2bc9b5){_0xa2e490[_0x9680('0x2a')]=0x0;_0xa2e490[_0x9680('0x2b')]=0x0;_0xa2e490['answered']=0x0;_0xa2e490['unmanaged']=0x0;_0xa2e490['total']=0x0;if(!_0xa2e490[_0x9680('0x2c')]&&!_0xa2e490[_0x9680('0x2d')]){_0xa2e490[_0x9680('0x2a')]+=0x1;}if(!_0xa2e490[_0x9680('0x2c')]&&_0xa2e490['UserId']){_0xa2e490['talking']+=0x1;if(_0xa2e490[_0x9680('0x2a')]){_0xa2e490[_0x9680('0x2a')]-=0x1;}}if(_0xa2e490['closed']&&_0xa2e490[_0x9680('0x2d')]){_0xa2e490['answered']+=0x1;if(_0xa2e490['talking']){_0xa2e490['talking']-=0x1;}}if(_0xa2e490[_0x9680('0x2c')]&&!_0xa2e490['UserId']){_0xa2e490[_0x9680('0x2e')]+=0x1;if(_0xa2e490[_0x9680('0x2a')]){_0xa2e490[_0x9680('0x2a')]-=0x1;}}_0xa2e490[_0x9680('0x2f')]+=0x1;_0x2bc9b5(_0xa2e490);});}exports[_0x9680('0x30')]=function(_0x44a794,_0x32b9f9){var _0x516e9b={},_0x204aac={},_0x38dec3={'count':0x0,'rows':[]};var _0x173700=_['map'](db[_0x9680('0x31')]['rawAttributes'],function(_0x42dade){return{'name':_0x42dade[_0x9680('0x32')],'type':_0x42dade[_0x9680('0x33')][_0x9680('0x34')]};});_0x204aac[_0x9680('0x35')]=_[_0x9680('0x1e')](_0x173700,_0x9680('0x36'));_0x204aac['query']=_[_0x9680('0x37')](_0x44a794[_0x9680('0x38')]);_0x204aac[_0x9680('0x39')]=_[_0x9680('0x3a')](_0x204aac[_0x9680('0x35')],_0x204aac[_0x9680('0x38')]);_0x516e9b['attributes']=_[_0x9680('0x3a')](_0x204aac['model'],qs[_0x9680('0x3b')](_0x44a794[_0x9680('0x38')]['fields']));_0x516e9b[_0x9680('0x3c')]=_0x516e9b[_0x9680('0x3c')][_0x9680('0x3d')]?_0x516e9b[_0x9680('0x3c')]:_0x204aac['model'];if(!_0x44a794[_0x9680('0x38')][_0x9680('0x3e')](_0x9680('0x3f'))){_0x516e9b['limit']=qs[_0x9680('0x40')](_0x44a794[_0x9680('0x38')][_0x9680('0x40')]);_0x516e9b[_0x9680('0x14')]=qs[_0x9680('0x14')](_0x44a794[_0x9680('0x38')][_0x9680('0x14')]);}_0x516e9b[_0x9680('0x41')]=qs[_0x9680('0x42')](_0x44a794[_0x9680('0x38')]['sort']);_0x516e9b['where']=qs[_0x9680('0x39')](_[_0x9680('0x43')](_0x44a794['query'],_0x204aac[_0x9680('0x39')]),_0x173700);var _0x22aa77=[];var _0x4f6361=squel[_0x9680('0x44')]()[_0x9680('0x45')]('id')[_0x9680('0x45')]('name')[_0x9680('0x45')](_0x9680('0x46'))[_0x9680('0x47')](_0x9680('0x48'));var _0x38e033=squel[_0x9680('0x44')]()[_0x9680('0x45')](_0x9680('0x49'))[_0x9680('0x45')](_0x9680('0x4a'))[_0x9680('0x45')](_0x9680('0x4b'))[_0x9680('0x47')]('user_has_mail_interactions','ui')[_0x9680('0x4c')](_0x9680('0x4d'),'u',_0x9680('0x4e'));var _0x21e65c=squel[_0x9680('0x44')]()[_0x9680('0x47')](_0x9680('0x4f'),'i')[_0x9680('0x4c')]('cm_contacts','c',_0x9680('0x50'))[_0x9680('0x4c')](_0x9680('0x4d'),'o',_0x9680('0x51'))['left_join'](_0x9680('0x52'),'a',_0x9680('0x53'))['left_join'](_0x9680('0x54'),'me','me.MailInteractionId\x20=\x20i.id')[_0x9680('0x4c')](_0x9680('0x55'),'it',_0x9680('0x56'))[_0x9680('0x4c')](_0x9680('0x48'),'t',_0x9680('0x57'));var _0xec974b=squel[_0x9680('0x58')]();var _0x334161=[];var _0x21fb9b=squel[_0x9680('0x58')]();var _0x105bf6;if(_0x44a794[_0x9680('0x38')][_0x9680('0x59')]){_0x105bf6=as[_0x9680('0x5a')](_0x44a794['query']['search']);var _0x6ac164=_0x105bf6[_0x9680('0x5b')];for(var _0x2420dc=0x0;_0x2420dc<_0x105bf6[_0x9680('0x5c')][_0x9680('0x3d')];_0x2420dc++){var _0xbfe5bc=_0x105bf6[_0x9680('0x5c')][_0x2420dc];var _0x496d3e='i';var _0x305d8a=_['find'](_0x173700,[_0x9680('0x36'),_0xbfe5bc[_0x9680('0x45')]]);if(!_0x305d8a){switch(_0xbfe5bc['field']){case _0x9680('0x5d'):if(_0xbfe5bc[_0x9680('0x5e')]==0x1){_0x21e65c[_0x9680('0x5f')]('`'+_0xbfe5bc[_0x9680('0x45')]+'`\x20=\x200');}else{_0x21e65c[_0x9680('0x5f')]('`'+_0xbfe5bc[_0x9680('0x45')]+_0x9680('0x60'));}break;case _0x9680('0x61'):if(_0xbfe5bc[_0x9680('0x62')]===_0x9680('0x63')){if(_0xbfe5bc[_0x9680('0x5e')][_0x9680('0x21')]('\x20')['length']>0x1){_0xec974b[_0x6ac164]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9680('0x64')](_0xbfe5bc[_0x9680('0x5e')]),null);}else{var _0x32c650='%'+_0xbfe5bc['value']+'%';_0xec974b[_0x6ac164](_0x9680('0x65'),_0x32c650,_0x32c650,_0x32c650);}}else{_0x305d8a=_[_0x9680('0x66')](_0x173700,[_0x9680('0x36'),_0x9680('0x67')]);_0xbfe5bc[_0x9680('0x45')]='ContactId';_0x364dea=as['buildExpression'](_0x496d3e,_0x305d8a[_0x9680('0x33')],_0xbfe5bc);_0xec974b[_0x6ac164](_0x364dea['text'],_0x364dea['value']['start'],_0x364dea[_0x9680('0x5e')]['end']);}break;case _0x9680('0x68'):var _0x4fdd14=_0xbfe5bc['value'][_0x9680('0x21')](',')['map'](function(_0x5b6588){return Number(_0x5b6588);});_0x4fdd14[_0x9680('0x22')](function(_0x470f28){_0x21fb9b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x470f28+',%');});_0x334161=_['union'](_0x334161,_0x4fdd14);break;case _0x9680('0x69'):if(_0xbfe5bc[_0x9680('0x62')]===_0x9680('0x63')){_0xec974b[_0x6ac164](_0x9680('0x6a'),'%'+_0xbfe5bc['value']+'%',null);}else{_0x305d8a=_[_0x9680('0x66')](_0x173700,[_0x9680('0x36'),'UserId']);_0xbfe5bc[_0x9680('0x45')]=_0x9680('0x2d');_0x364dea=as[_0x9680('0x6b')](_0x496d3e,_0x305d8a[_0x9680('0x33')],_0xbfe5bc);_0xec974b[_0x6ac164](_0x364dea[_0x9680('0x6c')],_0x364dea[_0x9680('0x5e')]['start'],_0x364dea['value']['end']);}break;case _0x9680('0x27'):_0x364dea=as[_0x9680('0x6b')]('me',null,_0xbfe5bc);_0xec974b[_0x6ac164](_0x364dea[_0x9680('0x6c')],_0x364dea[_0x9680('0x5e')][_0x9680('0x6d')],_0x364dea[_0x9680('0x5e')][_0x9680('0x12')]);break;}}else{var _0x364dea=as[_0x9680('0x6b')](_0x496d3e,_0x305d8a[_0x9680('0x33')],_0xbfe5bc);_0xec974b[_0x6ac164](_0x364dea[_0x9680('0x6c')],_0x364dea['value'][_0x9680('0x6d')],_0x364dea[_0x9680('0x5e')][_0x9680('0x12')]);}}}else{var _0x41471b=_(_0x44a794[_0x9680('0x38')])[_0x9680('0x37')]()[_0x9680('0x1e')](function(_0x4dfe60){return _[_0x9680('0x6e')](_0x173700,['name',_0x4dfe60])?_0x4dfe60:undefined;})[_0x9680('0x6f')]()[_0x9680('0x5e')]();if(!_[_0x9680('0x70')](_0x41471b)){_0x41471b['forEach'](function(_0xb49acd){if(_0xb49acd==='MailAccountId'){_0x21e65c[_0x9680('0x71')](_0x9680('0x72'),[]['concat'](_0x44a794[_0x9680('0x38')][_0xb49acd]));}else if(_0xb49acd===_0x9680('0x73')){var _0x5d8ded=JSON['parse'](_0x44a794[_0x9680('0x38')][_0xb49acd])[_0x9680('0x74')];var _0x4bcbab=JSON['parse'](_0x44a794['query'][_0xb49acd])[_0x9680('0x75')];_0x21e65c[_0x9680('0x71')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5d8ded,_0x4bcbab);}else{if(_0x44a794[_0x9680('0x38')][_0xb49acd]===_0x9680('0x76')){_0x21e65c[_0x9680('0x71')]('i.'+_0xb49acd+_0x9680('0x77'));}else{_0x21e65c[_0x9680('0x71')]('i.'+_0xb49acd+_0x9680('0x78'),_0x44a794[_0x9680('0x38')][_0xb49acd]);}}});}if(_0x44a794[_0x9680('0x38')][_0x9680('0x79')]){if(_0x44a794[_0x9680('0x38')]['read']==0x1){_0x21e65c['having'](_0x9680('0x7a'));}else{_0x21e65c[_0x9680('0x5f')](_0x9680('0x7b'));}}if(_0x44a794['query']['tag']){_0x334161=_['isArray'](_0x44a794[_0x9680('0x38')][_0x9680('0x7c')])?_0x44a794['query']['tag']:new Array(_0x44a794[_0x9680('0x38')]['tag']);_0x334161[_0x9680('0x22')](function(_0xf59872){_0x21fb9b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf59872+',%');});}if(_0x44a794['query']['filter']){var _0x4eb6ee=_0x44a794['query'][_0x9680('0x7d')][_0x9680('0x7e')]('\x5c','\x5c\x5c')[_0x9680('0x7e')](/'/g,'\x27\x27');if(qs[_0x9680('0x7f')](_0x4eb6ee)){_0xec974b['or']('i.id\x20LIKE\x20?',_0x4eb6ee+'%');}else if(qs[_0x9680('0x80')](_0x4eb6ee)){_0xec974b['or'](_0x9680('0x81'),_0x4eb6ee+'%');}else{_0xec974b['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9680('0x64')](_0x4eb6ee))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9680('0x64')](_0x4eb6ee));}}}_0x21e65c[_0x9680('0x71')](_0xec974b);_0x21e65c[_0x9680('0x82')]('i.id');var _0x4238d5={'type':db[_0x9680('0x83')][_0x9680('0x84')][_0x9680('0x85')],'raw':!![]};var _0x591a4b=_0x21e65c[_0x9680('0x86')]();_0x591a4b['field'](_0x9680('0x87'));_0x591a4b['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9680('0x5d'));if(_0x516e9b[_0x9680('0x41')]){_0x516e9b['order'][_0x9680('0x22')](function(_0x21886c){var _0x117d2c=_0x21886c[0x0]===_0x9680('0x88')?_0x21886c[0x0]:'i.'+_0x21886c[0x0];_0x21e65c[_0x9680('0x41')](_0x117d2c,_0x21886c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9680('0x70')](_0x334161)){_0x21e65c[_0x9680('0x5f')](_0x21fb9b);_0x591a4b[_0x9680('0x71')](_0x9680('0x89'),_0x334161);}BPromise[_0x9680('0x8a')]()[_0x9680('0x18')](function(){if(!_0x105bf6){if(_0x44a794[_0x9680('0x38')][_0x9680('0x8b')])return;_0x591a4b[_0x9680('0x71')](_0x9680('0x8c'));_0x21e65c[_0x9680('0x71')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x44a794[_0x9680('0x8d')][_0x9680('0x8e')]!=='agent')return;return _0x44a794[_0x9680('0x8d')][_0x9680('0x8f')]({'attributes':['id'],'raw':!![]})[_0x9680('0x18')](function(_0x44bf40){if(_[_0x9680('0x70')](_0x44bf40)){_0x591a4b[_0x9680('0x71')](_0x9680('0x90'));_0x21e65c[_0x9680('0x71')](_0x9680('0x90'));}else{_0x591a4b[_0x9680('0x71')]('i.MailAccountId\x20IN\x20?',_[_0x9680('0x1e')](_0x44bf40,'id'));_0x21e65c[_0x9680('0x71')](_0x9680('0x72'),_[_0x9680('0x1e')](_0x44bf40,'id'));}});})['then'](function(){if(_0x44a794[_0x9680('0x8d')]['role']==='agent'&&!_0x105bf6&&!_0x44a794[_0x9680('0x38')][_0x9680('0x8b')])return[];return db[_0x9680('0x91')]['query'](_0x591a4b[_0x9680('0x92')](),_0x4238d5);})['then'](function(_0x4cc3e6){_0x38dec3[_0x9680('0x16')]=_0x4cc3e6['length'];if(_0x38dec3[_0x9680('0x16')]===0x0)return[];return db[_0x9680('0x91')][_0x9680('0x38')](_0x4f6361[_0x9680('0x92')](),_0x4238d5)[_0x9680('0x18')](function(_0x56546a){_0x22aa77=_[_0x9680('0x93')](_0x56546a,'id');_0x4238d5=_[_0x9680('0x94')](_0x4238d5,{'model':db[_0x9680('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44a794['query']['fields']){_0x516e9b[_0x9680('0x3c')][_0x9680('0x22')](function(_0x1b889a){_0x21e65c[_0x9680('0x45')]('i.'+_0x1b889a);});}else{_0x21e65c[_0x9680('0x45')](_0x9680('0x95'),'unreadMessages');_0x21e65c[_0x9680('0x45')](_0x9680('0x96'),'Account.key');_0x21e65c[_0x9680('0x45')](_0x9680('0x97'),_0x9680('0x98'));_0x21e65c[_0x9680('0x45')](_0x9680('0x99'),_0x9680('0x88'));_0x21e65c[_0x9680('0x45')](_0x9680('0x87'));_0x21e65c[_0x9680('0x45')](_0x9680('0x9a'));_0x21e65c[_0x9680('0x45')]('i.updatedAt');_0x21e65c[_0x9680('0x45')]('i.closed');_0x21e65c['field'](_0x9680('0x9b'));_0x21e65c[_0x9680('0x45')]('i.attach');_0x21e65c[_0x9680('0x45')](_0x9680('0x9c'));_0x21e65c[_0x9680('0x45')](_0x9680('0x9d'));_0x21e65c[_0x9680('0x45')]('i.subject');_0x21e65c[_0x9680('0x45')](_0x9680('0x9e'));_0x21e65c[_0x9680('0x45')](_0x9680('0x9f'));_0x21e65c[_0x9680('0x45')](_0x9680('0xa0'));_0x21e65c[_0x9680('0x45')](_0x9680('0xa1'));_0x21e65c['field'](_0x9680('0xa2'));_0x21e65c[_0x9680('0x45')](_0x9680('0xa3'));_0x21e65c[_0x9680('0x45')](_0x9680('0xa4'));_0x21e65c[_0x9680('0x45')](_0x9680('0xa5'));_0x21e65c['field'](_0x9680('0xa6'),_0x9680('0xa7'));_0x21e65c['field'](_0x9680('0xa8'),_0x9680('0xa9'));_0x21e65c[_0x9680('0x45')]('c.email',_0x9680('0xaa'));_0x21e65c[_0x9680('0x45')](_0x9680('0xab'),_0x9680('0xac'));_0x21e65c[_0x9680('0x45')]('c.mobile',_0x9680('0xad'));_0x21e65c['field'](_0x9680('0xae'),_0x9680('0xaf'));_0x21e65c[_0x9680('0x45')](_0x9680('0xb0'),'Owner.fullname');_0x21e65c[_0x9680('0x45')](_0x9680('0xb1'),'Owner.internal');_0x21e65c['field'](_0x9680('0xb2'),'TagIds');}if(_0x516e9b[_0x9680('0x40')])_0x21e65c[_0x9680('0x40')](_0x516e9b[_0x9680('0x40')]);if(_0x516e9b[_0x9680('0x14')])_0x21e65c[_0x9680('0x14')](_0x516e9b[_0x9680('0x14')]);return db[_0x9680('0x91')][_0x9680('0x38')](_0x21e65c['toString'](),_0x4238d5);})[_0x9680('0x18')](function(_0x11f379){if(_0x11f379['length']>0x0)_0x38e033[_0x9680('0x71')](_0x9680('0xb3'),_[_0x9680('0x1e')](_0x11f379,'id'));return db[_0x9680('0x91')]['query'](_0x38e033[_0x9680('0x92')](),_0x4238d5)['then'](function(_0x4f42ae){var _0x3ca1aa=_['groupBy'](_0x4f42ae,_0x9680('0xb4'));var _0xcd2a08=[];return db[_0x9680('0xb5')][_0x9680('0x25')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x9680('0x18')](function(_0x1d5437){var _0x3b8421=_0x1d5437[_0x9680('0xb6')];_0x11f379[_0x9680('0x22')](function(_0x25907c){_0xcd2a08[_0x9680('0x23')](updateMailInteraction(_0x25907c,_0x22aa77,_0x3ca1aa,_0x3b8421));});return BPromise[_0x9680('0xb7')](_0xcd2a08);});});});})[_0x9680('0x18')](function(_0x561a85){_0x38dec3[_0x9680('0xb8')]=_0x561a85;return _0x38dec3;})[_0x9680('0x18')](respondWithFilteredResult(_0x32b9f9,_0x516e9b))['catch'](handleError(_0x32b9f9,null));};exports[_0x9680('0xb9')]=function(_0x368175,_0x44cf06){var _0x5f299d={'raw':![],'where':{'id':_0x368175[_0x9680('0xba')]['id']}},_0x9add73={};_0x9add73['model']=_[_0x9680('0x37')](db[_0x9680('0x31')]['rawAttributes']);_0x9add73[_0x9680('0x38')]=_['keys'](_0x368175['query']);_0x9add73[_0x9680('0x39')]=_[_0x9680('0x3a')](_0x9add73[_0x9680('0x35')],_0x9add73[_0x9680('0x38')]);_0x5f299d['attributes']=_['intersection'](_0x9add73['model'],qs[_0x9680('0x3b')](_0x368175['query'][_0x9680('0x3b')]));_0x5f299d[_0x9680('0x3c')]=_0x5f299d[_0x9680('0x3c')][_0x9680('0x3d')]?_0x5f299d[_0x9680('0x3c')]:_0x9add73['model'];if(_0x368175['query'][_0x9680('0xbb')]){_0x5f299d[_0x9680('0xbc')]=[{'all':!![]}];}_0x5f299d=_[_0x9680('0x94')]({},_0x5f299d,_0x368175[_0x9680('0xbd')]);return db[_0x9680('0x31')]['find'](_0x5f299d)[_0x9680('0x18')](handleEntityNotFound(_0x44cf06,null))[_0x9680('0x18')](respondWithResult(_0x44cf06,null))['catch'](handleError(_0x44cf06,null));};exports[_0x9680('0xbe')]=function(_0x5c0aad,_0x1f24ae){return db[_0x9680('0x31')][_0x9680('0xbe')](_0x5c0aad['body'],{})[_0x9680('0x18')](respondWithResult(_0x1f24ae,0xc9))[_0x9680('0x29')](handleError(_0x1f24ae,null));};exports[_0x9680('0x17')]=function(_0x46c6b1,_0x5d6d71){if(_0x46c6b1[_0x9680('0xbf')]['id']){delete _0x46c6b1['body']['id'];}return db[_0x9680('0x31')][_0x9680('0x66')]({'where':{'id':_0x46c6b1[_0x9680('0xba')]['id']}})['then'](handleEntityNotFound(_0x5d6d71,null))[_0x9680('0x18')](saveUpdates(_0x46c6b1['body'],null))[_0x9680('0x18')](respondWithResult(_0x5d6d71,null))['catch'](handleError(_0x5d6d71,null));};exports[_0x9680('0x19')]=function(_0x582919,_0x3388bc){return db[_0x9680('0x31')][_0x9680('0x66')]({'where':{'id':_0x582919['params']['id']}})['then'](handleEntityNotFound(_0x3388bc,null))[_0x9680('0x18')](removeEntity(_0x3388bc,null))['catch'](handleError(_0x3388bc,null));};exports[_0x9680('0xc0')]=function(_0x58d24b,_0x4c8ba1){return db[_0x9680('0x31')][_0x9680('0xc0')]()['then'](respondWithResult(_0x4c8ba1,null))[_0x9680('0x29')](handleError(_0x4c8ba1,null));};exports['addMessage']=function(_0x5b0456,_0x17de9e){return db[_0x9680('0x24')][_0x9680('0x66')]({'where':{'id':_0x5b0456[_0x9680('0xba')]['id']}})['then'](handleEntityNotFound(_0x17de9e,null))[_0x9680('0x18')](function(_0x2f29ad){if(_0x2f29ad){return _0x2f29ad[_0x9680('0xc1')](_0x5b0456[_0x9680('0xbf')]['ids'],_[_0x9680('0xc2')](_0x5b0456[_0x9680('0xbf')],[_0x9680('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x17de9e,null))[_0x9680('0x29')](handleError(_0x17de9e,null));};exports['getMessages']=function(_0x5d576f,_0x4a23d3){var _0x31076a={'raw':![],'where':{}};var _0x52b5d1={};var _0x151b18={'count':0x0,'rows':[]};return db[_0x9680('0x31')]['findOne']({'where':{'id':_0x5d576f[_0x9680('0xba')]['id']}})[_0x9680('0x18')](handleEntityNotFound(_0x4a23d3,null))[_0x9680('0x18')](function(_0x192706){if(_0x192706){_0x52b5d1[_0x9680('0x35')]=_[_0x9680('0x37')](db[_0x9680('0x24')][_0x9680('0xc4')]);_0x52b5d1[_0x9680('0x38')]=_['keys'](_0x5d576f[_0x9680('0x38')]);_0x52b5d1['filters']=_[_0x9680('0x3a')](_0x52b5d1[_0x9680('0x35')],_0x52b5d1[_0x9680('0x38')]);_0x31076a[_0x9680('0x3c')]=_[_0x9680('0x3a')](_0x52b5d1[_0x9680('0x35')],qs[_0x9680('0x3b')](_0x5d576f[_0x9680('0x38')]['fields']));_0x31076a[_0x9680('0x3c')]=_0x31076a[_0x9680('0x3c')][_0x9680('0x3d')]?_0x31076a[_0x9680('0x3c')]:_0x52b5d1[_0x9680('0x35')];if(!_0x5d576f[_0x9680('0x38')][_0x9680('0x3e')](_0x9680('0x3f'))){_0x31076a[_0x9680('0x40')]=qs['limit'](_0x5d576f[_0x9680('0x38')][_0x9680('0x40')]);_0x31076a[_0x9680('0x14')]=qs[_0x9680('0x14')](_0x5d576f[_0x9680('0x38')][_0x9680('0x14')]);}_0x31076a['order']=qs['sort'](_0x5d576f[_0x9680('0x38')]['sort']);_0x31076a[_0x9680('0x71')]=qs[_0x9680('0x39')](_[_0x9680('0x43')](_0x5d576f[_0x9680('0x38')],_0x52b5d1['filters']));_0x31076a[_0x9680('0x71')]['MailInteractionId']=_0x192706['id'];if(_0x5d576f['query'][_0x9680('0x7d')]){_0x31076a[_0x9680('0x71')]=_[_0x9680('0x94')](_0x31076a['where'],{'$or':_[_0x9680('0x1e')](_0x31076a['attributes'],function(_0x23c236){var _0x7e4342={};_0x7e4342[_0x23c236]={'$like':'%'+_0x5d576f[_0x9680('0x38')][_0x9680('0x7d')]+'%'};return _0x7e4342;})});}if(_0x5d576f[_0x9680('0x38')][_0x9680('0x74')]){var _0x559543=_0x5d576f[_0x9680('0x38')][_0x9680('0x74')][_0x9680('0x21')](',');var _0xc82809={};_0xc82809[_0x559543[0x0]]={'$gte':moment(_0x559543[0x1])[_0x9680('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x31076a[_0x9680('0x71')]=_[_0x9680('0x94')](_0x31076a['where'],_0xc82809);}_0x31076a=_['merge']({},_0x31076a,_0x5d576f[_0x9680('0xbd')]);return db[_0x9680('0x24')][_0x9680('0x16')]({'where':_0x31076a[_0x9680('0x71')]})['then'](function(_0x1ac711){_0x151b18['count']=_0x1ac711;if(_0x5d576f[_0x9680('0x38')][_0x9680('0xbb')]){_0x31076a['include']=[{'all':!![]}];}return db[_0x9680('0x24')][_0x9680('0xc6')](_0x31076a);})[_0x9680('0x18')](function(_0x5cf532){if(_0x5d576f['query'][_0x9680('0xc7')]===_0x9680('0xc8')){for(var _0x5d3438=0x0;_0x5d3438<_0x5cf532[_0x9680('0x3d')];_0x5d3438++){_0x5cf532[_0x5d3438][_0x9680('0xbf')]=juice(_0x5cf532[_0x5d3438]['body']);}}_0x151b18[_0x9680('0xb8')]=_0x5cf532;return _0x151b18;});}})[_0x9680('0x18')](respondWithFilteredResult(_0x4a23d3,_0x31076a))['catch'](handleError(_0x4a23d3,null));};exports['addTags']=function(_0x1d60e2,_0x340e37){return db[_0x9680('0x31')][_0x9680('0x66')]({'where':{'id':_0x1d60e2[_0x9680('0xba')]['id']}})[_0x9680('0x18')](handleEntityNotFound(_0x340e37,null))[_0x9680('0x18')](function(_0x3bcbe5){if(_0x3bcbe5){return _0x3bcbe5['setTags'](_0x1d60e2['body'][_0x9680('0xc3')],_['omit'](_0x1d60e2[_0x9680('0xbf')],['ids','id'])||{})[_0x9680('0xc9')](function(){return db[_0x9680('0x68')]['findAll']({'attributes':['id',_0x9680('0x36'),_0x9680('0x46')],'where':{'id':_0x1d60e2['body'][_0x9680('0xc3')]}});})['then'](function(_0x5e19a7){socket['emit']('mailInteractionTags:save',{'id':Number(_0x1d60e2[_0x9680('0xba')]['id']),'tags':_0x5e19a7||[]});return{'id':Number(_0x1d60e2[_0x9680('0xba')]['id']),'tags':_0x5e19a7||[]};});}})[_0x9680('0x18')](respondWithResult(_0x340e37,null))[_0x9680('0x29')](handleError(_0x340e37,null));};exports['removeTags']=function(_0x2147ff,_0x5dc781){return db[_0x9680('0x31')][_0x9680('0x66')]({'where':{'id':_0x2147ff[_0x9680('0xba')]['id']}})['then'](handleEntityNotFound(_0x5dc781,null))[_0x9680('0x18')](function(_0x2a1965){if(_0x2a1965){return _0x2a1965[_0x9680('0xca')](_0x2147ff['query'][_0x9680('0xc3')]);}})['then'](respondWithStatusCode(_0x5dc781,null))['catch'](handleError(_0x5dc781,null));};exports['download']=function(_0x25a709,_0x1366c0){var _0x26d0e7=moment()[_0x9680('0xcb')]()[_0x9680('0x92')]();var _0x359d2d=path[_0x9680('0xcc')](config['root'],_0x9680('0xcd'),_0x9680('0xce'),'tmp');var _0x5128b5=path[_0x9680('0xcc')](config['root'],_0x9680('0xcd'),_0x9680('0xce'),_0x9680('0xcf'));var _0x58e7af=path[_0x9680('0xcc')](_0x359d2d,_0x26d0e7);var _0x2d36c4=util[_0x9680('0xc5')](_0x9680('0xd0'),_0x25a709[_0x9680('0xba')]['id'],_0x26d0e7);var _0x42b70a=path[_0x9680('0xcc')](_0x359d2d,_0x2d36c4);var _0x557f37=[];if(_0x25a709[_0x9680('0x38')]['attachments']){_0x557f37[_0x9680('0x23')]({'model':db[_0x9680('0xd1')],'as':_0x9680('0xd2'),'raw':!![]});}var _0x1845d7=[{'model':db[_0x9680('0x24')],'as':_0x9680('0xd3'),'attributes':['id',_0x9680('0xbf'),_0x9680('0x47'),'to','cc','bcc',_0x9680('0xd4'),_0x9680('0x73')],'where':{'secret':![]},'order':qs[_0x9680('0x42')]('id'),'include':_0x557f37}];return db['MailInteraction'][_0x9680('0x66')]({'where':{'id':_0x25a709[_0x9680('0xba')]['id']},'include':_0x1845d7})[_0x9680('0x18')](handleEntityNotFound(_0x1366c0,null))[_0x9680('0x18')](function(_0x24967f){if(_0x24967f&&_0x24967f[_0x9680('0xd3')]){var _0x101736=_0x24967f[_0x9680('0xd5')]({'plain':!![]});fs[_0x9680('0xd6')](_0x58e7af);return BPromise['each'](_0x101736[_0x9680('0xd3')],function(_0x312019,_0x3db024){var _0x1262cf={'from':_0x312019[_0x9680('0x47')],'to':_0x312019['to'],'subject':_0x312019['subject'],'html':htmlEntities[_0x9680('0xd7')](_0x312019[_0x9680('0xbf')]),'headers':{'Date':moment(_0x312019[_0x9680('0x73')])[_0x9680('0xc5')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x312019['cc']){_0x1262cf[_0x9680('0xd8')]['Cc']=_0x312019['cc'];}if(_0x312019[_0x9680('0xd9')]){_0x1262cf[_0x9680('0xd8')]['Bcc']=_0x312019[_0x9680('0xd9')];}return new BPromise(function(_0x3dd6a3,_0x33a25d){if(_0x312019['Attachments']){for(var _0x1a0b99=0x0;_0x1a0b99<_0x312019[_0x9680('0xd2')][_0x9680('0x3d')];_0x1a0b99++){var _0x124220=_0x312019['Attachments'][_0x1a0b99];var _0x2837e6=path[_0x9680('0xcc')](_0x5128b5,_0x124220['basename']);if(fs[_0x9680('0xda')](_0x2837e6)){_0x1262cf[_0x9680('0xcf')][_0x9680('0x23')]({'name':_0x124220[_0x9680('0x36')],'contentType':_0x124220['type'],'data':fs['readFileSync'](_0x2837e6)});}}}emlformat[_0x9680('0xdb')](_0x1262cf,function(_0x58687b,_0x2763ca){if(_0x58687b)return _0x33a25d(_0x58687b);fs[_0x9680('0xdc')](path[_0x9680('0xcc')](_0x58e7af,util[_0x9680('0xc5')](_0x9680('0xdd'),_0x3db024)),_0x2763ca);return _0x3dd6a3(_0x2763ca);});});})[_0x9680('0x18')](function(){return new BPromise(function(_0x26400f,_0x12f8eb){zipdir(_0x58e7af,{'saveTo':_0x42b70a},function(_0x36a434,_0x4969de){if(_0x36a434)return _0x12f8eb(_0x36a434);return _0x26400f(_0x4969de);});})[_0x9680('0x18')](function(){return new BPromise(function(_0x1bd2af,_0x37ec3d){rimraf(_0x58e7af,function(_0x2024ae){if(_0x2024ae)_0x37ec3d(_0x2024ae);return _0x1bd2af();});});})[_0x9680('0x18')](function(){return _0x1366c0['download'](_0x42b70a,_0x2d36c4,function(_0x1db476){if(!_0x1db476)fs['unlinkSync'](_0x42b70a);});});});}else{return _0x1366c0[_0x9680('0x10')](0xc8);}})[_0x9680('0x29')](handleError(_0x1366c0,null));}; \ No newline at end of file +var _0xc0f0=['i.id','Sequelize','QueryTypes','SELECT','order','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','MailAccountId','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','enableEmailPreview','push','all','show','includeAll','include','options','body','params','describe','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','attachments','Attachment','Messages','bcc','subject','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','split','forEach','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','some','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xc0f0,0x67));var _0x0c0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0f0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c0f('0x0'));var rimraf=require(_0x0c0f('0x1'));var zipdir=require(_0x0c0f('0x2'));var moment=require(_0x0c0f('0x3'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x0c0f('0x4'));var fs=require('fs');var _=require(_0x0c0f('0x5'));var squel=require(_0x0c0f('0x6'));var juice=require(_0x0c0f('0x7'));var Redis=require(_0x0c0f('0x8'));var qs=require(_0x0c0f('0x9'));var as=require(_0x0c0f('0xa'));var logger=require(_0x0c0f('0xb'))(_0x0c0f('0xc'));var config=require(_0x0c0f('0xd'));var db=require(_0x0c0f('0xe'))['db'];var htmlEntities=require(_0x0c0f('0xf'));config[_0x0c0f('0x10')]=_['defaults'](config[_0x0c0f('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c0f('0x11'))(new Redis(config[_0x0c0f('0x10')]));require(_0x0c0f('0x12'))[_0x0c0f('0x13')](socket);function respondWithStatusCode(_0x4e9598,_0x2af9c0){_0x2af9c0=_0x2af9c0||0xcc;return function(_0x257ac5){if(_0x257ac5){return _0x4e9598[_0x0c0f('0x14')](_0x2af9c0);}return _0x4e9598[_0x0c0f('0x15')](_0x2af9c0)[_0x0c0f('0x16')]();};}function respondWithResult(_0x20b72c,_0xf7fa6b){_0xf7fa6b=_0xf7fa6b||0xc8;return function(_0x2e678a){if(_0x2e678a){return _0x20b72c[_0x0c0f('0x15')](_0xf7fa6b)['json'](_0x2e678a);}};}function respondWithFilteredResult(_0x3259a1,_0x351437){return function(_0x4d11e3){if(_0x4d11e3){var _0x4dc115=typeof _0x351437[_0x0c0f('0x17')]==='undefined'&&typeof _0x351437['limit']===_0x0c0f('0x18');var _0x47e1d9=_0x4d11e3[_0x0c0f('0x19')];var _0x2cf416=_0x4dc115?0x0:_0x351437[_0x0c0f('0x17')];var _0x1c6cf3=_0x4dc115?_0x4d11e3['count']:_0x351437[_0x0c0f('0x17')]+_0x351437[_0x0c0f('0x1a')];var _0x320484;if(_0x1c6cf3>=_0x47e1d9){_0x1c6cf3=_0x47e1d9;_0x320484=0xc8;}else{_0x320484=0xce;}_0x3259a1['status'](_0x320484);return _0x3259a1[_0x0c0f('0x1b')](_0x0c0f('0x1c'),_0x2cf416+'-'+_0x1c6cf3+'/'+_0x47e1d9)[_0x0c0f('0x1d')](_0x4d11e3);}return null;};}function saveUpdates(_0x1c9b38){return function(_0xf6e79d){if(_0xf6e79d){return _0xf6e79d[_0x0c0f('0x1e')](_0x1c9b38)[_0x0c0f('0x1f')](function(_0x1aacd5){return _0x1aacd5;});}return null;};}function removeEntity(_0x446924){return function(_0x4bf4b1){if(_0x4bf4b1){return _0x4bf4b1[_0x0c0f('0x20')]()[_0x0c0f('0x1f')](function(){_0x446924[_0x0c0f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47361a){return function(_0x4be949){if(!_0x4be949){_0x47361a['sendStatus'](0x194);}return _0x4be949;};}function handleError(_0x42d47e,_0x3c98e4){_0x3c98e4=_0x3c98e4||0x1f4;return function(_0x66ea09){logger[_0x0c0f('0x21')](_0x66ea09['stack']);if(_0x66ea09['name']){delete _0x66ea09[_0x0c0f('0x22')];}_0x42d47e[_0x0c0f('0x15')](_0x3c98e4)['send'](_0x66ea09);};}function getInteractionUsers(_0x456f51,_0x5f4aec){return new BPromise(function(_0x345feb,_0x4526fe){try{if(_0x5f4aec[_0x456f51['id']]){_0x456f51[_0x0c0f('0x23')]=_[_0x0c0f('0x24')](_0x5f4aec[_0x456f51['id']],function(_0x1c68d1){return{'id':_0x1c68d1['id'],'fullname':_0x1c68d1[_0x0c0f('0x25')]};});}}catch(_0x375ab4){_0x4526fe(_0x375ab4);}_0x345feb(_0x456f51);});}function getInteractionTags(_0x479cbe,_0x1b835a){return new BPromise(function(_0x25a01c,_0x2fb316){try{if(_0x479cbe[_0x0c0f('0x26')]){_0x479cbe[_0x0c0f('0x27')]=[];_0x479cbe[_0x0c0f('0x26')][_0x0c0f('0x28')](',')[_0x0c0f('0x29')](function(_0x394cd3){_0x479cbe['Tags']['push'](_0x1b835a[_0x394cd3]);});}delete _0x479cbe[_0x0c0f('0x26')];}catch(_0x1b1cf6){_0x2fb316(_0x1b1cf6);}_0x25a01c(_0x479cbe);});}function getLastMessageText(_0x4f3750){return new BPromise(function(_0x1f4770,_0xadbb33){return db[_0x0c0f('0x2a')][_0x0c0f('0x2b')]({'where':{'$and':[{'MailInteractionId':_0x4f3750['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0c0f('0x2c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x0c0f('0x1f')](function(_0x3cf5d5){if(_0x3cf5d5&&_0x3cf5d5[_0x0c0f('0x2d')]){_0x4f3750[_0x0c0f('0x2e')]=_[_0x0c0f('0x2f')](_0x3cf5d5[_0x0c0f('0x2d')]);}_0x1f4770(_0x4f3750);})['catch'](function(_0x3c536a){_0xadbb33(_0x3c536a);});});}function updateMailInteraction(_0xaeb571,_0x1ec753,_0x9d1220,_0x5b9b60){return new BPromise(function(_0x43dbe4,_0x53a312){return getInteractionUsers(_0xaeb571,_0x9d1220)[_0x0c0f('0x1f')](function(_0x442114){return getInteractionTags(_0x442114,_0x1ec753);})['then'](function(_0x324c31){return getStateInteraction(_0x324c31);})[_0x0c0f('0x1f')](function(_0x7e4c67){if(_0x5b9b60){_0x43dbe4(getLastMessageText(_0x7e4c67));}else{_0x43dbe4(_0x7e4c67);}})[_0x0c0f('0x30')](function(_0x3fee28){_0x53a312(_0x3fee28);});});}function getStateInteraction(_0x382d2e){return new BPromise(function(_0x5729da){_0x382d2e[_0x0c0f('0x31')]=0x0;_0x382d2e[_0x0c0f('0x32')]=0x0;_0x382d2e[_0x0c0f('0x33')]=0x0;_0x382d2e[_0x0c0f('0x34')]=0x0;_0x382d2e['total']=0x0;if(!_0x382d2e[_0x0c0f('0x35')]&&!_0x382d2e['UserId']){_0x382d2e[_0x0c0f('0x31')]+=0x1;}if(!_0x382d2e[_0x0c0f('0x35')]&&_0x382d2e[_0x0c0f('0x36')]){_0x382d2e[_0x0c0f('0x32')]+=0x1;if(_0x382d2e[_0x0c0f('0x31')]){_0x382d2e['waiting']-=0x1;}}if(_0x382d2e[_0x0c0f('0x35')]&&_0x382d2e[_0x0c0f('0x36')]){_0x382d2e[_0x0c0f('0x33')]+=0x1;if(_0x382d2e[_0x0c0f('0x32')]){_0x382d2e[_0x0c0f('0x32')]-=0x1;}}if(_0x382d2e['closed']&&!_0x382d2e[_0x0c0f('0x36')]){_0x382d2e['unmanaged']+=0x1;if(_0x382d2e[_0x0c0f('0x31')]){_0x382d2e[_0x0c0f('0x31')]-=0x1;}}_0x382d2e[_0x0c0f('0x37')]+=0x1;_0x5729da(_0x382d2e);});}exports[_0x0c0f('0x38')]=function(_0x4cdaa3,_0x2b907f){var _0x541f97={},_0x433ade={},_0x44d5eb={'count':0x0,'rows':[]};var _0x409d83=_[_0x0c0f('0x24')](db[_0x0c0f('0x39')][_0x0c0f('0x3a')],function(_0x43b359){return{'name':_0x43b359[_0x0c0f('0x3b')],'type':_0x43b359[_0x0c0f('0x3c')]['key']};});_0x433ade[_0x0c0f('0x3d')]=_[_0x0c0f('0x24')](_0x409d83,_0x0c0f('0x22'));_0x433ade[_0x0c0f('0x3e')]=_[_0x0c0f('0x3f')](_0x4cdaa3[_0x0c0f('0x3e')]);_0x433ade[_0x0c0f('0x40')]=_[_0x0c0f('0x41')](_0x433ade['model'],_0x433ade['query']);_0x541f97[_0x0c0f('0x42')]=_[_0x0c0f('0x41')](_0x433ade[_0x0c0f('0x3d')],qs[_0x0c0f('0x43')](_0x4cdaa3[_0x0c0f('0x3e')]['fields']));_0x541f97[_0x0c0f('0x42')]=_0x541f97[_0x0c0f('0x42')][_0x0c0f('0x44')]?_0x541f97[_0x0c0f('0x42')]:_0x433ade[_0x0c0f('0x3d')];if(!_0x4cdaa3['query']['hasOwnProperty']('nolimit')){_0x541f97[_0x0c0f('0x1a')]=qs['limit'](_0x4cdaa3[_0x0c0f('0x3e')]['limit']);_0x541f97['offset']=qs['offset'](_0x4cdaa3['query']['offset']);}_0x541f97['order']=qs[_0x0c0f('0x45')](_0x4cdaa3[_0x0c0f('0x3e')]['sort']);_0x541f97[_0x0c0f('0x46')]=qs['filters'](_[_0x0c0f('0x47')](_0x4cdaa3[_0x0c0f('0x3e')],_0x433ade[_0x0c0f('0x40')]),_0x409d83);var _0x20fcde=[];var _0x22279d=squel['select']()['field']('id')['field']('name')[_0x0c0f('0x48')](_0x0c0f('0x49'))[_0x0c0f('0x4a')](_0x0c0f('0x4b'));var _0x16389f=squel[_0x0c0f('0x4c')]()[_0x0c0f('0x48')](_0x0c0f('0x4d'))[_0x0c0f('0x48')](_0x0c0f('0x4e'))[_0x0c0f('0x48')](_0x0c0f('0x4f'))[_0x0c0f('0x4a')](_0x0c0f('0x50'),'ui')[_0x0c0f('0x51')](_0x0c0f('0x52'),'u',_0x0c0f('0x53'));var _0x1c8584=squel[_0x0c0f('0x4c')]()[_0x0c0f('0x4a')](_0x0c0f('0x54'),'i')[_0x0c0f('0x51')](_0x0c0f('0x55'),'c',_0x0c0f('0x56'))[_0x0c0f('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x0c0f('0x51')](_0x0c0f('0x57'),'a',_0x0c0f('0x58'))[_0x0c0f('0x51')](_0x0c0f('0x59'),'me','me.MailInteractionId\x20=\x20i.id')[_0x0c0f('0x51')](_0x0c0f('0x5a'),'it',_0x0c0f('0x5b'))['left_join'](_0x0c0f('0x4b'),'t',_0x0c0f('0x5c'));var _0x27af2e=squel[_0x0c0f('0x5d')]();var _0x588700=[];var _0x1b0bc9=squel[_0x0c0f('0x5d')]();var _0x5aa48e;if(_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x5e')]){_0x5aa48e=as[_0x0c0f('0x5f')](_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x5e')]);var _0x458896=_0x5aa48e[_0x0c0f('0x60')];for(var _0x2d6c9e=0x0;_0x2d6c9e<_0x5aa48e[_0x0c0f('0x61')][_0x0c0f('0x44')];_0x2d6c9e++){var _0x938090=_0x5aa48e[_0x0c0f('0x61')][_0x2d6c9e];var _0x1e61eb='i';var _0x3cdcc6=_['find'](_0x409d83,[_0x0c0f('0x22'),_0x938090['field']]);if(!_0x3cdcc6){switch(_0x938090[_0x0c0f('0x48')]){case _0x0c0f('0x62'):if(_0x938090[_0x0c0f('0x63')]==0x1){_0x1c8584[_0x0c0f('0x64')]('`'+_0x938090[_0x0c0f('0x48')]+_0x0c0f('0x65'));}else{_0x1c8584['having']('`'+_0x938090[_0x0c0f('0x48')]+'`\x20>\x200');}break;case _0x0c0f('0x66'):if(_0x938090['operator']==='$substring'){if(_0x938090[_0x0c0f('0x63')]['split']('\x20')[_0x0c0f('0x44')]>0x1){_0x27af2e[_0x458896]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0c0f('0x67')](_0x938090['value']),null);}else{var _0x4846a0='%'+_0x938090[_0x0c0f('0x63')]+'%';_0x27af2e[_0x458896]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4846a0,_0x4846a0,_0x4846a0);}}else{_0x3cdcc6=_['find'](_0x409d83,[_0x0c0f('0x22'),_0x0c0f('0x68')]);_0x938090[_0x0c0f('0x48')]='ContactId';_0x427ca7=as[_0x0c0f('0x69')](_0x1e61eb,_0x3cdcc6['type'],_0x938090);_0x27af2e[_0x458896](_0x427ca7[_0x0c0f('0x6a')],_0x427ca7[_0x0c0f('0x63')][_0x0c0f('0x6b')],_0x427ca7['value'][_0x0c0f('0x16')]);}break;case _0x0c0f('0x6c'):var _0x457f1d=_0x938090[_0x0c0f('0x63')][_0x0c0f('0x28')](',')[_0x0c0f('0x24')](function(_0x4a33f5){return Number(_0x4a33f5);});_0x457f1d[_0x0c0f('0x29')](function(_0xb74c07){_0x1b0bc9['or'](_0x0c0f('0x6d'),'%,'+_0xb74c07+',%');});_0x588700=_['union'](_0x588700,_0x457f1d);break;case _0x0c0f('0x6e'):if(_0x938090[_0x0c0f('0x6f')]==='$substring'){_0x27af2e[_0x458896](_0x0c0f('0x70'),'%'+_0x938090[_0x0c0f('0x63')]+'%',null);}else{_0x3cdcc6=_[_0x0c0f('0x71')](_0x409d83,['name',_0x0c0f('0x36')]);_0x938090[_0x0c0f('0x48')]='UserId';_0x427ca7=as[_0x0c0f('0x69')](_0x1e61eb,_0x3cdcc6[_0x0c0f('0x3c')],_0x938090);_0x27af2e[_0x458896](_0x427ca7['text'],_0x427ca7[_0x0c0f('0x63')]['start'],_0x427ca7[_0x0c0f('0x63')]['end']);}break;case _0x0c0f('0x2d'):_0x427ca7=as['buildExpression']('me',null,_0x938090);_0x27af2e[_0x458896](_0x427ca7[_0x0c0f('0x6a')],_0x427ca7[_0x0c0f('0x63')][_0x0c0f('0x6b')],_0x427ca7['value'][_0x0c0f('0x16')]);break;}}else{var _0x427ca7=as[_0x0c0f('0x69')](_0x1e61eb,_0x3cdcc6[_0x0c0f('0x3c')],_0x938090);_0x27af2e[_0x458896](_0x427ca7[_0x0c0f('0x6a')],_0x427ca7[_0x0c0f('0x63')]['start'],_0x427ca7[_0x0c0f('0x63')][_0x0c0f('0x16')]);}}}else{var _0x530ae0=_(_0x4cdaa3[_0x0c0f('0x3e')])['keys']()[_0x0c0f('0x24')](function(_0x5c6643){return _[_0x0c0f('0x72')](_0x409d83,[_0x0c0f('0x22'),_0x5c6643])?_0x5c6643:undefined;})['compact']()[_0x0c0f('0x63')]();if(!_[_0x0c0f('0x73')](_0x530ae0)){_0x530ae0['forEach'](function(_0x4ca101){if(_0x4ca101==='MailAccountId'){_0x1c8584[_0x0c0f('0x46')](_0x0c0f('0x74'),[][_0x0c0f('0x75')](_0x4cdaa3[_0x0c0f('0x3e')][_0x4ca101]));}else if(_0x4ca101===_0x0c0f('0x76')){var _0x2b687f=JSON[_0x0c0f('0x77')](_0x4cdaa3[_0x0c0f('0x3e')][_0x4ca101])[_0x0c0f('0x78')];var _0x164339=JSON[_0x0c0f('0x77')](_0x4cdaa3[_0x0c0f('0x3e')][_0x4ca101])[_0x0c0f('0x79')];_0x1c8584[_0x0c0f('0x46')](_0x0c0f('0x7a'),_0x2b687f,_0x164339);}else{if(_0x4cdaa3[_0x0c0f('0x3e')][_0x4ca101]==='null'){_0x1c8584[_0x0c0f('0x46')]('i.'+_0x4ca101+_0x0c0f('0x7b'));}else{_0x1c8584[_0x0c0f('0x46')]('i.'+_0x4ca101+'\x20=\x20?',_0x4cdaa3[_0x0c0f('0x3e')][_0x4ca101]);}}});}if(_0x4cdaa3[_0x0c0f('0x3e')]['read']){if(_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x7c')]==0x1){_0x1c8584['having'](_0x0c0f('0x7d'));}else{_0x1c8584[_0x0c0f('0x64')](_0x0c0f('0x7e'));}}if(_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x7f')]){_0x588700=_[_0x0c0f('0x80')](_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x7f')])?_0x4cdaa3['query']['tag']:new Array(_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x7f')]);_0x588700[_0x0c0f('0x29')](function(_0x15e1e4){_0x1b0bc9['or'](_0x0c0f('0x6d'),'%,'+_0x15e1e4+',%');});}if(_0x4cdaa3['query'][_0x0c0f('0x81')]){var _0xfa4e25=_0x4cdaa3['query'][_0x0c0f('0x81')][_0x0c0f('0x82')]('\x5c','\x5c\x5c')[_0x0c0f('0x82')](/'/g,'\x27\x27');if(qs[_0x0c0f('0x83')](_0xfa4e25)){_0x27af2e['or']('i.id\x20LIKE\x20?',_0xfa4e25+'%');}else if(qs['isEmail'](_0xfa4e25)){_0x27af2e['or'](_0x0c0f('0x84'),_0xfa4e25+'%');}else{_0x27af2e['or'](_0x0c0f('0x85'),qs[_0x0c0f('0x67')](_0xfa4e25))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0c0f('0x67')](_0xfa4e25));}}}_0x1c8584[_0x0c0f('0x46')](_0x27af2e);_0x1c8584[_0x0c0f('0x86')](_0x0c0f('0x87'));var _0x536b42={'type':db[_0x0c0f('0x88')][_0x0c0f('0x89')][_0x0c0f('0x8a')],'raw':!![]};var _0x200fbd=_0x1c8584['clone']();_0x200fbd['field']('i.id');_0x200fbd[_0x0c0f('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0c0f('0x62'));if(_0x541f97['order']){_0x541f97[_0x0c0f('0x8b')][_0x0c0f('0x29')](function(_0x112abf){var _0x359f44=_0x112abf[0x0]==='contactName'?_0x112abf[0x0]:'i.'+_0x112abf[0x0];_0x1c8584[_0x0c0f('0x8b')](_0x359f44,_0x112abf[0x1]===_0x0c0f('0x8c')?![]:!![]);});}if(!_[_0x0c0f('0x73')](_0x588700)){_0x1c8584[_0x0c0f('0x64')](_0x1b0bc9);_0x200fbd[_0x0c0f('0x46')](_0x0c0f('0x8d'),_0x588700);}BPromise[_0x0c0f('0x8e')]()[_0x0c0f('0x1f')](function(){if(!_0x5aa48e){if(_0x4cdaa3[_0x0c0f('0x3e')]['MailAccountId'])return;_0x200fbd[_0x0c0f('0x46')](_0x0c0f('0x8f'));_0x1c8584[_0x0c0f('0x46')](_0x0c0f('0x8f'));return;}if(_0x4cdaa3[_0x0c0f('0x90')][_0x0c0f('0x91')]!==_0x0c0f('0x92'))return;return _0x4cdaa3[_0x0c0f('0x90')][_0x0c0f('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0xe7bfb7){if(_['isEmpty'](_0xe7bfb7)){_0x200fbd[_0x0c0f('0x46')](_0x0c0f('0x94'));_0x1c8584[_0x0c0f('0x46')](_0x0c0f('0x94'));}else{_0x200fbd['where'](_0x0c0f('0x74'),_[_0x0c0f('0x24')](_0xe7bfb7,'id'));_0x1c8584[_0x0c0f('0x46')](_0x0c0f('0x74'),_['map'](_0xe7bfb7,'id'));}});})[_0x0c0f('0x1f')](function(){if(_0x4cdaa3['user'][_0x0c0f('0x91')]==='agent'&&!_0x5aa48e&&!_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x95')])return[];return db[_0x0c0f('0x96')][_0x0c0f('0x3e')](_0x200fbd[_0x0c0f('0x97')](),_0x536b42);})[_0x0c0f('0x1f')](function(_0x678082){_0x44d5eb[_0x0c0f('0x19')]=_0x678082[_0x0c0f('0x44')];if(_0x44d5eb[_0x0c0f('0x19')]===0x0)return[];return db['sequelize']['query'](_0x22279d[_0x0c0f('0x97')](),_0x536b42)[_0x0c0f('0x1f')](function(_0x3eca15){_0x20fcde=_[_0x0c0f('0x98')](_0x3eca15,'id');_0x536b42=_[_0x0c0f('0x99')](_0x536b42,{'model':db[_0x0c0f('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4cdaa3[_0x0c0f('0x3e')][_0x0c0f('0x43')]){_0x541f97['attributes'][_0x0c0f('0x29')](function(_0x323e25){_0x1c8584[_0x0c0f('0x48')]('i.'+_0x323e25);});}else{_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0x9a'),_0x0c0f('0x62'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0x9b'),_0x0c0f('0x9c'));_0x1c8584['field'](_0x0c0f('0x9d'),'Account.mandatoryDisposition');_0x1c8584['field'](_0x0c0f('0x9e'),_0x0c0f('0x9f'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0x87'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa0'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa1'));_0x1c8584['field'](_0x0c0f('0xa2'));_0x1c8584['field'](_0x0c0f('0xa3'));_0x1c8584['field'](_0x0c0f('0xa4'));_0x1c8584['field'](_0x0c0f('0xa5'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa6'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa7'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa8'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xa9'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xaa'));_0x1c8584[_0x0c0f('0x48')]('i.substatus');_0x1c8584[_0x0c0f('0x48')]('i.to');_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xab'));_0x1c8584[_0x0c0f('0x48')]('i.MailAccountId');_0x1c8584[_0x0c0f('0x48')]('i.UserId');_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xac'),_0x0c0f('0xad'));_0x1c8584['field']('c.lastName','Contact.lastName');_0x1c8584['field'](_0x0c0f('0xae'),_0x0c0f('0xaf'));_0x1c8584[_0x0c0f('0x48')]('c.phone',_0x0c0f('0xb0'));_0x1c8584[_0x0c0f('0x48')]('c.mobile',_0x0c0f('0xb1'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xb2'),_0x0c0f('0xb3'));_0x1c8584[_0x0c0f('0x48')](_0x0c0f('0xb4'),'Owner.fullname');_0x1c8584['field'](_0x0c0f('0xb5'),_0x0c0f('0xb6'));_0x1c8584['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0c0f('0x26'));}if(_0x541f97[_0x0c0f('0x1a')])_0x1c8584['limit'](_0x541f97[_0x0c0f('0x1a')]);if(_0x541f97[_0x0c0f('0x17')])_0x1c8584[_0x0c0f('0x17')](_0x541f97[_0x0c0f('0x17')]);return db[_0x0c0f('0x96')][_0x0c0f('0x3e')](_0x1c8584[_0x0c0f('0x97')](),_0x536b42);})[_0x0c0f('0x1f')](function(_0x5678c2){if(_0x5678c2['length']>0x0)_0x16389f['where']('ui.MailInteractionId\x20IN\x20?',_[_0x0c0f('0x24')](_0x5678c2,'id'));return db[_0x0c0f('0x96')][_0x0c0f('0x3e')](_0x16389f[_0x0c0f('0x97')](),_0x536b42)[_0x0c0f('0x1f')](function(_0x19fe7d){var _0x1c34a7=_[_0x0c0f('0xb7')](_0x19fe7d,'MailInteractionId');var _0x3295f3=[];return db['Setting'][_0x0c0f('0x2b')]({'attributes':[_0x0c0f('0xb8')],'raw':!![]})[_0x0c0f('0x1f')](function(_0x493581){var _0x414523=_0x493581['enableEmailPreview'];_0x5678c2[_0x0c0f('0x29')](function(_0x1b2edf){_0x3295f3[_0x0c0f('0xb9')](updateMailInteraction(_0x1b2edf,_0x20fcde,_0x1c34a7,_0x414523));});return BPromise[_0x0c0f('0xba')](_0x3295f3);});});});})[_0x0c0f('0x1f')](function(_0x31fb47){_0x44d5eb['rows']=_0x31fb47;return _0x44d5eb;})[_0x0c0f('0x1f')](respondWithFilteredResult(_0x2b907f,_0x541f97))['catch'](handleError(_0x2b907f,null));};exports[_0x0c0f('0xbb')]=function(_0x536222,_0x4e92af){var _0x30d538={'raw':![],'where':{'id':_0x536222['params']['id']}},_0x196c1a={};_0x196c1a[_0x0c0f('0x3d')]=_[_0x0c0f('0x3f')](db[_0x0c0f('0x39')][_0x0c0f('0x3a')]);_0x196c1a['query']=_[_0x0c0f('0x3f')](_0x536222[_0x0c0f('0x3e')]);_0x196c1a['filters']=_[_0x0c0f('0x41')](_0x196c1a[_0x0c0f('0x3d')],_0x196c1a['query']);_0x30d538[_0x0c0f('0x42')]=_['intersection'](_0x196c1a['model'],qs['fields'](_0x536222[_0x0c0f('0x3e')][_0x0c0f('0x43')]));_0x30d538[_0x0c0f('0x42')]=_0x30d538[_0x0c0f('0x42')][_0x0c0f('0x44')]?_0x30d538[_0x0c0f('0x42')]:_0x196c1a[_0x0c0f('0x3d')];if(_0x536222[_0x0c0f('0x3e')][_0x0c0f('0xbc')]){_0x30d538[_0x0c0f('0xbd')]=[{'all':!![]}];}_0x30d538=_[_0x0c0f('0x99')]({},_0x30d538,_0x536222[_0x0c0f('0xbe')]);return db[_0x0c0f('0x39')]['find'](_0x30d538)[_0x0c0f('0x1f')](handleEntityNotFound(_0x4e92af,null))['then'](respondWithResult(_0x4e92af,null))[_0x0c0f('0x30')](handleError(_0x4e92af,null));};exports['create']=function(_0x6192e0,_0x7ea24c){return db[_0x0c0f('0x39')]['create'](_0x6192e0['body'],{})[_0x0c0f('0x1f')](respondWithResult(_0x7ea24c,0xc9))[_0x0c0f('0x30')](handleError(_0x7ea24c,null));};exports[_0x0c0f('0x1e')]=function(_0x4220b9,_0x3519d9){if(_0x4220b9['body']['id']){delete _0x4220b9[_0x0c0f('0xbf')]['id'];}return db[_0x0c0f('0x39')]['find']({'where':{'id':_0x4220b9[_0x0c0f('0xc0')]['id']}})[_0x0c0f('0x1f')](handleEntityNotFound(_0x3519d9,null))[_0x0c0f('0x1f')](saveUpdates(_0x4220b9['body'],null))['then'](respondWithResult(_0x3519d9,null))[_0x0c0f('0x30')](handleError(_0x3519d9,null));};exports[_0x0c0f('0x20')]=function(_0x451c78,_0x2bae1c){return db[_0x0c0f('0x39')][_0x0c0f('0x71')]({'where':{'id':_0x451c78['params']['id']}})[_0x0c0f('0x1f')](handleEntityNotFound(_0x2bae1c,null))['then'](removeEntity(_0x2bae1c,null))['catch'](handleError(_0x2bae1c,null));};exports[_0x0c0f('0xc1')]=function(_0x31b388,_0x5931d7){return db['MailInteraction'][_0x0c0f('0xc1')]()[_0x0c0f('0x1f')](respondWithResult(_0x5931d7,null))['catch'](handleError(_0x5931d7,null));};exports['addMessage']=function(_0x1c5ef5,_0x5eb5ab){return db['MailMessage'][_0x0c0f('0x71')]({'where':{'id':_0x1c5ef5[_0x0c0f('0xc0')]['id']}})[_0x0c0f('0x1f')](handleEntityNotFound(_0x5eb5ab,null))[_0x0c0f('0x1f')](function(_0x551852){if(_0x551852){return _0x551852[_0x0c0f('0xc2')](_0x1c5ef5[_0x0c0f('0xbf')][_0x0c0f('0xc3')],_[_0x0c0f('0xc4')](_0x1c5ef5['body'],['ids','id'])||{});}})[_0x0c0f('0x1f')](respondWithResult(_0x5eb5ab,null))[_0x0c0f('0x30')](handleError(_0x5eb5ab,null));};exports[_0x0c0f('0xc5')]=function(_0x5584b5,_0xe6f986){var _0x73e14f={'raw':![],'where':{}};var _0x3fd331={};var _0x5b52ba={'count':0x0,'rows':[]};return db[_0x0c0f('0x39')][_0x0c0f('0x2b')]({'where':{'id':_0x5584b5['params']['id']}})[_0x0c0f('0x1f')](handleEntityNotFound(_0xe6f986,null))[_0x0c0f('0x1f')](function(_0x1bc978){if(_0x1bc978){_0x3fd331[_0x0c0f('0x3d')]=_[_0x0c0f('0x3f')](db['MailMessage'][_0x0c0f('0x3a')]);_0x3fd331[_0x0c0f('0x3e')]=_['keys'](_0x5584b5[_0x0c0f('0x3e')]);_0x3fd331['filters']=_[_0x0c0f('0x41')](_0x3fd331['model'],_0x3fd331['query']);_0x73e14f[_0x0c0f('0x42')]=_[_0x0c0f('0x41')](_0x3fd331['model'],qs[_0x0c0f('0x43')](_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x43')]));_0x73e14f[_0x0c0f('0x42')]=_0x73e14f[_0x0c0f('0x42')]['length']?_0x73e14f[_0x0c0f('0x42')]:_0x3fd331[_0x0c0f('0x3d')];if(!_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0xc6')](_0x0c0f('0xc7'))){_0x73e14f['limit']=qs[_0x0c0f('0x1a')](_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x1a')]);_0x73e14f[_0x0c0f('0x17')]=qs[_0x0c0f('0x17')](_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x17')]);}_0x73e14f['order']=qs[_0x0c0f('0x45')](_0x5584b5['query'][_0x0c0f('0x45')]);_0x73e14f[_0x0c0f('0x46')]=qs[_0x0c0f('0x40')](_[_0x0c0f('0x47')](_0x5584b5[_0x0c0f('0x3e')],_0x3fd331[_0x0c0f('0x40')]));_0x73e14f[_0x0c0f('0x46')][_0x0c0f('0xc8')]=_0x1bc978['id'];if(_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x81')]){_0x73e14f[_0x0c0f('0x46')]=_[_0x0c0f('0x99')](_0x73e14f['where'],{'$or':_[_0x0c0f('0x24')](_0x73e14f[_0x0c0f('0x42')],function(_0x5d93dd){var _0x18f376={};_0x18f376[_0x5d93dd]={'$like':'%'+_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x81')]+'%'};return _0x18f376;})});}if(_0x5584b5[_0x0c0f('0x3e')]['$gte']){var _0x3999e7=_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0x78')]['split'](',');var _0x546d9e={};_0x546d9e[_0x3999e7[0x0]]={'$gte':moment(_0x3999e7[0x1])[_0x0c0f('0xc9')](_0x0c0f('0xca'))};_0x73e14f['where']=_[_0x0c0f('0x99')](_0x73e14f['where'],_0x546d9e);}_0x73e14f=_[_0x0c0f('0x99')]({},_0x73e14f,_0x5584b5[_0x0c0f('0xbe')]);return db[_0x0c0f('0x2a')][_0x0c0f('0x19')]({'where':_0x73e14f[_0x0c0f('0x46')]})[_0x0c0f('0x1f')](function(_0x358733){_0x5b52ba[_0x0c0f('0x19')]=_0x358733;if(_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0xbc')]){_0x73e14f['include']=[{'all':!![]}];}return db['MailMessage'][_0x0c0f('0xcb')](_0x73e14f);})[_0x0c0f('0x1f')](function(_0x2fcd38){if(_0x5584b5[_0x0c0f('0x3e')][_0x0c0f('0xcc')]===_0x0c0f('0xcd')){for(var _0x2ce382=0x0;_0x2ce382<_0x2fcd38[_0x0c0f('0x44')];_0x2ce382++){_0x2fcd38[_0x2ce382]['body']=juice(_0x2fcd38[_0x2ce382]['body']);}}_0x5b52ba[_0x0c0f('0xce')]=_0x2fcd38;return _0x5b52ba;});}})[_0x0c0f('0x1f')](respondWithFilteredResult(_0xe6f986,_0x73e14f))[_0x0c0f('0x30')](handleError(_0xe6f986,null));};exports[_0x0c0f('0xcf')]=function(_0x402be3,_0x3448b3){return db[_0x0c0f('0x39')]['find']({'where':{'id':_0x402be3[_0x0c0f('0xc0')]['id']}})[_0x0c0f('0x1f')](handleEntityNotFound(_0x3448b3,null))[_0x0c0f('0x1f')](function(_0x1e2284){if(_0x1e2284){return _0x1e2284[_0x0c0f('0xd0')](_0x402be3[_0x0c0f('0xbf')][_0x0c0f('0xc3')],_[_0x0c0f('0xc4')](_0x402be3[_0x0c0f('0xbf')],[_0x0c0f('0xc3'),'id'])||{})[_0x0c0f('0xd1')](function(){return db['Tag']['findAll']({'attributes':['id',_0x0c0f('0x22'),'color'],'where':{'id':_0x402be3['body']['ids']}});})[_0x0c0f('0x1f')](function(_0xf4bce9){socket[_0x0c0f('0xd2')]('mailInteractionTags:save',{'id':Number(_0x402be3[_0x0c0f('0xc0')]['id']),'tags':_0xf4bce9||[]});return{'id':Number(_0x402be3[_0x0c0f('0xc0')]['id']),'tags':_0xf4bce9||[]};});}})['then'](respondWithResult(_0x3448b3,null))[_0x0c0f('0x30')](handleError(_0x3448b3,null));};exports[_0x0c0f('0xd3')]=function(_0x35b04b,_0x3113c8){return db['MailInteraction'][_0x0c0f('0x71')]({'where':{'id':_0x35b04b[_0x0c0f('0xc0')]['id']}})['then'](handleEntityNotFound(_0x3113c8,null))[_0x0c0f('0x1f')](function(_0x1c9875){if(_0x1c9875){return _0x1c9875[_0x0c0f('0xd3')](_0x35b04b[_0x0c0f('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x3113c8,null))[_0x0c0f('0x30')](handleError(_0x3113c8,null));};exports[_0x0c0f('0xd4')]=function(_0x6cdbfa,_0x43bfb0){var _0x408e8f=moment()[_0x0c0f('0xd5')]()[_0x0c0f('0x97')]();var _0xe61fcc=path[_0x0c0f('0xd6')](config[_0x0c0f('0xd7')],_0x0c0f('0xd8'),_0x0c0f('0xd9'),_0x0c0f('0xda'));var _0x6c2e06=path[_0x0c0f('0xd6')](config[_0x0c0f('0xd7')],_0x0c0f('0xd8'),_0x0c0f('0xd9'),'attachments');var _0x16d086=path['join'](_0xe61fcc,_0x408e8f);var _0xcc1bc=util[_0x0c0f('0xc9')](_0x0c0f('0xdb'),_0x6cdbfa[_0x0c0f('0xc0')]['id'],_0x408e8f);var _0x533349=path[_0x0c0f('0xd6')](_0xe61fcc,_0xcc1bc);var _0x1de91c=[];if(_0x6cdbfa[_0x0c0f('0x3e')][_0x0c0f('0xdc')]){_0x1de91c[_0x0c0f('0xb9')]({'model':db[_0x0c0f('0xdd')],'as':'Attachments','raw':!![]});}var _0x19da80=[{'model':db['MailMessage'],'as':_0x0c0f('0xde'),'attributes':['id',_0x0c0f('0xbf'),_0x0c0f('0x4a'),'to','cc',_0x0c0f('0xdf'),_0x0c0f('0xe0'),_0x0c0f('0x76')],'where':{'secret':![]},'order':qs[_0x0c0f('0x45')]('id'),'include':_0x1de91c}];return db[_0x0c0f('0x39')][_0x0c0f('0x71')]({'where':{'id':_0x6cdbfa[_0x0c0f('0xc0')]['id']},'include':_0x19da80})['then'](handleEntityNotFound(_0x43bfb0,null))[_0x0c0f('0x1f')](function(_0x298e57){if(_0x298e57&&_0x298e57['Messages']){var _0x1fec28=_0x298e57['get']({'plain':!![]});fs[_0x0c0f('0xe1')](_0x16d086);return BPromise[_0x0c0f('0xe2')](_0x1fec28[_0x0c0f('0xde')],function(_0x8691e1,_0x39bc47){var _0x1e1b3f={'from':_0x8691e1[_0x0c0f('0x4a')],'to':_0x8691e1['to'],'subject':_0x8691e1[_0x0c0f('0xe0')],'html':htmlEntities['decode'](_0x8691e1[_0x0c0f('0xbf')]),'headers':{'Date':moment(_0x8691e1['createdAt'])[_0x0c0f('0xc9')](_0x0c0f('0xe3'))},'attachments':[]};if(_0x8691e1['cc']){_0x1e1b3f[_0x0c0f('0xe4')]['Cc']=_0x8691e1['cc'];}if(_0x8691e1[_0x0c0f('0xdf')]){_0x1e1b3f[_0x0c0f('0xe4')][_0x0c0f('0xe5')]=_0x8691e1[_0x0c0f('0xdf')];}return new BPromise(function(_0x4cf7a9,_0x1b5579){if(_0x8691e1[_0x0c0f('0xe6')]){for(var _0x56750f=0x0;_0x56750f<_0x8691e1[_0x0c0f('0xe6')][_0x0c0f('0x44')];_0x56750f++){var _0x172a46=_0x8691e1[_0x0c0f('0xe6')][_0x56750f];var _0x210828=path[_0x0c0f('0xd6')](_0x6c2e06,_0x172a46[_0x0c0f('0xe7')]);if(fs[_0x0c0f('0xe8')](_0x210828)){_0x1e1b3f[_0x0c0f('0xdc')][_0x0c0f('0xb9')]({'name':_0x172a46[_0x0c0f('0x22')],'contentType':_0x172a46['type'],'data':fs[_0x0c0f('0xe9')](_0x210828)});}}}emlformat[_0x0c0f('0xea')](_0x1e1b3f,function(_0x32e18c,_0x54e180){if(_0x32e18c)return _0x1b5579(_0x32e18c);fs[_0x0c0f('0xeb')](path[_0x0c0f('0xd6')](_0x16d086,util[_0x0c0f('0xc9')](_0x0c0f('0xec'),_0x39bc47)),_0x54e180);return _0x4cf7a9(_0x54e180);});});})[_0x0c0f('0x1f')](function(){return new BPromise(function(_0x2f614c,_0x47728a){zipdir(_0x16d086,{'saveTo':_0x533349},function(_0x13ca1c,_0x379e90){if(_0x13ca1c)return _0x47728a(_0x13ca1c);return _0x2f614c(_0x379e90);});})['then'](function(){return new BPromise(function(_0x4d6eca,_0xad195d){rimraf(_0x16d086,function(_0x381c54){if(_0x381c54)_0xad195d(_0x381c54);return _0x4d6eca();});});})['then'](function(){return _0x43bfb0['download'](_0x533349,_0xcc1bc,function(_0x2204a6){if(!_0x2204a6)fs[_0x0c0f('0xed')](_0x533349);});});});}else{return _0x43bfb0[_0x0c0f('0x14')](0xc8);}})[_0x0c0f('0x30')](handleError(_0x43bfb0,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 53737fe..1d95d4f 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 _0x7ec1=['../../mysqldb','MailInteraction','MailMessage','save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','events'];(function(_0x50a3e6,_0x3e8ec2){var _0x315083=function(_0x3acea6){while(--_0x3acea6){_0x50a3e6['push'](_0x50a3e6['shift']());}};_0x315083(++_0x3e8ec2);}(_0x7ec1,0xdf));var _0x17ec=function(_0x2bf2da,_0x813598){_0x2bf2da=_0x2bf2da-0x0;var _0x4762f6=_0x7ec1[_0x2bf2da];return _0x4762f6;};'use strict';var EventEmitter=require(_0x17ec('0x0'));var MailInteraction=require(_0x17ec('0x1'))['db'][_0x17ec('0x2')];var MailMessage=require(_0x17ec('0x1'))['db'][_0x17ec('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17ec('0x4'),'afterUpdate':_0x17ec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36dd45){return function(_0x277cd9,_0x1ce847,_0x32effa){_0x277cd9[_0x17ec('0x6')]({'attributes':['id'],'raw':!![]})[_0x17ec('0x7')](function(_0x57e54a){_0x277cd9[_0x17ec('0x8')](_0x17ec('0x9'),_0x57e54a[_0x17ec('0xa')](function(_0x3aaa4c){return{'id':_0x3aaa4c['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x277cd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x17ec('0x7')](function(_0x4406ad){_0x277cd9[_0x17ec('0x8')](_0x17ec('0xb'),_0x4406ad[_0x17ec('0xc')]);MailInteractionEvents[_0x17ec('0xd')](_0x36dd45+':'+_0x277cd9['id'],_0x277cd9);MailInteractionEvents[_0x17ec('0xd')](_0x36dd45,_0x277cd9);_0x32effa(null);})[_0x17ec('0xe')](_0x32effa(null));};}for(var e in events){if(events[_0x17ec('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xd444=['unreadMessages','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll'];(function(_0x3e6478,_0x58d025){var _0x3f821a=function(_0x3daeae){while(--_0x3daeae){_0x3e6478['push'](_0x3e6478['shift']());}};_0x3f821a(++_0x58d025);}(_0xd444,0x6c));var _0x4d44=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0xd444[_0x37e845];return _0x59e55b;};'use strict';var EventEmitter=require(_0x4d44('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4d44('0x1')];var MailMessage=require(_0x4d44('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4d44('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d44('0x4'),'afterDestroy':_0x4d44('0x5')};function emitEvent(_0x4a0527){return function(_0x184bce,_0x1ba224,_0x5944ea){_0x184bce['getUsers']({'attributes':['id'],'raw':!![]})[_0x4d44('0x6')](function(_0x37b1d9){_0x184bce[_0x4d44('0x7')](_0x4d44('0x8'),_0x37b1d9[_0x4d44('0x9')](function(_0x52e758){return{'id':_0x52e758['id']};}));return MailMessage[_0x4d44('0xa')]({'where':{'MailInteractionId':_0x184bce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4d44('0x6')](function(_0x17b862){_0x184bce['setDataValue'](_0x4d44('0xb'),_0x17b862[_0x4d44('0xc')]);MailInteractionEvents[_0x4d44('0xd')](_0x4a0527+':'+_0x184bce['id'],_0x184bce);MailInteractionEvents[_0x4d44('0xd')](_0x4a0527,_0x184bce);_0x5944ea(null);})[_0x4d44('0xe')](_0x5944ea(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4d44('0xf')](e,emitEvent(event));}}module[_0x4d44('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b4ba5bb..c520b65 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 _0xb88d=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','changed','format','closed','closedAt','models','then','catch','utf8mb4'];(function(_0x2d273f,_0x2a68c3){var _0x7297ea=function(_0x7d0e68){while(--_0x7d0e68){_0x2d273f['push'](_0x2d273f['shift']());}};_0x7297ea(++_0x2a68c3);}(_0xb88d,0x114));var _0xdb88=function(_0x4a07b4,_0xadef73){_0x4a07b4=_0x4a07b4-0x0;var _0x3ed0ed=_0xb88d[_0x4a07b4];return _0x3ed0ed;};'use strict';var _=require(_0xdb88('0x0'));var util=require('util');var logger=require(_0xdb88('0x1'))('api');var moment=require(_0xdb88('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb88('0x3'));var rimraf=require(_0xdb88('0x4'));var config=require(_0xdb88('0x5'));var attributes=require(_0xdb88('0x6'));module[_0xdb88('0x7')]=function(_0x28f4fb,_0x298fe9){return _0x28f4fb[_0xdb88('0x8')](_0xdb88('0x9'),attributes,{'tableName':_0xdb88('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xdb88('0xb'),'to'],'type':_0xdb88('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22adda,_0x4125b8,_0x25a55b){if(_0x22adda[_0xdb88('0xd')]){_0x22adda[_0xdb88('0xe')]=moment()['format'](_0xdb88('0xf'));}if(_0x22adda['closed']){_0x22adda['closedAt']=moment()['format'](_0xdb88('0xf'));}_0x25a55b(null,_0x4125b8);},'beforeUpdate':function(_0x1fd5e2,_0x220cce,_0x17aec1){if(_0x1fd5e2[_0xdb88('0x10')](_0xdb88('0xd'))){_0x1fd5e2[_0xdb88('0xe')]=_0x1fd5e2[_0xdb88('0xd')]?moment()[_0xdb88('0x11')](_0xdb88('0xf')):null;}if(_0x1fd5e2['changed'](_0xdb88('0x12'))){_0x1fd5e2[_0xdb88('0x13')]=moment()[_0xdb88('0x11')](_0xdb88('0xf'));_0x1fd5e2['substatus']=null;_0x1fd5e2[_0xdb88('0xe')]=null;}_0x17aec1(null,_0x1fd5e2);},'afterUpdate':function(_0x2c0a98,_0x4e1369,_0x8b0a6e){var _0x56efdf=_0x28f4fb[_0xdb88('0x14')];var _0x4a157e=_0x2c0a98['get']({'plain':!![]});if(_0x4a157e['closed']){return _0x56efdf['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x4a157e['id']}})[_0xdb88('0x15')](function(){_0x8b0a6e();})[_0xdb88('0x16')](function(_0x136185){_0x8b0a6e(_0x136185);});}else{_0x8b0a6e();}}},'charset':_0xdb88('0x17'),'collate':_0xdb88('0x18')});}; \ No newline at end of file +var _0x9de8=['../../config/logger','api','moment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1fc237,_0x1cb0d4){var _0x1916b0=function(_0x4ca148){while(--_0x4ca148){_0x1fc237['push'](_0x1fc237['shift']());}};_0x1916b0(++_0x1cb0d4);}(_0x9de8,0xdf));var _0x89de=function(_0x34d5c8,_0x1a3347){_0x34d5c8=_0x34d5c8-0x0;var _0x35da77=_0x9de8[_0x34d5c8];return _0x35da77;};'use strict';var _=require(_0x89de('0x0'));var util=require(_0x89de('0x1'));var logger=require(_0x89de('0x2'))(_0x89de('0x3'));var moment=require(_0x89de('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x89de('0x5'));module[_0x89de('0x6')]=function(_0x53091e,_0x5d994f){return _0x53091e[_0x89de('0x7')](_0x89de('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x89de('0x9'),'fields':[_0x89de('0xa'),'to'],'type':_0x89de('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ab080,_0xb497ba,_0x399eb5){if(_0x4ab080['substatus']){_0x4ab080[_0x89de('0xc')]=moment()[_0x89de('0xd')](_0x89de('0xe'));}if(_0x4ab080['closed']){_0x4ab080[_0x89de('0xf')]=moment()[_0x89de('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x399eb5(null,_0xb497ba);},'beforeUpdate':function(_0x526a8d,_0x417938,_0x38282d){if(_0x526a8d[_0x89de('0x10')](_0x89de('0x11'))){_0x526a8d[_0x89de('0xc')]=_0x526a8d[_0x89de('0x11')]?moment()['format'](_0x89de('0xe')):null;}if(_0x526a8d[_0x89de('0x10')]('closed')){_0x526a8d[_0x89de('0xf')]=moment()[_0x89de('0xd')](_0x89de('0xe'));_0x526a8d[_0x89de('0x11')]=null;_0x526a8d[_0x89de('0xc')]=null;}_0x38282d(null,_0x526a8d);},'afterUpdate':function(_0x59a83b,_0x5d2402,_0x39cb0f){var _0x35bd85=_0x53091e[_0x89de('0x12')];var _0x1963ba=_0x59a83b[_0x89de('0x13')]({'plain':!![]});if(_0x1963ba['closed']){return _0x35bd85['MailMessage'][_0x89de('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x1963ba['id']}})[_0x89de('0x15')](function(){_0x39cb0f();})[_0x89de('0x16')](function(_0x2e0d05){_0x39cb0f(_0x2e0d05);});}else{_0x39cb0f();}}},'charset':_0x89de('0x17'),'collate':_0x89de('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 55309fd..f598217 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 _0x1c76=['redis','localhost','register','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','MailInteraction','find','ids','omit','AddTags','debug','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','client'];(function(_0x1e16ab,_0x3663cf){var _0x23e052=function(_0x1b19a0){while(--_0x1b19a0){_0x1e16ab['push'](_0x1e16ab['shift']());}};_0x23e052(++_0x3663cf);}(_0x1c76,0x12b));var _0x61c7=function(_0x16ade9,_0x3d3ce1){_0x16ade9=_0x16ade9-0x0;var _0x3dcf70=_0x1c76[_0x16ade9];return _0x3dcf70;};'use strict';var _=require(_0x61c7('0x0'));var util=require('util');var moment=require(_0x61c7('0x1'));var BPromise=require(_0x61c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61c7('0x3'));var db=require(_0x61c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x61c7('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61c7('0x6')]['http']({'port':0x232a});config[_0x61c7('0x7')]=_['defaults'](config[_0x61c7('0x7')],{'host':_0x61c7('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x61c7('0x9')](socket);function respondWithRpcPromise(_0x259165,_0x3e6df9,_0x4224e8){return new BPromise(function(_0xf7ba4f,_0x20a06b){return client['request'](_0x259165,_0x4224e8)[_0x61c7('0xa')](function(_0x2b2039){logger[_0x61c7('0xb')](_0x61c7('0xc'),_0x3e6df9,'request\x20sent');logger['debug'](_0x61c7('0xd'),_0x3e6df9,_0x61c7('0xe'),JSON[_0x61c7('0xf')](_0x2b2039));if(_0x2b2039[_0x61c7('0x10')]){if(_0x2b2039[_0x61c7('0x10')]['code']===0x1f4){logger[_0x61c7('0x10')]('MailInteraction,\x20%s,\x20%s',_0x3e6df9,_0x2b2039[_0x61c7('0x10')][_0x61c7('0x11')]);return _0x20a06b(_0x2b2039[_0x61c7('0x10')]['message']);}logger['error'](_0x61c7('0xc'),_0x3e6df9,_0x2b2039[_0x61c7('0x10')][_0x61c7('0x11')]);return _0xf7ba4f(_0x2b2039[_0x61c7('0x10')][_0x61c7('0x11')]);}else{logger[_0x61c7('0xb')](_0x61c7('0xc'),_0x3e6df9,_0x61c7('0xe'));_0xf7ba4f(_0x2b2039[_0x61c7('0x12')]['message']);}})[_0x61c7('0x13')](function(_0x337fb5){logger[_0x61c7('0x10')](_0x61c7('0xc'),_0x3e6df9,_0x337fb5);_0x20a06b(_0x337fb5);});});}exports[_0x61c7('0x14')]=function(_0x3194d5){var _0x23b277=this;return new Promise(function(_0x1e0783,_0x2cadf7){return db['MailInteraction'][_0x61c7('0x15')](_0x3194d5[_0x61c7('0x16')],{'raw':_0x3194d5['options']?_0x3194d5[_0x61c7('0x17')][_0x61c7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3194d5['options']?_0x3194d5[_0x61c7('0x17')][_0x61c7('0x19')]||null:null,'attributes':_0x3194d5[_0x61c7('0x17')]?_0x3194d5[_0x61c7('0x17')][_0x61c7('0x1a')]||null:null,'limit':_0x3194d5['options']?_0x3194d5['options'][_0x61c7('0x1b')]||null:null})[_0x61c7('0xa')](function(_0x34fc65){logger[_0x61c7('0xb')](_0x61c7('0x14'),_0x3194d5);logger['debug']('UpdateMailInteraction',_0x3194d5,JSON[_0x61c7('0xf')](_0x34fc65));_0x1e0783(_0x34fc65);})[_0x61c7('0x13')](function(_0x2977b2){logger[_0x61c7('0x10')](_0x61c7('0x14'),_0x2977b2[_0x61c7('0x11')],_0x3194d5);_0x2cadf7(_0x23b277[_0x61c7('0x10')](0x1f4,_0x2977b2[_0x61c7('0x11')]));});});};exports['AddTagsToMailInteraction']=function(_0xce8fd5){return new Promise(function(_0x40deb4,_0x3edfde){return db[_0x61c7('0x1c')][_0x61c7('0x1d')]({'where':_0xce8fd5['options']?_0xce8fd5[_0x61c7('0x17')][_0x61c7('0x19')]||null:null})['then'](function(_0xc04532){if(_0xc04532){return _0xc04532['addTags'](_0xce8fd5[_0x61c7('0x16')][_0x61c7('0x1e')],_[_0x61c7('0x1f')](_0xce8fd5[_0x61c7('0x16')],[_0x61c7('0x1e'),'id'])||{});}})['spread'](function(_0xb1b22c){logger['info'](_0x61c7('0x20'),_0xce8fd5);logger[_0x61c7('0x21')](_0x61c7('0x20'),_0xce8fd5,JSON['stringify'](_0xb1b22c));_0x40deb4(_0xb1b22c);})[_0x61c7('0x13')](function(_0x9570da){logger[_0x61c7('0x10')](_0x61c7('0x20'),_0x9570da[_0x61c7('0x11')],_0xce8fd5);_0x3edfde(_this[_0x61c7('0x10')](0x1f4,_0x9570da[_0x61c7('0x11')]));});});}; \ No newline at end of file +var _0x5d87=['AddTags','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','MailInteraction','body','raw','options','where','attributes','limit','then','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','omit','ids','spread'];(function(_0x23cf72,_0x22e108){var _0x3bc541=function(_0x59ef43){while(--_0x59ef43){_0x23cf72['push'](_0x23cf72['shift']());}};_0x3bc541(++_0x22e108);}(_0x5d87,0x1b0));var _0x75d8=function(_0xe38d7d,_0x49ccec){_0xe38d7d=_0xe38d7d-0x0;var _0x965811=_0x5d87[_0xe38d7d];return _0x965811;};'use strict';var _=require('lodash');var util=require(_0x75d8('0x0'));var moment=require(_0x75d8('0x1'));var BPromise=require(_0x75d8('0x2'));var rs=require(_0x75d8('0x3'));var fs=require('fs');var Redis=require(_0x75d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x75d8('0x5'));var logger=require(_0x75d8('0x6'))('rpc');var config=require(_0x75d8('0x7'));var jayson=require(_0x75d8('0x8'));var client=jayson['client'][_0x75d8('0x9')]({'port':0x232a});config[_0x75d8('0xa')]=_[_0x75d8('0xb')](config[_0x75d8('0xa')],{'host':_0x75d8('0xc'),'port':0x18eb});var socket=require(_0x75d8('0xd'))(new Redis(config[_0x75d8('0xa')]));require(_0x75d8('0xe'))[_0x75d8('0xf')](socket);function respondWithRpcPromise(_0x3ed8c8,_0x4948a8,_0x340c79){return new BPromise(function(_0x49085c,_0x57f3d9){return client[_0x75d8('0x10')](_0x3ed8c8,_0x340c79)['then'](function(_0x4ffbdb){logger[_0x75d8('0x11')]('MailInteraction,\x20%s,\x20%s',_0x4948a8,_0x75d8('0x12'));logger[_0x75d8('0x13')](_0x75d8('0x14'),_0x4948a8,_0x75d8('0x12'),JSON[_0x75d8('0x15')](_0x4ffbdb));if(_0x4ffbdb[_0x75d8('0x16')]){if(_0x4ffbdb[_0x75d8('0x16')][_0x75d8('0x17')]===0x1f4){logger['error'](_0x75d8('0x18'),_0x4948a8,_0x4ffbdb['error'][_0x75d8('0x19')]);return _0x57f3d9(_0x4ffbdb['error'][_0x75d8('0x19')]);}logger[_0x75d8('0x16')](_0x75d8('0x18'),_0x4948a8,_0x4ffbdb[_0x75d8('0x16')][_0x75d8('0x19')]);return _0x49085c(_0x4ffbdb['error'][_0x75d8('0x19')]);}else{logger[_0x75d8('0x11')](_0x75d8('0x18'),_0x4948a8,_0x75d8('0x12'));_0x49085c(_0x4ffbdb['result']['message']);}})['catch'](function(_0x265141){logger['error']('MailInteraction,\x20%s,\x20%s',_0x4948a8,_0x265141);_0x57f3d9(_0x265141);});});}exports['UpdateMailInteraction']=function(_0x5d9aaf){var _0x2597d2=this;return new Promise(function(_0x2a0a8a,_0x421d1c){return db[_0x75d8('0x1a')]['update'](_0x5d9aaf[_0x75d8('0x1b')],{'raw':_0x5d9aaf['options']?_0x5d9aaf['options'][_0x75d8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d9aaf['options']?_0x5d9aaf[_0x75d8('0x1d')][_0x75d8('0x1e')]||null:null,'attributes':_0x5d9aaf[_0x75d8('0x1d')]?_0x5d9aaf[_0x75d8('0x1d')][_0x75d8('0x1f')]||null:null,'limit':_0x5d9aaf[_0x75d8('0x1d')]?_0x5d9aaf[_0x75d8('0x1d')][_0x75d8('0x20')]||null:null})[_0x75d8('0x21')](function(_0x2f8a5a){logger[_0x75d8('0x11')](_0x75d8('0x22'),_0x5d9aaf);logger[_0x75d8('0x13')]('UpdateMailInteraction',_0x5d9aaf,JSON[_0x75d8('0x15')](_0x2f8a5a));_0x2a0a8a(_0x2f8a5a);})['catch'](function(_0xb89de3){logger['error'](_0x75d8('0x22'),_0xb89de3[_0x75d8('0x19')],_0x5d9aaf);_0x421d1c(_0x2597d2[_0x75d8('0x16')](0x1f4,_0xb89de3['message']));});});};exports[_0x75d8('0x23')]=function(_0x29108e){return new Promise(function(_0x227904,_0x9593ef){return db['MailInteraction'][_0x75d8('0x24')]({'where':_0x29108e['options']?_0x29108e[_0x75d8('0x1d')][_0x75d8('0x1e')]||null:null})[_0x75d8('0x21')](function(_0x3de656){if(_0x3de656){return _0x3de656[_0x75d8('0x25')](_0x29108e[_0x75d8('0x1b')]['ids'],_[_0x75d8('0x26')](_0x29108e[_0x75d8('0x1b')],[_0x75d8('0x27'),'id'])||{});}})[_0x75d8('0x28')](function(_0x319c10){logger[_0x75d8('0x11')](_0x75d8('0x29'),_0x29108e);logger[_0x75d8('0x13')](_0x75d8('0x29'),_0x29108e,JSON[_0x75d8('0x15')](_0x319c10));_0x227904(_0x319c10);})[_0x75d8('0x2a')](function(_0x4e1ad7){logger[_0x75d8('0x16')](_0x75d8('0x29'),_0x4e1ad7[_0x75d8('0x19')],_0x29108e);_0x9593ef(_this[_0x75d8('0x16')](0x1f4,_0x4e1ad7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 521c46c..c16dad6 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 _0xc0d3=['mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc0d3,0x1f1));var _0x3c0d=function(_0x25129b,_0x116790){_0x25129b=_0x25129b-0x0;var _0x1115a7=_0xc0d3[_0x25129b];return _0x1115a7;};'use strict';var MailInteractionEvents=require(_0x3c0d('0x0'));var events=['save',_0x3c0d('0x1'),_0x3c0d('0x2')];function createListener(_0xc8c8e0,_0x5e93c3){return function(_0x9e5390){_0x5e93c3[_0x3c0d('0x3')](_0xc8c8e0,_0x9e5390);};}function removeListener(_0x5510b7,_0x4c7ff2){return function(){MailInteractionEvents[_0x3c0d('0x4')](_0x5510b7,_0x4c7ff2);};}exports[_0x3c0d('0x5')]=function(_0x4f4fac){for(var _0x293344=0x0,_0xabbd64=events[_0x3c0d('0x6')];_0x293344<_0xabbd64;_0x293344++){var _0xedc9de=events[_0x293344];var _0x4f346c=createListener(_0x3c0d('0x7')+_0xedc9de,_0x4f4fac);MailInteractionEvents['on'](_0xedc9de,_0x4f346c);}}; \ No newline at end of file +var _0xbf1f=['register','length','mailInteraction:','save','remove','update','removeListener'];(function(_0x195f3d,_0x2eb5bb){var _0x40a8ae=function(_0x46fa00){while(--_0x46fa00){_0x195f3d['push'](_0x195f3d['shift']());}};_0x40a8ae(++_0x2eb5bb);}(_0xbf1f,0x18b));var _0xfbf1=function(_0x444975,_0x44aaf0){_0x444975=_0x444975-0x0;var _0x45cc12=_0xbf1f[_0x444975];return _0x45cc12;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xfbf1('0x0'),_0xfbf1('0x1'),_0xfbf1('0x2')];function createListener(_0x53757a,_0x3e68c4){return function(_0xec5ea8){_0x3e68c4['emit'](_0x53757a,_0xec5ea8);};}function removeListener(_0x12742f,_0x5aca5d){return function(){MailInteractionEvents[_0xfbf1('0x3')](_0x12742f,_0x5aca5d);};}exports[_0xfbf1('0x4')]=function(_0xdb957b){for(var _0x17dbbb=0x0,_0x30ab6b=events[_0xfbf1('0x5')];_0x17dbbb<_0x30ab6b;_0x17dbbb++){var _0x49ce9e=events[_0x17dbbb];var _0x23f8cf=createListener(_0xfbf1('0x6')+_0x49ce9e,_0xdb957b);MailInteractionEvents['on'](_0x49ce9e,_0x23f8cf);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 78175ec..7c5de8d 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 _0xe348=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mail','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe348,0x137));var _0x8e34=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xe348[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var path=require('path');var timeout=require(_0x8e34('0x2'));var express=require(_0x8e34('0x3'));var router=express[_0x8e34('0x4')]();var fs_extra=require(_0x8e34('0x5'));var auth=require(_0x8e34('0x6'));var interaction=require(_0x8e34('0x7'));var config=require(_0x8e34('0x8'));var controller=require('./mailMessage.controller');router[_0x8e34('0x9')]('/',auth[_0x8e34('0xa')](),controller[_0x8e34('0xb')]);router['get'](_0x8e34('0xc'),auth[_0x8e34('0xa')](),controller[_0x8e34('0xd')]);router[_0x8e34('0x9')]('/:id',auth[_0x8e34('0xa')](),controller[_0x8e34('0xe')]);router[_0x8e34('0x9')](_0x8e34('0xf'),auth[_0x8e34('0xa')](),controller[_0x8e34('0x10')]);router[_0x8e34('0x11')]('/',auth[_0x8e34('0xa')](),interaction[_0x8e34('0x12')](_0x8e34('0x13'),'mailmessage:create'),controller[_0x8e34('0x14')]);router[_0x8e34('0x15')](_0x8e34('0x16'),auth[_0x8e34('0xa')](),controller[_0x8e34('0x17')]);router[_0x8e34('0x15')](_0x8e34('0x18'),auth['isAuthenticated'](),controller['accept']);router[_0x8e34('0x15')](_0x8e34('0x19'),auth[_0x8e34('0xa')](),controller[_0x8e34('0x1a')]);router[_0x8e34('0x1b')](_0x8e34('0x16'),auth['isAuthenticated'](),controller[_0x8e34('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x83e1=['download','isAuthenticated','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','show','/:id/download'];(function(_0x9f913e,_0x27613c){var _0xa193c8=function(_0x54dde2){while(--_0x54dde2){_0x9f913e['push'](_0x9f913e['shift']());}};_0xa193c8(++_0x27613c);}(_0x83e1,0x1ad));var _0x183e=function(_0x1c6d69,_0x2a13ee){_0x1c6d69=_0x1c6d69-0x0;var _0xcdd612=_0x83e1[_0x1c6d69];return _0xcdd612;};'use strict';var multer=require(_0x183e('0x0'));var util=require(_0x183e('0x1'));var path=require('path');var timeout=require(_0x183e('0x2'));var express=require('express');var router=express[_0x183e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x183e('0x4'));var config=require(_0x183e('0x5'));var controller=require('./mailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x183e('0x6')]);router[_0x183e('0x7')](_0x183e('0x8'),auth['isAuthenticated'](),controller[_0x183e('0x9')]);router[_0x183e('0x7')](_0x183e('0xa'),auth['isAuthenticated'](),controller[_0x183e('0xb')]);router[_0x183e('0x7')](_0x183e('0xc'),auth['isAuthenticated'](),controller[_0x183e('0xd')]);router['post']('/',auth[_0x183e('0xe')](),interaction[_0x183e('0xf')](_0x183e('0x10'),_0x183e('0x11')),controller[_0x183e('0x12')]);router[_0x183e('0x13')](_0x183e('0xa'),auth['isAuthenticated'](),controller['update']);router['put'](_0x183e('0x14'),auth[_0x183e('0xe')](),controller[_0x183e('0x15')]);router['put'](_0x183e('0x16'),auth[_0x183e('0xe')](),controller[_0x183e('0x17')]);router['delete'](_0x183e('0xa'),auth[_0x183e('0xe')](),controller[_0x183e('0x18')]);module[_0x183e('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6b32681..c2b986e 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 _0x16a1=['medium','ENUM','out','STRING','DATE','Email','Chat','lodash','exports','TEXT','long'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x16a1,0x1b4));var _0x116a=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x16a1[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');var _=require(_0x116a('0x0'));module[_0x116a('0x1')]={'body':{'type':Sequelize[_0x116a('0x2')](_0x116a('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x116a('0x2')](_0x116a('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x116a('0x5')]('in',_0x116a('0x6')),'defaultValue':_0x116a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x116a('0x7')](0x1fe)},'from':{'type':Sequelize[_0x116a('0x7')]},'to':{'type':Sequelize[_0x116a('0x2')](_0x116a('0x3'))},'cc':{'type':Sequelize[_0x116a('0x2')]('long')},'bcc':{'type':Sequelize[_0x116a('0x2')](_0x116a('0x3'))},'subject':{'type':Sequelize[_0x116a('0x2')]},'sentAt':{'type':Sequelize[_0x116a('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0x116a('0x3'))},'originChannel':{'type':Sequelize[_0x116a('0x5')](_0x116a('0x9'),_0x116a('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x28a1=['TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','lodash','exports'];(function(_0x3ec84d,_0x21a9c3){var _0x2b5a1d=function(_0x50a9d3){while(--_0x50a9d3){_0x3ec84d['push'](_0x3ec84d['shift']());}};_0x2b5a1d(++_0x21a9c3);}(_0x28a1,0xeb));var _0x128a=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x28a1[_0x2136a6];return _0x55b948;};'use strict';var Sequelize=require(_0x128a('0x0'));var _=require(_0x128a('0x1'));module[_0x128a('0x2')]={'body':{'type':Sequelize[_0x128a('0x3')](_0x128a('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x128a('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x128a('0x6')]('in',_0x128a('0x7')),'defaultValue':_0x128a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x128a('0x8')](0x1fe)},'from':{'type':Sequelize[_0x128a('0x8')]},'to':{'type':Sequelize[_0x128a('0x3')]('long')},'cc':{'type':Sequelize[_0x128a('0x3')](_0x128a('0x4'))},'bcc':{'type':Sequelize[_0x128a('0x3')](_0x128a('0x4'))},'subject':{'type':Sequelize[_0x128a('0x3')]},'sentAt':{'type':Sequelize[_0x128a('0x9')]},'attach':{'type':Sequelize[_0x128a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x128a('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x128a('0x9')]},'originTo':{'type':Sequelize[_0x128a('0x3')]('long')},'originCc':{'type':Sequelize[_0x128a('0x3')](_0x128a('0x4'))},'originChannel':{'type':Sequelize[_0x128a('0x6')](_0x128a('0xc'),_0x128a('0xd')),'defaultValue':_0x128a('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e90ba73..994867d 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 _0x217b=['util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','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','count','limit','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','body','describe','direction','out','MailAccount','findOne','MailAccountId','List','CmContact','updatedAt','MailServerOut','Smtp','service','host','port','secure','pass','auth','attachments','join','root','server/files/attachments','basename','Contacts','create','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','rejectmessage','toString','files','server','from','bcc','subject','createdAt','Attachments','decode','headers','Bcc','existsSync','push','readFileSync','build','download','unlinkSync','eml-format'];(function(_0x1541c6,_0x170408){var _0x41901b=function(_0x517db0){while(--_0x517db0){_0x1541c6['push'](_0x1541c6['shift']());}};_0x41901b(++_0x170408);}(_0x217b,0x13b));var _0xb217=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x217b[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require(_0xb217('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xb217('0x1'));var path=require(_0xb217('0x2'));var fs=require('fs');var _=require(_0xb217('0x3'));var Redis=require(_0xb217('0x4'));var htmlToText=require(_0xb217('0x5'));var qs=require(_0xb217('0x6'));var logger=require(_0xb217('0x7'))(_0xb217('0x8'));var interaction_log=require(_0xb217('0x7'))(_0xb217('0x9'));var config=require(_0xb217('0xa'));var db=require(_0xb217('0xb'))['db'];config[_0xb217('0xc')]=_[_0xb217('0xd')](config[_0xb217('0xc')],{'host':_0xb217('0xe'),'port':0x18eb});var socket=require(_0xb217('0xf'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0xb217('0x10'))[_0xb217('0x11')](socket);var jayson=require(_0xb217('0x12'));var client=jayson['client'][_0xb217('0x13')]({'port':0x232c});var client9003=jayson[_0xb217('0x14')]['http']({'port':0x232b});var client9002=jayson['client'][_0xb217('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x522b84,_0x467093,_0x4eda24,_0xc8efbf){return new BPromise(function(_0x4322e0,_0x52af19){var _0x522db8=_0xc8efbf||client;return _0x522db8[_0xb217('0x15')](_0x522b84,_0x4eda24)[_0xb217('0x16')](function(_0x15d2a0){logger[_0xb217('0x17')](_0xb217('0x18'),_0x467093,_0xb217('0x19'));logger[_0xb217('0x1a')](_0xb217('0x1b'),_0x467093,_0xb217('0x19'),JSON[_0xb217('0x1c')](_0x15d2a0));if(_0x15d2a0[_0xb217('0x1d')]){if(_0x15d2a0[_0xb217('0x1d')][_0xb217('0x1e')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x467093,_0x15d2a0['error'][_0xb217('0x1f')]);return _0x52af19(_0x15d2a0[_0xb217('0x1d')][_0xb217('0x1f')]);}logger['error'](_0xb217('0x18'),_0x467093,_0x15d2a0[_0xb217('0x1d')][_0xb217('0x1f')]);return _0x4322e0(_0x15d2a0['error'][_0xb217('0x1f')]);}else{logger[_0xb217('0x17')](_0xb217('0x18'),_0x467093,_0xb217('0x19'));_0x4322e0(_0x15d2a0[_0xb217('0x20')]['message']);}})[_0xb217('0x21')](function(_0x23b16b){logger[_0xb217('0x1d')]('MailMessage,\x20%s,\x20%s',_0x467093,_0x23b16b);_0x52af19(_0x23b16b);});});}function respondWithResult(_0x4527be,_0x22375a){_0x22375a=_0x22375a||0xc8;return function(_0x36c8ab){if(_0x36c8ab){return _0x4527be[_0xb217('0x22')](_0x22375a)[_0xb217('0x23')](_0x36c8ab);}};}function respondWithFilteredResult(_0x39a486,_0x1bffdd){return function(_0x3432fe){if(_0x3432fe){var _0x287a55=typeof _0x1bffdd[_0xb217('0x24')]==='undefined'&&typeof _0x1bffdd['limit']==='undefined';var _0x4d21f7=_0x3432fe[_0xb217('0x25')];var _0x448926=_0x287a55?0x0:_0x1bffdd['offset'];var _0x4cb22a=_0x287a55?_0x3432fe[_0xb217('0x25')]:_0x1bffdd['offset']+_0x1bffdd[_0xb217('0x26')];var _0x1d06d8;if(_0x4cb22a>=_0x4d21f7){_0x4cb22a=_0x4d21f7;_0x1d06d8=0xc8;}else{_0x1d06d8=0xce;}_0x39a486[_0xb217('0x22')](_0x1d06d8);return _0x39a486['set']('Content-Range',_0x448926+'-'+_0x4cb22a+'/'+_0x4d21f7)[_0xb217('0x23')](_0x3432fe);}return null;};}function saveUpdates(_0xf9f11e){return function(_0x5ea437){if(_0x5ea437){return _0x5ea437[_0xb217('0x27')](_0xf9f11e)[_0xb217('0x16')](function(_0x192327){return _0x192327;});}return null;};}function removeEntity(_0x1c8168){return function(_0x3303c8){if(_0x3303c8){return _0x3303c8[_0xb217('0x28')]()[_0xb217('0x16')](function(){_0x1c8168['status'](0xcc)[_0xb217('0x29')]();});}};}function handleEntityNotFound(_0x1cac7d){return function(_0x219f3e){if(!_0x219f3e){_0x1cac7d[_0xb217('0x2a')](0x194);}return _0x219f3e;};}function handleError(_0x47b316,_0x110e75){_0x110e75=_0x110e75||0x1f4;return function(_0x1b16e2){logger[_0xb217('0x1d')](_0x1b16e2[_0xb217('0x2b')]);if(_0x1b16e2[_0xb217('0x2c')]){delete _0x1b16e2['name'];}_0x47b316[_0xb217('0x22')](_0x110e75)[_0xb217('0x2d')](_0x1b16e2);};}exports[_0xb217('0x2e')]=function(_0x5bc29d,_0x2a422b){var _0x5a26ba={},_0x3949ea={},_0x201dd5={'count':0x0,'rows':[]};var _0xc0f548=_['map'](db[_0xb217('0x2f')][_0xb217('0x30')],function(_0x2a1ac7){return{'name':_0x2a1ac7['fieldName'],'type':_0x2a1ac7[_0xb217('0x31')]['key']};});_0x3949ea[_0xb217('0x32')]=_[_0xb217('0x33')](_0xc0f548,'name');_0x3949ea[_0xb217('0x34')]=_[_0xb217('0x35')](_0x5bc29d['query']);_0x3949ea[_0xb217('0x36')]=_[_0xb217('0x37')](_0x3949ea[_0xb217('0x32')],_0x3949ea[_0xb217('0x34')]);_0x5a26ba[_0xb217('0x38')]=_[_0xb217('0x37')](_0x3949ea[_0xb217('0x32')],qs[_0xb217('0x39')](_0x5bc29d[_0xb217('0x34')]['fields']));_0x5a26ba[_0xb217('0x38')]=_0x5a26ba[_0xb217('0x38')][_0xb217('0x3a')]?_0x5a26ba['attributes']:_0x3949ea[_0xb217('0x32')];if(!_0x5bc29d[_0xb217('0x34')][_0xb217('0x3b')](_0xb217('0x3c'))){_0x5a26ba[_0xb217('0x26')]=qs['limit'](_0x5bc29d[_0xb217('0x34')]['limit']);_0x5a26ba[_0xb217('0x24')]=qs[_0xb217('0x24')](_0x5bc29d[_0xb217('0x34')]['offset']);}_0x5a26ba[_0xb217('0x3d')]=qs['sort'](_0x5bc29d[_0xb217('0x34')]['sort']);_0x5a26ba[_0xb217('0x3e')]=qs[_0xb217('0x36')](_['pick'](_0x5bc29d[_0xb217('0x34')],_0x3949ea[_0xb217('0x36')]),_0xc0f548);if(_0x5bc29d[_0xb217('0x34')][_0xb217('0x3f')]){_0x5a26ba[_0xb217('0x3e')]=_[_0xb217('0x40')](_0x5a26ba[_0xb217('0x3e')],{'$or':_[_0xb217('0x33')](_0xc0f548,function(_0x3d9e44){if(_0x3d9e44[_0xb217('0x31')]!==_0xb217('0x41')){var _0x69eb9b={};_0x69eb9b[_0x3d9e44[_0xb217('0x2c')]]={'$like':'%'+_0x5bc29d['query'][_0xb217('0x3f')]+'%'};return _0x69eb9b;}})});}_0x5a26ba=_[_0xb217('0x40')]({},_0x5a26ba,_0x5bc29d[_0xb217('0x42')]);var _0xca6919={'where':_0x5a26ba['where']};return db[_0xb217('0x2f')][_0xb217('0x25')](_0xca6919)[_0xb217('0x16')](function(_0x15609d){_0x201dd5[_0xb217('0x25')]=_0x15609d;if(_0x5bc29d[_0xb217('0x34')][_0xb217('0x43')]){_0x5a26ba[_0xb217('0x44')]=[{'all':!![]}];}return db[_0xb217('0x2f')]['findAll'](_0x5a26ba);})[_0xb217('0x16')](function(_0x1e2917){_0x201dd5[_0xb217('0x45')]=_0x1e2917;return _0x201dd5;})[_0xb217('0x16')](respondWithFilteredResult(_0x2a422b,_0x5a26ba))[_0xb217('0x21')](handleError(_0x2a422b,null));};exports[_0xb217('0x46')]=function(_0x5eea7f,_0xfd7055){var _0x3f9f39={'raw':!![],'where':{'id':_0x5eea7f[_0xb217('0x47')]['id']}},_0x2ede2a={};_0x2ede2a['model']=_[_0xb217('0x35')](db[_0xb217('0x2f')][_0xb217('0x30')]);_0x2ede2a[_0xb217('0x34')]=_[_0xb217('0x35')](_0x5eea7f[_0xb217('0x34')]);_0x2ede2a[_0xb217('0x36')]=_[_0xb217('0x37')](_0x2ede2a[_0xb217('0x32')],_0x2ede2a[_0xb217('0x34')]);_0x3f9f39['attributes']=_[_0xb217('0x37')](_0x2ede2a[_0xb217('0x32')],qs[_0xb217('0x39')](_0x5eea7f[_0xb217('0x34')][_0xb217('0x39')]));_0x3f9f39[_0xb217('0x38')]=_0x3f9f39[_0xb217('0x38')][_0xb217('0x3a')]?_0x3f9f39[_0xb217('0x38')]:_0x2ede2a[_0xb217('0x32')];if(_0x5eea7f[_0xb217('0x34')][_0xb217('0x43')]){_0x3f9f39['include']=[{'all':!![]}];}_0x3f9f39=_[_0xb217('0x40')]({},_0x3f9f39,_0x5eea7f[_0xb217('0x42')]);return db[_0xb217('0x2f')][_0xb217('0x48')](_0x3f9f39)[_0xb217('0x16')](handleEntityNotFound(_0xfd7055,null))['then'](respondWithResult(_0xfd7055,null))['catch'](handleError(_0xfd7055,null));};exports[_0xb217('0x27')]=function(_0x3a1668,_0x2912fd){if(_0x3a1668[_0xb217('0x49')]['id']){delete _0x3a1668[_0xb217('0x49')]['id'];}return db['MailMessage'][_0xb217('0x48')]({'where':{'id':_0x3a1668[_0xb217('0x47')]['id']}})[_0xb217('0x16')](handleEntityNotFound(_0x2912fd,null))[_0xb217('0x16')](saveUpdates(_0x3a1668[_0xb217('0x49')],null))['then'](respondWithResult(_0x2912fd,null))[_0xb217('0x21')](handleError(_0x2912fd,null));};exports[_0xb217('0x28')]=function(_0x58bf29,_0x3b009d){return db[_0xb217('0x2f')][_0xb217('0x48')]({'where':{'id':_0x58bf29['params']['id']}})[_0xb217('0x16')](handleEntityNotFound(_0x3b009d,null))[_0xb217('0x16')](removeEntity(_0x3b009d,null))['catch'](handleError(_0x3b009d,null));};exports[_0xb217('0x4a')]=function(_0x2f4b2b,_0x547854){return db[_0xb217('0x2f')][_0xb217('0x4a')]()[_0xb217('0x16')](respondWithResult(_0x547854,null))[_0xb217('0x21')](handleError(_0x547854,null));};exports['create']=function(_0x161eea,_0x2a06ee){return db['MailMessage']['create'](_0x161eea[_0xb217('0x49')])[_0xb217('0x16')](function(_0xbcd302){if(_0xbcd302){if(_0xbcd302[_0xb217('0x4b')]===_0xb217('0x4c')&&!_0xbcd302['secret']){var _0x50cef7,_0x2ce73f,_0x45bf64;if(_0x161eea[_0xb217('0x49')]['to']){_0x2ce73f=_0x161eea[_0xb217('0x49')]['to']['split'](',')[0x0];}return db[_0xb217('0x4d')][_0xb217('0x4e')]({'where':{'id':_0xbcd302[_0xb217('0x4f')]},'include':[{'model':db['CmList'],'as':_0xb217('0x50'),'include':[{'model':db[_0xb217('0x51')],'as':'Contacts','where':{'email':_0x2ce73f},'limit':0x1,'order':[[_0xb217('0x52'),'DESC']]}]},{'model':db[_0xb217('0x53')],'as':'Smtp','raw':!![]}]})[_0xb217('0x16')](function(_0x4124d7){_0x50cef7=_0x4124d7;if(_0x50cef7&&_0x50cef7[_0xb217('0x54')]){var _0x514aff={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x50cef7[_0xb217('0x54')][_0xb217('0x55')])){_0x514aff[_0xb217('0x56')]=_0x50cef7[_0xb217('0x54')][_0xb217('0x56')];_0x514aff[_0xb217('0x57')]=_0x50cef7[_0xb217('0x54')][_0xb217('0x57')];_0x514aff[_0xb217('0x58')]=_0x50cef7[_0xb217('0x54')]['secure'];if(_0x50cef7[_0xb217('0x54')]['authentication']){_0x514aff['auth']={'user':_0x50cef7[_0xb217('0x54')]['user'],'pass':_0x50cef7[_0xb217('0x54')][_0xb217('0x59')]};}}else{_0x514aff['service']=_0x50cef7['Smtp']['service'];_0x514aff[_0xb217('0x5a')]={'user':_0x50cef7[_0xb217('0x54')]['user'],'pass':_0x50cef7[_0xb217('0x54')][_0xb217('0x59')]};_0x514aff['secure']=_0x50cef7[_0xb217('0x54')][_0xb217('0x58')];}if(_0x161eea['body']['attachments']&&_0x161eea[_0xb217('0x49')][_0xb217('0x5b')][_0xb217('0x3a')]){for(var _0x27a543=0x0;_0x27a543<_0x161eea[_0xb217('0x49')][_0xb217('0x5b')]['length'];_0x27a543+=0x1){_0x161eea[_0xb217('0x49')][_0xb217('0x5b')][_0x27a543]={'filename':_0x161eea['body']['attachments'][_0x27a543][_0xb217('0x2c')],'path':path[_0xb217('0x5c')](config[_0xb217('0x5d')],_0xb217('0x5e'),_0x161eea[_0xb217('0x49')][_0xb217('0x5b')][_0x27a543][_0xb217('0x5f')])};}}_0x45bf64={'account':_0x514aff,'message':_0x161eea['body']};return;}})[_0xb217('0x16')](function(){if(_0x50cef7[_0xb217('0x50')]){if(_0x50cef7[_0xb217('0x50')][_0xb217('0x60')][_0xb217('0x3a')]){return _0x50cef7[_0xb217('0x50')][_0xb217('0x60')][0x0];}else{return db[_0xb217('0x51')][_0xb217('0x61')](_['defaults'](_0x161eea['body'],{'firstName':_0x161eea['body']['to'],'email':_0x161eea[_0xb217('0x49')]['to'],'phone':_0x161eea[_0xb217('0x49')]['to'],'ListId':_0x50cef7[_0xb217('0x62')]}));}}else{throw new Error(_0xb217('0x63'));}})[_0xb217('0x16')](function(){if(_0x45bf64){return respondWithRpcPromise(_0xb217('0x64'),'sendMail',_0x45bf64,client9003)[_0xb217('0x16')](function(_0x2aa173){return _0xbcd302[_0xb217('0x27')]({'read':!![],'messageId':_0x2aa173['messageId'],'sentAt':moment()[_0xb217('0x65')](_0xb217('0x66'))});})[_0xb217('0x21')](function(_0x3a489b){logger[_0xb217('0x1d')]('%s',JSON[_0xb217('0x1c')](_0x3a489b));return _0xbcd302;});}return _0xbcd302;});}return _0xbcd302;}})[_0xb217('0x16')](respondWithResult(_0x2a06ee,0xc9))[_0xb217('0x21')](handleError(_0x2a06ee,null));};exports['accept']=function(_0x4473b,_0x2c648c){var _0x151048={'agent':{},'channel':_0xb217('0x67')};if(_0x4473b[_0xb217('0x49')]['id']){delete _0x4473b[_0xb217('0x49')]['id'];}_0x4473b[_0xb217('0x49')][_0xb217('0x68')]=!![];_0x4473b[_0xb217('0x49')][_0xb217('0x69')]=moment()[_0xb217('0x65')](_0xb217('0x66'));_0x4473b['body'][_0xb217('0x6a')]=_0x4473b[_0xb217('0x49')][_0xb217('0x6a')]||_0x4473b[_0xb217('0x6b')]['id'];_0x151048[_0xb217('0x6c')]['id']=_0x4473b[_0xb217('0x49')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x4473b[_0xb217('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c648c,null))[_0xb217('0x16')](saveUpdates(_0x4473b[_0xb217('0x49')],null))[_0xb217('0x16')](function(_0x547e59){if(_0x547e59){_0x151048[_0xb217('0x1f')]=_0x547e59[_0xb217('0x6d')]({'plain':!![]});return db[_0xb217('0x6e')][_0xb217('0x48')]({'where':{'id':_0x547e59[_0xb217('0x6f')]}});}return null;})[_0xb217('0x16')](handleEntityNotFound(_0x2c648c,null))[_0xb217('0x16')](function(_0x2de688){if(_0x2de688){return _0x2de688[_0xb217('0x27')]({'UserId':_0x4473b[_0xb217('0x49')][_0xb217('0x6a')],'read1stAt':_['isNil'](_0x2de688[_0xb217('0x70')])?moment()[_0xb217('0x65')](_0xb217('0x66')):undefined});}return null;})[_0xb217('0x16')](function(_0x4fdeba){if(_0x4fdeba){_0x151048[_0xb217('0x71')]=_0x4fdeba[_0xb217('0x6d')]({'plain':!![]});interaction_log[_0xb217('0x17')](_0xb217('0x72'),_0x4473b[_0xb217('0x6b')]['id'],_0x4473b['user'][_0xb217('0x2c')],_0x4473b[_0xb217('0x6b')]['role'],_0x151048['interaction']['id'],_0x4473b[_0xb217('0x49')]?JSON['stringify'](_0x4473b[_0xb217('0x49')]):_0xb217('0x73'));return respondWithRpcPromise(_0xb217('0x74'),'acceptMessage',_0x151048);}return null;})[_0xb217('0x16')](function(_0x24fe0b){var _0x1ec714='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24fe0b[_0xb217('0x1f')][_0xb217('0x75')];return db[_0xb217('0x76')][_0xb217('0x34')](_0x1ec714,{'type':db['Sequelize'][_0xb217('0x77')][_0xb217('0x78')],'raw':!![]})['then'](function(_0x2800a7){return _0x2800a7;});})[_0xb217('0x16')](function(_0x300517){if(_0x300517){_0x151048['message'][_0xb217('0x79')]=_0x300517[0x0];if(!_0x4473b[_0xb217('0x49')]['UserId'])return;return db['User'][_0xb217('0x48')]({'where':{'id':_0x4473b['body'][_0xb217('0x6a')],'role':'agent'},'attributes':['id',_0xb217('0x2c'),_0xb217('0x7a'),_0xb217('0x7b'),_0xb217('0x7c')],'raw':!![]});}return null;})[_0xb217('0x16')](function(_0x35e2bc){if(!_0x35e2bc)return null;_0x151048[_0xb217('0x1f')][_0xb217('0x6c')]=_0x35e2bc;return _0x151048;})[_0xb217('0x16')](function(_0x24d68c){if(_0x24d68c){if(_0x4473b[_0xb217('0x49')][_0xb217('0x7d')]){_0x151048[_0xb217('0x1f')][_0xb217('0x7e')]=util[_0xb217('0x65')](_0xb217('0x7f'),_0x4473b[_0xb217('0x6b')][_0xb217('0x2c')]);_0x151048[_0xb217('0x1f')][_0xb217('0x80')]=_0x151048[_0xb217('0x80')];_0x151048[_0xb217('0x1f')][_0xb217('0x81')]=_0x151048[_0xb217('0x80')];_0x151048['message'][_0xb217('0x82')]=_0xb217('0x83');_0x151048[_0xb217('0x1f')][_0xb217('0x49')]=htmlToText[_0xb217('0x84')](_0x151048[_0xb217('0x1f')][_0xb217('0x49')]);return respondWithRpcPromise(_0xb217('0x85'),'EventManager',{'event':_0xb217('0x86'),'message':_0x151048[_0xb217('0x1f')]},client9002)[_0xb217('0x16')](function(){return _0x151048;});}return _0x151048;}return null;})[_0xb217('0x16')](respondWithResult(_0x2c648c,null))['catch'](handleError(_0x2c648c,null));};exports[_0xb217('0x87')]=function(_0x5cfa6b,_0x4c97ab){var _0x1b0abe={'agent':{},'channel':'mail'};if(_0x5cfa6b[_0xb217('0x49')]['id']){delete _0x5cfa6b[_0xb217('0x49')]['id'];}_0x5cfa6b[_0xb217('0x49')]['UserId']=_0x5cfa6b[_0xb217('0x49')][_0xb217('0x6a')]||_0x5cfa6b[_0xb217('0x6b')]['id'];_0x1b0abe[_0xb217('0x6c')]['id']=_0x5cfa6b['body']['UserId'];return db[_0xb217('0x2f')]['find']({'where':{'id':_0x5cfa6b['params']['id'],'UserId':null}})[_0xb217('0x16')](handleEntityNotFound(_0x4c97ab,null))[_0xb217('0x16')](function(_0x1f4428){if(_0x1f4428){_0x1b0abe['message']=_0x1f4428[_0xb217('0x6d')]({'plain':!![]});return db[_0xb217('0x6e')][_0xb217('0x48')]({'where':{'id':_0x1f4428[_0xb217('0x6f')]}});}return null;})[_0xb217('0x16')](handleEntityNotFound(_0x4c97ab,null))['then'](function(_0x22489b){if(_0x22489b){_0x1b0abe[_0xb217('0x71')]=_0x22489b['get']({'plain':!![]});interaction_log[_0xb217('0x17')](_0xb217('0x88'),_0x5cfa6b[_0xb217('0x6b')]['id'],_0x5cfa6b[_0xb217('0x6b')][_0xb217('0x2c')],_0x5cfa6b[_0xb217('0x6b')]['role'],_0x1b0abe[_0xb217('0x71')]['id'],_0x5cfa6b['body']?JSON[_0xb217('0x1c')](_0x5cfa6b[_0xb217('0x49')]):_0xb217('0x73'));return respondWithRpcPromise('RejectMessage',_0xb217('0x89'),_0x1b0abe);}return null;})[_0xb217('0x16')](function(_0x5d4622){var _0x5aaad7=_0xb217('0x8a')+_0x5d4622[_0xb217('0x1f')][_0xb217('0x75')];return db[_0xb217('0x76')][_0xb217('0x34')](_0x5aaad7,{'type':db[_0xb217('0x8b')][_0xb217('0x77')][_0xb217('0x78')],'raw':!![]})[_0xb217('0x16')](function(_0x259710){return _0x259710;});})['then'](function(_0x381148){if(_0x381148){_0x1b0abe[_0xb217('0x1f')][_0xb217('0x79')]=_0x381148[0x0];if(!_0x5cfa6b[_0xb217('0x49')][_0xb217('0x6a')])return;return db['User'][_0xb217('0x48')]({'where':{'id':_0x5cfa6b[_0xb217('0x49')]['UserId'],'role':_0xb217('0x6c')},'attributes':['id',_0xb217('0x2c'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xb217('0x16')](function(_0x3b9e7a){if(!_0x3b9e7a)return null;_0x1b0abe[_0xb217('0x1f')][_0xb217('0x6c')]=_0x3b9e7a;return _0x1b0abe;})['then'](function(_0x22e16e){if(_0x22e16e){_0x22e16e['message'][_0xb217('0x7e')]=util[_0xb217('0x65')]('SIP/%s',_0x5cfa6b[_0xb217('0x6b')]['name']);_0x22e16e[_0xb217('0x1f')][_0xb217('0x80')]=_0x1b0abe[_0xb217('0x80')];_0x22e16e[_0xb217('0x1f')][_0xb217('0x81')]=_0x1b0abe[_0xb217('0x80')];_0x22e16e[_0xb217('0x1f')][_0xb217('0x82')]=_0xb217('0x87');_0x22e16e['message']['body']=htmlToText[_0xb217('0x84')](_0x1b0abe[_0xb217('0x1f')]['body']);respondWithRpcPromise('EventManager',_0xb217('0x85'),{'event':_0xb217('0x8c'),'message':_0x22e16e[_0xb217('0x1f')]},client9002);return _0x1b0abe;}return null;})[_0xb217('0x16')](respondWithResult(_0x4c97ab,null))[_0xb217('0x21')](handleError(_0x4c97ab,null));};exports['download']=function(_0x8f52c,_0x5c6e25){var _0x4d01aa=moment()['unix']()[_0xb217('0x8d')]();var _0x3e96ba=path['join'](config[_0xb217('0x5d')],'server',_0xb217('0x8e'),'tmp');var _0xa81e8d=path['join'](config[_0xb217('0x5d')],_0xb217('0x8f'),_0xb217('0x8e'),_0xb217('0x5b'));var _0x27d2e5=util[_0xb217('0x65')]('message-%s.eml',_0x4d01aa);return db[_0xb217('0x2f')][_0xb217('0x48')]({'where':{'id':_0x8f52c[_0xb217('0x47')]['id']},'attributes':['id','body',_0xb217('0x90'),'to','cc',_0xb217('0x91'),_0xb217('0x92'),_0xb217('0x93')],'include':_0x8f52c[_0xb217('0x34')][_0xb217('0x5b')]?[{'model':db['Attachment'],'as':_0xb217('0x94')}]:undefined})['then'](handleEntityNotFound(_0x5c6e25,null))[_0xb217('0x16')](function(_0x1e1b2c){if(_0x1e1b2c){var _0x258c3e=_0x1e1b2c;var _0x247b13={'from':_0x258c3e['from'],'to':_0x258c3e['to'],'subject':_0x258c3e[_0xb217('0x92')],'html':htmlEntities[_0xb217('0x95')](_0x258c3e[_0xb217('0x49')]),'headers':{'Date':moment(_0x258c3e[_0xb217('0x93')])[_0xb217('0x65')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1e1b2c['cc']){_0x247b13[_0xb217('0x96')]['Cc']=_0x1e1b2c['cc'];}if(_0x1e1b2c[_0xb217('0x91')]){_0x247b13['headers'][_0xb217('0x97')]=_0x1e1b2c[_0xb217('0x91')];}return new BPromise(function(_0x257e86,_0x444b67){if(_0x1e1b2c[_0xb217('0x94')]){for(var _0x22f768=0x0;_0x22f768<_0x1e1b2c[_0xb217('0x94')][_0xb217('0x3a')];_0x22f768++){var _0x8d7c87=_0x1e1b2c[_0xb217('0x94')][_0x22f768];var _0x52e2a9=path[_0xb217('0x5c')](_0xa81e8d,_0x8d7c87['basename']);if(fs[_0xb217('0x98')](_0x52e2a9)){_0x247b13[_0xb217('0x5b')][_0xb217('0x99')]({'name':_0x8d7c87[_0xb217('0x2c')],'contentType':_0x8d7c87[_0xb217('0x31')],'data':fs[_0xb217('0x9a')](_0x52e2a9)});}}}emlformat[_0xb217('0x9b')](_0x247b13,function(_0xc513b,_0x2f09a7){if(_0xc513b)return _0x444b67(_0xc513b);fs['writeFileSync'](path[_0xb217('0x5c')](_0x3e96ba,_0x27d2e5),_0x2f09a7);return _0x257e86(_0x2f09a7);});});}})['then'](function(_0x285d68){if(_0x285d68){return _0x5c6e25[_0xb217('0x9c')](path[_0xb217('0x5c')](_0x3e96ba,_0x27d2e5),_0x27d2e5,function(_0x581fb2){if(!_0x581fb2)fs[_0xb217('0x9d')](path['join'](_0x3e96ba,_0x27d2e5));});}})[_0xb217('0x21')](handleError(_0x5c6e25,null));}; \ No newline at end of file +var _0x64b1=['include','findAll','rows','show','params','length','find','body','describe','create','direction','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','defaults','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','User','fullname','fromString','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','push','readFileSync','writeFileSync','eml-format','moment','util','path','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','html-entities','./mailMessage.socket','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','json','offset','limit','undefined','count','set','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','MailMessage','includeAll'];(function(_0x72f059,_0x1b0590){var _0x33a83a=function(_0x2c48a9){while(--_0x2c48a9){_0x72f059['push'](_0x72f059['shift']());}};_0x33a83a(++_0x1b0590);}(_0x64b1,0x64));var _0x164b=function(_0x18ffdb,_0x164ba4){_0x18ffdb=_0x18ffdb-0x0;var _0x2a6e17=_0x64b1[_0x18ffdb];return _0x2a6e17;};'use strict';var emlformat=require(_0x164b('0x0'));var moment=require(_0x164b('0x1'));var BPromise=require('bluebird');var util=require(_0x164b('0x2'));var path=require(_0x164b('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x164b('0x4'));var htmlToText=require(_0x164b('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x164b('0x6'))(_0x164b('0x7'));var interaction_log=require(_0x164b('0x6'))(_0x164b('0x8'));var config=require(_0x164b('0x9'));var db=require(_0x164b('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x164b('0xb')]));var htmlEntities=require(_0x164b('0xc'));require(_0x164b('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x164b('0xe')]['http']({'port':0x232c});var client9003=jayson[_0x164b('0xe')][_0x164b('0xf')]({'port':0x232b});var client9002=jayson[_0x164b('0xe')][_0x164b('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x15d317,_0x41ab16,_0xec6a,_0x2e16af){return new BPromise(function(_0x422b41,_0x1e3db4){var _0x1ebd22=_0x2e16af||client;return _0x1ebd22['request'](_0x15d317,_0xec6a)[_0x164b('0x10')](function(_0x11e51c){logger[_0x164b('0x11')](_0x164b('0x12'),_0x41ab16,_0x164b('0x13'));logger['debug'](_0x164b('0x14'),_0x41ab16,_0x164b('0x13'),JSON['stringify'](_0x11e51c));if(_0x11e51c[_0x164b('0x15')]){if(_0x11e51c[_0x164b('0x15')][_0x164b('0x16')]===0x1f4){logger[_0x164b('0x15')](_0x164b('0x12'),_0x41ab16,_0x11e51c[_0x164b('0x15')][_0x164b('0x17')]);return _0x1e3db4(_0x11e51c[_0x164b('0x15')]['message']);}logger[_0x164b('0x15')](_0x164b('0x12'),_0x41ab16,_0x11e51c['error']['message']);return _0x422b41(_0x11e51c[_0x164b('0x15')]['message']);}else{logger[_0x164b('0x11')](_0x164b('0x12'),_0x41ab16,_0x164b('0x13'));_0x422b41(_0x11e51c['result'][_0x164b('0x17')]);}})[_0x164b('0x18')](function(_0x24e711){logger['error'](_0x164b('0x12'),_0x41ab16,_0x24e711);_0x1e3db4(_0x24e711);});});}function respondWithResult(_0x5d45a7,_0x4bffd3){_0x4bffd3=_0x4bffd3||0xc8;return function(_0xcfd132){if(_0xcfd132){return _0x5d45a7[_0x164b('0x19')](_0x4bffd3)[_0x164b('0x1a')](_0xcfd132);}};}function respondWithFilteredResult(_0x320e65,_0xcc672c){return function(_0x1ed188){if(_0x1ed188){var _0x4087c0=typeof _0xcc672c[_0x164b('0x1b')]==='undefined'&&typeof _0xcc672c[_0x164b('0x1c')]===_0x164b('0x1d');var _0x1501a6=_0x1ed188['count'];var _0x23c8fe=_0x4087c0?0x0:_0xcc672c[_0x164b('0x1b')];var _0x10e3d5=_0x4087c0?_0x1ed188[_0x164b('0x1e')]:_0xcc672c['offset']+_0xcc672c['limit'];var _0x40f13f;if(_0x10e3d5>=_0x1501a6){_0x10e3d5=_0x1501a6;_0x40f13f=0xc8;}else{_0x40f13f=0xce;}_0x320e65[_0x164b('0x19')](_0x40f13f);return _0x320e65[_0x164b('0x1f')]('Content-Range',_0x23c8fe+'-'+_0x10e3d5+'/'+_0x1501a6)[_0x164b('0x1a')](_0x1ed188);}return null;};}function saveUpdates(_0x405214){return function(_0x30c0bc){if(_0x30c0bc){return _0x30c0bc[_0x164b('0x20')](_0x405214)['then'](function(_0x2720f8){return _0x2720f8;});}return null;};}function removeEntity(_0x32f7be){return function(_0x5cd89b){if(_0x5cd89b){return _0x5cd89b[_0x164b('0x21')]()[_0x164b('0x10')](function(){_0x32f7be[_0x164b('0x19')](0xcc)[_0x164b('0x22')]();});}};}function handleEntityNotFound(_0x18ece0){return function(_0x3dc8d3){if(!_0x3dc8d3){_0x18ece0[_0x164b('0x23')](0x194);}return _0x3dc8d3;};}function handleError(_0x43308e,_0x423744){_0x423744=_0x423744||0x1f4;return function(_0xa8470a){logger[_0x164b('0x15')](_0xa8470a[_0x164b('0x24')]);if(_0xa8470a[_0x164b('0x25')]){delete _0xa8470a[_0x164b('0x25')];}_0x43308e[_0x164b('0x19')](_0x423744)[_0x164b('0x26')](_0xa8470a);};}exports[_0x164b('0x27')]=function(_0x5682ab,_0x766ee0){var _0x1ac1d6={},_0x3ec607={},_0x5808ef={'count':0x0,'rows':[]};var _0x15669e=_[_0x164b('0x28')](db['MailMessage'][_0x164b('0x29')],function(_0x3cb7cb){return{'name':_0x3cb7cb[_0x164b('0x2a')],'type':_0x3cb7cb[_0x164b('0x2b')][_0x164b('0x2c')]};});_0x3ec607[_0x164b('0x2d')]=_[_0x164b('0x28')](_0x15669e,_0x164b('0x25'));_0x3ec607['query']=_[_0x164b('0x2e')](_0x5682ab[_0x164b('0x2f')]);_0x3ec607['filters']=_['intersection'](_0x3ec607[_0x164b('0x2d')],_0x3ec607[_0x164b('0x2f')]);_0x1ac1d6[_0x164b('0x30')]=_[_0x164b('0x31')](_0x3ec607[_0x164b('0x2d')],qs[_0x164b('0x32')](_0x5682ab['query'][_0x164b('0x32')]));_0x1ac1d6['attributes']=_0x1ac1d6[_0x164b('0x30')]['length']?_0x1ac1d6[_0x164b('0x30')]:_0x3ec607[_0x164b('0x2d')];if(!_0x5682ab['query'][_0x164b('0x33')](_0x164b('0x34'))){_0x1ac1d6[_0x164b('0x1c')]=qs[_0x164b('0x1c')](_0x5682ab[_0x164b('0x2f')]['limit']);_0x1ac1d6[_0x164b('0x1b')]=qs[_0x164b('0x1b')](_0x5682ab[_0x164b('0x2f')]['offset']);}_0x1ac1d6[_0x164b('0x35')]=qs['sort'](_0x5682ab[_0x164b('0x2f')][_0x164b('0x36')]);_0x1ac1d6[_0x164b('0x37')]=qs[_0x164b('0x38')](_[_0x164b('0x39')](_0x5682ab['query'],_0x3ec607['filters']),_0x15669e);if(_0x5682ab[_0x164b('0x2f')]['filter']){_0x1ac1d6[_0x164b('0x37')]=_['merge'](_0x1ac1d6['where'],{'$or':_['map'](_0x15669e,function(_0x338cf8){if(_0x338cf8[_0x164b('0x2b')]!==_0x164b('0x3a')){var _0x2654b7={};_0x2654b7[_0x338cf8[_0x164b('0x25')]]={'$like':'%'+_0x5682ab[_0x164b('0x2f')]['filter']+'%'};return _0x2654b7;}})});}_0x1ac1d6=_[_0x164b('0x3b')]({},_0x1ac1d6,_0x5682ab[_0x164b('0x3c')]);var _0x32cb80={'where':_0x1ac1d6[_0x164b('0x37')]};return db[_0x164b('0x3d')][_0x164b('0x1e')](_0x32cb80)[_0x164b('0x10')](function(_0x51e635){_0x5808ef[_0x164b('0x1e')]=_0x51e635;if(_0x5682ab[_0x164b('0x2f')][_0x164b('0x3e')]){_0x1ac1d6[_0x164b('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0x164b('0x40')](_0x1ac1d6);})['then'](function(_0x6d902b){_0x5808ef[_0x164b('0x41')]=_0x6d902b;return _0x5808ef;})[_0x164b('0x10')](respondWithFilteredResult(_0x766ee0,_0x1ac1d6))[_0x164b('0x18')](handleError(_0x766ee0,null));};exports[_0x164b('0x42')]=function(_0x122567,_0x1f296c){var _0x2aa58c={'raw':!![],'where':{'id':_0x122567[_0x164b('0x43')]['id']}},_0x59ac2c={};_0x59ac2c[_0x164b('0x2d')]=_[_0x164b('0x2e')](db['MailMessage']['rawAttributes']);_0x59ac2c[_0x164b('0x2f')]=_['keys'](_0x122567[_0x164b('0x2f')]);_0x59ac2c[_0x164b('0x38')]=_[_0x164b('0x31')](_0x59ac2c['model'],_0x59ac2c['query']);_0x2aa58c[_0x164b('0x30')]=_[_0x164b('0x31')](_0x59ac2c['model'],qs[_0x164b('0x32')](_0x122567[_0x164b('0x2f')]['fields']));_0x2aa58c['attributes']=_0x2aa58c[_0x164b('0x30')][_0x164b('0x44')]?_0x2aa58c[_0x164b('0x30')]:_0x59ac2c['model'];if(_0x122567[_0x164b('0x2f')][_0x164b('0x3e')]){_0x2aa58c['include']=[{'all':!![]}];}_0x2aa58c=_['merge']({},_0x2aa58c,_0x122567[_0x164b('0x3c')]);return db[_0x164b('0x3d')][_0x164b('0x45')](_0x2aa58c)[_0x164b('0x10')](handleEntityNotFound(_0x1f296c,null))[_0x164b('0x10')](respondWithResult(_0x1f296c,null))[_0x164b('0x18')](handleError(_0x1f296c,null));};exports[_0x164b('0x20')]=function(_0x50a1b9,_0x5a610b){if(_0x50a1b9[_0x164b('0x46')]['id']){delete _0x50a1b9[_0x164b('0x46')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x50a1b9[_0x164b('0x43')]['id']}})[_0x164b('0x10')](handleEntityNotFound(_0x5a610b,null))[_0x164b('0x10')](saveUpdates(_0x50a1b9[_0x164b('0x46')],null))['then'](respondWithResult(_0x5a610b,null))[_0x164b('0x18')](handleError(_0x5a610b,null));};exports[_0x164b('0x21')]=function(_0x5cbab7,_0x155004){return db[_0x164b('0x3d')][_0x164b('0x45')]({'where':{'id':_0x5cbab7[_0x164b('0x43')]['id']}})[_0x164b('0x10')](handleEntityNotFound(_0x155004,null))['then'](removeEntity(_0x155004,null))[_0x164b('0x18')](handleError(_0x155004,null));};exports[_0x164b('0x47')]=function(_0x21fd0d,_0x2ac783){return db[_0x164b('0x3d')][_0x164b('0x47')]()[_0x164b('0x10')](respondWithResult(_0x2ac783,null))[_0x164b('0x18')](handleError(_0x2ac783,null));};exports[_0x164b('0x48')]=function(_0xa75b30,_0x21d94d){return db[_0x164b('0x3d')][_0x164b('0x48')](_0xa75b30[_0x164b('0x46')])[_0x164b('0x10')](function(_0x2a785e){if(_0x2a785e){if(_0x2a785e[_0x164b('0x49')]==='out'&&!_0x2a785e[_0x164b('0x4a')]){var _0x9082e7,_0x3f922b,_0x5416bc;if(_0xa75b30[_0x164b('0x46')]['to']){_0x3f922b=_0xa75b30[_0x164b('0x46')]['to']['split'](',')[0x0];}return db[_0x164b('0x4b')][_0x164b('0x4c')]({'where':{'id':_0x2a785e[_0x164b('0x4d')]},'include':[{'model':db[_0x164b('0x4e')],'as':_0x164b('0x4f'),'include':[{'model':db[_0x164b('0x50')],'as':_0x164b('0x51'),'where':{'email':_0x3f922b},'limit':0x1,'order':[[_0x164b('0x52'),_0x164b('0x53')]]}]},{'model':db[_0x164b('0x54')],'as':_0x164b('0x55'),'raw':!![]}]})[_0x164b('0x10')](function(_0x1b693a){_0x9082e7=_0x1b693a;if(_0x9082e7&&_0x9082e7[_0x164b('0x55')]){var _0xe88f0d={'tls':{'rejectUnauthorized':![]}};if(_[_0x164b('0x56')](_0x9082e7[_0x164b('0x55')][_0x164b('0x57')])){_0xe88f0d[_0x164b('0x58')]=_0x9082e7[_0x164b('0x55')][_0x164b('0x58')];_0xe88f0d[_0x164b('0x59')]=_0x9082e7[_0x164b('0x55')][_0x164b('0x59')];_0xe88f0d[_0x164b('0x5a')]=_0x9082e7[_0x164b('0x55')][_0x164b('0x5a')];if(_0x9082e7[_0x164b('0x55')][_0x164b('0x5b')]){_0xe88f0d[_0x164b('0x5c')]={'user':_0x9082e7[_0x164b('0x55')][_0x164b('0x5d')],'pass':_0x9082e7[_0x164b('0x55')][_0x164b('0x5e')]};}}else{_0xe88f0d[_0x164b('0x57')]=_0x9082e7['Smtp'][_0x164b('0x57')];_0xe88f0d[_0x164b('0x5c')]={'user':_0x9082e7['Smtp'][_0x164b('0x5d')],'pass':_0x9082e7[_0x164b('0x55')][_0x164b('0x5e')]};_0xe88f0d[_0x164b('0x5a')]=_0x9082e7['Smtp'][_0x164b('0x5a')];}if(_0xa75b30[_0x164b('0x46')][_0x164b('0x5f')]&&_0xa75b30[_0x164b('0x46')][_0x164b('0x5f')][_0x164b('0x44')]){for(var _0x43d15c=0x0;_0x43d15c<_0xa75b30[_0x164b('0x46')][_0x164b('0x5f')][_0x164b('0x44')];_0x43d15c+=0x1){_0xa75b30[_0x164b('0x46')][_0x164b('0x5f')][_0x43d15c]={'filename':_0xa75b30[_0x164b('0x46')]['attachments'][_0x43d15c]['name'],'path':path[_0x164b('0x60')](config['root'],_0x164b('0x61'),_0xa75b30[_0x164b('0x46')][_0x164b('0x5f')][_0x43d15c][_0x164b('0x62')])};}}_0x5416bc={'account':_0xe88f0d,'message':_0xa75b30[_0x164b('0x46')]};return;}})[_0x164b('0x10')](function(){if(_0x9082e7[_0x164b('0x4f')]){if(_0x9082e7[_0x164b('0x4f')][_0x164b('0x51')][_0x164b('0x44')]){return _0x9082e7[_0x164b('0x4f')][_0x164b('0x51')][0x0];}else{return db[_0x164b('0x50')]['create'](_[_0x164b('0x63')](_0xa75b30[_0x164b('0x46')],{'firstName':_0xa75b30[_0x164b('0x46')]['to'],'email':_0xa75b30[_0x164b('0x46')]['to'],'phone':_0xa75b30[_0x164b('0x46')]['to'],'ListId':_0x9082e7['ListId']}));}}else{throw new Error(_0x164b('0x64'));}})['then'](function(){if(_0x5416bc){return respondWithRpcPromise(_0x164b('0x65'),_0x164b('0x66'),_0x5416bc,client9003)['then'](function(_0x53d6a5){return _0x2a785e[_0x164b('0x20')]({'read':!![],'messageId':_0x53d6a5[_0x164b('0x67')],'sentAt':moment()[_0x164b('0x68')](_0x164b('0x69'))});})[_0x164b('0x18')](function(_0x2d6062){logger[_0x164b('0x15')]('%s',JSON['stringify'](_0x2d6062));return _0x2a785e;});}return _0x2a785e;});}return _0x2a785e;}})[_0x164b('0x10')](respondWithResult(_0x21d94d,0xc9))[_0x164b('0x18')](handleError(_0x21d94d,null));};exports[_0x164b('0x6a')]=function(_0xa2d41c,_0x500205){var _0x3de5e9={'agent':{},'channel':_0x164b('0x6b')};if(_0xa2d41c[_0x164b('0x46')]['id']){delete _0xa2d41c[_0x164b('0x46')]['id'];}_0xa2d41c[_0x164b('0x46')][_0x164b('0x6c')]=!![];_0xa2d41c[_0x164b('0x46')][_0x164b('0x6d')]=moment()[_0x164b('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0xa2d41c['body']['UserId']=_0xa2d41c[_0x164b('0x46')][_0x164b('0x6e')]||_0xa2d41c[_0x164b('0x5d')]['id'];_0x3de5e9[_0x164b('0x6f')]['id']=_0xa2d41c[_0x164b('0x46')][_0x164b('0x6e')];return db['MailMessage'][_0x164b('0x45')]({'where':{'id':_0xa2d41c[_0x164b('0x43')]['id'],'UserId':null}})[_0x164b('0x10')](handleEntityNotFound(_0x500205,null))['then'](saveUpdates(_0xa2d41c['body'],null))[_0x164b('0x10')](function(_0x1bd9a5){if(_0x1bd9a5){_0x3de5e9[_0x164b('0x17')]=_0x1bd9a5[_0x164b('0x70')]({'plain':!![]});return db[_0x164b('0x71')][_0x164b('0x45')]({'where':{'id':_0x1bd9a5[_0x164b('0x72')]}});}return null;})[_0x164b('0x10')](handleEntityNotFound(_0x500205,null))[_0x164b('0x10')](function(_0x1496a){if(_0x1496a){return _0x1496a[_0x164b('0x20')]({'UserId':_0xa2d41c['body'][_0x164b('0x6e')],'read1stAt':_[_0x164b('0x56')](_0x1496a[_0x164b('0x73')])?moment()[_0x164b('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x164b('0x10')](function(_0x1f9db6){if(_0x1f9db6){_0x3de5e9[_0x164b('0x74')]=_0x1f9db6[_0x164b('0x70')]({'plain':!![]});interaction_log[_0x164b('0x11')](_0x164b('0x75'),_0xa2d41c[_0x164b('0x5d')]['id'],_0xa2d41c[_0x164b('0x5d')]['name'],_0xa2d41c['user'][_0x164b('0x76')],_0x3de5e9[_0x164b('0x74')]['id'],_0xa2d41c[_0x164b('0x46')]?JSON[_0x164b('0x77')](_0xa2d41c['body']):_0x164b('0x78'));return respondWithRpcPromise(_0x164b('0x79'),'acceptMessage',_0x3de5e9);}return null;})[_0x164b('0x10')](function(_0x11514f){var _0x4d3ac8=_0x164b('0x7a')+_0x11514f[_0x164b('0x17')][_0x164b('0x7b')];return db[_0x164b('0x7c')][_0x164b('0x2f')](_0x4d3ac8,{'type':db[_0x164b('0x7d')]['QueryTypes'][_0x164b('0x7e')],'raw':!![]})['then'](function(_0x59c104){return _0x59c104;});})[_0x164b('0x10')](function(_0xa1fe85){if(_0xa1fe85){_0x3de5e9[_0x164b('0x17')][_0x164b('0x7f')]=_0xa1fe85[0x0];if(!_0xa2d41c[_0x164b('0x46')][_0x164b('0x6e')])return;return db['User'][_0x164b('0x45')]({'where':{'id':_0xa2d41c['body'][_0x164b('0x6e')],'role':'agent'},'attributes':['id',_0x164b('0x25'),'fullname',_0x164b('0x80'),_0x164b('0x81')],'raw':!![]});}return null;})['then'](function(_0x4ea3ba){if(!_0x4ea3ba)return null;_0x3de5e9[_0x164b('0x17')][_0x164b('0x6f')]=_0x4ea3ba;return _0x3de5e9;})[_0x164b('0x10')](function(_0x45fea1){if(_0x45fea1){if(_0xa2d41c['body']['manual']){_0x3de5e9[_0x164b('0x17')][_0x164b('0x82')]=util[_0x164b('0x68')](_0x164b('0x83'),_0xa2d41c[_0x164b('0x5d')][_0x164b('0x25')]);_0x3de5e9[_0x164b('0x17')]['channel']=_0x3de5e9[_0x164b('0x84')];_0x3de5e9['message'][_0x164b('0x85')]=_0x3de5e9[_0x164b('0x84')];_0x3de5e9[_0x164b('0x17')][_0x164b('0x86')]=_0x164b('0x6a');_0x3de5e9[_0x164b('0x17')][_0x164b('0x46')]=htmlToText['fromString'](_0x3de5e9[_0x164b('0x17')][_0x164b('0x46')]);return respondWithRpcPromise(_0x164b('0x87'),_0x164b('0x87'),{'event':'acceptmessage','message':_0x3de5e9[_0x164b('0x17')]},client9002)[_0x164b('0x10')](function(){return _0x3de5e9;});}return _0x3de5e9;}return null;})[_0x164b('0x10')](respondWithResult(_0x500205,null))['catch'](handleError(_0x500205,null));};exports[_0x164b('0x88')]=function(_0x42c1c4,_0x15b586){var _0x2514f3={'agent':{},'channel':_0x164b('0x6b')};if(_0x42c1c4['body']['id']){delete _0x42c1c4[_0x164b('0x46')]['id'];}_0x42c1c4[_0x164b('0x46')][_0x164b('0x6e')]=_0x42c1c4[_0x164b('0x46')][_0x164b('0x6e')]||_0x42c1c4[_0x164b('0x5d')]['id'];_0x2514f3['agent']['id']=_0x42c1c4[_0x164b('0x46')][_0x164b('0x6e')];return db[_0x164b('0x3d')][_0x164b('0x45')]({'where':{'id':_0x42c1c4[_0x164b('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15b586,null))[_0x164b('0x10')](function(_0x4fd858){if(_0x4fd858){_0x2514f3[_0x164b('0x17')]=_0x4fd858[_0x164b('0x70')]({'plain':!![]});return db[_0x164b('0x71')]['find']({'where':{'id':_0x4fd858['MailInteractionId']}});}return null;})[_0x164b('0x10')](handleEntityNotFound(_0x15b586,null))[_0x164b('0x10')](function(_0x1cb7a8){if(_0x1cb7a8){_0x2514f3['interaction']=_0x1cb7a8[_0x164b('0x70')]({'plain':!![]});interaction_log[_0x164b('0x11')](_0x164b('0x89'),_0x42c1c4[_0x164b('0x5d')]['id'],_0x42c1c4[_0x164b('0x5d')][_0x164b('0x25')],_0x42c1c4[_0x164b('0x5d')]['role'],_0x2514f3[_0x164b('0x74')]['id'],_0x42c1c4[_0x164b('0x46')]?JSON[_0x164b('0x77')](_0x42c1c4['body']):_0x164b('0x78'));return respondWithRpcPromise(_0x164b('0x8a'),_0x164b('0x8b'),_0x2514f3);}return null;})[_0x164b('0x10')](function(_0x57edb3){var _0x35a38b=_0x164b('0x7a')+_0x57edb3[_0x164b('0x17')]['ContactId'];return db[_0x164b('0x7c')]['query'](_0x35a38b,{'type':db[_0x164b('0x7d')][_0x164b('0x8c')]['SELECT'],'raw':!![]})['then'](function(_0x5c913b){return _0x5c913b;});})['then'](function(_0x21f359){if(_0x21f359){_0x2514f3[_0x164b('0x17')][_0x164b('0x7f')]=_0x21f359[0x0];if(!_0x42c1c4['body'][_0x164b('0x6e')])return;return db[_0x164b('0x8d')][_0x164b('0x45')]({'where':{'id':_0x42c1c4[_0x164b('0x46')][_0x164b('0x6e')],'role':_0x164b('0x6f')},'attributes':['id',_0x164b('0x25'),_0x164b('0x8e'),_0x164b('0x80'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4f0abf){if(!_0x4f0abf)return null;_0x2514f3[_0x164b('0x17')]['agent']=_0x4f0abf;return _0x2514f3;})[_0x164b('0x10')](function(_0x3ff9da){if(_0x3ff9da){_0x3ff9da[_0x164b('0x17')][_0x164b('0x82')]=util['format'](_0x164b('0x83'),_0x42c1c4[_0x164b('0x5d')]['name']);_0x3ff9da[_0x164b('0x17')][_0x164b('0x84')]=_0x2514f3[_0x164b('0x84')];_0x3ff9da[_0x164b('0x17')]['motionChannel']=_0x2514f3[_0x164b('0x84')];_0x3ff9da[_0x164b('0x17')][_0x164b('0x86')]=_0x164b('0x88');_0x3ff9da[_0x164b('0x17')][_0x164b('0x46')]=htmlToText[_0x164b('0x8f')](_0x2514f3[_0x164b('0x17')][_0x164b('0x46')]);respondWithRpcPromise('EventManager',_0x164b('0x87'),{'event':_0x164b('0x90'),'message':_0x3ff9da[_0x164b('0x17')]},client9002);return _0x2514f3;}return null;})['then'](respondWithResult(_0x15b586,null))[_0x164b('0x18')](handleError(_0x15b586,null));};exports[_0x164b('0x91')]=function(_0x5bdffd,_0x49e1d1){var _0xea4fc4=moment()[_0x164b('0x92')]()[_0x164b('0x93')]();var _0x44b34e=path[_0x164b('0x60')](config[_0x164b('0x94')],_0x164b('0x95'),_0x164b('0x96'),_0x164b('0x97'));var _0x2d8627=path[_0x164b('0x60')](config[_0x164b('0x94')],_0x164b('0x95'),_0x164b('0x96'),_0x164b('0x5f'));var _0x18c69a=util[_0x164b('0x68')](_0x164b('0x98'),_0xea4fc4);return db['MailMessage']['find']({'where':{'id':_0x5bdffd[_0x164b('0x43')]['id']},'attributes':['id',_0x164b('0x46'),'from','to','cc',_0x164b('0x99'),_0x164b('0x9a'),_0x164b('0x9b')],'include':_0x5bdffd['query'][_0x164b('0x5f')]?[{'model':db['Attachment'],'as':_0x164b('0x9c')}]:undefined})[_0x164b('0x10')](handleEntityNotFound(_0x49e1d1,null))[_0x164b('0x10')](function(_0x2e77ee){if(_0x2e77ee){var _0x339c9a=_0x2e77ee;var _0x35a8b9={'from':_0x339c9a['from'],'to':_0x339c9a['to'],'subject':_0x339c9a['subject'],'html':htmlEntities[_0x164b('0x9d')](_0x339c9a[_0x164b('0x46')]),'headers':{'Date':moment(_0x339c9a['createdAt'])[_0x164b('0x68')](_0x164b('0x9e'))},'attachments':[]};if(_0x2e77ee['cc']){_0x35a8b9['headers']['Cc']=_0x2e77ee['cc'];}if(_0x2e77ee['bcc']){_0x35a8b9['headers'][_0x164b('0x9f')]=_0x2e77ee[_0x164b('0x99')];}return new BPromise(function(_0x151aa8,_0x4f756f){if(_0x2e77ee[_0x164b('0x9c')]){for(var _0x30e0a9=0x0;_0x30e0a9<_0x2e77ee[_0x164b('0x9c')][_0x164b('0x44')];_0x30e0a9++){var _0x336641=_0x2e77ee[_0x164b('0x9c')][_0x30e0a9];var _0x3eb06a=path[_0x164b('0x60')](_0x2d8627,_0x336641['basename']);if(fs['existsSync'](_0x3eb06a)){_0x35a8b9[_0x164b('0x5f')][_0x164b('0xa0')]({'name':_0x336641[_0x164b('0x25')],'contentType':_0x336641[_0x164b('0x2b')],'data':fs[_0x164b('0xa1')](_0x3eb06a)});}}}emlformat['build'](_0x35a8b9,function(_0x177697,_0x4ff523){if(_0x177697)return _0x4f756f(_0x177697);fs[_0x164b('0xa2')](path['join'](_0x44b34e,_0x18c69a),_0x4ff523);return _0x151aa8(_0x4ff523);});});}})[_0x164b('0x10')](function(_0x1c8fc1){if(_0x1c8fc1){return _0x49e1d1[_0x164b('0x91')](path[_0x164b('0x60')](_0x44b34e,_0x18c69a),_0x18c69a,function(_0x48de42){if(!_0x48de42)fs['unlinkSync'](path['join'](_0x44b34e,_0x18c69a));});}})[_0x164b('0x18')](handleError(_0x49e1d1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index dcc24ab..990c90f 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 _0x37fe=['emit','hook','../../mysqldb','MailMessage','save'];(function(_0x44ab1b,_0x33f27a){var _0x14e402=function(_0x10b24e){while(--_0x10b24e){_0x44ab1b['push'](_0x44ab1b['shift']());}};_0x14e402(++_0x33f27a);}(_0x37fe,0xd9));var _0xe37f=function(_0x167cdc,_0x29eeba){_0x167cdc=_0x167cdc-0x0;var _0x5c8089=_0x37fe[_0x167cdc];return _0x5c8089;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe37f('0x0'))['db'][_0xe37f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe37f('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x52dc33){return function(_0x368dde,_0x5b2833,_0x48248e){MailMessageEvents['emit'](_0x52dc33+':'+_0x368dde['id'],_0x368dde);MailMessageEvents[_0xe37f('0x3')](_0x52dc33,_0x368dde);_0x48248e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xe37f('0x4')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xfe99=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x3cdd83,_0x4c9216){var _0x139a73=function(_0x26b975){while(--_0x26b975){_0x3cdd83['push'](_0x3cdd83['shift']());}};_0x139a73(++_0x4c9216);}(_0xfe99,0x1e4));var _0x9fe9=function(_0x1eed00,_0x3ce9b0){_0x1eed00=_0x1eed00-0x0;var _0x2bcb20=_0xfe99[_0x1eed00];return _0x2bcb20;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x9fe9('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9fe9('0x1')](0x0);var events={'afterCreate':_0x9fe9('0x2'),'afterUpdate':_0x9fe9('0x3'),'afterDestroy':_0x9fe9('0x4')};function emitEvent(_0x3f95f6){return function(_0x28bd1f,_0x18447f,_0x39d83b){MailMessageEvents[_0x9fe9('0x5')](_0x3f95f6+':'+_0x28bd1f['id'],_0x28bd1f);MailMessageEvents[_0x9fe9('0x5')](_0x3f95f6,_0x28bd1f);_0x39d83b(null);};}for(var e in events){if(events[_0x9fe9('0x6')](e)){var event=events[e];MailMessage[_0x9fe9('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8eaa95a..283779d 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 _0xd371=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','body','fromString','models','get','direction','toLowerCase','out','MailInteraction','MailInteractionId'];(function(_0x4bfbda,_0x332198){var _0x3811c8=function(_0x3233c7){while(--_0x3233c7){_0x4bfbda['push'](_0x4bfbda['shift']());}};_0x3811c8(++_0x332198);}(_0xd371,0x13c));var _0x1d37=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xd371[_0xb3b452];return _0x238983;};'use strict';var _=require(_0x1d37('0x0'));var util=require(_0x1d37('0x1'));var logger=require(_0x1d37('0x2'))(_0x1d37('0x3'));var moment=require(_0x1d37('0x4'));var BPromise=require(_0x1d37('0x5'));var rp=require('request-promise');var htmlToText=require(_0x1d37('0x6'));var fs=require('fs');var path=require(_0x1d37('0x7'));var rimraf=require('rimraf');var config=require(_0x1d37('0x8'));var attributes=require(_0x1d37('0x9'));module[_0x1d37('0xa')]=function(_0x21ab56,_0x3dae67){return _0x21ab56[_0x1d37('0xb')](_0x1d37('0xc'),attributes,{'tableName':_0x1d37('0xd'),'paranoid':![],'indexes':[{'name':_0x1d37('0xe'),'fields':[_0x1d37('0xe')]},{'name':'fti_mail_messages','fields':[_0x1d37('0xf'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x177920,_0x184ed7,_0x4dbf9b){if(_0x177920[_0x1d37('0x10')]){_0x177920[_0x1d37('0xf')]=htmlToText[_0x1d37('0x11')](_0x177920['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4dbf9b(null,_0x184ed7);},'afterCreate':function(_0x179181,_0x2c5f49,_0x5442cb){var _0x433482=_0x21ab56[_0x1d37('0x12')];var _0x1666f4=_0x179181[_0x1d37('0x13')]({'plain':!![]});if(_0x1666f4[_0x1d37('0x14')][_0x1d37('0x15')]()==='in'||_0x1666f4['direction'][_0x1d37('0x15')]()===_0x1d37('0x16')&&!_0x1666f4['secret']&&!_['isNil'](_0x1666f4['UserId'])){_0x433482[_0x1d37('0x17')]['findOne']({'where':{'id':_0x1666f4[_0x1d37('0x18')]}})[_0x1d37('0x19')](function(_0x5689d1){if(_0x5689d1){_0x5689d1['update']({'lastMsgAt':_0x1666f4[_0x1d37('0x1a')],'lastMsgDirection':_0x1666f4[_0x1d37('0x14')][_0x1d37('0x15')]()});}})[_0x1d37('0x1b')](function(_0x432974){console[_0x1d37('0x1c')](_0x432974);});}_0x5442cb();}},'charset':_0x1d37('0x1d'),'collate':_0x1d37('0x1e')});}; \ No newline at end of file +var _0x742b=['createdAt','catch','error','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','html-to-text','rimraf','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','get','direction','toLowerCase','out','isNil','UserId','findOne','MailInteractionId','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x742b,0x1c6));var _0xb742=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x742b[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb742('0x0'))('api');var moment=require(_0xb742('0x1'));var BPromise=require(_0xb742('0x2'));var rp=require(_0xb742('0x3'));var htmlToText=require(_0xb742('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb742('0x5'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0xb742('0x6')]=function(_0x1d7249,_0x47769a){return _0x1d7249[_0xb742('0x7')](_0xb742('0x8'),attributes,{'tableName':_0xb742('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb742('0xa')]},{'name':_0xb742('0xb'),'fields':[_0xb742('0xc'),_0xb742('0xd')],'type':_0xb742('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x116864,_0x2b0ecf,_0x30ef0f){if(_0x116864['body']){_0x116864[_0xb742('0xc')]=htmlToText[_0xb742('0xf')](_0x116864['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x30ef0f(null,_0x2b0ecf);},'afterCreate':function(_0x88cb81,_0x50769a,_0x47e627){var _0x21a420=_0x1d7249[_0xb742('0x10')];var _0x59ad2a=_0x88cb81[_0xb742('0x11')]({'plain':!![]});if(_0x59ad2a[_0xb742('0x12')][_0xb742('0x13')]()==='in'||_0x59ad2a[_0xb742('0x12')][_0xb742('0x13')]()===_0xb742('0x14')&&!_0x59ad2a['secret']&&!_[_0xb742('0x15')](_0x59ad2a[_0xb742('0x16')])){_0x21a420['MailInteraction'][_0xb742('0x17')]({'where':{'id':_0x59ad2a[_0xb742('0x18')]}})['then'](function(_0xdf42b0){if(_0xdf42b0){_0xdf42b0[_0xb742('0x19')]({'lastMsgAt':_0x59ad2a[_0xb742('0x1a')],'lastMsgDirection':_0x59ad2a['direction']['toLowerCase']()});}})[_0xb742('0x1b')](function(_0x4bad73){console[_0xb742('0x1c')](_0x4bad73);});}_0x47e627();}},'charset':'utf8mb4','collate':_0xb742('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a06954a..267bd45 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x766bd0,_0x105716){var _0xeffdcf=function(_0x36b927){while(--_0x36b927){_0x766bd0['push'](_0x766bd0['shift']());}};_0xeffdcf(++_0x105716);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x5c3c[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file +var _0xed3c=['request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register'];(function(_0x49e5d2,_0x209d32){var _0x38f275=function(_0x4a8b0b){while(--_0x4a8b0b){_0x49e5d2['push'](_0x49e5d2['shift']());}};_0x38f275(++_0x209d32);}(_0xed3c,0x1a6));var _0xced3=function(_0x459c09,_0x596ed4){_0x459c09=_0x459c09-0x0;var _0x2aee20=_0xed3c[_0x459c09];return _0x2aee20;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('MailMessage,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});}exports[_0xced3('0x19')]=function(_0xe0cf2e){var _0x16d30d=this;return new Promise(function(_0x3f688c,_0x17c011){return db[_0xced3('0x1a')]['create'](_0xe0cf2e['body'],{'raw':_0xe0cf2e['options']?_0xe0cf2e[_0xced3('0x1b')][_0xced3('0x1c')]===undefined?!![]:![]:!![]})[_0xced3('0xe')](function(_0x4bf915){logger[_0xced3('0x17')](_0xced3('0x19'),_0xe0cf2e);logger['debug']('CreateMailMessage',_0xe0cf2e,JSON[_0xced3('0x13')](_0x4bf915));_0x3f688c(_0x4bf915);})[_0xced3('0x18')](function(_0x219fa8){logger[_0xced3('0x14')]('CreateMailMessage',_0x219fa8[_0xced3('0x16')],_0xe0cf2e);_0x17c011(_0x16d30d[_0xced3('0x14')](0x1f4,_0x219fa8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 0f1fc8e..bd936f5 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 _0xa573=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x5a0e35,_0x223b27){var _0x184c44=function(_0x2d5c32){while(--_0x2d5c32){_0x5a0e35['push'](_0x5a0e35['shift']());}};_0x184c44(++_0x223b27);}(_0xa573,0x95));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0x3a57('0x0'));var events=[_0x3a57('0x1'),_0x3a57('0x2'),_0x3a57('0x3')];function createListener(_0x11416f,_0x11d8b8){return function(_0x42d880){_0x11d8b8[_0x3a57('0x4')](_0x11416f,_0x42d880);};}function removeListener(_0x194d0f,_0x106d80){return function(){MailMessageEvents[_0x3a57('0x5')](_0x194d0f,_0x106d80);};}exports[_0x3a57('0x6')]=function(_0x10f25f){for(var _0x432330=0x0,_0x4573d7=events[_0x3a57('0x7')];_0x432330<_0x4573d7;_0x432330++){var _0x433f2a=events[_0x432330];var _0x4c48bc=createListener(_0x3a57('0x8')+_0x433f2a,_0x10f25f);MailMessageEvents['on'](_0x433f2a,_0x4c48bc);}}; \ No newline at end of file +var _0x7e31=['remove','update','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x335665,_0x2c20a5){var _0x2202a1=function(_0x1e1d3d){while(--_0x1e1d3d){_0x335665['push'](_0x335665['shift']());}};_0x2202a1(++_0x2c20a5);}(_0x7e31,0x6e));var _0x17e3=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x7e31[_0x5d07ff];return _0x5226ad;};'use strict';var MailMessageEvents=require(_0x17e3('0x0'));var events=[_0x17e3('0x1'),_0x17e3('0x2'),_0x17e3('0x3')];function createListener(_0x357bdc,_0x57606d){return function(_0xefb59b){_0x57606d['emit'](_0x357bdc,_0xefb59b);};}function removeListener(_0x4beff7,_0x2b5663){return function(){MailMessageEvents[_0x17e3('0x4')](_0x4beff7,_0x2b5663);};}exports[_0x17e3('0x5')]=function(_0x3c9dc9){for(var _0x5b581f=0x0,_0x1395ce=events[_0x17e3('0x6')];_0x5b581f<_0x1395ce;_0x5b581f++){var _0x384e99=events[_0x5b581f];var _0x26328f=createListener(_0x17e3('0x7')+_0x384e99,_0x3c9dc9);MailMessageEvents['on'](_0x384e99,_0x26328f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0fdf768..57f7ab1 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 _0x1ff1=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','/describe'];(function(_0x1ba05b,_0x181f39){var _0x32566c=function(_0x568d87){while(--_0x568d87){_0x1ba05b['push'](_0x1ba05b['shift']());}};_0x32566c(++_0x181f39);}(_0x1ff1,0x19a));var _0x11ff=function(_0x134ff3,_0x5f4f21){_0x134ff3=_0x134ff3-0x0;var _0x4aeb17=_0x1ff1[_0x134ff3];return _0x4aeb17;};'use strict';var multer=require(_0x11ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x11ff('0x1'));var express=require(_0x11ff('0x2'));var router=express[_0x11ff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x11ff('0x4'));var interaction=require(_0x11ff('0x5'));var config=require(_0x11ff('0x6'));var controller=require(_0x11ff('0x7'));router[_0x11ff('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x11ff('0x8')](_0x11ff('0x9'),auth[_0x11ff('0xa')](),controller[_0x11ff('0xb')]);router[_0x11ff('0x8')](_0x11ff('0xc'),auth[_0x11ff('0xa')](),controller[_0x11ff('0xd')]);router[_0x11ff('0x8')](_0x11ff('0xe'),auth[_0x11ff('0xa')](),controller[_0x11ff('0xf')]);router[_0x11ff('0x8')](_0x11ff('0x10'),auth[_0x11ff('0xa')](),controller['getTeams']);router['get'](_0x11ff('0x11'),auth[_0x11ff('0xa')](),controller[_0x11ff('0x12')]);router[_0x11ff('0x13')]('/',auth[_0x11ff('0xa')](),controller[_0x11ff('0x14')]);router[_0x11ff('0x13')](_0x11ff('0x10'),auth[_0x11ff('0xa')](),controller[_0x11ff('0x15')]);router[_0x11ff('0x13')](_0x11ff('0x11'),auth[_0x11ff('0xa')](),controller[_0x11ff('0x16')]);router[_0x11ff('0x17')]('/:id',auth[_0x11ff('0xa')](),controller[_0x11ff('0x18')]);router['delete'](_0x11ff('0xc'),auth['isAuthenticated'](),controller[_0x11ff('0x19')]);router[_0x11ff('0x1a')]('/:id/teams',auth[_0x11ff('0xa')](),controller[_0x11ff('0x1b')]);router[_0x11ff('0x1a')](_0x11ff('0x11'),auth[_0x11ff('0xa')](),controller[_0x11ff('0x1c')]);module[_0x11ff('0x1d')]=router; \ No newline at end of file +var _0xb992=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','/:id/users','exports','multer','util','path','connect-timeout'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xb992,0x192));var _0x2b99=function(_0x1e5db0,_0x4ce736){_0x1e5db0=_0x1e5db0-0x0;var _0x3acb4d=_0xb992[_0x1e5db0];return _0x3acb4d;};'use strict';var multer=require(_0x2b99('0x0'));var util=require(_0x2b99('0x1'));var path=require(_0x2b99('0x2'));var timeout=require(_0x2b99('0x3'));var express=require(_0x2b99('0x4'));var router=express[_0x2b99('0x5')]();var fs_extra=require(_0x2b99('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2b99('0x7'));var config=require(_0x2b99('0x8'));var controller=require(_0x2b99('0x9'));router[_0x2b99('0xa')]('/',auth['isAuthenticated'](),controller[_0x2b99('0xb')]);router[_0x2b99('0xa')](_0x2b99('0xc'),auth[_0x2b99('0xd')](),controller['describe']);router[_0x2b99('0xa')](_0x2b99('0xe'),auth[_0x2b99('0xd')](),controller[_0x2b99('0xf')]);router[_0x2b99('0xa')]('/:id/members',auth[_0x2b99('0xd')](),controller[_0x2b99('0x10')]);router[_0x2b99('0xa')]('/:id/teams',auth[_0x2b99('0xd')](),controller['getTeams']);router[_0x2b99('0xa')]('/:id/users',auth[_0x2b99('0xd')](),controller[_0x2b99('0x11')]);router[_0x2b99('0x12')]('/',auth[_0x2b99('0xd')](),controller[_0x2b99('0x13')]);router[_0x2b99('0x12')](_0x2b99('0x14'),auth[_0x2b99('0xd')](),controller[_0x2b99('0x15')]);router[_0x2b99('0x12')]('/:id/users',auth[_0x2b99('0xd')](),controller[_0x2b99('0x16')]);router[_0x2b99('0x17')](_0x2b99('0xe'),auth[_0x2b99('0xd')](),controller[_0x2b99('0x18')]);router[_0x2b99('0x19')](_0x2b99('0xe'),auth[_0x2b99('0xd')](),controller[_0x2b99('0x1a')]);router[_0x2b99('0x19')](_0x2b99('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2b99('0x19')](_0x2b99('0x1b'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2b99('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 7d4cd53..1e6cfb6 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 _0x0013=['roundrobin','exports','STRING','name','ENUM','rrmemory'];(function(_0x4d6127,_0x471fc6){var _0x4fe144=function(_0x1dfbd1){while(--_0x1dfbd1){_0x4d6127['push'](_0x4d6127['shift']());}};_0x4fe144(++_0x471fc6);}(_0x0013,0x1ab));var _0x3001=function(_0x46fd97,_0xed710b){_0x46fd97=_0x46fd97-0x0;var _0x555c71=_0x0013[_0x46fd97];return _0x555c71;};'use strict';var Sequelize=require('sequelize');module[_0x3001('0x0')]={'name':{'type':Sequelize[_0x3001('0x1')],'unique':_0x3001('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3001('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3001('0x3')](_0x3001('0x4'),'beepall',_0x3001('0x5'))}}; \ No newline at end of file +var _0x3c46=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x558596,_0x39e1ce){var _0x117d7d=function(_0x136fa7){while(--_0x136fa7){_0x558596['push'](_0x558596['shift']());}};_0x117d7d(++_0x39e1ce);}(_0x3c46,0xf5));var _0x63c4=function(_0x2a4d77,_0x1306a6){_0x2a4d77=_0x2a4d77-0x0;var _0x9cdd68=_0x3c46[_0x2a4d77];return _0x9cdd68;};'use strict';var Sequelize=require(_0x63c4('0x0'));module[_0x63c4('0x1')]={'name':{'type':Sequelize[_0x63c4('0x2')],'unique':_0x63c4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x63c4('0x2')]},'timeout':{'type':Sequelize[_0x63c4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x63c4('0x5')](_0x63c4('0x6'),_0x63c4('0x7'),_0x63c4('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 5df6ebe..7ac2ad2 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 _0xe088=['UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','hasOwnProperty','MailQueueId','UserId','agent','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','interface','transaction','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','sequelize','removeAgents','userMailQueue:remove','addAgents','omit','spread','emit','getAgents','eml-format','zip-dir','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','MailQueues','destroy','end','stack','name','send','index','map','MailQueue','fieldName','type','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x24e730,_0x494934){var _0x46e54b=function(_0x184c2d){while(--_0x184c2d){_0x24e730['push'](_0x24e730['shift']());}};_0x46e54b(++_0x494934);}(_0xe088,0xbf));var _0x8e08=function(_0x3be20a,_0x223336){_0x3be20a=_0x3be20a-0x0;var _0x7382f6=_0xe088[_0x3be20a];return _0x7382f6;};'use strict';var emlformat=require(_0x8e08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e08('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e08('0x2'));var moment=require('moment');var BPromise=require(_0x8e08('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8e08('0x4'));var csv=require(_0x8e08('0x5'));var ejs=require(_0x8e08('0x6'));var fs=require('fs');var fs_extra=require(_0x8e08('0x7'));var _=require(_0x8e08('0x8'));var squel=require(_0x8e08('0x9'));var crypto=require(_0x8e08('0xa'));var jsforce=require(_0x8e08('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8e08('0x5'));var querystring=require(_0x8e08('0xc'));var Papa=require(_0x8e08('0xd'));var Redis=require(_0x8e08('0xe'));var authService=require(_0x8e08('0xf'));var qs=require(_0x8e08('0x10'));var as=require(_0x8e08('0x11'));var hardwareService=require(_0x8e08('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8e08('0x13'));var db=require(_0x8e08('0x14'))['db'];config[_0x8e08('0x15')]=_[_0x8e08('0x16')](config[_0x8e08('0x15')],{'host':_0x8e08('0x17'),'port':0x18eb});var socket=require(_0x8e08('0x18'))(new Redis(config[_0x8e08('0x15')]));require(_0x8e08('0x19'))[_0x8e08('0x1a')](socket);function respondWithStatusCode(_0x15341e,_0x38ba8d){_0x38ba8d=_0x38ba8d||0xcc;return function(_0x1f7655){if(_0x1f7655){return _0x15341e[_0x8e08('0x1b')](_0x38ba8d);}return _0x15341e[_0x8e08('0x1c')](_0x38ba8d)['end']();};}function respondWithResult(_0x401819,_0x5509e3){_0x5509e3=_0x5509e3||0xc8;return function(_0x19928f){if(_0x19928f){return _0x401819[_0x8e08('0x1c')](_0x5509e3)[_0x8e08('0x1d')](_0x19928f);}};}function respondWithFilteredResult(_0x5e294f,_0x2a1fcb){return function(_0x3705f0){if(_0x3705f0){var _0x44bb87=typeof _0x2a1fcb[_0x8e08('0x1e')]===_0x8e08('0x1f')&&typeof _0x2a1fcb['limit']==='undefined';var _0x427271=_0x3705f0[_0x8e08('0x20')];var _0x5ee2e9=_0x44bb87?0x0:_0x2a1fcb[_0x8e08('0x1e')];var _0x4e2784=_0x44bb87?_0x3705f0[_0x8e08('0x20')]:_0x2a1fcb[_0x8e08('0x1e')]+_0x2a1fcb[_0x8e08('0x21')];var _0x2b9df8;if(_0x4e2784>=_0x427271){_0x4e2784=_0x427271;_0x2b9df8=0xc8;}else{_0x2b9df8=0xce;}_0x5e294f[_0x8e08('0x1c')](_0x2b9df8);return _0x5e294f[_0x8e08('0x22')](_0x8e08('0x23'),_0x5ee2e9+'-'+_0x4e2784+'/'+_0x427271)[_0x8e08('0x1d')](_0x3705f0);}return null;};}function patchUpdates(_0xe021af){return function(_0x30c86a){try{jsonpatch[_0x8e08('0x24')](_0x30c86a,_0xe021af,!![]);}catch(_0xee5af5){return BPromise[_0x8e08('0x25')](_0xee5af5);}return _0x30c86a['save']();};}function saveUpdates(_0xfc5959,_0x30237d){return function(_0x56fd2a){if(_0x56fd2a){return _0x56fd2a[_0x8e08('0x26')](_0xfc5959)[_0x8e08('0x27')](function(_0x36dfa8){return _0x36dfa8;});}return null;};}function removeEntity(_0x43d25f,_0x1ba28f){return function(_0x5afdb8){if(_0x5afdb8){return _0x5afdb8['destroy']()['then'](function(){var _0x277b11=_0x5afdb8[_0x8e08('0x28')]({'plain':!![]});var _0x50ad3b=_0x8e08('0x29');return db['UserProfileResource'][_0x8e08('0x2a')]({'where':{'type':_0x50ad3b,'resourceId':_0x277b11['id']}})[_0x8e08('0x27')](function(){return _0x5afdb8;});})[_0x8e08('0x27')](function(){_0x43d25f[_0x8e08('0x1c')](0xcc)[_0x8e08('0x2b')]();});}};}function handleEntityNotFound(_0x3280d4,_0x2d7065){return function(_0x215596){if(!_0x215596){_0x3280d4[_0x8e08('0x1b')](0x194);}return _0x215596;};}function handleError(_0x22c75d,_0x203438){_0x203438=_0x203438||0x1f4;return function(_0x26e816){logger['error'](_0x26e816[_0x8e08('0x2c')]);if(_0x26e816[_0x8e08('0x2d')]){delete _0x26e816['name'];}_0x22c75d['status'](_0x203438)[_0x8e08('0x2e')](_0x26e816);};}exports[_0x8e08('0x2f')]=function(_0x1d8567,_0x50e7fd){var _0x59049f={},_0xe17020={},_0x2bf3cd={'count':0x0,'rows':[]};var _0x34bc45=_[_0x8e08('0x30')](db[_0x8e08('0x31')]['rawAttributes'],function(_0x9a214e){return{'name':_0x9a214e[_0x8e08('0x32')],'type':_0x9a214e[_0x8e08('0x33')]['key']};});_0xe17020[_0x8e08('0x34')]=_['map'](_0x34bc45,_0x8e08('0x2d'));_0xe17020['query']=_['keys'](_0x1d8567[_0x8e08('0x35')]);_0xe17020['filters']=_[_0x8e08('0x36')](_0xe17020[_0x8e08('0x34')],_0xe17020[_0x8e08('0x35')]);_0x59049f['attributes']=_[_0x8e08('0x36')](_0xe17020['model'],qs[_0x8e08('0x37')](_0x1d8567[_0x8e08('0x35')][_0x8e08('0x37')]));_0x59049f[_0x8e08('0x38')]=_0x59049f[_0x8e08('0x38')][_0x8e08('0x39')]?_0x59049f[_0x8e08('0x38')]:_0xe17020['model'];if(!_0x1d8567[_0x8e08('0x35')]['hasOwnProperty'](_0x8e08('0x3a'))){_0x59049f['limit']=qs['limit'](_0x1d8567[_0x8e08('0x35')]['limit']);_0x59049f['offset']=qs[_0x8e08('0x1e')](_0x1d8567['query'][_0x8e08('0x1e')]);}_0x59049f[_0x8e08('0x3b')]=qs[_0x8e08('0x3c')](_0x1d8567[_0x8e08('0x35')][_0x8e08('0x3c')]);_0x59049f[_0x8e08('0x3d')]=qs[_0x8e08('0x3e')](_[_0x8e08('0x3f')](_0x1d8567[_0x8e08('0x35')],_0xe17020[_0x8e08('0x3e')]),_0x34bc45);if(_0x1d8567['query'][_0x8e08('0x40')]){_0x59049f[_0x8e08('0x3d')]=_[_0x8e08('0x41')](_0x59049f['where'],{'$or':_[_0x8e08('0x30')](_0x34bc45,function(_0x36af47){if(_0x36af47[_0x8e08('0x33')]!=='VIRTUAL'){var _0x302808={};_0x302808[_0x36af47['name']]={'$like':'%'+_0x1d8567[_0x8e08('0x35')][_0x8e08('0x40')]+'%'};return _0x302808;}})});}_0x59049f=_['merge']({},_0x59049f,_0x1d8567['options']);var _0x23598e={'where':_0x59049f[_0x8e08('0x3d')]};return db[_0x8e08('0x31')][_0x8e08('0x20')](_0x23598e)[_0x8e08('0x27')](function(_0x158c67){_0x2bf3cd[_0x8e08('0x20')]=_0x158c67;if(_0x1d8567[_0x8e08('0x35')][_0x8e08('0x42')]){_0x59049f['include']=[{'all':!![]}];}return db[_0x8e08('0x31')][_0x8e08('0x43')](_0x59049f);})[_0x8e08('0x27')](function(_0x1e9d4b){_0x2bf3cd[_0x8e08('0x44')]=_0x1e9d4b;return _0x2bf3cd;})['then'](respondWithFilteredResult(_0x50e7fd,_0x59049f))[_0x8e08('0x45')](handleError(_0x50e7fd,null));};exports[_0x8e08('0x46')]=function(_0x2823eb,_0x38dc48){var _0x15ce07={'raw':!![],'where':{'id':_0x2823eb[_0x8e08('0x47')]['id']}},_0x4abb80={};_0x4abb80[_0x8e08('0x34')]=_[_0x8e08('0x48')](db[_0x8e08('0x31')][_0x8e08('0x49')]);_0x4abb80[_0x8e08('0x35')]=_[_0x8e08('0x48')](_0x2823eb[_0x8e08('0x35')]);_0x4abb80[_0x8e08('0x3e')]=_[_0x8e08('0x36')](_0x4abb80[_0x8e08('0x34')],_0x4abb80['query']);_0x15ce07[_0x8e08('0x38')]=_['intersection'](_0x4abb80['model'],qs['fields'](_0x2823eb['query'][_0x8e08('0x37')]));_0x15ce07[_0x8e08('0x38')]=_0x15ce07['attributes'][_0x8e08('0x39')]?_0x15ce07['attributes']:_0x4abb80['model'];if(_0x2823eb['query'][_0x8e08('0x42')]){_0x15ce07[_0x8e08('0x4a')]=[{'all':!![]}];}_0x15ce07=_[_0x8e08('0x41')]({},_0x15ce07,_0x2823eb[_0x8e08('0x4b')]);return db['MailQueue'][_0x8e08('0x4c')](_0x15ce07)[_0x8e08('0x27')](handleEntityNotFound(_0x38dc48,null))[_0x8e08('0x27')](respondWithResult(_0x38dc48,null))[_0x8e08('0x45')](handleError(_0x38dc48,null));};exports[_0x8e08('0x4d')]=function(_0x45564f,_0x3006b9){return db[_0x8e08('0x31')]['create'](_0x45564f[_0x8e08('0x4e')],{})[_0x8e08('0x27')](function(_0x1e39fa){var _0x311b36=_0x45564f[_0x8e08('0x4f')][_0x8e08('0x28')]({'plain':!![]});if(!_0x311b36)throw new Error(_0x8e08('0x50'));if(_0x311b36[_0x8e08('0x51')]===_0x8e08('0x4f')){var _0x3c65ec=_0x1e39fa[_0x8e08('0x28')]({'plain':!![]});var _0xe65604='MailQueues';return db[_0x8e08('0x52')]['find']({'where':{'name':_0xe65604,'userProfileId':_0x311b36[_0x8e08('0x53')]},'raw':!![]})['then'](function(_0x503fac){if(_0x503fac&&_0x503fac[_0x8e08('0x54')]===0x0){return db[_0x8e08('0x55')]['create']({'name':_0x3c65ec[_0x8e08('0x2d')],'resourceId':_0x3c65ec['id'],'type':_0x503fac[_0x8e08('0x2d')],'sectionId':_0x503fac['id']},{})[_0x8e08('0x27')](function(){return _0x1e39fa;});}else{return _0x1e39fa;}})[_0x8e08('0x45')](function(_0x105c2b){logger[_0x8e08('0x56')](_0x8e08('0x57'),_0x105c2b);throw _0x105c2b;});}return _0x1e39fa;})[_0x8e08('0x27')](respondWithResult(_0x3006b9,0xc9))['catch'](handleError(_0x3006b9,null));};exports[_0x8e08('0x26')]=function(_0x440ea4,_0x3c237c){if(_0x440ea4[_0x8e08('0x4e')]['id']){delete _0x440ea4[_0x8e08('0x4e')]['id'];}return db[_0x8e08('0x31')]['find']({'where':{'id':_0x440ea4[_0x8e08('0x47')]['id']}})[_0x8e08('0x27')](handleEntityNotFound(_0x3c237c,null))[_0x8e08('0x27')](saveUpdates(_0x440ea4[_0x8e08('0x4e')],null))[_0x8e08('0x27')](respondWithResult(_0x3c237c,null))[_0x8e08('0x45')](handleError(_0x3c237c,null));};exports[_0x8e08('0x2a')]=function(_0x2da23d,_0x22a2d6){return db[_0x8e08('0x31')]['find']({'where':{'id':_0x2da23d[_0x8e08('0x47')]['id']}})['then'](handleEntityNotFound(_0x22a2d6,null))[_0x8e08('0x27')](removeEntity(_0x22a2d6,null))['catch'](handleError(_0x22a2d6,null));};exports[_0x8e08('0x58')]=function(_0x5eccee,_0x264c9e){return db['MailQueue'][_0x8e08('0x58')]()[_0x8e08('0x27')](respondWithResult(_0x264c9e,null))[_0x8e08('0x45')](handleError(_0x264c9e,null));};exports['getMembers']=function(_0x2c92d4,_0x140602,_0x2cf627){var _0x4f6477={'raw':!![],'where':{}},_0x1293c2={},_0x1b770e;return db[_0x8e08('0x31')][_0x8e08('0x59')]({'where':{'id':_0x2c92d4[_0x8e08('0x47')]['id']}})[_0x8e08('0x27')](handleEntityNotFound(_0x140602,null))[_0x8e08('0x27')](function(_0xe9fc20){if(_0xe9fc20){_0x1b770e=_0xe9fc20[_0x8e08('0x28')]({'plain':!![]});_0x1293c2[_0x8e08('0x34')]=_[_0x8e08('0x48')](db[_0x8e08('0x5a')][_0x8e08('0x49')]);_0x1293c2[_0x8e08('0x35')]=_[_0x8e08('0x48')](_0x2c92d4[_0x8e08('0x35')]);_0x1293c2['filters']=_[_0x8e08('0x36')](_0x1293c2['model'],_0x1293c2[_0x8e08('0x35')]);_0x4f6477['attributes']=_[_0x8e08('0x36')](_0x1293c2['model'],qs[_0x8e08('0x37')](_0x2c92d4[_0x8e08('0x35')]['fields']));_0x4f6477['attributes']=_0x4f6477[_0x8e08('0x38')][_0x8e08('0x39')]?_0x4f6477[_0x8e08('0x38')]:_0x1293c2['model'];if(!_0x2c92d4['query'][_0x8e08('0x5b')](_0x8e08('0x3a'))){_0x4f6477[_0x8e08('0x21')]=qs[_0x8e08('0x21')](_0x2c92d4[_0x8e08('0x35')]['limit']);_0x4f6477[_0x8e08('0x1e')]=qs[_0x8e08('0x1e')](_0x2c92d4[_0x8e08('0x35')][_0x8e08('0x1e')]);}_0x4f6477['order']=qs[_0x8e08('0x3c')](_0x2c92d4['query'][_0x8e08('0x3c')]);_0x4f6477[_0x8e08('0x3d')]=qs[_0x8e08('0x3e')](_[_0x8e08('0x3f')](_0x2c92d4[_0x8e08('0x35')],_0x1293c2[_0x8e08('0x3e')]));_0x4f6477[_0x8e08('0x3d')][_0x8e08('0x5c')]=_0xe9fc20['id'];if(_0x2c92d4[_0x8e08('0x35')][_0x8e08('0x40')]){_0x4f6477[_0x8e08('0x3d')]=_[_0x8e08('0x41')](_0x4f6477[_0x8e08('0x3d')],{'$or':_[_0x8e08('0x30')](_0x4f6477['attributes'],function(_0x473c66){var _0x4ab185={};_0x4ab185[_0x473c66]={'$like':'%'+_0x2c92d4['query'][_0x8e08('0x40')]+'%'};return _0x4ab185;})});}_0x4f6477=_[_0x8e08('0x41')]({},_0x4f6477,_0x2c92d4[_0x8e08('0x4b')]);return db[_0x8e08('0x5a')][_0x8e08('0x43')](_0x4f6477);}})[_0x8e08('0x27')](function(_0xb0fc60){if(_0xb0fc60){return db['User']['findAndCountAll']({'where':{'id':_[_0x8e08('0x30')](_0xb0fc60,_0x8e08('0x5d')),'role':_0x8e08('0x5e')},'attributes':['id','name','mailPause','updatedAt','createdAt']});}})[_0x8e08('0x27')](function(_0x5b0c66){if(_0x5b0c66){return{'count':_0x5b0c66[_0x8e08('0x20')],'rows':_[_0x8e08('0x30')](_0x5b0c66['rows'],function(_0x22b49d){return{'membername':_0x22b49d[_0x8e08('0x2d')],'UserId':_0x22b49d['id'],'queue_name':_0x1b770e[_0x8e08('0x2d')],'MailQueueId':_0x1b770e['id'],'interface':util['format'](_0x8e08('0x5f'),_0x8e08('0x60'),_0x22b49d[_0x8e08('0x2d')]),'penalty':0x0,'paused':_0x22b49d['mailPause'],'createdAt':_0x22b49d['createdAt'],'updatedAt':_0x22b49d[_0x8e08('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e08('0x27')](respondWithFilteredResult(_0x140602,_0x4f6477))[_0x8e08('0x45')](handleError(_0x140602,null));};exports[_0x8e08('0x62')]=function(_0xf286ce,_0x2d6a1e,_0x47325c){var _0x4ea34b={};var _0x4395a9={};var _0x25dd2b;var _0x3b8b59;return db[_0x8e08('0x31')][_0x8e08('0x59')]({'where':{'id':_0xf286ce[_0x8e08('0x47')]['id']}})[_0x8e08('0x27')](handleEntityNotFound(_0x2d6a1e,null))['then'](function(_0x3bcad1){if(_0x3bcad1){_0x25dd2b=_0x3bcad1;_0x4395a9[_0x8e08('0x34')]=_[_0x8e08('0x48')](db[_0x8e08('0x63')][_0x8e08('0x49')]);_0x4395a9['query']=_['keys'](_0xf286ce[_0x8e08('0x35')]);_0x4395a9[_0x8e08('0x3e')]=_[_0x8e08('0x36')](_0x4395a9['model'],_0x4395a9['query']);_0x4ea34b[_0x8e08('0x38')]=_[_0x8e08('0x36')](_0x4395a9[_0x8e08('0x34')],qs['fields'](_0xf286ce[_0x8e08('0x35')][_0x8e08('0x37')]));_0x4ea34b[_0x8e08('0x38')]=_0x4ea34b[_0x8e08('0x38')]['length']?_0x4ea34b[_0x8e08('0x38')]:_0x4395a9[_0x8e08('0x34')];_0x4ea34b[_0x8e08('0x3b')]=qs['sort'](_0xf286ce[_0x8e08('0x35')]['sort']);_0x4ea34b[_0x8e08('0x3d')]=qs[_0x8e08('0x3e')](_['pick'](_0xf286ce['query'],_0x4395a9[_0x8e08('0x3e')]));if(_0xf286ce[_0x8e08('0x35')][_0x8e08('0x40')]){_0x4ea34b['where']=_[_0x8e08('0x41')](_0x4ea34b[_0x8e08('0x3d')],{'$or':_['map'](_0x4ea34b['attributes'],function(_0x54bab0){var _0x2354b0={};_0x2354b0[_0x54bab0]={'$like':'%'+_0xf286ce[_0x8e08('0x35')][_0x8e08('0x40')]+'%'};return _0x2354b0;})});}_0x4ea34b=_[_0x8e08('0x41')]({},_0x4ea34b,_0xf286ce[_0x8e08('0x4b')]);return _0x25dd2b[_0x8e08('0x62')](_0x4ea34b);}})[_0x8e08('0x27')](function(_0x33ac15){if(_0x33ac15){_0x3b8b59=_0x33ac15['length'];if(!_0xf286ce[_0x8e08('0x35')][_0x8e08('0x5b')](_0x8e08('0x3a'))){_0x4ea34b[_0x8e08('0x21')]=qs[_0x8e08('0x21')](_0xf286ce[_0x8e08('0x35')][_0x8e08('0x21')]);_0x4ea34b[_0x8e08('0x1e')]=qs['offset'](_0xf286ce[_0x8e08('0x35')]['offset']);}return _0x25dd2b[_0x8e08('0x62')](_0x4ea34b);}})['then'](function(_0x1628c4){if(_0x1628c4){return _0x1628c4?{'count':_0x3b8b59,'rows':_0x1628c4}:null;}})[_0x8e08('0x27')](respondWithResult(_0x2d6a1e,null))[_0x8e08('0x45')](handleError(_0x2d6a1e,null));};exports[_0x8e08('0x64')]=function(_0x2be08f,_0x39faba,_0x41c4b0){var _0x1c68d8=_0x2be08f[_0x8e08('0x4e')][_0x8e08('0x65')];return db['Team'][_0x8e08('0x43')]({'where':{'id':_0x1c68d8},'attributes':['id'],'include':[{'model':db[_0x8e08('0x66')],'as':_0x8e08('0x67'),'attributes':['id',_0x8e08('0x2d'),_0x8e08('0x68'),'voicePause',_0x8e08('0x69')],'raw':!![]}]})[_0x8e08('0x27')](function(_0x292eb7){if(_0x292eb7){var _0x27df19=_['flatMap'](_0x292eb7,function(_0x445e95){var _0x356e48=_0x445e95[_0x8e08('0x28')]({'plain':!![]});return _0x356e48['Agents'];});return db['MailQueue'][_0x8e08('0x4c')]({'where':{'id':_0x2be08f[_0x8e08('0x47')]['id']}})[_0x8e08('0x27')](function(_0x30021c){return db['sequelize'][_0x8e08('0x6a')](function(_0x2c7b80){return _0x30021c['addTeams'](_0x1c68d8,{'transaction':_0x2c7b80})['then'](function(){return BPromise['each'](_0x27df19,function(_0x24cb20){return db['UserMailQueue'][_0x8e08('0x6b')]({'where':{'UserId':_0x24cb20['id'],'MailQueueId':_0x2be08f[_0x8e08('0x47')]['id']},'transaction':_0x2c7b80});});})['then'](function(){_0x27df19[_0x8e08('0x6c')](function(_0x40152c){socket['emit'](_0x8e08('0x6d'),{'UserId':_0x40152c['id'],'MailQueueId':_0x30021c['id']});});});});});}})[_0x8e08('0x27')](respondWithStatusCode(_0x39faba,null))[_0x8e08('0x45')](handleError(_0x39faba,null));};exports[_0x8e08('0x6e')]=function(_0x1a3926,_0x4efcee,_0x1876f2){return db[_0x8e08('0x63')][_0x8e08('0x43')]({'where':{'id':_0x1a3926[_0x8e08('0x35')][_0x8e08('0x65')]},'attributes':['id'],'include':[{'model':db[_0x8e08('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8e08('0x27')](handleEntityNotFound(_0x4efcee,null))['then'](function(_0x58b239){var _0x559acb=_['map'](_0x58b239,'id');var _0x33b768=[];var _0x2d944b=[];var _0x3dbb38=squel[_0x8e08('0x6f')]();_0x3dbb38[_0x8e08('0x70')](_0x8e08('0x71'))[_0x8e08('0x72')](_0x8e08('0x73'),'tq')['join'](_0x8e08('0x74'),'ut',_0x8e08('0x75'))[_0x8e08('0x3d')]('MailQueueId\x20=\x20?',_0x1a3926[_0x8e08('0x47')]['id']);for(var _0x1b2eb0=0x0;_0x1b2eb0<_0x58b239[_0x8e08('0x39')];_0x1b2eb0+=0x1){let _0xc8a3ac=_0x58b239[_0x1b2eb0];for(var _0x4db39a=0x0;_0x4db39a<_0xc8a3ac[_0x8e08('0x67')]['length'];_0x4db39a+=0x1){let _0x1c1586=_0xc8a3ac[_0x8e08('0x67')][_0x4db39a];var _0x1433a8=_0x3dbb38[_0x8e08('0x76')]();_0x1433a8[_0x8e08('0x3d')](_0x8e08('0x77'),_0x1c1586['id']);_0x2d944b[_0x8e08('0x78')](db['sequelize'][_0x8e08('0x35')](_0x1433a8[_0x8e08('0x79')](),{'type':db['sequelize'][_0x8e08('0x7a')][_0x8e08('0x7b')]})[_0x8e08('0x27')](function(_0xbf1125){if(_0xbf1125['length']===0x1){return _0x1c1586['id'];}else{var _0x395489=_[_0x8e08('0x7c')](_['map'](_0xbf1125,_0x8e08('0x7d')),function(_0x409d95){return _['includes'](_0x559acb,_0x409d95);});if(_0x395489){return _0x1c1586['id'];}}}));}}return BPromise[_0x8e08('0x7e')](_0x2d944b)['then'](function(_0x3fd73c){_0x33b768=_(_0x33b768)[_0x8e08('0x7f')](_0x3fd73c)[_0x8e08('0x80')]()[_0x8e08('0x81')]();return db[_0x8e08('0x31')]['find']({'where':{'id':_0x1a3926['params']['id']}})['then'](function(_0x118958){return db[_0x8e08('0x82')]['transaction'](function(_0x4efeeb){return _0x118958[_0x8e08('0x6e')](_0x1a3926[_0x8e08('0x35')][_0x8e08('0x65')],{'transaction':_0x4efeeb})[_0x8e08('0x27')](function(){if(!_['isEmpty'](_0x33b768)){return _0x118958[_0x8e08('0x83')](_0x33b768,{'transaction':_0x4efeeb});}})['then'](function(){_0x33b768[_0x8e08('0x6c')](function(_0x40ecba){socket['emit'](_0x8e08('0x84'),{'UserId':_0x40ecba,'MailQueueId':_0x118958['id']});});});});});});})['then'](respondWithStatusCode(_0x4efcee,null))['catch'](handleError(_0x4efcee,null));};exports[_0x8e08('0x85')]=function(_0xbf66f9,_0x1fba8e,_0x556a97){return db[_0x8e08('0x31')][_0x8e08('0x4c')]({'where':{'id':_0xbf66f9[_0x8e08('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fba8e,null))[_0x8e08('0x27')](function(_0x4560e4){if(_0x4560e4){return _0x4560e4[_0x8e08('0x85')](_0xbf66f9[_0x8e08('0x4e')][_0x8e08('0x65')],_[_0x8e08('0x86')](_0xbf66f9[_0x8e08('0x4e')],[_0x8e08('0x65'),'id'])||{})[_0x8e08('0x87')](function(_0x575eff){for(var _0x4d8cef=0x0;_0x4d8cef<_0xbf66f9[_0x8e08('0x4e')]['ids']['length'];_0x4d8cef+=0x1){socket[_0x8e08('0x88')]('userMailQueue:save',{'UserId':Number(_0xbf66f9['body']['ids'][_0x4d8cef]),'MailQueueId':Number(_0xbf66f9[_0x8e08('0x47')]['id'])});}return _0x575eff;});}})[_0x8e08('0x27')](respondWithResult(_0x1fba8e,null))[_0x8e08('0x45')](handleError(_0x1fba8e,null));};exports['removeAgents']=function(_0x6f122,_0xa67d94,_0x15e544){return db[_0x8e08('0x31')][_0x8e08('0x4c')]({'where':{'id':_0x6f122[_0x8e08('0x47')]['id']}})['then'](handleEntityNotFound(_0xa67d94,null))[_0x8e08('0x27')](function(_0xd35f0e){if(_0xd35f0e){return _0xd35f0e['removeAgents'](_0x6f122[_0x8e08('0x35')]['ids'])['then'](function(){if(_['isArray'](_0x6f122[_0x8e08('0x35')]['ids'])){for(var _0x22a13e=0x0;_0x22a13e<_0x6f122[_0x8e08('0x35')][_0x8e08('0x65')][_0x8e08('0x39')];_0x22a13e+=0x1){socket['emit'](_0x8e08('0x84'),{'UserId':Number(_0x6f122[_0x8e08('0x35')][_0x8e08('0x65')][_0x22a13e]),'MailQueueId':Number(_0x6f122['params']['id'])});}}else{socket[_0x8e08('0x88')](_0x8e08('0x84'),{'UserId':Number(_0x6f122[_0x8e08('0x35')][_0x8e08('0x65')]),'MailQueueId':Number(_0x6f122['params']['id'])});}});}})['then'](respondWithStatusCode(_0xa67d94,null))[_0x8e08('0x45')](handleError(_0xa67d94,null));};exports['getAgents']=function(_0x3932bb,_0x49d279,_0x550f45){var _0x375e5f={};var _0x594a49={};var _0x4d2001;var _0x4eff8c;return db[_0x8e08('0x31')]['findOne']({'where':{'id':_0x3932bb[_0x8e08('0x47')]['id']}})[_0x8e08('0x27')](handleEntityNotFound(_0x49d279,null))['then'](function(_0x59b3e2){if(_0x59b3e2){_0x4d2001=_0x59b3e2;_0x594a49[_0x8e08('0x34')]=_[_0x8e08('0x48')](db['User'][_0x8e08('0x49')]);_0x594a49[_0x8e08('0x35')]=_[_0x8e08('0x48')](_0x3932bb[_0x8e08('0x35')]);_0x594a49[_0x8e08('0x3e')]=_[_0x8e08('0x36')](_0x594a49['model'],_0x594a49[_0x8e08('0x35')]);_0x375e5f[_0x8e08('0x38')]=_[_0x8e08('0x36')](_0x594a49[_0x8e08('0x34')],qs[_0x8e08('0x37')](_0x3932bb[_0x8e08('0x35')][_0x8e08('0x37')]));_0x375e5f['attributes']=_0x375e5f['attributes'][_0x8e08('0x39')]?_0x375e5f[_0x8e08('0x38')]:_0x594a49[_0x8e08('0x34')];_0x375e5f[_0x8e08('0x3b')]=qs[_0x8e08('0x3c')](_0x3932bb[_0x8e08('0x35')]['sort']);_0x375e5f[_0x8e08('0x3d')]=qs[_0x8e08('0x3e')](_[_0x8e08('0x3f')](_0x3932bb[_0x8e08('0x35')],_0x594a49[_0x8e08('0x3e')]));if(_0x3932bb[_0x8e08('0x35')][_0x8e08('0x40')]){_0x375e5f[_0x8e08('0x3d')]=_[_0x8e08('0x41')](_0x375e5f[_0x8e08('0x3d')],{'$or':_['map'](_0x375e5f[_0x8e08('0x38')],function(_0x51e1b3){var _0x3985e8={};_0x3985e8[_0x51e1b3]={'$like':'%'+_0x3932bb[_0x8e08('0x35')][_0x8e08('0x40')]+'%'};return _0x3985e8;})});}_0x375e5f=_[_0x8e08('0x41')]({},_0x375e5f,_0x3932bb[_0x8e08('0x4b')]);return _0x4d2001[_0x8e08('0x89')](_0x375e5f);}})[_0x8e08('0x27')](function(_0x144913){if(_0x144913){_0x4eff8c=_0x144913['length'];if(!_0x3932bb[_0x8e08('0x35')][_0x8e08('0x5b')]('nolimit')){_0x375e5f[_0x8e08('0x21')]=qs[_0x8e08('0x21')](_0x3932bb[_0x8e08('0x35')][_0x8e08('0x21')]);_0x375e5f[_0x8e08('0x1e')]=qs[_0x8e08('0x1e')](_0x3932bb[_0x8e08('0x35')][_0x8e08('0x1e')]);}return _0x4d2001[_0x8e08('0x89')](_0x375e5f);}})[_0x8e08('0x27')](function(_0x478d1d){if(_0x478d1d){return _0x478d1d?{'count':_0x4eff8c,'rows':_0x478d1d}:null;}})['then'](respondWithResult(_0x49d279,null))[_0x8e08('0x45')](handleError(_0x49d279,null));}; \ No newline at end of file +var _0x848d=['params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','agent','mailPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','Agents','voicePause','flatMap','sequelize','transaction','emit','removeTeams','User','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','value','removeAgents','forEach','userMailQueue:remove','addAgents','ids','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','MailQueues','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailQueue','includeAll','include','findAll','rows','show'];(function(_0x428e79,_0x1830a8){var _0x53d865=function(_0x35246){while(--_0x35246){_0x428e79['push'](_0x428e79['shift']());}};_0x53d865(++_0x1830a8);}(_0x848d,0x1d5));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd848('0x0'));var rimraf=require(_0xd848('0x1'));var zipdir=require(_0xd848('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd848('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd848('0x4'));var util=require(_0xd848('0x5'));var path=require(_0xd848('0x6'));var sox=require(_0xd848('0x7'));var csv=require(_0xd848('0x8'));var ejs=require(_0xd848('0x9'));var fs=require('fs');var fs_extra=require(_0xd848('0xa'));var _=require(_0xd848('0xb'));var squel=require(_0xd848('0xc'));var crypto=require(_0xd848('0xd'));var jsforce=require(_0xd848('0xe'));var deskjs=require(_0xd848('0xf'));var toCsv=require(_0xd848('0x8'));var querystring=require(_0xd848('0x10'));var Papa=require(_0xd848('0x11'));var Redis=require('ioredis');var authService=require(_0xd848('0x12'));var qs=require(_0xd848('0x13'));var as=require(_0xd848('0x14'));var hardwareService=require(_0xd848('0x15'));var logger=require('../../config/logger')(_0xd848('0x16'));var utils=require(_0xd848('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd848('0x18'))['db'];config['redis']=_[_0xd848('0x19')](config[_0xd848('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd848('0x1b'))(new Redis(config[_0xd848('0x1a')]));require(_0xd848('0x1c'))[_0xd848('0x1d')](socket);function respondWithStatusCode(_0xd6d8d7,_0x2ae659){_0x2ae659=_0x2ae659||0xcc;return function(_0x2a4d9f){if(_0x2a4d9f){return _0xd6d8d7['sendStatus'](_0x2ae659);}return _0xd6d8d7[_0xd848('0x1e')](_0x2ae659)[_0xd848('0x1f')]();};}function respondWithResult(_0x5d5595,_0x439c57){_0x439c57=_0x439c57||0xc8;return function(_0x2ea342){if(_0x2ea342){return _0x5d5595[_0xd848('0x1e')](_0x439c57)[_0xd848('0x20')](_0x2ea342);}};}function respondWithFilteredResult(_0x137566,_0x40e8fe){return function(_0x5c22c5){if(_0x5c22c5){var _0x31dfdd=typeof _0x40e8fe[_0xd848('0x21')]===_0xd848('0x22')&&typeof _0x40e8fe[_0xd848('0x23')]==='undefined';var _0x30c580=_0x5c22c5[_0xd848('0x24')];var _0x22bd5d=_0x31dfdd?0x0:_0x40e8fe[_0xd848('0x21')];var _0x906bc6=_0x31dfdd?_0x5c22c5[_0xd848('0x24')]:_0x40e8fe['offset']+_0x40e8fe[_0xd848('0x23')];var _0x798c5a;if(_0x906bc6>=_0x30c580){_0x906bc6=_0x30c580;_0x798c5a=0xc8;}else{_0x798c5a=0xce;}_0x137566[_0xd848('0x1e')](_0x798c5a);return _0x137566[_0xd848('0x25')]('Content-Range',_0x22bd5d+'-'+_0x906bc6+'/'+_0x30c580)[_0xd848('0x20')](_0x5c22c5);}return null;};}function patchUpdates(_0xe333f8){return function(_0x20f69b){try{jsonpatch['apply'](_0x20f69b,_0xe333f8,!![]);}catch(_0x2a70c2){return BPromise[_0xd848('0x26')](_0x2a70c2);}return _0x20f69b[_0xd848('0x27')]();};}function saveUpdates(_0x27f868,_0x4c93f0){return function(_0x1189b9){if(_0x1189b9){return _0x1189b9[_0xd848('0x28')](_0x27f868)[_0xd848('0x29')](function(_0x272260){return _0x272260;});}return null;};}function removeEntity(_0x1d1d7d,_0x4236d3){return function(_0x1cc8df){if(_0x1cc8df){return _0x1cc8df[_0xd848('0x2a')]()[_0xd848('0x29')](function(){var _0x4b8d53=_0x1cc8df[_0xd848('0x2b')]({'plain':!![]});var _0xc4ab26=_0xd848('0x2c');return db['UserProfileResource'][_0xd848('0x2a')]({'where':{'type':_0xc4ab26,'resourceId':_0x4b8d53['id']}})[_0xd848('0x29')](function(){return _0x1cc8df;});})[_0xd848('0x29')](function(){_0x1d1d7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x141927,_0xe2e8d6){return function(_0x4eaee4){if(!_0x4eaee4){_0x141927['sendStatus'](0x194);}return _0x4eaee4;};}function handleError(_0x5bcf72,_0x542b8c){_0x542b8c=_0x542b8c||0x1f4;return function(_0x186391){logger[_0xd848('0x2d')](_0x186391['stack']);if(_0x186391[_0xd848('0x2e')]){delete _0x186391[_0xd848('0x2e')];}_0x5bcf72[_0xd848('0x1e')](_0x542b8c)[_0xd848('0x2f')](_0x186391);};}exports[_0xd848('0x30')]=function(_0x47caa3,_0x1ef056){var _0x563b98={},_0x1e4b4f={},_0x496e8c={'count':0x0,'rows':[]};var _0x25b260=_[_0xd848('0x31')](db['MailQueue']['rawAttributes'],function(_0xc0ffae){return{'name':_0xc0ffae[_0xd848('0x32')],'type':_0xc0ffae[_0xd848('0x33')][_0xd848('0x34')]};});_0x1e4b4f[_0xd848('0x35')]=_['map'](_0x25b260,_0xd848('0x2e'));_0x1e4b4f[_0xd848('0x36')]=_[_0xd848('0x37')](_0x47caa3[_0xd848('0x36')]);_0x1e4b4f[_0xd848('0x38')]=_['intersection'](_0x1e4b4f[_0xd848('0x35')],_0x1e4b4f['query']);_0x563b98[_0xd848('0x39')]=_[_0xd848('0x3a')](_0x1e4b4f[_0xd848('0x35')],qs['fields'](_0x47caa3[_0xd848('0x36')][_0xd848('0x3b')]));_0x563b98[_0xd848('0x39')]=_0x563b98[_0xd848('0x39')][_0xd848('0x3c')]?_0x563b98[_0xd848('0x39')]:_0x1e4b4f[_0xd848('0x35')];if(!_0x47caa3['query'][_0xd848('0x3d')]('nolimit')){_0x563b98[_0xd848('0x23')]=qs[_0xd848('0x23')](_0x47caa3[_0xd848('0x36')]['limit']);_0x563b98[_0xd848('0x21')]=qs['offset'](_0x47caa3[_0xd848('0x36')][_0xd848('0x21')]);}_0x563b98[_0xd848('0x3e')]=qs[_0xd848('0x3f')](_0x47caa3[_0xd848('0x36')]['sort']);_0x563b98[_0xd848('0x40')]=qs[_0xd848('0x38')](_[_0xd848('0x41')](_0x47caa3[_0xd848('0x36')],_0x1e4b4f[_0xd848('0x38')]),_0x25b260);if(_0x47caa3[_0xd848('0x36')][_0xd848('0x42')]){_0x563b98[_0xd848('0x40')]=_[_0xd848('0x43')](_0x563b98[_0xd848('0x40')],{'$or':_[_0xd848('0x31')](_0x25b260,function(_0x518594){if(_0x518594[_0xd848('0x33')]!=='VIRTUAL'){var _0x4d25cf={};_0x4d25cf[_0x518594[_0xd848('0x2e')]]={'$like':'%'+_0x47caa3[_0xd848('0x36')][_0xd848('0x42')]+'%'};return _0x4d25cf;}})});}_0x563b98=_[_0xd848('0x43')]({},_0x563b98,_0x47caa3[_0xd848('0x44')]);var _0x59f70c={'where':_0x563b98[_0xd848('0x40')]};return db[_0xd848('0x45')][_0xd848('0x24')](_0x59f70c)[_0xd848('0x29')](function(_0x734396){_0x496e8c[_0xd848('0x24')]=_0x734396;if(_0x47caa3[_0xd848('0x36')][_0xd848('0x46')]){_0x563b98[_0xd848('0x47')]=[{'all':!![]}];}return db[_0xd848('0x45')][_0xd848('0x48')](_0x563b98);})[_0xd848('0x29')](function(_0x7bcb2){_0x496e8c[_0xd848('0x49')]=_0x7bcb2;return _0x496e8c;})[_0xd848('0x29')](respondWithFilteredResult(_0x1ef056,_0x563b98))['catch'](handleError(_0x1ef056,null));};exports[_0xd848('0x4a')]=function(_0x57b9fa,_0x18ac9a){var _0x228509={'raw':!![],'where':{'id':_0x57b9fa[_0xd848('0x4b')]['id']}},_0x49f0cb={};_0x49f0cb[_0xd848('0x35')]=_[_0xd848('0x37')](db['MailQueue'][_0xd848('0x4c')]);_0x49f0cb[_0xd848('0x36')]=_[_0xd848('0x37')](_0x57b9fa[_0xd848('0x36')]);_0x49f0cb[_0xd848('0x38')]=_[_0xd848('0x3a')](_0x49f0cb[_0xd848('0x35')],_0x49f0cb['query']);_0x228509[_0xd848('0x39')]=_[_0xd848('0x3a')](_0x49f0cb[_0xd848('0x35')],qs[_0xd848('0x3b')](_0x57b9fa[_0xd848('0x36')][_0xd848('0x3b')]));_0x228509[_0xd848('0x39')]=_0x228509[_0xd848('0x39')][_0xd848('0x3c')]?_0x228509['attributes']:_0x49f0cb[_0xd848('0x35')];if(_0x57b9fa['query']['includeAll']){_0x228509[_0xd848('0x47')]=[{'all':!![]}];}_0x228509=_[_0xd848('0x43')]({},_0x228509,_0x57b9fa[_0xd848('0x44')]);return db['MailQueue'][_0xd848('0x4d')](_0x228509)[_0xd848('0x29')](handleEntityNotFound(_0x18ac9a,null))[_0xd848('0x29')](respondWithResult(_0x18ac9a,null))[_0xd848('0x4e')](handleError(_0x18ac9a,null));};exports[_0xd848('0x4f')]=function(_0x3beabc,_0x225d78){return db[_0xd848('0x45')][_0xd848('0x4f')](_0x3beabc[_0xd848('0x50')],{})[_0xd848('0x29')](function(_0x2cdda3){var _0x5b13aa=_0x3beabc[_0xd848('0x51')][_0xd848('0x2b')]({'plain':!![]});if(!_0x5b13aa)throw new Error(_0xd848('0x52'));if(_0x5b13aa[_0xd848('0x53')]===_0xd848('0x51')){var _0x1819e5=_0x2cdda3['get']({'plain':!![]});var _0x1df7cd='MailQueues';return db[_0xd848('0x54')][_0xd848('0x4d')]({'where':{'name':_0x1df7cd,'userProfileId':_0x5b13aa['userProfileId']},'raw':!![]})['then'](function(_0x3521a8){if(_0x3521a8&&_0x3521a8['autoAssociation']===0x0){return db[_0xd848('0x55')]['create']({'name':_0x1819e5['name'],'resourceId':_0x1819e5['id'],'type':_0x3521a8[_0xd848('0x2e')],'sectionId':_0x3521a8['id']},{})[_0xd848('0x29')](function(){return _0x2cdda3;});}else{return _0x2cdda3;}})[_0xd848('0x4e')](function(_0x6627fe){logger[_0xd848('0x2d')](_0xd848('0x56'),_0x6627fe);throw _0x6627fe;});}return _0x2cdda3;})[_0xd848('0x29')](respondWithResult(_0x225d78,0xc9))[_0xd848('0x4e')](handleError(_0x225d78,null));};exports[_0xd848('0x28')]=function(_0x57b9be,_0x52a053){if(_0x57b9be['body']['id']){delete _0x57b9be[_0xd848('0x50')]['id'];}return db[_0xd848('0x45')][_0xd848('0x4d')]({'where':{'id':_0x57b9be[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](handleEntityNotFound(_0x52a053,null))['then'](saveUpdates(_0x57b9be[_0xd848('0x50')],null))[_0xd848('0x29')](respondWithResult(_0x52a053,null))[_0xd848('0x4e')](handleError(_0x52a053,null));};exports[_0xd848('0x2a')]=function(_0x1134cb,_0xa0725f){return db[_0xd848('0x45')][_0xd848('0x4d')]({'where':{'id':_0x1134cb[_0xd848('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa0725f,null))[_0xd848('0x29')](removeEntity(_0xa0725f,null))['catch'](handleError(_0xa0725f,null));};exports[_0xd848('0x57')]=function(_0x3c7d32,_0x4a81c0){return db[_0xd848('0x45')][_0xd848('0x57')]()['then'](respondWithResult(_0x4a81c0,null))['catch'](handleError(_0x4a81c0,null));};exports[_0xd848('0x58')]=function(_0x32cdd1,_0x46debb,_0x4431e2){var _0x5c7b4e={'raw':!![],'where':{}},_0x453ae1={},_0x3e7f74;return db[_0xd848('0x45')][_0xd848('0x59')]({'where':{'id':_0x32cdd1[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](handleEntityNotFound(_0x46debb,null))['then'](function(_0x2dbb96){if(_0x2dbb96){_0x3e7f74=_0x2dbb96['get']({'plain':!![]});_0x453ae1[_0xd848('0x35')]=_[_0xd848('0x37')](db[_0xd848('0x5a')][_0xd848('0x4c')]);_0x453ae1['query']=_[_0xd848('0x37')](_0x32cdd1['query']);_0x453ae1[_0xd848('0x38')]=_[_0xd848('0x3a')](_0x453ae1[_0xd848('0x35')],_0x453ae1[_0xd848('0x36')]);_0x5c7b4e[_0xd848('0x39')]=_[_0xd848('0x3a')](_0x453ae1['model'],qs[_0xd848('0x3b')](_0x32cdd1[_0xd848('0x36')]['fields']));_0x5c7b4e[_0xd848('0x39')]=_0x5c7b4e[_0xd848('0x39')][_0xd848('0x3c')]?_0x5c7b4e[_0xd848('0x39')]:_0x453ae1[_0xd848('0x35')];if(!_0x32cdd1[_0xd848('0x36')][_0xd848('0x3d')](_0xd848('0x5b'))){_0x5c7b4e[_0xd848('0x23')]=qs[_0xd848('0x23')](_0x32cdd1[_0xd848('0x36')][_0xd848('0x23')]);_0x5c7b4e[_0xd848('0x21')]=qs[_0xd848('0x21')](_0x32cdd1[_0xd848('0x36')][_0xd848('0x21')]);}_0x5c7b4e[_0xd848('0x3e')]=qs[_0xd848('0x3f')](_0x32cdd1['query']['sort']);_0x5c7b4e['where']=qs[_0xd848('0x38')](_['pick'](_0x32cdd1[_0xd848('0x36')],_0x453ae1[_0xd848('0x38')]));_0x5c7b4e[_0xd848('0x40')][_0xd848('0x5c')]=_0x2dbb96['id'];if(_0x32cdd1[_0xd848('0x36')][_0xd848('0x42')]){_0x5c7b4e[_0xd848('0x40')]=_[_0xd848('0x43')](_0x5c7b4e[_0xd848('0x40')],{'$or':_[_0xd848('0x31')](_0x5c7b4e[_0xd848('0x39')],function(_0x44df0a){var _0x1f5340={};_0x1f5340[_0x44df0a]={'$like':'%'+_0x32cdd1[_0xd848('0x36')][_0xd848('0x42')]+'%'};return _0x1f5340;})});}_0x5c7b4e=_[_0xd848('0x43')]({},_0x5c7b4e,_0x32cdd1[_0xd848('0x44')]);return db[_0xd848('0x5a')][_0xd848('0x48')](_0x5c7b4e);}})['then'](function(_0x51712d){if(_0x51712d){return db['User']['findAndCountAll']({'where':{'id':_[_0xd848('0x31')](_0x51712d,'UserId'),'role':_0xd848('0x5d')},'attributes':['id',_0xd848('0x2e'),_0xd848('0x5e'),_0xd848('0x5f'),'createdAt']});}})[_0xd848('0x29')](function(_0x4e5b8b){if(_0x4e5b8b){return{'count':_0x4e5b8b[_0xd848('0x24')],'rows':_[_0xd848('0x31')](_0x4e5b8b[_0xd848('0x49')],function(_0x1e72e9){return{'membername':_0x1e72e9[_0xd848('0x2e')],'UserId':_0x1e72e9['id'],'queue_name':_0x3e7f74[_0xd848('0x2e')],'MailQueueId':_0x3e7f74['id'],'interface':util['format'](_0xd848('0x60'),_0xd848('0x61'),_0x1e72e9['name']),'penalty':0x0,'paused':_0x1e72e9['mailPause'],'createdAt':_0x1e72e9[_0xd848('0x62')],'updatedAt':_0x1e72e9[_0xd848('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x46debb,_0x5c7b4e))[_0xd848('0x4e')](handleError(_0x46debb,null));};exports['getTeams']=function(_0x638eba,_0x239b3a,_0x4a4d49){var _0x529638={};var _0x268a5c={};var _0x554f34;var _0x1cf644;return db[_0xd848('0x45')][_0xd848('0x59')]({'where':{'id':_0x638eba[_0xd848('0x4b')]['id']}})['then'](handleEntityNotFound(_0x239b3a,null))[_0xd848('0x29')](function(_0x44685e){if(_0x44685e){_0x554f34=_0x44685e;_0x268a5c['model']=_['keys'](db[_0xd848('0x63')][_0xd848('0x4c')]);_0x268a5c[_0xd848('0x36')]=_[_0xd848('0x37')](_0x638eba[_0xd848('0x36')]);_0x268a5c[_0xd848('0x38')]=_[_0xd848('0x3a')](_0x268a5c[_0xd848('0x35')],_0x268a5c[_0xd848('0x36')]);_0x529638[_0xd848('0x39')]=_[_0xd848('0x3a')](_0x268a5c[_0xd848('0x35')],qs[_0xd848('0x3b')](_0x638eba[_0xd848('0x36')][_0xd848('0x3b')]));_0x529638[_0xd848('0x39')]=_0x529638[_0xd848('0x39')]['length']?_0x529638[_0xd848('0x39')]:_0x268a5c[_0xd848('0x35')];_0x529638[_0xd848('0x3e')]=qs['sort'](_0x638eba[_0xd848('0x36')][_0xd848('0x3f')]);_0x529638['where']=qs[_0xd848('0x38')](_[_0xd848('0x41')](_0x638eba[_0xd848('0x36')],_0x268a5c[_0xd848('0x38')]));if(_0x638eba['query'][_0xd848('0x42')]){_0x529638[_0xd848('0x40')]=_['merge'](_0x529638[_0xd848('0x40')],{'$or':_[_0xd848('0x31')](_0x529638[_0xd848('0x39')],function(_0x39fade){var _0x289733={};_0x289733[_0x39fade]={'$like':'%'+_0x638eba[_0xd848('0x36')][_0xd848('0x42')]+'%'};return _0x289733;})});}_0x529638=_['merge']({},_0x529638,_0x638eba['options']);return _0x554f34[_0xd848('0x64')](_0x529638);}})[_0xd848('0x29')](function(_0xa04886){if(_0xa04886){_0x1cf644=_0xa04886[_0xd848('0x3c')];if(!_0x638eba[_0xd848('0x36')][_0xd848('0x3d')](_0xd848('0x5b'))){_0x529638[_0xd848('0x23')]=qs['limit'](_0x638eba[_0xd848('0x36')][_0xd848('0x23')]);_0x529638[_0xd848('0x21')]=qs[_0xd848('0x21')](_0x638eba['query'][_0xd848('0x21')]);}return _0x554f34[_0xd848('0x64')](_0x529638);}})[_0xd848('0x29')](function(_0x18b8f2){if(_0x18b8f2){return _0x18b8f2?{'count':_0x1cf644,'rows':_0x18b8f2}:null;}})[_0xd848('0x29')](respondWithResult(_0x239b3a,null))['catch'](handleError(_0x239b3a,null));};exports[_0xd848('0x65')]=function(_0x2816fa,_0x4bec7a,_0x4424f0){var _0x217ac5=_0x2816fa[_0xd848('0x50')]['ids'];return db[_0xd848('0x63')][_0xd848('0x48')]({'where':{'id':_0x217ac5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd848('0x66'),'attributes':['id',_0xd848('0x2e'),'online',_0xd848('0x67'),'interface'],'raw':!![]}]})[_0xd848('0x29')](function(_0x4ad1a2){if(_0x4ad1a2){var _0x391a46=_[_0xd848('0x68')](_0x4ad1a2,function(_0x16838e){var _0x45750d=_0x16838e[_0xd848('0x2b')]({'plain':!![]});return _0x45750d[_0xd848('0x66')];});return db[_0xd848('0x45')][_0xd848('0x4d')]({'where':{'id':_0x2816fa[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](function(_0x257a9c){return db[_0xd848('0x69')][_0xd848('0x6a')](function(_0x260abd){return _0x257a9c['addTeams'](_0x217ac5,{'transaction':_0x260abd})[_0xd848('0x29')](function(){return BPromise['each'](_0x391a46,function(_0x30974b){return db[_0xd848('0x5a')]['findOrCreate']({'where':{'UserId':_0x30974b['id'],'MailQueueId':_0x2816fa[_0xd848('0x4b')]['id']},'transaction':_0x260abd});});})['then'](function(){_0x391a46['forEach'](function(_0x5863fd){socket[_0xd848('0x6b')]('userMailQueue:save',{'UserId':_0x5863fd['id'],'MailQueueId':_0x257a9c['id']});});});});});}})[_0xd848('0x29')](respondWithStatusCode(_0x4bec7a,null))[_0xd848('0x4e')](handleError(_0x4bec7a,null));};exports[_0xd848('0x6c')]=function(_0x59f489,_0x1972ff,_0x4ca11d){return db[_0xd848('0x63')][_0xd848('0x48')]({'where':{'id':_0x59f489[_0xd848('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd848('0x6d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd848('0x29')](handleEntityNotFound(_0x1972ff,null))[_0xd848('0x29')](function(_0x1b2d42){var _0x59c358=_[_0xd848('0x31')](_0x1b2d42,'id');var _0x38fba2=[];var _0x5f1d0e=[];var _0x180853=squel[_0xd848('0x6e')]();_0x180853[_0xd848('0x6f')]('tq.TeamId')[_0xd848('0x70')](_0xd848('0x71'),'tq')[_0xd848('0x72')](_0xd848('0x73'),'ut',_0xd848('0x74'))[_0xd848('0x40')](_0xd848('0x75'),_0x59f489[_0xd848('0x4b')]['id']);for(var _0x37a75a=0x0;_0x37a75a<_0x1b2d42[_0xd848('0x3c')];_0x37a75a+=0x1){let _0x35f0ac=_0x1b2d42[_0x37a75a];for(var _0x480608=0x0;_0x480608<_0x35f0ac[_0xd848('0x66')][_0xd848('0x3c')];_0x480608+=0x1){let _0x20ef9a=_0x35f0ac['Agents'][_0x480608];var _0x2d2fbe=_0x180853['clone']();_0x2d2fbe[_0xd848('0x40')]('ut.UserId\x20=\x20?',_0x20ef9a['id']);_0x5f1d0e[_0xd848('0x76')](db[_0xd848('0x69')][_0xd848('0x36')](_0x2d2fbe[_0xd848('0x77')](),{'type':db['sequelize']['QueryTypes'][_0xd848('0x78')]})[_0xd848('0x29')](function(_0x21ce64){if(_0x21ce64[_0xd848('0x3c')]===0x1){return _0x20ef9a['id'];}else{var _0x19ff85=_[_0xd848('0x79')](_[_0xd848('0x31')](_0x21ce64,_0xd848('0x7a')),function(_0x4de840){return _['includes'](_0x59c358,_0x4de840);});if(_0x19ff85){return _0x20ef9a['id'];}}}));}}return BPromise[_0xd848('0x7b')](_0x5f1d0e)[_0xd848('0x29')](function(_0x583069){_0x38fba2=_(_0x38fba2)[_0xd848('0x7c')](_0x583069)['compact']()[_0xd848('0x7d')]();return db[_0xd848('0x45')][_0xd848('0x4d')]({'where':{'id':_0x59f489[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](function(_0x12a346){return db['sequelize'][_0xd848('0x6a')](function(_0xed7313){return _0x12a346[_0xd848('0x6c')](_0x59f489[_0xd848('0x36')]['ids'],{'transaction':_0xed7313})[_0xd848('0x29')](function(){if(!_['isEmpty'](_0x38fba2)){return _0x12a346[_0xd848('0x7e')](_0x38fba2,{'transaction':_0xed7313});}})['then'](function(){_0x38fba2[_0xd848('0x7f')](function(_0x5491dd){socket[_0xd848('0x6b')](_0xd848('0x80'),{'UserId':_0x5491dd,'MailQueueId':_0x12a346['id']});});});});});});})[_0xd848('0x29')](respondWithStatusCode(_0x1972ff,null))[_0xd848('0x4e')](handleError(_0x1972ff,null));};exports[_0xd848('0x81')]=function(_0x1b5177,_0x23cf38,_0x131aee){return db[_0xd848('0x45')][_0xd848('0x4d')]({'where':{'id':_0x1b5177[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](handleEntityNotFound(_0x23cf38,null))[_0xd848('0x29')](function(_0x3a1178){if(_0x3a1178){return _0x3a1178[_0xd848('0x81')](_0x1b5177[_0xd848('0x50')][_0xd848('0x82')],_[_0xd848('0x83')](_0x1b5177[_0xd848('0x50')],[_0xd848('0x82'),'id'])||{})[_0xd848('0x84')](function(_0x2a1876){for(var _0x2bd41f=0x0;_0x2bd41f<_0x1b5177['body']['ids'][_0xd848('0x3c')];_0x2bd41f+=0x1){socket['emit'](_0xd848('0x85'),{'UserId':Number(_0x1b5177[_0xd848('0x50')][_0xd848('0x82')][_0x2bd41f]),'MailQueueId':Number(_0x1b5177['params']['id'])});}return _0x2a1876;});}})[_0xd848('0x29')](respondWithResult(_0x23cf38,null))[_0xd848('0x4e')](handleError(_0x23cf38,null));};exports[_0xd848('0x7e')]=function(_0x5ae367,_0x51e5d0,_0x4c36b8){return db[_0xd848('0x45')]['find']({'where':{'id':_0x5ae367[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](handleEntityNotFound(_0x51e5d0,null))[_0xd848('0x29')](function(_0x38a2cd){if(_0x38a2cd){return _0x38a2cd[_0xd848('0x7e')](_0x5ae367[_0xd848('0x36')][_0xd848('0x82')])[_0xd848('0x29')](function(){if(_[_0xd848('0x86')](_0x5ae367[_0xd848('0x36')]['ids'])){for(var _0x4aaaeb=0x0;_0x4aaaeb<_0x5ae367[_0xd848('0x36')][_0xd848('0x82')][_0xd848('0x3c')];_0x4aaaeb+=0x1){socket[_0xd848('0x6b')]('userMailQueue:remove',{'UserId':Number(_0x5ae367[_0xd848('0x36')][_0xd848('0x82')][_0x4aaaeb]),'MailQueueId':Number(_0x5ae367['params']['id'])});}}else{socket[_0xd848('0x6b')]('userMailQueue:remove',{'UserId':Number(_0x5ae367[_0xd848('0x36')][_0xd848('0x82')]),'MailQueueId':Number(_0x5ae367['params']['id'])});}});}})[_0xd848('0x29')](respondWithStatusCode(_0x51e5d0,null))[_0xd848('0x4e')](handleError(_0x51e5d0,null));};exports['getAgents']=function(_0x5e900b,_0x33d854,_0x39f9db){var _0x5dc11f={};var _0x15f877={};var _0x187cb6;var _0x2a044d;return db[_0xd848('0x45')][_0xd848('0x59')]({'where':{'id':_0x5e900b[_0xd848('0x4b')]['id']}})[_0xd848('0x29')](handleEntityNotFound(_0x33d854,null))['then'](function(_0x3f8bcd){if(_0x3f8bcd){_0x187cb6=_0x3f8bcd;_0x15f877['model']=_[_0xd848('0x37')](db[_0xd848('0x6d')][_0xd848('0x4c')]);_0x15f877[_0xd848('0x36')]=_[_0xd848('0x37')](_0x5e900b['query']);_0x15f877[_0xd848('0x38')]=_[_0xd848('0x3a')](_0x15f877[_0xd848('0x35')],_0x15f877[_0xd848('0x36')]);_0x5dc11f[_0xd848('0x39')]=_['intersection'](_0x15f877[_0xd848('0x35')],qs[_0xd848('0x3b')](_0x5e900b['query'][_0xd848('0x3b')]));_0x5dc11f['attributes']=_0x5dc11f[_0xd848('0x39')][_0xd848('0x3c')]?_0x5dc11f[_0xd848('0x39')]:_0x15f877[_0xd848('0x35')];_0x5dc11f[_0xd848('0x3e')]=qs[_0xd848('0x3f')](_0x5e900b[_0xd848('0x36')][_0xd848('0x3f')]);_0x5dc11f[_0xd848('0x40')]=qs[_0xd848('0x38')](_[_0xd848('0x41')](_0x5e900b['query'],_0x15f877[_0xd848('0x38')]));if(_0x5e900b[_0xd848('0x36')][_0xd848('0x42')]){_0x5dc11f[_0xd848('0x40')]=_['merge'](_0x5dc11f[_0xd848('0x40')],{'$or':_[_0xd848('0x31')](_0x5dc11f['attributes'],function(_0x4dee81){var _0x1172bf={};_0x1172bf[_0x4dee81]={'$like':'%'+_0x5e900b['query'][_0xd848('0x42')]+'%'};return _0x1172bf;})});}_0x5dc11f=_[_0xd848('0x43')]({},_0x5dc11f,_0x5e900b['options']);return _0x187cb6[_0xd848('0x87')](_0x5dc11f);}})[_0xd848('0x29')](function(_0x4ea8a3){if(_0x4ea8a3){_0x2a044d=_0x4ea8a3[_0xd848('0x3c')];if(!_0x5e900b[_0xd848('0x36')][_0xd848('0x3d')](_0xd848('0x5b'))){_0x5dc11f['limit']=qs[_0xd848('0x23')](_0x5e900b[_0xd848('0x36')][_0xd848('0x23')]);_0x5dc11f[_0xd848('0x21')]=qs[_0xd848('0x21')](_0x5e900b[_0xd848('0x36')][_0xd848('0x21')]);}return _0x187cb6['getAgents'](_0x5dc11f);}})['then'](function(_0x24be41){if(_0x24be41){return _0x24be41?{'count':_0x2a044d,'rows':_0x24be41}:null;}})[_0xd848('0x29')](respondWithResult(_0x33d854,null))[_0xd848('0x4e')](handleError(_0x33d854,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d8faa42..855c5be 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 _0x0c22=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x3e8020,_0x390cb4){var _0x3f8a13=function(_0x41964a){while(--_0x41964a){_0x3e8020['push'](_0x3e8020['shift']());}};_0x3f8a13(++_0x390cb4);}(_0x0c22,0xe1));var _0x20c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0c22[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x20c2('0x0'));var MailQueue=require(_0x20c2('0x1'))['db'][_0x20c2('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x20c2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x20c2('0x4'),'afterDestroy':_0x20c2('0x5')};function emitEvent(_0x26b5a6){return function(_0xb6a89b,_0x595744,_0x4a2e75){MailQueueEvents[_0x20c2('0x6')](_0x26b5a6+':'+_0xb6a89b['id'],_0xb6a89b);MailQueueEvents[_0x20c2('0x6')](_0x26b5a6,_0xb6a89b);_0x4a2e75(null);};}for(var e in events){if(events[_0x20c2('0x7')](e)){var event=events[e];MailQueue[_0x20c2('0x8')](e,emitEvent(event));}}module[_0x20c2('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x4c3a=['MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x35d039,_0xb0d674){var _0x52e258=function(_0x517838){while(--_0x517838){_0x35d039['push'](_0x35d039['shift']());}};_0x52e258(++_0xb0d674);}(_0x4c3a,0x1ae));var _0xa4c3=function(_0x3bff96,_0x5c063b){_0x3bff96=_0x3bff96-0x0;var _0x3af2e9=_0x4c3a[_0x3bff96];return _0x3af2e9;};'use strict';var EventEmitter=require(_0xa4c3('0x0'));var MailQueue=require(_0xa4c3('0x1'))['db'][_0xa4c3('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa4c3('0x3')](0x0);var events={'afterCreate':_0xa4c3('0x4'),'afterUpdate':'update','afterDestroy':_0xa4c3('0x5')};function emitEvent(_0x138b1d){return function(_0x196fee,_0x44bfe1,_0x117e1d){MailQueueEvents[_0xa4c3('0x6')](_0x138b1d+':'+_0x196fee['id'],_0x196fee);MailQueueEvents[_0xa4c3('0x6')](_0x138b1d,_0x196fee);_0x117e1d(null);};}for(var e in events){if(events[_0xa4c3('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xa4c3('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 1b72018..ce66f92 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 _0x1344=['mail_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define'];(function(_0x44aef9,_0x3bf71b){var _0x26186e=function(_0x555d89){while(--_0x555d89){_0x44aef9['push'](_0x44aef9['shift']());}};_0x26186e(++_0x3bf71b);}(_0x1344,0x1da));var _0x4134=function(_0x5524a1,_0x37c171){_0x5524a1=_0x5524a1-0x0;var _0x4ea5e3=_0x1344[_0x5524a1];return _0x4ea5e3;};'use strict';var _=require(_0x4134('0x0'));var util=require('util');var logger=require(_0x4134('0x1'))('api');var moment=require(_0x4134('0x2'));var BPromise=require(_0x4134('0x3'));var rp=require(_0x4134('0x4'));var fs=require('fs');var path=require(_0x4134('0x5'));var rimraf=require(_0x4134('0x6'));var config=require(_0x4134('0x7'));var attributes=require(_0x4134('0x8'));module['exports']=function(_0x24cf07,_0x2772cf){return _0x24cf07[_0x4134('0x9')]('MailQueue',attributes,{'tableName':_0x4134('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9649=['bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','util','../../config/logger','api','moment'];(function(_0x4e9360,_0x31fd53){var _0x50dcfe=function(_0x111167){while(--_0x111167){_0x4e9360['push'](_0x4e9360['shift']());}};_0x50dcfe(++_0x31fd53);}(_0x9649,0xec));var _0x9964=function(_0x429d52,_0x3c20cb){_0x429d52=_0x429d52-0x0;var _0x33a746=_0x9649[_0x429d52];return _0x33a746;};'use strict';var _=require('lodash');var util=require(_0x9964('0x0'));var logger=require(_0x9964('0x1'))(_0x9964('0x2'));var moment=require(_0x9964('0x3'));var BPromise=require(_0x9964('0x4'));var rp=require(_0x9964('0x5'));var fs=require('fs');var path=require(_0x9964('0x6'));var rimraf=require('rimraf');var config=require(_0x9964('0x7'));var attributes=require(_0x9964('0x8'));module[_0x9964('0x9')]=function(_0x4f3dc9,_0x10bbe6){return _0x4f3dc9[_0x9964('0xa')]('MailQueue',attributes,{'tableName':_0x9964('0xb'),'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 ea19a0a..7743a73 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 _0x4d88=['GetMailQueue','MailQueue','raw','then','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','where','attributes','include','model','map'];(function(_0x1db498,_0x4589c4){var _0x5a171f=function(_0x24dd12){while(--_0x24dd12){_0x1db498['push'](_0x1db498['shift']());}};_0x5a171f(++_0x4589c4);}(_0x4d88,0x195));var _0x84d8=function(_0x20a5df,_0x4e1567){_0x20a5df=_0x20a5df-0x0;var _0x2124e4=_0x4d88[_0x20a5df];return _0x2124e4;};'use strict';var _=require(_0x84d8('0x0'));var util=require(_0x84d8('0x1'));var moment=require(_0x84d8('0x2'));var BPromise=require(_0x84d8('0x3'));var rs=require(_0x84d8('0x4'));var fs=require('fs');var Redis=require(_0x84d8('0x5'));var db=require(_0x84d8('0x6'))['db'];var utils=require(_0x84d8('0x7'));var logger=require(_0x84d8('0x8'))(_0x84d8('0x9'));var config=require(_0x84d8('0xa'));var jayson=require(_0x84d8('0xb'));var client=jayson[_0x84d8('0xc')][_0x84d8('0xd')]({'port':0x232a});config[_0x84d8('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x84d8('0xf'))(new Redis(config['redis']));require(_0x84d8('0x10'))[_0x84d8('0x11')](socket);function respondWithRpcPromise(_0x24283e,_0x33cf16,_0x387a32){return new BPromise(function(_0x3744ce,_0x118fe3){return client[_0x84d8('0x12')](_0x24283e,_0x387a32)['then'](function(_0x2f8203){logger[_0x84d8('0x13')](_0x84d8('0x14'),_0x33cf16,_0x84d8('0x15'));logger[_0x84d8('0x16')](_0x84d8('0x17'),_0x33cf16,_0x84d8('0x15'),JSON[_0x84d8('0x18')](_0x2f8203));if(_0x2f8203[_0x84d8('0x19')]){if(_0x2f8203[_0x84d8('0x19')]['code']===0x1f4){logger[_0x84d8('0x19')]('MailQueue,\x20%s,\x20%s',_0x33cf16,_0x2f8203['error'][_0x84d8('0x1a')]);return _0x118fe3(_0x2f8203[_0x84d8('0x19')]['message']);}logger[_0x84d8('0x19')](_0x84d8('0x14'),_0x33cf16,_0x2f8203[_0x84d8('0x19')][_0x84d8('0x1a')]);return _0x3744ce(_0x2f8203['error']['message']);}else{logger[_0x84d8('0x13')]('MailQueue,\x20%s,\x20%s',_0x33cf16,_0x84d8('0x15'));_0x3744ce(_0x2f8203[_0x84d8('0x1b')]['message']);}})[_0x84d8('0x1c')](function(_0x451b22){logger[_0x84d8('0x19')](_0x84d8('0x14'),_0x33cf16,_0x451b22);_0x118fe3(_0x451b22);});});}exports['GetMailQueue']=function(_0x52719e){var _0x45316f=this;return new Promise(function(_0x2476ea,_0x56491a){return db['MailQueue']['findAll']({'raw':_0x52719e['options']?_0x52719e[_0x84d8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x52719e[_0x84d8('0x1d')]?_0x52719e[_0x84d8('0x1d')][_0x84d8('0x1e')]||null:null,'attributes':_0x52719e['options']?_0x52719e[_0x84d8('0x1d')][_0x84d8('0x1f')]||null:null,'limit':_0x52719e[_0x84d8('0x1d')]?_0x52719e['options']['limit']||null:null,'include':_0x52719e['options']?_0x52719e['options'][_0x84d8('0x20')]?_['map'](_0x52719e['options'][_0x84d8('0x20')],function(_0x45c79e){return{'model':db[_0x45c79e[_0x84d8('0x21')]],'as':_0x45c79e['as'],'attributes':_0x45c79e[_0x84d8('0x1f')],'include':_0x45c79e[_0x84d8('0x20')]?_[_0x84d8('0x22')](_0x45c79e[_0x84d8('0x20')],function(_0x17ed00){return{'model':db[_0x17ed00[_0x84d8('0x21')]],'as':_0x17ed00['as'],'attributes':_0x17ed00['attributes'],'include':_0x17ed00['include']?_[_0x84d8('0x22')](_0x17ed00[_0x84d8('0x20')],function(_0x54f78f){return{'model':db[_0x54f78f[_0x84d8('0x21')]],'as':_0x54f78f['as'],'attributes':_0x54f78f[_0x84d8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2df6f9){logger[_0x84d8('0x13')](_0x84d8('0x23'),_0x52719e);logger[_0x84d8('0x16')]('GetMailQueue',_0x52719e,JSON[_0x84d8('0x18')](_0x2df6f9));_0x2476ea(_0x2df6f9);})[_0x84d8('0x1c')](function(_0x4678df){logger['error']('GetMailQueue',_0x4678df['message'],_0x52719e);_0x56491a(_0x45316f[_0x84d8('0x19')](0x1f4,_0x4678df[_0x84d8('0x1a')]));});});};exports['ShowMailQueue']=function(_0x5361d5){var _0x186de5=this;return new Promise(function(_0x48d823,_0x434a1a){return db[_0x84d8('0x24')]['find']({'raw':_0x5361d5['options']?_0x5361d5[_0x84d8('0x1d')][_0x84d8('0x25')]===undefined?!![]:![]:!![],'where':_0x5361d5[_0x84d8('0x1d')]?_0x5361d5[_0x84d8('0x1d')][_0x84d8('0x1e')]||null:null,'attributes':_0x5361d5[_0x84d8('0x1d')]?_0x5361d5[_0x84d8('0x1d')][_0x84d8('0x1f')]||null:null,'include':_0x5361d5[_0x84d8('0x1d')]?_0x5361d5[_0x84d8('0x1d')][_0x84d8('0x20')]?_['map'](_0x5361d5[_0x84d8('0x1d')]['include'],function(_0x4e6506){return{'model':db[_0x4e6506[_0x84d8('0x21')]],'as':_0x4e6506['as'],'attributes':_0x4e6506[_0x84d8('0x1f')],'include':_0x4e6506[_0x84d8('0x20')]?_['map'](_0x4e6506[_0x84d8('0x20')],function(_0x3ef0a9){return{'model':db[_0x3ef0a9['model']],'as':_0x3ef0a9['as'],'attributes':_0x3ef0a9[_0x84d8('0x1f')],'include':_0x3ef0a9[_0x84d8('0x20')]?_[_0x84d8('0x22')](_0x3ef0a9[_0x84d8('0x20')],function(_0x579818){return{'model':db[_0x579818[_0x84d8('0x21')]],'as':_0x579818['as'],'attributes':_0x579818[_0x84d8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x84d8('0x26')](function(_0x2ded11){logger[_0x84d8('0x13')](_0x84d8('0x27'),_0x5361d5);logger[_0x84d8('0x16')](_0x84d8('0x27'),_0x5361d5,JSON[_0x84d8('0x18')](_0x2ded11));_0x48d823(_0x2ded11);})[_0x84d8('0x1c')](function(_0x816d48){logger['error'](_0x84d8('0x27'),_0x816d48[_0x84d8('0x1a')],_0x5361d5);_0x434a1a(_0x186de5['error'](0x1f4,_0x816d48['message']));});});}; \ No newline at end of file +var _0xd71d=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailQueue','findAll','options','raw','where','attributes','include','model','map','GetMailQueue','stringify','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','register','request','then','info'];(function(_0x262446,_0x581ac3){var _0x1c6e45=function(_0x9fa5a1){while(--_0x9fa5a1){_0x262446['push'](_0x262446['shift']());}};_0x1c6e45(++_0x581ac3);}(_0xd71d,0x1a5));var _0xdd71=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xd71d[_0x404957];return _0x4e0365;};'use strict';var _=require(_0xdd71('0x0'));var util=require(_0xdd71('0x1'));var moment=require(_0xdd71('0x2'));var BPromise=require(_0xdd71('0x3'));var rs=require(_0xdd71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd71('0x5'))['db'];var utils=require(_0xdd71('0x6'));var logger=require(_0xdd71('0x7'))('rpc');var config=require(_0xdd71('0x8'));var jayson=require(_0xdd71('0x9'));var client=jayson[_0xdd71('0xa')]['http']({'port':0x232a});config[_0xdd71('0xb')]=_[_0xdd71('0xc')](config[_0xdd71('0xb')],{'host':_0xdd71('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd71('0xb')]));require(_0xdd71('0xe'))[_0xdd71('0xf')](socket);function respondWithRpcPromise(_0x42a51f,_0x1163dc,_0x5df09b){return new BPromise(function(_0x17cd75,_0x15d56b){return client[_0xdd71('0x10')](_0x42a51f,_0x5df09b)[_0xdd71('0x11')](function(_0x48bd45){logger[_0xdd71('0x12')](_0xdd71('0x13'),_0x1163dc,_0xdd71('0x14'));logger[_0xdd71('0x15')](_0xdd71('0x16'),_0x1163dc,_0xdd71('0x14'),JSON['stringify'](_0x48bd45));if(_0x48bd45[_0xdd71('0x17')]){if(_0x48bd45[_0xdd71('0x17')][_0xdd71('0x18')]===0x1f4){logger[_0xdd71('0x17')]('MailQueue,\x20%s,\x20%s',_0x1163dc,_0x48bd45[_0xdd71('0x17')][_0xdd71('0x19')]);return _0x15d56b(_0x48bd45[_0xdd71('0x17')][_0xdd71('0x19')]);}logger[_0xdd71('0x17')](_0xdd71('0x13'),_0x1163dc,_0x48bd45[_0xdd71('0x17')][_0xdd71('0x19')]);return _0x17cd75(_0x48bd45[_0xdd71('0x17')][_0xdd71('0x19')]);}else{logger[_0xdd71('0x12')]('MailQueue,\x20%s,\x20%s',_0x1163dc,'request\x20sent');_0x17cd75(_0x48bd45[_0xdd71('0x1a')][_0xdd71('0x19')]);}})[_0xdd71('0x1b')](function(_0x2a7d0b){logger[_0xdd71('0x17')](_0xdd71('0x13'),_0x1163dc,_0x2a7d0b);_0x15d56b(_0x2a7d0b);});});}exports['GetMailQueue']=function(_0x3243ef){var _0x199e70=this;return new Promise(function(_0x1959ca,_0x3635fc){return db[_0xdd71('0x1c')][_0xdd71('0x1d')]({'raw':_0x3243ef[_0xdd71('0x1e')]?_0x3243ef[_0xdd71('0x1e')][_0xdd71('0x1f')]===undefined?!![]:![]:!![],'where':_0x3243ef[_0xdd71('0x1e')]?_0x3243ef[_0xdd71('0x1e')][_0xdd71('0x20')]||null:null,'attributes':_0x3243ef['options']?_0x3243ef[_0xdd71('0x1e')][_0xdd71('0x21')]||null:null,'limit':_0x3243ef['options']?_0x3243ef[_0xdd71('0x1e')]['limit']||null:null,'include':_0x3243ef[_0xdd71('0x1e')]?_0x3243ef['options']['include']?_['map'](_0x3243ef['options'][_0xdd71('0x22')],function(_0x5bb250){return{'model':db[_0x5bb250[_0xdd71('0x23')]],'as':_0x5bb250['as'],'attributes':_0x5bb250[_0xdd71('0x21')],'include':_0x5bb250[_0xdd71('0x22')]?_[_0xdd71('0x24')](_0x5bb250['include'],function(_0x56b094){return{'model':db[_0x56b094[_0xdd71('0x23')]],'as':_0x56b094['as'],'attributes':_0x56b094[_0xdd71('0x21')],'include':_0x56b094[_0xdd71('0x22')]?_['map'](_0x56b094[_0xdd71('0x22')],function(_0x3a57fc){return{'model':db[_0x3a57fc[_0xdd71('0x23')]],'as':_0x3a57fc['as'],'attributes':_0x3a57fc['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd71('0x11')](function(_0x5b8848){logger['info'](_0xdd71('0x25'),_0x3243ef);logger[_0xdd71('0x15')](_0xdd71('0x25'),_0x3243ef,JSON[_0xdd71('0x26')](_0x5b8848));_0x1959ca(_0x5b8848);})[_0xdd71('0x1b')](function(_0x10da75){logger[_0xdd71('0x17')](_0xdd71('0x25'),_0x10da75[_0xdd71('0x19')],_0x3243ef);_0x3635fc(_0x199e70['error'](0x1f4,_0x10da75[_0xdd71('0x19')]));});});};exports[_0xdd71('0x27')]=function(_0x2c2a73){var _0x2f00f7=this;return new Promise(function(_0x5a1698,_0x345ad0){return db['MailQueue']['find']({'raw':_0x2c2a73[_0xdd71('0x1e')]?_0x2c2a73[_0xdd71('0x1e')][_0xdd71('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c2a73['options']?_0x2c2a73[_0xdd71('0x1e')]['where']||null:null,'attributes':_0x2c2a73[_0xdd71('0x1e')]?_0x2c2a73['options']['attributes']||null:null,'include':_0x2c2a73[_0xdd71('0x1e')]?_0x2c2a73[_0xdd71('0x1e')][_0xdd71('0x22')]?_['map'](_0x2c2a73['options'][_0xdd71('0x22')],function(_0x5a4668){return{'model':db[_0x5a4668['model']],'as':_0x5a4668['as'],'attributes':_0x5a4668[_0xdd71('0x21')],'include':_0x5a4668['include']?_['map'](_0x5a4668[_0xdd71('0x22')],function(_0x6f7dd){return{'model':db[_0x6f7dd[_0xdd71('0x23')]],'as':_0x6f7dd['as'],'attributes':_0x6f7dd[_0xdd71('0x21')],'include':_0x6f7dd[_0xdd71('0x22')]?_[_0xdd71('0x24')](_0x6f7dd[_0xdd71('0x22')],function(_0x45ec8d){return{'model':db[_0x45ec8d[_0xdd71('0x23')]],'as':_0x45ec8d['as'],'attributes':_0x45ec8d[_0xdd71('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdd71('0x11')](function(_0x3f0da5){logger[_0xdd71('0x12')](_0xdd71('0x27'),_0x2c2a73);logger[_0xdd71('0x15')](_0xdd71('0x27'),_0x2c2a73,JSON[_0xdd71('0x26')](_0x3f0da5));_0x5a1698(_0x3f0da5);})['catch'](function(_0x47ace6){logger[_0xdd71('0x17')](_0xdd71('0x27'),_0x47ace6[_0xdd71('0x19')],_0x2c2a73);_0x345ad0(_0x2f00f7['error'](0x1f4,_0x47ace6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7c2ed88..619c2d7 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 _0xa1bf=['save','remove','emit','register','length'];(function(_0x464b7d,_0xfc2350){var _0x54747b=function(_0x2c0d6f){while(--_0x2c0d6f){_0x464b7d['push'](_0x464b7d['shift']());}};_0x54747b(++_0xfc2350);}(_0xa1bf,0x91));var _0xfa1b=function(_0x2a19cb,_0x5e3908){_0x2a19cb=_0x2a19cb-0x0;var _0x34ef60=_0xa1bf[_0x2a19cb];return _0x34ef60;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xfa1b('0x0'),_0xfa1b('0x1'),'update'];function createListener(_0xc69ffc,_0x24ef5){return function(_0x4fd267){_0x24ef5[_0xfa1b('0x2')](_0xc69ffc,_0x4fd267);};}function removeListener(_0x83aaf4,_0x2e44c1){return function(){MailQueueEvents['removeListener'](_0x83aaf4,_0x2e44c1);};}exports[_0xfa1b('0x3')]=function(_0x4888bf){for(var _0x30e77a=0x0,_0x3a2d1f=events[_0xfa1b('0x4')];_0x30e77a<_0x3a2d1f;_0x30e77a++){var _0x2d430c=events[_0x30e77a];var _0x398d41=createListener('mailQueue:'+_0x2d430c,_0x4888bf);MailQueueEvents['on'](_0x2d430c,_0x398d41);}}; \ No newline at end of file +var _0x9e50=['remove','update','mailQueue:','./mailQueue.events','save'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x9e50,0xdf));var _0x09e5=function(_0x49baa8,_0x451e0d){_0x49baa8=_0x49baa8-0x0;var _0x58a58e=_0x9e50[_0x49baa8];return _0x58a58e;};'use strict';var MailQueueEvents=require(_0x09e5('0x0'));var events=[_0x09e5('0x1'),_0x09e5('0x2'),_0x09e5('0x3')];function createListener(_0x44fc9c,_0x1cb204){return function(_0x2a1ea9){_0x1cb204['emit'](_0x44fc9c,_0x2a1ea9);};}function removeListener(_0x359c0b,_0x3301f4){return function(){MailQueueEvents['removeListener'](_0x359c0b,_0x3301f4);};}exports['register']=function(_0x6796e2){for(var _0x424961=0x0,_0x5dc0ad=events['length'];_0x424961<_0x5dc0ad;_0x424961++){var _0x104556=events[_0x424961];var _0x50e6d8=createListener(_0x09e5('0x4')+_0x104556,_0x6796e2);MailQueueEvents['on'](_0x104556,_0x50e6d8);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b54f8d4..21c76d4 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 _0xa409=['get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated','/describe','describe'];(function(_0x1f3d7d,_0x1c4e87){var _0x3f5cc5=function(_0x3c2e84){while(--_0x3c2e84){_0x1f3d7d['push'](_0x1f3d7d['shift']());}};_0x3f5cc5(++_0x1c4e87);}(_0xa409,0x68));var _0x9a40=function(_0x73cf1b,_0x559a09){_0x73cf1b=_0x73cf1b-0x0;var _0x300267=_0xa409[_0x73cf1b];return _0x300267;};'use strict';var multer=require(_0x9a40('0x0'));var util=require(_0x9a40('0x1'));var path=require(_0x9a40('0x2'));var timeout=require(_0x9a40('0x3'));var express=require(_0x9a40('0x4'));var router=express['Router']();var fs_extra=require(_0x9a40('0x5'));var auth=require(_0x9a40('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x9a40('0x7')](),controller['index']);router['get'](_0x9a40('0x8'),auth[_0x9a40('0x7')](),controller[_0x9a40('0x9')]);router[_0x9a40('0xa')](_0x9a40('0xb'),auth[_0x9a40('0x7')](),controller[_0x9a40('0xc')]);router[_0x9a40('0xd')]('/',auth[_0x9a40('0x7')](),controller[_0x9a40('0xe')]);router[_0x9a40('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9a40('0x10')]);router['delete'](_0x9a40('0xb'),auth[_0x9a40('0x7')](),controller[_0x9a40('0x11')]);module[_0x9a40('0x12')]=router; \ No newline at end of file +var _0xb640=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x5c4e28,_0x4d2054){var _0x13623f=function(_0x408f48){while(--_0x408f48){_0x5c4e28['push'](_0x5c4e28['shift']());}};_0x13623f(++_0x4d2054);}(_0xb640,0x1d2));var _0x0b64=function(_0x832ad,_0x553e9d){_0x832ad=_0x832ad-0x0;var _0x53ff3f=_0xb640[_0x832ad];return _0x53ff3f;};'use strict';var multer=require(_0x0b64('0x0'));var util=require(_0x0b64('0x1'));var path=require('path');var timeout=require(_0x0b64('0x2'));var express=require(_0x0b64('0x3'));var router=express[_0x0b64('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0b64('0x6'));var controller=require(_0x0b64('0x7'));router[_0x0b64('0x8')]('/',auth['isAuthenticated'](),controller[_0x0b64('0x9')]);router[_0x0b64('0x8')](_0x0b64('0xa'),auth[_0x0b64('0xb')](),controller[_0x0b64('0xc')]);router[_0x0b64('0x8')](_0x0b64('0xd'),auth[_0x0b64('0xb')](),controller[_0x0b64('0xe')]);router[_0x0b64('0xf')]('/',auth[_0x0b64('0xb')](),controller[_0x0b64('0x10')]);router[_0x0b64('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0b64('0x12')]);router[_0x0b64('0x13')]('/:id',auth[_0x0b64('0xb')](),controller['destroy']);module[_0x0b64('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7047346..4d00f19 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 _0xcc30=['DATE','moment','sequelize','STRING'];(function(_0x4e9417,_0x3f3730){var _0x23ac0a=function(_0x5edafb){while(--_0x5edafb){_0x4e9417['push'](_0x4e9417['shift']());}};_0x23ac0a(++_0x3f3730);}(_0xcc30,0x1a9));var _0x0cc3=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0xcc30[_0x5ed54b];return _0x4b58c7;};'use strict';var moment=require(_0x0cc3('0x0'));var Sequelize=require(_0x0cc3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0cc3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0cc3('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0cc3('0x3')]},'acceptAt':{'type':Sequelize[_0x0cc3('0x3')]},'exitAt':{'type':Sequelize[_0x0cc3('0x3')]},'reason':{'type':Sequelize[_0x0cc3('0x2')]}}; \ No newline at end of file +var _0x02cc=['exports','STRING','DATE','moment','sequelize'];(function(_0x42bc17,_0x787221){var _0x1fa959=function(_0x3937ae){while(--_0x3937ae){_0x42bc17['push'](_0x42bc17['shift']());}};_0x1fa959(++_0x787221);}(_0x02cc,0x8f));var _0xc02c=function(_0x2063a8,_0x2b7d66){_0x2063a8=_0x2063a8-0x0;var _0x5a1b96=_0x02cc[_0x2063a8];return _0x5a1b96;};'use strict';var moment=require(_0xc02c('0x0'));var Sequelize=require(_0xc02c('0x1'));module[_0xc02c('0x2')]={'uniqueid':{'type':Sequelize[_0xc02c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc02c('0x3')]},'joinAt':{'type':Sequelize[_0xc02c('0x4')]},'leaveAt':{'type':Sequelize[_0xc02c('0x4')]},'acceptAt':{'type':Sequelize[_0xc02c('0x4')]},'exitAt':{'type':Sequelize[_0xc02c('0x4')]},'reason':{'type':Sequelize[_0xc02c('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1bfb287..4d5472a 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 _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailQueueReport','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','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'];(function(_0x4a5756,_0x11f062){var _0x3eb72e=function(_0x434b3e){while(--_0x434b3e){_0x4a5756['push'](_0x4a5756['shift']());}};_0x3eb72e(++_0x11f062);}(_0x2ef3,0xba));var _0x32ef=function(_0x17c351,_0x5ea099){_0x17c351=_0x17c351-0x0;var _0x4561e8=_0x2ef3[_0x17c351];return _0x4561e8;};'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['MailQueueReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['MailQueueReport'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['MailQueueReport']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file +var _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','MailQueueReport','rawAttributes','type','key','model','query'];(function(_0x5931cc,_0x5617c3){var _0x4189fd=function(_0x48632e){while(--_0x48632e){_0x5931cc['push'](_0x5931cc['shift']());}};_0x4189fd(++_0x5617c3);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4a2431,_0x323438){_0x4a2431=_0x4a2431-0x0;var _0x45f206=_0xc1c6[_0x4a2431];return _0x45f206;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['MailQueueReport']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['MailQueueReport'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['MailQueueReport']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['MailQueueReport'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ea11eb0..0ba7a44 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 _0x8dd9=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x8dd9,0x134));var _0x98dd=function(_0x22cb21,_0x433b0a){_0x22cb21=_0x22cb21-0x0;var _0x4dd943=_0x8dd9[_0x22cb21];return _0x4dd943;};'use strict';var _=require(_0x98dd('0x0'));var util=require(_0x98dd('0x1'));var logger=require(_0x98dd('0x2'))(_0x98dd('0x3'));var moment=require('moment');var BPromise=require(_0x98dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98dd('0x5'));var rimraf=require('rimraf');var config=require(_0x98dd('0x6'));var attributes=require(_0x98dd('0x7'));module['exports']=function(_0x590ab4,_0x38cd43){return _0x590ab4['define'](_0x98dd('0x8'),attributes,{'tableName':_0x98dd('0x9'),'paranoid':![],'indexes':[{'name':_0x98dd('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e36=['rimraf','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x8e36,0x1ce));var _0x68e3=function(_0xf1bda8,_0x3ff6ef){_0xf1bda8=_0xf1bda8-0x0;var _0x4415d7=_0x8e36[_0xf1bda8];return _0x4415d7;};'use strict';var _=require(_0x68e3('0x0'));var util=require(_0x68e3('0x1'));var logger=require('../../config/logger')(_0x68e3('0x2'));var moment=require(_0x68e3('0x3'));var BPromise=require(_0x68e3('0x4'));var rp=require(_0x68e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x68e3('0x7'));module[_0x68e3('0x8')]=function(_0x4612b4,_0x42e67e){return _0x4612b4[_0x68e3('0x9')]('MailQueueReport',attributes,{'tableName':_0x68e3('0xa'),'paranoid':![],'indexes':[{'name':_0x68e3('0xb'),'fields':[_0x68e3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index dc05f29..1e5edd7 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x383d81,_0x3babfe){var _0x4ba1dc=function(_0x1b579e){while(--_0x1b579e){_0x383d81['push'](_0x383d81['shift']());}};_0x4ba1dc(++_0x3babfe);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x3f509a,_0x1f4b4c){var _0x575dfc=function(_0xcdbaae){while(--_0xcdbaae){_0x3f509a['push'](_0x3f509a['shift']());}};_0x575dfc(++_0x1f4b4c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4e77256..d440a57 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10a169,_0x5cc213){var _0x24925d=function(_0x1a53bb){while(--_0x1a53bb){_0x10a169['push'](_0x10a169['shift']());}};_0x24925d(++_0x5cc213);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xcf77de,_0x5c3807){var _0x585948=function(_0x4a9278){while(--_0x4a9278){_0xcf77de['push'](_0xcf77de['shift']());}};_0x585948(++_0x5c3807);}(_0xe706,0xa3));var _0x6e70=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0xe706[_0x5bfb78];return _0x4efd00;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 73d8fb9..d64090a 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 _0x0713=['INBOX','INTEGER','STRING','BOOLEAN'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3071('0x0')]},'host':{'type':Sequelize[_0x3071('0x0')]},'authentication':{'type':Sequelize[_0x3071('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3071('0x0')]},'password':{'type':Sequelize[_0x3071('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x3071('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x2')},'connTimeout':{'type':Sequelize[_0x3071('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3071('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['INBOX','INTEGER','STRING','BOOLEAN'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3071('0x0')]},'host':{'type':Sequelize[_0x3071('0x0')]},'authentication':{'type':Sequelize[_0x3071('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3071('0x0')]},'password':{'type':Sequelize[_0x3071('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x3071('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x2')},'connTimeout':{'type':Sequelize[_0x3071('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3071('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 86aa763..3f67074 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 _0xc6ff=['rimraf','../../config/environment','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x15d32d,_0x1bdc27){var _0x40a023=function(_0x1d8c6d){while(--_0x1d8c6d){_0x15d32d['push'](_0x15d32d['shift']());}};_0x40a023(++_0x1bdc27);}(_0xc6ff,0x72));var _0xfc6f=function(_0x2c8cf6,_0x16800c){_0x2c8cf6=_0x2c8cf6-0x0;var _0x5c75a6=_0xc6ff[_0x2c8cf6];return _0x5c75a6;};'use strict';var _=require(_0xfc6f('0x0'));var util=require('util');var logger=require(_0xfc6f('0x1'))(_0xfc6f('0x2'));var moment=require(_0xfc6f('0x3'));var BPromise=require(_0xfc6f('0x4'));var rp=require(_0xfc6f('0x5'));var fs=require('fs');var path=require(_0xfc6f('0x6'));var rimraf=require(_0xfc6f('0x7'));var config=require(_0xfc6f('0x8'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x45e799,_0x1b8cdb){return _0x45e799['define'](_0xfc6f('0x9'),attributes,{'tableName':_0xfc6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1607=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1607,0x113));var _0x7160=function(_0x3f6c0d,_0x4edd5c){_0x3f6c0d=_0x3f6c0d-0x0;var _0x582a8a=_0x1607[_0x3f6c0d];return _0x582a8a;};'use strict';var _=require(_0x7160('0x0'));var util=require(_0x7160('0x1'));var logger=require(_0x7160('0x2'))(_0x7160('0x3'));var moment=require(_0x7160('0x4'));var BPromise=require(_0x7160('0x5'));var rp=require(_0x7160('0x6'));var fs=require('fs');var path=require(_0x7160('0x7'));var rimraf=require(_0x7160('0x8'));var config=require(_0x7160('0x9'));var attributes=require('./mailServerIn.attributes');module[_0x7160('0xa')]=function(_0x347cbe,_0x16ee2b){return _0x347cbe[_0x7160('0xb')](_0x7160('0xc'),attributes,{'tableName':_0x7160('0xd'),'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 5a08178..801cf47 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 _0xdbb7=['../../config/environment','jayson/promise','client','http','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x304ac7,_0x1c6d43){var _0x3210ed=function(_0x3eb134){while(--_0x3eb134){_0x304ac7['push'](_0x304ac7['shift']());}};_0x3210ed(++_0x1c6d43);}(_0xdbb7,0x9d));var _0x7dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7dbb('0x0'));var moment=require(_0x7dbb('0x1'));var BPromise=require(_0x7dbb('0x2'));var rs=require(_0x7dbb('0x3'));var fs=require('fs');var Redis=require(_0x7dbb('0x4'));var db=require(_0x7dbb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7dbb('0x6'))(_0x7dbb('0x7'));var config=require(_0x7dbb('0x8'));var jayson=require(_0x7dbb('0x9'));var client=jayson[_0x7dbb('0xa')][_0x7dbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1724bb,_0x3b7329,_0x4d709f){return new BPromise(function(_0x4a2e80,_0x190098){return client['request'](_0x1724bb,_0x4d709f)['then'](function(_0x76b7fc){logger['info'](_0x7dbb('0xc'),_0x3b7329,_0x7dbb('0xd'));logger[_0x7dbb('0xe')](_0x7dbb('0xf'),_0x3b7329,_0x7dbb('0xd'),JSON[_0x7dbb('0x10')](_0x76b7fc));if(_0x76b7fc['error']){if(_0x76b7fc[_0x7dbb('0x11')]['code']===0x1f4){logger[_0x7dbb('0x11')](_0x7dbb('0xc'),_0x3b7329,_0x76b7fc['error'][_0x7dbb('0x12')]);return _0x190098(_0x76b7fc[_0x7dbb('0x11')][_0x7dbb('0x12')]);}logger[_0x7dbb('0x11')](_0x7dbb('0xc'),_0x3b7329,_0x76b7fc['error'][_0x7dbb('0x12')]);return _0x4a2e80(_0x76b7fc['error']['message']);}else{logger[_0x7dbb('0x13')](_0x7dbb('0xc'),_0x3b7329,'request\x20sent');_0x4a2e80(_0x76b7fc[_0x7dbb('0x14')][_0x7dbb('0x12')]);}})[_0x7dbb('0x15')](function(_0x10e0b7){logger[_0x7dbb('0x11')](_0x7dbb('0xc'),_0x3b7329,_0x10e0b7);_0x190098(_0x10e0b7);});});}exports[_0x7dbb('0x16')]=function(_0x3eea25){var _0x2d1fb8=this;return new Promise(function(_0xe75de0,_0x223ffb){return db['MailServerIn'][_0x7dbb('0x17')]({'raw':_0x3eea25['options']?_0x3eea25[_0x7dbb('0x18')][_0x7dbb('0x19')]===undefined?!![]:![]:!![],'where':_0x3eea25[_0x7dbb('0x18')]?_0x3eea25[_0x7dbb('0x18')][_0x7dbb('0x1a')]||null:null,'attributes':_0x3eea25['options']?_0x3eea25[_0x7dbb('0x18')][_0x7dbb('0x1b')]||null:null,'limit':_0x3eea25['options']?_0x3eea25[_0x7dbb('0x18')][_0x7dbb('0x1c')]||null:null,'include':_0x3eea25[_0x7dbb('0x18')]?_0x3eea25[_0x7dbb('0x18')]['include']?_[_0x7dbb('0x1d')](_0x3eea25[_0x7dbb('0x18')][_0x7dbb('0x1e')],function(_0xad846d){return{'model':db[_0xad846d[_0x7dbb('0x1f')]],'as':_0xad846d['as'],'attributes':_0xad846d[_0x7dbb('0x1b')],'include':_0xad846d[_0x7dbb('0x1e')]?_[_0x7dbb('0x1d')](_0xad846d[_0x7dbb('0x1e')],function(_0x1b6b49){return{'model':db[_0x1b6b49[_0x7dbb('0x1f')]],'as':_0x1b6b49['as'],'attributes':_0x1b6b49['attributes'],'include':_0x1b6b49[_0x7dbb('0x1e')]?_[_0x7dbb('0x1d')](_0x1b6b49['include'],function(_0x4fce07){return{'model':db[_0x4fce07[_0x7dbb('0x1f')]],'as':_0x4fce07['as'],'attributes':_0x4fce07[_0x7dbb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7dbb('0x20')](function(_0x1ff518){logger['info'](_0x7dbb('0x16'),_0x3eea25);logger[_0x7dbb('0xe')](_0x7dbb('0x16'),_0x3eea25,JSON[_0x7dbb('0x10')](_0x1ff518));_0xe75de0(_0x1ff518);})[_0x7dbb('0x15')](function(_0x37267e){logger[_0x7dbb('0x11')](_0x7dbb('0x16'),_0x37267e[_0x7dbb('0x12')],_0x3eea25);_0x223ffb(_0x2d1fb8[_0x7dbb('0x11')](0x1f4,_0x37267e[_0x7dbb('0x12')]));});});}; \ No newline at end of file +var _0xc855=['lodash','moment','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','stringify'];(function(_0x250762,_0x5dac2a){var _0x5534bb=function(_0x6d5653){while(--_0x6d5653){_0x250762['push'](_0x250762['shift']());}};_0x5534bb(++_0x5dac2a);}(_0xc855,0xe8));var _0x5c85=function(_0x576f97,_0x5a3ccb){_0x576f97=_0x576f97-0x0;var _0x3f6f42=_0xc855[_0x576f97];return _0x3f6f42;};'use strict';var _=require(_0x5c85('0x0'));var util=require('util');var moment=require(_0x5c85('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c85('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5c85('0x3'));var jayson=require(_0x5c85('0x4'));var client=jayson[_0x5c85('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x404dbb,_0x562e14,_0x50e441){return new BPromise(function(_0x101544,_0x2d6ec0){return client[_0x5c85('0x6')](_0x404dbb,_0x50e441)[_0x5c85('0x7')](function(_0x19e4f3){logger[_0x5c85('0x8')](_0x5c85('0x9'),_0x562e14,_0x5c85('0xa'));logger[_0x5c85('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x562e14,_0x5c85('0xa'),JSON['stringify'](_0x19e4f3));if(_0x19e4f3[_0x5c85('0xc')]){if(_0x19e4f3[_0x5c85('0xc')][_0x5c85('0xd')]===0x1f4){logger[_0x5c85('0xc')](_0x5c85('0x9'),_0x562e14,_0x19e4f3[_0x5c85('0xc')][_0x5c85('0xe')]);return _0x2d6ec0(_0x19e4f3['error']['message']);}logger[_0x5c85('0xc')](_0x5c85('0x9'),_0x562e14,_0x19e4f3[_0x5c85('0xc')][_0x5c85('0xe')]);return _0x101544(_0x19e4f3['error'][_0x5c85('0xe')]);}else{logger[_0x5c85('0x8')](_0x5c85('0x9'),_0x562e14,_0x5c85('0xa'));_0x101544(_0x19e4f3[_0x5c85('0xf')]['message']);}})[_0x5c85('0x10')](function(_0x5bec87){logger['error']('MailServerIn,\x20%s,\x20%s',_0x562e14,_0x5bec87);_0x2d6ec0(_0x5bec87);});});}exports[_0x5c85('0x11')]=function(_0x24f0a5){var _0x4d0090=this;return new Promise(function(_0x320064,_0xba55a8){return db[_0x5c85('0x12')][_0x5c85('0x13')]({'raw':_0x24f0a5['options']?_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x15')]===undefined?!![]:![]:!![],'where':_0x24f0a5[_0x5c85('0x14')]?_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x16')]||null:null,'attributes':_0x24f0a5[_0x5c85('0x14')]?_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x17')]||null:null,'limit':_0x24f0a5[_0x5c85('0x14')]?_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x18')]||null:null,'include':_0x24f0a5[_0x5c85('0x14')]?_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x19')]?_['map'](_0x24f0a5[_0x5c85('0x14')][_0x5c85('0x19')],function(_0xc87375){return{'model':db[_0xc87375[_0x5c85('0x1a')]],'as':_0xc87375['as'],'attributes':_0xc87375[_0x5c85('0x17')],'include':_0xc87375[_0x5c85('0x19')]?_[_0x5c85('0x1b')](_0xc87375[_0x5c85('0x19')],function(_0x5164c7){return{'model':db[_0x5164c7[_0x5c85('0x1a')]],'as':_0x5164c7['as'],'attributes':_0x5164c7['attributes'],'include':_0x5164c7['include']?_[_0x5c85('0x1b')](_0x5164c7['include'],function(_0x524fc3){return{'model':db[_0x524fc3[_0x5c85('0x1a')]],'as':_0x524fc3['as'],'attributes':_0x524fc3[_0x5c85('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5c85('0x7')](function(_0x150e1d){logger[_0x5c85('0x8')](_0x5c85('0x11'),_0x24f0a5);logger[_0x5c85('0xb')](_0x5c85('0x11'),_0x24f0a5,JSON[_0x5c85('0x1c')](_0x150e1d));_0x320064(_0x150e1d);})[_0x5c85('0x10')](function(_0x190bb0){logger[_0x5c85('0xc')]('GetMailServerIn',_0x190bb0['message'],_0x24f0a5);_0xba55a8(_0x4d0090[_0x5c85('0xc')](0x1f4,_0x190bb0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 728482c..5c97a63 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x1eb2bc,_0x249fd2){_0x1eb2bc=_0x1eb2bc-0x0;var _0x1043ab=_0x7a54[_0x1eb2bc];return _0x1043ab;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index bbf11da..4df93e8 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 _0xb0fb=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb0fb,0xcb));var _0xbb0f=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xb0fb[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require(_0xbb0f('0x0'));module[_0xbb0f('0x1')]={'description':{'type':Sequelize[_0xbb0f('0x2')]},'host':{'type':Sequelize[_0xbb0f('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb0f('0x3')]},'secure':{'type':Sequelize[_0xbb0f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xbb0f('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x39d3=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x4f82bb,_0x2a0185){var _0x8e29a7=function(_0x29a6f1){while(--_0x29a6f1){_0x4f82bb['push'](_0x4f82bb['shift']());}};_0x8e29a7(++_0x2a0185);}(_0x39d3,0x1e5));var _0x339d=function(_0x1463b5,_0x34219e){_0x1463b5=_0x1463b5-0x0;var _0xdcb2a=_0x39d3[_0x1463b5];return _0xdcb2a;};'use strict';var Sequelize=require(_0x339d('0x0'));module[_0x339d('0x1')]={'description':{'type':Sequelize[_0x339d('0x2')]},'host':{'type':Sequelize[_0x339d('0x2')]},'user':{'type':Sequelize[_0x339d('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x339d('0x3')]},'secure':{'type':Sequelize[_0x339d('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x339d('0x2')]},'authentication':{'type':Sequelize[_0x339d('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 93d9e77..7d763d3 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 _0x4bea=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','stack','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2c2c63,_0x4239f9){var _0x55cefe=function(_0x45799c){while(--_0x45799c){_0x2c2c63['push'](_0x2c2c63['shift']());}};_0x55cefe(++_0x4239f9);}(_0x4bea,0x1aa));var _0xa4be=function(_0x4ea9a4,_0x344f3e){_0x4ea9a4=_0x4ea9a4-0x0;var _0x30fddb=_0x4bea[_0x4ea9a4];return _0x30fddb;};'use strict';var emlformat=require(_0xa4be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4be('0x1'));var jsonpatch=require(_0xa4be('0x2'));var rp=require(_0xa4be('0x3'));var moment=require(_0xa4be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa4be('0x5'));var util=require(_0xa4be('0x6'));var path=require('path');var sox=require(_0xa4be('0x7'));var csv=require(_0xa4be('0x8'));var ejs=require(_0xa4be('0x9'));var fs=require('fs');var fs_extra=require(_0xa4be('0xa'));var _=require(_0xa4be('0xb'));var squel=require(_0xa4be('0xc'));var crypto=require(_0xa4be('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa4be('0xe'));var toCsv=require(_0xa4be('0x8'));var querystring=require(_0xa4be('0xf'));var Papa=require(_0xa4be('0x10'));var Redis=require(_0xa4be('0x11'));var authService=require(_0xa4be('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa4be('0x13'));var hardwareService=require(_0xa4be('0x14'));var logger=require(_0xa4be('0x15'))(_0xa4be('0x16'));var utils=require('../../config/utils');var config=require(_0xa4be('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4be('0x18'))['db'];function respondWithStatusCode(_0x2a7421,_0x11daf0){_0x11daf0=_0x11daf0||0xcc;return function(_0x45fb92){if(_0x45fb92){return _0x2a7421[_0xa4be('0x19')](_0x11daf0);}return _0x2a7421[_0xa4be('0x1a')](_0x11daf0)['end']();};}function respondWithResult(_0x5acc15,_0x1d155d){_0x1d155d=_0x1d155d||0xc8;return function(_0x166423){if(_0x166423){return _0x5acc15['status'](_0x1d155d)[_0xa4be('0x1b')](_0x166423);}};}function respondWithFilteredResult(_0x1fc986,_0x15504d){return function(_0x4e80b4){if(_0x4e80b4){var _0x34d7f9=typeof _0x15504d[_0xa4be('0x1c')]===_0xa4be('0x1d')&&typeof _0x15504d[_0xa4be('0x1e')]===_0xa4be('0x1d');var _0x457896=_0x4e80b4[_0xa4be('0x1f')];var _0x2faaa0=_0x34d7f9?0x0:_0x15504d[_0xa4be('0x1c')];var _0x2d994f=_0x34d7f9?_0x4e80b4[_0xa4be('0x1f')]:_0x15504d[_0xa4be('0x1c')]+_0x15504d['limit'];var _0x3ce578;if(_0x2d994f>=_0x457896){_0x2d994f=_0x457896;_0x3ce578=0xc8;}else{_0x3ce578=0xce;}_0x1fc986[_0xa4be('0x1a')](_0x3ce578);return _0x1fc986['set'](_0xa4be('0x20'),_0x2faaa0+'-'+_0x2d994f+'/'+_0x457896)[_0xa4be('0x1b')](_0x4e80b4);}return null;};}function patchUpdates(_0x235184){return function(_0x322e06){try{jsonpatch[_0xa4be('0x21')](_0x322e06,_0x235184,!![]);}catch(_0x5f0743){return BPromise[_0xa4be('0x22')](_0x5f0743);}return _0x322e06['save']();};}function saveUpdates(_0x13dc09,_0x15e7f7){return function(_0x5c6861){if(_0x5c6861){return _0x5c6861['update'](_0x13dc09)[_0xa4be('0x23')](function(_0x3283cb){return _0x3283cb;});}return null;};}function removeEntity(_0xaaf2c9,_0x4bc08f){return function(_0x409ead){if(_0x409ead){return _0x409ead['destroy']()[_0xa4be('0x23')](function(){_0xaaf2c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x284cde,_0x2eebb4){return function(_0x1572d6){if(!_0x1572d6){_0x284cde['sendStatus'](0x194);}return _0x1572d6;};}function handleError(_0x2c43a9,_0x535c34){_0x535c34=_0x535c34||0x1f4;return function(_0x67646f){logger[_0xa4be('0x24')](_0x67646f[_0xa4be('0x25')]);if(_0x67646f['name']){delete _0x67646f[_0xa4be('0x26')];}_0x2c43a9[_0xa4be('0x1a')](_0x535c34)['send'](_0x67646f);};}exports[_0xa4be('0x27')]=function(_0xa246da,_0x79c673){var _0x4052c4={},_0x280585={},_0xc8925f={'count':0x0,'rows':[]};var _0x4e54e1=_['map'](db[_0xa4be('0x28')][_0xa4be('0x29')],function(_0x134cad){return{'name':_0x134cad[_0xa4be('0x2a')],'type':_0x134cad[_0xa4be('0x2b')][_0xa4be('0x2c')]};});_0x280585[_0xa4be('0x2d')]=_[_0xa4be('0x2e')](_0x4e54e1,_0xa4be('0x26'));_0x280585['query']=_[_0xa4be('0x2f')](_0xa246da[_0xa4be('0x30')]);_0x280585[_0xa4be('0x31')]=_[_0xa4be('0x32')](_0x280585[_0xa4be('0x2d')],_0x280585[_0xa4be('0x30')]);_0x4052c4['attributes']=_['intersection'](_0x280585[_0xa4be('0x2d')],qs['fields'](_0xa246da[_0xa4be('0x30')][_0xa4be('0x33')]));_0x4052c4[_0xa4be('0x34')]=_0x4052c4[_0xa4be('0x34')]['length']?_0x4052c4[_0xa4be('0x34')]:_0x280585[_0xa4be('0x2d')];if(!_0xa246da['query'][_0xa4be('0x35')](_0xa4be('0x36'))){_0x4052c4[_0xa4be('0x1e')]=qs[_0xa4be('0x1e')](_0xa246da[_0xa4be('0x30')]['limit']);_0x4052c4['offset']=qs[_0xa4be('0x1c')](_0xa246da[_0xa4be('0x30')][_0xa4be('0x1c')]);}_0x4052c4[_0xa4be('0x37')]=qs[_0xa4be('0x38')](_0xa246da[_0xa4be('0x30')][_0xa4be('0x38')]);_0x4052c4[_0xa4be('0x39')]=qs[_0xa4be('0x31')](_['pick'](_0xa246da[_0xa4be('0x30')],_0x280585[_0xa4be('0x31')]),_0x4e54e1);if(_0xa246da[_0xa4be('0x30')][_0xa4be('0x3a')]){_0x4052c4[_0xa4be('0x39')]=_[_0xa4be('0x3b')](_0x4052c4[_0xa4be('0x39')],{'$or':_['map'](_0x4e54e1,function(_0x2e1e7d){if(_0x2e1e7d[_0xa4be('0x2b')]!==_0xa4be('0x3c')){var _0x37d837={};_0x37d837[_0x2e1e7d[_0xa4be('0x26')]]={'$like':'%'+_0xa246da[_0xa4be('0x30')][_0xa4be('0x3a')]+'%'};return _0x37d837;}})});}_0x4052c4=_['merge']({},_0x4052c4,_0xa246da[_0xa4be('0x3d')]);var _0x11d4b5={'where':_0x4052c4['where']};return db[_0xa4be('0x28')]['count'](_0x11d4b5)[_0xa4be('0x23')](function(_0x534168){_0xc8925f[_0xa4be('0x1f')]=_0x534168;if(_0xa246da[_0xa4be('0x30')][_0xa4be('0x3e')]){_0x4052c4[_0xa4be('0x3f')]=[{'all':!![]}];}return db[_0xa4be('0x28')][_0xa4be('0x40')](_0x4052c4);})[_0xa4be('0x23')](function(_0x5cb15f){_0xc8925f[_0xa4be('0x41')]=_0x5cb15f;return _0xc8925f;})[_0xa4be('0x23')](respondWithFilteredResult(_0x79c673,_0x4052c4))[_0xa4be('0x42')](handleError(_0x79c673,null));};exports['show']=function(_0x572885,_0x4f7c83){var _0x4280d0={'raw':!![],'where':{'id':_0x572885['params']['id']}},_0x148f86={};_0x148f86[_0xa4be('0x2d')]=_['keys'](db[_0xa4be('0x28')]['rawAttributes']);_0x148f86[_0xa4be('0x30')]=_['keys'](_0x572885[_0xa4be('0x30')]);_0x148f86[_0xa4be('0x31')]=_[_0xa4be('0x32')](_0x148f86[_0xa4be('0x2d')],_0x148f86[_0xa4be('0x30')]);_0x4280d0[_0xa4be('0x34')]=_[_0xa4be('0x32')](_0x148f86['model'],qs[_0xa4be('0x33')](_0x572885[_0xa4be('0x30')][_0xa4be('0x33')]));_0x4280d0[_0xa4be('0x34')]=_0x4280d0[_0xa4be('0x34')][_0xa4be('0x43')]?_0x4280d0[_0xa4be('0x34')]:_0x148f86[_0xa4be('0x2d')];if(_0x572885['query'][_0xa4be('0x3e')]){_0x4280d0['include']=[{'all':!![]}];}_0x4280d0=_[_0xa4be('0x3b')]({},_0x4280d0,_0x572885[_0xa4be('0x3d')]);return db[_0xa4be('0x28')][_0xa4be('0x44')](_0x4280d0)[_0xa4be('0x23')](handleEntityNotFound(_0x4f7c83,null))[_0xa4be('0x23')](respondWithResult(_0x4f7c83,null))[_0xa4be('0x42')](handleError(_0x4f7c83,null));};exports[_0xa4be('0x45')]=function(_0x3ab699,_0x2037dc){return db[_0xa4be('0x28')]['create'](_0x3ab699['body'],{})[_0xa4be('0x23')](respondWithResult(_0x2037dc,0xc9))[_0xa4be('0x42')](handleError(_0x2037dc,null));};exports['update']=function(_0x5ac2a7,_0x35e6bc){if(_0x5ac2a7[_0xa4be('0x46')]['id']){delete _0x5ac2a7[_0xa4be('0x46')]['id'];}return db['MailServerOut'][_0xa4be('0x44')]({'where':{'id':_0x5ac2a7[_0xa4be('0x47')]['id']}})[_0xa4be('0x23')](handleEntityNotFound(_0x35e6bc,null))['then'](saveUpdates(_0x5ac2a7[_0xa4be('0x46')],null))[_0xa4be('0x23')](respondWithResult(_0x35e6bc,null))[_0xa4be('0x42')](handleError(_0x35e6bc,null));};exports[_0xa4be('0x48')]=function(_0x51261b,_0x6bed96){return db['MailServerOut'][_0xa4be('0x44')]({'where':{'id':_0x51261b[_0xa4be('0x47')]['id']}})[_0xa4be('0x23')](handleEntityNotFound(_0x6bed96,null))[_0xa4be('0x23')](removeEntity(_0x6bed96,null))[_0xa4be('0x42')](handleError(_0x6bed96,null));}; \ No newline at end of file +var _0x0ba7=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x49c137,_0x375c3c){var _0x153198=function(_0x28a727){while(--_0x28a727){_0x49c137['push'](_0x49c137['shift']());}};_0x153198(++_0x375c3c);}(_0x0ba7,0xd8));var _0x70ba=function(_0x4d00cd,_0x54f207){_0x4d00cd=_0x4d00cd-0x0;var _0x354015=_0x0ba7[_0x4d00cd];return _0x354015;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x70ba('0x0'));var jsonpatch=require(_0x70ba('0x1'));var rp=require(_0x70ba('0x2'));var moment=require(_0x70ba('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x70ba('0x4'));var path=require(_0x70ba('0x5'));var sox=require(_0x70ba('0x6'));var csv=require(_0x70ba('0x7'));var ejs=require(_0x70ba('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70ba('0x9'));var squel=require(_0x70ba('0xa'));var crypto=require(_0x70ba('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x70ba('0xc'));var toCsv=require(_0x70ba('0x7'));var querystring=require('querystring');var Papa=require(_0x70ba('0xd'));var Redis=require(_0x70ba('0xe'));var authService=require(_0x70ba('0xf'));var qs=require(_0x70ba('0x10'));var as=require(_0x70ba('0x11'));var hardwareService=require(_0x70ba('0x12'));var logger=require(_0x70ba('0x13'))(_0x70ba('0x14'));var utils=require(_0x70ba('0x15'));var config=require(_0x70ba('0x16'));var licenseUtil=require(_0x70ba('0x17'));var db=require(_0x70ba('0x18'))['db'];function respondWithStatusCode(_0x48bccf,_0x4aa547){_0x4aa547=_0x4aa547||0xcc;return function(_0x562c55){if(_0x562c55){return _0x48bccf[_0x70ba('0x19')](_0x4aa547);}return _0x48bccf['status'](_0x4aa547)['end']();};}function respondWithResult(_0x2b3e41,_0x27beb7){_0x27beb7=_0x27beb7||0xc8;return function(_0x14ee52){if(_0x14ee52){return _0x2b3e41['status'](_0x27beb7)['json'](_0x14ee52);}};}function respondWithFilteredResult(_0x1bb740,_0x41cc57){return function(_0x448db5){if(_0x448db5){var _0x34a57e=typeof _0x41cc57[_0x70ba('0x1a')]===_0x70ba('0x1b')&&typeof _0x41cc57[_0x70ba('0x1c')]===_0x70ba('0x1b');var _0x3b0951=_0x448db5[_0x70ba('0x1d')];var _0x11540f=_0x34a57e?0x0:_0x41cc57[_0x70ba('0x1a')];var _0x3b28f0=_0x34a57e?_0x448db5[_0x70ba('0x1d')]:_0x41cc57['offset']+_0x41cc57[_0x70ba('0x1c')];var _0x177daf;if(_0x3b28f0>=_0x3b0951){_0x3b28f0=_0x3b0951;_0x177daf=0xc8;}else{_0x177daf=0xce;}_0x1bb740[_0x70ba('0x1e')](_0x177daf);return _0x1bb740[_0x70ba('0x1f')](_0x70ba('0x20'),_0x11540f+'-'+_0x3b28f0+'/'+_0x3b0951)[_0x70ba('0x21')](_0x448db5);}return null;};}function patchUpdates(_0x25237b){return function(_0x1fcafa){try{jsonpatch[_0x70ba('0x22')](_0x1fcafa,_0x25237b,!![]);}catch(_0x3e43eb){return BPromise[_0x70ba('0x23')](_0x3e43eb);}return _0x1fcafa[_0x70ba('0x24')]();};}function saveUpdates(_0x39f2fa,_0x1fc672){return function(_0xe7ee5e){if(_0xe7ee5e){return _0xe7ee5e[_0x70ba('0x25')](_0x39f2fa)[_0x70ba('0x26')](function(_0x4a151e){return _0x4a151e;});}return null;};}function removeEntity(_0x3be62b,_0x3804ad){return function(_0x3e24b9){if(_0x3e24b9){return _0x3e24b9[_0x70ba('0x27')]()[_0x70ba('0x26')](function(){_0x3be62b[_0x70ba('0x1e')](0xcc)[_0x70ba('0x28')]();});}};}function handleEntityNotFound(_0x2bef17,_0x4ac694){return function(_0x2495ed){if(!_0x2495ed){_0x2bef17[_0x70ba('0x19')](0x194);}return _0x2495ed;};}function handleError(_0x261295,_0x13d8d2){_0x13d8d2=_0x13d8d2||0x1f4;return function(_0x284a71){logger[_0x70ba('0x29')](_0x284a71['stack']);if(_0x284a71['name']){delete _0x284a71[_0x70ba('0x2a')];}_0x261295['status'](_0x13d8d2)[_0x70ba('0x2b')](_0x284a71);};}exports[_0x70ba('0x2c')]=function(_0x576628,_0xe6ec6c){var _0x1562f3={},_0x5bdaaf={},_0x1e6da9={'count':0x0,'rows':[]};var _0x5e7c79=_['map'](db[_0x70ba('0x2d')][_0x70ba('0x2e')],function(_0x209338){return{'name':_0x209338[_0x70ba('0x2f')],'type':_0x209338[_0x70ba('0x30')][_0x70ba('0x31')]};});_0x5bdaaf[_0x70ba('0x32')]=_['map'](_0x5e7c79,_0x70ba('0x2a'));_0x5bdaaf[_0x70ba('0x33')]=_[_0x70ba('0x34')](_0x576628[_0x70ba('0x33')]);_0x5bdaaf[_0x70ba('0x35')]=_['intersection'](_0x5bdaaf[_0x70ba('0x32')],_0x5bdaaf['query']);_0x1562f3[_0x70ba('0x36')]=_[_0x70ba('0x37')](_0x5bdaaf[_0x70ba('0x32')],qs[_0x70ba('0x38')](_0x576628['query'][_0x70ba('0x38')]));_0x1562f3[_0x70ba('0x36')]=_0x1562f3[_0x70ba('0x36')][_0x70ba('0x39')]?_0x1562f3[_0x70ba('0x36')]:_0x5bdaaf['model'];if(!_0x576628['query'][_0x70ba('0x3a')](_0x70ba('0x3b'))){_0x1562f3['limit']=qs[_0x70ba('0x1c')](_0x576628['query']['limit']);_0x1562f3['offset']=qs[_0x70ba('0x1a')](_0x576628[_0x70ba('0x33')][_0x70ba('0x1a')]);}_0x1562f3[_0x70ba('0x3c')]=qs[_0x70ba('0x3d')](_0x576628[_0x70ba('0x33')][_0x70ba('0x3d')]);_0x1562f3[_0x70ba('0x3e')]=qs[_0x70ba('0x35')](_[_0x70ba('0x3f')](_0x576628['query'],_0x5bdaaf['filters']),_0x5e7c79);if(_0x576628[_0x70ba('0x33')][_0x70ba('0x40')]){_0x1562f3[_0x70ba('0x3e')]=_[_0x70ba('0x41')](_0x1562f3['where'],{'$or':_[_0x70ba('0x42')](_0x5e7c79,function(_0x422d7a){if(_0x422d7a[_0x70ba('0x30')]!=='VIRTUAL'){var _0x2a6237={};_0x2a6237[_0x422d7a[_0x70ba('0x2a')]]={'$like':'%'+_0x576628[_0x70ba('0x33')][_0x70ba('0x40')]+'%'};return _0x2a6237;}})});}_0x1562f3=_[_0x70ba('0x41')]({},_0x1562f3,_0x576628[_0x70ba('0x43')]);var _0x453d0f={'where':_0x1562f3[_0x70ba('0x3e')]};return db[_0x70ba('0x2d')][_0x70ba('0x1d')](_0x453d0f)[_0x70ba('0x26')](function(_0x411f7e){_0x1e6da9[_0x70ba('0x1d')]=_0x411f7e;if(_0x576628[_0x70ba('0x33')][_0x70ba('0x44')]){_0x1562f3[_0x70ba('0x45')]=[{'all':!![]}];}return db['MailServerOut'][_0x70ba('0x46')](_0x1562f3);})[_0x70ba('0x26')](function(_0x212b7d){_0x1e6da9[_0x70ba('0x47')]=_0x212b7d;return _0x1e6da9;})['then'](respondWithFilteredResult(_0xe6ec6c,_0x1562f3))[_0x70ba('0x48')](handleError(_0xe6ec6c,null));};exports[_0x70ba('0x49')]=function(_0x4ce233,_0x1c267b){var _0x37c173={'raw':!![],'where':{'id':_0x4ce233[_0x70ba('0x4a')]['id']}},_0x2cb5f8={};_0x2cb5f8[_0x70ba('0x32')]=_['keys'](db[_0x70ba('0x2d')]['rawAttributes']);_0x2cb5f8[_0x70ba('0x33')]=_[_0x70ba('0x34')](_0x4ce233[_0x70ba('0x33')]);_0x2cb5f8['filters']=_[_0x70ba('0x37')](_0x2cb5f8['model'],_0x2cb5f8[_0x70ba('0x33')]);_0x37c173[_0x70ba('0x36')]=_[_0x70ba('0x37')](_0x2cb5f8['model'],qs[_0x70ba('0x38')](_0x4ce233['query'][_0x70ba('0x38')]));_0x37c173['attributes']=_0x37c173[_0x70ba('0x36')][_0x70ba('0x39')]?_0x37c173[_0x70ba('0x36')]:_0x2cb5f8[_0x70ba('0x32')];if(_0x4ce233[_0x70ba('0x33')]['includeAll']){_0x37c173[_0x70ba('0x45')]=[{'all':!![]}];}_0x37c173=_[_0x70ba('0x41')]({},_0x37c173,_0x4ce233['options']);return db[_0x70ba('0x2d')][_0x70ba('0x4b')](_0x37c173)[_0x70ba('0x26')](handleEntityNotFound(_0x1c267b,null))[_0x70ba('0x26')](respondWithResult(_0x1c267b,null))['catch'](handleError(_0x1c267b,null));};exports[_0x70ba('0x4c')]=function(_0xcfa2a6,_0x43e2a4){return db[_0x70ba('0x2d')][_0x70ba('0x4c')](_0xcfa2a6[_0x70ba('0x4d')],{})[_0x70ba('0x26')](respondWithResult(_0x43e2a4,0xc9))['catch'](handleError(_0x43e2a4,null));};exports[_0x70ba('0x25')]=function(_0x34be85,_0x2fec2e){if(_0x34be85[_0x70ba('0x4d')]['id']){delete _0x34be85[_0x70ba('0x4d')]['id'];}return db[_0x70ba('0x2d')][_0x70ba('0x4b')]({'where':{'id':_0x34be85[_0x70ba('0x4a')]['id']}})[_0x70ba('0x26')](handleEntityNotFound(_0x2fec2e,null))[_0x70ba('0x26')](saveUpdates(_0x34be85['body'],null))[_0x70ba('0x26')](respondWithResult(_0x2fec2e,null))[_0x70ba('0x48')](handleError(_0x2fec2e,null));};exports['destroy']=function(_0xa08368,_0x32862c){return db[_0x70ba('0x2d')][_0x70ba('0x4b')]({'where':{'id':_0xa08368[_0x70ba('0x4a')]['id']}})[_0x70ba('0x26')](handleEntityNotFound(_0x32862c,null))['then'](removeEntity(_0x32862c,null))['catch'](handleError(_0x32862c,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e443c7f..41b4822 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 _0x7aad=['exports','mail_servers_out','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x9fe470,_0x250a67){var _0x35677b=function(_0x453af2){while(--_0x453af2){_0x9fe470['push'](_0x9fe470['shift']());}};_0x35677b(++_0x250a67);}(_0x7aad,0x19c));var _0xd7aa=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7aad[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd7aa('0x0'))('api');var moment=require(_0xd7aa('0x1'));var BPromise=require(_0xd7aa('0x2'));var rp=require(_0xd7aa('0x3'));var fs=require('fs');var path=require(_0xd7aa('0x4'));var rimraf=require(_0xd7aa('0x5'));var config=require(_0xd7aa('0x6'));var attributes=require(_0xd7aa('0x7'));module[_0xd7aa('0x8')]=function(_0x57ee3c,_0x490a05){return _0x57ee3c['define']('MailServerOut',attributes,{'tableName':_0xd7aa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf566=['./mailServerOut.attributes','define','mail_servers_out','util','api','moment','bluebird','path'];(function(_0x5066e3,_0x479d00){var _0x5bc0bf=function(_0x305390){while(--_0x305390){_0x5066e3['push'](_0x5066e3['shift']());}};_0x5bc0bf(++_0x479d00);}(_0xf566,0x17b));var _0x6f56=function(_0x4e9559,_0x324346){_0x4e9559=_0x4e9559-0x0;var _0x13d630=_0xf566[_0x4e9559];return _0x13d630;};'use strict';var _=require('lodash');var util=require(_0x6f56('0x0'));var logger=require('../../config/logger')(_0x6f56('0x1'));var moment=require(_0x6f56('0x2'));var BPromise=require(_0x6f56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f56('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f56('0x5'));module['exports']=function(_0x42dd20,_0x1e77d6){return _0x42dd20[_0x6f56('0x6')]('MailServerOut',attributes,{'tableName':_0x6f56('0x7'),'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 d79bc21..32bfcb9 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1e964b,_0x91f662){var _0x29eea4=function(_0x490871){while(--_0x490871){_0x1e964b['push'](_0x1e964b['shift']());}};_0x29eea4(++_0x91f662);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x102caf,_0x363913){var _0x35a33f=function(_0x1b27e6){while(--_0x1b27e6){_0x102caf['push'](_0x102caf['shift']());}};_0x35a33f(++_0x363913);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f13a0,_0x17ab7b){_0x1f13a0=_0x1f13a0-0x0;var _0x527611=_0x2ef3[_0x1f13a0];return _0x527611;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9cdc1e7..4150fba 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 _0x418c=['get','isAuthenticated','index','describe','show','post','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailSubstatus.controller'];(function(_0x474e2b,_0x300473){var _0x5b5660=function(_0x27e3f2){while(--_0x27e3f2){_0x474e2b['push'](_0x474e2b['shift']());}};_0x5b5660(++_0x300473);}(_0x418c,0xd0));var _0xc418=function(_0x1bd2b1,_0x27a17e){_0x1bd2b1=_0x1bd2b1-0x0;var _0x3d0090=_0x418c[_0x1bd2b1];return _0x3d0090;};'use strict';var multer=require(_0xc418('0x0'));var util=require(_0xc418('0x1'));var path=require('path');var timeout=require(_0xc418('0x2'));var express=require(_0xc418('0x3'));var router=express[_0xc418('0x4')]();var fs_extra=require(_0xc418('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc418('0x6'));var controller=require(_0xc418('0x7'));router[_0xc418('0x8')]('/',auth[_0xc418('0x9')](),controller[_0xc418('0xa')]);router[_0xc418('0x8')]('/describe',auth[_0xc418('0x9')](),controller[_0xc418('0xb')]);router[_0xc418('0x8')]('/:id',auth[_0xc418('0x9')](),controller[_0xc418('0xc')]);router[_0xc418('0xd')]('/',auth[_0xc418('0x9')](),controller['create']);router[_0xc418('0xe')](_0xc418('0xf'),auth[_0xc418('0x9')](),controller['update']);router[_0xc418('0x10')](_0xc418('0xf'),auth[_0xc418('0x9')](),controller[_0xc418('0x11')]);module['exports']=router; \ No newline at end of file +var _0x26e9=['put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x4b401b,_0x465382){var _0x408616=function(_0x16fbc3){while(--_0x16fbc3){_0x4b401b['push'](_0x4b401b['shift']());}};_0x408616(++_0x465382);}(_0x26e9,0x1cf));var _0x926e=function(_0x28e96c,_0x2d75ed){_0x28e96c=_0x28e96c-0x0;var _0x1db3d5=_0x26e9[_0x28e96c];return _0x1db3d5;};'use strict';var multer=require(_0x926e('0x0'));var util=require(_0x926e('0x1'));var path=require(_0x926e('0x2'));var timeout=require(_0x926e('0x3'));var express=require(_0x926e('0x4'));var router=express['Router']();var fs_extra=require(_0x926e('0x5'));var auth=require(_0x926e('0x6'));var interaction=require(_0x926e('0x7'));var config=require(_0x926e('0x8'));var controller=require('./mailSubstatus.controller');router[_0x926e('0x9')]('/',auth[_0x926e('0xa')](),controller[_0x926e('0xb')]);router[_0x926e('0x9')](_0x926e('0xc'),auth[_0x926e('0xa')](),controller[_0x926e('0xd')]);router['get'](_0x926e('0xe'),auth[_0x926e('0xa')](),controller[_0x926e('0xf')]);router['post']('/',auth[_0x926e('0xa')](),controller[_0x926e('0x10')]);router[_0x926e('0x11')](_0x926e('0xe'),auth[_0x926e('0xa')](),controller['update']);router[_0x926e('0x12')](_0x926e('0xe'),auth[_0x926e('0xa')](),controller['destroy']);module[_0x926e('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5348568..83dc130 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 _0x71ab=['exports','name'];(function(_0x5a62e9,_0xad7487){var _0x2bf377=function(_0x49e660){while(--_0x49e660){_0x5a62e9['push'](_0x5a62e9['shift']());}};_0x2bf377(++_0xad7487);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb71a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0618=['name','STRING','sequelize','exports'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x0618,0x1c6));var _0x8061=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0618[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8061('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8061('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cc8fb3d..e45e51a 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 _0xa2bd=['where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','count','set','reject','save','update','then','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xa2bd,0x139));var _0xda2b=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xa2bd[_0x15dbca];return _0x326533;};'use strict';var emlformat=require(_0xda2b('0x0'));var rimraf=require(_0xda2b('0x1'));var zipdir=require(_0xda2b('0x2'));var jsonpatch=require(_0xda2b('0x3'));var rp=require(_0xda2b('0x4'));var moment=require(_0xda2b('0x5'));var BPromise=require(_0xda2b('0x6'));var Mustache=require(_0xda2b('0x7'));var util=require('util');var path=require(_0xda2b('0x8'));var sox=require(_0xda2b('0x9'));var csv=require(_0xda2b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda2b('0xb'));var _=require(_0xda2b('0xc'));var squel=require(_0xda2b('0xd'));var crypto=require(_0xda2b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda2b('0xf'));var toCsv=require(_0xda2b('0xa'));var querystring=require(_0xda2b('0x10'));var Papa=require(_0xda2b('0x11'));var Redis=require('ioredis');var authService=require(_0xda2b('0x12'));var qs=require(_0xda2b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda2b('0x14'))(_0xda2b('0x15'));var utils=require(_0xda2b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda2b('0x17'));var db=require(_0xda2b('0x18'))['db'];function respondWithStatusCode(_0x2aa2ec,_0x32ffeb){_0x32ffeb=_0x32ffeb||0xcc;return function(_0x312955){if(_0x312955){return _0x2aa2ec['sendStatus'](_0x32ffeb);}return _0x2aa2ec[_0xda2b('0x19')](_0x32ffeb)[_0xda2b('0x1a')]();};}function respondWithResult(_0x2586cd,_0xaeed0d){_0xaeed0d=_0xaeed0d||0xc8;return function(_0x4c68ba){if(_0x4c68ba){return _0x2586cd[_0xda2b('0x19')](_0xaeed0d)[_0xda2b('0x1b')](_0x4c68ba);}};}function respondWithFilteredResult(_0x4ef8f5,_0x2b8d2d){return function(_0x474af5){if(_0x474af5){var _0x2e357a=typeof _0x2b8d2d['offset']==='undefined'&&typeof _0x2b8d2d[_0xda2b('0x1c')]===_0xda2b('0x1d');var _0x22c35e=_0x474af5['count'];var _0x3397c0=_0x2e357a?0x0:_0x2b8d2d[_0xda2b('0x1e')];var _0x31b61d=_0x2e357a?_0x474af5[_0xda2b('0x1f')]:_0x2b8d2d[_0xda2b('0x1e')]+_0x2b8d2d[_0xda2b('0x1c')];var _0x205bc8;if(_0x31b61d>=_0x22c35e){_0x31b61d=_0x22c35e;_0x205bc8=0xc8;}else{_0x205bc8=0xce;}_0x4ef8f5['status'](_0x205bc8);return _0x4ef8f5[_0xda2b('0x20')]('Content-Range',_0x3397c0+'-'+_0x31b61d+'/'+_0x22c35e)['json'](_0x474af5);}return null;};}function patchUpdates(_0x5c617c){return function(_0x58c94a){try{jsonpatch['apply'](_0x58c94a,_0x5c617c,!![]);}catch(_0x4d2228){return BPromise[_0xda2b('0x21')](_0x4d2228);}return _0x58c94a[_0xda2b('0x22')]();};}function saveUpdates(_0xfcac3e,_0x1ab207){return function(_0x29bba9){if(_0x29bba9){return _0x29bba9[_0xda2b('0x23')](_0xfcac3e)[_0xda2b('0x24')](function(_0x1af308){return _0x1af308;});}return null;};}function removeEntity(_0x95f25e,_0x4d246f){return function(_0x39ab4c){if(_0x39ab4c){return _0x39ab4c['destroy']()[_0xda2b('0x24')](function(){_0x95f25e[_0xda2b('0x19')](0xcc)[_0xda2b('0x1a')]();});}};}function handleEntityNotFound(_0x4704a2,_0x266917){return function(_0x27c6ad){if(!_0x27c6ad){_0x4704a2['sendStatus'](0x194);}return _0x27c6ad;};}function handleError(_0xaf3148,_0x2293c5){_0x2293c5=_0x2293c5||0x1f4;return function(_0x4925d6){logger['error'](_0x4925d6['stack']);if(_0x4925d6[_0xda2b('0x25')]){delete _0x4925d6[_0xda2b('0x25')];}_0xaf3148[_0xda2b('0x19')](_0x2293c5)[_0xda2b('0x26')](_0x4925d6);};}exports['index']=function(_0x2644a3,_0x59b610){var _0x3a81f9={},_0x37e1ef={},_0x3fbc9d={'count':0x0,'rows':[]};var _0x1a7d7e=_[_0xda2b('0x27')](db[_0xda2b('0x28')][_0xda2b('0x29')],function(_0x45c52b){return{'name':_0x45c52b[_0xda2b('0x2a')],'type':_0x45c52b[_0xda2b('0x2b')][_0xda2b('0x2c')]};});_0x37e1ef[_0xda2b('0x2d')]=_[_0xda2b('0x27')](_0x1a7d7e,_0xda2b('0x25'));_0x37e1ef[_0xda2b('0x2e')]=_[_0xda2b('0x2f')](_0x2644a3[_0xda2b('0x2e')]);_0x37e1ef[_0xda2b('0x30')]=_[_0xda2b('0x31')](_0x37e1ef[_0xda2b('0x2d')],_0x37e1ef['query']);_0x3a81f9[_0xda2b('0x32')]=_[_0xda2b('0x31')](_0x37e1ef[_0xda2b('0x2d')],qs[_0xda2b('0x33')](_0x2644a3['query']['fields']));_0x3a81f9[_0xda2b('0x32')]=_0x3a81f9[_0xda2b('0x32')][_0xda2b('0x34')]?_0x3a81f9[_0xda2b('0x32')]:_0x37e1ef[_0xda2b('0x2d')];if(!_0x2644a3[_0xda2b('0x2e')][_0xda2b('0x35')](_0xda2b('0x36'))){_0x3a81f9[_0xda2b('0x1c')]=qs[_0xda2b('0x1c')](_0x2644a3[_0xda2b('0x2e')]['limit']);_0x3a81f9[_0xda2b('0x1e')]=qs[_0xda2b('0x1e')](_0x2644a3[_0xda2b('0x2e')]['offset']);}_0x3a81f9[_0xda2b('0x37')]=qs[_0xda2b('0x38')](_0x2644a3[_0xda2b('0x2e')][_0xda2b('0x38')]);_0x3a81f9[_0xda2b('0x39')]=qs[_0xda2b('0x30')](_[_0xda2b('0x3a')](_0x2644a3[_0xda2b('0x2e')],_0x37e1ef[_0xda2b('0x30')]),_0x1a7d7e);if(_0x2644a3[_0xda2b('0x2e')][_0xda2b('0x3b')]){_0x3a81f9['where']=_[_0xda2b('0x3c')](_0x3a81f9[_0xda2b('0x39')],{'$or':_[_0xda2b('0x27')](_0x1a7d7e,function(_0xeadf76){if(_0xeadf76[_0xda2b('0x2b')]!=='VIRTUAL'){var _0x5c9eab={};_0x5c9eab[_0xeadf76['name']]={'$like':'%'+_0x2644a3[_0xda2b('0x2e')]['filter']+'%'};return _0x5c9eab;}})});}_0x3a81f9=_['merge']({},_0x3a81f9,_0x2644a3[_0xda2b('0x3d')]);var _0xfcb003={'where':_0x3a81f9['where']};return db[_0xda2b('0x28')]['count'](_0xfcb003)[_0xda2b('0x24')](function(_0x53f795){_0x3fbc9d[_0xda2b('0x1f')]=_0x53f795;if(_0x2644a3['query'][_0xda2b('0x3e')]){_0x3a81f9[_0xda2b('0x3f')]=[{'all':!![]}];}return db[_0xda2b('0x28')][_0xda2b('0x40')](_0x3a81f9);})[_0xda2b('0x24')](function(_0x73ef4c){_0x3fbc9d[_0xda2b('0x41')]=_0x73ef4c;return _0x3fbc9d;})['then'](respondWithFilteredResult(_0x59b610,_0x3a81f9))[_0xda2b('0x42')](handleError(_0x59b610,null));};exports[_0xda2b('0x43')]=function(_0x2c2a78,_0x2f527d){var _0x274c41={'raw':!![],'where':{'id':_0x2c2a78['params']['id']}},_0x4ada7a={};_0x4ada7a[_0xda2b('0x2d')]=_[_0xda2b('0x2f')](db[_0xda2b('0x28')]['rawAttributes']);_0x4ada7a[_0xda2b('0x2e')]=_['keys'](_0x2c2a78[_0xda2b('0x2e')]);_0x4ada7a[_0xda2b('0x30')]=_['intersection'](_0x4ada7a[_0xda2b('0x2d')],_0x4ada7a[_0xda2b('0x2e')]);_0x274c41[_0xda2b('0x32')]=_['intersection'](_0x4ada7a[_0xda2b('0x2d')],qs[_0xda2b('0x33')](_0x2c2a78[_0xda2b('0x2e')][_0xda2b('0x33')]));_0x274c41[_0xda2b('0x32')]=_0x274c41[_0xda2b('0x32')][_0xda2b('0x34')]?_0x274c41[_0xda2b('0x32')]:_0x4ada7a[_0xda2b('0x2d')];if(_0x2c2a78[_0xda2b('0x2e')][_0xda2b('0x3e')]){_0x274c41[_0xda2b('0x3f')]=[{'all':!![]}];}_0x274c41=_[_0xda2b('0x3c')]({},_0x274c41,_0x2c2a78['options']);return db[_0xda2b('0x28')][_0xda2b('0x44')](_0x274c41)[_0xda2b('0x24')](handleEntityNotFound(_0x2f527d,null))[_0xda2b('0x24')](respondWithResult(_0x2f527d,null))[_0xda2b('0x42')](handleError(_0x2f527d,null));};exports[_0xda2b('0x45')]=function(_0x65882a,_0x11c6f7){return db['MailSubstatus'][_0xda2b('0x45')](_0x65882a[_0xda2b('0x46')],{})[_0xda2b('0x24')](respondWithResult(_0x11c6f7,0xc9))[_0xda2b('0x42')](handleError(_0x11c6f7,null));};exports[_0xda2b('0x23')]=function(_0x5386ac,_0x40a81d){if(_0x5386ac[_0xda2b('0x46')]['id']){delete _0x5386ac[_0xda2b('0x46')]['id'];}return db[_0xda2b('0x28')][_0xda2b('0x44')]({'where':{'id':_0x5386ac['params']['id']}})['then'](handleEntityNotFound(_0x40a81d,null))[_0xda2b('0x24')](saveUpdates(_0x5386ac['body'],null))['then'](respondWithResult(_0x40a81d,null))[_0xda2b('0x42')](handleError(_0x40a81d,null));};exports[_0xda2b('0x47')]=function(_0xb912af,_0x5e6007){return db[_0xda2b('0x28')]['find']({'where':{'id':_0xb912af[_0xda2b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e6007,null))[_0xda2b('0x24')](removeEntity(_0x5e6007,null))[_0xda2b('0x42')](handleError(_0x5e6007,null));};exports[_0xda2b('0x49')]=function(_0x3c5502,_0x1a2d07){return db[_0xda2b('0x28')][_0xda2b('0x49')]()[_0xda2b('0x24')](respondWithResult(_0x1a2d07,null))[_0xda2b('0x42')](handleError(_0x1a2d07,null));}; \ No newline at end of file +var _0x7222=['VIRTUAL','merge','options','findAll','then','rows','catch','show','params','intersection','includeAll','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7222,0xf8));var _0x2722=function(_0x9844c2,_0x4a6e0a){_0x9844c2=_0x9844c2-0x0;var _0x425407=_0x7222[_0x9844c2];return _0x425407;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2722('0x0'));var zipdir=require(_0x2722('0x1'));var jsonpatch=require(_0x2722('0x2'));var rp=require('request-promise');var moment=require(_0x2722('0x3'));var BPromise=require(_0x2722('0x4'));var Mustache=require(_0x2722('0x5'));var util=require(_0x2722('0x6'));var path=require('path');var sox=require(_0x2722('0x7'));var csv=require(_0x2722('0x8'));var ejs=require(_0x2722('0x9'));var fs=require('fs');var fs_extra=require(_0x2722('0xa'));var _=require(_0x2722('0xb'));var squel=require(_0x2722('0xc'));var crypto=require(_0x2722('0xd'));var jsforce=require(_0x2722('0xe'));var deskjs=require(_0x2722('0xf'));var toCsv=require(_0x2722('0x8'));var querystring=require(_0x2722('0x10'));var Papa=require('papaparse');var Redis=require(_0x2722('0x11'));var authService=require(_0x2722('0x12'));var qs=require(_0x2722('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2722('0x14'));var logger=require(_0x2722('0x15'))(_0x2722('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2722('0x17'))['db'];function respondWithStatusCode(_0x5bac95,_0x256015){_0x256015=_0x256015||0xcc;return function(_0x2ea387){if(_0x2ea387){return _0x5bac95[_0x2722('0x18')](_0x256015);}return _0x5bac95[_0x2722('0x19')](_0x256015)[_0x2722('0x1a')]();};}function respondWithResult(_0xc60783,_0xc09699){_0xc09699=_0xc09699||0xc8;return function(_0x2a224c){if(_0x2a224c){return _0xc60783[_0x2722('0x19')](_0xc09699)['json'](_0x2a224c);}};}function respondWithFilteredResult(_0x16ee7c,_0x2c5456){return function(_0x5ea7cd){if(_0x5ea7cd){var _0x506aa3=typeof _0x2c5456[_0x2722('0x1b')]===_0x2722('0x1c')&&typeof _0x2c5456[_0x2722('0x1d')]===_0x2722('0x1c');var _0x33fca6=_0x5ea7cd['count'];var _0x1651b0=_0x506aa3?0x0:_0x2c5456[_0x2722('0x1b')];var _0x384250=_0x506aa3?_0x5ea7cd[_0x2722('0x1e')]:_0x2c5456[_0x2722('0x1b')]+_0x2c5456[_0x2722('0x1d')];var _0x3a69fb;if(_0x384250>=_0x33fca6){_0x384250=_0x33fca6;_0x3a69fb=0xc8;}else{_0x3a69fb=0xce;}_0x16ee7c[_0x2722('0x19')](_0x3a69fb);return _0x16ee7c['set'](_0x2722('0x1f'),_0x1651b0+'-'+_0x384250+'/'+_0x33fca6)[_0x2722('0x20')](_0x5ea7cd);}return null;};}function patchUpdates(_0x1abf7f){return function(_0x3c85b3){try{jsonpatch[_0x2722('0x21')](_0x3c85b3,_0x1abf7f,!![]);}catch(_0x2c420c){return BPromise[_0x2722('0x22')](_0x2c420c);}return _0x3c85b3[_0x2722('0x23')]();};}function saveUpdates(_0x5b80cb,_0x13d4e8){return function(_0x1424ec){if(_0x1424ec){return _0x1424ec[_0x2722('0x24')](_0x5b80cb)['then'](function(_0x1753fb){return _0x1753fb;});}return null;};}function removeEntity(_0x2865e0,_0x396f8c){return function(_0x551158){if(_0x551158){return _0x551158['destroy']()['then'](function(){_0x2865e0[_0x2722('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21aadc,_0x436e9a){return function(_0x526b87){if(!_0x526b87){_0x21aadc['sendStatus'](0x194);}return _0x526b87;};}function handleError(_0x591189,_0x363525){_0x363525=_0x363525||0x1f4;return function(_0x3a5cef){logger[_0x2722('0x25')](_0x3a5cef['stack']);if(_0x3a5cef[_0x2722('0x26')]){delete _0x3a5cef['name'];}_0x591189[_0x2722('0x19')](_0x363525)[_0x2722('0x27')](_0x3a5cef);};}exports[_0x2722('0x28')]=function(_0x368c45,_0x139c23){var _0x5f8806={},_0x55c512={},_0xd5fcbc={'count':0x0,'rows':[]};var _0x394962=_[_0x2722('0x29')](db[_0x2722('0x2a')][_0x2722('0x2b')],function(_0x3b9be3){return{'name':_0x3b9be3[_0x2722('0x2c')],'type':_0x3b9be3[_0x2722('0x2d')][_0x2722('0x2e')]};});_0x55c512[_0x2722('0x2f')]=_[_0x2722('0x29')](_0x394962,_0x2722('0x26'));_0x55c512[_0x2722('0x30')]=_[_0x2722('0x31')](_0x368c45[_0x2722('0x30')]);_0x55c512[_0x2722('0x32')]=_['intersection'](_0x55c512[_0x2722('0x2f')],_0x55c512[_0x2722('0x30')]);_0x5f8806[_0x2722('0x33')]=_['intersection'](_0x55c512['model'],qs[_0x2722('0x34')](_0x368c45[_0x2722('0x30')][_0x2722('0x34')]));_0x5f8806[_0x2722('0x33')]=_0x5f8806[_0x2722('0x33')][_0x2722('0x35')]?_0x5f8806[_0x2722('0x33')]:_0x55c512['model'];if(!_0x368c45[_0x2722('0x30')][_0x2722('0x36')](_0x2722('0x37'))){_0x5f8806[_0x2722('0x1d')]=qs['limit'](_0x368c45[_0x2722('0x30')]['limit']);_0x5f8806[_0x2722('0x1b')]=qs[_0x2722('0x1b')](_0x368c45['query'][_0x2722('0x1b')]);}_0x5f8806['order']=qs['sort'](_0x368c45[_0x2722('0x30')][_0x2722('0x38')]);_0x5f8806[_0x2722('0x39')]=qs[_0x2722('0x32')](_[_0x2722('0x3a')](_0x368c45['query'],_0x55c512['filters']),_0x394962);if(_0x368c45[_0x2722('0x30')][_0x2722('0x3b')]){_0x5f8806[_0x2722('0x39')]=_['merge'](_0x5f8806[_0x2722('0x39')],{'$or':_['map'](_0x394962,function(_0x41d0b5){if(_0x41d0b5[_0x2722('0x2d')]!==_0x2722('0x3c')){var _0x557503={};_0x557503[_0x41d0b5[_0x2722('0x26')]]={'$like':'%'+_0x368c45[_0x2722('0x30')][_0x2722('0x3b')]+'%'};return _0x557503;}})});}_0x5f8806=_[_0x2722('0x3d')]({},_0x5f8806,_0x368c45[_0x2722('0x3e')]);var _0x520c70={'where':_0x5f8806[_0x2722('0x39')]};return db['MailSubstatus'][_0x2722('0x1e')](_0x520c70)['then'](function(_0x50283a){_0xd5fcbc[_0x2722('0x1e')]=_0x50283a;if(_0x368c45[_0x2722('0x30')]['includeAll']){_0x5f8806['include']=[{'all':!![]}];}return db[_0x2722('0x2a')][_0x2722('0x3f')](_0x5f8806);})[_0x2722('0x40')](function(_0x3f93a5){_0xd5fcbc[_0x2722('0x41')]=_0x3f93a5;return _0xd5fcbc;})[_0x2722('0x40')](respondWithFilteredResult(_0x139c23,_0x5f8806))[_0x2722('0x42')](handleError(_0x139c23,null));};exports[_0x2722('0x43')]=function(_0x28bf35,_0x5b7a00){var _0x1d26bf={'raw':!![],'where':{'id':_0x28bf35[_0x2722('0x44')]['id']}},_0x1c1c13={};_0x1c1c13[_0x2722('0x2f')]=_[_0x2722('0x31')](db[_0x2722('0x2a')][_0x2722('0x2b')]);_0x1c1c13[_0x2722('0x30')]=_[_0x2722('0x31')](_0x28bf35[_0x2722('0x30')]);_0x1c1c13[_0x2722('0x32')]=_[_0x2722('0x45')](_0x1c1c13['model'],_0x1c1c13[_0x2722('0x30')]);_0x1d26bf[_0x2722('0x33')]=_[_0x2722('0x45')](_0x1c1c13['model'],qs[_0x2722('0x34')](_0x28bf35[_0x2722('0x30')][_0x2722('0x34')]));_0x1d26bf[_0x2722('0x33')]=_0x1d26bf[_0x2722('0x33')]['length']?_0x1d26bf[_0x2722('0x33')]:_0x1c1c13[_0x2722('0x2f')];if(_0x28bf35[_0x2722('0x30')][_0x2722('0x46')]){_0x1d26bf[_0x2722('0x47')]=[{'all':!![]}];}_0x1d26bf=_['merge']({},_0x1d26bf,_0x28bf35[_0x2722('0x3e')]);return db[_0x2722('0x2a')][_0x2722('0x48')](_0x1d26bf)[_0x2722('0x40')](handleEntityNotFound(_0x5b7a00,null))[_0x2722('0x40')](respondWithResult(_0x5b7a00,null))['catch'](handleError(_0x5b7a00,null));};exports['create']=function(_0x3194aa,_0x40c647){return db['MailSubstatus'][_0x2722('0x49')](_0x3194aa[_0x2722('0x4a')],{})[_0x2722('0x40')](respondWithResult(_0x40c647,0xc9))['catch'](handleError(_0x40c647,null));};exports[_0x2722('0x24')]=function(_0x3eff72,_0x4d54e8){if(_0x3eff72['body']['id']){delete _0x3eff72[_0x2722('0x4a')]['id'];}return db[_0x2722('0x2a')][_0x2722('0x48')]({'where':{'id':_0x3eff72['params']['id']}})[_0x2722('0x40')](handleEntityNotFound(_0x4d54e8,null))[_0x2722('0x40')](saveUpdates(_0x3eff72[_0x2722('0x4a')],null))[_0x2722('0x40')](respondWithResult(_0x4d54e8,null))[_0x2722('0x42')](handleError(_0x4d54e8,null));};exports[_0x2722('0x4b')]=function(_0x12a5ae,_0x224558){return db['MailSubstatus'][_0x2722('0x48')]({'where':{'id':_0x12a5ae[_0x2722('0x44')]['id']}})['then'](handleEntityNotFound(_0x224558,null))[_0x2722('0x40')](removeEntity(_0x224558,null))['catch'](handleError(_0x224558,null));};exports[_0x2722('0x4c')]=function(_0xc52594,_0x1833f5){return db[_0x2722('0x2a')][_0x2722('0x4c')]()['then'](respondWithResult(_0x1833f5,null))[_0x2722('0x42')](handleError(_0x1833f5,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 8c7ea66..3f8c993 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 _0x86ce=['emit','hasOwnProperty','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x3377be,_0x526eca){var _0x4f6456=function(_0x1af2ed){while(--_0x1af2ed){_0x3377be['push'](_0x3377be['shift']());}};_0x4f6456(++_0x526eca);}(_0x86ce,0x14c));var _0xe86c=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0x86ce[_0x45c61e];return _0x19033c;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xe86c('0x0'))['db'][_0xe86c('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe86c('0x2')](0x0);var events={'afterUpdate':_0xe86c('0x3')};function emitEvent(_0x2c6ba5){return function(_0x5527cd,_0x3461cd,_0x468a06){MailSubstatusEvents[_0xe86c('0x4')](_0x2c6ba5+':'+_0x5527cd['id'],_0x5527cd);MailSubstatusEvents[_0xe86c('0x4')](_0x2c6ba5,_0x5527cd);_0x468a06(null);};}for(var e in events){if(events[_0xe86c('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x772a=['hook','exports','events','../../mysqldb','MailSubstatus','update','emit'];(function(_0x5482f4,_0x150cac){var _0x42d1ec=function(_0x2d3af5){while(--_0x2d3af5){_0x5482f4['push'](_0x5482f4['shift']());}};_0x42d1ec(++_0x150cac);}(_0x772a,0x1ad));var _0xa772=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x772a[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0xa772('0x0'));var MailSubstatus=require(_0xa772('0x1'))['db'][_0xa772('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xa772('0x3')};function emitEvent(_0x44041d){return function(_0x1a759d,_0x2b8fad,_0x20f34c){MailSubstatusEvents[_0xa772('0x4')](_0x44041d+':'+_0x1a759d['id'],_0x1a759d);MailSubstatusEvents[_0xa772('0x4')](_0x44041d,_0x1a759d);_0x20f34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xa772('0x5')](e,emitEvent(event));}}module[_0xa772('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 677cd40..7e14291 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 _0x4b3c=['MailSubstatus','update','name','_previousDataValues','catch','exports','define'];(function(_0x16326f,_0x51577c){var _0x19452c=function(_0x534ba2){while(--_0x534ba2){_0x16326f['push'](_0x16326f['shift']());}};_0x19452c(++_0x51577c);}(_0x4b3c,0x1cc));var _0xc4b3=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x4b3c[_0x20a590];return _0x2e1b41;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xc4b3('0x0')]=function(_0x3cfb4e){var _0x170006=_0x3cfb4e['models'];return _0x3cfb4e[_0xc4b3('0x1')](_0xc4b3('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x59ffb5,_0x4ec123,_0x4ef5db){return _0x170006['Condition'][_0xc4b3('0x3')]({'value':_0x59ffb5[_0xc4b3('0x4')]},{'where':{'field':'mailSubstatus','value':_0x59ffb5[_0xc4b3('0x5')]['name']}})['then'](function(){_0x4ef5db();})[_0xc4b3('0x6')](function(_0x355cea){_0x4ef5db(_0x355cea);});}}});}; \ No newline at end of file +var _0x6d3d=['update','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition'];(function(_0x1c80b4,_0x183d93){var _0x2bcc18=function(_0x38ed31){while(--_0x38ed31){_0x1c80b4['push'](_0x1c80b4['shift']());}};_0x2bcc18(++_0x183d93);}(_0x6d3d,0x12e));var _0xd6d3=function(_0x2dd65,_0x5bc866){_0x2dd65=_0x2dd65-0x0;var _0x3a13fa=_0x6d3d[_0x2dd65];return _0x3a13fa;};'use strict';var attributes=require(_0xd6d3('0x0'));module[_0xd6d3('0x1')]=function(_0x10fa0f){var _0x48fc26=_0x10fa0f[_0xd6d3('0x2')];return _0x10fa0f['define'](_0xd6d3('0x3'),attributes,{'tableName':_0xd6d3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3c087b,_0x198c01,_0x16ff79){return _0x48fc26[_0xd6d3('0x5')][_0xd6d3('0x6')]({'value':_0x3c087b['name']},{'where':{'field':_0xd6d3('0x7'),'value':_0x3c087b[_0xd6d3('0x8')]['name']}})[_0xd6d3('0x9')](function(){_0x16ff79();})[_0xd6d3('0xa')](function(_0x420833){_0x16ff79(_0x420833);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 672fad4..890d45f 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 _0x87de=['rpc','../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x829d5d,_0x520c80){var _0x13df56=function(_0x1acdb4){while(--_0x1acdb4){_0x829d5d['push'](_0x829d5d['shift']());}};_0x13df56(++_0x520c80);}(_0x87de,0x67));var _0xe87d=function(_0x3af280,_0x5a192a){_0x3af280=_0x3af280-0x0;var _0x156013=_0x87de[_0x3af280];return _0x156013;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87d('0x0'));var BPromise=require(_0xe87d('0x1'));var rs=require(_0xe87d('0x2'));var fs=require('fs');var Redis=require(_0xe87d('0x3'));var db=require(_0xe87d('0x4'))['db'];var utils=require(_0xe87d('0x5'));var logger=require(_0xe87d('0x6'))(_0xe87d('0x7'));var config=require(_0xe87d('0x8'));var jayson=require(_0xe87d('0x9'));var client=jayson[_0xe87d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6dbb0c,_0xa1276b,_0x171420){return new BPromise(function(_0x588076,_0x37ca14){return client[_0xe87d('0xb')](_0x6dbb0c,_0x171420)['then'](function(_0x2f8b43){logger['info'](_0xe87d('0xc'),_0xa1276b,'request\x20sent');logger[_0xe87d('0xd')](_0xe87d('0xe'),_0xa1276b,_0xe87d('0xf'),JSON[_0xe87d('0x10')](_0x2f8b43));if(_0x2f8b43[_0xe87d('0x11')]){if(_0x2f8b43[_0xe87d('0x11')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0xa1276b,_0x2f8b43[_0xe87d('0x11')][_0xe87d('0x12')]);return _0x37ca14(_0x2f8b43[_0xe87d('0x11')][_0xe87d('0x12')]);}logger[_0xe87d('0x11')](_0xe87d('0xc'),_0xa1276b,_0x2f8b43[_0xe87d('0x11')][_0xe87d('0x12')]);return _0x588076(_0x2f8b43['error'][_0xe87d('0x12')]);}else{logger[_0xe87d('0x13')](_0xe87d('0xc'),_0xa1276b,_0xe87d('0xf'));_0x588076(_0x2f8b43[_0xe87d('0x14')]['message']);}})[_0xe87d('0x15')](function(_0x30df1f){logger[_0xe87d('0x11')]('MailSubstatus,\x20%s,\x20%s',_0xa1276b,_0x30df1f);_0x37ca14(_0x30df1f);});});} \ No newline at end of file +var _0x048c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x048c,0xc4));var _0xc048=function(_0x150652,_0x42adff){_0x150652=_0x150652-0x0;var _0x13a5c5=_0x048c[_0x150652];return _0x13a5c5;};'use strict';var _=require(_0xc048('0x0'));var util=require(_0xc048('0x1'));var moment=require(_0xc048('0x2'));var BPromise=require(_0xc048('0x3'));var rs=require(_0xc048('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc048('0x5'))['db'];var utils=require(_0xc048('0x6'));var logger=require(_0xc048('0x7'))(_0xc048('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc048('0x9')][_0xc048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d6e5,_0x30377b,_0x400714){return new BPromise(function(_0x46eed0,_0x548bf9){return client[_0xc048('0xb')](_0x55d6e5,_0x400714)['then'](function(_0x414b50){logger['info'](_0xc048('0xc'),_0x30377b,'request\x20sent');logger[_0xc048('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x30377b,_0xc048('0xe'),JSON[_0xc048('0xf')](_0x414b50));if(_0x414b50[_0xc048('0x10')]){if(_0x414b50[_0xc048('0x10')][_0xc048('0x11')]===0x1f4){logger[_0xc048('0x10')](_0xc048('0xc'),_0x30377b,_0x414b50[_0xc048('0x10')]['message']);return _0x548bf9(_0x414b50[_0xc048('0x10')][_0xc048('0x12')]);}logger[_0xc048('0x10')](_0xc048('0xc'),_0x30377b,_0x414b50[_0xc048('0x10')][_0xc048('0x12')]);return _0x46eed0(_0x414b50['error'][_0xc048('0x12')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x30377b,_0xc048('0xe'));_0x46eed0(_0x414b50[_0xc048('0x13')][_0xc048('0x12')]);}})['catch'](function(_0xee157){logger[_0xc048('0x10')](_0xc048('0xc'),_0x30377b,_0xee157);_0x548bf9(_0xee157);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d6b7506..64b4a2b 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 _0x60dc=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xd60c11,_0x401372){var _0x2c139b=function(_0x5f512a){while(--_0x5f512a){_0xd60c11['push'](_0xd60c11['shift']());}};_0x2c139b(++_0x401372);}(_0x60dc,0x163));var _0xc60d=function(_0x4b9a9e,_0x55c8b2){_0x4b9a9e=_0x4b9a9e-0x0;var _0x3c9e82=_0x60dc[_0x4b9a9e];return _0x3c9e82;};'use strict';var multer=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var path=require(_0xc60d('0x2'));var timeout=require(_0xc60d('0x3'));var express=require(_0xc60d('0x4'));var router=express['Router']();var fs_extra=require(_0xc60d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc60d('0x6'));var config=require(_0xc60d('0x7'));var controller=require(_0xc60d('0x8'));router[_0xc60d('0x9')]('/',auth[_0xc60d('0xa')](),controller['index']);router[_0xc60d('0x9')](_0xc60d('0xb'),auth[_0xc60d('0xa')](),controller['describe']);router[_0xc60d('0x9')](_0xc60d('0xc'),auth[_0xc60d('0xa')](),controller[_0xc60d('0xd')]);router[_0xc60d('0xe')]('/',auth['isAuthenticated'](),controller[_0xc60d('0xf')]);router[_0xc60d('0x10')]('/:id',auth[_0xc60d('0xa')](),controller[_0xc60d('0x11')]);router[_0xc60d('0x12')](_0xc60d('0xc'),auth['isAuthenticated'](),controller[_0xc60d('0x13')]);module[_0xc60d('0x14')]=router; \ No newline at end of file +var _0x1c06=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete'];(function(_0x4decbe,_0x1309b6){var _0x1eedef=function(_0x396fe3){while(--_0x396fe3){_0x4decbe['push'](_0x4decbe['shift']());}};_0x1eedef(++_0x1309b6);}(_0x1c06,0x18e));var _0x61c0=function(_0x2ffee8,_0x126cdd){_0x2ffee8=_0x2ffee8-0x0;var _0x432ebf=_0x1c06[_0x2ffee8];return _0x432ebf;};'use strict';var multer=require(_0x61c0('0x0'));var util=require(_0x61c0('0x1'));var path=require(_0x61c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x61c0('0x3'));var router=express[_0x61c0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x61c0('0x5'));var interaction=require(_0x61c0('0x6'));var config=require(_0x61c0('0x7'));var controller=require(_0x61c0('0x8'));router[_0x61c0('0x9')]('/',auth[_0x61c0('0xa')](),controller[_0x61c0('0xb')]);router[_0x61c0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x61c0('0xc')]);router[_0x61c0('0x9')]('/:id',auth[_0x61c0('0xa')](),controller[_0x61c0('0xd')]);router[_0x61c0('0xe')]('/',auth[_0x61c0('0xa')](),controller[_0x61c0('0xf')]);router[_0x61c0('0x10')](_0x61c0('0x11'),auth[_0x61c0('0xa')](),controller[_0x61c0('0x12')]);router[_0x61c0('0x13')](_0x61c0('0x11'),auth[_0x61c0('0xa')](),controller[_0x61c0('0x14')]);module[_0x61c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index f3e8db3..95d82df 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3ff948,_0x2e5201){_0x3ff948=_0x3ff948-0x0;var _0x497ed0=_0xb43b[_0x3ff948];return _0x497ed0;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x11a4dc,_0x12e672){var _0x3c3f26=function(_0x48ccc7){while(--_0x48ccc7){_0x11a4dc['push'](_0x11a4dc['shift']());}};_0x3c3f26(++_0x12e672);}(_0xedd9,0xfc));var _0x9edd=function(_0x3093fd,_0x22a601){_0x3093fd=_0x3093fd-0x0;var _0x490262=_0xedd9[_0x3093fd];return _0x490262;};'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 675870c..ed511a1 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 _0x85f4=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','MailTransferReport','includeAll','include','findAll','show','params','length','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x365371,_0x2dbe84){var _0x4c07e0=function(_0x3ada37){while(--_0x3ada37){_0x365371['push'](_0x365371['shift']());}};_0x4c07e0(++_0x2dbe84);}(_0x85f4,0x165));var _0x485f=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x85f4[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require(_0x485f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x485f('0x1'));var jsonpatch=require(_0x485f('0x2'));var rp=require(_0x485f('0x3'));var moment=require(_0x485f('0x4'));var BPromise=require(_0x485f('0x5'));var Mustache=require(_0x485f('0x6'));var util=require(_0x485f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x485f('0x8'));var ejs=require(_0x485f('0x9'));var fs=require('fs');var fs_extra=require(_0x485f('0xa'));var _=require(_0x485f('0xb'));var squel=require('squel');var crypto=require(_0x485f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x485f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x485f('0xe'));var Papa=require(_0x485f('0xf'));var Redis=require(_0x485f('0x10'));var authService=require(_0x485f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x485f('0x12'));var hardwareService=require(_0x485f('0x13'));var logger=require(_0x485f('0x14'))('api');var utils=require(_0x485f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x485f('0x16'));var db=require(_0x485f('0x17'))['db'];function respondWithStatusCode(_0x4a484b,_0x52bd88){_0x52bd88=_0x52bd88||0xcc;return function(_0x5ed167){if(_0x5ed167){return _0x4a484b[_0x485f('0x18')](_0x52bd88);}return _0x4a484b[_0x485f('0x19')](_0x52bd88)[_0x485f('0x1a')]();};}function respondWithResult(_0x20db4f,_0x137ef6){_0x137ef6=_0x137ef6||0xc8;return function(_0x106636){if(_0x106636){return _0x20db4f['status'](_0x137ef6)['json'](_0x106636);}};}function respondWithFilteredResult(_0x4a76fc,_0x4c7979){return function(_0x174d35){if(_0x174d35){var _0xa16be7=typeof _0x4c7979['offset']===_0x485f('0x1b')&&typeof _0x4c7979['limit']===_0x485f('0x1b');var _0x1fac4d=_0x174d35[_0x485f('0x1c')];var _0x433753=_0xa16be7?0x0:_0x4c7979['offset'];var _0x3feeed=_0xa16be7?_0x174d35['count']:_0x4c7979[_0x485f('0x1d')]+_0x4c7979[_0x485f('0x1e')];var _0x4b5cda;if(_0x3feeed>=_0x1fac4d){_0x3feeed=_0x1fac4d;_0x4b5cda=0xc8;}else{_0x4b5cda=0xce;}_0x4a76fc[_0x485f('0x19')](_0x4b5cda);return _0x4a76fc[_0x485f('0x1f')](_0x485f('0x20'),_0x433753+'-'+_0x3feeed+'/'+_0x1fac4d)['json'](_0x174d35);}return null;};}function patchUpdates(_0x4d1ca5){return function(_0x14058d){try{jsonpatch[_0x485f('0x21')](_0x14058d,_0x4d1ca5,!![]);}catch(_0x2f910d){return BPromise['reject'](_0x2f910d);}return _0x14058d[_0x485f('0x22')]();};}function saveUpdates(_0x40a23e,_0x18e89d){return function(_0x5999fe){if(_0x5999fe){return _0x5999fe[_0x485f('0x23')](_0x40a23e)[_0x485f('0x24')](function(_0xb89298){return _0xb89298;});}return null;};}function removeEntity(_0x3e0ead,_0x1c50e1){return function(_0x47536a){if(_0x47536a){return _0x47536a[_0x485f('0x25')]()['then'](function(){_0x3e0ead[_0x485f('0x19')](0xcc)[_0x485f('0x1a')]();});}};}function handleEntityNotFound(_0x23ab0c,_0x2b6455){return function(_0x3728e9){if(!_0x3728e9){_0x23ab0c[_0x485f('0x18')](0x194);}return _0x3728e9;};}function handleError(_0x136b6f,_0x384198){_0x384198=_0x384198||0x1f4;return function(_0x3dfc86){logger[_0x485f('0x26')](_0x3dfc86['stack']);if(_0x3dfc86[_0x485f('0x27')]){delete _0x3dfc86[_0x485f('0x27')];}_0x136b6f[_0x485f('0x19')](_0x384198)[_0x485f('0x28')](_0x3dfc86);};}exports[_0x485f('0x29')]=function(_0x17cc8b,_0x443c16){var _0x58ce63={},_0x46973f={},_0x4553c9={'count':0x0,'rows':[]};var _0x1f7648=_['map'](db['MailTransferReport'][_0x485f('0x2a')],function(_0x43c3a8){return{'name':_0x43c3a8[_0x485f('0x2b')],'type':_0x43c3a8[_0x485f('0x2c')][_0x485f('0x2d')]};});_0x46973f[_0x485f('0x2e')]=_[_0x485f('0x2f')](_0x1f7648,_0x485f('0x27'));_0x46973f['query']=_[_0x485f('0x30')](_0x17cc8b[_0x485f('0x31')]);_0x46973f[_0x485f('0x32')]=_[_0x485f('0x33')](_0x46973f[_0x485f('0x2e')],_0x46973f['query']);_0x58ce63['attributes']=_[_0x485f('0x33')](_0x46973f['model'],qs[_0x485f('0x34')](_0x17cc8b['query'][_0x485f('0x34')]));_0x58ce63[_0x485f('0x35')]=_0x58ce63[_0x485f('0x35')]['length']?_0x58ce63[_0x485f('0x35')]:_0x46973f[_0x485f('0x2e')];if(!_0x17cc8b[_0x485f('0x31')][_0x485f('0x36')]('nolimit')){_0x58ce63['limit']=qs[_0x485f('0x1e')](_0x17cc8b[_0x485f('0x31')][_0x485f('0x1e')]);_0x58ce63[_0x485f('0x1d')]=qs[_0x485f('0x1d')](_0x17cc8b['query'][_0x485f('0x1d')]);}_0x58ce63[_0x485f('0x37')]=qs[_0x485f('0x38')](_0x17cc8b[_0x485f('0x31')][_0x485f('0x38')]);_0x58ce63[_0x485f('0x39')]=qs[_0x485f('0x32')](_['pick'](_0x17cc8b[_0x485f('0x31')],_0x46973f[_0x485f('0x32')]),_0x1f7648);if(_0x17cc8b['query'][_0x485f('0x3a')]){_0x58ce63[_0x485f('0x39')]=_[_0x485f('0x3b')](_0x58ce63[_0x485f('0x39')],{'$or':_[_0x485f('0x2f')](_0x1f7648,function(_0x41fb4e){if(_0x41fb4e[_0x485f('0x2c')]!==_0x485f('0x3c')){var _0x16839d={};_0x16839d[_0x41fb4e[_0x485f('0x27')]]={'$like':'%'+_0x17cc8b[_0x485f('0x31')]['filter']+'%'};return _0x16839d;}})});}_0x58ce63=_[_0x485f('0x3b')]({},_0x58ce63,_0x17cc8b[_0x485f('0x3d')]);var _0x391b08={'where':_0x58ce63[_0x485f('0x39')]};return db[_0x485f('0x3e')][_0x485f('0x1c')](_0x391b08)[_0x485f('0x24')](function(_0x5f4cc7){_0x4553c9[_0x485f('0x1c')]=_0x5f4cc7;if(_0x17cc8b[_0x485f('0x31')][_0x485f('0x3f')]){_0x58ce63[_0x485f('0x40')]=[{'all':!![]}];}return db[_0x485f('0x3e')][_0x485f('0x41')](_0x58ce63);})[_0x485f('0x24')](function(_0x4988e0){_0x4553c9['rows']=_0x4988e0;return _0x4553c9;})[_0x485f('0x24')](respondWithFilteredResult(_0x443c16,_0x58ce63))['catch'](handleError(_0x443c16,null));};exports[_0x485f('0x42')]=function(_0xff909f,_0xc3b935){var _0x24f5fc={'raw':!![],'where':{'id':_0xff909f[_0x485f('0x43')]['id']}},_0x392edd={};_0x392edd[_0x485f('0x2e')]=_[_0x485f('0x30')](db[_0x485f('0x3e')][_0x485f('0x2a')]);_0x392edd[_0x485f('0x31')]=_[_0x485f('0x30')](_0xff909f['query']);_0x392edd[_0x485f('0x32')]=_[_0x485f('0x33')](_0x392edd[_0x485f('0x2e')],_0x392edd[_0x485f('0x31')]);_0x24f5fc['attributes']=_[_0x485f('0x33')](_0x392edd[_0x485f('0x2e')],qs['fields'](_0xff909f['query'][_0x485f('0x34')]));_0x24f5fc[_0x485f('0x35')]=_0x24f5fc[_0x485f('0x35')][_0x485f('0x44')]?_0x24f5fc[_0x485f('0x35')]:_0x392edd['model'];if(_0xff909f[_0x485f('0x31')]['includeAll']){_0x24f5fc['include']=[{'all':!![]}];}_0x24f5fc=_[_0x485f('0x3b')]({},_0x24f5fc,_0xff909f[_0x485f('0x3d')]);return db[_0x485f('0x3e')][_0x485f('0x45')](_0x24f5fc)[_0x485f('0x24')](handleEntityNotFound(_0xc3b935,null))[_0x485f('0x24')](respondWithResult(_0xc3b935,null))[_0x485f('0x46')](handleError(_0xc3b935,null));};exports[_0x485f('0x47')]=function(_0x5a37c5,_0x3f6597){return db['MailTransferReport'][_0x485f('0x47')](_0x5a37c5[_0x485f('0x48')],{})['then'](respondWithResult(_0x3f6597,0xc9))['catch'](handleError(_0x3f6597,null));};exports[_0x485f('0x23')]=function(_0x457545,_0x3ceafa){if(_0x457545[_0x485f('0x48')]['id']){delete _0x457545[_0x485f('0x48')]['id'];}return db[_0x485f('0x3e')]['find']({'where':{'id':_0x457545[_0x485f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ceafa,null))[_0x485f('0x24')](saveUpdates(_0x457545['body'],null))['then'](respondWithResult(_0x3ceafa,null))[_0x485f('0x46')](handleError(_0x3ceafa,null));};exports['destroy']=function(_0x1dfc19,_0x4b7e4d){return db[_0x485f('0x3e')][_0x485f('0x45')]({'where':{'id':_0x1dfc19[_0x485f('0x43')]['id']}})[_0x485f('0x24')](handleEntityNotFound(_0x4b7e4d,null))[_0x485f('0x24')](removeEntity(_0x4b7e4d,null))[_0x485f('0x46')](handleError(_0x4b7e4d,null));};exports[_0x485f('0x49')]=function(_0x1d6565,_0xac9555){return db['MailTransferReport'][_0x485f('0x49')]()[_0x485f('0x24')](respondWithResult(_0xac9555,null))[_0x485f('0x46')](handleError(_0xac9555,null));}; \ No newline at end of file +var _0x2d20=['apply','reject','save','update','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','MailTransferReport','includeAll','include','findAll','then','show','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set'];(function(_0x510cd8,_0x43d8f7){var _0xaec906=function(_0x4504f5){while(--_0x4504f5){_0x510cd8['push'](_0x510cd8['shift']());}};_0xaec906(++_0x43d8f7);}(_0x2d20,0x6f));var _0x02d2=function(_0x4f2055,_0x229472){_0x4f2055=_0x4f2055-0x0;var _0x287a0b=_0x2d20[_0x4f2055];return _0x287a0b;};'use strict';var emlformat=require(_0x02d2('0x0'));var rimraf=require(_0x02d2('0x1'));var zipdir=require(_0x02d2('0x2'));var jsonpatch=require(_0x02d2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02d2('0x4'));var Mustache=require(_0x02d2('0x5'));var util=require(_0x02d2('0x6'));var path=require(_0x02d2('0x7'));var sox=require(_0x02d2('0x8'));var csv=require('to-csv');var ejs=require(_0x02d2('0x9'));var fs=require('fs');var fs_extra=require(_0x02d2('0xa'));var _=require(_0x02d2('0xb'));var squel=require(_0x02d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x02d2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x02d2('0xe'));var querystring=require('querystring');var Papa=require(_0x02d2('0xf'));var Redis=require(_0x02d2('0x10'));var authService=require(_0x02d2('0x11'));var qs=require(_0x02d2('0x12'));var as=require(_0x02d2('0x13'));var hardwareService=require(_0x02d2('0x14'));var logger=require('../../config/logger')(_0x02d2('0x15'));var utils=require('../../config/utils');var config=require(_0x02d2('0x16'));var licenseUtil=require(_0x02d2('0x17'));var db=require(_0x02d2('0x18'))['db'];function respondWithStatusCode(_0x30c96e,_0x197b6b){_0x197b6b=_0x197b6b||0xcc;return function(_0x2daf11){if(_0x2daf11){return _0x30c96e[_0x02d2('0x19')](_0x197b6b);}return _0x30c96e[_0x02d2('0x1a')](_0x197b6b)[_0x02d2('0x1b')]();};}function respondWithResult(_0x383a31,_0x3eefe2){_0x3eefe2=_0x3eefe2||0xc8;return function(_0x127e2e){if(_0x127e2e){return _0x383a31[_0x02d2('0x1a')](_0x3eefe2)['json'](_0x127e2e);}};}function respondWithFilteredResult(_0x21f68f,_0x442607){return function(_0x137452){if(_0x137452){var _0x5ce809=typeof _0x442607['offset']===_0x02d2('0x1c')&&typeof _0x442607[_0x02d2('0x1d')]===_0x02d2('0x1c');var _0x26682c=_0x137452[_0x02d2('0x1e')];var _0x28b3c3=_0x5ce809?0x0:_0x442607[_0x02d2('0x1f')];var _0x4bc1d1=_0x5ce809?_0x137452[_0x02d2('0x1e')]:_0x442607[_0x02d2('0x1f')]+_0x442607[_0x02d2('0x1d')];var _0x1568ec;if(_0x4bc1d1>=_0x26682c){_0x4bc1d1=_0x26682c;_0x1568ec=0xc8;}else{_0x1568ec=0xce;}_0x21f68f[_0x02d2('0x1a')](_0x1568ec);return _0x21f68f[_0x02d2('0x20')]('Content-Range',_0x28b3c3+'-'+_0x4bc1d1+'/'+_0x26682c)['json'](_0x137452);}return null;};}function patchUpdates(_0x448e6b){return function(_0x2de144){try{jsonpatch[_0x02d2('0x21')](_0x2de144,_0x448e6b,!![]);}catch(_0x512a73){return BPromise[_0x02d2('0x22')](_0x512a73);}return _0x2de144[_0x02d2('0x23')]();};}function saveUpdates(_0x26e039,_0x437f82){return function(_0x14a7ea){if(_0x14a7ea){return _0x14a7ea[_0x02d2('0x24')](_0x26e039)['then'](function(_0x42121f){return _0x42121f;});}return null;};}function removeEntity(_0x2add08,_0x7d2ea7){return function(_0x1ae564){if(_0x1ae564){return _0x1ae564['destroy']()['then'](function(){_0x2add08[_0x02d2('0x1a')](0xcc)[_0x02d2('0x1b')]();});}};}function handleEntityNotFound(_0x19bfe2,_0x38b996){return function(_0x14e449){if(!_0x14e449){_0x19bfe2[_0x02d2('0x19')](0x194);}return _0x14e449;};}function handleError(_0x3611f1,_0x197802){_0x197802=_0x197802||0x1f4;return function(_0x3b4e32){logger['error'](_0x3b4e32[_0x02d2('0x25')]);if(_0x3b4e32[_0x02d2('0x26')]){delete _0x3b4e32[_0x02d2('0x26')];}_0x3611f1[_0x02d2('0x1a')](_0x197802)[_0x02d2('0x27')](_0x3b4e32);};}exports['index']=function(_0x6af2ad,_0x55b721){var _0x2afce2={},_0x443611={},_0x28bc03={'count':0x0,'rows':[]};var _0x4bfae4=_[_0x02d2('0x28')](db['MailTransferReport'][_0x02d2('0x29')],function(_0x453400){return{'name':_0x453400[_0x02d2('0x2a')],'type':_0x453400[_0x02d2('0x2b')][_0x02d2('0x2c')]};});_0x443611[_0x02d2('0x2d')]=_[_0x02d2('0x28')](_0x4bfae4,_0x02d2('0x26'));_0x443611[_0x02d2('0x2e')]=_[_0x02d2('0x2f')](_0x6af2ad[_0x02d2('0x2e')]);_0x443611[_0x02d2('0x30')]=_[_0x02d2('0x31')](_0x443611[_0x02d2('0x2d')],_0x443611['query']);_0x2afce2[_0x02d2('0x32')]=_[_0x02d2('0x31')](_0x443611[_0x02d2('0x2d')],qs[_0x02d2('0x33')](_0x6af2ad[_0x02d2('0x2e')]['fields']));_0x2afce2[_0x02d2('0x32')]=_0x2afce2[_0x02d2('0x32')][_0x02d2('0x34')]?_0x2afce2[_0x02d2('0x32')]:_0x443611['model'];if(!_0x6af2ad['query']['hasOwnProperty']('nolimit')){_0x2afce2['limit']=qs['limit'](_0x6af2ad[_0x02d2('0x2e')][_0x02d2('0x1d')]);_0x2afce2[_0x02d2('0x1f')]=qs['offset'](_0x6af2ad['query'][_0x02d2('0x1f')]);}_0x2afce2[_0x02d2('0x35')]=qs[_0x02d2('0x36')](_0x6af2ad[_0x02d2('0x2e')][_0x02d2('0x36')]);_0x2afce2[_0x02d2('0x37')]=qs[_0x02d2('0x30')](_[_0x02d2('0x38')](_0x6af2ad[_0x02d2('0x2e')],_0x443611['filters']),_0x4bfae4);if(_0x6af2ad['query'][_0x02d2('0x39')]){_0x2afce2[_0x02d2('0x37')]=_['merge'](_0x2afce2[_0x02d2('0x37')],{'$or':_[_0x02d2('0x28')](_0x4bfae4,function(_0x1fbf90){if(_0x1fbf90['type']!==_0x02d2('0x3a')){var _0x39027f={};_0x39027f[_0x1fbf90[_0x02d2('0x26')]]={'$like':'%'+_0x6af2ad['query'][_0x02d2('0x39')]+'%'};return _0x39027f;}})});}_0x2afce2=_[_0x02d2('0x3b')]({},_0x2afce2,_0x6af2ad['options']);var _0x4b8ff3={'where':_0x2afce2[_0x02d2('0x37')]};return db[_0x02d2('0x3c')][_0x02d2('0x1e')](_0x4b8ff3)['then'](function(_0x558da6){_0x28bc03[_0x02d2('0x1e')]=_0x558da6;if(_0x6af2ad['query'][_0x02d2('0x3d')]){_0x2afce2[_0x02d2('0x3e')]=[{'all':!![]}];}return db[_0x02d2('0x3c')][_0x02d2('0x3f')](_0x2afce2);})[_0x02d2('0x40')](function(_0x5795a4){_0x28bc03['rows']=_0x5795a4;return _0x28bc03;})[_0x02d2('0x40')](respondWithFilteredResult(_0x55b721,_0x2afce2))['catch'](handleError(_0x55b721,null));};exports[_0x02d2('0x41')]=function(_0x2cdead,_0x45d71a){var _0x33312c={'raw':!![],'where':{'id':_0x2cdead['params']['id']}},_0x15a1ee={};_0x15a1ee['model']=_[_0x02d2('0x2f')](db[_0x02d2('0x3c')]['rawAttributes']);_0x15a1ee[_0x02d2('0x2e')]=_[_0x02d2('0x2f')](_0x2cdead[_0x02d2('0x2e')]);_0x15a1ee[_0x02d2('0x30')]=_[_0x02d2('0x31')](_0x15a1ee[_0x02d2('0x2d')],_0x15a1ee['query']);_0x33312c[_0x02d2('0x32')]=_[_0x02d2('0x31')](_0x15a1ee[_0x02d2('0x2d')],qs[_0x02d2('0x33')](_0x2cdead[_0x02d2('0x2e')]['fields']));_0x33312c[_0x02d2('0x32')]=_0x33312c[_0x02d2('0x32')][_0x02d2('0x34')]?_0x33312c['attributes']:_0x15a1ee[_0x02d2('0x2d')];if(_0x2cdead[_0x02d2('0x2e')][_0x02d2('0x3d')]){_0x33312c['include']=[{'all':!![]}];}_0x33312c=_[_0x02d2('0x3b')]({},_0x33312c,_0x2cdead['options']);return db[_0x02d2('0x3c')][_0x02d2('0x42')](_0x33312c)[_0x02d2('0x40')](handleEntityNotFound(_0x45d71a,null))[_0x02d2('0x40')](respondWithResult(_0x45d71a,null))['catch'](handleError(_0x45d71a,null));};exports[_0x02d2('0x43')]=function(_0x26914e,_0x15af93){return db[_0x02d2('0x3c')]['create'](_0x26914e[_0x02d2('0x44')],{})[_0x02d2('0x40')](respondWithResult(_0x15af93,0xc9))[_0x02d2('0x45')](handleError(_0x15af93,null));};exports[_0x02d2('0x24')]=function(_0x23de9d,_0x3d4081){if(_0x23de9d[_0x02d2('0x44')]['id']){delete _0x23de9d[_0x02d2('0x44')]['id'];}return db[_0x02d2('0x3c')][_0x02d2('0x42')]({'where':{'id':_0x23de9d['params']['id']}})['then'](handleEntityNotFound(_0x3d4081,null))[_0x02d2('0x40')](saveUpdates(_0x23de9d[_0x02d2('0x44')],null))[_0x02d2('0x40')](respondWithResult(_0x3d4081,null))[_0x02d2('0x45')](handleError(_0x3d4081,null));};exports['destroy']=function(_0x2c239a,_0x3ecd34){return db[_0x02d2('0x3c')][_0x02d2('0x42')]({'where':{'id':_0x2c239a[_0x02d2('0x46')]['id']}})[_0x02d2('0x40')](handleEntityNotFound(_0x3ecd34,null))[_0x02d2('0x40')](removeEntity(_0x3ecd34,null))[_0x02d2('0x45')](handleError(_0x3ecd34,null));};exports['describe']=function(_0x341872,_0x2865f3){return db['MailTransferReport'][_0x02d2('0x47')]()[_0x02d2('0x40')](respondWithResult(_0x2865f3,null))['catch'](handleError(_0x2865f3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c76160a..efc46ce 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 _0xbe52=['moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbe52,0x164));var _0x2be5=function(_0x4de3a4,_0x1a000d){_0x4de3a4=_0x4de3a4-0x0;var _0x3586a7=_0xbe52[_0x4de3a4];return _0x3586a7;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var logger=require(_0x2be5('0x2'))(_0x2be5('0x3'));var moment=require(_0x2be5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2be5('0x5'));var fs=require('fs');var path=require(_0x2be5('0x6'));var rimraf=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var attributes=require(_0x2be5('0x9'));module[_0x2be5('0xa')]=function(_0x39dc18,_0x13fadf){return _0x39dc18[_0x2be5('0xb')](_0x2be5('0xc'),attributes,{'tableName':_0x2be5('0xd'),'paranoid':![],'indexes':[{'name':_0x2be5('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7e6=['moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1ee83d,_0x502b34){var _0x1a5b8b=function(_0x596704){while(--_0x596704){_0x1ee83d['push'](_0x1ee83d['shift']());}};_0x1a5b8b(++_0x502b34);}(_0xa7e6,0x74));var _0x6a7e=function(_0x31d3b4,_0x138abc){_0x31d3b4=_0x31d3b4-0x0;var _0x43b94b=_0xa7e6[_0x31d3b4];return _0x43b94b;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7e('0x6'));var rimraf=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var attributes=require(_0x6a7e('0x9'));module[_0x6a7e('0xa')]=function(_0x599006,_0x79df6f){return _0x599006[_0x6a7e('0xb')](_0x6a7e('0xc'),attributes,{'tableName':_0x6a7e('0xd'),'paranoid':![],'indexes':[{'name':_0x6a7e('0xe'),'fields':[_0x6a7e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index b45046e..491de9b 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 _0xd42d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0xd42d,0x1f4));var _0xdd42=function(_0x5f1286,_0x5e0a0b){_0x5f1286=_0x5f1286-0x0;var _0x1069bf=_0xd42d[_0x5f1286];return _0x1069bf;};'use strict';var _=require(_0xdd42('0x0'));var util=require(_0xdd42('0x1'));var moment=require(_0xdd42('0x2'));var BPromise=require(_0xdd42('0x3'));var rs=require(_0xdd42('0x4'));var fs=require('fs');var Redis=require(_0xdd42('0x5'));var db=require(_0xdd42('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd42('0x7'))(_0xdd42('0x8'));var config=require(_0xdd42('0x9'));var jayson=require(_0xdd42('0xa'));var client=jayson['client'][_0xdd42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x70c94d,_0x24d5ea,_0x4248a3){return new BPromise(function(_0x1a4dc4,_0x32080c){return client[_0xdd42('0xc')](_0x70c94d,_0x4248a3)['then'](function(_0x29f030){logger[_0xdd42('0xd')](_0xdd42('0xe'),_0x24d5ea,_0xdd42('0xf'));logger[_0xdd42('0x10')](_0xdd42('0x11'),_0x24d5ea,'request\x20sent',JSON[_0xdd42('0x12')](_0x29f030));if(_0x29f030[_0xdd42('0x13')]){if(_0x29f030[_0xdd42('0x13')][_0xdd42('0x14')]===0x1f4){logger['error'](_0xdd42('0xe'),_0x24d5ea,_0x29f030[_0xdd42('0x13')][_0xdd42('0x15')]);return _0x32080c(_0x29f030['error'][_0xdd42('0x15')]);}logger[_0xdd42('0x13')](_0xdd42('0xe'),_0x24d5ea,_0x29f030[_0xdd42('0x13')]['message']);return _0x1a4dc4(_0x29f030[_0xdd42('0x13')][_0xdd42('0x15')]);}else{logger[_0xdd42('0xd')](_0xdd42('0xe'),_0x24d5ea,_0xdd42('0xf'));_0x1a4dc4(_0x29f030['result']['message']);}})[_0xdd42('0x16')](function(_0x17d728){logger[_0xdd42('0x13')](_0xdd42('0xe'),_0x24d5ea,_0x17d728);_0x32080c(_0x17d728);});});} \ No newline at end of file +var _0xc008=['../../config/environment','jayson/promise','http','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5720fe,_0x18f3db){var _0x15eb0f=function(_0x110364){while(--_0x110364){_0x5720fe['push'](_0x5720fe['shift']());}};_0x15eb0f(++_0x18f3db);}(_0xc008,0x8c));var _0x8c00=function(_0x1fe7d1,_0x48a629){_0x1fe7d1=_0x1fe7d1-0x0;var _0x5ad5af=_0xc008[_0x1fe7d1];return _0x5ad5af;};'use strict';var _=require(_0x8c00('0x0'));var util=require(_0x8c00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8c00('0x2'));var fs=require('fs');var Redis=require(_0x8c00('0x3'));var db=require(_0x8c00('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c00('0x5'))(_0x8c00('0x6'));var config=require(_0x8c00('0x7'));var jayson=require(_0x8c00('0x8'));var client=jayson['client'][_0x8c00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415a5d,_0x1de376,_0x40aaa6){return new BPromise(function(_0x44fc61,_0x19bb1a){return client['request'](_0x415a5d,_0x40aaa6)['then'](function(_0x5c673c){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1de376,_0x8c00('0xa'));logger[_0x8c00('0xb')](_0x8c00('0xc'),_0x1de376,_0x8c00('0xa'),JSON[_0x8c00('0xd')](_0x5c673c));if(_0x5c673c[_0x8c00('0xe')]){if(_0x5c673c[_0x8c00('0xe')][_0x8c00('0xf')]===0x1f4){logger[_0x8c00('0xe')](_0x8c00('0x10'),_0x1de376,_0x5c673c['error'][_0x8c00('0x11')]);return _0x19bb1a(_0x5c673c[_0x8c00('0xe')]['message']);}logger[_0x8c00('0xe')](_0x8c00('0x10'),_0x1de376,_0x5c673c[_0x8c00('0xe')][_0x8c00('0x11')]);return _0x44fc61(_0x5c673c[_0x8c00('0xe')][_0x8c00('0x11')]);}else{logger[_0x8c00('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x1de376,'request\x20sent');_0x44fc61(_0x5c673c[_0x8c00('0x13')][_0x8c00('0x11')]);}})[_0x8c00('0x14')](function(_0x173d05){logger['error'](_0x8c00('0x10'),_0x1de376,_0x173d05);_0x19bb1a(_0x173d05);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 95c03eb..867aac0 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 _0x0f41=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x1bd279,_0x13e517){var _0x271461=function(_0x4ebdc9){while(--_0x4ebdc9){_0x1bd279['push'](_0x1bd279['shift']());}};_0x271461(++_0x13e517);}(_0x0f41,0xca));var _0x10f4=function(_0x3285f6,_0x4f66aa){_0x3285f6=_0x3285f6-0x0;var _0x4b0abf=_0x0f41[_0x3285f6];return _0x4b0abf;};'use strict';var multer=require(_0x10f4('0x0'));var util=require(_0x10f4('0x1'));var path=require(_0x10f4('0x2'));var timeout=require(_0x10f4('0x3'));var express=require(_0x10f4('0x4'));var router=express[_0x10f4('0x5')]();var fs_extra=require(_0x10f4('0x6'));var auth=require(_0x10f4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x10f4('0x8'));var controller=require(_0x10f4('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x10f4('0xa')]);router[_0x10f4('0xb')](_0x10f4('0xc'),auth[_0x10f4('0xd')](),controller[_0x10f4('0xe')]);router[_0x10f4('0xb')](_0x10f4('0xf'),auth[_0x10f4('0xd')](),controller[_0x10f4('0x10')]);router[_0x10f4('0x11')]('/',auth[_0x10f4('0xd')](),controller['create']);router[_0x10f4('0x12')](_0x10f4('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x10f4('0x13')](_0x10f4('0xf'),auth[_0x10f4('0xd')](),controller[_0x10f4('0x14')]);module[_0x10f4('0x15')]=router; \ No newline at end of file +var _0x8cfd=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','create','put','/:id','update','destroy','exports','multer','util','path','express'];(function(_0x2eeacc,_0x5cb4b9){var _0x345ef9=function(_0x5f27e4){while(--_0x5f27e4){_0x2eeacc['push'](_0x2eeacc['shift']());}};_0x345ef9(++_0x5cb4b9);}(_0x8cfd,0x1bc));var _0xd8cf=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x8cfd[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var path=require(_0xd8cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8cf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd8cf('0x4'));var config=require(_0xd8cf('0x5'));var controller=require('./memberReport.controller');router[_0xd8cf('0x6')]('/',auth[_0xd8cf('0x7')](),controller[_0xd8cf('0x8')]);router['get'](_0xd8cf('0x9'),auth[_0xd8cf('0x7')](),controller['describe']);router[_0xd8cf('0x6')]('/:id',auth[_0xd8cf('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd8cf('0xa')]);router[_0xd8cf('0xb')](_0xd8cf('0xc'),auth[_0xd8cf('0x7')](),controller[_0xd8cf('0xd')]);router['delete']('/:id',auth[_0xd8cf('0x7')](),controller[_0xd8cf('0xe')]);module[_0xd8cf('0xf')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4801bfa..9f9e325 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 _0x86cd=['exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x2fe92e,_0x5a8166){var _0x4a455a=function(_0x253328){while(--_0x253328){_0x2fe92e['push'](_0x2fe92e['shift']());}};_0x4a455a(++_0x5a8166);}(_0x86cd,0x139));var _0xd86c=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x86cd[_0x39609a];return _0xecd92;};'use strict';var Sequelize=require(_0xd86c('0x0'));var moment=require(_0xd86c('0x1'));module[_0xd86c('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd86c('0x3')]},'interface':{'type':Sequelize[_0xd86c('0x3')]},'type':{'type':Sequelize[_0xd86c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xd86c('0x4')},'duration':{'type':Sequelize[_0xd86c('0x5')]},'enterAt':{'type':Sequelize[_0xd86c('0x6')]},'exitAt':{'type':Sequelize[_0xd86c('0x6')],'set':function(_0x4f327b){var _0x29477b=moment(_0x4f327b);var _0x5dc067=moment(this[_0xd86c('0x7')]('enterAt'));var _0x43b09f=_0x29477b['diff'](_0x5dc067,_0xd86c('0x8'));this[_0xd86c('0x9')](_0xd86c('0xa'),_0x4f327b);this[_0xd86c('0x9')]('duration',_0x43b09f>=0x0?_0x43b09f:null);}},'data1':{'type':Sequelize[_0xd86c('0x3')],'comment':_0xd86c('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xd86c('0x3')],'comment':_0xd86c('0xc')},'data4':{'type':Sequelize[_0xd86c('0x3')],'comment':_0xd86c('0xd')},'data5':{'type':Sequelize[_0xd86c('0x3')],'comment':_0xd86c('0xe')},'role':{'type':Sequelize[_0xd86c('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd86c('0x3')]}}; \ No newline at end of file +var _0x345b=['talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]'];(function(_0x13d425,_0x4419fa){var _0x72f3a6=function(_0x3d49e2){while(--_0x3d49e2){_0x13d425['push'](_0x13d425['shift']());}};_0x72f3a6(++_0x4419fa);}(_0x345b,0x102));var _0xb345=function(_0x535b80,_0x5155f7){_0x535b80=_0x535b80-0x0;var _0x1c5532=_0x345b[_0x535b80];return _0x1c5532;};'use strict';var Sequelize=require(_0xb345('0x0'));var moment=require(_0xb345('0x1'));module[_0xb345('0x2')]={'channel':{'type':Sequelize[_0xb345('0x3')]},'membername':{'type':Sequelize[_0xb345('0x3')]},'interface':{'type':Sequelize[_0xb345('0x3')]},'type':{'type':Sequelize[_0xb345('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xb345('0x4')},'duration':{'type':Sequelize[_0xb345('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2230b3){var _0x3a5366=moment(_0x2230b3);var _0x180577=moment(this[_0xb345('0x6')](_0xb345('0x7')));var _0x55ab0d=_0x3a5366['diff'](_0x180577,_0xb345('0x8'));this[_0xb345('0x9')](_0xb345('0xa'),_0x2230b3);this[_0xb345('0x9')](_0xb345('0xb'),_0x55ab0d>=0x0?_0x55ab0d:null);}},'data1':{'type':Sequelize[_0xb345('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xb345('0x3')],'comment':_0xb345('0xc')},'data3':{'type':Sequelize[_0xb345('0x3')],'comment':_0xb345('0xd')},'data4':{'type':Sequelize[_0xb345('0x3')],'comment':_0xb345('0xe')},'data5':{'type':Sequelize[_0xb345('0x3')],'comment':_0xb345('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xb345('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index cf8e157..f94188b 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x5902a3,_0x3219ee){var _0x3c68cc=function(_0x528c7f){while(--_0x528c7f){_0x5902a3['push'](_0x5902a3['shift']());}};_0x3c68cc(++_0x3219ee);}(_0x3e74,0x175));var _0x43e7=function(_0x12b276,_0x2fdaa1){_0x12b276=_0x12b276-0x0;var _0x4875e5=_0x3e74[_0x12b276];return _0x4875e5;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index b624295..f875728 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 _0x1f2e=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b530f,_0x1a82fd){var _0x144243=function(_0x579bbe){while(--_0x579bbe){_0x2b530f['push'](_0x2b530f['shift']());}};_0x144243(++_0x1a82fd);}(_0x1f2e,0x82));var _0xe1f2=function(_0x157ebd,_0x3aa941){_0x157ebd=_0x157ebd-0x0;var _0x408482=_0x1f2e[_0x157ebd];return _0x408482;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1f2('0x0'))(_0xe1f2('0x1'));var moment=require(_0xe1f2('0x2'));var BPromise=require(_0xe1f2('0x3'));var rp=require(_0xe1f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1f2('0x5'));var config=require(_0xe1f2('0x6'));var attributes=require(_0xe1f2('0x7'));module[_0xe1f2('0x8')]=function(_0xae6dc7,_0x41bd1a){return _0xae6dc7[_0xe1f2('0x9')](_0xe1f2('0xa'),attributes,{'tableName':_0xe1f2('0xb'),'paranoid':![],'indexes':[{'name':_0xe1f2('0xc'),'fields':[_0xe1f2('0xd'),_0xe1f2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa269=['./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x26f7aa,_0x215988){var _0x5e8406=function(_0x39d28d){while(--_0x39d28d){_0x26f7aa['push'](_0x26f7aa['shift']());}};_0x5e8406(++_0x215988);}(_0xa269,0x14c));var _0x9a26=function(_0x2ed1ed,_0x1291ba){_0x2ed1ed=_0x2ed1ed-0x0;var _0x501f47=_0xa269[_0x2ed1ed];return _0x501f47;};'use strict';var _=require('lodash');var util=require(_0x9a26('0x0'));var logger=require('../../config/logger')(_0x9a26('0x1'));var moment=require(_0x9a26('0x2'));var BPromise=require(_0x9a26('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9a26('0x4'));var config=require(_0x9a26('0x5'));var attributes=require(_0x9a26('0x6'));module['exports']=function(_0x3379e6,_0x2a94a2){return _0x3379e6[_0x9a26('0x7')](_0x9a26('0x8'),attributes,{'tableName':_0x9a26('0x9'),'paranoid':![],'indexes':[{'name':_0x9a26('0xa'),'fields':[_0x9a26('0xb'),_0x9a26('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 32a7de6..b243bf3 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 _0xefce=['stringify','error','code','message','catch','MemberReport','findAll','options','raw','attributes','limit','include','map','model','then','CreateMemberReport','body','UpdateMemberReport','update','where','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5820df,_0x24240a){var _0x7a47f1=function(_0x37410b){while(--_0x37410b){_0x5820df['push'](_0x5820df['shift']());}};_0x7a47f1(++_0x24240a);}(_0xefce,0x1e8));var _0xeefc=function(_0x41cc3f,_0x2678a2){_0x41cc3f=_0x41cc3f-0x0;var _0x47ff58=_0xefce[_0x41cc3f];return _0x47ff58;};'use strict';var _=require('lodash');var util=require(_0xeefc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeefc('0x1'));var fs=require('fs');var Redis=require(_0xeefc('0x2'));var db=require(_0xeefc('0x3'))['db'];var utils=require(_0xeefc('0x4'));var logger=require(_0xeefc('0x5'))(_0xeefc('0x6'));var config=require(_0xeefc('0x7'));var jayson=require(_0xeefc('0x8'));var client=jayson[_0xeefc('0x9')][_0xeefc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a2635,_0x4f93b2,_0x377309){return new BPromise(function(_0xfb5a39,_0x1b3eb3){return client[_0xeefc('0xb')](_0x5a2635,_0x377309)['then'](function(_0x560d33){logger[_0xeefc('0xc')](_0xeefc('0xd'),_0x4f93b2,'request\x20sent');logger[_0xeefc('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4f93b2,_0xeefc('0xf'),JSON[_0xeefc('0x10')](_0x560d33));if(_0x560d33['error']){if(_0x560d33[_0xeefc('0x11')][_0xeefc('0x12')]===0x1f4){logger[_0xeefc('0x11')]('MemberReport,\x20%s,\x20%s',_0x4f93b2,_0x560d33[_0xeefc('0x11')][_0xeefc('0x13')]);return _0x1b3eb3(_0x560d33[_0xeefc('0x11')][_0xeefc('0x13')]);}logger[_0xeefc('0x11')](_0xeefc('0xd'),_0x4f93b2,_0x560d33[_0xeefc('0x11')][_0xeefc('0x13')]);return _0xfb5a39(_0x560d33[_0xeefc('0x11')][_0xeefc('0x13')]);}else{logger[_0xeefc('0xc')]('MemberReport,\x20%s,\x20%s',_0x4f93b2,_0xeefc('0xf'));_0xfb5a39(_0x560d33['result'][_0xeefc('0x13')]);}})[_0xeefc('0x14')](function(_0x37f8a4){logger[_0xeefc('0x11')](_0xeefc('0xd'),_0x4f93b2,_0x37f8a4);_0x1b3eb3(_0x37f8a4);});});}exports['GetMemberReport']=function(_0x1c247e){var _0x1ea90e=this;return new Promise(function(_0x55c2fb,_0x337b70){return db[_0xeefc('0x15')][_0xeefc('0x16')]({'raw':_0x1c247e['options']?_0x1c247e[_0xeefc('0x17')][_0xeefc('0x18')]===undefined?!![]:![]:!![],'where':_0x1c247e['options']?_0x1c247e[_0xeefc('0x17')]['where']||null:null,'attributes':_0x1c247e[_0xeefc('0x17')]?_0x1c247e[_0xeefc('0x17')][_0xeefc('0x19')]||null:null,'limit':_0x1c247e[_0xeefc('0x17')]?_0x1c247e[_0xeefc('0x17')][_0xeefc('0x1a')]||null:null,'include':_0x1c247e[_0xeefc('0x17')]?_0x1c247e['options'][_0xeefc('0x1b')]?_[_0xeefc('0x1c')](_0x1c247e[_0xeefc('0x17')][_0xeefc('0x1b')],function(_0x4eea87){return{'model':db[_0x4eea87['model']],'as':_0x4eea87['as'],'attributes':_0x4eea87[_0xeefc('0x19')],'include':_0x4eea87[_0xeefc('0x1b')]?_[_0xeefc('0x1c')](_0x4eea87[_0xeefc('0x1b')],function(_0x4aeaa7){return{'model':db[_0x4aeaa7[_0xeefc('0x1d')]],'as':_0x4aeaa7['as'],'attributes':_0x4aeaa7[_0xeefc('0x19')],'include':_0x4aeaa7[_0xeefc('0x1b')]?_[_0xeefc('0x1c')](_0x4aeaa7['include'],function(_0x5a8736){return{'model':db[_0x5a8736[_0xeefc('0x1d')]],'as':_0x5a8736['as'],'attributes':_0x5a8736['attributes']};}):[]};}):[]};}):[]:[]})[_0xeefc('0x1e')](function(_0x2d13b6){logger['info']('GetMemberReport',_0x1c247e);logger[_0xeefc('0xe')]('GetMemberReport',_0x1c247e,JSON['stringify'](_0x2d13b6));_0x55c2fb(_0x2d13b6);})[_0xeefc('0x14')](function(_0x1079f2){logger['error']('GetMemberReport',_0x1079f2[_0xeefc('0x13')],_0x1c247e);_0x337b70(_0x1ea90e[_0xeefc('0x11')](0x1f4,_0x1079f2[_0xeefc('0x13')]));});});};exports[_0xeefc('0x1f')]=function(_0x29fc6b){var _0x325578=this;return new Promise(function(_0x1d8522,_0xa0c512){return db[_0xeefc('0x15')]['create'](_0x29fc6b[_0xeefc('0x20')],{'raw':_0x29fc6b[_0xeefc('0x17')]?_0x29fc6b[_0xeefc('0x17')][_0xeefc('0x18')]===undefined?!![]:![]:!![]})[_0xeefc('0x1e')](function(_0x1dd76f){logger[_0xeefc('0xc')](_0xeefc('0x1f'),_0x29fc6b);logger[_0xeefc('0xe')](_0xeefc('0x1f'),_0x29fc6b,JSON[_0xeefc('0x10')](_0x1dd76f));_0x1d8522(_0x1dd76f);})[_0xeefc('0x14')](function(_0x2b0350){logger['error'](_0xeefc('0x1f'),_0x2b0350[_0xeefc('0x13')],_0x29fc6b);_0xa0c512(_0x325578['error'](0x1f4,_0x2b0350[_0xeefc('0x13')]));});});};exports[_0xeefc('0x21')]=function(_0x59b608){var _0x4a9f8e=this;return new Promise(function(_0x45fa62,_0x2fcf80){return db[_0xeefc('0x15')][_0xeefc('0x22')](_0x59b608['body'],{'raw':_0x59b608[_0xeefc('0x17')]?_0x59b608['options'][_0xeefc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b608[_0xeefc('0x17')]?_0x59b608['options'][_0xeefc('0x23')]||null:null,'attributes':_0x59b608[_0xeefc('0x17')]?_0x59b608[_0xeefc('0x17')][_0xeefc('0x19')]||null:null,'limit':_0x59b608[_0xeefc('0x17')]?_0x59b608[_0xeefc('0x17')][_0xeefc('0x1a')]||null:null})[_0xeefc('0x1e')](function(_0x3bd245){logger[_0xeefc('0xc')]('UpdateMemberReport',_0x59b608);logger['debug']('UpdateMemberReport',_0x59b608,JSON[_0xeefc('0x10')](_0x3bd245));_0x45fa62(_0x3bd245);})[_0xeefc('0x14')](function(_0x378b57){logger[_0xeefc('0x11')]('UpdateMemberReport',_0x378b57[_0xeefc('0x13')],_0x59b608);_0x2fcf80(_0x4a9f8e[_0xeefc('0x11')](0x1f4,_0x378b57[_0xeefc('0x13')]));});});}; \ No newline at end of file +var _0x28b1=['model','debug','catch','CreateMemberReport','create','body','raw','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','GetMemberReport','MemberReport','findAll','options','attributes','include','map'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x28b1,0x1d6));var _0x128b=function(_0x331d09,_0x53f124){_0x331d09=_0x331d09-0x0;var _0x2013e8=_0x28b1[_0x331d09];return _0x2013e8;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var moment=require(_0x128b('0x2'));var BPromise=require('bluebird');var rs=require(_0x128b('0x3'));var fs=require('fs');var Redis=require(_0x128b('0x4'));var db=require(_0x128b('0x5'))['db'];var utils=require(_0x128b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x128b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x128b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59cd4f,_0xcd2ab0,_0x1af910){return new BPromise(function(_0x383c28,_0x2b7b08){return client[_0x128b('0x9')](_0x59cd4f,_0x1af910)[_0x128b('0xa')](function(_0x5b4709){logger['info'](_0x128b('0xb'),_0xcd2ab0,'request\x20sent');logger['debug'](_0x128b('0xc'),_0xcd2ab0,_0x128b('0xd'),JSON[_0x128b('0xe')](_0x5b4709));if(_0x5b4709[_0x128b('0xf')]){if(_0x5b4709[_0x128b('0xf')]['code']===0x1f4){logger[_0x128b('0xf')]('MemberReport,\x20%s,\x20%s',_0xcd2ab0,_0x5b4709[_0x128b('0xf')][_0x128b('0x10')]);return _0x2b7b08(_0x5b4709[_0x128b('0xf')][_0x128b('0x10')]);}logger[_0x128b('0xf')](_0x128b('0xb'),_0xcd2ab0,_0x5b4709[_0x128b('0xf')][_0x128b('0x10')]);return _0x383c28(_0x5b4709[_0x128b('0xf')][_0x128b('0x10')]);}else{logger[_0x128b('0x11')](_0x128b('0xb'),_0xcd2ab0,_0x128b('0xd'));_0x383c28(_0x5b4709['result']['message']);}})['catch'](function(_0x5de3f4){logger['error'](_0x128b('0xb'),_0xcd2ab0,_0x5de3f4);_0x2b7b08(_0x5de3f4);});});}exports[_0x128b('0x12')]=function(_0x2f04a5){var _0x13d62b=this;return new Promise(function(_0x4479f9,_0x5a78b6){return db[_0x128b('0x13')][_0x128b('0x14')]({'raw':_0x2f04a5[_0x128b('0x15')]?_0x2f04a5[_0x128b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2f04a5[_0x128b('0x15')]?_0x2f04a5[_0x128b('0x15')]['where']||null:null,'attributes':_0x2f04a5[_0x128b('0x15')]?_0x2f04a5['options'][_0x128b('0x16')]||null:null,'limit':_0x2f04a5[_0x128b('0x15')]?_0x2f04a5[_0x128b('0x15')]['limit']||null:null,'include':_0x2f04a5['options']?_0x2f04a5[_0x128b('0x15')][_0x128b('0x17')]?_[_0x128b('0x18')](_0x2f04a5[_0x128b('0x15')][_0x128b('0x17')],function(_0x215d4d){return{'model':db[_0x215d4d[_0x128b('0x19')]],'as':_0x215d4d['as'],'attributes':_0x215d4d['attributes'],'include':_0x215d4d['include']?_[_0x128b('0x18')](_0x215d4d[_0x128b('0x17')],function(_0x25bb95){return{'model':db[_0x25bb95[_0x128b('0x19')]],'as':_0x25bb95['as'],'attributes':_0x25bb95[_0x128b('0x16')],'include':_0x25bb95['include']?_['map'](_0x25bb95[_0x128b('0x17')],function(_0x3bb156){return{'model':db[_0x3bb156[_0x128b('0x19')]],'as':_0x3bb156['as'],'attributes':_0x3bb156['attributes']};}):[]};}):[]};}):[]:[]})[_0x128b('0xa')](function(_0xc0797a){logger['info'](_0x128b('0x12'),_0x2f04a5);logger[_0x128b('0x1a')](_0x128b('0x12'),_0x2f04a5,JSON[_0x128b('0xe')](_0xc0797a));_0x4479f9(_0xc0797a);})[_0x128b('0x1b')](function(_0xa2f5bb){logger[_0x128b('0xf')](_0x128b('0x12'),_0xa2f5bb[_0x128b('0x10')],_0x2f04a5);_0x5a78b6(_0x13d62b['error'](0x1f4,_0xa2f5bb[_0x128b('0x10')]));});});};exports[_0x128b('0x1c')]=function(_0x148945){var _0x145a6d=this;return new Promise(function(_0x593e23,_0x479e8a){return db['MemberReport'][_0x128b('0x1d')](_0x148945[_0x128b('0x1e')],{'raw':_0x148945[_0x128b('0x15')]?_0x148945[_0x128b('0x15')][_0x128b('0x1f')]===undefined?!![]:![]:!![]})[_0x128b('0xa')](function(_0x19ebe2){logger[_0x128b('0x11')](_0x128b('0x1c'),_0x148945);logger['debug']('CreateMemberReport',_0x148945,JSON['stringify'](_0x19ebe2));_0x593e23(_0x19ebe2);})[_0x128b('0x1b')](function(_0x5b041a){logger[_0x128b('0xf')](_0x128b('0x1c'),_0x5b041a[_0x128b('0x10')],_0x148945);_0x479e8a(_0x145a6d[_0x128b('0xf')](0x1f4,_0x5b041a[_0x128b('0x10')]));});});};exports['UpdateMemberReport']=function(_0x20ce1c){var _0x45a0c5=this;return new Promise(function(_0x4314e7,_0x27c82f){return db[_0x128b('0x13')]['update'](_0x20ce1c[_0x128b('0x1e')],{'raw':_0x20ce1c[_0x128b('0x15')]?_0x20ce1c[_0x128b('0x15')][_0x128b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ce1c['options']?_0x20ce1c[_0x128b('0x15')][_0x128b('0x20')]||null:null,'attributes':_0x20ce1c[_0x128b('0x15')]?_0x20ce1c[_0x128b('0x15')][_0x128b('0x16')]||null:null,'limit':_0x20ce1c[_0x128b('0x15')]?_0x20ce1c['options']['limit']||null:null})[_0x128b('0xa')](function(_0x326c2e){logger[_0x128b('0x11')]('UpdateMemberReport',_0x20ce1c);logger[_0x128b('0x1a')]('UpdateMemberReport',_0x20ce1c,JSON[_0x128b('0xe')](_0x326c2e));_0x4314e7(_0x326c2e);})[_0x128b('0x1b')](function(_0x4371c3){logger[_0x128b('0xf')]('UpdateMemberReport',_0x4371c3[_0x128b('0x10')],_0x20ce1c);_0x27c82f(_0x45a0c5[_0x128b('0xf')](0x1f4,_0x4371c3[_0x128b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6f03883..9fbd9d2 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 _0xd0b2=['../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x4f4ffa,_0x1040e9){var _0x16b61a=function(_0x54d99f){while(--_0x54d99f){_0x4f4ffa['push'](_0x4f4ffa['shift']());}};_0x16b61a(++_0x1040e9);}(_0xd0b2,0x96));var _0x2d0b=function(_0x3a6748,_0x1545d3){_0x3a6748=_0x3a6748-0x0;var _0x3ab514=_0xd0b2[_0x3a6748];return _0x3ab514;};'use strict';var multer=require(_0x2d0b('0x0'));var util=require(_0x2d0b('0x1'));var path=require(_0x2d0b('0x2'));var timeout=require(_0x2d0b('0x3'));var express=require(_0x2d0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d0b('0x5'));var interaction=require(_0x2d0b('0x6'));var config=require(_0x2d0b('0x7'));var controller=require(_0x2d0b('0x8'));router[_0x2d0b('0x9')]('/',controller[_0x2d0b('0xa')]);module[_0x2d0b('0xb')]=router; \ No newline at end of file +var _0x51b2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path'];(function(_0x3ad2e5,_0x94d414){var _0xc4e565=function(_0x2c96e3){while(--_0x2c96e3){_0x3ad2e5['push'](_0x3ad2e5['shift']());}};_0xc4e565(++_0x94d414);}(_0x51b2,0x150));var _0x251b=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0x51b2[_0x474c66];return _0xcbd9bf;};'use strict';var multer=require('multer');var util=require(_0x251b('0x0'));var path=require(_0x251b('0x1'));var timeout=require(_0x251b('0x2'));var express=require(_0x251b('0x3'));var router=express[_0x251b('0x4')]();var fs_extra=require(_0x251b('0x5'));var auth=require(_0x251b('0x6'));var interaction=require(_0x251b('0x7'));var config=require(_0x251b('0x8'));var controller=require(_0x251b('0x9'));router[_0x251b('0xa')]('/',controller[_0x251b('0xb')]);module[_0x251b('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ae206a0..7b9be4d 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 _0xecc8=['exports','STRING','version'];(function(_0x5584e0,_0x561225){var _0x3bec24=function(_0x5ded8a){while(--_0x5ded8a){_0x5584e0['push'](_0x5584e0['shift']());}};_0x3bec24(++_0x561225);}(_0xecc8,0x186));var _0x8ecc=function(_0x2a92d5,_0x46d690){_0x2a92d5=_0x2a92d5-0x0;var _0x4d4356=_0xecc8[_0x2a92d5];return _0x4d4356;};'use strict';var Sequelize=require('sequelize');module[_0x8ecc('0x0')]={'version':{'type':Sequelize[_0x8ecc('0x1')],'unique':_0x8ecc('0x2')}}; \ No newline at end of file +var _0xcf35=['exports','STRING','version','sequelize'];(function(_0x42ba8f,_0x2ceef9){var _0x56beee=function(_0x9d8094){while(--_0x9d8094){_0x42ba8f['push'](_0x42ba8f['shift']());}};_0x56beee(++_0x2ceef9);}(_0xcf35,0x1bf));var _0x5cf3=function(_0x5bcddc,_0x288f93){_0x5bcddc=_0x5bcddc-0x0;var _0x578229=_0xcf35[_0x5bcddc];return _0x578229;};'use strict';var Sequelize=require(_0x5cf3('0x0'));module[_0x5cf3('0x1')]={'version':{'type':Sequelize[_0x5cf3('0x2')],'unique':_0x5cf3('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 67e1ffd..dd9c853 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 _0x7c82=['name','send','index','map','Migration','rawAttributes','fieldName','query','keys','filters','attributes','intersection','model','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','Content-Range','apply','reject','update','then','sendStatus','stack'];(function(_0x703096,_0xd95aa0){var _0x334db9=function(_0x4288df){while(--_0x4288df){_0x703096['push'](_0x703096['shift']());}};_0x334db9(++_0xd95aa0);}(_0x7c82,0x16b));var _0x27c8=function(_0x247d6c,_0x5c40dd){_0x247d6c=_0x247d6c-0x0;var _0x598f3e=_0x7c82[_0x247d6c];return _0x598f3e;};'use strict';var emlformat=require(_0x27c8('0x0'));var rimraf=require(_0x27c8('0x1'));var zipdir=require(_0x27c8('0x2'));var jsonpatch=require(_0x27c8('0x3'));var rp=require(_0x27c8('0x4'));var moment=require(_0x27c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x27c8('0x6'));var util=require('util');var path=require(_0x27c8('0x7'));var sox=require(_0x27c8('0x8'));var csv=require(_0x27c8('0x9'));var ejs=require(_0x27c8('0xa'));var fs=require('fs');var fs_extra=require(_0x27c8('0xb'));var _=require(_0x27c8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27c8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x27c8('0xe'));var Papa=require(_0x27c8('0xf'));var Redis=require(_0x27c8('0x10'));var authService=require(_0x27c8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x27c8('0x12'));var hardwareService=require(_0x27c8('0x13'));var logger=require(_0x27c8('0x14'))(_0x27c8('0x15'));var utils=require(_0x27c8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x27c8('0x17'));var db=require(_0x27c8('0x18'))['db'];function respondWithStatusCode(_0x1b1d3d,_0x466b24){_0x466b24=_0x466b24||0xcc;return function(_0x58b251){if(_0x58b251){return _0x1b1d3d['sendStatus'](_0x466b24);}return _0x1b1d3d['status'](_0x466b24)[_0x27c8('0x19')]();};}function respondWithResult(_0x24b0b9,_0x3c6bcc){_0x3c6bcc=_0x3c6bcc||0xc8;return function(_0x1e4782){if(_0x1e4782){return _0x24b0b9['status'](_0x3c6bcc)[_0x27c8('0x1a')](_0x1e4782);}};}function respondWithFilteredResult(_0x14468c,_0x556088){return function(_0x595e2b){if(_0x595e2b){var _0x50dfec=typeof _0x556088['offset']===_0x27c8('0x1b')&&typeof _0x556088[_0x27c8('0x1c')]==='undefined';var _0x863aef=_0x595e2b[_0x27c8('0x1d')];var _0x2cf75b=_0x50dfec?0x0:_0x556088[_0x27c8('0x1e')];var _0x5066e3=_0x50dfec?_0x595e2b[_0x27c8('0x1d')]:_0x556088[_0x27c8('0x1e')]+_0x556088[_0x27c8('0x1c')];var _0x280bf3;if(_0x5066e3>=_0x863aef){_0x5066e3=_0x863aef;_0x280bf3=0xc8;}else{_0x280bf3=0xce;}_0x14468c[_0x27c8('0x1f')](_0x280bf3);return _0x14468c['set'](_0x27c8('0x20'),_0x2cf75b+'-'+_0x5066e3+'/'+_0x863aef)[_0x27c8('0x1a')](_0x595e2b);}return null;};}function patchUpdates(_0x4d32e3){return function(_0x180abd){try{jsonpatch[_0x27c8('0x21')](_0x180abd,_0x4d32e3,!![]);}catch(_0x9ca68f){return BPromise[_0x27c8('0x22')](_0x9ca68f);}return _0x180abd['save']();};}function saveUpdates(_0x53aee1,_0x245806){return function(_0x11b24e){if(_0x11b24e){return _0x11b24e[_0x27c8('0x23')](_0x53aee1)[_0x27c8('0x24')](function(_0x4604cc){return _0x4604cc;});}return null;};}function removeEntity(_0x34d0c2,_0x23d472){return function(_0x459fdc){if(_0x459fdc){return _0x459fdc['destroy']()[_0x27c8('0x24')](function(){_0x34d0c2[_0x27c8('0x1f')](0xcc)[_0x27c8('0x19')]();});}};}function handleEntityNotFound(_0x171a4a,_0x358fe1){return function(_0xb34ce4){if(!_0xb34ce4){_0x171a4a[_0x27c8('0x25')](0x194);}return _0xb34ce4;};}function handleError(_0x5c8b23,_0x344737){_0x344737=_0x344737||0x1f4;return function(_0x5e1e81){logger['error'](_0x5e1e81[_0x27c8('0x26')]);if(_0x5e1e81[_0x27c8('0x27')]){delete _0x5e1e81[_0x27c8('0x27')];}_0x5c8b23[_0x27c8('0x1f')](_0x344737)[_0x27c8('0x28')](_0x5e1e81);};}exports[_0x27c8('0x29')]=function(_0x5743a8,_0x3bc822){var _0x176c09={},_0x2f538c={},_0x145d12={'count':0x0,'rows':[]};var _0x3394b0=_[_0x27c8('0x2a')](db[_0x27c8('0x2b')][_0x27c8('0x2c')],function(_0x1d57d7){return{'name':_0x1d57d7[_0x27c8('0x2d')],'type':_0x1d57d7['type']['key']};});_0x2f538c['model']=_[_0x27c8('0x2a')](_0x3394b0,_0x27c8('0x27'));_0x2f538c[_0x27c8('0x2e')]=_[_0x27c8('0x2f')](_0x5743a8[_0x27c8('0x2e')]);_0x2f538c[_0x27c8('0x30')]=_['intersection'](_0x2f538c['model'],_0x2f538c[_0x27c8('0x2e')]);_0x176c09[_0x27c8('0x31')]=_[_0x27c8('0x32')](_0x2f538c[_0x27c8('0x33')],qs[_0x27c8('0x34')](_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x34')]));_0x176c09[_0x27c8('0x31')]=_0x176c09[_0x27c8('0x31')][_0x27c8('0x35')]?_0x176c09[_0x27c8('0x31')]:_0x2f538c[_0x27c8('0x33')];if(!_0x5743a8[_0x27c8('0x2e')]['hasOwnProperty'](_0x27c8('0x36'))){_0x176c09[_0x27c8('0x1c')]=qs[_0x27c8('0x1c')](_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x1c')]);_0x176c09['offset']=qs[_0x27c8('0x1e')](_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x1e')]);}_0x176c09['order']=qs[_0x27c8('0x37')](_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x37')]);_0x176c09[_0x27c8('0x38')]=qs[_0x27c8('0x30')](_[_0x27c8('0x39')](_0x5743a8[_0x27c8('0x2e')],_0x2f538c[_0x27c8('0x30')]),_0x3394b0);if(_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x3a')]){_0x176c09[_0x27c8('0x38')]=_['merge'](_0x176c09[_0x27c8('0x38')],{'$or':_[_0x27c8('0x2a')](_0x3394b0,function(_0x41e608){if(_0x41e608[_0x27c8('0x3b')]!==_0x27c8('0x3c')){var _0x5d3452={};_0x5d3452[_0x41e608[_0x27c8('0x27')]]={'$like':'%'+_0x5743a8['query'][_0x27c8('0x3a')]+'%'};return _0x5d3452;}})});}_0x176c09=_[_0x27c8('0x3d')]({},_0x176c09,_0x5743a8[_0x27c8('0x3e')]);var _0x24fbee={'where':_0x176c09[_0x27c8('0x38')]};return db['Migration']['count'](_0x24fbee)['then'](function(_0x116677){_0x145d12[_0x27c8('0x1d')]=_0x116677;if(_0x5743a8[_0x27c8('0x2e')][_0x27c8('0x3f')]){_0x176c09[_0x27c8('0x40')]=[{'all':!![]}];}return db[_0x27c8('0x2b')][_0x27c8('0x41')](_0x176c09);})['then'](function(_0x366ca8){_0x145d12[_0x27c8('0x42')]=_0x366ca8;return _0x145d12;})[_0x27c8('0x24')](respondWithFilteredResult(_0x3bc822,_0x176c09))['catch'](handleError(_0x3bc822,null));}; \ No newline at end of file +var _0x3150=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','stack','name','send','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','rimraf','zip-dir','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x2c33aa,_0x13f08d){var _0x46f89b=function(_0x34a68b){while(--_0x34a68b){_0x2c33aa['push'](_0x2c33aa['shift']());}};_0x46f89b(++_0x13f08d);}(_0x3150,0xab));var _0x0315=function(_0x16b77e,_0x4a56a3){_0x16b77e=_0x16b77e-0x0;var _0x3ae284=_0x3150[_0x16b77e];return _0x3ae284;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0315('0x0'));var zipdir=require(_0x0315('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0315('0x2'));var moment=require('moment');var BPromise=require(_0x0315('0x3'));var Mustache=require('mustache');var util=require(_0x0315('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x0315('0x5'));var ejs=require(_0x0315('0x6'));var fs=require('fs');var fs_extra=require(_0x0315('0x7'));var _=require(_0x0315('0x8'));var squel=require(_0x0315('0x9'));var crypto=require(_0x0315('0xa'));var jsforce=require(_0x0315('0xb'));var deskjs=require(_0x0315('0xc'));var toCsv=require(_0x0315('0x5'));var querystring=require(_0x0315('0xd'));var Papa=require('papaparse');var Redis=require(_0x0315('0xe'));var authService=require(_0x0315('0xf'));var qs=require(_0x0315('0x10'));var as=require(_0x0315('0x11'));var hardwareService=require(_0x0315('0x12'));var logger=require(_0x0315('0x13'))('api');var utils=require(_0x0315('0x14'));var config=require(_0x0315('0x15'));var licenseUtil=require(_0x0315('0x16'));var db=require(_0x0315('0x17'))['db'];function respondWithStatusCode(_0x5e5b66,_0x1e8ced){_0x1e8ced=_0x1e8ced||0xcc;return function(_0x3c7b64){if(_0x3c7b64){return _0x5e5b66[_0x0315('0x18')](_0x1e8ced);}return _0x5e5b66[_0x0315('0x19')](_0x1e8ced)[_0x0315('0x1a')]();};}function respondWithResult(_0x227742,_0x50f2f3){_0x50f2f3=_0x50f2f3||0xc8;return function(_0x5aa3de){if(_0x5aa3de){return _0x227742[_0x0315('0x19')](_0x50f2f3)[_0x0315('0x1b')](_0x5aa3de);}};}function respondWithFilteredResult(_0x4842ae,_0x110593){return function(_0xf59e32){if(_0xf59e32){var _0x44a44e=typeof _0x110593[_0x0315('0x1c')]===_0x0315('0x1d')&&typeof _0x110593['limit']===_0x0315('0x1d');var _0x41694b=_0xf59e32[_0x0315('0x1e')];var _0x1a5a0b=_0x44a44e?0x0:_0x110593[_0x0315('0x1c')];var _0x30690b=_0x44a44e?_0xf59e32[_0x0315('0x1e')]:_0x110593[_0x0315('0x1c')]+_0x110593[_0x0315('0x1f')];var _0x1a15eb;if(_0x30690b>=_0x41694b){_0x30690b=_0x41694b;_0x1a15eb=0xc8;}else{_0x1a15eb=0xce;}_0x4842ae[_0x0315('0x19')](_0x1a15eb);return _0x4842ae[_0x0315('0x20')]('Content-Range',_0x1a5a0b+'-'+_0x30690b+'/'+_0x41694b)[_0x0315('0x1b')](_0xf59e32);}return null;};}function patchUpdates(_0x3b2e60){return function(_0x3c3ff6){try{jsonpatch['apply'](_0x3c3ff6,_0x3b2e60,!![]);}catch(_0x4be6d3){return BPromise[_0x0315('0x21')](_0x4be6d3);}return _0x3c3ff6[_0x0315('0x22')]();};}function saveUpdates(_0x42371b,_0x4c2ab0){return function(_0x5e91c5){if(_0x5e91c5){return _0x5e91c5['update'](_0x42371b)[_0x0315('0x23')](function(_0x204e9d){return _0x204e9d;});}return null;};}function removeEntity(_0x3c3a86,_0x3cc6b4){return function(_0x3f791e){if(_0x3f791e){return _0x3f791e[_0x0315('0x24')]()[_0x0315('0x23')](function(){_0x3c3a86[_0x0315('0x19')](0xcc)[_0x0315('0x1a')]();});}};}function handleEntityNotFound(_0x1af935,_0x11d303){return function(_0x3851a5){if(!_0x3851a5){_0x1af935[_0x0315('0x18')](0x194);}return _0x3851a5;};}function handleError(_0xf627b5,_0x10e4af){_0x10e4af=_0x10e4af||0x1f4;return function(_0x27ee19){logger['error'](_0x27ee19[_0x0315('0x25')]);if(_0x27ee19['name']){delete _0x27ee19[_0x0315('0x26')];}_0xf627b5[_0x0315('0x19')](_0x10e4af)[_0x0315('0x27')](_0x27ee19);};}exports[_0x0315('0x28')]=function(_0x1855c7,_0x46bdf4){var _0x26f7f2={},_0x58a5d1={},_0xfa91bf={'count':0x0,'rows':[]};var _0x4c516f=_[_0x0315('0x29')](db[_0x0315('0x2a')]['rawAttributes'],function(_0x4e4e41){return{'name':_0x4e4e41[_0x0315('0x2b')],'type':_0x4e4e41[_0x0315('0x2c')][_0x0315('0x2d')]};});_0x58a5d1[_0x0315('0x2e')]=_[_0x0315('0x29')](_0x4c516f,_0x0315('0x26'));_0x58a5d1[_0x0315('0x2f')]=_['keys'](_0x1855c7[_0x0315('0x2f')]);_0x58a5d1[_0x0315('0x30')]=_[_0x0315('0x31')](_0x58a5d1['model'],_0x58a5d1[_0x0315('0x2f')]);_0x26f7f2[_0x0315('0x32')]=_[_0x0315('0x31')](_0x58a5d1[_0x0315('0x2e')],qs['fields'](_0x1855c7[_0x0315('0x2f')][_0x0315('0x33')]));_0x26f7f2[_0x0315('0x32')]=_0x26f7f2[_0x0315('0x32')]['length']?_0x26f7f2[_0x0315('0x32')]:_0x58a5d1[_0x0315('0x2e')];if(!_0x1855c7[_0x0315('0x2f')][_0x0315('0x34')](_0x0315('0x35'))){_0x26f7f2[_0x0315('0x1f')]=qs[_0x0315('0x1f')](_0x1855c7[_0x0315('0x2f')][_0x0315('0x1f')]);_0x26f7f2[_0x0315('0x1c')]=qs[_0x0315('0x1c')](_0x1855c7[_0x0315('0x2f')][_0x0315('0x1c')]);}_0x26f7f2[_0x0315('0x36')]=qs[_0x0315('0x37')](_0x1855c7['query'][_0x0315('0x37')]);_0x26f7f2[_0x0315('0x38')]=qs[_0x0315('0x30')](_['pick'](_0x1855c7['query'],_0x58a5d1['filters']),_0x4c516f);if(_0x1855c7[_0x0315('0x2f')][_0x0315('0x39')]){_0x26f7f2['where']=_[_0x0315('0x3a')](_0x26f7f2['where'],{'$or':_[_0x0315('0x29')](_0x4c516f,function(_0x3a0f25){if(_0x3a0f25['type']!=='VIRTUAL'){var _0x5c9266={};_0x5c9266[_0x3a0f25[_0x0315('0x26')]]={'$like':'%'+_0x1855c7[_0x0315('0x2f')][_0x0315('0x39')]+'%'};return _0x5c9266;}})});}_0x26f7f2=_[_0x0315('0x3a')]({},_0x26f7f2,_0x1855c7[_0x0315('0x3b')]);var _0x243d7e={'where':_0x26f7f2[_0x0315('0x38')]};return db[_0x0315('0x2a')][_0x0315('0x1e')](_0x243d7e)[_0x0315('0x23')](function(_0x56daaf){_0xfa91bf[_0x0315('0x1e')]=_0x56daaf;if(_0x1855c7['query'][_0x0315('0x3c')]){_0x26f7f2['include']=[{'all':!![]}];}return db['Migration'][_0x0315('0x3d')](_0x26f7f2);})['then'](function(_0x1bbfdd){_0xfa91bf[_0x0315('0x3e')]=_0x1bbfdd;return _0xfa91bf;})[_0x0315('0x23')](respondWithFilteredResult(_0x46bdf4,_0x26f7f2))[_0x0315('0x3f')](handleError(_0x46bdf4,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e4e67a0..41489b7 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 _0x01bc=['bluebird','path','rimraf','Migration','migrations','util','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01bc,0x101));var _0xc01b=function(_0xbc4304,_0x1c8343){_0xbc4304=_0xbc4304-0x0;var _0xc6d549=_0x01bc[_0xbc4304];return _0xc6d549;};'use strict';var _=require('lodash');var util=require(_0xc01b('0x0'));var logger=require('../../config/logger')(_0xc01b('0x1'));var moment=require('moment');var BPromise=require(_0xc01b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc01b('0x3'));var rimraf=require(_0xc01b('0x4'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x56e82b,_0x90a7ed){return _0x56e82b['define'](_0xc01b('0x5'),attributes,{'tableName':_0xc01b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbbc=['define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0xfbbc,0x12c));var _0xcfbb=function(_0xd827cc,_0x1db53c){_0xd827cc=_0xd827cc-0x0;var _0x121538=_0xfbbc[_0xd827cc];return _0x121538;};'use strict';var _=require(_0xcfbb('0x0'));var util=require(_0xcfbb('0x1'));var logger=require(_0xcfbb('0x2'))(_0xcfbb('0x3'));var moment=require(_0xcfbb('0x4'));var BPromise=require(_0xcfbb('0x5'));var rp=require(_0xcfbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfbb('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0xd4e3c6,_0x749819){return _0xd4e3c6[_0xcfbb('0x8')](_0xcfbb('0x9'),attributes,{'tableName':_0xcfbb('0xa'),'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 87fea7a..2fa17e2 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 _0x593e=['then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2d258c,_0x612e74){var _0x275d40=function(_0x1a5c9a){while(--_0x1a5c9a){_0x2d258c['push'](_0x2d258c['shift']());}};_0x275d40(++_0x612e74);}(_0x593e,0xcb));var _0xe593=function(_0x343fd2,_0x112d0e){_0x343fd2=_0x343fd2-0x0;var _0x450d30=_0x593e[_0x343fd2];return _0x450d30;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('Migration,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('Migration,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('Migration,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('Migration,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});} \ No newline at end of file +var _0x0d74=['error','code','message','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x21090f,_0x5b73cc){var _0x5cbfe7=function(_0x49e2b9){while(--_0x49e2b9){_0x21090f['push'](_0x21090f['shift']());}};_0x5cbfe7(++_0x5b73cc);}(_0x0d74,0x146));var _0x40d7=function(_0x5ea908,_0x1dae33){_0x5ea908=_0x5ea908-0x0;var _0x2d7bb4=_0x0d74[_0x5ea908];return _0x2d7bb4;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504d2a,_0x416c83,_0x5b9b25){return new BPromise(function(_0x4644a3,_0xa80f32){return client['request'](_0x504d2a,_0x5b9b25)[_0x40d7('0x8')](function(_0x13328b){logger[_0x40d7('0x9')](_0x40d7('0xa'),_0x416c83,_0x40d7('0xb'));logger[_0x40d7('0xc')]('Migration,\x20%s,\x20%s,\x20%s',_0x416c83,_0x40d7('0xb'),JSON[_0x40d7('0xd')](_0x13328b));if(_0x13328b[_0x40d7('0xe')]){if(_0x13328b[_0x40d7('0xe')][_0x40d7('0xf')]===0x1f4){logger['error'](_0x40d7('0xa'),_0x416c83,_0x13328b[_0x40d7('0xe')][_0x40d7('0x10')]);return _0xa80f32(_0x13328b[_0x40d7('0xe')]['message']);}logger[_0x40d7('0xe')](_0x40d7('0xa'),_0x416c83,_0x13328b[_0x40d7('0xe')][_0x40d7('0x10')]);return _0x4644a3(_0x13328b[_0x40d7('0xe')][_0x40d7('0x10')]);}else{logger[_0x40d7('0x9')](_0x40d7('0xa'),_0x416c83,_0x40d7('0xb'));_0x4644a3(_0x13328b['result']['message']);}})['catch'](function(_0x3810f9){logger[_0x40d7('0xe')]('Migration,\x20%s,\x20%s',_0x416c83,_0x3810f9);_0xa80f32(_0x3810f9);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 8c606c8..b922303 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 _0x5cc3=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x302266,_0x558705){var _0x21b390=function(_0x4e02aa){while(--_0x4e02aa){_0x302266['push'](_0x302266['shift']());}};_0x21b390(++_0x558705);}(_0x5cc3,0x144));var _0x35cc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5cc3[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x35cc('0x0'));var util=require(_0x35cc('0x1'));var path=require(_0x35cc('0x2'));var timeout=require(_0x35cc('0x3'));var express=require(_0x35cc('0x4'));var router=express[_0x35cc('0x5')]();var fs_extra=require(_0x35cc('0x6'));var auth=require(_0x35cc('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35cc('0x8'));router[_0x35cc('0x9')]('/',auth[_0x35cc('0xa')](),controller[_0x35cc('0xb')]);router[_0x35cc('0x9')](_0x35cc('0xc'),auth[_0x35cc('0xa')](),controller[_0x35cc('0xd')]);router[_0x35cc('0xe')]('/',auth[_0x35cc('0xa')](),controller[_0x35cc('0xf')]);router[_0x35cc('0x10')](_0x35cc('0xc'),auth[_0x35cc('0xa')](),controller['update']);router['delete'](_0x35cc('0xc'),auth[_0x35cc('0xa')](),controller[_0x35cc('0x11')]);module[_0x35cc('0x12')]=router; \ No newline at end of file +var _0x9797=['show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x55879b,_0x14821a){var _0x90e09c=function(_0x190681){while(--_0x190681){_0x55879b['push'](_0x55879b['shift']());}};_0x90e09c(++_0x14821a);}(_0x9797,0x1c9));var _0x7979=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x9797[_0x36a469];return _0x3347fc;};'use strict';var multer=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var path=require(_0x7979('0x2'));var timeout=require('connect-timeout');var express=require(_0x7979('0x3'));var router=express[_0x7979('0x4')]();var fs_extra=require(_0x7979('0x5'));var auth=require(_0x7979('0x6'));var interaction=require(_0x7979('0x7'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x7979('0x8')]('/',auth[_0x7979('0x9')](),controller[_0x7979('0xa')]);router[_0x7979('0x8')]('/:id',auth[_0x7979('0x9')](),controller[_0x7979('0xb')]);router[_0x7979('0xc')]('/',auth[_0x7979('0x9')](),controller[_0x7979('0xd')]);router['put']('/:id',auth[_0x7979('0x9')](),controller[_0x7979('0xe')]);router[_0x7979('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7979('0x10')]);module[_0x7979('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 4046f0e..9e370c3 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 _0x0abd=['sequelize','localnet','stun','turn','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0abd,0xaa));var _0xd0ab=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0x0abd[_0x5cabfd];return _0x4bc06c;};'use strict';var Sequelize=require(_0xd0ab('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xd0ab('0x1'),'externip',_0xd0ab('0x2'),_0xd0ab('0x3'))},'value':{'type':Sequelize[_0xd0ab('0x4')]},'username':{'type':Sequelize[_0xd0ab('0x4')]},'password':{'type':Sequelize[_0xd0ab('0x4')]}}; \ No newline at end of file +var _0x49a4=['exports','ENUM','stun','STRING','sequelize'];(function(_0x1f0a8f,_0x4c1038){var _0x1f3885=function(_0x4dfe12){while(--_0x4dfe12){_0x1f0a8f['push'](_0x1f0a8f['shift']());}};_0x1f3885(++_0x4c1038);}(_0x49a4,0xf9));var _0x449a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49a4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x449a('0x0'));module[_0x449a('0x1')]={'type':{'type':Sequelize[_0x449a('0x2')]('localnet','externip',_0x449a('0x3'),'turn')},'value':{'type':Sequelize[_0x449a('0x4')]},'username':{'type':Sequelize[_0x449a('0x4')]},'password':{'type':Sequelize[_0x449a('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index abcf7d0..4ebfb32 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 _0x149c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','sequelize','transaction','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','STUN','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0x149c,0x143));var _0xc149=function(_0x5d2217,_0x22e601){_0x5d2217=_0x5d2217-0x0;var _0x3f1817=_0x149c[_0x5d2217];return _0x3f1817;};'use strict';var emlformat=require(_0xc149('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc149('0x1'));var jsonpatch=require(_0xc149('0x2'));var rp=require(_0xc149('0x3'));var moment=require('moment');var BPromise=require(_0xc149('0x4'));var Mustache=require(_0xc149('0x5'));var util=require(_0xc149('0x6'));var path=require(_0xc149('0x7'));var sox=require(_0xc149('0x8'));var csv=require(_0xc149('0x9'));var ejs=require(_0xc149('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc149('0xb'));var crypto=require(_0xc149('0xc'));var jsforce=require(_0xc149('0xd'));var deskjs=require(_0xc149('0xe'));var toCsv=require(_0xc149('0x9'));var querystring=require(_0xc149('0xf'));var Papa=require(_0xc149('0x10'));var Redis=require(_0xc149('0x11'));var authService=require(_0xc149('0x12'));var qs=require(_0xc149('0x13'));var as=require(_0xc149('0x14'));var hardwareService=require(_0xc149('0x15'));var logger=require(_0xc149('0x16'))(_0xc149('0x17'));var utils=require(_0xc149('0x18'));var config=require(_0xc149('0x19'));var licenseUtil=require(_0xc149('0x1a'));var db=require(_0xc149('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc149('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9e8a0c,_0x4c7f46,_0x11aec6,_0x468eec){return new BPromise(function(_0x5e8968,_0x533010){var _0x9dd0b=_0x468eec||client;return _0x9dd0b[_0xc149('0x1d')](_0x9e8a0c,_0x11aec6)[_0xc149('0x1e')](function(_0x453aa3){logger[_0xc149('0x1f')](_0xc149('0x20'),_0x4c7f46,'request\x20sent');logger[_0xc149('0x21')](_0xc149('0x22'),_0x4c7f46,_0xc149('0x23'),JSON[_0xc149('0x24')](_0x453aa3));if(_0x453aa3[_0xc149('0x25')]){if(_0x453aa3['error'][_0xc149('0x26')]===0x1f4){logger[_0xc149('0x25')](_0xc149('0x20'),_0x4c7f46,_0x453aa3[_0xc149('0x25')][_0xc149('0x27')]);return _0x533010(_0x453aa3[_0xc149('0x25')]['message']);}logger[_0xc149('0x25')](_0xc149('0x20'),_0x4c7f46,_0x453aa3['error']['message']);return _0x5e8968(_0x453aa3[_0xc149('0x25')][_0xc149('0x27')]);}else{logger[_0xc149('0x1f')](_0xc149('0x20'),_0x4c7f46,_0xc149('0x23'));_0x5e8968(_0x453aa3[_0xc149('0x28')][_0xc149('0x27')]);}})['catch'](function(_0x50ed2e){logger[_0xc149('0x25')]('Network,\x20%s,\x20%s',_0x4c7f46,_0x50ed2e);_0x533010(_0x50ed2e);});});}function respondWithStatusCode(_0x5cdb4b,_0xb4ea4f){_0xb4ea4f=_0xb4ea4f||0xcc;return function(_0x5b7033){if(_0x5b7033){return _0x5cdb4b[_0xc149('0x29')](_0xb4ea4f);}return _0x5cdb4b['status'](_0xb4ea4f)[_0xc149('0x2a')]();};}function respondWithResult(_0x36a85f,_0x1e08e3){_0x1e08e3=_0x1e08e3||0xc8;return function(_0xe2eae0){if(_0xe2eae0){return _0x36a85f[_0xc149('0x2b')](_0x1e08e3)[_0xc149('0x2c')](_0xe2eae0);}};}function respondWithFilteredResult(_0x1a5872,_0x5004c7){return function(_0x2d2700){if(_0x2d2700){var _0x4b2151=typeof _0x5004c7[_0xc149('0x2d')]===_0xc149('0x2e')&&typeof _0x5004c7[_0xc149('0x2f')]===_0xc149('0x2e');var _0x5d4a66=_0x2d2700[_0xc149('0x30')];var _0x401dc3=_0x4b2151?0x0:_0x5004c7[_0xc149('0x2d')];var _0x473869=_0x4b2151?_0x2d2700[_0xc149('0x30')]:_0x5004c7[_0xc149('0x2d')]+_0x5004c7['limit'];var _0x7b9227;if(_0x473869>=_0x5d4a66){_0x473869=_0x5d4a66;_0x7b9227=0xc8;}else{_0x7b9227=0xce;}_0x1a5872[_0xc149('0x2b')](_0x7b9227);return _0x1a5872['set'](_0xc149('0x31'),_0x401dc3+'-'+_0x473869+'/'+_0x5d4a66)['json'](_0x2d2700);}return null;};}function patchUpdates(_0x149ddc){return function(_0x3ebc1f){try{jsonpatch[_0xc149('0x32')](_0x3ebc1f,_0x149ddc,!![]);}catch(_0x19f130){return BPromise[_0xc149('0x33')](_0x19f130);}return _0x3ebc1f[_0xc149('0x34')]();};}function saveUpdates(_0x46027c,_0x2025d6){return function(_0x466fa8){if(_0x466fa8){return _0x466fa8['update'](_0x46027c)[_0xc149('0x1e')](function(_0x3caaa0){return _0x3caaa0;});}return null;};}function removeEntity(_0x479c36,_0x3f23c0){return function(_0x3652b3){if(_0x3652b3){return _0x3652b3[_0xc149('0x35')]()['then'](function(){_0x479c36[_0xc149('0x2b')](0xcc)[_0xc149('0x2a')]();});}};}function handleEntityNotFound(_0x3df729,_0x137646){return function(_0x402c70){if(!_0x402c70){_0x3df729['sendStatus'](0x194);}return _0x402c70;};}function handleError(_0x5c3f31,_0x464787){_0x464787=_0x464787||0x1f4;return function(_0x5b83e2){logger[_0xc149('0x25')](_0x5b83e2[_0xc149('0x36')]);if(_0x5b83e2[_0xc149('0x37')]){delete _0x5b83e2[_0xc149('0x37')];}_0x5c3f31[_0xc149('0x2b')](_0x464787)[_0xc149('0x38')](_0x5b83e2);};}exports[_0xc149('0x39')]=function(_0x26151c,_0x134c56){var _0x3505fa={},_0x5c26d1={},_0x1b361e={'count':0x0,'rows':[]};var _0x2c396d=_[_0xc149('0x3a')](db[_0xc149('0x3b')][_0xc149('0x3c')],function(_0x22ec68){return{'name':_0x22ec68[_0xc149('0x3d')],'type':_0x22ec68[_0xc149('0x3e')][_0xc149('0x3f')]};});_0x5c26d1[_0xc149('0x40')]=_['map'](_0x2c396d,_0xc149('0x37'));_0x5c26d1['query']=_['keys'](_0x26151c['query']);_0x5c26d1['filters']=_[_0xc149('0x41')](_0x5c26d1[_0xc149('0x40')],_0x5c26d1[_0xc149('0x42')]);_0x3505fa[_0xc149('0x43')]=_[_0xc149('0x41')](_0x5c26d1[_0xc149('0x40')],qs[_0xc149('0x44')](_0x26151c[_0xc149('0x42')]['fields']));_0x3505fa[_0xc149('0x43')]=_0x3505fa[_0xc149('0x43')][_0xc149('0x45')]?_0x3505fa['attributes']:_0x5c26d1[_0xc149('0x40')];if(!_0x26151c[_0xc149('0x42')][_0xc149('0x46')](_0xc149('0x47'))){_0x3505fa['limit']=qs[_0xc149('0x2f')](_0x26151c[_0xc149('0x42')][_0xc149('0x2f')]);_0x3505fa[_0xc149('0x2d')]=qs[_0xc149('0x2d')](_0x26151c['query'][_0xc149('0x2d')]);}_0x3505fa[_0xc149('0x48')]=qs[_0xc149('0x49')](_0x26151c[_0xc149('0x42')][_0xc149('0x49')]);_0x3505fa['where']=qs[_0xc149('0x4a')](_[_0xc149('0x4b')](_0x26151c[_0xc149('0x42')],_0x5c26d1[_0xc149('0x4a')]),_0x2c396d);if(_0x26151c[_0xc149('0x42')][_0xc149('0x4c')]){_0x3505fa[_0xc149('0x4d')]=_[_0xc149('0x4e')](_0x3505fa['where'],{'$or':_[_0xc149('0x3a')](_0x2c396d,function(_0x4629d9){if(_0x4629d9['type']!=='VIRTUAL'){var _0x43a41b={};_0x43a41b[_0x4629d9[_0xc149('0x37')]]={'$like':'%'+_0x26151c['query'][_0xc149('0x4c')]+'%'};return _0x43a41b;}})});}_0x3505fa=_[_0xc149('0x4e')]({},_0x3505fa,_0x26151c[_0xc149('0x4f')]);var _0x2ecb3c={'where':_0x3505fa['where']};return db[_0xc149('0x3b')][_0xc149('0x30')](_0x2ecb3c)[_0xc149('0x1e')](function(_0x234f28){_0x1b361e[_0xc149('0x30')]=_0x234f28;if(_0x26151c['query'][_0xc149('0x50')]){_0x3505fa[_0xc149('0x51')]=[{'all':!![]}];}return db[_0xc149('0x3b')][_0xc149('0x52')](_0x3505fa);})[_0xc149('0x1e')](function(_0xf9c349){_0x1b361e[_0xc149('0x53')]=_0xf9c349;return _0x1b361e;})['then'](respondWithFilteredResult(_0x134c56,_0x3505fa))[_0xc149('0x54')](handleError(_0x134c56,null));};exports[_0xc149('0x55')]=function(_0x54bde8,_0x1d94ae){var _0x429b11={'raw':!![],'where':{'id':_0x54bde8[_0xc149('0x56')]['id']}},_0x5c2f59={};_0x5c2f59[_0xc149('0x40')]=_['keys'](db[_0xc149('0x3b')][_0xc149('0x3c')]);_0x5c2f59[_0xc149('0x42')]=_[_0xc149('0x57')](_0x54bde8[_0xc149('0x42')]);_0x5c2f59[_0xc149('0x4a')]=_[_0xc149('0x41')](_0x5c2f59[_0xc149('0x40')],_0x5c2f59[_0xc149('0x42')]);_0x429b11[_0xc149('0x43')]=_[_0xc149('0x41')](_0x5c2f59[_0xc149('0x40')],qs[_0xc149('0x44')](_0x54bde8[_0xc149('0x42')][_0xc149('0x44')]));_0x429b11['attributes']=_0x429b11['attributes']['length']?_0x429b11[_0xc149('0x43')]:_0x5c2f59[_0xc149('0x40')];if(_0x54bde8[_0xc149('0x42')]['includeAll']){_0x429b11[_0xc149('0x51')]=[{'all':!![]}];}_0x429b11=_[_0xc149('0x4e')]({},_0x429b11,_0x54bde8[_0xc149('0x4f')]);return db[_0xc149('0x3b')][_0xc149('0x58')](_0x429b11)['then'](handleEntityNotFound(_0x1d94ae,null))[_0xc149('0x1e')](respondWithResult(_0x1d94ae,null))['catch'](handleError(_0x1d94ae,null));};exports['create']=function(_0x44da9b,_0x1b34af,_0x870cce){var _0x433447;return db[_0xc149('0x59')][_0xc149('0x5a')](function(_0x51b14e){return db[_0xc149('0x3b')][_0xc149('0x5b')](_0x44da9b[_0xc149('0x5c')],{'raw':!![]})['then'](function(_0x279b3f){_0x433447=_0x279b3f;return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x44da9b[_0xc149('0x5c')][_0xc149('0x3e')]},'raw':!![]});})['then'](function(_0x327e89){if(_0x433447[_0xc149('0x3e')][_0xc149('0x5d')]()=='STUN'){var _0x3b6255=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x61')),'utf8');var _0xca903c=ejs[_0xc149('0x62')](_0x3b6255,{'networks':_0x327e89||[]});fs[_0xc149('0x63')](_0xc149('0x64'),_0xca903c);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x5b'),{'module':_0xc149('0x66')});}else if(_0x433447[_0xc149('0x3e')]['toUpperCase']()==_0xc149('0x67')){var _0x4ae8be=fs['readFileSync'](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x68')),_0xc149('0x69'));var _0x51a943=ejs[_0xc149('0x62')](_0x4ae8be,{'networks':_0x327e89||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x51a943);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x5b'),{'module':_0xc149('0x66')});}else{var _0x324b42=fs[_0xc149('0x5e')](path['join'](config[_0xc149('0x60')],_0xc149('0x6b')),_0xc149('0x69'));var _0x4f086b=ejs[_0xc149('0x62')](_0x324b42,{'networks':_0x327e89||[]});fs['writeFileSync'](util[_0xc149('0x6c')](_0xc149('0x6d'),_0x44da9b[_0xc149('0x5c')]['type'][_0xc149('0x6e')]()),_0x4f086b);return respondWithRpcPromise(_0xc149('0x65'),'create',{'module':_0xc149('0x6f')});}return null;})['then'](function(){return _0x433447;});})['then'](respondWithResult(_0x1b34af,0xc9))[_0xc149('0x54')](handleError(_0x1b34af,null));};exports[_0xc149('0x70')]=function(_0x3f2cd7,_0x531a2c,_0x28958a){var _0x2feeff;return db[_0xc149('0x59')]['transaction'](function(_0x4b3225){return db[_0xc149('0x3b')][_0xc149('0x58')]({'where':{'id':_0x3f2cd7['params']['id']}})[_0xc149('0x1e')](handleEntityNotFound(_0x531a2c,null))[_0xc149('0x1e')](saveUpdates(_0x3f2cd7[_0xc149('0x5c')],null))[_0xc149('0x1e')](function(_0x592e28){if(_0x592e28){_0x2feeff=_0x592e28;return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x2feeff[_0xc149('0x3e')]},'raw':!![]});}return null;})[_0xc149('0x1e')](function(_0x31b96d){if(_0x2feeff[_0xc149('0x3e')][_0xc149('0x5d')]()==_0xc149('0x71')){var _0x18e891=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x39535c=ejs['render'](_0x18e891,{'networks':_0x31b96d||[]});fs[_0xc149('0x63')](_0xc149('0x64'),_0x39535c);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x70'),{'module':_0xc149('0x66')});}else if(_0x2feeff[_0xc149('0x3e')][_0xc149('0x5d')]()==_0xc149('0x67')){var _0x4ad74c=fs['readFileSync'](path['join'](config['root'],_0xc149('0x68')),_0xc149('0x69'));var _0x842463=ejs[_0xc149('0x62')](_0x4ad74c,{'networks':_0x31b96d||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x842463);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x70'),{'module':'res_stun_monitor.so'});}else{var _0x1d50f1=fs['readFileSync'](path['join'](config[_0xc149('0x60')],'server/files/templates/network.ejs'),_0xc149('0x69'));var _0x42f65d=ejs[_0xc149('0x62')](_0x1d50f1,{'networks':_0x31b96d||[]});fs['writeFileSync'](util[_0xc149('0x6c')](_0xc149('0x6d'),_0x3f2cd7[_0xc149('0x5c')][_0xc149('0x3e')][_0xc149('0x6e')]()),_0x42f65d);return respondWithRpcPromise('Reload',_0xc149('0x70'),{'module':_0xc149('0x6f')});}return null;})[_0xc149('0x1e')](function(_0x3922b1){if(_0x3922b1){return _0x2feeff;}return null;});})['then'](respondWithResult(_0x531a2c,null))[_0xc149('0x54')](handleError(_0x531a2c,null));};exports[_0xc149('0x35')]=function(_0x305ddc,_0x556a05,_0x11a935){var _0x19d68b;return db[_0xc149('0x3b')][_0xc149('0x58')]({'where':{'id':_0x305ddc[_0xc149('0x56')]['id']}})['then'](function(_0x5c2560){_0x19d68b=_0x5c2560;return _0x5c2560;})[_0xc149('0x1e')](handleEntityNotFound(_0x556a05,null))['then'](removeEntity(_0x556a05,null))[_0xc149('0x1e')](function(){if(_0x19d68b){return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x19d68b[_0xc149('0x3e')]},'raw':!![]});}})[_0xc149('0x1e')](function(_0x4dd549){if(_0x19d68b[_0xc149('0x3e')]['toUpperCase']()==_0xc149('0x71')){var _0x4ea8fc=fs['readFileSync'](path['join'](config['root'],_0xc149('0x61')),_0xc149('0x69'));var _0x3f530b=ejs['render'](_0x4ea8fc,{'networks':_0x4dd549||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x3f530b);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x35'),{'module':_0xc149('0x66')});}else if(_0x19d68b[_0xc149('0x3e')][_0xc149('0x5d')]()=='TURN'){var _0x2763dc=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x68')),'utf8');var _0x16a099=ejs[_0xc149('0x62')](_0x2763dc,{'networks':_0x4dd549||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x16a099);return respondWithRpcPromise('Reload','destroy',{'module':_0xc149('0x66')});}else{var _0x31c5d8=fs['readFileSync'](path['join'](config['root'],_0xc149('0x6b')),_0xc149('0x69'));var _0x27c581=ejs['render'](_0x31c5d8,{'networks':_0x4dd549||[]});fs['writeFileSync'](util[_0xc149('0x6c')]('/etc/asterisk/sip_xcally_%s.conf',_0x305ddc[_0xc149('0x5c')][_0xc149('0x3e')][_0xc149('0x6e')]()),_0x27c581);return respondWithRpcPromise('Reload',_0xc149('0x35'),{'module':_0xc149('0x6f')});}return null;})[_0xc149('0x54')](handleError(_0x556a05,null));}; \ No newline at end of file +var _0xacaf=['STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','res_stun_monitor.so','toUpperCase','root','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','catch','server/files/templates/turn_multiple.ejs','toLowerCase','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','undefined','count','offset','limit','Content-Range','reject','save','update','destroy','stack','name','send','index','Network','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','sequelize','transaction','body'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0xacaf,0x152));var _0xfaca=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0xacaf[_0x200827];return _0x120047;};'use strict';var emlformat=require(_0xfaca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfaca('0x1'));var jsonpatch=require(_0xfaca('0x2'));var rp=require(_0xfaca('0x3'));var moment=require(_0xfaca('0x4'));var BPromise=require(_0xfaca('0x5'));var Mustache=require('mustache');var util=require(_0xfaca('0x6'));var path=require(_0xfaca('0x7'));var sox=require(_0xfaca('0x8'));var csv=require(_0xfaca('0x9'));var ejs=require(_0xfaca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaca('0xb'));var squel=require(_0xfaca('0xc'));var crypto=require(_0xfaca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfaca('0xe'));var toCsv=require(_0xfaca('0x9'));var querystring=require(_0xfaca('0xf'));var Papa=require(_0xfaca('0x10'));var Redis=require(_0xfaca('0x11'));var authService=require(_0xfaca('0x12'));var qs=require(_0xfaca('0x13'));var as=require(_0xfaca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaca('0x15'))('api');var utils=require(_0xfaca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfaca('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfaca('0x18'));var client=jayson[_0xfaca('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1b8b,_0x33b329,_0x5e48ba,_0x2c2a65){return new BPromise(function(_0x1ad876,_0x3b5de8){var _0x409c5a=_0x2c2a65||client;return _0x409c5a[_0xfaca('0x1a')](_0x5d1b8b,_0x5e48ba)[_0xfaca('0x1b')](function(_0xaf4e90){logger[_0xfaca('0x1c')](_0xfaca('0x1d'),_0x33b329,_0xfaca('0x1e'));logger['debug'](_0xfaca('0x1f'),_0x33b329,_0xfaca('0x1e'),JSON[_0xfaca('0x20')](_0xaf4e90));if(_0xaf4e90[_0xfaca('0x21')]){if(_0xaf4e90['error']['code']===0x1f4){logger[_0xfaca('0x21')](_0xfaca('0x1d'),_0x33b329,_0xaf4e90[_0xfaca('0x21')][_0xfaca('0x22')]);return _0x3b5de8(_0xaf4e90['error']['message']);}logger[_0xfaca('0x21')]('Network,\x20%s,\x20%s',_0x33b329,_0xaf4e90['error'][_0xfaca('0x22')]);return _0x1ad876(_0xaf4e90[_0xfaca('0x21')][_0xfaca('0x22')]);}else{logger['info'](_0xfaca('0x1d'),_0x33b329,_0xfaca('0x1e'));_0x1ad876(_0xaf4e90[_0xfaca('0x23')][_0xfaca('0x22')]);}})['catch'](function(_0x3d90c1){logger[_0xfaca('0x21')](_0xfaca('0x1d'),_0x33b329,_0x3d90c1);_0x3b5de8(_0x3d90c1);});});}function respondWithStatusCode(_0x43221b,_0x4e7aec){_0x4e7aec=_0x4e7aec||0xcc;return function(_0x4c37ae){if(_0x4c37ae){return _0x43221b[_0xfaca('0x24')](_0x4e7aec);}return _0x43221b[_0xfaca('0x25')](_0x4e7aec)[_0xfaca('0x26')]();};}function respondWithResult(_0x4d2e29,_0x517c1e){_0x517c1e=_0x517c1e||0xc8;return function(_0x337331){if(_0x337331){return _0x4d2e29[_0xfaca('0x25')](_0x517c1e)['json'](_0x337331);}};}function respondWithFilteredResult(_0x569d9b,_0x2fa711){return function(_0x16b051){if(_0x16b051){var _0x4ad79a=typeof _0x2fa711['offset']===_0xfaca('0x27')&&typeof _0x2fa711['limit']===_0xfaca('0x27');var _0x21e952=_0x16b051[_0xfaca('0x28')];var _0x56d4ca=_0x4ad79a?0x0:_0x2fa711[_0xfaca('0x29')];var _0x353903=_0x4ad79a?_0x16b051[_0xfaca('0x28')]:_0x2fa711[_0xfaca('0x29')]+_0x2fa711[_0xfaca('0x2a')];var _0x558e17;if(_0x353903>=_0x21e952){_0x353903=_0x21e952;_0x558e17=0xc8;}else{_0x558e17=0xce;}_0x569d9b[_0xfaca('0x25')](_0x558e17);return _0x569d9b['set'](_0xfaca('0x2b'),_0x56d4ca+'-'+_0x353903+'/'+_0x21e952)['json'](_0x16b051);}return null;};}function patchUpdates(_0x3865dc){return function(_0xbb779c){try{jsonpatch['apply'](_0xbb779c,_0x3865dc,!![]);}catch(_0x286bad){return BPromise[_0xfaca('0x2c')](_0x286bad);}return _0xbb779c[_0xfaca('0x2d')]();};}function saveUpdates(_0x3f40e7,_0x1b266f){return function(_0x44a17c){if(_0x44a17c){return _0x44a17c[_0xfaca('0x2e')](_0x3f40e7)[_0xfaca('0x1b')](function(_0x46a1d3){return _0x46a1d3;});}return null;};}function removeEntity(_0x29881d,_0x21d030){return function(_0x206068){if(_0x206068){return _0x206068[_0xfaca('0x2f')]()[_0xfaca('0x1b')](function(){_0x29881d[_0xfaca('0x25')](0xcc)[_0xfaca('0x26')]();});}};}function handleEntityNotFound(_0x251b75,_0x1a1f5){return function(_0x5648e3){if(!_0x5648e3){_0x251b75[_0xfaca('0x24')](0x194);}return _0x5648e3;};}function handleError(_0x341071,_0x499ffb){_0x499ffb=_0x499ffb||0x1f4;return function(_0x2f92a9){logger[_0xfaca('0x21')](_0x2f92a9[_0xfaca('0x30')]);if(_0x2f92a9[_0xfaca('0x31')]){delete _0x2f92a9[_0xfaca('0x31')];}_0x341071[_0xfaca('0x25')](_0x499ffb)[_0xfaca('0x32')](_0x2f92a9);};}exports[_0xfaca('0x33')]=function(_0x5597a2,_0x4f8e8d){var _0x11ba3d={},_0x4e6c26={},_0x4d0308={'count':0x0,'rows':[]};var _0x1ee467=_['map'](db[_0xfaca('0x34')]['rawAttributes'],function(_0x502cb5){return{'name':_0x502cb5[_0xfaca('0x35')],'type':_0x502cb5[_0xfaca('0x36')][_0xfaca('0x37')]};});_0x4e6c26[_0xfaca('0x38')]=_[_0xfaca('0x39')](_0x1ee467,_0xfaca('0x31'));_0x4e6c26['query']=_[_0xfaca('0x3a')](_0x5597a2[_0xfaca('0x3b')]);_0x4e6c26[_0xfaca('0x3c')]=_[_0xfaca('0x3d')](_0x4e6c26[_0xfaca('0x38')],_0x4e6c26[_0xfaca('0x3b')]);_0x11ba3d[_0xfaca('0x3e')]=_[_0xfaca('0x3d')](_0x4e6c26[_0xfaca('0x38')],qs['fields'](_0x5597a2[_0xfaca('0x3b')][_0xfaca('0x3f')]));_0x11ba3d[_0xfaca('0x3e')]=_0x11ba3d[_0xfaca('0x3e')][_0xfaca('0x40')]?_0x11ba3d[_0xfaca('0x3e')]:_0x4e6c26[_0xfaca('0x38')];if(!_0x5597a2[_0xfaca('0x3b')]['hasOwnProperty'](_0xfaca('0x41'))){_0x11ba3d['limit']=qs['limit'](_0x5597a2[_0xfaca('0x3b')][_0xfaca('0x2a')]);_0x11ba3d['offset']=qs[_0xfaca('0x29')](_0x5597a2[_0xfaca('0x3b')]['offset']);}_0x11ba3d['order']=qs[_0xfaca('0x42')](_0x5597a2[_0xfaca('0x3b')][_0xfaca('0x42')]);_0x11ba3d[_0xfaca('0x43')]=qs[_0xfaca('0x3c')](_[_0xfaca('0x44')](_0x5597a2['query'],_0x4e6c26[_0xfaca('0x3c')]),_0x1ee467);if(_0x5597a2[_0xfaca('0x3b')]['filter']){_0x11ba3d['where']=_[_0xfaca('0x45')](_0x11ba3d['where'],{'$or':_[_0xfaca('0x39')](_0x1ee467,function(_0x72535f){if(_0x72535f['type']!==_0xfaca('0x46')){var _0x155920={};_0x155920[_0x72535f[_0xfaca('0x31')]]={'$like':'%'+_0x5597a2[_0xfaca('0x3b')][_0xfaca('0x47')]+'%'};return _0x155920;}})});}_0x11ba3d=_[_0xfaca('0x45')]({},_0x11ba3d,_0x5597a2[_0xfaca('0x48')]);var _0x4b31a2={'where':_0x11ba3d[_0xfaca('0x43')]};return db['Network'][_0xfaca('0x28')](_0x4b31a2)[_0xfaca('0x1b')](function(_0x1b7208){_0x4d0308[_0xfaca('0x28')]=_0x1b7208;if(_0x5597a2['query'][_0xfaca('0x49')]){_0x11ba3d[_0xfaca('0x4a')]=[{'all':!![]}];}return db[_0xfaca('0x34')][_0xfaca('0x4b')](_0x11ba3d);})['then'](function(_0x49fbaf){_0x4d0308[_0xfaca('0x4c')]=_0x49fbaf;return _0x4d0308;})[_0xfaca('0x1b')](respondWithFilteredResult(_0x4f8e8d,_0x11ba3d))['catch'](handleError(_0x4f8e8d,null));};exports[_0xfaca('0x4d')]=function(_0x1985df,_0x2ef790){var _0x430c14={'raw':!![],'where':{'id':_0x1985df['params']['id']}},_0xfb7934={};_0xfb7934[_0xfaca('0x38')]=_[_0xfaca('0x3a')](db[_0xfaca('0x34')][_0xfaca('0x4e')]);_0xfb7934['query']=_[_0xfaca('0x3a')](_0x1985df[_0xfaca('0x3b')]);_0xfb7934['filters']=_[_0xfaca('0x3d')](_0xfb7934[_0xfaca('0x38')],_0xfb7934[_0xfaca('0x3b')]);_0x430c14[_0xfaca('0x3e')]=_[_0xfaca('0x3d')](_0xfb7934[_0xfaca('0x38')],qs[_0xfaca('0x3f')](_0x1985df['query'][_0xfaca('0x3f')]));_0x430c14[_0xfaca('0x3e')]=_0x430c14[_0xfaca('0x3e')][_0xfaca('0x40')]?_0x430c14[_0xfaca('0x3e')]:_0xfb7934[_0xfaca('0x38')];if(_0x1985df[_0xfaca('0x3b')][_0xfaca('0x49')]){_0x430c14['include']=[{'all':!![]}];}_0x430c14=_['merge']({},_0x430c14,_0x1985df['options']);return db[_0xfaca('0x34')]['find'](_0x430c14)[_0xfaca('0x1b')](handleEntityNotFound(_0x2ef790,null))['then'](respondWithResult(_0x2ef790,null))['catch'](handleError(_0x2ef790,null));};exports['create']=function(_0x2fb9c3,_0x5b29e5,_0x4b056a){var _0x4f85b7;return db[_0xfaca('0x4f')][_0xfaca('0x50')](function(_0x165516){return db[_0xfaca('0x34')]['create'](_0x2fb9c3[_0xfaca('0x51')],{'raw':!![]})[_0xfaca('0x1b')](function(_0x5a358e){_0x4f85b7=_0x5a358e;return db['Network'][_0xfaca('0x4b')]({'where':{'type':_0x2fb9c3['body'][_0xfaca('0x36')]},'raw':!![]});})[_0xfaca('0x1b')](function(_0x1c8713){if(_0x4f85b7['type']['toUpperCase']()==_0xfaca('0x52')){var _0x47a697=fs[_0xfaca('0x53')](path[_0xfaca('0x54')](config['root'],_0xfaca('0x55')),_0xfaca('0x56'));var _0x120a86=ejs[_0xfaca('0x57')](_0x47a697,{'networks':_0x1c8713||[]});fs[_0xfaca('0x58')](_0xfaca('0x59'),_0x120a86);return respondWithRpcPromise(_0xfaca('0x5a'),_0xfaca('0x5b'),{'module':_0xfaca('0x5c')});}else if(_0x4f85b7['type'][_0xfaca('0x5d')]()=='TURN'){var _0x2bf720=fs[_0xfaca('0x53')](path[_0xfaca('0x54')](config[_0xfaca('0x5e')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x29a35d=ejs[_0xfaca('0x57')](_0x2bf720,{'networks':_0x1c8713||[]});fs['writeFileSync'](_0xfaca('0x5f'),_0x29a35d);return respondWithRpcPromise(_0xfaca('0x5a'),_0xfaca('0x5b'),{'module':_0xfaca('0x5c')});}else{var _0x1e4b5c=fs[_0xfaca('0x53')](path['join'](config[_0xfaca('0x5e')],_0xfaca('0x60')),_0xfaca('0x56'));var _0x3e5ae5=ejs[_0xfaca('0x57')](_0x1e4b5c,{'networks':_0x1c8713||[]});fs['writeFileSync'](util[_0xfaca('0x61')](_0xfaca('0x62'),_0x2fb9c3['body']['type']['toLowerCase']()),_0x3e5ae5);return respondWithRpcPromise(_0xfaca('0x5a'),_0xfaca('0x5b'),{'module':_0xfaca('0x63')});}return null;})[_0xfaca('0x1b')](function(){return _0x4f85b7;});})['then'](respondWithResult(_0x5b29e5,0xc9))[_0xfaca('0x64')](handleError(_0x5b29e5,null));};exports['update']=function(_0x3a06b4,_0x3c7087,_0x2ffe45){var _0x33e644;return db['sequelize'][_0xfaca('0x50')](function(_0x26b0c9){return db[_0xfaca('0x34')]['find']({'where':{'id':_0x3a06b4['params']['id']}})[_0xfaca('0x1b')](handleEntityNotFound(_0x3c7087,null))['then'](saveUpdates(_0x3a06b4['body'],null))[_0xfaca('0x1b')](function(_0x5257d2){if(_0x5257d2){_0x33e644=_0x5257d2;return db['Network'][_0xfaca('0x4b')]({'where':{'type':_0x33e644[_0xfaca('0x36')]},'raw':!![]});}return null;})[_0xfaca('0x1b')](function(_0x3a9360){if(_0x33e644[_0xfaca('0x36')][_0xfaca('0x5d')]()==_0xfaca('0x52')){var _0x234589=fs[_0xfaca('0x53')](path[_0xfaca('0x54')](config[_0xfaca('0x5e')],_0xfaca('0x55')),_0xfaca('0x56'));var _0x29327e=ejs[_0xfaca('0x57')](_0x234589,{'networks':_0x3a9360||[]});fs[_0xfaca('0x58')](_0xfaca('0x59'),_0x29327e);return respondWithRpcPromise(_0xfaca('0x5a'),'update',{'module':_0xfaca('0x5c')});}else if(_0x33e644[_0xfaca('0x36')][_0xfaca('0x5d')]()=='TURN'){var _0x25d659=fs['readFileSync'](path['join'](config[_0xfaca('0x5e')],_0xfaca('0x65')),_0xfaca('0x56'));var _0x1f07c5=ejs['render'](_0x25d659,{'networks':_0x3a9360||[]});fs['writeFileSync'](_0xfaca('0x5f'),_0x1f07c5);return respondWithRpcPromise('Reload',_0xfaca('0x2e'),{'module':_0xfaca('0x5c')});}else{var _0x89973d=fs['readFileSync'](path[_0xfaca('0x54')](config[_0xfaca('0x5e')],'server/files/templates/network.ejs'),_0xfaca('0x56'));var _0x37b6c2=ejs[_0xfaca('0x57')](_0x89973d,{'networks':_0x3a9360||[]});fs['writeFileSync'](util[_0xfaca('0x61')](_0xfaca('0x62'),_0x3a06b4[_0xfaca('0x51')]['type'][_0xfaca('0x66')]()),_0x37b6c2);return respondWithRpcPromise('Reload',_0xfaca('0x2e'),{'module':_0xfaca('0x63')});}return null;})[_0xfaca('0x1b')](function(_0x3e18a4){if(_0x3e18a4){return _0x33e644;}return null;});})['then'](respondWithResult(_0x3c7087,null))[_0xfaca('0x64')](handleError(_0x3c7087,null));};exports[_0xfaca('0x2f')]=function(_0x345b49,_0x3cf6de,_0x363745){var _0x1f654e;return db[_0xfaca('0x34')][_0xfaca('0x67')]({'where':{'id':_0x345b49[_0xfaca('0x68')]['id']}})[_0xfaca('0x1b')](function(_0x44c41f){_0x1f654e=_0x44c41f;return _0x44c41f;})[_0xfaca('0x1b')](handleEntityNotFound(_0x3cf6de,null))[_0xfaca('0x1b')](removeEntity(_0x3cf6de,null))[_0xfaca('0x1b')](function(){if(_0x1f654e){return db[_0xfaca('0x34')][_0xfaca('0x4b')]({'where':{'type':_0x1f654e[_0xfaca('0x36')]},'raw':!![]});}})['then'](function(_0x4731ec){if(_0x1f654e[_0xfaca('0x36')][_0xfaca('0x5d')]()=='STUN'){var _0x3c51f8=fs[_0xfaca('0x53')](path[_0xfaca('0x54')](config['root'],_0xfaca('0x55')),_0xfaca('0x56'));var _0x49c81b=ejs[_0xfaca('0x57')](_0x3c51f8,{'networks':_0x4731ec||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x49c81b);return respondWithRpcPromise(_0xfaca('0x5a'),'destroy',{'module':_0xfaca('0x5c')});}else if(_0x1f654e[_0xfaca('0x36')][_0xfaca('0x5d')]()=='TURN'){var _0x4b7984=fs['readFileSync'](path[_0xfaca('0x54')](config[_0xfaca('0x5e')],_0xfaca('0x65')),_0xfaca('0x56'));var _0x5a4ca5=ejs['render'](_0x4b7984,{'networks':_0x4731ec||[]});fs[_0xfaca('0x58')]('/etc/asterisk/turn_xcally.conf',_0x5a4ca5);return respondWithRpcPromise(_0xfaca('0x5a'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x1fd75f=fs[_0xfaca('0x53')](path[_0xfaca('0x54')](config[_0xfaca('0x5e')],_0xfaca('0x60')),'utf8');var _0x417ef5=ejs[_0xfaca('0x57')](_0x1fd75f,{'networks':_0x4731ec||[]});fs[_0xfaca('0x58')](util[_0xfaca('0x61')](_0xfaca('0x62'),_0x345b49[_0xfaca('0x51')][_0xfaca('0x36')][_0xfaca('0x66')]()),_0x417ef5);return respondWithRpcPromise(_0xfaca('0x5a'),_0xfaca('0x2f'),{'module':_0xfaca('0x63')});}return null;})['catch'](handleError(_0x3cf6de,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3612e19..ee8e8e3 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 _0x4522=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger','api','moment','request-promise'];(function(_0x42e2e6,_0x97a4b8){var _0xdd6b32=function(_0x44b42b){while(--_0x44b42b){_0x42e2e6['push'](_0x42e2e6['shift']());}};_0xdd6b32(++_0x97a4b8);}(_0x4522,0x1a0));var _0x2452=function(_0x741cdd,_0x2260af){_0x741cdd=_0x741cdd-0x0;var _0x1fd616=_0x4522[_0x741cdd];return _0x1fd616;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4483=['define','Network','network','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x29402f,_0x4ca4eb){var _0x59479b=function(_0x3a39a1){while(--_0x3a39a1){_0x29402f['push'](_0x29402f['shift']());}};_0x59479b(++_0x4ca4eb);}(_0x4483,0x1a3));var _0x3448=function(_0x1c3219,_0x1fd32d){_0x1c3219=_0x1c3219-0x0;var _0x25d4f9=_0x4483[_0x1c3219];return _0x25d4f9;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));module[_0x3448('0x9')]=function(_0x1b05db,_0xd3606d){return _0x1b05db[_0x3448('0xa')](_0x3448('0xb'),attributes,{'tableName':_0x3448('0xc'),'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 348bb48..6223534 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(_0x4c8cc8,_0x5c6467){_0x4c8cc8=_0x4c8cc8-0x0;var _0x1cca3b=_0x7a54[_0x4c8cc8];return _0x1cca3b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e7e53,_0x40530d){var _0xba8436=function(_0x2eafb2){while(--_0x2eafb2){_0x4e7e53['push'](_0x4e7e53['shift']());}};_0xba8436(++_0x40530d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 9d094df..a30ab1c 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 _0x7254=['addApplications','addAgents','send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','notify'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0x7254,0x79));var _0x4725=function(_0x755816,_0x1bbc98){_0x755816=_0x755816-0x0;var _0x499a95=_0x7254[_0x755816];return _0x499a95;};'use strict';var multer=require(_0x4725('0x0'));var util=require(_0x4725('0x1'));var path=require(_0x4725('0x2'));var timeout=require('connect-timeout');var express=require(_0x4725('0x3'));var router=express[_0x4725('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4725('0x5'));var interaction=require(_0x4725('0x6'));var config=require(_0x4725('0x7'));var controller=require('./openchannelAccount.controller');router[_0x4725('0x8')]('/',auth[_0x4725('0x9')](),controller[_0x4725('0xa')]);router[_0x4725('0x8')](_0x4725('0xb'),auth[_0x4725('0x9')](),controller['describe']);router[_0x4725('0x8')](_0x4725('0xc'),auth[_0x4725('0x9')](),controller[_0x4725('0xd')]);router[_0x4725('0x8')](_0x4725('0xe'),auth[_0x4725('0x9')](),controller[_0x4725('0xf')]);router[_0x4725('0x8')](_0x4725('0x10'),auth['isAuthenticated'](),controller[_0x4725('0x11')]);router[_0x4725('0x8')](_0x4725('0x12'),auth[_0x4725('0x9')](),controller['getApplications']);router[_0x4725('0x8')](_0x4725('0x13'),auth[_0x4725('0x9')](),controller[_0x4725('0x14')]);router['get'](_0x4725('0x15'),auth[_0x4725('0x9')](),controller[_0x4725('0x16')]);router[_0x4725('0x17')]('/',auth[_0x4725('0x9')](),controller['create']);router[_0x4725('0x17')](_0x4725('0xe'),auth['isAuthenticated'](),controller[_0x4725('0x18')]);router[_0x4725('0x17')](_0x4725('0x10'),auth['isAuthenticated'](),controller[_0x4725('0x19')]);router['post']('/:id/notify',controller[_0x4725('0x1a')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x4725('0x1b')]);router['post'](_0x4725('0x15'),auth[_0x4725('0x9')](),controller[_0x4725('0x1c')]);router[_0x4725('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0x4725('0x1d')]);router[_0x4725('0x1e')](_0x4725('0xc'),auth[_0x4725('0x9')](),controller[_0x4725('0x1f')]);router[_0x4725('0x20')](_0x4725('0xc'),auth[_0x4725('0x9')](),controller[_0x4725('0x21')]);router[_0x4725('0x20')](_0x4725('0xe'),auth[_0x4725('0x9')](),controller['removeDispositions']);router[_0x4725('0x20')](_0x4725('0x10'),auth[_0x4725('0x9')](),controller[_0x4725('0x22')]);router['delete'](_0x4725('0x15'),auth[_0x4725('0x9')](),controller[_0x4725('0x23')]);module[_0x4725('0x24')]=router; \ No newline at end of file +var _0x596e=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','put','update','destroy','delete','removeAnswers','/:id/users','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0xf126e4,_0x1197b3){var _0x44d74b=function(_0x2d6ff2){while(--_0x2d6ff2){_0xf126e4['push'](_0xf126e4['shift']());}};_0x44d74b(++_0x1197b3);}(_0x596e,0x14c));var _0xe596=function(_0x2c7585,_0x124f69){_0x2c7585=_0x2c7585-0x0;var _0x4aa379=_0x596e[_0x2c7585];return _0x4aa379;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe596('0x0'));var timeout=require(_0xe596('0x1'));var express=require(_0xe596('0x2'));var router=express[_0xe596('0x3')]();var fs_extra=require(_0xe596('0x4'));var auth=require(_0xe596('0x5'));var interaction=require(_0xe596('0x6'));var config=require(_0xe596('0x7'));var controller=require(_0xe596('0x8'));router[_0xe596('0x9')]('/',auth[_0xe596('0xa')](),controller[_0xe596('0xb')]);router[_0xe596('0x9')](_0xe596('0xc'),auth['isAuthenticated'](),controller[_0xe596('0xd')]);router['get'](_0xe596('0xe'),auth[_0xe596('0xa')](),controller[_0xe596('0xf')]);router['get'](_0xe596('0x10'),auth[_0xe596('0xa')](),controller['getDispositions']);router['get'](_0xe596('0x11'),auth[_0xe596('0xa')](),controller['getAnswers']);router[_0xe596('0x9')]('/:id/applications',auth[_0xe596('0xa')](),controller[_0xe596('0x12')]);router['get'](_0xe596('0x13'),auth[_0xe596('0xa')](),controller[_0xe596('0x14')]);router[_0xe596('0x9')]('/:id/users',auth[_0xe596('0xa')](),controller['getAgents']);router[_0xe596('0x15')]('/',auth['isAuthenticated'](),controller[_0xe596('0x16')]);router[_0xe596('0x15')]('/:id/dispositions',auth[_0xe596('0xa')](),controller[_0xe596('0x17')]);router['post'](_0xe596('0x11'),auth['isAuthenticated'](),controller[_0xe596('0x18')]);router[_0xe596('0x15')](_0xe596('0x19'),controller[_0xe596('0x1a')]);router[_0xe596('0x15')](_0xe596('0x1b'),auth[_0xe596('0xa')](),controller[_0xe596('0x1c')]);router[_0xe596('0x15')]('/:id/users',auth[_0xe596('0xa')](),controller['addAgents']);router[_0xe596('0x15')](_0xe596('0x1d'),auth[_0xe596('0xa')](),controller['send']);router[_0xe596('0x1e')](_0xe596('0xe'),auth['isAuthenticated'](),controller[_0xe596('0x1f')]);router['delete'](_0xe596('0xe'),auth[_0xe596('0xa')](),controller[_0xe596('0x20')]);router[_0xe596('0x21')](_0xe596('0x10'),auth[_0xe596('0xa')](),controller['removeDispositions']);router[_0xe596('0x21')]('/:id/canned_answers',auth[_0xe596('0xa')](),controller[_0xe596('0x22')]);router['delete'](_0xe596('0x23'),auth[_0xe596('0xa')](),controller[_0xe596('0x24')]);module[_0xe596('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 804424f..7fb77d4 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 _0x2240=['mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x70e4b7,_0x1e9e22){var _0x4f3b85=function(_0x46d1db){while(--_0x46d1db){_0x70e4b7['push'](_0x70e4b7['shift']());}};_0x4f3b85(++_0x1e9e22);}(_0x2240,0xb5));var _0x0224=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2240[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x0224('0x0'));var rs=require(_0x0224('0x1'));module[_0x0224('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0224('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0224('0x4')]},'token':{'type':Sequelize[_0x0224('0x4')],'defaultValue':function(){return rs[_0x0224('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0224('0x6')],'defaultValue':function(){return _0x0224('0x7');}},'notificationSound':{'type':Sequelize[_0x0224('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0224('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0224('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0224('0x4')]},'queueTransfer':{'type':Sequelize[_0x0224('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0224('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0224('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x0224('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x0224('0x8')],'defaultValue':![],'comment':_0x0224('0xb'),'set':function(_0x3ae4d5){if(!_0x3ae4d5)this[_0x0224('0xc')](_0x0224('0xd'),null);this['setDataValue'](_0x0224('0xe'),_0x3ae4d5);}}}; \ No newline at end of file +var _0x62a8=['sequelize','randomstring','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x62a8,0xea));var _0x862a=function(_0x431289,_0xa29c06){_0x431289=_0x431289-0x0;var _0x5ddf0c=_0x62a8[_0x431289];return _0x5ddf0c;};'use strict';var Sequelize=require(_0x862a('0x0'));var rs=require(_0x862a('0x1'));module['exports']={'name':{'type':Sequelize[_0x862a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x862a('0x2')]},'token':{'type':Sequelize[_0x862a('0x2')],'defaultValue':function(){return rs[_0x862a('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x862a('0x4')],'defaultValue':function(){return _0x862a('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x862a('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x862a('0x2')]},'queueTransfer':{'type':Sequelize[_0x862a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x862a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x862a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x862a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x862a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x862a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x862a('0x6')],'defaultValue':![],'comment':_0x862a('0x9'),'set':function(_0x4342ba){if(!_0x4342ba)this[_0x862a('0xa')](_0x862a('0xb'),null);this[_0x862a('0xa')](_0x862a('0xc'),_0x4342ba);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b6eb667..d548e37 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 _0x888b=['Messages','dataValues','push','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../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','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getDispositions','findOne','Disposition','length','removeDispositions','ids','CannedAnswer','getAnswers','OpenchannelAccountId','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','OpenchannelApplication','List','account','applications','Applications','list','orderBy','priority','asc','Contacts','CmContact','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out'];(function(_0x18da6d,_0xacbf97){var _0x305aea=function(_0x5dae33){while(--_0x5dae33){_0x18da6d['push'](_0x18da6d['shift']());}};_0x305aea(++_0xacbf97);}(_0x888b,0x183));var _0xb888=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x888b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb888('0x0'));var zipdir=require(_0xb888('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb888('0x2'));var moment=require(_0xb888('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb888('0x4'));var util=require(_0xb888('0x5'));var path=require(_0xb888('0x6'));var sox=require('sox');var csv=require(_0xb888('0x7'));var ejs=require(_0xb888('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb888('0x9'));var squel=require(_0xb888('0xa'));var crypto=require('crypto');var jsforce=require(_0xb888('0xb'));var deskjs=require(_0xb888('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb888('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb888('0xe'));var as=require(_0xb888('0xf'));var hardwareService=require(_0xb888('0x10'));var logger=require(_0xb888('0x11'))(_0xb888('0x12'));var utils=require(_0xb888('0x13'));var config=require(_0xb888('0x14'));var licenseUtil=require(_0xb888('0x15'));var db=require(_0xb888('0x16'))['db'];config[_0xb888('0x17')]=_[_0xb888('0x18')](config[_0xb888('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb888('0x19'))(new Redis(config['redis']));require(_0xb888('0x1a'))[_0xb888('0x1b')](socket);var jayson=require(_0xb888('0x1c'));var client=jayson[_0xb888('0x1d')][_0xb888('0x1e')]({'port':0x232c});var client9002=jayson[_0xb888('0x1d')][_0xb888('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ca392,_0xc27217,_0x3bfe62,_0x54fc62){return new BPromise(function(_0x42a703,_0x197d61){var _0x1b794f=_0x54fc62||client;return _0x1b794f[_0xb888('0x1f')](_0x1ca392,_0x3bfe62)[_0xb888('0x20')](function(_0x5817aa){logger[_0xb888('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0xc27217,_0xb888('0x22'));logger[_0xb888('0x23')](_0xb888('0x24'),_0xc27217,_0xb888('0x22'),JSON['stringify'](_0x5817aa));if(_0x5817aa[_0xb888('0x25')]){if(_0x5817aa[_0xb888('0x25')][_0xb888('0x26')]===0x1f4){logger[_0xb888('0x25')](_0xb888('0x27'),_0xc27217,_0x5817aa[_0xb888('0x25')][_0xb888('0x28')]);return _0x197d61(_0x5817aa[_0xb888('0x25')][_0xb888('0x28')]);}logger[_0xb888('0x25')](_0xb888('0x27'),_0xc27217,_0x5817aa[_0xb888('0x25')][_0xb888('0x28')]);return _0x42a703(_0x5817aa[_0xb888('0x25')][_0xb888('0x28')]);}else{logger[_0xb888('0x21')](_0xb888('0x27'),_0xc27217,'request\x20sent');_0x42a703(_0x5817aa[_0xb888('0x29')][_0xb888('0x28')]);}})[_0xb888('0x2a')](function(_0x2e5627){logger[_0xb888('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0xc27217,_0x2e5627);_0x197d61(_0x2e5627);});});}function respondWithStatusCode(_0x1cc313,_0x549731){_0x549731=_0x549731||0xcc;return function(_0x4b088f){if(_0x4b088f){return _0x1cc313['sendStatus'](_0x549731);}return _0x1cc313[_0xb888('0x2b')](_0x549731)[_0xb888('0x2c')]();};}function respondWithResult(_0xfed8c1,_0x1eba62){_0x1eba62=_0x1eba62||0xc8;return function(_0x43862c){if(_0x43862c){return _0xfed8c1[_0xb888('0x2b')](_0x1eba62)[_0xb888('0x2d')](_0x43862c);}};}function respondWithFilteredResult(_0x1ed8d9,_0x4f6bef){return function(_0x4829b9){if(_0x4829b9){var _0x4af357=typeof _0x4f6bef[_0xb888('0x2e')]===_0xb888('0x2f')&&typeof _0x4f6bef['limit']===_0xb888('0x2f');var _0x2b5f7b=_0x4829b9[_0xb888('0x30')];var _0x26d05c=_0x4af357?0x0:_0x4f6bef[_0xb888('0x2e')];var _0x108a13=_0x4af357?_0x4829b9[_0xb888('0x30')]:_0x4f6bef[_0xb888('0x2e')]+_0x4f6bef['limit'];var _0x4115f9;if(_0x108a13>=_0x2b5f7b){_0x108a13=_0x2b5f7b;_0x4115f9=0xc8;}else{_0x4115f9=0xce;}_0x1ed8d9[_0xb888('0x2b')](_0x4115f9);return _0x1ed8d9[_0xb888('0x31')](_0xb888('0x32'),_0x26d05c+'-'+_0x108a13+'/'+_0x2b5f7b)[_0xb888('0x2d')](_0x4829b9);}return null;};}function patchUpdates(_0x536f0e){return function(_0x1cce21){try{jsonpatch[_0xb888('0x33')](_0x1cce21,_0x536f0e,!![]);}catch(_0x5b09a0){return BPromise[_0xb888('0x34')](_0x5b09a0);}return _0x1cce21[_0xb888('0x35')]();};}function saveUpdates(_0x4a6954,_0x23172a){return function(_0x231357){if(_0x231357){return _0x231357[_0xb888('0x36')](_0x4a6954)['then'](function(_0x1c4a1e){return _0x1c4a1e;});}return null;};}function removeEntity(_0x57cddd,_0x4102df){return function(_0x5800d4){if(_0x5800d4){return _0x5800d4[_0xb888('0x37')]()[_0xb888('0x20')](function(){var _0x36cf5c=_0x5800d4[_0xb888('0x38')]({'plain':!![]});var _0x2881c0=_0xb888('0x39');return db[_0xb888('0x3a')][_0xb888('0x37')]({'where':{'type':_0x2881c0,'resourceId':_0x36cf5c['id']}})[_0xb888('0x20')](function(){return _0x5800d4;});})[_0xb888('0x20')](function(){_0x57cddd[_0xb888('0x2b')](0xcc)[_0xb888('0x2c')]();});}};}function handleEntityNotFound(_0x2e9355,_0x28f1b6){return function(_0x14a2f0){if(!_0x14a2f0){_0x2e9355[_0xb888('0x3b')](0x194);}return _0x14a2f0;};}function handleError(_0x291ae8,_0x3771b9){_0x3771b9=_0x3771b9||0x1f4;return function(_0x5a72a2){logger[_0xb888('0x25')](_0x5a72a2[_0xb888('0x3c')]);if(_0x5a72a2['name']){delete _0x5a72a2[_0xb888('0x3d')];}_0x291ae8['status'](_0x3771b9)[_0xb888('0x3e')](_0x5a72a2);};}exports[_0xb888('0x3f')]=function(_0xc5f8eb,_0x59a32f){var _0x2122d2={'include':[{'model':db['Pause'],'as':_0xb888('0x40')}]},_0x28b2cf={},_0xf495b2={'count':0x0,'rows':[]};var _0x2c7b37=_[_0xb888('0x41')](db['OpenchannelAccount'][_0xb888('0x42')],function(_0x19dca9){return{'name':_0x19dca9[_0xb888('0x43')],'type':_0x19dca9[_0xb888('0x44')]['key']};});_0x28b2cf[_0xb888('0x45')]=_[_0xb888('0x41')](_0x2c7b37,_0xb888('0x3d'));_0x28b2cf['query']=_[_0xb888('0x46')](_0xc5f8eb['query']);_0x28b2cf[_0xb888('0x47')]=_[_0xb888('0x48')](_0x28b2cf[_0xb888('0x45')],_0x28b2cf[_0xb888('0x49')]);_0x2122d2[_0xb888('0x4a')]=_[_0xb888('0x48')](_0x28b2cf[_0xb888('0x45')],qs[_0xb888('0x4b')](_0xc5f8eb['query'][_0xb888('0x4b')]));_0x2122d2[_0xb888('0x4a')]=_0x2122d2[_0xb888('0x4a')]['length']?_0x2122d2['attributes']:_0x28b2cf[_0xb888('0x45')];if(!_0xc5f8eb[_0xb888('0x49')][_0xb888('0x4c')](_0xb888('0x4d'))){_0x2122d2[_0xb888('0x4e')]=qs[_0xb888('0x4e')](_0xc5f8eb[_0xb888('0x49')]['limit']);_0x2122d2[_0xb888('0x2e')]=qs[_0xb888('0x2e')](_0xc5f8eb[_0xb888('0x49')]['offset']);}_0x2122d2[_0xb888('0x4f')]=qs[_0xb888('0x50')](_0xc5f8eb[_0xb888('0x49')][_0xb888('0x50')]);_0x2122d2[_0xb888('0x51')]=qs[_0xb888('0x47')](_[_0xb888('0x52')](_0xc5f8eb['query'],_0x28b2cf['filters']),_0x2c7b37);if(_0xc5f8eb['query'][_0xb888('0x53')]){_0x2122d2['where']=_[_0xb888('0x54')](_0x2122d2['where'],{'$or':_[_0xb888('0x41')](_0x2c7b37,function(_0xdf0905){if(_0xdf0905[_0xb888('0x44')]!=='VIRTUAL'){var _0x30e2fe={};_0x30e2fe[_0xdf0905[_0xb888('0x3d')]]={'$like':'%'+_0xc5f8eb[_0xb888('0x49')][_0xb888('0x53')]+'%'};return _0x30e2fe;}})});}_0x2122d2=_[_0xb888('0x54')]({},_0x2122d2,_0xc5f8eb['options']);var _0x4a4109={'where':_0x2122d2[_0xb888('0x51')]};return db[_0xb888('0x55')][_0xb888('0x30')](_0x4a4109)[_0xb888('0x20')](function(_0x1c992c){_0xf495b2['count']=_0x1c992c;if(_0xc5f8eb[_0xb888('0x49')][_0xb888('0x56')]){_0x2122d2[_0xb888('0x57')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xb888('0x58')](_0x2122d2);})[_0xb888('0x20')](function(_0x4f36a8){_0xf495b2[_0xb888('0x59')]=_0x4f36a8;return _0xf495b2;})[_0xb888('0x20')](respondWithFilteredResult(_0x59a32f,_0x2122d2))[_0xb888('0x2a')](handleError(_0x59a32f,null));};exports[_0xb888('0x5a')]=function(_0x158bd5,_0x5824f0){var _0x308040={'raw':![],'where':{'id':_0x158bd5[_0xb888('0x5b')]['id']},'include':[{'model':db[_0xb888('0x5c')],'as':_0xb888('0x40')}]},_0xfb3a4c={};_0xfb3a4c['model']=_[_0xb888('0x46')](db['OpenchannelAccount']['rawAttributes']);_0xfb3a4c[_0xb888('0x49')]=_[_0xb888('0x46')](_0x158bd5['query']);_0xfb3a4c['filters']=_[_0xb888('0x48')](_0xfb3a4c[_0xb888('0x45')],_0xfb3a4c[_0xb888('0x49')]);_0x308040[_0xb888('0x4a')]=_[_0xb888('0x48')](_0xfb3a4c['model'],qs[_0xb888('0x4b')](_0x158bd5[_0xb888('0x49')][_0xb888('0x4b')]));_0x308040['attributes']=_0x308040['attributes']['length']?_0x308040[_0xb888('0x4a')]:_0xfb3a4c[_0xb888('0x45')];if(_0x158bd5['query']['includeAll']){_0x308040[_0xb888('0x57')]=[{'all':!![]}];}_0x308040=_[_0xb888('0x54')]({},_0x308040,_0x158bd5[_0xb888('0x5d')]);return db[_0xb888('0x55')][_0xb888('0x5e')](_0x308040)[_0xb888('0x20')](handleEntityNotFound(_0x5824f0,null))[_0xb888('0x20')](respondWithResult(_0x5824f0,null))['catch'](handleError(_0x5824f0,null));};exports[_0xb888('0x5f')]=function(_0x5aca48,_0x52ab8e){return db[_0xb888('0x55')][_0xb888('0x5f')](_0x5aca48[_0xb888('0x60')],{})['then'](function(_0x29ec63){var _0x2f629b=_0x5aca48[_0xb888('0x61')][_0xb888('0x38')]({'plain':!![]});if(!_0x2f629b)throw new Error(_0xb888('0x62'));if(_0x2f629b['role']===_0xb888('0x61')){var _0x55abb9=_0x29ec63['get']({'plain':!![]});var _0xf6cd6='OpenchannelAccounts';return db[_0xb888('0x63')][_0xb888('0x5e')]({'where':{'name':_0xf6cd6,'userProfileId':_0x2f629b[_0xb888('0x64')]},'raw':!![]})[_0xb888('0x20')](function(_0x386145){if(_0x386145&&_0x386145[_0xb888('0x65')]===0x0){return db['UserProfileResource'][_0xb888('0x5f')]({'name':_0x55abb9[_0xb888('0x3d')],'resourceId':_0x55abb9['id'],'type':_0x386145[_0xb888('0x3d')],'sectionId':_0x386145['id']},{})[_0xb888('0x20')](function(){return _0x29ec63;});}else{return _0x29ec63;}})[_0xb888('0x2a')](function(_0x5206b1){logger[_0xb888('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5206b1);throw _0x5206b1;});}return _0x29ec63;})[_0xb888('0x20')](respondWithResult(_0x52ab8e,0xc9))[_0xb888('0x2a')](handleError(_0x52ab8e,null));};exports[_0xb888('0x36')]=function(_0x2bdce7,_0x29b260){if(_0x2bdce7['body']['id']){delete _0x2bdce7[_0xb888('0x60')]['id'];}return db[_0xb888('0x55')]['find']({'where':{'id':_0x2bdce7[_0xb888('0x5b')]['id']},'include':[{'model':db[_0xb888('0x5c')],'as':_0xb888('0x40')}]})['then'](handleEntityNotFound(_0x29b260,null))[_0xb888('0x20')](saveUpdates(_0x2bdce7[_0xb888('0x60')],null))[_0xb888('0x20')](respondWithResult(_0x29b260,null))[_0xb888('0x2a')](handleError(_0x29b260,null));};exports[_0xb888('0x37')]=function(_0x3020a1,_0x5972e8){return db['OpenchannelAccount'][_0xb888('0x5e')]({'where':{'id':_0x3020a1[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x5972e8,null))[_0xb888('0x20')](removeEntity(_0x5972e8,null))['catch'](handleError(_0x5972e8,null));};exports['describe']=function(_0x17de39,_0x275054){return db[_0xb888('0x55')][_0xb888('0x66')]()[_0xb888('0x20')](respondWithResult(_0x275054,null))[_0xb888('0x2a')](handleError(_0x275054,null));};exports['addDisposition']=function(_0x4c6a5b,_0x2930a1,_0x504f5c){if(_0x4c6a5b['body']['id']){delete _0x4c6a5b[_0xb888('0x60')]['id'];}return db[_0xb888('0x55')][_0xb888('0x5e')]({'where':{'id':_0x4c6a5b[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x2930a1,null))['then'](function(_0x464b1d){if(_0x464b1d){_0x4c6a5b[_0xb888('0x60')]['OpenchannelAccountId']=_0x464b1d['id'];return db['Disposition']['create'](_0x4c6a5b['body']);}})['then'](respondWithResult(_0x2930a1,null))['catch'](handleError(_0x2930a1,null));};exports[_0xb888('0x67')]=function(_0x48394f,_0x2573c5,_0x3138fb){var _0x16c47a={'raw':![],'where':{}};var _0x45bcee={};var _0x80c1e1={'count':0x0,'rows':[]};return db[_0xb888('0x55')][_0xb888('0x68')]({'where':{'id':_0x48394f[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x2573c5,null))[_0xb888('0x20')](function(_0x30adb4){if(_0x30adb4){_0x45bcee[_0xb888('0x45')]=_[_0xb888('0x46')](db[_0xb888('0x69')][_0xb888('0x42')]);_0x45bcee[_0xb888('0x49')]=_['keys'](_0x48394f['query']);_0x45bcee[_0xb888('0x47')]=_[_0xb888('0x48')](_0x45bcee['model'],_0x45bcee['query']);_0x16c47a[_0xb888('0x4a')]=_['intersection'](_0x45bcee[_0xb888('0x45')],qs[_0xb888('0x4b')](_0x48394f[_0xb888('0x49')]['fields']));_0x16c47a[_0xb888('0x4a')]=_0x16c47a['attributes'][_0xb888('0x6a')]?_0x16c47a[_0xb888('0x4a')]:_0x45bcee[_0xb888('0x45')];if(!_0x48394f['query'][_0xb888('0x4c')](_0xb888('0x4d'))){_0x16c47a[_0xb888('0x4e')]=qs['limit'](_0x48394f[_0xb888('0x49')][_0xb888('0x4e')]);_0x16c47a[_0xb888('0x2e')]=qs[_0xb888('0x2e')](_0x48394f[_0xb888('0x49')][_0xb888('0x2e')]);}_0x16c47a[_0xb888('0x4f')]=qs[_0xb888('0x50')](_0x48394f['query'][_0xb888('0x50')]);_0x16c47a[_0xb888('0x51')]=qs[_0xb888('0x47')](_[_0xb888('0x52')](_0x48394f['query'],_0x45bcee[_0xb888('0x47')]));_0x16c47a[_0xb888('0x51')]['OpenchannelAccountId']=_0x30adb4['id'];if(_0x48394f['query'][_0xb888('0x53')]){_0x16c47a[_0xb888('0x51')]=_[_0xb888('0x54')](_0x16c47a[_0xb888('0x51')],{'$or':_[_0xb888('0x41')](_0x16c47a[_0xb888('0x4a')],function(_0x20e9c0){var _0x3e785e={};_0x3e785e[_0x20e9c0]={'$like':'%'+_0x48394f[_0xb888('0x49')][_0xb888('0x53')]+'%'};return _0x3e785e;})});}_0x16c47a=_[_0xb888('0x54')]({},_0x16c47a,_0x48394f[_0xb888('0x5d')]);return db[_0xb888('0x69')]['count']({'where':_0x16c47a['where']})[_0xb888('0x20')](function(_0x2069c8){_0x80c1e1['count']=_0x2069c8;if(_0x48394f['query'][_0xb888('0x56')]){_0x16c47a[_0xb888('0x57')]=[{'all':!![]}];}return db[_0xb888('0x69')][_0xb888('0x58')](_0x16c47a);})['then'](function(_0x371f55){_0x80c1e1[_0xb888('0x59')]=_0x371f55;return _0x80c1e1;});}})[_0xb888('0x20')](respondWithFilteredResult(_0x2573c5,_0x16c47a))[_0xb888('0x2a')](handleError(_0x2573c5,null));};exports[_0xb888('0x6b')]=function(_0x50e6a0,_0x5a6336,_0x320872){return db[_0xb888('0x55')][_0xb888('0x5e')]({'where':{'id':_0x50e6a0[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x5a6336,null))['then'](function(_0x198097){if(_0x198097){return _0x198097[_0xb888('0x6b')](_0x50e6a0[_0xb888('0x49')][_0xb888('0x6c')]);}})[_0xb888('0x20')](respondWithStatusCode(_0x5a6336,null))[_0xb888('0x2a')](handleError(_0x5a6336,null));};exports['addAnswer']=function(_0x25df89,_0x4af494,_0x1fc462){if(_0x25df89[_0xb888('0x60')]['id']){delete _0x25df89[_0xb888('0x60')]['id'];}return db[_0xb888('0x55')][_0xb888('0x5e')]({'where':{'id':_0x25df89[_0xb888('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4af494,null))[_0xb888('0x20')](function(_0x436376){if(_0x436376){_0x25df89[_0xb888('0x60')]['OpenchannelAccountId']=_0x436376['id'];return db[_0xb888('0x6d')]['create'](_0x25df89[_0xb888('0x60')]);}})['then'](respondWithResult(_0x4af494,null))['catch'](handleError(_0x4af494,null));};exports[_0xb888('0x6e')]=function(_0x52f510,_0x21b022,_0x37a95b){var _0x286d0d={'raw':![],'where':{}};var _0x3f8fef={};var _0x78c140={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb888('0x68')]({'where':{'id':_0x52f510[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x21b022,null))[_0xb888('0x20')](function(_0x46f580){if(_0x46f580){_0x3f8fef[_0xb888('0x45')]=_[_0xb888('0x46')](db[_0xb888('0x6d')][_0xb888('0x42')]);_0x3f8fef[_0xb888('0x49')]=_[_0xb888('0x46')](_0x52f510['query']);_0x3f8fef[_0xb888('0x47')]=_['intersection'](_0x3f8fef[_0xb888('0x45')],_0x3f8fef[_0xb888('0x49')]);_0x286d0d['attributes']=_[_0xb888('0x48')](_0x3f8fef['model'],qs['fields'](_0x52f510[_0xb888('0x49')][_0xb888('0x4b')]));_0x286d0d[_0xb888('0x4a')]=_0x286d0d['attributes'][_0xb888('0x6a')]?_0x286d0d[_0xb888('0x4a')]:_0x3f8fef[_0xb888('0x45')];if(!_0x52f510[_0xb888('0x49')][_0xb888('0x4c')](_0xb888('0x4d'))){_0x286d0d[_0xb888('0x4e')]=qs[_0xb888('0x4e')](_0x52f510['query']['limit']);_0x286d0d[_0xb888('0x2e')]=qs[_0xb888('0x2e')](_0x52f510['query'][_0xb888('0x2e')]);}_0x286d0d[_0xb888('0x4f')]=qs[_0xb888('0x50')](_0x52f510[_0xb888('0x49')][_0xb888('0x50')]);_0x286d0d[_0xb888('0x51')]=qs['filters'](_[_0xb888('0x52')](_0x52f510[_0xb888('0x49')],_0x3f8fef['filters']));_0x286d0d['where'][_0xb888('0x6f')]=_0x46f580['id'];if(_0x52f510[_0xb888('0x49')]['filter']){_0x286d0d[_0xb888('0x51')]=_[_0xb888('0x54')](_0x286d0d['where'],{'$or':_[_0xb888('0x41')](_0x286d0d[_0xb888('0x4a')],function(_0x4ba477){var _0x5146af={};_0x5146af[_0x4ba477]={'$like':'%'+_0x52f510[_0xb888('0x49')][_0xb888('0x53')]+'%'};return _0x5146af;})});}_0x286d0d=_[_0xb888('0x54')]({},_0x286d0d,_0x52f510[_0xb888('0x5d')]);return db[_0xb888('0x6d')][_0xb888('0x30')]({'where':_0x286d0d[_0xb888('0x51')]})[_0xb888('0x20')](function(_0x2cf525){_0x78c140[_0xb888('0x30')]=_0x2cf525;if(_0x52f510[_0xb888('0x49')][_0xb888('0x56')]){_0x286d0d[_0xb888('0x57')]=[{'all':!![]}];}return db[_0xb888('0x6d')][_0xb888('0x58')](_0x286d0d);})[_0xb888('0x20')](function(_0x3d9359){_0x78c140[_0xb888('0x59')]=_0x3d9359;return _0x78c140;});}})['then'](respondWithFilteredResult(_0x21b022,_0x286d0d))[_0xb888('0x2a')](handleError(_0x21b022,null));};exports['removeAnswers']=function(_0x41cfc5,_0xc806c7,_0x5e604c){return db[_0xb888('0x55')]['find']({'where':{'id':_0x41cfc5[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0xc806c7,null))['then'](function(_0x1f6932){if(_0x1f6932){return _0x1f6932[_0xb888('0x70')](_0x41cfc5['query'][_0xb888('0x6c')]);}})['then'](respondWithStatusCode(_0xc806c7,null))['catch'](handleError(_0xc806c7,null));};exports[_0xb888('0x71')]=function(_0x246c9d,_0x3c7132,_0x484a3f){var _0xfad345={'body':_0x246c9d['body'],'channel':_0xb888('0x72')};var _0x575a3e=[];var _0x593924=[];var _0x5a9522={};var _0x266fac=![];return db['CmContact'][_0xb888('0x66')]()[_0xb888('0x20')](function(_0x1f4665){if(!_0x1f4665){throw new db[(_0xb888('0x73'))][(_0xb888('0x74'))](_0xb888('0x75'));}_0x575a3e=_[_0xb888('0x76')](_['keys'](_0x1f4665),[_0xb888('0x77'),_0xb888('0x78')]);_0x593924=_[_0xb888('0x76')](_[_0xb888('0x46')](_0x1f4665),[_0xb888('0x77'),_0xb888('0x78'),'CompanyId',_0xb888('0x79')]);if(_0x246c9d[_0xb888('0x60')]['id']){delete _0x246c9d['body']['id'];}if(_[_0xb888('0x7a')](_0x246c9d['body'][_0xb888('0x7b')])){throw new db['Sequelize'][(_0xb888('0x74'))](_0xb888('0x7c'));}if(_['isNil'](_0x246c9d[_0xb888('0x60')][_0xb888('0x60')])||_0x246c9d[_0xb888('0x60')][_0xb888('0x60')]===''){throw new db[(_0xb888('0x73'))][(_0xb888('0x74'))](_0xb888('0x7d'));}if(_[_0xb888('0x7a')](_0x246c9d[_0xb888('0x60')][_0xb888('0x7e')])){throw new db[(_0xb888('0x73'))][(_0xb888('0x74'))](_0xb888('0x7f')+_0x593924);}if(!_['includes'](_0x593924,_0x246c9d['body'][_0xb888('0x7e')])){throw new db[(_0xb888('0x73'))]['ValidationError'](_0xb888('0x80')+_0x593924);}_0x5a9522[_0x246c9d[_0xb888('0x60')][_0xb888('0x7e')]]=_0x246c9d[_0xb888('0x60')][_0xb888('0x7b')];})[_0xb888('0x20')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x246c9d[_0xb888('0x5b')]['id']},'include':[{'model':db[_0xb888('0x81')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5a9522,'limit':0x1,'order':[[_0xb888('0x78'),_0xb888('0x82')]]}]},{'model':db[_0xb888('0x83')],'as':'Applications'}]});})[_0xb888('0x20')](handleEntityNotFound(_0x3c7132,null))[_0xb888('0x20')](function(_0x604158){if(_0x604158&&_0x604158[_0xb888('0x84')]){_0xfad345[_0xb888('0x85')]=_0x604158;_0xfad345[_0xb888('0x86')]=_0x604158[_0xb888('0x87')];_0xfad345[_0xb888('0x88')]=_0x604158[_0xb888('0x84')];_0xfad345['applications']=_[_0xb888('0x89')](_0xfad345[_0xb888('0x86')],[_0xb888('0x8a')],[_0xb888('0x8b')]);if(_0xfad345[_0xb888('0x85')][_0xb888('0x87')]){delete _0xfad345['account'][_0xb888('0x87')];}if(_0xfad345[_0xb888('0x85')]['List']&&_0xfad345[_0xb888('0x85')][_0xb888('0x84')][_0xb888('0x8c')][_0xb888('0x6a')]){return _0xfad345['account'][_0xb888('0x84')][_0xb888('0x8c')][0x0];}var _0x2a7b18=_[_0xb888('0x18')](_0x246c9d[_0xb888('0x60')],{'firstName':_0x246c9d[_0xb888('0x60')][_0xb888('0x7b')],'ListId':_0x604158[_0xb888('0x79')]});_0x2a7b18[_0x246c9d[_0xb888('0x60')][_0xb888('0x7e')]]=_0x246c9d[_0xb888('0x60')][_0xb888('0x7b')];return db[_0xb888('0x8d')][_0xb888('0x5f')](_0x2a7b18,{'fields':_0x575a3e,'raw':!![]});}})[_0xb888('0x20')](handleEntityNotFound(_0x3c7132,null))[_0xb888('0x20')](function(_0x7e03b1){_0xfad345[_0xb888('0x8e')]=_0x7e03b1;if(_0x7e03b1){var _0x265164={'ContactId':_0x7e03b1['id'],'OpenchannelAccountId':_0x246c9d[_0xb888('0x5b')]['id'],'from':(_0x7e03b1[_0xb888('0x8f')]||'')+'\x20'+(_0x7e03b1[_0xb888('0x90')]||'')};var _0x3946bb={'OpenchannelAccountId':_0x246c9d[_0xb888('0x5b')]['id'],'closed':![]};if(_0x246c9d[_0xb888('0x60')]['threadId']){_0x3946bb[_0xb888('0x91')]=_0x246c9d[_0xb888('0x60')][_0xb888('0x91')];return db[_0xb888('0x92')][_0xb888('0x5e')]({'where':_0x3946bb})[_0xb888('0x20')](function(_0x15d5b2){if(_0x15d5b2){return[_0x15d5b2,![]];}_0x265164[_0xb888('0x91')]=_0x246c9d[_0xb888('0x60')]['threadId'];_0x265164[_0xb888('0x93')]=_0x246c9d['body']['externalUrl'];return db[_0xb888('0x92')][_0xb888('0x5f')](_0x265164)[_0xb888('0x20')](function(_0x25680a){return[_0x25680a,!![]];});});}else{_0x3946bb[_0xb888('0x91')]=null;}_0x3946bb['ContactId']=_0x7e03b1['id'];return db['OpenchannelInteraction'][_0xb888('0x5e')]({'where':_0x3946bb})[_0xb888('0x20')](function(_0x64b2bf){if(_0x64b2bf){return[_0x64b2bf,![]];}return db[_0xb888('0x92')]['create'](_0x265164)[_0xb888('0x20')](function(_0x58d4db){return[_0x58d4db,!![]];});});}})[_0xb888('0x94')](function(_0xb5e12e,_0x584707){if(_0xb5e12e){_0x266fac=_0x584707;if(!_0x584707){var _0x51bd23={'from':(_0xfad345[_0xb888('0x8e')][_0xb888('0x8f')]||'')+'\x20'+(_0xfad345[_0xb888('0x8e')]['lastName']||'')};if(_0x246c9d[_0xb888('0x60')]['threadId']&&_0x246c9d[_0xb888('0x60')]['messageId']&&_0x246c9d[_0xb888('0x60')][_0xb888('0x91')]!=_0x246c9d[_0xb888('0x60')][_0xb888('0x95')]){_0x51bd23[_0xb888('0x91')]=_0x246c9d[_0xb888('0x60')][_0xb888('0x95')];}return _0xb5e12e['update'](_0x51bd23);}else{return _0xb5e12e;}}})['then'](function(_0x43c22b){_0xfad345['interaction']=_0x43c22b[_0xb888('0x38')]({'plain':!![]});_0xfad345[_0xb888('0x96')][_0xb888('0x97')]=_0x266fac;if(_0xfad345['interaction']['created']){if(_0xfad345[_0xb888('0x85')][_0xb888('0x98')]){_0xfad345[_0xb888('0x86')]['push']({'id':0x0,'priority':_0xfad345[_0xb888('0x86')]['length']+0x1,'app':_0xb888('0x99'),'appdata':'unmanaged','interval':_0xb888('0x9a')});}}return db[_0xb888('0x9b')][_0xb888('0x5f')]({'body':_0x246c9d[_0xb888('0x60')]['body'],'OpenchannelAccountId':_0x246c9d[_0xb888('0x5b')]['id'],'OpenchannelInteractionId':_0x43c22b['id'],'direction':'in','ContactId':_0xfad345[_0xb888('0x8e')]['id'],'AttachmentId':_0x246c9d['body'][_0xb888('0x9c')]});})[_0xb888('0x20')](function(_0x3b55e4){_0xfad345[_0xb888('0x28')]=_0x3b55e4;if(_0xfad345['interaction']['UserId']){return db[_0xb888('0x9d')]['find']({'attributes':['id',_0xb888('0x3d')],'where':{'id':_0xfad345[_0xb888('0x96')][_0xb888('0x9e')]}})[_0xb888('0x20')](function(_0x368e44){if(_0x368e44){_0xfad345[_0xb888('0x86')][_0xb888('0x9f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x368e44['name']+','+(_0xfad345[_0xb888('0x85')][_0xb888('0xa0')]||0xa),'interval':_0xb888('0x9a')});_0xfad345[_0xb888('0xa1')]=![];}return respondWithRpcPromise(_0xb888('0xa2'),_0xb888('0xa3'),_0xfad345);});}return respondWithRpcPromise(_0xb888('0xa2'),_0xb888('0xa3'),_0xfad345);})[_0xb888('0x20')](function(_0x1327e3){respondWithRpcPromise('EventManager',_0xb888('0xa4'),{'event':'notify','message':_0x1327e3},client9002);return _0x1327e3;})['then'](respondWithResult(_0x3c7132,null))[_0xb888('0x2a')](handleError(_0x3c7132,null));};exports[_0xb888('0xa5')]=function(_0x30f359,_0x5440f5){var _0x22df5e=_0x30f359['params']['id'];var _0x5b52a2=_0x30f359[_0xb888('0x60')];var _0x47fd3f=0xc8;var _0x582da8=null;return db[_0xb888('0xa6')][_0xb888('0xa7')]({'isolationLevel':db[_0xb888('0xa6')][_0xb888('0xa8')]['ISOLATION_LEVELS'][_0xb888('0xa9')]},function(_0xf7086a){return db[_0xb888('0x55')][_0xb888('0x68')]({'where':{'id':_0x22df5e},'transaction':_0xf7086a})[_0xb888('0x20')](function(_0x40ca8d){if(_0x40ca8d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x22df5e},'transaction':_0xf7086a})[_0xb888('0x20')](function(){var _0x47e757=_[_0xb888('0x41')](_0x5b52a2,function(_0xc49af3){_0xc49af3[_0xb888('0x6f')]=_0x22df5e;return _0xc49af3;});return db[_0xb888('0x83')][_0xb888('0xaa')](_0x47e757,{'transaction':_0xf7086a});});}else{_0x47fd3f=0x194;_0x582da8=[];}});})[_0xb888('0x20')](function(){if(_0x47fd3f!==0x194){return db[_0xb888('0x83')][_0xb888('0xab')]({'where':{'OpenchannelAccountId':_0x22df5e},'order':_0xb888('0x8a')})[_0xb888('0x20')](function(_0x54c9b8){_0x582da8=_0x54c9b8;});}})[_0xb888('0x2a')](function(_0x38da80){_0x47fd3f=0x1f4;logger[_0xb888('0x25')](_0x38da80['stack']);if(_0x38da80[_0xb888('0x3d')]){delete _0x38da80['name'];}_0x582da8=_0x38da80;})['finally'](function(){if(_0x582da8===null){_0x5440f5[_0xb888('0x3b')](_0x47fd3f);}else{if(_0x47fd3f===0x1f4){_0x5440f5[_0xb888('0x2b')](_0x47fd3f)[_0xb888('0x3e')](_0x582da8);}else{_0x5440f5[_0xb888('0x2b')](_0x47fd3f)[_0xb888('0x2d')](_0x582da8);}}});};exports[_0xb888('0xac')]=function(_0x3e55d0,_0x46cc2f,_0x3de473){var _0x3f8bdd={};var _0xa2707e={};var _0x3d6af4;var _0x55e572;return db[_0xb888('0x55')][_0xb888('0x68')]({'where':{'id':_0x3e55d0['params']['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x46cc2f,null))[_0xb888('0x20')](function(_0x5e7b7b){if(_0x5e7b7b){_0x3d6af4=_0x5e7b7b;_0xa2707e[_0xb888('0x45')]=_[_0xb888('0x46')](db[_0xb888('0x83')]['rawAttributes']);_0xa2707e['query']=_[_0xb888('0x46')](_0x3e55d0[_0xb888('0x49')]);_0xa2707e[_0xb888('0x47')]=_[_0xb888('0x48')](_0xa2707e[_0xb888('0x45')],_0xa2707e['query']);_0x3f8bdd['attributes']=_[_0xb888('0x48')](_0xa2707e['model'],qs[_0xb888('0x4b')](_0x3e55d0[_0xb888('0x49')][_0xb888('0x4b')]));_0x3f8bdd['attributes']=_0x3f8bdd[_0xb888('0x4a')]['length']?_0x3f8bdd[_0xb888('0x4a')]:_0xa2707e[_0xb888('0x45')];_0x3f8bdd[_0xb888('0x4f')]=qs[_0xb888('0x50')](_0x3e55d0[_0xb888('0x49')][_0xb888('0x50')]);_0x3f8bdd[_0xb888('0x51')]=qs[_0xb888('0x47')](_[_0xb888('0x52')](_0x3e55d0['query'],_0xa2707e['filters']));if(_0x3e55d0[_0xb888('0x49')]['filter']){_0x3f8bdd['where']=_['merge'](_0x3f8bdd[_0xb888('0x51')],{'$or':_['map'](_0x3f8bdd[_0xb888('0x4a')],function(_0xe46396){var _0x14b455={};_0x14b455[_0xe46396]={'$like':'%'+_0x3e55d0[_0xb888('0x49')][_0xb888('0x53')]+'%'};return _0x14b455;})});}_0x3f8bdd=_[_0xb888('0x54')]({},_0x3f8bdd,_0x3e55d0['options']);return _0x3d6af4['getApplications'](_0x3f8bdd);}})[_0xb888('0x20')](function(_0x5a1db2){if(_0x5a1db2){_0x55e572=_0x5a1db2[_0xb888('0x6a')];if(!_0x3e55d0[_0xb888('0x49')][_0xb888('0x4c')](_0xb888('0x4d'))){_0x3f8bdd['limit']=qs[_0xb888('0x4e')](_0x3e55d0[_0xb888('0x49')][_0xb888('0x4e')]);_0x3f8bdd[_0xb888('0x2e')]=qs[_0xb888('0x2e')](_0x3e55d0[_0xb888('0x49')]['offset']);}return _0x3d6af4[_0xb888('0xac')](_0x3f8bdd);}})[_0xb888('0x20')](function(_0x2712c5){if(_0x2712c5){return _0x2712c5?{'count':_0x55e572,'rows':_0x2712c5}:null;}})[_0xb888('0x20')](respondWithResult(_0x46cc2f,null))[_0xb888('0x2a')](handleError(_0x46cc2f,null));};exports[_0xb888('0xad')]=function(_0x22edbe,_0x4a60a9,_0x1e2c9b){var _0x2041b2={'raw':![],'where':{}};var _0x3354b2={};var _0x373a47={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb888('0x68')]({'where':{'id':_0x22edbe['params']['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x4a60a9,null))[_0xb888('0x20')](function(_0x3f0816){if(_0x3f0816){_0x3354b2[_0xb888('0x45')]=_[_0xb888('0x46')](db[_0xb888('0x92')]['rawAttributes']);_0x3354b2[_0xb888('0x49')]=_[_0xb888('0x46')](_0x22edbe['query']);_0x3354b2[_0xb888('0x47')]=_[_0xb888('0x48')](_0x3354b2[_0xb888('0x45')],_0x3354b2[_0xb888('0x49')]);_0x2041b2['attributes']=_[_0xb888('0x48')](_0x3354b2[_0xb888('0x45')],qs[_0xb888('0x4b')](_0x22edbe[_0xb888('0x49')][_0xb888('0x4b')]));_0x2041b2['attributes']=_0x2041b2['attributes'][_0xb888('0x6a')]?_0x2041b2[_0xb888('0x4a')]:_0x3354b2[_0xb888('0x45')];if(!_0x22edbe[_0xb888('0x49')][_0xb888('0x4c')](_0xb888('0x4d'))){_0x2041b2[_0xb888('0x4e')]=qs[_0xb888('0x4e')](_0x22edbe['query'][_0xb888('0x4e')]);_0x2041b2[_0xb888('0x2e')]=qs[_0xb888('0x2e')](_0x22edbe[_0xb888('0x49')][_0xb888('0x2e')]);}_0x2041b2['order']=qs[_0xb888('0x50')](_0x22edbe[_0xb888('0x49')][_0xb888('0x50')]);_0x2041b2['where']=qs[_0xb888('0x47')](_['pick'](_0x22edbe[_0xb888('0x49')],_0x3354b2[_0xb888('0x47')]));_0x2041b2[_0xb888('0x51')][_0xb888('0x6f')]=_0x3f0816['id'];if(_0x22edbe[_0xb888('0x49')]['filter']){_0x2041b2[_0xb888('0x51')]=_[_0xb888('0x54')](_0x2041b2[_0xb888('0x51')],{'$or':_[_0xb888('0x41')](_0x2041b2[_0xb888('0x4a')],function(_0xf261e7){var _0x1906aa={};_0x1906aa[_0xf261e7]={'$like':'%'+_0x22edbe[_0xb888('0x49')][_0xb888('0x53')]+'%'};return _0x1906aa;})});}_0x2041b2=_[_0xb888('0x54')]({},_0x2041b2,_0x22edbe[_0xb888('0x5d')]);return db[_0xb888('0x92')][_0xb888('0x30')]({'where':_0x2041b2[_0xb888('0x51')]})[_0xb888('0x20')](function(_0x1b07d9){_0x373a47['count']=_0x1b07d9;if(_0x22edbe['query'][_0xb888('0x56')]){_0x2041b2[_0xb888('0x57')]=[{'model':db['CmContact'],'as':_0xb888('0xae'),'required':![]},{'model':db[_0xb888('0x9d')],'as':_0xb888('0xaf'),'attributes':[_0xb888('0x3d'),_0xb888('0xb0'),_0xb888('0xb1')],'required':![]},{'model':db['Tag'],'as':_0xb888('0xb2'),'attributes':['id','name','color'],'where':_0x22edbe[_0xb888('0x49')][_0xb888('0xb3')]?{'id':_0x22edbe[_0xb888('0x49')][_0xb888('0xb3')]}:undefined,'required':_0x22edbe[_0xb888('0x49')][_0xb888('0xb3')]?!![]:![]}];}return db[_0xb888('0x92')][_0xb888('0x58')](_0x2041b2);})['then'](function(_0x749d61){_0x373a47['rows']=_0x749d61;return _0x373a47;});}})['then'](respondWithFilteredResult(_0x4a60a9,_0x2041b2))[_0xb888('0x2a')](handleError(_0x4a60a9,null));};exports[_0xb888('0xb4')]=function(_0x560e2d,_0x19c1b9,_0x13daa5){return db[_0xb888('0x55')][_0xb888('0x5e')]({'where':{'id':_0x560e2d[_0xb888('0x5b')]['id']}})['then'](handleEntityNotFound(_0x19c1b9,null))[_0xb888('0x20')](function(_0x5282dc){if(_0x5282dc){return _0x5282dc[_0xb888('0xb4')](_0x560e2d['body']['ids'],_[_0xb888('0xb5')](_0x560e2d[_0xb888('0x60')],['ids','id'])||{})[_0xb888('0x94')](function(_0x5f646d){for(var _0x15fd29=0x0;_0x15fd29<_0x560e2d[_0xb888('0x60')][_0xb888('0x6c')][_0xb888('0x6a')];_0x15fd29+=0x1){socket[_0xb888('0xb6')](_0xb888('0xb7'),{'UserId':Number(_0x560e2d[_0xb888('0x60')][_0xb888('0x6c')][_0x15fd29]),'OpenchannelAccountId':Number(_0x560e2d[_0xb888('0x5b')]['id'])});}return _0x5f646d;});}})[_0xb888('0x20')](respondWithResult(_0x19c1b9,null))[_0xb888('0x2a')](handleError(_0x19c1b9,null));};exports[_0xb888('0xb8')]=function(_0x692a30,_0x344788,_0xc80609){return db[_0xb888('0x55')][_0xb888('0x5e')]({'where':{'id':_0x692a30[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x344788,null))['then'](function(_0x50faf5){if(_0x50faf5){return _0x50faf5[_0xb888('0xb8')](_0x692a30['query'][_0xb888('0x6c')])[_0xb888('0x20')](function(){if(_[_0xb888('0xb9')](_0x692a30['query'][_0xb888('0x6c')])){for(var _0x5c1494=0x0;_0x5c1494<_0x692a30[_0xb888('0x49')][_0xb888('0x6c')]['length'];_0x5c1494+=0x1){socket['emit'](_0xb888('0xba'),{'UserId':Number(_0x692a30[_0xb888('0x49')][_0xb888('0x6c')][_0x5c1494]),'OpenchannelAccountId':Number(_0x692a30[_0xb888('0x5b')]['id'])});}}else{socket[_0xb888('0xb6')](_0xb888('0xba'),{'UserId':Number(_0x692a30[_0xb888('0x49')]['ids']),'OpenchannelAccountId':Number(_0x692a30[_0xb888('0x5b')]['id'])});}});}})[_0xb888('0x20')](respondWithStatusCode(_0x344788,null))[_0xb888('0x2a')](handleError(_0x344788,null));};exports[_0xb888('0xbb')]=function(_0x279b7c,_0x1aae05,_0x45eef3){var _0x4ac41f={};var _0x50c8b8={};var _0x264e08;var _0x456014;return db['OpenchannelAccount'][_0xb888('0x68')]({'where':{'id':_0x279b7c['params']['id']}})['then'](handleEntityNotFound(_0x1aae05,null))[_0xb888('0x20')](function(_0x52c1b2){if(_0x52c1b2){_0x264e08=_0x52c1b2;_0x50c8b8['model']=_[_0xb888('0x46')](db['User'][_0xb888('0x42')]);_0x50c8b8[_0xb888('0x49')]=_[_0xb888('0x46')](_0x279b7c['query']);_0x50c8b8['filters']=_['intersection'](_0x50c8b8[_0xb888('0x45')],_0x50c8b8[_0xb888('0x49')]);_0x4ac41f['attributes']=_[_0xb888('0x48')](_0x50c8b8['model'],qs[_0xb888('0x4b')](_0x279b7c[_0xb888('0x49')][_0xb888('0x4b')]));_0x4ac41f['attributes']=_0x4ac41f['attributes'][_0xb888('0x6a')]?_0x4ac41f[_0xb888('0x4a')]:_0x50c8b8['model'];_0x4ac41f[_0xb888('0x4f')]=qs[_0xb888('0x50')](_0x279b7c[_0xb888('0x49')]['sort']);_0x4ac41f[_0xb888('0x51')]=qs[_0xb888('0x47')](_[_0xb888('0x52')](_0x279b7c['query'],_0x50c8b8[_0xb888('0x47')]));if(_0x279b7c[_0xb888('0x49')]['filter']){_0x4ac41f['where']=_[_0xb888('0x54')](_0x4ac41f[_0xb888('0x51')],{'$or':_[_0xb888('0x41')](_0x4ac41f['attributes'],function(_0x34b39d){var _0x5b4914={};_0x5b4914[_0x34b39d]={'$like':'%'+_0x279b7c[_0xb888('0x49')]['filter']+'%'};return _0x5b4914;})});}_0x4ac41f=_[_0xb888('0x54')]({},_0x4ac41f,_0x279b7c['options']);return _0x264e08[_0xb888('0xbb')](_0x4ac41f);}})[_0xb888('0x20')](function(_0x3a467c){if(_0x3a467c){_0x456014=_0x3a467c[_0xb888('0x6a')];if(!_0x279b7c[_0xb888('0x49')][_0xb888('0x4c')](_0xb888('0x4d'))){_0x4ac41f[_0xb888('0x4e')]=qs[_0xb888('0x4e')](_0x279b7c['query'][_0xb888('0x4e')]);_0x4ac41f['offset']=qs['offset'](_0x279b7c['query'][_0xb888('0x2e')]);}return _0x264e08[_0xb888('0xbb')](_0x4ac41f);}})[_0xb888('0x20')](function(_0x71f366){if(_0x71f366){return _0x71f366?{'count':_0x456014,'rows':_0x71f366}:null;}})['then'](respondWithResult(_0x1aae05,null))[_0xb888('0x2a')](handleError(_0x1aae05,null));};exports['send']=function(_0x5e674f,_0x308beb,_0x4b4152){var _0xc75691,_0xf83f2c,_0x2c2759;if(_[_0xb888('0x7a')](_0x5e674f[_0xb888('0x60')][_0xb888('0x60')])||_0x5e674f[_0xb888('0x60')]['body']===''){throw new db[(_0xb888('0x73'))][(_0xb888('0x74'))](_0xb888('0x7d'));}if(_['isNil'](_0x5e674f[_0xb888('0x60')]['to'])){}_0xc75691=_0x5e674f['body']['to'];return db[_0xb888('0x55')][_0xb888('0x68')]({'where':{'id':_0x5e674f[_0xb888('0x5b')]['id']}})[_0xb888('0x20')](handleEntityNotFound(_0x308beb,null))[_0xb888('0x20')](function(_0x44a0a7){if(_0x44a0a7){return db[_0xb888('0x55')]['find']({'where':{'id':_0x44a0a7['id']},'include':[{'model':db[_0xb888('0x81')],'as':_0xb888('0x84'),'include':[{'model':db['CmContact'],'as':_0xb888('0x8c'),'where':{[_0x44a0a7[_0xb888('0x7e')]]:_0xc75691},'limit':0x1,'order':[[_0xb888('0x78'),_0xb888('0x82')]]}]}]})[_0xb888('0x20')](handleEntityNotFound(_0x308beb,null))[_0xb888('0x20')](function(_0xafd7cb){if(_0xafd7cb&&_0xafd7cb[_0xb888('0x84')]){_0xf83f2c=_0xafd7cb[_0xb888('0x38')]({'plain':!![]});if(_0xf83f2c[_0xb888('0x84')]&&_0xf83f2c[_0xb888('0x84')][_0xb888('0x8c')][_0xb888('0x6a')]){return _0xf83f2c['List']['Contacts'][0x0];}return db[_0xb888('0x8d')][_0xb888('0x5f')](_[_0xb888('0x18')](_0x5e674f[_0xb888('0x60')],{'firstName':_0xc75691,[_0xafd7cb[_0xb888('0x7e')]]:_0xc75691,'phone':_0xc75691,'ListId':_0xf83f2c[_0xb888('0x79')]}));}})[_0xb888('0x20')](handleEntityNotFound(_0x308beb,null))[_0xb888('0x20')](function(_0xa41fd4){if(_0xa41fd4){_0x2c2759=_0xa41fd4;return db[_0xb888('0x92')]['find']({'where':{'ContactId':_0x2c2759['id'],'closed':![],'OpenchannelAccountId':_0xf83f2c['id']}})['then'](function(_0x4b1ac4){if(_0x4b1ac4){return[_0x4b1ac4,![]];}return db[_0xb888('0x92')][_0xb888('0x5f')]({'UserId':_0x5e674f[_0xb888('0x61')]['id'],'ContactId':_0x2c2759['id'],'OpenchannelAccountId':_0xf83f2c['id'],'lastMsgDirection':_0xb888('0xbc'),'Messages':[_[_0xb888('0x54')](_0x5e674f[_0xb888('0x60')],{'read':![],'body':_0x5e674f[_0xb888('0x60')][_0xb888('0x60')],'OpenchannelAccountId':_0xf83f2c['id'],'UserId':_0x5e674f['user']['id'],'ContactId':_0x2c2759['id']})]},{'include':[{'model':db[_0xb888('0x9b')],'as':_0xb888('0xbd')}]})['then'](function(_0x42f4e9){return[_0x42f4e9,!![]];});});}})[_0xb888('0x94')](function(_0x2bb9cd,_0x10eea2){if(_0x10eea2){return _0x2bb9cd;}return db[_0xb888('0x9b')][_0xb888('0x5f')](_[_0xb888('0x54')](_0x5e674f[_0xb888('0x60')],{'read':![],'body':_0x5e674f[_0xb888('0x60')][_0xb888('0x60')],'OpenchannelAccountId':_0xf83f2c['id'],'OpenchannelInteractionId':_0x2bb9cd['id'],'UserId':_0x5e674f[_0xb888('0x61')]['id'],'ContactId':_0x2c2759['id']}))['then'](function(_0x10627a){_0x2bb9cd[_0xb888('0xbe')][_0xb888('0xbd')]=[];_0x2bb9cd[_0xb888('0xbe')][_0xb888('0xbd')][_0xb888('0xbf')](_0x10627a[_0xb888('0xbe')]);return _0x2bb9cd;});});}})[_0xb888('0x20')](respondWithResult(_0x308beb,null))[_0xb888('0x2a')](handleError(_0x308beb,null));}; \ No newline at end of file +var _0xfdc3=['omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','defaults','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','hasOwnProperty','nolimit','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','orderBy','priority','ListId','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','Owner','internal','Tags','color','tag','addAgents'];(function(_0x26d038,_0x512abc){var _0x31fed5=function(_0x8e57ef){while(--_0x8e57ef){_0x26d038['push'](_0x26d038['shift']());}};_0x31fed5(++_0x512abc);}(_0xfdc3,0xcc));var _0x3fdc=function(_0x1d1a63,_0x25f4c3){_0x1d1a63=_0x1d1a63-0x0;var _0xaf29ff=_0xfdc3[_0x1d1a63];return _0xaf29ff;};'use strict';var emlformat=require(_0x3fdc('0x0'));var rimraf=require(_0x3fdc('0x1'));var zipdir=require(_0x3fdc('0x2'));var jsonpatch=require(_0x3fdc('0x3'));var rp=require(_0x3fdc('0x4'));var moment=require(_0x3fdc('0x5'));var BPromise=require(_0x3fdc('0x6'));var Mustache=require(_0x3fdc('0x7'));var util=require(_0x3fdc('0x8'));var path=require(_0x3fdc('0x9'));var sox=require(_0x3fdc('0xa'));var csv=require(_0x3fdc('0xb'));var ejs=require(_0x3fdc('0xc'));var fs=require('fs');var fs_extra=require(_0x3fdc('0xd'));var _=require(_0x3fdc('0xe'));var squel=require(_0x3fdc('0xf'));var crypto=require('crypto');var jsforce=require(_0x3fdc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3fdc('0xb'));var querystring=require('querystring');var Papa=require(_0x3fdc('0x11'));var Redis=require(_0x3fdc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3fdc('0x13'));var as=require(_0x3fdc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fdc('0x15'))('api');var utils=require(_0x3fdc('0x16'));var config=require(_0x3fdc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fdc('0x18'))['db'];config[_0x3fdc('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3fdc('0x1a'))(new Redis(config[_0x3fdc('0x19')]));require('./openchannelAccount.socket')[_0x3fdc('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3fdc('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x3fdc('0x1c')][_0x3fdc('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x509f78,_0x337c2e,_0x2050fa,_0x5eb83c){return new BPromise(function(_0x3211cf,_0x225da8){var _0x22eec0=_0x5eb83c||client;return _0x22eec0['request'](_0x509f78,_0x2050fa)[_0x3fdc('0x1e')](function(_0x1b12de){logger[_0x3fdc('0x1f')](_0x3fdc('0x20'),_0x337c2e,_0x3fdc('0x21'));logger[_0x3fdc('0x22')](_0x3fdc('0x23'),_0x337c2e,_0x3fdc('0x21'),JSON[_0x3fdc('0x24')](_0x1b12de));if(_0x1b12de['error']){if(_0x1b12de[_0x3fdc('0x25')]['code']===0x1f4){logger['error'](_0x3fdc('0x20'),_0x337c2e,_0x1b12de[_0x3fdc('0x25')]['message']);return _0x225da8(_0x1b12de[_0x3fdc('0x25')]['message']);}logger['error'](_0x3fdc('0x20'),_0x337c2e,_0x1b12de[_0x3fdc('0x25')][_0x3fdc('0x26')]);return _0x3211cf(_0x1b12de[_0x3fdc('0x25')][_0x3fdc('0x26')]);}else{logger[_0x3fdc('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x337c2e,_0x3fdc('0x21'));_0x3211cf(_0x1b12de[_0x3fdc('0x27')][_0x3fdc('0x26')]);}})[_0x3fdc('0x28')](function(_0x9fe2e7){logger[_0x3fdc('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x337c2e,_0x9fe2e7);_0x225da8(_0x9fe2e7);});});}function respondWithStatusCode(_0x22236b,_0x4deb66){_0x4deb66=_0x4deb66||0xcc;return function(_0x1670b8){if(_0x1670b8){return _0x22236b[_0x3fdc('0x29')](_0x4deb66);}return _0x22236b[_0x3fdc('0x2a')](_0x4deb66)[_0x3fdc('0x2b')]();};}function respondWithResult(_0x34d12f,_0x4f152c){_0x4f152c=_0x4f152c||0xc8;return function(_0x111810){if(_0x111810){return _0x34d12f[_0x3fdc('0x2a')](_0x4f152c)[_0x3fdc('0x2c')](_0x111810);}};}function respondWithFilteredResult(_0x3f7581,_0x209326){return function(_0xaa3c7d){if(_0xaa3c7d){var _0x1d6401=typeof _0x209326['offset']===_0x3fdc('0x2d')&&typeof _0x209326['limit']===_0x3fdc('0x2d');var _0x41ba59=_0xaa3c7d[_0x3fdc('0x2e')];var _0x3ecc64=_0x1d6401?0x0:_0x209326['offset'];var _0xc72378=_0x1d6401?_0xaa3c7d[_0x3fdc('0x2e')]:_0x209326[_0x3fdc('0x2f')]+_0x209326[_0x3fdc('0x30')];var _0x16095a;if(_0xc72378>=_0x41ba59){_0xc72378=_0x41ba59;_0x16095a=0xc8;}else{_0x16095a=0xce;}_0x3f7581['status'](_0x16095a);return _0x3f7581[_0x3fdc('0x31')](_0x3fdc('0x32'),_0x3ecc64+'-'+_0xc72378+'/'+_0x41ba59)[_0x3fdc('0x2c')](_0xaa3c7d);}return null;};}function patchUpdates(_0x3b1cc5){return function(_0x4a118d){try{jsonpatch['apply'](_0x4a118d,_0x3b1cc5,!![]);}catch(_0xa3cd37){return BPromise[_0x3fdc('0x33')](_0xa3cd37);}return _0x4a118d[_0x3fdc('0x34')]();};}function saveUpdates(_0x59c98e,_0x54c9c0){return function(_0x1e90ac){if(_0x1e90ac){return _0x1e90ac[_0x3fdc('0x35')](_0x59c98e)[_0x3fdc('0x1e')](function(_0x444c2e){return _0x444c2e;});}return null;};}function removeEntity(_0x37443f,_0x49a42f){return function(_0x321040){if(_0x321040){return _0x321040[_0x3fdc('0x36')]()[_0x3fdc('0x1e')](function(){var _0x3d8674=_0x321040[_0x3fdc('0x37')]({'plain':!![]});var _0x9b97b8=_0x3fdc('0x38');return db[_0x3fdc('0x39')][_0x3fdc('0x36')]({'where':{'type':_0x9b97b8,'resourceId':_0x3d8674['id']}})['then'](function(){return _0x321040;});})['then'](function(){_0x37443f[_0x3fdc('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8294,_0x938769){return function(_0x3ed5c8){if(!_0x3ed5c8){_0x5b8294[_0x3fdc('0x29')](0x194);}return _0x3ed5c8;};}function handleError(_0x98ca9f,_0x3e8643){_0x3e8643=_0x3e8643||0x1f4;return function(_0x18fc62){logger[_0x3fdc('0x25')](_0x18fc62[_0x3fdc('0x3a')]);if(_0x18fc62[_0x3fdc('0x3b')]){delete _0x18fc62[_0x3fdc('0x3b')];}_0x98ca9f[_0x3fdc('0x2a')](_0x3e8643)[_0x3fdc('0x3c')](_0x18fc62);};}exports[_0x3fdc('0x3d')]=function(_0x4a8217,_0x3bb388){var _0x22402c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4d6d0b={},_0x58681e={'count':0x0,'rows':[]};var _0x191bdd=_[_0x3fdc('0x3e')](db['OpenchannelAccount'][_0x3fdc('0x3f')],function(_0x1453cd){return{'name':_0x1453cd[_0x3fdc('0x40')],'type':_0x1453cd[_0x3fdc('0x41')][_0x3fdc('0x42')]};});_0x4d6d0b[_0x3fdc('0x43')]=_[_0x3fdc('0x3e')](_0x191bdd,_0x3fdc('0x3b'));_0x4d6d0b[_0x3fdc('0x44')]=_[_0x3fdc('0x45')](_0x4a8217[_0x3fdc('0x44')]);_0x4d6d0b[_0x3fdc('0x46')]=_['intersection'](_0x4d6d0b[_0x3fdc('0x43')],_0x4d6d0b[_0x3fdc('0x44')]);_0x22402c[_0x3fdc('0x47')]=_[_0x3fdc('0x48')](_0x4d6d0b[_0x3fdc('0x43')],qs[_0x3fdc('0x49')](_0x4a8217[_0x3fdc('0x44')]['fields']));_0x22402c['attributes']=_0x22402c[_0x3fdc('0x47')][_0x3fdc('0x4a')]?_0x22402c[_0x3fdc('0x47')]:_0x4d6d0b['model'];if(!_0x4a8217['query']['hasOwnProperty']('nolimit')){_0x22402c[_0x3fdc('0x30')]=qs['limit'](_0x4a8217[_0x3fdc('0x44')][_0x3fdc('0x30')]);_0x22402c['offset']=qs[_0x3fdc('0x2f')](_0x4a8217['query'][_0x3fdc('0x2f')]);}_0x22402c[_0x3fdc('0x4b')]=qs[_0x3fdc('0x4c')](_0x4a8217[_0x3fdc('0x44')][_0x3fdc('0x4c')]);_0x22402c[_0x3fdc('0x4d')]=qs[_0x3fdc('0x46')](_[_0x3fdc('0x4e')](_0x4a8217[_0x3fdc('0x44')],_0x4d6d0b[_0x3fdc('0x46')]),_0x191bdd);if(_0x4a8217[_0x3fdc('0x44')][_0x3fdc('0x4f')]){_0x22402c['where']=_['merge'](_0x22402c[_0x3fdc('0x4d')],{'$or':_[_0x3fdc('0x3e')](_0x191bdd,function(_0xbb41f2){if(_0xbb41f2['type']!=='VIRTUAL'){var _0xd8483b={};_0xd8483b[_0xbb41f2[_0x3fdc('0x3b')]]={'$like':'%'+_0x4a8217[_0x3fdc('0x44')][_0x3fdc('0x4f')]+'%'};return _0xd8483b;}})});}_0x22402c=_[_0x3fdc('0x50')]({},_0x22402c,_0x4a8217[_0x3fdc('0x51')]);var _0xe42b2f={'where':_0x22402c[_0x3fdc('0x4d')]};return db[_0x3fdc('0x52')][_0x3fdc('0x2e')](_0xe42b2f)[_0x3fdc('0x1e')](function(_0x4da276){_0x58681e[_0x3fdc('0x2e')]=_0x4da276;if(_0x4a8217['query'][_0x3fdc('0x53')]){_0x22402c[_0x3fdc('0x54')]=[{'all':!![]}];}return db[_0x3fdc('0x52')][_0x3fdc('0x55')](_0x22402c);})[_0x3fdc('0x1e')](function(_0x26d0a2){_0x58681e[_0x3fdc('0x56')]=_0x26d0a2;return _0x58681e;})[_0x3fdc('0x1e')](respondWithFilteredResult(_0x3bb388,_0x22402c))[_0x3fdc('0x28')](handleError(_0x3bb388,null));};exports[_0x3fdc('0x57')]=function(_0x4f65b9,_0x130273){var _0xf1c00b={'raw':![],'where':{'id':_0x4f65b9[_0x3fdc('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x3fdc('0x59')}]},_0x2c5c9b={};_0x2c5c9b['model']=_[_0x3fdc('0x45')](db[_0x3fdc('0x52')][_0x3fdc('0x3f')]);_0x2c5c9b[_0x3fdc('0x44')]=_[_0x3fdc('0x45')](_0x4f65b9[_0x3fdc('0x44')]);_0x2c5c9b[_0x3fdc('0x46')]=_[_0x3fdc('0x48')](_0x2c5c9b['model'],_0x2c5c9b[_0x3fdc('0x44')]);_0xf1c00b[_0x3fdc('0x47')]=_[_0x3fdc('0x48')](_0x2c5c9b[_0x3fdc('0x43')],qs['fields'](_0x4f65b9[_0x3fdc('0x44')][_0x3fdc('0x49')]));_0xf1c00b[_0x3fdc('0x47')]=_0xf1c00b[_0x3fdc('0x47')]['length']?_0xf1c00b[_0x3fdc('0x47')]:_0x2c5c9b['model'];if(_0x4f65b9['query'][_0x3fdc('0x53')]){_0xf1c00b[_0x3fdc('0x54')]=[{'all':!![]}];}_0xf1c00b=_['merge']({},_0xf1c00b,_0x4f65b9[_0x3fdc('0x51')]);return db['OpenchannelAccount'][_0x3fdc('0x5a')](_0xf1c00b)[_0x3fdc('0x1e')](handleEntityNotFound(_0x130273,null))[_0x3fdc('0x1e')](respondWithResult(_0x130273,null))[_0x3fdc('0x28')](handleError(_0x130273,null));};exports[_0x3fdc('0x5b')]=function(_0x1ccaa0,_0x51b1db){return db[_0x3fdc('0x52')]['create'](_0x1ccaa0[_0x3fdc('0x5c')],{})[_0x3fdc('0x1e')](function(_0xec8570){var _0x1a8c66=_0x1ccaa0[_0x3fdc('0x5d')]['get']({'plain':!![]});if(!_0x1a8c66)throw new Error(_0x3fdc('0x5e'));if(_0x1a8c66[_0x3fdc('0x5f')]===_0x3fdc('0x5d')){var _0x4103c9=_0xec8570[_0x3fdc('0x37')]({'plain':!![]});var _0x35c5fe='OpenchannelAccounts';return db[_0x3fdc('0x60')][_0x3fdc('0x5a')]({'where':{'name':_0x35c5fe,'userProfileId':_0x1a8c66[_0x3fdc('0x61')]},'raw':!![]})[_0x3fdc('0x1e')](function(_0x2bf96a){if(_0x2bf96a&&_0x2bf96a[_0x3fdc('0x62')]===0x0){return db[_0x3fdc('0x39')][_0x3fdc('0x5b')]({'name':_0x4103c9[_0x3fdc('0x3b')],'resourceId':_0x4103c9['id'],'type':_0x2bf96a[_0x3fdc('0x3b')],'sectionId':_0x2bf96a['id']},{})[_0x3fdc('0x1e')](function(){return _0xec8570;});}else{return _0xec8570;}})['catch'](function(_0x1a6bdc){logger[_0x3fdc('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a6bdc);throw _0x1a6bdc;});}return _0xec8570;})[_0x3fdc('0x1e')](respondWithResult(_0x51b1db,0xc9))[_0x3fdc('0x28')](handleError(_0x51b1db,null));};exports[_0x3fdc('0x35')]=function(_0x2af065,_0x3419f3){if(_0x2af065[_0x3fdc('0x5c')]['id']){delete _0x2af065[_0x3fdc('0x5c')]['id'];}return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x2af065[_0x3fdc('0x58')]['id']},'include':[{'model':db[_0x3fdc('0x63')],'as':_0x3fdc('0x59')}]})[_0x3fdc('0x1e')](handleEntityNotFound(_0x3419f3,null))[_0x3fdc('0x1e')](saveUpdates(_0x2af065['body'],null))[_0x3fdc('0x1e')](respondWithResult(_0x3419f3,null))[_0x3fdc('0x28')](handleError(_0x3419f3,null));};exports['destroy']=function(_0x4143fb,_0x1d7923){return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x4143fb[_0x3fdc('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d7923,null))['then'](removeEntity(_0x1d7923,null))[_0x3fdc('0x28')](handleError(_0x1d7923,null));};exports[_0x3fdc('0x64')]=function(_0x1e02a6,_0x26a4fa){return db[_0x3fdc('0x52')]['describe']()[_0x3fdc('0x1e')](respondWithResult(_0x26a4fa,null))[_0x3fdc('0x28')](handleError(_0x26a4fa,null));};exports[_0x3fdc('0x65')]=function(_0x506aa3,_0x597046,_0x177272){if(_0x506aa3[_0x3fdc('0x5c')]['id']){delete _0x506aa3[_0x3fdc('0x5c')]['id'];}return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x506aa3[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x597046,null))['then'](function(_0x29c542){if(_0x29c542){_0x506aa3['body'][_0x3fdc('0x66')]=_0x29c542['id'];return db[_0x3fdc('0x67')]['create'](_0x506aa3[_0x3fdc('0x5c')]);}})[_0x3fdc('0x1e')](respondWithResult(_0x597046,null))[_0x3fdc('0x28')](handleError(_0x597046,null));};exports[_0x3fdc('0x68')]=function(_0x2f6c04,_0x392306,_0x2ab9b9){var _0x2f7bb7={'raw':![],'where':{}};var _0x47f636={};var _0xd27ba5={'count':0x0,'rows':[]};return db[_0x3fdc('0x52')]['findOne']({'where':{'id':_0x2f6c04['params']['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x392306,null))['then'](function(_0x345085){if(_0x345085){_0x47f636['model']=_[_0x3fdc('0x45')](db[_0x3fdc('0x67')]['rawAttributes']);_0x47f636['query']=_[_0x3fdc('0x45')](_0x2f6c04[_0x3fdc('0x44')]);_0x47f636[_0x3fdc('0x46')]=_[_0x3fdc('0x48')](_0x47f636[_0x3fdc('0x43')],_0x47f636[_0x3fdc('0x44')]);_0x2f7bb7[_0x3fdc('0x47')]=_[_0x3fdc('0x48')](_0x47f636['model'],qs['fields'](_0x2f6c04[_0x3fdc('0x44')]['fields']));_0x2f7bb7[_0x3fdc('0x47')]=_0x2f7bb7['attributes'][_0x3fdc('0x4a')]?_0x2f7bb7[_0x3fdc('0x47')]:_0x47f636['model'];if(!_0x2f6c04[_0x3fdc('0x44')][_0x3fdc('0x69')](_0x3fdc('0x6a'))){_0x2f7bb7['limit']=qs[_0x3fdc('0x30')](_0x2f6c04['query'][_0x3fdc('0x30')]);_0x2f7bb7['offset']=qs['offset'](_0x2f6c04[_0x3fdc('0x44')][_0x3fdc('0x2f')]);}_0x2f7bb7['order']=qs[_0x3fdc('0x4c')](_0x2f6c04[_0x3fdc('0x44')]['sort']);_0x2f7bb7['where']=qs['filters'](_['pick'](_0x2f6c04[_0x3fdc('0x44')],_0x47f636[_0x3fdc('0x46')]));_0x2f7bb7['where'][_0x3fdc('0x66')]=_0x345085['id'];if(_0x2f6c04[_0x3fdc('0x44')][_0x3fdc('0x4f')]){_0x2f7bb7['where']=_[_0x3fdc('0x50')](_0x2f7bb7[_0x3fdc('0x4d')],{'$or':_[_0x3fdc('0x3e')](_0x2f7bb7[_0x3fdc('0x47')],function(_0x3b5799){var _0x12a7b7={};_0x12a7b7[_0x3b5799]={'$like':'%'+_0x2f6c04[_0x3fdc('0x44')][_0x3fdc('0x4f')]+'%'};return _0x12a7b7;})});}_0x2f7bb7=_['merge']({},_0x2f7bb7,_0x2f6c04[_0x3fdc('0x51')]);return db[_0x3fdc('0x67')][_0x3fdc('0x2e')]({'where':_0x2f7bb7[_0x3fdc('0x4d')]})[_0x3fdc('0x1e')](function(_0x188475){_0xd27ba5['count']=_0x188475;if(_0x2f6c04[_0x3fdc('0x44')]['includeAll']){_0x2f7bb7[_0x3fdc('0x54')]=[{'all':!![]}];}return db[_0x3fdc('0x67')][_0x3fdc('0x55')](_0x2f7bb7);})[_0x3fdc('0x1e')](function(_0x2d1a49){_0xd27ba5[_0x3fdc('0x56')]=_0x2d1a49;return _0xd27ba5;});}})[_0x3fdc('0x1e')](respondWithFilteredResult(_0x392306,_0x2f7bb7))[_0x3fdc('0x28')](handleError(_0x392306,null));};exports[_0x3fdc('0x6b')]=function(_0x1692a6,_0x58c203,_0x50533f){return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x1692a6[_0x3fdc('0x58')]['id']}})['then'](handleEntityNotFound(_0x58c203,null))['then'](function(_0x16c590){if(_0x16c590){return _0x16c590['removeDispositions'](_0x1692a6['query']['ids']);}})[_0x3fdc('0x1e')](respondWithStatusCode(_0x58c203,null))[_0x3fdc('0x28')](handleError(_0x58c203,null));};exports[_0x3fdc('0x6c')]=function(_0x33e940,_0x53e04e,_0x35f758){if(_0x33e940[_0x3fdc('0x5c')]['id']){delete _0x33e940[_0x3fdc('0x5c')]['id'];}return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x33e940[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x53e04e,null))['then'](function(_0xe06899){if(_0xe06899){_0x33e940[_0x3fdc('0x5c')][_0x3fdc('0x66')]=_0xe06899['id'];return db['CannedAnswer'][_0x3fdc('0x5b')](_0x33e940[_0x3fdc('0x5c')]);}})[_0x3fdc('0x1e')](respondWithResult(_0x53e04e,null))['catch'](handleError(_0x53e04e,null));};exports[_0x3fdc('0x6d')]=function(_0x4d805b,_0x85430,_0x46c007){var _0x3d6d71={'raw':![],'where':{}};var _0x2a1c22={};var _0x5c274b={'count':0x0,'rows':[]};return db[_0x3fdc('0x52')][_0x3fdc('0x6e')]({'where':{'id':_0x4d805b[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x85430,null))[_0x3fdc('0x1e')](function(_0x230d9){if(_0x230d9){_0x2a1c22[_0x3fdc('0x43')]=_['keys'](db[_0x3fdc('0x6f')][_0x3fdc('0x3f')]);_0x2a1c22[_0x3fdc('0x44')]=_['keys'](_0x4d805b[_0x3fdc('0x44')]);_0x2a1c22[_0x3fdc('0x46')]=_[_0x3fdc('0x48')](_0x2a1c22[_0x3fdc('0x43')],_0x2a1c22[_0x3fdc('0x44')]);_0x3d6d71['attributes']=_[_0x3fdc('0x48')](_0x2a1c22[_0x3fdc('0x43')],qs[_0x3fdc('0x49')](_0x4d805b[_0x3fdc('0x44')]['fields']));_0x3d6d71[_0x3fdc('0x47')]=_0x3d6d71[_0x3fdc('0x47')][_0x3fdc('0x4a')]?_0x3d6d71[_0x3fdc('0x47')]:_0x2a1c22[_0x3fdc('0x43')];if(!_0x4d805b[_0x3fdc('0x44')][_0x3fdc('0x69')](_0x3fdc('0x6a'))){_0x3d6d71[_0x3fdc('0x30')]=qs['limit'](_0x4d805b[_0x3fdc('0x44')]['limit']);_0x3d6d71[_0x3fdc('0x2f')]=qs[_0x3fdc('0x2f')](_0x4d805b[_0x3fdc('0x44')][_0x3fdc('0x2f')]);}_0x3d6d71[_0x3fdc('0x4b')]=qs[_0x3fdc('0x4c')](_0x4d805b[_0x3fdc('0x44')][_0x3fdc('0x4c')]);_0x3d6d71['where']=qs['filters'](_['pick'](_0x4d805b[_0x3fdc('0x44')],_0x2a1c22[_0x3fdc('0x46')]));_0x3d6d71[_0x3fdc('0x4d')][_0x3fdc('0x66')]=_0x230d9['id'];if(_0x4d805b[_0x3fdc('0x44')]['filter']){_0x3d6d71[_0x3fdc('0x4d')]=_[_0x3fdc('0x50')](_0x3d6d71['where'],{'$or':_['map'](_0x3d6d71[_0x3fdc('0x47')],function(_0x3a396b){var _0x275c38={};_0x275c38[_0x3a396b]={'$like':'%'+_0x4d805b['query'][_0x3fdc('0x4f')]+'%'};return _0x275c38;})});}_0x3d6d71=_['merge']({},_0x3d6d71,_0x4d805b['options']);return db[_0x3fdc('0x6f')][_0x3fdc('0x2e')]({'where':_0x3d6d71['where']})[_0x3fdc('0x1e')](function(_0x45eb34){_0x5c274b[_0x3fdc('0x2e')]=_0x45eb34;if(_0x4d805b[_0x3fdc('0x44')][_0x3fdc('0x53')]){_0x3d6d71[_0x3fdc('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3fdc('0x55')](_0x3d6d71);})[_0x3fdc('0x1e')](function(_0x214ba2){_0x5c274b[_0x3fdc('0x56')]=_0x214ba2;return _0x5c274b;});}})[_0x3fdc('0x1e')](respondWithFilteredResult(_0x85430,_0x3d6d71))[_0x3fdc('0x28')](handleError(_0x85430,null));};exports[_0x3fdc('0x70')]=function(_0x2ccdfd,_0xf89de,_0x33df46){return db['OpenchannelAccount']['find']({'where':{'id':_0x2ccdfd[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0xf89de,null))['then'](function(_0x3ddc9a){if(_0x3ddc9a){return _0x3ddc9a['removeAnswers'](_0x2ccdfd[_0x3fdc('0x44')][_0x3fdc('0x71')]);}})[_0x3fdc('0x1e')](respondWithStatusCode(_0xf89de,null))[_0x3fdc('0x28')](handleError(_0xf89de,null));};exports[_0x3fdc('0x72')]=function(_0x1055f2,_0x3ebeb4,_0x1257d0){var _0x29d455={'body':_0x1055f2[_0x3fdc('0x5c')],'channel':_0x3fdc('0x73')};var _0x1c837e=[];var _0x1abbc2=[];var _0x463192={};var _0x29829e=![];return db[_0x3fdc('0x74')][_0x3fdc('0x64')]()[_0x3fdc('0x1e')](function(_0x4fc875){if(!_0x4fc875){throw new db[(_0x3fdc('0x75'))]['ValidationError'](_0x3fdc('0x76'));}_0x1c837e=_[_0x3fdc('0x77')](_[_0x3fdc('0x45')](_0x4fc875),[_0x3fdc('0x78'),_0x3fdc('0x79')]);_0x1abbc2=_[_0x3fdc('0x77')](_['keys'](_0x4fc875),[_0x3fdc('0x78'),_0x3fdc('0x79'),_0x3fdc('0x7a'),'ListId']);if(_0x1055f2[_0x3fdc('0x5c')]['id']){delete _0x1055f2['body']['id'];}if(_[_0x3fdc('0x7b')](_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x7c')])){throw new db[(_0x3fdc('0x75'))][(_0x3fdc('0x7d'))](_0x3fdc('0x7e'));}if(_['isNil'](_0x1055f2['body']['body'])||_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x5c')]===''){throw new db['Sequelize'][(_0x3fdc('0x7d'))](_0x3fdc('0x7f'));}if(_[_0x3fdc('0x7b')](_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x80')])){throw new db[(_0x3fdc('0x75'))][(_0x3fdc('0x7d'))](_0x3fdc('0x81')+_0x1abbc2);}if(!_['includes'](_0x1abbc2,_0x1055f2[_0x3fdc('0x5c')]['mapKey'])){throw new db[(_0x3fdc('0x75'))]['ValidationError'](_0x3fdc('0x82')+_0x1abbc2);}_0x463192[_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x80')]]=_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x7c')];})[_0x3fdc('0x1e')](function(){return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x1055f2['params']['id']},'include':[{'model':db[_0x3fdc('0x83')],'as':'List','include':[{'model':db[_0x3fdc('0x74')],'as':_0x3fdc('0x84'),'where':_0x463192,'limit':0x1,'order':[[_0x3fdc('0x79'),_0x3fdc('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x3fdc('0x86')}]});})[_0x3fdc('0x1e')](handleEntityNotFound(_0x3ebeb4,null))[_0x3fdc('0x1e')](function(_0x350a77){if(_0x350a77&&_0x350a77[_0x3fdc('0x87')]){_0x29d455[_0x3fdc('0x88')]=_0x350a77;_0x29d455[_0x3fdc('0x89')]=_0x350a77['Applications'];_0x29d455['list']=_0x350a77[_0x3fdc('0x87')];_0x29d455['applications']=_[_0x3fdc('0x8a')](_0x29d455[_0x3fdc('0x89')],[_0x3fdc('0x8b')],['asc']);if(_0x29d455[_0x3fdc('0x88')][_0x3fdc('0x86')]){delete _0x29d455[_0x3fdc('0x88')][_0x3fdc('0x86')];}if(_0x29d455[_0x3fdc('0x88')]['List']&&_0x29d455[_0x3fdc('0x88')][_0x3fdc('0x87')][_0x3fdc('0x84')]['length']){return _0x29d455[_0x3fdc('0x88')][_0x3fdc('0x87')][_0x3fdc('0x84')][0x0];}var _0x30c9c5=_['defaults'](_0x1055f2['body'],{'firstName':_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x7c')],'ListId':_0x350a77[_0x3fdc('0x8c')]});_0x30c9c5[_0x1055f2[_0x3fdc('0x5c')]['mapKey']]=_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x7c')];return db[_0x3fdc('0x74')][_0x3fdc('0x5b')](_0x30c9c5,{'fields':_0x1c837e,'raw':!![]});}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x3ebeb4,null))[_0x3fdc('0x1e')](function(_0x1e6e5b){_0x29d455[_0x3fdc('0x8d')]=_0x1e6e5b;if(_0x1e6e5b){var _0x8fe0d9={'ContactId':_0x1e6e5b['id'],'OpenchannelAccountId':_0x1055f2['params']['id'],'from':(_0x1e6e5b[_0x3fdc('0x8e')]||'')+'\x20'+(_0x1e6e5b[_0x3fdc('0x8f')]||'')};var _0x5c1306={'OpenchannelAccountId':_0x1055f2[_0x3fdc('0x58')]['id'],'closed':![]};if(_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x90')]){_0x5c1306[_0x3fdc('0x90')]=_0x1055f2[_0x3fdc('0x5c')]['threadId'];return db['OpenchannelInteraction'][_0x3fdc('0x5a')]({'where':_0x5c1306})[_0x3fdc('0x1e')](function(_0x5081f7){if(_0x5081f7){return[_0x5081f7,![]];}_0x8fe0d9[_0x3fdc('0x90')]=_0x1055f2[_0x3fdc('0x5c')]['threadId'];_0x8fe0d9[_0x3fdc('0x91')]=_0x1055f2[_0x3fdc('0x5c')]['externalUrl'];return db[_0x3fdc('0x92')][_0x3fdc('0x5b')](_0x8fe0d9)[_0x3fdc('0x1e')](function(_0x4b74cb){return[_0x4b74cb,!![]];});});}else{_0x5c1306[_0x3fdc('0x90')]=null;}_0x5c1306[_0x3fdc('0x93')]=_0x1e6e5b['id'];return db['OpenchannelInteraction']['find']({'where':_0x5c1306})['then'](function(_0x412d25){if(_0x412d25){return[_0x412d25,![]];}return db[_0x3fdc('0x92')]['create'](_0x8fe0d9)[_0x3fdc('0x1e')](function(_0x27ca0e){return[_0x27ca0e,!![]];});});}})[_0x3fdc('0x94')](function(_0x2f4545,_0x5cd233){if(_0x2f4545){_0x29829e=_0x5cd233;if(!_0x5cd233){var _0x35ca20={'from':(_0x29d455[_0x3fdc('0x8d')][_0x3fdc('0x8e')]||'')+'\x20'+(_0x29d455[_0x3fdc('0x8d')][_0x3fdc('0x8f')]||'')};if(_0x1055f2[_0x3fdc('0x5c')]['threadId']&&_0x1055f2['body'][_0x3fdc('0x95')]&&_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x90')]!=_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x95')]){_0x35ca20['threadId']=_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x95')];}return _0x2f4545[_0x3fdc('0x35')](_0x35ca20);}else{return _0x2f4545;}}})[_0x3fdc('0x1e')](function(_0x429ea4){_0x29d455[_0x3fdc('0x96')]=_0x429ea4[_0x3fdc('0x37')]({'plain':!![]});_0x29d455[_0x3fdc('0x96')][_0x3fdc('0x97')]=_0x29829e;if(_0x29d455['interaction'][_0x3fdc('0x97')]){if(_0x29d455[_0x3fdc('0x88')][_0x3fdc('0x98')]){_0x29d455['applications']['push']({'id':0x0,'priority':_0x29d455[_0x3fdc('0x89')]['length']+0x1,'app':_0x3fdc('0x99'),'appdata':'unmanaged','interval':_0x3fdc('0x9a')});}}return db[_0x3fdc('0x9b')]['create']({'body':_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x5c')],'OpenchannelAccountId':_0x1055f2[_0x3fdc('0x58')]['id'],'OpenchannelInteractionId':_0x429ea4['id'],'direction':'in','ContactId':_0x29d455['contact']['id'],'AttachmentId':_0x1055f2[_0x3fdc('0x5c')][_0x3fdc('0x9c')]});})[_0x3fdc('0x1e')](function(_0x14fa41){_0x29d455['message']=_0x14fa41;if(_0x29d455[_0x3fdc('0x96')][_0x3fdc('0x9d')]){return db['User'][_0x3fdc('0x5a')]({'attributes':['id',_0x3fdc('0x3b')],'where':{'id':_0x29d455[_0x3fdc('0x96')][_0x3fdc('0x9d')]}})[_0x3fdc('0x1e')](function(_0x2fb224){if(_0x2fb224){_0x29d455[_0x3fdc('0x89')][_0x3fdc('0x9e')]({'id':0x0,'priority':0x0,'app':_0x3fdc('0x9f'),'appdata':_0x2fb224[_0x3fdc('0x3b')]+','+(_0x29d455['account'][_0x3fdc('0xa0')]||0xa),'interval':_0x3fdc('0x9a')});_0x29d455[_0x3fdc('0xa1')]=![];}return respondWithRpcPromise(_0x3fdc('0xa2'),'startRouting',_0x29d455);});}return respondWithRpcPromise('Start',_0x3fdc('0xa3'),_0x29d455);})[_0x3fdc('0x1e')](function(_0x13cc71){respondWithRpcPromise('EventManager','EventManager',{'event':_0x3fdc('0x72'),'message':_0x13cc71},client9002);return _0x13cc71;})[_0x3fdc('0x1e')](respondWithResult(_0x3ebeb4,null))[_0x3fdc('0x28')](handleError(_0x3ebeb4,null));};exports[_0x3fdc('0xa4')]=function(_0x54fd47,_0x191586){var _0xdb75e7=_0x54fd47[_0x3fdc('0x58')]['id'];var _0x5f1a96=_0x54fd47[_0x3fdc('0x5c')];var _0x46bbcf=0xc8;var _0x3dabc4=null;return db[_0x3fdc('0xa5')][_0x3fdc('0xa6')]({'isolationLevel':db[_0x3fdc('0xa5')][_0x3fdc('0xa7')]['ISOLATION_LEVELS'][_0x3fdc('0xa8')]},function(_0x2330d0){return db[_0x3fdc('0x52')][_0x3fdc('0x6e')]({'where':{'id':_0xdb75e7},'transaction':_0x2330d0})['then'](function(_0x509141){if(_0x509141){return db[_0x3fdc('0xa9')][_0x3fdc('0x36')]({'where':{'OpenchannelAccountId':_0xdb75e7},'transaction':_0x2330d0})[_0x3fdc('0x1e')](function(){var _0x1b5ccd=_[_0x3fdc('0x3e')](_0x5f1a96,function(_0x19d3a1){_0x19d3a1[_0x3fdc('0x66')]=_0xdb75e7;return _0x19d3a1;});return db[_0x3fdc('0xa9')][_0x3fdc('0xaa')](_0x1b5ccd,{'transaction':_0x2330d0});});}else{_0x46bbcf=0x194;_0x3dabc4=[];}});})[_0x3fdc('0x1e')](function(){if(_0x46bbcf!==0x194){return db[_0x3fdc('0xa9')][_0x3fdc('0xab')]({'where':{'OpenchannelAccountId':_0xdb75e7},'order':'priority'})[_0x3fdc('0x1e')](function(_0x50a05c){_0x3dabc4=_0x50a05c;});}})[_0x3fdc('0x28')](function(_0x80077b){_0x46bbcf=0x1f4;logger[_0x3fdc('0x25')](_0x80077b[_0x3fdc('0x3a')]);if(_0x80077b[_0x3fdc('0x3b')]){delete _0x80077b[_0x3fdc('0x3b')];}_0x3dabc4=_0x80077b;})[_0x3fdc('0xac')](function(){if(_0x3dabc4===null){_0x191586[_0x3fdc('0x29')](_0x46bbcf);}else{if(_0x46bbcf===0x1f4){_0x191586[_0x3fdc('0x2a')](_0x46bbcf)[_0x3fdc('0x3c')](_0x3dabc4);}else{_0x191586[_0x3fdc('0x2a')](_0x46bbcf)[_0x3fdc('0x2c')](_0x3dabc4);}}});};exports[_0x3fdc('0xad')]=function(_0x44ffec,_0x38cd9b,_0x521fb9){var _0x4c7e49={};var _0x3d6f35={};var _0x5a43a9;var _0x4b51b4;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x44ffec[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x38cd9b,null))[_0x3fdc('0x1e')](function(_0x3512c6){if(_0x3512c6){_0x5a43a9=_0x3512c6;_0x3d6f35[_0x3fdc('0x43')]=_[_0x3fdc('0x45')](db[_0x3fdc('0xa9')][_0x3fdc('0x3f')]);_0x3d6f35[_0x3fdc('0x44')]=_[_0x3fdc('0x45')](_0x44ffec['query']);_0x3d6f35['filters']=_[_0x3fdc('0x48')](_0x3d6f35['model'],_0x3d6f35['query']);_0x4c7e49[_0x3fdc('0x47')]=_[_0x3fdc('0x48')](_0x3d6f35['model'],qs[_0x3fdc('0x49')](_0x44ffec['query'][_0x3fdc('0x49')]));_0x4c7e49['attributes']=_0x4c7e49[_0x3fdc('0x47')]['length']?_0x4c7e49[_0x3fdc('0x47')]:_0x3d6f35['model'];_0x4c7e49['order']=qs[_0x3fdc('0x4c')](_0x44ffec[_0x3fdc('0x44')][_0x3fdc('0x4c')]);_0x4c7e49[_0x3fdc('0x4d')]=qs['filters'](_[_0x3fdc('0x4e')](_0x44ffec[_0x3fdc('0x44')],_0x3d6f35[_0x3fdc('0x46')]));if(_0x44ffec[_0x3fdc('0x44')][_0x3fdc('0x4f')]){_0x4c7e49[_0x3fdc('0x4d')]=_[_0x3fdc('0x50')](_0x4c7e49[_0x3fdc('0x4d')],{'$or':_[_0x3fdc('0x3e')](_0x4c7e49[_0x3fdc('0x47')],function(_0x1a2c39){var _0x4c1e9b={};_0x4c1e9b[_0x1a2c39]={'$like':'%'+_0x44ffec[_0x3fdc('0x44')][_0x3fdc('0x4f')]+'%'};return _0x4c1e9b;})});}_0x4c7e49=_[_0x3fdc('0x50')]({},_0x4c7e49,_0x44ffec[_0x3fdc('0x51')]);return _0x5a43a9['getApplications'](_0x4c7e49);}})['then'](function(_0x24d83d){if(_0x24d83d){_0x4b51b4=_0x24d83d['length'];if(!_0x44ffec['query'][_0x3fdc('0x69')]('nolimit')){_0x4c7e49['limit']=qs['limit'](_0x44ffec[_0x3fdc('0x44')]['limit']);_0x4c7e49[_0x3fdc('0x2f')]=qs[_0x3fdc('0x2f')](_0x44ffec[_0x3fdc('0x44')]['offset']);}return _0x5a43a9[_0x3fdc('0xad')](_0x4c7e49);}})[_0x3fdc('0x1e')](function(_0x2a3ab9){if(_0x2a3ab9){return _0x2a3ab9?{'count':_0x4b51b4,'rows':_0x2a3ab9}:null;}})['then'](respondWithResult(_0x38cd9b,null))['catch'](handleError(_0x38cd9b,null));};exports['getInteractions']=function(_0x4f38f6,_0x59f97e,_0x56fd3c){var _0x165531={'raw':![],'where':{}};var _0x4050df={};var _0x4c0a79={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3fdc('0x6e')]({'where':{'id':_0x4f38f6['params']['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x59f97e,null))[_0x3fdc('0x1e')](function(_0x2288f8){if(_0x2288f8){_0x4050df['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x4050df[_0x3fdc('0x44')]=_[_0x3fdc('0x45')](_0x4f38f6[_0x3fdc('0x44')]);_0x4050df[_0x3fdc('0x46')]=_['intersection'](_0x4050df[_0x3fdc('0x43')],_0x4050df['query']);_0x165531['attributes']=_[_0x3fdc('0x48')](_0x4050df[_0x3fdc('0x43')],qs[_0x3fdc('0x49')](_0x4f38f6['query']['fields']));_0x165531[_0x3fdc('0x47')]=_0x165531['attributes'][_0x3fdc('0x4a')]?_0x165531[_0x3fdc('0x47')]:_0x4050df[_0x3fdc('0x43')];if(!_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0x69')]('nolimit')){_0x165531[_0x3fdc('0x30')]=qs[_0x3fdc('0x30')](_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0x30')]);_0x165531['offset']=qs[_0x3fdc('0x2f')](_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0x2f')]);}_0x165531[_0x3fdc('0x4b')]=qs[_0x3fdc('0x4c')](_0x4f38f6[_0x3fdc('0x44')]['sort']);_0x165531[_0x3fdc('0x4d')]=qs[_0x3fdc('0x46')](_['pick'](_0x4f38f6[_0x3fdc('0x44')],_0x4050df['filters']));_0x165531[_0x3fdc('0x4d')][_0x3fdc('0x66')]=_0x2288f8['id'];if(_0x4f38f6[_0x3fdc('0x44')]['filter']){_0x165531[_0x3fdc('0x4d')]=_[_0x3fdc('0x50')](_0x165531[_0x3fdc('0x4d')],{'$or':_[_0x3fdc('0x3e')](_0x165531[_0x3fdc('0x47')],function(_0x36e2a3){var _0x4f03ce={};_0x4f03ce[_0x36e2a3]={'$like':'%'+_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0x4f')]+'%'};return _0x4f03ce;})});}_0x165531=_['merge']({},_0x165531,_0x4f38f6[_0x3fdc('0x51')]);return db['OpenchannelInteraction'][_0x3fdc('0x2e')]({'where':_0x165531['where']})[_0x3fdc('0x1e')](function(_0x4238d6){_0x4c0a79[_0x3fdc('0x2e')]=_0x4238d6;if(_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0x53')]){_0x165531['include']=[{'model':db[_0x3fdc('0x74')],'as':_0x3fdc('0xae'),'required':![]},{'model':db[_0x3fdc('0xaf')],'as':_0x3fdc('0xb0'),'attributes':[_0x3fdc('0x3b'),'fullname',_0x3fdc('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x3fdc('0xb2'),'attributes':['id',_0x3fdc('0x3b'),_0x3fdc('0xb3')],'where':_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0xb4')]?{'id':_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0xb4')]}:undefined,'required':_0x4f38f6[_0x3fdc('0x44')][_0x3fdc('0xb4')]?!![]:![]}];}return db[_0x3fdc('0x92')][_0x3fdc('0x55')](_0x165531);})['then'](function(_0x2eda1a){_0x4c0a79[_0x3fdc('0x56')]=_0x2eda1a;return _0x4c0a79;});}})[_0x3fdc('0x1e')](respondWithFilteredResult(_0x59f97e,_0x165531))[_0x3fdc('0x28')](handleError(_0x59f97e,null));};exports['addAgents']=function(_0x2bcb18,_0x4345a0,_0x23734d){return db[_0x3fdc('0x52')]['find']({'where':{'id':_0x2bcb18['params']['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x4345a0,null))[_0x3fdc('0x1e')](function(_0x5a852a){if(_0x5a852a){return _0x5a852a[_0x3fdc('0xb5')](_0x2bcb18['body'][_0x3fdc('0x71')],_[_0x3fdc('0xb6')](_0x2bcb18[_0x3fdc('0x5c')],[_0x3fdc('0x71'),'id'])||{})['spread'](function(_0x2ec338){for(var _0x1eb1ee=0x0;_0x1eb1ee<_0x2bcb18[_0x3fdc('0x5c')][_0x3fdc('0x71')][_0x3fdc('0x4a')];_0x1eb1ee+=0x1){socket[_0x3fdc('0xb7')](_0x3fdc('0xb8'),{'UserId':Number(_0x2bcb18[_0x3fdc('0x5c')][_0x3fdc('0x71')][_0x1eb1ee]),'OpenchannelAccountId':Number(_0x2bcb18[_0x3fdc('0x58')]['id'])});}return _0x2ec338;});}})['then'](respondWithResult(_0x4345a0,null))['catch'](handleError(_0x4345a0,null));};exports['removeAgents']=function(_0x3c8db2,_0x355750,_0x271a40){return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x3c8db2[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x355750,null))[_0x3fdc('0x1e')](function(_0x51d2fa){if(_0x51d2fa){return _0x51d2fa['removeAgents'](_0x3c8db2[_0x3fdc('0x44')][_0x3fdc('0x71')])[_0x3fdc('0x1e')](function(){if(_[_0x3fdc('0xb9')](_0x3c8db2[_0x3fdc('0x44')][_0x3fdc('0x71')])){for(var _0x5027dd=0x0;_0x5027dd<_0x3c8db2[_0x3fdc('0x44')][_0x3fdc('0x71')][_0x3fdc('0x4a')];_0x5027dd+=0x1){socket[_0x3fdc('0xb7')](_0x3fdc('0xba'),{'UserId':Number(_0x3c8db2['query'][_0x3fdc('0x71')][_0x5027dd]),'OpenchannelAccountId':Number(_0x3c8db2[_0x3fdc('0x58')]['id'])});}}else{socket[_0x3fdc('0xb7')](_0x3fdc('0xba'),{'UserId':Number(_0x3c8db2[_0x3fdc('0x44')][_0x3fdc('0x71')]),'OpenchannelAccountId':Number(_0x3c8db2[_0x3fdc('0x58')]['id'])});}});}})[_0x3fdc('0x1e')](respondWithStatusCode(_0x355750,null))['catch'](handleError(_0x355750,null));};exports[_0x3fdc('0xbb')]=function(_0x3980db,_0x4e9613,_0x38fc31){var _0x3da1dd={};var _0x2e3c80={};var _0xc560d;var _0x225769;return db[_0x3fdc('0x52')][_0x3fdc('0x6e')]({'where':{'id':_0x3980db['params']['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x4e9613,null))['then'](function(_0x3a46e5){if(_0x3a46e5){_0xc560d=_0x3a46e5;_0x2e3c80[_0x3fdc('0x43')]=_[_0x3fdc('0x45')](db[_0x3fdc('0xaf')][_0x3fdc('0x3f')]);_0x2e3c80[_0x3fdc('0x44')]=_['keys'](_0x3980db[_0x3fdc('0x44')]);_0x2e3c80['filters']=_['intersection'](_0x2e3c80[_0x3fdc('0x43')],_0x2e3c80['query']);_0x3da1dd[_0x3fdc('0x47')]=_[_0x3fdc('0x48')](_0x2e3c80[_0x3fdc('0x43')],qs['fields'](_0x3980db['query'][_0x3fdc('0x49')]));_0x3da1dd['attributes']=_0x3da1dd[_0x3fdc('0x47')]['length']?_0x3da1dd[_0x3fdc('0x47')]:_0x2e3c80[_0x3fdc('0x43')];_0x3da1dd[_0x3fdc('0x4b')]=qs[_0x3fdc('0x4c')](_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x4c')]);_0x3da1dd['where']=qs[_0x3fdc('0x46')](_['pick'](_0x3980db[_0x3fdc('0x44')],_0x2e3c80[_0x3fdc('0x46')]));if(_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x4f')]){_0x3da1dd[_0x3fdc('0x4d')]=_[_0x3fdc('0x50')](_0x3da1dd['where'],{'$or':_['map'](_0x3da1dd[_0x3fdc('0x47')],function(_0x2c1fca){var _0x1f8a07={};_0x1f8a07[_0x2c1fca]={'$like':'%'+_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x4f')]+'%'};return _0x1f8a07;})});}_0x3da1dd=_['merge']({},_0x3da1dd,_0x3980db[_0x3fdc('0x51')]);return _0xc560d[_0x3fdc('0xbb')](_0x3da1dd);}})[_0x3fdc('0x1e')](function(_0x57fdc3){if(_0x57fdc3){_0x225769=_0x57fdc3[_0x3fdc('0x4a')];if(!_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x69')](_0x3fdc('0x6a'))){_0x3da1dd[_0x3fdc('0x30')]=qs['limit'](_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x30')]);_0x3da1dd[_0x3fdc('0x2f')]=qs[_0x3fdc('0x2f')](_0x3980db[_0x3fdc('0x44')][_0x3fdc('0x2f')]);}return _0xc560d[_0x3fdc('0xbb')](_0x3da1dd);}})[_0x3fdc('0x1e')](function(_0x5580ea){if(_0x5580ea){return _0x5580ea?{'count':_0x225769,'rows':_0x5580ea}:null;}})['then'](respondWithResult(_0x4e9613,null))['catch'](handleError(_0x4e9613,null));};exports[_0x3fdc('0x3c')]=function(_0x4b7a08,_0x4f3058,_0x10dfe9){var _0x3f83e1,_0xb8b592,_0x9df2a;if(_[_0x3fdc('0x7b')](_0x4b7a08['body'][_0x3fdc('0x5c')])||_0x4b7a08[_0x3fdc('0x5c')][_0x3fdc('0x5c')]===''){throw new db[(_0x3fdc('0x75'))][(_0x3fdc('0x7d'))](_0x3fdc('0x7f'));}if(_[_0x3fdc('0x7b')](_0x4b7a08[_0x3fdc('0x5c')]['to'])){}_0x3f83e1=_0x4b7a08[_0x3fdc('0x5c')]['to'];return db[_0x3fdc('0x52')][_0x3fdc('0x6e')]({'where':{'id':_0x4b7a08[_0x3fdc('0x58')]['id']}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x4f3058,null))['then'](function(_0x54dbe2){if(_0x54dbe2){return db[_0x3fdc('0x52')][_0x3fdc('0x5a')]({'where':{'id':_0x54dbe2['id']},'include':[{'model':db[_0x3fdc('0x83')],'as':'List','include':[{'model':db[_0x3fdc('0x74')],'as':_0x3fdc('0x84'),'where':{[_0x54dbe2['mapKey']]:_0x3f83e1},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x3fdc('0x1e')](handleEntityNotFound(_0x4f3058,null))[_0x3fdc('0x1e')](function(_0x3a6d59){if(_0x3a6d59&&_0x3a6d59[_0x3fdc('0x87')]){_0xb8b592=_0x3a6d59['get']({'plain':!![]});if(_0xb8b592[_0x3fdc('0x87')]&&_0xb8b592[_0x3fdc('0x87')][_0x3fdc('0x84')][_0x3fdc('0x4a')]){return _0xb8b592['List'][_0x3fdc('0x84')][0x0];}return db[_0x3fdc('0x74')]['create'](_[_0x3fdc('0xbc')](_0x4b7a08[_0x3fdc('0x5c')],{'firstName':_0x3f83e1,[_0x3a6d59['mapKey']]:_0x3f83e1,'phone':_0x3f83e1,'ListId':_0xb8b592[_0x3fdc('0x8c')]}));}})[_0x3fdc('0x1e')](handleEntityNotFound(_0x4f3058,null))[_0x3fdc('0x1e')](function(_0x5e1eee){if(_0x5e1eee){_0x9df2a=_0x5e1eee;return db[_0x3fdc('0x92')][_0x3fdc('0x5a')]({'where':{'ContactId':_0x9df2a['id'],'closed':![],'OpenchannelAccountId':_0xb8b592['id']}})[_0x3fdc('0x1e')](function(_0x5a100a){if(_0x5a100a){return[_0x5a100a,![]];}return db[_0x3fdc('0x92')]['create']({'UserId':_0x4b7a08['user']['id'],'ContactId':_0x9df2a['id'],'OpenchannelAccountId':_0xb8b592['id'],'lastMsgDirection':_0x3fdc('0xbd'),'Messages':[_['merge'](_0x4b7a08[_0x3fdc('0x5c')],{'read':![],'body':_0x4b7a08['body'][_0x3fdc('0x5c')],'OpenchannelAccountId':_0xb8b592['id'],'UserId':_0x4b7a08['user']['id'],'ContactId':_0x9df2a['id']})]},{'include':[{'model':db[_0x3fdc('0x9b')],'as':_0x3fdc('0xbe')}]})[_0x3fdc('0x1e')](function(_0x177458){return[_0x177458,!![]];});});}})[_0x3fdc('0x94')](function(_0x5999ef,_0x25d382){if(_0x25d382){return _0x5999ef;}return db[_0x3fdc('0x9b')]['create'](_[_0x3fdc('0x50')](_0x4b7a08[_0x3fdc('0x5c')],{'read':![],'body':_0x4b7a08[_0x3fdc('0x5c')][_0x3fdc('0x5c')],'OpenchannelAccountId':_0xb8b592['id'],'OpenchannelInteractionId':_0x5999ef['id'],'UserId':_0x4b7a08[_0x3fdc('0x5d')]['id'],'ContactId':_0x9df2a['id']}))[_0x3fdc('0x1e')](function(_0x32c847){_0x5999ef[_0x3fdc('0xbf')]['Messages']=[];_0x5999ef['dataValues'][_0x3fdc('0xbe')][_0x3fdc('0xc0')](_0x32c847[_0x3fdc('0xbf')]);return _0x5999ef;});});}})['then'](respondWithResult(_0x4f3058,null))['catch'](handleError(_0x4f3058,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5aef779..e75fd9c 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 _0x6c76=['update','emit','hook','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x4bdaa2,_0x3313a5){var _0x9e4dda=function(_0x5ad70d){while(--_0x5ad70d){_0x4bdaa2['push'](_0x4bdaa2['shift']());}};_0x9e4dda(++_0x3313a5);}(_0x6c76,0x184));var _0x66c7=function(_0x3a0be9,_0x214ee4){_0x3a0be9=_0x3a0be9-0x0;var _0xc1ec3e=_0x6c76[_0x3a0be9];return _0xc1ec3e;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var OpenchannelAccount=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x6e6c=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x36033b,_0x188f0e){var _0x11517e=function(_0x36b5d0){while(--_0x36b5d0){_0x36033b['push'](_0x36033b['shift']());}};_0x11517e(++_0x188f0e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var OpenchannelAccount=require(_0xc6e6('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc6e6('0x2')](0x0);var events={'afterCreate':_0xc6e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e97f5){return function(_0x5a9e2b,_0x40b7e1,_0x4b13f0){OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5+':'+_0x5a9e2b['id'],_0x5a9e2b);OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5,_0x5a9e2b);_0x4b13f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc6e6('0x5')](e,emitEvent(event));}}module[_0xc6e6('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8217d32..ad1b6e2 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(_0x18ef85,_0x1569dd){var _0x1b0a8b=function(_0x4dcc9f){while(--_0x4dcc9f){_0x18ef85['push'](_0x18ef85['shift']());}};_0x1b0a8b(++_0x1569dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x37ca7f,_0x33e40c){var _0x8f30cb=function(_0x4bf19f){while(--_0x4bf19f){_0x37ca7f['push'](_0x37ca7f['shift']());}};_0x8f30cb(++_0x33e40c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 99ca87b..5d380f8 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 _0x16d2=['request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x57528f,_0x3f6591){var _0x3d60bd=function(_0x1e0808){while(--_0x1e0808){_0x57528f['push'](_0x57528f['shift']());}};_0x3d60bd(++_0x3f6591);}(_0x16d2,0x123));var _0x216d=function(_0x1e46a5,_0x5b094e){_0x1e46a5=_0x1e46a5-0x0;var _0x35a2cf=_0x16d2[_0x1e46a5];return _0x35a2cf;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var moment=require(_0x216d('0x2'));var BPromise=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var fs=require('fs');var Redis=require(_0x216d('0x5'));var db=require(_0x216d('0x6'))['db'];var utils=require(_0x216d('0x7'));var logger=require(_0x216d('0x8'))('rpc');var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232a});config[_0x216d('0xd')]=_[_0x216d('0xe')](config[_0x216d('0xd')],{'host':_0x216d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x216d('0xd')]));require(_0x216d('0x10'))[_0x216d('0x11')](socket);function respondWithRpcPromise(_0x227c46,_0x301058,_0x729bdf){return new BPromise(function(_0x5682cc,_0x7ca9c9){return client['request'](_0x227c46,_0x729bdf)[_0x216d('0x12')](function(_0x2e02ce){logger[_0x216d('0x13')](_0x216d('0x14'),_0x301058,_0x216d('0x15'));logger[_0x216d('0x16')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x301058,_0x216d('0x15'),JSON['stringify'](_0x2e02ce));if(_0x2e02ce[_0x216d('0x17')]){if(_0x2e02ce[_0x216d('0x17')]['code']===0x1f4){logger[_0x216d('0x17')](_0x216d('0x14'),_0x301058,_0x2e02ce['error'][_0x216d('0x18')]);return _0x7ca9c9(_0x2e02ce['error'][_0x216d('0x18')]);}logger[_0x216d('0x17')](_0x216d('0x14'),_0x301058,_0x2e02ce[_0x216d('0x17')][_0x216d('0x18')]);return _0x5682cc(_0x2e02ce[_0x216d('0x17')][_0x216d('0x18')]);}else{logger[_0x216d('0x13')](_0x216d('0x14'),_0x301058,'request\x20sent');_0x5682cc(_0x2e02ce[_0x216d('0x19')]['message']);}})['catch'](function(_0x133838){logger[_0x216d('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x301058,_0x133838);_0x7ca9c9(_0x133838);});});} \ No newline at end of file +var _0x0abf=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./openchannelAccount.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index cbbcf26..69453aa 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 _0xd2ce=['length','save','update','emit','register'];(function(_0x1b046f,_0x8e5fa6){var _0x1f6c8f=function(_0x4a2f64){while(--_0x4a2f64){_0x1b046f['push'](_0x1b046f['shift']());}};_0x1f6c8f(++_0x8e5fa6);}(_0xd2ce,0x13c));var _0xed2c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd2ce[_0x6131cd];return _0x47e916;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xed2c('0x0'),'remove',_0xed2c('0x1')];function createListener(_0x271df9,_0x100271){return function(_0x1e3c07){_0x100271[_0xed2c('0x2')](_0x271df9,_0x1e3c07);};}function removeListener(_0x2fe29b,_0x418d1c){return function(){OpenchannelAccountEvents['removeListener'](_0x2fe29b,_0x418d1c);};}exports[_0xed2c('0x3')]=function(_0x5b6ccb){for(var _0x38aa25=0x0,_0x24cd4f=events[_0xed2c('0x4')];_0x38aa25<_0x24cd4f;_0x38aa25++){var _0x523fb0=events[_0x38aa25];var _0x255320=createListener('openchannelAccount:'+_0x523fb0,_0x5b6ccb);OpenchannelAccountEvents['on'](_0x523fb0,_0x255320);}}; \ No newline at end of file +var _0x44a3=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2ed879,_0x84d534){var _0x69e2c8=function(_0x4ddc3c){while(--_0x4ddc3c){_0x2ed879['push'](_0x2ed879['shift']());}};_0x69e2c8(++_0x84d534);}(_0x44a3,0x1a9));var _0x344a=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x44a3[_0x51b0dc];return _0x13fa89;};'use strict';var OpenchannelAccountEvents=require(_0x344a('0x0'));var events=[_0x344a('0x1'),_0x344a('0x2'),_0x344a('0x3')];function createListener(_0xdffe0b,_0x42b3a6){return function(_0x3bb844){_0x42b3a6[_0x344a('0x4')](_0xdffe0b,_0x3bb844);};}function removeListener(_0x528a13,_0x23004c){return function(){OpenchannelAccountEvents[_0x344a('0x5')](_0x528a13,_0x23004c);};}exports[_0x344a('0x6')]=function(_0x28b51e){for(var _0x39984a=0x0,_0x504bd1=events['length'];_0x39984a<_0x504bd1;_0x39984a++){var _0x55ddca=events[_0x39984a];var _0x484661=createListener(_0x344a('0x7')+_0x55ddca,_0x28b51e);OpenchannelAccountEvents['on'](_0x55ddca,_0x484661);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index bd6e072..e1cd3ab 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 _0x2687=['put','update','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','/:id','post','create'];(function(_0x4b15a4,_0x4241fe){var _0x40a783=function(_0x1f3de1){while(--_0x1f3de1){_0x4b15a4['push'](_0x4b15a4['shift']());}};_0x40a783(++_0x4241fe);}(_0x2687,0x8a));var _0x7268=function(_0x433b93,_0x40db4f){_0x433b93=_0x433b93-0x0;var _0x116edd=_0x2687[_0x433b93];return _0x116edd;};'use strict';var multer=require(_0x7268('0x0'));var util=require(_0x7268('0x1'));var path=require(_0x7268('0x2'));var timeout=require(_0x7268('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7268('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7268('0x5'));var controller=require(_0x7268('0x6'));router['get']('/',auth[_0x7268('0x7')](),controller['index']);router[_0x7268('0x8')](_0x7268('0x9'),auth[_0x7268('0x7')](),controller['show']);router[_0x7268('0xa')]('/',auth['isAuthenticated'](),controller[_0x7268('0xb')]);router[_0x7268('0xc')](_0x7268('0x9'),auth[_0x7268('0x7')](),controller[_0x7268('0xd')]);router['delete'](_0x7268('0x9'),auth[_0x7268('0x7')](),controller['destroy']);module[_0x7268('0xe')]=router; \ No newline at end of file +var _0x0637=['create','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0637,0x111));var _0x7063=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0637[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7063('0x0'));var util=require('util');var path=require(_0x7063('0x1'));var timeout=require('connect-timeout');var express=require(_0x7063('0x2'));var router=express[_0x7063('0x3')]();var fs_extra=require(_0x7063('0x4'));var auth=require(_0x7063('0x5'));var interaction=require(_0x7063('0x6'));var config=require(_0x7063('0x7'));var controller=require(_0x7063('0x8'));router[_0x7063('0x9')]('/',auth['isAuthenticated'](),controller[_0x7063('0xa')]);router[_0x7063('0x9')](_0x7063('0xb'),auth['isAuthenticated'](),controller[_0x7063('0xc')]);router[_0x7063('0xd')]('/',auth[_0x7063('0xe')](),controller[_0x7063('0xf')]);router['put']('/:id',auth[_0x7063('0xe')](),controller['update']);router['delete'](_0x7063('0xb'),auth[_0x7063('0xe')](),controller[_0x7063('0x10')]);module[_0x7063('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 916bc8d..ccbb47b 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 _0x6809=['STRING','sequelize','exports','INTEGER','TEXT'];(function(_0x469f6d,_0x46177a){var _0x6fd826=function(_0x2067ef){while(--_0x2067ef){_0x469f6d['push'](_0x469f6d['shift']());}};_0x6fd826(++_0x46177a);}(_0x6809,0x155));var _0x9680=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x6809[_0x14476b];return _0x24e2e8;};'use strict';var Sequelize=require(_0x9680('0x0'));module[_0x9680('0x1')]={'priority':{'type':Sequelize[_0x9680('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9680('0x3')]()},'description':{'type':Sequelize[_0x9680('0x4')]},'interval':{'type':Sequelize[_0x9680('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x76be=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1ca66c,_0x3e3868){var _0x5a78ce=function(_0x5432ac){while(--_0x5432ac){_0x1ca66c['push'](_0x1ca66c['shift']());}};_0x5a78ce(++_0x3e3868);}(_0x76be,0xe7));var _0xe76b=function(_0x244338,_0x523093){_0x244338=_0x244338-0x0;var _0xf3071e=_0x76be[_0x244338];return _0xf3071e;};'use strict';var Sequelize=require(_0xe76b('0x0'));module[_0xe76b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe76b('0x2')],'allowNull':![],'defaultValue':_0xe76b('0x3')},'appdata':{'type':Sequelize[_0xe76b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe76b('0x2')],'defaultValue':_0xe76b('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index c37c3e5..fdb1c3d 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 _0xd9b8=['save','then','stack','name','send','index','OpenchannelApplication','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','fields','find','catch','create','body','update','destroy','zip-dir','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x42f391,_0x52537f){var _0x57193f=function(_0x21c74f){while(--_0x21c74f){_0x42f391['push'](_0x42f391['shift']());}};_0x57193f(++_0x52537f);}(_0xd9b8,0x6f));var _0x8d9b=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xd9b8[_0xe1b5f6];return _0x44636e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8d9b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d9b('0x1'));var Mustache=require(_0x8d9b('0x2'));var util=require(_0x8d9b('0x3'));var path=require('path');var sox=require(_0x8d9b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d9b('0x5'));var _=require('lodash');var squel=require(_0x8d9b('0x6'));var crypto=require(_0x8d9b('0x7'));var jsforce=require(_0x8d9b('0x8'));var deskjs=require(_0x8d9b('0x9'));var toCsv=require(_0x8d9b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8d9b('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x8d9b('0xc'));var hardwareService=require(_0x8d9b('0xd'));var logger=require(_0x8d9b('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x8d9b('0xf'));var licenseUtil=require(_0x8d9b('0x10'));var db=require(_0x8d9b('0x11'))['db'];function respondWithStatusCode(_0x4d081c,_0x37b5ef){_0x37b5ef=_0x37b5ef||0xcc;return function(_0x31ff00){if(_0x31ff00){return _0x4d081c[_0x8d9b('0x12')](_0x37b5ef);}return _0x4d081c['status'](_0x37b5ef)[_0x8d9b('0x13')]();};}function respondWithResult(_0x14efd9,_0x3d359c){_0x3d359c=_0x3d359c||0xc8;return function(_0x5dfbee){if(_0x5dfbee){return _0x14efd9[_0x8d9b('0x14')](_0x3d359c)[_0x8d9b('0x15')](_0x5dfbee);}};}function respondWithFilteredResult(_0x314223,_0x2d325e){return function(_0x148e03){if(_0x148e03){var _0x13f40b=typeof _0x2d325e[_0x8d9b('0x16')]===_0x8d9b('0x17')&&typeof _0x2d325e['limit']===_0x8d9b('0x17');var _0x27f3ec=_0x148e03[_0x8d9b('0x18')];var _0x2a40e8=_0x13f40b?0x0:_0x2d325e[_0x8d9b('0x16')];var _0x170d19=_0x13f40b?_0x148e03[_0x8d9b('0x18')]:_0x2d325e[_0x8d9b('0x16')]+_0x2d325e['limit'];var _0x14a066;if(_0x170d19>=_0x27f3ec){_0x170d19=_0x27f3ec;_0x14a066=0xc8;}else{_0x14a066=0xce;}_0x314223[_0x8d9b('0x14')](_0x14a066);return _0x314223[_0x8d9b('0x19')](_0x8d9b('0x1a'),_0x2a40e8+'-'+_0x170d19+'/'+_0x27f3ec)[_0x8d9b('0x15')](_0x148e03);}return null;};}function patchUpdates(_0x22befc){return function(_0x3700d3){try{jsonpatch[_0x8d9b('0x1b')](_0x3700d3,_0x22befc,!![]);}catch(_0x4b5b24){return BPromise[_0x8d9b('0x1c')](_0x4b5b24);}return _0x3700d3[_0x8d9b('0x1d')]();};}function saveUpdates(_0x5d9756,_0xefb06d){return function(_0x5e7d29){if(_0x5e7d29){return _0x5e7d29['update'](_0x5d9756)[_0x8d9b('0x1e')](function(_0x1b8b8f){return _0x1b8b8f;});}return null;};}function removeEntity(_0x363f5c,_0x52bfc9){return function(_0x30d4dc){if(_0x30d4dc){return _0x30d4dc['destroy']()[_0x8d9b('0x1e')](function(){_0x363f5c[_0x8d9b('0x14')](0xcc)[_0x8d9b('0x13')]();});}};}function handleEntityNotFound(_0x5cded8,_0x4332e6){return function(_0x110ec0){if(!_0x110ec0){_0x5cded8['sendStatus'](0x194);}return _0x110ec0;};}function handleError(_0x3e2bd8,_0x3ec91e){_0x3ec91e=_0x3ec91e||0x1f4;return function(_0x325f20){logger['error'](_0x325f20[_0x8d9b('0x1f')]);if(_0x325f20[_0x8d9b('0x20')]){delete _0x325f20[_0x8d9b('0x20')];}_0x3e2bd8[_0x8d9b('0x14')](_0x3ec91e)[_0x8d9b('0x21')](_0x325f20);};}exports[_0x8d9b('0x22')]=function(_0x38efe5,_0x2f25a2){var _0x4d1d82={},_0x4b62ca={},_0x318fdd={'count':0x0,'rows':[]};var _0x2ceb47=_['map'](db[_0x8d9b('0x23')]['rawAttributes'],function(_0x53a6f2){return{'name':_0x53a6f2[_0x8d9b('0x24')],'type':_0x53a6f2[_0x8d9b('0x25')][_0x8d9b('0x26')]};});_0x4b62ca[_0x8d9b('0x27')]=_['map'](_0x2ceb47,'name');_0x4b62ca['query']=_[_0x8d9b('0x28')](_0x38efe5[_0x8d9b('0x29')]);_0x4b62ca['filters']=_[_0x8d9b('0x2a')](_0x4b62ca['model'],_0x4b62ca[_0x8d9b('0x29')]);_0x4d1d82[_0x8d9b('0x2b')]=_[_0x8d9b('0x2a')](_0x4b62ca[_0x8d9b('0x27')],qs['fields'](_0x38efe5[_0x8d9b('0x29')]['fields']));_0x4d1d82[_0x8d9b('0x2b')]=_0x4d1d82[_0x8d9b('0x2b')][_0x8d9b('0x2c')]?_0x4d1d82[_0x8d9b('0x2b')]:_0x4b62ca[_0x8d9b('0x27')];if(!_0x38efe5[_0x8d9b('0x29')][_0x8d9b('0x2d')](_0x8d9b('0x2e'))){_0x4d1d82[_0x8d9b('0x2f')]=qs[_0x8d9b('0x2f')](_0x38efe5[_0x8d9b('0x29')][_0x8d9b('0x2f')]);_0x4d1d82[_0x8d9b('0x16')]=qs[_0x8d9b('0x16')](_0x38efe5['query'][_0x8d9b('0x16')]);}_0x4d1d82[_0x8d9b('0x30')]=qs[_0x8d9b('0x31')](_0x38efe5['query'][_0x8d9b('0x31')]);_0x4d1d82[_0x8d9b('0x32')]=qs['filters'](_[_0x8d9b('0x33')](_0x38efe5[_0x8d9b('0x29')],_0x4b62ca[_0x8d9b('0x34')]),_0x2ceb47);if(_0x38efe5['query']['filter']){_0x4d1d82['where']=_[_0x8d9b('0x35')](_0x4d1d82[_0x8d9b('0x32')],{'$or':_[_0x8d9b('0x36')](_0x2ceb47,function(_0x4ea9e9){if(_0x4ea9e9[_0x8d9b('0x25')]!==_0x8d9b('0x37')){var _0x146b38={};_0x146b38[_0x4ea9e9['name']]={'$like':'%'+_0x38efe5[_0x8d9b('0x29')][_0x8d9b('0x38')]+'%'};return _0x146b38;}})});}_0x4d1d82=_['merge']({},_0x4d1d82,_0x38efe5[_0x8d9b('0x39')]);var _0x12f7f9={'where':_0x4d1d82[_0x8d9b('0x32')]};return db[_0x8d9b('0x23')][_0x8d9b('0x18')](_0x12f7f9)[_0x8d9b('0x1e')](function(_0x102746){_0x318fdd[_0x8d9b('0x18')]=_0x102746;if(_0x38efe5[_0x8d9b('0x29')][_0x8d9b('0x3a')]){_0x4d1d82[_0x8d9b('0x3b')]=[{'all':!![]}];}return db[_0x8d9b('0x23')][_0x8d9b('0x3c')](_0x4d1d82);})[_0x8d9b('0x1e')](function(_0x1731ae){_0x318fdd[_0x8d9b('0x3d')]=_0x1731ae;return _0x318fdd;})['then'](respondWithFilteredResult(_0x2f25a2,_0x4d1d82))['catch'](handleError(_0x2f25a2,null));};exports['show']=function(_0xd132b9,_0x5eb883){var _0xe73c89={'raw':!![],'where':{'id':_0xd132b9[_0x8d9b('0x3e')]['id']}},_0x4e5d24={};_0x4e5d24[_0x8d9b('0x27')]=_[_0x8d9b('0x28')](db[_0x8d9b('0x23')]['rawAttributes']);_0x4e5d24['query']=_[_0x8d9b('0x28')](_0xd132b9[_0x8d9b('0x29')]);_0x4e5d24[_0x8d9b('0x34')]=_['intersection'](_0x4e5d24[_0x8d9b('0x27')],_0x4e5d24[_0x8d9b('0x29')]);_0xe73c89[_0x8d9b('0x2b')]=_[_0x8d9b('0x2a')](_0x4e5d24['model'],qs[_0x8d9b('0x3f')](_0xd132b9[_0x8d9b('0x29')][_0x8d9b('0x3f')]));_0xe73c89['attributes']=_0xe73c89[_0x8d9b('0x2b')]['length']?_0xe73c89[_0x8d9b('0x2b')]:_0x4e5d24[_0x8d9b('0x27')];if(_0xd132b9[_0x8d9b('0x29')][_0x8d9b('0x3a')]){_0xe73c89['include']=[{'all':!![]}];}_0xe73c89=_[_0x8d9b('0x35')]({},_0xe73c89,_0xd132b9[_0x8d9b('0x39')]);return db[_0x8d9b('0x23')][_0x8d9b('0x40')](_0xe73c89)[_0x8d9b('0x1e')](handleEntityNotFound(_0x5eb883,null))[_0x8d9b('0x1e')](respondWithResult(_0x5eb883,null))[_0x8d9b('0x41')](handleError(_0x5eb883,null));};exports[_0x8d9b('0x42')]=function(_0x55e193,_0x402d7a){return db['OpenchannelApplication'][_0x8d9b('0x42')](_0x55e193[_0x8d9b('0x43')],{})[_0x8d9b('0x1e')](respondWithResult(_0x402d7a,0xc9))[_0x8d9b('0x41')](handleError(_0x402d7a,null));};exports[_0x8d9b('0x44')]=function(_0x403f8b,_0x2cd375){if(_0x403f8b['body']['id']){delete _0x403f8b[_0x8d9b('0x43')]['id'];}return db[_0x8d9b('0x23')][_0x8d9b('0x40')]({'where':{'id':_0x403f8b[_0x8d9b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2cd375,null))[_0x8d9b('0x1e')](saveUpdates(_0x403f8b[_0x8d9b('0x43')],null))['then'](respondWithResult(_0x2cd375,null))[_0x8d9b('0x41')](handleError(_0x2cd375,null));};exports[_0x8d9b('0x45')]=function(_0x5e9775,_0x319871){return db['OpenchannelApplication'][_0x8d9b('0x40')]({'where':{'id':_0x5e9775[_0x8d9b('0x3e')]['id']}})[_0x8d9b('0x1e')](handleEntityNotFound(_0x319871,null))['then'](removeEntity(_0x319871,null))[_0x8d9b('0x41')](handleError(_0x319871,null));}; \ No newline at end of file +var _0xe61f=['error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','OpenchannelApplication','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','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','../../mysqldb','status','json','undefined','limit','offset','apply','save','update','then','destroy','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe61f,0x6e));var _0xfe61=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe61f[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xfe61('0x0'));var rimraf=require(_0xfe61('0x1'));var zipdir=require(_0xfe61('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe61('0x3'));var Mustache=require(_0xfe61('0x4'));var util=require('util');var path=require(_0xfe61('0x5'));var sox=require('sox');var csv=require(_0xfe61('0x6'));var ejs=require(_0xfe61('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe61('0x8'));var squel=require(_0xfe61('0x9'));var crypto=require(_0xfe61('0xa'));var jsforce=require(_0xfe61('0xb'));var deskjs=require(_0xfe61('0xc'));var toCsv=require(_0xfe61('0x6'));var querystring=require(_0xfe61('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe61('0xe'));var authService=require(_0xfe61('0xf'));var qs=require(_0xfe61('0x10'));var as=require(_0xfe61('0x11'));var hardwareService=require(_0xfe61('0x12'));var logger=require('../../config/logger')(_0xfe61('0x13'));var utils=require(_0xfe61('0x14'));var config=require(_0xfe61('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe61('0x16'))['db'];function respondWithStatusCode(_0x2c0fbc,_0x3cd771){_0x3cd771=_0x3cd771||0xcc;return function(_0x4edd53){if(_0x4edd53){return _0x2c0fbc['sendStatus'](_0x3cd771);}return _0x2c0fbc[_0xfe61('0x17')](_0x3cd771)['end']();};}function respondWithResult(_0x266a9f,_0x391a06){_0x391a06=_0x391a06||0xc8;return function(_0x5ca55d){if(_0x5ca55d){return _0x266a9f['status'](_0x391a06)[_0xfe61('0x18')](_0x5ca55d);}};}function respondWithFilteredResult(_0xb801a,_0x31d186){return function(_0x3184b5){if(_0x3184b5){var _0x318424=typeof _0x31d186['offset']===_0xfe61('0x19')&&typeof _0x31d186[_0xfe61('0x1a')]===_0xfe61('0x19');var _0x594a54=_0x3184b5['count'];var _0x4a2539=_0x318424?0x0:_0x31d186['offset'];var _0x3e1089=_0x318424?_0x3184b5['count']:_0x31d186[_0xfe61('0x1b')]+_0x31d186['limit'];var _0x535309;if(_0x3e1089>=_0x594a54){_0x3e1089=_0x594a54;_0x535309=0xc8;}else{_0x535309=0xce;}_0xb801a[_0xfe61('0x17')](_0x535309);return _0xb801a['set']('Content-Range',_0x4a2539+'-'+_0x3e1089+'/'+_0x594a54)[_0xfe61('0x18')](_0x3184b5);}return null;};}function patchUpdates(_0x5ee7f3){return function(_0xa75e9b){try{jsonpatch[_0xfe61('0x1c')](_0xa75e9b,_0x5ee7f3,!![]);}catch(_0x381872){return BPromise['reject'](_0x381872);}return _0xa75e9b[_0xfe61('0x1d')]();};}function saveUpdates(_0x1d93fa,_0x15d3e1){return function(_0x2194c7){if(_0x2194c7){return _0x2194c7[_0xfe61('0x1e')](_0x1d93fa)[_0xfe61('0x1f')](function(_0x377c58){return _0x377c58;});}return null;};}function removeEntity(_0x282974,_0x14ea9a){return function(_0xef053){if(_0xef053){return _0xef053[_0xfe61('0x20')]()['then'](function(){_0x282974[_0xfe61('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c93a5,_0x3bc915){return function(_0x413b30){if(!_0x413b30){_0x1c93a5[_0xfe61('0x21')](0x194);}return _0x413b30;};}function handleError(_0x4df546,_0x1a2161){_0x1a2161=_0x1a2161||0x1f4;return function(_0x85bafe){logger[_0xfe61('0x22')](_0x85bafe[_0xfe61('0x23')]);if(_0x85bafe[_0xfe61('0x24')]){delete _0x85bafe['name'];}_0x4df546[_0xfe61('0x17')](_0x1a2161)[_0xfe61('0x25')](_0x85bafe);};}exports[_0xfe61('0x26')]=function(_0x398956,_0x5b9282){var _0x4a3349={},_0x3d5afc={},_0x5870a2={'count':0x0,'rows':[]};var _0x1d756f=_[_0xfe61('0x27')](db['OpenchannelApplication']['rawAttributes'],function(_0x3bc297){return{'name':_0x3bc297['fieldName'],'type':_0x3bc297[_0xfe61('0x28')][_0xfe61('0x29')]};});_0x3d5afc[_0xfe61('0x2a')]=_['map'](_0x1d756f,_0xfe61('0x24'));_0x3d5afc[_0xfe61('0x2b')]=_[_0xfe61('0x2c')](_0x398956[_0xfe61('0x2b')]);_0x3d5afc[_0xfe61('0x2d')]=_[_0xfe61('0x2e')](_0x3d5afc[_0xfe61('0x2a')],_0x3d5afc[_0xfe61('0x2b')]);_0x4a3349[_0xfe61('0x2f')]=_[_0xfe61('0x2e')](_0x3d5afc[_0xfe61('0x2a')],qs['fields'](_0x398956[_0xfe61('0x2b')][_0xfe61('0x30')]));_0x4a3349[_0xfe61('0x2f')]=_0x4a3349[_0xfe61('0x2f')][_0xfe61('0x31')]?_0x4a3349['attributes']:_0x3d5afc[_0xfe61('0x2a')];if(!_0x398956[_0xfe61('0x2b')][_0xfe61('0x32')](_0xfe61('0x33'))){_0x4a3349[_0xfe61('0x1a')]=qs[_0xfe61('0x1a')](_0x398956[_0xfe61('0x2b')][_0xfe61('0x1a')]);_0x4a3349[_0xfe61('0x1b')]=qs['offset'](_0x398956[_0xfe61('0x2b')][_0xfe61('0x1b')]);}_0x4a3349[_0xfe61('0x34')]=qs[_0xfe61('0x35')](_0x398956[_0xfe61('0x2b')]['sort']);_0x4a3349['where']=qs['filters'](_[_0xfe61('0x36')](_0x398956[_0xfe61('0x2b')],_0x3d5afc[_0xfe61('0x2d')]),_0x1d756f);if(_0x398956[_0xfe61('0x2b')][_0xfe61('0x37')]){_0x4a3349[_0xfe61('0x38')]=_[_0xfe61('0x39')](_0x4a3349[_0xfe61('0x38')],{'$or':_[_0xfe61('0x27')](_0x1d756f,function(_0x441fac){if(_0x441fac[_0xfe61('0x28')]!=='VIRTUAL'){var _0x16b87e={};_0x16b87e[_0x441fac[_0xfe61('0x24')]]={'$like':'%'+_0x398956[_0xfe61('0x2b')][_0xfe61('0x37')]+'%'};return _0x16b87e;}})});}_0x4a3349=_['merge']({},_0x4a3349,_0x398956[_0xfe61('0x3a')]);var _0x25463a={'where':_0x4a3349[_0xfe61('0x38')]};return db[_0xfe61('0x3b')][_0xfe61('0x3c')](_0x25463a)[_0xfe61('0x1f')](function(_0x42a6c6){_0x5870a2[_0xfe61('0x3c')]=_0x42a6c6;if(_0x398956[_0xfe61('0x2b')][_0xfe61('0x3d')]){_0x4a3349[_0xfe61('0x3e')]=[{'all':!![]}];}return db[_0xfe61('0x3b')][_0xfe61('0x3f')](_0x4a3349);})[_0xfe61('0x1f')](function(_0x274a28){_0x5870a2[_0xfe61('0x40')]=_0x274a28;return _0x5870a2;})['then'](respondWithFilteredResult(_0x5b9282,_0x4a3349))[_0xfe61('0x41')](handleError(_0x5b9282,null));};exports[_0xfe61('0x42')]=function(_0x529644,_0x1f0003){var _0x5ced79={'raw':!![],'where':{'id':_0x529644['params']['id']}},_0x217fdd={};_0x217fdd[_0xfe61('0x2a')]=_['keys'](db[_0xfe61('0x3b')][_0xfe61('0x43')]);_0x217fdd[_0xfe61('0x2b')]=_[_0xfe61('0x2c')](_0x529644[_0xfe61('0x2b')]);_0x217fdd[_0xfe61('0x2d')]=_[_0xfe61('0x2e')](_0x217fdd[_0xfe61('0x2a')],_0x217fdd[_0xfe61('0x2b')]);_0x5ced79[_0xfe61('0x2f')]=_[_0xfe61('0x2e')](_0x217fdd['model'],qs[_0xfe61('0x30')](_0x529644['query'][_0xfe61('0x30')]));_0x5ced79[_0xfe61('0x2f')]=_0x5ced79[_0xfe61('0x2f')][_0xfe61('0x31')]?_0x5ced79[_0xfe61('0x2f')]:_0x217fdd[_0xfe61('0x2a')];if(_0x529644['query'][_0xfe61('0x3d')]){_0x5ced79[_0xfe61('0x3e')]=[{'all':!![]}];}_0x5ced79=_['merge']({},_0x5ced79,_0x529644[_0xfe61('0x3a')]);return db['OpenchannelApplication'][_0xfe61('0x44')](_0x5ced79)[_0xfe61('0x1f')](handleEntityNotFound(_0x1f0003,null))[_0xfe61('0x1f')](respondWithResult(_0x1f0003,null))['catch'](handleError(_0x1f0003,null));};exports[_0xfe61('0x45')]=function(_0x383d75,_0x26d461){return db[_0xfe61('0x3b')][_0xfe61('0x45')](_0x383d75[_0xfe61('0x46')],{})[_0xfe61('0x1f')](respondWithResult(_0x26d461,0xc9))['catch'](handleError(_0x26d461,null));};exports[_0xfe61('0x1e')]=function(_0x1ce32a,_0x5b49ea){if(_0x1ce32a[_0xfe61('0x46')]['id']){delete _0x1ce32a[_0xfe61('0x46')]['id'];}return db[_0xfe61('0x3b')][_0xfe61('0x44')]({'where':{'id':_0x1ce32a['params']['id']}})[_0xfe61('0x1f')](handleEntityNotFound(_0x5b49ea,null))['then'](saveUpdates(_0x1ce32a[_0xfe61('0x46')],null))['then'](respondWithResult(_0x5b49ea,null))['catch'](handleError(_0x5b49ea,null));};exports[_0xfe61('0x20')]=function(_0x156951,_0x4d3011){return db['OpenchannelApplication'][_0xfe61('0x44')]({'where':{'id':_0x156951[_0xfe61('0x47')]['id']}})[_0xfe61('0x1f')](handleEntityNotFound(_0x4d3011,null))[_0xfe61('0x1f')](removeEntity(_0x4d3011,null))[_0xfe61('0x41')](handleError(_0x4d3011,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 6a505d1..c83e4bb 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 _0x766b=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise'];(function(_0x58ed28,_0x330aad){var _0xb22bbc=function(_0x4c7eef){while(--_0x4c7eef){_0x58ed28['push'](_0x58ed28['shift']());}};_0xb22bbc(++_0x330aad);}(_0x766b,0x91));var _0xb766=function(_0x2ccc69,_0x82f30f){_0x2ccc69=_0x2ccc69-0x0;var _0x157a37=_0x766b[_0x2ccc69];return _0x157a37;};'use strict';var _=require(_0xb766('0x0'));var util=require(_0xb766('0x1'));var logger=require('../../config/logger')(_0xb766('0x2'));var moment=require(_0xb766('0x3'));var BPromise=require('bluebird');var rp=require(_0xb766('0x4'));var fs=require('fs');var path=require(_0xb766('0x5'));var rimraf=require(_0xb766('0x6'));var config=require(_0xb766('0x7'));var attributes=require(_0xb766('0x8'));module[_0xb766('0x9')]=function(_0x1c32d9,_0x541507){return _0x1c32d9[_0xb766('0xa')](_0xb766('0xb'),attributes,{'tableName':_0xb766('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb766('0xd'),'collate':_0xb766('0xe')});}; \ No newline at end of file +var _0x13d7=['bluebird','request-promise','path','rimraf','define','openchannel_applications','utf8mb4','lodash','../../config/logger','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x13d7,0x9d));var _0x713d=function(_0xe5ffd2,_0x5be372){_0xe5ffd2=_0xe5ffd2-0x0;var _0x34db97=_0x13d7[_0xe5ffd2];return _0x34db97;};'use strict';var _=require(_0x713d('0x0'));var util=require('util');var logger=require(_0x713d('0x1'))('api');var moment=require(_0x713d('0x2'));var BPromise=require(_0x713d('0x3'));var rp=require(_0x713d('0x4'));var fs=require('fs');var path=require(_0x713d('0x5'));var rimraf=require(_0x713d('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x26bfeb,_0x57045f){return _0x26bfeb[_0x713d('0x7')]('OpenchannelApplication',attributes,{'tableName':_0x713d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x713d('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fdc1010..86dd883 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 _0xccc3=['UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x508141,_0xa60922){var _0x38fc72=function(_0x30aa71){while(--_0x30aa71){_0x508141['push'](_0x508141['shift']());}};_0x38fc72(++_0xa60922);}(_0xccc3,0x8a));var _0x3ccc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xccc3[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3ccc('0x0'));var util=require(_0x3ccc('0x1'));var moment=require(_0x3ccc('0x2'));var BPromise=require(_0x3ccc('0x3'));var rs=require(_0x3ccc('0x4'));var fs=require('fs');var Redis=require(_0x3ccc('0x5'));var db=require(_0x3ccc('0x6'))['db'];var utils=require(_0x3ccc('0x7'));var logger=require(_0x3ccc('0x8'))('rpc');var config=require(_0x3ccc('0x9'));var jayson=require(_0x3ccc('0xa'));var client=jayson[_0x3ccc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15c25c,_0x319edd,_0x1ca822){return new BPromise(function(_0x254a67,_0x4b0320){return client[_0x3ccc('0xc')](_0x15c25c,_0x1ca822)[_0x3ccc('0xd')](function(_0x286929){logger[_0x3ccc('0xe')](_0x3ccc('0xf'),_0x319edd,_0x3ccc('0x10'));logger[_0x3ccc('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x319edd,'request\x20sent',JSON['stringify'](_0x286929));if(_0x286929[_0x3ccc('0x12')]){if(_0x286929[_0x3ccc('0x12')][_0x3ccc('0x13')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x319edd,_0x286929[_0x3ccc('0x12')][_0x3ccc('0x14')]);return _0x4b0320(_0x286929['error'][_0x3ccc('0x14')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x319edd,_0x286929[_0x3ccc('0x12')]['message']);return _0x254a67(_0x286929[_0x3ccc('0x12')]['message']);}else{logger[_0x3ccc('0xe')](_0x3ccc('0xf'),_0x319edd,_0x3ccc('0x10'));_0x254a67(_0x286929['result'][_0x3ccc('0x14')]);}})[_0x3ccc('0x15')](function(_0x1e4eb1){logger[_0x3ccc('0x12')](_0x3ccc('0xf'),_0x319edd,_0x1e4eb1);_0x4b0320(_0x1e4eb1);});});}exports[_0x3ccc('0x16')]=function(_0x3de6c0){var _0x1fce45=this;return new Promise(function(_0x2c5fbd,_0x36b58b){return db[_0x3ccc('0x17')][_0x3ccc('0x18')](_0x3de6c0[_0x3ccc('0x19')],{'raw':_0x3de6c0[_0x3ccc('0x1a')]?_0x3de6c0[_0x3ccc('0x1a')][_0x3ccc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3de6c0[_0x3ccc('0x1a')]?_0x3de6c0['options'][_0x3ccc('0x1c')]||null:null,'attributes':_0x3de6c0[_0x3ccc('0x1a')]?_0x3de6c0['options'][_0x3ccc('0x1d')]||null:null,'limit':_0x3de6c0['options']?_0x3de6c0['options'][_0x3ccc('0x1e')]||null:null})[_0x3ccc('0xd')](function(_0x5ed6f6){logger['info'](_0x3ccc('0x16'),_0x3de6c0);logger[_0x3ccc('0x11')](_0x3ccc('0x16'),_0x3de6c0,JSON[_0x3ccc('0x1f')](_0x5ed6f6));_0x2c5fbd(_0x5ed6f6);})[_0x3ccc('0x15')](function(_0x8c5886){logger['error'](_0x3ccc('0x16'),_0x8c5886[_0x3ccc('0x14')],_0x3de6c0);_0x36b58b(_0x1fce45[_0x3ccc('0x12')](0x1f4,_0x8c5886[_0x3ccc('0x14')]));});});}; \ No newline at end of file +var _0x342c=['request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update','body','options','attributes','limit','UpdateOpenchannelApplication','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x342c,0x146));var _0xc342=function(_0x3b6f56,_0x3371e2){_0x3b6f56=_0x3b6f56-0x0;var _0x33bc40=_0x342c[_0x3b6f56];return _0x33bc40;};'use strict';var _=require(_0xc342('0x0'));var util=require(_0xc342('0x1'));var moment=require('moment');var BPromise=require(_0xc342('0x2'));var rs=require(_0xc342('0x3'));var fs=require('fs');var Redis=require(_0xc342('0x4'));var db=require(_0xc342('0x5'))['db'];var utils=require(_0xc342('0x6'));var logger=require(_0xc342('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc342('0x8'));var client=jayson[_0xc342('0x9')][_0xc342('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3766bf,_0x380ee8,_0x310daf){return new BPromise(function(_0x42e3fa,_0x2ed6a7){return client[_0xc342('0xb')](_0x3766bf,_0x310daf)[_0xc342('0xc')](function(_0x16dc37){logger[_0xc342('0xd')](_0xc342('0xe'),_0x380ee8,_0xc342('0xf'));logger['debug'](_0xc342('0x10'),_0x380ee8,_0xc342('0xf'),JSON[_0xc342('0x11')](_0x16dc37));if(_0x16dc37['error']){if(_0x16dc37[_0xc342('0x12')][_0xc342('0x13')]===0x1f4){logger[_0xc342('0x12')](_0xc342('0xe'),_0x380ee8,_0x16dc37[_0xc342('0x12')][_0xc342('0x14')]);return _0x2ed6a7(_0x16dc37['error'][_0xc342('0x14')]);}logger[_0xc342('0x12')](_0xc342('0xe'),_0x380ee8,_0x16dc37[_0xc342('0x12')][_0xc342('0x14')]);return _0x42e3fa(_0x16dc37[_0xc342('0x12')][_0xc342('0x14')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x380ee8,_0xc342('0xf'));_0x42e3fa(_0x16dc37[_0xc342('0x15')][_0xc342('0x14')]);}})[_0xc342('0x16')](function(_0x188228){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x380ee8,_0x188228);_0x2ed6a7(_0x188228);});});}exports['UpdateOpenchannelApplication']=function(_0x58f714){var _0x3b3be6=this;return new Promise(function(_0x1b7f96,_0x4d2fda){return db[_0xc342('0x17')][_0xc342('0x18')](_0x58f714[_0xc342('0x19')],{'raw':_0x58f714[_0xc342('0x1a')]?_0x58f714[_0xc342('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f714['options']?_0x58f714['options']['where']||null:null,'attributes':_0x58f714['options']?_0x58f714[_0xc342('0x1a')][_0xc342('0x1b')]||null:null,'limit':_0x58f714[_0xc342('0x1a')]?_0x58f714[_0xc342('0x1a')][_0xc342('0x1c')]||null:null})[_0xc342('0xc')](function(_0x1bd7ce){logger['info'](_0xc342('0x1d'),_0x58f714);logger[_0xc342('0x1e')](_0xc342('0x1d'),_0x58f714,JSON[_0xc342('0x11')](_0x1bd7ce));_0x1b7f96(_0x1bd7ce);})[_0xc342('0x16')](function(_0x254636){logger[_0xc342('0x12')](_0xc342('0x1d'),_0x254636['message'],_0x58f714);_0x4d2fda(_0x3b3be6[_0xc342('0x12')](0x1f4,_0x254636['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 69fbd99..941b108 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 _0xa3f3=['/:id/messages','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','download','post','create'];(function(_0x5a6a7b,_0x88a84d){var _0x1aac07=function(_0x2e37c8){while(--_0x2e37c8){_0x5a6a7b['push'](_0x5a6a7b['shift']());}};_0x1aac07(++_0x88a84d);}(_0xa3f3,0x141));var _0x3a3f=function(_0x1ed182,_0x13b3c5){_0x1ed182=_0x1ed182-0x0;var _0x22dde0=_0xa3f3[_0x1ed182];return _0x22dde0;};'use strict';var multer=require(_0x3a3f('0x0'));var util=require(_0x3a3f('0x1'));var path=require(_0x3a3f('0x2'));var timeout=require(_0x3a3f('0x3'));var express=require(_0x3a3f('0x4'));var router=express['Router']();var fs_extra=require(_0x3a3f('0x5'));var auth=require(_0x3a3f('0x6'));var interaction=require(_0x3a3f('0x7'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x3a3f('0x8')]('/',auth[_0x3a3f('0x9')](),controller[_0x3a3f('0xa')]);router['get'](_0x3a3f('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3a3f('0xc'),auth[_0x3a3f('0x9')](),controller[_0x3a3f('0xd')]);router[_0x3a3f('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x3a3f('0xe')]);router[_0x3a3f('0x8')](_0x3a3f('0xf'),auth['isAuthenticated'](),controller[_0x3a3f('0x10')]);router[_0x3a3f('0x11')]('/',auth[_0x3a3f('0x9')](),controller[_0x3a3f('0x12')]);router[_0x3a3f('0x11')](_0x3a3f('0x13'),auth[_0x3a3f('0x9')](),controller[_0x3a3f('0x14')]);router['post']('/:id/tags',auth[_0x3a3f('0x9')](),interaction[_0x3a3f('0x15')](_0x3a3f('0x16'),_0x3a3f('0x17')),controller[_0x3a3f('0x18')]);router[_0x3a3f('0x19')](_0x3a3f('0xc'),auth[_0x3a3f('0x9')](),interaction['tracked']('openchannel',_0x3a3f('0x1a')),controller[_0x3a3f('0x1b')]);router[_0x3a3f('0x1c')](_0x3a3f('0xc'),auth[_0x3a3f('0x9')](),interaction[_0x3a3f('0x15')](_0x3a3f('0x16'),_0x3a3f('0x1d')),controller[_0x3a3f('0x1e')]);router[_0x3a3f('0x1c')](_0x3a3f('0x1f'),auth[_0x3a3f('0x9')](),controller[_0x3a3f('0x20')]);module[_0x3a3f('0x21')]=router; \ No newline at end of file +var _0x888d=['openchannelinteraction:update','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id'];(function(_0x1267ef,_0x54384c){var _0x1729d6=function(_0x2840e6){while(--_0x2840e6){_0x1267ef['push'](_0x1267ef['shift']());}};_0x1729d6(++_0x54384c);}(_0x888d,0x185));var _0xd888=function(_0x306b57,_0x222097){_0x306b57=_0x306b57-0x0;var _0x2bed22=_0x888d[_0x306b57];return _0x2bed22;};'use strict';var multer=require(_0xd888('0x0'));var util=require(_0xd888('0x1'));var path=require(_0xd888('0x2'));var timeout=require(_0xd888('0x3'));var express=require(_0xd888('0x4'));var router=express['Router']();var fs_extra=require(_0xd888('0x5'));var auth=require(_0xd888('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd888('0x7'));var controller=require(_0xd888('0x8'));router[_0xd888('0x9')]('/',auth[_0xd888('0xa')](),controller[_0xd888('0xb')]);router[_0xd888('0x9')](_0xd888('0xc'),auth['isAuthenticated'](),controller[_0xd888('0xd')]);router[_0xd888('0x9')]('/:id',auth[_0xd888('0xa')](),controller[_0xd888('0xe')]);router[_0xd888('0x9')]('/:id/messages',auth[_0xd888('0xa')](),controller['getMessages']);router[_0xd888('0x9')](_0xd888('0xf'),auth['isAuthenticated'](),controller[_0xd888('0x10')]);router[_0xd888('0x11')]('/',auth['isAuthenticated'](),controller[_0xd888('0x12')]);router[_0xd888('0x11')](_0xd888('0x13'),auth[_0xd888('0xa')](),controller[_0xd888('0x14')]);router[_0xd888('0x11')](_0xd888('0x15'),auth[_0xd888('0xa')](),interaction[_0xd888('0x16')](_0xd888('0x17'),_0xd888('0x18')),controller[_0xd888('0x19')]);router['put'](_0xd888('0x1a'),auth[_0xd888('0xa')](),interaction[_0xd888('0x16')](_0xd888('0x17'),_0xd888('0x1b')),controller[_0xd888('0x1c')]);router[_0xd888('0x1d')]('/:id',auth[_0xd888('0xa')](),interaction[_0xd888('0x16')](_0xd888('0x17'),'openchannelinteraction:destroy'),controller[_0xd888('0x1e')]);router['delete'](_0xd888('0x15'),auth[_0xd888('0xa')](),controller['removeTags']);module[_0xd888('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4e395c6..ff794eb 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 _0x9f3c=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x25e7a2,_0x14612b){var _0x36b86f=function(_0x2e4312){while(--_0x2e4312){_0x25e7a2['push'](_0x25e7a2['shift']());}};_0x36b86f(++_0x14612b);}(_0x9f3c,0x12b));var _0xc9f3=function(_0x1ffc1e,_0x5780ed){_0x1ffc1e=_0x1ffc1e-0x0;var _0x121a66=_0x9f3c[_0x1ffc1e];return _0x121a66;};'use strict';var Sequelize=require(_0xc9f3('0x0'));module[_0xc9f3('0x1')]={'closed':{'type':Sequelize[_0xc9f3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc9f3('0x3')]},'secondDisposition':{'type':Sequelize[_0xc9f3('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc9f3('0x3')]},'read1stAt':{'type':Sequelize[_0xc9f3('0x4')]},'threadId':{'type':Sequelize[_0xc9f3('0x3')]},'externalUrl':{'type':Sequelize[_0xc9f3('0x3')]},'lastMsgAt':{'type':Sequelize[_0xc9f3('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc9f3('0x5')]('in',_0xc9f3('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc9f3('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xc9f3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xaeef=['sequelize','exports','BOOLEAN','STRING','DATE','out'];(function(_0x36a04b,_0x1ad56f){var _0x44f844=function(_0x284812){while(--_0x284812){_0x36a04b['push'](_0x36a04b['shift']());}};_0x44f844(++_0x1ad56f);}(_0xaeef,0x14a));var _0xfaee=function(_0x547ce1,_0x5310e2){_0x547ce1=_0x547ce1-0x0;var _0x4f2ebc=_0xaeef[_0x547ce1];return _0x4f2ebc;};'use strict';var Sequelize=require(_0xfaee('0x0'));module[_0xfaee('0x1')]={'closed':{'type':Sequelize[_0xfaee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfaee('0x3')]},'secondDisposition':{'type':Sequelize[_0xfaee('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfaee('0x3')]},'note':{'type':Sequelize[_0xfaee('0x3')]},'read1stAt':{'type':Sequelize[_0xfaee('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xfaee('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfaee('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfaee('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index fd6e1fc..52df192 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 _0x581a=['cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','body','some','isEmpty','OpenchannelAccountId','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','OpenchannelInteraction','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','rows','catch','show','params','includeAll','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','Tag','emit','removeTags','download','unix','root','server','files','attachments','join','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','end','error','stack','name','Users','map','fullname','TagIds','Tags','forEach','waiting','talking','total','closed','UserId','answered','index','key','query','keys','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','openchannel_interactions'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x581a,0x9a));var _0xa581=function(_0x5691c9,_0x265830){_0x5691c9=_0x5691c9-0x0;var _0x2af9b0=_0x581a[_0x5691c9];return _0x2af9b0;};'use strict';var emlformat=require(_0xa581('0x0'));var rimraf=require(_0xa581('0x1'));var zipdir=require(_0xa581('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa581('0x3'));var moment=require(_0xa581('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa581('0x5'));var path=require(_0xa581('0x6'));var sox=require(_0xa581('0x7'));var csv=require(_0xa581('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa581('0x9'));var _=require(_0xa581('0xa'));var squel=require(_0xa581('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa581('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa581('0xd'));var Papa=require(_0xa581('0xe'));var Redis=require(_0xa581('0xf'));var authService=require(_0xa581('0x10'));var qs=require(_0xa581('0x11'));var as=require(_0xa581('0x12'));var pdf=require(_0xa581('0x13'));var hardwareService=require(_0xa581('0x14'));var logger=require(_0xa581('0x15'))(_0xa581('0x16'));var utils=require(_0xa581('0x17'));var config=require(_0xa581('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa581('0x19'))['db'];config[_0xa581('0x1a')]=_[_0xa581('0x1b')](config['redis'],{'host':_0xa581('0x1c'),'port':0x18eb});var socket=require(_0xa581('0x1d'))(new Redis(config[_0xa581('0x1a')]));require(_0xa581('0x1e'))[_0xa581('0x1f')](socket);function respondWithStatusCode(_0x26e792,_0x28e0ee){_0x28e0ee=_0x28e0ee||0xcc;return function(_0x3b58d){if(_0x3b58d){return _0x26e792[_0xa581('0x20')](_0x28e0ee);}return _0x26e792[_0xa581('0x21')](_0x28e0ee)['end']();};}function respondWithResult(_0x4fe8af,_0x281e1a){_0x281e1a=_0x281e1a||0xc8;return function(_0x4e2910){if(_0x4e2910){return _0x4fe8af['status'](_0x281e1a)[_0xa581('0x22')](_0x4e2910);}};}function respondWithFilteredResult(_0xe1833f,_0x23e6b2){return function(_0x3adfcb){if(_0x3adfcb){var _0x17865e=typeof _0x23e6b2[_0xa581('0x23')]===_0xa581('0x24')&&typeof _0x23e6b2[_0xa581('0x25')]===_0xa581('0x24');var _0x2af334=_0x3adfcb['count'];var _0x50948a=_0x17865e?0x0:_0x23e6b2[_0xa581('0x23')];var _0x35b1b0=_0x17865e?_0x3adfcb[_0xa581('0x26')]:_0x23e6b2[_0xa581('0x23')]+_0x23e6b2[_0xa581('0x25')];var _0x317797;if(_0x35b1b0>=_0x2af334){_0x35b1b0=_0x2af334;_0x317797=0xc8;}else{_0x317797=0xce;}_0xe1833f[_0xa581('0x21')](_0x317797);return _0xe1833f[_0xa581('0x27')](_0xa581('0x28'),_0x50948a+'-'+_0x35b1b0+'/'+_0x2af334)[_0xa581('0x22')](_0x3adfcb);}return null;};}function patchUpdates(_0x210e68){return function(_0x257b2f){try{jsonpatch[_0xa581('0x29')](_0x257b2f,_0x210e68,!![]);}catch(_0x1506ac){return BPromise[_0xa581('0x2a')](_0x1506ac);}return _0x257b2f['save']();};}function saveUpdates(_0x5c6b83,_0x3661ee){return function(_0x36803a){if(_0x36803a){return _0x36803a['update'](_0x5c6b83)[_0xa581('0x2b')](function(_0x557a2b){return _0x557a2b;});}return null;};}function removeEntity(_0x16ca33,_0x331e63){return function(_0x3bb475){if(_0x3bb475){return _0x3bb475['destroy']()['then'](function(){_0x16ca33[_0xa581('0x21')](0xcc)[_0xa581('0x2c')]();});}};}function handleEntityNotFound(_0x1b425e,_0x18ea5e){return function(_0xaad1d5){if(!_0xaad1d5){_0x1b425e[_0xa581('0x20')](0x194);}return _0xaad1d5;};}function handleError(_0x191363,_0x4a7860){_0x4a7860=_0x4a7860||0x1f4;return function(_0x18ad18){logger[_0xa581('0x2d')](_0x18ad18[_0xa581('0x2e')]);if(_0x18ad18[_0xa581('0x2f')]){delete _0x18ad18[_0xa581('0x2f')];}_0x191363[_0xa581('0x21')](_0x4a7860)['send'](_0x18ad18);};}function getInteractionUsers(_0x4c8137,_0x1bf62f){return new BPromise(function(_0x5b09da,_0x42e7bd){try{if(_0x1bf62f[_0x4c8137['id']]){_0x4c8137[_0xa581('0x30')]=_[_0xa581('0x31')](_0x1bf62f[_0x4c8137['id']],function(_0x485147){return{'id':_0x485147['id'],'fullname':_0x485147[_0xa581('0x32')]};});}}catch(_0x55ae6a){_0x42e7bd(_0x55ae6a);}_0x5b09da(_0x4c8137);});}function getInteractionTags(_0x213886,_0x1f367e){return new BPromise(function(_0x4193de,_0x1ef6fc){try{if(_0x213886[_0xa581('0x33')]){_0x213886[_0xa581('0x34')]=[];_0x213886[_0xa581('0x33')]['split'](',')[_0xa581('0x35')](function(_0x124117){_0x213886[_0xa581('0x34')]['push'](_0x1f367e[_0x124117]);});}delete _0x213886[_0xa581('0x33')];}catch(_0x310786){_0x1ef6fc(_0x310786);}_0x4193de(_0x213886);});}function updateOpenchannelInteraction(_0x4e37fa,_0x56ffc9,_0x5441fc){return new BPromise(function(_0x1c5eaa,_0x437325){return getInteractionUsers(_0x4e37fa,_0x5441fc)['then'](function(_0x3586b2){return getInteractionTags(_0x3586b2,_0x56ffc9);})[_0xa581('0x2b')](function(_0x32b833){return getStateInteraction(_0x32b833);})[_0xa581('0x2b')](function(_0x4e8915){_0x1c5eaa(_0x4e8915);})['catch'](function(_0x5bc632){_0x437325(_0x5bc632);});});}function getStateInteraction(_0x1e9663){return new BPromise(function(_0x26939f){_0x1e9663[_0xa581('0x36')]=0x0;_0x1e9663[_0xa581('0x37')]=0x0;_0x1e9663['answered']=0x0;_0x1e9663['unmanaged']=0x0;_0x1e9663[_0xa581('0x38')]=0x0;if(!_0x1e9663[_0xa581('0x39')]&&!_0x1e9663[_0xa581('0x3a')]){_0x1e9663[_0xa581('0x36')]+=0x1;}if(!_0x1e9663[_0xa581('0x39')]&&_0x1e9663[_0xa581('0x3a')]){_0x1e9663['talking']+=0x1;if(_0x1e9663[_0xa581('0x36')]){_0x1e9663['waiting']-=0x1;}}if(_0x1e9663[_0xa581('0x39')]&&_0x1e9663[_0xa581('0x3a')]){_0x1e9663[_0xa581('0x3b')]+=0x1;if(_0x1e9663[_0xa581('0x37')]){_0x1e9663[_0xa581('0x37')]-=0x1;}}if(_0x1e9663['closed']&&!_0x1e9663[_0xa581('0x3a')]){_0x1e9663['unmanaged']+=0x1;if(_0x1e9663[_0xa581('0x36')]){_0x1e9663[_0xa581('0x36')]-=0x1;}}_0x1e9663['total']+=0x1;_0x26939f(_0x1e9663);});}exports[_0xa581('0x3c')]=function(_0x2cebef,_0x14057d){var _0x3eae58={},_0x37d8df={},_0x39c0e6={'count':0x0,'rows':[]};var _0x22dda6=_[_0xa581('0x31')](db['OpenchannelInteraction']['rawAttributes'],function(_0x24faeb){return{'name':_0x24faeb['fieldName'],'type':_0x24faeb['type'][_0xa581('0x3d')]};});_0x37d8df['model']=_[_0xa581('0x31')](_0x22dda6,_0xa581('0x2f'));_0x37d8df[_0xa581('0x3e')]=_[_0xa581('0x3f')](_0x2cebef[_0xa581('0x3e')]);_0x37d8df['filters']=_['intersection'](_0x37d8df[_0xa581('0x40')],_0x37d8df[_0xa581('0x3e')]);_0x3eae58[_0xa581('0x41')]=_[_0xa581('0x42')](_0x37d8df['model'],qs['fields'](_0x2cebef[_0xa581('0x3e')]['fields']));_0x3eae58[_0xa581('0x41')]=_0x3eae58['attributes'][_0xa581('0x43')]?_0x3eae58[_0xa581('0x41')]:_0x37d8df[_0xa581('0x40')];if(!_0x2cebef[_0xa581('0x3e')][_0xa581('0x44')](_0xa581('0x45'))){_0x3eae58[_0xa581('0x25')]=qs[_0xa581('0x25')](_0x2cebef['query']['limit']);_0x3eae58[_0xa581('0x23')]=qs[_0xa581('0x23')](_0x2cebef['query'][_0xa581('0x23')]);}_0x3eae58[_0xa581('0x46')]=qs[_0xa581('0x47')](_0x2cebef['query'][_0xa581('0x47')]);_0x3eae58[_0xa581('0x48')]=qs[_0xa581('0x49')](_[_0xa581('0x4a')](_0x2cebef['query'],_0x37d8df[_0xa581('0x49')]),_0x22dda6);var _0x33addd=[];var _0x493eb4=squel[_0xa581('0x4b')]()['field']('id')[_0xa581('0x4c')](_0xa581('0x2f'))[_0xa581('0x4c')](_0xa581('0x4d'))[_0xa581('0x4e')](_0xa581('0x4f'));var _0x5d6c0a=squel['select']()[_0xa581('0x4c')](_0xa581('0x50'))[_0xa581('0x4c')](_0xa581('0x51'))[_0xa581('0x4c')]('ui.OpenchannelInteractionId')[_0xa581('0x4e')](_0xa581('0x52'),'ui')[_0xa581('0x53')](_0xa581('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x357160=squel[_0xa581('0x4b')]()[_0xa581('0x4e')](_0xa581('0x55'),'i')['left_join'](_0xa581('0x56'),'c',_0xa581('0x57'))[_0xa581('0x53')](_0xa581('0x54'),'o',_0xa581('0x58'))[_0xa581('0x53')](_0xa581('0x59'),'a',_0xa581('0x5a'))[_0xa581('0x53')](_0xa581('0x5b'),'me',_0xa581('0x5c'))[_0xa581('0x53')](_0xa581('0x5d'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xa581('0x4f'),'t',_0xa581('0x5e'));var _0x30b4d8=squel[_0xa581('0x5f')]();var _0x57d4a3=[];var _0x51619d=squel[_0xa581('0x5f')]();var _0x28491e;if(_0x2cebef['query'][_0xa581('0x60')]){_0x28491e=as['parseSearch'](_0x2cebef[_0xa581('0x3e')]['search']);var _0x4de508=_0x28491e[_0xa581('0x61')];for(var _0x1ac129=0x0;_0x1ac129<_0x28491e['conditions'][_0xa581('0x43')];_0x1ac129++){var _0x34a00a=_0x28491e[_0xa581('0x62')][_0x1ac129];var _0x31458e='i';var _0x317096=_[_0xa581('0x63')](_0x22dda6,['name',_0x34a00a['field']]);if(!_0x317096){switch(_0x34a00a[_0xa581('0x4c')]){case _0xa581('0x64'):if(_0x34a00a['value']==0x1){_0x357160[_0xa581('0x65')]('`'+_0x34a00a[_0xa581('0x4c')]+_0xa581('0x66'));}else{_0x357160[_0xa581('0x65')]('`'+_0x34a00a[_0xa581('0x4c')]+'`\x20>\x200');}break;case _0xa581('0x67'):if(_0x34a00a[_0xa581('0x68')]===_0xa581('0x69')){if(_0x34a00a[_0xa581('0x6a')][_0xa581('0x6b')]('\x20')['length']>0x1){_0x30b4d8[_0x4de508]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x34a00a[_0xa581('0x6a')]),null);}else{var _0x29479a='%'+_0x34a00a[_0xa581('0x6a')]+'%';_0x30b4d8[_0x4de508](_0xa581('0x6c'),_0x29479a,_0x29479a,_0x29479a);}}else{_0x317096=_[_0xa581('0x63')](_0x22dda6,[_0xa581('0x2f'),'ContactId']);_0x34a00a[_0xa581('0x4c')]='ContactId';_0x3114db=as[_0xa581('0x6d')](_0x31458e,_0x317096['type'],_0x34a00a);_0x30b4d8[_0x4de508](_0x3114db[_0xa581('0x6e')],_0x3114db[_0xa581('0x6a')][_0xa581('0x6f')],_0x3114db['value'][_0xa581('0x2c')]);}break;case'Tag':var _0x581feb=_0x34a00a['value'][_0xa581('0x6b')](',')[_0xa581('0x31')](function(_0x46a8d5){return Number(_0x46a8d5);});_0x581feb['forEach'](function(_0x13745a){_0x51619d['or'](_0xa581('0x70'),'%,'+_0x13745a+',%');});_0x57d4a3=_[_0xa581('0x71')](_0x57d4a3,_0x581feb);break;case _0xa581('0x72'):if(_0x34a00a[_0xa581('0x68')]==='$substring'){_0x30b4d8[_0x4de508](_0xa581('0x73'),'%'+_0x34a00a['value']+'%',null);}else{_0x317096=_[_0xa581('0x63')](_0x22dda6,['name',_0xa581('0x3a')]);_0x34a00a[_0xa581('0x4c')]=_0xa581('0x3a');_0x3114db=as[_0xa581('0x6d')](_0x31458e,_0x317096[_0xa581('0x74')],_0x34a00a);_0x30b4d8[_0x4de508](_0x3114db['text'],_0x3114db[_0xa581('0x6a')][_0xa581('0x6f')],_0x3114db[_0xa581('0x6a')]['end']);}break;case _0xa581('0x75'):_0x3114db=as[_0xa581('0x6d')]('me',null,_0x34a00a);_0x30b4d8[_0x4de508](_0x3114db[_0xa581('0x6e')],_0x3114db['value'][_0xa581('0x6f')],_0x3114db[_0xa581('0x6a')][_0xa581('0x2c')]);break;}}else{var _0x3114db=as['buildExpression'](_0x31458e,_0x317096[_0xa581('0x74')],_0x34a00a);_0x30b4d8[_0x4de508](_0x3114db[_0xa581('0x6e')],_0x3114db[_0xa581('0x6a')]['start'],_0x3114db[_0xa581('0x6a')][_0xa581('0x2c')]);}}}else{var _0x1ccc81=_(_0x2cebef[_0xa581('0x3e')])[_0xa581('0x3f')]()[_0xa581('0x31')](function(_0x54a42b){return _[_0xa581('0x76')](_0x22dda6,[_0xa581('0x2f'),_0x54a42b])?_0x54a42b:undefined;})['compact']()[_0xa581('0x6a')]();if(!_[_0xa581('0x77')](_0x1ccc81)){_0x1ccc81['forEach'](function(_0x162011){if(_0x162011===_0xa581('0x78')){_0x357160[_0xa581('0x48')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xa581('0x79')](_0x2cebef[_0xa581('0x3e')][_0x162011]));}else if(_0x162011===_0xa581('0x7a')){var _0x966160=JSON['parse'](_0x2cebef[_0xa581('0x3e')][_0x162011])[_0xa581('0x7b')];var _0xe2264b=JSON['parse'](_0x2cebef[_0xa581('0x3e')][_0x162011])[_0xa581('0x7c')];_0x357160[_0xa581('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x966160,_0xe2264b);}else{if(_0x2cebef[_0xa581('0x3e')][_0x162011]===_0xa581('0x7d')){_0x357160[_0xa581('0x48')]('i.'+_0x162011+_0xa581('0x7e'));}else{_0x357160['where']('i.'+_0x162011+'\x20=\x20?',_0x2cebef[_0xa581('0x3e')][_0x162011]);}}});}if(_0x2cebef[_0xa581('0x3e')]['read']){if(_0x2cebef[_0xa581('0x3e')][_0xa581('0x7f')]==0x1){_0x357160['having']('`unreadMessages`\x20=\x200');}else{_0x357160[_0xa581('0x65')](_0xa581('0x80'));}}if(_0x2cebef[_0xa581('0x3e')]['tag']){_0x57d4a3=_[_0xa581('0x81')](_0x2cebef[_0xa581('0x3e')][_0xa581('0x82')])?_0x2cebef[_0xa581('0x3e')][_0xa581('0x82')]:new Array(_0x2cebef[_0xa581('0x3e')][_0xa581('0x82')]);_0x57d4a3[_0xa581('0x35')](function(_0x481e65){_0x51619d['or'](_0xa581('0x70'),'%,'+_0x481e65+',%');});}if(_0x2cebef['query'][_0xa581('0x83')]){var _0x369396=_0x2cebef[_0xa581('0x3e')]['filter'][_0xa581('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa581('0x85')](_0x369396)){_0x30b4d8['or'](_0xa581('0x86'),_0x369396+'%');}else{_0x30b4d8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x369396))['or'](_0xa581('0x87'),_0x369396+'%')['or'](_0xa581('0x88'),_0x369396+'%');}}}_0x357160[_0xa581('0x48')](_0x30b4d8);_0x357160[_0xa581('0x89')]('i.id');var _0xd2560b={'type':db[_0xa581('0x8a')][_0xa581('0x8b')][_0xa581('0x8c')],'raw':!![]};var _0x3e646b=_0x357160['clone']();_0x3e646b[_0xa581('0x4c')](_0xa581('0x8d'));_0x3e646b[_0xa581('0x4c')](_0xa581('0x8e'),_0xa581('0x64'));if(_0x3eae58[_0xa581('0x46')]){_0x3eae58[_0xa581('0x46')][_0xa581('0x35')](function(_0x255a16){var _0x48a146=_0x255a16[0x0]===_0xa581('0x8f')?_0x255a16[0x0]:'i.'+_0x255a16[0x0];_0x357160[_0xa581('0x46')](_0x48a146,_0x255a16[0x1]===_0xa581('0x90')?![]:!![]);});}if(!_[_0xa581('0x77')](_0x57d4a3)){_0x357160['having'](_0x51619d);_0x3e646b[_0xa581('0x48')](_0xa581('0x91'),_0x57d4a3);}BPromise[_0xa581('0x92')]()[_0xa581('0x2b')](function(){if(!_0x28491e){if(_0x2cebef[_0xa581('0x3e')][_0xa581('0x78')])return;_0x3e646b[_0xa581('0x48')](_0xa581('0x93'));_0x357160[_0xa581('0x48')](_0xa581('0x93'));return;}if(_0x2cebef['user'][_0xa581('0x94')]!==_0xa581('0x95'))return;return _0x2cebef[_0xa581('0x96')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x20331a){if(_[_0xa581('0x77')](_0x20331a)){_0x3e646b[_0xa581('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x357160[_0xa581('0x48')](_0xa581('0x97'));}else{_0x3e646b[_0xa581('0x48')](_0xa581('0x98'),_[_0xa581('0x31')](_0x20331a,'id'));_0x357160[_0xa581('0x48')](_0xa581('0x98'),_[_0xa581('0x31')](_0x20331a,'id'));}});})[_0xa581('0x2b')](function(){if(_0x2cebef[_0xa581('0x96')][_0xa581('0x94')]===_0xa581('0x95')&&!_0x28491e&&!_0x2cebef[_0xa581('0x3e')][_0xa581('0x78')])return[];return db[_0xa581('0x99')][_0xa581('0x3e')](_0x3e646b[_0xa581('0x9a')](),_0xd2560b);})[_0xa581('0x2b')](function(_0x2025ff){_0x39c0e6['count']=_0x2025ff[_0xa581('0x43')];if(_0x39c0e6[_0xa581('0x26')]===0x0)return[];return db[_0xa581('0x99')][_0xa581('0x3e')](_0x493eb4[_0xa581('0x9a')](),_0xd2560b)[_0xa581('0x2b')](function(_0x5e52a3){_0x33addd=_[_0xa581('0x9b')](_0x5e52a3,'id');_0xd2560b=_[_0xa581('0x9c')](_0xd2560b,{'model':db[_0xa581('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cebef[_0xa581('0x3e')][_0xa581('0x9e')]){_0x3eae58[_0xa581('0x41')][_0xa581('0x35')](function(_0x4941ae){_0x357160[_0xa581('0x4c')]('i.'+_0x4941ae);});}else{_0x357160[_0xa581('0x4c')](_0xa581('0x8e'),_0xa581('0x64'));_0x357160[_0xa581('0x4c')](_0xa581('0x9f'),_0xa581('0xa0'));_0x357160['field'](_0xa581('0xa1'),_0xa581('0xa2'));_0x357160['field'](_0xa581('0xa3'),_0xa581('0x8f'));_0x357160[_0xa581('0x4c')](_0xa581('0xa4'));_0x357160['field'](_0xa581('0xa5'),_0xa581('0xa6'));_0x357160[_0xa581('0x4c')]('c.lastName','Contact.lastName');_0x357160[_0xa581('0x4c')](_0xa581('0xa7'),_0xa581('0xa8'));_0x357160[_0xa581('0x4c')](_0xa581('0xa9'),'Contact.phone');_0x357160[_0xa581('0x4c')]('c.mobile',_0xa581('0xaa'));_0x357160[_0xa581('0x4c')](_0xa581('0xab'),_0xa581('0xac'));_0x357160[_0xa581('0x4c')](_0xa581('0xad'),_0xa581('0xae'));_0x357160[_0xa581('0x4c')](_0xa581('0xaf'),_0xa581('0xb0'));_0x357160[_0xa581('0x4c')](_0xa581('0xb1'),_0xa581('0x33'));}if(_0x3eae58[_0xa581('0x25')])_0x357160[_0xa581('0x25')](_0x3eae58['limit']);if(_0x3eae58[_0xa581('0x23')])_0x357160[_0xa581('0x23')](_0x3eae58[_0xa581('0x23')]);return db[_0xa581('0x99')][_0xa581('0x3e')](_0x357160['toString'](),_0xd2560b);})[_0xa581('0x2b')](function(_0x4bd2d2){if(_0x4bd2d2[_0xa581('0x43')]>0x0)_0x5d6c0a['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xa581('0x31')](_0x4bd2d2,'id'));return db[_0xa581('0x99')]['query'](_0x5d6c0a['toString'](),_0xd2560b)[_0xa581('0x2b')](function(_0x514285){var _0x1af89f=_[_0xa581('0xb2')](_0x514285,_0xa581('0xb3'));var _0x1f37ab=[];_0x4bd2d2[_0xa581('0x35')](function(_0x39e770){_0x1f37ab[_0xa581('0xb4')](updateOpenchannelInteraction(_0x39e770,_0x33addd,_0x1af89f));});return BPromise['all'](_0x1f37ab);});});})['then'](function(_0x2cd8c2){_0x39c0e6[_0xa581('0xb5')]=_0x2cd8c2;return _0x39c0e6;})[_0xa581('0x2b')](respondWithFilteredResult(_0x14057d,_0x3eae58))[_0xa581('0xb6')](handleError(_0x14057d,null));};exports[_0xa581('0xb7')]=function(_0x34b2d9,_0x230153){var _0x4eaf05={};if(_0x34b2d9[_0xa581('0x3e')][_0xa581('0x74')]&&_0x34b2d9[_0xa581('0x3e')]['type']===_0xa581('0x4e')){_0x4eaf05[_0xa581('0x4e')]=_0x34b2d9['params']['id'];}else{_0x4eaf05['id']=_0x34b2d9[_0xa581('0xb8')]['id'];}var _0x49477e={'raw':![],'where':_0x4eaf05},_0x105f22={};_0x105f22[_0xa581('0x40')]=_[_0xa581('0x3f')](db['OpenchannelInteraction']['rawAttributes']);_0x105f22['query']=_[_0xa581('0x3f')](_0x34b2d9['query']);_0x105f22[_0xa581('0x49')]=_[_0xa581('0x42')](_0x105f22[_0xa581('0x40')],_0x105f22[_0xa581('0x3e')]);_0x49477e[_0xa581('0x41')]=_[_0xa581('0x42')](_0x105f22['model'],qs[_0xa581('0x9e')](_0x34b2d9[_0xa581('0x3e')][_0xa581('0x9e')]));_0x49477e[_0xa581('0x41')]=_0x49477e['attributes'][_0xa581('0x43')]?_0x49477e[_0xa581('0x41')]:_0x105f22[_0xa581('0x40')];if(_0x34b2d9[_0xa581('0x3e')][_0xa581('0xb9')]){_0x49477e['include']=[{'all':!![]}];}_0x49477e=_[_0xa581('0x9c')]({},_0x49477e,_0x34b2d9[_0xa581('0xba')]);return db[_0xa581('0x9d')]['find'](_0x49477e)[_0xa581('0x2b')](handleEntityNotFound(_0x230153,null))[_0xa581('0x2b')](respondWithResult(_0x230153,null))[_0xa581('0xb6')](handleError(_0x230153,null));};exports['create']=function(_0x5a2b11,_0x53b190){return db[_0xa581('0x9d')][_0xa581('0xbb')](_0x5a2b11[_0xa581('0x75')],{})['then'](respondWithResult(_0x53b190,0xc9))['catch'](handleError(_0x53b190,null));};exports['update']=function(_0x523b63,_0x40f317){if(_0x523b63[_0xa581('0x75')]['id']){delete _0x523b63[_0xa581('0x75')]['id'];}return db[_0xa581('0x9d')][_0xa581('0x63')]({'where':{'id':_0x523b63[_0xa581('0xb8')]['id']}})['then'](handleEntityNotFound(_0x40f317,null))['then'](saveUpdates(_0x523b63[_0xa581('0x75')],null))[_0xa581('0x2b')](respondWithResult(_0x40f317,null))[_0xa581('0xb6')](handleError(_0x40f317,null));};exports[_0xa581('0xbc')]=function(_0x5beb5e,_0x395d82){return db[_0xa581('0x9d')][_0xa581('0x63')]({'where':{'id':_0x5beb5e['params']['id']}})[_0xa581('0x2b')](handleEntityNotFound(_0x395d82,null))[_0xa581('0x2b')](removeEntity(_0x395d82,null))[_0xa581('0xb6')](handleError(_0x395d82,null));};exports[_0xa581('0xbd')]=function(_0x462d9d,_0x388917){return db[_0xa581('0x9d')]['describe']()[_0xa581('0x2b')](respondWithResult(_0x388917,null))['catch'](handleError(_0x388917,null));};exports[_0xa581('0xbe')]=function(_0x54635f,_0x4ebfc9,_0x184914){return db[_0xa581('0xbf')][_0xa581('0x63')]({'where':{'id':_0x54635f[_0xa581('0xb8')]['id']}})[_0xa581('0x2b')](handleEntityNotFound(_0x4ebfc9,null))[_0xa581('0x2b')](function(_0xf55bbe){if(_0xf55bbe){return _0xf55bbe[_0xa581('0xbe')](_0x54635f[_0xa581('0x75')][_0xa581('0xc0')],_[_0xa581('0xc1')](_0x54635f[_0xa581('0x75')],['ids','id'])||{});}})[_0xa581('0x2b')](respondWithResult(_0x4ebfc9,null))[_0xa581('0xb6')](handleError(_0x4ebfc9,null));};exports[_0xa581('0xc2')]=function(_0x3f692e,_0x1db4a5,_0x5659ed){var _0x29da52={'raw':![],'where':{}};var _0x5a2d0c={};var _0xfd6d30={'count':0x0,'rows':[]};return db[_0xa581('0x9d')]['findOne']({'where':{'id':_0x3f692e[_0xa581('0xb8')]['id']}})[_0xa581('0x2b')](handleEntityNotFound(_0x1db4a5,null))[_0xa581('0x2b')](function(_0x523833){if(_0x523833){_0x5a2d0c[_0xa581('0x40')]=_[_0xa581('0x3f')](db[_0xa581('0xbf')]['rawAttributes']);_0x5a2d0c[_0xa581('0x3e')]=_[_0xa581('0x3f')](_0x3f692e['query']);_0x5a2d0c[_0xa581('0x49')]=_[_0xa581('0x42')](_0x5a2d0c[_0xa581('0x40')],_0x5a2d0c['query']);_0x29da52[_0xa581('0x41')]=_[_0xa581('0x42')](_0x5a2d0c['model'],qs['fields'](_0x3f692e[_0xa581('0x3e')]['fields']));_0x29da52[_0xa581('0x41')]=_0x29da52[_0xa581('0x41')][_0xa581('0x43')]?_0x29da52[_0xa581('0x41')]:_0x5a2d0c[_0xa581('0x40')];if(!_0x3f692e[_0xa581('0x3e')][_0xa581('0x44')](_0xa581('0x45'))){_0x29da52[_0xa581('0x25')]=qs[_0xa581('0x25')](_0x3f692e['query'][_0xa581('0x25')]);_0x29da52[_0xa581('0x23')]=qs[_0xa581('0x23')](_0x3f692e[_0xa581('0x3e')][_0xa581('0x23')]);}_0x29da52[_0xa581('0x46')]=qs[_0xa581('0x47')](_0x3f692e[_0xa581('0x3e')][_0xa581('0x47')]);_0x29da52['where']=qs[_0xa581('0x49')](_[_0xa581('0x4a')](_0x3f692e[_0xa581('0x3e')],_0x5a2d0c[_0xa581('0x49')]));_0x29da52['where'][_0xa581('0xb3')]=_0x523833['id'];if(_0x3f692e[_0xa581('0x3e')][_0xa581('0x83')]){_0x29da52[_0xa581('0x48')]=_[_0xa581('0x9c')](_0x29da52[_0xa581('0x48')],{'$or':_[_0xa581('0x31')](_0x29da52['attributes'],function(_0x529e40){var _0x36d141={};_0x36d141[_0x529e40]={'$like':'%'+_0x3f692e['query'][_0xa581('0x83')]+'%'};return _0x36d141;})});}if(_0x3f692e[_0xa581('0x3e')][_0xa581('0x7b')]){var _0x568507=_0x3f692e['query'][_0xa581('0x7b')]['split'](',');var _0x860fa7={};_0x860fa7[_0x568507[0x0]]={'$gte':moment(_0x568507[0x1])[_0xa581('0xc3')](_0xa581('0xc4'))};_0x29da52[_0xa581('0x48')]=_['merge'](_0x29da52['where'],_0x860fa7);}_0x29da52=_['merge']({},_0x29da52,_0x3f692e['options']);return db[_0xa581('0xbf')][_0xa581('0x26')]({'where':_0x29da52['where']})[_0xa581('0x2b')](function(_0x29263c){_0xfd6d30[_0xa581('0x26')]=_0x29263c;if(_0x3f692e[_0xa581('0x3e')][_0xa581('0xb9')]){_0x29da52[_0xa581('0xc5')]=[{'all':!![]}];}return db[_0xa581('0xbf')][_0xa581('0xc6')](_0x29da52);})['then'](function(_0x5e25df){_0xfd6d30[_0xa581('0xb5')]=_0x5e25df;return _0xfd6d30;});}})[_0xa581('0x2b')](respondWithFilteredResult(_0x1db4a5,_0x29da52))[_0xa581('0xb6')](handleError(_0x1db4a5,null));};exports[_0xa581('0xc7')]=function(_0x41f542,_0x23645d,_0x2222aa){return db[_0xa581('0x9d')][_0xa581('0x63')]({'where':{'id':_0x41f542[_0xa581('0xb8')]['id']}})['then'](handleEntityNotFound(_0x23645d,null))['then'](function(_0x339136){if(_0x339136){return _0x339136[_0xa581('0xc8')](_0x41f542[_0xa581('0x75')]['ids'],_[_0xa581('0xc1')](_0x41f542[_0xa581('0x75')],['ids','id'])||{})['spread'](function(){return db[_0xa581('0xc9')][_0xa581('0xc6')]({'attributes':['id',_0xa581('0x2f'),_0xa581('0x4d')],'where':{'id':_0x41f542['body']['ids']}});})[_0xa581('0x2b')](function(_0x3dd443){socket[_0xa581('0xca')]('openchannelInteractionTags:save',{'id':Number(_0x41f542[_0xa581('0xb8')]['id']),'tags':_0x3dd443||[]});return{'id':Number(_0x41f542['params']['id']),'tags':_0x3dd443||[]};});}})[_0xa581('0x2b')](respondWithResult(_0x23645d,null))['catch'](handleError(_0x23645d,null));};exports['removeTags']=function(_0x297d88,_0x1dd5b1,_0x514761){return db[_0xa581('0x9d')][_0xa581('0x63')]({'where':{'id':_0x297d88[_0xa581('0xb8')]['id']}})[_0xa581('0x2b')](handleEntityNotFound(_0x1dd5b1,null))[_0xa581('0x2b')](function(_0x2a6f16){if(_0x2a6f16){return _0x2a6f16[_0xa581('0xcb')](_0x297d88['query'][_0xa581('0xc0')]);}})[_0xa581('0x2b')](respondWithStatusCode(_0x1dd5b1,null))['catch'](handleError(_0x1dd5b1,null));};exports[_0xa581('0xcc')]=function(_0x1cacaf,_0x38d461){var _0x51ef61=moment()[_0xa581('0xcd')]()[_0xa581('0x9a')]();var _0x332e51=path['join'](config[_0xa581('0xce')],_0xa581('0xcf'),'files','tmp');var _0x2ac774=path['join'](config[_0xa581('0xce')],'server',_0xa581('0xd0'),_0xa581('0xd1'));var _0x474290=path[_0xa581('0xd2')](_0x332e51,_0x51ef61);var _0x5aa657=util[_0xa581('0xc3')](_0xa581('0xd3'),_0x1cacaf[_0xa581('0xb8')]['id'],_0x51ef61);var _0x440cd1=path['join'](_0x332e51,_0x5aa657);var _0x26bf03=[];_0x26bf03['push']({'model':db[_0xa581('0x72')],'as':_0xa581('0x72'),'attributes':['id','fullname'],'raw':!![]});_0x26bf03[_0xa581('0xb4')]({'model':db[_0xa581('0xd4')],'as':_0xa581('0x67'),'attributes':['id',_0xa581('0xd5'),_0xa581('0xd6')],'raw':!![]});if(_0x1cacaf['query'][_0xa581('0xd1')]){_0x26bf03['push']({'model':db[_0xa581('0xd7')],'as':_0xa581('0xd7'),'raw':!![]});}var _0x4a835f=[{'model':db[_0xa581('0xbf')],'as':_0xa581('0xd8'),'attributes':['id',_0xa581('0x75'),'createdAt',_0xa581('0xd9'),_0xa581('0xda'),_0xa581('0x7f')],'include':_0x26bf03}];_0x4a835f[_0xa581('0xb4')]({'model':db[_0xa581('0xdb')],'as':'Account','attributes':['id',_0xa581('0x2f')]});_0x4a835f[_0xa581('0xb4')]({'model':db['User'],'as':'Owner','attributes':['id',_0xa581('0x32')]});return db[_0xa581('0x9d')][_0xa581('0x63')]({'where':{'id':_0x1cacaf[_0xa581('0xb8')]['id']},'include':_0x4a835f})[_0xa581('0x2b')](handleEntityNotFound(_0x38d461,null))[_0xa581('0x2b')](function(_0x58172d){if(_0x58172d){var _0x28829a=_0x58172d[_0xa581('0xdc')]({'plain':!![]});fs[_0xa581('0xdd')](_0x474290);var _0x5fab66={'channel':_0xa581('0xde'),'account':_0x28829a['Account']['name'],'agent':_0x28829a['Owner']?_0x28829a['Owner'][_0xa581('0x32')]:_0xa581('0xdf'),'createdAt':moment(_0x28829a[_0xa581('0x7a')])[_0xa581('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa581('0x9a')](),'closedAt':_0x28829a[_0xa581('0x39')]?moment(_0x28829a[_0xa581('0xe0')])['format'](_0xa581('0xc4'))[_0xa581('0x9a')]():'','disposition':_0x28829a[_0xa581('0xe1')],'visibility':_0x28829a[_0xa581('0xe2')]?_0xa581('0xe3'):_0xa581('0xe4'),'messages':_(_0x28829a[_0xa581('0xd8')])[_0xa581('0x83')]({'secret':![]})[_0xa581('0x31')](function(_0x219834){if(_0x219834['Attachment']){var _0x1b822c=path['join'](_0x2ac774,_0x219834['Attachment'][_0xa581('0xe5')]);if(fs[_0xa581('0xe6')](_0x1b822c)){fs['createReadStream'](_0x1b822c)[_0xa581('0xe7')](fs[_0xa581('0xe8')](path[_0xa581('0xd2')](_0x474290,_0x219834[_0xa581('0xd7')][_0xa581('0xe5')])));}}return{'date':moment(_0x219834[_0xa581('0x7a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa581('0x9a')](),'sender':_0x219834[_0xa581('0xd9')]==='out'?_0x219834[_0xa581('0x72')]?_0x219834[_0xa581('0x72')][_0xa581('0x32')]:_0xa581('0xe9'):_0x219834[_0xa581('0x67')]['firstName']+(_0x219834[_0xa581('0x67')][_0xa581('0xd6')]?'\x20'+_0x219834['Contact'][_0xa581('0xd6')]:''),'body':_0x219834[_0xa581('0xd7')]?_0x219834[_0xa581('0xd7')][_0xa581('0xe5')]:_0x219834[_0xa581('0x75')],'direction':_0x219834[_0xa581('0xd9')]==='out'?'A':'C','secret':_0x219834['secret'],'read':_0x219834[_0xa581('0x7f')],'attachment':_0x219834[_0xa581('0xd7')]};})[_0xa581('0x6a')]()};return ejs[_0xa581('0xea')](path['join'](config[_0xa581('0xce')],'server','views',_0xa581('0xeb')),{'interaction':_0x5fab66})[_0xa581('0x2b')](function(_0x3262ea){var _0x4362fd=path[_0xa581('0xd2')](_0x474290,_0xa581('0xec')+_0x28829a['id']+'-'+_0x51ef61+_0xa581('0xed'));var _0x4bdd07={'path':_0x4362fd,'channel':'Openchannel','interactionId':_0x28829a['id']};return pdf['createPdfFromHTML'](_0x3262ea,_0x4bdd07);})[_0xa581('0x2b')](function(){return new BPromise(function(_0x276c39,_0x255ca5){zipdir(_0x474290,{'saveTo':_0x440cd1},function(_0x237acb,_0x1ad421){if(_0x237acb)return _0x255ca5(_0x237acb);return _0x276c39(_0x1ad421);});})['then'](function(){return new BPromise(function(_0x5855b5,_0x17b20d){rimraf(_0x474290,function(_0x332411){if(_0x332411)_0x17b20d(_0x332411);return _0x5855b5();});});})['then'](function(){return _0x38d461[_0xa581('0xcc')](_0x440cd1,_0x5aa657,function(_0x11cf71){if(_0x11cf71){console[_0xa581('0xee')](_0xa581('0xef'),_0x11cf71);}else{fs['unlinkSync'](_0x440cd1);}});});});}else{return _0x38d461['sendStatus'](0xc8);}})[_0xa581('0xb6')](handleError(_0x38d461,null));}; \ No newline at end of file +var _0xdf0e=['field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','tag','filter','replace','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','spread','findAll','openchannelInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','secret','Owner','get','mkdirSync','Openchannel','Account','N.A.','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','direction','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','end','json','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','catch','waiting','talking','answered','unmanaged','total','closed','UserId','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','select'];(function(_0x42a41e,_0x2637b0){var _0x39face=function(_0x5c816a){while(--_0x5c816a){_0x42a41e['push'](_0x42a41e['shift']());}};_0x39face(++_0x2637b0);}(_0xdf0e,0x9d));var _0xedf0=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0xdf0e[_0x47c5bf];return _0x11b779;};'use strict';var emlformat=require(_0xedf0('0x0'));var rimraf=require(_0xedf0('0x1'));var zipdir=require(_0xedf0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedf0('0x3'));var moment=require(_0xedf0('0x4'));var BPromise=require(_0xedf0('0x5'));var Mustache=require(_0xedf0('0x6'));var util=require(_0xedf0('0x7'));var path=require(_0xedf0('0x8'));var sox=require(_0xedf0('0x9'));var csv=require(_0xedf0('0xa'));var ejs=require(_0xedf0('0xb'));var fs=require('fs');var fs_extra=require(_0xedf0('0xc'));var _=require(_0xedf0('0xd'));var squel=require('squel');var crypto=require(_0xedf0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xedf0('0xf'));var toCsv=require(_0xedf0('0xa'));var querystring=require(_0xedf0('0x10'));var Papa=require(_0xedf0('0x11'));var Redis=require(_0xedf0('0x12'));var authService=require(_0xedf0('0x13'));var qs=require(_0xedf0('0x14'));var as=require(_0xedf0('0x15'));var pdf=require(_0xedf0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedf0('0x17'));var utils=require(_0xedf0('0x18'));var config=require(_0xedf0('0x19'));var licenseUtil=require(_0xedf0('0x1a'));var db=require(_0xedf0('0x1b'))['db'];config[_0xedf0('0x1c')]=_['defaults'](config[_0xedf0('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xedf0('0x1d'))(new Redis(config['redis']));require(_0xedf0('0x1e'))[_0xedf0('0x1f')](socket);function respondWithStatusCode(_0x5d13bd,_0xb0e81){_0xb0e81=_0xb0e81||0xcc;return function(_0x35424e){if(_0x35424e){return _0x5d13bd['sendStatus'](_0xb0e81);}return _0x5d13bd['status'](_0xb0e81)[_0xedf0('0x20')]();};}function respondWithResult(_0x2bbe4b,_0x42ec12){_0x42ec12=_0x42ec12||0xc8;return function(_0x71794b){if(_0x71794b){return _0x2bbe4b['status'](_0x42ec12)[_0xedf0('0x21')](_0x71794b);}};}function respondWithFilteredResult(_0x360238,_0x33bc7e){return function(_0x3a8f2e){if(_0x3a8f2e){var _0x55c542=typeof _0x33bc7e['offset']===_0xedf0('0x22')&&typeof _0x33bc7e['limit']===_0xedf0('0x22');var _0x157525=_0x3a8f2e[_0xedf0('0x23')];var _0x5b57da=_0x55c542?0x0:_0x33bc7e['offset'];var _0x1e1df0=_0x55c542?_0x3a8f2e['count']:_0x33bc7e['offset']+_0x33bc7e[_0xedf0('0x24')];var _0x210992;if(_0x1e1df0>=_0x157525){_0x1e1df0=_0x157525;_0x210992=0xc8;}else{_0x210992=0xce;}_0x360238[_0xedf0('0x25')](_0x210992);return _0x360238[_0xedf0('0x26')](_0xedf0('0x27'),_0x5b57da+'-'+_0x1e1df0+'/'+_0x157525)['json'](_0x3a8f2e);}return null;};}function patchUpdates(_0x3f8bd3){return function(_0x4bae8f){try{jsonpatch[_0xedf0('0x28')](_0x4bae8f,_0x3f8bd3,!![]);}catch(_0x130e89){return BPromise[_0xedf0('0x29')](_0x130e89);}return _0x4bae8f[_0xedf0('0x2a')]();};}function saveUpdates(_0x548bbd,_0x61601a){return function(_0x2a2b4a){if(_0x2a2b4a){return _0x2a2b4a[_0xedf0('0x2b')](_0x548bbd)[_0xedf0('0x2c')](function(_0x24be12){return _0x24be12;});}return null;};}function removeEntity(_0x36af1f,_0x587c66){return function(_0x19e927){if(_0x19e927){return _0x19e927['destroy']()[_0xedf0('0x2c')](function(){_0x36af1f[_0xedf0('0x25')](0xcc)[_0xedf0('0x20')]();});}};}function handleEntityNotFound(_0x25d64b,_0x4b2d21){return function(_0x2dca40){if(!_0x2dca40){_0x25d64b[_0xedf0('0x2d')](0x194);}return _0x2dca40;};}function handleError(_0x29e36b,_0x38fcb7){_0x38fcb7=_0x38fcb7||0x1f4;return function(_0x33355c){logger[_0xedf0('0x2e')](_0x33355c[_0xedf0('0x2f')]);if(_0x33355c[_0xedf0('0x30')]){delete _0x33355c[_0xedf0('0x30')];}_0x29e36b[_0xedf0('0x25')](_0x38fcb7)[_0xedf0('0x31')](_0x33355c);};}function getInteractionUsers(_0x251121,_0x45106d){return new BPromise(function(_0x8ed4a4,_0x1d2504){try{if(_0x45106d[_0x251121['id']]){_0x251121[_0xedf0('0x32')]=_[_0xedf0('0x33')](_0x45106d[_0x251121['id']],function(_0x29535e){return{'id':_0x29535e['id'],'fullname':_0x29535e[_0xedf0('0x34')]};});}}catch(_0x4468ea){_0x1d2504(_0x4468ea);}_0x8ed4a4(_0x251121);});}function getInteractionTags(_0x1ef408,_0xd92382){return new BPromise(function(_0x51e94e,_0x578db4){try{if(_0x1ef408[_0xedf0('0x35')]){_0x1ef408[_0xedf0('0x36')]=[];_0x1ef408[_0xedf0('0x35')][_0xedf0('0x37')](',')['forEach'](function(_0x4afc7a){_0x1ef408[_0xedf0('0x36')]['push'](_0xd92382[_0x4afc7a]);});}delete _0x1ef408[_0xedf0('0x35')];}catch(_0x338a04){_0x578db4(_0x338a04);}_0x51e94e(_0x1ef408);});}function updateOpenchannelInteraction(_0x173a2d,_0x1bb0cd,_0x2ec67a){return new BPromise(function(_0x32ee74,_0xd101b9){return getInteractionUsers(_0x173a2d,_0x2ec67a)[_0xedf0('0x2c')](function(_0x1a0b00){return getInteractionTags(_0x1a0b00,_0x1bb0cd);})['then'](function(_0x4f34b1){return getStateInteraction(_0x4f34b1);})['then'](function(_0x2a6bab){_0x32ee74(_0x2a6bab);})[_0xedf0('0x38')](function(_0x1d6153){_0xd101b9(_0x1d6153);});});}function getStateInteraction(_0x1e816d){return new BPromise(function(_0x5ae0a6){_0x1e816d[_0xedf0('0x39')]=0x0;_0x1e816d[_0xedf0('0x3a')]=0x0;_0x1e816d[_0xedf0('0x3b')]=0x0;_0x1e816d[_0xedf0('0x3c')]=0x0;_0x1e816d[_0xedf0('0x3d')]=0x0;if(!_0x1e816d[_0xedf0('0x3e')]&&!_0x1e816d[_0xedf0('0x3f')]){_0x1e816d['waiting']+=0x1;}if(!_0x1e816d[_0xedf0('0x3e')]&&_0x1e816d['UserId']){_0x1e816d[_0xedf0('0x3a')]+=0x1;if(_0x1e816d[_0xedf0('0x39')]){_0x1e816d[_0xedf0('0x39')]-=0x1;}}if(_0x1e816d[_0xedf0('0x3e')]&&_0x1e816d[_0xedf0('0x3f')]){_0x1e816d[_0xedf0('0x3b')]+=0x1;if(_0x1e816d[_0xedf0('0x3a')]){_0x1e816d[_0xedf0('0x3a')]-=0x1;}}if(_0x1e816d[_0xedf0('0x3e')]&&!_0x1e816d['UserId']){_0x1e816d[_0xedf0('0x3c')]+=0x1;if(_0x1e816d['waiting']){_0x1e816d[_0xedf0('0x39')]-=0x1;}}_0x1e816d[_0xedf0('0x3d')]+=0x1;_0x5ae0a6(_0x1e816d);});}exports['index']=function(_0x5bbe78,_0x509d25){var _0x426198={},_0x408eb8={},_0x5614c9={'count':0x0,'rows':[]};var _0x330e00=_[_0xedf0('0x33')](db[_0xedf0('0x40')][_0xedf0('0x41')],function(_0x32ab6c){return{'name':_0x32ab6c['fieldName'],'type':_0x32ab6c[_0xedf0('0x42')][_0xedf0('0x43')]};});_0x408eb8[_0xedf0('0x44')]=_['map'](_0x330e00,_0xedf0('0x30'));_0x408eb8[_0xedf0('0x45')]=_[_0xedf0('0x46')](_0x5bbe78[_0xedf0('0x45')]);_0x408eb8[_0xedf0('0x47')]=_[_0xedf0('0x48')](_0x408eb8[_0xedf0('0x44')],_0x408eb8[_0xedf0('0x45')]);_0x426198[_0xedf0('0x49')]=_[_0xedf0('0x48')](_0x408eb8[_0xedf0('0x44')],qs['fields'](_0x5bbe78['query'][_0xedf0('0x4a')]));_0x426198[_0xedf0('0x49')]=_0x426198[_0xedf0('0x49')][_0xedf0('0x4b')]?_0x426198['attributes']:_0x408eb8[_0xedf0('0x44')];if(!_0x5bbe78['query']['hasOwnProperty'](_0xedf0('0x4c'))){_0x426198[_0xedf0('0x24')]=qs[_0xedf0('0x24')](_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x24')]);_0x426198[_0xedf0('0x4d')]=qs[_0xedf0('0x4d')](_0x5bbe78['query'][_0xedf0('0x4d')]);}_0x426198[_0xedf0('0x4e')]=qs[_0xedf0('0x4f')](_0x5bbe78['query'][_0xedf0('0x4f')]);_0x426198[_0xedf0('0x50')]=qs[_0xedf0('0x47')](_['pick'](_0x5bbe78[_0xedf0('0x45')],_0x408eb8[_0xedf0('0x47')]),_0x330e00);var _0x88d1d5=[];var _0x38a8ec=squel[_0xedf0('0x51')]()['field']('id')[_0xedf0('0x52')](_0xedf0('0x30'))[_0xedf0('0x52')](_0xedf0('0x53'))[_0xedf0('0x54')](_0xedf0('0x55'));var _0x4d38aa=squel[_0xedf0('0x51')]()[_0xedf0('0x52')](_0xedf0('0x56'))[_0xedf0('0x52')](_0xedf0('0x57'))[_0xedf0('0x52')](_0xedf0('0x58'))[_0xedf0('0x54')]('user_has_openchannel_interactions','ui')[_0xedf0('0x59')](_0xedf0('0x5a'),'u',_0xedf0('0x5b'));var _0x567c02=squel[_0xedf0('0x51')]()[_0xedf0('0x54')]('openchannel_interactions','i')[_0xedf0('0x59')](_0xedf0('0x5c'),'c',_0xedf0('0x5d'))[_0xedf0('0x59')]('users','o',_0xedf0('0x5e'))['left_join']('openchannel_accounts','a',_0xedf0('0x5f'))['left_join'](_0xedf0('0x60'),'me',_0xedf0('0x61'))[_0xedf0('0x59')](_0xedf0('0x62'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xedf0('0x59')]('tools_tags','t',_0xedf0('0x63'));var _0x3c0faa=squel[_0xedf0('0x64')]();var _0x36f47f=[];var _0x51bde3=squel[_0xedf0('0x64')]();var _0x81c52d;if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x65')]){_0x81c52d=as[_0xedf0('0x66')](_0x5bbe78[_0xedf0('0x45')]['search']);var _0x43ec27=_0x81c52d[_0xedf0('0x67')];for(var _0x262eb4=0x0;_0x262eb4<_0x81c52d['conditions'][_0xedf0('0x4b')];_0x262eb4++){var _0x2336bd=_0x81c52d['conditions'][_0x262eb4];var _0x2c18b2='i';var _0x1cf442=_[_0xedf0('0x68')](_0x330e00,['name',_0x2336bd[_0xedf0('0x52')]]);if(!_0x1cf442){switch(_0x2336bd[_0xedf0('0x52')]){case _0xedf0('0x69'):if(_0x2336bd['value']==0x1){_0x567c02[_0xedf0('0x6a')]('`'+_0x2336bd[_0xedf0('0x52')]+_0xedf0('0x6b'));}else{_0x567c02[_0xedf0('0x6a')]('`'+_0x2336bd['field']+_0xedf0('0x6c'));}break;case _0xedf0('0x6d'):if(_0x2336bd[_0xedf0('0x6e')]===_0xedf0('0x6f')){if(_0x2336bd[_0xedf0('0x70')][_0xedf0('0x37')]('\x20')[_0xedf0('0x4b')]>0x1){_0x3c0faa[_0x43ec27](_0xedf0('0x71'),qs[_0xedf0('0x72')](_0x2336bd[_0xedf0('0x70')]),null);}else{var _0x14b51c='%'+_0x2336bd[_0xedf0('0x70')]+'%';_0x3c0faa[_0x43ec27](_0xedf0('0x73'),_0x14b51c,_0x14b51c,_0x14b51c);}}else{_0x1cf442=_['find'](_0x330e00,['name','ContactId']);_0x2336bd['field']=_0xedf0('0x74');_0x4cf85f=as['buildExpression'](_0x2c18b2,_0x1cf442[_0xedf0('0x42')],_0x2336bd);_0x3c0faa[_0x43ec27](_0x4cf85f[_0xedf0('0x75')],_0x4cf85f['value'][_0xedf0('0x76')],_0x4cf85f[_0xedf0('0x70')]['end']);}break;case _0xedf0('0x77'):var _0x383193=_0x2336bd[_0xedf0('0x70')][_0xedf0('0x37')](',')[_0xedf0('0x33')](function(_0x32f0ef){return Number(_0x32f0ef);});_0x383193[_0xedf0('0x78')](function(_0x198104){_0x51bde3['or'](_0xedf0('0x79'),'%,'+_0x198104+',%');});_0x36f47f=_[_0xedf0('0x7a')](_0x36f47f,_0x383193);break;case _0xedf0('0x7b'):if(_0x2336bd[_0xedf0('0x6e')]==='$substring'){_0x3c0faa[_0x43ec27]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2336bd['value']+'%',null);}else{_0x1cf442=_[_0xedf0('0x68')](_0x330e00,[_0xedf0('0x30'),'UserId']);_0x2336bd[_0xedf0('0x52')]=_0xedf0('0x3f');_0x4cf85f=as['buildExpression'](_0x2c18b2,_0x1cf442[_0xedf0('0x42')],_0x2336bd);_0x3c0faa[_0x43ec27](_0x4cf85f[_0xedf0('0x75')],_0x4cf85f[_0xedf0('0x70')][_0xedf0('0x76')],_0x4cf85f['value']['end']);}break;case _0xedf0('0x7c'):_0x4cf85f=as['buildExpression']('me',null,_0x2336bd);_0x3c0faa[_0x43ec27](_0x4cf85f[_0xedf0('0x75')],_0x4cf85f['value'][_0xedf0('0x76')],_0x4cf85f['value']['end']);break;}}else{var _0x4cf85f=as['buildExpression'](_0x2c18b2,_0x1cf442[_0xedf0('0x42')],_0x2336bd);_0x3c0faa[_0x43ec27](_0x4cf85f['text'],_0x4cf85f[_0xedf0('0x70')][_0xedf0('0x76')],_0x4cf85f[_0xedf0('0x70')]['end']);}}}else{var _0x45cfdd=_(_0x5bbe78['query'])[_0xedf0('0x46')]()['map'](function(_0x15ab8e){return _['some'](_0x330e00,[_0xedf0('0x30'),_0x15ab8e])?_0x15ab8e:undefined;})[_0xedf0('0x7d')]()[_0xedf0('0x70')]();if(!_[_0xedf0('0x7e')](_0x45cfdd)){_0x45cfdd[_0xedf0('0x78')](function(_0x297b7b){if(_0x297b7b===_0xedf0('0x7f')){_0x567c02[_0xedf0('0x50')](_0xedf0('0x80'),[][_0xedf0('0x81')](_0x5bbe78[_0xedf0('0x45')][_0x297b7b]));}else if(_0x297b7b===_0xedf0('0x82')){var _0x3119fc=JSON[_0xedf0('0x83')](_0x5bbe78[_0xedf0('0x45')][_0x297b7b])[_0xedf0('0x84')];var _0x147ec9=JSON[_0xedf0('0x83')](_0x5bbe78['query'][_0x297b7b])['$lte'];_0x567c02[_0xedf0('0x50')](_0xedf0('0x85'),_0x3119fc,_0x147ec9);}else{if(_0x5bbe78[_0xedf0('0x45')][_0x297b7b]===_0xedf0('0x86')){_0x567c02[_0xedf0('0x50')]('i.'+_0x297b7b+_0xedf0('0x87'));}else{_0x567c02[_0xedf0('0x50')]('i.'+_0x297b7b+'\x20=\x20?',_0x5bbe78['query'][_0x297b7b]);}}});}if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x88')]){if(_0x5bbe78[_0xedf0('0x45')]['read']==0x1){_0x567c02[_0xedf0('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x567c02['having']('`unreadMessages`\x20>\x200');}}if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x89')]){_0x36f47f=_['isArray'](_0x5bbe78['query'][_0xedf0('0x89')])?_0x5bbe78['query']['tag']:new Array(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x89')]);_0x36f47f[_0xedf0('0x78')](function(_0x11fc66){_0x51bde3['or'](_0xedf0('0x79'),'%,'+_0x11fc66+',%');});}if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x8a')]){var _0x26af9f=_0x5bbe78['query'][_0xedf0('0x8a')][_0xedf0('0x8b')]('\x5c','\x5c\x5c')[_0xedf0('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x26af9f)){_0x3c0faa['or'](_0xedf0('0x8c'),_0x26af9f+'%');}else{_0x3c0faa['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x26af9f))['or'](_0xedf0('0x8d'),_0x26af9f+'%')['or'](_0xedf0('0x8e'),_0x26af9f+'%');}}}_0x567c02[_0xedf0('0x50')](_0x3c0faa);_0x567c02[_0xedf0('0x8f')]('i.id');var _0x3f13e4={'type':db[_0xedf0('0x90')][_0xedf0('0x91')][_0xedf0('0x92')],'raw':!![]};var _0x5d7108=_0x567c02[_0xedf0('0x93')]();_0x5d7108['field']('i.id');_0x5d7108[_0xedf0('0x52')](_0xedf0('0x94'),_0xedf0('0x69'));if(_0x426198[_0xedf0('0x4e')]){_0x426198[_0xedf0('0x4e')][_0xedf0('0x78')](function(_0x210f60){var _0x5b91af=_0x210f60[0x0]==='contactName'?_0x210f60[0x0]:'i.'+_0x210f60[0x0];_0x567c02[_0xedf0('0x4e')](_0x5b91af,_0x210f60[0x1]===_0xedf0('0x95')?![]:!![]);});}if(!_[_0xedf0('0x7e')](_0x36f47f)){_0x567c02[_0xedf0('0x6a')](_0x51bde3);_0x5d7108[_0xedf0('0x50')](_0xedf0('0x96'),_0x36f47f);}BPromise['resolve']()[_0xedf0('0x2c')](function(){if(!_0x81c52d){if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x7f')])return;_0x5d7108[_0xedf0('0x50')](_0xedf0('0x97'));_0x567c02[_0xedf0('0x50')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5bbe78[_0xedf0('0x98')][_0xedf0('0x99')]!==_0xedf0('0x9a'))return;return _0x5bbe78[_0xedf0('0x98')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xedf0('0x2c')](function(_0x3fc407){if(_[_0xedf0('0x7e')](_0x3fc407)){_0x5d7108[_0xedf0('0x50')](_0xedf0('0x9b'));_0x567c02[_0xedf0('0x50')](_0xedf0('0x9b'));}else{_0x5d7108[_0xedf0('0x50')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x3fc407,'id'));_0x567c02['where'](_0xedf0('0x80'),_[_0xedf0('0x33')](_0x3fc407,'id'));}});})[_0xedf0('0x2c')](function(){if(_0x5bbe78[_0xedf0('0x98')][_0xedf0('0x99')]===_0xedf0('0x9a')&&!_0x81c52d&&!_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x7f')])return[];return db['sequelize'][_0xedf0('0x45')](_0x5d7108[_0xedf0('0x9c')](),_0x3f13e4);})[_0xedf0('0x2c')](function(_0x30025b){_0x5614c9[_0xedf0('0x23')]=_0x30025b['length'];if(_0x5614c9['count']===0x0)return[];return db[_0xedf0('0x9d')][_0xedf0('0x45')](_0x38a8ec[_0xedf0('0x9c')](),_0x3f13e4)[_0xedf0('0x2c')](function(_0x728896){_0x88d1d5=_['keyBy'](_0x728896,'id');_0x3f13e4=_[_0xedf0('0x9e')](_0x3f13e4,{'model':db[_0xedf0('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bbe78[_0xedf0('0x45')][_0xedf0('0x4a')]){_0x426198['attributes'][_0xedf0('0x78')](function(_0x36e668){_0x567c02[_0xedf0('0x52')]('i.'+_0x36e668);});}else{_0x567c02['field'](_0xedf0('0x94'),_0xedf0('0x69'));_0x567c02[_0xedf0('0x52')](_0xedf0('0x9f'),_0xedf0('0xa0'));_0x567c02[_0xedf0('0x52')](_0xedf0('0xa1'),'Account.mandatoryDisposition');_0x567c02[_0xedf0('0x52')](_0xedf0('0xa2'),'contactName');_0x567c02[_0xedf0('0x52')](_0xedf0('0xa3'));_0x567c02['field'](_0xedf0('0xa4'),'Contact.firstName');_0x567c02[_0xedf0('0x52')]('c.lastName',_0xedf0('0xa5'));_0x567c02['field'](_0xedf0('0xa6'),_0xedf0('0xa7'));_0x567c02[_0xedf0('0x52')](_0xedf0('0xa8'),_0xedf0('0xa9'));_0x567c02[_0xedf0('0x52')]('c.mobile',_0xedf0('0xaa'));_0x567c02['field'](_0xedf0('0xab'),'Contact.fax');_0x567c02[_0xedf0('0x52')](_0xedf0('0xac'),_0xedf0('0xad'));_0x567c02[_0xedf0('0x52')]('o.internal',_0xedf0('0xae'));_0x567c02[_0xedf0('0x52')](_0xedf0('0xaf'),_0xedf0('0x35'));}if(_0x426198[_0xedf0('0x24')])_0x567c02[_0xedf0('0x24')](_0x426198[_0xedf0('0x24')]);if(_0x426198[_0xedf0('0x4d')])_0x567c02[_0xedf0('0x4d')](_0x426198['offset']);return db['sequelize'][_0xedf0('0x45')](_0x567c02[_0xedf0('0x9c')](),_0x3f13e4);})[_0xedf0('0x2c')](function(_0x3ec7c6){if(_0x3ec7c6[_0xedf0('0x4b')]>0x0)_0x4d38aa[_0xedf0('0x50')](_0xedf0('0xb0'),_[_0xedf0('0x33')](_0x3ec7c6,'id'));return db['sequelize'][_0xedf0('0x45')](_0x4d38aa[_0xedf0('0x9c')](),_0x3f13e4)['then'](function(_0x206132){var _0x1ab50=_[_0xedf0('0xb1')](_0x206132,'OpenchannelInteractionId');var _0x73d2c3=[];_0x3ec7c6[_0xedf0('0x78')](function(_0x4758b4){_0x73d2c3[_0xedf0('0xb2')](updateOpenchannelInteraction(_0x4758b4,_0x88d1d5,_0x1ab50));});return BPromise['all'](_0x73d2c3);});});})[_0xedf0('0x2c')](function(_0x1210c4){_0x5614c9[_0xedf0('0xb3')]=_0x1210c4;return _0x5614c9;})['then'](respondWithFilteredResult(_0x509d25,_0x426198))['catch'](handleError(_0x509d25,null));};exports[_0xedf0('0xb4')]=function(_0x40c012,_0x59048c){var _0x4491de={};if(_0x40c012[_0xedf0('0x45')][_0xedf0('0x42')]&&_0x40c012[_0xedf0('0x45')]['type']===_0xedf0('0x54')){_0x4491de[_0xedf0('0x54')]=_0x40c012['params']['id'];}else{_0x4491de['id']=_0x40c012[_0xedf0('0xb5')]['id'];}var _0x581191={'raw':![],'where':_0x4491de},_0x375f21={};_0x375f21['model']=_[_0xedf0('0x46')](db[_0xedf0('0x40')][_0xedf0('0x41')]);_0x375f21[_0xedf0('0x45')]=_[_0xedf0('0x46')](_0x40c012[_0xedf0('0x45')]);_0x375f21[_0xedf0('0x47')]=_[_0xedf0('0x48')](_0x375f21[_0xedf0('0x44')],_0x375f21[_0xedf0('0x45')]);_0x581191['attributes']=_[_0xedf0('0x48')](_0x375f21['model'],qs[_0xedf0('0x4a')](_0x40c012[_0xedf0('0x45')][_0xedf0('0x4a')]));_0x581191[_0xedf0('0x49')]=_0x581191['attributes']['length']?_0x581191['attributes']:_0x375f21[_0xedf0('0x44')];if(_0x40c012[_0xedf0('0x45')][_0xedf0('0xb6')]){_0x581191[_0xedf0('0xb7')]=[{'all':!![]}];}_0x581191=_[_0xedf0('0x9e')]({},_0x581191,_0x40c012[_0xedf0('0xb8')]);return db['OpenchannelInteraction']['find'](_0x581191)[_0xedf0('0x2c')](handleEntityNotFound(_0x59048c,null))[_0xedf0('0x2c')](respondWithResult(_0x59048c,null))[_0xedf0('0x38')](handleError(_0x59048c,null));};exports[_0xedf0('0xb9')]=function(_0x23e2f5,_0x42fdac){return db[_0xedf0('0x40')][_0xedf0('0xb9')](_0x23e2f5[_0xedf0('0x7c')],{})[_0xedf0('0x2c')](respondWithResult(_0x42fdac,0xc9))[_0xedf0('0x38')](handleError(_0x42fdac,null));};exports[_0xedf0('0x2b')]=function(_0x1658a2,_0x448203){if(_0x1658a2[_0xedf0('0x7c')]['id']){delete _0x1658a2['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x1658a2[_0xedf0('0xb5')]['id']}})['then'](handleEntityNotFound(_0x448203,null))[_0xedf0('0x2c')](saveUpdates(_0x1658a2[_0xedf0('0x7c')],null))[_0xedf0('0x2c')](respondWithResult(_0x448203,null))[_0xedf0('0x38')](handleError(_0x448203,null));};exports['destroy']=function(_0x57857c,_0x109a65){return db[_0xedf0('0x40')]['find']({'where':{'id':_0x57857c[_0xedf0('0xb5')]['id']}})[_0xedf0('0x2c')](handleEntityNotFound(_0x109a65,null))['then'](removeEntity(_0x109a65,null))[_0xedf0('0x38')](handleError(_0x109a65,null));};exports[_0xedf0('0xba')]=function(_0x7912d8,_0x39dd1e){return db[_0xedf0('0x40')][_0xedf0('0xba')]()[_0xedf0('0x2c')](respondWithResult(_0x39dd1e,null))['catch'](handleError(_0x39dd1e,null));};exports[_0xedf0('0xbb')]=function(_0x3323c7,_0x2fcecc,_0x4182be){return db['OpenchannelMessage'][_0xedf0('0x68')]({'where':{'id':_0x3323c7[_0xedf0('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2fcecc,null))[_0xedf0('0x2c')](function(_0x2c3133){if(_0x2c3133){return _0x2c3133[_0xedf0('0xbb')](_0x3323c7['body'][_0xedf0('0xbc')],_[_0xedf0('0xbd')](_0x3323c7['body'],['ids','id'])||{});}})[_0xedf0('0x2c')](respondWithResult(_0x2fcecc,null))[_0xedf0('0x38')](handleError(_0x2fcecc,null));};exports[_0xedf0('0xbe')]=function(_0xaed25b,_0x89ba02,_0x402f4b){var _0x5c7a29={'raw':![],'where':{}};var _0x59da2c={};var _0x3bcb71={'count':0x0,'rows':[]};return db[_0xedf0('0x40')]['findOne']({'where':{'id':_0xaed25b['params']['id']}})['then'](handleEntityNotFound(_0x89ba02,null))['then'](function(_0xe0948d){if(_0xe0948d){_0x59da2c[_0xedf0('0x44')]=_[_0xedf0('0x46')](db[_0xedf0('0xbf')][_0xedf0('0x41')]);_0x59da2c[_0xedf0('0x45')]=_[_0xedf0('0x46')](_0xaed25b[_0xedf0('0x45')]);_0x59da2c[_0xedf0('0x47')]=_[_0xedf0('0x48')](_0x59da2c['model'],_0x59da2c['query']);_0x5c7a29[_0xedf0('0x49')]=_['intersection'](_0x59da2c[_0xedf0('0x44')],qs['fields'](_0xaed25b[_0xedf0('0x45')][_0xedf0('0x4a')]));_0x5c7a29['attributes']=_0x5c7a29[_0xedf0('0x49')][_0xedf0('0x4b')]?_0x5c7a29[_0xedf0('0x49')]:_0x59da2c[_0xedf0('0x44')];if(!_0xaed25b[_0xedf0('0x45')][_0xedf0('0xc0')](_0xedf0('0x4c'))){_0x5c7a29[_0xedf0('0x24')]=qs['limit'](_0xaed25b[_0xedf0('0x45')][_0xedf0('0x24')]);_0x5c7a29[_0xedf0('0x4d')]=qs[_0xedf0('0x4d')](_0xaed25b[_0xedf0('0x45')][_0xedf0('0x4d')]);}_0x5c7a29[_0xedf0('0x4e')]=qs[_0xedf0('0x4f')](_0xaed25b[_0xedf0('0x45')][_0xedf0('0x4f')]);_0x5c7a29['where']=qs[_0xedf0('0x47')](_['pick'](_0xaed25b[_0xedf0('0x45')],_0x59da2c[_0xedf0('0x47')]));_0x5c7a29[_0xedf0('0x50')]['OpenchannelInteractionId']=_0xe0948d['id'];if(_0xaed25b[_0xedf0('0x45')][_0xedf0('0x8a')]){_0x5c7a29['where']=_[_0xedf0('0x9e')](_0x5c7a29[_0xedf0('0x50')],{'$or':_['map'](_0x5c7a29[_0xedf0('0x49')],function(_0x20f253){var _0x3568d9={};_0x3568d9[_0x20f253]={'$like':'%'+_0xaed25b[_0xedf0('0x45')][_0xedf0('0x8a')]+'%'};return _0x3568d9;})});}if(_0xaed25b['query'][_0xedf0('0x84')]){var _0x14d7ef=_0xaed25b[_0xedf0('0x45')]['$gte'][_0xedf0('0x37')](',');var _0x38ec13={};_0x38ec13[_0x14d7ef[0x0]]={'$gte':moment(_0x14d7ef[0x1])[_0xedf0('0xc1')](_0xedf0('0xc2'))};_0x5c7a29[_0xedf0('0x50')]=_[_0xedf0('0x9e')](_0x5c7a29[_0xedf0('0x50')],_0x38ec13);}_0x5c7a29=_[_0xedf0('0x9e')]({},_0x5c7a29,_0xaed25b[_0xedf0('0xb8')]);return db['OpenchannelMessage'][_0xedf0('0x23')]({'where':_0x5c7a29[_0xedf0('0x50')]})[_0xedf0('0x2c')](function(_0x116a80){_0x3bcb71[_0xedf0('0x23')]=_0x116a80;if(_0xaed25b[_0xedf0('0x45')]['includeAll']){_0x5c7a29[_0xedf0('0xb7')]=[{'all':!![]}];}return db[_0xedf0('0xbf')]['findAll'](_0x5c7a29);})[_0xedf0('0x2c')](function(_0x14dbe5){_0x3bcb71[_0xedf0('0xb3')]=_0x14dbe5;return _0x3bcb71;});}})[_0xedf0('0x2c')](respondWithFilteredResult(_0x89ba02,_0x5c7a29))['catch'](handleError(_0x89ba02,null));};exports['addTags']=function(_0x45f1b1,_0x24d4e7,_0x40a387){return db[_0xedf0('0x40')][_0xedf0('0x68')]({'where':{'id':_0x45f1b1[_0xedf0('0xb5')]['id']}})[_0xedf0('0x2c')](handleEntityNotFound(_0x24d4e7,null))[_0xedf0('0x2c')](function(_0xae826){if(_0xae826){return _0xae826['setTags'](_0x45f1b1[_0xedf0('0x7c')][_0xedf0('0xbc')],_[_0xedf0('0xbd')](_0x45f1b1[_0xedf0('0x7c')],[_0xedf0('0xbc'),'id'])||{})[_0xedf0('0xc3')](function(){return db[_0xedf0('0x77')][_0xedf0('0xc4')]({'attributes':['id','name',_0xedf0('0x53')],'where':{'id':_0x45f1b1[_0xedf0('0x7c')][_0xedf0('0xbc')]}});})[_0xedf0('0x2c')](function(_0x57c29b){socket['emit'](_0xedf0('0xc5'),{'id':Number(_0x45f1b1[_0xedf0('0xb5')]['id']),'tags':_0x57c29b||[]});return{'id':Number(_0x45f1b1[_0xedf0('0xb5')]['id']),'tags':_0x57c29b||[]};});}})[_0xedf0('0x2c')](respondWithResult(_0x24d4e7,null))[_0xedf0('0x38')](handleError(_0x24d4e7,null));};exports[_0xedf0('0xc6')]=function(_0x304407,_0x4802a6,_0x349303){return db[_0xedf0('0x40')][_0xedf0('0x68')]({'where':{'id':_0x304407[_0xedf0('0xb5')]['id']}})[_0xedf0('0x2c')](handleEntityNotFound(_0x4802a6,null))[_0xedf0('0x2c')](function(_0x4119bf){if(_0x4119bf){return _0x4119bf[_0xedf0('0xc6')](_0x304407['query'][_0xedf0('0xbc')]);}})[_0xedf0('0x2c')](respondWithStatusCode(_0x4802a6,null))[_0xedf0('0x38')](handleError(_0x4802a6,null));};exports[_0xedf0('0xc7')]=function(_0x77ca3,_0x5666f3){var _0x5c97b8=moment()['unix']()[_0xedf0('0x9c')]();var _0x112cae=path[_0xedf0('0xc8')](config['root'],_0xedf0('0xc9'),_0xedf0('0xca'),_0xedf0('0xcb'));var _0x50680b=path[_0xedf0('0xc8')](config[_0xedf0('0xcc')],'server',_0xedf0('0xca'),_0xedf0('0xcd'));var _0x496354=path[_0xedf0('0xc8')](_0x112cae,_0x5c97b8);var _0x41d966=util[_0xedf0('0xc1')](_0xedf0('0xce'),_0x77ca3[_0xedf0('0xb5')]['id'],_0x5c97b8);var _0x5739f4=path[_0xedf0('0xc8')](_0x112cae,_0x41d966);var _0x500875=[];_0x500875[_0xedf0('0xb2')]({'model':db[_0xedf0('0x7b')],'as':_0xedf0('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x500875[_0xedf0('0xb2')]({'model':db[_0xedf0('0xcf')],'as':_0xedf0('0x6d'),'attributes':['id',_0xedf0('0xd0'),_0xedf0('0xd1')],'raw':!![]});if(_0x77ca3[_0xedf0('0x45')]['attachments']){_0x500875['push']({'model':db[_0xedf0('0xd2')],'as':_0xedf0('0xd2'),'raw':!![]});}var _0x1eedda=[{'model':db['OpenchannelMessage'],'as':_0xedf0('0xd3'),'attributes':['id',_0xedf0('0x7c'),_0xedf0('0x82'),'direction',_0xedf0('0xd4'),'read'],'include':_0x500875}];_0x1eedda[_0xedf0('0xb2')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xedf0('0x30')]});_0x1eedda[_0xedf0('0xb2')]({'model':db[_0xedf0('0x7b')],'as':_0xedf0('0xd5'),'attributes':['id',_0xedf0('0x34')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x77ca3[_0xedf0('0xb5')]['id']},'include':_0x1eedda})[_0xedf0('0x2c')](handleEntityNotFound(_0x5666f3,null))[_0xedf0('0x2c')](function(_0x5d4012){if(_0x5d4012){var _0x2c4dec=_0x5d4012[_0xedf0('0xd6')]({'plain':!![]});fs[_0xedf0('0xd7')](_0x496354);var _0x3fc76={'channel':_0xedf0('0xd8'),'account':_0x2c4dec[_0xedf0('0xd9')][_0xedf0('0x30')],'agent':_0x2c4dec[_0xedf0('0xd5')]?_0x2c4dec[_0xedf0('0xd5')][_0xedf0('0x34')]:_0xedf0('0xda'),'createdAt':moment(_0x2c4dec[_0xedf0('0x82')])[_0xedf0('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xedf0('0x9c')](),'closedAt':_0x2c4dec[_0xedf0('0x3e')]?moment(_0x2c4dec[_0xedf0('0xdb')])[_0xedf0('0xc1')](_0xedf0('0xc2'))['toString']():'','disposition':_0x2c4dec[_0xedf0('0xdc')],'visibility':_0x2c4dec[_0xedf0('0xdd')]?_0xedf0('0xde'):'Private','messages':_(_0x2c4dec['Messages'])[_0xedf0('0x8a')]({'secret':![]})[_0xedf0('0x33')](function(_0x23dbcc){if(_0x23dbcc[_0xedf0('0xd2')]){var _0x1c4749=path[_0xedf0('0xc8')](_0x50680b,_0x23dbcc[_0xedf0('0xd2')][_0xedf0('0xdf')]);if(fs[_0xedf0('0xe0')](_0x1c4749)){fs[_0xedf0('0xe1')](_0x1c4749)[_0xedf0('0xe2')](fs[_0xedf0('0xe3')](path[_0xedf0('0xc8')](_0x496354,_0x23dbcc[_0xedf0('0xd2')][_0xedf0('0xdf')])));}}return{'date':moment(_0x23dbcc[_0xedf0('0x82')])[_0xedf0('0xc1')](_0xedf0('0xc2'))[_0xedf0('0x9c')](),'sender':_0x23dbcc[_0xedf0('0xe4')]==='out'?_0x23dbcc['User']?_0x23dbcc[_0xedf0('0x7b')][_0xedf0('0x34')]:_0xedf0('0xe5'):_0x23dbcc[_0xedf0('0x6d')][_0xedf0('0xd0')]+(_0x23dbcc[_0xedf0('0x6d')][_0xedf0('0xd1')]?'\x20'+_0x23dbcc[_0xedf0('0x6d')][_0xedf0('0xd1')]:''),'body':_0x23dbcc[_0xedf0('0xd2')]?_0x23dbcc[_0xedf0('0xd2')][_0xedf0('0xdf')]:_0x23dbcc[_0xedf0('0x7c')],'direction':_0x23dbcc[_0xedf0('0xe4')]==='out'?'A':'C','secret':_0x23dbcc[_0xedf0('0xd4')],'read':_0x23dbcc['read'],'attachment':_0x23dbcc[_0xedf0('0xd2')]};})[_0xedf0('0x70')]()};return ejs[_0xedf0('0xe6')](path[_0xedf0('0xc8')](config[_0xedf0('0xcc')],_0xedf0('0xc9'),_0xedf0('0xe7'),_0xedf0('0xe8')),{'interaction':_0x3fc76})[_0xedf0('0x2c')](function(_0x2f913b){var _0x27b47a=path[_0xedf0('0xc8')](_0x496354,_0xedf0('0xe9')+_0x2c4dec['id']+'-'+_0x5c97b8+_0xedf0('0xea'));var _0x218e3b={'path':_0x27b47a,'channel':'Openchannel','interactionId':_0x2c4dec['id']};return pdf[_0xedf0('0xeb')](_0x2f913b,_0x218e3b);})[_0xedf0('0x2c')](function(){return new BPromise(function(_0x4028fb,_0x5a85f0){zipdir(_0x496354,{'saveTo':_0x5739f4},function(_0xb55746,_0x255056){if(_0xb55746)return _0x5a85f0(_0xb55746);return _0x4028fb(_0x255056);});})[_0xedf0('0x2c')](function(){return new BPromise(function(_0x293242,_0x52105d){rimraf(_0x496354,function(_0x1ef502){if(_0x1ef502)_0x52105d(_0x1ef502);return _0x293242();});});})[_0xedf0('0x2c')](function(){return _0x5666f3[_0xedf0('0xc7')](_0x5739f4,_0x41d966,function(_0x23fddf){if(_0x23fddf){console[_0xedf0('0xec')](_0xedf0('0xed'),_0x23fddf);}else{fs[_0xedf0('0xee')](_0x5739f4);}});});});}else{return _0x5666f3[_0xedf0('0x2d')](0xc8);}})[_0xedf0('0x38')](handleError(_0x5666f3,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 93226ee..2c22c28 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 _0x9ac0=['findAll','unreadMessages','length','emit','catch','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3eac6d,_0x118305){var _0x5c2773=function(_0x3c0028){while(--_0x3c0028){_0x3eac6d['push'](_0x3eac6d['shift']());}};_0x5c2773(++_0x118305);}(_0x9ac0,0x116));var _0x09ac=function(_0x2dbc77,_0x3c38b6){_0x2dbc77=_0x2dbc77-0x0;var _0x3c70f4=_0x9ac0[_0x2dbc77];return _0x3c70f4;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x09ac('0x0'))['db'][_0x09ac('0x1')];var OpenchannelMessage=require(_0x09ac('0x0'))['db'][_0x09ac('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x09ac('0x3')](0x0);var events={'afterCreate':_0x09ac('0x4'),'afterUpdate':_0x09ac('0x5'),'afterDestroy':'remove'};function emitEvent(_0x339657){return function(_0x46fd74,_0x32a016,_0x353ae8){_0x46fd74[_0x09ac('0x6')]({'attributes':['id'],'raw':!![]})[_0x09ac('0x7')](function(_0x11f2ad){_0x46fd74[_0x09ac('0x8')](_0x09ac('0x9'),_0x11f2ad[_0x09ac('0xa')](function(_0x444627){return{'id':_0x444627['id']};}));return OpenchannelMessage[_0x09ac('0xb')]({'where':{'OpenchannelInteractionId':_0x46fd74['id'],'direction':'in','read':![]},'raw':!![]});})[_0x09ac('0x7')](function(_0x2bb40a){_0x46fd74[_0x09ac('0x8')](_0x09ac('0xc'),_0x2bb40a[_0x09ac('0xd')]);OpenchannelInteractionEvents['emit'](_0x339657+':'+_0x46fd74['id'],_0x46fd74);OpenchannelInteractionEvents[_0x09ac('0xe')](_0x339657,_0x46fd74);_0x353ae8(null);})[_0x09ac('0xf')](_0x353ae8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x09ac('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xdd5e=['map','findAll','unreadMessages','length','emit','catch','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x351b1b,_0x58015d){var _0x2964d7=function(_0x48f313){while(--_0x48f313){_0x351b1b['push'](_0x351b1b['shift']());}};_0x2964d7(++_0x58015d);}(_0xdd5e,0x127));var _0xedd5=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xdd5e[_0x102ff9];return _0x24fa97;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xedd5('0x0'))['db'][_0xedd5('0x1')];var OpenchannelMessage=require(_0xedd5('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xedd5('0x2')](0x0);var events={'afterCreate':_0xedd5('0x3'),'afterUpdate':_0xedd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ef727){return function(_0x1ce3a6,_0x4674b9,_0x69008d){_0x1ce3a6[_0xedd5('0x5')]({'attributes':['id'],'raw':!![]})[_0xedd5('0x6')](function(_0x4d7607){_0x1ce3a6[_0xedd5('0x7')](_0xedd5('0x8'),_0x4d7607[_0xedd5('0x9')](function(_0x563e79){return{'id':_0x563e79['id']};}));return OpenchannelMessage[_0xedd5('0xa')]({'where':{'OpenchannelInteractionId':_0x1ce3a6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x230fe4){_0x1ce3a6[_0xedd5('0x7')](_0xedd5('0xb'),_0x230fe4[_0xedd5('0xc')]);OpenchannelInteractionEvents['emit'](_0x1ef727+':'+_0x1ce3a6['id'],_0x1ce3a6);OpenchannelInteractionEvents[_0xedd5('0xd')](_0x1ef727,_0x1ce3a6);_0x69008d(null);})[_0xedd5('0xe')](_0x69008d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xedd5('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8709f3f..c535e76 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 _0x9e33=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x9e33,0x144));var _0x39e3=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x9e33[_0x4394b6];return _0x360244;};'use strict';var _=require(_0x39e3('0x0'));var util=require(_0x39e3('0x1'));var logger=require(_0x39e3('0x2'))(_0x39e3('0x3'));var moment=require(_0x39e3('0x4'));var BPromise=require(_0x39e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39e3('0x6'));var config=require(_0x39e3('0x7'));var attributes=require(_0x39e3('0x8'));module[_0x39e3('0x9')]=function(_0x436c94,_0x59a881){return _0x436c94['define'](_0x39e3('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39e3('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x58ff92,_0x41c4c4,_0x1add3b){if(_0x58ff92['changed'](_0x39e3('0xc'))){_0x58ff92[_0x39e3('0xd')]=moment()['format'](_0x39e3('0xe'));}_0x1add3b(null,_0x58ff92);}}});}; \ No newline at end of file +var _0x289e=['request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x59ff85,_0x2958e4){var _0x3e4e3d=function(_0x4c0201){while(--_0x4c0201){_0x59ff85['push'](_0x59ff85['shift']());}};_0x3e4e3d(++_0x2958e4);}(_0x289e,0xea));var _0xe289=function(_0x5e3f15,_0x4b8170){_0x5e3f15=_0x5e3f15-0x0;var _0x38683c=_0x289e[_0x5e3f15];return _0x38683c;};'use strict';var _=require(_0xe289('0x0'));var util=require(_0xe289('0x1'));var logger=require('../../config/logger')(_0xe289('0x2'));var moment=require(_0xe289('0x3'));var BPromise=require('bluebird');var rp=require(_0xe289('0x4'));var fs=require('fs');var path=require(_0xe289('0x5'));var rimraf=require('rimraf');var config=require(_0xe289('0x6'));var attributes=require(_0xe289('0x7'));module[_0xe289('0x8')]=function(_0x14871b,_0x2096af){return _0x14871b[_0xe289('0x9')](_0xe289('0xa'),attributes,{'tableName':_0xe289('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe289('0xc'),'collate':_0xe289('0xd'),'hooks':{'beforeUpdate':function(_0x4ee069,_0x1c3ed5,_0x64a0da){if(_0x4ee069[_0xe289('0xe')]('closed')){_0x4ee069[_0xe289('0xf')]=moment()['format'](_0xe289('0x10'));}_0x64a0da(null,_0x4ee069);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ef3a854..3d1c5d3 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 _0x1fe0=['defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0xd2797f,_0x88d76b){var _0xe35a1e=function(_0x4130db){while(--_0x4130db){_0xd2797f['push'](_0xd2797f['shift']());}};_0xe35a1e(++_0x88d76b);}(_0x1fe0,0xe8));var _0x01fe=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x1fe0[_0x36c6eb];return _0x30675b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x01fe('0x0'));var BPromise=require('bluebird');var rs=require(_0x01fe('0x1'));var fs=require('fs');var Redis=require(_0x01fe('0x2'));var db=require(_0x01fe('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x01fe('0x4'));var jayson=require(_0x01fe('0x5'));var client=jayson[_0x01fe('0x6')][_0x01fe('0x7')]({'port':0x232a});config['redis']=_[_0x01fe('0x8')](config[_0x01fe('0x9')],{'host':_0x01fe('0xa'),'port':0x18eb});var socket=require(_0x01fe('0xb'))(new Redis(config['redis']));require(_0x01fe('0xc'))['register'](socket);function respondWithRpcPromise(_0x5dbde8,_0x6ae75d,_0x26115a){return new BPromise(function(_0x30138b,_0x2909ea){return client[_0x01fe('0xd')](_0x5dbde8,_0x26115a)[_0x01fe('0xe')](function(_0x32164f){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x6ae75d,_0x01fe('0xf'));logger[_0x01fe('0x10')](_0x01fe('0x11'),_0x6ae75d,_0x01fe('0xf'),JSON[_0x01fe('0x12')](_0x32164f));if(_0x32164f[_0x01fe('0x13')]){if(_0x32164f[_0x01fe('0x13')][_0x01fe('0x14')]===0x1f4){logger[_0x01fe('0x13')](_0x01fe('0x15'),_0x6ae75d,_0x32164f[_0x01fe('0x13')][_0x01fe('0x16')]);return _0x2909ea(_0x32164f[_0x01fe('0x13')][_0x01fe('0x16')]);}logger[_0x01fe('0x13')](_0x01fe('0x15'),_0x6ae75d,_0x32164f[_0x01fe('0x13')][_0x01fe('0x16')]);return _0x30138b(_0x32164f[_0x01fe('0x13')][_0x01fe('0x16')]);}else{logger[_0x01fe('0x17')](_0x01fe('0x15'),_0x6ae75d,_0x01fe('0xf'));_0x30138b(_0x32164f['result'][_0x01fe('0x16')]);}})['catch'](function(_0x1ea49d){logger[_0x01fe('0x13')](_0x01fe('0x15'),_0x6ae75d,_0x1ea49d);_0x2909ea(_0x1ea49d);});});}exports[_0x01fe('0x18')]=function(_0x230846){var _0x3579d8=this;return new Promise(function(_0x43a7bd,_0x5b2d6d){return db[_0x01fe('0x19')][_0x01fe('0x1a')](_0x230846[_0x01fe('0x1b')],{'raw':_0x230846[_0x01fe('0x1c')]?_0x230846[_0x01fe('0x1c')][_0x01fe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x230846[_0x01fe('0x1c')]?_0x230846[_0x01fe('0x1c')][_0x01fe('0x1e')]||null:null,'attributes':_0x230846[_0x01fe('0x1c')]?_0x230846[_0x01fe('0x1c')][_0x01fe('0x1f')]||null:null,'limit':_0x230846['options']?_0x230846[_0x01fe('0x1c')]['limit']||null:null})[_0x01fe('0xe')](function(_0x371ce9){logger[_0x01fe('0x17')](_0x01fe('0x18'),_0x230846);logger[_0x01fe('0x10')](_0x01fe('0x18'),_0x230846,JSON[_0x01fe('0x12')](_0x371ce9));_0x43a7bd(_0x371ce9);})[_0x01fe('0x20')](function(_0x362a60){logger[_0x01fe('0x13')](_0x01fe('0x18'),_0x362a60[_0x01fe('0x16')],_0x230846);_0x5b2d6d(_0x3579d8['error'](0x1f4,_0x362a60[_0x01fe('0x16')]));});});};exports[_0x01fe('0x21')]=function(_0x26911f){return new Promise(function(_0x19459e,_0x401b1e){return db['OpenchannelInteraction'][_0x01fe('0x22')]({'where':_0x26911f[_0x01fe('0x1c')]?_0x26911f[_0x01fe('0x1c')]['where']||null:null})[_0x01fe('0xe')](function(_0x2681c4){if(_0x2681c4){return _0x2681c4[_0x01fe('0x23')](_0x26911f['body'][_0x01fe('0x24')],_[_0x01fe('0x25')](_0x26911f[_0x01fe('0x1b')],['ids','id'])||{});}})[_0x01fe('0x26')](function(_0x481f60){logger[_0x01fe('0x17')](_0x01fe('0x27'),_0x26911f);logger['debug'](_0x01fe('0x27'),_0x26911f,JSON['stringify'](_0x481f60));_0x19459e(_0x481f60);})[_0x01fe('0x20')](function(_0x591a89){logger[_0x01fe('0x13')](_0x01fe('0x27'),_0x591a89[_0x01fe('0x16')],_0x26911f);_0x401b1e(_this[_0x01fe('0x13')](0x1f4,_0x591a89['message']));});});}; \ No newline at end of file +var _0x0b96=['ids','spread','AddTags','debug','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','OpenchannelInteraction','body','options','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find'];(function(_0xd71ff9,_0x36cd21){var _0x2834ef=function(_0x532570){while(--_0x532570){_0xd71ff9['push'](_0xd71ff9['shift']());}};_0x2834ef(++_0x36cd21);}(_0x0b96,0x71));var _0x60b9=function(_0x36a5d0,_0x477b0f){_0x36a5d0=_0x36a5d0-0x0;var _0x2b0076=_0x0b96[_0x36a5d0];return _0x2b0076;};'use strict';var _=require('lodash');var util=require(_0x60b9('0x0'));var moment=require('moment');var BPromise=require(_0x60b9('0x1'));var rs=require(_0x60b9('0x2'));var fs=require('fs');var Redis=require(_0x60b9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x60b9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x60b9('0x5'));var jayson=require(_0x60b9('0x6'));var client=jayson[_0x60b9('0x7')]['http']({'port':0x232a});config[_0x60b9('0x8')]=_[_0x60b9('0x9')](config[_0x60b9('0x8')],{'host':_0x60b9('0xa'),'port':0x18eb});var socket=require(_0x60b9('0xb'))(new Redis(config[_0x60b9('0x8')]));require(_0x60b9('0xc'))[_0x60b9('0xd')](socket);function respondWithRpcPromise(_0x198107,_0x400084,_0x2652e5){return new BPromise(function(_0x29847d,_0x543a2b){return client['request'](_0x198107,_0x2652e5)[_0x60b9('0xe')](function(_0x3199e7){logger[_0x60b9('0xf')](_0x60b9('0x10'),_0x400084,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x400084,_0x60b9('0x11'),JSON['stringify'](_0x3199e7));if(_0x3199e7[_0x60b9('0x12')]){if(_0x3199e7['error']['code']===0x1f4){logger[_0x60b9('0x12')](_0x60b9('0x10'),_0x400084,_0x3199e7['error'][_0x60b9('0x13')]);return _0x543a2b(_0x3199e7[_0x60b9('0x12')]['message']);}logger[_0x60b9('0x12')](_0x60b9('0x10'),_0x400084,_0x3199e7['error'][_0x60b9('0x13')]);return _0x29847d(_0x3199e7[_0x60b9('0x12')][_0x60b9('0x13')]);}else{logger['info'](_0x60b9('0x10'),_0x400084,_0x60b9('0x11'));_0x29847d(_0x3199e7[_0x60b9('0x14')][_0x60b9('0x13')]);}})[_0x60b9('0x15')](function(_0x418a32){logger[_0x60b9('0x12')](_0x60b9('0x10'),_0x400084,_0x418a32);_0x543a2b(_0x418a32);});});}exports['UpdateOpenchannelInteraction']=function(_0x3fe15d){var _0x143307=this;return new Promise(function(_0x3c6a25,_0x3f807e){return db[_0x60b9('0x16')]['update'](_0x3fe15d[_0x60b9('0x17')],{'raw':_0x3fe15d[_0x60b9('0x18')]?_0x3fe15d[_0x60b9('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fe15d['options']?_0x3fe15d[_0x60b9('0x18')][_0x60b9('0x19')]||null:null,'attributes':_0x3fe15d[_0x60b9('0x18')]?_0x3fe15d[_0x60b9('0x18')][_0x60b9('0x1a')]||null:null,'limit':_0x3fe15d[_0x60b9('0x18')]?_0x3fe15d[_0x60b9('0x18')][_0x60b9('0x1b')]||null:null})[_0x60b9('0xe')](function(_0x10848e){logger[_0x60b9('0xf')](_0x60b9('0x1c'),_0x3fe15d);logger['debug']('UpdateOpenchannelInteraction',_0x3fe15d,JSON['stringify'](_0x10848e));_0x3c6a25(_0x10848e);})[_0x60b9('0x15')](function(_0x272a30){logger[_0x60b9('0x12')](_0x60b9('0x1c'),_0x272a30[_0x60b9('0x13')],_0x3fe15d);_0x3f807e(_0x143307[_0x60b9('0x12')](0x1f4,_0x272a30['message']));});});};exports[_0x60b9('0x1d')]=function(_0xa35e95){return new Promise(function(_0xe23cbd,_0x3d104e){return db['OpenchannelInteraction'][_0x60b9('0x1e')]({'where':_0xa35e95['options']?_0xa35e95['options']['where']||null:null})[_0x60b9('0xe')](function(_0x458918){if(_0x458918){return _0x458918['addTags'](_0xa35e95[_0x60b9('0x17')][_0x60b9('0x1f')],_['omit'](_0xa35e95['body'],[_0x60b9('0x1f'),'id'])||{});}})[_0x60b9('0x20')](function(_0x155b24){logger[_0x60b9('0xf')](_0x60b9('0x21'),_0xa35e95);logger[_0x60b9('0x22')](_0x60b9('0x21'),_0xa35e95,JSON[_0x60b9('0x23')](_0x155b24));_0xe23cbd(_0x155b24);})[_0x60b9('0x15')](function(_0x13434f){logger[_0x60b9('0x12')](_0x60b9('0x21'),_0x13434f[_0x60b9('0x13')],_0xa35e95);_0x3d104e(_this[_0x60b9('0x12')](0x1f4,_0x13434f[_0x60b9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 529c82c..5fbcb5c 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 _0x3952=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x2cbc30,_0x225c44){var _0x118268=function(_0x21596f){while(--_0x21596f){_0x2cbc30['push'](_0x2cbc30['shift']());}};_0x118268(++_0x225c44);}(_0x3952,0x14b));var _0x2395=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3952[_0x12f688];return _0x59c3de;};'use strict';var OpenchannelInteractionEvents=require(_0x2395('0x0'));var events=[_0x2395('0x1'),_0x2395('0x2'),_0x2395('0x3')];function createListener(_0x41ee09,_0x49c196){return function(_0x5480e1){_0x49c196[_0x2395('0x4')](_0x41ee09,_0x5480e1);};}function removeListener(_0x32228e,_0x5eca31){return function(){OpenchannelInteractionEvents[_0x2395('0x5')](_0x32228e,_0x5eca31);};}exports[_0x2395('0x6')]=function(_0x59d853){for(var _0x4c9e5a=0x0,_0xd6ad5f=events['length'];_0x4c9e5a<_0xd6ad5f;_0x4c9e5a++){var _0x411307=events[_0x4c9e5a];var _0x2b61df=createListener(_0x2395('0x7')+_0x411307,_0x59d853);OpenchannelInteractionEvents['on'](_0x411307,_0x2b61df);}}; \ No newline at end of file +var _0x41bc=['./openchannelInteraction.events','save','remove','update','emit','register','openchannelInteraction:'];(function(_0x29d9f3,_0x2069c3){var _0x3a6bea=function(_0x3b555f){while(--_0x3b555f){_0x29d9f3['push'](_0x29d9f3['shift']());}};_0x3a6bea(++_0x2069c3);}(_0x41bc,0x15e));var _0xc41b=function(_0x2fb3f4,_0x22f0c3){_0x2fb3f4=_0x2fb3f4-0x0;var _0x19ef6c=_0x41bc[_0x2fb3f4];return _0x19ef6c;};'use strict';var OpenchannelInteractionEvents=require(_0xc41b('0x0'));var events=[_0xc41b('0x1'),_0xc41b('0x2'),_0xc41b('0x3')];function createListener(_0x3bffff,_0x3a640e){return function(_0x45fb20){_0x3a640e[_0xc41b('0x4')](_0x3bffff,_0x45fb20);};}function removeListener(_0x54627f,_0x18a713){return function(){OpenchannelInteractionEvents['removeListener'](_0x54627f,_0x18a713);};}exports[_0xc41b('0x5')]=function(_0x2c7142){for(var _0x1c0aa7=0x0,_0x38cd23=events['length'];_0x1c0aa7<_0x38cd23;_0x1c0aa7++){var _0x40c681=events[_0x1c0aa7];var _0x247c10=createListener(_0xc41b('0x6')+_0x40c681,_0x2c7142);OpenchannelInteractionEvents['on'](_0x40c681,_0x247c10);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index eb32e22..3ac0c4a 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xcb91[_0x10291b];return _0x1d5fbe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x4387a0,_0x1650ac){var _0x1184af=function(_0x4771a7){while(--_0x4771a7){_0x4387a0['push'](_0x4387a0['shift']());}};_0x1184af(++_0x1650ac);}(_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('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 94f0dc0..2a09987 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 _0x065e=['ENUM','DATE','STRING','sequelize','BOOLEAN'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x065e,0x1a7));var _0xe065=function(_0x272be7,_0x3dd027){_0x272be7=_0x272be7-0x0;var _0x1d060c=_0x065e[_0x272be7];return _0x1d060c;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe065('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe065('0x3')]},'providerName':{'type':Sequelize[_0xe065('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa30a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'body':{'type':Sequelize[_0xaa30('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xaa30('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xaa30('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa30('0x4')]('in',_0xaa30('0x5')),'defaultValue':_0xaa30('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xaa30('0x6')]},'providerName':{'type':Sequelize[_0xaa30('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8e63a99..8d93a9b 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 _0x4913=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','end','stack','name','index','map','OpenchannelMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','filter','where','options','include','show','params','includeAll','merge','find','create','update','body','destroy','describe','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','format','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','Sequelize','SIP/%s','rimraf','zip-dir','request-promise','moment','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x271474,_0x248441){var _0x72f117=function(_0x4ad1b9){while(--_0x4ad1b9){_0x271474['push'](_0x271474['shift']());}};_0x72f117(++_0x248441);}(_0x4913,0x170));var _0x3491=function(_0xc17b35,_0x4256c0){_0xc17b35=_0xc17b35-0x0;var _0x2bda79=_0x4913[_0xc17b35];return _0x2bda79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3491('0x0'));var zipdir=require(_0x3491('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3491('0x2'));var moment=require(_0x3491('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3491('0x4'));var path=require(_0x3491('0x5'));var sox=require(_0x3491('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3491('0x7'));var squel=require(_0x3491('0x8'));var crypto=require(_0x3491('0x9'));var jsforce=require(_0x3491('0xa'));var deskjs=require(_0x3491('0xb'));var toCsv=require(_0x3491('0xc'));var querystring=require(_0x3491('0xd'));var Papa=require(_0x3491('0xe'));var Redis=require(_0x3491('0xf'));var authService=require(_0x3491('0x10'));var qs=require(_0x3491('0x11'));var as=require(_0x3491('0x12'));var hardwareService=require(_0x3491('0x13'));var logger=require('../../config/logger')(_0x3491('0x14'));var utils=require(_0x3491('0x15'));var config=require(_0x3491('0x16'));var licenseUtil=require(_0x3491('0x17'));var db=require('../../mysqldb')['db'];config[_0x3491('0x18')]=_[_0x3491('0x19')](config[_0x3491('0x18')],{'host':_0x3491('0x1a'),'port':0x18eb});var socket=require(_0x3491('0x1b'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x3491('0x1c')](socket);var jayson=require(_0x3491('0x1d'));var client=jayson[_0x3491('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x3491('0x1e')][_0x3491('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3a9077,_0x293495,_0x52834e,_0x2e3aea){return new BPromise(function(_0x1505d3,_0x317ff0){var _0x34f573=_0x2e3aea||client;return _0x34f573['request'](_0x3a9077,_0x52834e)[_0x3491('0x20')](function(_0x202054){logger[_0x3491('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x293495,_0x3491('0x22'));logger[_0x3491('0x23')](_0x3491('0x24'),_0x293495,_0x3491('0x22'),JSON['stringify'](_0x202054));if(_0x202054[_0x3491('0x25')]){if(_0x202054['error'][_0x3491('0x26')]===0x1f4){logger['error'](_0x3491('0x27'),_0x293495,_0x202054['error'][_0x3491('0x28')]);return _0x317ff0(_0x202054[_0x3491('0x25')][_0x3491('0x28')]);}logger[_0x3491('0x25')](_0x3491('0x27'),_0x293495,_0x202054['error'][_0x3491('0x28')]);return _0x1505d3(_0x202054['error'][_0x3491('0x28')]);}else{logger[_0x3491('0x21')](_0x3491('0x27'),_0x293495,_0x3491('0x22'));_0x1505d3(_0x202054[_0x3491('0x29')][_0x3491('0x28')]);}})[_0x3491('0x2a')](function(_0x3dc7b7){logger[_0x3491('0x25')](_0x3491('0x27'),_0x293495,_0x3dc7b7);_0x317ff0(_0x3dc7b7);});});}function respondWithStatusCode(_0x352ab5,_0x23372d){_0x23372d=_0x23372d||0xcc;return function(_0x3ebe00){if(_0x3ebe00){return _0x352ab5[_0x3491('0x2b')](_0x23372d);}return _0x352ab5[_0x3491('0x2c')](_0x23372d)['end']();};}function respondWithResult(_0x3e8f91,_0x1935ad){_0x1935ad=_0x1935ad||0xc8;return function(_0x5beee4){if(_0x5beee4){return _0x3e8f91[_0x3491('0x2c')](_0x1935ad)[_0x3491('0x2d')](_0x5beee4);}};}function respondWithFilteredResult(_0x1df2be,_0x1a4d9e){return function(_0x3db057){if(_0x3db057){var _0x28a317=typeof _0x1a4d9e[_0x3491('0x2e')]===_0x3491('0x2f')&&typeof _0x1a4d9e[_0x3491('0x30')]===_0x3491('0x2f');var _0x57b0cc=_0x3db057[_0x3491('0x31')];var _0x394e85=_0x28a317?0x0:_0x1a4d9e[_0x3491('0x2e')];var _0x460015=_0x28a317?_0x3db057['count']:_0x1a4d9e[_0x3491('0x2e')]+_0x1a4d9e[_0x3491('0x30')];var _0x1833cd;if(_0x460015>=_0x57b0cc){_0x460015=_0x57b0cc;_0x1833cd=0xc8;}else{_0x1833cd=0xce;}_0x1df2be[_0x3491('0x2c')](_0x1833cd);return _0x1df2be[_0x3491('0x32')](_0x3491('0x33'),_0x394e85+'-'+_0x460015+'/'+_0x57b0cc)[_0x3491('0x2d')](_0x3db057);}return null;};}function patchUpdates(_0x460da7){return function(_0x289178){try{jsonpatch[_0x3491('0x34')](_0x289178,_0x460da7,!![]);}catch(_0x47fe8d){return BPromise[_0x3491('0x35')](_0x47fe8d);}return _0x289178[_0x3491('0x36')]();};}function saveUpdates(_0x15778f,_0x720d2c){return function(_0x14d64c){if(_0x14d64c){return _0x14d64c['update'](_0x15778f)['then'](function(_0x505323){return _0x505323;});}return null;};}function removeEntity(_0x3238fd,_0x5b6284){return function(_0x4dae7d){if(_0x4dae7d){return _0x4dae7d['destroy']()[_0x3491('0x20')](function(){_0x3238fd['status'](0xcc)[_0x3491('0x37')]();});}};}function handleEntityNotFound(_0x34bce5,_0x3057c3){return function(_0x155fa2){if(!_0x155fa2){_0x34bce5['sendStatus'](0x194);}return _0x155fa2;};}function handleError(_0x37d5f0,_0x1189d9){_0x1189d9=_0x1189d9||0x1f4;return function(_0x1f30e4){logger['error'](_0x1f30e4[_0x3491('0x38')]);if(_0x1f30e4[_0x3491('0x39')]){delete _0x1f30e4[_0x3491('0x39')];}_0x37d5f0[_0x3491('0x2c')](_0x1189d9)['send'](_0x1f30e4);};}exports[_0x3491('0x3a')]=function(_0x5c6c7c,_0x5cbbda){var _0x2433fa={},_0x491a77={},_0xb337f1={'count':0x0,'rows':[]};var _0x3eb62b=_[_0x3491('0x3b')](db[_0x3491('0x3c')]['rawAttributes'],function(_0xe10c11){return{'name':_0xe10c11[_0x3491('0x3d')],'type':_0xe10c11[_0x3491('0x3e')][_0x3491('0x3f')]};});_0x491a77[_0x3491('0x40')]=_[_0x3491('0x3b')](_0x3eb62b,_0x3491('0x39'));_0x491a77[_0x3491('0x41')]=_[_0x3491('0x42')](_0x5c6c7c[_0x3491('0x41')]);_0x491a77['filters']=_[_0x3491('0x43')](_0x491a77[_0x3491('0x40')],_0x491a77[_0x3491('0x41')]);_0x2433fa[_0x3491('0x44')]=_[_0x3491('0x43')](_0x491a77['model'],qs['fields'](_0x5c6c7c[_0x3491('0x41')][_0x3491('0x45')]));_0x2433fa[_0x3491('0x44')]=_0x2433fa[_0x3491('0x44')][_0x3491('0x46')]?_0x2433fa['attributes']:_0x491a77[_0x3491('0x40')];if(!_0x5c6c7c['query']['hasOwnProperty'](_0x3491('0x47'))){_0x2433fa[_0x3491('0x30')]=qs['limit'](_0x5c6c7c['query'][_0x3491('0x30')]);_0x2433fa[_0x3491('0x2e')]=qs[_0x3491('0x2e')](_0x5c6c7c[_0x3491('0x41')][_0x3491('0x2e')]);}_0x2433fa['order']=qs[_0x3491('0x48')](_0x5c6c7c['query'][_0x3491('0x48')]);_0x2433fa['where']=qs[_0x3491('0x49')](_['pick'](_0x5c6c7c['query'],_0x491a77[_0x3491('0x49')]),_0x3eb62b);if(_0x5c6c7c[_0x3491('0x41')][_0x3491('0x4a')]){_0x2433fa[_0x3491('0x4b')]=_['merge'](_0x2433fa[_0x3491('0x4b')],{'$or':_[_0x3491('0x3b')](_0x3eb62b,function(_0x55f1e3){if(_0x55f1e3[_0x3491('0x3e')]!=='VIRTUAL'){var _0x188a3a={};_0x188a3a[_0x55f1e3['name']]={'$like':'%'+_0x5c6c7c['query']['filter']+'%'};return _0x188a3a;}})});}_0x2433fa=_['merge']({},_0x2433fa,_0x5c6c7c[_0x3491('0x4c')]);var _0x3537c7={'where':_0x2433fa[_0x3491('0x4b')]};return db['OpenchannelMessage'][_0x3491('0x31')](_0x3537c7)[_0x3491('0x20')](function(_0x4c1094){_0xb337f1['count']=_0x4c1094;if(_0x5c6c7c[_0x3491('0x41')]['includeAll']){_0x2433fa[_0x3491('0x4d')]=[{'all':!![]}];}return db[_0x3491('0x3c')]['findAll'](_0x2433fa);})['then'](function(_0x3c4533){_0xb337f1['rows']=_0x3c4533;return _0xb337f1;})[_0x3491('0x20')](respondWithFilteredResult(_0x5cbbda,_0x2433fa))[_0x3491('0x2a')](handleError(_0x5cbbda,null));};exports[_0x3491('0x4e')]=function(_0x1ffa32,_0x3745e8){var _0x242d14={'raw':!![],'where':{'id':_0x1ffa32[_0x3491('0x4f')]['id']}},_0x9e623b={};_0x9e623b[_0x3491('0x40')]=_['keys'](db[_0x3491('0x3c')]['rawAttributes']);_0x9e623b[_0x3491('0x41')]=_[_0x3491('0x42')](_0x1ffa32[_0x3491('0x41')]);_0x9e623b['filters']=_[_0x3491('0x43')](_0x9e623b[_0x3491('0x40')],_0x9e623b['query']);_0x242d14[_0x3491('0x44')]=_[_0x3491('0x43')](_0x9e623b[_0x3491('0x40')],qs[_0x3491('0x45')](_0x1ffa32[_0x3491('0x41')]['fields']));_0x242d14['attributes']=_0x242d14['attributes'][_0x3491('0x46')]?_0x242d14[_0x3491('0x44')]:_0x9e623b[_0x3491('0x40')];if(_0x1ffa32['query'][_0x3491('0x50')]){_0x242d14['include']=[{'all':!![]}];}_0x242d14=_[_0x3491('0x51')]({},_0x242d14,_0x1ffa32[_0x3491('0x4c')]);return db[_0x3491('0x3c')][_0x3491('0x52')](_0x242d14)[_0x3491('0x20')](handleEntityNotFound(_0x3745e8,null))[_0x3491('0x20')](respondWithResult(_0x3745e8,null))[_0x3491('0x2a')](handleError(_0x3745e8,null));};exports[_0x3491('0x53')]=function(_0x3942d7,_0x537df4){return db['OpenchannelMessage'][_0x3491('0x53')](_0x3942d7['body'],{})[_0x3491('0x20')](respondWithResult(_0x537df4,0xc9))['catch'](handleError(_0x537df4,null));};exports[_0x3491('0x54')]=function(_0x454727,_0x28046c){if(_0x454727[_0x3491('0x55')]['id']){delete _0x454727[_0x3491('0x55')]['id'];}return db['OpenchannelMessage'][_0x3491('0x52')]({'where':{'id':_0x454727[_0x3491('0x4f')]['id']}})[_0x3491('0x20')](handleEntityNotFound(_0x28046c,null))[_0x3491('0x20')](saveUpdates(_0x454727['body'],null))['then'](respondWithResult(_0x28046c,null))[_0x3491('0x2a')](handleError(_0x28046c,null));};exports[_0x3491('0x56')]=function(_0x168bba,_0x2cdb65){return db[_0x3491('0x3c')]['find']({'where':{'id':_0x168bba[_0x3491('0x4f')]['id']}})[_0x3491('0x20')](handleEntityNotFound(_0x2cdb65,null))[_0x3491('0x20')](removeEntity(_0x2cdb65,null))['catch'](handleError(_0x2cdb65,null));};exports['describe']=function(_0x54fdfd,_0x56804c){return db[_0x3491('0x3c')][_0x3491('0x57')]()[_0x3491('0x20')](respondWithResult(_0x56804c,null))['catch'](handleError(_0x56804c,null));};var interaction_log=require('../../config/logger')(_0x3491('0x58'));exports['accept']=function(_0x499c37,_0x16e5bc,_0x1301bc){var _0x5f4d72={'agent':{},'channel':_0x3491('0x59')};if(_0x499c37['body']['id']){delete _0x499c37['body']['id'];}_0x499c37[_0x3491('0x55')][_0x3491('0x5a')]=!![];_0x499c37['body'][_0x3491('0x5b')]=moment()['format'](_0x3491('0x5c'));_0x499c37[_0x3491('0x55')]['UserId']=_0x499c37[_0x3491('0x55')][_0x3491('0x5d')]||_0x499c37['user']['id'];_0x5f4d72[_0x3491('0x5e')]['id']=_0x499c37['body'][_0x3491('0x5d')];return db[_0x3491('0x3c')][_0x3491('0x52')]({'where':{'id':_0x499c37['params']['id'],'UserId':null}})[_0x3491('0x20')](handleEntityNotFound(_0x16e5bc,null))[_0x3491('0x20')](saveUpdates(_0x499c37['body'],null))[_0x3491('0x20')](function(_0x38ed8d){if(_0x38ed8d){_0x5f4d72[_0x3491('0x28')]=_0x38ed8d['get']({'plain':!![]});return db[_0x3491('0x5f')]['find']({'where':{'id':_0x38ed8d['OpenchannelInteractionId']}});}return null;})[_0x3491('0x20')](handleEntityNotFound(_0x16e5bc,null))['then'](function(_0x572aa0){if(_0x572aa0){return _0x572aa0[_0x3491('0x54')]({'UserId':_0x499c37['body']['UserId'],'read1stAt':_[_0x3491('0x60')](_0x572aa0[_0x3491('0x61')])?moment()[_0x3491('0x62')](_0x3491('0x5c')):undefined});}return null;})[_0x3491('0x20')](function(_0x2db82c){if(_0x2db82c){_0x5f4d72[_0x3491('0x63')]=_0x2db82c[_0x3491('0x64')]({'plain':!![]});interaction_log[_0x3491('0x21')](_0x3491('0x65'),_0x499c37['user']['id'],_0x499c37[_0x3491('0x66')][_0x3491('0x39')],_0x499c37[_0x3491('0x66')][_0x3491('0x67')],_0x5f4d72[_0x3491('0x63')]['id'],_0x499c37['body']?JSON['stringify'](_0x499c37[_0x3491('0x55')]):'null');return respondWithRpcPromise(_0x3491('0x68'),'acceptMessage',_0x5f4d72);}return null;})[_0x3491('0x20')](function(_0x2114ca){var _0x405e47=_0x3491('0x69')+_0x2114ca[_0x3491('0x28')][_0x3491('0x6a')];return db[_0x3491('0x6b')]['query'](_0x405e47,{'type':db['Sequelize'][_0x3491('0x6c')][_0x3491('0x6d')],'raw':!![]})[_0x3491('0x20')](function(_0x15503c){return _0x15503c;});})[_0x3491('0x20')](function(_0x15bc61){if(_0x15bc61){_0x5f4d72[_0x3491('0x28')][_0x3491('0x6e')]=_0x15bc61[0x0];if(!_0x499c37['body'][_0x3491('0x5d')])return;return db[_0x3491('0x6f')][_0x3491('0x52')]({'where':{'id':_0x499c37[_0x3491('0x55')][_0x3491('0x5d')],'role':_0x3491('0x5e')},'attributes':['id',_0x3491('0x39'),_0x3491('0x70'),_0x3491('0x71'),_0x3491('0x72')],'raw':!![]});}return null;})[_0x3491('0x20')](function(_0x17fc9f){if(!_0x17fc9f)return null;_0x5f4d72['message']['agent']=_0x17fc9f;return _0x5f4d72;})['then'](function(_0x3f4845){if(_0x3f4845){if(_0x499c37[_0x3491('0x55')][_0x3491('0x73')]){_0x5f4d72['message'][_0x3491('0x74')]=util['format']('SIP/%s',_0x499c37[_0x3491('0x66')][_0x3491('0x39')]);_0x5f4d72[_0x3491('0x28')][_0x3491('0x75')]=_0x5f4d72[_0x3491('0x75')];_0x5f4d72[_0x3491('0x28')][_0x3491('0x76')]=_0x5f4d72['channel'];_0x5f4d72[_0x3491('0x28')][_0x3491('0x77')]=_0x3491('0x78');return respondWithRpcPromise(_0x3491('0x79'),'EventManager',{'event':_0x3491('0x7a'),'message':_0x5f4d72[_0x3491('0x28')]},client9002)[_0x3491('0x20')](function(){return _0x5f4d72;});}return _0x5f4d72;}return null;})[_0x3491('0x20')](respondWithResult(_0x16e5bc,null))[_0x3491('0x2a')](handleError(_0x16e5bc,null));};var interaction_log=require('../../config/logger')(_0x3491('0x58'));exports[_0x3491('0x35')]=function(_0x3720c4,_0x2befe5,_0x2e3127){var _0x3c2414={'agent':{},'channel':_0x3491('0x59')};if(_0x3720c4[_0x3491('0x55')]['id']){delete _0x3720c4[_0x3491('0x55')]['id'];}_0x3720c4[_0x3491('0x55')][_0x3491('0x5d')]=_0x3720c4[_0x3491('0x55')][_0x3491('0x5d')]||_0x3720c4[_0x3491('0x66')]['id'];_0x3c2414['agent']['id']=_0x3720c4[_0x3491('0x55')]['UserId'];return db[_0x3491('0x3c')][_0x3491('0x52')]({'where':{'id':_0x3720c4[_0x3491('0x4f')]['id'],'UserId':null}})[_0x3491('0x20')](handleEntityNotFound(_0x2befe5,null))[_0x3491('0x20')](function(_0x12040e){if(_0x12040e){_0x3c2414[_0x3491('0x28')]=_0x12040e[_0x3491('0x64')]({'plain':!![]});return db[_0x3491('0x5f')][_0x3491('0x52')]({'where':{'id':_0x12040e['OpenchannelInteractionId']}});}return null;})[_0x3491('0x20')](handleEntityNotFound(_0x2befe5,null))[_0x3491('0x20')](function(_0x239872){if(_0x239872){_0x3c2414[_0x3491('0x63')]=_0x239872[_0x3491('0x64')]({'plain':!![]});interaction_log[_0x3491('0x21')](_0x3491('0x7b'),_0x3720c4[_0x3491('0x66')]['id'],_0x3720c4[_0x3491('0x66')][_0x3491('0x39')],_0x3720c4[_0x3491('0x66')]['role'],_0x3c2414['interaction']['id'],_0x3720c4['body']?JSON[_0x3491('0x7c')](_0x3720c4[_0x3491('0x55')]):_0x3491('0x7d'));return respondWithRpcPromise(_0x3491('0x7e'),_0x3491('0x7f'),_0x3c2414);}return null;})[_0x3491('0x20')](function(_0x52b984){var _0x325005=_0x3491('0x69')+_0x52b984[_0x3491('0x28')][_0x3491('0x6a')];return db[_0x3491('0x6b')]['query'](_0x325005,{'type':db[_0x3491('0x80')][_0x3491('0x6c')][_0x3491('0x6d')],'raw':!![]})[_0x3491('0x20')](function(_0x2ab80c){return _0x2ab80c;});})[_0x3491('0x20')](function(_0x2e290d){if(_0x2e290d){_0x3c2414['message'][_0x3491('0x6e')]=_0x2e290d[0x0];if(!_0x3720c4[_0x3491('0x55')][_0x3491('0x5d')])return;return db[_0x3491('0x6f')]['find']({'where':{'id':_0x3720c4['body']['UserId'],'role':_0x3491('0x5e')},'attributes':['id',_0x3491('0x39'),_0x3491('0x70'),'email',_0x3491('0x72')],'raw':!![]});}return null;})[_0x3491('0x20')](function(_0x3a4df2){if(!_0x3a4df2)return null;_0x3c2414[_0x3491('0x28')]['agent']=_0x3a4df2;return _0x3c2414;})[_0x3491('0x20')](function(_0x3ee8d9){if(_0x3ee8d9){_0x3ee8d9[_0x3491('0x28')][_0x3491('0x74')]=util[_0x3491('0x62')](_0x3491('0x81'),_0x3720c4['user'][_0x3491('0x39')]);_0x3ee8d9[_0x3491('0x28')][_0x3491('0x75')]=_0x3c2414[_0x3491('0x75')];_0x3ee8d9[_0x3491('0x28')][_0x3491('0x76')]=_0x3c2414[_0x3491('0x75')];_0x3ee8d9[_0x3491('0x28')][_0x3491('0x77')]=_0x3491('0x35');respondWithRpcPromise('EventManager',_0x3491('0x79'),{'event':'rejectmessage','message':_0x3ee8d9[_0x3491('0x28')]},client9002);return _0x3c2414;}return null;})[_0x3491('0x20')](respondWithResult(_0x2befe5,null))[_0x3491('0x2a')](handleError(_0x2befe5,null));}; \ No newline at end of file +var _0xf6ea=['key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','keys','includeAll','find','create','body','update','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','channel','motionChannel','event','EventManager','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','contact','email','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type'];(function(_0x5b5d7d,_0x481759){var _0x460c85=function(_0x4d55d2){while(--_0x4d55d2){_0x5b5d7d['push'](_0x5b5d7d['shift']());}};_0x460c85(++_0x481759);}(_0xf6ea,0x1c1));var _0xaf6e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xf6ea[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0xaf6e('0x0'));var rimraf=require(_0xaf6e('0x1'));var zipdir=require(_0xaf6e('0x2'));var jsonpatch=require(_0xaf6e('0x3'));var rp=require(_0xaf6e('0x4'));var moment=require(_0xaf6e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaf6e('0x6'));var path=require('path');var sox=require(_0xaf6e('0x7'));var csv=require(_0xaf6e('0x8'));var ejs=require(_0xaf6e('0x9'));var fs=require('fs');var fs_extra=require(_0xaf6e('0xa'));var _=require('lodash');var squel=require(_0xaf6e('0xb'));var crypto=require('crypto');var jsforce=require(_0xaf6e('0xc'));var deskjs=require(_0xaf6e('0xd'));var toCsv=require(_0xaf6e('0x8'));var querystring=require('querystring');var Papa=require(_0xaf6e('0xe'));var Redis=require(_0xaf6e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaf6e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf6e('0x11'))(_0xaf6e('0x12'));var utils=require('../../config/utils');var config=require(_0xaf6e('0x13'));var licenseUtil=require(_0xaf6e('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xaf6e('0x15')](config[_0xaf6e('0x16')],{'host':_0xaf6e('0x17'),'port':0x18eb});var socket=require(_0xaf6e('0x18'))(new Redis(config[_0xaf6e('0x16')]));require(_0xaf6e('0x19'))[_0xaf6e('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xaf6e('0x1b')][_0xaf6e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3aca10,_0x585da3,_0x1caaf3,_0x3786f9){return new BPromise(function(_0x5a9d4c,_0x54d440){var _0x5c4729=_0x3786f9||client;return _0x5c4729[_0xaf6e('0x1d')](_0x3aca10,_0x1caaf3)[_0xaf6e('0x1e')](function(_0x3fe016){logger[_0xaf6e('0x1f')](_0xaf6e('0x20'),_0x585da3,'request\x20sent');logger[_0xaf6e('0x21')](_0xaf6e('0x22'),_0x585da3,_0xaf6e('0x23'),JSON[_0xaf6e('0x24')](_0x3fe016));if(_0x3fe016[_0xaf6e('0x25')]){if(_0x3fe016['error'][_0xaf6e('0x26')]===0x1f4){logger[_0xaf6e('0x25')](_0xaf6e('0x20'),_0x585da3,_0x3fe016[_0xaf6e('0x25')][_0xaf6e('0x27')]);return _0x54d440(_0x3fe016[_0xaf6e('0x25')][_0xaf6e('0x27')]);}logger['error'](_0xaf6e('0x20'),_0x585da3,_0x3fe016[_0xaf6e('0x25')][_0xaf6e('0x27')]);return _0x5a9d4c(_0x3fe016[_0xaf6e('0x25')][_0xaf6e('0x27')]);}else{logger[_0xaf6e('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x585da3,_0xaf6e('0x23'));_0x5a9d4c(_0x3fe016[_0xaf6e('0x28')][_0xaf6e('0x27')]);}})[_0xaf6e('0x29')](function(_0x5b68e1){logger[_0xaf6e('0x25')](_0xaf6e('0x20'),_0x585da3,_0x5b68e1);_0x54d440(_0x5b68e1);});});}function respondWithStatusCode(_0x4c2a1f,_0x1c80b7){_0x1c80b7=_0x1c80b7||0xcc;return function(_0x4b7ed0){if(_0x4b7ed0){return _0x4c2a1f[_0xaf6e('0x2a')](_0x1c80b7);}return _0x4c2a1f[_0xaf6e('0x2b')](_0x1c80b7)[_0xaf6e('0x2c')]();};}function respondWithResult(_0x4f4c93,_0x2c781c){_0x2c781c=_0x2c781c||0xc8;return function(_0x4ccdde){if(_0x4ccdde){return _0x4f4c93[_0xaf6e('0x2b')](_0x2c781c)[_0xaf6e('0x2d')](_0x4ccdde);}};}function respondWithFilteredResult(_0x255eb9,_0x93db92){return function(_0x38c667){if(_0x38c667){var _0x13f2e4=typeof _0x93db92['offset']===_0xaf6e('0x2e')&&typeof _0x93db92[_0xaf6e('0x2f')]===_0xaf6e('0x2e');var _0x437419=_0x38c667[_0xaf6e('0x30')];var _0x44563a=_0x13f2e4?0x0:_0x93db92[_0xaf6e('0x31')];var _0x1e8339=_0x13f2e4?_0x38c667[_0xaf6e('0x30')]:_0x93db92['offset']+_0x93db92[_0xaf6e('0x2f')];var _0x456cfa;if(_0x1e8339>=_0x437419){_0x1e8339=_0x437419;_0x456cfa=0xc8;}else{_0x456cfa=0xce;}_0x255eb9[_0xaf6e('0x2b')](_0x456cfa);return _0x255eb9[_0xaf6e('0x32')]('Content-Range',_0x44563a+'-'+_0x1e8339+'/'+_0x437419)[_0xaf6e('0x2d')](_0x38c667);}return null;};}function patchUpdates(_0x1aebc2){return function(_0x197e76){try{jsonpatch['apply'](_0x197e76,_0x1aebc2,!![]);}catch(_0x48d374){return BPromise[_0xaf6e('0x33')](_0x48d374);}return _0x197e76[_0xaf6e('0x34')]();};}function saveUpdates(_0x59f812,_0x4032bb){return function(_0x3d7105){if(_0x3d7105){return _0x3d7105['update'](_0x59f812)[_0xaf6e('0x1e')](function(_0x2296b9){return _0x2296b9;});}return null;};}function removeEntity(_0x314813,_0x5d5a30){return function(_0x255fe6){if(_0x255fe6){return _0x255fe6[_0xaf6e('0x35')]()[_0xaf6e('0x1e')](function(){_0x314813[_0xaf6e('0x2b')](0xcc)[_0xaf6e('0x2c')]();});}};}function handleEntityNotFound(_0xdfec4c,_0xb9e97c){return function(_0x1041ec){if(!_0x1041ec){_0xdfec4c[_0xaf6e('0x2a')](0x194);}return _0x1041ec;};}function handleError(_0x436645,_0x2d29dc){_0x2d29dc=_0x2d29dc||0x1f4;return function(_0x291196){logger['error'](_0x291196[_0xaf6e('0x36')]);if(_0x291196[_0xaf6e('0x37')]){delete _0x291196[_0xaf6e('0x37')];}_0x436645[_0xaf6e('0x2b')](_0x2d29dc)[_0xaf6e('0x38')](_0x291196);};}exports[_0xaf6e('0x39')]=function(_0x2ff7ad,_0xf5658a){var _0x2d92a4={},_0x587bfb={},_0x1e8c8d={'count':0x0,'rows':[]};var _0xb639ad=_[_0xaf6e('0x3a')](db[_0xaf6e('0x3b')][_0xaf6e('0x3c')],function(_0x516e2a){return{'name':_0x516e2a[_0xaf6e('0x3d')],'type':_0x516e2a[_0xaf6e('0x3e')][_0xaf6e('0x3f')]};});_0x587bfb[_0xaf6e('0x40')]=_[_0xaf6e('0x3a')](_0xb639ad,_0xaf6e('0x37'));_0x587bfb[_0xaf6e('0x41')]=_['keys'](_0x2ff7ad['query']);_0x587bfb[_0xaf6e('0x42')]=_[_0xaf6e('0x43')](_0x587bfb['model'],_0x587bfb['query']);_0x2d92a4[_0xaf6e('0x44')]=_[_0xaf6e('0x43')](_0x587bfb[_0xaf6e('0x40')],qs['fields'](_0x2ff7ad[_0xaf6e('0x41')][_0xaf6e('0x45')]));_0x2d92a4['attributes']=_0x2d92a4['attributes'][_0xaf6e('0x46')]?_0x2d92a4[_0xaf6e('0x44')]:_0x587bfb['model'];if(!_0x2ff7ad[_0xaf6e('0x41')]['hasOwnProperty'](_0xaf6e('0x47'))){_0x2d92a4[_0xaf6e('0x2f')]=qs[_0xaf6e('0x2f')](_0x2ff7ad[_0xaf6e('0x41')]['limit']);_0x2d92a4[_0xaf6e('0x31')]=qs[_0xaf6e('0x31')](_0x2ff7ad['query']['offset']);}_0x2d92a4[_0xaf6e('0x48')]=qs[_0xaf6e('0x49')](_0x2ff7ad[_0xaf6e('0x41')]['sort']);_0x2d92a4[_0xaf6e('0x4a')]=qs['filters'](_['pick'](_0x2ff7ad[_0xaf6e('0x41')],_0x587bfb[_0xaf6e('0x42')]),_0xb639ad);if(_0x2ff7ad['query']['filter']){_0x2d92a4[_0xaf6e('0x4a')]=_[_0xaf6e('0x4b')](_0x2d92a4[_0xaf6e('0x4a')],{'$or':_['map'](_0xb639ad,function(_0x333349){if(_0x333349[_0xaf6e('0x3e')]!==_0xaf6e('0x4c')){var _0x4ec02b={};_0x4ec02b[_0x333349['name']]={'$like':'%'+_0x2ff7ad[_0xaf6e('0x41')][_0xaf6e('0x4d')]+'%'};return _0x4ec02b;}})});}_0x2d92a4=_[_0xaf6e('0x4b')]({},_0x2d92a4,_0x2ff7ad[_0xaf6e('0x4e')]);var _0x3efa74={'where':_0x2d92a4[_0xaf6e('0x4a')]};return db[_0xaf6e('0x3b')][_0xaf6e('0x30')](_0x3efa74)['then'](function(_0x61c892){_0x1e8c8d[_0xaf6e('0x30')]=_0x61c892;if(_0x2ff7ad[_0xaf6e('0x41')]['includeAll']){_0x2d92a4[_0xaf6e('0x4f')]=[{'all':!![]}];}return db[_0xaf6e('0x3b')][_0xaf6e('0x50')](_0x2d92a4);})[_0xaf6e('0x1e')](function(_0x371926){_0x1e8c8d[_0xaf6e('0x51')]=_0x371926;return _0x1e8c8d;})['then'](respondWithFilteredResult(_0xf5658a,_0x2d92a4))[_0xaf6e('0x29')](handleError(_0xf5658a,null));};exports['show']=function(_0x2fdeb1,_0x42e03d){var _0x3597e0={'raw':!![],'where':{'id':_0x2fdeb1[_0xaf6e('0x52')]['id']}},_0x1e7ddd={};_0x1e7ddd['model']=_[_0xaf6e('0x53')](db[_0xaf6e('0x3b')][_0xaf6e('0x3c')]);_0x1e7ddd[_0xaf6e('0x41')]=_[_0xaf6e('0x53')](_0x2fdeb1[_0xaf6e('0x41')]);_0x1e7ddd[_0xaf6e('0x42')]=_[_0xaf6e('0x43')](_0x1e7ddd[_0xaf6e('0x40')],_0x1e7ddd[_0xaf6e('0x41')]);_0x3597e0['attributes']=_[_0xaf6e('0x43')](_0x1e7ddd[_0xaf6e('0x40')],qs[_0xaf6e('0x45')](_0x2fdeb1[_0xaf6e('0x41')][_0xaf6e('0x45')]));_0x3597e0['attributes']=_0x3597e0[_0xaf6e('0x44')][_0xaf6e('0x46')]?_0x3597e0[_0xaf6e('0x44')]:_0x1e7ddd['model'];if(_0x2fdeb1[_0xaf6e('0x41')][_0xaf6e('0x54')]){_0x3597e0[_0xaf6e('0x4f')]=[{'all':!![]}];}_0x3597e0=_[_0xaf6e('0x4b')]({},_0x3597e0,_0x2fdeb1['options']);return db['OpenchannelMessage'][_0xaf6e('0x55')](_0x3597e0)[_0xaf6e('0x1e')](handleEntityNotFound(_0x42e03d,null))[_0xaf6e('0x1e')](respondWithResult(_0x42e03d,null))[_0xaf6e('0x29')](handleError(_0x42e03d,null));};exports[_0xaf6e('0x56')]=function(_0x28434f,_0x4bc18c){return db[_0xaf6e('0x3b')][_0xaf6e('0x56')](_0x28434f[_0xaf6e('0x57')],{})[_0xaf6e('0x1e')](respondWithResult(_0x4bc18c,0xc9))[_0xaf6e('0x29')](handleError(_0x4bc18c,null));};exports[_0xaf6e('0x58')]=function(_0xb15216,_0x4ace69){if(_0xb15216[_0xaf6e('0x57')]['id']){delete _0xb15216[_0xaf6e('0x57')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0xb15216[_0xaf6e('0x52')]['id']}})['then'](handleEntityNotFound(_0x4ace69,null))[_0xaf6e('0x1e')](saveUpdates(_0xb15216[_0xaf6e('0x57')],null))[_0xaf6e('0x1e')](respondWithResult(_0x4ace69,null))[_0xaf6e('0x29')](handleError(_0x4ace69,null));};exports[_0xaf6e('0x35')]=function(_0x955f20,_0x537666){return db['OpenchannelMessage'][_0xaf6e('0x55')]({'where':{'id':_0x955f20['params']['id']}})['then'](handleEntityNotFound(_0x537666,null))[_0xaf6e('0x1e')](removeEntity(_0x537666,null))[_0xaf6e('0x29')](handleError(_0x537666,null));};exports[_0xaf6e('0x59')]=function(_0x5be343,_0x5cefb8){return db[_0xaf6e('0x3b')][_0xaf6e('0x59')]()[_0xaf6e('0x1e')](respondWithResult(_0x5cefb8,null))['catch'](handleError(_0x5cefb8,null));};var interaction_log=require('../../config/logger')(_0xaf6e('0x5a'));exports[_0xaf6e('0x5b')]=function(_0x12880e,_0x89254e,_0x225f80){var _0x4ea1ff={'agent':{},'channel':'openchannel'};if(_0x12880e[_0xaf6e('0x57')]['id']){delete _0x12880e[_0xaf6e('0x57')]['id'];}_0x12880e[_0xaf6e('0x57')][_0xaf6e('0x5c')]=!![];_0x12880e[_0xaf6e('0x57')]['readAt']=moment()[_0xaf6e('0x5d')](_0xaf6e('0x5e'));_0x12880e['body']['UserId']=_0x12880e['body']['UserId']||_0x12880e[_0xaf6e('0x5f')]['id'];_0x4ea1ff[_0xaf6e('0x60')]['id']=_0x12880e['body'][_0xaf6e('0x61')];return db['OpenchannelMessage'][_0xaf6e('0x55')]({'where':{'id':_0x12880e[_0xaf6e('0x52')]['id'],'UserId':null}})[_0xaf6e('0x1e')](handleEntityNotFound(_0x89254e,null))['then'](saveUpdates(_0x12880e[_0xaf6e('0x57')],null))[_0xaf6e('0x1e')](function(_0x1dbeb9){if(_0x1dbeb9){_0x4ea1ff[_0xaf6e('0x27')]=_0x1dbeb9[_0xaf6e('0x62')]({'plain':!![]});return db[_0xaf6e('0x63')]['find']({'where':{'id':_0x1dbeb9[_0xaf6e('0x64')]}});}return null;})[_0xaf6e('0x1e')](handleEntityNotFound(_0x89254e,null))['then'](function(_0xa8f66d){if(_0xa8f66d){return _0xa8f66d[_0xaf6e('0x58')]({'UserId':_0x12880e[_0xaf6e('0x57')]['UserId'],'read1stAt':_[_0xaf6e('0x65')](_0xa8f66d[_0xaf6e('0x66')])?moment()[_0xaf6e('0x5d')](_0xaf6e('0x5e')):undefined});}return null;})[_0xaf6e('0x1e')](function(_0x5837e7){if(_0x5837e7){_0x4ea1ff[_0xaf6e('0x67')]=_0x5837e7[_0xaf6e('0x62')]({'plain':!![]});interaction_log[_0xaf6e('0x1f')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12880e[_0xaf6e('0x5f')]['id'],_0x12880e[_0xaf6e('0x5f')][_0xaf6e('0x37')],_0x12880e['user']['role'],_0x4ea1ff[_0xaf6e('0x67')]['id'],_0x12880e[_0xaf6e('0x57')]?JSON['stringify'](_0x12880e[_0xaf6e('0x57')]):_0xaf6e('0x68'));return respondWithRpcPromise('AcceptMessage',_0xaf6e('0x69'),_0x4ea1ff);}return null;})[_0xaf6e('0x1e')](function(_0x2f24f0){var _0x2a8213=_0xaf6e('0x6a')+_0x2f24f0[_0xaf6e('0x27')][_0xaf6e('0x6b')];return db[_0xaf6e('0x6c')][_0xaf6e('0x41')](_0x2a8213,{'type':db['Sequelize'][_0xaf6e('0x6d')][_0xaf6e('0x6e')],'raw':!![]})[_0xaf6e('0x1e')](function(_0x321e2b){return _0x321e2b;});})[_0xaf6e('0x1e')](function(_0x5b3b35){if(_0x5b3b35){_0x4ea1ff[_0xaf6e('0x27')]['contact']=_0x5b3b35[0x0];if(!_0x12880e[_0xaf6e('0x57')]['UserId'])return;return db[_0xaf6e('0x6f')]['find']({'where':{'id':_0x12880e[_0xaf6e('0x57')][_0xaf6e('0x61')],'role':_0xaf6e('0x60')},'attributes':['id','name',_0xaf6e('0x70'),'email',_0xaf6e('0x71')],'raw':!![]});}return null;})[_0xaf6e('0x1e')](function(_0x40673a){if(!_0x40673a)return null;_0x4ea1ff[_0xaf6e('0x27')][_0xaf6e('0x60')]=_0x40673a;return _0x4ea1ff;})[_0xaf6e('0x1e')](function(_0x423bcc){if(_0x423bcc){if(_0x12880e[_0xaf6e('0x57')][_0xaf6e('0x72')]){_0x4ea1ff[_0xaf6e('0x27')][_0xaf6e('0x73')]=util['format']('SIP/%s',_0x12880e['user'][_0xaf6e('0x37')]);_0x4ea1ff[_0xaf6e('0x27')][_0xaf6e('0x74')]=_0x4ea1ff['channel'];_0x4ea1ff[_0xaf6e('0x27')][_0xaf6e('0x75')]=_0x4ea1ff[_0xaf6e('0x74')];_0x4ea1ff[_0xaf6e('0x27')][_0xaf6e('0x76')]=_0xaf6e('0x5b');return respondWithRpcPromise(_0xaf6e('0x77'),_0xaf6e('0x77'),{'event':'acceptmessage','message':_0x4ea1ff['message']},client9002)[_0xaf6e('0x1e')](function(){return _0x4ea1ff;});}return _0x4ea1ff;}return null;})[_0xaf6e('0x1e')](respondWithResult(_0x89254e,null))[_0xaf6e('0x29')](handleError(_0x89254e,null));};var interaction_log=require(_0xaf6e('0x11'))(_0xaf6e('0x5a'));exports[_0xaf6e('0x33')]=function(_0x39a7d3,_0x1cf1f8,_0x1867ca){var _0x441b11={'agent':{},'channel':_0xaf6e('0x78')};if(_0x39a7d3[_0xaf6e('0x57')]['id']){delete _0x39a7d3[_0xaf6e('0x57')]['id'];}_0x39a7d3[_0xaf6e('0x57')][_0xaf6e('0x61')]=_0x39a7d3['body'][_0xaf6e('0x61')]||_0x39a7d3[_0xaf6e('0x5f')]['id'];_0x441b11['agent']['id']=_0x39a7d3['body'][_0xaf6e('0x61')];return db[_0xaf6e('0x3b')][_0xaf6e('0x55')]({'where':{'id':_0x39a7d3[_0xaf6e('0x52')]['id'],'UserId':null}})[_0xaf6e('0x1e')](handleEntityNotFound(_0x1cf1f8,null))[_0xaf6e('0x1e')](function(_0x3198bb){if(_0x3198bb){_0x441b11[_0xaf6e('0x27')]=_0x3198bb[_0xaf6e('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xaf6e('0x55')]({'where':{'id':_0x3198bb[_0xaf6e('0x64')]}});}return null;})[_0xaf6e('0x1e')](handleEntityNotFound(_0x1cf1f8,null))['then'](function(_0xc79e33){if(_0xc79e33){_0x441b11[_0xaf6e('0x67')]=_0xc79e33[_0xaf6e('0x62')]({'plain':!![]});interaction_log['info'](_0xaf6e('0x79'),_0x39a7d3[_0xaf6e('0x5f')]['id'],_0x39a7d3['user'][_0xaf6e('0x37')],_0x39a7d3['user'][_0xaf6e('0x7a')],_0x441b11[_0xaf6e('0x67')]['id'],_0x39a7d3[_0xaf6e('0x57')]?JSON[_0xaf6e('0x24')](_0x39a7d3[_0xaf6e('0x57')]):'null');return respondWithRpcPromise(_0xaf6e('0x7b'),_0xaf6e('0x7c'),_0x441b11);}return null;})[_0xaf6e('0x1e')](function(_0x57b58d){var _0x5d9dfe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x57b58d['message'][_0xaf6e('0x6b')];return db['sequelize'][_0xaf6e('0x41')](_0x5d9dfe,{'type':db[_0xaf6e('0x7d')][_0xaf6e('0x6d')][_0xaf6e('0x6e')],'raw':!![]})[_0xaf6e('0x1e')](function(_0x140d46){return _0x140d46;});})['then'](function(_0x1a6b9b){if(_0x1a6b9b){_0x441b11['message'][_0xaf6e('0x7e')]=_0x1a6b9b[0x0];if(!_0x39a7d3[_0xaf6e('0x57')][_0xaf6e('0x61')])return;return db['User']['find']({'where':{'id':_0x39a7d3[_0xaf6e('0x57')][_0xaf6e('0x61')],'role':'agent'},'attributes':['id',_0xaf6e('0x37'),_0xaf6e('0x70'),_0xaf6e('0x7f'),_0xaf6e('0x71')],'raw':!![]});}return null;})['then'](function(_0x216e1f){if(!_0x216e1f)return null;_0x441b11[_0xaf6e('0x27')][_0xaf6e('0x60')]=_0x216e1f;return _0x441b11;})[_0xaf6e('0x1e')](function(_0x2e6a36){if(_0x2e6a36){_0x2e6a36[_0xaf6e('0x27')][_0xaf6e('0x73')]=util[_0xaf6e('0x5d')]('SIP/%s',_0x39a7d3[_0xaf6e('0x5f')][_0xaf6e('0x37')]);_0x2e6a36['message'][_0xaf6e('0x74')]=_0x441b11[_0xaf6e('0x74')];_0x2e6a36[_0xaf6e('0x27')][_0xaf6e('0x75')]=_0x441b11[_0xaf6e('0x74')];_0x2e6a36[_0xaf6e('0x27')][_0xaf6e('0x76')]=_0xaf6e('0x33');respondWithRpcPromise('EventManager',_0xaf6e('0x77'),{'event':'rejectmessage','message':_0x2e6a36[_0xaf6e('0x27')]},client9002);return _0x441b11;}return null;})[_0xaf6e('0x1e')](respondWithResult(_0x1cf1f8,null))[_0xaf6e('0x29')](handleError(_0x1cf1f8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 0035a2b..9846990 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 _0x926c=['remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x2ef013,_0x557ee7){var _0xa2c07f=function(_0x1dfedb){while(--_0x1dfedb){_0x2ef013['push'](_0x2ef013['shift']());}};_0xa2c07f(++_0x557ee7);}(_0x926c,0x13a));var _0xc926=function(_0x58f4c5,_0x3dadac){_0x58f4c5=_0x58f4c5-0x0;var _0x421d6a=_0x926c[_0x58f4c5];return _0x421d6a;};'use strict';var EventEmitter=require(_0xc926('0x0'));var OpenchannelMessage=require(_0xc926('0x1'))['db'][_0xc926('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc926('0x3')](0x0);var events={'afterCreate':_0xc926('0x4'),'afterUpdate':_0xc926('0x5'),'afterDestroy':_0xc926('0x6')};function emitEvent(_0x1fcf5f){return function(_0x206f7c,_0x9a4ea8,_0x11a4ed){OpenchannelMessageEvents[_0xc926('0x7')](_0x1fcf5f+':'+_0x206f7c['id'],_0x206f7c);OpenchannelMessageEvents['emit'](_0x1fcf5f,_0x206f7c);_0x11a4ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xc926('0x8')](e,emitEvent(event));}}module[_0xc926('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x36d0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x5e9bfd,_0x235485){var _0x3b34d2=function(_0xd5133b){while(--_0xd5133b){_0x5e9bfd['push'](_0x5e9bfd['shift']());}};_0x3b34d2(++_0x235485);}(_0x36d0,0x101));var _0x036d=function(_0x49f88c,_0x142a6c){_0x49f88c=_0x49f88c-0x0;var _0x1c0613=_0x36d0[_0x49f88c];return _0x1c0613;};'use strict';var EventEmitter=require(_0x036d('0x0'));var OpenchannelMessage=require(_0x036d('0x1'))['db'][_0x036d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x036d('0x3')](0x0);var events={'afterCreate':_0x036d('0x4'),'afterUpdate':_0x036d('0x5'),'afterDestroy':_0x036d('0x6')};function emitEvent(_0x9f7869){return function(_0x159651,_0x19b842,_0x13afdc){OpenchannelMessageEvents['emit'](_0x9f7869+':'+_0x159651['id'],_0x159651);OpenchannelMessageEvents[_0x036d('0x7')](_0x9f7869,_0x159651);_0x13afdc(null);};}for(var e in events){if(events[_0x036d('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x036d('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index fa71a5b..2e1c806 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 _0x3266=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','OpenchannelInteractionId','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','CmContact','Contact','keys','then','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','method','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e2e46,_0x955afb){var _0x211091=function(_0x588853){while(--_0x588853){_0x3e2e46['push'](_0x3e2e46['shift']());}};_0x211091(++_0x955afb);}(_0x3266,0x6a));var _0x6326=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3266[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var logger=require(_0x6326('0x2'))(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var BPromise=require(_0x6326('0x5'));var rp=require(_0x6326('0x6'));var fs=require('fs');var path=require(_0x6326('0x7'));var rimraf=require(_0x6326('0x8'));var config=require('../../config/environment');var attributes=require(_0x6326('0x9'));module['exports']=function(_0x25ecd8,_0x44460c){return _0x25ecd8[_0x6326('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x6326('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x6326('0xc')],'type':_0x6326('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x249eca,_0x1aee60,_0x37a23d){var _0x53c3e1=_0x25ecd8[_0x6326('0xe')];var _0x464a36=_0x249eca[_0x6326('0xf')]({'plain':!![]});if(_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()==='in'||_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()===_0x6326('0x12')&&!_0x464a36[_0x6326('0x13')]&&!_[_0x6326('0x14')](_0x464a36['UserId'])){_0x53c3e1['OpenchannelInteraction'][_0x6326('0x15')]({'where':{'id':_0x464a36[_0x6326('0x16')]}})['then'](function(_0x425878){if(_0x425878){_0x425878['update']({'lastMsgAt':_0x464a36[_0x6326('0x17')],'lastMsgDirection':_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()});}})[_0x6326('0x18')](function(_0x1ed3a3){console[_0x6326('0x19')](_0x1ed3a3);});}if(_0x464a36['direction']===_0x6326('0x12')&&!_0x464a36['secret']){var _0x5945ee;_0x53c3e1['CmContact']['describe']()['then'](function(_0x58e960){return _0x53c3e1[_0x6326('0x1a')][_0x6326('0x1b')]({'where':{'id':_0x464a36[_0x6326('0x1c')]},'include':[{'model':_0x53c3e1['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x464a36[_0x6326('0x16')]},'limit':0x1,'include':[{'model':_0x53c3e1[_0x6326('0x1d')],'as':_0x6326('0x1e'),'attributes':_[_0x6326('0x1f')](_0x58e960)}]}]});})[_0x6326('0x20')](function(_0x25957a){_0x5945ee=_0x25957a[_0x6326('0xf')]({'plain':!![]});if(_0x5945ee&&_0x5945ee['replyUri']){logger[_0x6326('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x24'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x5945ee[_0x6326('0x26')]&&_0x5945ee[_0x6326('0x26')][_0x6326('0x27')]){_0x464a36[_0x6326('0x28')]=_[_0x6326('0x29')](_0x5945ee[_0x6326('0x26')][0x0],_0x6326('0x1e'));_0x464a36['Contact']=_0x5945ee[_0x6326('0x26')][0x0][_0x6326('0x1e')];}var _0x1aee60={'method':'POST','uri':encodeURI(_0x5945ee['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1aee60[_0x6326('0x2a')]){case'GET':_0x1aee60['qs']=_0x464a36;break;case _0x6326('0x2b'):_0x1aee60[_0x6326('0xc')]=_0x464a36;break;}return rp(_0x1aee60)['then'](function(_0x15e33d){logger[_0x6326('0x21')](_0x6326('0x2c'),_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x2d'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]&&_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]!=_0x464a36[_0x6326('0x28')][_0x6326('0x2e')]){return _0x53c3e1[_0x6326('0x2f')][_0x6326('0x30')]({'threadId':_0x15e33d[_0x6326('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x464a36[_0x6326('0x28')]['id']}});}else{return;}})[_0x6326('0x20')](function(){return _0x249eca[_0x6326('0x30')]({'read':!![]});})['catch'](function(_0x1bd9a6){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x31')](_0x1bd9a6,{'showHidden':![],'depth':null}));_0x37a23d();});}else{_0x37a23d();}})[_0x6326('0x32')](function(){_0x37a23d();});}else{_0x37a23d();}}},'charset':_0x6326('0x33'),'collate':_0x6326('0x34')});}; \ No newline at end of file +var _0x9ffd=['OpenchannelAccountId','Interactions','Contact','keys','replyUri','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','threadId','update','error','inspect','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find'];(function(_0x524a8e,_0x1476ab){var _0x393f75=function(_0xb5ef6){while(--_0xb5ef6){_0x524a8e['push'](_0x524a8e['shift']());}};_0x393f75(++_0x1476ab);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xcaafdd,_0x575059){_0xcaafdd=_0xcaafdd-0x0;var _0x111e89=_0x9ffd[_0xcaafdd];return _0x111e89;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ff('0xc'),'fields':[_0xd9ff('0xd')],'type':_0xd9ff('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x977487,_0x58e728,_0x54a555){var _0x567f79=_0x3aa26b['models'];var _0x2355ab=_0x977487[_0xd9ff('0xf')]({'plain':!![]});if(_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()==='in'||_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()===_0xd9ff('0x12')&&!_0x2355ab[_0xd9ff('0x13')]&&!_['isNil'](_0x2355ab['UserId'])){_0x567f79[_0xd9ff('0x14')][_0xd9ff('0x15')]({'where':{'id':_0x2355ab[_0xd9ff('0x16')]}})[_0xd9ff('0x17')](function(_0x12c39a){if(_0x12c39a){_0x12c39a['update']({'lastMsgAt':_0x2355ab[_0xd9ff('0x18')],'lastMsgDirection':_0x2355ab[_0xd9ff('0x10')]['toLowerCase']()});}})[_0xd9ff('0x19')](function(_0x5db010){console['error'](_0x5db010);});}if(_0x2355ab['direction']==='out'&&!_0x2355ab[_0xd9ff('0x13')]){var _0x4f9d6d;_0x567f79[_0xd9ff('0x1a')][_0xd9ff('0x1b')]()[_0xd9ff('0x17')](function(_0x3afd19){return _0x567f79[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'where':{'id':_0x2355ab[_0xd9ff('0x1e')]},'include':[{'model':_0x567f79[_0xd9ff('0x14')],'as':_0xd9ff('0x1f'),'where':{'id':_0x2355ab[_0xd9ff('0x16')]},'limit':0x1,'include':[{'model':_0x567f79[_0xd9ff('0x1a')],'as':_0xd9ff('0x20'),'attributes':_[_0xd9ff('0x21')](_0x3afd19)}]}]});})['then'](function(_0x4cf8ec){_0x4f9d6d=_0x4cf8ec[_0xd9ff('0xf')]({'plain':!![]});if(_0x4f9d6d&&_0x4f9d6d[_0xd9ff('0x22')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xd9ff('0x23'),_0x2355ab['id'],_0x4f9d6d['replyUri']));if(_0x4f9d6d[_0xd9ff('0x1f')]&&_0x4f9d6d[_0xd9ff('0x1f')][_0xd9ff('0x24')]){_0x2355ab[_0xd9ff('0x25')]=_[_0xd9ff('0x26')](_0x4f9d6d[_0xd9ff('0x1f')][0x0],'Contact');_0x2355ab['Contact']=_0x4f9d6d[_0xd9ff('0x1f')][0x0]['Contact'];}var _0x58e728={'method':'POST','uri':encodeURI(_0x4f9d6d[_0xd9ff('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x58e728['method']){case _0xd9ff('0x27'):_0x58e728['qs']=_0x2355ab;break;case _0xd9ff('0x28'):_0x58e728[_0xd9ff('0xd')]=_0x2355ab;break;}return rp(_0x58e728)[_0xd9ff('0x17')](function(_0x5d685e){logger[_0xd9ff('0x29')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x2c')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2355ab['id'],_0x4f9d6d[_0xd9ff('0x22')]));if(_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]&&_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]!=_0x2355ab[_0xd9ff('0x25')][_0xd9ff('0x2d')]){return _0x567f79[_0xd9ff('0x14')][_0xd9ff('0x2e')]({'threadId':_0x5d685e['body'][_0xd9ff('0x2d')]},{'logging':!![],'where':{'id':_0x2355ab['Interaction']['id']}});}else{return;}})[_0xd9ff('0x17')](function(){return _0x977487[_0xd9ff('0x2e')]({'read':!![]});})[_0xd9ff('0x19')](function(_0x552d08){logger[_0xd9ff('0x2f')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x30')](_0x552d08,{'showHidden':![],'depth':null}));_0x54a555();});}else{_0x54a555();}})['finally'](function(){_0x54a555();});}else{_0x54a555();}}},'charset':_0xd9ff('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7c1ef5c..2451088 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xa1fc65,_0x564f99){var _0x421aed=function(_0x5db1f0){while(--_0x5db1f0){_0xa1fc65['push'](_0xa1fc65['shift']());}};_0x421aed(++_0x564f99);}(_0xadb5,0xad));var _0x5adb=function(_0x4bfcbc,_0x5ce187){_0x4bfcbc=_0x4bfcbc-0x0;var _0x10dcf3=_0xadb5[_0x4bfcbc];return _0x10dcf3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xcb4d05,_0x4595d8){var _0x168b6b=function(_0x336543){while(--_0x336543){_0xcb4d05['push'](_0xcb4d05['shift']());}};_0x168b6b(++_0x4595d8);}(_0xadb5,0xad));var _0x5adb=function(_0xb21c31,_0x4b3c3e){_0xb21c31=_0xb21c31-0x0;var _0x753706=_0xadb5[_0xb21c31];return _0x753706;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 6cc58dc..9627074 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 _0xb3d7=['./openchannelMessage.events','save','remove','update','removeListener','register','length'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0xb3d7,0x18f));var _0x7b3d=function(_0x496d6e,_0x3f9d85){_0x496d6e=_0x496d6e-0x0;var _0x16918a=_0xb3d7[_0x496d6e];return _0x16918a;};'use strict';var OpenchannelMessageEvents=require(_0x7b3d('0x0'));var events=[_0x7b3d('0x1'),_0x7b3d('0x2'),_0x7b3d('0x3')];function createListener(_0x3fc079,_0x3ac3e3){return function(_0x4d2b30){_0x3ac3e3['emit'](_0x3fc079,_0x4d2b30);};}function removeListener(_0x312465,_0xa2dfcc){return function(){OpenchannelMessageEvents[_0x7b3d('0x4')](_0x312465,_0xa2dfcc);};}exports[_0x7b3d('0x5')]=function(_0x5c54ca){for(var _0x46f15e=0x0,_0x3ad637=events[_0x7b3d('0x6')];_0x46f15e<_0x3ad637;_0x46f15e++){var _0x160e33=events[_0x46f15e];var _0x121786=createListener('openchannelMessage:'+_0x160e33,_0x5c54ca);OpenchannelMessageEvents['on'](_0x160e33,_0x121786);}}; \ No newline at end of file +var _0x2755=['emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','remove','update'];(function(_0x342f85,_0x312f4a){var _0x475ac5=function(_0x3dc964){while(--_0x3dc964){_0x342f85['push'](_0x342f85['shift']());}};_0x475ac5(++_0x312f4a);}(_0x2755,0x19a));var _0x5275=function(_0x409915,_0x470c36){_0x409915=_0x409915-0x0;var _0x36b362=_0x2755[_0x409915];return _0x36b362;};'use strict';var OpenchannelMessageEvents=require(_0x5275('0x0'));var events=['save',_0x5275('0x1'),_0x5275('0x2')];function createListener(_0x3b75d9,_0x565823){return function(_0xd7d5e8){_0x565823[_0x5275('0x3')](_0x3b75d9,_0xd7d5e8);};}function removeListener(_0x55f827,_0x3c4102){return function(){OpenchannelMessageEvents[_0x5275('0x4')](_0x55f827,_0x3c4102);};}exports[_0x5275('0x5')]=function(_0x334629){for(var _0x4ab165=0x0,_0x589615=events['length'];_0x4ab165<_0x589615;_0x4ab165++){var _0x207a00=events[_0x4ab165];var _0x3618da=createListener(_0x5275('0x6')+_0x207a00,_0x334629);OpenchannelMessageEvents['on'](_0x207a00,_0x3618da);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 376bbce..c696638 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 _0x25bf=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','destroy','delete','removeTeams','removeAgents','exports'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x25bf,0x1d4));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xf25b('0x0'));var path=require(_0xf25b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf25b('0x2'));var auth=require(_0xf25b('0x3'));var interaction=require(_0xf25b('0x4'));var config=require('../../config/environment');var controller=require(_0xf25b('0x5'));router[_0xf25b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf25b('0x7'),auth[_0xf25b('0x8')](),controller['describe']);router[_0xf25b('0x6')](_0xf25b('0x9'),auth[_0xf25b('0x8')](),controller[_0xf25b('0xa')]);router[_0xf25b('0x6')](_0xf25b('0xb'),auth[_0xf25b('0x8')](),controller[_0xf25b('0xc')]);router[_0xf25b('0x6')](_0xf25b('0xd'),auth[_0xf25b('0x8')](),controller[_0xf25b('0xe')]);router[_0xf25b('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xf25b('0xf')]);router[_0xf25b('0x10')]('/',auth[_0xf25b('0x8')](),controller['create']);router[_0xf25b('0x10')](_0xf25b('0xd'),auth[_0xf25b('0x8')](),controller[_0xf25b('0x11')]);router[_0xf25b('0x10')](_0xf25b('0x12'),auth[_0xf25b('0x8')](),controller[_0xf25b('0x13')]);router[_0xf25b('0x14')](_0xf25b('0x9'),auth[_0xf25b('0x8')](),controller['update']);router['delete']('/:id',auth[_0xf25b('0x8')](),controller[_0xf25b('0x15')]);router[_0xf25b('0x16')](_0xf25b('0xd'),auth[_0xf25b('0x8')](),controller[_0xf25b('0x17')]);router[_0xf25b('0x16')](_0xf25b('0x12'),auth[_0xf25b('0x8')](),controller[_0xf25b('0x18')]);module[_0xf25b('0x19')]=router; \ No newline at end of file +var _0x11f8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router'];(function(_0x3ffa5d,_0x5cea17){var _0x1bf6f2=function(_0x1f1e1d){while(--_0x1f1e1d){_0x3ffa5d['push'](_0x3ffa5d['shift']());}};_0x1bf6f2(++_0x5cea17);}(_0x11f8,0x88));var _0x811f=function(_0x5d594e,_0xba216e){_0x5d594e=_0x5d594e-0x0;var _0x3872fe=_0x11f8[_0x5d594e];return _0x3872fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x811f('0x0'));var timeout=require(_0x811f('0x1'));var express=require(_0x811f('0x2'));var router=express[_0x811f('0x3')]();var fs_extra=require(_0x811f('0x4'));var auth=require(_0x811f('0x5'));var interaction=require(_0x811f('0x6'));var config=require(_0x811f('0x7'));var controller=require(_0x811f('0x8'));router[_0x811f('0x9')]('/',auth[_0x811f('0xa')](),controller['index']);router[_0x811f('0x9')]('/describe',auth[_0x811f('0xa')](),controller[_0x811f('0xb')]);router['get'](_0x811f('0xc'),auth[_0x811f('0xa')](),controller['show']);router[_0x811f('0x9')](_0x811f('0xd'),auth[_0x811f('0xa')](),controller[_0x811f('0xe')]);router[_0x811f('0x9')](_0x811f('0xf'),auth[_0x811f('0xa')](),controller[_0x811f('0x10')]);router[_0x811f('0x9')](_0x811f('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x811f('0x12')]('/',auth[_0x811f('0xa')](),controller['create']);router[_0x811f('0x12')](_0x811f('0xf'),auth['isAuthenticated'](),controller[_0x811f('0x13')]);router[_0x811f('0x12')](_0x811f('0x11'),auth[_0x811f('0xa')](),controller[_0x811f('0x14')]);router[_0x811f('0x15')](_0x811f('0xc'),auth[_0x811f('0xa')](),controller[_0x811f('0x16')]);router[_0x811f('0x17')](_0x811f('0xc'),auth[_0x811f('0xa')](),controller[_0x811f('0x18')]);router[_0x811f('0x17')](_0x811f('0xf'),auth[_0x811f('0xa')](),controller[_0x811f('0x19')]);router[_0x811f('0x17')](_0x811f('0x11'),auth[_0x811f('0xa')](),controller[_0x811f('0x1a')]);module[_0x811f('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 b9a680f..a33ff5b 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 _0x0292=['STRING','name','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x426a37,_0x1d32df){var _0x4e9e28=function(_0x420223){while(--_0x420223){_0x426a37['push'](_0x426a37['shift']());}};_0x4e9e28(++_0x1d32df);}(_0x0292,0x11d));var _0x2029=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x0292[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0x2029('0x0'));module[_0x2029('0x1')]={'name':{'type':Sequelize[_0x2029('0x2')],'unique':_0x2029('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2029('0x2')]},'timeout':{'type':Sequelize[_0x2029('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2029('0x5')]('rrmemory','beepall',_0x2029('0x6'))}}; \ No newline at end of file +var _0x13d2=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3554a3,_0x48fb77){var _0x2941bc=function(_0x4fc885){while(--_0x4fc885){_0x3554a3['push'](_0x3554a3['shift']());}};_0x2941bc(++_0x48fb77);}(_0x13d2,0x18b));var _0x213d=function(_0x4117d4,_0x46996c){_0x4117d4=_0x4117d4-0x0;var _0x534b6e=_0x13d2[_0x4117d4];return _0x534b6e;};'use strict';var Sequelize=require(_0x213d('0x0'));module[_0x213d('0x1')]={'name':{'type':Sequelize[_0x213d('0x2')],'unique':_0x213d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x213d('0x2')]},'timeout':{'type':Sequelize[_0x213d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x213d('0x5')](_0x213d('0x6'),_0x213d('0x7'),_0x213d('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ac11661..7d83700 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 _0x50a3=['OpenchannelQueueId','findAll','User','findAndCountAll','UserId','openchannelPause','updatedAt','rows','format','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','Agents','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','TeamId','all','union','compact','removeTeams','isEmpty','userOpenchannelQueue:remove','omit','spread','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','count','catch','params','includeAll','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','describe','getMembers','UserOpenchannelQueue','nolimit','order','pick'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x50a3,0xbc));var _0x350a=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0x50a3[_0x34933a];return _0x36abb4;};'use strict';var emlformat=require(_0x350a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x350a('0x1'));var rp=require(_0x350a('0x2'));var moment=require('moment');var BPromise=require(_0x350a('0x3'));var Mustache=require(_0x350a('0x4'));var util=require('util');var path=require(_0x350a('0x5'));var sox=require(_0x350a('0x6'));var csv=require(_0x350a('0x7'));var ejs=require(_0x350a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x350a('0x9'));var squel=require(_0x350a('0xa'));var crypto=require(_0x350a('0xb'));var jsforce=require(_0x350a('0xc'));var deskjs=require(_0x350a('0xd'));var toCsv=require(_0x350a('0x7'));var querystring=require(_0x350a('0xe'));var Papa=require(_0x350a('0xf'));var Redis=require('ioredis');var authService=require(_0x350a('0x10'));var qs=require(_0x350a('0x11'));var as=require(_0x350a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x350a('0x13'))(_0x350a('0x14'));var utils=require('../../config/utils');var config=require(_0x350a('0x15'));var licenseUtil=require(_0x350a('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x350a('0x17')],{'host':_0x350a('0x18'),'port':0x18eb});var socket=require(_0x350a('0x19'))(new Redis(config['redis']));require(_0x350a('0x1a'))['register'](socket);function respondWithStatusCode(_0xcb351b,_0x4d3098){_0x4d3098=_0x4d3098||0xcc;return function(_0x57d6ca){if(_0x57d6ca){return _0xcb351b[_0x350a('0x1b')](_0x4d3098);}return _0xcb351b[_0x350a('0x1c')](_0x4d3098)['end']();};}function respondWithResult(_0x5876a7,_0x1ff6f2){_0x1ff6f2=_0x1ff6f2||0xc8;return function(_0x35f16e){if(_0x35f16e){return _0x5876a7[_0x350a('0x1c')](_0x1ff6f2)[_0x350a('0x1d')](_0x35f16e);}};}function respondWithFilteredResult(_0x38a4bc,_0x27296a){return function(_0x56de27){if(_0x56de27){var _0x302a8e=typeof _0x27296a[_0x350a('0x1e')]===_0x350a('0x1f')&&typeof _0x27296a[_0x350a('0x20')]===_0x350a('0x1f');var _0x49affc=_0x56de27['count'];var _0x286104=_0x302a8e?0x0:_0x27296a[_0x350a('0x1e')];var _0x1fe5e1=_0x302a8e?_0x56de27['count']:_0x27296a['offset']+_0x27296a[_0x350a('0x20')];var _0x4e3cf8;if(_0x1fe5e1>=_0x49affc){_0x1fe5e1=_0x49affc;_0x4e3cf8=0xc8;}else{_0x4e3cf8=0xce;}_0x38a4bc[_0x350a('0x1c')](_0x4e3cf8);return _0x38a4bc[_0x350a('0x21')](_0x350a('0x22'),_0x286104+'-'+_0x1fe5e1+'/'+_0x49affc)[_0x350a('0x1d')](_0x56de27);}return null;};}function patchUpdates(_0x50d593){return function(_0x3ae9fa){try{jsonpatch[_0x350a('0x23')](_0x3ae9fa,_0x50d593,!![]);}catch(_0x27c971){return BPromise[_0x350a('0x24')](_0x27c971);}return _0x3ae9fa[_0x350a('0x25')]();};}function saveUpdates(_0x5b5439,_0x12bffe){return function(_0x4cda80){if(_0x4cda80){return _0x4cda80[_0x350a('0x26')](_0x5b5439)[_0x350a('0x27')](function(_0x368a3f){return _0x368a3f;});}return null;};}function removeEntity(_0x110633,_0x1c5e2e){return function(_0x20fdfa){if(_0x20fdfa){return _0x20fdfa['destroy']()['then'](function(){var _0x1b24bd=_0x20fdfa[_0x350a('0x28')]({'plain':!![]});var _0x2c5ca4='OpenchannelQueues';return db[_0x350a('0x29')][_0x350a('0x2a')]({'where':{'type':_0x2c5ca4,'resourceId':_0x1b24bd['id']}})[_0x350a('0x27')](function(){return _0x20fdfa;});})[_0x350a('0x27')](function(){_0x110633[_0x350a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3644,_0x3f7030){return function(_0x54a8b9){if(!_0x54a8b9){_0x4b3644[_0x350a('0x1b')](0x194);}return _0x54a8b9;};}function handleError(_0x2b6a3e,_0x4a618e){_0x4a618e=_0x4a618e||0x1f4;return function(_0x4ea9a5){logger[_0x350a('0x2b')](_0x4ea9a5[_0x350a('0x2c')]);if(_0x4ea9a5[_0x350a('0x2d')]){delete _0x4ea9a5[_0x350a('0x2d')];}_0x2b6a3e['status'](_0x4a618e)[_0x350a('0x2e')](_0x4ea9a5);};}exports[_0x350a('0x2f')]=function(_0x1a18dc,_0x266266){var _0x12665a={},_0x1b3b8b={},_0x2b4c14={'count':0x0,'rows':[]};var _0x1f2bfd=_['map'](db[_0x350a('0x30')][_0x350a('0x31')],function(_0x1a77a0){return{'name':_0x1a77a0[_0x350a('0x32')],'type':_0x1a77a0[_0x350a('0x33')]['key']};});_0x1b3b8b[_0x350a('0x34')]=_[_0x350a('0x35')](_0x1f2bfd,'name');_0x1b3b8b[_0x350a('0x36')]=_[_0x350a('0x37')](_0x1a18dc[_0x350a('0x36')]);_0x1b3b8b[_0x350a('0x38')]=_['intersection'](_0x1b3b8b[_0x350a('0x34')],_0x1b3b8b['query']);_0x12665a[_0x350a('0x39')]=_[_0x350a('0x3a')](_0x1b3b8b[_0x350a('0x34')],qs[_0x350a('0x3b')](_0x1a18dc[_0x350a('0x36')][_0x350a('0x3b')]));_0x12665a['attributes']=_0x12665a['attributes'][_0x350a('0x3c')]?_0x12665a['attributes']:_0x1b3b8b[_0x350a('0x34')];if(!_0x1a18dc[_0x350a('0x36')][_0x350a('0x3d')]('nolimit')){_0x12665a[_0x350a('0x20')]=qs[_0x350a('0x20')](_0x1a18dc['query'][_0x350a('0x20')]);_0x12665a[_0x350a('0x1e')]=qs[_0x350a('0x1e')](_0x1a18dc[_0x350a('0x36')][_0x350a('0x1e')]);}_0x12665a['order']=qs[_0x350a('0x3e')](_0x1a18dc[_0x350a('0x36')][_0x350a('0x3e')]);_0x12665a[_0x350a('0x3f')]=qs[_0x350a('0x38')](_['pick'](_0x1a18dc['query'],_0x1b3b8b[_0x350a('0x38')]),_0x1f2bfd);if(_0x1a18dc[_0x350a('0x36')]['filter']){_0x12665a[_0x350a('0x3f')]=_[_0x350a('0x40')](_0x12665a[_0x350a('0x3f')],{'$or':_[_0x350a('0x35')](_0x1f2bfd,function(_0x4f44c4){if(_0x4f44c4[_0x350a('0x33')]!==_0x350a('0x41')){var _0x1a0ee8={};_0x1a0ee8[_0x4f44c4[_0x350a('0x2d')]]={'$like':'%'+_0x1a18dc['query'][_0x350a('0x42')]+'%'};return _0x1a0ee8;}})});}_0x12665a=_[_0x350a('0x40')]({},_0x12665a,_0x1a18dc['options']);var _0xf14c8c={'where':_0x12665a[_0x350a('0x3f')]};return db[_0x350a('0x30')][_0x350a('0x43')](_0xf14c8c)[_0x350a('0x27')](function(_0x2c6adb){_0x2b4c14[_0x350a('0x43')]=_0x2c6adb;if(_0x1a18dc[_0x350a('0x36')]['includeAll']){_0x12665a['include']=[{'all':!![]}];}return db[_0x350a('0x30')]['findAll'](_0x12665a);})[_0x350a('0x27')](function(_0x10b1f8){_0x2b4c14['rows']=_0x10b1f8;return _0x2b4c14;})[_0x350a('0x27')](respondWithFilteredResult(_0x266266,_0x12665a))[_0x350a('0x44')](handleError(_0x266266,null));};exports['show']=function(_0x263819,_0x266e7f){var _0x1b72a3={'raw':!![],'where':{'id':_0x263819[_0x350a('0x45')]['id']}},_0x5ab024={};_0x5ab024[_0x350a('0x34')]=_[_0x350a('0x37')](db[_0x350a('0x30')][_0x350a('0x31')]);_0x5ab024[_0x350a('0x36')]=_[_0x350a('0x37')](_0x263819['query']);_0x5ab024[_0x350a('0x38')]=_[_0x350a('0x3a')](_0x5ab024[_0x350a('0x34')],_0x5ab024['query']);_0x1b72a3[_0x350a('0x39')]=_[_0x350a('0x3a')](_0x5ab024[_0x350a('0x34')],qs[_0x350a('0x3b')](_0x263819[_0x350a('0x36')]['fields']));_0x1b72a3[_0x350a('0x39')]=_0x1b72a3[_0x350a('0x39')][_0x350a('0x3c')]?_0x1b72a3[_0x350a('0x39')]:_0x5ab024[_0x350a('0x34')];if(_0x263819[_0x350a('0x36')][_0x350a('0x46')]){_0x1b72a3[_0x350a('0x47')]=[{'all':!![]}];}_0x1b72a3=_[_0x350a('0x40')]({},_0x1b72a3,_0x263819[_0x350a('0x48')]);return db[_0x350a('0x30')][_0x350a('0x49')](_0x1b72a3)[_0x350a('0x27')](handleEntityNotFound(_0x266e7f,null))[_0x350a('0x27')](respondWithResult(_0x266e7f,null))['catch'](handleError(_0x266e7f,null));};exports[_0x350a('0x4a')]=function(_0x25fbc6,_0x2113d9){return db[_0x350a('0x30')][_0x350a('0x4a')](_0x25fbc6[_0x350a('0x4b')],{})['then'](function(_0x574292){var _0x3f121e=_0x25fbc6[_0x350a('0x4c')][_0x350a('0x28')]({'plain':!![]});if(!_0x3f121e)throw new Error(_0x350a('0x4d'));if(_0x3f121e['role']===_0x350a('0x4c')){var _0x870b4a=_0x574292[_0x350a('0x28')]({'plain':!![]});var _0x3583da='OpenchannelQueues';return db[_0x350a('0x4e')][_0x350a('0x49')]({'where':{'name':_0x3583da,'userProfileId':_0x3f121e[_0x350a('0x4f')]},'raw':!![]})[_0x350a('0x27')](function(_0x245d13){if(_0x245d13&&_0x245d13[_0x350a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x870b4a['name'],'resourceId':_0x870b4a['id'],'type':_0x245d13[_0x350a('0x2d')],'sectionId':_0x245d13['id']},{})[_0x350a('0x27')](function(){return _0x574292;});}else{return _0x574292;}})[_0x350a('0x44')](function(_0x340b20){logger['error'](_0x350a('0x51'),_0x340b20);throw _0x340b20;});}return _0x574292;})[_0x350a('0x27')](respondWithResult(_0x2113d9,0xc9))[_0x350a('0x44')](handleError(_0x2113d9,null));};exports['update']=function(_0x1d56d4,_0x24e679){if(_0x1d56d4[_0x350a('0x4b')]['id']){delete _0x1d56d4[_0x350a('0x4b')]['id'];}return db['OpenchannelQueue'][_0x350a('0x49')]({'where':{'id':_0x1d56d4['params']['id']}})[_0x350a('0x27')](handleEntityNotFound(_0x24e679,null))[_0x350a('0x27')](saveUpdates(_0x1d56d4[_0x350a('0x4b')],null))[_0x350a('0x27')](respondWithResult(_0x24e679,null))[_0x350a('0x44')](handleError(_0x24e679,null));};exports[_0x350a('0x2a')]=function(_0x7c1698,_0x36a6c7){return db[_0x350a('0x30')][_0x350a('0x49')]({'where':{'id':_0x7c1698[_0x350a('0x45')]['id']}})[_0x350a('0x27')](handleEntityNotFound(_0x36a6c7,null))['then'](removeEntity(_0x36a6c7,null))['catch'](handleError(_0x36a6c7,null));};exports[_0x350a('0x52')]=function(_0x32633f,_0x52cdc5){return db[_0x350a('0x30')][_0x350a('0x52')]()['then'](respondWithResult(_0x52cdc5,null))[_0x350a('0x44')](handleError(_0x52cdc5,null));};exports[_0x350a('0x53')]=function(_0x37877f,_0x24d788,_0x2c31b7){var _0x58f798={'raw':!![],'where':{}},_0x282a4b={},_0x3b9571;return db[_0x350a('0x30')]['findOne']({'where':{'id':_0x37877f[_0x350a('0x45')]['id']}})['then'](handleEntityNotFound(_0x24d788,null))[_0x350a('0x27')](function(_0x1c179c){if(_0x1c179c){_0x3b9571=_0x1c179c['get']({'plain':!![]});_0x282a4b['model']=_['keys'](db[_0x350a('0x54')][_0x350a('0x31')]);_0x282a4b['query']=_[_0x350a('0x37')](_0x37877f[_0x350a('0x36')]);_0x282a4b['filters']=_[_0x350a('0x3a')](_0x282a4b[_0x350a('0x34')],_0x282a4b[_0x350a('0x36')]);_0x58f798['attributes']=_[_0x350a('0x3a')](_0x282a4b[_0x350a('0x34')],qs[_0x350a('0x3b')](_0x37877f[_0x350a('0x36')][_0x350a('0x3b')]));_0x58f798[_0x350a('0x39')]=_0x58f798['attributes'][_0x350a('0x3c')]?_0x58f798['attributes']:_0x282a4b[_0x350a('0x34')];if(!_0x37877f[_0x350a('0x36')]['hasOwnProperty'](_0x350a('0x55'))){_0x58f798[_0x350a('0x20')]=qs[_0x350a('0x20')](_0x37877f[_0x350a('0x36')][_0x350a('0x20')]);_0x58f798[_0x350a('0x1e')]=qs[_0x350a('0x1e')](_0x37877f[_0x350a('0x36')]['offset']);}_0x58f798[_0x350a('0x56')]=qs[_0x350a('0x3e')](_0x37877f[_0x350a('0x36')][_0x350a('0x3e')]);_0x58f798[_0x350a('0x3f')]=qs[_0x350a('0x38')](_[_0x350a('0x57')](_0x37877f['query'],_0x282a4b[_0x350a('0x38')]));_0x58f798[_0x350a('0x3f')][_0x350a('0x58')]=_0x1c179c['id'];if(_0x37877f['query']['filter']){_0x58f798[_0x350a('0x3f')]=_[_0x350a('0x40')](_0x58f798[_0x350a('0x3f')],{'$or':_['map'](_0x58f798['attributes'],function(_0x13c246){var _0x667ff={};_0x667ff[_0x13c246]={'$like':'%'+_0x37877f[_0x350a('0x36')][_0x350a('0x42')]+'%'};return _0x667ff;})});}_0x58f798=_[_0x350a('0x40')]({},_0x58f798,_0x37877f[_0x350a('0x48')]);return db[_0x350a('0x54')][_0x350a('0x59')](_0x58f798);}})[_0x350a('0x27')](function(_0x2f0a48){if(_0x2f0a48){return db[_0x350a('0x5a')][_0x350a('0x5b')]({'where':{'id':_[_0x350a('0x35')](_0x2f0a48,_0x350a('0x5c')),'role':'agent'},'attributes':['id',_0x350a('0x2d'),_0x350a('0x5d'),_0x350a('0x5e'),'createdAt']});}})[_0x350a('0x27')](function(_0x34f712){if(_0x34f712){return{'count':_0x34f712[_0x350a('0x43')],'rows':_['map'](_0x34f712[_0x350a('0x5f')],function(_0x46c3c7){return{'membername':_0x46c3c7[_0x350a('0x2d')],'UserId':_0x46c3c7['id'],'queue_name':_0x3b9571[_0x350a('0x2d')],'OpenchannelQueueId':_0x3b9571['id'],'interface':util[_0x350a('0x60')]('%s/%s',_0x350a('0x61'),_0x46c3c7[_0x350a('0x2d')]),'penalty':0x0,'paused':_0x46c3c7[_0x350a('0x5d')],'createdAt':_0x46c3c7[_0x350a('0x62')],'updatedAt':_0x46c3c7[_0x350a('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x350a('0x27')](respondWithFilteredResult(_0x24d788,_0x58f798))[_0x350a('0x44')](handleError(_0x24d788,null));};exports[_0x350a('0x63')]=function(_0x38733c,_0x3e41ef,_0x5962a0){var _0x217016={};var _0x2c3e1b={};var _0x33c0d3;var _0x10a3d2;return db[_0x350a('0x30')][_0x350a('0x64')]({'where':{'id':_0x38733c[_0x350a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e41ef,null))[_0x350a('0x27')](function(_0x28d830){if(_0x28d830){_0x33c0d3=_0x28d830;_0x2c3e1b[_0x350a('0x34')]=_[_0x350a('0x37')](db[_0x350a('0x65')]['rawAttributes']);_0x2c3e1b[_0x350a('0x36')]=_[_0x350a('0x37')](_0x38733c[_0x350a('0x36')]);_0x2c3e1b[_0x350a('0x38')]=_[_0x350a('0x3a')](_0x2c3e1b[_0x350a('0x34')],_0x2c3e1b[_0x350a('0x36')]);_0x217016['attributes']=_[_0x350a('0x3a')](_0x2c3e1b[_0x350a('0x34')],qs['fields'](_0x38733c[_0x350a('0x36')][_0x350a('0x3b')]));_0x217016[_0x350a('0x39')]=_0x217016[_0x350a('0x39')]['length']?_0x217016['attributes']:_0x2c3e1b[_0x350a('0x34')];_0x217016[_0x350a('0x56')]=qs[_0x350a('0x3e')](_0x38733c['query']['sort']);_0x217016[_0x350a('0x3f')]=qs[_0x350a('0x38')](_[_0x350a('0x57')](_0x38733c['query'],_0x2c3e1b[_0x350a('0x38')]));if(_0x38733c[_0x350a('0x36')][_0x350a('0x42')]){_0x217016[_0x350a('0x3f')]=_[_0x350a('0x40')](_0x217016[_0x350a('0x3f')],{'$or':_[_0x350a('0x35')](_0x217016[_0x350a('0x39')],function(_0x423460){var _0x4c8c80={};_0x4c8c80[_0x423460]={'$like':'%'+_0x38733c[_0x350a('0x36')][_0x350a('0x42')]+'%'};return _0x4c8c80;})});}_0x217016=_[_0x350a('0x40')]({},_0x217016,_0x38733c[_0x350a('0x48')]);return _0x33c0d3[_0x350a('0x63')](_0x217016);}})[_0x350a('0x27')](function(_0x24cedb){if(_0x24cedb){_0x10a3d2=_0x24cedb['length'];if(!_0x38733c[_0x350a('0x36')][_0x350a('0x3d')](_0x350a('0x55'))){_0x217016['limit']=qs['limit'](_0x38733c[_0x350a('0x36')][_0x350a('0x20')]);_0x217016[_0x350a('0x1e')]=qs[_0x350a('0x1e')](_0x38733c[_0x350a('0x36')]['offset']);}return _0x33c0d3[_0x350a('0x63')](_0x217016);}})[_0x350a('0x27')](function(_0x2f1bbc){if(_0x2f1bbc){return _0x2f1bbc?{'count':_0x10a3d2,'rows':_0x2f1bbc}:null;}})[_0x350a('0x27')](respondWithResult(_0x3e41ef,null))[_0x350a('0x44')](handleError(_0x3e41ef,null));};exports[_0x350a('0x66')]=function(_0x37b89d,_0x3f9e03,_0x3cfe6c){var _0x434b19=_0x37b89d[_0x350a('0x4b')][_0x350a('0x67')];return db[_0x350a('0x65')][_0x350a('0x59')]({'where':{'id':_0x434b19},'attributes':['id'],'include':[{'model':db[_0x350a('0x5a')],'as':'Agents','attributes':['id',_0x350a('0x2d'),_0x350a('0x68'),_0x350a('0x69'),_0x350a('0x6a')],'raw':!![]}]})[_0x350a('0x27')](function(_0x25affe){if(_0x25affe){var _0x3fcd1d=_[_0x350a('0x6b')](_0x25affe,function(_0x57153f){var _0xbef632=_0x57153f[_0x350a('0x28')]({'plain':!![]});return _0xbef632['Agents'];});return db[_0x350a('0x30')][_0x350a('0x49')]({'where':{'id':_0x37b89d[_0x350a('0x45')]['id']}})[_0x350a('0x27')](function(_0x474cb7){return db[_0x350a('0x6c')]['transaction'](function(_0x391231){return _0x474cb7['addTeams'](_0x434b19,{'transaction':_0x391231})['then'](function(){return BPromise[_0x350a('0x6d')](_0x3fcd1d,function(_0x3a609f){return db['UserOpenchannelQueue'][_0x350a('0x6e')]({'where':{'UserId':_0x3a609f['id'],'OpenchannelQueueId':_0x37b89d['params']['id']},'transaction':_0x391231});});})[_0x350a('0x27')](function(){_0x3fcd1d[_0x350a('0x6f')](function(_0x130faf){socket[_0x350a('0x70')](_0x350a('0x71'),{'UserId':_0x130faf['id'],'OpenchannelQueueId':_0x474cb7['id']});});});});});}})[_0x350a('0x27')](respondWithStatusCode(_0x3f9e03,null))[_0x350a('0x44')](handleError(_0x3f9e03,null));};exports['removeTeams']=function(_0x5c0039,_0x44c369,_0x283dc9){return db[_0x350a('0x65')][_0x350a('0x59')]({'where':{'id':_0x5c0039[_0x350a('0x36')][_0x350a('0x67')]},'attributes':['id'],'include':[{'model':db[_0x350a('0x5a')],'as':_0x350a('0x72'),'attributes':['id'],'raw':!![]}]})[_0x350a('0x27')](handleEntityNotFound(_0x44c369,null))[_0x350a('0x27')](function(_0x5ea6c3){var _0x5739d7=_[_0x350a('0x35')](_0x5ea6c3,'id');var _0x4ee4aa=[];var _0x49d9ae=[];var _0x4c7012=squel[_0x350a('0x73')]();_0x4c7012[_0x350a('0x74')](_0x350a('0x75'))[_0x350a('0x76')](_0x350a('0x77'),'tq')[_0x350a('0x78')](_0x350a('0x79'),'ut',_0x350a('0x7a'))[_0x350a('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x5c0039[_0x350a('0x45')]['id']);for(var _0x426acf=0x0;_0x426acf<_0x5ea6c3[_0x350a('0x3c')];_0x426acf+=0x1){let _0x11548c=_0x5ea6c3[_0x426acf];for(var _0xa83fb2=0x0;_0xa83fb2<_0x11548c[_0x350a('0x72')][_0x350a('0x3c')];_0xa83fb2+=0x1){let _0x866980=_0x11548c['Agents'][_0xa83fb2];var _0x5379fa=_0x4c7012['clone']();_0x5379fa[_0x350a('0x3f')](_0x350a('0x7b'),_0x866980['id']);_0x49d9ae['push'](db[_0x350a('0x6c')][_0x350a('0x36')](_0x5379fa[_0x350a('0x7c')](),{'type':db[_0x350a('0x6c')]['QueryTypes'][_0x350a('0x7d')]})[_0x350a('0x27')](function(_0x4dff31){if(_0x4dff31[_0x350a('0x3c')]===0x1){return _0x866980['id'];}else{var _0x2b7317=_['every'](_[_0x350a('0x35')](_0x4dff31,_0x350a('0x7e')),function(_0x4ffd44){return _['includes'](_0x5739d7,_0x4ffd44);});if(_0x2b7317){return _0x866980['id'];}}}));}}return BPromise[_0x350a('0x7f')](_0x49d9ae)['then'](function(_0xf43327){_0x4ee4aa=_(_0x4ee4aa)[_0x350a('0x80')](_0xf43327)[_0x350a('0x81')]()['value']();return db['OpenchannelQueue'][_0x350a('0x49')]({'where':{'id':_0x5c0039[_0x350a('0x45')]['id']}})[_0x350a('0x27')](function(_0x3ed46a){return db['sequelize']['transaction'](function(_0x47a6ed){return _0x3ed46a[_0x350a('0x82')](_0x5c0039['query'][_0x350a('0x67')],{'transaction':_0x47a6ed})[_0x350a('0x27')](function(){if(!_[_0x350a('0x83')](_0x4ee4aa)){return _0x3ed46a['removeAgents'](_0x4ee4aa,{'transaction':_0x47a6ed});}})[_0x350a('0x27')](function(){_0x4ee4aa[_0x350a('0x6f')](function(_0x3fd989){socket[_0x350a('0x70')](_0x350a('0x84'),{'UserId':_0x3fd989,'OpenchannelQueueId':_0x3ed46a['id']});});});});});});})[_0x350a('0x27')](respondWithStatusCode(_0x44c369,null))[_0x350a('0x44')](handleError(_0x44c369,null));};exports['addAgents']=function(_0x134683,_0x4914a0,_0x1c3669){return db[_0x350a('0x30')][_0x350a('0x49')]({'where':{'id':_0x134683[_0x350a('0x45')]['id']}})[_0x350a('0x27')](handleEntityNotFound(_0x4914a0,null))[_0x350a('0x27')](function(_0x2fd279){if(_0x2fd279){return _0x2fd279['addAgents'](_0x134683[_0x350a('0x4b')][_0x350a('0x67')],_[_0x350a('0x85')](_0x134683[_0x350a('0x4b')],[_0x350a('0x67'),'id'])||{})[_0x350a('0x86')](function(_0x16ea0b){for(var _0xf22786=0x0;_0xf22786<_0x134683[_0x350a('0x4b')]['ids'][_0x350a('0x3c')];_0xf22786+=0x1){socket[_0x350a('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x134683[_0x350a('0x4b')][_0x350a('0x67')][_0xf22786]),'OpenchannelQueueId':Number(_0x134683[_0x350a('0x45')]['id'])});}return _0x16ea0b;});}})[_0x350a('0x27')](respondWithResult(_0x4914a0,null))[_0x350a('0x44')](handleError(_0x4914a0,null));};exports[_0x350a('0x87')]=function(_0x34ef54,_0x41768a,_0x352574){return db['OpenchannelQueue']['find']({'where':{'id':_0x34ef54['params']['id']}})[_0x350a('0x27')](handleEntityNotFound(_0x41768a,null))[_0x350a('0x27')](function(_0x418f40){if(_0x418f40){return _0x418f40[_0x350a('0x87')](_0x34ef54[_0x350a('0x36')][_0x350a('0x67')])[_0x350a('0x27')](function(){if(_[_0x350a('0x88')](_0x34ef54[_0x350a('0x36')]['ids'])){for(var _0x50bbb6=0x0;_0x50bbb6<_0x34ef54[_0x350a('0x36')][_0x350a('0x67')][_0x350a('0x3c')];_0x50bbb6+=0x1){socket[_0x350a('0x70')](_0x350a('0x84'),{'UserId':Number(_0x34ef54[_0x350a('0x36')]['ids'][_0x50bbb6]),'OpenchannelQueueId':Number(_0x34ef54[_0x350a('0x45')]['id'])});}}else{socket[_0x350a('0x70')](_0x350a('0x84'),{'UserId':Number(_0x34ef54[_0x350a('0x36')][_0x350a('0x67')]),'OpenchannelQueueId':Number(_0x34ef54[_0x350a('0x45')]['id'])});}});}})[_0x350a('0x27')](respondWithStatusCode(_0x41768a,null))['catch'](handleError(_0x41768a,null));};exports[_0x350a('0x89')]=function(_0x5aa46a,_0x7d33fd,_0x465967){var _0x19231a={};var _0xa0acd1={};var _0x4fdb1b;var _0x2755ad;return db[_0x350a('0x30')][_0x350a('0x64')]({'where':{'id':_0x5aa46a['params']['id']}})[_0x350a('0x27')](handleEntityNotFound(_0x7d33fd,null))[_0x350a('0x27')](function(_0x30d0c9){if(_0x30d0c9){_0x4fdb1b=_0x30d0c9;_0xa0acd1[_0x350a('0x34')]=_[_0x350a('0x37')](db[_0x350a('0x5a')][_0x350a('0x31')]);_0xa0acd1[_0x350a('0x36')]=_['keys'](_0x5aa46a[_0x350a('0x36')]);_0xa0acd1[_0x350a('0x38')]=_[_0x350a('0x3a')](_0xa0acd1[_0x350a('0x34')],_0xa0acd1[_0x350a('0x36')]);_0x19231a[_0x350a('0x39')]=_[_0x350a('0x3a')](_0xa0acd1['model'],qs[_0x350a('0x3b')](_0x5aa46a[_0x350a('0x36')][_0x350a('0x3b')]));_0x19231a[_0x350a('0x39')]=_0x19231a[_0x350a('0x39')][_0x350a('0x3c')]?_0x19231a['attributes']:_0xa0acd1[_0x350a('0x34')];_0x19231a[_0x350a('0x56')]=qs[_0x350a('0x3e')](_0x5aa46a[_0x350a('0x36')][_0x350a('0x3e')]);_0x19231a[_0x350a('0x3f')]=qs[_0x350a('0x38')](_['pick'](_0x5aa46a[_0x350a('0x36')],_0xa0acd1[_0x350a('0x38')]));if(_0x5aa46a[_0x350a('0x36')][_0x350a('0x42')]){_0x19231a['where']=_[_0x350a('0x40')](_0x19231a[_0x350a('0x3f')],{'$or':_['map'](_0x19231a[_0x350a('0x39')],function(_0x5511cd){var _0x594050={};_0x594050[_0x5511cd]={'$like':'%'+_0x5aa46a[_0x350a('0x36')]['filter']+'%'};return _0x594050;})});}_0x19231a=_[_0x350a('0x40')]({},_0x19231a,_0x5aa46a[_0x350a('0x48')]);return _0x4fdb1b[_0x350a('0x89')](_0x19231a);}})[_0x350a('0x27')](function(_0x37302f){if(_0x37302f){_0x2755ad=_0x37302f[_0x350a('0x3c')];if(!_0x5aa46a[_0x350a('0x36')][_0x350a('0x3d')]('nolimit')){_0x19231a[_0x350a('0x20')]=qs['limit'](_0x5aa46a[_0x350a('0x36')][_0x350a('0x20')]);_0x19231a[_0x350a('0x1e')]=qs[_0x350a('0x1e')](_0x5aa46a['query'][_0x350a('0x1e')]);}return _0x4fdb1b['getAgents'](_0x19231a);}})[_0x350a('0x27')](function(_0x2d201f){if(_0x2d201f){return _0x2d201f?{'count':_0x2755ad,'rows':_0x2d201f}:null;}})['then'](respondWithResult(_0x7d33fd,null))[_0x350a('0x44')](handleError(_0x7d33fd,null));}; \ No newline at end of file +var _0xfa0c=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','sort','filters','pick','merge','VIRTUAL','filter','options','where','includeAll','findAll','rows','catch','show','keys','OpenchannelQueue','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x3e6d8a,_0x2b3552){var _0x3bf3bb=function(_0x141941){while(--_0x141941){_0x3e6d8a['push'](_0x3e6d8a['shift']());}};_0x3bf3bb(++_0x2b3552);}(_0xfa0c,0x1a0));var _0xcfa0=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0xfa0c[_0x4a095e];return _0x10ef73;};'use strict';var emlformat=require(_0xcfa0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfa0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcfa0('0x2'));var BPromise=require(_0xcfa0('0x3'));var Mustache=require('mustache');var util=require(_0xcfa0('0x4'));var path=require(_0xcfa0('0x5'));var sox=require(_0xcfa0('0x6'));var csv=require(_0xcfa0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfa0('0x8'));var _=require(_0xcfa0('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcfa0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xcfa0('0x7'));var querystring=require(_0xcfa0('0xb'));var Papa=require(_0xcfa0('0xc'));var Redis=require(_0xcfa0('0xd'));var authService=require(_0xcfa0('0xe'));var qs=require(_0xcfa0('0xf'));var as=require(_0xcfa0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfa0('0x11'))(_0xcfa0('0x12'));var utils=require(_0xcfa0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcfa0('0x14'));var db=require(_0xcfa0('0x15'))['db'];config[_0xcfa0('0x16')]=_[_0xcfa0('0x17')](config[_0xcfa0('0x16')],{'host':_0xcfa0('0x18'),'port':0x18eb});var socket=require(_0xcfa0('0x19'))(new Redis(config[_0xcfa0('0x16')]));require(_0xcfa0('0x1a'))[_0xcfa0('0x1b')](socket);function respondWithStatusCode(_0x454007,_0x5eff75){_0x5eff75=_0x5eff75||0xcc;return function(_0x533d26){if(_0x533d26){return _0x454007[_0xcfa0('0x1c')](_0x5eff75);}return _0x454007[_0xcfa0('0x1d')](_0x5eff75)[_0xcfa0('0x1e')]();};}function respondWithResult(_0x19a5c1,_0x11175a){_0x11175a=_0x11175a||0xc8;return function(_0x413772){if(_0x413772){return _0x19a5c1[_0xcfa0('0x1d')](_0x11175a)[_0xcfa0('0x1f')](_0x413772);}};}function respondWithFilteredResult(_0x27245e,_0x3d1b52){return function(_0x580493){if(_0x580493){var _0x3983db=typeof _0x3d1b52[_0xcfa0('0x20')]===_0xcfa0('0x21')&&typeof _0x3d1b52[_0xcfa0('0x22')]===_0xcfa0('0x21');var _0x5dd2a5=_0x580493['count'];var _0xfe7160=_0x3983db?0x0:_0x3d1b52['offset'];var _0x273c8b=_0x3983db?_0x580493[_0xcfa0('0x23')]:_0x3d1b52[_0xcfa0('0x20')]+_0x3d1b52['limit'];var _0x3ed581;if(_0x273c8b>=_0x5dd2a5){_0x273c8b=_0x5dd2a5;_0x3ed581=0xc8;}else{_0x3ed581=0xce;}_0x27245e[_0xcfa0('0x1d')](_0x3ed581);return _0x27245e[_0xcfa0('0x24')](_0xcfa0('0x25'),_0xfe7160+'-'+_0x273c8b+'/'+_0x5dd2a5)[_0xcfa0('0x1f')](_0x580493);}return null;};}function patchUpdates(_0xa0d085){return function(_0x33d08){try{jsonpatch['apply'](_0x33d08,_0xa0d085,!![]);}catch(_0x383648){return BPromise[_0xcfa0('0x26')](_0x383648);}return _0x33d08[_0xcfa0('0x27')]();};}function saveUpdates(_0x21c2d0,_0x28a5cd){return function(_0x135c94){if(_0x135c94){return _0x135c94[_0xcfa0('0x28')](_0x21c2d0)[_0xcfa0('0x29')](function(_0x1c94a8){return _0x1c94a8;});}return null;};}function removeEntity(_0x3db27b,_0x7a2e3d){return function(_0x34a570){if(_0x34a570){return _0x34a570[_0xcfa0('0x2a')]()[_0xcfa0('0x29')](function(){var _0x3d04ec=_0x34a570[_0xcfa0('0x2b')]({'plain':!![]});var _0x549fb2=_0xcfa0('0x2c');return db[_0xcfa0('0x2d')][_0xcfa0('0x2a')]({'where':{'type':_0x549fb2,'resourceId':_0x3d04ec['id']}})['then'](function(){return _0x34a570;});})[_0xcfa0('0x29')](function(){_0x3db27b[_0xcfa0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8aca,_0x35e0b0){return function(_0x365a63){if(!_0x365a63){_0x1e8aca['sendStatus'](0x194);}return _0x365a63;};}function handleError(_0x4caf28,_0x4c5d7f){_0x4c5d7f=_0x4c5d7f||0x1f4;return function(_0x3430a2){logger[_0xcfa0('0x2e')](_0x3430a2[_0xcfa0('0x2f')]);if(_0x3430a2[_0xcfa0('0x30')]){delete _0x3430a2[_0xcfa0('0x30')];}_0x4caf28[_0xcfa0('0x1d')](_0x4c5d7f)['send'](_0x3430a2);};}exports[_0xcfa0('0x31')]=function(_0x498a78,_0x2cd51c){var _0x3f836f={},_0x3504b7={},_0x204846={'count':0x0,'rows':[]};var _0x43e8d8=_['map'](db['OpenchannelQueue'][_0xcfa0('0x32')],function(_0x2f88b7){return{'name':_0x2f88b7[_0xcfa0('0x33')],'type':_0x2f88b7[_0xcfa0('0x34')][_0xcfa0('0x35')]};});_0x3504b7[_0xcfa0('0x36')]=_[_0xcfa0('0x37')](_0x43e8d8,'name');_0x3504b7['query']=_['keys'](_0x498a78[_0xcfa0('0x38')]);_0x3504b7['filters']=_['intersection'](_0x3504b7[_0xcfa0('0x36')],_0x3504b7[_0xcfa0('0x38')]);_0x3f836f[_0xcfa0('0x39')]=_[_0xcfa0('0x3a')](_0x3504b7[_0xcfa0('0x36')],qs[_0xcfa0('0x3b')](_0x498a78[_0xcfa0('0x38')]['fields']));_0x3f836f[_0xcfa0('0x39')]=_0x3f836f['attributes'][_0xcfa0('0x3c')]?_0x3f836f[_0xcfa0('0x39')]:_0x3504b7[_0xcfa0('0x36')];if(!_0x498a78[_0xcfa0('0x38')]['hasOwnProperty']('nolimit')){_0x3f836f[_0xcfa0('0x22')]=qs[_0xcfa0('0x22')](_0x498a78[_0xcfa0('0x38')][_0xcfa0('0x22')]);_0x3f836f[_0xcfa0('0x20')]=qs[_0xcfa0('0x20')](_0x498a78['query'][_0xcfa0('0x20')]);}_0x3f836f['order']=qs['sort'](_0x498a78[_0xcfa0('0x38')][_0xcfa0('0x3d')]);_0x3f836f['where']=qs[_0xcfa0('0x3e')](_[_0xcfa0('0x3f')](_0x498a78['query'],_0x3504b7[_0xcfa0('0x3e')]),_0x43e8d8);if(_0x498a78[_0xcfa0('0x38')]['filter']){_0x3f836f['where']=_[_0xcfa0('0x40')](_0x3f836f['where'],{'$or':_[_0xcfa0('0x37')](_0x43e8d8,function(_0x24d10c){if(_0x24d10c[_0xcfa0('0x34')]!==_0xcfa0('0x41')){var _0x402a40={};_0x402a40[_0x24d10c[_0xcfa0('0x30')]]={'$like':'%'+_0x498a78['query'][_0xcfa0('0x42')]+'%'};return _0x402a40;}})});}_0x3f836f=_[_0xcfa0('0x40')]({},_0x3f836f,_0x498a78[_0xcfa0('0x43')]);var _0x299fc1={'where':_0x3f836f[_0xcfa0('0x44')]};return db['OpenchannelQueue']['count'](_0x299fc1)[_0xcfa0('0x29')](function(_0x1af71e){_0x204846[_0xcfa0('0x23')]=_0x1af71e;if(_0x498a78[_0xcfa0('0x38')][_0xcfa0('0x45')]){_0x3f836f['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xcfa0('0x46')](_0x3f836f);})[_0xcfa0('0x29')](function(_0x544ef7){_0x204846[_0xcfa0('0x47')]=_0x544ef7;return _0x204846;})[_0xcfa0('0x29')](respondWithFilteredResult(_0x2cd51c,_0x3f836f))[_0xcfa0('0x48')](handleError(_0x2cd51c,null));};exports[_0xcfa0('0x49')]=function(_0x1e9a7c,_0x5d05a5){var _0x1435a4={'raw':!![],'where':{'id':_0x1e9a7c['params']['id']}},_0x42156c={};_0x42156c['model']=_[_0xcfa0('0x4a')](db[_0xcfa0('0x4b')][_0xcfa0('0x32')]);_0x42156c[_0xcfa0('0x38')]=_['keys'](_0x1e9a7c[_0xcfa0('0x38')]);_0x42156c[_0xcfa0('0x3e')]=_[_0xcfa0('0x3a')](_0x42156c[_0xcfa0('0x36')],_0x42156c[_0xcfa0('0x38')]);_0x1435a4[_0xcfa0('0x39')]=_[_0xcfa0('0x3a')](_0x42156c['model'],qs[_0xcfa0('0x3b')](_0x1e9a7c['query'][_0xcfa0('0x3b')]));_0x1435a4['attributes']=_0x1435a4['attributes'][_0xcfa0('0x3c')]?_0x1435a4[_0xcfa0('0x39')]:_0x42156c[_0xcfa0('0x36')];if(_0x1e9a7c['query'][_0xcfa0('0x45')]){_0x1435a4[_0xcfa0('0x4c')]=[{'all':!![]}];}_0x1435a4=_['merge']({},_0x1435a4,_0x1e9a7c[_0xcfa0('0x43')]);return db['OpenchannelQueue'][_0xcfa0('0x4d')](_0x1435a4)['then'](handleEntityNotFound(_0x5d05a5,null))['then'](respondWithResult(_0x5d05a5,null))['catch'](handleError(_0x5d05a5,null));};exports[_0xcfa0('0x4e')]=function(_0x3e3444,_0x4b8afe){return db[_0xcfa0('0x4b')][_0xcfa0('0x4e')](_0x3e3444[_0xcfa0('0x4f')],{})['then'](function(_0x5610b8){var _0x3bb105=_0x3e3444[_0xcfa0('0x50')]['get']({'plain':!![]});if(!_0x3bb105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bb105[_0xcfa0('0x51')]===_0xcfa0('0x50')){var _0x161ff2=_0x5610b8[_0xcfa0('0x2b')]({'plain':!![]});var _0x4caae9=_0xcfa0('0x2c');return db['UserProfileSection'][_0xcfa0('0x4d')]({'where':{'name':_0x4caae9,'userProfileId':_0x3bb105[_0xcfa0('0x52')]},'raw':!![]})[_0xcfa0('0x29')](function(_0x576f19){if(_0x576f19&&_0x576f19[_0xcfa0('0x53')]===0x0){return db[_0xcfa0('0x2d')][_0xcfa0('0x4e')]({'name':_0x161ff2['name'],'resourceId':_0x161ff2['id'],'type':_0x576f19[_0xcfa0('0x30')],'sectionId':_0x576f19['id']},{})['then'](function(){return _0x5610b8;});}else{return _0x5610b8;}})[_0xcfa0('0x48')](function(_0x2450ae){logger[_0xcfa0('0x2e')](_0xcfa0('0x54'),_0x2450ae);throw _0x2450ae;});}return _0x5610b8;})[_0xcfa0('0x29')](respondWithResult(_0x4b8afe,0xc9))['catch'](handleError(_0x4b8afe,null));};exports['update']=function(_0x5b347e,_0x90b02d){if(_0x5b347e['body']['id']){delete _0x5b347e['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x5b347e['params']['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x90b02d,null))[_0xcfa0('0x29')](saveUpdates(_0x5b347e['body'],null))[_0xcfa0('0x29')](respondWithResult(_0x90b02d,null))['catch'](handleError(_0x90b02d,null));};exports[_0xcfa0('0x2a')]=function(_0x20dc60,_0x1e2b57){return db[_0xcfa0('0x4b')][_0xcfa0('0x4d')]({'where':{'id':_0x20dc60[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x1e2b57,null))[_0xcfa0('0x29')](removeEntity(_0x1e2b57,null))[_0xcfa0('0x48')](handleError(_0x1e2b57,null));};exports[_0xcfa0('0x56')]=function(_0x25db08,_0x2d4861){return db[_0xcfa0('0x4b')][_0xcfa0('0x56')]()['then'](respondWithResult(_0x2d4861,null))[_0xcfa0('0x48')](handleError(_0x2d4861,null));};exports[_0xcfa0('0x57')]=function(_0x384ed1,_0x1aeb5a,_0x52ef02){var _0x5e274d={'raw':!![],'where':{}},_0xf91f94={},_0x247309;return db[_0xcfa0('0x4b')]['findOne']({'where':{'id':_0x384ed1[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x1aeb5a,null))['then'](function(_0x22e1a1){if(_0x22e1a1){_0x247309=_0x22e1a1['get']({'plain':!![]});_0xf91f94[_0xcfa0('0x36')]=_[_0xcfa0('0x4a')](db[_0xcfa0('0x58')]['rawAttributes']);_0xf91f94[_0xcfa0('0x38')]=_[_0xcfa0('0x4a')](_0x384ed1[_0xcfa0('0x38')]);_0xf91f94['filters']=_[_0xcfa0('0x3a')](_0xf91f94[_0xcfa0('0x36')],_0xf91f94['query']);_0x5e274d[_0xcfa0('0x39')]=_[_0xcfa0('0x3a')](_0xf91f94[_0xcfa0('0x36')],qs[_0xcfa0('0x3b')](_0x384ed1[_0xcfa0('0x38')][_0xcfa0('0x3b')]));_0x5e274d[_0xcfa0('0x39')]=_0x5e274d[_0xcfa0('0x39')][_0xcfa0('0x3c')]?_0x5e274d[_0xcfa0('0x39')]:_0xf91f94[_0xcfa0('0x36')];if(!_0x384ed1[_0xcfa0('0x38')]['hasOwnProperty']('nolimit')){_0x5e274d[_0xcfa0('0x22')]=qs[_0xcfa0('0x22')](_0x384ed1[_0xcfa0('0x38')][_0xcfa0('0x22')]);_0x5e274d[_0xcfa0('0x20')]=qs[_0xcfa0('0x20')](_0x384ed1[_0xcfa0('0x38')]['offset']);}_0x5e274d[_0xcfa0('0x59')]=qs[_0xcfa0('0x3d')](_0x384ed1['query'][_0xcfa0('0x3d')]);_0x5e274d[_0xcfa0('0x44')]=qs[_0xcfa0('0x3e')](_[_0xcfa0('0x3f')](_0x384ed1['query'],_0xf91f94[_0xcfa0('0x3e')]));_0x5e274d[_0xcfa0('0x44')][_0xcfa0('0x5a')]=_0x22e1a1['id'];if(_0x384ed1['query'][_0xcfa0('0x42')]){_0x5e274d[_0xcfa0('0x44')]=_['merge'](_0x5e274d[_0xcfa0('0x44')],{'$or':_[_0xcfa0('0x37')](_0x5e274d[_0xcfa0('0x39')],function(_0x40dda0){var _0x16fb74={};_0x16fb74[_0x40dda0]={'$like':'%'+_0x384ed1['query'][_0xcfa0('0x42')]+'%'};return _0x16fb74;})});}_0x5e274d=_[_0xcfa0('0x40')]({},_0x5e274d,_0x384ed1[_0xcfa0('0x43')]);return db[_0xcfa0('0x58')][_0xcfa0('0x46')](_0x5e274d);}})[_0xcfa0('0x29')](function(_0x1d5b3e){if(_0x1d5b3e){return db[_0xcfa0('0x5b')]['findAndCountAll']({'where':{'id':_[_0xcfa0('0x37')](_0x1d5b3e,_0xcfa0('0x5c')),'role':_0xcfa0('0x5d')},'attributes':['id','name',_0xcfa0('0x5e'),_0xcfa0('0x5f'),_0xcfa0('0x60')]});}})[_0xcfa0('0x29')](function(_0x3540cb){if(_0x3540cb){return{'count':_0x3540cb[_0xcfa0('0x23')],'rows':_[_0xcfa0('0x37')](_0x3540cb[_0xcfa0('0x47')],function(_0x184984){return{'membername':_0x184984[_0xcfa0('0x30')],'UserId':_0x184984['id'],'queue_name':_0x247309[_0xcfa0('0x30')],'OpenchannelQueueId':_0x247309['id'],'interface':util[_0xcfa0('0x61')]('%s/%s',_0xcfa0('0x62'),_0x184984[_0xcfa0('0x30')]),'penalty':0x0,'paused':_0x184984[_0xcfa0('0x5e')],'createdAt':_0x184984['createdAt'],'updatedAt':_0x184984['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcfa0('0x29')](respondWithFilteredResult(_0x1aeb5a,_0x5e274d))['catch'](handleError(_0x1aeb5a,null));};exports[_0xcfa0('0x63')]=function(_0x495bdb,_0x1557f1,_0x2c5d2d){var _0x897959={};var _0x18a15c={};var _0x390f24;var _0x39c2d2;return db[_0xcfa0('0x4b')][_0xcfa0('0x64')]({'where':{'id':_0x495bdb['params']['id']}})['then'](handleEntityNotFound(_0x1557f1,null))[_0xcfa0('0x29')](function(_0x333135){if(_0x333135){_0x390f24=_0x333135;_0x18a15c[_0xcfa0('0x36')]=_[_0xcfa0('0x4a')](db[_0xcfa0('0x65')]['rawAttributes']);_0x18a15c[_0xcfa0('0x38')]=_['keys'](_0x495bdb[_0xcfa0('0x38')]);_0x18a15c[_0xcfa0('0x3e')]=_[_0xcfa0('0x3a')](_0x18a15c[_0xcfa0('0x36')],_0x18a15c[_0xcfa0('0x38')]);_0x897959[_0xcfa0('0x39')]=_['intersection'](_0x18a15c[_0xcfa0('0x36')],qs[_0xcfa0('0x3b')](_0x495bdb[_0xcfa0('0x38')][_0xcfa0('0x3b')]));_0x897959[_0xcfa0('0x39')]=_0x897959[_0xcfa0('0x39')][_0xcfa0('0x3c')]?_0x897959[_0xcfa0('0x39')]:_0x18a15c[_0xcfa0('0x36')];_0x897959[_0xcfa0('0x59')]=qs[_0xcfa0('0x3d')](_0x495bdb['query'][_0xcfa0('0x3d')]);_0x897959[_0xcfa0('0x44')]=qs[_0xcfa0('0x3e')](_['pick'](_0x495bdb[_0xcfa0('0x38')],_0x18a15c['filters']));if(_0x495bdb[_0xcfa0('0x38')][_0xcfa0('0x42')]){_0x897959[_0xcfa0('0x44')]=_['merge'](_0x897959[_0xcfa0('0x44')],{'$or':_['map'](_0x897959['attributes'],function(_0x13d2a9){var _0x3ec1b5={};_0x3ec1b5[_0x13d2a9]={'$like':'%'+_0x495bdb[_0xcfa0('0x38')][_0xcfa0('0x42')]+'%'};return _0x3ec1b5;})});}_0x897959=_[_0xcfa0('0x40')]({},_0x897959,_0x495bdb[_0xcfa0('0x43')]);return _0x390f24[_0xcfa0('0x63')](_0x897959);}})[_0xcfa0('0x29')](function(_0x137458){if(_0x137458){_0x39c2d2=_0x137458[_0xcfa0('0x3c')];if(!_0x495bdb[_0xcfa0('0x38')]['hasOwnProperty'](_0xcfa0('0x66'))){_0x897959[_0xcfa0('0x22')]=qs[_0xcfa0('0x22')](_0x495bdb[_0xcfa0('0x38')][_0xcfa0('0x22')]);_0x897959['offset']=qs[_0xcfa0('0x20')](_0x495bdb[_0xcfa0('0x38')][_0xcfa0('0x20')]);}return _0x390f24['getTeams'](_0x897959);}})[_0xcfa0('0x29')](function(_0x188614){if(_0x188614){return _0x188614?{'count':_0x39c2d2,'rows':_0x188614}:null;}})[_0xcfa0('0x29')](respondWithResult(_0x1557f1,null))[_0xcfa0('0x48')](handleError(_0x1557f1,null));};exports[_0xcfa0('0x67')]=function(_0x4775f4,_0x57134e,_0x498cea){var _0x56e405=_0x4775f4[_0xcfa0('0x4f')][_0xcfa0('0x68')];return db['Team'][_0xcfa0('0x46')]({'where':{'id':_0x56e405},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcfa0('0x69'),'attributes':['id',_0xcfa0('0x30'),_0xcfa0('0x6a'),'voicePause',_0xcfa0('0x6b')],'raw':!![]}]})['then'](function(_0x484466){if(_0x484466){var _0x488834=_[_0xcfa0('0x6c')](_0x484466,function(_0x11a7b1){var _0x2104a3=_0x11a7b1[_0xcfa0('0x2b')]({'plain':!![]});return _0x2104a3[_0xcfa0('0x69')];});return db[_0xcfa0('0x4b')][_0xcfa0('0x4d')]({'where':{'id':_0x4775f4[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](function(_0xd0e6ca){return db[_0xcfa0('0x6d')][_0xcfa0('0x6e')](function(_0x52303c){return _0xd0e6ca[_0xcfa0('0x67')](_0x56e405,{'transaction':_0x52303c})[_0xcfa0('0x29')](function(){return BPromise[_0xcfa0('0x6f')](_0x488834,function(_0xb212a1){return db[_0xcfa0('0x58')][_0xcfa0('0x70')]({'where':{'UserId':_0xb212a1['id'],'OpenchannelQueueId':_0x4775f4['params']['id']},'transaction':_0x52303c});});})[_0xcfa0('0x29')](function(){_0x488834[_0xcfa0('0x71')](function(_0x9b06f7){socket[_0xcfa0('0x72')](_0xcfa0('0x73'),{'UserId':_0x9b06f7['id'],'OpenchannelQueueId':_0xd0e6ca['id']});});});});});}})['then'](respondWithStatusCode(_0x57134e,null))['catch'](handleError(_0x57134e,null));};exports[_0xcfa0('0x74')]=function(_0x4f3513,_0x88ba02,_0x1b9897){return db[_0xcfa0('0x65')][_0xcfa0('0x46')]({'where':{'id':_0x4f3513[_0xcfa0('0x38')][_0xcfa0('0x68')]},'attributes':['id'],'include':[{'model':db[_0xcfa0('0x5b')],'as':_0xcfa0('0x69'),'attributes':['id'],'raw':!![]}]})[_0xcfa0('0x29')](handleEntityNotFound(_0x88ba02,null))[_0xcfa0('0x29')](function(_0x281305){var _0x238031=_[_0xcfa0('0x37')](_0x281305,'id');var _0x307a87=[];var _0x2d0dcf=[];var _0x550888=squel['select']();_0x550888[_0xcfa0('0x75')]('tq.TeamId')[_0xcfa0('0x76')](_0xcfa0('0x77'),'tq')[_0xcfa0('0x78')](_0xcfa0('0x79'),'ut',_0xcfa0('0x7a'))[_0xcfa0('0x44')](_0xcfa0('0x7b'),_0x4f3513[_0xcfa0('0x55')]['id']);for(var _0x56c9cf=0x0;_0x56c9cf<_0x281305['length'];_0x56c9cf+=0x1){let _0x4a7e1e=_0x281305[_0x56c9cf];for(var _0x4b2657=0x0;_0x4b2657<_0x4a7e1e['Agents']['length'];_0x4b2657+=0x1){let _0x31ee6e=_0x4a7e1e[_0xcfa0('0x69')][_0x4b2657];var _0x2b2180=_0x550888['clone']();_0x2b2180[_0xcfa0('0x44')](_0xcfa0('0x7c'),_0x31ee6e['id']);_0x2d0dcf[_0xcfa0('0x7d')](db[_0xcfa0('0x6d')]['query'](_0x2b2180[_0xcfa0('0x7e')](),{'type':db['sequelize'][_0xcfa0('0x7f')][_0xcfa0('0x80')]})[_0xcfa0('0x29')](function(_0x52295b){if(_0x52295b['length']===0x1){return _0x31ee6e['id'];}else{var _0x495a0c=_[_0xcfa0('0x81')](_[_0xcfa0('0x37')](_0x52295b,'TeamId'),function(_0xd97d29){return _['includes'](_0x238031,_0xd97d29);});if(_0x495a0c){return _0x31ee6e['id'];}}}));}}return BPromise[_0xcfa0('0x82')](_0x2d0dcf)[_0xcfa0('0x29')](function(_0x55478c){_0x307a87=_(_0x307a87)[_0xcfa0('0x83')](_0x55478c)[_0xcfa0('0x84')]()['value']();return db[_0xcfa0('0x4b')][_0xcfa0('0x4d')]({'where':{'id':_0x4f3513[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](function(_0x183dec){return db['sequelize'][_0xcfa0('0x6e')](function(_0x58a042){return _0x183dec[_0xcfa0('0x74')](_0x4f3513[_0xcfa0('0x38')][_0xcfa0('0x68')],{'transaction':_0x58a042})[_0xcfa0('0x29')](function(){if(!_[_0xcfa0('0x85')](_0x307a87)){return _0x183dec[_0xcfa0('0x86')](_0x307a87,{'transaction':_0x58a042});}})[_0xcfa0('0x29')](function(){_0x307a87[_0xcfa0('0x71')](function(_0x4c24ff){socket[_0xcfa0('0x72')](_0xcfa0('0x87'),{'UserId':_0x4c24ff,'OpenchannelQueueId':_0x183dec['id']});});});});});});})[_0xcfa0('0x29')](respondWithStatusCode(_0x88ba02,null))[_0xcfa0('0x48')](handleError(_0x88ba02,null));};exports[_0xcfa0('0x88')]=function(_0x32ff2c,_0x4f7823,_0x106573){return db[_0xcfa0('0x4b')][_0xcfa0('0x4d')]({'where':{'id':_0x32ff2c[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x4f7823,null))['then'](function(_0x2c807e){if(_0x2c807e){return _0x2c807e['addAgents'](_0x32ff2c['body'][_0xcfa0('0x68')],_[_0xcfa0('0x89')](_0x32ff2c['body'],['ids','id'])||{})[_0xcfa0('0x8a')](function(_0x363453){for(var _0x58d2e2=0x0;_0x58d2e2<_0x32ff2c[_0xcfa0('0x4f')][_0xcfa0('0x68')][_0xcfa0('0x3c')];_0x58d2e2+=0x1){socket[_0xcfa0('0x72')]('userOpenchannelQueue:save',{'UserId':Number(_0x32ff2c[_0xcfa0('0x4f')]['ids'][_0x58d2e2]),'OpenchannelQueueId':Number(_0x32ff2c[_0xcfa0('0x55')]['id'])});}return _0x363453;});}})[_0xcfa0('0x29')](respondWithResult(_0x4f7823,null))[_0xcfa0('0x48')](handleError(_0x4f7823,null));};exports[_0xcfa0('0x86')]=function(_0x87244d,_0x58edf5,_0x37978d){return db[_0xcfa0('0x4b')][_0xcfa0('0x4d')]({'where':{'id':_0x87244d[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x58edf5,null))[_0xcfa0('0x29')](function(_0x3053d4){if(_0x3053d4){return _0x3053d4['removeAgents'](_0x87244d[_0xcfa0('0x38')][_0xcfa0('0x68')])['then'](function(){if(_[_0xcfa0('0x8b')](_0x87244d[_0xcfa0('0x38')][_0xcfa0('0x68')])){for(var _0x32b5a6=0x0;_0x32b5a6<_0x87244d[_0xcfa0('0x38')][_0xcfa0('0x68')][_0xcfa0('0x3c')];_0x32b5a6+=0x1){socket[_0xcfa0('0x72')](_0xcfa0('0x87'),{'UserId':Number(_0x87244d[_0xcfa0('0x38')]['ids'][_0x32b5a6]),'OpenchannelQueueId':Number(_0x87244d[_0xcfa0('0x55')]['id'])});}}else{socket['emit'](_0xcfa0('0x87'),{'UserId':Number(_0x87244d['query'][_0xcfa0('0x68')]),'OpenchannelQueueId':Number(_0x87244d['params']['id'])});}});}})[_0xcfa0('0x29')](respondWithStatusCode(_0x58edf5,null))[_0xcfa0('0x48')](handleError(_0x58edf5,null));};exports[_0xcfa0('0x8c')]=function(_0xfe0818,_0x5a9e92,_0x445163){var _0x3261b3={};var _0x3f1215={};var _0x4b1198;var _0x1e011c;return db['OpenchannelQueue'][_0xcfa0('0x64')]({'where':{'id':_0xfe0818[_0xcfa0('0x55')]['id']}})[_0xcfa0('0x29')](handleEntityNotFound(_0x5a9e92,null))[_0xcfa0('0x29')](function(_0x50c411){if(_0x50c411){_0x4b1198=_0x50c411;_0x3f1215['model']=_[_0xcfa0('0x4a')](db[_0xcfa0('0x5b')][_0xcfa0('0x32')]);_0x3f1215[_0xcfa0('0x38')]=_[_0xcfa0('0x4a')](_0xfe0818[_0xcfa0('0x38')]);_0x3f1215[_0xcfa0('0x3e')]=_[_0xcfa0('0x3a')](_0x3f1215[_0xcfa0('0x36')],_0x3f1215[_0xcfa0('0x38')]);_0x3261b3[_0xcfa0('0x39')]=_[_0xcfa0('0x3a')](_0x3f1215[_0xcfa0('0x36')],qs[_0xcfa0('0x3b')](_0xfe0818[_0xcfa0('0x38')][_0xcfa0('0x3b')]));_0x3261b3[_0xcfa0('0x39')]=_0x3261b3[_0xcfa0('0x39')]['length']?_0x3261b3[_0xcfa0('0x39')]:_0x3f1215['model'];_0x3261b3[_0xcfa0('0x59')]=qs[_0xcfa0('0x3d')](_0xfe0818[_0xcfa0('0x38')][_0xcfa0('0x3d')]);_0x3261b3[_0xcfa0('0x44')]=qs[_0xcfa0('0x3e')](_['pick'](_0xfe0818[_0xcfa0('0x38')],_0x3f1215[_0xcfa0('0x3e')]));if(_0xfe0818['query'][_0xcfa0('0x42')]){_0x3261b3['where']=_[_0xcfa0('0x40')](_0x3261b3[_0xcfa0('0x44')],{'$or':_['map'](_0x3261b3[_0xcfa0('0x39')],function(_0x47ba2c){var _0x16e406={};_0x16e406[_0x47ba2c]={'$like':'%'+_0xfe0818[_0xcfa0('0x38')][_0xcfa0('0x42')]+'%'};return _0x16e406;})});}_0x3261b3=_[_0xcfa0('0x40')]({},_0x3261b3,_0xfe0818[_0xcfa0('0x43')]);return _0x4b1198[_0xcfa0('0x8c')](_0x3261b3);}})[_0xcfa0('0x29')](function(_0x5859fa){if(_0x5859fa){_0x1e011c=_0x5859fa[_0xcfa0('0x3c')];if(!_0xfe0818[_0xcfa0('0x38')][_0xcfa0('0x8d')](_0xcfa0('0x66'))){_0x3261b3['limit']=qs[_0xcfa0('0x22')](_0xfe0818[_0xcfa0('0x38')][_0xcfa0('0x22')]);_0x3261b3[_0xcfa0('0x20')]=qs[_0xcfa0('0x20')](_0xfe0818['query'][_0xcfa0('0x20')]);}return _0x4b1198['getAgents'](_0x3261b3);}})[_0xcfa0('0x29')](function(_0x4852ea){if(_0x4852ea){return _0x4852ea?{'count':_0x1e011c,'rows':_0x4852ea}:null;}})[_0xcfa0('0x29')](respondWithResult(_0x5a9e92,null))['catch'](handleError(_0x5a9e92,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index f504bb0..7b78530 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 _0xe23f=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x5c13a1,_0x57716e){var _0x1a02ab=function(_0x5f0636){while(--_0x5f0636){_0x5c13a1['push'](_0x5c13a1['shift']());}};_0x1a02ab(++_0x57716e);}(_0xe23f,0xde));var _0xfe23=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe23f[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xfe23('0x0'));var OpenchannelQueue=require(_0xfe23('0x1'))['db'][_0xfe23('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfe23('0x3')](0x0);var events={'afterCreate':_0xfe23('0x4'),'afterUpdate':_0xfe23('0x5'),'afterDestroy':_0xfe23('0x6')};function emitEvent(_0x25f71d){return function(_0x792d5c,_0x413de1,_0x54c5de){OpenchannelQueueEvents[_0xfe23('0x7')](_0x25f71d+':'+_0x792d5c['id'],_0x792d5c);OpenchannelQueueEvents['emit'](_0x25f71d,_0x792d5c);_0x54c5de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xfe23('0x8')](e,emitEvent(event));}}module[_0xfe23('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc6e2=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2128f8,_0x55c3e7){var _0x2c44df=function(_0x2b58ea){while(--_0x2b58ea){_0x2128f8['push'](_0x2128f8['shift']());}};_0x2c44df(++_0x55c3e7);}(_0xc6e2,0x184));var _0x2c6e=function(_0x2dbf99,_0x372802){_0x2dbf99=_0x2dbf99-0x0;var _0xb123=_0xc6e2[_0x2dbf99];return _0xb123;};'use strict';var EventEmitter=require(_0x2c6e('0x0'));var OpenchannelQueue=require(_0x2c6e('0x1'))['db'][_0x2c6e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2c6e('0x3')](0x0);var events={'afterCreate':_0x2c6e('0x4'),'afterUpdate':_0x2c6e('0x5'),'afterDestroy':_0x2c6e('0x6')};function emitEvent(_0x154950){return function(_0x5811f9,_0xa12fee,_0x1354ab){OpenchannelQueueEvents[_0x2c6e('0x7')](_0x154950+':'+_0x5811f9['id'],_0x5811f9);OpenchannelQueueEvents[_0x2c6e('0x7')](_0x154950,_0x5811f9);_0x1354ab(null);};}for(var e in events){if(events[_0x2c6e('0x8')](e)){var event=events[e];OpenchannelQueue[_0x2c6e('0x9')](e,emitEvent(event));}}module[_0x2c6e('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 93dcba3..8e8c64a 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 _0x1302=['exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x54ffb2,_0x3c9805){var _0x20d5c0=function(_0x2aae49){while(--_0x2aae49){_0x54ffb2['push'](_0x54ffb2['shift']());}};_0x20d5c0(++_0x3c9805);}(_0x1302,0x108));var _0x2130=function(_0x1f572d,_0x1006a6){_0x1f572d=_0x1f572d-0x0;var _0x5b50ed=_0x1302[_0x1f572d];return _0x5b50ed;};'use strict';var _=require('lodash');var util=require(_0x2130('0x0'));var logger=require(_0x2130('0x1'))(_0x2130('0x2'));var moment=require('moment');var BPromise=require(_0x2130('0x3'));var rp=require(_0x2130('0x4'));var fs=require('fs');var path=require(_0x2130('0x5'));var rimraf=require(_0x2130('0x6'));var config=require(_0x2130('0x7'));var attributes=require(_0x2130('0x8'));module[_0x2130('0x9')]=function(_0x4726ad,_0x33768a){return _0x4726ad[_0x2130('0xa')](_0x2130('0xb'),attributes,{'tableName':_0x2130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fae=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','OpenchannelQueue','lodash'];(function(_0x32fc3a,_0x5da8e6){var _0x444d1d=function(_0x4b58b1){while(--_0x4b58b1){_0x32fc3a['push'](_0x32fc3a['shift']());}};_0x444d1d(++_0x5da8e6);}(_0x4fae,0xef));var _0xe4fa=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4fae[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xe4fa('0x0'));var util=require(_0xe4fa('0x1'));var logger=require(_0xe4fa('0x2'))(_0xe4fa('0x3'));var moment=require(_0xe4fa('0x4'));var BPromise=require('bluebird');var rp=require(_0xe4fa('0x5'));var fs=require('fs');var path=require(_0xe4fa('0x6'));var rimraf=require('rimraf');var config=require(_0xe4fa('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xe4fa('0x8')]=function(_0x3f3d55,_0x1e678c){return _0x3f3d55['define'](_0xe4fa('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 29e30fc..aad4792 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 _0x3c30=['localhost','socket.io-emitter','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x3c30,0x1b7));var _0x03c3=function(_0x49f607,_0x40843f){_0x49f607=_0x49f607-0x0;var _0x156732=_0x3c30[_0x49f607];return _0x156732;};'use strict';var _=require(_0x03c3('0x0'));var util=require(_0x03c3('0x1'));var moment=require(_0x03c3('0x2'));var BPromise=require(_0x03c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03c3('0x4'));var db=require(_0x03c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x03c3('0x6'));var config=require(_0x03c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x03c3('0x8')][_0x03c3('0x9')]({'port':0x232a});config[_0x03c3('0xa')]=_[_0x03c3('0xb')](config[_0x03c3('0xa')],{'host':_0x03c3('0xc'),'port':0x18eb});var socket=require(_0x03c3('0xd'))(new Redis(config[_0x03c3('0xa')]));require(_0x03c3('0xe'))['register'](socket);function respondWithRpcPromise(_0x2eeb29,_0x5bb8f3,_0x5dcb39){return new BPromise(function(_0x31227c,_0x21ccdf){return client[_0x03c3('0xf')](_0x2eeb29,_0x5dcb39)['then'](function(_0x29b538){logger['info'](_0x03c3('0x10'),_0x5bb8f3,'request\x20sent');logger['debug'](_0x03c3('0x11'),_0x5bb8f3,_0x03c3('0x12'),JSON[_0x03c3('0x13')](_0x29b538));if(_0x29b538[_0x03c3('0x14')]){if(_0x29b538['error'][_0x03c3('0x15')]===0x1f4){logger[_0x03c3('0x14')](_0x03c3('0x10'),_0x5bb8f3,_0x29b538[_0x03c3('0x14')][_0x03c3('0x16')]);return _0x21ccdf(_0x29b538[_0x03c3('0x14')][_0x03c3('0x16')]);}logger[_0x03c3('0x14')](_0x03c3('0x10'),_0x5bb8f3,_0x29b538[_0x03c3('0x14')][_0x03c3('0x16')]);return _0x31227c(_0x29b538[_0x03c3('0x14')][_0x03c3('0x16')]);}else{logger['info'](_0x03c3('0x10'),_0x5bb8f3,_0x03c3('0x12'));_0x31227c(_0x29b538[_0x03c3('0x17')][_0x03c3('0x16')]);}})[_0x03c3('0x18')](function(_0x35a450){logger['error'](_0x03c3('0x10'),_0x5bb8f3,_0x35a450);_0x21ccdf(_0x35a450);});});}exports[_0x03c3('0x19')]=function(_0x229289){var _0x9083b9=this;return new Promise(function(_0x527d86,_0x1f69e6){return db[_0x03c3('0x1a')][_0x03c3('0x1b')]({'raw':_0x229289[_0x03c3('0x1c')]?_0x229289['options'][_0x03c3('0x1d')]===undefined?!![]:![]:!![],'where':_0x229289[_0x03c3('0x1c')]?_0x229289[_0x03c3('0x1c')][_0x03c3('0x1e')]||null:null,'attributes':_0x229289['options']?_0x229289[_0x03c3('0x1c')][_0x03c3('0x1f')]||null:null,'limit':_0x229289[_0x03c3('0x1c')]?_0x229289[_0x03c3('0x1c')][_0x03c3('0x20')]||null:null,'include':_0x229289[_0x03c3('0x1c')]?_0x229289[_0x03c3('0x1c')][_0x03c3('0x21')]?_['map'](_0x229289[_0x03c3('0x1c')][_0x03c3('0x21')],function(_0x45a0d8){return{'model':db[_0x45a0d8[_0x03c3('0x22')]],'as':_0x45a0d8['as'],'attributes':_0x45a0d8[_0x03c3('0x1f')],'include':_0x45a0d8[_0x03c3('0x21')]?_['map'](_0x45a0d8[_0x03c3('0x21')],function(_0x454be9){return{'model':db[_0x454be9[_0x03c3('0x22')]],'as':_0x454be9['as'],'attributes':_0x454be9[_0x03c3('0x1f')],'include':_0x454be9[_0x03c3('0x21')]?_[_0x03c3('0x23')](_0x454be9['include'],function(_0x2a6f16){return{'model':db[_0x2a6f16['model']],'as':_0x2a6f16['as'],'attributes':_0x2a6f16[_0x03c3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x03c3('0x24')](function(_0x5654aa){logger[_0x03c3('0x25')](_0x03c3('0x19'),_0x229289);logger[_0x03c3('0x26')](_0x03c3('0x19'),_0x229289,JSON[_0x03c3('0x13')](_0x5654aa));_0x527d86(_0x5654aa);})[_0x03c3('0x18')](function(_0xa73e09){logger['error']('GetOpenchannelQueue',_0xa73e09[_0x03c3('0x16')],_0x229289);_0x1f69e6(_0x9083b9[_0x03c3('0x14')](0x1f4,_0xa73e09[_0x03c3('0x16')]));});});};exports[_0x03c3('0x27')]=function(_0x2b5290){var _0xd9d795=this;return new Promise(function(_0x5c36df,_0x19ffac){return db[_0x03c3('0x1a')][_0x03c3('0x28')]({'raw':_0x2b5290[_0x03c3('0x1c')]?_0x2b5290[_0x03c3('0x1c')][_0x03c3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b5290[_0x03c3('0x1c')]?_0x2b5290['options'][_0x03c3('0x1e')]||null:null,'attributes':_0x2b5290[_0x03c3('0x1c')]?_0x2b5290[_0x03c3('0x1c')][_0x03c3('0x1f')]||null:null,'include':_0x2b5290['options']?_0x2b5290['options'][_0x03c3('0x21')]?_[_0x03c3('0x23')](_0x2b5290[_0x03c3('0x1c')][_0x03c3('0x21')],function(_0x3ac8c5){return{'model':db[_0x3ac8c5[_0x03c3('0x22')]],'as':_0x3ac8c5['as'],'attributes':_0x3ac8c5[_0x03c3('0x1f')],'include':_0x3ac8c5[_0x03c3('0x21')]?_[_0x03c3('0x23')](_0x3ac8c5[_0x03c3('0x21')],function(_0x10937e){return{'model':db[_0x10937e[_0x03c3('0x22')]],'as':_0x10937e['as'],'attributes':_0x10937e[_0x03c3('0x1f')],'include':_0x10937e['include']?_['map'](_0x10937e[_0x03c3('0x21')],function(_0x3063e4){return{'model':db[_0x3063e4[_0x03c3('0x22')]],'as':_0x3063e4['as'],'attributes':_0x3063e4[_0x03c3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a1aaa){logger['info'](_0x03c3('0x27'),_0x2b5290);logger['debug'](_0x03c3('0x27'),_0x2b5290,JSON[_0x03c3('0x13')](_0x3a1aaa));_0x5c36df(_0x3a1aaa);})[_0x03c3('0x18')](function(_0x2c5ff8){logger[_0x03c3('0x14')]('ShowOpenchannelQueue',_0x2c5ff8['message'],_0x2b5290);_0x19ffac(_0xd9d795[_0x03c3('0x14')](0x1f4,_0x2c5ff8['message']));});});}; \ No newline at end of file +var _0x0dbe=['ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','options','raw','where','attributes','limit','include','model','map'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x0dbe,0xab));var _0xe0db=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x0dbe[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xe0db('0x0'));var util=require(_0xe0db('0x1'));var moment=require(_0xe0db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0db('0x3'));var db=require(_0xe0db('0x4'))['db'];var utils=require(_0xe0db('0x5'));var logger=require(_0xe0db('0x6'))(_0xe0db('0x7'));var config=require(_0xe0db('0x8'));var jayson=require(_0xe0db('0x9'));var client=jayson[_0xe0db('0xa')][_0xe0db('0xb')]({'port':0x232a});config[_0xe0db('0xc')]=_['defaults'](config[_0xe0db('0xc')],{'host':_0xe0db('0xd'),'port':0x18eb});var socket=require(_0xe0db('0xe'))(new Redis(config[_0xe0db('0xc')]));require(_0xe0db('0xf'))[_0xe0db('0x10')](socket);function respondWithRpcPromise(_0x346308,_0x34f73f,_0x123d75){return new BPromise(function(_0x1f5d80,_0x130e9b){return client[_0xe0db('0x11')](_0x346308,_0x123d75)[_0xe0db('0x12')](function(_0x3a3ddf){logger[_0xe0db('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x34f73f,_0xe0db('0x14'));logger[_0xe0db('0x15')](_0xe0db('0x16'),_0x34f73f,_0xe0db('0x14'),JSON[_0xe0db('0x17')](_0x3a3ddf));if(_0x3a3ddf[_0xe0db('0x18')]){if(_0x3a3ddf[_0xe0db('0x18')][_0xe0db('0x19')]===0x1f4){logger[_0xe0db('0x18')](_0xe0db('0x1a'),_0x34f73f,_0x3a3ddf[_0xe0db('0x18')][_0xe0db('0x1b')]);return _0x130e9b(_0x3a3ddf[_0xe0db('0x18')][_0xe0db('0x1b')]);}logger[_0xe0db('0x18')](_0xe0db('0x1a'),_0x34f73f,_0x3a3ddf[_0xe0db('0x18')][_0xe0db('0x1b')]);return _0x1f5d80(_0x3a3ddf['error']['message']);}else{logger['info'](_0xe0db('0x1a'),_0x34f73f,_0xe0db('0x14'));_0x1f5d80(_0x3a3ddf[_0xe0db('0x1c')]['message']);}})[_0xe0db('0x1d')](function(_0x563419){logger['error'](_0xe0db('0x1a'),_0x34f73f,_0x563419);_0x130e9b(_0x563419);});});}exports[_0xe0db('0x1e')]=function(_0x33b08e){var _0xc2bc7d=this;return new Promise(function(_0x3bdd70,_0xd43f2b){return db['OpenchannelQueue']['findAll']({'raw':_0x33b08e[_0xe0db('0x1f')]?_0x33b08e['options'][_0xe0db('0x20')]===undefined?!![]:![]:!![],'where':_0x33b08e['options']?_0x33b08e[_0xe0db('0x1f')][_0xe0db('0x21')]||null:null,'attributes':_0x33b08e['options']?_0x33b08e[_0xe0db('0x1f')][_0xe0db('0x22')]||null:null,'limit':_0x33b08e[_0xe0db('0x1f')]?_0x33b08e[_0xe0db('0x1f')][_0xe0db('0x23')]||null:null,'include':_0x33b08e[_0xe0db('0x1f')]?_0x33b08e[_0xe0db('0x1f')]['include']?_['map'](_0x33b08e[_0xe0db('0x1f')][_0xe0db('0x24')],function(_0x386e0c){return{'model':db[_0x386e0c[_0xe0db('0x25')]],'as':_0x386e0c['as'],'attributes':_0x386e0c['attributes'],'include':_0x386e0c[_0xe0db('0x24')]?_[_0xe0db('0x26')](_0x386e0c['include'],function(_0x2de18d){return{'model':db[_0x2de18d[_0xe0db('0x25')]],'as':_0x2de18d['as'],'attributes':_0x2de18d['attributes'],'include':_0x2de18d[_0xe0db('0x24')]?_[_0xe0db('0x26')](_0x2de18d[_0xe0db('0x24')],function(_0x537d3e){return{'model':db[_0x537d3e[_0xe0db('0x25')]],'as':_0x537d3e['as'],'attributes':_0x537d3e[_0xe0db('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe0db('0x12')](function(_0x5535bb){logger[_0xe0db('0x13')](_0xe0db('0x1e'),_0x33b08e);logger[_0xe0db('0x15')]('GetOpenchannelQueue',_0x33b08e,JSON[_0xe0db('0x17')](_0x5535bb));_0x3bdd70(_0x5535bb);})['catch'](function(_0x28c2c9){logger[_0xe0db('0x18')](_0xe0db('0x1e'),_0x28c2c9[_0xe0db('0x1b')],_0x33b08e);_0xd43f2b(_0xc2bc7d['error'](0x1f4,_0x28c2c9[_0xe0db('0x1b')]));});});};exports[_0xe0db('0x27')]=function(_0x24f050){var _0x572a3a=this;return new Promise(function(_0x2d9eae,_0x57d194){return db[_0xe0db('0x28')][_0xe0db('0x29')]({'raw':_0x24f050[_0xe0db('0x1f')]?_0x24f050['options'][_0xe0db('0x20')]===undefined?!![]:![]:!![],'where':_0x24f050[_0xe0db('0x1f')]?_0x24f050[_0xe0db('0x1f')]['where']||null:null,'attributes':_0x24f050['options']?_0x24f050[_0xe0db('0x1f')]['attributes']||null:null,'include':_0x24f050['options']?_0x24f050[_0xe0db('0x1f')]['include']?_[_0xe0db('0x26')](_0x24f050[_0xe0db('0x1f')]['include'],function(_0x420ffe){return{'model':db[_0x420ffe[_0xe0db('0x25')]],'as':_0x420ffe['as'],'attributes':_0x420ffe[_0xe0db('0x22')],'include':_0x420ffe[_0xe0db('0x24')]?_[_0xe0db('0x26')](_0x420ffe[_0xe0db('0x24')],function(_0x598fa2){return{'model':db[_0x598fa2['model']],'as':_0x598fa2['as'],'attributes':_0x598fa2[_0xe0db('0x22')],'include':_0x598fa2[_0xe0db('0x24')]?_[_0xe0db('0x26')](_0x598fa2['include'],function(_0x326dba){return{'model':db[_0x326dba[_0xe0db('0x25')]],'as':_0x326dba['as'],'attributes':_0x326dba[_0xe0db('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe0db('0x12')](function(_0x3df17a){logger[_0xe0db('0x13')]('ShowOpenchannelQueue',_0x24f050);logger[_0xe0db('0x15')]('ShowOpenchannelQueue',_0x24f050,JSON['stringify'](_0x3df17a));_0x2d9eae(_0x3df17a);})[_0xe0db('0x1d')](function(_0x364c32){logger[_0xe0db('0x18')]('ShowOpenchannelQueue',_0x364c32['message'],_0x24f050);_0x57d194(_0x572a3a['error'](0x1f4,_0x364c32[_0xe0db('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d083a8f..ab48a2f 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 _0x5cdf=['remove','update','emit','removeListener','register','length','./openchannelQueue.events'];(function(_0x7d24f5,_0x29ac6f){var _0x37bb4f=function(_0x41f0b4){while(--_0x41f0b4){_0x7d24f5['push'](_0x7d24f5['shift']());}};_0x37bb4f(++_0x29ac6f);}(_0x5cdf,0x1b1));var _0xf5cd=function(_0x32f4f5,_0x563c03){_0x32f4f5=_0x32f4f5-0x0;var _0x28e7f6=_0x5cdf[_0x32f4f5];return _0x28e7f6;};'use strict';var OpenchannelQueueEvents=require(_0xf5cd('0x0'));var events=['save',_0xf5cd('0x1'),_0xf5cd('0x2')];function createListener(_0x46644d,_0xe5f79f){return function(_0x51182c){_0xe5f79f[_0xf5cd('0x3')](_0x46644d,_0x51182c);};}function removeListener(_0x69bbdb,_0x14ea3a){return function(){OpenchannelQueueEvents[_0xf5cd('0x4')](_0x69bbdb,_0x14ea3a);};}exports[_0xf5cd('0x5')]=function(_0x1d74e0){for(var _0x24e068=0x0,_0x450034=events[_0xf5cd('0x6')];_0x24e068<_0x450034;_0x24e068++){var _0x470187=events[_0x24e068];var _0x596f57=createListener('openchannelQueue:'+_0x470187,_0x1d74e0);OpenchannelQueueEvents['on'](_0x470187,_0x596f57);}}; \ No newline at end of file +var _0x856c=['emit','register','length','openchannelQueue:','save','update'];(function(_0x2a4b56,_0x40aff4){var _0x364381=function(_0x1061af){while(--_0x1061af){_0x2a4b56['push'](_0x2a4b56['shift']());}};_0x364381(++_0x40aff4);}(_0x856c,0xfa));var _0xc856=function(_0x41610c,_0x8d5427){_0x41610c=_0x41610c-0x0;var _0x4eea3f=_0x856c[_0x41610c];return _0x4eea3f;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc856('0x0'),'remove',_0xc856('0x1')];function createListener(_0x41225b,_0x57200a){return function(_0x3df790){_0x57200a[_0xc856('0x2')](_0x41225b,_0x3df790);};}function removeListener(_0xd69404,_0x39511b){return function(){OpenchannelQueueEvents['removeListener'](_0xd69404,_0x39511b);};}exports[_0xc856('0x3')]=function(_0xf5f724){for(var _0x43caaa=0x0,_0x40779e=events[_0xc856('0x4')];_0x43caaa<_0x40779e;_0x43caaa++){var _0x2bec3d=events[_0x43caaa];var _0x59ceca=createListener(_0xc856('0x5')+_0x2bec3d,_0xf5f724);OpenchannelQueueEvents['on'](_0x2bec3d,_0x59ceca);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index d5966a7..3c20575 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 _0x55e1=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x29eafb,_0x5b3960){var _0x3c0307=function(_0x38756c){while(--_0x38756c){_0x29eafb['push'](_0x29eafb['shift']());}};_0x3c0307(++_0x5b3960);}(_0x55e1,0x172));var _0x155e=function(_0x56f2f5,_0x29601b){_0x56f2f5=_0x56f2f5-0x0;var _0x49b2fb=_0x55e1[_0x56f2f5];return _0x49b2fb;};'use strict';var multer=require(_0x155e('0x0'));var util=require(_0x155e('0x1'));var path=require(_0x155e('0x2'));var timeout=require(_0x155e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x155e('0x4'));var interaction=require(_0x155e('0x5'));var config=require(_0x155e('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x155e('0x7')]('/',auth[_0x155e('0x8')](),controller[_0x155e('0x9')]);router[_0x155e('0x7')](_0x155e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x155e('0x7')](_0x155e('0xb'),auth[_0x155e('0x8')](),controller[_0x155e('0xc')]);router[_0x155e('0xd')]('/',auth[_0x155e('0x8')](),controller[_0x155e('0xe')]);router[_0x155e('0xf')]('/:id',auth[_0x155e('0x8')](),controller[_0x155e('0x10')]);router[_0x155e('0x11')](_0x155e('0xb'),auth[_0x155e('0x8')](),controller[_0x155e('0x12')]);module[_0x155e('0x13')]=router; \ No newline at end of file +var _0x5c4b=['isAuthenticated','/describe','describe','/:id','post','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x36c482,_0x2f0a15){var _0x1f513a=function(_0x37b1df){while(--_0x37b1df){_0x36c482['push'](_0x36c482['shift']());}};_0x1f513a(++_0x2f0a15);}(_0x5c4b,0x104));var _0xb5c4=function(_0xe3c705,_0x5edb1a){_0xe3c705=_0xe3c705-0x0;var _0x57da30=_0x5c4b[_0xe3c705];return _0x57da30;};'use strict';var multer=require('multer');var util=require(_0xb5c4('0x0'));var path=require(_0xb5c4('0x1'));var timeout=require(_0xb5c4('0x2'));var express=require(_0xb5c4('0x3'));var router=express[_0xb5c4('0x4')]();var fs_extra=require(_0xb5c4('0x5'));var auth=require(_0xb5c4('0x6'));var interaction=require(_0xb5c4('0x7'));var config=require(_0xb5c4('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0xb5c4('0x9')]('/',auth[_0xb5c4('0xa')](),controller['index']);router[_0xb5c4('0x9')](_0xb5c4('0xb'),auth[_0xb5c4('0xa')](),controller[_0xb5c4('0xc')]);router[_0xb5c4('0x9')](_0xb5c4('0xd'),auth[_0xb5c4('0xa')](),controller['show']);router[_0xb5c4('0xe')]('/',auth[_0xb5c4('0xa')](),controller['create']);router[_0xb5c4('0xf')](_0xb5c4('0xd'),auth[_0xb5c4('0xa')](),controller[_0xb5c4('0x10')]);router['delete'](_0xb5c4('0xd'),auth[_0xb5c4('0xa')](),controller[_0xb5c4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index f71f773..f22d686 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 _0x91ff=['exports','STRING','DATE','moment','sequelize'];(function(_0x5d7dde,_0x2d7bd8){var _0x38b12c=function(_0x384435){while(--_0x384435){_0x5d7dde['push'](_0x5d7dde['shift']());}};_0x38b12c(++_0x2d7bd8);}(_0x91ff,0x1ac));var _0xf91f=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x91ff[_0x1e3c16];return _0x47a0c9;};'use strict';var moment=require(_0xf91f('0x0'));var Sequelize=require(_0xf91f('0x1'));module[_0xf91f('0x2')]={'uniqueid':{'type':Sequelize[_0xf91f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf91f('0x3')]},'joinAt':{'type':Sequelize[_0xf91f('0x4')]},'leaveAt':{'type':Sequelize[_0xf91f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf91f('0x4')]},'reason':{'type':Sequelize[_0xf91f('0x3')]}}; \ No newline at end of file +var _0x54ba=['exports','STRING','DATE','moment','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x54ba,0x170));var _0xa54b=function(_0x667687,_0xeb904){_0x667687=_0x667687-0x0;var _0xf5f5bb=_0x54ba[_0x667687];return _0xf5f5bb;};'use strict';var moment=require(_0xa54b('0x0'));var Sequelize=require(_0xa54b('0x1'));module[_0xa54b('0x2')]={'uniqueid':{'type':Sequelize[_0xa54b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa54b('0x3')]},'joinAt':{'type':Sequelize[_0xa54b('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa54b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa54b('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a8c03c9..f52b2ef 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 _0x82b6=['map','OpenchannelQueueReport','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','params','keys','rawAttributes','fields','includeAll','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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','save','then','destroy','error','name','send','index'];(function(_0x4c21ff,_0x384b66){var _0x5185ec=function(_0x245b5c){while(--_0x245b5c){_0x4c21ff['push'](_0x4c21ff['shift']());}};_0x5185ec(++_0x384b66);}(_0x82b6,0x161));var _0x682b=function(_0xfe9365,_0x4f9b01){_0xfe9365=_0xfe9365-0x0;var _0x419138=_0x82b6[_0xfe9365];return _0x419138;};'use strict';var emlformat=require(_0x682b('0x0'));var rimraf=require(_0x682b('0x1'));var zipdir=require(_0x682b('0x2'));var jsonpatch=require(_0x682b('0x3'));var rp=require(_0x682b('0x4'));var moment=require(_0x682b('0x5'));var BPromise=require(_0x682b('0x6'));var Mustache=require(_0x682b('0x7'));var util=require(_0x682b('0x8'));var path=require(_0x682b('0x9'));var sox=require(_0x682b('0xa'));var csv=require('to-csv');var ejs=require(_0x682b('0xb'));var fs=require('fs');var fs_extra=require(_0x682b('0xc'));var _=require(_0x682b('0xd'));var squel=require(_0x682b('0xe'));var crypto=require(_0x682b('0xf'));var jsforce=require(_0x682b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x682b('0x11'));var querystring=require(_0x682b('0x12'));var Papa=require(_0x682b('0x13'));var Redis=require(_0x682b('0x14'));var authService=require(_0x682b('0x15'));var qs=require(_0x682b('0x16'));var as=require(_0x682b('0x17'));var hardwareService=require(_0x682b('0x18'));var logger=require(_0x682b('0x19'))(_0x682b('0x1a'));var utils=require('../../config/utils');var config=require(_0x682b('0x1b'));var licenseUtil=require(_0x682b('0x1c'));var db=require(_0x682b('0x1d'))['db'];function respondWithStatusCode(_0x44c292,_0x45c76b){_0x45c76b=_0x45c76b||0xcc;return function(_0x41c4f2){if(_0x41c4f2){return _0x44c292[_0x682b('0x1e')](_0x45c76b);}return _0x44c292[_0x682b('0x1f')](_0x45c76b)[_0x682b('0x20')]();};}function respondWithResult(_0x238343,_0x5a3286){_0x5a3286=_0x5a3286||0xc8;return function(_0x346e01){if(_0x346e01){return _0x238343['status'](_0x5a3286)[_0x682b('0x21')](_0x346e01);}};}function respondWithFilteredResult(_0x463764,_0x76efa9){return function(_0x24c633){if(_0x24c633){var _0x2c394c=typeof _0x76efa9[_0x682b('0x22')]==='undefined'&&typeof _0x76efa9[_0x682b('0x23')]===_0x682b('0x24');var _0x2221fe=_0x24c633['count'];var _0x244652=_0x2c394c?0x0:_0x76efa9[_0x682b('0x22')];var _0x212f01=_0x2c394c?_0x24c633[_0x682b('0x25')]:_0x76efa9[_0x682b('0x22')]+_0x76efa9[_0x682b('0x23')];var _0x339ae5;if(_0x212f01>=_0x2221fe){_0x212f01=_0x2221fe;_0x339ae5=0xc8;}else{_0x339ae5=0xce;}_0x463764[_0x682b('0x1f')](_0x339ae5);return _0x463764[_0x682b('0x26')](_0x682b('0x27'),_0x244652+'-'+_0x212f01+'/'+_0x2221fe)[_0x682b('0x21')](_0x24c633);}return null;};}function patchUpdates(_0x45caf0){return function(_0x558c77){try{jsonpatch['apply'](_0x558c77,_0x45caf0,!![]);}catch(_0xfdfd6f){return BPromise['reject'](_0xfdfd6f);}return _0x558c77[_0x682b('0x28')]();};}function saveUpdates(_0x17f023,_0x474a9f){return function(_0x2efe1d){if(_0x2efe1d){return _0x2efe1d['update'](_0x17f023)[_0x682b('0x29')](function(_0xdc694c){return _0xdc694c;});}return null;};}function removeEntity(_0x267643,_0x2a1630){return function(_0x4df650){if(_0x4df650){return _0x4df650[_0x682b('0x2a')]()[_0x682b('0x29')](function(){_0x267643[_0x682b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16399b,_0x5db37e){return function(_0x73a67c){if(!_0x73a67c){_0x16399b[_0x682b('0x1e')](0x194);}return _0x73a67c;};}function handleError(_0x5d27e7,_0x1f68e4){_0x1f68e4=_0x1f68e4||0x1f4;return function(_0x5125af){logger[_0x682b('0x2b')](_0x5125af['stack']);if(_0x5125af[_0x682b('0x2c')]){delete _0x5125af[_0x682b('0x2c')];}_0x5d27e7[_0x682b('0x1f')](_0x1f68e4)[_0x682b('0x2d')](_0x5125af);};}exports[_0x682b('0x2e')]=function(_0x4e605a,_0x765cdd){var _0x41bf3e={},_0x49ad1b={},_0x1c4e7a={'count':0x0,'rows':[]};var _0x4cea1d=_[_0x682b('0x2f')](db[_0x682b('0x30')]['rawAttributes'],function(_0x29172c){return{'name':_0x29172c[_0x682b('0x31')],'type':_0x29172c[_0x682b('0x32')][_0x682b('0x33')]};});_0x49ad1b['model']=_[_0x682b('0x2f')](_0x4cea1d,_0x682b('0x2c'));_0x49ad1b[_0x682b('0x34')]=_['keys'](_0x4e605a[_0x682b('0x34')]);_0x49ad1b[_0x682b('0x35')]=_[_0x682b('0x36')](_0x49ad1b[_0x682b('0x37')],_0x49ad1b[_0x682b('0x34')]);_0x41bf3e[_0x682b('0x38')]=_[_0x682b('0x36')](_0x49ad1b[_0x682b('0x37')],qs['fields'](_0x4e605a[_0x682b('0x34')]['fields']));_0x41bf3e[_0x682b('0x38')]=_0x41bf3e['attributes'][_0x682b('0x39')]?_0x41bf3e['attributes']:_0x49ad1b[_0x682b('0x37')];if(!_0x4e605a[_0x682b('0x34')][_0x682b('0x3a')]('nolimit')){_0x41bf3e[_0x682b('0x23')]=qs[_0x682b('0x23')](_0x4e605a[_0x682b('0x34')][_0x682b('0x23')]);_0x41bf3e[_0x682b('0x22')]=qs['offset'](_0x4e605a[_0x682b('0x34')][_0x682b('0x22')]);}_0x41bf3e[_0x682b('0x3b')]=qs[_0x682b('0x3c')](_0x4e605a[_0x682b('0x34')]['sort']);_0x41bf3e[_0x682b('0x3d')]=qs['filters'](_['pick'](_0x4e605a[_0x682b('0x34')],_0x49ad1b['filters']),_0x4cea1d);if(_0x4e605a[_0x682b('0x34')][_0x682b('0x3e')]){_0x41bf3e[_0x682b('0x3d')]=_['merge'](_0x41bf3e[_0x682b('0x3d')],{'$or':_['map'](_0x4cea1d,function(_0x115b32){if(_0x115b32[_0x682b('0x32')]!==_0x682b('0x3f')){var _0x4d7611={};_0x4d7611[_0x115b32[_0x682b('0x2c')]]={'$like':'%'+_0x4e605a['query']['filter']+'%'};return _0x4d7611;}})});}_0x41bf3e=_[_0x682b('0x40')]({},_0x41bf3e,_0x4e605a['options']);var _0x39b2c1={'where':_0x41bf3e[_0x682b('0x3d')]};return db[_0x682b('0x30')][_0x682b('0x25')](_0x39b2c1)['then'](function(_0x4efcf5){_0x1c4e7a['count']=_0x4efcf5;if(_0x4e605a[_0x682b('0x34')]['includeAll']){_0x41bf3e[_0x682b('0x41')]=[{'all':!![]}];}return db[_0x682b('0x30')][_0x682b('0x42')](_0x41bf3e);})[_0x682b('0x29')](function(_0x7bd162){_0x1c4e7a[_0x682b('0x43')]=_0x7bd162;return _0x1c4e7a;})[_0x682b('0x29')](respondWithFilteredResult(_0x765cdd,_0x41bf3e))[_0x682b('0x44')](handleError(_0x765cdd,null));};exports['show']=function(_0x31c585,_0x20b4c2){var _0x1df59d={'raw':!![],'where':{'id':_0x31c585[_0x682b('0x45')]['id']}},_0x1bc5ab={};_0x1bc5ab[_0x682b('0x37')]=_[_0x682b('0x46')](db[_0x682b('0x30')][_0x682b('0x47')]);_0x1bc5ab[_0x682b('0x34')]=_[_0x682b('0x46')](_0x31c585[_0x682b('0x34')]);_0x1bc5ab[_0x682b('0x35')]=_[_0x682b('0x36')](_0x1bc5ab[_0x682b('0x37')],_0x1bc5ab[_0x682b('0x34')]);_0x1df59d[_0x682b('0x38')]=_['intersection'](_0x1bc5ab['model'],qs['fields'](_0x31c585[_0x682b('0x34')][_0x682b('0x48')]));_0x1df59d[_0x682b('0x38')]=_0x1df59d[_0x682b('0x38')]['length']?_0x1df59d[_0x682b('0x38')]:_0x1bc5ab[_0x682b('0x37')];if(_0x31c585[_0x682b('0x34')][_0x682b('0x49')]){_0x1df59d[_0x682b('0x41')]=[{'all':!![]}];}_0x1df59d=_['merge']({},_0x1df59d,_0x31c585[_0x682b('0x4a')]);return db[_0x682b('0x30')]['find'](_0x1df59d)['then'](handleEntityNotFound(_0x20b4c2,null))['then'](respondWithResult(_0x20b4c2,null))[_0x682b('0x44')](handleError(_0x20b4c2,null));};exports[_0x682b('0x4b')]=function(_0x3bac0e,_0x5b70f3){return db['OpenchannelQueueReport'][_0x682b('0x4b')](_0x3bac0e[_0x682b('0x4c')],{})[_0x682b('0x29')](respondWithResult(_0x5b70f3,0xc9))[_0x682b('0x44')](handleError(_0x5b70f3,null));};exports[_0x682b('0x4d')]=function(_0x3e72d2,_0x37d79b){if(_0x3e72d2[_0x682b('0x4c')]['id']){delete _0x3e72d2[_0x682b('0x4c')]['id'];}return db[_0x682b('0x30')][_0x682b('0x4e')]({'where':{'id':_0x3e72d2[_0x682b('0x45')]['id']}})[_0x682b('0x29')](handleEntityNotFound(_0x37d79b,null))[_0x682b('0x29')](saveUpdates(_0x3e72d2[_0x682b('0x4c')],null))[_0x682b('0x29')](respondWithResult(_0x37d79b,null))[_0x682b('0x44')](handleError(_0x37d79b,null));};exports[_0x682b('0x2a')]=function(_0x12721c,_0x488f48){return db[_0x682b('0x30')][_0x682b('0x4e')]({'where':{'id':_0x12721c[_0x682b('0x45')]['id']}})[_0x682b('0x29')](handleEntityNotFound(_0x488f48,null))[_0x682b('0x29')](removeEntity(_0x488f48,null))[_0x682b('0x44')](handleError(_0x488f48,null));};exports[_0x682b('0x4f')]=function(_0x3abd92,_0x3e55fc){return db[_0x682b('0x30')]['describe']()[_0x682b('0x29')](respondWithResult(_0x3e55fc,null))[_0x682b('0x44')](handleError(_0x3e55fc,null));}; \ No newline at end of file +var _0x82ab=['count','set','Content-Range','apply','save','update','then','end','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelQueueReport','include','findAll','rows','catch','rawAttributes','includeAll','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x57850b,_0x299d84){var _0xecdbbf=function(_0x346829){while(--_0x346829){_0x57850b['push'](_0x57850b['shift']());}};_0xecdbbf(++_0x299d84);}(_0x82ab,0x197));var _0xb82a=function(_0x54a229,_0x479dd1){_0x54a229=_0x54a229-0x0;var _0x36232e=_0x82ab[_0x54a229];return _0x36232e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb82a('0x0'));var zipdir=require(_0xb82a('0x1'));var jsonpatch=require(_0xb82a('0x2'));var rp=require(_0xb82a('0x3'));var moment=require(_0xb82a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb82a('0x5'));var util=require(_0xb82a('0x6'));var path=require(_0xb82a('0x7'));var sox=require(_0xb82a('0x8'));var csv=require('to-csv');var ejs=require(_0xb82a('0x9'));var fs=require('fs');var fs_extra=require(_0xb82a('0xa'));var _=require(_0xb82a('0xb'));var squel=require(_0xb82a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb82a('0xd'));var toCsv=require(_0xb82a('0xe'));var querystring=require('querystring');var Papa=require(_0xb82a('0xf'));var Redis=require(_0xb82a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb82a('0x11'));var as=require(_0xb82a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb82a('0x13'))(_0xb82a('0x14'));var utils=require(_0xb82a('0x15'));var config=require(_0xb82a('0x16'));var licenseUtil=require(_0xb82a('0x17'));var db=require(_0xb82a('0x18'))['db'];function respondWithStatusCode(_0x4c8216,_0x238276){_0x238276=_0x238276||0xcc;return function(_0x403d57){if(_0x403d57){return _0x4c8216[_0xb82a('0x19')](_0x238276);}return _0x4c8216[_0xb82a('0x1a')](_0x238276)['end']();};}function respondWithResult(_0x5f5985,_0x25d016){_0x25d016=_0x25d016||0xc8;return function(_0x1003ec){if(_0x1003ec){return _0x5f5985[_0xb82a('0x1a')](_0x25d016)[_0xb82a('0x1b')](_0x1003ec);}};}function respondWithFilteredResult(_0x42e9ea,_0x5ebdc3){return function(_0x1b2f44){if(_0x1b2f44){var _0x120869=typeof _0x5ebdc3[_0xb82a('0x1c')]===_0xb82a('0x1d')&&typeof _0x5ebdc3[_0xb82a('0x1e')]===_0xb82a('0x1d');var _0x4a1d20=_0x1b2f44['count'];var _0x37047f=_0x120869?0x0:_0x5ebdc3[_0xb82a('0x1c')];var _0x5d9f8d=_0x120869?_0x1b2f44[_0xb82a('0x1f')]:_0x5ebdc3[_0xb82a('0x1c')]+_0x5ebdc3['limit'];var _0x55e391;if(_0x5d9f8d>=_0x4a1d20){_0x5d9f8d=_0x4a1d20;_0x55e391=0xc8;}else{_0x55e391=0xce;}_0x42e9ea[_0xb82a('0x1a')](_0x55e391);return _0x42e9ea[_0xb82a('0x20')](_0xb82a('0x21'),_0x37047f+'-'+_0x5d9f8d+'/'+_0x4a1d20)[_0xb82a('0x1b')](_0x1b2f44);}return null;};}function patchUpdates(_0x482be8){return function(_0x59ee53){try{jsonpatch[_0xb82a('0x22')](_0x59ee53,_0x482be8,!![]);}catch(_0x54595a){return BPromise['reject'](_0x54595a);}return _0x59ee53[_0xb82a('0x23')]();};}function saveUpdates(_0x48d7cd,_0x380ef7){return function(_0x2bb5d5){if(_0x2bb5d5){return _0x2bb5d5[_0xb82a('0x24')](_0x48d7cd)['then'](function(_0x3c51d9){return _0x3c51d9;});}return null;};}function removeEntity(_0x52a928,_0x5228a6){return function(_0x53d9a3){if(_0x53d9a3){return _0x53d9a3['destroy']()[_0xb82a('0x25')](function(){_0x52a928['status'](0xcc)[_0xb82a('0x26')]();});}};}function handleEntityNotFound(_0x3a407c,_0x193185){return function(_0x212d2a){if(!_0x212d2a){_0x3a407c[_0xb82a('0x19')](0x194);}return _0x212d2a;};}function handleError(_0x5c331a,_0x20aac2){_0x20aac2=_0x20aac2||0x1f4;return function(_0x24efe2){logger['error'](_0x24efe2[_0xb82a('0x27')]);if(_0x24efe2[_0xb82a('0x28')]){delete _0x24efe2['name'];}_0x5c331a['status'](_0x20aac2)[_0xb82a('0x29')](_0x24efe2);};}exports['index']=function(_0x4d3a35,_0x246e82){var _0x84d453={},_0x4b028b={},_0x501f20={'count':0x0,'rows':[]};var _0x43027b=_[_0xb82a('0x2a')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x133bff){return{'name':_0x133bff[_0xb82a('0x2b')],'type':_0x133bff[_0xb82a('0x2c')]['key']};});_0x4b028b[_0xb82a('0x2d')]=_[_0xb82a('0x2a')](_0x43027b,_0xb82a('0x28'));_0x4b028b[_0xb82a('0x2e')]=_[_0xb82a('0x2f')](_0x4d3a35['query']);_0x4b028b[_0xb82a('0x30')]=_[_0xb82a('0x31')](_0x4b028b['model'],_0x4b028b[_0xb82a('0x2e')]);_0x84d453[_0xb82a('0x32')]=_[_0xb82a('0x31')](_0x4b028b[_0xb82a('0x2d')],qs[_0xb82a('0x33')](_0x4d3a35[_0xb82a('0x2e')][_0xb82a('0x33')]));_0x84d453[_0xb82a('0x32')]=_0x84d453[_0xb82a('0x32')][_0xb82a('0x34')]?_0x84d453[_0xb82a('0x32')]:_0x4b028b['model'];if(!_0x4d3a35[_0xb82a('0x2e')][_0xb82a('0x35')]('nolimit')){_0x84d453[_0xb82a('0x1e')]=qs[_0xb82a('0x1e')](_0x4d3a35[_0xb82a('0x2e')]['limit']);_0x84d453['offset']=qs[_0xb82a('0x1c')](_0x4d3a35[_0xb82a('0x2e')][_0xb82a('0x1c')]);}_0x84d453['order']=qs['sort'](_0x4d3a35[_0xb82a('0x2e')][_0xb82a('0x36')]);_0x84d453[_0xb82a('0x37')]=qs['filters'](_[_0xb82a('0x38')](_0x4d3a35[_0xb82a('0x2e')],_0x4b028b['filters']),_0x43027b);if(_0x4d3a35[_0xb82a('0x2e')]['filter']){_0x84d453['where']=_[_0xb82a('0x39')](_0x84d453[_0xb82a('0x37')],{'$or':_[_0xb82a('0x2a')](_0x43027b,function(_0x33e2e1){if(_0x33e2e1['type']!==_0xb82a('0x3a')){var _0x501fda={};_0x501fda[_0x33e2e1[_0xb82a('0x28')]]={'$like':'%'+_0x4d3a35['query'][_0xb82a('0x3b')]+'%'};return _0x501fda;}})});}_0x84d453=_[_0xb82a('0x39')]({},_0x84d453,_0x4d3a35[_0xb82a('0x3c')]);var _0x166c9c={'where':_0x84d453[_0xb82a('0x37')]};return db[_0xb82a('0x3d')][_0xb82a('0x1f')](_0x166c9c)['then'](function(_0x2eeaf9){_0x501f20[_0xb82a('0x1f')]=_0x2eeaf9;if(_0x4d3a35['query']['includeAll']){_0x84d453[_0xb82a('0x3e')]=[{'all':!![]}];}return db[_0xb82a('0x3d')][_0xb82a('0x3f')](_0x84d453);})[_0xb82a('0x25')](function(_0x5bec79){_0x501f20[_0xb82a('0x40')]=_0x5bec79;return _0x501f20;})[_0xb82a('0x25')](respondWithFilteredResult(_0x246e82,_0x84d453))[_0xb82a('0x41')](handleError(_0x246e82,null));};exports['show']=function(_0x2bdcc2,_0x15c3a5){var _0xe62c1e={'raw':!![],'where':{'id':_0x2bdcc2['params']['id']}},_0x44f222={};_0x44f222['model']=_[_0xb82a('0x2f')](db['OpenchannelQueueReport'][_0xb82a('0x42')]);_0x44f222[_0xb82a('0x2e')]=_['keys'](_0x2bdcc2[_0xb82a('0x2e')]);_0x44f222[_0xb82a('0x30')]=_[_0xb82a('0x31')](_0x44f222['model'],_0x44f222['query']);_0xe62c1e[_0xb82a('0x32')]=_[_0xb82a('0x31')](_0x44f222[_0xb82a('0x2d')],qs[_0xb82a('0x33')](_0x2bdcc2[_0xb82a('0x2e')][_0xb82a('0x33')]));_0xe62c1e[_0xb82a('0x32')]=_0xe62c1e['attributes'][_0xb82a('0x34')]?_0xe62c1e[_0xb82a('0x32')]:_0x44f222[_0xb82a('0x2d')];if(_0x2bdcc2[_0xb82a('0x2e')][_0xb82a('0x43')]){_0xe62c1e[_0xb82a('0x3e')]=[{'all':!![]}];}_0xe62c1e=_[_0xb82a('0x39')]({},_0xe62c1e,_0x2bdcc2['options']);return db[_0xb82a('0x3d')]['find'](_0xe62c1e)[_0xb82a('0x25')](handleEntityNotFound(_0x15c3a5,null))['then'](respondWithResult(_0x15c3a5,null))[_0xb82a('0x41')](handleError(_0x15c3a5,null));};exports[_0xb82a('0x44')]=function(_0x3f7fac,_0x544de3){return db['OpenchannelQueueReport'][_0xb82a('0x44')](_0x3f7fac['body'],{})['then'](respondWithResult(_0x544de3,0xc9))[_0xb82a('0x41')](handleError(_0x544de3,null));};exports[_0xb82a('0x24')]=function(_0x3a1833,_0x4a7687){if(_0x3a1833[_0xb82a('0x45')]['id']){delete _0x3a1833[_0xb82a('0x45')]['id'];}return db[_0xb82a('0x3d')][_0xb82a('0x46')]({'where':{'id':_0x3a1833['params']['id']}})['then'](handleEntityNotFound(_0x4a7687,null))[_0xb82a('0x25')](saveUpdates(_0x3a1833[_0xb82a('0x45')],null))[_0xb82a('0x25')](respondWithResult(_0x4a7687,null))[_0xb82a('0x41')](handleError(_0x4a7687,null));};exports[_0xb82a('0x47')]=function(_0x3451fc,_0x12d685){return db[_0xb82a('0x3d')][_0xb82a('0x46')]({'where':{'id':_0x3451fc['params']['id']}})[_0xb82a('0x25')](handleEntityNotFound(_0x12d685,null))[_0xb82a('0x25')](removeEntity(_0x12d685,null))['catch'](handleError(_0x12d685,null));};exports['describe']=function(_0x10479a,_0x4c5b27){return db[_0xb82a('0x3d')][_0xb82a('0x48')]()[_0xb82a('0x25')](respondWithResult(_0x4c5b27,null))[_0xb82a('0x41')](handleError(_0x4c5b27,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f18aa71..62b7ce1 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(_0x55d466,_0x12d67c){var _0x187e0a=function(_0x3f3689){while(--_0x3f3689){_0x55d466['push'](_0x55d466['shift']());}};_0x187e0a(++_0x12d67c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x5fc3[_0x377a6e];return _0x37f751;};'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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x16e2e7,_0x3878e3){var _0x21cfbe=function(_0xbb4edb){while(--_0xbb4edb){_0x16e2e7['push'](_0x16e2e7['shift']());}};_0x21cfbe(++_0x3878e3);}(_0x7a54,0x106));var _0x47a5=function(_0x2fc36a,_0x4af1eb){_0x2fc36a=_0x2fc36a-0x0;var _0x51624f=_0x7a54[_0x2fc36a];return _0x51624f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ce5d3dc..68a1490 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 _0x0447=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','raw','then','UpdateOpenchannelQueueReport','update','body','options','where','attributes','limit','catch','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0447,0x8b));var _0x7044=function(_0x3a3a6a,_0x5eb6a9){_0x3a3a6a=_0x3a3a6a-0x0;var _0xa89294=_0x0447[_0x3a3a6a];return _0xa89294;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rs=require(_0x7044('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7044('0x5'))['db'];var utils=require(_0x7044('0x6'));var logger=require(_0x7044('0x7'))(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require(_0x7044('0xa'));var client=jayson[_0x7044('0xb')][_0x7044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b8cb,_0x51de50,_0x72d341){return new BPromise(function(_0x42d53b,_0x2a2b36){return client[_0x7044('0xd')](_0x66b8cb,_0x72d341)['then'](function(_0x41616d){logger[_0x7044('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x51de50,_0x7044('0xf'));logger[_0x7044('0x10')](_0x7044('0x11'),_0x51de50,_0x7044('0xf'),JSON['stringify'](_0x41616d));if(_0x41616d[_0x7044('0x12')]){if(_0x41616d['error']['code']===0x1f4){logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')][_0x7044('0x14')]);return _0x2a2b36(_0x41616d[_0x7044('0x12')]['message']);}logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')]['message']);return _0x42d53b(_0x41616d['error'][_0x7044('0x14')]);}else{logger[_0x7044('0xe')](_0x7044('0x13'),_0x51de50,_0x7044('0xf'));_0x42d53b(_0x41616d[_0x7044('0x15')][_0x7044('0x14')]);}})['catch'](function(_0xdae8a){logger[_0x7044('0x12')](_0x7044('0x13'),_0x51de50,_0xdae8a);_0x2a2b36(_0xdae8a);});});}exports[_0x7044('0x16')]=function(_0x219486){var _0x3f373c=this;return new Promise(function(_0x4df89b,_0x1f300e){return db[_0x7044('0x17')][_0x7044('0x18')](_0x219486['body'],{'raw':_0x219486['options']?_0x219486['options'][_0x7044('0x19')]===undefined?!![]:![]:!![]})[_0x7044('0x1a')](function(_0x2c5dcb){logger[_0x7044('0xe')](_0x7044('0x16'),_0x219486);logger['debug'](_0x7044('0x16'),_0x219486,JSON['stringify'](_0x2c5dcb));_0x4df89b(_0x2c5dcb);})['catch'](function(_0x3db88b){logger[_0x7044('0x12')](_0x7044('0x16'),_0x3db88b[_0x7044('0x14')],_0x219486);_0x1f300e(_0x3f373c[_0x7044('0x12')](0x1f4,_0x3db88b[_0x7044('0x14')]));});});};exports[_0x7044('0x1b')]=function(_0x9452a1){var _0x4271b5=this;return new Promise(function(_0x5e2c9a,_0x5d7d8a){return db[_0x7044('0x17')][_0x7044('0x1c')](_0x9452a1[_0x7044('0x1d')],{'raw':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x1f')]||null:null,'attributes':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x20')]||null:null,'limit':_0x9452a1['options']?_0x9452a1[_0x7044('0x1e')][_0x7044('0x21')]||null:null})[_0x7044('0x1a')](function(_0x1a75ff){logger['info'](_0x7044('0x1b'),_0x9452a1);logger['debug']('UpdateOpenchannelQueueReport',_0x9452a1,JSON['stringify'](_0x1a75ff));_0x5e2c9a(_0x1a75ff);})[_0x7044('0x22')](function(_0x55ea91){logger[_0x7044('0x12')](_0x7044('0x1b'),_0x55ea91['message'],_0x9452a1);_0x5d7d8a(_0x4271b5['error'](0x1f4,_0x55ea91[_0x7044('0x14')]));});});}; \ No newline at end of file +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(_0x30c57e,_0x294ea7){var _0xb9618c=function(_0x399319){while(--_0x399319){_0x30c57e['push'](_0x30c57e['shift']());}};_0xb9618c(++_0x294ea7);}(_0xd290,0x165));var _0x0d29=function(_0x16a79e,_0x56820a){_0x16a79e=_0x16a79e-0x0;var _0x596f3d=_0xd290[_0x16a79e];return _0x596f3d;};'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 diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cfe631b..98ad5e0 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 _0x796e=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4511ce,_0x18592c){var _0x474df1=function(_0x33edbb){while(--_0x33edbb){_0x4511ce['push'](_0x4511ce['shift']());}};_0x474df1(++_0x18592c);}(_0x796e,0xb5));var _0xe796=function(_0x547194,_0x2910cc){_0x547194=_0x547194-0x0;var _0x24658b=_0x796e[_0x547194];return _0x24658b;};'use strict';var multer=require(_0xe796('0x0'));var util=require(_0xe796('0x1'));var path=require('path');var timeout=require(_0xe796('0x2'));var express=require(_0xe796('0x3'));var router=express[_0xe796('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe796('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xe796('0x6')]('/',auth[_0xe796('0x7')](),controller[_0xe796('0x8')]);router[_0xe796('0x6')](_0xe796('0x9'),auth[_0xe796('0x7')](),controller[_0xe796('0xa')]);router[_0xe796('0x6')](_0xe796('0xb'),auth[_0xe796('0x7')](),controller[_0xe796('0xc')]);router[_0xe796('0xd')]('/',auth[_0xe796('0x7')](),controller[_0xe796('0xe')]);router[_0xe796('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe796('0x10')]);router['delete'](_0xe796('0xb'),auth[_0xe796('0x7')](),controller[_0xe796('0x11')]);module[_0xe796('0x12')]=router; \ No newline at end of file +var _0x5f97=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','put','update','delete','exports','multer','util'];(function(_0x120d51,_0x3fbb18){var _0x26126e=function(_0xd02ff7){while(--_0xd02ff7){_0x120d51['push'](_0x120d51['shift']());}};_0x26126e(++_0x3fbb18);}(_0x5f97,0x139));var _0x75f9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f97[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x75f9('0x0'));var util=require(_0x75f9('0x1'));var path=require(_0x75f9('0x2'));var timeout=require(_0x75f9('0x3'));var express=require(_0x75f9('0x4'));var router=express[_0x75f9('0x5')]();var fs_extra=require(_0x75f9('0x6'));var auth=require(_0x75f9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x75f9('0x8'));var controller=require(_0x75f9('0x9'));router[_0x75f9('0xa')]('/',auth['isAuthenticated'](),controller[_0x75f9('0xb')]);router[_0x75f9('0xa')](_0x75f9('0xc'),auth['isAuthenticated'](),controller[_0x75f9('0xd')]);router[_0x75f9('0xa')](_0x75f9('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x75f9('0xf')](),controller[_0x75f9('0x10')]);router[_0x75f9('0x11')](_0x75f9('0xe'),auth['isAuthenticated'](),controller[_0x75f9('0x12')]);router[_0x75f9('0x13')]('/:id',auth[_0x75f9('0xf')](),controller['destroy']);module[_0x75f9('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4b8b493..fd6a35e 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x57eefb,_0x201f49){var _0xb764b9=function(_0xbb831){while(--_0xbb831){_0x57eefb['push'](_0x57eefb['shift']());}};_0xb764b9(++_0x201f49);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x4b84[_0x4df6f9];return _0x4b1a73;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5cb106,_0x5cba2a){var _0x29509b=function(_0x16dbc1){while(--_0x16dbc1){_0x5cb106['push'](_0x5cb106['shift']());}};_0x29509b(++_0x5cba2a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xcb91[_0x126f47];return _0x49508a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 737f926..d23a28e 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 _0x5d3f=['rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport'];(function(_0x20f648,_0x270e70){var _0x30547b=function(_0x5b926b){while(--_0x5b926b){_0x20f648['push'](_0x20f648['shift']());}};_0x30547b(++_0x270e70);}(_0x5d3f,0x18d));var _0xf5d3=function(_0x48bae5,_0x2030c6){_0x48bae5=_0x48bae5-0x0;var _0x2df98f=_0x5d3f[_0x48bae5];return _0x2df98f;};'use strict';var emlformat=require(_0xf5d3('0x0'));var rimraf=require(_0xf5d3('0x1'));var zipdir=require(_0xf5d3('0x2'));var jsonpatch=require(_0xf5d3('0x3'));var rp=require(_0xf5d3('0x4'));var moment=require(_0xf5d3('0x5'));var BPromise=require(_0xf5d3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5d3('0x7'));var sox=require(_0xf5d3('0x8'));var csv=require('to-csv');var ejs=require(_0xf5d3('0x9'));var fs=require('fs');var fs_extra=require(_0xf5d3('0xa'));var _=require(_0xf5d3('0xb'));var squel=require(_0xf5d3('0xc'));var crypto=require(_0xf5d3('0xd'));var jsforce=require(_0xf5d3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf5d3('0xf'));var querystring=require(_0xf5d3('0x10'));var Papa=require(_0xf5d3('0x11'));var Redis=require(_0xf5d3('0x12'));var authService=require(_0xf5d3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf5d3('0x14'));var hardwareService=require(_0xf5d3('0x15'));var logger=require(_0xf5d3('0x16'))(_0xf5d3('0x17'));var utils=require('../../config/utils');var config=require(_0xf5d3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5d3('0x19'))['db'];function respondWithStatusCode(_0xc35b71,_0x2da491){_0x2da491=_0x2da491||0xcc;return function(_0x453893){if(_0x453893){return _0xc35b71[_0xf5d3('0x1a')](_0x2da491);}return _0xc35b71[_0xf5d3('0x1b')](_0x2da491)[_0xf5d3('0x1c')]();};}function respondWithResult(_0x22133f,_0x25aca6){_0x25aca6=_0x25aca6||0xc8;return function(_0x2371df){if(_0x2371df){return _0x22133f[_0xf5d3('0x1b')](_0x25aca6)[_0xf5d3('0x1d')](_0x2371df);}};}function respondWithFilteredResult(_0x23fa52,_0x330bd3){return function(_0x5e9fe7){if(_0x5e9fe7){var _0x4ef2c6=typeof _0x330bd3['offset']===_0xf5d3('0x1e')&&typeof _0x330bd3[_0xf5d3('0x1f')]===_0xf5d3('0x1e');var _0x3cf0be=_0x5e9fe7[_0xf5d3('0x20')];var _0x541490=_0x4ef2c6?0x0:_0x330bd3[_0xf5d3('0x21')];var _0x36b75e=_0x4ef2c6?_0x5e9fe7[_0xf5d3('0x20')]:_0x330bd3[_0xf5d3('0x21')]+_0x330bd3[_0xf5d3('0x1f')];var _0x1fad0c;if(_0x36b75e>=_0x3cf0be){_0x36b75e=_0x3cf0be;_0x1fad0c=0xc8;}else{_0x1fad0c=0xce;}_0x23fa52[_0xf5d3('0x1b')](_0x1fad0c);return _0x23fa52[_0xf5d3('0x22')](_0xf5d3('0x23'),_0x541490+'-'+_0x36b75e+'/'+_0x3cf0be)[_0xf5d3('0x1d')](_0x5e9fe7);}return null;};}function patchUpdates(_0x9a320a){return function(_0x4cc200){try{jsonpatch[_0xf5d3('0x24')](_0x4cc200,_0x9a320a,!![]);}catch(_0x2a9381){return BPromise[_0xf5d3('0x25')](_0x2a9381);}return _0x4cc200['save']();};}function saveUpdates(_0xba0a8d,_0x39da27){return function(_0xdbe75d){if(_0xdbe75d){return _0xdbe75d[_0xf5d3('0x26')](_0xba0a8d)[_0xf5d3('0x27')](function(_0x3727ad){return _0x3727ad;});}return null;};}function removeEntity(_0x3e9db9,_0x53f323){return function(_0x2bf120){if(_0x2bf120){return _0x2bf120[_0xf5d3('0x28')]()[_0xf5d3('0x27')](function(){_0x3e9db9[_0xf5d3('0x1b')](0xcc)[_0xf5d3('0x1c')]();});}};}function handleEntityNotFound(_0x4432c8,_0xc78364){return function(_0x111041){if(!_0x111041){_0x4432c8['sendStatus'](0x194);}return _0x111041;};}function handleError(_0x46fc0c,_0x2e5667){_0x2e5667=_0x2e5667||0x1f4;return function(_0x35c034){logger[_0xf5d3('0x29')](_0x35c034[_0xf5d3('0x2a')]);if(_0x35c034[_0xf5d3('0x2b')]){delete _0x35c034[_0xf5d3('0x2b')];}_0x46fc0c[_0xf5d3('0x1b')](_0x2e5667)[_0xf5d3('0x2c')](_0x35c034);};}exports[_0xf5d3('0x2d')]=function(_0xaecf37,_0x37d244){var _0x47adbb={},_0x3c1c75={},_0x23f14a={'count':0x0,'rows':[]};var _0xe4c284=_['map'](db[_0xf5d3('0x2e')][_0xf5d3('0x2f')],function(_0x5df9ae){return{'name':_0x5df9ae['fieldName'],'type':_0x5df9ae[_0xf5d3('0x30')]['key']};});_0x3c1c75[_0xf5d3('0x31')]=_['map'](_0xe4c284,_0xf5d3('0x2b'));_0x3c1c75[_0xf5d3('0x32')]=_[_0xf5d3('0x33')](_0xaecf37[_0xf5d3('0x32')]);_0x3c1c75[_0xf5d3('0x34')]=_[_0xf5d3('0x35')](_0x3c1c75[_0xf5d3('0x31')],_0x3c1c75[_0xf5d3('0x32')]);_0x47adbb['attributes']=_[_0xf5d3('0x35')](_0x3c1c75['model'],qs[_0xf5d3('0x36')](_0xaecf37[_0xf5d3('0x32')]['fields']));_0x47adbb['attributes']=_0x47adbb['attributes']['length']?_0x47adbb[_0xf5d3('0x37')]:_0x3c1c75[_0xf5d3('0x31')];if(!_0xaecf37[_0xf5d3('0x32')]['hasOwnProperty'](_0xf5d3('0x38'))){_0x47adbb[_0xf5d3('0x1f')]=qs[_0xf5d3('0x1f')](_0xaecf37[_0xf5d3('0x32')][_0xf5d3('0x1f')]);_0x47adbb[_0xf5d3('0x21')]=qs[_0xf5d3('0x21')](_0xaecf37[_0xf5d3('0x32')][_0xf5d3('0x21')]);}_0x47adbb['order']=qs['sort'](_0xaecf37['query'][_0xf5d3('0x39')]);_0x47adbb[_0xf5d3('0x3a')]=qs['filters'](_[_0xf5d3('0x3b')](_0xaecf37[_0xf5d3('0x32')],_0x3c1c75[_0xf5d3('0x34')]),_0xe4c284);if(_0xaecf37['query'][_0xf5d3('0x3c')]){_0x47adbb[_0xf5d3('0x3a')]=_['merge'](_0x47adbb[_0xf5d3('0x3a')],{'$or':_['map'](_0xe4c284,function(_0x1397c9){if(_0x1397c9[_0xf5d3('0x30')]!==_0xf5d3('0x3d')){var _0x208130={};_0x208130[_0x1397c9[_0xf5d3('0x2b')]]={'$like':'%'+_0xaecf37[_0xf5d3('0x32')][_0xf5d3('0x3c')]+'%'};return _0x208130;}})});}_0x47adbb=_[_0xf5d3('0x3e')]({},_0x47adbb,_0xaecf37[_0xf5d3('0x3f')]);var _0x4fbcdf={'where':_0x47adbb[_0xf5d3('0x3a')]};return db['OpenchannelTransferReport']['count'](_0x4fbcdf)[_0xf5d3('0x27')](function(_0x32e77b){_0x23f14a[_0xf5d3('0x20')]=_0x32e77b;if(_0xaecf37[_0xf5d3('0x32')]['includeAll']){_0x47adbb[_0xf5d3('0x40')]=[{'all':!![]}];}return db[_0xf5d3('0x2e')][_0xf5d3('0x41')](_0x47adbb);})['then'](function(_0x30564e){_0x23f14a[_0xf5d3('0x42')]=_0x30564e;return _0x23f14a;})['then'](respondWithFilteredResult(_0x37d244,_0x47adbb))['catch'](handleError(_0x37d244,null));};exports['show']=function(_0x3453b9,_0x38455b){var _0x2af703={'raw':!![],'where':{'id':_0x3453b9['params']['id']}},_0x2ed511={};_0x2ed511[_0xf5d3('0x31')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x2ed511[_0xf5d3('0x32')]=_[_0xf5d3('0x33')](_0x3453b9[_0xf5d3('0x32')]);_0x2ed511[_0xf5d3('0x34')]=_[_0xf5d3('0x35')](_0x2ed511['model'],_0x2ed511[_0xf5d3('0x32')]);_0x2af703[_0xf5d3('0x37')]=_[_0xf5d3('0x35')](_0x2ed511[_0xf5d3('0x31')],qs[_0xf5d3('0x36')](_0x3453b9[_0xf5d3('0x32')][_0xf5d3('0x36')]));_0x2af703[_0xf5d3('0x37')]=_0x2af703[_0xf5d3('0x37')]['length']?_0x2af703['attributes']:_0x2ed511[_0xf5d3('0x31')];if(_0x3453b9[_0xf5d3('0x32')][_0xf5d3('0x43')]){_0x2af703['include']=[{'all':!![]}];}_0x2af703=_[_0xf5d3('0x3e')]({},_0x2af703,_0x3453b9[_0xf5d3('0x3f')]);return db[_0xf5d3('0x2e')][_0xf5d3('0x44')](_0x2af703)[_0xf5d3('0x27')](handleEntityNotFound(_0x38455b,null))[_0xf5d3('0x27')](respondWithResult(_0x38455b,null))[_0xf5d3('0x45')](handleError(_0x38455b,null));};exports['create']=function(_0xb90ca2,_0x3352c3){return db['OpenchannelTransferReport'][_0xf5d3('0x46')](_0xb90ca2[_0xf5d3('0x47')],{})[_0xf5d3('0x27')](respondWithResult(_0x3352c3,0xc9))['catch'](handleError(_0x3352c3,null));};exports[_0xf5d3('0x26')]=function(_0x11a45e,_0x311a3d){if(_0x11a45e[_0xf5d3('0x47')]['id']){delete _0x11a45e[_0xf5d3('0x47')]['id'];}return db[_0xf5d3('0x2e')][_0xf5d3('0x44')]({'where':{'id':_0x11a45e[_0xf5d3('0x48')]['id']}})[_0xf5d3('0x27')](handleEntityNotFound(_0x311a3d,null))[_0xf5d3('0x27')](saveUpdates(_0x11a45e[_0xf5d3('0x47')],null))[_0xf5d3('0x27')](respondWithResult(_0x311a3d,null))[_0xf5d3('0x45')](handleError(_0x311a3d,null));};exports[_0xf5d3('0x28')]=function(_0x5719d8,_0x4a9698){return db[_0xf5d3('0x2e')][_0xf5d3('0x44')]({'where':{'id':_0x5719d8[_0xf5d3('0x48')]['id']}})[_0xf5d3('0x27')](handleEntityNotFound(_0x4a9698,null))[_0xf5d3('0x27')](removeEntity(_0x4a9698,null))['catch'](handleError(_0x4a9698,null));};exports[_0xf5d3('0x49')]=function(_0x42ebc,_0x3bae40){return db[_0xf5d3('0x2e')]['describe']()[_0xf5d3('0x27')](respondWithResult(_0x3bae40,null))[_0xf5d3('0x45')](handleError(_0x3bae40,null));}; \ No newline at end of file +var _0x99e3=['rimraf','zip-dir','moment','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','update','describe','eml-format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x99e3,0x95));var _0x399e=function(_0x1b8045,_0x28b38f){_0x1b8045=_0x1b8045-0x0;var _0x59e918=_0x99e3[_0x1b8045];return _0x59e918;};'use strict';var emlformat=require(_0x399e('0x0'));var rimraf=require(_0x399e('0x1'));var zipdir=require(_0x399e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x399e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x399e('0x4'));var path=require(_0x399e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x399e('0x6'));var fs=require('fs');var fs_extra=require(_0x399e('0x7'));var _=require(_0x399e('0x8'));var squel=require(_0x399e('0x9'));var crypto=require(_0x399e('0xa'));var jsforce=require(_0x399e('0xb'));var deskjs=require(_0x399e('0xc'));var toCsv=require(_0x399e('0xd'));var querystring=require(_0x399e('0xe'));var Papa=require(_0x399e('0xf'));var Redis=require(_0x399e('0x10'));var authService=require(_0x399e('0x11'));var qs=require(_0x399e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x399e('0x13'));var logger=require(_0x399e('0x14'))('api');var utils=require(_0x399e('0x15'));var config=require(_0x399e('0x16'));var licenseUtil=require(_0x399e('0x17'));var db=require(_0x399e('0x18'))['db'];function respondWithStatusCode(_0x265418,_0x37a0f2){_0x37a0f2=_0x37a0f2||0xcc;return function(_0x293b83){if(_0x293b83){return _0x265418[_0x399e('0x19')](_0x37a0f2);}return _0x265418[_0x399e('0x1a')](_0x37a0f2)[_0x399e('0x1b')]();};}function respondWithResult(_0x3f3e5f,_0xdf90aa){_0xdf90aa=_0xdf90aa||0xc8;return function(_0x117a91){if(_0x117a91){return _0x3f3e5f[_0x399e('0x1a')](_0xdf90aa)[_0x399e('0x1c')](_0x117a91);}};}function respondWithFilteredResult(_0x39ec1b,_0x9e71d2){return function(_0x41e22b){if(_0x41e22b){var _0x36d26f=typeof _0x9e71d2[_0x399e('0x1d')]===_0x399e('0x1e')&&typeof _0x9e71d2['limit']===_0x399e('0x1e');var _0x12588d=_0x41e22b[_0x399e('0x1f')];var _0x494119=_0x36d26f?0x0:_0x9e71d2['offset'];var _0xed420c=_0x36d26f?_0x41e22b[_0x399e('0x1f')]:_0x9e71d2[_0x399e('0x1d')]+_0x9e71d2[_0x399e('0x20')];var _0x4920f6;if(_0xed420c>=_0x12588d){_0xed420c=_0x12588d;_0x4920f6=0xc8;}else{_0x4920f6=0xce;}_0x39ec1b['status'](_0x4920f6);return _0x39ec1b[_0x399e('0x21')](_0x399e('0x22'),_0x494119+'-'+_0xed420c+'/'+_0x12588d)['json'](_0x41e22b);}return null;};}function patchUpdates(_0x536e2d){return function(_0x1e73b6){try{jsonpatch[_0x399e('0x23')](_0x1e73b6,_0x536e2d,!![]);}catch(_0x27dc58){return BPromise[_0x399e('0x24')](_0x27dc58);}return _0x1e73b6[_0x399e('0x25')]();};}function saveUpdates(_0x5ee21e,_0x51b0e0){return function(_0xfb87c1){if(_0xfb87c1){return _0xfb87c1['update'](_0x5ee21e)[_0x399e('0x26')](function(_0x336e8e){return _0x336e8e;});}return null;};}function removeEntity(_0x5a8f32,_0x22b0e5){return function(_0xee53b9){if(_0xee53b9){return _0xee53b9[_0x399e('0x27')]()[_0x399e('0x26')](function(){_0x5a8f32[_0x399e('0x1a')](0xcc)[_0x399e('0x1b')]();});}};}function handleEntityNotFound(_0x4b7501,_0x3265f5){return function(_0x3e69c2){if(!_0x3e69c2){_0x4b7501[_0x399e('0x19')](0x194);}return _0x3e69c2;};}function handleError(_0x1f187b,_0x174631){_0x174631=_0x174631||0x1f4;return function(_0x180300){logger[_0x399e('0x28')](_0x180300[_0x399e('0x29')]);if(_0x180300[_0x399e('0x2a')]){delete _0x180300[_0x399e('0x2a')];}_0x1f187b[_0x399e('0x1a')](_0x174631)[_0x399e('0x2b')](_0x180300);};}exports['index']=function(_0x257459,_0x741083){var _0x37bb0a={},_0x228da4={},_0x41c4e0={'count':0x0,'rows':[]};var _0x58e10b=_[_0x399e('0x2c')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x589837){return{'name':_0x589837['fieldName'],'type':_0x589837[_0x399e('0x2d')][_0x399e('0x2e')]};});_0x228da4[_0x399e('0x2f')]=_[_0x399e('0x2c')](_0x58e10b,_0x399e('0x2a'));_0x228da4[_0x399e('0x30')]=_['keys'](_0x257459['query']);_0x228da4[_0x399e('0x31')]=_[_0x399e('0x32')](_0x228da4[_0x399e('0x2f')],_0x228da4['query']);_0x37bb0a[_0x399e('0x33')]=_[_0x399e('0x32')](_0x228da4[_0x399e('0x2f')],qs[_0x399e('0x34')](_0x257459[_0x399e('0x30')][_0x399e('0x34')]));_0x37bb0a[_0x399e('0x33')]=_0x37bb0a[_0x399e('0x33')]['length']?_0x37bb0a[_0x399e('0x33')]:_0x228da4[_0x399e('0x2f')];if(!_0x257459[_0x399e('0x30')]['hasOwnProperty']('nolimit')){_0x37bb0a[_0x399e('0x20')]=qs['limit'](_0x257459['query'][_0x399e('0x20')]);_0x37bb0a[_0x399e('0x1d')]=qs[_0x399e('0x1d')](_0x257459[_0x399e('0x30')][_0x399e('0x1d')]);}_0x37bb0a[_0x399e('0x35')]=qs[_0x399e('0x36')](_0x257459[_0x399e('0x30')][_0x399e('0x36')]);_0x37bb0a[_0x399e('0x37')]=qs[_0x399e('0x31')](_[_0x399e('0x38')](_0x257459[_0x399e('0x30')],_0x228da4['filters']),_0x58e10b);if(_0x257459[_0x399e('0x30')][_0x399e('0x39')]){_0x37bb0a[_0x399e('0x37')]=_[_0x399e('0x3a')](_0x37bb0a[_0x399e('0x37')],{'$or':_[_0x399e('0x2c')](_0x58e10b,function(_0x29246a){if(_0x29246a[_0x399e('0x2d')]!==_0x399e('0x3b')){var _0x2d5f25={};_0x2d5f25[_0x29246a[_0x399e('0x2a')]]={'$like':'%'+_0x257459[_0x399e('0x30')]['filter']+'%'};return _0x2d5f25;}})});}_0x37bb0a=_[_0x399e('0x3a')]({},_0x37bb0a,_0x257459[_0x399e('0x3c')]);var _0x209b48={'where':_0x37bb0a[_0x399e('0x37')]};return db[_0x399e('0x3d')][_0x399e('0x1f')](_0x209b48)[_0x399e('0x26')](function(_0xc43660){_0x41c4e0[_0x399e('0x1f')]=_0xc43660;if(_0x257459[_0x399e('0x30')]['includeAll']){_0x37bb0a[_0x399e('0x3e')]=[{'all':!![]}];}return db[_0x399e('0x3d')][_0x399e('0x3f')](_0x37bb0a);})[_0x399e('0x26')](function(_0x32ee1b){_0x41c4e0['rows']=_0x32ee1b;return _0x41c4e0;})['then'](respondWithFilteredResult(_0x741083,_0x37bb0a))[_0x399e('0x40')](handleError(_0x741083,null));};exports[_0x399e('0x41')]=function(_0x3acdb2,_0x46f04b){var _0x449c6e={'raw':!![],'where':{'id':_0x3acdb2[_0x399e('0x42')]['id']}},_0x11c629={};_0x11c629[_0x399e('0x2f')]=_[_0x399e('0x43')](db[_0x399e('0x3d')]['rawAttributes']);_0x11c629[_0x399e('0x30')]=_[_0x399e('0x43')](_0x3acdb2[_0x399e('0x30')]);_0x11c629[_0x399e('0x31')]=_[_0x399e('0x32')](_0x11c629['model'],_0x11c629[_0x399e('0x30')]);_0x449c6e['attributes']=_[_0x399e('0x32')](_0x11c629['model'],qs[_0x399e('0x34')](_0x3acdb2['query'][_0x399e('0x34')]));_0x449c6e[_0x399e('0x33')]=_0x449c6e['attributes'][_0x399e('0x44')]?_0x449c6e[_0x399e('0x33')]:_0x11c629[_0x399e('0x2f')];if(_0x3acdb2[_0x399e('0x30')][_0x399e('0x45')]){_0x449c6e[_0x399e('0x3e')]=[{'all':!![]}];}_0x449c6e=_[_0x399e('0x3a')]({},_0x449c6e,_0x3acdb2[_0x399e('0x3c')]);return db[_0x399e('0x3d')][_0x399e('0x46')](_0x449c6e)[_0x399e('0x26')](handleEntityNotFound(_0x46f04b,null))[_0x399e('0x26')](respondWithResult(_0x46f04b,null))['catch'](handleError(_0x46f04b,null));};exports[_0x399e('0x47')]=function(_0x2989eb,_0xa96cfe){return db[_0x399e('0x3d')][_0x399e('0x47')](_0x2989eb[_0x399e('0x48')],{})['then'](respondWithResult(_0xa96cfe,0xc9))[_0x399e('0x40')](handleError(_0xa96cfe,null));};exports[_0x399e('0x49')]=function(_0xd923ca,_0x1de854){if(_0xd923ca[_0x399e('0x48')]['id']){delete _0xd923ca[_0x399e('0x48')]['id'];}return db['OpenchannelTransferReport'][_0x399e('0x46')]({'where':{'id':_0xd923ca['params']['id']}})[_0x399e('0x26')](handleEntityNotFound(_0x1de854,null))['then'](saveUpdates(_0xd923ca[_0x399e('0x48')],null))[_0x399e('0x26')](respondWithResult(_0x1de854,null))[_0x399e('0x40')](handleError(_0x1de854,null));};exports[_0x399e('0x27')]=function(_0x49c938,_0x26162d){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x49c938[_0x399e('0x42')]['id']}})['then'](handleEntityNotFound(_0x26162d,null))[_0x399e('0x26')](removeEntity(_0x26162d,null))[_0x399e('0x40')](handleError(_0x26162d,null));};exports[_0x399e('0x4a')]=function(_0xdad7d8,_0x159727){return db[_0x399e('0x3d')][_0x399e('0x4a')]()[_0x399e('0x26')](respondWithResult(_0x159727,null))[_0x399e('0x40')](handleError(_0x159727,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5a973f3..ec34a3b 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 _0x07c5=['exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x14a321,_0x4889d9){var _0x16dd89=function(_0x20852f){while(--_0x20852f){_0x14a321['push'](_0x14a321['shift']());}};_0x16dd89(++_0x4889d9);}(_0x07c5,0xd0));var _0x507c=function(_0x571727,_0x36d075){_0x571727=_0x571727-0x0;var _0x502eeb=_0x07c5[_0x571727];return _0x502eeb;};'use strict';var _=require(_0x507c('0x0'));var util=require(_0x507c('0x1'));var logger=require(_0x507c('0x2'))(_0x507c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x507c('0x4'));var fs=require('fs');var path=require(_0x507c('0x5'));var rimraf=require(_0x507c('0x6'));var config=require(_0x507c('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x507c('0x8')]=function(_0xf7cd2,_0x5f214a){return _0xf7cd2[_0x507c('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x507c('0xa'),'paranoid':![],'indexes':[{'name':_0x507c('0xb'),'fields':[_0x507c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd68d=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3c5081,_0x48d7db){var _0x11ddf7=function(_0x164b1b){while(--_0x164b1b){_0x3c5081['push'](_0x3c5081['shift']());}};_0x11ddf7(++_0x48d7db);}(_0xd68d,0x1da));var _0xdd68=function(_0x4e44fc,_0x469115){_0x4e44fc=_0x4e44fc-0x0;var _0x297d19=_0xd68d[_0x4e44fc];return _0x297d19;};'use strict';var _=require(_0xdd68('0x0'));var util=require(_0xdd68('0x1'));var logger=require('../../config/logger')(_0xdd68('0x2'));var moment=require(_0xdd68('0x3'));var BPromise=require(_0xdd68('0x4'));var rp=require(_0xdd68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x527dd0,_0xde6c51){return _0x527dd0[_0xdd68('0x6')](_0xdd68('0x7'),attributes,{'tableName':_0xdd68('0x8'),'paranoid':![],'indexes':[{'name':_0xdd68('0x9'),'fields':[_0xdd68('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fc5c55f..6b07d4d 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 _0x3c6c=['jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17c882,_0x557f28){var _0x188c2d=function(_0x593dd5){while(--_0x593dd5){_0x17c882['push'](_0x17c882['shift']());}};_0x188c2d(++_0x557f28);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x33c0f4,_0x1d0c20){_0x33c0f4=_0x33c0f4-0x0;var _0x5bc728=_0x3c6c[_0x33c0f4];return _0x5bc728;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var moment=require(_0xc3c6('0x1'));var BPromise=require(_0xc3c6('0x2'));var rs=require(_0xc3c6('0x3'));var fs=require('fs');var Redis=require(_0xc3c6('0x4'));var db=require(_0xc3c6('0x5'))['db'];var utils=require(_0xc3c6('0x6'));var logger=require(_0xc3c6('0x7'))(_0xc3c6('0x8'));var config=require('../../config/environment');var jayson=require(_0xc3c6('0x9'));var client=jayson['client'][_0xc3c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7ae6,_0x50cd05,_0x4aed87){return new BPromise(function(_0x5185c3,_0x4f39dd){return client[_0xc3c6('0xb')](_0x4d7ae6,_0x4aed87)[_0xc3c6('0xc')](function(_0x5bc1c1){logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));logger[_0xc3c6('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x50cd05,_0xc3c6('0xf'),JSON[_0xc3c6('0x11')](_0x5bc1c1));if(_0x5bc1c1[_0xc3c6('0x12')]){if(_0x5bc1c1['error']['code']===0x1f4){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x4f39dd(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x5185c3(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}else{logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));_0x5185c3(_0x5bc1c1[_0xc3c6('0x14')][_0xc3c6('0x13')]);}})[_0xc3c6('0x15')](function(_0x33920c){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x33920c);_0x4f39dd(_0x33920c);});});} \ No newline at end of file +var _0x3f27=['../../config/utils','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x3f27,0x1f4));var _0x73f2=function(_0x282873,_0x383919){_0x282873=_0x282873-0x0;var _0x23146d=_0x3f27[_0x282873];return _0x23146d;};'use strict';var _=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var moment=require(_0x73f2('0x2'));var BPromise=require(_0x73f2('0x3'));var rs=require(_0x73f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73f2('0x5'))['db'];var utils=require(_0x73f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x73f2('0x7'));var client=jayson[_0x73f2('0x8')][_0x73f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa8ec,_0x10af7a,_0x5efe60){return new BPromise(function(_0x521fc9,_0xa2ea48){return client[_0x73f2('0xa')](_0x4aa8ec,_0x5efe60)[_0x73f2('0xb')](function(_0x3bf117){logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,'request\x20sent');logger[_0x73f2('0xe')](_0x73f2('0xf'),_0x10af7a,_0x73f2('0x10'),JSON['stringify'](_0x3bf117));if(_0x3bf117['error']){if(_0x3bf117['error'][_0x73f2('0x11')]===0x1f4){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0xa2ea48(_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0x521fc9(_0x3bf117['error']['message']);}else{logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,_0x73f2('0x10'));_0x521fc9(_0x3bf117[_0x73f2('0x14')][_0x73f2('0x13')]);}})[_0x73f2('0x15')](function(_0x32e9c6){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x32e9c6);_0xa2ea48(_0x32e9c6);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2300fe2..b72130c 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 _0x7b6b=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x254e9e,_0x405fbb){var _0x2e4b18=function(_0x4ebdcc){while(--_0x4ebdcc){_0x254e9e['push'](_0x254e9e['shift']());}};_0x2e4b18(++_0x405fbb);}(_0x7b6b,0xd4));var _0xb7b6=function(_0x3d9167,_0x36a768){_0x3d9167=_0x3d9167-0x0;var _0x5869bb=_0x7b6b[_0x3d9167];return _0x5869bb;};'use strict';var multer=require(_0xb7b6('0x0'));var util=require(_0xb7b6('0x1'));var path=require(_0xb7b6('0x2'));var timeout=require(_0xb7b6('0x3'));var express=require('express');var router=express[_0xb7b6('0x4')]();var fs_extra=require(_0xb7b6('0x5'));var auth=require(_0xb7b6('0x6'));var interaction=require(_0xb7b6('0x7'));var config=require(_0xb7b6('0x8'));var controller=require(_0xb7b6('0x9'));router[_0xb7b6('0xa')]('/',auth[_0xb7b6('0xb')](),controller[_0xb7b6('0xc')]);router[_0xb7b6('0xa')](_0xb7b6('0xd'),auth[_0xb7b6('0xb')](),controller[_0xb7b6('0xe')]);router['post']('/',auth[_0xb7b6('0xb')](),controller[_0xb7b6('0xf')]);router[_0xb7b6('0x10')](_0xb7b6('0xd'),auth['isAuthenticated'](),controller[_0xb7b6('0x11')]);router[_0xb7b6('0x12')](_0xb7b6('0xd'),auth[_0xb7b6('0xb')](),controller[_0xb7b6('0x13')]);module[_0xb7b6('0x14')]=router; \ No newline at end of file +var _0xec3b=['Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','post','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1d4b6f,_0x55f33a){var _0x45df5b=function(_0x316cce){while(--_0x316cce){_0x1d4b6f['push'](_0x1d4b6f['shift']());}};_0x45df5b(++_0x55f33a);}(_0xec3b,0x93));var _0xbec3=function(_0x5860e8,_0x24d174){_0x5860e8=_0x5860e8-0x0;var _0xffe7d=_0xec3b[_0x5860e8];return _0xffe7d;};'use strict';var multer=require(_0xbec3('0x0'));var util=require(_0xbec3('0x1'));var path=require(_0xbec3('0x2'));var timeout=require(_0xbec3('0x3'));var express=require(_0xbec3('0x4'));var router=express[_0xbec3('0x5')]();var fs_extra=require(_0xbec3('0x6'));var auth=require(_0xbec3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbec3('0x8'));var controller=require(_0xbec3('0x9'));router[_0xbec3('0xa')]('/',auth[_0xbec3('0xb')](),controller['index']);router[_0xbec3('0xa')]('/:id',auth[_0xbec3('0xb')](),controller['show']);router[_0xbec3('0xc')]('/',auth['isAuthenticated'](),controller[_0xbec3('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xbec3('0xe')]);router[_0xbec3('0xf')](_0xbec3('0x10'),auth['isAuthenticated'](),controller[_0xbec3('0x11')]);module[_0xbec3('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6f932b0..5c75919 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 _0x8c9f=['STRING','name','sequelize'];(function(_0xe236ae,_0x16039b){var _0x4e039d=function(_0x30ac72){while(--_0x30ac72){_0xe236ae['push'](_0xe236ae['shift']());}};_0x4e039d(++_0x16039b);}(_0x8c9f,0x15e));var _0xf8c9=function(_0x45f91c,_0x1ff7dd){_0x45f91c=_0x45f91c-0x0;var _0xe0cdef=_0x8c9f[_0x45f91c];return _0xe0cdef;};'use strict';var Sequelize=require(_0xf8c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8c9('0x1')],'unique':_0xf8c9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xf8c9('0x1')]}}; \ No newline at end of file +var _0x9b46=['STRING','name','sequelize','exports'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x9b46,0xea));var _0x69b4=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0x9b46[_0xaf025d];return _0x1c77cb;};'use strict';var Sequelize=require(_0x69b4('0x0'));module[_0x69b4('0x1')]={'name':{'type':Sequelize[_0x69b4('0x2')],'unique':_0x69b4('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x69b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 121ae29..ffe448a 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 _0x5061=['path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','get','Pauses','UserProfileResource','end','name','map','Pause','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x551c6f,_0x4ccf82){var _0x567765=function(_0x218a79){while(--_0x218a79){_0x551c6f['push'](_0x551c6f['shift']());}};_0x567765(++_0x4ccf82);}(_0x5061,0x19c));var _0x1506=function(_0x21d383,_0x71056d){_0x21d383=_0x21d383-0x0;var _0x3ea4a5=_0x5061[_0x21d383];return _0x3ea4a5;};'use strict';var emlformat=require(_0x1506('0x0'));var rimraf=require(_0x1506('0x1'));var zipdir=require(_0x1506('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require(_0x1506('0x5'));var Mustache=require(_0x1506('0x6'));var util=require(_0x1506('0x7'));var path=require(_0x1506('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1506('0x9'));var fs=require('fs');var fs_extra=require(_0x1506('0xa'));var _=require(_0x1506('0xb'));var squel=require(_0x1506('0xc'));var crypto=require(_0x1506('0xd'));var jsforce=require(_0x1506('0xe'));var deskjs=require(_0x1506('0xf'));var toCsv=require(_0x1506('0x10'));var querystring=require('querystring');var Papa=require(_0x1506('0x11'));var Redis=require('ioredis');var authService=require(_0x1506('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1506('0x13'));var hardwareService=require(_0x1506('0x14'));var logger=require('../../config/logger')(_0x1506('0x15'));var utils=require(_0x1506('0x16'));var config=require(_0x1506('0x17'));var licenseUtil=require(_0x1506('0x18'));var db=require(_0x1506('0x19'))['db'];function respondWithStatusCode(_0x2d3672,_0x54e631){_0x54e631=_0x54e631||0xcc;return function(_0x33c1b3){if(_0x33c1b3){return _0x2d3672[_0x1506('0x1a')](_0x54e631);}return _0x2d3672['status'](_0x54e631)['end']();};}function respondWithResult(_0x530fef,_0x102b58){_0x102b58=_0x102b58||0xc8;return function(_0x356403){if(_0x356403){return _0x530fef[_0x1506('0x1b')](_0x102b58)['json'](_0x356403);}};}function respondWithFilteredResult(_0x2105b7,_0x1f415d){return function(_0x5844a1){if(_0x5844a1){var _0x21d25a=typeof _0x1f415d[_0x1506('0x1c')]===_0x1506('0x1d')&&typeof _0x1f415d['limit']===_0x1506('0x1d');var _0x38f5e1=_0x5844a1[_0x1506('0x1e')];var _0x1554b1=_0x21d25a?0x0:_0x1f415d['offset'];var _0xa9d959=_0x21d25a?_0x5844a1[_0x1506('0x1e')]:_0x1f415d['offset']+_0x1f415d[_0x1506('0x1f')];var _0x4fdd22;if(_0xa9d959>=_0x38f5e1){_0xa9d959=_0x38f5e1;_0x4fdd22=0xc8;}else{_0x4fdd22=0xce;}_0x2105b7[_0x1506('0x1b')](_0x4fdd22);return _0x2105b7[_0x1506('0x20')]('Content-Range',_0x1554b1+'-'+_0xa9d959+'/'+_0x38f5e1)[_0x1506('0x21')](_0x5844a1);}return null;};}function patchUpdates(_0x2c82f3){return function(_0xe6399b){try{jsonpatch['apply'](_0xe6399b,_0x2c82f3,!![]);}catch(_0x3ac637){return BPromise[_0x1506('0x22')](_0x3ac637);}return _0xe6399b[_0x1506('0x23')]();};}function saveUpdates(_0x57751b,_0x537c0e){return function(_0x5f2210){if(_0x5f2210){return _0x5f2210['update'](_0x57751b)[_0x1506('0x24')](function(_0x214a2f){return _0x214a2f;});}return null;};}function removeEntity(_0x258902,_0x1633a3){return function(_0xb5de90){if(_0xb5de90){return _0xb5de90[_0x1506('0x25')]()[_0x1506('0x24')](function(){var _0x5970c8=_0xb5de90[_0x1506('0x26')]({'plain':!![]});var _0x5c965e=_0x1506('0x27');return db[_0x1506('0x28')]['destroy']({'where':{'type':_0x5c965e,'resourceId':_0x5970c8['id']}})[_0x1506('0x24')](function(){return _0xb5de90;});})[_0x1506('0x24')](function(){_0x258902['status'](0xcc)[_0x1506('0x29')]();});}};}function handleEntityNotFound(_0x4838eb,_0x2e42ef){return function(_0x15a941){if(!_0x15a941){_0x4838eb['sendStatus'](0x194);}return _0x15a941;};}function handleError(_0x19c7e5,_0x34e39b){_0x34e39b=_0x34e39b||0x1f4;return function(_0x19860f){logger['error'](_0x19860f['stack']);if(_0x19860f['name']){delete _0x19860f[_0x1506('0x2a')];}_0x19c7e5[_0x1506('0x1b')](_0x34e39b)['send'](_0x19860f);};}exports['index']=function(_0x31533f,_0x83c5c4){var _0x462e2e={},_0x4c8de5={},_0x1d8cfc={'count':0x0,'rows':[]};var _0x3b2cb8=_[_0x1506('0x2b')](db[_0x1506('0x2c')]['rawAttributes'],function(_0x340672){return{'name':_0x340672[_0x1506('0x2d')],'type':_0x340672['type'][_0x1506('0x2e')]};});_0x4c8de5['model']=_['map'](_0x3b2cb8,'name');_0x4c8de5[_0x1506('0x2f')]=_['keys'](_0x31533f[_0x1506('0x2f')]);_0x4c8de5[_0x1506('0x30')]=_[_0x1506('0x31')](_0x4c8de5[_0x1506('0x32')],_0x4c8de5[_0x1506('0x2f')]);_0x462e2e['attributes']=_['intersection'](_0x4c8de5[_0x1506('0x32')],qs['fields'](_0x31533f[_0x1506('0x2f')][_0x1506('0x33')]));_0x462e2e[_0x1506('0x34')]=_0x462e2e[_0x1506('0x34')][_0x1506('0x35')]?_0x462e2e['attributes']:_0x4c8de5[_0x1506('0x32')];if(!_0x31533f[_0x1506('0x2f')][_0x1506('0x36')](_0x1506('0x37'))){_0x462e2e[_0x1506('0x1f')]=qs['limit'](_0x31533f[_0x1506('0x2f')][_0x1506('0x1f')]);_0x462e2e[_0x1506('0x1c')]=qs[_0x1506('0x1c')](_0x31533f[_0x1506('0x2f')][_0x1506('0x1c')]);}_0x462e2e[_0x1506('0x38')]=qs['sort'](_0x31533f[_0x1506('0x2f')][_0x1506('0x39')]);_0x462e2e[_0x1506('0x3a')]=qs['filters'](_[_0x1506('0x3b')](_0x31533f[_0x1506('0x2f')],_0x4c8de5['filters']),_0x3b2cb8);if(_0x31533f[_0x1506('0x2f')][_0x1506('0x3c')]){_0x462e2e[_0x1506('0x3a')]=_[_0x1506('0x3d')](_0x462e2e[_0x1506('0x3a')],{'$or':_[_0x1506('0x2b')](_0x3b2cb8,function(_0x2d1ee1){if(_0x2d1ee1[_0x1506('0x3e')]!==_0x1506('0x3f')){var _0x2cf77d={};_0x2cf77d[_0x2d1ee1[_0x1506('0x2a')]]={'$like':'%'+_0x31533f[_0x1506('0x2f')][_0x1506('0x3c')]+'%'};return _0x2cf77d;}})});}_0x462e2e=_[_0x1506('0x3d')]({},_0x462e2e,_0x31533f['options']);var _0x2bf2b0={'where':_0x462e2e[_0x1506('0x3a')]};return db[_0x1506('0x2c')]['count'](_0x2bf2b0)[_0x1506('0x24')](function(_0x509b38){_0x1d8cfc[_0x1506('0x1e')]=_0x509b38;if(_0x31533f['query'][_0x1506('0x40')]){_0x462e2e['include']=[{'all':!![]}];}return db[_0x1506('0x2c')][_0x1506('0x41')](_0x462e2e);})[_0x1506('0x24')](function(_0x542457){_0x1d8cfc[_0x1506('0x42')]=_0x542457;return _0x1d8cfc;})['then'](respondWithFilteredResult(_0x83c5c4,_0x462e2e))[_0x1506('0x43')](handleError(_0x83c5c4,null));};exports[_0x1506('0x44')]=function(_0x37b595,_0x17fd4c){var _0x5a7125={'raw':!![],'where':{'id':_0x37b595[_0x1506('0x45')]['id']}},_0x440a4d={};_0x440a4d[_0x1506('0x32')]=_['keys'](db[_0x1506('0x2c')][_0x1506('0x46')]);_0x440a4d[_0x1506('0x2f')]=_[_0x1506('0x47')](_0x37b595[_0x1506('0x2f')]);_0x440a4d['filters']=_['intersection'](_0x440a4d[_0x1506('0x32')],_0x440a4d[_0x1506('0x2f')]);_0x5a7125[_0x1506('0x34')]=_[_0x1506('0x31')](_0x440a4d[_0x1506('0x32')],qs[_0x1506('0x33')](_0x37b595[_0x1506('0x2f')][_0x1506('0x33')]));_0x5a7125['attributes']=_0x5a7125['attributes'][_0x1506('0x35')]?_0x5a7125['attributes']:_0x440a4d[_0x1506('0x32')];if(_0x37b595[_0x1506('0x2f')][_0x1506('0x40')]){_0x5a7125[_0x1506('0x48')]=[{'all':!![]}];}_0x5a7125=_[_0x1506('0x3d')]({},_0x5a7125,_0x37b595[_0x1506('0x49')]);return db[_0x1506('0x2c')][_0x1506('0x4a')](_0x5a7125)[_0x1506('0x24')](handleEntityNotFound(_0x17fd4c,null))[_0x1506('0x24')](respondWithResult(_0x17fd4c,null))[_0x1506('0x43')](handleError(_0x17fd4c,null));};exports[_0x1506('0x4b')]=function(_0x5b2335,_0x45dc28){return db[_0x1506('0x2c')]['create'](_0x5b2335[_0x1506('0x4c')],{})[_0x1506('0x24')](function(_0x381af9){var _0x1a81ef=_0x5b2335['user'][_0x1506('0x26')]({'plain':!![]});if(!_0x1a81ef)throw new Error(_0x1506('0x4d'));if(_0x1a81ef[_0x1506('0x4e')]===_0x1506('0x4f')){var _0x54c5b6=_0x381af9[_0x1506('0x26')]({'plain':!![]});var _0x4ce20f=_0x1506('0x27');return db['UserProfileSection'][_0x1506('0x4a')]({'where':{'name':_0x4ce20f,'userProfileId':_0x1a81ef['userProfileId']},'raw':!![]})[_0x1506('0x24')](function(_0x4f361b){if(_0x4f361b&&_0x4f361b[_0x1506('0x50')]===0x0){return db[_0x1506('0x28')][_0x1506('0x4b')]({'name':_0x54c5b6['name'],'resourceId':_0x54c5b6['id'],'type':_0x4f361b[_0x1506('0x2a')],'sectionId':_0x4f361b['id']},{})[_0x1506('0x24')](function(){return _0x381af9;});}else{return _0x381af9;}})[_0x1506('0x43')](function(_0x12e06f){logger[_0x1506('0x51')](_0x1506('0x52'),_0x12e06f);throw _0x12e06f;});}return _0x381af9;})['then'](respondWithResult(_0x45dc28,0xc9))[_0x1506('0x43')](handleError(_0x45dc28,null));};exports[_0x1506('0x53')]=function(_0x3c1e18,_0x563897){if(_0x3c1e18[_0x1506('0x4c')]['id']){delete _0x3c1e18['body']['id'];}return db[_0x1506('0x2c')][_0x1506('0x4a')]({'where':{'id':_0x3c1e18[_0x1506('0x45')]['id']}})[_0x1506('0x24')](handleEntityNotFound(_0x563897,null))['then'](saveUpdates(_0x3c1e18[_0x1506('0x4c')],null))[_0x1506('0x24')](respondWithResult(_0x563897,null))[_0x1506('0x43')](handleError(_0x563897,null));};exports['destroy']=function(_0x32ccca,_0x227085){return db[_0x1506('0x2c')]['find']({'where':{'id':_0x32ccca[_0x1506('0x45')]['id']}})[_0x1506('0x24')](handleEntityNotFound(_0x227085,null))['then'](removeEntity(_0x227085,null))[_0x1506('0x43')](handleError(_0x227085,null));}; \ No newline at end of file +var _0x9503=['status','json','offset','limit','undefined','set','reject','save','destroy','then','get','Pauses','end','error','stack','name','send','map','Pause','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','merge','type','VIRTUAL','options','count','includeAll','include','show','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x9503,0xcf));var _0x3950=function(_0x5ce329,_0xd4112f){_0x5ce329=_0x5ce329-0x0;var _0x263d47=_0x9503[_0x5ce329];return _0x263d47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3950('0x0'));var zipdir=require(_0x3950('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3950('0x2'));var moment=require(_0x3950('0x3'));var BPromise=require(_0x3950('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3950('0x5'));var sox=require(_0x3950('0x6'));var csv=require(_0x3950('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3950('0x8'));var _=require(_0x3950('0x9'));var squel=require(_0x3950('0xa'));var crypto=require(_0x3950('0xb'));var jsforce=require(_0x3950('0xc'));var deskjs=require(_0x3950('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3950('0xe'));var Papa=require('papaparse');var Redis=require(_0x3950('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3950('0x10'));var as=require(_0x3950('0x11'));var hardwareService=require(_0x3950('0x12'));var logger=require('../../config/logger')(_0x3950('0x13'));var utils=require(_0x3950('0x14'));var config=require(_0x3950('0x15'));var licenseUtil=require(_0x3950('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4289da,_0x517868){_0x517868=_0x517868||0xcc;return function(_0x2ad7ad){if(_0x2ad7ad){return _0x4289da[_0x3950('0x17')](_0x517868);}return _0x4289da[_0x3950('0x18')](_0x517868)['end']();};}function respondWithResult(_0x557ff6,_0x2b8ffd){_0x2b8ffd=_0x2b8ffd||0xc8;return function(_0x47e3e8){if(_0x47e3e8){return _0x557ff6['status'](_0x2b8ffd)[_0x3950('0x19')](_0x47e3e8);}};}function respondWithFilteredResult(_0x1af7a8,_0x22ca52){return function(_0x4af8aa){if(_0x4af8aa){var _0x3cf6dd=typeof _0x22ca52[_0x3950('0x1a')]==='undefined'&&typeof _0x22ca52[_0x3950('0x1b')]===_0x3950('0x1c');var _0x8036c7=_0x4af8aa['count'];var _0x11d2b7=_0x3cf6dd?0x0:_0x22ca52[_0x3950('0x1a')];var _0x182fb5=_0x3cf6dd?_0x4af8aa['count']:_0x22ca52[_0x3950('0x1a')]+_0x22ca52[_0x3950('0x1b')];var _0x280476;if(_0x182fb5>=_0x8036c7){_0x182fb5=_0x8036c7;_0x280476=0xc8;}else{_0x280476=0xce;}_0x1af7a8[_0x3950('0x18')](_0x280476);return _0x1af7a8[_0x3950('0x1d')]('Content-Range',_0x11d2b7+'-'+_0x182fb5+'/'+_0x8036c7)[_0x3950('0x19')](_0x4af8aa);}return null;};}function patchUpdates(_0x4643d6){return function(_0x3a6c18){try{jsonpatch['apply'](_0x3a6c18,_0x4643d6,!![]);}catch(_0x37264e){return BPromise[_0x3950('0x1e')](_0x37264e);}return _0x3a6c18[_0x3950('0x1f')]();};}function saveUpdates(_0x213cc8,_0x37c786){return function(_0x3d35cb){if(_0x3d35cb){return _0x3d35cb['update'](_0x213cc8)['then'](function(_0x4b6f8d){return _0x4b6f8d;});}return null;};}function removeEntity(_0x329718,_0x3cee89){return function(_0x28f4a1){if(_0x28f4a1){return _0x28f4a1[_0x3950('0x20')]()[_0x3950('0x21')](function(){var _0x3839e4=_0x28f4a1[_0x3950('0x22')]({'plain':!![]});var _0x21bc3f=_0x3950('0x23');return db['UserProfileResource'][_0x3950('0x20')]({'where':{'type':_0x21bc3f,'resourceId':_0x3839e4['id']}})['then'](function(){return _0x28f4a1;});})['then'](function(){_0x329718[_0x3950('0x18')](0xcc)[_0x3950('0x24')]();});}};}function handleEntityNotFound(_0x17d14d,_0x3e325d){return function(_0x25180a){if(!_0x25180a){_0x17d14d[_0x3950('0x17')](0x194);}return _0x25180a;};}function handleError(_0x12e2ae,_0x29cfee){_0x29cfee=_0x29cfee||0x1f4;return function(_0x169c09){logger[_0x3950('0x25')](_0x169c09[_0x3950('0x26')]);if(_0x169c09[_0x3950('0x27')]){delete _0x169c09[_0x3950('0x27')];}_0x12e2ae[_0x3950('0x18')](_0x29cfee)[_0x3950('0x28')](_0x169c09);};}exports['index']=function(_0x1fe4de,_0xb7c44c){var _0x217213={},_0x1e8204={},_0x4febf5={'count':0x0,'rows':[]};var _0x466da2=_[_0x3950('0x29')](db[_0x3950('0x2a')][_0x3950('0x2b')],function(_0x36a2a1){return{'name':_0x36a2a1[_0x3950('0x2c')],'type':_0x36a2a1['type'][_0x3950('0x2d')]};});_0x1e8204['model']=_[_0x3950('0x29')](_0x466da2,_0x3950('0x27'));_0x1e8204[_0x3950('0x2e')]=_[_0x3950('0x2f')](_0x1fe4de[_0x3950('0x2e')]);_0x1e8204[_0x3950('0x30')]=_[_0x3950('0x31')](_0x1e8204[_0x3950('0x32')],_0x1e8204[_0x3950('0x2e')]);_0x217213[_0x3950('0x33')]=_[_0x3950('0x31')](_0x1e8204[_0x3950('0x32')],qs[_0x3950('0x34')](_0x1fe4de[_0x3950('0x2e')][_0x3950('0x34')]));_0x217213['attributes']=_0x217213[_0x3950('0x33')][_0x3950('0x35')]?_0x217213[_0x3950('0x33')]:_0x1e8204[_0x3950('0x32')];if(!_0x1fe4de[_0x3950('0x2e')]['hasOwnProperty'](_0x3950('0x36'))){_0x217213['limit']=qs[_0x3950('0x1b')](_0x1fe4de[_0x3950('0x2e')][_0x3950('0x1b')]);_0x217213[_0x3950('0x1a')]=qs[_0x3950('0x1a')](_0x1fe4de[_0x3950('0x2e')][_0x3950('0x1a')]);}_0x217213[_0x3950('0x37')]=qs['sort'](_0x1fe4de[_0x3950('0x2e')]['sort']);_0x217213[_0x3950('0x38')]=qs['filters'](_['pick'](_0x1fe4de[_0x3950('0x2e')],_0x1e8204[_0x3950('0x30')]),_0x466da2);if(_0x1fe4de['query']['filter']){_0x217213['where']=_[_0x3950('0x39')](_0x217213[_0x3950('0x38')],{'$or':_[_0x3950('0x29')](_0x466da2,function(_0x5e24bf){if(_0x5e24bf[_0x3950('0x3a')]!==_0x3950('0x3b')){var _0xb7c11b={};_0xb7c11b[_0x5e24bf[_0x3950('0x27')]]={'$like':'%'+_0x1fe4de[_0x3950('0x2e')]['filter']+'%'};return _0xb7c11b;}})});}_0x217213=_[_0x3950('0x39')]({},_0x217213,_0x1fe4de[_0x3950('0x3c')]);var _0x39b466={'where':_0x217213[_0x3950('0x38')]};return db['Pause'][_0x3950('0x3d')](_0x39b466)[_0x3950('0x21')](function(_0x7878b9){_0x4febf5[_0x3950('0x3d')]=_0x7878b9;if(_0x1fe4de['query'][_0x3950('0x3e')]){_0x217213[_0x3950('0x3f')]=[{'all':!![]}];}return db[_0x3950('0x2a')]['findAll'](_0x217213);})[_0x3950('0x21')](function(_0xbb986e){_0x4febf5['rows']=_0xbb986e;return _0x4febf5;})['then'](respondWithFilteredResult(_0xb7c44c,_0x217213))['catch'](handleError(_0xb7c44c,null));};exports[_0x3950('0x40')]=function(_0x5818de,_0x48453d){var _0x11b587={'raw':!![],'where':{'id':_0x5818de[_0x3950('0x41')]['id']}},_0x4b8eb6={};_0x4b8eb6[_0x3950('0x32')]=_[_0x3950('0x2f')](db[_0x3950('0x2a')][_0x3950('0x2b')]);_0x4b8eb6[_0x3950('0x2e')]=_[_0x3950('0x2f')](_0x5818de[_0x3950('0x2e')]);_0x4b8eb6['filters']=_[_0x3950('0x31')](_0x4b8eb6[_0x3950('0x32')],_0x4b8eb6['query']);_0x11b587[_0x3950('0x33')]=_['intersection'](_0x4b8eb6[_0x3950('0x32')],qs[_0x3950('0x34')](_0x5818de[_0x3950('0x2e')]['fields']));_0x11b587[_0x3950('0x33')]=_0x11b587[_0x3950('0x33')][_0x3950('0x35')]?_0x11b587['attributes']:_0x4b8eb6[_0x3950('0x32')];if(_0x5818de[_0x3950('0x2e')][_0x3950('0x3e')]){_0x11b587[_0x3950('0x3f')]=[{'all':!![]}];}_0x11b587=_[_0x3950('0x39')]({},_0x11b587,_0x5818de[_0x3950('0x3c')]);return db[_0x3950('0x2a')]['find'](_0x11b587)['then'](handleEntityNotFound(_0x48453d,null))[_0x3950('0x21')](respondWithResult(_0x48453d,null))[_0x3950('0x42')](handleError(_0x48453d,null));};exports[_0x3950('0x43')]=function(_0x446781,_0x3f468d){return db[_0x3950('0x2a')][_0x3950('0x43')](_0x446781[_0x3950('0x44')],{})[_0x3950('0x21')](function(_0x1d7244){var _0x51c862=_0x446781['user']['get']({'plain':!![]});if(!_0x51c862)throw new Error(_0x3950('0x45'));if(_0x51c862[_0x3950('0x46')]==='user'){var _0x57c9d8=_0x1d7244['get']({'plain':!![]});var _0x99801b=_0x3950('0x23');return db[_0x3950('0x47')]['find']({'where':{'name':_0x99801b,'userProfileId':_0x51c862['userProfileId']},'raw':!![]})[_0x3950('0x21')](function(_0x1c2486){if(_0x1c2486&&_0x1c2486[_0x3950('0x48')]===0x0){return db[_0x3950('0x49')][_0x3950('0x43')]({'name':_0x57c9d8[_0x3950('0x27')],'resourceId':_0x57c9d8['id'],'type':_0x1c2486['name'],'sectionId':_0x1c2486['id']},{})[_0x3950('0x21')](function(){return _0x1d7244;});}else{return _0x1d7244;}})[_0x3950('0x42')](function(_0x45b50d){logger[_0x3950('0x25')](_0x3950('0x4a'),_0x45b50d);throw _0x45b50d;});}return _0x1d7244;})[_0x3950('0x21')](respondWithResult(_0x3f468d,0xc9))[_0x3950('0x42')](handleError(_0x3f468d,null));};exports[_0x3950('0x4b')]=function(_0x1860a1,_0x192cac){if(_0x1860a1[_0x3950('0x44')]['id']){delete _0x1860a1[_0x3950('0x44')]['id'];}return db[_0x3950('0x2a')][_0x3950('0x4c')]({'where':{'id':_0x1860a1['params']['id']}})['then'](handleEntityNotFound(_0x192cac,null))['then'](saveUpdates(_0x1860a1[_0x3950('0x44')],null))[_0x3950('0x21')](respondWithResult(_0x192cac,null))[_0x3950('0x42')](handleError(_0x192cac,null));};exports[_0x3950('0x20')]=function(_0x542dd9,_0x475dae){return db[_0x3950('0x2a')]['find']({'where':{'id':_0x542dd9[_0x3950('0x41')]['id']}})['then'](handleEntityNotFound(_0x475dae,null))[_0x3950('0x21')](removeEntity(_0x475dae,null))['catch'](handleError(_0x475dae,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index a97e7c2..1c8d37f 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x5f3df5,_0x1fb80b){var _0xbd71c0=function(_0x27d2ad){while(--_0x27d2ad){_0x5f3df5['push'](_0x5f3df5['shift']());}};_0xbd71c0(++_0x1fb80b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x299eed,_0x36e31c){_0x299eed=_0x299eed-0x0;var _0x1296bc=_0x8ef6[_0x299eed];return _0x1296bc;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4c56dc,_0x3c7f5d){var _0x134c99=function(_0x626651){while(--_0x626651){_0x4c56dc['push'](_0x4c56dc['shift']());}};_0x134c99(++_0x3c7f5d);}(_0x1cb9,0x14e));var _0x91cb=function(_0xce3768,_0x234f35){_0xce3768=_0xce3768-0x0;var _0x23083c=_0x1cb9[_0xce3768];return _0x23083c;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b2451eb..29dc5f8 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(_0x2e6dc6,_0x4dfd51){var _0x354e1a=function(_0x1301a0){while(--_0x1301a0){_0x2e6dc6['push'](_0x2e6dc6['shift']());}};_0x354e1a(++_0x4dfd51);}(_0x7a54,0x106));var _0x47a5=function(_0x3cb4d6,_0x305e50){_0x3cb4d6=_0x3cb4d6-0x0;var _0x3aa4d9=_0x7a54[_0x3cb4d6];return _0x3aa4d9;};'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(_0x28bc2e,_0x4b3eaf){var _0x27abfd=function(_0x13b9bc){while(--_0x13b9bc){_0x28bc2e['push'](_0x28bc2e['shift']());}};_0x27abfd(++_0x4b3eaf);}(_0x7a54,0x106));var _0x47a5=function(_0x1f6e18,_0x3d5011){_0x1f6e18=_0x1f6e18-0x0;var _0x14eb66=_0x7a54[_0x1f6e18];return _0x14eb66;};'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 4ef2092..7d4fe68 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 _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x49688,_0x81c601){var _0x1c737e=function(_0x3e01e7){while(--_0x3e01e7){_0x49688['push'](_0x49688['shift']());}};_0x1c737e(++_0x81c601);}(_0x5c12,0x188));var _0x25c1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x5c12[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router; \ No newline at end of file +var _0x207c=['file','upload','post','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/webhook','/:id','isAuthenticated','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','extname','now','single'];(function(_0x533dba,_0x2551c7){var _0x39b8f7=function(_0x3f7b04){while(--_0x3f7b04){_0x533dba['push'](_0x533dba['shift']());}};_0x39b8f7(++_0x2551c7);}(_0x207c,0x1e8));var _0xc207=function(_0x3e4e5c,_0x4d2966){_0x3e4e5c=_0x3e4e5c-0x0;var _0x46f0bf=_0x207c[_0x3e4e5c];return _0x46f0bf;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),controller['webhookGet']);router[_0xc207('0x9')](_0xc207('0xb'),auth[_0xc207('0xc')](),controller['show']);router[_0xc207('0x9')](_0xc207('0xd'),auth[_0xc207('0xc')](),controller[_0xc207('0xe')]);var upload=multer({'storage':multer[_0xc207('0xf')]({'destination':function(_0x347549,_0x487d95,_0x574425){_0x574425(null,path['join'](config[_0xc207('0x10')],'server/files/plugins'));},'filename':function(_0x2741f3,_0x2782ce,_0x59d401){_0x2782ce[_0xc207('0x11')]=_0x2782ce[_0xc207('0x11')][_0xc207('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59d401(null,util[_0xc207('0x13')](_0xc207('0x14'),path['basename'](_0x2782ce[_0xc207('0x11')],path[_0xc207('0x15')](_0x2782ce[_0xc207('0x11')])),Date[_0xc207('0x16')](),path['extname'](_0x2782ce['originalname'])));}})});router['post']('/',upload[_0xc207('0x17')](_0xc207('0x18')),controller[_0xc207('0x19')]);router[_0xc207('0x1a')]('/webhook',controller[_0xc207('0x1b')]);router[_0xc207('0x1c')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x1d')]);router['delete'](_0xc207('0xb'),auth[_0xc207('0xc')](),controller[_0xc207('0x1e')]);module[_0xc207('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 56c4a3e..1da316c 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 _0x9357=['sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never'];(function(_0x1870b2,_0x3dcdab){var _0x293f82=function(_0x3cf3be){while(--_0x3cf3be){_0x1870b2['push'](_0x1870b2['shift']());}};_0x293f82(++_0x3dcdab);}(_0x9357,0x145));var _0x7935=function(_0x2ddf41,_0x4d7a1e){_0x2ddf41=_0x2ddf41-0x0;var _0x3a1c5f=_0x9357[_0x2ddf41];return _0x3a1c5f;};'use strict';var Sequelize=require(_0x7935('0x0'));module[_0x7935('0x1')]={'name':{'type':Sequelize[_0x7935('0x2')]},'type':{'type':Sequelize[_0x7935('0x3')](_0x7935('0x4'),_0x7935('0x5'))},'description':{'type':Sequelize[_0x7935('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x7935('0x7')},'active':{'type':Sequelize[_0x7935('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x7935('0x3')](_0x7935('0x9'),_0x7935('0xa'),_0x7935('0xb'),_0x7935('0xc')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x7935('0x2')]},'adminUrl':{'type':Sequelize[_0x7935('0x2')]},'agentUrl':{'type':Sequelize[_0x7935('0x2')]},'scriptName':{'type':Sequelize[_0x7935('0x2')]},'scriptPath':{'type':Sequelize[_0x7935('0x2')]}}; \ No newline at end of file +var _0x9bec=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x9bec,0x161));var _0xc9be=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x9bec[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0xc9be('0x0'));module[_0xc9be('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc9be('0x2')]('html',_0xc9be('0x3'))},'description':{'type':Sequelize[_0xc9be('0x4')]},'version':{'type':Sequelize[_0xc9be('0x4')]},'path':{'type':Sequelize[_0xc9be('0x5')],'comment':_0xc9be('0x6')},'active':{'type':Sequelize[_0xc9be('0x7')],'defaultValue':0x0,'comment':_0xc9be('0x8')},'sidebar':{'type':Sequelize[_0xc9be('0x2')]('adminOnly',_0xc9be('0x9'),_0xc9be('0xa'),_0xc9be('0xb')),'defaultValue':_0xc9be('0xa'),'comment':_0xc9be('0xc')},'icon':{'type':Sequelize[_0xc9be('0x5')]},'adminUrl':{'type':Sequelize[_0xc9be('0x5')]},'agentUrl':{'type':Sequelize[_0xc9be('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xc9be('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 18fb70a..ae61462 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 _0xe905=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','sendStatus','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','endsWith','statusCode','webhookPost','port','method','content-type'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0xe905,0xa7));var _0x5e90=function(_0x97ee0d,_0x19554d){_0x97ee0d=_0x97ee0d-0x0;var _0x452cba=_0xe905[_0x97ee0d];return _0x452cba;};'use strict';var emlformat=require(_0x5e90('0x0'));var rimraf=require(_0x5e90('0x1'));var zipdir=require(_0x5e90('0x2'));var jsonpatch=require(_0x5e90('0x3'));var rp=require(_0x5e90('0x4'));var moment=require('moment');var BPromise=require(_0x5e90('0x5'));var Mustache=require(_0x5e90('0x6'));var util=require(_0x5e90('0x7'));var path=require(_0x5e90('0x8'));var sox=require(_0x5e90('0x9'));var csv=require(_0x5e90('0xa'));var ejs=require(_0x5e90('0xb'));var fs=require('fs');var fs_extra=require(_0x5e90('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e90('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5e90('0xe'));var toCsv=require(_0x5e90('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x5e90('0xf'));var rimraf=require(_0x5e90('0x1'));var archiver=require('archiver');var Redis=require(_0x5e90('0x10'));var authService=require(_0x5e90('0x11'));var qs=require(_0x5e90('0x12'));var as=require(_0x5e90('0x13'));var hardwareService=require(_0x5e90('0x14'));var logger=require(_0x5e90('0x15'))(_0x5e90('0x16'));var utils=require(_0x5e90('0x17'));var config=require(_0x5e90('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e90('0x19'))['db'];config[_0x5e90('0x1a')]=_[_0x5e90('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e90('0x1c'))(new Redis(config[_0x5e90('0x1a')]));require(_0x5e90('0x1d'))[_0x5e90('0x1e')](socket);function respondWithStatusCode(_0xe116b,_0x570bb6){_0x570bb6=_0x570bb6||0xcc;return function(_0x2cda62){if(_0x2cda62){return _0xe116b['sendStatus'](_0x570bb6);}return _0xe116b[_0x5e90('0x1f')](_0x570bb6)[_0x5e90('0x20')]();};}function respondWithResult(_0x443446,_0x397f22){_0x397f22=_0x397f22||0xc8;return function(_0x3f6af5){if(_0x3f6af5){return _0x443446[_0x5e90('0x1f')](_0x397f22)[_0x5e90('0x21')](_0x3f6af5);}};}function respondWithFilteredResult(_0x1cb668,_0x564258){return function(_0x2080a7){if(_0x2080a7){var _0x4da57a=typeof _0x564258['offset']==='undefined'&&typeof _0x564258[_0x5e90('0x22')]===_0x5e90('0x23');var _0x17f5eb=_0x2080a7[_0x5e90('0x24')];var _0x326f64=_0x4da57a?0x0:_0x564258['offset'];var _0xe8807=_0x4da57a?_0x2080a7['count']:_0x564258[_0x5e90('0x25')]+_0x564258[_0x5e90('0x22')];var _0x1f5178;if(_0xe8807>=_0x17f5eb){_0xe8807=_0x17f5eb;_0x1f5178=0xc8;}else{_0x1f5178=0xce;}_0x1cb668['status'](_0x1f5178);return _0x1cb668[_0x5e90('0x26')](_0x5e90('0x27'),_0x326f64+'-'+_0xe8807+'/'+_0x17f5eb)[_0x5e90('0x21')](_0x2080a7);}return null;};}function patchUpdates(_0x42bce9){return function(_0xa1ba0a){try{jsonpatch[_0x5e90('0x28')](_0xa1ba0a,_0x42bce9,!![]);}catch(_0x569b7e){return BPromise[_0x5e90('0x29')](_0x569b7e);}return _0xa1ba0a[_0x5e90('0x2a')]();};}function saveUpdates(_0x334348,_0x548a7d){return function(_0x1f1596){if(_0x1f1596){return _0x1f1596[_0x5e90('0x2b')](_0x334348)[_0x5e90('0x2c')](function(_0x2a265c){return _0x2a265c;});}return null;};}function removeEntity(_0x223c09,_0x31e165){return function(_0x2ce195){if(_0x2ce195){return _0x2ce195[_0x5e90('0x2d')]()['then'](function(){var _0x3b484a=_0x2ce195['get']({'plain':!![]});var _0x34045c=_0x5e90('0x2e');return db[_0x5e90('0x2f')][_0x5e90('0x2d')]({'where':{'type':_0x34045c,'resourceId':_0x3b484a['id']}})['then'](function(){return _0x2ce195;});})['then'](function(){_0x223c09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9966,_0x409780){return function(_0x69e977){if(!_0x69e977){_0x2f9966[_0x5e90('0x30')](0x194);}return _0x69e977;};}function handleError(_0x4195c1,_0x37c16b){_0x37c16b=_0x37c16b||0x1f4;return function(_0x2bb071){logger[_0x5e90('0x31')](_0x2bb071['stack']);if(_0x2bb071[_0x5e90('0x32')]){delete _0x2bb071['name'];}_0x4195c1['status'](_0x37c16b)[_0x5e90('0x33')](_0x2bb071);};}exports[_0x5e90('0x34')]=function(_0x5941e3,_0x173f98){var _0x55cd38={},_0x2e64aa={},_0x2cc7ae={'count':0x0,'rows':[]};var _0x396bbe=_[_0x5e90('0x35')](db[_0x5e90('0x36')][_0x5e90('0x37')],function(_0x4fc269){return{'name':_0x4fc269[_0x5e90('0x38')],'type':_0x4fc269[_0x5e90('0x39')][_0x5e90('0x3a')]};});_0x2e64aa[_0x5e90('0x3b')]=_['map'](_0x396bbe,_0x5e90('0x32'));_0x2e64aa[_0x5e90('0x3c')]=_[_0x5e90('0x3d')](_0x5941e3[_0x5e90('0x3c')]);_0x2e64aa[_0x5e90('0x3e')]=_['intersection'](_0x2e64aa['model'],_0x2e64aa[_0x5e90('0x3c')]);_0x55cd38[_0x5e90('0x3f')]=_[_0x5e90('0x40')](_0x2e64aa[_0x5e90('0x3b')],qs[_0x5e90('0x41')](_0x5941e3['query'][_0x5e90('0x41')]));_0x55cd38[_0x5e90('0x3f')]=_0x55cd38[_0x5e90('0x3f')][_0x5e90('0x42')]?_0x55cd38['attributes']:_0x2e64aa[_0x5e90('0x3b')];if(!_0x5941e3[_0x5e90('0x3c')]['hasOwnProperty'](_0x5e90('0x43'))){_0x55cd38[_0x5e90('0x22')]=qs[_0x5e90('0x22')](_0x5941e3[_0x5e90('0x3c')]['limit']);_0x55cd38[_0x5e90('0x25')]=qs['offset'](_0x5941e3[_0x5e90('0x3c')]['offset']);}_0x55cd38[_0x5e90('0x44')]=qs[_0x5e90('0x45')](_0x5941e3[_0x5e90('0x3c')][_0x5e90('0x45')]);_0x55cd38['where']=qs[_0x5e90('0x3e')](_['pick'](_0x5941e3[_0x5e90('0x3c')],_0x2e64aa[_0x5e90('0x3e')]),_0x396bbe);if(_0x5941e3[_0x5e90('0x3c')][_0x5e90('0x46')]){_0x55cd38[_0x5e90('0x47')]=_['merge'](_0x55cd38[_0x5e90('0x47')],{'$or':_[_0x5e90('0x35')](_0x396bbe,function(_0x973c74){if(_0x973c74[_0x5e90('0x39')]!==_0x5e90('0x48')){var _0x205e2b={};_0x205e2b[_0x973c74[_0x5e90('0x32')]]={'$like':'%'+_0x5941e3[_0x5e90('0x3c')][_0x5e90('0x46')]+'%'};return _0x205e2b;}})});}_0x55cd38=_['merge']({},_0x55cd38,_0x5941e3[_0x5e90('0x49')]);var _0x3cc00c={'where':_0x55cd38[_0x5e90('0x47')]};return db[_0x5e90('0x36')]['count'](_0x3cc00c)['then'](function(_0x29d818){_0x2cc7ae['count']=_0x29d818;if(_0x5941e3[_0x5e90('0x3c')]['includeAll']){_0x55cd38[_0x5e90('0x4a')]=[{'all':!![]}];}return db[_0x5e90('0x36')][_0x5e90('0x4b')](_0x55cd38);})[_0x5e90('0x2c')](function(_0x3ea167){_0x2cc7ae[_0x5e90('0x4c')]=_0x3ea167;return _0x2cc7ae;})['then'](respondWithFilteredResult(_0x173f98,_0x55cd38))[_0x5e90('0x4d')](handleError(_0x173f98,null));};exports[_0x5e90('0x4e')]=function(_0x3b3f8a,_0x5a1bd9){var _0x295412={'raw':!![],'where':{'id':_0x3b3f8a[_0x5e90('0x4f')]['id']}},_0x3bb73b={};_0x3bb73b[_0x5e90('0x3b')]=_[_0x5e90('0x3d')](db[_0x5e90('0x36')]['rawAttributes']);_0x3bb73b[_0x5e90('0x3c')]=_[_0x5e90('0x3d')](_0x3b3f8a[_0x5e90('0x3c')]);_0x3bb73b['filters']=_[_0x5e90('0x40')](_0x3bb73b[_0x5e90('0x3b')],_0x3bb73b['query']);_0x295412['attributes']=_[_0x5e90('0x40')](_0x3bb73b[_0x5e90('0x3b')],qs[_0x5e90('0x41')](_0x3b3f8a[_0x5e90('0x3c')][_0x5e90('0x41')]));_0x295412[_0x5e90('0x3f')]=_0x295412[_0x5e90('0x3f')]['length']?_0x295412[_0x5e90('0x3f')]:_0x3bb73b['model'];if(_0x3b3f8a[_0x5e90('0x3c')][_0x5e90('0x50')]){_0x295412[_0x5e90('0x4a')]=[{'all':!![]}];}_0x295412=_[_0x5e90('0x51')]({},_0x295412,_0x3b3f8a['options']);return db[_0x5e90('0x36')][_0x5e90('0x52')](_0x295412)[_0x5e90('0x2c')](handleEntityNotFound(_0x5a1bd9,null))[_0x5e90('0x2c')](respondWithResult(_0x5a1bd9,null))['catch'](handleError(_0x5a1bd9,null));};exports['download']=function(_0x12761a,_0x3b1a5f,_0x5361c8){return db['Plugin'][_0x5e90('0x52')]({'where':{'id':_0x12761a[_0x5e90('0x4f')]['id']},'attributes':[_0x5e90('0x32'),_0x5e90('0x8')],'raw':!![]})[_0x5e90('0x2c')](handleEntityNotFound(_0x3b1a5f,null))[_0x5e90('0x2c')](function(_0x10e683){if(_0x10e683){var _0x2981a9=path[_0x5e90('0x53')](config[_0x5e90('0x54')],_0x5e90('0x55'),util[_0x5e90('0x56')](_0x5e90('0x57'),path[_0x5e90('0x58')](_0x10e683[_0x5e90('0x8')])));var _0x468ffe=fs[_0x5e90('0x59')](_0x2981a9);var _0x12cccc=archiver(_0x5e90('0x5a'),{'zlib':{'level':0x9}});_0x12cccc['on']('warning',function(_0x3a07d6){if(_0x3a07d6['code']===_0x5e90('0x5b')){logger[_0x5e90('0x31')](_0x3a07d6);}else{throw new db[(_0x5e90('0x5c'))]['Error'](_0x5e90('0x5d'));}});_0x12cccc['on']('error',function(_0x38526b){throw new db[(_0x5e90('0x5c'))][(_0x5e90('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x12cccc[_0x5e90('0x5f')](_0x468ffe);_0x12cccc[_0x5e90('0x60')](_0x5e90('0x61'),{'cwd':path[_0x5e90('0x53')](config[_0x5e90('0x54')],_0x5e90('0x55'),path[_0x5e90('0x62')](_0x10e683[_0x5e90('0x8')])),'ignore':[path[_0x5e90('0x53')](path[_0x5e90('0x58')](_0x10e683[_0x5e90('0x8')]),_0x5e90('0x63')),path[_0x5e90('0x53')](path['basename'](_0x10e683[_0x5e90('0x8')]),_0x5e90('0x64'))],'nodir':!![]})['finalize']();_0x468ffe['on']('close',function(){if(!fs['existsSync'](_0x2981a9)){throw new db[(_0x5e90('0x5c'))]['Error'](_0x5e90('0x65'));}return _0x3b1a5f[_0x5e90('0x66')](_0x2981a9,util[_0x5e90('0x56')]('%s.zip',path[_0x5e90('0x58')](_0x10e683[_0x5e90('0x8')])),function(_0x31e72f){if(_0x31e72f){throw new db['Sequelize'][(_0x5e90('0x5e'))](_0x5e90('0x67'));}fs[_0x5e90('0x68')](_0x2981a9);logger[_0x5e90('0x69')](_0x5e90('0x6a'));logger[_0x5e90('0x69')](_0x5e90('0x6b'));});});}return null;})[_0x5e90('0x4d')](handleError(_0x3b1a5f,null));};exports['upload']=function(_0x200595,_0x280e25,_0x293fee){var _0x201403=path[_0x5e90('0x58')](_0x200595[_0x5e90('0x6c')][_0x5e90('0x6d')],path['extname'](_0x200595[_0x5e90('0x6c')]['filename']));var _0xb5ef29=path[_0x5e90('0x53')](config[_0x5e90('0x54')],_0x5e90('0x55'),_0x200595[_0x5e90('0x6c')][_0x5e90('0x6d')]);var _0x189ea9=path['join'](config[_0x5e90('0x54')],_0x5e90('0x55'),_0x201403);logger[_0x5e90('0x69')](_0x5e90('0x6e'),_0xb5ef29);logger[_0x5e90('0x69')]('Plugin\x20upload\x20destination:\x20%s',_0x189ea9);try{fs[_0x5e90('0x6f')](_0xb5ef29,parseInt('0777',0x8));extract(_0xb5ef29,{'dir':_0x189ea9},function(_0x5bca91){if(_0x5bca91){logger[_0x5e90('0x31')](_0x5bca91);handleError(_0x5bca91,!![]);};var _0x299e29=fs[_0x5e90('0x70')](_0x189ea9);if(_0x299e29[_0x5e90('0x42')]>0x1){removeReferences(_0xb5ef29,_0x189ea9);logger[_0x5e90('0x31')]('Invalid\x20plugin\x20structure');return _0x293fee(new Error(_0x5e90('0x71')));}var _0x46ae19=fs['lstatSync'](path['join'](_0x189ea9,_0x299e29[0x0]));if(_0x46ae19[_0x5e90('0x72')]()){removeReferences(_0xb5ef29,_0x189ea9);logger['error'](_0x5e90('0x71'));return _0x293fee(new Error(_0x5e90('0x71')));}if(_0x46ae19['isDirectory']()){var _0x339ab1=fs[_0x5e90('0x70')](path[_0x5e90('0x53')](_0x189ea9,_0x299e29[0x0]));if(_0x339ab1[_0x5e90('0x42')]===0x0){removeReferences(_0xb5ef29,_0x189ea9);logger['error'](_0x5e90('0x71'));return _0x293fee(new Error('Invalid\x20plugin\x20structure'));}var _0x1fca65=_0x339ab1['some'](function(_0x31abf1){return _0x31abf1===_0x5e90('0x73');});if(!_0x1fca65){return _0x293fee(new Error(_0x5e90('0x74')));}var _0x439b98=fs[_0x5e90('0x75')](path['join'](_0x189ea9,_0x299e29[0x0],_0x5e90('0x73')));var _0x516875=JSON[_0x5e90('0x76')](_0x439b98);if('undefined'==typeof _0x516875[_0x5e90('0x32')]){return _0x293fee(new Error(_0x5e90('0x77')));}if(_0x5e90('0x23')==typeof _0x516875[_0x5e90('0x39')]){return _0x293fee(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x516875[_0x5e90('0x78')]){return _0x293fee(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x5e90('0x23')==typeof _0x516875[_0x5e90('0x79')]){return _0x293fee(new Error(_0x5e90('0x7a')));}if(_0x516875['type']===_0x5e90('0x7b')){if(_0x5e90('0x23')==typeof _0x516875[_0x5e90('0x79')]['views']){return _0x293fee(new Error(_0x5e90('0x7c')));}if(_0x5e90('0x23')==typeof _0x516875[_0x5e90('0x79')]['views'][_0x5e90('0x7d')]&&'undefined'==typeof _0x516875[_0x5e90('0x79')][_0x5e90('0x7e')][_0x5e90('0x7f')]){return _0x293fee(new Error(_0x5e90('0x80')));}}else if(_0x516875['type']===_0x5e90('0x81')){if(_0x5e90('0x23')==typeof _0x516875['parameters'][_0x5e90('0x82')]){return _0x293fee(new Error(_0x5e90('0x83')));}if(_0x5e90('0x23')==typeof _0x516875[_0x5e90('0x79')]['scriptPath']){return _0x293fee(new Error(_0x5e90('0x84')));}}else{return _0x293fee(new Error(_0x5e90('0x85')));}var _0x18b6c4=_0x516875[_0x5e90('0x32')];var _0x37c0b2=_0x516875[_0x5e90('0x86')];var _0x3e8c3f=_0x516875[_0x5e90('0x39')];var _0x122286=_0x516875['sidebar']?_0x516875[_0x5e90('0x87')]:'always';var _0x98f230=_0x516875['icon']?_0x516875[_0x5e90('0x88')]:_0x5e90('0x89');var _0x2bc1bc='';var _0x36c0d4='';var _0x5c1c9e='';var _0xbbf7a6='';var _0xff7e5c=_0x516875[_0x5e90('0x78')];if(_0x3e8c3f===_0x5e90('0x7b')){if('undefined'!=typeof _0x516875['parameters'][_0x5e90('0x7e')]['admin']){var _0x5090bf=_0x516875['parameters'][_0x5e90('0x7e')][_0x5e90('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x5e90('0x8a')](_0x5090bf)){_0x2bc1bc=path[_0x5e90('0x53')](_0x5e90('0x8b'),_0x201403,_0x299e29[0x0],_0x5090bf);}else{_0x2bc1bc=_0x5090bf;}}else{logger['info'](_0x5e90('0x8c'));}if(_0x5e90('0x23')!=typeof _0x516875[_0x5e90('0x79')][_0x5e90('0x7e')][_0x5e90('0x7f')]){var _0xf59b6=_0x516875[_0x5e90('0x79')]['views'][_0x5e90('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x5e90('0x8a')](_0xf59b6)){_0x36c0d4=path[_0x5e90('0x53')](_0x5e90('0x8b'),_0x201403,_0x299e29[0x0],_0xf59b6);}else{_0x36c0d4=_0xf59b6;}}else{logger['info'](_0x5e90('0x8d'));}}else if(_0x3e8c3f===_0x5e90('0x81')){_0x5c1c9e=_0x516875['parameters'][_0x5e90('0x82')];_0xbbf7a6=_0x516875[_0x5e90('0x79')][_0x5e90('0x8e')];if(_0x5e90('0x23')!=typeof _0x516875['parameters'][_0x5e90('0x7e')]){if(_0x5e90('0x23')!=typeof _0x516875[_0x5e90('0x79')][_0x5e90('0x7e')][_0x5e90('0x7d')]){var _0x5090bf=_0x516875['parameters'][_0x5e90('0x7e')][_0x5e90('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x5e90('0x8a')](_0x5090bf)){_0x2bc1bc=path[_0x5e90('0x53')](_0x5e90('0x8b'),_0x201403,_0x299e29[0x0],_0x5090bf);}else{_0x2bc1bc=_0x5090bf;}}if(_0x5e90('0x23')!=typeof _0x516875[_0x5e90('0x79')][_0x5e90('0x7e')]['agent']){var _0xf59b6=_0x516875[_0x5e90('0x79')][_0x5e90('0x7e')][_0x5e90('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x5e90('0x8a')](_0xf59b6)){_0x36c0d4=path['join']('plugins',_0x201403,_0x299e29[0x0],_0xf59b6);}else{_0x36c0d4=_0xf59b6;}}}}var _0x4553e4={'name':_0x18b6c4,'description':_0x37c0b2,'path':path[_0x5e90('0x53')](_0x201403,_0x299e29[0x0]),'type':_0x3e8c3f,'sidebar':_0x122286,'icon':_0x98f230,'adminUrl':_0x2bc1bc,'agentUrl':_0x36c0d4,'scriptName':_0x5c1c9e,'scriptPath':_0xbbf7a6,'version':_0xff7e5c};removeReferences(_0xb5ef29,null);return db[_0x5e90('0x36')]['create'](_0x4553e4)[_0x5e90('0x2c')](function(_0x4fc412){var _0x270c2d={'role':_0x200595['body']['role'],'userProfileId':_0x200595[_0x5e90('0x8f')]['userProfileId']};if(!_0x270c2d)throw new Error(_0x5e90('0x90'));if(_0x270c2d[_0x5e90('0x91')]===_0x5e90('0x92')){var _0x15835d=_0x4fc412[_0x5e90('0x93')]({'plain':!![]});return db[_0x5e90('0x94')]['find']({'where':{'name':_0x5e90('0x2e'),'userProfileId':_0x270c2d['userProfileId']},'raw':!![]})[_0x5e90('0x2c')](function(_0x3fd8f3){if(_0x3fd8f3&&_0x3fd8f3[_0x5e90('0x95')]===0x0){return db['UserProfileResource'][_0x5e90('0x96')]({'name':_0x15835d[_0x5e90('0x32')],'resourceId':_0x15835d['id'],'type':_0x3fd8f3[_0x5e90('0x32')],'sectionId':_0x3fd8f3['id']},{})[_0x5e90('0x2c')](function(){return _0x4fc412;});}else{return _0x4fc412;}})['catch'](function(_0x4ab2f4){logger[_0x5e90('0x31')](_0x5e90('0x97'),_0x4ab2f4);throw _0x4ab2f4;});}return _0x4fc412;})[_0x5e90('0x2c')](respondWithResult(_0x280e25,null))['catch'](handleError(_0x280e25,null));}});}catch(_0x4ad750){_0x280e25[_0x5e90('0x1f')](0x1f4)['send'](_0x4ad750);}};function removeReferences(_0x79d3b8,_0x69bb7){try{if(_0x79d3b8){fs[_0x5e90('0x68')](_0x79d3b8);logger[_0x5e90('0x69')]('Zip\x20archive\x20removed');}if(_0x69bb7){rimraf(_0x69bb7,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x14447b){logger[_0x5e90('0x31')](_0x14447b);}}exports[_0x5e90('0x2b')]=function(_0x534131,_0x3315d4,_0x539001){return db[_0x5e90('0x36')]['find']({'where':{'id':_0x534131['params']['id']}})['then'](handleEntityNotFound(_0x3315d4,null))[_0x5e90('0x2c')](saveUpdates(_0x534131[_0x5e90('0x8f')],null))[_0x5e90('0x2c')](respondWithResult(_0x3315d4,null))[_0x5e90('0x4d')](handleError(_0x3315d4,null));};exports['delete']=function(_0x2ec6a4,_0x3dec3f,_0x4bf08f){return db['Plugin']['find']({'where':{'id':_0x2ec6a4['params']['id']}})['then'](function(_0x2e4ab1){if(_0x2e4ab1){return _0x2e4ab1[_0x5e90('0x2d')]();}})[_0x5e90('0x2c')](function(_0x648c7e){rimraf(path[_0x5e90('0x53')](config['root'],'server/files/plugins',path['dirname'](_0x648c7e[_0x5e90('0x8')])),function(){});return _0x648c7e;})[_0x5e90('0x2c')](handleEntityNotFound(_0x3dec3f,null))[_0x5e90('0x2c')](respondWithStatusCode(_0x3dec3f,null))[_0x5e90('0x4d')](handleError(_0x3dec3f,null));};exports['webhookGet']=function(_0x39a1b5,_0x519ec0,_0x2198d1){return BPromise[_0x5e90('0x98')]()[_0x5e90('0x2c')](function(){if(!_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x8')]){throw new Error(_0x5e90('0x99'));}if(!_0x39a1b5[_0x5e90('0x3c')]['port']){throw new Error(_0x5e90('0x9a'));}var _0x5def48=_0x39a1b5[_0x5e90('0x3c')]['hostname']?_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x9b')]+':'+_0x39a1b5[_0x5e90('0x3c')]['port']:_0x5e90('0x9c')+_0x39a1b5[_0x5e90('0x3c')]['port'];var _0x643608=_0x39a1b5[_0x5e90('0x3c')]['json']?_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x21')]:!![];var _0x665794=_0x39a1b5['query'][_0x5e90('0x9d')]?_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x9d')]:null;var _0xf804b3={'method':_0x39a1b5['method'],'uri':util[_0x5e90('0x56')](_0x5e90('0x9e'),_0x5def48,_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x8')]),'json':_0x643608,'resolveWithFullResponse':!![],'encoding':_0x665794,'qs':_0x39a1b5[_0x5e90('0x3c')]};if(_0x39a1b5[_0x5e90('0x9f')]){_0xf804b3[_0x5e90('0x9f')]=_0x39a1b5[_0x5e90('0x9f')];if(_0xf804b3[_0x5e90('0x9f')][_0x5e90('0xa0')]){delete _0xf804b3[_0x5e90('0x9f')]['content-length'];}}if(_0xf804b3['headers']['content-type']){delete _0xf804b3['headers']['content-type'];}return rp(_0xf804b3);})[_0x5e90('0x2c')](function(_0x4ccf04){if(_0x4ccf04){_0x519ec0[_0x5e90('0x26')](_0x4ccf04[_0x5e90('0x9f')]);logger[_0x5e90('0x69')](_0x4ccf04[_0x5e90('0x8f')]);if(_[_0x5e90('0xa1')](_0x39a1b5[_0x5e90('0x3c')][_0x5e90('0x8')],_0x5e90('0x66'))&&_0x4ccf04[_0x5e90('0xa2')]==0x1f4){return _0x519ec0[_0x5e90('0x30')](_0x4ccf04[_0x5e90('0xa2')]);}else{return _0x519ec0[_0x5e90('0x1f')](_0x4ccf04['statusCode'])['send'](_0x4ccf04[_0x5e90('0x8f')]);}}else{return _0x519ec0[_0x5e90('0x30')](0xc8);}})[_0x5e90('0x4d')](handleError(_0x519ec0,null));};exports[_0x5e90('0xa3')]=function(_0x253cd7,_0x18dc6f,_0x27bf8a){return BPromise['resolve']()[_0x5e90('0x2c')](function(){if(!_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x8')]){throw new Error(_0x5e90('0x99'));}if(!_0x253cd7[_0x5e90('0x3c')][_0x5e90('0xa4')]){throw new Error(_0x5e90('0x9a'));}var _0xb6da80=_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x9b')]?_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x9b')]+':'+_0x253cd7[_0x5e90('0x3c')]['port']:_0x5e90('0x9c')+_0x253cd7[_0x5e90('0x3c')][_0x5e90('0xa4')];var _0xa476d0=_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x21')]?_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x21')]:!![];var _0x2408db=_0x253cd7['query'][_0x5e90('0x9d')]?_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x9d')]:null;var _0x20642f={'method':_0x253cd7[_0x5e90('0xa5')],'uri':util['format'](_0x5e90('0x9e'),_0xb6da80,_0x253cd7[_0x5e90('0x3c')][_0x5e90('0x8')]),'json':_0xa476d0,'resolveWithFullResponse':!![],'encoding':_0x2408db,'body':_0x253cd7[_0x5e90('0x8f')]};if(_0x253cd7['headers']){_0x20642f[_0x5e90('0x9f')]=_0x253cd7[_0x5e90('0x9f')];if(_0x20642f[_0x5e90('0x9f')][_0x5e90('0xa0')]){delete _0x20642f[_0x5e90('0x9f')]['content-length'];}}if(_0x20642f[_0x5e90('0x9f')][_0x5e90('0xa6')]){delete _0x20642f[_0x5e90('0x9f')][_0x5e90('0xa6')];}return rp(_0x20642f);})[_0x5e90('0x2c')](function(_0x42f129){if(_0x42f129){_0x18dc6f[_0x5e90('0x26')](_0x42f129[_0x5e90('0x9f')]);logger['info'](_0x42f129[_0x5e90('0x8f')]);return _0x18dc6f[_0x5e90('0x1f')](_0x42f129['statusCode'])[_0x5e90('0x33')](_0x42f129[_0x5e90('0x8f')]);}else{return _0x18dc6f[_0x5e90('0x30')](0xc8);}})[_0x5e90('0x4d')](handleError(_0x18dc6f,null));}; \ No newline at end of file +var _0xd158=['Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Plugins','autoAssociation','unlinkSync','Extracted\x20folder\x20removed','params','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','statusCode','resolve','http://localhost:','%s%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','then','get','error','stack','name','send','index','map','Plugin','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','find','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','format','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent'];(function(_0x3b3107,_0x4003d5){var _0x1132ae=function(_0x16c946){while(--_0x16c946){_0x3b3107['push'](_0x3b3107['shift']());}};_0x1132ae(++_0x4003d5);}(_0xd158,0xd2));var _0x8d15=function(_0x2554dd,_0x2f188d){_0x2554dd=_0x2554dd-0x0;var _0x37f271=_0xd158[_0x2554dd];return _0x37f271;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d15('0x0'));var zipdir=require(_0x8d15('0x1'));var jsonpatch=require(_0x8d15('0x2'));var rp=require(_0x8d15('0x3'));var moment=require(_0x8d15('0x4'));var BPromise=require(_0x8d15('0x5'));var Mustache=require(_0x8d15('0x6'));var util=require('util');var path=require(_0x8d15('0x7'));var sox=require(_0x8d15('0x8'));var csv=require(_0x8d15('0x9'));var ejs=require(_0x8d15('0xa'));var fs=require('fs');var fs_extra=require(_0x8d15('0xb'));var _=require(_0x8d15('0xc'));var squel=require(_0x8d15('0xd'));var crypto=require('crypto');var jsforce=require(_0x8d15('0xe'));var deskjs=require(_0x8d15('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8d15('0x10'));var extract=require(_0x8d15('0x11'));var rimraf=require('rimraf');var archiver=require(_0x8d15('0x12'));var Redis=require(_0x8d15('0x13'));var authService=require(_0x8d15('0x14'));var qs=require(_0x8d15('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d15('0x16'));var logger=require('../../config/logger')(_0x8d15('0x17'));var utils=require(_0x8d15('0x18'));var config=require(_0x8d15('0x19'));var licenseUtil=require(_0x8d15('0x1a'));var db=require(_0x8d15('0x1b'))['db'];config[_0x8d15('0x1c')]=_[_0x8d15('0x1d')](config[_0x8d15('0x1c')],{'host':_0x8d15('0x1e'),'port':0x18eb});var socket=require(_0x8d15('0x1f'))(new Redis(config[_0x8d15('0x1c')]));require(_0x8d15('0x20'))[_0x8d15('0x21')](socket);function respondWithStatusCode(_0x2fff09,_0x3380d9){_0x3380d9=_0x3380d9||0xcc;return function(_0x2328f6){if(_0x2328f6){return _0x2fff09[_0x8d15('0x22')](_0x3380d9);}return _0x2fff09[_0x8d15('0x23')](_0x3380d9)[_0x8d15('0x24')]();};}function respondWithResult(_0x5237fa,_0x3ecab0){_0x3ecab0=_0x3ecab0||0xc8;return function(_0x17f533){if(_0x17f533){return _0x5237fa['status'](_0x3ecab0)[_0x8d15('0x25')](_0x17f533);}};}function respondWithFilteredResult(_0xa6c75d,_0x35b21e){return function(_0x124252){if(_0x124252){var _0xdb005d=typeof _0x35b21e['offset']===_0x8d15('0x26')&&typeof _0x35b21e[_0x8d15('0x27')]===_0x8d15('0x26');var _0x245ad2=_0x124252[_0x8d15('0x28')];var _0x27a10d=_0xdb005d?0x0:_0x35b21e['offset'];var _0x38958a=_0xdb005d?_0x124252[_0x8d15('0x28')]:_0x35b21e[_0x8d15('0x29')]+_0x35b21e[_0x8d15('0x27')];var _0x13e890;if(_0x38958a>=_0x245ad2){_0x38958a=_0x245ad2;_0x13e890=0xc8;}else{_0x13e890=0xce;}_0xa6c75d[_0x8d15('0x23')](_0x13e890);return _0xa6c75d[_0x8d15('0x2a')]('Content-Range',_0x27a10d+'-'+_0x38958a+'/'+_0x245ad2)['json'](_0x124252);}return null;};}function patchUpdates(_0x25003b){return function(_0x262f6f){try{jsonpatch['apply'](_0x262f6f,_0x25003b,!![]);}catch(_0x16f3a4){return BPromise['reject'](_0x16f3a4);}return _0x262f6f['save']();};}function saveUpdates(_0x5c339d,_0x540c81){return function(_0x4eb40c){if(_0x4eb40c){return _0x4eb40c[_0x8d15('0x2b')](_0x5c339d)['then'](function(_0x11fc2c){return _0x11fc2c;});}return null;};}function removeEntity(_0x2fc824,_0x1b9fd4){return function(_0x505fc3){if(_0x505fc3){return _0x505fc3[_0x8d15('0x2c')]()[_0x8d15('0x2d')](function(){var _0x37a0e1=_0x505fc3[_0x8d15('0x2e')]({'plain':!![]});var _0x5aed9b='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x5aed9b,'resourceId':_0x37a0e1['id']}})[_0x8d15('0x2d')](function(){return _0x505fc3;});})[_0x8d15('0x2d')](function(){_0x2fc824[_0x8d15('0x23')](0xcc)[_0x8d15('0x24')]();});}};}function handleEntityNotFound(_0xc9101d,_0xeec6b){return function(_0x3bccbc){if(!_0x3bccbc){_0xc9101d[_0x8d15('0x22')](0x194);}return _0x3bccbc;};}function handleError(_0x5d758e,_0x2fc588){_0x2fc588=_0x2fc588||0x1f4;return function(_0x11685e){logger[_0x8d15('0x2f')](_0x11685e[_0x8d15('0x30')]);if(_0x11685e[_0x8d15('0x31')]){delete _0x11685e['name'];}_0x5d758e[_0x8d15('0x23')](_0x2fc588)[_0x8d15('0x32')](_0x11685e);};}exports[_0x8d15('0x33')]=function(_0x328c3d,_0xe72e62){var _0x10c7a4={},_0x1e9dc2={},_0x311d34={'count':0x0,'rows':[]};var _0x8f1b9b=_[_0x8d15('0x34')](db[_0x8d15('0x35')]['rawAttributes'],function(_0x252dd2){return{'name':_0x252dd2[_0x8d15('0x36')],'type':_0x252dd2[_0x8d15('0x37')][_0x8d15('0x38')]};});_0x1e9dc2[_0x8d15('0x39')]=_[_0x8d15('0x34')](_0x8f1b9b,_0x8d15('0x31'));_0x1e9dc2[_0x8d15('0x3a')]=_['keys'](_0x328c3d[_0x8d15('0x3a')]);_0x1e9dc2[_0x8d15('0x3b')]=_['intersection'](_0x1e9dc2[_0x8d15('0x39')],_0x1e9dc2[_0x8d15('0x3a')]);_0x10c7a4[_0x8d15('0x3c')]=_[_0x8d15('0x3d')](_0x1e9dc2[_0x8d15('0x39')],qs[_0x8d15('0x3e')](_0x328c3d['query'][_0x8d15('0x3e')]));_0x10c7a4[_0x8d15('0x3c')]=_0x10c7a4[_0x8d15('0x3c')][_0x8d15('0x3f')]?_0x10c7a4['attributes']:_0x1e9dc2[_0x8d15('0x39')];if(!_0x328c3d[_0x8d15('0x3a')][_0x8d15('0x40')](_0x8d15('0x41'))){_0x10c7a4[_0x8d15('0x27')]=qs[_0x8d15('0x27')](_0x328c3d['query'][_0x8d15('0x27')]);_0x10c7a4[_0x8d15('0x29')]=qs['offset'](_0x328c3d[_0x8d15('0x3a')]['offset']);}_0x10c7a4[_0x8d15('0x42')]=qs[_0x8d15('0x43')](_0x328c3d[_0x8d15('0x3a')][_0x8d15('0x43')]);_0x10c7a4[_0x8d15('0x44')]=qs[_0x8d15('0x3b')](_[_0x8d15('0x45')](_0x328c3d[_0x8d15('0x3a')],_0x1e9dc2['filters']),_0x8f1b9b);if(_0x328c3d[_0x8d15('0x3a')][_0x8d15('0x46')]){_0x10c7a4['where']=_[_0x8d15('0x47')](_0x10c7a4['where'],{'$or':_[_0x8d15('0x34')](_0x8f1b9b,function(_0x11f6f2){if(_0x11f6f2['type']!==_0x8d15('0x48')){var _0x5254ef={};_0x5254ef[_0x11f6f2['name']]={'$like':'%'+_0x328c3d[_0x8d15('0x3a')]['filter']+'%'};return _0x5254ef;}})});}_0x10c7a4=_[_0x8d15('0x47')]({},_0x10c7a4,_0x328c3d[_0x8d15('0x49')]);var _0x1bc48e={'where':_0x10c7a4['where']};return db[_0x8d15('0x35')]['count'](_0x1bc48e)[_0x8d15('0x2d')](function(_0x16aed2){_0x311d34[_0x8d15('0x28')]=_0x16aed2;if(_0x328c3d[_0x8d15('0x3a')][_0x8d15('0x4a')]){_0x10c7a4['include']=[{'all':!![]}];}return db[_0x8d15('0x35')][_0x8d15('0x4b')](_0x10c7a4);})[_0x8d15('0x2d')](function(_0xd973c2){_0x311d34[_0x8d15('0x4c')]=_0xd973c2;return _0x311d34;})[_0x8d15('0x2d')](respondWithFilteredResult(_0xe72e62,_0x10c7a4))[_0x8d15('0x4d')](handleError(_0xe72e62,null));};exports['show']=function(_0x436fde,_0x5e4eca){var _0x4b2832={'raw':!![],'where':{'id':_0x436fde['params']['id']}},_0x5bb1f8={};_0x5bb1f8['model']=_[_0x8d15('0x4e')](db[_0x8d15('0x35')]['rawAttributes']);_0x5bb1f8[_0x8d15('0x3a')]=_[_0x8d15('0x4e')](_0x436fde[_0x8d15('0x3a')]);_0x5bb1f8[_0x8d15('0x3b')]=_[_0x8d15('0x3d')](_0x5bb1f8[_0x8d15('0x39')],_0x5bb1f8[_0x8d15('0x3a')]);_0x4b2832[_0x8d15('0x3c')]=_[_0x8d15('0x3d')](_0x5bb1f8[_0x8d15('0x39')],qs[_0x8d15('0x3e')](_0x436fde['query'][_0x8d15('0x3e')]));_0x4b2832[_0x8d15('0x3c')]=_0x4b2832[_0x8d15('0x3c')][_0x8d15('0x3f')]?_0x4b2832[_0x8d15('0x3c')]:_0x5bb1f8[_0x8d15('0x39')];if(_0x436fde[_0x8d15('0x3a')][_0x8d15('0x4a')]){_0x4b2832['include']=[{'all':!![]}];}_0x4b2832=_[_0x8d15('0x47')]({},_0x4b2832,_0x436fde[_0x8d15('0x49')]);return db[_0x8d15('0x35')][_0x8d15('0x4f')](_0x4b2832)[_0x8d15('0x2d')](handleEntityNotFound(_0x5e4eca,null))['then'](respondWithResult(_0x5e4eca,null))[_0x8d15('0x4d')](handleError(_0x5e4eca,null));};exports['download']=function(_0x3d029e,_0x1e211c,_0x436c65){return db[_0x8d15('0x35')][_0x8d15('0x4f')]({'where':{'id':_0x3d029e['params']['id']},'attributes':[_0x8d15('0x31'),_0x8d15('0x7')],'raw':!![]})[_0x8d15('0x2d')](handleEntityNotFound(_0x1e211c,null))[_0x8d15('0x2d')](function(_0x10831d){if(_0x10831d){var _0x1471d3=path[_0x8d15('0x50')](config[_0x8d15('0x51')],_0x8d15('0x52'),util['format'](_0x8d15('0x53'),path[_0x8d15('0x54')](_0x10831d[_0x8d15('0x7')])));var _0x3d925c=fs['createWriteStream'](_0x1471d3);var _0x5a38c3=archiver(_0x8d15('0x55'),{'zlib':{'level':0x9}});_0x5a38c3['on'](_0x8d15('0x56'),function(_0x43ca2f){if(_0x43ca2f[_0x8d15('0x57')]==='ENOENT'){logger[_0x8d15('0x2f')](_0x43ca2f);}else{throw new db[(_0x8d15('0x58'))][(_0x8d15('0x59'))](_0x8d15('0x5a'));}});_0x5a38c3['on']('error',function(_0x1fa20d){throw new db[(_0x8d15('0x58'))][(_0x8d15('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5a38c3['pipe'](_0x3d925c);_0x5a38c3[_0x8d15('0x5b')]('**/*',{'cwd':path['join'](config['root'],_0x8d15('0x52'),path[_0x8d15('0x5c')](_0x10831d['path'])),'ignore':[path[_0x8d15('0x50')](path[_0x8d15('0x54')](_0x10831d[_0x8d15('0x7')]),_0x8d15('0x5d')),path[_0x8d15('0x50')](path[_0x8d15('0x54')](_0x10831d[_0x8d15('0x7')]),_0x8d15('0x5e'))],'nodir':!![]})[_0x8d15('0x5f')]();_0x3d925c['on'](_0x8d15('0x60'),function(){if(!fs[_0x8d15('0x61')](_0x1471d3)){throw new db[(_0x8d15('0x58'))][(_0x8d15('0x59'))]('Plugin\x20not\x20found');}return _0x1e211c[_0x8d15('0x62')](_0x1471d3,util[_0x8d15('0x63')](_0x8d15('0x53'),path[_0x8d15('0x54')](_0x10831d[_0x8d15('0x7')])),function(_0x239227){if(_0x239227){throw new db[(_0x8d15('0x58'))]['Error'](_0x8d15('0x64'));}fs['unlinkSync'](_0x1471d3);logger[_0x8d15('0x65')]('Download\x20completed');logger['info'](_0x8d15('0x66'));});});}return null;})[_0x8d15('0x4d')](handleError(_0x1e211c,null));};exports[_0x8d15('0x67')]=function(_0x4e79b7,_0x5eeb97,_0x2e35d2){var _0x43decc=path['basename'](_0x4e79b7[_0x8d15('0x68')][_0x8d15('0x69')],path[_0x8d15('0x6a')](_0x4e79b7[_0x8d15('0x68')][_0x8d15('0x69')]));var _0x265330=path[_0x8d15('0x50')](config[_0x8d15('0x51')],_0x8d15('0x52'),_0x4e79b7[_0x8d15('0x68')][_0x8d15('0x69')]);var _0x2818a7=path[_0x8d15('0x50')](config['root'],_0x8d15('0x52'),_0x43decc);logger['info'](_0x8d15('0x6b'),_0x265330);logger[_0x8d15('0x65')](_0x8d15('0x6c'),_0x2818a7);try{fs[_0x8d15('0x6d')](_0x265330,parseInt(_0x8d15('0x6e'),0x8));extract(_0x265330,{'dir':_0x2818a7},function(_0x2e70ea){if(_0x2e70ea){logger[_0x8d15('0x2f')](_0x2e70ea);handleError(_0x2e70ea,!![]);};var _0x45071a=fs['readdirSync'](_0x2818a7);if(_0x45071a[_0x8d15('0x3f')]>0x1){removeReferences(_0x265330,_0x2818a7);logger[_0x8d15('0x2f')](_0x8d15('0x6f'));return _0x2e35d2(new Error(_0x8d15('0x6f')));}var _0x381d02=fs[_0x8d15('0x70')](path[_0x8d15('0x50')](_0x2818a7,_0x45071a[0x0]));if(_0x381d02[_0x8d15('0x71')]()){removeReferences(_0x265330,_0x2818a7);logger[_0x8d15('0x2f')](_0x8d15('0x6f'));return _0x2e35d2(new Error(_0x8d15('0x6f')));}if(_0x381d02[_0x8d15('0x72')]()){var _0x118207=fs[_0x8d15('0x73')](path[_0x8d15('0x50')](_0x2818a7,_0x45071a[0x0]));if(_0x118207[_0x8d15('0x3f')]===0x0){removeReferences(_0x265330,_0x2818a7);logger['error'](_0x8d15('0x6f'));return _0x2e35d2(new Error('Invalid\x20plugin\x20structure'));}var _0x2f0d66=_0x118207[_0x8d15('0x74')](function(_0x3c87e4){return _0x3c87e4===_0x8d15('0x75');});if(!_0x2f0d66){return _0x2e35d2(new Error(_0x8d15('0x76')));}var _0x29c794=fs[_0x8d15('0x77')](path[_0x8d15('0x50')](_0x2818a7,_0x45071a[0x0],_0x8d15('0x75')));var _0x3730f2=JSON[_0x8d15('0x78')](_0x29c794);if(_0x8d15('0x26')==typeof _0x3730f2[_0x8d15('0x31')]){return _0x2e35d2(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x3730f2[_0x8d15('0x37')]){return _0x2e35d2(new Error(_0x8d15('0x79')));}if(_0x8d15('0x26')==typeof _0x3730f2[_0x8d15('0x7a')]){return _0x2e35d2(new Error(_0x8d15('0x7b')));}if(_0x8d15('0x26')==typeof _0x3730f2['parameters']){return _0x2e35d2(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3730f2[_0x8d15('0x37')]===_0x8d15('0x7c')){if(_0x8d15('0x26')==typeof _0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')]){return _0x2e35d2(new Error(_0x8d15('0x7f')));}if('undefined'==typeof _0x3730f2['parameters'][_0x8d15('0x7e')][_0x8d15('0x80')]&&'undefined'==typeof _0x3730f2[_0x8d15('0x7d')]['views'][_0x8d15('0x81')]){return _0x2e35d2(new Error(_0x8d15('0x82')));}}else if(_0x3730f2['type']===_0x8d15('0x83')){if(_0x8d15('0x26')==typeof _0x3730f2[_0x8d15('0x7d')]['scriptName']){return _0x2e35d2(new Error(_0x8d15('0x84')));}if('undefined'==typeof _0x3730f2[_0x8d15('0x7d')][_0x8d15('0x85')]){return _0x2e35d2(new Error(_0x8d15('0x86')));}}else{return _0x2e35d2(new Error(_0x8d15('0x87')));}var _0x4b8380=_0x3730f2[_0x8d15('0x31')];var _0x1819aa=_0x3730f2[_0x8d15('0x88')];var _0x558131=_0x3730f2[_0x8d15('0x37')];var _0x37987a=_0x3730f2[_0x8d15('0x89')]?_0x3730f2[_0x8d15('0x89')]:_0x8d15('0x8a');var _0x460f91=_0x3730f2[_0x8d15('0x8b')]?_0x3730f2['icon']:'icon-apps';var _0x44c45e='';var _0x51f025='';var _0x37b525='';var _0x4738e='';var _0x1dbf43=_0x3730f2[_0x8d15('0x7a')];if(_0x558131===_0x8d15('0x7c')){if(_0x8d15('0x26')!=typeof _0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')][_0x8d15('0x80')]){var _0x4995b8=_0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8d15('0x8c')](_0x4995b8)){_0x44c45e=path[_0x8d15('0x50')](_0x8d15('0x8d'),_0x43decc,_0x45071a[0x0],_0x4995b8);}else{_0x44c45e=_0x4995b8;}}else{logger['info'](_0x8d15('0x8e'));}if('undefined'!=typeof _0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')][_0x8d15('0x81')]){var _0x65fc7e=_0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x65fc7e)){_0x51f025=path['join'](_0x8d15('0x8d'),_0x43decc,_0x45071a[0x0],_0x65fc7e);}else{_0x51f025=_0x65fc7e;}}else{logger[_0x8d15('0x65')](_0x8d15('0x8f'));}}else if(_0x558131===_0x8d15('0x83')){_0x37b525=_0x3730f2[_0x8d15('0x7d')]['scriptName'];_0x4738e=_0x3730f2[_0x8d15('0x7d')]['scriptPath'];if('undefined'!=typeof _0x3730f2[_0x8d15('0x7d')]['views']){if(_0x8d15('0x26')!=typeof _0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')][_0x8d15('0x80')]){var _0x4995b8=_0x3730f2[_0x8d15('0x7d')]['views'][_0x8d15('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4995b8)){_0x44c45e=path[_0x8d15('0x50')](_0x8d15('0x8d'),_0x43decc,_0x45071a[0x0],_0x4995b8);}else{_0x44c45e=_0x4995b8;}}if(_0x8d15('0x26')!=typeof _0x3730f2['parameters'][_0x8d15('0x7e')][_0x8d15('0x81')]){var _0x65fc7e=_0x3730f2[_0x8d15('0x7d')][_0x8d15('0x7e')][_0x8d15('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x8d15('0x8c')](_0x65fc7e)){_0x51f025=path['join'](_0x8d15('0x8d'),_0x43decc,_0x45071a[0x0],_0x65fc7e);}else{_0x51f025=_0x65fc7e;}}}}var _0x4e20fb={'name':_0x4b8380,'description':_0x1819aa,'path':path[_0x8d15('0x50')](_0x43decc,_0x45071a[0x0]),'type':_0x558131,'sidebar':_0x37987a,'icon':_0x460f91,'adminUrl':_0x44c45e,'agentUrl':_0x51f025,'scriptName':_0x37b525,'scriptPath':_0x4738e,'version':_0x1dbf43};removeReferences(_0x265330,null);return db[_0x8d15('0x35')][_0x8d15('0x90')](_0x4e20fb)[_0x8d15('0x2d')](function(_0x93101){var _0x5140b0={'role':_0x4e79b7[_0x8d15('0x91')][_0x8d15('0x92')],'userProfileId':_0x4e79b7[_0x8d15('0x91')][_0x8d15('0x93')]};if(!_0x5140b0)throw new Error(_0x8d15('0x94'));if(_0x5140b0[_0x8d15('0x92')]==='user'){var _0x36c303=_0x93101[_0x8d15('0x2e')]({'plain':!![]});return db[_0x8d15('0x95')][_0x8d15('0x4f')]({'where':{'name':_0x8d15('0x96'),'userProfileId':_0x5140b0[_0x8d15('0x93')]},'raw':!![]})[_0x8d15('0x2d')](function(_0x4d4dff){if(_0x4d4dff&&_0x4d4dff[_0x8d15('0x97')]===0x0){return db['UserProfileResource'][_0x8d15('0x90')]({'name':_0x36c303[_0x8d15('0x31')],'resourceId':_0x36c303['id'],'type':_0x4d4dff['name'],'sectionId':_0x4d4dff['id']},{})[_0x8d15('0x2d')](function(){return _0x93101;});}else{return _0x93101;}})['catch'](function(_0x3d96d1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d96d1);throw _0x3d96d1;});}return _0x93101;})[_0x8d15('0x2d')](respondWithResult(_0x5eeb97,null))['catch'](handleError(_0x5eeb97,null));}});}catch(_0x56287d){_0x5eeb97[_0x8d15('0x23')](0x1f4)[_0x8d15('0x32')](_0x56287d);}};function removeReferences(_0x2a8ebe,_0x1e136f){try{if(_0x2a8ebe){fs[_0x8d15('0x98')](_0x2a8ebe);logger[_0x8d15('0x65')]('Zip\x20archive\x20removed');}if(_0x1e136f){rimraf(_0x1e136f,function(){});logger[_0x8d15('0x65')](_0x8d15('0x99'));}}catch(_0x69cde7){logger['error'](_0x69cde7);}}exports[_0x8d15('0x2b')]=function(_0x3c6448,_0x555c89,_0x2c90d4){return db['Plugin'][_0x8d15('0x4f')]({'where':{'id':_0x3c6448[_0x8d15('0x9a')]['id']}})[_0x8d15('0x2d')](handleEntityNotFound(_0x555c89,null))['then'](saveUpdates(_0x3c6448[_0x8d15('0x91')],null))[_0x8d15('0x2d')](respondWithResult(_0x555c89,null))['catch'](handleError(_0x555c89,null));};exports[_0x8d15('0x9b')]=function(_0x255888,_0x54433f,_0xb96f32){return db['Plugin']['find']({'where':{'id':_0x255888[_0x8d15('0x9a')]['id']}})[_0x8d15('0x2d')](function(_0x153b9b){if(_0x153b9b){return _0x153b9b[_0x8d15('0x2c')]();}})[_0x8d15('0x2d')](function(_0x15c3dc){rimraf(path[_0x8d15('0x50')](config[_0x8d15('0x51')],'server/files/plugins',path[_0x8d15('0x5c')](_0x15c3dc[_0x8d15('0x7')])),function(){});return _0x15c3dc;})[_0x8d15('0x2d')](handleEntityNotFound(_0x54433f,null))[_0x8d15('0x2d')](respondWithStatusCode(_0x54433f,null))[_0x8d15('0x4d')](handleError(_0x54433f,null));};exports[_0x8d15('0x9c')]=function(_0x172db2,_0x41440d,_0x704da3){return BPromise['resolve']()[_0x8d15('0x2d')](function(){if(!_0x172db2['query'][_0x8d15('0x7')]){throw new Error(_0x8d15('0x9d'));}if(!_0x172db2[_0x8d15('0x3a')][_0x8d15('0x9e')]){throw new Error(_0x8d15('0x9f'));}var _0x4245e7=_0x172db2['query'][_0x8d15('0xa0')]?_0x172db2[_0x8d15('0x3a')]['hostname']+':'+_0x172db2[_0x8d15('0x3a')][_0x8d15('0x9e')]:'http://localhost:'+_0x172db2[_0x8d15('0x3a')][_0x8d15('0x9e')];var _0x432e38=_0x172db2['query']['json']?_0x172db2[_0x8d15('0x3a')][_0x8d15('0x25')]:!![];var _0x19cb33=_0x172db2[_0x8d15('0x3a')][_0x8d15('0xa1')]?_0x172db2[_0x8d15('0x3a')][_0x8d15('0xa1')]:null;var _0x44f75e={'method':_0x172db2[_0x8d15('0xa2')],'uri':util[_0x8d15('0x63')]('%s%s',_0x4245e7,_0x172db2['query'][_0x8d15('0x7')]),'json':_0x432e38,'resolveWithFullResponse':!![],'encoding':_0x19cb33,'qs':_0x172db2[_0x8d15('0x3a')]};if(_0x172db2[_0x8d15('0xa3')]){_0x44f75e[_0x8d15('0xa3')]=_0x172db2[_0x8d15('0xa3')];if(_0x44f75e['headers'][_0x8d15('0xa4')]){delete _0x44f75e[_0x8d15('0xa3')]['content-length'];}}if(_0x44f75e[_0x8d15('0xa3')]['content-type']){delete _0x44f75e[_0x8d15('0xa3')][_0x8d15('0xa5')];}return rp(_0x44f75e);})[_0x8d15('0x2d')](function(_0xcf4872){if(_0xcf4872){_0x41440d[_0x8d15('0x2a')](_0xcf4872[_0x8d15('0xa3')]);logger['info'](_0xcf4872[_0x8d15('0x91')]);if(_['endsWith'](_0x172db2['query'][_0x8d15('0x7')],_0x8d15('0x62'))&&_0xcf4872[_0x8d15('0xa6')]==0x1f4){return _0x41440d[_0x8d15('0x22')](_0xcf4872['statusCode']);}else{return _0x41440d[_0x8d15('0x23')](_0xcf4872[_0x8d15('0xa6')])[_0x8d15('0x32')](_0xcf4872[_0x8d15('0x91')]);}}else{return _0x41440d[_0x8d15('0x22')](0xc8);}})[_0x8d15('0x4d')](handleError(_0x41440d,null));};exports['webhookPost']=function(_0x4fbaca,_0x1e59de,_0x43bd1b){return BPromise[_0x8d15('0xa7')]()['then'](function(){if(!_0x4fbaca[_0x8d15('0x3a')][_0x8d15('0x7')]){throw new Error(_0x8d15('0x9d'));}if(!_0x4fbaca[_0x8d15('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4bb5cc=_0x4fbaca[_0x8d15('0x3a')]['hostname']?_0x4fbaca[_0x8d15('0x3a')]['hostname']+':'+_0x4fbaca[_0x8d15('0x3a')][_0x8d15('0x9e')]:_0x8d15('0xa8')+_0x4fbaca['query'][_0x8d15('0x9e')];var _0x334107=_0x4fbaca[_0x8d15('0x3a')][_0x8d15('0x25')]?_0x4fbaca[_0x8d15('0x3a')][_0x8d15('0x25')]:!![];var _0x3a78e7=_0x4fbaca[_0x8d15('0x3a')][_0x8d15('0xa1')]?_0x4fbaca['query'][_0x8d15('0xa1')]:null;var _0x3e49dc={'method':_0x4fbaca[_0x8d15('0xa2')],'uri':util[_0x8d15('0x63')](_0x8d15('0xa9'),_0x4bb5cc,_0x4fbaca['query']['path']),'json':_0x334107,'resolveWithFullResponse':!![],'encoding':_0x3a78e7,'body':_0x4fbaca[_0x8d15('0x91')]};if(_0x4fbaca['headers']){_0x3e49dc[_0x8d15('0xa3')]=_0x4fbaca[_0x8d15('0xa3')];if(_0x3e49dc[_0x8d15('0xa3')][_0x8d15('0xa4')]){delete _0x3e49dc['headers'][_0x8d15('0xa4')];}}if(_0x3e49dc[_0x8d15('0xa3')]['content-type']){delete _0x3e49dc['headers']['content-type'];}return rp(_0x3e49dc);})[_0x8d15('0x2d')](function(_0x494dee){if(_0x494dee){_0x1e59de[_0x8d15('0x2a')](_0x494dee[_0x8d15('0xa3')]);logger[_0x8d15('0x65')](_0x494dee[_0x8d15('0x91')]);return _0x1e59de[_0x8d15('0x23')](_0x494dee[_0x8d15('0xa6')])['send'](_0x494dee['body']);}else{return _0x1e59de[_0x8d15('0x22')](0xc8);}})[_0x8d15('0x4d')](handleError(_0x1e59de,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e66aceb..fe419ac 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 _0xd916=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','remove'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0xd916,0x18a));var _0x6d91=function(_0x24a0e6,_0x1746ed){_0x24a0e6=_0x24a0e6-0x0;var _0x2c425e=_0xd916[_0x24a0e6];return _0x2c425e;};'use strict';var EventEmitter=require(_0x6d91('0x0'));var Plugin=require(_0x6d91('0x1'))['db'][_0x6d91('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6d91('0x3')](0x0);var events={'afterCreate':_0x6d91('0x4'),'afterUpdate':'update','afterDestroy':_0x6d91('0x5')};function emitEvent(_0x3644e5){return function(_0x5a4b38,_0x4f82b3,_0x35101c){PluginEvents[_0x6d91('0x6')](_0x3644e5+':'+_0x5a4b38['id'],_0x5a4b38);PluginEvents['emit'](_0x3644e5,_0x5a4b38);_0x35101c(null);};}for(var e in events){if(events[_0x6d91('0x7')](e)){var event=events[e];Plugin[_0x6d91('0x8')](e,emitEvent(event));}}module[_0x6d91('0x9')]=PluginEvents; \ No newline at end of file +var _0xf603=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x27ed8b,_0x456e1d){var _0xe8e726=function(_0x4c1aaa){while(--_0x4c1aaa){_0x27ed8b['push'](_0x27ed8b['shift']());}};_0xe8e726(++_0x456e1d);}(_0xf603,0x124));var _0x3f60=function(_0x10a08c,_0x16d5b2){_0x10a08c=_0x10a08c-0x0;var _0x4f4ed9=_0xf603[_0x10a08c];return _0x4f4ed9;};'use strict';var EventEmitter=require(_0x3f60('0x0'));var Plugin=require(_0x3f60('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x3f60('0x2')](0x0);var events={'afterCreate':_0x3f60('0x3'),'afterUpdate':_0x3f60('0x4'),'afterDestroy':_0x3f60('0x5')};function emitEvent(_0x360e59){return function(_0x1403db,_0x21a566,_0x15a654){PluginEvents[_0x3f60('0x6')](_0x360e59+':'+_0x1403db['id'],_0x1403db);PluginEvents['emit'](_0x360e59,_0x1403db);_0x15a654(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x3f60('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 73468e1..9661604 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 _0xc08b=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','api','moment','path','rimraf'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0xc08b,0x8a));var _0xbc08=function(_0x4512f6,_0x3d4c0e){_0x4512f6=_0x4512f6-0x0;var _0x194ab0=_0xc08b[_0x4512f6];return _0x194ab0;};'use strict';var _=require(_0xbc08('0x0'));var util=require(_0xbc08('0x1'));var logger=require('../../config/logger')(_0xbc08('0x2'));var moment=require(_0xbc08('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc08('0x4'));var rimraf=require(_0xbc08('0x5'));var config=require(_0xbc08('0x6'));var attributes=require(_0xbc08('0x7'));module[_0xbc08('0x8')]=function(_0x30cf03,_0x42a672){return _0x30cf03[_0xbc08('0x9')](_0xbc08('0xa'),attributes,{'tableName':_0xbc08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8840=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x18bbac,_0x5144b9){var _0x3e2588=function(_0x574e34){while(--_0x574e34){_0x18bbac['push'](_0x18bbac['shift']());}};_0x3e2588(++_0x5144b9);}(_0x8840,0x15b));var _0x0884=function(_0x5869f5,_0x176fd5){_0x5869f5=_0x5869f5-0x0;var _0x6beba1=_0x8840[_0x5869f5];return _0x6beba1;};'use strict';var _=require(_0x0884('0x0'));var util=require(_0x0884('0x1'));var logger=require(_0x0884('0x2'))(_0x0884('0x3'));var moment=require(_0x0884('0x4'));var BPromise=require(_0x0884('0x5'));var rp=require(_0x0884('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0884('0x7'));var config=require(_0x0884('0x8'));var attributes=require(_0x0884('0x9'));module[_0x0884('0xa')]=function(_0x4dfa82,_0x45a820){return _0x4dfa82[_0x0884('0xb')](_0x0884('0xc'),attributes,{'tableName':_0x0884('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index bb5eef9..abdfd29 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 _0x045c=['catch','CreatePlugin','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1cfcff,_0x3ffcc3){var _0x4af22f=function(_0x201682){while(--_0x201682){_0x1cfcff['push'](_0x1cfcff['shift']());}};_0x4af22f(++_0x3ffcc3);}(_0x045c,0x8a));var _0xc045=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x045c[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xc045('0x0'));var util=require(_0xc045('0x1'));var moment=require(_0xc045('0x2'));var BPromise=require(_0xc045('0x3'));var rs=require(_0xc045('0x4'));var fs=require('fs');var Redis=require(_0xc045('0x5'));var db=require(_0xc045('0x6'))['db'];var utils=require(_0xc045('0x7'));var logger=require('../../config/logger')(_0xc045('0x8'));var config=require('../../config/environment');var jayson=require(_0xc045('0x9'));var client=jayson[_0xc045('0xa')][_0xc045('0xb')]({'port':0x232a});config[_0xc045('0xc')]=_[_0xc045('0xd')](config[_0xc045('0xc')],{'host':_0xc045('0xe'),'port':0x18eb});var socket=require(_0xc045('0xf'))(new Redis(config[_0xc045('0xc')]));require(_0xc045('0x10'))[_0xc045('0x11')](socket);function respondWithRpcPromise(_0x18cc77,_0x2c4c21,_0x1cd016){return new BPromise(function(_0x3231b8,_0x5f3e7d){return client['request'](_0x18cc77,_0x1cd016)[_0xc045('0x12')](function(_0x166b92){logger[_0xc045('0x13')](_0xc045('0x14'),_0x2c4c21,_0xc045('0x15'));logger[_0xc045('0x16')](_0xc045('0x17'),_0x2c4c21,_0xc045('0x15'),JSON['stringify'](_0x166b92));if(_0x166b92[_0xc045('0x18')]){if(_0x166b92[_0xc045('0x18')][_0xc045('0x19')]===0x1f4){logger[_0xc045('0x18')](_0xc045('0x14'),_0x2c4c21,_0x166b92[_0xc045('0x18')]['message']);return _0x5f3e7d(_0x166b92['error'][_0xc045('0x1a')]);}logger[_0xc045('0x18')](_0xc045('0x14'),_0x2c4c21,_0x166b92[_0xc045('0x18')][_0xc045('0x1a')]);return _0x3231b8(_0x166b92[_0xc045('0x18')]['message']);}else{logger[_0xc045('0x13')](_0xc045('0x14'),_0x2c4c21,_0xc045('0x15'));_0x3231b8(_0x166b92['result'][_0xc045('0x1a')]);}})[_0xc045('0x1b')](function(_0x2c4ee6){logger[_0xc045('0x18')]('Plugin,\x20%s,\x20%s',_0x2c4c21,_0x2c4ee6);_0x5f3e7d(_0x2c4ee6);});});}exports[_0xc045('0x1c')]=function(_0x3a1de8){var _0x44de3f=this;return new Promise(function(_0x51410e,_0x3c17ac){return db['Plugin'][_0xc045('0x1d')](_0x3a1de8['body'],{'raw':_0x3a1de8[_0xc045('0x1e')]?_0x3a1de8[_0xc045('0x1e')][_0xc045('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x25cc6c){logger[_0xc045('0x13')](_0xc045('0x1c'),_0x3a1de8);logger['debug'](_0xc045('0x1c'),_0x3a1de8,JSON[_0xc045('0x20')](_0x25cc6c));_0x51410e(_0x25cc6c);})[_0xc045('0x1b')](function(_0x26caa5){logger[_0xc045('0x18')](_0xc045('0x1c'),_0x26caa5[_0xc045('0x1a')],_0x3a1de8);_0x3c17ac(_0x44de3f['error'](0x1f4,_0x26caa5[_0xc045('0x1a')]));});});}; \ No newline at end of file +var _0x4030=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x4030,0x1ee));var _0x0403=function(_0x5b959e,_0x28debf){_0x5b959e=_0x5b959e-0x0;var _0x11df5a=_0x4030[_0x5b959e];return _0x11df5a;};'use strict';var _=require(_0x0403('0x0'));var util=require(_0x0403('0x1'));var moment=require('moment');var BPromise=require(_0x0403('0x2'));var rs=require(_0x0403('0x3'));var fs=require('fs');var Redis=require(_0x0403('0x4'));var db=require(_0x0403('0x5'))['db'];var utils=require(_0x0403('0x6'));var logger=require('../../config/logger')(_0x0403('0x7'));var config=require(_0x0403('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0403('0x9')][_0x0403('0xa')]({'port':0x232a});config[_0x0403('0xb')]=_['defaults'](config[_0x0403('0xb')],{'host':_0x0403('0xc'),'port':0x18eb});var socket=require(_0x0403('0xd'))(new Redis(config[_0x0403('0xb')]));require('./plugin.socket')[_0x0403('0xe')](socket);function respondWithRpcPromise(_0x22b251,_0x3ab58d,_0x48cb84){return new BPromise(function(_0x17f8b2,_0x4036cc){return client['request'](_0x22b251,_0x48cb84)[_0x0403('0xf')](function(_0x432303){logger[_0x0403('0x10')](_0x0403('0x11'),_0x3ab58d,_0x0403('0x12'));logger['debug'](_0x0403('0x13'),_0x3ab58d,_0x0403('0x12'),JSON[_0x0403('0x14')](_0x432303));if(_0x432303[_0x0403('0x15')]){if(_0x432303['error'][_0x0403('0x16')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x3ab58d,_0x432303[_0x0403('0x15')][_0x0403('0x17')]);return _0x4036cc(_0x432303[_0x0403('0x15')][_0x0403('0x17')]);}logger[_0x0403('0x15')](_0x0403('0x11'),_0x3ab58d,_0x432303[_0x0403('0x15')][_0x0403('0x17')]);return _0x17f8b2(_0x432303[_0x0403('0x15')]['message']);}else{logger[_0x0403('0x10')]('Plugin,\x20%s,\x20%s',_0x3ab58d,_0x0403('0x12'));_0x17f8b2(_0x432303[_0x0403('0x18')][_0x0403('0x17')]);}})[_0x0403('0x19')](function(_0x518c5c){logger[_0x0403('0x15')]('Plugin,\x20%s,\x20%s',_0x3ab58d,_0x518c5c);_0x4036cc(_0x518c5c);});});}exports[_0x0403('0x1a')]=function(_0x39b34c){var _0x1e64e2=this;return new Promise(function(_0x2a58e5,_0x24c935){return db[_0x0403('0x1b')][_0x0403('0x1c')](_0x39b34c[_0x0403('0x1d')],{'raw':_0x39b34c[_0x0403('0x1e')]?_0x39b34c[_0x0403('0x1e')][_0x0403('0x1f')]===undefined?!![]:![]:!![]})[_0x0403('0xf')](function(_0x1e6c35){logger[_0x0403('0x10')](_0x0403('0x1a'),_0x39b34c);logger[_0x0403('0x20')](_0x0403('0x1a'),_0x39b34c,JSON[_0x0403('0x14')](_0x1e6c35));_0x2a58e5(_0x1e6c35);})['catch'](function(_0x265b35){logger[_0x0403('0x15')](_0x0403('0x1a'),_0x265b35[_0x0403('0x17')],_0x39b34c);_0x24c935(_0x1e64e2['error'](0x1f4,_0x265b35[_0x0403('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4872c27..f9c1193 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 _0xdbc6=['plugin:','./plugin.events','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbc6,0x1a5));var _0x6dbc=function(_0x74c996,_0x375b5d){_0x74c996=_0x74c996-0x0;var _0x2ec6e6=_0xdbc6[_0x74c996];return _0x2ec6e6;};'use strict';var PluginEvents=require(_0x6dbc('0x0'));var events=[_0x6dbc('0x1'),_0x6dbc('0x2'),_0x6dbc('0x3')];function createListener(_0x20559c,_0x34cc54){return function(_0x1c4494){_0x34cc54[_0x6dbc('0x4')](_0x20559c,_0x1c4494);};}function removeListener(_0x14cc19,_0x2c1ae5){return function(){PluginEvents['removeListener'](_0x14cc19,_0x2c1ae5);};}exports[_0x6dbc('0x5')]=function(_0x307273){for(var _0x38ff0e=0x0,_0xbc6c49=events['length'];_0x38ff0e<_0xbc6c49;_0x38ff0e++){var _0x5ca575=events[_0x38ff0e];var _0x34420b=createListener(_0x6dbc('0x6')+_0x5ca575,_0x307273);PluginEvents['on'](_0x5ca575,_0x34420b);}}; \ No newline at end of file +var _0xd66d=['emit','removeListener','register','length','plugin:'];(function(_0x2bcb3a,_0x533554){var _0x51688a=function(_0x438bd9){while(--_0x438bd9){_0x2bcb3a['push'](_0x2bcb3a['shift']());}};_0x51688a(++_0x533554);}(_0xd66d,0xbe));var _0xdd66=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xd66d[_0xa148b7];return _0x51efd3;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove','update'];function createListener(_0x457454,_0x44741b){return function(_0x504a8a){_0x44741b[_0xdd66('0x0')](_0x457454,_0x504a8a);};}function removeListener(_0x330a90,_0x11d66a){return function(){PluginEvents[_0xdd66('0x1')](_0x330a90,_0x11d66a);};}exports[_0xdd66('0x2')]=function(_0x561992){for(var _0x1f2cc0=0x0,_0xa24902=events[_0xdd66('0x3')];_0x1f2cc0<_0xa24902;_0x1f2cc0++){var _0x43cbe3=events[_0x1f2cc0];var _0x264e7a=createListener(_0xdd66('0x4')+_0x43cbe3,_0x561992);PluginEvents['on'](_0x43cbe3,_0x264e7a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3e5052f..aef9942 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(_0xe01fb8,_0x5d3a27){var _0x318cb3=function(_0x154999){while(--_0x154999){_0xe01fb8['push'](_0xe01fb8['shift']());}};_0x318cb3(++_0x5d3a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x5458b0,_0x1db8d5){var _0x5fcbee=function(_0x3c4910){while(--_0x3c4910){_0x5458b0['push'](_0x5458b0['shift']());}};_0x5fcbee(++_0x1db8d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 8a5fd08..5ea899d 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 _0xf45e=['name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','create','body','script','join','../../files/plugins','chdir','start','update','hasOwnProperty','dump','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json','error','stack'];(function(_0x195d96,_0x39b065){var _0x5e21c2=function(_0x553f87){while(--_0x553f87){_0x195d96['push'](_0x195d96['shift']());}};_0x5e21c2(++_0x39b065);}(_0xf45e,0x115));var _0xef45=function(_0x5324b4,_0x593807){_0x5324b4=_0x5324b4-0x0;var _0x463734=_0xf45e[_0x5324b4];return _0x463734;};'use strict';var _=require(_0xef45('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xef45('0x1'))('api');var path=require(_0xef45('0x2'));var exec=require(_0xef45('0x3'))[_0xef45('0x4')];var BPromise=require(_0xef45('0x5'));function handleEntityNotFound(_0x37772f,_0x8b048c){return function(_0x3cd579){if(!_0x3cd579){_0x37772f[_0xef45('0x6')](0x194);;}return _0x3cd579;};}function respondWithResult(_0x338960,_0x315b84){_0x315b84=_0x315b84||0xc8;return function(_0x2f2e92){if(_0x2f2e92){return _0x338960[_0xef45('0x7')](_0x315b84)[_0xef45('0x8')](_0x2f2e92);}return null;};}function handleError(_0x1e0def,_0x268ef6){_0x268ef6=_0x268ef6||0x1f4;return function(_0x143523){logger[_0xef45('0x9')](_0x143523[_0xef45('0xa')]);if(_0x143523[_0xef45('0xb')]){delete _0x143523['name'];}_0x1e0def[_0xef45('0x7')](_0x268ef6)[_0xef45('0xc')](_0x143523);};}function execChildProcess(){return new BPromise(function(_0x46cfeb,_0x3fba8b){exec(_0xef45('0xd'),function(_0x2b429f,_0x48eaf3,_0x14d870){logger[_0xef45('0xe')](_0x48eaf3);logger[_0xef45('0xe')](_0x14d870);if(_0x2b429f){logger[_0xef45('0x9')](_0x2b429f);return _0x3fba8b(_0x2b429f);}return _0x46cfeb(_0x48eaf3);});});}exports[_0xef45('0xf')]=function(_0x4a6e5c,_0x5215fb){return pm2[_0xef45('0x10')]()['then'](function(_0x2ae89a){if(_0x2ae89a){var _0xb0fc43=_[_0xef45('0x11')](_0x2ae89a,function(_0x536e46){return _0x536e46['name']===_0xef45('0x12')||_0x536e46['name']===_0xef45('0x13');});return{'rows':_0xb0fc43,'count':_0xb0fc43[_0xef45('0x14')]};}return null;})[_0xef45('0x15')](respondWithResult(_0x5215fb,null))[_0xef45('0x16')](handleError(_0x5215fb,null));};exports['show']=function(_0x560b2f,_0x45ee70){return pm2[_0xef45('0x17')](_0x560b2f[_0xef45('0x18')]['id'])[_0xef45('0x15')](respondWithResult(_0x45ee70,null))['then'](handleEntityNotFound(_0x45ee70,null))['catch'](handleError(_0x45ee70,null));};exports[_0xef45('0x19')]=function(_0x20ef26,_0xba941b){if(_0x20ef26[_0xef45('0x1a')][_0xef45('0xb')]&&_0x20ef26[_0xef45('0x1a')][_0xef45('0x1b')]){var _0x4a6217=path[_0xef45('0x1c')](__dirname,_0xef45('0x1d'),_0x20ef26[_0xef45('0x1a')][_0xef45('0x1b')]);var _0x27322f=process['cwd']();process[_0xef45('0x1e')](path['dirname'](_0x4a6217));return execChildProcess()['then'](function(_0x7707a1){process[_0xef45('0x1e')](_0x27322f);return pm2[_0xef45('0x1f')]({'name':_0x20ef26[_0xef45('0x1a')][_0xef45('0xb')],'script':_0x4a6217});})[_0xef45('0x15')](function(_0x315777){pm2['dump']();return _0x315777[0x0];})[_0xef45('0x15')](respondWithResult(_0xba941b,0xc9))['catch'](handleError(_0xba941b,null));}else{return _0xba941b[_0xef45('0x7')](0x1f4)[_0xef45('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xef45('0x20')]=function(_0x2c356d,_0x479e3c){if(_0x2c356d[_0xef45('0x1a')]['id']){delete _0x2c356d['body']['id'];}var _0x550e18={'online':'restart','stopped':'stop'};if(_0x550e18[_0xef45('0x21')](_0x2c356d[_0xef45('0x1a')][_0xef45('0x7')])){return pm2[_0x550e18[_0x2c356d[_0xef45('0x1a')]['status']]](_0x2c356d[_0xef45('0x18')]['id'])['then'](respondWithResult(_0x479e3c,0xc8))[_0xef45('0x16')](handleError(_0x479e3c,null));}else{return _0x479e3c['status'](0x1f4)[_0xef45('0xc')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x14ce5a,_0x3e45de){if(_0x14ce5a[_0xef45('0x1a')]['id']){delete _0x14ce5a[_0xef45('0x1a')]['id'];}if(_0x14ce5a[_0xef45('0x18')]['id']){return pm2['delete'](_0x14ce5a['params']['id'])['then'](function(_0x164429){pm2[_0xef45('0x22')]();return _0x164429[0x0];})[_0xef45('0x15')](respondWithResult(_0x3e45de,null))[_0xef45('0x16')](handleError(_0x3e45de,null));}else{return _0x3e45de[_0xef45('0x7')](0x1f4)[_0xef45('0xc')]({'message':_0xef45('0x23')});}}; \ No newline at end of file +var _0xc368=['update','restart','Unknown\x20status','destroy','delete','dump','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','npm\x20install','info','index','list','then','reject','name','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path'];(function(_0x5af9cc,_0x21df4c){var _0x34e13c=function(_0x353cbe){while(--_0x353cbe){_0x5af9cc['push'](_0x5af9cc['shift']());}};_0x34e13c(++_0x21df4c);}(_0xc368,0x7b));var _0x8c36=function(_0x16d38a,_0x1fb563){_0x16d38a=_0x16d38a-0x0;var _0x4065ad=_0xc368[_0x16d38a];return _0x4065ad;};'use strict';var _=require('lodash');var pm2=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var exec=require(_0x8c36('0x3'))[_0x8c36('0x4')];var BPromise=require(_0x8c36('0x5'));function handleEntityNotFound(_0x5d3b27,_0x3e9034){return function(_0x3bb30e){if(!_0x3bb30e){_0x5d3b27[_0x8c36('0x6')](0x194);;}return _0x3bb30e;};}function respondWithResult(_0x1d3660,_0x5ebfc1){_0x5ebfc1=_0x5ebfc1||0xc8;return function(_0x554022){if(_0x554022){return _0x1d3660[_0x8c36('0x7')](_0x5ebfc1)[_0x8c36('0x8')](_0x554022);}return null;};}function handleError(_0x3e76be,_0x26bad1){_0x26bad1=_0x26bad1||0x1f4;return function(_0x3af839){logger[_0x8c36('0x9')](_0x3af839['stack']);if(_0x3af839['name']){delete _0x3af839['name'];}_0x3e76be[_0x8c36('0x7')](_0x26bad1)[_0x8c36('0xa')](_0x3af839);};}function execChildProcess(){return new BPromise(function(_0x5132f6,_0x36cb13){exec(_0x8c36('0xb'),function(_0x1d5c61,_0xe7857e,_0x2a8e73){logger[_0x8c36('0xc')](_0xe7857e);logger[_0x8c36('0xc')](_0x2a8e73);if(_0x1d5c61){logger[_0x8c36('0x9')](_0x1d5c61);return _0x36cb13(_0x1d5c61);}return _0x5132f6(_0xe7857e);});});}exports[_0x8c36('0xd')]=function(_0x11f8fa,_0x43736d){return pm2[_0x8c36('0xe')]()[_0x8c36('0xf')](function(_0x220f18){if(_0x220f18){var _0x5dfcd5=_[_0x8c36('0x10')](_0x220f18,function(_0x5e32ad){return _0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x12')||_0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x13');});return{'rows':_0x5dfcd5,'count':_0x5dfcd5[_0x8c36('0x14')]};}return null;})[_0x8c36('0xf')](respondWithResult(_0x43736d,null))[_0x8c36('0x15')](handleError(_0x43736d,null));};exports[_0x8c36('0x16')]=function(_0x30229e,_0x49cafe){return pm2[_0x8c36('0x17')](_0x30229e[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x49cafe,null))[_0x8c36('0xf')](handleEntityNotFound(_0x49cafe,null))[_0x8c36('0x15')](handleError(_0x49cafe,null));};exports['create']=function(_0x15100f,_0x409de0){if(_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')]&&_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]){var _0xfb9763=path[_0x8c36('0x1b')](__dirname,_0x8c36('0x1c'),_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]);var _0x14ee6b=process[_0x8c36('0x1d')]();process['chdir'](path['dirname'](_0xfb9763));return execChildProcess()['then'](function(_0x55b844){process[_0x8c36('0x1e')](_0x14ee6b);return pm2[_0x8c36('0x1f')]({'name':_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')],'script':_0xfb9763});})[_0x8c36('0xf')](function(_0x27c0df){pm2['dump']();return _0x27c0df[0x0];})[_0x8c36('0xf')](respondWithResult(_0x409de0,0xc9))['catch'](handleError(_0x409de0,null));}else{return _0x409de0[_0x8c36('0x7')](0x1f4)['send']({'message':_0x8c36('0x20')});}};exports[_0x8c36('0x21')]=function(_0x271ec4,_0x1010c8){if(_0x271ec4['body']['id']){delete _0x271ec4['body']['id'];}var _0x7e7e56={'online':_0x8c36('0x22'),'stopped':'stop'};if(_0x7e7e56['hasOwnProperty'](_0x271ec4[_0x8c36('0x19')][_0x8c36('0x7')])){return pm2[_0x7e7e56[_0x271ec4['body'][_0x8c36('0x7')]]](_0x271ec4[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x1010c8,0xc8))['catch'](handleError(_0x1010c8,null));}else{return _0x1010c8['status'](0x1f4)[_0x8c36('0xa')]({'message':_0x8c36('0x23')});}};exports[_0x8c36('0x24')]=function(_0x192ce3,_0x3ae970){if(_0x192ce3[_0x8c36('0x19')]['id']){delete _0x192ce3[_0x8c36('0x19')]['id'];}if(_0x192ce3[_0x8c36('0x18')]['id']){return pm2[_0x8c36('0x25')](_0x192ce3[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](function(_0x36648e){pm2[_0x8c36('0x26')]();return _0x36648e[0x0];})[_0x8c36('0xf')](respondWithResult(_0x3ae970,null))[_0x8c36('0x15')](handleError(_0x3ae970,null));}else{return _0x3ae970[_0x8c36('0x7')](0x1f4)[_0x8c36('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index da7fe50..6d5dcea 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 _0x29c3=['exports','express','Router','./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues'];(function(_0x17742f,_0x3d040d){var _0x4e4509=function(_0x5d8813){while(--_0x5d8813){_0x17742f['push'](_0x17742f['shift']());}};_0x4e4509(++_0x3d040d);}(_0x29c3,0xb5));var _0x329c=function(_0x5b9b6b,_0x495d5b){_0x5b9b6b=_0x5b9b6b-0x0;var _0x46f99a=_0x29c3[_0x5b9b6b];return _0x46f99a;};'use strict';var express=require(_0x329c('0x0'));var router=express[_0x329c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x329c('0x2'));router[_0x329c('0x3')]('/agents',auth[_0x329c('0x4')](),controller[_0x329c('0x5')]);router['get'](_0x329c('0x6'),auth[_0x329c('0x4')](),controller[_0x329c('0x7')]);module[_0x329c('0x8')]=router; \ No newline at end of file +var _0x0480=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','getQueues','Router'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x0480,0xdf));var _0x0048=function(_0x2bc742,_0x117eb5){_0x2bc742=_0x2bc742-0x0;var _0x10b788=_0x0480[_0x2bc742];return _0x10b788;};'use strict';var express=require('express');var router=express[_0x0048('0x0')]();var auth=require(_0x0048('0x1'));var controller=require(_0x0048('0x2'));router[_0x0048('0x3')](_0x0048('0x4'),auth[_0x0048('0x5')](),controller[_0x0048('0x6')]);router[_0x0048('0x3')]('/queues',auth[_0x0048('0x5')](),controller[_0x0048('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 915688f..64f375c 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 _0x0462=['voice','Queues','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','waiting','talking','paused','outbound','push','pTalking','originated','dialActive','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','busy','pick','filter','length','some','connectedlinenum','internal','getMembers','UserId','accountcode','online','User','startCase','Queue','Pause','findAll','QueueId','find','agents','idle','unavailable','chatPause','faxPause','smsPause','whatsappPause','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','voiceStatus','whatsappStatus','*pause','getAgents','lastLoginAt','lastPauseAt','openchannelPause','mailPause','chatCapacity','openchannelCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','rawAttributes','type','key','query','role','agent','getOptions','user','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','openchannel','fax','whatsapp','resolve','channel','toLowerCase','Invalid\x20channel','fieldName','userProfileId','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','limit','undefined','count','status','error','stack','name','send','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge'];(function(_0x2fd234,_0x326416){var _0x1360e6=function(_0x1b8980){while(--_0x1b8980){_0x2fd234['push'](_0x2fd234['shift']());}};_0x1360e6(++_0x326416);}(_0x0462,0x74));var _0x2046=function(_0x425fb0,_0x58e79c){_0x425fb0=_0x425fb0-0x0;var _0x12a913=_0x0462[_0x425fb0];return _0x12a913;};'use strict';var util=require('util');var _=require(_0x2046('0x0'));var jayson=require(_0x2046('0x1'));var qs=require(_0x2046('0x2'));var logger=require(_0x2046('0x3'))(_0x2046('0x4'));var db=require(_0x2046('0x5'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x2046('0x6')][_0x2046('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x28a1e5,_0x41553d){return function(_0x301528){if(_0x301528){var _0x2a8245=typeof _0x41553d[_0x2046('0x8')]==='undefined'&&typeof _0x41553d[_0x2046('0x9')]===_0x2046('0xa');var _0x3ad79c=_0x301528[_0x2046('0xb')];var _0x341fab=_0x2a8245?0x0:_0x41553d[_0x2046('0x8')];var _0x15f901=_0x2a8245?_0x301528['count']:_0x41553d[_0x2046('0x8')]+_0x41553d['limit'];var _0x532157;if(_0x15f901>=_0x3ad79c){_0x15f901=_0x3ad79c;_0x532157=0xc8;}else{_0x532157=0xce;}_0x28a1e5[_0x2046('0xc')](_0x532157);return _0x28a1e5['set']('Content-Range',_0x341fab+'-'+_0x15f901+'/'+_0x3ad79c)['json'](_0x301528);}return null;};}function handleError(_0x40a8d5,_0x5387c9){_0x5387c9=_0x5387c9||0x1f4;return function(_0x80aa46){logger[_0x2046('0xd')](_0x80aa46[_0x2046('0xe')]);if(_0x80aa46[_0x2046('0xf')]){delete _0x80aa46['name'];}_0x40a8d5[_0x2046('0xc')](_0x5387c9)[_0x2046('0x10')](_0x80aa46);};}function getRealtimeAgents(){return new Promise(function(_0xd4aabb,_0x5e6ea8){return amiClient['request'](_0x2046('0x11'),{})['then'](function(_0x1f76f0){if(_0x1f76f0[_0x2046('0xd')])throw new Error(_0x2046('0x12'));var _0x441e5a=_0x1f76f0[_0x2046('0x13')];return routingClient[_0x2046('0x14')](_0x2046('0x11'),{})[_0x2046('0x15')](function(_0x31403a){if(_0x31403a[_0x2046('0xd')])throw new Error(_0x2046('0x16'));var _0x49a047=_0x31403a[_0x2046('0x13')];return _0xd4aabb(_[_0x2046('0x17')]({},_0x441e5a,_0x49a047));});})['catch'](function(_0x3bc83e){_0x5e6ea8(_0x3bc83e);});});}function getRealtimeQueues(_0x5822b3,_0x5ce4d2){return new Promise(function(_0x5bd051,_0x19d605){var _0x1a219b=_0x5ce4d2===_0x2046('0x18')?amiClient:routingClient;return _0x1a219b['request'](_['startCase'](_0x5ce4d2)+_0x2046('0x19'),_0x5822b3)[_0x2046('0x15')](function(_0x110736){if(_0x110736[_0x2046('0xd')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x5ce4d2));return _0x5bd051(_0x110736['result']);})[_0x2046('0x1a')](function(_0x2f5351){_0x19d605(_0x2f5351);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x102ff1,_0x73f1a0){return amiClient[_0x2046('0x14')]('VoiceQueuesChannels',{})[_0x2046('0x15')](function(_0x150a8c){if(_0x150a8c[_0x2046('0xd')])throw new Error(_0x2046('0x1b'));return _0x102ff1(_0x150a8c[_0x2046('0x13')]);})['catch'](function(_0x2bf609){_0x73f1a0(_0x2bf609);});});}function initializeQueues(_0x28bfec,_0x220b05,_0xb462e9,_0x526277){var _0x55b538=['loggedIn','available',_0x2046('0x1c'),_0x2046('0x1d'),_0x2046('0x1e')];if(_0xb462e9==='voice'&&_0x526277===_0x2046('0x1f')){_0x55b538[_0x2046('0x20')](_0x2046('0x21'),_0x2046('0x22'),'message',_0x2046('0x23'),'dialMethod',_0x2046('0x24'),'startPredictive',_0x2046('0x25'),_0x2046('0x26'),_0x2046('0x27'),_0x2046('0x28'),_0x2046('0x29'),_0x2046('0x2a'),'dialPredictiveIntervalMaxThreshold',_0x2046('0x2b'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x2046('0x2c'),_0x2046('0x2d'),_0x2046('0x2e'),'predictiveIntervalAvgHoldtime',_0x2046('0x2f'));}return _0x28bfec[_0x2046('0x30')](function(_0x31bf2c){var _0x3396e4=_0x31bf2c[_0x2046('0x31')]({'plain':!![]});_0x3396e4['agents']=[];_0x3396e4['paused']=0x0;_0x3396e4[_0x2046('0x32')]=0x0;_0x3396e4['loggedIn']=0x0;_0x3396e4['available']=0x0;_0x3396e4[_0x2046('0x1c')]=0x0;if(_0xb462e9==='voice'){_0x3396e4[_0x2046('0x1d')]=0x0;_0x3396e4[_0x2046('0x33')]=0x0;if(_0x526277===_0x2046('0x1f')){_0x3396e4[_0x2046('0x21')]=0x0;_0x3396e4[_0x2046('0x22')]=0x0;}}var _0x50098c=_['find'](_0x220b05,['id',_0x3396e4['id']]);if(_0x50098c)_[_0x2046('0x17')](_0x3396e4,_[_0x2046('0x34')](_0x50098c,_0x55b538));return _0x3396e4;});}function updateAgentVoiceStatus(_0x4c4f8d,_0x1ecf0a,_0x4c95d8){var _0x434c71=_[_0x2046('0x35')](_0x4c95d8,['queue',_0x1ecf0a[_0x2046('0xf')]]);if(_0x434c71[_0x2046('0x36')]===0x0)return _0x4c4f8d[_0x2046('0x33')]=!![];if(_[_0x2046('0x37')](_0x434c71,[_0x2046('0x38'),_0x4c4f8d[_0x2046('0x39')]['toString']()]))return _0x4c4f8d['talking']=!![];if(!_0x4c4f8d[_0x2046('0x1d')])return _0x4c4f8d[_0x2046('0x33')]=!![];}function getVoiceQueueAgents(_0x379598,_0x172c07,_0x467c21,_0xeb0422){var _0x469539=_['find'](_0x172c07,['id',_0x379598['id']]);if(!_0x469539)return _0x379598;return _0x469539[_0x2046('0x3a')]({'raw':!![]})[_0x2046('0x15')](function(_0x34a661){for(var _0x3f0bd4=0x0;_0x3f0bd4<_0x34a661['length'];_0x3f0bd4++){var _0x29a93e=_['find'](_0x467c21,['id',_0x34a661[_0x3f0bd4][_0x2046('0x3b')]]);if(!_0x29a93e){_0x29a93e={'id':_0x34a661[_0x3f0bd4]['UserId'],'name':_0x34a661[_0x3f0bd4][_0x2046('0x3b')],'accountcode':'','online':![]};}var _0x1a7819={'id':_0x29a93e['id'],'name':_0x29a93e['name'],'internal':_0x29a93e[_0x2046('0x3c')],'online':Boolean(_0x29a93e[_0x2046('0x3d')]),'paused':Boolean(_0x34a661[_0x3f0bd4][_0x2046('0x1e')])};if(_0x29a93e['voiceStatus']==='talking')updateAgentVoiceStatus(_0x1a7819,_0x379598,_0xeb0422);if(_0x1a7819[_0x2046('0x3d')])_0x379598[_0x2046('0x32')]++;if(_0x1a7819[_0x2046('0x33')])_0x379598[_0x2046('0x33')]++;if(_0x1a7819[_0x2046('0x1e')]&&!_0x1a7819[_0x2046('0x33')]&&!_0x1a7819[_0x2046('0x1d')])_0x379598[_0x2046('0x1e')]++;_0x379598['agents']['push'](_0x1a7819);}return _0x379598;});}function getQueueAgents(_0x3b5a4c,_0x560905,_0x313499){var _0x3ec369=_0x2046('0x3e')+_[_0x2046('0x3f')](_0x313499)+_0x2046('0x40');var _0x2a3dcf=_0x313499+_0x2046('0x41');return db[_0x3ec369][_0x2046('0x42')]({'where':{[_[_0x2046('0x3f')](_0x313499)+_0x2046('0x43')]:_0x3b5a4c['id']},'raw':!![]})[_0x2046('0x15')](function(_0x3f5f2c){for(var _0x1104a5=0x0;_0x1104a5<_0x3f5f2c[_0x2046('0x36')];_0x1104a5++){var _0x48e3d7=_[_0x2046('0x44')](_0x560905,['id',_0x3f5f2c[_0x1104a5]['UserId']]);if(!_0x48e3d7){_0x48e3d7={'id':_0x3f5f2c[_0x1104a5][_0x2046('0x3b')],'name':_0x3f5f2c[_0x1104a5]['UserId'],'online':![],['pauseField']:![]};}var _0x3392ee={'id':_0x48e3d7['id'],'name':_0x48e3d7[_0x2046('0xf')],'online':Boolean(_0x48e3d7[_0x2046('0x3d')]),'paused':Boolean(_0x48e3d7[_0x2a3dcf])};if(_0x3392ee[_0x2046('0x3d')])_0x3b5a4c['loggedInDb']++;_0x3b5a4c[_0x2046('0x45')][_0x2046('0x20')](_0x3392ee);}return _0x3b5a4c;});}function isIdle(_0x434c15){return _0x434c15===_0x2046('0x46')||_0x434c15==='unknown'||_0x434c15===_0x2046('0x47')||_0x434c15==='ringing'||_['isNil'](_0x434c15);}function isAgentPaused(_0x59da97,_0x37c022){var _0x2e463d=[_0x59da97[_0x2046('0x48')],_0x59da97[_0x2046('0x49')],_0x59da97['mailPause'],_0x59da97['openchannelPause'],_0x59da97[_0x2046('0x4a')],_0x59da97['voicePause'],_0x59da97[_0x2046('0x4b')]];if(!_0x37c022)return _['every'](_0x2e463d);var _0x53c652=_[_0x2046('0x35')](_0x2e463d);return _0x53c652[_0x2046('0x36')]>0x0&&_0x53c652[_0x2046('0x36')]<_0x2e463d[_0x2046('0x36')]?!![]:![];}function isAgentIdle(_0x52dafc){if(_0x52dafc['voiceStatus']!==_0x2046('0x46')&&_0x52dafc['voicePause']){_0x52dafc['voiceStatus']=_0x2046('0x4c');return![];}return _[_0x2046('0x4d')]([_0x52dafc[_0x2046('0x4e')],_0x52dafc[_0x2046('0x4f')],_0x52dafc[_0x2046('0x50')],_0x52dafc[_0x2046('0x51')],_0x52dafc['smsStatus'],_0x52dafc[_0x2046('0x52')],_0x52dafc[_0x2046('0x53')]],isIdle);}function getAgentStatus(_0x4f7196){var _0x47b9ee='unknown';if(isAgentPaused(_0x4f7196))_0x47b9ee=_0x2046('0x4c');else if(isAgentPaused(_0x4f7196,!![]))_0x47b9ee=_0x2046('0x54');else if(isAgentIdle(_0x4f7196))_0x47b9ee=_0x2046('0x46');else _0x47b9ee=_0x2046('0x33');return _0x47b9ee;}exports[_0x2046('0x55')]=function(_0x5d43e4,_0x293bd5){var _0x1665f7={'count':0x0,'rows':[]},_0x2f6900={},_0x2720a5,_0x43e1f8,_0x464e32=['userpic',_0x2046('0x3d'),_0x2046('0x56'),_0x2046('0x57'),'pauseType',_0x2046('0x57'),_0x2046('0x39'),'address',_0x2046('0x48'),_0x2046('0x58'),_0x2046('0x59'),'smsPause',_0x2046('0x4b'),'faxPause','voicePause',_0x2046('0x5a'),_0x2046('0x5b'),'mailCapacity','smsCapacity',_0x2046('0x5c'),_0x2046('0x5d'),_0x2046('0x5e'),_0x2046('0x5f'),_0x2046('0x60'),_0x2046('0x61'),'whatsappCurrentCapacity',_0x2046('0x62'),_0x2046('0x4e'),_0x2046('0x51'),_0x2046('0x50'),_0x2046('0x63'),'whatsappStatus','faxStatus',_0x2046('0x52'),_0x2046('0x64'),_0x2046('0x65'),'mailStatusTime',_0x2046('0x66'),_0x2046('0x67'),_0x2046('0x68'),_0x2046('0x69'),_0x2046('0x6a'),'destconnectedlinenum',_0x2046('0x6b'),_0x2046('0x6c'),_0x2046('0x6d'),_0x2046('0x6e')],_0x4d85c6=[_0x2046('0x48'),_0x2046('0x58'),_0x2046('0x59'),'smsPause','whatsappPause',_0x2046('0x49'),'voicePause',_0x2046('0x3d')];Promise['resolve']()[_0x2046('0x15')](function(){var _0x234034=_[_0x2046('0x30')](db['User'][_0x2046('0x6f')],function(_0x163470){return{'name':_0x163470['fieldName'],'type':_0x163470[_0x2046('0x70')][_0x2046('0x71')]};});_0x5d43e4[_0x2046('0x72')][_0x2046('0x73')]=_0x2046('0x74');_0x5d43e4['query']['online']=!![];_0x2f6900=qs[_0x2046('0x75')](_0x234034,_0x5d43e4);_0x2f6900['raw']=!![];if(_0x5d43e4[_0x2046('0x76')][_0x2046('0x73')]==='user'){var _0x472f34={'params':{'id':_0x5d43e4[_0x2046('0x76')]['userProfileId']},'query':{'section':_0x2046('0x11'),'role':_0x2046('0x74'),'online':!![],'nolimit':_0x5d43e4[_0x2046('0x72')][_0x2046('0x77')],'sort':_0x5d43e4[_0x2046('0x72')][_0x2046('0x78')],'filter':_0x5d43e4['query']['filter']},'raw':!![]};return db[_0x2046('0x79')][_0x2046('0x7a')](_0x472f34);}return db[_0x2046('0x3e')][_0x2046('0x7b')](_0x2f6900);})['then'](function(_0x2b2ba7){_0x1665f7[_0x2046('0xb')]=_0x2b2ba7['count'];_0x2720a5=_0x2b2ba7[_0x2046('0x7c')];return getRealtimeAgents();})[_0x2046('0x15')](function(_0x4adc12){_0x43e1f8=_0x4adc12[_0x2046('0x7c')];return _0x2720a5[_0x2046('0x30')](function(_0x63f12d){var _0x3a8b7f=_[_0x2046('0x44')](_0x43e1f8,['id',_0x63f12d['id']]);if(_0x3a8b7f)_[_0x2046('0x17')](_0x63f12d,_[_0x2046('0x34')](_[_0x2046('0x7d')](_0x3a8b7f,_0x4d85c6),_0x464e32));_0x63f12d[_0x2046('0x7e')]=getAgentStatus(_0x63f12d);return _0x63f12d;});})[_0x2046('0x15')](function(_0x443579){if(_0x5d43e4[_0x2046('0x72')][_0x2046('0x7f')]){var _0xf1d413=_['filter'](_0x443579,[_0x2046('0x7e'),_0x5d43e4[_0x2046('0x72')][_0x2046('0x7f')]]);if(_0x5d43e4['query']['pauseTypeFilter']){_0xf1d413=_[_0x2046('0x35')](_0xf1d413,['pauseType',_0x5d43e4[_0x2046('0x72')][_0x2046('0x80')]]);}}_0x1665f7['rows']=_0xf1d413||_0x443579;return _0x1665f7;})[_0x2046('0x15')](respondWithFilteredResult(_0x293bd5,_0x2f6900))['catch'](handleError(_0x293bd5,null));};exports[_0x2046('0x81')]=function(_0x595283,_0x2176ba){var _0x231a9b=[_0x2046('0x82'),'chat','sms',_0x2046('0x83'),_0x2046('0x84'),_0x2046('0x85'),'voice'];var _0x451498={'count':0x0,'rows':[]},_0x507b01={},_0x5e54e3,_0x7f2ca2,_0x573fc2,_0x155c0,_0x305545;Promise[_0x2046('0x86')]()[_0x2046('0x15')](function(){if(_0x595283[_0x2046('0x72')][_0x2046('0x87')]){if(!_['includes'](_0x231a9b,_0x595283['query']['channel'][_0x2046('0x88')]()))throw new Error(_0x2046('0x89'));_0x5e54e3=_0x595283['query'][_0x2046('0x87')][_0x2046('0x88')]();}var _0x27ee0a=_[_0x2046('0x3f')](_0x5e54e3)+_0x2046('0x40');var _0x1a758f=_[_0x2046('0x30')](db[_0x27ee0a][_0x2046('0x6f')],function(_0x7466eb){return{'name':_0x7466eb[_0x2046('0x8a')],'type':_0x7466eb[_0x2046('0x70')][_0x2046('0x71')]};});_0x507b01=qs[_0x2046('0x75')](_0x1a758f,_0x595283);if(_0x595283['user'][_0x2046('0x73')]===_0x2046('0x76')){var _0x573167={'params':{'id':_0x595283[_0x2046('0x76')][_0x2046('0x8b')]},'query':{'section':_0x5e54e3===_0x2046('0x18')&&_0x595283[_0x2046('0x72')]['type']===_0x2046('0x1f')?'QueueCampaigns':_[_0x2046('0x3f')](_0x5e54e3)+'Queues','type':_0x595283[_0x2046('0x72')][_0x2046('0x70')],'nolimit':!![],'sort':_0x2046('0xf'),'filter':_0x595283[_0x2046('0x72')][_0x2046('0x35')]}};return db[_0x2046('0x79')][_0x2046('0x7a')](_0x573167);}return db[_0x27ee0a][_0x2046('0x7b')](_0x507b01);})[_0x2046('0x15')](function(_0x50a44b){_0x451498[_0x2046('0xb')]=_0x50a44b[_0x2046('0xb')];_0x7f2ca2=_0x50a44b['rows'];return getRealtimeQueues(_0x595283,_0x5e54e3);})[_0x2046('0x15')](function(_0x1fdd99){_0x155c0=_0x1fdd99['rows'];return getRealtimeAgents();})[_0x2046('0x15')](function(_0xd5d9b2){_0x573fc2=_0xd5d9b2[_0x2046('0x7c')];if(_0x5e54e3!=_0x2046('0x18'))return;return getRealtimeVoiceQueueChannels();})[_0x2046('0x15')](function(_0x26e13f){_0x305545=_0x26e13f?_0x26e13f[_0x2046('0x7c')]:[];return initializeQueues(_0x7f2ca2,_0x155c0,_0x5e54e3,_0x595283['query']['type']);})['then'](function(_0x9c5555){var _0x4fffa6=_0x9c5555[_0x2046('0x30')](function(_0xb5fe80){if(_0x5e54e3===_0x2046('0x18'))return getVoiceQueueAgents(_0xb5fe80,_0x7f2ca2,_0x573fc2,_0x305545);else return getQueueAgents(_0xb5fe80,_0x573fc2,_0x5e54e3);});return Promise['all'](_0x4fffa6);})[_0x2046('0x15')](function(_0x316f1b){_0x451498['rows']=_0x316f1b;return _0x451498;})[_0x2046('0x15')](respondWithFilteredResult(_0x2176ba,_0x507b01))[_0x2046('0x1a')](handleError(_0x2176ba,null));}; \ No newline at end of file +var _0xad2c=['chat','openchannel','fax','whatsapp','includes','channel','toLowerCase','UserProfile','findAndCountAll','all','lodash','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','voice','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','outbound','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','busy','originated','pick','queue','length','some','connectedlinenum','find','getMembers','UserId','online','loggedInDb','User','Queue','Pause','findAll','startCase','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','filter','idle','voiceStatus','every','faxStatus','openchannelStatus','smsStatus','whatsappStatus','unknown','pause','getAgents','userpic','lastLoginAt','pauseType','lastPauseAt','internal','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','chatStatus','mailStatus','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','resolve','rawAttributes','fieldName','type','key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','getResources','rows','merge','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues'];(function(_0x422ab5,_0xf0f2ac){var _0x451edd=function(_0xee4515){while(--_0xee4515){_0x422ab5['push'](_0x422ab5['shift']());}};_0x451edd(++_0xf0f2ac);}(_0xad2c,0x1c3));var _0xcad2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xad2c[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var _=require(_0xcad2('0x0'));var jayson=require(_0xcad2('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xcad2('0x2'))(_0xcad2('0x3'));var db=require(_0xcad2('0x4'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xcad2('0x5')][_0xcad2('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xcb36e1,_0x123efe){return function(_0x38eb1a){if(_0x38eb1a){var _0xa8562=typeof _0x123efe[_0xcad2('0x7')]===_0xcad2('0x8')&&typeof _0x123efe[_0xcad2('0x9')]===_0xcad2('0x8');var _0x2fc88c=_0x38eb1a[_0xcad2('0xa')];var _0x4842ce=_0xa8562?0x0:_0x123efe[_0xcad2('0x7')];var _0x4a8084=_0xa8562?_0x38eb1a[_0xcad2('0xa')]:_0x123efe[_0xcad2('0x7')]+_0x123efe[_0xcad2('0x9')];var _0x57cf2c;if(_0x4a8084>=_0x2fc88c){_0x4a8084=_0x2fc88c;_0x57cf2c=0xc8;}else{_0x57cf2c=0xce;}_0xcb36e1['status'](_0x57cf2c);return _0xcb36e1['set'](_0xcad2('0xb'),_0x4842ce+'-'+_0x4a8084+'/'+_0x2fc88c)[_0xcad2('0xc')](_0x38eb1a);}return null;};}function handleError(_0x359779,_0xd9aaeb){_0xd9aaeb=_0xd9aaeb||0x1f4;return function(_0xd18127){logger[_0xcad2('0xd')](_0xd18127[_0xcad2('0xe')]);if(_0xd18127[_0xcad2('0xf')]){delete _0xd18127['name'];}_0x359779['status'](_0xd9aaeb)[_0xcad2('0x10')](_0xd18127);};}function getRealtimeAgents(){return new Promise(function(_0x28239c,_0x456d55){return amiClient[_0xcad2('0x11')](_0xcad2('0x12'),{})[_0xcad2('0x13')](function(_0x1922af){if(_0x1922af[_0xcad2('0xd')])throw new Error(_0xcad2('0x14'));var _0xe1f3d1=_0x1922af['result'];return routingClient[_0xcad2('0x11')](_0xcad2('0x12'),{})['then'](function(_0x1ad7b5){if(_0x1ad7b5[_0xcad2('0xd')])throw new Error(_0xcad2('0x15'));var _0x2aae16=_0x1ad7b5[_0xcad2('0x16')];return _0x28239c(_['merge']({},_0xe1f3d1,_0x2aae16));});})[_0xcad2('0x17')](function(_0x256745){_0x456d55(_0x256745);});});}function getRealtimeQueues(_0x58dfff,_0x3dddb3){return new Promise(function(_0x1a3a18,_0x53239e){var _0x573c19=_0x3dddb3===_0xcad2('0x18')?amiClient:routingClient;return _0x573c19[_0xcad2('0x11')](_['startCase'](_0x3dddb3)+_0xcad2('0x19'),_0x58dfff)[_0xcad2('0x13')](function(_0x511ff0){if(_0x511ff0[_0xcad2('0xd')])throw new Error(util['format'](_0xcad2('0x1a'),_0x3dddb3));return _0x1a3a18(_0x511ff0['result']);})[_0xcad2('0x17')](function(_0x33db3d){_0x53239e(_0x33db3d);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2c0ee9,_0x146548){return amiClient[_0xcad2('0x11')]('VoiceQueuesChannels',{})[_0xcad2('0x13')](function(_0x5cdff4){if(_0x5cdff4['error'])throw new Error(_0xcad2('0x1b'));return _0x2c0ee9(_0x5cdff4['result']);})['catch'](function(_0x5092f3){_0x146548(_0x5092f3);});});}function initializeQueues(_0xf2ddfb,_0x6726ae,_0x2b719d,_0x493201){var _0x57015d=[_0xcad2('0x1c'),'available',_0xcad2('0x1d'),_0xcad2('0x1e'),_0xcad2('0x1f')];if(_0x2b719d===_0xcad2('0x18')&&_0x493201===_0xcad2('0x20')){_0x57015d[_0xcad2('0x21')](_0xcad2('0x22'),'originated',_0xcad2('0x23'),_0xcad2('0x24'),_0xcad2('0x25'),_0xcad2('0x26'),_0xcad2('0x27'),_0xcad2('0x28'),'erlangCalls',_0xcad2('0x29'),_0xcad2('0x2a'),'erlangBusyFactor',_0xcad2('0x2b'),_0xcad2('0x2c'),_0xcad2('0x2d'),_0xcad2('0x2e'),'predictiveIntervalTotalCalls',_0xcad2('0x2f'),_0xcad2('0x30'),_0xcad2('0x31'),_0xcad2('0x32'),'predictiveIntervalAvgTalktime');}return _0xf2ddfb[_0xcad2('0x33')](function(_0x4cc83d){var _0x10f86a=_0x4cc83d[_0xcad2('0x34')]({'plain':!![]});_0x10f86a[_0xcad2('0x35')]=[];_0x10f86a[_0xcad2('0x1f')]=0x0;_0x10f86a['loggedInDb']=0x0;_0x10f86a[_0xcad2('0x1c')]=0x0;_0x10f86a['available']=0x0;_0x10f86a[_0xcad2('0x1d')]=0x0;if(_0x2b719d===_0xcad2('0x18')){_0x10f86a['talking']=0x0;_0x10f86a[_0xcad2('0x36')]=0x0;if(_0x493201===_0xcad2('0x20')){_0x10f86a['pTalking']=0x0;_0x10f86a[_0xcad2('0x37')]=0x0;}}var _0x3f5715=_['find'](_0x6726ae,['id',_0x10f86a['id']]);if(_0x3f5715)_['merge'](_0x10f86a,_[_0xcad2('0x38')](_0x3f5715,_0x57015d));return _0x10f86a;});}function updateAgentVoiceStatus(_0x396719,_0x34772,_0x44ff81){var _0x360d75=_['filter'](_0x44ff81,[_0xcad2('0x39'),_0x34772[_0xcad2('0xf')]]);if(_0x360d75[_0xcad2('0x3a')]===0x0)return _0x396719[_0xcad2('0x36')]=!![];if(_[_0xcad2('0x3b')](_0x360d75,[_0xcad2('0x3c'),_0x396719['internal']['toString']()]))return _0x396719[_0xcad2('0x1e')]=!![];if(!_0x396719[_0xcad2('0x1e')])return _0x396719[_0xcad2('0x36')]=!![];}function getVoiceQueueAgents(_0x1c1017,_0x423bc3,_0x3c338d,_0x17b093){var _0x435d85=_[_0xcad2('0x3d')](_0x423bc3,['id',_0x1c1017['id']]);if(!_0x435d85)return _0x1c1017;return _0x435d85[_0xcad2('0x3e')]({'raw':!![]})[_0xcad2('0x13')](function(_0x4abe15){for(var _0x3ee443=0x0;_0x3ee443<_0x4abe15[_0xcad2('0x3a')];_0x3ee443++){var _0x5932b5=_['find'](_0x3c338d,['id',_0x4abe15[_0x3ee443][_0xcad2('0x3f')]]);if(!_0x5932b5){_0x5932b5={'id':_0x4abe15[_0x3ee443][_0xcad2('0x3f')],'name':_0x4abe15[_0x3ee443][_0xcad2('0x3f')],'accountcode':'','online':![]};}var _0x150900={'id':_0x5932b5['id'],'name':_0x5932b5['name'],'internal':_0x5932b5['accountcode'],'online':Boolean(_0x5932b5[_0xcad2('0x40')]),'paused':Boolean(_0x4abe15[_0x3ee443][_0xcad2('0x1f')])};if(_0x5932b5['voiceStatus']===_0xcad2('0x1e'))updateAgentVoiceStatus(_0x150900,_0x1c1017,_0x17b093);if(_0x150900['online'])_0x1c1017[_0xcad2('0x41')]++;if(_0x150900[_0xcad2('0x36')])_0x1c1017['busy']++;if(_0x150900[_0xcad2('0x1f')]&&!_0x150900[_0xcad2('0x36')]&&!_0x150900[_0xcad2('0x1e')])_0x1c1017[_0xcad2('0x1f')]++;_0x1c1017[_0xcad2('0x35')][_0xcad2('0x21')](_0x150900);}return _0x1c1017;});}function getQueueAgents(_0x2f2c0a,_0x290a7a,_0x453736){var _0x3716e4=_0xcad2('0x42')+_['startCase'](_0x453736)+_0xcad2('0x43');var _0x32a46c=_0x453736+_0xcad2('0x44');return db[_0x3716e4][_0xcad2('0x45')]({'where':{[_[_0xcad2('0x46')](_0x453736)+'QueueId']:_0x2f2c0a['id']},'raw':!![]})[_0xcad2('0x13')](function(_0x3418a3){for(var _0x211a4f=0x0;_0x211a4f<_0x3418a3[_0xcad2('0x3a')];_0x211a4f++){var _0x644074=_[_0xcad2('0x3d')](_0x290a7a,['id',_0x3418a3[_0x211a4f][_0xcad2('0x3f')]]);if(!_0x644074){_0x644074={'id':_0x3418a3[_0x211a4f][_0xcad2('0x3f')],'name':_0x3418a3[_0x211a4f][_0xcad2('0x3f')],'online':![],['pauseField']:![]};}var _0x40d6f1={'id':_0x644074['id'],'name':_0x644074[_0xcad2('0xf')],'online':Boolean(_0x644074[_0xcad2('0x40')]),'paused':Boolean(_0x644074[_0x32a46c])};if(_0x40d6f1[_0xcad2('0x40')])_0x2f2c0a[_0xcad2('0x41')]++;_0x2f2c0a[_0xcad2('0x35')][_0xcad2('0x21')](_0x40d6f1);}return _0x2f2c0a;});}function isIdle(_0x47e2bc){return _0x47e2bc==='idle'||_0x47e2bc==='unknown'||_0x47e2bc===_0xcad2('0x47')||_0x47e2bc===_0xcad2('0x48')||_[_0xcad2('0x49')](_0x47e2bc);}function isAgentPaused(_0x5e8608,_0x4c5f2e){var _0x36ed10=[_0x5e8608[_0xcad2('0x4a')],_0x5e8608[_0xcad2('0x4b')],_0x5e8608[_0xcad2('0x4c')],_0x5e8608[_0xcad2('0x4d')],_0x5e8608['smsPause'],_0x5e8608[_0xcad2('0x4e')],_0x5e8608[_0xcad2('0x4f')]];if(!_0x4c5f2e)return _['every'](_0x36ed10);var _0x556eab=_[_0xcad2('0x50')](_0x36ed10);return _0x556eab[_0xcad2('0x3a')]>0x0&&_0x556eab[_0xcad2('0x3a')]<_0x36ed10['length']?!![]:![];}function isAgentIdle(_0x3361e8){if(_0x3361e8['voiceStatus']!==_0xcad2('0x51')&&_0x3361e8[_0xcad2('0x4e')]){_0x3361e8[_0xcad2('0x52')]='pause';return![];}return _[_0xcad2('0x53')]([_0x3361e8['chatStatus'],_0x3361e8[_0xcad2('0x54')],_0x3361e8['mailStatus'],_0x3361e8[_0xcad2('0x55')],_0x3361e8[_0xcad2('0x56')],_0x3361e8['voiceStatus'],_0x3361e8[_0xcad2('0x57')]],isIdle);}function getAgentStatus(_0x589147){var _0x1d693d=_0xcad2('0x58');if(isAgentPaused(_0x589147))_0x1d693d=_0xcad2('0x59');else if(isAgentPaused(_0x589147,!![]))_0x1d693d='*pause';else if(isAgentIdle(_0x589147))_0x1d693d=_0xcad2('0x51');else _0x1d693d=_0xcad2('0x36');return _0x1d693d;}exports[_0xcad2('0x5a')]=function(_0x42cf7d,_0x5ea208){var _0x45a171={'count':0x0,'rows':[]},_0x442409={},_0x3110c8,_0x436264,_0x35d0ee=[_0xcad2('0x5b'),_0xcad2('0x40'),_0xcad2('0x5c'),'lastPauseAt',_0xcad2('0x5d'),_0xcad2('0x5e'),_0xcad2('0x5f'),'address',_0xcad2('0x4a'),_0xcad2('0x4d'),'mailPause','smsPause',_0xcad2('0x4f'),_0xcad2('0x4b'),_0xcad2('0x4e'),_0xcad2('0x60'),_0xcad2('0x61'),_0xcad2('0x62'),'smsCapacity','whatsappCapacity',_0xcad2('0x63'),_0xcad2('0x64'),_0xcad2('0x65'),_0xcad2('0x66'),_0xcad2('0x67'),'whatsappCurrentCapacity','faxCurrentCapacity',_0xcad2('0x68'),_0xcad2('0x55'),_0xcad2('0x69'),_0xcad2('0x56'),_0xcad2('0x57'),_0xcad2('0x54'),'voiceStatus','chatStatusTime','openchannelStatusTime','mailStatusTime',_0xcad2('0x6a'),_0xcad2('0x6b'),_0xcad2('0x6c'),_0xcad2('0x6d'),_0xcad2('0x39'),_0xcad2('0x6e'),_0xcad2('0x6f'),_0xcad2('0x70'),_0xcad2('0x71'),_0xcad2('0x72')],_0xff96ec=[_0xcad2('0x4a'),_0xcad2('0x4d'),_0xcad2('0x4c'),_0xcad2('0x73'),_0xcad2('0x4f'),_0xcad2('0x4b'),_0xcad2('0x4e'),_0xcad2('0x40')];Promise[_0xcad2('0x74')]()[_0xcad2('0x13')](function(){var _0x5412a3=_[_0xcad2('0x33')](db[_0xcad2('0x42')][_0xcad2('0x75')],function(_0x400476){return{'name':_0x400476[_0xcad2('0x76')],'type':_0x400476[_0xcad2('0x77')][_0xcad2('0x78')]};});_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x7a')]=_0xcad2('0x7b');_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x40')]=!![];_0x442409=qs[_0xcad2('0x7c')](_0x5412a3,_0x42cf7d);_0x442409[_0xcad2('0x7d')]=!![];if(_0x42cf7d[_0xcad2('0x7e')]['role']===_0xcad2('0x7e')){var _0x2740be={'params':{'id':_0x42cf7d[_0xcad2('0x7e')][_0xcad2('0x7f')]},'query':{'section':_0xcad2('0x12'),'role':_0xcad2('0x7b'),'online':!![],'nolimit':_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x80')],'sort':_0x42cf7d[_0xcad2('0x79')]['sort'],'filter':_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x50')]},'raw':!![]};return db['UserProfile'][_0xcad2('0x81')](_0x2740be);}return db['User']['findAndCountAll'](_0x442409);})['then'](function(_0x44ce83){_0x45a171[_0xcad2('0xa')]=_0x44ce83[_0xcad2('0xa')];_0x3110c8=_0x44ce83['rows'];return getRealtimeAgents();})[_0xcad2('0x13')](function(_0x56a74d){_0x436264=_0x56a74d[_0xcad2('0x82')];return _0x3110c8[_0xcad2('0x33')](function(_0x2a78f2){var _0xdaa7dd=_[_0xcad2('0x3d')](_0x436264,['id',_0x2a78f2['id']]);if(_0xdaa7dd)_[_0xcad2('0x83')](_0x2a78f2,_['pick'](_[_0xcad2('0x84')](_0xdaa7dd,_0xff96ec),_0x35d0ee));_0x2a78f2[_0xcad2('0x85')]=getAgentStatus(_0x2a78f2);return _0x2a78f2;});})[_0xcad2('0x13')](function(_0x213688){if(_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x86')]){var _0x91cb14=_[_0xcad2('0x50')](_0x213688,[_0xcad2('0x85'),_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x86')]]);if(_0x42cf7d['query'][_0xcad2('0x87')]){_0x91cb14=_['filter'](_0x91cb14,['pauseType',_0x42cf7d[_0xcad2('0x79')][_0xcad2('0x87')]]);}}_0x45a171[_0xcad2('0x82')]=_0x91cb14||_0x213688;return _0x45a171;})[_0xcad2('0x13')](respondWithFilteredResult(_0x5ea208,_0x442409))[_0xcad2('0x17')](handleError(_0x5ea208,null));};exports[_0xcad2('0x88')]=function(_0x25b303,_0xd8fa39){var _0x4d96fc=['mail',_0xcad2('0x89'),'sms',_0xcad2('0x8a'),_0xcad2('0x8b'),_0xcad2('0x8c'),'voice'];var _0xf9ac16={'count':0x0,'rows':[]},_0x5c2e1f={},_0x396e9a,_0x43d617,_0x4b4637,_0x2c1fcd,_0x34b71f;Promise[_0xcad2('0x74')]()['then'](function(){if(_0x25b303[_0xcad2('0x79')]['channel']){if(!_[_0xcad2('0x8d')](_0x4d96fc,_0x25b303['query'][_0xcad2('0x8e')][_0xcad2('0x8f')]()))throw new Error('Invalid\x20channel');_0x396e9a=_0x25b303['query'][_0xcad2('0x8e')][_0xcad2('0x8f')]();}var _0x52c9d2=_[_0xcad2('0x46')](_0x396e9a)+_0xcad2('0x43');var _0x35b01d=_[_0xcad2('0x33')](db[_0x52c9d2][_0xcad2('0x75')],function(_0x30cb92){return{'name':_0x30cb92['fieldName'],'type':_0x30cb92[_0xcad2('0x77')][_0xcad2('0x78')]};});_0x5c2e1f=qs[_0xcad2('0x7c')](_0x35b01d,_0x25b303);if(_0x25b303[_0xcad2('0x7e')][_0xcad2('0x7a')]===_0xcad2('0x7e')){var _0x148c27={'params':{'id':_0x25b303[_0xcad2('0x7e')]['userProfileId']},'query':{'section':_0x396e9a===_0xcad2('0x18')&&_0x25b303['query'][_0xcad2('0x77')]==='outbound'?'QueueCampaigns':_[_0xcad2('0x46')](_0x396e9a)+_0xcad2('0x19'),'type':_0x25b303[_0xcad2('0x79')][_0xcad2('0x77')],'nolimit':!![],'sort':'name','filter':_0x25b303['query'][_0xcad2('0x50')]}};return db[_0xcad2('0x90')][_0xcad2('0x81')](_0x148c27);}return db[_0x52c9d2][_0xcad2('0x91')](_0x5c2e1f);})[_0xcad2('0x13')](function(_0x4663d8){_0xf9ac16[_0xcad2('0xa')]=_0x4663d8[_0xcad2('0xa')];_0x43d617=_0x4663d8[_0xcad2('0x82')];return getRealtimeQueues(_0x25b303,_0x396e9a);})[_0xcad2('0x13')](function(_0x39f081){_0x2c1fcd=_0x39f081[_0xcad2('0x82')];return getRealtimeAgents();})[_0xcad2('0x13')](function(_0x4d976f){_0x4b4637=_0x4d976f['rows'];if(_0x396e9a!=_0xcad2('0x18'))return;return getRealtimeVoiceQueueChannels();})[_0xcad2('0x13')](function(_0x21ad29){_0x34b71f=_0x21ad29?_0x21ad29[_0xcad2('0x82')]:[];return initializeQueues(_0x43d617,_0x2c1fcd,_0x396e9a,_0x25b303['query']['type']);})[_0xcad2('0x13')](function(_0x5655e9){var _0x4a8838=_0x5655e9['map'](function(_0x5c6a30){if(_0x396e9a==='voice')return getVoiceQueueAgents(_0x5c6a30,_0x43d617,_0x4b4637,_0x34b71f);else return getQueueAgents(_0x5c6a30,_0x4b4637,_0x396e9a);});return Promise[_0xcad2('0x92')](_0x4a8838);})[_0xcad2('0x13')](function(_0x5cea12){_0xf9ac16[_0xcad2('0x82')]=_0x5cea12;return _0xf9ac16;})[_0xcad2('0x13')](respondWithFilteredResult(_0xd8fa39,_0x5c2e1f))[_0xcad2('0x17')](handleError(_0xd8fa39,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 50ac32d..1f07f49 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1ed010,_0x734e0b){var _0x6e22bf=function(_0x1ffe15){while(--_0x1ffe15){_0x1ed010['push'](_0x1ed010['shift']());}};_0x6e22bf(++_0x734e0b);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1fec72,_0x43b3a6){var _0x833907=function(_0x435cde){while(--_0x435cde){_0x1fec72['push'](_0x1fec72['shift']());}};_0x833907(++_0x43b3a6);}(_0x70e0,0x17b));var _0x070e=function(_0x5d31d7,_0x50df94){_0x5d31d7=_0x5d31d7-0x0;var _0x579bcc=_0x70e0[_0x5d31d7];return _0x579bcc;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index cf0043b..122017d 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 _0xee4a=['STRING','DATE','sequelize','INTEGER'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xee4a,0x9e));var _0xaee4=function(_0x617d4a,_0x344df2){_0x617d4a=_0x617d4a-0x0;var _0x21be3e=_0xee4a[_0x617d4a];return _0x21be3e;};'use strict';var Sequelize=require(_0xaee4('0x0'));module['exports']={'state':{'type':Sequelize[_0xaee4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xaee4('0x2')]},'scheduledat':{'type':Sequelize[_0xaee4('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaee4('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xaee4('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xaee4('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x36b2=['DATE','STRING','sequelize','exports','INTEGER'];(function(_0x7e1a2e,_0x435866){var _0x55d34f=function(_0x5999dd){while(--_0x5999dd){_0x7e1a2e['push'](_0x7e1a2e['shift']());}};_0x55d34f(++_0x435866);}(_0x36b2,0x6b));var _0x236b=function(_0x3cf22e,_0x5d67fd){_0x3cf22e=_0x3cf22e-0x0;var _0x4031ac=_0x36b2[_0x3cf22e];return _0x4031ac;};'use strict';var Sequelize=require(_0x236b('0x0'));module[_0x236b('0x1')]={'state':{'type':Sequelize[_0x236b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x236b('0x3')]},'uniqueid':{'type':Sequelize[_0x236b('0x4')]},'starttime':{'type':Sequelize[_0x236b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x236b('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x236b('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x236b('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b8ac288..86a01f3 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 _0xe9c4=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','util','api','moment','bluebird','request-promise'];(function(_0x256065,_0x28b79f){var _0x57a9a0=function(_0x1a68f3){while(--_0x1a68f3){_0x256065['push'](_0x256065['shift']());}};_0x57a9a0(++_0x28b79f);}(_0xe9c4,0x1b7));var _0x4e9c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe9c4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x4e9c('0x0'));var logger=require('../../config/logger')(_0x4e9c('0x1'));var moment=require(_0x4e9c('0x2'));var BPromise=require(_0x4e9c('0x3'));var rp=require(_0x4e9c('0x4'));var fs=require('fs');var path=require(_0x4e9c('0x5'));var rimraf=require(_0x4e9c('0x6'));var config=require(_0x4e9c('0x7'));var attributes=require(_0x4e9c('0x8'));module[_0x4e9c('0x9')]=function(_0x4afdd6,_0x24df9f){return _0x4afdd6[_0x4e9c('0xa')](_0x4e9c('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa55=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa55,0x7a));var _0x5fa5=function(_0x425018,_0x1c3992){_0x425018=_0x425018-0x0;var _0x114180=_0xfa55[_0x425018];return _0x114180;};'use strict';var _=require(_0x5fa5('0x0'));var util=require(_0x5fa5('0x1'));var logger=require(_0x5fa5('0x2'))('api');var moment=require(_0x5fa5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fa5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fa5('0x5'));var config=require(_0x5fa5('0x6'));var attributes=require(_0x5fa5('0x7'));module[_0x5fa5('0x8')]=function(_0x370291,_0x349256){return _0x370291[_0x5fa5('0x9')](_0x5fa5('0xa'),attributes,{'tableName':_0x5fa5('0xb'),'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 343ee49..f8e6595 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 _0x9af6=['util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','create','body','options'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0x9af6,0x7d));var _0x69af=function(_0x18c5d0,_0x2ee4d9){_0x18c5d0=_0x18c5d0-0x0;var _0x54028a=_0x9af6[_0x18c5d0];return _0x54028a;};'use strict';var _=require('lodash');var util=require(_0x69af('0x0'));var moment=require(_0x69af('0x1'));var BPromise=require(_0x69af('0x2'));var rs=require(_0x69af('0x3'));var fs=require('fs');var Redis=require(_0x69af('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x69af('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x69af('0x6'));var client=jayson[_0x69af('0x7')][_0x69af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2ed6,_0x180da6,_0xb19cfa){return new BPromise(function(_0x4d00b8,_0x3daedb){return client[_0x69af('0x9')](_0x1e2ed6,_0xb19cfa)[_0x69af('0xa')](function(_0x2c65ae){logger[_0x69af('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x180da6,_0x69af('0xc'));logger[_0x69af('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x180da6,'request\x20sent',JSON[_0x69af('0xe')](_0x2c65ae));if(_0x2c65ae['error']){if(_0x2c65ae[_0x69af('0xf')][_0x69af('0x10')]===0x1f4){logger[_0x69af('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x180da6,_0x2c65ae[_0x69af('0xf')][_0x69af('0x11')]);return _0x3daedb(_0x2c65ae[_0x69af('0xf')][_0x69af('0x11')]);}logger[_0x69af('0xf')](_0x69af('0x12'),_0x180da6,_0x2c65ae[_0x69af('0xf')][_0x69af('0x11')]);return _0x4d00b8(_0x2c65ae[_0x69af('0xf')][_0x69af('0x11')]);}else{logger[_0x69af('0xb')](_0x69af('0x12'),_0x180da6,_0x69af('0xc'));_0x4d00b8(_0x2c65ae[_0x69af('0x13')]['message']);}})[_0x69af('0x14')](function(_0x52e7ee){logger[_0x69af('0xf')](_0x69af('0x12'),_0x180da6,_0x52e7ee);_0x3daedb(_0x52e7ee);});});}exports[_0x69af('0x15')]=function(_0x17be55){var _0x135452=this;return new Promise(function(_0x2b4e46,_0x5f1a1d){return db['ReportAgentPreview'][_0x69af('0x16')](_0x17be55[_0x69af('0x17')],{'raw':_0x17be55[_0x69af('0x18')]?_0x17be55[_0x69af('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x69af('0xa')](function(_0x388b33){logger[_0x69af('0xb')](_0x69af('0x15'),_0x17be55);logger['debug'](_0x69af('0x15'),_0x17be55,JSON[_0x69af('0xe')](_0x388b33));_0x2b4e46(_0x388b33);})[_0x69af('0x14')](function(_0x4acf29){logger[_0x69af('0xf')](_0x69af('0x15'),_0x4acf29[_0x69af('0x11')],_0x17be55);_0x5f1a1d(_0x135452[_0x69af('0xf')](0x1f4,_0x4acf29[_0x69af('0x11')]));});});}; \ No newline at end of file +var _0x9917=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','lodash'];(function(_0x118a88,_0x166f95){var _0x5a5ae7=function(_0x180b2d){while(--_0x180b2d){_0x118a88['push'](_0x118a88['shift']());}};_0x5a5ae7(++_0x166f95);}(_0x9917,0xc3));var _0x7991=function(_0x2b2f9e,_0x102746){_0x2b2f9e=_0x2b2f9e-0x0;var _0x46c00f=_0x9917[_0x2b2f9e];return _0x46c00f;};'use strict';var _=require(_0x7991('0x0'));var util=require(_0x7991('0x1'));var moment=require(_0x7991('0x2'));var BPromise=require(_0x7991('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7991('0x4'));var db=require(_0x7991('0x5'))['db'];var utils=require(_0x7991('0x6'));var logger=require(_0x7991('0x7'))(_0x7991('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7991('0x9')][_0x7991('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x183fc5,_0x14acd3,_0x3c98fd){return new BPromise(function(_0x43f5ee,_0x1b02a7){return client['request'](_0x183fc5,_0x3c98fd)[_0x7991('0xb')](function(_0x5adc13){logger[_0x7991('0xc')](_0x7991('0xd'),_0x14acd3,_0x7991('0xe'));logger['debug'](_0x7991('0xf'),_0x14acd3,_0x7991('0xe'),JSON[_0x7991('0x10')](_0x5adc13));if(_0x5adc13[_0x7991('0x11')]){if(_0x5adc13[_0x7991('0x11')][_0x7991('0x12')]===0x1f4){logger[_0x7991('0x11')](_0x7991('0xd'),_0x14acd3,_0x5adc13[_0x7991('0x11')][_0x7991('0x13')]);return _0x1b02a7(_0x5adc13[_0x7991('0x11')][_0x7991('0x13')]);}logger[_0x7991('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x14acd3,_0x5adc13['error']['message']);return _0x43f5ee(_0x5adc13[_0x7991('0x11')][_0x7991('0x13')]);}else{logger[_0x7991('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x14acd3,_0x7991('0xe'));_0x43f5ee(_0x5adc13['result'][_0x7991('0x13')]);}})[_0x7991('0x14')](function(_0xdf8bb0){logger[_0x7991('0x11')](_0x7991('0xd'),_0x14acd3,_0xdf8bb0);_0x1b02a7(_0xdf8bb0);});});}exports[_0x7991('0x15')]=function(_0x2449c7){var _0x2068ee=this;return new Promise(function(_0x2ae340,_0x3c15ff){return db[_0x7991('0x16')][_0x7991('0x17')](_0x2449c7[_0x7991('0x18')],{'raw':_0x2449c7['options']?_0x2449c7[_0x7991('0x19')][_0x7991('0x1a')]===undefined?!![]:![]:!![]})[_0x7991('0xb')](function(_0x4a2b1){logger[_0x7991('0xc')]('CreateReportAgentPreview',_0x2449c7);logger[_0x7991('0x1b')]('CreateReportAgentPreview',_0x2449c7,JSON[_0x7991('0x10')](_0x4a2b1));_0x2ae340(_0x4a2b1);})[_0x7991('0x14')](function(_0x384b8a){logger['error'](_0x7991('0x15'),_0x384b8a[_0x7991('0x13')],_0x2449c7);_0x3c15ff(_0x2068ee[_0x7991('0x11')](0x1f4,_0x384b8a['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index b05678e..6b32af4 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 _0xa607=['/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','showMailQueues','post','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','exports','util','Router','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels'];(function(_0x3feeef,_0x3eed46){var _0x506a37=function(_0x40b785){while(--_0x40b785){_0x3feeef['push'](_0x3feeef['shift']());}};_0x506a37(++_0x3eed46);}(_0xa607,0x192));var _0x7a60=function(_0x3733eb,_0x2d9450){_0x3733eb=_0x3733eb-0x0;var _0x4c80e3=_0xa607[_0x3733eb];return _0x4c80e3;};'use strict';var multer=require('multer');var util=require(_0x7a60('0x0'));var path=require('path');var express=require('express');var router=express[_0x7a60('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7a60('0x2'));router['get'](_0x7a60('0x3'),auth['isAuthenticated'](),controller[_0x7a60('0x4')]);router[_0x7a60('0x5')](_0x7a60('0x6'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x8')]);router[_0x7a60('0x5')](_0x7a60('0x9'),auth['isAuthenticated'](),controller[_0x7a60('0xa')]);router[_0x7a60('0x5')]('/voice/queues',auth[_0x7a60('0x7')](),controller[_0x7a60('0xb')]);router['get']('/chat/queues',auth[_0x7a60('0x7')](),controller[_0x7a60('0xc')]);router[_0x7a60('0x5')](_0x7a60('0xd'),auth[_0x7a60('0x7')](),controller[_0x7a60('0xe')]);router['get'](_0x7a60('0xf'),auth['isAuthenticated'](),controller['mailAccounts']);router['get'](_0x7a60('0x10'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x11')]);router[_0x7a60('0x5')](_0x7a60('0x12'),auth[_0x7a60('0x7')](),controller['smsQueues']);router[_0x7a60('0x5')](_0x7a60('0x13'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x14')]);router[_0x7a60('0x5')](_0x7a60('0x15'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x16')]);router[_0x7a60('0x5')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0x7a60('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x7a60('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x7a60('0x7')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x7a60('0x7')](),controller['voiceQueuesChannelHangup']);router['get'](_0x7a60('0x18'),auth['isAuthenticated'](),controller[_0x7a60('0x19')]);router[_0x7a60('0x5')](_0x7a60('0x1a'),auth[_0x7a60('0x7')](),controller['showVoiceQueues']);router[_0x7a60('0x1b')]('/voice/queues/:id',auth[_0x7a60('0x7')](),controller['updateVoiceQueue']);router[_0x7a60('0x5')]('/outbound',auth[_0x7a60('0x7')](),controller[_0x7a60('0x1c')]);router[_0x7a60('0x5')](_0x7a60('0x1d'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x1e')]);router[_0x7a60('0x5')](_0x7a60('0x1f'),auth['isAuthenticated'](),controller[_0x7a60('0x20')]);router['put'](_0x7a60('0x21'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x22')]);router['get'](_0x7a60('0x23'),auth['isAuthenticated'](),controller['telephones']);router['get'](_0x7a60('0x24'),auth['isAuthenticated'](),controller[_0x7a60('0x25')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x7a60('0x26')]);router[_0x7a60('0x5')](_0x7a60('0x27'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x28')]);router[_0x7a60('0x5')](_0x7a60('0x29'),auth[_0x7a60('0x7')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x7a60('0x7')](),controller[_0x7a60('0x2a')]);router[_0x7a60('0x5')](_0x7a60('0x2b'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x2c')]);router[_0x7a60('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x7a60('0x7')](),controller[_0x7a60('0x2d')]);router[_0x7a60('0x5')](_0x7a60('0x2e'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x2f')]);router[_0x7a60('0x5')](_0x7a60('0x30'),auth[_0x7a60('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x7a60('0x5')](_0x7a60('0x31'),auth[_0x7a60('0x7')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x7a60('0x32'),auth[_0x7a60('0x7')](),controller['queueNotify']('mail'));router['get']('/mail/queues/:id',auth[_0x7a60('0x7')](),controller[_0x7a60('0x33')]);router[_0x7a60('0x34')]('/chat/queues/:id/notify',auth[_0x7a60('0x7')](),controller[_0x7a60('0x35')](_0x7a60('0x36')));router[_0x7a60('0x5')](_0x7a60('0x37'),auth[_0x7a60('0x7')](),controller['showChatQueues']);router['post'](_0x7a60('0x38'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x35')](_0x7a60('0x39')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x7a60('0x3a')]);router[_0x7a60('0x34')](_0x7a60('0x3b'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x35')](_0x7a60('0x3c')));router[_0x7a60('0x5')](_0x7a60('0x3d'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x3e')]);router[_0x7a60('0x34')]('/sms/queues/:id/notify',auth[_0x7a60('0x7')](),controller['queueNotify'](_0x7a60('0x3f')));router[_0x7a60('0x34')](_0x7a60('0x40'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x35')](_0x7a60('0x41')));router[_0x7a60('0x5')](_0x7a60('0x42'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x43')]);router[_0x7a60('0x5')](_0x7a60('0x44'),auth[_0x7a60('0x7')](),controller[_0x7a60('0x45')]);router[_0x7a60('0x34')]('/agents/:id/notify',auth[_0x7a60('0x7')](),controller['agentNotify']);module[_0x7a60('0x46')]=router; \ No newline at end of file +var _0x14fd=['voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0x14fd,0x192));var _0xd14f=function(_0x5bdb13,_0x74e5f7){_0x5bdb13=_0x5bdb13-0x0;var _0x213e55=_0x14fd[_0x5bdb13];return _0x213e55;};'use strict';var multer=require(_0xd14f('0x0'));var util=require(_0xd14f('0x1'));var path=require(_0xd14f('0x2'));var express=require(_0xd14f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xd14f('0x4'));router[_0xd14f('0x5')](_0xd14f('0x6'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x8')]);router[_0xd14f('0x5')](_0xd14f('0x9'),auth['isAuthenticated'](),controller[_0xd14f('0xa')]);router[_0xd14f('0x5')](_0xd14f('0xb'),auth[_0xd14f('0x7')](),controller[_0xd14f('0xc')]);router['get'](_0xd14f('0xd'),auth[_0xd14f('0x7')](),controller[_0xd14f('0xe')]);router['get'](_0xd14f('0xf'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x10')]);router[_0xd14f('0x5')]('/mail/queues',auth[_0xd14f('0x7')](),controller['mailQueues']);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0xd14f('0x11')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0xd14f('0x12')]);router['get'](_0xd14f('0x13'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x14')]);router[_0xd14f('0x5')]('/whatsapp/queues',auth[_0xd14f('0x7')](),controller[_0xd14f('0x15')]);router['get']('/fax/queues',auth[_0xd14f('0x7')](),controller['faxQueues']);router[_0xd14f('0x5')](_0xd14f('0x16'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x17')]);router[_0xd14f('0x5')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0xd14f('0x18')]);router['get'](_0xd14f('0x19'),auth[_0xd14f('0x7')](),controller['voiceQueuesChannel']);router[_0xd14f('0x5')](_0xd14f('0x1a'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x1b')]);router[_0xd14f('0x5')](_0xd14f('0x1c'),auth['isAuthenticated'](),controller[_0xd14f('0x1d')]);router['get'](_0xd14f('0x1e'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x1f')]);router['put'](_0xd14f('0x1e'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xd14f('0x5')]('/outbound',auth[_0xd14f('0x7')](),controller['outbound']);router[_0xd14f('0x5')](_0xd14f('0x20'),auth[_0xd14f('0x7')](),controller['outboundChannels']);router['get'](_0xd14f('0x21'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x22')]);router[_0xd14f('0x23')](_0xd14f('0x24'),auth['isAuthenticated'](),controller[_0xd14f('0x25')]);router[_0xd14f('0x5')](_0xd14f('0x26'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x27')]);router[_0xd14f('0x5')](_0xd14f('0x28'),auth['isAuthenticated'](),controller['trunks']);router[_0xd14f('0x5')](_0xd14f('0x29'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x2a')]);router[_0xd14f('0x5')](_0xd14f('0x2b'),auth['isAuthenticated'](),controller['faxAccounts']);router['get'](_0xd14f('0x2c'),auth[_0xd14f('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xd14f('0x5')](_0xd14f('0x2d'),auth[_0xd14f('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0xd14f('0x5')](_0xd14f('0x2e'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x2f')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xd14f('0x30')]);router[_0xd14f('0x5')](_0xd14f('0x31'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x32')]);router[_0xd14f('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xd14f('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xd14f('0x33'),auth[_0xd14f('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0xd14f('0x34')](_0xd14f('0x35'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x36')](_0xd14f('0x37')));router[_0xd14f('0x5')](_0xd14f('0x38'),auth[_0xd14f('0x7')](),controller['showMailQueues']);router[_0xd14f('0x34')](_0xd14f('0x39'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x36')]('chat'));router['get'](_0xd14f('0x3a'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x3b')]);router['post'](_0xd14f('0x3c'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x36')](_0xd14f('0x3d')));router[_0xd14f('0x5')](_0xd14f('0x3e'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x3f')]);router['post']('/openchannel/queues/:id/notify',auth[_0xd14f('0x7')](),controller['queueNotify']('openchannel'));router[_0xd14f('0x5')](_0xd14f('0x40'),auth[_0xd14f('0x7')](),controller['showOpenchannelQueues']);router['post'](_0xd14f('0x41'),auth[_0xd14f('0x7')](),controller[_0xd14f('0x36')]('sms'));router[_0xd14f('0x34')](_0xd14f('0x42'),auth[_0xd14f('0x7')](),controller['queueNotify']('whatsapp'));router[_0xd14f('0x5')]('/sms/queues/:id',auth[_0xd14f('0x7')](),controller['showSmsQueues']);router[_0xd14f('0x5')](_0xd14f('0x43'),auth[_0xd14f('0x7')](),controller['showWhatsappQueues']);router[_0xd14f('0x34')](_0xd14f('0x44'),auth['isAuthenticated'](),controller[_0xd14f('0x45')]);module[_0xd14f('0x46')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 156d4c2..0f9ed98 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 _0x31f0=['YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','interface','SIP/%s','capacity','telephones','Telephones','trunks','Trunks','chatQueues','ChatQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','uniq','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','From','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','chat','agent','Agent\x20not\x20found','MessageId','TransferReport','agentTransferTimeout','bluebird','lodash','../../mysqldb','../../config/logger','api','jayson/promise','http','client','then','error','code','message','result','catch','status','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format'];(function(_0x16de43,_0x2bb75f){var _0x2aaa5d=function(_0x5d6eee){while(--_0x5d6eee){_0x16de43['push'](_0x16de43['shift']());}};_0x2aaa5d(++_0x2bb75f);}(_0x31f0,0xb7));var _0x031f=function(_0x4200ed,_0x5090eb){_0x4200ed=_0x4200ed-0x0;var _0x1f6533=_0x31f0[_0x4200ed];return _0x1f6533;};'use strict';var BPromise=require(_0x031f('0x0'));var moment=require('moment');var _=require(_0x031f('0x1'));var util=require('util');var db=require(_0x031f('0x2'))['db'];var logger=require(_0x031f('0x3'))(_0x031f('0x4'));var jayson=require(_0x031f('0x5'));var amiClient=jayson['client'][_0x031f('0x6')]({'port':0x232a});var mailClient=jayson[_0x031f('0x7')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){var _0x3e41ed=_0x365f59?_0x365f59:amiClient;return _0x3e41ed['request'](_0x3dc98e,_0x487e65)[_0x031f('0x8')](function(_0x24145f){if(_0x24145f[_0x031f('0x9')]){if(_0x24145f[_0x031f('0x9')][_0x031f('0xa')]===0x1f4){return _0x2569b6(_0x24145f[_0x031f('0x9')][_0x031f('0xb')]);}return _0x4300b4(_0x24145f[_0x031f('0x9')]['message']);}else{_0x4300b4(_0x24145f[_0x031f('0xc')]);}})[_0x031f('0xd')](function(_0x28da6e){_0x2569b6(_0x28da6e);});});}function respondWithResult(_0x351052,_0x3819bb){_0x3819bb=_0x3819bb||0xc8;return function(_0x405896){if(_0x405896){return _0x351052[_0x031f('0xe')](_0x3819bb)['json'](_0x405896);}return _0x351052[_0x031f('0xf')](0x194);};}function handleError(_0x23b40c,_0x17a699){_0x17a699=_0x17a699||0x1f4;return function(_0x2e3dfe){logger[_0x031f('0x9')](_0x2e3dfe['stack']);if(_0x2e3dfe['name']){delete _0x2e3dfe[_0x031f('0x10')];}_0x23b40c[_0x031f('0xe')](_0x17a699)[_0x031f('0x11')](_0x2e3dfe);};}function findById(_0x286177){return function(_0x5196b1){if(!_[_0x031f('0x12')](_0x286177)&&!_[_0x031f('0x12')](_0x5196b1)&&!_['isNil'](_0x5196b1[_0x031f('0x13')])){return _['find'](_0x5196b1[_0x031f('0x13')],function(_0x5f2199){return _0x5f2199['id']==_0x286177;});}return null;};}exports[_0x031f('0x14')]=function(_0xaa155,_0x1ceddc){return respondWithRpcPromise(_0x031f('0x15'),_0xaa155[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x1ceddc,null))[_0x031f('0xd')](handleError(_0x1ceddc,null));};exports[_0x031f('0x17')]=function(_0x29dd6e,_0x48a76e){return respondWithRpcPromise(_0x031f('0x18'),_[_0x031f('0x19')](_0x29dd6e[_0x031f('0x16')],_0x29dd6e['params']))['then'](respondWithResult(_0x48a76e,null))[_0x031f('0xd')](handleError(_0x48a76e,null));};exports['voiceChannelStopMixMonitor']=function(_0x3472a2,_0x57f6c4){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x3472a2[_0x031f('0x16')],_0x3472a2[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0x57f6c4,null))[_0x031f('0xd')](handleError(_0x57f6c4,null));};exports['voiceQueues']=function(_0x374b65,_0x5a64c0){return respondWithRpcPromise(_0x031f('0x1b'),_0x374b65[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x5a64c0,null))['catch'](handleError(_0x5a64c0,null));};exports[_0x031f('0x1c')]=function(_0x3b2a51,_0x54b44e){return respondWithRpcPromise(_0x031f('0x1b'),_0x3b2a51[_0x031f('0x16')])[_0x031f('0x8')](findById(_0x3b2a51['params']['id']))[_0x031f('0x8')](respondWithResult(_0x54b44e,null))[_0x031f('0xd')](handleError(_0x54b44e,null));};exports[_0x031f('0x1d')]=function(_0xaf5bea,_0xfaa36){return respondWithRpcPromise(_0x031f('0x1e'),_['merge'](_0xaf5bea[_0x031f('0x1f')],_0xaf5bea[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0xfaa36,null))[_0x031f('0xd')](handleError(_0xfaa36,null));};exports[_0x031f('0x20')]=function(_0x2d24f0,_0x378692){return respondWithRpcPromise(_0x031f('0x21'),_[_0x031f('0x19')](_0x2d24f0[_0x031f('0x16')],_0x2d24f0[_0x031f('0x1a')]))['then'](respondWithResult(_0x378692,null))[_0x031f('0xd')](handleError(_0x378692,null));};exports[_0x031f('0x22')]=function(_0xb3a6bd,_0x2f2616){return respondWithRpcPromise(_0x031f('0x23'),_0xb3a6bd[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x2f2616,null))[_0x031f('0xd')](handleError(_0x2f2616,null));};exports[_0x031f('0x24')]=function(_0xb7284d,_0x12bd77){return respondWithRpcPromise(_0x031f('0x25'),_[_0x031f('0x19')](_0xb7284d['query'],_0xb7284d[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0x12bd77,null))['catch'](handleError(_0x12bd77,null));};exports[_0x031f('0x26')]=function(_0x1fde6b,_0x4ec696){return respondWithRpcPromise(_0x031f('0x27'),_[_0x031f('0x19')](_0x1fde6b[_0x031f('0x16')],_0x1fde6b[_0x031f('0x1a')]))['then'](respondWithResult(_0x4ec696,null))['catch'](handleError(_0x4ec696,null));};exports[_0x031f('0x28')]=function(_0x555b89,_0x43ab76){return respondWithRpcPromise(_0x031f('0x29'),_[_0x031f('0x19')](_0x555b89['query'],_0x555b89['params']))[_0x031f('0x8')](respondWithResult(_0x43ab76,null))['catch'](handleError(_0x43ab76,null));};exports['outbound']=function(_0x2d489a,_0x45e3a4){return respondWithRpcPromise(_0x031f('0x2a'),_0x2d489a[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x45e3a4,null))[_0x031f('0xd')](handleError(_0x45e3a4,null));};exports[_0x031f('0x2b')]=function(_0x55c85f,_0x17a970){return respondWithRpcPromise(_0x031f('0x2c'),_0x55c85f[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x17a970,null))['catch'](handleError(_0x17a970,null));};exports[_0x031f('0x2d')]=function(_0x10f590,_0x2dba8b){var _0x5895f6;return respondWithRpcPromise(_0x031f('0x2e'),_0x10f590[_0x031f('0x16')])['then'](function(_0x36bafa){_0x5895f6=_0x36bafa;return respondWithRpcPromise(_0x031f('0x2e'),_0x10f590['query'],routingClient);})['then'](function(_0x178135){return _[_0x031f('0x19')]({},_0x178135,_0x5895f6);})[_0x031f('0x8')](respondWithResult(_0x2dba8b,null))[_0x031f('0xd')](handleError(_0x2dba8b,null));};exports[_0x031f('0x2f')]=function(_0xf0fb95,_0xe07087){if(_0xf0fb95['body']&&_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')]&&_0xf0fb95['user']&&_0xf0fb95[_0x031f('0x31')]['name']){for(var _0x456a98 in _0xf0fb95[_0x031f('0x1f')]['interaction']){if(_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x031f('0x32')](_0x456a98)){db['MemberReport'][_0x031f('0x33')]({'where':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')][_0x031f('0x10')],'type':_0x031f('0x34'),'exitAt':null,'uniqueid':_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98]&&_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98][_0x031f('0x35')]?{'$notIn':_0xf0fb95['body'][_0x031f('0x30')][_0x456a98]}:{'$ne':null}}})[_0x031f('0x8')](function(_0x28f2b3){var _0x3205ce=moment()[_0x031f('0x36')](_0x031f('0x37'));for(var _0x2111c5=0x0,_0x33d24b=_0x28f2b3[_0x031f('0x35')];_0x2111c5<_0x33d24b;_0x2111c5+=0x1){_0x28f2b3[_0x2111c5]['updateAttributes']({'exitAt':_0x3205ce});}});for(var _0x38539a=0x0;_0x38539a<_0xf0fb95['body']['interaction'][_0x456a98][_0x031f('0x35')];_0x38539a+=0x1){db[_0x031f('0x38')][_0x031f('0x39')]({'where':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')][_0x031f('0x10')],'type':'INTERACTION','uniqueid':_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98][_0x38539a],'exitAt':null},'defaults':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')]['name'],'interface':_[_0x031f('0x12')](_0xf0fb95[_0x031f('0x31')][_0x031f('0x3a')])?util[_0x031f('0x36')](_0x031f('0x3b'),_0xf0fb95[_0x031f('0x31')]['name']):_0xf0fb95['user'][_0x031f('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x031f('0x36')](_0x031f('0x37')),'role':'agent','internal':_0xf0fb95[_0x031f('0x31')]['internal'],'uniqueid':_0xf0fb95['body'][_0x031f('0x30')][_0x456a98][_0x38539a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xf0fb95[_0x031f('0x1a')]['id'],'capacity':_0xf0fb95['body'][_0x031f('0x3c')]},routingClient)[_0x031f('0x8')](respondWithResult(_0xe07087,null))['catch'](handleError(_0xe07087,null));};exports[_0x031f('0x3d')]=function(_0x2e7abe,_0x57e32d){return respondWithRpcPromise(_0x031f('0x3e'),_0x2e7abe['query'])[_0x031f('0x8')](respondWithResult(_0x57e32d,null))['catch'](handleError(_0x57e32d,null));};exports[_0x031f('0x3f')]=function(_0x24848b,_0x393807){return respondWithRpcPromise(_0x031f('0x40'),_0x24848b[_0x031f('0x16')])['then'](respondWithResult(_0x393807,null))[_0x031f('0xd')](handleError(_0x393807,null));};exports['campaigns']=function(_0x186957,_0x414350){return respondWithRpcPromise('Campaigns',_0x186957[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x414350,null))['catch'](handleError(_0x414350,null));};exports[_0x031f('0x41')]=function(_0x154ad2,_0x22a547){return respondWithRpcPromise('ChatQueues',_0x154ad2[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x22a547,null))[_0x031f('0xd')](handleError(_0x22a547,null));};exports['showChatQueues']=function(_0x3bd6f4,_0x561a2b){return respondWithRpcPromise(_0x031f('0x42'),_0x3bd6f4[_0x031f('0x16')],routingClient)['then'](findById(_0x3bd6f4['params']['id']))[_0x031f('0x8')](respondWithResult(_0x561a2b,null))[_0x031f('0xd')](handleError(_0x561a2b,null));};exports['mailQueues']=function(_0x434c0f,_0xb44c73){return respondWithRpcPromise(_0x031f('0x43'),_0x434c0f[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0xb44c73,null))[_0x031f('0xd')](handleError(_0xb44c73,null));};exports[_0x031f('0x44')]=function(_0x405398,_0x4b25e5){return respondWithRpcPromise(_0x031f('0x43'),_0x405398[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x405398['params']['id']))[_0x031f('0x8')](respondWithResult(_0x4b25e5,null))[_0x031f('0xd')](handleError(_0x4b25e5,null));};exports['mailAccounts']=function(_0xb86dcd,_0x14506b){return respondWithRpcPromise(_0x031f('0x45'),_0xb86dcd[_0x031f('0x16')],mailClient)['then'](respondWithResult(_0x14506b,null))['catch'](handleError(_0x14506b,null));};exports['openchannelQueues']=function(_0x4e2d0d,_0x9f76f3){return respondWithRpcPromise(_0x031f('0x46'),_0x4e2d0d['query'],routingClient)[_0x031f('0x8')](respondWithResult(_0x9f76f3,null))[_0x031f('0xd')](handleError(_0x9f76f3,null));};exports['showOpenchannelQueues']=function(_0x110495,_0x26ecb0){return respondWithRpcPromise(_0x031f('0x46'),_0x110495[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x110495[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x26ecb0,null))[_0x031f('0xd')](handleError(_0x26ecb0,null));};exports[_0x031f('0x47')]=function(_0x557a32,_0x138e0d){return respondWithRpcPromise('SmsQueues',_0x557a32[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x138e0d,null))[_0x031f('0xd')](handleError(_0x138e0d,null));};exports['showSmsQueues']=function(_0x4c1b74,_0xdb3d45){return respondWithRpcPromise(_0x031f('0x48'),_0x4c1b74[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x4c1b74['params']['id']))[_0x031f('0x8')](respondWithResult(_0xdb3d45,null))['catch'](handleError(_0xdb3d45,null));};exports['whatsappQueues']=function(_0x2179ee,_0x534bae){return respondWithRpcPromise('WhatsappQueues',_0x2179ee[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x534bae,null))[_0x031f('0xd')](handleError(_0x534bae,null));};exports[_0x031f('0x49')]=function(_0xe125d9,_0x584899){return respondWithRpcPromise('WhatsappQueues',_0xe125d9[_0x031f('0x16')],routingClient)['then'](findById(_0xe125d9[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x584899,null))['catch'](handleError(_0x584899,null));};exports[_0x031f('0x4a')]=function(_0xee136c,_0x439095){return respondWithRpcPromise(_0x031f('0x4b'),_0xee136c[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x439095,null))['catch'](handleError(_0x439095,null));};exports['showFaxQueues']=function(_0x3bcc7e,_0x232b62){return respondWithRpcPromise(_0x031f('0x4b'),_0x3bcc7e[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x3bcc7e[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x232b62,null))['catch'](handleError(_0x232b62,null));};exports['faxAccounts']=function(_0x4bd283,_0x5ddf46){return respondWithRpcPromise(_0x031f('0x4c'),_0x4bd283[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x5ddf46,null))['catch'](handleError(_0x5ddf46,null));};exports[_0x031f('0x4d')]=function(_0x2e56e3,_0x5133a6){return respondWithRpcPromise(_0x031f('0x4e'),_0x2e56e3[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x5133a6,null))[_0x031f('0xd')](handleError(_0x5133a6,null));};exports[_0x031f('0x4f')]=function(_0x1e10f6,_0x982c1b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1e10f6['query'],routingClient)[_0x031f('0x8')](respondWithResult(_0x982c1b,null))['catch'](handleError(_0x982c1b,null));};exports[_0x031f('0x50')]=function(_0x523f69,_0x13251c){return respondWithRpcPromise(_0x031f('0x51'),_0x523f69[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x13251c,null))[_0x031f('0xd')](handleError(_0x13251c,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0xa31a3,_0xffb00){return respondWithRpcPromise(_0x031f('0x51'),_0xa31a3['query'],routingClient)[_0x031f('0x8')](function(_0x398e7c){if(_0xa31a3[_0x031f('0x16')][_0x031f('0x52')]!==undefined){var _0x45330f=_(_0x398e7c['rows'])['filter']([_0xa31a3[_0x031f('0x16')][_0x031f('0x52')],_0xa31a3['params']['id']])[_0x031f('0x53')]('queue_id')[_0x031f('0x54')]()[_0x031f('0x55')]();return _0x398e7c[_0x031f('0x13')][_0x031f('0x56')](function(_0x52bb92){return _0x45330f[_0x031f('0x57')](_0x52bb92[_0x031f('0x58')])>-0x1;});}else{return _0x398e7c[_0x031f('0x13')]['filter'](function(_0x1328ba){return _0x1328ba[_0x031f('0x58')]===parseInt(_0xa31a3['params']['id']);});}})[_0x031f('0x8')](respondWithResult(_0xffb00,null))[_0x031f('0xd')](handleError(_0xffb00,null));};exports[_0x031f('0x59')]=function(_0x2fb2a8,_0x104025){return respondWithRpcPromise(_0x031f('0x5a'),_0x2fb2a8[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x104025,null))[_0x031f('0xd')](handleError(_0x104025,null));};exports[_0x031f('0x5b')]=function(_0x23cc40,_0x5b19c1){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x23cc40[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x5b19c1,null))['catch'](handleError(_0x5b19c1,null));};exports[_0x031f('0x5c')]=function(_0x184bbd,_0x1c8055){return respondWithRpcPromise(_0x031f('0x5d'),_0x184bbd[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x1c8055,null))[_0x031f('0xd')](handleError(_0x1c8055,null));};exports[_0x031f('0x5e')]=function(_0xecbfed){return function(_0x30a3ea,_0x3166bb){var _0x49505e,_0x1a5fd2;var _0x2d867f=_[_0x031f('0x5f')](_0xecbfed);var _0x8290bf=_0xecbfed==='chat'?_0x031f('0x60'):'Account';return db[_0x2d867f+'Queue'][_0x031f('0x61')]({'raw':!![],'where':{'id':_0x30a3ea[_0x031f('0x1a')]['id']}})['then'](function(_0x510bb6){if(_[_0x031f('0x12')](_0x510bb6)){throw new Error(_0x2d867f+_0x031f('0x62'));}_0x49505e=_0x510bb6;return db[_0x2d867f+_0x031f('0x63')][_0x031f('0x61')]({'where':{'id':_0x30a3ea[_0x031f('0x1f')][_0x031f('0x64')]},'include':[{'model':db[_0x2d867f+'Interaction'],'as':_0x031f('0x65')},{'model':db[_0x2d867f+_0x8290bf],'as':_0x031f('0x66')}]});})['then'](function(_0x25ea89){if(_[_0x031f('0x12')](_0x25ea89)){throw new Error(_0x2d867f+_0x031f('0x67'));}_0x1a5fd2=_0x25ea89;return _0x25ea89[_0x031f('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x031f('0x8')](function(){var _0x20a8c6={'uniqueid':_0xecbfed+'.'+_0x1a5fd2['id']+'.'+_0x1a5fd2[_0x031f('0x65')]['id'],'FromUserId':_0x30a3ea['user']['id'],'type':_0x031f('0x69')};_0x20a8c6[_0x2d867f+'MessageId']=_0x1a5fd2['id'];_0x20a8c6[_0x2d867f+_0x031f('0x6a')]=_0x1a5fd2[_0x031f('0x65')]['id'];_0x20a8c6[_0x031f('0x6b')+_0x2d867f+_0x8290bf+'Id']=_0x1a5fd2['Account']['id'];_0x20a8c6['To'+_0x2d867f+'QueueId']=_0x49505e['id'];return db[_0x2d867f+'TransferReport'][_0x031f('0x6c')](_0x20a8c6);})[_0x031f('0x8')](function(){return respondWithRpcPromise(_0x031f('0x6d'),{'channel':_0xecbfed,'interaction':_0x1a5fd2[_0x031f('0x65')],'message':_0x1a5fd2,'account':_0x1a5fd2[_0x031f('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0x031f('0x69'),'appdata':_0x49505e[_0x031f('0x10')]+','+(_0x1a5fd2['Account']['queueTransferTimeout']||0x12c),'interval':_0x031f('0x6e')}]},routingClient);})[_0x031f('0x8')](respondWithResult(_0x3166bb,null))['catch'](handleError(_0x3166bb,null));};};exports[_0x031f('0x6f')]=function(_0x4afad0,_0x1c31d5){var _0x20d85a,_0x5a6db6;if(_[_0x031f('0x12')](_0x4afad0[_0x031f('0x1f')]['channel'])){throw new Error(_0x031f('0x70'));}var _0x3c7dee=_0x4afad0[_0x031f('0x1f')]['channel'];var _0xa9b5e2=_[_0x031f('0x5f')](_0x3c7dee);var _0x1f6f71=_0x3c7dee===_0x031f('0x71')?_0x031f('0x60'):_0x031f('0x66');return db['User'][_0x031f('0x61')]({'raw':!![],'where':{'id':_0x4afad0[_0x031f('0x1a')]['id'],'role':_0x031f('0x72')}})[_0x031f('0x8')](function(_0x4ef395){if(_[_0x031f('0x12')](_0x4ef395)){throw new Error(_0x031f('0x73'));}_0x20d85a=_0x4ef395;return db[_0xa9b5e2+'Message'][_0x031f('0x61')]({'where':{'id':_0x4afad0[_0x031f('0x1f')][_0x031f('0x64')]},'include':[{'model':db[_0xa9b5e2+_0x031f('0x65')],'as':_0x031f('0x65')},{'model':db[_0xa9b5e2+_0x1f6f71],'as':_0x031f('0x66')}]});})[_0x031f('0x8')](function(_0xb35eef){if(_[_0x031f('0x12')](_0xb35eef)){throw new Error(_0xa9b5e2+_0x031f('0x67'));}_0x5a6db6=_0xb35eef;return _0xb35eef[_0x031f('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x031f('0x8')](function(){var _0x4b077c={'uniqueid':_0x3c7dee+'.'+_0x5a6db6['id']+'.'+_0x5a6db6[_0x031f('0x65')]['id'],'FromUserId':_0x4afad0[_0x031f('0x31')]['id'],'type':'queue','ToUserId':_0x20d85a['id']};_0x4b077c[_0xa9b5e2+_0x031f('0x74')]=_0x5a6db6['id'];_0x4b077c[_0xa9b5e2+_0x031f('0x6a')]=_0x5a6db6[_0x031f('0x65')]['id'];_0x4b077c[_0x031f('0x6b')+_0xa9b5e2+_0x1f6f71+'Id']=_0x5a6db6[_0x031f('0x66')]['id'];return db[_0xa9b5e2+_0x031f('0x75')]['create'](_0x4b077c);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x3c7dee,'interaction':_0x5a6db6[_0x031f('0x65')],'message':_0x5a6db6,'account':_0x5a6db6[_0x031f('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20d85a[_0x031f('0x10')]+','+(_0x5a6db6[_0x031f('0x66')][_0x031f('0x76')]||0x12c),'interval':_0x031f('0x6e')}]},routingClient);})['then'](respondWithResult(_0x1c31d5,null))[_0x031f('0xd')](handleError(_0x1c31d5,null));}; \ No newline at end of file +var _0xabce=['InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','jayson/promise','client','http','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','FaxAccounts','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','value','indexOf','queue_id','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','queue','MessageId'];(function(_0x161ac3,_0x142e49){var _0x3bb837=function(_0x269c7c){while(--_0x269c7c){_0x161ac3['push'](_0x161ac3['shift']());}};_0x3bb837(++_0x142e49);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0xeabc('0x0'));var moment=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));var util=require(_0xeabc('0x3'));var db=require(_0xeabc('0x4'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xeabc('0x5'));var amiClient=jayson[_0xeabc('0x6')][_0xeabc('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0xeabc('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){var _0x5d59d5=_0x3bdc29?_0x3bdc29:amiClient;return _0x5d59d5[_0xeabc('0x8')](_0x229ba4,_0x52ede8)[_0xeabc('0x9')](function(_0x2f73e9){if(_0x2f73e9[_0xeabc('0xa')]){if(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xb')]===0x1f4){return _0x8434c5(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}return _0x9417af(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}else{_0x9417af(_0x2f73e9[_0xeabc('0xd')]);}})[_0xeabc('0xe')](function(_0x435ea7){_0x8434c5(_0x435ea7);});});}function respondWithResult(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xc8;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['status'](_0x36a92e)[_0xeabc('0xf')](_0xcfbf06);}return _0x3fd0b5[_0xeabc('0x10')](0x194);};}function handleError(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0x1f4;return function(_0x5f4ee8){logger[_0xeabc('0xa')](_0x5f4ee8[_0xeabc('0x11')]);if(_0x5f4ee8[_0xeabc('0x12')]){delete _0x5f4ee8['name'];}_0x3251c6[_0xeabc('0x13')](_0x55f0de)[_0xeabc('0x14')](_0x5f4ee8);};}function findById(_0x49f2d8){return function(_0x53fe28){if(!_[_0xeabc('0x15')](_0x49f2d8)&&!_['isNil'](_0x53fe28)&&!_[_0xeabc('0x15')](_0x53fe28[_0xeabc('0x16')])){return _[_0xeabc('0x17')](_0x53fe28[_0xeabc('0x16')],function(_0x31dd53){return _0x31dd53['id']==_0x49f2d8;});}return null;};}exports[_0xeabc('0x18')]=function(_0x384be5,_0x5e30ee){return respondWithRpcPromise('VoiceChannels',_0x384be5[_0xeabc('0x19')])['then'](respondWithResult(_0x5e30ee,null))[_0xeabc('0xe')](handleError(_0x5e30ee,null));};exports[_0xeabc('0x1a')]=function(_0x502947,_0x28063a){return respondWithRpcPromise(_0xeabc('0x1b'),_[_0xeabc('0x1c')](_0x502947[_0xeabc('0x19')],_0x502947[_0xeabc('0x1d')]))['then'](respondWithResult(_0x28063a,null))[_0xeabc('0xe')](handleError(_0x28063a,null));};exports[_0xeabc('0x1e')]=function(_0x91ab00,_0x5bdd57){return respondWithRpcPromise(_0xeabc('0x1f'),_[_0xeabc('0x1c')](_0x91ab00[_0xeabc('0x19')],_0x91ab00[_0xeabc('0x1d')]))['then'](respondWithResult(_0x5bdd57,null))[_0xeabc('0xe')](handleError(_0x5bdd57,null));};exports['voiceQueues']=function(_0x27dbaf,_0x4d4e29){return respondWithRpcPromise(_0xeabc('0x20'),_0x27dbaf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x4d4e29,null))[_0xeabc('0xe')](handleError(_0x4d4e29,null));};exports[_0xeabc('0x21')]=function(_0x137293,_0x131722){return respondWithRpcPromise('VoiceQueues',_0x137293['query'])[_0xeabc('0x9')](findById(_0x137293['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x131722,null))[_0xeabc('0xe')](handleError(_0x131722,null));};exports['updateVoiceQueue']=function(_0x2163e6,_0x38572d){return respondWithRpcPromise(_0xeabc('0x22'),_[_0xeabc('0x1c')](_0x2163e6[_0xeabc('0x23')],_0x2163e6[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x38572d,null))[_0xeabc('0xe')](handleError(_0x38572d,null));};exports[_0xeabc('0x24')]=function(_0x5ebb86,_0x5b34dd){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xeabc('0x1c')](_0x5ebb86[_0xeabc('0x19')],_0x5ebb86[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x5b34dd,null))[_0xeabc('0xe')](handleError(_0x5b34dd,null));};exports[_0xeabc('0x25')]=function(_0x61c0af,_0x545d7f){return respondWithRpcPromise(_0xeabc('0x26'),_0x61c0af[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x545d7f,null))['catch'](handleError(_0x545d7f,null));};exports[_0xeabc('0x27')]=function(_0x3777c1,_0x4492fd){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xeabc('0x1c')](_0x3777c1[_0xeabc('0x19')],_0x3777c1[_0xeabc('0x1d')]))['then'](respondWithResult(_0x4492fd,null))[_0xeabc('0xe')](handleError(_0x4492fd,null));};exports[_0xeabc('0x28')]=function(_0x5d9acf,_0x50cca2){return respondWithRpcPromise(_0xeabc('0x29'),_[_0xeabc('0x1c')](_0x5d9acf['query'],_0x5d9acf[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x50cca2,null))[_0xeabc('0xe')](handleError(_0x50cca2,null));};exports[_0xeabc('0x2a')]=function(_0x34057c,_0x4b7923){return respondWithRpcPromise(_0xeabc('0x2b'),_['merge'](_0x34057c[_0xeabc('0x19')],_0x34057c[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x4b7923,null))['catch'](handleError(_0x4b7923,null));};exports['outbound']=function(_0x452580,_0x560d4a){return respondWithRpcPromise(_0xeabc('0x2c'),_0x452580['query'])['then'](respondWithResult(_0x560d4a,null))['catch'](handleError(_0x560d4a,null));};exports['outboundChannels']=function(_0x1e222a,_0x593588){return respondWithRpcPromise(_0xeabc('0x2d'),_0x1e222a[_0xeabc('0x19')])['then'](respondWithResult(_0x593588,null))[_0xeabc('0xe')](handleError(_0x593588,null));};exports['agents']=function(_0x3d48f4,_0x58aafe){var _0xbd7f03;return respondWithRpcPromise(_0xeabc('0x2e'),_0x3d48f4[_0xeabc('0x19')])['then'](function(_0x5a00d0){_0xbd7f03=_0x5a00d0;return respondWithRpcPromise('Agents',_0x3d48f4[_0xeabc('0x19')],routingClient);})[_0xeabc('0x9')](function(_0xafa59b){return _['merge']({},_0xafa59b,_0xbd7f03);})['then'](respondWithResult(_0x58aafe,null))[_0xeabc('0xe')](handleError(_0x58aafe,null));};exports[_0xeabc('0x2f')]=function(_0x5e9cb3,_0xc6af4d){if(_0x5e9cb3['body']&&_0x5e9cb3[_0xeabc('0x23')]['interaction']&&_0x5e9cb3['user']&&_0x5e9cb3['user'][_0xeabc('0x12')]){for(var _0x37c926 in _0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')]){if(_0x5e9cb3['body'][_0xeabc('0x30')]['hasOwnProperty'](_0x37c926)){db[_0xeabc('0x31')][_0xeabc('0x32')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'exitAt':null,'uniqueid':_0x5e9cb3['body']['interaction'][_0x37c926]&&_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926][_0xeabc('0x35')]?{'$notIn':_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926]}:{'$ne':null}}})[_0xeabc('0x9')](function(_0x2b3c28){var _0x459c98=moment()[_0xeabc('0x36')](_0xeabc('0x37'));for(var _0xcaa5b9=0x0,_0x2003a7=_0x2b3c28['length'];_0xcaa5b9<_0x2003a7;_0xcaa5b9+=0x1){_0x2b3c28[_0xcaa5b9][_0xeabc('0x38')]({'exitAt':_0x459c98});}});for(var _0x2c85f0=0x0;_0x2c85f0<_0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')][_0x37c926][_0xeabc('0x35')];_0x2c85f0+=0x1){db[_0xeabc('0x31')][_0xeabc('0x39')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0],'exitAt':null},'defaults':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'interface':_[_0xeabc('0x15')](_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')])?util[_0xeabc('0x36')]('SIP/%s',_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')]):_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')],'type':_0xeabc('0x34'),'enterAt':moment()['format'](_0xeabc('0x37')),'role':_0xeabc('0x3b'),'internal':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3c')],'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0]}});}}}}return respondWithRpcPromise(_0xeabc('0x3d'),{'id':_0x5e9cb3['params']['id'],'capacity':_0x5e9cb3[_0xeabc('0x23')]['capacity']},routingClient)[_0xeabc('0x9')](respondWithResult(_0xc6af4d,null))['catch'](handleError(_0xc6af4d,null));};exports[_0xeabc('0x3e')]=function(_0x2ec94c,_0x38f988){return respondWithRpcPromise(_0xeabc('0x3f'),_0x2ec94c[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x38f988,null))[_0xeabc('0xe')](handleError(_0x38f988,null));};exports[_0xeabc('0x40')]=function(_0x31aedf,_0x6423f3){return respondWithRpcPromise('Trunks',_0x31aedf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x6423f3,null))[_0xeabc('0xe')](handleError(_0x6423f3,null));};exports[_0xeabc('0x41')]=function(_0x555d6b,_0x1cef45){return respondWithRpcPromise(_0xeabc('0x42'),_0x555d6b[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x1cef45,null))['catch'](handleError(_0x1cef45,null));};exports[_0xeabc('0x43')]=function(_0x1c7679,_0x3a1b84){return respondWithRpcPromise(_0xeabc('0x44'),_0x1c7679[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x3a1b84,null))[_0xeabc('0xe')](handleError(_0x3a1b84,null));};exports[_0xeabc('0x45')]=function(_0x17acf8,_0x58ab08){return respondWithRpcPromise(_0xeabc('0x44'),_0x17acf8['query'],routingClient)['then'](findById(_0x17acf8['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x58ab08,null))[_0xeabc('0xe')](handleError(_0x58ab08,null));};exports[_0xeabc('0x46')]=function(_0xb35103,_0xe89728){return respondWithRpcPromise(_0xeabc('0x47'),_0xb35103['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0xe89728,null))[_0xeabc('0xe')](handleError(_0xe89728,null));};exports[_0xeabc('0x48')]=function(_0x104c1e,_0x2ddc53){return respondWithRpcPromise(_0xeabc('0x47'),_0x104c1e[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x104c1e['params']['id']))['then'](respondWithResult(_0x2ddc53,null))[_0xeabc('0xe')](handleError(_0x2ddc53,null));};exports[_0xeabc('0x49')]=function(_0x2c0894,_0x4b3794){return respondWithRpcPromise(_0xeabc('0x4a'),_0x2c0894['query'],mailClient)['then'](respondWithResult(_0x4b3794,null))[_0xeabc('0xe')](handleError(_0x4b3794,null));};exports[_0xeabc('0x4b')]=function(_0x13f04f,_0x4f5451){return respondWithRpcPromise(_0xeabc('0x4c'),_0x13f04f[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x4f5451,null))[_0xeabc('0xe')](handleError(_0x4f5451,null));};exports[_0xeabc('0x4d')]=function(_0x321a90,_0x7697f7){return respondWithRpcPromise(_0xeabc('0x4c'),_0x321a90[_0xeabc('0x19')],routingClient)['then'](findById(_0x321a90[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x7697f7,null))[_0xeabc('0xe')](handleError(_0x7697f7,null));};exports[_0xeabc('0x4e')]=function(_0x1b61a8,_0x19faa4){return respondWithRpcPromise(_0xeabc('0x4f'),_0x1b61a8[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x19faa4,null))['catch'](handleError(_0x19faa4,null));};exports[_0xeabc('0x50')]=function(_0x590439,_0x404846){return respondWithRpcPromise(_0xeabc('0x4f'),_0x590439[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x590439[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x404846,null))[_0xeabc('0xe')](handleError(_0x404846,null));};exports[_0xeabc('0x51')]=function(_0x5d4bc2,_0x24d0e5){return respondWithRpcPromise('WhatsappQueues',_0x5d4bc2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x24d0e5,null))[_0xeabc('0xe')](handleError(_0x24d0e5,null));};exports[_0xeabc('0x52')]=function(_0x5b4430,_0x12fd48){return respondWithRpcPromise('WhatsappQueues',_0x5b4430['query'],routingClient)[_0xeabc('0x9')](findById(_0x5b4430[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x12fd48,null))[_0xeabc('0xe')](handleError(_0x12fd48,null));};exports['faxQueues']=function(_0x51a0c7,_0x2e712e){return respondWithRpcPromise('FaxQueues',_0x51a0c7['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0x2e712e,null))['catch'](handleError(_0x2e712e,null));};exports['showFaxQueues']=function(_0xa44f2d,_0x1c84b5){return respondWithRpcPromise('FaxQueues',_0xa44f2d['query'],routingClient)[_0xeabc('0x9')](findById(_0xa44f2d['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x1c84b5,null))[_0xeabc('0xe')](handleError(_0x1c84b5,null));};exports['faxAccounts']=function(_0x5d6477,_0x24365a){return respondWithRpcPromise(_0xeabc('0x53'),_0x5d6477[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x24365a,null))[_0xeabc('0xe')](handleError(_0x24365a,null));};exports['chatQueuesWaitingInteractions']=function(_0x53f578,_0x391cae){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x53f578[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x391cae,null))[_0xeabc('0xe')](handleError(_0x391cae,null));};exports['mailQueuesWaitingInteractions']=function(_0x1fdaba,_0x53ac31){return respondWithRpcPromise(_0xeabc('0x54'),_0x1fdaba[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x53ac31,null))[_0xeabc('0xe')](handleError(_0x53ac31,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x6ee7cf,_0x4fa682){return respondWithRpcPromise(_0xeabc('0x55'),_0x6ee7cf[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x4fa682,null))[_0xeabc('0xe')](handleError(_0x4fa682,null));};exports[_0xeabc('0x56')]=function(_0x5c1ab2,_0x239350){return respondWithRpcPromise(_0xeabc('0x55'),_0x5c1ab2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](function(_0x5427c8){if(_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')]!==undefined){var _0xe60b11=_(_0x5427c8[_0xeabc('0x16')])['filter']([_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')],_0x5c1ab2[_0xeabc('0x1d')]['id']])[_0xeabc('0x58')]('queue_id')['uniq']()[_0xeabc('0x59')]();return _0x5427c8['rows']['filter'](function(_0x3271b6){return _0xe60b11[_0xeabc('0x5a')](_0x3271b6[_0xeabc('0x5b')])>-0x1;});}else{return _0x5427c8['rows'][_0xeabc('0x5c')](function(_0x403b18){return _0x403b18['queue_id']===parseInt(_0x5c1ab2[_0xeabc('0x1d')]['id']);});}})[_0xeabc('0x9')](respondWithResult(_0x239350,null))[_0xeabc('0xe')](handleError(_0x239350,null));};exports[_0xeabc('0x5d')]=function(_0x2ece2c,_0x4bf9d8){return respondWithRpcPromise(_0xeabc('0x5e'),_0x2ece2c['query'],routingClient)['then'](respondWithResult(_0x4bf9d8,null))['catch'](handleError(_0x4bf9d8,null));};exports[_0xeabc('0x5f')]=function(_0x1c8a51,_0x1b6e9e){return respondWithRpcPromise(_0xeabc('0x60'),_0x1c8a51[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x1b6e9e,null))[_0xeabc('0xe')](handleError(_0x1b6e9e,null));};exports['faxQueuesWaitingInteractions']=function(_0x1795fe,_0x2f95c7){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x1795fe[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x2f95c7,null))['catch'](handleError(_0x2f95c7,null));};exports[_0xeabc('0x61')]=function(_0xa5c4ca){return function(_0x439a48,_0x3acb88){var _0x3c6a49,_0x4dfc4b;var _0x399735=_[_0xeabc('0x62')](_0xa5c4ca);var _0x33e5fb=_0xa5c4ca===_0xeabc('0x63')?_0xeabc('0x64'):_0xeabc('0x65');return db[_0x399735+_0xeabc('0x66')][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0x439a48[_0xeabc('0x1d')]['id']}})[_0xeabc('0x9')](function(_0x522c6e){if(_[_0xeabc('0x15')](_0x522c6e)){throw new Error(_0x399735+_0xeabc('0x68'));}_0x3c6a49=_0x522c6e;return db[_0x399735+_0xeabc('0x69')]['findOne']({'where':{'id':_0x439a48['body'][_0xeabc('0x6a')]},'include':[{'model':db[_0x399735+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x399735+_0x33e5fb],'as':_0xeabc('0x65')}]});})[_0xeabc('0x9')](function(_0x5f5a47){if(_[_0xeabc('0x15')](_0x5f5a47)){throw new Error(_0x399735+'\x20Message\x20not\x20found');}_0x4dfc4b=_0x5f5a47;return _0x5f5a47['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xeabc('0x9')](function(){var _0x302e94={'uniqueid':_0xa5c4ca+'.'+_0x4dfc4b['id']+'.'+_0x4dfc4b['Interaction']['id'],'FromUserId':_0x439a48[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c')};_0x302e94[_0x399735+_0xeabc('0x6d')]=_0x4dfc4b['id'];_0x302e94[_0x399735+_0xeabc('0x6e')]=_0x4dfc4b[_0xeabc('0x6b')]['id'];_0x302e94[_0xeabc('0x6f')+_0x399735+_0x33e5fb+'Id']=_0x4dfc4b[_0xeabc('0x65')]['id'];_0x302e94['To'+_0x399735+_0xeabc('0x70')]=_0x3c6a49['id'];return db[_0x399735+_0xeabc('0x71')][_0xeabc('0x72')](_0x302e94);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0xa5c4ca,'interaction':_0x4dfc4b[_0xeabc('0x6b')],'message':_0x4dfc4b,'account':_0x4dfc4b['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x6c'),'appdata':_0x3c6a49[_0xeabc('0x12')]+','+(_0x4dfc4b[_0xeabc('0x65')][_0xeabc('0x73')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x3acb88,null))[_0xeabc('0xe')](handleError(_0x3acb88,null));};};exports[_0xeabc('0x75')]=function(_0xb85c3d,_0x156e20){var _0x42e92b,_0x5d471f;if(_[_0xeabc('0x15')](_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')])){throw new Error(_0xeabc('0x77'));}var _0x5b00d6=_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')];var _0x580661=_[_0xeabc('0x62')](_0x5b00d6);var _0x22ef88=_0x5b00d6==='chat'?'Website':'Account';return db['User'][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0xb85c3d[_0xeabc('0x1d')]['id'],'role':_0xeabc('0x3b')}})[_0xeabc('0x9')](function(_0x1d8dca){if(_[_0xeabc('0x15')](_0x1d8dca)){throw new Error(_0xeabc('0x78'));}_0x42e92b=_0x1d8dca;return db[_0x580661+_0xeabc('0x69')][_0xeabc('0x67')]({'where':{'id':_0xb85c3d[_0xeabc('0x23')]['messageId']},'include':[{'model':db[_0x580661+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x580661+_0x22ef88],'as':'Account'}]});})[_0xeabc('0x9')](function(_0x32063c){if(_[_0xeabc('0x15')](_0x32063c)){throw new Error(_0x580661+'\x20Message\x20not\x20found');}_0x5d471f=_0x32063c;return _0x32063c[_0xeabc('0x79')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x425e5c={'uniqueid':_0x5b00d6+'.'+_0x5d471f['id']+'.'+_0x5d471f[_0xeabc('0x6b')]['id'],'FromUserId':_0xb85c3d[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c'),'ToUserId':_0x42e92b['id']};_0x425e5c[_0x580661+_0xeabc('0x6d')]=_0x5d471f['id'];_0x425e5c[_0x580661+'InteractionId']=_0x5d471f['Interaction']['id'];_0x425e5c['From'+_0x580661+_0x22ef88+'Id']=_0x5d471f['Account']['id'];return db[_0x580661+_0xeabc('0x71')][_0xeabc('0x72')](_0x425e5c);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x5b00d6,'interaction':_0x5d471f[_0xeabc('0x6b')],'message':_0x5d471f,'account':_0x5d471f[_0xeabc('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x3b'),'appdata':_0x42e92b[_0xeabc('0x12')]+','+(_0x5d471f[_0xeabc('0x65')][_0xeabc('0x7a')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x156e20,null))[_0xeabc('0xe')](handleError(_0x156e20,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ba37d23..519252b 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 _0xaa1c=['show','create','put','delete','destroy','exports','path','express','Router','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xaa1c,0x1b9));var _0xcaa1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaa1c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcaa1('0x0'));var timeout=require('connect-timeout');var express=require(_0xcaa1('0x1'));var router=express[_0xcaa1('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcaa1('0x3'));var controller=require(_0xcaa1('0x4'));router[_0xcaa1('0x5')]('/',auth['isAuthenticated'](),controller[_0xcaa1('0x6')]);router[_0xcaa1('0x5')](_0xcaa1('0x7'),auth[_0xcaa1('0x8')](),controller[_0xcaa1('0x9')]);router[_0xcaa1('0x5')]('/:id/run',auth[_0xcaa1('0x8')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xcaa1('0xa')]);router[_0xcaa1('0xb')](_0xcaa1('0x7'),auth[_0xcaa1('0x8')](),controller['update']);router[_0xcaa1('0xc')](_0xcaa1('0x7'),auth['isAuthenticated'](),controller[_0xcaa1('0xd')]);module[_0xcaa1('0xe')]=router; \ No newline at end of file +var _0xc4e2=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id/run','run','post','create','put','update','delete','/:id','multer'];(function(_0x61021c,_0x243da8){var _0x4b4ea2=function(_0x52e6f0){while(--_0x52e6f0){_0x61021c['push'](_0x61021c['shift']());}};_0x4b4ea2(++_0x243da8);}(_0xc4e2,0x1e2));var _0x2c4e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc4e2[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x2c4e('0x0'));var util=require(_0x2c4e('0x1'));var path=require(_0x2c4e('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c4e('0x3'));var router=express[_0x2c4e('0x4')]();var fs_extra=require(_0x2c4e('0x5'));var auth=require(_0x2c4e('0x6'));var interaction=require(_0x2c4e('0x7'));var config=require(_0x2c4e('0x8'));var controller=require(_0x2c4e('0x9'));router[_0x2c4e('0xa')]('/',auth[_0x2c4e('0xb')](),controller[_0x2c4e('0xc')]);router[_0x2c4e('0xa')]('/:id',auth[_0x2c4e('0xb')](),controller['show']);router['get'](_0x2c4e('0xd'),auth[_0x2c4e('0xb')](),controller[_0x2c4e('0xe')]);router[_0x2c4e('0xf')]('/',auth[_0x2c4e('0xb')](),controller[_0x2c4e('0x10')]);router[_0x2c4e('0x11')]('/:id',auth[_0x2c4e('0xb')](),controller[_0x2c4e('0x12')]);router[_0x2c4e('0x13')](_0x2c4e('0x14'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 66c4851..f429be3 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 _0xb5b3=['ENUM','months','weeks','days','minutes','csv','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x997ede,_0x5a0814){var _0x1f3288=function(_0x5ddd2a){while(--_0x5ddd2a){_0x997ede['push'](_0x997ede['shift']());}};_0x1f3288(++_0x5a0814);}(_0xb5b3,0xca));var _0x3b5b=function(_0x239ac7,_0x25bbf3){_0x239ac7=_0x239ac7-0x0;var _0x99f88c=_0xb5b3[_0x239ac7];return _0x99f88c;};'use strict';var Sequelize=require(_0x3b5b('0x0'));module[_0x3b5b('0x1')]={'name':{'type':Sequelize[_0x3b5b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3b5b('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b5b('0x3')},'startAt':{'type':Sequelize[_0x3b5b('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3b5b('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3b5b('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3b5b('0x6')]('years','quarters',_0x3b5b('0x7'),_0x3b5b('0x8'),_0x3b5b('0x9'),'hours',_0x3b5b('0xa')),'allowNull':![],'defaultValue':_0x3b5b('0x9')},'output':{'type':Sequelize[_0x3b5b('0x6')](_0x3b5b('0xb'),'pdf',_0x3b5b('0xc')),'allowNull':![],'defaultValue':_0x3b5b('0xb')},'type':{'type':Sequelize[_0x3b5b('0x6')](_0x3b5b('0xd'),'default'),'allowNull':![],'defaultValue':_0x3b5b('0xd')},'sendMail':{'type':Sequelize[_0x3b5b('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x3b5b('0x2')]},'cc':{'type':Sequelize[_0x3b5b('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x3b5b('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0465=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','years','months','days','hours','ENUM','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0465,0x1c9));var _0x5046=function(_0xc1fdd3,_0x350cc3){_0xc1fdd3=_0xc1fdd3-0x0;var _0x3ccc51=_0x0465[_0xc1fdd3];return _0x3ccc51;};'use strict';var Sequelize=require(_0x5046('0x0'));module[_0x5046('0x1')]={'name':{'type':Sequelize[_0x5046('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5046('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5046('0x2')],'allowNull':![],'defaultValue':_0x5046('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x5046('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5046('0x6'),'quarters',_0x5046('0x7'),'weeks',_0x5046('0x8'),_0x5046('0x9'),'minutes'),'allowNull':![],'defaultValue':_0x5046('0x8')},'output':{'type':Sequelize[_0x5046('0xa')]('csv',_0x5046('0xb'),_0x5046('0xc')),'allowNull':![],'defaultValue':_0x5046('0xd')},'type':{'type':Sequelize['ENUM'](_0x5046('0xe'),_0x5046('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x5046('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5046('0x2')]},'cc':{'type':Sequelize[_0x5046('0x10')]},'bcc':{'type':Sequelize[_0x5046('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 5f398b3..2d4a393 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 _0x2289=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','map','Schedule','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','find','userProfileId','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x436015,_0x4c5240){var _0x5de12e=function(_0x17bfb2){while(--_0x17bfb2){_0x436015['push'](_0x436015['shift']());}};_0x5de12e(++_0x4c5240);}(_0x2289,0x148));var _0x9228=function(_0x3f13fb,_0x38a934){_0x3f13fb=_0x3f13fb-0x0;var _0x4f14f2=_0x2289[_0x3f13fb];return _0x4f14f2;};'use strict';var emlformat=require(_0x9228('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9228('0x1'));var jsonpatch=require(_0x9228('0x2'));var rp=require(_0x9228('0x3'));var moment=require('moment');var BPromise=require(_0x9228('0x4'));var Mustache=require(_0x9228('0x5'));var util=require(_0x9228('0x6'));var path=require(_0x9228('0x7'));var sox=require(_0x9228('0x8'));var csv=require(_0x9228('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9228('0xa'));var _=require(_0x9228('0xb'));var squel=require(_0x9228('0xc'));var crypto=require(_0x9228('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9228('0x9'));var querystring=require(_0x9228('0xe'));var Papa=require(_0x9228('0xf'));var Redis=require(_0x9228('0x10'));var authService=require(_0x9228('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9228('0x12'));var logger=require(_0x9228('0x13'))(_0x9228('0x14'));var utils=require(_0x9228('0x15'));var config=require(_0x9228('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9228('0x17'))['db'];function respondWithStatusCode(_0x1a7a5f,_0x4cf1fe){_0x4cf1fe=_0x4cf1fe||0xcc;return function(_0x492273){if(_0x492273){return _0x1a7a5f['sendStatus'](_0x4cf1fe);}return _0x1a7a5f[_0x9228('0x18')](_0x4cf1fe)[_0x9228('0x19')]();};}function respondWithResult(_0x24896d,_0x51a62f){_0x51a62f=_0x51a62f||0xc8;return function(_0x531490){if(_0x531490){return _0x24896d[_0x9228('0x18')](_0x51a62f)[_0x9228('0x1a')](_0x531490);}};}function respondWithFilteredResult(_0x4f918b,_0x55e44e){return function(_0x46ecb8){if(_0x46ecb8){var _0x31050c=typeof _0x55e44e[_0x9228('0x1b')]===_0x9228('0x1c')&&typeof _0x55e44e[_0x9228('0x1d')]===_0x9228('0x1c');var _0x454181=_0x46ecb8[_0x9228('0x1e')];var _0x23da12=_0x31050c?0x0:_0x55e44e[_0x9228('0x1b')];var _0x8e839d=_0x31050c?_0x46ecb8[_0x9228('0x1e')]:_0x55e44e[_0x9228('0x1b')]+_0x55e44e['limit'];var _0x520433;if(_0x8e839d>=_0x454181){_0x8e839d=_0x454181;_0x520433=0xc8;}else{_0x520433=0xce;}_0x4f918b[_0x9228('0x18')](_0x520433);return _0x4f918b[_0x9228('0x1f')](_0x9228('0x20'),_0x23da12+'-'+_0x8e839d+'/'+_0x454181)[_0x9228('0x1a')](_0x46ecb8);}return null;};}function patchUpdates(_0x28de56){return function(_0x432017){try{jsonpatch['apply'](_0x432017,_0x28de56,!![]);}catch(_0x3bd7c7){return BPromise[_0x9228('0x21')](_0x3bd7c7);}return _0x432017[_0x9228('0x22')]();};}function saveUpdates(_0x376e99,_0x35219a){return function(_0x2746ab){if(_0x2746ab){return _0x2746ab[_0x9228('0x23')](_0x376e99)[_0x9228('0x24')](function(_0x45d010){return _0x45d010;});}return null;};}function removeEntity(_0x207ef5,_0x2b6fde){return function(_0x1813c4){if(_0x1813c4){return _0x1813c4[_0x9228('0x25')]()[_0x9228('0x24')](function(){var _0x216c76=_0x1813c4['get']({'plain':!![]});var _0x478cff='Scheduler';return db[_0x9228('0x26')][_0x9228('0x25')]({'where':{'type':_0x478cff,'resourceId':_0x216c76['id']}})[_0x9228('0x24')](function(){return _0x1813c4;});})[_0x9228('0x24')](function(){_0x207ef5[_0x9228('0x18')](0xcc)[_0x9228('0x19')]();});}};}function handleEntityNotFound(_0x41940f,_0x53c402){return function(_0x10e881){if(!_0x10e881){_0x41940f[_0x9228('0x27')](0x194);}return _0x10e881;};}function handleError(_0x596e5f,_0xaa6399){_0xaa6399=_0xaa6399||0x1f4;return function(_0x53e12a){logger['error'](_0x53e12a[_0x9228('0x28')]);if(_0x53e12a[_0x9228('0x29')]){delete _0x53e12a['name'];}_0x596e5f['status'](_0xaa6399)[_0x9228('0x2a')](_0x53e12a);};}exports['index']=function(_0x50ee9c,_0x155e67){var _0xefae53={},_0x94d4e8={},_0x1442ac={'count':0x0,'rows':[]};var _0x33af6c=_[_0x9228('0x2b')](db[_0x9228('0x2c')][_0x9228('0x2d')],function(_0x33d2b6){return{'name':_0x33d2b6['fieldName'],'type':_0x33d2b6[_0x9228('0x2e')][_0x9228('0x2f')]};});_0x94d4e8['model']=_[_0x9228('0x2b')](_0x33af6c,_0x9228('0x29'));_0x94d4e8[_0x9228('0x30')]=_[_0x9228('0x31')](_0x50ee9c['query']);_0x94d4e8[_0x9228('0x32')]=_[_0x9228('0x33')](_0x94d4e8[_0x9228('0x34')],_0x94d4e8[_0x9228('0x30')]);_0xefae53[_0x9228('0x35')]=_['intersection'](_0x94d4e8[_0x9228('0x34')],qs[_0x9228('0x36')](_0x50ee9c[_0x9228('0x30')][_0x9228('0x36')]));_0xefae53[_0x9228('0x35')]=_0xefae53[_0x9228('0x35')][_0x9228('0x37')]?_0xefae53[_0x9228('0x35')]:_0x94d4e8[_0x9228('0x34')];if(!_0x50ee9c['query'][_0x9228('0x38')](_0x9228('0x39'))){_0xefae53['limit']=qs[_0x9228('0x1d')](_0x50ee9c[_0x9228('0x30')][_0x9228('0x1d')]);_0xefae53[_0x9228('0x1b')]=qs[_0x9228('0x1b')](_0x50ee9c[_0x9228('0x30')][_0x9228('0x1b')]);}_0xefae53[_0x9228('0x3a')]=qs['sort'](_0x50ee9c[_0x9228('0x30')][_0x9228('0x3b')]);_0xefae53['where']=qs[_0x9228('0x32')](_[_0x9228('0x3c')](_0x50ee9c[_0x9228('0x30')],_0x94d4e8[_0x9228('0x32')]),_0x33af6c);if(_0x50ee9c[_0x9228('0x30')][_0x9228('0x3d')]){_0xefae53[_0x9228('0x3e')]=_[_0x9228('0x3f')](_0xefae53[_0x9228('0x3e')],{'$or':_[_0x9228('0x2b')](_0x33af6c,function(_0x1838eb){if(_0x1838eb[_0x9228('0x2e')]!=='VIRTUAL'){var _0x58cd5e={};_0x58cd5e[_0x1838eb[_0x9228('0x29')]]={'$like':'%'+_0x50ee9c[_0x9228('0x30')][_0x9228('0x3d')]+'%'};return _0x58cd5e;}})});}_0xefae53=_[_0x9228('0x3f')]({},_0xefae53,_0x50ee9c[_0x9228('0x40')]);var _0x534a3c={'where':_0xefae53['where']};return db['Schedule'][_0x9228('0x1e')](_0x534a3c)[_0x9228('0x24')](function(_0x5c2d22){_0x1442ac['count']=_0x5c2d22;if(_0x50ee9c['query'][_0x9228('0x41')]){_0xefae53['include']=[{'all':!![]}];}return db[_0x9228('0x2c')][_0x9228('0x42')](_0xefae53);})[_0x9228('0x24')](function(_0x5bd3e3){_0x1442ac[_0x9228('0x43')]=_0x5bd3e3;return _0x1442ac;})[_0x9228('0x24')](respondWithFilteredResult(_0x155e67,_0xefae53))['catch'](handleError(_0x155e67,null));};exports[_0x9228('0x44')]=function(_0xd90331,_0x3c3f45){var _0x2062c0={'raw':![],'where':{'id':_0xd90331[_0x9228('0x45')]['id']}},_0x251c3c={};_0x251c3c[_0x9228('0x34')]=_[_0x9228('0x31')](db[_0x9228('0x2c')]['rawAttributes']);_0x251c3c[_0x9228('0x30')]=_['keys'](_0xd90331[_0x9228('0x30')]);_0x251c3c[_0x9228('0x32')]=_[_0x9228('0x33')](_0x251c3c[_0x9228('0x34')],_0x251c3c[_0x9228('0x30')]);_0x2062c0['attributes']=_[_0x9228('0x33')](_0x251c3c[_0x9228('0x34')],qs['fields'](_0xd90331[_0x9228('0x30')][_0x9228('0x36')]));_0x2062c0['attributes']=_0x2062c0['attributes'][_0x9228('0x37')]?_0x2062c0[_0x9228('0x35')]:_0x251c3c['model'];if(_0xd90331[_0x9228('0x30')][_0x9228('0x41')]){_0x2062c0[_0x9228('0x46')]=[{'all':!![]}];}_0x2062c0=_[_0x9228('0x3f')]({},_0x2062c0,_0xd90331['options']);return db[_0x9228('0x2c')]['find'](_0x2062c0)[_0x9228('0x24')](handleEntityNotFound(_0x3c3f45,null))[_0x9228('0x24')](respondWithResult(_0x3c3f45,null))[_0x9228('0x47')](handleError(_0x3c3f45,null));};exports[_0x9228('0x48')]=function(_0x38ed2d,_0x574a20){return db[_0x9228('0x2c')][_0x9228('0x48')](_0x38ed2d[_0x9228('0x49')],{})['then'](function(_0x1ca7e5){var _0x2f3ea2=_0x38ed2d[_0x9228('0x4a')][_0x9228('0x4b')]({'plain':!![]});if(!_0x2f3ea2)throw new Error(_0x9228('0x4c'));if(_0x2f3ea2[_0x9228('0x4d')]===_0x9228('0x4a')){var _0x289263=_0x1ca7e5[_0x9228('0x4b')]({'plain':!![]});var _0x3997ee=_0x9228('0x4e');return db['UserProfileSection'][_0x9228('0x4f')]({'where':{'name':_0x3997ee,'userProfileId':_0x2f3ea2[_0x9228('0x50')]},'raw':!![]})[_0x9228('0x24')](function(_0x11af68){if(_0x11af68&&_0x11af68['autoAssociation']===0x0){return db[_0x9228('0x26')][_0x9228('0x48')]({'name':_0x289263[_0x9228('0x29')],'resourceId':_0x289263['id'],'type':_0x11af68['name'],'sectionId':_0x11af68['id']},{})['then'](function(){return _0x1ca7e5;});}else{return _0x1ca7e5;}})[_0x9228('0x47')](function(_0x58c0b5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58c0b5);throw _0x58c0b5;});}return _0x1ca7e5;})['then'](respondWithResult(_0x574a20,0xc9))[_0x9228('0x47')](handleError(_0x574a20,null));};exports[_0x9228('0x23')]=function(_0x3a48fe,_0x3fe2cd){if(_0x3a48fe[_0x9228('0x49')]['id']){delete _0x3a48fe[_0x9228('0x49')]['id'];}return db[_0x9228('0x2c')][_0x9228('0x4f')]({'where':{'id':_0x3a48fe[_0x9228('0x45')]['id']}})[_0x9228('0x24')](handleEntityNotFound(_0x3fe2cd,null))[_0x9228('0x24')](saveUpdates(_0x3a48fe[_0x9228('0x49')],null))[_0x9228('0x24')](respondWithResult(_0x3fe2cd,null))['catch'](handleError(_0x3fe2cd,null));};exports[_0x9228('0x25')]=function(_0x18bd5e,_0x483cf0){return db[_0x9228('0x2c')][_0x9228('0x4f')]({'where':{'id':_0x18bd5e[_0x9228('0x45')]['id']}})[_0x9228('0x24')](handleEntityNotFound(_0x483cf0,null))[_0x9228('0x24')](removeEntity(_0x483cf0,null))[_0x9228('0x47')](handleError(_0x483cf0,null));};exports[_0x9228('0x51')]=function(_0xe9bab9,_0x3d3646,_0x45e826){var _0x2412e0=require(_0x9228('0x52'));return db['Schedule'][_0x9228('0x4f')]({'where':{'id':_0xe9bab9[_0x9228('0x45')]['id']},'raw':!![]})[_0x9228('0x24')](handleEntityNotFound(_0x3d3646,null))['then'](function(){_0x2412e0[_0x9228('0x51')](_0xe9bab9['params']['id']);})[_0x9228('0x24')](respondWithStatusCode(_0x3d3646,null))[_0x9228('0x47')](handleError(_0x3d3646,null));}; \ No newline at end of file +var _0x864c=['UserProfileResource','then','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','get'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x864c,0x1e7));var _0xc864=function(_0x4716fe,_0x30c5fe){_0x4716fe=_0x4716fe-0x0;var _0x179ea2=_0x864c[_0x4716fe];return _0x179ea2;};'use strict';var emlformat=require(_0xc864('0x0'));var rimraf=require(_0xc864('0x1'));var zipdir=require(_0xc864('0x2'));var jsonpatch=require(_0xc864('0x3'));var rp=require(_0xc864('0x4'));var moment=require(_0xc864('0x5'));var BPromise=require(_0xc864('0x6'));var Mustache=require(_0xc864('0x7'));var util=require(_0xc864('0x8'));var path=require(_0xc864('0x9'));var sox=require(_0xc864('0xa'));var csv=require(_0xc864('0xb'));var ejs=require(_0xc864('0xc'));var fs=require('fs');var fs_extra=require(_0xc864('0xd'));var _=require(_0xc864('0xe'));var squel=require(_0xc864('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc864('0x10'));var toCsv=require(_0xc864('0xb'));var querystring=require(_0xc864('0x11'));var Papa=require(_0xc864('0x12'));var Redis=require(_0xc864('0x13'));var authService=require(_0xc864('0x14'));var qs=require(_0xc864('0x15'));var as=require(_0xc864('0x16'));var hardwareService=require(_0xc864('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xc864('0x18'));var config=require(_0xc864('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc864('0x1a'))['db'];function respondWithStatusCode(_0x2162c0,_0x2fb827){_0x2fb827=_0x2fb827||0xcc;return function(_0x7eaba9){if(_0x7eaba9){return _0x2162c0['sendStatus'](_0x2fb827);}return _0x2162c0['status'](_0x2fb827)[_0xc864('0x1b')]();};}function respondWithResult(_0xb40a17,_0x43467f){_0x43467f=_0x43467f||0xc8;return function(_0x190b65){if(_0x190b65){return _0xb40a17[_0xc864('0x1c')](_0x43467f)['json'](_0x190b65);}};}function respondWithFilteredResult(_0x55b4f7,_0x5ab6a6){return function(_0x2bc1de){if(_0x2bc1de){var _0x40803c=typeof _0x5ab6a6['offset']===_0xc864('0x1d')&&typeof _0x5ab6a6[_0xc864('0x1e')]===_0xc864('0x1d');var _0x522a10=_0x2bc1de[_0xc864('0x1f')];var _0x1c0e25=_0x40803c?0x0:_0x5ab6a6[_0xc864('0x20')];var _0x5c77bb=_0x40803c?_0x2bc1de[_0xc864('0x1f')]:_0x5ab6a6['offset']+_0x5ab6a6[_0xc864('0x1e')];var _0x5136ac;if(_0x5c77bb>=_0x522a10){_0x5c77bb=_0x522a10;_0x5136ac=0xc8;}else{_0x5136ac=0xce;}_0x55b4f7['status'](_0x5136ac);return _0x55b4f7[_0xc864('0x21')](_0xc864('0x22'),_0x1c0e25+'-'+_0x5c77bb+'/'+_0x522a10)[_0xc864('0x23')](_0x2bc1de);}return null;};}function patchUpdates(_0x1b7f59){return function(_0x2c1a74){try{jsonpatch[_0xc864('0x24')](_0x2c1a74,_0x1b7f59,!![]);}catch(_0x124f1b){return BPromise[_0xc864('0x25')](_0x124f1b);}return _0x2c1a74['save']();};}function saveUpdates(_0x1ea644,_0x33851f){return function(_0x1dfc78){if(_0x1dfc78){return _0x1dfc78[_0xc864('0x26')](_0x1ea644)['then'](function(_0x1ff416){return _0x1ff416;});}return null;};}function removeEntity(_0x3f45c8,_0x548946){return function(_0xf0588c){if(_0xf0588c){return _0xf0588c[_0xc864('0x27')]()['then'](function(){var _0x1bc193=_0xf0588c[_0xc864('0x28')]({'plain':!![]});var _0x675948='Scheduler';return db[_0xc864('0x29')]['destroy']({'where':{'type':_0x675948,'resourceId':_0x1bc193['id']}})['then'](function(){return _0xf0588c;});})[_0xc864('0x2a')](function(){_0x3f45c8['status'](0xcc)[_0xc864('0x1b')]();});}};}function handleEntityNotFound(_0x3b9129,_0x248c83){return function(_0x1258a5){if(!_0x1258a5){_0x3b9129['sendStatus'](0x194);}return _0x1258a5;};}function handleError(_0x193e54,_0x1ab3dc){_0x1ab3dc=_0x1ab3dc||0x1f4;return function(_0x23d111){logger[_0xc864('0x2b')](_0x23d111[_0xc864('0x2c')]);if(_0x23d111[_0xc864('0x2d')]){delete _0x23d111[_0xc864('0x2d')];}_0x193e54[_0xc864('0x1c')](_0x1ab3dc)[_0xc864('0x2e')](_0x23d111);};}exports['index']=function(_0x2a7b9f,_0x2e0784){var _0x587920={},_0x21e903={},_0x19de6f={'count':0x0,'rows':[]};var _0x3b312e=_[_0xc864('0x2f')](db[_0xc864('0x30')][_0xc864('0x31')],function(_0x3feffc){return{'name':_0x3feffc[_0xc864('0x32')],'type':_0x3feffc[_0xc864('0x33')][_0xc864('0x34')]};});_0x21e903[_0xc864('0x35')]=_[_0xc864('0x2f')](_0x3b312e,_0xc864('0x2d'));_0x21e903[_0xc864('0x36')]=_['keys'](_0x2a7b9f[_0xc864('0x36')]);_0x21e903[_0xc864('0x37')]=_['intersection'](_0x21e903[_0xc864('0x35')],_0x21e903[_0xc864('0x36')]);_0x587920[_0xc864('0x38')]=_[_0xc864('0x39')](_0x21e903[_0xc864('0x35')],qs[_0xc864('0x3a')](_0x2a7b9f['query']['fields']));_0x587920[_0xc864('0x38')]=_0x587920[_0xc864('0x38')][_0xc864('0x3b')]?_0x587920[_0xc864('0x38')]:_0x21e903[_0xc864('0x35')];if(!_0x2a7b9f[_0xc864('0x36')][_0xc864('0x3c')](_0xc864('0x3d'))){_0x587920[_0xc864('0x1e')]=qs[_0xc864('0x1e')](_0x2a7b9f[_0xc864('0x36')]['limit']);_0x587920[_0xc864('0x20')]=qs[_0xc864('0x20')](_0x2a7b9f['query'][_0xc864('0x20')]);}_0x587920[_0xc864('0x3e')]=qs['sort'](_0x2a7b9f['query']['sort']);_0x587920[_0xc864('0x3f')]=qs['filters'](_[_0xc864('0x40')](_0x2a7b9f['query'],_0x21e903[_0xc864('0x37')]),_0x3b312e);if(_0x2a7b9f[_0xc864('0x36')][_0xc864('0x41')]){_0x587920[_0xc864('0x3f')]=_[_0xc864('0x42')](_0x587920[_0xc864('0x3f')],{'$or':_['map'](_0x3b312e,function(_0x3af30a){if(_0x3af30a[_0xc864('0x33')]!=='VIRTUAL'){var _0x3dd55b={};_0x3dd55b[_0x3af30a['name']]={'$like':'%'+_0x2a7b9f[_0xc864('0x36')][_0xc864('0x41')]+'%'};return _0x3dd55b;}})});}_0x587920=_[_0xc864('0x42')]({},_0x587920,_0x2a7b9f[_0xc864('0x43')]);var _0x4f7bb2={'where':_0x587920['where']};return db['Schedule'][_0xc864('0x1f')](_0x4f7bb2)[_0xc864('0x2a')](function(_0x4dd29b){_0x19de6f[_0xc864('0x1f')]=_0x4dd29b;if(_0x2a7b9f[_0xc864('0x36')][_0xc864('0x44')]){_0x587920[_0xc864('0x45')]=[{'all':!![]}];}return db['Schedule'][_0xc864('0x46')](_0x587920);})[_0xc864('0x2a')](function(_0x12b2ea){_0x19de6f[_0xc864('0x47')]=_0x12b2ea;return _0x19de6f;})[_0xc864('0x2a')](respondWithFilteredResult(_0x2e0784,_0x587920))['catch'](handleError(_0x2e0784,null));};exports[_0xc864('0x48')]=function(_0x8ccff9,_0x107a09){var _0x3c6358={'raw':![],'where':{'id':_0x8ccff9[_0xc864('0x49')]['id']}},_0x47b4dd={};_0x47b4dd[_0xc864('0x35')]=_[_0xc864('0x4a')](db['Schedule']['rawAttributes']);_0x47b4dd[_0xc864('0x36')]=_[_0xc864('0x4a')](_0x8ccff9[_0xc864('0x36')]);_0x47b4dd[_0xc864('0x37')]=_[_0xc864('0x39')](_0x47b4dd[_0xc864('0x35')],_0x47b4dd[_0xc864('0x36')]);_0x3c6358[_0xc864('0x38')]=_[_0xc864('0x39')](_0x47b4dd[_0xc864('0x35')],qs[_0xc864('0x3a')](_0x8ccff9[_0xc864('0x36')][_0xc864('0x3a')]));_0x3c6358[_0xc864('0x38')]=_0x3c6358['attributes']['length']?_0x3c6358['attributes']:_0x47b4dd['model'];if(_0x8ccff9[_0xc864('0x36')]['includeAll']){_0x3c6358[_0xc864('0x45')]=[{'all':!![]}];}_0x3c6358=_[_0xc864('0x42')]({},_0x3c6358,_0x8ccff9[_0xc864('0x43')]);return db[_0xc864('0x30')]['find'](_0x3c6358)['then'](handleEntityNotFound(_0x107a09,null))[_0xc864('0x2a')](respondWithResult(_0x107a09,null))[_0xc864('0x4b')](handleError(_0x107a09,null));};exports[_0xc864('0x4c')]=function(_0x1b1ef1,_0x4be20a){return db['Schedule']['create'](_0x1b1ef1[_0xc864('0x4d')],{})[_0xc864('0x2a')](function(_0x360974){var _0x5d36ac=_0x1b1ef1['user']['get']({'plain':!![]});if(!_0x5d36ac)throw new Error(_0xc864('0x4e'));if(_0x5d36ac[_0xc864('0x4f')]===_0xc864('0x50')){var _0x492765=_0x360974[_0xc864('0x28')]({'plain':!![]});var _0x1191ab=_0xc864('0x51');return db[_0xc864('0x52')][_0xc864('0x53')]({'where':{'name':_0x1191ab,'userProfileId':_0x5d36ac['userProfileId']},'raw':!![]})['then'](function(_0x432676){if(_0x432676&&_0x432676[_0xc864('0x54')]===0x0){return db[_0xc864('0x29')]['create']({'name':_0x492765['name'],'resourceId':_0x492765['id'],'type':_0x432676[_0xc864('0x2d')],'sectionId':_0x432676['id']},{})[_0xc864('0x2a')](function(){return _0x360974;});}else{return _0x360974;}})[_0xc864('0x4b')](function(_0x44c56f){logger[_0xc864('0x2b')](_0xc864('0x55'),_0x44c56f);throw _0x44c56f;});}return _0x360974;})[_0xc864('0x2a')](respondWithResult(_0x4be20a,0xc9))[_0xc864('0x4b')](handleError(_0x4be20a,null));};exports[_0xc864('0x26')]=function(_0x864688,_0x1ff35c){if(_0x864688[_0xc864('0x4d')]['id']){delete _0x864688[_0xc864('0x4d')]['id'];}return db[_0xc864('0x30')][_0xc864('0x53')]({'where':{'id':_0x864688[_0xc864('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ff35c,null))[_0xc864('0x2a')](saveUpdates(_0x864688[_0xc864('0x4d')],null))['then'](respondWithResult(_0x1ff35c,null))[_0xc864('0x4b')](handleError(_0x1ff35c,null));};exports[_0xc864('0x27')]=function(_0x2a4f59,_0x1ebd9e){return db[_0xc864('0x30')][_0xc864('0x53')]({'where':{'id':_0x2a4f59[_0xc864('0x49')]['id']}})[_0xc864('0x2a')](handleEntityNotFound(_0x1ebd9e,null))[_0xc864('0x2a')](removeEntity(_0x1ebd9e,null))[_0xc864('0x4b')](handleError(_0x1ebd9e,null));};exports[_0xc864('0x56')]=function(_0x22a50d,_0x5b5626,_0x30d21d){var _0x24a1fb=require(_0xc864('0x57'));return db[_0xc864('0x30')][_0xc864('0x53')]({'where':{'id':_0x22a50d[_0xc864('0x49')]['id']},'raw':!![]})[_0xc864('0x2a')](handleEntityNotFound(_0x5b5626,null))[_0xc864('0x2a')](function(){_0x24a1fb[_0xc864('0x56')](_0x22a50d[_0xc864('0x49')]['id']);})[_0xc864('0x2a')](respondWithStatusCode(_0x5b5626,null))[_0xc864('0x4b')](handleError(_0x5b5626,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 87849ca..55339d0 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 _0x477f=['define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x477f,0x7c));var _0xf477=function(_0x599d49,_0x10cbac){_0x599d49=_0x599d49-0x0;var _0x4c101d=_0x477f[_0x599d49];return _0x4c101d;};'use strict';var _=require('lodash');var util=require(_0xf477('0x0'));var logger=require(_0xf477('0x1'))(_0xf477('0x2'));var moment=require(_0xf477('0x3'));var BPromise=require(_0xf477('0x4'));var rp=require(_0xf477('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf477('0x6'));var attributes=require('./schedule.attributes');module[_0xf477('0x7')]=function(_0x350f0b,_0x414dcd){return _0x350f0b[_0xf477('0x8')](_0xf477('0x9'),attributes,{'tableName':_0xf477('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2b2=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','tools_schedules','lodash','../../config/logger','moment','bluebird'];(function(_0x50e265,_0x31cf38){var _0x465539=function(_0x3ba2db){while(--_0x3ba2db){_0x50e265['push'](_0x50e265['shift']());}};_0x465539(++_0x31cf38);}(_0xd2b2,0x75));var _0x2d2b=function(_0x5528ce,_0x2a8c7b){_0x5528ce=_0x5528ce-0x0;var _0x30846b=_0xd2b2[_0x5528ce];return _0x30846b;};'use strict';var _=require(_0x2d2b('0x0'));var util=require('util');var logger=require(_0x2d2b('0x1'))('api');var moment=require(_0x2d2b('0x2'));var BPromise=require(_0x2d2b('0x3'));var rp=require(_0x2d2b('0x4'));var fs=require('fs');var path=require(_0x2d2b('0x5'));var rimraf=require(_0x2d2b('0x6'));var config=require(_0x2d2b('0x7'));var attributes=require(_0x2d2b('0x8'));module[_0x2d2b('0x9')]=function(_0x504a53,_0x2c48b9){return _0x504a53['define']('Schedule',attributes,{'tableName':_0x2d2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 598c657..fcc86cf 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 _0x47e0=['request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x47e0,0x127));var _0x047e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47e0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x047e('0x0'));var util=require('util');var moment=require(_0x047e('0x1'));var BPromise=require(_0x047e('0x2'));var rs=require(_0x047e('0x3'));var fs=require('fs');var Redis=require(_0x047e('0x4'));var db=require(_0x047e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x047e('0x6'))(_0x047e('0x7'));var config=require(_0x047e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x047e('0x9')][_0x047e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213c7f,_0x527092,_0x35ed8c){return new BPromise(function(_0xd2cc08,_0x55af5f){return client['request'](_0x213c7f,_0x35ed8c)[_0x047e('0xb')](function(_0x377434){logger[_0x047e('0xc')]('Schedule,\x20%s,\x20%s',_0x527092,_0x047e('0xd'));logger[_0x047e('0xe')](_0x047e('0xf'),_0x527092,_0x047e('0xd'),JSON[_0x047e('0x10')](_0x377434));if(_0x377434[_0x047e('0x11')]){if(_0x377434['error'][_0x047e('0x12')]===0x1f4){logger[_0x047e('0x11')](_0x047e('0x13'),_0x527092,_0x377434['error'][_0x047e('0x14')]);return _0x55af5f(_0x377434[_0x047e('0x11')][_0x047e('0x14')]);}logger['error'](_0x047e('0x13'),_0x527092,_0x377434['error']['message']);return _0xd2cc08(_0x377434[_0x047e('0x11')][_0x047e('0x14')]);}else{logger[_0x047e('0xc')](_0x047e('0x13'),_0x527092,'request\x20sent');_0xd2cc08(_0x377434[_0x047e('0x15')][_0x047e('0x14')]);}})['catch'](function(_0x2e623a){logger[_0x047e('0x11')]('Schedule,\x20%s,\x20%s',_0x527092,_0x2e623a);_0x55af5f(_0x2e623a);});});} \ No newline at end of file +var _0x8eb6=['rpc','../../config/environment','client','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e6140,_0x86e733){var _0x5cf486=function(_0x340cb4){while(--_0x340cb4){_0x4e6140['push'](_0x4e6140['shift']());}};_0x5cf486(++_0x86e733);}(_0x8eb6,0xd4));var _0x68eb=function(_0x5a910d,_0x20724a){_0x5a910d=_0x5a910d-0x0;var _0x52d93f=_0x8eb6[_0x5a910d];return _0x52d93f;};'use strict';var _=require(_0x68eb('0x0'));var util=require(_0x68eb('0x1'));var moment=require(_0x68eb('0x2'));var BPromise=require(_0x68eb('0x3'));var rs=require(_0x68eb('0x4'));var fs=require('fs');var Redis=require(_0x68eb('0x5'));var db=require(_0x68eb('0x6'))['db'];var utils=require(_0x68eb('0x7'));var logger=require('../../config/logger')(_0x68eb('0x8'));var config=require(_0x68eb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x68eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b141,_0x27091f,_0x594a09){return new BPromise(function(_0x3264ef,_0x328b4e){return client['request'](_0x50b141,_0x594a09)[_0x68eb('0xb')](function(_0x53cf3e){logger['info'](_0x68eb('0xc'),_0x27091f,_0x68eb('0xd'));logger['debug'](_0x68eb('0xe'),_0x27091f,_0x68eb('0xd'),JSON[_0x68eb('0xf')](_0x53cf3e));if(_0x53cf3e[_0x68eb('0x10')]){if(_0x53cf3e['error'][_0x68eb('0x11')]===0x1f4){logger[_0x68eb('0x10')](_0x68eb('0xc'),_0x27091f,_0x53cf3e[_0x68eb('0x10')][_0x68eb('0x12')]);return _0x328b4e(_0x53cf3e[_0x68eb('0x10')]['message']);}logger[_0x68eb('0x10')](_0x68eb('0xc'),_0x27091f,_0x53cf3e[_0x68eb('0x10')][_0x68eb('0x12')]);return _0x3264ef(_0x53cf3e['error'][_0x68eb('0x12')]);}else{logger['info'](_0x68eb('0xc'),_0x27091f,_0x68eb('0xd'));_0x3264ef(_0x53cf3e[_0x68eb('0x13')][_0x68eb('0x12')]);}})['catch'](function(_0x554b5d){logger[_0x68eb('0x10')](_0x68eb('0xc'),_0x27091f,_0x554b5d);_0x328b4e(_0x554b5d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f6ab9b2..eb84053 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 _0x7d15=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d15,0x127));var _0x57d1=function(_0x4f0100,_0x2af42d){_0x4f0100=_0x4f0100-0x0;var _0xf3dc4d=_0x7d15[_0x4f0100];return _0xf3dc4d;};'use strict';var multer=require(_0x57d1('0x0'));var util=require(_0x57d1('0x1'));var path=require(_0x57d1('0x2'));var timeout=require(_0x57d1('0x3'));var express=require(_0x57d1('0x4'));var router=express[_0x57d1('0x5')]();var fs_extra=require(_0x57d1('0x6'));var auth=require(_0x57d1('0x7'));var interaction=require(_0x57d1('0x8'));var config=require(_0x57d1('0x9'));var controller=require(_0x57d1('0xa'));router['get']('/',auth[_0x57d1('0xb')](),controller[_0x57d1('0xc')]);router[_0x57d1('0xd')](_0x57d1('0xe'),auth[_0x57d1('0xb')](),controller[_0x57d1('0xf')]);router[_0x57d1('0xd')](_0x57d1('0x10'),auth[_0x57d1('0xb')](),controller[_0x57d1('0x11')]);router[_0x57d1('0xd')](_0x57d1('0x12'),auth[_0x57d1('0xb')](),controller[_0x57d1('0x13')]);router[_0x57d1('0x14')]('/',auth[_0x57d1('0xb')](),controller[_0x57d1('0x15')]);router['put'](_0x57d1('0x10'),auth[_0x57d1('0xb')](),controller[_0x57d1('0x16')]);router[_0x57d1('0x17')](_0x57d1('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x57d1('0x18')]=router; \ No newline at end of file +var _0x1475=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','create','put','delete'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1475,0x144));var _0x5147=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x1475[_0x4a5f6c];return _0x281ffd;};'use strict';var multer=require(_0x5147('0x0'));var util=require(_0x5147('0x1'));var path=require(_0x5147('0x2'));var timeout=require(_0x5147('0x3'));var express=require('express');var router=express[_0x5147('0x4')]();var fs_extra=require(_0x5147('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5147('0x6'));var controller=require(_0x5147('0x7'));router[_0x5147('0x8')]('/',auth[_0x5147('0x9')](),controller[_0x5147('0xa')]);router[_0x5147('0x8')](_0x5147('0xb'),auth[_0x5147('0x9')](),controller[_0x5147('0xc')]);router[_0x5147('0x8')](_0x5147('0xd'),auth[_0x5147('0x9')](),controller['show']);router[_0x5147('0x8')](_0x5147('0xe'),auth[_0x5147('0x9')](),controller['download']);router['post']('/',auth[_0x5147('0x9')](),controller[_0x5147('0xf')]);router[_0x5147('0x10')](_0x5147('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5147('0x11')](_0x5147('0xd'),auth['isAuthenticated'](),controller[_0x5147('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 98bccdc..fef44e8 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 _0x6337=['getDataValue','value','extname','STRING','setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','closedAt','createdAt','toString','updatedAt','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x1f3193,_0x49bd3e){var _0x2db246=function(_0x2015c2){while(--_0x2015c2){_0x1f3193['push'](_0x1f3193['shift']());}};_0x2db246(++_0x49bd3e);}(_0x6337,0x18a));var _0x7633=function(_0x46042a,_0x15fddc){_0x46042a=_0x46042a-0x0;var _0x3e1718=_0x6337[_0x46042a];return _0x3e1718;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7633('0x0'));var path=require(_0x7633('0x1'));var config=require(_0x7633('0x2'));module[_0x7633('0x3')]={'format':{'type':Sequelize[_0x7633('0x4')],'get':function(){return this[_0x7633('0x5')](_0x7633('0x6'))?path[_0x7633('0x7')](this[_0x7633('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x7633('0x8')]},'channel':{'type':Sequelize[_0x7633('0x8')]},'value':{'type':Sequelize[_0x7633('0x8')],'set':function(_0x539d69){var _0x1fee41=_0x539d69['replace'](/\\/g,'/');this[_0x7633('0x9')](_0x7633('0x6'),_0x1fee41);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7633('0xa')],'set':function(_0x547874){this[_0x7633('0x9')]('startedAt',moment()[_0x7633('0xb')](_0x547874,'ms'));this[_0x7633('0x9')]('closedAt',moment());this[_0x7633('0x9')](_0x7633('0xc'),_0x547874);}},'startedAt':{'type':Sequelize[_0x7633('0xd')],'get':function(){return moment(this['getDataValue'](_0x7633('0xe')))[_0x7633('0xf')](_0x7633('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x7633('0xd')],'get':function(){return moment(this[_0x7633('0x5')](_0x7633('0x11')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x7633('0xd')],'get':function(){return moment(this[_0x7633('0x5')](_0x7633('0x12')))[_0x7633('0xf')](_0x7633('0x10'))[_0x7633('0x13')]();}},'updatedAt':{'type':Sequelize[_0x7633('0xd')],'get':function(){return moment(this[_0x7633('0x5')](_0x7633('0x14')))['format'](_0x7633('0x10'))[_0x7633('0x13')]();}}}; \ No newline at end of file +var _0x8ba6=['value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','toString','format','MM-DD-YYYY\x20HH:mm','DATE','sequelize','path','exports','VIRTUAL','getDataValue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8ba6,0x11b));var _0x68ba=function(_0x1a680d,_0x307224){_0x1a680d=_0x1a680d-0x0;var _0x30cf4e=_0x8ba6[_0x1a680d];return _0x30cf4e;};'use strict';var Sequelize=require(_0x68ba('0x0'));var moment=require('moment');var path=require(_0x68ba('0x1'));var config=require('../../config/environment');module[_0x68ba('0x2')]={'format':{'type':Sequelize[_0x68ba('0x3')],'get':function(){return this[_0x68ba('0x4')](_0x68ba('0x5'))?path['extname'](this['getDataValue'](_0x68ba('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x68ba('0x6')]},'channel':{'type':Sequelize[_0x68ba('0x6')]},'value':{'type':Sequelize[_0x68ba('0x6')],'set':function(_0x2ad848){var _0x1ba7fa=_0x2ad848[_0x68ba('0x7')](/\\/g,'/');this[_0x68ba('0x8')]('value',_0x1ba7fa);}},'rating':{'type':Sequelize[_0x68ba('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x68ba('0x9')],'set':function(_0x1ec922){this[_0x68ba('0x8')](_0x68ba('0xa'),moment()[_0x68ba('0xb')](_0x1ec922,'ms'));this[_0x68ba('0x8')](_0x68ba('0xc'),moment());this[_0x68ba('0x8')](_0x68ba('0xd'),_0x1ec922);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x68ba('0x4')](_0x68ba('0xa')))['format']('MM-DD-YYYY\x20HH:mm')[_0x68ba('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x68ba('0x4')](_0x68ba('0xc')))[_0x68ba('0xf')](_0x68ba('0x10'))[_0x68ba('0xe')]();}},'createdAt':{'type':Sequelize[_0x68ba('0x11')],'get':function(){return moment(this[_0x68ba('0x4')]('createdAt'))[_0x68ba('0xf')](_0x68ba('0x10'))[_0x68ba('0xe')]();}},'updatedAt':{'type':Sequelize[_0x68ba('0x11')],'get':function(){return moment(this[_0x68ba('0x4')]('updatedAt'))[_0x68ba('0xf')](_0x68ba('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index d14f6f7..e3d9018 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0xd0bb[_0x142ec2];return _0x45ef4e;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0x2d17=['apply','then','error','name','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','catch','show','find','create','body','update','duration','closedAt','value','params','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','filename','download','extname','unlink','Not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','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','end','json','undefined','offset','limit','set','Content-Range'];(function(_0x1b21da,_0xde741e){var _0x45cede=function(_0x4a1cbd){while(--_0x4a1cbd){_0x1b21da['push'](_0x1b21da['shift']());}};_0x45cede(++_0xde741e);}(_0x2d17,0x17e));var _0x72d1=function(_0xb879f5,_0x3bae30){_0xb879f5=_0xb879f5-0x0;var _0x532e38=_0x2d17[_0xb879f5];return _0x532e38;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['ScreenRecording'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_[_0x72d1('0x27')](_0x51242b,'name'),[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_[_0x72d1('0x2f')](_0x4c4c41['query']);_0x32588f[_0x72d1('0x30')]=_[_0x72d1('0x31')](_0x32588f['model'],_0x32588f[_0x72d1('0x2e')]);_0x20055f[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x32588f['model'],qs[_0x72d1('0x33')](_0x4c4c41['query'][_0x72d1('0x33')]));_0x20055f[_0x72d1('0x32')]=_0x20055f[_0x72d1('0x32')][_0x72d1('0x34')]?_0x20055f[_0x72d1('0x32')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x35')](_0x72d1('0x36'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41['query'][_0x72d1('0x1f')]);_0x20055f[_0x72d1('0x1e')]=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2e')]['offset']);}_0x20055f[_0x72d1('0x37')]=qs[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2e')]['sort']);_0x20055f[_0x72d1('0x39')]=qs[_0x72d1('0x30')](_[_0x72d1('0x3a')](_0x4c4c41['query'],_0x32588f[_0x72d1('0x30')]),_0x51242b);if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]){_0x20055f['where']=_[_0x72d1('0x3c')](_0x20055f[_0x72d1('0x39')],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x14cb3d){if(_0x14cb3d[_0x72d1('0x29')]!==_0x72d1('0x3d')){var _0xd7ec0f={};_0xd7ec0f[_0x14cb3d['name']]={'$like':'%'+_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]+'%'};return _0xd7ec0f;}})});}_0x20055f=_[_0x72d1('0x3c')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3e')]);var _0x20fb2f={'where':_0x20055f[_0x72d1('0x39')]};return db[_0x72d1('0x3f')][_0x72d1('0x40')](_0x20fb2f)['then'](function(_0x44d5b2){_0x2cc0c8[_0x72d1('0x40')]=_0x44d5b2;if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x41')]){_0x20055f[_0x72d1('0x42')]=[{'all':!![]}];}return db[_0x72d1('0x3f')][_0x72d1('0x43')](_0x20055f);})[_0x72d1('0x23')](function(_0x5620f0){_0x2cc0c8['rows']=_0x5620f0;return _0x2cc0c8;})[_0x72d1('0x23')](respondWithFilteredResult(_0x707cd0,_0x20055f))[_0x72d1('0x44')](handleError(_0x707cd0,null));};exports[_0x72d1('0x45')]=function(_0x21d361,_0x5a6bc4){var _0x3fe286={'raw':![],'where':{'id':_0x21d361['params']['id']}},_0x3e80e0={};_0x3e80e0[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3f')][_0x72d1('0x28')]);_0x3e80e0['query']=_[_0x72d1('0x2f')](_0x21d361['query']);_0x3e80e0['filters']=_['intersection'](_0x3e80e0[_0x72d1('0x2b')],_0x3e80e0['query']);_0x3fe286[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x3e80e0[_0x72d1('0x2b')],qs['fields'](_0x21d361['query'][_0x72d1('0x33')]));_0x3fe286['attributes']=_0x3fe286['attributes'][_0x72d1('0x34')]?_0x3fe286[_0x72d1('0x32')]:_0x3e80e0[_0x72d1('0x2b')];if(_0x21d361['query']['includeAll']){_0x3fe286['include']=[{'all':!![]}];}_0x3fe286=_['merge']({},_0x3fe286,_0x21d361[_0x72d1('0x3e')]);return db[_0x72d1('0x3f')][_0x72d1('0x46')](_0x3fe286)[_0x72d1('0x23')](handleEntityNotFound(_0x5a6bc4,null))[_0x72d1('0x23')](respondWithResult(_0x5a6bc4,null))[_0x72d1('0x44')](handleError(_0x5a6bc4,null));};exports[_0x72d1('0x47')]=function(_0x5924c,_0x1e2c11){return db['ScreenRecording'][_0x72d1('0x47')](_0x5924c[_0x72d1('0x48')],{})[_0x72d1('0x23')](respondWithResult(_0x1e2c11,0xc9))['catch'](handleError(_0x1e2c11,null));};exports[_0x72d1('0x49')]=function(_0x29c88f,_0x12ad75){if(_0x29c88f['body']['id']){delete _0x29c88f[_0x72d1('0x48')]['id'];}delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4a')];delete _0x29c88f[_0x72d1('0x48')]['createdAt'];delete _0x29c88f['body'][_0x72d1('0x4b')];delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4c')];return db['ScreenRecording'][_0x72d1('0x46')]({'where':{'id':_0x29c88f[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x12ad75,null))[_0x72d1('0x23')](saveUpdates(_0x29c88f[_0x72d1('0x48')],null))[_0x72d1('0x23')](respondWithResult(_0x12ad75,null))[_0x72d1('0x44')](handleError(_0x12ad75,null));};exports[_0x72d1('0x4e')]=function(_0x12870c,_0x18f986){return db[_0x72d1('0x3f')]['describe']()[_0x72d1('0x23')](respondWithResult(_0x18f986,null))['catch'](handleError(_0x18f986,null));};exports['download']=function(_0x356196,_0x5f2bba,_0x3c880e){var _0x7e401b=require(_0x72d1('0x4f'));var _0x162248=![];var _0x473a7b={};if(_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]&&_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]===_0x72d1('0x50')){_0x473a7b[_0x72d1('0x50')]=_0x356196['params']['id'];}else{_0x473a7b['id']=_0x356196[_0x72d1('0x4d')]['id'];}return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':_0x473a7b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5f2bba,null))[_0x72d1('0x23')](function(_0x140f0b){if(_0x140f0b){var _0x16e9e7=path[_0x72d1('0x51')](config[_0x72d1('0x52')],'server/files/screen_recordings',_0x140f0b[_0x72d1('0x4c')]);var _0x48f4a7=util[_0x72d1('0x2d')](_0x72d1('0x53'),_0x16e9e7);if(fs[_0x72d1('0x54')](_0x48f4a7)){_0x162248=!![];return _0x7e401b[_0x72d1('0x55')](_0x48f4a7,_0x16e9e7,config[_0x72d1('0x56')][_0x72d1('0x57')])[_0x72d1('0x23')](function(){return _0x140f0b;});}return _0x140f0b;}})[_0x72d1('0x23')](function(_0x384f0a){if(_0x384f0a){var _0x3a2dfe=path[_0x72d1('0x51')](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x384f0a[_0x72d1('0x4c')]);if(!fs[_0x72d1('0x54')](_0x3a2dfe)){throw new db[(_0x72d1('0x59'))][(_0x72d1('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x384f0a[_0x72d1('0x5b')]){return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,_0x384f0a[_0x72d1('0x5b')]+path[_0x72d1('0x5d')](_0x3a2dfe),function(){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}else{return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,function(_0x4e2d85){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}}})[_0x72d1('0x44')](function(_0xb05cd9){if(_0xb05cd9['message']==='ScreenRecording\x20not\x20found'){_0x5f2bba[_0x72d1('0x1a')](0x194)['send'](_0x72d1('0x5f'));}else{return handleError(_0x5f2bba,null);}});};exports[_0x72d1('0x60')]=function(_0x201810,_0x41525c){return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':{'id':_0x201810[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](function(_0x28e42b){if(_['isNil'](_0x28e42b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x28e42b;})[_0x72d1('0x23')](function(_0x1d44f0){var _0x1bd80b=path['join'](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x1d44f0['value']);logger[_0x72d1('0x61')](_0x72d1('0x62'),_0x1bd80b);if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs[_0x72d1('0x54')](_0x1bd80b)){logger[_0x72d1('0x61')](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}_0x1bd80b=_0x1bd80b+_0x72d1('0x67');if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs['existsSync'](_0x1bd80b)){logger['info'](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}return _0x1d44f0;})[_0x72d1('0x23')](function(_0x2ae8c9){if(!_0x2ae8c9)throw new InternalError();return _0x2ae8c9[_0x72d1('0x60')]();})[_0x72d1('0x23')](function(){_0x41525c[_0x72d1('0x1a')](0xcc)['end']();})[_0x72d1('0x44')](handleError(_0x41525c,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 1014379..7e2cd54 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 _0x8d12=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','util','moment','bluebird','request-promise','path'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8d12,0x163));var _0x28d1=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x8d12[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require(_0x28d1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x28d1('0x1'));var BPromise=require(_0x28d1('0x2'));var rp=require(_0x28d1('0x3'));var fs=require('fs');var path=require(_0x28d1('0x4'));var rimraf=require(_0x28d1('0x5'));var config=require(_0x28d1('0x6'));var attributes=require(_0x28d1('0x7'));module[_0x28d1('0x8')]=function(_0x3078fc,_0xedf447){return _0x3078fc[_0x28d1('0x9')](_0x28d1('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x28d1('0xb'),'fields':[_0x28d1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd08f=['../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd08f,0x13f));var _0xfd08=function(_0x407b07,_0x525c69){_0x407b07=_0x407b07-0x0;var _0x2c9b12=_0xd08f[_0x407b07];return _0x2c9b12;};'use strict';var _=require(_0xfd08('0x0'));var util=require('util');var logger=require(_0xfd08('0x1'))('api');var moment=require(_0xfd08('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd08('0x3'));var fs=require('fs');var path=require(_0xfd08('0x4'));var rimraf=require(_0xfd08('0x5'));var config=require(_0xfd08('0x6'));var attributes=require(_0xfd08('0x7'));module[_0xfd08('0x8')]=function(_0x4c181e,_0x3fe415){return _0x4c181e[_0xfd08('0x9')](_0xfd08('0xa'),attributes,{'tableName':_0xfd08('0xb'),'paranoid':![],'indexes':[{'name':_0xfd08('0xc'),'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 83e1ce1..f6a59b5 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 _0x0da4=['../../config/logger','../../config/environment','jayson/promise','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x0da4,0xb8));var _0x40da=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0x0da4[_0x438685];return _0x41cca2;};'use strict';var _=require(_0x40da('0x0'));var util=require(_0x40da('0x1'));var moment=require(_0x40da('0x2'));var BPromise=require('bluebird');var rs=require(_0x40da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x40da('0x5'))('rpc');var config=require(_0x40da('0x6'));var jayson=require(_0x40da('0x7'));var client=jayson['client'][_0x40da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d5c69,_0x4afd32,_0x79be07){return new BPromise(function(_0xf9d8fe,_0x2434e2){return client[_0x40da('0x9')](_0x2d5c69,_0x79be07)['then'](function(_0x5cc27b){logger[_0x40da('0xa')](_0x40da('0xb'),_0x4afd32,_0x40da('0xc'));logger[_0x40da('0xd')](_0x40da('0xe'),_0x4afd32,'request\x20sent',JSON[_0x40da('0xf')](_0x5cc27b));if(_0x5cc27b[_0x40da('0x10')]){if(_0x5cc27b[_0x40da('0x10')][_0x40da('0x11')]===0x1f4){logger[_0x40da('0x10')](_0x40da('0xb'),_0x4afd32,_0x5cc27b[_0x40da('0x10')][_0x40da('0x12')]);return _0x2434e2(_0x5cc27b[_0x40da('0x10')][_0x40da('0x12')]);}logger[_0x40da('0x10')](_0x40da('0xb'),_0x4afd32,_0x5cc27b[_0x40da('0x10')][_0x40da('0x12')]);return _0xf9d8fe(_0x5cc27b[_0x40da('0x10')][_0x40da('0x12')]);}else{logger[_0x40da('0xa')](_0x40da('0xb'),_0x4afd32,_0x40da('0xc'));_0xf9d8fe(_0x5cc27b[_0x40da('0x13')][_0x40da('0x12')]);}})[_0x40da('0x14')](function(_0x5a57e0){logger[_0x40da('0x10')](_0x40da('0xb'),_0x4afd32,_0x5a57e0);_0x2434e2(_0x5a57e0);});});} \ No newline at end of file +var _0x56b1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x152ca2,_0x131292){var _0x56f3d3=function(_0x19bd84){while(--_0x19bd84){_0x152ca2['push'](_0x152ca2['shift']());}};_0x56f3d3(++_0x131292);}(_0x56b1,0x19e));var _0x156b=function(_0x5446d0,_0x293284){_0x5446d0=_0x5446d0-0x0;var _0x29d3c3=_0x56b1[_0x5446d0];return _0x29d3c3;};'use strict';var _=require('lodash');var util=require(_0x156b('0x0'));var moment=require('moment');var BPromise=require(_0x156b('0x1'));var rs=require(_0x156b('0x2'));var fs=require('fs');var Redis=require(_0x156b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x156b('0x4'))(_0x156b('0x5'));var config=require(_0x156b('0x6'));var jayson=require(_0x156b('0x7'));var client=jayson[_0x156b('0x8')][_0x156b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58442c,_0x1f6f06,_0x357de2){return new BPromise(function(_0x41df93,_0x25cee9){return client['request'](_0x58442c,_0x357de2)[_0x156b('0xa')](function(_0x41915f){logger[_0x156b('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x1f6f06,_0x156b('0xc'));logger[_0x156b('0xd')](_0x156b('0xe'),_0x1f6f06,_0x156b('0xc'),JSON[_0x156b('0xf')](_0x41915f));if(_0x41915f[_0x156b('0x10')]){if(_0x41915f[_0x156b('0x10')][_0x156b('0x11')]===0x1f4){logger['error'](_0x156b('0x12'),_0x1f6f06,_0x41915f['error'][_0x156b('0x13')]);return _0x25cee9(_0x41915f[_0x156b('0x10')][_0x156b('0x13')]);}logger[_0x156b('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x1f6f06,_0x41915f[_0x156b('0x10')]['message']);return _0x41df93(_0x41915f[_0x156b('0x10')][_0x156b('0x13')]);}else{logger[_0x156b('0xb')](_0x156b('0x12'),_0x1f6f06,_0x156b('0xc'));_0x41df93(_0x41915f[_0x156b('0x14')][_0x156b('0x13')]);}})[_0x156b('0x15')](function(_0x2c213a){logger[_0x156b('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x1f6f06,_0x2c213a);_0x25cee9(_0x2c213a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 76d962b..c84ad27 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 _0xd999=['getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','server/files/images/logos/','format','%s%s','extname','originalname','post','single','addLogo','join','root','logologin','file','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','getDate','/:id','show','/:id/logo','/:id/logo_login'];(function(_0x1aece3,_0x4ce790){var _0x36254e=function(_0x9c8723){while(--_0x9c8723){_0x1aece3['push'](_0x1aece3['shift']());}};_0x36254e(++_0x4ce790);}(_0xd999,0x14f));var _0x9d99=function(_0x13a4bf,_0x56cb27){_0x13a4bf=_0x13a4bf-0x0;var _0x2933d6=_0xd999[_0x13a4bf];return _0x2933d6;};'use strict';var multer=require(_0x9d99('0x0'));var util=require(_0x9d99('0x1'));var path=require(_0x9d99('0x2'));var timeout=require(_0x9d99('0x3'));var express=require(_0x9d99('0x4'));var router=express['Router']();var fs_extra=require(_0x9d99('0x5'));var auth=require(_0x9d99('0x6'));var interaction=require(_0x9d99('0x7'));var config=require(_0x9d99('0x8'));var controller=require(_0x9d99('0x9'));router[_0x9d99('0xa')]('/',auth['isAuthenticated'](),controller[_0x9d99('0xb')]);router['get']('/now',controller[_0x9d99('0xc')]);router[_0x9d99('0xa')](_0x9d99('0xd'),controller[_0x9d99('0xe')]);router['get'](_0x9d99('0xf'),controller['getLogo']);router['get'](_0x9d99('0x10'),controller[_0x9d99('0x11')]);router[_0x9d99('0xa')](_0x9d99('0x12'),controller[_0x9d99('0x13')]);router['get'](_0x9d99('0x14'),controller[_0x9d99('0x15')]);router[_0x9d99('0xa')]('/:id/favicon',controller[_0x9d99('0x16')]);var upload=multer({'storage':multer[_0x9d99('0x17')]({'destination':function(_0x46e696,_0x407cbf,_0x19bdad){_0x19bdad(null,path['join'](config['root'],_0x9d99('0x18')));},'filename':function(_0x32258f,_0x414ac6,_0x135ecd){_0x135ecd(null,util[_0x9d99('0x19')](_0x9d99('0x1a'),'logo',path[_0x9d99('0x1b')](_0x414ac6[_0x9d99('0x1c')])));}})});router[_0x9d99('0x1d')](_0x9d99('0xf'),upload[_0x9d99('0x1e')]('file'),controller[_0x9d99('0x1f')]);var upload=multer({'storage':multer[_0x9d99('0x17')]({'destination':function(_0x5682bb,_0x28ea13,_0x429a40){_0x429a40(null,path[_0x9d99('0x20')](config[_0x9d99('0x21')],_0x9d99('0x18')));},'filename':function(_0x14d84e,_0x1e3dbe,_0x5c3436){_0x5c3436(null,util['format'](_0x9d99('0x1a'),_0x9d99('0x22'),path['extname'](_0x1e3dbe[_0x9d99('0x1c')])));}})});router['post'](_0x9d99('0x10'),upload[_0x9d99('0x1e')](_0x9d99('0x23')),controller[_0x9d99('0x24')]);var upload=multer({'storage':multer[_0x9d99('0x17')]({'destination':function(_0x30989d,_0x595168,_0x35346f){_0x35346f(null,path['join'](config[_0x9d99('0x21')],_0x9d99('0x18')));},'filename':function(_0x348edf,_0x314bfb,_0x2bd9fc){_0x2bd9fc(null,util[_0x9d99('0x19')](_0x9d99('0x1a'),_0x9d99('0x25'),path[_0x9d99('0x1b')](_0x314bfb[_0x9d99('0x1c')])));}})});router[_0x9d99('0x1d')](_0x9d99('0x14'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x9d99('0x17')]({'destination':function(_0x44a06c,_0x14245c,_0x7f5601){_0x7f5601(null,path[_0x9d99('0x20')](config[_0x9d99('0x21')],'server/files/images/logos/'));},'filename':function(_0x2b04b7,_0x179434,_0x998c53){_0x998c53(null,util[_0x9d99('0x19')](_0x9d99('0x1a'),_0x9d99('0x26'),path[_0x9d99('0x1b')](_0x179434[_0x9d99('0x1c')])));}})});router[_0x9d99('0x1d')](_0x9d99('0x27'),upload[_0x9d99('0x1e')](_0x9d99('0x23')),controller[_0x9d99('0x28')]);router[_0x9d99('0x29')]('/:id',auth[_0x9d99('0x2a')](),controller['update']);module[_0x9d99('0x2b')]=router; \ No newline at end of file +var _0xaa2e=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','single','addLogo','server/files/images/logos/','logologin','post','file','addLogoLogin','preferred','addPreferred','/:id/favicon','addFavicon','put','update'];(function(_0x232091,_0x14fa1d){var _0x5d3cc3=function(_0x196989){while(--_0x196989){_0x232091['push'](_0x232091['shift']());}};_0x5d3cc3(++_0x14fa1d);}(_0xaa2e,0x103));var _0xeaa2=function(_0x1d76c3,_0x126248){_0x1d76c3=_0x1d76c3-0x0;var _0xc0226=_0xaa2e[_0x1d76c3];return _0xc0226;};'use strict';var multer=require(_0xeaa2('0x0'));var util=require(_0xeaa2('0x1'));var path=require(_0xeaa2('0x2'));var timeout=require(_0xeaa2('0x3'));var express=require('express');var router=express[_0xeaa2('0x4')]();var fs_extra=require(_0xeaa2('0x5'));var auth=require(_0xeaa2('0x6'));var interaction=require(_0xeaa2('0x7'));var config=require('../../config/environment');var controller=require(_0xeaa2('0x8'));router[_0xeaa2('0x9')]('/',auth[_0xeaa2('0xa')](),controller[_0xeaa2('0xb')]);router['get'](_0xeaa2('0xc'),controller['getDate']);router['get'](_0xeaa2('0xd'),controller['show']);router['get']('/:id/logo',controller[_0xeaa2('0xe')]);router[_0xeaa2('0x9')](_0xeaa2('0xf'),controller[_0xeaa2('0x10')]);router[_0xeaa2('0x9')](_0xeaa2('0x11'),controller[_0xeaa2('0x12')]);router[_0xeaa2('0x9')](_0xeaa2('0x13'),controller['getPreferred']);router[_0xeaa2('0x9')]('/:id/favicon',controller[_0xeaa2('0x14')]);var upload=multer({'storage':multer[_0xeaa2('0x15')]({'destination':function(_0x5d1e78,_0xd0d866,_0x5b06d7){_0x5b06d7(null,path[_0xeaa2('0x16')](config[_0xeaa2('0x17')],'server/files/images/logos/'));},'filename':function(_0x4c23f3,_0x103cd4,_0x2438d0){_0x2438d0(null,util[_0xeaa2('0x18')](_0xeaa2('0x19'),_0xeaa2('0x1a'),path[_0xeaa2('0x1b')](_0x103cd4[_0xeaa2('0x1c')])));}})});router['post']('/:id/logo',upload[_0xeaa2('0x1d')]('file'),controller[_0xeaa2('0x1e')]);var upload=multer({'storage':multer[_0xeaa2('0x15')]({'destination':function(_0x24f238,_0x266e80,_0x5ced3d){_0x5ced3d(null,path[_0xeaa2('0x16')](config[_0xeaa2('0x17')],_0xeaa2('0x1f')));},'filename':function(_0x16a331,_0x14e07b,_0x23a07c){_0x23a07c(null,util[_0xeaa2('0x18')](_0xeaa2('0x19'),_0xeaa2('0x20'),path[_0xeaa2('0x1b')](_0x14e07b['originalname'])));}})});router[_0xeaa2('0x21')]('/:id/logo_login',upload[_0xeaa2('0x1d')](_0xeaa2('0x22')),controller[_0xeaa2('0x23')]);var upload=multer({'storage':multer[_0xeaa2('0x15')]({'destination':function(_0x456174,_0x16c76a,_0x2ec097){_0x2ec097(null,path['join'](config[_0xeaa2('0x17')],_0xeaa2('0x1f')));},'filename':function(_0x3ed2a0,_0x18a92d,_0xb72718){_0xb72718(null,util[_0xeaa2('0x18')](_0xeaa2('0x19'),_0xeaa2('0x24'),path['extname'](_0x18a92d[_0xeaa2('0x1c')])));}})});router[_0xeaa2('0x21')](_0xeaa2('0x13'),upload[_0xeaa2('0x1d')](_0xeaa2('0x22')),controller[_0xeaa2('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9b1a1c,_0x2aa89c,_0x26f8cd){_0x26f8cd(null,path[_0xeaa2('0x16')](config[_0xeaa2('0x17')],'server/files/images/logos/'));},'filename':function(_0x3a4683,_0x1b31b5,_0x1366fa){_0x1366fa(null,util[_0xeaa2('0x18')]('%s%s','favicon',path[_0xeaa2('0x1b')](_0x1b31b5['originalname'])));}})});router[_0xeaa2('0x21')](_0xeaa2('0x26'),upload['single']('file'),controller[_0xeaa2('0x27')]);router[_0xeaa2('0x28')](_0xeaa2('0xd'),auth[_0xeaa2('0xa')](),controller[_0xeaa2('0x29')]);module[_0xeaa2('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 1174377..c0cd1cf 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 _0x34e8=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x4471ff,_0x4bb7de){var _0xe723ca=function(_0xf3cc76){while(--_0xf3cc76){_0x4471ff['push'](_0x4471ff['shift']());}};_0xe723ca(++_0x4bb7de);}(_0x34e8,0x12c));var _0x834e=function(_0x3b8a68,_0x45bfcd){_0x3b8a68=_0x3b8a68-0x0;var _0x4eedf9=_0x34e8[_0x3b8a68];return _0x4eedf9;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'min_internal':{'type':Sequelize[_0x834e('0x2')](0xb),'unique':_0x834e('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x834e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x6')},'logo':{'type':Sequelize[_0x834e('0x5')]},'defaultLogo':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x834e('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x834e('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x834e('0x5')]},'turnaddr':{'type':Sequelize[_0x834e('0x5')]},'turnusername':{'type':Sequelize[_0x834e('0x5')]},'turnpassword':{'type':Sequelize[_0x834e('0x5')]},'pageTitle':{'type':Sequelize[_0x834e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x8')},'enableEmailPreview':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x834e('0x5')]},'defaultPreferred':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x834e('0x5')]},'sentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x834e('0x5')]},'language':{'type':Sequelize[_0x834e('0x5')]},'bucket':{'type':Sequelize[_0x834e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x834e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x834e('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x34e8=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x166e71,_0x3a1cd4){var _0x2ebc75=function(_0x4889d9){while(--_0x4889d9){_0x166e71['push'](_0x166e71['shift']());}};_0x2ebc75(++_0x3a1cd4);}(_0x34e8,0x12c));var _0x834e=function(_0x4aaf76,_0x35d6b8){_0x4aaf76=_0x4aaf76-0x0;var _0x51e2c0=_0x34e8[_0x4aaf76];return _0x51e2c0;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'min_internal':{'type':Sequelize[_0x834e('0x2')](0xb),'unique':_0x834e('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x834e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x6')},'logo':{'type':Sequelize[_0x834e('0x5')]},'defaultLogo':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x834e('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x834e('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x834e('0x5')]},'turnaddr':{'type':Sequelize[_0x834e('0x5')]},'turnusername':{'type':Sequelize[_0x834e('0x5')]},'turnpassword':{'type':Sequelize[_0x834e('0x5')]},'pageTitle':{'type':Sequelize[_0x834e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x8')},'enableEmailPreview':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x834e('0x5')]},'defaultPreferred':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x834e('0x5')]},'sentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x834e('0x5')]},'language':{'type':Sequelize[_0x834e('0x5')]},'bucket':{'type':Sequelize[_0x834e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x834e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x834e('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index acefb9a..9083b5d 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 _0x9ff7=['default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultPreferred','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','Setting,\x20%s,\x20%s','message','result','end','status','json','offset','undefined','limit','count','set','apply','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','Setting','findAll','catch','show','params','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','logo','join','default_logo.svg'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9ff7,0x8c));var _0x79ff=function(_0x3cf81e,_0x5693bc){_0x3cf81e=_0x3cf81e-0x0;var _0x56133d=_0x9ff7[_0x3cf81e];return _0x56133d;};'use strict';var emlformat=require(_0x79ff('0x0'));var rimraf=require(_0x79ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79ff('0x2'));var rp=require('request-promise');var moment=require(_0x79ff('0x3'));var BPromise=require(_0x79ff('0x4'));var Mustache=require(_0x79ff('0x5'));var util=require(_0x79ff('0x6'));var path=require(_0x79ff('0x7'));var sox=require(_0x79ff('0x8'));var csv=require('to-csv');var ejs=require(_0x79ff('0x9'));var fs=require('fs');var fs_extra=require(_0x79ff('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x79ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x79ff('0xc'));var toCsv=require(_0x79ff('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x79ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x79ff('0xf'));var as=require(_0x79ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79ff('0x11'))('api');var utils=require(_0x79ff('0x12'));var config=require(_0x79ff('0x13'));var licenseUtil=require(_0x79ff('0x14'));var db=require(_0x79ff('0x15'))['db'];var jayson=require(_0x79ff('0x16'));var client=jayson[_0x79ff('0x17')][_0x79ff('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x32da4c,_0x26c878,_0x4d0963,_0x32704b){return new BPromise(function(_0x940839,_0x2894c5){var _0xfab01a=_0x32704b||client;return _0xfab01a[_0x79ff('0x19')](_0x32da4c,_0x4d0963)[_0x79ff('0x1a')](function(_0x3d13cd){logger[_0x79ff('0x1b')]('Setting,\x20%s,\x20%s',_0x26c878,_0x79ff('0x1c'));logger[_0x79ff('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x26c878,_0x79ff('0x1c'),JSON['stringify'](_0x3d13cd));if(_0x3d13cd[_0x79ff('0x1e')]){if(_0x3d13cd[_0x79ff('0x1e')]['code']===0x1f4){logger[_0x79ff('0x1e')](_0x79ff('0x1f'),_0x26c878,_0x3d13cd['error'][_0x79ff('0x20')]);return _0x2894c5(_0x3d13cd[_0x79ff('0x1e')][_0x79ff('0x20')]);}logger[_0x79ff('0x1e')]('Setting,\x20%s,\x20%s',_0x26c878,_0x3d13cd[_0x79ff('0x1e')][_0x79ff('0x20')]);return _0x940839(_0x3d13cd[_0x79ff('0x1e')][_0x79ff('0x20')]);}else{logger[_0x79ff('0x1b')](_0x79ff('0x1f'),_0x26c878,_0x79ff('0x1c'));_0x940839(_0x3d13cd[_0x79ff('0x21')]['message']);}})['catch'](function(_0xcfe9b9){logger['error']('Setting,\x20%s,\x20%s',_0x26c878,_0xcfe9b9);_0x2894c5(_0xcfe9b9);});});}function respondWithStatusCode(_0x2572d6,_0x3d6f88){_0x3d6f88=_0x3d6f88||0xcc;return function(_0x5c23af){if(_0x5c23af){return _0x2572d6['sendStatus'](_0x3d6f88);}return _0x2572d6['status'](_0x3d6f88)[_0x79ff('0x22')]();};}function respondWithResult(_0x49f018,_0x4f776e){_0x4f776e=_0x4f776e||0xc8;return function(_0x32c6dd){if(_0x32c6dd){return _0x49f018[_0x79ff('0x23')](_0x4f776e)[_0x79ff('0x24')](_0x32c6dd);}};}function respondWithFilteredResult(_0x6e5a41,_0x337434){return function(_0x39c1c5){if(_0x39c1c5){var _0x255587=typeof _0x337434[_0x79ff('0x25')]===_0x79ff('0x26')&&typeof _0x337434[_0x79ff('0x27')]===_0x79ff('0x26');var _0x1e919d=_0x39c1c5[_0x79ff('0x28')];var _0x15a0d2=_0x255587?0x0:_0x337434[_0x79ff('0x25')];var _0x3b9f7e=_0x255587?_0x39c1c5['count']:_0x337434[_0x79ff('0x25')]+_0x337434[_0x79ff('0x27')];var _0x5b54fc;if(_0x3b9f7e>=_0x1e919d){_0x3b9f7e=_0x1e919d;_0x5b54fc=0xc8;}else{_0x5b54fc=0xce;}_0x6e5a41[_0x79ff('0x23')](_0x5b54fc);return _0x6e5a41[_0x79ff('0x29')]('Content-Range',_0x15a0d2+'-'+_0x3b9f7e+'/'+_0x1e919d)['json'](_0x39c1c5);}return null;};}function patchUpdates(_0x448d90){return function(_0x1a26d1){try{jsonpatch[_0x79ff('0x2a')](_0x1a26d1,_0x448d90,!![]);}catch(_0x4738dc){return BPromise['reject'](_0x4738dc);}return _0x1a26d1[_0x79ff('0x2b')]();};}function saveUpdates(_0x235df5,_0x2d1e64){return function(_0x3e20eb){if(_0x3e20eb){return _0x3e20eb[_0x79ff('0x2c')](_0x235df5)['then'](function(_0x2e12de){return _0x2e12de;});}return null;};}function removeEntity(_0x41fa0c,_0x52367f){return function(_0x1218b5){if(_0x1218b5){return _0x1218b5['destroy']()[_0x79ff('0x1a')](function(){_0x41fa0c[_0x79ff('0x23')](0xcc)[_0x79ff('0x22')]();});}};}function handleEntityNotFound(_0x588ffc,_0x306372){return function(_0x4eabdf){if(!_0x4eabdf){_0x588ffc[_0x79ff('0x2d')](0x194);}return _0x4eabdf;};}function handleError(_0x5d4c4f,_0x3f3dd5){_0x3f3dd5=_0x3f3dd5||0x1f4;return function(_0x580abe){logger[_0x79ff('0x1e')](_0x580abe[_0x79ff('0x2e')]);if(_0x580abe[_0x79ff('0x2f')]){delete _0x580abe['name'];}_0x5d4c4f['status'](_0x3f3dd5)[_0x79ff('0x30')](_0x580abe);};}exports[_0x79ff('0x31')]=function(_0x28199b,_0x4f6b4c){var _0x6c3ea9={},_0x2cc089={},_0x115ce1={'count':0x0,'rows':[]};var _0x55e66c=_[_0x79ff('0x32')](db['Setting'][_0x79ff('0x33')],function(_0x1e4a42){return{'name':_0x1e4a42[_0x79ff('0x34')],'type':_0x1e4a42[_0x79ff('0x35')][_0x79ff('0x36')]};});_0x2cc089[_0x79ff('0x37')]=_[_0x79ff('0x32')](_0x55e66c,_0x79ff('0x2f'));_0x2cc089[_0x79ff('0x38')]=_[_0x79ff('0x39')](_0x28199b[_0x79ff('0x38')]);_0x2cc089['filters']=_[_0x79ff('0x3a')](_0x2cc089[_0x79ff('0x37')],_0x2cc089['query']);_0x6c3ea9[_0x79ff('0x3b')]=_[_0x79ff('0x3a')](_0x2cc089[_0x79ff('0x37')],qs[_0x79ff('0x3c')](_0x28199b[_0x79ff('0x38')][_0x79ff('0x3c')]));_0x6c3ea9[_0x79ff('0x3b')]=_0x6c3ea9['attributes'][_0x79ff('0x3d')]?_0x6c3ea9[_0x79ff('0x3b')]:_0x2cc089[_0x79ff('0x37')];if(!_0x28199b[_0x79ff('0x38')][_0x79ff('0x3e')](_0x79ff('0x3f'))){_0x6c3ea9[_0x79ff('0x27')]=qs[_0x79ff('0x27')](_0x28199b[_0x79ff('0x38')][_0x79ff('0x27')]);_0x6c3ea9['offset']=qs[_0x79ff('0x25')](_0x28199b[_0x79ff('0x38')]['offset']);}_0x6c3ea9[_0x79ff('0x40')]=qs[_0x79ff('0x41')](_0x28199b[_0x79ff('0x38')][_0x79ff('0x41')]);_0x6c3ea9[_0x79ff('0x42')]=qs[_0x79ff('0x43')](_['pick'](_0x28199b['query'],_0x2cc089['filters']),_0x55e66c);if(_0x28199b[_0x79ff('0x38')]['filter']){_0x6c3ea9[_0x79ff('0x42')]=_[_0x79ff('0x44')](_0x6c3ea9['where'],{'$or':_[_0x79ff('0x32')](_0x55e66c,function(_0x50cae1){if(_0x50cae1[_0x79ff('0x35')]!==_0x79ff('0x45')){var _0x1fddb0={};_0x1fddb0[_0x50cae1[_0x79ff('0x2f')]]={'$like':'%'+_0x28199b[_0x79ff('0x38')][_0x79ff('0x46')]+'%'};return _0x1fddb0;}})});}_0x6c3ea9=_[_0x79ff('0x44')]({},_0x6c3ea9,_0x28199b[_0x79ff('0x47')]);var _0x2bb048={'where':_0x6c3ea9['where']};return db['Setting']['count'](_0x2bb048)[_0x79ff('0x1a')](function(_0x57da51){_0x115ce1['count']=_0x57da51;if(_0x28199b['query'][_0x79ff('0x48')]){_0x6c3ea9[_0x79ff('0x49')]=[{'all':!![]}];}return db[_0x79ff('0x4a')][_0x79ff('0x4b')](_0x6c3ea9);})[_0x79ff('0x1a')](function(_0x4b2982){_0x115ce1['rows']=_0x4b2982;return _0x115ce1;})[_0x79ff('0x1a')](respondWithFilteredResult(_0x4f6b4c,_0x6c3ea9))[_0x79ff('0x4c')](handleError(_0x4f6b4c,null));};exports[_0x79ff('0x4d')]=function(_0x40a5f4,_0x3b8b8f){var _0x5c6523={'raw':![],'where':{'id':_0x40a5f4[_0x79ff('0x4e')]['id']}},_0x3a0605={};_0x3a0605[_0x79ff('0x37')]=_[_0x79ff('0x39')](db[_0x79ff('0x4a')][_0x79ff('0x33')]);_0x3a0605[_0x79ff('0x38')]=_[_0x79ff('0x39')](_0x40a5f4[_0x79ff('0x38')]);_0x3a0605[_0x79ff('0x43')]=_['intersection'](_0x3a0605[_0x79ff('0x37')],_0x3a0605[_0x79ff('0x38')]);_0x5c6523[_0x79ff('0x3b')]=_[_0x79ff('0x3a')](_0x3a0605[_0x79ff('0x37')],qs[_0x79ff('0x3c')](_0x40a5f4[_0x79ff('0x38')]['fields']));_0x5c6523['attributes']=_0x5c6523['attributes'][_0x79ff('0x3d')]?_0x5c6523[_0x79ff('0x3b')]:_0x3a0605[_0x79ff('0x37')];if(_0x40a5f4['query']['includeAll']){_0x5c6523['include']=[{'all':!![]}];}_0x5c6523=_[_0x79ff('0x44')]({},_0x5c6523,_0x40a5f4['options']);return db[_0x79ff('0x4a')][_0x79ff('0x4f')](_0x5c6523)[_0x79ff('0x1a')](handleEntityNotFound(_0x3b8b8f,null))[_0x79ff('0x1a')](respondWithResult(_0x3b8b8f,null))[_0x79ff('0x4c')](handleError(_0x3b8b8f,null));};exports[_0x79ff('0x2c')]=function(_0xc0443e,_0x23149b){if(_0xc0443e[_0x79ff('0x50')]['id']){delete _0xc0443e[_0x79ff('0x50')]['id'];}return db[_0x79ff('0x4a')][_0x79ff('0x4f')]({'where':{'id':_0xc0443e[_0x79ff('0x4e')]['id']}})[_0x79ff('0x1a')](handleEntityNotFound(_0x23149b,null))[_0x79ff('0x1a')](saveUpdates(_0xc0443e[_0x79ff('0x50')],null))[_0x79ff('0x1a')](respondWithResult(_0x23149b,null))['catch'](handleError(_0x23149b,null));};exports[_0x79ff('0x51')]=function(_0x16e640,_0x410681,_0x9d2e55){if(_0x16e640['file']&&_0x16e640[_0x79ff('0x52')][_0x79ff('0x53')]){_0x16e640['body']['logo']=_0x16e640['file'][_0x79ff('0x53')];}return db['Setting'][_0x79ff('0x4f')]({'where':{'id':_0x16e640['params']['id']}})['then'](handleEntityNotFound(_0x410681,null))[_0x79ff('0x1a')](saveUpdates(_0x16e640[_0x79ff('0x50')],null))['then'](respondWithResult(_0x410681,null))[_0x79ff('0x4c')](handleError(_0x410681,null));};exports[_0x79ff('0x54')]=function(_0x302fe7,_0x334a1,_0x295ab5){if(_0x302fe7[_0x79ff('0x52')]&&_0x302fe7[_0x79ff('0x52')][_0x79ff('0x53')]){_0x302fe7[_0x79ff('0x50')][_0x79ff('0x55')]=_0x302fe7[_0x79ff('0x52')][_0x79ff('0x53')];}return db['Setting'][_0x79ff('0x4f')]({'where':{'id':_0x302fe7[_0x79ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x334a1,null))[_0x79ff('0x1a')](saveUpdates(_0x302fe7[_0x79ff('0x50')],null))[_0x79ff('0x1a')](respondWithResult(_0x334a1,null))[_0x79ff('0x4c')](handleError(_0x334a1,null));};var utilLicense=require(_0x79ff('0x14'));exports[_0x79ff('0x56')]=function(_0x433eaa,_0x177095,_0x2f19c3){var _0x12cba9=_0x79ff('0x57');var _0x4961c1={'custom':![]};return utilLicense[_0x79ff('0x58')]()[_0x79ff('0x1a')](function(_0x1d701e){if(_0x1d701e){_0x4961c1=_0x1d701e;}return db['Setting']['find']({'where':{'id':_0x433eaa[_0x79ff('0x4e')]['id']},'attributes':['logo',_0x79ff('0x55'),_0x79ff('0x59'),_0x79ff('0x5a'),_0x79ff('0x5b'),_0x79ff('0x5c'),'defaultPreferred',_0x79ff('0x5d')],'raw':!![]});})[_0x79ff('0x1a')](handleEntityNotFound(_0x177095,null))[_0x79ff('0x1a')](function(_0x4e7c34){if(_0x4e7c34){var _0x10a0e3=_0x4e7c34['logo']&&fs[_0x79ff('0x5e')](path['join'](config[_0x79ff('0x5f')],_0x12cba9,_[_0x79ff('0x60')](_0x4e7c34[_0x79ff('0x61')])))?path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x12cba9,_[_0x79ff('0x60')](_0x4e7c34[_0x79ff('0x61')])):path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x12cba9,_[_0x79ff('0x60')](_0x79ff('0x63')));var _0x247b05=_0x79ff('0x64')+_[_0x79ff('0x65')]('logo');if(_0x4e7c34[_0x247b05]||!_0x4961c1[_0x79ff('0x66')]){_0x10a0e3=path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x12cba9,_['toLower']('default_logo.svg'));}if(!fs[_0x79ff('0x5e')](_0x10a0e3)){throw new db[(_0x79ff('0x67'))][(_0x79ff('0x68'))](_[_0x79ff('0x65')](_0x79ff('0x61'))+_0x79ff('0x69'));}return _0x177095['download'](_0x10a0e3);}})[_0x79ff('0x4c')](handleError(_0x177095,null));};var utilLicense=require(_0x79ff('0x14'));exports[_0x79ff('0x6a')]=function(_0x1e82da,_0x3256a7,_0x5d8ef9){var _0x1e8acd=_0x79ff('0x57');var _0x3beb42={'custom':![]};return utilLicense[_0x79ff('0x58')]()[_0x79ff('0x1a')](function(_0x78c0f3){if(_0x78c0f3){_0x3beb42=_0x78c0f3;}return db[_0x79ff('0x4a')][_0x79ff('0x4f')]({'where':{'id':_0x1e82da[_0x79ff('0x4e')]['id']},'attributes':['logo',_0x79ff('0x55'),_0x79ff('0x59'),_0x79ff('0x5a'),'defaultLogo','defaultLoginLogo',_0x79ff('0x6b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3256a7,null))[_0x79ff('0x1a')](function(_0x463f2c){if(_0x463f2c){var _0x13b2c1=_0x463f2c['loginLogo']&&fs[_0x79ff('0x5e')](path['join'](config['root'],_0x1e8acd,_[_0x79ff('0x60')](_0x463f2c[_0x79ff('0x55')])))?path['join'](config[_0x79ff('0x5f')],_0x1e8acd,_[_0x79ff('0x60')](_0x463f2c[_0x79ff('0x55')])):path[_0x79ff('0x62')](config['root'],_0x1e8acd,_[_0x79ff('0x60')](_0x79ff('0x6c')));var _0xf55ab3='default'+_[_0x79ff('0x65')]('loginLogo');if(_0x463f2c[_0xf55ab3]||!_0x3beb42[_0x79ff('0x66')]){_0x13b2c1=path[_0x79ff('0x62')](config['root'],_0x1e8acd,_[_0x79ff('0x60')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x13b2c1)){throw new db[(_0x79ff('0x67'))][(_0x79ff('0x68'))](_[_0x79ff('0x65')](_0x79ff('0x55'))+'\x20not\x20found');}return _0x3256a7[_0x79ff('0x6d')](_0x13b2c1);}})[_0x79ff('0x4c')](handleError(_0x3256a7,null));};exports[_0x79ff('0x6e')]=function(_0x2a1cea,_0x5d5b6f){return db['Setting'][_0x79ff('0x4f')]({'where':{'id':_0x2a1cea[_0x79ff('0x4e')]['id']},'attributes':[_0x79ff('0x6f')]})[_0x79ff('0x1a')](respondWithResult(_0x5d5b6f,null))[_0x79ff('0x4c')](handleError(_0x5d5b6f,null));};exports['addPreferred']=function(_0x35f95c,_0x227876,_0x3f3add){if(_0x35f95c[_0x79ff('0x52')]&&_0x35f95c[_0x79ff('0x52')][_0x79ff('0x53')]){_0x35f95c[_0x79ff('0x50')]['preferred']=_0x35f95c[_0x79ff('0x52')][_0x79ff('0x53')];}return db[_0x79ff('0x4a')][_0x79ff('0x4f')]({'where':{'id':_0x35f95c[_0x79ff('0x4e')]['id']}})[_0x79ff('0x1a')](handleEntityNotFound(_0x227876,null))[_0x79ff('0x1a')](saveUpdates(_0x35f95c[_0x79ff('0x50')],null))[_0x79ff('0x1a')](respondWithResult(_0x227876,null))[_0x79ff('0x4c')](handleError(_0x227876,null));};var utilLicense=require(_0x79ff('0x14'));exports[_0x79ff('0x70')]=function(_0x42e2e5,_0x3478fc,_0x560236){var _0x324922=_0x79ff('0x57');var _0x33a341={'custom':![]};return utilLicense[_0x79ff('0x58')]()[_0x79ff('0x1a')](function(_0x1ba073){if(_0x1ba073){_0x33a341=_0x1ba073;}return db[_0x79ff('0x4a')]['find']({'where':{'id':_0x42e2e5[_0x79ff('0x4e')]['id']},'attributes':[_0x79ff('0x61'),_0x79ff('0x55'),_0x79ff('0x59'),'favicon',_0x79ff('0x5b'),_0x79ff('0x5c'),'defaultPreferred',_0x79ff('0x5d')],'raw':!![]});})[_0x79ff('0x1a')](handleEntityNotFound(_0x3478fc,null))[_0x79ff('0x1a')](function(_0x52caab){if(_0x52caab){var _0x43e70a=_0x52caab[_0x79ff('0x59')]&&fs[_0x79ff('0x5e')](path[_0x79ff('0x62')](config['root'],_0x324922,_[_0x79ff('0x60')](_0x52caab[_0x79ff('0x59')])))?path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x324922,_[_0x79ff('0x60')](_0x52caab['preferred'])):path[_0x79ff('0x62')](config['root'],_0x324922,_[_0x79ff('0x60')](_0x79ff('0x71')));var _0x156161=_0x79ff('0x64')+_[_0x79ff('0x65')]('preferred');if(_0x52caab[_0x156161]||!_0x33a341[_0x79ff('0x66')]||!_0x33a341['preferred']){_0x43e70a=path[_0x79ff('0x62')](config['root'],_0x324922,_[_0x79ff('0x60')](_0x79ff('0x71')));}if(!fs[_0x79ff('0x5e')](_0x43e70a)){throw new db[(_0x79ff('0x67'))][(_0x79ff('0x68'))](_[_0x79ff('0x65')](_0x79ff('0x59'))+_0x79ff('0x69'));}return _0x3478fc[_0x79ff('0x6d')](_0x43e70a);}})['catch'](handleError(_0x3478fc,null));};exports[_0x79ff('0x72')]=function(_0x55ae51,_0x5a1765,_0x19551b){if(_0x55ae51['file']&&_0x55ae51['file'][_0x79ff('0x53')]){_0x55ae51['body'][_0x79ff('0x5a')]=_0x55ae51['file'][_0x79ff('0x53')];}return db[_0x79ff('0x4a')][_0x79ff('0x4f')]({'where':{'id':_0x55ae51[_0x79ff('0x4e')]['id']}})[_0x79ff('0x1a')](handleEntityNotFound(_0x5a1765,null))[_0x79ff('0x1a')](saveUpdates(_0x55ae51[_0x79ff('0x50')],null))[_0x79ff('0x1a')](respondWithResult(_0x5a1765,null))[_0x79ff('0x4c')](handleError(_0x5a1765,null));};var utilLicense=require(_0x79ff('0x14'));exports['getFavicon']=function(_0x17cb52,_0xff2bdf,_0x35c856){var _0x75ab74=_0x79ff('0x57');var _0x3301d5={'custom':![]};return utilLicense[_0x79ff('0x58')]()[_0x79ff('0x1a')](function(_0xc949d0){if(_0xc949d0){_0x3301d5=_0xc949d0;}return db[_0x79ff('0x4a')][_0x79ff('0x4f')]({'where':{'id':_0x17cb52[_0x79ff('0x4e')]['id']},'attributes':['logo',_0x79ff('0x55'),_0x79ff('0x59'),'favicon',_0x79ff('0x5b'),_0x79ff('0x5c'),_0x79ff('0x6b'),_0x79ff('0x5d')],'raw':!![]});})[_0x79ff('0x1a')](handleEntityNotFound(_0xff2bdf,null))[_0x79ff('0x1a')](function(_0x20fc11){if(_0x20fc11){var _0xeb15ac=_0x20fc11[_0x79ff('0x5a')]&&fs[_0x79ff('0x5e')](path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x75ab74,_[_0x79ff('0x60')](_0x20fc11[_0x79ff('0x5a')])))?path[_0x79ff('0x62')](config['root'],_0x75ab74,_[_0x79ff('0x60')](_0x20fc11[_0x79ff('0x5a')])):path[_0x79ff('0x62')](config[_0x79ff('0x5f')],_0x75ab74,_[_0x79ff('0x60')]('default_favicon.ico'));var _0x853f2=_0x79ff('0x64')+_[_0x79ff('0x65')](_0x79ff('0x5a'));if(_0x20fc11[_0x853f2]||!_0x3301d5[_0x79ff('0x66')]){_0xeb15ac=path['join'](config[_0x79ff('0x5f')],_0x75ab74,_[_0x79ff('0x60')]('default_favicon.ico'));}if(!fs[_0x79ff('0x5e')](_0xeb15ac)){throw new db['Sequelize'][(_0x79ff('0x68'))](_[_0x79ff('0x65')](_0x79ff('0x5a'))+'\x20not\x20found');}return _0xff2bdf[_0x79ff('0x6d')](_0xeb15ac);}})[_0x79ff('0x4c')](handleError(_0xff2bdf,null));};exports[_0x79ff('0x73')]=function(_0x372b40,_0x2cc4be){var _0x35776f={'offset':moment()['utcOffset']()};_0x35776f[_0x79ff('0x74')]=moment()[_0x79ff('0x75')](_0x35776f['offset'])[_0x79ff('0x76')](_0x79ff('0x77'));return _0x2cc4be[_0x79ff('0x23')](0xc8)[_0x79ff('0x30')](_0x35776f);}; \ No newline at end of file +var _0xb420=['to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','key','model','name','keys','query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Setting','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','Sequelize','ValidationError','download','../../config/license/util','defaultPreferred','default_loginLogo.svg','gdpr','addPreferred','getPreferred','custom','default_preferred.png','\x20not\x20found','default_favicon.ico','getDate','now','utcOffset','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x445a2e,_0x2a568b){var _0x307908=function(_0x2ac0e5){while(--_0x2ac0e5){_0x445a2e['push'](_0x445a2e['shift']());}};_0x307908(++_0x2a568b);}(_0xb420,0x6a));var _0x0b42=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb420[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x0b42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b42('0x1'));var jsonpatch=require(_0x0b42('0x2'));var rp=require(_0x0b42('0x3'));var moment=require(_0x0b42('0x4'));var BPromise=require(_0x0b42('0x5'));var Mustache=require(_0x0b42('0x6'));var util=require(_0x0b42('0x7'));var path=require(_0x0b42('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b42('0x9'));var fs=require('fs');var fs_extra=require(_0x0b42('0xa'));var _=require(_0x0b42('0xb'));var squel=require(_0x0b42('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b42('0xd'));var deskjs=require(_0x0b42('0xe'));var toCsv=require(_0x0b42('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0b42('0x10'));var authService=require(_0x0b42('0x11'));var qs=require(_0x0b42('0x12'));var as=require(_0x0b42('0x13'));var hardwareService=require(_0x0b42('0x14'));var logger=require('../../config/logger')(_0x0b42('0x15'));var utils=require(_0x0b42('0x16'));var config=require(_0x0b42('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b42('0x18'))['db'];var jayson=require(_0x0b42('0x19'));var client=jayson['client'][_0x0b42('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1ce031,_0x3cccb4,_0x13dff7,_0x43810f){return new BPromise(function(_0x57fc8d,_0x534032){var _0x2f525a=_0x43810f||client;return _0x2f525a['request'](_0x1ce031,_0x13dff7)[_0x0b42('0x1b')](function(_0x8004a){logger[_0x0b42('0x1c')](_0x0b42('0x1d'),_0x3cccb4,_0x0b42('0x1e'));logger[_0x0b42('0x1f')](_0x0b42('0x20'),_0x3cccb4,_0x0b42('0x1e'),JSON[_0x0b42('0x21')](_0x8004a));if(_0x8004a['error']){if(_0x8004a[_0x0b42('0x22')]['code']===0x1f4){logger[_0x0b42('0x22')](_0x0b42('0x1d'),_0x3cccb4,_0x8004a[_0x0b42('0x22')]['message']);return _0x534032(_0x8004a[_0x0b42('0x22')][_0x0b42('0x23')]);}logger['error'](_0x0b42('0x1d'),_0x3cccb4,_0x8004a[_0x0b42('0x22')][_0x0b42('0x23')]);return _0x57fc8d(_0x8004a[_0x0b42('0x22')][_0x0b42('0x23')]);}else{logger['info'](_0x0b42('0x1d'),_0x3cccb4,_0x0b42('0x1e'));_0x57fc8d(_0x8004a[_0x0b42('0x24')][_0x0b42('0x23')]);}})[_0x0b42('0x25')](function(_0x37afa4){logger[_0x0b42('0x22')]('Setting,\x20%s,\x20%s',_0x3cccb4,_0x37afa4);_0x534032(_0x37afa4);});});}function respondWithStatusCode(_0x327758,_0x19233f){_0x19233f=_0x19233f||0xcc;return function(_0x27f87c){if(_0x27f87c){return _0x327758[_0x0b42('0x26')](_0x19233f);}return _0x327758[_0x0b42('0x27')](_0x19233f)[_0x0b42('0x28')]();};}function respondWithResult(_0x4c01d3,_0x1751ef){_0x1751ef=_0x1751ef||0xc8;return function(_0x59320f){if(_0x59320f){return _0x4c01d3[_0x0b42('0x27')](_0x1751ef)[_0x0b42('0x29')](_0x59320f);}};}function respondWithFilteredResult(_0x4bf20e,_0x1f02d1){return function(_0x458876){if(_0x458876){var _0xbfb43e=typeof _0x1f02d1[_0x0b42('0x2a')]===_0x0b42('0x2b')&&typeof _0x1f02d1[_0x0b42('0x2c')]===_0x0b42('0x2b');var _0x9a6050=_0x458876[_0x0b42('0x2d')];var _0x424ed5=_0xbfb43e?0x0:_0x1f02d1['offset'];var _0x1d0a6d=_0xbfb43e?_0x458876[_0x0b42('0x2d')]:_0x1f02d1[_0x0b42('0x2a')]+_0x1f02d1[_0x0b42('0x2c')];var _0xa25f18;if(_0x1d0a6d>=_0x9a6050){_0x1d0a6d=_0x9a6050;_0xa25f18=0xc8;}else{_0xa25f18=0xce;}_0x4bf20e[_0x0b42('0x27')](_0xa25f18);return _0x4bf20e['set'](_0x0b42('0x2e'),_0x424ed5+'-'+_0x1d0a6d+'/'+_0x9a6050)['json'](_0x458876);}return null;};}function patchUpdates(_0x586768){return function(_0x98332d){try{jsonpatch[_0x0b42('0x2f')](_0x98332d,_0x586768,!![]);}catch(_0x31a2eb){return BPromise[_0x0b42('0x30')](_0x31a2eb);}return _0x98332d[_0x0b42('0x31')]();};}function saveUpdates(_0x15c870,_0x4af514){return function(_0x91b007){if(_0x91b007){return _0x91b007[_0x0b42('0x32')](_0x15c870)[_0x0b42('0x1b')](function(_0x2ad486){return _0x2ad486;});}return null;};}function removeEntity(_0x3e050e,_0x2df701){return function(_0x3b1a83){if(_0x3b1a83){return _0x3b1a83[_0x0b42('0x33')]()[_0x0b42('0x1b')](function(){_0x3e050e['status'](0xcc)[_0x0b42('0x28')]();});}};}function handleEntityNotFound(_0x160b9c,_0x393b3a){return function(_0x3f53f5){if(!_0x3f53f5){_0x160b9c[_0x0b42('0x26')](0x194);}return _0x3f53f5;};}function handleError(_0x4e632f,_0x3a12ec){_0x3a12ec=_0x3a12ec||0x1f4;return function(_0x4ff3d3){logger[_0x0b42('0x22')](_0x4ff3d3[_0x0b42('0x34')]);if(_0x4ff3d3['name']){delete _0x4ff3d3['name'];}_0x4e632f[_0x0b42('0x27')](_0x3a12ec)['send'](_0x4ff3d3);};}exports[_0x0b42('0x35')]=function(_0xa93c25,_0xe1432f){var _0x5e281d={},_0x3ad542={},_0x52013b={'count':0x0,'rows':[]};var _0x571544=_[_0x0b42('0x36')](db['Setting'][_0x0b42('0x37')],function(_0x1c3971){return{'name':_0x1c3971[_0x0b42('0x38')],'type':_0x1c3971['type'][_0x0b42('0x39')]};});_0x3ad542[_0x0b42('0x3a')]=_['map'](_0x571544,_0x0b42('0x3b'));_0x3ad542['query']=_[_0x0b42('0x3c')](_0xa93c25[_0x0b42('0x3d')]);_0x3ad542[_0x0b42('0x3e')]=_['intersection'](_0x3ad542[_0x0b42('0x3a')],_0x3ad542[_0x0b42('0x3d')]);_0x5e281d[_0x0b42('0x3f')]=_[_0x0b42('0x40')](_0x3ad542[_0x0b42('0x3a')],qs[_0x0b42('0x41')](_0xa93c25[_0x0b42('0x3d')]['fields']));_0x5e281d['attributes']=_0x5e281d[_0x0b42('0x3f')][_0x0b42('0x42')]?_0x5e281d[_0x0b42('0x3f')]:_0x3ad542['model'];if(!_0xa93c25[_0x0b42('0x3d')]['hasOwnProperty']('nolimit')){_0x5e281d[_0x0b42('0x2c')]=qs['limit'](_0xa93c25['query'][_0x0b42('0x2c')]);_0x5e281d['offset']=qs['offset'](_0xa93c25['query'][_0x0b42('0x2a')]);}_0x5e281d[_0x0b42('0x43')]=qs[_0x0b42('0x44')](_0xa93c25[_0x0b42('0x3d')][_0x0b42('0x44')]);_0x5e281d[_0x0b42('0x45')]=qs[_0x0b42('0x3e')](_['pick'](_0xa93c25[_0x0b42('0x3d')],_0x3ad542[_0x0b42('0x3e')]),_0x571544);if(_0xa93c25['query'][_0x0b42('0x46')]){_0x5e281d[_0x0b42('0x45')]=_[_0x0b42('0x47')](_0x5e281d[_0x0b42('0x45')],{'$or':_[_0x0b42('0x36')](_0x571544,function(_0x103f88){if(_0x103f88[_0x0b42('0x48')]!==_0x0b42('0x49')){var _0x49bf56={};_0x49bf56[_0x103f88[_0x0b42('0x3b')]]={'$like':'%'+_0xa93c25[_0x0b42('0x3d')]['filter']+'%'};return _0x49bf56;}})});}_0x5e281d=_[_0x0b42('0x47')]({},_0x5e281d,_0xa93c25[_0x0b42('0x4a')]);var _0x3d569e={'where':_0x5e281d[_0x0b42('0x45')]};return db['Setting']['count'](_0x3d569e)[_0x0b42('0x1b')](function(_0x40500e){_0x52013b[_0x0b42('0x2d')]=_0x40500e;if(_0xa93c25[_0x0b42('0x3d')][_0x0b42('0x4b')]){_0x5e281d[_0x0b42('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x0b42('0x4d')](_0x5e281d);})['then'](function(_0x32f2dd){_0x52013b[_0x0b42('0x4e')]=_0x32f2dd;return _0x52013b;})['then'](respondWithFilteredResult(_0xe1432f,_0x5e281d))[_0x0b42('0x25')](handleError(_0xe1432f,null));};exports[_0x0b42('0x4f')]=function(_0x241380,_0x2274fa){var _0x1c3375={'raw':![],'where':{'id':_0x241380[_0x0b42('0x50')]['id']}},_0x54734e={};_0x54734e[_0x0b42('0x3a')]=_[_0x0b42('0x3c')](db[_0x0b42('0x51')]['rawAttributes']);_0x54734e[_0x0b42('0x3d')]=_['keys'](_0x241380['query']);_0x54734e['filters']=_[_0x0b42('0x40')](_0x54734e[_0x0b42('0x3a')],_0x54734e[_0x0b42('0x3d')]);_0x1c3375[_0x0b42('0x3f')]=_[_0x0b42('0x40')](_0x54734e[_0x0b42('0x3a')],qs[_0x0b42('0x41')](_0x241380[_0x0b42('0x3d')][_0x0b42('0x41')]));_0x1c3375['attributes']=_0x1c3375[_0x0b42('0x3f')]['length']?_0x1c3375[_0x0b42('0x3f')]:_0x54734e[_0x0b42('0x3a')];if(_0x241380[_0x0b42('0x3d')][_0x0b42('0x4b')]){_0x1c3375[_0x0b42('0x4c')]=[{'all':!![]}];}_0x1c3375=_[_0x0b42('0x47')]({},_0x1c3375,_0x241380[_0x0b42('0x4a')]);return db[_0x0b42('0x51')][_0x0b42('0x52')](_0x1c3375)[_0x0b42('0x1b')](handleEntityNotFound(_0x2274fa,null))[_0x0b42('0x1b')](respondWithResult(_0x2274fa,null))['catch'](handleError(_0x2274fa,null));};exports['update']=function(_0x189c23,_0x386630){if(_0x189c23[_0x0b42('0x53')]['id']){delete _0x189c23[_0x0b42('0x53')]['id'];}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x189c23['params']['id']}})['then'](handleEntityNotFound(_0x386630,null))[_0x0b42('0x1b')](saveUpdates(_0x189c23[_0x0b42('0x53')],null))['then'](respondWithResult(_0x386630,null))[_0x0b42('0x25')](handleError(_0x386630,null));};exports[_0x0b42('0x54')]=function(_0x4e4ae4,_0x439b53,_0x44fb6d){if(_0x4e4ae4[_0x0b42('0x55')]&&_0x4e4ae4[_0x0b42('0x55')][_0x0b42('0x56')]){_0x4e4ae4[_0x0b42('0x53')]['logo']=_0x4e4ae4[_0x0b42('0x55')][_0x0b42('0x56')];}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x4e4ae4['params']['id']}})[_0x0b42('0x1b')](handleEntityNotFound(_0x439b53,null))['then'](saveUpdates(_0x4e4ae4[_0x0b42('0x53')],null))[_0x0b42('0x1b')](respondWithResult(_0x439b53,null))['catch'](handleError(_0x439b53,null));};exports[_0x0b42('0x57')]=function(_0x13b785,_0x1cbf11,_0x88b0fc){if(_0x13b785[_0x0b42('0x55')]&&_0x13b785[_0x0b42('0x55')]['filename']){_0x13b785[_0x0b42('0x53')][_0x0b42('0x58')]=_0x13b785[_0x0b42('0x55')][_0x0b42('0x56')];}return db[_0x0b42('0x51')]['find']({'where':{'id':_0x13b785[_0x0b42('0x50')]['id']}})[_0x0b42('0x1b')](handleEntityNotFound(_0x1cbf11,null))[_0x0b42('0x1b')](saveUpdates(_0x13b785[_0x0b42('0x53')],null))[_0x0b42('0x1b')](respondWithResult(_0x1cbf11,null))[_0x0b42('0x25')](handleError(_0x1cbf11,null));};var utilLicense=require('../../config/license/util');exports[_0x0b42('0x59')]=function(_0x516765,_0x157341,_0xc94749){var _0x2d825d=_0x0b42('0x5a');var _0x380142={'custom':![]};return utilLicense[_0x0b42('0x5b')]()[_0x0b42('0x1b')](function(_0x4cec47){if(_0x4cec47){_0x380142=_0x4cec47;}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x516765[_0x0b42('0x50')]['id']},'attributes':[_0x0b42('0x5c'),_0x0b42('0x58'),_0x0b42('0x5d'),_0x0b42('0x5e'),_0x0b42('0x5f'),_0x0b42('0x60'),'defaultPreferred',_0x0b42('0x61')],'raw':!![]});})[_0x0b42('0x1b')](handleEntityNotFound(_0x157341,null))[_0x0b42('0x1b')](function(_0x260bef){if(_0x260bef){var _0x4e7b70=_0x260bef[_0x0b42('0x5c')]&&fs[_0x0b42('0x62')](path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x2d825d,_['toLower'](_0x260bef[_0x0b42('0x5c')])))?path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x2d825d,_['toLower'](_0x260bef['logo'])):path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x2d825d,_[_0x0b42('0x65')]('default_logo.svg'));var _0x691a52=_0x0b42('0x66')+_[_0x0b42('0x67')](_0x0b42('0x5c'));if(_0x260bef[_0x691a52]||!_0x380142['custom']){_0x4e7b70=path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x2d825d,_[_0x0b42('0x65')]('default_logo.svg'));}if(!fs[_0x0b42('0x62')](_0x4e7b70)){throw new db[(_0x0b42('0x68'))][(_0x0b42('0x69'))](_[_0x0b42('0x67')](_0x0b42('0x5c'))+'\x20not\x20found');}return _0x157341[_0x0b42('0x6a')](_0x4e7b70);}})[_0x0b42('0x25')](handleError(_0x157341,null));};var utilLicense=require(_0x0b42('0x6b'));exports['getLogoLogin']=function(_0x2f105a,_0x3d6d0d,_0x3a8e6b){var _0x18b8b0=_0x0b42('0x5a');var _0x231872={'custom':![]};return utilLicense['getLicense']()[_0x0b42('0x1b')](function(_0x259a4c){if(_0x259a4c){_0x231872=_0x259a4c;}return db['Setting'][_0x0b42('0x52')]({'where':{'id':_0x2f105a[_0x0b42('0x50')]['id']},'attributes':[_0x0b42('0x5c'),_0x0b42('0x58'),_0x0b42('0x5d'),_0x0b42('0x5e'),_0x0b42('0x5f'),_0x0b42('0x60'),_0x0b42('0x6c'),_0x0b42('0x61')],'raw':!![]});})[_0x0b42('0x1b')](handleEntityNotFound(_0x3d6d0d,null))['then'](function(_0x2df6cf){if(_0x2df6cf){var _0x3971fa=_0x2df6cf[_0x0b42('0x58')]&&fs[_0x0b42('0x62')](path['join'](config['root'],_0x18b8b0,_[_0x0b42('0x65')](_0x2df6cf[_0x0b42('0x58')])))?path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x18b8b0,_[_0x0b42('0x65')](_0x2df6cf[_0x0b42('0x58')])):path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x18b8b0,_['toLower']('default_loginLogo.svg'));var _0x5f4aaf=_0x0b42('0x66')+_[_0x0b42('0x67')]('loginLogo');if(_0x2df6cf[_0x5f4aaf]||!_0x231872['custom']){_0x3971fa=path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x18b8b0,_['toLower'](_0x0b42('0x6d')));}if(!fs[_0x0b42('0x62')](_0x3971fa)){throw new db['Sequelize'][(_0x0b42('0x69'))](_['upperFirst'](_0x0b42('0x58'))+'\x20not\x20found');}return _0x3d6d0d[_0x0b42('0x6a')](_0x3971fa);}})[_0x0b42('0x25')](handleError(_0x3d6d0d,null));};exports[_0x0b42('0x6e')]=function(_0x3b22b4,_0x54f6da){return db['Setting']['find']({'where':{'id':_0x3b22b4[_0x0b42('0x50')]['id']},'attributes':['securePassword']})[_0x0b42('0x1b')](respondWithResult(_0x54f6da,null))['catch'](handleError(_0x54f6da,null));};exports[_0x0b42('0x6f')]=function(_0x268c02,_0x5a56f1,_0x6343e5){if(_0x268c02['file']&&_0x268c02[_0x0b42('0x55')][_0x0b42('0x56')]){_0x268c02[_0x0b42('0x53')]['preferred']=_0x268c02[_0x0b42('0x55')][_0x0b42('0x56')];}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x268c02[_0x0b42('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a56f1,null))[_0x0b42('0x1b')](saveUpdates(_0x268c02[_0x0b42('0x53')],null))[_0x0b42('0x1b')](respondWithResult(_0x5a56f1,null))[_0x0b42('0x25')](handleError(_0x5a56f1,null));};var utilLicense=require(_0x0b42('0x6b'));exports[_0x0b42('0x70')]=function(_0x8fb79,_0x2ec38c,_0x8fae33){var _0x5b2611=_0x0b42('0x5a');var _0x1f0fbf={'custom':![]};return utilLicense[_0x0b42('0x5b')]()[_0x0b42('0x1b')](function(_0x5b2c24){if(_0x5b2c24){_0x1f0fbf=_0x5b2c24;}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x8fb79[_0x0b42('0x50')]['id']},'attributes':[_0x0b42('0x5c'),_0x0b42('0x58'),_0x0b42('0x5d'),_0x0b42('0x5e'),_0x0b42('0x5f'),_0x0b42('0x60'),_0x0b42('0x6c'),'defaultFavicon'],'raw':!![]});})[_0x0b42('0x1b')](handleEntityNotFound(_0x2ec38c,null))[_0x0b42('0x1b')](function(_0xc4643b){if(_0xc4643b){var _0xfed440=_0xc4643b[_0x0b42('0x5d')]&&fs[_0x0b42('0x62')](path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x5b2611,_[_0x0b42('0x65')](_0xc4643b['preferred'])))?path['join'](config[_0x0b42('0x64')],_0x5b2611,_[_0x0b42('0x65')](_0xc4643b['preferred'])):path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x5b2611,_['toLower']('default_preferred.png'));var _0x2450b9=_0x0b42('0x66')+_[_0x0b42('0x67')](_0x0b42('0x5d'));if(_0xc4643b[_0x2450b9]||!_0x1f0fbf[_0x0b42('0x71')]||!_0x1f0fbf['preferred']){_0xfed440=path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x5b2611,_[_0x0b42('0x65')](_0x0b42('0x72')));}if(!fs['existsSync'](_0xfed440)){throw new db['Sequelize'][(_0x0b42('0x69'))](_['upperFirst'](_0x0b42('0x5d'))+_0x0b42('0x73'));}return _0x2ec38c['download'](_0xfed440);}})[_0x0b42('0x25')](handleError(_0x2ec38c,null));};exports['addFavicon']=function(_0x492264,_0x244238,_0xf34f3f){if(_0x492264[_0x0b42('0x55')]&&_0x492264[_0x0b42('0x55')][_0x0b42('0x56')]){_0x492264[_0x0b42('0x53')]['favicon']=_0x492264[_0x0b42('0x55')][_0x0b42('0x56')];}return db[_0x0b42('0x51')]['find']({'where':{'id':_0x492264[_0x0b42('0x50')]['id']}})['then'](handleEntityNotFound(_0x244238,null))[_0x0b42('0x1b')](saveUpdates(_0x492264[_0x0b42('0x53')],null))[_0x0b42('0x1b')](respondWithResult(_0x244238,null))[_0x0b42('0x25')](handleError(_0x244238,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x6252bc,_0x73030,_0x5c02fd){var _0x54baf3='server/files/images/logos';var _0x5bb5af={'custom':![]};return utilLicense['getLicense']()[_0x0b42('0x1b')](function(_0x308f0b){if(_0x308f0b){_0x5bb5af=_0x308f0b;}return db[_0x0b42('0x51')][_0x0b42('0x52')]({'where':{'id':_0x6252bc[_0x0b42('0x50')]['id']},'attributes':[_0x0b42('0x5c'),_0x0b42('0x58'),_0x0b42('0x5d'),_0x0b42('0x5e'),_0x0b42('0x5f'),_0x0b42('0x60'),'defaultPreferred',_0x0b42('0x61')],'raw':!![]});})[_0x0b42('0x1b')](handleEntityNotFound(_0x73030,null))[_0x0b42('0x1b')](function(_0x584bcb){if(_0x584bcb){var _0x173a31=_0x584bcb[_0x0b42('0x5e')]&&fs[_0x0b42('0x62')](path['join'](config[_0x0b42('0x64')],_0x54baf3,_['toLower'](_0x584bcb[_0x0b42('0x5e')])))?path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x54baf3,_['toLower'](_0x584bcb['favicon'])):path[_0x0b42('0x63')](config['root'],_0x54baf3,_[_0x0b42('0x65')](_0x0b42('0x74')));var _0x2a964d='default'+_[_0x0b42('0x67')](_0x0b42('0x5e'));if(_0x584bcb[_0x2a964d]||!_0x5bb5af['custom']){_0x173a31=path[_0x0b42('0x63')](config[_0x0b42('0x64')],_0x54baf3,_['toLower'](_0x0b42('0x74')));}if(!fs[_0x0b42('0x62')](_0x173a31)){throw new db['Sequelize'][(_0x0b42('0x69'))](_[_0x0b42('0x67')](_0x0b42('0x5e'))+_0x0b42('0x73'));}return _0x73030[_0x0b42('0x6a')](_0x173a31);}})['catch'](handleError(_0x73030,null));};exports[_0x0b42('0x75')]=function(_0x281c12,_0x1337e9){var _0x5d06b3={'offset':moment()['utcOffset']()};_0x5d06b3[_0x0b42('0x76')]=moment()[_0x0b42('0x77')](_0x5d06b3[_0x0b42('0x2a')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x1337e9['status'](0xc8)[_0x0b42('0x78')](_0x5d06b3);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index de6b3ad..b0cdf9e 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(_0x31c35b,_0x461651){var _0x2c443e=function(_0x2e895b){while(--_0x2e895b){_0x31c35b['push'](_0x31c35b['shift']());}};_0x2c443e(++_0x461651);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ebe81,_0x493550){_0x3ebe81=_0x3ebe81-0x0;var _0x230055=_0xedd9[_0x3ebe81];return _0x230055;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x55ca,0x126));var _0xa55c=function(_0x62396d,_0x1ad1ba){_0x62396d=_0x62396d-0x0;var _0x49db3e=_0x55ca[_0x62396d];return _0x49db3e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index dedf9e9..3e0a7c5 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 _0x7a37=['request','then','info','debug','request\x20sent','stringify','error','message','Setting,\x20%s,\x20%s','catch','ShowSetting','Setting','find','options','where','attributes','map','include','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0xa3ac78,_0x33bb8c){var _0x2afc77=function(_0x51003a){while(--_0x51003a){_0xa3ac78['push'](_0xa3ac78['shift']());}};_0x2afc77(++_0x33bb8c);}(_0x7a37,0x67));var _0x77a3=function(_0x384b76,_0x496cf3){_0x384b76=_0x384b76-0x0;var _0x4dbfac=_0x7a37[_0x384b76];return _0x4dbfac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x77a3('0x0'));var BPromise=require(_0x77a3('0x1'));var rs=require(_0x77a3('0x2'));var fs=require('fs');var Redis=require(_0x77a3('0x3'));var db=require(_0x77a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77a3('0x5'))(_0x77a3('0x6'));var config=require('../../config/environment');var jayson=require(_0x77a3('0x7'));var client=jayson[_0x77a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c1b4,_0x26f437,_0x148cf9){return new BPromise(function(_0x2af416,_0x1a14c6){return client[_0x77a3('0x9')](_0x26c1b4,_0x148cf9)[_0x77a3('0xa')](function(_0x21ec95){logger[_0x77a3('0xb')]('Setting,\x20%s,\x20%s',_0x26f437,'request\x20sent');logger[_0x77a3('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x26f437,_0x77a3('0xd'),JSON[_0x77a3('0xe')](_0x21ec95));if(_0x21ec95[_0x77a3('0xf')]){if(_0x21ec95['error']['code']===0x1f4){logger[_0x77a3('0xf')]('Setting,\x20%s,\x20%s',_0x26f437,_0x21ec95[_0x77a3('0xf')][_0x77a3('0x10')]);return _0x1a14c6(_0x21ec95[_0x77a3('0xf')]['message']);}logger[_0x77a3('0xf')]('Setting,\x20%s,\x20%s',_0x26f437,_0x21ec95[_0x77a3('0xf')][_0x77a3('0x10')]);return _0x2af416(_0x21ec95['error'][_0x77a3('0x10')]);}else{logger[_0x77a3('0xb')](_0x77a3('0x11'),_0x26f437,_0x77a3('0xd'));_0x2af416(_0x21ec95['result']['message']);}})[_0x77a3('0x12')](function(_0x2f93b2){logger[_0x77a3('0xf')](_0x77a3('0x11'),_0x26f437,_0x2f93b2);_0x1a14c6(_0x2f93b2);});});}exports[_0x77a3('0x13')]=function(_0x40ff8e){var _0x3260f9=this;return new Promise(function(_0x32c108,_0x4a93f4){return db[_0x77a3('0x14')][_0x77a3('0x15')]({'raw':_0x40ff8e[_0x77a3('0x16')]?_0x40ff8e[_0x77a3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x40ff8e[_0x77a3('0x16')]?_0x40ff8e[_0x77a3('0x16')][_0x77a3('0x17')]||null:null,'attributes':_0x40ff8e['options']?_0x40ff8e[_0x77a3('0x16')][_0x77a3('0x18')]||null:null,'include':_0x40ff8e[_0x77a3('0x16')]?_0x40ff8e['options']['include']?_[_0x77a3('0x19')](_0x40ff8e[_0x77a3('0x16')][_0x77a3('0x1a')],function(_0x2d5ac9){return{'model':db[_0x2d5ac9[_0x77a3('0x1b')]],'as':_0x2d5ac9['as'],'attributes':_0x2d5ac9[_0x77a3('0x18')],'include':_0x2d5ac9[_0x77a3('0x1a')]?_[_0x77a3('0x19')](_0x2d5ac9['include'],function(_0x3c0f1d){return{'model':db[_0x3c0f1d['model']],'as':_0x3c0f1d['as'],'attributes':_0x3c0f1d[_0x77a3('0x18')],'include':_0x3c0f1d[_0x77a3('0x1a')]?_[_0x77a3('0x19')](_0x3c0f1d['include'],function(_0x41f9a4){return{'model':db[_0x41f9a4[_0x77a3('0x1b')]],'as':_0x41f9a4['as'],'attributes':_0x41f9a4[_0x77a3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x77a3('0xa')](function(_0x508dcf){logger[_0x77a3('0xb')](_0x77a3('0x13'),_0x40ff8e);logger[_0x77a3('0xc')](_0x77a3('0x13'),_0x40ff8e,JSON[_0x77a3('0xe')](_0x508dcf));_0x32c108(_0x508dcf);})[_0x77a3('0x12')](function(_0x2b08b2){logger[_0x77a3('0xf')]('ShowSetting',_0x2b08b2[_0x77a3('0x10')],_0x40ff8e);_0x4a93f4(_0x3260f9[_0x77a3('0xf')](0x1f4,_0x2b08b2['message']));});});}; \ No newline at end of file +var _0xaf23=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cffe4,_0x3091da){var _0x43d42f=function(_0x3b5290){while(--_0x3b5290){_0x2cffe4['push'](_0x2cffe4['shift']());}};_0x43d42f(++_0x3091da);}(_0xaf23,0x1c0));var _0x3af2=function(_0x5e99ae,_0x37d21f){_0x5e99ae=_0x5e99ae-0x0;var _0x286019=_0xaf23[_0x5e99ae];return _0x286019;};'use strict';var _=require(_0x3af2('0x0'));var util=require(_0x3af2('0x1'));var moment=require('moment');var BPromise=require(_0x3af2('0x2'));var rs=require(_0x3af2('0x3'));var fs=require('fs');var Redis=require(_0x3af2('0x4'));var db=require(_0x3af2('0x5'))['db'];var utils=require(_0x3af2('0x6'));var logger=require(_0x3af2('0x7'))(_0x3af2('0x8'));var config=require(_0x3af2('0x9'));var jayson=require(_0x3af2('0xa'));var client=jayson[_0x3af2('0xb')][_0x3af2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52d31b,_0x454c96,_0x195108){return new BPromise(function(_0x4ce0fb,_0x1b0083){return client[_0x3af2('0xd')](_0x52d31b,_0x195108)['then'](function(_0x21a30d){logger[_0x3af2('0xe')](_0x3af2('0xf'),_0x454c96,_0x3af2('0x10'));logger[_0x3af2('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x454c96,_0x3af2('0x10'),JSON[_0x3af2('0x12')](_0x21a30d));if(_0x21a30d[_0x3af2('0x13')]){if(_0x21a30d['error'][_0x3af2('0x14')]===0x1f4){logger[_0x3af2('0x13')]('Setting,\x20%s,\x20%s',_0x454c96,_0x21a30d[_0x3af2('0x13')][_0x3af2('0x15')]);return _0x1b0083(_0x21a30d[_0x3af2('0x13')]['message']);}logger[_0x3af2('0x13')](_0x3af2('0xf'),_0x454c96,_0x21a30d[_0x3af2('0x13')][_0x3af2('0x15')]);return _0x4ce0fb(_0x21a30d[_0x3af2('0x13')][_0x3af2('0x15')]);}else{logger[_0x3af2('0xe')](_0x3af2('0xf'),_0x454c96,_0x3af2('0x10'));_0x4ce0fb(_0x21a30d[_0x3af2('0x16')][_0x3af2('0x15')]);}})[_0x3af2('0x17')](function(_0x30f776){logger[_0x3af2('0x13')](_0x3af2('0xf'),_0x454c96,_0x30f776);_0x1b0083(_0x30f776);});});}exports[_0x3af2('0x18')]=function(_0x1200ef){var _0xffb9c8=this;return new Promise(function(_0xbc86b,_0x51d9e4){return db[_0x3af2('0x19')][_0x3af2('0x1a')]({'raw':_0x1200ef[_0x3af2('0x1b')]?_0x1200ef[_0x3af2('0x1b')][_0x3af2('0x1c')]===undefined?!![]:![]:!![],'where':_0x1200ef[_0x3af2('0x1b')]?_0x1200ef['options'][_0x3af2('0x1d')]||null:null,'attributes':_0x1200ef[_0x3af2('0x1b')]?_0x1200ef[_0x3af2('0x1b')][_0x3af2('0x1e')]||null:null,'include':_0x1200ef[_0x3af2('0x1b')]?_0x1200ef[_0x3af2('0x1b')][_0x3af2('0x1f')]?_[_0x3af2('0x20')](_0x1200ef[_0x3af2('0x1b')][_0x3af2('0x1f')],function(_0x28d87b){return{'model':db[_0x28d87b['model']],'as':_0x28d87b['as'],'attributes':_0x28d87b['attributes'],'include':_0x28d87b[_0x3af2('0x1f')]?_[_0x3af2('0x20')](_0x28d87b['include'],function(_0x180ff0){return{'model':db[_0x180ff0[_0x3af2('0x21')]],'as':_0x180ff0['as'],'attributes':_0x180ff0[_0x3af2('0x1e')],'include':_0x180ff0[_0x3af2('0x1f')]?_['map'](_0x180ff0['include'],function(_0x432f0b){return{'model':db[_0x432f0b[_0x3af2('0x21')]],'as':_0x432f0b['as'],'attributes':_0x432f0b[_0x3af2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3af2('0x22')](function(_0x23f015){logger[_0x3af2('0xe')]('ShowSetting',_0x1200ef);logger[_0x3af2('0x11')](_0x3af2('0x18'),_0x1200ef,JSON[_0x3af2('0x12')](_0x23f015));_0xbc86b(_0x23f015);})[_0x3af2('0x17')](function(_0x36c423){logger[_0x3af2('0x13')](_0x3af2('0x18'),_0x36c423[_0x3af2('0x15')],_0x1200ef);_0x51d9e4(_0xffb9c8[_0x3af2('0x13')](0x1f4,_0x36c423[_0x3af2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8fd930a..06fdd04 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x98743,_0x54a11d){var _0x4f0b23=function(_0x2c7863){while(--_0x2c7863){_0x98743['push'](_0x98743['shift']());}};_0x4f0b23(++_0x54a11d);}(_0x6aa7,0x178));var _0x76aa=function(_0x127597,_0x1ef29c){_0x127597=_0x127597-0x0;var _0x43d0e8=_0x6aa7[_0x127597];return _0x43d0e8;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x29d976,_0x652e0){var _0xeca83=function(_0x3533e8){while(--_0x3533e8){_0x29d976['push'](_0x29d976['shift']());}};_0xeca83(++_0x652e0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index dc70d85..34dadd5 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 _0x3e52=['ENUM','connectel','clicksend','plivo','clickatell','bandwidth','intelepeer','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate'];(function(_0x52e130,_0x36a67c){var _0x167346=function(_0x1d2092){while(--_0x1d2092){_0x52e130['push'](_0x52e130['shift']());}};_0x167346(++_0x36a67c);}(_0x3e52,0x1cd));var _0x23e5=function(_0x453dc9,_0x160421){_0x453dc9=_0x453dc9-0x0;var _0x106576=_0x3e52[_0x453dc9];return _0x106576;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x23e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x23e5('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x23e5('0x1')],'defaultValue':function(){return rs[_0x23e5('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x23e5('0x3')]('twilio','skebby',_0x23e5('0x4'),_0x23e5('0x5'),_0x23e5('0x6'),_0x23e5('0x7'),_0x23e5('0x8'),'csc','infobip',_0x23e5('0x9'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x23e5('0x1')]},'authToken':{'type':Sequelize[_0x23e5('0x1')]},'smsMethod':{'type':Sequelize[_0x23e5('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x23e5('0x1')]},'password':{'type':Sequelize[_0x23e5('0x1')]},'apiKey':{'type':Sequelize[_0x23e5('0x1')]},'applicationId':{'type':Sequelize[_0x23e5('0x1')]},'accountId':{'type':Sequelize[_0x23e5('0x1')]},'senderString':{'type':Sequelize[_0x23e5('0x1')]},'deliveryReport':{'type':Sequelize[_0x23e5('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x23e5('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x23e5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x23e5('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x23e5('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x23e5('0xa')],'defaultValue':![],'comment':_0x23e5('0xc'),'set':function(_0x2c7aed){if(!_0x2c7aed)this[_0x23e5('0xd')](_0x23e5('0xe'),null);this[_0x23e5('0xd')](_0x23e5('0xf'),_0x2c7aed);}}}; \ No newline at end of file +var _0xb5e5=['intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','connectel','bandwidth'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xb5e5,0x1d6));var _0x5b5e=function(_0x389c11,_0x3e2c0e){_0x389c11=_0x389c11-0x0;var _0x9adb67=_0xb5e5[_0x389c11];return _0x9adb67;};'use strict';var Sequelize=require(_0x5b5e('0x0'));var rs=require(_0x5b5e('0x1'));module[_0x5b5e('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5b5e('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x5b5e('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x5b5e('0x4')],'defaultValue':function(){return rs[_0x5b5e('0x5')]();}},'phone':{'type':Sequelize[_0x5b5e('0x4')]},'type':{'type':Sequelize['ENUM'](_0x5b5e('0x6'),_0x5b5e('0x7'),_0x5b5e('0x8'),'clicksend','plivo','clickatell',_0x5b5e('0x9'),'csc','infobip',_0x5b5e('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x5b5e('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x5b5e('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5b5e('0x4')]},'password':{'type':Sequelize[_0x5b5e('0x4')]},'apiKey':{'type':Sequelize[_0x5b5e('0x4')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x5b5e('0x4')]},'deliveryReport':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5b5e('0xd')],'defaultValue':function(){return _0x5b5e('0xe');}},'notificationSound':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b5e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5b5e('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5b5e('0xc')],'defaultValue':![],'comment':_0x5b5e('0x10'),'set':function(_0x5001d6){if(!_0x5001d6)this[_0x5b5e('0x11')](_0x5b5e('0x12'),null);this['setDataValue'](_0x5b5e('0x13'),_0x5001d6);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index d5e9c6f..f8642d8 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 _0xe7bd=['skebby','from','sender','text','connectel','messageId','message_id','plivo','Text','MessageUUID','infobip','results','segmentedMessage','clickatell','replyMessageId','bandwidth','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','defaults','contact','SmsInteraction','spread','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','interaction','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','text/xml','\x0a','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','CmContact','Contact','internal','Tag','color','tag','to\x20is\x20mandatory','List','ListId','Messages','dataValues','inspect','skebby_dispatch_id','requestid','status_code','groupName','DELIVERED','redif','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','findOne','nolimit','include','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','Sequelize','difference','createdAt','updatedAt','mobile','From','Body','MessageSid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7bd,0x147));var _0xde7b=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xe7bd[_0x39cf70];return _0x580424;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde7b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde7b('0x1'));var rp=require(_0xde7b('0x2'));var moment=require(_0xde7b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xde7b('0x4'));var path=require(_0xde7b('0x5'));var sox=require('sox');var csv=require(_0xde7b('0x6'));var ejs=require(_0xde7b('0x7'));var fs=require('fs');var fs_extra=require(_0xde7b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde7b('0x9'));var deskjs=require(_0xde7b('0xa'));var toCsv=require(_0xde7b('0x6'));var querystring=require('querystring');var Papa=require(_0xde7b('0xb'));var Redis=require(_0xde7b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xde7b('0xd'));var as=require(_0xde7b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde7b('0xf'))(_0xde7b('0x10'));var utils=require(_0xde7b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xde7b('0x12'));var db=require(_0xde7b('0x13'))['db'];config[_0xde7b('0x14')]=_['defaults'](config[_0xde7b('0x14')],{'host':_0xde7b('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde7b('0x14')]));require('./smsAccount.socket')[_0xde7b('0x16')](socket);var jayson=require(_0xde7b('0x17'));var client=jayson['client'][_0xde7b('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x48d6a6,_0x3541bf,_0x11f018,_0x5202f0){return new BPromise(function(_0x5041cb,_0x181d80){var _0x1adb00=_0x5202f0||client;return _0x1adb00[_0xde7b('0x19')](_0x48d6a6,_0x11f018)[_0xde7b('0x1a')](function(_0x7a97c5){logger[_0xde7b('0x1b')](_0xde7b('0x1c'),_0x3541bf,_0xde7b('0x1d'));logger[_0xde7b('0x1e')](_0xde7b('0x1f'),_0x3541bf,_0xde7b('0x1d'),JSON[_0xde7b('0x20')](_0x7a97c5));if(_0x7a97c5[_0xde7b('0x21')]){if(_0x7a97c5[_0xde7b('0x21')]['code']===0x1f4){logger[_0xde7b('0x21')](_0xde7b('0x1c'),_0x3541bf,_0x7a97c5[_0xde7b('0x21')]['message']);return _0x181d80(_0x7a97c5[_0xde7b('0x21')][_0xde7b('0x22')]);}logger[_0xde7b('0x21')](_0xde7b('0x1c'),_0x3541bf,_0x7a97c5['error'][_0xde7b('0x22')]);return _0x5041cb(_0x7a97c5['error'][_0xde7b('0x22')]);}else{logger[_0xde7b('0x1b')](_0xde7b('0x1c'),_0x3541bf,_0xde7b('0x1d'));_0x5041cb(_0x7a97c5[_0xde7b('0x23')][_0xde7b('0x22')]);}})[_0xde7b('0x24')](function(_0x9d2d38){logger[_0xde7b('0x21')](_0xde7b('0x1c'),_0x3541bf,_0x9d2d38);_0x181d80(_0x9d2d38);});});}function respondWithStatusCode(_0x51c504,_0x57982a){_0x57982a=_0x57982a||0xcc;return function(_0x51cd2f){if(_0x51cd2f){return _0x51c504[_0xde7b('0x25')](_0x57982a);}return _0x51c504[_0xde7b('0x26')](_0x57982a)[_0xde7b('0x27')]();};}function respondWithResult(_0x3d64d8,_0x403bb3){_0x403bb3=_0x403bb3||0xc8;return function(_0x14e508){if(_0x14e508){return _0x3d64d8[_0xde7b('0x26')](_0x403bb3)[_0xde7b('0x28')](_0x14e508);}};}function respondWithFilteredResult(_0x6e282d,_0x258d01){return function(_0x47cbca){if(_0x47cbca){var _0x45e34a=typeof _0x258d01[_0xde7b('0x29')]===_0xde7b('0x2a')&&typeof _0x258d01[_0xde7b('0x2b')]==='undefined';var _0x30bee2=_0x47cbca['count'];var _0x414ce5=_0x45e34a?0x0:_0x258d01[_0xde7b('0x29')];var _0x343ea2=_0x45e34a?_0x47cbca[_0xde7b('0x2c')]:_0x258d01['offset']+_0x258d01[_0xde7b('0x2b')];var _0x453f51;if(_0x343ea2>=_0x30bee2){_0x343ea2=_0x30bee2;_0x453f51=0xc8;}else{_0x453f51=0xce;}_0x6e282d[_0xde7b('0x26')](_0x453f51);return _0x6e282d[_0xde7b('0x2d')](_0xde7b('0x2e'),_0x414ce5+'-'+_0x343ea2+'/'+_0x30bee2)[_0xde7b('0x28')](_0x47cbca);}return null;};}function patchUpdates(_0x125cce){return function(_0xa9067d){try{jsonpatch[_0xde7b('0x2f')](_0xa9067d,_0x125cce,!![]);}catch(_0x3054dd){return BPromise[_0xde7b('0x30')](_0x3054dd);}return _0xa9067d[_0xde7b('0x31')]();};}function saveUpdates(_0x26acf7,_0x22037a){return function(_0x31d17c){if(_0x31d17c){return _0x31d17c[_0xde7b('0x32')](_0x26acf7)[_0xde7b('0x1a')](function(_0x1021a0){return _0x1021a0;});}return null;};}function removeEntity(_0x42d3f0,_0x4e045f){return function(_0x15b0e7){if(_0x15b0e7){return _0x15b0e7[_0xde7b('0x33')]()[_0xde7b('0x1a')](function(){var _0x1fca5d=_0x15b0e7[_0xde7b('0x34')]({'plain':!![]});var _0xd9a457='SmsAccounts';return db['UserProfileResource'][_0xde7b('0x33')]({'where':{'type':_0xd9a457,'resourceId':_0x1fca5d['id']}})['then'](function(){return _0x15b0e7;});})[_0xde7b('0x1a')](function(){_0x42d3f0[_0xde7b('0x26')](0xcc)[_0xde7b('0x27')]();});}};}function handleEntityNotFound(_0x490961,_0x1ca9fd){return function(_0x38e9ed){if(!_0x38e9ed){_0x490961[_0xde7b('0x25')](0x194);}return _0x38e9ed;};}function handleError(_0x27d7f6,_0x1ce2a1){_0x1ce2a1=_0x1ce2a1||0x1f4;return function(_0x19f34c){logger[_0xde7b('0x21')](_0x19f34c[_0xde7b('0x35')]);if(_0x19f34c['name']){delete _0x19f34c[_0xde7b('0x36')];}_0x27d7f6['status'](_0x1ce2a1)[_0xde7b('0x37')](_0x19f34c);};}exports[_0xde7b('0x38')]=function(_0x5bb237,_0x3f56c6){var _0x11cf84={'include':[{'model':db[_0xde7b('0x39')],'as':_0xde7b('0x3a')}]},_0x53a9d2={},_0x4b29d3={'count':0x0,'rows':[]};var _0x4d91ff=_[_0xde7b('0x3b')](db[_0xde7b('0x3c')][_0xde7b('0x3d')],function(_0x457255){return{'name':_0x457255[_0xde7b('0x3e')],'type':_0x457255['type'][_0xde7b('0x3f')]};});_0x53a9d2[_0xde7b('0x40')]=_[_0xde7b('0x3b')](_0x4d91ff,_0xde7b('0x36'));_0x53a9d2['query']=_[_0xde7b('0x41')](_0x5bb237[_0xde7b('0x42')]);_0x53a9d2['filters']=_[_0xde7b('0x43')](_0x53a9d2[_0xde7b('0x40')],_0x53a9d2[_0xde7b('0x42')]);_0x11cf84[_0xde7b('0x44')]=_[_0xde7b('0x43')](_0x53a9d2[_0xde7b('0x40')],qs[_0xde7b('0x45')](_0x5bb237[_0xde7b('0x42')][_0xde7b('0x45')]));_0x11cf84[_0xde7b('0x44')]=_0x11cf84[_0xde7b('0x44')][_0xde7b('0x46')]?_0x11cf84[_0xde7b('0x44')]:_0x53a9d2[_0xde7b('0x40')];if(!_0x5bb237[_0xde7b('0x42')][_0xde7b('0x47')]('nolimit')){_0x11cf84['limit']=qs[_0xde7b('0x2b')](_0x5bb237[_0xde7b('0x42')][_0xde7b('0x2b')]);_0x11cf84['offset']=qs[_0xde7b('0x29')](_0x5bb237['query'][_0xde7b('0x29')]);}_0x11cf84['order']=qs[_0xde7b('0x48')](_0x5bb237[_0xde7b('0x42')][_0xde7b('0x48')]);_0x11cf84[_0xde7b('0x49')]=qs['filters'](_[_0xde7b('0x4a')](_0x5bb237[_0xde7b('0x42')],_0x53a9d2[_0xde7b('0x4b')]),_0x4d91ff);if(_0x5bb237[_0xde7b('0x42')][_0xde7b('0x4c')]){_0x11cf84[_0xde7b('0x49')]=_[_0xde7b('0x4d')](_0x11cf84[_0xde7b('0x49')],{'$or':_[_0xde7b('0x3b')](_0x4d91ff,function(_0x5f171d){if(_0x5f171d[_0xde7b('0x4e')]!==_0xde7b('0x4f')){var _0x15fcc4={};_0x15fcc4[_0x5f171d[_0xde7b('0x36')]]={'$like':'%'+_0x5bb237[_0xde7b('0x42')][_0xde7b('0x4c')]+'%'};return _0x15fcc4;}})});}_0x11cf84=_['merge']({},_0x11cf84,_0x5bb237[_0xde7b('0x50')]);var _0x436788={'where':_0x11cf84[_0xde7b('0x49')]};return db['SmsAccount'][_0xde7b('0x2c')](_0x436788)['then'](function(_0x30658e){_0x4b29d3['count']=_0x30658e;if(_0x5bb237['query'][_0xde7b('0x51')]){_0x11cf84['include']=[{'all':!![]}];}return db[_0xde7b('0x3c')][_0xde7b('0x52')](_0x11cf84);})['then'](function(_0x4fead8){_0x4b29d3[_0xde7b('0x53')]=_0x4fead8;return _0x4b29d3;})[_0xde7b('0x1a')](respondWithFilteredResult(_0x3f56c6,_0x11cf84))[_0xde7b('0x24')](handleError(_0x3f56c6,null));};exports['show']=function(_0x4b164d,_0x29c2c6){var _0x4cfd1f={'raw':![],'where':{'id':_0x4b164d[_0xde7b('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xde7b('0x3a')}]},_0x27a656={};_0x27a656[_0xde7b('0x40')]=_[_0xde7b('0x41')](db[_0xde7b('0x3c')][_0xde7b('0x3d')]);_0x27a656[_0xde7b('0x42')]=_[_0xde7b('0x41')](_0x4b164d[_0xde7b('0x42')]);_0x27a656['filters']=_[_0xde7b('0x43')](_0x27a656[_0xde7b('0x40')],_0x27a656[_0xde7b('0x42')]);_0x4cfd1f['attributes']=_[_0xde7b('0x43')](_0x27a656['model'],qs[_0xde7b('0x45')](_0x4b164d['query']['fields']));_0x4cfd1f[_0xde7b('0x44')]=_0x4cfd1f['attributes'][_0xde7b('0x46')]?_0x4cfd1f['attributes']:_0x27a656[_0xde7b('0x40')];if(_0x4b164d[_0xde7b('0x42')][_0xde7b('0x51')]){_0x4cfd1f['include']=[{'all':!![]}];}_0x4cfd1f=_['merge']({},_0x4cfd1f,_0x4b164d[_0xde7b('0x50')]);return db[_0xde7b('0x3c')]['find'](_0x4cfd1f)['then'](handleEntityNotFound(_0x29c2c6,null))[_0xde7b('0x1a')](respondWithResult(_0x29c2c6,null))['catch'](handleError(_0x29c2c6,null));};exports['create']=function(_0x124ca0,_0x56c95e){return db[_0xde7b('0x3c')]['create'](_0x124ca0[_0xde7b('0x55')],{})[_0xde7b('0x1a')](function(_0x3444b6){var _0x1f4d1e=_0x124ca0[_0xde7b('0x56')][_0xde7b('0x34')]({'plain':!![]});if(!_0x1f4d1e)throw new Error(_0xde7b('0x57'));if(_0x1f4d1e[_0xde7b('0x58')]===_0xde7b('0x56')){var _0x2e6741=_0x3444b6[_0xde7b('0x34')]({'plain':!![]});var _0x36c6c8=_0xde7b('0x59');return db[_0xde7b('0x5a')][_0xde7b('0x5b')]({'where':{'name':_0x36c6c8,'userProfileId':_0x1f4d1e[_0xde7b('0x5c')]},'raw':!![]})[_0xde7b('0x1a')](function(_0x53937d){if(_0x53937d&&_0x53937d[_0xde7b('0x5d')]===0x0){return db[_0xde7b('0x5e')][_0xde7b('0x5f')]({'name':_0x2e6741[_0xde7b('0x36')],'resourceId':_0x2e6741['id'],'type':_0x53937d[_0xde7b('0x36')],'sectionId':_0x53937d['id']},{})[_0xde7b('0x1a')](function(){return _0x3444b6;});}else{return _0x3444b6;}})['catch'](function(_0x55b18d){logger[_0xde7b('0x21')](_0xde7b('0x60'),_0x55b18d);throw _0x55b18d;});}return _0x3444b6;})[_0xde7b('0x1a')](respondWithResult(_0x56c95e,0xc9))[_0xde7b('0x24')](handleError(_0x56c95e,null));};exports['update']=function(_0x958613,_0x13871d){if(_0x958613[_0xde7b('0x55')]['id']){delete _0x958613['body']['id'];}return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x958613[_0xde7b('0x54')]['id']},'include':[{'model':db[_0xde7b('0x39')],'as':_0xde7b('0x3a')}]})['then'](handleEntityNotFound(_0x13871d,null))[_0xde7b('0x1a')](saveUpdates(_0x958613[_0xde7b('0x55')],null))[_0xde7b('0x1a')](respondWithResult(_0x13871d,null))[_0xde7b('0x24')](handleError(_0x13871d,null));};exports['destroy']=function(_0x3fc210,_0x3730a7){return db[_0xde7b('0x3c')]['find']({'where':{'id':_0x3fc210[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x3730a7,null))[_0xde7b('0x1a')](removeEntity(_0x3730a7,null))[_0xde7b('0x24')](handleError(_0x3730a7,null));};exports['describe']=function(_0x1a2e75,_0x246994){return db[_0xde7b('0x3c')][_0xde7b('0x61')]()[_0xde7b('0x1a')](respondWithResult(_0x246994,null))['catch'](handleError(_0x246994,null));};exports['addDisposition']=function(_0x5bccb3,_0x232e60,_0x4cbc1d){if(_0x5bccb3[_0xde7b('0x55')]['id']){delete _0x5bccb3[_0xde7b('0x55')]['id'];}return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x5bccb3[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x232e60,null))[_0xde7b('0x1a')](function(_0x2b4bac){if(_0x2b4bac){_0x5bccb3[_0xde7b('0x55')][_0xde7b('0x62')]=_0x2b4bac['id'];return db[_0xde7b('0x63')]['create'](_0x5bccb3[_0xde7b('0x55')]);}})[_0xde7b('0x1a')](respondWithResult(_0x232e60,null))[_0xde7b('0x24')](handleError(_0x232e60,null));};exports['getDispositions']=function(_0x563a9d,_0x182bb9,_0x10f243){var _0xeb354={'raw':![],'where':{}};var _0x514c45={};var _0x1a2058={'count':0x0,'rows':[]};return db[_0xde7b('0x3c')][_0xde7b('0x64')]({'where':{'id':_0x563a9d['params']['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x182bb9,null))[_0xde7b('0x1a')](function(_0x5c71d4){if(_0x5c71d4){_0x514c45[_0xde7b('0x40')]=_[_0xde7b('0x41')](db[_0xde7b('0x63')][_0xde7b('0x3d')]);_0x514c45[_0xde7b('0x42')]=_[_0xde7b('0x41')](_0x563a9d['query']);_0x514c45['filters']=_[_0xde7b('0x43')](_0x514c45[_0xde7b('0x40')],_0x514c45['query']);_0xeb354['attributes']=_['intersection'](_0x514c45[_0xde7b('0x40')],qs[_0xde7b('0x45')](_0x563a9d[_0xde7b('0x42')][_0xde7b('0x45')]));_0xeb354['attributes']=_0xeb354['attributes'][_0xde7b('0x46')]?_0xeb354[_0xde7b('0x44')]:_0x514c45[_0xde7b('0x40')];if(!_0x563a9d['query'][_0xde7b('0x47')](_0xde7b('0x65'))){_0xeb354['limit']=qs[_0xde7b('0x2b')](_0x563a9d['query'][_0xde7b('0x2b')]);_0xeb354[_0xde7b('0x29')]=qs[_0xde7b('0x29')](_0x563a9d[_0xde7b('0x42')][_0xde7b('0x29')]);}_0xeb354['order']=qs[_0xde7b('0x48')](_0x563a9d[_0xde7b('0x42')][_0xde7b('0x48')]);_0xeb354['where']=qs[_0xde7b('0x4b')](_[_0xde7b('0x4a')](_0x563a9d[_0xde7b('0x42')],_0x514c45[_0xde7b('0x4b')]));_0xeb354[_0xde7b('0x49')][_0xde7b('0x62')]=_0x5c71d4['id'];if(_0x563a9d[_0xde7b('0x42')]['filter']){_0xeb354[_0xde7b('0x49')]=_[_0xde7b('0x4d')](_0xeb354[_0xde7b('0x49')],{'$or':_[_0xde7b('0x3b')](_0xeb354['attributes'],function(_0x2dbc56){var _0x4d9f57={};_0x4d9f57[_0x2dbc56]={'$like':'%'+_0x563a9d[_0xde7b('0x42')][_0xde7b('0x4c')]+'%'};return _0x4d9f57;})});}_0xeb354=_[_0xde7b('0x4d')]({},_0xeb354,_0x563a9d['options']);return db[_0xde7b('0x63')][_0xde7b('0x2c')]({'where':_0xeb354[_0xde7b('0x49')]})['then'](function(_0x5359fc){_0x1a2058[_0xde7b('0x2c')]=_0x5359fc;if(_0x563a9d[_0xde7b('0x42')][_0xde7b('0x51')]){_0xeb354[_0xde7b('0x66')]=[{'all':!![]}];}return db[_0xde7b('0x63')][_0xde7b('0x52')](_0xeb354);})[_0xde7b('0x1a')](function(_0x3d005a){_0x1a2058['rows']=_0x3d005a;return _0x1a2058;});}})[_0xde7b('0x1a')](respondWithFilteredResult(_0x182bb9,_0xeb354))[_0xde7b('0x24')](handleError(_0x182bb9,null));};exports[_0xde7b('0x67')]=function(_0x5670e0,_0x1ff6c8,_0x27bbac){return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x5670e0[_0xde7b('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ff6c8,null))['then'](function(_0x56025d){if(_0x56025d){return _0x56025d[_0xde7b('0x67')](_0x5670e0[_0xde7b('0x42')][_0xde7b('0x68')]);}})[_0xde7b('0x1a')](respondWithStatusCode(_0x1ff6c8,null))['catch'](handleError(_0x1ff6c8,null));};exports['addAnswer']=function(_0x5aa35e,_0x2e3eb9,_0x58fec8){if(_0x5aa35e[_0xde7b('0x55')]['id']){delete _0x5aa35e['body']['id'];}return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x5aa35e[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x2e3eb9,null))[_0xde7b('0x1a')](function(_0xf8947b){if(_0xf8947b){_0x5aa35e[_0xde7b('0x55')][_0xde7b('0x62')]=_0xf8947b['id'];return db[_0xde7b('0x69')][_0xde7b('0x5f')](_0x5aa35e[_0xde7b('0x55')]);}})[_0xde7b('0x1a')](respondWithResult(_0x2e3eb9,null))[_0xde7b('0x24')](handleError(_0x2e3eb9,null));};exports[_0xde7b('0x6a')]=function(_0x5ef630,_0x4fe14b,_0x507839){var _0x187bfe={'raw':![],'where':{}};var _0x5eef40={};var _0x5e0721={'count':0x0,'rows':[]};return db[_0xde7b('0x3c')][_0xde7b('0x64')]({'where':{'id':_0x5ef630[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x4fe14b,null))['then'](function(_0x2a4ad0){if(_0x2a4ad0){_0x5eef40[_0xde7b('0x40')]=_[_0xde7b('0x41')](db[_0xde7b('0x69')]['rawAttributes']);_0x5eef40[_0xde7b('0x42')]=_['keys'](_0x5ef630[_0xde7b('0x42')]);_0x5eef40['filters']=_[_0xde7b('0x43')](_0x5eef40[_0xde7b('0x40')],_0x5eef40[_0xde7b('0x42')]);_0x187bfe[_0xde7b('0x44')]=_[_0xde7b('0x43')](_0x5eef40[_0xde7b('0x40')],qs[_0xde7b('0x45')](_0x5ef630[_0xde7b('0x42')][_0xde7b('0x45')]));_0x187bfe[_0xde7b('0x44')]=_0x187bfe[_0xde7b('0x44')]['length']?_0x187bfe[_0xde7b('0x44')]:_0x5eef40['model'];if(!_0x5ef630[_0xde7b('0x42')][_0xde7b('0x47')](_0xde7b('0x65'))){_0x187bfe[_0xde7b('0x2b')]=qs['limit'](_0x5ef630['query'][_0xde7b('0x2b')]);_0x187bfe[_0xde7b('0x29')]=qs[_0xde7b('0x29')](_0x5ef630[_0xde7b('0x42')][_0xde7b('0x29')]);}_0x187bfe[_0xde7b('0x6b')]=qs[_0xde7b('0x48')](_0x5ef630[_0xde7b('0x42')][_0xde7b('0x48')]);_0x187bfe[_0xde7b('0x49')]=qs[_0xde7b('0x4b')](_[_0xde7b('0x4a')](_0x5ef630[_0xde7b('0x42')],_0x5eef40[_0xde7b('0x4b')]));_0x187bfe[_0xde7b('0x49')][_0xde7b('0x62')]=_0x2a4ad0['id'];if(_0x5ef630[_0xde7b('0x42')]['filter']){_0x187bfe[_0xde7b('0x49')]=_[_0xde7b('0x4d')](_0x187bfe['where'],{'$or':_['map'](_0x187bfe[_0xde7b('0x44')],function(_0x2efb7d){var _0x4bbb95={};_0x4bbb95[_0x2efb7d]={'$like':'%'+_0x5ef630[_0xde7b('0x42')][_0xde7b('0x4c')]+'%'};return _0x4bbb95;})});}_0x187bfe=_[_0xde7b('0x4d')]({},_0x187bfe,_0x5ef630[_0xde7b('0x50')]);return db[_0xde7b('0x69')]['count']({'where':_0x187bfe['where']})[_0xde7b('0x1a')](function(_0x367207){_0x5e0721['count']=_0x367207;if(_0x5ef630[_0xde7b('0x42')][_0xde7b('0x51')]){_0x187bfe[_0xde7b('0x66')]=[{'all':!![]}];}return db[_0xde7b('0x69')]['findAll'](_0x187bfe);})['then'](function(_0x309231){_0x5e0721['rows']=_0x309231;return _0x5e0721;});}})[_0xde7b('0x1a')](respondWithFilteredResult(_0x4fe14b,_0x187bfe))['catch'](handleError(_0x4fe14b,null));};exports['removeAnswers']=function(_0x1ec272,_0x405c0e,_0x46260f){return db[_0xde7b('0x3c')]['find']({'where':{'id':_0x1ec272['params']['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x405c0e,null))[_0xde7b('0x1a')](function(_0x1da135){if(_0x1da135){return _0x1da135[_0xde7b('0x6c')](_0x1ec272[_0xde7b('0x42')][_0xde7b('0x68')]);}})[_0xde7b('0x1a')](respondWithStatusCode(_0x405c0e,null))[_0xde7b('0x24')](handleError(_0x405c0e,null));};exports['notify']=function(_0x525362,_0x23afdb,_0x102efe){var _0x5e9ab1={'channel':_0xde7b('0x6d')};var _0x2db4a1=[];var _0x258e2b=[];var _0x977e0b={};return db['SmsAccount'][_0xde7b('0x5b')]({'where':{'id':_0x525362[_0xde7b('0x54')]['id']},'include':[{'model':db[_0xde7b('0x6e')],'as':'Applications'}]})[_0xde7b('0x1a')](handleEntityNotFound(_0x23afdb,null))['then'](function(_0x4b3bbb){_0x5e9ab1[_0xde7b('0x6f')]=_0x4b3bbb;_0x5e9ab1[_0xde7b('0x70')]=_[_0xde7b('0x71')](_0x4b3bbb[_0xde7b('0x72')],[_0xde7b('0x73')],[_0xde7b('0x74')]);if(_0x5e9ab1[_0xde7b('0x6f')][_0xde7b('0x72')]){delete _0x5e9ab1[_0xde7b('0x6f')][_0xde7b('0x72')];}return db['CmContact'][_0xde7b('0x61')]();})[_0xde7b('0x1a')](function(_0x17952a){if(!_0x17952a){throw new db[(_0xde7b('0x75'))]['ValidationError']('no\x20available\x20attributes');}_0x2db4a1=_[_0xde7b('0x76')](_['keys'](_0x17952a),[_0xde7b('0x77'),_0xde7b('0x78')]);_0x258e2b=_['difference'](_['keys'](_0x17952a),[_0xde7b('0x77'),_0xde7b('0x78'),'CompanyId','ListId']);_0x5e9ab1[_0xde7b('0x55')]={'mapKey':_0xde7b('0x79')};if(_0x5e9ab1[_0xde7b('0x6f')][_0xde7b('0x4e')]){switch(_0x5e9ab1['account']['type']){case'twilio':_0x5e9ab1['body']['from']=_0x525362[_0xde7b('0x55')][_0xde7b('0x7a')];_0x5e9ab1[_0xde7b('0x55')]['body']=_0x525362[_0xde7b('0x55')][_0xde7b('0x7b')];_0x5e9ab1['body']['messageId']=_0x525362['body'][_0xde7b('0x7c')];break;case _0xde7b('0x7d'):_0x5e9ab1['body'][_0xde7b('0x7e')]='+'+_0x525362[_0xde7b('0x55')][_0xde7b('0x7f')];_0x5e9ab1['body'][_0xde7b('0x55')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x80')];break;case _0xde7b('0x81'):_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')]=_0x525362['body'][_0xde7b('0x7e')];_0x5e9ab1[_0xde7b('0x55')]['body']=_0x525362[_0xde7b('0x55')][_0xde7b('0x22')];break;case'clicksend':_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x7e')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x55')]=_0x525362['body'][_0xde7b('0x55')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x82')]=_0x525362['body'][_0xde7b('0x83')];break;case _0xde7b('0x84'):_0x5e9ab1['body'][_0xde7b('0x7e')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x7a')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x55')]=_0x525362['body'][_0xde7b('0x85')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x82')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x86')];break;case _0xde7b('0x87'):_0x5e9ab1['body']['from']='+'+_0x525362['body'][_0xde7b('0x88')][0x0]['from'];_0x5e9ab1[_0xde7b('0x55')]['body']=_0x525362[_0xde7b('0x55')][_0xde7b('0x88')][0x0][_0xde7b('0x80')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x82')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x88')][0x0][_0xde7b('0x82')];break;case'csc':_0x5e9ab1['body'][_0xde7b('0x7e')]=_0x525362['body']['originatingAddress'];_0x5e9ab1[_0xde7b('0x55')]['body']=_0x525362[_0xde7b('0x55')][_0xde7b('0x89')]['message'];break;case _0xde7b('0x8a'):_0x5e9ab1['body']['from']=_0x525362['body']['fromNumber'];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x55')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x80')];_0x5e9ab1[_0xde7b('0x55')]['messageId']=_0x525362['body'][_0xde7b('0x8b')];break;case _0xde7b('0x8c'):_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x82')]=_0x525362['body'][0x0][_0xde7b('0x22')]['id'];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')]=_0x525362['body'][0x0][_0xde7b('0x22')]['from'];_0x5e9ab1['body'][_0xde7b('0x55')]=_0x525362[_0xde7b('0x55')][0x0][_0xde7b('0x22')]['text'];break;case'intelepeer':_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x7e')];_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x55')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x22')];_0x5e9ab1['body'][_0xde7b('0x82')]=_0x525362[_0xde7b('0x55')][_0xde7b('0x8d')];break;}}if(_0x5e9ab1[_0xde7b('0x55')]['id']){delete _0x5e9ab1[_0xde7b('0x55')]['id'];}if(_[_0xde7b('0x8e')](_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')])){throw new db[(_0xde7b('0x75'))][(_0xde7b('0x8f'))](_0xde7b('0x90'));}if(_[_0xde7b('0x8e')](_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x55')])||_0x5e9ab1[_0xde7b('0x55')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xde7b('0x91'));}if(_[_0xde7b('0x8e')](_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x92')])){throw new db[(_0xde7b('0x75'))][(_0xde7b('0x8f'))](_0xde7b('0x93')+_0x258e2b);}if(!_[_0xde7b('0x94')](_0x258e2b,_0x5e9ab1[_0xde7b('0x55')]['mapKey'])){throw new db[(_0xde7b('0x75'))][(_0xde7b('0x8f'))](_0xde7b('0x95')+_0x258e2b);}_0x977e0b[_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x92')]]=_0x5e9ab1['body'][_0xde7b('0x7e')];return db[_0xde7b('0x96')][_0xde7b('0x5b')]({'where':{'id':_0x5e9ab1[_0xde7b('0x6f')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x977e0b,'limit':0x1,'order':[['updatedAt',_0xde7b('0x97')]]}]});})['then'](handleEntityNotFound(_0x23afdb,null))['then'](function(_0xa4df68){if(_0xa4df68){_0x5e9ab1[_0xde7b('0x98')]=_['omit'](_0xa4df68,[_0xde7b('0x99')]);if(_0xa4df68[_0xde7b('0x99')][_0xde7b('0x46')]){return _0xa4df68['Contacts'][0x0];}var _0x50a4f0=_[_0xde7b('0x9a')](_0x5e9ab1[_0xde7b('0x55')],{'firstName':_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')],'ListId':_0xa4df68['id']});_0x50a4f0[_0x5e9ab1['body'][_0xde7b('0x92')]]=_0x5e9ab1[_0xde7b('0x55')]['from'];return db['CmContact']['create'](_0x50a4f0,{'fields':_0x2db4a1,'raw':!![]});}})['then'](handleEntityNotFound(_0x23afdb,null))['then'](function(_0x52d55b){if(_0x52d55b){_0x5e9ab1[_0xde7b('0x9b')]=_0x52d55b;var _0x11daec={'ContactId':_0x52d55b['id'],'phone':_0x5e9ab1['body'][_0xde7b('0x7e')],'SmsAccountId':_0x525362['params']['id']};var _0x1dafb2={'ContactId':_0x52d55b['id'],'SmsAccountId':_0x525362[_0xde7b('0x54')]['id'],'closed':![]};return db[_0xde7b('0x9c')][_0xde7b('0x5b')]({'where':_0x1dafb2})[_0xde7b('0x1a')](function(_0x3323fb){if(_0x3323fb){return[_0x3323fb,![]];}return db['SmsInteraction'][_0xde7b('0x5f')](_0x11daec)['then'](function(_0x431529){return[_0x431529,!![]];});});}})[_0xde7b('0x9d')](function(_0x4e35a6,_0x4b1701){_0x5e9ab1['interaction']=_0x4e35a6['get']({'plain':!![]});_0x5e9ab1['interaction'][_0xde7b('0x9e')]=![];if(_0x4b1701){if(_0x5e9ab1[_0xde7b('0x6f')][_0xde7b('0x9f')]){_0x5e9ab1[_0xde7b('0x70')][_0xde7b('0xa0')]({'id':0x0,'priority':_0x5e9ab1[_0xde7b('0x70')][_0xde7b('0x46')]+0x1,'app':_0xde7b('0xa1'),'appdata':'unmanaged','interval':_0xde7b('0xa2')});}_0x5e9ab1['interaction'][_0xde7b('0x9e')]=!![];}return db[_0xde7b('0xa3')][_0xde7b('0x5f')]({'phone':_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0x7e')],'messageId':_0x5e9ab1['body']['messageId'],'body':_0x5e9ab1['body'][_0xde7b('0x55')],'SmsAccountId':_0x525362[_0xde7b('0x54')]['id'],'SmsInteractionId':_0x4e35a6['id'],'direction':'in','ContactId':_0x4e35a6[_0xde7b('0xa4')],'AttachmentId':_0x5e9ab1[_0xde7b('0x55')][_0xde7b('0xa5')]});})[_0xde7b('0x1a')](function(_0x376470){_0x5e9ab1[_0xde7b('0x22')]=_0x376470;if(_0x5e9ab1[_0xde7b('0xa6')]['UserId']){return db[_0xde7b('0xa7')][_0xde7b('0x5b')]({'attributes':['id','name'],'where':{'id':_0x5e9ab1[_0xde7b('0xa6')][_0xde7b('0xa8')]}})[_0xde7b('0x1a')](function(_0x41bbfd){if(_0x41bbfd){_0x5e9ab1[_0xde7b('0x70')][_0xde7b('0xa9')]({'id':0x0,'priority':0x0,'app':_0xde7b('0xaa'),'appdata':_0x41bbfd[_0xde7b('0x36')]+','+(_0x5e9ab1[_0xde7b('0x6f')][_0xde7b('0xab')]||0xa),'interval':_0xde7b('0xa2')});}return respondWithRpcPromise(_0xde7b('0xac'),_0xde7b('0xad'),_0x5e9ab1);});}return respondWithRpcPromise('Start',_0xde7b('0xad'),_0x5e9ab1);})['then'](function(_0x48f929){if(_0x48f929){var _0x337941=0xc8;var _0x3bab2c='receiveMessage';logger[_0xde7b('0x1b')](_0xde7b('0x1f'),_0x3bab2c,_0x337941,'entity\x20found');logger[_0xde7b('0x1e')](_0xde7b('0xae'),_0x3bab2c,_0x337941,_0xde7b('0xaf'),JSON[_0xde7b('0x20')](_0x48f929));if(_0x5e9ab1[_0xde7b('0x6f')]['type']===_0xde7b('0xb0')){return _0x23afdb[_0xde7b('0x26')](_0x337941)[_0xde7b('0x2d')](_0xde7b('0xb1'),_0xde7b('0xb2'))[_0xde7b('0x37')](_0xde7b('0xb3'));}else{return _0x23afdb[_0xde7b('0x26')](_0x337941)[_0xde7b('0x28')](_0x48f929);}}})['catch'](handleError(_0x23afdb,null));};exports[_0xde7b('0xb4')]=function(_0x5e74fc,_0x151dc8){var _0x2e26b6=_0x5e74fc[_0xde7b('0x54')]['id'];var _0x268265=_0x5e74fc[_0xde7b('0x55')];var _0x520ef0=0xc8;var _0x40c18c=null;return db['sequelize'][_0xde7b('0xb5')]({'isolationLevel':db['sequelize'][_0xde7b('0xb6')][_0xde7b('0xb7')][_0xde7b('0xb8')]},function(_0xc49c01){return db['SmsAccount'][_0xde7b('0x64')]({'where':{'id':_0x2e26b6},'transaction':_0xc49c01})[_0xde7b('0x1a')](function(_0x2f7263){if(_0x2f7263){return db['SmsApplication'][_0xde7b('0x33')]({'where':{'SmsAccountId':_0x2e26b6},'transaction':_0xc49c01})[_0xde7b('0x1a')](function(){var _0x230340=_[_0xde7b('0x3b')](_0x268265,function(_0x5ebf92){_0x5ebf92['SmsAccountId']=_0x2e26b6;return _0x5ebf92;});return db[_0xde7b('0x6e')][_0xde7b('0xb9')](_0x230340,{'transaction':_0xc49c01});});}else{_0x520ef0=0x194;_0x40c18c=[];}});})[_0xde7b('0x1a')](function(){if(_0x520ef0!==0x194){return db[_0xde7b('0x6e')][_0xde7b('0xba')]({'where':{'SmsAccountId':_0x2e26b6},'order':_0xde7b('0x73')})['then'](function(_0x156a1f){_0x40c18c=_0x156a1f;});}})[_0xde7b('0x24')](function(_0x19ac30){_0x520ef0=0x1f4;logger[_0xde7b('0x21')](_0x19ac30[_0xde7b('0x35')]);if(_0x19ac30[_0xde7b('0x36')]){delete _0x19ac30['name'];}_0x40c18c=_0x19ac30;})[_0xde7b('0xbb')](function(){if(_0x40c18c===null){_0x151dc8[_0xde7b('0x25')](_0x520ef0);}else{if(_0x520ef0===0x1f4){_0x151dc8[_0xde7b('0x26')](_0x520ef0)[_0xde7b('0x37')](_0x40c18c);}else{_0x151dc8[_0xde7b('0x26')](_0x520ef0)['json'](_0x40c18c);}}});};exports[_0xde7b('0xbc')]=function(_0xc2c043,_0x137091,_0x320a0e){var _0x29f42a={};var _0x37f840={};var _0x484afa;var _0x187f3c;return db[_0xde7b('0x3c')][_0xde7b('0x64')]({'where':{'id':_0xc2c043[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x137091,null))[_0xde7b('0x1a')](function(_0x3dfadf){if(_0x3dfadf){_0x484afa=_0x3dfadf;_0x37f840[_0xde7b('0x40')]=_[_0xde7b('0x41')](db[_0xde7b('0x6e')][_0xde7b('0x3d')]);_0x37f840[_0xde7b('0x42')]=_[_0xde7b('0x41')](_0xc2c043[_0xde7b('0x42')]);_0x37f840[_0xde7b('0x4b')]=_[_0xde7b('0x43')](_0x37f840[_0xde7b('0x40')],_0x37f840[_0xde7b('0x42')]);_0x29f42a[_0xde7b('0x44')]=_[_0xde7b('0x43')](_0x37f840[_0xde7b('0x40')],qs['fields'](_0xc2c043[_0xde7b('0x42')]['fields']));_0x29f42a[_0xde7b('0x44')]=_0x29f42a[_0xde7b('0x44')]['length']?_0x29f42a['attributes']:_0x37f840[_0xde7b('0x40')];_0x29f42a[_0xde7b('0x6b')]=qs[_0xde7b('0x48')](_0xc2c043['query'][_0xde7b('0x48')]);_0x29f42a[_0xde7b('0x49')]=qs['filters'](_['pick'](_0xc2c043['query'],_0x37f840[_0xde7b('0x4b')]));if(_0xc2c043[_0xde7b('0x42')][_0xde7b('0x4c')]){_0x29f42a['where']=_[_0xde7b('0x4d')](_0x29f42a[_0xde7b('0x49')],{'$or':_['map'](_0x29f42a[_0xde7b('0x44')],function(_0x537df9){var _0x228335={};_0x228335[_0x537df9]={'$like':'%'+_0xc2c043[_0xde7b('0x42')][_0xde7b('0x4c')]+'%'};return _0x228335;})});}_0x29f42a=_['merge']({},_0x29f42a,_0xc2c043['options']);return _0x484afa[_0xde7b('0xbc')](_0x29f42a);}})[_0xde7b('0x1a')](function(_0x13560a){if(_0x13560a){_0x187f3c=_0x13560a[_0xde7b('0x46')];if(!_0xc2c043[_0xde7b('0x42')]['hasOwnProperty'](_0xde7b('0x65'))){_0x29f42a['limit']=qs[_0xde7b('0x2b')](_0xc2c043[_0xde7b('0x42')][_0xde7b('0x2b')]);_0x29f42a['offset']=qs[_0xde7b('0x29')](_0xc2c043[_0xde7b('0x42')][_0xde7b('0x29')]);}return _0x484afa[_0xde7b('0xbc')](_0x29f42a);}})[_0xde7b('0x1a')](function(_0x445850){if(_0x445850){return _0x445850?{'count':_0x187f3c,'rows':_0x445850}:null;}})[_0xde7b('0x1a')](respondWithResult(_0x137091,null))[_0xde7b('0x24')](handleError(_0x137091,null));};exports[_0xde7b('0xbd')]=function(_0x289497,_0x813273,_0x2c899e){var _0x5cf925={'raw':![],'where':{}};var _0x465cab={};var _0x4d1419={'count':0x0,'rows':[]};return db[_0xde7b('0x3c')][_0xde7b('0x64')]({'where':{'id':_0x289497[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x813273,null))[_0xde7b('0x1a')](function(_0x9d6a34){if(_0x9d6a34){_0x465cab[_0xde7b('0x40')]=_['keys'](db[_0xde7b('0x9c')][_0xde7b('0x3d')]);_0x465cab['query']=_[_0xde7b('0x41')](_0x289497[_0xde7b('0x42')]);_0x465cab[_0xde7b('0x4b')]=_[_0xde7b('0x43')](_0x465cab[_0xde7b('0x40')],_0x465cab[_0xde7b('0x42')]);_0x5cf925['attributes']=_[_0xde7b('0x43')](_0x465cab[_0xde7b('0x40')],qs[_0xde7b('0x45')](_0x289497[_0xde7b('0x42')][_0xde7b('0x45')]));_0x5cf925[_0xde7b('0x44')]=_0x5cf925[_0xde7b('0x44')]['length']?_0x5cf925[_0xde7b('0x44')]:_0x465cab[_0xde7b('0x40')];if(!_0x289497[_0xde7b('0x42')][_0xde7b('0x47')]('nolimit')){_0x5cf925[_0xde7b('0x2b')]=qs[_0xde7b('0x2b')](_0x289497[_0xde7b('0x42')]['limit']);_0x5cf925[_0xde7b('0x29')]=qs[_0xde7b('0x29')](_0x289497[_0xde7b('0x42')][_0xde7b('0x29')]);}_0x5cf925[_0xde7b('0x6b')]=qs[_0xde7b('0x48')](_0x289497[_0xde7b('0x42')]['sort']);_0x5cf925[_0xde7b('0x49')]=qs[_0xde7b('0x4b')](_[_0xde7b('0x4a')](_0x289497['query'],_0x465cab['filters']));_0x5cf925['where'][_0xde7b('0x62')]=_0x9d6a34['id'];if(_0x289497[_0xde7b('0x42')][_0xde7b('0x4c')]){_0x5cf925['where']=_[_0xde7b('0x4d')](_0x5cf925[_0xde7b('0x49')],{'$or':_[_0xde7b('0x3b')](_0x5cf925[_0xde7b('0x44')],function(_0x5cf02){var _0x4b9a46={};_0x4b9a46[_0x5cf02]={'$like':'%'+_0x289497[_0xde7b('0x42')][_0xde7b('0x4c')]+'%'};return _0x4b9a46;})});}_0x5cf925=_[_0xde7b('0x4d')]({},_0x5cf925,_0x289497['options']);return db[_0xde7b('0x9c')]['count']({'where':_0x5cf925[_0xde7b('0x49')]})['then'](function(_0x9d478){_0x4d1419[_0xde7b('0x2c')]=_0x9d478;if(_0x289497[_0xde7b('0x42')][_0xde7b('0x51')]){_0x5cf925[_0xde7b('0x66')]=[{'model':db[_0xde7b('0xbe')],'as':_0xde7b('0xbf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xde7b('0x36'),'fullname',_0xde7b('0xc0')],'required':![]},{'model':db[_0xde7b('0xc1')],'as':'Tags','attributes':['id',_0xde7b('0x36'),_0xde7b('0xc2')],'where':_0x289497[_0xde7b('0x42')][_0xde7b('0xc3')]?{'id':_0x289497[_0xde7b('0x42')][_0xde7b('0xc3')]}:undefined,'required':_0x289497[_0xde7b('0x42')][_0xde7b('0xc3')]?!![]:![]}];}return db[_0xde7b('0x9c')][_0xde7b('0x52')](_0x5cf925);})['then'](function(_0x38c454){_0x4d1419[_0xde7b('0x53')]=_0x38c454;return _0x4d1419;});}})['then'](respondWithFilteredResult(_0x813273,_0x5cf925))['catch'](handleError(_0x813273,null));};exports[_0xde7b('0x37')]=function(_0x530eac,_0x1791fd,_0x26dbce){var _0x2db0ad,_0x5ef365,_0xcc6d06;if(_[_0xde7b('0x8e')](_0x530eac['body'][_0xde7b('0x55')])||_0x530eac[_0xde7b('0x55')][_0xde7b('0x55')]===''){throw new db[(_0xde7b('0x75'))][(_0xde7b('0x8f'))](_0xde7b('0x91'));}if(_[_0xde7b('0x8e')](_0x530eac['body']['to'])){throw new db[(_0xde7b('0x75'))][(_0xde7b('0x8f'))](_0xde7b('0xc4'));}_0x2db0ad=_0x530eac[_0xde7b('0x55')]['to'];return db['SmsAccount'][_0xde7b('0x5b')]({'where':{'id':_0x530eac[_0xde7b('0x54')]['id']},'include':[{'model':db[_0xde7b('0x96')],'as':_0xde7b('0xc5'),'include':[{'model':db[_0xde7b('0xbe')],'as':_0xde7b('0x99'),'where':{'mobile':_0x2db0ad},'limit':0x1,'order':[[_0xde7b('0x78'),_0xde7b('0x97')]]}]}]})[_0xde7b('0x1a')](handleEntityNotFound(_0x1791fd,null))['then'](function(_0x56d8df){if(_0x56d8df&&_0x56d8df['List']){_0x5ef365=_0x56d8df[_0xde7b('0x34')]({'plain':!![]});if(_0x5ef365[_0xde7b('0xc5')]&&_0x5ef365['List'][_0xde7b('0x99')][_0xde7b('0x46')]){return _0x5ef365[_0xde7b('0xc5')][_0xde7b('0x99')][0x0];}return db[_0xde7b('0xbe')][_0xde7b('0x5f')](_[_0xde7b('0x9a')](_0x530eac['body'],{'firstName':_0x2db0ad,'mobile':_0x2db0ad,'phone':_0x2db0ad,'ListId':_0x5ef365[_0xde7b('0xc6')]}));}})[_0xde7b('0x1a')](handleEntityNotFound(_0x1791fd,null))['then'](function(_0xc1774){if(_0xc1774){_0xcc6d06=_0xc1774;return db[_0xde7b('0x9c')][_0xde7b('0x5b')]({'where':{'ContactId':_0xcc6d06['id'],'closed':![],'SmsAccountId':_0x5ef365['id']}})[_0xde7b('0x1a')](function(_0x54070e){if(_0x54070e){return[_0x54070e,![]];}return db[_0xde7b('0x9c')][_0xde7b('0x5f')]({'UserId':_0x530eac['user']['id'],'ContactId':_0xcc6d06['id'],'SmsAccountId':_0x5ef365['id'],'phone':_0x2db0ad,'firstMsgDirection':'out','Messages':[_[_0xde7b('0x4d')](_0x530eac[_0xde7b('0x55')],{'read':![],'body':_0x530eac[_0xde7b('0x55')][_0xde7b('0x55')],'phone':_0x2db0ad,'SmsAccountId':_0x5ef365['id'],'UserId':_0x530eac['user']['id'],'ContactId':_0xcc6d06['id']})]},{'include':[{'model':db[_0xde7b('0xa3')],'as':_0xde7b('0xc7')}]})[_0xde7b('0x1a')](function(_0x57a968){return[_0x57a968,!![]];});});}})[_0xde7b('0x9d')](function(_0x254fec,_0x110178){if(_0x110178){return _0x254fec;}return db['SmsMessage'][_0xde7b('0x5f')](_[_0xde7b('0x4d')](_0x530eac['body'],{'read':![],'body':_0x530eac['body'][_0xde7b('0x55')],'phone':_0x2db0ad,'SmsAccountId':_0x5ef365['id'],'SmsInteractionId':_0x254fec['id'],'UserId':_0x530eac[_0xde7b('0x56')]['id'],'ContactId':_0xcc6d06['id']}))[_0xde7b('0x1a')](function(_0x1284ca){_0x254fec[_0xde7b('0xc8')]['Messages']=[];_0x254fec[_0xde7b('0xc8')][_0xde7b('0xc7')]['push'](_0x1284ca[_0xde7b('0xc8')]);return _0x254fec;});})[_0xde7b('0x1a')](respondWithResult(_0x1791fd,null))['catch'](handleError(_0x1791fd,null));};exports[_0xde7b('0x26')]=function(_0x238e3e,_0x36ecd4,_0x4d7a05){if(_0x238e3e[_0xde7b('0x55')]['id']){delete _0x238e3e[_0xde7b('0x55')]['id'];}var _0x2f0e51,_0x135973,_0x13c098;return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x238e3e[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x36ecd4,null))[_0xde7b('0x1a')](function(_0x4c14af){if(_0x4c14af){_0x13c098=_0x4c14af;logger[_0xde7b('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde7b('0x26'),'received\x20delivery\x20report\x20from',_0x4c14af['type'],util[_0xde7b('0xc9')](_0x238e3e[_0xde7b('0x55')],{'showHidden':![],'depth':null}));switch(_0x4c14af[_0xde7b('0x4e')]){case _0xde7b('0x7d'):if(_0x238e3e[_0xde7b('0x55')][_0xde7b('0xca')]&&_0x238e3e['body'][_0xde7b('0x26')]){_0x135973=_0x238e3e['body'][_0xde7b('0x26')];return db[_0xde7b('0xa3')]['find']({'where':{'messageId':_0x238e3e[_0xde7b('0x55')][_0xde7b('0xca')]}});}break;case _0xde7b('0x81'):if(_0x238e3e['body'][_0xde7b('0xcb')]&&_0x238e3e[_0xde7b('0x55')]['statusInt']){_0x135973=_0x238e3e[_0xde7b('0x55')]['statusInt'];return db[_0xde7b('0xa3')][_0xde7b('0x5b')]({'where':{'messageId':_0x238e3e[_0xde7b('0x55')][_0xde7b('0xcb')]}});}break;case'clicksend':if(_0x238e3e[_0xde7b('0x55')][_0xde7b('0x83')]&&_0x238e3e[_0xde7b('0x55')][_0xde7b('0xcc')]){_0x135973=_0x238e3e['body'][_0xde7b('0xcc')];return db[_0xde7b('0xa3')][_0xde7b('0x5b')]({'where':{'messageId':_0x238e3e['body'][_0xde7b('0x83')]}});}break;case'infobip':var _0x220f85=_0x238e3e[_0xde7b('0x55')]['results'][0x0];if(_0x220f85[_0xde7b('0x82')]&&_0x220f85[_0xde7b('0x26')][_0xde7b('0xcd')]===_0xde7b('0xce')){_0x135973=_0x220f85['status']['groupName'];return db[_0xde7b('0xa3')]['find']({'where':{'messageId':_0x220f85[_0xde7b('0x82')]}});}break;case'clickatell':if(_0x238e3e[_0xde7b('0x55')][_0xde7b('0x82')]&&_0x238e3e[_0xde7b('0x55')][_0xde7b('0x26')]){_0x135973=_0x238e3e['body'][_0xde7b('0x26')];return db[_0xde7b('0xa3')]['find']({'where':{'messageId':_0x238e3e[_0xde7b('0x55')][_0xde7b('0x82')]}});}break;case _0xde7b('0x8c'):if(_0x238e3e[_0xde7b('0x55')][0x0][_0xde7b('0x22')]['id']){_0x135973=_0x238e3e[_0xde7b('0x55')][0x0][_0xde7b('0x4e')];return db[_0xde7b('0xa3')]['find']({'where':{'messageId':_0x238e3e['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x238e3e[_0xde7b('0x55')]['redif']&&_0x238e3e[_0xde7b('0x55')][_0xde7b('0x26')]){_0x135973=_0x238e3e['body'][_0xde7b('0x26')];return db[_0xde7b('0xa3')]['find']({'where':{'messageId':_0x238e3e[_0xde7b('0x55')][_0xde7b('0xcf')]}});}break;}}})[_0xde7b('0x1a')](handleEntityNotFound(_0x36ecd4,null))[_0xde7b('0x1a')](function(_0x1583d1){if(_0x1583d1){_0x2f0e51=_0x1583d1;switch(_0x13c098['type']){case'skebby':if(_0x135973===_0xde7b('0xce')){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde7b('0x26'),_0xde7b('0x7d'),util[_0xde7b('0xc9')](_0x238e3e[_0xde7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0xde7b('0x81'):if(_0x135973==='1'){return _0x2f0e51['update']({'read':!![]});}else{logger[_0xde7b('0x21')](_0xde7b('0x1f'),'status','skebby',util[_0xde7b('0xc9')](_0x238e3e[_0xde7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0xde7b('0xd0'):if(!_0x238e3e[_0xde7b('0x55')][_0xde7b('0xd1')]&&_0x135973>=0xc8&&_0x135973<=0xce){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')](_0xde7b('0x1f'),'status',_0xde7b('0xd0'),util['inspect'](_0x238e3e[_0xde7b('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x166405=_0x238e3e['body'][_0xde7b('0x88')][0x0];if(_0x166405[_0xde7b('0x26')]['groupName']===_0xde7b('0xce')){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde7b('0x26'),_0xde7b('0x87'),util[_0xde7b('0xc9')](_0x238e3e['body'],{'showHidden':![],'depth':null}));}break;case _0xde7b('0x8a'):if(_0x135973==_0xde7b('0xd2')||_0x135973==_0xde7b('0xd3')){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde7b('0x26'),_0xde7b('0x8a'),util[_0xde7b('0xc9')](_0x238e3e['body'],{'showHidden':![],'depth':null}));}break;case _0xde7b('0x8c'):if(_0x135973==_0xde7b('0xd4')){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')](_0xde7b('0x1f'),_0xde7b('0x26'),'bandwidth',util['inspect'](_0x238e3e['body'],{'showHidden':![],'depth':null}));}break;case _0xde7b('0xd5'):if(_0x135973===_0xde7b('0xd6')||_0x135973===_0xde7b('0xd7')){return _0x2f0e51[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')](_0xde7b('0x1f'),_0xde7b('0x26'),_0xde7b('0xd5'),util[_0xde7b('0xc9')](_0x238e3e[_0xde7b('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2f0e51;}})[_0xde7b('0x1a')](respondWithResult(_0x36ecd4,null))['catch'](handleError(_0x36ecd4,null));};exports[_0xde7b('0xd8')]=function(_0x49384d,_0x4c7a4f,_0x55c434){var _0x266dce,_0x2ccc20,_0x1d318a;return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x49384d[_0xde7b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c7a4f,null))[_0xde7b('0x1a')](function(_0x15aeab){if(_0x15aeab){_0x1d318a=_0x15aeab;logger['debug'](_0xde7b('0x1f'),_0xde7b('0x26'),'received\x20delivery\x20report\x20from',_0x15aeab[_0xde7b('0x4e')],util[_0xde7b('0xc9')](_0x49384d[_0xde7b('0x42')],{'showHidden':![],'depth':null}));switch(_0x15aeab[_0xde7b('0x4e')]){case _0xde7b('0xd9'):if(_0x49384d['query'][_0xde7b('0xda')]&&_0x49384d[_0xde7b('0x42')][_0xde7b('0xdb')]){_0x2ccc20=_0x49384d[_0xde7b('0x42')][_0xde7b('0xdb')];return db[_0xde7b('0xa3')][_0xde7b('0x5b')]({'where':{'messageId':_0x49384d[_0xde7b('0x42')][_0xde7b('0xda')]}});}break;}}})[_0xde7b('0x1a')](handleEntityNotFound(_0x4c7a4f,null))[_0xde7b('0x1a')](function(_0x27cd24){if(_0x27cd24){_0x266dce=_0x27cd24;switch(_0x1d318a[_0xde7b('0x4e')]){case _0xde7b('0xd9'):if(_0x2ccc20==='2'||_0x2ccc20==='6'){return _0x266dce[_0xde7b('0x32')]({'read':!![]});}else{logger[_0xde7b('0x21')](_0xde7b('0x1f'),_0xde7b('0x26'),_0xde7b('0xd9'),util[_0xde7b('0xc9')](_0x49384d[_0xde7b('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x266dce;}})['then'](respondWithResult(_0x4c7a4f,null))[_0xde7b('0x24')](handleError(_0x4c7a4f,null));};exports['addAgents']=function(_0x4c0dc7,_0x1e3153,_0x5d5643){return db[_0xde7b('0x3c')][_0xde7b('0x5b')]({'where':{'id':_0x4c0dc7[_0xde7b('0x54')]['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x1e3153,null))['then'](function(_0x1b3781){if(_0x1b3781){return _0x1b3781[_0xde7b('0xdc')](_0x4c0dc7[_0xde7b('0x55')][_0xde7b('0x68')],_['omit'](_0x4c0dc7[_0xde7b('0x55')],[_0xde7b('0x68'),'id'])||{})[_0xde7b('0x9d')](function(_0x3f796e){for(var _0x185ec5=0x0;_0x185ec5<_0x4c0dc7[_0xde7b('0x55')]['ids'][_0xde7b('0x46')];_0x185ec5+=0x1){socket[_0xde7b('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x4c0dc7['body']['ids'][_0x185ec5]),'SmsAccountId':Number(_0x4c0dc7[_0xde7b('0x54')]['id'])});}return _0x3f796e;});}})[_0xde7b('0x1a')](respondWithResult(_0x1e3153,null))[_0xde7b('0x24')](handleError(_0x1e3153,null));};exports[_0xde7b('0xde')]=function(_0x3d55ac,_0x202918,_0x24b325){return db['SmsAccount'][_0xde7b('0x5b')]({'where':{'id':_0x3d55ac[_0xde7b('0x54')]['id']}})['then'](handleEntityNotFound(_0x202918,null))[_0xde7b('0x1a')](function(_0x16fad4){if(_0x16fad4){return _0x16fad4[_0xde7b('0xde')](_0x3d55ac[_0xde7b('0x42')]['ids'])['then'](function(){if(_[_0xde7b('0xdf')](_0x3d55ac['query'][_0xde7b('0x68')])){for(var _0x1b28fd=0x0;_0x1b28fd<_0x3d55ac['query']['ids'][_0xde7b('0x46')];_0x1b28fd+=0x1){socket[_0xde7b('0xdd')](_0xde7b('0xe0'),{'UserId':Number(_0x3d55ac[_0xde7b('0x42')][_0xde7b('0x68')][_0x1b28fd]),'SmsAccountId':Number(_0x3d55ac[_0xde7b('0x54')]['id'])});}}else{socket[_0xde7b('0xdd')](_0xde7b('0xe0'),{'UserId':Number(_0x3d55ac[_0xde7b('0x42')][_0xde7b('0x68')]),'SmsAccountId':Number(_0x3d55ac['params']['id'])});}});}})['then'](respondWithStatusCode(_0x202918,null))[_0xde7b('0x24')](handleError(_0x202918,null));};exports['getAgents']=function(_0x39ba1a,_0x2374a3,_0x452416){var _0x5dd951={};var _0x2fc7cb={};var _0x36fcaf;var _0x5bb20e;return db['SmsAccount'][_0xde7b('0x64')]({'where':{'id':_0x39ba1a['params']['id']}})[_0xde7b('0x1a')](handleEntityNotFound(_0x2374a3,null))[_0xde7b('0x1a')](function(_0x346cca){if(_0x346cca){_0x36fcaf=_0x346cca;_0x2fc7cb[_0xde7b('0x40')]=_[_0xde7b('0x41')](db['User'][_0xde7b('0x3d')]);_0x2fc7cb[_0xde7b('0x42')]=_[_0xde7b('0x41')](_0x39ba1a['query']);_0x2fc7cb[_0xde7b('0x4b')]=_['intersection'](_0x2fc7cb[_0xde7b('0x40')],_0x2fc7cb['query']);_0x5dd951[_0xde7b('0x44')]=_[_0xde7b('0x43')](_0x2fc7cb[_0xde7b('0x40')],qs[_0xde7b('0x45')](_0x39ba1a[_0xde7b('0x42')]['fields']));_0x5dd951[_0xde7b('0x44')]=_0x5dd951[_0xde7b('0x44')][_0xde7b('0x46')]?_0x5dd951[_0xde7b('0x44')]:_0x2fc7cb['model'];_0x5dd951[_0xde7b('0x6b')]=qs[_0xde7b('0x48')](_0x39ba1a[_0xde7b('0x42')][_0xde7b('0x48')]);_0x5dd951[_0xde7b('0x49')]=qs[_0xde7b('0x4b')](_['pick'](_0x39ba1a[_0xde7b('0x42')],_0x2fc7cb[_0xde7b('0x4b')]));if(_0x39ba1a[_0xde7b('0x42')][_0xde7b('0x4c')]){_0x5dd951['where']=_[_0xde7b('0x4d')](_0x5dd951[_0xde7b('0x49')],{'$or':_[_0xde7b('0x3b')](_0x5dd951[_0xde7b('0x44')],function(_0x5f49cb){var _0x3d0c68={};_0x3d0c68[_0x5f49cb]={'$like':'%'+_0x39ba1a['query'][_0xde7b('0x4c')]+'%'};return _0x3d0c68;})});}_0x5dd951=_[_0xde7b('0x4d')]({},_0x5dd951,_0x39ba1a[_0xde7b('0x50')]);return _0x36fcaf[_0xde7b('0xe1')](_0x5dd951);}})['then'](function(_0x32dcd4){if(_0x32dcd4){_0x5bb20e=_0x32dcd4[_0xde7b('0x46')];if(!_0x39ba1a[_0xde7b('0x42')][_0xde7b('0x47')]('nolimit')){_0x5dd951[_0xde7b('0x2b')]=qs[_0xde7b('0x2b')](_0x39ba1a[_0xde7b('0x42')]['limit']);_0x5dd951[_0xde7b('0x29')]=qs[_0xde7b('0x29')](_0x39ba1a[_0xde7b('0x42')][_0xde7b('0x29')]);}return _0x36fcaf[_0xde7b('0xe1')](_0x5dd951);}})[_0xde7b('0x1a')](function(_0x4b92dd){if(_0x4b92dd){return _0x4b92dd?{'count':_0x5bb20e,'rows':_0x4b92dd}:null;}})['then'](respondWithResult(_0x2374a3,null))['catch'](handleError(_0x2374a3,null));}; \ No newline at end of file +var _0xa47b=['sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','SmsApplication','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','connectel','requestid','status_code','groupName','redif','DELIVERED','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','status','end','json','undefined','count','offset','set','apply','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','SmsAccount','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','filter','options','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','rawAttributes','intersection','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sms','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','Body','messageId','MessageSid','skebby','from','sender','text','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0xa47b,0x10e));var _0xba47=function(_0x5c895f,_0x121299){_0x5c895f=_0x5c895f-0x0;var _0x2a7141=_0xa47b[_0x5c895f];return _0x2a7141;};'use strict';var emlformat=require(_0xba47('0x0'));var rimraf=require(_0xba47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xba47('0x2'));var moment=require(_0xba47('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba47('0x4'));var path=require(_0xba47('0x5'));var sox=require(_0xba47('0x6'));var csv=require(_0xba47('0x7'));var ejs=require(_0xba47('0x8'));var fs=require('fs');var fs_extra=require(_0xba47('0x9'));var _=require(_0xba47('0xa'));var squel=require('squel');var crypto=require(_0xba47('0xb'));var jsforce=require(_0xba47('0xc'));var deskjs=require(_0xba47('0xd'));var toCsv=require(_0xba47('0x7'));var querystring=require(_0xba47('0xe'));var Papa=require(_0xba47('0xf'));var Redis=require(_0xba47('0x10'));var authService=require(_0xba47('0x11'));var qs=require(_0xba47('0x12'));var as=require(_0xba47('0x13'));var hardwareService=require(_0xba47('0x14'));var logger=require(_0xba47('0x15'))(_0xba47('0x16'));var utils=require(_0xba47('0x17'));var config=require(_0xba47('0x18'));var licenseUtil=require(_0xba47('0x19'));var db=require(_0xba47('0x1a'))['db'];config[_0xba47('0x1b')]=_[_0xba47('0x1c')](config[_0xba47('0x1b')],{'host':_0xba47('0x1d'),'port':0x18eb});var socket=require(_0xba47('0x1e'))(new Redis(config[_0xba47('0x1b')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xba47('0x1f'));var client=jayson[_0xba47('0x20')][_0xba47('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x566cb4,_0x12263c,_0x54c877,_0x3003a6){return new BPromise(function(_0xd1105f,_0x5cabcf){var _0x466d26=_0x3003a6||client;return _0x466d26[_0xba47('0x22')](_0x566cb4,_0x54c877)[_0xba47('0x23')](function(_0x3aa7ec){logger[_0xba47('0x24')](_0xba47('0x25'),_0x12263c,_0xba47('0x26'));logger[_0xba47('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x12263c,'request\x20sent',JSON['stringify'](_0x3aa7ec));if(_0x3aa7ec[_0xba47('0x28')]){if(_0x3aa7ec[_0xba47('0x28')]['code']===0x1f4){logger[_0xba47('0x28')](_0xba47('0x25'),_0x12263c,_0x3aa7ec[_0xba47('0x28')][_0xba47('0x29')]);return _0x5cabcf(_0x3aa7ec[_0xba47('0x28')][_0xba47('0x29')]);}logger['error'](_0xba47('0x25'),_0x12263c,_0x3aa7ec[_0xba47('0x28')][_0xba47('0x29')]);return _0xd1105f(_0x3aa7ec[_0xba47('0x28')][_0xba47('0x29')]);}else{logger[_0xba47('0x24')](_0xba47('0x25'),_0x12263c,'request\x20sent');_0xd1105f(_0x3aa7ec[_0xba47('0x2a')][_0xba47('0x29')]);}})['catch'](function(_0x3d5a5e){logger[_0xba47('0x28')](_0xba47('0x25'),_0x12263c,_0x3d5a5e);_0x5cabcf(_0x3d5a5e);});});}function respondWithStatusCode(_0x567e4a,_0x50910f){_0x50910f=_0x50910f||0xcc;return function(_0x25b7cd){if(_0x25b7cd){return _0x567e4a['sendStatus'](_0x50910f);}return _0x567e4a[_0xba47('0x2b')](_0x50910f)[_0xba47('0x2c')]();};}function respondWithResult(_0x376fb5,_0x219948){_0x219948=_0x219948||0xc8;return function(_0x5bcdcf){if(_0x5bcdcf){return _0x376fb5['status'](_0x219948)[_0xba47('0x2d')](_0x5bcdcf);}};}function respondWithFilteredResult(_0x1f86bf,_0x2c9d6a){return function(_0x4827f1){if(_0x4827f1){var _0x35e4da=typeof _0x2c9d6a['offset']===_0xba47('0x2e')&&typeof _0x2c9d6a['limit']==='undefined';var _0x19a50b=_0x4827f1[_0xba47('0x2f')];var _0xa6b077=_0x35e4da?0x0:_0x2c9d6a[_0xba47('0x30')];var _0x3cf758=_0x35e4da?_0x4827f1[_0xba47('0x2f')]:_0x2c9d6a[_0xba47('0x30')]+_0x2c9d6a['limit'];var _0x3d778b;if(_0x3cf758>=_0x19a50b){_0x3cf758=_0x19a50b;_0x3d778b=0xc8;}else{_0x3d778b=0xce;}_0x1f86bf[_0xba47('0x2b')](_0x3d778b);return _0x1f86bf[_0xba47('0x31')]('Content-Range',_0xa6b077+'-'+_0x3cf758+'/'+_0x19a50b)['json'](_0x4827f1);}return null;};}function patchUpdates(_0x31daf6){return function(_0x54f978){try{jsonpatch[_0xba47('0x32')](_0x54f978,_0x31daf6,!![]);}catch(_0x5ae598){return BPromise['reject'](_0x5ae598);}return _0x54f978[_0xba47('0x33')]();};}function saveUpdates(_0x739e7f,_0x2bd5e8){return function(_0x5f5b7a){if(_0x5f5b7a){return _0x5f5b7a[_0xba47('0x34')](_0x739e7f)[_0xba47('0x23')](function(_0x33527d){return _0x33527d;});}return null;};}function removeEntity(_0x1426cd,_0xe6afe9){return function(_0x4758f2){if(_0x4758f2){return _0x4758f2[_0xba47('0x35')]()[_0xba47('0x23')](function(){var _0x4669d0=_0x4758f2['get']({'plain':!![]});var _0x317bc0='SmsAccounts';return db[_0xba47('0x36')][_0xba47('0x35')]({'where':{'type':_0x317bc0,'resourceId':_0x4669d0['id']}})['then'](function(){return _0x4758f2;});})[_0xba47('0x23')](function(){_0x1426cd[_0xba47('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501490,_0x16f753){return function(_0x1b67b4){if(!_0x1b67b4){_0x501490[_0xba47('0x37')](0x194);}return _0x1b67b4;};}function handleError(_0x3a3b32,_0x3f9b2a){_0x3f9b2a=_0x3f9b2a||0x1f4;return function(_0x4ba8e4){logger[_0xba47('0x28')](_0x4ba8e4[_0xba47('0x38')]);if(_0x4ba8e4['name']){delete _0x4ba8e4[_0xba47('0x39')];}_0x3a3b32[_0xba47('0x2b')](_0x3f9b2a)[_0xba47('0x3a')](_0x4ba8e4);};}exports[_0xba47('0x3b')]=function(_0x58fe21,_0x3195cf){var _0x27d2dc={'include':[{'model':db[_0xba47('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2faf3e={},_0x50dcd7={'count':0x0,'rows':[]};var _0x40c767=_[_0xba47('0x3d')](db[_0xba47('0x3e')]['rawAttributes'],function(_0x377cc7){return{'name':_0x377cc7['fieldName'],'type':_0x377cc7[_0xba47('0x3f')][_0xba47('0x40')]};});_0x2faf3e[_0xba47('0x41')]=_[_0xba47('0x3d')](_0x40c767,_0xba47('0x39'));_0x2faf3e['query']=_['keys'](_0x58fe21[_0xba47('0x42')]);_0x2faf3e[_0xba47('0x43')]=_['intersection'](_0x2faf3e[_0xba47('0x41')],_0x2faf3e[_0xba47('0x42')]);_0x27d2dc['attributes']=_['intersection'](_0x2faf3e[_0xba47('0x41')],qs[_0xba47('0x44')](_0x58fe21[_0xba47('0x42')][_0xba47('0x44')]));_0x27d2dc[_0xba47('0x45')]=_0x27d2dc['attributes'][_0xba47('0x46')]?_0x27d2dc[_0xba47('0x45')]:_0x2faf3e['model'];if(!_0x58fe21[_0xba47('0x42')][_0xba47('0x47')](_0xba47('0x48'))){_0x27d2dc[_0xba47('0x49')]=qs[_0xba47('0x49')](_0x58fe21[_0xba47('0x42')]['limit']);_0x27d2dc['offset']=qs[_0xba47('0x30')](_0x58fe21[_0xba47('0x42')][_0xba47('0x30')]);}_0x27d2dc[_0xba47('0x4a')]=qs[_0xba47('0x4b')](_0x58fe21[_0xba47('0x42')]['sort']);_0x27d2dc['where']=qs['filters'](_[_0xba47('0x4c')](_0x58fe21['query'],_0x2faf3e['filters']),_0x40c767);if(_0x58fe21[_0xba47('0x42')]['filter']){_0x27d2dc[_0xba47('0x4d')]=_[_0xba47('0x4e')](_0x27d2dc[_0xba47('0x4d')],{'$or':_['map'](_0x40c767,function(_0x259199){if(_0x259199[_0xba47('0x3f')]!=='VIRTUAL'){var _0x34c634={};_0x34c634[_0x259199[_0xba47('0x39')]]={'$like':'%'+_0x58fe21[_0xba47('0x42')][_0xba47('0x4f')]+'%'};return _0x34c634;}})});}_0x27d2dc=_[_0xba47('0x4e')]({},_0x27d2dc,_0x58fe21[_0xba47('0x50')]);var _0x1702ad={'where':_0x27d2dc['where']};return db[_0xba47('0x3e')]['count'](_0x1702ad)[_0xba47('0x23')](function(_0x50fa0b){_0x50dcd7[_0xba47('0x2f')]=_0x50fa0b;if(_0x58fe21[_0xba47('0x42')]['includeAll']){_0x27d2dc['include']=[{'all':!![]}];}return db[_0xba47('0x3e')][_0xba47('0x51')](_0x27d2dc);})['then'](function(_0x3c97ea){_0x50dcd7[_0xba47('0x52')]=_0x3c97ea;return _0x50dcd7;})['then'](respondWithFilteredResult(_0x3195cf,_0x27d2dc))[_0xba47('0x53')](handleError(_0x3195cf,null));};exports[_0xba47('0x54')]=function(_0x22f985,_0x6103c1){var _0x18c33a={'raw':![],'where':{'id':_0x22f985[_0xba47('0x55')]['id']},'include':[{'model':db[_0xba47('0x3c')],'as':_0xba47('0x56')}]},_0x2a0d2e={};_0x2a0d2e[_0xba47('0x41')]=_[_0xba47('0x57')](db[_0xba47('0x3e')][_0xba47('0x58')]);_0x2a0d2e[_0xba47('0x42')]=_[_0xba47('0x57')](_0x22f985[_0xba47('0x42')]);_0x2a0d2e[_0xba47('0x43')]=_[_0xba47('0x59')](_0x2a0d2e[_0xba47('0x41')],_0x2a0d2e[_0xba47('0x42')]);_0x18c33a[_0xba47('0x45')]=_[_0xba47('0x59')](_0x2a0d2e['model'],qs['fields'](_0x22f985[_0xba47('0x42')][_0xba47('0x44')]));_0x18c33a[_0xba47('0x45')]=_0x18c33a[_0xba47('0x45')]['length']?_0x18c33a['attributes']:_0x2a0d2e[_0xba47('0x41')];if(_0x22f985[_0xba47('0x42')][_0xba47('0x5a')]){_0x18c33a[_0xba47('0x5b')]=[{'all':!![]}];}_0x18c33a=_[_0xba47('0x4e')]({},_0x18c33a,_0x22f985['options']);return db[_0xba47('0x3e')][_0xba47('0x5c')](_0x18c33a)['then'](handleEntityNotFound(_0x6103c1,null))[_0xba47('0x23')](respondWithResult(_0x6103c1,null))[_0xba47('0x53')](handleError(_0x6103c1,null));};exports[_0xba47('0x5d')]=function(_0x157e45,_0x36c1cb){return db[_0xba47('0x3e')][_0xba47('0x5d')](_0x157e45[_0xba47('0x5e')],{})[_0xba47('0x23')](function(_0x1920df){var _0x126b47=_0x157e45[_0xba47('0x5f')][_0xba47('0x60')]({'plain':!![]});if(!_0x126b47)throw new Error(_0xba47('0x61'));if(_0x126b47[_0xba47('0x62')]===_0xba47('0x5f')){var _0x42661f=_0x1920df[_0xba47('0x60')]({'plain':!![]});var _0x148387=_0xba47('0x63');return db['UserProfileSection'][_0xba47('0x5c')]({'where':{'name':_0x148387,'userProfileId':_0x126b47['userProfileId']},'raw':!![]})[_0xba47('0x23')](function(_0x345b91){if(_0x345b91&&_0x345b91[_0xba47('0x64')]===0x0){return db[_0xba47('0x36')]['create']({'name':_0x42661f[_0xba47('0x39')],'resourceId':_0x42661f['id'],'type':_0x345b91[_0xba47('0x39')],'sectionId':_0x345b91['id']},{})[_0xba47('0x23')](function(){return _0x1920df;});}else{return _0x1920df;}})[_0xba47('0x53')](function(_0x18659f){logger[_0xba47('0x28')](_0xba47('0x65'),_0x18659f);throw _0x18659f;});}return _0x1920df;})['then'](respondWithResult(_0x36c1cb,0xc9))['catch'](handleError(_0x36c1cb,null));};exports[_0xba47('0x34')]=function(_0x373cc6,_0x5e6c6c){if(_0x373cc6[_0xba47('0x5e')]['id']){delete _0x373cc6['body']['id'];}return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x373cc6[_0xba47('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xba47('0x56')}]})['then'](handleEntityNotFound(_0x5e6c6c,null))['then'](saveUpdates(_0x373cc6[_0xba47('0x5e')],null))[_0xba47('0x23')](respondWithResult(_0x5e6c6c,null))[_0xba47('0x53')](handleError(_0x5e6c6c,null));};exports[_0xba47('0x35')]=function(_0x468293,_0x2bad0e){return db[_0xba47('0x3e')]['find']({'where':{'id':_0x468293['params']['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x2bad0e,null))[_0xba47('0x23')](removeEntity(_0x2bad0e,null))[_0xba47('0x53')](handleError(_0x2bad0e,null));};exports['describe']=function(_0x52c91b,_0x19704d){return db[_0xba47('0x3e')][_0xba47('0x66')]()[_0xba47('0x23')](respondWithResult(_0x19704d,null))['catch'](handleError(_0x19704d,null));};exports['addDisposition']=function(_0x3b335f,_0x43f52c,_0x2c07f0){if(_0x3b335f[_0xba47('0x5e')]['id']){delete _0x3b335f['body']['id'];}return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x3b335f[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x43f52c,null))['then'](function(_0x4b9104){if(_0x4b9104){_0x3b335f[_0xba47('0x5e')][_0xba47('0x67')]=_0x4b9104['id'];return db[_0xba47('0x68')][_0xba47('0x5d')](_0x3b335f['body']);}})[_0xba47('0x23')](respondWithResult(_0x43f52c,null))[_0xba47('0x53')](handleError(_0x43f52c,null));};exports[_0xba47('0x69')]=function(_0x789e1d,_0x29117f,_0x33e670){var _0x7fcc1={'raw':![],'where':{}};var _0x25b036={};var _0x1550b0={'count':0x0,'rows':[]};return db[_0xba47('0x3e')]['findOne']({'where':{'id':_0x789e1d[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x29117f,null))['then'](function(_0x29dbdc){if(_0x29dbdc){_0x25b036[_0xba47('0x41')]=_[_0xba47('0x57')](db[_0xba47('0x68')]['rawAttributes']);_0x25b036[_0xba47('0x42')]=_['keys'](_0x789e1d[_0xba47('0x42')]);_0x25b036['filters']=_[_0xba47('0x59')](_0x25b036[_0xba47('0x41')],_0x25b036[_0xba47('0x42')]);_0x7fcc1[_0xba47('0x45')]=_['intersection'](_0x25b036['model'],qs[_0xba47('0x44')](_0x789e1d[_0xba47('0x42')][_0xba47('0x44')]));_0x7fcc1[_0xba47('0x45')]=_0x7fcc1[_0xba47('0x45')][_0xba47('0x46')]?_0x7fcc1['attributes']:_0x25b036[_0xba47('0x41')];if(!_0x789e1d[_0xba47('0x42')][_0xba47('0x47')](_0xba47('0x48'))){_0x7fcc1[_0xba47('0x49')]=qs[_0xba47('0x49')](_0x789e1d[_0xba47('0x42')][_0xba47('0x49')]);_0x7fcc1['offset']=qs['offset'](_0x789e1d[_0xba47('0x42')][_0xba47('0x30')]);}_0x7fcc1['order']=qs[_0xba47('0x4b')](_0x789e1d[_0xba47('0x42')][_0xba47('0x4b')]);_0x7fcc1[_0xba47('0x4d')]=qs[_0xba47('0x43')](_['pick'](_0x789e1d['query'],_0x25b036[_0xba47('0x43')]));_0x7fcc1[_0xba47('0x4d')][_0xba47('0x67')]=_0x29dbdc['id'];if(_0x789e1d[_0xba47('0x42')][_0xba47('0x4f')]){_0x7fcc1['where']=_[_0xba47('0x4e')](_0x7fcc1[_0xba47('0x4d')],{'$or':_[_0xba47('0x3d')](_0x7fcc1[_0xba47('0x45')],function(_0x520af7){var _0x288da3={};_0x288da3[_0x520af7]={'$like':'%'+_0x789e1d['query'][_0xba47('0x4f')]+'%'};return _0x288da3;})});}_0x7fcc1=_[_0xba47('0x4e')]({},_0x7fcc1,_0x789e1d[_0xba47('0x50')]);return db['Disposition'][_0xba47('0x2f')]({'where':_0x7fcc1['where']})['then'](function(_0xa176c7){_0x1550b0[_0xba47('0x2f')]=_0xa176c7;if(_0x789e1d[_0xba47('0x42')][_0xba47('0x5a')]){_0x7fcc1[_0xba47('0x5b')]=[{'all':!![]}];}return db[_0xba47('0x68')]['findAll'](_0x7fcc1);})[_0xba47('0x23')](function(_0x36d90b){_0x1550b0[_0xba47('0x52')]=_0x36d90b;return _0x1550b0;});}})['then'](respondWithFilteredResult(_0x29117f,_0x7fcc1))[_0xba47('0x53')](handleError(_0x29117f,null));};exports[_0xba47('0x6a')]=function(_0x2521ee,_0x137a13,_0x272df0){return db['SmsAccount']['find']({'where':{'id':_0x2521ee[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x137a13,null))[_0xba47('0x23')](function(_0x154cb7){if(_0x154cb7){return _0x154cb7[_0xba47('0x6a')](_0x2521ee[_0xba47('0x42')][_0xba47('0x6b')]);}})['then'](respondWithStatusCode(_0x137a13,null))[_0xba47('0x53')](handleError(_0x137a13,null));};exports[_0xba47('0x6c')]=function(_0x5e4be8,_0x5dd63b,_0x3846ad){if(_0x5e4be8[_0xba47('0x5e')]['id']){delete _0x5e4be8[_0xba47('0x5e')]['id'];}return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x5e4be8[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x5dd63b,null))[_0xba47('0x23')](function(_0x171c36){if(_0x171c36){_0x5e4be8[_0xba47('0x5e')][_0xba47('0x67')]=_0x171c36['id'];return db[_0xba47('0x6d')][_0xba47('0x5d')](_0x5e4be8[_0xba47('0x5e')]);}})['then'](respondWithResult(_0x5dd63b,null))[_0xba47('0x53')](handleError(_0x5dd63b,null));};exports[_0xba47('0x6e')]=function(_0x5848b1,_0x3ecde0,_0x1572ac){var _0x3e950a={'raw':![],'where':{}};var _0x152a16={};var _0x37c88a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xba47('0x6f')]({'where':{'id':_0x5848b1['params']['id']}})['then'](handleEntityNotFound(_0x3ecde0,null))[_0xba47('0x23')](function(_0x5d12ef){if(_0x5d12ef){_0x152a16[_0xba47('0x41')]=_['keys'](db[_0xba47('0x6d')][_0xba47('0x58')]);_0x152a16[_0xba47('0x42')]=_['keys'](_0x5848b1['query']);_0x152a16[_0xba47('0x43')]=_[_0xba47('0x59')](_0x152a16[_0xba47('0x41')],_0x152a16[_0xba47('0x42')]);_0x3e950a[_0xba47('0x45')]=_[_0xba47('0x59')](_0x152a16['model'],qs[_0xba47('0x44')](_0x5848b1['query'][_0xba47('0x44')]));_0x3e950a[_0xba47('0x45')]=_0x3e950a['attributes'][_0xba47('0x46')]?_0x3e950a[_0xba47('0x45')]:_0x152a16[_0xba47('0x41')];if(!_0x5848b1[_0xba47('0x42')]['hasOwnProperty'](_0xba47('0x48'))){_0x3e950a['limit']=qs[_0xba47('0x49')](_0x5848b1[_0xba47('0x42')][_0xba47('0x49')]);_0x3e950a[_0xba47('0x30')]=qs[_0xba47('0x30')](_0x5848b1['query'][_0xba47('0x30')]);}_0x3e950a[_0xba47('0x4a')]=qs[_0xba47('0x4b')](_0x5848b1['query']['sort']);_0x3e950a['where']=qs[_0xba47('0x43')](_[_0xba47('0x4c')](_0x5848b1[_0xba47('0x42')],_0x152a16['filters']));_0x3e950a[_0xba47('0x4d')][_0xba47('0x67')]=_0x5d12ef['id'];if(_0x5848b1[_0xba47('0x42')][_0xba47('0x4f')]){_0x3e950a[_0xba47('0x4d')]=_[_0xba47('0x4e')](_0x3e950a[_0xba47('0x4d')],{'$or':_['map'](_0x3e950a[_0xba47('0x45')],function(_0x10a672){var _0x125dd6={};_0x125dd6[_0x10a672]={'$like':'%'+_0x5848b1['query'][_0xba47('0x4f')]+'%'};return _0x125dd6;})});}_0x3e950a=_[_0xba47('0x4e')]({},_0x3e950a,_0x5848b1[_0xba47('0x50')]);return db[_0xba47('0x6d')]['count']({'where':_0x3e950a[_0xba47('0x4d')]})[_0xba47('0x23')](function(_0x1f5ca4){_0x37c88a[_0xba47('0x2f')]=_0x1f5ca4;if(_0x5848b1[_0xba47('0x42')][_0xba47('0x5a')]){_0x3e950a[_0xba47('0x5b')]=[{'all':!![]}];}return db[_0xba47('0x6d')]['findAll'](_0x3e950a);})[_0xba47('0x23')](function(_0x292777){_0x37c88a['rows']=_0x292777;return _0x37c88a;});}})['then'](respondWithFilteredResult(_0x3ecde0,_0x3e950a))[_0xba47('0x53')](handleError(_0x3ecde0,null));};exports[_0xba47('0x70')]=function(_0x248543,_0x29332b,_0x4b28cd){return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x248543[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x29332b,null))[_0xba47('0x23')](function(_0x2cdf99){if(_0x2cdf99){return _0x2cdf99[_0xba47('0x70')](_0x248543['query'][_0xba47('0x6b')]);}})[_0xba47('0x23')](respondWithStatusCode(_0x29332b,null))['catch'](handleError(_0x29332b,null));};exports['notify']=function(_0x36311b,_0x408f7d,_0x42f9a1){var _0x40c5b9={'channel':_0xba47('0x71')};var _0x1681a3=[];var _0x17ee48=[];var _0x2eda63={};return db['SmsAccount'][_0xba47('0x5c')]({'where':{'id':_0x36311b[_0xba47('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xba47('0x72')}]})['then'](handleEntityNotFound(_0x408f7d,null))['then'](function(_0x4a40e1){_0x40c5b9[_0xba47('0x73')]=_0x4a40e1;_0x40c5b9[_0xba47('0x74')]=_[_0xba47('0x75')](_0x4a40e1['Applications'],[_0xba47('0x76')],[_0xba47('0x77')]);if(_0x40c5b9[_0xba47('0x73')][_0xba47('0x72')]){delete _0x40c5b9['account']['Applications'];}return db[_0xba47('0x78')][_0xba47('0x66')]();})['then'](function(_0x1087d5){if(!_0x1087d5){throw new db['Sequelize'][(_0xba47('0x79'))](_0xba47('0x7a'));}_0x1681a3=_[_0xba47('0x7b')](_['keys'](_0x1087d5),['createdAt',_0xba47('0x7c')]);_0x17ee48=_[_0xba47('0x7b')](_[_0xba47('0x57')](_0x1087d5),[_0xba47('0x7d'),_0xba47('0x7c'),_0xba47('0x7e'),_0xba47('0x7f')]);_0x40c5b9[_0xba47('0x5e')]={'mapKey':_0xba47('0x80')};if(_0x40c5b9[_0xba47('0x73')][_0xba47('0x3f')]){switch(_0x40c5b9[_0xba47('0x73')][_0xba47('0x3f')]){case _0xba47('0x81'):_0x40c5b9[_0xba47('0x5e')]['from']=_0x36311b['body']['From'];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x82')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x84')];break;case _0xba47('0x85'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]='+'+_0x36311b[_0xba47('0x5e')][_0xba47('0x87')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]=_0x36311b['body'][_0xba47('0x88')];break;case'connectel':_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x86')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]=_0x36311b[_0xba47('0x5e')]['message'];break;case _0xba47('0x89'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x86')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x5e')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x8a')];break;case _0xba47('0x8b'):_0x40c5b9[_0xba47('0x5e')]['from']=_0x36311b[_0xba47('0x5e')]['From'];_0x40c5b9[_0xba47('0x5e')]['body']=_0x36311b[_0xba47('0x5e')][_0xba47('0x8c')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x8d')];break;case _0xba47('0x8e'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]='+'+_0x36311b[_0xba47('0x5e')][_0xba47('0x8f')][0x0][_0xba47('0x86')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x8f')][0x0][_0xba47('0x88')];_0x40c5b9['body'][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')]['results'][0x0][_0xba47('0x83')];break;case _0xba47('0x90'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x91')];_0x40c5b9['body'][_0xba47('0x5e')]=_0x36311b['body'][_0xba47('0x92')][_0xba47('0x29')];break;case _0xba47('0x93'):_0x40c5b9['body'][_0xba47('0x86')]=_0x36311b['body']['fromNumber'];_0x40c5b9['body']['body']=_0x36311b['body']['text'];_0x40c5b9[_0xba47('0x5e')]['messageId']=_0x36311b[_0xba47('0x5e')][_0xba47('0x94')];break;case _0xba47('0x95'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')][0x0]['message']['id'];_0x40c5b9[_0xba47('0x5e')]['from']=_0x36311b['body'][0x0]['message'][_0xba47('0x86')];_0x40c5b9['body'][_0xba47('0x5e')]=_0x36311b[_0xba47('0x5e')][0x0][_0xba47('0x29')][_0xba47('0x88')];break;case _0xba47('0x96'):_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')]=_0x36311b['body'][_0xba47('0x86')];_0x40c5b9[_0xba47('0x5e')]['body']=_0x36311b['body'][_0xba47('0x29')];_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')]=_0x36311b[_0xba47('0x5e')][_0xba47('0x97')];break;}}if(_0x40c5b9[_0xba47('0x5e')]['id']){delete _0x40c5b9[_0xba47('0x5e')]['id'];}if(_[_0xba47('0x98')](_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xba47('0x98')](_0x40c5b9[_0xba47('0x5e')]['body'])||_0x40c5b9[_0xba47('0x5e')][_0xba47('0x5e')]===''){throw new db['Sequelize']['ValidationError'](_0xba47('0x99'));}if(_[_0xba47('0x98')](_0x40c5b9[_0xba47('0x5e')][_0xba47('0x9a')])){throw new db[(_0xba47('0x9b'))][(_0xba47('0x79'))](_0xba47('0x9c')+_0x17ee48);}if(!_[_0xba47('0x9d')](_0x17ee48,_0x40c5b9[_0xba47('0x5e')][_0xba47('0x9a')])){throw new db[(_0xba47('0x9b'))][(_0xba47('0x79'))](_0xba47('0x9e')+_0x17ee48);}_0x2eda63[_0x40c5b9[_0xba47('0x5e')][_0xba47('0x9a')]]=_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')];return db[_0xba47('0x9f')][_0xba47('0x5c')]({'where':{'id':_0x40c5b9[_0xba47('0x73')]['ListId']},'include':[{'model':db[_0xba47('0x78')],'as':_0xba47('0xa0'),'where':_0x2eda63,'limit':0x1,'order':[[_0xba47('0x7c'),_0xba47('0xa1')]]}]});})['then'](handleEntityNotFound(_0x408f7d,null))[_0xba47('0x23')](function(_0x330d7d){if(_0x330d7d){_0x40c5b9['list']=_[_0xba47('0xa2')](_0x330d7d,[_0xba47('0xa0')]);if(_0x330d7d['Contacts'][_0xba47('0x46')]){return _0x330d7d['Contacts'][0x0];}var _0x210093=_[_0xba47('0x1c')](_0x40c5b9[_0xba47('0x5e')],{'firstName':_0x40c5b9['body'][_0xba47('0x86')],'ListId':_0x330d7d['id']});_0x210093[_0x40c5b9['body'][_0xba47('0x9a')]]=_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')];return db['CmContact'][_0xba47('0x5d')](_0x210093,{'fields':_0x1681a3,'raw':!![]});}})[_0xba47('0x23')](handleEntityNotFound(_0x408f7d,null))[_0xba47('0x23')](function(_0x37253a){if(_0x37253a){_0x40c5b9[_0xba47('0xa3')]=_0x37253a;var _0x255e78={'ContactId':_0x37253a['id'],'phone':_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')],'SmsAccountId':_0x36311b[_0xba47('0x55')]['id']};var _0x3e0460={'ContactId':_0x37253a['id'],'SmsAccountId':_0x36311b[_0xba47('0x55')]['id'],'closed':![]};return db['SmsInteraction'][_0xba47('0x5c')]({'where':_0x3e0460})['then'](function(_0x1fb80c){if(_0x1fb80c){return[_0x1fb80c,![]];}return db[_0xba47('0xa4')][_0xba47('0x5d')](_0x255e78)[_0xba47('0x23')](function(_0x5c6fc9){return[_0x5c6fc9,!![]];});});}})[_0xba47('0xa5')](function(_0x23ac49,_0x5ff143){_0x40c5b9[_0xba47('0xa6')]=_0x23ac49[_0xba47('0x60')]({'plain':!![]});_0x40c5b9[_0xba47('0xa6')][_0xba47('0xa7')]=![];if(_0x5ff143){if(_0x40c5b9[_0xba47('0x73')][_0xba47('0xa8')]){_0x40c5b9[_0xba47('0x74')][_0xba47('0xa9')]({'id':0x0,'priority':_0x40c5b9[_0xba47('0x74')][_0xba47('0x46')]+0x1,'app':_0xba47('0xaa'),'appdata':_0xba47('0xab'),'interval':_0xba47('0xac')});}_0x40c5b9['interaction'][_0xba47('0xa7')]=!![];}return db[_0xba47('0xad')][_0xba47('0x5d')]({'phone':_0x40c5b9[_0xba47('0x5e')][_0xba47('0x86')],'messageId':_0x40c5b9[_0xba47('0x5e')][_0xba47('0x83')],'body':_0x40c5b9[_0xba47('0x5e')]['body'],'SmsAccountId':_0x36311b[_0xba47('0x55')]['id'],'SmsInteractionId':_0x23ac49['id'],'direction':'in','ContactId':_0x23ac49[_0xba47('0xae')],'AttachmentId':_0x40c5b9[_0xba47('0x5e')][_0xba47('0xaf')]});})[_0xba47('0x23')](function(_0xd7be8b){_0x40c5b9[_0xba47('0x29')]=_0xd7be8b;if(_0x40c5b9['interaction'][_0xba47('0xb0')]){return db[_0xba47('0xb1')][_0xba47('0x5c')]({'attributes':['id',_0xba47('0x39')],'where':{'id':_0x40c5b9[_0xba47('0xa6')]['UserId']}})[_0xba47('0x23')](function(_0x264e64){if(_0x264e64){_0x40c5b9['applications'][_0xba47('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x264e64[_0xba47('0x39')]+','+(_0x40c5b9[_0xba47('0x73')][_0xba47('0xb3')]||0xa),'interval':_0xba47('0xac')});}return respondWithRpcPromise('Start','startRouting',_0x40c5b9);});}return respondWithRpcPromise(_0xba47('0xb4'),_0xba47('0xb5'),_0x40c5b9);})[_0xba47('0x23')](function(_0x25e31e){if(_0x25e31e){var _0x49624=0xc8;var _0xb3cc80=_0xba47('0xb6');logger[_0xba47('0x24')](_0xba47('0xb7'),_0xb3cc80,_0x49624,'entity\x20found');logger[_0xba47('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xb3cc80,_0x49624,'entity\x20found',JSON['stringify'](_0x25e31e));if(_0x40c5b9['account']['type']===_0xba47('0x81')){return _0x408f7d[_0xba47('0x2b')](_0x49624)[_0xba47('0x31')](_0xba47('0xb8'),_0xba47('0xb9'))[_0xba47('0x3a')](_0xba47('0xba'));}else{return _0x408f7d[_0xba47('0x2b')](_0x49624)[_0xba47('0x2d')](_0x25e31e);}}})[_0xba47('0x53')](handleError(_0x408f7d,null));};exports[_0xba47('0xbb')]=function(_0x1c25db,_0x3e6bbe){var _0x1254b4=_0x1c25db['params']['id'];var _0x58fbaa=_0x1c25db[_0xba47('0x5e')];var _0x50edf0=0xc8;var _0x4cbfac=null;return db[_0xba47('0xbc')][_0xba47('0xbd')]({'isolationLevel':db[_0xba47('0xbc')][_0xba47('0xbe')][_0xba47('0xbf')][_0xba47('0xc0')]},function(_0x29d1d7){return db[_0xba47('0x3e')][_0xba47('0x6f')]({'where':{'id':_0x1254b4},'transaction':_0x29d1d7})[_0xba47('0x23')](function(_0x399df4){if(_0x399df4){return db['SmsApplication'][_0xba47('0x35')]({'where':{'SmsAccountId':_0x1254b4},'transaction':_0x29d1d7})[_0xba47('0x23')](function(){var _0x3f7fc9=_[_0xba47('0x3d')](_0x58fbaa,function(_0x1f457f){_0x1f457f[_0xba47('0x67')]=_0x1254b4;return _0x1f457f;});return db['SmsApplication'][_0xba47('0xc1')](_0x3f7fc9,{'transaction':_0x29d1d7});});}else{_0x50edf0=0x194;_0x4cbfac=[];}});})[_0xba47('0x23')](function(){if(_0x50edf0!==0x194){return db[_0xba47('0xc2')][_0xba47('0xc3')]({'where':{'SmsAccountId':_0x1254b4},'order':_0xba47('0x76')})[_0xba47('0x23')](function(_0x15f24d){_0x4cbfac=_0x15f24d;});}})[_0xba47('0x53')](function(_0x1615d4){_0x50edf0=0x1f4;logger[_0xba47('0x28')](_0x1615d4['stack']);if(_0x1615d4[_0xba47('0x39')]){delete _0x1615d4[_0xba47('0x39')];}_0x4cbfac=_0x1615d4;})[_0xba47('0xc4')](function(){if(_0x4cbfac===null){_0x3e6bbe['sendStatus'](_0x50edf0);}else{if(_0x50edf0===0x1f4){_0x3e6bbe[_0xba47('0x2b')](_0x50edf0)[_0xba47('0x3a')](_0x4cbfac);}else{_0x3e6bbe['status'](_0x50edf0)[_0xba47('0x2d')](_0x4cbfac);}}});};exports[_0xba47('0xc5')]=function(_0x441362,_0x2e917d,_0x5ff23f){var _0x3448b1={};var _0x3b8845={};var _0x4291cb;var _0x914709;return db[_0xba47('0x3e')][_0xba47('0x6f')]({'where':{'id':_0x441362[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x2e917d,null))[_0xba47('0x23')](function(_0x275666){if(_0x275666){_0x4291cb=_0x275666;_0x3b8845[_0xba47('0x41')]=_[_0xba47('0x57')](db['SmsApplication'][_0xba47('0x58')]);_0x3b8845[_0xba47('0x42')]=_[_0xba47('0x57')](_0x441362[_0xba47('0x42')]);_0x3b8845[_0xba47('0x43')]=_['intersection'](_0x3b8845['model'],_0x3b8845[_0xba47('0x42')]);_0x3448b1[_0xba47('0x45')]=_[_0xba47('0x59')](_0x3b8845[_0xba47('0x41')],qs[_0xba47('0x44')](_0x441362[_0xba47('0x42')][_0xba47('0x44')]));_0x3448b1['attributes']=_0x3448b1[_0xba47('0x45')][_0xba47('0x46')]?_0x3448b1['attributes']:_0x3b8845['model'];_0x3448b1[_0xba47('0x4a')]=qs['sort'](_0x441362[_0xba47('0x42')][_0xba47('0x4b')]);_0x3448b1[_0xba47('0x4d')]=qs[_0xba47('0x43')](_['pick'](_0x441362[_0xba47('0x42')],_0x3b8845[_0xba47('0x43')]));if(_0x441362[_0xba47('0x42')][_0xba47('0x4f')]){_0x3448b1['where']=_[_0xba47('0x4e')](_0x3448b1[_0xba47('0x4d')],{'$or':_[_0xba47('0x3d')](_0x3448b1[_0xba47('0x45')],function(_0x281f06){var _0x11080c={};_0x11080c[_0x281f06]={'$like':'%'+_0x441362[_0xba47('0x42')][_0xba47('0x4f')]+'%'};return _0x11080c;})});}_0x3448b1=_['merge']({},_0x3448b1,_0x441362[_0xba47('0x50')]);return _0x4291cb['getApplications'](_0x3448b1);}})['then'](function(_0x56f6b7){if(_0x56f6b7){_0x914709=_0x56f6b7[_0xba47('0x46')];if(!_0x441362[_0xba47('0x42')]['hasOwnProperty'](_0xba47('0x48'))){_0x3448b1['limit']=qs[_0xba47('0x49')](_0x441362[_0xba47('0x42')][_0xba47('0x49')]);_0x3448b1[_0xba47('0x30')]=qs[_0xba47('0x30')](_0x441362[_0xba47('0x42')]['offset']);}return _0x4291cb[_0xba47('0xc5')](_0x3448b1);}})['then'](function(_0xaf7e93){if(_0xaf7e93){return _0xaf7e93?{'count':_0x914709,'rows':_0xaf7e93}:null;}})['then'](respondWithResult(_0x2e917d,null))[_0xba47('0x53')](handleError(_0x2e917d,null));};exports[_0xba47('0xc6')]=function(_0x5b8ca7,_0x3ccd96,_0x224b24){var _0x26686b={'raw':![],'where':{}};var _0x746ddd={};var _0x296484={'count':0x0,'rows':[]};return db[_0xba47('0x3e')][_0xba47('0x6f')]({'where':{'id':_0x5b8ca7['params']['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x3ccd96,null))[_0xba47('0x23')](function(_0x380772){if(_0x380772){_0x746ddd[_0xba47('0x41')]=_['keys'](db[_0xba47('0xa4')][_0xba47('0x58')]);_0x746ddd['query']=_[_0xba47('0x57')](_0x5b8ca7['query']);_0x746ddd['filters']=_[_0xba47('0x59')](_0x746ddd['model'],_0x746ddd['query']);_0x26686b[_0xba47('0x45')]=_[_0xba47('0x59')](_0x746ddd[_0xba47('0x41')],qs['fields'](_0x5b8ca7[_0xba47('0x42')][_0xba47('0x44')]));_0x26686b['attributes']=_0x26686b[_0xba47('0x45')][_0xba47('0x46')]?_0x26686b['attributes']:_0x746ddd['model'];if(!_0x5b8ca7['query']['hasOwnProperty']('nolimit')){_0x26686b['limit']=qs[_0xba47('0x49')](_0x5b8ca7[_0xba47('0x42')][_0xba47('0x49')]);_0x26686b[_0xba47('0x30')]=qs['offset'](_0x5b8ca7[_0xba47('0x42')][_0xba47('0x30')]);}_0x26686b[_0xba47('0x4a')]=qs[_0xba47('0x4b')](_0x5b8ca7[_0xba47('0x42')]['sort']);_0x26686b[_0xba47('0x4d')]=qs[_0xba47('0x43')](_[_0xba47('0x4c')](_0x5b8ca7['query'],_0x746ddd[_0xba47('0x43')]));_0x26686b[_0xba47('0x4d')][_0xba47('0x67')]=_0x380772['id'];if(_0x5b8ca7[_0xba47('0x42')][_0xba47('0x4f')]){_0x26686b[_0xba47('0x4d')]=_['merge'](_0x26686b['where'],{'$or':_['map'](_0x26686b[_0xba47('0x45')],function(_0x4a5eea){var _0x24e78b={};_0x24e78b[_0x4a5eea]={'$like':'%'+_0x5b8ca7[_0xba47('0x42')][_0xba47('0x4f')]+'%'};return _0x24e78b;})});}_0x26686b=_['merge']({},_0x26686b,_0x5b8ca7[_0xba47('0x50')]);return db[_0xba47('0xa4')]['count']({'where':_0x26686b[_0xba47('0x4d')]})['then'](function(_0x29cc8f){_0x296484['count']=_0x29cc8f;if(_0x5b8ca7[_0xba47('0x42')][_0xba47('0x5a')]){_0x26686b['include']=[{'model':db[_0xba47('0x78')],'as':_0xba47('0xc7'),'required':![]},{'model':db[_0xba47('0xb1')],'as':_0xba47('0xc8'),'attributes':[_0xba47('0x39'),_0xba47('0xc9'),'internal'],'required':![]},{'model':db[_0xba47('0xca')],'as':'Tags','attributes':['id','name',_0xba47('0xcb')],'where':_0x5b8ca7['query']['tag']?{'id':_0x5b8ca7[_0xba47('0x42')]['tag']}:undefined,'required':_0x5b8ca7['query']['tag']?!![]:![]}];}return db['SmsInteraction'][_0xba47('0x51')](_0x26686b);})[_0xba47('0x23')](function(_0x4906b1){_0x296484[_0xba47('0x52')]=_0x4906b1;return _0x296484;});}})[_0xba47('0x23')](respondWithFilteredResult(_0x3ccd96,_0x26686b))['catch'](handleError(_0x3ccd96,null));};exports[_0xba47('0x3a')]=function(_0x5890e2,_0xe8d74a,_0xebeafe){var _0x25b7b4,_0x38edde,_0x553a44;if(_[_0xba47('0x98')](_0x5890e2[_0xba47('0x5e')][_0xba47('0x5e')])||_0x5890e2[_0xba47('0x5e')]['body']===''){throw new db[(_0xba47('0x9b'))][(_0xba47('0x79'))](_0xba47('0x99'));}if(_[_0xba47('0x98')](_0x5890e2[_0xba47('0x5e')]['to'])){throw new db[(_0xba47('0x9b'))]['ValidationError'](_0xba47('0xcc'));}_0x25b7b4=_0x5890e2[_0xba47('0x5e')]['to'];return db[_0xba47('0x3e')]['find']({'where':{'id':_0x5890e2[_0xba47('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xba47('0x78')],'as':_0xba47('0xa0'),'where':{'mobile':_0x25b7b4},'limit':0x1,'order':[[_0xba47('0x7c'),_0xba47('0xa1')]]}]}]})[_0xba47('0x23')](handleEntityNotFound(_0xe8d74a,null))[_0xba47('0x23')](function(_0x346174){if(_0x346174&&_0x346174[_0xba47('0xcd')]){_0x38edde=_0x346174['get']({'plain':!![]});if(_0x38edde[_0xba47('0xcd')]&&_0x38edde[_0xba47('0xcd')][_0xba47('0xa0')]['length']){return _0x38edde[_0xba47('0xcd')][_0xba47('0xa0')][0x0];}return db['CmContact'][_0xba47('0x5d')](_[_0xba47('0x1c')](_0x5890e2[_0xba47('0x5e')],{'firstName':_0x25b7b4,'mobile':_0x25b7b4,'phone':_0x25b7b4,'ListId':_0x38edde[_0xba47('0x7f')]}));}})[_0xba47('0x23')](handleEntityNotFound(_0xe8d74a,null))['then'](function(_0x466a17){if(_0x466a17){_0x553a44=_0x466a17;return db[_0xba47('0xa4')][_0xba47('0x5c')]({'where':{'ContactId':_0x553a44['id'],'closed':![],'SmsAccountId':_0x38edde['id']}})[_0xba47('0x23')](function(_0x1ecb09){if(_0x1ecb09){return[_0x1ecb09,![]];}return db['SmsInteraction'][_0xba47('0x5d')]({'UserId':_0x5890e2[_0xba47('0x5f')]['id'],'ContactId':_0x553a44['id'],'SmsAccountId':_0x38edde['id'],'phone':_0x25b7b4,'firstMsgDirection':_0xba47('0xce'),'Messages':[_['merge'](_0x5890e2['body'],{'read':![],'body':_0x5890e2[_0xba47('0x5e')]['body'],'phone':_0x25b7b4,'SmsAccountId':_0x38edde['id'],'UserId':_0x5890e2['user']['id'],'ContactId':_0x553a44['id']})]},{'include':[{'model':db[_0xba47('0xad')],'as':_0xba47('0xcf')}]})['then'](function(_0x1b5860){return[_0x1b5860,!![]];});});}})[_0xba47('0xa5')](function(_0xeaf0cf,_0x3b7884){if(_0x3b7884){return _0xeaf0cf;}return db['SmsMessage'][_0xba47('0x5d')](_[_0xba47('0x4e')](_0x5890e2[_0xba47('0x5e')],{'read':![],'body':_0x5890e2[_0xba47('0x5e')][_0xba47('0x5e')],'phone':_0x25b7b4,'SmsAccountId':_0x38edde['id'],'SmsInteractionId':_0xeaf0cf['id'],'UserId':_0x5890e2[_0xba47('0x5f')]['id'],'ContactId':_0x553a44['id']}))[_0xba47('0x23')](function(_0x56099b){_0xeaf0cf[_0xba47('0xd0')][_0xba47('0xcf')]=[];_0xeaf0cf[_0xba47('0xd0')][_0xba47('0xcf')]['push'](_0x56099b[_0xba47('0xd0')]);return _0xeaf0cf;});})[_0xba47('0x23')](respondWithResult(_0xe8d74a,null))[_0xba47('0x53')](handleError(_0xe8d74a,null));};exports[_0xba47('0x2b')]=function(_0x2bccde,_0x4c2967,_0x114fb3){if(_0x2bccde[_0xba47('0x5e')]['id']){delete _0x2bccde['body']['id'];}var _0x4da581,_0x1480bd,_0x3f67bd;return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x2bccde['params']['id']}})['then'](handleEntityNotFound(_0x4c2967,null))[_0xba47('0x23')](function(_0x1f3759){if(_0x1f3759){_0x3f67bd=_0x1f3759;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xba47('0x2b'),'received\x20delivery\x20report\x20from',_0x1f3759[_0xba47('0x3f')],util[_0xba47('0xd1')](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));switch(_0x1f3759[_0xba47('0x3f')]){case _0xba47('0x85'):if(_0x2bccde[_0xba47('0x5e')][_0xba47('0xd2')]&&_0x2bccde[_0xba47('0x5e')][_0xba47('0x2b')]){_0x1480bd=_0x2bccde[_0xba47('0x5e')]['status'];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')]['skebby_dispatch_id']}});}break;case _0xba47('0xd3'):if(_0x2bccde[_0xba47('0x5e')][_0xba47('0xd4')]&&_0x2bccde[_0xba47('0x5e')]['statusInt']){_0x1480bd=_0x2bccde[_0xba47('0x5e')]['statusInt'];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')]['requestid']}});}break;case _0xba47('0x89'):if(_0x2bccde[_0xba47('0x5e')][_0xba47('0x8a')]&&_0x2bccde[_0xba47('0x5e')][_0xba47('0xd5')]){_0x1480bd=_0x2bccde[_0xba47('0x5e')]['status_code'];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')]['message_id']}});}break;case _0xba47('0x8e'):var _0x12c611=_0x2bccde[_0xba47('0x5e')][_0xba47('0x8f')][0x0];if(_0x12c611[_0xba47('0x83')]&&_0x12c611[_0xba47('0x2b')][_0xba47('0xd6')]==='DELIVERED'){_0x1480bd=_0x12c611[_0xba47('0x2b')]['groupName'];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x12c611[_0xba47('0x83')]}});}break;case _0xba47('0x93'):if(_0x2bccde['body'][_0xba47('0x83')]&&_0x2bccde['body']['status']){_0x1480bd=_0x2bccde[_0xba47('0x5e')][_0xba47('0x2b')];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')][_0xba47('0x83')]}});}break;case _0xba47('0x95'):if(_0x2bccde['body'][0x0][_0xba47('0x29')]['id']){_0x1480bd=_0x2bccde[_0xba47('0x5e')][0x0][_0xba47('0x3f')];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')][0x0][_0xba47('0x29')]['id']}});}break;case _0xba47('0x96'):if(_0x2bccde[_0xba47('0x5e')][_0xba47('0xd7')]&&_0x2bccde[_0xba47('0x5e')][_0xba47('0x2b')]){_0x1480bd=_0x2bccde[_0xba47('0x5e')][_0xba47('0x2b')];return db['SmsMessage'][_0xba47('0x5c')]({'where':{'messageId':_0x2bccde[_0xba47('0x5e')][_0xba47('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x4c2967,null))[_0xba47('0x23')](function(_0x2b712e){if(_0x2b712e){_0x4da581=_0x2b712e;switch(_0x3f67bd[_0xba47('0x3f')]){case _0xba47('0x85'):if(_0x1480bd==='DELIVERED'){return _0x4da581['update']({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),'status',_0xba47('0x85'),util['inspect'](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xba47('0xd3'):if(_0x1480bd==='1'){return _0x4da581[_0xba47('0x34')]({'read':!![]});}else{logger['error'](_0xba47('0xb7'),_0xba47('0x2b'),_0xba47('0x85'),util[_0xba47('0xd1')](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2bccde[_0xba47('0x5e')]['error_code']&&_0x1480bd>=0xc8&&_0x1480bd<=0xce){return _0x4da581['update']({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),_0xba47('0x2b'),'clicksend',util[_0xba47('0xd1')](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xba47('0x8e'):var _0x15bb01=_0x2bccde[_0xba47('0x5e')][_0xba47('0x8f')][0x0];if(_0x15bb01['status'][_0xba47('0xd6')]===_0xba47('0xd8')){return _0x4da581[_0xba47('0x34')]({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),_0xba47('0x2b'),_0xba47('0x8e'),util[_0xba47('0xd1')](_0x2bccde['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x1480bd=='DELIVERED_TO_GATEWAY'||_0x1480bd=='RECEIVED_BY_RECIPIENT'){return _0x4da581[_0xba47('0x34')]({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),_0xba47('0x2b'),_0xba47('0x93'),util['inspect'](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xba47('0x95'):if(_0x1480bd=='message-delivered'){return _0x4da581[_0xba47('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xba47('0x2b'),_0xba47('0x95'),util[_0xba47('0xd1')](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1480bd===_0xba47('0xd9')||_0x1480bd===_0xba47('0xda')){return _0x4da581[_0xba47('0x34')]({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),'status',_0xba47('0x96'),util[_0xba47('0xd1')](_0x2bccde[_0xba47('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x4da581;}})['then'](respondWithResult(_0x4c2967,null))['catch'](handleError(_0x4c2967,null));};exports[_0xba47('0xdb')]=function(_0x863849,_0x34d8bc,_0x40fc17){var _0x2a2314,_0x366d8b,_0x49ce80;return db['SmsAccount'][_0xba47('0x5c')]({'where':{'id':_0x863849['params']['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x34d8bc,null))[_0xba47('0x23')](function(_0x3ee661){if(_0x3ee661){_0x49ce80=_0x3ee661;logger[_0xba47('0x27')](_0xba47('0xb7'),_0xba47('0x2b'),'received\x20delivery\x20report\x20from',_0x3ee661[_0xba47('0x3f')],util[_0xba47('0xd1')](_0x863849[_0xba47('0x42')],{'showHidden':![],'depth':null}));switch(_0x3ee661[_0xba47('0x3f')]){case _0xba47('0x90'):if(_0x863849['query']['message-id']&&_0x863849[_0xba47('0x42')][_0xba47('0xdc')]){_0x366d8b=_0x863849[_0xba47('0x42')][_0xba47('0xdc')];return db[_0xba47('0xad')][_0xba47('0x5c')]({'where':{'messageId':_0x863849[_0xba47('0x42')][_0xba47('0xdd')]}});}break;}}})[_0xba47('0x23')](handleEntityNotFound(_0x34d8bc,null))['then'](function(_0xe76ab1){if(_0xe76ab1){_0x2a2314=_0xe76ab1;switch(_0x49ce80[_0xba47('0x3f')]){case _0xba47('0x90'):if(_0x366d8b==='2'||_0x366d8b==='6'){return _0x2a2314[_0xba47('0x34')]({'read':!![]});}else{logger[_0xba47('0x28')](_0xba47('0xb7'),'status',_0xba47('0x90'),util[_0xba47('0xd1')](_0x863849[_0xba47('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x2a2314;}})[_0xba47('0x23')](respondWithResult(_0x34d8bc,null))[_0xba47('0x53')](handleError(_0x34d8bc,null));};exports['addAgents']=function(_0x59b2e8,_0x4446d7,_0x5b7111){return db['SmsAccount'][_0xba47('0x5c')]({'where':{'id':_0x59b2e8[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x4446d7,null))[_0xba47('0x23')](function(_0x3bd83d){if(_0x3bd83d){return _0x3bd83d[_0xba47('0xde')](_0x59b2e8[_0xba47('0x5e')]['ids'],_[_0xba47('0xa2')](_0x59b2e8[_0xba47('0x5e')],[_0xba47('0x6b'),'id'])||{})[_0xba47('0xa5')](function(_0x5dcac3){for(var _0x1beaec=0x0;_0x1beaec<_0x59b2e8[_0xba47('0x5e')]['ids'][_0xba47('0x46')];_0x1beaec+=0x1){socket[_0xba47('0xdf')](_0xba47('0xe0'),{'UserId':Number(_0x59b2e8['body'][_0xba47('0x6b')][_0x1beaec]),'SmsAccountId':Number(_0x59b2e8[_0xba47('0x55')]['id'])});}return _0x5dcac3;});}})['then'](respondWithResult(_0x4446d7,null))[_0xba47('0x53')](handleError(_0x4446d7,null));};exports[_0xba47('0xe1')]=function(_0x4b022f,_0x1f698f,_0x49a310){return db[_0xba47('0x3e')][_0xba47('0x5c')]({'where':{'id':_0x4b022f[_0xba47('0x55')]['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x1f698f,null))[_0xba47('0x23')](function(_0x41dd9e){if(_0x41dd9e){return _0x41dd9e['removeAgents'](_0x4b022f[_0xba47('0x42')]['ids'])[_0xba47('0x23')](function(){if(_[_0xba47('0xe2')](_0x4b022f[_0xba47('0x42')][_0xba47('0x6b')])){for(var _0x3c3a8a=0x0;_0x3c3a8a<_0x4b022f[_0xba47('0x42')][_0xba47('0x6b')]['length'];_0x3c3a8a+=0x1){socket[_0xba47('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x4b022f[_0xba47('0x42')]['ids'][_0x3c3a8a]),'SmsAccountId':Number(_0x4b022f[_0xba47('0x55')]['id'])});}}else{socket[_0xba47('0xdf')](_0xba47('0xe3'),{'UserId':Number(_0x4b022f[_0xba47('0x42')][_0xba47('0x6b')]),'SmsAccountId':Number(_0x4b022f[_0xba47('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f698f,null))[_0xba47('0x53')](handleError(_0x1f698f,null));};exports[_0xba47('0xe4')]=function(_0x311192,_0x3b0982,_0x48ecc7){var _0x29eae9={};var _0x444ff9={};var _0x26413d;var _0x29aeec;return db['SmsAccount'][_0xba47('0x6f')]({'where':{'id':_0x311192['params']['id']}})[_0xba47('0x23')](handleEntityNotFound(_0x3b0982,null))[_0xba47('0x23')](function(_0x2dcbe4){if(_0x2dcbe4){_0x26413d=_0x2dcbe4;_0x444ff9[_0xba47('0x41')]=_[_0xba47('0x57')](db[_0xba47('0xb1')][_0xba47('0x58')]);_0x444ff9[_0xba47('0x42')]=_['keys'](_0x311192[_0xba47('0x42')]);_0x444ff9[_0xba47('0x43')]=_[_0xba47('0x59')](_0x444ff9[_0xba47('0x41')],_0x444ff9[_0xba47('0x42')]);_0x29eae9[_0xba47('0x45')]=_[_0xba47('0x59')](_0x444ff9[_0xba47('0x41')],qs['fields'](_0x311192['query'][_0xba47('0x44')]));_0x29eae9['attributes']=_0x29eae9[_0xba47('0x45')][_0xba47('0x46')]?_0x29eae9[_0xba47('0x45')]:_0x444ff9[_0xba47('0x41')];_0x29eae9['order']=qs[_0xba47('0x4b')](_0x311192['query'][_0xba47('0x4b')]);_0x29eae9[_0xba47('0x4d')]=qs[_0xba47('0x43')](_[_0xba47('0x4c')](_0x311192[_0xba47('0x42')],_0x444ff9[_0xba47('0x43')]));if(_0x311192['query'][_0xba47('0x4f')]){_0x29eae9[_0xba47('0x4d')]=_[_0xba47('0x4e')](_0x29eae9[_0xba47('0x4d')],{'$or':_[_0xba47('0x3d')](_0x29eae9[_0xba47('0x45')],function(_0xa658a2){var _0x1cd089={};_0x1cd089[_0xa658a2]={'$like':'%'+_0x311192[_0xba47('0x42')][_0xba47('0x4f')]+'%'};return _0x1cd089;})});}_0x29eae9=_[_0xba47('0x4e')]({},_0x29eae9,_0x311192[_0xba47('0x50')]);return _0x26413d[_0xba47('0xe4')](_0x29eae9);}})[_0xba47('0x23')](function(_0x1cca07){if(_0x1cca07){_0x29aeec=_0x1cca07[_0xba47('0x46')];if(!_0x311192[_0xba47('0x42')][_0xba47('0x47')]('nolimit')){_0x29eae9[_0xba47('0x49')]=qs[_0xba47('0x49')](_0x311192[_0xba47('0x42')][_0xba47('0x49')]);_0x29eae9['offset']=qs[_0xba47('0x30')](_0x311192[_0xba47('0x42')][_0xba47('0x30')]);}return _0x26413d[_0xba47('0xe4')](_0x29eae9);}})[_0xba47('0x23')](function(_0xe7082){if(_0xe7082){return _0xe7082?{'count':_0x29aeec,'rows':_0xe7082}:null;}})['then'](respondWithResult(_0x3b0982,null))['catch'](handleError(_0x3b0982,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ef7507b..40927ed 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 _0x75ce=['hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x75ce,0xd4));var _0xe75c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x75ce[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xe75c('0x0'));var SmsAccount=require(_0xe75c('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe75c('0x2'),'afterUpdate':_0xe75c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23b06c){return function(_0x2117fd,_0x3bd5f0,_0x4644d8){SmsAccountEvents[_0xe75c('0x4')](_0x23b06c+':'+_0x2117fd['id'],_0x2117fd);SmsAccountEvents[_0xe75c('0x4')](_0x23b06c,_0x2117fd);_0x4644d8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe75c('0x5')](e,emitEvent(event));}}module[_0xe75c('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x05e2=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1e750c,_0xb21735){var _0x1f756a=function(_0x415b82){while(--_0x415b82){_0x1e750c['push'](_0x1e750c['shift']());}};_0x1f756a(++_0xb21735);}(_0x05e2,0xea));var _0x205e=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0x05e2[_0x158e3b];return _0x551a1d;};'use strict';var EventEmitter=require(_0x205e('0x0'));var SmsAccount=require(_0x205e('0x1'))['db'][_0x205e('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x205e('0x3')](0x0);var events={'afterCreate':_0x205e('0x4'),'afterUpdate':_0x205e('0x5'),'afterDestroy':_0x205e('0x6')};function emitEvent(_0x276eb1){return function(_0x4f23d6,_0x4b3d66,_0x1accf5){SmsAccountEvents[_0x205e('0x7')](_0x276eb1+':'+_0x4f23d6['id'],_0x4f23d6);SmsAccountEvents[_0x205e('0x7')](_0x276eb1,_0x4f23d6);_0x1accf5(null);};}for(var e in events){if(events[_0x205e('0x8')](e)){var event=events[e];SmsAccount[_0x205e('0x9')](e,emitEvent(event));}}module[_0x205e('0xa')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 48372aa..9f9189f 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 _0xabdd=['api','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xabdd,0x19c));var _0xdabd=function(_0x3cc967,_0x1732c0){_0x3cc967=_0x3cc967-0x0;var _0x344fcb=_0xabdd[_0x3cc967];return _0x344fcb;};'use strict';var _=require('lodash');var util=require(_0xdabd('0x0'));var logger=require(_0xdabd('0x1'))(_0xdabd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdabd('0x3'));var fs=require('fs');var path=require(_0xdabd('0x4'));var rimraf=require(_0xdabd('0x5'));var config=require(_0xdabd('0x6'));var attributes=require('./smsAccount.attributes');module[_0xdabd('0x7')]=function(_0x1131c0,_0x2ac46a){return _0x1131c0[_0xdabd('0x8')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5563=['sms_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','SmsAccount'];(function(_0x47c268,_0x2c3ab9){var _0x3a3e70=function(_0x32650c){while(--_0x32650c){_0x47c268['push'](_0x47c268['shift']());}};_0x3a3e70(++_0x2c3ab9);}(_0x5563,0x1cf));var _0x3556=function(_0x390c7c,_0x1dce97){_0x390c7c=_0x390c7c-0x0;var _0x42daae=_0x5563[_0x390c7c];return _0x42daae;};'use strict';var _=require(_0x3556('0x0'));var util=require('util');var logger=require(_0x3556('0x1'))(_0x3556('0x2'));var moment=require(_0x3556('0x3'));var BPromise=require(_0x3556('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3556('0x5'));var rimraf=require(_0x3556('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x3556('0x7')]=function(_0x5b9da5,_0x4159d4){return _0x5b9da5[_0x3556('0x8')](_0x3556('0x9'),attributes,{'tableName':_0x3556('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 b0c9083..cca2de1 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 _0x84f8=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x575c52,_0x352bb7){var _0xba5635=function(_0xc8c776){while(--_0xc8c776){_0x575c52['push'](_0x575c52['shift']());}};_0xba5635(++_0x352bb7);}(_0x84f8,0x64));var _0x884f=function(_0x188f75,_0x558198){_0x188f75=_0x188f75-0x0;var _0x4dce7b=_0x84f8[_0x188f75];return _0x4dce7b;};'use strict';var _=require(_0x884f('0x0'));var util=require('util');var moment=require(_0x884f('0x1'));var BPromise=require(_0x884f('0x2'));var rs=require(_0x884f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x884f('0x4'));var logger=require('../../config/logger')(_0x884f('0x5'));var config=require(_0x884f('0x6'));var jayson=require(_0x884f('0x7'));var client=jayson[_0x884f('0x8')][_0x884f('0x9')]({'port':0x232a});config['redis']=_[_0x884f('0xa')](config['redis'],{'host':_0x884f('0xb'),'port':0x18eb});var socket=require(_0x884f('0xc'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x884f('0xd')](socket);function respondWithRpcPromise(_0x3a4ea1,_0x3647f4,_0x40b2cc){return new BPromise(function(_0x250d1c,_0x349583){return client['request'](_0x3a4ea1,_0x40b2cc)['then'](function(_0x3b92dd){logger[_0x884f('0xe')]('SmsAccount,\x20%s,\x20%s',_0x3647f4,'request\x20sent');logger[_0x884f('0xf')](_0x884f('0x10'),_0x3647f4,'request\x20sent',JSON[_0x884f('0x11')](_0x3b92dd));if(_0x3b92dd[_0x884f('0x12')]){if(_0x3b92dd['error'][_0x884f('0x13')]===0x1f4){logger[_0x884f('0x12')](_0x884f('0x14'),_0x3647f4,_0x3b92dd['error']['message']);return _0x349583(_0x3b92dd[_0x884f('0x12')][_0x884f('0x15')]);}logger['error'](_0x884f('0x14'),_0x3647f4,_0x3b92dd[_0x884f('0x12')][_0x884f('0x15')]);return _0x250d1c(_0x3b92dd['error']['message']);}else{logger[_0x884f('0xe')](_0x884f('0x14'),_0x3647f4,_0x884f('0x16'));_0x250d1c(_0x3b92dd[_0x884f('0x17')][_0x884f('0x15')]);}})[_0x884f('0x18')](function(_0x5a8151){logger[_0x884f('0x12')](_0x884f('0x14'),_0x3647f4,_0x5a8151);_0x349583(_0x5a8151);});});}exports[_0x884f('0x19')]=function(_0x31b9ef){var _0x2c6fd9=this;return new Promise(function(_0x311792,_0x3a3352){return db[_0x884f('0x1a')][_0x884f('0x1b')]({'raw':_0x31b9ef['options']?_0x31b9ef[_0x884f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x31b9ef['options']?_0x31b9ef[_0x884f('0x1c')][_0x884f('0x1d')]||null:null,'attributes':_0x31b9ef['options']?_0x31b9ef[_0x884f('0x1c')][_0x884f('0x1e')]||null:null,'include':_0x31b9ef[_0x884f('0x1c')]?_0x31b9ef[_0x884f('0x1c')][_0x884f('0x1f')]?_[_0x884f('0x20')](_0x31b9ef[_0x884f('0x1c')][_0x884f('0x1f')],function(_0x1446e5){return{'model':db[_0x1446e5[_0x884f('0x21')]],'as':_0x1446e5['as'],'attributes':_0x1446e5[_0x884f('0x1e')],'include':_0x1446e5['include']?_[_0x884f('0x20')](_0x1446e5[_0x884f('0x1f')],function(_0x5d18d5){return{'model':db[_0x5d18d5[_0x884f('0x21')]],'as':_0x5d18d5['as'],'attributes':_0x5d18d5[_0x884f('0x1e')],'include':_0x5d18d5[_0x884f('0x1f')]?_['map'](_0x5d18d5[_0x884f('0x1f')],function(_0x2f833d){return{'model':db[_0x2f833d[_0x884f('0x21')]],'as':_0x2f833d['as'],'attributes':_0x2f833d[_0x884f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x884f('0x22')](function(_0x462942){logger[_0x884f('0xe')](_0x884f('0x19'),_0x31b9ef);logger[_0x884f('0xf')]('ShowSmsAccount',_0x31b9ef,JSON[_0x884f('0x11')](_0x462942));_0x311792(_0x462942);})[_0x884f('0x18')](function(_0x234d6a){logger['error'](_0x884f('0x19'),_0x234d6a[_0x884f('0x15')],_0x31b9ef);_0x3a3352(_0x2c6fd9['error'](0x1f4,_0x234d6a[_0x884f('0x15')]));});});}; \ No newline at end of file +var _0xbb84=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./smsAccount.socket','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','catch','lodash','bluebird','randomstring'];(function(_0x7b3b8a,_0x445d7e){var _0x5d4a04=function(_0x29a4b7){while(--_0x29a4b7){_0x7b3b8a['push'](_0x7b3b8a['shift']());}};_0x5d4a04(++_0x445d7e);}(_0xbb84,0x12f));var _0x4bb8=function(_0x386b6b,_0x489623){_0x386b6b=_0x386b6b-0x0;var _0x39969e=_0xbb84[_0x386b6b];return _0x39969e;};'use strict';var _=require(_0x4bb8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4bb8('0x1'));var rs=require(_0x4bb8('0x2'));var fs=require('fs');var Redis=require(_0x4bb8('0x3'));var db=require(_0x4bb8('0x4'))['db'];var utils=require(_0x4bb8('0x5'));var logger=require('../../config/logger')(_0x4bb8('0x6'));var config=require(_0x4bb8('0x7'));var jayson=require(_0x4bb8('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x4bb8('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4bb8('0xa'))(new Redis(config['redis']));require(_0x4bb8('0xb'))[_0x4bb8('0xc')](socket);function respondWithRpcPromise(_0x2c5eb0,_0x14f743,_0x310a4b){return new BPromise(function(_0x563909,_0x11946a){return client['request'](_0x2c5eb0,_0x310a4b)[_0x4bb8('0xd')](function(_0x2009da){logger['info'](_0x4bb8('0xe'),_0x14f743,_0x4bb8('0xf'));logger[_0x4bb8('0x10')](_0x4bb8('0x11'),_0x14f743,_0x4bb8('0xf'),JSON[_0x4bb8('0x12')](_0x2009da));if(_0x2009da[_0x4bb8('0x13')]){if(_0x2009da[_0x4bb8('0x13')][_0x4bb8('0x14')]===0x1f4){logger[_0x4bb8('0x13')]('SmsAccount,\x20%s,\x20%s',_0x14f743,_0x2009da[_0x4bb8('0x13')][_0x4bb8('0x15')]);return _0x11946a(_0x2009da[_0x4bb8('0x13')]['message']);}logger[_0x4bb8('0x13')](_0x4bb8('0xe'),_0x14f743,_0x2009da[_0x4bb8('0x13')][_0x4bb8('0x15')]);return _0x563909(_0x2009da['error'][_0x4bb8('0x15')]);}else{logger[_0x4bb8('0x16')](_0x4bb8('0xe'),_0x14f743,'request\x20sent');_0x563909(_0x2009da[_0x4bb8('0x17')][_0x4bb8('0x15')]);}})['catch'](function(_0x338b89){logger[_0x4bb8('0x13')](_0x4bb8('0xe'),_0x14f743,_0x338b89);_0x11946a(_0x338b89);});});}exports[_0x4bb8('0x18')]=function(_0x1e60af){var _0x3d0edf=this;return new Promise(function(_0x3548bc,_0x230b74){return db[_0x4bb8('0x19')]['find']({'raw':_0x1e60af['options']?_0x1e60af[_0x4bb8('0x1a')][_0x4bb8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e60af['options']?_0x1e60af[_0x4bb8('0x1a')][_0x4bb8('0x1c')]||null:null,'attributes':_0x1e60af['options']?_0x1e60af['options'][_0x4bb8('0x1d')]||null:null,'include':_0x1e60af[_0x4bb8('0x1a')]?_0x1e60af[_0x4bb8('0x1a')][_0x4bb8('0x1e')]?_[_0x4bb8('0x1f')](_0x1e60af[_0x4bb8('0x1a')][_0x4bb8('0x1e')],function(_0x2a9aac){return{'model':db[_0x2a9aac[_0x4bb8('0x20')]],'as':_0x2a9aac['as'],'attributes':_0x2a9aac[_0x4bb8('0x1d')],'include':_0x2a9aac[_0x4bb8('0x1e')]?_['map'](_0x2a9aac[_0x4bb8('0x1e')],function(_0x893ad2){return{'model':db[_0x893ad2[_0x4bb8('0x20')]],'as':_0x893ad2['as'],'attributes':_0x893ad2[_0x4bb8('0x1d')],'include':_0x893ad2['include']?_[_0x4bb8('0x1f')](_0x893ad2[_0x4bb8('0x1e')],function(_0x208f49){return{'model':db[_0x208f49[_0x4bb8('0x20')]],'as':_0x208f49['as'],'attributes':_0x208f49[_0x4bb8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1586ce){logger[_0x4bb8('0x16')](_0x4bb8('0x18'),_0x1e60af);logger['debug'](_0x4bb8('0x18'),_0x1e60af,JSON[_0x4bb8('0x12')](_0x1586ce));_0x3548bc(_0x1586ce);})[_0x4bb8('0x21')](function(_0x131eaf){logger[_0x4bb8('0x13')]('ShowSmsAccount',_0x131eaf['message'],_0x1e60af);_0x230b74(_0x3d0edf[_0x4bb8('0x13')](0x1f4,_0x131eaf['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d80ced9..c290a72 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 8f58a2f..91a4503 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3e112c,_0x1c8d7a){var _0x5b037e=function(_0x477377){while(--_0x477377){_0x3e112c['push'](_0x3e112c['shift']());}};_0x5b037e(++_0x1c8d7a);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a0ba2,_0x3bd15){_0x4a0ba2=_0x4a0ba2-0x0;var _0x3258d5=_0xedd9[_0x4a0ba2];return _0x3258d5;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3d3dfa,_0x540d21){var _0x5426b1=function(_0x39fa47){while(--_0x39fa47){_0x3d3dfa['push'](_0x3d3dfa['shift']());}};_0x5426b1(++_0x540d21);}(_0xedd9,0xfc));var _0x9edd=function(_0x543d3b,_0x4ef17d){_0x543d3b=_0x543d3b-0x0;var _0x1f39bc=_0xedd9[_0x543d3b];return _0x1f39bc;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 7f182c8..0d5977a 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 _0x4d7f=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x58a888,_0x2432db){var _0x23049c=function(_0x517fbb){while(--_0x517fbb){_0x58a888['push'](_0x58a888['shift']());}};_0x23049c(++_0x2432db);}(_0x4d7f,0xd2));var _0xf4d7=function(_0x18310f,_0x28e2a3){_0x18310f=_0x18310f-0x0;var _0x3a9f04=_0x4d7f[_0x18310f];return _0x3a9f04;};'use strict';var Sequelize=require(_0xf4d7('0x0'));module[_0xf4d7('0x1')]={'priority':{'type':Sequelize[_0xf4d7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf4d7('0x3')],'allowNull':![],'defaultValue':_0xf4d7('0x4')},'appdata':{'type':Sequelize[_0xf4d7('0x5')]()},'description':{'type':Sequelize[_0xf4d7('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x76cc=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5e30df,_0x5762e8){var _0x205248=function(_0x315d30){while(--_0x315d30){_0x5e30df['push'](_0x5e30df['shift']());}};_0x205248(++_0x5762e8);}(_0x76cc,0xfc));var _0xc76c=function(_0x2e401a,_0x1335f9){_0x2e401a=_0x2e401a-0x0;var _0x1e9a14=_0x76cc[_0x2e401a];return _0x1e9a14;};'use strict';var Sequelize=require('sequelize');module[_0xc76c('0x0')]={'priority':{'type':Sequelize[_0xc76c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc76c('0x2')],'allowNull':![],'defaultValue':_0xc76c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc76c('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc76c('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index b655087..cd49440 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 _0xdcae=['keys','options','find','create','body','eml-format','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params'];(function(_0x4b935a,_0x327ee3){var _0xa298f0=function(_0x3e07c2){while(--_0x3e07c2){_0x4b935a['push'](_0x4b935a['shift']());}};_0xa298f0(++_0x327ee3);}(_0xdcae,0x1b5));var _0xedca=function(_0x467d3b,_0x4225ba){_0x467d3b=_0x467d3b-0x0;var _0x1a35ec=_0xdcae[_0x467d3b];return _0x1a35ec;};'use strict';var emlformat=require(_0xedca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedca('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xedca('0x2'));var util=require(_0xedca('0x3'));var path=require('path');var sox=require(_0xedca('0x4'));var csv=require(_0xedca('0x5'));var ejs=require(_0xedca('0x6'));var fs=require('fs');var fs_extra=require(_0xedca('0x7'));var _=require(_0xedca('0x8'));var squel=require(_0xedca('0x9'));var crypto=require('crypto');var jsforce=require(_0xedca('0xa'));var deskjs=require(_0xedca('0xb'));var toCsv=require(_0xedca('0x5'));var querystring=require(_0xedca('0xc'));var Papa=require(_0xedca('0xd'));var Redis=require(_0xedca('0xe'));var authService=require(_0xedca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xedca('0x10'));var hardwareService=require(_0xedca('0x11'));var logger=require(_0xedca('0x12'))(_0xedca('0x13'));var utils=require('../../config/utils');var config=require(_0xedca('0x14'));var licenseUtil=require(_0xedca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x756b12,_0x370280){_0x370280=_0x370280||0xcc;return function(_0x48b9e3){if(_0x48b9e3){return _0x756b12[_0xedca('0x16')](_0x370280);}return _0x756b12[_0xedca('0x17')](_0x370280)[_0xedca('0x18')]();};}function respondWithResult(_0x44a41d,_0x30eb52){_0x30eb52=_0x30eb52||0xc8;return function(_0x1837e0){if(_0x1837e0){return _0x44a41d['status'](_0x30eb52)[_0xedca('0x19')](_0x1837e0);}};}function respondWithFilteredResult(_0x3a6014,_0x35e49b){return function(_0x5c7ecd){if(_0x5c7ecd){var _0x214228=typeof _0x35e49b[_0xedca('0x1a')]==='undefined'&&typeof _0x35e49b[_0xedca('0x1b')]===_0xedca('0x1c');var _0x3552fb=_0x5c7ecd['count'];var _0x5dbbc5=_0x214228?0x0:_0x35e49b[_0xedca('0x1a')];var _0x5e6c2c=_0x214228?_0x5c7ecd[_0xedca('0x1d')]:_0x35e49b[_0xedca('0x1a')]+_0x35e49b['limit'];var _0x8b3d82;if(_0x5e6c2c>=_0x3552fb){_0x5e6c2c=_0x3552fb;_0x8b3d82=0xc8;}else{_0x8b3d82=0xce;}_0x3a6014['status'](_0x8b3d82);return _0x3a6014[_0xedca('0x1e')](_0xedca('0x1f'),_0x5dbbc5+'-'+_0x5e6c2c+'/'+_0x3552fb)[_0xedca('0x19')](_0x5c7ecd);}return null;};}function patchUpdates(_0x1b6c36){return function(_0x98fb01){try{jsonpatch[_0xedca('0x20')](_0x98fb01,_0x1b6c36,!![]);}catch(_0x2a0bce){return BPromise[_0xedca('0x21')](_0x2a0bce);}return _0x98fb01[_0xedca('0x22')]();};}function saveUpdates(_0x13325b,_0x35e761){return function(_0x59ef33){if(_0x59ef33){return _0x59ef33[_0xedca('0x23')](_0x13325b)[_0xedca('0x24')](function(_0x435f84){return _0x435f84;});}return null;};}function removeEntity(_0x3e2b5a,_0x5bdd11){return function(_0x1cfabb){if(_0x1cfabb){return _0x1cfabb[_0xedca('0x25')]()[_0xedca('0x24')](function(){_0x3e2b5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3750bf,_0x4520ef){return function(_0x5004c6){if(!_0x5004c6){_0x3750bf[_0xedca('0x16')](0x194);}return _0x5004c6;};}function handleError(_0x3b8909,_0x3670a3){_0x3670a3=_0x3670a3||0x1f4;return function(_0x1d5105){logger['error'](_0x1d5105[_0xedca('0x26')]);if(_0x1d5105[_0xedca('0x27')]){delete _0x1d5105['name'];}_0x3b8909[_0xedca('0x17')](_0x3670a3)[_0xedca('0x28')](_0x1d5105);};}exports[_0xedca('0x29')]=function(_0x191a9d,_0x5aca35){var _0x58821d={},_0x145019={},_0x1a37d4={'count':0x0,'rows':[]};var _0x46d1ce=_[_0xedca('0x2a')](db[_0xedca('0x2b')][_0xedca('0x2c')],function(_0x4d424d){return{'name':_0x4d424d[_0xedca('0x2d')],'type':_0x4d424d[_0xedca('0x2e')]['key']};});_0x145019['model']=_[_0xedca('0x2a')](_0x46d1ce,'name');_0x145019[_0xedca('0x2f')]=_['keys'](_0x191a9d[_0xedca('0x2f')]);_0x145019[_0xedca('0x30')]=_[_0xedca('0x31')](_0x145019[_0xedca('0x32')],_0x145019['query']);_0x58821d['attributes']=_[_0xedca('0x31')](_0x145019[_0xedca('0x32')],qs['fields'](_0x191a9d[_0xedca('0x2f')][_0xedca('0x33')]));_0x58821d[_0xedca('0x34')]=_0x58821d[_0xedca('0x34')]['length']?_0x58821d[_0xedca('0x34')]:_0x145019[_0xedca('0x32')];if(!_0x191a9d[_0xedca('0x2f')][_0xedca('0x35')](_0xedca('0x36'))){_0x58821d[_0xedca('0x1b')]=qs[_0xedca('0x1b')](_0x191a9d['query'][_0xedca('0x1b')]);_0x58821d[_0xedca('0x1a')]=qs[_0xedca('0x1a')](_0x191a9d[_0xedca('0x2f')][_0xedca('0x1a')]);}_0x58821d[_0xedca('0x37')]=qs['sort'](_0x191a9d[_0xedca('0x2f')][_0xedca('0x38')]);_0x58821d[_0xedca('0x39')]=qs[_0xedca('0x30')](_[_0xedca('0x3a')](_0x191a9d[_0xedca('0x2f')],_0x145019['filters']),_0x46d1ce);if(_0x191a9d[_0xedca('0x2f')]['filter']){_0x58821d['where']=_[_0xedca('0x3b')](_0x58821d['where'],{'$or':_[_0xedca('0x2a')](_0x46d1ce,function(_0x5debca){if(_0x5debca[_0xedca('0x2e')]!==_0xedca('0x3c')){var _0x14a963={};_0x14a963[_0x5debca[_0xedca('0x27')]]={'$like':'%'+_0x191a9d[_0xedca('0x2f')]['filter']+'%'};return _0x14a963;}})});}_0x58821d=_[_0xedca('0x3b')]({},_0x58821d,_0x191a9d['options']);var _0xa7158={'where':_0x58821d[_0xedca('0x39')]};return db[_0xedca('0x2b')][_0xedca('0x1d')](_0xa7158)[_0xedca('0x24')](function(_0x1df6fc){_0x1a37d4[_0xedca('0x1d')]=_0x1df6fc;if(_0x191a9d[_0xedca('0x2f')][_0xedca('0x3d')]){_0x58821d[_0xedca('0x3e')]=[{'all':!![]}];}return db[_0xedca('0x2b')][_0xedca('0x3f')](_0x58821d);})[_0xedca('0x24')](function(_0x5c8c41){_0x1a37d4['rows']=_0x5c8c41;return _0x1a37d4;})[_0xedca('0x24')](respondWithFilteredResult(_0x5aca35,_0x58821d))[_0xedca('0x40')](handleError(_0x5aca35,null));};exports[_0xedca('0x41')]=function(_0x463c1a,_0x4272bf){var _0x206266={'raw':!![],'where':{'id':_0x463c1a[_0xedca('0x42')]['id']}},_0x4e551e={};_0x4e551e['model']=_[_0xedca('0x43')](db['SmsApplication'][_0xedca('0x2c')]);_0x4e551e[_0xedca('0x2f')]=_['keys'](_0x463c1a[_0xedca('0x2f')]);_0x4e551e[_0xedca('0x30')]=_[_0xedca('0x31')](_0x4e551e['model'],_0x4e551e[_0xedca('0x2f')]);_0x206266[_0xedca('0x34')]=_[_0xedca('0x31')](_0x4e551e[_0xedca('0x32')],qs[_0xedca('0x33')](_0x463c1a['query'][_0xedca('0x33')]));_0x206266['attributes']=_0x206266['attributes']['length']?_0x206266[_0xedca('0x34')]:_0x4e551e[_0xedca('0x32')];if(_0x463c1a[_0xedca('0x2f')]['includeAll']){_0x206266[_0xedca('0x3e')]=[{'all':!![]}];}_0x206266=_['merge']({},_0x206266,_0x463c1a[_0xedca('0x44')]);return db['SmsApplication'][_0xedca('0x45')](_0x206266)[_0xedca('0x24')](handleEntityNotFound(_0x4272bf,null))[_0xedca('0x24')](respondWithResult(_0x4272bf,null))[_0xedca('0x40')](handleError(_0x4272bf,null));};exports[_0xedca('0x46')]=function(_0x3b692e,_0xd75c0c){return db[_0xedca('0x2b')][_0xedca('0x46')](_0x3b692e['body'],{})['then'](respondWithResult(_0xd75c0c,0xc9))[_0xedca('0x40')](handleError(_0xd75c0c,null));};exports[_0xedca('0x23')]=function(_0x11ba16,_0x4b890e){if(_0x11ba16['body']['id']){delete _0x11ba16[_0xedca('0x47')]['id'];}return db[_0xedca('0x2b')][_0xedca('0x45')]({'where':{'id':_0x11ba16['params']['id']}})['then'](handleEntityNotFound(_0x4b890e,null))[_0xedca('0x24')](saveUpdates(_0x11ba16[_0xedca('0x47')],null))[_0xedca('0x24')](respondWithResult(_0x4b890e,null))['catch'](handleError(_0x4b890e,null));};exports[_0xedca('0x25')]=function(_0x2ca4c3,_0x32db15){return db[_0xedca('0x2b')][_0xedca('0x45')]({'where':{'id':_0x2ca4c3[_0xedca('0x42')]['id']}})[_0xedca('0x24')](handleEntityNotFound(_0x32db15,null))[_0xedca('0x24')](removeEntity(_0x32db15,null))['catch'](handleError(_0x32db15,null));}; \ No newline at end of file +var _0x66d1=['ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x186780,_0x144f34){var _0x307c3c=function(_0x4503a6){while(--_0x4503a6){_0x186780['push'](_0x186780['shift']());}};_0x307c3c(++_0x144f34);}(_0x66d1,0x1f4));var _0x166d=function(_0x40239e,_0x2a6114){_0x40239e=_0x40239e-0x0;var _0x1ad79d=_0x66d1[_0x40239e];return _0x1ad79d;};'use strict';var emlformat=require(_0x166d('0x0'));var rimraf=require(_0x166d('0x1'));var zipdir=require(_0x166d('0x2'));var jsonpatch=require(_0x166d('0x3'));var rp=require(_0x166d('0x4'));var moment=require(_0x166d('0x5'));var BPromise=require(_0x166d('0x6'));var Mustache=require(_0x166d('0x7'));var util=require(_0x166d('0x8'));var path=require('path');var sox=require(_0x166d('0x9'));var csv=require(_0x166d('0xa'));var ejs=require(_0x166d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x166d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x166d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x166d('0xe'));var Papa=require(_0x166d('0xf'));var Redis=require(_0x166d('0x10'));var authService=require(_0x166d('0x11'));var qs=require(_0x166d('0x12'));var as=require(_0x166d('0x13'));var hardwareService=require(_0x166d('0x14'));var logger=require(_0x166d('0x15'))(_0x166d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x166d('0x17'));var db=require(_0x166d('0x18'))['db'];function respondWithStatusCode(_0x3b4eea,_0x4357fa){_0x4357fa=_0x4357fa||0xcc;return function(_0x11b640){if(_0x11b640){return _0x3b4eea[_0x166d('0x19')](_0x4357fa);}return _0x3b4eea[_0x166d('0x1a')](_0x4357fa)[_0x166d('0x1b')]();};}function respondWithResult(_0x108875,_0x129a7b){_0x129a7b=_0x129a7b||0xc8;return function(_0x57ebd0){if(_0x57ebd0){return _0x108875[_0x166d('0x1a')](_0x129a7b)[_0x166d('0x1c')](_0x57ebd0);}};}function respondWithFilteredResult(_0x1db2a9,_0x52d24e){return function(_0x22a123){if(_0x22a123){var _0x2b0996=typeof _0x52d24e[_0x166d('0x1d')]===_0x166d('0x1e')&&typeof _0x52d24e['limit']===_0x166d('0x1e');var _0x45bbc5=_0x22a123['count'];var _0x41a7a6=_0x2b0996?0x0:_0x52d24e['offset'];var _0x12d07f=_0x2b0996?_0x22a123[_0x166d('0x1f')]:_0x52d24e[_0x166d('0x1d')]+_0x52d24e[_0x166d('0x20')];var _0x175674;if(_0x12d07f>=_0x45bbc5){_0x12d07f=_0x45bbc5;_0x175674=0xc8;}else{_0x175674=0xce;}_0x1db2a9[_0x166d('0x1a')](_0x175674);return _0x1db2a9[_0x166d('0x21')](_0x166d('0x22'),_0x41a7a6+'-'+_0x12d07f+'/'+_0x45bbc5)['json'](_0x22a123);}return null;};}function patchUpdates(_0x1db94f){return function(_0x212e28){try{jsonpatch[_0x166d('0x23')](_0x212e28,_0x1db94f,!![]);}catch(_0x371990){return BPromise[_0x166d('0x24')](_0x371990);}return _0x212e28[_0x166d('0x25')]();};}function saveUpdates(_0x4c3710,_0x5404e8){return function(_0x32fddc){if(_0x32fddc){return _0x32fddc[_0x166d('0x26')](_0x4c3710)[_0x166d('0x27')](function(_0x12e976){return _0x12e976;});}return null;};}function removeEntity(_0x43d242,_0x58c2d7){return function(_0x1f6a59){if(_0x1f6a59){return _0x1f6a59[_0x166d('0x28')]()[_0x166d('0x27')](function(){_0x43d242['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x132f60,_0x4fea53){return function(_0x56624c){if(!_0x56624c){_0x132f60[_0x166d('0x19')](0x194);}return _0x56624c;};}function handleError(_0x544826,_0x3c87ce){_0x3c87ce=_0x3c87ce||0x1f4;return function(_0xac9338){logger[_0x166d('0x29')](_0xac9338['stack']);if(_0xac9338[_0x166d('0x2a')]){delete _0xac9338[_0x166d('0x2a')];}_0x544826[_0x166d('0x1a')](_0x3c87ce)[_0x166d('0x2b')](_0xac9338);};}exports[_0x166d('0x2c')]=function(_0x5144fd,_0x8ed088){var _0xe8c391={},_0x598492={},_0x16fe3e={'count':0x0,'rows':[]};var _0x24ad10=_[_0x166d('0x2d')](db[_0x166d('0x2e')][_0x166d('0x2f')],function(_0x1536c6){return{'name':_0x1536c6['fieldName'],'type':_0x1536c6[_0x166d('0x30')][_0x166d('0x31')]};});_0x598492[_0x166d('0x32')]=_['map'](_0x24ad10,_0x166d('0x2a'));_0x598492[_0x166d('0x33')]=_[_0x166d('0x34')](_0x5144fd[_0x166d('0x33')]);_0x598492[_0x166d('0x35')]=_[_0x166d('0x36')](_0x598492[_0x166d('0x32')],_0x598492['query']);_0xe8c391['attributes']=_['intersection'](_0x598492['model'],qs['fields'](_0x5144fd[_0x166d('0x33')][_0x166d('0x37')]));_0xe8c391[_0x166d('0x38')]=_0xe8c391[_0x166d('0x38')][_0x166d('0x39')]?_0xe8c391[_0x166d('0x38')]:_0x598492[_0x166d('0x32')];if(!_0x5144fd['query']['hasOwnProperty'](_0x166d('0x3a'))){_0xe8c391[_0x166d('0x20')]=qs[_0x166d('0x20')](_0x5144fd[_0x166d('0x33')]['limit']);_0xe8c391['offset']=qs['offset'](_0x5144fd[_0x166d('0x33')][_0x166d('0x1d')]);}_0xe8c391[_0x166d('0x3b')]=qs[_0x166d('0x3c')](_0x5144fd['query']['sort']);_0xe8c391[_0x166d('0x3d')]=qs[_0x166d('0x35')](_['pick'](_0x5144fd['query'],_0x598492[_0x166d('0x35')]),_0x24ad10);if(_0x5144fd[_0x166d('0x33')][_0x166d('0x3e')]){_0xe8c391[_0x166d('0x3d')]=_['merge'](_0xe8c391['where'],{'$or':_[_0x166d('0x2d')](_0x24ad10,function(_0x296bc6){if(_0x296bc6[_0x166d('0x30')]!==_0x166d('0x3f')){var _0x115f33={};_0x115f33[_0x296bc6[_0x166d('0x2a')]]={'$like':'%'+_0x5144fd[_0x166d('0x33')][_0x166d('0x3e')]+'%'};return _0x115f33;}})});}_0xe8c391=_[_0x166d('0x40')]({},_0xe8c391,_0x5144fd[_0x166d('0x41')]);var _0x1e08ae={'where':_0xe8c391[_0x166d('0x3d')]};return db[_0x166d('0x2e')][_0x166d('0x1f')](_0x1e08ae)[_0x166d('0x27')](function(_0x2cede7){_0x16fe3e['count']=_0x2cede7;if(_0x5144fd[_0x166d('0x33')][_0x166d('0x42')]){_0xe8c391['include']=[{'all':!![]}];}return db[_0x166d('0x2e')]['findAll'](_0xe8c391);})[_0x166d('0x27')](function(_0x3f2178){_0x16fe3e[_0x166d('0x43')]=_0x3f2178;return _0x16fe3e;})[_0x166d('0x27')](respondWithFilteredResult(_0x8ed088,_0xe8c391))[_0x166d('0x44')](handleError(_0x8ed088,null));};exports[_0x166d('0x45')]=function(_0x3a1e46,_0x4972d7){var _0x78e825={'raw':!![],'where':{'id':_0x3a1e46['params']['id']}},_0x3afa27={};_0x3afa27[_0x166d('0x32')]=_[_0x166d('0x34')](db[_0x166d('0x2e')]['rawAttributes']);_0x3afa27['query']=_[_0x166d('0x34')](_0x3a1e46[_0x166d('0x33')]);_0x3afa27[_0x166d('0x35')]=_[_0x166d('0x36')](_0x3afa27[_0x166d('0x32')],_0x3afa27['query']);_0x78e825[_0x166d('0x38')]=_[_0x166d('0x36')](_0x3afa27[_0x166d('0x32')],qs['fields'](_0x3a1e46['query'][_0x166d('0x37')]));_0x78e825[_0x166d('0x38')]=_0x78e825[_0x166d('0x38')]['length']?_0x78e825['attributes']:_0x3afa27[_0x166d('0x32')];if(_0x3a1e46[_0x166d('0x33')][_0x166d('0x42')]){_0x78e825['include']=[{'all':!![]}];}_0x78e825=_[_0x166d('0x40')]({},_0x78e825,_0x3a1e46[_0x166d('0x41')]);return db['SmsApplication'][_0x166d('0x46')](_0x78e825)[_0x166d('0x27')](handleEntityNotFound(_0x4972d7,null))[_0x166d('0x27')](respondWithResult(_0x4972d7,null))[_0x166d('0x44')](handleError(_0x4972d7,null));};exports[_0x166d('0x47')]=function(_0x48c7b5,_0x29c45a){return db['SmsApplication'][_0x166d('0x47')](_0x48c7b5[_0x166d('0x48')],{})['then'](respondWithResult(_0x29c45a,0xc9))['catch'](handleError(_0x29c45a,null));};exports[_0x166d('0x26')]=function(_0x13d45d,_0x3baea2){if(_0x13d45d['body']['id']){delete _0x13d45d[_0x166d('0x48')]['id'];}return db[_0x166d('0x2e')][_0x166d('0x46')]({'where':{'id':_0x13d45d['params']['id']}})[_0x166d('0x27')](handleEntityNotFound(_0x3baea2,null))[_0x166d('0x27')](saveUpdates(_0x13d45d[_0x166d('0x48')],null))[_0x166d('0x27')](respondWithResult(_0x3baea2,null))[_0x166d('0x44')](handleError(_0x3baea2,null));};exports[_0x166d('0x28')]=function(_0x3f6c9f,_0x3bd51f){return db['SmsApplication'][_0x166d('0x46')]({'where':{'id':_0x3f6c9f['params']['id']}})[_0x166d('0x27')](handleEntityNotFound(_0x3bd51f,null))[_0x166d('0x27')](removeEntity(_0x3bd51f,null))[_0x166d('0x44')](handleError(_0x3bd51f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1704f86..94a8018 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 _0xc92f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x36f7ba,_0x5f1665){var _0x50bab7=function(_0x265348){while(--_0x265348){_0x36f7ba['push'](_0x36f7ba['shift']());}};_0x50bab7(++_0x5f1665);}(_0xc92f,0x7d));var _0xfc92=function(_0xf51265,_0x3b610f){_0xf51265=_0xf51265-0x0;var _0x5aefdb=_0xc92f[_0xf51265];return _0x5aefdb;};'use strict';var _=require('lodash');var util=require(_0xfc92('0x0'));var logger=require(_0xfc92('0x1'))(_0xfc92('0x2'));var moment=require(_0xfc92('0x3'));var BPromise=require(_0xfc92('0x4'));var rp=require(_0xfc92('0x5'));var fs=require('fs');var path=require(_0xfc92('0x6'));var rimraf=require(_0xfc92('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xfc92('0x8')]=function(_0x77df5c,_0x12d5a3){return _0x77df5c[_0xfc92('0x9')](_0xfc92('0xa'),attributes,{'tableName':_0xfc92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc92('0xc'),'collate':_0xfc92('0xd')});}; \ No newline at end of file +var _0x3709=['sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication'];(function(_0x5bebb5,_0x151930){var _0x5d869f=function(_0x1f2dac){while(--_0x1f2dac){_0x5bebb5['push'](_0x5bebb5['shift']());}};_0x5d869f(++_0x151930);}(_0x3709,0xf3));var _0x9370=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3709[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x9370('0x0'));var logger=require(_0x9370('0x1'))(_0x9370('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9370('0x3'));var fs=require('fs');var path=require(_0x9370('0x4'));var rimraf=require('rimraf');var config=require(_0x9370('0x5'));var attributes=require(_0x9370('0x6'));module[_0x9370('0x7')]=function(_0x2c9bcd,_0x15aaf7){return _0x2c9bcd['define'](_0x9370('0x8'),attributes,{'tableName':_0x9370('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9370('0xa'),'collate':_0x9370('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 532a6b7..92ad11d 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 _0x63d4=['jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1099a8,_0x1a78bc){var _0x310abc=function(_0x457dca){while(--_0x457dca){_0x1099a8['push'](_0x1099a8['shift']());}};_0x310abc(++_0x1a78bc);}(_0x63d4,0x117));var _0x463d=function(_0x26a4cc,_0x4272e5){_0x26a4cc=_0x26a4cc-0x0;var _0x251a7e=_0x63d4[_0x26a4cc];return _0x251a7e;};'use strict';var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var moment=require(_0x463d('0x2'));var BPromise=require('bluebird');var rs=require(_0x463d('0x3'));var fs=require('fs');var Redis=require(_0x463d('0x4'));var db=require(_0x463d('0x5'))['db'];var utils=require(_0x463d('0x6'));var logger=require(_0x463d('0x7'))('rpc');var config=require(_0x463d('0x8'));var jayson=require(_0x463d('0x9'));var client=jayson['client'][_0x463d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb5e1b1,_0x2635aa,_0x41dc01){return new BPromise(function(_0x218286,_0x4d32fb){return client[_0x463d('0xb')](_0xb5e1b1,_0x41dc01)['then'](function(_0x42b27e){logger[_0x463d('0xc')](_0x463d('0xd'),_0x2635aa,_0x463d('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2635aa,_0x463d('0xe'),JSON['stringify'](_0x42b27e));if(_0x42b27e[_0x463d('0xf')]){if(_0x42b27e[_0x463d('0xf')][_0x463d('0x10')]===0x1f4){logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x42b27e[_0x463d('0xf')][_0x463d('0x11')]);return _0x4d32fb(_0x42b27e['error'][_0x463d('0x11')]);}logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x42b27e['error'][_0x463d('0x11')]);return _0x218286(_0x42b27e[_0x463d('0xf')][_0x463d('0x11')]);}else{logger[_0x463d('0xc')](_0x463d('0xd'),_0x2635aa,_0x463d('0xe'));_0x218286(_0x42b27e['result'][_0x463d('0x11')]);}})['catch'](function(_0x10008f){logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x10008f);_0x4d32fb(_0x10008f);});});} \ No newline at end of file +var _0xb78e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2c697f,_0x39cb6a){_0x2c697f=_0x2c697f-0x0;var _0x18d8bb=_0xb78e[_0x2c697f];return _0x18d8bb;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('SmsApplication,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ea0c4ca..95b0131 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 _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5c00,0x17e));var _0x05c0=function(_0x2b2583,_0x2a154b){_0x2b2583=_0x2b2583-0x0;var _0x4cd668=_0x5c00[_0x2b2583];return _0x4cd668;};'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('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file +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(_0x481059,_0x1a1471){var _0x76e1f2=function(_0x3d58c){while(--_0x3d58c){_0x481059['push'](_0x481059['shift']());}};_0x76e1f2(++_0x1a1471);}(_0x955f,0x1eb));var _0xf955=function(_0xa322d9,_0x5e3687){_0xa322d9=_0xa322d9-0x0;var _0x361b3f=_0x955f[_0xa322d9];return _0x361b3f;};'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 diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index bad6846..2cd1205 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 _0x3981=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x1adcc5,_0x5d7fe9){var _0x594522=function(_0x2d5bb2){while(--_0x2d5bb2){_0x1adcc5['push'](_0x1adcc5['shift']());}};_0x594522(++_0x5d7fe9);}(_0x3981,0x144));var _0x1398=function(_0x4c8f99,_0x119309){_0x4c8f99=_0x4c8f99-0x0;var _0xeba8e2=_0x3981[_0x4c8f99];return _0xeba8e2;};'use strict';var Sequelize=require(_0x1398('0x0'));var moment=require('moment');module[_0x1398('0x1')]={'closed':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1398('0x3')]},'disposition':{'type':Sequelize[_0x1398('0x4')]},'secondDisposition':{'type':Sequelize[_0x1398('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1398('0x4')]},'note':{'type':Sequelize[_0x1398('0x4')]},'phone':{'type':Sequelize[_0x1398('0x4')]},'read1stAt':{'type':Sequelize[_0x1398('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1398('0x5')]('in',_0x1398('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1398('0x5')]('in',_0x1398('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8bb=['BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0x5a968c,_0x3d914a){var _0x49d089=function(_0x38f9db){while(--_0x38f9db){_0x5a968c['push'](_0x5a968c['shift']());}};_0x49d089(++_0x3d914a);}(_0xf8bb,0x111));var _0xbf8b=function(_0x14faaf,_0xcb13ba){_0x14faaf=_0x14faaf-0x0;var _0x1beb4e=_0xf8bb[_0x14faaf];return _0x1beb4e;};'use strict';var Sequelize=require(_0xbf8b('0x0'));var moment=require(_0xbf8b('0x1'));module[_0xbf8b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbf8b('0x3')]},'disposition':{'type':Sequelize[_0xbf8b('0x4')]},'secondDisposition':{'type':Sequelize[_0xbf8b('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbf8b('0x4')]},'note':{'type':Sequelize[_0xbf8b('0x4')]},'phone':{'type':Sequelize[_0xbf8b('0x4')]},'read1stAt':{'type':Sequelize[_0xbf8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbf8b('0x5')]('in',_0xbf8b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbf8b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbf8b('0x5')]('in',_0xbf8b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbf8b('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 7d5b0f8..aa363cb 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 _0xf72f=['`\x20=\x200','having','`\x20>\x200','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','count','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','params','includeAll','options','create','body','describe','SmsMessage','addMessage','omit','ids','getMessages','filter','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','findAll','emit','smsInteractionTags:save','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','secret','read','SmsAccount','Account','get','Sms','Owner','Messages','direction','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','map','fullname','TagIds','Tags','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','SmsInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','field','color','from','ui.SmsInteractionId','left_join','u.id\x20=\x20ui.UserId','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value'];(function(_0x1e00a8,_0x312bc8){var _0x51d505=function(_0x238f94){while(--_0x238f94){_0x1e00a8['push'](_0x1e00a8['shift']());}};_0x51d505(++_0x312bc8);}(_0xf72f,0x171));var _0xff72=function(_0x6986eb,_0x3fbc37){_0x6986eb=_0x6986eb-0x0;var _0x2b5e74=_0xf72f[_0x6986eb];return _0x2b5e74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff72('0x0'));var zipdir=require(_0xff72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff72('0x2'));var moment=require(_0xff72('0x3'));var BPromise=require(_0xff72('0x4'));var Mustache=require(_0xff72('0x5'));var util=require(_0xff72('0x6'));var path=require(_0xff72('0x7'));var sox=require(_0xff72('0x8'));var csv=require(_0xff72('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff72('0xa'));var squel=require('squel');var crypto=require(_0xff72('0xb'));var jsforce=require(_0xff72('0xc'));var deskjs=require(_0xff72('0xd'));var toCsv=require(_0xff72('0x9'));var querystring=require(_0xff72('0xe'));var Papa=require(_0xff72('0xf'));var Redis=require(_0xff72('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff72('0x11'));var as=require(_0xff72('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xff72('0x13'));var utils=require('../../config/utils');var config=require(_0xff72('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xff72('0x15')]=_[_0xff72('0x16')](config[_0xff72('0x15')],{'host':_0xff72('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff72('0x15')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2c851c,_0x2a1c39){_0x2a1c39=_0x2a1c39||0xcc;return function(_0x43ec9b){if(_0x43ec9b){return _0x2c851c[_0xff72('0x18')](_0x2a1c39);}return _0x2c851c[_0xff72('0x19')](_0x2a1c39)[_0xff72('0x1a')]();};}function respondWithResult(_0x4d7514,_0x40b2de){_0x40b2de=_0x40b2de||0xc8;return function(_0x2cdcb7){if(_0x2cdcb7){return _0x4d7514[_0xff72('0x19')](_0x40b2de)[_0xff72('0x1b')](_0x2cdcb7);}};}function respondWithFilteredResult(_0x503567,_0x40685f){return function(_0x398d04){if(_0x398d04){var _0x2e5240=typeof _0x40685f[_0xff72('0x1c')]==='undefined'&&typeof _0x40685f['limit']===_0xff72('0x1d');var _0x292558=_0x398d04['count'];var _0xe05dd4=_0x2e5240?0x0:_0x40685f[_0xff72('0x1c')];var _0x12ed64=_0x2e5240?_0x398d04['count']:_0x40685f[_0xff72('0x1c')]+_0x40685f['limit'];var _0x4e3b7f;if(_0x12ed64>=_0x292558){_0x12ed64=_0x292558;_0x4e3b7f=0xc8;}else{_0x4e3b7f=0xce;}_0x503567[_0xff72('0x19')](_0x4e3b7f);return _0x503567[_0xff72('0x1e')]('Content-Range',_0xe05dd4+'-'+_0x12ed64+'/'+_0x292558)['json'](_0x398d04);}return null;};}function patchUpdates(_0x211114){return function(_0x132254){try{jsonpatch[_0xff72('0x1f')](_0x132254,_0x211114,!![]);}catch(_0x654882){return BPromise[_0xff72('0x20')](_0x654882);}return _0x132254[_0xff72('0x21')]();};}function saveUpdates(_0x1dde5e,_0x4d3a8c){return function(_0x51f5db){if(_0x51f5db){return _0x51f5db[_0xff72('0x22')](_0x1dde5e)[_0xff72('0x23')](function(_0x49bf3f){return _0x49bf3f;});}return null;};}function removeEntity(_0x230f21,_0x595be2){return function(_0x94aeb3){if(_0x94aeb3){return _0x94aeb3[_0xff72('0x24')]()[_0xff72('0x23')](function(){_0x230f21[_0xff72('0x19')](0xcc)[_0xff72('0x1a')]();});}};}function handleEntityNotFound(_0xf8ce1c,_0x21e0fe){return function(_0x1e2b62){if(!_0x1e2b62){_0xf8ce1c[_0xff72('0x18')](0x194);}return _0x1e2b62;};}function handleError(_0x2f6e25,_0x5e4cc4){_0x5e4cc4=_0x5e4cc4||0x1f4;return function(_0x3a3b59){logger[_0xff72('0x25')](_0x3a3b59[_0xff72('0x26')]);if(_0x3a3b59['name']){delete _0x3a3b59[_0xff72('0x27')];}_0x2f6e25[_0xff72('0x19')](_0x5e4cc4)['send'](_0x3a3b59);};}function getInteractionUsers(_0x1679eb,_0x3bcfbb){return new BPromise(function(_0x46dbd2,_0x18a7e4){try{if(_0x3bcfbb[_0x1679eb['id']]){_0x1679eb['Users']=_[_0xff72('0x28')](_0x3bcfbb[_0x1679eb['id']],function(_0x3bf6d0){return{'id':_0x3bf6d0['id'],'fullname':_0x3bf6d0[_0xff72('0x29')]};});}}catch(_0x3fc034){_0x18a7e4(_0x3fc034);}_0x46dbd2(_0x1679eb);});}function getInteractionTags(_0x599ee6,_0x22edc6){return new BPromise(function(_0x1b58ab,_0x5de51b){try{if(_0x599ee6[_0xff72('0x2a')]){_0x599ee6[_0xff72('0x2b')]=[];_0x599ee6['TagIds']['split'](',')[_0xff72('0x2c')](function(_0x87e740){_0x599ee6[_0xff72('0x2b')][_0xff72('0x2d')](_0x22edc6[_0x87e740]);});}delete _0x599ee6[_0xff72('0x2a')];}catch(_0x37a88e){_0x5de51b(_0x37a88e);}_0x1b58ab(_0x599ee6);});}function updateSmsInteraction(_0xbe6f60,_0x45f83a,_0x188701){return new BPromise(function(_0x3bfb0f,_0x101209){return getInteractionUsers(_0xbe6f60,_0x188701)[_0xff72('0x23')](function(_0x13b01b){return getInteractionTags(_0x13b01b,_0x45f83a);})[_0xff72('0x23')](function(_0xe3bdfb){return getStateInteraction(_0xe3bdfb);})['then'](function(_0x7731a0){_0x3bfb0f(_0x7731a0);})[_0xff72('0x2e')](function(_0x19fe9c){_0x101209(_0x19fe9c);});});}function getStateInteraction(_0x4b1731){return new BPromise(function(_0x417762){_0x4b1731[_0xff72('0x2f')]=0x0;_0x4b1731['talking']=0x0;_0x4b1731[_0xff72('0x30')]=0x0;_0x4b1731[_0xff72('0x31')]=0x0;_0x4b1731[_0xff72('0x32')]=0x0;if(!_0x4b1731[_0xff72('0x33')]&&!_0x4b1731['UserId']){_0x4b1731['waiting']+=0x1;}if(!_0x4b1731[_0xff72('0x33')]&&_0x4b1731[_0xff72('0x34')]){_0x4b1731[_0xff72('0x35')]+=0x1;if(_0x4b1731[_0xff72('0x2f')]){_0x4b1731[_0xff72('0x2f')]-=0x1;}}if(_0x4b1731['closed']&&_0x4b1731[_0xff72('0x34')]){_0x4b1731['answered']+=0x1;if(_0x4b1731[_0xff72('0x35')]){_0x4b1731[_0xff72('0x35')]-=0x1;}}if(_0x4b1731[_0xff72('0x33')]&&!_0x4b1731[_0xff72('0x34')]){_0x4b1731['unmanaged']+=0x1;if(_0x4b1731[_0xff72('0x2f')]){_0x4b1731[_0xff72('0x2f')]-=0x1;}}_0x4b1731[_0xff72('0x32')]+=0x1;_0x417762(_0x4b1731);});}exports['index']=function(_0x2c3aaa,_0xe84ee2){var _0x1c9f9d={},_0x36b755={},_0xd19d7a={'count':0x0,'rows':[]};var _0xe19e1f=_[_0xff72('0x28')](db[_0xff72('0x36')][_0xff72('0x37')],function(_0x4428b7){return{'name':_0x4428b7[_0xff72('0x38')],'type':_0x4428b7['type'][_0xff72('0x39')]};});_0x36b755[_0xff72('0x3a')]=_['map'](_0xe19e1f,_0xff72('0x27'));_0x36b755[_0xff72('0x3b')]=_[_0xff72('0x3c')](_0x2c3aaa['query']);_0x36b755[_0xff72('0x3d')]=_[_0xff72('0x3e')](_0x36b755[_0xff72('0x3a')],_0x36b755[_0xff72('0x3b')]);_0x1c9f9d['attributes']=_[_0xff72('0x3e')](_0x36b755['model'],qs[_0xff72('0x3f')](_0x2c3aaa['query'][_0xff72('0x3f')]));_0x1c9f9d[_0xff72('0x40')]=_0x1c9f9d[_0xff72('0x40')][_0xff72('0x41')]?_0x1c9f9d[_0xff72('0x40')]:_0x36b755[_0xff72('0x3a')];if(!_0x2c3aaa['query'][_0xff72('0x42')](_0xff72('0x43'))){_0x1c9f9d[_0xff72('0x44')]=qs['limit'](_0x2c3aaa[_0xff72('0x3b')]['limit']);_0x1c9f9d[_0xff72('0x1c')]=qs['offset'](_0x2c3aaa['query']['offset']);}_0x1c9f9d[_0xff72('0x45')]=qs[_0xff72('0x46')](_0x2c3aaa[_0xff72('0x3b')]['sort']);_0x1c9f9d['where']=qs[_0xff72('0x3d')](_[_0xff72('0x47')](_0x2c3aaa[_0xff72('0x3b')],_0x36b755[_0xff72('0x3d')]),_0xe19e1f);var _0x5a39e1=[];var _0x399683=squel['select']()[_0xff72('0x48')]('id')[_0xff72('0x48')]('name')[_0xff72('0x48')](_0xff72('0x49'))[_0xff72('0x4a')]('tools_tags');var _0x4c4511=squel['select']()[_0xff72('0x48')]('u.id')[_0xff72('0x48')]('u.fullname')['field'](_0xff72('0x4b'))[_0xff72('0x4a')]('user_has_sms_interactions','ui')[_0xff72('0x4c')]('users','u',_0xff72('0x4d'));var _0x538730=squel[_0xff72('0x4e')]()[_0xff72('0x4a')](_0xff72('0x4f'),'i')[_0xff72('0x4c')](_0xff72('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xff72('0x51'))['left_join'](_0xff72('0x52'),'a',_0xff72('0x53'))[_0xff72('0x4c')](_0xff72('0x54'),'me',_0xff72('0x55'))[_0xff72('0x4c')](_0xff72('0x56'),'it',_0xff72('0x57'))[_0xff72('0x4c')](_0xff72('0x58'),'t',_0xff72('0x59'));var _0x2cb6d9=squel['expr']();var _0x5daa1c=[];var _0x330ecd=squel[_0xff72('0x5a')]();var _0x3c8ac4;if(_0x2c3aaa[_0xff72('0x3b')][_0xff72('0x5b')]){_0x3c8ac4=as[_0xff72('0x5c')](_0x2c3aaa['query'][_0xff72('0x5b')]);var _0x7649b=_0x3c8ac4[_0xff72('0x5d')];for(var _0x88f595=0x0;_0x88f595<_0x3c8ac4[_0xff72('0x5e')][_0xff72('0x41')];_0x88f595++){var _0x23a63f=_0x3c8ac4[_0xff72('0x5e')][_0x88f595];var _0x1b073d='i';var _0x131ffa=_['find'](_0xe19e1f,[_0xff72('0x27'),_0x23a63f['field']]);if(!_0x131ffa){switch(_0x23a63f[_0xff72('0x48')]){case _0xff72('0x5f'):if(_0x23a63f[_0xff72('0x60')]==0x1){_0x538730['having']('`'+_0x23a63f['field']+_0xff72('0x61'));}else{_0x538730[_0xff72('0x62')]('`'+_0x23a63f[_0xff72('0x48')]+_0xff72('0x63'));}break;case'Contact':if(_0x23a63f[_0xff72('0x64')]==='$substring'){if(_0x23a63f['value'][_0xff72('0x65')]('\x20')[_0xff72('0x41')]>0x1){_0x2cb6d9[_0x7649b](_0xff72('0x66'),qs[_0xff72('0x67')](_0x23a63f[_0xff72('0x60')]),null);}else{var _0x5d5a60='%'+_0x23a63f['value']+'%';_0x2cb6d9[_0x7649b](_0xff72('0x68'),_0x5d5a60,_0x5d5a60,_0x5d5a60);}}else{_0x131ffa=_[_0xff72('0x69')](_0xe19e1f,[_0xff72('0x27'),_0xff72('0x6a')]);_0x23a63f[_0xff72('0x48')]='ContactId';_0x595e1b=as['buildExpression'](_0x1b073d,_0x131ffa[_0xff72('0x6b')],_0x23a63f);_0x2cb6d9[_0x7649b](_0x595e1b[_0xff72('0x6c')],_0x595e1b[_0xff72('0x60')][_0xff72('0x6d')],_0x595e1b[_0xff72('0x60')]['end']);}break;case _0xff72('0x6e'):var _0x5eb634=_0x23a63f[_0xff72('0x60')][_0xff72('0x65')](',')[_0xff72('0x28')](function(_0xd85781){return Number(_0xd85781);});_0x5eb634[_0xff72('0x2c')](function(_0x20e126){_0x330ecd['or'](_0xff72('0x6f'),'%,'+_0x20e126+',%');});_0x5daa1c=_[_0xff72('0x70')](_0x5daa1c,_0x5eb634);break;case _0xff72('0x71'):if(_0x23a63f['operator']==='$substring'){_0x2cb6d9[_0x7649b](_0xff72('0x72'),'%'+_0x23a63f['value']+'%',null);}else{_0x131ffa=_['find'](_0xe19e1f,[_0xff72('0x27'),_0xff72('0x34')]);_0x23a63f[_0xff72('0x48')]=_0xff72('0x34');_0x595e1b=as[_0xff72('0x73')](_0x1b073d,_0x131ffa[_0xff72('0x6b')],_0x23a63f);_0x2cb6d9[_0x7649b](_0x595e1b[_0xff72('0x6c')],_0x595e1b[_0xff72('0x60')]['start'],_0x595e1b['value']['end']);}break;case'body':_0x595e1b=as[_0xff72('0x73')]('me',null,_0x23a63f);_0x2cb6d9[_0x7649b](_0x595e1b['text'],_0x595e1b['value'][_0xff72('0x6d')],_0x595e1b[_0xff72('0x60')]['end']);break;}}else{var _0x595e1b=as['buildExpression'](_0x1b073d,_0x131ffa[_0xff72('0x6b')],_0x23a63f);_0x2cb6d9[_0x7649b](_0x595e1b[_0xff72('0x6c')],_0x595e1b[_0xff72('0x60')][_0xff72('0x6d')],_0x595e1b[_0xff72('0x60')]['end']);}}}else{var _0x1df05b=_(_0x2c3aaa[_0xff72('0x3b')])[_0xff72('0x3c')]()['map'](function(_0x221a58){return _[_0xff72('0x74')](_0xe19e1f,['name',_0x221a58])?_0x221a58:undefined;})[_0xff72('0x75')]()[_0xff72('0x60')]();if(!_['isEmpty'](_0x1df05b)){_0x1df05b[_0xff72('0x2c')](function(_0x182488){if(_0x182488===_0xff72('0x76')){_0x538730[_0xff72('0x77')](_0xff72('0x78'),[][_0xff72('0x79')](_0x2c3aaa[_0xff72('0x3b')][_0x182488]));}else if(_0x182488===_0xff72('0x7a')){var _0x15d3be=JSON['parse'](_0x2c3aaa['query'][_0x182488])[_0xff72('0x7b')];var _0x4e9746=JSON['parse'](_0x2c3aaa[_0xff72('0x3b')][_0x182488])[_0xff72('0x7c')];_0x538730[_0xff72('0x77')](_0xff72('0x7d'),_0x15d3be,_0x4e9746);}else{if(_0x2c3aaa[_0xff72('0x3b')][_0x182488]===_0xff72('0x7e')){_0x538730['where']('i.'+_0x182488+_0xff72('0x7f'));}else{_0x538730[_0xff72('0x77')]('i.'+_0x182488+_0xff72('0x80'),_0x2c3aaa['query'][_0x182488]);}}});}if(_0x2c3aaa[_0xff72('0x3b')]['read']){if(_0x2c3aaa[_0xff72('0x3b')]['read']==0x1){_0x538730[_0xff72('0x62')](_0xff72('0x81'));}else{_0x538730[_0xff72('0x62')](_0xff72('0x82'));}}if(_0x2c3aaa['query']['tag']){_0x5daa1c=_[_0xff72('0x83')](_0x2c3aaa[_0xff72('0x3b')]['tag'])?_0x2c3aaa[_0xff72('0x3b')][_0xff72('0x84')]:new Array(_0x2c3aaa[_0xff72('0x3b')][_0xff72('0x84')]);_0x5daa1c[_0xff72('0x2c')](function(_0x436867){_0x330ecd['or'](_0xff72('0x6f'),'%,'+_0x436867+',%');});}if(_0x2c3aaa[_0xff72('0x3b')]['filter']){var _0x12ef8f=_0x2c3aaa['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x12ef8f)){_0x2cb6d9['or'](_0xff72('0x85'),_0x12ef8f+'%')['or'](_0xff72('0x86'),_0x12ef8f+'%');}else{_0x2cb6d9['or'](_0xff72('0x87'),qs[_0xff72('0x67')](_0x12ef8f))['or'](_0xff72('0x88'),_0x12ef8f+'%');}}}_0x538730['where'](_0x2cb6d9);_0x538730['group'](_0xff72('0x89'));var _0x39266d={'type':db[_0xff72('0x8a')][_0xff72('0x8b')][_0xff72('0x8c')],'raw':!![]};var _0x4cbba8=_0x538730[_0xff72('0x8d')]();_0x4cbba8[_0xff72('0x48')](_0xff72('0x89'));_0x4cbba8[_0xff72('0x48')](_0xff72('0x8e'),_0xff72('0x5f'));if(_0x1c9f9d[_0xff72('0x45')]){_0x1c9f9d[_0xff72('0x45')][_0xff72('0x2c')](function(_0x1fc96e){var _0x492f7b=_0x1fc96e[0x0]===_0xff72('0x8f')?_0x1fc96e[0x0]:'i.'+_0x1fc96e[0x0];_0x538730['order'](_0x492f7b,_0x1fc96e[0x1]===_0xff72('0x90')?![]:!![]);});}if(!_[_0xff72('0x91')](_0x5daa1c)){_0x538730[_0xff72('0x62')](_0x330ecd);_0x4cbba8['where'](_0xff72('0x92'),_0x5daa1c);}BPromise[_0xff72('0x93')]()[_0xff72('0x23')](function(){if(!_0x3c8ac4){if(_0x2c3aaa['query']['SmsAccountId'])return;_0x4cbba8[_0xff72('0x77')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x538730[_0xff72('0x77')](_0xff72('0x94'));return;}if(_0x2c3aaa['user'][_0xff72('0x95')]!==_0xff72('0x96'))return;return _0x2c3aaa[_0xff72('0x97')][_0xff72('0x98')]({'attributes':['id'],'raw':!![]})[_0xff72('0x23')](function(_0x2f5e52){if(_[_0xff72('0x91')](_0x2f5e52)){_0x4cbba8['where']('i.SmsAccountId\x20IS\x20NULL');_0x538730['where'](_0xff72('0x99'));}else{_0x4cbba8[_0xff72('0x77')](_0xff72('0x78'),_[_0xff72('0x28')](_0x2f5e52,'id'));_0x538730[_0xff72('0x77')]('i.SmsAccountId\x20IN\x20?',_[_0xff72('0x28')](_0x2f5e52,'id'));}});})['then'](function(){if(_0x2c3aaa[_0xff72('0x97')][_0xff72('0x95')]==='agent'&&!_0x3c8ac4&&!_0x2c3aaa[_0xff72('0x3b')]['SmsAccountId'])return[];return db['sequelize'][_0xff72('0x3b')](_0x4cbba8[_0xff72('0x9a')](),_0x39266d);})['then'](function(_0x32c670){_0xd19d7a['count']=_0x32c670[_0xff72('0x41')];if(_0xd19d7a[_0xff72('0x9b')]===0x0)return[];return db['sequelize'][_0xff72('0x3b')](_0x399683[_0xff72('0x9a')](),_0x39266d)['then'](function(_0x1739bb){_0x5a39e1=_[_0xff72('0x9c')](_0x1739bb,'id');_0x39266d=_[_0xff72('0x9d')](_0x39266d,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c3aaa['query'][_0xff72('0x3f')]){_0x1c9f9d[_0xff72('0x40')][_0xff72('0x2c')](function(_0x33f0c2){_0x538730['field']('i.'+_0x33f0c2);});}else{_0x538730['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x538730[_0xff72('0x48')](_0xff72('0x9e'),_0xff72('0x9f'));_0x538730[_0xff72('0x48')](_0xff72('0xa0'),_0xff72('0xa1'));_0x538730[_0xff72('0x48')](_0xff72('0xa2'),'contactName');_0x538730[_0xff72('0x48')](_0xff72('0xa3'));_0x538730['field'](_0xff72('0xa4'),_0xff72('0xa5'));_0x538730['field'](_0xff72('0xa6'),_0xff72('0xa7'));_0x538730['field'](_0xff72('0xa8'),_0xff72('0xa9'));_0x538730[_0xff72('0x48')](_0xff72('0xaa'),_0xff72('0xab'));_0x538730[_0xff72('0x48')](_0xff72('0xac'),_0xff72('0xad'));_0x538730[_0xff72('0x48')](_0xff72('0xae'),'Contact.fax');_0x538730[_0xff72('0x48')]('o.fullname',_0xff72('0xaf'));_0x538730['field'](_0xff72('0xb0'),'Owner.internal');_0x538730[_0xff72('0x48')](_0xff72('0xb1'),'TagIds');}if(_0x1c9f9d[_0xff72('0x44')])_0x538730[_0xff72('0x44')](_0x1c9f9d[_0xff72('0x44')]);if(_0x1c9f9d[_0xff72('0x1c')])_0x538730[_0xff72('0x1c')](_0x1c9f9d['offset']);return db['sequelize'][_0xff72('0x3b')](_0x538730[_0xff72('0x9a')](),_0x39266d);})[_0xff72('0x23')](function(_0x1c0136){if(_0x1c0136[_0xff72('0x41')]>0x0)_0x4c4511['where'](_0xff72('0xb2'),_[_0xff72('0x28')](_0x1c0136,'id'));return db['sequelize']['query'](_0x4c4511[_0xff72('0x9a')](),_0x39266d)[_0xff72('0x23')](function(_0x4b5067){var _0x437ca7=_[_0xff72('0xb3')](_0x4b5067,_0xff72('0xb4'));var _0x4a298a=[];_0x1c0136[_0xff72('0x2c')](function(_0x1a92c5){_0x4a298a[_0xff72('0x2d')](updateSmsInteraction(_0x1a92c5,_0x5a39e1,_0x437ca7));});return BPromise[_0xff72('0xb5')](_0x4a298a);});});})[_0xff72('0x23')](function(_0x12e2a0){_0xd19d7a[_0xff72('0xb6')]=_0x12e2a0;return _0xd19d7a;})[_0xff72('0x23')](respondWithFilteredResult(_0xe84ee2,_0x1c9f9d))[_0xff72('0x2e')](handleError(_0xe84ee2,null));};exports['show']=function(_0x5e21fe,_0x40e3f0){var _0x561165={'raw':![],'where':{'id':_0x5e21fe[_0xff72('0xb7')]['id']}},_0x1ed378={};_0x1ed378[_0xff72('0x3a')]=_[_0xff72('0x3c')](db[_0xff72('0x36')][_0xff72('0x37')]);_0x1ed378[_0xff72('0x3b')]=_['keys'](_0x5e21fe[_0xff72('0x3b')]);_0x1ed378['filters']=_[_0xff72('0x3e')](_0x1ed378['model'],_0x1ed378[_0xff72('0x3b')]);_0x561165['attributes']=_[_0xff72('0x3e')](_0x1ed378[_0xff72('0x3a')],qs[_0xff72('0x3f')](_0x5e21fe['query']['fields']));_0x561165[_0xff72('0x40')]=_0x561165[_0xff72('0x40')]['length']?_0x561165[_0xff72('0x40')]:_0x1ed378[_0xff72('0x3a')];if(_0x5e21fe['query'][_0xff72('0xb8')]){_0x561165['include']=[{'all':!![]}];}_0x561165=_[_0xff72('0x9d')]({},_0x561165,_0x5e21fe[_0xff72('0xb9')]);return db[_0xff72('0x36')][_0xff72('0x69')](_0x561165)[_0xff72('0x23')](handleEntityNotFound(_0x40e3f0,null))[_0xff72('0x23')](respondWithResult(_0x40e3f0,null))['catch'](handleError(_0x40e3f0,null));};exports[_0xff72('0xba')]=function(_0x1da992,_0x2e43c9){return db['SmsInteraction'][_0xff72('0xba')](_0x1da992[_0xff72('0xbb')],{})['then'](respondWithResult(_0x2e43c9,0xc9))[_0xff72('0x2e')](handleError(_0x2e43c9,null));};exports[_0xff72('0x22')]=function(_0x1cc6d1,_0x22c874){if(_0x1cc6d1[_0xff72('0xbb')]['id']){delete _0x1cc6d1[_0xff72('0xbb')]['id'];}return db[_0xff72('0x36')]['find']({'where':{'id':_0x1cc6d1[_0xff72('0xb7')]['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x22c874,null))[_0xff72('0x23')](saveUpdates(_0x1cc6d1[_0xff72('0xbb')],null))[_0xff72('0x23')](respondWithResult(_0x22c874,null))['catch'](handleError(_0x22c874,null));};exports['destroy']=function(_0x2c2b3d,_0x3b450a){return db['SmsInteraction'][_0xff72('0x69')]({'where':{'id':_0x2c2b3d[_0xff72('0xb7')]['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x3b450a,null))[_0xff72('0x23')](removeEntity(_0x3b450a,null))[_0xff72('0x2e')](handleError(_0x3b450a,null));};exports[_0xff72('0xbc')]=function(_0x57b72d,_0x3bf5a2){return db['SmsInteraction'][_0xff72('0xbc')]()['then'](respondWithResult(_0x3bf5a2,null))[_0xff72('0x2e')](handleError(_0x3bf5a2,null));};exports['addMessage']=function(_0x5d83d4,_0x5c061b,_0x171d0){return db[_0xff72('0xbd')][_0xff72('0x69')]({'where':{'id':_0x5d83d4[_0xff72('0xb7')]['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x5c061b,null))[_0xff72('0x23')](function(_0x4f3888){if(_0x4f3888){return _0x4f3888[_0xff72('0xbe')](_0x5d83d4[_0xff72('0xbb')]['ids'],_[_0xff72('0xbf')](_0x5d83d4['body'],[_0xff72('0xc0'),'id'])||{});}})[_0xff72('0x23')](respondWithResult(_0x5c061b,null))[_0xff72('0x2e')](handleError(_0x5c061b,null));};exports[_0xff72('0xc1')]=function(_0x155ba6,_0x192439,_0x39b134){var _0x46e7c7={'raw':![],'where':{}};var _0x1e9112={};var _0x4f81dc={'count':0x0,'rows':[]};return db[_0xff72('0x36')]['findOne']({'where':{'id':_0x155ba6[_0xff72('0xb7')]['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x192439,null))[_0xff72('0x23')](function(_0x23bdc2){if(_0x23bdc2){_0x1e9112[_0xff72('0x3a')]=_[_0xff72('0x3c')](db[_0xff72('0xbd')]['rawAttributes']);_0x1e9112[_0xff72('0x3b')]=_[_0xff72('0x3c')](_0x155ba6[_0xff72('0x3b')]);_0x1e9112[_0xff72('0x3d')]=_[_0xff72('0x3e')](_0x1e9112['model'],_0x1e9112[_0xff72('0x3b')]);_0x46e7c7[_0xff72('0x40')]=_['intersection'](_0x1e9112[_0xff72('0x3a')],qs[_0xff72('0x3f')](_0x155ba6[_0xff72('0x3b')][_0xff72('0x3f')]));_0x46e7c7[_0xff72('0x40')]=_0x46e7c7[_0xff72('0x40')][_0xff72('0x41')]?_0x46e7c7[_0xff72('0x40')]:_0x1e9112[_0xff72('0x3a')];if(!_0x155ba6[_0xff72('0x3b')][_0xff72('0x42')](_0xff72('0x43'))){_0x46e7c7[_0xff72('0x44')]=qs['limit'](_0x155ba6[_0xff72('0x3b')]['limit']);_0x46e7c7[_0xff72('0x1c')]=qs['offset'](_0x155ba6[_0xff72('0x3b')][_0xff72('0x1c')]);}_0x46e7c7['order']=qs[_0xff72('0x46')](_0x155ba6[_0xff72('0x3b')]['sort']);_0x46e7c7[_0xff72('0x77')]=qs[_0xff72('0x3d')](_[_0xff72('0x47')](_0x155ba6[_0xff72('0x3b')],_0x1e9112[_0xff72('0x3d')]));_0x46e7c7[_0xff72('0x77')]['SmsInteractionId']=_0x23bdc2['id'];if(_0x155ba6[_0xff72('0x3b')]['filter']){_0x46e7c7[_0xff72('0x77')]=_[_0xff72('0x9d')](_0x46e7c7[_0xff72('0x77')],{'$or':_[_0xff72('0x28')](_0x46e7c7[_0xff72('0x40')],function(_0x3be676){var _0x5de436={};_0x5de436[_0x3be676]={'$like':'%'+_0x155ba6[_0xff72('0x3b')][_0xff72('0xc2')]+'%'};return _0x5de436;})});}if(_0x155ba6['query'][_0xff72('0x7b')]){var _0x232f4e=_0x155ba6[_0xff72('0x3b')][_0xff72('0x7b')][_0xff72('0x65')](',');var _0x263b00={};_0x263b00[_0x232f4e[0x0]]={'$gte':moment(_0x232f4e[0x1])[_0xff72('0xc3')](_0xff72('0xc4'))};_0x46e7c7[_0xff72('0x77')]=_[_0xff72('0x9d')](_0x46e7c7['where'],_0x263b00);}_0x46e7c7=_['merge']({},_0x46e7c7,_0x155ba6[_0xff72('0xb9')]);return db[_0xff72('0xbd')][_0xff72('0x9b')]({'where':_0x46e7c7['where']})['then'](function(_0x57ace0){_0x4f81dc[_0xff72('0x9b')]=_0x57ace0;if(_0x155ba6['query'][_0xff72('0xb8')]){_0x46e7c7[_0xff72('0xc5')]=[{'all':!![]}];}return db[_0xff72('0xbd')]['findAll'](_0x46e7c7);})[_0xff72('0x23')](function(_0x4fc0d9){_0x4f81dc[_0xff72('0xb6')]=_0x4fc0d9;return _0x4f81dc;});}})[_0xff72('0x23')](respondWithFilteredResult(_0x192439,_0x46e7c7))[_0xff72('0x2e')](handleError(_0x192439,null));};exports[_0xff72('0xc6')]=function(_0x16a62e,_0x408dba,_0x4747d){return db[_0xff72('0x36')][_0xff72('0x69')]({'where':{'id':_0x16a62e['params']['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x408dba,null))[_0xff72('0x23')](function(_0x106259){if(_0x106259){return _0x106259[_0xff72('0xc7')](_0x16a62e[_0xff72('0xbb')][_0xff72('0xc0')],_[_0xff72('0xbf')](_0x16a62e[_0xff72('0xbb')],[_0xff72('0xc0'),'id'])||{})['spread'](function(){return db[_0xff72('0x6e')][_0xff72('0xc8')]({'attributes':['id',_0xff72('0x27'),_0xff72('0x49')],'where':{'id':_0x16a62e[_0xff72('0xbb')][_0xff72('0xc0')]}});})[_0xff72('0x23')](function(_0x1d7359){socket[_0xff72('0xc9')](_0xff72('0xca'),{'id':Number(_0x16a62e[_0xff72('0xb7')]['id']),'tags':_0x1d7359||[]});return{'id':Number(_0x16a62e['params']['id']),'tags':_0x1d7359||[]};});}})[_0xff72('0x23')](respondWithResult(_0x408dba,null))[_0xff72('0x2e')](handleError(_0x408dba,null));};exports['removeTags']=function(_0x55fa95,_0x1277f8,_0x4ecbfe){return db[_0xff72('0x36')][_0xff72('0x69')]({'where':{'id':_0x55fa95['params']['id']}})[_0xff72('0x23')](handleEntityNotFound(_0x1277f8,null))[_0xff72('0x23')](function(_0x16adf9){if(_0x16adf9){return _0x16adf9['removeTags'](_0x55fa95['query'][_0xff72('0xc0')]);}})[_0xff72('0x23')](respondWithStatusCode(_0x1277f8,null))[_0xff72('0x2e')](handleError(_0x1277f8,null));};exports['download']=function(_0x2d5c73,_0x44ddf2){var _0x63fe12=moment()[_0xff72('0xcb')]()['toString']();var _0x298593=path[_0xff72('0xcc')](config[_0xff72('0xcd')],_0xff72('0xce'),_0xff72('0xcf'),_0xff72('0xd0'));var _0x2ec222=path[_0xff72('0xcc')](config[_0xff72('0xcd')],_0xff72('0xce'),_0xff72('0xcf'),_0xff72('0xd1'));var _0x467c39=path[_0xff72('0xcc')](_0x298593,_0x63fe12);var _0x804adf=util['format'](_0xff72('0xd2'),_0x2d5c73['params']['id'],_0x63fe12);var _0x2d8136=path[_0xff72('0xcc')](_0x298593,_0x804adf);var _0x14ae80=[];_0x14ae80[_0xff72('0x2d')]({'model':db[_0xff72('0x71')],'as':'User','attributes':['id',_0xff72('0x29')],'raw':!![]});_0x14ae80[_0xff72('0x2d')]({'model':db['CmContact'],'as':_0xff72('0xd3'),'attributes':['id',_0xff72('0xd4'),_0xff72('0xd5')],'raw':!![]});var _0x3b6c90=[{'model':db[_0xff72('0xbd')],'as':'Messages','attributes':['id',_0xff72('0xbb'),_0xff72('0x7a'),'direction',_0xff72('0xd6'),_0xff72('0xd7')],'include':_0x14ae80}];_0x3b6c90[_0xff72('0x2d')]({'model':db[_0xff72('0xd8')],'as':_0xff72('0xd9'),'attributes':['id',_0xff72('0x27')]});_0x3b6c90[_0xff72('0x2d')]({'model':db[_0xff72('0x71')],'as':'Owner','attributes':['id',_0xff72('0x29')]});return db['SmsInteraction']['find']({'where':{'id':_0x2d5c73['params']['id']},'include':_0x3b6c90})[_0xff72('0x23')](handleEntityNotFound(_0x44ddf2,null))[_0xff72('0x23')](function(_0x4d6b47){if(_0x4d6b47){var _0x5a585e=_0x4d6b47[_0xff72('0xda')]({'plain':!![]});fs['mkdirSync'](_0x467c39);var _0xf9387b={'channel':_0xff72('0xdb'),'account':_0x5a585e['Account'][_0xff72('0x27')],'agent':_0x5a585e['Owner']?_0x5a585e[_0xff72('0xdc')][_0xff72('0x29')]:'N.A.','createdAt':moment(_0x5a585e[_0xff72('0x7a')])[_0xff72('0xc3')](_0xff72('0xc4'))['toString'](),'closedAt':_0x5a585e[_0xff72('0x33')]?moment(_0x5a585e['closedAt'])[_0xff72('0xc3')](_0xff72('0xc4'))[_0xff72('0x9a')]():'','disposition':_0x5a585e['disposition'],'messages':_(_0x5a585e[_0xff72('0xdd')])['filter']({'secret':![]})[_0xff72('0x28')](function(_0x44294c){return{'date':moment(_0x44294c[_0xff72('0x7a')])[_0xff72('0xc3')](_0xff72('0xc4'))[_0xff72('0x9a')](),'sender':_0x44294c[_0xff72('0xde')]===_0xff72('0xdf')?_0x44294c[_0xff72('0x71')]?_0x44294c[_0xff72('0x71')][_0xff72('0x29')]:_0xff72('0xe0'):_0x44294c[_0xff72('0xd3')][_0xff72('0xd4')]+(_0x44294c[_0xff72('0xd3')]['lastName']?'\x20'+_0x44294c['Contact'][_0xff72('0xd5')]:''),'body':_0x44294c['body'],'direction':_0x44294c[_0xff72('0xde')]==='out'?'A':'C','secret':_0x44294c['secret'],'read':_0x44294c[_0xff72('0xd7')]};})[_0xff72('0x60')]()};return ejs[_0xff72('0xe1')](path['join'](config[_0xff72('0xcd')],_0xff72('0xce'),'views',_0xff72('0xe2')),{'interaction':_0xf9387b})[_0xff72('0x23')](function(_0x472fa6){var _0x33394a=path[_0xff72('0xcc')](_0x467c39,_0xff72('0xe3')+_0x5a585e['id']+'-'+_0x63fe12+_0xff72('0xe4'));var _0x1020c3={'path':_0x33394a,'channel':_0xff72('0xdb'),'interactionId':_0x5a585e['id']};return pdf[_0xff72('0xe5')](_0x472fa6,_0x1020c3);})[_0xff72('0x23')](function(){return new BPromise(function(_0x81787a,_0xe3b066){zipdir(_0x467c39,{'saveTo':_0x2d8136},function(_0xb3e683,_0xea6035){if(_0xb3e683)return _0xe3b066(_0xb3e683);return _0x81787a(_0xea6035);});})[_0xff72('0x23')](function(){return new BPromise(function(_0x3c77b7,_0x1b03c6){rimraf(_0x467c39,function(_0x2133d2){if(_0x2133d2)_0x1b03c6(_0x2133d2);return _0x3c77b7();});});})[_0xff72('0x23')](function(){return _0x44ddf2[_0xff72('0xe6')](_0x2d8136,_0x804adf,function(_0x7ee345){if(_0x7ee345){console[_0xff72('0xe7')]('err',_0x7ee345);}else{fs[_0xff72('0xe8')](_0x2d8136);}});});});}else{return _0x44ddf2['sendStatus'](0xc8);}})[_0xff72('0x2e')](handleError(_0x44ddf2,null));}; \ No newline at end of file +var _0x4e86=['firstName','SmsAccount','Account','Owner','get','Sms','N.A.','disposition','Messages','out','System','lastName','direction','secret','views','downloadInteraction.ejs','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','then','destroy','sendStatus','stack','name','send','map','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','closed','UserId','total','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','operator','body','some','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','all','rows','catch','show','includeAll','options','create','update','params','describe','addMessage','ids','omit','getMessages','SmsMessage','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','emit','smsInteractionTags:save','removeTags','download','unix','join','root','files','server','transcript-%d-%s.zip','User','fullname','Contact'];(function(_0x235907,_0x38cf0b){var _0x3ccda3=function(_0x7aab53){while(--_0x7aab53){_0x235907['push'](_0x235907['shift']());}};_0x3ccda3(++_0x38cf0b);}(_0x4e86,0xf1));var _0x64e8=function(_0x48507b,_0x5f0ac5){_0x48507b=_0x48507b-0x0;var _0x97adb2=_0x4e86[_0x48507b];return _0x97adb2;};'use strict';var emlformat=require(_0x64e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64e8('0x2'));var moment=require(_0x64e8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x64e8('0x4'));var util=require(_0x64e8('0x5'));var path=require(_0x64e8('0x6'));var sox=require(_0x64e8('0x7'));var csv=require('to-csv');var ejs=require(_0x64e8('0x8'));var fs=require('fs');var fs_extra=require(_0x64e8('0x9'));var _=require(_0x64e8('0xa'));var squel=require(_0x64e8('0xb'));var crypto=require(_0x64e8('0xc'));var jsforce=require(_0x64e8('0xd'));var deskjs=require(_0x64e8('0xe'));var toCsv=require(_0x64e8('0xf'));var querystring=require('querystring');var Papa=require(_0x64e8('0x10'));var Redis=require('ioredis');var authService=require(_0x64e8('0x11'));var qs=require(_0x64e8('0x12'));var as=require(_0x64e8('0x13'));var pdf=require(_0x64e8('0x14'));var hardwareService=require(_0x64e8('0x15'));var logger=require('../../config/logger')(_0x64e8('0x16'));var utils=require(_0x64e8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x64e8('0x18'));var db=require('../../mysqldb')['db'];config[_0x64e8('0x19')]=_['defaults'](config['redis'],{'host':_0x64e8('0x1a'),'port':0x18eb});var socket=require(_0x64e8('0x1b'))(new Redis(config[_0x64e8('0x19')]));require(_0x64e8('0x1c'))[_0x64e8('0x1d')](socket);function respondWithStatusCode(_0x5c80e8,_0x5882d5){_0x5882d5=_0x5882d5||0xcc;return function(_0x251eb2){if(_0x251eb2){return _0x5c80e8['sendStatus'](_0x5882d5);}return _0x5c80e8[_0x64e8('0x1e')](_0x5882d5)[_0x64e8('0x1f')]();};}function respondWithResult(_0x130570,_0xc2143){_0xc2143=_0xc2143||0xc8;return function(_0x313616){if(_0x313616){return _0x130570[_0x64e8('0x1e')](_0xc2143)[_0x64e8('0x20')](_0x313616);}};}function respondWithFilteredResult(_0x55f306,_0x198b1e){return function(_0x56bc65){if(_0x56bc65){var _0x488d35=typeof _0x198b1e[_0x64e8('0x21')]===_0x64e8('0x22')&&typeof _0x198b1e[_0x64e8('0x23')]===_0x64e8('0x22');var _0x591e00=_0x56bc65['count'];var _0xa33f76=_0x488d35?0x0:_0x198b1e['offset'];var _0x439bf2=_0x488d35?_0x56bc65[_0x64e8('0x24')]:_0x198b1e[_0x64e8('0x21')]+_0x198b1e[_0x64e8('0x23')];var _0x4f0cbc;if(_0x439bf2>=_0x591e00){_0x439bf2=_0x591e00;_0x4f0cbc=0xc8;}else{_0x4f0cbc=0xce;}_0x55f306['status'](_0x4f0cbc);return _0x55f306['set']('Content-Range',_0xa33f76+'-'+_0x439bf2+'/'+_0x591e00)[_0x64e8('0x20')](_0x56bc65);}return null;};}function patchUpdates(_0x26428f){return function(_0x5899ef){try{jsonpatch[_0x64e8('0x25')](_0x5899ef,_0x26428f,!![]);}catch(_0xea5783){return BPromise[_0x64e8('0x26')](_0xea5783);}return _0x5899ef['save']();};}function saveUpdates(_0x517947,_0x77e55a){return function(_0x39b963){if(_0x39b963){return _0x39b963['update'](_0x517947)[_0x64e8('0x27')](function(_0x581767){return _0x581767;});}return null;};}function removeEntity(_0x12ef7a,_0x8d947c){return function(_0x2a6ee5){if(_0x2a6ee5){return _0x2a6ee5[_0x64e8('0x28')]()[_0x64e8('0x27')](function(){_0x12ef7a['status'](0xcc)[_0x64e8('0x1f')]();});}};}function handleEntityNotFound(_0xb547de,_0x3bcfb6){return function(_0x49873){if(!_0x49873){_0xb547de[_0x64e8('0x29')](0x194);}return _0x49873;};}function handleError(_0x3c1b86,_0x189574){_0x189574=_0x189574||0x1f4;return function(_0x3eb9b4){logger['error'](_0x3eb9b4[_0x64e8('0x2a')]);if(_0x3eb9b4[_0x64e8('0x2b')]){delete _0x3eb9b4['name'];}_0x3c1b86[_0x64e8('0x1e')](_0x189574)[_0x64e8('0x2c')](_0x3eb9b4);};}function getInteractionUsers(_0x3508cd,_0x581a06){return new BPromise(function(_0x192ee1,_0x8f97d3){try{if(_0x581a06[_0x3508cd['id']]){_0x3508cd['Users']=_[_0x64e8('0x2d')](_0x581a06[_0x3508cd['id']],function(_0x154dab){return{'id':_0x154dab['id'],'fullname':_0x154dab['fullname']};});}}catch(_0x44d87c){_0x8f97d3(_0x44d87c);}_0x192ee1(_0x3508cd);});}function getInteractionTags(_0x2ebca1,_0x18b02c){return new BPromise(function(_0x561f6f,_0x127c11){try{if(_0x2ebca1[_0x64e8('0x2e')]){_0x2ebca1[_0x64e8('0x2f')]=[];_0x2ebca1['TagIds'][_0x64e8('0x30')](',')[_0x64e8('0x31')](function(_0x7977aa){_0x2ebca1[_0x64e8('0x2f')][_0x64e8('0x32')](_0x18b02c[_0x7977aa]);});}delete _0x2ebca1[_0x64e8('0x2e')];}catch(_0x20f9d2){_0x127c11(_0x20f9d2);}_0x561f6f(_0x2ebca1);});}function updateSmsInteraction(_0x5afde6,_0x4e2cf0,_0xd8677d){return new BPromise(function(_0xec0f67,_0x839008){return getInteractionUsers(_0x5afde6,_0xd8677d)['then'](function(_0x59e0ae){return getInteractionTags(_0x59e0ae,_0x4e2cf0);})[_0x64e8('0x27')](function(_0x2a8515){return getStateInteraction(_0x2a8515);})['then'](function(_0x197046){_0xec0f67(_0x197046);})['catch'](function(_0x5889b4){_0x839008(_0x5889b4);});});}function getStateInteraction(_0x18ac24){return new BPromise(function(_0x1bcbfe){_0x18ac24[_0x64e8('0x33')]=0x0;_0x18ac24[_0x64e8('0x34')]=0x0;_0x18ac24[_0x64e8('0x35')]=0x0;_0x18ac24[_0x64e8('0x36')]=0x0;_0x18ac24['total']=0x0;if(!_0x18ac24[_0x64e8('0x37')]&&!_0x18ac24[_0x64e8('0x38')]){_0x18ac24[_0x64e8('0x33')]+=0x1;}if(!_0x18ac24[_0x64e8('0x37')]&&_0x18ac24['UserId']){_0x18ac24[_0x64e8('0x34')]+=0x1;if(_0x18ac24[_0x64e8('0x33')]){_0x18ac24[_0x64e8('0x33')]-=0x1;}}if(_0x18ac24[_0x64e8('0x37')]&&_0x18ac24[_0x64e8('0x38')]){_0x18ac24[_0x64e8('0x35')]+=0x1;if(_0x18ac24['talking']){_0x18ac24[_0x64e8('0x34')]-=0x1;}}if(_0x18ac24[_0x64e8('0x37')]&&!_0x18ac24[_0x64e8('0x38')]){_0x18ac24[_0x64e8('0x36')]+=0x1;if(_0x18ac24['waiting']){_0x18ac24[_0x64e8('0x33')]-=0x1;}}_0x18ac24[_0x64e8('0x39')]+=0x1;_0x1bcbfe(_0x18ac24);});}exports['index']=function(_0x35a59b,_0x2c226f){var _0x596bf8={},_0x232e9d={},_0x249d76={'count':0x0,'rows':[]};var _0xbb3250=_['map'](db['SmsInteraction'][_0x64e8('0x3a')],function(_0x2b1f4f){return{'name':_0x2b1f4f[_0x64e8('0x3b')],'type':_0x2b1f4f[_0x64e8('0x3c')]['key']};});_0x232e9d[_0x64e8('0x3d')]=_[_0x64e8('0x2d')](_0xbb3250,'name');_0x232e9d['query']=_[_0x64e8('0x3e')](_0x35a59b[_0x64e8('0x3f')]);_0x232e9d[_0x64e8('0x40')]=_['intersection'](_0x232e9d['model'],_0x232e9d[_0x64e8('0x3f')]);_0x596bf8['attributes']=_[_0x64e8('0x41')](_0x232e9d[_0x64e8('0x3d')],qs[_0x64e8('0x42')](_0x35a59b['query'][_0x64e8('0x42')]));_0x596bf8['attributes']=_0x596bf8[_0x64e8('0x43')][_0x64e8('0x44')]?_0x596bf8[_0x64e8('0x43')]:_0x232e9d['model'];if(!_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x45')]('nolimit')){_0x596bf8[_0x64e8('0x23')]=qs['limit'](_0x35a59b['query'][_0x64e8('0x23')]);_0x596bf8[_0x64e8('0x21')]=qs[_0x64e8('0x21')](_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x21')]);}_0x596bf8[_0x64e8('0x46')]=qs[_0x64e8('0x47')](_0x35a59b['query'][_0x64e8('0x47')]);_0x596bf8['where']=qs[_0x64e8('0x40')](_['pick'](_0x35a59b['query'],_0x232e9d[_0x64e8('0x40')]),_0xbb3250);var _0x36ab5f=[];var _0x1a4155=squel[_0x64e8('0x48')]()['field']('id')[_0x64e8('0x49')](_0x64e8('0x2b'))[_0x64e8('0x49')](_0x64e8('0x4a'))[_0x64e8('0x4b')](_0x64e8('0x4c'));var _0x4c1f2e=squel[_0x64e8('0x48')]()['field'](_0x64e8('0x4d'))[_0x64e8('0x49')](_0x64e8('0x4e'))['field']('ui.SmsInteractionId')[_0x64e8('0x4b')](_0x64e8('0x4f'),'ui')[_0x64e8('0x50')](_0x64e8('0x51'),'u',_0x64e8('0x52'));var _0x4d9f6d=squel[_0x64e8('0x48')]()[_0x64e8('0x4b')](_0x64e8('0x53'),'i')[_0x64e8('0x50')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x64e8('0x50')]('users','o',_0x64e8('0x54'))[_0x64e8('0x50')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x64e8('0x50')]('sms_messages','me',_0x64e8('0x55'))[_0x64e8('0x50')](_0x64e8('0x56'),'it',_0x64e8('0x57'))[_0x64e8('0x50')](_0x64e8('0x4c'),'t',_0x64e8('0x58'));var _0x5043ea=squel[_0x64e8('0x59')]();var _0x303a61=[];var _0x422ca7=squel[_0x64e8('0x59')]();var _0x1b2de8;if(_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x5a')]){_0x1b2de8=as['parseSearch'](_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x5a')]);var _0x144d20=_0x1b2de8[_0x64e8('0x5b')];for(var _0x2454c1=0x0;_0x2454c1<_0x1b2de8[_0x64e8('0x5c')][_0x64e8('0x44')];_0x2454c1++){var _0x241d6e=_0x1b2de8['conditions'][_0x2454c1];var _0x3978af='i';var _0x529e3f=_[_0x64e8('0x5d')](_0xbb3250,[_0x64e8('0x2b'),_0x241d6e[_0x64e8('0x49')]]);if(!_0x529e3f){switch(_0x241d6e['field']){case'unreadMessages':if(_0x241d6e['value']==0x1){_0x4d9f6d[_0x64e8('0x5e')]('`'+_0x241d6e[_0x64e8('0x49')]+_0x64e8('0x5f'));}else{_0x4d9f6d[_0x64e8('0x5e')]('`'+_0x241d6e[_0x64e8('0x49')]+_0x64e8('0x60'));}break;case'Contact':if(_0x241d6e['operator']===_0x64e8('0x61')){if(_0x241d6e['value'][_0x64e8('0x30')]('\x20')[_0x64e8('0x44')]>0x1){_0x5043ea[_0x144d20](_0x64e8('0x62'),qs[_0x64e8('0x63')](_0x241d6e[_0x64e8('0x64')]),null);}else{var _0x37d872='%'+_0x241d6e['value']+'%';_0x5043ea[_0x144d20](_0x64e8('0x65'),_0x37d872,_0x37d872,_0x37d872);}}else{_0x529e3f=_['find'](_0xbb3250,[_0x64e8('0x2b'),_0x64e8('0x66')]);_0x241d6e[_0x64e8('0x49')]=_0x64e8('0x66');_0x4bc2df=as[_0x64e8('0x67')](_0x3978af,_0x529e3f[_0x64e8('0x3c')],_0x241d6e);_0x5043ea[_0x144d20](_0x4bc2df[_0x64e8('0x68')],_0x4bc2df[_0x64e8('0x64')][_0x64e8('0x69')],_0x4bc2df[_0x64e8('0x64')][_0x64e8('0x1f')]);}break;case _0x64e8('0x6a'):var _0x1b5868=_0x241d6e[_0x64e8('0x64')][_0x64e8('0x30')](',')[_0x64e8('0x2d')](function(_0x3e26d4){return Number(_0x3e26d4);});_0x1b5868['forEach'](function(_0x5c9d98){_0x422ca7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c9d98+',%');});_0x303a61=_['union'](_0x303a61,_0x1b5868);break;case'User':if(_0x241d6e[_0x64e8('0x6b')]===_0x64e8('0x61')){_0x5043ea[_0x144d20]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x241d6e[_0x64e8('0x64')]+'%',null);}else{_0x529e3f=_['find'](_0xbb3250,[_0x64e8('0x2b'),'UserId']);_0x241d6e[_0x64e8('0x49')]=_0x64e8('0x38');_0x4bc2df=as[_0x64e8('0x67')](_0x3978af,_0x529e3f[_0x64e8('0x3c')],_0x241d6e);_0x5043ea[_0x144d20](_0x4bc2df['text'],_0x4bc2df[_0x64e8('0x64')][_0x64e8('0x69')],_0x4bc2df[_0x64e8('0x64')]['end']);}break;case _0x64e8('0x6c'):_0x4bc2df=as[_0x64e8('0x67')]('me',null,_0x241d6e);_0x5043ea[_0x144d20](_0x4bc2df[_0x64e8('0x68')],_0x4bc2df['value'][_0x64e8('0x69')],_0x4bc2df['value'][_0x64e8('0x1f')]);break;}}else{var _0x4bc2df=as[_0x64e8('0x67')](_0x3978af,_0x529e3f[_0x64e8('0x3c')],_0x241d6e);_0x5043ea[_0x144d20](_0x4bc2df[_0x64e8('0x68')],_0x4bc2df[_0x64e8('0x64')][_0x64e8('0x69')],_0x4bc2df[_0x64e8('0x64')]['end']);}}}else{var _0x29472e=_(_0x35a59b[_0x64e8('0x3f')])['keys']()['map'](function(_0x5c00c2){return _[_0x64e8('0x6d')](_0xbb3250,[_0x64e8('0x2b'),_0x5c00c2])?_0x5c00c2:undefined;})['compact']()[_0x64e8('0x64')]();if(!_['isEmpty'](_0x29472e)){_0x29472e[_0x64e8('0x31')](function(_0x2ce104){if(_0x2ce104===_0x64e8('0x6e')){_0x4d9f6d[_0x64e8('0x6f')](_0x64e8('0x70'),[][_0x64e8('0x71')](_0x35a59b['query'][_0x2ce104]));}else if(_0x2ce104===_0x64e8('0x72')){var _0x46cf7a=JSON[_0x64e8('0x73')](_0x35a59b['query'][_0x2ce104])[_0x64e8('0x74')];var _0x39c674=JSON['parse'](_0x35a59b[_0x64e8('0x3f')][_0x2ce104])[_0x64e8('0x75')];_0x4d9f6d[_0x64e8('0x6f')](_0x64e8('0x76'),_0x46cf7a,_0x39c674);}else{if(_0x35a59b[_0x64e8('0x3f')][_0x2ce104]===_0x64e8('0x77')){_0x4d9f6d['where']('i.'+_0x2ce104+_0x64e8('0x78'));}else{_0x4d9f6d[_0x64e8('0x6f')]('i.'+_0x2ce104+_0x64e8('0x79'),_0x35a59b['query'][_0x2ce104]);}}});}if(_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x7a')]){if(_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x7a')]==0x1){_0x4d9f6d[_0x64e8('0x5e')](_0x64e8('0x7b'));}else{_0x4d9f6d[_0x64e8('0x5e')](_0x64e8('0x7c'));}}if(_0x35a59b[_0x64e8('0x3f')]['tag']){_0x303a61=_[_0x64e8('0x7d')](_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x7e')])?_0x35a59b[_0x64e8('0x3f')]['tag']:new Array(_0x35a59b['query']['tag']);_0x303a61['forEach'](function(_0x404767){_0x422ca7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x404767+',%');});}if(_0x35a59b['query'][_0x64e8('0x7f')]){var _0x434d26=_0x35a59b[_0x64e8('0x3f')]['filter'][_0x64e8('0x80')]('\x5c','\x5c\x5c')[_0x64e8('0x80')](/'/g,'\x27\x27');if(qs[_0x64e8('0x81')](_0x434d26)){_0x5043ea['or']('i.id\x20LIKE\x20?',_0x434d26+'%')['or'](_0x64e8('0x82'),_0x434d26+'%');}else{_0x5043ea['or'](_0x64e8('0x83'),qs[_0x64e8('0x63')](_0x434d26))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x434d26+'%');}}}_0x4d9f6d[_0x64e8('0x6f')](_0x5043ea);_0x4d9f6d[_0x64e8('0x84')]('i.id');var _0x27b41a={'type':db[_0x64e8('0x85')][_0x64e8('0x86')]['SELECT'],'raw':!![]};var _0x2adfb0=_0x4d9f6d[_0x64e8('0x87')]();_0x2adfb0['field']('i.id');_0x2adfb0[_0x64e8('0x49')](_0x64e8('0x88'),_0x64e8('0x89'));if(_0x596bf8[_0x64e8('0x46')]){_0x596bf8[_0x64e8('0x46')]['forEach'](function(_0x3a272e){var _0x5baaa3=_0x3a272e[0x0]==='contactName'?_0x3a272e[0x0]:'i.'+_0x3a272e[0x0];_0x4d9f6d[_0x64e8('0x46')](_0x5baaa3,_0x3a272e[0x1]===_0x64e8('0x8a')?![]:!![]);});}if(!_[_0x64e8('0x8b')](_0x303a61)){_0x4d9f6d[_0x64e8('0x5e')](_0x422ca7);_0x2adfb0[_0x64e8('0x6f')](_0x64e8('0x8c'),_0x303a61);}BPromise[_0x64e8('0x8d')]()['then'](function(){if(!_0x1b2de8){if(_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x6e')])return;_0x2adfb0[_0x64e8('0x6f')](_0x64e8('0x8e'));_0x4d9f6d['where'](_0x64e8('0x8e'));return;}if(_0x35a59b['user']['role']!==_0x64e8('0x8f'))return;return _0x35a59b[_0x64e8('0x90')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x64e8('0x27')](function(_0x45782e){if(_[_0x64e8('0x8b')](_0x45782e)){_0x2adfb0[_0x64e8('0x6f')](_0x64e8('0x91'));_0x4d9f6d['where'](_0x64e8('0x91'));}else{_0x2adfb0[_0x64e8('0x6f')](_0x64e8('0x70'),_[_0x64e8('0x2d')](_0x45782e,'id'));_0x4d9f6d[_0x64e8('0x6f')](_0x64e8('0x70'),_[_0x64e8('0x2d')](_0x45782e,'id'));}});})['then'](function(){if(_0x35a59b[_0x64e8('0x90')]['role']===_0x64e8('0x8f')&&!_0x1b2de8&&!_0x35a59b[_0x64e8('0x3f')][_0x64e8('0x6e')])return[];return db[_0x64e8('0x92')][_0x64e8('0x3f')](_0x2adfb0[_0x64e8('0x93')](),_0x27b41a);})['then'](function(_0xfcb610){_0x249d76[_0x64e8('0x24')]=_0xfcb610[_0x64e8('0x44')];if(_0x249d76[_0x64e8('0x24')]===0x0)return[];return db['sequelize'][_0x64e8('0x3f')](_0x1a4155['toString'](),_0x27b41a)[_0x64e8('0x27')](function(_0x34c31c){_0x36ab5f=_[_0x64e8('0x94')](_0x34c31c,'id');_0x27b41a=_[_0x64e8('0x95')](_0x27b41a,{'model':db[_0x64e8('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35a59b['query']['fields']){_0x596bf8[_0x64e8('0x43')]['forEach'](function(_0x47de90){_0x4d9f6d['field']('i.'+_0x47de90);});}else{_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0x88'),_0x64e8('0x89'));_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0x97'),_0x64e8('0x98'));_0x4d9f6d['field'](_0x64e8('0x99'),'Account.mandatoryDisposition');_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0x9a'),_0x64e8('0x9b'));_0x4d9f6d['field']('i.*');_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0x9c'),_0x64e8('0x9d'));_0x4d9f6d['field']('c.lastName',_0x64e8('0x9e'));_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0x9f'),'Contact.email');_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0xa0'),_0x64e8('0xa1'));_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0xa2'),_0x64e8('0xa3'));_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0xa4'),_0x64e8('0xa5'));_0x4d9f6d[_0x64e8('0x49')](_0x64e8('0xa6'),_0x64e8('0xa7'));_0x4d9f6d[_0x64e8('0x49')]('o.internal',_0x64e8('0xa8'));_0x4d9f6d[_0x64e8('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x64e8('0x2e'));}if(_0x596bf8[_0x64e8('0x23')])_0x4d9f6d['limit'](_0x596bf8['limit']);if(_0x596bf8[_0x64e8('0x21')])_0x4d9f6d[_0x64e8('0x21')](_0x596bf8[_0x64e8('0x21')]);return db['sequelize'][_0x64e8('0x3f')](_0x4d9f6d[_0x64e8('0x93')](),_0x27b41a);})[_0x64e8('0x27')](function(_0x2db97d){if(_0x2db97d[_0x64e8('0x44')]>0x0)_0x4c1f2e['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x64e8('0x2d')](_0x2db97d,'id'));return db[_0x64e8('0x92')][_0x64e8('0x3f')](_0x4c1f2e['toString'](),_0x27b41a)[_0x64e8('0x27')](function(_0x474fce){var _0x3b7b56=_[_0x64e8('0xa9')](_0x474fce,'SmsInteractionId');var _0x3b5a6a=[];_0x2db97d[_0x64e8('0x31')](function(_0x413bc8){_0x3b5a6a['push'](updateSmsInteraction(_0x413bc8,_0x36ab5f,_0x3b7b56));});return BPromise[_0x64e8('0xaa')](_0x3b5a6a);});});})[_0x64e8('0x27')](function(_0x3b9c7d){_0x249d76[_0x64e8('0xab')]=_0x3b9c7d;return _0x249d76;})[_0x64e8('0x27')](respondWithFilteredResult(_0x2c226f,_0x596bf8))[_0x64e8('0xac')](handleError(_0x2c226f,null));};exports[_0x64e8('0xad')]=function(_0x439647,_0x1520fb){var _0x1e83e2={'raw':![],'where':{'id':_0x439647['params']['id']}},_0x70da00={};_0x70da00[_0x64e8('0x3d')]=_['keys'](db[_0x64e8('0x96')][_0x64e8('0x3a')]);_0x70da00[_0x64e8('0x3f')]=_['keys'](_0x439647[_0x64e8('0x3f')]);_0x70da00['filters']=_[_0x64e8('0x41')](_0x70da00[_0x64e8('0x3d')],_0x70da00[_0x64e8('0x3f')]);_0x1e83e2[_0x64e8('0x43')]=_[_0x64e8('0x41')](_0x70da00['model'],qs[_0x64e8('0x42')](_0x439647[_0x64e8('0x3f')][_0x64e8('0x42')]));_0x1e83e2['attributes']=_0x1e83e2[_0x64e8('0x43')]['length']?_0x1e83e2[_0x64e8('0x43')]:_0x70da00[_0x64e8('0x3d')];if(_0x439647[_0x64e8('0x3f')][_0x64e8('0xae')]){_0x1e83e2['include']=[{'all':!![]}];}_0x1e83e2=_[_0x64e8('0x95')]({},_0x1e83e2,_0x439647[_0x64e8('0xaf')]);return db[_0x64e8('0x96')][_0x64e8('0x5d')](_0x1e83e2)[_0x64e8('0x27')](handleEntityNotFound(_0x1520fb,null))[_0x64e8('0x27')](respondWithResult(_0x1520fb,null))['catch'](handleError(_0x1520fb,null));};exports[_0x64e8('0xb0')]=function(_0x310f7e,_0x4a8d4a){return db['SmsInteraction']['create'](_0x310f7e[_0x64e8('0x6c')],{})[_0x64e8('0x27')](respondWithResult(_0x4a8d4a,0xc9))['catch'](handleError(_0x4a8d4a,null));};exports[_0x64e8('0xb1')]=function(_0x4b3639,_0x2417df){if(_0x4b3639[_0x64e8('0x6c')]['id']){delete _0x4b3639[_0x64e8('0x6c')]['id'];}return db[_0x64e8('0x96')][_0x64e8('0x5d')]({'where':{'id':_0x4b3639[_0x64e8('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2417df,null))[_0x64e8('0x27')](saveUpdates(_0x4b3639[_0x64e8('0x6c')],null))[_0x64e8('0x27')](respondWithResult(_0x2417df,null))[_0x64e8('0xac')](handleError(_0x2417df,null));};exports[_0x64e8('0x28')]=function(_0x30c811,_0x51edb9){return db[_0x64e8('0x96')][_0x64e8('0x5d')]({'where':{'id':_0x30c811[_0x64e8('0xb2')]['id']}})[_0x64e8('0x27')](handleEntityNotFound(_0x51edb9,null))['then'](removeEntity(_0x51edb9,null))[_0x64e8('0xac')](handleError(_0x51edb9,null));};exports[_0x64e8('0xb3')]=function(_0x24a776,_0x4ee628){return db[_0x64e8('0x96')][_0x64e8('0xb3')]()[_0x64e8('0x27')](respondWithResult(_0x4ee628,null))['catch'](handleError(_0x4ee628,null));};exports[_0x64e8('0xb4')]=function(_0x48d59e,_0x552ab9,_0x5618b3){return db['SmsMessage']['find']({'where':{'id':_0x48d59e[_0x64e8('0xb2')]['id']}})[_0x64e8('0x27')](handleEntityNotFound(_0x552ab9,null))['then'](function(_0x1fc03e){if(_0x1fc03e){return _0x1fc03e[_0x64e8('0xb4')](_0x48d59e['body'][_0x64e8('0xb5')],_[_0x64e8('0xb6')](_0x48d59e['body'],[_0x64e8('0xb5'),'id'])||{});}})[_0x64e8('0x27')](respondWithResult(_0x552ab9,null))[_0x64e8('0xac')](handleError(_0x552ab9,null));};exports[_0x64e8('0xb7')]=function(_0x5ae248,_0x2bbc81,_0xbc4be2){var _0x5b102a={'raw':![],'where':{}};var _0x3bd9ba={};var _0x4088aa={'count':0x0,'rows':[]};return db[_0x64e8('0x96')]['findOne']({'where':{'id':_0x5ae248[_0x64e8('0xb2')]['id']}})[_0x64e8('0x27')](handleEntityNotFound(_0x2bbc81,null))[_0x64e8('0x27')](function(_0x68035c){if(_0x68035c){_0x3bd9ba[_0x64e8('0x3d')]=_[_0x64e8('0x3e')](db[_0x64e8('0xb8')][_0x64e8('0x3a')]);_0x3bd9ba[_0x64e8('0x3f')]=_[_0x64e8('0x3e')](_0x5ae248['query']);_0x3bd9ba[_0x64e8('0x40')]=_[_0x64e8('0x41')](_0x3bd9ba[_0x64e8('0x3d')],_0x3bd9ba[_0x64e8('0x3f')]);_0x5b102a[_0x64e8('0x43')]=_[_0x64e8('0x41')](_0x3bd9ba[_0x64e8('0x3d')],qs['fields'](_0x5ae248['query'][_0x64e8('0x42')]));_0x5b102a[_0x64e8('0x43')]=_0x5b102a[_0x64e8('0x43')][_0x64e8('0x44')]?_0x5b102a['attributes']:_0x3bd9ba[_0x64e8('0x3d')];if(!_0x5ae248['query']['hasOwnProperty']('nolimit')){_0x5b102a['limit']=qs[_0x64e8('0x23')](_0x5ae248[_0x64e8('0x3f')]['limit']);_0x5b102a[_0x64e8('0x21')]=qs[_0x64e8('0x21')](_0x5ae248['query'][_0x64e8('0x21')]);}_0x5b102a[_0x64e8('0x46')]=qs['sort'](_0x5ae248[_0x64e8('0x3f')][_0x64e8('0x47')]);_0x5b102a[_0x64e8('0x6f')]=qs['filters'](_['pick'](_0x5ae248[_0x64e8('0x3f')],_0x3bd9ba[_0x64e8('0x40')]));_0x5b102a[_0x64e8('0x6f')][_0x64e8('0xb9')]=_0x68035c['id'];if(_0x5ae248[_0x64e8('0x3f')][_0x64e8('0x7f')]){_0x5b102a[_0x64e8('0x6f')]=_[_0x64e8('0x95')](_0x5b102a[_0x64e8('0x6f')],{'$or':_[_0x64e8('0x2d')](_0x5b102a[_0x64e8('0x43')],function(_0x4729f1){var _0x36a310={};_0x36a310[_0x4729f1]={'$like':'%'+_0x5ae248[_0x64e8('0x3f')][_0x64e8('0x7f')]+'%'};return _0x36a310;})});}if(_0x5ae248[_0x64e8('0x3f')][_0x64e8('0x74')]){var _0x459b5c=_0x5ae248['query'][_0x64e8('0x74')][_0x64e8('0x30')](',');var _0x5e4a14={};_0x5e4a14[_0x459b5c[0x0]]={'$gte':moment(_0x459b5c[0x1])[_0x64e8('0xba')](_0x64e8('0xbb'))};_0x5b102a[_0x64e8('0x6f')]=_[_0x64e8('0x95')](_0x5b102a['where'],_0x5e4a14);}_0x5b102a=_[_0x64e8('0x95')]({},_0x5b102a,_0x5ae248[_0x64e8('0xaf')]);return db[_0x64e8('0xb8')][_0x64e8('0x24')]({'where':_0x5b102a[_0x64e8('0x6f')]})[_0x64e8('0x27')](function(_0x3f925b){_0x4088aa['count']=_0x3f925b;if(_0x5ae248['query'][_0x64e8('0xae')]){_0x5b102a['include']=[{'all':!![]}];}return db['SmsMessage'][_0x64e8('0xbc')](_0x5b102a);})[_0x64e8('0x27')](function(_0x4d328d){_0x4088aa[_0x64e8('0xab')]=_0x4d328d;return _0x4088aa;});}})[_0x64e8('0x27')](respondWithFilteredResult(_0x2bbc81,_0x5b102a))[_0x64e8('0xac')](handleError(_0x2bbc81,null));};exports[_0x64e8('0xbd')]=function(_0x7e622c,_0x23e8f6,_0x2b9445){return db[_0x64e8('0x96')][_0x64e8('0x5d')]({'where':{'id':_0x7e622c['params']['id']}})[_0x64e8('0x27')](handleEntityNotFound(_0x23e8f6,null))[_0x64e8('0x27')](function(_0x882043){if(_0x882043){return _0x882043['setTags'](_0x7e622c[_0x64e8('0x6c')][_0x64e8('0xb5')],_[_0x64e8('0xb6')](_0x7e622c[_0x64e8('0x6c')],[_0x64e8('0xb5'),'id'])||{})['spread'](function(){return db[_0x64e8('0x6a')]['findAll']({'attributes':['id',_0x64e8('0x2b'),_0x64e8('0x4a')],'where':{'id':_0x7e622c['body'][_0x64e8('0xb5')]}});})[_0x64e8('0x27')](function(_0x4bbab0){socket[_0x64e8('0xbe')](_0x64e8('0xbf'),{'id':Number(_0x7e622c[_0x64e8('0xb2')]['id']),'tags':_0x4bbab0||[]});return{'id':Number(_0x7e622c['params']['id']),'tags':_0x4bbab0||[]};});}})[_0x64e8('0x27')](respondWithResult(_0x23e8f6,null))['catch'](handleError(_0x23e8f6,null));};exports['removeTags']=function(_0x1ad50f,_0x1683bb,_0x598e34){return db[_0x64e8('0x96')]['find']({'where':{'id':_0x1ad50f['params']['id']}})[_0x64e8('0x27')](handleEntityNotFound(_0x1683bb,null))['then'](function(_0x4afbab){if(_0x4afbab){return _0x4afbab[_0x64e8('0xc0')](_0x1ad50f[_0x64e8('0x3f')]['ids']);}})[_0x64e8('0x27')](respondWithStatusCode(_0x1683bb,null))[_0x64e8('0xac')](handleError(_0x1683bb,null));};exports[_0x64e8('0xc1')]=function(_0x3410a2,_0x56d403){var _0x2c83a8=moment()[_0x64e8('0xc2')]()['toString']();var _0x472deb=path[_0x64e8('0xc3')](config[_0x64e8('0xc4')],'server',_0x64e8('0xc5'),'tmp');var _0x146997=path['join'](config['root'],_0x64e8('0xc6'),_0x64e8('0xc5'),'attachments');var _0x13b514=path[_0x64e8('0xc3')](_0x472deb,_0x2c83a8);var _0x4d1fa1=util[_0x64e8('0xba')](_0x64e8('0xc7'),_0x3410a2[_0x64e8('0xb2')]['id'],_0x2c83a8);var _0x468e64=path['join'](_0x472deb,_0x4d1fa1);var _0x389ecf=[];_0x389ecf[_0x64e8('0x32')]({'model':db[_0x64e8('0xc8')],'as':_0x64e8('0xc8'),'attributes':['id',_0x64e8('0xc9')],'raw':!![]});_0x389ecf[_0x64e8('0x32')]({'model':db['CmContact'],'as':_0x64e8('0xca'),'attributes':['id',_0x64e8('0xcb'),'lastName'],'raw':!![]});var _0x54333c=[{'model':db[_0x64e8('0xb8')],'as':'Messages','attributes':['id',_0x64e8('0x6c'),_0x64e8('0x72'),'direction','secret',_0x64e8('0x7a')],'include':_0x389ecf}];_0x54333c['push']({'model':db[_0x64e8('0xcc')],'as':_0x64e8('0xcd'),'attributes':['id',_0x64e8('0x2b')]});_0x54333c[_0x64e8('0x32')]({'model':db[_0x64e8('0xc8')],'as':_0x64e8('0xce'),'attributes':['id',_0x64e8('0xc9')]});return db[_0x64e8('0x96')][_0x64e8('0x5d')]({'where':{'id':_0x3410a2['params']['id']},'include':_0x54333c})[_0x64e8('0x27')](handleEntityNotFound(_0x56d403,null))[_0x64e8('0x27')](function(_0x464f6f){if(_0x464f6f){var _0x539267=_0x464f6f[_0x64e8('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x13b514);var _0x13667c={'channel':_0x64e8('0xd0'),'account':_0x539267['Account'][_0x64e8('0x2b')],'agent':_0x539267['Owner']?_0x539267[_0x64e8('0xce')][_0x64e8('0xc9')]:_0x64e8('0xd1'),'createdAt':moment(_0x539267[_0x64e8('0x72')])['format'](_0x64e8('0xbb'))[_0x64e8('0x93')](),'closedAt':_0x539267[_0x64e8('0x37')]?moment(_0x539267['closedAt'])[_0x64e8('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x64e8('0x93')]():'','disposition':_0x539267[_0x64e8('0xd2')],'messages':_(_0x539267[_0x64e8('0xd3')])[_0x64e8('0x7f')]({'secret':![]})[_0x64e8('0x2d')](function(_0x4db62d){return{'date':moment(_0x4db62d[_0x64e8('0x72')])[_0x64e8('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x64e8('0x93')](),'sender':_0x4db62d['direction']===_0x64e8('0xd4')?_0x4db62d[_0x64e8('0xc8')]?_0x4db62d['User'][_0x64e8('0xc9')]:_0x64e8('0xd5'):_0x4db62d[_0x64e8('0xca')]['firstName']+(_0x4db62d[_0x64e8('0xca')][_0x64e8('0xd6')]?'\x20'+_0x4db62d[_0x64e8('0xca')][_0x64e8('0xd6')]:''),'body':_0x4db62d[_0x64e8('0x6c')],'direction':_0x4db62d[_0x64e8('0xd7')]===_0x64e8('0xd4')?'A':'C','secret':_0x4db62d[_0x64e8('0xd8')],'read':_0x4db62d['read']};})['value']()};return ejs['renderFile'](path[_0x64e8('0xc3')](config[_0x64e8('0xc4')],'server',_0x64e8('0xd9'),_0x64e8('0xda')),{'interaction':_0x13667c})['then'](function(_0x2019b5){var _0x57e2de=path['join'](_0x13b514,'transcript-'+_0x539267['id']+'-'+_0x2c83a8+'.pdf');var _0x488dc5={'path':_0x57e2de,'channel':_0x64e8('0xd0'),'interactionId':_0x539267['id']};return pdf[_0x64e8('0xdb')](_0x2019b5,_0x488dc5);})[_0x64e8('0x27')](function(){return new BPromise(function(_0x576d68,_0x1f65ab){zipdir(_0x13b514,{'saveTo':_0x468e64},function(_0x53bdeb,_0x1223b0){if(_0x53bdeb)return _0x1f65ab(_0x53bdeb);return _0x576d68(_0x1223b0);});})[_0x64e8('0x27')](function(){return new BPromise(function(_0x4132f8,_0x20ef5b){rimraf(_0x13b514,function(_0x2aa17f){if(_0x2aa17f)_0x20ef5b(_0x2aa17f);return _0x4132f8();});});})[_0x64e8('0x27')](function(){return _0x56d403[_0x64e8('0xc1')](_0x468e64,_0x4d1fa1,function(_0x14a98b){if(_0x14a98b){console[_0x64e8('0xdc')]('err',_0x14a98b);}else{fs[_0x64e8('0xdd')](_0x468e64);}});});});}else{return _0x56d403['sendStatus'](0xc8);}})['catch'](handleError(_0x56d403,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ce90ef0..0ec6e51 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 _0x8603=['update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit','hasOwnProperty','hook','../../mysqldb','SmsInteraction','save'];(function(_0x535f86,_0x2e90d4){var _0x109568=function(_0x3fa7aa){while(--_0x3fa7aa){_0x535f86['push'](_0x535f86['shift']());}};_0x109568(++_0x2e90d4);}(_0x8603,0x190));var _0x3860=function(_0x4e2d3e,_0x59578a){_0x4e2d3e=_0x4e2d3e-0x0;var _0x3596bc=_0x8603[_0x4e2d3e];return _0x3596bc;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x3860('0x0'))['db'][_0x3860('0x1')];var SmsMessage=require(_0x3860('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3860('0x2'),'afterUpdate':_0x3860('0x3'),'afterDestroy':_0x3860('0x4')};function emitEvent(_0x490262){return function(_0x2fc97a,_0x56f8c5,_0xb0fc24){_0x2fc97a[_0x3860('0x5')]({'attributes':['id'],'raw':!![]})[_0x3860('0x6')](function(_0xd3ce26){_0x2fc97a[_0x3860('0x7')]('Users',_0xd3ce26['map'](function(_0x5b1ac8){return{'id':_0x5b1ac8['id']};}));return SmsMessage[_0x3860('0x8')]({'where':{'SmsInteractionId':_0x2fc97a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3860('0x6')](function(_0x52c277){_0x2fc97a[_0x3860('0x7')](_0x3860('0x9'),_0x52c277['length']);SmsInteractionEvents[_0x3860('0xa')](_0x490262+':'+_0x2fc97a['id'],_0x2fc97a);SmsInteractionEvents[_0x3860('0xa')](_0x490262,_0x2fc97a);_0xb0fc24(null);})['catch'](_0xb0fc24(null));};}for(var e in events){if(events[_0x3860('0xb')](e)){var event=events[e];SmsInteraction[_0x3860('0xc')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x2da6=['setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x2da6,0x1dd));var _0x62da=function(_0x376689,_0x57c223){_0x376689=_0x376689-0x0;var _0x1d6422=_0x2da6[_0x376689];return _0x1d6422;};'use strict';var EventEmitter=require(_0x62da('0x0'));var SmsInteraction=require(_0x62da('0x1'))['db'][_0x62da('0x2')];var SmsMessage=require(_0x62da('0x1'))['db'][_0x62da('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x62da('0x4')](0x0);var events={'afterCreate':_0x62da('0x5'),'afterUpdate':_0x62da('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4a8428){return function(_0xe28204,_0x3163df,_0x3a59f8){_0xe28204[_0x62da('0x7')]({'attributes':['id'],'raw':!![]})[_0x62da('0x8')](function(_0x9d9139){_0xe28204[_0x62da('0x9')](_0x62da('0xa'),_0x9d9139[_0x62da('0xb')](function(_0x4cfc5d){return{'id':_0x4cfc5d['id']};}));return SmsMessage[_0x62da('0xc')]({'where':{'SmsInteractionId':_0xe28204['id'],'direction':'in','read':![]},'raw':!![]});})[_0x62da('0x8')](function(_0x2a3d7c){_0xe28204[_0x62da('0x9')]('unreadMessages',_0x2a3d7c[_0x62da('0xd')]);SmsInteractionEvents[_0x62da('0xe')](_0x4a8428+':'+_0xe28204['id'],_0xe28204);SmsInteractionEvents[_0x62da('0xe')](_0x4a8428,_0xe28204);_0x3a59f8(null);})[_0x62da('0xf')](_0x3a59f8(null));};}for(var e in events){if(events[_0x62da('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x62da('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 1ef1a3a..4b9c817 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 _0x8fc4=['define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x10dcf2,_0x3ec707){var _0x479bbf=function(_0x336b87){while(--_0x336b87){_0x10dcf2['push'](_0x10dcf2['shift']());}};_0x479bbf(++_0x3ec707);}(_0x8fc4,0x77));var _0x48fc=function(_0x71c074,_0x4ec79e){_0x71c074=_0x71c074-0x0;var _0x515f80=_0x8fc4[_0x71c074];return _0x515f80;};'use strict';var _=require('lodash');var util=require(_0x48fc('0x0'));var logger=require('../../config/logger')(_0x48fc('0x1'));var moment=require(_0x48fc('0x2'));var BPromise=require(_0x48fc('0x3'));var rp=require(_0x48fc('0x4'));var fs=require('fs');var path=require(_0x48fc('0x5'));var rimraf=require(_0x48fc('0x6'));var config=require(_0x48fc('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x48fc('0x8')]=function(_0x4574b4,_0x4cd01c){return _0x4574b4[_0x48fc('0x9')](_0x48fc('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1aa93e,_0x1f9ca9,_0x120de1){if(_0x1aa93e[_0x48fc('0xb')](_0x48fc('0xc'))){_0x1aa93e[_0x48fc('0xd')]=moment()[_0x48fc('0xe')](_0x48fc('0xf'));}_0x120de1(null,_0x1aa93e);}}});}; \ No newline at end of file +var _0x0f75=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x0f75,0x1cc));var _0x50f7=function(_0x17c063,_0x3e2726){_0x17c063=_0x17c063-0x0;var _0x282950=_0x0f75[_0x17c063];return _0x282950;};'use strict';var _=require(_0x50f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x50f7('0x1'));var moment=require(_0x50f7('0x2'));var BPromise=require(_0x50f7('0x3'));var rp=require(_0x50f7('0x4'));var fs=require('fs');var path=require(_0x50f7('0x5'));var rimraf=require(_0x50f7('0x6'));var config=require(_0x50f7('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x20a2f5,_0x328597){return _0x20a2f5[_0x50f7('0x8')](_0x50f7('0x9'),attributes,{'tableName':_0x50f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x258bce,_0x3011e5,_0x1a5764){if(_0x258bce[_0x50f7('0xb')]('closed')){_0x258bce[_0x50f7('0xc')]=moment()['format'](_0x50f7('0xd'));}_0x1a5764(null,_0x258bce);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 0f0c0e3..5dce4b3 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 _0xff45=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xff45,0x6c));var _0x5ff4=function(_0x20cc10,_0xacb404){_0x20cc10=_0x20cc10-0x0;var _0x111204=_0xff45[_0x20cc10];return _0x111204;};'use strict';var _=require(_0x5ff4('0x0'));var util=require(_0x5ff4('0x1'));var moment=require('moment');var BPromise=require(_0x5ff4('0x2'));var rs=require(_0x5ff4('0x3'));var fs=require('fs');var Redis=require(_0x5ff4('0x4'));var db=require(_0x5ff4('0x5'))['db'];var utils=require(_0x5ff4('0x6'));var logger=require('../../config/logger')(_0x5ff4('0x7'));var config=require(_0x5ff4('0x8'));var jayson=require(_0x5ff4('0x9'));var client=jayson[_0x5ff4('0xa')][_0x5ff4('0xb')]({'port':0x232a});config[_0x5ff4('0xc')]=_[_0x5ff4('0xd')](config[_0x5ff4('0xc')],{'host':_0x5ff4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5ff4('0xf'))[_0x5ff4('0x10')](socket);function respondWithRpcPromise(_0x18ff88,_0x48a8c0,_0x4059a7){return new BPromise(function(_0x381ae3,_0x425777){return client[_0x5ff4('0x11')](_0x18ff88,_0x4059a7)[_0x5ff4('0x12')](function(_0x46df20){logger[_0x5ff4('0x13')](_0x5ff4('0x14'),_0x48a8c0,_0x5ff4('0x15'));logger[_0x5ff4('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x48a8c0,_0x5ff4('0x15'),JSON[_0x5ff4('0x17')](_0x46df20));if(_0x46df20['error']){if(_0x46df20[_0x5ff4('0x18')][_0x5ff4('0x19')]===0x1f4){logger[_0x5ff4('0x18')](_0x5ff4('0x14'),_0x48a8c0,_0x46df20[_0x5ff4('0x18')]['message']);return _0x425777(_0x46df20[_0x5ff4('0x18')]['message']);}logger[_0x5ff4('0x18')](_0x5ff4('0x14'),_0x48a8c0,_0x46df20[_0x5ff4('0x18')][_0x5ff4('0x1a')]);return _0x381ae3(_0x46df20[_0x5ff4('0x18')][_0x5ff4('0x1a')]);}else{logger[_0x5ff4('0x13')](_0x5ff4('0x14'),_0x48a8c0,_0x5ff4('0x15'));_0x381ae3(_0x46df20['result'][_0x5ff4('0x1a')]);}})[_0x5ff4('0x1b')](function(_0x262934){logger[_0x5ff4('0x18')](_0x5ff4('0x14'),_0x48a8c0,_0x262934);_0x425777(_0x262934);});});}exports['UpdateSmsInteraction']=function(_0x3bcc4a){var _0x172797=this;return new Promise(function(_0x2c7fa1,_0x3732e0){return db[_0x5ff4('0x1c')][_0x5ff4('0x1d')](_0x3bcc4a['body'],{'raw':_0x3bcc4a[_0x5ff4('0x1e')]?_0x3bcc4a[_0x5ff4('0x1e')][_0x5ff4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bcc4a[_0x5ff4('0x1e')]?_0x3bcc4a[_0x5ff4('0x1e')][_0x5ff4('0x20')]||null:null,'attributes':_0x3bcc4a['options']?_0x3bcc4a['options'][_0x5ff4('0x21')]||null:null,'limit':_0x3bcc4a[_0x5ff4('0x1e')]?_0x3bcc4a[_0x5ff4('0x1e')][_0x5ff4('0x22')]||null:null})['then'](function(_0x1c2717){logger[_0x5ff4('0x13')](_0x5ff4('0x23'),_0x3bcc4a);logger[_0x5ff4('0x16')](_0x5ff4('0x23'),_0x3bcc4a,JSON['stringify'](_0x1c2717));_0x2c7fa1(_0x1c2717);})[_0x5ff4('0x1b')](function(_0x555188){logger[_0x5ff4('0x18')](_0x5ff4('0x23'),_0x555188[_0x5ff4('0x1a')],_0x3bcc4a);_0x3732e0(_0x172797[_0x5ff4('0x18')](0x1f4,_0x555188[_0x5ff4('0x1a')]));});});};exports[_0x5ff4('0x24')]=function(_0x5217f7){return new Promise(function(_0x1d5ebc,_0x1f5d9f){return db['SmsInteraction'][_0x5ff4('0x25')]({'where':_0x5217f7['options']?_0x5217f7[_0x5ff4('0x1e')][_0x5ff4('0x20')]||null:null})['then'](function(_0x4c0ea9){if(_0x4c0ea9){return _0x4c0ea9[_0x5ff4('0x26')](_0x5217f7['body'][_0x5ff4('0x27')],_['omit'](_0x5217f7['body'],[_0x5ff4('0x27'),'id'])||{});}})[_0x5ff4('0x28')](function(_0x35d673){logger['info'](_0x5ff4('0x29'),_0x5217f7);logger[_0x5ff4('0x16')]('AddTags',_0x5217f7,JSON[_0x5ff4('0x17')](_0x35d673));_0x1d5ebc(_0x35d673);})['catch'](function(_0xc336f4){logger[_0x5ff4('0x18')](_0x5ff4('0x29'),_0xc336f4['message'],_0x5217f7);_0x1f5d9f(_this[_0x5ff4('0x18')](0x1f4,_0xc336f4[_0x5ff4('0x1a')]));});});}; \ No newline at end of file +var _0xc9c7=['register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','body','options','raw','where','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./smsInteraction.socket'];(function(_0x5110cc,_0x5638c1){var _0x155429=function(_0xa08f72){while(--_0xa08f72){_0x5110cc['push'](_0x5110cc['shift']());}};_0x155429(++_0x5638c1);}(_0xc9c7,0xe2));var _0x7c9c=function(_0x3079aa,_0x375fec){_0x3079aa=_0x3079aa-0x0;var _0x478de3=_0xc9c7[_0x3079aa];return _0x478de3;};'use strict';var _=require(_0x7c9c('0x0'));var util=require(_0x7c9c('0x1'));var moment=require(_0x7c9c('0x2'));var BPromise=require(_0x7c9c('0x3'));var rs=require(_0x7c9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c9c('0x5'))['db'];var utils=require(_0x7c9c('0x6'));var logger=require('../../config/logger')(_0x7c9c('0x7'));var config=require(_0x7c9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c9c('0x9')][_0x7c9c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7c9c('0xb')],{'host':_0x7c9c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c9c('0xb')]));require(_0x7c9c('0xd'))[_0x7c9c('0xe')](socket);function respondWithRpcPromise(_0x880485,_0x442922,_0x45bdb6){return new BPromise(function(_0x5c16de,_0x1f7c5d){return client[_0x7c9c('0xf')](_0x880485,_0x45bdb6)[_0x7c9c('0x10')](function(_0x3a1c36){logger[_0x7c9c('0x11')](_0x7c9c('0x12'),_0x442922,'request\x20sent');logger[_0x7c9c('0x13')](_0x7c9c('0x14'),_0x442922,_0x7c9c('0x15'),JSON[_0x7c9c('0x16')](_0x3a1c36));if(_0x3a1c36[_0x7c9c('0x17')]){if(_0x3a1c36[_0x7c9c('0x17')][_0x7c9c('0x18')]===0x1f4){logger[_0x7c9c('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x442922,_0x3a1c36[_0x7c9c('0x17')][_0x7c9c('0x19')]);return _0x1f7c5d(_0x3a1c36[_0x7c9c('0x17')][_0x7c9c('0x19')]);}logger['error'](_0x7c9c('0x12'),_0x442922,_0x3a1c36[_0x7c9c('0x17')][_0x7c9c('0x19')]);return _0x5c16de(_0x3a1c36['error'][_0x7c9c('0x19')]);}else{logger[_0x7c9c('0x11')](_0x7c9c('0x12'),_0x442922,_0x7c9c('0x15'));_0x5c16de(_0x3a1c36[_0x7c9c('0x1a')][_0x7c9c('0x19')]);}})['catch'](function(_0x40ab0a){logger[_0x7c9c('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x442922,_0x40ab0a);_0x1f7c5d(_0x40ab0a);});});}exports['UpdateSmsInteraction']=function(_0x71ca7e){var _0x3fb2d3=this;return new Promise(function(_0x5ceff7,_0x1835bf){return db['SmsInteraction']['update'](_0x71ca7e[_0x7c9c('0x1b')],{'raw':_0x71ca7e[_0x7c9c('0x1c')]?_0x71ca7e[_0x7c9c('0x1c')][_0x7c9c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x71ca7e[_0x7c9c('0x1c')]?_0x71ca7e[_0x7c9c('0x1c')][_0x7c9c('0x1e')]||null:null,'attributes':_0x71ca7e[_0x7c9c('0x1c')]?_0x71ca7e[_0x7c9c('0x1c')]['attributes']||null:null,'limit':_0x71ca7e[_0x7c9c('0x1c')]?_0x71ca7e[_0x7c9c('0x1c')][_0x7c9c('0x1f')]||null:null})[_0x7c9c('0x10')](function(_0x588913){logger[_0x7c9c('0x11')](_0x7c9c('0x20'),_0x71ca7e);logger['debug']('UpdateSmsInteraction',_0x71ca7e,JSON[_0x7c9c('0x16')](_0x588913));_0x5ceff7(_0x588913);})['catch'](function(_0x38ee02){logger['error'](_0x7c9c('0x20'),_0x38ee02['message'],_0x71ca7e);_0x1835bf(_0x3fb2d3[_0x7c9c('0x17')](0x1f4,_0x38ee02[_0x7c9c('0x19')]));});});};exports[_0x7c9c('0x21')]=function(_0x2f7093){return new Promise(function(_0x1ce962,_0x483acb){return db[_0x7c9c('0x22')]['find']({'where':_0x2f7093['options']?_0x2f7093[_0x7c9c('0x1c')][_0x7c9c('0x1e')]||null:null})['then'](function(_0xe92f00){if(_0xe92f00){return _0xe92f00[_0x7c9c('0x23')](_0x2f7093[_0x7c9c('0x1b')][_0x7c9c('0x24')],_[_0x7c9c('0x25')](_0x2f7093['body'],[_0x7c9c('0x24'),'id'])||{});}})[_0x7c9c('0x26')](function(_0x29aab7){logger['info'](_0x7c9c('0x27'),_0x2f7093);logger[_0x7c9c('0x13')]('AddTags',_0x2f7093,JSON['stringify'](_0x29aab7));_0x1ce962(_0x29aab7);})['catch'](function(_0x147f09){logger[_0x7c9c('0x17')]('AddTags',_0x147f09[_0x7c9c('0x19')],_0x2f7093);_0x483acb(_this['error'](0x1f4,_0x147f09['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d9d3f51..9822fe8 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 _0x82bc=['register','length','smsInteraction:','remove','removeListener'];(function(_0x3d8a16,_0x375ca9){var _0x17e2ce=function(_0x4008e4){while(--_0x4008e4){_0x3d8a16['push'](_0x3d8a16['shift']());}};_0x17e2ce(++_0x375ca9);}(_0x82bc,0xb2));var _0xc82b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x82bc[_0x413feb];return _0x40ee88;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xc82b('0x0'),'update'];function createListener(_0x4aa63f,_0x8b5b05){return function(_0x2f62d6){_0x8b5b05['emit'](_0x4aa63f,_0x2f62d6);};}function removeListener(_0x5125ec,_0x20b536){return function(){SmsInteractionEvents[_0xc82b('0x1')](_0x5125ec,_0x20b536);};}exports[_0xc82b('0x2')]=function(_0x45ea71){for(var _0x4191d5=0x0,_0x3b75b1=events[_0xc82b('0x3')];_0x4191d5<_0x3b75b1;_0x4191d5++){var _0x1e5e0e=events[_0x4191d5];var _0x59891b=createListener(_0xc82b('0x4')+_0x1e5e0e,_0x45ea71);SmsInteractionEvents['on'](_0x1e5e0e,_0x59891b);}}; \ No newline at end of file +var _0x4bed=['emit','removeListener','length','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x36c3c7,_0x52f866){var _0x52bc17=function(_0x2bd0f0){while(--_0x2bd0f0){_0x36c3c7['push'](_0x36c3c7['shift']());}};_0x52bc17(++_0x52f866);}(_0x4bed,0xa5));var _0xd4be=function(_0x4249df,_0x2d21d0){_0x4249df=_0x4249df-0x0;var _0x507ef6=_0x4bed[_0x4249df];return _0x507ef6;};'use strict';var SmsInteractionEvents=require(_0xd4be('0x0'));var events=['save',_0xd4be('0x1'),_0xd4be('0x2')];function createListener(_0x58a486,_0x1864bd){return function(_0x4d9d4a){_0x1864bd[_0xd4be('0x3')](_0x58a486,_0x4d9d4a);};}function removeListener(_0x149d8e,_0x13d0ee){return function(){SmsInteractionEvents[_0xd4be('0x4')](_0x149d8e,_0x13d0ee);};}exports['register']=function(_0x152f0d){for(var _0x985432=0x0,_0x358567=events[_0xd4be('0x5')];_0x985432<_0x358567;_0x985432++){var _0x15a999=events[_0x985432];var _0x48c7b2=createListener(_0xd4be('0x6')+_0x15a999,_0x152f0d);SmsInteractionEvents['on'](_0x15a999,_0x48c7b2);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 84d97cd..666181d 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 _0x63a5=['isAuthenticated','get','/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20aa61,_0x4a9062){var _0x4f9281=function(_0x51fa86){while(--_0x51fa86){_0x20aa61['push'](_0x20aa61['shift']());}};_0x4f9281(++_0x4a9062);}(_0x63a5,0x18e));var _0x563a=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x63a5[_0x4ae829];return _0x256b31;};'use strict';var multer=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var path=require(_0x563a('0x2'));var timeout=require('connect-timeout');var express=require(_0x563a('0x3'));var router=express['Router']();var fs_extra=require(_0x563a('0x4'));var auth=require(_0x563a('0x5'));var interaction=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x563a('0x8')](),controller['index']);router[_0x563a('0x9')](_0x563a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x563a('0x9')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller[_0x563a('0xc')]);router[_0x563a('0xd')]('/',auth[_0x563a('0x8')](),interaction[_0x563a('0xe')](_0x563a('0xf'),_0x563a('0x10')),controller[_0x563a('0x11')]);router[_0x563a('0xd')](_0x563a('0x12'),controller[_0x563a('0x13')]);router[_0x563a('0x14')]('/:id',auth[_0x563a('0x8')](),controller[_0x563a('0x15')]);router[_0x563a('0x14')](_0x563a('0x16'),auth[_0x563a('0x8')](),controller[_0x563a('0x17')]);router['put'](_0x563a('0x18'),auth[_0x563a('0x8')](),controller[_0x563a('0x19')]);router[_0x563a('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x563a('0x1b')]);module[_0x563a('0x1c')]=router; \ No newline at end of file +var _0x9f85=['accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update'];(function(_0x54c2e2,_0x2e2b72){var _0x3a754b=function(_0x3a454c){while(--_0x3a454c){_0x54c2e2['push'](_0x54c2e2['shift']());}};_0x3a754b(++_0x2e2b72);}(_0x9f85,0xf5));var _0x59f8=function(_0x6bcda3,_0x108efe){_0x6bcda3=_0x6bcda3-0x0;var _0x45d9c9=_0x9f85[_0x6bcda3];return _0x45d9c9;};'use strict';var multer=require(_0x59f8('0x0'));var util=require('util');var path=require(_0x59f8('0x1'));var timeout=require(_0x59f8('0x2'));var express=require(_0x59f8('0x3'));var router=express[_0x59f8('0x4')]();var fs_extra=require(_0x59f8('0x5'));var auth=require(_0x59f8('0x6'));var interaction=require(_0x59f8('0x7'));var config=require(_0x59f8('0x8'));var controller=require(_0x59f8('0x9'));router[_0x59f8('0xa')]('/',auth[_0x59f8('0xb')](),controller[_0x59f8('0xc')]);router[_0x59f8('0xa')]('/describe',auth[_0x59f8('0xb')](),controller[_0x59f8('0xd')]);router[_0x59f8('0xa')](_0x59f8('0xe'),auth[_0x59f8('0xb')](),controller[_0x59f8('0xf')]);router[_0x59f8('0x10')]('/',auth[_0x59f8('0xb')](),interaction[_0x59f8('0x11')](_0x59f8('0x12'),_0x59f8('0x13')),controller[_0x59f8('0x14')]);router['post'](_0x59f8('0x15'),controller[_0x59f8('0x16')]);router[_0x59f8('0x17')]('/:id',auth[_0x59f8('0xb')](),controller[_0x59f8('0x18')]);router[_0x59f8('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0x59f8('0x19')]);router[_0x59f8('0x17')](_0x59f8('0x1a'),auth[_0x59f8('0xb')](),controller[_0x59f8('0x1b')]);router[_0x59f8('0x1c')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x59f8('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 961bc09..cf55c5b 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 _0xa809=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa809,0x1a8));var _0x9a80=function(_0x404338,_0x1f1f76){_0x404338=_0x404338-0x0;var _0x28e22f=_0xa809[_0x404338];return _0x28e22f;};'use strict';var Sequelize=require(_0x9a80('0x0'));module[_0x9a80('0x1')]={'body':{'type':Sequelize[_0x9a80('0x2')](_0x9a80('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a80('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a80('0x5')]('in',_0x9a80('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9a80('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9a80('0x7')]},'readAt':{'type':Sequelize[_0x9a80('0x8')]},'secret':{'type':Sequelize[_0x9a80('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9a80('0x7')]},'providerResponse':{'type':Sequelize[_0x9a80('0x2')]}}; \ No newline at end of file +var _0x3d74=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x4471c6,_0xc2e7f4){var _0x44e0e8=function(_0x171492){while(--_0x171492){_0x4471c6['push'](_0x4471c6['shift']());}};_0x44e0e8(++_0xc2e7f4);}(_0x3d74,0x6c));var _0x43d7=function(_0x33f299,_0x2e770b){_0x33f299=_0x33f299-0x0;var _0x1584ab=_0x3d74[_0x33f299];return _0x1584ab;};'use strict';var Sequelize=require(_0x43d7('0x0'));module[_0x43d7('0x1')]={'body':{'type':Sequelize[_0x43d7('0x2')](_0x43d7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x43d7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x43d7('0x5')]('in',_0x43d7('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x43d7('0x7')](0xbe)},'phone':{'type':Sequelize[_0x43d7('0x7')]},'readAt':{'type':Sequelize[_0x43d7('0x8')]},'secret':{'type':Sequelize[_0x43d7('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x43d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3edeee6..d7a76b1 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 _0xfae3=['twilio','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','inspect','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','create','body','find','describe','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','isNil','read1stAt','interaction','get','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','sms-interactions','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','motionChannel','event','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','type','MessageSid','messageId'];(function(_0x2915dd,_0x30d876){var _0x53b04=function(_0x5b59f4){while(--_0x5b59f4){_0x2915dd['push'](_0x2915dd['shift']());}};_0x53b04(++_0x30d876);}(_0xfae3,0xa1));var _0x3fae=function(_0x49fb87,_0x5d65bb){_0x49fb87=_0x49fb87-0x0;var _0x17db71=_0xfae3[_0x49fb87];return _0x17db71;};'use strict';var emlformat=require(_0x3fae('0x0'));var rimraf=require(_0x3fae('0x1'));var zipdir=require(_0x3fae('0x2'));var jsonpatch=require(_0x3fae('0x3'));var rp=require(_0x3fae('0x4'));var moment=require(_0x3fae('0x5'));var BPromise=require(_0x3fae('0x6'));var Mustache=require(_0x3fae('0x7'));var util=require(_0x3fae('0x8'));var path=require(_0x3fae('0x9'));var sox=require(_0x3fae('0xa'));var csv=require('to-csv');var ejs=require(_0x3fae('0xb'));var fs=require('fs');var fs_extra=require(_0x3fae('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3fae('0xd'));var jsforce=require(_0x3fae('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3fae('0xf'));var querystring=require(_0x3fae('0x10'));var Papa=require(_0x3fae('0x11'));var Redis=require(_0x3fae('0x12'));var authService=require(_0x3fae('0x13'));var qs=require(_0x3fae('0x14'));var as=require(_0x3fae('0x15'));var hardwareService=require(_0x3fae('0x16'));var logger=require(_0x3fae('0x17'))(_0x3fae('0x18'));var utils=require(_0x3fae('0x19'));var config=require(_0x3fae('0x1a'));var licenseUtil=require(_0x3fae('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3fae('0x1c')]=_['defaults'](config[_0x3fae('0x1c')],{'host':_0x3fae('0x1d'),'port':0x18eb});var socket=require(_0x3fae('0x1e'))(new Redis(config[_0x3fae('0x1c')]));require(_0x3fae('0x1f'))[_0x3fae('0x20')](socket);var jayson=require(_0x3fae('0x21'));var client=jayson[_0x3fae('0x22')][_0x3fae('0x23')]({'port':0x232c});var client9002=jayson[_0x3fae('0x22')][_0x3fae('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x20513e,_0x341c61,_0x38b6c1,_0x1c32b0){return new BPromise(function(_0xbfb96d,_0x3fb2f8){var _0xa515bc=_0x1c32b0||client;return _0xa515bc[_0x3fae('0x24')](_0x20513e,_0x38b6c1)[_0x3fae('0x25')](function(_0x552f00){logger['info'](_0x3fae('0x26'),_0x341c61,_0x3fae('0x27'));logger[_0x3fae('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x341c61,_0x3fae('0x27'),JSON[_0x3fae('0x29')](_0x552f00));if(_0x552f00[_0x3fae('0x2a')]){if(_0x552f00[_0x3fae('0x2a')]['code']===0x1f4){logger['error'](_0x3fae('0x26'),_0x341c61,_0x552f00[_0x3fae('0x2a')][_0x3fae('0x2b')]);return _0x3fb2f8(_0x552f00[_0x3fae('0x2a')][_0x3fae('0x2b')]);}logger[_0x3fae('0x2a')](_0x3fae('0x26'),_0x341c61,_0x552f00[_0x3fae('0x2a')][_0x3fae('0x2b')]);return _0xbfb96d(_0x552f00[_0x3fae('0x2a')][_0x3fae('0x2b')]);}else{logger[_0x3fae('0x2c')](_0x3fae('0x26'),_0x341c61,_0x3fae('0x27'));_0xbfb96d(_0x552f00['result'][_0x3fae('0x2b')]);}})[_0x3fae('0x2d')](function(_0xba023){logger[_0x3fae('0x2a')](_0x3fae('0x26'),_0x341c61,_0xba023);_0x3fb2f8(_0xba023);});});}function respondWithStatusCode(_0x42a970,_0x255c3f){_0x255c3f=_0x255c3f||0xcc;return function(_0x38f413){if(_0x38f413){return _0x42a970[_0x3fae('0x2e')](_0x255c3f);}return _0x42a970['status'](_0x255c3f)[_0x3fae('0x2f')]();};}function respondWithResult(_0x479ebe,_0x403e40){_0x403e40=_0x403e40||0xc8;return function(_0x1bad4a){if(_0x1bad4a){return _0x479ebe['status'](_0x403e40)[_0x3fae('0x30')](_0x1bad4a);}};}function respondWithFilteredResult(_0x3692d4,_0x52d0da){return function(_0xaab54b){if(_0xaab54b){var _0x133a5c=typeof _0x52d0da[_0x3fae('0x31')]===_0x3fae('0x32')&&typeof _0x52d0da[_0x3fae('0x33')]===_0x3fae('0x32');var _0x1ae497=_0xaab54b[_0x3fae('0x34')];var _0x473881=_0x133a5c?0x0:_0x52d0da[_0x3fae('0x31')];var _0x110e8b=_0x133a5c?_0xaab54b['count']:_0x52d0da[_0x3fae('0x31')]+_0x52d0da[_0x3fae('0x33')];var _0x3bb92b;if(_0x110e8b>=_0x1ae497){_0x110e8b=_0x1ae497;_0x3bb92b=0xc8;}else{_0x3bb92b=0xce;}_0x3692d4[_0x3fae('0x35')](_0x3bb92b);return _0x3692d4['set'](_0x3fae('0x36'),_0x473881+'-'+_0x110e8b+'/'+_0x1ae497)['json'](_0xaab54b);}return null;};}function patchUpdates(_0x4fcc2d){return function(_0x19218b){try{jsonpatch['apply'](_0x19218b,_0x4fcc2d,!![]);}catch(_0x48efa9){return BPromise['reject'](_0x48efa9);}return _0x19218b[_0x3fae('0x37')]();};}function saveUpdates(_0x5a77ad,_0x42cf7c){return function(_0xa56230){if(_0xa56230){return _0xa56230[_0x3fae('0x38')](_0x5a77ad)[_0x3fae('0x25')](function(_0x1155fa){return _0x1155fa;});}return null;};}function removeEntity(_0x598344,_0x25d8f6){return function(_0x108273){if(_0x108273){return _0x108273[_0x3fae('0x39')]()[_0x3fae('0x25')](function(){_0x598344[_0x3fae('0x35')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eeeb0,_0x347d14){return function(_0x3ff3de){if(!_0x3ff3de){_0x3eeeb0[_0x3fae('0x2e')](0x194);}return _0x3ff3de;};}function handleError(_0x2254cd,_0x4efbb6){_0x4efbb6=_0x4efbb6||0x1f4;return function(_0xfb49b0){logger['error'](_0xfb49b0[_0x3fae('0x3a')]);if(_0xfb49b0[_0x3fae('0x3b')]){delete _0xfb49b0[_0x3fae('0x3b')];}_0x2254cd['status'](_0x4efbb6)[_0x3fae('0x3c')](_0xfb49b0);};}exports[_0x3fae('0x3d')]=function(_0x40cb92,_0x5597eb){var _0x4f150d={},_0x9a90={},_0x45b9c8={'count':0x0,'rows':[]};var _0x1e8351=_['map'](db[_0x3fae('0x3e')][_0x3fae('0x3f')],function(_0x3d3a39){return{'name':_0x3d3a39[_0x3fae('0x40')],'type':_0x3d3a39['type'][_0x3fae('0x41')]};});_0x9a90[_0x3fae('0x42')]=_[_0x3fae('0x43')](_0x1e8351,_0x3fae('0x3b'));_0x9a90['query']=_[_0x3fae('0x44')](_0x40cb92[_0x3fae('0x45')]);_0x9a90[_0x3fae('0x46')]=_[_0x3fae('0x47')](_0x9a90[_0x3fae('0x42')],_0x9a90['query']);_0x4f150d[_0x3fae('0x48')]=_[_0x3fae('0x47')](_0x9a90['model'],qs[_0x3fae('0x49')](_0x40cb92[_0x3fae('0x45')]['fields']));_0x4f150d['attributes']=_0x4f150d['attributes'][_0x3fae('0x4a')]?_0x4f150d[_0x3fae('0x48')]:_0x9a90[_0x3fae('0x42')];if(!_0x40cb92[_0x3fae('0x45')]['hasOwnProperty'](_0x3fae('0x4b'))){_0x4f150d[_0x3fae('0x33')]=qs[_0x3fae('0x33')](_0x40cb92['query'][_0x3fae('0x33')]);_0x4f150d[_0x3fae('0x31')]=qs[_0x3fae('0x31')](_0x40cb92['query'][_0x3fae('0x31')]);}_0x4f150d[_0x3fae('0x4c')]=qs[_0x3fae('0x4d')](_0x40cb92[_0x3fae('0x45')]['sort']);_0x4f150d[_0x3fae('0x4e')]=qs[_0x3fae('0x46')](_[_0x3fae('0x4f')](_0x40cb92['query'],_0x9a90[_0x3fae('0x46')]),_0x1e8351);if(_0x40cb92[_0x3fae('0x45')][_0x3fae('0x50')]){_0x4f150d[_0x3fae('0x4e')]=_[_0x3fae('0x51')](_0x4f150d['where'],{'$or':_[_0x3fae('0x43')](_0x1e8351,function(_0x4b314c){if(_0x4b314c['type']!=='VIRTUAL'){var _0x46a565={};_0x46a565[_0x4b314c[_0x3fae('0x3b')]]={'$like':'%'+_0x40cb92[_0x3fae('0x45')]['filter']+'%'};return _0x46a565;}})});}_0x4f150d=_[_0x3fae('0x51')]({},_0x4f150d,_0x40cb92[_0x3fae('0x52')]);var _0x4f51be={'where':_0x4f150d[_0x3fae('0x4e')]};return db[_0x3fae('0x3e')]['count'](_0x4f51be)['then'](function(_0x5e0534){_0x45b9c8['count']=_0x5e0534;if(_0x40cb92[_0x3fae('0x45')][_0x3fae('0x53')]){_0x4f150d['include']=[{'all':!![]}];}return db[_0x3fae('0x3e')][_0x3fae('0x54')](_0x4f150d);})[_0x3fae('0x25')](function(_0x45bf02){_0x45b9c8[_0x3fae('0x55')]=_0x45bf02;return _0x45b9c8;})[_0x3fae('0x25')](respondWithFilteredResult(_0x5597eb,_0x4f150d))[_0x3fae('0x2d')](handleError(_0x5597eb,null));};exports['show']=function(_0x5970c6,_0x5309ed){var _0x39894f={'raw':!![],'where':{'id':_0x5970c6[_0x3fae('0x56')]['id']}},_0x54556a={};_0x54556a[_0x3fae('0x42')]=_[_0x3fae('0x44')](db[_0x3fae('0x3e')][_0x3fae('0x3f')]);_0x54556a[_0x3fae('0x45')]=_[_0x3fae('0x44')](_0x5970c6[_0x3fae('0x45')]);_0x54556a['filters']=_[_0x3fae('0x47')](_0x54556a[_0x3fae('0x42')],_0x54556a['query']);_0x39894f[_0x3fae('0x48')]=_[_0x3fae('0x47')](_0x54556a[_0x3fae('0x42')],qs[_0x3fae('0x49')](_0x5970c6[_0x3fae('0x45')]['fields']));_0x39894f[_0x3fae('0x48')]=_0x39894f['attributes'][_0x3fae('0x4a')]?_0x39894f[_0x3fae('0x48')]:_0x54556a[_0x3fae('0x42')];if(_0x5970c6[_0x3fae('0x45')][_0x3fae('0x53')]){_0x39894f['include']=[{'all':!![]}];}_0x39894f=_['merge']({},_0x39894f,_0x5970c6['options']);return db['SmsMessage']['find'](_0x39894f)[_0x3fae('0x25')](handleEntityNotFound(_0x5309ed,null))[_0x3fae('0x25')](respondWithResult(_0x5309ed,null))['catch'](handleError(_0x5309ed,null));};exports[_0x3fae('0x57')]=function(_0x18f73f,_0x5b796f){return db[_0x3fae('0x3e')][_0x3fae('0x57')](_0x18f73f[_0x3fae('0x58')],{})[_0x3fae('0x25')](respondWithResult(_0x5b796f,0xc9))[_0x3fae('0x2d')](handleError(_0x5b796f,null));};exports[_0x3fae('0x38')]=function(_0x185bde,_0x5c7976){if(_0x185bde['body']['id']){delete _0x185bde['body']['id'];}return db['SmsMessage'][_0x3fae('0x59')]({'where':{'id':_0x185bde[_0x3fae('0x56')]['id']}})[_0x3fae('0x25')](handleEntityNotFound(_0x5c7976,null))[_0x3fae('0x25')](saveUpdates(_0x185bde[_0x3fae('0x58')],null))[_0x3fae('0x25')](respondWithResult(_0x5c7976,null))[_0x3fae('0x2d')](handleError(_0x5c7976,null));};exports[_0x3fae('0x39')]=function(_0x1ab954,_0x2ff058){return db[_0x3fae('0x3e')]['find']({'where':{'id':_0x1ab954['params']['id']}})[_0x3fae('0x25')](handleEntityNotFound(_0x2ff058,null))['then'](removeEntity(_0x2ff058,null))[_0x3fae('0x2d')](handleError(_0x2ff058,null));};exports['describe']=function(_0x3d6fdf,_0x28ac0f){return db[_0x3fae('0x3e')][_0x3fae('0x5a')]()[_0x3fae('0x25')](respondWithResult(_0x28ac0f,null))['catch'](handleError(_0x28ac0f,null));};var interaction_log=require(_0x3fae('0x17'))('sms-interactions');exports[_0x3fae('0x5b')]=function(_0x5e37f0,_0x581d00,_0x30fe3f){var _0x4b722d={'agent':{},'channel':_0x3fae('0x5c')};if(_0x5e37f0[_0x3fae('0x58')]['id']){delete _0x5e37f0[_0x3fae('0x58')]['id'];}_0x5e37f0[_0x3fae('0x58')]['read']=!![];_0x5e37f0['body'][_0x3fae('0x5d')]=moment()[_0x3fae('0x5e')](_0x3fae('0x5f'));_0x5e37f0[_0x3fae('0x58')][_0x3fae('0x60')]=_0x5e37f0[_0x3fae('0x58')][_0x3fae('0x60')]||_0x5e37f0[_0x3fae('0x61')]['id'];_0x4b722d['agent']['id']=_0x5e37f0[_0x3fae('0x58')]['UserId'];return db[_0x3fae('0x3e')][_0x3fae('0x59')]({'where':{'id':_0x5e37f0[_0x3fae('0x56')]['id'],'UserId':null}})[_0x3fae('0x25')](handleEntityNotFound(_0x581d00,null))[_0x3fae('0x25')](saveUpdates(_0x5e37f0['body'],null))[_0x3fae('0x25')](function(_0x294526){if(_0x294526){_0x4b722d[_0x3fae('0x2b')]=_0x294526['get']({'plain':!![]});return db[_0x3fae('0x62')]['find']({'where':{'id':_0x294526['SmsInteractionId']}});}return null;})[_0x3fae('0x25')](handleEntityNotFound(_0x581d00,null))[_0x3fae('0x25')](function(_0xc3f89c){if(_0xc3f89c){return _0xc3f89c[_0x3fae('0x38')]({'UserId':_0x5e37f0[_0x3fae('0x58')]['UserId'],'read1stAt':_[_0x3fae('0x63')](_0xc3f89c[_0x3fae('0x64')])?moment()[_0x3fae('0x5e')](_0x3fae('0x5f')):undefined});}return null;})[_0x3fae('0x25')](function(_0x2142e4){if(_0x2142e4){_0x4b722d[_0x3fae('0x65')]=_0x2142e4[_0x3fae('0x66')]({'plain':!![]});interaction_log[_0x3fae('0x2c')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e37f0[_0x3fae('0x61')]['id'],_0x5e37f0[_0x3fae('0x61')][_0x3fae('0x3b')],_0x5e37f0[_0x3fae('0x61')]['role'],_0x4b722d[_0x3fae('0x65')]['id'],_0x5e37f0['body']?JSON[_0x3fae('0x29')](_0x5e37f0[_0x3fae('0x58')]):_0x3fae('0x67'));return respondWithRpcPromise(_0x3fae('0x68'),'acceptMessage',_0x4b722d);}return null;})[_0x3fae('0x25')](function(_0x3b4611){var _0x3c5e98=_0x3fae('0x69')+_0x3b4611[_0x3fae('0x2b')]['ContactId'];return db['sequelize'][_0x3fae('0x45')](_0x3c5e98,{'type':db[_0x3fae('0x6a')][_0x3fae('0x6b')][_0x3fae('0x6c')],'raw':!![]})['then'](function(_0x2c1bbe){return _0x2c1bbe;});})[_0x3fae('0x25')](function(_0x5635a2){if(_0x5635a2){_0x4b722d[_0x3fae('0x2b')][_0x3fae('0x6d')]=_0x5635a2[0x0];if(!_0x5e37f0[_0x3fae('0x58')]['UserId'])return;return db[_0x3fae('0x6e')][_0x3fae('0x59')]({'where':{'id':_0x5e37f0[_0x3fae('0x58')][_0x3fae('0x60')],'role':_0x3fae('0x6f')},'attributes':['id',_0x3fae('0x3b'),'fullname',_0x3fae('0x70'),_0x3fae('0x71')],'raw':!![]});}return null;})[_0x3fae('0x25')](function(_0x1b8329){if(!_0x1b8329)return null;_0x4b722d[_0x3fae('0x2b')][_0x3fae('0x6f')]=_0x1b8329;return _0x4b722d;})['then'](function(_0xea2c0b){if(_0xea2c0b){if(_0x5e37f0[_0x3fae('0x58')][_0x3fae('0x72')]){_0x4b722d[_0x3fae('0x2b')][_0x3fae('0x73')]=util[_0x3fae('0x5e')](_0x3fae('0x74'),_0x5e37f0[_0x3fae('0x61')][_0x3fae('0x3b')]);_0x4b722d[_0x3fae('0x2b')][_0x3fae('0x75')]=_0x4b722d[_0x3fae('0x75')];_0x4b722d[_0x3fae('0x2b')]['motionChannel']=_0x4b722d[_0x3fae('0x75')];_0x4b722d[_0x3fae('0x2b')]['event']='accept';return respondWithRpcPromise(_0x3fae('0x76'),_0x3fae('0x76'),{'event':_0x3fae('0x77'),'message':_0x4b722d['message']},client9002)[_0x3fae('0x25')](function(){return _0x4b722d;});}return _0x4b722d;}return null;})['then'](respondWithResult(_0x581d00,null))[_0x3fae('0x2d')](handleError(_0x581d00,null));};var interaction_log=require(_0x3fae('0x17'))(_0x3fae('0x78'));exports[_0x3fae('0x79')]=function(_0x23ab84,_0x444770,_0x1ee820){var _0x4629dd={'agent':{},'channel':'sms'};if(_0x23ab84[_0x3fae('0x58')]['id']){delete _0x23ab84['body']['id'];}_0x23ab84[_0x3fae('0x58')]['UserId']=_0x23ab84['body'][_0x3fae('0x60')]||_0x23ab84[_0x3fae('0x61')]['id'];_0x4629dd[_0x3fae('0x6f')]['id']=_0x23ab84[_0x3fae('0x58')][_0x3fae('0x60')];return db[_0x3fae('0x3e')][_0x3fae('0x59')]({'where':{'id':_0x23ab84['params']['id'],'UserId':null}})[_0x3fae('0x25')](handleEntityNotFound(_0x444770,null))[_0x3fae('0x25')](function(_0x21d1f7){if(_0x21d1f7){_0x4629dd[_0x3fae('0x2b')]=_0x21d1f7['get']({'plain':!![]});return db['SmsInteraction'][_0x3fae('0x59')]({'where':{'id':_0x21d1f7[_0x3fae('0x7a')]}});}return null;})[_0x3fae('0x25')](handleEntityNotFound(_0x444770,null))[_0x3fae('0x25')](function(_0x1c3ea7){if(_0x1c3ea7){_0x4629dd[_0x3fae('0x65')]=_0x1c3ea7[_0x3fae('0x66')]({'plain':!![]});interaction_log[_0x3fae('0x2c')](_0x3fae('0x7b'),_0x23ab84[_0x3fae('0x61')]['id'],_0x23ab84[_0x3fae('0x61')]['name'],_0x23ab84['user'][_0x3fae('0x7c')],_0x4629dd[_0x3fae('0x65')]['id'],_0x23ab84[_0x3fae('0x58')]?JSON[_0x3fae('0x29')](_0x23ab84['body']):_0x3fae('0x67'));return respondWithRpcPromise('RejectMessage',_0x3fae('0x7d'),_0x4629dd);}return null;})[_0x3fae('0x25')](function(_0x2569c2){var _0x2b91b9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2569c2[_0x3fae('0x2b')][_0x3fae('0x7e')];return db['sequelize']['query'](_0x2b91b9,{'type':db[_0x3fae('0x6a')][_0x3fae('0x6b')][_0x3fae('0x6c')],'raw':!![]})['then'](function(_0x5eed27){return _0x5eed27;});})[_0x3fae('0x25')](function(_0x1222b4){if(_0x1222b4){_0x4629dd[_0x3fae('0x2b')]['contact']=_0x1222b4[0x0];if(!_0x23ab84[_0x3fae('0x58')][_0x3fae('0x60')])return;return db[_0x3fae('0x6e')]['find']({'where':{'id':_0x23ab84[_0x3fae('0x58')][_0x3fae('0x60')],'role':_0x3fae('0x6f')},'attributes':['id','name','fullname',_0x3fae('0x70'),'internal'],'raw':!![]});}return null;})[_0x3fae('0x25')](function(_0x2dfd11){if(!_0x2dfd11)return null;_0x4629dd[_0x3fae('0x2b')][_0x3fae('0x6f')]=_0x2dfd11;return _0x4629dd;})[_0x3fae('0x25')](function(_0x209107){if(_0x209107){_0x209107['message'][_0x3fae('0x73')]=util[_0x3fae('0x5e')]('SIP/%s',_0x23ab84[_0x3fae('0x61')][_0x3fae('0x3b')]);_0x209107[_0x3fae('0x2b')][_0x3fae('0x75')]=_0x4629dd['channel'];_0x209107['message'][_0x3fae('0x7f')]=_0x4629dd[_0x3fae('0x75')];_0x209107['message'][_0x3fae('0x80')]='reject';respondWithRpcPromise('EventManager',_0x3fae('0x76'),{'event':_0x3fae('0x81'),'message':_0x209107[_0x3fae('0x2b')]},client9002);return _0x4629dd;}return null;})[_0x3fae('0x25')](respondWithResult(_0x444770,null))[_0x3fae('0x2d')](handleError(_0x444770,null));};exports[_0x3fae('0x35')]=function(_0x1c8989,_0x3ebda4,_0x4330cb){if(_0x1c8989[_0x3fae('0x58')]['id']){delete _0x1c8989[_0x3fae('0x58')]['id'];}var _0x128355;return db[_0x3fae('0x3e')][_0x3fae('0x59')]({'where':{'id':_0x1c8989[_0x3fae('0x56')]['id']}})[_0x3fae('0x25')](handleEntityNotFound(_0x3ebda4,null))['then'](function(_0x2b1c56){if(_0x2b1c56){_0x128355=_0x2b1c56;return db[_0x3fae('0x82')][_0x3fae('0x59')]({'where':{'id':_0x2b1c56['SmsAccountId']}});}})[_0x3fae('0x25')](handleEntityNotFound(_0x3ebda4,null))[_0x3fae('0x25')](function(_0x289278){if(_0x289278){logger['debug'](_0x3fae('0x83'),_0x3fae('0x35'),'received\x20delivery\x20report\x20from',_0x289278[_0x3fae('0x84')],util['inspect'](_0x1c8989[_0x3fae('0x58')],{'showHidden':![],'depth':null}));switch(_0x289278[_0x3fae('0x84')]){case'twilio':if(_0x1c8989[_0x3fae('0x58')][_0x3fae('0x85')]&&_0x1c8989[_0x3fae('0x58')]['MessageSid']===_0x128355[_0x3fae('0x86')]){return _0x128355[_0x3fae('0x38')]({'read':!![]});}else{logger[_0x3fae('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fae('0x35'),_0x3fae('0x87'),util['inspect'](_0x1c8989['body'],{'showHidden':![],'depth':null}));}break;case _0x3fae('0x88'):if(_0x1c8989[_0x3fae('0x58')][_0x3fae('0x89')]&&_0x1c8989[_0x3fae('0x58')][_0x3fae('0x89')]===_0x128355['messageId']&&_['indexOf']([_0x3fae('0x8a'),_0x3fae('0x8b')],_0x1c8989[_0x3fae('0x58')][_0x3fae('0x8c')])>=0x0){return _0x128355['update']({'read':!![]});}else{logger['error'](_0x3fae('0x8d'),_0x3fae('0x35'),_0x3fae('0x8e'),util[_0x3fae('0x8f')](_0x1c8989[_0x3fae('0x58')],{'showHidden':![],'depth':null}));}break;case _0x3fae('0x90'):var _0x1fd108=_0x1c8989[_0x3fae('0x58')][_0x3fae('0x91')][0x0];if(_0x1fd108[_0x3fae('0x35')][_0x3fae('0x92')]===_0x3fae('0x93')){return _0x128355[_0x3fae('0x38')]({'read':!![]});}else{logger['error'](_0x3fae('0x8d'),'status',_0x3fae('0x90'),util[_0x3fae('0x8f')](_0x1c8989[_0x3fae('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x128355;}})[_0x3fae('0x25')](respondWithResult(_0x3ebda4,null))['catch'](handleError(_0x3ebda4,null));}; \ No newline at end of file +var _0x4cf5=['Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filter','where','SmsMessage','includeAll','include','findAll','rows','show','params','length','merge','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','info','[SMSMESSAGE: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','QueryTypes','contact','User','fullname','internal','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','interface','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered'];(function(_0x161464,_0x56acc1){var _0x2b198f=function(_0x361916){while(--_0x361916){_0x161464['push'](_0x161464['shift']());}};_0x2b198f(++_0x56acc1);}(_0x4cf5,0x12e));var _0x54cf=function(_0x381e76,_0x5b10f0){_0x381e76=_0x381e76-0x0;var _0x38c786=_0x4cf5[_0x381e76];return _0x38c786;};'use strict';var emlformat=require(_0x54cf('0x0'));var rimraf=require(_0x54cf('0x1'));var zipdir=require(_0x54cf('0x2'));var jsonpatch=require(_0x54cf('0x3'));var rp=require(_0x54cf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x54cf('0x5'));var util=require(_0x54cf('0x6'));var path=require(_0x54cf('0x7'));var sox=require('sox');var csv=require(_0x54cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54cf('0x9'));var _=require(_0x54cf('0xa'));var squel=require(_0x54cf('0xb'));var crypto=require(_0x54cf('0xc'));var jsforce=require(_0x54cf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x54cf('0xe'));var Redis=require('ioredis');var authService=require(_0x54cf('0xf'));var qs=require(_0x54cf('0x10'));var as=require(_0x54cf('0x11'));var hardwareService=require(_0x54cf('0x12'));var logger=require('../../config/logger')(_0x54cf('0x13'));var utils=require(_0x54cf('0x14'));var config=require(_0x54cf('0x15'));var licenseUtil=require(_0x54cf('0x16'));var db=require(_0x54cf('0x17'))['db'];config[_0x54cf('0x18')]=_['defaults'](config[_0x54cf('0x18')],{'host':_0x54cf('0x19'),'port':0x18eb});var socket=require(_0x54cf('0x1a'))(new Redis(config[_0x54cf('0x18')]));require('./smsMessage.socket')[_0x54cf('0x1b')](socket);var jayson=require(_0x54cf('0x1c'));var client=jayson[_0x54cf('0x1d')][_0x54cf('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x54cf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x14d3c6,_0x4cf543,_0x421fe7,_0x38f794){return new BPromise(function(_0x51a789,_0x584254){var _0x5d3fdd=_0x38f794||client;return _0x5d3fdd[_0x54cf('0x1f')](_0x14d3c6,_0x421fe7)[_0x54cf('0x20')](function(_0x4412e3){logger['info'](_0x54cf('0x21'),_0x4cf543,'request\x20sent');logger[_0x54cf('0x22')](_0x54cf('0x23'),_0x4cf543,'request\x20sent',JSON['stringify'](_0x4412e3));if(_0x4412e3[_0x54cf('0x24')]){if(_0x4412e3[_0x54cf('0x24')][_0x54cf('0x25')]===0x1f4){logger['error'](_0x54cf('0x21'),_0x4cf543,_0x4412e3[_0x54cf('0x24')][_0x54cf('0x26')]);return _0x584254(_0x4412e3['error']['message']);}logger[_0x54cf('0x24')](_0x54cf('0x21'),_0x4cf543,_0x4412e3[_0x54cf('0x24')][_0x54cf('0x26')]);return _0x51a789(_0x4412e3[_0x54cf('0x24')][_0x54cf('0x26')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4cf543,_0x54cf('0x27'));_0x51a789(_0x4412e3['result']['message']);}})[_0x54cf('0x28')](function(_0x44e970){logger[_0x54cf('0x24')](_0x54cf('0x21'),_0x4cf543,_0x44e970);_0x584254(_0x44e970);});});}function respondWithStatusCode(_0x5e41f8,_0x389d8e){_0x389d8e=_0x389d8e||0xcc;return function(_0x3d76b1){if(_0x3d76b1){return _0x5e41f8['sendStatus'](_0x389d8e);}return _0x5e41f8[_0x54cf('0x29')](_0x389d8e)[_0x54cf('0x2a')]();};}function respondWithResult(_0x1c2d2d,_0x592121){_0x592121=_0x592121||0xc8;return function(_0x37cdd4){if(_0x37cdd4){return _0x1c2d2d[_0x54cf('0x29')](_0x592121)[_0x54cf('0x2b')](_0x37cdd4);}};}function respondWithFilteredResult(_0x10588d,_0x1de40a){return function(_0x532dbb){if(_0x532dbb){var _0xdeba42=typeof _0x1de40a['offset']===_0x54cf('0x2c')&&typeof _0x1de40a[_0x54cf('0x2d')]===_0x54cf('0x2c');var _0x5d8460=_0x532dbb[_0x54cf('0x2e')];var _0x232e72=_0xdeba42?0x0:_0x1de40a['offset'];var _0x403fd7=_0xdeba42?_0x532dbb[_0x54cf('0x2e')]:_0x1de40a['offset']+_0x1de40a[_0x54cf('0x2d')];var _0x3b4f06;if(_0x403fd7>=_0x5d8460){_0x403fd7=_0x5d8460;_0x3b4f06=0xc8;}else{_0x3b4f06=0xce;}_0x10588d[_0x54cf('0x29')](_0x3b4f06);return _0x10588d[_0x54cf('0x2f')](_0x54cf('0x30'),_0x232e72+'-'+_0x403fd7+'/'+_0x5d8460)['json'](_0x532dbb);}return null;};}function patchUpdates(_0x506cc){return function(_0x527a97){try{jsonpatch[_0x54cf('0x31')](_0x527a97,_0x506cc,!![]);}catch(_0x50daaa){return BPromise[_0x54cf('0x32')](_0x50daaa);}return _0x527a97[_0x54cf('0x33')]();};}function saveUpdates(_0x2247a3,_0xb30622){return function(_0x391153){if(_0x391153){return _0x391153[_0x54cf('0x34')](_0x2247a3)[_0x54cf('0x20')](function(_0x52a740){return _0x52a740;});}return null;};}function removeEntity(_0x2d4fcb,_0x341351){return function(_0x38a6dd){if(_0x38a6dd){return _0x38a6dd[_0x54cf('0x35')]()[_0x54cf('0x20')](function(){_0x2d4fcb[_0x54cf('0x29')](0xcc)[_0x54cf('0x2a')]();});}};}function handleEntityNotFound(_0xc7778c,_0x1ce5bb){return function(_0x46130d){if(!_0x46130d){_0xc7778c[_0x54cf('0x36')](0x194);}return _0x46130d;};}function handleError(_0x5636e6,_0xc1a6b7){_0xc1a6b7=_0xc1a6b7||0x1f4;return function(_0x2d4ee9){logger[_0x54cf('0x24')](_0x2d4ee9['stack']);if(_0x2d4ee9[_0x54cf('0x37')]){delete _0x2d4ee9[_0x54cf('0x37')];}_0x5636e6[_0x54cf('0x29')](_0xc1a6b7)[_0x54cf('0x38')](_0x2d4ee9);};}exports[_0x54cf('0x39')]=function(_0x4d97ce,_0x47b0dc){var _0x63fbae={},_0x497dd7={},_0x129625={'count':0x0,'rows':[]};var _0x2802f4=_[_0x54cf('0x3a')](db['SmsMessage'][_0x54cf('0x3b')],function(_0x5e93b9){return{'name':_0x5e93b9[_0x54cf('0x3c')],'type':_0x5e93b9[_0x54cf('0x3d')][_0x54cf('0x3e')]};});_0x497dd7[_0x54cf('0x3f')]=_[_0x54cf('0x3a')](_0x2802f4,_0x54cf('0x37'));_0x497dd7[_0x54cf('0x40')]=_[_0x54cf('0x41')](_0x4d97ce[_0x54cf('0x40')]);_0x497dd7[_0x54cf('0x42')]=_[_0x54cf('0x43')](_0x497dd7['model'],_0x497dd7['query']);_0x63fbae[_0x54cf('0x44')]=_[_0x54cf('0x43')](_0x497dd7['model'],qs[_0x54cf('0x45')](_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x45')]));_0x63fbae[_0x54cf('0x44')]=_0x63fbae['attributes']['length']?_0x63fbae['attributes']:_0x497dd7[_0x54cf('0x3f')];if(!_0x4d97ce['query'][_0x54cf('0x46')](_0x54cf('0x47'))){_0x63fbae[_0x54cf('0x2d')]=qs[_0x54cf('0x2d')](_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x2d')]);_0x63fbae['offset']=qs['offset'](_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x48')]);}_0x63fbae[_0x54cf('0x49')]=qs[_0x54cf('0x4a')](_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x4a')]);_0x63fbae['where']=qs[_0x54cf('0x42')](_['pick'](_0x4d97ce[_0x54cf('0x40')],_0x497dd7[_0x54cf('0x42')]),_0x2802f4);if(_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x4b')]){_0x63fbae[_0x54cf('0x4c')]=_['merge'](_0x63fbae[_0x54cf('0x4c')],{'$or':_[_0x54cf('0x3a')](_0x2802f4,function(_0x2ad91a){if(_0x2ad91a[_0x54cf('0x3d')]!=='VIRTUAL'){var _0x2b9b37={};_0x2b9b37[_0x2ad91a['name']]={'$like':'%'+_0x4d97ce[_0x54cf('0x40')]['filter']+'%'};return _0x2b9b37;}})});}_0x63fbae=_['merge']({},_0x63fbae,_0x4d97ce['options']);var _0x57c827={'where':_0x63fbae['where']};return db[_0x54cf('0x4d')][_0x54cf('0x2e')](_0x57c827)[_0x54cf('0x20')](function(_0x37f5f0){_0x129625[_0x54cf('0x2e')]=_0x37f5f0;if(_0x4d97ce[_0x54cf('0x40')][_0x54cf('0x4e')]){_0x63fbae[_0x54cf('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0x54cf('0x50')](_0x63fbae);})['then'](function(_0x53a364){_0x129625[_0x54cf('0x51')]=_0x53a364;return _0x129625;})[_0x54cf('0x20')](respondWithFilteredResult(_0x47b0dc,_0x63fbae))[_0x54cf('0x28')](handleError(_0x47b0dc,null));};exports[_0x54cf('0x52')]=function(_0xb0537c,_0x39b456){var _0x116941={'raw':!![],'where':{'id':_0xb0537c[_0x54cf('0x53')]['id']}},_0x1b54da={};_0x1b54da[_0x54cf('0x3f')]=_[_0x54cf('0x41')](db[_0x54cf('0x4d')][_0x54cf('0x3b')]);_0x1b54da['query']=_[_0x54cf('0x41')](_0xb0537c[_0x54cf('0x40')]);_0x1b54da[_0x54cf('0x42')]=_[_0x54cf('0x43')](_0x1b54da[_0x54cf('0x3f')],_0x1b54da[_0x54cf('0x40')]);_0x116941[_0x54cf('0x44')]=_[_0x54cf('0x43')](_0x1b54da[_0x54cf('0x3f')],qs[_0x54cf('0x45')](_0xb0537c[_0x54cf('0x40')][_0x54cf('0x45')]));_0x116941['attributes']=_0x116941[_0x54cf('0x44')][_0x54cf('0x54')]?_0x116941[_0x54cf('0x44')]:_0x1b54da[_0x54cf('0x3f')];if(_0xb0537c[_0x54cf('0x40')][_0x54cf('0x4e')]){_0x116941[_0x54cf('0x4f')]=[{'all':!![]}];}_0x116941=_[_0x54cf('0x55')]({},_0x116941,_0xb0537c['options']);return db[_0x54cf('0x4d')][_0x54cf('0x56')](_0x116941)[_0x54cf('0x20')](handleEntityNotFound(_0x39b456,null))[_0x54cf('0x20')](respondWithResult(_0x39b456,null))[_0x54cf('0x28')](handleError(_0x39b456,null));};exports[_0x54cf('0x57')]=function(_0x4d977d,_0x39350c){return db[_0x54cf('0x4d')]['create'](_0x4d977d[_0x54cf('0x58')],{})[_0x54cf('0x20')](respondWithResult(_0x39350c,0xc9))['catch'](handleError(_0x39350c,null));};exports[_0x54cf('0x34')]=function(_0x415095,_0x3823e2){if(_0x415095[_0x54cf('0x58')]['id']){delete _0x415095[_0x54cf('0x58')]['id'];}return db[_0x54cf('0x4d')][_0x54cf('0x56')]({'where':{'id':_0x415095[_0x54cf('0x53')]['id']}})[_0x54cf('0x20')](handleEntityNotFound(_0x3823e2,null))['then'](saveUpdates(_0x415095['body'],null))['then'](respondWithResult(_0x3823e2,null))['catch'](handleError(_0x3823e2,null));};exports[_0x54cf('0x35')]=function(_0x585627,_0x21c615){return db[_0x54cf('0x4d')][_0x54cf('0x56')]({'where':{'id':_0x585627[_0x54cf('0x53')]['id']}})[_0x54cf('0x20')](handleEntityNotFound(_0x21c615,null))['then'](removeEntity(_0x21c615,null))[_0x54cf('0x28')](handleError(_0x21c615,null));};exports['describe']=function(_0x562b45,_0x2ce1ff){return db['SmsMessage'][_0x54cf('0x59')]()[_0x54cf('0x20')](respondWithResult(_0x2ce1ff,null))[_0x54cf('0x28')](handleError(_0x2ce1ff,null));};var interaction_log=require(_0x54cf('0x5a'))(_0x54cf('0x5b'));exports[_0x54cf('0x5c')]=function(_0x518b4f,_0x47b3e6,_0x219e3b){var _0x3cde4e={'agent':{},'channel':_0x54cf('0x5d')};if(_0x518b4f[_0x54cf('0x58')]['id']){delete _0x518b4f[_0x54cf('0x58')]['id'];}_0x518b4f[_0x54cf('0x58')][_0x54cf('0x5e')]=!![];_0x518b4f[_0x54cf('0x58')]['readAt']=moment()[_0x54cf('0x5f')](_0x54cf('0x60'));_0x518b4f[_0x54cf('0x58')][_0x54cf('0x61')]=_0x518b4f[_0x54cf('0x58')][_0x54cf('0x61')]||_0x518b4f[_0x54cf('0x62')]['id'];_0x3cde4e[_0x54cf('0x63')]['id']=_0x518b4f[_0x54cf('0x58')][_0x54cf('0x61')];return db[_0x54cf('0x4d')][_0x54cf('0x56')]({'where':{'id':_0x518b4f[_0x54cf('0x53')]['id'],'UserId':null}})[_0x54cf('0x20')](handleEntityNotFound(_0x47b3e6,null))['then'](saveUpdates(_0x518b4f['body'],null))[_0x54cf('0x20')](function(_0x124c57){if(_0x124c57){_0x3cde4e[_0x54cf('0x26')]=_0x124c57[_0x54cf('0x64')]({'plain':!![]});return db[_0x54cf('0x65')][_0x54cf('0x56')]({'where':{'id':_0x124c57[_0x54cf('0x66')]}});}return null;})[_0x54cf('0x20')](handleEntityNotFound(_0x47b3e6,null))['then'](function(_0x34d47b){if(_0x34d47b){return _0x34d47b['update']({'UserId':_0x518b4f['body'][_0x54cf('0x61')],'read1stAt':_['isNil'](_0x34d47b[_0x54cf('0x67')])?moment()[_0x54cf('0x5f')](_0x54cf('0x60')):undefined});}return null;})[_0x54cf('0x20')](function(_0x520252){if(_0x520252){_0x3cde4e[_0x54cf('0x68')]=_0x520252[_0x54cf('0x64')]({'plain':!![]});interaction_log[_0x54cf('0x69')](_0x54cf('0x6a'),_0x518b4f[_0x54cf('0x62')]['id'],_0x518b4f[_0x54cf('0x62')][_0x54cf('0x37')],_0x518b4f[_0x54cf('0x62')][_0x54cf('0x6b')],_0x3cde4e[_0x54cf('0x68')]['id'],_0x518b4f[_0x54cf('0x58')]?JSON['stringify'](_0x518b4f[_0x54cf('0x58')]):_0x54cf('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x54cf('0x6d'),_0x3cde4e);}return null;})['then'](function(_0xa9056a){var _0x59e2ca=_0x54cf('0x6e')+_0xa9056a[_0x54cf('0x26')][_0x54cf('0x6f')];return db[_0x54cf('0x70')][_0x54cf('0x40')](_0x59e2ca,{'type':db['Sequelize'][_0x54cf('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x3bb87b){return _0x3bb87b;});})['then'](function(_0x58660b){if(_0x58660b){_0x3cde4e[_0x54cf('0x26')][_0x54cf('0x72')]=_0x58660b[0x0];if(!_0x518b4f[_0x54cf('0x58')][_0x54cf('0x61')])return;return db[_0x54cf('0x73')][_0x54cf('0x56')]({'where':{'id':_0x518b4f[_0x54cf('0x58')][_0x54cf('0x61')],'role':_0x54cf('0x63')},'attributes':['id',_0x54cf('0x37'),_0x54cf('0x74'),'email',_0x54cf('0x75')],'raw':!![]});}return null;})[_0x54cf('0x20')](function(_0x1cd701){if(!_0x1cd701)return null;_0x3cde4e[_0x54cf('0x26')][_0x54cf('0x63')]=_0x1cd701;return _0x3cde4e;})[_0x54cf('0x20')](function(_0x4b735c){if(_0x4b735c){if(_0x518b4f[_0x54cf('0x58')]['manual']){_0x3cde4e['message']['interface']=util[_0x54cf('0x5f')]('SIP/%s',_0x518b4f[_0x54cf('0x62')]['name']);_0x3cde4e[_0x54cf('0x26')][_0x54cf('0x76')]=_0x3cde4e[_0x54cf('0x76')];_0x3cde4e[_0x54cf('0x26')][_0x54cf('0x77')]=_0x3cde4e[_0x54cf('0x76')];_0x3cde4e[_0x54cf('0x26')][_0x54cf('0x78')]=_0x54cf('0x5c');return respondWithRpcPromise(_0x54cf('0x79'),_0x54cf('0x79'),{'event':'acceptmessage','message':_0x3cde4e['message']},client9002)['then'](function(){return _0x3cde4e;});}return _0x3cde4e;}return null;})[_0x54cf('0x20')](respondWithResult(_0x47b3e6,null))['catch'](handleError(_0x47b3e6,null));};var interaction_log=require('../../config/logger')(_0x54cf('0x5b'));exports[_0x54cf('0x32')]=function(_0x571463,_0x49ef5b,_0x329c3b){var _0x4f3c77={'agent':{},'channel':'sms'};if(_0x571463[_0x54cf('0x58')]['id']){delete _0x571463[_0x54cf('0x58')]['id'];}_0x571463[_0x54cf('0x58')][_0x54cf('0x61')]=_0x571463[_0x54cf('0x58')]['UserId']||_0x571463[_0x54cf('0x62')]['id'];_0x4f3c77['agent']['id']=_0x571463['body'][_0x54cf('0x61')];return db[_0x54cf('0x4d')]['find']({'where':{'id':_0x571463[_0x54cf('0x53')]['id'],'UserId':null}})[_0x54cf('0x20')](handleEntityNotFound(_0x49ef5b,null))[_0x54cf('0x20')](function(_0x517d24){if(_0x517d24){_0x4f3c77[_0x54cf('0x26')]=_0x517d24[_0x54cf('0x64')]({'plain':!![]});return db[_0x54cf('0x65')][_0x54cf('0x56')]({'where':{'id':_0x517d24[_0x54cf('0x66')]}});}return null;})[_0x54cf('0x20')](handleEntityNotFound(_0x49ef5b,null))[_0x54cf('0x20')](function(_0x59db57){if(_0x59db57){_0x4f3c77[_0x54cf('0x68')]=_0x59db57[_0x54cf('0x64')]({'plain':!![]});interaction_log[_0x54cf('0x69')](_0x54cf('0x7a'),_0x571463[_0x54cf('0x62')]['id'],_0x571463[_0x54cf('0x62')][_0x54cf('0x37')],_0x571463[_0x54cf('0x62')][_0x54cf('0x6b')],_0x4f3c77[_0x54cf('0x68')]['id'],_0x571463[_0x54cf('0x58')]?JSON['stringify'](_0x571463[_0x54cf('0x58')]):_0x54cf('0x6c'));return respondWithRpcPromise(_0x54cf('0x7b'),_0x54cf('0x7c'),_0x4f3c77);}return null;})[_0x54cf('0x20')](function(_0x1c8cbd){var _0x4f5434=_0x54cf('0x6e')+_0x1c8cbd[_0x54cf('0x26')]['ContactId'];return db['sequelize'][_0x54cf('0x40')](_0x4f5434,{'type':db['Sequelize'][_0x54cf('0x71')][_0x54cf('0x7d')],'raw':!![]})[_0x54cf('0x20')](function(_0x2ecf92){return _0x2ecf92;});})['then'](function(_0xc15fb9){if(_0xc15fb9){_0x4f3c77[_0x54cf('0x26')][_0x54cf('0x72')]=_0xc15fb9[0x0];if(!_0x571463[_0x54cf('0x58')][_0x54cf('0x61')])return;return db[_0x54cf('0x73')][_0x54cf('0x56')]({'where':{'id':_0x571463[_0x54cf('0x58')]['UserId'],'role':'agent'},'attributes':['id','name',_0x54cf('0x74'),'email',_0x54cf('0x75')],'raw':!![]});}return null;})[_0x54cf('0x20')](function(_0x5a5937){if(!_0x5a5937)return null;_0x4f3c77[_0x54cf('0x26')][_0x54cf('0x63')]=_0x5a5937;return _0x4f3c77;})[_0x54cf('0x20')](function(_0x2a8ff7){if(_0x2a8ff7){_0x2a8ff7[_0x54cf('0x26')][_0x54cf('0x7e')]=util[_0x54cf('0x5f')](_0x54cf('0x7f'),_0x571463[_0x54cf('0x62')]['name']);_0x2a8ff7['message']['channel']=_0x4f3c77['channel'];_0x2a8ff7['message'][_0x54cf('0x77')]=_0x4f3c77[_0x54cf('0x76')];_0x2a8ff7['message'][_0x54cf('0x78')]=_0x54cf('0x32');respondWithRpcPromise(_0x54cf('0x79'),_0x54cf('0x79'),{'event':_0x54cf('0x80'),'message':_0x2a8ff7[_0x54cf('0x26')]},client9002);return _0x4f3c77;}return null;})[_0x54cf('0x20')](respondWithResult(_0x49ef5b,null))[_0x54cf('0x28')](handleError(_0x49ef5b,null));};exports['status']=function(_0x42005e,_0x119b79,_0x4d2e00){if(_0x42005e[_0x54cf('0x58')]['id']){delete _0x42005e[_0x54cf('0x58')]['id'];}var _0x545e52;return db['SmsMessage']['find']({'where':{'id':_0x42005e['params']['id']}})['then'](handleEntityNotFound(_0x119b79,null))[_0x54cf('0x20')](function(_0x495c85){if(_0x495c85){_0x545e52=_0x495c85;return db[_0x54cf('0x81')]['find']({'where':{'id':_0x495c85[_0x54cf('0x82')]}});}})[_0x54cf('0x20')](handleEntityNotFound(_0x119b79,null))['then'](function(_0x34d0e3){if(_0x34d0e3){logger[_0x54cf('0x22')](_0x54cf('0x23'),_0x54cf('0x29'),_0x54cf('0x83'),_0x34d0e3[_0x54cf('0x3d')],util[_0x54cf('0x84')](_0x42005e['body'],{'showHidden':![],'depth':null}));switch(_0x34d0e3[_0x54cf('0x3d')]){case _0x54cf('0x85'):if(_0x42005e[_0x54cf('0x58')][_0x54cf('0x86')]&&_0x42005e[_0x54cf('0x58')][_0x54cf('0x86')]===_0x545e52[_0x54cf('0x87')]){return _0x545e52[_0x54cf('0x34')]({'read':!![]});}else{logger['error'](_0x54cf('0x88'),_0x54cf('0x29'),_0x54cf('0x85'),util['inspect'](_0x42005e['body'],{'showHidden':![],'depth':null}));}break;case _0x54cf('0x89'):if(_0x42005e[_0x54cf('0x58')][_0x54cf('0x8a')]&&_0x42005e['body'][_0x54cf('0x8a')]===_0x545e52['messageId']&&_[_0x54cf('0x8b')]([_0x54cf('0x8c'),_0x54cf('0x8d')],_0x42005e[_0x54cf('0x58')][_0x54cf('0x8e')])>=0x0){return _0x545e52[_0x54cf('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x54cf('0x8f'),util[_0x54cf('0x84')](_0x42005e['body'],{'showHidden':![],'depth':null}));}break;case _0x54cf('0x90'):var _0x3237ee=_0x42005e[_0x54cf('0x58')][_0x54cf('0x91')][0x0];if(_0x3237ee[_0x54cf('0x29')][_0x54cf('0x92')]===_0x54cf('0x93')){return _0x545e52['update']({'read':!![]});}else{logger[_0x54cf('0x24')](_0x54cf('0x88'),_0x54cf('0x29'),'infobip',util['inspect'](_0x42005e[_0x54cf('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x545e52;}})['then'](respondWithResult(_0x119b79,null))['catch'](handleError(_0x119b79,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index e15a888..f5c9f61 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 _0x6f00=['../../mysqldb','SmsMessage','save','update','remove','emit','hook','events'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x6f00,0x1ef));var _0x06f0=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x6f00[_0x5bfa44];return _0x43815f;};'use strict';var EventEmitter=require(_0x06f0('0x0'));var SmsMessage=require(_0x06f0('0x1'))['db'][_0x06f0('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x06f0('0x3'),'afterUpdate':_0x06f0('0x4'),'afterDestroy':_0x06f0('0x5')};function emitEvent(_0x390901){return function(_0x3c4a1e,_0x1cb101,_0x349e68){SmsMessageEvents['emit'](_0x390901+':'+_0x3c4a1e['id'],_0x3c4a1e);SmsMessageEvents[_0x06f0('0x6')](_0x390901,_0x3c4a1e);_0x349e68(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x06f0('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x7a39=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x1f5812,_0x5d342a){var _0x460582=function(_0x40037f){while(--_0x40037f){_0x1f5812['push'](_0x1f5812['shift']());}};_0x460582(++_0x5d342a);}(_0x7a39,0x16d));var _0x97a3=function(_0x528045,_0x4e6cc7){_0x528045=_0x528045-0x0;var _0x217436=_0x7a39[_0x528045];return _0x217436;};'use strict';var EventEmitter=require(_0x97a3('0x0'));var SmsMessage=require(_0x97a3('0x1'))['db'][_0x97a3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x97a3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d3e6d){return function(_0x5b58e5,_0x35c8d6,_0x5a6775){SmsMessageEvents[_0x97a3('0x4')](_0x2d3e6d+':'+_0x5b58e5['id'],_0x5b58e5);SmsMessageEvents['emit'](_0x2d3e6d,_0x5b58e5);_0x5a6775(null);};}for(var e in events){if(events[_0x97a3('0x5')](e)){var event=events[e];SmsMessage[_0x97a3('0x6')](e,emitEvent(event));}}module[_0x97a3('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 d5ea57d..ebad0ca 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 _0xc480=['message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','length','createHash','digest','hex','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','applicationId','Basic\x20%s','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','Bearer\x20','refid','status','message','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/status?token=','token','sid','catch','error','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','&password=','GET','split','POST','user_key','session_key','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/api/sms/messages/'];(function(_0x4bd0aa,_0x15b4dc){var _0x4a9178=function(_0xcc0c58){while(--_0xcc0c58){_0x4bd0aa['push'](_0x4bd0aa['shift']());}};_0x4a9178(++_0x15b4dc);}(_0xc480,0x9f));var _0x0c48=function(_0x2db200,_0x327cb6){_0x2db200=_0x2db200-0x0;var _0x2d01e1=_0xc480[_0x2db200];return _0x2d01e1;};'use strict';var _=require(_0x0c48('0x0'));var util=require(_0x0c48('0x1'));var logger=require(_0x0c48('0x2'))(_0x0c48('0x3'));var moment=require(_0x0c48('0x4'));var BPromise=require('bluebird');var rp=require(_0x0c48('0x5'));var fs=require('fs');var path=require(_0x0c48('0x6'));var rimraf=require(_0x0c48('0x7'));var config=require(_0x0c48('0x8'));var attributes=require(_0x0c48('0x9'));module[_0x0c48('0xa')]=function(_0x1bc18d,_0xee19f6){return _0x1bc18d[_0x0c48('0xb')](_0x0c48('0xc'),attributes,{'tableName':_0x0c48('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0c48('0xe')]},{'name':'fti_sms_messages','fields':[_0x0c48('0xf')],'type':_0x0c48('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x156455,_0x5c9ebb,_0x209c6f){var _0x173fdd=_0x1bc18d[_0x0c48('0x11')];var _0x2d098a=_0x156455['get']({'plain':!![]});if(_0x2d098a[_0x0c48('0x12')][_0x0c48('0x13')]()==='in'||_0x2d098a[_0x0c48('0x12')][_0x0c48('0x13')]()===_0x0c48('0x14')&&!_0x2d098a[_0x0c48('0x15')]&&!_[_0x0c48('0x16')](_0x2d098a['UserId'])&&!_[_0x0c48('0x16')](_0x2d098a[_0x0c48('0x17')])){_0x173fdd[_0x0c48('0x18')][_0x0c48('0x19')]({'where':{'id':_0x2d098a[_0x0c48('0x17')]}})[_0x0c48('0x1a')](function(_0x38d508){if(_0x38d508){_0x38d508[_0x0c48('0x1b')]({'lastMsgAt':_0x2d098a['createdAt'],'lastMsgDirection':_0x2d098a[_0x0c48('0x12')]['toLowerCase']()});}})['catch'](function(_0x173cd8){console['error'](_0x173cd8);});}if(_0x2d098a[_0x0c48('0x12')]===_0x0c48('0x14')&&!_0x2d098a[_0x0c48('0x15')]){var _0x3f9cff;_0x173fdd[_0x0c48('0x1c')]['find']({'where':{'id':_0x2d098a[_0x0c48('0x1d')]},'raw':!![]})[_0x0c48('0x1a')](function(_0x124cfe){_0x3f9cff=_0x124cfe;if(_0x3f9cff&&_0x3f9cff[_0x0c48('0x1e')]){switch(_0x3f9cff[_0x0c48('0x1e')]){case _0x0c48('0x1f'):var _0x5a40f4=require('twilio');if(_0x3f9cff[_0x0c48('0x20')]&&_0x3f9cff['authToken']&&_0x3f9cff['phone']){var _0x43dd3e=new _0x5a40f4(_0x3f9cff[_0x0c48('0x20')],_0x3f9cff[_0x0c48('0x21')]);_0x43dd3e[_0x0c48('0x22')]['create']({'body':_0x2d098a['body'],'to':_0x2d098a[_0x0c48('0x23')],'from':_0x3f9cff[_0x0c48('0x23')],'statusCallback':_0x3f9cff[_0x0c48('0x24')]+'/api/sms/messages/'+_0x2d098a['id']+_0x0c48('0x25')+_0x3f9cff[_0x0c48('0x26')]})[_0x0c48('0x1a')](function(_0x29136e){if(_0x29136e[_0x0c48('0x27')]){return _0x156455[_0x0c48('0x1b')]({'messageId':_0x29136e[_0x0c48('0x27')]});}})[_0x0c48('0x28')](function(_0x1d4078){logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0c48('0x1f'),util[_0x0c48('0x2a')](_0x1d4078,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0c48('0x1f'),_0x0c48('0x2b'));}break;case _0x0c48('0x2c'):var _0x544f59='https://api.skebby.it/API/v1.0/REST/';if(_0x3f9cff[_0x0c48('0x2d')]&&_0x3f9cff[_0x0c48('0x2e')]){var _0x4f226b={'recipient':[_0x2d098a[_0x0c48('0x23')]],'message':_0x2d098a[_0x0c48('0xf')],'message_type':_0x3f9cff[_0x0c48('0x2f')]};if(_0x3f9cff[_0x0c48('0x2f')]&&_0x3f9cff['smsMethod']!=='SI'){_0x4f226b[_0x0c48('0x30')]=_0x3f9cff[_0x0c48('0x23')];}var _0x2c6ccd={'url':_0x544f59+'login?username='+_0x3f9cff[_0x0c48('0x2d')]+_0x0c48('0x31')+_0x3f9cff['password'],'method':_0x0c48('0x32')};rp(_0x2c6ccd)['then'](function(_0x128751){var _0x4fc92e=_0x128751[_0x0c48('0x33')](';');var _0x51d9c6={'user_key':_0x4fc92e[0x0],'session_key':_0x4fc92e[0x1]};_0x2c6ccd={'url':_0x544f59+'sms','method':_0x0c48('0x34'),'headers':{'user_key':_0x51d9c6[_0x0c48('0x35')],'Session_key':_0x51d9c6[_0x0c48('0x36')]},'json':!![],'body':_0x4f226b};return rp(_0x2c6ccd);})[_0x0c48('0x1a')](function(_0x51d502){if(_0x51d502['total_sent']>=0x1){var _0x9c30e={'messageId':_0x51d502[_0x0c48('0x37')]};if(_0x3f9cff[_0x0c48('0x2f')]!=='GP'||!_0x3f9cff[_0x0c48('0x38')]){_0x9c30e[_0x0c48('0x39')]=!![];}return _0x156455[_0x0c48('0x1b')](_0x9c30e);}else{return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'skebby',util[_0x0c48('0x2a')](_0x51d502,{'showHidden':![],'depth':null}));}})[_0x0c48('0x28')](function(_0x5852f5){return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x2c'),util[_0x0c48('0x2a')](_0x5852f5,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0c48('0x3c'):if(_0x3f9cff[_0x0c48('0x21')]){var _0x4c1656={'recipient':_0x2d098a['phone'],'message':_0x2d098a[_0x0c48('0xf')],'sender':_0x3f9cff[_0x0c48('0x3d')]||_0x3f9cff['phone'],'authorization':_0x3f9cff[_0x0c48('0x21')]};var _0x5c9ebb={'method':_0x0c48('0x34'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4c1656,'json':!![]};rp(_0x5c9ebb)['then'](function(_0x11a097){var _0x3f4ca2={'messageId':_0x11a097[_0x0c48('0x3e')]};if(!_0x3f9cff['deliveryReport']){_0x3f4ca2['read']=!![];}return _0x156455[_0x0c48('0x1b')](_0x3f4ca2);})['catch'](function(_0x1541c1){logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),_0x0c48('0x3c'),util[_0x0c48('0x2a')](_0x1541c1,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x3c'),_0x0c48('0x3f'));}break;case'clicksend':if(_0x3f9cff[_0x0c48('0x2d')]&&_0x3f9cff[_0x0c48('0x2e')]){var _0x4c1656={'messages':[{'source':_0x0c48('0x40'),'to':_0x2d098a['phone'],'body':_0x2d098a[_0x0c48('0xf')],'from':_0x3f9cff[_0x0c48('0x3d')]||_0x3f9cff['phone']}]};var _0x18afce=util['format'](_0x0c48('0x41'),_0x3f9cff['username'],_0x3f9cff[_0x0c48('0x2e')]);var _0x5c9ebb={'method':_0x0c48('0x34'),'uri':_0x0c48('0x42'),'body':_0x4c1656,'headers':{'Authorization':util[_0x0c48('0x43')]('Basic\x20%s',new Buffer(_0x18afce)['toString'](_0x0c48('0x44')))},'json':!![]};rp(_0x5c9ebb)['then'](function(_0x5ab03e){if(_0x5ab03e[_0x0c48('0x45')]>=0xc8&&_0x5ab03e['http_code']<=0xce){if(_0x5ab03e[_0x0c48('0x46')]&&_0x5ab03e[_0x0c48('0x46')][_0x0c48('0x47')]>0x0){var _0x143a16=_[_0x0c48('0x48')](_0x5ab03e[_0x0c48('0x46')][_0x0c48('0x22')]);var _0x2a1da1={'messageId':_0x143a16[_0x0c48('0x49')]};if(!_0x3f9cff['deliveryReport']){_0x2a1da1[_0x0c48('0x39')]=!![];}return _0x156455['update'](_0x2a1da1);}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),'afterCreate',_0x0c48('0x4a'),util[_0x0c48('0x2a')](_0x5ab03e,{'showHidden':![],'depth':null}));}}else{logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),_0x0c48('0x4a'),util[_0x0c48('0x2a')](_0x5ab03e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3b4c96){logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),_0x0c48('0x4a'),util['inspect'](_0x3b4c96,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x4a'),_0x0c48('0x4b'));}break;case _0x0c48('0x4c'):if(_0x3f9cff[_0x0c48('0x4d')]&&_0x3f9cff[_0x0c48('0x21')]){var _0x4c1656={'dst':_0x2d098a['phone'],'text':_0x2d098a[_0x0c48('0xf')],'src':_0x3f9cff[_0x0c48('0x3d')]||_0x3f9cff['phone'],'url':_0x3f9cff[_0x0c48('0x24')]+_0x0c48('0x4e')+_0x2d098a['id']+_0x0c48('0x25')+_0x3f9cff[_0x0c48('0x26')]};var _0x18afce=util['format'](_0x0c48('0x41'),_0x3f9cff[_0x0c48('0x4d')],_0x3f9cff[_0x0c48('0x21')]);var _0x5c9ebb={'method':'POST','uri':util[_0x0c48('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3f9cff[_0x0c48('0x4d')]),'body':_0x4c1656,'headers':{'Authorization':util[_0x0c48('0x43')]('Basic\x20%s',new Buffer(_0x18afce)['toString'](_0x0c48('0x44')))},'json':!![]};rp(_0x5c9ebb)['then'](function(_0x3f056d){var _0x25106e={'messageId':_0x3f056d[_0x0c48('0x4f')][0x0]};return _0x156455[_0x0c48('0x1b')](_0x25106e);})[_0x0c48('0x28')](function(_0x1bbfbe){logger['error'](_0x0c48('0x3a'),'afterCreate','plivo',util[_0x0c48('0x2a')](_0x1bbfbe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0c48('0x3a'),'afterCreate',_0x0c48('0x4c'),_0x0c48('0x50'));}break;case _0x0c48('0x51'):if(_0x3f9cff[_0x0c48('0x2d')]&&_0x3f9cff[_0x0c48('0x2e')]){if(_0x3f9cff[_0x0c48('0x52')]){var _0x17e75a={'method':_0x0c48('0x34'),'uri':_0x3f9cff[_0x0c48('0x52')]+_0x0c48('0x53'),'body':{'username':_0x3f9cff['username'],'password':_0x3f9cff[_0x0c48('0x2e')]},'json':!![]};return rp(_0x17e75a)[_0x0c48('0x1a')](function(_0x3b112f){var _0x1c1f1f={'method':_0x0c48('0x34'),'uri':_0x3f9cff['baseUrl']+_0x0c48('0x54'),'body':{'messages':[{'from':_0x3f9cff[_0x0c48('0x23')],'destinations':[{'to':_0x2d098a[_0x0c48('0x23')]}],'text':_0x2d098a[_0x0c48('0xf')],'notifyUrl':_0x3f9cff[_0x0c48('0x24')]+_0x0c48('0x4e')+_0x2d098a['id']+_0x0c48('0x25')+_0x3f9cff[_0x0c48('0x26')],'notifyContentType':'application/json','callbackData':_0x3f9cff[_0x0c48('0x23')]+';'+_0x2d098a[_0x0c48('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3b112f['token']},'json':!![]};return rp(_0x1c1f1f)[_0x0c48('0x1a')](function(_0x2ab240){if(_0x2ab240['messages']){var _0x3f5385={'messageId':_0x2ab240[_0x0c48('0x22')][0x0][_0x0c48('0xe')]};if(!_0x3f9cff['deliveryReport']){_0x3f5385[_0x0c48('0x39')]=!![];}return _0x156455['update'](_0x3f5385);}else{return logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),'infobip',util[_0x0c48('0x2a')](_0x2ab240,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5d24e7){return logger[_0x0c48('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),_0x0c48('0x51'),util['inspect'](_0x5d24e7,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'infobip',_0x0c48('0x55'));}}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'infobip',_0x0c48('0x4b'));}break;case _0x0c48('0x56'):var _0x1507e=require(_0x0c48('0x57'));if(_0x3f9cff[_0x0c48('0x58')]){var _0x5bf231={};_0x5bf231[_0x0c48('0x59')]=_0x3f9cff['username'];_0x5bf231[_0x0c48('0x23')]=_0x2d098a[_0x0c48('0x23')];_0x5bf231[_0x0c48('0x30')]=_0x3f9cff[_0x0c48('0x23')];_0x5bf231['text']=_0x2d098a[_0x0c48('0xf')];_0x5bf231[_0x0c48('0x5a')]=+new Date();var _0x14d14e='';var _0x1ea6db='';var _0x500f1b=Object[_0x0c48('0x5b')](_0x5bf231);_0x500f1b['sort']();for(var _0x1847c4=0x0;_0x1847c4<_0x500f1b[_0x0c48('0x5c')];_0x1847c4++){if(_0x14d14e!=''){_0x14d14e+='&';}_0x14d14e+=_0x500f1b[_0x1847c4]+'='+encodeURIComponent(_0x5bf231[_0x500f1b[_0x1847c4]]);_0x1ea6db+=_0x5bf231[_0x500f1b[_0x1847c4]];}_0x1ea6db+=_0x3f9cff[_0x0c48('0x58')];_0x1ea6db=_0x1507e[_0x0c48('0x5d')]('md5')[_0x0c48('0x1b')](_0x1ea6db)[_0x0c48('0x5e')](_0x0c48('0x5f'));if(_0x14d14e!==''){_0x14d14e+='&';}_0x14d14e+='signature='+_0x1ea6db;var _0x2c6ccd={'method':_0x0c48('0x32'),'uri':_0x3f9cff[_0x0c48('0x52')]+'/external/get/send.php?'+_0x14d14e,'json':!![]};return rp(_0x2c6ccd)[_0x0c48('0x1a')](function(_0x53e0bd){var _0x24b66b=Object[_0x0c48('0x5b')](_0x53e0bd);if(_0x53e0bd[_0x24b66b[0x0]][_0x0c48('0x29')]&&parseInt(_0x53e0bd[_0x24b66b[0x0]][_0x0c48('0x29')])===0x0){var _0x586bf9={'messageId':_0x53e0bd[_0x24b66b[0x0]][_0x0c48('0x60')]};if(!_0x3f9cff[_0x0c48('0x38')]){_0x586bf9['read']=!![];}return _0x156455['update'](_0x586bf9);}else{return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x56'),util[_0x0c48('0x2a')](_0x53e0bd[_0x0c48('0x29')],{'showHidden':![],'depth':null}));}})[_0x0c48('0x28')](function(_0x2731e0){return logger[_0x0c48('0x29')](_0x0c48('0x3a'),'afterCreate',_0x0c48('0x56'),util[_0x0c48('0x2a')](_0x2731e0,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0x0c48('0x61'):if(_0x3f9cff['apiKey']){var _0x3c1556={'method':_0x0c48('0x34'),'uri':_0x0c48('0x62'),'headers':{'Authorization':_0x3f9cff[_0x0c48('0x58')]},'body':{'content':_0x2d098a[_0x0c48('0xf')],'to':[_0x2d098a[_0x0c48('0x23')]],'from':_0x3f9cff[_0x0c48('0x23')],'binary':![],'clientMessageId':_0x0c48('0x63'),'charset':_0x0c48('0x64')},'json':!![]};rp(_0x3c1556)[_0x0c48('0x1a')](function(_0x27b31e){if(!_0x27b31e[_0x0c48('0x29')]){var _0x5737d1={'messageId':_0x27b31e['messages'][0x0][_0x0c48('0x65')]};if(!_0x3f9cff[_0x0c48('0x38')]){_0x5737d1['read']=!![];}return _0x156455[_0x0c48('0x1b')](_0x5737d1);}else{return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x61'),util[_0x0c48('0x2a')](_0x27b31e['error'],{'showHidden':![],'depth':null}));}})[_0x0c48('0x28')](function(_0x3d3f25){return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'clickatell',util['inspect'](_0x3d3f25,{'showHidden':![],'depth':null}));});}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),'afterCreate',_0x0c48('0x61'),_0x0c48('0x66'));}break;case'bandwidth':if(_0x3f9cff[_0x0c48('0x2d')]&&_0x3f9cff[_0x0c48('0x2e')]){var _0x18afce=util[_0x0c48('0x43')](_0x0c48('0x41'),_0x3f9cff[_0x0c48('0x2d')],_0x3f9cff[_0x0c48('0x2e')]);var _0x5c9ebb={'method':_0x0c48('0x34'),'uri':_0x0c48('0x67')+_0x3f9cff['accountId']+'/messages','body':{'to':[_0x2d098a[_0x0c48('0x23')]],'text':_0x2d098a[_0x0c48('0xf')],'from':_0x3f9cff[_0x0c48('0x23')],'applicationId':_0x3f9cff[_0x0c48('0x68')]},'headers':{'Authorization':util['format'](_0x0c48('0x69'),new Buffer(_0x18afce)[_0x0c48('0x6a')](_0x0c48('0x44')))},'json':!![]};rp(_0x5c9ebb)['then'](function(_0x29660a){if(_0x29660a['id']){var _0xb8eb07={'messageId':_0x29660a['id']};return _0x156455['update'](_0xb8eb07);}else{logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),_0x0c48('0x6b'),util[_0x0c48('0x2a')](_0x29660a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4f0051){logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'bandwidth',util[_0x0c48('0x2a')](_0x4f0051,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0c48('0x6b'),_0x0c48('0x4b'));}break;case _0x0c48('0x6c'):if(_0x3f9cff[_0x0c48('0x58')]){var _0x355774={};var _0x2c6ccd={'method':_0x0c48('0x34'),'uri':_0x0c48('0x6d'),'headers':{'Authorization':'Bearer\x20'+_0x3f9cff['apiKey'],'Content-Type':_0x0c48('0x6e')},'body':{'from':_0x3f9cff[_0x0c48('0x23')],'to':_0x2d098a[_0x0c48('0x23')],'text':_0x2d098a[_0x0c48('0xf')]},'json':!![]};return rp(_0x2c6ccd)['then'](function(_0x90d18d){if(_0x90d18d[_0x0c48('0x6f')]==0xca){_0x355774['message']=_0x90d18d;var _0x534a8d={'method':_0x0c48('0x34'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0c48('0x70')+_0x3f9cff['apiKey'],'Content-Type':_0x0c48('0x6e')},'body':{'refid':_0x355774['message'][_0x0c48('0x71')]},'json':!![]};return rp(_0x534a8d)[_0x0c48('0x1a')](function(_0x17d521){_0x355774[_0x0c48('0x72')]=_0x17d521;var _0x59f8ba={'messageId':_0x355774[_0x0c48('0x73')]['refid'],'read':!![]};return _0x156455['update'](_0x59f8ba);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c48('0x3b'),_0x0c48('0x6c'),util[_0x0c48('0x2a')](_0x90d18d,{'showHidden':![],'depth':null}));}})[_0x0c48('0x28')](function(_0x5d78f3){return logger[_0x0c48('0x29')](_0x0c48('0x3a'),'afterCreate',_0x0c48('0x6c'),util[_0x0c48('0x2a')](_0x5d78f3,{'showHidden':![],'depth':null}));});}else{return logger[_0x0c48('0x29')](_0x0c48('0x3a'),_0x0c48('0x3b'),'intelepeer',_0x0c48('0x74'));}break;}}})[_0x0c48('0x75')](function(){_0x209c6f();});}else{_0x209c6f();}}},'charset':'utf8mb4','collate':_0x0c48('0x76')});}; \ No newline at end of file +var _0xde38=['requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','authId','Basic\x20%s','message_uuid','infobip','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4','request-promise','path','../../config/environment','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','direction','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','/api/sms/messages/','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','catch','connectel','senderString'];(function(_0x6455d7,_0x1259a0){var _0x5c3920=function(_0x38ff98){while(--_0x38ff98){_0x6455d7['push'](_0x6455d7['shift']());}};_0x5c3920(++_0x1259a0);}(_0xde38,0xa9));var _0x8de3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde38[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8de3('0x0'));var fs=require('fs');var path=require(_0x8de3('0x1'));var rimraf=require('rimraf');var config=require(_0x8de3('0x2'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x6cdeae,_0x520ce8){return _0x6cdeae[_0x8de3('0x3')](_0x8de3('0x4'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8de3('0x5')]},{'name':_0x8de3('0x6'),'fields':[_0x8de3('0x7')],'type':_0x8de3('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b2b83,_0x4a076d,_0x4c023f){var _0x2cd37d=_0x6cdeae[_0x8de3('0x9')];var _0x27e420=_0x3b2b83['get']({'plain':!![]});if(_0x27e420['direction'][_0x8de3('0xa')]()==='in'||_0x27e420['direction'][_0x8de3('0xa')]()===_0x8de3('0xb')&&!_0x27e420[_0x8de3('0xc')]&&!_[_0x8de3('0xd')](_0x27e420['UserId'])&&!_[_0x8de3('0xd')](_0x27e420[_0x8de3('0xe')])){_0x2cd37d[_0x8de3('0xf')][_0x8de3('0x10')]({'where':{'id':_0x27e420[_0x8de3('0xe')]}})[_0x8de3('0x11')](function(_0x426af6){if(_0x426af6){_0x426af6[_0x8de3('0x12')]({'lastMsgAt':_0x27e420[_0x8de3('0x13')],'lastMsgDirection':_0x27e420[_0x8de3('0x14')][_0x8de3('0xa')]()});}})['catch'](function(_0x1e11fc){console['error'](_0x1e11fc);});}if(_0x27e420[_0x8de3('0x14')]===_0x8de3('0xb')&&!_0x27e420[_0x8de3('0xc')]){var _0x563489;_0x2cd37d[_0x8de3('0x15')]['find']({'where':{'id':_0x27e420[_0x8de3('0x16')]},'raw':!![]})[_0x8de3('0x11')](function(_0x5acc02){_0x563489=_0x5acc02;if(_0x563489&&_0x563489[_0x8de3('0x17')]){switch(_0x563489[_0x8de3('0x17')]){case _0x8de3('0x18'):var _0x1abd2f=require(_0x8de3('0x18'));if(_0x563489[_0x8de3('0x19')]&&_0x563489['authToken']&&_0x563489['phone']){var _0x34fd12=new _0x1abd2f(_0x563489[_0x8de3('0x19')],_0x563489[_0x8de3('0x1a')]);_0x34fd12[_0x8de3('0x1b')][_0x8de3('0x1c')]({'body':_0x27e420[_0x8de3('0x7')],'to':_0x27e420['phone'],'from':_0x563489[_0x8de3('0x1d')],'statusCallback':_0x563489['remote']+_0x8de3('0x1e')+_0x27e420['id']+'/status?token='+_0x563489[_0x8de3('0x1f')]})[_0x8de3('0x11')](function(_0x17f3ae){if(_0x17f3ae[_0x8de3('0x20')]){return _0x3b2b83[_0x8de3('0x12')]({'messageId':_0x17f3ae[_0x8de3('0x20')]});}})['catch'](function(_0x5513d6){logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x18'),util[_0x8de3('0x24')](_0x5513d6,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x18'),_0x8de3('0x25'));}break;case _0x8de3('0x26'):var _0x2be5b1=_0x8de3('0x27');if(_0x563489['username']&&_0x563489[_0x8de3('0x28')]){var _0x44a913={'recipient':[_0x27e420['phone']],'message':_0x27e420[_0x8de3('0x7')],'message_type':_0x563489[_0x8de3('0x29')]};if(_0x563489[_0x8de3('0x29')]&&_0x563489[_0x8de3('0x29')]!=='SI'){_0x44a913[_0x8de3('0x2a')]=_0x563489[_0x8de3('0x1d')];}var _0x5290aa={'url':_0x2be5b1+_0x8de3('0x2b')+_0x563489[_0x8de3('0x2c')]+_0x8de3('0x2d')+_0x563489[_0x8de3('0x28')],'method':_0x8de3('0x2e')};rp(_0x5290aa)[_0x8de3('0x11')](function(_0x48a108){var _0x3aca8f=_0x48a108[_0x8de3('0x2f')](';');var _0x2e1a4b={'user_key':_0x3aca8f[0x0],'session_key':_0x3aca8f[0x1]};_0x5290aa={'url':_0x2be5b1+_0x8de3('0x30'),'method':_0x8de3('0x31'),'headers':{'user_key':_0x2e1a4b[_0x8de3('0x32')],'Session_key':_0x2e1a4b[_0x8de3('0x33')]},'json':!![],'body':_0x44a913};return rp(_0x5290aa);})['then'](function(_0x23d23a){if(_0x23d23a['total_sent']>=0x1){var _0x15e200={'messageId':_0x23d23a[_0x8de3('0x34')]};if(_0x563489['smsMethod']!=='GP'||!_0x563489[_0x8de3('0x35')]){_0x15e200['read']=!![];}return _0x3b2b83['update'](_0x15e200);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x26'),util[_0x8de3('0x24')](_0x23d23a,{'showHidden':![],'depth':null}));}})[_0x8de3('0x36')](function(_0x1b92f9){return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'skebby',util[_0x8de3('0x24')](_0x1b92f9,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x26'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8de3('0x37'):if(_0x563489[_0x8de3('0x1a')]){var _0x2522a2={'recipient':_0x27e420[_0x8de3('0x1d')],'message':_0x27e420['body'],'sender':_0x563489[_0x8de3('0x38')]||_0x563489[_0x8de3('0x1d')],'authorization':_0x563489[_0x8de3('0x1a')]};var _0x4a076d={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2522a2,'json':!![]};rp(_0x4a076d)[_0x8de3('0x11')](function(_0x593e5e){var _0x461e3d={'messageId':_0x593e5e[_0x8de3('0x39')]};if(!_0x563489[_0x8de3('0x35')]){_0x461e3d[_0x8de3('0x3a')]=!![];}return _0x3b2b83[_0x8de3('0x12')](_0x461e3d);})[_0x8de3('0x36')](function(_0x25974b){logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x37'),util[_0x8de3('0x24')](_0x25974b,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),'afterCreate',_0x8de3('0x37'),_0x8de3('0x3b'));}break;case _0x8de3('0x3c'):if(_0x563489[_0x8de3('0x2c')]&&_0x563489[_0x8de3('0x28')]){var _0x2522a2={'messages':[{'source':_0x8de3('0x3d'),'to':_0x27e420[_0x8de3('0x1d')],'body':_0x27e420[_0x8de3('0x7')],'from':_0x563489[_0x8de3('0x38')]||_0x563489[_0x8de3('0x1d')]}]};var _0x22f1da=util[_0x8de3('0x3e')](_0x8de3('0x3f'),_0x563489[_0x8de3('0x2c')],_0x563489['password']);var _0x4a076d={'method':_0x8de3('0x31'),'uri':_0x8de3('0x40'),'body':_0x2522a2,'headers':{'Authorization':util[_0x8de3('0x3e')]('Basic\x20%s',new Buffer(_0x22f1da)[_0x8de3('0x41')](_0x8de3('0x42')))},'json':!![]};rp(_0x4a076d)['then'](function(_0x292cb1){if(_0x292cb1[_0x8de3('0x43')]>=0xc8&&_0x292cb1[_0x8de3('0x43')]<=0xce){if(_0x292cb1[_0x8de3('0x44')]&&_0x292cb1[_0x8de3('0x44')][_0x8de3('0x45')]>0x0){var _0x4b0f72=_['head'](_0x292cb1['data'][_0x8de3('0x1b')]);var _0xf328b0={'messageId':_0x4b0f72['message_id']};if(!_0x563489['deliveryReport']){_0xf328b0['read']=!![];}return _0x3b2b83[_0x8de3('0x12')](_0xf328b0);}else{logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),'clickSend',util['inspect'](_0x292cb1,{'showHidden':![],'depth':null}));}}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),'afterCreate',_0x8de3('0x46'),util[_0x8de3('0x24')](_0x292cb1,{'showHidden':![],'depth':null}));}})[_0x8de3('0x36')](function(_0x4bf6c3){logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x46'),util['inspect'](_0x4bf6c3,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'clickSend',_0x8de3('0x47'));}break;case _0x8de3('0x48'):if(_0x563489['authId']&&_0x563489[_0x8de3('0x1a')]){var _0x2522a2={'dst':_0x27e420[_0x8de3('0x1d')],'text':_0x27e420[_0x8de3('0x7')],'src':_0x563489[_0x8de3('0x38')]||_0x563489['phone'],'url':_0x563489[_0x8de3('0x49')]+_0x8de3('0x1e')+_0x27e420['id']+_0x8de3('0x4a')+_0x563489['token']};var _0x22f1da=util[_0x8de3('0x3e')](_0x8de3('0x3f'),_0x563489['authId'],_0x563489[_0x8de3('0x1a')]);var _0x4a076d={'method':'POST','uri':util[_0x8de3('0x3e')](_0x8de3('0x4b'),_0x563489[_0x8de3('0x4c')]),'body':_0x2522a2,'headers':{'Authorization':util[_0x8de3('0x3e')](_0x8de3('0x4d'),new Buffer(_0x22f1da)['toString'](_0x8de3('0x42')))},'json':!![]};rp(_0x4a076d)[_0x8de3('0x11')](function(_0x13ac51){var _0xe65146={'messageId':_0x13ac51[_0x8de3('0x4e')][0x0]};return _0x3b2b83[_0x8de3('0x12')](_0xe65146);})[_0x8de3('0x36')](function(_0x10c9a1){logger[_0x8de3('0x21')](_0x8de3('0x22'),'afterCreate',_0x8de3('0x48'),util[_0x8de3('0x24')](_0x10c9a1,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x8de3('0x4f'):if(_0x563489[_0x8de3('0x2c')]&&_0x563489[_0x8de3('0x28')]){if(_0x563489[_0x8de3('0x50')]){var _0x31de94={'method':_0x8de3('0x31'),'uri':_0x563489[_0x8de3('0x50')]+'/auth/1/session','body':{'username':_0x563489['username'],'password':_0x563489[_0x8de3('0x28')]},'json':!![]};return rp(_0x31de94)[_0x8de3('0x11')](function(_0x1a6a6d){var _0x230557={'method':_0x8de3('0x31'),'uri':_0x563489['baseUrl']+_0x8de3('0x51'),'body':{'messages':[{'from':_0x563489['phone'],'destinations':[{'to':_0x27e420[_0x8de3('0x1d')]}],'text':_0x27e420['body'],'notifyUrl':_0x563489[_0x8de3('0x49')]+'/api/sms/messages/'+_0x27e420['id']+_0x8de3('0x4a')+_0x563489['token'],'notifyContentType':_0x8de3('0x52'),'callbackData':_0x563489[_0x8de3('0x1d')]+';'+_0x27e420[_0x8de3('0x7')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x1a6a6d[_0x8de3('0x1f')]},'json':!![]};return rp(_0x230557)['then'](function(_0xf98d0e){if(_0xf98d0e[_0x8de3('0x1b')]){var _0x1e71b3={'messageId':_0xf98d0e[_0x8de3('0x1b')][0x0]['messageId']};if(!_0x563489[_0x8de3('0x35')]){_0x1e71b3['read']=!![];}return _0x3b2b83[_0x8de3('0x12')](_0x1e71b3);}else{return logger['error'](_0x8de3('0x22'),'afterCreate',_0x8de3('0x4f'),util[_0x8de3('0x24')](_0xf98d0e,{'showHidden':![],'depth':null}));}});})[_0x8de3('0x36')](function(_0x532445){return logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x4f'),util[_0x8de3('0x24')](_0x532445,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x4f'),_0x8de3('0x53'));}}else{logger[_0x8de3('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),_0x8de3('0x4f'),_0x8de3('0x47'));}break;case _0x8de3('0x54'):var _0x14d331=require(_0x8de3('0x55'));if(_0x563489[_0x8de3('0x56')]){var _0x596d2f={};_0x596d2f['login']=_0x563489[_0x8de3('0x2c')];_0x596d2f[_0x8de3('0x1d')]=_0x27e420['phone'];_0x596d2f[_0x8de3('0x2a')]=_0x563489[_0x8de3('0x1d')];_0x596d2f[_0x8de3('0x57')]=_0x27e420[_0x8de3('0x7')];_0x596d2f[_0x8de3('0x58')]=+new Date();var _0x3cec02='';var _0x23e4fb='';var _0x574d4f=Object[_0x8de3('0x59')](_0x596d2f);_0x574d4f[_0x8de3('0x5a')]();for(var _0x850832=0x0;_0x850832<_0x574d4f[_0x8de3('0x5b')];_0x850832++){if(_0x3cec02!=''){_0x3cec02+='&';}_0x3cec02+=_0x574d4f[_0x850832]+'='+encodeURIComponent(_0x596d2f[_0x574d4f[_0x850832]]);_0x23e4fb+=_0x596d2f[_0x574d4f[_0x850832]];}_0x23e4fb+=_0x563489[_0x8de3('0x56')];_0x23e4fb=_0x14d331[_0x8de3('0x5c')]('md5')[_0x8de3('0x12')](_0x23e4fb)['digest']('hex');if(_0x3cec02!==''){_0x3cec02+='&';}_0x3cec02+='signature='+_0x23e4fb;var _0x5290aa={'method':_0x8de3('0x2e'),'uri':_0x563489[_0x8de3('0x50')]+_0x8de3('0x5d')+_0x3cec02,'json':!![]};return rp(_0x5290aa)[_0x8de3('0x11')](function(_0x84ee2e){var _0x128725=Object[_0x8de3('0x59')](_0x84ee2e);if(_0x84ee2e[_0x128725[0x0]][_0x8de3('0x21')]&&parseInt(_0x84ee2e[_0x128725[0x0]][_0x8de3('0x21')])===0x0){var _0x2b9d88={'messageId':_0x84ee2e[_0x128725[0x0]][_0x8de3('0x5e')]};if(!_0x563489['deliveryReport']){_0x2b9d88[_0x8de3('0x3a')]=!![];}return _0x3b2b83[_0x8de3('0x12')](_0x2b9d88);}else{return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x54'),util[_0x8de3('0x24')](_0x84ee2e[_0x8de3('0x21')],{'showHidden':![],'depth':null}));}})[_0x8de3('0x36')](function(_0x47bbde){return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'csc',util[_0x8de3('0x24')](_0x47bbde,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'csc',_0x8de3('0x5f'));}break;case _0x8de3('0x60'):if(_0x563489[_0x8de3('0x56')]){var _0x526b24={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x563489[_0x8de3('0x56')]},'body':{'content':_0x27e420[_0x8de3('0x7')],'to':[_0x27e420[_0x8de3('0x1d')]],'from':_0x563489[_0x8de3('0x1d')],'binary':![],'clientMessageId':_0x8de3('0x61'),'charset':_0x8de3('0x62')},'json':!![]};rp(_0x526b24)[_0x8de3('0x11')](function(_0x5a4faa){if(!_0x5a4faa['error']){var _0x1593ad={'messageId':_0x5a4faa['messages'][0x0][_0x8de3('0x63')]};if(!_0x563489[_0x8de3('0x35')]){_0x1593ad[_0x8de3('0x3a')]=!![];}return _0x3b2b83[_0x8de3('0x12')](_0x1593ad);}else{return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x60'),util[_0x8de3('0x24')](_0x5a4faa[_0x8de3('0x21')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1d5eb2){return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'clickatell',util[_0x8de3('0x24')](_0x1d5eb2,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'clickatell',_0x8de3('0x5f'));}break;case _0x8de3('0x64'):if(_0x563489[_0x8de3('0x2c')]&&_0x563489[_0x8de3('0x28')]){var _0x22f1da=util[_0x8de3('0x3e')](_0x8de3('0x3f'),_0x563489[_0x8de3('0x2c')],_0x563489[_0x8de3('0x28')]);var _0x4a076d={'method':'POST','uri':_0x8de3('0x65')+_0x563489[_0x8de3('0x66')]+_0x8de3('0x67'),'body':{'to':[_0x27e420[_0x8de3('0x1d')]],'text':_0x27e420['body'],'from':_0x563489[_0x8de3('0x1d')],'applicationId':_0x563489['applicationId']},'headers':{'Authorization':util[_0x8de3('0x3e')](_0x8de3('0x4d'),new Buffer(_0x22f1da)[_0x8de3('0x41')](_0x8de3('0x42')))},'json':!![]};rp(_0x4a076d)[_0x8de3('0x11')](function(_0x3555f8){if(_0x3555f8['id']){var _0x4d119b={'messageId':_0x3555f8['id']};return _0x3b2b83[_0x8de3('0x12')](_0x4d119b);}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x64'),util[_0x8de3('0x24')](_0x3555f8,{'showHidden':![],'depth':null}));}})[_0x8de3('0x36')](function(_0x5015de){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8de3('0x23'),'bandwidth',util['inspect'](_0x5015de,{'showHidden':![],'depth':null}));});}else{logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x64'),_0x8de3('0x47'));}break;case'intelepeer':if(_0x563489['apiKey']){var _0x4465d2={};var _0x5290aa={'method':'POST','uri':_0x8de3('0x68'),'headers':{'Authorization':_0x8de3('0x69')+_0x563489[_0x8de3('0x56')],'Content-Type':_0x8de3('0x52')},'body':{'from':_0x563489[_0x8de3('0x1d')],'to':_0x27e420[_0x8de3('0x1d')],'text':_0x27e420[_0x8de3('0x7')]},'json':!![]};return rp(_0x5290aa)[_0x8de3('0x11')](function(_0x4aafa8){if(_0x4aafa8['code']==0xca){_0x4465d2[_0x8de3('0x6a')]=_0x4aafa8;var _0x1ea85f={'method':_0x8de3('0x31'),'uri':_0x8de3('0x6b'),'headers':{'Authorization':_0x8de3('0x69')+_0x563489[_0x8de3('0x56')],'Content-Type':_0x8de3('0x52')},'body':{'refid':_0x4465d2[_0x8de3('0x6a')][_0x8de3('0x6c')]},'json':!![]};return rp(_0x1ea85f)[_0x8de3('0x11')](function(_0x4064e2){_0x4465d2[_0x8de3('0x6d')]=_0x4064e2;var _0x14a0f5={'messageId':_0x4465d2[_0x8de3('0x6a')][_0x8de3('0x6c')],'read':!![]};return _0x3b2b83[_0x8de3('0x12')](_0x14a0f5);});}else{return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),'intelepeer',util['inspect'](_0x4aafa8,{'showHidden':![],'depth':null}));}})[_0x8de3('0x36')](function(_0x56e15f){return logger[_0x8de3('0x21')](_0x8de3('0x22'),_0x8de3('0x23'),_0x8de3('0x6e'),util[_0x8de3('0x24')](_0x56e15f,{'showHidden':![],'depth':null}));});}else{return logger[_0x8de3('0x21')](_0x8de3('0x22'),'afterCreate',_0x8de3('0x6e'),'Token\x20not\x20received');}break;}}})[_0x8de3('0x6f')](function(){_0x4c023f();});}else{_0x4c023f();}}},'charset':_0x8de3('0x70'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fc90e60..fb882c9 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 _0xf340=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsMessage','SmsMessage','body','options','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register'];(function(_0x5e4607,_0x3c8f91){var _0x35567e=function(_0x2d698d){while(--_0x2d698d){_0x5e4607['push'](_0x5e4607['shift']());}};_0x35567e(++_0x3c8f91);}(_0xf340,0x177));var _0x0f34=function(_0x254f01,_0x1e528a){_0x254f01=_0x254f01-0x0;var _0x11a58f=_0xf340[_0x254f01];return _0x11a58f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f34('0x0'));var fs=require('fs');var Redis=require(_0x0f34('0x1'));var db=require(_0x0f34('0x2'))['db'];var utils=require(_0x0f34('0x3'));var logger=require(_0x0f34('0x4'))('rpc');var config=require(_0x0f34('0x5'));var jayson=require(_0x0f34('0x6'));var client=jayson[_0x0f34('0x7')][_0x0f34('0x8')]({'port':0x232a});config[_0x0f34('0x9')]=_[_0x0f34('0xa')](config[_0x0f34('0x9')],{'host':_0x0f34('0xb'),'port':0x18eb});var socket=require(_0x0f34('0xc'))(new Redis(config['redis']));require(_0x0f34('0xd'))[_0x0f34('0xe')](socket);function respondWithRpcPromise(_0x311503,_0x37feab,_0x36c922){return new BPromise(function(_0x3afaa6,_0x209afb){return client[_0x0f34('0xf')](_0x311503,_0x36c922)[_0x0f34('0x10')](function(_0x32cf1b){logger[_0x0f34('0x11')](_0x0f34('0x12'),_0x37feab,_0x0f34('0x13'));logger[_0x0f34('0x14')](_0x0f34('0x15'),_0x37feab,_0x0f34('0x13'),JSON[_0x0f34('0x16')](_0x32cf1b));if(_0x32cf1b[_0x0f34('0x17')]){if(_0x32cf1b[_0x0f34('0x17')]['code']===0x1f4){logger[_0x0f34('0x17')]('SmsMessage,\x20%s,\x20%s',_0x37feab,_0x32cf1b['error'][_0x0f34('0x18')]);return _0x209afb(_0x32cf1b[_0x0f34('0x17')]['message']);}logger['error'](_0x0f34('0x12'),_0x37feab,_0x32cf1b['error'][_0x0f34('0x18')]);return _0x3afaa6(_0x32cf1b['error'][_0x0f34('0x18')]);}else{logger[_0x0f34('0x11')](_0x0f34('0x12'),_0x37feab,_0x0f34('0x13'));_0x3afaa6(_0x32cf1b['result'][_0x0f34('0x18')]);}})[_0x0f34('0x19')](function(_0x2bbf00){logger['error']('SmsMessage,\x20%s,\x20%s',_0x37feab,_0x2bbf00);_0x209afb(_0x2bbf00);});});}exports[_0x0f34('0x1a')]=function(_0x5519e6){var _0x2e5d09=this;return new Promise(function(_0x3a2d2d,_0x420262){return db[_0x0f34('0x1b')]['create'](_0x5519e6[_0x0f34('0x1c')],{'raw':_0x5519e6[_0x0f34('0x1d')]?_0x5519e6[_0x0f34('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x0f34('0x10')](function(_0x5152df){logger[_0x0f34('0x11')](_0x0f34('0x1a'),_0x5519e6);logger['debug'](_0x0f34('0x1a'),_0x5519e6,JSON[_0x0f34('0x16')](_0x5152df));_0x3a2d2d(_0x5152df);})[_0x0f34('0x19')](function(_0x50069e){logger[_0x0f34('0x17')]('CreateSmsMessage',_0x50069e[_0x0f34('0x18')],_0x5519e6);_0x420262(_0x2e5d09[_0x0f34('0x17')](0x1f4,_0x50069e[_0x0f34('0x18')]));});});}; \ No newline at end of file +var _0x48cf=['localhost','socket.io-emitter','./smsMessage.socket','register','request','info','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','create','options','raw','CreateSmsMessage','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x48cf,0x134));var _0xf48c=function(_0x20115d,_0x1a193f){_0x20115d=_0x20115d-0x0;var _0x49958b=_0x48cf[_0x20115d];return _0x49958b;};'use strict';var _=require(_0xf48c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf48c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf48c('0x2'))['db'];var utils=require(_0xf48c('0x3'));var logger=require(_0xf48c('0x4'))(_0xf48c('0x5'));var config=require(_0xf48c('0x6'));var jayson=require(_0xf48c('0x7'));var client=jayson[_0xf48c('0x8')]['http']({'port':0x232a});config[_0xf48c('0x9')]=_[_0xf48c('0xa')](config['redis'],{'host':_0xf48c('0xb'),'port':0x18eb});var socket=require(_0xf48c('0xc'))(new Redis(config['redis']));require(_0xf48c('0xd'))[_0xf48c('0xe')](socket);function respondWithRpcPromise(_0x4b5a62,_0x50f737,_0x125447){return new BPromise(function(_0xa55dd5,_0x240c66){return client[_0xf48c('0xf')](_0x4b5a62,_0x125447)['then'](function(_0xba4638){logger[_0xf48c('0x10')]('SmsMessage,\x20%s,\x20%s',_0x50f737,_0xf48c('0x11'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x50f737,_0xf48c('0x11'),JSON[_0xf48c('0x12')](_0xba4638));if(_0xba4638['error']){if(_0xba4638[_0xf48c('0x13')][_0xf48c('0x14')]===0x1f4){logger[_0xf48c('0x13')](_0xf48c('0x15'),_0x50f737,_0xba4638[_0xf48c('0x13')][_0xf48c('0x16')]);return _0x240c66(_0xba4638['error']['message']);}logger['error'](_0xf48c('0x15'),_0x50f737,_0xba4638[_0xf48c('0x13')]['message']);return _0xa55dd5(_0xba4638[_0xf48c('0x13')][_0xf48c('0x16')]);}else{logger['info'](_0xf48c('0x15'),_0x50f737,_0xf48c('0x11'));_0xa55dd5(_0xba4638[_0xf48c('0x17')][_0xf48c('0x16')]);}})['catch'](function(_0x542ae1){logger[_0xf48c('0x13')](_0xf48c('0x15'),_0x50f737,_0x542ae1);_0x240c66(_0x542ae1);});});}exports['CreateSmsMessage']=function(_0x17d7b6){var _0x49a8c4=this;return new Promise(function(_0xa7efd8,_0x12d247){return db['SmsMessage'][_0xf48c('0x18')](_0x17d7b6['body'],{'raw':_0x17d7b6[_0xf48c('0x19')]?_0x17d7b6[_0xf48c('0x19')][_0xf48c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x50ddc0){logger[_0xf48c('0x10')](_0xf48c('0x1b'),_0x17d7b6);logger['debug'](_0xf48c('0x1b'),_0x17d7b6,JSON['stringify'](_0x50ddc0));_0xa7efd8(_0x50ddc0);})[_0xf48c('0x1c')](function(_0x489ef8){logger[_0xf48c('0x13')]('CreateSmsMessage',_0x489ef8['message'],_0x17d7b6);_0x12d247(_0x49a8c4[_0xf48c('0x13')](0x1f4,_0x489ef8[_0xf48c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 22fbf3b..cf1a53a 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 _0x10cf=['save','remove','emit','register','length','smsMessage:','./smsMessage.events'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x10cf,0x164));var _0xf10c=function(_0x4cf9a7,_0x5b0243){_0x4cf9a7=_0x4cf9a7-0x0;var _0x5d1789=_0x10cf[_0x4cf9a7];return _0x5d1789;};'use strict';var SmsMessageEvents=require(_0xf10c('0x0'));var events=[_0xf10c('0x1'),_0xf10c('0x2'),'update'];function createListener(_0x6ff9a4,_0x3775f2){return function(_0x3a3ef2){_0x3775f2[_0xf10c('0x3')](_0x6ff9a4,_0x3a3ef2);};}function removeListener(_0xc2772e,_0x2b20a1){return function(){SmsMessageEvents['removeListener'](_0xc2772e,_0x2b20a1);};}exports[_0xf10c('0x4')]=function(_0x12b090){for(var _0x3b6860=0x0,_0x47a5b3=events[_0xf10c('0x5')];_0x3b6860<_0x47a5b3;_0x3b6860++){var _0x13a3ee=events[_0x3b6860];var _0x21413d=createListener(_0xf10c('0x6')+_0x13a3ee,_0x12b090);SmsMessageEvents['on'](_0x13a3ee,_0x21413d);}}; \ No newline at end of file +var _0xe32c=['register','length','smsMessage:','./smsMessage.events','remove','update','emit','removeListener'];(function(_0x46167d,_0x52fe60){var _0x281177=function(_0x1ac810){while(--_0x1ac810){_0x46167d['push'](_0x46167d['shift']());}};_0x281177(++_0x52fe60);}(_0xe32c,0x143));var _0xce32=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe32c[_0x243b59];return _0x3e1676;};'use strict';var SmsMessageEvents=require(_0xce32('0x0'));var events=['save',_0xce32('0x1'),_0xce32('0x2')];function createListener(_0x5ce909,_0x42d033){return function(_0x3b9222){_0x42d033[_0xce32('0x3')](_0x5ce909,_0x3b9222);};}function removeListener(_0x3bc421,_0x2960fd){return function(){SmsMessageEvents[_0xce32('0x4')](_0x3bc421,_0x2960fd);};}exports[_0xce32('0x5')]=function(_0x214c85){for(var _0x31b696=0x0,_0x566442=events[_0xce32('0x6')];_0x31b696<_0x566442;_0x31b696++){var _0x4abafb=events[_0x31b696];var _0x153e12=createListener(_0xce32('0x7')+_0x4abafb,_0x214c85);SmsMessageEvents['on'](_0x4abafb,_0x153e12);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b2682a7..b4c2133 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 _0x0465=['put','update','delete','destroy','removeTeams','util','path','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents'];(function(_0x1fffb9,_0x1eff20){var _0x49d248=function(_0x476ed0){while(--_0x476ed0){_0x1fffb9['push'](_0x1fffb9['shift']());}};_0x49d248(++_0x1eff20);}(_0x0465,0x1f3));var _0x5046=function(_0x4223ac,_0x18be91){_0x4223ac=_0x4223ac-0x0;var _0x236d86=_0x0465[_0x4223ac];return _0x236d86;};'use strict';var multer=require('multer');var util=require(_0x5046('0x0'));var path=require(_0x5046('0x1'));var timeout=require('connect-timeout');var express=require(_0x5046('0x2'));var router=express[_0x5046('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5046('0x4'));var config=require(_0x5046('0x5'));var controller=require(_0x5046('0x6'));router[_0x5046('0x7')]('/',auth[_0x5046('0x8')](),controller['index']);router['get'](_0x5046('0x9'),auth[_0x5046('0x8')](),controller[_0x5046('0xa')]);router['get'](_0x5046('0xb'),auth['isAuthenticated'](),controller[_0x5046('0xc')]);router[_0x5046('0x7')](_0x5046('0xd'),auth[_0x5046('0x8')](),controller[_0x5046('0xe')]);router[_0x5046('0x7')](_0x5046('0xf'),auth['isAuthenticated'](),controller[_0x5046('0x10')]);router[_0x5046('0x7')](_0x5046('0x11'),auth[_0x5046('0x8')](),controller['getAgents']);router[_0x5046('0x12')]('/',auth[_0x5046('0x8')](),controller[_0x5046('0x13')]);router[_0x5046('0x12')](_0x5046('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x5046('0x11'),auth['isAuthenticated'](),controller[_0x5046('0x14')]);router[_0x5046('0x15')](_0x5046('0xb'),auth[_0x5046('0x8')](),controller[_0x5046('0x16')]);router[_0x5046('0x17')](_0x5046('0xb'),auth['isAuthenticated'](),controller[_0x5046('0x18')]);router[_0x5046('0x17')](_0x5046('0xf'),auth[_0x5046('0x8')](),controller[_0x5046('0x19')]);router[_0x5046('0x17')]('/:id/users',auth[_0x5046('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x164f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','getAgents','post','addAgents','put','update','/:id','destroy','/:id/users','removeAgents','exports','util','path'];(function(_0x4e8b8b,_0x2c8bcf){var _0x2129a9=function(_0x4858bc){while(--_0x4858bc){_0x4e8b8b['push'](_0x4e8b8b['shift']());}};_0x2129a9(++_0x2c8bcf);}(_0x164f,0x186));var _0xf164=function(_0x51ba56,_0x11fac7){_0x51ba56=_0x51ba56-0x0;var _0x5b5569=_0x164f[_0x51ba56];return _0x5b5569;};'use strict';var multer=require('multer');var util=require(_0xf164('0x0'));var path=require(_0xf164('0x1'));var timeout=require(_0xf164('0x2'));var express=require(_0xf164('0x3'));var router=express[_0xf164('0x4')]();var fs_extra=require(_0xf164('0x5'));var auth=require(_0xf164('0x6'));var interaction=require(_0xf164('0x7'));var config=require('../../config/environment');var controller=require(_0xf164('0x8'));router[_0xf164('0x9')]('/',auth[_0xf164('0xa')](),controller[_0xf164('0xb')]);router[_0xf164('0x9')](_0xf164('0xc'),auth['isAuthenticated'](),controller[_0xf164('0xd')]);router[_0xf164('0x9')]('/:id',auth[_0xf164('0xa')](),controller[_0xf164('0xe')]);router[_0xf164('0x9')](_0xf164('0xf'),auth[_0xf164('0xa')](),controller['getMembers']);router[_0xf164('0x9')](_0xf164('0x10'),auth[_0xf164('0xa')](),controller[_0xf164('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xf164('0x12')]);router[_0xf164('0x13')]('/',auth[_0xf164('0xa')](),controller['create']);router[_0xf164('0x13')](_0xf164('0x10'),auth[_0xf164('0xa')](),controller['addTeams']);router[_0xf164('0x13')]('/:id/users',auth[_0xf164('0xa')](),controller[_0xf164('0x14')]);router[_0xf164('0x15')]('/:id',auth[_0xf164('0xa')](),controller[_0xf164('0x16')]);router['delete'](_0xf164('0x17'),auth[_0xf164('0xa')](),controller[_0xf164('0x18')]);router['delete'](_0xf164('0x10'),auth[_0xf164('0xa')](),controller['removeTeams']);router['delete'](_0xf164('0x19'),auth[_0xf164('0xa')](),controller[_0xf164('0x1a')]);module[_0xf164('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 307b3ba..6afd0c0 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 _0x6a81=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a81,0xd5));var _0x16a8=function(_0x4ecf9b,_0x639293){_0x4ecf9b=_0x4ecf9b-0x0;var _0x2aa4cf=_0x6a81[_0x4ecf9b];return _0x2aa4cf;};'use strict';var Sequelize=require(_0x16a8('0x0'));module[_0x16a8('0x1')]={'name':{'type':Sequelize[_0x16a8('0x2')],'unique':_0x16a8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x16a8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x16a8('0x5')](_0x16a8('0x6'),_0x16a8('0x7'),_0x16a8('0x8'))}}; \ No newline at end of file +var _0xa730=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x262b91,_0x200498){var _0x45b945=function(_0x2731fc){while(--_0x2731fc){_0x262b91['push'](_0x262b91['shift']());}};_0x45b945(++_0x200498);}(_0xa730,0x195));var _0x0a73=function(_0x2d14e6,_0x4890b4){_0x2d14e6=_0x2d14e6-0x0;var _0x4451f5=_0xa730[_0x2d14e6];return _0x4451f5;};'use strict';var Sequelize=require(_0x0a73('0x0'));module[_0x0a73('0x1')]={'name':{'type':Sequelize[_0x0a73('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0a73('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0a73('0x4')](_0x0a73('0x5'),_0x0a73('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 76273ce..96f0806 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 _0xd3ab=['findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','voicePause','interface','flatMap','sequelize','UserSmsQueue','forEach','userSmsQueue:save','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','removeTeams','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','index','map','SmsQueue','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','getMembers','findOne','nolimit','SmsQueueId','merge'];(function(_0x4500bb,_0x2df5aa){var _0x2118e8=function(_0x543070){while(--_0x543070){_0x4500bb['push'](_0x4500bb['shift']());}};_0x2118e8(++_0x2df5aa);}(_0xd3ab,0x149));var _0xbd3a=function(_0x4fa714,_0x59d4a5){_0x4fa714=_0x4fa714-0x0;var _0x3c9055=_0xd3ab[_0x4fa714];return _0x3c9055;};'use strict';var emlformat=require(_0xbd3a('0x0'));var rimraf=require(_0xbd3a('0x1'));var zipdir=require(_0xbd3a('0x2'));var jsonpatch=require(_0xbd3a('0x3'));var rp=require(_0xbd3a('0x4'));var moment=require(_0xbd3a('0x5'));var BPromise=require(_0xbd3a('0x6'));var Mustache=require(_0xbd3a('0x7'));var util=require(_0xbd3a('0x8'));var path=require(_0xbd3a('0x9'));var sox=require(_0xbd3a('0xa'));var csv=require('to-csv');var ejs=require(_0xbd3a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd3a('0xc'));var squel=require(_0xbd3a('0xd'));var crypto=require(_0xbd3a('0xe'));var jsforce=require(_0xbd3a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbd3a('0x10'));var querystring=require(_0xbd3a('0x11'));var Papa=require(_0xbd3a('0x12'));var Redis=require(_0xbd3a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbd3a('0x14'));var as=require(_0xbd3a('0x15'));var hardwareService=require(_0xbd3a('0x16'));var logger=require(_0xbd3a('0x17'))(_0xbd3a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbd3a('0x19'))['db'];config[_0xbd3a('0x1a')]=_['defaults'](config[_0xbd3a('0x1a')],{'host':_0xbd3a('0x1b'),'port':0x18eb});var socket=require(_0xbd3a('0x1c'))(new Redis(config[_0xbd3a('0x1a')]));require(_0xbd3a('0x1d'))['register'](socket);function respondWithStatusCode(_0x23692f,_0x75e445){_0x75e445=_0x75e445||0xcc;return function(_0x455aeb){if(_0x455aeb){return _0x23692f[_0xbd3a('0x1e')](_0x75e445);}return _0x23692f[_0xbd3a('0x1f')](_0x75e445)[_0xbd3a('0x20')]();};}function respondWithResult(_0x1fdafe,_0x723812){_0x723812=_0x723812||0xc8;return function(_0x417c1c){if(_0x417c1c){return _0x1fdafe[_0xbd3a('0x1f')](_0x723812)[_0xbd3a('0x21')](_0x417c1c);}};}function respondWithFilteredResult(_0x2e4239,_0x3a7747){return function(_0x573b74){if(_0x573b74){var _0x377934=typeof _0x3a7747['offset']===_0xbd3a('0x22')&&typeof _0x3a7747[_0xbd3a('0x23')]===_0xbd3a('0x22');var _0xa94cff=_0x573b74[_0xbd3a('0x24')];var _0x1dba98=_0x377934?0x0:_0x3a7747[_0xbd3a('0x25')];var _0x5e4fe2=_0x377934?_0x573b74[_0xbd3a('0x24')]:_0x3a7747[_0xbd3a('0x25')]+_0x3a7747['limit'];var _0x5a96a4;if(_0x5e4fe2>=_0xa94cff){_0x5e4fe2=_0xa94cff;_0x5a96a4=0xc8;}else{_0x5a96a4=0xce;}_0x2e4239['status'](_0x5a96a4);return _0x2e4239[_0xbd3a('0x26')](_0xbd3a('0x27'),_0x1dba98+'-'+_0x5e4fe2+'/'+_0xa94cff)[_0xbd3a('0x21')](_0x573b74);}return null;};}function patchUpdates(_0x2c5deb){return function(_0x324d7a){try{jsonpatch[_0xbd3a('0x28')](_0x324d7a,_0x2c5deb,!![]);}catch(_0x40ceab){return BPromise[_0xbd3a('0x29')](_0x40ceab);}return _0x324d7a['save']();};}function saveUpdates(_0x5a5560,_0x5d78e8){return function(_0x3c34e1){if(_0x3c34e1){return _0x3c34e1[_0xbd3a('0x2a')](_0x5a5560)[_0xbd3a('0x2b')](function(_0x332660){return _0x332660;});}return null;};}function removeEntity(_0x46b924,_0x3fa6f9){return function(_0x19bd9c){if(_0x19bd9c){return _0x19bd9c[_0xbd3a('0x2c')]()[_0xbd3a('0x2b')](function(){var _0x499caa=_0x19bd9c[_0xbd3a('0x2d')]({'plain':!![]});var _0x4e2d92=_0xbd3a('0x2e');return db[_0xbd3a('0x2f')]['destroy']({'where':{'type':_0x4e2d92,'resourceId':_0x499caa['id']}})[_0xbd3a('0x2b')](function(){return _0x19bd9c;});})[_0xbd3a('0x2b')](function(){_0x46b924[_0xbd3a('0x1f')](0xcc)[_0xbd3a('0x20')]();});}};}function handleEntityNotFound(_0x1481e9,_0x32ae4d){return function(_0x51a870){if(!_0x51a870){_0x1481e9[_0xbd3a('0x1e')](0x194);}return _0x51a870;};}function handleError(_0x364fba,_0x1bf8e8){_0x1bf8e8=_0x1bf8e8||0x1f4;return function(_0x43f688){logger[_0xbd3a('0x30')](_0x43f688['stack']);if(_0x43f688[_0xbd3a('0x31')]){delete _0x43f688[_0xbd3a('0x31')];}_0x364fba[_0xbd3a('0x1f')](_0x1bf8e8)['send'](_0x43f688);};}exports[_0xbd3a('0x32')]=function(_0x35cc03,_0x3498ad){var _0x254347={},_0x2e6f1a={},_0x47e08c={'count':0x0,'rows':[]};var _0xf10a09=_[_0xbd3a('0x33')](db[_0xbd3a('0x34')][_0xbd3a('0x35')],function(_0x128b32){return{'name':_0x128b32[_0xbd3a('0x36')],'type':_0x128b32['type'][_0xbd3a('0x37')]};});_0x2e6f1a['model']=_[_0xbd3a('0x33')](_0xf10a09,_0xbd3a('0x31'));_0x2e6f1a['query']=_['keys'](_0x35cc03[_0xbd3a('0x38')]);_0x2e6f1a[_0xbd3a('0x39')]=_[_0xbd3a('0x3a')](_0x2e6f1a[_0xbd3a('0x3b')],_0x2e6f1a['query']);_0x254347[_0xbd3a('0x3c')]=_[_0xbd3a('0x3a')](_0x2e6f1a[_0xbd3a('0x3b')],qs[_0xbd3a('0x3d')](_0x35cc03[_0xbd3a('0x38')][_0xbd3a('0x3d')]));_0x254347[_0xbd3a('0x3c')]=_0x254347['attributes'][_0xbd3a('0x3e')]?_0x254347['attributes']:_0x2e6f1a['model'];if(!_0x35cc03['query'][_0xbd3a('0x3f')]('nolimit')){_0x254347[_0xbd3a('0x23')]=qs[_0xbd3a('0x23')](_0x35cc03[_0xbd3a('0x38')]['limit']);_0x254347[_0xbd3a('0x25')]=qs[_0xbd3a('0x25')](_0x35cc03[_0xbd3a('0x38')]['offset']);}_0x254347[_0xbd3a('0x40')]=qs[_0xbd3a('0x41')](_0x35cc03[_0xbd3a('0x38')][_0xbd3a('0x41')]);_0x254347['where']=qs[_0xbd3a('0x39')](_[_0xbd3a('0x42')](_0x35cc03[_0xbd3a('0x38')],_0x2e6f1a[_0xbd3a('0x39')]),_0xf10a09);if(_0x35cc03[_0xbd3a('0x38')][_0xbd3a('0x43')]){_0x254347[_0xbd3a('0x44')]=_['merge'](_0x254347[_0xbd3a('0x44')],{'$or':_[_0xbd3a('0x33')](_0xf10a09,function(_0x46b38e){if(_0x46b38e['type']!==_0xbd3a('0x45')){var _0x7ef9ca={};_0x7ef9ca[_0x46b38e[_0xbd3a('0x31')]]={'$like':'%'+_0x35cc03[_0xbd3a('0x38')][_0xbd3a('0x43')]+'%'};return _0x7ef9ca;}})});}_0x254347=_['merge']({},_0x254347,_0x35cc03[_0xbd3a('0x46')]);var _0x58ca8e={'where':_0x254347[_0xbd3a('0x44')]};return db['SmsQueue'][_0xbd3a('0x24')](_0x58ca8e)[_0xbd3a('0x2b')](function(_0x340b8d){_0x47e08c[_0xbd3a('0x24')]=_0x340b8d;if(_0x35cc03['query'][_0xbd3a('0x47')]){_0x254347[_0xbd3a('0x48')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x254347);})[_0xbd3a('0x2b')](function(_0x593388){_0x47e08c[_0xbd3a('0x49')]=_0x593388;return _0x47e08c;})[_0xbd3a('0x2b')](respondWithFilteredResult(_0x3498ad,_0x254347))['catch'](handleError(_0x3498ad,null));};exports[_0xbd3a('0x4a')]=function(_0x3db80d,_0x3a5c10){var _0x22c97e={'raw':!![],'where':{'id':_0x3db80d[_0xbd3a('0x4b')]['id']}},_0x4edbbc={};_0x4edbbc['model']=_[_0xbd3a('0x4c')](db[_0xbd3a('0x34')][_0xbd3a('0x35')]);_0x4edbbc[_0xbd3a('0x38')]=_[_0xbd3a('0x4c')](_0x3db80d[_0xbd3a('0x38')]);_0x4edbbc[_0xbd3a('0x39')]=_[_0xbd3a('0x3a')](_0x4edbbc[_0xbd3a('0x3b')],_0x4edbbc[_0xbd3a('0x38')]);_0x22c97e['attributes']=_['intersection'](_0x4edbbc['model'],qs[_0xbd3a('0x3d')](_0x3db80d[_0xbd3a('0x38')]['fields']));_0x22c97e['attributes']=_0x22c97e[_0xbd3a('0x3c')][_0xbd3a('0x3e')]?_0x22c97e[_0xbd3a('0x3c')]:_0x4edbbc[_0xbd3a('0x3b')];if(_0x3db80d[_0xbd3a('0x38')][_0xbd3a('0x47')]){_0x22c97e[_0xbd3a('0x48')]=[{'all':!![]}];}_0x22c97e=_['merge']({},_0x22c97e,_0x3db80d[_0xbd3a('0x46')]);return db[_0xbd3a('0x34')][_0xbd3a('0x4d')](_0x22c97e)[_0xbd3a('0x2b')](handleEntityNotFound(_0x3a5c10,null))[_0xbd3a('0x2b')](respondWithResult(_0x3a5c10,null))['catch'](handleError(_0x3a5c10,null));};exports['create']=function(_0x1dd29d,_0x455a34){return db[_0xbd3a('0x34')]['create'](_0x1dd29d[_0xbd3a('0x4e')],{})[_0xbd3a('0x2b')](function(_0x5205a9){var _0x45ff10=_0x1dd29d[_0xbd3a('0x4f')]['get']({'plain':!![]});if(!_0x45ff10)throw new Error(_0xbd3a('0x50'));if(_0x45ff10[_0xbd3a('0x51')]==='user'){var _0x4be062=_0x5205a9[_0xbd3a('0x2d')]({'plain':!![]});var _0x579def=_0xbd3a('0x2e');return db[_0xbd3a('0x52')][_0xbd3a('0x4d')]({'where':{'name':_0x579def,'userProfileId':_0x45ff10[_0xbd3a('0x53')]},'raw':!![]})[_0xbd3a('0x2b')](function(_0x9f7823){if(_0x9f7823&&_0x9f7823[_0xbd3a('0x54')]===0x0){return db[_0xbd3a('0x2f')][_0xbd3a('0x55')]({'name':_0x4be062[_0xbd3a('0x31')],'resourceId':_0x4be062['id'],'type':_0x9f7823[_0xbd3a('0x31')],'sectionId':_0x9f7823['id']},{})[_0xbd3a('0x2b')](function(){return _0x5205a9;});}else{return _0x5205a9;}})['catch'](function(_0x412297){logger[_0xbd3a('0x30')](_0xbd3a('0x56'),_0x412297);throw _0x412297;});}return _0x5205a9;})[_0xbd3a('0x2b')](respondWithResult(_0x455a34,0xc9))[_0xbd3a('0x57')](handleError(_0x455a34,null));};exports[_0xbd3a('0x2a')]=function(_0x2930e1,_0x3ada69){if(_0x2930e1[_0xbd3a('0x4e')]['id']){delete _0x2930e1[_0xbd3a('0x4e')]['id'];}return db[_0xbd3a('0x34')][_0xbd3a('0x4d')]({'where':{'id':_0x2930e1[_0xbd3a('0x4b')]['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x3ada69,null))[_0xbd3a('0x2b')](saveUpdates(_0x2930e1[_0xbd3a('0x4e')],null))[_0xbd3a('0x2b')](respondWithResult(_0x3ada69,null))['catch'](handleError(_0x3ada69,null));};exports[_0xbd3a('0x2c')]=function(_0x157460,_0x1652af){return db[_0xbd3a('0x34')][_0xbd3a('0x4d')]({'where':{'id':_0x157460[_0xbd3a('0x4b')]['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x1652af,null))[_0xbd3a('0x2b')](removeEntity(_0x1652af,null))[_0xbd3a('0x57')](handleError(_0x1652af,null));};exports[_0xbd3a('0x58')]=function(_0x56a266,_0x5be405){return db['SmsQueue'][_0xbd3a('0x58')]()['then'](respondWithResult(_0x5be405,null))[_0xbd3a('0x57')](handleError(_0x5be405,null));};exports[_0xbd3a('0x59')]=function(_0x325e25,_0x410b2b,_0x37217e){var _0x2b1840={'raw':!![],'where':{}},_0x110d1d={},_0x453410;return db[_0xbd3a('0x34')][_0xbd3a('0x5a')]({'where':{'id':_0x325e25[_0xbd3a('0x4b')]['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x410b2b,null))['then'](function(_0x476762){if(_0x476762){_0x453410=_0x476762['get']({'plain':!![]});_0x110d1d[_0xbd3a('0x3b')]=_[_0xbd3a('0x4c')](db['UserSmsQueue'][_0xbd3a('0x35')]);_0x110d1d[_0xbd3a('0x38')]=_['keys'](_0x325e25[_0xbd3a('0x38')]);_0x110d1d[_0xbd3a('0x39')]=_['intersection'](_0x110d1d['model'],_0x110d1d[_0xbd3a('0x38')]);_0x2b1840[_0xbd3a('0x3c')]=_[_0xbd3a('0x3a')](_0x110d1d[_0xbd3a('0x3b')],qs[_0xbd3a('0x3d')](_0x325e25[_0xbd3a('0x38')][_0xbd3a('0x3d')]));_0x2b1840[_0xbd3a('0x3c')]=_0x2b1840[_0xbd3a('0x3c')][_0xbd3a('0x3e')]?_0x2b1840[_0xbd3a('0x3c')]:_0x110d1d[_0xbd3a('0x3b')];if(!_0x325e25[_0xbd3a('0x38')][_0xbd3a('0x3f')](_0xbd3a('0x5b'))){_0x2b1840['limit']=qs[_0xbd3a('0x23')](_0x325e25['query']['limit']);_0x2b1840['offset']=qs['offset'](_0x325e25['query']['offset']);}_0x2b1840[_0xbd3a('0x40')]=qs[_0xbd3a('0x41')](_0x325e25[_0xbd3a('0x38')][_0xbd3a('0x41')]);_0x2b1840[_0xbd3a('0x44')]=qs['filters'](_[_0xbd3a('0x42')](_0x325e25['query'],_0x110d1d[_0xbd3a('0x39')]));_0x2b1840[_0xbd3a('0x44')][_0xbd3a('0x5c')]=_0x476762['id'];if(_0x325e25[_0xbd3a('0x38')][_0xbd3a('0x43')]){_0x2b1840[_0xbd3a('0x44')]=_[_0xbd3a('0x5d')](_0x2b1840[_0xbd3a('0x44')],{'$or':_[_0xbd3a('0x33')](_0x2b1840[_0xbd3a('0x3c')],function(_0x12aacc){var _0x359060={};_0x359060[_0x12aacc]={'$like':'%'+_0x325e25[_0xbd3a('0x38')][_0xbd3a('0x43')]+'%'};return _0x359060;})});}_0x2b1840=_[_0xbd3a('0x5d')]({},_0x2b1840,_0x325e25[_0xbd3a('0x46')]);return db['UserSmsQueue'][_0xbd3a('0x5e')](_0x2b1840);}})[_0xbd3a('0x2b')](function(_0x38bab3){if(_0x38bab3){return db[_0xbd3a('0x5f')][_0xbd3a('0x60')]({'where':{'id':_[_0xbd3a('0x33')](_0x38bab3,_0xbd3a('0x61')),'role':_0xbd3a('0x62')},'attributes':['id',_0xbd3a('0x31'),'smsPause',_0xbd3a('0x63'),_0xbd3a('0x64')]});}})[_0xbd3a('0x2b')](function(_0x5d4909){if(_0x5d4909){return{'count':_0x5d4909[_0xbd3a('0x24')],'rows':_['map'](_0x5d4909[_0xbd3a('0x49')],function(_0x5614ba){return{'membername':_0x5614ba['name'],'UserId':_0x5614ba['id'],'queue_name':_0x453410[_0xbd3a('0x31')],'SmsQueueId':_0x453410['id'],'interface':util[_0xbd3a('0x65')](_0xbd3a('0x66'),_0xbd3a('0x67'),_0x5614ba[_0xbd3a('0x31')]),'penalty':0x0,'paused':_0x5614ba['smsPause'],'createdAt':_0x5614ba[_0xbd3a('0x64')],'updatedAt':_0x5614ba[_0xbd3a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbd3a('0x2b')](respondWithFilteredResult(_0x410b2b,_0x2b1840))[_0xbd3a('0x57')](handleError(_0x410b2b,null));};exports[_0xbd3a('0x68')]=function(_0x3c2288,_0x3879b0,_0x31dc36){var _0x2bfc4f={};var _0x579dcb={};var _0x1175f6;var _0x3d8792;return db[_0xbd3a('0x34')]['findOne']({'where':{'id':_0x3c2288['params']['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x3879b0,null))[_0xbd3a('0x2b')](function(_0x1aa66e){if(_0x1aa66e){_0x1175f6=_0x1aa66e;_0x579dcb['model']=_[_0xbd3a('0x4c')](db['Team']['rawAttributes']);_0x579dcb[_0xbd3a('0x38')]=_[_0xbd3a('0x4c')](_0x3c2288[_0xbd3a('0x38')]);_0x579dcb['filters']=_[_0xbd3a('0x3a')](_0x579dcb[_0xbd3a('0x3b')],_0x579dcb[_0xbd3a('0x38')]);_0x2bfc4f[_0xbd3a('0x3c')]=_[_0xbd3a('0x3a')](_0x579dcb['model'],qs[_0xbd3a('0x3d')](_0x3c2288[_0xbd3a('0x38')][_0xbd3a('0x3d')]));_0x2bfc4f[_0xbd3a('0x3c')]=_0x2bfc4f[_0xbd3a('0x3c')][_0xbd3a('0x3e')]?_0x2bfc4f[_0xbd3a('0x3c')]:_0x579dcb[_0xbd3a('0x3b')];_0x2bfc4f[_0xbd3a('0x40')]=qs[_0xbd3a('0x41')](_0x3c2288[_0xbd3a('0x38')][_0xbd3a('0x41')]);_0x2bfc4f[_0xbd3a('0x44')]=qs[_0xbd3a('0x39')](_['pick'](_0x3c2288[_0xbd3a('0x38')],_0x579dcb['filters']));if(_0x3c2288[_0xbd3a('0x38')][_0xbd3a('0x43')]){_0x2bfc4f['where']=_[_0xbd3a('0x5d')](_0x2bfc4f['where'],{'$or':_[_0xbd3a('0x33')](_0x2bfc4f[_0xbd3a('0x3c')],function(_0x473681){var _0x4e233b={};_0x4e233b[_0x473681]={'$like':'%'+_0x3c2288[_0xbd3a('0x38')][_0xbd3a('0x43')]+'%'};return _0x4e233b;})});}_0x2bfc4f=_[_0xbd3a('0x5d')]({},_0x2bfc4f,_0x3c2288['options']);return _0x1175f6[_0xbd3a('0x68')](_0x2bfc4f);}})[_0xbd3a('0x2b')](function(_0x21a040){if(_0x21a040){_0x3d8792=_0x21a040['length'];if(!_0x3c2288[_0xbd3a('0x38')][_0xbd3a('0x3f')](_0xbd3a('0x5b'))){_0x2bfc4f['limit']=qs['limit'](_0x3c2288['query'][_0xbd3a('0x23')]);_0x2bfc4f[_0xbd3a('0x25')]=qs[_0xbd3a('0x25')](_0x3c2288[_0xbd3a('0x38')]['offset']);}return _0x1175f6[_0xbd3a('0x68')](_0x2bfc4f);}})[_0xbd3a('0x2b')](function(_0x2e0fb6){if(_0x2e0fb6){return _0x2e0fb6?{'count':_0x3d8792,'rows':_0x2e0fb6}:null;}})[_0xbd3a('0x2b')](respondWithResult(_0x3879b0,null))['catch'](handleError(_0x3879b0,null));};exports[_0xbd3a('0x69')]=function(_0x173444,_0x327879,_0x93aab9){var _0x185a63=_0x173444['body']['ids'];return db[_0xbd3a('0x6a')][_0xbd3a('0x5e')]({'where':{'id':_0x185a63},'attributes':['id'],'include':[{'model':db[_0xbd3a('0x5f')],'as':_0xbd3a('0x6b'),'attributes':['id',_0xbd3a('0x31'),'online',_0xbd3a('0x6c'),_0xbd3a('0x6d')],'raw':!![]}]})[_0xbd3a('0x2b')](function(_0x557913){if(_0x557913){var _0x46a3fc=_[_0xbd3a('0x6e')](_0x557913,function(_0x30c3d0){var _0x54dec5=_0x30c3d0[_0xbd3a('0x2d')]({'plain':!![]});return _0x54dec5[_0xbd3a('0x6b')];});return db['SmsQueue']['find']({'where':{'id':_0x173444['params']['id']}})['then'](function(_0x1fb892){return db[_0xbd3a('0x6f')]['transaction'](function(_0x3917d1){return _0x1fb892['addTeams'](_0x185a63,{'transaction':_0x3917d1})[_0xbd3a('0x2b')](function(){return BPromise['each'](_0x46a3fc,function(_0x31ec8e){return db[_0xbd3a('0x70')]['findOrCreate']({'where':{'UserId':_0x31ec8e['id'],'SmsQueueId':_0x173444[_0xbd3a('0x4b')]['id']},'transaction':_0x3917d1});});})[_0xbd3a('0x2b')](function(){_0x46a3fc[_0xbd3a('0x71')](function(_0x47508b){socket['emit'](_0xbd3a('0x72'),{'UserId':_0x47508b['id'],'SmsQueueId':_0x1fb892['id']});});});});});}})['then'](respondWithStatusCode(_0x327879,null))[_0xbd3a('0x57')](handleError(_0x327879,null));};exports['removeTeams']=function(_0x6acb4,_0x5119d2,_0x2ed71e){return db[_0xbd3a('0x6a')]['findAll']({'where':{'id':_0x6acb4[_0xbd3a('0x38')][_0xbd3a('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbd3a('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xbd3a('0x2b')](handleEntityNotFound(_0x5119d2,null))[_0xbd3a('0x2b')](function(_0xb6bdee){var _0xbb0b94=_[_0xbd3a('0x33')](_0xb6bdee,'id');var _0x4fe1e1=[];var _0x440b51=[];var _0x1772ef=squel[_0xbd3a('0x74')]();_0x1772ef[_0xbd3a('0x75')](_0xbd3a('0x76'))['from']('team_has_sms_queues','tq')[_0xbd3a('0x77')](_0xbd3a('0x78'),'ut',_0xbd3a('0x79'))[_0xbd3a('0x44')](_0xbd3a('0x7a'),_0x6acb4[_0xbd3a('0x4b')]['id']);for(var _0x1cbf8a=0x0;_0x1cbf8a<_0xb6bdee[_0xbd3a('0x3e')];_0x1cbf8a+=0x1){let _0x16fd7b=_0xb6bdee[_0x1cbf8a];for(var _0x5ee326=0x0;_0x5ee326<_0x16fd7b[_0xbd3a('0x6b')][_0xbd3a('0x3e')];_0x5ee326+=0x1){let _0x438714=_0x16fd7b[_0xbd3a('0x6b')][_0x5ee326];var _0x3f8432=_0x1772ef[_0xbd3a('0x7b')]();_0x3f8432[_0xbd3a('0x44')](_0xbd3a('0x7c'),_0x438714['id']);_0x440b51[_0xbd3a('0x7d')](db[_0xbd3a('0x6f')]['query'](_0x3f8432['toString'](),{'type':db[_0xbd3a('0x6f')][_0xbd3a('0x7e')]['SELECT']})[_0xbd3a('0x2b')](function(_0x12135f){if(_0x12135f[_0xbd3a('0x3e')]===0x1){return _0x438714['id'];}else{var _0x1b5b65=_[_0xbd3a('0x7f')](_['map'](_0x12135f,_0xbd3a('0x80')),function(_0x1c44b6){return _['includes'](_0xbb0b94,_0x1c44b6);});if(_0x1b5b65){return _0x438714['id'];}}}));}}return BPromise[_0xbd3a('0x81')](_0x440b51)[_0xbd3a('0x2b')](function(_0x3518cf){_0x4fe1e1=_(_0x4fe1e1)[_0xbd3a('0x82')](_0x3518cf)['compact']()['value']();return db[_0xbd3a('0x34')]['find']({'where':{'id':_0x6acb4['params']['id']}})['then'](function(_0x2b933c){return db['sequelize']['transaction'](function(_0x1fff69){return _0x2b933c[_0xbd3a('0x83')](_0x6acb4[_0xbd3a('0x38')]['ids'],{'transaction':_0x1fff69})[_0xbd3a('0x2b')](function(){if(!_[_0xbd3a('0x84')](_0x4fe1e1)){return _0x2b933c[_0xbd3a('0x85')](_0x4fe1e1,{'transaction':_0x1fff69});}})[_0xbd3a('0x2b')](function(){_0x4fe1e1[_0xbd3a('0x71')](function(_0x19930e){socket[_0xbd3a('0x86')](_0xbd3a('0x87'),{'UserId':_0x19930e,'SmsQueueId':_0x2b933c['id']});});});});});});})[_0xbd3a('0x2b')](respondWithStatusCode(_0x5119d2,null))[_0xbd3a('0x57')](handleError(_0x5119d2,null));};exports[_0xbd3a('0x88')]=function(_0x2bc317,_0x55d185,_0x431e48){return db['SmsQueue'][_0xbd3a('0x4d')]({'where':{'id':_0x2bc317[_0xbd3a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55d185,null))[_0xbd3a('0x2b')](function(_0x5ee4c7){if(_0x5ee4c7){return _0x5ee4c7[_0xbd3a('0x88')](_0x2bc317[_0xbd3a('0x4e')][_0xbd3a('0x73')],_[_0xbd3a('0x89')](_0x2bc317[_0xbd3a('0x4e')],['ids','id'])||{})[_0xbd3a('0x8a')](function(_0x5d7621){for(var _0x124b75=0x0;_0x124b75<_0x2bc317[_0xbd3a('0x4e')]['ids'][_0xbd3a('0x3e')];_0x124b75+=0x1){socket[_0xbd3a('0x86')](_0xbd3a('0x72'),{'UserId':Number(_0x2bc317[_0xbd3a('0x4e')][_0xbd3a('0x73')][_0x124b75]),'SmsQueueId':Number(_0x2bc317[_0xbd3a('0x4b')]['id'])});}return _0x5d7621;});}})[_0xbd3a('0x2b')](respondWithResult(_0x55d185,null))[_0xbd3a('0x57')](handleError(_0x55d185,null));};exports[_0xbd3a('0x85')]=function(_0x26230d,_0x331a7d,_0x291a57){return db[_0xbd3a('0x34')]['find']({'where':{'id':_0x26230d[_0xbd3a('0x4b')]['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x331a7d,null))['then'](function(_0xe0e2d3){if(_0xe0e2d3){return _0xe0e2d3['removeAgents'](_0x26230d[_0xbd3a('0x38')][_0xbd3a('0x73')])[_0xbd3a('0x2b')](function(){if(_[_0xbd3a('0x8b')](_0x26230d['query'][_0xbd3a('0x73')])){for(var _0x16c086=0x0;_0x16c086<_0x26230d[_0xbd3a('0x38')][_0xbd3a('0x73')]['length'];_0x16c086+=0x1){socket[_0xbd3a('0x86')](_0xbd3a('0x87'),{'UserId':Number(_0x26230d[_0xbd3a('0x38')]['ids'][_0x16c086]),'SmsQueueId':Number(_0x26230d[_0xbd3a('0x4b')]['id'])});}}else{socket[_0xbd3a('0x86')]('userSmsQueue:remove',{'UserId':Number(_0x26230d['query'][_0xbd3a('0x73')]),'SmsQueueId':Number(_0x26230d[_0xbd3a('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x331a7d,null))[_0xbd3a('0x57')](handleError(_0x331a7d,null));};exports['getAgents']=function(_0x22683a,_0x5e9012,_0x113e17){var _0x56f7de={};var _0x49c48b={};var _0x38adc6;var _0x10a160;return db[_0xbd3a('0x34')][_0xbd3a('0x5a')]({'where':{'id':_0x22683a[_0xbd3a('0x4b')]['id']}})[_0xbd3a('0x2b')](handleEntityNotFound(_0x5e9012,null))[_0xbd3a('0x2b')](function(_0x21b627){if(_0x21b627){_0x38adc6=_0x21b627;_0x49c48b[_0xbd3a('0x3b')]=_[_0xbd3a('0x4c')](db[_0xbd3a('0x5f')][_0xbd3a('0x35')]);_0x49c48b['query']=_[_0xbd3a('0x4c')](_0x22683a[_0xbd3a('0x38')]);_0x49c48b[_0xbd3a('0x39')]=_['intersection'](_0x49c48b[_0xbd3a('0x3b')],_0x49c48b[_0xbd3a('0x38')]);_0x56f7de[_0xbd3a('0x3c')]=_[_0xbd3a('0x3a')](_0x49c48b[_0xbd3a('0x3b')],qs[_0xbd3a('0x3d')](_0x22683a[_0xbd3a('0x38')][_0xbd3a('0x3d')]));_0x56f7de[_0xbd3a('0x3c')]=_0x56f7de[_0xbd3a('0x3c')]['length']?_0x56f7de['attributes']:_0x49c48b[_0xbd3a('0x3b')];_0x56f7de[_0xbd3a('0x40')]=qs[_0xbd3a('0x41')](_0x22683a[_0xbd3a('0x38')][_0xbd3a('0x41')]);_0x56f7de['where']=qs['filters'](_[_0xbd3a('0x42')](_0x22683a[_0xbd3a('0x38')],_0x49c48b[_0xbd3a('0x39')]));if(_0x22683a['query'][_0xbd3a('0x43')]){_0x56f7de['where']=_[_0xbd3a('0x5d')](_0x56f7de['where'],{'$or':_[_0xbd3a('0x33')](_0x56f7de[_0xbd3a('0x3c')],function(_0x3f9922){var _0x196362={};_0x196362[_0x3f9922]={'$like':'%'+_0x22683a['query']['filter']+'%'};return _0x196362;})});}_0x56f7de=_[_0xbd3a('0x5d')]({},_0x56f7de,_0x22683a[_0xbd3a('0x46')]);return _0x38adc6[_0xbd3a('0x8c')](_0x56f7de);}})[_0xbd3a('0x2b')](function(_0x1640a9){if(_0x1640a9){_0x10a160=_0x1640a9[_0xbd3a('0x3e')];if(!_0x22683a[_0xbd3a('0x38')][_0xbd3a('0x3f')]('nolimit')){_0x56f7de[_0xbd3a('0x23')]=qs[_0xbd3a('0x23')](_0x22683a[_0xbd3a('0x38')][_0xbd3a('0x23')]);_0x56f7de[_0xbd3a('0x25')]=qs['offset'](_0x22683a[_0xbd3a('0x38')]['offset']);}return _0x38adc6[_0xbd3a('0x8c')](_0x56f7de);}})[_0xbd3a('0x2b')](function(_0x93a417){if(_0x93a417){return _0x93a417?{'count':_0x10a160,'rows':_0x93a417}:null;}})[_0xbd3a('0x2b')](respondWithResult(_0x5e9012,null))['catch'](handleError(_0x5e9012,null));}; \ No newline at end of file +var _0xc1c6=['include','findAll','catch','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','filter','User','agent','smsPause','updatedAt','createdAt','rows','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','redis','defaults','localhost','socket.io-emitter','register','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll'];(function(_0x27ec7f,_0x46755a){var _0x440d56=function(_0x129f31){while(--_0x129f31){_0x27ec7f['push'](_0x27ec7f['shift']());}};_0x440d56(++_0x46755a);}(_0xc1c6,0xd0));var _0x6c1c=function(_0x4f46d2,_0x5600ec){_0x4f46d2=_0x4f46d2-0x0;var _0xd45794=_0xc1c6[_0x4f46d2];return _0xd45794;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c1c('0x1'));var jsonpatch=require(_0x6c1c('0x2'));var rp=require('request-promise');var moment=require(_0x6c1c('0x3'));var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require(_0x6c1c('0x7'));var sox=require(_0x6c1c('0x8'));var csv=require('to-csv');var ejs=require(_0x6c1c('0x9'));var fs=require('fs');var fs_extra=require(_0x6c1c('0xa'));var _=require(_0x6c1c('0xb'));var squel=require(_0x6c1c('0xc'));var crypto=require('crypto');var jsforce=require(_0x6c1c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xe'));var Papa=require(_0x6c1c('0xf'));var Redis=require(_0x6c1c('0x10'));var authService=require(_0x6c1c('0x11'));var qs=require(_0x6c1c('0x12'));var as=require(_0x6c1c('0x13'));var hardwareService=require(_0x6c1c('0x14'));var logger=require(_0x6c1c('0x15'))('api');var utils=require(_0x6c1c('0x16'));var config=require(_0x6c1c('0x17'));var licenseUtil=require(_0x6c1c('0x18'));var db=require(_0x6c1c('0x19'))['db'];config[_0x6c1c('0x1a')]=_[_0x6c1c('0x1b')](config[_0x6c1c('0x1a')],{'host':_0x6c1c('0x1c'),'port':0x18eb});var socket=require(_0x6c1c('0x1d'))(new Redis(config[_0x6c1c('0x1a')]));require('./smsQueue.socket')[_0x6c1c('0x1e')](socket);function respondWithStatusCode(_0x3550b8,_0x57c3b6){_0x57c3b6=_0x57c3b6||0xcc;return function(_0x1018e5){if(_0x1018e5){return _0x3550b8['sendStatus'](_0x57c3b6);}return _0x3550b8[_0x6c1c('0x1f')](_0x57c3b6)[_0x6c1c('0x20')]();};}function respondWithResult(_0x5ee870,_0x5f2aa9){_0x5f2aa9=_0x5f2aa9||0xc8;return function(_0xeb4694){if(_0xeb4694){return _0x5ee870[_0x6c1c('0x1f')](_0x5f2aa9)[_0x6c1c('0x21')](_0xeb4694);}};}function respondWithFilteredResult(_0x3f3756,_0x8b281){return function(_0xda41bc){if(_0xda41bc){var _0x44fadc=typeof _0x8b281['offset']==='undefined'&&typeof _0x8b281[_0x6c1c('0x22')]===_0x6c1c('0x23');var _0xc1edcb=_0xda41bc['count'];var _0x5de2c6=_0x44fadc?0x0:_0x8b281[_0x6c1c('0x24')];var _0x4ae73a=_0x44fadc?_0xda41bc[_0x6c1c('0x25')]:_0x8b281[_0x6c1c('0x24')]+_0x8b281[_0x6c1c('0x22')];var _0x557511;if(_0x4ae73a>=_0xc1edcb){_0x4ae73a=_0xc1edcb;_0x557511=0xc8;}else{_0x557511=0xce;}_0x3f3756[_0x6c1c('0x1f')](_0x557511);return _0x3f3756[_0x6c1c('0x26')](_0x6c1c('0x27'),_0x5de2c6+'-'+_0x4ae73a+'/'+_0xc1edcb)['json'](_0xda41bc);}return null;};}function patchUpdates(_0x24f489){return function(_0x1f2d0b){try{jsonpatch[_0x6c1c('0x28')](_0x1f2d0b,_0x24f489,!![]);}catch(_0x483e4e){return BPromise[_0x6c1c('0x29')](_0x483e4e);}return _0x1f2d0b[_0x6c1c('0x2a')]();};}function saveUpdates(_0x4fd5c1,_0x173017){return function(_0x81a8f){if(_0x81a8f){return _0x81a8f[_0x6c1c('0x2b')](_0x4fd5c1)[_0x6c1c('0x2c')](function(_0x31af49){return _0x31af49;});}return null;};}function removeEntity(_0x25af89,_0x22f2c8){return function(_0x49495a){if(_0x49495a){return _0x49495a[_0x6c1c('0x2d')]()[_0x6c1c('0x2c')](function(){var _0x449dbe=_0x49495a[_0x6c1c('0x2e')]({'plain':!![]});var _0x2f68b6=_0x6c1c('0x2f');return db[_0x6c1c('0x30')][_0x6c1c('0x2d')]({'where':{'type':_0x2f68b6,'resourceId':_0x449dbe['id']}})[_0x6c1c('0x2c')](function(){return _0x49495a;});})['then'](function(){_0x25af89[_0x6c1c('0x1f')](0xcc)[_0x6c1c('0x20')]();});}};}function handleEntityNotFound(_0x205714,_0x1873b9){return function(_0xe70061){if(!_0xe70061){_0x205714[_0x6c1c('0x31')](0x194);}return _0xe70061;};}function handleError(_0x10b846,_0x146cd5){_0x146cd5=_0x146cd5||0x1f4;return function(_0x4ce947){logger[_0x6c1c('0x32')](_0x4ce947[_0x6c1c('0x33')]);if(_0x4ce947[_0x6c1c('0x34')]){delete _0x4ce947[_0x6c1c('0x34')];}_0x10b846['status'](_0x146cd5)[_0x6c1c('0x35')](_0x4ce947);};}exports[_0x6c1c('0x36')]=function(_0x295817,_0x286924){var _0x466216={},_0x4de97c={},_0x35e8b1={'count':0x0,'rows':[]};var _0x22b913=_['map'](db[_0x6c1c('0x37')][_0x6c1c('0x38')],function(_0x31d10a){return{'name':_0x31d10a[_0x6c1c('0x39')],'type':_0x31d10a[_0x6c1c('0x3a')][_0x6c1c('0x3b')]};});_0x4de97c[_0x6c1c('0x3c')]=_[_0x6c1c('0x3d')](_0x22b913,_0x6c1c('0x34'));_0x4de97c[_0x6c1c('0x3e')]=_[_0x6c1c('0x3f')](_0x295817['query']);_0x4de97c['filters']=_[_0x6c1c('0x40')](_0x4de97c[_0x6c1c('0x3c')],_0x4de97c['query']);_0x466216[_0x6c1c('0x41')]=_['intersection'](_0x4de97c[_0x6c1c('0x3c')],qs[_0x6c1c('0x42')](_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x42')]));_0x466216[_0x6c1c('0x41')]=_0x466216[_0x6c1c('0x41')]['length']?_0x466216[_0x6c1c('0x41')]:_0x4de97c[_0x6c1c('0x3c')];if(!_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x43')](_0x6c1c('0x44'))){_0x466216[_0x6c1c('0x22')]=qs['limit'](_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x22')]);_0x466216[_0x6c1c('0x24')]=qs[_0x6c1c('0x24')](_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x24')]);}_0x466216[_0x6c1c('0x45')]=qs[_0x6c1c('0x46')](_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x46')]);_0x466216[_0x6c1c('0x47')]=qs[_0x6c1c('0x48')](_[_0x6c1c('0x49')](_0x295817[_0x6c1c('0x3e')],_0x4de97c['filters']),_0x22b913);if(_0x295817[_0x6c1c('0x3e')]['filter']){_0x466216[_0x6c1c('0x47')]=_[_0x6c1c('0x4a')](_0x466216[_0x6c1c('0x47')],{'$or':_[_0x6c1c('0x3d')](_0x22b913,function(_0x25addd){if(_0x25addd['type']!==_0x6c1c('0x4b')){var _0x48802a={};_0x48802a[_0x25addd[_0x6c1c('0x34')]]={'$like':'%'+_0x295817[_0x6c1c('0x3e')]['filter']+'%'};return _0x48802a;}})});}_0x466216=_[_0x6c1c('0x4a')]({},_0x466216,_0x295817[_0x6c1c('0x4c')]);var _0x2d4ced={'where':_0x466216[_0x6c1c('0x47')]};return db[_0x6c1c('0x37')][_0x6c1c('0x25')](_0x2d4ced)[_0x6c1c('0x2c')](function(_0x1c272d){_0x35e8b1[_0x6c1c('0x25')]=_0x1c272d;if(_0x295817[_0x6c1c('0x3e')][_0x6c1c('0x4d')]){_0x466216[_0x6c1c('0x4e')]=[{'all':!![]}];}return db['SmsQueue'][_0x6c1c('0x4f')](_0x466216);})[_0x6c1c('0x2c')](function(_0x551f38){_0x35e8b1['rows']=_0x551f38;return _0x35e8b1;})[_0x6c1c('0x2c')](respondWithFilteredResult(_0x286924,_0x466216))[_0x6c1c('0x50')](handleError(_0x286924,null));};exports['show']=function(_0x3eb686,_0x1bd771){var _0x166226={'raw':!![],'where':{'id':_0x3eb686[_0x6c1c('0x51')]['id']}},_0x24724a={};_0x24724a[_0x6c1c('0x3c')]=_['keys'](db['SmsQueue'][_0x6c1c('0x38')]);_0x24724a['query']=_[_0x6c1c('0x3f')](_0x3eb686[_0x6c1c('0x3e')]);_0x24724a[_0x6c1c('0x48')]=_[_0x6c1c('0x40')](_0x24724a[_0x6c1c('0x3c')],_0x24724a[_0x6c1c('0x3e')]);_0x166226['attributes']=_[_0x6c1c('0x40')](_0x24724a[_0x6c1c('0x3c')],qs[_0x6c1c('0x42')](_0x3eb686[_0x6c1c('0x3e')][_0x6c1c('0x42')]));_0x166226[_0x6c1c('0x41')]=_0x166226[_0x6c1c('0x41')][_0x6c1c('0x52')]?_0x166226[_0x6c1c('0x41')]:_0x24724a[_0x6c1c('0x3c')];if(_0x3eb686[_0x6c1c('0x3e')]['includeAll']){_0x166226[_0x6c1c('0x4e')]=[{'all':!![]}];}_0x166226=_['merge']({},_0x166226,_0x3eb686[_0x6c1c('0x4c')]);return db[_0x6c1c('0x37')][_0x6c1c('0x53')](_0x166226)['then'](handleEntityNotFound(_0x1bd771,null))[_0x6c1c('0x2c')](respondWithResult(_0x1bd771,null))['catch'](handleError(_0x1bd771,null));};exports['create']=function(_0x242457,_0x5b7ac4){return db[_0x6c1c('0x37')][_0x6c1c('0x54')](_0x242457[_0x6c1c('0x55')],{})[_0x6c1c('0x2c')](function(_0x4c4181){var _0x4f492a=_0x242457['user'][_0x6c1c('0x2e')]({'plain':!![]});if(!_0x4f492a)throw new Error(_0x6c1c('0x56'));if(_0x4f492a[_0x6c1c('0x57')]===_0x6c1c('0x58')){var _0x1cc8eb=_0x4c4181[_0x6c1c('0x2e')]({'plain':!![]});var _0x56e105=_0x6c1c('0x2f');return db[_0x6c1c('0x59')][_0x6c1c('0x53')]({'where':{'name':_0x56e105,'userProfileId':_0x4f492a[_0x6c1c('0x5a')]},'raw':!![]})['then'](function(_0x5a3af7){if(_0x5a3af7&&_0x5a3af7['autoAssociation']===0x0){return db[_0x6c1c('0x30')]['create']({'name':_0x1cc8eb[_0x6c1c('0x34')],'resourceId':_0x1cc8eb['id'],'type':_0x5a3af7[_0x6c1c('0x34')],'sectionId':_0x5a3af7['id']},{})[_0x6c1c('0x2c')](function(){return _0x4c4181;});}else{return _0x4c4181;}})[_0x6c1c('0x50')](function(_0x589af7){logger[_0x6c1c('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x589af7);throw _0x589af7;});}return _0x4c4181;})[_0x6c1c('0x2c')](respondWithResult(_0x5b7ac4,0xc9))['catch'](handleError(_0x5b7ac4,null));};exports['update']=function(_0x53f4ad,_0x1bfdcf){if(_0x53f4ad['body']['id']){delete _0x53f4ad['body']['id'];}return db['SmsQueue'][_0x6c1c('0x53')]({'where':{'id':_0x53f4ad['params']['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0x1bfdcf,null))['then'](saveUpdates(_0x53f4ad[_0x6c1c('0x55')],null))[_0x6c1c('0x2c')](respondWithResult(_0x1bfdcf,null))[_0x6c1c('0x50')](handleError(_0x1bfdcf,null));};exports[_0x6c1c('0x2d')]=function(_0x33d42c,_0x30827f){return db[_0x6c1c('0x37')][_0x6c1c('0x53')]({'where':{'id':_0x33d42c[_0x6c1c('0x51')]['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0x30827f,null))['then'](removeEntity(_0x30827f,null))[_0x6c1c('0x50')](handleError(_0x30827f,null));};exports['describe']=function(_0x5bced6,_0x5bb461){return db[_0x6c1c('0x37')][_0x6c1c('0x5b')]()[_0x6c1c('0x2c')](respondWithResult(_0x5bb461,null))['catch'](handleError(_0x5bb461,null));};exports[_0x6c1c('0x5c')]=function(_0x1bbba,_0x3f1b9b,_0x37b54e){var _0x139af9={'raw':!![],'where':{}},_0xdafd09={},_0x2892b3;return db[_0x6c1c('0x37')][_0x6c1c('0x5d')]({'where':{'id':_0x1bbba['params']['id']}})['then'](handleEntityNotFound(_0x3f1b9b,null))[_0x6c1c('0x2c')](function(_0x14ee27){if(_0x14ee27){_0x2892b3=_0x14ee27[_0x6c1c('0x2e')]({'plain':!![]});_0xdafd09[_0x6c1c('0x3c')]=_['keys'](db[_0x6c1c('0x5e')][_0x6c1c('0x38')]);_0xdafd09[_0x6c1c('0x3e')]=_['keys'](_0x1bbba[_0x6c1c('0x3e')]);_0xdafd09[_0x6c1c('0x48')]=_[_0x6c1c('0x40')](_0xdafd09[_0x6c1c('0x3c')],_0xdafd09['query']);_0x139af9['attributes']=_[_0x6c1c('0x40')](_0xdafd09[_0x6c1c('0x3c')],qs[_0x6c1c('0x42')](_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x42')]));_0x139af9[_0x6c1c('0x41')]=_0x139af9[_0x6c1c('0x41')][_0x6c1c('0x52')]?_0x139af9[_0x6c1c('0x41')]:_0xdafd09[_0x6c1c('0x3c')];if(!_0x1bbba['query'][_0x6c1c('0x43')](_0x6c1c('0x44'))){_0x139af9['limit']=qs[_0x6c1c('0x22')](_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x22')]);_0x139af9[_0x6c1c('0x24')]=qs[_0x6c1c('0x24')](_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x24')]);}_0x139af9['order']=qs[_0x6c1c('0x46')](_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x46')]);_0x139af9[_0x6c1c('0x47')]=qs['filters'](_[_0x6c1c('0x49')](_0x1bbba[_0x6c1c('0x3e')],_0xdafd09[_0x6c1c('0x48')]));_0x139af9['where'][_0x6c1c('0x5f')]=_0x14ee27['id'];if(_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x60')]){_0x139af9['where']=_[_0x6c1c('0x4a')](_0x139af9['where'],{'$or':_[_0x6c1c('0x3d')](_0x139af9['attributes'],function(_0x3a4b0d){var _0x2a4c2f={};_0x2a4c2f[_0x3a4b0d]={'$like':'%'+_0x1bbba[_0x6c1c('0x3e')][_0x6c1c('0x60')]+'%'};return _0x2a4c2f;})});}_0x139af9=_[_0x6c1c('0x4a')]({},_0x139af9,_0x1bbba[_0x6c1c('0x4c')]);return db[_0x6c1c('0x5e')][_0x6c1c('0x4f')](_0x139af9);}})[_0x6c1c('0x2c')](function(_0x1a164d){if(_0x1a164d){return db[_0x6c1c('0x61')]['findAndCountAll']({'where':{'id':_[_0x6c1c('0x3d')](_0x1a164d,'UserId'),'role':_0x6c1c('0x62')},'attributes':['id','name',_0x6c1c('0x63'),_0x6c1c('0x64'),_0x6c1c('0x65')]});}})[_0x6c1c('0x2c')](function(_0x283895){if(_0x283895){return{'count':_0x283895['count'],'rows':_[_0x6c1c('0x3d')](_0x283895[_0x6c1c('0x66')],function(_0x5db515){return{'membername':_0x5db515[_0x6c1c('0x34')],'UserId':_0x5db515['id'],'queue_name':_0x2892b3[_0x6c1c('0x34')],'SmsQueueId':_0x2892b3['id'],'interface':util['format']('%s/%s',_0x6c1c('0x67'),_0x5db515[_0x6c1c('0x34')]),'penalty':0x0,'paused':_0x5db515['smsPause'],'createdAt':_0x5db515[_0x6c1c('0x65')],'updatedAt':_0x5db515[_0x6c1c('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6c1c('0x2c')](respondWithFilteredResult(_0x3f1b9b,_0x139af9))['catch'](handleError(_0x3f1b9b,null));};exports[_0x6c1c('0x68')]=function(_0x40f4d7,_0x2781e2,_0x58d23b){var _0x87a061={};var _0x218adb={};var _0x4a8e96;var _0xcc3fa5;return db['SmsQueue']['findOne']({'where':{'id':_0x40f4d7['params']['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0x2781e2,null))[_0x6c1c('0x2c')](function(_0x4c5b9f){if(_0x4c5b9f){_0x4a8e96=_0x4c5b9f;_0x218adb['model']=_[_0x6c1c('0x3f')](db['Team'][_0x6c1c('0x38')]);_0x218adb[_0x6c1c('0x3e')]=_[_0x6c1c('0x3f')](_0x40f4d7['query']);_0x218adb['filters']=_[_0x6c1c('0x40')](_0x218adb['model'],_0x218adb[_0x6c1c('0x3e')]);_0x87a061[_0x6c1c('0x41')]=_[_0x6c1c('0x40')](_0x218adb[_0x6c1c('0x3c')],qs['fields'](_0x40f4d7[_0x6c1c('0x3e')][_0x6c1c('0x42')]));_0x87a061['attributes']=_0x87a061[_0x6c1c('0x41')][_0x6c1c('0x52')]?_0x87a061[_0x6c1c('0x41')]:_0x218adb[_0x6c1c('0x3c')];_0x87a061[_0x6c1c('0x45')]=qs['sort'](_0x40f4d7['query'][_0x6c1c('0x46')]);_0x87a061[_0x6c1c('0x47')]=qs[_0x6c1c('0x48')](_[_0x6c1c('0x49')](_0x40f4d7[_0x6c1c('0x3e')],_0x218adb[_0x6c1c('0x48')]));if(_0x40f4d7[_0x6c1c('0x3e')][_0x6c1c('0x60')]){_0x87a061['where']=_['merge'](_0x87a061[_0x6c1c('0x47')],{'$or':_[_0x6c1c('0x3d')](_0x87a061[_0x6c1c('0x41')],function(_0x38e053){var _0x5c0bff={};_0x5c0bff[_0x38e053]={'$like':'%'+_0x40f4d7['query'][_0x6c1c('0x60')]+'%'};return _0x5c0bff;})});}_0x87a061=_['merge']({},_0x87a061,_0x40f4d7['options']);return _0x4a8e96['getTeams'](_0x87a061);}})['then'](function(_0x3c7036){if(_0x3c7036){_0xcc3fa5=_0x3c7036['length'];if(!_0x40f4d7[_0x6c1c('0x3e')][_0x6c1c('0x43')](_0x6c1c('0x44'))){_0x87a061[_0x6c1c('0x22')]=qs[_0x6c1c('0x22')](_0x40f4d7['query']['limit']);_0x87a061['offset']=qs['offset'](_0x40f4d7['query']['offset']);}return _0x4a8e96['getTeams'](_0x87a061);}})[_0x6c1c('0x2c')](function(_0x2bfefe){if(_0x2bfefe){return _0x2bfefe?{'count':_0xcc3fa5,'rows':_0x2bfefe}:null;}})[_0x6c1c('0x2c')](respondWithResult(_0x2781e2,null))[_0x6c1c('0x50')](handleError(_0x2781e2,null));};exports[_0x6c1c('0x69')]=function(_0x3fb1dc,_0x35c92c,_0x5432d9){var _0x438c35=_0x3fb1dc['body'][_0x6c1c('0x6a')];return db[_0x6c1c('0x6b')][_0x6c1c('0x4f')]({'where':{'id':_0x438c35},'attributes':['id'],'include':[{'model':db[_0x6c1c('0x61')],'as':_0x6c1c('0x6c'),'attributes':['id','name','online',_0x6c1c('0x6d'),'interface'],'raw':!![]}]})[_0x6c1c('0x2c')](function(_0x48e7af){if(_0x48e7af){var _0x4b4de4=_[_0x6c1c('0x6e')](_0x48e7af,function(_0x42bbd6){var _0x1f1b14=_0x42bbd6[_0x6c1c('0x2e')]({'plain':!![]});return _0x1f1b14['Agents'];});return db[_0x6c1c('0x37')][_0x6c1c('0x53')]({'where':{'id':_0x3fb1dc[_0x6c1c('0x51')]['id']}})['then'](function(_0x5391fd){return db[_0x6c1c('0x6f')][_0x6c1c('0x70')](function(_0x549572){return _0x5391fd[_0x6c1c('0x69')](_0x438c35,{'transaction':_0x549572})[_0x6c1c('0x2c')](function(){return BPromise[_0x6c1c('0x71')](_0x4b4de4,function(_0x3ab8c9){return db['UserSmsQueue'][_0x6c1c('0x72')]({'where':{'UserId':_0x3ab8c9['id'],'SmsQueueId':_0x3fb1dc[_0x6c1c('0x51')]['id']},'transaction':_0x549572});});})[_0x6c1c('0x2c')](function(){_0x4b4de4[_0x6c1c('0x73')](function(_0x5534d9){socket['emit'](_0x6c1c('0x74'),{'UserId':_0x5534d9['id'],'SmsQueueId':_0x5391fd['id']});});});});});}})['then'](respondWithStatusCode(_0x35c92c,null))[_0x6c1c('0x50')](handleError(_0x35c92c,null));};exports[_0x6c1c('0x75')]=function(_0xc9338,_0x2574ce,_0x2d9a3f){return db['Team'][_0x6c1c('0x4f')]({'where':{'id':_0xc9338[_0x6c1c('0x3e')][_0x6c1c('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x6c1c('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6c1c('0x2c')](handleEntityNotFound(_0x2574ce,null))[_0x6c1c('0x2c')](function(_0x128aa3){var _0x56dc2c=_[_0x6c1c('0x3d')](_0x128aa3,'id');var _0x2fd4df=[];var _0x505232=[];var _0x2b8e4e=squel['select']();_0x2b8e4e['field'](_0x6c1c('0x76'))[_0x6c1c('0x77')](_0x6c1c('0x78'),'tq')[_0x6c1c('0x79')](_0x6c1c('0x7a'),'ut',_0x6c1c('0x7b'))['where'](_0x6c1c('0x7c'),_0xc9338[_0x6c1c('0x51')]['id']);for(var _0x38786b=0x0;_0x38786b<_0x128aa3['length'];_0x38786b+=0x1){let _0x75ae53=_0x128aa3[_0x38786b];for(var _0x13429b=0x0;_0x13429b<_0x75ae53[_0x6c1c('0x6c')][_0x6c1c('0x52')];_0x13429b+=0x1){let _0x3e19ba=_0x75ae53[_0x6c1c('0x6c')][_0x13429b];var _0x30ddb7=_0x2b8e4e[_0x6c1c('0x7d')]();_0x30ddb7[_0x6c1c('0x47')](_0x6c1c('0x7e'),_0x3e19ba['id']);_0x505232['push'](db[_0x6c1c('0x6f')][_0x6c1c('0x3e')](_0x30ddb7['toString'](),{'type':db[_0x6c1c('0x6f')][_0x6c1c('0x7f')][_0x6c1c('0x80')]})[_0x6c1c('0x2c')](function(_0x205991){if(_0x205991[_0x6c1c('0x52')]===0x1){return _0x3e19ba['id'];}else{var _0x5ea13a=_[_0x6c1c('0x81')](_['map'](_0x205991,_0x6c1c('0x82')),function(_0x369f8e){return _[_0x6c1c('0x83')](_0x56dc2c,_0x369f8e);});if(_0x5ea13a){return _0x3e19ba['id'];}}}));}}return BPromise[_0x6c1c('0x84')](_0x505232)[_0x6c1c('0x2c')](function(_0x5688c7){_0x2fd4df=_(_0x2fd4df)['union'](_0x5688c7)[_0x6c1c('0x85')]()['value']();return db[_0x6c1c('0x37')]['find']({'where':{'id':_0xc9338[_0x6c1c('0x51')]['id']}})['then'](function(_0x1f9fa2){return db['sequelize']['transaction'](function(_0x5b09d8){return _0x1f9fa2[_0x6c1c('0x75')](_0xc9338[_0x6c1c('0x3e')][_0x6c1c('0x6a')],{'transaction':_0x5b09d8})['then'](function(){if(!_[_0x6c1c('0x86')](_0x2fd4df)){return _0x1f9fa2[_0x6c1c('0x87')](_0x2fd4df,{'transaction':_0x5b09d8});}})[_0x6c1c('0x2c')](function(){_0x2fd4df[_0x6c1c('0x73')](function(_0x1f4e84){socket[_0x6c1c('0x88')](_0x6c1c('0x89'),{'UserId':_0x1f4e84,'SmsQueueId':_0x1f9fa2['id']});});});});});});})[_0x6c1c('0x2c')](respondWithStatusCode(_0x2574ce,null))[_0x6c1c('0x50')](handleError(_0x2574ce,null));};exports[_0x6c1c('0x8a')]=function(_0x496a96,_0x5a4e41,_0x595a62){return db[_0x6c1c('0x37')]['find']({'where':{'id':_0x496a96['params']['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0x5a4e41,null))[_0x6c1c('0x2c')](function(_0x5c85d3){if(_0x5c85d3){return _0x5c85d3[_0x6c1c('0x8a')](_0x496a96['body'][_0x6c1c('0x6a')],_[_0x6c1c('0x8b')](_0x496a96[_0x6c1c('0x55')],[_0x6c1c('0x6a'),'id'])||{})[_0x6c1c('0x8c')](function(_0x96737d){for(var _0x17a48d=0x0;_0x17a48d<_0x496a96[_0x6c1c('0x55')][_0x6c1c('0x6a')][_0x6c1c('0x52')];_0x17a48d+=0x1){socket[_0x6c1c('0x88')](_0x6c1c('0x74'),{'UserId':Number(_0x496a96[_0x6c1c('0x55')]['ids'][_0x17a48d]),'SmsQueueId':Number(_0x496a96[_0x6c1c('0x51')]['id'])});}return _0x96737d;});}})['then'](respondWithResult(_0x5a4e41,null))[_0x6c1c('0x50')](handleError(_0x5a4e41,null));};exports[_0x6c1c('0x87')]=function(_0x44b9ba,_0x44c9ae,_0x248e82){return db[_0x6c1c('0x37')][_0x6c1c('0x53')]({'where':{'id':_0x44b9ba['params']['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0x44c9ae,null))[_0x6c1c('0x2c')](function(_0x3f6e61){if(_0x3f6e61){return _0x3f6e61[_0x6c1c('0x87')](_0x44b9ba[_0x6c1c('0x3e')][_0x6c1c('0x6a')])[_0x6c1c('0x2c')](function(){if(_[_0x6c1c('0x8d')](_0x44b9ba[_0x6c1c('0x3e')][_0x6c1c('0x6a')])){for(var _0x2295d3=0x0;_0x2295d3<_0x44b9ba['query'][_0x6c1c('0x6a')][_0x6c1c('0x52')];_0x2295d3+=0x1){socket[_0x6c1c('0x88')](_0x6c1c('0x89'),{'UserId':Number(_0x44b9ba[_0x6c1c('0x3e')][_0x6c1c('0x6a')][_0x2295d3]),'SmsQueueId':Number(_0x44b9ba[_0x6c1c('0x51')]['id'])});}}else{socket[_0x6c1c('0x88')](_0x6c1c('0x89'),{'UserId':Number(_0x44b9ba[_0x6c1c('0x3e')]['ids']),'SmsQueueId':Number(_0x44b9ba['params']['id'])});}});}})[_0x6c1c('0x2c')](respondWithStatusCode(_0x44c9ae,null))['catch'](handleError(_0x44c9ae,null));};exports[_0x6c1c('0x8e')]=function(_0x510e55,_0xd2c536,_0x1088e9){var _0x600dd4={};var _0x41b1a4={};var _0x502270;var _0x393c2c;return db[_0x6c1c('0x37')][_0x6c1c('0x5d')]({'where':{'id':_0x510e55['params']['id']}})[_0x6c1c('0x2c')](handleEntityNotFound(_0xd2c536,null))[_0x6c1c('0x2c')](function(_0x3456f8){if(_0x3456f8){_0x502270=_0x3456f8;_0x41b1a4[_0x6c1c('0x3c')]=_[_0x6c1c('0x3f')](db[_0x6c1c('0x61')][_0x6c1c('0x38')]);_0x41b1a4[_0x6c1c('0x3e')]=_['keys'](_0x510e55['query']);_0x41b1a4[_0x6c1c('0x48')]=_[_0x6c1c('0x40')](_0x41b1a4[_0x6c1c('0x3c')],_0x41b1a4[_0x6c1c('0x3e')]);_0x600dd4[_0x6c1c('0x41')]=_[_0x6c1c('0x40')](_0x41b1a4[_0x6c1c('0x3c')],qs[_0x6c1c('0x42')](_0x510e55[_0x6c1c('0x3e')][_0x6c1c('0x42')]));_0x600dd4[_0x6c1c('0x41')]=_0x600dd4[_0x6c1c('0x41')][_0x6c1c('0x52')]?_0x600dd4['attributes']:_0x41b1a4[_0x6c1c('0x3c')];_0x600dd4[_0x6c1c('0x45')]=qs[_0x6c1c('0x46')](_0x510e55[_0x6c1c('0x3e')][_0x6c1c('0x46')]);_0x600dd4[_0x6c1c('0x47')]=qs[_0x6c1c('0x48')](_[_0x6c1c('0x49')](_0x510e55[_0x6c1c('0x3e')],_0x41b1a4[_0x6c1c('0x48')]));if(_0x510e55[_0x6c1c('0x3e')][_0x6c1c('0x60')]){_0x600dd4[_0x6c1c('0x47')]=_[_0x6c1c('0x4a')](_0x600dd4[_0x6c1c('0x47')],{'$or':_[_0x6c1c('0x3d')](_0x600dd4['attributes'],function(_0x12bba9){var _0x2f4baa={};_0x2f4baa[_0x12bba9]={'$like':'%'+_0x510e55['query']['filter']+'%'};return _0x2f4baa;})});}_0x600dd4=_[_0x6c1c('0x4a')]({},_0x600dd4,_0x510e55[_0x6c1c('0x4c')]);return _0x502270[_0x6c1c('0x8e')](_0x600dd4);}})[_0x6c1c('0x2c')](function(_0x23dfe7){if(_0x23dfe7){_0x393c2c=_0x23dfe7[_0x6c1c('0x52')];if(!_0x510e55['query'][_0x6c1c('0x43')](_0x6c1c('0x44'))){_0x600dd4[_0x6c1c('0x22')]=qs[_0x6c1c('0x22')](_0x510e55[_0x6c1c('0x3e')][_0x6c1c('0x22')]);_0x600dd4[_0x6c1c('0x24')]=qs[_0x6c1c('0x24')](_0x510e55[_0x6c1c('0x3e')][_0x6c1c('0x24')]);}return _0x502270[_0x6c1c('0x8e')](_0x600dd4);}})['then'](function(_0x428701){if(_0x428701){return _0x428701?{'count':_0x393c2c,'rows':_0x428701}:null;}})[_0x6c1c('0x2c')](respondWithResult(_0xd2c536,null))[_0x6c1c('0x50')](handleError(_0xd2c536,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d9fd495..d1e6454 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 _0x1aba=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x55021f,_0x23906c){var _0x3ced14=function(_0x1f7285){while(--_0x1f7285){_0x55021f['push'](_0x55021f['shift']());}};_0x3ced14(++_0x23906c);}(_0x1aba,0xf8));var _0xa1ab=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1aba[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require(_0xa1ab('0x0'));var SmsQueue=require(_0xa1ab('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa1ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1ab('0x3'),'afterDestroy':_0xa1ab('0x4')};function emitEvent(_0x26d278){return function(_0x508e17,_0x9ad11d,_0x1e5591){SmsQueueEvents[_0xa1ab('0x5')](_0x26d278+':'+_0x508e17['id'],_0x508e17);SmsQueueEvents['emit'](_0x26d278,_0x508e17);_0x1e5591(null);};}for(var e in events){if(events[_0xa1ab('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xa1ab('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x1151=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x1151,0x1c8));var _0x1115=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x1151[_0x19d24c];return _0x2fae8d;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x1115('0x0'))['db'][_0x1115('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1115('0x2')](0x0);var events={'afterCreate':_0x1115('0x3'),'afterUpdate':'update','afterDestroy':_0x1115('0x4')};function emitEvent(_0x50b16e){return function(_0x201fa3,_0x355923,_0xb982b3){SmsQueueEvents[_0x1115('0x5')](_0x50b16e+':'+_0x201fa3['id'],_0x201fa3);SmsQueueEvents[_0x1115('0x5')](_0x50b16e,_0x201fa3);_0xb982b3(null);};}for(var e in events){if(events[_0x1115('0x6')](e)){var event=events[e];SmsQueue[_0x1115('0x7')](e,emitEvent(event));}}module[_0x1115('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 71befec..89434d2 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 _0x3884=['bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x3884,0x183));var _0x4388=function(_0x2ed88f,_0x5bc5ae){_0x2ed88f=_0x2ed88f-0x0;var _0x17ca96=_0x3884[_0x2ed88f];return _0x17ca96;};'use strict';var _=require(_0x4388('0x0'));var util=require(_0x4388('0x1'));var logger=require(_0x4388('0x2'))(_0x4388('0x3'));var moment=require(_0x4388('0x4'));var BPromise=require(_0x4388('0x5'));var rp=require(_0x4388('0x6'));var fs=require('fs');var path=require(_0x4388('0x7'));var rimraf=require(_0x4388('0x8'));var config=require(_0x4388('0x9'));var attributes=require(_0x4388('0xa'));module[_0x4388('0xb')]=function(_0x2c0850,_0x4d7398){return _0x2c0850['define'](_0x4388('0xc'),attributes,{'tableName':_0x4388('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','../../config/logger'];(function(_0x2b7b75,_0x2f35f8){var _0x405a1d=function(_0x28f993){while(--_0x28f993){_0x2b7b75['push'](_0x2b7b75['shift']());}};_0x405a1d(++_0x2f35f8);}(_0x75fb,0xa6));var _0xb75f=function(_0x578b84,_0x38fedb){_0x578b84=_0x578b84-0x0;var _0x12860a=_0x75fb[_0x578b84];return _0x12860a;};'use strict';var _=require(_0xb75f('0x0'));var util=require(_0xb75f('0x1'));var logger=require(_0xb75f('0x2'))('api');var moment=require(_0xb75f('0x3'));var BPromise=require(_0xb75f('0x4'));var rp=require(_0xb75f('0x5'));var fs=require('fs');var path=require(_0xb75f('0x6'));var rimraf=require(_0xb75f('0x7'));var config=require(_0xb75f('0x8'));var attributes=require(_0xb75f('0x9'));module['exports']=function(_0x421d7b,_0x52c5a0){return _0x421d7b[_0xb75f('0xa')](_0xb75f('0xb'),attributes,{'tableName':_0xb75f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 44561fe..8fba40a 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 _0x83b5=['debug','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','where','attributes','include','model','then','raw','map','ShowSmsQueue','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info'];(function(_0x4fec33,_0x25a458){var _0x5bac25=function(_0x353686){while(--_0x353686){_0x4fec33['push'](_0x4fec33['shift']());}};_0x5bac25(++_0x25a458);}(_0x83b5,0xd2));var _0x583b=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x83b5[_0x58d5ac];return _0x37985c;};'use strict';var _=require('lodash');var util=require(_0x583b('0x0'));var moment=require(_0x583b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x583b('0x2'));var db=require(_0x583b('0x3'))['db'];var utils=require(_0x583b('0x4'));var logger=require(_0x583b('0x5'))(_0x583b('0x6'));var config=require(_0x583b('0x7'));var jayson=require(_0x583b('0x8'));var client=jayson['client'][_0x583b('0x9')]({'port':0x232a});config[_0x583b('0xa')]=_[_0x583b('0xb')](config[_0x583b('0xa')],{'host':_0x583b('0xc'),'port':0x18eb});var socket=require(_0x583b('0xd'))(new Redis(config['redis']));require(_0x583b('0xe'))[_0x583b('0xf')](socket);function respondWithRpcPromise(_0xcdda0f,_0x2dcd88,_0x3a5873){return new BPromise(function(_0x2269b2,_0x472acf){return client[_0x583b('0x10')](_0xcdda0f,_0x3a5873)['then'](function(_0x19e2ea){logger[_0x583b('0x11')]('SmsQueue,\x20%s,\x20%s',_0x2dcd88,'request\x20sent');logger[_0x583b('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2dcd88,'request\x20sent',JSON[_0x583b('0x13')](_0x19e2ea));if(_0x19e2ea[_0x583b('0x14')]){if(_0x19e2ea[_0x583b('0x14')][_0x583b('0x15')]===0x1f4){logger[_0x583b('0x14')](_0x583b('0x16'),_0x2dcd88,_0x19e2ea[_0x583b('0x14')][_0x583b('0x17')]);return _0x472acf(_0x19e2ea[_0x583b('0x14')][_0x583b('0x17')]);}logger[_0x583b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2dcd88,_0x19e2ea[_0x583b('0x14')][_0x583b('0x17')]);return _0x2269b2(_0x19e2ea['error'][_0x583b('0x17')]);}else{logger[_0x583b('0x11')]('SmsQueue,\x20%s,\x20%s',_0x2dcd88,_0x583b('0x18'));_0x2269b2(_0x19e2ea[_0x583b('0x19')][_0x583b('0x17')]);}})[_0x583b('0x1a')](function(_0x426c4e){logger['error'](_0x583b('0x16'),_0x2dcd88,_0x426c4e);_0x472acf(_0x426c4e);});});}exports[_0x583b('0x1b')]=function(_0x1efd44){var _0x58c8fb=this;return new Promise(function(_0x23d7ae,_0x5286e6){return db[_0x583b('0x1c')]['findAll']({'raw':_0x1efd44[_0x583b('0x1d')]?_0x1efd44[_0x583b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1efd44[_0x583b('0x1d')]?_0x1efd44[_0x583b('0x1d')][_0x583b('0x1e')]||null:null,'attributes':_0x1efd44['options']?_0x1efd44['options'][_0x583b('0x1f')]||null:null,'limit':_0x1efd44[_0x583b('0x1d')]?_0x1efd44[_0x583b('0x1d')]['limit']||null:null,'include':_0x1efd44['options']?_0x1efd44['options'][_0x583b('0x20')]?_['map'](_0x1efd44['options'][_0x583b('0x20')],function(_0x47bfdc){return{'model':db[_0x47bfdc['model']],'as':_0x47bfdc['as'],'attributes':_0x47bfdc[_0x583b('0x1f')],'include':_0x47bfdc[_0x583b('0x20')]?_['map'](_0x47bfdc['include'],function(_0x17e19c){return{'model':db[_0x17e19c[_0x583b('0x21')]],'as':_0x17e19c['as'],'attributes':_0x17e19c[_0x583b('0x1f')],'include':_0x17e19c[_0x583b('0x20')]?_['map'](_0x17e19c[_0x583b('0x20')],function(_0x34b680){return{'model':db[_0x34b680[_0x583b('0x21')]],'as':_0x34b680['as'],'attributes':_0x34b680['attributes']};}):[]};}):[]};}):[]:[]})[_0x583b('0x22')](function(_0x42dcc4){logger[_0x583b('0x11')](_0x583b('0x1b'),_0x1efd44);logger[_0x583b('0x12')](_0x583b('0x1b'),_0x1efd44,JSON[_0x583b('0x13')](_0x42dcc4));_0x23d7ae(_0x42dcc4);})['catch'](function(_0x5cecbe){logger[_0x583b('0x14')](_0x583b('0x1b'),_0x5cecbe[_0x583b('0x17')],_0x1efd44);_0x5286e6(_0x58c8fb[_0x583b('0x14')](0x1f4,_0x5cecbe[_0x583b('0x17')]));});});};exports['ShowSmsQueue']=function(_0xb1d2db){var _0x6008c4=this;return new Promise(function(_0x35fc23,_0x13c4ab){return db['SmsQueue']['find']({'raw':_0xb1d2db[_0x583b('0x1d')]?_0xb1d2db[_0x583b('0x1d')][_0x583b('0x23')]===undefined?!![]:![]:!![],'where':_0xb1d2db[_0x583b('0x1d')]?_0xb1d2db[_0x583b('0x1d')]['where']||null:null,'attributes':_0xb1d2db[_0x583b('0x1d')]?_0xb1d2db[_0x583b('0x1d')]['attributes']||null:null,'include':_0xb1d2db[_0x583b('0x1d')]?_0xb1d2db['options'][_0x583b('0x20')]?_[_0x583b('0x24')](_0xb1d2db[_0x583b('0x1d')]['include'],function(_0x2effa8){return{'model':db[_0x2effa8[_0x583b('0x21')]],'as':_0x2effa8['as'],'attributes':_0x2effa8[_0x583b('0x1f')],'include':_0x2effa8['include']?_[_0x583b('0x24')](_0x2effa8[_0x583b('0x20')],function(_0x1ce760){return{'model':db[_0x1ce760[_0x583b('0x21')]],'as':_0x1ce760['as'],'attributes':_0x1ce760[_0x583b('0x1f')],'include':_0x1ce760[_0x583b('0x20')]?_[_0x583b('0x24')](_0x1ce760['include'],function(_0xc032ef){return{'model':db[_0xc032ef['model']],'as':_0xc032ef['as'],'attributes':_0xc032ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x583b('0x22')](function(_0x4ae334){logger['info'](_0x583b('0x25'),_0xb1d2db);logger[_0x583b('0x12')]('ShowSmsQueue',_0xb1d2db,JSON[_0x583b('0x13')](_0x4ae334));_0x35fc23(_0x4ae334);})[_0x583b('0x1a')](function(_0x8499a9){logger['error'](_0x583b('0x25'),_0x8499a9[_0x583b('0x17')],_0xb1d2db);_0x13c4ab(_0x6008c4[_0x583b('0x14')](0x1f4,_0x8499a9[_0x583b('0x17')]));});});}; \ No newline at end of file +var _0x1715=['map','model','then','find','raw','ShowSmsQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include'];(function(_0x581563,_0x407574){var _0x4db579=function(_0x2f978f){while(--_0x2f978f){_0x581563['push'](_0x581563['shift']());}};_0x4db579(++_0x407574);}(_0x1715,0x110));var _0x5171=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1715[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5171('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5171('0x1'));var rs=require(_0x5171('0x2'));var fs=require('fs');var Redis=require(_0x5171('0x3'));var db=require(_0x5171('0x4'))['db'];var utils=require(_0x5171('0x5'));var logger=require(_0x5171('0x6'))(_0x5171('0x7'));var config=require(_0x5171('0x8'));var jayson=require(_0x5171('0x9'));var client=jayson['client'][_0x5171('0xa')]({'port':0x232a});config[_0x5171('0xb')]=_[_0x5171('0xc')](config[_0x5171('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5171('0xd'))(new Redis(config[_0x5171('0xb')]));require(_0x5171('0xe'))['register'](socket);function respondWithRpcPromise(_0x18dab4,_0x2a73e8,_0x7a83f0){return new BPromise(function(_0x50e65c,_0x3eecd2){return client['request'](_0x18dab4,_0x7a83f0)['then'](function(_0x6ee15c){logger['info'](_0x5171('0xf'),_0x2a73e8,_0x5171('0x10'));logger[_0x5171('0x11')](_0x5171('0x12'),_0x2a73e8,'request\x20sent',JSON[_0x5171('0x13')](_0x6ee15c));if(_0x6ee15c[_0x5171('0x14')]){if(_0x6ee15c[_0x5171('0x14')][_0x5171('0x15')]===0x1f4){logger[_0x5171('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2a73e8,_0x6ee15c[_0x5171('0x14')][_0x5171('0x16')]);return _0x3eecd2(_0x6ee15c['error'][_0x5171('0x16')]);}logger[_0x5171('0x14')](_0x5171('0xf'),_0x2a73e8,_0x6ee15c[_0x5171('0x14')][_0x5171('0x16')]);return _0x50e65c(_0x6ee15c[_0x5171('0x14')][_0x5171('0x16')]);}else{logger[_0x5171('0x17')](_0x5171('0xf'),_0x2a73e8,_0x5171('0x10'));_0x50e65c(_0x6ee15c['result'][_0x5171('0x16')]);}})[_0x5171('0x18')](function(_0xdc806f){logger[_0x5171('0x14')](_0x5171('0xf'),_0x2a73e8,_0xdc806f);_0x3eecd2(_0xdc806f);});});}exports[_0x5171('0x19')]=function(_0x5b4791){var _0xcf06b=this;return new Promise(function(_0x4569e9,_0x12c77c){return db[_0x5171('0x1a')][_0x5171('0x1b')]({'raw':_0x5b4791[_0x5171('0x1c')]?_0x5b4791[_0x5171('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5b4791[_0x5171('0x1c')]?_0x5b4791[_0x5171('0x1c')][_0x5171('0x1d')]||null:null,'attributes':_0x5b4791[_0x5171('0x1c')]?_0x5b4791['options'][_0x5171('0x1e')]||null:null,'limit':_0x5b4791[_0x5171('0x1c')]?_0x5b4791['options']['limit']||null:null,'include':_0x5b4791[_0x5171('0x1c')]?_0x5b4791[_0x5171('0x1c')][_0x5171('0x1f')]?_[_0x5171('0x20')](_0x5b4791[_0x5171('0x1c')][_0x5171('0x1f')],function(_0x4ee447){return{'model':db[_0x4ee447[_0x5171('0x21')]],'as':_0x4ee447['as'],'attributes':_0x4ee447[_0x5171('0x1e')],'include':_0x4ee447[_0x5171('0x1f')]?_[_0x5171('0x20')](_0x4ee447['include'],function(_0x5daee1){return{'model':db[_0x5daee1[_0x5171('0x21')]],'as':_0x5daee1['as'],'attributes':_0x5daee1[_0x5171('0x1e')],'include':_0x5daee1[_0x5171('0x1f')]?_[_0x5171('0x20')](_0x5daee1[_0x5171('0x1f')],function(_0x446bad){return{'model':db[_0x446bad[_0x5171('0x21')]],'as':_0x446bad['as'],'attributes':_0x446bad[_0x5171('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5171('0x22')](function(_0xa06445){logger[_0x5171('0x17')](_0x5171('0x19'),_0x5b4791);logger[_0x5171('0x11')](_0x5171('0x19'),_0x5b4791,JSON['stringify'](_0xa06445));_0x4569e9(_0xa06445);})['catch'](function(_0x4071ac){logger[_0x5171('0x14')](_0x5171('0x19'),_0x4071ac['message'],_0x5b4791);_0x12c77c(_0xcf06b[_0x5171('0x14')](0x1f4,_0x4071ac[_0x5171('0x16')]));});});};exports['ShowSmsQueue']=function(_0x3cbdad){var _0x6827b6=this;return new Promise(function(_0x9cf4c,_0x158f4b){return db['SmsQueue'][_0x5171('0x23')]({'raw':_0x3cbdad[_0x5171('0x1c')]?_0x3cbdad[_0x5171('0x1c')][_0x5171('0x24')]===undefined?!![]:![]:!![],'where':_0x3cbdad[_0x5171('0x1c')]?_0x3cbdad['options'][_0x5171('0x1d')]||null:null,'attributes':_0x3cbdad[_0x5171('0x1c')]?_0x3cbdad[_0x5171('0x1c')]['attributes']||null:null,'include':_0x3cbdad['options']?_0x3cbdad[_0x5171('0x1c')][_0x5171('0x1f')]?_[_0x5171('0x20')](_0x3cbdad[_0x5171('0x1c')]['include'],function(_0x201249){return{'model':db[_0x201249[_0x5171('0x21')]],'as':_0x201249['as'],'attributes':_0x201249[_0x5171('0x1e')],'include':_0x201249['include']?_[_0x5171('0x20')](_0x201249[_0x5171('0x1f')],function(_0x5b5c82){return{'model':db[_0x5b5c82[_0x5171('0x21')]],'as':_0x5b5c82['as'],'attributes':_0x5b5c82[_0x5171('0x1e')],'include':_0x5b5c82[_0x5171('0x1f')]?_[_0x5171('0x20')](_0x5b5c82[_0x5171('0x1f')],function(_0x57b234){return{'model':db[_0x57b234['model']],'as':_0x57b234['as'],'attributes':_0x57b234[_0x5171('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5171('0x22')](function(_0x779998){logger[_0x5171('0x17')](_0x5171('0x25'),_0x3cbdad);logger[_0x5171('0x11')]('ShowSmsQueue',_0x3cbdad,JSON['stringify'](_0x779998));_0x9cf4c(_0x779998);})[_0x5171('0x18')](function(_0x56dec1){logger[_0x5171('0x14')](_0x5171('0x25'),_0x56dec1['message'],_0x3cbdad);_0x158f4b(_0x6827b6[_0x5171('0x14')](0x1f4,_0x56dec1[_0x5171('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f39d409..10c7c5a 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 _0x6ccf=['save','update','removeListener','register','smsQueue:','./smsQueue.events'];(function(_0x5b21a2,_0x2c6461){var _0x57166b=function(_0x2c0c1a){while(--_0x2c0c1a){_0x5b21a2['push'](_0x5b21a2['shift']());}};_0x57166b(++_0x2c6461);}(_0x6ccf,0xf5));var _0xf6cc=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x6ccf[_0x166e96];return _0x553d73;};'use strict';var SmsQueueEvents=require(_0xf6cc('0x0'));var events=[_0xf6cc('0x1'),'remove',_0xf6cc('0x2')];function createListener(_0x4dc3f3,_0x45416c){return function(_0x3148dc){_0x45416c['emit'](_0x4dc3f3,_0x3148dc);};}function removeListener(_0xf526b2,_0xd45b93){return function(){SmsQueueEvents[_0xf6cc('0x3')](_0xf526b2,_0xd45b93);};}exports[_0xf6cc('0x4')]=function(_0x53cbe5){for(var _0x2c2b2c=0x0,_0x34b0b5=events['length'];_0x2c2b2c<_0x34b0b5;_0x2c2b2c++){var _0x4f47f2=events[_0x2c2b2c];var _0x14bb15=createListener(_0xf6cc('0x5')+_0x4f47f2,_0x53cbe5);SmsQueueEvents['on'](_0x4f47f2,_0x14bb15);}}; \ No newline at end of file +var _0x400a=['length','smsQueue:','save','remove','update','emit','removeListener','register'];(function(_0x1c5baf,_0x213a0b){var _0x33f8ae=function(_0x2ad6ba){while(--_0x2ad6ba){_0x1c5baf['push'](_0x1c5baf['shift']());}};_0x33f8ae(++_0x213a0b);}(_0x400a,0x142));var _0xa400=function(_0x28f1ee,_0x396bb7){_0x28f1ee=_0x28f1ee-0x0;var _0x329b53=_0x400a[_0x28f1ee];return _0x329b53;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa400('0x0'),_0xa400('0x1'),_0xa400('0x2')];function createListener(_0x5bbd39,_0x4fa44c){return function(_0x502315){_0x4fa44c[_0xa400('0x3')](_0x5bbd39,_0x502315);};}function removeListener(_0x422e41,_0x47094c){return function(){SmsQueueEvents[_0xa400('0x4')](_0x422e41,_0x47094c);};}exports[_0xa400('0x5')]=function(_0x2c955c){for(var _0xd324b2=0x0,_0x5a4d31=events[_0xa400('0x6')];_0xd324b2<_0x5a4d31;_0xd324b2++){var _0x52c9dd=events[_0xd324b2];var _0x461540=createListener(_0xa400('0x7')+_0x52c9dd,_0x2c955c);SmsQueueEvents['on'](_0x52c9dd,_0x461540);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 6fb909b..b8c87be 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 _0xbc00=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc00,0x107));var _0x0bc0=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xbc00[_0x15c421];return _0x5e5ed5;};'use strict';var multer=require(_0x0bc0('0x0'));var util=require(_0x0bc0('0x1'));var path=require('path');var timeout=require(_0x0bc0('0x2'));var express=require('express');var router=express[_0x0bc0('0x3')]();var fs_extra=require(_0x0bc0('0x4'));var auth=require(_0x0bc0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bc0('0x6'));var controller=require(_0x0bc0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0bc0('0x8')]);router[_0x0bc0('0x9')](_0x0bc0('0xa'),auth[_0x0bc0('0xb')](),controller[_0x0bc0('0xc')]);router[_0x0bc0('0x9')](_0x0bc0('0xd'),auth[_0x0bc0('0xb')](),controller[_0x0bc0('0xe')]);router['post']('/',auth[_0x0bc0('0xb')](),controller['create']);router[_0x0bc0('0xf')](_0x0bc0('0xd'),auth[_0x0bc0('0xb')](),controller[_0x0bc0('0x10')]);router[_0x0bc0('0x11')](_0x0bc0('0xd'),auth[_0x0bc0('0xb')](),controller['destroy']);module[_0x0bc0('0x12')]=router; \ No newline at end of file +var _0xd338=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','show','post','create','/:id','update','destroy','exports','multer','path','Router','fs-extra'];(function(_0x4d08b0,_0xaedab0){var _0x2b0c11=function(_0x38e359){while(--_0x38e359){_0x4d08b0['push'](_0x4d08b0['shift']());}};_0x2b0c11(++_0xaedab0);}(_0xd338,0x1f4));var _0x8d33=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0xd338[_0x5b36bd];return _0x1614fe;};'use strict';var multer=require(_0x8d33('0x0'));var util=require('util');var path=require(_0x8d33('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d33('0x2')]();var fs_extra=require(_0x8d33('0x3'));var auth=require(_0x8d33('0x4'));var interaction=require(_0x8d33('0x5'));var config=require(_0x8d33('0x6'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x8d33('0x7')](),controller['index']);router['get'](_0x8d33('0x8'),auth[_0x8d33('0x7')](),controller[_0x8d33('0x9')]);router[_0x8d33('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8d33('0xb')]);router[_0x8d33('0xc')]('/',auth[_0x8d33('0x7')](),controller[_0x8d33('0xd')]);router['put'](_0x8d33('0xe'),auth[_0x8d33('0x7')](),controller[_0x8d33('0xf')]);router['delete'](_0x8d33('0xe'),auth[_0x8d33('0x7')](),controller[_0x8d33('0x10')]);module[_0x8d33('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 41593e8..62b93cb 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 _0xda8b=['STRING','DATE','moment','sequelize'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0xda8b,0x96));var _0xbda8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xda8b[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0xbda8('0x0'));var Sequelize=require(_0xbda8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbda8('0x2')]},'joinAt':{'type':Sequelize[_0xbda8('0x3')]},'leaveAt':{'type':Sequelize[_0xbda8('0x3')]},'acceptAt':{'type':Sequelize[_0xbda8('0x3')]},'exitAt':{'type':Sequelize[_0xbda8('0x3')]},'reason':{'type':Sequelize[_0xbda8('0x2')]}}; \ No newline at end of file +var _0x4b0b=['exports','STRING','DATE','moment','sequelize'];(function(_0xcae309,_0x3ba9d2){var _0x2e4f96=function(_0x264491){while(--_0x264491){_0xcae309['push'](_0xcae309['shift']());}};_0x2e4f96(++_0x3ba9d2);}(_0x4b0b,0x94));var _0xb4b0=function(_0x5cec78,_0x2b87dc){_0x5cec78=_0x5cec78-0x0;var _0x5c63a9=_0x4b0b[_0x5cec78];return _0x5c63a9;};'use strict';var moment=require(_0xb4b0('0x0'));var Sequelize=require(_0xb4b0('0x1'));module[_0xb4b0('0x2')]={'uniqueid':{'type':Sequelize[_0xb4b0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb4b0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb4b0('0x4')]},'exitAt':{'type':Sequelize[_0xb4b0('0x4')]},'reason':{'type':Sequelize[_0xb4b0('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 3026bc0..9a5a955 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 _0x2e5d=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','filters','intersection','attributes','fields','length','query','sort','where','filter','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0xb23c62,_0x40ccce){var _0xec7ab7=function(_0x3a4f00){while(--_0x3a4f00){_0xb23c62['push'](_0xb23c62['shift']());}};_0xec7ab7(++_0x40ccce);}(_0x2e5d,0x11f));var _0xd2e5=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x2e5d[_0x1d30a3];return _0x32bba1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd2e5('0x0'));var jsonpatch=require(_0xd2e5('0x1'));var rp=require(_0xd2e5('0x2'));var moment=require(_0xd2e5('0x3'));var BPromise=require(_0xd2e5('0x4'));var Mustache=require(_0xd2e5('0x5'));var util=require(_0xd2e5('0x6'));var path=require(_0xd2e5('0x7'));var sox=require(_0xd2e5('0x8'));var csv=require(_0xd2e5('0x9'));var ejs=require(_0xd2e5('0xa'));var fs=require('fs');var fs_extra=require(_0xd2e5('0xb'));var _=require(_0xd2e5('0xc'));var squel=require(_0xd2e5('0xd'));var crypto=require(_0xd2e5('0xe'));var jsforce=require(_0xd2e5('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd2e5('0x10'));var Redis=require(_0xd2e5('0x11'));var authService=require(_0xd2e5('0x12'));var qs=require(_0xd2e5('0x13'));var as=require(_0xd2e5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd2e5('0x15'));var config=require(_0xd2e5('0x16'));var licenseUtil=require(_0xd2e5('0x17'));var db=require(_0xd2e5('0x18'))['db'];function respondWithStatusCode(_0x3f26d1,_0x12e9f0){_0x12e9f0=_0x12e9f0||0xcc;return function(_0x2d5c0b){if(_0x2d5c0b){return _0x3f26d1[_0xd2e5('0x19')](_0x12e9f0);}return _0x3f26d1['status'](_0x12e9f0)[_0xd2e5('0x1a')]();};}function respondWithResult(_0x135b6c,_0x1ca6a7){_0x1ca6a7=_0x1ca6a7||0xc8;return function(_0x2e2b53){if(_0x2e2b53){return _0x135b6c[_0xd2e5('0x1b')](_0x1ca6a7)[_0xd2e5('0x1c')](_0x2e2b53);}};}function respondWithFilteredResult(_0x318057,_0x580e6e){return function(_0x49ae62){if(_0x49ae62){var _0x1a2838=typeof _0x580e6e[_0xd2e5('0x1d')]===_0xd2e5('0x1e')&&typeof _0x580e6e['limit']===_0xd2e5('0x1e');var _0x44fc54=_0x49ae62[_0xd2e5('0x1f')];var _0x100ca7=_0x1a2838?0x0:_0x580e6e[_0xd2e5('0x1d')];var _0x13f2a8=_0x1a2838?_0x49ae62['count']:_0x580e6e['offset']+_0x580e6e[_0xd2e5('0x20')];var _0x523f7e;if(_0x13f2a8>=_0x44fc54){_0x13f2a8=_0x44fc54;_0x523f7e=0xc8;}else{_0x523f7e=0xce;}_0x318057[_0xd2e5('0x1b')](_0x523f7e);return _0x318057[_0xd2e5('0x21')](_0xd2e5('0x22'),_0x100ca7+'-'+_0x13f2a8+'/'+_0x44fc54)[_0xd2e5('0x1c')](_0x49ae62);}return null;};}function patchUpdates(_0x1b2ada){return function(_0x35d3e3){try{jsonpatch[_0xd2e5('0x23')](_0x35d3e3,_0x1b2ada,!![]);}catch(_0xb2436e){return BPromise[_0xd2e5('0x24')](_0xb2436e);}return _0x35d3e3[_0xd2e5('0x25')]();};}function saveUpdates(_0x9de1cc,_0x486361){return function(_0x4aed1b){if(_0x4aed1b){return _0x4aed1b[_0xd2e5('0x26')](_0x9de1cc)[_0xd2e5('0x27')](function(_0x4123e6){return _0x4123e6;});}return null;};}function removeEntity(_0x57fd72,_0x1a3b74){return function(_0x5a5f46){if(_0x5a5f46){return _0x5a5f46[_0xd2e5('0x28')]()[_0xd2e5('0x27')](function(){_0x57fd72[_0xd2e5('0x1b')](0xcc)[_0xd2e5('0x1a')]();});}};}function handleEntityNotFound(_0x3eef05,_0x50f9d6){return function(_0x69bb3d){if(!_0x69bb3d){_0x3eef05[_0xd2e5('0x19')](0x194);}return _0x69bb3d;};}function handleError(_0x306467,_0x48f3a1){_0x48f3a1=_0x48f3a1||0x1f4;return function(_0x1f60f3){logger[_0xd2e5('0x29')](_0x1f60f3[_0xd2e5('0x2a')]);if(_0x1f60f3[_0xd2e5('0x2b')]){delete _0x1f60f3[_0xd2e5('0x2b')];}_0x306467['status'](_0x48f3a1)[_0xd2e5('0x2c')](_0x1f60f3);};}exports[_0xd2e5('0x2d')]=function(_0xdbfb3e,_0x2391ab){var _0xf1470a={},_0x4a9bcb={},_0x1c7acf={'count':0x0,'rows':[]};var _0x5984ef=_[_0xd2e5('0x2e')](db['SmsQueueReport'][_0xd2e5('0x2f')],function(_0xc6b90d){return{'name':_0xc6b90d[_0xd2e5('0x30')],'type':_0xc6b90d[_0xd2e5('0x31')]['key']};});_0x4a9bcb[_0xd2e5('0x32')]=_[_0xd2e5('0x2e')](_0x5984ef,_0xd2e5('0x2b'));_0x4a9bcb['query']=_['keys'](_0xdbfb3e['query']);_0x4a9bcb[_0xd2e5('0x33')]=_[_0xd2e5('0x34')](_0x4a9bcb[_0xd2e5('0x32')],_0x4a9bcb['query']);_0xf1470a[_0xd2e5('0x35')]=_[_0xd2e5('0x34')](_0x4a9bcb[_0xd2e5('0x32')],qs[_0xd2e5('0x36')](_0xdbfb3e['query'][_0xd2e5('0x36')]));_0xf1470a['attributes']=_0xf1470a[_0xd2e5('0x35')][_0xd2e5('0x37')]?_0xf1470a[_0xd2e5('0x35')]:_0x4a9bcb['model'];if(!_0xdbfb3e[_0xd2e5('0x38')]['hasOwnProperty']('nolimit')){_0xf1470a[_0xd2e5('0x20')]=qs[_0xd2e5('0x20')](_0xdbfb3e[_0xd2e5('0x38')]['limit']);_0xf1470a[_0xd2e5('0x1d')]=qs[_0xd2e5('0x1d')](_0xdbfb3e['query']['offset']);}_0xf1470a['order']=qs['sort'](_0xdbfb3e[_0xd2e5('0x38')][_0xd2e5('0x39')]);_0xf1470a[_0xd2e5('0x3a')]=qs['filters'](_['pick'](_0xdbfb3e['query'],_0x4a9bcb[_0xd2e5('0x33')]),_0x5984ef);if(_0xdbfb3e[_0xd2e5('0x38')][_0xd2e5('0x3b')]){_0xf1470a[_0xd2e5('0x3a')]=_[_0xd2e5('0x3c')](_0xf1470a[_0xd2e5('0x3a')],{'$or':_[_0xd2e5('0x2e')](_0x5984ef,function(_0x25076d){if(_0x25076d['type']!==_0xd2e5('0x3d')){var _0x12632a={};_0x12632a[_0x25076d[_0xd2e5('0x2b')]]={'$like':'%'+_0xdbfb3e[_0xd2e5('0x38')]['filter']+'%'};return _0x12632a;}})});}_0xf1470a=_['merge']({},_0xf1470a,_0xdbfb3e['options']);var _0x545787={'where':_0xf1470a[_0xd2e5('0x3a')]};return db[_0xd2e5('0x3e')][_0xd2e5('0x1f')](_0x545787)[_0xd2e5('0x27')](function(_0x480271){_0x1c7acf['count']=_0x480271;if(_0xdbfb3e[_0xd2e5('0x38')][_0xd2e5('0x3f')]){_0xf1470a[_0xd2e5('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xd2e5('0x41')](_0xf1470a);})['then'](function(_0x1d7d36){_0x1c7acf[_0xd2e5('0x42')]=_0x1d7d36;return _0x1c7acf;})[_0xd2e5('0x27')](respondWithFilteredResult(_0x2391ab,_0xf1470a))[_0xd2e5('0x43')](handleError(_0x2391ab,null));};exports[_0xd2e5('0x44')]=function(_0xba7434,_0x295d56){var _0x4b058d={'raw':!![],'where':{'id':_0xba7434[_0xd2e5('0x45')]['id']}},_0x1e11c2={};_0x1e11c2[_0xd2e5('0x32')]=_[_0xd2e5('0x46')](db[_0xd2e5('0x3e')][_0xd2e5('0x2f')]);_0x1e11c2['query']=_[_0xd2e5('0x46')](_0xba7434[_0xd2e5('0x38')]);_0x1e11c2['filters']=_[_0xd2e5('0x34')](_0x1e11c2[_0xd2e5('0x32')],_0x1e11c2['query']);_0x4b058d[_0xd2e5('0x35')]=_[_0xd2e5('0x34')](_0x1e11c2[_0xd2e5('0x32')],qs[_0xd2e5('0x36')](_0xba7434[_0xd2e5('0x38')][_0xd2e5('0x36')]));_0x4b058d[_0xd2e5('0x35')]=_0x4b058d[_0xd2e5('0x35')][_0xd2e5('0x37')]?_0x4b058d[_0xd2e5('0x35')]:_0x1e11c2[_0xd2e5('0x32')];if(_0xba7434[_0xd2e5('0x38')][_0xd2e5('0x3f')]){_0x4b058d['include']=[{'all':!![]}];}_0x4b058d=_['merge']({},_0x4b058d,_0xba7434['options']);return db[_0xd2e5('0x3e')][_0xd2e5('0x47')](_0x4b058d)[_0xd2e5('0x27')](handleEntityNotFound(_0x295d56,null))[_0xd2e5('0x27')](respondWithResult(_0x295d56,null))[_0xd2e5('0x43')](handleError(_0x295d56,null));};exports[_0xd2e5('0x48')]=function(_0x3d8439,_0x4ab7ab){return db[_0xd2e5('0x3e')]['create'](_0x3d8439[_0xd2e5('0x49')],{})[_0xd2e5('0x27')](respondWithResult(_0x4ab7ab,0xc9))[_0xd2e5('0x43')](handleError(_0x4ab7ab,null));};exports[_0xd2e5('0x26')]=function(_0x36f746,_0x50cd0a){if(_0x36f746[_0xd2e5('0x49')]['id']){delete _0x36f746[_0xd2e5('0x49')]['id'];}return db[_0xd2e5('0x3e')][_0xd2e5('0x47')]({'where':{'id':_0x36f746[_0xd2e5('0x45')]['id']}})[_0xd2e5('0x27')](handleEntityNotFound(_0x50cd0a,null))[_0xd2e5('0x27')](saveUpdates(_0x36f746[_0xd2e5('0x49')],null))['then'](respondWithResult(_0x50cd0a,null))[_0xd2e5('0x43')](handleError(_0x50cd0a,null));};exports['destroy']=function(_0x120a54,_0x5e8a39){return db['SmsQueueReport'][_0xd2e5('0x47')]({'where':{'id':_0x120a54['params']['id']}})[_0xd2e5('0x27')](handleEntityNotFound(_0x5e8a39,null))['then'](removeEntity(_0x5e8a39,null))[_0xd2e5('0x43')](handleError(_0x5e8a39,null));};exports['describe']=function(_0x4ed28a,_0x1477a1){return db['SmsQueueReport']['describe']()[_0xd2e5('0x27')](respondWithResult(_0x1477a1,null))[_0xd2e5('0x43')](handleError(_0x1477a1,null));}; \ No newline at end of file +var _0x1216=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x4b14bb,_0xe7b4d3){var _0x285200=function(_0x48c1d7){while(--_0x48c1d7){_0x4b14bb['push'](_0x4b14bb['shift']());}};_0x285200(++_0xe7b4d3);}(_0x1216,0x11f));var _0x6121=function(_0x36bab3,_0x19ce33){_0x36bab3=_0x36bab3-0x0;var _0x2d3989=_0x1216[_0x36bab3];return _0x2d3989;};'use strict';var emlformat=require(_0x6121('0x0'));var rimraf=require(_0x6121('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6121('0x2'));var rp=require(_0x6121('0x3'));var moment=require(_0x6121('0x4'));var BPromise=require(_0x6121('0x5'));var Mustache=require(_0x6121('0x6'));var util=require(_0x6121('0x7'));var path=require(_0x6121('0x8'));var sox=require(_0x6121('0x9'));var csv=require(_0x6121('0xa'));var ejs=require(_0x6121('0xb'));var fs=require('fs');var fs_extra=require(_0x6121('0xc'));var _=require('lodash');var squel=require(_0x6121('0xd'));var crypto=require('crypto');var jsforce=require(_0x6121('0xe'));var deskjs=require(_0x6121('0xf'));var toCsv=require(_0x6121('0xa'));var querystring=require(_0x6121('0x10'));var Papa=require(_0x6121('0x11'));var Redis=require(_0x6121('0x12'));var authService=require(_0x6121('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6121('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6121('0x15'))(_0x6121('0x16'));var utils=require(_0x6121('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6121('0x18'))['db'];function respondWithStatusCode(_0xaa49f4,_0x3aa050){_0x3aa050=_0x3aa050||0xcc;return function(_0x27cc7e){if(_0x27cc7e){return _0xaa49f4[_0x6121('0x19')](_0x3aa050);}return _0xaa49f4['status'](_0x3aa050)[_0x6121('0x1a')]();};}function respondWithResult(_0x478f10,_0x4a8572){_0x4a8572=_0x4a8572||0xc8;return function(_0x2d36dc){if(_0x2d36dc){return _0x478f10['status'](_0x4a8572)['json'](_0x2d36dc);}};}function respondWithFilteredResult(_0x54aa74,_0x6a605d){return function(_0x479572){if(_0x479572){var _0x2489f7=typeof _0x6a605d[_0x6121('0x1b')]===_0x6121('0x1c')&&typeof _0x6a605d[_0x6121('0x1d')]===_0x6121('0x1c');var _0x3d6c1d=_0x479572[_0x6121('0x1e')];var _0x1373ed=_0x2489f7?0x0:_0x6a605d[_0x6121('0x1b')];var _0x5565e7=_0x2489f7?_0x479572[_0x6121('0x1e')]:_0x6a605d['offset']+_0x6a605d[_0x6121('0x1d')];var _0x4ffadc;if(_0x5565e7>=_0x3d6c1d){_0x5565e7=_0x3d6c1d;_0x4ffadc=0xc8;}else{_0x4ffadc=0xce;}_0x54aa74[_0x6121('0x1f')](_0x4ffadc);return _0x54aa74['set']('Content-Range',_0x1373ed+'-'+_0x5565e7+'/'+_0x3d6c1d)[_0x6121('0x20')](_0x479572);}return null;};}function patchUpdates(_0x1fb456){return function(_0x23fc89){try{jsonpatch[_0x6121('0x21')](_0x23fc89,_0x1fb456,!![]);}catch(_0x44bcf4){return BPromise[_0x6121('0x22')](_0x44bcf4);}return _0x23fc89[_0x6121('0x23')]();};}function saveUpdates(_0x315490,_0x3d36fa){return function(_0x4b9e4d){if(_0x4b9e4d){return _0x4b9e4d[_0x6121('0x24')](_0x315490)[_0x6121('0x25')](function(_0x3ffadd){return _0x3ffadd;});}return null;};}function removeEntity(_0x3b8e07,_0x1ae772){return function(_0x37f9d7){if(_0x37f9d7){return _0x37f9d7[_0x6121('0x26')]()[_0x6121('0x25')](function(){_0x3b8e07[_0x6121('0x1f')](0xcc)[_0x6121('0x1a')]();});}};}function handleEntityNotFound(_0x36bab3,_0x37aaa9){return function(_0xad5c79){if(!_0xad5c79){_0x36bab3['sendStatus'](0x194);}return _0xad5c79;};}function handleError(_0x1a0412,_0x2dc61d){_0x2dc61d=_0x2dc61d||0x1f4;return function(_0x509f34){logger[_0x6121('0x27')](_0x509f34[_0x6121('0x28')]);if(_0x509f34['name']){delete _0x509f34[_0x6121('0x29')];}_0x1a0412[_0x6121('0x1f')](_0x2dc61d)[_0x6121('0x2a')](_0x509f34);};}exports[_0x6121('0x2b')]=function(_0x44d059,_0xdcb8fa){var _0x297692={},_0x3f4b0a={},_0x595ff5={'count':0x0,'rows':[]};var _0x59900f=_[_0x6121('0x2c')](db[_0x6121('0x2d')][_0x6121('0x2e')],function(_0x2c7fdf){return{'name':_0x2c7fdf[_0x6121('0x2f')],'type':_0x2c7fdf[_0x6121('0x30')][_0x6121('0x31')]};});_0x3f4b0a['model']=_['map'](_0x59900f,_0x6121('0x29'));_0x3f4b0a['query']=_['keys'](_0x44d059['query']);_0x3f4b0a['filters']=_[_0x6121('0x32')](_0x3f4b0a[_0x6121('0x33')],_0x3f4b0a[_0x6121('0x34')]);_0x297692[_0x6121('0x35')]=_['intersection'](_0x3f4b0a[_0x6121('0x33')],qs[_0x6121('0x36')](_0x44d059[_0x6121('0x34')][_0x6121('0x36')]));_0x297692['attributes']=_0x297692[_0x6121('0x35')]['length']?_0x297692[_0x6121('0x35')]:_0x3f4b0a[_0x6121('0x33')];if(!_0x44d059[_0x6121('0x34')][_0x6121('0x37')](_0x6121('0x38'))){_0x297692[_0x6121('0x1d')]=qs[_0x6121('0x1d')](_0x44d059[_0x6121('0x34')][_0x6121('0x1d')]);_0x297692[_0x6121('0x1b')]=qs[_0x6121('0x1b')](_0x44d059[_0x6121('0x34')][_0x6121('0x1b')]);}_0x297692['order']=qs['sort'](_0x44d059['query'][_0x6121('0x39')]);_0x297692[_0x6121('0x3a')]=qs['filters'](_[_0x6121('0x3b')](_0x44d059[_0x6121('0x34')],_0x3f4b0a[_0x6121('0x3c')]),_0x59900f);if(_0x44d059['query'][_0x6121('0x3d')]){_0x297692[_0x6121('0x3a')]=_[_0x6121('0x3e')](_0x297692[_0x6121('0x3a')],{'$or':_['map'](_0x59900f,function(_0x50bb6e){if(_0x50bb6e[_0x6121('0x30')]!==_0x6121('0x3f')){var _0xed3fa5={};_0xed3fa5[_0x50bb6e[_0x6121('0x29')]]={'$like':'%'+_0x44d059[_0x6121('0x34')]['filter']+'%'};return _0xed3fa5;}})});}_0x297692=_[_0x6121('0x3e')]({},_0x297692,_0x44d059[_0x6121('0x40')]);var _0x129894={'where':_0x297692[_0x6121('0x3a')]};return db['SmsQueueReport']['count'](_0x129894)[_0x6121('0x25')](function(_0xdac442){_0x595ff5[_0x6121('0x1e')]=_0xdac442;if(_0x44d059[_0x6121('0x34')][_0x6121('0x41')]){_0x297692[_0x6121('0x42')]=[{'all':!![]}];}return db[_0x6121('0x2d')][_0x6121('0x43')](_0x297692);})['then'](function(_0x4e792a){_0x595ff5['rows']=_0x4e792a;return _0x595ff5;})['then'](respondWithFilteredResult(_0xdcb8fa,_0x297692))[_0x6121('0x44')](handleError(_0xdcb8fa,null));};exports[_0x6121('0x45')]=function(_0x58c3f7,_0x504e92){var _0x402078={'raw':!![],'where':{'id':_0x58c3f7['params']['id']}},_0xb3cb9f={};_0xb3cb9f['model']=_[_0x6121('0x46')](db['SmsQueueReport'][_0x6121('0x2e')]);_0xb3cb9f['query']=_[_0x6121('0x46')](_0x58c3f7[_0x6121('0x34')]);_0xb3cb9f[_0x6121('0x3c')]=_['intersection'](_0xb3cb9f[_0x6121('0x33')],_0xb3cb9f[_0x6121('0x34')]);_0x402078[_0x6121('0x35')]=_['intersection'](_0xb3cb9f[_0x6121('0x33')],qs[_0x6121('0x36')](_0x58c3f7[_0x6121('0x34')][_0x6121('0x36')]));_0x402078[_0x6121('0x35')]=_0x402078[_0x6121('0x35')]['length']?_0x402078[_0x6121('0x35')]:_0xb3cb9f[_0x6121('0x33')];if(_0x58c3f7[_0x6121('0x34')]['includeAll']){_0x402078[_0x6121('0x42')]=[{'all':!![]}];}_0x402078=_[_0x6121('0x3e')]({},_0x402078,_0x58c3f7[_0x6121('0x40')]);return db[_0x6121('0x2d')]['find'](_0x402078)[_0x6121('0x25')](handleEntityNotFound(_0x504e92,null))[_0x6121('0x25')](respondWithResult(_0x504e92,null))[_0x6121('0x44')](handleError(_0x504e92,null));};exports[_0x6121('0x47')]=function(_0x255775,_0x5f0936){return db[_0x6121('0x2d')][_0x6121('0x47')](_0x255775[_0x6121('0x48')],{})[_0x6121('0x25')](respondWithResult(_0x5f0936,0xc9))[_0x6121('0x44')](handleError(_0x5f0936,null));};exports[_0x6121('0x24')]=function(_0x431933,_0x65889c){if(_0x431933[_0x6121('0x48')]['id']){delete _0x431933[_0x6121('0x48')]['id'];}return db[_0x6121('0x2d')][_0x6121('0x49')]({'where':{'id':_0x431933[_0x6121('0x4a')]['id']}})[_0x6121('0x25')](handleEntityNotFound(_0x65889c,null))['then'](saveUpdates(_0x431933['body'],null))[_0x6121('0x25')](respondWithResult(_0x65889c,null))['catch'](handleError(_0x65889c,null));};exports[_0x6121('0x26')]=function(_0x243a99,_0x440338){return db[_0x6121('0x2d')][_0x6121('0x49')]({'where':{'id':_0x243a99[_0x6121('0x4a')]['id']}})[_0x6121('0x25')](handleEntityNotFound(_0x440338,null))[_0x6121('0x25')](removeEntity(_0x440338,null))[_0x6121('0x44')](handleError(_0x440338,null));};exports[_0x6121('0x4b')]=function(_0x113a46,_0x3d9a2a){return db[_0x6121('0x2d')][_0x6121('0x4b')]()[_0x6121('0x25')](respondWithResult(_0x3d9a2a,null))['catch'](handleError(_0x3d9a2a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1c93f1b..5d36f41 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x39c7fa,_0x57e3ff){var _0x34f95f=function(_0x36c5c3){while(--_0x36c5c3){_0x39c7fa['push'](_0x39c7fa['shift']());}};_0x34f95f(++_0x57e3ff);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xcb91[_0x35007a];return _0x574f68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ceece9a..721c09c 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 _0x53cc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','body','where','debug','lodash','moment','bluebird'];(function(_0x333b8c,_0x8c792d){var _0x3af725=function(_0x3ca04f){while(--_0x3ca04f){_0x333b8c['push'](_0x333b8c['shift']());}};_0x3af725(++_0x8c792d);}(_0x53cc,0x133));var _0xc53c=function(_0x883d7,_0x28edb8){_0x883d7=_0x883d7-0x0;var _0x1559d6=_0x53cc[_0x883d7];return _0x1559d6;};'use strict';var _=require(_0xc53c('0x0'));var util=require('util');var moment=require(_0xc53c('0x1'));var BPromise=require(_0xc53c('0x2'));var rs=require(_0xc53c('0x3'));var fs=require('fs');var Redis=require(_0xc53c('0x4'));var db=require(_0xc53c('0x5'))['db'];var utils=require(_0xc53c('0x6'));var logger=require(_0xc53c('0x7'))(_0xc53c('0x8'));var config=require(_0xc53c('0x9'));var jayson=require(_0xc53c('0xa'));var client=jayson['client'][_0xc53c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x455adf,_0x1e39d7,_0xd02819){return new BPromise(function(_0x1546f9,_0x2748d4){return client['request'](_0x455adf,_0xd02819)[_0xc53c('0xc')](function(_0x40afbc){logger[_0xc53c('0xd')](_0xc53c('0xe'),_0x1e39d7,_0xc53c('0xf'));logger['debug'](_0xc53c('0x10'),_0x1e39d7,_0xc53c('0xf'),JSON[_0xc53c('0x11')](_0x40afbc));if(_0x40afbc[_0xc53c('0x12')]){if(_0x40afbc['error']['code']===0x1f4){logger[_0xc53c('0x12')](_0xc53c('0xe'),_0x1e39d7,_0x40afbc[_0xc53c('0x12')][_0xc53c('0x13')]);return _0x2748d4(_0x40afbc[_0xc53c('0x12')]['message']);}logger[_0xc53c('0x12')](_0xc53c('0xe'),_0x1e39d7,_0x40afbc['error']['message']);return _0x1546f9(_0x40afbc[_0xc53c('0x12')]['message']);}else{logger[_0xc53c('0xd')](_0xc53c('0xe'),_0x1e39d7,'request\x20sent');_0x1546f9(_0x40afbc[_0xc53c('0x14')][_0xc53c('0x13')]);}})[_0xc53c('0x15')](function(_0x314623){logger['error'](_0xc53c('0xe'),_0x1e39d7,_0x314623);_0x2748d4(_0x314623);});});}exports[_0xc53c('0x16')]=function(_0x5d4ce7){var _0x1f184e=this;return new Promise(function(_0x4010e3,_0x2d762f){return db[_0xc53c('0x17')][_0xc53c('0x18')](_0x5d4ce7['body'],{'raw':_0x5d4ce7['options']?_0x5d4ce7[_0xc53c('0x19')][_0xc53c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x25fe13){logger[_0xc53c('0xd')](_0xc53c('0x16'),_0x5d4ce7);logger['debug'](_0xc53c('0x16'),_0x5d4ce7,JSON[_0xc53c('0x11')](_0x25fe13));_0x4010e3(_0x25fe13);})[_0xc53c('0x15')](function(_0x4949a8){logger[_0xc53c('0x12')](_0xc53c('0x16'),_0x4949a8[_0xc53c('0x13')],_0x5d4ce7);_0x2d762f(_0x1f184e['error'](0x1f4,_0x4949a8['message']));});});};exports[_0xc53c('0x1b')]=function(_0x5d0c67){var _0x421d4d=this;return new Promise(function(_0x24f329,_0x45d0c6){return db[_0xc53c('0x17')]['update'](_0x5d0c67[_0xc53c('0x1c')],{'raw':_0x5d0c67[_0xc53c('0x19')]?_0x5d0c67[_0xc53c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0c67[_0xc53c('0x19')]?_0x5d0c67[_0xc53c('0x19')][_0xc53c('0x1d')]||null:null,'attributes':_0x5d0c67[_0xc53c('0x19')]?_0x5d0c67[_0xc53c('0x19')]['attributes']||null:null,'limit':_0x5d0c67['options']?_0x5d0c67[_0xc53c('0x19')]['limit']||null:null})[_0xc53c('0xc')](function(_0x2c12ed){logger[_0xc53c('0xd')](_0xc53c('0x1b'),_0x5d0c67);logger[_0xc53c('0x1e')]('UpdateSmsQueueReport',_0x5d0c67,JSON['stringify'](_0x2c12ed));_0x24f329(_0x2c12ed);})[_0xc53c('0x15')](function(_0x514ed7){logger[_0xc53c('0x12')](_0xc53c('0x1b'),_0x514ed7[_0xc53c('0x13')],_0x5d0c67);_0x45d0c6(_0x421d4d[_0xc53c('0x12')](0x1f4,_0x514ed7[_0xc53c('0x13')]));});});}; \ No newline at end of file +var _0x1acf=['update','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','catch'];(function(_0x400489,_0x4a24ce){var _0x6d5f81=function(_0x5e4291){while(--_0x5e4291){_0x400489['push'](_0x400489['shift']());}};_0x6d5f81(++_0x4a24ce);}(_0x1acf,0x6a));var _0xf1ac=function(_0x157c61,_0x46849a){_0x157c61=_0x157c61-0x0;var _0x113e0c=_0x1acf[_0x157c61];return _0x113e0c;};'use strict';var _=require(_0xf1ac('0x0'));var util=require(_0xf1ac('0x1'));var moment=require(_0xf1ac('0x2'));var BPromise=require(_0xf1ac('0x3'));var rs=require(_0xf1ac('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ac('0x5'))['db'];var utils=require(_0xf1ac('0x6'));var logger=require(_0xf1ac('0x7'))('rpc');var config=require(_0xf1ac('0x8'));var jayson=require(_0xf1ac('0x9'));var client=jayson[_0xf1ac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e5526,_0x173d01,_0x4af976){return new BPromise(function(_0x329cea,_0x222731){return client[_0xf1ac('0xb')](_0x2e5526,_0x4af976)[_0xf1ac('0xc')](function(_0x3450ae){logger[_0xf1ac('0xd')](_0xf1ac('0xe'),_0x173d01,_0xf1ac('0xf'));logger[_0xf1ac('0x10')](_0xf1ac('0x11'),_0x173d01,'request\x20sent',JSON[_0xf1ac('0x12')](_0x3450ae));if(_0x3450ae[_0xf1ac('0x13')]){if(_0x3450ae[_0xf1ac('0x13')][_0xf1ac('0x14')]===0x1f4){logger[_0xf1ac('0x13')](_0xf1ac('0xe'),_0x173d01,_0x3450ae[_0xf1ac('0x13')]['message']);return _0x222731(_0x3450ae[_0xf1ac('0x13')][_0xf1ac('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x173d01,_0x3450ae['error'][_0xf1ac('0x15')]);return _0x329cea(_0x3450ae[_0xf1ac('0x13')]['message']);}else{logger['info'](_0xf1ac('0xe'),_0x173d01,'request\x20sent');_0x329cea(_0x3450ae[_0xf1ac('0x16')]['message']);}})['catch'](function(_0x1e101d){logger['error'](_0xf1ac('0xe'),_0x173d01,_0x1e101d);_0x222731(_0x1e101d);});});}exports['CreateSmsQueueReport']=function(_0xd7864b){var _0x5ac119=this;return new Promise(function(_0x5e0603,_0x489cb0){return db[_0xf1ac('0x17')][_0xf1ac('0x18')](_0xd7864b[_0xf1ac('0x19')],{'raw':_0xd7864b[_0xf1ac('0x1a')]?_0xd7864b[_0xf1ac('0x1a')][_0xf1ac('0x1b')]===undefined?!![]:![]:!![]})[_0xf1ac('0xc')](function(_0x2a854a){logger[_0xf1ac('0xd')](_0xf1ac('0x1c'),_0xd7864b);logger['debug'](_0xf1ac('0x1c'),_0xd7864b,JSON[_0xf1ac('0x12')](_0x2a854a));_0x5e0603(_0x2a854a);})[_0xf1ac('0x1d')](function(_0x3ea6da){logger[_0xf1ac('0x13')](_0xf1ac('0x1c'),_0x3ea6da[_0xf1ac('0x15')],_0xd7864b);_0x489cb0(_0x5ac119[_0xf1ac('0x13')](0x1f4,_0x3ea6da['message']));});});};exports['UpdateSmsQueueReport']=function(_0x56b994){var _0x4c17b8=this;return new Promise(function(_0x1717a5,_0x2fcde3){return db[_0xf1ac('0x17')][_0xf1ac('0x1e')](_0x56b994['body'],{'raw':_0x56b994[_0xf1ac('0x1a')]?_0x56b994[_0xf1ac('0x1a')][_0xf1ac('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56b994[_0xf1ac('0x1a')]?_0x56b994[_0xf1ac('0x1a')]['where']||null:null,'attributes':_0x56b994['options']?_0x56b994[_0xf1ac('0x1a')][_0xf1ac('0x1f')]||null:null,'limit':_0x56b994[_0xf1ac('0x1a')]?_0x56b994[_0xf1ac('0x1a')][_0xf1ac('0x20')]||null:null})[_0xf1ac('0xc')](function(_0x2de5d6){logger[_0xf1ac('0xd')](_0xf1ac('0x21'),_0x56b994);logger[_0xf1ac('0x10')](_0xf1ac('0x21'),_0x56b994,JSON[_0xf1ac('0x12')](_0x2de5d6));_0x1717a5(_0x2de5d6);})[_0xf1ac('0x1d')](function(_0x174994){logger[_0xf1ac('0x13')]('UpdateSmsQueueReport',_0x174994[_0xf1ac('0x15')],_0x56b994);_0x2fcde3(_0x4c17b8['error'](0x1f4,_0x174994['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 0aa5e45..4f07806 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 _0xd67b=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x2258b2,_0x4bfc4c){var _0x44e07f=function(_0x382e55){while(--_0x382e55){_0x2258b2['push'](_0x2258b2['shift']());}};_0x44e07f(++_0x4bfc4c);}(_0xd67b,0x133));var _0xbd67=function(_0x21c6d5,_0xcec630){_0x21c6d5=_0x21c6d5-0x0;var _0x183ede=_0xd67b[_0x21c6d5];return _0x183ede;};'use strict';var multer=require('multer');var util=require(_0xbd67('0x0'));var path=require('path');var timeout=require(_0xbd67('0x1'));var express=require(_0xbd67('0x2'));var router=express[_0xbd67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd67('0x5'));var controller=require('./smsTransferReport.controller');router[_0xbd67('0x6')]('/',auth[_0xbd67('0x7')](),controller[_0xbd67('0x8')]);router[_0xbd67('0x6')](_0xbd67('0x9'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xa')]);router[_0xbd67('0x6')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xc')]);router[_0xbd67('0xd')]('/',auth[_0xbd67('0x7')](),controller['create']);router['put'](_0xbd67('0xb'),auth['isAuthenticated'](),controller[_0xbd67('0xe')]);router[_0xbd67('0xf')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0x10')]);module[_0xbd67('0x11')]=router; \ No newline at end of file +var _0xdbf5=['show','post','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3451e9,_0x2ec885){_0x3451e9=_0x3451e9-0x0;var _0x38a292=_0xdbf5[_0x3451e9];return _0x38a292;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0x8')](_0x5dbf('0xb'),auth[_0x5dbf('0x9')](),controller['describe']);router[_0x5dbf('0x8')]('/:id',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router[_0x5dbf('0xd')]('/',auth[_0x5dbf('0x9')](),controller['create']);router[_0x5dbf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0xf')]);router['delete']('/:id',auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index aae2106..9a9eaaf 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2b281b,_0x341c39){var _0x1fd765=function(_0x3e99fd){while(--_0x3e99fd){_0x2b281b['push'](_0x2b281b['shift']());}};_0x1fd765(++_0x341c39);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xcb91[_0x4327fe];return _0x138651;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4d683e,_0x49dd09){var _0x40b834=function(_0x2d5da9){while(--_0x2d5da9){_0x4d683e['push'](_0x4d683e['shift']());}};_0x40b834(++_0x49dd09);}(_0xaa88,0x137));var _0x8aa8=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0xaa88[_0x59e862];return _0x1a25ee;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4374461..958f717 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 _0xe7d9=['../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x575e00,_0x559d6e){var _0x199f97=function(_0xd65d89){while(--_0xd65d89){_0x575e00['push'](_0x575e00['shift']());}};_0x199f97(++_0x559d6e);}(_0xe7d9,0x109));var _0x9e7d=function(_0x57da50,_0x17ce7e){_0x57da50=_0x57da50-0x0;var _0x2f190c=_0xe7d9[_0x57da50];return _0x2f190c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e7d('0x0'));var zipdir=require(_0x9e7d('0x1'));var jsonpatch=require(_0x9e7d('0x2'));var rp=require(_0x9e7d('0x3'));var moment=require(_0x9e7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e7d('0x5'));var util=require('util');var path=require(_0x9e7d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e7d('0x7'));var fs=require('fs');var fs_extra=require(_0x9e7d('0x8'));var _=require(_0x9e7d('0x9'));var squel=require('squel');var crypto=require(_0x9e7d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9e7d('0xb'));var toCsv=require(_0x9e7d('0xc'));var querystring=require('querystring');var Papa=require(_0x9e7d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e7d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e7d('0xf'));var logger=require(_0x9e7d('0x10'))(_0x9e7d('0x11'));var utils=require(_0x9e7d('0x12'));var config=require(_0x9e7d('0x13'));var licenseUtil=require(_0x9e7d('0x14'));var db=require(_0x9e7d('0x15'))['db'];function respondWithStatusCode(_0x2b3f76,_0x10b7dc){_0x10b7dc=_0x10b7dc||0xcc;return function(_0x25fec1){if(_0x25fec1){return _0x2b3f76['sendStatus'](_0x10b7dc);}return _0x2b3f76[_0x9e7d('0x16')](_0x10b7dc)['end']();};}function respondWithResult(_0x3d79cf,_0x428087){_0x428087=_0x428087||0xc8;return function(_0x37a47b){if(_0x37a47b){return _0x3d79cf[_0x9e7d('0x16')](_0x428087)[_0x9e7d('0x17')](_0x37a47b);}};}function respondWithFilteredResult(_0x3f5c93,_0x5d5b7e){return function(_0x169604){if(_0x169604){var _0x1294c6=typeof _0x5d5b7e[_0x9e7d('0x18')]===_0x9e7d('0x19')&&typeof _0x5d5b7e[_0x9e7d('0x1a')]===_0x9e7d('0x19');var _0x4b1aa5=_0x169604[_0x9e7d('0x1b')];var _0x3806ee=_0x1294c6?0x0:_0x5d5b7e[_0x9e7d('0x18')];var _0x5497c0=_0x1294c6?_0x169604[_0x9e7d('0x1b')]:_0x5d5b7e[_0x9e7d('0x18')]+_0x5d5b7e[_0x9e7d('0x1a')];var _0x1661c5;if(_0x5497c0>=_0x4b1aa5){_0x5497c0=_0x4b1aa5;_0x1661c5=0xc8;}else{_0x1661c5=0xce;}_0x3f5c93[_0x9e7d('0x16')](_0x1661c5);return _0x3f5c93['set'](_0x9e7d('0x1c'),_0x3806ee+'-'+_0x5497c0+'/'+_0x4b1aa5)[_0x9e7d('0x17')](_0x169604);}return null;};}function patchUpdates(_0x5e7fd8){return function(_0x33637a){try{jsonpatch['apply'](_0x33637a,_0x5e7fd8,!![]);}catch(_0x2ede9c){return BPromise[_0x9e7d('0x1d')](_0x2ede9c);}return _0x33637a[_0x9e7d('0x1e')]();};}function saveUpdates(_0x178c73,_0x3cd02a){return function(_0x55d080){if(_0x55d080){return _0x55d080[_0x9e7d('0x1f')](_0x178c73)[_0x9e7d('0x20')](function(_0xd97fd0){return _0xd97fd0;});}return null;};}function removeEntity(_0x49ca94,_0xe8f81c){return function(_0x2e5ee5){if(_0x2e5ee5){return _0x2e5ee5[_0x9e7d('0x21')]()[_0x9e7d('0x20')](function(){_0x49ca94[_0x9e7d('0x16')](0xcc)[_0x9e7d('0x22')]();});}};}function handleEntityNotFound(_0x27ba80,_0x1805bd){return function(_0x5300b0){if(!_0x5300b0){_0x27ba80[_0x9e7d('0x23')](0x194);}return _0x5300b0;};}function handleError(_0x4b59e1,_0x7912a6){_0x7912a6=_0x7912a6||0x1f4;return function(_0x5d8f98){logger[_0x9e7d('0x24')](_0x5d8f98['stack']);if(_0x5d8f98[_0x9e7d('0x25')]){delete _0x5d8f98[_0x9e7d('0x25')];}_0x4b59e1[_0x9e7d('0x16')](_0x7912a6)[_0x9e7d('0x26')](_0x5d8f98);};}exports[_0x9e7d('0x27')]=function(_0x4423c6,_0x5d7aeb){var _0x3ef6af={},_0x1a633c={},_0x18b5e4={'count':0x0,'rows':[]};var _0x16b7a1=_['map'](db[_0x9e7d('0x28')][_0x9e7d('0x29')],function(_0x21e6f5){return{'name':_0x21e6f5[_0x9e7d('0x2a')],'type':_0x21e6f5[_0x9e7d('0x2b')][_0x9e7d('0x2c')]};});_0x1a633c['model']=_['map'](_0x16b7a1,_0x9e7d('0x25'));_0x1a633c[_0x9e7d('0x2d')]=_[_0x9e7d('0x2e')](_0x4423c6[_0x9e7d('0x2d')]);_0x1a633c[_0x9e7d('0x2f')]=_['intersection'](_0x1a633c[_0x9e7d('0x30')],_0x1a633c[_0x9e7d('0x2d')]);_0x3ef6af[_0x9e7d('0x31')]=_[_0x9e7d('0x32')](_0x1a633c[_0x9e7d('0x30')],qs['fields'](_0x4423c6[_0x9e7d('0x2d')][_0x9e7d('0x33')]));_0x3ef6af['attributes']=_0x3ef6af['attributes'][_0x9e7d('0x34')]?_0x3ef6af[_0x9e7d('0x31')]:_0x1a633c[_0x9e7d('0x30')];if(!_0x4423c6[_0x9e7d('0x2d')]['hasOwnProperty']('nolimit')){_0x3ef6af['limit']=qs[_0x9e7d('0x1a')](_0x4423c6[_0x9e7d('0x2d')]['limit']);_0x3ef6af[_0x9e7d('0x18')]=qs[_0x9e7d('0x18')](_0x4423c6[_0x9e7d('0x2d')]['offset']);}_0x3ef6af[_0x9e7d('0x35')]=qs['sort'](_0x4423c6[_0x9e7d('0x2d')][_0x9e7d('0x36')]);_0x3ef6af[_0x9e7d('0x37')]=qs['filters'](_[_0x9e7d('0x38')](_0x4423c6[_0x9e7d('0x2d')],_0x1a633c[_0x9e7d('0x2f')]),_0x16b7a1);if(_0x4423c6[_0x9e7d('0x2d')][_0x9e7d('0x39')]){_0x3ef6af[_0x9e7d('0x37')]=_['merge'](_0x3ef6af['where'],{'$or':_['map'](_0x16b7a1,function(_0x3b2808){if(_0x3b2808[_0x9e7d('0x2b')]!==_0x9e7d('0x3a')){var _0x7fd240={};_0x7fd240[_0x3b2808[_0x9e7d('0x25')]]={'$like':'%'+_0x4423c6[_0x9e7d('0x2d')][_0x9e7d('0x39')]+'%'};return _0x7fd240;}})});}_0x3ef6af=_['merge']({},_0x3ef6af,_0x4423c6[_0x9e7d('0x3b')]);var _0x3c1327={'where':_0x3ef6af[_0x9e7d('0x37')]};return db[_0x9e7d('0x28')][_0x9e7d('0x1b')](_0x3c1327)[_0x9e7d('0x20')](function(_0x43f121){_0x18b5e4[_0x9e7d('0x1b')]=_0x43f121;if(_0x4423c6[_0x9e7d('0x2d')][_0x9e7d('0x3c')]){_0x3ef6af[_0x9e7d('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x9e7d('0x3e')](_0x3ef6af);})[_0x9e7d('0x20')](function(_0x2feda7){_0x18b5e4[_0x9e7d('0x3f')]=_0x2feda7;return _0x18b5e4;})['then'](respondWithFilteredResult(_0x5d7aeb,_0x3ef6af))[_0x9e7d('0x40')](handleError(_0x5d7aeb,null));};exports['show']=function(_0x47b8f6,_0x5e6d35){var _0x13081c={'raw':!![],'where':{'id':_0x47b8f6[_0x9e7d('0x41')]['id']}},_0x10859c={};_0x10859c[_0x9e7d('0x30')]=_['keys'](db[_0x9e7d('0x28')]['rawAttributes']);_0x10859c[_0x9e7d('0x2d')]=_[_0x9e7d('0x2e')](_0x47b8f6[_0x9e7d('0x2d')]);_0x10859c['filters']=_['intersection'](_0x10859c[_0x9e7d('0x30')],_0x10859c[_0x9e7d('0x2d')]);_0x13081c[_0x9e7d('0x31')]=_['intersection'](_0x10859c[_0x9e7d('0x30')],qs[_0x9e7d('0x33')](_0x47b8f6[_0x9e7d('0x2d')][_0x9e7d('0x33')]));_0x13081c[_0x9e7d('0x31')]=_0x13081c['attributes'][_0x9e7d('0x34')]?_0x13081c['attributes']:_0x10859c[_0x9e7d('0x30')];if(_0x47b8f6[_0x9e7d('0x2d')]['includeAll']){_0x13081c[_0x9e7d('0x3d')]=[{'all':!![]}];}_0x13081c=_[_0x9e7d('0x42')]({},_0x13081c,_0x47b8f6[_0x9e7d('0x3b')]);return db[_0x9e7d('0x28')][_0x9e7d('0x43')](_0x13081c)['then'](handleEntityNotFound(_0x5e6d35,null))[_0x9e7d('0x20')](respondWithResult(_0x5e6d35,null))['catch'](handleError(_0x5e6d35,null));};exports[_0x9e7d('0x44')]=function(_0x432d02,_0x54ee5d){return db[_0x9e7d('0x28')][_0x9e7d('0x44')](_0x432d02[_0x9e7d('0x45')],{})[_0x9e7d('0x20')](respondWithResult(_0x54ee5d,0xc9))[_0x9e7d('0x40')](handleError(_0x54ee5d,null));};exports[_0x9e7d('0x1f')]=function(_0x153b2f,_0x24e154){if(_0x153b2f[_0x9e7d('0x45')]['id']){delete _0x153b2f['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x153b2f['params']['id']}})[_0x9e7d('0x20')](handleEntityNotFound(_0x24e154,null))['then'](saveUpdates(_0x153b2f[_0x9e7d('0x45')],null))[_0x9e7d('0x20')](respondWithResult(_0x24e154,null))[_0x9e7d('0x40')](handleError(_0x24e154,null));};exports[_0x9e7d('0x21')]=function(_0x5488fb,_0x4e7b77){return db['SmsTransferReport']['find']({'where':{'id':_0x5488fb[_0x9e7d('0x41')]['id']}})[_0x9e7d('0x20')](handleEntityNotFound(_0x4e7b77,null))['then'](removeEntity(_0x4e7b77,null))[_0x9e7d('0x40')](handleError(_0x4e7b77,null));};exports[_0x9e7d('0x46')]=function(_0x3bf128,_0x59d1c2){return db[_0x9e7d('0x28')]['describe']()[_0x9e7d('0x20')](respondWithResult(_0x59d1c2,null))['catch'](handleError(_0x59d1c2,null));}; \ No newline at end of file +var _0x76a9=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','keys','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','update','then','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName'];(function(_0x4be68b,_0x13486a){var _0x397805=function(_0x4cad3e){while(--_0x4cad3e){_0x4be68b['push'](_0x4be68b['shift']());}};_0x397805(++_0x13486a);}(_0x76a9,0x69));var _0x976a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x76a9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x976a('0x0'));var rimraf=require(_0x976a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x976a('0x2'));var moment=require(_0x976a('0x3'));var BPromise=require(_0x976a('0x4'));var Mustache=require(_0x976a('0x5'));var util=require(_0x976a('0x6'));var path=require(_0x976a('0x7'));var sox=require(_0x976a('0x8'));var csv=require(_0x976a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x976a('0xa'));var _=require(_0x976a('0xb'));var squel=require(_0x976a('0xc'));var crypto=require(_0x976a('0xd'));var jsforce=require(_0x976a('0xe'));var deskjs=require(_0x976a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x976a('0x10'));var Redis=require(_0x976a('0x11'));var authService=require(_0x976a('0x12'));var qs=require(_0x976a('0x13'));var as=require(_0x976a('0x14'));var hardwareService=require(_0x976a('0x15'));var logger=require(_0x976a('0x16'))('api');var utils=require(_0x976a('0x17'));var config=require(_0x976a('0x18'));var licenseUtil=require(_0x976a('0x19'));var db=require(_0x976a('0x1a'))['db'];function respondWithStatusCode(_0x2105fa,_0x3bf8a0){_0x3bf8a0=_0x3bf8a0||0xcc;return function(_0x434518){if(_0x434518){return _0x2105fa[_0x976a('0x1b')](_0x3bf8a0);}return _0x2105fa['status'](_0x3bf8a0)[_0x976a('0x1c')]();};}function respondWithResult(_0x3f4c49,_0x4bde01){_0x4bde01=_0x4bde01||0xc8;return function(_0x2ebc4){if(_0x2ebc4){return _0x3f4c49['status'](_0x4bde01)[_0x976a('0x1d')](_0x2ebc4);}};}function respondWithFilteredResult(_0x471254,_0x376c39){return function(_0x14f56c){if(_0x14f56c){var _0x5379a8=typeof _0x376c39['offset']==='undefined'&&typeof _0x376c39[_0x976a('0x1e')]===_0x976a('0x1f');var _0x4d1513=_0x14f56c[_0x976a('0x20')];var _0x2265c2=_0x5379a8?0x0:_0x376c39[_0x976a('0x21')];var _0x154957=_0x5379a8?_0x14f56c[_0x976a('0x20')]:_0x376c39[_0x976a('0x21')]+_0x376c39[_0x976a('0x1e')];var _0x108d05;if(_0x154957>=_0x4d1513){_0x154957=_0x4d1513;_0x108d05=0xc8;}else{_0x108d05=0xce;}_0x471254[_0x976a('0x22')](_0x108d05);return _0x471254['set'](_0x976a('0x23'),_0x2265c2+'-'+_0x154957+'/'+_0x4d1513)[_0x976a('0x1d')](_0x14f56c);}return null;};}function patchUpdates(_0x113daa){return function(_0x3e55b3){try{jsonpatch[_0x976a('0x24')](_0x3e55b3,_0x113daa,!![]);}catch(_0x58cec6){return BPromise['reject'](_0x58cec6);}return _0x3e55b3['save']();};}function saveUpdates(_0x40e2c1,_0x3da0c1){return function(_0x3bd04a){if(_0x3bd04a){return _0x3bd04a[_0x976a('0x25')](_0x40e2c1)['then'](function(_0x2fce4a){return _0x2fce4a;});}return null;};}function removeEntity(_0x114867,_0x1adcc7){return function(_0x5eec0f){if(_0x5eec0f){return _0x5eec0f['destroy']()[_0x976a('0x26')](function(){_0x114867[_0x976a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10dbb0,_0x4655d1){return function(_0x59a493){if(!_0x59a493){_0x10dbb0[_0x976a('0x1b')](0x194);}return _0x59a493;};}function handleError(_0x18d2a9,_0x3a85e8){_0x3a85e8=_0x3a85e8||0x1f4;return function(_0x17fa45){logger[_0x976a('0x27')](_0x17fa45[_0x976a('0x28')]);if(_0x17fa45[_0x976a('0x29')]){delete _0x17fa45['name'];}_0x18d2a9[_0x976a('0x22')](_0x3a85e8)[_0x976a('0x2a')](_0x17fa45);};}exports['index']=function(_0x4cd0dc,_0x34d474){var _0x503052={},_0x3b05e5={},_0x14711b={'count':0x0,'rows':[]};var _0x1e2fc6=_[_0x976a('0x2b')](db[_0x976a('0x2c')][_0x976a('0x2d')],function(_0x5d1b03){return{'name':_0x5d1b03[_0x976a('0x2e')],'type':_0x5d1b03[_0x976a('0x2f')][_0x976a('0x30')]};});_0x3b05e5[_0x976a('0x31')]=_['map'](_0x1e2fc6,'name');_0x3b05e5[_0x976a('0x32')]=_['keys'](_0x4cd0dc[_0x976a('0x32')]);_0x3b05e5[_0x976a('0x33')]=_[_0x976a('0x34')](_0x3b05e5[_0x976a('0x31')],_0x3b05e5[_0x976a('0x32')]);_0x503052[_0x976a('0x35')]=_['intersection'](_0x3b05e5['model'],qs[_0x976a('0x36')](_0x4cd0dc[_0x976a('0x32')][_0x976a('0x36')]));_0x503052[_0x976a('0x35')]=_0x503052[_0x976a('0x35')][_0x976a('0x37')]?_0x503052[_0x976a('0x35')]:_0x3b05e5['model'];if(!_0x4cd0dc[_0x976a('0x32')][_0x976a('0x38')]('nolimit')){_0x503052[_0x976a('0x1e')]=qs[_0x976a('0x1e')](_0x4cd0dc['query'][_0x976a('0x1e')]);_0x503052[_0x976a('0x21')]=qs[_0x976a('0x21')](_0x4cd0dc[_0x976a('0x32')][_0x976a('0x21')]);}_0x503052[_0x976a('0x39')]=qs[_0x976a('0x3a')](_0x4cd0dc[_0x976a('0x32')]['sort']);_0x503052[_0x976a('0x3b')]=qs['filters'](_[_0x976a('0x3c')](_0x4cd0dc[_0x976a('0x32')],_0x3b05e5[_0x976a('0x33')]),_0x1e2fc6);if(_0x4cd0dc[_0x976a('0x32')][_0x976a('0x3d')]){_0x503052[_0x976a('0x3b')]=_['merge'](_0x503052[_0x976a('0x3b')],{'$or':_['map'](_0x1e2fc6,function(_0x392029){if(_0x392029[_0x976a('0x2f')]!==_0x976a('0x3e')){var _0x4b9705={};_0x4b9705[_0x392029[_0x976a('0x29')]]={'$like':'%'+_0x4cd0dc[_0x976a('0x32')][_0x976a('0x3d')]+'%'};return _0x4b9705;}})});}_0x503052=_[_0x976a('0x3f')]({},_0x503052,_0x4cd0dc['options']);var _0x7a286a={'where':_0x503052['where']};return db['SmsTransferReport'][_0x976a('0x20')](_0x7a286a)[_0x976a('0x26')](function(_0x5a9354){_0x14711b['count']=_0x5a9354;if(_0x4cd0dc[_0x976a('0x32')]['includeAll']){_0x503052[_0x976a('0x40')]=[{'all':!![]}];}return db[_0x976a('0x2c')][_0x976a('0x41')](_0x503052);})[_0x976a('0x26')](function(_0x4d75b3){_0x14711b['rows']=_0x4d75b3;return _0x14711b;})[_0x976a('0x26')](respondWithFilteredResult(_0x34d474,_0x503052))[_0x976a('0x42')](handleError(_0x34d474,null));};exports['show']=function(_0x5ee901,_0x61eef2){var _0x1f1a59={'raw':!![],'where':{'id':_0x5ee901[_0x976a('0x43')]['id']}},_0x3252e0={};_0x3252e0[_0x976a('0x31')]=_[_0x976a('0x44')](db[_0x976a('0x2c')][_0x976a('0x2d')]);_0x3252e0[_0x976a('0x32')]=_[_0x976a('0x44')](_0x5ee901['query']);_0x3252e0[_0x976a('0x33')]=_['intersection'](_0x3252e0[_0x976a('0x31')],_0x3252e0['query']);_0x1f1a59[_0x976a('0x35')]=_[_0x976a('0x34')](_0x3252e0[_0x976a('0x31')],qs[_0x976a('0x36')](_0x5ee901[_0x976a('0x32')][_0x976a('0x36')]));_0x1f1a59['attributes']=_0x1f1a59[_0x976a('0x35')][_0x976a('0x37')]?_0x1f1a59[_0x976a('0x35')]:_0x3252e0[_0x976a('0x31')];if(_0x5ee901[_0x976a('0x32')][_0x976a('0x45')]){_0x1f1a59['include']=[{'all':!![]}];}_0x1f1a59=_[_0x976a('0x3f')]({},_0x1f1a59,_0x5ee901[_0x976a('0x46')]);return db[_0x976a('0x2c')][_0x976a('0x47')](_0x1f1a59)[_0x976a('0x26')](handleEntityNotFound(_0x61eef2,null))[_0x976a('0x26')](respondWithResult(_0x61eef2,null))[_0x976a('0x42')](handleError(_0x61eef2,null));};exports['create']=function(_0x18b6dc,_0x5ca6ea){return db[_0x976a('0x2c')][_0x976a('0x48')](_0x18b6dc['body'],{})['then'](respondWithResult(_0x5ca6ea,0xc9))[_0x976a('0x42')](handleError(_0x5ca6ea,null));};exports[_0x976a('0x25')]=function(_0x1d6a71,_0x11e04e){if(_0x1d6a71['body']['id']){delete _0x1d6a71[_0x976a('0x49')]['id'];}return db[_0x976a('0x2c')][_0x976a('0x47')]({'where':{'id':_0x1d6a71['params']['id']}})[_0x976a('0x26')](handleEntityNotFound(_0x11e04e,null))[_0x976a('0x26')](saveUpdates(_0x1d6a71[_0x976a('0x49')],null))[_0x976a('0x26')](respondWithResult(_0x11e04e,null))['catch'](handleError(_0x11e04e,null));};exports[_0x976a('0x4a')]=function(_0x19f008,_0x59d8cb){return db[_0x976a('0x2c')][_0x976a('0x47')]({'where':{'id':_0x19f008[_0x976a('0x43')]['id']}})[_0x976a('0x26')](handleEntityNotFound(_0x59d8cb,null))[_0x976a('0x26')](removeEntity(_0x59d8cb,null))[_0x976a('0x42')](handleError(_0x59d8cb,null));};exports['describe']=function(_0x2f8b75,_0x34ead1){return db[_0x976a('0x2c')][_0x976a('0x4b')]()['then'](respondWithResult(_0x34ead1,null))[_0x976a('0x42')](handleError(_0x34ead1,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 222d30b..4b6e1d8 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 _0x0e0d=['define','report_sms_transfer','uniqueid','lodash','util','api','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x187f72,_0x32f589){var _0x5b6b49=function(_0x25a792){while(--_0x25a792){_0x187f72['push'](_0x187f72['shift']());}};_0x5b6b49(++_0x32f589);}(_0x0e0d,0x100));var _0xd0e0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0e0d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd0e0('0x0'));var util=require(_0xd0e0('0x1'));var logger=require('../../config/logger')(_0xd0e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0e0('0x3'));var rimraf=require(_0xd0e0('0x4'));var config=require(_0xd0e0('0x5'));var attributes=require(_0xd0e0('0x6'));module[_0xd0e0('0x7')]=function(_0xd86374,_0x2fc4f2){return _0xd86374[_0xd0e0('0x8')]('SmsTransferReport',attributes,{'tableName':_0xd0e0('0x9'),'paranoid':![],'indexes':[{'name':_0xd0e0('0xa'),'fields':[_0xd0e0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0890=['lodash','util','api','moment','rimraf','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0890,0x1e6));var _0x0089=function(_0x2b6ef8,_0x279c2a){_0x2b6ef8=_0x2b6ef8-0x0;var _0x4f1af2=_0x0890[_0x2b6ef8];return _0x4f1af2;};'use strict';var _=require(_0x0089('0x0'));var util=require(_0x0089('0x1'));var logger=require('../../config/logger')(_0x0089('0x2'));var moment=require(_0x0089('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0089('0x4'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x5c2c5b,_0x11c291){return _0x5c2c5b[_0x0089('0x5')](_0x0089('0x6'),attributes,{'tableName':_0x0089('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0089('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 21af7dc..83dac54 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 _0x4f5d=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4f5d[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var moment=require(_0xd4f5('0x2'));var BPromise=require(_0xd4f5('0x3'));var rs=require(_0xd4f5('0x4'));var fs=require('fs');var Redis=require(_0xd4f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4f5('0x6'));var logger=require(_0xd4f5('0x7'))(_0xd4f5('0x8'));var config=require(_0xd4f5('0x9'));var jayson=require(_0xd4f5('0xa'));var client=jayson[_0xd4f5('0xb')][_0xd4f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ab294,_0x150de6,_0x1d2d72){return new BPromise(function(_0xee2bc,_0x2690e8){return client[_0xd4f5('0xd')](_0x3ab294,_0x1d2d72)['then'](function(_0x4424cb){logger[_0xd4f5('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x150de6,_0xd4f5('0xf'));logger[_0xd4f5('0x10')](_0xd4f5('0x11'),_0x150de6,_0xd4f5('0xf'),JSON[_0xd4f5('0x12')](_0x4424cb));if(_0x4424cb[_0xd4f5('0x13')]){if(_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x14')]===0x1f4){logger[_0xd4f5('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x150de6,_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x15')]);return _0x2690e8(_0x4424cb['error'][_0xd4f5('0x15')]);}logger[_0xd4f5('0x13')](_0xd4f5('0x16'),_0x150de6,_0x4424cb['error'][_0xd4f5('0x15')]);return _0xee2bc(_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x15')]);}else{logger[_0xd4f5('0xe')](_0xd4f5('0x16'),_0x150de6,_0xd4f5('0xf'));_0xee2bc(_0x4424cb[_0xd4f5('0x17')][_0xd4f5('0x15')]);}})['catch'](function(_0x452e46){logger['error'](_0xd4f5('0x16'),_0x150de6,_0x452e46);_0x2690e8(_0x452e46);});});} \ No newline at end of file +var _0x2b83=['request','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x57dbc5,_0x119d48){var _0x218f2f=function(_0x58087c){while(--_0x58087c){_0x57dbc5['push'](_0x57dbc5['shift']());}};_0x218f2f(++_0x119d48);}(_0x2b83,0x1d3));var _0x32b8=function(_0x1d408f,_0x3bc1fd){_0x1d408f=_0x1d408f-0x0;var _0xadd488=_0x2b83[_0x1d408f];return _0xadd488;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var moment=require(_0x32b8('0x1'));var BPromise=require('bluebird');var rs=require(_0x32b8('0x2'));var fs=require('fs');var Redis=require(_0x32b8('0x3'));var db=require(_0x32b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32b8('0x5'));var config=require(_0x32b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x32b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18150c,_0x342a03,_0x36bde3){return new BPromise(function(_0x10a967,_0x5cc6b2){return client[_0x32b8('0x8')](_0x18150c,_0x36bde3)[_0x32b8('0x9')](function(_0x48257a){logger['info'](_0x32b8('0xa'),_0x342a03,'request\x20sent');logger[_0x32b8('0xb')](_0x32b8('0xc'),_0x342a03,_0x32b8('0xd'),JSON[_0x32b8('0xe')](_0x48257a));if(_0x48257a['error']){if(_0x48257a[_0x32b8('0xf')][_0x32b8('0x10')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x342a03,_0x48257a[_0x32b8('0xf')]['message']);return _0x5cc6b2(_0x48257a[_0x32b8('0xf')]['message']);}logger[_0x32b8('0xf')](_0x32b8('0xa'),_0x342a03,_0x48257a[_0x32b8('0xf')][_0x32b8('0x11')]);return _0x10a967(_0x48257a[_0x32b8('0xf')]['message']);}else{logger['info'](_0x32b8('0xa'),_0x342a03,'request\x20sent');_0x10a967(_0x48257a['result']['message']);}})[_0x32b8('0x12')](function(_0x57a060){logger['error'](_0x32b8('0xa'),_0x342a03,_0x57a060);_0x5cc6b2(_0x57a060);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 594f4f1..322836e 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 _0xd6a1=['originalname','replace','%s-%s%s','now','create','update','delete','/:id','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/download','isAuthenticated','download','diskStorage','join','server/files/sounds/original/'];(function(_0x57d294,_0x9a7de6){var _0x17aa2c=function(_0x2ce840){while(--_0x2ce840){_0x57d294['push'](_0x57d294['shift']());}};_0x17aa2c(++_0x9a7de6);}(_0xd6a1,0x7b));var _0x1d6a=function(_0x5557da,_0x5449be){_0x5557da=_0x5557da-0x0;var _0x42e591=_0xd6a1[_0x5557da];return _0x42e591;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d6a('0x0'));var timeout=require(_0x1d6a('0x1'));var express=require('express');var router=express[_0x1d6a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1d6a('0x3'));var interaction=require(_0x1d6a('0x4'));var config=require(_0x1d6a('0x5'));var controller=require('./sound.controller');router[_0x1d6a('0x6')]('/',auth['isAuthenticated'](),controller[_0x1d6a('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1d6a('0x8')]);router[_0x1d6a('0x6')](_0x1d6a('0x9'),auth[_0x1d6a('0xa')](),controller[_0x1d6a('0xb')]);var upload=multer({'storage':multer[_0x1d6a('0xc')]({'destination':function(_0x204f26,_0x541ca8,_0x1c5c9f){_0x1c5c9f(null,path[_0x1d6a('0xd')](config['root'],_0x1d6a('0xe')));},'filename':function(_0x569ff0,_0x499c12,_0x128c95){_0x499c12[_0x1d6a('0xf')]=_0x499c12[_0x1d6a('0xf')][_0x1d6a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x128c95(null,util['format'](_0x1d6a('0x11'),path['basename'](_0x499c12[_0x1d6a('0xf')],path['extname'](_0x499c12[_0x1d6a('0xf')])),Date[_0x1d6a('0x12')](),path['extname'](_0x499c12[_0x1d6a('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x1d6a('0x13')]);router['put']('/:id',auth[_0x1d6a('0xa')](),controller[_0x1d6a('0x14')]);router[_0x1d6a('0x15')](_0x1d6a('0x16'),auth[_0x1d6a('0xa')](),controller[_0x1d6a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6907=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','index','/:id','show','get','join','root','server/files/sounds/original/','originalname','%s-%s%s','basename','now','extname','post','file','create','put','delete','exports'];(function(_0x5e2052,_0x53a934){var _0x28ce47=function(_0x43a7e7){while(--_0x43a7e7){_0x5e2052['push'](_0x5e2052['shift']());}};_0x28ce47(++_0x53a934);}(_0x6907,0x17a));var _0x7690=function(_0x1cc40e,_0x14d6e2){_0x1cc40e=_0x1cc40e-0x0;var _0x52fd7b=_0x6907[_0x1cc40e];return _0x52fd7b;};'use strict';var multer=require('multer');var util=require(_0x7690('0x0'));var path=require(_0x7690('0x1'));var timeout=require(_0x7690('0x2'));var express=require('express');var router=express[_0x7690('0x3')]();var fs_extra=require(_0x7690('0x4'));var auth=require(_0x7690('0x5'));var interaction=require(_0x7690('0x6'));var config=require('../../config/environment');var controller=require(_0x7690('0x7'));router['get']('/',auth[_0x7690('0x8')](),controller[_0x7690('0x9')]);router['get'](_0x7690('0xa'),auth['isAuthenticated'](),controller[_0x7690('0xb')]);router[_0x7690('0xc')]('/:id/download',auth[_0x7690('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3eac93,_0x564b7b,_0x4a92de){_0x4a92de(null,path[_0x7690('0xd')](config[_0x7690('0xe')],_0x7690('0xf')));},'filename':function(_0x1e52f8,_0x34915e,_0x2ee97b){_0x34915e['originalname']=_0x34915e[_0x7690('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ee97b(null,util['format'](_0x7690('0x11'),path[_0x7690('0x12')](_0x34915e[_0x7690('0x10')],path['extname'](_0x34915e[_0x7690('0x10')])),Date[_0x7690('0x13')](),path[_0x7690('0x14')](_0x34915e[_0x7690('0x10')])));}})});router[_0x7690('0x15')]('/',upload['single'](_0x7690('0x16')),controller[_0x7690('0x17')]);router[_0x7690('0x18')](_0x7690('0xa'),auth[_0x7690('0x8')](),controller['update']);router[_0x7690('0x19')](_0x7690('0xa'),auth[_0x7690('0x8')](),controller[_0x7690('0x19')]);module[_0x7690('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c8702b1..64a93d9 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 _0xa9a2=['INTEGER','BIGINT','exports','name','STRING','FLOAT'];(function(_0x41caa0,_0x587334){var _0x1c0aff=function(_0x3c766c){while(--_0x3c766c){_0x41caa0['push'](_0x41caa0['shift']());}};_0x1c0aff(++_0x587334);}(_0xa9a2,0x86));var _0x2a9a=function(_0x211c6f,_0xb94824){_0x211c6f=_0x211c6f-0x0;var _0x37c0dc=_0xa9a2[_0x211c6f];return _0x37c0dc;};'use strict';var Sequelize=require('sequelize');module[_0x2a9a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2a9a('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2a9a('0x2')]},'display_name':{'type':Sequelize[_0x2a9a('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x2a9a('0x2')]},'original_format':{'type':Sequelize[_0x2a9a('0x2')]},'original_duration':{'type':Sequelize[_0x2a9a('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x2a9a('0x4')]},'original_bitRate':{'type':Sequelize[_0x2a9a('0x5')]},'original_sampleRate':{'type':Sequelize[_0x2a9a('0x4')]},'converted_format':{'type':Sequelize[_0x2a9a('0x2')]},'converted_duration':{'type':Sequelize[_0x2a9a('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x2a9a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x2a9a('0x4')]},'converted_bitRate':{'type':Sequelize[_0x2a9a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x2a9a('0x4')]}}; \ No newline at end of file +var _0x772d=['FLOAT','BIGINT','INTEGER','STRING','name'];(function(_0x5c0f88,_0x5a6c17){var _0x3ff850=function(_0x327de4){while(--_0x327de4){_0x5c0f88['push'](_0x5c0f88['shift']());}};_0x3ff850(++_0x5a6c17);}(_0x772d,0x10c));var _0xd772=function(_0x5db71f,_0x165ff9){_0x5db71f=_0x5db71f-0x0;var _0x19f8c6=_0x772d[_0x5db71f];return _0x19f8c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd772('0x0')],'unique':_0xd772('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd772('0x0')]},'display_name':{'type':Sequelize[_0xd772('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0xd772('0x0')]},'original_format':{'type':Sequelize[_0xd772('0x0')]},'original_duration':{'type':Sequelize[_0xd772('0x2')]},'original_sampleCount':{'type':Sequelize[_0xd772('0x3')]},'original_channelCount':{'type':Sequelize[_0xd772('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xd772('0x4')]},'converted_format':{'type':Sequelize[_0xd772('0x0')]},'converted_duration':{'type':Sequelize[_0xd772('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xd772('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xd772('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xd772('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 802d4c1..3f949a5 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 _0x0215=['filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','download','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','file','extname','originalname','filename','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Sounds','autoAssociation','start','description','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick'];(function(_0x2368f5,_0x204aff){var _0x5b3b26=function(_0x1dc5c5){while(--_0x1dc5c5){_0x2368f5['push'](_0x2368f5['shift']());}};_0x5b3b26(++_0x204aff);}(_0x0215,0x1b5));var _0x5021=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x0215[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0x5021('0x0'));var rimraf=require(_0x5021('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5021('0x2'));var rp=require(_0x5021('0x3'));var moment=require('moment');var BPromise=require(_0x5021('0x4'));var Mustache=require('mustache');var util=require(_0x5021('0x5'));var path=require('path');var sox=require(_0x5021('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5021('0x7'));var squel=require('squel');var crypto=require(_0x5021('0x8'));var jsforce=require(_0x5021('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5021('0xa'));var querystring=require('querystring');var Papa=require(_0x5021('0xb'));var Redis=require(_0x5021('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5021('0xd'));var hardwareService=require(_0x5021('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5021('0xf'));var licenseUtil=require(_0x5021('0x10'));var db=require(_0x5021('0x11'))['db'];function respondWithStatusCode(_0x424e41,_0x4e0d6e){_0x4e0d6e=_0x4e0d6e||0xcc;return function(_0x3aad08){if(_0x3aad08){return _0x424e41[_0x5021('0x12')](_0x4e0d6e);}return _0x424e41[_0x5021('0x13')](_0x4e0d6e)[_0x5021('0x14')]();};}function respondWithResult(_0x1b9d94,_0x5ca70f){_0x5ca70f=_0x5ca70f||0xc8;return function(_0x33fa53){if(_0x33fa53){return _0x1b9d94[_0x5021('0x13')](_0x5ca70f)[_0x5021('0x15')](_0x33fa53);}};}function respondWithFilteredResult(_0x51ebe1,_0x271944){return function(_0x110541){if(_0x110541){var _0x535399=typeof _0x271944[_0x5021('0x16')]==='undefined'&&typeof _0x271944['limit']==='undefined';var _0x522133=_0x110541[_0x5021('0x17')];var _0x449409=_0x535399?0x0:_0x271944[_0x5021('0x16')];var _0x29bbf6=_0x535399?_0x110541[_0x5021('0x17')]:_0x271944[_0x5021('0x16')]+_0x271944[_0x5021('0x18')];var _0x2502ed;if(_0x29bbf6>=_0x522133){_0x29bbf6=_0x522133;_0x2502ed=0xc8;}else{_0x2502ed=0xce;}_0x51ebe1[_0x5021('0x13')](_0x2502ed);return _0x51ebe1[_0x5021('0x19')](_0x5021('0x1a'),_0x449409+'-'+_0x29bbf6+'/'+_0x522133)['json'](_0x110541);}return null;};}function patchUpdates(_0x5da838){return function(_0x19b0f2){try{jsonpatch[_0x5021('0x1b')](_0x19b0f2,_0x5da838,!![]);}catch(_0x238f23){return BPromise[_0x5021('0x1c')](_0x238f23);}return _0x19b0f2['save']();};}function saveUpdates(_0x9654a8,_0x3a27c6){return function(_0x22602d){if(_0x22602d){return _0x22602d[_0x5021('0x1d')](_0x9654a8)[_0x5021('0x1e')](function(_0x554905){return _0x554905;});}return null;};}function removeEntity(_0x3faa02,_0x176acc){return function(_0x500671){if(_0x500671){return _0x500671[_0x5021('0x1f')]()['then'](function(){var _0x1138e9=_0x500671['get']({'plain':!![]});var _0x3eca03='Sounds';return db[_0x5021('0x20')][_0x5021('0x1f')]({'where':{'type':_0x3eca03,'resourceId':_0x1138e9['id']}})[_0x5021('0x1e')](function(){return _0x500671;});})['then'](function(){_0x3faa02[_0x5021('0x13')](0xcc)[_0x5021('0x14')]();});}};}function handleEntityNotFound(_0x37dc07,_0x2ce4ac){return function(_0x4050a8){if(!_0x4050a8){_0x37dc07[_0x5021('0x12')](0x194);}return _0x4050a8;};}function handleError(_0x49630a,_0x48c478){_0x48c478=_0x48c478||0x1f4;return function(_0x13b9e4){logger[_0x5021('0x21')](_0x13b9e4[_0x5021('0x22')]);if(_0x13b9e4['name']){delete _0x13b9e4[_0x5021('0x23')];}_0x49630a[_0x5021('0x13')](_0x48c478)[_0x5021('0x24')](_0x13b9e4);};}exports[_0x5021('0x25')]=function(_0x1cde5f,_0x427791){var _0x40849d={},_0x3edaf7={},_0x5409d9={'count':0x0,'rows':[]};var _0x5d48ba=_['map'](db[_0x5021('0x26')][_0x5021('0x27')],function(_0x3c21af){return{'name':_0x3c21af[_0x5021('0x28')],'type':_0x3c21af[_0x5021('0x29')][_0x5021('0x2a')]};});_0x3edaf7[_0x5021('0x2b')]=_[_0x5021('0x2c')](_0x5d48ba,_0x5021('0x23'));_0x3edaf7[_0x5021('0x2d')]=_[_0x5021('0x2e')](_0x1cde5f[_0x5021('0x2d')]);_0x3edaf7['filters']=_[_0x5021('0x2f')](_0x3edaf7[_0x5021('0x2b')],_0x3edaf7[_0x5021('0x2d')]);_0x40849d[_0x5021('0x30')]=_[_0x5021('0x2f')](_0x3edaf7[_0x5021('0x2b')],qs[_0x5021('0x31')](_0x1cde5f[_0x5021('0x2d')]['fields']));_0x40849d[_0x5021('0x30')]=_0x40849d[_0x5021('0x30')][_0x5021('0x32')]?_0x40849d[_0x5021('0x30')]:_0x3edaf7[_0x5021('0x2b')];if(!_0x1cde5f[_0x5021('0x2d')]['hasOwnProperty'](_0x5021('0x33'))){_0x40849d[_0x5021('0x18')]=qs[_0x5021('0x18')](_0x1cde5f[_0x5021('0x2d')][_0x5021('0x18')]);_0x40849d['offset']=qs[_0x5021('0x16')](_0x1cde5f[_0x5021('0x2d')]['offset']);}_0x40849d['order']=qs[_0x5021('0x34')](_0x1cde5f[_0x5021('0x2d')][_0x5021('0x34')]);_0x40849d['where']=qs[_0x5021('0x35')](_[_0x5021('0x36')](_0x1cde5f[_0x5021('0x2d')],_0x3edaf7[_0x5021('0x35')]),_0x5d48ba);if(_0x1cde5f[_0x5021('0x2d')][_0x5021('0x37')]){_0x40849d[_0x5021('0x38')]=_['merge'](_0x40849d[_0x5021('0x38')],{'$or':_[_0x5021('0x2c')](_0x5d48ba,function(_0x41e1f1){if(_0x41e1f1[_0x5021('0x29')]!==_0x5021('0x39')){var _0x4a8942={};_0x4a8942[_0x41e1f1[_0x5021('0x23')]]={'$like':'%'+_0x1cde5f['query'][_0x5021('0x37')]+'%'};return _0x4a8942;}})});}_0x40849d=_['merge']({},_0x40849d,_0x1cde5f[_0x5021('0x3a')]);var _0x404042={'where':_0x40849d[_0x5021('0x38')]};return db[_0x5021('0x26')]['count'](_0x404042)[_0x5021('0x1e')](function(_0x2c5590){_0x5409d9[_0x5021('0x17')]=_0x2c5590;if(_0x1cde5f[_0x5021('0x2d')][_0x5021('0x3b')]){_0x40849d[_0x5021('0x3c')]=[{'all':!![]}];}return db[_0x5021('0x26')][_0x5021('0x3d')](_0x40849d);})[_0x5021('0x1e')](function(_0x4c55ed){_0x5409d9[_0x5021('0x3e')]=_0x4c55ed;return _0x5409d9;})[_0x5021('0x1e')](respondWithFilteredResult(_0x427791,_0x40849d))[_0x5021('0x3f')](handleError(_0x427791,null));};exports[_0x5021('0x40')]=function(_0x7013f0,_0x52ae6c){var _0x2a5a05={'raw':!![],'where':{'id':_0x7013f0['params']['id']}},_0x5adfdf={};_0x5adfdf[_0x5021('0x2b')]=_[_0x5021('0x2e')](db[_0x5021('0x26')]['rawAttributes']);_0x5adfdf['query']=_[_0x5021('0x2e')](_0x7013f0[_0x5021('0x2d')]);_0x5adfdf[_0x5021('0x35')]=_[_0x5021('0x2f')](_0x5adfdf['model'],_0x5adfdf[_0x5021('0x2d')]);_0x2a5a05['attributes']=_[_0x5021('0x2f')](_0x5adfdf['model'],qs[_0x5021('0x31')](_0x7013f0['query'][_0x5021('0x31')]));_0x2a5a05[_0x5021('0x30')]=_0x2a5a05['attributes'][_0x5021('0x32')]?_0x2a5a05[_0x5021('0x30')]:_0x5adfdf['model'];if(_0x7013f0[_0x5021('0x2d')][_0x5021('0x3b')]){_0x2a5a05[_0x5021('0x3c')]=[{'all':!![]}];}_0x2a5a05=_[_0x5021('0x41')]({},_0x2a5a05,_0x7013f0[_0x5021('0x3a')]);return db[_0x5021('0x26')][_0x5021('0x42')](_0x2a5a05)[_0x5021('0x1e')](handleEntityNotFound(_0x52ae6c,null))['then'](respondWithResult(_0x52ae6c,null))['catch'](handleError(_0x52ae6c,null));};exports[_0x5021('0x43')]=function(_0x1ae7ad,_0x23ca13,_0x5cf8f3){return db[_0x5021('0x26')][_0x5021('0x42')]({'where':{'id':_0x1ae7ad[_0x5021('0x44')]['id']},'attributes':['name',_0x5021('0x45'),_0x5021('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x23ca13,null))[_0x5021('0x1e')](function(_0x1b544d){if(_0x1b544d){if(!fs[_0x5021('0x47')](path[_0x5021('0x48')](config['root'],_0x5021('0x49'),_0x1b544d[_0x5021('0x45')]+'.'+_0x1b544d[_0x5021('0x46')]))){throw new db[(_0x5021('0x4a'))][(_0x5021('0x4b'))](_0x5021('0x4c'));}return _0x23ca13[_0x5021('0x43')](path[_0x5021('0x48')](config['root'],_0x5021('0x49'),util['format']('%s.%s',_0x1b544d[_0x5021('0x45')],_0x1b544d['converted_format'])),util[_0x5021('0x4d')](_0x5021('0x4e'),_0x1b544d[_0x5021('0x23')],_0x1b544d[_0x5021('0x46')]));}return null;})['catch'](handleError(_0x23ca13,null));};exports['create']=function(_0x286666,_0x902532,_0x1649e2){var _0x356c9b={'name':path[_0x5021('0x4f')](_0x286666[_0x5021('0x50')]['originalname'],path[_0x5021('0x51')](_0x286666[_0x5021('0x50')][_0x5021('0x52')])),'save_name':path['basename'](_0x286666[_0x5021('0x50')][_0x5021('0x53')],path[_0x5021('0x51')](_0x286666[_0x5021('0x50')]['filename'])),'original_format':path[_0x5021('0x51')](_0x286666[_0x5021('0x50')]['originalname'])[_0x5021('0x54')](0x1),'converted_format':_0x5021('0x55')};var _0x39f7a3=path['join'](config[_0x5021('0x56')],_0x5021('0x57'),_0x286666[_0x5021('0x50')]['filename']);var _0xe736=path['join'](config[_0x5021('0x56')],'server/files/sounds/converted',util['format'](_0x5021('0x4e'),path[_0x5021('0x4f')](_0x286666[_0x5021('0x50')][_0x5021('0x53')],path[_0x5021('0x51')](_0x286666[_0x5021('0x50')][_0x5021('0x53')])),_0x356c9b[_0x5021('0x46')]));logger[_0x5021('0x58')](_0x5021('0x59'),_0x39f7a3);logger[_0x5021('0x58')](_0x5021('0x5a'),_0xe736);try{fs['chmodSync'](_0x39f7a3,parseInt(_0x5021('0x5b'),0x8));var _0x5cd0b1=sox[_0x5021('0x5c')](_0x39f7a3,_0xe736,{'sampleRate':0x1f40,'format':_0x5021('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5cd0b1['on'](_0x5021('0x21'),function(_0x16fb74){fs[_0x5021('0x5d')](_0x39f7a3);_0x902532['status'](0x1f4)['send'](_0x16fb74);});_0x5cd0b1['on'](_0x5021('0x5e'),function(_0x12cd75){_0x356c9b[_0x5021('0x5f')]=isNaN(_0x12cd75[_0x5021('0x60')])?null:_0x12cd75[_0x5021('0x60')]*0x3e8;_0x356c9b[_0x5021('0x61')]=isNaN(_0x12cd75[_0x5021('0x62')])?null:_0x12cd75[_0x5021('0x62')];_0x356c9b[_0x5021('0x63')]=isNaN(_0x12cd75[_0x5021('0x64')])?null:_0x12cd75['channelCount'];_0x356c9b[_0x5021('0x65')]=isNaN(_0x12cd75[_0x5021('0x66')])?null:_0x12cd75[_0x5021('0x66')];_0x356c9b[_0x5021('0x67')]=isNaN(_0x12cd75[_0x5021('0x68')])?null:_0x12cd75[_0x5021('0x68')];});_0x5cd0b1['on']('dest',function(_0x3c8587){_0x356c9b[_0x5021('0x69')]=isNaN(_0x3c8587[_0x5021('0x60')])?null:_0x3c8587[_0x5021('0x60')]*0x3e8;_0x356c9b[_0x5021('0x6a')]=isNaN(_0x3c8587[_0x5021('0x62')])?null:_0x3c8587[_0x5021('0x62')];_0x356c9b['converted_channelCount']=isNaN(_0x3c8587[_0x5021('0x64')])?null:_0x3c8587['channelCount'];_0x356c9b[_0x5021('0x6b')]=isNaN(_0x3c8587[_0x5021('0x66')])?null:_0x3c8587[_0x5021('0x66')];_0x356c9b[_0x5021('0x6c')]=isNaN(_0x3c8587[_0x5021('0x68')])?null:_0x3c8587[_0x5021('0x68')];});_0x5cd0b1['on']('end',function(){fs[_0x5021('0x6d')](_0xe736,parseInt(_0x5021('0x5b'),0x8));return db['Sound'][_0x5021('0x6e')](_0x356c9b)['then'](function(_0x3dd191){var _0x5a9675={'role':_0x286666[_0x5021('0x6f')][_0x5021('0x70')],'userProfileId':_0x286666['body'][_0x5021('0x71')]};if(!_0x5a9675)throw new Error(_0x5021('0x72'));if(_0x5a9675[_0x5021('0x70')]===_0x5021('0x73')){var _0xa113a9=_0x3dd191[_0x5021('0x74')]({'plain':!![]});return db[_0x5021('0x75')][_0x5021('0x42')]({'where':{'name':_0x5021('0x76'),'userProfileId':_0x5a9675['userProfileId']},'raw':!![]})[_0x5021('0x1e')](function(_0xd7af12){if(_0xd7af12&&_0xd7af12[_0x5021('0x77')]===0x0){return db[_0x5021('0x20')][_0x5021('0x6e')]({'name':_0xa113a9[_0x5021('0x23')],'resourceId':_0xa113a9['id'],'type':_0xd7af12[_0x5021('0x23')],'sectionId':_0xd7af12['id']},{})[_0x5021('0x1e')](function(){return _0x3dd191;});}else{return _0x3dd191;}})['catch'](function(_0x28aaa2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28aaa2);throw _0x28aaa2;});}return _0x3dd191;})[_0x5021('0x1e')](respondWithResult(_0x902532,null))[_0x5021('0x3f')](handleError(_0x902532,null));});_0x5cd0b1[_0x5021('0x78')]();}catch(_0x5af1e9){_0x902532[_0x5021('0x13')](0x1f4)[_0x5021('0x24')](_0x5af1e9);}};exports[_0x5021('0x1d')]=function(_0x7e1079,_0x374b76,_0x18faf1){return db[_0x5021('0x26')][_0x5021('0x42')]({'where':{'id':_0x7e1079[_0x5021('0x44')]['id']}})[_0x5021('0x1e')](handleEntityNotFound(_0x374b76,null))[_0x5021('0x1e')](saveUpdates(_['pick'](_0x7e1079[_0x5021('0x6f')],['name',_0x5021('0x79')]),null))[_0x5021('0x1e')](respondWithResult(_0x374b76,null))['catch'](handleError(_0x374b76,null));};exports['delete']=function(_0x4ccdf2,_0x41e6f5,_0x18aa0f){return db[_0x5021('0x26')][_0x5021('0x42')]({'where':{'id':_0x4ccdf2['params']['id']}})[_0x5021('0x1e')](function(_0x398819){if(_0x398819){return _0x398819['destroy']();}})[_0x5021('0x1e')](function(_0x21350b){var _0x3f7bd2=path[_0x5021('0x48')](config['root'],_0x5021('0x57'),util[_0x5021('0x4d')](_0x5021('0x4e'),_0x21350b[_0x5021('0x45')],_0x21350b[_0x5021('0x7a')]));var _0x82ae46=path['join'](config['root'],_0x5021('0x49'),util[_0x5021('0x4d')](_0x5021('0x4e'),_0x21350b[_0x5021('0x45')],_0x21350b[_0x5021('0x46')]));fs[_0x5021('0x5d')](_0x3f7bd2);fs[_0x5021('0x5d')](_0x82ae46);return _0x21350b;})[_0x5021('0x1e')](function(_0x5472af){if(_0x5472af){return _0x41e6f5[_0x5021('0x13')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x41e6f5,null))[_0x5021('0x3f')](handleError(_0x41e6f5,null));}; \ No newline at end of file +var _0x4fac=['chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','includeAll','include','rows','params','merge','find','catch','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','file','originalname','filename','extname','wav','server/files/sounds/original','basename','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s'];(function(_0x2c9065,_0x39c45c){var _0x3c22c9=function(_0xceb76){while(--_0xceb76){_0x2c9065['push'](_0x2c9065['shift']());}};_0x3c22c9(++_0x39c45c);}(_0x4fac,0x1e9));var _0xc4fa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4fac[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc4fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4fa('0x1'));var jsonpatch=require(_0xc4fa('0x2'));var rp=require(_0xc4fa('0x3'));var moment=require('moment');var BPromise=require(_0xc4fa('0x4'));var Mustache=require(_0xc4fa('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc4fa('0x6'));var csv=require('to-csv');var ejs=require(_0xc4fa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4fa('0x8'));var jsforce=require(_0xc4fa('0x9'));var deskjs=require(_0xc4fa('0xa'));var toCsv=require(_0xc4fa('0xb'));var querystring=require('querystring');var Papa=require(_0xc4fa('0xc'));var Redis=require('ioredis');var authService=require(_0xc4fa('0xd'));var qs=require(_0xc4fa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4fa('0xf'));var logger=require(_0xc4fa('0x10'))('api');var utils=require(_0xc4fa('0x11'));var config=require(_0xc4fa('0x12'));var licenseUtil=require(_0xc4fa('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab9ab,_0x2d8d5d){_0x2d8d5d=_0x2d8d5d||0xcc;return function(_0x506c0a){if(_0x506c0a){return _0x5ab9ab[_0xc4fa('0x14')](_0x2d8d5d);}return _0x5ab9ab[_0xc4fa('0x15')](_0x2d8d5d)[_0xc4fa('0x16')]();};}function respondWithResult(_0x4b8dce,_0x46e891){_0x46e891=_0x46e891||0xc8;return function(_0x28607d){if(_0x28607d){return _0x4b8dce[_0xc4fa('0x15')](_0x46e891)['json'](_0x28607d);}};}function respondWithFilteredResult(_0x340337,_0x4c8f2d){return function(_0x4ae007){if(_0x4ae007){var _0x314818=typeof _0x4c8f2d[_0xc4fa('0x17')]===_0xc4fa('0x18')&&typeof _0x4c8f2d[_0xc4fa('0x19')]===_0xc4fa('0x18');var _0x3794c8=_0x4ae007['count'];var _0x31b810=_0x314818?0x0:_0x4c8f2d['offset'];var _0x204c2a=_0x314818?_0x4ae007[_0xc4fa('0x1a')]:_0x4c8f2d['offset']+_0x4c8f2d[_0xc4fa('0x19')];var _0x4a659;if(_0x204c2a>=_0x3794c8){_0x204c2a=_0x3794c8;_0x4a659=0xc8;}else{_0x4a659=0xce;}_0x340337['status'](_0x4a659);return _0x340337[_0xc4fa('0x1b')](_0xc4fa('0x1c'),_0x31b810+'-'+_0x204c2a+'/'+_0x3794c8)['json'](_0x4ae007);}return null;};}function patchUpdates(_0x18c05a){return function(_0x4121ea){try{jsonpatch[_0xc4fa('0x1d')](_0x4121ea,_0x18c05a,!![]);}catch(_0x436207){return BPromise[_0xc4fa('0x1e')](_0x436207);}return _0x4121ea[_0xc4fa('0x1f')]();};}function saveUpdates(_0x397486,_0x5a7520){return function(_0xee8033){if(_0xee8033){return _0xee8033[_0xc4fa('0x20')](_0x397486)['then'](function(_0x5e6105){return _0x5e6105;});}return null;};}function removeEntity(_0x1f1229,_0x2d36ef){return function(_0x3709e0){if(_0x3709e0){return _0x3709e0[_0xc4fa('0x21')]()[_0xc4fa('0x22')](function(){var _0x2d9a18=_0x3709e0['get']({'plain':!![]});var _0x100230='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0x100230,'resourceId':_0x2d9a18['id']}})[_0xc4fa('0x22')](function(){return _0x3709e0;});})['then'](function(){_0x1f1229[_0xc4fa('0x15')](0xcc)[_0xc4fa('0x16')]();});}};}function handleEntityNotFound(_0x559658,_0xabbe79){return function(_0x14b83b){if(!_0x14b83b){_0x559658[_0xc4fa('0x14')](0x194);}return _0x14b83b;};}function handleError(_0x2417fa,_0x476f51){_0x476f51=_0x476f51||0x1f4;return function(_0x1d7bc2){logger[_0xc4fa('0x23')](_0x1d7bc2[_0xc4fa('0x24')]);if(_0x1d7bc2[_0xc4fa('0x25')]){delete _0x1d7bc2['name'];}_0x2417fa[_0xc4fa('0x15')](_0x476f51)[_0xc4fa('0x26')](_0x1d7bc2);};}exports[_0xc4fa('0x27')]=function(_0x5c3947,_0x52cd1a){var _0x408d6d={},_0xac51d0={},_0x57dbee={'count':0x0,'rows':[]};var _0x53575e=_[_0xc4fa('0x28')](db[_0xc4fa('0x29')][_0xc4fa('0x2a')],function(_0x46f037){return{'name':_0x46f037[_0xc4fa('0x2b')],'type':_0x46f037[_0xc4fa('0x2c')]['key']};});_0xac51d0[_0xc4fa('0x2d')]=_['map'](_0x53575e,'name');_0xac51d0[_0xc4fa('0x2e')]=_[_0xc4fa('0x2f')](_0x5c3947[_0xc4fa('0x2e')]);_0xac51d0[_0xc4fa('0x30')]=_['intersection'](_0xac51d0[_0xc4fa('0x2d')],_0xac51d0[_0xc4fa('0x2e')]);_0x408d6d[_0xc4fa('0x31')]=_[_0xc4fa('0x32')](_0xac51d0['model'],qs[_0xc4fa('0x33')](_0x5c3947[_0xc4fa('0x2e')]['fields']));_0x408d6d[_0xc4fa('0x31')]=_0x408d6d['attributes'][_0xc4fa('0x34')]?_0x408d6d[_0xc4fa('0x31')]:_0xac51d0[_0xc4fa('0x2d')];if(!_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x35')]('nolimit')){_0x408d6d[_0xc4fa('0x19')]=qs['limit'](_0x5c3947[_0xc4fa('0x2e')]['limit']);_0x408d6d['offset']=qs[_0xc4fa('0x17')](_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x17')]);}_0x408d6d[_0xc4fa('0x36')]=qs[_0xc4fa('0x37')](_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x37')]);_0x408d6d['where']=qs[_0xc4fa('0x30')](_[_0xc4fa('0x38')](_0x5c3947[_0xc4fa('0x2e')],_0xac51d0[_0xc4fa('0x30')]),_0x53575e);if(_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x39')]){_0x408d6d['where']=_['merge'](_0x408d6d[_0xc4fa('0x3a')],{'$or':_[_0xc4fa('0x28')](_0x53575e,function(_0x17823d){if(_0x17823d[_0xc4fa('0x2c')]!=='VIRTUAL'){var _0x440492={};_0x440492[_0x17823d[_0xc4fa('0x25')]]={'$like':'%'+_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x39')]+'%'};return _0x440492;}})});}_0x408d6d=_['merge']({},_0x408d6d,_0x5c3947[_0xc4fa('0x3b')]);var _0x286f40={'where':_0x408d6d['where']};return db[_0xc4fa('0x29')]['count'](_0x286f40)['then'](function(_0x20e07f){_0x57dbee['count']=_0x20e07f;if(_0x5c3947[_0xc4fa('0x2e')][_0xc4fa('0x3c')]){_0x408d6d[_0xc4fa('0x3d')]=[{'all':!![]}];}return db[_0xc4fa('0x29')]['findAll'](_0x408d6d);})[_0xc4fa('0x22')](function(_0x2ce277){_0x57dbee[_0xc4fa('0x3e')]=_0x2ce277;return _0x57dbee;})[_0xc4fa('0x22')](respondWithFilteredResult(_0x52cd1a,_0x408d6d))['catch'](handleError(_0x52cd1a,null));};exports['show']=function(_0x7e96a8,_0x4f6e15){var _0x4c3f86={'raw':!![],'where':{'id':_0x7e96a8[_0xc4fa('0x3f')]['id']}},_0x1c3d6c={};_0x1c3d6c[_0xc4fa('0x2d')]=_[_0xc4fa('0x2f')](db[_0xc4fa('0x29')]['rawAttributes']);_0x1c3d6c[_0xc4fa('0x2e')]=_[_0xc4fa('0x2f')](_0x7e96a8[_0xc4fa('0x2e')]);_0x1c3d6c[_0xc4fa('0x30')]=_[_0xc4fa('0x32')](_0x1c3d6c[_0xc4fa('0x2d')],_0x1c3d6c[_0xc4fa('0x2e')]);_0x4c3f86['attributes']=_[_0xc4fa('0x32')](_0x1c3d6c['model'],qs[_0xc4fa('0x33')](_0x7e96a8[_0xc4fa('0x2e')][_0xc4fa('0x33')]));_0x4c3f86[_0xc4fa('0x31')]=_0x4c3f86[_0xc4fa('0x31')][_0xc4fa('0x34')]?_0x4c3f86['attributes']:_0x1c3d6c['model'];if(_0x7e96a8[_0xc4fa('0x2e')]['includeAll']){_0x4c3f86[_0xc4fa('0x3d')]=[{'all':!![]}];}_0x4c3f86=_[_0xc4fa('0x40')]({},_0x4c3f86,_0x7e96a8['options']);return db['Sound'][_0xc4fa('0x41')](_0x4c3f86)[_0xc4fa('0x22')](handleEntityNotFound(_0x4f6e15,null))[_0xc4fa('0x22')](respondWithResult(_0x4f6e15,null))[_0xc4fa('0x42')](handleError(_0x4f6e15,null));};exports[_0xc4fa('0x43')]=function(_0x1dfc4d,_0x693089,_0xa63566){return db[_0xc4fa('0x29')][_0xc4fa('0x41')]({'where':{'id':_0x1dfc4d['params']['id']},'attributes':[_0xc4fa('0x25'),'save_name',_0xc4fa('0x44')],'raw':!![]})[_0xc4fa('0x22')](handleEntityNotFound(_0x693089,null))[_0xc4fa('0x22')](function(_0x2c0f3d){if(_0x2c0f3d){if(!fs['existsSync'](path[_0xc4fa('0x45')](config[_0xc4fa('0x46')],_0xc4fa('0x47'),_0x2c0f3d[_0xc4fa('0x48')]+'.'+_0x2c0f3d[_0xc4fa('0x44')]))){throw new db[(_0xc4fa('0x49'))]['ValidationError'](_0xc4fa('0x4a'));}return _0x693089[_0xc4fa('0x43')](path[_0xc4fa('0x45')](config['root'],_0xc4fa('0x47'),util['format']('%s.%s',_0x2c0f3d[_0xc4fa('0x48')],_0x2c0f3d[_0xc4fa('0x44')])),util[_0xc4fa('0x4b')](_0xc4fa('0x4c'),_0x2c0f3d['name'],_0x2c0f3d[_0xc4fa('0x44')]));}return null;})[_0xc4fa('0x42')](handleError(_0x693089,null));};exports['create']=function(_0x1da5cb,_0x5d4f8e,_0x55fa45){var _0x3fb739={'name':path['basename'](_0x1da5cb[_0xc4fa('0x4d')][_0xc4fa('0x4e')],path['extname'](_0x1da5cb[_0xc4fa('0x4d')][_0xc4fa('0x4e')])),'save_name':path['basename'](_0x1da5cb[_0xc4fa('0x4d')][_0xc4fa('0x4f')],path[_0xc4fa('0x50')](_0x1da5cb[_0xc4fa('0x4d')]['filename'])),'original_format':path[_0xc4fa('0x50')](_0x1da5cb[_0xc4fa('0x4d')]['originalname'])['substring'](0x1),'converted_format':_0xc4fa('0x51')};var _0x107b79=path[_0xc4fa('0x45')](config[_0xc4fa('0x46')],_0xc4fa('0x52'),_0x1da5cb[_0xc4fa('0x4d')][_0xc4fa('0x4f')]);var _0x330bdc=path[_0xc4fa('0x45')](config[_0xc4fa('0x46')],_0xc4fa('0x47'),util[_0xc4fa('0x4b')](_0xc4fa('0x4c'),path[_0xc4fa('0x53')](_0x1da5cb[_0xc4fa('0x4d')][_0xc4fa('0x4f')],path[_0xc4fa('0x50')](_0x1da5cb[_0xc4fa('0x4d')]['filename'])),_0x3fb739[_0xc4fa('0x44')]));logger['info'](_0xc4fa('0x54'),_0x107b79);logger['info'](_0xc4fa('0x55'),_0x330bdc);try{fs[_0xc4fa('0x56')](_0x107b79,parseInt(_0xc4fa('0x57'),0x8));var _0x44d8c6=sox[_0xc4fa('0x58')](_0x107b79,_0x330bdc,{'sampleRate':0x1f40,'format':_0xc4fa('0x51'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44d8c6['on'](_0xc4fa('0x23'),function(_0x5b0662){fs[_0xc4fa('0x59')](_0x107b79);_0x5d4f8e[_0xc4fa('0x15')](0x1f4)[_0xc4fa('0x26')](_0x5b0662);});_0x44d8c6['on'](_0xc4fa('0x5a'),function(_0x5b4ef9){_0x3fb739[_0xc4fa('0x5b')]=isNaN(_0x5b4ef9[_0xc4fa('0x5c')])?null:_0x5b4ef9['duration']*0x3e8;_0x3fb739[_0xc4fa('0x5d')]=isNaN(_0x5b4ef9['sampleCount'])?null:_0x5b4ef9[_0xc4fa('0x5e')];_0x3fb739['original_channelCount']=isNaN(_0x5b4ef9['channelCount'])?null:_0x5b4ef9[_0xc4fa('0x5f')];_0x3fb739['original_bitRate']=isNaN(_0x5b4ef9[_0xc4fa('0x60')])?null:_0x5b4ef9[_0xc4fa('0x60')];_0x3fb739[_0xc4fa('0x61')]=isNaN(_0x5b4ef9[_0xc4fa('0x62')])?null:_0x5b4ef9[_0xc4fa('0x62')];});_0x44d8c6['on'](_0xc4fa('0x63'),function(_0x460205){_0x3fb739[_0xc4fa('0x64')]=isNaN(_0x460205[_0xc4fa('0x5c')])?null:_0x460205[_0xc4fa('0x5c')]*0x3e8;_0x3fb739[_0xc4fa('0x65')]=isNaN(_0x460205[_0xc4fa('0x5e')])?null:_0x460205['sampleCount'];_0x3fb739['converted_channelCount']=isNaN(_0x460205[_0xc4fa('0x5f')])?null:_0x460205[_0xc4fa('0x5f')];_0x3fb739['converted_bitRate']=isNaN(_0x460205[_0xc4fa('0x60')])?null:_0x460205[_0xc4fa('0x60')];_0x3fb739[_0xc4fa('0x66')]=isNaN(_0x460205['sampleRate'])?null:_0x460205[_0xc4fa('0x62')];});_0x44d8c6['on']('end',function(){fs[_0xc4fa('0x56')](_0x330bdc,parseInt(_0xc4fa('0x57'),0x8));return db[_0xc4fa('0x29')][_0xc4fa('0x67')](_0x3fb739)[_0xc4fa('0x22')](function(_0x2b4dd5){var _0x4c0b8a={'role':_0x1da5cb[_0xc4fa('0x68')][_0xc4fa('0x69')],'userProfileId':_0x1da5cb['body'][_0xc4fa('0x6a')]};if(!_0x4c0b8a)throw new Error(_0xc4fa('0x6b'));if(_0x4c0b8a['role']==='user'){var _0x51ac66=_0x2b4dd5[_0xc4fa('0x6c')]({'plain':!![]});return db[_0xc4fa('0x6d')]['find']({'where':{'name':'Sounds','userProfileId':_0x4c0b8a['userProfileId']},'raw':!![]})[_0xc4fa('0x22')](function(_0x1120b6){if(_0x1120b6&&_0x1120b6[_0xc4fa('0x6e')]===0x0){return db['UserProfileResource'][_0xc4fa('0x67')]({'name':_0x51ac66[_0xc4fa('0x25')],'resourceId':_0x51ac66['id'],'type':_0x1120b6[_0xc4fa('0x25')],'sectionId':_0x1120b6['id']},{})['then'](function(){return _0x2b4dd5;});}else{return _0x2b4dd5;}})[_0xc4fa('0x42')](function(_0x400416){logger[_0xc4fa('0x23')](_0xc4fa('0x6f'),_0x400416);throw _0x400416;});}return _0x2b4dd5;})[_0xc4fa('0x22')](respondWithResult(_0x5d4f8e,null))[_0xc4fa('0x42')](handleError(_0x5d4f8e,null));});_0x44d8c6[_0xc4fa('0x70')]();}catch(_0x24bc7){_0x5d4f8e['status'](0x1f4)[_0xc4fa('0x26')](_0x24bc7);}};exports[_0xc4fa('0x20')]=function(_0xc2b570,_0x50c7ff,_0x45b5eb){return db[_0xc4fa('0x29')]['find']({'where':{'id':_0xc2b570[_0xc4fa('0x3f')]['id']}})[_0xc4fa('0x22')](handleEntityNotFound(_0x50c7ff,null))['then'](saveUpdates(_[_0xc4fa('0x38')](_0xc2b570[_0xc4fa('0x68')],[_0xc4fa('0x25'),_0xc4fa('0x71')]),null))['then'](respondWithResult(_0x50c7ff,null))['catch'](handleError(_0x50c7ff,null));};exports[_0xc4fa('0x72')]=function(_0x177d56,_0x3f16aa,_0x48a6a7){return db[_0xc4fa('0x29')][_0xc4fa('0x41')]({'where':{'id':_0x177d56['params']['id']}})['then'](function(_0x4387f0){if(_0x4387f0){return _0x4387f0['destroy']();}})[_0xc4fa('0x22')](function(_0xb3415b){var _0x440fe5=path['join'](config[_0xc4fa('0x46')],_0xc4fa('0x52'),util['format'](_0xc4fa('0x4c'),_0xb3415b['save_name'],_0xb3415b['original_format']));var _0x52309e=path['join'](config[_0xc4fa('0x46')],_0xc4fa('0x47'),util[_0xc4fa('0x4b')](_0xc4fa('0x4c'),_0xb3415b[_0xc4fa('0x48')],_0xb3415b[_0xc4fa('0x44')]));fs['unlinkSync'](_0x440fe5);fs['unlinkSync'](_0x52309e);return _0xb3415b;})['then'](function(_0x4bbd71){if(_0x4bbd71){return _0x3f16aa['status'](0xcc)[_0xc4fa('0x16')]();}})['then'](handleEntityNotFound(_0x3f16aa,null))['catch'](handleError(_0x3f16aa,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index aa5f012..c35d936 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 _0x8e7e=['request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','tools_sounds','lodash','util','api','moment','bluebird'];(function(_0x2035a1,_0x2692d2){var _0x18bd10=function(_0x3e28d0){while(--_0x3e28d0){_0x2035a1['push'](_0x2035a1['shift']());}};_0x18bd10(++_0x2692d2);}(_0x8e7e,0x133));var _0xe8e7=function(_0x2ce266,_0x5f39b2){_0x2ce266=_0x2ce266-0x0;var _0x1463c8=_0x8e7e[_0x2ce266];return _0x1463c8;};'use strict';var _=require(_0xe8e7('0x0'));var util=require(_0xe8e7('0x1'));var logger=require('../../config/logger')(_0xe8e7('0x2'));var moment=require(_0xe8e7('0x3'));var BPromise=require(_0xe8e7('0x4'));var rp=require(_0xe8e7('0x5'));var fs=require('fs');var path=require(_0xe8e7('0x6'));var rimraf=require(_0xe8e7('0x7'));var config=require(_0xe8e7('0x8'));var attributes=require(_0xe8e7('0x9'));module[_0xe8e7('0xa')]=function(_0x4ccd76,_0x5c4a35){return _0x4ccd76['define']('Sound',attributes,{'tableName':_0xe8e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7144=['tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Sound'];(function(_0x287bd8,_0x11eb6e){var _0x3d9f67=function(_0x3fcb5e){while(--_0x3fcb5e){_0x287bd8['push'](_0x287bd8['shift']());}};_0x3d9f67(++_0x11eb6e);}(_0x7144,0x1a5));var _0x4714=function(_0x5419b3,_0x443da9){_0x5419b3=_0x5419b3-0x0;var _0x1ef195=_0x7144[_0x5419b3];return _0x1ef195;};'use strict';var _=require(_0x4714('0x0'));var util=require('util');var logger=require(_0x4714('0x1'))(_0x4714('0x2'));var moment=require(_0x4714('0x3'));var BPromise=require(_0x4714('0x4'));var rp=require(_0x4714('0x5'));var fs=require('fs');var path=require(_0x4714('0x6'));var rimraf=require(_0x4714('0x7'));var config=require(_0x4714('0x8'));var attributes=require('./sound.attributes');module[_0x4714('0x9')]=function(_0x5843f7,_0x179c68){return _0x5843f7['define'](_0x4714('0xa'),attributes,{'tableName':_0x4714('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 899fba2..97c8766 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 _0x3a27=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Sound','options','raw','where','attributes','include','map','model','ShowSound','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x408146,_0x1ec77a){var _0x46c408=function(_0x44c8d5){while(--_0x44c8d5){_0x408146['push'](_0x408146['shift']());}};_0x46c408(++_0x1ec77a);}(_0x3a27,0x163));var _0x73a2=function(_0x5492fd,_0x1edbb0){_0x5492fd=_0x5492fd-0x0;var _0x3011d7=_0x3a27[_0x5492fd];return _0x3011d7;};'use strict';var _=require(_0x73a2('0x0'));var util=require(_0x73a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x73a2('0x2'));var fs=require('fs');var Redis=require(_0x73a2('0x3'));var db=require(_0x73a2('0x4'))['db'];var utils=require(_0x73a2('0x5'));var logger=require(_0x73a2('0x6'))(_0x73a2('0x7'));var config=require(_0x73a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x73a2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x535e5d,_0x50953c,_0x2ff5b5){return new BPromise(function(_0x56c77c,_0xe4f44f){return client['request'](_0x535e5d,_0x2ff5b5)[_0x73a2('0xa')](function(_0x4eb146){logger[_0x73a2('0xb')](_0x73a2('0xc'),_0x50953c,_0x73a2('0xd'));logger[_0x73a2('0xe')](_0x73a2('0xf'),_0x50953c,'request\x20sent',JSON[_0x73a2('0x10')](_0x4eb146));if(_0x4eb146[_0x73a2('0x11')]){if(_0x4eb146[_0x73a2('0x11')]['code']===0x1f4){logger[_0x73a2('0x11')](_0x73a2('0xc'),_0x50953c,_0x4eb146[_0x73a2('0x11')][_0x73a2('0x12')]);return _0xe4f44f(_0x4eb146[_0x73a2('0x11')][_0x73a2('0x12')]);}logger[_0x73a2('0x11')](_0x73a2('0xc'),_0x50953c,_0x4eb146[_0x73a2('0x11')][_0x73a2('0x12')]);return _0x56c77c(_0x4eb146['error'][_0x73a2('0x12')]);}else{logger[_0x73a2('0xb')](_0x73a2('0xc'),_0x50953c,_0x73a2('0xd'));_0x56c77c(_0x4eb146[_0x73a2('0x13')][_0x73a2('0x12')]);}})[_0x73a2('0x14')](function(_0x4d6274){logger['error'](_0x73a2('0xc'),_0x50953c,_0x4d6274);_0xe4f44f(_0x4d6274);});});}exports['ShowSound']=function(_0x464784){var _0x31bd2e=this;return new Promise(function(_0x6013db,_0x408013){return db[_0x73a2('0x15')]['find']({'raw':_0x464784['options']?_0x464784[_0x73a2('0x16')][_0x73a2('0x17')]===undefined?!![]:![]:!![],'where':_0x464784[_0x73a2('0x16')]?_0x464784['options'][_0x73a2('0x18')]||null:null,'attributes':_0x464784[_0x73a2('0x16')]?_0x464784[_0x73a2('0x16')][_0x73a2('0x19')]||null:null,'include':_0x464784[_0x73a2('0x16')]?_0x464784['options'][_0x73a2('0x1a')]?_[_0x73a2('0x1b')](_0x464784[_0x73a2('0x16')]['include'],function(_0x5c471f){return{'model':db[_0x5c471f['model']],'as':_0x5c471f['as'],'attributes':_0x5c471f[_0x73a2('0x19')],'include':_0x5c471f[_0x73a2('0x1a')]?_[_0x73a2('0x1b')](_0x5c471f['include'],function(_0x307c51){return{'model':db[_0x307c51['model']],'as':_0x307c51['as'],'attributes':_0x307c51[_0x73a2('0x19')],'include':_0x307c51['include']?_[_0x73a2('0x1b')](_0x307c51['include'],function(_0x51a371){return{'model':db[_0x51a371[_0x73a2('0x1c')]],'as':_0x51a371['as'],'attributes':_0x51a371['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b435a){logger[_0x73a2('0xb')](_0x73a2('0x1d'),_0x464784);logger[_0x73a2('0xe')]('ShowSound',_0x464784,JSON['stringify'](_0x4b435a));_0x6013db(_0x4b435a);})[_0x73a2('0x14')](function(_0xa3d056){logger[_0x73a2('0x11')](_0x73a2('0x1d'),_0xa3d056[_0x73a2('0x12')],_0x464784);_0x408013(_0x31bd2e['error'](0x1f4,_0xa3d056[_0x73a2('0x12')]));});});}; \ No newline at end of file +var _0x081a=['error','message','info','result','catch','find','options','include','map','model','attributes','then','ShowSound','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3579b2,_0x4b4ab0){var _0x547abf=function(_0x475566){while(--_0x475566){_0x3579b2['push'](_0x3579b2['shift']());}};_0x547abf(++_0x4b4ab0);}(_0x081a,0x99));var _0xa081=function(_0x1f1bbc,_0x40ca9b){_0x1f1bbc=_0x1f1bbc-0x0;var _0x3f9d0d=_0x081a[_0x1f1bbc];return _0x3f9d0d;};'use strict';var _=require(_0xa081('0x0'));var util=require(_0xa081('0x1'));var moment=require(_0xa081('0x2'));var BPromise=require('bluebird');var rs=require(_0xa081('0x3'));var fs=require('fs');var Redis=require(_0xa081('0x4'));var db=require(_0xa081('0x5'))['db'];var utils=require(_0xa081('0x6'));var logger=require('../../config/logger')(_0xa081('0x7'));var config=require('../../config/environment');var jayson=require(_0xa081('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d32e2,_0x40c989,_0x2da036){return new BPromise(function(_0x3c5eae,_0x1ff2ed){return client[_0xa081('0x9')](_0x5d32e2,_0x2da036)['then'](function(_0x39652a){logger['info'](_0xa081('0xa'),_0x40c989,_0xa081('0xb'));logger[_0xa081('0xc')](_0xa081('0xd'),_0x40c989,'request\x20sent',JSON[_0xa081('0xe')](_0x39652a));if(_0x39652a[_0xa081('0xf')]){if(_0x39652a[_0xa081('0xf')]['code']===0x1f4){logger[_0xa081('0xf')](_0xa081('0xa'),_0x40c989,_0x39652a[_0xa081('0xf')][_0xa081('0x10')]);return _0x1ff2ed(_0x39652a[_0xa081('0xf')]['message']);}logger[_0xa081('0xf')]('Sound,\x20%s,\x20%s',_0x40c989,_0x39652a['error'][_0xa081('0x10')]);return _0x3c5eae(_0x39652a['error']['message']);}else{logger[_0xa081('0x11')](_0xa081('0xa'),_0x40c989,_0xa081('0xb'));_0x3c5eae(_0x39652a[_0xa081('0x12')][_0xa081('0x10')]);}})[_0xa081('0x13')](function(_0x3216c9){logger[_0xa081('0xf')](_0xa081('0xa'),_0x40c989,_0x3216c9);_0x1ff2ed(_0x3216c9);});});}exports['ShowSound']=function(_0x332957){var _0x24eb5f=this;return new Promise(function(_0x57f4c5,_0x1bfa0e){return db['Sound'][_0xa081('0x14')]({'raw':_0x332957[_0xa081('0x15')]?_0x332957[_0xa081('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x332957[_0xa081('0x15')]?_0x332957['options']['where']||null:null,'attributes':_0x332957[_0xa081('0x15')]?_0x332957['options']['attributes']||null:null,'include':_0x332957[_0xa081('0x15')]?_0x332957[_0xa081('0x15')][_0xa081('0x16')]?_[_0xa081('0x17')](_0x332957[_0xa081('0x15')][_0xa081('0x16')],function(_0x34874c){return{'model':db[_0x34874c[_0xa081('0x18')]],'as':_0x34874c['as'],'attributes':_0x34874c[_0xa081('0x19')],'include':_0x34874c['include']?_[_0xa081('0x17')](_0x34874c[_0xa081('0x16')],function(_0x2665cc){return{'model':db[_0x2665cc[_0xa081('0x18')]],'as':_0x2665cc['as'],'attributes':_0x2665cc['attributes'],'include':_0x2665cc[_0xa081('0x16')]?_[_0xa081('0x17')](_0x2665cc[_0xa081('0x16')],function(_0x96c576){return{'model':db[_0x96c576[_0xa081('0x18')]],'as':_0x96c576['as'],'attributes':_0x96c576[_0xa081('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa081('0x1a')](function(_0x4cfb92){logger['info'](_0xa081('0x1b'),_0x332957);logger[_0xa081('0xc')](_0xa081('0x1b'),_0x332957,JSON[_0xa081('0xe')](_0x4cfb92));_0x57f4c5(_0x4cfb92);})[_0xa081('0x13')](function(_0x2e4b67){logger[_0xa081('0xf')](_0xa081('0x1b'),_0x2e4b67[_0xa081('0x10')],_0x332957);_0x1bfa0e(_0x24eb5f[_0xa081('0xf')](0x1f4,_0x2e4b67[_0xa081('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b476432..56505d5 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x2233c2,_0x3340f7){var _0x4995fb=function(_0x1172d6){while(--_0x1172d6){_0x2233c2['push'](_0x2233c2['shift']());}};_0x4995fb(++_0x3340f7);}(_0x757a,0xde));var _0xa757=function(_0x44f4a8,_0x434eb6){_0x44f4a8=_0x44f4a8-0x0;var _0x2dea00=_0x757a[_0x44f4a8];return _0x2dea00;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x45723a,_0x1ac456){var _0x115035=function(_0x469778){while(--_0x469778){_0x45723a['push'](_0x45723a['shift']());}};_0x115035(++_0x1ac456);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xb7e7[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 8c3be22..2200a06 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 _0x29a4=['ENUM','out','exports','STRING','TEXT','medium'];(function(_0x56f873,_0x18d656){var _0x354083=function(_0x35b83f){while(--_0x35b83f){_0x56f873['push'](_0x56f873['shift']());}};_0x354083(++_0x18d656);}(_0x29a4,0x19a));var _0x429a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x29a4[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x429a('0x0')]={'uniqueid':{'type':Sequelize[_0x429a('0x1')]},'body':{'type':Sequelize[_0x429a('0x2')](_0x429a('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x429a('0x4')]('in',_0x429a('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x429a('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x01f0=['TEXT','medium','ENUM','out','STRING','sequelize','exports'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x01f0,0xe5));var _0x001f=function(_0x1a5456,_0x5e9c68){_0x1a5456=_0x1a5456-0x0;var _0x4fff34=_0x01f0[_0x1a5456];return _0x4fff34;};'use strict';var Sequelize=require(_0x001f('0x0'));module[_0x001f('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x001f('0x2')](_0x001f('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x001f('0x4')]('in',_0x001f('0x5')),'defaultValue':_0x001f('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x001f('0x6')]},'providerResponse':{'type':Sequelize[_0x001f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 5f1e9fb..70546ee 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 _0x20f2=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','filters','attributes','length','query','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x594f0c,_0x2dccd7){var _0xda7001=function(_0x37b516){while(--_0x37b516){_0x594f0c['push'](_0x594f0c['shift']());}};_0xda7001(++_0x2dccd7);}(_0x20f2,0x1e6));var _0x220f=function(_0x2603dc,_0x5e167b){_0x2603dc=_0x2603dc-0x0;var _0x170a09=_0x20f2[_0x2603dc];return _0x170a09;};'use strict';var emlformat=require(_0x220f('0x0'));var rimraf=require(_0x220f('0x1'));var zipdir=require(_0x220f('0x2'));var jsonpatch=require(_0x220f('0x3'));var rp=require(_0x220f('0x4'));var moment=require(_0x220f('0x5'));var BPromise=require(_0x220f('0x6'));var Mustache=require(_0x220f('0x7'));var util=require(_0x220f('0x8'));var path=require(_0x220f('0x9'));var sox=require(_0x220f('0xa'));var csv=require(_0x220f('0xb'));var ejs=require(_0x220f('0xc'));var fs=require('fs');var fs_extra=require(_0x220f('0xd'));var _=require(_0x220f('0xe'));var squel=require(_0x220f('0xf'));var crypto=require('crypto');var jsforce=require(_0x220f('0x10'));var deskjs=require(_0x220f('0x11'));var toCsv=require(_0x220f('0xb'));var querystring=require(_0x220f('0x12'));var Papa=require(_0x220f('0x13'));var Redis=require(_0x220f('0x14'));var authService=require(_0x220f('0x15'));var qs=require(_0x220f('0x16'));var as=require(_0x220f('0x17'));var hardwareService=require(_0x220f('0x18'));var logger=require(_0x220f('0x19'))(_0x220f('0x1a'));var utils=require(_0x220f('0x1b'));var config=require(_0x220f('0x1c'));var licenseUtil=require(_0x220f('0x1d'));var db=require(_0x220f('0x1e'))['db'];function respondWithStatusCode(_0x54086e,_0x4e79af){_0x4e79af=_0x4e79af||0xcc;return function(_0x220597){if(_0x220597){return _0x54086e[_0x220f('0x1f')](_0x4e79af);}return _0x54086e[_0x220f('0x20')](_0x4e79af)[_0x220f('0x21')]();};}function respondWithResult(_0x415b1f,_0x1fe4c7){_0x1fe4c7=_0x1fe4c7||0xc8;return function(_0x44663d){if(_0x44663d){return _0x415b1f[_0x220f('0x20')](_0x1fe4c7)[_0x220f('0x22')](_0x44663d);}};}function respondWithFilteredResult(_0x4965b9,_0x29edef){return function(_0x329913){if(_0x329913){var _0x50abf4=typeof _0x29edef[_0x220f('0x23')]===_0x220f('0x24')&&typeof _0x29edef['limit']==='undefined';var _0x2c1b61=_0x329913[_0x220f('0x25')];var _0x14b9d=_0x50abf4?0x0:_0x29edef[_0x220f('0x23')];var _0x446820=_0x50abf4?_0x329913['count']:_0x29edef[_0x220f('0x23')]+_0x29edef[_0x220f('0x26')];var _0x5a364c;if(_0x446820>=_0x2c1b61){_0x446820=_0x2c1b61;_0x5a364c=0xc8;}else{_0x5a364c=0xce;}_0x4965b9[_0x220f('0x20')](_0x5a364c);return _0x4965b9[_0x220f('0x27')](_0x220f('0x28'),_0x14b9d+'-'+_0x446820+'/'+_0x2c1b61)[_0x220f('0x22')](_0x329913);}return null;};}function patchUpdates(_0x3b6e7c){return function(_0x2e1291){try{jsonpatch[_0x220f('0x29')](_0x2e1291,_0x3b6e7c,!![]);}catch(_0x22be8a){return BPromise[_0x220f('0x2a')](_0x22be8a);}return _0x2e1291[_0x220f('0x2b')]();};}function saveUpdates(_0x196c99,_0x20f317){return function(_0x3133f3){if(_0x3133f3){return _0x3133f3[_0x220f('0x2c')](_0x196c99)['then'](function(_0x1081d8){return _0x1081d8;});}return null;};}function removeEntity(_0x405a8b,_0x1ddc73){return function(_0x198aa0){if(_0x198aa0){return _0x198aa0[_0x220f('0x2d')]()[_0x220f('0x2e')](function(){_0x405a8b[_0x220f('0x20')](0xcc)[_0x220f('0x21')]();});}};}function handleEntityNotFound(_0x4a3844,_0x44e406){return function(_0x424f42){if(!_0x424f42){_0x4a3844[_0x220f('0x1f')](0x194);}return _0x424f42;};}function handleError(_0x1aebb7,_0x3c36be){_0x3c36be=_0x3c36be||0x1f4;return function(_0x125d2f){logger[_0x220f('0x2f')](_0x125d2f[_0x220f('0x30')]);if(_0x125d2f[_0x220f('0x31')]){delete _0x125d2f[_0x220f('0x31')];}_0x1aebb7[_0x220f('0x20')](_0x3c36be)[_0x220f('0x32')](_0x125d2f);};}exports[_0x220f('0x33')]=function(_0x3883ab,_0x5f2df8){var _0x588c12={},_0x293c12={},_0x1aa4be={'count':0x0,'rows':[]};var _0x129bf3=_[_0x220f('0x34')](db[_0x220f('0x35')][_0x220f('0x36')],function(_0xfa2415){return{'name':_0xfa2415[_0x220f('0x37')],'type':_0xfa2415[_0x220f('0x38')][_0x220f('0x39')]};});_0x293c12[_0x220f('0x3a')]=_[_0x220f('0x34')](_0x129bf3,_0x220f('0x31'));_0x293c12['query']=_['keys'](_0x3883ab['query']);_0x293c12[_0x220f('0x3b')]=_['intersection'](_0x293c12[_0x220f('0x3a')],_0x293c12['query']);_0x588c12[_0x220f('0x3c')]=_['intersection'](_0x293c12['model'],qs['fields'](_0x3883ab['query']['fields']));_0x588c12[_0x220f('0x3c')]=_0x588c12[_0x220f('0x3c')][_0x220f('0x3d')]?_0x588c12[_0x220f('0x3c')]:_0x293c12[_0x220f('0x3a')];if(!_0x3883ab[_0x220f('0x3e')][_0x220f('0x3f')](_0x220f('0x40'))){_0x588c12[_0x220f('0x26')]=qs['limit'](_0x3883ab[_0x220f('0x3e')][_0x220f('0x26')]);_0x588c12[_0x220f('0x23')]=qs['offset'](_0x3883ab[_0x220f('0x3e')][_0x220f('0x23')]);}_0x588c12['order']=qs['sort'](_0x3883ab[_0x220f('0x3e')][_0x220f('0x41')]);_0x588c12['where']=qs[_0x220f('0x3b')](_['pick'](_0x3883ab[_0x220f('0x3e')],_0x293c12[_0x220f('0x3b')]),_0x129bf3);if(_0x3883ab[_0x220f('0x3e')][_0x220f('0x42')]){_0x588c12['where']=_[_0x220f('0x43')](_0x588c12[_0x220f('0x44')],{'$or':_[_0x220f('0x34')](_0x129bf3,function(_0x85f5c4){if(_0x85f5c4[_0x220f('0x38')]!==_0x220f('0x45')){var _0x315a16={};_0x315a16[_0x85f5c4[_0x220f('0x31')]]={'$like':'%'+_0x3883ab[_0x220f('0x3e')]['filter']+'%'};return _0x315a16;}})});}_0x588c12=_['merge']({},_0x588c12,_0x3883ab[_0x220f('0x46')]);var _0x450c19={'where':_0x588c12[_0x220f('0x44')]};return db['SquareMessage']['count'](_0x450c19)['then'](function(_0x154a0c){_0x1aa4be[_0x220f('0x25')]=_0x154a0c;if(_0x3883ab['query'][_0x220f('0x47')]){_0x588c12[_0x220f('0x48')]=[{'all':!![]}];}return db[_0x220f('0x35')][_0x220f('0x49')](_0x588c12);})[_0x220f('0x2e')](function(_0x200fb4){_0x1aa4be[_0x220f('0x4a')]=_0x200fb4;return _0x1aa4be;})[_0x220f('0x2e')](respondWithFilteredResult(_0x5f2df8,_0x588c12))[_0x220f('0x4b')](handleError(_0x5f2df8,null));};exports[_0x220f('0x4c')]=function(_0x54a8a2,_0x1a3f92){var _0x492d02={'raw':!![],'where':{'id':_0x54a8a2[_0x220f('0x4d')]['id']}},_0x5271c2={};_0x5271c2[_0x220f('0x3a')]=_[_0x220f('0x4e')](db[_0x220f('0x35')][_0x220f('0x36')]);_0x5271c2[_0x220f('0x3e')]=_[_0x220f('0x4e')](_0x54a8a2['query']);_0x5271c2[_0x220f('0x3b')]=_[_0x220f('0x4f')](_0x5271c2['model'],_0x5271c2[_0x220f('0x3e')]);_0x492d02['attributes']=_[_0x220f('0x4f')](_0x5271c2[_0x220f('0x3a')],qs[_0x220f('0x50')](_0x54a8a2[_0x220f('0x3e')][_0x220f('0x50')]));_0x492d02['attributes']=_0x492d02['attributes'][_0x220f('0x3d')]?_0x492d02['attributes']:_0x5271c2['model'];if(_0x54a8a2[_0x220f('0x3e')][_0x220f('0x47')]){_0x492d02[_0x220f('0x48')]=[{'all':!![]}];}_0x492d02=_[_0x220f('0x43')]({},_0x492d02,_0x54a8a2[_0x220f('0x46')]);return db[_0x220f('0x35')][_0x220f('0x51')](_0x492d02)['then'](handleEntityNotFound(_0x1a3f92,null))['then'](respondWithResult(_0x1a3f92,null))['catch'](handleError(_0x1a3f92,null));};exports[_0x220f('0x52')]=function(_0x1e7403,_0x353b56){return db[_0x220f('0x35')][_0x220f('0x52')](_0x1e7403[_0x220f('0x53')],{})[_0x220f('0x2e')](respondWithResult(_0x353b56,0xc9))['catch'](handleError(_0x353b56,null));};exports[_0x220f('0x2c')]=function(_0x1f18e4,_0x2fbdee){if(_0x1f18e4['body']['id']){delete _0x1f18e4[_0x220f('0x53')]['id'];}return db['SquareMessage'][_0x220f('0x51')]({'where':{'id':_0x1f18e4[_0x220f('0x4d')]['id']}})[_0x220f('0x2e')](handleEntityNotFound(_0x2fbdee,null))[_0x220f('0x2e')](saveUpdates(_0x1f18e4[_0x220f('0x53')],null))[_0x220f('0x2e')](respondWithResult(_0x2fbdee,null))[_0x220f('0x4b')](handleError(_0x2fbdee,null));};exports['destroy']=function(_0x153c40,_0x504cda){return db[_0x220f('0x35')][_0x220f('0x51')]({'where':{'id':_0x153c40['params']['id']}})[_0x220f('0x2e')](handleEntityNotFound(_0x504cda,null))['then'](removeEntity(_0x504cda,null))[_0x220f('0x4b')](handleError(_0x504cda,null));}; \ No newline at end of file +var _0x480d=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','merge','filter','options','where','includeAll','findAll','show','params','include','find','catch'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0x480d,0x1c5));var _0xd480=function(_0xea9a2,_0x485523){_0xea9a2=_0xea9a2-0x0;var _0x9cd9ca=_0x480d[_0xea9a2];return _0x9cd9ca;};'use strict';var emlformat=require(_0xd480('0x0'));var rimraf=require(_0xd480('0x1'));var zipdir=require(_0xd480('0x2'));var jsonpatch=require(_0xd480('0x3'));var rp=require(_0xd480('0x4'));var moment=require(_0xd480('0x5'));var BPromise=require(_0xd480('0x6'));var Mustache=require(_0xd480('0x7'));var util=require('util');var path=require(_0xd480('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd480('0x9'));var fs=require('fs');var fs_extra=require(_0xd480('0xa'));var _=require(_0xd480('0xb'));var squel=require('squel');var crypto=require(_0xd480('0xc'));var jsforce=require(_0xd480('0xd'));var deskjs=require(_0xd480('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd480('0xf'));var Redis=require(_0xd480('0x10'));var authService=require(_0xd480('0x11'));var qs=require(_0xd480('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd480('0x13'));var logger=require(_0xd480('0x14'))(_0xd480('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd480('0x16'));var db=require(_0xd480('0x17'))['db'];function respondWithStatusCode(_0x3eb732,_0x39c18d){_0x39c18d=_0x39c18d||0xcc;return function(_0x359ebb){if(_0x359ebb){return _0x3eb732[_0xd480('0x18')](_0x39c18d);}return _0x3eb732['status'](_0x39c18d)[_0xd480('0x19')]();};}function respondWithResult(_0x3254c2,_0x4b3c64){_0x4b3c64=_0x4b3c64||0xc8;return function(_0x1254a8){if(_0x1254a8){return _0x3254c2[_0xd480('0x1a')](_0x4b3c64)['json'](_0x1254a8);}};}function respondWithFilteredResult(_0x10bc0a,_0x266830){return function(_0x3d34b2){if(_0x3d34b2){var _0x5d59af=typeof _0x266830[_0xd480('0x1b')]===_0xd480('0x1c')&&typeof _0x266830['limit']===_0xd480('0x1c');var _0x1f1727=_0x3d34b2[_0xd480('0x1d')];var _0x450933=_0x5d59af?0x0:_0x266830[_0xd480('0x1b')];var _0x51b2a9=_0x5d59af?_0x3d34b2[_0xd480('0x1d')]:_0x266830['offset']+_0x266830[_0xd480('0x1e')];var _0x12d7a1;if(_0x51b2a9>=_0x1f1727){_0x51b2a9=_0x1f1727;_0x12d7a1=0xc8;}else{_0x12d7a1=0xce;}_0x10bc0a['status'](_0x12d7a1);return _0x10bc0a[_0xd480('0x1f')](_0xd480('0x20'),_0x450933+'-'+_0x51b2a9+'/'+_0x1f1727)[_0xd480('0x21')](_0x3d34b2);}return null;};}function patchUpdates(_0x5a7abf){return function(_0x13ccd5){try{jsonpatch[_0xd480('0x22')](_0x13ccd5,_0x5a7abf,!![]);}catch(_0x4d3c3a){return BPromise[_0xd480('0x23')](_0x4d3c3a);}return _0x13ccd5[_0xd480('0x24')]();};}function saveUpdates(_0xefd785,_0x635a87){return function(_0x40c5cc){if(_0x40c5cc){return _0x40c5cc[_0xd480('0x25')](_0xefd785)[_0xd480('0x26')](function(_0x575579){return _0x575579;});}return null;};}function removeEntity(_0x404c99,_0x49021b){return function(_0x5969ed){if(_0x5969ed){return _0x5969ed['destroy']()[_0xd480('0x26')](function(){_0x404c99[_0xd480('0x1a')](0xcc)[_0xd480('0x19')]();});}};}function handleEntityNotFound(_0x23015b,_0x2740a4){return function(_0x524e05){if(!_0x524e05){_0x23015b[_0xd480('0x18')](0x194);}return _0x524e05;};}function handleError(_0x9bb135,_0x5adaaf){_0x5adaaf=_0x5adaaf||0x1f4;return function(_0x42716b){logger['error'](_0x42716b[_0xd480('0x27')]);if(_0x42716b[_0xd480('0x28')]){delete _0x42716b[_0xd480('0x28')];}_0x9bb135[_0xd480('0x1a')](_0x5adaaf)[_0xd480('0x29')](_0x42716b);};}exports[_0xd480('0x2a')]=function(_0x1236d6,_0x40ed46){var _0x5a6683={},_0x2a123f={},_0x1687a9={'count':0x0,'rows':[]};var _0x1f35a9=_['map'](db[_0xd480('0x2b')][_0xd480('0x2c')],function(_0x557d1a){return{'name':_0x557d1a[_0xd480('0x2d')],'type':_0x557d1a[_0xd480('0x2e')][_0xd480('0x2f')]};});_0x2a123f[_0xd480('0x30')]=_[_0xd480('0x31')](_0x1f35a9,_0xd480('0x28'));_0x2a123f['query']=_[_0xd480('0x32')](_0x1236d6[_0xd480('0x33')]);_0x2a123f['filters']=_[_0xd480('0x34')](_0x2a123f[_0xd480('0x30')],_0x2a123f[_0xd480('0x33')]);_0x5a6683['attributes']=_[_0xd480('0x34')](_0x2a123f[_0xd480('0x30')],qs[_0xd480('0x35')](_0x1236d6[_0xd480('0x33')][_0xd480('0x35')]));_0x5a6683[_0xd480('0x36')]=_0x5a6683[_0xd480('0x36')][_0xd480('0x37')]?_0x5a6683[_0xd480('0x36')]:_0x2a123f[_0xd480('0x30')];if(!_0x1236d6[_0xd480('0x33')]['hasOwnProperty'](_0xd480('0x38'))){_0x5a6683['limit']=qs['limit'](_0x1236d6[_0xd480('0x33')][_0xd480('0x1e')]);_0x5a6683['offset']=qs[_0xd480('0x1b')](_0x1236d6[_0xd480('0x33')]['offset']);}_0x5a6683[_0xd480('0x39')]=qs[_0xd480('0x3a')](_0x1236d6['query']['sort']);_0x5a6683['where']=qs[_0xd480('0x3b')](_[_0xd480('0x3c')](_0x1236d6[_0xd480('0x33')],_0x2a123f[_0xd480('0x3b')]),_0x1f35a9);if(_0x1236d6[_0xd480('0x33')]['filter']){_0x5a6683['where']=_[_0xd480('0x3d')](_0x5a6683['where'],{'$or':_[_0xd480('0x31')](_0x1f35a9,function(_0x30d209){if(_0x30d209[_0xd480('0x2e')]!=='VIRTUAL'){var _0x35a5a1={};_0x35a5a1[_0x30d209[_0xd480('0x28')]]={'$like':'%'+_0x1236d6[_0xd480('0x33')][_0xd480('0x3e')]+'%'};return _0x35a5a1;}})});}_0x5a6683=_[_0xd480('0x3d')]({},_0x5a6683,_0x1236d6[_0xd480('0x3f')]);var _0x5e78d5={'where':_0x5a6683[_0xd480('0x40')]};return db[_0xd480('0x2b')]['count'](_0x5e78d5)[_0xd480('0x26')](function(_0x505921){_0x1687a9[_0xd480('0x1d')]=_0x505921;if(_0x1236d6[_0xd480('0x33')][_0xd480('0x41')]){_0x5a6683['include']=[{'all':!![]}];}return db[_0xd480('0x2b')][_0xd480('0x42')](_0x5a6683);})[_0xd480('0x26')](function(_0x25208e){_0x1687a9['rows']=_0x25208e;return _0x1687a9;})[_0xd480('0x26')](respondWithFilteredResult(_0x40ed46,_0x5a6683))['catch'](handleError(_0x40ed46,null));};exports[_0xd480('0x43')]=function(_0x3b9a45,_0xbdc9a5){var _0x51b98a={'raw':!![],'where':{'id':_0x3b9a45[_0xd480('0x44')]['id']}},_0xef213e={};_0xef213e[_0xd480('0x30')]=_[_0xd480('0x32')](db['SquareMessage']['rawAttributes']);_0xef213e[_0xd480('0x33')]=_['keys'](_0x3b9a45[_0xd480('0x33')]);_0xef213e[_0xd480('0x3b')]=_['intersection'](_0xef213e[_0xd480('0x30')],_0xef213e[_0xd480('0x33')]);_0x51b98a[_0xd480('0x36')]=_[_0xd480('0x34')](_0xef213e['model'],qs['fields'](_0x3b9a45[_0xd480('0x33')]['fields']));_0x51b98a[_0xd480('0x36')]=_0x51b98a['attributes'][_0xd480('0x37')]?_0x51b98a[_0xd480('0x36')]:_0xef213e[_0xd480('0x30')];if(_0x3b9a45['query']['includeAll']){_0x51b98a[_0xd480('0x45')]=[{'all':!![]}];}_0x51b98a=_['merge']({},_0x51b98a,_0x3b9a45['options']);return db[_0xd480('0x2b')][_0xd480('0x46')](_0x51b98a)[_0xd480('0x26')](handleEntityNotFound(_0xbdc9a5,null))[_0xd480('0x26')](respondWithResult(_0xbdc9a5,null))[_0xd480('0x47')](handleError(_0xbdc9a5,null));};exports['create']=function(_0x5ddc24,_0x42b623){return db['SquareMessage'][_0xd480('0x48')](_0x5ddc24[_0xd480('0x49')],{})['then'](respondWithResult(_0x42b623,0xc9))[_0xd480('0x47')](handleError(_0x42b623,null));};exports[_0xd480('0x25')]=function(_0x306cb1,_0x4acbab){if(_0x306cb1[_0xd480('0x49')]['id']){delete _0x306cb1[_0xd480('0x49')]['id'];}return db[_0xd480('0x2b')][_0xd480('0x46')]({'where':{'id':_0x306cb1[_0xd480('0x44')]['id']}})['then'](handleEntityNotFound(_0x4acbab,null))['then'](saveUpdates(_0x306cb1[_0xd480('0x49')],null))['then'](respondWithResult(_0x4acbab,null))['catch'](handleError(_0x4acbab,null));};exports[_0xd480('0x4a')]=function(_0x3c8cd7,_0x35b35e){return db['SquareMessage'][_0xd480('0x46')]({'where':{'id':_0x3c8cd7[_0xd480('0x44')]['id']}})['then'](handleEntityNotFound(_0x35b35e,null))[_0xd480('0x26')](removeEntity(_0x35b35e,null))[_0xd480('0x47')](handleError(_0x35b35e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2a04204..7876838 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 _0x48ff=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','api','moment','request-promise','path','rimraf'];(function(_0x32fab5,_0x1c3ea6){var _0x1983ea=function(_0x2c2289){while(--_0x2c2289){_0x32fab5['push'](_0x32fab5['shift']());}};_0x1983ea(++_0x1c3ea6);}(_0x48ff,0x1a9));var _0xf48f=function(_0x145153,_0x15247e){_0x145153=_0x145153-0x0;var _0x38cfe2=_0x48ff[_0x145153];return _0x38cfe2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf48f('0x0'));var moment=require(_0xf48f('0x1'));var BPromise=require('bluebird');var rp=require(_0xf48f('0x2'));var fs=require('fs');var path=require(_0xf48f('0x3'));var rimraf=require(_0xf48f('0x4'));var config=require('../../config/environment');var attributes=require(_0xf48f('0x5'));module[_0xf48f('0x6')]=function(_0x2d555f,_0x2e1ac9){return _0x2d555f[_0xf48f('0x7')](_0xf48f('0x8'),attributes,{'tableName':_0xf48f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7a4=['square_messages','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','SquareMessage'];(function(_0x5e6ebe,_0x373752){var _0x5d80a0=function(_0x145677){while(--_0x145677){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x5d80a0(++_0x373752);}(_0xe7a4,0x97));var _0x4e7a=function(_0x5af347,_0x5e9c72){_0x5af347=_0x5af347-0x0;var _0x246eff=_0xe7a4[_0x5af347];return _0x246eff;};'use strict';var _=require('lodash');var util=require(_0x4e7a('0x0'));var logger=require(_0x4e7a('0x1'))(_0x4e7a('0x2'));var moment=require(_0x4e7a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e7a('0x4'));var rimraf=require(_0x4e7a('0x5'));var config=require(_0x4e7a('0x6'));var attributes=require('./squareMessage.attributes');module[_0x4e7a('0x7')]=function(_0x509d15,_0x2b218c){return _0x509d15['define'](_0x4e7a('0x8'),attributes,{'tableName':_0x4e7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 68b6d5f..ffdb703 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 _0x0223=['jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2f1d86,_0x43b15b){var _0x4058f9=function(_0x170ab3){while(--_0x170ab3){_0x2f1d86['push'](_0x2f1d86['shift']());}};_0x4058f9(++_0x43b15b);}(_0x0223,0xc2));var _0x3022=function(_0x5305c0,_0x2588e3){_0x5305c0=_0x5305c0-0x0;var _0x5c27bd=_0x0223[_0x5305c0];return _0x5c27bd;};'use strict';var _=require(_0x3022('0x0'));var util=require(_0x3022('0x1'));var moment=require(_0x3022('0x2'));var BPromise=require(_0x3022('0x3'));var rs=require(_0x3022('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3022('0x5'))['db'];var utils=require(_0x3022('0x6'));var logger=require(_0x3022('0x7'))(_0x3022('0x8'));var config=require('../../config/environment');var jayson=require(_0x3022('0x9'));var client=jayson[_0x3022('0xa')][_0x3022('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5056e7,_0x132773,_0x191efd){return new BPromise(function(_0x43d297,_0x1e23e4){return client[_0x3022('0xc')](_0x5056e7,_0x191efd)[_0x3022('0xd')](function(_0x2d9964){logger[_0x3022('0xe')]('SquareMessage,\x20%s,\x20%s',_0x132773,_0x3022('0xf'));logger[_0x3022('0x10')](_0x3022('0x11'),_0x132773,_0x3022('0xf'),JSON[_0x3022('0x12')](_0x2d9964));if(_0x2d9964[_0x3022('0x13')]){if(_0x2d9964[_0x3022('0x13')][_0x3022('0x14')]===0x1f4){logger['error'](_0x3022('0x15'),_0x132773,_0x2d9964[_0x3022('0x13')]['message']);return _0x1e23e4(_0x2d9964[_0x3022('0x13')]['message']);}logger[_0x3022('0x13')](_0x3022('0x15'),_0x132773,_0x2d9964[_0x3022('0x13')]['message']);return _0x43d297(_0x2d9964[_0x3022('0x13')][_0x3022('0x16')]);}else{logger['info'](_0x3022('0x15'),_0x132773,'request\x20sent');_0x43d297(_0x2d9964[_0x3022('0x17')]['message']);}})['catch'](function(_0x435af4){logger['error'](_0x3022('0x15'),_0x132773,_0x435af4);_0x1e23e4(_0x435af4);});});}exports[_0x3022('0x18')]=function(_0x1bbf4c){var _0x65b424=this;return new Promise(function(_0x47f05c,_0xa8d4b6){return db[_0x3022('0x19')][_0x3022('0x1a')](_0x1bbf4c['body'],{'raw':_0x1bbf4c[_0x3022('0x1b')]?_0x1bbf4c[_0x3022('0x1b')][_0x3022('0x1c')]===undefined?!![]:![]:!![]})[_0x3022('0xd')](function(_0x6bf25d){logger[_0x3022('0xe')]('CreateSquareMessage',_0x1bbf4c);logger['debug']('CreateSquareMessage',_0x1bbf4c,JSON[_0x3022('0x12')](_0x6bf25d));_0x47f05c(_0x6bf25d);})['catch'](function(_0x1fdabf){logger[_0x3022('0x13')]('CreateSquareMessage',_0x1fdabf['message'],_0x1bbf4c);_0xa8d4b6(_0x65b424['error'](0x1f4,_0x1fdabf[_0x3022('0x16')]));});});}; \ No newline at end of file +var _0xc8f5=['request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1be1f6,_0x5e7089){var _0x2bd577=function(_0x210461){while(--_0x210461){_0x1be1f6['push'](_0x1be1f6['shift']());}};_0x2bd577(++_0x5e7089);}(_0xc8f5,0xa3));var _0x5c8f=function(_0x11b4fb,_0x10c784){_0x11b4fb=_0x11b4fb-0x0;var _0x56cbb5=_0xc8f5[_0x11b4fb];return _0x56cbb5;};'use strict';var _=require(_0x5c8f('0x0'));var util=require(_0x5c8f('0x1'));var moment=require('moment');var BPromise=require(_0x5c8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c8f('0x3'));var db=require(_0x5c8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c8f('0x5'))(_0x5c8f('0x6'));var config=require(_0x5c8f('0x7'));var jayson=require(_0x5c8f('0x8'));var client=jayson[_0x5c8f('0x9')][_0x5c8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49fe74,_0x318214,_0x28b7d3){return new BPromise(function(_0x7d5b4e,_0x399035){return client[_0x5c8f('0xb')](_0x49fe74,_0x28b7d3)[_0x5c8f('0xc')](function(_0x4d65da){logger[_0x5c8f('0xd')]('SquareMessage,\x20%s,\x20%s',_0x318214,_0x5c8f('0xe'));logger[_0x5c8f('0xf')](_0x5c8f('0x10'),_0x318214,_0x5c8f('0xe'),JSON[_0x5c8f('0x11')](_0x4d65da));if(_0x4d65da[_0x5c8f('0x12')]){if(_0x4d65da[_0x5c8f('0x12')][_0x5c8f('0x13')]===0x1f4){logger[_0x5c8f('0x12')]('SquareMessage,\x20%s,\x20%s',_0x318214,_0x4d65da[_0x5c8f('0x12')][_0x5c8f('0x14')]);return _0x399035(_0x4d65da[_0x5c8f('0x12')][_0x5c8f('0x14')]);}logger[_0x5c8f('0x12')](_0x5c8f('0x15'),_0x318214,_0x4d65da['error'][_0x5c8f('0x14')]);return _0x7d5b4e(_0x4d65da[_0x5c8f('0x12')][_0x5c8f('0x14')]);}else{logger[_0x5c8f('0xd')](_0x5c8f('0x15'),_0x318214,_0x5c8f('0xe'));_0x7d5b4e(_0x4d65da[_0x5c8f('0x16')]['message']);}})[_0x5c8f('0x17')](function(_0x25add2){logger[_0x5c8f('0x12')](_0x5c8f('0x15'),_0x318214,_0x25add2);_0x399035(_0x25add2);});});}exports[_0x5c8f('0x18')]=function(_0x2d0261){var _0x1ad3bf=this;return new Promise(function(_0x16d867,_0x4b5ecc){return db[_0x5c8f('0x19')][_0x5c8f('0x1a')](_0x2d0261['body'],{'raw':_0x2d0261[_0x5c8f('0x1b')]?_0x2d0261['options'][_0x5c8f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4cb976){logger[_0x5c8f('0xd')](_0x5c8f('0x18'),_0x2d0261);logger['debug']('CreateSquareMessage',_0x2d0261,JSON[_0x5c8f('0x11')](_0x4cb976));_0x16d867(_0x4cb976);})['catch'](function(_0xb9f4ee){logger[_0x5c8f('0x12')]('CreateSquareMessage',_0xb9f4ee[_0x5c8f('0x14')],_0x2d0261);_0x4b5ecc(_0x1ad3bf['error'](0x1f4,_0xb9f4ee[_0x5c8f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index bd183ff..0c51a39 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 _0x65c1=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','/:id','isAuthenticated','/:id/test','15s','test','post','create','update','delete','exports'];(function(_0x2e62ae,_0x12c9d3){var _0xfd788b=function(_0xd50008){while(--_0xd50008){_0x2e62ae['push'](_0x2e62ae['shift']());}};_0xfd788b(++_0x12c9d3);}(_0x65c1,0xf0));var _0x165c=function(_0x2697d9,_0x26806a){_0x2697d9=_0x2697d9-0x0;var _0x25e6ae=_0x65c1[_0x2697d9];return _0x25e6ae;};'use strict';var multer=require(_0x165c('0x0'));var util=require(_0x165c('0x1'));var path=require(_0x165c('0x2'));var timeout=require(_0x165c('0x3'));var express=require(_0x165c('0x4'));var router=express['Router']();var fs_extra=require(_0x165c('0x5'));var auth=require(_0x165c('0x6'));var interaction=require(_0x165c('0x7'));var config=require('../../config/environment');var controller=require(_0x165c('0x8'));router[_0x165c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x165c('0xa'),auth[_0x165c('0xb')](),controller['show']);router[_0x165c('0x9')](_0x165c('0xc'),auth[_0x165c('0xb')](),timeout(_0x165c('0xd')),controller[_0x165c('0xe')]);router[_0x165c('0xf')]('/',auth[_0x165c('0xb')](),controller[_0x165c('0x10')]);router['put'](_0x165c('0xa'),auth[_0x165c('0xb')](),controller[_0x165c('0x11')]);router[_0x165c('0x12')]('/:id',auth[_0x165c('0xb')](),controller['destroy']);module[_0x165c('0x13')]=router; \ No newline at end of file +var _0x9b1b=['get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller'];(function(_0x3bdc4d,_0xb8e64f){var _0x5899e1=function(_0x4fb6b9){while(--_0x4fb6b9){_0x3bdc4d['push'](_0x3bdc4d['shift']());}};_0x5899e1(++_0xb8e64f);}(_0x9b1b,0x1b0));var _0xb9b1=function(_0x2d6c75,_0x120871){_0x2d6c75=_0x2d6c75-0x0;var _0x30ded4=_0x9b1b[_0x2d6c75];return _0x30ded4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9b1('0x0'));var router=express['Router']();var fs_extra=require(_0xb9b1('0x1'));var auth=require(_0xb9b1('0x2'));var interaction=require(_0xb9b1('0x3'));var config=require('../../config/environment');var controller=require(_0xb9b1('0x4'));router[_0xb9b1('0x5')]('/',auth[_0xb9b1('0x6')](),controller[_0xb9b1('0x7')]);router['get'](_0xb9b1('0x8'),auth[_0xb9b1('0x6')](),controller[_0xb9b1('0x9')]);router['get'](_0xb9b1('0xa'),auth[_0xb9b1('0x6')](),timeout(_0xb9b1('0xb')),controller[_0xb9b1('0xc')]);router[_0xb9b1('0xd')]('/',auth[_0xb9b1('0x6')](),controller[_0xb9b1('0xe')]);router[_0xb9b1('0xf')]('/:id',auth[_0xb9b1('0x6')](),controller[_0xb9b1('0x10')]);router[_0xb9b1('0x11')](_0xb9b1('0x8'),auth[_0xb9b1('0x6')](),controller[_0xb9b1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index cb134f8..7fa5f86 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 _0x1477=['name','sequelize','exports','STRING'];(function(_0x10a479,_0x4c1010){var _0x3c1ebf=function(_0x285854){while(--_0x285854){_0x10a479['push'](_0x10a479['shift']());}};_0x3c1ebf(++_0x4c1010);}(_0x1477,0x16d));var _0x7147=function(_0xf22f9b,_0x1ec50f){_0xf22f9b=_0xf22f9b-0x0;var _0x1619b3=_0x1477[_0xf22f9b];return _0x1619b3;};'use strict';var Sequelize=require(_0x7147('0x0'));module[_0x7147('0x1')]={'name':{'type':Sequelize[_0x7147('0x2')],'unique':_0x7147('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7147('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x82a6=['name','sequelize','exports','STRING'];(function(_0x228958,_0x201192){var _0x365a6c=function(_0x2759a5){while(--_0x2759a5){_0x228958['push'](_0x228958['shift']());}};_0x365a6c(++_0x201192);}(_0x82a6,0x1a5));var _0x682a=function(_0x419e41,_0x381132){_0x419e41=_0x419e41-0x0;var _0x11ec58=_0x82a6[_0x419e41];return _0x11ec58;};'use strict';var Sequelize=require(_0x682a('0x0'));module[_0x682a('0x1')]={'name':{'type':Sequelize[_0x682a('0x2')],'unique':_0x682a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x682a('0x2')]},'description':{'type':Sequelize[_0x682a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5864a02..129562a 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 _0x4c13=['eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','name','send','index','map','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','SquareOdbc','include','findAll','rows','show','includeAll','catch','create','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','params','test','odbc','openSync'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x4c13,0x1b8));var _0x34c1=function(_0x2624e5,_0x260090){_0x2624e5=_0x2624e5-0x0;var _0x5ea188=_0x4c13[_0x2624e5];return _0x5ea188;};'use strict';var emlformat=require(_0x34c1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x34c1('0x1'));var rp=require(_0x34c1('0x2'));var moment=require('moment');var BPromise=require(_0x34c1('0x3'));var Mustache=require(_0x34c1('0x4'));var util=require(_0x34c1('0x5'));var path=require(_0x34c1('0x6'));var sox=require(_0x34c1('0x7'));var csv=require(_0x34c1('0x8'));var ejs=require(_0x34c1('0x9'));var fs=require('fs');var fs_extra=require(_0x34c1('0xa'));var _=require(_0x34c1('0xb'));var squel=require(_0x34c1('0xc'));var crypto=require(_0x34c1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x34c1('0xe'));var toCsv=require(_0x34c1('0x8'));var querystring=require('querystring');var Papa=require(_0x34c1('0xf'));var Redis=require('ioredis');var authService=require(_0x34c1('0x10'));var qs=require(_0x34c1('0x11'));var as=require(_0x34c1('0x12'));var hardwareService=require(_0x34c1('0x13'));var logger=require(_0x34c1('0x14'))(_0x34c1('0x15'));var utils=require(_0x34c1('0x16'));var config=require(_0x34c1('0x17'));var licenseUtil=require(_0x34c1('0x18'));var db=require(_0x34c1('0x19'))['db'];function respondWithStatusCode(_0x5c958c,_0x4f7c36){_0x4f7c36=_0x4f7c36||0xcc;return function(_0x4f3b42){if(_0x4f3b42){return _0x5c958c[_0x34c1('0x1a')](_0x4f7c36);}return _0x5c958c[_0x34c1('0x1b')](_0x4f7c36)[_0x34c1('0x1c')]();};}function respondWithResult(_0x21515c,_0x3115ce){_0x3115ce=_0x3115ce||0xc8;return function(_0xea30b1){if(_0xea30b1){return _0x21515c[_0x34c1('0x1b')](_0x3115ce)['json'](_0xea30b1);}};}function respondWithFilteredResult(_0x2cec25,_0x4a290f){return function(_0x96a077){if(_0x96a077){var _0x28856b=typeof _0x4a290f[_0x34c1('0x1d')]===_0x34c1('0x1e')&&typeof _0x4a290f[_0x34c1('0x1f')]===_0x34c1('0x1e');var _0xe2c0a3=_0x96a077[_0x34c1('0x20')];var _0xd35b88=_0x28856b?0x0:_0x4a290f[_0x34c1('0x1d')];var _0xd8daf5=_0x28856b?_0x96a077[_0x34c1('0x20')]:_0x4a290f[_0x34c1('0x1d')]+_0x4a290f['limit'];var _0x31d19a;if(_0xd8daf5>=_0xe2c0a3){_0xd8daf5=_0xe2c0a3;_0x31d19a=0xc8;}else{_0x31d19a=0xce;}_0x2cec25[_0x34c1('0x1b')](_0x31d19a);return _0x2cec25[_0x34c1('0x21')](_0x34c1('0x22'),_0xd35b88+'-'+_0xd8daf5+'/'+_0xe2c0a3)[_0x34c1('0x23')](_0x96a077);}return null;};}function patchUpdates(_0x1c1977){return function(_0x10be1d){try{jsonpatch[_0x34c1('0x24')](_0x10be1d,_0x1c1977,!![]);}catch(_0x608bb6){return BPromise[_0x34c1('0x25')](_0x608bb6);}return _0x10be1d[_0x34c1('0x26')]();};}function saveUpdates(_0x2cea87,_0x587dfc){return function(_0x8d06d4){if(_0x8d06d4){return _0x8d06d4['update'](_0x2cea87)[_0x34c1('0x27')](function(_0x4e3dc1){return _0x4e3dc1;});}return null;};}function removeEntity(_0x55a97f,_0x4258ab){return function(_0x23e575){if(_0x23e575){return _0x23e575[_0x34c1('0x28')]()[_0x34c1('0x27')](function(){var _0x468b2d=_0x23e575[_0x34c1('0x29')]({'plain':!![]});var _0xeee072=_0x34c1('0x2a');return db[_0x34c1('0x2b')][_0x34c1('0x28')]({'where':{'type':_0xeee072,'resourceId':_0x468b2d['id']}})['then'](function(){return _0x23e575;});})['then'](function(){_0x55a97f[_0x34c1('0x1b')](0xcc)[_0x34c1('0x1c')]();});}};}function handleEntityNotFound(_0x4ae598,_0x2fd4ab){return function(_0x17c4f2){if(!_0x17c4f2){_0x4ae598['sendStatus'](0x194);}return _0x17c4f2;};}function handleError(_0x30f758,_0x97a51b){_0x97a51b=_0x97a51b||0x1f4;return function(_0x5269f6){logger['error'](_0x5269f6['stack']);if(_0x5269f6[_0x34c1('0x2c')]){delete _0x5269f6[_0x34c1('0x2c')];}_0x30f758[_0x34c1('0x1b')](_0x97a51b)[_0x34c1('0x2d')](_0x5269f6);};}exports[_0x34c1('0x2e')]=function(_0x4937a3,_0x471632){var _0x157152={},_0x40358f={},_0x3085c6={'count':0x0,'rows':[]};var _0x3cda12=_[_0x34c1('0x2f')](db['SquareOdbc']['rawAttributes'],function(_0x37ae18){return{'name':_0x37ae18[_0x34c1('0x30')],'type':_0x37ae18[_0x34c1('0x31')]['key']};});_0x40358f['model']=_[_0x34c1('0x2f')](_0x3cda12,_0x34c1('0x2c'));_0x40358f[_0x34c1('0x32')]=_[_0x34c1('0x33')](_0x4937a3[_0x34c1('0x32')]);_0x40358f[_0x34c1('0x34')]=_[_0x34c1('0x35')](_0x40358f['model'],_0x40358f['query']);_0x157152[_0x34c1('0x36')]=_[_0x34c1('0x35')](_0x40358f[_0x34c1('0x37')],qs[_0x34c1('0x38')](_0x4937a3[_0x34c1('0x32')][_0x34c1('0x38')]));_0x157152[_0x34c1('0x36')]=_0x157152['attributes'][_0x34c1('0x39')]?_0x157152[_0x34c1('0x36')]:_0x40358f[_0x34c1('0x37')];if(!_0x4937a3[_0x34c1('0x32')][_0x34c1('0x3a')](_0x34c1('0x3b'))){_0x157152[_0x34c1('0x1f')]=qs[_0x34c1('0x1f')](_0x4937a3['query'][_0x34c1('0x1f')]);_0x157152[_0x34c1('0x1d')]=qs[_0x34c1('0x1d')](_0x4937a3['query']['offset']);}_0x157152['order']=qs[_0x34c1('0x3c')](_0x4937a3[_0x34c1('0x32')][_0x34c1('0x3c')]);_0x157152['where']=qs[_0x34c1('0x34')](_[_0x34c1('0x3d')](_0x4937a3[_0x34c1('0x32')],_0x40358f[_0x34c1('0x34')]),_0x3cda12);if(_0x4937a3[_0x34c1('0x32')][_0x34c1('0x3e')]){_0x157152[_0x34c1('0x3f')]=_['merge'](_0x157152[_0x34c1('0x3f')],{'$or':_[_0x34c1('0x2f')](_0x3cda12,function(_0x44ef04){if(_0x44ef04['type']!==_0x34c1('0x40')){var _0x789f69={};_0x789f69[_0x44ef04[_0x34c1('0x2c')]]={'$like':'%'+_0x4937a3[_0x34c1('0x32')]['filter']+'%'};return _0x789f69;}})});}_0x157152=_[_0x34c1('0x41')]({},_0x157152,_0x4937a3[_0x34c1('0x42')]);var _0x43bcd7={'where':_0x157152['where']};return db[_0x34c1('0x43')]['count'](_0x43bcd7)[_0x34c1('0x27')](function(_0x4cab93){_0x3085c6[_0x34c1('0x20')]=_0x4cab93;if(_0x4937a3['query']['includeAll']){_0x157152[_0x34c1('0x44')]=[{'all':!![]}];}return db[_0x34c1('0x43')][_0x34c1('0x45')](_0x157152);})['then'](function(_0x386a57){_0x3085c6[_0x34c1('0x46')]=_0x386a57;return _0x3085c6;})[_0x34c1('0x27')](respondWithFilteredResult(_0x471632,_0x157152))['catch'](handleError(_0x471632,null));};exports[_0x34c1('0x47')]=function(_0x438086,_0x5bbf8d){var _0x4e4ccb={'raw':!![],'where':{'id':_0x438086['params']['id']}},_0x4839e3={};_0x4839e3[_0x34c1('0x37')]=_[_0x34c1('0x33')](db[_0x34c1('0x43')]['rawAttributes']);_0x4839e3[_0x34c1('0x32')]=_[_0x34c1('0x33')](_0x438086[_0x34c1('0x32')]);_0x4839e3[_0x34c1('0x34')]=_[_0x34c1('0x35')](_0x4839e3[_0x34c1('0x37')],_0x4839e3[_0x34c1('0x32')]);_0x4e4ccb[_0x34c1('0x36')]=_[_0x34c1('0x35')](_0x4839e3[_0x34c1('0x37')],qs[_0x34c1('0x38')](_0x438086[_0x34c1('0x32')][_0x34c1('0x38')]));_0x4e4ccb[_0x34c1('0x36')]=_0x4e4ccb[_0x34c1('0x36')][_0x34c1('0x39')]?_0x4e4ccb[_0x34c1('0x36')]:_0x4839e3[_0x34c1('0x37')];if(_0x438086[_0x34c1('0x32')][_0x34c1('0x48')]){_0x4e4ccb[_0x34c1('0x44')]=[{'all':!![]}];}_0x4e4ccb=_['merge']({},_0x4e4ccb,_0x438086[_0x34c1('0x42')]);return db[_0x34c1('0x43')]['find'](_0x4e4ccb)['then'](handleEntityNotFound(_0x5bbf8d,null))[_0x34c1('0x27')](respondWithResult(_0x5bbf8d,null))[_0x34c1('0x49')](handleError(_0x5bbf8d,null));};exports[_0x34c1('0x4a')]=function(_0x3fa8c6,_0x19edee){return db[_0x34c1('0x43')][_0x34c1('0x4a')](_0x3fa8c6['body'],{})[_0x34c1('0x27')](function(_0x44db5a){var _0x26047e=_0x3fa8c6[_0x34c1('0x4b')][_0x34c1('0x29')]({'plain':!![]});if(!_0x26047e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26047e[_0x34c1('0x4c')]===_0x34c1('0x4b')){var _0x1e50c6=_0x44db5a['get']({'plain':!![]});var _0x18cef4=_0x34c1('0x2a');return db[_0x34c1('0x4d')]['find']({'where':{'name':_0x18cef4,'userProfileId':_0x26047e['userProfileId']},'raw':!![]})['then'](function(_0x59b990){if(_0x59b990&&_0x59b990[_0x34c1('0x4e')]===0x0){return db[_0x34c1('0x2b')][_0x34c1('0x4a')]({'name':_0x1e50c6[_0x34c1('0x2c')],'resourceId':_0x1e50c6['id'],'type':_0x59b990['name'],'sectionId':_0x59b990['id']},{})[_0x34c1('0x27')](function(){return _0x44db5a;});}else{return _0x44db5a;}})[_0x34c1('0x49')](function(_0xeefbb4){logger[_0x34c1('0x4f')](_0x34c1('0x50'),_0xeefbb4);throw _0xeefbb4;});}return _0x44db5a;})[_0x34c1('0x27')](respondWithResult(_0x19edee,0xc9))['catch'](handleError(_0x19edee,null));};exports[_0x34c1('0x51')]=function(_0x55d6eb,_0x18164e){if(_0x55d6eb[_0x34c1('0x52')]['id']){delete _0x55d6eb[_0x34c1('0x52')]['id'];}return db[_0x34c1('0x43')][_0x34c1('0x53')]({'where':{'id':_0x55d6eb[_0x34c1('0x54')]['id']}})[_0x34c1('0x27')](handleEntityNotFound(_0x18164e,null))[_0x34c1('0x27')](saveUpdates(_0x55d6eb['body'],null))[_0x34c1('0x27')](respondWithResult(_0x18164e,null))['catch'](handleError(_0x18164e,null));};exports[_0x34c1('0x28')]=function(_0x3b464b,_0x470596){return db[_0x34c1('0x43')][_0x34c1('0x53')]({'where':{'id':_0x3b464b[_0x34c1('0x54')]['id']}})[_0x34c1('0x27')](handleEntityNotFound(_0x470596,null))['then'](removeEntity(_0x470596,null))['catch'](handleError(_0x470596,null));};exports[_0x34c1('0x55')]=function(_0x579e7b,_0x40abb6,_0x47ee37){var _0x3dbc81;return db[_0x34c1('0x43')][_0x34c1('0x53')]({'where':{'id':_0x579e7b['params']['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x40abb6,null))['then'](function(_0x4f6e06){if(_0x4f6e06){var _0x2e17ba=require(_0x34c1('0x56'))();_0x2e17ba[_0x34c1('0x57')](_0x4f6e06['dsn']);_0x2e17ba['closeSync']();return _0x4f6e06;}})['then'](respondWithResult(_0x40abb6,null))[_0x34c1('0x49')](handleError(_0x40abb6,null));}; \ No newline at end of file +var _0x621f=['VIRTUAL','merge','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','closeSync','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','reject','save','update','then','get','UserProfileResource','destroy','stack','name','status','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x4269ba,_0x648fa9){var _0xae6f6=function(_0x56cfc8){while(--_0x56cfc8){_0x4269ba['push'](_0x4269ba['shift']());}};_0xae6f6(++_0x648fa9);}(_0x621f,0x16d));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf621('0x1'));var jsonpatch=require(_0xf621('0x2'));var rp=require(_0xf621('0x3'));var moment=require(_0xf621('0x4'));var BPromise=require(_0xf621('0x5'));var Mustache=require(_0xf621('0x6'));var util=require('util');var path=require(_0xf621('0x7'));var sox=require(_0xf621('0x8'));var csv=require(_0xf621('0x9'));var ejs=require(_0xf621('0xa'));var fs=require('fs');var fs_extra=require(_0xf621('0xb'));var _=require(_0xf621('0xc'));var squel=require(_0xf621('0xd'));var crypto=require('crypto');var jsforce=require(_0xf621('0xe'));var deskjs=require(_0xf621('0xf'));var toCsv=require(_0xf621('0x9'));var querystring=require(_0xf621('0x10'));var Papa=require('papaparse');var Redis=require(_0xf621('0x11'));var authService=require(_0xf621('0x12'));var qs=require(_0xf621('0x13'));var as=require(_0xf621('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf621('0x15'))(_0xf621('0x16'));var utils=require(_0xf621('0x17'));var config=require(_0xf621('0x18'));var licenseUtil=require(_0xf621('0x19'));var db=require(_0xf621('0x1a'))['db'];function respondWithStatusCode(_0x99aaa3,_0x466979){_0x466979=_0x466979||0xcc;return function(_0x16cfba){if(_0x16cfba){return _0x99aaa3[_0xf621('0x1b')](_0x466979);}return _0x99aaa3['status'](_0x466979)[_0xf621('0x1c')]();};}function respondWithResult(_0x519bd3,_0x177e60){_0x177e60=_0x177e60||0xc8;return function(_0x236f6a){if(_0x236f6a){return _0x519bd3['status'](_0x177e60)[_0xf621('0x1d')](_0x236f6a);}};}function respondWithFilteredResult(_0x582ae0,_0x1f24b7){return function(_0x3f2456){if(_0x3f2456){var _0x5ba795=typeof _0x1f24b7[_0xf621('0x1e')]==='undefined'&&typeof _0x1f24b7[_0xf621('0x1f')]===_0xf621('0x20');var _0x4ea0cd=_0x3f2456[_0xf621('0x21')];var _0x4ef594=_0x5ba795?0x0:_0x1f24b7['offset'];var _0x45877c=_0x5ba795?_0x3f2456[_0xf621('0x21')]:_0x1f24b7[_0xf621('0x1e')]+_0x1f24b7[_0xf621('0x1f')];var _0x337069;if(_0x45877c>=_0x4ea0cd){_0x45877c=_0x4ea0cd;_0x337069=0xc8;}else{_0x337069=0xce;}_0x582ae0['status'](_0x337069);return _0x582ae0[_0xf621('0x22')]('Content-Range',_0x4ef594+'-'+_0x45877c+'/'+_0x4ea0cd)[_0xf621('0x1d')](_0x3f2456);}return null;};}function patchUpdates(_0x5df3fd){return function(_0x5e038b){try{jsonpatch['apply'](_0x5e038b,_0x5df3fd,!![]);}catch(_0x3d8830){return BPromise[_0xf621('0x23')](_0x3d8830);}return _0x5e038b[_0xf621('0x24')]();};}function saveUpdates(_0xd54798,_0x2081f2){return function(_0x2f914e){if(_0x2f914e){return _0x2f914e[_0xf621('0x25')](_0xd54798)['then'](function(_0x28fcb3){return _0x28fcb3;});}return null;};}function removeEntity(_0x306fc0,_0x5afe04){return function(_0x36e505){if(_0x36e505){return _0x36e505['destroy']()[_0xf621('0x26')](function(){var _0xe34b5=_0x36e505[_0xf621('0x27')]({'plain':!![]});var _0x2582d1='ODBC';return db[_0xf621('0x28')][_0xf621('0x29')]({'where':{'type':_0x2582d1,'resourceId':_0xe34b5['id']}})['then'](function(){return _0x36e505;});})[_0xf621('0x26')](function(){_0x306fc0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e1b60,_0x3db4a3){return function(_0x20fea3){if(!_0x20fea3){_0x3e1b60[_0xf621('0x1b')](0x194);}return _0x20fea3;};}function handleError(_0xd1194,_0x249a7f){_0x249a7f=_0x249a7f||0x1f4;return function(_0x1739d9){logger['error'](_0x1739d9[_0xf621('0x2a')]);if(_0x1739d9[_0xf621('0x2b')]){delete _0x1739d9[_0xf621('0x2b')];}_0xd1194[_0xf621('0x2c')](_0x249a7f)['send'](_0x1739d9);};}exports[_0xf621('0x2d')]=function(_0xa010fb,_0x42c709){var _0x395a2c={},_0x1003eb={},_0x5e9615={'count':0x0,'rows':[]};var _0x55d06c=_[_0xf621('0x2e')](db[_0xf621('0x2f')][_0xf621('0x30')],function(_0x24cd20){return{'name':_0x24cd20[_0xf621('0x31')],'type':_0x24cd20[_0xf621('0x32')][_0xf621('0x33')]};});_0x1003eb[_0xf621('0x34')]=_['map'](_0x55d06c,_0xf621('0x2b'));_0x1003eb[_0xf621('0x35')]=_[_0xf621('0x36')](_0xa010fb['query']);_0x1003eb[_0xf621('0x37')]=_[_0xf621('0x38')](_0x1003eb[_0xf621('0x34')],_0x1003eb['query']);_0x395a2c[_0xf621('0x39')]=_[_0xf621('0x38')](_0x1003eb['model'],qs['fields'](_0xa010fb[_0xf621('0x35')][_0xf621('0x3a')]));_0x395a2c[_0xf621('0x39')]=_0x395a2c[_0xf621('0x39')][_0xf621('0x3b')]?_0x395a2c[_0xf621('0x39')]:_0x1003eb[_0xf621('0x34')];if(!_0xa010fb[_0xf621('0x35')]['hasOwnProperty'](_0xf621('0x3c'))){_0x395a2c[_0xf621('0x1f')]=qs[_0xf621('0x1f')](_0xa010fb[_0xf621('0x35')][_0xf621('0x1f')]);_0x395a2c[_0xf621('0x1e')]=qs['offset'](_0xa010fb['query'][_0xf621('0x1e')]);}_0x395a2c[_0xf621('0x3d')]=qs['sort'](_0xa010fb['query'][_0xf621('0x3e')]);_0x395a2c[_0xf621('0x3f')]=qs['filters'](_[_0xf621('0x40')](_0xa010fb[_0xf621('0x35')],_0x1003eb[_0xf621('0x37')]),_0x55d06c);if(_0xa010fb[_0xf621('0x35')]['filter']){_0x395a2c[_0xf621('0x3f')]=_['merge'](_0x395a2c['where'],{'$or':_[_0xf621('0x2e')](_0x55d06c,function(_0x445215){if(_0x445215[_0xf621('0x32')]!==_0xf621('0x41')){var _0x401820={};_0x401820[_0x445215['name']]={'$like':'%'+_0xa010fb['query']['filter']+'%'};return _0x401820;}})});}_0x395a2c=_[_0xf621('0x42')]({},_0x395a2c,_0xa010fb[_0xf621('0x43')]);var _0x2f82b8={'where':_0x395a2c[_0xf621('0x3f')]};return db['SquareOdbc'][_0xf621('0x21')](_0x2f82b8)[_0xf621('0x26')](function(_0x19b1ed){_0x5e9615['count']=_0x19b1ed;if(_0xa010fb[_0xf621('0x35')][_0xf621('0x44')]){_0x395a2c[_0xf621('0x45')]=[{'all':!![]}];}return db[_0xf621('0x2f')]['findAll'](_0x395a2c);})[_0xf621('0x26')](function(_0x127425){_0x5e9615[_0xf621('0x46')]=_0x127425;return _0x5e9615;})[_0xf621('0x26')](respondWithFilteredResult(_0x42c709,_0x395a2c))['catch'](handleError(_0x42c709,null));};exports[_0xf621('0x47')]=function(_0x3210d5,_0x3e885f){var _0x4ab37d={'raw':!![],'where':{'id':_0x3210d5[_0xf621('0x48')]['id']}},_0x2f19d5={};_0x2f19d5[_0xf621('0x34')]=_[_0xf621('0x36')](db['SquareOdbc']['rawAttributes']);_0x2f19d5['query']=_[_0xf621('0x36')](_0x3210d5['query']);_0x2f19d5[_0xf621('0x37')]=_[_0xf621('0x38')](_0x2f19d5[_0xf621('0x34')],_0x2f19d5[_0xf621('0x35')]);_0x4ab37d['attributes']=_[_0xf621('0x38')](_0x2f19d5[_0xf621('0x34')],qs[_0xf621('0x3a')](_0x3210d5['query'][_0xf621('0x3a')]));_0x4ab37d[_0xf621('0x39')]=_0x4ab37d[_0xf621('0x39')][_0xf621('0x3b')]?_0x4ab37d[_0xf621('0x39')]:_0x2f19d5['model'];if(_0x3210d5[_0xf621('0x35')]['includeAll']){_0x4ab37d[_0xf621('0x45')]=[{'all':!![]}];}_0x4ab37d=_['merge']({},_0x4ab37d,_0x3210d5['options']);return db['SquareOdbc'][_0xf621('0x49')](_0x4ab37d)[_0xf621('0x26')](handleEntityNotFound(_0x3e885f,null))['then'](respondWithResult(_0x3e885f,null))[_0xf621('0x4a')](handleError(_0x3e885f,null));};exports[_0xf621('0x4b')]=function(_0x14d3e1,_0x23adde){return db[_0xf621('0x2f')]['create'](_0x14d3e1[_0xf621('0x4c')],{})['then'](function(_0x4d9d33){var _0x1cb194=_0x14d3e1[_0xf621('0x4d')][_0xf621('0x27')]({'plain':!![]});if(!_0x1cb194)throw new Error(_0xf621('0x4e'));if(_0x1cb194['role']===_0xf621('0x4d')){var _0x295f10=_0x4d9d33[_0xf621('0x27')]({'plain':!![]});var _0x3f70f6=_0xf621('0x4f');return db['UserProfileSection'][_0xf621('0x49')]({'where':{'name':_0x3f70f6,'userProfileId':_0x1cb194[_0xf621('0x50')]},'raw':!![]})[_0xf621('0x26')](function(_0x343ed0){if(_0x343ed0&&_0x343ed0['autoAssociation']===0x0){return db[_0xf621('0x28')][_0xf621('0x4b')]({'name':_0x295f10[_0xf621('0x2b')],'resourceId':_0x295f10['id'],'type':_0x343ed0[_0xf621('0x2b')],'sectionId':_0x343ed0['id']},{})[_0xf621('0x26')](function(){return _0x4d9d33;});}else{return _0x4d9d33;}})[_0xf621('0x4a')](function(_0x36e888){logger[_0xf621('0x51')](_0xf621('0x52'),_0x36e888);throw _0x36e888;});}return _0x4d9d33;})[_0xf621('0x26')](respondWithResult(_0x23adde,0xc9))[_0xf621('0x4a')](handleError(_0x23adde,null));};exports[_0xf621('0x25')]=function(_0x103da3,_0x40a4f6){if(_0x103da3[_0xf621('0x4c')]['id']){delete _0x103da3[_0xf621('0x4c')]['id'];}return db[_0xf621('0x2f')][_0xf621('0x49')]({'where':{'id':_0x103da3['params']['id']}})[_0xf621('0x26')](handleEntityNotFound(_0x40a4f6,null))[_0xf621('0x26')](saveUpdates(_0x103da3[_0xf621('0x4c')],null))[_0xf621('0x26')](respondWithResult(_0x40a4f6,null))['catch'](handleError(_0x40a4f6,null));};exports['destroy']=function(_0x553392,_0x3ea2c3){return db[_0xf621('0x2f')][_0xf621('0x49')]({'where':{'id':_0x553392[_0xf621('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ea2c3,null))[_0xf621('0x26')](removeEntity(_0x3ea2c3,null))[_0xf621('0x4a')](handleError(_0x3ea2c3,null));};exports['test']=function(_0x1be222,_0x52c204,_0x390a78){var _0x276c48;return db['SquareOdbc'][_0xf621('0x49')]({'where':{'id':_0x1be222[_0xf621('0x48')]['id']},'attributes':['id',_0xf621('0x53')]})[_0xf621('0x26')](handleEntityNotFound(_0x52c204,null))[_0xf621('0x26')](function(_0x4f7e9d){if(_0x4f7e9d){var _0x578054=require(_0xf621('0x54'))();_0x578054['openSync'](_0x4f7e9d[_0xf621('0x53')]);_0x578054[_0xf621('0x55')]();return _0x4f7e9d;}})[_0xf621('0x26')](respondWithResult(_0x52c204,null))[_0xf621('0x4a')](handleError(_0x52c204,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 61b65b8..8ba7c15 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 _0x63bb=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dd970,_0x316ea1){var _0x109177=function(_0x176d50){while(--_0x176d50){_0x2dd970['push'](_0x2dd970['shift']());}};_0x109177(++_0x316ea1);}(_0x63bb,0x7e));var _0xb63b=function(_0x291e0e,_0x792683){_0x291e0e=_0x291e0e-0x0;var _0x3f85f3=_0x63bb[_0x291e0e];return _0x3f85f3;};'use strict';var _=require(_0xb63b('0x0'));var util=require(_0xb63b('0x1'));var logger=require(_0xb63b('0x2'))(_0xb63b('0x3'));var moment=require(_0xb63b('0x4'));var BPromise=require(_0xb63b('0x5'));var rp=require(_0xb63b('0x6'));var fs=require('fs');var path=require(_0xb63b('0x7'));var rimraf=require(_0xb63b('0x8'));var config=require(_0xb63b('0x9'));var attributes=require(_0xb63b('0xa'));module[_0xb63b('0xb')]=function(_0x2ca57a,_0x60f84d){return _0x2ca57a['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa7d=['path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','bluebird','request-promise'];(function(_0x2175c8,_0x354a24){var _0x2ae52d=function(_0x5be3bb){while(--_0x5be3bb){_0x2175c8['push'](_0x2175c8['shift']());}};_0x2ae52d(++_0x354a24);}(_0xaa7d,0x1e0));var _0xdaa7=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xaa7d[_0xf44d98];return _0x5ebb04;};'use strict';var _=require(_0xdaa7('0x0'));var util=require(_0xdaa7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdaa7('0x2'));var rp=require(_0xdaa7('0x3'));var fs=require('fs');var path=require(_0xdaa7('0x4'));var rimraf=require(_0xdaa7('0x5'));var config=require(_0xdaa7('0x6'));var attributes=require(_0xdaa7('0x7'));module[_0xdaa7('0x8')]=function(_0x3aa95d,_0x2ca31a){return _0x3aa95d[_0xdaa7('0x9')]('SquareOdbc',attributes,{'tableName':_0xdaa7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index c38c756..4e9a15a 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 _0x380f=['stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','map','model','debug','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x380f,0x107));var _0xf380=function(_0x1b1451,_0x248fad){_0x1b1451=_0x1b1451-0x0;var _0x291b9f=_0x380f[_0x1b1451];return _0x291b9f;};'use strict';var _=require(_0xf380('0x0'));var util=require(_0xf380('0x1'));var moment=require(_0xf380('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf380('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf380('0x4'));var logger=require(_0xf380('0x5'))(_0xf380('0x6'));var config=require(_0xf380('0x7'));var jayson=require(_0xf380('0x8'));var client=jayson[_0xf380('0x9')][_0xf380('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277433,_0x3ff44e,_0x177f6c){return new BPromise(function(_0x50a336,_0x1c88bf){return client[_0xf380('0xb')](_0x277433,_0x177f6c)[_0xf380('0xc')](function(_0x709ca7){logger[_0xf380('0xd')](_0xf380('0xe'),_0x3ff44e,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3ff44e,_0xf380('0xf'),JSON[_0xf380('0x10')](_0x709ca7));if(_0x709ca7['error']){if(_0x709ca7[_0xf380('0x11')]['code']===0x1f4){logger[_0xf380('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x3ff44e,_0x709ca7['error'][_0xf380('0x12')]);return _0x1c88bf(_0x709ca7[_0xf380('0x11')][_0xf380('0x12')]);}logger[_0xf380('0x11')](_0xf380('0xe'),_0x3ff44e,_0x709ca7[_0xf380('0x11')]['message']);return _0x50a336(_0x709ca7[_0xf380('0x11')][_0xf380('0x12')]);}else{logger[_0xf380('0xd')](_0xf380('0xe'),_0x3ff44e,_0xf380('0xf'));_0x50a336(_0x709ca7[_0xf380('0x13')][_0xf380('0x12')]);}})['catch'](function(_0x2fe125){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x3ff44e,_0x2fe125);_0x1c88bf(_0x2fe125);});});}exports[_0xf380('0x14')]=function(_0x4438c7){var _0x172091=this;return new Promise(function(_0x5a0648,_0x2098bc){return db[_0xf380('0x15')][_0xf380('0x16')]({'raw':_0x4438c7['options']?_0x4438c7[_0xf380('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4438c7[_0xf380('0x17')]?_0x4438c7[_0xf380('0x17')][_0xf380('0x18')]||null:null,'attributes':_0x4438c7[_0xf380('0x17')]?_0x4438c7[_0xf380('0x17')][_0xf380('0x19')]||null:null,'include':_0x4438c7[_0xf380('0x17')]?_0x4438c7[_0xf380('0x17')][_0xf380('0x1a')]?_[_0xf380('0x1b')](_0x4438c7[_0xf380('0x17')][_0xf380('0x1a')],function(_0x26ee72){return{'model':db[_0x26ee72[_0xf380('0x1c')]],'as':_0x26ee72['as'],'attributes':_0x26ee72[_0xf380('0x19')],'include':_0x26ee72[_0xf380('0x1a')]?_[_0xf380('0x1b')](_0x26ee72[_0xf380('0x1a')],function(_0x48f411){return{'model':db[_0x48f411[_0xf380('0x1c')]],'as':_0x48f411['as'],'attributes':_0x48f411[_0xf380('0x19')],'include':_0x48f411[_0xf380('0x1a')]?_[_0xf380('0x1b')](_0x48f411['include'],function(_0x224dd9){return{'model':db[_0x224dd9[_0xf380('0x1c')]],'as':_0x224dd9['as'],'attributes':_0x224dd9['attributes']};}):[]};}):[]};}):[]:[]})[_0xf380('0xc')](function(_0x51c9bf){logger['info'](_0xf380('0x14'),_0x4438c7);logger[_0xf380('0x1d')](_0xf380('0x14'),_0x4438c7,JSON[_0xf380('0x10')](_0x51c9bf));_0x5a0648(_0x51c9bf);})[_0xf380('0x1e')](function(_0x2212e0){logger[_0xf380('0x11')]('ShowSquareOdbc',_0x2212e0[_0xf380('0x12')],_0x4438c7);_0x2098bc(_0x172091[_0xf380('0x11')](0x1f4,_0x2212e0[_0xf380('0x12')]));});});}; \ No newline at end of file +var _0x3cbd=['result','ShowSquareOdbc','find','options','raw','map','include','model','attributes','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x35bfd7,_0x2eb362){var _0x5c2476=function(_0x2e5e3b){while(--_0x2e5e3b){_0x35bfd7['push'](_0x35bfd7['shift']());}};_0x5c2476(++_0x2eb362);}(_0x3cbd,0x1f0));var _0xd3cb=function(_0x25996d,_0x5b282e){_0x25996d=_0x25996d-0x0;var _0x12d802=_0x3cbd[_0x25996d];return _0x12d802;};'use strict';var _=require('lodash');var util=require(_0xd3cb('0x0'));var moment=require('moment');var BPromise=require(_0xd3cb('0x1'));var rs=require(_0xd3cb('0x2'));var fs=require('fs');var Redis=require(_0xd3cb('0x3'));var db=require(_0xd3cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3cb('0x5'))(_0xd3cb('0x6'));var config=require('../../config/environment');var jayson=require(_0xd3cb('0x7'));var client=jayson['client'][_0xd3cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1507f9,_0x1e808b,_0x5e2274){return new BPromise(function(_0x167c94,_0xce01bb){return client[_0xd3cb('0x9')](_0x1507f9,_0x5e2274)['then'](function(_0x2737a6){logger['info'](_0xd3cb('0xa'),_0x1e808b,_0xd3cb('0xb'));logger[_0xd3cb('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1e808b,_0xd3cb('0xb'),JSON[_0xd3cb('0xd')](_0x2737a6));if(_0x2737a6[_0xd3cb('0xe')]){if(_0x2737a6[_0xd3cb('0xe')]['code']===0x1f4){logger['error'](_0xd3cb('0xa'),_0x1e808b,_0x2737a6['error'][_0xd3cb('0xf')]);return _0xce01bb(_0x2737a6['error'][_0xd3cb('0xf')]);}logger['error'](_0xd3cb('0xa'),_0x1e808b,_0x2737a6['error'][_0xd3cb('0xf')]);return _0x167c94(_0x2737a6[_0xd3cb('0xe')][_0xd3cb('0xf')]);}else{logger[_0xd3cb('0x10')](_0xd3cb('0xa'),_0x1e808b,_0xd3cb('0xb'));_0x167c94(_0x2737a6[_0xd3cb('0x11')][_0xd3cb('0xf')]);}})['catch'](function(_0x5824b7){logger['error'](_0xd3cb('0xa'),_0x1e808b,_0x5824b7);_0xce01bb(_0x5824b7);});});}exports[_0xd3cb('0x12')]=function(_0x2a408d){var _0x17e433=this;return new Promise(function(_0x18cc4d,_0x484d59){return db['SquareOdbc'][_0xd3cb('0x13')]({'raw':_0x2a408d[_0xd3cb('0x14')]?_0x2a408d[_0xd3cb('0x14')][_0xd3cb('0x15')]===undefined?!![]:![]:!![],'where':_0x2a408d[_0xd3cb('0x14')]?_0x2a408d[_0xd3cb('0x14')]['where']||null:null,'attributes':_0x2a408d['options']?_0x2a408d['options']['attributes']||null:null,'include':_0x2a408d[_0xd3cb('0x14')]?_0x2a408d['options']['include']?_[_0xd3cb('0x16')](_0x2a408d[_0xd3cb('0x14')][_0xd3cb('0x17')],function(_0x4c3f2f){return{'model':db[_0x4c3f2f[_0xd3cb('0x18')]],'as':_0x4c3f2f['as'],'attributes':_0x4c3f2f['attributes'],'include':_0x4c3f2f[_0xd3cb('0x17')]?_['map'](_0x4c3f2f[_0xd3cb('0x17')],function(_0x40f01f){return{'model':db[_0x40f01f[_0xd3cb('0x18')]],'as':_0x40f01f['as'],'attributes':_0x40f01f[_0xd3cb('0x19')],'include':_0x40f01f['include']?_[_0xd3cb('0x16')](_0x40f01f[_0xd3cb('0x17')],function(_0x585063){return{'model':db[_0x585063[_0xd3cb('0x18')]],'as':_0x585063['as'],'attributes':_0x585063[_0xd3cb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4151b0){logger[_0xd3cb('0x10')](_0xd3cb('0x12'),_0x2a408d);logger[_0xd3cb('0xc')](_0xd3cb('0x12'),_0x2a408d,JSON[_0xd3cb('0xd')](_0x4151b0));_0x18cc4d(_0x4151b0);})[_0xd3cb('0x1a')](function(_0x4b8a96){logger['error'](_0xd3cb('0x12'),_0x4b8a96[_0xd3cb('0xf')],_0x2a408d);_0x484d59(_0x17e433[_0xd3cb('0xe')](0x1f4,_0x4b8a96['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 73eeba6..2fa643a 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 _0x56fe=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','/:id/users','getUsers','post','create','addUsers','put','update','/:id','delete','multer','util','express'];(function(_0x449382,_0x3a5e10){var _0x55edf3=function(_0x57dc95){while(--_0x57dc95){_0x449382['push'](_0x449382['shift']());}};_0x55edf3(++_0x3a5e10);}(_0x56fe,0xe4));var _0xe56f=function(_0x1d5f65,_0x4bbb22){_0x1d5f65=_0x1d5f65-0x0;var _0x513c8c=_0x56fe[_0x1d5f65];return _0x513c8c;};'use strict';var multer=require(_0xe56f('0x0'));var util=require(_0xe56f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe56f('0x2'));var router=express[_0xe56f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe56f('0x4'));var interaction=require(_0xe56f('0x5'));var config=require(_0xe56f('0x6'));var controller=require(_0xe56f('0x7'));router['get']('/',auth[_0xe56f('0x8')](),controller[_0xe56f('0x9')]);router[_0xe56f('0xa')]('/:id',auth[_0xe56f('0x8')](),controller[_0xe56f('0xb')]);router[_0xe56f('0xa')](_0xe56f('0xc'),auth['isAuthenticated'](),controller[_0xe56f('0xd')]);router[_0xe56f('0xe')]('/',auth[_0xe56f('0x8')](),controller[_0xe56f('0xf')]);router['post'](_0xe56f('0xc'),auth[_0xe56f('0x8')](),controller[_0xe56f('0x10')]);router[_0xe56f('0x11')]('/:id',auth[_0xe56f('0x8')](),controller[_0xe56f('0x12')]);router['delete'](_0xe56f('0x13'),auth[_0xe56f('0x8')](),controller['destroy']);router[_0xe56f('0x14')]('/:id/users',auth['isAuthenticated'](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x8254=['update','destroy','delete','removeUsers','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put'];(function(_0x42839f,_0x29d4e5){var _0x144728=function(_0x4d357e){while(--_0x4d357e){_0x42839f['push'](_0x42839f['shift']());}};_0x144728(++_0x29d4e5);}(_0x8254,0x95));var _0x4825=function(_0x393653,_0x21a40a){_0x393653=_0x393653-0x0;var _0x477217=_0x8254[_0x393653];return _0x477217;};'use strict';var multer=require(_0x4825('0x0'));var util=require('util');var path=require(_0x4825('0x1'));var timeout=require('connect-timeout');var express=require(_0x4825('0x2'));var router=express[_0x4825('0x3')]();var fs_extra=require(_0x4825('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4825('0x5'));var config=require(_0x4825('0x6'));var controller=require(_0x4825('0x7'));router[_0x4825('0x8')]('/',auth[_0x4825('0x9')](),controller[_0x4825('0xa')]);router['get'](_0x4825('0xb'),auth[_0x4825('0x9')](),controller[_0x4825('0xc')]);router['get'](_0x4825('0xd'),auth[_0x4825('0x9')](),controller[_0x4825('0xe')]);router[_0x4825('0xf')]('/',auth['isAuthenticated'](),controller[_0x4825('0x10')]);router[_0x4825('0xf')](_0x4825('0xd'),auth['isAuthenticated'](),controller[_0x4825('0x11')]);router[_0x4825('0x12')](_0x4825('0xb'),auth[_0x4825('0x9')](),controller[_0x4825('0x13')]);router['delete'](_0x4825('0xb'),auth[_0x4825('0x9')](),controller[_0x4825('0x14')]);router[_0x4825('0x15')](_0x4825('0xd'),auth[_0x4825('0x9')](),controller[_0x4825('0x16')]);module[_0x4825('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e93ae66..150d10a 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 _0x7181=['name','TEXT','BLOB','long','preproduction','getDataValue','toString','utf8','DATE','sequelize','STRING'];(function(_0x4945da,_0x2ecb03){var _0x24460c=function(_0x30d606){while(--_0x30d606){_0x4945da['push'](_0x4945da['shift']());}};_0x24460c(++_0x2ecb03);}(_0x7181,0x11c));var _0x1718=function(_0x9bd1eb,_0x24ccb4){_0x9bd1eb=_0x9bd1eb-0x0;var _0x51b468=_0x7181[_0x9bd1eb];return _0x51b468;};'use strict';var Sequelize=require(_0x1718('0x0'));module['exports']={'name':{'type':Sequelize[_0x1718('0x1')],'unique':_0x1718('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1718('0x1')]},'notes':{'type':Sequelize[_0x1718('0x3')]},'preproduction':{'type':Sequelize[_0x1718('0x4')](_0x1718('0x5')),'get':function(){if(this['getDataValue'](_0x1718('0x6'))){return this[_0x1718('0x7')](_0x1718('0x6'))[_0x1718('0x8')](_0x1718('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x1718('0x5')),'get':function(){if(this[_0x1718('0x7')]('production')){return this[_0x1718('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x1718('0xa')]},'publishedAt':{'type':Sequelize[_0x1718('0xa')]}}; \ No newline at end of file +var _0xb39c=['name','STRING','TEXT','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0xb39c,0x136));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xcb39('0x0'));module[_0xcb39('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb39('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb39('0x3')]},'notes':{'type':Sequelize[_0xcb39('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xcb39('0x5')](_0xcb39('0x6'))){return this[_0xcb39('0x5')](_0xcb39('0x6'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xcb39('0x9')),'get':function(){if(this['getDataValue'](_0xcb39('0xa'))){return this[_0xcb39('0x5')](_0xcb39('0xa'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'savedAt':{'type':Sequelize[_0xcb39('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 407e98f..694b915 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 _0x3220=['error','name','send','index','map','SquareProject','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','get','SquareProjects','sendStatus'];(function(_0x12d4f6,_0x54a121){var _0xc628a6=function(_0x1dc684){while(--_0x1dc684){_0x12d4f6['push'](_0x12d4f6['shift']());}};_0xc628a6(++_0x54a121);}(_0x3220,0x9f));var _0x0322=function(_0x3c25c9,_0x25f58d){_0x3c25c9=_0x3c25c9-0x0;var _0x417ce1=_0x3220[_0x3c25c9];return _0x417ce1;};'use strict';var emlformat=require(_0x0322('0x0'));var rimraf=require(_0x0322('0x1'));var zipdir=require(_0x0322('0x2'));var jsonpatch=require(_0x0322('0x3'));var rp=require('request-promise');var moment=require(_0x0322('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0322('0x5'));var util=require(_0x0322('0x6'));var path=require(_0x0322('0x7'));var sox=require(_0x0322('0x8'));var csv=require(_0x0322('0x9'));var ejs=require(_0x0322('0xa'));var fs=require('fs');var fs_extra=require(_0x0322('0xb'));var _=require(_0x0322('0xc'));var squel=require(_0x0322('0xd'));var crypto=require(_0x0322('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0322('0xf'));var toCsv=require(_0x0322('0x9'));var querystring=require(_0x0322('0x10'));var Papa=require(_0x0322('0x11'));var Redis=require(_0x0322('0x12'));var authService=require(_0x0322('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0322('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0322('0x15'))(_0x0322('0x16'));var utils=require(_0x0322('0x17'));var config=require(_0x0322('0x18'));var licenseUtil=require(_0x0322('0x19'));var db=require('../../mysqldb')['db'];config[_0x0322('0x1a')]=_[_0x0322('0x1b')](config['redis'],{'host':_0x0322('0x1c'),'port':0x18eb});var socket=require(_0x0322('0x1d'))(new Redis(config[_0x0322('0x1a')]));require(_0x0322('0x1e'))[_0x0322('0x1f')](socket);function respondWithStatusCode(_0x55e63e,_0x55b998){_0x55b998=_0x55b998||0xcc;return function(_0x2547a9){if(_0x2547a9){return _0x55e63e['sendStatus'](_0x55b998);}return _0x55e63e[_0x0322('0x20')](_0x55b998)[_0x0322('0x21')]();};}function respondWithResult(_0x3a6dda,_0x1e7224){_0x1e7224=_0x1e7224||0xc8;return function(_0x55e63d){if(_0x55e63d){return _0x3a6dda['status'](_0x1e7224)[_0x0322('0x22')](_0x55e63d);}};}function respondWithFilteredResult(_0x5d7b18,_0x46fdc){return function(_0x41c390){if(_0x41c390){var _0x3fe8ad=typeof _0x46fdc[_0x0322('0x23')]===_0x0322('0x24')&&typeof _0x46fdc['limit']===_0x0322('0x24');var _0x56743a=_0x41c390[_0x0322('0x25')];var _0x145495=_0x3fe8ad?0x0:_0x46fdc[_0x0322('0x23')];var _0x15ac97=_0x3fe8ad?_0x41c390['count']:_0x46fdc['offset']+_0x46fdc[_0x0322('0x26')];var _0x3689da;if(_0x15ac97>=_0x56743a){_0x15ac97=_0x56743a;_0x3689da=0xc8;}else{_0x3689da=0xce;}_0x5d7b18[_0x0322('0x20')](_0x3689da);return _0x5d7b18[_0x0322('0x27')](_0x0322('0x28'),_0x145495+'-'+_0x15ac97+'/'+_0x56743a)[_0x0322('0x22')](_0x41c390);}return null;};}function patchUpdates(_0x595fcb){return function(_0x12178a){try{jsonpatch[_0x0322('0x29')](_0x12178a,_0x595fcb,!![]);}catch(_0xc472cc){return BPromise['reject'](_0xc472cc);}return _0x12178a[_0x0322('0x2a')]();};}function saveUpdates(_0x9ca979,_0x5c80c0){return function(_0x34e121){if(_0x34e121){return _0x34e121['update'](_0x9ca979)['then'](function(_0x2b266c){return _0x2b266c;});}return null;};}function removeEntity(_0x1fcfa6,_0x98bb85){return function(_0x409f5a){if(_0x409f5a){return _0x409f5a[_0x0322('0x2b')]()['then'](function(){var _0x4e791d=_0x409f5a[_0x0322('0x2c')]({'plain':!![]});var _0x26e8bf=_0x0322('0x2d');return db['UserProfileResource'][_0x0322('0x2b')]({'where':{'type':_0x26e8bf,'resourceId':_0x4e791d['id']}})['then'](function(){return _0x409f5a;});})['then'](function(){_0x1fcfa6[_0x0322('0x20')](0xcc)[_0x0322('0x21')]();});}};}function handleEntityNotFound(_0x6a8154,_0x1e7e3d){return function(_0x55617f){if(!_0x55617f){_0x6a8154[_0x0322('0x2e')](0x194);}return _0x55617f;};}function handleError(_0x484286,_0x45f6f0){_0x45f6f0=_0x45f6f0||0x1f4;return function(_0x338faa){logger[_0x0322('0x2f')](_0x338faa['stack']);if(_0x338faa[_0x0322('0x30')]){delete _0x338faa['name'];}_0x484286['status'](_0x45f6f0)[_0x0322('0x31')](_0x338faa);};}exports[_0x0322('0x32')]=function(_0x5633ca,_0x35c83e){var _0x357469={},_0x589f6c={},_0x2e6a08={'count':0x0,'rows':[]};var _0x556dc0=_[_0x0322('0x33')](db[_0x0322('0x34')][_0x0322('0x35')],function(_0x141cb2){return{'name':_0x141cb2[_0x0322('0x36')],'type':_0x141cb2['type']['key']};});_0x589f6c[_0x0322('0x37')]=_[_0x0322('0x33')](_0x556dc0,_0x0322('0x30'));_0x589f6c['query']=_[_0x0322('0x38')](_0x5633ca[_0x0322('0x39')]);_0x589f6c['filters']=_['intersection'](_0x589f6c['model'],_0x589f6c[_0x0322('0x39')]);_0x357469[_0x0322('0x3a')]=_[_0x0322('0x3b')](_0x589f6c[_0x0322('0x37')],qs[_0x0322('0x3c')](_0x5633ca[_0x0322('0x39')][_0x0322('0x3c')]));_0x357469[_0x0322('0x3a')]=_0x357469[_0x0322('0x3a')][_0x0322('0x3d')]?_0x357469[_0x0322('0x3a')]:_0x589f6c['model'];if(!_0x5633ca[_0x0322('0x39')][_0x0322('0x3e')](_0x0322('0x3f'))){_0x357469['limit']=qs[_0x0322('0x26')](_0x5633ca[_0x0322('0x39')][_0x0322('0x26')]);_0x357469[_0x0322('0x23')]=qs[_0x0322('0x23')](_0x5633ca[_0x0322('0x39')][_0x0322('0x23')]);}_0x357469[_0x0322('0x40')]=qs[_0x0322('0x41')](_0x5633ca[_0x0322('0x39')][_0x0322('0x41')]);_0x357469[_0x0322('0x42')]=qs['filters'](_[_0x0322('0x43')](_0x5633ca['query'],_0x589f6c[_0x0322('0x44')]),_0x556dc0);if(_0x5633ca[_0x0322('0x39')][_0x0322('0x45')]){_0x357469[_0x0322('0x42')]=_[_0x0322('0x46')](_0x357469[_0x0322('0x42')],{'$or':_['map'](_0x556dc0,function(_0xaf1074){if(_0xaf1074[_0x0322('0x47')]!==_0x0322('0x48')){var _0x3d72cb={};_0x3d72cb[_0xaf1074['name']]={'$like':'%'+_0x5633ca[_0x0322('0x39')]['filter']+'%'};return _0x3d72cb;}})});}_0x357469=_[_0x0322('0x46')]({},_0x357469,_0x5633ca['options']);var _0x1cedc4={'where':_0x357469[_0x0322('0x42')]};return db[_0x0322('0x34')]['count'](_0x1cedc4)[_0x0322('0x49')](function(_0x4e567c){_0x2e6a08['count']=_0x4e567c;if(_0x5633ca[_0x0322('0x39')][_0x0322('0x4a')]){_0x357469[_0x0322('0x4b')]=[{'all':!![]}];}return db[_0x0322('0x34')][_0x0322('0x4c')](_0x357469);})[_0x0322('0x49')](function(_0x3578f9){_0x2e6a08[_0x0322('0x4d')]=_0x3578f9;return _0x2e6a08;})[_0x0322('0x49')](respondWithFilteredResult(_0x35c83e,_0x357469))[_0x0322('0x4e')](handleError(_0x35c83e,null));};exports[_0x0322('0x4f')]=function(_0x80c15e,_0x29fa15){var _0xfeae04={'raw':![],'where':{'id':_0x80c15e[_0x0322('0x50')]['id']}},_0x457acf={};_0x457acf['model']=_[_0x0322('0x38')](db[_0x0322('0x34')][_0x0322('0x35')]);_0x457acf[_0x0322('0x39')]=_[_0x0322('0x38')](_0x80c15e[_0x0322('0x39')]);_0x457acf[_0x0322('0x44')]=_['intersection'](_0x457acf[_0x0322('0x37')],_0x457acf[_0x0322('0x39')]);_0xfeae04[_0x0322('0x3a')]=_[_0x0322('0x3b')](_0x457acf[_0x0322('0x37')],qs[_0x0322('0x3c')](_0x80c15e[_0x0322('0x39')][_0x0322('0x3c')]));_0xfeae04[_0x0322('0x3a')]=_0xfeae04[_0x0322('0x3a')]['length']?_0xfeae04[_0x0322('0x3a')]:_0x457acf[_0x0322('0x37')];if(_0x80c15e[_0x0322('0x39')]['includeAll']){_0xfeae04[_0x0322('0x4b')]=[{'all':!![]}];}_0xfeae04=_[_0x0322('0x46')]({},_0xfeae04,_0x80c15e[_0x0322('0x51')]);return db[_0x0322('0x34')][_0x0322('0x52')](_0xfeae04)[_0x0322('0x49')](handleEntityNotFound(_0x29fa15,null))[_0x0322('0x49')](respondWithResult(_0x29fa15,null))[_0x0322('0x4e')](handleError(_0x29fa15,null));};exports[_0x0322('0x53')]=function(_0x348260,_0xe8ad2d){return db[_0x0322('0x34')][_0x0322('0x53')](_0x348260['body'],{})[_0x0322('0x49')](function(_0x5c3c1){var _0x3f310a=_0x348260['user']['get']({'plain':!![]});if(!_0x3f310a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f310a[_0x0322('0x54')]===_0x0322('0x55')){var _0x3cece5=_0x5c3c1[_0x0322('0x2c')]({'plain':!![]});var _0x4bdc9d=_0x0322('0x2d');return db[_0x0322('0x56')][_0x0322('0x52')]({'where':{'name':_0x4bdc9d,'userProfileId':_0x3f310a[_0x0322('0x57')]},'raw':!![]})[_0x0322('0x49')](function(_0x2e489d){if(_0x2e489d&&_0x2e489d[_0x0322('0x58')]===0x0){return db[_0x0322('0x59')][_0x0322('0x53')]({'name':_0x3cece5[_0x0322('0x30')],'resourceId':_0x3cece5['id'],'type':_0x2e489d[_0x0322('0x30')],'sectionId':_0x2e489d['id']},{})[_0x0322('0x49')](function(){return _0x5c3c1;});}else{return _0x5c3c1;}})[_0x0322('0x4e')](function(_0x582814){logger['error'](_0x0322('0x5a'),_0x582814);throw _0x582814;});}return _0x5c3c1;})[_0x0322('0x49')](respondWithResult(_0xe8ad2d,0xc9))[_0x0322('0x4e')](handleError(_0xe8ad2d,null));};exports[_0x0322('0x5b')]=function(_0x49dc2f,_0x36f0e0){if(_0x49dc2f[_0x0322('0x5c')]['id']){delete _0x49dc2f[_0x0322('0x5c')]['id'];}return db[_0x0322('0x34')]['find']({'where':{'id':_0x49dc2f[_0x0322('0x50')]['id']}})[_0x0322('0x49')](handleEntityNotFound(_0x36f0e0,null))[_0x0322('0x49')](saveUpdates(_0x49dc2f[_0x0322('0x5c')],null))['then'](respondWithResult(_0x36f0e0,null))[_0x0322('0x4e')](handleError(_0x36f0e0,null));};exports[_0x0322('0x2b')]=function(_0x4b7ef,_0x24b029){return db[_0x0322('0x34')][_0x0322('0x52')]({'where':{'id':_0x4b7ef[_0x0322('0x50')]['id']}})[_0x0322('0x49')](handleEntityNotFound(_0x24b029,null))[_0x0322('0x49')](removeEntity(_0x24b029,null))[_0x0322('0x4e')](handleError(_0x24b029,null));};exports['addUsers']=function(_0x2757c2,_0x2a7deb,_0x2b01a5){return db[_0x0322('0x34')][_0x0322('0x52')]({'where':{'id':_0x2757c2[_0x0322('0x50')]['id']}})[_0x0322('0x49')](handleEntityNotFound(_0x2a7deb,null))['then'](function(_0x4d96f9){if(_0x4d96f9){return _0x4d96f9[_0x0322('0x5d')](_0x2757c2['body'][_0x0322('0x5e')],_[_0x0322('0x5f')](_0x2757c2['body'],[_0x0322('0x5e'),'id'])||{});}})[_0x0322('0x49')](respondWithResult(_0x2a7deb,null))[_0x0322('0x4e')](handleError(_0x2a7deb,null));};exports[_0x0322('0x60')]=function(_0x554c1d,_0x4a7095,_0x32afe0){return db['SquareProject'][_0x0322('0x52')]({'where':{'id':_0x554c1d[_0x0322('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a7095,null))[_0x0322('0x49')](function(_0x34a755){if(_0x34a755){return _0x34a755[_0x0322('0x60')](_0x554c1d[_0x0322('0x39')][_0x0322('0x5e')])[_0x0322('0x49')](function(){if(_[_0x0322('0x61')](_0x554c1d[_0x0322('0x39')][_0x0322('0x5e')])){for(var _0x772e7b=0x0;_0x772e7b<_0x554c1d[_0x0322('0x39')]['ids'][_0x0322('0x3d')];_0x772e7b+=0x1){socket[_0x0322('0x62')](_0x0322('0x63'),{'UserId':Number(_0x554c1d['query']['ids'][_0x772e7b]),'SquareProjectId':Number(_0x554c1d[_0x0322('0x50')]['id'])});}}else{socket[_0x0322('0x62')](_0x0322('0x63'),{'UserId':Number(_0x554c1d[_0x0322('0x39')]['ids']),'SquareProjectId':Number(_0x554c1d['params']['id'])});}});}})[_0x0322('0x49')](respondWithStatusCode(_0x4a7095,null))[_0x0322('0x4e')](handleError(_0x4a7095,null));};exports[_0x0322('0x64')]=function(_0xef1cb6,_0x19c538,_0x1a4497){var _0x21d23a={};var _0x1bf24c={};var _0x59ae1d;var _0x324853;return db[_0x0322('0x34')][_0x0322('0x65')]({'where':{'id':_0xef1cb6[_0x0322('0x50')]['id']}})[_0x0322('0x49')](handleEntityNotFound(_0x19c538,null))[_0x0322('0x49')](function(_0x180aeb){if(_0x180aeb){_0x59ae1d=_0x180aeb;_0x1bf24c[_0x0322('0x37')]=_[_0x0322('0x38')](db[_0x0322('0x66')][_0x0322('0x35')]);_0x1bf24c[_0x0322('0x39')]=_[_0x0322('0x38')](_0xef1cb6['query']);_0x1bf24c[_0x0322('0x44')]=_['intersection'](_0x1bf24c[_0x0322('0x37')],_0x1bf24c[_0x0322('0x39')]);_0x21d23a[_0x0322('0x3a')]=_[_0x0322('0x3b')](_0x1bf24c[_0x0322('0x37')],qs[_0x0322('0x3c')](_0xef1cb6[_0x0322('0x39')]['fields']));_0x21d23a[_0x0322('0x3a')]=_0x21d23a[_0x0322('0x3a')]['length']?_0x21d23a['attributes']:_0x1bf24c[_0x0322('0x37')];_0x21d23a[_0x0322('0x40')]=qs['sort'](_0xef1cb6[_0x0322('0x39')]['sort']);_0x21d23a['where']=qs[_0x0322('0x44')](_[_0x0322('0x43')](_0xef1cb6[_0x0322('0x39')],_0x1bf24c[_0x0322('0x44')]));if(_0xef1cb6['query']['filter']){_0x21d23a[_0x0322('0x42')]=_[_0x0322('0x46')](_0x21d23a[_0x0322('0x42')],{'$or':_['map'](_0x21d23a['attributes'],function(_0x19976a){var _0x2f1c76={};_0x2f1c76[_0x19976a]={'$like':'%'+_0xef1cb6['query']['filter']+'%'};return _0x2f1c76;})});}_0x21d23a=_[_0x0322('0x46')]({},_0x21d23a,_0xef1cb6['options']);return _0x59ae1d['getUsers'](_0x21d23a);}})[_0x0322('0x49')](function(_0x1326be){if(_0x1326be){_0x324853=_0x1326be[_0x0322('0x3d')];if(!_0xef1cb6[_0x0322('0x39')][_0x0322('0x3e')](_0x0322('0x3f'))){_0x21d23a[_0x0322('0x26')]=qs['limit'](_0xef1cb6[_0x0322('0x39')][_0x0322('0x26')]);_0x21d23a['offset']=qs['offset'](_0xef1cb6[_0x0322('0x39')][_0x0322('0x23')]);}return _0x59ae1d['getUsers'](_0x21d23a);}})[_0x0322('0x49')](function(_0xeed570){if(_0xeed570){return _0xeed570?{'count':_0x324853,'rows':_0xeed570}:null;}})[_0x0322('0x49')](respondWithResult(_0x19c538,null))[_0x0322('0x4e')](handleError(_0x19c538,null));}; \ No newline at end of file +var _0xd6ee=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','catch','model','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','emit','getUsers','User','options','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','SquareProjects','destroy','end','error','name','index','SquareProject','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd6ee,0x190));var _0xed6e=function(_0x55ecc5,_0x5a65b1){_0x55ecc5=_0x55ecc5-0x0;var _0x11346d=_0xd6ee[_0x55ecc5];return _0x11346d;};'use strict';var emlformat=require(_0xed6e('0x0'));var rimraf=require(_0xed6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed6e('0x2'));var rp=require(_0xed6e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed6e('0x4'));var util=require(_0xed6e('0x5'));var path=require(_0xed6e('0x6'));var sox=require('sox');var csv=require(_0xed6e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed6e('0x8'));var _=require(_0xed6e('0x9'));var squel=require(_0xed6e('0xa'));var crypto=require('crypto');var jsforce=require(_0xed6e('0xb'));var deskjs=require(_0xed6e('0xc'));var toCsv=require(_0xed6e('0x7'));var querystring=require(_0xed6e('0xd'));var Papa=require(_0xed6e('0xe'));var Redis=require(_0xed6e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed6e('0x10'));var logger=require(_0xed6e('0x11'))(_0xed6e('0x12'));var utils=require('../../config/utils');var config=require(_0xed6e('0x13'));var licenseUtil=require(_0xed6e('0x14'));var db=require(_0xed6e('0x15'))['db'];config['redis']=_[_0xed6e('0x16')](config[_0xed6e('0x17')],{'host':_0xed6e('0x18'),'port':0x18eb});var socket=require(_0xed6e('0x19'))(new Redis(config[_0xed6e('0x17')]));require(_0xed6e('0x1a'))[_0xed6e('0x1b')](socket);function respondWithStatusCode(_0x4ffe3d,_0x25fe18){_0x25fe18=_0x25fe18||0xcc;return function(_0x4f4446){if(_0x4f4446){return _0x4ffe3d[_0xed6e('0x1c')](_0x25fe18);}return _0x4ffe3d[_0xed6e('0x1d')](_0x25fe18)['end']();};}function respondWithResult(_0xbcfbaf,_0x26ede4){_0x26ede4=_0x26ede4||0xc8;return function(_0x56d8f0){if(_0x56d8f0){return _0xbcfbaf[_0xed6e('0x1d')](_0x26ede4)[_0xed6e('0x1e')](_0x56d8f0);}};}function respondWithFilteredResult(_0x2ac6cd,_0x5281ca){return function(_0x1feaa9){if(_0x1feaa9){var _0x58acd3=typeof _0x5281ca['offset']===_0xed6e('0x1f')&&typeof _0x5281ca[_0xed6e('0x20')]===_0xed6e('0x1f');var _0x34721a=_0x1feaa9[_0xed6e('0x21')];var _0x1045e1=_0x58acd3?0x0:_0x5281ca[_0xed6e('0x22')];var _0x9002b1=_0x58acd3?_0x1feaa9[_0xed6e('0x21')]:_0x5281ca[_0xed6e('0x22')]+_0x5281ca[_0xed6e('0x20')];var _0x1d34f2;if(_0x9002b1>=_0x34721a){_0x9002b1=_0x34721a;_0x1d34f2=0xc8;}else{_0x1d34f2=0xce;}_0x2ac6cd[_0xed6e('0x1d')](_0x1d34f2);return _0x2ac6cd['set'](_0xed6e('0x23'),_0x1045e1+'-'+_0x9002b1+'/'+_0x34721a)[_0xed6e('0x1e')](_0x1feaa9);}return null;};}function patchUpdates(_0x565ef7){return function(_0x1689cd){try{jsonpatch[_0xed6e('0x24')](_0x1689cd,_0x565ef7,!![]);}catch(_0x4164eb){return BPromise[_0xed6e('0x25')](_0x4164eb);}return _0x1689cd['save']();};}function saveUpdates(_0x2d577c,_0x3a4051){return function(_0x93c449){if(_0x93c449){return _0x93c449[_0xed6e('0x26')](_0x2d577c)[_0xed6e('0x27')](function(_0x45e3e1){return _0x45e3e1;});}return null;};}function removeEntity(_0xcbb456,_0x357b2d){return function(_0x52786a){if(_0x52786a){return _0x52786a['destroy']()['then'](function(){var _0x1d4e29=_0x52786a[_0xed6e('0x28')]({'plain':!![]});var _0x4e6cc3=_0xed6e('0x29');return db['UserProfileResource'][_0xed6e('0x2a')]({'where':{'type':_0x4e6cc3,'resourceId':_0x1d4e29['id']}})['then'](function(){return _0x52786a;});})[_0xed6e('0x27')](function(){_0xcbb456[_0xed6e('0x1d')](0xcc)[_0xed6e('0x2b')]();});}};}function handleEntityNotFound(_0x48f355,_0x2e5e5e){return function(_0x1beb31){if(!_0x1beb31){_0x48f355[_0xed6e('0x1c')](0x194);}return _0x1beb31;};}function handleError(_0x570c0b,_0x55ed79){_0x55ed79=_0x55ed79||0x1f4;return function(_0x26fbf4){logger[_0xed6e('0x2c')](_0x26fbf4['stack']);if(_0x26fbf4['name']){delete _0x26fbf4[_0xed6e('0x2d')];}_0x570c0b[_0xed6e('0x1d')](_0x55ed79)['send'](_0x26fbf4);};}exports[_0xed6e('0x2e')]=function(_0x19013e,_0x2a51dc){var _0x363b4b={},_0x329b56={},_0x379be2={'count':0x0,'rows':[]};var _0x17e868=_['map'](db[_0xed6e('0x2f')][_0xed6e('0x30')],function(_0x567802){return{'name':_0x567802[_0xed6e('0x31')],'type':_0x567802[_0xed6e('0x32')][_0xed6e('0x33')]};});_0x329b56['model']=_[_0xed6e('0x34')](_0x17e868,_0xed6e('0x2d'));_0x329b56[_0xed6e('0x35')]=_[_0xed6e('0x36')](_0x19013e[_0xed6e('0x35')]);_0x329b56[_0xed6e('0x37')]=_['intersection'](_0x329b56['model'],_0x329b56[_0xed6e('0x35')]);_0x363b4b['attributes']=_[_0xed6e('0x38')](_0x329b56['model'],qs['fields'](_0x19013e['query'][_0xed6e('0x39')]));_0x363b4b['attributes']=_0x363b4b[_0xed6e('0x3a')][_0xed6e('0x3b')]?_0x363b4b[_0xed6e('0x3a')]:_0x329b56['model'];if(!_0x19013e[_0xed6e('0x35')][_0xed6e('0x3c')](_0xed6e('0x3d'))){_0x363b4b[_0xed6e('0x20')]=qs['limit'](_0x19013e['query'][_0xed6e('0x20')]);_0x363b4b['offset']=qs[_0xed6e('0x22')](_0x19013e[_0xed6e('0x35')][_0xed6e('0x22')]);}_0x363b4b[_0xed6e('0x3e')]=qs[_0xed6e('0x3f')](_0x19013e[_0xed6e('0x35')][_0xed6e('0x3f')]);_0x363b4b[_0xed6e('0x40')]=qs[_0xed6e('0x37')](_[_0xed6e('0x41')](_0x19013e[_0xed6e('0x35')],_0x329b56[_0xed6e('0x37')]),_0x17e868);if(_0x19013e[_0xed6e('0x35')][_0xed6e('0x42')]){_0x363b4b[_0xed6e('0x40')]=_['merge'](_0x363b4b['where'],{'$or':_[_0xed6e('0x34')](_0x17e868,function(_0x4db049){if(_0x4db049['type']!==_0xed6e('0x43')){var _0x48f859={};_0x48f859[_0x4db049[_0xed6e('0x2d')]]={'$like':'%'+_0x19013e['query'][_0xed6e('0x42')]+'%'};return _0x48f859;}})});}_0x363b4b=_['merge']({},_0x363b4b,_0x19013e['options']);var _0x6f9591={'where':_0x363b4b[_0xed6e('0x40')]};return db[_0xed6e('0x2f')]['count'](_0x6f9591)[_0xed6e('0x27')](function(_0x19885d){_0x379be2[_0xed6e('0x21')]=_0x19885d;if(_0x19013e['query']['includeAll']){_0x363b4b[_0xed6e('0x44')]=[{'all':!![]}];}return db[_0xed6e('0x2f')][_0xed6e('0x45')](_0x363b4b);})['then'](function(_0x2b2e37){_0x379be2['rows']=_0x2b2e37;return _0x379be2;})[_0xed6e('0x27')](respondWithFilteredResult(_0x2a51dc,_0x363b4b))[_0xed6e('0x46')](handleError(_0x2a51dc,null));};exports['show']=function(_0x51f80e,_0x157f7d){var _0x30ca54={'raw':![],'where':{'id':_0x51f80e['params']['id']}},_0x287966={};_0x287966[_0xed6e('0x47')]=_['keys'](db['SquareProject'][_0xed6e('0x30')]);_0x287966['query']=_[_0xed6e('0x36')](_0x51f80e[_0xed6e('0x35')]);_0x287966['filters']=_[_0xed6e('0x38')](_0x287966['model'],_0x287966[_0xed6e('0x35')]);_0x30ca54[_0xed6e('0x3a')]=_['intersection'](_0x287966[_0xed6e('0x47')],qs[_0xed6e('0x39')](_0x51f80e[_0xed6e('0x35')][_0xed6e('0x39')]));_0x30ca54['attributes']=_0x30ca54[_0xed6e('0x3a')][_0xed6e('0x3b')]?_0x30ca54['attributes']:_0x287966[_0xed6e('0x47')];if(_0x51f80e['query']['includeAll']){_0x30ca54[_0xed6e('0x44')]=[{'all':!![]}];}_0x30ca54=_[_0xed6e('0x48')]({},_0x30ca54,_0x51f80e['options']);return db['SquareProject']['find'](_0x30ca54)[_0xed6e('0x27')](handleEntityNotFound(_0x157f7d,null))[_0xed6e('0x27')](respondWithResult(_0x157f7d,null))[_0xed6e('0x46')](handleError(_0x157f7d,null));};exports[_0xed6e('0x49')]=function(_0x1c5dd4,_0x137633){return db[_0xed6e('0x2f')][_0xed6e('0x49')](_0x1c5dd4[_0xed6e('0x4a')],{})[_0xed6e('0x27')](function(_0x2bbd14){var _0x15c68a=_0x1c5dd4[_0xed6e('0x4b')][_0xed6e('0x28')]({'plain':!![]});if(!_0x15c68a)throw new Error(_0xed6e('0x4c'));if(_0x15c68a[_0xed6e('0x4d')]===_0xed6e('0x4b')){var _0x3c94c4=_0x2bbd14[_0xed6e('0x28')]({'plain':!![]});var _0x2d50af=_0xed6e('0x29');return db['UserProfileSection'][_0xed6e('0x4e')]({'where':{'name':_0x2d50af,'userProfileId':_0x15c68a[_0xed6e('0x4f')]},'raw':!![]})[_0xed6e('0x27')](function(_0x2e9318){if(_0x2e9318&&_0x2e9318['autoAssociation']===0x0){return db['UserProfileResource'][_0xed6e('0x49')]({'name':_0x3c94c4['name'],'resourceId':_0x3c94c4['id'],'type':_0x2e9318[_0xed6e('0x2d')],'sectionId':_0x2e9318['id']},{})[_0xed6e('0x27')](function(){return _0x2bbd14;});}else{return _0x2bbd14;}})[_0xed6e('0x46')](function(_0x36b82b){logger[_0xed6e('0x2c')](_0xed6e('0x50'),_0x36b82b);throw _0x36b82b;});}return _0x2bbd14;})[_0xed6e('0x27')](respondWithResult(_0x137633,0xc9))[_0xed6e('0x46')](handleError(_0x137633,null));};exports[_0xed6e('0x26')]=function(_0x90ec1,_0x567af8){if(_0x90ec1['body']['id']){delete _0x90ec1['body']['id'];}return db[_0xed6e('0x2f')][_0xed6e('0x4e')]({'where':{'id':_0x90ec1[_0xed6e('0x51')]['id']}})['then'](handleEntityNotFound(_0x567af8,null))[_0xed6e('0x27')](saveUpdates(_0x90ec1[_0xed6e('0x4a')],null))[_0xed6e('0x27')](respondWithResult(_0x567af8,null))[_0xed6e('0x46')](handleError(_0x567af8,null));};exports[_0xed6e('0x2a')]=function(_0x483094,_0x28307c){return db[_0xed6e('0x2f')][_0xed6e('0x4e')]({'where':{'id':_0x483094[_0xed6e('0x51')]['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x28307c,null))[_0xed6e('0x27')](removeEntity(_0x28307c,null))[_0xed6e('0x46')](handleError(_0x28307c,null));};exports[_0xed6e('0x52')]=function(_0x3dc79d,_0x55e383,_0x310f74){return db[_0xed6e('0x2f')][_0xed6e('0x4e')]({'where':{'id':_0x3dc79d[_0xed6e('0x51')]['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x55e383,null))[_0xed6e('0x27')](function(_0x5469bf){if(_0x5469bf){return _0x5469bf[_0xed6e('0x52')](_0x3dc79d['body'][_0xed6e('0x53')],_[_0xed6e('0x54')](_0x3dc79d[_0xed6e('0x4a')],[_0xed6e('0x53'),'id'])||{});}})[_0xed6e('0x27')](respondWithResult(_0x55e383,null))[_0xed6e('0x46')](handleError(_0x55e383,null));};exports[_0xed6e('0x55')]=function(_0x4896c9,_0x807935,_0x2e22a7){return db['SquareProject'][_0xed6e('0x4e')]({'where':{'id':_0x4896c9[_0xed6e('0x51')]['id']}})['then'](handleEntityNotFound(_0x807935,null))[_0xed6e('0x27')](function(_0x44c5a1){if(_0x44c5a1){return _0x44c5a1[_0xed6e('0x55')](_0x4896c9[_0xed6e('0x35')][_0xed6e('0x53')])[_0xed6e('0x27')](function(){if(_[_0xed6e('0x56')](_0x4896c9[_0xed6e('0x35')][_0xed6e('0x53')])){for(var _0x538188=0x0;_0x538188<_0x4896c9[_0xed6e('0x35')][_0xed6e('0x53')][_0xed6e('0x3b')];_0x538188+=0x1){socket[_0xed6e('0x57')]('userSquareProject:remove',{'UserId':Number(_0x4896c9[_0xed6e('0x35')][_0xed6e('0x53')][_0x538188]),'SquareProjectId':Number(_0x4896c9[_0xed6e('0x51')]['id'])});}}else{socket[_0xed6e('0x57')]('userSquareProject:remove',{'UserId':Number(_0x4896c9['query'][_0xed6e('0x53')]),'SquareProjectId':Number(_0x4896c9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x807935,null))[_0xed6e('0x46')](handleError(_0x807935,null));};exports[_0xed6e('0x58')]=function(_0x534ae2,_0x1abe02,_0x3a678e){var _0x42a8cd={};var _0x12f961={};var _0x579ce4;var _0x244043;return db[_0xed6e('0x2f')]['findOne']({'where':{'id':_0x534ae2[_0xed6e('0x51')]['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x1abe02,null))[_0xed6e('0x27')](function(_0xd89ce1){if(_0xd89ce1){_0x579ce4=_0xd89ce1;_0x12f961[_0xed6e('0x47')]=_[_0xed6e('0x36')](db[_0xed6e('0x59')][_0xed6e('0x30')]);_0x12f961[_0xed6e('0x35')]=_[_0xed6e('0x36')](_0x534ae2[_0xed6e('0x35')]);_0x12f961[_0xed6e('0x37')]=_[_0xed6e('0x38')](_0x12f961[_0xed6e('0x47')],_0x12f961[_0xed6e('0x35')]);_0x42a8cd[_0xed6e('0x3a')]=_[_0xed6e('0x38')](_0x12f961['model'],qs['fields'](_0x534ae2['query'][_0xed6e('0x39')]));_0x42a8cd['attributes']=_0x42a8cd[_0xed6e('0x3a')]['length']?_0x42a8cd['attributes']:_0x12f961[_0xed6e('0x47')];_0x42a8cd['order']=qs[_0xed6e('0x3f')](_0x534ae2[_0xed6e('0x35')][_0xed6e('0x3f')]);_0x42a8cd[_0xed6e('0x40')]=qs[_0xed6e('0x37')](_[_0xed6e('0x41')](_0x534ae2[_0xed6e('0x35')],_0x12f961[_0xed6e('0x37')]));if(_0x534ae2[_0xed6e('0x35')][_0xed6e('0x42')]){_0x42a8cd[_0xed6e('0x40')]=_[_0xed6e('0x48')](_0x42a8cd[_0xed6e('0x40')],{'$or':_['map'](_0x42a8cd[_0xed6e('0x3a')],function(_0x2eb4fe){var _0x2f212d={};_0x2f212d[_0x2eb4fe]={'$like':'%'+_0x534ae2[_0xed6e('0x35')][_0xed6e('0x42')]+'%'};return _0x2f212d;})});}_0x42a8cd=_[_0xed6e('0x48')]({},_0x42a8cd,_0x534ae2[_0xed6e('0x5a')]);return _0x579ce4[_0xed6e('0x58')](_0x42a8cd);}})[_0xed6e('0x27')](function(_0x971e47){if(_0x971e47){_0x244043=_0x971e47['length'];if(!_0x534ae2[_0xed6e('0x35')][_0xed6e('0x3c')](_0xed6e('0x3d'))){_0x42a8cd[_0xed6e('0x20')]=qs[_0xed6e('0x20')](_0x534ae2[_0xed6e('0x35')][_0xed6e('0x20')]);_0x42a8cd[_0xed6e('0x22')]=qs[_0xed6e('0x22')](_0x534ae2['query'][_0xed6e('0x22')]);}return _0x579ce4[_0xed6e('0x58')](_0x42a8cd);}})[_0xed6e('0x27')](function(_0x5357c2){if(_0x5357c2){return _0x5357c2?{'count':_0x244043,'rows':_0x5357c2}:null;}})['then'](respondWithResult(_0x1abe02,null))[_0xed6e('0x46')](handleError(_0x1abe02,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d78e4b0..f7f9636 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 _0x28f6=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1204cf,_0x480502){var _0x111695=function(_0x30442c){while(--_0x30442c){_0x1204cf['push'](_0x1204cf['shift']());}};_0x111695(++_0x480502);}(_0x28f6,0x1ad));var _0x628f=function(_0x1d7672,_0x45cb66){_0x1d7672=_0x1d7672-0x0;var _0x2e4a86=_0x28f6[_0x1d7672];return _0x2e4a86;};'use strict';var EventEmitter=require(_0x628f('0x0'));var SquareProject=require(_0x628f('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x628f('0x2')](0x0);var events={'afterCreate':_0x628f('0x3'),'afterUpdate':_0x628f('0x4'),'afterDestroy':_0x628f('0x5')};function emitEvent(_0x1a50d4){return function(_0x263554,_0x42f2ee,_0x15da74){SquareProjectEvents[_0x628f('0x6')](_0x1a50d4+':'+_0x263554['id'],_0x263554);SquareProjectEvents[_0x628f('0x6')](_0x1a50d4,_0x263554);_0x15da74(null);};}for(var e in events){if(events[_0x628f('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x628f('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x2a3b=['events','../../mysqldb','SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x9c0817,_0x50058d){var _0x396086=function(_0x45e7a6){while(--_0x45e7a6){_0x9c0817['push'](_0x9c0817['shift']());}};_0x396086(++_0x50058d);}(_0x2a3b,0xcf));var _0xb2a3=function(_0x270e77,_0x35a2c3){_0x270e77=_0x270e77-0x0;var _0x110b57=_0x2a3b[_0x270e77];return _0x110b57;};'use strict';var EventEmitter=require(_0xb2a3('0x0'));var SquareProject=require(_0xb2a3('0x1'))['db'][_0xb2a3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb2a3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2a3('0x4'),'afterDestroy':_0xb2a3('0x5')};function emitEvent(_0x2e0bcd){return function(_0x515da2,_0x4535ff,_0x4764c3){SquareProjectEvents[_0xb2a3('0x6')](_0x2e0bcd+':'+_0x515da2['id'],_0x515da2);SquareProjectEvents['emit'](_0x2e0bcd,_0x515da2);_0x4764c3(null);};}for(var e in events){if(events[_0xb2a3('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xb2a3('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 918cdec..ebad356 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 _0xa750=['path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa750,0xc2));var _0x0a75=function(_0x5a377b,_0x1f7760){_0x5a377b=_0x5a377b-0x0;var _0x1cae37=_0xa750[_0x5a377b];return _0x1cae37;};'use strict';var _=require('lodash');var util=require(_0x0a75('0x0'));var logger=require(_0x0a75('0x1'))(_0x0a75('0x2'));var moment=require(_0x0a75('0x3'));var BPromise=require(_0x0a75('0x4'));var rp=require(_0x0a75('0x5'));var fs=require('fs');var path=require(_0x0a75('0x6'));var rimraf=require(_0x0a75('0x7'));var config=require(_0x0a75('0x8'));var attributes=require(_0x0a75('0x9'));module[_0x0a75('0xa')]=function(_0x3377d3,_0x58d30e){return _0x3377d3[_0x0a75('0xb')](_0x0a75('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d0765,_0x43aed2,_0x49486d){if(_0x1d0765[_0x0a75('0xd')](_0x0a75('0xe'))){_0x1d0765[_0x0a75('0xf')]=moment()['format'](_0x0a75('0x10'));}if(_0x1d0765[_0x0a75('0xd')](_0x0a75('0x11'))){_0x1d0765[_0x0a75('0x12')]=moment()[_0x0a75('0x13')](_0x0a75('0x10'));}_0x49486d(null,_0x1d0765);}}});}; \ No newline at end of file +var _0xa077=['production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa077,0x142));var _0x7a07=function(_0x3ba3cd,_0x66f8d0){_0x3ba3cd=_0x3ba3cd-0x0;var _0x32dc67=_0xa077[_0x3ba3cd];return _0x32dc67;};'use strict';var _=require(_0x7a07('0x0'));var util=require(_0x7a07('0x1'));var logger=require(_0x7a07('0x2'))(_0x7a07('0x3'));var moment=require(_0x7a07('0x4'));var BPromise=require(_0x7a07('0x5'));var rp=require(_0x7a07('0x6'));var fs=require('fs');var path=require(_0x7a07('0x7'));var rimraf=require(_0x7a07('0x8'));var config=require(_0x7a07('0x9'));var attributes=require(_0x7a07('0xa'));module['exports']=function(_0x5501f9,_0x2e58f7){return _0x5501f9[_0x7a07('0xb')](_0x7a07('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52546c,_0x4c96e9,_0x725934){if(_0x52546c[_0x7a07('0xd')](_0x7a07('0xe'))){_0x52546c[_0x7a07('0xf')]=moment()[_0x7a07('0x10')](_0x7a07('0x11'));}if(_0x52546c[_0x7a07('0xd')](_0x7a07('0x12'))){_0x52546c[_0x7a07('0x13')]=moment()[_0x7a07('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x725934(null,_0x52546c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 7261a6d..e0ce967 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 _0xcd88=['ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','find','options','raw','where','attributes','include','map','model','then','ShowSquareProject','stringify','util','moment','bluebird','randomstring'];(function(_0x2c9a92,_0x2471b2){var _0x4faefc=function(_0x5d2758){while(--_0x5d2758){_0x2c9a92['push'](_0x2c9a92['shift']());}};_0x4faefc(++_0x2471b2);}(_0xcd88,0x1c3));var _0x8cd8=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0xcd88[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require('lodash');var util=require(_0x8cd8('0x0'));var moment=require(_0x8cd8('0x1'));var BPromise=require(_0x8cd8('0x2'));var rs=require(_0x8cd8('0x3'));var fs=require('fs');var Redis=require(_0x8cd8('0x4'));var db=require(_0x8cd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8cd8('0x6'))(_0x8cd8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8cd8('0x8')][_0x8cd8('0x9')]({'port':0x232a});config[_0x8cd8('0xa')]=_[_0x8cd8('0xb')](config['redis'],{'host':_0x8cd8('0xc'),'port':0x18eb});var socket=require(_0x8cd8('0xd'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x4e53f4,_0x20f383,_0x4c976d){return new BPromise(function(_0x5dc2c9,_0x240bdb){return client[_0x8cd8('0xe')](_0x4e53f4,_0x4c976d)['then'](function(_0x52d6f4){logger[_0x8cd8('0xf')](_0x8cd8('0x10'),_0x20f383,'request\x20sent');logger[_0x8cd8('0x11')](_0x8cd8('0x12'),_0x20f383,_0x8cd8('0x13'),JSON['stringify'](_0x52d6f4));if(_0x52d6f4['error']){if(_0x52d6f4['error'][_0x8cd8('0x14')]===0x1f4){logger[_0x8cd8('0x15')](_0x8cd8('0x10'),_0x20f383,_0x52d6f4[_0x8cd8('0x15')][_0x8cd8('0x16')]);return _0x240bdb(_0x52d6f4[_0x8cd8('0x15')][_0x8cd8('0x16')]);}logger[_0x8cd8('0x15')](_0x8cd8('0x10'),_0x20f383,_0x52d6f4[_0x8cd8('0x15')][_0x8cd8('0x16')]);return _0x5dc2c9(_0x52d6f4['error'][_0x8cd8('0x16')]);}else{logger[_0x8cd8('0xf')](_0x8cd8('0x10'),_0x20f383,_0x8cd8('0x13'));_0x5dc2c9(_0x52d6f4[_0x8cd8('0x17')]['message']);}})['catch'](function(_0x46fdb9){logger['error']('SquareProject,\x20%s,\x20%s',_0x20f383,_0x46fdb9);_0x240bdb(_0x46fdb9);});});}exports['ShowSquareProject']=function(_0x2da1f5){var _0x18f2cf=this;return new Promise(function(_0x5472ad,_0x53766a){return db['SquareProject'][_0x8cd8('0x18')]({'raw':_0x2da1f5[_0x8cd8('0x19')]?_0x2da1f5[_0x8cd8('0x19')][_0x8cd8('0x1a')]===undefined?!![]:![]:!![],'where':_0x2da1f5['options']?_0x2da1f5['options'][_0x8cd8('0x1b')]||null:null,'attributes':_0x2da1f5[_0x8cd8('0x19')]?_0x2da1f5['options'][_0x8cd8('0x1c')]||null:null,'include':_0x2da1f5[_0x8cd8('0x19')]?_0x2da1f5[_0x8cd8('0x19')][_0x8cd8('0x1d')]?_['map'](_0x2da1f5[_0x8cd8('0x19')][_0x8cd8('0x1d')],function(_0x35d9f6){return{'model':db[_0x35d9f6['model']],'as':_0x35d9f6['as'],'attributes':_0x35d9f6['attributes'],'include':_0x35d9f6[_0x8cd8('0x1d')]?_[_0x8cd8('0x1e')](_0x35d9f6['include'],function(_0x425285){return{'model':db[_0x425285[_0x8cd8('0x1f')]],'as':_0x425285['as'],'attributes':_0x425285[_0x8cd8('0x1c')],'include':_0x425285['include']?_[_0x8cd8('0x1e')](_0x425285['include'],function(_0x55a8e0){return{'model':db[_0x55a8e0[_0x8cd8('0x1f')]],'as':_0x55a8e0['as'],'attributes':_0x55a8e0[_0x8cd8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8cd8('0x20')](function(_0x411036){logger[_0x8cd8('0xf')](_0x8cd8('0x21'),_0x2da1f5);logger[_0x8cd8('0x11')](_0x8cd8('0x21'),_0x2da1f5,JSON[_0x8cd8('0x22')](_0x411036));_0x5472ad(_0x411036);})['catch'](function(_0x4c4945){logger[_0x8cd8('0x15')](_0x8cd8('0x21'),_0x4c4945[_0x8cd8('0x16')],_0x2da1f5);_0x53766a(_0x18f2cf[_0x8cd8('0x15')](0x1f4,_0x4c4945['message']));});});}; \ No newline at end of file +var _0xf7db=['debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','request\x20sent'];(function(_0xd51fa6,_0x3b60ee){var _0x145313=function(_0x1bdf3e){while(--_0x1bdf3e){_0xd51fa6['push'](_0xd51fa6['shift']());}};_0x145313(++_0x3b60ee);}(_0xf7db,0x104));var _0xbf7d=function(_0x499250,_0x33c0bc){_0x499250=_0x499250-0x0;var _0x312093=_0xf7db[_0x499250];return _0x312093;};'use strict';var _=require(_0xbf7d('0x0'));var util=require(_0xbf7d('0x1'));var moment=require(_0xbf7d('0x2'));var BPromise=require(_0xbf7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf7d('0x4'));var db=require(_0xbf7d('0x5'))['db'];var utils=require(_0xbf7d('0x6'));var logger=require(_0xbf7d('0x7'))(_0xbf7d('0x8'));var config=require(_0xbf7d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbf7d('0xa')][_0xbf7d('0xb')]({'port':0x232a});config[_0xbf7d('0xc')]=_[_0xbf7d('0xd')](config['redis'],{'host':_0xbf7d('0xe'),'port':0x18eb});var socket=require(_0xbf7d('0xf'))(new Redis(config[_0xbf7d('0xc')]));require(_0xbf7d('0x10'))['register'](socket);function respondWithRpcPromise(_0x4b54aa,_0x52038b,_0x4c372c){return new BPromise(function(_0x558995,_0xeb2831){return client[_0xbf7d('0x11')](_0x4b54aa,_0x4c372c)[_0xbf7d('0x12')](function(_0x5a449d){logger['info']('SquareProject,\x20%s,\x20%s',_0x52038b,_0xbf7d('0x13'));logger[_0xbf7d('0x14')](_0xbf7d('0x15'),_0x52038b,_0xbf7d('0x13'),JSON[_0xbf7d('0x16')](_0x5a449d));if(_0x5a449d[_0xbf7d('0x17')]){if(_0x5a449d[_0xbf7d('0x17')][_0xbf7d('0x18')]===0x1f4){logger[_0xbf7d('0x17')]('SquareProject,\x20%s,\x20%s',_0x52038b,_0x5a449d[_0xbf7d('0x17')]['message']);return _0xeb2831(_0x5a449d[_0xbf7d('0x17')][_0xbf7d('0x19')]);}logger[_0xbf7d('0x17')]('SquareProject,\x20%s,\x20%s',_0x52038b,_0x5a449d[_0xbf7d('0x17')][_0xbf7d('0x19')]);return _0x558995(_0x5a449d[_0xbf7d('0x17')][_0xbf7d('0x19')]);}else{logger[_0xbf7d('0x1a')](_0xbf7d('0x1b'),_0x52038b,_0xbf7d('0x13'));_0x558995(_0x5a449d[_0xbf7d('0x1c')]['message']);}})[_0xbf7d('0x1d')](function(_0x269bb7){logger[_0xbf7d('0x17')](_0xbf7d('0x1b'),_0x52038b,_0x269bb7);_0xeb2831(_0x269bb7);});});}exports[_0xbf7d('0x1e')]=function(_0x3ca8b1){var _0x1aa0fd=this;return new Promise(function(_0x5aa2ad,_0x3540f7){return db[_0xbf7d('0x1f')][_0xbf7d('0x20')]({'raw':_0x3ca8b1['options']?_0x3ca8b1[_0xbf7d('0x21')][_0xbf7d('0x22')]===undefined?!![]:![]:!![],'where':_0x3ca8b1[_0xbf7d('0x21')]?_0x3ca8b1[_0xbf7d('0x21')][_0xbf7d('0x23')]||null:null,'attributes':_0x3ca8b1['options']?_0x3ca8b1['options'][_0xbf7d('0x24')]||null:null,'include':_0x3ca8b1[_0xbf7d('0x21')]?_0x3ca8b1['options'][_0xbf7d('0x25')]?_[_0xbf7d('0x26')](_0x3ca8b1[_0xbf7d('0x21')][_0xbf7d('0x25')],function(_0x3c1f0a){return{'model':db[_0x3c1f0a[_0xbf7d('0x27')]],'as':_0x3c1f0a['as'],'attributes':_0x3c1f0a[_0xbf7d('0x24')],'include':_0x3c1f0a['include']?_['map'](_0x3c1f0a[_0xbf7d('0x25')],function(_0x5bda86){return{'model':db[_0x5bda86[_0xbf7d('0x27')]],'as':_0x5bda86['as'],'attributes':_0x5bda86[_0xbf7d('0x24')],'include':_0x5bda86[_0xbf7d('0x25')]?_['map'](_0x5bda86[_0xbf7d('0x25')],function(_0x389a3c){return{'model':db[_0x389a3c[_0xbf7d('0x27')]],'as':_0x389a3c['as'],'attributes':_0x389a3c[_0xbf7d('0x24')]};}):[]};}):[]};}):[]:[]})[_0xbf7d('0x12')](function(_0x3196a6){logger['info'](_0xbf7d('0x1e'),_0x3ca8b1);logger[_0xbf7d('0x14')](_0xbf7d('0x1e'),_0x3ca8b1,JSON[_0xbf7d('0x16')](_0x3196a6));_0x5aa2ad(_0x3196a6);})['catch'](function(_0xf36ad8){logger['error'](_0xbf7d('0x1e'),_0xf36ad8[_0xbf7d('0x19')],_0x3ca8b1);_0x3540f7(_0x1aa0fd[_0xbf7d('0x17')](0x1f4,_0xf36ad8[_0xbf7d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a45c92a..ff7c194 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 _0x8882=['remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0x27564d,_0x38fb74){var _0x52dce3=function(_0x571aef){while(--_0x571aef){_0x27564d['push'](_0x27564d['shift']());}};_0x52dce3(++_0x38fb74);}(_0x8882,0x166));var _0x2888=function(_0x2e09b3,_0x1f4069){_0x2e09b3=_0x2e09b3-0x0;var _0x55dcd2=_0x8882[_0x2e09b3];return _0x55dcd2;};'use strict';var SquareProjectEvents=require(_0x2888('0x0'));var events=[_0x2888('0x1'),_0x2888('0x2'),_0x2888('0x3')];function createListener(_0x25f2ac,_0x5d8b0c){return function(_0x303050){_0x5d8b0c[_0x2888('0x4')](_0x25f2ac,_0x303050);};}function removeListener(_0x2e9e64,_0x3a211b){return function(){SquareProjectEvents[_0x2888('0x5')](_0x2e9e64,_0x3a211b);};}exports[_0x2888('0x6')]=function(_0x52d214){for(var _0x22adf2=0x0,_0xd0b1f=events[_0x2888('0x7')];_0x22adf2<_0xd0b1f;_0x22adf2++){var _0x216edb=events[_0x22adf2];var _0x14ea8f=createListener(_0x2888('0x8')+_0x216edb,_0x52d214);SquareProjectEvents['on'](_0x216edb,_0x14ea8f);}}; \ No newline at end of file +var _0x2180=['save','remove','emit','removeListener','register','squareProject:','./squareProject.events'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x2180,0x125));var _0x0218=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x2180[_0x243b2f];return _0xcb3c2d;};'use strict';var SquareProjectEvents=require(_0x0218('0x0'));var events=[_0x0218('0x1'),_0x0218('0x2'),'update'];function createListener(_0x7486b3,_0x55a5de){return function(_0x590849){_0x55a5de[_0x0218('0x3')](_0x7486b3,_0x590849);};}function removeListener(_0x209fe4,_0x2af55a){return function(){SquareProjectEvents[_0x0218('0x4')](_0x209fe4,_0x2af55a);};}exports[_0x0218('0x5')]=function(_0x3e4851){for(var _0x2db21f=0x0,_0x1f6b5c=events['length'];_0x2db21f<_0x1f6b5c;_0x2db21f++){var _0x2f05b2=events[_0x2db21f];var _0x52b034=createListener(_0x0218('0x6')+_0x2f05b2,_0x3e4851);SquareProjectEvents['on'](_0x2f05b2,_0x52b034);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 0c8c3a6..0a04798 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(_0x27adf6,_0x41af04){var _0x11373e=function(_0x53b23e){while(--_0x53b23e){_0x27adf6['push'](_0x27adf6['shift']());}};_0x11373e(++_0x41af04);}(_0x4975,0x86));var _0x5497=function(_0x5b65c8,_0x4bde3e){_0x5b65c8=_0x5b65c8-0x0;var _0x1a2b75=_0x4975[_0x5b65c8];return _0x1a2b75;};'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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x42b601,_0x3ddd25){var _0x230496=function(_0x269ff6){while(--_0x269ff6){_0x42b601['push'](_0x42b601['shift']());}};_0x230496(++_0x3ddd25);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5722be,_0x58390a){_0x5722be=_0x5722be-0x0;var _0x16c733=_0x1cb9[_0x5722be];return _0x16c733;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 737c9b8..c479e80 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 _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x98a8,0x12c));var _0x898a=function(_0x37aeeb,_0x50a2ba){_0x37aeeb=_0x37aeeb-0x0;var _0x587afb=_0x98a8[_0x37aeeb];return _0x587afb;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}}; \ No newline at end of file +var _0x2eb2=['substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x2eb2,0x19f));var _0x22eb=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x2eb2[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'uniqueid':{'type':Sequelize[_0x22eb('0x1')]},'callerid':{'type':Sequelize[_0x22eb('0x1')]},'calleridname':{'type':Sequelize[_0x22eb('0x1')]},'context':{'type':Sequelize[_0x22eb('0x1')]},'extension':{'type':Sequelize[_0x22eb('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x22eb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x22eb('0x1')]},'filename':{'type':Sequelize[_0x22eb('0x1')]},'savePath':{'type':Sequelize[_0x22eb('0x1')]},'format':{'type':Sequelize[_0x22eb('0x2')],'get':function(){var _0x4539d0='';var _0x396806=this[_0x22eb('0x3')](_0x22eb('0x4'));if(_0x396806){_0x4539d0=_0x396806[_0x22eb('0x5')](_0x396806[_0x22eb('0x6')]('.'));}return _0x4539d0;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3d70cf9..1c3e00b 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 _0xd823=['apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','catch','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','Sequelize','unlink','isNil','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json'];(function(_0x1cc925,_0x4c59a1){var _0x5a2e6c=function(_0x426cfb){while(--_0x426cfb){_0x1cc925['push'](_0x1cc925['shift']());}};_0x5a2e6c(++_0x4c59a1);}(_0xd823,0x153));var _0x3d82=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0xd823[_0x1f1fb4];return _0x12fa15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d82('0x0'));var zipdir=require(_0x3d82('0x1'));var jsonpatch=require(_0x3d82('0x2'));var rp=require(_0x3d82('0x3'));var moment=require(_0x3d82('0x4'));var BPromise=require(_0x3d82('0x5'));var Mustache=require(_0x3d82('0x6'));var util=require(_0x3d82('0x7'));var path=require(_0x3d82('0x8'));var sox=require('sox');var csv=require(_0x3d82('0x9'));var ejs=require(_0x3d82('0xa'));var fs=require('fs');var fs_extra=require(_0x3d82('0xb'));var _=require(_0x3d82('0xc'));var squel=require(_0x3d82('0xd'));var crypto=require(_0x3d82('0xe'));var jsforce=require(_0x3d82('0xf'));var deskjs=require(_0x3d82('0x10'));var toCsv=require(_0x3d82('0x9'));var querystring=require(_0x3d82('0x11'));var Papa=require(_0x3d82('0x12'));var Redis=require('ioredis');var authService=require(_0x3d82('0x13'));var qs=require(_0x3d82('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d82('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x3d82('0x16'));var config=require(_0x3d82('0x17'));var licenseUtil=require(_0x3d82('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b8bc8,_0x512812){_0x512812=_0x512812||0xcc;return function(_0x4558a2){if(_0x4558a2){return _0x3b8bc8['sendStatus'](_0x512812);}return _0x3b8bc8[_0x3d82('0x19')](_0x512812)[_0x3d82('0x1a')]();};}function respondWithResult(_0x4da1ba,_0x3b9158){_0x3b9158=_0x3b9158||0xc8;return function(_0x5c5309){if(_0x5c5309){return _0x4da1ba[_0x3d82('0x19')](_0x3b9158)['json'](_0x5c5309);}};}function respondWithFilteredResult(_0x3f982e,_0x33996d){return function(_0x362486){if(_0x362486){var _0x3c55a4=typeof _0x33996d[_0x3d82('0x1b')]===_0x3d82('0x1c')&&typeof _0x33996d[_0x3d82('0x1d')]==='undefined';var _0x3cc4f6=_0x362486[_0x3d82('0x1e')];var _0x5e4bcc=_0x3c55a4?0x0:_0x33996d[_0x3d82('0x1b')];var _0x49945c=_0x3c55a4?_0x362486[_0x3d82('0x1e')]:_0x33996d['offset']+_0x33996d[_0x3d82('0x1d')];var _0x50c2bf;if(_0x49945c>=_0x3cc4f6){_0x49945c=_0x3cc4f6;_0x50c2bf=0xc8;}else{_0x50c2bf=0xce;}_0x3f982e[_0x3d82('0x19')](_0x50c2bf);return _0x3f982e['set'](_0x3d82('0x1f'),_0x5e4bcc+'-'+_0x49945c+'/'+_0x3cc4f6)[_0x3d82('0x20')](_0x362486);}return null;};}function patchUpdates(_0x38baf1){return function(_0x542ee6){try{jsonpatch[_0x3d82('0x21')](_0x542ee6,_0x38baf1,!![]);}catch(_0x27ac96){return BPromise[_0x3d82('0x22')](_0x27ac96);}return _0x542ee6[_0x3d82('0x23')]();};}function saveUpdates(_0xe37189,_0x252162){return function(_0xc0712c){if(_0xc0712c){return _0xc0712c[_0x3d82('0x24')](_0xe37189)[_0x3d82('0x25')](function(_0x38ae97){return _0x38ae97;});}return null;};}function removeEntity(_0x34a0e1,_0x3d550d){return function(_0x346fbc){if(_0x346fbc){return _0x346fbc[_0x3d82('0x26')]()[_0x3d82('0x25')](function(){_0x34a0e1[_0x3d82('0x19')](0xcc)[_0x3d82('0x1a')]();});}};}function handleEntityNotFound(_0x21dd6e,_0x28dd2f){return function(_0x4b123b){if(!_0x4b123b){_0x21dd6e[_0x3d82('0x27')](0x194);}return _0x4b123b;};}function handleError(_0x35547d,_0x4b4aa5){_0x4b4aa5=_0x4b4aa5||0x1f4;return function(_0x39eed4){logger[_0x3d82('0x28')](_0x39eed4[_0x3d82('0x29')]);if(_0x39eed4[_0x3d82('0x2a')]){delete _0x39eed4[_0x3d82('0x2a')];}_0x35547d[_0x3d82('0x19')](_0x4b4aa5)[_0x3d82('0x2b')](_0x39eed4);};}exports[_0x3d82('0x2c')]=function(_0x19b66b,_0x30c4d4){var _0x560a5a={},_0x5f2534={},_0x3ca918={'count':0x0,'rows':[]};var _0x5b4d7e=_[_0x3d82('0x2d')](db[_0x3d82('0x2e')][_0x3d82('0x2f')],function(_0x58ea4d){return{'name':_0x58ea4d[_0x3d82('0x30')],'type':_0x58ea4d[_0x3d82('0x31')][_0x3d82('0x32')]};});_0x5f2534[_0x3d82('0x33')]=_[_0x3d82('0x2d')](_0x5b4d7e,_0x3d82('0x2a'));_0x5f2534[_0x3d82('0x34')]=_[_0x3d82('0x35')](_0x19b66b['query']);_0x5f2534[_0x3d82('0x36')]=_[_0x3d82('0x37')](_0x5f2534[_0x3d82('0x33')],_0x5f2534[_0x3d82('0x34')]);_0x560a5a[_0x3d82('0x38')]=_[_0x3d82('0x37')](_0x5f2534[_0x3d82('0x33')],qs[_0x3d82('0x39')](_0x19b66b[_0x3d82('0x34')]['fields']));_0x560a5a[_0x3d82('0x38')]=_0x560a5a[_0x3d82('0x38')][_0x3d82('0x3a')]?_0x560a5a[_0x3d82('0x38')]:_0x5f2534[_0x3d82('0x33')];if(!_0x19b66b['query'][_0x3d82('0x3b')]('nolimit')){_0x560a5a[_0x3d82('0x1d')]=qs[_0x3d82('0x1d')](_0x19b66b['query'][_0x3d82('0x1d')]);_0x560a5a['offset']=qs[_0x3d82('0x1b')](_0x19b66b['query'][_0x3d82('0x1b')]);}_0x560a5a[_0x3d82('0x3c')]=qs[_0x3d82('0x3d')](_0x19b66b['query'][_0x3d82('0x3d')]);_0x560a5a[_0x3d82('0x3e')]=qs[_0x3d82('0x36')](_[_0x3d82('0x3f')](_0x19b66b[_0x3d82('0x34')],_0x5f2534[_0x3d82('0x36')]),_0x5b4d7e);if(_0x19b66b['query'][_0x3d82('0x40')]){_0x560a5a[_0x3d82('0x3e')]=_[_0x3d82('0x41')](_0x560a5a[_0x3d82('0x3e')],{'$or':_[_0x3d82('0x2d')](_0x5b4d7e,function(_0x2c43d8){if(_0x2c43d8[_0x3d82('0x31')]!==_0x3d82('0x42')){var _0x311f05={};_0x311f05[_0x2c43d8[_0x3d82('0x2a')]]={'$like':'%'+_0x19b66b[_0x3d82('0x34')][_0x3d82('0x40')]+'%'};return _0x311f05;}})});}_0x560a5a=_[_0x3d82('0x41')]({},_0x560a5a,_0x19b66b[_0x3d82('0x43')]);var _0x11f668={'where':_0x560a5a[_0x3d82('0x3e')]};return db[_0x3d82('0x2e')][_0x3d82('0x1e')](_0x11f668)[_0x3d82('0x25')](function(_0x13d15f){_0x3ca918[_0x3d82('0x1e')]=_0x13d15f;if(_0x19b66b[_0x3d82('0x34')][_0x3d82('0x44')]){_0x560a5a[_0x3d82('0x45')]=[{'all':!![]}];}return db[_0x3d82('0x2e')][_0x3d82('0x46')](_0x560a5a);})[_0x3d82('0x25')](function(_0x3e24c6){_0x3ca918[_0x3d82('0x47')]=_0x3e24c6;return _0x3ca918;})[_0x3d82('0x25')](respondWithFilteredResult(_0x30c4d4,_0x560a5a))['catch'](handleError(_0x30c4d4,null));};exports[_0x3d82('0x48')]=function(_0x42d0ab,_0x36eafb){var _0x93ae16={'raw':!![],'where':{'id':_0x42d0ab[_0x3d82('0x49')]['id']}},_0x5a1185={};_0x5a1185[_0x3d82('0x33')]=_[_0x3d82('0x35')](db['SquareRecording'][_0x3d82('0x2f')]);_0x5a1185[_0x3d82('0x34')]=_[_0x3d82('0x35')](_0x42d0ab[_0x3d82('0x34')]);_0x5a1185[_0x3d82('0x36')]=_[_0x3d82('0x37')](_0x5a1185[_0x3d82('0x33')],_0x5a1185['query']);_0x93ae16[_0x3d82('0x38')]=_[_0x3d82('0x37')](_0x5a1185['model'],qs['fields'](_0x42d0ab['query']['fields']));_0x93ae16['attributes']=_0x93ae16[_0x3d82('0x38')][_0x3d82('0x3a')]?_0x93ae16[_0x3d82('0x38')]:_0x5a1185['model'];if(_0x42d0ab[_0x3d82('0x34')][_0x3d82('0x44')]){_0x93ae16['include']=[{'all':!![]}];}_0x93ae16=_[_0x3d82('0x41')]({},_0x93ae16,_0x42d0ab[_0x3d82('0x43')]);return db[_0x3d82('0x2e')][_0x3d82('0x4a')](_0x93ae16)[_0x3d82('0x25')](handleEntityNotFound(_0x36eafb,null))[_0x3d82('0x25')](respondWithResult(_0x36eafb,null))['catch'](handleError(_0x36eafb,null));};exports['create']=function(_0x35c9cc,_0x2c0785){return db[_0x3d82('0x2e')]['create'](_0x35c9cc[_0x3d82('0x4b')],{})[_0x3d82('0x25')](respondWithResult(_0x2c0785,0xc9))[_0x3d82('0x4c')](handleError(_0x2c0785,null));};exports['update']=function(_0x59f8f1,_0x329923){if(_0x59f8f1[_0x3d82('0x4b')]['id']){delete _0x59f8f1[_0x3d82('0x4b')]['id'];}return db[_0x3d82('0x2e')][_0x3d82('0x4a')]({'where':{'id':_0x59f8f1[_0x3d82('0x49')]['id']}})[_0x3d82('0x25')](handleEntityNotFound(_0x329923,null))[_0x3d82('0x25')](saveUpdates(_0x59f8f1[_0x3d82('0x4b')],null))[_0x3d82('0x25')](respondWithResult(_0x329923,null))[_0x3d82('0x4c')](handleError(_0x329923,null));};exports[_0x3d82('0x4d')]=function(_0x1b6afa,_0x7dc25,_0x1f8f86){var _0x4c70bf=require('../../components/encryptor');var _0x4c9da6=![];var _0x77878a={};if(_0x1b6afa[_0x3d82('0x34')][_0x3d82('0x31')]&&_0x1b6afa[_0x3d82('0x34')]['type']===_0x3d82('0x4e')){_0x77878a[_0x3d82('0x4e')]=_0x1b6afa[_0x3d82('0x49')]['id'];}else{_0x77878a['id']=_0x1b6afa[_0x3d82('0x49')]['id'];}return db[_0x3d82('0x2e')]['find']({'where':_0x77878a,'attributes':['id',_0x3d82('0x4f'),_0x3d82('0x50')],'raw':!![]})[_0x3d82('0x25')](handleEntityNotFound(_0x7dc25,null))[_0x3d82('0x25')](function(_0x23781f){if(_0x23781f){var _0x426b4f=_0x23781f[_0x3d82('0x4f')];var _0x3df21c=util['format'](_0x3d82('0x51'),_0x426b4f);if(fs[_0x3d82('0x52')](_0x3df21c)){_0x4c9da6=!![];return _0x4c70bf[_0x3d82('0x53')](_0x3df21c,_0x426b4f,config[_0x3d82('0x54')]['recording'])['then'](function(){return _0x23781f;});}return _0x23781f;}})[_0x3d82('0x25')](function(_0x4e6208){if(_0x4e6208){var _0x2ca246=_0x4e6208[_0x3d82('0x4f')];if(!fs[_0x3d82('0x52')](_0x2ca246)){throw new db[(_0x3d82('0x55'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x4e6208[_0x3d82('0x50')]){return _0x7dc25['download'](_0x2ca246,_0x4e6208[_0x3d82('0x50')]+path['extname'](_0x2ca246),function(){if(_0x4c9da6){fs['unlink'](_0x2ca246);}});}else{return _0x7dc25[_0x3d82('0x4d')](_0x2ca246,function(_0x51831a){if(_0x4c9da6){fs[_0x3d82('0x56')](_0x2ca246);}});}}})[_0x3d82('0x4c')](function(_0x37598d){if(_0x37598d['message']==='SquareRecording\x20not\x20found'){_0x7dc25['status'](0x194)[_0x3d82('0x2b')]('Not\x20found');}else{return handleError(_0x7dc25,null);}});};exports[_0x3d82('0x26')]=function(_0x4d2bb1,_0x3ae272){return db[_0x3d82('0x2e')][_0x3d82('0x4a')]({'where':{'id':_0x4d2bb1[_0x3d82('0x49')]['id']}})['then'](function(_0x28b957){if(_[_0x3d82('0x57')](_0x28b957)){throw new ReferenceError('Entity\x20not\x20found');}return _0x28b957;})[_0x3d82('0x25')](function(_0x25fbbc){var _0x11bd53=_0x25fbbc['savePath'];logger[_0x3d82('0x58')](_0x3d82('0x59'),_0x11bd53);if(!_[_0x3d82('0x57')](_0x25fbbc[_0x3d82('0x4f')])&&fs[_0x3d82('0x52')](_0x11bd53)){logger[_0x3d82('0x58')]('File:\x20\x22'+_0x11bd53+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3d82('0x5a')](_0x11bd53);}_0x11bd53=_0x11bd53+_0x3d82('0x5b');if(!_[_0x3d82('0x57')](_0x25fbbc['savePath'])&&fs[_0x3d82('0x52')](_0x11bd53)){logger[_0x3d82('0x58')]('File:\x20\x22'+_0x11bd53+_0x3d82('0x5c'));fs[_0x3d82('0x5a')](_0x11bd53);}return _0x25fbbc;})[_0x3d82('0x25')](function(_0x28e725){if(!_0x28e725)throw new InternalError();return _0x28e725[_0x3d82('0x26')]();})[_0x3d82('0x25')](function(){_0x3ae272[_0x3d82('0x19')](0xcc)[_0x3d82('0x1a')]();})['catch'](handleError(_0x3ae272,null));}; \ No newline at end of file +var _0x1663=['Not\x20found','info','isNil','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','status','end','json','offset','limit','undefined','count','apply','reject','save','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','download','../../components/encryptor','type','uniqueid','filename','savePath','format','%s.cypher','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1663,0x69));var _0x3166=function(_0x52aaf6,_0x25ff27){_0x52aaf6=_0x52aaf6-0x0;var _0x2d4f7=_0x1663[_0x52aaf6];return _0x2d4f7;};'use strict';var emlformat=require(_0x3166('0x0'));var rimraf=require(_0x3166('0x1'));var zipdir=require(_0x3166('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3166('0x3'));var moment=require(_0x3166('0x4'));var BPromise=require(_0x3166('0x5'));var Mustache=require(_0x3166('0x6'));var util=require(_0x3166('0x7'));var path=require(_0x3166('0x8'));var sox=require(_0x3166('0x9'));var csv=require(_0x3166('0xa'));var ejs=require(_0x3166('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3166('0xc'));var squel=require(_0x3166('0xd'));var crypto=require(_0x3166('0xe'));var jsforce=require(_0x3166('0xf'));var deskjs=require(_0x3166('0x10'));var toCsv=require(_0x3166('0xa'));var querystring=require(_0x3166('0x11'));var Papa=require(_0x3166('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3166('0x13'));var as=require(_0x3166('0x14'));var hardwareService=require(_0x3166('0x15'));var logger=require(_0x3166('0x16'))(_0x3166('0x17'));var utils=require(_0x3166('0x18'));var config=require(_0x3166('0x19'));var licenseUtil=require(_0x3166('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2958da,_0xf5d6a8){_0xf5d6a8=_0xf5d6a8||0xcc;return function(_0x3ebfff){if(_0x3ebfff){return _0x2958da['sendStatus'](_0xf5d6a8);}return _0x2958da[_0x3166('0x1b')](_0xf5d6a8)[_0x3166('0x1c')]();};}function respondWithResult(_0x1a855d,_0x1a9c50){_0x1a9c50=_0x1a9c50||0xc8;return function(_0x52907f){if(_0x52907f){return _0x1a855d['status'](_0x1a9c50)[_0x3166('0x1d')](_0x52907f);}};}function respondWithFilteredResult(_0x384c46,_0x61bd30){return function(_0x4f35de){if(_0x4f35de){var _0xcb3e16=typeof _0x61bd30[_0x3166('0x1e')]==='undefined'&&typeof _0x61bd30[_0x3166('0x1f')]===_0x3166('0x20');var _0xf7a36c=_0x4f35de[_0x3166('0x21')];var _0x474d4b=_0xcb3e16?0x0:_0x61bd30[_0x3166('0x1e')];var _0x243957=_0xcb3e16?_0x4f35de[_0x3166('0x21')]:_0x61bd30[_0x3166('0x1e')]+_0x61bd30[_0x3166('0x1f')];var _0x4aa509;if(_0x243957>=_0xf7a36c){_0x243957=_0xf7a36c;_0x4aa509=0xc8;}else{_0x4aa509=0xce;}_0x384c46[_0x3166('0x1b')](_0x4aa509);return _0x384c46['set']('Content-Range',_0x474d4b+'-'+_0x243957+'/'+_0xf7a36c)[_0x3166('0x1d')](_0x4f35de);}return null;};}function patchUpdates(_0xdc2709){return function(_0x5dc167){try{jsonpatch[_0x3166('0x22')](_0x5dc167,_0xdc2709,!![]);}catch(_0x3ea826){return BPromise[_0x3166('0x23')](_0x3ea826);}return _0x5dc167[_0x3166('0x24')]();};}function saveUpdates(_0x328319,_0x4ddb86){return function(_0x33de0){if(_0x33de0){return _0x33de0['update'](_0x328319)[_0x3166('0x25')](function(_0x24b530){return _0x24b530;});}return null;};}function removeEntity(_0x39d83a,_0x47ec82){return function(_0x1e391c){if(_0x1e391c){return _0x1e391c['destroy']()['then'](function(){_0x39d83a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c6d0d,_0x392f5a){return function(_0x74c662){if(!_0x74c662){_0x4c6d0d['sendStatus'](0x194);}return _0x74c662;};}function handleError(_0xaf306d,_0x4d90f7){_0x4d90f7=_0x4d90f7||0x1f4;return function(_0x28f34a){logger[_0x3166('0x26')](_0x28f34a[_0x3166('0x27')]);if(_0x28f34a[_0x3166('0x28')]){delete _0x28f34a[_0x3166('0x28')];}_0xaf306d[_0x3166('0x1b')](_0x4d90f7)[_0x3166('0x29')](_0x28f34a);};}exports[_0x3166('0x2a')]=function(_0x5c6105,_0x1984ec){var _0x2ea56f={},_0x55b048={},_0xb6ee1f={'count':0x0,'rows':[]};var _0x13d8a0=_[_0x3166('0x2b')](db[_0x3166('0x2c')][_0x3166('0x2d')],function(_0x487bc5){return{'name':_0x487bc5[_0x3166('0x2e')],'type':_0x487bc5['type']['key']};});_0x55b048[_0x3166('0x2f')]=_['map'](_0x13d8a0,_0x3166('0x28'));_0x55b048['query']=_[_0x3166('0x30')](_0x5c6105[_0x3166('0x31')]);_0x55b048[_0x3166('0x32')]=_[_0x3166('0x33')](_0x55b048[_0x3166('0x2f')],_0x55b048[_0x3166('0x31')]);_0x2ea56f[_0x3166('0x34')]=_[_0x3166('0x33')](_0x55b048[_0x3166('0x2f')],qs['fields'](_0x5c6105[_0x3166('0x31')][_0x3166('0x35')]));_0x2ea56f[_0x3166('0x34')]=_0x2ea56f[_0x3166('0x34')][_0x3166('0x36')]?_0x2ea56f[_0x3166('0x34')]:_0x55b048[_0x3166('0x2f')];if(!_0x5c6105['query'][_0x3166('0x37')](_0x3166('0x38'))){_0x2ea56f[_0x3166('0x1f')]=qs[_0x3166('0x1f')](_0x5c6105[_0x3166('0x31')][_0x3166('0x1f')]);_0x2ea56f[_0x3166('0x1e')]=qs[_0x3166('0x1e')](_0x5c6105[_0x3166('0x31')]['offset']);}_0x2ea56f[_0x3166('0x39')]=qs['sort'](_0x5c6105['query']['sort']);_0x2ea56f['where']=qs[_0x3166('0x32')](_[_0x3166('0x3a')](_0x5c6105[_0x3166('0x31')],_0x55b048['filters']),_0x13d8a0);if(_0x5c6105[_0x3166('0x31')][_0x3166('0x3b')]){_0x2ea56f[_0x3166('0x3c')]=_[_0x3166('0x3d')](_0x2ea56f[_0x3166('0x3c')],{'$or':_[_0x3166('0x2b')](_0x13d8a0,function(_0x5603ae){if(_0x5603ae['type']!==_0x3166('0x3e')){var _0x3e000e={};_0x3e000e[_0x5603ae[_0x3166('0x28')]]={'$like':'%'+_0x5c6105[_0x3166('0x31')]['filter']+'%'};return _0x3e000e;}})});}_0x2ea56f=_[_0x3166('0x3d')]({},_0x2ea56f,_0x5c6105[_0x3166('0x3f')]);var _0x19928a={'where':_0x2ea56f[_0x3166('0x3c')]};return db[_0x3166('0x2c')][_0x3166('0x21')](_0x19928a)[_0x3166('0x25')](function(_0xf0ff8d){_0xb6ee1f[_0x3166('0x21')]=_0xf0ff8d;if(_0x5c6105[_0x3166('0x31')][_0x3166('0x40')]){_0x2ea56f['include']=[{'all':!![]}];}return db[_0x3166('0x2c')][_0x3166('0x41')](_0x2ea56f);})[_0x3166('0x25')](function(_0x1eb975){_0xb6ee1f[_0x3166('0x42')]=_0x1eb975;return _0xb6ee1f;})[_0x3166('0x25')](respondWithFilteredResult(_0x1984ec,_0x2ea56f))[_0x3166('0x43')](handleError(_0x1984ec,null));};exports['show']=function(_0x2f0ecd,_0x1033fd){var _0x4e635f={'raw':!![],'where':{'id':_0x2f0ecd[_0x3166('0x44')]['id']}},_0xc166={};_0xc166[_0x3166('0x2f')]=_[_0x3166('0x30')](db[_0x3166('0x2c')][_0x3166('0x2d')]);_0xc166[_0x3166('0x31')]=_['keys'](_0x2f0ecd[_0x3166('0x31')]);_0xc166[_0x3166('0x32')]=_['intersection'](_0xc166[_0x3166('0x2f')],_0xc166[_0x3166('0x31')]);_0x4e635f[_0x3166('0x34')]=_['intersection'](_0xc166[_0x3166('0x2f')],qs[_0x3166('0x35')](_0x2f0ecd[_0x3166('0x31')][_0x3166('0x35')]));_0x4e635f['attributes']=_0x4e635f[_0x3166('0x34')]['length']?_0x4e635f[_0x3166('0x34')]:_0xc166[_0x3166('0x2f')];if(_0x2f0ecd[_0x3166('0x31')]['includeAll']){_0x4e635f[_0x3166('0x45')]=[{'all':!![]}];}_0x4e635f=_[_0x3166('0x3d')]({},_0x4e635f,_0x2f0ecd[_0x3166('0x3f')]);return db['SquareRecording'][_0x3166('0x46')](_0x4e635f)['then'](handleEntityNotFound(_0x1033fd,null))[_0x3166('0x25')](respondWithResult(_0x1033fd,null))[_0x3166('0x43')](handleError(_0x1033fd,null));};exports[_0x3166('0x47')]=function(_0x333b37,_0x2ebd75){return db[_0x3166('0x2c')][_0x3166('0x47')](_0x333b37[_0x3166('0x48')],{})[_0x3166('0x25')](respondWithResult(_0x2ebd75,0xc9))[_0x3166('0x43')](handleError(_0x2ebd75,null));};exports['update']=function(_0xb2215c,_0x5b0df3){if(_0xb2215c[_0x3166('0x48')]['id']){delete _0xb2215c[_0x3166('0x48')]['id'];}return db[_0x3166('0x2c')][_0x3166('0x46')]({'where':{'id':_0xb2215c[_0x3166('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b0df3,null))[_0x3166('0x25')](saveUpdates(_0xb2215c['body'],null))[_0x3166('0x25')](respondWithResult(_0x5b0df3,null))['catch'](handleError(_0x5b0df3,null));};exports[_0x3166('0x49')]=function(_0x28b093,_0x447ba8,_0x4f4ed4){var _0xfd8973=require(_0x3166('0x4a'));var _0x5d6959=![];var _0x181fd7={};if(_0x28b093[_0x3166('0x31')]['type']&&_0x28b093[_0x3166('0x31')][_0x3166('0x4b')]==='uniqueid'){_0x181fd7[_0x3166('0x4c')]=_0x28b093[_0x3166('0x44')]['id'];}else{_0x181fd7['id']=_0x28b093[_0x3166('0x44')]['id'];}return db['SquareRecording'][_0x3166('0x46')]({'where':_0x181fd7,'attributes':['id','savePath',_0x3166('0x4d')],'raw':!![]})[_0x3166('0x25')](handleEntityNotFound(_0x447ba8,null))['then'](function(_0x3816df){if(_0x3816df){var _0x455df0=_0x3816df[_0x3166('0x4e')];var _0x52b81d=util[_0x3166('0x4f')](_0x3166('0x50'),_0x455df0);if(fs['existsSync'](_0x52b81d)){_0x5d6959=!![];return _0xfd8973[_0x3166('0x51')](_0x52b81d,_0x455df0,config[_0x3166('0x52')][_0x3166('0x53')])[_0x3166('0x25')](function(){return _0x3816df;});}return _0x3816df;}})[_0x3166('0x25')](function(_0x2d1370){if(_0x2d1370){var _0x119c85=_0x2d1370['savePath'];if(!fs['existsSync'](_0x119c85)){throw new db[(_0x3166('0x54'))][(_0x3166('0x55'))]('SquareRecording\x20not\x20found');}if(_0x2d1370['filename']){return _0x447ba8[_0x3166('0x49')](_0x119c85,_0x2d1370['filename']+path[_0x3166('0x56')](_0x119c85),function(){if(_0x5d6959){fs[_0x3166('0x57')](_0x119c85);}});}else{return _0x447ba8[_0x3166('0x49')](_0x119c85,function(_0x48f03d){if(_0x5d6959){fs[_0x3166('0x57')](_0x119c85);}});}}})[_0x3166('0x43')](function(_0x2b0a7f){if(_0x2b0a7f[_0x3166('0x58')]==='SquareRecording\x20not\x20found'){_0x447ba8[_0x3166('0x1b')](0x194)[_0x3166('0x29')](_0x3166('0x59'));}else{return handleError(_0x447ba8,null);}});};exports['destroy']=function(_0x4a652a,_0x3543e0){return db[_0x3166('0x2c')][_0x3166('0x46')]({'where':{'id':_0x4a652a[_0x3166('0x44')]['id']}})[_0x3166('0x25')](function(_0x9dff2f){if(_['isNil'](_0x9dff2f)){throw new ReferenceError('Entity\x20not\x20found');}return _0x9dff2f;})['then'](function(_0x5380b8){var _0x2e2335=_0x5380b8[_0x3166('0x4e')];logger[_0x3166('0x5a')]('cancellazione\x20fisica\x20documento\x20%s',_0x2e2335);if(!_[_0x3166('0x5b')](_0x5380b8[_0x3166('0x4e')])&&fs[_0x3166('0x5c')](_0x2e2335)){logger[_0x3166('0x5a')]('File:\x20\x22'+_0x2e2335+_0x3166('0x5d'));fs[_0x3166('0x5e')](_0x2e2335);}_0x2e2335=_0x2e2335+_0x3166('0x5f');if(!_[_0x3166('0x5b')](_0x5380b8[_0x3166('0x4e')])&&fs[_0x3166('0x5c')](_0x2e2335)){logger[_0x3166('0x5a')]('File:\x20\x22'+_0x2e2335+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3166('0x5e')](_0x2e2335);}return _0x5380b8;})[_0x3166('0x25')](function(_0x14f580){if(!_0x14f580)throw new InternalError();return _0x14f580[_0x3166('0x60')]();})[_0x3166('0x25')](function(){_0x3543e0['status'](0xcc)['end']();})[_0x3166('0x43')](handleError(_0x3543e0,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c638474..ed78135 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 _0xb491=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareRecording.attributes','exports','define','square_recordings'];(function(_0x596cdd,_0x939916){var _0x5b65ab=function(_0x465562){while(--_0x465562){_0x596cdd['push'](_0x596cdd['shift']());}};_0x5b65ab(++_0x939916);}(_0xb491,0x18c));var _0x1b49=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xb491[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var logger=require(_0x1b49('0x2'))(_0x1b49('0x3'));var moment=require(_0x1b49('0x4'));var BPromise=require(_0x1b49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b49('0x6'));var rimraf=require(_0x1b49('0x7'));var config=require('../../config/environment');var attributes=require(_0x1b49('0x8'));module[_0x1b49('0x9')]=function(_0x22b7c1,_0x5d9945){return _0x22b7c1[_0x1b49('0xa')]('SquareRecording',attributes,{'tableName':_0x1b49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7753=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareRecording.attributes','exports','define'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7753,0xfd));var _0x3775=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x7753[_0x134192];return _0x3cd080;};'use strict';var _=require(_0x3775('0x0'));var util=require(_0x3775('0x1'));var logger=require(_0x3775('0x2'))(_0x3775('0x3'));var moment=require(_0x3775('0x4'));var BPromise=require('bluebird');var rp=require(_0x3775('0x5'));var fs=require('fs');var path=require(_0x3775('0x6'));var rimraf=require(_0x3775('0x7'));var config=require('../../config/environment');var attributes=require(_0x3775('0x8'));module[_0x3775('0x9')]=function(_0x4c3b32,_0x380481){return _0x4c3b32[_0x3775('0xa')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 8e24350..e4b60b8 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 _0x7ff6=['options','raw','debug','stringify','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording'];(function(_0x4489cd,_0x83d7ee){var _0x3d202c=function(_0x134751){while(--_0x134751){_0x4489cd['push'](_0x4489cd['shift']());}};_0x3d202c(++_0x83d7ee);}(_0x7ff6,0x1e4));var _0x67ff=function(_0x4bb887,_0x4f43cb){_0x4bb887=_0x4bb887-0x0;var _0x43fae5=_0x7ff6[_0x4bb887];return _0x43fae5;};'use strict';var _=require('lodash');var util=require(_0x67ff('0x0'));var moment=require(_0x67ff('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67ff('0x2'))['db'];var utils=require(_0x67ff('0x3'));var logger=require('../../config/logger')(_0x67ff('0x4'));var config=require(_0x67ff('0x5'));var jayson=require(_0x67ff('0x6'));var client=jayson[_0x67ff('0x7')][_0x67ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43bb7e,_0x321c5f,_0x42c323){return new BPromise(function(_0x31139a,_0x4c3b3b){return client[_0x67ff('0x9')](_0x43bb7e,_0x42c323)[_0x67ff('0xa')](function(_0x1b622d){logger[_0x67ff('0xb')]('SquareRecording,\x20%s,\x20%s',_0x321c5f,_0x67ff('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x321c5f,_0x67ff('0xc'),JSON['stringify'](_0x1b622d));if(_0x1b622d[_0x67ff('0xd')]){if(_0x1b622d['error'][_0x67ff('0xe')]===0x1f4){logger[_0x67ff('0xd')](_0x67ff('0xf'),_0x321c5f,_0x1b622d['error'][_0x67ff('0x10')]);return _0x4c3b3b(_0x1b622d[_0x67ff('0xd')][_0x67ff('0x10')]);}logger[_0x67ff('0xd')](_0x67ff('0xf'),_0x321c5f,_0x1b622d[_0x67ff('0xd')][_0x67ff('0x10')]);return _0x31139a(_0x1b622d[_0x67ff('0xd')][_0x67ff('0x10')]);}else{logger[_0x67ff('0xb')](_0x67ff('0xf'),_0x321c5f,'request\x20sent');_0x31139a(_0x1b622d[_0x67ff('0x11')][_0x67ff('0x10')]);}})['catch'](function(_0x165257){logger[_0x67ff('0xd')](_0x67ff('0xf'),_0x321c5f,_0x165257);_0x4c3b3b(_0x165257);});});}exports[_0x67ff('0x12')]=function(_0x1fc464){var _0x109410=this;return new Promise(function(_0x7ca1e0,_0x321761){return db[_0x67ff('0x13')]['create'](_0x1fc464['body'],{'raw':_0x1fc464[_0x67ff('0x14')]?_0x1fc464[_0x67ff('0x14')][_0x67ff('0x15')]===undefined?!![]:![]:!![]})[_0x67ff('0xa')](function(_0x5dd3e5){logger['info']('CreateSquareRecording',_0x1fc464);logger[_0x67ff('0x16')]('CreateSquareRecording',_0x1fc464,JSON[_0x67ff('0x17')](_0x5dd3e5));_0x7ca1e0(_0x5dd3e5);})['catch'](function(_0x572316){logger['error'](_0x67ff('0x12'),_0x572316['message'],_0x1fc464);_0x321761(_0x109410['error'](0x1f4,_0x572316['message']));});});}; \ No newline at end of file +var _0x03fc=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s'];(function(_0x36a6df,_0x27a6b1){var _0x1b394d=function(_0x17c995){while(--_0x17c995){_0x36a6df['push'](_0x36a6df['shift']());}};_0x1b394d(++_0x27a6b1);}(_0x03fc,0x1e0));var _0xc03f=function(_0x5e81c1,_0x2fd6f1){_0x5e81c1=_0x5e81c1-0x0;var _0x4a2940=_0x03fc[_0x5e81c1];return _0x4a2940;};'use strict';var _=require(_0xc03f('0x0'));var util=require('util');var moment=require(_0xc03f('0x1'));var BPromise=require(_0xc03f('0x2'));var rs=require(_0xc03f('0x3'));var fs=require('fs');var Redis=require(_0xc03f('0x4'));var db=require(_0xc03f('0x5'))['db'];var utils=require(_0xc03f('0x6'));var logger=require(_0xc03f('0x7'))(_0xc03f('0x8'));var config=require(_0xc03f('0x9'));var jayson=require(_0xc03f('0xa'));var client=jayson[_0xc03f('0xb')][_0xc03f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d98bd,_0x1f44c8,_0x4e6c41){return new BPromise(function(_0x158cc9,_0x1399dc){return client[_0xc03f('0xd')](_0x1d98bd,_0x4e6c41)[_0xc03f('0xe')](function(_0x117593){logger['info'](_0xc03f('0xf'),_0x1f44c8,'request\x20sent');logger[_0xc03f('0x10')](_0xc03f('0x11'),_0x1f44c8,'request\x20sent',JSON['stringify'](_0x117593));if(_0x117593[_0xc03f('0x12')]){if(_0x117593[_0xc03f('0x12')]['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x1f44c8,_0x117593[_0xc03f('0x12')][_0xc03f('0x13')]);return _0x1399dc(_0x117593[_0xc03f('0x12')][_0xc03f('0x13')]);}logger[_0xc03f('0x12')]('SquareRecording,\x20%s,\x20%s',_0x1f44c8,_0x117593[_0xc03f('0x12')]['message']);return _0x158cc9(_0x117593[_0xc03f('0x12')][_0xc03f('0x13')]);}else{logger[_0xc03f('0x14')](_0xc03f('0xf'),_0x1f44c8,_0xc03f('0x15'));_0x158cc9(_0x117593[_0xc03f('0x16')][_0xc03f('0x13')]);}})[_0xc03f('0x17')](function(_0x2f14db){logger[_0xc03f('0x12')](_0xc03f('0xf'),_0x1f44c8,_0x2f14db);_0x1399dc(_0x2f14db);});});}exports[_0xc03f('0x18')]=function(_0x3c4913){var _0x3f8cd9=this;return new Promise(function(_0x20c581,_0x53220c){return db[_0xc03f('0x19')][_0xc03f('0x1a')](_0x3c4913[_0xc03f('0x1b')],{'raw':_0x3c4913['options']?_0x3c4913[_0xc03f('0x1c')][_0xc03f('0x1d')]===undefined?!![]:![]:!![]})[_0xc03f('0xe')](function(_0xb7d4ab){logger[_0xc03f('0x14')](_0xc03f('0x18'),_0x3c4913);logger[_0xc03f('0x10')](_0xc03f('0x18'),_0x3c4913,JSON[_0xc03f('0x1e')](_0xb7d4ab));_0x20c581(_0xb7d4ab);})[_0xc03f('0x17')](function(_0x34b1da){logger['error'](_0xc03f('0x18'),_0x34b1da[_0xc03f('0x13')],_0x3c4913);_0x53220c(_0x3f8cd9[_0xc03f('0x12')](0x1f4,_0x34b1da[_0xc03f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 830c224..73c7c31 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1efa10,_0xd95c93){var _0x19550d=function(_0x962b57){while(--_0x962b57){_0x1efa10['push'](_0x1efa10['shift']());}};_0x19550d(++_0xd95c93);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x4fc2c3,_0x1cd682){var _0x33840e=function(_0x2bf12c){while(--_0x2bf12c){_0x4fc2c3['push'](_0x4fc2c3['shift']());}};_0x33840e(++_0x1cd682);}(_0xe706,0xa3));var _0x6e70=function(_0x56ea12,_0x304238){_0x56ea12=_0x56ea12-0x0;var _0x4b9883=_0xe706[_0x56ea12];return _0x4b9883;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index c07ff46..9da0c06 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 _0x992a=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x2593f7,_0x5e0eb7){var _0x3a3fe5=function(_0x318878){while(--_0x318878){_0x2593f7['push'](_0x2593f7['shift']());}};_0x3a3fe5(++_0x5e0eb7);}(_0x992a,0x1e8));var _0xa992=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0x992a[_0xbbfe59];return _0x28a2a4;};'use strict';var Sequelize=require(_0xa992('0x0'));module[_0xa992('0x1')]={'network':{'type':Sequelize[_0xa992('0x2')]},'network_script':{'type':Sequelize[_0xa992('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa992('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa992('0x2')]},'uniqueid':{'type':Sequelize[_0xa992('0x2')]},'version':{'type':Sequelize[_0xa992('0x2')]},'callerid':{'type':Sequelize[_0xa992('0x2')]},'calleridname':{'type':Sequelize[_0xa992('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xa992('0x2')]},'callingtns':{'type':Sequelize[_0xa992('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xa992('0x2')]},'context':{'type':Sequelize[_0xa992('0x2')]},'extension':{'type':Sequelize[_0xa992('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa992('0x2')]},'threadid':{'type':Sequelize[_0xa992('0x2')]},'project_name':{'type':Sequelize[_0xa992('0x2')]},'joinAt':{'type':Sequelize[_0xa992('0x3')]},'leaveAt':{'type':Sequelize[_0xa992('0x3')]},'bot':{'type':Sequelize[_0xa992('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7e2a=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0xc5f00c,_0x2f5db0){var _0x292ef9=function(_0xfcc4f8){while(--_0xfcc4f8){_0xc5f00c['push'](_0xc5f00c['shift']());}};_0x292ef9(++_0x2f5db0);}(_0x7e2a,0x1bf));var _0xa7e2=function(_0x4642ab,_0x289453){_0x4642ab=_0x4642ab-0x0;var _0x28c63b=_0x7e2a[_0x4642ab];return _0x28c63b;};'use strict';var Sequelize=require(_0xa7e2('0x0'));module[_0xa7e2('0x1')]={'network':{'type':Sequelize[_0xa7e2('0x2')]},'network_script':{'type':Sequelize[_0xa7e2('0x2')]},'request':{'type':Sequelize[_0xa7e2('0x2')]},'channel':{'type':Sequelize[_0xa7e2('0x2')]},'language':{'type':Sequelize[_0xa7e2('0x2')]},'type':{'type':Sequelize[_0xa7e2('0x2')]},'uniqueid':{'type':Sequelize[_0xa7e2('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa7e2('0x2')]},'callington':{'type':Sequelize[_0xa7e2('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xa7e2('0x2')]},'rdnis':{'type':Sequelize[_0xa7e2('0x2')]},'context':{'type':Sequelize[_0xa7e2('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa7e2('0x2')]},'enhanced':{'type':Sequelize[_0xa7e2('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xa7e2('0x2')]},'project_name':{'type':Sequelize[_0xa7e2('0x2')]},'joinAt':{'type':Sequelize[_0xa7e2('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa7e2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 0f9832c..30079c6 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 _0x6ef1=['update','find','params','describe','eml-format','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','show','create','body'];(function(_0x576150,_0x3e72c4){var _0x2b43d4=function(_0x86311d){while(--_0x86311d){_0x576150['push'](_0x576150['shift']());}};_0x2b43d4(++_0x3e72c4);}(_0x6ef1,0x92));var _0x16ef=function(_0x2ab310,_0x396a74){_0x2ab310=_0x2ab310-0x0;var _0x11cc76=_0x6ef1[_0x2ab310];return _0x11cc76;};'use strict';var emlformat=require(_0x16ef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16ef('0x1'));var moment=require('moment');var BPromise=require(_0x16ef('0x2'));var Mustache=require('mustache');var util=require(_0x16ef('0x3'));var path=require('path');var sox=require(_0x16ef('0x4'));var csv=require('to-csv');var ejs=require(_0x16ef('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16ef('0x6'));var squel=require(_0x16ef('0x7'));var crypto=require(_0x16ef('0x8'));var jsforce=require(_0x16ef('0x9'));var deskjs=require(_0x16ef('0xa'));var toCsv=require(_0x16ef('0xb'));var querystring=require(_0x16ef('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x16ef('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16ef('0xe'));var logger=require(_0x16ef('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x16ef('0x10'));var licenseUtil=require(_0x16ef('0x11'));var db=require(_0x16ef('0x12'))['db'];function respondWithStatusCode(_0x1ad770,_0xb7df86){_0xb7df86=_0xb7df86||0xcc;return function(_0x559dfe){if(_0x559dfe){return _0x1ad770[_0x16ef('0x13')](_0xb7df86);}return _0x1ad770[_0x16ef('0x14')](_0xb7df86)['end']();};}function respondWithResult(_0x30e020,_0x39c6bf){_0x39c6bf=_0x39c6bf||0xc8;return function(_0x32d551){if(_0x32d551){return _0x30e020[_0x16ef('0x14')](_0x39c6bf)[_0x16ef('0x15')](_0x32d551);}};}function respondWithFilteredResult(_0x996faf,_0x42bdf4){return function(_0x3ec6c3){if(_0x3ec6c3){var _0x3138a8=typeof _0x42bdf4['offset']==='undefined'&&typeof _0x42bdf4[_0x16ef('0x16')]===_0x16ef('0x17');var _0x3cf9b1=_0x3ec6c3[_0x16ef('0x18')];var _0x3a56cc=_0x3138a8?0x0:_0x42bdf4[_0x16ef('0x19')];var _0x5f5274=_0x3138a8?_0x3ec6c3['count']:_0x42bdf4[_0x16ef('0x19')]+_0x42bdf4[_0x16ef('0x16')];var _0x3e4ac9;if(_0x5f5274>=_0x3cf9b1){_0x5f5274=_0x3cf9b1;_0x3e4ac9=0xc8;}else{_0x3e4ac9=0xce;}_0x996faf[_0x16ef('0x14')](_0x3e4ac9);return _0x996faf[_0x16ef('0x1a')](_0x16ef('0x1b'),_0x3a56cc+'-'+_0x5f5274+'/'+_0x3cf9b1)[_0x16ef('0x15')](_0x3ec6c3);}return null;};}function patchUpdates(_0x56af51){return function(_0x2a26e9){try{jsonpatch[_0x16ef('0x1c')](_0x2a26e9,_0x56af51,!![]);}catch(_0x21433e){return BPromise[_0x16ef('0x1d')](_0x21433e);}return _0x2a26e9[_0x16ef('0x1e')]();};}function saveUpdates(_0x4b4a83,_0x54740d){return function(_0x25a209){if(_0x25a209){return _0x25a209['update'](_0x4b4a83)[_0x16ef('0x1f')](function(_0x3aa4bd){return _0x3aa4bd;});}return null;};}function removeEntity(_0x342c92,_0x4292e4){return function(_0x3397a2){if(_0x3397a2){return _0x3397a2[_0x16ef('0x20')]()[_0x16ef('0x1f')](function(){_0x342c92[_0x16ef('0x14')](0xcc)[_0x16ef('0x21')]();});}};}function handleEntityNotFound(_0x330cf2,_0x5ce507){return function(_0x11eeb9){if(!_0x11eeb9){_0x330cf2[_0x16ef('0x13')](0x194);}return _0x11eeb9;};}function handleError(_0x29c5b9,_0x207996){_0x207996=_0x207996||0x1f4;return function(_0x7487bc){logger[_0x16ef('0x22')](_0x7487bc['stack']);if(_0x7487bc['name']){delete _0x7487bc[_0x16ef('0x23')];}_0x29c5b9[_0x16ef('0x14')](_0x207996)['send'](_0x7487bc);};}exports[_0x16ef('0x24')]=function(_0x37712e,_0xc98291){var _0x3e605e={},_0x27b35f={},_0x337852={'count':0x0,'rows':[]};var _0x52d8cd=_[_0x16ef('0x25')](db['SquareReport'][_0x16ef('0x26')],function(_0x51845f){return{'name':_0x51845f[_0x16ef('0x27')],'type':_0x51845f[_0x16ef('0x28')][_0x16ef('0x29')]};});_0x27b35f[_0x16ef('0x2a')]=_['map'](_0x52d8cd,_0x16ef('0x23'));_0x27b35f[_0x16ef('0x2b')]=_[_0x16ef('0x2c')](_0x37712e['query']);_0x27b35f[_0x16ef('0x2d')]=_[_0x16ef('0x2e')](_0x27b35f[_0x16ef('0x2a')],_0x27b35f['query']);_0x3e605e[_0x16ef('0x2f')]=_[_0x16ef('0x2e')](_0x27b35f[_0x16ef('0x2a')],qs[_0x16ef('0x30')](_0x37712e[_0x16ef('0x2b')][_0x16ef('0x30')]));_0x3e605e[_0x16ef('0x2f')]=_0x3e605e['attributes'][_0x16ef('0x31')]?_0x3e605e[_0x16ef('0x2f')]:_0x27b35f[_0x16ef('0x2a')];if(!_0x37712e[_0x16ef('0x2b')]['hasOwnProperty'](_0x16ef('0x32'))){_0x3e605e[_0x16ef('0x16')]=qs[_0x16ef('0x16')](_0x37712e['query'][_0x16ef('0x16')]);_0x3e605e[_0x16ef('0x19')]=qs[_0x16ef('0x19')](_0x37712e['query'][_0x16ef('0x19')]);}_0x3e605e[_0x16ef('0x33')]=qs[_0x16ef('0x34')](_0x37712e[_0x16ef('0x2b')][_0x16ef('0x34')]);_0x3e605e['where']=qs[_0x16ef('0x2d')](_['pick'](_0x37712e[_0x16ef('0x2b')],_0x27b35f['filters']),_0x52d8cd);if(_0x37712e[_0x16ef('0x2b')][_0x16ef('0x35')]){_0x3e605e['where']=_[_0x16ef('0x36')](_0x3e605e[_0x16ef('0x37')],{'$or':_[_0x16ef('0x25')](_0x52d8cd,function(_0x2da805){if(_0x2da805[_0x16ef('0x28')]!==_0x16ef('0x38')){var _0x3af791={};_0x3af791[_0x2da805[_0x16ef('0x23')]]={'$like':'%'+_0x37712e[_0x16ef('0x2b')][_0x16ef('0x35')]+'%'};return _0x3af791;}})});}_0x3e605e=_[_0x16ef('0x36')]({},_0x3e605e,_0x37712e[_0x16ef('0x39')]);var _0x1b4e8f={'where':_0x3e605e[_0x16ef('0x37')]};return db[_0x16ef('0x3a')][_0x16ef('0x18')](_0x1b4e8f)[_0x16ef('0x1f')](function(_0x4aeffa){_0x337852['count']=_0x4aeffa;if(_0x37712e[_0x16ef('0x2b')][_0x16ef('0x3b')]){_0x3e605e[_0x16ef('0x3c')]=[{'all':!![]}];}return db[_0x16ef('0x3a')][_0x16ef('0x3d')](_0x3e605e);})[_0x16ef('0x1f')](function(_0xaf4fd9){_0x337852[_0x16ef('0x3e')]=_0xaf4fd9;return _0x337852;})['then'](respondWithFilteredResult(_0xc98291,_0x3e605e))[_0x16ef('0x3f')](handleError(_0xc98291,null));};exports[_0x16ef('0x40')]=function(_0x2c1f01,_0x3d7795){var _0x23cf55={'raw':!![],'where':{'id':_0x2c1f01['params']['id']}},_0x4fd025={};_0x4fd025['model']=_['keys'](db[_0x16ef('0x3a')]['rawAttributes']);_0x4fd025[_0x16ef('0x2b')]=_[_0x16ef('0x2c')](_0x2c1f01[_0x16ef('0x2b')]);_0x4fd025[_0x16ef('0x2d')]=_[_0x16ef('0x2e')](_0x4fd025['model'],_0x4fd025[_0x16ef('0x2b')]);_0x23cf55['attributes']=_[_0x16ef('0x2e')](_0x4fd025['model'],qs['fields'](_0x2c1f01[_0x16ef('0x2b')]['fields']));_0x23cf55['attributes']=_0x23cf55[_0x16ef('0x2f')][_0x16ef('0x31')]?_0x23cf55[_0x16ef('0x2f')]:_0x4fd025[_0x16ef('0x2a')];if(_0x2c1f01[_0x16ef('0x2b')][_0x16ef('0x3b')]){_0x23cf55[_0x16ef('0x3c')]=[{'all':!![]}];}_0x23cf55=_['merge']({},_0x23cf55,_0x2c1f01[_0x16ef('0x39')]);return db[_0x16ef('0x3a')]['find'](_0x23cf55)[_0x16ef('0x1f')](handleEntityNotFound(_0x3d7795,null))[_0x16ef('0x1f')](respondWithResult(_0x3d7795,null))[_0x16ef('0x3f')](handleError(_0x3d7795,null));};exports['create']=function(_0x31cd04,_0x2cf5a3){return db[_0x16ef('0x3a')][_0x16ef('0x41')](_0x31cd04[_0x16ef('0x42')],{})[_0x16ef('0x1f')](respondWithResult(_0x2cf5a3,0xc9))[_0x16ef('0x3f')](handleError(_0x2cf5a3,null));};exports[_0x16ef('0x43')]=function(_0x174676,_0x40ce1a){if(_0x174676[_0x16ef('0x42')]['id']){delete _0x174676[_0x16ef('0x42')]['id'];}return db[_0x16ef('0x3a')][_0x16ef('0x44')]({'where':{'id':_0x174676[_0x16ef('0x45')]['id']}})[_0x16ef('0x1f')](handleEntityNotFound(_0x40ce1a,null))[_0x16ef('0x1f')](saveUpdates(_0x174676[_0x16ef('0x42')],null))[_0x16ef('0x1f')](respondWithResult(_0x40ce1a,null))['catch'](handleError(_0x40ce1a,null));};exports[_0x16ef('0x20')]=function(_0x2fedf2,_0x5b3b79){return db[_0x16ef('0x3a')][_0x16ef('0x44')]({'where':{'id':_0x2fedf2['params']['id']}})['then'](handleEntityNotFound(_0x5b3b79,null))[_0x16ef('0x1f')](removeEntity(_0x5b3b79,null))['catch'](handleError(_0x5b3b79,null));};exports['describe']=function(_0x449cb4,_0x6e870b){return db['SquareReport'][_0x16ef('0x46')]()[_0x16ef('0x1f')](respondWithResult(_0x6e870b,null))[_0x16ef('0x3f')](handleError(_0x6e870b,null));}; \ No newline at end of file +var _0xcc18=['request-promise','moment','bluebird','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x19f42c,_0x1cb1be){var _0x20c151=function(_0x4baf1a){while(--_0x4baf1a){_0x19f42c['push'](_0x19f42c['shift']());}};_0x20c151(++_0x1cb1be);}(_0xcc18,0x134));var _0x8cc1=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xcc18[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0x8cc1('0x0'));var rimraf=require(_0x8cc1('0x1'));var zipdir=require(_0x8cc1('0x2'));var jsonpatch=require(_0x8cc1('0x3'));var rp=require(_0x8cc1('0x4'));var moment=require(_0x8cc1('0x5'));var BPromise=require(_0x8cc1('0x6'));var Mustache=require('mustache');var util=require(_0x8cc1('0x7'));var path=require(_0x8cc1('0x8'));var sox=require('sox');var csv=require(_0x8cc1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cc1('0xa'));var squel=require('squel');var crypto=require(_0x8cc1('0xb'));var jsforce=require(_0x8cc1('0xc'));var deskjs=require(_0x8cc1('0xd'));var toCsv=require(_0x8cc1('0x9'));var querystring=require(_0x8cc1('0xe'));var Papa=require('papaparse');var Redis=require(_0x8cc1('0xf'));var authService=require(_0x8cc1('0x10'));var qs=require(_0x8cc1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cc1('0x12'))(_0x8cc1('0x13'));var utils=require(_0x8cc1('0x14'));var config=require(_0x8cc1('0x15'));var licenseUtil=require(_0x8cc1('0x16'));var db=require(_0x8cc1('0x17'))['db'];function respondWithStatusCode(_0x5170f9,_0x1985a7){_0x1985a7=_0x1985a7||0xcc;return function(_0xdecd52){if(_0xdecd52){return _0x5170f9['sendStatus'](_0x1985a7);}return _0x5170f9['status'](_0x1985a7)[_0x8cc1('0x18')]();};}function respondWithResult(_0x3e4a6a,_0x4b55a0){_0x4b55a0=_0x4b55a0||0xc8;return function(_0x27147f){if(_0x27147f){return _0x3e4a6a[_0x8cc1('0x19')](_0x4b55a0)['json'](_0x27147f);}};}function respondWithFilteredResult(_0x120d31,_0x2822a4){return function(_0x13943c){if(_0x13943c){var _0x3d7eb6=typeof _0x2822a4[_0x8cc1('0x1a')]===_0x8cc1('0x1b')&&typeof _0x2822a4[_0x8cc1('0x1c')]===_0x8cc1('0x1b');var _0x1dfe86=_0x13943c[_0x8cc1('0x1d')];var _0x4f15e6=_0x3d7eb6?0x0:_0x2822a4['offset'];var _0xc57710=_0x3d7eb6?_0x13943c['count']:_0x2822a4[_0x8cc1('0x1a')]+_0x2822a4[_0x8cc1('0x1c')];var _0x119b3a;if(_0xc57710>=_0x1dfe86){_0xc57710=_0x1dfe86;_0x119b3a=0xc8;}else{_0x119b3a=0xce;}_0x120d31[_0x8cc1('0x19')](_0x119b3a);return _0x120d31['set'](_0x8cc1('0x1e'),_0x4f15e6+'-'+_0xc57710+'/'+_0x1dfe86)[_0x8cc1('0x1f')](_0x13943c);}return null;};}function patchUpdates(_0x49ef45){return function(_0x40c80a){try{jsonpatch[_0x8cc1('0x20')](_0x40c80a,_0x49ef45,!![]);}catch(_0x5c2d64){return BPromise[_0x8cc1('0x21')](_0x5c2d64);}return _0x40c80a[_0x8cc1('0x22')]();};}function saveUpdates(_0x12dadb,_0x3e55dd){return function(_0x56ec4a){if(_0x56ec4a){return _0x56ec4a[_0x8cc1('0x23')](_0x12dadb)['then'](function(_0x43539a){return _0x43539a;});}return null;};}function removeEntity(_0x537980,_0x555c08){return function(_0x168ad3){if(_0x168ad3){return _0x168ad3[_0x8cc1('0x24')]()[_0x8cc1('0x25')](function(){_0x537980[_0x8cc1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1394,_0x53d55e){return function(_0xee917f){if(!_0xee917f){_0x2c1394[_0x8cc1('0x26')](0x194);}return _0xee917f;};}function handleError(_0x1d77bf,_0x4875e8){_0x4875e8=_0x4875e8||0x1f4;return function(_0x2c3d04){logger[_0x8cc1('0x27')](_0x2c3d04[_0x8cc1('0x28')]);if(_0x2c3d04[_0x8cc1('0x29')]){delete _0x2c3d04[_0x8cc1('0x29')];}_0x1d77bf['status'](_0x4875e8)[_0x8cc1('0x2a')](_0x2c3d04);};}exports[_0x8cc1('0x2b')]=function(_0x208314,_0x16a7a0){var _0x5d5e48={},_0x247b9a={},_0x53b5cb={'count':0x0,'rows':[]};var _0x1809cd=_['map'](db[_0x8cc1('0x2c')][_0x8cc1('0x2d')],function(_0xce1d48){return{'name':_0xce1d48[_0x8cc1('0x2e')],'type':_0xce1d48[_0x8cc1('0x2f')][_0x8cc1('0x30')]};});_0x247b9a[_0x8cc1('0x31')]=_[_0x8cc1('0x32')](_0x1809cd,_0x8cc1('0x29'));_0x247b9a[_0x8cc1('0x33')]=_['keys'](_0x208314[_0x8cc1('0x33')]);_0x247b9a[_0x8cc1('0x34')]=_[_0x8cc1('0x35')](_0x247b9a[_0x8cc1('0x31')],_0x247b9a[_0x8cc1('0x33')]);_0x5d5e48[_0x8cc1('0x36')]=_['intersection'](_0x247b9a[_0x8cc1('0x31')],qs[_0x8cc1('0x37')](_0x208314['query']['fields']));_0x5d5e48['attributes']=_0x5d5e48[_0x8cc1('0x36')][_0x8cc1('0x38')]?_0x5d5e48[_0x8cc1('0x36')]:_0x247b9a[_0x8cc1('0x31')];if(!_0x208314['query'][_0x8cc1('0x39')]('nolimit')){_0x5d5e48[_0x8cc1('0x1c')]=qs[_0x8cc1('0x1c')](_0x208314[_0x8cc1('0x33')]['limit']);_0x5d5e48[_0x8cc1('0x1a')]=qs[_0x8cc1('0x1a')](_0x208314['query'][_0x8cc1('0x1a')]);}_0x5d5e48[_0x8cc1('0x3a')]=qs['sort'](_0x208314[_0x8cc1('0x33')][_0x8cc1('0x3b')]);_0x5d5e48[_0x8cc1('0x3c')]=qs[_0x8cc1('0x34')](_[_0x8cc1('0x3d')](_0x208314['query'],_0x247b9a['filters']),_0x1809cd);if(_0x208314[_0x8cc1('0x33')][_0x8cc1('0x3e')]){_0x5d5e48['where']=_[_0x8cc1('0x3f')](_0x5d5e48[_0x8cc1('0x3c')],{'$or':_['map'](_0x1809cd,function(_0x446296){if(_0x446296[_0x8cc1('0x2f')]!==_0x8cc1('0x40')){var _0x3c229f={};_0x3c229f[_0x446296['name']]={'$like':'%'+_0x208314[_0x8cc1('0x33')]['filter']+'%'};return _0x3c229f;}})});}_0x5d5e48=_[_0x8cc1('0x3f')]({},_0x5d5e48,_0x208314['options']);var _0x3b6fc6={'where':_0x5d5e48[_0x8cc1('0x3c')]};return db['SquareReport'][_0x8cc1('0x1d')](_0x3b6fc6)['then'](function(_0x165e2f){_0x53b5cb[_0x8cc1('0x1d')]=_0x165e2f;if(_0x208314[_0x8cc1('0x33')]['includeAll']){_0x5d5e48[_0x8cc1('0x41')]=[{'all':!![]}];}return db['SquareReport'][_0x8cc1('0x42')](_0x5d5e48);})['then'](function(_0x1d5bd3){_0x53b5cb[_0x8cc1('0x43')]=_0x1d5bd3;return _0x53b5cb;})[_0x8cc1('0x25')](respondWithFilteredResult(_0x16a7a0,_0x5d5e48))[_0x8cc1('0x44')](handleError(_0x16a7a0,null));};exports[_0x8cc1('0x45')]=function(_0xa1cc45,_0x471bca){var _0x27c890={'raw':!![],'where':{'id':_0xa1cc45[_0x8cc1('0x46')]['id']}},_0x1d36c6={};_0x1d36c6[_0x8cc1('0x31')]=_[_0x8cc1('0x47')](db[_0x8cc1('0x2c')][_0x8cc1('0x2d')]);_0x1d36c6[_0x8cc1('0x33')]=_[_0x8cc1('0x47')](_0xa1cc45[_0x8cc1('0x33')]);_0x1d36c6[_0x8cc1('0x34')]=_[_0x8cc1('0x35')](_0x1d36c6[_0x8cc1('0x31')],_0x1d36c6[_0x8cc1('0x33')]);_0x27c890[_0x8cc1('0x36')]=_[_0x8cc1('0x35')](_0x1d36c6[_0x8cc1('0x31')],qs[_0x8cc1('0x37')](_0xa1cc45['query'][_0x8cc1('0x37')]));_0x27c890['attributes']=_0x27c890[_0x8cc1('0x36')][_0x8cc1('0x38')]?_0x27c890[_0x8cc1('0x36')]:_0x1d36c6[_0x8cc1('0x31')];if(_0xa1cc45['query'][_0x8cc1('0x48')]){_0x27c890['include']=[{'all':!![]}];}_0x27c890=_[_0x8cc1('0x3f')]({},_0x27c890,_0xa1cc45[_0x8cc1('0x49')]);return db['SquareReport'][_0x8cc1('0x4a')](_0x27c890)[_0x8cc1('0x25')](handleEntityNotFound(_0x471bca,null))['then'](respondWithResult(_0x471bca,null))['catch'](handleError(_0x471bca,null));};exports['create']=function(_0x33b696,_0x1907b5){return db[_0x8cc1('0x2c')][_0x8cc1('0x4b')](_0x33b696[_0x8cc1('0x4c')],{})[_0x8cc1('0x25')](respondWithResult(_0x1907b5,0xc9))[_0x8cc1('0x44')](handleError(_0x1907b5,null));};exports[_0x8cc1('0x23')]=function(_0x1b83fe,_0x5530f0){if(_0x1b83fe[_0x8cc1('0x4c')]['id']){delete _0x1b83fe[_0x8cc1('0x4c')]['id'];}return db['SquareReport'][_0x8cc1('0x4a')]({'where':{'id':_0x1b83fe[_0x8cc1('0x46')]['id']}})[_0x8cc1('0x25')](handleEntityNotFound(_0x5530f0,null))[_0x8cc1('0x25')](saveUpdates(_0x1b83fe[_0x8cc1('0x4c')],null))[_0x8cc1('0x25')](respondWithResult(_0x5530f0,null))[_0x8cc1('0x44')](handleError(_0x5530f0,null));};exports['destroy']=function(_0x51ad1d,_0x2f5108){return db[_0x8cc1('0x2c')][_0x8cc1('0x4a')]({'where':{'id':_0x51ad1d[_0x8cc1('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f5108,null))[_0x8cc1('0x25')](removeEntity(_0x2f5108,null))[_0x8cc1('0x44')](handleError(_0x2f5108,null));};exports['describe']=function(_0x25e19a,_0x33d3f4){return db['SquareReport'][_0x8cc1('0x4d')]()[_0x8cc1('0x25')](respondWithResult(_0x33d3f4,null))['catch'](handleError(_0x33d3f4,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e5b54b3..09704f8 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 _0xe12e=['exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0xe12e,0x1a6));var _0xee12=function(_0x348799,_0x5b7f5d){_0x348799=_0x348799-0x0;var _0x51c210=_0xe12e[_0x348799];return _0x51c210;};'use strict';var _=require(_0xee12('0x0'));var util=require(_0xee12('0x1'));var logger=require(_0xee12('0x2'))(_0xee12('0x3'));var moment=require(_0xee12('0x4'));var BPromise=require(_0xee12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee12('0x6'));var rimraf=require(_0xee12('0x7'));var config=require(_0xee12('0x8'));var attributes=require(_0xee12('0x9'));module[_0xee12('0xa')]=function(_0xd8dae0,_0x732a8a){return _0xd8dae0[_0xee12('0xb')](_0xee12('0xc'),attributes,{'tableName':_0xee12('0xd'),'paranoid':![],'indexes':[{'name':_0xee12('0xe'),'fields':[_0xee12('0xf'),_0xee12('0x10')]},{'name':_0xee12('0x11'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x00f8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid','leaveAt'];(function(_0x466690,_0x1a726b){var _0x5657f8=function(_0x1bfef9){while(--_0x1bfef9){_0x466690['push'](_0x466690['shift']());}};_0x5657f8(++_0x1a726b);}(_0x00f8,0x1a0));var _0x800f=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x00f8[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0x800f('0x0'));var util=require(_0x800f('0x1'));var logger=require('../../config/logger')(_0x800f('0x2'));var moment=require(_0x800f('0x3'));var BPromise=require(_0x800f('0x4'));var rp=require(_0x800f('0x5'));var fs=require('fs');var path=require(_0x800f('0x6'));var rimraf=require(_0x800f('0x7'));var config=require(_0x800f('0x8'));var attributes=require(_0x800f('0x9'));module[_0x800f('0xa')]=function(_0x994ea5,_0x42a151){return _0x994ea5[_0x800f('0xb')](_0x800f('0xc'),attributes,{'tableName':_0x800f('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x800f('0xe'),'project_name']},{'name':_0x800f('0xf'),'fields':[_0x800f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 10ae526..d04757d 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 _0x3803=['catch','SquareReport','body','options','raw','CreateSquareReport','UpdateSquareReport','attributes','debug','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0x3c7331,_0x3d5a0a){var _0x1e429e=function(_0x2d5043){while(--_0x2d5043){_0x3c7331['push'](_0x3c7331['shift']());}};_0x1e429e(++_0x3d5a0a);}(_0x3803,0x159));var _0x3380=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3803[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x3380('0x0'));var util=require(_0x3380('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3380('0x2'));var db=require(_0x3380('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3380('0x4'))(_0x3380('0x5'));var config=require(_0x3380('0x6'));var jayson=require(_0x3380('0x7'));var client=jayson[_0x3380('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f79ba,_0x37e88e,_0x2f023c){return new BPromise(function(_0x126c52,_0x1babc2){return client[_0x3380('0x9')](_0x1f79ba,_0x2f023c)[_0x3380('0xa')](function(_0x5e9172){logger[_0x3380('0xb')](_0x3380('0xc'),_0x37e88e,'request\x20sent');logger['debug'](_0x3380('0xd'),_0x37e88e,'request\x20sent',JSON[_0x3380('0xe')](_0x5e9172));if(_0x5e9172[_0x3380('0xf')]){if(_0x5e9172[_0x3380('0xf')]['code']===0x1f4){logger[_0x3380('0xf')](_0x3380('0xc'),_0x37e88e,_0x5e9172[_0x3380('0xf')][_0x3380('0x10')]);return _0x1babc2(_0x5e9172[_0x3380('0xf')][_0x3380('0x10')]);}logger[_0x3380('0xf')](_0x3380('0xc'),_0x37e88e,_0x5e9172[_0x3380('0xf')][_0x3380('0x10')]);return _0x126c52(_0x5e9172['error'][_0x3380('0x10')]);}else{logger[_0x3380('0xb')](_0x3380('0xc'),_0x37e88e,_0x3380('0x11'));_0x126c52(_0x5e9172[_0x3380('0x12')][_0x3380('0x10')]);}})[_0x3380('0x13')](function(_0x427397){logger[_0x3380('0xf')](_0x3380('0xc'),_0x37e88e,_0x427397);_0x1babc2(_0x427397);});});}exports['CreateSquareReport']=function(_0x3bec34){var _0x5d1cb1=this;return new Promise(function(_0x4147f0,_0x29988d){return db[_0x3380('0x14')]['create'](_0x3bec34[_0x3380('0x15')],{'raw':_0x3bec34['options']?_0x3bec34[_0x3380('0x16')][_0x3380('0x17')]===undefined?!![]:![]:!![]})[_0x3380('0xa')](function(_0x59f866){logger['info'](_0x3380('0x18'),_0x3bec34);logger['debug']('CreateSquareReport',_0x3bec34,JSON[_0x3380('0xe')](_0x59f866));_0x4147f0(_0x59f866);})[_0x3380('0x13')](function(_0x1cc43f){logger[_0x3380('0xf')](_0x3380('0x18'),_0x1cc43f['message'],_0x3bec34);_0x29988d(_0x5d1cb1['error'](0x1f4,_0x1cc43f[_0x3380('0x10')]));});});};exports[_0x3380('0x19')]=function(_0x43d0b7){var _0x4ae802=this;return new Promise(function(_0x5aff3a,_0x3dda00){return db[_0x3380('0x14')]['update'](_0x43d0b7['body'],{'raw':_0x43d0b7[_0x3380('0x16')]?_0x43d0b7[_0x3380('0x16')][_0x3380('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43d0b7[_0x3380('0x16')]?_0x43d0b7[_0x3380('0x16')]['where']||null:null,'attributes':_0x43d0b7[_0x3380('0x16')]?_0x43d0b7['options'][_0x3380('0x1a')]||null:null,'limit':_0x43d0b7['options']?_0x43d0b7['options']['limit']||null:null})[_0x3380('0xa')](function(_0x189fdd){logger[_0x3380('0xb')]('UpdateSquareReport',_0x43d0b7);logger[_0x3380('0x1b')](_0x3380('0x19'),_0x43d0b7,JSON[_0x3380('0xe')](_0x189fdd));_0x5aff3a(_0x189fdd);})[_0x3380('0x13')](function(_0x14fd0e){logger[_0x3380('0xf')](_0x3380('0x19'),_0x14fd0e[_0x3380('0x10')],_0x43d0b7);_0x3dda00(_0x4ae802['error'](0x1f4,_0x14fd0e[_0x3380('0x10')]));});});}; \ No newline at end of file +var _0x528d=['then','debug','stringify','UpdateSquareReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options','raw'];(function(_0x498226,_0x1eaa8e){var _0x39878f=function(_0x586f5a){while(--_0x586f5a){_0x498226['push'](_0x498226['shift']());}};_0x39878f(++_0x1eaa8e);}(_0x528d,0x1c9));var _0xd528=function(_0x1513bc,_0x461684){_0x1513bc=_0x1513bc-0x0;var _0x82e13e=_0x528d[_0x1513bc];return _0x82e13e;};'use strict';var _=require(_0xd528('0x0'));var util=require(_0xd528('0x1'));var moment=require(_0xd528('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd528('0x3'));var db=require(_0xd528('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd528('0x5'))('rpc');var config=require(_0xd528('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd528('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x325816,_0x215cd5,_0x9dd8bc){return new BPromise(function(_0x510f2d,_0xbe445e){return client[_0xd528('0x8')](_0x325816,_0x9dd8bc)['then'](function(_0x194d6a){logger[_0xd528('0x9')](_0xd528('0xa'),_0x215cd5,_0xd528('0xb'));logger['debug'](_0xd528('0xc'),_0x215cd5,_0xd528('0xb'),JSON['stringify'](_0x194d6a));if(_0x194d6a[_0xd528('0xd')]){if(_0x194d6a['error'][_0xd528('0xe')]===0x1f4){logger[_0xd528('0xd')](_0xd528('0xa'),_0x215cd5,_0x194d6a[_0xd528('0xd')][_0xd528('0xf')]);return _0xbe445e(_0x194d6a['error'][_0xd528('0xf')]);}logger['error'](_0xd528('0xa'),_0x215cd5,_0x194d6a[_0xd528('0xd')][_0xd528('0xf')]);return _0x510f2d(_0x194d6a[_0xd528('0xd')]['message']);}else{logger[_0xd528('0x9')](_0xd528('0xa'),_0x215cd5,'request\x20sent');_0x510f2d(_0x194d6a['result'][_0xd528('0xf')]);}})[_0xd528('0x10')](function(_0x50639b){logger[_0xd528('0xd')](_0xd528('0xa'),_0x215cd5,_0x50639b);_0xbe445e(_0x50639b);});});}exports[_0xd528('0x11')]=function(_0x527a6f){var _0x38c579=this;return new Promise(function(_0x4c7a9c,_0x22fd81){return db[_0xd528('0x12')][_0xd528('0x13')](_0x527a6f[_0xd528('0x14')],{'raw':_0x527a6f[_0xd528('0x15')]?_0x527a6f[_0xd528('0x15')][_0xd528('0x16')]===undefined?!![]:![]:!![]})[_0xd528('0x17')](function(_0x4e7ff9){logger['info'](_0xd528('0x11'),_0x527a6f);logger[_0xd528('0x18')](_0xd528('0x11'),_0x527a6f,JSON[_0xd528('0x19')](_0x4e7ff9));_0x4c7a9c(_0x4e7ff9);})['catch'](function(_0xc23a96){logger[_0xd528('0xd')](_0xd528('0x11'),_0xc23a96['message'],_0x527a6f);_0x22fd81(_0x38c579[_0xd528('0xd')](0x1f4,_0xc23a96[_0xd528('0xf')]));});});};exports[_0xd528('0x1a')]=function(_0x55e87a){var _0x34cad1=this;return new Promise(function(_0x43bba1,_0x21b367){return db[_0xd528('0x12')][_0xd528('0x1b')](_0x55e87a['body'],{'raw':_0x55e87a[_0xd528('0x15')]?_0x55e87a['options'][_0xd528('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e87a[_0xd528('0x15')]?_0x55e87a[_0xd528('0x15')][_0xd528('0x1c')]||null:null,'attributes':_0x55e87a['options']?_0x55e87a['options'][_0xd528('0x1d')]||null:null,'limit':_0x55e87a[_0xd528('0x15')]?_0x55e87a['options']['limit']||null:null})[_0xd528('0x17')](function(_0xfea58e){logger[_0xd528('0x9')](_0xd528('0x1a'),_0x55e87a);logger['debug']('UpdateSquareReport',_0x55e87a,JSON[_0xd528('0x19')](_0xfea58e));_0x43bba1(_0xfea58e);})[_0xd528('0x10')](function(_0x49df08){logger[_0xd528('0xd')](_0xd528('0x1a'),_0x49df08['message'],_0x55e87a);_0x21b367(_0x34cad1['error'](0x1f4,_0x49df08[_0xd528('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index fad2a52..55488b3 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 _0x22be=['describe','/:id','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','isAuthenticated'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x22be,0x93));var _0xe22b=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x22be[_0x516927];return _0x30749b;};'use strict';var multer=require(_0xe22b('0x0'));var util=require(_0xe22b('0x1'));var path=require('path');var timeout=require(_0xe22b('0x2'));var express=require(_0xe22b('0x3'));var router=express[_0xe22b('0x4')]();var fs_extra=require(_0xe22b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe22b('0x6'));var config=require(_0xe22b('0x7'));var controller=require(_0xe22b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe22b('0x9')]);router[_0xe22b('0xa')](_0xe22b('0xb'),auth[_0xe22b('0xc')](),controller[_0xe22b('0xd')]);router[_0xe22b('0xa')](_0xe22b('0xe'),auth[_0xe22b('0xc')](),controller['show']);router[_0xe22b('0xf')]('/',auth[_0xe22b('0xc')](),controller['create']);router[_0xe22b('0x10')](_0xe22b('0xe'),auth[_0xe22b('0xc')](),controller[_0xe22b('0x11')]);router[_0xe22b('0x12')](_0xe22b('0xe'),auth[_0xe22b('0xc')](),controller['destroy']);module[_0xe22b('0x13')]=router; \ No newline at end of file +var _0x6302=['describe','show','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe'];(function(_0x5697ca,_0x50b747){var _0x3ed94e=function(_0x40c9e3){while(--_0x40c9e3){_0x5697ca['push'](_0x5697ca['shift']());}};_0x3ed94e(++_0x50b747);}(_0x6302,0x1c2));var _0x2630=function(_0x322e24,_0xc3de36){_0x322e24=_0x322e24-0x0;var _0x277ca1=_0x6302[_0x322e24];return _0x277ca1;};'use strict';var multer=require('multer');var util=require(_0x2630('0x0'));var path=require('path');var timeout=require(_0x2630('0x1'));var express=require(_0x2630('0x2'));var router=express[_0x2630('0x3')]();var fs_extra=require(_0x2630('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2630('0x5'));var config=require(_0x2630('0x6'));var controller=require(_0x2630('0x7'));router['get']('/',auth[_0x2630('0x8')](),controller[_0x2630('0x9')]);router[_0x2630('0xa')](_0x2630('0xb'),auth[_0x2630('0x8')](),controller[_0x2630('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2630('0xd')]);router['post']('/',auth[_0x2630('0x8')](),controller[_0x2630('0xe')]);router[_0x2630('0xf')](_0x2630('0x10'),auth[_0x2630('0x8')](),controller[_0x2630('0x11')]);router[_0x2630('0x12')](_0x2630('0x10'),auth['isAuthenticated'](),controller[_0x2630('0x13')]);module[_0x2630('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 511f356..7804223 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 _0xf538=['STRING','TEXT','exports'];(function(_0x5529f5,_0x4ab6e7){var _0x39cff4=function(_0x2ec206){while(--_0x2ec206){_0x5529f5['push'](_0x5529f5['shift']());}};_0x39cff4(++_0x4ab6e7);}(_0xf538,0x65));var _0x8f53=function(_0x51330a,_0x38e928){_0x51330a=_0x51330a-0x0;var _0x25d0bf=_0xf538[_0x51330a];return _0x25d0bf;};'use strict';var Sequelize=require('sequelize');module[_0x8f53('0x0')]={'uniqueid':{'type':Sequelize[_0x8f53('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x8f53('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8f53('0x1')]}}; \ No newline at end of file +var _0xf5c2=['STRING','exports'];(function(_0x458cac,_0x521f8d){var _0x833faa=function(_0x3eebac){while(--_0x3eebac){_0x458cac['push'](_0x458cac['shift']());}};_0x833faa(++_0x521f8d);}(_0xf5c2,0x145));var _0x2f5c=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xf5c2[_0x4c321c];return _0x25accb;};'use strict';var Sequelize=require('sequelize');module[_0x2f5c('0x0')]={'uniqueid':{'type':Sequelize[_0x2f5c('0x1')]},'node':{'type':Sequelize[_0x2f5c('0x1')]},'application':{'type':Sequelize[_0x2f5c('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x2f5c('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 1fa99c6..4d27ed5 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 _0xb7f3=['fields','attributes','length','model','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x5c4471,_0x14c91f){var _0x13ea26=function(_0x3b2858){while(--_0x3b2858){_0x5c4471['push'](_0x5c4471['shift']());}};_0x13ea26(++_0x14c91f);}(_0xb7f3,0x197));var _0x3b7f=function(_0x422f19,_0x3804e6){_0x422f19=_0x422f19-0x0;var _0x9c1430=_0xb7f3[_0x422f19];return _0x9c1430;};'use strict';var emlformat=require(_0x3b7f('0x0'));var rimraf=require(_0x3b7f('0x1'));var zipdir=require(_0x3b7f('0x2'));var jsonpatch=require(_0x3b7f('0x3'));var rp=require('request-promise');var moment=require(_0x3b7f('0x4'));var BPromise=require(_0x3b7f('0x5'));var Mustache=require(_0x3b7f('0x6'));var util=require('util');var path=require(_0x3b7f('0x7'));var sox=require('sox');var csv=require(_0x3b7f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b7f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b7f('0xa'));var jsforce=require(_0x3b7f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3b7f('0x8'));var querystring=require(_0x3b7f('0xc'));var Papa=require('papaparse');var Redis=require(_0x3b7f('0xd'));var authService=require(_0x3b7f('0xe'));var qs=require(_0x3b7f('0xf'));var as=require(_0x3b7f('0x10'));var hardwareService=require(_0x3b7f('0x11'));var logger=require(_0x3b7f('0x12'))(_0x3b7f('0x13'));var utils=require(_0x3b7f('0x14'));var config=require(_0x3b7f('0x15'));var licenseUtil=require(_0x3b7f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24fef8,_0x37c288){_0x37c288=_0x37c288||0xcc;return function(_0x59c7ec){if(_0x59c7ec){return _0x24fef8[_0x3b7f('0x17')](_0x37c288);}return _0x24fef8[_0x3b7f('0x18')](_0x37c288)[_0x3b7f('0x19')]();};}function respondWithResult(_0x3cced5,_0x45616e){_0x45616e=_0x45616e||0xc8;return function(_0xd99428){if(_0xd99428){return _0x3cced5['status'](_0x45616e)[_0x3b7f('0x1a')](_0xd99428);}};}function respondWithFilteredResult(_0xfb4c25,_0xb943b8){return function(_0x1c5e56){if(_0x1c5e56){var _0x466835=typeof _0xb943b8[_0x3b7f('0x1b')]===_0x3b7f('0x1c')&&typeof _0xb943b8[_0x3b7f('0x1d')]===_0x3b7f('0x1c');var _0x35c35b=_0x1c5e56[_0x3b7f('0x1e')];var _0x249a0e=_0x466835?0x0:_0xb943b8[_0x3b7f('0x1b')];var _0x531c34=_0x466835?_0x1c5e56[_0x3b7f('0x1e')]:_0xb943b8[_0x3b7f('0x1b')]+_0xb943b8['limit'];var _0x4ef62d;if(_0x531c34>=_0x35c35b){_0x531c34=_0x35c35b;_0x4ef62d=0xc8;}else{_0x4ef62d=0xce;}_0xfb4c25[_0x3b7f('0x18')](_0x4ef62d);return _0xfb4c25[_0x3b7f('0x1f')](_0x3b7f('0x20'),_0x249a0e+'-'+_0x531c34+'/'+_0x35c35b)[_0x3b7f('0x1a')](_0x1c5e56);}return null;};}function patchUpdates(_0x396da0){return function(_0x28aff6){try{jsonpatch[_0x3b7f('0x21')](_0x28aff6,_0x396da0,!![]);}catch(_0x51a8b0){return BPromise[_0x3b7f('0x22')](_0x51a8b0);}return _0x28aff6[_0x3b7f('0x23')]();};}function saveUpdates(_0x366048,_0x11e464){return function(_0xca2fb9){if(_0xca2fb9){return _0xca2fb9['update'](_0x366048)[_0x3b7f('0x24')](function(_0x50e0b2){return _0x50e0b2;});}return null;};}function removeEntity(_0x579051,_0x3b6caf){return function(_0x1b757b){if(_0x1b757b){return _0x1b757b[_0x3b7f('0x25')]()[_0x3b7f('0x24')](function(){_0x579051[_0x3b7f('0x18')](0xcc)[_0x3b7f('0x19')]();});}};}function handleEntityNotFound(_0x1fae12,_0x1e9ba1){return function(_0x557cbe){if(!_0x557cbe){_0x1fae12[_0x3b7f('0x17')](0x194);}return _0x557cbe;};}function handleError(_0x1755b2,_0x45a0e8){_0x45a0e8=_0x45a0e8||0x1f4;return function(_0x3c75b1){logger[_0x3b7f('0x26')](_0x3c75b1[_0x3b7f('0x27')]);if(_0x3c75b1[_0x3b7f('0x28')]){delete _0x3c75b1['name'];}_0x1755b2[_0x3b7f('0x18')](_0x45a0e8)['send'](_0x3c75b1);};}exports['index']=function(_0x1c111f,_0x13d2dc){var _0x28133e={},_0x319ad7={},_0x5600d8={'count':0x0,'rows':[]};var _0x5b6038=_[_0x3b7f('0x29')](db['SquareDetailsReport'][_0x3b7f('0x2a')],function(_0x185714){return{'name':_0x185714[_0x3b7f('0x2b')],'type':_0x185714[_0x3b7f('0x2c')][_0x3b7f('0x2d')]};});_0x319ad7['model']=_[_0x3b7f('0x29')](_0x5b6038,'name');_0x319ad7[_0x3b7f('0x2e')]=_[_0x3b7f('0x2f')](_0x1c111f[_0x3b7f('0x2e')]);_0x319ad7[_0x3b7f('0x30')]=_['intersection'](_0x319ad7['model'],_0x319ad7['query']);_0x28133e['attributes']=_['intersection'](_0x319ad7['model'],qs[_0x3b7f('0x31')](_0x1c111f[_0x3b7f('0x2e')][_0x3b7f('0x31')]));_0x28133e[_0x3b7f('0x32')]=_0x28133e[_0x3b7f('0x32')][_0x3b7f('0x33')]?_0x28133e[_0x3b7f('0x32')]:_0x319ad7[_0x3b7f('0x34')];if(!_0x1c111f['query'][_0x3b7f('0x35')](_0x3b7f('0x36'))){_0x28133e['limit']=qs[_0x3b7f('0x1d')](_0x1c111f[_0x3b7f('0x2e')]['limit']);_0x28133e[_0x3b7f('0x1b')]=qs[_0x3b7f('0x1b')](_0x1c111f['query']['offset']);}_0x28133e[_0x3b7f('0x37')]=qs['sort'](_0x1c111f[_0x3b7f('0x2e')]['sort']);_0x28133e[_0x3b7f('0x38')]=qs[_0x3b7f('0x30')](_[_0x3b7f('0x39')](_0x1c111f['query'],_0x319ad7[_0x3b7f('0x30')]),_0x5b6038);if(_0x1c111f[_0x3b7f('0x2e')][_0x3b7f('0x3a')]){_0x28133e[_0x3b7f('0x38')]=_['merge'](_0x28133e[_0x3b7f('0x38')],{'$or':_[_0x3b7f('0x29')](_0x5b6038,function(_0x50dbe6){if(_0x50dbe6[_0x3b7f('0x2c')]!==_0x3b7f('0x3b')){var _0x1fbfbb={};_0x1fbfbb[_0x50dbe6[_0x3b7f('0x28')]]={'$like':'%'+_0x1c111f[_0x3b7f('0x2e')][_0x3b7f('0x3a')]+'%'};return _0x1fbfbb;}})});}_0x28133e=_[_0x3b7f('0x3c')]({},_0x28133e,_0x1c111f[_0x3b7f('0x3d')]);var _0x59dc66={'where':_0x28133e[_0x3b7f('0x38')]};return db[_0x3b7f('0x3e')][_0x3b7f('0x1e')](_0x59dc66)[_0x3b7f('0x24')](function(_0xcaee44){_0x5600d8['count']=_0xcaee44;if(_0x1c111f['query'][_0x3b7f('0x3f')]){_0x28133e[_0x3b7f('0x40')]=[{'all':!![]}];}return db[_0x3b7f('0x3e')][_0x3b7f('0x41')](_0x28133e);})[_0x3b7f('0x24')](function(_0x3ef0d6){_0x5600d8[_0x3b7f('0x42')]=_0x3ef0d6;return _0x5600d8;})[_0x3b7f('0x24')](respondWithFilteredResult(_0x13d2dc,_0x28133e))['catch'](handleError(_0x13d2dc,null));};exports[_0x3b7f('0x43')]=function(_0x154b24,_0x288648){var _0x27214b={'raw':!![],'where':{'id':_0x154b24[_0x3b7f('0x44')]['id']}},_0x559b0a={};_0x559b0a['model']=_[_0x3b7f('0x2f')](db['SquareDetailsReport']['rawAttributes']);_0x559b0a['query']=_[_0x3b7f('0x2f')](_0x154b24['query']);_0x559b0a[_0x3b7f('0x30')]=_['intersection'](_0x559b0a[_0x3b7f('0x34')],_0x559b0a[_0x3b7f('0x2e')]);_0x27214b[_0x3b7f('0x32')]=_[_0x3b7f('0x45')](_0x559b0a[_0x3b7f('0x34')],qs['fields'](_0x154b24[_0x3b7f('0x2e')][_0x3b7f('0x31')]));_0x27214b[_0x3b7f('0x32')]=_0x27214b[_0x3b7f('0x32')][_0x3b7f('0x33')]?_0x27214b[_0x3b7f('0x32')]:_0x559b0a[_0x3b7f('0x34')];if(_0x154b24[_0x3b7f('0x2e')]['includeAll']){_0x27214b['include']=[{'all':!![]}];}_0x27214b=_[_0x3b7f('0x3c')]({},_0x27214b,_0x154b24['options']);return db[_0x3b7f('0x3e')][_0x3b7f('0x46')](_0x27214b)[_0x3b7f('0x24')](handleEntityNotFound(_0x288648,null))[_0x3b7f('0x24')](respondWithResult(_0x288648,null))[_0x3b7f('0x47')](handleError(_0x288648,null));};exports[_0x3b7f('0x48')]=function(_0x2614fd,_0x43d6d0){return db['SquareDetailsReport'][_0x3b7f('0x48')](_0x2614fd[_0x3b7f('0x49')],{})[_0x3b7f('0x24')](respondWithResult(_0x43d6d0,0xc9))['catch'](handleError(_0x43d6d0,null));};exports[_0x3b7f('0x4a')]=function(_0x11b6fb,_0x4242c3){if(_0x11b6fb['body']['id']){delete _0x11b6fb[_0x3b7f('0x49')]['id'];}return db[_0x3b7f('0x3e')][_0x3b7f('0x46')]({'where':{'id':_0x11b6fb[_0x3b7f('0x44')]['id']}})['then'](handleEntityNotFound(_0x4242c3,null))[_0x3b7f('0x24')](saveUpdates(_0x11b6fb['body'],null))[_0x3b7f('0x24')](respondWithResult(_0x4242c3,null))[_0x3b7f('0x47')](handleError(_0x4242c3,null));};exports[_0x3b7f('0x25')]=function(_0x44cd2c,_0xe47360){return db[_0x3b7f('0x3e')][_0x3b7f('0x46')]({'where':{'id':_0x44cd2c['params']['id']}})[_0x3b7f('0x24')](handleEntityNotFound(_0xe47360,null))['then'](removeEntity(_0xe47360,null))['catch'](handleError(_0xe47360,null));};exports[_0x3b7f('0x4b')]=function(_0x49811d,_0x1804d9){return db[_0x3b7f('0x3e')][_0x3b7f('0x4b')]()[_0x3b7f('0x24')](respondWithResult(_0x1804d9,null))[_0x3b7f('0x47')](handleError(_0x1804d9,null));}; \ No newline at end of file +var _0x87a3=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','SquareDetailsReport','rawAttributes','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter'];(function(_0xf4a12a,_0x585d23){var _0x85a7f2=function(_0x9c936a){while(--_0x9c936a){_0xf4a12a['push'](_0xf4a12a['shift']());}};_0x85a7f2(++_0x585d23);}(_0x87a3,0xed));var _0x387a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x87a3[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x387a('0x0'));var rimraf=require(_0x387a('0x1'));var zipdir=require(_0x387a('0x2'));var jsonpatch=require(_0x387a('0x3'));var rp=require(_0x387a('0x4'));var moment=require(_0x387a('0x5'));var BPromise=require(_0x387a('0x6'));var Mustache=require(_0x387a('0x7'));var util=require(_0x387a('0x8'));var path=require(_0x387a('0x9'));var sox=require(_0x387a('0xa'));var csv=require(_0x387a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x387a('0xc'));var _=require(_0x387a('0xd'));var squel=require('squel');var crypto=require(_0x387a('0xe'));var jsforce=require(_0x387a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x387a('0xb'));var querystring=require(_0x387a('0x10'));var Papa=require(_0x387a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x387a('0x12'));var logger=require('../../config/logger')(_0x387a('0x13'));var utils=require('../../config/utils');var config=require(_0x387a('0x14'));var licenseUtil=require(_0x387a('0x15'));var db=require(_0x387a('0x16'))['db'];function respondWithStatusCode(_0x5551c0,_0x5bb7d3){_0x5bb7d3=_0x5bb7d3||0xcc;return function(_0x74bf34){if(_0x74bf34){return _0x5551c0[_0x387a('0x17')](_0x5bb7d3);}return _0x5551c0[_0x387a('0x18')](_0x5bb7d3)[_0x387a('0x19')]();};}function respondWithResult(_0xfdc007,_0x420c21){_0x420c21=_0x420c21||0xc8;return function(_0x30d359){if(_0x30d359){return _0xfdc007[_0x387a('0x18')](_0x420c21)[_0x387a('0x1a')](_0x30d359);}};}function respondWithFilteredResult(_0x48c615,_0x1af6a1){return function(_0x2a9e7b){if(_0x2a9e7b){var _0x2f9a0e=typeof _0x1af6a1[_0x387a('0x1b')]===_0x387a('0x1c')&&typeof _0x1af6a1['limit']===_0x387a('0x1c');var _0xb53cf3=_0x2a9e7b[_0x387a('0x1d')];var _0x3616d4=_0x2f9a0e?0x0:_0x1af6a1[_0x387a('0x1b')];var _0x4d5efc=_0x2f9a0e?_0x2a9e7b[_0x387a('0x1d')]:_0x1af6a1[_0x387a('0x1b')]+_0x1af6a1[_0x387a('0x1e')];var _0x5a8bd3;if(_0x4d5efc>=_0xb53cf3){_0x4d5efc=_0xb53cf3;_0x5a8bd3=0xc8;}else{_0x5a8bd3=0xce;}_0x48c615['status'](_0x5a8bd3);return _0x48c615[_0x387a('0x1f')](_0x387a('0x20'),_0x3616d4+'-'+_0x4d5efc+'/'+_0xb53cf3)[_0x387a('0x1a')](_0x2a9e7b);}return null;};}function patchUpdates(_0x178f5d){return function(_0x4cbf02){try{jsonpatch[_0x387a('0x21')](_0x4cbf02,_0x178f5d,!![]);}catch(_0x3661b7){return BPromise[_0x387a('0x22')](_0x3661b7);}return _0x4cbf02[_0x387a('0x23')]();};}function saveUpdates(_0x23a514,_0x375033){return function(_0x8e3cc0){if(_0x8e3cc0){return _0x8e3cc0[_0x387a('0x24')](_0x23a514)[_0x387a('0x25')](function(_0x4fb2f3){return _0x4fb2f3;});}return null;};}function removeEntity(_0x3a1212,_0x538458){return function(_0x4e12a7){if(_0x4e12a7){return _0x4e12a7['destroy']()[_0x387a('0x25')](function(){_0x3a1212[_0x387a('0x18')](0xcc)[_0x387a('0x19')]();});}};}function handleEntityNotFound(_0x20496e,_0x2693c9){return function(_0x315c61){if(!_0x315c61){_0x20496e['sendStatus'](0x194);}return _0x315c61;};}function handleError(_0x36f5a4,_0x25c1a1){_0x25c1a1=_0x25c1a1||0x1f4;return function(_0x3e46f6){logger['error'](_0x3e46f6[_0x387a('0x26')]);if(_0x3e46f6['name']){delete _0x3e46f6[_0x387a('0x27')];}_0x36f5a4[_0x387a('0x18')](_0x25c1a1)['send'](_0x3e46f6);};}exports[_0x387a('0x28')]=function(_0x2b0210,_0x1b35a1){var _0x5c8ef1={},_0x3a1bb4={},_0x5900a5={'count':0x0,'rows':[]};var _0x358e1b=_['map'](db[_0x387a('0x29')][_0x387a('0x2a')],function(_0xc80dc4){return{'name':_0xc80dc4['fieldName'],'type':_0xc80dc4['type'][_0x387a('0x2b')]};});_0x3a1bb4[_0x387a('0x2c')]=_[_0x387a('0x2d')](_0x358e1b,_0x387a('0x27'));_0x3a1bb4['query']=_[_0x387a('0x2e')](_0x2b0210['query']);_0x3a1bb4[_0x387a('0x2f')]=_[_0x387a('0x30')](_0x3a1bb4['model'],_0x3a1bb4[_0x387a('0x31')]);_0x5c8ef1['attributes']=_[_0x387a('0x30')](_0x3a1bb4[_0x387a('0x2c')],qs[_0x387a('0x32')](_0x2b0210[_0x387a('0x31')][_0x387a('0x32')]));_0x5c8ef1[_0x387a('0x33')]=_0x5c8ef1['attributes'][_0x387a('0x34')]?_0x5c8ef1[_0x387a('0x33')]:_0x3a1bb4[_0x387a('0x2c')];if(!_0x2b0210[_0x387a('0x31')][_0x387a('0x35')](_0x387a('0x36'))){_0x5c8ef1[_0x387a('0x1e')]=qs['limit'](_0x2b0210['query'][_0x387a('0x1e')]);_0x5c8ef1['offset']=qs['offset'](_0x2b0210[_0x387a('0x31')][_0x387a('0x1b')]);}_0x5c8ef1[_0x387a('0x37')]=qs['sort'](_0x2b0210['query']['sort']);_0x5c8ef1[_0x387a('0x38')]=qs['filters'](_[_0x387a('0x39')](_0x2b0210[_0x387a('0x31')],_0x3a1bb4[_0x387a('0x2f')]),_0x358e1b);if(_0x2b0210[_0x387a('0x31')][_0x387a('0x3a')]){_0x5c8ef1[_0x387a('0x38')]=_[_0x387a('0x3b')](_0x5c8ef1[_0x387a('0x38')],{'$or':_[_0x387a('0x2d')](_0x358e1b,function(_0x13daf9){if(_0x13daf9[_0x387a('0x3c')]!==_0x387a('0x3d')){var _0x5cd0e9={};_0x5cd0e9[_0x13daf9[_0x387a('0x27')]]={'$like':'%'+_0x2b0210['query'][_0x387a('0x3a')]+'%'};return _0x5cd0e9;}})});}_0x5c8ef1=_[_0x387a('0x3b')]({},_0x5c8ef1,_0x2b0210[_0x387a('0x3e')]);var _0x332989={'where':_0x5c8ef1['where']};return db[_0x387a('0x29')][_0x387a('0x1d')](_0x332989)[_0x387a('0x25')](function(_0x2dbf4a){_0x5900a5['count']=_0x2dbf4a;if(_0x2b0210[_0x387a('0x31')][_0x387a('0x3f')]){_0x5c8ef1[_0x387a('0x40')]=[{'all':!![]}];}return db[_0x387a('0x29')][_0x387a('0x41')](_0x5c8ef1);})[_0x387a('0x25')](function(_0xd9d65a){_0x5900a5[_0x387a('0x42')]=_0xd9d65a;return _0x5900a5;})[_0x387a('0x25')](respondWithFilteredResult(_0x1b35a1,_0x5c8ef1))[_0x387a('0x43')](handleError(_0x1b35a1,null));};exports[_0x387a('0x44')]=function(_0x1ee6a7,_0x286251){var _0x444993={'raw':!![],'where':{'id':_0x1ee6a7[_0x387a('0x45')]['id']}},_0x266e17={};_0x266e17[_0x387a('0x2c')]=_[_0x387a('0x2e')](db['SquareDetailsReport'][_0x387a('0x2a')]);_0x266e17[_0x387a('0x31')]=_['keys'](_0x1ee6a7['query']);_0x266e17[_0x387a('0x2f')]=_[_0x387a('0x30')](_0x266e17[_0x387a('0x2c')],_0x266e17['query']);_0x444993['attributes']=_['intersection'](_0x266e17['model'],qs[_0x387a('0x32')](_0x1ee6a7['query'][_0x387a('0x32')]));_0x444993[_0x387a('0x33')]=_0x444993[_0x387a('0x33')]['length']?_0x444993[_0x387a('0x33')]:_0x266e17['model'];if(_0x1ee6a7[_0x387a('0x31')][_0x387a('0x3f')]){_0x444993[_0x387a('0x40')]=[{'all':!![]}];}_0x444993=_[_0x387a('0x3b')]({},_0x444993,_0x1ee6a7['options']);return db[_0x387a('0x29')]['find'](_0x444993)[_0x387a('0x25')](handleEntityNotFound(_0x286251,null))[_0x387a('0x25')](respondWithResult(_0x286251,null))['catch'](handleError(_0x286251,null));};exports[_0x387a('0x46')]=function(_0x2591eb,_0x1735e0){return db[_0x387a('0x29')][_0x387a('0x46')](_0x2591eb[_0x387a('0x47')],{})['then'](respondWithResult(_0x1735e0,0xc9))[_0x387a('0x43')](handleError(_0x1735e0,null));};exports[_0x387a('0x24')]=function(_0x5b59a3,_0xf74f12){if(_0x5b59a3[_0x387a('0x47')]['id']){delete _0x5b59a3['body']['id'];}return db[_0x387a('0x29')]['find']({'where':{'id':_0x5b59a3['params']['id']}})[_0x387a('0x25')](handleEntityNotFound(_0xf74f12,null))[_0x387a('0x25')](saveUpdates(_0x5b59a3[_0x387a('0x47')],null))[_0x387a('0x25')](respondWithResult(_0xf74f12,null))[_0x387a('0x43')](handleError(_0xf74f12,null));};exports[_0x387a('0x48')]=function(_0x26bb8c,_0x184e16){return db[_0x387a('0x29')]['find']({'where':{'id':_0x26bb8c['params']['id']}})['then'](handleEntityNotFound(_0x184e16,null))[_0x387a('0x25')](removeEntity(_0x184e16,null))[_0x387a('0x43')](handleError(_0x184e16,null));};exports[_0x387a('0x49')]=function(_0x53918b,_0x238a17){return db['SquareDetailsReport'][_0x387a('0x49')]()['then'](respondWithResult(_0x238a17,null))[_0x387a('0x43')](handleError(_0x238a17,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c5f0574..20965d4 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 _0x43d7=['define','SquareDetailsReport','lodash','util','moment','request-promise','path','rimraf','exports'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x43d7,0x1e8));var _0x743d=function(_0x2cd0bd,_0x84366e){_0x2cd0bd=_0x2cd0bd-0x0;var _0x4f7d5c=_0x43d7[_0x2cd0bd];return _0x4f7d5c;};'use strict';var _=require(_0x743d('0x0'));var util=require(_0x743d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x743d('0x2'));var BPromise=require('bluebird');var rp=require(_0x743d('0x3'));var fs=require('fs');var path=require(_0x743d('0x4'));var rimraf=require(_0x743d('0x5'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x743d('0x6')]=function(_0x5b58f4,_0x25bb8b){return _0x5b58f4[_0x743d('0x7')](_0x743d('0x8'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x211b=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x280aaa,_0x57bb42){var _0x2318d8=function(_0xd6c43d){while(--_0xd6c43d){_0x280aaa['push'](_0x280aaa['shift']());}};_0x2318d8(++_0x57bb42);}(_0x211b,0xae));var _0xb211=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x211b[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0xb211('0x0'));var logger=require(_0xb211('0x1'))('api');var moment=require(_0xb211('0x2'));var BPromise=require(_0xb211('0x3'));var rp=require(_0xb211('0x4'));var fs=require('fs');var path=require(_0xb211('0x5'));var rimraf=require(_0xb211('0x6'));var config=require(_0xb211('0x7'));var attributes=require(_0xb211('0x8'));module[_0xb211('0x9')]=function(_0xbb4168,_0x1fa55b){return _0xbb4168[_0xb211('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xb211('0xb'),'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 067d69e..6235cdc 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 _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4df296,_0x55edb8){_0x4df296=_0x4df296-0x0;var _0x35a45f=_0x1c7c[_0x4df296];return _0x35a45f;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')](_0xb42702[_0xc1c7('0x1b')],{'raw':_0xb42702[_0xc1c7('0x1c')]?_0xb42702['options'][_0xc1c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e7e4a){logger[_0xc1c7('0xe')]('CreateSquareDetailsReport',_0xb42702);logger['debug'](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x5e7e4a));_0x2e93e5(_0x5e7e4a);})[_0xc1c7('0x17')](function(_0x4c6b34){logger[_0xc1c7('0x13')](_0xc1c7('0x18'),_0x4c6b34[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x4c6b34[_0xc1c7('0x14')]));});});}; \ No newline at end of file +var _0x8952=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','raw','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3799bf,_0x937a88){var _0x633b0a=function(_0x192fc7){while(--_0x192fc7){_0x3799bf['push'](_0x3799bf['shift']());}};_0x633b0a(++_0x937a88);}(_0x8952,0x17e));var _0x2895=function(_0x276268,_0x5c4299){_0x276268=_0x276268-0x0;var _0x1c3016=_0x8952[_0x276268];return _0x1c3016;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')](_0xbf8b63['body'],{'raw':_0xbf8b63['options']?_0xbf8b63['options'][_0x2895('0x18')]===undefined?!![]:![]:!![]})[_0x2895('0xc')](function(_0x3ec4da){logger['info'](_0x2895('0x15'),_0xbf8b63);logger[_0x2895('0x19')](_0x2895('0x15'),_0xbf8b63,JSON[_0x2895('0xf')](_0x3ec4da));_0x155124(_0x3ec4da);})[_0x2895('0x14')](function(_0x5dbbfe){logger[_0x2895('0x10')](_0x2895('0x15'),_0x5dbbfe['message'],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x5dbbfe[_0x2895('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 0c879cb..20a2b27 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 _0x4163=['isAuthenticated','killProcess','exports','Router','./system.controller','index','get','/process/:pid/kill'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x4163,0x9b));var _0x3416=function(_0x1ece00,_0x29e271){_0x1ece00=_0x1ece00-0x0;var _0x3019aa=_0x4163[_0x1ece00];return _0x3019aa;};'use strict';var express=require('express');var router=express[_0x3416('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3416('0x1'));router['get']('/',auth['isAuthenticated'](),controller[_0x3416('0x2')]);router[_0x3416('0x3')](_0x3416('0x4'),auth[_0x3416('0x5')](),controller[_0x3416('0x6')]);module[_0x3416('0x7')]=router; \ No newline at end of file +var _0xd950=['express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x46acd1,_0x43bb41){var _0x5239c7=function(_0x539da4){while(--_0x539da4){_0x46acd1['push'](_0x46acd1['shift']());}};_0x5239c7(++_0x43bb41);}(_0xd950,0x117));var _0x0d95=function(_0x26e448,_0x9a85b7){_0x26e448=_0x26e448-0x0;var _0x3c4e48=_0xd950[_0x26e448];return _0x3c4e48;};'use strict';var express=require(_0x0d95('0x0'));var router=express[_0x0d95('0x1')]();var auth=require(_0x0d95('0x2'));var controller=require('./system.controller');router[_0x0d95('0x3')]('/',auth[_0x0d95('0x4')](),controller[_0x0d95('0x5')]);router['get'](_0x0d95('0x6'),auth['isAuthenticated'](),controller[_0x0d95('0x7')]);module[_0x0d95('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 68a8f17..576e3b4 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 _0x26e8=['lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','then','catch','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','util','bluebird'];(function(_0x4a4ef4,_0x400dc1){var _0x337246=function(_0x13ca47){while(--_0x13ca47){_0x4a4ef4['push'](_0x4a4ef4['shift']());}};_0x337246(++_0x400dc1);}(_0x26e8,0x13e));var _0x826e=function(_0x1d3c4b,_0x3918c4){_0x1d3c4b=_0x1d3c4b-0x0;var _0x1acd5c=_0x26e8[_0x1d3c4b];return _0x1acd5c;};'use strict';var info=require('systeminformation');var exec=require(_0x826e('0x0'))[_0x826e('0x1')];var logger=require('../../config/logger')('api');var util=require(_0x826e('0x2'));var BPromise=require(_0x826e('0x3'));var _=require(_0x826e('0x4'));function handleError(_0x13cbc6,_0x1f7dc9,_0x4717c5){_0x1f7dc9=_0x1f7dc9||0x1f4;return function(_0x311029){logger['error'](_0x826e('0x5'),_0x4717c5,_0x1f7dc9,util['inspect'](_0x311029,{'showHidden':![],'depth':null}));delete _0x311029['name'];_0x13cbc6[_0x826e('0x6')](_0x1f7dc9)[_0x826e('0x7')](_0x311029);};}exports[_0x826e('0x8')]=function(_0xb6ea5b,_0x2b4d8e){return info['getAllData']()[_0x826e('0x9')](function(_0x16924f){return _0x2b4d8e[_0x826e('0x6')](0xc8)['json'](_0x16924f);})[_0x826e('0xa')](function(_0x36da41){return _0x2b4d8e[_0x826e('0x6')](0x1f4)[_0x826e('0xb')](_0x36da41);});};exports[_0x826e('0xc')]=function(_0x365d5e,_0x499f5f){var _0x3a1fb8=['components/import/cm'];return new BPromise(function(_0x38407a,_0x10cea9){return exec(util['format'](_0x826e('0xd'),_0x365d5e[_0x826e('0xe')]['pid']),function(_0x1bdf50,_0xed9006,_0x2f9e5e){if(_0x1bdf50){return _0x10cea9(_0x1bdf50);}return _0x38407a(_0xed9006);});})['then'](function(_0x4075af){var _0x383fb5=![];var _0x2b5b65=_0x4075af[_0x826e('0xf')](/\n/);for(var _0x142d14=0x0,_0x24688b=_0x3a1fb8[_0x826e('0x10')];_0x142d14<_0x24688b,_0x383fb5===![];_0x142d14+=0x1){if(_0x4075af['indexOf'](_0x3a1fb8[_0x142d14])>=0x0){_0x383fb5=!![];}}if(!_0x383fb5){throw new Error(util[_0x826e('0x11')](_0x826e('0x12'),_0x365d5e['params']['pid']));}process[_0x826e('0x13')](_0x365d5e[_0x826e('0xe')][_0x826e('0x14')],_0x826e('0x15'));return _0x499f5f[_0x826e('0x6')](0xc8)[_0x826e('0xb')]({'message':util[_0x826e('0x11')](_0x826e('0x16'),_0x365d5e[_0x826e('0xe')][_0x826e('0x14')])});})['catch'](handleError(_0x499f5f,null,'killProcess'));}; \ No newline at end of file +var _0xcc12=['../../config/logger','api','lodash','error','name','send','getAllData','then','status','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','kill','SIGINT','json','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec'];(function(_0x4be9e1,_0x21054a){var _0x2e7b12=function(_0x76caf6){while(--_0x76caf6){_0x4be9e1['push'](_0x4be9e1['shift']());}};_0x2e7b12(++_0x21054a);}(_0xcc12,0x1b6));var _0x2cc1=function(_0xe4e45b,_0x5d1d87){_0xe4e45b=_0xe4e45b-0x0;var _0x58f3c2=_0xcc12[_0xe4e45b];return _0x58f3c2;};'use strict';var info=require(_0x2cc1('0x0'));var exec=require('child_process')[_0x2cc1('0x1')];var logger=require(_0x2cc1('0x2'))(_0x2cc1('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x2cc1('0x4'));function handleError(_0x5141f2,_0x48460e,_0x1a2db5){_0x48460e=_0x48460e||0x1f4;return function(_0xfc2fd){logger[_0x2cc1('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1a2db5,_0x48460e,util['inspect'](_0xfc2fd,{'showHidden':![],'depth':null}));delete _0xfc2fd[_0x2cc1('0x6')];_0x5141f2['status'](_0x48460e)[_0x2cc1('0x7')](_0xfc2fd);};}exports['index']=function(_0x3e866d,_0x2ee0aa){return info[_0x2cc1('0x8')]()[_0x2cc1('0x9')](function(_0x4e055d){return _0x2ee0aa[_0x2cc1('0xa')](0xc8)['json'](_0x4e055d);})['catch'](function(_0x350192){return _0x2ee0aa[_0x2cc1('0xa')](0x1f4)['json'](_0x350192);});};exports[_0x2cc1('0xb')]=function(_0x3713ea,_0x11f0f6){var _0x11fa38=['components/import/cm'];return new BPromise(function(_0x1369ed,_0x2d22dc){return exec(util['format'](_0x2cc1('0xc'),_0x3713ea[_0x2cc1('0xd')][_0x2cc1('0xe')]),function(_0x5c2988,_0x4c97f5,_0xf8c950){if(_0x5c2988){return _0x2d22dc(_0x5c2988);}return _0x1369ed(_0x4c97f5);});})['then'](function(_0x4fc863){var _0x493142=![];var _0x20fa29=_0x4fc863[_0x2cc1('0xf')](/\n/);for(var _0x31b9c3=0x0,_0x56596b=_0x11fa38['length'];_0x31b9c3<_0x56596b,_0x493142===![];_0x31b9c3+=0x1){if(_0x4fc863[_0x2cc1('0x10')](_0x11fa38[_0x31b9c3])>=0x0){_0x493142=!![];}}if(!_0x493142){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3713ea['params'][_0x2cc1('0xe')]));}process[_0x2cc1('0x11')](_0x3713ea['params']['pid'],_0x2cc1('0x12'));return _0x11f0f6[_0x2cc1('0xa')](0xc8)[_0x2cc1('0x13')]({'message':util[_0x2cc1('0x14')](_0x2cc1('0x15'),_0x3713ea['params'][_0x2cc1('0xe')])});})['catch'](handleError(_0x11f0f6,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5706f33..d3b44e5 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 _0x678e=['connect-timeout','fs-extra','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1ddbef,_0x4a2c3f){var _0xc3b929=function(_0x2f46f8){while(--_0x2f46f8){_0x1ddbef['push'](_0x1ddbef['shift']());}};_0xc3b929(++_0x4a2c3f);}(_0x678e,0x153));var _0xe678=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x678e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe678('0x0'));var util=require(_0xe678('0x1'));var path=require(_0xe678('0x2'));var timeout=require(_0xe678('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe678('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe678('0x5'));var controller=require(_0xe678('0x6'));router[_0xe678('0x7')]('/',auth[_0xe678('0x8')](),controller[_0xe678('0x9')]);router[_0xe678('0x7')](_0xe678('0xa'),auth['isAuthenticated'](),controller[_0xe678('0xb')]);router[_0xe678('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe678('0xd')](_0xe678('0xa'),auth[_0xe678('0x8')](),controller[_0xe678('0xe')]);router[_0xe678('0xf')](_0xe678('0xa'),auth[_0xe678('0x8')](),controller[_0xe678('0x10')]);module[_0xe678('0x11')]=router; \ No newline at end of file +var _0x20cc=['show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id'];(function(_0x41702f,_0x2a3ab3){var _0x1c3d79=function(_0x13d47e){while(--_0x13d47e){_0x41702f['push'](_0x41702f['shift']());}};_0x1c3d79(++_0x2a3ab3);}(_0x20cc,0x196));var _0xc20c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x20cc[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var path=require(_0xc20c('0x2'));var timeout=require('connect-timeout');var express=require(_0xc20c('0x3'));var router=express[_0xc20c('0x4')]();var fs_extra=require(_0xc20c('0x5'));var auth=require(_0xc20c('0x6'));var interaction=require(_0xc20c('0x7'));var config=require(_0xc20c('0x8'));var controller=require(_0xc20c('0x9'));router[_0xc20c('0xa')]('/',auth[_0xc20c('0xb')](),controller[_0xc20c('0xc')]);router[_0xc20c('0xa')](_0xc20c('0xd'),auth['isAuthenticated'](),controller[_0xc20c('0xe')]);router[_0xc20c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc20c('0x10')]);router[_0xc20c('0x11')]('/:id',auth[_0xc20c('0xb')](),controller[_0xc20c('0x12')]);router[_0xc20c('0x13')](_0xc20c('0xd'),auth[_0xc20c('0xb')](),controller['destroy']);module[_0xc20c('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1735a2e..24ff2a6 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 _0x21f8=['STRING','name','#0091EA','sequelize','exports'];(function(_0x21c8a9,_0x5687f4){var _0x1f8a72=function(_0x54f365){while(--_0x54f365){_0x21c8a9['push'](_0x21c8a9['shift']());}};_0x1f8a72(++_0x5687f4);}(_0x21f8,0x71));var _0x821f=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x21f8[_0x5a636f];return _0x6a8cfb;};'use strict';var Sequelize=require(_0x821f('0x0'));module[_0x821f('0x1')]={'name':{'type':Sequelize[_0x821f('0x2')],'unique':_0x821f('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x821f('0x2')],'defaultValue':_0x821f('0x4')},'description':{'type':Sequelize[_0x821f('0x2')]}}; \ No newline at end of file +var _0x23a8=['#0091EA','STRING','exports','name'];(function(_0x5cbcdc,_0x271df6){var _0x4bfbf7=function(_0x390e90){while(--_0x390e90){_0x5cbcdc['push'](_0x5cbcdc['shift']());}};_0x4bfbf7(++_0x271df6);}(_0x23a8,0x172));var _0x823a=function(_0x27f893,_0x1010de){_0x27f893=_0x27f893-0x0;var _0x3639da=_0x23a8[_0x27f893];return _0x3639da;};'use strict';var Sequelize=require('sequelize');module[_0x823a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x823a('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x823a('0x2')},'description':{'type':Sequelize[_0x823a('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 49ae764..3e88a46 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 _0xf021=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','reject','save','update','then','Tags','end','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','Tag','count','includeAll','include','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xf021,0x18f));var _0x1f02=function(_0x24f1ff,_0x4014c9){_0x24f1ff=_0x24f1ff-0x0;var _0x349109=_0xf021[_0x24f1ff];return _0x349109;};'use strict';var emlformat=require(_0x1f02('0x0'));var rimraf=require(_0x1f02('0x1'));var zipdir=require(_0x1f02('0x2'));var jsonpatch=require(_0x1f02('0x3'));var rp=require(_0x1f02('0x4'));var moment=require('moment');var BPromise=require(_0x1f02('0x5'));var Mustache=require('mustache');var util=require(_0x1f02('0x6'));var path=require(_0x1f02('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f02('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f02('0x9'));var squel=require(_0x1f02('0xa'));var crypto=require(_0x1f02('0xb'));var jsforce=require(_0x1f02('0xc'));var deskjs=require(_0x1f02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f02('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f02('0xf'));var as=require(_0x1f02('0x10'));var hardwareService=require(_0x1f02('0x11'));var logger=require(_0x1f02('0x12'))(_0x1f02('0x13'));var utils=require('../../config/utils');var config=require(_0x1f02('0x14'));var licenseUtil=require(_0x1f02('0x15'));var db=require(_0x1f02('0x16'))['db'];function respondWithStatusCode(_0x56a2c2,_0x24e9b8){_0x24e9b8=_0x24e9b8||0xcc;return function(_0x1ac6eb){if(_0x1ac6eb){return _0x56a2c2[_0x1f02('0x17')](_0x24e9b8);}return _0x56a2c2['status'](_0x24e9b8)['end']();};}function respondWithResult(_0x4974bd,_0x11ba7e){_0x11ba7e=_0x11ba7e||0xc8;return function(_0x2c08ad){if(_0x2c08ad){return _0x4974bd[_0x1f02('0x18')](_0x11ba7e)[_0x1f02('0x19')](_0x2c08ad);}};}function respondWithFilteredResult(_0x1c16ce,_0x45bae1){return function(_0x440328){if(_0x440328){var _0x3b0a3d=typeof _0x45bae1['offset']===_0x1f02('0x1a')&&typeof _0x45bae1['limit']==='undefined';var _0x4a66a5=_0x440328['count'];var _0x4d1e4f=_0x3b0a3d?0x0:_0x45bae1[_0x1f02('0x1b')];var _0x3033a2=_0x3b0a3d?_0x440328['count']:_0x45bae1[_0x1f02('0x1b')]+_0x45bae1[_0x1f02('0x1c')];var _0x356444;if(_0x3033a2>=_0x4a66a5){_0x3033a2=_0x4a66a5;_0x356444=0xc8;}else{_0x356444=0xce;}_0x1c16ce[_0x1f02('0x18')](_0x356444);return _0x1c16ce['set']('Content-Range',_0x4d1e4f+'-'+_0x3033a2+'/'+_0x4a66a5)[_0x1f02('0x19')](_0x440328);}return null;};}function patchUpdates(_0x37393a){return function(_0x5e78c2){try{jsonpatch['apply'](_0x5e78c2,_0x37393a,!![]);}catch(_0x339c29){return BPromise[_0x1f02('0x1d')](_0x339c29);}return _0x5e78c2[_0x1f02('0x1e')]();};}function saveUpdates(_0xbabbd7,_0x480297){return function(_0x12c4af){if(_0x12c4af){return _0x12c4af[_0x1f02('0x1f')](_0xbabbd7)[_0x1f02('0x20')](function(_0x2f422c){return _0x2f422c;});}return null;};}function removeEntity(_0x43b3e7,_0x134398){return function(_0x1328ea){if(_0x1328ea){return _0x1328ea['destroy']()[_0x1f02('0x20')](function(){var _0x3a8c57=_0x1328ea['get']({'plain':!![]});var _0x25a8d1=_0x1f02('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x25a8d1,'resourceId':_0x3a8c57['id']}})[_0x1f02('0x20')](function(){return _0x1328ea;});})[_0x1f02('0x20')](function(){_0x43b3e7[_0x1f02('0x18')](0xcc)[_0x1f02('0x22')]();});}};}function handleEntityNotFound(_0x3f5c5e,_0x3f5577){return function(_0x297cf4){if(!_0x297cf4){_0x3f5c5e['sendStatus'](0x194);}return _0x297cf4;};}function handleError(_0x4d5f7e,_0x4e04f2){_0x4e04f2=_0x4e04f2||0x1f4;return function(_0x3ef4bf){logger[_0x1f02('0x23')](_0x3ef4bf[_0x1f02('0x24')]);if(_0x3ef4bf['name']){delete _0x3ef4bf['name'];}_0x4d5f7e[_0x1f02('0x18')](_0x4e04f2)[_0x1f02('0x25')](_0x3ef4bf);};}exports[_0x1f02('0x26')]=function(_0x433a1e,_0x220345){var _0x3080a6={},_0x442333={},_0x23fa22={'count':0x0,'rows':[]};var _0x1c2a0d=_[_0x1f02('0x27')](db['Tag'][_0x1f02('0x28')],function(_0x5ab7a2){return{'name':_0x5ab7a2[_0x1f02('0x29')],'type':_0x5ab7a2[_0x1f02('0x2a')][_0x1f02('0x2b')]};});_0x442333[_0x1f02('0x2c')]=_[_0x1f02('0x27')](_0x1c2a0d,_0x1f02('0x2d'));_0x442333['query']=_['keys'](_0x433a1e[_0x1f02('0x2e')]);_0x442333[_0x1f02('0x2f')]=_['intersection'](_0x442333[_0x1f02('0x2c')],_0x442333['query']);_0x3080a6[_0x1f02('0x30')]=_['intersection'](_0x442333[_0x1f02('0x2c')],qs['fields'](_0x433a1e['query'][_0x1f02('0x31')]));_0x3080a6[_0x1f02('0x30')]=_0x3080a6[_0x1f02('0x30')][_0x1f02('0x32')]?_0x3080a6['attributes']:_0x442333[_0x1f02('0x2c')];if(!_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x33')]('nolimit')){_0x3080a6[_0x1f02('0x1c')]=qs[_0x1f02('0x1c')](_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x1c')]);_0x3080a6[_0x1f02('0x1b')]=qs[_0x1f02('0x1b')](_0x433a1e['query'][_0x1f02('0x1b')]);}_0x3080a6[_0x1f02('0x34')]=qs[_0x1f02('0x35')](_0x433a1e['query'][_0x1f02('0x35')]);_0x3080a6['where']=qs[_0x1f02('0x2f')](_['pick'](_0x433a1e['query'],_0x442333[_0x1f02('0x2f')]),_0x1c2a0d);if(_0x433a1e['query']['filter']){_0x3080a6[_0x1f02('0x36')]=_[_0x1f02('0x37')](_0x3080a6[_0x1f02('0x36')],{'$or':_[_0x1f02('0x27')](_0x1c2a0d,function(_0x47ee27){if(_0x47ee27[_0x1f02('0x2a')]!=='VIRTUAL'){var _0x2cd179={};_0x2cd179[_0x47ee27[_0x1f02('0x2d')]]={'$like':'%'+_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x38')]+'%'};return _0x2cd179;}})});}_0x3080a6=_[_0x1f02('0x37')]({},_0x3080a6,_0x433a1e[_0x1f02('0x39')]);var _0xb4fac5={'where':_0x3080a6[_0x1f02('0x36')]};return db[_0x1f02('0x3a')]['count'](_0xb4fac5)[_0x1f02('0x20')](function(_0x5aab10){_0x23fa22[_0x1f02('0x3b')]=_0x5aab10;if(_0x433a1e['query'][_0x1f02('0x3c')]){_0x3080a6[_0x1f02('0x3d')]=[{'all':!![]}];}return db[_0x1f02('0x3a')]['findAll'](_0x3080a6);})['then'](function(_0x1c3f09){_0x23fa22[_0x1f02('0x3e')]=_0x1c3f09;return _0x23fa22;})[_0x1f02('0x20')](respondWithFilteredResult(_0x220345,_0x3080a6))[_0x1f02('0x3f')](handleError(_0x220345,null));};exports[_0x1f02('0x40')]=function(_0x15fb49,_0x23733c){var _0x11f31f={'raw':!![],'where':{'id':_0x15fb49['params']['id']}},_0x391b57={};_0x391b57[_0x1f02('0x2c')]=_['keys'](db['Tag'][_0x1f02('0x28')]);_0x391b57['query']=_['keys'](_0x15fb49[_0x1f02('0x2e')]);_0x391b57['filters']=_['intersection'](_0x391b57[_0x1f02('0x2c')],_0x391b57[_0x1f02('0x2e')]);_0x11f31f['attributes']=_[_0x1f02('0x41')](_0x391b57[_0x1f02('0x2c')],qs[_0x1f02('0x31')](_0x15fb49[_0x1f02('0x2e')]['fields']));_0x11f31f[_0x1f02('0x30')]=_0x11f31f[_0x1f02('0x30')][_0x1f02('0x32')]?_0x11f31f[_0x1f02('0x30')]:_0x391b57[_0x1f02('0x2c')];if(_0x15fb49[_0x1f02('0x2e')][_0x1f02('0x3c')]){_0x11f31f[_0x1f02('0x3d')]=[{'all':!![]}];}_0x11f31f=_[_0x1f02('0x37')]({},_0x11f31f,_0x15fb49[_0x1f02('0x39')]);return db[_0x1f02('0x3a')][_0x1f02('0x42')](_0x11f31f)[_0x1f02('0x20')](handleEntityNotFound(_0x23733c,null))[_0x1f02('0x20')](respondWithResult(_0x23733c,null))['catch'](handleError(_0x23733c,null));};exports[_0x1f02('0x43')]=function(_0x50d5ed,_0x37759d){return db['Tag'][_0x1f02('0x43')](_0x50d5ed[_0x1f02('0x44')],{})[_0x1f02('0x20')](function(_0x32dac3){var _0x40bf99=_0x50d5ed[_0x1f02('0x45')][_0x1f02('0x46')]({'plain':!![]});if(!_0x40bf99)throw new Error(_0x1f02('0x47'));if(_0x40bf99[_0x1f02('0x48')]===_0x1f02('0x45')){var _0x1241c5=_0x32dac3['get']({'plain':!![]});var _0x45e71d=_0x1f02('0x21');return db[_0x1f02('0x49')][_0x1f02('0x42')]({'where':{'name':_0x45e71d,'userProfileId':_0x40bf99[_0x1f02('0x4a')]},'raw':!![]})[_0x1f02('0x20')](function(_0x2201b4){if(_0x2201b4&&_0x2201b4[_0x1f02('0x4b')]===0x0){return db[_0x1f02('0x4c')]['create']({'name':_0x1241c5[_0x1f02('0x2d')],'resourceId':_0x1241c5['id'],'type':_0x2201b4[_0x1f02('0x2d')],'sectionId':_0x2201b4['id']},{})[_0x1f02('0x20')](function(){return _0x32dac3;});}else{return _0x32dac3;}})[_0x1f02('0x3f')](function(_0x3cdf8c){logger['error'](_0x1f02('0x4d'),_0x3cdf8c);throw _0x3cdf8c;});}return _0x32dac3;})['then'](respondWithResult(_0x37759d,0xc9))[_0x1f02('0x3f')](handleError(_0x37759d,null));};exports[_0x1f02('0x1f')]=function(_0x2240d1,_0x18d80d){if(_0x2240d1[_0x1f02('0x44')]['id']){delete _0x2240d1[_0x1f02('0x44')]['id'];}return db[_0x1f02('0x3a')][_0x1f02('0x42')]({'where':{'id':_0x2240d1[_0x1f02('0x4e')]['id']}})[_0x1f02('0x20')](handleEntityNotFound(_0x18d80d,null))['then'](saveUpdates(_0x2240d1['body'],null))['then'](respondWithResult(_0x18d80d,null))[_0x1f02('0x3f')](handleError(_0x18d80d,null));};exports['destroy']=function(_0x238911,_0x449d58){return db['Tag'][_0x1f02('0x42')]({'where':{'id':_0x238911['params']['id']}})['then'](handleEntityNotFound(_0x449d58,null))['then'](removeEntity(_0x449d58,null))[_0x1f02('0x3f')](handleError(_0x449d58,null));}; \ No newline at end of file +var _0x99e9=['show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x594513,_0x109a7a){var _0x49a3b6=function(_0x405e19){while(--_0x405e19){_0x594513['push'](_0x594513['shift']());}};_0x49a3b6(++_0x109a7a);}(_0x99e9,0xb4));var _0x999e=function(_0x592307,_0x2b8719){_0x592307=_0x592307-0x0;var _0x244eb8=_0x99e9[_0x592307];return _0x244eb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999e('0x0'));var zipdir=require(_0x999e('0x1'));var jsonpatch=require(_0x999e('0x2'));var rp=require(_0x999e('0x3'));var moment=require('moment');var BPromise=require(_0x999e('0x4'));var Mustache=require(_0x999e('0x5'));var util=require(_0x999e('0x6'));var path=require('path');var sox=require(_0x999e('0x7'));var csv=require('to-csv');var ejs=require(_0x999e('0x8'));var fs=require('fs');var fs_extra=require(_0x999e('0x9'));var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0xe'));var querystring=require(_0x999e('0xf'));var Papa=require(_0x999e('0x10'));var Redis=require(_0x999e('0x11'));var authService=require(_0x999e('0x12'));var qs=require(_0x999e('0x13'));var as=require(_0x999e('0x14'));var hardwareService=require(_0x999e('0x15'));var logger=require(_0x999e('0x16'))(_0x999e('0x17'));var utils=require(_0x999e('0x18'));var config=require(_0x999e('0x19'));var licenseUtil=require(_0x999e('0x1a'));var db=require(_0x999e('0x1b'))['db'];function respondWithStatusCode(_0x26b55a,_0x47a3c1){_0x47a3c1=_0x47a3c1||0xcc;return function(_0x15f771){if(_0x15f771){return _0x26b55a['sendStatus'](_0x47a3c1);}return _0x26b55a[_0x999e('0x1c')](_0x47a3c1)[_0x999e('0x1d')]();};}function respondWithResult(_0x2fbc3e,_0x538a92){_0x538a92=_0x538a92||0xc8;return function(_0x28bdd1){if(_0x28bdd1){return _0x2fbc3e['status'](_0x538a92)[_0x999e('0x1e')](_0x28bdd1);}};}function respondWithFilteredResult(_0x539598,_0x549ad4){return function(_0x1eee64){if(_0x1eee64){var _0x22feac=typeof _0x549ad4[_0x999e('0x1f')]===_0x999e('0x20')&&typeof _0x549ad4[_0x999e('0x21')]===_0x999e('0x20');var _0x4aac66=_0x1eee64['count'];var _0x4fcdfb=_0x22feac?0x0:_0x549ad4[_0x999e('0x1f')];var _0x43b09e=_0x22feac?_0x1eee64[_0x999e('0x22')]:_0x549ad4[_0x999e('0x1f')]+_0x549ad4[_0x999e('0x21')];var _0x3ece5e;if(_0x43b09e>=_0x4aac66){_0x43b09e=_0x4aac66;_0x3ece5e=0xc8;}else{_0x3ece5e=0xce;}_0x539598['status'](_0x3ece5e);return _0x539598['set'](_0x999e('0x23'),_0x4fcdfb+'-'+_0x43b09e+'/'+_0x4aac66)[_0x999e('0x1e')](_0x1eee64);}return null;};}function patchUpdates(_0x3b3642){return function(_0x510fa2){try{jsonpatch[_0x999e('0x24')](_0x510fa2,_0x3b3642,!![]);}catch(_0x42e167){return BPromise[_0x999e('0x25')](_0x42e167);}return _0x510fa2[_0x999e('0x26')]();};}function saveUpdates(_0x373b80,_0x3750a0){return function(_0x427bcf){if(_0x427bcf){return _0x427bcf['update'](_0x373b80)['then'](function(_0x11a6bf){return _0x11a6bf;});}return null;};}function removeEntity(_0x4f0091,_0x4c5491){return function(_0x452acd){if(_0x452acd){return _0x452acd[_0x999e('0x27')]()[_0x999e('0x28')](function(){var _0x13027c=_0x452acd[_0x999e('0x29')]({'plain':!![]});var _0x320634='Tags';return db[_0x999e('0x2a')][_0x999e('0x27')]({'where':{'type':_0x320634,'resourceId':_0x13027c['id']}})[_0x999e('0x28')](function(){return _0x452acd;});})[_0x999e('0x28')](function(){_0x4f0091[_0x999e('0x1c')](0xcc)[_0x999e('0x1d')]();});}};}function handleEntityNotFound(_0x44b790,_0x5798f3){return function(_0x28f803){if(!_0x28f803){_0x44b790['sendStatus'](0x194);}return _0x28f803;};}function handleError(_0x4fed13,_0x3dff6b){_0x3dff6b=_0x3dff6b||0x1f4;return function(_0x1059bd){logger[_0x999e('0x2b')](_0x1059bd['stack']);if(_0x1059bd[_0x999e('0x2c')]){delete _0x1059bd[_0x999e('0x2c')];}_0x4fed13[_0x999e('0x1c')](_0x3dff6b)[_0x999e('0x2d')](_0x1059bd);};}exports[_0x999e('0x2e')]=function(_0x327079,_0x82e067){var _0x2e9b0e={},_0x27102b={},_0x3ddacb={'count':0x0,'rows':[]};var _0x53ece1=_[_0x999e('0x2f')](db[_0x999e('0x30')][_0x999e('0x31')],function(_0x4c2ce8){return{'name':_0x4c2ce8[_0x999e('0x32')],'type':_0x4c2ce8['type']['key']};});_0x27102b[_0x999e('0x33')]=_[_0x999e('0x2f')](_0x53ece1,'name');_0x27102b['query']=_[_0x999e('0x34')](_0x327079[_0x999e('0x35')]);_0x27102b[_0x999e('0x36')]=_[_0x999e('0x37')](_0x27102b['model'],_0x27102b[_0x999e('0x35')]);_0x2e9b0e[_0x999e('0x38')]=_[_0x999e('0x37')](_0x27102b[_0x999e('0x33')],qs['fields'](_0x327079['query'][_0x999e('0x39')]));_0x2e9b0e['attributes']=_0x2e9b0e[_0x999e('0x38')][_0x999e('0x3a')]?_0x2e9b0e[_0x999e('0x38')]:_0x27102b[_0x999e('0x33')];if(!_0x327079['query'][_0x999e('0x3b')](_0x999e('0x3c'))){_0x2e9b0e['limit']=qs['limit'](_0x327079[_0x999e('0x35')]['limit']);_0x2e9b0e[_0x999e('0x1f')]=qs['offset'](_0x327079['query']['offset']);}_0x2e9b0e['order']=qs[_0x999e('0x3d')](_0x327079['query'][_0x999e('0x3d')]);_0x2e9b0e['where']=qs['filters'](_['pick'](_0x327079[_0x999e('0x35')],_0x27102b[_0x999e('0x36')]),_0x53ece1);if(_0x327079[_0x999e('0x35')][_0x999e('0x3e')]){_0x2e9b0e[_0x999e('0x3f')]=_[_0x999e('0x40')](_0x2e9b0e[_0x999e('0x3f')],{'$or':_[_0x999e('0x2f')](_0x53ece1,function(_0x54866a){if(_0x54866a[_0x999e('0x41')]!==_0x999e('0x42')){var _0x1e1229={};_0x1e1229[_0x54866a[_0x999e('0x2c')]]={'$like':'%'+_0x327079['query'][_0x999e('0x3e')]+'%'};return _0x1e1229;}})});}_0x2e9b0e=_['merge']({},_0x2e9b0e,_0x327079[_0x999e('0x43')]);var _0x35b318={'where':_0x2e9b0e[_0x999e('0x3f')]};return db[_0x999e('0x30')]['count'](_0x35b318)[_0x999e('0x28')](function(_0x108c96){_0x3ddacb[_0x999e('0x22')]=_0x108c96;if(_0x327079['query']['includeAll']){_0x2e9b0e[_0x999e('0x44')]=[{'all':!![]}];}return db[_0x999e('0x30')][_0x999e('0x45')](_0x2e9b0e);})[_0x999e('0x28')](function(_0x1009a0){_0x3ddacb[_0x999e('0x46')]=_0x1009a0;return _0x3ddacb;})[_0x999e('0x28')](respondWithFilteredResult(_0x82e067,_0x2e9b0e))[_0x999e('0x47')](handleError(_0x82e067,null));};exports[_0x999e('0x48')]=function(_0xf4fa,_0x55da0b){var _0x4c8b36={'raw':!![],'where':{'id':_0xf4fa[_0x999e('0x49')]['id']}},_0xa5742d={};_0xa5742d[_0x999e('0x33')]=_[_0x999e('0x34')](db[_0x999e('0x30')][_0x999e('0x31')]);_0xa5742d['query']=_[_0x999e('0x34')](_0xf4fa['query']);_0xa5742d['filters']=_[_0x999e('0x37')](_0xa5742d['model'],_0xa5742d['query']);_0x4c8b36['attributes']=_['intersection'](_0xa5742d[_0x999e('0x33')],qs[_0x999e('0x39')](_0xf4fa['query'][_0x999e('0x39')]));_0x4c8b36[_0x999e('0x38')]=_0x4c8b36[_0x999e('0x38')]['length']?_0x4c8b36['attributes']:_0xa5742d[_0x999e('0x33')];if(_0xf4fa[_0x999e('0x35')][_0x999e('0x4a')]){_0x4c8b36['include']=[{'all':!![]}];}_0x4c8b36=_['merge']({},_0x4c8b36,_0xf4fa['options']);return db['Tag'][_0x999e('0x4b')](_0x4c8b36)['then'](handleEntityNotFound(_0x55da0b,null))['then'](respondWithResult(_0x55da0b,null))[_0x999e('0x47')](handleError(_0x55da0b,null));};exports[_0x999e('0x4c')]=function(_0x5843f1,_0xa50dc6){return db[_0x999e('0x30')]['create'](_0x5843f1[_0x999e('0x4d')],{})['then'](function(_0x9322ca){var _0x42dfea=_0x5843f1['user'][_0x999e('0x29')]({'plain':!![]});if(!_0x42dfea)throw new Error(_0x999e('0x4e'));if(_0x42dfea['role']==='user'){var _0x254292=_0x9322ca['get']({'plain':!![]});var _0x5ebc95='Tags';return db[_0x999e('0x4f')][_0x999e('0x4b')]({'where':{'name':_0x5ebc95,'userProfileId':_0x42dfea[_0x999e('0x50')]},'raw':!![]})[_0x999e('0x28')](function(_0x37c3ff){if(_0x37c3ff&&_0x37c3ff[_0x999e('0x51')]===0x0){return db['UserProfileResource'][_0x999e('0x4c')]({'name':_0x254292[_0x999e('0x2c')],'resourceId':_0x254292['id'],'type':_0x37c3ff['name'],'sectionId':_0x37c3ff['id']},{})[_0x999e('0x28')](function(){return _0x9322ca;});}else{return _0x9322ca;}})[_0x999e('0x47')](function(_0x4169eb){logger[_0x999e('0x2b')](_0x999e('0x52'),_0x4169eb);throw _0x4169eb;});}return _0x9322ca;})[_0x999e('0x28')](respondWithResult(_0xa50dc6,0xc9))[_0x999e('0x47')](handleError(_0xa50dc6,null));};exports[_0x999e('0x53')]=function(_0x290c7a,_0x53932a){if(_0x290c7a[_0x999e('0x4d')]['id']){delete _0x290c7a[_0x999e('0x4d')]['id'];}return db[_0x999e('0x30')][_0x999e('0x4b')]({'where':{'id':_0x290c7a['params']['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x53932a,null))[_0x999e('0x28')](saveUpdates(_0x290c7a[_0x999e('0x4d')],null))[_0x999e('0x28')](respondWithResult(_0x53932a,null))[_0x999e('0x47')](handleError(_0x53932a,null));};exports[_0x999e('0x27')]=function(_0x3f5790,_0x1a6925){return db['Tag']['find']({'where':{'id':_0x3f5790[_0x999e('0x49')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x1a6925,null))[_0x999e('0x28')](removeEntity(_0x1a6925,null))[_0x999e('0x47')](handleError(_0x1a6925,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7326e1e..1ec7603 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 _0x9585=['Tag','tools_tags','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define'];(function(_0xbac765,_0x4ad98d){var _0x1729dc=function(_0x476951){while(--_0x476951){_0xbac765['push'](_0xbac765['shift']());}};_0x1729dc(++_0x4ad98d);}(_0x9585,0x15e));var _0x5958=function(_0xfb105e,_0x2bcebb){_0xfb105e=_0xfb105e-0x0;var _0x53a0e2=_0x9585[_0xfb105e];return _0x53a0e2;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require('../../config/logger')(_0x5958('0x1'));var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var fs=require('fs');var path=require(_0x5958('0x5'));var rimraf=require(_0x5958('0x6'));var config=require(_0x5958('0x7'));var attributes=require(_0x5958('0x8'));module['exports']=function(_0x202d6f,_0x48ddaf){return _0x202d6f[_0x5958('0x9')](_0x5958('0xa'),attributes,{'tableName':_0x5958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea0e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./tag.attributes','Tag','tools_tags'];(function(_0x543950,_0x890352){var _0x2a0444=function(_0x4c3ca7){while(--_0x4c3ca7){_0x543950['push'](_0x543950['shift']());}};_0x2a0444(++_0x890352);}(_0xea0e,0xa2));var _0xeea0=function(_0x51437e,_0x56dd5e){_0x51437e=_0x51437e-0x0;var _0x515fe0=_0xea0e[_0x51437e];return _0x515fe0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeea0('0x0'))(_0xeea0('0x1'));var moment=require(_0xeea0('0x2'));var BPromise=require(_0xeea0('0x3'));var rp=require(_0xeea0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeea0('0x5'));var config=require('../../config/environment');var attributes=require(_0xeea0('0x6'));module['exports']=function(_0x389e93,_0x3392e8){return _0x389e93['define'](_0xeea0('0x7'),attributes,{'tableName':_0xeea0('0x8'),'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 7d986d8..0dd1611 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 _0xaf80=['result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x548377,_0x10b588){var _0x218e9e=function(_0x485378){while(--_0x485378){_0x548377['push'](_0x548377['shift']());}};_0x218e9e(++_0x10b588);}(_0xaf80,0x1ef));var _0x0af8=function(_0x15ec25,_0x38e6cf){_0x15ec25=_0x15ec25-0x0;var _0x5309d0=_0xaf80[_0x15ec25];return _0x5309d0;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Tag,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});} \ No newline at end of file +var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x2dfff5,_0x51794e){var _0x5c6434=function(_0x5503f4){while(--_0x5503f4){_0x2dfff5['push'](_0x2dfff5['shift']());}};_0x5c6434(++_0x51794e);}(_0x54f3,0x120));var _0x354f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x54f3[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('Tag,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index d14880a..6a71a3b 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 10ef15f..2605f71 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7e7[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3efdb1,_0x5a5508){var _0x26cdae=function(_0x503f80){while(--_0x503f80){_0x3efdb1['push'](_0x3efdb1['shift']());}};_0x26cdae(++_0x5a5508);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 937dd30..082651f 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 _0xa1a5=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','count','status','Content-Range','json','apply','reject','save','then','error','name','index','map','Team','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','role','user','get','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','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','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','ValidationError','Unknown\x20channel','pick','capitalize','toLowerCase','addQueues','isValidChannel','add','Queues','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','User','Queue','findOrCreate','emit','Queue:save','QueueId','online','interface','UserVoiceQueueRt','isNil','SIP/%s','voicePause','all','upsert','spread','removeAgents','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x440ea5,_0x48a1b6){var _0x226976=function(_0x214bd3){while(--_0x214bd3){_0x440ea5['push'](_0x440ea5['shift']());}};_0x226976(++_0x48a1b6);}(_0xa1a5,0x1d4));var _0x5a1a=function(_0x4ec57a,_0x54dea8){_0x4ec57a=_0x4ec57a-0x0;var _0x205c3e=_0xa1a5[_0x4ec57a];return _0x205c3e;};'use strict';var emlformat=require(_0x5a1a('0x0'));var rimraf=require(_0x5a1a('0x1'));var zipdir=require(_0x5a1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a1a('0x3'));var moment=require(_0x5a1a('0x4'));var BPromise=require(_0x5a1a('0x5'));var Mustache=require(_0x5a1a('0x6'));var util=require(_0x5a1a('0x7'));var path=require(_0x5a1a('0x8'));var sox=require(_0x5a1a('0x9'));var csv=require(_0x5a1a('0xa'));var ejs=require(_0x5a1a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a1a('0xc'));var squel=require(_0x5a1a('0xd'));var crypto=require(_0x5a1a('0xe'));var jsforce=require(_0x5a1a('0xf'));var deskjs=require(_0x5a1a('0x10'));var toCsv=require(_0x5a1a('0xa'));var querystring=require('querystring');var Papa=require(_0x5a1a('0x11'));var Redis=require(_0x5a1a('0x12'));var authService=require(_0x5a1a('0x13'));var qs=require(_0x5a1a('0x14'));var as=require(_0x5a1a('0x15'));var hardwareService=require(_0x5a1a('0x16'));var logger=require('../../config/logger')(_0x5a1a('0x17'));var utils=require('../../config/utils');var config=require(_0x5a1a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a1a('0x19'))['db'];config['redis']=_[_0x5a1a('0x1a')](config[_0x5a1a('0x1b')],{'host':_0x5a1a('0x1c'),'port':0x18eb});var socket=require(_0x5a1a('0x1d'))(new Redis(config[_0x5a1a('0x1b')]));require('./team.socket')[_0x5a1a('0x1e')](socket);function respondWithStatusCode(_0x5d969f,_0xa5b7bd){_0xa5b7bd=_0xa5b7bd||0xcc;return function(_0x10d59c){if(_0x10d59c){return _0x5d969f[_0x5a1a('0x1f')](_0xa5b7bd);}return _0x5d969f['status'](_0xa5b7bd)[_0x5a1a('0x20')]();};}function respondWithResult(_0x431050,_0x3fda7d){_0x3fda7d=_0x3fda7d||0xc8;return function(_0x3b1cd4){if(_0x3b1cd4){return _0x431050['status'](_0x3fda7d)['json'](_0x3b1cd4);}};}function respondWithFilteredResult(_0x38ff55,_0x971399){return function(_0x29b6c9){if(_0x29b6c9){var _0x380641=typeof _0x971399[_0x5a1a('0x21')]===_0x5a1a('0x22')&&typeof _0x971399['limit']===_0x5a1a('0x22');var _0x6be8a=_0x29b6c9[_0x5a1a('0x23')];var _0x15571e=_0x380641?0x0:_0x971399['offset'];var _0x3cc895=_0x380641?_0x29b6c9['count']:_0x971399[_0x5a1a('0x21')]+_0x971399['limit'];var _0x3e657e;if(_0x3cc895>=_0x6be8a){_0x3cc895=_0x6be8a;_0x3e657e=0xc8;}else{_0x3e657e=0xce;}_0x38ff55[_0x5a1a('0x24')](_0x3e657e);return _0x38ff55['set'](_0x5a1a('0x25'),_0x15571e+'-'+_0x3cc895+'/'+_0x6be8a)[_0x5a1a('0x26')](_0x29b6c9);}return null;};}function patchUpdates(_0x842263){return function(_0x27b5ba){try{jsonpatch[_0x5a1a('0x27')](_0x27b5ba,_0x842263,!![]);}catch(_0x5d18e7){return BPromise[_0x5a1a('0x28')](_0x5d18e7);}return _0x27b5ba[_0x5a1a('0x29')]();};}function saveUpdates(_0x222ef4,_0x1415cb){return function(_0xf3c550){if(_0xf3c550){return _0xf3c550['update'](_0x222ef4)[_0x5a1a('0x2a')](function(_0x4e1335){return _0x4e1335;});}return null;};}function handleEntityNotFound(_0x5ca937,_0x39523c){return function(_0x274c6c){if(!_0x274c6c){_0x5ca937[_0x5a1a('0x1f')](0x194);}return _0x274c6c;};}function handleError(_0xd0a7d8,_0x54de1f){_0x54de1f=_0x54de1f||0x1f4;return function(_0x3f4da3){logger[_0x5a1a('0x2b')](_0x3f4da3['stack']);if(_0x3f4da3[_0x5a1a('0x2c')]){delete _0x3f4da3['name'];}_0xd0a7d8[_0x5a1a('0x24')](_0x54de1f)['send'](_0x3f4da3);};}exports[_0x5a1a('0x2d')]=function(_0x3b4d6d,_0x5a7808){var _0x60b4bb={},_0x12d379={},_0x4d22e9={'count':0x0,'rows':[]};var _0x46a436=_[_0x5a1a('0x2e')](db[_0x5a1a('0x2f')][_0x5a1a('0x30')],function(_0xa09407){return{'name':_0xa09407['fieldName'],'type':_0xa09407[_0x5a1a('0x31')][_0x5a1a('0x32')]};});_0x12d379[_0x5a1a('0x33')]=_[_0x5a1a('0x2e')](_0x46a436,_0x5a1a('0x2c'));_0x12d379[_0x5a1a('0x34')]=_[_0x5a1a('0x35')](_0x3b4d6d[_0x5a1a('0x34')]);_0x12d379['filters']=_[_0x5a1a('0x36')](_0x12d379[_0x5a1a('0x33')],_0x12d379['query']);_0x60b4bb[_0x5a1a('0x37')]=_[_0x5a1a('0x36')](_0x12d379[_0x5a1a('0x33')],qs[_0x5a1a('0x38')](_0x3b4d6d[_0x5a1a('0x34')][_0x5a1a('0x38')]));_0x60b4bb[_0x5a1a('0x37')]=_0x60b4bb['attributes'][_0x5a1a('0x39')]?_0x60b4bb[_0x5a1a('0x37')]:_0x12d379[_0x5a1a('0x33')];if(!_0x3b4d6d['query']['hasOwnProperty'](_0x5a1a('0x3a'))){_0x60b4bb[_0x5a1a('0x3b')]=qs['limit'](_0x3b4d6d[_0x5a1a('0x34')]['limit']);_0x60b4bb[_0x5a1a('0x21')]=qs[_0x5a1a('0x21')](_0x3b4d6d[_0x5a1a('0x34')][_0x5a1a('0x21')]);}_0x60b4bb[_0x5a1a('0x3c')]=qs['sort'](_0x3b4d6d[_0x5a1a('0x34')][_0x5a1a('0x3d')]);_0x60b4bb[_0x5a1a('0x3e')]=qs[_0x5a1a('0x3f')](_['pick'](_0x3b4d6d[_0x5a1a('0x34')],_0x12d379[_0x5a1a('0x3f')]),_0x46a436);if(_0x3b4d6d['query']['filter']){_0x60b4bb[_0x5a1a('0x3e')]=_[_0x5a1a('0x40')](_0x60b4bb[_0x5a1a('0x3e')],{'$or':_[_0x5a1a('0x2e')](_0x46a436,function(_0x4f2d78){if(_0x4f2d78[_0x5a1a('0x31')]!==_0x5a1a('0x41')){var _0x5b8ed0={};_0x5b8ed0[_0x4f2d78['name']]={'$like':'%'+_0x3b4d6d[_0x5a1a('0x34')][_0x5a1a('0x42')]+'%'};return _0x5b8ed0;}})});}_0x60b4bb=_[_0x5a1a('0x40')]({},_0x60b4bb,_0x3b4d6d[_0x5a1a('0x43')]);var _0x70ffd3={'where':_0x60b4bb[_0x5a1a('0x3e')]};return db['Team']['count'](_0x70ffd3)[_0x5a1a('0x2a')](function(_0xe22f52){_0x4d22e9[_0x5a1a('0x23')]=_0xe22f52;if(_0x3b4d6d['query'][_0x5a1a('0x44')]){_0x60b4bb[_0x5a1a('0x45')]=[{'all':!![]}];}return db[_0x5a1a('0x2f')][_0x5a1a('0x46')](_0x60b4bb);})[_0x5a1a('0x2a')](function(_0x26dfde){_0x4d22e9[_0x5a1a('0x47')]=_0x26dfde;return _0x4d22e9;})[_0x5a1a('0x2a')](respondWithFilteredResult(_0x5a7808,_0x60b4bb))[_0x5a1a('0x48')](handleError(_0x5a7808,null));};exports[_0x5a1a('0x49')]=function(_0x33973a,_0x3b1796){var _0x5a7758={'raw':![],'where':{'id':_0x33973a[_0x5a1a('0x4a')]['id']}},_0x2d7cbb={};_0x2d7cbb[_0x5a1a('0x33')]=_[_0x5a1a('0x35')](db[_0x5a1a('0x2f')][_0x5a1a('0x30')]);_0x2d7cbb['query']=_['keys'](_0x33973a['query']);_0x2d7cbb['filters']=_[_0x5a1a('0x36')](_0x2d7cbb[_0x5a1a('0x33')],_0x2d7cbb['query']);_0x5a7758[_0x5a1a('0x37')]=_[_0x5a1a('0x36')](_0x2d7cbb['model'],qs[_0x5a1a('0x38')](_0x33973a[_0x5a1a('0x34')][_0x5a1a('0x38')]));_0x5a7758['attributes']=_0x5a7758[_0x5a1a('0x37')]['length']?_0x5a7758[_0x5a1a('0x37')]:_0x2d7cbb[_0x5a1a('0x33')];if(_0x33973a['query']['includeAll']){_0x5a7758['include']=[{'all':!![]}];}_0x5a7758=_[_0x5a1a('0x40')]({},_0x5a7758,_0x33973a[_0x5a1a('0x43')]);return db['Team']['find'](_0x5a7758)[_0x5a1a('0x2a')](handleEntityNotFound(_0x3b1796,null))['then'](respondWithResult(_0x3b1796,null))[_0x5a1a('0x48')](handleError(_0x3b1796,null));};exports[_0x5a1a('0x4b')]=function(_0xd87e13,_0x3095db){return db[_0x5a1a('0x2f')][_0x5a1a('0x4b')](_0xd87e13['body'],{})[_0x5a1a('0x2a')](function(_0x5b9cbc){var _0x1d0567=_0xd87e13['user']['get']({'plain':!![]});if(!_0x1d0567)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d0567[_0x5a1a('0x4c')]===_0x5a1a('0x4d')){var _0xade24a=_0x5b9cbc[_0x5a1a('0x4e')]({'plain':!![]});var _0x2ec659=_0x5a1a('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x2ec659,'userProfileId':_0x1d0567[_0x5a1a('0x50')]},'raw':!![]})['then'](function(_0x1573f7){if(_0x1573f7&&_0x1573f7['autoAssociation']===0x0){return db[_0x5a1a('0x51')][_0x5a1a('0x4b')]({'name':_0xade24a['name'],'resourceId':_0xade24a['id'],'type':_0x1573f7[_0x5a1a('0x2c')],'sectionId':_0x1573f7['id']},{})[_0x5a1a('0x2a')](function(){return _0x5b9cbc;});}else{return _0x5b9cbc;}})[_0x5a1a('0x48')](function(_0x1869f0){logger['error'](_0x5a1a('0x52'),_0x1869f0);throw _0x1869f0;});}return _0x5b9cbc;})['then'](respondWithResult(_0x3095db,0xc9))['catch'](handleError(_0x3095db,null));};exports[_0x5a1a('0x53')]=function(_0x415b90,_0xae478a){if(_0x415b90[_0x5a1a('0x54')]['id']){delete _0x415b90[_0x5a1a('0x54')]['id'];}return db[_0x5a1a('0x2f')][_0x5a1a('0x55')]({'where':{'id':_0x415b90[_0x5a1a('0x4a')]['id']}})[_0x5a1a('0x2a')](handleEntityNotFound(_0xae478a,null))[_0x5a1a('0x2a')](saveUpdates(_0x415b90[_0x5a1a('0x54')],null))['then'](respondWithResult(_0xae478a,null))[_0x5a1a('0x48')](handleError(_0xae478a,null));};exports[_0x5a1a('0x56')]=function(_0x2b2cea,_0x599c73){var _0x4346ec=_0x2b2cea[_0x5a1a('0x4a')]['id'];var _0x2cdfbb=[];return db['sequelize'][_0x5a1a('0x57')](function(_0x221d11){var _0xebef93=_0x5a1a('0x58')+_0x4346ec;return db[_0x5a1a('0x59')]['query'](_0xebef93,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x221d11})[_0x5a1a('0x2a')](function(_0x3891fe){_0x2cdfbb=_[_0x5a1a('0x2e')](_0x3891fe,function(_0x5883a3){return Number(_0x5883a3[_0x5a1a('0x5c')]);});})['then'](function(){var _0x243052=_0x5a1a('0x5d')+_0x4346ec;return db['sequelize']['query'](_0x243052,{'type':db[_0x5a1a('0x5a')]['QueryTypes'][_0x5a1a('0x5e')],'raw':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x538ab9){var _0x48a89c=_[_0x5a1a('0x2e')](_0x538ab9,function(_0x2a299d){return Number(_0x2a299d['VoiceQueueId']);});return db[_0x5a1a('0x5f')][_0x5a1a('0x56')]({'where':{'UserId':{'$in':_0x2cdfbb},'VoiceQueueId':{'$in':_0x48a89c}},'transaction':_0x221d11});})['then'](function(){var _0x448351=_0x5a1a('0x60')+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0x448351,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x287bf7){var _0x141af0=_[_0x5a1a('0x2e')](_0x287bf7,function(_0x2be934){return Number(_0x2be934[_0x5a1a('0x61')]);});return db[_0x5a1a('0x62')][_0x5a1a('0x56')]({'where':{'UserId':{'$in':_0x2cdfbb},'MailQueueId':{'$in':_0x141af0}},'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(){var _0x3c8c9a=_0x5a1a('0x63')+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0x3c8c9a,{'type':db[_0x5a1a('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x5381d9){var _0x2d510f=_[_0x5a1a('0x2e')](_0x5381d9,function(_0x412083){return Number(_0x412083[_0x5a1a('0x64')]);});return db[_0x5a1a('0x65')]['destroy']({'where':{'UserId':{'$in':_0x2cdfbb},'SmsQueueId':{'$in':_0x2d510f}},'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(){var _0x23cd24='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0x23cd24,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')][_0x5a1a('0x5e')],'raw':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x3cafe1){var _0x58a721=_[_0x5a1a('0x2e')](_0x3cafe1,function(_0x1190d4){return Number(_0x1190d4[_0x5a1a('0x66')]);});return db['UserChatQueue'][_0x5a1a('0x56')]({'where':{'UserId':{'$in':_0x2cdfbb},'ChatQueueId':{'$in':_0x58a721}},'transaction':_0x221d11});})['then'](function(){var _0x47a7b8=_0x5a1a('0x67')+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0x47a7b8,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x5bd0e6){var _0x23792d=_[_0x5a1a('0x2e')](_0x5bd0e6,function(_0x521d71){return Number(_0x521d71[_0x5a1a('0x68')]);});return db[_0x5a1a('0x69')]['destroy']({'where':{'UserId':{'$in':_0x2cdfbb},'FaxQueueId':{'$in':_0x23792d}},'transaction':_0x221d11});})['then'](function(){var _0x5c41ad=_0x5a1a('0x6a')+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0x5c41ad,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')][_0x5a1a('0x5e')],'raw':!![],'transaction':_0x221d11});})['then'](function(_0x5aea1c){var _0x3868bd=_[_0x5a1a('0x2e')](_0x5aea1c,function(_0x96f5db){return Number(_0x96f5db[_0x5a1a('0x6b')]);});return db[_0x5a1a('0x6c')][_0x5a1a('0x56')]({'where':{'UserId':{'$in':_0x2cdfbb},'OpenchannelQueueId':{'$in':_0x3868bd}},'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(){var _0xef8a35=_0x5a1a('0x6d')+_0x4346ec;return db[_0x5a1a('0x59')][_0x5a1a('0x34')](_0xef8a35,{'type':db[_0x5a1a('0x5a')][_0x5a1a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x221d11});})['then'](function(_0x57ee8d){var _0x1438a9=_[_0x5a1a('0x2e')](_0x57ee8d,function(_0x56b7f8){return Number(_0x56b7f8['WhatsappQueueId']);});return db[_0x5a1a('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x2cdfbb},'WhatsappQueueId':{'$in':_0x1438a9}},'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(){return db['TeamVoicePrefix'][_0x5a1a('0x55')]({'where':{'TeamId':_0x4346ec}});})[_0x5a1a('0x2a')](function(_0x34b375){if(_0x34b375===null){return;}return db[_0x5a1a('0x6f')][_0x5a1a('0x56')]({'where':{'UserId':{'$in':_0x2cdfbb},'VoicePrefixId':_0x34b375[_0x5a1a('0x70')]},'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(){return db[_0x5a1a('0x2f')]['destroy']({'where':{'id':_0x4346ec},'cascade':!![],'transaction':_0x221d11});})[_0x5a1a('0x2a')](function(_0x2e1cf7){if(_0x2e1cf7===0x0){_0x599c73['sendStatus'](0x194);}else{return db[_0x5a1a('0x51')][_0x5a1a('0x56')]({'where':{'type':_0x5a1a('0x4f'),'resourceId':_0x4346ec},'cascade':!![],'transaction':_0x221d11})[_0x5a1a('0x2a')](function(){_0x599c73[_0x5a1a('0x24')](0xcc)[_0x5a1a('0x20')]();});}})['catch'](function(_0x5d66b7){_0x599c73[_0x5a1a('0x24')](0x1f4)['send'](_0x5d66b7);});});};exports[_0x5a1a('0x71')]=function(_0xaec414,_0x1f1618,_0x15bcf4){return db[_0x5a1a('0x2f')][_0x5a1a('0x72')]({'where':{'id':_0xaec414[_0x5a1a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f1618,null))['then'](function(_0x5cbcf6){if(!_0xaec414[_0x5a1a('0x34')]['channel']||!utils['isValidChannel'](_0xaec414['query'][_0x5a1a('0x73')])){throw new db['Sequelize'][(_0x5a1a('0x74'))](_0x5a1a('0x75'));}var _0x18f569={};var _0x1faacc={};_0x1faacc[_0x5a1a('0x33')]=_[_0x5a1a('0x35')](db[_['capitalize'](_0xaec414[_0x5a1a('0x34')][_0x5a1a('0x73')]['toLowerCase']())+'Queue'][_0x5a1a('0x30')]);_0x1faacc['query']=_['keys'](_0xaec414[_0x5a1a('0x34')]);_0x1faacc['filters']=_[_0x5a1a('0x36')](_0x1faacc[_0x5a1a('0x33')],_0x1faacc[_0x5a1a('0x34')]);_0x18f569[_0x5a1a('0x37')]=_['intersection'](_0x1faacc[_0x5a1a('0x33')],qs[_0x5a1a('0x38')](_0xaec414[_0x5a1a('0x34')][_0x5a1a('0x38')]));_0x18f569[_0x5a1a('0x37')]=_0x18f569['attributes'][_0x5a1a('0x39')]?_0x18f569['attributes']:_0x1faacc[_0x5a1a('0x33')];_0x18f569['limit']=qs[_0x5a1a('0x3b')](_0xaec414[_0x5a1a('0x34')][_0x5a1a('0x3b')]);_0x18f569[_0x5a1a('0x21')]=qs[_0x5a1a('0x21')](_0xaec414[_0x5a1a('0x34')][_0x5a1a('0x21')]);_0x18f569['order']=qs[_0x5a1a('0x3d')](_0xaec414['query'][_0x5a1a('0x3d')]);_0x18f569[_0x5a1a('0x3e')]=qs[_0x5a1a('0x3f')](_[_0x5a1a('0x76')](_0xaec414['query'],_0x1faacc['filters']));_0x18f569=_['merge']({},_0x18f569,_0xaec414['options']);return _0x5cbcf6[_0x5a1a('0x4e')+_[_0x5a1a('0x77')](_0xaec414[_0x5a1a('0x34')][_0x5a1a('0x73')][_0x5a1a('0x78')]())+'Queues'](_0x18f569);})[_0x5a1a('0x2a')](respondWithResult(_0x1f1618,null))[_0x5a1a('0x48')](handleError(_0x1f1618,null));};exports[_0x5a1a('0x79')]=function(_0x5ca5f6,_0x266e5b,_0x332c64){return db[_0x5a1a('0x2f')][_0x5a1a('0x72')]({'where':{'id':_0x5ca5f6[_0x5a1a('0x4a')]['id']}})['then'](function(_0x151fdc){if(_0x151fdc){if(!_0x5ca5f6[_0x5a1a('0x54')][_0x5a1a('0x73')]||!utils[_0x5a1a('0x7a')](_0x5ca5f6[_0x5a1a('0x54')][_0x5a1a('0x73')])){throw new db['Sequelize'][(_0x5a1a('0x74'))]('Unknown\x20channel');}return _0x151fdc[_0x5a1a('0x7b')+_['capitalize'](_0x5ca5f6[_0x5a1a('0x54')][_0x5a1a('0x73')][_0x5a1a('0x78')]())+_0x5a1a('0x7c')](_0x5ca5f6[_0x5a1a('0x54')]['ids']);}return null;})[_0x5a1a('0x2a')](handleEntityNotFound(_0x266e5b,null))[_0x5a1a('0x2a')](respondWithStatusCode(_0x266e5b,null))[_0x5a1a('0x48')](handleError(_0x266e5b,null));};exports[_0x5a1a('0x7d')]=function(_0x4bc446,_0x5cc3e4,_0x4b3c4c){return db['Team'][_0x5a1a('0x72')]({'where':{'id':_0x4bc446[_0x5a1a('0x4a')]['id']}})['then'](function(_0x577b4d){if(_0x577b4d){if(!_0x4bc446[_0x5a1a('0x34')]['channel']||!utils['isValidChannel'](_0x4bc446[_0x5a1a('0x34')][_0x5a1a('0x73')])){throw new db[(_0x5a1a('0x5a'))]['ValidationError'](_0x5a1a('0x75'));}return _0x577b4d[_0x5a1a('0x7e')+_[_0x5a1a('0x77')](_0x4bc446[_0x5a1a('0x34')]['channel']['toLowerCase']())+_0x5a1a('0x7c')](_0x4bc446[_0x5a1a('0x34')][_0x5a1a('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x5cc3e4,null))[_0x5a1a('0x2a')](respondWithStatusCode(_0x5cc3e4,null))[_0x5a1a('0x48')](handleError(_0x5cc3e4,null));};exports[_0x5a1a('0x80')]=function(_0x35bba9,_0x416686){var _0x36e313=_[_0x5a1a('0x81')](_0x35bba9[_0x5a1a('0x54')][_0x5a1a('0x7f')])?_0x35bba9[_0x5a1a('0x54')][_0x5a1a('0x7f')]:[_0x35bba9[_0x5a1a('0x54')][_0x5a1a('0x7f')]];var _0x8d839b=_0x35bba9[_0x5a1a('0x4a')]['id'];return db[_0x5a1a('0x2f')]['find']({'where':{'id':_0x8d839b}})['then'](handleEntityNotFound(_0x416686,null))[_0x5a1a('0x2a')](function(_0x118d7d){if(_0x118d7d){var _0x1882f3=[_0x5a1a('0x82'),_0x5a1a('0x83'),_0x5a1a('0x84'),_0x5a1a('0x85'),_0x5a1a('0x86'),_0x5a1a('0x87'),_0x5a1a('0x88')];return db['sequelize']['transaction'](function(_0x214eba){var _0x496023=_['map'](_0x1882f3,function(_0x390aad){var _0x3e2578={'attributes':['id',_0x5a1a('0x2c')]};if(_0x390aad===_0x5a1a('0x82')){_0x3e2578[_0x5a1a('0x89')]={'attributes':['penalty']};}return _0x118d7d['get'+_0x390aad+'Queues'](_0x3e2578)[_0x5a1a('0x2a')](function(_0x53edb1){var _0x1edaf3=_['map'](_0x53edb1,function(_0x294eb0){var _0x5d1b8a=_[_0x5a1a('0x2e')](_0x36e313,function(_0x5c1947){var _0x259221={'where':{'UserId':_0x5c1947,[_0x390aad+'QueueId']:_0x294eb0['id']},'transaction':_0x214eba};if(_0x390aad===_0x5a1a('0x82')){_0x259221[_0x5a1a('0x1a')]={'penalty':_0x294eb0['TeamVoiceQueue'][_0x5a1a('0x8a')]};}return db[_0x5a1a('0x8b')+_0x390aad+_0x5a1a('0x8c')][_0x5a1a('0x8d')](_0x259221)[_0x5a1a('0x2a')](function(){socket[_0x5a1a('0x8e')](_0x5a1a('0x4d')+_0x390aad+_0x5a1a('0x8f'),{'UserId':_0x5c1947,[_0x390aad+_0x5a1a('0x90')]:_0x294eb0['id']});if(_0x390aad!==_0x5a1a('0x82')){return;}return db[_0x5a1a('0x8b')]['findAll']({'where':{'id':_0x36e313,'online':0x1},'attributes':['id','name',_0x5a1a('0x91'),'voicePause',_0x5a1a('0x92')],'raw':!![]})[_0x5a1a('0x2a')](function(_0x102d58){var _0x2764da=_[_0x5a1a('0x2e')](_0x102d58,function(_0x8c0520){return db[_0x5a1a('0x93')]['upsert']({'membername':_0x8c0520[_0x5a1a('0x2c')],'UserId':_0x8c0520['id'],'queue_name':_0x294eb0['name'],'VoiceQueueId':_0x294eb0['id'],'interface':_[_0x5a1a('0x94')](_0x8c0520['interface'])?util['format'](_0x5a1a('0x95'),_0x8c0520[_0x5a1a('0x2c')]):_0x8c0520['interface'],'paused':_0x8c0520[_0x5a1a('0x96')]||![],'penalty':_0x294eb0['TeamVoiceQueue']['penalty']},{'transaction':_0x214eba});});return Promise[_0x5a1a('0x97')](_0x2764da);});});});return Promise[_0x5a1a('0x97')](_0x5d1b8a);});return Promise[_0x5a1a('0x97')](_0x1edaf3);})[_0x5a1a('0x2a')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x8d839b}})['then'](function(_0x48726a){if(_0x48726a){var _0x285fb0=_[_0x5a1a('0x2e')](_0x36e313,function(_0x1fcd4c){db[_0x5a1a('0x6f')][_0x5a1a('0x98')]({'UserId':_0x1fcd4c,'VoicePrefixId':_0x48726a['VoicePrefixId']});});return Promise[_0x5a1a('0x97')](_0x285fb0);}});});});return Promise[_0x5a1a('0x97')](_0x496023)[_0x5a1a('0x2a')](function(){return _0x118d7d[_0x5a1a('0x80')](_0x36e313,{'transaction':_0x214eba})[_0x5a1a('0x99')](function(_0x3a427f){return _0x3a427f;});});});}})['then'](respondWithResult(_0x416686,null))[_0x5a1a('0x48')](handleError(_0x416686,null));};exports[_0x5a1a('0x9a')]=function(_0xd1056,_0x29a16f){var _0x1b1c80=_['isArray'](_0xd1056[_0x5a1a('0x34')][_0x5a1a('0x7f')])?_0xd1056['query'][_0x5a1a('0x7f')]:[_0xd1056[_0x5a1a('0x34')][_0x5a1a('0x7f')]];var _0x1fcd52=_0xd1056[_0x5a1a('0x4a')]['id'];return db[_0x5a1a('0x2f')][_0x5a1a('0x55')]({'where':{'id':_0x1fcd52}})['then'](handleEntityNotFound(_0x29a16f,null))[_0x5a1a('0x2a')](function(_0x388e45){if(_0x388e45){var _0x253c1e=['Voice',_0x5a1a('0x83'),_0x5a1a('0x84'),_0x5a1a('0x85'),_0x5a1a('0x86'),_0x5a1a('0x87'),_0x5a1a('0x88')];return db[_0x5a1a('0x59')]['transaction'](function(_0x43ac31){var _0x544980=_['map'](_0x253c1e,function(_0x162bc0){var _0x29e92e={'attributes':['id',_0x5a1a('0x2c')]};return _0x388e45['get'+_0x162bc0+'Queues'](_0x29e92e)[_0x5a1a('0x2a')](function(_0x43efe2){var _0x40a05a=_['map'](_0x43efe2,function(_0x12fb60){return _0x12fb60['removeAgents'](_0x1b1c80,{'transaction':_0x43ac31})[_0x5a1a('0x2a')](function(){var _0x35af7f=_['map'](_0x1b1c80,function(_0x558b95){socket[_0x5a1a('0x8e')]('user'+_0x162bc0+_0x5a1a('0x9b'),{'UserId':Number(_0x558b95),[_0x162bc0+_0x5a1a('0x90')]:_0x12fb60['id']});if(_0x162bc0!==_0x5a1a('0x82')){return;}return db[_0x5a1a('0x93')]['destroy']({'where':{'VoiceQueueId':_0x12fb60['id'],'UserId':_0x558b95},'transaction':_0x43ac31});});return Promise[_0x5a1a('0x97')](_0x35af7f);});});return Promise[_0x5a1a('0x97')](_0x40a05a);});});return Promise[_0x5a1a('0x97')](_0x544980)[_0x5a1a('0x2a')](function(){return _0x388e45[_0x5a1a('0x9a')](_0x1b1c80,{'transaction':_0x43ac31});})['then'](function(){return db['TeamVoicePrefix'][_0x5a1a('0x72')]({'where':{'teamId':_0x1fcd52}})[_0x5a1a('0x2a')](function(_0x1a94c5){if(_0x1a94c5){var _0xbe7d2b=_['map'](_0x1b1c80,function(_0x4c68c2){db[_0x5a1a('0x6f')]['destroy']({'where':{'UserId':_0x4c68c2,'VoicePrefixId':_0x1a94c5['VoicePrefixId']}});});return Promise[_0x5a1a('0x97')](_0xbe7d2b);}});});});}})['then'](respondWithStatusCode(_0x29a16f,null))[_0x5a1a('0x48')](handleError(_0x29a16f,null));};exports[_0x5a1a('0x9c')]=function(_0x5383b0,_0x258be0,_0x1a31ff){var _0x3ddd8f={};var _0x3496cd={};var _0x446b80;var _0x3b33ae;return db[_0x5a1a('0x2f')][_0x5a1a('0x72')]({'where':{'id':_0x5383b0[_0x5a1a('0x4a')]['id']}})[_0x5a1a('0x2a')](handleEntityNotFound(_0x258be0,null))[_0x5a1a('0x2a')](function(_0x4fb62d){if(_0x4fb62d){_0x446b80=_0x4fb62d;_0x3496cd[_0x5a1a('0x33')]=_['keys'](db['User'][_0x5a1a('0x30')]);_0x3496cd[_0x5a1a('0x34')]=_[_0x5a1a('0x35')](_0x5383b0[_0x5a1a('0x34')]);_0x3496cd['filters']=_[_0x5a1a('0x36')](_0x3496cd[_0x5a1a('0x33')],_0x3496cd[_0x5a1a('0x34')]);_0x3ddd8f['attributes']=_[_0x5a1a('0x36')](_0x3496cd[_0x5a1a('0x33')],qs[_0x5a1a('0x38')](_0x5383b0[_0x5a1a('0x34')]['fields']));_0x3ddd8f['attributes']=_0x3ddd8f[_0x5a1a('0x37')][_0x5a1a('0x39')]?_0x3ddd8f[_0x5a1a('0x37')]:_0x3496cd['model'];_0x3ddd8f[_0x5a1a('0x3c')]=qs[_0x5a1a('0x3d')](_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x3d')]);_0x3ddd8f[_0x5a1a('0x3e')]=qs[_0x5a1a('0x3f')](_[_0x5a1a('0x76')](_0x5383b0['query'],_0x3496cd[_0x5a1a('0x3f')]));if(_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x42')]){_0x3ddd8f[_0x5a1a('0x3e')]=_['merge'](_0x3ddd8f['where'],{'$or':_['map'](_0x3ddd8f[_0x5a1a('0x37')],function(_0x382c68){var _0x2913f2={};_0x2913f2[_0x382c68]={'$like':'%'+_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x42')]+'%'};return _0x2913f2;})});}_0x3ddd8f=_[_0x5a1a('0x40')]({},_0x3ddd8f,_0x5383b0[_0x5a1a('0x43')]);return _0x446b80['getAgents'](_0x3ddd8f);}})[_0x5a1a('0x2a')](function(_0x4f9043){if(_0x4f9043){_0x3b33ae=_0x4f9043['length'];if(!_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x9d')](_0x5a1a('0x3a'))){_0x3ddd8f['limit']=qs[_0x5a1a('0x3b')](_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x3b')]);_0x3ddd8f['offset']=qs[_0x5a1a('0x21')](_0x5383b0[_0x5a1a('0x34')][_0x5a1a('0x21')]);}return _0x446b80[_0x5a1a('0x9c')](_0x3ddd8f);}})[_0x5a1a('0x2a')](function(_0x41ba2e){if(_0x41ba2e){return _0x41ba2e?{'count':_0x3b33ae,'rows':_0x41ba2e}:null;}})[_0x5a1a('0x2a')](respondWithResult(_0x258be0,null))['catch'](handleError(_0x258be0,null));}; \ No newline at end of file +var _0x6c50=['pick','filter','where','merge','options','includeAll','rows','params','keys','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','VoiceQueueId','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','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','findOne','add','removeQueues','ValidationError','remove','ids','addAgents','isArray','Chat','Sms','Fax','Openchannel','Whatsapp','Voice','through','QueueId','defaults','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','User','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','upsert','spread','removeAgents','Mail','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x9b5da6,_0x3e119c){var _0x4328e9=function(_0x142f17){while(--_0x142f17){_0x9b5da6['push'](_0x9b5da6['shift']());}};_0x4328e9(++_0x3e119c);}(_0x6c50,0x1a4));var _0x06c5=function(_0x1d5cc1,_0x2bfc1a){_0x1d5cc1=_0x1d5cc1-0x0;var _0x38705e=_0x6c50[_0x1d5cc1];return _0x38705e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06c5('0x0'));var zipdir=require(_0x06c5('0x1'));var jsonpatch=require(_0x06c5('0x2'));var rp=require(_0x06c5('0x3'));var moment=require(_0x06c5('0x4'));var BPromise=require(_0x06c5('0x5'));var Mustache=require(_0x06c5('0x6'));var util=require('util');var path=require(_0x06c5('0x7'));var sox=require(_0x06c5('0x8'));var csv=require('to-csv');var ejs=require(_0x06c5('0x9'));var fs=require('fs');var fs_extra=require(_0x06c5('0xa'));var _=require(_0x06c5('0xb'));var squel=require(_0x06c5('0xc'));var crypto=require(_0x06c5('0xd'));var jsforce=require(_0x06c5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x06c5('0xf'));var querystring=require(_0x06c5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06c5('0x11'));var qs=require(_0x06c5('0x12'));var as=require(_0x06c5('0x13'));var hardwareService=require(_0x06c5('0x14'));var logger=require('../../config/logger')(_0x06c5('0x15'));var utils=require(_0x06c5('0x16'));var config=require(_0x06c5('0x17'));var licenseUtil=require(_0x06c5('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x06c5('0x19')],{'host':_0x06c5('0x1a'),'port':0x18eb});var socket=require(_0x06c5('0x1b'))(new Redis(config[_0x06c5('0x19')]));require('./team.socket')[_0x06c5('0x1c')](socket);function respondWithStatusCode(_0x1064bb,_0x1e8e09){_0x1e8e09=_0x1e8e09||0xcc;return function(_0x5e0490){if(_0x5e0490){return _0x1064bb[_0x06c5('0x1d')](_0x1e8e09);}return _0x1064bb[_0x06c5('0x1e')](_0x1e8e09)[_0x06c5('0x1f')]();};}function respondWithResult(_0xa17308,_0x328cb0){_0x328cb0=_0x328cb0||0xc8;return function(_0x3ddc97){if(_0x3ddc97){return _0xa17308[_0x06c5('0x1e')](_0x328cb0)[_0x06c5('0x20')](_0x3ddc97);}};}function respondWithFilteredResult(_0x34bc88,_0x4ffa60){return function(_0x4452c5){if(_0x4452c5){var _0x149480=typeof _0x4ffa60[_0x06c5('0x21')]===_0x06c5('0x22')&&typeof _0x4ffa60[_0x06c5('0x23')]===_0x06c5('0x22');var _0x233c15=_0x4452c5['count'];var _0x1dec69=_0x149480?0x0:_0x4ffa60[_0x06c5('0x21')];var _0x50c976=_0x149480?_0x4452c5[_0x06c5('0x24')]:_0x4ffa60[_0x06c5('0x21')]+_0x4ffa60[_0x06c5('0x23')];var _0x1ec57c;if(_0x50c976>=_0x233c15){_0x50c976=_0x233c15;_0x1ec57c=0xc8;}else{_0x1ec57c=0xce;}_0x34bc88[_0x06c5('0x1e')](_0x1ec57c);return _0x34bc88[_0x06c5('0x25')](_0x06c5('0x26'),_0x1dec69+'-'+_0x50c976+'/'+_0x233c15)[_0x06c5('0x20')](_0x4452c5);}return null;};}function patchUpdates(_0x25f2ab){return function(_0x28e02c){try{jsonpatch[_0x06c5('0x27')](_0x28e02c,_0x25f2ab,!![]);}catch(_0x3784a0){return BPromise[_0x06c5('0x28')](_0x3784a0);}return _0x28e02c[_0x06c5('0x29')]();};}function saveUpdates(_0x4b14b2,_0x1409cb){return function(_0x4c6aa5){if(_0x4c6aa5){return _0x4c6aa5[_0x06c5('0x2a')](_0x4b14b2)[_0x06c5('0x2b')](function(_0x55c634){return _0x55c634;});}return null;};}function handleEntityNotFound(_0x40b66c,_0x1d0b0a){return function(_0x424366){if(!_0x424366){_0x40b66c['sendStatus'](0x194);}return _0x424366;};}function handleError(_0x14d966,_0x4d2519){_0x4d2519=_0x4d2519||0x1f4;return function(_0x3b2db0){logger[_0x06c5('0x2c')](_0x3b2db0[_0x06c5('0x2d')]);if(_0x3b2db0['name']){delete _0x3b2db0[_0x06c5('0x2e')];}_0x14d966[_0x06c5('0x1e')](_0x4d2519)[_0x06c5('0x2f')](_0x3b2db0);};}exports[_0x06c5('0x30')]=function(_0x469132,_0x584c4a){var _0x4889a5={},_0x53be2f={},_0x18fc56={'count':0x0,'rows':[]};var _0x13dd4f=_[_0x06c5('0x31')](db[_0x06c5('0x32')][_0x06c5('0x33')],function(_0x39aeab){return{'name':_0x39aeab['fieldName'],'type':_0x39aeab['type'][_0x06c5('0x34')]};});_0x53be2f['model']=_[_0x06c5('0x31')](_0x13dd4f,'name');_0x53be2f['query']=_['keys'](_0x469132[_0x06c5('0x35')]);_0x53be2f[_0x06c5('0x36')]=_[_0x06c5('0x37')](_0x53be2f['model'],_0x53be2f[_0x06c5('0x35')]);_0x4889a5[_0x06c5('0x38')]=_[_0x06c5('0x37')](_0x53be2f[_0x06c5('0x39')],qs[_0x06c5('0x3a')](_0x469132[_0x06c5('0x35')]['fields']));_0x4889a5[_0x06c5('0x38')]=_0x4889a5[_0x06c5('0x38')][_0x06c5('0x3b')]?_0x4889a5[_0x06c5('0x38')]:_0x53be2f[_0x06c5('0x39')];if(!_0x469132[_0x06c5('0x35')][_0x06c5('0x3c')](_0x06c5('0x3d'))){_0x4889a5[_0x06c5('0x23')]=qs['limit'](_0x469132[_0x06c5('0x35')]['limit']);_0x4889a5[_0x06c5('0x21')]=qs[_0x06c5('0x21')](_0x469132['query']['offset']);}_0x4889a5['order']=qs[_0x06c5('0x3e')](_0x469132['query'][_0x06c5('0x3e')]);_0x4889a5['where']=qs[_0x06c5('0x36')](_[_0x06c5('0x3f')](_0x469132['query'],_0x53be2f['filters']),_0x13dd4f);if(_0x469132[_0x06c5('0x35')][_0x06c5('0x40')]){_0x4889a5[_0x06c5('0x41')]=_['merge'](_0x4889a5[_0x06c5('0x41')],{'$or':_[_0x06c5('0x31')](_0x13dd4f,function(_0x28920e){if(_0x28920e['type']!=='VIRTUAL'){var _0x42e4ab={};_0x42e4ab[_0x28920e[_0x06c5('0x2e')]]={'$like':'%'+_0x469132[_0x06c5('0x35')][_0x06c5('0x40')]+'%'};return _0x42e4ab;}})});}_0x4889a5=_[_0x06c5('0x42')]({},_0x4889a5,_0x469132[_0x06c5('0x43')]);var _0x1b7c19={'where':_0x4889a5['where']};return db[_0x06c5('0x32')][_0x06c5('0x24')](_0x1b7c19)[_0x06c5('0x2b')](function(_0x1dd3be){_0x18fc56[_0x06c5('0x24')]=_0x1dd3be;if(_0x469132[_0x06c5('0x35')][_0x06c5('0x44')]){_0x4889a5['include']=[{'all':!![]}];}return db['Team']['findAll'](_0x4889a5);})[_0x06c5('0x2b')](function(_0x4a5d50){_0x18fc56[_0x06c5('0x45')]=_0x4a5d50;return _0x18fc56;})['then'](respondWithFilteredResult(_0x584c4a,_0x4889a5))['catch'](handleError(_0x584c4a,null));};exports['show']=function(_0x233bb4,_0x53cf4f){var _0x71b34={'raw':![],'where':{'id':_0x233bb4[_0x06c5('0x46')]['id']}},_0x47698a={};_0x47698a[_0x06c5('0x39')]=_[_0x06c5('0x47')](db[_0x06c5('0x32')][_0x06c5('0x33')]);_0x47698a[_0x06c5('0x35')]=_[_0x06c5('0x47')](_0x233bb4[_0x06c5('0x35')]);_0x47698a['filters']=_[_0x06c5('0x37')](_0x47698a['model'],_0x47698a[_0x06c5('0x35')]);_0x71b34[_0x06c5('0x38')]=_[_0x06c5('0x37')](_0x47698a[_0x06c5('0x39')],qs['fields'](_0x233bb4[_0x06c5('0x35')]['fields']));_0x71b34[_0x06c5('0x38')]=_0x71b34[_0x06c5('0x38')][_0x06c5('0x3b')]?_0x71b34['attributes']:_0x47698a[_0x06c5('0x39')];if(_0x233bb4[_0x06c5('0x35')]['includeAll']){_0x71b34[_0x06c5('0x48')]=[{'all':!![]}];}_0x71b34=_['merge']({},_0x71b34,_0x233bb4[_0x06c5('0x43')]);return db[_0x06c5('0x32')]['find'](_0x71b34)['then'](handleEntityNotFound(_0x53cf4f,null))['then'](respondWithResult(_0x53cf4f,null))['catch'](handleError(_0x53cf4f,null));};exports['create']=function(_0x266cb9,_0x43083b){return db[_0x06c5('0x32')][_0x06c5('0x49')](_0x266cb9[_0x06c5('0x4a')],{})['then'](function(_0x1768b2){var _0x4bf8e9=_0x266cb9[_0x06c5('0x4b')][_0x06c5('0x4c')]({'plain':!![]});if(!_0x4bf8e9)throw new Error(_0x06c5('0x4d'));if(_0x4bf8e9[_0x06c5('0x4e')]==='user'){var _0x2ccecd=_0x1768b2[_0x06c5('0x4c')]({'plain':!![]});var _0x3b732a=_0x06c5('0x4f');return db['UserProfileSection'][_0x06c5('0x50')]({'where':{'name':_0x3b732a,'userProfileId':_0x4bf8e9[_0x06c5('0x51')]},'raw':!![]})['then'](function(_0x27078a){if(_0x27078a&&_0x27078a[_0x06c5('0x52')]===0x0){return db[_0x06c5('0x53')]['create']({'name':_0x2ccecd[_0x06c5('0x2e')],'resourceId':_0x2ccecd['id'],'type':_0x27078a[_0x06c5('0x2e')],'sectionId':_0x27078a['id']},{})['then'](function(){return _0x1768b2;});}else{return _0x1768b2;}})[_0x06c5('0x54')](function(_0x16f6d9){logger['error'](_0x06c5('0x55'),_0x16f6d9);throw _0x16f6d9;});}return _0x1768b2;})[_0x06c5('0x2b')](respondWithResult(_0x43083b,0xc9))['catch'](handleError(_0x43083b,null));};exports['update']=function(_0xe65009,_0x25d011){if(_0xe65009[_0x06c5('0x4a')]['id']){delete _0xe65009[_0x06c5('0x4a')]['id'];}return db[_0x06c5('0x32')]['find']({'where':{'id':_0xe65009[_0x06c5('0x46')]['id']}})[_0x06c5('0x2b')](handleEntityNotFound(_0x25d011,null))[_0x06c5('0x2b')](saveUpdates(_0xe65009['body'],null))[_0x06c5('0x2b')](respondWithResult(_0x25d011,null))['catch'](handleError(_0x25d011,null));};exports[_0x06c5('0x56')]=function(_0x3ac0d0,_0x3c57d7){var _0x3bfab6=_0x3ac0d0[_0x06c5('0x46')]['id'];var _0x23b7ba=[];return db[_0x06c5('0x57')][_0x06c5('0x58')](function(_0x21996c){var _0x4d85a5=_0x06c5('0x59')+_0x3bfab6;return db[_0x06c5('0x57')][_0x06c5('0x35')](_0x4d85a5,{'type':db[_0x06c5('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x21996c})[_0x06c5('0x2b')](function(_0x1ad952){_0x23b7ba=_[_0x06c5('0x31')](_0x1ad952,function(_0x493755){return Number(_0x493755[_0x06c5('0x5b')]);});})['then'](function(){var _0x486b2f=_0x06c5('0x5c')+_0x3bfab6;return db['sequelize'][_0x06c5('0x35')](_0x486b2f,{'type':db[_0x06c5('0x5a')][_0x06c5('0x5d')][_0x06c5('0x5e')],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x2b669b){var _0x5c5bf2=_[_0x06c5('0x31')](_0x2b669b,function(_0x998d94){return Number(_0x998d94[_0x06c5('0x5f')]);});return db['UserVoiceQueue'][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'VoiceQueueId':{'$in':_0x5c5bf2}},'transaction':_0x21996c});})['then'](function(){var _0x530565=_0x06c5('0x60')+_0x3bfab6;return db[_0x06c5('0x57')][_0x06c5('0x35')](_0x530565,{'type':db['Sequelize'][_0x06c5('0x5d')][_0x06c5('0x5e')],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x40c76f){var _0x49ae1d=_[_0x06c5('0x31')](_0x40c76f,function(_0x1d6b66){return Number(_0x1d6b66[_0x06c5('0x61')]);});return db[_0x06c5('0x62')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'MailQueueId':{'$in':_0x49ae1d}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){var _0x4714be=_0x06c5('0x63')+_0x3bfab6;return db['sequelize'][_0x06c5('0x35')](_0x4714be,{'type':db[_0x06c5('0x5a')]['QueryTypes'][_0x06c5('0x5e')],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x2e0183){var _0x1a471d=_[_0x06c5('0x31')](_0x2e0183,function(_0xcca4f0){return Number(_0xcca4f0[_0x06c5('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x23b7ba},'SmsQueueId':{'$in':_0x1a471d}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){var _0x2fb23e='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3bfab6;return db[_0x06c5('0x57')]['query'](_0x2fb23e,{'type':db[_0x06c5('0x5a')][_0x06c5('0x5d')][_0x06c5('0x5e')],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x3129c0){var _0x220ebf=_['map'](_0x3129c0,function(_0x29913c){return Number(_0x29913c[_0x06c5('0x65')]);});return db[_0x06c5('0x66')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'ChatQueueId':{'$in':_0x220ebf}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){var _0x5d4bf3=_0x06c5('0x67')+_0x3bfab6;return db[_0x06c5('0x57')][_0x06c5('0x35')](_0x5d4bf3,{'type':db[_0x06c5('0x5a')]['QueryTypes'][_0x06c5('0x5e')],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x50be32){var _0x1e4cca=_[_0x06c5('0x31')](_0x50be32,function(_0x172d2f){return Number(_0x172d2f[_0x06c5('0x68')]);});return db[_0x06c5('0x69')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'FaxQueueId':{'$in':_0x1e4cca}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){var _0x32ee69=_0x06c5('0x6a')+_0x3bfab6;return db['sequelize'][_0x06c5('0x35')](_0x32ee69,{'type':db[_0x06c5('0x5a')][_0x06c5('0x5d')]['SELECT'],'raw':!![],'transaction':_0x21996c});})[_0x06c5('0x2b')](function(_0x4af58e){var _0xffad20=_[_0x06c5('0x31')](_0x4af58e,function(_0x57b9cb){return Number(_0x57b9cb[_0x06c5('0x6b')]);});return db[_0x06c5('0x6c')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'OpenchannelQueueId':{'$in':_0xffad20}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){var _0x3c37b1=_0x06c5('0x6d')+_0x3bfab6;return db[_0x06c5('0x57')]['query'](_0x3c37b1,{'type':db[_0x06c5('0x5a')][_0x06c5('0x5d')]['SELECT'],'raw':!![],'transaction':_0x21996c});})['then'](function(_0xeea4ff){var _0x3512ab=_[_0x06c5('0x31')](_0xeea4ff,function(_0x2f1305){return Number(_0x2f1305[_0x06c5('0x6e')]);});return db[_0x06c5('0x6f')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'WhatsappQueueId':{'$in':_0x3512ab}},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){return db[_0x06c5('0x70')][_0x06c5('0x50')]({'where':{'TeamId':_0x3bfab6}});})[_0x06c5('0x2b')](function(_0x2a1012){if(_0x2a1012===null){return;}return db[_0x06c5('0x71')][_0x06c5('0x56')]({'where':{'UserId':{'$in':_0x23b7ba},'VoicePrefixId':_0x2a1012['VoicePrefixId']},'transaction':_0x21996c});})[_0x06c5('0x2b')](function(){return db[_0x06c5('0x32')]['destroy']({'where':{'id':_0x3bfab6},'cascade':!![],'transaction':_0x21996c});})['then'](function(_0x123503){if(_0x123503===0x0){_0x3c57d7['sendStatus'](0x194);}else{return db[_0x06c5('0x53')][_0x06c5('0x56')]({'where':{'type':_0x06c5('0x4f'),'resourceId':_0x3bfab6},'cascade':!![],'transaction':_0x21996c})['then'](function(){_0x3c57d7[_0x06c5('0x1e')](0xcc)[_0x06c5('0x1f')]();});}})[_0x06c5('0x54')](function(_0x5a557e){_0x3c57d7[_0x06c5('0x1e')](0x1f4)[_0x06c5('0x2f')](_0x5a557e);});});};exports[_0x06c5('0x72')]=function(_0x3d0e6a,_0x4fe2a3,_0x3e3c3b){return db[_0x06c5('0x32')]['findOne']({'where':{'id':_0x3d0e6a[_0x06c5('0x46')]['id']}})[_0x06c5('0x2b')](handleEntityNotFound(_0x4fe2a3,null))[_0x06c5('0x2b')](function(_0x17e033){if(!_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x73')]||!utils[_0x06c5('0x74')](_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x73')])){throw new db[(_0x06c5('0x5a'))]['ValidationError'](_0x06c5('0x75'));}var _0x149eaf={};var _0x1d61e4={};_0x1d61e4[_0x06c5('0x39')]=_[_0x06c5('0x47')](db[_[_0x06c5('0x76')](_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x73')][_0x06c5('0x77')]())+_0x06c5('0x78')][_0x06c5('0x33')]);_0x1d61e4[_0x06c5('0x35')]=_[_0x06c5('0x47')](_0x3d0e6a['query']);_0x1d61e4['filters']=_['intersection'](_0x1d61e4['model'],_0x1d61e4[_0x06c5('0x35')]);_0x149eaf[_0x06c5('0x38')]=_[_0x06c5('0x37')](_0x1d61e4['model'],qs[_0x06c5('0x3a')](_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x3a')]));_0x149eaf[_0x06c5('0x38')]=_0x149eaf[_0x06c5('0x38')][_0x06c5('0x3b')]?_0x149eaf[_0x06c5('0x38')]:_0x1d61e4['model'];_0x149eaf[_0x06c5('0x23')]=qs[_0x06c5('0x23')](_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x23')]);_0x149eaf[_0x06c5('0x21')]=qs[_0x06c5('0x21')](_0x3d0e6a['query']['offset']);_0x149eaf[_0x06c5('0x79')]=qs[_0x06c5('0x3e')](_0x3d0e6a['query'][_0x06c5('0x3e')]);_0x149eaf[_0x06c5('0x41')]=qs['filters'](_[_0x06c5('0x3f')](_0x3d0e6a[_0x06c5('0x35')],_0x1d61e4['filters']));_0x149eaf=_[_0x06c5('0x42')]({},_0x149eaf,_0x3d0e6a[_0x06c5('0x43')]);return _0x17e033[_0x06c5('0x4c')+_[_0x06c5('0x76')](_0x3d0e6a[_0x06c5('0x35')][_0x06c5('0x73')]['toLowerCase']())+_0x06c5('0x7a')](_0x149eaf);})[_0x06c5('0x2b')](respondWithResult(_0x4fe2a3,null))[_0x06c5('0x54')](handleError(_0x4fe2a3,null));};exports[_0x06c5('0x7b')]=function(_0x1fa7e4,_0xd3271a,_0xb71dc6){return db[_0x06c5('0x32')][_0x06c5('0x7c')]({'where':{'id':_0x1fa7e4[_0x06c5('0x46')]['id']}})[_0x06c5('0x2b')](function(_0x130d89){if(_0x130d89){if(!_0x1fa7e4['body'][_0x06c5('0x73')]||!utils[_0x06c5('0x74')](_0x1fa7e4[_0x06c5('0x4a')][_0x06c5('0x73')])){throw new db[(_0x06c5('0x5a'))]['ValidationError'](_0x06c5('0x75'));}return _0x130d89[_0x06c5('0x7d')+_[_0x06c5('0x76')](_0x1fa7e4['body'][_0x06c5('0x73')][_0x06c5('0x77')]())+_0x06c5('0x7a')](_0x1fa7e4[_0x06c5('0x4a')]['ids']);}return null;})[_0x06c5('0x2b')](handleEntityNotFound(_0xd3271a,null))['then'](respondWithStatusCode(_0xd3271a,null))[_0x06c5('0x54')](handleError(_0xd3271a,null));};exports[_0x06c5('0x7e')]=function(_0xddfad2,_0x55244e,_0x4689c7){return db['Team'][_0x06c5('0x7c')]({'where':{'id':_0xddfad2[_0x06c5('0x46')]['id']}})['then'](function(_0x44e0d0){if(_0x44e0d0){if(!_0xddfad2[_0x06c5('0x35')][_0x06c5('0x73')]||!utils['isValidChannel'](_0xddfad2[_0x06c5('0x35')][_0x06c5('0x73')])){throw new db[(_0x06c5('0x5a'))][(_0x06c5('0x7f'))](_0x06c5('0x75'));}return _0x44e0d0[_0x06c5('0x80')+_[_0x06c5('0x76')](_0xddfad2[_0x06c5('0x35')][_0x06c5('0x73')][_0x06c5('0x77')]())+_0x06c5('0x7a')](_0xddfad2[_0x06c5('0x35')][_0x06c5('0x81')]);}return null;})[_0x06c5('0x2b')](handleEntityNotFound(_0x55244e,null))['then'](respondWithStatusCode(_0x55244e,null))['catch'](handleError(_0x55244e,null));};exports[_0x06c5('0x82')]=function(_0x42aa10,_0x24c8eb){var _0x27b0cd=_[_0x06c5('0x83')](_0x42aa10[_0x06c5('0x4a')][_0x06c5('0x81')])?_0x42aa10[_0x06c5('0x4a')][_0x06c5('0x81')]:[_0x42aa10[_0x06c5('0x4a')][_0x06c5('0x81')]];var _0x4f2472=_0x42aa10[_0x06c5('0x46')]['id'];return db[_0x06c5('0x32')][_0x06c5('0x50')]({'where':{'id':_0x4f2472}})[_0x06c5('0x2b')](handleEntityNotFound(_0x24c8eb,null))[_0x06c5('0x2b')](function(_0x342d85){if(_0x342d85){var _0x516c08=['Voice',_0x06c5('0x84'),'Mail',_0x06c5('0x85'),_0x06c5('0x86'),_0x06c5('0x87'),_0x06c5('0x88')];return db['sequelize'][_0x06c5('0x58')](function(_0x2ccd65){var _0x5262e3=_[_0x06c5('0x31')](_0x516c08,function(_0x68e214){var _0x10f4d9={'attributes':['id','name']};if(_0x68e214===_0x06c5('0x89')){_0x10f4d9[_0x06c5('0x8a')]={'attributes':['penalty']};}return _0x342d85[_0x06c5('0x4c')+_0x68e214+_0x06c5('0x7a')](_0x10f4d9)['then'](function(_0x3eecdb){var _0x2abc59=_['map'](_0x3eecdb,function(_0x5b7182){var _0xc908bd=_[_0x06c5('0x31')](_0x27b0cd,function(_0x529ea5){var _0x36a250={'where':{'UserId':_0x529ea5,[_0x68e214+_0x06c5('0x8b')]:_0x5b7182['id']},'transaction':_0x2ccd65};if(_0x68e214===_0x06c5('0x89')){_0x36a250[_0x06c5('0x8c')]={'penalty':_0x5b7182[_0x06c5('0x8d')][_0x06c5('0x8e')]};}return db['User'+_0x68e214+_0x06c5('0x78')][_0x06c5('0x8f')](_0x36a250)['then'](function(){socket[_0x06c5('0x90')]('user'+_0x68e214+_0x06c5('0x91'),{'UserId':_0x529ea5,[_0x68e214+_0x06c5('0x8b')]:_0x5b7182['id']});if(_0x68e214!=='Voice'){return;}return db[_0x06c5('0x92')][_0x06c5('0x93')]({'where':{'id':_0x27b0cd,'online':0x1},'attributes':['id','name',_0x06c5('0x94'),_0x06c5('0x95'),_0x06c5('0x96')],'raw':!![]})[_0x06c5('0x2b')](function(_0x4fb347){var _0x41d5bb=_[_0x06c5('0x31')](_0x4fb347,function(_0x47d8ee){return db[_0x06c5('0x97')]['upsert']({'membername':_0x47d8ee[_0x06c5('0x2e')],'UserId':_0x47d8ee['id'],'queue_name':_0x5b7182[_0x06c5('0x2e')],'VoiceQueueId':_0x5b7182['id'],'interface':_[_0x06c5('0x98')](_0x47d8ee[_0x06c5('0x96')])?util[_0x06c5('0x99')](_0x06c5('0x9a'),_0x47d8ee[_0x06c5('0x2e')]):_0x47d8ee[_0x06c5('0x96')],'paused':_0x47d8ee['voicePause']||![],'penalty':_0x5b7182['TeamVoiceQueue'][_0x06c5('0x8e')]},{'transaction':_0x2ccd65});});return Promise[_0x06c5('0x9b')](_0x41d5bb);});});});return Promise[_0x06c5('0x9b')](_0xc908bd);});return Promise['all'](_0x2abc59);})['then'](function(){return db[_0x06c5('0x70')][_0x06c5('0x7c')]({'where':{'teamId':_0x4f2472}})['then'](function(_0x335f2){if(_0x335f2){var _0x53b3fb=_[_0x06c5('0x31')](_0x27b0cd,function(_0x5ded51){db[_0x06c5('0x71')][_0x06c5('0x9c')]({'UserId':_0x5ded51,'VoicePrefixId':_0x335f2['VoicePrefixId']});});return Promise['all'](_0x53b3fb);}});});});return Promise['all'](_0x5262e3)['then'](function(){return _0x342d85[_0x06c5('0x82')](_0x27b0cd,{'transaction':_0x2ccd65})[_0x06c5('0x9d')](function(_0x104522){return _0x104522;});});});}})['then'](respondWithResult(_0x24c8eb,null))[_0x06c5('0x54')](handleError(_0x24c8eb,null));};exports[_0x06c5('0x9e')]=function(_0x45cf1d,_0x7d382e){var _0x3b79c3=_[_0x06c5('0x83')](_0x45cf1d[_0x06c5('0x35')]['ids'])?_0x45cf1d[_0x06c5('0x35')][_0x06c5('0x81')]:[_0x45cf1d[_0x06c5('0x35')]['ids']];var _0x2f295f=_0x45cf1d[_0x06c5('0x46')]['id'];return db[_0x06c5('0x32')][_0x06c5('0x50')]({'where':{'id':_0x2f295f}})[_0x06c5('0x2b')](handleEntityNotFound(_0x7d382e,null))[_0x06c5('0x2b')](function(_0x578f6d){if(_0x578f6d){var _0x9720cf=['Voice','Chat',_0x06c5('0x9f'),'Sms',_0x06c5('0x86'),_0x06c5('0x87'),_0x06c5('0x88')];return db['sequelize'][_0x06c5('0x58')](function(_0x21a48f){var _0x5b87df=_[_0x06c5('0x31')](_0x9720cf,function(_0x1f6646){var _0x112009={'attributes':['id',_0x06c5('0x2e')]};return _0x578f6d[_0x06c5('0x4c')+_0x1f6646+_0x06c5('0x7a')](_0x112009)[_0x06c5('0x2b')](function(_0x1ad258){var _0x53ca44=_[_0x06c5('0x31')](_0x1ad258,function(_0x43287a){return _0x43287a[_0x06c5('0x9e')](_0x3b79c3,{'transaction':_0x21a48f})[_0x06c5('0x2b')](function(){var _0x4766a8=_['map'](_0x3b79c3,function(_0x59c6cf){socket['emit'](_0x06c5('0x4b')+_0x1f6646+'Queue:remove',{'UserId':Number(_0x59c6cf),[_0x1f6646+_0x06c5('0x8b')]:_0x43287a['id']});if(_0x1f6646!==_0x06c5('0x89')){return;}return db[_0x06c5('0x97')]['destroy']({'where':{'VoiceQueueId':_0x43287a['id'],'UserId':_0x59c6cf},'transaction':_0x21a48f});});return Promise[_0x06c5('0x9b')](_0x4766a8);});});return Promise[_0x06c5('0x9b')](_0x53ca44);});});return Promise[_0x06c5('0x9b')](_0x5b87df)['then'](function(){return _0x578f6d[_0x06c5('0x9e')](_0x3b79c3,{'transaction':_0x21a48f});})[_0x06c5('0x2b')](function(){return db[_0x06c5('0x70')]['findOne']({'where':{'teamId':_0x2f295f}})[_0x06c5('0x2b')](function(_0x58eb41){if(_0x58eb41){var _0x1ab1fb=_[_0x06c5('0x31')](_0x3b79c3,function(_0x45d2ca){db[_0x06c5('0x71')][_0x06c5('0x56')]({'where':{'UserId':_0x45d2ca,'VoicePrefixId':_0x58eb41['VoicePrefixId']}});});return Promise[_0x06c5('0x9b')](_0x1ab1fb);}});});});}})[_0x06c5('0x2b')](respondWithStatusCode(_0x7d382e,null))[_0x06c5('0x54')](handleError(_0x7d382e,null));};exports[_0x06c5('0xa0')]=function(_0x1ae297,_0x12b11d,_0x2dfb4b){var _0xe60020={};var _0x53f1a9={};var _0x2e642e;var _0x65af23;return db[_0x06c5('0x32')][_0x06c5('0x7c')]({'where':{'id':_0x1ae297[_0x06c5('0x46')]['id']}})[_0x06c5('0x2b')](handleEntityNotFound(_0x12b11d,null))['then'](function(_0x5ef420){if(_0x5ef420){_0x2e642e=_0x5ef420;_0x53f1a9[_0x06c5('0x39')]=_[_0x06c5('0x47')](db['User'][_0x06c5('0x33')]);_0x53f1a9['query']=_[_0x06c5('0x47')](_0x1ae297[_0x06c5('0x35')]);_0x53f1a9[_0x06c5('0x36')]=_[_0x06c5('0x37')](_0x53f1a9[_0x06c5('0x39')],_0x53f1a9[_0x06c5('0x35')]);_0xe60020[_0x06c5('0x38')]=_[_0x06c5('0x37')](_0x53f1a9[_0x06c5('0x39')],qs[_0x06c5('0x3a')](_0x1ae297[_0x06c5('0x35')][_0x06c5('0x3a')]));_0xe60020[_0x06c5('0x38')]=_0xe60020[_0x06c5('0x38')][_0x06c5('0x3b')]?_0xe60020['attributes']:_0x53f1a9[_0x06c5('0x39')];_0xe60020[_0x06c5('0x79')]=qs[_0x06c5('0x3e')](_0x1ae297['query'][_0x06c5('0x3e')]);_0xe60020[_0x06c5('0x41')]=qs['filters'](_[_0x06c5('0x3f')](_0x1ae297[_0x06c5('0x35')],_0x53f1a9[_0x06c5('0x36')]));if(_0x1ae297[_0x06c5('0x35')][_0x06c5('0x40')]){_0xe60020[_0x06c5('0x41')]=_['merge'](_0xe60020[_0x06c5('0x41')],{'$or':_[_0x06c5('0x31')](_0xe60020[_0x06c5('0x38')],function(_0x493a2b){var _0x2b9376={};_0x2b9376[_0x493a2b]={'$like':'%'+_0x1ae297[_0x06c5('0x35')][_0x06c5('0x40')]+'%'};return _0x2b9376;})});}_0xe60020=_[_0x06c5('0x42')]({},_0xe60020,_0x1ae297[_0x06c5('0x43')]);return _0x2e642e[_0x06c5('0xa0')](_0xe60020);}})['then'](function(_0x3a46f7){if(_0x3a46f7){_0x65af23=_0x3a46f7['length'];if(!_0x1ae297[_0x06c5('0x35')][_0x06c5('0x3c')](_0x06c5('0x3d'))){_0xe60020[_0x06c5('0x23')]=qs[_0x06c5('0x23')](_0x1ae297[_0x06c5('0x35')][_0x06c5('0x23')]);_0xe60020[_0x06c5('0x21')]=qs['offset'](_0x1ae297[_0x06c5('0x35')][_0x06c5('0x21')]);}return _0x2e642e[_0x06c5('0xa0')](_0xe60020);}})[_0x06c5('0x2b')](function(_0x10c706){if(_0x10c706){return _0x10c706?{'count':_0x65af23,'rows':_0x10c706}:null;}})[_0x06c5('0x2b')](respondWithResult(_0x12b11d,null))[_0x06c5('0x54')](handleError(_0x12b11d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8318518..75b7526 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 _0x8fa6=['exports','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x188455,_0x37a6fe){var _0x1ba548=function(_0x2a9f4e){while(--_0x2a9f4e){_0x188455['push'](_0x188455['shift']());}};_0x1ba548(++_0x37a6fe);}(_0x8fa6,0x139));var _0x68fa=function(_0x1ba864,_0x3716bb){_0x1ba864=_0x1ba864-0x0;var _0x4e5382=_0x8fa6[_0x1ba864];return _0x4e5382;};'use strict';var EventEmitter=require('events');var Team=require(_0x68fa('0x0'))['db'][_0x68fa('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x68fa('0x2')](0x0);var events={'afterCreate':_0x68fa('0x3'),'afterUpdate':'update','afterDestroy':_0x68fa('0x4')};function emitEvent(_0x297cbf){return function(_0x4ecb95,_0x571b12,_0x1e66a2){TeamEvents[_0x68fa('0x5')](_0x297cbf+':'+_0x4ecb95['id'],_0x4ecb95);TeamEvents[_0x68fa('0x5')](_0x297cbf,_0x4ecb95);_0x1e66a2(null);};}for(var e in events){if(events[_0x68fa('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x68fa('0x7')]=TeamEvents; \ No newline at end of file +var _0x8169=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x388aa5,_0x4c944a){var _0x445930=function(_0x2f18ad){while(--_0x2f18ad){_0x388aa5['push'](_0x388aa5['shift']());}};_0x445930(++_0x4c944a);}(_0x8169,0x16c));var _0x9816=function(_0x1b8dd7,_0x5277ae){_0x1b8dd7=_0x1b8dd7-0x0;var _0xa367d7=_0x8169[_0x1b8dd7];return _0xa367d7;};'use strict';var EventEmitter=require(_0x9816('0x0'));var Team=require(_0x9816('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9816('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5d77c4){return function(_0x64462c,_0x5ca699,_0x1290c8){TeamEvents[_0x9816('0x3')](_0x5d77c4+':'+_0x64462c['id'],_0x64462c);TeamEvents[_0x9816('0x3')](_0x5d77c4,_0x64462c);_0x1290c8(null);};}for(var e in events){if(events[_0x9816('0x4')](e)){var event=events[e];Team[_0x9816('0x5')](e,emitEvent(event));}}module[_0x9816('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index f746b8c..d8a21a8 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 _0x80b2=['bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','teams','lodash','util','api','moment'];(function(_0x441d25,_0x5bd33d){var _0x3195d0=function(_0x35741f){while(--_0x35741f){_0x441d25['push'](_0x441d25['shift']());}};_0x3195d0(++_0x5bd33d);}(_0x80b2,0x19c));var _0x280b=function(_0x4cb4e9,_0x3c6c84){_0x4cb4e9=_0x4cb4e9-0x0;var _0x7711ec=_0x80b2[_0x4cb4e9];return _0x7711ec;};'use strict';var _=require(_0x280b('0x0'));var util=require(_0x280b('0x1'));var logger=require('../../config/logger')(_0x280b('0x2'));var moment=require(_0x280b('0x3'));var BPromise=require(_0x280b('0x4'));var rp=require(_0x280b('0x5'));var fs=require('fs');var path=require(_0x280b('0x6'));var rimraf=require(_0x280b('0x7'));var config=require(_0x280b('0x8'));var attributes=require(_0x280b('0x9'));module['exports']=function(_0x122627,_0x4c7682){return _0x122627[_0x280b('0xa')](_0x280b('0xb'),attributes,{'tableName':_0x280b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x226b=['bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','util','../../config/logger','api','moment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x226b,0x13d));var _0xb226=function(_0x2acb87,_0x434537){_0x2acb87=_0x2acb87-0x0;var _0x1f6ed6=_0x226b[_0x2acb87];return _0x1f6ed6;};'use strict';var _=require(_0xb226('0x0'));var util=require(_0xb226('0x1'));var logger=require(_0xb226('0x2'))(_0xb226('0x3'));var moment=require(_0xb226('0x4'));var BPromise=require(_0xb226('0x5'));var rp=require(_0xb226('0x6'));var fs=require('fs');var path=require(_0xb226('0x7'));var rimraf=require(_0xb226('0x8'));var config=require(_0xb226('0x9'));var attributes=require(_0xb226('0xa'));module[_0xb226('0xb')]=function(_0x2f2fa4,_0x1d5fba){return _0x2f2fa4['define'](_0xb226('0xc'),attributes,{'tableName':_0xb226('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 80f70f4..29d19c0 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 _0xc70c=['client','http','redis','localhost','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xc70c,0xa6));var _0xcc70=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc70c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xcc70('0x0'));var util=require(_0xcc70('0x1'));var moment=require(_0xcc70('0x2'));var BPromise=require(_0xcc70('0x3'));var rs=require(_0xcc70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc70('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc70('0x6'))(_0xcc70('0x7'));var config=require('../../config/environment');var jayson=require(_0xcc70('0x8'));var client=jayson[_0xcc70('0x9')][_0xcc70('0xa')]({'port':0x232a});config[_0xcc70('0xb')]=_['defaults'](config[_0xcc70('0xb')],{'host':_0xcc70('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc70('0xb')]));require(_0xcc70('0xd'))['register'](socket);function respondWithRpcPromise(_0x25b090,_0x5965d1,_0x13faa7){return new BPromise(function(_0x33430d,_0x42486b){return client['request'](_0x25b090,_0x13faa7)[_0xcc70('0xe')](function(_0x97d8e6){logger[_0xcc70('0xf')](_0xcc70('0x10'),_0x5965d1,_0xcc70('0x11'));logger[_0xcc70('0x12')](_0xcc70('0x13'),_0x5965d1,_0xcc70('0x11'),JSON[_0xcc70('0x14')](_0x97d8e6));if(_0x97d8e6[_0xcc70('0x15')]){if(_0x97d8e6['error'][_0xcc70('0x16')]===0x1f4){logger[_0xcc70('0x15')](_0xcc70('0x10'),_0x5965d1,_0x97d8e6[_0xcc70('0x15')][_0xcc70('0x17')]);return _0x42486b(_0x97d8e6['error']['message']);}logger[_0xcc70('0x15')](_0xcc70('0x10'),_0x5965d1,_0x97d8e6[_0xcc70('0x15')][_0xcc70('0x17')]);return _0x33430d(_0x97d8e6[_0xcc70('0x15')][_0xcc70('0x17')]);}else{logger[_0xcc70('0xf')](_0xcc70('0x10'),_0x5965d1,_0xcc70('0x11'));_0x33430d(_0x97d8e6[_0xcc70('0x18')][_0xcc70('0x17')]);}})['catch'](function(_0x58bfd9){logger['error'](_0xcc70('0x10'),_0x5965d1,_0x58bfd9);_0x42486b(_0x58bfd9);});});} \ No newline at end of file +var _0x6a49=['defaults','localhost','socket.io-emitter','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x6a49,0x7c));var _0x96a4=function(_0x2b4e30,_0x4f9e10){_0x2b4e30=_0x2b4e30-0x0;var _0x5753c0=_0x6a49[_0x2b4e30];return _0x5753c0;};'use strict';var _=require('lodash');var util=require(_0x96a4('0x0'));var moment=require(_0x96a4('0x1'));var BPromise=require(_0x96a4('0x2'));var rs=require(_0x96a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96a4('0x4'))['db'];var utils=require(_0x96a4('0x5'));var logger=require(_0x96a4('0x6'))(_0x96a4('0x7'));var config=require(_0x96a4('0x8'));var jayson=require(_0x96a4('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x96a4('0xa')]=_[_0x96a4('0xb')](config[_0x96a4('0xa')],{'host':_0x96a4('0xc'),'port':0x18eb});var socket=require(_0x96a4('0xd'))(new Redis(config[_0x96a4('0xa')]));require('./team.socket')[_0x96a4('0xe')](socket);function respondWithRpcPromise(_0x2d3d74,_0x1e807e,_0x17c5f6){return new BPromise(function(_0x39118b,_0x5dbfe2){return client['request'](_0x2d3d74,_0x17c5f6)[_0x96a4('0xf')](function(_0x37714f){logger[_0x96a4('0x10')](_0x96a4('0x11'),_0x1e807e,_0x96a4('0x12'));logger[_0x96a4('0x13')](_0x96a4('0x14'),_0x1e807e,_0x96a4('0x12'),JSON[_0x96a4('0x15')](_0x37714f));if(_0x37714f[_0x96a4('0x16')]){if(_0x37714f[_0x96a4('0x16')][_0x96a4('0x17')]===0x1f4){logger[_0x96a4('0x16')](_0x96a4('0x11'),_0x1e807e,_0x37714f['error'][_0x96a4('0x18')]);return _0x5dbfe2(_0x37714f[_0x96a4('0x16')][_0x96a4('0x18')]);}logger[_0x96a4('0x16')]('Team,\x20%s,\x20%s',_0x1e807e,_0x37714f[_0x96a4('0x16')][_0x96a4('0x18')]);return _0x39118b(_0x37714f[_0x96a4('0x16')][_0x96a4('0x18')]);}else{logger[_0x96a4('0x10')]('Team,\x20%s,\x20%s',_0x1e807e,_0x96a4('0x12'));_0x39118b(_0x37714f[_0x96a4('0x19')]['message']);}})[_0x96a4('0x1a')](function(_0x30ecc6){logger['error']('Team,\x20%s,\x20%s',_0x1e807e,_0x30ecc6);_0x5dbfe2(_0x30ecc6);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 738db1c..889753c 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 _0xa5df=['./team.events','save','emit','removeListener'];(function(_0x4a397d,_0x5bab1f){var _0x316571=function(_0xa6d65a){while(--_0xa6d65a){_0x4a397d['push'](_0x4a397d['shift']());}};_0x316571(++_0x5bab1f);}(_0xa5df,0xe8));var _0xfa5d=function(_0xe02c01,_0xf52c5e){_0xe02c01=_0xe02c01-0x0;var _0x57cb6f=_0xa5df[_0xe02c01];return _0x57cb6f;};'use strict';var TeamEvents=require(_0xfa5d('0x0'));var events=[_0xfa5d('0x1'),'remove','update'];function createListener(_0x3960bd,_0x4d8bd8){return function(_0x4df3c1){_0x4d8bd8[_0xfa5d('0x2')](_0x3960bd,_0x4df3c1);};}function removeListener(_0x5c8734,_0x577e0a){return function(){TeamEvents[_0xfa5d('0x3')](_0x5c8734,_0x577e0a);};}exports['register']=function(_0x5b6605){for(var _0x5c2de1=0x0,_0x4e6245=events['length'];_0x5c2de1<_0x4e6245;_0x5c2de1++){var _0x39029b=events[_0x5c2de1];var _0x148c3a=createListener('team:'+_0x39029b,_0x5b6605);TeamEvents['on'](_0x39029b,_0x148c3a);}}; \ No newline at end of file +var _0x24a9=['removeListener','register','length','./team.events','save','update'];(function(_0x3de74d,_0x41e906){var _0xdb1150=function(_0x1944fe){while(--_0x1944fe){_0x3de74d['push'](_0x3de74d['shift']());}};_0xdb1150(++_0x41e906);}(_0x24a9,0xf9));var _0x924a=function(_0x5b0e2d,_0x2175f0){_0x5b0e2d=_0x5b0e2d-0x0;var _0x71a079=_0x24a9[_0x5b0e2d];return _0x71a079;};'use strict';var TeamEvents=require(_0x924a('0x0'));var events=[_0x924a('0x1'),'remove',_0x924a('0x2')];function createListener(_0x3be878,_0x421010){return function(_0x3eb096){_0x421010['emit'](_0x3be878,_0x3eb096);};}function removeListener(_0x1dc029,_0x424d2d){return function(){TeamEvents[_0x924a('0x3')](_0x1dc029,_0x424d2d);};}exports[_0x924a('0x4')]=function(_0x63206c){for(var _0x497773=0x0,_0x557b12=events[_0x924a('0x5')];_0x497773<_0x557b12;_0x497773++){var _0x59b79a=events[_0x497773];var _0x4a7e89=createListener('team:'+_0x59b79a,_0x63206c);TeamEvents['on'](_0x59b79a,_0x4a7e89);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 2180772..4af5c98 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 _0x6eaf=['INTEGER','sequelize','exports'];(function(_0x36c695,_0x277aed){var _0x5d783f=function(_0x27b4b8){while(--_0x27b4b8){_0x36c695['push'](_0x36c695['shift']());}};_0x5d783f(++_0x277aed);}(_0x6eaf,0xe5));var _0xf6ea=function(_0x366ac1,_0x43a5ce){_0x366ac1=_0x366ac1-0x0;var _0x377426=_0x6eaf[_0x366ac1];return _0x377426;};'use strict';var Sequelize=require(_0xf6ea('0x0'));module[_0xf6ea('0x1')]={'TeamId':{'type':Sequelize[_0xf6ea('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xca7b=['INTEGER'];(function(_0x4e2e6f,_0x4e53d2){var _0x45594d=function(_0x1aa975){while(--_0x1aa975){_0x4e2e6f['push'](_0x4e2e6f['shift']());}};_0x45594d(++_0x4e53d2);}(_0xca7b,0x14e));var _0xbca7=function(_0x29373f,_0x1494f0){_0x29373f=_0x29373f-0x0;var _0x3aaf43=_0xca7b[_0x29373f];return _0x3aaf43;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0xbca7('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xbca7('0x0')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d114463..b6ff60c 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 _0x8c7a=['path','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','api','bluebird','request-promise'];(function(_0x3671d7,_0x586bbc){var _0xf9f6e6=function(_0x80d81){while(--_0x80d81){_0x3671d7['push'](_0x3671d7['shift']());}};_0xf9f6e6(++_0x586bbc);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x145c2c,_0x2760b4){_0x145c2c=_0x145c2c-0x0;var _0x1edae5=_0x8c7a[_0x145c2c];return _0x1edae5;};'use strict';var _=require(_0xa8c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c7('0x1'));var moment=require('moment');var BPromise=require(_0xa8c7('0x2'));var rp=require(_0xa8c7('0x3'));var fs=require('fs');var path=require(_0xa8c7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c7('0x5'));module[_0xa8c7('0x6')]=function(_0x1afbe0,_0x2ecdf1){return _0x1afbe0[_0xa8c7('0x7')]('TeamVoicePrefix',attributes,{'tableName':_0xa8c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24cf=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','../../config/logger'];(function(_0x36bc58,_0x27f03c){var _0x4a547e=function(_0x6326c6){while(--_0x6326c6){_0x36bc58['push'](_0x36bc58['shift']());}};_0x4a547e(++_0x27f03c);}(_0x24cf,0x1d5));var _0xf24c=function(_0x4e3535,_0x16b3b6){_0x4e3535=_0x4e3535-0x0;var _0x4285ca=_0x24cf[_0x4e3535];return _0x4285ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf24c('0x0'))(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rp=require(_0xf24c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var attributes=require(_0xf24c('0x7'));module[_0xf24c('0x8')]=function(_0x5c4ebc,_0x4983e2){return _0x5c4ebc['define'](_0xf24c('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 648ab6e..3a5d60f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x251e73,_0x276bbd){var _0x4ef730=function(_0x25d500){while(--_0x25d500){_0x251e73['push'](_0x251e73['shift']());}};_0x4ef730(++_0x276bbd);}(_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(_0x3835e7,_0x25e253){var _0xcb6db2=function(_0x5ae737){while(--_0x5ae737){_0x3835e7['push'](_0x3835e7['shift']());}};_0xcb6db2(++_0x25e253);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c823c24..32cc8ca 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 _0x09f3=['sequelize','exports','INTEGER'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x09f3,0x1c5));var _0x309f=function(_0x3367b7,_0x1e0234){_0x3367b7=_0x3367b7-0x0;var _0x52bb97=_0x09f3[_0x3367b7];return _0x52bb97;};'use strict';var Sequelize=require(_0x309f('0x0'));module[_0x309f('0x1')]={'penalty':{'type':Sequelize[_0x309f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3987=['sequelize','exports','INTEGER'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3987,0x18f));var _0x7398=function(_0x48571c,_0x1cf377){_0x48571c=_0x48571c-0x0;var _0x5025a9=_0x3987[_0x48571c];return _0x5025a9;};'use strict';var Sequelize=require(_0x7398('0x0'));module[_0x7398('0x1')]={'penalty':{'type':Sequelize[_0x7398('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index b52a8bb..638072a 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 _0xf6fb=['define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x2c1a2e,_0x1a738d){var _0x33a9e6=function(_0x735553){while(--_0x735553){_0x2c1a2e['push'](_0x2c1a2e['shift']());}};_0x33a9e6(++_0x1a738d);}(_0xf6fb,0x111));var _0xbf6f=function(_0x282780,_0x49c2d3){_0x282780=_0x282780-0x0;var _0x3f8c44=_0xf6fb[_0x282780];return _0x3f8c44;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));var moment=require('moment');var BPromise=require(_0xbf6f('0x2'));var rp=require(_0xbf6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6f('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf6f('0x5'));module[_0xbf6f('0x6')]=function(_0x2d8ffb,_0x370983){return _0x2d8ffb[_0xbf6f('0x7')](_0xbf6f('0x8'),attributes,{'tableName':_0xbf6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f7=['moment','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger'];(function(_0xc3857e,_0x21a487){var _0xf0350d=function(_0xd4e673){while(--_0xd4e673){_0xc3857e['push'](_0xc3857e['shift']());}};_0xf0350d(++_0x21a487);}(_0x89f7,0x105));var _0x789f=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0x89f7[_0x544072];return _0x590bf6;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var logger=require(_0x789f('0x2'))('api');var moment=require(_0x789f('0x3'));var BPromise=require('bluebird');var rp=require(_0x789f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x789f('0x5'));var config=require(_0x789f('0x6'));var attributes=require(_0x789f('0x7'));module[_0x789f('0x8')]=function(_0x5d7abe,_0x273a16){return _0x5d7abe[_0x789f('0x9')](_0x789f('0xa'),attributes,{'tableName':_0x789f('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 3ac9ecb..9ef2b69 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 _0x3248=['TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x3248,0x1bc));var _0x8324=function(_0xf4eaa3,_0x5b0e11){_0xf4eaa3=_0xf4eaa3-0x0;var _0x5ebac9=_0x3248[_0xf4eaa3];return _0x5ebac9;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8324('0x1'));var fs=require('fs');var Redis=require(_0x8324('0x2'));var db=require(_0x8324('0x3'))['db'];var utils=require(_0x8324('0x4'));var logger=require(_0x8324('0x5'))(_0x8324('0x6'));var config=require('../../config/environment');var jayson=require(_0x8324('0x7'));var client=jayson[_0x8324('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ee7a,_0x459a62,_0x4302c5){return new BPromise(function(_0x1514c0,_0x5a482d){return client[_0x8324('0x9')](_0x25ee7a,_0x4302c5)[_0x8324('0xa')](function(_0x3f00e6){logger[_0x8324('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'));logger[_0x8324('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'),JSON[_0x8324('0xe')](_0x3f00e6));if(_0x3f00e6['error']){if(_0x3f00e6['error']['code']===0x1f4){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x5a482d(_0x3f00e6['error'][_0x8324('0x11')]);}logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x1514c0(_0x3f00e6['error'][_0x8324('0x11')]);}else{logger[_0x8324('0xb')](_0x8324('0x10'),_0x459a62,_0x8324('0xc'));_0x1514c0(_0x3f00e6[_0x8324('0x12')]['message']);}})[_0x8324('0x13')](function(_0xaf20a5){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0xaf20a5);_0x5a482d(_0xaf20a5);});});} \ No newline at end of file +var _0x92ab=['message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','stringify','error'];(function(_0x39998f,_0x1b5b92){var _0x1d11fe=function(_0x13dbf8){while(--_0x13dbf8){_0x39998f['push'](_0x39998f['shift']());}};_0x1d11fe(++_0x1b5b92);}(_0x92ab,0x193));var _0xb92a=function(_0x25dcca,_0x3b0174){_0x25dcca=_0x25dcca-0x0;var _0x342a81=_0x92ab[_0x25dcca];return _0x342a81;};'use strict';var _=require(_0xb92a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb92a('0x1'));var rs=require(_0xb92a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb92a('0x3'))['db'];var utils=require(_0xb92a('0x4'));var logger=require(_0xb92a('0x5'))(_0xb92a('0x6'));var config=require(_0xb92a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb92a('0x8')][_0xb92a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x479139,_0x276050,_0x2c1c03){return new BPromise(function(_0x419cdd,_0x282b1f){return client[_0xb92a('0xa')](_0x479139,_0x2c1c03)[_0xb92a('0xb')](function(_0x113be9){logger[_0xb92a('0xc')](_0xb92a('0xd'),_0x276050,'request\x20sent');logger[_0xb92a('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x276050,'request\x20sent',JSON[_0xb92a('0xf')](_0x113be9));if(_0x113be9[_0xb92a('0x10')]){if(_0x113be9[_0xb92a('0x10')]['code']===0x1f4){logger[_0xb92a('0x10')](_0xb92a('0xd'),_0x276050,_0x113be9[_0xb92a('0x10')][_0xb92a('0x11')]);return _0x282b1f(_0x113be9[_0xb92a('0x10')][_0xb92a('0x11')]);}logger['error'](_0xb92a('0xd'),_0x276050,_0x113be9[_0xb92a('0x10')][_0xb92a('0x11')]);return _0x419cdd(_0x113be9[_0xb92a('0x10')][_0xb92a('0x11')]);}else{logger[_0xb92a('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x276050,'request\x20sent');_0x419cdd(_0x113be9[_0xb92a('0x12')][_0xb92a('0x11')]);}})[_0xb92a('0x13')](function(_0x1348ec){logger[_0xb92a('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x276050,_0x1348ec);_0x282b1f(_0x1348ec);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 103d8dc..b2486b8 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 _0x3914=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','index','/:id','show','post','put','isAuthenticated','delete','destroy','multer','util','connect-timeout'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x3914,0xeb));var _0x4391=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x3914[_0x2b152a];return _0x2ad4c7;};'use strict';var multer=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var path=require('path');var timeout=require(_0x4391('0x2'));var express=require(_0x4391('0x3'));var router=express['Router']();var fs_extra=require(_0x4391('0x4'));var auth=require(_0x4391('0x5'));var interaction=require(_0x4391('0x6'));var config=require('../../config/environment');var controller=require(_0x4391('0x7'));router[_0x4391('0x8')]('/',auth['isAuthenticated'](),controller[_0x4391('0x9')]);router['get'](_0x4391('0xa'),auth['isAuthenticated'](),controller[_0x4391('0xb')]);router[_0x4391('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4391('0xd')](_0x4391('0xa'),auth[_0x4391('0xe')](),controller['update']);router[_0x4391('0xf')](_0x4391('0xa'),auth[_0x4391('0xe')](),controller[_0x4391('0x10')]);module['exports']=router; \ No newline at end of file +var _0x110f=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x110f,0x1e6));var _0xf110=function(_0x23eb8b,_0x2c7c94){_0x23eb8b=_0x23eb8b-0x0;var _0x5c3123=_0x110f[_0x23eb8b];return _0x5c3123;};'use strict';var multer=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf110('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf110('0x3'));var interaction=require(_0xf110('0x4'));var config=require(_0xf110('0x5'));var controller=require('./template.controller');router[_0xf110('0x6')]('/',auth[_0xf110('0x7')](),controller[_0xf110('0x8')]);router['get'](_0xf110('0x9'),auth[_0xf110('0x7')](),controller[_0xf110('0xa')]);router['post']('/',auth[_0xf110('0x7')](),controller[_0xf110('0xb')]);router[_0xf110('0xc')]('/:id',auth[_0xf110('0x7')](),controller[_0xf110('0xd')]);router[_0xf110('0xe')](_0xf110('0x9'),auth['isAuthenticated'](),controller[_0xf110('0xf')]);module[_0xf110('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0b044f4..55d8d5e 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 _0xf26a=['TEXT','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf26a,0x141));var _0xaf26=function(_0x583821,_0x2c6394){_0x583821=_0x583821-0x0;var _0xf613ba=_0xf26a[_0x583821];return _0xf613ba;};'use strict';var Sequelize=require(_0xaf26('0x0'));module[_0xaf26('0x1')]={'name':{'type':Sequelize[_0xaf26('0x2')]},'description':{'type':Sequelize[_0xaf26('0x2')]},'html':{'type':Sequelize[_0xaf26('0x3')]}}; \ No newline at end of file +var _0x9cab=['STRING','sequelize','exports'];(function(_0x56f0ee,_0xb898d){var _0xb8bddb=function(_0x468e8a){while(--_0x468e8a){_0x56f0ee['push'](_0x56f0ee['shift']());}};_0xb8bddb(++_0xb898d);}(_0x9cab,0x7f));var _0xb9ca=function(_0x10f626,_0x275ca8){_0x10f626=_0x10f626-0x0;var _0x5bd89e=_0x9cab[_0x10f626];return _0x5bd89e;};'use strict';var Sequelize=require(_0xb9ca('0x0'));module[_0xb9ca('0x1')]={'name':{'type':Sequelize[_0xb9ca('0x2')]},'description':{'type':Sequelize[_0xb9ca('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 91fdddd..025753d 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 _0xfc77=['mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','stack','name','send','index','map','Template','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','show','params','rawAttributes','includeAll','find','catch','create','body','role','user','UserProfileSection','userProfileId','error','eml-format','fast-json-patch','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc77,0x1cb));var _0x7fc7=function(_0x330a51,_0x42c33b){_0x330a51=_0x330a51-0x0;var _0x55aa63=_0xfc77[_0x330a51];return _0x55aa63;};'use strict';var emlformat=require(_0x7fc7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7fc7('0x1'));var rp=require('request-promise');var moment=require(_0x7fc7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7fc7('0x3'));var util=require(_0x7fc7('0x4'));var path=require(_0x7fc7('0x5'));var sox=require('sox');var csv=require(_0x7fc7('0x6'));var ejs=require(_0x7fc7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fc7('0x8'));var squel=require(_0x7fc7('0x9'));var crypto=require(_0x7fc7('0xa'));var jsforce=require(_0x7fc7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7fc7('0xc'));var Papa=require(_0x7fc7('0xd'));var Redis=require('ioredis');var authService=require(_0x7fc7('0xe'));var qs=require(_0x7fc7('0xf'));var as=require(_0x7fc7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7fc7('0x11'));var utils=require(_0x7fc7('0x12'));var config=require(_0x7fc7('0x13'));var licenseUtil=require(_0x7fc7('0x14'));var db=require(_0x7fc7('0x15'))['db'];function respondWithStatusCode(_0x4bf0f9,_0x5a1529){_0x5a1529=_0x5a1529||0xcc;return function(_0x1f4b35){if(_0x1f4b35){return _0x4bf0f9['sendStatus'](_0x5a1529);}return _0x4bf0f9[_0x7fc7('0x16')](_0x5a1529)['end']();};}function respondWithResult(_0x2f9eab,_0x4429eb){_0x4429eb=_0x4429eb||0xc8;return function(_0x416614){if(_0x416614){return _0x2f9eab[_0x7fc7('0x16')](_0x4429eb)[_0x7fc7('0x17')](_0x416614);}};}function respondWithFilteredResult(_0x3f1dc8,_0xc3bff7){return function(_0xf7575d){if(_0xf7575d){var _0x2d47e6=typeof _0xc3bff7[_0x7fc7('0x18')]===_0x7fc7('0x19')&&typeof _0xc3bff7[_0x7fc7('0x1a')]===_0x7fc7('0x19');var _0x268b79=_0xf7575d[_0x7fc7('0x1b')];var _0x539023=_0x2d47e6?0x0:_0xc3bff7[_0x7fc7('0x18')];var _0x4a0c7d=_0x2d47e6?_0xf7575d[_0x7fc7('0x1b')]:_0xc3bff7[_0x7fc7('0x18')]+_0xc3bff7[_0x7fc7('0x1a')];var _0x51380d;if(_0x4a0c7d>=_0x268b79){_0x4a0c7d=_0x268b79;_0x51380d=0xc8;}else{_0x51380d=0xce;}_0x3f1dc8[_0x7fc7('0x16')](_0x51380d);return _0x3f1dc8[_0x7fc7('0x1c')](_0x7fc7('0x1d'),_0x539023+'-'+_0x4a0c7d+'/'+_0x268b79)['json'](_0xf7575d);}return null;};}function patchUpdates(_0x10058c){return function(_0x1aa2ae){try{jsonpatch[_0x7fc7('0x1e')](_0x1aa2ae,_0x10058c,!![]);}catch(_0x281884){return BPromise[_0x7fc7('0x1f')](_0x281884);}return _0x1aa2ae[_0x7fc7('0x20')]();};}function saveUpdates(_0x5aeb97,_0x53d1c0){return function(_0x4557b8){if(_0x4557b8){return _0x4557b8[_0x7fc7('0x21')](_0x5aeb97)[_0x7fc7('0x22')](function(_0xc3b79e){return _0xc3b79e;});}return null;};}function removeEntity(_0x59ce29,_0x1a615c){return function(_0x18951d){if(_0x18951d){return _0x18951d[_0x7fc7('0x23')]()[_0x7fc7('0x22')](function(){var _0x2702b6=_0x18951d[_0x7fc7('0x24')]({'plain':!![]});var _0x1621c4=_0x7fc7('0x25');return db[_0x7fc7('0x26')][_0x7fc7('0x23')]({'where':{'type':_0x1621c4,'resourceId':_0x2702b6['id']}})[_0x7fc7('0x22')](function(){return _0x18951d;});})[_0x7fc7('0x22')](function(){_0x59ce29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x542cbd,_0x3970f4){return function(_0x4fa798){if(!_0x4fa798){_0x542cbd['sendStatus'](0x194);}return _0x4fa798;};}function handleError(_0x3ead96,_0x2d2b90){_0x2d2b90=_0x2d2b90||0x1f4;return function(_0x3b3d74){logger['error'](_0x3b3d74[_0x7fc7('0x27')]);if(_0x3b3d74[_0x7fc7('0x28')]){delete _0x3b3d74[_0x7fc7('0x28')];}_0x3ead96[_0x7fc7('0x16')](_0x2d2b90)[_0x7fc7('0x29')](_0x3b3d74);};}exports[_0x7fc7('0x2a')]=function(_0x180448,_0x2c6d03){var _0x3a434c={},_0x442175={},_0x4ac39c={'count':0x0,'rows':[]};var _0x282cb1=_[_0x7fc7('0x2b')](db[_0x7fc7('0x2c')]['rawAttributes'],function(_0x57ef7f){return{'name':_0x57ef7f['fieldName'],'type':_0x57ef7f[_0x7fc7('0x2d')][_0x7fc7('0x2e')]};});_0x442175[_0x7fc7('0x2f')]=_[_0x7fc7('0x2b')](_0x282cb1,_0x7fc7('0x28'));_0x442175[_0x7fc7('0x30')]=_[_0x7fc7('0x31')](_0x180448[_0x7fc7('0x30')]);_0x442175[_0x7fc7('0x32')]=_[_0x7fc7('0x33')](_0x442175[_0x7fc7('0x2f')],_0x442175[_0x7fc7('0x30')]);_0x3a434c[_0x7fc7('0x34')]=_[_0x7fc7('0x33')](_0x442175[_0x7fc7('0x2f')],qs[_0x7fc7('0x35')](_0x180448[_0x7fc7('0x30')][_0x7fc7('0x35')]));_0x3a434c[_0x7fc7('0x34')]=_0x3a434c[_0x7fc7('0x34')][_0x7fc7('0x36')]?_0x3a434c[_0x7fc7('0x34')]:_0x442175['model'];if(!_0x180448[_0x7fc7('0x30')][_0x7fc7('0x37')]('nolimit')){_0x3a434c[_0x7fc7('0x1a')]=qs[_0x7fc7('0x1a')](_0x180448[_0x7fc7('0x30')][_0x7fc7('0x1a')]);_0x3a434c[_0x7fc7('0x18')]=qs[_0x7fc7('0x18')](_0x180448[_0x7fc7('0x30')][_0x7fc7('0x18')]);}_0x3a434c['order']=qs[_0x7fc7('0x38')](_0x180448['query']['sort']);_0x3a434c[_0x7fc7('0x39')]=qs[_0x7fc7('0x32')](_[_0x7fc7('0x3a')](_0x180448[_0x7fc7('0x30')],_0x442175['filters']),_0x282cb1);if(_0x180448['query'][_0x7fc7('0x3b')]){_0x3a434c['where']=_[_0x7fc7('0x3c')](_0x3a434c[_0x7fc7('0x39')],{'$or':_['map'](_0x282cb1,function(_0x557d84){if(_0x557d84[_0x7fc7('0x2d')]!=='VIRTUAL'){var _0x5904dd={};_0x5904dd[_0x557d84[_0x7fc7('0x28')]]={'$like':'%'+_0x180448[_0x7fc7('0x30')][_0x7fc7('0x3b')]+'%'};return _0x5904dd;}})});}_0x3a434c=_[_0x7fc7('0x3c')]({},_0x3a434c,_0x180448[_0x7fc7('0x3d')]);var _0x55a35d={'where':_0x3a434c[_0x7fc7('0x39')]};return db[_0x7fc7('0x2c')]['count'](_0x55a35d)[_0x7fc7('0x22')](function(_0x5e0520){_0x4ac39c[_0x7fc7('0x1b')]=_0x5e0520;if(_0x180448[_0x7fc7('0x30')]['includeAll']){_0x3a434c[_0x7fc7('0x3e')]=[{'all':!![]}];}return db['Template'][_0x7fc7('0x3f')](_0x3a434c);})[_0x7fc7('0x22')](function(_0x40afee){_0x4ac39c['rows']=_0x40afee;return _0x4ac39c;})[_0x7fc7('0x22')](respondWithFilteredResult(_0x2c6d03,_0x3a434c))['catch'](handleError(_0x2c6d03,null));};exports[_0x7fc7('0x40')]=function(_0x39b2ee,_0x1e15d1){var _0x354fde={'raw':!![],'where':{'id':_0x39b2ee[_0x7fc7('0x41')]['id']}},_0x41b203={};_0x41b203[_0x7fc7('0x2f')]=_[_0x7fc7('0x31')](db[_0x7fc7('0x2c')][_0x7fc7('0x42')]);_0x41b203[_0x7fc7('0x30')]=_['keys'](_0x39b2ee['query']);_0x41b203[_0x7fc7('0x32')]=_['intersection'](_0x41b203[_0x7fc7('0x2f')],_0x41b203[_0x7fc7('0x30')]);_0x354fde[_0x7fc7('0x34')]=_[_0x7fc7('0x33')](_0x41b203[_0x7fc7('0x2f')],qs[_0x7fc7('0x35')](_0x39b2ee[_0x7fc7('0x30')]['fields']));_0x354fde['attributes']=_0x354fde[_0x7fc7('0x34')][_0x7fc7('0x36')]?_0x354fde[_0x7fc7('0x34')]:_0x41b203[_0x7fc7('0x2f')];if(_0x39b2ee[_0x7fc7('0x30')][_0x7fc7('0x43')]){_0x354fde[_0x7fc7('0x3e')]=[{'all':!![]}];}_0x354fde=_[_0x7fc7('0x3c')]({},_0x354fde,_0x39b2ee['options']);return db[_0x7fc7('0x2c')][_0x7fc7('0x44')](_0x354fde)[_0x7fc7('0x22')](handleEntityNotFound(_0x1e15d1,null))['then'](respondWithResult(_0x1e15d1,null))[_0x7fc7('0x45')](handleError(_0x1e15d1,null));};exports[_0x7fc7('0x46')]=function(_0x1cc0e0,_0xb494e2){return db['Template'][_0x7fc7('0x46')](_0x1cc0e0[_0x7fc7('0x47')],{})[_0x7fc7('0x22')](function(_0x2d30d9){var _0x325067=_0x1cc0e0['user'][_0x7fc7('0x24')]({'plain':!![]});if(!_0x325067)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x325067[_0x7fc7('0x48')]===_0x7fc7('0x49')){var _0x5b7891=_0x2d30d9[_0x7fc7('0x24')]({'plain':!![]});var _0x4d213b=_0x7fc7('0x25');return db[_0x7fc7('0x4a')][_0x7fc7('0x44')]({'where':{'name':_0x4d213b,'userProfileId':_0x325067[_0x7fc7('0x4b')]},'raw':!![]})[_0x7fc7('0x22')](function(_0x3c4a65){if(_0x3c4a65&&_0x3c4a65['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5b7891[_0x7fc7('0x28')],'resourceId':_0x5b7891['id'],'type':_0x3c4a65[_0x7fc7('0x28')],'sectionId':_0x3c4a65['id']},{})[_0x7fc7('0x22')](function(){return _0x2d30d9;});}else{return _0x2d30d9;}})[_0x7fc7('0x45')](function(_0x5dd99c){logger[_0x7fc7('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dd99c);throw _0x5dd99c;});}return _0x2d30d9;})[_0x7fc7('0x22')](respondWithResult(_0xb494e2,0xc9))[_0x7fc7('0x45')](handleError(_0xb494e2,null));};exports['update']=function(_0x202520,_0x15c876){if(_0x202520['body']['id']){delete _0x202520[_0x7fc7('0x47')]['id'];}return db['Template'][_0x7fc7('0x44')]({'where':{'id':_0x202520['params']['id']}})['then'](handleEntityNotFound(_0x15c876,null))[_0x7fc7('0x22')](saveUpdates(_0x202520[_0x7fc7('0x47')],null))[_0x7fc7('0x22')](respondWithResult(_0x15c876,null))['catch'](handleError(_0x15c876,null));};exports[_0x7fc7('0x23')]=function(_0x121648,_0x1712d7){return db['Template'][_0x7fc7('0x44')]({'where':{'id':_0x121648[_0x7fc7('0x41')]['id']}})[_0x7fc7('0x22')](handleEntityNotFound(_0x1712d7,null))[_0x7fc7('0x22')](removeEntity(_0x1712d7,null))[_0x7fc7('0x45')](handleError(_0x1712d7,null));}; \ No newline at end of file +var _0x5a2b=['error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','keys','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x5a2b,0xc6));var _0xb5a2=function(_0x15077a,_0x38443e){_0x15077a=_0x15077a-0x0;var _0x1bceca=_0x5a2b[_0x15077a];return _0x1bceca;};'use strict';var emlformat=require(_0xb5a2('0x0'));var rimraf=require(_0xb5a2('0x1'));var zipdir=require(_0xb5a2('0x2'));var jsonpatch=require(_0xb5a2('0x3'));var rp=require(_0xb5a2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb5a2('0x5'));var util=require(_0xb5a2('0x6'));var path=require(_0xb5a2('0x7'));var sox=require(_0xb5a2('0x8'));var csv=require(_0xb5a2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5a2('0xa'));var _=require('lodash');var squel=require(_0xb5a2('0xb'));var crypto=require(_0xb5a2('0xc'));var jsforce=require(_0xb5a2('0xd'));var deskjs=require(_0xb5a2('0xe'));var toCsv=require(_0xb5a2('0x9'));var querystring=require(_0xb5a2('0xf'));var Papa=require(_0xb5a2('0x10'));var Redis=require('ioredis');var authService=require(_0xb5a2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb5a2('0x12'));var hardwareService=require(_0xb5a2('0x13'));var logger=require('../../config/logger')(_0xb5a2('0x14'));var utils=require('../../config/utils');var config=require(_0xb5a2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5a2('0x16'))['db'];function respondWithStatusCode(_0x3f154d,_0x2899b1){_0x2899b1=_0x2899b1||0xcc;return function(_0x12ce90){if(_0x12ce90){return _0x3f154d['sendStatus'](_0x2899b1);}return _0x3f154d['status'](_0x2899b1)[_0xb5a2('0x17')]();};}function respondWithResult(_0x7d32b6,_0x4b9e29){_0x4b9e29=_0x4b9e29||0xc8;return function(_0x57ad61){if(_0x57ad61){return _0x7d32b6[_0xb5a2('0x18')](_0x4b9e29)[_0xb5a2('0x19')](_0x57ad61);}};}function respondWithFilteredResult(_0x24c925,_0x51d4a6){return function(_0x4ab802){if(_0x4ab802){var _0x5caea2=typeof _0x51d4a6['offset']===_0xb5a2('0x1a')&&typeof _0x51d4a6[_0xb5a2('0x1b')]==='undefined';var _0x4cde1a=_0x4ab802['count'];var _0x5ceae0=_0x5caea2?0x0:_0x51d4a6['offset'];var _0x538d82=_0x5caea2?_0x4ab802[_0xb5a2('0x1c')]:_0x51d4a6[_0xb5a2('0x1d')]+_0x51d4a6[_0xb5a2('0x1b')];var _0x5a51e9;if(_0x538d82>=_0x4cde1a){_0x538d82=_0x4cde1a;_0x5a51e9=0xc8;}else{_0x5a51e9=0xce;}_0x24c925[_0xb5a2('0x18')](_0x5a51e9);return _0x24c925['set'](_0xb5a2('0x1e'),_0x5ceae0+'-'+_0x538d82+'/'+_0x4cde1a)['json'](_0x4ab802);}return null;};}function patchUpdates(_0x582579){return function(_0xbcf9f2){try{jsonpatch[_0xb5a2('0x1f')](_0xbcf9f2,_0x582579,!![]);}catch(_0x30f40a){return BPromise[_0xb5a2('0x20')](_0x30f40a);}return _0xbcf9f2[_0xb5a2('0x21')]();};}function saveUpdates(_0x45aad8,_0x4a315d){return function(_0x125c2f){if(_0x125c2f){return _0x125c2f[_0xb5a2('0x22')](_0x45aad8)[_0xb5a2('0x23')](function(_0x1d3863){return _0x1d3863;});}return null;};}function removeEntity(_0x52c503,_0x284a71){return function(_0x230fd9){if(_0x230fd9){return _0x230fd9['destroy']()['then'](function(){var _0x30d62d=_0x230fd9[_0xb5a2('0x24')]({'plain':!![]});var _0x39598b='Templates';return db[_0xb5a2('0x25')][_0xb5a2('0x26')]({'where':{'type':_0x39598b,'resourceId':_0x30d62d['id']}})[_0xb5a2('0x23')](function(){return _0x230fd9;});})[_0xb5a2('0x23')](function(){_0x52c503[_0xb5a2('0x18')](0xcc)[_0xb5a2('0x17')]();});}};}function handleEntityNotFound(_0x4e4f60,_0x4806bc){return function(_0x37a6a4){if(!_0x37a6a4){_0x4e4f60['sendStatus'](0x194);}return _0x37a6a4;};}function handleError(_0x4d6e3c,_0x582d3e){_0x582d3e=_0x582d3e||0x1f4;return function(_0x29d927){logger[_0xb5a2('0x27')](_0x29d927[_0xb5a2('0x28')]);if(_0x29d927[_0xb5a2('0x29')]){delete _0x29d927[_0xb5a2('0x29')];}_0x4d6e3c[_0xb5a2('0x18')](_0x582d3e)['send'](_0x29d927);};}exports[_0xb5a2('0x2a')]=function(_0x2f56ca,_0x3b0323){var _0x59886d={},_0x510f6d={},_0x52e782={'count':0x0,'rows':[]};var _0x399fa3=_[_0xb5a2('0x2b')](db[_0xb5a2('0x2c')][_0xb5a2('0x2d')],function(_0x172727){return{'name':_0x172727[_0xb5a2('0x2e')],'type':_0x172727[_0xb5a2('0x2f')][_0xb5a2('0x30')]};});_0x510f6d['model']=_[_0xb5a2('0x2b')](_0x399fa3,_0xb5a2('0x29'));_0x510f6d[_0xb5a2('0x31')]=_['keys'](_0x2f56ca[_0xb5a2('0x31')]);_0x510f6d[_0xb5a2('0x32')]=_['intersection'](_0x510f6d[_0xb5a2('0x33')],_0x510f6d['query']);_0x59886d[_0xb5a2('0x34')]=_['intersection'](_0x510f6d[_0xb5a2('0x33')],qs[_0xb5a2('0x35')](_0x2f56ca[_0xb5a2('0x31')]['fields']));_0x59886d[_0xb5a2('0x34')]=_0x59886d[_0xb5a2('0x34')][_0xb5a2('0x36')]?_0x59886d[_0xb5a2('0x34')]:_0x510f6d['model'];if(!_0x2f56ca[_0xb5a2('0x31')]['hasOwnProperty'](_0xb5a2('0x37'))){_0x59886d[_0xb5a2('0x1b')]=qs['limit'](_0x2f56ca[_0xb5a2('0x31')][_0xb5a2('0x1b')]);_0x59886d[_0xb5a2('0x1d')]=qs[_0xb5a2('0x1d')](_0x2f56ca[_0xb5a2('0x31')][_0xb5a2('0x1d')]);}_0x59886d[_0xb5a2('0x38')]=qs[_0xb5a2('0x39')](_0x2f56ca['query']['sort']);_0x59886d['where']=qs[_0xb5a2('0x32')](_['pick'](_0x2f56ca[_0xb5a2('0x31')],_0x510f6d[_0xb5a2('0x32')]),_0x399fa3);if(_0x2f56ca['query'][_0xb5a2('0x3a')]){_0x59886d[_0xb5a2('0x3b')]=_[_0xb5a2('0x3c')](_0x59886d[_0xb5a2('0x3b')],{'$or':_[_0xb5a2('0x2b')](_0x399fa3,function(_0x6a46bb){if(_0x6a46bb[_0xb5a2('0x2f')]!=='VIRTUAL'){var _0x34259d={};_0x34259d[_0x6a46bb[_0xb5a2('0x29')]]={'$like':'%'+_0x2f56ca['query'][_0xb5a2('0x3a')]+'%'};return _0x34259d;}})});}_0x59886d=_[_0xb5a2('0x3c')]({},_0x59886d,_0x2f56ca['options']);var _0x503866={'where':_0x59886d[_0xb5a2('0x3b')]};return db['Template'][_0xb5a2('0x1c')](_0x503866)[_0xb5a2('0x23')](function(_0x20032b){_0x52e782[_0xb5a2('0x1c')]=_0x20032b;if(_0x2f56ca[_0xb5a2('0x31')][_0xb5a2('0x3d')]){_0x59886d[_0xb5a2('0x3e')]=[{'all':!![]}];}return db['Template'][_0xb5a2('0x3f')](_0x59886d);})['then'](function(_0x133dd5){_0x52e782[_0xb5a2('0x40')]=_0x133dd5;return _0x52e782;})['then'](respondWithFilteredResult(_0x3b0323,_0x59886d))[_0xb5a2('0x41')](handleError(_0x3b0323,null));};exports['show']=function(_0xe4430d,_0x38e8a2){var _0x4635bf={'raw':!![],'where':{'id':_0xe4430d['params']['id']}},_0x32c62={};_0x32c62['model']=_[_0xb5a2('0x42')](db[_0xb5a2('0x2c')][_0xb5a2('0x2d')]);_0x32c62['query']=_['keys'](_0xe4430d['query']);_0x32c62['filters']=_[_0xb5a2('0x43')](_0x32c62[_0xb5a2('0x33')],_0x32c62[_0xb5a2('0x31')]);_0x4635bf['attributes']=_[_0xb5a2('0x43')](_0x32c62['model'],qs['fields'](_0xe4430d[_0xb5a2('0x31')][_0xb5a2('0x35')]));_0x4635bf[_0xb5a2('0x34')]=_0x4635bf[_0xb5a2('0x34')][_0xb5a2('0x36')]?_0x4635bf[_0xb5a2('0x34')]:_0x32c62['model'];if(_0xe4430d[_0xb5a2('0x31')][_0xb5a2('0x3d')]){_0x4635bf['include']=[{'all':!![]}];}_0x4635bf=_['merge']({},_0x4635bf,_0xe4430d[_0xb5a2('0x44')]);return db[_0xb5a2('0x2c')][_0xb5a2('0x45')](_0x4635bf)['then'](handleEntityNotFound(_0x38e8a2,null))['then'](respondWithResult(_0x38e8a2,null))[_0xb5a2('0x41')](handleError(_0x38e8a2,null));};exports[_0xb5a2('0x46')]=function(_0x21aedb,_0x15fc1d){return db['Template'][_0xb5a2('0x46')](_0x21aedb[_0xb5a2('0x47')],{})[_0xb5a2('0x23')](function(_0x5150b7){var _0x595899=_0x21aedb[_0xb5a2('0x48')]['get']({'plain':!![]});if(!_0x595899)throw new Error(_0xb5a2('0x49'));if(_0x595899[_0xb5a2('0x4a')]===_0xb5a2('0x48')){var _0x9c9b78=_0x5150b7[_0xb5a2('0x24')]({'plain':!![]});var _0x66516b='Templates';return db[_0xb5a2('0x4b')]['find']({'where':{'name':_0x66516b,'userProfileId':_0x595899[_0xb5a2('0x4c')]},'raw':!![]})[_0xb5a2('0x23')](function(_0x2b820d){if(_0x2b820d&&_0x2b820d['autoAssociation']===0x0){return db[_0xb5a2('0x25')][_0xb5a2('0x46')]({'name':_0x9c9b78[_0xb5a2('0x29')],'resourceId':_0x9c9b78['id'],'type':_0x2b820d[_0xb5a2('0x29')],'sectionId':_0x2b820d['id']},{})['then'](function(){return _0x5150b7;});}else{return _0x5150b7;}})['catch'](function(_0xc299db){logger[_0xb5a2('0x27')](_0xb5a2('0x4d'),_0xc299db);throw _0xc299db;});}return _0x5150b7;})[_0xb5a2('0x23')](respondWithResult(_0x15fc1d,0xc9))[_0xb5a2('0x41')](handleError(_0x15fc1d,null));};exports[_0xb5a2('0x22')]=function(_0x379bb6,_0x11ab14){if(_0x379bb6[_0xb5a2('0x47')]['id']){delete _0x379bb6[_0xb5a2('0x47')]['id'];}return db[_0xb5a2('0x2c')][_0xb5a2('0x45')]({'where':{'id':_0x379bb6[_0xb5a2('0x4e')]['id']}})[_0xb5a2('0x23')](handleEntityNotFound(_0x11ab14,null))[_0xb5a2('0x23')](saveUpdates(_0x379bb6[_0xb5a2('0x47')],null))['then'](respondWithResult(_0x11ab14,null))[_0xb5a2('0x41')](handleError(_0x11ab14,null));};exports[_0xb5a2('0x26')]=function(_0xfb9c2,_0x2771a9){return db[_0xb5a2('0x2c')]['find']({'where':{'id':_0xfb9c2[_0xb5a2('0x4e')]['id']}})[_0xb5a2('0x23')](handleEntityNotFound(_0x2771a9,null))[_0xb5a2('0x23')](removeEntity(_0x2771a9,null))[_0xb5a2('0x41')](handleError(_0x2771a9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 98507ca..f969d8b 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 _0x3d1f=['../../config/environment','./template.attributes','define','tools_templates','../../config/logger','bluebird','path','rimraf'];(function(_0x55569a,_0x4c78b5){var _0x2f6046=function(_0x2a4a8c){while(--_0x2a4a8c){_0x55569a['push'](_0x55569a['shift']());}};_0x2f6046(++_0x4c78b5);}(_0x3d1f,0x174));var _0xf3d1=function(_0x4b2929,_0x388297){_0x4b2929=_0x4b2929-0x0;var _0x54f42b=_0x3d1f[_0x4b2929];return _0x54f42b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf3d1('0x0'))('api');var moment=require('moment');var BPromise=require(_0xf3d1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3d1('0x2'));var rimraf=require(_0xf3d1('0x3'));var config=require(_0xf3d1('0x4'));var attributes=require(_0xf3d1('0x5'));module['exports']=function(_0x4b9fc6,_0x19a6ff){return _0x4b9fc6[_0xf3d1('0x6')]('Template',attributes,{'tableName':_0xf3d1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb212=['define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0xe09623,_0x169462){var _0xb1801f=function(_0x570ba5){while(--_0x570ba5){_0xe09623['push'](_0xe09623['shift']());}};_0xb1801f(++_0x169462);}(_0xb212,0x12e));var _0x2b21=function(_0x1b5405,_0x44b5bc){_0x1b5405=_0x1b5405-0x0;var _0x459db1=_0xb212[_0x1b5405];return _0x459db1;};'use strict';var _=require(_0x2b21('0x0'));var util=require(_0x2b21('0x1'));var logger=require(_0x2b21('0x2'))(_0x2b21('0x3'));var moment=require(_0x2b21('0x4'));var BPromise=require(_0x2b21('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b21('0x6'));var rimraf=require(_0x2b21('0x7'));var config=require(_0x2b21('0x8'));var attributes=require('./template.attributes');module[_0x2b21('0x9')]=function(_0x5587c5,_0x47395f){return _0x5587c5[_0x2b21('0xa')](_0x2b21('0xb'),attributes,{'tableName':_0x2b21('0xc'),'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 6b21a59..1f91775 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 _0xb545=['Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Template,\x20%s,\x20%s','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x4ecd6f,_0x359110){var _0x1f6692=function(_0x1a20ce){while(--_0x1a20ce){_0x4ecd6f['push'](_0x4ecd6f['shift']());}};_0x1f6692(++_0x359110);}(_0xb545,0x195));var _0x5b54=function(_0x92d91f,_0x39b9d9){_0x92d91f=_0x92d91f-0x0;var _0x5276f2=_0xb545[_0x92d91f];return _0x5276f2;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var moment=require(_0x5b54('0x2'));var BPromise=require(_0x5b54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b54('0x4'));var db=require(_0x5b54('0x5'))['db'];var utils=require(_0x5b54('0x6'));var logger=require('../../config/logger')(_0x5b54('0x7'));var config=require(_0x5b54('0x8'));var jayson=require(_0x5b54('0x9'));var client=jayson[_0x5b54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe61e71,_0x35ddb8,_0x5be850){return new BPromise(function(_0xe279b1,_0x324321){return client[_0x5b54('0xb')](_0xe61e71,_0x5be850)[_0x5b54('0xc')](function(_0x2d7c1f){logger[_0x5b54('0xd')]('Template,\x20%s,\x20%s',_0x35ddb8,'request\x20sent');logger[_0x5b54('0xe')](_0x5b54('0xf'),_0x35ddb8,_0x5b54('0x10'),JSON[_0x5b54('0x11')](_0x2d7c1f));if(_0x2d7c1f[_0x5b54('0x12')]){if(_0x2d7c1f[_0x5b54('0x12')][_0x5b54('0x13')]===0x1f4){logger[_0x5b54('0x12')]('Template,\x20%s,\x20%s',_0x35ddb8,_0x2d7c1f[_0x5b54('0x12')][_0x5b54('0x14')]);return _0x324321(_0x2d7c1f[_0x5b54('0x12')]['message']);}logger[_0x5b54('0x12')]('Template,\x20%s,\x20%s',_0x35ddb8,_0x2d7c1f[_0x5b54('0x12')][_0x5b54('0x14')]);return _0xe279b1(_0x2d7c1f[_0x5b54('0x12')][_0x5b54('0x14')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x35ddb8,_0x5b54('0x10'));_0xe279b1(_0x2d7c1f[_0x5b54('0x15')][_0x5b54('0x14')]);}})[_0x5b54('0x16')](function(_0x2a97bf){logger[_0x5b54('0x12')](_0x5b54('0x17'),_0x35ddb8,_0x2a97bf);_0x324321(_0x2a97bf);});});}exports[_0x5b54('0x18')]=function(_0x12a910){var _0x6286fb=this;return new Promise(function(_0x2e0703,_0x760bf7){return db[_0x5b54('0x19')][_0x5b54('0x1a')]({'raw':_0x12a910[_0x5b54('0x1b')]?_0x12a910['options'][_0x5b54('0x1c')]===undefined?!![]:![]:!![],'where':_0x12a910[_0x5b54('0x1b')]?_0x12a910['options'][_0x5b54('0x1d')]||null:null,'attributes':_0x12a910['options']?_0x12a910[_0x5b54('0x1b')][_0x5b54('0x1e')]||null:null,'limit':_0x12a910[_0x5b54('0x1b')]?_0x12a910[_0x5b54('0x1b')][_0x5b54('0x1f')]||null:null,'include':_0x12a910[_0x5b54('0x1b')]?_0x12a910[_0x5b54('0x1b')][_0x5b54('0x20')]?_[_0x5b54('0x21')](_0x12a910['options'][_0x5b54('0x20')],function(_0x81c9a0){return{'model':db[_0x81c9a0[_0x5b54('0x22')]],'as':_0x81c9a0['as'],'attributes':_0x81c9a0[_0x5b54('0x1e')],'include':_0x81c9a0[_0x5b54('0x20')]?_['map'](_0x81c9a0[_0x5b54('0x20')],function(_0x469a05){return{'model':db[_0x469a05[_0x5b54('0x22')]],'as':_0x469a05['as'],'attributes':_0x469a05[_0x5b54('0x1e')],'include':_0x469a05[_0x5b54('0x20')]?_['map'](_0x469a05[_0x5b54('0x20')],function(_0x32af89){return{'model':db[_0x32af89[_0x5b54('0x22')]],'as':_0x32af89['as'],'attributes':_0x32af89[_0x5b54('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b54('0xc')](function(_0x15f930){logger[_0x5b54('0xd')](_0x5b54('0x18'),_0x12a910);logger[_0x5b54('0xe')](_0x5b54('0x18'),_0x12a910,JSON[_0x5b54('0x11')](_0x15f930));_0x2e0703(_0x15f930);})['catch'](function(_0x87bfe9){logger[_0x5b54('0x12')](_0x5b54('0x18'),_0x87bfe9[_0x5b54('0x14')],_0x12a910);_0x760bf7(_0x6286fb[_0x5b54('0x12')](0x1f4,_0x87bfe9['message']));});});}; \ No newline at end of file +var _0x0a48=['error','code','message','result','catch','GetTemplate','findAll','options','where','include','map','model','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b2d38,_0x3c461a){var _0x2f7806=function(_0x3433c9){while(--_0x3433c9){_0x5b2d38['push'](_0x5b2d38['shift']());}};_0x2f7806(++_0x3c461a);}(_0x0a48,0x115));var _0x80a4=function(_0x42f06f,_0x558e76){_0x42f06f=_0x42f06f-0x0;var _0x4a0f50=_0x0a48[_0x42f06f];return _0x4a0f50;};'use strict';var _=require('lodash');var util=require(_0x80a4('0x0'));var moment=require('moment');var BPromise=require(_0x80a4('0x1'));var rs=require(_0x80a4('0x2'));var fs=require('fs');var Redis=require(_0x80a4('0x3'));var db=require(_0x80a4('0x4'))['db'];var utils=require(_0x80a4('0x5'));var logger=require(_0x80a4('0x6'))(_0x80a4('0x7'));var config=require(_0x80a4('0x8'));var jayson=require(_0x80a4('0x9'));var client=jayson[_0x80a4('0xa')][_0x80a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x69709d,_0x46b120,_0x4e584a){return new BPromise(function(_0x2d6753,_0x5a71e3){return client[_0x80a4('0xc')](_0x69709d,_0x4e584a)[_0x80a4('0xd')](function(_0x175a49){logger[_0x80a4('0xe')](_0x80a4('0xf'),_0x46b120,_0x80a4('0x10'));logger[_0x80a4('0x11')](_0x80a4('0x12'),_0x46b120,_0x80a4('0x10'),JSON[_0x80a4('0x13')](_0x175a49));if(_0x175a49[_0x80a4('0x14')]){if(_0x175a49[_0x80a4('0x14')][_0x80a4('0x15')]===0x1f4){logger[_0x80a4('0x14')](_0x80a4('0xf'),_0x46b120,_0x175a49['error']['message']);return _0x5a71e3(_0x175a49['error'][_0x80a4('0x16')]);}logger[_0x80a4('0x14')](_0x80a4('0xf'),_0x46b120,_0x175a49[_0x80a4('0x14')][_0x80a4('0x16')]);return _0x2d6753(_0x175a49[_0x80a4('0x14')][_0x80a4('0x16')]);}else{logger[_0x80a4('0xe')]('Template,\x20%s,\x20%s',_0x46b120,_0x80a4('0x10'));_0x2d6753(_0x175a49[_0x80a4('0x17')][_0x80a4('0x16')]);}})[_0x80a4('0x18')](function(_0x580236){logger['error']('Template,\x20%s,\x20%s',_0x46b120,_0x580236);_0x5a71e3(_0x580236);});});}exports[_0x80a4('0x19')]=function(_0x5c3c96){var _0x467f57=this;return new Promise(function(_0x27b7f7,_0x3b043b){return db['Template'][_0x80a4('0x1a')]({'raw':_0x5c3c96['options']?_0x5c3c96[_0x80a4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5c3c96['options']?_0x5c3c96[_0x80a4('0x1b')][_0x80a4('0x1c')]||null:null,'attributes':_0x5c3c96['options']?_0x5c3c96['options']['attributes']||null:null,'limit':_0x5c3c96[_0x80a4('0x1b')]?_0x5c3c96[_0x80a4('0x1b')]['limit']||null:null,'include':_0x5c3c96[_0x80a4('0x1b')]?_0x5c3c96[_0x80a4('0x1b')][_0x80a4('0x1d')]?_[_0x80a4('0x1e')](_0x5c3c96[_0x80a4('0x1b')][_0x80a4('0x1d')],function(_0x4f0cca){return{'model':db[_0x4f0cca[_0x80a4('0x1f')]],'as':_0x4f0cca['as'],'attributes':_0x4f0cca['attributes'],'include':_0x4f0cca['include']?_[_0x80a4('0x1e')](_0x4f0cca[_0x80a4('0x1d')],function(_0x105bc9){return{'model':db[_0x105bc9[_0x80a4('0x1f')]],'as':_0x105bc9['as'],'attributes':_0x105bc9[_0x80a4('0x20')],'include':_0x105bc9[_0x80a4('0x1d')]?_[_0x80a4('0x1e')](_0x105bc9[_0x80a4('0x1d')],function(_0x21bcd8){return{'model':db[_0x21bcd8['model']],'as':_0x21bcd8['as'],'attributes':_0x21bcd8['attributes']};}):[]};}):[]};}):[]:[]})[_0x80a4('0xd')](function(_0x37da31){logger[_0x80a4('0xe')](_0x80a4('0x19'),_0x5c3c96);logger[_0x80a4('0x11')]('GetTemplate',_0x5c3c96,JSON[_0x80a4('0x13')](_0x37da31));_0x27b7f7(_0x37da31);})[_0x80a4('0x18')](function(_0x13df9a){logger[_0x80a4('0x14')](_0x80a4('0x19'),_0x13df9a[_0x80a4('0x16')],_0x5c3c96);_0x3b043b(_0x467f57['error'](0x1f4,_0x13df9a[_0x80a4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 19b5a2b..dafdb30 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 _0x399d=['isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAction','/:id','update','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get'];(function(_0x3efc77,_0x1fa6ad){var _0x146c7e=function(_0x3f59ea){while(--_0x3f59ea){_0x3efc77['push'](_0x3efc77['shift']());}};_0x146c7e(++_0x1fa6ad);}(_0x399d,0x196));var _0xd399=function(_0x7ead6d,_0x29591a){_0x7ead6d=_0x7ead6d-0x0;var _0xc43e84=_0x399d[_0x7ead6d];return _0xc43e84;};'use strict';var multer=require(_0xd399('0x0'));var util=require('util');var path=require(_0xd399('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd399('0x2')]();var fs_extra=require(_0xd399('0x3'));var auth=require(_0xd399('0x4'));var interaction=require(_0xd399('0x5'));var config=require('../../config/environment');var controller=require(_0xd399('0x6'));router[_0xd399('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xd399('0x8')](),controller[_0xd399('0x9')]);router[_0xd399('0x7')](_0xd399('0xa'),auth[_0xd399('0x8')](),controller[_0xd399('0xb')]);router[_0xd399('0x7')](_0xd399('0xc'),auth['isAuthenticated'](),controller[_0xd399('0xd')]);router[_0xd399('0x7')](_0xd399('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0xd399('0xf')]);router[_0xd399('0x10')](_0xd399('0xa'),auth[_0xd399('0x8')](),controller[_0xd399('0x11')]);router[_0xd399('0x10')](_0xd399('0xc'),auth[_0xd399('0x8')](),controller['addAnyCondition']);router[_0xd399('0x10')](_0xd399('0xe'),auth['isAuthenticated'](),controller[_0xd399('0x12')]);router['put'](_0xd399('0x13'),auth[_0xd399('0x8')](),controller[_0xd399('0x14')]);router[_0xd399('0x15')](_0xd399('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xd399('0x16')]=router; \ No newline at end of file +var _0x7e37=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','update','delete','exports'];(function(_0x254f9b,_0x2e6e25){var _0x374a1c=function(_0x2b31ce){while(--_0x2b31ce){_0x254f9b['push'](_0x254f9b['shift']());}};_0x374a1c(++_0x2e6e25);}(_0x7e37,0xf3));var _0x77e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e37[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x77e3('0x0'));var util=require(_0x77e3('0x1'));var path=require(_0x77e3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77e3('0x3')]();var fs_extra=require(_0x77e3('0x4'));var auth=require(_0x77e3('0x5'));var interaction=require(_0x77e3('0x6'));var config=require(_0x77e3('0x7'));var controller=require('./trigger.controller');router['get']('/',auth[_0x77e3('0x8')](),controller[_0x77e3('0x9')]);router[_0x77e3('0xa')](_0x77e3('0xb'),auth[_0x77e3('0x8')](),controller[_0x77e3('0xc')]);router['get'](_0x77e3('0xd'),auth[_0x77e3('0x8')](),controller[_0x77e3('0xe')]);router['get'](_0x77e3('0xf'),auth[_0x77e3('0x8')](),controller[_0x77e3('0x10')]);router[_0x77e3('0xa')](_0x77e3('0x11'),auth[_0x77e3('0x8')](),controller[_0x77e3('0x12')]);router['post']('/',auth[_0x77e3('0x8')](),controller[_0x77e3('0x13')]);router[_0x77e3('0x14')](_0x77e3('0xd'),auth[_0x77e3('0x8')](),controller[_0x77e3('0x15')]);router[_0x77e3('0x14')](_0x77e3('0xf'),auth[_0x77e3('0x8')](),controller[_0x77e3('0x16')]);router[_0x77e3('0x14')]('/:id/actions',auth['isAuthenticated'](),controller[_0x77e3('0x17')]);router['put']('/:id',auth[_0x77e3('0x8')](),controller[_0x77e3('0x18')]);router[_0x77e3('0x19')](_0x77e3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x77e3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f36bca7..22a42a6 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 _0x0721=['sequelize','exports','STRING','BOOLEAN'];(function(_0x48ce78,_0x2dffea){var _0x5dbe35=function(_0x44a91b){while(--_0x44a91b){_0x48ce78['push'](_0x48ce78['shift']());}};_0x5dbe35(++_0x2dffea);}(_0x0721,0x1d8));var _0x1072=function(_0x2f4e7a,_0x4c3f4e){_0x2f4e7a=_0x2f4e7a-0x0;var _0x3299a0=_0x0721[_0x2f4e7a];return _0x3299a0;};'use strict';var Sequelize=require(_0x1072('0x0'));module[_0x1072('0x1')]={'name':{'type':Sequelize[_0x1072('0x2')]},'channel':{'type':Sequelize[_0x1072('0x2')]},'description':{'type':Sequelize[_0x1072('0x2')]},'status':{'type':Sequelize[_0x1072('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9df0=['STRING','sequelize','exports'];(function(_0x3b8349,_0x2146ac){var _0x4a9fc3=function(_0x24d0c7){while(--_0x24d0c7){_0x3b8349['push'](_0x3b8349['shift']());}};_0x4a9fc3(++_0x2146ac);}(_0x9df0,0x166));var _0x09df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9df0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x09df('0x0'));module[_0x09df('0x1')]={'name':{'type':Sequelize[_0x09df('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x09df('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index daab26a..1987e21 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 _0x5467=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','Trigger','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','catch','body','user','Triggers','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Condition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x5467,0x106));var _0x7546=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5467[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7546('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7546('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7546('0x2'));var moment=require(_0x7546('0x3'));var BPromise=require(_0x7546('0x4'));var Mustache=require('mustache');var util=require(_0x7546('0x5'));var path=require(_0x7546('0x6'));var sox=require(_0x7546('0x7'));var csv=require(_0x7546('0x8'));var ejs=require(_0x7546('0x9'));var fs=require('fs');var fs_extra=require(_0x7546('0xa'));var _=require('lodash');var squel=require(_0x7546('0xb'));var crypto=require(_0x7546('0xc'));var jsforce=require(_0x7546('0xd'));var deskjs=require(_0x7546('0xe'));var toCsv=require(_0x7546('0x8'));var querystring=require(_0x7546('0xf'));var Papa=require(_0x7546('0x10'));var Redis=require(_0x7546('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7546('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7546('0x13'));var logger=require(_0x7546('0x14'))(_0x7546('0x15'));var utils=require(_0x7546('0x16'));var config=require(_0x7546('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7546('0x18'))['db'];function respondWithStatusCode(_0x4f5cb7,_0x14b9d0){_0x14b9d0=_0x14b9d0||0xcc;return function(_0x3a708a){if(_0x3a708a){return _0x4f5cb7[_0x7546('0x19')](_0x14b9d0);}return _0x4f5cb7[_0x7546('0x1a')](_0x14b9d0)[_0x7546('0x1b')]();};}function respondWithResult(_0x59df2e,_0xf3f0f0){_0xf3f0f0=_0xf3f0f0||0xc8;return function(_0x549820){if(_0x549820){return _0x59df2e[_0x7546('0x1a')](_0xf3f0f0)[_0x7546('0x1c')](_0x549820);}};}function respondWithFilteredResult(_0x3248a0,_0xaa873d){return function(_0x547500){if(_0x547500){var _0x23a0d4=typeof _0xaa873d[_0x7546('0x1d')]===_0x7546('0x1e')&&typeof _0xaa873d['limit']===_0x7546('0x1e');var _0x2559a5=_0x547500[_0x7546('0x1f')];var _0x1c6bfa=_0x23a0d4?0x0:_0xaa873d[_0x7546('0x1d')];var _0xc93f72=_0x23a0d4?_0x547500[_0x7546('0x1f')]:_0xaa873d[_0x7546('0x1d')]+_0xaa873d[_0x7546('0x20')];var _0x285e6f;if(_0xc93f72>=_0x2559a5){_0xc93f72=_0x2559a5;_0x285e6f=0xc8;}else{_0x285e6f=0xce;}_0x3248a0[_0x7546('0x1a')](_0x285e6f);return _0x3248a0[_0x7546('0x21')]('Content-Range',_0x1c6bfa+'-'+_0xc93f72+'/'+_0x2559a5)[_0x7546('0x1c')](_0x547500);}return null;};}function patchUpdates(_0x5b287e){return function(_0x58141d){try{jsonpatch['apply'](_0x58141d,_0x5b287e,!![]);}catch(_0x23f0a0){return BPromise[_0x7546('0x22')](_0x23f0a0);}return _0x58141d[_0x7546('0x23')]();};}function saveUpdates(_0x40e112,_0x36ed6b){return function(_0xb0e2ac){if(_0xb0e2ac){return _0xb0e2ac[_0x7546('0x24')](_0x40e112)[_0x7546('0x25')](function(_0x73f92d){return _0x73f92d;});}return null;};}function removeEntity(_0x34301c,_0x35da6c){return function(_0x525eb9){if(_0x525eb9){return _0x525eb9[_0x7546('0x26')]()[_0x7546('0x25')](function(){var _0xd8d523=_0x525eb9[_0x7546('0x27')]({'plain':!![]});var _0x4189e2='Triggers';return db[_0x7546('0x28')][_0x7546('0x26')]({'where':{'type':_0x4189e2,'resourceId':_0xd8d523['id']}})['then'](function(){return _0x525eb9;});})[_0x7546('0x25')](function(){_0x34301c[_0x7546('0x1a')](0xcc)[_0x7546('0x1b')]();});}};}function handleEntityNotFound(_0x57add9,_0x5d5b78){return function(_0x2a60ac){if(!_0x2a60ac){_0x57add9[_0x7546('0x19')](0x194);}return _0x2a60ac;};}function handleError(_0x41d82c,_0x286711){_0x286711=_0x286711||0x1f4;return function(_0x1abe8d){logger[_0x7546('0x29')](_0x1abe8d[_0x7546('0x2a')]);if(_0x1abe8d[_0x7546('0x2b')]){delete _0x1abe8d[_0x7546('0x2b')];}_0x41d82c['status'](_0x286711)['send'](_0x1abe8d);};}exports[_0x7546('0x2c')]=function(_0x1d00a0,_0x91b890){var _0x175da1={},_0x486559={},_0x339088={'count':0x0,'rows':[]};var _0x58670e=_['map'](db[_0x7546('0x2d')][_0x7546('0x2e')],function(_0x28c724){return{'name':_0x28c724['fieldName'],'type':_0x28c724[_0x7546('0x2f')][_0x7546('0x30')]};});_0x486559[_0x7546('0x31')]=_[_0x7546('0x32')](_0x58670e,'name');_0x486559[_0x7546('0x33')]=_['keys'](_0x1d00a0[_0x7546('0x33')]);_0x486559['filters']=_[_0x7546('0x34')](_0x486559[_0x7546('0x31')],_0x486559[_0x7546('0x33')]);_0x175da1[_0x7546('0x35')]=_[_0x7546('0x34')](_0x486559['model'],qs[_0x7546('0x36')](_0x1d00a0[_0x7546('0x33')]['fields']));_0x175da1[_0x7546('0x35')]=_0x175da1['attributes'][_0x7546('0x37')]?_0x175da1[_0x7546('0x35')]:_0x486559[_0x7546('0x31')];if(!_0x1d00a0[_0x7546('0x33')][_0x7546('0x38')](_0x7546('0x39'))){_0x175da1[_0x7546('0x20')]=qs[_0x7546('0x20')](_0x1d00a0[_0x7546('0x33')][_0x7546('0x20')]);_0x175da1[_0x7546('0x1d')]=qs['offset'](_0x1d00a0[_0x7546('0x33')]['offset']);}_0x175da1[_0x7546('0x3a')]=qs[_0x7546('0x3b')](_0x1d00a0[_0x7546('0x33')][_0x7546('0x3b')]);_0x175da1[_0x7546('0x3c')]=qs[_0x7546('0x3d')](_[_0x7546('0x3e')](_0x1d00a0[_0x7546('0x33')],_0x486559[_0x7546('0x3d')]),_0x58670e);if(_0x1d00a0['query']['filter']){_0x175da1[_0x7546('0x3c')]=_[_0x7546('0x3f')](_0x175da1[_0x7546('0x3c')],{'$or':_[_0x7546('0x32')](_0x58670e,function(_0x5de5dc){if(_0x5de5dc['type']!==_0x7546('0x40')){var _0x59571a={};_0x59571a[_0x5de5dc['name']]={'$like':'%'+_0x1d00a0['query'][_0x7546('0x41')]+'%'};return _0x59571a;}})});}_0x175da1=_[_0x7546('0x3f')]({},_0x175da1,_0x1d00a0[_0x7546('0x42')]);var _0x31ef7e={'where':_0x175da1[_0x7546('0x3c')]};return db['Trigger'][_0x7546('0x1f')](_0x31ef7e)[_0x7546('0x25')](function(_0x45381e){_0x339088['count']=_0x45381e;if(_0x1d00a0[_0x7546('0x33')][_0x7546('0x43')]){_0x175da1[_0x7546('0x44')]=[{'all':!![]}];}return db[_0x7546('0x2d')][_0x7546('0x45')](_0x175da1);})[_0x7546('0x25')](function(_0x3ce8a1){_0x339088[_0x7546('0x46')]=_0x3ce8a1;return _0x339088;})[_0x7546('0x25')](respondWithFilteredResult(_0x91b890,_0x175da1))['catch'](handleError(_0x91b890,null));};exports[_0x7546('0x47')]=function(_0x4c7251,_0x4d1bab){var _0x524979={'raw':![],'where':{'id':_0x4c7251['params']['id']}},_0x262041={};_0x262041[_0x7546('0x31')]=_[_0x7546('0x48')](db[_0x7546('0x2d')]['rawAttributes']);_0x262041[_0x7546('0x33')]=_[_0x7546('0x48')](_0x4c7251['query']);_0x262041[_0x7546('0x3d')]=_[_0x7546('0x34')](_0x262041[_0x7546('0x31')],_0x262041['query']);_0x524979['attributes']=_['intersection'](_0x262041[_0x7546('0x31')],qs[_0x7546('0x36')](_0x4c7251[_0x7546('0x33')]['fields']));_0x524979[_0x7546('0x35')]=_0x524979[_0x7546('0x35')][_0x7546('0x37')]?_0x524979[_0x7546('0x35')]:_0x262041['model'];if(_0x4c7251[_0x7546('0x33')][_0x7546('0x43')]){_0x524979[_0x7546('0x44')]=[{'all':!![]}];}_0x524979=_[_0x7546('0x3f')]({},_0x524979,_0x4c7251[_0x7546('0x42')]);return db[_0x7546('0x2d')][_0x7546('0x49')](_0x524979)[_0x7546('0x25')](handleEntityNotFound(_0x4d1bab,null))[_0x7546('0x25')](respondWithResult(_0x4d1bab,null))[_0x7546('0x4a')](handleError(_0x4d1bab,null));};exports['create']=function(_0x3ddfe4,_0x4d8f28){return db['Trigger']['create'](_0x3ddfe4[_0x7546('0x4b')],{})[_0x7546('0x25')](function(_0xf5702d){var _0x110b58=_0x3ddfe4['user'][_0x7546('0x27')]({'plain':!![]});if(!_0x110b58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x110b58['role']===_0x7546('0x4c')){var _0x18e23c=_0xf5702d[_0x7546('0x27')]({'plain':!![]});var _0x3eb6d4=_0x7546('0x4d');return db['UserProfileSection'][_0x7546('0x49')]({'where':{'name':_0x3eb6d4,'userProfileId':_0x110b58[_0x7546('0x4e')]},'raw':!![]})[_0x7546('0x25')](function(_0x4c2741){if(_0x4c2741&&_0x4c2741[_0x7546('0x4f')]===0x0){return db[_0x7546('0x28')][_0x7546('0x50')]({'name':_0x18e23c[_0x7546('0x2b')],'resourceId':_0x18e23c['id'],'type':_0x4c2741[_0x7546('0x2b')],'sectionId':_0x4c2741['id']},{})['then'](function(){return _0xf5702d;});}else{return _0xf5702d;}})[_0x7546('0x4a')](function(_0x8faff3){logger[_0x7546('0x29')](_0x7546('0x51'),_0x8faff3);throw _0x8faff3;});}return _0xf5702d;})['then'](respondWithResult(_0x4d8f28,0xc9))[_0x7546('0x4a')](handleError(_0x4d8f28,null));};exports[_0x7546('0x24')]=function(_0x433e20,_0x16f200){if(_0x433e20['body']['id']){delete _0x433e20[_0x7546('0x4b')]['id'];}return db[_0x7546('0x2d')][_0x7546('0x49')]({'where':{'id':_0x433e20[_0x7546('0x52')]['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x16f200,null))[_0x7546('0x25')](saveUpdates(_0x433e20[_0x7546('0x4b')],null))['then'](respondWithResult(_0x16f200,null))[_0x7546('0x4a')](handleError(_0x16f200,null));};exports[_0x7546('0x26')]=function(_0x11a788,_0x447d49){return db[_0x7546('0x2d')][_0x7546('0x49')]({'where':{'id':_0x11a788['params']['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x447d49,null))[_0x7546('0x25')](removeEntity(_0x447d49,null))['catch'](handleError(_0x447d49,null));};exports['addAllCondition']=function(_0x3c6278,_0x84c516,_0x325747){if(_0x3c6278[_0x7546('0x4b')]['id']){delete _0x3c6278[_0x7546('0x4b')]['id'];}return db['Trigger'][_0x7546('0x49')]({'where':{'id':_0x3c6278[_0x7546('0x52')]['id']}})['then'](handleEntityNotFound(_0x84c516,null))[_0x7546('0x25')](function(_0x5f4f41){if(_0x5f4f41){_0x3c6278[_0x7546('0x4b')]['TriggerAllId']=_0x5f4f41['id'];return db[_0x7546('0x53')][_0x7546('0x50')](_0x3c6278['body']);}})[_0x7546('0x25')](respondWithResult(_0x84c516,null))[_0x7546('0x4a')](handleError(_0x84c516,null));};exports['addAnyCondition']=function(_0x56d516,_0x5e0c26,_0x3ae663){if(_0x56d516[_0x7546('0x4b')]['id']){delete _0x56d516[_0x7546('0x4b')]['id'];}return db['Trigger'][_0x7546('0x49')]({'where':{'id':_0x56d516['params']['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x5e0c26,null))[_0x7546('0x25')](function(_0x1d4e7b){if(_0x1d4e7b){_0x56d516[_0x7546('0x4b')][_0x7546('0x54')]=_0x1d4e7b['id'];return db[_0x7546('0x53')]['create'](_0x56d516[_0x7546('0x4b')]);}})[_0x7546('0x25')](respondWithResult(_0x5e0c26,null))[_0x7546('0x4a')](handleError(_0x5e0c26,null));};exports['getAllConditions']=function(_0x5e1641,_0x4a087d,_0x254e70){var _0x15e46e={};var _0x50455b={};var _0x3f8d49;var _0x39db1f;return db[_0x7546('0x2d')][_0x7546('0x55')]({'where':{'id':_0x5e1641[_0x7546('0x52')]['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x4a087d,null))[_0x7546('0x25')](function(_0x557cbb){if(_0x557cbb){_0x3f8d49=_0x557cbb;_0x50455b[_0x7546('0x31')]=_[_0x7546('0x48')](db[_0x7546('0x53')][_0x7546('0x2e')]);_0x50455b[_0x7546('0x33')]=_[_0x7546('0x48')](_0x5e1641['query']);_0x50455b[_0x7546('0x3d')]=_['intersection'](_0x50455b[_0x7546('0x31')],_0x50455b[_0x7546('0x33')]);_0x15e46e[_0x7546('0x35')]=_['intersection'](_0x50455b[_0x7546('0x31')],qs[_0x7546('0x36')](_0x5e1641[_0x7546('0x33')]['fields']));_0x15e46e['attributes']=_0x15e46e[_0x7546('0x35')][_0x7546('0x37')]?_0x15e46e[_0x7546('0x35')]:_0x50455b[_0x7546('0x31')];_0x15e46e[_0x7546('0x3a')]=qs[_0x7546('0x3b')](_0x5e1641['query'][_0x7546('0x3b')]);_0x15e46e['where']=qs[_0x7546('0x3d')](_[_0x7546('0x3e')](_0x5e1641[_0x7546('0x33')],_0x50455b[_0x7546('0x3d')]));if(_0x5e1641[_0x7546('0x33')][_0x7546('0x41')]){_0x15e46e['where']=_[_0x7546('0x3f')](_0x15e46e['where'],{'$or':_[_0x7546('0x32')](_0x15e46e[_0x7546('0x35')],function(_0x2f3d95){var _0x4865e1={};_0x4865e1[_0x2f3d95]={'$like':'%'+_0x5e1641[_0x7546('0x33')][_0x7546('0x41')]+'%'};return _0x4865e1;})});}_0x15e46e=_['merge']({},_0x15e46e,_0x5e1641[_0x7546('0x42')]);return _0x3f8d49[_0x7546('0x56')](_0x15e46e);}})[_0x7546('0x25')](function(_0x198143){if(_0x198143){_0x39db1f=_0x198143['length'];if(!_0x5e1641[_0x7546('0x33')]['hasOwnProperty']('nolimit')){_0x15e46e[_0x7546('0x20')]=qs[_0x7546('0x20')](_0x5e1641['query']['limit']);_0x15e46e['offset']=qs[_0x7546('0x1d')](_0x5e1641['query']['offset']);}return _0x3f8d49['getAllConditions'](_0x15e46e);}})['then'](function(_0x1d9134){if(_0x1d9134){return _0x1d9134?{'count':_0x39db1f,'rows':_0x1d9134}:null;}})['then'](respondWithResult(_0x4a087d,null))['catch'](handleError(_0x4a087d,null));};exports[_0x7546('0x57')]=function(_0x45ad98,_0x210da6,_0x5227c8){var _0x32ee4b={};var _0x23cc51={};var _0x349b48;var _0x441d06;return db[_0x7546('0x2d')]['findOne']({'where':{'id':_0x45ad98[_0x7546('0x52')]['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x210da6,null))[_0x7546('0x25')](function(_0x26702b){if(_0x26702b){_0x349b48=_0x26702b;_0x23cc51[_0x7546('0x31')]=_[_0x7546('0x48')](db['Condition']['rawAttributes']);_0x23cc51[_0x7546('0x33')]=_[_0x7546('0x48')](_0x45ad98[_0x7546('0x33')]);_0x23cc51[_0x7546('0x3d')]=_[_0x7546('0x34')](_0x23cc51[_0x7546('0x31')],_0x23cc51['query']);_0x32ee4b[_0x7546('0x35')]=_[_0x7546('0x34')](_0x23cc51[_0x7546('0x31')],qs[_0x7546('0x36')](_0x45ad98[_0x7546('0x33')]['fields']));_0x32ee4b[_0x7546('0x35')]=_0x32ee4b[_0x7546('0x35')][_0x7546('0x37')]?_0x32ee4b[_0x7546('0x35')]:_0x23cc51[_0x7546('0x31')];_0x32ee4b[_0x7546('0x3a')]=qs[_0x7546('0x3b')](_0x45ad98[_0x7546('0x33')][_0x7546('0x3b')]);_0x32ee4b[_0x7546('0x3c')]=qs[_0x7546('0x3d')](_[_0x7546('0x3e')](_0x45ad98[_0x7546('0x33')],_0x23cc51['filters']));if(_0x45ad98['query'][_0x7546('0x41')]){_0x32ee4b[_0x7546('0x3c')]=_['merge'](_0x32ee4b[_0x7546('0x3c')],{'$or':_[_0x7546('0x32')](_0x32ee4b[_0x7546('0x35')],function(_0x34f23f){var _0x357891={};_0x357891[_0x34f23f]={'$like':'%'+_0x45ad98[_0x7546('0x33')]['filter']+'%'};return _0x357891;})});}_0x32ee4b=_['merge']({},_0x32ee4b,_0x45ad98[_0x7546('0x42')]);return _0x349b48[_0x7546('0x57')](_0x32ee4b);}})[_0x7546('0x25')](function(_0x48b629){if(_0x48b629){_0x441d06=_0x48b629['length'];if(!_0x45ad98[_0x7546('0x33')][_0x7546('0x38')]('nolimit')){_0x32ee4b[_0x7546('0x20')]=qs['limit'](_0x45ad98[_0x7546('0x33')][_0x7546('0x20')]);_0x32ee4b['offset']=qs[_0x7546('0x1d')](_0x45ad98[_0x7546('0x33')][_0x7546('0x1d')]);}return _0x349b48['getAnyConditions'](_0x32ee4b);}})['then'](function(_0x409181){if(_0x409181){return _0x409181?{'count':_0x441d06,'rows':_0x409181}:null;}})['then'](respondWithResult(_0x210da6,null))[_0x7546('0x4a')](handleError(_0x210da6,null));};exports[_0x7546('0x58')]=function(_0x8d4f44,_0x3c0207,_0x5b5dbc){if(_0x8d4f44[_0x7546('0x4b')]['id']){delete _0x8d4f44[_0x7546('0x4b')]['id'];}return db[_0x7546('0x2d')]['find']({'where':{'id':_0x8d4f44[_0x7546('0x52')]['id']}})['then'](handleEntityNotFound(_0x3c0207,null))[_0x7546('0x25')](function(_0x569e89){if(_0x569e89){_0x8d4f44[_0x7546('0x4b')][_0x7546('0x59')]=_0x569e89['id'];return db[_0x7546('0x5a')][_0x7546('0x50')](_0x8d4f44['body']);}})[_0x7546('0x25')](respondWithResult(_0x3c0207,null))[_0x7546('0x4a')](handleError(_0x3c0207,null));};exports[_0x7546('0x5b')]=function(_0x4a7ee8,_0x403ffe,_0x3c9bb2){var _0x3bd2e4={};var _0x1dfd6c={};var _0x351298;var _0x5c8625;return db['Trigger']['findOne']({'where':{'id':_0x4a7ee8['params']['id']}})[_0x7546('0x25')](handleEntityNotFound(_0x403ffe,null))[_0x7546('0x25')](function(_0x2faacd){if(_0x2faacd){_0x351298=_0x2faacd;_0x1dfd6c[_0x7546('0x31')]=_[_0x7546('0x48')](db[_0x7546('0x5a')][_0x7546('0x2e')]);_0x1dfd6c[_0x7546('0x33')]=_[_0x7546('0x48')](_0x4a7ee8[_0x7546('0x33')]);_0x1dfd6c[_0x7546('0x3d')]=_[_0x7546('0x34')](_0x1dfd6c[_0x7546('0x31')],_0x1dfd6c['query']);_0x3bd2e4[_0x7546('0x35')]=_[_0x7546('0x34')](_0x1dfd6c[_0x7546('0x31')],qs['fields'](_0x4a7ee8[_0x7546('0x33')]['fields']));_0x3bd2e4[_0x7546('0x35')]=_0x3bd2e4[_0x7546('0x35')][_0x7546('0x37')]?_0x3bd2e4[_0x7546('0x35')]:_0x1dfd6c['model'];_0x3bd2e4['order']=qs[_0x7546('0x3b')](_0x4a7ee8[_0x7546('0x33')][_0x7546('0x3b')]);_0x3bd2e4[_0x7546('0x3c')]=qs[_0x7546('0x3d')](_[_0x7546('0x3e')](_0x4a7ee8['query'],_0x1dfd6c['filters']));if(_0x4a7ee8[_0x7546('0x33')][_0x7546('0x41')]){_0x3bd2e4[_0x7546('0x3c')]=_['merge'](_0x3bd2e4[_0x7546('0x3c')],{'$or':_[_0x7546('0x32')](_0x3bd2e4[_0x7546('0x35')],function(_0x4c23fd){var _0x432f05={};_0x432f05[_0x4c23fd]={'$like':'%'+_0x4a7ee8[_0x7546('0x33')][_0x7546('0x41')]+'%'};return _0x432f05;})});}_0x3bd2e4=_[_0x7546('0x3f')]({},_0x3bd2e4,_0x4a7ee8[_0x7546('0x42')]);return _0x351298[_0x7546('0x5b')](_0x3bd2e4);}})['then'](function(_0x583fd9){if(_0x583fd9){_0x5c8625=_0x583fd9[_0x7546('0x37')];if(!_0x4a7ee8[_0x7546('0x33')][_0x7546('0x38')](_0x7546('0x39'))){_0x3bd2e4[_0x7546('0x20')]=qs[_0x7546('0x20')](_0x4a7ee8[_0x7546('0x33')]['limit']);_0x3bd2e4[_0x7546('0x1d')]=qs[_0x7546('0x1d')](_0x4a7ee8[_0x7546('0x33')][_0x7546('0x1d')]);}return _0x351298['getActions'](_0x3bd2e4);}})[_0x7546('0x25')](function(_0x2558bb){if(_0x2558bb){return _0x2558bb?{'count':_0x5c8625,'rows':_0x2558bb}:null;}})[_0x7546('0x25')](respondWithResult(_0x403ffe,null))['catch'](handleError(_0x403ffe,null));}; \ No newline at end of file +var _0xc352=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','UserProfileResource','error','name','send','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','intersection','find','create','body','user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','update','addAllCondition','addAnyCondition','TriggerAnyId','Condition','findOne','length','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x5a06df,_0x20b11e){var _0x3739a3=function(_0x942141){while(--_0x942141){_0x5a06df['push'](_0x5a06df['shift']());}};_0x3739a3(++_0x20b11e);}(_0xc352,0xab));var _0x2c35=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xc352[_0x151721];return _0x2deaa7;};'use strict';var emlformat=require(_0x2c35('0x0'));var rimraf=require(_0x2c35('0x1'));var zipdir=require(_0x2c35('0x2'));var jsonpatch=require(_0x2c35('0x3'));var rp=require(_0x2c35('0x4'));var moment=require(_0x2c35('0x5'));var BPromise=require(_0x2c35('0x6'));var Mustache=require(_0x2c35('0x7'));var util=require(_0x2c35('0x8'));var path=require(_0x2c35('0x9'));var sox=require('sox');var csv=require(_0x2c35('0xa'));var ejs=require(_0x2c35('0xb'));var fs=require('fs');var fs_extra=require(_0x2c35('0xc'));var _=require(_0x2c35('0xd'));var squel=require('squel');var crypto=require(_0x2c35('0xe'));var jsforce=require(_0x2c35('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2c35('0xa'));var querystring=require(_0x2c35('0x10'));var Papa=require(_0x2c35('0x11'));var Redis=require(_0x2c35('0x12'));var authService=require(_0x2c35('0x13'));var qs=require(_0x2c35('0x14'));var as=require(_0x2c35('0x15'));var hardwareService=require(_0x2c35('0x16'));var logger=require('../../config/logger')(_0x2c35('0x17'));var utils=require(_0x2c35('0x18'));var config=require(_0x2c35('0x19'));var licenseUtil=require(_0x2c35('0x1a'));var db=require(_0x2c35('0x1b'))['db'];function respondWithStatusCode(_0x1bf613,_0x337406){_0x337406=_0x337406||0xcc;return function(_0x26eec2){if(_0x26eec2){return _0x1bf613['sendStatus'](_0x337406);}return _0x1bf613['status'](_0x337406)[_0x2c35('0x1c')]();};}function respondWithResult(_0x10f82d,_0x1896ff){_0x1896ff=_0x1896ff||0xc8;return function(_0x4b716d){if(_0x4b716d){return _0x10f82d[_0x2c35('0x1d')](_0x1896ff)[_0x2c35('0x1e')](_0x4b716d);}};}function respondWithFilteredResult(_0x3109f8,_0x7abdbb){return function(_0x2d2d8e){if(_0x2d2d8e){var _0x388dfb=typeof _0x7abdbb[_0x2c35('0x1f')]===_0x2c35('0x20')&&typeof _0x7abdbb[_0x2c35('0x21')]===_0x2c35('0x20');var _0x4e7275=_0x2d2d8e[_0x2c35('0x22')];var _0xde5886=_0x388dfb?0x0:_0x7abdbb['offset'];var _0x55c17a=_0x388dfb?_0x2d2d8e[_0x2c35('0x22')]:_0x7abdbb['offset']+_0x7abdbb[_0x2c35('0x21')];var _0x3cdbec;if(_0x55c17a>=_0x4e7275){_0x55c17a=_0x4e7275;_0x3cdbec=0xc8;}else{_0x3cdbec=0xce;}_0x3109f8[_0x2c35('0x1d')](_0x3cdbec);return _0x3109f8[_0x2c35('0x23')](_0x2c35('0x24'),_0xde5886+'-'+_0x55c17a+'/'+_0x4e7275)['json'](_0x2d2d8e);}return null;};}function patchUpdates(_0x5266ee){return function(_0x4e9c65){try{jsonpatch[_0x2c35('0x25')](_0x4e9c65,_0x5266ee,!![]);}catch(_0x12b564){return BPromise[_0x2c35('0x26')](_0x12b564);}return _0x4e9c65['save']();};}function saveUpdates(_0x55d0b2,_0x56d13c){return function(_0x2419a1){if(_0x2419a1){return _0x2419a1['update'](_0x55d0b2)['then'](function(_0x119a51){return _0x119a51;});}return null;};}function removeEntity(_0x2e48cf,_0x415276){return function(_0x5d8192){if(_0x5d8192){return _0x5d8192[_0x2c35('0x27')]()[_0x2c35('0x28')](function(){var _0x26f357=_0x5d8192[_0x2c35('0x29')]({'plain':!![]});var _0x5205b3='Triggers';return db[_0x2c35('0x2a')][_0x2c35('0x27')]({'where':{'type':_0x5205b3,'resourceId':_0x26f357['id']}})['then'](function(){return _0x5d8192;});})[_0x2c35('0x28')](function(){_0x2e48cf['status'](0xcc)[_0x2c35('0x1c')]();});}};}function handleEntityNotFound(_0x10524f,_0x26d6c2){return function(_0x5a861d){if(!_0x5a861d){_0x10524f['sendStatus'](0x194);}return _0x5a861d;};}function handleError(_0x404d78,_0x18ee4b){_0x18ee4b=_0x18ee4b||0x1f4;return function(_0x365237){logger[_0x2c35('0x2b')](_0x365237['stack']);if(_0x365237[_0x2c35('0x2c')]){delete _0x365237['name'];}_0x404d78[_0x2c35('0x1d')](_0x18ee4b)[_0x2c35('0x2d')](_0x365237);};}exports['index']=function(_0x2f136c,_0x725bd9){var _0x441399={},_0x5a92e2={},_0x27c3ac={'count':0x0,'rows':[]};var _0x57090d=_[_0x2c35('0x2e')](db[_0x2c35('0x2f')][_0x2c35('0x30')],function(_0x302a81){return{'name':_0x302a81[_0x2c35('0x31')],'type':_0x302a81[_0x2c35('0x32')]['key']};});_0x5a92e2[_0x2c35('0x33')]=_['map'](_0x57090d,_0x2c35('0x2c'));_0x5a92e2[_0x2c35('0x34')]=_[_0x2c35('0x35')](_0x2f136c['query']);_0x5a92e2[_0x2c35('0x36')]=_['intersection'](_0x5a92e2[_0x2c35('0x33')],_0x5a92e2['query']);_0x441399[_0x2c35('0x37')]=_['intersection'](_0x5a92e2['model'],qs[_0x2c35('0x38')](_0x2f136c[_0x2c35('0x34')][_0x2c35('0x38')]));_0x441399[_0x2c35('0x37')]=_0x441399['attributes']['length']?_0x441399[_0x2c35('0x37')]:_0x5a92e2[_0x2c35('0x33')];if(!_0x2f136c[_0x2c35('0x34')]['hasOwnProperty'](_0x2c35('0x39'))){_0x441399[_0x2c35('0x21')]=qs[_0x2c35('0x21')](_0x2f136c['query']['limit']);_0x441399[_0x2c35('0x1f')]=qs['offset'](_0x2f136c[_0x2c35('0x34')][_0x2c35('0x1f')]);}_0x441399[_0x2c35('0x3a')]=qs[_0x2c35('0x3b')](_0x2f136c[_0x2c35('0x34')]['sort']);_0x441399['where']=qs['filters'](_[_0x2c35('0x3c')](_0x2f136c[_0x2c35('0x34')],_0x5a92e2[_0x2c35('0x36')]),_0x57090d);if(_0x2f136c[_0x2c35('0x34')]['filter']){_0x441399['where']=_[_0x2c35('0x3d')](_0x441399[_0x2c35('0x3e')],{'$or':_[_0x2c35('0x2e')](_0x57090d,function(_0x59bb6c){if(_0x59bb6c[_0x2c35('0x32')]!==_0x2c35('0x3f')){var _0x51c74c={};_0x51c74c[_0x59bb6c[_0x2c35('0x2c')]]={'$like':'%'+_0x2f136c[_0x2c35('0x34')][_0x2c35('0x40')]+'%'};return _0x51c74c;}})});}_0x441399=_[_0x2c35('0x3d')]({},_0x441399,_0x2f136c[_0x2c35('0x41')]);var _0x4726a0={'where':_0x441399[_0x2c35('0x3e')]};return db[_0x2c35('0x2f')][_0x2c35('0x22')](_0x4726a0)['then'](function(_0x2612c3){_0x27c3ac[_0x2c35('0x22')]=_0x2612c3;if(_0x2f136c[_0x2c35('0x34')]['includeAll']){_0x441399[_0x2c35('0x42')]=[{'all':!![]}];}return db[_0x2c35('0x2f')][_0x2c35('0x43')](_0x441399);})[_0x2c35('0x28')](function(_0x5a6524){_0x27c3ac[_0x2c35('0x44')]=_0x5a6524;return _0x27c3ac;})[_0x2c35('0x28')](respondWithFilteredResult(_0x725bd9,_0x441399))[_0x2c35('0x45')](handleError(_0x725bd9,null));};exports[_0x2c35('0x46')]=function(_0x544d3d,_0x7a63d1){var _0x4bf79f={'raw':![],'where':{'id':_0x544d3d[_0x2c35('0x47')]['id']}},_0x585e38={};_0x585e38[_0x2c35('0x33')]=_[_0x2c35('0x35')](db[_0x2c35('0x2f')][_0x2c35('0x30')]);_0x585e38[_0x2c35('0x34')]=_[_0x2c35('0x35')](_0x544d3d['query']);_0x585e38[_0x2c35('0x36')]=_[_0x2c35('0x48')](_0x585e38[_0x2c35('0x33')],_0x585e38[_0x2c35('0x34')]);_0x4bf79f[_0x2c35('0x37')]=_[_0x2c35('0x48')](_0x585e38[_0x2c35('0x33')],qs['fields'](_0x544d3d[_0x2c35('0x34')][_0x2c35('0x38')]));_0x4bf79f[_0x2c35('0x37')]=_0x4bf79f[_0x2c35('0x37')]['length']?_0x4bf79f['attributes']:_0x585e38[_0x2c35('0x33')];if(_0x544d3d[_0x2c35('0x34')]['includeAll']){_0x4bf79f[_0x2c35('0x42')]=[{'all':!![]}];}_0x4bf79f=_['merge']({},_0x4bf79f,_0x544d3d[_0x2c35('0x41')]);return db[_0x2c35('0x2f')][_0x2c35('0x49')](_0x4bf79f)['then'](handleEntityNotFound(_0x7a63d1,null))[_0x2c35('0x28')](respondWithResult(_0x7a63d1,null))[_0x2c35('0x45')](handleError(_0x7a63d1,null));};exports[_0x2c35('0x4a')]=function(_0x1cec44,_0x488c37){return db[_0x2c35('0x2f')][_0x2c35('0x4a')](_0x1cec44[_0x2c35('0x4b')],{})['then'](function(_0x5e4564){var _0x1e110b=_0x1cec44[_0x2c35('0x4c')][_0x2c35('0x29')]({'plain':!![]});if(!_0x1e110b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e110b[_0x2c35('0x4d')]===_0x2c35('0x4c')){var _0x56b8a3=_0x5e4564[_0x2c35('0x29')]({'plain':!![]});var _0x1b2ee7=_0x2c35('0x4e');return db[_0x2c35('0x4f')][_0x2c35('0x49')]({'where':{'name':_0x1b2ee7,'userProfileId':_0x1e110b[_0x2c35('0x50')]},'raw':!![]})[_0x2c35('0x28')](function(_0x191880){if(_0x191880&&_0x191880[_0x2c35('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x56b8a3[_0x2c35('0x2c')],'resourceId':_0x56b8a3['id'],'type':_0x191880['name'],'sectionId':_0x191880['id']},{})[_0x2c35('0x28')](function(){return _0x5e4564;});}else{return _0x5e4564;}})[_0x2c35('0x45')](function(_0x14f8ac){logger[_0x2c35('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14f8ac);throw _0x14f8ac;});}return _0x5e4564;})['then'](respondWithResult(_0x488c37,0xc9))[_0x2c35('0x45')](handleError(_0x488c37,null));};exports[_0x2c35('0x52')]=function(_0x333913,_0xd3f6fb){if(_0x333913[_0x2c35('0x4b')]['id']){delete _0x333913['body']['id'];}return db[_0x2c35('0x2f')][_0x2c35('0x49')]({'where':{'id':_0x333913[_0x2c35('0x47')]['id']}})[_0x2c35('0x28')](handleEntityNotFound(_0xd3f6fb,null))['then'](saveUpdates(_0x333913[_0x2c35('0x4b')],null))[_0x2c35('0x28')](respondWithResult(_0xd3f6fb,null))[_0x2c35('0x45')](handleError(_0xd3f6fb,null));};exports[_0x2c35('0x27')]=function(_0x19abcf,_0x157799){return db[_0x2c35('0x2f')][_0x2c35('0x49')]({'where':{'id':_0x19abcf['params']['id']}})[_0x2c35('0x28')](handleEntityNotFound(_0x157799,null))[_0x2c35('0x28')](removeEntity(_0x157799,null))[_0x2c35('0x45')](handleError(_0x157799,null));};exports[_0x2c35('0x53')]=function(_0x14b230,_0x51c029,_0xe8bce9){if(_0x14b230[_0x2c35('0x4b')]['id']){delete _0x14b230['body']['id'];}return db[_0x2c35('0x2f')][_0x2c35('0x49')]({'where':{'id':_0x14b230['params']['id']}})['then'](handleEntityNotFound(_0x51c029,null))[_0x2c35('0x28')](function(_0x1f68fe){if(_0x1f68fe){_0x14b230[_0x2c35('0x4b')]['TriggerAllId']=_0x1f68fe['id'];return db['Condition'][_0x2c35('0x4a')](_0x14b230[_0x2c35('0x4b')]);}})[_0x2c35('0x28')](respondWithResult(_0x51c029,null))['catch'](handleError(_0x51c029,null));};exports[_0x2c35('0x54')]=function(_0x338d34,_0x1fadbf,_0xb68f61){if(_0x338d34[_0x2c35('0x4b')]['id']){delete _0x338d34['body']['id'];}return db[_0x2c35('0x2f')][_0x2c35('0x49')]({'where':{'id':_0x338d34[_0x2c35('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fadbf,null))[_0x2c35('0x28')](function(_0x371b2c){if(_0x371b2c){_0x338d34[_0x2c35('0x4b')][_0x2c35('0x55')]=_0x371b2c['id'];return db[_0x2c35('0x56')]['create'](_0x338d34[_0x2c35('0x4b')]);}})[_0x2c35('0x28')](respondWithResult(_0x1fadbf,null))[_0x2c35('0x45')](handleError(_0x1fadbf,null));};exports['getAllConditions']=function(_0x567bf9,_0x3f2500,_0x41f028){var _0x8bdb61={};var _0x39c217={};var _0x1966f5;var _0x4c025b;return db[_0x2c35('0x2f')][_0x2c35('0x57')]({'where':{'id':_0x567bf9[_0x2c35('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f2500,null))['then'](function(_0x3782e1){if(_0x3782e1){_0x1966f5=_0x3782e1;_0x39c217['model']=_[_0x2c35('0x35')](db[_0x2c35('0x56')][_0x2c35('0x30')]);_0x39c217['query']=_[_0x2c35('0x35')](_0x567bf9['query']);_0x39c217[_0x2c35('0x36')]=_[_0x2c35('0x48')](_0x39c217['model'],_0x39c217[_0x2c35('0x34')]);_0x8bdb61['attributes']=_['intersection'](_0x39c217[_0x2c35('0x33')],qs[_0x2c35('0x38')](_0x567bf9['query']['fields']));_0x8bdb61[_0x2c35('0x37')]=_0x8bdb61[_0x2c35('0x37')][_0x2c35('0x58')]?_0x8bdb61[_0x2c35('0x37')]:_0x39c217['model'];_0x8bdb61['order']=qs[_0x2c35('0x3b')](_0x567bf9[_0x2c35('0x34')][_0x2c35('0x3b')]);_0x8bdb61['where']=qs[_0x2c35('0x36')](_[_0x2c35('0x3c')](_0x567bf9[_0x2c35('0x34')],_0x39c217[_0x2c35('0x36')]));if(_0x567bf9[_0x2c35('0x34')][_0x2c35('0x40')]){_0x8bdb61[_0x2c35('0x3e')]=_[_0x2c35('0x3d')](_0x8bdb61[_0x2c35('0x3e')],{'$or':_[_0x2c35('0x2e')](_0x8bdb61['attributes'],function(_0x50cbc6){var _0x3905e6={};_0x3905e6[_0x50cbc6]={'$like':'%'+_0x567bf9[_0x2c35('0x34')][_0x2c35('0x40')]+'%'};return _0x3905e6;})});}_0x8bdb61=_['merge']({},_0x8bdb61,_0x567bf9[_0x2c35('0x41')]);return _0x1966f5['getAllConditions'](_0x8bdb61);}})['then'](function(_0x58b560){if(_0x58b560){_0x4c025b=_0x58b560['length'];if(!_0x567bf9[_0x2c35('0x34')][_0x2c35('0x59')]('nolimit')){_0x8bdb61[_0x2c35('0x21')]=qs[_0x2c35('0x21')](_0x567bf9[_0x2c35('0x34')]['limit']);_0x8bdb61[_0x2c35('0x1f')]=qs[_0x2c35('0x1f')](_0x567bf9['query'][_0x2c35('0x1f')]);}return _0x1966f5['getAllConditions'](_0x8bdb61);}})[_0x2c35('0x28')](function(_0x285615){if(_0x285615){return _0x285615?{'count':_0x4c025b,'rows':_0x285615}:null;}})[_0x2c35('0x28')](respondWithResult(_0x3f2500,null))[_0x2c35('0x45')](handleError(_0x3f2500,null));};exports[_0x2c35('0x5a')]=function(_0x3f6bf5,_0x4e8b8c,_0x591622){var _0x598daa={};var _0x576e00={};var _0x5792d1;var _0x281548;return db[_0x2c35('0x2f')][_0x2c35('0x57')]({'where':{'id':_0x3f6bf5['params']['id']}})['then'](handleEntityNotFound(_0x4e8b8c,null))[_0x2c35('0x28')](function(_0x1a24e6){if(_0x1a24e6){_0x5792d1=_0x1a24e6;_0x576e00['model']=_[_0x2c35('0x35')](db[_0x2c35('0x56')][_0x2c35('0x30')]);_0x576e00[_0x2c35('0x34')]=_[_0x2c35('0x35')](_0x3f6bf5[_0x2c35('0x34')]);_0x576e00['filters']=_[_0x2c35('0x48')](_0x576e00[_0x2c35('0x33')],_0x576e00['query']);_0x598daa[_0x2c35('0x37')]=_['intersection'](_0x576e00[_0x2c35('0x33')],qs['fields'](_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x38')]));_0x598daa[_0x2c35('0x37')]=_0x598daa[_0x2c35('0x37')]['length']?_0x598daa[_0x2c35('0x37')]:_0x576e00[_0x2c35('0x33')];_0x598daa['order']=qs[_0x2c35('0x3b')](_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x3b')]);_0x598daa[_0x2c35('0x3e')]=qs[_0x2c35('0x36')](_['pick'](_0x3f6bf5[_0x2c35('0x34')],_0x576e00['filters']));if(_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x40')]){_0x598daa[_0x2c35('0x3e')]=_['merge'](_0x598daa['where'],{'$or':_[_0x2c35('0x2e')](_0x598daa[_0x2c35('0x37')],function(_0x58e4e8){var _0x15697b={};_0x15697b[_0x58e4e8]={'$like':'%'+_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x40')]+'%'};return _0x15697b;})});}_0x598daa=_[_0x2c35('0x3d')]({},_0x598daa,_0x3f6bf5[_0x2c35('0x41')]);return _0x5792d1[_0x2c35('0x5a')](_0x598daa);}})[_0x2c35('0x28')](function(_0x5d21b1){if(_0x5d21b1){_0x281548=_0x5d21b1[_0x2c35('0x58')];if(!_0x3f6bf5[_0x2c35('0x34')]['hasOwnProperty']('nolimit')){_0x598daa[_0x2c35('0x21')]=qs[_0x2c35('0x21')](_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x21')]);_0x598daa[_0x2c35('0x1f')]=qs[_0x2c35('0x1f')](_0x3f6bf5[_0x2c35('0x34')][_0x2c35('0x1f')]);}return _0x5792d1[_0x2c35('0x5a')](_0x598daa);}})[_0x2c35('0x28')](function(_0x33f5a3){if(_0x33f5a3){return _0x33f5a3?{'count':_0x281548,'rows':_0x33f5a3}:null;}})[_0x2c35('0x28')](respondWithResult(_0x4e8b8c,null))[_0x2c35('0x45')](handleError(_0x4e8b8c,null));};exports[_0x2c35('0x5b')]=function(_0x1693dc,_0x439b1f,_0x2df0e6){if(_0x1693dc[_0x2c35('0x4b')]['id']){delete _0x1693dc[_0x2c35('0x4b')]['id'];}return db[_0x2c35('0x2f')][_0x2c35('0x49')]({'where':{'id':_0x1693dc[_0x2c35('0x47')]['id']}})[_0x2c35('0x28')](handleEntityNotFound(_0x439b1f,null))[_0x2c35('0x28')](function(_0x473620){if(_0x473620){_0x1693dc['body'][_0x2c35('0x5c')]=_0x473620['id'];return db[_0x2c35('0x5d')][_0x2c35('0x4a')](_0x1693dc[_0x2c35('0x4b')]);}})[_0x2c35('0x28')](respondWithResult(_0x439b1f,null))['catch'](handleError(_0x439b1f,null));};exports[_0x2c35('0x5e')]=function(_0x10e22d,_0x8154f3,_0x42a683){var _0x526981={};var _0x519b0b={};var _0x5306e7;var _0x3ccfb2;return db['Trigger'][_0x2c35('0x57')]({'where':{'id':_0x10e22d[_0x2c35('0x47')]['id']}})[_0x2c35('0x28')](handleEntityNotFound(_0x8154f3,null))[_0x2c35('0x28')](function(_0x393d4c){if(_0x393d4c){_0x5306e7=_0x393d4c;_0x519b0b['model']=_['keys'](db['Action'][_0x2c35('0x30')]);_0x519b0b[_0x2c35('0x34')]=_['keys'](_0x10e22d[_0x2c35('0x34')]);_0x519b0b[_0x2c35('0x36')]=_[_0x2c35('0x48')](_0x519b0b[_0x2c35('0x33')],_0x519b0b['query']);_0x526981[_0x2c35('0x37')]=_['intersection'](_0x519b0b['model'],qs['fields'](_0x10e22d[_0x2c35('0x34')][_0x2c35('0x38')]));_0x526981[_0x2c35('0x37')]=_0x526981['attributes']['length']?_0x526981['attributes']:_0x519b0b[_0x2c35('0x33')];_0x526981[_0x2c35('0x3a')]=qs[_0x2c35('0x3b')](_0x10e22d[_0x2c35('0x34')][_0x2c35('0x3b')]);_0x526981['where']=qs[_0x2c35('0x36')](_[_0x2c35('0x3c')](_0x10e22d[_0x2c35('0x34')],_0x519b0b[_0x2c35('0x36')]));if(_0x10e22d[_0x2c35('0x34')]['filter']){_0x526981[_0x2c35('0x3e')]=_['merge'](_0x526981[_0x2c35('0x3e')],{'$or':_[_0x2c35('0x2e')](_0x526981['attributes'],function(_0x4459fb){var _0x338787={};_0x338787[_0x4459fb]={'$like':'%'+_0x10e22d[_0x2c35('0x34')][_0x2c35('0x40')]+'%'};return _0x338787;})});}_0x526981=_[_0x2c35('0x3d')]({},_0x526981,_0x10e22d['options']);return _0x5306e7['getActions'](_0x526981);}})[_0x2c35('0x28')](function(_0x2afa06){if(_0x2afa06){_0x3ccfb2=_0x2afa06['length'];if(!_0x10e22d[_0x2c35('0x34')][_0x2c35('0x59')]('nolimit')){_0x526981[_0x2c35('0x21')]=qs[_0x2c35('0x21')](_0x10e22d[_0x2c35('0x34')][_0x2c35('0x21')]);_0x526981['offset']=qs[_0x2c35('0x1f')](_0x10e22d['query'][_0x2c35('0x1f')]);}return _0x5306e7[_0x2c35('0x5e')](_0x526981);}})[_0x2c35('0x28')](function(_0x503b2a){if(_0x503b2a){return _0x503b2a?{'count':_0x3ccfb2,'rows':_0x503b2a}:null;}})['then'](respondWithResult(_0x8154f3,null))[_0x2c35('0x45')](handleError(_0x8154f3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 214bcbe..e4bc1e7 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 _0x4016=['../../config/logger','request-promise','rimraf','../../config/environment','Trigger','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4016,0x131));var _0x6401=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4016[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x6401('0x0'));var logger=require(_0x6401('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6401('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6401('0x3'));var config=require(_0x6401('0x4'));var attributes=require('./trigger.attributes');module['exports']=function(_0x3e2c0b,_0x34c7f2){return _0x3e2c0b['define'](_0x6401('0x5'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7b4=['bluebird','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','util','../../config/logger','moment'];(function(_0x1f5249,_0x5c4c86){var _0x20e223=function(_0x15eb45){while(--_0x15eb45){_0x1f5249['push'](_0x1f5249['shift']());}};_0x20e223(++_0x5c4c86);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x2cd9e8,_0x3520ed){_0x2cd9e8=_0x2cd9e8-0x0;var _0x2f712f=_0xa7b4[_0x2cd9e8];return _0x2f712f;};'use strict';var _=require('lodash');var util=require(_0x4a7b('0x0'));var logger=require(_0x4a7b('0x1'))('api');var moment=require(_0x4a7b('0x2'));var BPromise=require(_0x4a7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a7b('0x4'));var attributes=require(_0x4a7b('0x5'));module['exports']=function(_0x27e783,_0xf43e24){return _0x27e783[_0x4a7b('0x6')](_0x4a7b('0x7'),attributes,{'tableName':_0x4a7b('0x8'),'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 5dbd334..3502452 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 _0x7591=['include','model','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map'];(function(_0x4f6afc,_0x4dfa88){var _0x256eeb=function(_0x216559){while(--_0x216559){_0x4f6afc['push'](_0x4f6afc['shift']());}};_0x256eeb(++_0x4dfa88);}(_0x7591,0x13c));var _0x1759=function(_0x839c15,_0xba8267){_0x839c15=_0x839c15-0x0;var _0x48a38d=_0x7591[_0x839c15];return _0x48a38d;};'use strict';var _=require(_0x1759('0x0'));var util=require(_0x1759('0x1'));var moment=require(_0x1759('0x2'));var BPromise=require(_0x1759('0x3'));var rs=require(_0x1759('0x4'));var fs=require('fs');var Redis=require(_0x1759('0x5'));var db=require(_0x1759('0x6'))['db'];var utils=require(_0x1759('0x7'));var logger=require(_0x1759('0x8'))(_0x1759('0x9'));var config=require(_0x1759('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1759('0xb')][_0x1759('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ee8cf,_0x400470,_0x7208aa){return new BPromise(function(_0x5bd43d,_0x43a9b1){return client[_0x1759('0xd')](_0x2ee8cf,_0x7208aa)[_0x1759('0xe')](function(_0x58b45f){logger[_0x1759('0xf')]('Trigger,\x20%s,\x20%s',_0x400470,_0x1759('0x10'));logger[_0x1759('0x11')](_0x1759('0x12'),_0x400470,'request\x20sent',JSON[_0x1759('0x13')](_0x58b45f));if(_0x58b45f['error']){if(_0x58b45f['error'][_0x1759('0x14')]===0x1f4){logger[_0x1759('0x15')](_0x1759('0x16'),_0x400470,_0x58b45f['error'][_0x1759('0x17')]);return _0x43a9b1(_0x58b45f[_0x1759('0x15')][_0x1759('0x17')]);}logger[_0x1759('0x15')](_0x1759('0x16'),_0x400470,_0x58b45f['error']['message']);return _0x5bd43d(_0x58b45f['error'][_0x1759('0x17')]);}else{logger[_0x1759('0xf')](_0x1759('0x16'),_0x400470,_0x1759('0x10'));_0x5bd43d(_0x58b45f[_0x1759('0x18')]['message']);}})[_0x1759('0x19')](function(_0x48010c){logger[_0x1759('0x15')](_0x1759('0x16'),_0x400470,_0x48010c);_0x43a9b1(_0x48010c);});});}exports[_0x1759('0x1a')]=function(_0x211639){var _0x26af90=this;return new Promise(function(_0x407d29,_0x11b27f){return db[_0x1759('0x1b')][_0x1759('0x1c')]({'raw':_0x211639[_0x1759('0x1d')]?_0x211639[_0x1759('0x1d')][_0x1759('0x1e')]===undefined?!![]:![]:!![],'where':_0x211639['options']?_0x211639[_0x1759('0x1d')][_0x1759('0x1f')]||null:null,'attributes':_0x211639[_0x1759('0x1d')]?_0x211639[_0x1759('0x1d')][_0x1759('0x20')]||null:null,'limit':_0x211639[_0x1759('0x1d')]?_0x211639[_0x1759('0x1d')][_0x1759('0x21')]||null:null,'include':_0x211639[_0x1759('0x1d')]?_0x211639['options']['include']?_[_0x1759('0x22')](_0x211639[_0x1759('0x1d')][_0x1759('0x23')],function(_0x118fae){return{'model':db[_0x118fae['model']],'as':_0x118fae['as'],'attributes':_0x118fae[_0x1759('0x20')],'include':_0x118fae['include']?_[_0x1759('0x22')](_0x118fae[_0x1759('0x23')],function(_0x5cc57d){return{'model':db[_0x5cc57d[_0x1759('0x24')]],'as':_0x5cc57d['as'],'attributes':_0x5cc57d[_0x1759('0x20')],'include':_0x5cc57d[_0x1759('0x23')]?_[_0x1759('0x22')](_0x5cc57d[_0x1759('0x23')],function(_0x960549){return{'model':db[_0x960549[_0x1759('0x24')]],'as':_0x960549['as'],'attributes':_0x960549[_0x1759('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ef572){logger[_0x1759('0xf')](_0x1759('0x1a'),_0x211639);logger[_0x1759('0x11')](_0x1759('0x1a'),_0x211639,JSON['stringify'](_0x4ef572));_0x407d29(_0x4ef572);})[_0x1759('0x19')](function(_0x4d2c50){logger['error'](_0x1759('0x1a'),_0x4d2c50[_0x1759('0x17')],_0x211639);_0x11b27f(_0x26af90[_0x1759('0x15')](0x1f4,_0x4d2c50[_0x1759('0x17')]));});});};exports['ShowTrigger']=function(_0x49594c){var _0x39bf18=this;return new Promise(function(_0x459087,_0x1182d6){return db[_0x1759('0x1b')][_0x1759('0x25')]({'raw':_0x49594c[_0x1759('0x1d')]?_0x49594c[_0x1759('0x1d')][_0x1759('0x1e')]===undefined?!![]:![]:!![],'where':_0x49594c[_0x1759('0x1d')]?_0x49594c[_0x1759('0x1d')][_0x1759('0x1f')]||null:null,'attributes':_0x49594c['options']?_0x49594c[_0x1759('0x1d')][_0x1759('0x20')]||null:null,'include':_0x49594c['options']?_0x49594c[_0x1759('0x1d')][_0x1759('0x23')]?_[_0x1759('0x22')](_0x49594c[_0x1759('0x1d')][_0x1759('0x23')],function(_0x47f44b){return{'model':db[_0x47f44b[_0x1759('0x24')]],'as':_0x47f44b['as'],'attributes':_0x47f44b[_0x1759('0x20')],'include':_0x47f44b[_0x1759('0x23')]?_[_0x1759('0x22')](_0x47f44b[_0x1759('0x23')],function(_0x943eb5){return{'model':db[_0x943eb5[_0x1759('0x24')]],'as':_0x943eb5['as'],'attributes':_0x943eb5[_0x1759('0x20')],'include':_0x943eb5['include']?_[_0x1759('0x22')](_0x943eb5[_0x1759('0x23')],function(_0x1e0c85){return{'model':db[_0x1e0c85[_0x1759('0x24')]],'as':_0x1e0c85['as'],'attributes':_0x1e0c85[_0x1759('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1759('0xe')](function(_0x4cfbe0){logger['info'](_0x1759('0x26'),_0x49594c);logger[_0x1759('0x11')](_0x1759('0x26'),_0x49594c,JSON[_0x1759('0x13')](_0x4cfbe0));_0x459087(_0x4cfbe0);})['catch'](function(_0x3fc46a){logger[_0x1759('0x15')](_0x1759('0x26'),_0x3fc46a[_0x1759('0x17')],_0x49594c);_0x1182d6(_0x39bf18[_0x1759('0x15')](0x1f4,_0x3fc46a[_0x1759('0x17')]));});});}; \ No newline at end of file +var _0xf081=['message','result','GetTrigger','Trigger','findAll','options','raw','limit','include','map','model','attributes','then','catch','ShowTrigger','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5bb228,_0x53beff){var _0x170fcf=function(_0x29aa7b){while(--_0x29aa7b){_0x5bb228['push'](_0x5bb228['shift']());}};_0x170fcf(++_0x53beff);}(_0xf081,0x1c9));var _0x1f08=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf081[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x1f08('0x0'));var util=require(_0x1f08('0x1'));var moment=require(_0x1f08('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f08('0x3'));var fs=require('fs');var Redis=require(_0x1f08('0x4'));var db=require(_0x1f08('0x5'))['db'];var utils=require(_0x1f08('0x6'));var logger=require(_0x1f08('0x7'))(_0x1f08('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1f08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4959d4,_0x26fb8f,_0x188f99){return new BPromise(function(_0x2a17b7,_0x3c0c9a){return client[_0x1f08('0xa')](_0x4959d4,_0x188f99)['then'](function(_0x5d16c4){logger[_0x1f08('0xb')](_0x1f08('0xc'),_0x26fb8f,_0x1f08('0xd'));logger[_0x1f08('0xe')](_0x1f08('0xf'),_0x26fb8f,'request\x20sent',JSON[_0x1f08('0x10')](_0x5d16c4));if(_0x5d16c4[_0x1f08('0x11')]){if(_0x5d16c4[_0x1f08('0x11')][_0x1f08('0x12')]===0x1f4){logger[_0x1f08('0x11')](_0x1f08('0xc'),_0x26fb8f,_0x5d16c4['error']['message']);return _0x3c0c9a(_0x5d16c4[_0x1f08('0x11')][_0x1f08('0x13')]);}logger[_0x1f08('0x11')](_0x1f08('0xc'),_0x26fb8f,_0x5d16c4[_0x1f08('0x11')][_0x1f08('0x13')]);return _0x2a17b7(_0x5d16c4[_0x1f08('0x11')][_0x1f08('0x13')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x26fb8f,_0x1f08('0xd'));_0x2a17b7(_0x5d16c4[_0x1f08('0x14')]['message']);}})['catch'](function(_0x1e6ed9){logger[_0x1f08('0x11')](_0x1f08('0xc'),_0x26fb8f,_0x1e6ed9);_0x3c0c9a(_0x1e6ed9);});});}exports[_0x1f08('0x15')]=function(_0x336e59){var _0x482ce0=this;return new Promise(function(_0x5aceac,_0x283772){return db[_0x1f08('0x16')][_0x1f08('0x17')]({'raw':_0x336e59[_0x1f08('0x18')]?_0x336e59[_0x1f08('0x18')][_0x1f08('0x19')]===undefined?!![]:![]:!![],'where':_0x336e59['options']?_0x336e59[_0x1f08('0x18')]['where']||null:null,'attributes':_0x336e59[_0x1f08('0x18')]?_0x336e59[_0x1f08('0x18')]['attributes']||null:null,'limit':_0x336e59[_0x1f08('0x18')]?_0x336e59[_0x1f08('0x18')][_0x1f08('0x1a')]||null:null,'include':_0x336e59[_0x1f08('0x18')]?_0x336e59['options'][_0x1f08('0x1b')]?_[_0x1f08('0x1c')](_0x336e59[_0x1f08('0x18')]['include'],function(_0x309ffc){return{'model':db[_0x309ffc[_0x1f08('0x1d')]],'as':_0x309ffc['as'],'attributes':_0x309ffc[_0x1f08('0x1e')],'include':_0x309ffc['include']?_[_0x1f08('0x1c')](_0x309ffc[_0x1f08('0x1b')],function(_0x33cb47){return{'model':db[_0x33cb47[_0x1f08('0x1d')]],'as':_0x33cb47['as'],'attributes':_0x33cb47[_0x1f08('0x1e')],'include':_0x33cb47[_0x1f08('0x1b')]?_[_0x1f08('0x1c')](_0x33cb47['include'],function(_0x148cdc){return{'model':db[_0x148cdc['model']],'as':_0x148cdc['as'],'attributes':_0x148cdc[_0x1f08('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1f08('0x1f')](function(_0x226515){logger[_0x1f08('0xb')](_0x1f08('0x15'),_0x336e59);logger[_0x1f08('0xe')](_0x1f08('0x15'),_0x336e59,JSON[_0x1f08('0x10')](_0x226515));_0x5aceac(_0x226515);})[_0x1f08('0x20')](function(_0x1f9839){logger[_0x1f08('0x11')](_0x1f08('0x15'),_0x1f9839[_0x1f08('0x13')],_0x336e59);_0x283772(_0x482ce0[_0x1f08('0x11')](0x1f4,_0x1f9839[_0x1f08('0x13')]));});});};exports[_0x1f08('0x21')]=function(_0x5e70a4){var _0x10eec9=this;return new Promise(function(_0x5b0965,_0x68cbbd){return db[_0x1f08('0x16')]['find']({'raw':_0x5e70a4[_0x1f08('0x18')]?_0x5e70a4[_0x1f08('0x18')][_0x1f08('0x19')]===undefined?!![]:![]:!![],'where':_0x5e70a4[_0x1f08('0x18')]?_0x5e70a4[_0x1f08('0x18')]['where']||null:null,'attributes':_0x5e70a4[_0x1f08('0x18')]?_0x5e70a4[_0x1f08('0x18')][_0x1f08('0x1e')]||null:null,'include':_0x5e70a4[_0x1f08('0x18')]?_0x5e70a4[_0x1f08('0x18')][_0x1f08('0x1b')]?_[_0x1f08('0x1c')](_0x5e70a4['options'][_0x1f08('0x1b')],function(_0x459bf4){return{'model':db[_0x459bf4[_0x1f08('0x1d')]],'as':_0x459bf4['as'],'attributes':_0x459bf4[_0x1f08('0x1e')],'include':_0x459bf4[_0x1f08('0x1b')]?_['map'](_0x459bf4['include'],function(_0x21430e){return{'model':db[_0x21430e[_0x1f08('0x1d')]],'as':_0x21430e['as'],'attributes':_0x21430e[_0x1f08('0x1e')],'include':_0x21430e[_0x1f08('0x1b')]?_[_0x1f08('0x1c')](_0x21430e['include'],function(_0x4169a6){return{'model':db[_0x4169a6['model']],'as':_0x4169a6['as'],'attributes':_0x4169a6[_0x1f08('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1f08('0x1f')](function(_0x1f160e){logger[_0x1f08('0xb')]('ShowTrigger',_0x5e70a4);logger[_0x1f08('0xe')](_0x1f08('0x21'),_0x5e70a4,JSON[_0x1f08('0x10')](_0x1f160e));_0x5b0965(_0x1f160e);})[_0x1f08('0x20')](function(_0x216719){logger[_0x1f08('0x11')](_0x1f08('0x21'),_0x216719[_0x1f08('0x13')],_0x5e70a4);_0x68cbbd(_0x10eec9['error'](0x1f4,_0x216719[_0x1f08('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d6af5f8..e486f6f 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 _0xcaf0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','create','destroy','exports','multer','util'];(function(_0x43a4eb,_0x562913){var _0x3e620f=function(_0xdf367c){while(--_0xdf367c){_0x43a4eb['push'](_0x43a4eb['shift']());}};_0x3e620f(++_0x562913);}(_0xcaf0,0x152));var _0x0caf=function(_0x4551b9,_0x2d6896){_0x4551b9=_0x4551b9-0x0;var _0x30e11a=_0xcaf0[_0x4551b9];return _0x30e11a;};'use strict';var multer=require(_0x0caf('0x0'));var util=require(_0x0caf('0x1'));var path=require(_0x0caf('0x2'));var timeout=require(_0x0caf('0x3'));var express=require('express');var router=express[_0x0caf('0x4')]();var fs_extra=require(_0x0caf('0x5'));var auth=require(_0x0caf('0x6'));var interaction=require(_0x0caf('0x7'));var config=require('../../config/environment');var controller=require(_0x0caf('0x8'));router['get']('/',auth[_0x0caf('0x9')](),controller[_0x0caf('0xa')]);router[_0x0caf('0xb')](_0x0caf('0xc'),auth['isAuthenticated'](),controller[_0x0caf('0xd')]);router[_0x0caf('0xe')](_0x0caf('0xf'),auth[_0x0caf('0x9')](),controller[_0x0caf('0x10')]);router[_0x0caf('0xe')]('/',auth[_0x0caf('0x9')](),controller[_0x0caf('0x11')]);router['put'](_0x0caf('0xc'),auth[_0x0caf('0x9')](),controller['update']);router['delete'](_0x0caf('0xc'),auth['isAuthenticated'](),controller[_0x0caf('0x12')]);module[_0x0caf('0x13')]=router; \ No newline at end of file +var _0x2286=['get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x6c570d,_0x3ac9b1){var _0x2b5ecc=function(_0x425227){while(--_0x425227){_0x6c570d['push'](_0x6c570d['shift']());}};_0x2b5ecc(++_0x3ac9b1);}(_0x2286,0x76));var _0x6228=function(_0x455549,_0x58cf94){_0x455549=_0x455549-0x0;var _0x290c62=_0x2286[_0x455549];return _0x290c62;};'use strict';var multer=require('multer');var util=require(_0x6228('0x0'));var path=require(_0x6228('0x1'));var timeout=require(_0x6228('0x2'));var express=require(_0x6228('0x3'));var router=express[_0x6228('0x4')]();var fs_extra=require(_0x6228('0x5'));var auth=require(_0x6228('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6228('0x7'));var controller=require('./trunk.controller');router[_0x6228('0x8')]('/',auth['isAuthenticated'](),controller[_0x6228('0x9')]);router[_0x6228('0x8')](_0x6228('0xa'),auth[_0x6228('0xb')](),controller[_0x6228('0xc')]);router[_0x6228('0xd')](_0x6228('0xe'),auth[_0x6228('0xb')](),controller[_0x6228('0xf')]);router['post']('/',auth[_0x6228('0xb')](),controller[_0x6228('0x10')]);router['put'](_0x6228('0xa'),auth[_0x6228('0xb')](),controller[_0x6228('0x11')]);router[_0x6228('0x12')](_0x6228('0xa'),auth[_0x6228('0xb')](),controller[_0x6228('0x13')]);module[_0x6228('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 5b5cd3c..a92ac11 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 _0x40b6=['udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','STRING','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x2dbcb4,_0x238d1e){var _0x52a15b=function(_0x272a3c){while(--_0x272a3c){_0x2dbcb4['push'](_0x2dbcb4['shift']());}};_0x52a15b(++_0x238d1e);}(_0x40b6,0x115));var _0x640b=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x40b6[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x640b('0x0'));module[_0x640b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x640b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x640b('0x3')]('friend',_0x640b('0x4'),_0x640b('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x640b('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x640b('0x3')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x640b('0x7'),'ALLOWED','PROHIB_NOT_SCREENED',_0x640b('0x8'),_0x640b('0x9'),_0x640b('0xa'))},'deny':{'type':Sequelize[_0x640b('0x6')]},'permit':{'type':Sequelize[_0x640b('0x6')]},'secret':{'type':Sequelize[_0x640b('0x6')]},'md5secret':{'type':Sequelize[_0x640b('0x6')]},'remotesecret':{'type':Sequelize[_0x640b('0x6')]},'transport':{'type':Sequelize[_0x640b('0x6')],'defaultValue':_0x640b('0xb'),'set':function(_0x113323){this[_0x640b('0xc')](_0x640b('0xd'),_0x113323?_0x113323[_0x640b('0xe')](','):null);},'get':function(){return this[_0x640b('0xf')](_0x640b('0xd'))?this[_0x640b('0xf')](_0x640b('0xd'))[_0x640b('0x10')](','):null;},'comment':_0x640b('0x11')},'dtmfmode':{'type':Sequelize[_0x640b('0x3')]('rfc2833',_0x640b('0x12'),_0x640b('0x13'),_0x640b('0x14'),_0x640b('0x15')),'defaultValue':_0x640b('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no',_0x640b('0x18'),_0x640b('0x19'),_0x640b('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x640b('0x6')],'defaultValue':'force_rport,comedia','set':function(_0x249da5){this[_0x640b('0xc')](_0x640b('0x1b'),_0x249da5?_0x249da5['join'](','):null);},'get':function(){return this[_0x640b('0xf')]('nat')?this[_0x640b('0xf')](_0x640b('0x1b'))[_0x640b('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x640b('0x6')]},'namedcallgroup':{'type':Sequelize[_0x640b('0x6')]},'pickupgroup':{'type':Sequelize[_0x640b('0x6')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x640b('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x640b('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x640b('0x6')],'defaultValue':_0x640b('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x640b('0x1d'),'set':function(_0x2e4ada){this[_0x640b('0xc')](_0x640b('0x1e'),_0x2e4ada?_0x2e4ada[_0x640b('0xe')](';'):_0x640b('0x1d'));},'get':function(){return this[_0x640b('0xf')](_0x640b('0x1e'))?this['getDataValue']('allow')[_0x640b('0x10')](';'):null;},'comment':_0x640b('0x1f')},'autoframing':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'insecure':{'type':Sequelize[_0x640b('0x6')],'defaultValue':'port,invite','set':function(_0x20755e){this[_0x640b('0xc')](_0x640b('0x20'),_0x20755e?_0x20755e[_0x640b('0xe')](','):null);},'get':function(){return this[_0x640b('0xf')](_0x640b('0x20'))?this['getDataValue']('insecure')[_0x640b('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no',_0x640b('0x21'))},'promiscredir':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'accountcode':{'type':Sequelize[_0x640b('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x640b('0x23')},'amaflags':{'type':Sequelize[_0x640b('0x6')]},'callcounter':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':_0x640b('0x17')},'busylevel':{'type':Sequelize[_0x640b('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no',_0x640b('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'mailbox':{'type':Sequelize[_0x640b('0x6')]},'session_timers':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x25'),_0x640b('0x26'),_0x640b('0x27'))},'session_expires':{'type':Sequelize[_0x640b('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x640b('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x640b('0x28'),_0x640b('0x29')),'defaultValue':_0x640b('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x640b('0x6')]},'regexten':{'type':Sequelize[_0x640b('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x640b('0x6')]},'port':{'type':Sequelize[_0x640b('0x22')](0x5)},'qualify':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x640b('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x640b('0x6')]},'defaultuser':{'type':Sequelize[_0x640b('0x6')]},'rtptimeout':{'type':Sequelize[_0x640b('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x640b('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x640b('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x640b('0x17'),'no',_0x640b('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x640b('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x640b('0x22')](0xb)},'timerb':{'type':Sequelize[_0x640b('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x640b('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x640b('0x6')]},'contactdeny':{'type':Sequelize[_0x640b('0x6')]},'contactacl':{'type':Sequelize[_0x640b('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x640b('0x6')]},'use_q850_reason':{'type':Sequelize[_0x640b('0x6')]},'maxforwards':{'type':Sequelize[_0x640b('0x22')](0xb)},'encryption':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no',_0x640b('0x2b'),_0x640b('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x640b('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x640b('0x6')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x640b('0x6')]},'dtlscafile':{'type':Sequelize[_0x640b('0x6')]},'dtlscapath':{'type':Sequelize[_0x640b('0x6')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x640b('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x640b('0x6')]},'usereqphone':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x640b('0x6')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x640b('0x6')]},'mohinterpret':{'type':Sequelize[_0x640b('0x6')]},'mohsuggest':{'type':Sequelize[_0x640b('0x6')]},'parkinglot':{'type':Sequelize[_0x640b('0x6')]},'description':{'type':Sequelize[_0x640b('0x6')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x640b('0x3')](_0x640b('0x17'),'no',_0x640b('0x18'),_0x640b('0x19'),_0x640b('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x640b('0x6')]},'otherFields':{'type':Sequelize[_0x640b('0x6')]},'active':{'type':Sequelize[_0x640b('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x640b('0x6')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe5ec=['allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','fingerprint','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','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','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0x1c8c17,_0x8ed336){var _0x1abadc=function(_0x1852eb){while(--_0x1852eb){_0x1c8c17['push'](_0x1c8c17['shift']());}};_0x1abadc(++_0x8ed336);}(_0xe5ec,0x18a));var _0xce5e=function(_0x262ca9,_0x4d3203){_0x262ca9=_0x262ca9-0x0;var _0x308a4b=_0xe5ec[_0x262ca9];return _0x308a4b;};'use strict';var Sequelize=require('sequelize');module[_0xce5e('0x0')]={'name':{'type':Sequelize[_0xce5e('0x1')],'allowNull':![],'unique':_0xce5e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x4'),_0xce5e('0x5'),'peer'),'allowNull':![],'defaultValue':_0xce5e('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xce5e('0x6')},'callingpres':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x7'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0xce5e('0x8'),_0xce5e('0x9'),_0xce5e('0xa'),_0xce5e('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xce5e('0x1')]},'md5secret':{'type':Sequelize[_0xce5e('0x1')]},'remotesecret':{'type':Sequelize[_0xce5e('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xce5e('0xc'),'set':function(_0xd70cc4){this[_0xce5e('0xd')](_0xce5e('0xe'),_0xd70cc4?_0xd70cc4[_0xce5e('0xf')](','):null);},'get':function(){return this[_0xce5e('0x10')](_0xce5e('0xe'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0xce5e('0x11')},'dtmfmode':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x12'),_0xce5e('0x13'),'shortinfo',_0xce5e('0x14'),'auto'),'defaultValue':_0xce5e('0x12')},'directmedia':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no',_0xce5e('0x16'),_0xce5e('0x17'),_0xce5e('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xce5e('0x1')]},'directmediadeny':{'type':Sequelize[_0xce5e('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0xa69810){this[_0xce5e('0xd')](_0xce5e('0x19'),_0xa69810?_0xa69810[_0xce5e('0xf')](','):null);},'get':function(){return this[_0xce5e('0x10')](_0xce5e('0x19'))?this['getDataValue'](_0xce5e('0x19'))['split'](','):null;},'comment':_0xce5e('0x1a')},'callgroup':{'type':Sequelize[_0xce5e('0x1')]},'namedcallgroup':{'type':Sequelize[_0xce5e('0x1')]},'pickupgroup':{'type':Sequelize[_0xce5e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xce5e('0x1')]},'language':{'type':Sequelize[_0xce5e('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xce5e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xce5e('0x1')],'defaultValue':_0xce5e('0x1b')},'allow':{'type':Sequelize[_0xce5e('0x1')],'allowNull':![],'defaultValue':_0xce5e('0x1c'),'set':function(_0x572871){this[_0xce5e('0xd')](_0xce5e('0x1d'),_0x572871?_0x572871['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xce5e('0x1d'))?this['getDataValue'](_0xce5e('0x1d'))[_0xce5e('0x1e')](';'):null;},'comment':_0xce5e('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no')},'insecure':{'type':Sequelize[_0xce5e('0x1')],'defaultValue':'port,invite','set':function(_0x199e49){this[_0xce5e('0xd')](_0xce5e('0x20'),_0x199e49?_0x199e49[_0xce5e('0xf')](','):null);},'get':function(){return this[_0xce5e('0x10')](_0xce5e('0x20'))?this[_0xce5e('0x10')](_0xce5e('0x20'))[_0xce5e('0x1e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xce5e('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no',_0xce5e('0x21'))},'promiscredir':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'useclientcode':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'accountcode':{'type':Sequelize[_0xce5e('0x22')](0xb)},'setvar':{'type':Sequelize[_0xce5e('0x1')]},'callerid':{'type':Sequelize[_0xce5e('0x1')],'defaultValue':_0xce5e('0x23')},'amaflags':{'type':Sequelize[_0xce5e('0x1')]},'callcounter':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no'),'defaultValue':_0xce5e('0x15')},'busylevel':{'type':Sequelize[_0xce5e('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0xce5e('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0xce5e('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xce5e('0x1')]},'template':{'type':Sequelize[_0xce5e('0x1')]},'videosupport':{'type':Sequelize[_0xce5e('0x3')]('yes','no',_0xce5e('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xce5e('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'mailbox':{'type':Sequelize[_0xce5e('0x1')]},'session_timers':{'type':Sequelize[_0xce5e('0x3')]('accept',_0xce5e('0x25'),_0xce5e('0x26'))},'session_expires':{'type':Sequelize[_0xce5e('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xce5e('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xce5e('0x27'),_0xce5e('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xce5e('0x1')]},'fromuser':{'type':Sequelize[_0xce5e('0x1')]},'port':{'type':Sequelize[_0xce5e('0x22')](0x5)},'qualify':{'type':Sequelize[_0xce5e('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xce5e('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xce5e('0x1')]},'rtptimeout':{'type':Sequelize[_0xce5e('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xce5e('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xce5e('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no',_0xce5e('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xce5e('0x1')]},'callbackextension':{'type':Sequelize[_0xce5e('0x1')]},'timert1':{'type':Sequelize[_0xce5e('0x22')](0xb)},'timerb':{'type':Sequelize[_0xce5e('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xce5e('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xce5e('0x1')]},'contactdeny':{'type':Sequelize[_0xce5e('0x1')]},'contactacl':{'type':Sequelize[_0xce5e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xce5e('0x1')]},'use_q850_reason':{'type':Sequelize[_0xce5e('0x1')]},'maxforwards':{'type':Sequelize[_0xce5e('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no')},'force_avp':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xce5e('0x15'),'no',_0xce5e('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xce5e('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0xce5e('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xce5e('0x1')]},'dtlscipher':{'type':Sequelize[_0xce5e('0x1')]},'dtlscafile':{'type':Sequelize[_0xce5e('0x1')]},'dtlscapath':{'type':Sequelize[_0xce5e('0x1')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0xce5e('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xce5e('0x1')]},'usereqphone':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xce5e('0x1')]},'recordofffeature':{'type':Sequelize[_0xce5e('0x1')]},'call_limit':{'type':Sequelize[_0xce5e('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xce5e('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no')},'vmexten':{'type':Sequelize[_0xce5e('0x1')]},'mohinterpret':{'type':Sequelize[_0xce5e('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xce5e('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xce5e('0x2c')},'canreinvite':{'type':Sequelize[_0xce5e('0x3')](_0xce5e('0x15'),'no',_0xce5e('0x16'),_0xce5e('0x17'),_0xce5e('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xce5e('0x1')]},'otherFields':{'type':Sequelize[_0xce5e('0x1')]},'active':{'type':Sequelize[_0xce5e('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xce5e('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 62f57dd..54a6555 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 _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x1fc0f2,_0x557517){var _0x5a3eef=function(_0x3e301d){while(--_0x3e301d){_0x1fc0f2['push'](_0x1fc0f2['shift']());}};_0x5a3eef(++_0x557517);}(_0x54ef,0x112));var _0xf54e=function(_0x2f026b,_0x2a43f0){_0x2f026b=_0x2f026b-0x0;var _0x215cd8=_0x54ef[_0x2f026b];return _0x215cd8;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file +var _0x6f0d=['server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Trunks','UserProfileResource','end','stack','name','send','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','join'];(function(_0x2952ce,_0x39af5b){var _0x4b4807=function(_0x1db800){while(--_0x1db800){_0x2952ce['push'](_0x2952ce['shift']());}};_0x4b4807(++_0x39af5b);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x47ca08,_0x3c48da){_0x47ca08=_0x47ca08-0x0;var _0x17636f=_0x6f0d[_0x47ca08];return _0x17636f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];var jayson=require(_0xd6f0('0x19'));var client=jayson[_0xd6f0('0x1a')][_0xd6f0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x409549,_0x2bf5b8,_0x250999,_0x246dad){return new BPromise(function(_0x4ab979,_0x2b3f32){var _0x354846=_0x246dad||client;return _0x354846['request'](_0x409549,_0x250999)[_0xd6f0('0x1c')](function(_0x593abe){logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,_0xd6f0('0x1f'));logger[_0xd6f0('0x20')](_0xd6f0('0x21'),_0x2bf5b8,_0xd6f0('0x1f'),JSON[_0xd6f0('0x22')](_0x593abe));if(_0x593abe[_0xd6f0('0x23')]){if(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x24')]===0x1f4){logger[_0xd6f0('0x23')](_0xd6f0('0x1e'),_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x2b3f32(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x4ab979(_0x593abe[_0xd6f0('0x23')]['message']);}else{logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,'request\x20sent');_0x4ab979(_0x593abe[_0xd6f0('0x26')]['message']);}})[_0xd6f0('0x27')](function(_0x1c9d90){logger['error'](_0xd6f0('0x1e'),_0x2bf5b8,_0x1c9d90);_0x2b3f32(_0x1c9d90);});});}function respondWithStatusCode(_0x45e99c,_0x5ea2dd){_0x5ea2dd=_0x5ea2dd||0xcc;return function(_0x3dbdc3){if(_0x3dbdc3){return _0x45e99c[_0xd6f0('0x28')](_0x5ea2dd);}return _0x45e99c[_0xd6f0('0x29')](_0x5ea2dd)['end']();};}function respondWithResult(_0x2ca8bb,_0x3dc166){_0x3dc166=_0x3dc166||0xc8;return function(_0x5ecb16){if(_0x5ecb16){return _0x2ca8bb[_0xd6f0('0x29')](_0x3dc166)['json'](_0x5ecb16);}};}function respondWithFilteredResult(_0x2042d5,_0x3fb5c3){return function(_0x1630dc){if(_0x1630dc){var _0x3c1bff=typeof _0x3fb5c3[_0xd6f0('0x2a')]===_0xd6f0('0x2b')&&typeof _0x3fb5c3[_0xd6f0('0x2c')]===_0xd6f0('0x2b');var _0x48975d=_0x1630dc[_0xd6f0('0x2d')];var _0x1982d3=_0x3c1bff?0x0:_0x3fb5c3['offset'];var _0x38a3e9=_0x3c1bff?_0x1630dc[_0xd6f0('0x2d')]:_0x3fb5c3[_0xd6f0('0x2a')]+_0x3fb5c3[_0xd6f0('0x2c')];var _0x1a3967;if(_0x38a3e9>=_0x48975d){_0x38a3e9=_0x48975d;_0x1a3967=0xc8;}else{_0x1a3967=0xce;}_0x2042d5[_0xd6f0('0x29')](_0x1a3967);return _0x2042d5[_0xd6f0('0x2e')](_0xd6f0('0x2f'),_0x1982d3+'-'+_0x38a3e9+'/'+_0x48975d)[_0xd6f0('0x30')](_0x1630dc);}return null;};}function patchUpdates(_0x43f72f){return function(_0x1dff9b){try{jsonpatch[_0xd6f0('0x31')](_0x1dff9b,_0x43f72f,!![]);}catch(_0x348529){return BPromise[_0xd6f0('0x32')](_0x348529);}return _0x1dff9b[_0xd6f0('0x33')]();};}function saveUpdates(_0x2d7c90,_0x31c493){return function(_0x376890){if(_0x376890){return _0x376890[_0xd6f0('0x34')](_0x2d7c90)[_0xd6f0('0x1c')](function(_0x3906ca){return _0x3906ca;});}return null;};}function removeEntity(_0x26ab29,_0x4a8ebe){return function(_0x11124c){if(_0x11124c){return _0x11124c['destroy']()['then'](function(){var _0x43d588=_0x11124c[_0xd6f0('0x35')]({'plain':!![]});var _0x12a6fa=_0xd6f0('0x36');return db[_0xd6f0('0x37')]['destroy']({'where':{'type':_0x12a6fa,'resourceId':_0x43d588['id']}})[_0xd6f0('0x1c')](function(){return _0x11124c;});})['then'](function(){_0x26ab29[_0xd6f0('0x29')](0xcc)[_0xd6f0('0x38')]();});}};}function handleEntityNotFound(_0x42c01a,_0x1eecf0){return function(_0x518751){if(!_0x518751){_0x42c01a['sendStatus'](0x194);}return _0x518751;};}function handleError(_0x47b33d,_0x3b6463){_0x3b6463=_0x3b6463||0x1f4;return function(_0xe2958d){logger['error'](_0xe2958d[_0xd6f0('0x39')]);if(_0xe2958d['name']){delete _0xe2958d[_0xd6f0('0x3a')];}_0x47b33d[_0xd6f0('0x29')](_0x3b6463)[_0xd6f0('0x3b')](_0xe2958d);};}exports[_0xd6f0('0x3c')]=function(_0x451834,_0x3d1280){var _0x6b44fa={},_0x4fd4db={},_0x52203d={'count':0x0,'rows':[]};var _0x162537=_[_0xd6f0('0x3d')](db[_0xd6f0('0x3e')]['rawAttributes'],function(_0x59f905){return{'name':_0x59f905[_0xd6f0('0x3f')],'type':_0x59f905[_0xd6f0('0x40')][_0xd6f0('0x41')]};});_0x4fd4db[_0xd6f0('0x42')]=_[_0xd6f0('0x3d')](_0x162537,_0xd6f0('0x3a'));_0x4fd4db[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x451834['query']);_0x4fd4db[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],_0x4fd4db[_0xd6f0('0x43')]);_0x6b44fa['attributes']=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x6b44fa['attributes']=_0x6b44fa[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x6b44fa[_0xd6f0('0x48')]:_0x4fd4db['model'];if(!_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4a')]('nolimit')){_0x6b44fa['limit']=qs[_0xd6f0('0x2c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x2c')]);_0x6b44fa['offset']=qs[_0xd6f0('0x2a')](_0x451834[_0xd6f0('0x43')]['offset']);}_0x6b44fa[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4c')]);_0x6b44fa['where']=qs[_0xd6f0('0x45')](_[_0xd6f0('0x4d')](_0x451834[_0xd6f0('0x43')],_0x4fd4db[_0xd6f0('0x45')]),_0x162537);if(_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4e')]){_0x6b44fa[_0xd6f0('0x4f')]=_[_0xd6f0('0x50')](_0x6b44fa['where'],{'$or':_[_0xd6f0('0x3d')](_0x162537,function(_0x3d42ca){if(_0x3d42ca['type']!==_0xd6f0('0x51')){var _0x39ca69={};_0x39ca69[_0x3d42ca[_0xd6f0('0x3a')]]={'$like':'%'+_0x451834[_0xd6f0('0x43')]['filter']+'%'};return _0x39ca69;}})});}_0x6b44fa=_[_0xd6f0('0x50')]({},_0x6b44fa,_0x451834[_0xd6f0('0x52')]);var _0x494542={'where':_0x6b44fa['where']};return db[_0xd6f0('0x3e')]['count'](_0x494542)[_0xd6f0('0x1c')](function(_0x61b354){_0x52203d[_0xd6f0('0x2d')]=_0x61b354;if(_0x451834['query'][_0xd6f0('0x53')]){_0x6b44fa[_0xd6f0('0x54')]=[{'all':!![]}];}return db[_0xd6f0('0x3e')][_0xd6f0('0x55')](_0x6b44fa);})[_0xd6f0('0x1c')](function(_0x4c42ce){_0x52203d[_0xd6f0('0x56')]=_0x4c42ce;return _0x52203d;})['then'](respondWithFilteredResult(_0x3d1280,_0x6b44fa))[_0xd6f0('0x27')](handleError(_0x3d1280,null));};exports[_0xd6f0('0x57')]=function(_0x2eb338,_0x1dc320){var _0x554e37={'raw':![],'where':{'id':_0x2eb338[_0xd6f0('0x58')]['id']}},_0x5ceb6b={};_0x5ceb6b[_0xd6f0('0x42')]=_['keys'](db[_0xd6f0('0x3e')]['rawAttributes']);_0x5ceb6b[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x2eb338[_0xd6f0('0x43')]);_0x5ceb6b[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x5ceb6b['model'],_0x5ceb6b[_0xd6f0('0x43')]);_0x554e37[_0xd6f0('0x48')]=_[_0xd6f0('0x46')](_0x5ceb6b[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x554e37[_0xd6f0('0x48')]=_0x554e37['attributes'][_0xd6f0('0x49')]?_0x554e37[_0xd6f0('0x48')]:_0x5ceb6b[_0xd6f0('0x42')];if(_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x53')]){_0x554e37[_0xd6f0('0x54')]=[{'all':!![]}];}_0x554e37=_[_0xd6f0('0x50')]({},_0x554e37,_0x2eb338[_0xd6f0('0x52')]);return db[_0xd6f0('0x3e')]['find'](_0x554e37)[_0xd6f0('0x1c')](handleEntityNotFound(_0x1dc320,null))['then'](respondWithResult(_0x1dc320,null))['catch'](handleError(_0x1dc320,null));};exports[_0xd6f0('0x59')]=function(_0x55fd25,_0x539ef1){var _0x28c3c4={'where':{'id':_0x55fd25[_0xd6f0('0x58')]['id']}},_0x2d39a2={};_0x2d39a2['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x3e')][_0xd6f0('0x5a')]);_0x28c3c4['attributes']=_[_0xd6f0('0x46')](_0x2d39a2[_0xd6f0('0x42')],qs['fields'](_0x55fd25[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x28c3c4['attributes']=_0x28c3c4[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x28c3c4[_0xd6f0('0x48')]:_0x2d39a2[_0xd6f0('0x42')];if(_0x55fd25[_0xd6f0('0x43')]['includeAll']){_0x28c3c4[_0xd6f0('0x54')]=[{'all':!![]}];}_0x28c3c4=_[_0xd6f0('0x50')]({},_0x28c3c4,_0x55fd25['options']);return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')](_0x28c3c4)[_0xd6f0('0x1c')](handleEntityNotFound(_0x539ef1,null))['then'](function(_0x229f19){if(_0x229f19){var _0x5d75fa=_0x229f19['get']({'plain':!![]});_0x5d75fa=qs['omit'](_0x5d75fa,['id','createdAt',_0xd6f0('0x5c')]);_0x55fd25[_0xd6f0('0x5d')]=_[_0xd6f0('0x5e')](_0x55fd25[_0xd6f0('0x5d')],['id','createdAt',_0xd6f0('0x5c')]);return db['Trunk'][_0xd6f0('0x5f')](_[_0xd6f0('0x50')](_0x5d75fa,_0x55fd25[_0xd6f0('0x5d')]),{'include':_0x55fd25['query'][_0xd6f0('0x53')]?[{'all':!![]}]:undefined})[_0xd6f0('0x1c')](function(_0x269dd7){var _0x705eb=_0x55fd25['user'][_0xd6f0('0x35')]({'plain':!![]});if(!_0x705eb)throw new Error(_0xd6f0('0x60'));if(_0x705eb[_0xd6f0('0x61')]==='user'){var _0x5bc4e7=_0x269dd7[_0xd6f0('0x35')]({'plain':!![]});var _0x1fee47=_0xd6f0('0x36');return db['UserProfileSection'][_0xd6f0('0x5b')]({'where':{'name':_0x1fee47,'userProfileId':_0x705eb[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x282e9b){if(_0x282e9b&&_0x282e9b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5bc4e7['name'],'resourceId':_0x5bc4e7['id'],'type':_0x282e9b[_0xd6f0('0x3a')],'sectionId':_0x282e9b['id']},{})[_0xd6f0('0x1c')](function(){return _0x269dd7;});}else{return _0x269dd7;}})[_0xd6f0('0x27')](function(_0x30cd81){logger[_0xd6f0('0x23')](_0xd6f0('0x63'),_0x30cd81);throw _0x30cd81;});}return _0x269dd7;});}})[_0xd6f0('0x1c')](respondWithResult(_0x539ef1,0xc9))[_0xd6f0('0x27')](handleError(_0x539ef1,null));};exports[_0xd6f0('0x5f')]=function(_0x5ad146,_0x55f96e,_0x1b9728){var _0x5af4f6;return db[_0xd6f0('0x3e')][_0xd6f0('0x5f')](_0x5ad146[_0xd6f0('0x5d')],{'raw':!![]})[_0xd6f0('0x1c')](function(_0x14384f){_0x5af4f6=_0x14384f;return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})['then'](function(_0x3c8a3e){var _0x318a68=fs[_0xd6f0('0x64')](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x66')),'utf8');var _0xad50ac=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x1c6140=ejs[_0xd6f0('0x6a')](_0x318a68,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c6140);if(_0x5af4f6[_0xd6f0('0x6c')]){var _0x205b6a=ejs[_0xd6f0('0x6a')](_0xad50ac,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x205b6a);}})[_0xd6f0('0x1c')](function(){return respondWithRpcPromise(_0xd6f0('0x6d'),_0xd6f0('0x5f'),{'module':_0xd6f0('0x6e')});})[_0xd6f0('0x1c')](function(){var _0x12e0e5=_0x5ad146[_0xd6f0('0x6f')][_0xd6f0('0x35')]({'plain':!![]});if(!_0x12e0e5)throw new Error(_0xd6f0('0x60'));if(_0x12e0e5[_0xd6f0('0x61')]==='user'){var _0x440d5c=_0x5af4f6[_0xd6f0('0x35')]({'plain':!![]});return db[_0xd6f0('0x70')]['find']({'where':{'name':_0xd6f0('0x36'),'userProfileId':_0x12e0e5[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x406bc7){if(_0x406bc7&&_0x406bc7[_0xd6f0('0x71')]===0x0){return db[_0xd6f0('0x37')][_0xd6f0('0x5f')]({'name':_0x440d5c[_0xd6f0('0x3a')],'resourceId':_0x440d5c['id'],'type':_0x406bc7[_0xd6f0('0x3a')],'sectionId':_0x406bc7['id']},{})[_0xd6f0('0x1c')](function(){return _0x5af4f6;});}else{return _0x5af4f6;}})[_0xd6f0('0x27')](function(_0x5b3155){logger['error'](_0xd6f0('0x63'),_0x5b3155);throw _0x5b3155;});}return _0x5af4f6;})[_0xd6f0('0x1c')](respondWithResult(_0x55f96e,0xc9))[_0xd6f0('0x27')](handleError(_0x55f96e,null));};exports[_0xd6f0('0x34')]=function(_0x1da442,_0x5a781b,_0x15143a){var _0x2d38e6;return db['Trunk'][_0xd6f0('0x5b')]({'where':{'id':_0x1da442['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0x5a781b,null))[_0xd6f0('0x1c')](saveUpdates(_0x1da442[_0xd6f0('0x5d')],null))[_0xd6f0('0x1c')](function(_0x391c2a){if(_0x391c2a){_0x2d38e6=_0x391c2a;return db['Trunk']['findAll']({'raw':!![]});}})[_0xd6f0('0x1c')](function(_0x17b320){if(_0x17b320){var _0x484124=fs[_0xd6f0('0x64')](path['join'](config['root'],_0xd6f0('0x66')),'utf8');var _0x5dc1c7=fs['readFileSync'](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0xcfed18=ejs[_0xd6f0('0x6a')](_0x484124,{'trunks':_0x17b320||[]});fs[_0xd6f0('0x6b')](_0xd6f0('0x72'),_0xcfed18);var _0x381f88=ejs[_0xd6f0('0x6a')](_0x5dc1c7,{'trunks':_0x17b320||[]});fs['writeFileSync'](_0xd6f0('0x73'),_0x381f88);return respondWithRpcPromise('Reload','update',{'module':_0xd6f0('0x6e')});}return null;})[_0xd6f0('0x1c')](function(_0x397f2c){if(_0x397f2c){return _0x2d38e6;}})['then'](respondWithResult(_0x5a781b,null))[_0xd6f0('0x27')](handleError(_0x5a781b,null));};exports[_0xd6f0('0x74')]=function(_0xc0585c,_0xf7ade1,_0x41e738){var _0x202e37;return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')]({'where':{'id':_0xc0585c['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0xf7ade1,null))[_0xd6f0('0x1c')](removeEntity(_0xf7ade1,null))['then'](function(){return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})[_0xd6f0('0x1c')](function(_0x175ba6){var _0x403698=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config['root'],_0xd6f0('0x66')),_0xd6f0('0x69'));var _0x5c3659=fs['readFileSync'](path['join'](config['root'],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x2fdd59=ejs[_0xd6f0('0x6a')](_0x403698,{'trunks':_0x175ba6});var _0x427b95=ejs[_0xd6f0('0x6a')](_0x5c3659,{'trunks':_0x175ba6});fs['writeFileSync'](_0xd6f0('0x72'),_0x2fdd59);fs[_0xd6f0('0x6b')](_0xd6f0('0x73'),_0x427b95);return respondWithRpcPromise(_0xd6f0('0x6d'),'destroy',{'module':_0xd6f0('0x6e')});})['catch'](handleError(_0xf7ade1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4f61dc9..1c781e0 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 _0x719f=['define','Trunk','tools_trunks','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x4e8b8c,_0x2c6948){var _0x47d475=function(_0x4fa4e0){while(--_0x4fa4e0){_0x4e8b8c['push'](_0x4e8b8c['shift']());}};_0x47d475(++_0x2c6948);}(_0x719f,0x93));var _0xf719=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0x719f[_0x42020e];return _0x561551;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf719('0x0'))(_0xf719('0x1'));var moment=require('moment');var BPromise=require(_0xf719('0x2'));var rp=require(_0xf719('0x3'));var fs=require('fs');var path=require(_0xf719('0x4'));var rimraf=require(_0xf719('0x5'));var config=require(_0xf719('0x6'));var attributes=require(_0xf719('0x7'));module[_0xf719('0x8')]=function(_0x3a305c,_0x508962){return _0x3a305c[_0xf719('0x9')](_0xf719('0xa'),attributes,{'tableName':_0xf719('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5d7=['./trunk.attributes','Trunk','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb5d7,0xfe));var _0x7b5d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb5d7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7b5d('0x0'));var util=require(_0x7b5d('0x1'));var logger=require('../../config/logger')(_0x7b5d('0x2'));var moment=require('moment');var BPromise=require(_0x7b5d('0x3'));var rp=require(_0x7b5d('0x4'));var fs=require('fs');var path=require(_0x7b5d('0x5'));var rimraf=require(_0x7b5d('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b5d('0x7'));module['exports']=function(_0x50b1af,_0x20cf0b){return _0x50b1af['define'](_0x7b5d('0x8'),attributes,{'tableName':'tools_trunks','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 6ac2373..336a0a2 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 _0x84e5=['stringify','error','code','Trunk,\x20%s,\x20%s','message','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowTrunk','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x1fe719,_0x5c9948){var _0x2cd5a7=function(_0xaa0f7b){while(--_0xaa0f7b){_0x1fe719['push'](_0x1fe719['shift']());}};_0x2cd5a7(++_0x5c9948);}(_0x84e5,0x1b7));var _0x584e=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x84e5[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0x584e('0x0'));var util=require(_0x584e('0x1'));var moment=require('moment');var BPromise=require(_0x584e('0x2'));var rs=require(_0x584e('0x3'));var fs=require('fs');var Redis=require(_0x584e('0x4'));var db=require(_0x584e('0x5'))['db'];var utils=require(_0x584e('0x6'));var logger=require(_0x584e('0x7'))(_0x584e('0x8'));var config=require(_0x584e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x584e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15f9d6,_0x25be10,_0x53a55c){return new BPromise(function(_0x553f8d,_0x521f1d){return client['request'](_0x15f9d6,_0x53a55c)[_0x584e('0xb')](function(_0x16248e){logger[_0x584e('0xc')]('Trunk,\x20%s,\x20%s',_0x25be10,_0x584e('0xd'));logger[_0x584e('0xe')](_0x584e('0xf'),_0x25be10,_0x584e('0xd'),JSON[_0x584e('0x10')](_0x16248e));if(_0x16248e[_0x584e('0x11')]){if(_0x16248e[_0x584e('0x11')][_0x584e('0x12')]===0x1f4){logger[_0x584e('0x11')](_0x584e('0x13'),_0x25be10,_0x16248e['error'][_0x584e('0x14')]);return _0x521f1d(_0x16248e[_0x584e('0x11')][_0x584e('0x14')]);}logger[_0x584e('0x11')](_0x584e('0x13'),_0x25be10,_0x16248e[_0x584e('0x11')][_0x584e('0x14')]);return _0x553f8d(_0x16248e['error']['message']);}else{logger[_0x584e('0xc')]('Trunk,\x20%s,\x20%s',_0x25be10,_0x584e('0xd'));_0x553f8d(_0x16248e['result']['message']);}})['catch'](function(_0x52820d){logger[_0x584e('0x11')](_0x584e('0x13'),_0x25be10,_0x52820d);_0x521f1d(_0x52820d);});});}exports[_0x584e('0x15')]=function(_0x26a129){var _0x577297=this;return new Promise(function(_0x532be6,_0x1b80c0){return db[_0x584e('0x16')][_0x584e('0x17')]({'raw':_0x26a129['options']?_0x26a129[_0x584e('0x18')][_0x584e('0x19')]===undefined?!![]:![]:!![],'where':_0x26a129[_0x584e('0x18')]?_0x26a129[_0x584e('0x18')][_0x584e('0x1a')]||null:null,'attributes':_0x26a129[_0x584e('0x18')]?_0x26a129[_0x584e('0x18')][_0x584e('0x1b')]||null:null,'limit':_0x26a129['options']?_0x26a129[_0x584e('0x18')][_0x584e('0x1c')]||null:null,'include':_0x26a129[_0x584e('0x18')]?_0x26a129['options']['include']?_[_0x584e('0x1d')](_0x26a129[_0x584e('0x18')][_0x584e('0x1e')],function(_0x10df6d){return{'model':db[_0x10df6d[_0x584e('0x1f')]],'as':_0x10df6d['as'],'attributes':_0x10df6d[_0x584e('0x1b')],'include':_0x10df6d[_0x584e('0x1e')]?_['map'](_0x10df6d[_0x584e('0x1e')],function(_0x1a79a0){return{'model':db[_0x1a79a0['model']],'as':_0x1a79a0['as'],'attributes':_0x1a79a0[_0x584e('0x1b')],'include':_0x1a79a0[_0x584e('0x1e')]?_[_0x584e('0x1d')](_0x1a79a0[_0x584e('0x1e')],function(_0x53c821){return{'model':db[_0x53c821[_0x584e('0x1f')]],'as':_0x53c821['as'],'attributes':_0x53c821['attributes']};}):[]};}):[]};}):[]:[]})[_0x584e('0xb')](function(_0x3f5e32){logger[_0x584e('0xc')](_0x584e('0x15'),_0x26a129);logger[_0x584e('0xe')](_0x584e('0x15'),_0x26a129,JSON[_0x584e('0x10')](_0x3f5e32));_0x532be6(_0x3f5e32);})['catch'](function(_0x2f0f0f){logger[_0x584e('0x11')](_0x584e('0x15'),_0x2f0f0f['message'],_0x26a129);_0x1b80c0(_0x577297[_0x584e('0x11')](0x1f4,_0x2f0f0f['message']));});});};exports['ShowTrunk']=function(_0x312a80){var _0x216ee0=this;return new Promise(function(_0x558cb7,_0x45d8f2){return db[_0x584e('0x16')][_0x584e('0x20')]({'raw':_0x312a80['options']?_0x312a80['options'][_0x584e('0x19')]===undefined?!![]:![]:!![],'where':_0x312a80[_0x584e('0x18')]?_0x312a80[_0x584e('0x18')]['where']||null:null,'attributes':_0x312a80[_0x584e('0x18')]?_0x312a80[_0x584e('0x18')][_0x584e('0x1b')]||null:null,'include':_0x312a80[_0x584e('0x18')]?_0x312a80['options']['include']?_[_0x584e('0x1d')](_0x312a80[_0x584e('0x18')][_0x584e('0x1e')],function(_0x5850f4){return{'model':db[_0x5850f4[_0x584e('0x1f')]],'as':_0x5850f4['as'],'attributes':_0x5850f4[_0x584e('0x1b')],'include':_0x5850f4['include']?_['map'](_0x5850f4[_0x584e('0x1e')],function(_0x3b4254){return{'model':db[_0x3b4254[_0x584e('0x1f')]],'as':_0x3b4254['as'],'attributes':_0x3b4254['attributes'],'include':_0x3b4254[_0x584e('0x1e')]?_[_0x584e('0x1d')](_0x3b4254[_0x584e('0x1e')],function(_0x3c8a46){return{'model':db[_0x3c8a46['model']],'as':_0x3c8a46['as'],'attributes':_0x3c8a46[_0x584e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c1762){logger[_0x584e('0xc')]('ShowTrunk',_0x312a80);logger['debug'](_0x584e('0x21'),_0x312a80,JSON[_0x584e('0x10')](_0x3c1762));_0x558cb7(_0x3c1762);})[_0x584e('0x22')](function(_0x11b27e){logger['error'](_0x584e('0x21'),_0x11b27e['message'],_0x312a80);_0x45d8f2(_0x216ee0[_0x584e('0x11')](0x1f4,_0x11b27e[_0x584e('0x14')]));});});}; \ No newline at end of file +var _0x3e51=['error','message','result','GetTrunk','options','raw','limit','map','include','model','attributes','ShowTrunk','Trunk','find','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x3e51,0x164));var _0x13e5=function(_0x1655af,_0x385e2c){_0x1655af=_0x1655af-0x0;var _0x530da2=_0x3e51[_0x1655af];return _0x530da2;};'use strict';var _=require(_0x13e5('0x0'));var util=require(_0x13e5('0x1'));var moment=require(_0x13e5('0x2'));var BPromise=require(_0x13e5('0x3'));var rs=require(_0x13e5('0x4'));var fs=require('fs');var Redis=require(_0x13e5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x13e5('0x6'));var logger=require('../../config/logger')(_0x13e5('0x7'));var config=require(_0x13e5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x13e5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eacf3,_0x1dc816,_0x5533ca){return new BPromise(function(_0x1446e7,_0x8ec078){return client[_0x13e5('0xa')](_0x4eacf3,_0x5533ca)[_0x13e5('0xb')](function(_0x5b70ab){logger[_0x13e5('0xc')](_0x13e5('0xd'),_0x1dc816,_0x13e5('0xe'));logger[_0x13e5('0xf')](_0x13e5('0x10'),_0x1dc816,_0x13e5('0xe'),JSON[_0x13e5('0x11')](_0x5b70ab));if(_0x5b70ab[_0x13e5('0x12')]){if(_0x5b70ab[_0x13e5('0x12')]['code']===0x1f4){logger[_0x13e5('0x12')](_0x13e5('0xd'),_0x1dc816,_0x5b70ab[_0x13e5('0x12')]['message']);return _0x8ec078(_0x5b70ab[_0x13e5('0x12')][_0x13e5('0x13')]);}logger[_0x13e5('0x12')](_0x13e5('0xd'),_0x1dc816,_0x5b70ab[_0x13e5('0x12')][_0x13e5('0x13')]);return _0x1446e7(_0x5b70ab[_0x13e5('0x12')]['message']);}else{logger[_0x13e5('0xc')]('Trunk,\x20%s,\x20%s',_0x1dc816,'request\x20sent');_0x1446e7(_0x5b70ab[_0x13e5('0x14')]['message']);}})['catch'](function(_0x819c97){logger['error'](_0x13e5('0xd'),_0x1dc816,_0x819c97);_0x8ec078(_0x819c97);});});}exports[_0x13e5('0x15')]=function(_0x221a44){var _0x518766=this;return new Promise(function(_0x464f22,_0x1b4337){return db['Trunk']['findAll']({'raw':_0x221a44[_0x13e5('0x16')]?_0x221a44[_0x13e5('0x16')][_0x13e5('0x17')]===undefined?!![]:![]:!![],'where':_0x221a44['options']?_0x221a44[_0x13e5('0x16')]['where']||null:null,'attributes':_0x221a44['options']?_0x221a44[_0x13e5('0x16')]['attributes']||null:null,'limit':_0x221a44[_0x13e5('0x16')]?_0x221a44[_0x13e5('0x16')][_0x13e5('0x18')]||null:null,'include':_0x221a44[_0x13e5('0x16')]?_0x221a44[_0x13e5('0x16')]['include']?_[_0x13e5('0x19')](_0x221a44[_0x13e5('0x16')][_0x13e5('0x1a')],function(_0x4a4d9f){return{'model':db[_0x4a4d9f[_0x13e5('0x1b')]],'as':_0x4a4d9f['as'],'attributes':_0x4a4d9f[_0x13e5('0x1c')],'include':_0x4a4d9f[_0x13e5('0x1a')]?_['map'](_0x4a4d9f[_0x13e5('0x1a')],function(_0x224c10){return{'model':db[_0x224c10[_0x13e5('0x1b')]],'as':_0x224c10['as'],'attributes':_0x224c10[_0x13e5('0x1c')],'include':_0x224c10['include']?_[_0x13e5('0x19')](_0x224c10[_0x13e5('0x1a')],function(_0x1bf4b3){return{'model':db[_0x1bf4b3[_0x13e5('0x1b')]],'as':_0x1bf4b3['as'],'attributes':_0x1bf4b3[_0x13e5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x13e5('0xb')](function(_0x25d978){logger[_0x13e5('0xc')](_0x13e5('0x15'),_0x221a44);logger[_0x13e5('0xf')]('GetTrunk',_0x221a44,JSON[_0x13e5('0x11')](_0x25d978));_0x464f22(_0x25d978);})['catch'](function(_0xf7fd2a){logger[_0x13e5('0x12')](_0x13e5('0x15'),_0xf7fd2a[_0x13e5('0x13')],_0x221a44);_0x1b4337(_0x518766['error'](0x1f4,_0xf7fd2a[_0x13e5('0x13')]));});});};exports[_0x13e5('0x1d')]=function(_0x163599){var _0x373268=this;return new Promise(function(_0x10f57b,_0x8a2d17){return db[_0x13e5('0x1e')][_0x13e5('0x1f')]({'raw':_0x163599['options']?_0x163599[_0x13e5('0x16')][_0x13e5('0x17')]===undefined?!![]:![]:!![],'where':_0x163599['options']?_0x163599[_0x13e5('0x16')][_0x13e5('0x20')]||null:null,'attributes':_0x163599[_0x13e5('0x16')]?_0x163599[_0x13e5('0x16')][_0x13e5('0x1c')]||null:null,'include':_0x163599[_0x13e5('0x16')]?_0x163599[_0x13e5('0x16')][_0x13e5('0x1a')]?_['map'](_0x163599['options'][_0x13e5('0x1a')],function(_0x4c26ee){return{'model':db[_0x4c26ee[_0x13e5('0x1b')]],'as':_0x4c26ee['as'],'attributes':_0x4c26ee[_0x13e5('0x1c')],'include':_0x4c26ee['include']?_[_0x13e5('0x19')](_0x4c26ee[_0x13e5('0x1a')],function(_0x10e2e3){return{'model':db[_0x10e2e3[_0x13e5('0x1b')]],'as':_0x10e2e3['as'],'attributes':_0x10e2e3[_0x13e5('0x1c')],'include':_0x10e2e3['include']?_[_0x13e5('0x19')](_0x10e2e3['include'],function(_0x2dc4c6){return{'model':db[_0x2dc4c6['model']],'as':_0x2dc4c6['as'],'attributes':_0x2dc4c6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x399f97){logger[_0x13e5('0xc')](_0x13e5('0x1d'),_0x163599);logger[_0x13e5('0xf')](_0x13e5('0x1d'),_0x163599,JSON[_0x13e5('0x11')](_0x399f97));_0x10f57b(_0x399f97);})[_0x13e5('0x21')](function(_0x1c8db6){logger[_0x13e5('0x12')](_0x13e5('0x1d'),_0x1c8db6[_0x13e5('0x13')],_0x163599);_0x8a2d17(_0x373268[_0x13e5('0x12')](0x1f4,_0x1c8db6['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c95ec64..fa939c0 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 _0x63af=['addQueues','diskStorage','join','root','server/files/images/','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','createApiKey','update','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','getOpenTabs','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','/:id/queues'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x63af,0x16b));var _0xf63a=function(_0x2582af,_0x3409f7){_0x2582af=_0x2582af-0x0;var _0x38c9c6=_0x63af[_0x2582af];return _0x38c9c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf63a('0x0'));var timeout=require(_0xf63a('0x1'));var express=require(_0xf63a('0x2'));var router=express[_0xf63a('0x3')]();var fs_extra=require(_0xf63a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf63a('0x5'));var config=require(_0xf63a('0x6'));var controller=require('./user.controller');router[_0xf63a('0x7')]('/',auth[_0xf63a('0x8')](),controller[_0xf63a('0x9')]);router['get'](_0xf63a('0xa'),auth['isAuthenticated'](),controller[_0xf63a('0xb')]);router[_0xf63a('0x7')](_0xf63a('0xc'),auth[_0xf63a('0x8')](),controller[_0xf63a('0xd')]);router[_0xf63a('0x7')](_0xf63a('0xe'),auth[_0xf63a('0x8')](),controller['getPresence']);router[_0xf63a('0x7')](_0xf63a('0xf'),auth[_0xf63a('0x8')](),controller['show']);router[_0xf63a('0x7')]('/:id/avatar',controller['getAvatar']);router['get']('/:id/open_tabs',auth[_0xf63a('0x8')](),controller[_0xf63a('0x10')]);router[_0xf63a('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xf63a('0x7')]('/:id/queues',auth['isAuthenticated'](),controller[_0xf63a('0x11')]);router['get']('/:id/queues_rt',auth['isAuthenticated'](),controller[_0xf63a('0x12')]);router[_0xf63a('0x7')](_0xf63a('0x13'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x14')]);router[_0xf63a('0x7')]('/:id/recordings',auth[_0xf63a('0x8')](),controller['getRecordings']);router[_0xf63a('0x7')](_0xf63a('0x15'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x16')]);router[_0xf63a('0x7')](_0xf63a('0x17'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0xf63a('0x7')](_0xf63a('0x18'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x19')]);router['get'](_0xf63a('0x1a'),auth[_0xf63a('0x8')](),controller['getMailInteractions']);router[_0xf63a('0x7')]('/:id/sms/interactions',auth[_0xf63a('0x8')](),controller[_0xf63a('0x1b')]);router[_0xf63a('0x7')](_0xf63a('0x1c'),auth['isAuthenticated'](),controller[_0xf63a('0x1d')]);router[_0xf63a('0x7')](_0xf63a('0x1e'),auth[_0xf63a('0x8')](),controller['getWhatsappInteractions']);router[_0xf63a('0x7')](_0xf63a('0x1f'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x20')]);router[_0xf63a('0x7')](_0xf63a('0x21'),auth['isAuthenticated'](),controller[_0xf63a('0x22')]);router[_0xf63a('0x7')]('/:id/agents',auth['isAuthenticated'](),controller[_0xf63a('0x23')]);router[_0xf63a('0x7')]('/:id/prefixes',auth[_0xf63a('0x8')](),controller['getVoicePrefixes']);router['get'](_0xf63a('0x24'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x25')]);router['get'](_0xf63a('0x26'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x27')]);router['get'](_0xf63a('0x28'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x29')]);router[_0xf63a('0x7')](_0xf63a('0x2a'),auth['isAuthenticated'](),controller[_0xf63a('0x2b')]);router['get'](_0xf63a('0x2c'),auth['isAuthenticated'](),controller[_0xf63a('0x2d')]);router['get'](_0xf63a('0x2e'),auth[_0xf63a('0x8')](),controller['getWhatsappAccounts']);router['get'](_0xf63a('0x2f'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x30')]);router[_0xf63a('0x7')](_0xf63a('0x31'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xf63a('0x7')](_0xf63a('0x32'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x33')]);router[_0xf63a('0x34')]('/:id/contacts',auth[_0xf63a('0x8')](),controller['addContacts']);router[_0xf63a('0x34')]('/',auth[_0xf63a('0x8')](),controller[_0xf63a('0x35')]);router[_0xf63a('0x34')](_0xf63a('0x36'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x37')]);router['post'](_0xf63a('0x38'),auth['isAuthenticated'](),controller[_0xf63a('0x39')]);var upload=multer({'storage':multer[_0xf63a('0x3a')]({'destination':function(_0x2b0f80,_0xa551cd,_0x2ac142){_0x2ac142(null,path[_0xf63a('0x3b')](config[_0xf63a('0x3c')],_0xf63a('0x3d')));},'filename':function(_0x30cd55,_0xa1b381,_0x4eb795){_0x4eb795(null,util['format'](_0xf63a('0x3e'),Date['now'](),_0xa1b381[_0xf63a('0x3f')]));}})});router['post'](_0xf63a('0x40'),upload[_0xf63a('0x41')](_0xf63a('0x42')),controller[_0xf63a('0x43')]);router[_0xf63a('0x34')](_0xf63a('0x44'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x45')]);router[_0xf63a('0x34')]('/:id/logout',auth['isAuthenticated'](),controller['logout']);router[_0xf63a('0x34')](_0xf63a('0x46'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x47')]);router[_0xf63a('0x34')](_0xf63a('0x48'),auth['isAuthenticated'](),controller[_0xf63a('0x49')]);router[_0xf63a('0x34')](_0xf63a('0x1f'),auth['isAuthenticated'](),controller[_0xf63a('0x4a')]);router[_0xf63a('0x34')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xf63a('0x4b')]);router[_0xf63a('0x34')]('/:id/mail_interactions',auth[_0xf63a('0x8')](),controller['addMailInteractions']);router[_0xf63a('0x34')]('/:id/fax_interactions',auth[_0xf63a('0x8')](),controller['addFaxInteractions']);router[_0xf63a('0x34')](_0xf63a('0x4c'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x4d')]);router['post']('/:id/openchannel_interactions',auth[_0xf63a('0x8')](),controller[_0xf63a('0x4e')]);router[_0xf63a('0x34')](_0xf63a('0x4f'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x50')]);router[_0xf63a('0x34')](_0xf63a('0x24'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x51')]);router['post'](_0xf63a('0x26'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x52')]);router[_0xf63a('0x34')](_0xf63a('0x28'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x53')]);router[_0xf63a('0x34')](_0xf63a('0x2a'),auth[_0xf63a('0x8')](),controller['addSmsAccounts']);router[_0xf63a('0x34')](_0xf63a('0x2c'),auth['isAuthenticated'](),controller[_0xf63a('0x54')]);router[_0xf63a('0x34')](_0xf63a('0x2e'),auth[_0xf63a('0x8')](),controller['addWhatsappAccounts']);router['post'](_0xf63a('0x2f'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x55')]);router[_0xf63a('0x34')](_0xf63a('0x32'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x56')]);router['put'](_0xf63a('0xf'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x57')]);router['put']('/:id/password',auth[_0xf63a('0x8')](),controller[_0xf63a('0x58')]);router['delete'](_0xf63a('0x38'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x59')]);router[_0xf63a('0x5a')]('/:id/teams',auth[_0xf63a('0x8')](),controller[_0xf63a('0x5b')]);router[_0xf63a('0x5a')](_0xf63a('0xf'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x5c')]);router[_0xf63a('0x5a')](_0xf63a('0x5d'),auth['isAuthenticated'](),controller[_0xf63a('0x5e')]);router[_0xf63a('0x5a')](_0xf63a('0x5f'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x60')]);router[_0xf63a('0x5a')](_0xf63a('0x61'),auth[_0xf63a('0x8')](),controller['removeFaxInteractions']);router['delete'](_0xf63a('0x4c'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0xf63a('0x8')](),controller[_0xf63a('0x62')]);router[_0xf63a('0x5a')](_0xf63a('0x4f'),auth[_0xf63a('0x8')](),controller['removeWhatsappInteractions']);router[_0xf63a('0x5a')](_0xf63a('0x24'),auth[_0xf63a('0x8')](),controller['removeFaxAccounts']);router['delete'](_0xf63a('0x26'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x63')]);router[_0xf63a('0x5a')](_0xf63a('0x28'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x64')]);router[_0xf63a('0x5a')](_0xf63a('0x2a'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xf63a('0x5a')]('/:id/chat_websites',auth[_0xf63a('0x8')](),controller[_0xf63a('0x65')]);router[_0xf63a('0x5a')](_0xf63a('0x2e'),auth[_0xf63a('0x8')](),controller[_0xf63a('0x66')]);router['delete']('/:id/square_projects',auth['isAuthenticated'](),controller[_0xf63a('0x67')]);router[_0xf63a('0x5a')](_0xf63a('0x32'),auth[_0xf63a('0x8')](),controller['removeApiKey']);module[_0xf63a('0x68')]=router; \ No newline at end of file +var _0x57bb=['addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getOpenTabs','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/:id/contacts','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','single','file','/:id/login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams'];(function(_0x137f06,_0x2a7b36){var _0x152b0c=function(_0x5655b1){while(--_0x5655b1){_0x137f06['push'](_0x137f06['shift']());}};_0x152b0c(++_0x2a7b36);}(_0x57bb,0x10e));var _0xb57b=function(_0x38aeb9,_0x22da8c){_0x38aeb9=_0x38aeb9-0x0;var _0x5e944e=_0x57bb[_0x38aeb9];return _0x5e944e;};'use strict';var multer=require(_0xb57b('0x0'));var util=require(_0xb57b('0x1'));var path=require(_0xb57b('0x2'));var timeout=require(_0xb57b('0x3'));var express=require(_0xb57b('0x4'));var router=express[_0xb57b('0x5')]();var fs_extra=require(_0xb57b('0x6'));var auth=require(_0xb57b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb57b('0x8'));var controller=require(_0xb57b('0x9'));router[_0xb57b('0xa')]('/',auth[_0xb57b('0xb')](),controller[_0xb57b('0xc')]);router[_0xb57b('0xa')](_0xb57b('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xb57b('0xa')](_0xb57b('0xe'),auth['isAuthenticated'](),controller[_0xb57b('0xf')]);router['get'](_0xb57b('0x10'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x11')]);router[_0xb57b('0xa')]('/:id',auth[_0xb57b('0xb')](),controller[_0xb57b('0x12')]);router[_0xb57b('0xa')](_0xb57b('0x13'),controller['getAvatar']);router[_0xb57b('0xa')]('/:id/open_tabs',auth[_0xb57b('0xb')](),controller[_0xb57b('0x14')]);router[_0xb57b('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xb57b('0xa')](_0xb57b('0x15'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x16')]);router[_0xb57b('0xa')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0xb57b('0x17')]);router[_0xb57b('0xa')](_0xb57b('0x18'),auth[_0xb57b('0xb')](),controller['getGroups']);router[_0xb57b('0xa')](_0xb57b('0x19'),auth['isAuthenticated'](),controller[_0xb57b('0x1a')]);router['get'](_0xb57b('0x1b'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x1c')]);router[_0xb57b('0xa')]('/:id/chat/interactions',auth[_0xb57b('0xb')](),controller[_0xb57b('0x1d')]);router[_0xb57b('0xa')](_0xb57b('0x1e'),auth['isAuthenticated'](),controller[_0xb57b('0x1f')]);router['get'](_0xb57b('0x20'),auth['isAuthenticated'](),controller[_0xb57b('0x21')]);router['get']('/:id/sms/interactions',auth[_0xb57b('0xb')](),controller[_0xb57b('0x22')]);router[_0xb57b('0xa')](_0xb57b('0x23'),auth[_0xb57b('0xb')](),controller['getFaxInteractions']);router[_0xb57b('0xa')](_0xb57b('0x24'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x25')]);router[_0xb57b('0xa')](_0xb57b('0x26'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x27')]);router[_0xb57b('0xa')](_0xb57b('0x28'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x29')]);router[_0xb57b('0xa')](_0xb57b('0x2a'),auth[_0xb57b('0xb')](),controller['getAgents']);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xb57b('0xa')](_0xb57b('0x2b'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x2c')]);router[_0xb57b('0xa')](_0xb57b('0x2d'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x2e')]);router[_0xb57b('0xa')](_0xb57b('0x2f'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x30')]);router[_0xb57b('0xa')](_0xb57b('0x31'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x32')]);router[_0xb57b('0xa')](_0xb57b('0x33'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x34')]);router['get'](_0xb57b('0x35'),auth[_0xb57b('0xb')](),controller['getWhatsappAccounts']);router['get']('/:id/square_projects',auth[_0xb57b('0xb')](),controller[_0xb57b('0x36')]);router[_0xb57b('0xa')](_0xb57b('0x37'),auth[_0xb57b('0xb')](),controller['getScheduledCalls']);router['get'](_0xb57b('0x38'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x39')]);router[_0xb57b('0x3a')](_0xb57b('0x3b'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb57b('0x3a')]('/',auth[_0xb57b('0xb')](),controller['create']);router[_0xb57b('0x3a')](_0xb57b('0x3c'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x3d')]);router[_0xb57b('0x3a')](_0xb57b('0x15'),auth['isAuthenticated'](),controller[_0xb57b('0x3e')]);var upload=multer({'storage':multer[_0xb57b('0x3f')]({'destination':function(_0x4d8fa8,_0x41b573,_0xd73374){_0xd73374(null,path[_0xb57b('0x40')](config['root'],_0xb57b('0x41')));},'filename':function(_0x1c8c07,_0x259286,_0x5905d9){_0x5905d9(null,util[_0xb57b('0x42')](_0xb57b('0x43'),Date[_0xb57b('0x44')](),_0x259286['originalname']));}})});router[_0xb57b('0x3a')]('/:id/avatar',upload[_0xb57b('0x45')](_0xb57b('0x46')),controller['addAvatar']);router[_0xb57b('0x3a')](_0xb57b('0x47'),auth[_0xb57b('0xb')](),controller['login']);router[_0xb57b('0x3a')]('/:id/logout',auth[_0xb57b('0xb')](),controller[_0xb57b('0x48')]);router['post'](_0xb57b('0x49'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x4a')]);router[_0xb57b('0x3a')](_0xb57b('0x4b'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x4c')]);router[_0xb57b('0x3a')](_0xb57b('0x26'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x4d')]);router['post']('/:id/chat_interactions',auth[_0xb57b('0xb')](),controller[_0xb57b('0x4e')]);router[_0xb57b('0x3a')](_0xb57b('0x4f'),auth[_0xb57b('0xb')](),controller['addMailInteractions']);router[_0xb57b('0x3a')]('/:id/fax_interactions',auth[_0xb57b('0xb')](),controller[_0xb57b('0x50')]);router['post'](_0xb57b('0x51'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x52')]);router[_0xb57b('0x3a')](_0xb57b('0x53'),auth['isAuthenticated'](),controller[_0xb57b('0x54')]);router[_0xb57b('0x3a')]('/:id/whatsapp_interactions',auth[_0xb57b('0xb')](),controller[_0xb57b('0x55')]);router['post'](_0xb57b('0x2b'),auth[_0xb57b('0xb')](),controller['addFaxAccounts']);router[_0xb57b('0x3a')](_0xb57b('0x2d'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x56')]);router[_0xb57b('0x3a')](_0xb57b('0x2f'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x57')]);router[_0xb57b('0x3a')](_0xb57b('0x31'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x58')]);router[_0xb57b('0x3a')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xb57b('0x3a')](_0xb57b('0x35'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xb57b('0x3a')]('/:id/square_projects',auth[_0xb57b('0xb')](),controller[_0xb57b('0x59')]);router[_0xb57b('0x3a')](_0xb57b('0x38'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x5a')]);router[_0xb57b('0x5b')]('/:id',auth[_0xb57b('0xb')](),controller[_0xb57b('0x5c')]);router[_0xb57b('0x5b')](_0xb57b('0x5d'),auth['isAuthenticated'](),controller[_0xb57b('0x5e')]);router[_0xb57b('0x5f')]('/:id/queues',auth[_0xb57b('0xb')](),controller[_0xb57b('0x60')]);router[_0xb57b('0x5f')](_0xb57b('0x26'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x61')]);router[_0xb57b('0x5f')]('/:id',auth[_0xb57b('0xb')](),controller[_0xb57b('0x62')]);router[_0xb57b('0x5f')](_0xb57b('0x63'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x64')]);router['delete'](_0xb57b('0x4f'),auth['isAuthenticated'](),controller[_0xb57b('0x65')]);router[_0xb57b('0x5f')](_0xb57b('0x66'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x67')]);router[_0xb57b('0x5f')](_0xb57b('0x51'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x68')]);router['delete'](_0xb57b('0x53'),auth[_0xb57b('0xb')](),controller['removeOpenchannelInteractions']);router[_0xb57b('0x5f')](_0xb57b('0x69'),auth['isAuthenticated'](),controller[_0xb57b('0x6a')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xb57b('0x6b')]);router['delete'](_0xb57b('0x2d'),auth['isAuthenticated'](),controller[_0xb57b('0x6c')]);router['delete'](_0xb57b('0x2f'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x6d')]);router[_0xb57b('0x5f')](_0xb57b('0x31'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x6e')]);router[_0xb57b('0x5f')](_0xb57b('0x33'),auth['isAuthenticated'](),controller['removeChatWebsites']);router['delete'](_0xb57b('0x35'),auth[_0xb57b('0xb')](),controller[_0xb57b('0x6f')]);router[_0xb57b('0x5f')](_0xb57b('0x70'),auth['isAuthenticated'](),controller[_0xb57b('0x71')]);router[_0xb57b('0x5f')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xb57b('0x72')]);module[_0xb57b('0x73')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 68fd555..a6321db 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 _0xe5c0=['util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','getDataValue','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','yes','nonat','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','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','isArray','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','encryption','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','moment'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0xe5c0,0x163));var _0x0e5c=function(_0x8c9741,_0x1362c8){_0x8c9741=_0x8c9741-0x0;var _0x580e3e=_0xe5c0[_0x8c9741];return _0x580e3e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0e5c('0x0'));var util=require(_0x0e5c('0x1'));var _=require('lodash');module[_0x0e5c('0x2')]={'name':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':![],'unique':_0x0e5c('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x138d0){this[_0x0e5c('0x5')]('name',_0x138d0);this['setDataValue'](_0x0e5c('0x6'),_0x138d0);},'comment':_0x0e5c('0x7')},'fullname':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':![],'set':function(_0x7687e8){this[_0x0e5c('0x5')]('fullname',_0x7687e8);this[_0x0e5c('0x5')](_0x0e5c('0x8'),util[_0x0e5c('0x9')](_0x0e5c('0xa'),_0x7687e8,this['getDataValue'](_0x0e5c('0xb'))));}},'alias':{'type':Sequelize[_0x0e5c('0x3')]},'email':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':![],'unique':_0x0e5c('0xc'),'validate':{'isEmail':!![]},'set':function(_0x108ca1){if(_0x108ca1){this[_0x0e5c('0x5')](_0x0e5c('0xc'),_0x108ca1[_0x0e5c('0xd')]());}}},'role':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0xf'),_0x0e5c('0x10'),_0x0e5c('0x11'),_0x0e5c('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0e5c('0x3')],'defaultValue':_0x0e5c('0x13')},'internal':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':![],'unique':_0x0e5c('0xb'),'set':function(_0x3c8933){this[_0x0e5c('0x5')](_0x0e5c('0xb'),_0x3c8933);this['setDataValue']('accountcode',_0x3c8933);this['setDataValue']('callerid',util['format'](_0x0e5c('0xa'),this[_0x0e5c('0x15')](_0x0e5c('0x16')),_0x3c8933));}},'salt':{'type':Sequelize[_0x0e5c('0x3')]},'phone':{'type':Sequelize[_0x0e5c('0x3')]},'mobile':{'type':Sequelize[_0x0e5c('0x3')]},'address':{'type':Sequelize[_0x0e5c('0x3')]},'zipcode':{'type':Sequelize[_0x0e5c('0x3')]},'userpic':{'type':Sequelize[_0x0e5c('0x3')]},'city':{'type':Sequelize[_0x0e5c('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0e5c('0x18')]},'voicePause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0e5c('0x3')],'defaultValue':_0x0e5c('0x19')},'lastPauseAt':{'type':Sequelize[_0x0e5c('0x18')]},'chatCapacity':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0e5c('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0e5c('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![],'defaultValue':_0x0e5c('0x1a')},'ipaddr':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0e5c('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0e5c('0xe')]('friend',_0x0e5c('0x10'),_0x0e5c('0x1b')),'allowNull':!![],'defaultValue':_0x0e5c('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0e5c('0x1d')},'callingpres':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x1e'),_0x0e5c('0x1f'),_0x0e5c('0x20'),_0x0e5c('0x21'),_0x0e5c('0x22'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x0e5c('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![],'defaultValue':_0x0e5c('0x24'),'set':function(_0x579eb6){this[_0x0e5c('0x5')](_0x0e5c('0x25'),_0x579eb6?_0x579eb6[_0x0e5c('0x26')](','):null);},'get':function(){return this[_0x0e5c('0x15')](_0x0e5c('0x25'))?this['getDataValue'](_0x0e5c('0x25'))[_0x0e5c('0x27')](','):null;},'comment':_0x0e5c('0x28')},'dtmfmode':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x29'),'info','shortinfo','inband',_0x0e5c('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no',_0x0e5c('0x2c'),'update',_0x0e5c('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![],'defaultValue':_0x0e5c('0x2e'),'set':function(_0x40dd64){this[_0x0e5c('0x5')]('nat',_0x40dd64?_0x40dd64[_0x0e5c('0x26')](','):null);},'get':function(){return this[_0x0e5c('0x15')]('nat')?this['getDataValue'](_0x0e5c('0x2f'))['split'](','):null;},'comment':_0x0e5c('0x30')},'callgroup':{'type':Sequelize[_0x0e5c('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0e5c('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0e5c('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e5c('0x31')},'allow':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':![],'defaultValue':_0x0e5c('0x32'),'set':function(_0x3b4cc2){this[_0x0e5c('0x5')](_0x0e5c('0x33'),_0x3b4cc2?_0x3b4cc2['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x0e5c('0x15')](_0x0e5c('0x33'))?this[_0x0e5c('0x15')](_0x0e5c('0x33'))[_0x0e5c('0x27')](';'):null;},'comment':_0x0e5c('0x34')},'autoframing':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![],'set':function(_0x887c29){this[_0x0e5c('0x5')](_0x0e5c('0x35'),_0x887c29?_0x887c29[_0x0e5c('0x26')](','):null);},'get':function(){return this[_0x0e5c('0x15')](_0x0e5c('0x35'))?this['getDataValue'](_0x0e5c('0x35'))[_0x0e5c('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0e5c('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0e5c('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0e5c('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no',_0x0e5c('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0e5c('0xe')]('accept',_0x0e5c('0x37'),_0x0e5c('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0e5c('0x39'),_0x0e5c('0x3a')),'allowNull':!![],'defaultValue':_0x0e5c('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0e5c('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no',_0x0e5c('0x3b'),_0x0e5c('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x3d'),_0x0e5c('0x3e'),_0x0e5c('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0e5c('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0e5c('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0e5c('0xe')](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x0e5c('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0e5c('0xe')]('yes','no','nonat',_0x0e5c('0x40'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0e5c('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0e5c('0x18')]},'passwordResetAt':{'type':Sequelize[_0x0e5c('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0,'set':function(_0x19e201){this[_0x0e5c('0x5')]('showWebBar',_0x19e201);var _0x5f361a=this['get']({'plain':!![]});switch(_0x19e201){case 0x0:case 0x1:var _0x2d1d75=_0x5f361a[_0x0e5c('0x25')]?_[_0x0e5c('0x41')](_0x5f361a['transport'])?_0x5f361a['transport'][_0x0e5c('0x26')]():_0x5f361a['transport']:_0x0e5c('0x24');if(_0x2d1d75==='wss'){_0x2d1d75='udp';}this[_0x0e5c('0x5')](_0x0e5c('0x25'),_0x2d1d75);this['setDataValue']('encryption','no');this[_0x0e5c('0x5')](_0x0e5c('0x42'),null);this['setDataValue'](_0x0e5c('0x43'),null);this[_0x0e5c('0x5')](_0x0e5c('0x44'),null);this[_0x0e5c('0x5')](_0x0e5c('0x45'),null);this[_0x0e5c('0x5')]('dtlsverify',null);this[_0x0e5c('0x5')](_0x0e5c('0x46'),null);this[_0x0e5c('0x5')](_0x0e5c('0x47'),null);this[_0x0e5c('0x5')](_0x0e5c('0x48'),null);this[_0x0e5c('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x0e5c('0x5')]('transport','wss');this['setDataValue'](_0x0e5c('0x49'),'yes');this[_0x0e5c('0x5')](_0x0e5c('0x42'),_0x0e5c('0x2b'));this[_0x0e5c('0x5')](_0x0e5c('0x43'),_0x0e5c('0x2b'));this['setDataValue'](_0x0e5c('0x44'),_0x0e5c('0x2b'));this[_0x0e5c('0x5')](_0x0e5c('0x45'),'yes');this[_0x0e5c('0x5')](_0x0e5c('0x4a'),'no');this[_0x0e5c('0x5')](_0x0e5c('0x46'),_0x0e5c('0x3f'));this[_0x0e5c('0x5')](_0x0e5c('0x47'),_0x5f361a['dtlscertfile']||_0x0e5c('0x4b'));this[_0x0e5c('0x5')]('dtlsprivatekey',_0x5f361a[_0x0e5c('0x48')]||_0x0e5c('0x4c'));this[_0x0e5c('0x5')](_0x0e5c('0x4d'),_0x0e5c('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x0e5c('0x4e')],'set':function(_0x64d177){this[_0x0e5c('0x5')](_0x0e5c('0x4f'),_0x64d177?_0x64d177[_0x0e5c('0x26')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x0e5c('0x50')](this[_0x0e5c('0x15')](_0x0e5c('0x4f'))['split'](','),function(_0xf354c9){return parseInt(_0xf354c9,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0e5c('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0e5c('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0e5c('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0e5c('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0e5c('0x51')],'get':function(){return this[_0x0e5c('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0e5c('0x15')](_0x0e5c('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0e5c('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0e5c('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![],'set':function(_0x1a52b6){if(typeof _0x1a52b6===_0x0e5c('0x53')){var _0x470064=_0x1a52b6==='1'?!![]:_0x1a52b6==='0'?![]:_0x1a52b6===_0x0e5c('0x54')?!![]:_0x1a52b6===_0x0e5c('0x55')?![]:![];this['setDataValue'](_0x0e5c('0x56'),_0x470064);}else{this[_0x0e5c('0x5')]('screenrecording',_0x1a52b6);}}},'blocked':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![],'set':function(_0x523dce){this[_0x0e5c('0x5')]('blocked',_0x523dce);if(_0x523dce===!![]){this['setDataValue'](_0x0e5c('0x57'),moment());this[_0x0e5c('0x5')]('loginAttempts',0x0);}else{this[_0x0e5c('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x0e5c('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0e5c('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x0e5c('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0e5c('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0xdaf1=['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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','active','actpass','update,nonat','TEXT','showWebBar','get','wss','encryption','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','dtlsenable','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','user','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdaf1,0x8a));var _0x1daf=function(_0x1362d3,_0x47f279){_0x1362d3=_0x1362d3-0x0;var _0x1589e2=_0xdaf1[_0x1362d3];return _0x1589e2;};'use strict';var Sequelize=require(_0x1daf('0x0'));var moment=require(_0x1daf('0x1'));var util=require(_0x1daf('0x2'));var _=require('lodash');module[_0x1daf('0x3')]={'name':{'type':Sequelize[_0x1daf('0x4')],'allowNull':![],'unique':_0x1daf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x425c0b){this[_0x1daf('0x6')]('name',_0x425c0b);this[_0x1daf('0x6')](_0x1daf('0x7'),_0x425c0b);},'comment':_0x1daf('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x372995){this['setDataValue'](_0x1daf('0x9'),_0x372995);this['setDataValue'](_0x1daf('0xa'),util[_0x1daf('0xb')](_0x1daf('0xc'),_0x372995,this[_0x1daf('0xd')](_0x1daf('0xe'))));}},'alias':{'type':Sequelize[_0x1daf('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1daf('0xf'),'validate':{'isEmail':!![]},'set':function(_0x15356e){if(_0x15356e){this[_0x1daf('0x6')](_0x1daf('0xf'),_0x15356e[_0x1daf('0x10')]());}}},'role':{'type':Sequelize[_0x1daf('0x11')]('admin',_0x1daf('0x12'),'agent',_0x1daf('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1daf('0x4')],'defaultValue':_0x1daf('0x14')},'internal':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':![],'unique':_0x1daf('0xe'),'set':function(_0x311313){this[_0x1daf('0x6')](_0x1daf('0xe'),_0x311313);this[_0x1daf('0x6')](_0x1daf('0x16'),_0x311313);this['setDataValue'](_0x1daf('0xa'),util[_0x1daf('0xb')](_0x1daf('0xc'),this['getDataValue'](_0x1daf('0x9')),_0x311313));}},'salt':{'type':Sequelize[_0x1daf('0x4')]},'phone':{'type':Sequelize[_0x1daf('0x4')]},'mobile':{'type':Sequelize[_0x1daf('0x4')]},'address':{'type':Sequelize[_0x1daf('0x4')]},'zipcode':{'type':Sequelize[_0x1daf('0x4')]},'userpic':{'type':Sequelize[_0x1daf('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1daf('0x4')]},'online':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1daf('0x18')]},'voicePause':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x1daf('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1daf('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x1daf('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x1a'),_0x1daf('0x12'),_0x1daf('0x1b')),'allowNull':!![],'defaultValue':_0x1daf('0x1a')},'context':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x1c'),_0x1daf('0x1d'),'ALLOWED_FAILED_SCREEN',_0x1daf('0x1e'),_0x1daf('0x1f'),_0x1daf('0x20'),_0x1daf('0x21'),_0x1daf('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'defaultValue':_0x1daf('0x23'),'set':function(_0x3d469e){this[_0x1daf('0x6')]('transport',_0x3d469e?_0x3d469e[_0x1daf('0x24')](','):null);},'get':function(){return this[_0x1daf('0xd')](_0x1daf('0x25'))?this[_0x1daf('0xd')](_0x1daf('0x25'))[_0x1daf('0x26')](','):null;},'comment':_0x1daf('0x27')},'dtmfmode':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x28'),'info',_0x1daf('0x29'),'inband',_0x1daf('0x2a')),'allowNull':!![],'defaultValue':_0x1daf('0x28')},'directmedia':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no',_0x1daf('0x2c'),_0x1daf('0x2d'),_0x1daf('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'defaultValue':_0x1daf('0x2f'),'set':function(_0x4f9515){this[_0x1daf('0x6')](_0x1daf('0x30'),_0x4f9515?_0x4f9515['join'](','):null);},'get':function(){return this[_0x1daf('0xd')](_0x1daf('0x30'))?this[_0x1daf('0xd')](_0x1daf('0x30'))['split'](','):null;},'comment':_0x1daf('0x31')},'callgroup':{'type':Sequelize[_0x1daf('0x4')]},'namedcallgroup':{'type':Sequelize[_0x1daf('0x4')]},'pickupgroup':{'type':Sequelize[_0x1daf('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1daf('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1daf('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1daf('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1daf('0x33'),'set':function(_0x43b53f){this['setDataValue']('allow',_0x43b53f?_0x43b53f[_0x1daf('0x24')](';'):_0x1daf('0x33'));},'get':function(){return this[_0x1daf('0xd')](_0x1daf('0x34'))?this['getDataValue'](_0x1daf('0x34'))[_0x1daf('0x26')](';'):null;},'comment':_0x1daf('0x35')},'autoframing':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'set':function(_0x4a3c6d){this[_0x1daf('0x6')]('insecure',_0x4a3c6d?_0x4a3c6d[_0x1daf('0x24')](','):null);},'get':function(){return this[_0x1daf('0xd')](_0x1daf('0x36'))?this[_0x1daf('0xd')](_0x1daf('0x36'))['split'](','):null;},'comment':_0x1daf('0x37')},'trustrpid':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no',_0x1daf('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![],'defaultValue':_0x1daf('0x39')},'amaflags':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x1daf('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no',_0x1daf('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x3b'),_0x1daf('0x3c'),_0x1daf('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x1daf('0x3e'),_0x1daf('0x3f')),'allowNull':!![],'defaultValue':_0x1daf('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x1daf('0x2b'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1daf('0x40'),'passive',_0x1daf('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1daf('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1daf('0x11')](_0x1daf('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1daf('0x11')]('yes','no',_0x1daf('0x2c'),'update',_0x1daf('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1daf('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x1daf('0x18')]},'passwordResetAt':{'type':Sequelize[_0x1daf('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1daf('0x43')]},'showWebBar':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0,'set':function(_0x1c46b2){this[_0x1daf('0x6')](_0x1daf('0x44'),_0x1c46b2);var _0x15b6a7=this[_0x1daf('0x45')]({'plain':!![]});switch(_0x1c46b2){case 0x0:case 0x1:var _0x53f825=_0x15b6a7[_0x1daf('0x25')]?_['isArray'](_0x15b6a7[_0x1daf('0x25')])?_0x15b6a7['transport'][_0x1daf('0x24')]():_0x15b6a7[_0x1daf('0x25')]:_0x1daf('0x23');if(_0x53f825===_0x1daf('0x46')){_0x53f825=_0x1daf('0x23');}this[_0x1daf('0x6')](_0x1daf('0x25'),_0x53f825);this[_0x1daf('0x6')](_0x1daf('0x47'),'no');this['setDataValue']('avpf',null);this[_0x1daf('0x6')](_0x1daf('0x48'),null);this[_0x1daf('0x6')](_0x1daf('0x49'),null);this[_0x1daf('0x6')]('dtlsenable',null);this[_0x1daf('0x6')](_0x1daf('0x4a'),null);this[_0x1daf('0x6')](_0x1daf('0x4b'),null);this[_0x1daf('0x6')](_0x1daf('0x4c'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x1daf('0x6')](_0x1daf('0x4d'),'no');break;case 0x2:this[_0x1daf('0x6')](_0x1daf('0x25'),'wss');this[_0x1daf('0x6')]('encryption',_0x1daf('0x2b'));this[_0x1daf('0x6')]('avpf',_0x1daf('0x2b'));this['setDataValue'](_0x1daf('0x48'),_0x1daf('0x2b'));this[_0x1daf('0x6')](_0x1daf('0x49'),'yes');this[_0x1daf('0x6')](_0x1daf('0x4e'),_0x1daf('0x2b'));this['setDataValue'](_0x1daf('0x4a'),'no');this[_0x1daf('0x6')](_0x1daf('0x4b'),_0x1daf('0x41'));this['setDataValue']('dtlscertfile',_0x15b6a7[_0x1daf('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0x1daf('0x6')](_0x1daf('0x4f'),_0x15b6a7[_0x1daf('0x4f')]||_0x1daf('0x50'));this[_0x1daf('0x6')](_0x1daf('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x1daf('0x43')],'set':function(_0x42d27a){this[_0x1daf('0x6')](_0x1daf('0x51'),_0x42d27a?_0x42d27a[_0x1daf('0x24')](','):[]);},'get':function(){return this['getDataValue'](_0x1daf('0x51'))?_['map'](this[_0x1daf('0xd')](_0x1daf('0x51'))[_0x1daf('0x26')](','),function(_0x4facb8){return parseInt(_0x4facb8,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1daf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1daf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1daf('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1daf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1daf('0x11')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1daf('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1daf('0x52')],'get':function(){return this[_0x1daf('0xd')](_0x1daf('0x53'))?this['getDataValue'](_0x1daf('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1daf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1daf('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![],'set':function(_0x1f3308){if(typeof _0x1f3308===_0x1daf('0x54')){var _0x393773=_0x1f3308==='1'?!![]:_0x1f3308==='0'?![]:_0x1f3308===_0x1daf('0x55')?!![]:_0x1f3308===_0x1daf('0x56')?![]:![];this[_0x1daf('0x6')](_0x1daf('0x57'),_0x393773);}else{this[_0x1daf('0x6')](_0x1daf('0x57'),_0x1f3308);}}},'blocked':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![],'set':function(_0x366557){this[_0x1daf('0x6')](_0x1daf('0x58'),_0x366557);if(_0x366557===!![]){this[_0x1daf('0x6')]('blockedAt',moment());this[_0x1daf('0x6')](_0x1daf('0x59'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1daf('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1daf('0x15')](0x5)[_0x1daf('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1daf('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a320659..a780d84 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 _0xafc4=['user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','lastName','dialActive','VoiceQueue','CmHopper','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','inbound','lower','col','desc','asc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','offline','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','toString','moment','util','lodash','squel','jayson/promise','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','map','includes','find','value','UserProfileResource','end','stack','name','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','includeAll','include','attributes','push','rows','query','openTabs','true','length','chat','sms','dataValues','fax','mail','all','params','model','differenceBy','keys','filters','intersection','fields','merge','options','openchannel','body','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','102','110','104','105','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','voice','online','format','SIP/%s','UserVoiceQueueRt','removeQueues','Unknown\x20channel','remove','Queues','isArray','Queue:remove','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','server/files/images/','download','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','order','sort','pick','getContacts','hasOwnProperty','CmList','Tag','Tags','color','tag','nolimit','Queue','Unknown\x20role','findAll','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','%s%s','getTeams','Team','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','removeAgent','VoicePrefixId','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions'];(function(_0x1e69dc,_0x6e895e){var _0x45e3e8=function(_0x4a05ab){while(--_0x4a05ab){_0x1e69dc['push'](_0x1e69dc['shift']());}};_0x45e3e8(++_0x6e895e);}(_0xafc4,0x69));var _0x4afc=function(_0x4c12be,_0x4c2479){_0x4c12be=_0x4c12be-0x0;var _0x13f9ac=_0xafc4[_0x4c12be];return _0x13f9ac;};'use strict';var moment=require(_0x4afc('0x0'));var BPromise=require('bluebird');var util=require(_0x4afc('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x4afc('0x2'));var squel=require(_0x4afc('0x3'));var jayson=require(_0x4afc('0x4'));var Redis=require(_0x4afc('0x5'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4afc('0x6'));var utils=require(_0x4afc('0x7'));var config=require(_0x4afc('0x8'));var licenseUtil=require(_0x4afc('0x9'));var db=require(_0x4afc('0xa'))['db'];var socket=require(_0x4afc('0xb'))(new Redis(config['redis']));require(_0x4afc('0xc'))[_0x4afc('0xd')](socket);config[_0x4afc('0xe')]=_[_0x4afc('0xf')](config[_0x4afc('0xe')],{'host':_0x4afc('0x10'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x7f127f,_0x49222e,_0x281230,_0x225793){return new BPromise(function(_0x49b56f,_0x38b322){var _0x3fb54a=_0x225793||client;return _0x3fb54a[_0x4afc('0x11')](_0x7f127f,_0x281230)[_0x4afc('0x12')](function(_0x1d8f98){logger[_0x4afc('0x13')](_0x4afc('0x14'),_0x49222e,_0x4afc('0x15'));logger['debug'](_0x4afc('0x16'),_0x49222e,_0x4afc('0x15'),JSON[_0x4afc('0x17')](_0x1d8f98));if(_0x1d8f98[_0x4afc('0x18')]){if(_0x1d8f98['error']['code']===0x1f4){logger[_0x4afc('0x18')]('User,\x20%s,\x20%s',_0x49222e,_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);return _0x38b322(_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);}logger[_0x4afc('0x18')](_0x4afc('0x14'),_0x49222e,_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);return _0x49b56f(_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);}else{logger[_0x4afc('0x13')]('User,\x20%s,\x20%s',_0x49222e,_0x4afc('0x15'));_0x49b56f(_0x1d8f98[_0x4afc('0x1a')][_0x4afc('0x19')]);}})[_0x4afc('0x1b')](function(_0x557a7e){logger[_0x4afc('0x18')](_0x4afc('0x14'),_0x49222e,_0x557a7e);_0x38b322(_0x557a7e);});});}function respondWithStatusCode(_0x2de6e9,_0x280587){_0x280587=_0x280587||0xcc;return function(_0x1559b8){if(_0x1559b8){return _0x2de6e9[_0x4afc('0x1c')](_0x280587);}return _0x2de6e9[_0x4afc('0x1d')](_0x280587)['end']();};}function respondWithResult(_0x5403e4,_0x3ecf2d){_0x3ecf2d=_0x3ecf2d||0xc8;return function(_0x57f37c){if(_0x57f37c){return _0x5403e4[_0x4afc('0x1d')](_0x3ecf2d)['json'](_0x57f37c);}};}function respondWithFilteredResult(_0x1aa676,_0x2a0314){return function(_0x1e454e){if(_0x1e454e){var _0x2876f2=typeof _0x2a0314[_0x4afc('0x1e')]===_0x4afc('0x1f')&&typeof _0x2a0314[_0x4afc('0x20')]===_0x4afc('0x1f');var _0x2bb837=_0x1e454e[_0x4afc('0x21')];var _0x4e8273=_0x2876f2?0x0:_0x2a0314[_0x4afc('0x1e')];var _0x35f5b3=_0x2876f2?_0x1e454e['count']:_0x2a0314[_0x4afc('0x1e')]+_0x2a0314[_0x4afc('0x20')];var _0x2d6112;if(_0x35f5b3>=_0x2bb837){_0x35f5b3=_0x2bb837;_0x2d6112=0xc8;}else{_0x2d6112=0xce;}_0x1aa676['status'](_0x2d6112);return _0x1aa676['set']('Content-Range',_0x4e8273+'-'+_0x35f5b3+'/'+_0x2bb837)[_0x4afc('0x22')](_0x1e454e);}return null;};}function saveUpdates(_0x5db47e){return function(_0x5e4747){if(_0x5e4747){return _0x5e4747[_0x4afc('0x23')](_0x5db47e)[_0x4afc('0x12')](function(_0x494fe7){return _0x494fe7;});}return null;};}function removeEntity(_0x514278){return function(_0x52e3dd){if(_0x52e3dd){return _0x52e3dd[_0x4afc('0x24')]()[_0x4afc('0x12')](function(){var _0x17a43d=_0x52e3dd[_0x4afc('0x25')]({'plain':!![]});if(_0x17a43d[_0x4afc('0x26')]===_0x4afc('0x27'))return;var _0x566389=[{'name':_0x4afc('0x28'),'value':_0x4afc('0x29'),'ignore':!![]},{'name':_0x4afc('0x2a'),'value':_0x4afc('0x2b'),'ignore':![]},{'name':_0x4afc('0x2c'),'value':_0x4afc('0x2d'),'ignore':![]}];var _0xbabe1e=_(_0x566389)[_0x4afc('0x2e')]('ignore')[_0x4afc('0x2f')]('value')['value']();if(_[_0x4afc('0x30')](_0xbabe1e,_0x17a43d[_0x4afc('0x26')])){return;}var _0x266f7f=_[_0x4afc('0x31')](_0x566389,[_0x4afc('0x32'),_0x17a43d[_0x4afc('0x26')]])['name'];return db[_0x4afc('0x33')][_0x4afc('0x24')]({'where':{'type':_0x266f7f,'resourceId':_0x17a43d['id']}})[_0x4afc('0x12')](function(){return _0x52e3dd;});})[_0x4afc('0x12')](function(){_0x514278[_0x4afc('0x1d')](0xcc)[_0x4afc('0x34')]();});}};}function handleEntityNotFound(_0x48f0c6){return function(_0x22eea2){if(!_0x22eea2){_0x48f0c6[_0x4afc('0x1c')](0x194);}return _0x22eea2;};}function handleError(_0x91565d,_0x283bc2){_0x283bc2=_0x283bc2||0x1f4;return function(_0x499464){logger['error'](_0x499464[_0x4afc('0x35')]);if(_0x499464[_0x4afc('0x36')]){delete _0x499464[_0x4afc('0x36')];}_0x91565d['status'](_0x283bc2)['send'](_0x499464);};}exports[_0x4afc('0x37')]=function(_0x4a06cf,_0x5947bb){var _0x295b53={},_0x1dc853={'count':0x0,'rows':[]};var _0x2be40e=_(db[_0x4afc('0x38')][_0x4afc('0x39')])[_0x4afc('0x2f')](function(_0x453e12){return{'name':_0x453e12[_0x4afc('0x3a')],'type':_0x453e12[_0x4afc('0x3b')][_0x4afc('0x3c')]};})[_0x4afc('0x2e')](function(_0x3ef2aa){return!_[_0x4afc('0x30')]([_0x4afc('0x3d'),_0x4afc('0x3e')],_0x3ef2aa['name']);})[_0x4afc('0x32')]();_0x295b53=qs[_0x4afc('0x3f')](_0x2be40e,_0x4a06cf);var _0x4357a6={'where':_0x295b53[_0x4afc('0x40')]};return db[_0x4afc('0x38')][_0x4afc('0x21')](_0x4357a6)[_0x4afc('0x12')](function(_0x50d53f){_0x1dc853['count']=_0x50d53f;if(_0x4a06cf['query'][_0x4afc('0x41')]){_0x295b53[_0x4afc('0x42')]=[{'all':!![]}];}if(!_['includes'](_0x295b53[_0x4afc('0x43')],'id')){_0x295b53[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')]['findAll'](_0x295b53);})[_0x4afc('0x12')](function(_0x45c9c3){_0x1dc853[_0x4afc('0x45')]=_0x45c9c3;if(_0x4a06cf[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){var _0x51dca0=[];for(var _0x1e6f95=0x0;_0x1e6f95<_0x1dc853['rows'][_0x4afc('0x49')];_0x1e6f95++){_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x1dc853['rows'][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0['push'](get_open_tabs(_0x4afc('0x4e'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs('openchannel',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs('whatsapp',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));}return BPromise[_0x4afc('0x4f')](_0x51dca0)[_0x4afc('0x12')](function(_0x4772db){return _0x1dc853;});}else{return _0x1dc853;}})[_0x4afc('0x12')](respondWithFilteredResult(_0x5947bb,_0x295b53))['catch'](handleError(_0x5947bb,null));};exports['show']=function(_0x4f4e46,_0x32f3b9){var _0x1c5661={'raw':![],'where':{'id':_0x4f4e46[_0x4afc('0x50')]['id']}},_0x42e274={};_0x42e274[_0x4afc('0x51')]=_[_0x4afc('0x52')](_[_0x4afc('0x53')](db[_0x4afc('0x38')][_0x4afc('0x39')]),[_0x4afc('0x3d'),'salt']);_0x42e274[_0x4afc('0x46')]=_['keys'](_0x4f4e46['query']);_0x42e274[_0x4afc('0x54')]=_['intersection'](_0x42e274[_0x4afc('0x51')],_0x42e274[_0x4afc('0x46')]);_0x1c5661[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x42e274['model'],qs[_0x4afc('0x56')](_0x4f4e46['query'][_0x4afc('0x56')]));_0x1c5661[_0x4afc('0x43')]=_0x1c5661[_0x4afc('0x43')][_0x4afc('0x49')]?_0x1c5661[_0x4afc('0x43')]:_0x42e274[_0x4afc('0x51')];if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x41')]){_0x1c5661[_0x4afc('0x42')]=[{'all':!![]}];}_0x1c5661=_[_0x4afc('0x57')]({},_0x1c5661,_0x4f4e46[_0x4afc('0x58')]);if(!_[_0x4afc('0x30')](_0x1c5661['attributes'],'id')){_0x1c5661[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')][_0x4afc('0x31')](_0x1c5661)[_0x4afc('0x12')](handleEntityNotFound(_0x32f3b9,null))[_0x4afc('0x12')](function(_0x2fd538){var _0x10c254=[];values=_0x2fd538;if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x2fd538['dataValues']));_0x10c254[_0x4afc('0x44')](get_open_tabs('sms',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x59'),_0x2fd538[_0x4afc('0x4c')]));_0x10c254['push'](get_open_tabs('whatsapp',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs('fax',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x2fd538[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x10c254);}else{return values;}})[_0x4afc('0x12')](function(_0x154797){return values;})[_0x4afc('0x12')](respondWithResult(_0x32f3b9,null))[_0x4afc('0x1b')](handleError(_0x32f3b9,null));};exports[_0x4afc('0x23')]=function(_0x4295a5,_0x1a4d15){if(_0x4295a5[_0x4afc('0x5a')]['id']){delete _0x4295a5[_0x4afc('0x5a')]['id'];}delete _0x4295a5['body'][_0x4afc('0x26')];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4295a5[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1a4d15,null))[_0x4afc('0x12')](saveUpdates(_0x4295a5[_0x4afc('0x5a')],null))['then'](respondWithResult(_0x1a4d15,null))[_0x4afc('0x1b')](handleError(_0x1a4d15,null));};exports[_0x4afc('0x5b')]=function(_0x543dce,_0x4b3439){return db[_0x4afc('0x38')][_0x4afc('0x5b')]()[_0x4afc('0x12')](respondWithResult(_0x4b3439,null))[_0x4afc('0x1b')](handleError(_0x4b3439,null));};exports[_0x4afc('0x5c')]=function(_0x193850,_0x37cfa6){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x193850[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x37cfa6,null))['then'](function(_0x458533){if(_0x458533){return _0x458533[_0x4afc('0x5c')](_0x193850['body'][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x193850['body'],['ids','id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x37cfa6,null))[_0x4afc('0x1b')](handleError(_0x37cfa6,null));};function validateUser(_0x576ea0){return new BPromise(function(_0x53792a,_0x3875f8){if(_0x576ea0['internal'])return _0x53792a(_0x576ea0);return db['Setting'][_0x4afc('0x5f')](0x1)[_0x4afc('0x12')](function(_0x53f9ca){if(_0x53f9ca[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x576ea0[_0x4afc('0x3d')]);db[_0x4afc('0x38')][_0x4afc('0x62')](_0x4afc('0x63'))['then'](function(_0x25969c){if(_[_0x4afc('0x64')](_0x25969c)){_0x576ea0[_0x4afc('0x63')]=_0x53f9ca['min_internal']||0x1;return;}if(_['isNil'](_0x53f9ca['min_internal'])||_0x53f9ca[_0x4afc('0x65')]===_0x25969c){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;return;}if(_0x53f9ca[_0x4afc('0x65')]>_0x25969c){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x4afc('0x66')][_0x4afc('0x67')][_0x4afc('0x68')]})['then'](function(_0x1e56b7){if(_0x1e56b7&&_0x1e56b7[_0x4afc('0x49')]){for(var _0x18ab12=0x0,_0x5e3e9b=_0x1e56b7[_0x4afc('0x49')];_0x18ab12<_0x5e3e9b&&_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')]);_0x18ab12++){if(_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12][_0x4afc('0x69')]){_0x576ea0['internal']=_0x1e56b7[_0x18ab12]['from'];}else if(_0x53f9ca[_0x4afc('0x65')]>_0x1e56b7[_0x18ab12][_0x4afc('0x69')]&&_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12]['to']){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];}}}if(_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')])){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;}return _0x53792a(_0x576ea0);});});})[_0x4afc('0x1b')](function(_0x4bc6e5){_0x3875f8(_0x4bc6e5);});});}function updateUser(_0x1ef397){return new BPromise(function(_0x8ba1da,_0x517efb){try{if(_0x1ef397[_0x4afc('0x6a')]){_0x1ef397[_0x4afc('0x6b')]=_0x1ef397[_0x4afc('0x63')];_0x1ef397['VoiceMail']={'mailbox':_0x1ef397[_0x4afc('0x63')],'password':_0x1ef397[_0x4afc('0x3d')],'fullname':_0x1ef397[_0x4afc('0x6c')],'email':_0x1ef397[_0x4afc('0x6d')]};}if(_0x1ef397[_0x4afc('0x26')]===_0x4afc('0x2b')){if(!_0x1ef397[_0x4afc('0x6e')])_0x1ef397[_0x4afc('0x6e')]=['101',_0x4afc('0x6f'),'103','113',_0x4afc('0x70'),_0x4afc('0x71'),_0x4afc('0x72'),'106','107',_0x4afc('0x73'),_0x4afc('0x74'),_0x4afc('0x75'),_0x4afc('0x76'),_0x4afc('0x77'),_0x4afc('0x78')];}_0x8ba1da(_0x1ef397);}catch(_0x4701ca){_0x517efb(_0x4701ca);}});}exports[_0x4afc('0x79')]=function(_0x5fd3e1,_0x396cb5){if(_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x2b'))throw new Error(_0x4afc('0x7a'));if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]==='user'&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x27')&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!=='admin'){throw new Error(_0x4afc('0x7c'));}return licenseUtil[_0x4afc('0x7d')]([_0x5fd3e1[_0x4afc('0x5a')]])[_0x4afc('0x12')](function(){return validateUser(_0x5fd3e1['body']);})[_0x4afc('0x12')](function(_0x56b862){return updateUser(_0x56b862)[_0x4afc('0x12')](function(_0x4956b2){if(_0x4956b2[_0x4afc('0x26')]===_0x4afc('0x27')){_0x4956b2[_0x4afc('0x7e')]=_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x7e')];delete _0x4956b2[_0x4afc('0x7f')];}return _0x4956b2;});})['then'](function(_0xbbcbf4){return db[_0x4afc('0x38')]['create'](_0xbbcbf4,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]});})[_0x4afc('0x12')](function(_0x4affde){if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x29'))return _0x4affde;if(_0x5fd3e1[_0x4afc('0x29')]['role']!==_0x4afc('0x29'))return _0x4affde;return db[_0x4afc('0x81')]['find']({'where':{'name':_0x4affde[_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):'Telephones','userProfileId':_0x5fd3e1['user'][_0x4afc('0x7f')]},'raw':!![]})[_0x4afc('0x12')](function(_0x1c0483){if(!_0x1c0483||_0x1c0483[_0x4afc('0x82')]!=0x0)return _0x4affde;return db[_0x4afc('0x33')][_0x4afc('0x79')]({'name':_0x4affde[_0x4afc('0x36')],'resourceId':_0x4affde['id'],'type':_0x1c0483[_0x4afc('0x36')],'sectionId':_0x1c0483['id']},{})[_0x4afc('0x12')](function(){return _0x4affde;});})[_0x4afc('0x1b')](function(_0x32a7a3){logger[_0x4afc('0x18')](_0x4afc('0x83'),_0x32a7a3);throw _0x32a7a3;});})[_0x4afc('0x12')](respondWithResult(_0x396cb5,0xc9))[_0x4afc('0x1b')](handleError(_0x396cb5,null));};exports[_0x4afc('0x84')]=function(_0x5d0ae9,_0x165a35){var _0x105ab7=_0x5d0ae9['body'];var _0xd8f88a=[];if(_0x5d0ae9['user']['role']===_0x4afc('0x2b'))throw new Error('Unauthorized');if(_['some'](_0x105ab7,[_0x4afc('0x26'),'user'])&&_0x5d0ae9[_0x4afc('0x29')]['role']!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_[_0x4afc('0x85')](_0x105ab7,[_0x4afc('0x26'),_0x4afc('0x27')])&&_0x5d0ae9['user'][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x105ab7)[_0x4afc('0x12')](function(){return validateUser(_0x105ab7[0x0]);})[_0x4afc('0x12')](function(){for(var _0x373e9c=0x1;_0x373e9c<_0x105ab7[_0x4afc('0x49')];_0x373e9c++){var _0x4596ed=_0x105ab7[_0x373e9c-0x1]['internal'];if(!_0x105ab7[_0x373e9c][_0x4afc('0x63')])_0x105ab7[_0x373e9c][_0x4afc('0x63')]=_0x4596ed+0x1;_0xd8f88a[_0x4afc('0x44')](validateUser(_0x105ab7[_0x373e9c]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})['then'](function(){_0xd8f88a=[];for(var _0x114e0f=0x0;_0x114e0f<_0x105ab7['length'];_0x114e0f++){_0xd8f88a[_0x4afc('0x44')](updateUser(_0x105ab7[_0x114e0f]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})[_0x4afc('0x12')](function(){return BPromise[_0x4afc('0x86')](_0x105ab7,function(_0xa580ad){return db[_0x4afc('0x38')][_0x4afc('0x79')](_0xa580ad,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]})[_0x4afc('0x12')](function(_0x27dd60){_0xa580ad['id']=_0x27dd60['id'];return _0xa580ad;});});})['then'](function(_0x26a924){if(_0x5d0ae9['body'][_0x4afc('0x26')]==='user')return _0x26a924;if(_0x5d0ae9['user'][_0x4afc('0x26')]!=='user')return _0x26a924;var _0x512f92=_[_0x4afc('0x85')](_0x26a924,function(_0x489c9d){return _0x489c9d[_0x4afc('0x26')]===_0x4afc('0x2b')||_0x489c9d['role']===_0x4afc('0x2d');});if(!_0x512f92)return _0x26a924;return db[_0x4afc('0x81')]['findAll']({'where':{'name':{'$or':[_0x4afc('0x2a'),_0x4afc('0x2c')]},'userProfileId':_0x5d0ae9[_0x4afc('0x29')]['userProfileId']},'raw':!![]})[_0x4afc('0x12')](function(_0x298c87){if(_[_0x4afc('0x87')](_0x298c87)||!_[_0x4afc('0x85')](_0x298c87,[_0x4afc('0x82'),0x0]))return _0x26a924;_0xd8f88a=[];var _0xbdeb7d=_(_0x298c87)['map'](function(_0x4daf24){if(_0x4daf24[_0x4afc('0x82')]===0x1)return;return _0x4daf24[_0x4afc('0x36')]==='Agents'?_0x4afc('0x2b'):_0x4afc('0x2d');})['compact']()[_0x4afc('0x32')]();for(var _0x102fd8=0x0;_0x102fd8<_0x26a924[_0x4afc('0x49')];_0x102fd8++){if(!_[_0x4afc('0x30')](_0xbdeb7d,_0x26a924[_0x102fd8][_0x4afc('0x26')]))return;var _0x4b1bbc=_0x26a924[_0x102fd8][_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):_0x4afc('0x2c');_0xd8f88a[_0x4afc('0x44')](db['UserProfileResource'][_0x4afc('0x79')]({'name':_0x26a924[_0x102fd8][_0x4afc('0x36')],'resourceId':_0x26a924[_0x102fd8]['id'],'type':_0x4b1bbc,'sectionId':_[_0x4afc('0x31')](_0x298c87,['name',_0x4b1bbc])['id']},{}));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);});})[_0x4afc('0x12')](respondWithResult(_0x165a35,0xc9))['catch'](handleError(_0x165a35,null));};exports['changePassword']=function(_0x4c27a2,_0x1119a9){if(_0x4c27a2[_0x4afc('0x5a')]['id']){delete _0x4c27a2['body']['id'];}return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4c27a2['params']['id']}})[_0x4afc('0x12')](function(_0x37a056){if(!_0x37a056)return null;if(_0x37a056['id']===_0x4c27a2[_0x4afc('0x29')]['id']){if(!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')]||!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x37a056[_0x4afc('0x8c')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')])){throw new db[(_0x4afc('0x8a'))]['ValidationError'](_0x4afc('0x8d'));}if(_0x4c27a2[_0x4afc('0x5a')]['oldPassword']===_0x4c27a2['body']['newPassword']){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8e'));}}else if(_0x4c27a2['user'][_0x4afc('0x26')]===_0x4afc('0x27')){if(!_0x4c27a2[_0x4afc('0x5a')]['newPassword']){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4c27a2[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x29')){if(!_0x4c27a2['body'][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8f'));}if(_0x37a056[_0x4afc('0x26')]!==_0x4afc('0x2b')){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x7a'));}}else{throw new db['Sequelize']['ValidationError'](_0x4afc('0x7a'));}return _0x37a056;})[_0x4afc('0x12')](handleEntityNotFound(_0x1119a9,null))[_0x4afc('0x12')](function(_0x2b3bbb){return db['Setting'][_0x4afc('0x90')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x4afc('0x12')](function(_0x449529){if(_0x449529[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]);if(!_0x449529[_0x4afc('0x91')]||!_0x2b3bbb[_0x4afc('0x92')])return _0x2b3bbb;authService[_0x4afc('0x93')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb[_0x4afc('0x92')],_0x449529[_0x4afc('0x94')]);return _0x2b3bbb;})['then'](saveUpdates({'password':_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],'passwordResetAt':_0x4c27a2[_0x4afc('0x29')]['id']==_0x4c27a2[_0x4afc('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb['previousPasswords'])},null));})[_0x4afc('0x12')](respondWithResult(_0x1119a9,null))[_0x4afc('0x1b')](handleError(_0x1119a9,null));};exports[_0x4afc('0x95')]=function(_0x46f5c1,_0x504eae){var _0x42f066=_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x96')];return db['User'][_0x4afc('0x31')]({'where':{'id':_0x46f5c1[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26'),'online',_0x4afc('0x97'),_0x4afc('0x98'),_0x4afc('0x99')]})[_0x4afc('0x12')](handleEntityNotFound(_0x504eae,null))[_0x4afc('0x12')](function(_0x2f5d0b){if(_0x2f5d0b){if(!utils[_0x4afc('0x9a')](_0x42f066)){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Unknown\x20channel');}return _0x2f5d0b[_0x4afc('0x9b')+_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+'Queues'](_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')],{'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0})[_0x4afc('0x9f')](function(_0x173149){for(var _0x5ca9fe=0x0;_0x5ca9fe<_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x5ca9fe+=0x1){var _0x53d197={'UserId':Number(_0x46f5c1[_0x4afc('0x50')]['id'])};_0x53d197[_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x5ca9fe]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x42f066['toLowerCase']())+_0x4afc('0xa2'),_0x53d197);}return _0x173149;})[_0x4afc('0x12')](function(){if(_0x42f066===_0x4afc('0xa3')){return db['VoiceQueue']['findAll']({'where':{'id':_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')]||[]},'raw':!![],'attributes':['id',_0x4afc('0x36')]});}})[_0x4afc('0x12')](function(_0xc8fba2){var _0x4118f3=_0x2f5d0b[_0x4afc('0x25')]({'plain':!![]});var _0x1cb863=[];if(_0x42f066===_0x4afc('0xa3')&&_0x4118f3['role']===_0x4afc('0x2b')&&_0x4118f3[_0x4afc('0xa4')]){for(var _0x456618=0x0;_0x456618<_0xc8fba2['length'];_0x456618+=0x1){_0x1cb863[_0x4afc('0x44')]({'membername':_0x4118f3[_0x4afc('0x36')],'UserId':_0x4118f3['id'],'queue_name':_0xc8fba2[_0x456618][_0x4afc('0x36')],'VoiceQueueId':_0xc8fba2[_0x456618]['id'],'interface':_['isNil'](_0x4118f3[_0x4afc('0x99')])?util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x4118f3[_0x4afc('0x36')]):_0x4118f3[_0x4afc('0x99')],'paused':_0x4118f3[_0x4afc('0x98')]||![],'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0});}return BPromise['each'](_0x1cb863,function(_0x5b721b){return db[_0x4afc('0xa7')]['upsert'](_0x5b721b);});}return _0x2f5d0b;});}})[_0x4afc('0x12')](respondWithStatusCode(_0x504eae,null))[_0x4afc('0x1b')](handleError(_0x504eae,null));};exports[_0x4afc('0xa8')]=function(_0x1191ac,_0x5bbeab){var _0x455a57;return db['User'][_0x4afc('0x31')]({'where':{'id':_0x1191ac[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26')]})[_0x4afc('0x12')](handleEntityNotFound(_0x5bbeab,null))[_0x4afc('0x12')](function(_0x205e1b){if(_0x205e1b){_0x455a57=_0x205e1b;if(!_0x1191ac['query'][_0x4afc('0x96')]||!utils['isValidChannel'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')])){throw new db['Sequelize'][(_0x4afc('0x8b'))](_0x4afc('0xa9'));}return _0x205e1b[_0x4afc('0xaa')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xab')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](function(_0x1fc5d8){if(_[_0x4afc('0xac')](_0x1191ac['query']['ids'])){for(var _0x1f0e12=0x0;_0x1f0e12<_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x1f0e12+=0x1){var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_['capitalize'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')]['ids'][_0x1f0e12]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}}else{var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')]['channel'][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}return _0x1fc5d8;})[_0x4afc('0x12')](function(){if(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]===_0x4afc('0xa3')){return db[_0x4afc('0xa7')]['destroy']({'where':{'UserId':_0x1191ac['params']['id'],'VoiceQueueId':_0x1191ac[_0x4afc('0x46')]['ids']},'individualHooks':!![]})[_0x4afc('0x12')](function(){return _0x455a57;});}return _0x455a57;})[_0x4afc('0x12')](respondWithStatusCode(_0x5bbeab,null))[_0x4afc('0x1b')](handleError(_0x5bbeab,null));};exports['addAvatar']=function(_0x75a628,_0x1ea1cb){_0x75a628[_0x4afc('0x5a')][_0x4afc('0xae')]=_0x75a628['file']['filename'];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x75a628[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ea1cb,null))[_0x4afc('0x12')](saveUpdates(_0x75a628['body'],null))[_0x4afc('0x12')](respondWithResult(_0x1ea1cb,null))['catch'](handleError(_0x1ea1cb,null));};exports[_0x4afc('0xaf')]=function(_0x54ea16,_0x1d79cd){var _0x4ba3a9=path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb2'));return db['User'][_0x4afc('0x31')]({'where':{'id':_0x54ea16['params']['id']},'attributes':['id',_0x4afc('0xae')],'raw':!![]})['then'](handleEntityNotFound(_0x1d79cd,null))[_0x4afc('0x12')](function(_0x2257f3){if(_0x2257f3){if(_['isNil'](_0x2257f3[_0x4afc('0xae')])){return _0x1d79cd['download'](_0x4ba3a9);}else{if(!fs['existsSync'](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3[_0x4afc('0xae')]))){return _0x1d79cd[_0x4afc('0xb4')](_0x4ba3a9);}return _0x1d79cd[_0x4afc('0xb4')](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3['userpic']));}}})[_0x4afc('0x1b')](handleError(_0x1d79cd,null));};exports[_0x4afc('0xb5')]=function(_0x280319,_0x1e6529){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x280319[_0x4afc('0x50')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1e6529,null))[_0x4afc('0x12')](function(_0x14c79c){var _0x4df52a=[];values=_0x14c79c[_0x4afc('0x4c')];_0x4df52a[_0x4afc('0x44')](get_open_tabs('chat',_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x14c79c['dataValues']));_0x4df52a['push'](get_open_tabs(_0x4afc('0x59'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0xb6'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x14c79c['dataValues']));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x14c79c[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x4df52a);})[_0x4afc('0x12')](function(_0x31f863){var _0x46f93b=[];if(_0x31f863){for(var _0x444586=0x0;_0x444586=_0x598aa4){_0xeff822=_0x598aa4;_0x2a20ed=0xc8;}else{_0x2a20ed=0xce;}_0x145771[_0xd187('0x21')](_0x2a20ed);return _0x145771['set'](_0xd187('0x25'),_0x4eac6a+'-'+_0xeff822+'/'+_0x598aa4)[_0xd187('0x26')](_0x1047f4);}return null;};}function saveUpdates(_0x34febe){return function(_0x4c50a5){if(_0x4c50a5){return _0x4c50a5[_0xd187('0x27')](_0x34febe)['then'](function(_0x263e31){return _0x263e31;});}return null;};}function removeEntity(_0x19e75f){return function(_0x1e7750){if(_0x1e7750){return _0x1e7750[_0xd187('0x28')]()['then'](function(){var _0x140e54=_0x1e7750[_0xd187('0x29')]({'plain':!![]});if(_0x140e54['role']==='admin')return;var _0x1a1922=[{'name':_0xd187('0x2a'),'value':_0xd187('0x2b'),'ignore':!![]},{'name':_0xd187('0x2c'),'value':_0xd187('0x2d'),'ignore':![]},{'name':_0xd187('0x2e'),'value':_0xd187('0x2f'),'ignore':![]}];var _0x4713df=_(_0x1a1922)['filter'](_0xd187('0x30'))[_0xd187('0x31')](_0xd187('0x32'))['value']();if(_[_0xd187('0x33')](_0x4713df,_0x140e54['role'])){return;}var _0xb3efa3=_[_0xd187('0x34')](_0x1a1922,[_0xd187('0x32'),_0x140e54['role']])['name'];return db[_0xd187('0x35')][_0xd187('0x28')]({'where':{'type':_0xb3efa3,'resourceId':_0x140e54['id']}})['then'](function(){return _0x1e7750;});})[_0xd187('0x16')](function(){_0x19e75f[_0xd187('0x21')](0xcc)[_0xd187('0x20')]();});}};}function handleEntityNotFound(_0x54abed){return function(_0x527c6f){if(!_0x527c6f){_0x54abed[_0xd187('0x36')](0x194);}return _0x527c6f;};}function handleError(_0xf32da2,_0x556146){_0x556146=_0x556146||0x1f4;return function(_0x51f5bf){logger['error'](_0x51f5bf[_0xd187('0x37')]);if(_0x51f5bf['name']){delete _0x51f5bf[_0xd187('0x38')];}_0xf32da2[_0xd187('0x21')](_0x556146)['send'](_0x51f5bf);};}exports[_0xd187('0x39')]=function(_0x5674ca,_0x293ce9){var _0x2db36e={},_0x4af59f={'count':0x0,'rows':[]};var _0x1a6256=_(db[_0xd187('0x3a')]['rawAttributes'])[_0xd187('0x31')](function(_0x5ec6cd){return{'name':_0x5ec6cd['fieldName'],'type':_0x5ec6cd[_0xd187('0x3b')][_0xd187('0x3c')]};})[_0xd187('0x3d')](function(_0x1a8f54){return!_[_0xd187('0x33')](['password',_0xd187('0x3e')],_0x1a8f54[_0xd187('0x38')]);})[_0xd187('0x32')]();_0x2db36e=qs['getOptions'](_0x1a6256,_0x5674ca);var _0x4b121c={'where':_0x2db36e['where']};return db['User'][_0xd187('0x24')](_0x4b121c)[_0xd187('0x16')](function(_0x3d74cc){_0x4af59f[_0xd187('0x24')]=_0x3d74cc;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x40')]){_0x2db36e[_0xd187('0x41')]=[{'all':!![]}];}if(!_[_0xd187('0x33')](_0x2db36e['attributes'],'id')){_0x2db36e[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')]['findAll'](_0x2db36e);})[_0xd187('0x16')](function(_0x48c100){_0x4af59f[_0xd187('0x44')]=_0x48c100;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x45')]===_0xd187('0x46')){var _0x3cea48=[];for(var _0x49c26e=0x0;_0x49c26e<_0x4af59f[_0xd187('0x44')][_0xd187('0x47')];_0x49c26e++){_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs('sms',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('fax',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('mail',_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4a'),_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4b'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));}return BPromise[_0xd187('0x4c')](_0x3cea48)[_0xd187('0x16')](function(_0x3ce4a1){return _0x4af59f;});}else{return _0x4af59f;}})[_0xd187('0x16')](respondWithFilteredResult(_0x293ce9,_0x2db36e))[_0xd187('0x1f')](handleError(_0x293ce9,null));};exports[_0xd187('0x4d')]=function(_0x3400a0,_0x4e4a32){var _0x368348={'raw':![],'where':{'id':_0x3400a0[_0xd187('0x4e')]['id']}},_0x2657be={};_0x2657be[_0xd187('0x4f')]=_[_0xd187('0x50')](_['keys'](db[_0xd187('0x3a')][_0xd187('0x51')]),['password',_0xd187('0x3e')]);_0x2657be[_0xd187('0x3f')]=_['keys'](_0x3400a0['query']);_0x2657be['filters']=_['intersection'](_0x2657be[_0xd187('0x4f')],_0x2657be[_0xd187('0x3f')]);_0x368348[_0xd187('0x42')]=_[_0xd187('0x52')](_0x2657be[_0xd187('0x4f')],qs[_0xd187('0x53')](_0x3400a0[_0xd187('0x3f')]['fields']));_0x368348[_0xd187('0x42')]=_0x368348[_0xd187('0x42')][_0xd187('0x47')]?_0x368348[_0xd187('0x42')]:_0x2657be['model'];if(_0x3400a0[_0xd187('0x3f')]['includeAll']){_0x368348['include']=[{'all':!![]}];}_0x368348=_[_0xd187('0x54')]({},_0x368348,_0x3400a0['options']);if(!_[_0xd187('0x33')](_0x368348[_0xd187('0x42')],'id')){_0x368348[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')][_0xd187('0x34')](_0x368348)[_0xd187('0x16')](handleEntityNotFound(_0x4e4a32,null))[_0xd187('0x16')](function(_0x1649a2){var _0x55e954=[];values=_0x1649a2;if(_0x3400a0[_0xd187('0x3f')][_0xd187('0x45')]==='true'){_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x55'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4a'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4b'),_0x1649a2['dataValues']));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x56'),_0x1649a2[_0xd187('0x49')]));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x57'),_0x1649a2[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x55e954);}else{return values;}})['then'](function(_0xcef6ca){return values;})[_0xd187('0x16')](respondWithResult(_0x4e4a32,null))[_0xd187('0x1f')](handleError(_0x4e4a32,null));};exports['update']=function(_0x374e30,_0x23428f){if(_0x374e30[_0xd187('0x58')]['id']){delete _0x374e30[_0xd187('0x58')]['id'];}delete _0x374e30[_0xd187('0x58')][_0xd187('0x59')];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x374e30[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x23428f,null))[_0xd187('0x16')](saveUpdates(_0x374e30[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x23428f,null))[_0xd187('0x1f')](handleError(_0x23428f,null));};exports[_0xd187('0x5a')]=function(_0xaff1e6,_0x42fb32){return db[_0xd187('0x3a')][_0xd187('0x5a')]()[_0xd187('0x16')](respondWithResult(_0x42fb32,null))['catch'](handleError(_0x42fb32,null));};exports[_0xd187('0x5b')]=function(_0x48c82d,_0x13d118){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x48c82d[_0xd187('0x4e')]['id']}})['then'](handleEntityNotFound(_0x13d118,null))[_0xd187('0x16')](function(_0x2eda30){if(_0x2eda30){return _0x2eda30['addContacts'](_0x48c82d['body'][_0xd187('0x5c')],_[_0xd187('0x5d')](_0x48c82d[_0xd187('0x58')],[_0xd187('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x13d118,null))[_0xd187('0x1f')](handleError(_0x13d118,null));};function validateUser(_0x49543f){return new BPromise(function(_0x1971b2,_0x2f6a72){if(_0x49543f[_0xd187('0x5e')])return _0x1971b2(_0x49543f);return db[_0xd187('0x5f')]['findById'](0x1)[_0xd187('0x16')](function(_0xaea7e0){if(_0xaea7e0[_0xd187('0x60')])authService[_0xd187('0x61')](_0x49543f[_0xd187('0x62')]);db['User']['max'](_0xd187('0x5e'))[_0xd187('0x16')](function(_0x167eaf){if(_[_0xd187('0x63')](_0x167eaf)){_0x49543f[_0xd187('0x5e')]=_0xaea7e0[_0xd187('0x64')]||0x1;return;}if(_[_0xd187('0x63')](_0xaea7e0[_0xd187('0x64')])||_0xaea7e0[_0xd187('0x64')]===_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0x167eaf+0x1;return;}if(_0xaea7e0[_0xd187('0x64')]>_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];return;}return db[_0xd187('0x65')][_0xd187('0x3f')]('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[_0xd187('0x65')][_0xd187('0x66')]['SELECT']})['then'](function(_0x32ba2a){if(_0x32ba2a&&_0x32ba2a[_0xd187('0x47')]){for(var _0x2ac56f=0x0,_0x2f743b=_0x32ba2a['length'];_0x2ac56f<_0x2f743b&&_[_0xd187('0x63')](_0x49543f[_0xd187('0x5e')]);_0x2ac56f++){if(_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['from']){_0x49543f[_0xd187('0x5e')]=_0x32ba2a[_0x2ac56f]['from'];}else if(_0xaea7e0[_0xd187('0x64')]>_0x32ba2a[_0x2ac56f][_0xd187('0x67')]&&_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['to']){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];}}}if(_[_0xd187('0x63')](_0x49543f['internal'])){_0x49543f['internal']=_0x167eaf+0x1;}return _0x1971b2(_0x49543f);});});})['catch'](function(_0x16d9ea){_0x2f6a72(_0x16d9ea);});});}function updateUser(_0x243063){return new BPromise(function(_0x421585,_0x216829){try{if(_0x243063[_0xd187('0x68')]){_0x243063[_0xd187('0x69')]=_0x243063[_0xd187('0x5e')];_0x243063[_0xd187('0x6a')]={'mailbox':_0x243063['internal'],'password':_0x243063[_0xd187('0x62')],'fullname':_0x243063[_0xd187('0x6b')],'email':_0x243063[_0xd187('0x6c')]};}if(_0x243063['role']===_0xd187('0x2d')){if(!_0x243063[_0xd187('0x6d')])_0x243063[_0xd187('0x6d')]=[_0xd187('0x6e'),'102',_0xd187('0x6f'),_0xd187('0x70'),'110',_0xd187('0x71'),_0xd187('0x72'),_0xd187('0x73'),_0xd187('0x74'),'108',_0xd187('0x75'),_0xd187('0x76'),'111',_0xd187('0x77'),'115'];}_0x421585(_0x243063);}catch(_0x47c27c){_0x216829(_0x47c27c);}});}exports['create']=function(_0x7cbbac,_0x28472d){if(_0x7cbbac[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_0x7cbbac['body'][_0xd187('0x59')]===_0xd187('0x2b')&&_0x7cbbac['user']['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7a'));}if(_0x7cbbac[_0xd187('0x58')][_0xd187('0x59')]===_0xd187('0x79')&&_0x7cbbac[_0xd187('0x2b')]['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7b'));}return licenseUtil[_0xd187('0x7c')]([_0x7cbbac[_0xd187('0x58')]])[_0xd187('0x16')](function(){return validateUser(_0x7cbbac[_0xd187('0x58')]);})[_0xd187('0x16')](function(_0x1e58d4){return updateUser(_0x1e58d4)[_0xd187('0x16')](function(_0xf31fac){if(_0xf31fac[_0xd187('0x59')]===_0xd187('0x79')){_0xf31fac['settingsEnabled']=_0x7cbbac['user'][_0xd187('0x7d')];delete _0xf31fac[_0xd187('0x7e')];}return _0xf31fac;});})[_0xd187('0x16')](function(_0x147c96){return db[_0xd187('0x3a')][_0xd187('0x7f')](_0x147c96,{'include':[{'model':db['VoiceMail'],'as':_0xd187('0x6a')}]});})['then'](function(_0x2b2df3){if(_0x7cbbac['body']['role']===_0xd187('0x2b'))return _0x2b2df3;if(_0x7cbbac['user'][_0xd187('0x59')]!==_0xd187('0x2b'))return _0x2b2df3;return db[_0xd187('0x80')][_0xd187('0x34')]({'where':{'name':_0x2b2df3[_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e'),'userProfileId':_0x7cbbac[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x3ae931){if(!_0x3ae931||_0x3ae931[_0xd187('0x81')]!=0x0)return _0x2b2df3;return db[_0xd187('0x35')][_0xd187('0x7f')]({'name':_0x2b2df3['name'],'resourceId':_0x2b2df3['id'],'type':_0x3ae931[_0xd187('0x38')],'sectionId':_0x3ae931['id']},{})[_0xd187('0x16')](function(){return _0x2b2df3;});})[_0xd187('0x1f')](function(_0x43563b){logger['error'](_0xd187('0x82'),_0x43563b);throw _0x43563b;});})[_0xd187('0x16')](respondWithResult(_0x28472d,0xc9))['catch'](handleError(_0x28472d,null));};exports['bulkCreate']=function(_0x20b680,_0x3c993a){var _0x7fdb14=_0x20b680[_0xd187('0x58')];var _0x371869=[];if(_0x20b680[_0xd187('0x2b')]['role']===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_['some'](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x2b')])&&_0x20b680[_0xd187('0x2b')][_0xd187('0x59')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd187('0x83')](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x79')])&&_0x20b680['user'][_0xd187('0x59')]!==_0xd187('0x79')){throw new Error(_0xd187('0x84'));}return licenseUtil[_0xd187('0x7c')](_0x7fdb14)['then'](function(){return validateUser(_0x7fdb14[0x0]);})[_0xd187('0x16')](function(){for(var _0x4efb9f=0x1;_0x4efb9f<_0x7fdb14['length'];_0x4efb9f++){var _0x4a9310=_0x7fdb14[_0x4efb9f-0x1]['internal'];if(!_0x7fdb14[_0x4efb9f]['internal'])_0x7fdb14[_0x4efb9f]['internal']=_0x4a9310+0x1;_0x371869['push'](validateUser(_0x7fdb14[_0x4efb9f]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){_0x371869=[];for(var _0x4c5879=0x0;_0x4c5879<_0x7fdb14[_0xd187('0x47')];_0x4c5879++){_0x371869[_0xd187('0x43')](updateUser(_0x7fdb14[_0x4c5879]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){return BPromise[_0xd187('0x85')](_0x7fdb14,function(_0x4a1189){return db[_0xd187('0x3a')]['create'](_0x4a1189,{'include':[{'model':db[_0xd187('0x6a')],'as':_0xd187('0x6a')}]})[_0xd187('0x16')](function(_0x36e6ae){_0x4a1189['id']=_0x36e6ae['id'];return _0x4a1189;});});})[_0xd187('0x16')](function(_0x18690e){if(_0x20b680[_0xd187('0x58')]['role']===_0xd187('0x2b'))return _0x18690e;if(_0x20b680[_0xd187('0x2b')]['role']!==_0xd187('0x2b'))return _0x18690e;var _0x3720f1=_['some'](_0x18690e,function(_0x348b73){return _0x348b73[_0xd187('0x59')]===_0xd187('0x2d')||_0x348b73[_0xd187('0x59')]===_0xd187('0x2f');});if(!_0x3720f1)return _0x18690e;return db[_0xd187('0x80')][_0xd187('0x86')]({'where':{'name':{'$or':[_0xd187('0x2c'),'Telephones']},'userProfileId':_0x20b680[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x44ac47){if(_[_0xd187('0x87')](_0x44ac47)||!_[_0xd187('0x83')](_0x44ac47,['autoAssociation',0x0]))return _0x18690e;_0x371869=[];var _0x4fcf43=_(_0x44ac47)[_0xd187('0x31')](function(_0x3c9248){if(_0x3c9248['autoAssociation']===0x1)return;return _0x3c9248[_0xd187('0x38')]===_0xd187('0x2c')?_0xd187('0x2d'):_0xd187('0x2f');})[_0xd187('0x88')]()[_0xd187('0x32')]();for(var _0x578de9=0x0;_0x578de9<_0x18690e[_0xd187('0x47')];_0x578de9++){if(!_[_0xd187('0x33')](_0x4fcf43,_0x18690e[_0x578de9][_0xd187('0x59')]))return;var _0x23e30b=_0x18690e[_0x578de9][_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e');_0x371869[_0xd187('0x43')](db['UserProfileResource'][_0xd187('0x7f')]({'name':_0x18690e[_0x578de9][_0xd187('0x38')],'resourceId':_0x18690e[_0x578de9]['id'],'type':_0x23e30b,'sectionId':_[_0xd187('0x34')](_0x44ac47,['name',_0x23e30b])['id']},{}));}return BPromise[_0xd187('0x4c')](_0x371869);});})[_0xd187('0x16')](respondWithResult(_0x3c993a,0xc9))[_0xd187('0x1f')](handleError(_0x3c993a,null));};exports[_0xd187('0x89')]=function(_0x1e0e80,_0xec0779){if(_0x1e0e80['body']['id']){delete _0x1e0e80[_0xd187('0x58')]['id'];}return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1e0e80['params']['id']}})[_0xd187('0x16')](function(_0xd39f2a){if(!_0xd39f2a)return null;if(_0xd39f2a['id']===_0x1e0e80[_0xd187('0x2b')]['id']){if(!_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]||!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xd39f2a[_0xd187('0x8d')](_0x1e0e80[_0xd187('0x58')]['oldPassword'])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Wrong\x20credentials');}if(_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]===_0x1e0e80['body'][_0xd187('0x8e')]){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x8f'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x79')){if(!_0x1e0e80['body']['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2b')){if(!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}if(_0xd39f2a[_0xd187('0x59')]!==_0xd187('0x2d')){throw new db[(_0xd187('0x8b'))]['ValidationError'](_0xd187('0x78'));}}else{throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x78'));}return _0xd39f2a;})[_0xd187('0x16')](handleEntityNotFound(_0xec0779,null))[_0xd187('0x16')](function(_0x1c6433){return db[_0xd187('0x5f')]['findOne']({'attributes':['id',_0xd187('0x60'),'enforcePasswordHistory',_0xd187('0x91')]})[_0xd187('0x16')](function(_0x4853a8){if(_0x4853a8[_0xd187('0x60')])authService[_0xd187('0x61')](_0x1e0e80['body'][_0xd187('0x8e')]);if(!_0x4853a8['enforcePasswordHistory']||!_0x1c6433[_0xd187('0x92')])return _0x1c6433;authService['validatePasswordHistory'](_0x1e0e80['body'][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')],_0x4853a8[_0xd187('0x91')]);return _0x1c6433;})[_0xd187('0x16')](saveUpdates({'password':_0x1e0e80['body'][_0xd187('0x8e')],'passwordResetAt':_0x1e0e80[_0xd187('0x2b')]['id']==_0x1e0e80[_0xd187('0x4e')]['id']?moment():null,'previousPasswords':authService[_0xd187('0x93')](_0x1e0e80[_0xd187('0x58')][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')])},null));})[_0xd187('0x16')](respondWithResult(_0xec0779,null))[_0xd187('0x1f')](handleError(_0xec0779,null));};exports[_0xd187('0x94')]=function(_0x52f520,_0x74f8d7){var _0x8c3b2a=_0x52f520[_0xd187('0x58')]['channel'];return db['User'][_0xd187('0x34')]({'where':{'id':_0x52f520[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0x38'),'role','online',_0xd187('0x95'),_0xd187('0x96'),'interface']})[_0xd187('0x16')](handleEntityNotFound(_0x74f8d7,null))[_0xd187('0x16')](function(_0x361f8b){if(_0x361f8b){if(!utils[_0xd187('0x97')](_0x8c3b2a)){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x361f8b[_0xd187('0x99')+_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9c')](_0x52f520[_0xd187('0x58')]['ids'],{'penalty':_0x52f520[_0xd187('0x58')]['penalty']||0x0})[_0xd187('0x9d')](function(_0x4f50a8){for(var _0x3a1101=0x0;_0x3a1101<_0x52f520['body'][_0xd187('0x5c')][_0xd187('0x47')];_0x3a1101+=0x1){var _0x388797={'UserId':Number(_0x52f520['params']['id'])};_0x388797[_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x52f520[_0xd187('0x58')][_0xd187('0x5c')][_0x3a1101]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x8c3b2a['toLowerCase']())+_0xd187('0xa0'),_0x388797);}return _0x4f50a8;})[_0xd187('0x16')](function(){if(_0x8c3b2a===_0xd187('0xa1')){return db['VoiceQueue'][_0xd187('0x86')]({'where':{'id':_0x52f520[_0xd187('0x58')][_0xd187('0x5c')]||[]},'raw':!![],'attributes':['id',_0xd187('0x38')]});}})[_0xd187('0x16')](function(_0x28bc14){var _0x2e4db4=_0x361f8b[_0xd187('0x29')]({'plain':!![]});var _0xbb4a68=[];if(_0x8c3b2a===_0xd187('0xa1')&&_0x2e4db4[_0xd187('0x59')]==='agent'&&_0x2e4db4[_0xd187('0xa2')]){for(var _0x7960ed=0x0;_0x7960ed<_0x28bc14[_0xd187('0x47')];_0x7960ed+=0x1){_0xbb4a68[_0xd187('0x43')]({'membername':_0x2e4db4['name'],'UserId':_0x2e4db4['id'],'queue_name':_0x28bc14[_0x7960ed][_0xd187('0x38')],'VoiceQueueId':_0x28bc14[_0x7960ed]['id'],'interface':_['isNil'](_0x2e4db4[_0xd187('0xa3')])?util[_0xd187('0xa4')](_0xd187('0xa5'),_0x2e4db4[_0xd187('0x38')]):_0x2e4db4[_0xd187('0xa3')],'paused':_0x2e4db4['voicePause']||![],'penalty':_0x52f520[_0xd187('0x58')][_0xd187('0xa6')]||0x0});}return BPromise[_0xd187('0x85')](_0xbb4a68,function(_0x31c17b){return db[_0xd187('0xa7')]['upsert'](_0x31c17b);});}return _0x361f8b;});}})[_0xd187('0x16')](respondWithStatusCode(_0x74f8d7,null))[_0xd187('0x1f')](handleError(_0x74f8d7,null));};exports[_0xd187('0xa8')]=function(_0x4fce90,_0x4dcd41){var _0x38e2af;return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x4fce90[_0xd187('0x4e')]['id']},'attributes':['id','name',_0xd187('0x59')]})[_0xd187('0x16')](handleEntityNotFound(_0x4dcd41,null))[_0xd187('0x16')](function(_0x1721c2){if(_0x1721c2){_0x38e2af=_0x1721c2;if(!_0x4fce90['query'][_0xd187('0xa9')]||!utils['isValidChannel'](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x1721c2['remove'+_[_0xd187('0x9a')](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')][_0xd187('0x9b')]())+'Queues'](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]);}})[_0xd187('0x16')](function(_0x474a9f){if(_[_0xd187('0xaa')](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')])){for(var _0x12e3ca=0x0;_0x12e3ca<_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0xd187('0x47')];_0x12e3ca+=0x1){var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_['capitalize'](_0x4fce90[_0xd187('0x3f')]['channel'][_0xd187('0x9b')]())+'QueueId']=Number(_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0x12e3ca]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_['capitalize'](_0x4fce90['query'][_0xd187('0xa9')][_0xd187('0x9b')]())+_0xd187('0xab'),_0x943fc1);}}else{var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_[_0xd187('0x9a')](_0x4fce90['query']['channel'][_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x4fce90[_0xd187('0x3f')]['ids']);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x4fce90['query'][_0xd187('0xa9')]['toLowerCase']())+_0xd187('0xab'),_0x943fc1);}return _0x474a9f;})['then'](function(){if(_0x4fce90['query']['channel']===_0xd187('0xa1')){return db[_0xd187('0xa7')][_0xd187('0x28')]({'where':{'UserId':_0x4fce90[_0xd187('0x4e')]['id'],'VoiceQueueId':_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]},'individualHooks':!![]})['then'](function(){return _0x38e2af;});}return _0x38e2af;})[_0xd187('0x16')](respondWithStatusCode(_0x4dcd41,null))['catch'](handleError(_0x4dcd41,null));};exports[_0xd187('0xac')]=function(_0x3ee43e,_0x3c71f3){_0x3ee43e[_0xd187('0x58')][_0xd187('0xad')]=_0x3ee43e[_0xd187('0xae')]['filename'];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x3ee43e[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x3c71f3,null))['then'](saveUpdates(_0x3ee43e[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x3c71f3,null))['catch'](handleError(_0x3c71f3,null));};exports[_0xd187('0xaf')]=function(_0x305023,_0xc926a1){var _0x18c8e4=path['join'](config[_0xd187('0xb0')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x305023[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0xad')],'raw':!![]})[_0xd187('0x16')](handleEntityNotFound(_0xc926a1,null))[_0xd187('0x16')](function(_0x7d8eb5){if(_0x7d8eb5){if(_[_0xd187('0x63')](_0x7d8eb5[_0xd187('0xad')])){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}else{if(!fs['existsSync'](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']))){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}return _0xc926a1[_0xd187('0xb1')](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']));}}})[_0xd187('0x1f')](handleError(_0xc926a1,null));};exports[_0xd187('0xb4')]=function(_0x1ac714,_0x5ac21a){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1ac714[_0xd187('0x4e')]['id']},'attributes':['id']})[_0xd187('0x16')](handleEntityNotFound(_0x5ac21a,null))['then'](function(_0x476b70){var _0x3cf76c=[];values=_0x476b70[_0xd187('0x49')];_0x3cf76c[_0xd187('0x43')](get_open_tabs('chat',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('sms',_0x476b70[_0xd187('0x49')]));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4a'),_0x476b70['dataValues']));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4b'),_0x476b70['dataValues']));_0x3cf76c[_0xd187('0x43')](get_open_tabs('fax',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('mail',_0x476b70[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x3cf76c);})[_0xd187('0x16')](function(_0x450bf6){var _0x1751ee=[];if(_0x450bf6){for(var _0x17a1d6=0x0;_0x17a1d6=_0x2bbd8c[_0x0595('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x0595('0x22')](function(){if(_0x47ba5a){return db[_0x0595('0x2b')][_0x0595('0x4e')]({'where':{'membername':_0x47ba5a[_0x0595('0x28')]},'individualHooks':!![]});}})[_0x0595('0x22')](function(){if(_0x47ba5a){return _0x47ba5a[_0x0595('0x4f')]({'raw':!![]});}})[_0x0595('0x22')](function(_0x13f1b1){if(_0x47ba5a){if(_0x13f1b1){var _0x13198d=[];_0x42e2e4=_0x13f1b1;if(_0x42e2e4[_0x0595('0x31')]){for(var _0x501740=0x0;_0x501740<_0x42e2e4[_0x0595('0x31')];_0x501740++){_0x13198d[_0x0595('0x35')](db[_0x0595('0x2b')][_0x0595('0x50')]({'membername':_0x47ba5a['name'],'UserId':_0x47ba5a['id'],'queue_name':_0x42e2e4[_0x501740][_0x0595('0x28')],'VoiceQueueId':_0x42e2e4[_0x501740]['id'],'interface':_0x50cf31,'paused':_0x47ba5a['loginInPause']||![],'penalty':_0x42e2e4[_0x501740]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0595('0x4a')](_0x13198d);}}}})['then'](function(){if(_0x47ba5a){return db[_0x0595('0x2d')][_0x0595('0x1a')]({'where':{'membername':_0x47ba5a[_0x0595('0x28')],'exitAt':null}});}})[_0x0595('0x22')](function(_0x3a1fd7){if(_0x47ba5a){if(_0x3a1fd7&&_0x3a1fd7['length']){var _0x3c9186=[];_0x3a1fd7['forEach'](function(_0x39fd66){_0x3c9186[_0x0595('0x35')](_0x39fd66[_0x0595('0x2c')]({'exitAt':moment()[_0x0595('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0595('0x4a')](_0x3c9186);}}})[_0x0595('0x22')](function(_0x29ed5f){if(_0x47ba5a){var _0x119c3e=[];var _0x50ed48=[];var _0x4d73e6=utils[_0x0595('0x33')]();var _0x2b09d9={'membername':_0x47ba5a[_0x0595('0x28')],'interface':_0x50cf31,'enterAt':moment()[_0x0595('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x47ba5a['role'],'internal':_0x47ba5a[_0x0595('0x39')]};_0x4d73e6[_0x0595('0x34')](function(_0x4fcf31){_0x119c3e[_0x0595('0x35')](_[_0x0595('0x51')]({'channel':_0x4fcf31,'type':_0x0595('0x52'),'data1':_0x0595('0x53'),'data2':_0x50cf31},_0x2b09d9));if(_0x47ba5a[_0x0595('0x54')]){_0x50ed48['push'](_['merge']({'channel':_0x4fcf31,'type':'PAUSE','data1':_0x0595('0x55')},_0x2b09d9));}});return db[_0x0595('0x2d')][_0x0595('0x3b')](_0x119c3e[_0x0595('0x56')](_0x50ed48),{'individualHooks':!![]});}})['then'](function(){if(_0x47ba5a){return _0x47ba5a['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x47ba5a['loginInPause']||![],'mailPause':_0x47ba5a['loginInPause']||![],'chatPause':_0x47ba5a[_0x0595('0x54')]||![],'faxPause':_0x47ba5a[_0x0595('0x54')]||![],'smsPause':_0x47ba5a[_0x0595('0x54')]||![],'openchannelPause':_0x47ba5a['loginInPause']||![],'pauseType':_0x47ba5a[_0x0595('0x54')]?_0x0595('0x55'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x50cf31});}})[_0x0595('0x22')](function(_0x32bf46){_0x48e89c(_0x32bf46);})[_0x0595('0x17')](function(_0x1ffd2d){_0x256a2b(_0x1a8b61[_0x0595('0x12')](0x1f4,_0x1ffd2d[_0x0595('0x15')]));});});}; \ No newline at end of file +var _0xed9a=['model','catch','ShowUser','then','PauseUser','User','role','internal','UserVoiceQueueRt','update','MemberReport','name','length','format','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','voice','find','system','mail','chat','fax','openchannel','whatsapp','set','%s%s','all','destroy','LoginUser','mobile','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','socket.io-emitter','redis','register','request','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetUser','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x473606,_0x5e943e){var _0x8840e0=function(_0xf544e0){while(--_0xf544e0){_0x473606['push'](_0x473606['shift']());}};_0x8840e0(++_0x5e943e);}(_0xed9a,0x96));var _0xaed9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xed9a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xaed9('0x0'));var moment=require(_0xaed9('0x1'));var BPromise=require(_0xaed9('0x2'));var rs=require(_0xaed9('0x3'));var fs=require('fs');var Redis=require(_0xaed9('0x4'));var db=require(_0xaed9('0x5'))['db'];var utils=require(_0xaed9('0x6'));var logger=require(_0xaed9('0x7'))(_0xaed9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaed9('0x9')][_0xaed9('0xa')]({'port':0x232a});config['redis']=_[_0xaed9('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaed9('0xc'))(new Redis(config[_0xaed9('0xd')]));require('./user.socket')[_0xaed9('0xe')](socket);function respondWithRpcPromise(_0x5ac71c,_0x5a51aa,_0x485055){return new BPromise(function(_0x4ab811,_0x4d06c8){return client[_0xaed9('0xf')](_0x5ac71c,_0x485055)['then'](function(_0x56b041){logger['info'](_0xaed9('0x10'),_0x5a51aa,_0xaed9('0x11'));logger[_0xaed9('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x5a51aa,'request\x20sent',JSON[_0xaed9('0x13')](_0x56b041));if(_0x56b041[_0xaed9('0x14')]){if(_0x56b041['error'][_0xaed9('0x15')]===0x1f4){logger[_0xaed9('0x14')](_0xaed9('0x10'),_0x5a51aa,_0x56b041[_0xaed9('0x14')][_0xaed9('0x16')]);return _0x4d06c8(_0x56b041[_0xaed9('0x14')][_0xaed9('0x16')]);}logger[_0xaed9('0x14')]('User,\x20%s,\x20%s',_0x5a51aa,_0x56b041[_0xaed9('0x14')][_0xaed9('0x16')]);return _0x4ab811(_0x56b041[_0xaed9('0x14')]['message']);}else{logger[_0xaed9('0x17')]('User,\x20%s,\x20%s',_0x5a51aa,_0xaed9('0x11'));_0x4ab811(_0x56b041[_0xaed9('0x18')]['message']);}})['catch'](function(_0x3707a3){logger['error']('User,\x20%s,\x20%s',_0x5a51aa,_0x3707a3);_0x4d06c8(_0x3707a3);});});}exports[_0xaed9('0x19')]=function(_0x506977){var _0x340d8b=this;return new Promise(function(_0x5e3ed5,_0x41790e){return db['User'][_0xaed9('0x1a')]({'raw':_0x506977['options']?_0x506977[_0xaed9('0x1b')][_0xaed9('0x1c')]===undefined?!![]:![]:!![],'where':_0x506977[_0xaed9('0x1b')]?_0x506977[_0xaed9('0x1b')][_0xaed9('0x1d')]||null:null,'attributes':_0x506977[_0xaed9('0x1b')]?_0x506977[_0xaed9('0x1b')][_0xaed9('0x1e')]||null:null,'limit':_0x506977[_0xaed9('0x1b')]?_0x506977[_0xaed9('0x1b')][_0xaed9('0x1f')]||null:null,'include':_0x506977['options']?_0x506977[_0xaed9('0x1b')][_0xaed9('0x20')]?_[_0xaed9('0x21')](_0x506977[_0xaed9('0x1b')][_0xaed9('0x20')],function(_0x3cb5cc){return{'model':db[_0x3cb5cc[_0xaed9('0x22')]],'as':_0x3cb5cc['as'],'attributes':_0x3cb5cc[_0xaed9('0x1e')],'include':_0x3cb5cc[_0xaed9('0x20')]?_['map'](_0x3cb5cc[_0xaed9('0x20')],function(_0x448d30){return{'model':db[_0x448d30[_0xaed9('0x22')]],'as':_0x448d30['as'],'attributes':_0x448d30['attributes'],'include':_0x448d30[_0xaed9('0x20')]?_[_0xaed9('0x21')](_0x448d30[_0xaed9('0x20')],function(_0x354248){return{'model':db[_0x354248[_0xaed9('0x22')]],'as':_0x354248['as'],'attributes':_0x354248[_0xaed9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c1206){logger['info'](_0xaed9('0x19'),_0x506977);logger['debug'](_0xaed9('0x19'),_0x506977,JSON[_0xaed9('0x13')](_0x4c1206));_0x5e3ed5(_0x4c1206);})[_0xaed9('0x23')](function(_0x4da9c3){logger[_0xaed9('0x14')](_0xaed9('0x19'),_0x4da9c3[_0xaed9('0x16')],_0x506977);_0x41790e(_0x340d8b['error'](0x1f4,_0x4da9c3['message']));});});};exports[_0xaed9('0x24')]=function(_0x52269b){var _0x5efdbd=this;return new Promise(function(_0x10defe,_0x2e1744){return db['User']['find']({'raw':_0x52269b[_0xaed9('0x1b')]?_0x52269b[_0xaed9('0x1b')][_0xaed9('0x1c')]===undefined?!![]:![]:!![],'where':_0x52269b[_0xaed9('0x1b')]?_0x52269b['options'][_0xaed9('0x1d')]||null:null,'attributes':_0x52269b['options']?_0x52269b[_0xaed9('0x1b')][_0xaed9('0x1e')]||null:null,'include':_0x52269b[_0xaed9('0x1b')]?_0x52269b[_0xaed9('0x1b')][_0xaed9('0x20')]?_[_0xaed9('0x21')](_0x52269b['options'][_0xaed9('0x20')],function(_0x44c5ea){return{'model':db[_0x44c5ea['model']],'as':_0x44c5ea['as'],'attributes':_0x44c5ea['attributes'],'include':_0x44c5ea[_0xaed9('0x20')]?_[_0xaed9('0x21')](_0x44c5ea['include'],function(_0x1eee59){return{'model':db[_0x1eee59[_0xaed9('0x22')]],'as':_0x1eee59['as'],'attributes':_0x1eee59[_0xaed9('0x1e')],'include':_0x1eee59[_0xaed9('0x20')]?_[_0xaed9('0x21')](_0x1eee59[_0xaed9('0x20')],function(_0x394523){return{'model':db[_0x394523[_0xaed9('0x22')]],'as':_0x394523['as'],'attributes':_0x394523['attributes']};}):[]};}):[]};}):[]:[]})[_0xaed9('0x25')](function(_0x3507c3){logger[_0xaed9('0x17')](_0xaed9('0x24'),_0x52269b);logger[_0xaed9('0x12')](_0xaed9('0x24'),_0x52269b,JSON[_0xaed9('0x13')](_0x3507c3));_0x10defe(_0x3507c3);})[_0xaed9('0x23')](function(_0x35e3fb){logger[_0xaed9('0x14')](_0xaed9('0x24'),_0x35e3fb['message'],_0x52269b);_0x2e1744(_0x5efdbd['error'](0x1f4,_0x35e3fb['message']));});});};exports[_0xaed9('0x26')]=function(_0x4077fc){var _0x1277dc=this;return new Promise(function(_0x5cfef3,_0x4326dc){var _0x473af9;return db[_0xaed9('0x27')]['find']({'where':_0x4077fc['options'][_0xaed9('0x1d')]||{},'attributes':['id','name',_0xaed9('0x28'),_0xaed9('0x29'),'interface']})[_0xaed9('0x25')](function(_0x165045){if(_0x165045){_0x473af9=_0x165045;return db[_0xaed9('0x2a')][_0xaed9('0x2b')]({'paused':0x1},{'where':{'UserId':_0x473af9['id']},'individualHooks':!![]});}})[_0xaed9('0x25')](function(){if(_0x473af9){return db[_0xaed9('0x2c')][_0xaed9('0x1a')]({'where':{'membername':_0x473af9[_0xaed9('0x2d')],'type':'PAUSE','exitAt':null}});}})[_0xaed9('0x25')](function(_0x804689){if(_0x473af9){if(_0x804689&&_0x804689[_0xaed9('0x2e')]){var _0x394029=moment()[_0xaed9('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x276d05=0x0,_0x413122=_0x804689[_0xaed9('0x2e')];_0x276d05<_0x413122;_0x276d05++){_0x804689[_0x276d05][_0xaed9('0x30')]({'exitAt':_0x394029});}}}})[_0xaed9('0x25')](function(){if(_0x473af9){var _0x517b0c=[];var _0x199fbd=utils[_0xaed9('0x31')]();_0x199fbd[_0xaed9('0x32')](function(_0xca7287){_0x517b0c[_0xaed9('0x33')]({'channel':_0xca7287,'membername':_0x473af9[_0xaed9('0x2d')],'interface':_[_0xaed9('0x34')](_0x473af9[_0xaed9('0x35')])?util['format'](_0xaed9('0x36'),_0x473af9['name']):_0x473af9[_0xaed9('0x35')],'type':_0xaed9('0x37'),'enterAt':moment()['format'](_0xaed9('0x38')),'data1':_0x4077fc[_0xaed9('0x39')][_0xaed9('0x3a')]||'DEFAULT\x20PAUSE','role':_0x473af9[_0xaed9('0x28')],'internal':_0x473af9[_0xaed9('0x29')],'uniqueid':_0x4077fc[_0xaed9('0x39')][_0xaed9('0x3b')]||null});});return db[_0xaed9('0x2c')][_0xaed9('0x3c')](_0x517b0c,{'individualHooks':!![]});}})[_0xaed9('0x25')](function(){if(_0x473af9){return _0x473af9[_0xaed9('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4077fc[_0xaed9('0x39')][_0xaed9('0x3a')]||_0xaed9('0x3d'),'lastPauseAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38'))});}})[_0xaed9('0x25')](function(_0x14ebc7){_0x5cfef3(_0x14ebc7);})[_0xaed9('0x23')](function(_0x2c789a){_0x4326dc(_0x1277dc[_0xaed9('0x14')](0x1f4,_0x2c789a[_0xaed9('0x16')]));});});};exports[_0xaed9('0x3e')]=function(_0x36c27){var _0x59b662=this;return new Promise(function(_0x9ee57,_0x34cdb7){var _0x4ac4b6;return db[_0xaed9('0x27')][_0xaed9('0x3f')]({'where':_0x36c27[_0xaed9('0x1b')][_0xaed9('0x1d')]||{},'attributes':['id',_0xaed9('0x2d')]})['then'](function(_0x231a28){if(_0x231a28){_0x4ac4b6=_0x231a28;if(_0x36c27[_0xaed9('0x39')][_0xaed9('0x40')]&&!utils[_0xaed9('0x41')](_0x36c27[_0xaed9('0x39')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x36c27['body'][_0xaed9('0x40')]){case _0xaed9('0x42'):return db[_0xaed9('0x2a')][_0xaed9('0x2b')]({'paused':0x0},{'where':{'UserId':_0x4ac4b6['id']}})[_0xaed9('0x25')](function(){return db['MemberReport'][_0xaed9('0x43')]({'where':{'channel':_0x36c27[_0xaed9('0x39')][_0xaed9('0x40')],'membername':_0x4ac4b6['name'],'type':_0xaed9('0x37'),'exitAt':null}});})[_0xaed9('0x25')](function(_0x5ae5b0){if(_0x5ae5b0){return _0x5ae5b0[_0xaed9('0x2b')]({'exitAt':moment()['format'](_0xaed9('0x38')),'data2':_0xaed9('0x44')},{'individualHooks':!![]});}return null;})[_0xaed9('0x25')](function(){return _0x4ac4b6[_0xaed9('0x2b')]({'voicePause':![]});});case _0xaed9('0x45'):case _0xaed9('0x46'):case _0xaed9('0x47'):case'sms':case _0xaed9('0x48'):case _0xaed9('0x49'):return db['MemberReport'][_0xaed9('0x43')]({'where':{'channel':_0x36c27[_0xaed9('0x39')]['channel'],'membername':_0x4ac4b6[_0xaed9('0x2d')],'type':_0xaed9('0x37'),'exitAt':null}})[_0xaed9('0x25')](function(_0x44f7ae){return _0x44f7ae['update']({'exitAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38')),'data2':_0xaed9('0x44')},{'individualHooks':!![]});})[_0xaed9('0x25')](function(){var _0x26bffa={};_[_0xaed9('0x4a')](_0x26bffa,util[_0xaed9('0x2f')](_0xaed9('0x4b'),_0x36c27[_0xaed9('0x39')]['channel'],'Pause'),![]);return _0x4ac4b6[_0xaed9('0x2b')](_0x26bffa);});default:return db[_0xaed9('0x2a')]['update']({'paused':0x0},{'where':{'UserId':_0x4ac4b6['id']}})[_0xaed9('0x25')](function(){return db[_0xaed9('0x2c')][_0xaed9('0x1a')]({'where':{'membername':_0x4ac4b6[_0xaed9('0x2d')],'type':'PAUSE','exitAt':null}});})[_0xaed9('0x25')](function(_0x33e825){var _0x7d739b=[];_0x33e825[_0xaed9('0x32')](function(_0x5b8cb3){_0x7d739b['push'](_0x5b8cb3[_0xaed9('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0xaed9('0x4c')](_0x7d739b);})['then'](function(){return _0x4ac4b6[_0xaed9('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xaed9('0x25')](function(_0x4fe6ff){_0x9ee57(_0x4fe6ff);})[_0xaed9('0x23')](function(_0x3f3827){_0x34cdb7(_0x59b662[_0xaed9('0x14')](0x1f4,_0x3f3827[_0xaed9('0x16')]));});});};exports['LogoutUser']=function(_0x164f02){var _0xabc084=this;return new Promise(function(_0x599864,_0x53e1fa){var _0x417205;return db[_0xaed9('0x27')][_0xaed9('0x3f')]({'where':_0x164f02[_0xaed9('0x1b')][_0xaed9('0x1d')]||{},'attributes':['id',_0xaed9('0x2d')]})[_0xaed9('0x25')](function(_0x42dede){if(_0x42dede){_0x417205=_0x42dede;return db[_0xaed9('0x2a')][_0xaed9('0x4d')]({'where':{'membername':_0x417205[_0xaed9('0x2d')]},'individualHooks':!![]});}})['then'](function(){if(_0x417205){return db[_0xaed9('0x2c')][_0xaed9('0x1a')]({'where':{'membername':_0x417205['name'],'exitAt':null}});}})[_0xaed9('0x25')](function(_0x5162a3){if(_0x417205){if(_0x5162a3&&_0x5162a3[_0xaed9('0x2e')]){var _0xeac7a0=[];_0x5162a3['forEach'](function(_0x596747){_0xeac7a0[_0xaed9('0x33')](_0x596747[_0xaed9('0x2b')]({'exitAt':moment()['format'](_0xaed9('0x38'))}));});return BPromise[_0xaed9('0x4c')](_0xeac7a0);}}})[_0xaed9('0x25')](function(){if(_0x417205){return _0x417205[_0xaed9('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xaed9('0x25')](function(_0x451f0d){_0x599864(_0x451f0d);})['catch'](function(_0x2f9f3c){_0x53e1fa(_0xabc084[_0xaed9('0x14')](0x1f4,_0x2f9f3c[_0xaed9('0x16')]));});});};exports[_0xaed9('0x4e')]=function(_0x376797){var _0x38fdce=this;return new Promise(function(_0x58b0bf,_0x34ad25){var _0x325eb5;var _0x3cbb49;var _0x199376;var _0x26e8b7;return db[_0xaed9('0x27')][_0xaed9('0x3f')]({'where':_0x376797[_0xaed9('0x1b')][_0xaed9('0x1d')]||{},'attributes':['id',_0xaed9('0x2d'),_0xaed9('0x28'),_0xaed9('0x4f'),'phone',_0xaed9('0x29'),_0xaed9('0x50'),_0xaed9('0x35')]})['then'](function(_0x47bb06){if(_0x47bb06){_0x325eb5=_0x47bb06;_0x26e8b7=_0x376797[_0xaed9('0x39')][_0xaed9('0x35')]?_0x376797[_0xaed9('0x39')]['interface']:util['format'](_0xaed9('0x36'),_0x325eb5[_0xaed9('0x2d')]);return db[_0xaed9('0x27')][_0xaed9('0x51')]({'where':{'role':_0xaed9('0x52'),'online':!![],'id':{'$ne':_0x325eb5['id']}}});}})[_0xaed9('0x25')](function(_0x1cae62){if(_0x1cae62){_0x199376=_0x1cae62;return require(_0xaed9('0x53'))[_0xaed9('0x54')]();}})[_0xaed9('0x25')](function(_0x3b74d9){if(_0x3b74d9&&_0x3b74d9['agents']&&_0x199376>=_0x3b74d9[_0xaed9('0x55')]){throw new Error(_0xaed9('0x56'));}})[_0xaed9('0x25')](function(){if(_0x325eb5){return db['UserVoiceQueueRt'][_0xaed9('0x4d')]({'where':{'membername':_0x325eb5[_0xaed9('0x2d')]},'individualHooks':!![]});}})['then'](function(){if(_0x325eb5){return _0x325eb5[_0xaed9('0x57')]({'raw':!![]});}})[_0xaed9('0x25')](function(_0x4098f6){if(_0x325eb5){if(_0x4098f6){var _0x3dc19b=[];_0x3cbb49=_0x4098f6;if(_0x3cbb49['length']){for(var _0x41553f=0x0;_0x41553f<_0x3cbb49[_0xaed9('0x2e')];_0x41553f++){_0x3dc19b['push'](db[_0xaed9('0x2a')]['upsert']({'membername':_0x325eb5[_0xaed9('0x2d')],'UserId':_0x325eb5['id'],'queue_name':_0x3cbb49[_0x41553f]['name'],'VoiceQueueId':_0x3cbb49[_0x41553f]['id'],'interface':_0x26e8b7,'paused':_0x325eb5[_0xaed9('0x50')]||![],'penalty':_0x3cbb49[_0x41553f]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xaed9('0x4c')](_0x3dc19b);}}}})['then'](function(){if(_0x325eb5){return db[_0xaed9('0x2c')][_0xaed9('0x1a')]({'where':{'membername':_0x325eb5[_0xaed9('0x2d')],'exitAt':null}});}})[_0xaed9('0x25')](function(_0x2dd3b1){if(_0x325eb5){if(_0x2dd3b1&&_0x2dd3b1[_0xaed9('0x2e')]){var _0x20285f=[];_0x2dd3b1[_0xaed9('0x32')](function(_0x115301){_0x20285f['push'](_0x115301[_0xaed9('0x2b')]({'exitAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38'))}));});return BPromise[_0xaed9('0x4c')](_0x20285f);}}})['then'](function(_0x1c1dbf){if(_0x325eb5){var _0xfe5f6c=[];var _0x3b651e=[];var _0x17cff9=utils[_0xaed9('0x31')]();var _0x8783={'membername':_0x325eb5[_0xaed9('0x2d')],'interface':_0x26e8b7,'enterAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38')),'role':_0x325eb5[_0xaed9('0x28')],'internal':_0x325eb5[_0xaed9('0x29')]};_0x17cff9[_0xaed9('0x32')](function(_0xba3eb0){_0xfe5f6c[_0xaed9('0x33')](_[_0xaed9('0x58')]({'channel':_0xba3eb0,'type':_0xaed9('0x59'),'data1':'callysquare','data2':_0x26e8b7},_0x8783));if(_0x325eb5[_0xaed9('0x50')]){_0x3b651e[_0xaed9('0x33')](_[_0xaed9('0x58')]({'channel':_0xba3eb0,'type':_0xaed9('0x37'),'data1':_0xaed9('0x5a')},_0x8783));}});return db[_0xaed9('0x2c')]['bulkCreate'](_0xfe5f6c[_0xaed9('0x5b')](_0x3b651e),{'individualHooks':!![]});}})[_0xaed9('0x25')](function(){if(_0x325eb5){return _0x325eb5[_0xaed9('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38')),'voicePause':_0x325eb5[_0xaed9('0x50')]||![],'mailPause':_0x325eb5['loginInPause']||![],'chatPause':_0x325eb5[_0xaed9('0x50')]||![],'faxPause':_0x325eb5[_0xaed9('0x50')]||![],'smsPause':_0x325eb5[_0xaed9('0x50')]||![],'openchannelPause':_0x325eb5[_0xaed9('0x50')]||![],'pauseType':_0x325eb5[_0xaed9('0x50')]?_0xaed9('0x5a'):null,'lastPauseAt':moment()[_0xaed9('0x2f')](_0xaed9('0x38')),'interface':_0x26e8b7});}})['then'](function(_0x377c2b){_0x58b0bf(_0x377c2b);})[_0xaed9('0x23')](function(_0x4ce73b){_0x34ad25(_0x38fdce[_0xaed9('0x14')](0x1f4,_0x4ce73b['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index cd2d24e..b4465db 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 _0x39cf=['remove','update','emit','removeListener','register','length','user:','save'];(function(_0x1e4af6,_0x3154ac){var _0x284543=function(_0x3385c5){while(--_0x3385c5){_0x1e4af6['push'](_0x1e4af6['shift']());}};_0x284543(++_0x3154ac);}(_0x39cf,0x1a7));var _0xf39c=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x39cf[_0x494d1f];return _0x457b6e;};'use strict';var UserEvents=require('./user.events');var events=[_0xf39c('0x0'),_0xf39c('0x1'),_0xf39c('0x2')];function createListener(_0x29ab77,_0x50d762){return function(_0xae544a){_0x50d762[_0xf39c('0x3')](_0x29ab77,_0xae544a);};}function removeListener(_0x2675e0,_0x586049){return function(){UserEvents[_0xf39c('0x4')](_0x2675e0,_0x586049);};}exports[_0xf39c('0x5')]=function(_0x22a0b5){for(var _0x59bb2a=0x0,_0x46ecc9=events[_0xf39c('0x6')];_0x59bb2a<_0x46ecc9;_0x59bb2a++){var _0xf344c8=events[_0x59bb2a];var _0x592060=createListener(_0xf39c('0x7')+_0xf344c8,_0x22a0b5);UserEvents['on'](_0xf344c8,_0x592060);}}; \ No newline at end of file +var _0xc641=['emit','removeListener','length','user:','./user.events','save','update'];(function(_0x2fb7b2,_0x9f61a4){var _0x4db80e=function(_0x595045){while(--_0x595045){_0x2fb7b2['push'](_0x2fb7b2['shift']());}};_0x4db80e(++_0x9f61a4);}(_0xc641,0x146));var _0x1c64=function(_0x25ba70,_0x22a3f9){_0x25ba70=_0x25ba70-0x0;var _0x295607=_0xc641[_0x25ba70];return _0x295607;};'use strict';var UserEvents=require(_0x1c64('0x0'));var events=[_0x1c64('0x1'),'remove',_0x1c64('0x2')];function createListener(_0x244fa5,_0x63623){return function(_0x272ad0){_0x63623[_0x1c64('0x3')](_0x244fa5,_0x272ad0);};}function removeListener(_0x5389a8,_0x4f3822){return function(){UserEvents[_0x1c64('0x4')](_0x5389a8,_0x4f3822);};}exports['register']=function(_0x5f3c02){for(var _0x2a2da3=0x0,_0x2d20a3=events[_0x1c64('0x5')];_0x2a2da3<_0x2d20a3;_0x2a2da3++){var _0x28c2b7=events[_0x2a2da3];var _0x3923d2=createListener(_0x1c64('0x6')+_0x28c2b7,_0x5f3c02);UserEvents['on'](_0x28c2b7,_0x3923d2);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4519255..964962f 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x39bc9a,_0x2f5da6){var _0x23dada=function(_0x11e637){while(--_0x11e637){_0x39bc9a['push'](_0x39bc9a['shift']());}};_0x23dada(++_0x2f5da6);}(_0x70e0,0x17b));var _0x070e=function(_0x442953,_0x23cf4b){_0x442953=_0x442953-0x0;var _0x27dd3f=_0x70e0[_0x442953];return _0x27dd3f;};'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(_0x174e10,_0x32f58c){var _0x4184c5=function(_0x4988aa){while(--_0x4988aa){_0x174e10['push'](_0x174e10['shift']());}};_0x4184c5(++_0x32f58c);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 87b51f9..16dbaaa 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 _0xd17f=['sequelize','exports','INTEGER'];(function(_0xafff4a,_0xf2d3a3){var _0x182145=function(_0x312ec0){while(--_0x312ec0){_0xafff4a['push'](_0xafff4a['shift']());}};_0x182145(++_0xf2d3a3);}(_0xd17f,0x10e));var _0xfd17=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xd17f[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xfd17('0x0'));module[_0xfd17('0x1')]={'penalty':{'type':Sequelize[_0xfd17('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6dc0=['sequelize','INTEGER'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x6dc0,0x18c));var _0x06dc=function(_0x4864ea,_0x7764ed){_0x4864ea=_0x4864ea-0x0;var _0x12e74f=_0x6dc0[_0x4864ea];return _0x12e74f;};'use strict';var Sequelize=require(_0x06dc('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x06dc('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index ffaf69c..75cf6f4 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 _0xcfb2=['user_has_chat_queues','lodash','util','moment','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x3a2389,_0x2f1d11){var _0x1d02ed=function(_0x1ae439){while(--_0x1ae439){_0x3a2389['push'](_0x3a2389['shift']());}};_0x1d02ed(++_0x2f1d11);}(_0xcfb2,0x156));var _0x2cfb=function(_0x2c64ff,_0x14ad17){_0x2c64ff=_0x2c64ff-0x0;var _0x277cdd=_0xcfb2[_0x2c64ff];return _0x277cdd;};'use strict';var _=require(_0x2cfb('0x0'));var util=require(_0x2cfb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2cfb('0x2'));var BPromise=require(_0x2cfb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2cfb('0x4'));var config=require(_0x2cfb('0x5'));var attributes=require(_0x2cfb('0x6'));module[_0x2cfb('0x7')]=function(_0x4abe57,_0x1e44dc){return _0x4abe57[_0x2cfb('0x8')](_0x2cfb('0x9'),attributes,{'tableName':_0x2cfb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x606c=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','define','user_has_chat_queues'];(function(_0x24a2e5,_0x1382d5){var _0x6dec0b=function(_0x2301ce){while(--_0x2301ce){_0x24a2e5['push'](_0x24a2e5['shift']());}};_0x6dec0b(++_0x1382d5);}(_0x606c,0x1e4));var _0xc606=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x606c[_0x58175c];return _0x55b88f;};'use strict';var _=require(_0xc606('0x0'));var util=require(_0xc606('0x1'));var logger=require(_0xc606('0x2'))('api');var moment=require(_0xc606('0x3'));var BPromise=require(_0xc606('0x4'));var rp=require(_0xc606('0x5'));var fs=require('fs');var path=require(_0xc606('0x6'));var rimraf=require('rimraf');var config=require(_0xc606('0x7'));var attributes=require(_0xc606('0x8'));module['exports']=function(_0x2ebadc,_0x2ce384){return _0x2ebadc[_0xc606('0x9')]('UserChatQueue',attributes,{'tableName':_0xc606('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 b231a3f..d495c89 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 _0x36c7=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x367951,_0x4fd4b3){var _0x1ed613=function(_0x1206d9){while(--_0x1206d9){_0x367951['push'](_0x367951['shift']());}};_0x1ed613(++_0x4fd4b3);}(_0x36c7,0x1c1));var _0x736c=function(_0x56c6c1,_0x61b8cd){_0x56c6c1=_0x56c6c1-0x0;var _0x412aae=_0x36c7[_0x56c6c1];return _0x412aae;};'use strict';var _=require(_0x736c('0x0'));var util=require('util');var moment=require(_0x736c('0x1'));var BPromise=require(_0x736c('0x2'));var rs=require(_0x736c('0x3'));var fs=require('fs');var Redis=require(_0x736c('0x4'));var db=require(_0x736c('0x5'))['db'];var utils=require(_0x736c('0x6'));var logger=require(_0x736c('0x7'))('rpc');var config=require(_0x736c('0x8'));var jayson=require(_0x736c('0x9'));var client=jayson[_0x736c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3a080,_0x345b6a,_0x4fb91a){return new BPromise(function(_0x3dbabe,_0x18ecb7){return client[_0x736c('0xb')](_0xd3a080,_0x4fb91a)[_0x736c('0xc')](function(_0x54cd9b){logger[_0x736c('0xd')](_0x736c('0xe'),_0x345b6a,_0x736c('0xf'));logger['debug'](_0x736c('0x10'),_0x345b6a,_0x736c('0xf'),JSON[_0x736c('0x11')](_0x54cd9b));if(_0x54cd9b[_0x736c('0x12')]){if(_0x54cd9b[_0x736c('0x12')][_0x736c('0x13')]===0x1f4){logger[_0x736c('0x12')](_0x736c('0xe'),_0x345b6a,_0x54cd9b[_0x736c('0x12')][_0x736c('0x14')]);return _0x18ecb7(_0x54cd9b[_0x736c('0x12')][_0x736c('0x14')]);}logger['error'](_0x736c('0xe'),_0x345b6a,_0x54cd9b[_0x736c('0x12')]['message']);return _0x3dbabe(_0x54cd9b[_0x736c('0x12')][_0x736c('0x14')]);}else{logger[_0x736c('0xd')](_0x736c('0xe'),_0x345b6a,_0x736c('0xf'));_0x3dbabe(_0x54cd9b[_0x736c('0x15')][_0x736c('0x14')]);}})[_0x736c('0x16')](function(_0x2a60fb){logger[_0x736c('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x345b6a,_0x2a60fb);_0x18ecb7(_0x2a60fb);});});} \ No newline at end of file +var _0x002e=['error','message','info','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5162e0,_0x26c1d9){var _0x18ff69=function(_0x43bf78){while(--_0x43bf78){_0x5162e0['push'](_0x5162e0['shift']());}};_0x18ff69(++_0x26c1d9);}(_0x002e,0x8b));var _0xe002=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0x002e[_0x42020e];return _0x561551;};'use strict';var _=require(_0xe002('0x0'));var util=require(_0xe002('0x1'));var moment=require(_0xe002('0x2'));var BPromise=require('bluebird');var rs=require(_0xe002('0x3'));var fs=require('fs');var Redis=require(_0xe002('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe002('0x5'));var logger=require(_0xe002('0x6'))(_0xe002('0x7'));var config=require(_0xe002('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe002('0x9')][_0xe002('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28b015,_0x3fb1dc,_0x565a72){return new BPromise(function(_0x345a03,_0x4877d3){return client['request'](_0x28b015,_0x565a72)['then'](function(_0x29b461){logger['info'](_0xe002('0xb'),_0x3fb1dc,_0xe002('0xc'));logger['debug'](_0xe002('0xd'),_0x3fb1dc,_0xe002('0xc'),JSON['stringify'](_0x29b461));if(_0x29b461[_0xe002('0xe')]){if(_0x29b461[_0xe002('0xe')]['code']===0x1f4){logger[_0xe002('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3fb1dc,_0x29b461[_0xe002('0xe')][_0xe002('0xf')]);return _0x4877d3(_0x29b461[_0xe002('0xe')]['message']);}logger[_0xe002('0xe')](_0xe002('0xb'),_0x3fb1dc,_0x29b461[_0xe002('0xe')][_0xe002('0xf')]);return _0x345a03(_0x29b461[_0xe002('0xe')][_0xe002('0xf')]);}else{logger[_0xe002('0x10')](_0xe002('0xb'),_0x3fb1dc,_0xe002('0xc'));_0x345a03(_0x29b461['result'][_0xe002('0xf')]);}})['catch'](function(_0x494076){logger[_0xe002('0xe')](_0xe002('0xb'),_0x3fb1dc,_0x494076);_0x4877d3(_0x494076);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index b3d230e..fc1e515 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xfb7b48,_0x57a542){var _0x49dafd=function(_0x36f75a){while(--_0x36f75a){_0xfb7b48['push'](_0xfb7b48['shift']());}};_0x49dafd(++_0x57a542);}(_0xe706,0xa3));var _0x6e70=function(_0x57fd40,_0x9de24f){_0x57fd40=_0x57fd40-0x0;var _0x52bb76=_0xe706[_0x57fd40];return _0x52bb76;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5e8f6d,_0x1c1c03){var _0x5d02b4=function(_0x576323){while(--_0x576323){_0x5e8f6d['push'](_0x5e8f6d['shift']());}};_0x5d02b4(++_0x1c1c03);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xcb91[_0x1ae4a9];return _0x54d0b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f72df5c..a528ccf 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 _0xfe10=['STRING','sequelize','exports','INTEGER'];(function(_0x36fe10,_0x5e0e73){var _0x146150=function(_0x66377d){while(--_0x66377d){_0x36fe10['push'](_0x36fe10['shift']());}};_0x146150(++_0x5e0e73);}(_0xfe10,0x191));var _0x0fe1=function(_0x24b6e4,_0x1dfe8d){_0x24b6e4=_0x24b6e4-0x0;var _0x3d9cd4=_0xfe10[_0x24b6e4];return _0x3d9cd4;};'use strict';var Sequelize=require(_0x0fe1('0x0'));module[_0x0fe1('0x1')]={'penalty':{'type':Sequelize[_0x0fe1('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0fe1('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0fe1('0x3')]}}; \ No newline at end of file +var _0xf9f3=['sequelize','exports','INTEGER'];(function(_0x3fb02d,_0x3a3f84){var _0x2b3255=function(_0x8f8cbf){while(--_0x8f8cbf){_0x3fb02d['push'](_0x3fb02d['shift']());}};_0x2b3255(++_0x3a3f84);}(_0xf9f3,0x9c));var _0x3f9f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf9f3[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x3f9f('0x0'));module[_0x3f9f('0x1')]={'penalty':{'type':Sequelize[_0x3f9f('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3f9f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f46ac4a..47f74ec 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 _0x27a3=['exports','user_has_fax_queues','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./userFaxQueue.attributes'];(function(_0x2e8674,_0xa839d1){var _0x35e4f5=function(_0x500278){while(--_0x500278){_0x2e8674['push'](_0x2e8674['shift']());}};_0x35e4f5(++_0xa839d1);}(_0x27a3,0x16a));var _0x327a=function(_0x41dc0b,_0x481b72){_0x41dc0b=_0x41dc0b-0x0;var _0x1ed529=_0x27a3[_0x41dc0b];return _0x1ed529;};'use strict';var _=require(_0x327a('0x0'));var util=require('util');var logger=require(_0x327a('0x1'))(_0x327a('0x2'));var moment=require(_0x327a('0x3'));var BPromise=require('bluebird');var rp=require(_0x327a('0x4'));var fs=require('fs');var path=require(_0x327a('0x5'));var rimraf=require('rimraf');var config=require(_0x327a('0x6'));var attributes=require(_0x327a('0x7'));module[_0x327a('0x8')]=function(_0x61c58,_0x45450e){return _0x61c58['define']('UserFaxQueue',attributes,{'tableName':_0x327a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9574=['request-promise','path','rimraf','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x340de3,_0x2d0cdf){var _0x57ddc0=function(_0x36dabd){while(--_0x36dabd){_0x340de3['push'](_0x340de3['shift']());}};_0x57ddc0(++_0x2d0cdf);}(_0x9574,0x162));var _0x4957=function(_0x30b22d,_0x47ea84){_0x30b22d=_0x30b22d-0x0;var _0xe8b1d7=_0x9574[_0x30b22d];return _0xe8b1d7;};'use strict';var _=require(_0x4957('0x0'));var util=require(_0x4957('0x1'));var logger=require(_0x4957('0x2'))(_0x4957('0x3'));var moment=require(_0x4957('0x4'));var BPromise=require(_0x4957('0x5'));var rp=require(_0x4957('0x6'));var fs=require('fs');var path=require(_0x4957('0x7'));var rimraf=require(_0x4957('0x8'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x4957('0x9')]=function(_0x53de24,_0x192fbf){return _0x53de24[_0x4957('0xa')](_0x4957('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 1ee293d..95dc02f 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 _0xfd08=['../../config/utils','rpc','jayson/promise','http','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','bluebird','../../mysqldb'];(function(_0x50b5c3,_0x217c30){var _0x302bfb=function(_0x1aed3b){while(--_0x1aed3b){_0x50b5c3['push'](_0x50b5c3['shift']());}};_0x302bfb(++_0x217c30);}(_0xfd08,0xb0));var _0x8fd0=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0xfd08[_0x118afa];return _0x167d76;};'use strict';var _=require(_0x8fd0('0x0'));var util=require(_0x8fd0('0x1'));var moment=require('moment');var BPromise=require(_0x8fd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd0('0x3'))['db'];var utils=require(_0x8fd0('0x4'));var logger=require('../../config/logger')(_0x8fd0('0x5'));var config=require('../../config/environment');var jayson=require(_0x8fd0('0x6'));var client=jayson['client'][_0x8fd0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f4a0f,_0x3975ec,_0x4cbb3c){return new BPromise(function(_0x19276d,_0x280525){return client['request'](_0x1f4a0f,_0x4cbb3c)[_0x8fd0('0x8')](function(_0x23a045){logger[_0x8fd0('0x9')](_0x8fd0('0xa'),_0x3975ec,'request\x20sent');logger['debug'](_0x8fd0('0xb'),_0x3975ec,'request\x20sent',JSON[_0x8fd0('0xc')](_0x23a045));if(_0x23a045[_0x8fd0('0xd')]){if(_0x23a045['error'][_0x8fd0('0xe')]===0x1f4){logger[_0x8fd0('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x3975ec,_0x23a045[_0x8fd0('0xd')][_0x8fd0('0xf')]);return _0x280525(_0x23a045[_0x8fd0('0xd')]['message']);}logger[_0x8fd0('0xd')](_0x8fd0('0xa'),_0x3975ec,_0x23a045[_0x8fd0('0xd')]['message']);return _0x19276d(_0x23a045['error'][_0x8fd0('0xf')]);}else{logger[_0x8fd0('0x9')](_0x8fd0('0xa'),_0x3975ec,_0x8fd0('0x10'));_0x19276d(_0x23a045[_0x8fd0('0x11')][_0x8fd0('0xf')]);}})['catch'](function(_0xfae4f6){logger['error'](_0x8fd0('0xa'),_0x3975ec,_0xfae4f6);_0x280525(_0xfae4f6);});});} \ No newline at end of file +var _0x617c=['info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x24717a,_0x26f6dc){var _0x32cf54=function(_0x1282a6){while(--_0x1282a6){_0x24717a['push'](_0x24717a['shift']());}};_0x32cf54(++_0x26f6dc);}(_0x617c,0xf9));var _0xc617=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x617c[_0x43a5c7];return _0x3b12a2;};'use strict';var _=require(_0xc617('0x0'));var util=require(_0xc617('0x1'));var moment=require(_0xc617('0x2'));var BPromise=require('bluebird');var rs=require(_0xc617('0x3'));var fs=require('fs');var Redis=require(_0xc617('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc617('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc617('0x6'));var jayson=require(_0xc617('0x7'));var client=jayson[_0xc617('0x8')][_0xc617('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229c7d,_0x5ac5ed,_0x11a1e7){return new BPromise(function(_0xb1fdcf,_0x2c6a38){return client[_0xc617('0xa')](_0x229c7d,_0x11a1e7)['then'](function(_0x195ed0){logger[_0xc617('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x5ac5ed,_0xc617('0xc'));logger['debug'](_0xc617('0xd'),_0x5ac5ed,_0xc617('0xc'),JSON[_0xc617('0xe')](_0x195ed0));if(_0x195ed0[_0xc617('0xf')]){if(_0x195ed0['error']['code']===0x1f4){logger[_0xc617('0xf')](_0xc617('0x10'),_0x5ac5ed,_0x195ed0['error'][_0xc617('0x11')]);return _0x2c6a38(_0x195ed0[_0xc617('0xf')][_0xc617('0x11')]);}logger[_0xc617('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x5ac5ed,_0x195ed0['error'][_0xc617('0x11')]);return _0xb1fdcf(_0x195ed0['error']['message']);}else{logger[_0xc617('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x5ac5ed,_0xc617('0xc'));_0xb1fdcf(_0x195ed0[_0xc617('0x12')][_0xc617('0x11')]);}})[_0xc617('0x13')](function(_0x3a607c){logger[_0xc617('0xf')](_0xc617('0x10'),_0x5ac5ed,_0x3a607c);_0x2c6a38(_0x3a607c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ecffca7..bd8ce71 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xaab2f5,_0x58463f){var _0x3b28ea=function(_0xcbc73c){while(--_0xcbc73c){_0xaab2f5['push'](_0xaab2f5['shift']());}};_0x3b28ea(++_0x58463f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x53ce15,_0xfaa6b1){var _0x1c3405=function(_0x59415f){while(--_0x59415f){_0x53ce15['push'](_0x53ce15['shift']());}};_0x1c3405(++_0xfaa6b1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xcb91[_0x1bf809];return _0x1caa4e;};'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 2af1ab1..7ec9dd9 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 _0x1a93=['INTEGER','sequelize','exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x1a93,0xa0));var _0x31a9=function(_0x5096ba,_0x1b6b0a){_0x5096ba=_0x5096ba-0x0;var _0x579551=_0x1a93[_0x5096ba];return _0x579551;};'use strict';var Sequelize=require(_0x31a9('0x0'));module[_0x31a9('0x1')]={'penalty':{'type':Sequelize[_0x31a9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc72f=['INTEGER','sequelize'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0xc72f,0x9b));var _0xfc72=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc72f[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0xfc72('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfc72('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 4928d53..1f8c473 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 _0xd9c9=['user_has_mail_queues','api','bluebird','request-promise','path','rimraf','exports','define','UserMailQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9c9,0x1d5));var _0x9d9c=function(_0x3aedc3,_0x5aa449){_0x3aedc3=_0x3aedc3-0x0;var _0x48400e=_0xd9c9[_0x3aedc3];return _0x48400e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9d9c('0x0'));var moment=require('moment');var BPromise=require(_0x9d9c('0x1'));var rp=require(_0x9d9c('0x2'));var fs=require('fs');var path=require(_0x9d9c('0x3'));var rimraf=require(_0x9d9c('0x4'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x9d9c('0x5')]=function(_0x2e82ad,_0x596845){return _0x2e82ad[_0x9d9c('0x6')](_0x9d9c('0x7'),attributes,{'tableName':_0x9d9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20b4=['bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','api','moment'];(function(_0x46228d,_0x3d7fb5){var _0x53614d=function(_0x2b7acf){while(--_0x2b7acf){_0x46228d['push'](_0x46228d['shift']());}};_0x53614d(++_0x3d7fb5);}(_0x20b4,0x131));var _0x420b=function(_0x3af704,_0x58486b){_0x3af704=_0x3af704-0x0;var _0x4ac16c=_0x20b4[_0x3af704];return _0x4ac16c;};'use strict';var _=require(_0x420b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x420b('0x1'));var moment=require(_0x420b('0x2'));var BPromise=require(_0x420b('0x3'));var rp=require(_0x420b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x420b('0x5'));var config=require(_0x420b('0x6'));var attributes=require(_0x420b('0x7'));module['exports']=function(_0x1cc135,_0x445364){return _0x1cc135[_0x420b('0x8')](_0x420b('0x9'),attributes,{'tableName':_0x420b('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 807bcb3..45ece13 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3bc0fa,_0x49c2ab){var _0x1a0a15=function(_0x2174f2){while(--_0x2174f2){_0x3bc0fa['push'](_0x3bc0fa['shift']());}};_0x1a0a15(++_0x49c2ab);}(_0x34e8,0x12c));var _0x834e=function(_0x13681d,_0x2bb362){_0x13681d=_0x13681d-0x0;var _0x199f52=_0x34e8[_0x13681d];return _0x199f52;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32bef2,_0x6f4924){var _0x2fae07=function(_0x4a6a72){while(--_0x4a6a72){_0x32bef2['push'](_0x32bef2['shift']());}};_0x2fae07(++_0x6f4924);}(_0x34e8,0x12c));var _0x834e=function(_0x296e86,_0x3b729c){_0x296e86=_0x296e86-0x0;var _0x56a194=_0x34e8[_0x296e86];return _0x56a194;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c302a0e..7a2534c 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 _0xf6df=['../../config/environment','isAuthenticated','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xf6df,0x73));var _0xff6d=function(_0xe92e71,_0xde2eb2){_0xe92e71=_0xe92e71-0x0;var _0x4d30b4=_0xf6df[_0xe92e71];return _0x4d30b4;};'use strict';var multer=require(_0xff6d('0x0'));var util=require('util');var path=require(_0xff6d('0x1'));var timeout=require(_0xff6d('0x2'));var express=require(_0xff6d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xff6d('0x4'));var config=require(_0xff6d('0x5'));var controller=require('./userNotification.controller');router['post']('/',auth[_0xff6d('0x6')](),controller['sendUserNotification']);module[_0xff6d('0x7')]=router; \ No newline at end of file +var _0x951c=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path'];(function(_0x414b5b,_0x24d20a){var _0x40ad7a=function(_0x437fc1){while(--_0x437fc1){_0x414b5b['push'](_0x414b5b['shift']());}};_0x40ad7a(++_0x24d20a);}(_0x951c,0x89));var _0xc951=function(_0x5bb037,_0xee1f16){_0x5bb037=_0x5bb037-0x0;var _0x2f369c=_0x951c[_0x5bb037];return _0x2f369c;};'use strict';var multer=require(_0xc951('0x0'));var util=require(_0xc951('0x1'));var path=require(_0xc951('0x2'));var timeout=require(_0xc951('0x3'));var express=require(_0xc951('0x4'));var router=express['Router']();var fs_extra=require(_0xc951('0x5'));var auth=require(_0xc951('0x6'));var interaction=require(_0xc951('0x7'));var config=require(_0xc951('0x8'));var controller=require(_0xc951('0x9'));router[_0xc951('0xa')]('/',auth[_0xc951('0xb')](),controller[_0xc951('0xc')]);module[_0xc951('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index d552a16..514f12f 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 _0x0a15=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x46d95b,_0x4c2198){var _0x48686d=function(_0xf285bc){while(--_0xf285bc){_0x46d95b['push'](_0x46d95b['shift']());}};_0x48686d(++_0x4c2198);}(_0x0a15,0x6f));var _0x50a1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0a15[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x50a1('0x0'));module[_0x50a1('0x1')]={'body':{'type':Sequelize[_0x50a1('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x50a1('0x2')]},'recipientsDescription':{'type':Sequelize[_0x50a1('0x3')]},'beep':{'type':Sequelize[_0x50a1('0x4')]}}; \ No newline at end of file +var _0x15e4=['STRING','sequelize','TEXT'];(function(_0x16765f,_0x3dd736){var _0x1326d4=function(_0x523c1a){while(--_0x523c1a){_0x16765f['push'](_0x16765f['shift']());}};_0x1326d4(++_0x3dd736);}(_0x15e4,0xa6));var _0x415e=function(_0x211863,_0x440104){_0x211863=_0x211863-0x0;var _0x326c96=_0x15e4[_0x211863];return _0x326c96;};'use strict';var Sequelize=require(_0x415e('0x0'));module['exports']={'body':{'type':Sequelize[_0x415e('0x1')]},'senderName':{'type':Sequelize[_0x415e('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x415e('0x2')]},'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 bcdea54..b1ef0f2 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 _0x1703=['senderName','user','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','emit','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','queue','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object'];(function(_0x1c9bf6,_0xa7b4d1){var _0x315a1d=function(_0x46015e){while(--_0x46015e){_0x1c9bf6['push'](_0x1c9bf6['shift']());}};_0x315a1d(++_0xa7b4d1);}(_0x1703,0xd5));var _0x3170=function(_0x1d5e5d,_0x172c14){_0x1d5e5d=_0x1d5e5d-0x0;var _0x4610eb=_0x1703[_0x1d5e5d];return _0x4610eb;};'use strict';var emlformat=require(_0x3170('0x0'));var rimraf=require(_0x3170('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3170('0x2'));var rp=require(_0x3170('0x3'));var moment=require(_0x3170('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3170('0x5'));var util=require(_0x3170('0x6'));var path=require('path');var sox=require(_0x3170('0x7'));var csv=require('to-csv');var ejs=require(_0x3170('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3170('0x9'));var squel=require('squel');var crypto=require(_0x3170('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3170('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3170('0xc'));var authService=require(_0x3170('0xd'));var qs=require(_0x3170('0xe'));var as=require(_0x3170('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3170('0x10'))('api');var utils=require(_0x3170('0x11'));var config=require(_0x3170('0x12'));var licenseUtil=require(_0x3170('0x13'));var db=require(_0x3170('0x14'))['db'];config[_0x3170('0x15')]=_[_0x3170('0x16')](config[_0x3170('0x15')],{'host':_0x3170('0x17'),'port':0x18eb});var socket=require(_0x3170('0x18'))(new Redis(config['redis']));require(_0x3170('0x19'))[_0x3170('0x1a')](socket);function respondWithStatusCode(_0x407621,_0x97c486){_0x97c486=_0x97c486||0xcc;return function(_0x4a7984){if(_0x4a7984){return _0x407621[_0x3170('0x1b')](_0x97c486);}return _0x407621[_0x3170('0x1c')](_0x97c486)['end']();};}function respondWithResult(_0x47fd85,_0x46859e){_0x46859e=_0x46859e||0xc8;return function(_0x39908e){if(_0x39908e){return _0x47fd85[_0x3170('0x1c')](_0x46859e)[_0x3170('0x1d')](_0x39908e);}};}function respondWithFilteredResult(_0x21d0ba,_0x32e514){return function(_0x6265cd){if(_0x6265cd){var _0x4feaa1=typeof _0x32e514[_0x3170('0x1e')]===_0x3170('0x1f')&&typeof _0x32e514[_0x3170('0x20')]==='undefined';var _0x37c9c3=_0x6265cd[_0x3170('0x21')];var _0x210042=_0x4feaa1?0x0:_0x32e514['offset'];var _0x122b78=_0x4feaa1?_0x6265cd['count']:_0x32e514[_0x3170('0x1e')]+_0x32e514['limit'];var _0x57ea68;if(_0x122b78>=_0x37c9c3){_0x122b78=_0x37c9c3;_0x57ea68=0xc8;}else{_0x57ea68=0xce;}_0x21d0ba[_0x3170('0x1c')](_0x57ea68);return _0x21d0ba[_0x3170('0x22')]('Content-Range',_0x210042+'-'+_0x122b78+'/'+_0x37c9c3)[_0x3170('0x1d')](_0x6265cd);}return null;};}function patchUpdates(_0x28e041){return function(_0x1090f2){try{jsonpatch[_0x3170('0x23')](_0x1090f2,_0x28e041,!![]);}catch(_0xe2da48){return BPromise['reject'](_0xe2da48);}return _0x1090f2[_0x3170('0x24')]();};}function saveUpdates(_0x2a3964,_0x12d60a){return function(_0x3775b6){if(_0x3775b6){return _0x3775b6[_0x3170('0x25')](_0x2a3964)['then'](function(_0x348bba){return _0x348bba;});}return null;};}function removeEntity(_0x1033fe,_0x41b761){return function(_0x4b4ae3){if(_0x4b4ae3){return _0x4b4ae3['destroy']()[_0x3170('0x26')](function(){_0x1033fe[_0x3170('0x1c')](0xcc)[_0x3170('0x27')]();});}};}function handleEntityNotFound(_0x24d0c0,_0x2eb7bc){return function(_0x58c0a6){if(!_0x58c0a6){_0x24d0c0[_0x3170('0x1b')](0x194);}return _0x58c0a6;};}function handleError(_0xb63d97,_0x34fd74){_0x34fd74=_0x34fd74||0x1f4;return function(_0x263fca){logger[_0x3170('0x28')](_0x263fca[_0x3170('0x29')]);if(_0x263fca[_0x3170('0x2a')]){delete _0x263fca[_0x3170('0x2a')];}_0xb63d97[_0x3170('0x1c')](_0x34fd74)['send'](_0x263fca);};}exports['sendUserNotification']=function(_0xb60884,_0x10a08d,_0x365293){if(!_0xb60884[_0x3170('0x2b')][_0x3170('0x2c')](_0x3170('0x2d'))&&!_0xb60884[_0x3170('0x2b')][_0x3170('0x2c')](_0x3170('0x2e'))){throw new db[(_0x3170('0x2f'))]['ValidationError'](_0x3170('0x30'));}else{if(_0xb60884[_0x3170('0x2b')][_0x3170('0x2c')]('TemplateId')&&!_0xb60884[_0x3170('0x2b')][_0x3170('0x2c')](_0x3170('0x31'))){throw new db[(_0x3170('0x2f'))][(_0x3170('0x32'))](_0x3170('0x33'));}if(!_0xb60884[_0x3170('0x2b')]['hasOwnProperty'](_0x3170('0x34'))){throw new db['Sequelize'][(_0x3170('0x32'))](_0x3170('0x35'));}else{try{var _0x27e73d=JSON[_0x3170('0x36')](_0xb60884[_0x3170('0x2b')][_0x3170('0x34')]);}catch(_0x1d4455){logger[_0x3170('0x28')](_0x1d4455);throw new db['Sequelize']['ValidationError'](_0x3170('0x37'));}var _0x89581=['chatqueue',_0x3170('0x38'),_0x3170('0x39'),_0x3170('0x3a'),'smsqueue','voicequeue',_0x3170('0x3b'),_0x3170('0x3c'),'user'];if(_[_0x3170('0x3d')](_0x27e73d,function(_0x4b2950){return!_[_0x3170('0x3e')](_0x89581,_0x4b2950[_0x3170('0x3f')][_0x3170('0x40')]());})){throw new db[(_0x3170('0x2f'))][(_0x3170('0x32'))](_0x3170('0x41'));}}}var _0xe0a911={};_0xe0a911[_0x3170('0x42')]=_0xb60884['body']['hasOwnProperty']('senderName')?_0xb60884[_0x3170('0x2b')][_0x3170('0x42')]:_0xb60884[_0x3170('0x43')]['fullname'];_0xe0a911[_0x3170('0x44')]=_[_0x3170('0x45')](_0xb60884[_0x3170('0x2b')]['recipientsDescription'])?null:_0xb60884['body'][_0x3170('0x44')];_0xe0a911['beep']=_0xb60884[_0x3170('0x2b')][_0x3170('0x46')]||![];_0xe0a911['SenderId']=_0xb60884['user']['id'];return getContent(_0xb60884['body'])['then'](function(_0x4e23a0){_0xe0a911[_0x3170('0x2b')]=_0x4e23a0;return getRecipients(_0x27e73d);})[_0x3170('0x26')](function(_0x117239){_0xe0a911[_0x3170('0x47')]=_[_0x3170('0x48')](_0x117239)[_0x3170('0x49')](',');return db['sequelize'][_0x3170('0x4a')](function(_0x103d44){return db[_0x3170('0x4b')][_0x3170('0x4c')](_0xe0a911,{'raw':!![],'transaction':_0x103d44})['then'](function(_0x524c58){var _0x198f9d={'sender':_0xe0a911[_0x3170('0x42')],'description':_0xe0a911['recipientsDescription'],'content':_0xe0a911['body'],'beep':_0xe0a911[_0x3170('0x46')]};_0x117239[_0x3170('0x4d')](function(_0x342321){_0x198f9d['recipient']=_0x342321;socket[_0x3170('0x4e')]('userNotification:send',_0x198f9d);});return _0x524c58;});});})['then'](respondWithResult(_0x10a08d,0xc9))[_0x3170('0x4f')](handleError(_0x10a08d,null));};function getContent(_0x2bfcb0){return new BPromise(function(_0x54b47d,_0x11e147){if(_0x2bfcb0['text']){_0x54b47d(_0x2bfcb0['text']);return;}return db['Template'][_0x3170('0x50')]({'attributes':['html'],'where':{'id':_0x2bfcb0[_0x3170('0x2e')]},'raw':!![]})[_0x3170('0x26')](function(_0x45df73){if(!_0x45df73)throw new db[(_0x3170('0x2f'))][(_0x3170('0x32'))](_0x3170('0x51'));var _0x2d8cdb=Mustache[_0x3170('0x52')](_0x45df73[_0x3170('0x53')],_0x2bfcb0[_0x3170('0x31')]);_0x54b47d(_0x2d8cdb);})[_0x3170('0x4f')](function(_0x3b104e){_0x11e147(_0x3b104e);});});}function getRecipients(_0x2c6f2b){return new BPromise(function(_0x4501c3,_0x24fa5e){var _0x241fbc=[];var _0x149e67=[];_0x2c6f2b[_0x3170('0x4d')](function(_0x5dff0b){var _0x53cd2c=_[_0x3170('0x54')](_0x5dff0b[_0x3170('0x3f')]['toLowerCase']());if(_0x53cd2c===_0x3170('0x55')){_0x241fbc=_[_0x3170('0x56')](_0x241fbc,_0x5dff0b[_0x3170('0x57')]);}else{if(_[_0x3170('0x3e')](_0x53cd2c,_0x3170('0x58')))_0x53cd2c=_0x53cd2c['replace'](_0x3170('0x58'),'Queue');_0x5dff0b[_0x3170('0x57')]['forEach'](function(_0x238c9b){_0x149e67[_0x3170('0x59')](getAgents(_0x53cd2c,_0x238c9b));});}});return BPromise[_0x3170('0x5a')](_0x149e67)[_0x3170('0x26')](function(_0x5bc835){_0x241fbc=_[_0x3170('0x56')](_0x241fbc,_['flatten'](_0x5bc835));_0x4501c3(_0x241fbc);})[_0x3170('0x4f')](function(_0x19a8b6){_0x24fa5e(_0x19a8b6);});});}function getAgents(_0x44a28d,_0x12b8c9){return new BPromise(function(_0x3b5d81,_0x47f696){return db[_0x44a28d][_0x3170('0x50')]({'where':{'id':_0x12b8c9}})[_0x3170('0x26')](function(_0x18a880){return _0x18a880[_0x3170('0x5b')]({'attributes':['id'],'raw':!![]})[_0x3170('0x26')](function(_0x3530a1){var _0x3d7190=_[_0x3170('0x5c')](_0x3530a1,'id');_0x3b5d81(_0x3d7190);});})[_0x3170('0x4f')](function(_0x13de54){_0x47f696(_0x13de54);});});} \ No newline at end of file +var _0x3f99=['undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','ValidationError','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sequelize','transaction','create','userNotification:send','Template','findOne','html','render','catch','forEach','User','ids','queue','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','end','status','json','offset'];(function(_0x3615bd,_0x5f17bc){var _0x6c4370=function(_0x20cd88){while(--_0x20cd88){_0x3615bd['push'](_0x3615bd['shift']());}};_0x6c4370(++_0x5f17bc);}(_0x3f99,0x1be));var _0x93f9=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0x3f99[_0x27031e];return _0xfd46b3;};'use strict';var emlformat=require(_0x93f9('0x0'));var rimraf=require(_0x93f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f9('0x2'));var rp=require(_0x93f9('0x3'));var moment=require('moment');var BPromise=require(_0x93f9('0x4'));var Mustache=require(_0x93f9('0x5'));var util=require(_0x93f9('0x6'));var path=require(_0x93f9('0x7'));var sox=require(_0x93f9('0x8'));var csv=require(_0x93f9('0x9'));var ejs=require(_0x93f9('0xa'));var fs=require('fs');var fs_extra=require(_0x93f9('0xb'));var _=require(_0x93f9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x93f9('0xd'));var toCsv=require(_0x93f9('0x9'));var querystring=require(_0x93f9('0xe'));var Papa=require(_0x93f9('0xf'));var Redis=require('ioredis');var authService=require(_0x93f9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93f9('0x11'));var logger=require(_0x93f9('0x12'))(_0x93f9('0x13'));var utils=require(_0x93f9('0x14'));var config=require(_0x93f9('0x15'));var licenseUtil=require(_0x93f9('0x16'));var db=require(_0x93f9('0x17'))['db'];config[_0x93f9('0x18')]=_[_0x93f9('0x19')](config['redis'],{'host':_0x93f9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93f9('0x18')]));require(_0x93f9('0x1b'))[_0x93f9('0x1c')](socket);function respondWithStatusCode(_0x1e6996,_0x5e49fb){_0x5e49fb=_0x5e49fb||0xcc;return function(_0x19d240){if(_0x19d240){return _0x1e6996[_0x93f9('0x1d')](_0x5e49fb);}return _0x1e6996['status'](_0x5e49fb)[_0x93f9('0x1e')]();};}function respondWithResult(_0x212c53,_0x503bed){_0x503bed=_0x503bed||0xc8;return function(_0x1e6f27){if(_0x1e6f27){return _0x212c53[_0x93f9('0x1f')](_0x503bed)[_0x93f9('0x20')](_0x1e6f27);}};}function respondWithFilteredResult(_0x40408a,_0x560d89){return function(_0x29caa1){if(_0x29caa1){var _0x55322c=typeof _0x560d89[_0x93f9('0x21')]===_0x93f9('0x22')&&typeof _0x560d89[_0x93f9('0x23')]===_0x93f9('0x22');var _0x38a7ad=_0x29caa1[_0x93f9('0x24')];var _0x39d930=_0x55322c?0x0:_0x560d89[_0x93f9('0x21')];var _0x1d5cb1=_0x55322c?_0x29caa1[_0x93f9('0x24')]:_0x560d89[_0x93f9('0x21')]+_0x560d89[_0x93f9('0x23')];var _0x1d0ecb;if(_0x1d5cb1>=_0x38a7ad){_0x1d5cb1=_0x38a7ad;_0x1d0ecb=0xc8;}else{_0x1d0ecb=0xce;}_0x40408a[_0x93f9('0x1f')](_0x1d0ecb);return _0x40408a['set'](_0x93f9('0x25'),_0x39d930+'-'+_0x1d5cb1+'/'+_0x38a7ad)[_0x93f9('0x20')](_0x29caa1);}return null;};}function patchUpdates(_0x43ea6e){return function(_0x23ada1){try{jsonpatch[_0x93f9('0x26')](_0x23ada1,_0x43ea6e,!![]);}catch(_0x54308){return BPromise[_0x93f9('0x27')](_0x54308);}return _0x23ada1['save']();};}function saveUpdates(_0x1a0602,_0x40531b){return function(_0x47ce23){if(_0x47ce23){return _0x47ce23[_0x93f9('0x28')](_0x1a0602)[_0x93f9('0x29')](function(_0x342e05){return _0x342e05;});}return null;};}function removeEntity(_0x57df7b,_0xf97491){return function(_0x1e6ee1){if(_0x1e6ee1){return _0x1e6ee1[_0x93f9('0x2a')]()['then'](function(){_0x57df7b[_0x93f9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1181c2,_0x53857b){return function(_0x49cd14){if(!_0x49cd14){_0x1181c2['sendStatus'](0x194);}return _0x49cd14;};}function handleError(_0x362a76,_0x2e7fda){_0x2e7fda=_0x2e7fda||0x1f4;return function(_0x466334){logger[_0x93f9('0x2b')](_0x466334[_0x93f9('0x2c')]);if(_0x466334[_0x93f9('0x2d')]){delete _0x466334['name'];}_0x362a76[_0x93f9('0x1f')](_0x2e7fda)[_0x93f9('0x2e')](_0x466334);};}exports['sendUserNotification']=function(_0x523ed2,_0x200956,_0x19359e){if(!_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x30')](_0x93f9('0x31'))&&!_0x523ed2['body'][_0x93f9('0x30')](_0x93f9('0x32'))){throw new db[(_0x93f9('0x33'))]['ValidationError'](_0x93f9('0x34'));}else{if(_0x523ed2['body'][_0x93f9('0x30')](_0x93f9('0x32'))&&!_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x30')](_0x93f9('0x35'))){throw new db[(_0x93f9('0x33'))]['ValidationError'](_0x93f9('0x36'));}if(!_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x30')](_0x93f9('0x37'))){throw new db['Sequelize']['ValidationError'](_0x93f9('0x38'));}else{try{var _0x1a76b6=JSON[_0x93f9('0x39')](_0x523ed2['body'][_0x93f9('0x37')]);}catch(_0x24056a){logger[_0x93f9('0x2b')](_0x24056a);throw new db['Sequelize'][(_0x93f9('0x3a'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4a24c3=[_0x93f9('0x3b'),_0x93f9('0x3c'),_0x93f9('0x3d'),_0x93f9('0x3e'),'smsqueue',_0x93f9('0x3f'),_0x93f9('0x40'),_0x93f9('0x41'),_0x93f9('0x42')];if(_['some'](_0x1a76b6,function(_0x1c162c){return!_[_0x93f9('0x43')](_0x4a24c3,_0x1c162c[_0x93f9('0x44')][_0x93f9('0x45')]());})){throw new db[(_0x93f9('0x33'))][(_0x93f9('0x3a'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x16a80f={};_0x16a80f[_0x93f9('0x46')]=_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x30')]('senderName')?_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x46')]:_0x523ed2[_0x93f9('0x42')][_0x93f9('0x47')];_0x16a80f[_0x93f9('0x48')]=_[_0x93f9('0x49')](_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x48')])?null:_0x523ed2[_0x93f9('0x2f')]['recipientsDescription'];_0x16a80f[_0x93f9('0x4a')]=_0x523ed2[_0x93f9('0x2f')][_0x93f9('0x4a')]||![];_0x16a80f[_0x93f9('0x4b')]=_0x523ed2['user']['id'];return getContent(_0x523ed2[_0x93f9('0x2f')])['then'](function(_0x2fb720){_0x16a80f[_0x93f9('0x2f')]=_0x2fb720;return getRecipients(_0x1a76b6);})[_0x93f9('0x29')](function(_0x489989){_0x16a80f['recipientsId']=_['sortBy'](_0x489989)['join'](',');return db[_0x93f9('0x4c')][_0x93f9('0x4d')](function(_0x2938a1){return db['UserNotification'][_0x93f9('0x4e')](_0x16a80f,{'raw':!![],'transaction':_0x2938a1})[_0x93f9('0x29')](function(_0x42aa7a){var _0x508f07={'sender':_0x16a80f[_0x93f9('0x46')],'description':_0x16a80f[_0x93f9('0x48')],'content':_0x16a80f[_0x93f9('0x2f')],'beep':_0x16a80f['beep']};_0x489989['forEach'](function(_0x12ce5d){_0x508f07['recipient']=_0x12ce5d;socket['emit'](_0x93f9('0x4f'),_0x508f07);});return _0x42aa7a;});});})[_0x93f9('0x29')](respondWithResult(_0x200956,0xc9))['catch'](handleError(_0x200956,null));};function getContent(_0x3b8aa8){return new BPromise(function(_0x53894a,_0x5b94dc){if(_0x3b8aa8[_0x93f9('0x31')]){_0x53894a(_0x3b8aa8[_0x93f9('0x31')]);return;}return db[_0x93f9('0x50')][_0x93f9('0x51')]({'attributes':[_0x93f9('0x52')],'where':{'id':_0x3b8aa8[_0x93f9('0x32')]},'raw':!![]})[_0x93f9('0x29')](function(_0x59cab9){if(!_0x59cab9)throw new db[(_0x93f9('0x33'))][(_0x93f9('0x3a'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x112dfd=Mustache[_0x93f9('0x53')](_0x59cab9[_0x93f9('0x52')],_0x3b8aa8[_0x93f9('0x35')]);_0x53894a(_0x112dfd);})[_0x93f9('0x54')](function(_0x449f69){_0x5b94dc(_0x449f69);});});}function getRecipients(_0x2b6d62){return new BPromise(function(_0x41cb28,_0x382372){var _0x15b608=[];var _0x44e9d0=[];_0x2b6d62[_0x93f9('0x55')](function(_0x50ea5e){var _0x4f8ba4=_['startCase'](_0x50ea5e[_0x93f9('0x44')][_0x93f9('0x45')]());if(_0x4f8ba4===_0x93f9('0x56')){_0x15b608=_['union'](_0x15b608,_0x50ea5e[_0x93f9('0x57')]);}else{if(_[_0x93f9('0x43')](_0x4f8ba4,'queue'))_0x4f8ba4=_0x4f8ba4['replace'](_0x93f9('0x58'),_0x93f9('0x59'));_0x50ea5e[_0x93f9('0x57')][_0x93f9('0x55')](function(_0x2dd4aa){_0x44e9d0[_0x93f9('0x5a')](getAgents(_0x4f8ba4,_0x2dd4aa));});}});return BPromise[_0x93f9('0x5b')](_0x44e9d0)[_0x93f9('0x29')](function(_0x58df1c){_0x15b608=_[_0x93f9('0x5c')](_0x15b608,_[_0x93f9('0x5d')](_0x58df1c));_0x41cb28(_0x15b608);})[_0x93f9('0x54')](function(_0x38ec28){_0x382372(_0x38ec28);});});}function getAgents(_0x3448f8,_0x3cdeb4){return new BPromise(function(_0x1d5e5f,_0x3de464){return db[_0x3448f8][_0x93f9('0x51')]({'where':{'id':_0x3cdeb4}})['then'](function(_0x31070f){return _0x31070f[_0x93f9('0x5e')]({'attributes':['id'],'raw':!![]})[_0x93f9('0x29')](function(_0x3e771c){var _0x482485=_[_0x93f9('0x5f')](_0x3e771c,'id');_0x1d5e5f(_0x482485);});})['catch'](function(_0x252d5d){_0x3de464(_0x252d5d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index ab20c0d..4929046 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 _0x201a=['exports','events','../../mysqldb','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x590f0a,_0x44fb7d){var _0x289e59=function(_0x3d56f7){while(--_0x3d56f7){_0x590f0a['push'](_0x590f0a['shift']());}};_0x289e59(++_0x44fb7d);}(_0x201a,0xda));var _0xa201=function(_0x588d01,_0x4ecdbe){_0x588d01=_0x588d01-0x0;var _0x395577=_0x201a[_0x588d01];return _0x395577;};'use strict';var EventEmitter=require(_0xa201('0x0'));var UserNotification=require(_0xa201('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa201('0x2')](0x0);var events={'afterCreate':_0xa201('0x3'),'afterUpdate':'update','afterDestroy':_0xa201('0x4')};function emitEvent(_0x4b34ff){return function(_0x3535c3,_0x108c8b,_0x3aaf42){UserNotificationEvents['emit'](_0x4b34ff+':'+_0x3535c3['id'],_0x3535c3);UserNotificationEvents['emit'](_0x4b34ff,_0x3535c3);_0x3aaf42(null);};}for(var e in events){if(events[_0xa201('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xa201('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x571b=['exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x42c00c,_0xdf2664){var _0x50304d=function(_0x3fdc84){while(--_0x3fdc84){_0x42c00c['push'](_0x42c00c['shift']());}};_0x50304d(++_0xdf2664);}(_0x571b,0x10f));var _0xb571=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x571b[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0xb571('0x0'));var UserNotification=require(_0xb571('0x1'))['db'][_0xb571('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb571('0x3'),'afterUpdate':_0xb571('0x4'),'afterDestroy':_0xb571('0x5')};function emitEvent(_0x281ecf){return function(_0x274f7d,_0x2388e5,_0x5755a5){UserNotificationEvents[_0xb571('0x6')](_0x281ecf+':'+_0x274f7d['id'],_0x274f7d);UserNotificationEvents[_0xb571('0x6')](_0x281ecf,_0x274f7d);_0x5755a5(null);};}for(var e in events){if(events[_0xb571('0x7')](e)){var event=events[e];UserNotification[_0xb571('0x8')](e,emitEvent(event));}}module[_0xb571('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0d82ed7..d6014b6 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 _0xbaca=['util','api','moment','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','lodash'];(function(_0x4d502e,_0x950daa){var _0x45eac8=function(_0x535d62){while(--_0x535d62){_0x4d502e['push'](_0x4d502e['shift']());}};_0x45eac8(++_0x950daa);}(_0xbaca,0xfc));var _0xabac=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xbaca[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xabac('0x0'));var util=require(_0xabac('0x1'));var logger=require('../../config/logger')(_0xabac('0x2'));var moment=require(_0xabac('0x3'));var BPromise=require('bluebird');var rp=require(_0xabac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabac('0x5'));var config=require(_0xabac('0x6'));var attributes=require(_0xabac('0x7'));module[_0xabac('0x8')]=function(_0x38acf5,_0x50bcd8){return _0x38acf5['define'](_0xabac('0x9'),attributes,{'tableName':_0xabac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x93ab=['request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x213f3d,_0x31c31f){var _0x238251=function(_0x222903){while(--_0x222903){_0x213f3d['push'](_0x213f3d['shift']());}};_0x238251(++_0x31c31f);}(_0x93ab,0x114));var _0xb93a=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x93ab[_0x16e0c8];return _0xe4b5af;};'use strict';var _=require('lodash');var util=require(_0xb93a('0x0'));var logger=require(_0xb93a('0x1'))(_0xb93a('0x2'));var moment=require(_0xb93a('0x3'));var BPromise=require('bluebird');var rp=require(_0xb93a('0x4'));var fs=require('fs');var path=require(_0xb93a('0x5'));var rimraf=require('rimraf');var config=require(_0xb93a('0x6'));var attributes=require(_0xb93a('0x7'));module[_0xb93a('0x8')]=function(_0x369908,_0x1f339a){return _0x369908[_0xb93a('0x9')](_0xb93a('0xa'),attributes,{'tableName':_0xb93a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb93a('0xc'),'collate':_0xb93a('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b4aec36..3cbd361 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 _0xef3c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','randomstring'];(function(_0x49715d,_0x55a0){var _0xbcb92b=function(_0x50f306){while(--_0x50f306){_0x49715d['push'](_0x49715d['shift']());}};_0xbcb92b(++_0x55a0);}(_0xef3c,0x173));var _0xcef3=function(_0x1b9eb2,_0x5dcac8){_0x1b9eb2=_0x1b9eb2-0x0;var _0x3cd876=_0xef3c[_0x1b9eb2];return _0x3cd876;};'use strict';var _=require(_0xcef3('0x0'));var util=require(_0xcef3('0x1'));var moment=require(_0xcef3('0x2'));var BPromise=require('bluebird');var rs=require(_0xcef3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcef3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcef3('0x5'))(_0xcef3('0x6'));var config=require(_0xcef3('0x7'));var jayson=require(_0xcef3('0x8'));var client=jayson[_0xcef3('0x9')][_0xcef3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xcef3('0xb'),'port':0x18eb});var socket=require(_0xcef3('0xc'))(new Redis(config['redis']));require(_0xcef3('0xd'))[_0xcef3('0xe')](socket);function respondWithRpcPromise(_0x147934,_0x2524da,_0x39a604){return new BPromise(function(_0x38adcc,_0x449a52){return client[_0xcef3('0xf')](_0x147934,_0x39a604)[_0xcef3('0x10')](function(_0x362952){logger[_0xcef3('0x11')](_0xcef3('0x12'),_0x2524da,'request\x20sent');logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x2524da,'request\x20sent',JSON[_0xcef3('0x13')](_0x362952));if(_0x362952[_0xcef3('0x14')]){if(_0x362952[_0xcef3('0x14')][_0xcef3('0x15')]===0x1f4){logger[_0xcef3('0x14')](_0xcef3('0x12'),_0x2524da,_0x362952['error']['message']);return _0x449a52(_0x362952[_0xcef3('0x14')]['message']);}logger[_0xcef3('0x14')]('UserNotification,\x20%s,\x20%s',_0x2524da,_0x362952['error'][_0xcef3('0x16')]);return _0x38adcc(_0x362952[_0xcef3('0x14')][_0xcef3('0x16')]);}else{logger[_0xcef3('0x11')]('UserNotification,\x20%s,\x20%s',_0x2524da,_0xcef3('0x17'));_0x38adcc(_0x362952[_0xcef3('0x18')]['message']);}})['catch'](function(_0x676d7f){logger[_0xcef3('0x14')](_0xcef3('0x12'),_0x2524da,_0x676d7f);_0x449a52(_0x676d7f);});});} \ No newline at end of file +var _0xde0d=['UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','ioredis','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30e950,_0x346f70){var _0x1537ce=function(_0x3488e4){while(--_0x3488e4){_0x30e950['push'](_0x30e950['shift']());}};_0x1537ce(++_0x346f70);}(_0xde0d,0xde));var _0xdde0=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xde0d[_0x934425];return _0x31d596;};'use strict';var _=require(_0xdde0('0x0'));var util=require(_0xdde0('0x1'));var moment=require(_0xdde0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdde0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdde0('0x4'));var logger=require('../../config/logger')(_0xdde0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdde0('0x6')]({'port':0x232a});config[_0xdde0('0x7')]=_[_0xdde0('0x8')](config[_0xdde0('0x7')],{'host':_0xdde0('0x9'),'port':0x18eb});var socket=require(_0xdde0('0xa'))(new Redis(config[_0xdde0('0x7')]));require(_0xdde0('0xb'))[_0xdde0('0xc')](socket);function respondWithRpcPromise(_0x3f69b7,_0xd7d6a1,_0x46b9f4){return new BPromise(function(_0x45f19a,_0x2066a7){return client[_0xdde0('0xd')](_0x3f69b7,_0x46b9f4)[_0xdde0('0xe')](function(_0x5d49a0){logger['info'](_0xdde0('0xf'),_0xd7d6a1,_0xdde0('0x10'));logger[_0xdde0('0x11')](_0xdde0('0x12'),_0xd7d6a1,_0xdde0('0x10'),JSON['stringify'](_0x5d49a0));if(_0x5d49a0[_0xdde0('0x13')]){if(_0x5d49a0[_0xdde0('0x13')][_0xdde0('0x14')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0xd7d6a1,_0x5d49a0['error']['message']);return _0x2066a7(_0x5d49a0[_0xdde0('0x13')]['message']);}logger['error'](_0xdde0('0xf'),_0xd7d6a1,_0x5d49a0[_0xdde0('0x13')][_0xdde0('0x15')]);return _0x45f19a(_0x5d49a0[_0xdde0('0x13')][_0xdde0('0x15')]);}else{logger[_0xdde0('0x16')](_0xdde0('0xf'),_0xd7d6a1,'request\x20sent');_0x45f19a(_0x5d49a0['result'][_0xdde0('0x15')]);}})[_0xdde0('0x17')](function(_0x2a89ad){logger[_0xdde0('0x13')]('UserNotification,\x20%s,\x20%s',_0xd7d6a1,_0x2a89ad);_0x2066a7(_0x2a89ad);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 269e3ad..d544fbe 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 _0x23cc=['userNotification:','./userNotification.events','save','remove','emit','removeListener','register'];(function(_0x4e94e2,_0x3715f8){var _0x41bf8b=function(_0x3ed7f1){while(--_0x3ed7f1){_0x4e94e2['push'](_0x4e94e2['shift']());}};_0x41bf8b(++_0x3715f8);}(_0x23cc,0xda));var _0xc23c=function(_0x574496,_0x2638b5){_0x574496=_0x574496-0x0;var _0x27fa0f=_0x23cc[_0x574496];return _0x27fa0f;};'use strict';var UserNotificationEvents=require(_0xc23c('0x0'));var events=[_0xc23c('0x1'),_0xc23c('0x2'),'update'];function createListener(_0x82e134,_0x21bfb6){return function(_0xaaead7){_0x21bfb6[_0xc23c('0x3')](_0x82e134,_0xaaead7);};}function removeListener(_0x280f4e,_0xddb5dc){return function(){UserNotificationEvents[_0xc23c('0x4')](_0x280f4e,_0xddb5dc);};}exports[_0xc23c('0x5')]=function(_0x507272){for(var _0x3fcf59=0x0,_0x5c61bd=events['length'];_0x3fcf59<_0x5c61bd;_0x3fcf59++){var _0x4654a0=events[_0x3fcf59];var _0x51e161=createListener(_0xc23c('0x6')+_0x4654a0,_0x507272);UserNotificationEvents['on'](_0x4654a0,_0x51e161);}}; \ No newline at end of file +var _0x7c86=['./userNotification.events','save','remove','update','removeListener','length','userNotification:'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7c86,0x16c));var _0x67c8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7c86[_0x4a9fb1];return _0x348672;};'use strict';var UserNotificationEvents=require(_0x67c8('0x0'));var events=[_0x67c8('0x1'),_0x67c8('0x2'),_0x67c8('0x3')];function createListener(_0x471a55,_0x1e3437){return function(_0x461b4c){_0x1e3437['emit'](_0x471a55,_0x461b4c);};}function removeListener(_0x1604e7,_0x2bae38){return function(){UserNotificationEvents[_0x67c8('0x4')](_0x1604e7,_0x2bae38);};}exports['register']=function(_0x59ec9d){for(var _0x6d2863=0x0,_0x2e1435=events[_0x67c8('0x5')];_0x6d2863<_0x2e1435;_0x6d2863++){var _0xcb3c86=events[_0x6d2863];var _0x3960b4=createListener(_0x67c8('0x6')+_0xcb3c86,_0x59ec9d);UserNotificationEvents['on'](_0xcb3c86,_0x3960b4);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 903eda9..43bd27f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4982f6,_0x45ba31){var _0x3d8a48=function(_0xef2826){while(--_0xef2826){_0x4982f6['push'](_0x4982f6['shift']());}};_0x3d8a48(++_0x45ba31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xec9322,_0x2d5b87){var _0x39d576=function(_0x542056){while(--_0x542056){_0xec9322['push'](_0xec9322['shift']());}};_0x39d576(++_0x2d5b87);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a77598e..67000ba 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 _0x054c=['sequelize','exports'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x054c,0x194));var _0xc054=function(_0x10e045,_0x2cba40){_0x10e045=_0x10e045-0x0;var _0x2173e3=_0x054c[_0x10e045];return _0x2173e3;};'use strict';var Sequelize=require(_0xc054('0x0'));module[_0xc054('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x60c3=['exports'];(function(_0x5aa3c0,_0x2ff5fd){var _0x3d4ada=function(_0x18289f){while(--_0x18289f){_0x5aa3c0['push'](_0x5aa3c0['shift']());}};_0x3d4ada(++_0x2ff5fd);}(_0x60c3,0x110));var _0x360c=function(_0x131bc4,_0x34acf8){_0x131bc4=_0x131bc4-0x0;var _0x27bfcc=_0x60c3[_0x131bc4];return _0x27bfcc;};'use strict';var Sequelize=require('sequelize');module[_0x360c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 47b6862..cdc0a09 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 _0xae12=['./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x484bde,_0x1f262e){var _0x5c1a61=function(_0x449cbb){while(--_0x449cbb){_0x484bde['push'](_0x484bde['shift']());}};_0x5c1a61(++_0x1f262e);}(_0xae12,0x1ea));var _0x2ae1=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xae12[_0x37cc52];return _0x2b4a90;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ae1('0x0'))(_0x2ae1('0x1'));var moment=require(_0x2ae1('0x2'));var BPromise=require(_0x2ae1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2ae1('0x4'));var config=require('../../config/environment');var attributes=require(_0x2ae1('0x5'));module['exports']=function(_0x36a2a2,_0xf682d4){return _0x36a2a2[_0x2ae1('0x6')](_0x2ae1('0x7'),attributes,{'tableName':_0x2ae1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ac5=['bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5ac5,0xa2));var _0x55ac=function(_0x14fe1a,_0x5bc7c8){_0x14fe1a=_0x14fe1a-0x0;var _0x540aa8=_0x5ac5[_0x14fe1a];return _0x540aa8;};'use strict';var _=require(_0x55ac('0x0'));var util=require('util');var logger=require(_0x55ac('0x1'))(_0x55ac('0x2'));var moment=require('moment');var BPromise=require(_0x55ac('0x3'));var rp=require(_0x55ac('0x4'));var fs=require('fs');var path=require(_0x55ac('0x5'));var rimraf=require('rimraf');var config=require(_0x55ac('0x6'));var attributes=require(_0x55ac('0x7'));module[_0x55ac('0x8')]=function(_0x1051a5,_0x425c9b){return _0x1051a5['define'](_0x55ac('0x9'),attributes,{'tableName':_0x55ac('0xa'),'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 f7e7ef0..f7e420b 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 _0xc10e=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x529dd7,_0x43f585){var _0xd089bb=function(_0x1a60a6){while(--_0x1a60a6){_0x529dd7['push'](_0x529dd7['shift']());}};_0xd089bb(++_0x43f585);}(_0xc10e,0x8b));var _0xec10=function(_0x289912,_0x1296a9){_0x289912=_0x289912-0x0;var _0x31d2af=_0xc10e[_0x289912];return _0x31d2af;};'use strict';var _=require(_0xec10('0x0'));var util=require(_0xec10('0x1'));var moment=require(_0xec10('0x2'));var BPromise=require(_0xec10('0x3'));var rs=require(_0xec10('0x4'));var fs=require('fs');var Redis=require(_0xec10('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec10('0x6'));var logger=require(_0xec10('0x7'))(_0xec10('0x8'));var config=require(_0xec10('0x9'));var jayson=require(_0xec10('0xa'));var client=jayson[_0xec10('0xb')][_0xec10('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40fe13,_0x49e996,_0x3f8857){return new BPromise(function(_0x217094,_0x503d6c){return client[_0xec10('0xd')](_0x40fe13,_0x3f8857)[_0xec10('0xe')](function(_0x19d552){logger[_0xec10('0xf')](_0xec10('0x10'),_0x49e996,'request\x20sent');logger[_0xec10('0x11')](_0xec10('0x12'),_0x49e996,_0xec10('0x13'),JSON[_0xec10('0x14')](_0x19d552));if(_0x19d552['error']){if(_0x19d552[_0xec10('0x15')][_0xec10('0x16')]===0x1f4){logger[_0xec10('0x15')](_0xec10('0x10'),_0x49e996,_0x19d552['error'][_0xec10('0x17')]);return _0x503d6c(_0x19d552['error'][_0xec10('0x17')]);}logger[_0xec10('0x15')](_0xec10('0x10'),_0x49e996,_0x19d552['error']['message']);return _0x217094(_0x19d552[_0xec10('0x15')]['message']);}else{logger[_0xec10('0xf')](_0xec10('0x10'),_0x49e996,_0xec10('0x13'));_0x217094(_0x19d552[_0xec10('0x18')][_0xec10('0x17')]);}})[_0xec10('0x19')](function(_0x39ed36){logger[_0xec10('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x49e996,_0x39ed36);_0x503d6c(_0x39ed36);});});} \ No newline at end of file +var _0x7069=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','randomstring'];(function(_0x1e0ee0,_0x475877){var _0x204bf2=function(_0x8b7adc){while(--_0x8b7adc){_0x1e0ee0['push'](_0x1e0ee0['shift']());}};_0x204bf2(++_0x475877);}(_0x7069,0x95));var _0x9706=function(_0x4f6d73,_0x1cd2d9){_0x4f6d73=_0x4f6d73-0x0;var _0x5b3b2f=_0x7069[_0x4f6d73];return _0x5b3b2f;};'use strict';var _=require(_0x9706('0x0'));var util=require(_0x9706('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9706('0x2'));var fs=require('fs');var Redis=require(_0x9706('0x3'));var db=require(_0x9706('0x4'))['db'];var utils=require(_0x9706('0x5'));var logger=require(_0x9706('0x6'))(_0x9706('0x7'));var config=require('../../config/environment');var jayson=require(_0x9706('0x8'));var client=jayson[_0x9706('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad824,_0x169c31,_0x13ec4e){return new BPromise(function(_0x1586c3,_0x2061bb){return client[_0x9706('0xa')](_0x2ad824,_0x13ec4e)['then'](function(_0x49975f){logger[_0x9706('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x169c31,'request\x20sent');logger[_0x9706('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x169c31,'request\x20sent',JSON[_0x9706('0xd')](_0x49975f));if(_0x49975f[_0x9706('0xe')]){if(_0x49975f[_0x9706('0xe')][_0x9706('0xf')]===0x1f4){logger[_0x9706('0xe')](_0x9706('0x10'),_0x169c31,_0x49975f[_0x9706('0xe')][_0x9706('0x11')]);return _0x2061bb(_0x49975f[_0x9706('0xe')][_0x9706('0x11')]);}logger[_0x9706('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x169c31,_0x49975f[_0x9706('0xe')][_0x9706('0x11')]);return _0x1586c3(_0x49975f['error'][_0x9706('0x11')]);}else{logger[_0x9706('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x169c31,'request\x20sent');_0x1586c3(_0x49975f['result'][_0x9706('0x11')]);}})[_0x9706('0x12')](function(_0x17858c){logger[_0x9706('0xe')](_0x9706('0x10'),_0x169c31,_0x17858c);_0x2061bb(_0x17858c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c5197fc..b785c7b 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 _0x0e6b=['/describe','isAuthenticated','describe','show','/:id/sections','getSections','/:id/resources','post','/:id/clone','addSections','addResources','put','/:id','update','delete','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x35e7f5,_0x2c52b8){var _0x290a15=function(_0x4df64b){while(--_0x4df64b){_0x35e7f5['push'](_0x35e7f5['shift']());}};_0x290a15(++_0x2c52b8);}(_0x0e6b,0x69));var _0xb0e6=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x0e6b[_0x596c43];return _0x4e1315;};'use strict';var multer=require(_0xb0e6('0x0'));var util=require(_0xb0e6('0x1'));var path=require('path');var timeout=require(_0xb0e6('0x2'));var express=require(_0xb0e6('0x3'));var router=express[_0xb0e6('0x4')]();var fs_extra=require(_0xb0e6('0x5'));var auth=require(_0xb0e6('0x6'));var interaction=require(_0xb0e6('0x7'));var config=require(_0xb0e6('0x8'));var controller=require('./userProfile.controller');router[_0xb0e6('0x9')]('/',auth['isAuthenticated'](),controller[_0xb0e6('0xa')]);router[_0xb0e6('0x9')](_0xb0e6('0xb'),auth[_0xb0e6('0xc')](),controller[_0xb0e6('0xd')]);router[_0xb0e6('0x9')]('/:id',auth[_0xb0e6('0xc')](),controller[_0xb0e6('0xe')]);router[_0xb0e6('0x9')](_0xb0e6('0xf'),auth[_0xb0e6('0xc')](),controller[_0xb0e6('0x10')]);router[_0xb0e6('0x9')](_0xb0e6('0x11'),auth['isAuthenticated'](),controller['getResources']);router[_0xb0e6('0x12')]('/',auth[_0xb0e6('0xc')](),controller['create']);router['post'](_0xb0e6('0x13'),auth[_0xb0e6('0xc')](),controller['clone']);router[_0xb0e6('0x12')](_0xb0e6('0xf'),auth['isAuthenticated'](),controller[_0xb0e6('0x14')]);router['post'](_0xb0e6('0x11'),auth['isAuthenticated'](),controller[_0xb0e6('0x15')]);router[_0xb0e6('0x16')](_0xb0e6('0x17'),auth[_0xb0e6('0xc')](),controller[_0xb0e6('0x18')]);router[_0xb0e6('0x19')](_0xb0e6('0x17'),auth[_0xb0e6('0xc')](),controller['destroy']);router[_0xb0e6('0x19')](_0xb0e6('0xf'),auth[_0xb0e6('0xc')](),controller[_0xb0e6('0x1a')]);router[_0xb0e6('0x19')](_0xb0e6('0x11'),auth[_0xb0e6('0xc')](),controller[_0xb0e6('0x1b')]);module[_0xb0e6('0x1c')]=router; \ No newline at end of file +var _0x2dce=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','destroy','delete','removeResources','exports','multer','util','path'];(function(_0x3fdd88,_0x20329e){var _0x2b0ed0=function(_0x248ed3){while(--_0x248ed3){_0x3fdd88['push'](_0x3fdd88['shift']());}};_0x2b0ed0(++_0x20329e);}(_0x2dce,0x141));var _0xe2dc=function(_0x51cff2,_0x54d2d2){_0x51cff2=_0x51cff2-0x0;var _0x1452cb=_0x2dce[_0x51cff2];return _0x1452cb;};'use strict';var multer=require(_0xe2dc('0x0'));var util=require(_0xe2dc('0x1'));var path=require(_0xe2dc('0x2'));var timeout=require(_0xe2dc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe2dc('0x4'));var auth=require(_0xe2dc('0x5'));var interaction=require(_0xe2dc('0x6'));var config=require(_0xe2dc('0x7'));var controller=require('./userProfile.controller');router[_0xe2dc('0x8')]('/',auth[_0xe2dc('0x9')](),controller['index']);router[_0xe2dc('0x8')](_0xe2dc('0xa'),auth[_0xe2dc('0x9')](),controller['describe']);router[_0xe2dc('0x8')](_0xe2dc('0xb'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0xc')]);router[_0xe2dc('0x8')](_0xe2dc('0xd'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0xe')]);router['get'](_0xe2dc('0xf'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x10')]);router[_0xe2dc('0x11')]('/',auth['isAuthenticated'](),controller[_0xe2dc('0x12')]);router[_0xe2dc('0x11')](_0xe2dc('0x13'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x14')]);router[_0xe2dc('0x11')]('/:id/sections',auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x15')]);router['post'](_0xe2dc('0xf'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x16')]);router['put'](_0xe2dc('0xb'),auth[_0xe2dc('0x9')](),controller['update']);router['delete'](_0xe2dc('0xb'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x17')]);router['delete'](_0xe2dc('0xd'),auth[_0xe2dc('0x9')](),controller['removeSections']);router[_0xe2dc('0x18')](_0xe2dc('0xf'),auth[_0xe2dc('0x9')](),controller[_0xe2dc('0x19')]);module[_0xe2dc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index dc1a0a7..492108e 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 _0xd1c5=['join','getDataValue','BOOLEAN','exports','STRING','crudPermissions'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xd1c5,0xbd));var _0x5d1c=function(_0x22bb0b,_0x5c16b7){_0x22bb0b=_0x22bb0b-0x0;var _0x4bea1e=_0xd1c5[_0x22bb0b];return _0x4bea1e;};'use strict';var Sequelize=require('sequelize');module[_0x5d1c('0x0')]={'name':{'type':Sequelize[_0x5d1c('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x5d1c('0x1')],'set':function(_0xec2cbe){this['setDataValue'](_0x5d1c('0x2'),_0xec2cbe?_0xec2cbe[_0x5d1c('0x3')](''):[]);},'get':function(){return this[_0x5d1c('0x4')](_0x5d1c('0x2'))?this['getDataValue'](_0x5d1c('0x2'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5d1c('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd55f=['split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2cbf3d,_0x193da6){var _0x37776b=function(_0x3b7bdd){while(--_0x3b7bdd){_0x2cbf3d['push'](_0x2cbf3d['shift']());}};_0x37776b(++_0x193da6);}(_0xd55f,0x122));var _0xfd55=function(_0x42ed67,_0x3779de){_0x42ed67=_0x42ed67-0x0;var _0x49eee9=_0xd55f[_0x42ed67];return _0x49eee9;};'use strict';var Sequelize=require('sequelize');module[_0xfd55('0x0')]={'name':{'type':Sequelize[_0xfd55('0x1')],'allowNull':![],'unique':_0xfd55('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1ff32a){this[_0xfd55('0x3')](_0xfd55('0x4'),_0x1ff32a?_0x1ff32a[_0xfd55('0x5')](''):[]);},'get':function(){return this[_0xfd55('0x6')](_0xfd55('0x4'))?this[_0xfd55('0x6')](_0xfd55('0x4'))[_0xfd55('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xfd55('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xfd55('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xfd55('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xfd55('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfd55('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index dad6cfa..7dc10b3 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 _0x5b47=['update','destroy','then','error','stack','send','index','map','UserProfile','rawAttributes','type','model','name','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','fields','create','clone','find','get','createdAt','updatedAt','body','omit','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','catch','userProfileId','Resources','describe','addSections','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x80de21,_0xa4bcd7){var _0x116aae=function(_0x5a6d3c){while(--_0x5a6d3c){_0x80de21['push'](_0x80de21['shift']());}};_0x116aae(++_0xa4bcd7);}(_0x5b47,0x120));var _0x75b4=function(_0x49007e,_0x1fa49c){_0x49007e=_0x49007e-0x0;var _0xb5f5c4=_0x5b47[_0x49007e];return _0xb5f5c4;};'use strict';var emlformat=require(_0x75b4('0x0'));var rimraf=require(_0x75b4('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(_0x75b4('0x2'));var util=require(_0x75b4('0x3'));var path=require(_0x75b4('0x4'));var sox=require(_0x75b4('0x5'));var csv=require(_0x75b4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x75b4('0x7'));var crypto=require('crypto');var jsforce=require(_0x75b4('0x8'));var deskjs=require(_0x75b4('0x9'));var toCsv=require(_0x75b4('0x6'));var querystring=require(_0x75b4('0xa'));var Papa=require(_0x75b4('0xb'));var Redis=require(_0x75b4('0xc'));var authService=require(_0x75b4('0xd'));var qs=require(_0x75b4('0xe'));var as=require(_0x75b4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75b4('0x10'))('api');var utils=require(_0x75b4('0x11'));var config=require(_0x75b4('0x12'));var licenseUtil=require(_0x75b4('0x13'));var db=require(_0x75b4('0x14'))['db'];config[_0x75b4('0x15')]=_[_0x75b4('0x16')](config[_0x75b4('0x15')],{'host':_0x75b4('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x75b4('0x18')](socket);function respondWithStatusCode(_0x2bc1a7,_0x4e0545){_0x4e0545=_0x4e0545||0xcc;return function(_0x2782ea){if(_0x2782ea){return _0x2bc1a7[_0x75b4('0x19')](_0x4e0545);}return _0x2bc1a7[_0x75b4('0x1a')](_0x4e0545)['end']();};}function respondWithResult(_0x2cd583,_0x320a44){_0x320a44=_0x320a44||0xc8;return function(_0x5bf10b){if(_0x5bf10b){return _0x2cd583[_0x75b4('0x1a')](_0x320a44)['json'](_0x5bf10b);}};}function respondWithFilteredResult(_0xf3d73a,_0x1322b6){return function(_0x254063){if(_0x254063){var _0x7e396d=typeof _0x1322b6[_0x75b4('0x1b')]===_0x75b4('0x1c')&&typeof _0x1322b6[_0x75b4('0x1d')]===_0x75b4('0x1c');var _0x2fea13=_0x254063[_0x75b4('0x1e')];var _0x61d267=_0x7e396d?0x0:_0x1322b6[_0x75b4('0x1b')];var _0x34ecfe=_0x7e396d?_0x254063[_0x75b4('0x1e')]:_0x1322b6[_0x75b4('0x1b')]+_0x1322b6[_0x75b4('0x1d')];var _0x432a51;if(_0x34ecfe>=_0x2fea13){_0x34ecfe=_0x2fea13;_0x432a51=0xc8;}else{_0x432a51=0xce;}_0xf3d73a[_0x75b4('0x1a')](_0x432a51);return _0xf3d73a[_0x75b4('0x1f')](_0x75b4('0x20'),_0x61d267+'-'+_0x34ecfe+'/'+_0x2fea13)[_0x75b4('0x21')](_0x254063);}return null;};}function patchUpdates(_0x2f91a7){return function(_0x2e64ab){try{jsonpatch[_0x75b4('0x22')](_0x2e64ab,_0x2f91a7,!![]);}catch(_0x4beeff){return BPromise[_0x75b4('0x23')](_0x4beeff);}return _0x2e64ab['save']();};}function saveUpdates(_0x16348b,_0x1fbb55){return function(_0x9a04e){if(_0x9a04e){return _0x9a04e[_0x75b4('0x24')](_0x16348b)['then'](function(_0x5e0b93){return _0x5e0b93;});}return null;};}function removeEntity(_0x1644d6,_0x3c526d){return function(_0x4e9bfe){if(_0x4e9bfe){return _0x4e9bfe[_0x75b4('0x25')]()[_0x75b4('0x26')](function(){_0x1644d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x125c43,_0x219e22){return function(_0x5c57c8){if(!_0x5c57c8){_0x125c43[_0x75b4('0x19')](0x194);}return _0x5c57c8;};}function handleError(_0x314c54,_0x1b1e1e){_0x1b1e1e=_0x1b1e1e||0x1f4;return function(_0x3fc275){logger[_0x75b4('0x27')](_0x3fc275[_0x75b4('0x28')]);if(_0x3fc275['name']){delete _0x3fc275['name'];}_0x314c54[_0x75b4('0x1a')](_0x1b1e1e)[_0x75b4('0x29')](_0x3fc275);};}exports[_0x75b4('0x2a')]=function(_0x476e67,_0x477c6a){var _0x228d17={},_0x398269={},_0x4bdbac={'count':0x0,'rows':[]};var _0x2912c4=_[_0x75b4('0x2b')](db[_0x75b4('0x2c')][_0x75b4('0x2d')],function(_0x9d4514){return{'name':_0x9d4514['fieldName'],'type':_0x9d4514[_0x75b4('0x2e')]['key']};});_0x398269[_0x75b4('0x2f')]=_[_0x75b4('0x2b')](_0x2912c4,_0x75b4('0x30'));_0x398269[_0x75b4('0x31')]=_[_0x75b4('0x32')](_0x476e67[_0x75b4('0x31')]);_0x398269['filters']=_[_0x75b4('0x33')](_0x398269['model'],_0x398269['query']);_0x228d17['attributes']=_[_0x75b4('0x33')](_0x398269[_0x75b4('0x2f')],qs['fields'](_0x476e67['query']['fields']));_0x228d17['attributes']=_0x228d17[_0x75b4('0x34')][_0x75b4('0x35')]?_0x228d17['attributes']:_0x398269[_0x75b4('0x2f')];if(!_0x476e67[_0x75b4('0x31')][_0x75b4('0x36')](_0x75b4('0x37'))){_0x228d17[_0x75b4('0x1d')]=qs['limit'](_0x476e67[_0x75b4('0x31')][_0x75b4('0x1d')]);_0x228d17[_0x75b4('0x1b')]=qs[_0x75b4('0x1b')](_0x476e67[_0x75b4('0x31')][_0x75b4('0x1b')]);}_0x228d17[_0x75b4('0x38')]=qs[_0x75b4('0x39')](_0x476e67[_0x75b4('0x31')]['sort']);_0x228d17[_0x75b4('0x3a')]=qs[_0x75b4('0x3b')](_[_0x75b4('0x3c')](_0x476e67[_0x75b4('0x31')],_0x398269[_0x75b4('0x3b')]),_0x2912c4);if(_0x476e67['query'][_0x75b4('0x3d')]){_0x228d17[_0x75b4('0x3a')]=_['merge'](_0x228d17[_0x75b4('0x3a')],{'$or':_['map'](_0x2912c4,function(_0x1434c8){if(_0x1434c8[_0x75b4('0x2e')]!==_0x75b4('0x3e')){var _0x53928f={};_0x53928f[_0x1434c8[_0x75b4('0x30')]]={'$like':'%'+_0x476e67['query'][_0x75b4('0x3d')]+'%'};return _0x53928f;}})});}_0x228d17=_[_0x75b4('0x3f')]({},_0x228d17,_0x476e67[_0x75b4('0x40')]);var _0x2e73a2={'where':_0x228d17[_0x75b4('0x3a')]};return db[_0x75b4('0x2c')][_0x75b4('0x1e')](_0x2e73a2)[_0x75b4('0x26')](function(_0x55415c){_0x4bdbac['count']=_0x55415c;if(_0x476e67['query'][_0x75b4('0x41')]){_0x228d17[_0x75b4('0x42')]=[{'all':!![]}];}return db[_0x75b4('0x2c')][_0x75b4('0x43')](_0x228d17);})[_0x75b4('0x26')](function(_0x273b2e){_0x4bdbac['rows']=_0x273b2e;return _0x4bdbac;})[_0x75b4('0x26')](respondWithFilteredResult(_0x477c6a,_0x228d17))['catch'](handleError(_0x477c6a,null));};exports['show']=function(_0x37aa0c,_0x2b0edd){var _0x2451a1={'raw':![],'where':{'id':_0x37aa0c[_0x75b4('0x44')]['id']}},_0x160a7c={};_0x160a7c[_0x75b4('0x2f')]=_['keys'](db[_0x75b4('0x2c')][_0x75b4('0x2d')]);_0x160a7c['query']=_[_0x75b4('0x32')](_0x37aa0c[_0x75b4('0x31')]);_0x160a7c[_0x75b4('0x3b')]=_[_0x75b4('0x33')](_0x160a7c[_0x75b4('0x2f')],_0x160a7c[_0x75b4('0x31')]);_0x2451a1[_0x75b4('0x34')]=_[_0x75b4('0x33')](_0x160a7c['model'],qs[_0x75b4('0x45')](_0x37aa0c[_0x75b4('0x31')][_0x75b4('0x45')]));_0x2451a1['attributes']=_0x2451a1['attributes']['length']?_0x2451a1['attributes']:_0x160a7c[_0x75b4('0x2f')];if(_0x37aa0c['query'][_0x75b4('0x41')]){_0x2451a1[_0x75b4('0x42')]=[{'all':!![]}];}_0x2451a1=_['merge']({},_0x2451a1,_0x37aa0c[_0x75b4('0x40')]);return db[_0x75b4('0x2c')]['find'](_0x2451a1)['then'](handleEntityNotFound(_0x2b0edd,null))['then'](respondWithResult(_0x2b0edd,null))['catch'](handleError(_0x2b0edd,null));};exports[_0x75b4('0x46')]=function(_0xe8b3d4,_0x267824){return db['UserProfile'][_0x75b4('0x46')](_0xe8b3d4['body'],{})[_0x75b4('0x26')](respondWithResult(_0x267824,0xc9))['catch'](handleError(_0x267824,null));};exports[_0x75b4('0x47')]=function(_0x452b60,_0x2e491a){var _0x5c2732={'where':{'id':_0x452b60[_0x75b4('0x44')]['id']}},_0x14e95c={};_0x14e95c[_0x75b4('0x2f')]=_[_0x75b4('0x32')](db[_0x75b4('0x2c')]['rawAttributes']);_0x5c2732[_0x75b4('0x34')]=_['intersection'](_0x14e95c[_0x75b4('0x2f')],qs['fields'](_0x452b60[_0x75b4('0x31')][_0x75b4('0x45')]));_0x5c2732[_0x75b4('0x34')]=_0x5c2732[_0x75b4('0x34')]['length']?_0x5c2732[_0x75b4('0x34')]:_0x14e95c[_0x75b4('0x2f')];if(_0x452b60[_0x75b4('0x31')][_0x75b4('0x41')]){_0x5c2732[_0x75b4('0x42')]=[{'all':!![]}];}_0x5c2732=_[_0x75b4('0x3f')]({},_0x5c2732,_0x452b60[_0x75b4('0x40')]);return db[_0x75b4('0x2c')][_0x75b4('0x48')](_0x5c2732)[_0x75b4('0x26')](handleEntityNotFound(_0x2e491a,null))[_0x75b4('0x26')](function(_0x3901bd){if(_0x3901bd){var _0x5604b8=_0x3901bd[_0x75b4('0x49')]({'plain':!![]});_0x5604b8=qs['omit'](_0x5604b8,['id',_0x75b4('0x4a'),_0x75b4('0x4b'),'crudPermissions']);_0x452b60[_0x75b4('0x4c')]=_[_0x75b4('0x4d')](_0x452b60[_0x75b4('0x4c')],['id',_0x75b4('0x4a'),_0x75b4('0x4b')]);return db[_0x75b4('0x4e')]['transaction'](function(_0x267122){return db['UserProfile'][_0x75b4('0x46')](_[_0x75b4('0x3f')](_0x5604b8,_0x452b60[_0x75b4('0x4c')]),{'include':_0x452b60[_0x75b4('0x31')][_0x75b4('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x267122})[_0x75b4('0x26')](function(_0xbbb9d8){var _0x5f319f=_0xbbb9d8[_0x75b4('0x49')]({'plain':!![]});return db[_0x75b4('0x4f')][_0x75b4('0x43')]({'where':{'userProfileId':_0x452b60[_0x75b4('0x44')]['id']},'raw':!![]})['then'](function(_0xe2a62d){if(_0xe2a62d){return BPromise[_0x75b4('0x50')](_0xe2a62d,function(_0x84a82c){return new BPromise(function(_0x14ba6f,_0x14890b){if(_0x84a82c[_0x75b4('0x51')]===null||_0x84a82c['autoAssociation']===0x1)_0x14ba6f(null);return db[_0x75b4('0x52')][_0x75b4('0x43')]({'where':{'sectionId':_0x84a82c['id']},'raw':!![]})[_0x75b4('0x26')](function(_0x1911c2){var _0x2957bc=_[_0x75b4('0x2b')](_0x1911c2,function(_0x4b9d42){return qs[_0x75b4('0x4d')](_0x4b9d42,['id',_0x75b4('0x4a'),'updatedAt',_0x75b4('0x53')]);});_0x14ba6f(_0x2957bc);})[_0x75b4('0x54')](function(_0x515da6){_0x14890b(_0x515da6);});})[_0x75b4('0x26')](function(_0x1df756){var _0x5ccde1=qs[_0x75b4('0x4d')](_0x84a82c,['id',_0x75b4('0x4a'),'updatedAt']);_0x5ccde1[_0x75b4('0x55')]=_0x5f319f['id'];if(_0x1df756)_0x5ccde1[_0x75b4('0x56')]=_0x1df756;return _0x5ccde1;})[_0x75b4('0x26')](function(_0x57fa48){return db[_0x75b4('0x4f')][_0x75b4('0x46')](_0x57fa48,{'include':[{'model':db['UserProfileResource'],'as':_0x75b4('0x56')}],'raw':!![],'transaction':_0x267122});});})[_0x75b4('0x26')](function(){return _0x5f319f;});}});});});}})[_0x75b4('0x26')](respondWithResult(_0x2e491a,0xc9))['catch'](handleError(_0x2e491a,null));};exports[_0x75b4('0x24')]=function(_0x290cb5,_0x66c102){if(_0x290cb5[_0x75b4('0x4c')]['id']){delete _0x290cb5[_0x75b4('0x4c')]['id'];}return db[_0x75b4('0x2c')]['find']({'where':{'id':_0x290cb5[_0x75b4('0x44')]['id']}})[_0x75b4('0x26')](handleEntityNotFound(_0x66c102,null))['then'](saveUpdates(_0x290cb5[_0x75b4('0x4c')],null))[_0x75b4('0x26')](respondWithResult(_0x66c102,null))[_0x75b4('0x54')](handleError(_0x66c102,null));};exports[_0x75b4('0x25')]=function(_0x706070,_0x23a399){return db[_0x75b4('0x2c')]['find']({'where':{'id':_0x706070[_0x75b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a399,null))[_0x75b4('0x26')](removeEntity(_0x23a399,null))['catch'](handleError(_0x23a399,null));};exports[_0x75b4('0x57')]=function(_0x347591,_0x4e408a){return db[_0x75b4('0x2c')][_0x75b4('0x57')]()[_0x75b4('0x26')](respondWithResult(_0x4e408a,null))[_0x75b4('0x54')](handleError(_0x4e408a,null));};exports[_0x75b4('0x58')]=function(_0x5edeb1,_0x41289c){var _0xbb2b96=_0x5edeb1['body'];return db[_0x75b4('0x2c')][_0x75b4('0x48')]({'where':{'id':_0x5edeb1[_0x75b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x41289c,null))[_0x75b4('0x26')](function(_0x4ed4ec){if(_0x4ed4ec){return db[_0x75b4('0x4e')]['transaction'](function(_0x1d16aa){return db['UserProfileSection'][_0x75b4('0x25')]({'where':{'userProfileId':_0x5edeb1[_0x75b4('0x44')]['id'],'sectionId':_[_0x75b4('0x2b')](_0xbb2b96,function(_0x53d0d1){return _0x53d0d1[_0x75b4('0x53')];})},'transaction':_0x1d16aa})[_0x75b4('0x26')](function(){var _0x441d0b=_[_0x75b4('0x2b')](_0xbb2b96,function(_0x5333fc){_0x5333fc['userProfileId']=_0x5edeb1['params']['id'];return _0x5333fc;});var _0x5f2f5d=[];return BPromise[_0x75b4('0x50')](_0x441d0b,function(_0x4b573d){return db['UserProfileSection']['create'](_0x4b573d,{'include':[{'model':db['UserProfileResource'],'as':_0x75b4('0x56')}],'raw':!![],'transaction':_0x1d16aa})['then'](function(_0x236692){_0x5f2f5d['push'](_0x236692['get']({'plain':!![]}));});})['then'](function(){return _0x5f2f5d;});});});}})['then'](function(_0x405a6d){return _0x405a6d;})[_0x75b4('0x26')](respondWithResult(_0x41289c,null))[_0x75b4('0x54')](handleError(_0x41289c,null));};exports[_0x75b4('0x59')]=function(_0x2c81b2,_0x362fc2){var _0x19c6ea;return db[_0x75b4('0x2c')][_0x75b4('0x48')]({'where':{'id':_0x2c81b2[_0x75b4('0x44')]['id']},'attributes':['id',_0x75b4('0x30')]})[_0x75b4('0x26')](handleEntityNotFound(_0x362fc2,null))[_0x75b4('0x26')](function(_0x16c2ae){if(_0x16c2ae){_0x19c6ea=_0x16c2ae;return db[_0x75b4('0x4f')][_0x75b4('0x25')]({'where':{'userProfileId':_0x2c81b2[_0x75b4('0x44')]['id'],'sectionId':_0x2c81b2[_0x75b4('0x31')][_0x75b4('0x5a')]}});}})[_0x75b4('0x26')](function(){return _0x19c6ea;})[_0x75b4('0x26')](respondWithStatusCode(_0x362fc2,null))['catch'](handleError(_0x362fc2,null));};exports[_0x75b4('0x5b')]=function(_0x44228c,_0x5d608c){var _0x342b20=[];var _0x117881=[];return db[_0x75b4('0x4f')][_0x75b4('0x43')]({'where':{'userProfileId':_0x44228c[_0x75b4('0x44')]['id']},'raw':!![]})['then'](function(_0x3689b1){_0x342b20=_[_0x75b4('0x3d')](_0x3689b1,function(_0x5e0be8){return _0x5e0be8[_0x75b4('0x5c')]===0x1||_[_0x75b4('0x5d')]([0x3eb,0x709],_0x5e0be8[_0x75b4('0x53')]);});if(!_[_0x75b4('0x5e')](_0x342b20)){return _[_0x75b4('0x2b')](_0x342b20,function(_0x9d93d5){return _0x9d93d5['sectionId'];});}else{return;}})['then'](function(_0x3f34dc){if(_0x3f34dc)_0x117881=_0x3f34dc;if(_[_0x75b4('0x5d')](_0x117881,0x64)){var _0x21e939=_[_0x75b4('0x48')](_0x342b20,{'sectionId':0x64});return hasDefaultDashboard(_0x21e939)[_0x75b4('0x26')](function(_0xea4f6){return _[_0x75b4('0x2b')](_0x342b20,function(_0x381291){if(_0x381291[_0x75b4('0x53')]===0x64){_0x381291[_0x75b4('0x5f')]=_0xea4f6;}return _0x381291;});});}else{return;}})[_0x75b4('0x26')](function(_0x2d8fcb){if(_0x2d8fcb)_0x342b20=_0x2d8fcb;if(_[_0x75b4('0x5d')](_0x117881,0x3eb)){var _0x466dfd=_[_0x75b4('0x48')](_0x342b20,{'sectionId':0x3eb});return getCustomDashboards(_0x466dfd)['then'](function(_0x177fc7){return _[_0x75b4('0x2b')](_0x342b20,function(_0x41b598){if(_0x466dfd[_0x75b4('0x5c')]){if(_0x41b598[_0x75b4('0x53')]===0x3eb){_0x41b598[_0x75b4('0x5f')]=_0x177fc7;}}else{if(_0x41b598[_0x75b4('0x53')]===0x64){_0x41b598[_0x75b4('0x5f')]=_0x177fc7;}}return _0x41b598;});});}else{return;}})[_0x75b4('0x26')](function(_0x39b48c){if(_0x39b48c)_0x342b20=_0x39b48c;if(_[_0x75b4('0x5d')](_0x117881,0x709)){var _0x36c73c=_['find'](_0x342b20,{'sectionId':0x709});return getPlugins(_0x36c73c)['then'](function(_0x61ec64){if(_0x36c73c[_0x75b4('0x5c')]){return _[_0x75b4('0x2b')](_0x342b20,function(_0x58c9d6){if(_0x58c9d6[_0x75b4('0x53')]===0x709){_0x58c9d6['subsections']=_0x61ec64;}return _0x58c9d6;});}else{var _0x483a22={'sectionId':0x76c,'enabled':0x1,'subsections':_0x61ec64};var _0x552e4c=_[_0x75b4('0x2b')](_0x342b20);_0x552e4c[_0x75b4('0x60')](_0x483a22);return _0x552e4c;}});}else{return;}})[_0x75b4('0x26')](function(_0x1ed692){if(_0x1ed692)_0x342b20=_0x1ed692;return _['filter'](_0x342b20,['enabled',0x1]);})[_0x75b4('0x26')](respondWithResult(_0x5d608c,null))['catch'](handleError(_0x5d608c,null));};function hasDefaultDashboard(_0x5a4f75){var _0x3087ce=[0x65];return new BPromise(function(_0x205d78,_0x25f406){try{if(_0x5a4f75['autoAssociation']){_0x205d78(_0x3087ce);}else{return db[_0x75b4('0x52')]['findOne']({'where':{'sectionId':_0x5a4f75['id']},'raw':!![]})[_0x75b4('0x26')](function(_0x1846fe){_0x1846fe?_0x205d78(_0x3087ce):_0x205d78();});}}catch(_0x310f0a){_0x25f406(_0x310f0a);}});}function getCustomDashboards(_0x1bd4ce){var _0x54916f=[];return new BPromise(function(_0x5e621b,_0x5065ee){try{if(_0x1bd4ce[_0x75b4('0x51')]){return db[_0x75b4('0x61')][_0x75b4('0x43')]({'raw':!![]})[_0x75b4('0x26')](function(_0xa251d3){_0xa251d3[_0x75b4('0x62')](function(_0x33de03){_0x54916f['push'](_0x33de03['id']+0x1869f);});_0x5e621b(_0x54916f);});}else{return db[_0x75b4('0x52')][_0x75b4('0x43')]({'where':{'sectionId':_0x1bd4ce['id']},'raw':!![]})['then'](function(_0x152c15){_0x152c15[_0x75b4('0x62')](function(_0x2246fc){_0x54916f['push'](_0x2246fc[_0x75b4('0x63')]+0x1869f);});_0x5e621b(_0x54916f);});}}catch(_0x180fea){_0x5065ee(_0x180fea);}});}function getPlugins(_0x859adb){var _0x121920=[];return new BPromise(function(_0x45e32c,_0x878bc8){try{if(_0x859adb['autoAssociation']){return db[_0x75b4('0x64')]['findAll']({'raw':!![]})[_0x75b4('0x26')](function(_0x53229c){_0x53229c[_0x75b4('0x62')](function(_0x27dfff){_0x121920[_0x75b4('0x60')](_0x27dfff['id']+0x15b38);});_0x45e32c(_0x121920);});}else{return db[_0x75b4('0x52')][_0x75b4('0x43')]({'where':{'sectionId':_0x859adb['id']},'raw':!![]})[_0x75b4('0x26')](function(_0xc6e033){_0xc6e033['forEach'](function(_0x2338bc){_0x121920[_0x75b4('0x60')](_0x2338bc[_0x75b4('0x63')]+0x15b38);});_0x45e32c(_0x121920);});}}catch(_0x5d4632){_0x878bc8(_0x5d4632);}});}exports[_0x75b4('0x65')]=function(_0x3ff918,_0x3289a9){return db[_0x75b4('0x2c')][_0x75b4('0x48')]({'where':{'id':_0x3ff918[_0x75b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x3289a9,null))[_0x75b4('0x26')](function(_0x298651){if(_0x298651){return db['sequelize']['transaction'](function(_0x15b290){return db[_0x75b4('0x4f')][_0x75b4('0x43')]({'where':{'userProfileId':_0x3ff918[_0x75b4('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x75b4('0x26')](function(_0x3deaab){if(_0x3deaab){return db[_0x75b4('0x4f')][_0x75b4('0x25')]({'where':{'userProfileId':_0x3ff918['params']['id'],'id':_[_0x75b4('0x2b')](_0x3deaab,function(_0x225605){return _0x225605['id'];})},'transaction':_0x15b290});}})[_0x75b4('0x26')](function(_0x1dfafb){var _0x2f4b0a=_[_0x75b4('0x2b')](_0x3ff918['body'],function(_0x17adef){_0x17adef[_0x75b4('0x55')]=_0x3ff918[_0x75b4('0x44')]['id'];return _0x17adef;});return db[_0x75b4('0x4f')][_0x75b4('0x66')](_0x2f4b0a,{'raw':!![],'transaction':_0x15b290});})['then'](function(_0x4d16fc){var _0x3b917e=_['filter'](_[_0x75b4('0x2b')](_0x4d16fc,function(_0x1c294a){return _0x1c294a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x3b917e){return db['UserProfileSection'][_0x75b4('0x43')]({'where':{'userProfileId':_0x3ff918[_0x75b4('0x44')]['id'],'sectionId':_[_0x75b4('0x2b')](_0x3b917e,function(_0x1edda2){return _0x1edda2[_0x75b4('0x53')];})},'attributes':['id',_0x75b4('0x53')],'raw':!![]})['then'](function(_0x2c2b3d){var _0xe4f0a9=_[_0x75b4('0x2b')](_0x3ff918[_0x75b4('0x4c')],function(_0x75423d){_0x75423d[_0x75b4('0x55')]=_0x3ff918['params']['id'];return _0x75423d;});return db['UserProfileResource']['bulkCreate'](_0xe4f0a9,{'raw':!![],'transaction':_0x15b290});});}})[_0x75b4('0x54')](handleError(_0x3289a9,null));});}})[_0x75b4('0x26')](function(_0x4b9a67){var _0x2ff0b9=_[_0x75b4('0x2b')](_0x4b9a67,function(_0x3d823b){return _0x3d823b[_0x75b4('0x49')]({'plain':!![]});});})[_0x75b4('0x26')](respondWithResult(_0x3289a9,null))['catch'](handleError(_0x3289a9,null));};exports[_0x75b4('0x67')]=function(_0x38ab77,_0x10969c,_0x56c0da){return db[_0x75b4('0x2c')][_0x75b4('0x48')]({'where':{'id':_0x38ab77[_0x75b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x10969c,null))['then'](function(_0x182c65){if(_0x182c65){return _0x182c65[_0x75b4('0x67')](_0x38ab77[_0x75b4('0x31')][_0x75b4('0x5a')]);}})['then'](respondWithStatusCode(_0x10969c,null))['catch'](handleError(_0x10969c,null));};exports['getResources']=function(_0x54e0f4,_0x403996){var _0x3c930d={};if(!_0x54e0f4[_0x75b4('0x31')][_0x75b4('0x68')])throw new Error(_0x75b4('0x69'));if(!_0x54e0f4['query']['hasOwnProperty'](_0x75b4('0x37'))){_0x3c930d[_0x75b4('0x1d')]=qs[_0x75b4('0x1d')](_0x54e0f4[_0x75b4('0x31')]['limit']);_0x3c930d[_0x75b4('0x1b')]=qs[_0x75b4('0x1b')](_0x54e0f4['query']['offset']);}return db[_0x75b4('0x2c')][_0x75b4('0x48')]({'where':{'id':_0x54e0f4['params']['id']}})['then'](function(_0x32ef69){if(!_0x32ef69)throw new Error(_0x75b4('0x6a')+_0x54e0f4['params']['id']);return db[_0x75b4('0x2c')][_0x75b4('0x6b')](_0x54e0f4);})[_0x75b4('0x26')](respondWithFilteredResult(_0x403996,_0x3c930d))['catch'](handleError(_0x403996,null));}; \ No newline at end of file +var _0x6fad=['sequelize','transaction','get','UserProfileSection','autoAssociation','userProfileId','UserProfileResource','destroy','addSections','sectionId','each','Resources','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','options','UserProfile','includeAll','findAll','rows','show','params','keys','include','merge','find','create','body','catch','length','omit','createdAt','updatedAt','crudPermissions'];(function(_0x561198,_0x243836){var _0x23da36=function(_0x413d05){while(--_0x413d05){_0x561198['push'](_0x561198['shift']());}};_0x23da36(++_0x243836);}(_0x6fad,0x17a));var _0xd6fa=function(_0x18e49a,_0x5bf163){_0x18e49a=_0x18e49a-0x0;var _0x1397b5=_0x6fad[_0x18e49a];return _0x1397b5;};'use strict';var emlformat=require(_0xd6fa('0x0'));var rimraf=require(_0xd6fa('0x1'));var zipdir=require(_0xd6fa('0x2'));var jsonpatch=require(_0xd6fa('0x3'));var rp=require(_0xd6fa('0x4'));var moment=require('moment');var BPromise=require(_0xd6fa('0x5'));var Mustache=require('mustache');var util=require(_0xd6fa('0x6'));var path=require('path');var sox=require(_0xd6fa('0x7'));var csv=require('to-csv');var ejs=require(_0xd6fa('0x8'));var fs=require('fs');var fs_extra=require(_0xd6fa('0x9'));var _=require(_0xd6fa('0xa'));var squel=require(_0xd6fa('0xb'));var crypto=require(_0xd6fa('0xc'));var jsforce=require(_0xd6fa('0xd'));var deskjs=require(_0xd6fa('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd6fa('0xf'));var Papa=require('papaparse');var Redis=require(_0xd6fa('0x10'));var authService=require(_0xd6fa('0x11'));var qs=require(_0xd6fa('0x12'));var as=require(_0xd6fa('0x13'));var hardwareService=require(_0xd6fa('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd6fa('0x15'));var config=require(_0xd6fa('0x16'));var licenseUtil=require(_0xd6fa('0x17'));var db=require('../../mysqldb')['db'];config[_0xd6fa('0x18')]=_[_0xd6fa('0x19')](config[_0xd6fa('0x18')],{'host':_0xd6fa('0x1a'),'port':0x18eb});var socket=require(_0xd6fa('0x1b'))(new Redis(config[_0xd6fa('0x18')]));require(_0xd6fa('0x1c'))['register'](socket);function respondWithStatusCode(_0x225332,_0x54dd76){_0x54dd76=_0x54dd76||0xcc;return function(_0x4a114b){if(_0x4a114b){return _0x225332[_0xd6fa('0x1d')](_0x54dd76);}return _0x225332[_0xd6fa('0x1e')](_0x54dd76)['end']();};}function respondWithResult(_0x1b25b3,_0x1d7bfc){_0x1d7bfc=_0x1d7bfc||0xc8;return function(_0x554bae){if(_0x554bae){return _0x1b25b3[_0xd6fa('0x1e')](_0x1d7bfc)[_0xd6fa('0x1f')](_0x554bae);}};}function respondWithFilteredResult(_0x11c3f3,_0x4868f3){return function(_0x376cd8){if(_0x376cd8){var _0x5a324d=typeof _0x4868f3[_0xd6fa('0x20')]===_0xd6fa('0x21')&&typeof _0x4868f3[_0xd6fa('0x22')]===_0xd6fa('0x21');var _0x34490c=_0x376cd8[_0xd6fa('0x23')];var _0x4e23e6=_0x5a324d?0x0:_0x4868f3['offset'];var _0x45ebf9=_0x5a324d?_0x376cd8[_0xd6fa('0x23')]:_0x4868f3['offset']+_0x4868f3['limit'];var _0x3683c2;if(_0x45ebf9>=_0x34490c){_0x45ebf9=_0x34490c;_0x3683c2=0xc8;}else{_0x3683c2=0xce;}_0x11c3f3[_0xd6fa('0x1e')](_0x3683c2);return _0x11c3f3[_0xd6fa('0x24')]('Content-Range',_0x4e23e6+'-'+_0x45ebf9+'/'+_0x34490c)[_0xd6fa('0x1f')](_0x376cd8);}return null;};}function patchUpdates(_0x4bab05){return function(_0x1bd7a4){try{jsonpatch[_0xd6fa('0x25')](_0x1bd7a4,_0x4bab05,!![]);}catch(_0x239e56){return BPromise[_0xd6fa('0x26')](_0x239e56);}return _0x1bd7a4[_0xd6fa('0x27')]();};}function saveUpdates(_0x456e0a,_0x7ec231){return function(_0x558f6a){if(_0x558f6a){return _0x558f6a['update'](_0x456e0a)['then'](function(_0xec9e94){return _0xec9e94;});}return null;};}function removeEntity(_0x48669c,_0x51a354){return function(_0xe5e709){if(_0xe5e709){return _0xe5e709['destroy']()[_0xd6fa('0x28')](function(){_0x48669c[_0xd6fa('0x1e')](0xcc)[_0xd6fa('0x29')]();});}};}function handleEntityNotFound(_0x504362,_0x8b3983){return function(_0x218d45){if(!_0x218d45){_0x504362['sendStatus'](0x194);}return _0x218d45;};}function handleError(_0x35521f,_0x17fc52){_0x17fc52=_0x17fc52||0x1f4;return function(_0x23c76c){logger[_0xd6fa('0x2a')](_0x23c76c[_0xd6fa('0x2b')]);if(_0x23c76c[_0xd6fa('0x2c')]){delete _0x23c76c[_0xd6fa('0x2c')];}_0x35521f[_0xd6fa('0x1e')](_0x17fc52)[_0xd6fa('0x2d')](_0x23c76c);};}exports[_0xd6fa('0x2e')]=function(_0x27ddf1,_0x31aa00){var _0x18f470={},_0x2d06b9={},_0x3ecefb={'count':0x0,'rows':[]};var _0x37a9df=_[_0xd6fa('0x2f')](db['UserProfile'][_0xd6fa('0x30')],function(_0x1d7d94){return{'name':_0x1d7d94[_0xd6fa('0x31')],'type':_0x1d7d94[_0xd6fa('0x32')]['key']};});_0x2d06b9['model']=_[_0xd6fa('0x2f')](_0x37a9df,'name');_0x2d06b9[_0xd6fa('0x33')]=_['keys'](_0x27ddf1['query']);_0x2d06b9[_0xd6fa('0x34')]=_[_0xd6fa('0x35')](_0x2d06b9['model'],_0x2d06b9[_0xd6fa('0x33')]);_0x18f470[_0xd6fa('0x36')]=_[_0xd6fa('0x35')](_0x2d06b9[_0xd6fa('0x37')],qs[_0xd6fa('0x38')](_0x27ddf1[_0xd6fa('0x33')][_0xd6fa('0x38')]));_0x18f470['attributes']=_0x18f470['attributes']['length']?_0x18f470[_0xd6fa('0x36')]:_0x2d06b9[_0xd6fa('0x37')];if(!_0x27ddf1[_0xd6fa('0x33')]['hasOwnProperty'](_0xd6fa('0x39'))){_0x18f470['limit']=qs[_0xd6fa('0x22')](_0x27ddf1['query'][_0xd6fa('0x22')]);_0x18f470[_0xd6fa('0x20')]=qs[_0xd6fa('0x20')](_0x27ddf1['query']['offset']);}_0x18f470[_0xd6fa('0x3a')]=qs[_0xd6fa('0x3b')](_0x27ddf1[_0xd6fa('0x33')][_0xd6fa('0x3b')]);_0x18f470[_0xd6fa('0x3c')]=qs[_0xd6fa('0x34')](_[_0xd6fa('0x3d')](_0x27ddf1[_0xd6fa('0x33')],_0x2d06b9[_0xd6fa('0x34')]),_0x37a9df);if(_0x27ddf1[_0xd6fa('0x33')][_0xd6fa('0x3e')]){_0x18f470[_0xd6fa('0x3c')]=_['merge'](_0x18f470[_0xd6fa('0x3c')],{'$or':_[_0xd6fa('0x2f')](_0x37a9df,function(_0x38c81a){if(_0x38c81a['type']!=='VIRTUAL'){var _0x538c07={};_0x538c07[_0x38c81a[_0xd6fa('0x2c')]]={'$like':'%'+_0x27ddf1[_0xd6fa('0x33')][_0xd6fa('0x3e')]+'%'};return _0x538c07;}})});}_0x18f470=_['merge']({},_0x18f470,_0x27ddf1[_0xd6fa('0x3f')]);var _0x1da4f5={'where':_0x18f470[_0xd6fa('0x3c')]};return db[_0xd6fa('0x40')][_0xd6fa('0x23')](_0x1da4f5)[_0xd6fa('0x28')](function(_0x12ccc2){_0x3ecefb[_0xd6fa('0x23')]=_0x12ccc2;if(_0x27ddf1['query'][_0xd6fa('0x41')]){_0x18f470['include']=[{'all':!![]}];}return db[_0xd6fa('0x40')][_0xd6fa('0x42')](_0x18f470);})[_0xd6fa('0x28')](function(_0x4ba055){_0x3ecefb[_0xd6fa('0x43')]=_0x4ba055;return _0x3ecefb;})[_0xd6fa('0x28')](respondWithFilteredResult(_0x31aa00,_0x18f470))['catch'](handleError(_0x31aa00,null));};exports[_0xd6fa('0x44')]=function(_0x124302,_0x4f3c41){var _0x4f7c48={'raw':![],'where':{'id':_0x124302[_0xd6fa('0x45')]['id']}},_0x36311a={};_0x36311a[_0xd6fa('0x37')]=_[_0xd6fa('0x46')](db[_0xd6fa('0x40')][_0xd6fa('0x30')]);_0x36311a[_0xd6fa('0x33')]=_[_0xd6fa('0x46')](_0x124302[_0xd6fa('0x33')]);_0x36311a['filters']=_[_0xd6fa('0x35')](_0x36311a[_0xd6fa('0x37')],_0x36311a['query']);_0x4f7c48[_0xd6fa('0x36')]=_[_0xd6fa('0x35')](_0x36311a['model'],qs[_0xd6fa('0x38')](_0x124302[_0xd6fa('0x33')][_0xd6fa('0x38')]));_0x4f7c48[_0xd6fa('0x36')]=_0x4f7c48['attributes']['length']?_0x4f7c48[_0xd6fa('0x36')]:_0x36311a[_0xd6fa('0x37')];if(_0x124302['query'][_0xd6fa('0x41')]){_0x4f7c48[_0xd6fa('0x47')]=[{'all':!![]}];}_0x4f7c48=_[_0xd6fa('0x48')]({},_0x4f7c48,_0x124302[_0xd6fa('0x3f')]);return db[_0xd6fa('0x40')][_0xd6fa('0x49')](_0x4f7c48)[_0xd6fa('0x28')](handleEntityNotFound(_0x4f3c41,null))['then'](respondWithResult(_0x4f3c41,null))['catch'](handleError(_0x4f3c41,null));};exports[_0xd6fa('0x4a')]=function(_0x2d8e77,_0x3a09e9){return db['UserProfile']['create'](_0x2d8e77[_0xd6fa('0x4b')],{})[_0xd6fa('0x28')](respondWithResult(_0x3a09e9,0xc9))[_0xd6fa('0x4c')](handleError(_0x3a09e9,null));};exports['clone']=function(_0x91e408,_0x4e9f81){var _0x41fc79={'where':{'id':_0x91e408[_0xd6fa('0x45')]['id']}},_0x283ee7={};_0x283ee7[_0xd6fa('0x37')]=_[_0xd6fa('0x46')](db[_0xd6fa('0x40')][_0xd6fa('0x30')]);_0x41fc79[_0xd6fa('0x36')]=_[_0xd6fa('0x35')](_0x283ee7[_0xd6fa('0x37')],qs['fields'](_0x91e408[_0xd6fa('0x33')][_0xd6fa('0x38')]));_0x41fc79[_0xd6fa('0x36')]=_0x41fc79[_0xd6fa('0x36')][_0xd6fa('0x4d')]?_0x41fc79[_0xd6fa('0x36')]:_0x283ee7['model'];if(_0x91e408[_0xd6fa('0x33')][_0xd6fa('0x41')]){_0x41fc79[_0xd6fa('0x47')]=[{'all':!![]}];}_0x41fc79=_['merge']({},_0x41fc79,_0x91e408[_0xd6fa('0x3f')]);return db[_0xd6fa('0x40')][_0xd6fa('0x49')](_0x41fc79)['then'](handleEntityNotFound(_0x4e9f81,null))[_0xd6fa('0x28')](function(_0xb59b56){if(_0xb59b56){var _0xd56f5d=_0xb59b56['get']({'plain':!![]});_0xd56f5d=qs[_0xd6fa('0x4e')](_0xd56f5d,['id',_0xd6fa('0x4f'),_0xd6fa('0x50'),_0xd6fa('0x51')]);_0x91e408[_0xd6fa('0x4b')]=_['omit'](_0x91e408[_0xd6fa('0x4b')],['id',_0xd6fa('0x4f'),_0xd6fa('0x50')]);return db[_0xd6fa('0x52')][_0xd6fa('0x53')](function(_0x144ae9){return db[_0xd6fa('0x40')][_0xd6fa('0x4a')](_[_0xd6fa('0x48')](_0xd56f5d,_0x91e408[_0xd6fa('0x4b')]),{'include':_0x91e408[_0xd6fa('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x144ae9})['then'](function(_0x2efe58){var _0x3cfee1=_0x2efe58[_0xd6fa('0x54')]({'plain':!![]});return db[_0xd6fa('0x55')][_0xd6fa('0x42')]({'where':{'userProfileId':_0x91e408[_0xd6fa('0x45')]['id']},'raw':!![]})['then'](function(_0x285e5e){if(_0x285e5e){return BPromise['each'](_0x285e5e,function(_0x3f305e){return new BPromise(function(_0x135900,_0x2263c8){if(_0x3f305e[_0xd6fa('0x56')]===null||_0x3f305e[_0xd6fa('0x56')]===0x1)_0x135900(null);return db['UserProfileResource'][_0xd6fa('0x42')]({'where':{'sectionId':_0x3f305e['id']},'raw':!![]})[_0xd6fa('0x28')](function(_0xba021d){var _0x1b7987=_[_0xd6fa('0x2f')](_0xba021d,function(_0x16009d){return qs[_0xd6fa('0x4e')](_0x16009d,['id','createdAt',_0xd6fa('0x50'),'sectionId']);});_0x135900(_0x1b7987);})[_0xd6fa('0x4c')](function(_0x1e60ae){_0x2263c8(_0x1e60ae);});})[_0xd6fa('0x28')](function(_0x3435fb){var _0x44c302=qs['omit'](_0x3f305e,['id',_0xd6fa('0x4f'),'updatedAt']);_0x44c302[_0xd6fa('0x57')]=_0x3cfee1['id'];if(_0x3435fb)_0x44c302['Resources']=_0x3435fb;return _0x44c302;})[_0xd6fa('0x28')](function(_0x1a1ffc){return db['UserProfileSection'][_0xd6fa('0x4a')](_0x1a1ffc,{'include':[{'model':db[_0xd6fa('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x144ae9});});})['then'](function(){return _0x3cfee1;});}});});});}})['then'](respondWithResult(_0x4e9f81,0xc9))['catch'](handleError(_0x4e9f81,null));};exports['update']=function(_0x2b6d3e,_0xaac970){if(_0x2b6d3e[_0xd6fa('0x4b')]['id']){delete _0x2b6d3e[_0xd6fa('0x4b')]['id'];}return db['UserProfile'][_0xd6fa('0x49')]({'where':{'id':_0x2b6d3e['params']['id']}})['then'](handleEntityNotFound(_0xaac970,null))[_0xd6fa('0x28')](saveUpdates(_0x2b6d3e[_0xd6fa('0x4b')],null))[_0xd6fa('0x28')](respondWithResult(_0xaac970,null))['catch'](handleError(_0xaac970,null));};exports[_0xd6fa('0x59')]=function(_0x1e43b8,_0x41815b){return db[_0xd6fa('0x40')]['find']({'where':{'id':_0x1e43b8[_0xd6fa('0x45')]['id']}})[_0xd6fa('0x28')](handleEntityNotFound(_0x41815b,null))[_0xd6fa('0x28')](removeEntity(_0x41815b,null))[_0xd6fa('0x4c')](handleError(_0x41815b,null));};exports['describe']=function(_0x586be2,_0x22c51d){return db[_0xd6fa('0x40')]['describe']()[_0xd6fa('0x28')](respondWithResult(_0x22c51d,null))['catch'](handleError(_0x22c51d,null));};exports[_0xd6fa('0x5a')]=function(_0x3c9c94,_0x46326f){var _0x1ebaff=_0x3c9c94['body'];return db[_0xd6fa('0x40')]['find']({'where':{'id':_0x3c9c94['params']['id']}})[_0xd6fa('0x28')](handleEntityNotFound(_0x46326f,null))[_0xd6fa('0x28')](function(_0x271498){if(_0x271498){return db[_0xd6fa('0x52')]['transaction'](function(_0xed7f2f){return db[_0xd6fa('0x55')]['destroy']({'where':{'userProfileId':_0x3c9c94[_0xd6fa('0x45')]['id'],'sectionId':_[_0xd6fa('0x2f')](_0x1ebaff,function(_0x17d1fb){return _0x17d1fb[_0xd6fa('0x5b')];})},'transaction':_0xed7f2f})[_0xd6fa('0x28')](function(){var _0x1d8705=_[_0xd6fa('0x2f')](_0x1ebaff,function(_0x458493){_0x458493[_0xd6fa('0x57')]=_0x3c9c94['params']['id'];return _0x458493;});var _0x5dd429=[];return BPromise[_0xd6fa('0x5c')](_0x1d8705,function(_0x5a9d1c){return db[_0xd6fa('0x55')]['create'](_0x5a9d1c,{'include':[{'model':db[_0xd6fa('0x58')],'as':_0xd6fa('0x5d')}],'raw':!![],'transaction':_0xed7f2f})[_0xd6fa('0x28')](function(_0x4bb197){_0x5dd429[_0xd6fa('0x5e')](_0x4bb197[_0xd6fa('0x54')]({'plain':!![]}));});})['then'](function(){return _0x5dd429;});});});}})[_0xd6fa('0x28')](function(_0x364845){return _0x364845;})[_0xd6fa('0x28')](respondWithResult(_0x46326f,null))[_0xd6fa('0x4c')](handleError(_0x46326f,null));};exports[_0xd6fa('0x5f')]=function(_0x3ffaca,_0xf4584a){var _0x10f30e;return db[_0xd6fa('0x40')][_0xd6fa('0x49')]({'where':{'id':_0x3ffaca[_0xd6fa('0x45')]['id']},'attributes':['id',_0xd6fa('0x2c')]})[_0xd6fa('0x28')](handleEntityNotFound(_0xf4584a,null))[_0xd6fa('0x28')](function(_0x412cad){if(_0x412cad){_0x10f30e=_0x412cad;return db[_0xd6fa('0x55')]['destroy']({'where':{'userProfileId':_0x3ffaca[_0xd6fa('0x45')]['id'],'sectionId':_0x3ffaca['query'][_0xd6fa('0x60')]}});}})[_0xd6fa('0x28')](function(){return _0x10f30e;})[_0xd6fa('0x28')](respondWithStatusCode(_0xf4584a,null))[_0xd6fa('0x4c')](handleError(_0xf4584a,null));};exports[_0xd6fa('0x61')]=function(_0x46b4fd,_0x257b44){var _0x34d2a7=[];var _0x5b78e3=[];return db[_0xd6fa('0x55')][_0xd6fa('0x42')]({'where':{'userProfileId':_0x46b4fd[_0xd6fa('0x45')]['id']},'raw':!![]})[_0xd6fa('0x28')](function(_0x33889f){_0x34d2a7=_[_0xd6fa('0x3e')](_0x33889f,function(_0x3e8d00){return _0x3e8d00[_0xd6fa('0x62')]===0x1||_[_0xd6fa('0x63')]([0x3eb,0x709],_0x3e8d00[_0xd6fa('0x5b')]);});if(!_[_0xd6fa('0x64')](_0x34d2a7)){return _[_0xd6fa('0x2f')](_0x34d2a7,function(_0x2d0d77){return _0x2d0d77[_0xd6fa('0x5b')];});}else{return;}})[_0xd6fa('0x28')](function(_0x10051b){if(_0x10051b)_0x5b78e3=_0x10051b;if(_[_0xd6fa('0x63')](_0x5b78e3,0x64)){var _0x3ece86=_[_0xd6fa('0x49')](_0x34d2a7,{'sectionId':0x64});return hasDefaultDashboard(_0x3ece86)[_0xd6fa('0x28')](function(_0x3df9d2){return _['map'](_0x34d2a7,function(_0x4e2c31){if(_0x4e2c31[_0xd6fa('0x5b')]===0x64){_0x4e2c31[_0xd6fa('0x65')]=_0x3df9d2;}return _0x4e2c31;});});}else{return;}})['then'](function(_0x2463c3){if(_0x2463c3)_0x34d2a7=_0x2463c3;if(_[_0xd6fa('0x63')](_0x5b78e3,0x3eb)){var _0x44436f=_[_0xd6fa('0x49')](_0x34d2a7,{'sectionId':0x3eb});return getCustomDashboards(_0x44436f)['then'](function(_0x5f4a53){return _[_0xd6fa('0x2f')](_0x34d2a7,function(_0x3d850d){if(_0x44436f['enabled']){if(_0x3d850d['sectionId']===0x3eb){_0x3d850d[_0xd6fa('0x65')]=_0x5f4a53;}}else{if(_0x3d850d[_0xd6fa('0x5b')]===0x64){_0x3d850d[_0xd6fa('0x65')]=_0x5f4a53;}}return _0x3d850d;});});}else{return;}})[_0xd6fa('0x28')](function(_0x5435f3){if(_0x5435f3)_0x34d2a7=_0x5435f3;if(_['includes'](_0x5b78e3,0x709)){var _0x52c5bf=_['find'](_0x34d2a7,{'sectionId':0x709});return getPlugins(_0x52c5bf)[_0xd6fa('0x28')](function(_0x56f72c){if(_0x52c5bf[_0xd6fa('0x62')]){return _[_0xd6fa('0x2f')](_0x34d2a7,function(_0x316c26){if(_0x316c26[_0xd6fa('0x5b')]===0x709){_0x316c26[_0xd6fa('0x65')]=_0x56f72c;}return _0x316c26;});}else{var _0x40b575={'sectionId':0x76c,'enabled':0x1,'subsections':_0x56f72c};var _0x38fbe2=_[_0xd6fa('0x2f')](_0x34d2a7);_0x38fbe2[_0xd6fa('0x5e')](_0x40b575);return _0x38fbe2;}});}else{return;}})['then'](function(_0x4512fe){if(_0x4512fe)_0x34d2a7=_0x4512fe;return _[_0xd6fa('0x3e')](_0x34d2a7,[_0xd6fa('0x62'),0x1]);})[_0xd6fa('0x28')](respondWithResult(_0x257b44,null))['catch'](handleError(_0x257b44,null));};function hasDefaultDashboard(_0x315cd4){var _0x2a5e2a=[0x65];return new BPromise(function(_0x1695cd,_0x52392d){try{if(_0x315cd4[_0xd6fa('0x56')]){_0x1695cd(_0x2a5e2a);}else{return db['UserProfileResource'][_0xd6fa('0x66')]({'where':{'sectionId':_0x315cd4['id']},'raw':!![]})[_0xd6fa('0x28')](function(_0x209a65){_0x209a65?_0x1695cd(_0x2a5e2a):_0x1695cd();});}}catch(_0x333afa){_0x52392d(_0x333afa);}});}function getCustomDashboards(_0x2df762){var _0x49f94a=[];return new BPromise(function(_0x415c35,_0x547939){try{if(_0x2df762['autoAssociation']){return db[_0xd6fa('0x67')]['findAll']({'raw':!![]})[_0xd6fa('0x28')](function(_0x34d164){_0x34d164['forEach'](function(_0x90713c){_0x49f94a[_0xd6fa('0x5e')](_0x90713c['id']+0x1869f);});_0x415c35(_0x49f94a);});}else{return db[_0xd6fa('0x58')]['findAll']({'where':{'sectionId':_0x2df762['id']},'raw':!![]})['then'](function(_0x2c13d2){_0x2c13d2[_0xd6fa('0x68')](function(_0x129743){_0x49f94a[_0xd6fa('0x5e')](_0x129743['resourceId']+0x1869f);});_0x415c35(_0x49f94a);});}}catch(_0x23d15c){_0x547939(_0x23d15c);}});}function getPlugins(_0x4117fc){var _0x21df6f=[];return new BPromise(function(_0x466305,_0x5df655){try{if(_0x4117fc['autoAssociation']){return db[_0xd6fa('0x69')][_0xd6fa('0x42')]({'raw':!![]})[_0xd6fa('0x28')](function(_0x2d1833){_0x2d1833[_0xd6fa('0x68')](function(_0x1e8064){_0x21df6f[_0xd6fa('0x5e')](_0x1e8064['id']+0x15b38);});_0x466305(_0x21df6f);});}else{return db[_0xd6fa('0x58')][_0xd6fa('0x42')]({'where':{'sectionId':_0x4117fc['id']},'raw':!![]})[_0xd6fa('0x28')](function(_0x5d2efa){_0x5d2efa[_0xd6fa('0x68')](function(_0x5b2a14){_0x21df6f[_0xd6fa('0x5e')](_0x5b2a14[_0xd6fa('0x6a')]+0x15b38);});_0x466305(_0x21df6f);});}}catch(_0x563a05){_0x5df655(_0x563a05);}});}exports[_0xd6fa('0x6b')]=function(_0x58bcfd,_0x18ff74){return db[_0xd6fa('0x40')][_0xd6fa('0x49')]({'where':{'id':_0x58bcfd[_0xd6fa('0x45')]['id']}})[_0xd6fa('0x28')](handleEntityNotFound(_0x18ff74,null))[_0xd6fa('0x28')](function(_0x10bb9a){if(_0x10bb9a){return db[_0xd6fa('0x52')][_0xd6fa('0x53')](function(_0x3f62b){return db[_0xd6fa('0x55')][_0xd6fa('0x42')]({'where':{'userProfileId':_0x58bcfd[_0xd6fa('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xd6fa('0x28')](function(_0x59ee67){if(_0x59ee67){return db[_0xd6fa('0x55')]['destroy']({'where':{'userProfileId':_0x58bcfd[_0xd6fa('0x45')]['id'],'id':_[_0xd6fa('0x2f')](_0x59ee67,function(_0x10ad0f){return _0x10ad0f['id'];})},'transaction':_0x3f62b});}})['then'](function(_0x4f8cba){var _0x1444ea=_[_0xd6fa('0x2f')](_0x58bcfd[_0xd6fa('0x4b')],function(_0x3f15b5){_0x3f15b5['userProfileId']=_0x58bcfd[_0xd6fa('0x45')]['id'];return _0x3f15b5;});return db[_0xd6fa('0x55')][_0xd6fa('0x6c')](_0x1444ea,{'raw':!![],'transaction':_0x3f62b});})[_0xd6fa('0x28')](function(_0x333b66){var _0x16ca3e=_[_0xd6fa('0x3e')](_[_0xd6fa('0x2f')](_0x333b66,function(_0x3b4cba){return _0x3b4cba[_0xd6fa('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x16ca3e){return db['UserProfileSection'][_0xd6fa('0x42')]({'where':{'userProfileId':_0x58bcfd[_0xd6fa('0x45')]['id'],'sectionId':_['map'](_0x16ca3e,function(_0x13f072){return _0x13f072['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd6fa('0x28')](function(_0x368b26){var _0x3e3089=_[_0xd6fa('0x2f')](_0x58bcfd[_0xd6fa('0x4b')],function(_0x50b423){_0x50b423[_0xd6fa('0x57')]=_0x58bcfd[_0xd6fa('0x45')]['id'];return _0x50b423;});return db[_0xd6fa('0x58')][_0xd6fa('0x6c')](_0x3e3089,{'raw':!![],'transaction':_0x3f62b});});}})['catch'](handleError(_0x18ff74,null));});}})['then'](function(_0x3c8a2f){var _0xcb726b=_[_0xd6fa('0x2f')](_0x3c8a2f,function(_0x4c3d24){return _0x4c3d24[_0xd6fa('0x54')]({'plain':!![]});});})[_0xd6fa('0x28')](respondWithResult(_0x18ff74,null))[_0xd6fa('0x4c')](handleError(_0x18ff74,null));};exports['removeResources']=function(_0x150c13,_0x2aa6b4,_0x43934b){return db[_0xd6fa('0x40')]['find']({'where':{'id':_0x150c13[_0xd6fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x2aa6b4,null))[_0xd6fa('0x28')](function(_0x3c0acc){if(_0x3c0acc){return _0x3c0acc[_0xd6fa('0x6d')](_0x150c13[_0xd6fa('0x33')]['ids']);}})[_0xd6fa('0x28')](respondWithStatusCode(_0x2aa6b4,null))[_0xd6fa('0x4c')](handleError(_0x2aa6b4,null));};exports[_0xd6fa('0x6e')]=function(_0x48ddbd,_0x220ea2){var _0x2a2a9b={};if(!_0x48ddbd[_0xd6fa('0x33')][_0xd6fa('0x6f')])throw new Error(_0xd6fa('0x70'));if(!_0x48ddbd[_0xd6fa('0x33')][_0xd6fa('0x71')](_0xd6fa('0x39'))){_0x2a2a9b[_0xd6fa('0x22')]=qs[_0xd6fa('0x22')](_0x48ddbd[_0xd6fa('0x33')][_0xd6fa('0x22')]);_0x2a2a9b['offset']=qs[_0xd6fa('0x20')](_0x48ddbd[_0xd6fa('0x33')][_0xd6fa('0x20')]);}return db[_0xd6fa('0x40')][_0xd6fa('0x49')]({'where':{'id':_0x48ddbd[_0xd6fa('0x45')]['id']}})[_0xd6fa('0x28')](function(_0x15e054){if(!_0x15e054)throw new Error(_0xd6fa('0x72')+_0x48ddbd[_0xd6fa('0x45')]['id']);return db[_0xd6fa('0x40')][_0xd6fa('0x6e')](_0x48ddbd);})[_0xd6fa('0x28')](respondWithFilteredResult(_0x220ea2,_0x2a2a9b))[_0xd6fa('0x4c')](handleError(_0x220ea2,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 727d72b..6829839 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 _0x2bab=['hook','events','../../mysqldb','UserProfile','setMaxListeners','update','remove'];(function(_0x13d347,_0x136e71){var _0x59de80=function(_0x89e8a9){while(--_0x89e8a9){_0x13d347['push'](_0x13d347['shift']());}};_0x59de80(++_0x136e71);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x4f7bfb,_0x209f58){_0x4f7bfb=_0x4f7bfb-0x0;var _0x3ad200=_0x2bab[_0x4f7bfb];return _0x3ad200;};'use strict';var EventEmitter=require(_0xb2ba('0x0'));var UserProfile=require(_0xb2ba('0x1'))['db'][_0xb2ba('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb2ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2ba('0x4'),'afterDestroy':_0xb2ba('0x5')};function emitEvent(_0x1d5064){return function(_0x54d80d,_0x24000c,_0x17466f){UserProfileEvents['emit'](_0x1d5064+':'+_0x54d80d['id'],_0x54d80d);UserProfileEvents['emit'](_0x1d5064,_0x54d80d);_0x17466f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xb2ba('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x7e02=['hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit'];(function(_0xc9c14e,_0x5255c4){var _0xb20a2b=function(_0x2e0017){while(--_0x2e0017){_0xc9c14e['push'](_0xc9c14e['shift']());}};_0xb20a2b(++_0x5255c4);}(_0x7e02,0x71));var _0x27e0=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x7e02[_0x142ec2];return _0x45ef4e;};'use strict';var EventEmitter=require(_0x27e0('0x0'));var UserProfile=require(_0x27e0('0x1'))['db'][_0x27e0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x27e0('0x3')](0x0);var events={'afterCreate':_0x27e0('0x4'),'afterUpdate':_0x27e0('0x5'),'afterDestroy':_0x27e0('0x6')};function emitEvent(_0x57d7fb){return function(_0x4fa613,_0x3d4f41,_0x5abeff){UserProfileEvents[_0x27e0('0x7')](_0x57d7fb+':'+_0x4fa613['id'],_0x4fa613);UserProfileEvents[_0x27e0('0x7')](_0x57d7fb,_0x4fa613);_0x5abeff(null);};}for(var e in events){if(events[_0x27e0('0x8')](e)){var event=events[e];UserProfile[_0x27e0('0x9')](e,emitEvent(event));}}module[_0x27e0('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5f55685..66e1ce1 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 _0x4975=['Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','Tag','templates','triggers','Trigger','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','key','VIRTUAL','foreignKey','forEach','merge','options','default','CustomReports','count','rows','includeAll','CmContact','include','Tags','ThroughTags','color','tag','openTabs','true','chat','sms','dataValues','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','findAll','associatedResources','map','catch','value','model','then','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projects','Lists','ListId','lists','CmCompany','globalcustomfields','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','Agents','User','agent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4975,0x86));var _0x5497=function(_0x5016c0,_0x4338e8){_0x5016c0=_0x5016c0-0x0;var _0x21e507=_0x4975[_0x5016c0];return _0x21e507;};'use strict';var _=require(_0x5497('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x5497('0x1'));var squel=require(_0x5497('0x2'));module[_0x5497('0x3')]=function(_0x349f5f){var _0x135f6f=_0x349f5f[_0x5497('0x4')];function _0x14cecb(_0xeb31af,_0xbb1888){return new Promise(function(_0x5d5272,_0x539a27){if(!_0xbb1888)return _0x5d5272(null);var _0x37e48d=_0xbb1888['filter']?{[_0xbb1888[_0x5497('0x5')][_0x5497('0x6')]]:_0xbb1888[_0x5497('0x5')]['value']}:undefined;return _0x135f6f[_0xeb31af][_0x5497('0x7')]({'where':_0x37e48d,'raw':!![]})['then'](function(_0x1f63d8){_0xbb1888[_0x5497('0x8')]=_[_0x5497('0x9')](_0x1f63d8,'id');_0x5d5272(_0xbb1888);})[_0x5497('0xa')](function(_0x131627){_0x539a27(_0x131627);});});}function _0x425288(_0x3e7886,_0x769e11){return new Promise(function(_0x50d716,_0x5874ef){var _0x5b1162=_0x3e7886[_0x5497('0x5')]?{[_0x3e7886[_0x5497('0x5')][_0x5497('0x6')]]:_0x3e7886[_0x5497('0x5')][_0x5497('0xb')]}:undefined;return _0x135f6f[_0x3e7886[_0x5497('0xc')]][_0x5497('0x7')]({'where':_0x5b1162,'raw':!![]})[_0x5497('0xd')](function(_0x363a5b){_0x769e11[_0x5497('0x8')]=_['map'](_0x363a5b,function(_0x11b0a9){return _0x11b0a9['name'];});_0x50d716(_0x769e11);})[_0x5497('0xa')](function(_0x2bfd8a){_0x5874ef(_0x2bfd8a);});});}function _0x19e5f3(_0x3ce50b,_0x37c18e,_0x4073e6){if(!_0x37c18e)return Promise[_0x5497('0xe')](null);return new Promise(function(_0x575f6b,_0x56a788){return _0x135f6f[_0x5497('0xf')][_0x5497('0x7')]({'where':{'sectionId':_0x37c18e['id']},'raw':!![]})[_0x5497('0xd')](function(_0x5d9e24){if(_0x3ce50b[_0x5497('0x6')]&&_0x3ce50b[_0x5497('0x6')]!=='id'){_0x37c18e[_0x5497('0x8')]=_[_0x5497('0x9')](_0x5d9e24,function(_0x1b1b43){return _0x1b1b43[_0x3ce50b[_0x5497('0x6')]];});}else{if(_0x4073e6===_0x5497('0x10')){_0x37c18e[_0x5497('0x8')]=_[_0x5497('0x9')](_0x5d9e24,function(_0x3f54ef){return{'id':_0x3f54ef[_0x5497('0x11')],'type':_0x3f54ef['type']};});}else{_0x37c18e[_0x5497('0x8')]=_['map'](_0x5d9e24,function(_0x19200a){return _0x19200a[_0x5497('0x11')];});}}_0x575f6b(_0x37c18e);})[_0x5497('0xa')](function(_0x2f587d){_0x56a788(_0x2f587d);});});}function _0x35ecd9(_0x3b2fbc,_0x5018fa){var _0x54043a={'parentSections':[]};switch(_0x3b2fbc[_0x5497('0x12')]()){case _0x5497('0x13'):_0x54043a[_0x5497('0x14')]=_0x5497('0x15');break;case'odbc':_0x54043a[_0x5497('0x14')]='SquareOdbc';break;case _0x5497('0x16'):_0x54043a[_0x5497('0x14')]=_0x5497('0x17');_0x54043a[_0x5497('0x18')]=[{'name':_0x5497('0x19'),'field':_0x5497('0x1a'),'foreignKey':'projectName'}];break;case _0x5497('0x1b'):_0x54043a['childModel']='JscriptyProject';break;case'contacts':_0x54043a[_0x5497('0x14')]='CmContact';_0x54043a['parentSections']=[{'name':_0x5497('0x1c'),'field':'id','foreignKey':_0x5497('0x1d')}];break;case _0x5497('0x1e'):_0x54043a['childModel']='CmList';break;case'companies':_0x54043a[_0x5497('0x14')]=_0x5497('0x1f');break;case _0x5497('0x20'):_0x54043a['childModel']='CmCustomField';break;case'chatqueues':_0x54043a[_0x5497('0x14')]='ChatQueue';break;case _0x5497('0x21'):_0x54043a[_0x5497('0x14')]=_0x5497('0x22');break;case'faxqueues':_0x54043a[_0x5497('0x14')]=_0x5497('0x23');break;case'faxaccounts':_0x54043a[_0x5497('0x14')]=_0x5497('0x24');break;case _0x5497('0x25'):case'internalroutes':case _0x5497('0x26'):_0x54043a[_0x5497('0x14')]=_0x5497('0x27');break;case _0x5497('0x28'):_0x54043a[_0x5497('0x14')]='VoiceContext';break;case _0x5497('0x29'):_0x54043a[_0x5497('0x14')]='VoiceMail';break;case _0x5497('0x2a'):_0x54043a[_0x5497('0x14')]=_0x5497('0x2b');_0x54043a[_0x5497('0x18')]=[{'name':_0x5497('0x2c'),'field':_0x5497('0x1a'),'foreignKey':'membername','model':_0x5497('0x2d'),'filter':{'field':'role','value':[_0x5497('0x2e')]}},{'name':_0x5497('0x2f'),'field':_0x5497('0x1a'),'foreignKey':'membername','model':'User','filter':{'field':_0x5497('0x30'),'value':[_0x5497('0x31')]}},{'name':_0x5497('0x32'),'field':_0x5497('0x1a'),'foreignKey':_0x5497('0x33'),'model':_0x5497('0x34'),'filter':{'field':'type','value':[_0x5497('0x35')]}},{'name':_0x5497('0x36'),'field':_0x5497('0x1a'),'foreignKey':_0x5497('0x33'),'model':_0x5497('0x34'),'filter':{'field':_0x5497('0x37'),'value':[_0x5497('0x38')]}}];break;case _0x5497('0x39'):_0x54043a[_0x5497('0x14')]='VoiceMusicOnHold';break;case _0x5497('0x3a'):_0x54043a[_0x5497('0x14')]=_0x5497('0x3b');break;case _0x5497('0x3c'):_0x54043a[_0x5497('0x14')]=_0x5497('0x3d');break;case _0x5497('0x3e'):_0x54043a['childModel']=_0x5497('0x3f');break;case _0x5497('0x40'):_0x54043a[_0x5497('0x14')]=_0x5497('0x41');break;case _0x5497('0x42'):_0x54043a[_0x5497('0x14')]=_0x5497('0x43');break;case'mailsubstatuses':_0x54043a[_0x5497('0x14')]=_0x5497('0x44');break;case _0x5497('0x45'):_0x54043a[_0x5497('0x14')]=_0x5497('0x46');break;case _0x5497('0x47'):_0x54043a[_0x5497('0x14')]=_0x5497('0x48');break;case _0x5497('0x49'):_0x54043a[_0x5497('0x14')]='SmsQueue';break;case _0x5497('0x4a'):_0x54043a['childModel']=_0x5497('0x4b');break;case _0x5497('0x4c'):_0x54043a[_0x5497('0x14')]=_0x5497('0x4d');break;case _0x5497('0x4e'):_0x54043a['childModel']=_0x5497('0x4f');break;case _0x5497('0x50'):_0x54043a['childModel']=_0x5497('0x51');break;case'voicequeues':case _0x5497('0x52'):_0x54043a['childModel']=_0x5497('0x34');if(_0x5018fa){_0x54043a[_0x5497('0x18')]=[{'name':_0x5497('0x32')},{'name':_0x5497('0x36')}];}break;case _0x5497('0x53'):case'agents':case'telephones':_0x54043a['childModel']='User';if(_0x5018fa){_0x54043a[_0x5497('0x18')]=[{'name':_0x5497('0x54'),'filter':{'field':_0x5497('0x30'),'value':[_0x5497('0x55'),_0x5497('0x56')]},'ignore':!![]},{'name':_0x5497('0x2c')},{'name':_0x5497('0x2f')}];}break;case _0x5497('0x57'):_0x54043a[_0x5497('0x14')]='ZendeskAccount';break;case _0x5497('0x58'):_0x54043a[_0x5497('0x14')]=_0x5497('0x59');break;case'freshdeskaccounts':_0x54043a[_0x5497('0x14')]='FreshdeskAccount';break;case _0x5497('0x5a'):_0x54043a[_0x5497('0x14')]=_0x5497('0x5b');break;case'deskaccounts':_0x54043a[_0x5497('0x14')]=_0x5497('0x5c');break;case'zohoaccounts':_0x54043a[_0x5497('0x14')]='ZohoAccount';break;case _0x5497('0x5d'):_0x54043a['childModel']=_0x5497('0x2d');break;case _0x5497('0x5e'):_0x54043a[_0x5497('0x14')]=_0x5497('0x5f');break;case _0x5497('0x60'):_0x54043a[_0x5497('0x14')]=_0x5497('0x61');break;case _0x5497('0x62'):_0x54043a['childModel']=_0x5497('0x63');break;case'intervals':_0x54043a['childModel']=_0x5497('0x64');break;case _0x5497('0x65'):_0x54043a['childModel']=_0x5497('0x66');break;case _0x5497('0x67'):_0x54043a[_0x5497('0x14')]=_0x5497('0x68');break;case'sounds':_0x54043a[_0x5497('0x14')]='Sound';break;case'tags':_0x54043a[_0x5497('0x14')]=_0x5497('0x69');break;case _0x5497('0x6a'):_0x54043a['childModel']='Template';break;case _0x5497('0x6b'):_0x54043a['childModel']=_0x5497('0x6c');break;case'trunks':_0x54043a[_0x5497('0x14')]='Trunk';break;case _0x5497('0x6d'):_0x54043a[_0x5497('0x14')]='Variable';break;case _0x5497('0x6e'):_0x54043a['childModel']='Plugin';break;case _0x5497('0x6f'):_0x54043a[_0x5497('0x14')]='AnalyticExtractedReport';_0x54043a[_0x5497('0x18')]=[{'name':_0x5497('0x70'),'field':'id','foreignKey':_0x5497('0x71')}];break;case _0x5497('0x72'):_0x54043a[_0x5497('0x14')]=_0x5497('0x73');break;}return _0x54043a;}function _0x590be7(_0x215ea8,_0x4916cd){var _0x4e0d4c=_0x215ea8['charAt'](0x0)[_0x5497('0x74')]()+_0x215ea8[_0x5497('0x75')](0x1);var _0x23fd59={'type':_0x135f6f['Sequelize'][_0x5497('0x76')]['SELECT'],'raw':!![]};return new Promise(function(_0x5f0243,_0x5a676d){var _0x1d320a=squel[_0x5497('0x77')]()[_0x5497('0x6')](_0x5497('0x78')+_0x4e0d4c+_0x5497('0x79'),'id')['field'](_0x5497('0x7a'))[_0x5497('0x7b')](_0x5497('0x7c')+_0x215ea8+_0x5497('0x7d'),'ui')['where'](_0x5497('0x7e'),_0x4916cd['id']);return _0x135f6f[_0x5497('0x7f')][_0x5497('0x80')](_0x1d320a[_0x5497('0x81')](),_0x23fd59)['then'](function(_0x31271c){_0x4916cd[_0x4e0d4c+_0x5497('0x82')]=_0x31271c;_0x5f0243(_0x31271c);})[_0x5497('0xa')](function(_0x542bcf){_0x5a676d(_0x542bcf);});});}return _0x349f5f[_0x5497('0x83')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x53e050){var _0x3bcc59={'raw':![],'where':{}};var _0x1ca4d8={};var _0x1e01a7={'count':0x0,'rows':[]};var _0x4e7d4c=_0x53e050[_0x5497('0x80')][_0x5497('0x84')];var _0x3cfebc=_0x53e050[_0x5497('0x80')]['mergeResources']||![];var _0x15f134=_0x35ecd9(_0x4e7d4c,_0x3cfebc);if(!_0x15f134[_0x5497('0x14')])throw new Error(_0x5497('0x85')+_0x4e7d4c+'\x27');var _0x49617c=[{'name':_0x4e7d4c}];if(!_[_0x5497('0x86')](_0x15f134[_0x5497('0x18')]))_0x49617c=_0x15f134[_0x5497('0x18')];var _0x4368e3=[];for(var _0x1467c4=0x0;_0x1467c4<_0x49617c[_0x5497('0x87')];_0x1467c4++){_0x4368e3[_0x5497('0x88')](_0x135f6f['UserProfileSection'][_0x5497('0x89')]({'where':{'userProfileId':_0x53e050[_0x5497('0x8a')]['id'],'name':_0x49617c[_0x1467c4][_0x5497('0x1a')]},'raw':!![]}));}return Promise[_0x5497('0x8b')](_0x4368e3)['then'](function(_0x5dd334){var _0x4a7360=_[_0x5497('0x5')](_0x5dd334,function(_0x1d1405){return _0x1d1405?_0x1d1405:undefined;});var _0x179bbc=_['filter'](_0x49617c,[_0x5497('0x8c'),!![]]);var _0x950d78=_[_0x5497('0x86')](_0x4a7360)&&_[_0x5497('0x86')](_0x179bbc)?null:_[_0x5497('0x8d')](_0x179bbc,_0x4a7360);if(!_0x950d78)return null;var _0x4338d4=[];for(var _0x3f38bf=0x0;_0x3f38bf<_0x950d78[_0x5497('0x87')];_0x3f38bf++){var _0x21da3d=_[_0x5497('0x89')](_0x49617c,function(_0x1fc6ad){return _0x950d78[_0x3f38bf]?_0x1fc6ad['name']===_0x950d78[_0x3f38bf][_0x5497('0x1a')]:null;});if(_0x21da3d){if(_0x950d78[_0x3f38bf][_0x5497('0x8c')]){_0x4338d4[_0x5497('0x88')](_0x14cecb(_0x15f134['childModel'],_0x950d78[_0x3f38bf]));}else{if(!_0x950d78[_0x3f38bf][_0x5497('0x8e')]){_0x4338d4['push'](_0x19e5f3(_0x21da3d,_0x950d78[_0x3f38bf],_0x15f134[_0x5497('0x14')]));}else{if(_0x21da3d[_0x5497('0xc')]){_0x4338d4['push'](_0x425288(_0x21da3d,_0x950d78[_0x3f38bf]));}}}}}return Promise[_0x5497('0x8b')](_0x4338d4);})[_0x5497('0xd')](function(_0x21c715){var _0x286af8=_0x21c715;var _0x535dba=null;if(_0x286af8){_0x535dba=_0x286af8[_0x5497('0x87')]===0x1?_0x286af8[0x0]:null;}if(!_0x535dba&&!_0x286af8)return _0x1e01a7;var _0x3ddd9d=_0x135f6f[_0x15f134[_0x5497('0x14')]]['rawAttributes'];_0x1ca4d8[_0x5497('0xc')]=_[_0x5497('0x8f')](_0x3ddd9d);_0x1ca4d8['query']=_[_0x5497('0x8f')](_0x53e050[_0x5497('0x80')]);_0x1ca4d8[_0x5497('0x90')]=_['intersection'](_0x1ca4d8['model'],_0x1ca4d8[_0x5497('0x80')]);_0x3bcc59[_0x5497('0x91')]=_[_0x5497('0x92')](_0x1ca4d8[_0x5497('0xc')],qs[_0x5497('0x93')](_0x53e050[_0x5497('0x80')][_0x5497('0x93')]));_0x3bcc59['attributes']=_0x3bcc59['attributes'][_0x5497('0x87')]?_0x3bcc59[_0x5497('0x91')]:_0x1ca4d8['model'];if(!_0x53e050[_0x5497('0x80')][_0x5497('0x94')](_0x5497('0x95'))){_0x3bcc59['limit']=qs[_0x5497('0x96')](_0x53e050[_0x5497('0x80')]['limit']);_0x3bcc59[_0x5497('0x97')]=qs[_0x5497('0x97')](_0x53e050[_0x5497('0x80')][_0x5497('0x97')]);}_0x3bcc59[_0x5497('0x98')]=qs['sort'](_0x53e050[_0x5497('0x80')][_0x5497('0x99')]);_0x3bcc59[_0x5497('0x9a')]=qs[_0x5497('0x90')](_[_0x5497('0x9b')](_0x53e050['query'],_0x1ca4d8[_0x5497('0x90')]));if(_0x53e050[_0x5497('0x80')][_0x5497('0x5')]){_0x3bcc59[_0x5497('0x9a')]=_['merge'](_0x3bcc59[_0x5497('0x9a')],{'$or':_[_0x5497('0x9')](_0x3ddd9d,function(_0x47c9fa){if(_0x47c9fa[_0x5497('0x37')][_0x5497('0x9c')]!==_0x5497('0x9d')){var _0x3a8cf9={};_0x3a8cf9[_0x47c9fa['field']]={'$like':'%'+_0x53e050['query']['filter']+'%'};return _0x3a8cf9;}})});}var _0x5343d5=[];var _0x594761=null;var _0x2d5543={};if(_0x535dba){_0x594761=_[_0x5497('0x89')](_0x49617c,[_0x5497('0x1a'),_0x535dba[_0x5497('0x1a')]]);if(_0x594761[_0x5497('0x6')]){_0x2d5543={};if(_0x15f134['childModel']==='AnalyticExtractedReport'){_0x2d5543[_0x594761[_0x5497('0x9e')]]=_[_0x5497('0x9')](_0x535dba[_0x5497('0x8')],'id');}else{_0x2d5543[_0x594761[_0x5497('0x9e')]]=_0x535dba[_0x5497('0x8')];}_0x5343d5[_0x5497('0x88')](_0x2d5543);}else{_0x3bcc59[_0x5497('0x9a')]['id']=_0x535dba[_0x5497('0x8')];}}else{for(var _0x2aae94=0x0;_0x2aae94<_0x286af8[_0x5497('0x87')];_0x2aae94++){_0x594761=_['find'](_0x49617c,[_0x5497('0x1a'),_0x286af8[_0x2aae94][_0x5497('0x1a')]]);if(_0x594761[_0x5497('0x6')]){_0x2d5543={};_0x2d5543[_0x594761[_0x5497('0x9e')]]=_0x286af8[_0x2aae94][_0x5497('0x8')];_0x5343d5[_0x5497('0x88')](_0x2d5543);}else{if(!_0x3bcc59['where']['id'])_0x3bcc59[_0x5497('0x9a')]['id']=[];_0x286af8[_0x2aae94]['associatedResources'][_0x5497('0x9f')](function(_0x420b6b){_0x3bcc59[_0x5497('0x9a')]['id']['push'](_0x420b6b);});}}}if(!_['isEmpty'](_0x5343d5)){_0x3bcc59[_0x5497('0x9a')]=_[_0x5497('0xa0')](_0x3bcc59[_0x5497('0x9a')],{'$and':{'$or':_0x5343d5}});}_0x3bcc59=_[_0x5497('0xa0')]({},_0x3bcc59,_0x53e050[_0x5497('0xa1')]);if(_0x535dba&&!_0x535dba[_0x5497('0x8e')]&&_0x15f134[_0x5497('0x14')]===_0x5497('0x10')){if(_0x53e050['query']['includeAll']){_0x3bcc59['include']=[{'all':!![]}];}return _0x135f6f[_0x15f134[_0x5497('0x14')]][_0x5497('0x7')](_0x3bcc59)[_0x5497('0xd')](function(_0xc81d7d){var _0x4c442f=[];_0xc81d7d['forEach'](function(_0x29502d){var _0xf38193;switch(_0x29502d['reportType']){case _0x5497('0xa2'):_0xf38193=_[_0x5497('0x89')](_0x535dba[_0x5497('0x8')],function(_0x36c09f){return _0x36c09f['id']===_0x29502d['reportId']&&_0x36c09f['type']==='DefaultReports';});break;case'custom':_0xf38193=_['find'](_0x535dba[_0x5497('0x8')],function(_0x579355){return _0x579355['id']===_0x29502d[_0x5497('0x71')]&&_0x579355['type']===_0x5497('0xa3');});break;}if(_0xf38193)_0x4c442f[_0x5497('0x88')](_0x29502d);});_0x1e01a7[_0x5497('0xa4')]=_0x4c442f[_0x5497('0x87')];_0x1e01a7[_0x5497('0xa5')]=_0x4c442f;return _0x1e01a7;});}else{return _0x135f6f[_0x15f134[_0x5497('0x14')]]['count']({'where':_0x3bcc59[_0x5497('0x9a')]})['then'](function(_0x15a67d){_0x1e01a7[_0x5497('0xa4')]=_0x15a67d;if(_0x53e050[_0x5497('0x80')][_0x5497('0xa6')]){if(_0x15f134[_0x5497('0x14')]===_0x5497('0xa7')){_0x3bcc59[_0x5497('0xa8')]=[{'model':_0x135f6f[_0x5497('0x69')],'as':_0x5497('0xa9'),'attributes':['id',_0x5497('0x1a'),'color'],'required':_0x53e050[_0x5497('0x80')]['tag']?!![]:![]},{'model':_0x135f6f[_0x5497('0x69')],'as':_0x5497('0xaa'),'attributes':['id','name',_0x5497('0xab')],'through':_0x53e050[_0x5497('0x80')][_0x5497('0xac')]?{'attributes':[],'where':{'TagId':_0x53e050[_0x5497('0x80')][_0x5497('0xac')]||undefined}}:{},'required':_0x53e050[_0x5497('0x80')][_0x5497('0xac')]?!![]:![]}];}else{_0x3bcc59[_0x5497('0xa8')]=[{'all':!![]}];}}return _0x135f6f[_0x15f134[_0x5497('0x14')]][_0x5497('0x7')](_0x3bcc59);})[_0x5497('0xd')](function(_0x926bc1){_0x1e01a7[_0x5497('0xa5')]=_0x926bc1;if(_0x4e7d4c===_0x5497('0x2c')&&_0x53e050['query'][_0x5497('0xad')]===_0x5497('0xae')){var _0x3a31be=[];for(var _0xeecd7=0x0;_0xeecd7<_0x1e01a7[_0x5497('0xa5')]['length'];_0xeecd7++){_0x3a31be[_0x5497('0x88')](_0x590be7(_0x5497('0xaf'),_0x1e01a7['rows'][_0xeecd7]['dataValues']));_0x3a31be[_0x5497('0x88')](_0x590be7(_0x5497('0xb0'),_0x1e01a7[_0x5497('0xa5')][_0xeecd7][_0x5497('0xb1')]));_0x3a31be[_0x5497('0x88')](_0x590be7('fax',_0x1e01a7['rows'][_0xeecd7][_0x5497('0xb1')]));_0x3a31be['push'](_0x590be7(_0x5497('0xb2'),_0x1e01a7[_0x5497('0xa5')][_0xeecd7][_0x5497('0xb1')]));_0x3a31be[_0x5497('0x88')](_0x590be7(_0x5497('0xb3'),_0x1e01a7[_0x5497('0xa5')][_0xeecd7]['dataValues']));_0x3a31be['push'](_0x590be7(_0x5497('0xb4'),_0x1e01a7[_0x5497('0xa5')][_0xeecd7][_0x5497('0xb1')]));}return Promise['all'](_0x3a31be)[_0x5497('0xd')](function(){return _0x1e01a7;});}return _0x1e01a7;});}});}}});}; \ No newline at end of file +var _0x187d=['chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','membername','Telephones','User','telephone','queue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','VoiceQueue','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','union','ignore','push','rawAttributes','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','DefaultReports','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue'];(function(_0x3a1e1c,_0xeb4a1){var _0x3cc920=function(_0xa7ce92){while(--_0xa7ce92){_0x3a1e1c['push'](_0x3a1e1c['shift']());}};_0x3cc920(++_0xeb4a1);}(_0x187d,0x93));var _0xd187=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x187d[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xd187('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd187('0x1'));var squel=require(_0xd187('0x2'));module[_0xd187('0x3')]=function(_0x1cb41f){var _0x18498b=_0x1cb41f[_0xd187('0x4')];function _0x58622a(_0x28fa0b,_0x163807){return new Promise(function(_0x4ebc8d,_0x1d2533){if(!_0x163807)return _0x4ebc8d(null);var _0x58ee7=_0x163807[_0xd187('0x5')]?{[_0x163807[_0xd187('0x5')][_0xd187('0x6')]]:_0x163807[_0xd187('0x5')][_0xd187('0x7')]}:undefined;return _0x18498b[_0x28fa0b][_0xd187('0x8')]({'where':_0x58ee7,'raw':!![]})['then'](function(_0x342539){_0x163807[_0xd187('0x9')]=_[_0xd187('0xa')](_0x342539,'id');_0x4ebc8d(_0x163807);})[_0xd187('0xb')](function(_0x33ca45){_0x1d2533(_0x33ca45);});});}function _0x2a61a4(_0x59c194,_0x10d467){return new Promise(function(_0x412ccf,_0x18237b){var _0x5e6180=_0x59c194[_0xd187('0x5')]?{[_0x59c194[_0xd187('0x5')][_0xd187('0x6')]]:_0x59c194['filter'][_0xd187('0x7')]}:undefined;return _0x18498b[_0x59c194[_0xd187('0xc')]][_0xd187('0x8')]({'where':_0x5e6180,'raw':!![]})[_0xd187('0xd')](function(_0x517b25){_0x10d467[_0xd187('0x9')]=_[_0xd187('0xa')](_0x517b25,function(_0x45ab10){return _0x45ab10[_0xd187('0xe')];});_0x412ccf(_0x10d467);})['catch'](function(_0x245d3e){_0x18237b(_0x245d3e);});});}function _0x52a208(_0x5cf218,_0x40ed84,_0x5a4986){if(!_0x40ed84)return Promise['resolve'](null);return new Promise(function(_0x207b36,_0x2b3290){return _0x18498b[_0xd187('0xf')][_0xd187('0x8')]({'where':{'sectionId':_0x40ed84['id']},'raw':!![]})[_0xd187('0xd')](function(_0x253a7e){if(_0x5cf218[_0xd187('0x6')]&&_0x5cf218[_0xd187('0x6')]!=='id'){_0x40ed84[_0xd187('0x9')]=_[_0xd187('0xa')](_0x253a7e,function(_0x170d5c){return _0x170d5c[_0x5cf218[_0xd187('0x6')]];});}else{if(_0x5a4986===_0xd187('0x10')){_0x40ed84['associatedResources']=_[_0xd187('0xa')](_0x253a7e,function(_0x81b988){return{'id':_0x81b988[_0xd187('0x11')],'type':_0x81b988['type']};});}else{_0x40ed84['associatedResources']=_['map'](_0x253a7e,function(_0x435d94){return _0x435d94[_0xd187('0x11')];});}}_0x207b36(_0x40ed84);})[_0xd187('0xb')](function(_0x4f62c8){_0x2b3290(_0x4f62c8);});});}function _0x2c07c8(_0x57186b,_0x145771){var _0x5a7a23={'parentSections':[]};switch(_0x57186b[_0xd187('0x12')]()){case'squareprojects':_0x5a7a23['childModel']=_0xd187('0x13');break;case'odbc':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x15');break;case'squarerecordings':_0x5a7a23['childModel']=_0xd187('0x16');_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x18'),'field':_0xd187('0xe'),'foreignKey':'projectName'}];break;case _0xd187('0x19'):_0x5a7a23[_0xd187('0x14')]='JscriptyProject';break;case _0xd187('0x1a'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1b');_0x5a7a23['parentSections']=[{'name':_0xd187('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd187('0x1d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1e');break;case _0xd187('0x1f'):_0x5a7a23['childModel']=_0xd187('0x20');break;case _0xd187('0x21'):_0x5a7a23['childModel']='CmCustomField';break;case _0xd187('0x22'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x23');break;case _0xd187('0x24'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x25');break;case _0xd187('0x26'):_0x5a7a23[_0xd187('0x14')]='FaxQueue';break;case _0xd187('0x27'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x28');break;case'inboundroutes':case _0xd187('0x29'):case'outboundroutes':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2a');break;case _0xd187('0x2b'):_0x5a7a23['childModel']='VoiceContext';break;case _0xd187('0x2c'):_0x5a7a23[_0xd187('0x14')]='VoiceMail';break;case _0xd187('0x2d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2e');_0x5a7a23['parentSections']=[{'name':'Agents','field':_0xd187('0xe'),'foreignKey':_0xd187('0x2f'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xd187('0x30'),'field':'name','foreignKey':_0xd187('0x2f'),'model':_0xd187('0x31'),'filter':{'field':'role','value':[_0xd187('0x32')]}},{'name':'VoiceQueues','field':_0xd187('0xe'),'foreignKey':_0xd187('0x33'),'model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x35')]}},{'name':'QueueCampaigns','field':_0xd187('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x36')]}}];break;case _0xd187('0x37'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x38');break;case'chanspies':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x39');break;case _0xd187('0x3a'):_0x5a7a23['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5a7a23['childModel']=_0xd187('0x3b');break;case _0xd187('0x3c'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3d');break;case _0xd187('0x3e'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3f');break;case _0xd187('0x40'):_0x5a7a23['childModel']=_0xd187('0x41');break;case _0xd187('0x42'):_0x5a7a23[_0xd187('0x14')]='OpenchannelQueue';break;case _0xd187('0x43'):_0x5a7a23['childModel']=_0xd187('0x44');break;case _0xd187('0x45'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x46');break;case _0xd187('0x47'):_0x5a7a23['childModel']=_0xd187('0x48');break;case _0xd187('0x49'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4a');break;case'whatsappaccounts':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4b');break;case'teams':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4c');break;case'voicequeues':case'queuecampaigns':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4d');if(_0x145771){_0x5a7a23['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xd187('0x4e'):case _0xd187('0x4f'):case _0xd187('0x50'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x31');if(_0x145771){_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x51'),'filter':{'field':'role','value':[_0xd187('0x52'),_0xd187('0x53')]},'ignore':!![]},{'name':_0xd187('0x54')},{'name':_0xd187('0x30')}];}break;case _0xd187('0x55'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x56');break;case _0xd187('0x57'):_0x5a7a23['childModel']=_0xd187('0x58');break;case _0xd187('0x59'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x5a');break;case _0xd187('0x5b'):_0x5a7a23['childModel']=_0xd187('0x5c');break;case _0xd187('0x5d'):_0x5a7a23['childModel']=_0xd187('0x5e');break;case _0xd187('0x5f'):_0x5a7a23['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x5a7a23['childModel']=_0xd187('0x31');break;case _0xd187('0x60'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x61');break;case _0xd187('0x62'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x63');break;case'customdashboards':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x64');break;case _0xd187('0x65'):_0x5a7a23[_0xd187('0x14')]='Interval';break;case _0xd187('0x66'):_0x5a7a23['childModel']='Pause';break;case _0xd187('0x67'):_0x5a7a23['childModel']=_0xd187('0x68');break;case _0xd187('0x69'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6a');break;case _0xd187('0x6b'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6c');break;case _0xd187('0x6d'):_0x5a7a23[_0xd187('0x14')]='Template';break;case _0xd187('0x6e'):_0x5a7a23[_0xd187('0x14')]='Trigger';break;case _0xd187('0x6f'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x70');break;case'variables':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x71');break;case'plugins':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x72');break;case'extractedreports':_0x5a7a23[_0xd187('0x14')]='AnalyticExtractedReport';_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x73'),'field':'id','foreignKey':_0xd187('0x74')}];break;case _0xd187('0x75'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x76');break;}return _0x5a7a23;}function _0x1675d9(_0x4eddd5,_0xcef6ca){var _0x298b46=_0x4eddd5[_0xd187('0x77')](0x0)['toUpperCase']()+_0x4eddd5[_0xd187('0x78')](0x1);var _0x23428f={'type':_0x18498b[_0xd187('0x79')][_0xd187('0x7a')][_0xd187('0x7b')],'raw':!![]};return new Promise(function(_0x2c4f4d,_0x10ebf4){var _0x202f73=squel[_0xd187('0x7c')]()[_0xd187('0x6')](_0xd187('0x7d')+_0x298b46+_0xd187('0x7e'),'id')[_0xd187('0x6')](_0xd187('0x7f'))[_0xd187('0x80')](_0xd187('0x81')+_0x4eddd5+_0xd187('0x82'),'ui')[_0xd187('0x83')](_0xd187('0x84'),_0xcef6ca['id']);return _0x18498b[_0xd187('0x85')]['query'](_0x202f73[_0xd187('0x86')](),_0x23428f)['then'](function(_0x13d118){_0xcef6ca[_0x298b46+_0xd187('0x87')]=_0x13d118;_0x2c4f4d(_0x13d118);})[_0xd187('0xb')](function(_0x4225e6){_0x10ebf4(_0x4225e6);});});}return _0x1cb41f['define'](_0xd187('0x88'),attributes,{'tableName':_0xd187('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f89a6){var _0x509815={'raw':![],'where':{}};var _0x3613ee={};var _0x2c2a62={'count':0x0,'rows':[]};var _0x2870ad=_0x4f89a6[_0xd187('0x8a')]['section'];var _0x2c1df4=_0x4f89a6['query'][_0xd187('0x8b')]||![];var _0x2f6a72=_0x2c07c8(_0x2870ad,_0x2c1df4);if(!_0x2f6a72[_0xd187('0x14')])throw new Error(_0xd187('0x8c')+_0x2870ad+'\x27');var _0x57cad7=[{'name':_0x2870ad}];if(!_[_0xd187('0x8d')](_0x2f6a72[_0xd187('0x17')]))_0x57cad7=_0x2f6a72[_0xd187('0x17')];var _0x9e82c=[];for(var _0x151f3c=0x0;_0x151f3c<_0x57cad7['length'];_0x151f3c++){_0x9e82c['push'](_0x18498b[_0xd187('0x8e')][_0xd187('0x8f')]({'where':{'userProfileId':_0x4f89a6[_0xd187('0x90')]['id'],'name':_0x57cad7[_0x151f3c][_0xd187('0xe')]},'raw':!![]}));}return Promise[_0xd187('0x91')](_0x9e82c)[_0xd187('0xd')](function(_0x2dccff){var _0x1291cc=_[_0xd187('0x5')](_0x2dccff,function(_0x3765b0){return _0x3765b0?_0x3765b0:undefined;});var _0x379e89=_[_0xd187('0x5')](_0x57cad7,['ignore',!![]]);var _0x35df1e=_[_0xd187('0x8d')](_0x1291cc)&&_['isEmpty'](_0x379e89)?null:_[_0xd187('0x92')](_0x379e89,_0x1291cc);if(!_0x35df1e)return null;var _0x1a9979=[];for(var _0x4bec3e=0x0;_0x4bec3e<_0x35df1e['length'];_0x4bec3e++){var _0x32ba2a=_[_0xd187('0x8f')](_0x57cad7,function(_0x2ac56f){return _0x35df1e[_0x4bec3e]?_0x2ac56f[_0xd187('0xe')]===_0x35df1e[_0x4bec3e]['name']:null;});if(_0x32ba2a){if(_0x35df1e[_0x4bec3e][_0xd187('0x93')]){_0x1a9979[_0xd187('0x94')](_0x58622a(_0x2f6a72['childModel'],_0x35df1e[_0x4bec3e]));}else{if(!_0x35df1e[_0x4bec3e]['autoAssociation']){_0x1a9979[_0xd187('0x94')](_0x52a208(_0x32ba2a,_0x35df1e[_0x4bec3e],_0x2f6a72['childModel']));}else{if(_0x32ba2a[_0xd187('0xc')]){_0x1a9979[_0xd187('0x94')](_0x2a61a4(_0x32ba2a,_0x35df1e[_0x4bec3e]));}}}}}return Promise['all'](_0x1a9979);})[_0xd187('0xd')](function(_0x570c1c){var _0x317bc3=_0x570c1c;var _0x4f2875=null;if(_0x317bc3){_0x4f2875=_0x317bc3['length']===0x1?_0x317bc3[0x0]:null;}if(!_0x4f2875&&!_0x317bc3)return _0x2c2a62;var _0x4a1988=_0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x95')];_0x3613ee[_0xd187('0xc')]=_[_0xd187('0x96')](_0x4a1988);_0x3613ee[_0xd187('0x8a')]=_[_0xd187('0x96')](_0x4f89a6[_0xd187('0x8a')]);_0x3613ee[_0xd187('0x97')]=_['intersection'](_0x3613ee[_0xd187('0xc')],_0x3613ee[_0xd187('0x8a')]);_0x509815[_0xd187('0x98')]=_['intersection'](_0x3613ee[_0xd187('0xc')],qs[_0xd187('0x99')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0x99')]));_0x509815['attributes']=_0x509815[_0xd187('0x98')][_0xd187('0x9a')]?_0x509815['attributes']:_0x3613ee[_0xd187('0xc')];if(!_0x4f89a6[_0xd187('0x8a')][_0xd187('0x9b')](_0xd187('0x9c'))){_0x509815['limit']=qs[_0xd187('0x9d')](_0x4f89a6[_0xd187('0x8a')]['limit']);_0x509815[_0xd187('0x9e')]=qs['offset'](_0x4f89a6['query']['offset']);}_0x509815[_0xd187('0x9f')]=qs[_0xd187('0xa0')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0xa0')]);_0x509815[_0xd187('0x83')]=qs[_0xd187('0x97')](_['pick'](_0x4f89a6[_0xd187('0x8a')],_0x3613ee[_0xd187('0x97')]));if(_0x4f89a6['query']['filter']){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$or':_[_0xd187('0xa')](_0x4a1988,function(_0x3fe450){if(_0x3fe450[_0xd187('0x34')]['key']!==_0xd187('0xa2')){var _0x134cc2={};_0x134cc2[_0x3fe450[_0xd187('0x6')]]={'$like':'%'+_0x4f89a6[_0xd187('0x8a')][_0xd187('0x5')]+'%'};return _0x134cc2;}})});}var _0x2879ff=[];var _0x1982cd=null;var _0x1e58d4={};if(_0x4f2875){_0x1982cd=_[_0xd187('0x8f')](_0x57cad7,[_0xd187('0xe'),_0x4f2875[_0xd187('0xe')]]);if(_0x1982cd[_0xd187('0x6')]){_0x1e58d4={};if(_0x2f6a72['childModel']==='AnalyticExtractedReport'){_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_[_0xd187('0xa')](_0x4f2875[_0xd187('0x9')],'id');}else{_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x4f2875[_0xd187('0x9')];}_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{_0x509815['where']['id']=_0x4f2875[_0xd187('0x9')];}}else{for(var _0x5541ef=0x0;_0x5541ef<_0x317bc3[_0xd187('0x9a')];_0x5541ef++){_0x1982cd=_['find'](_0x57cad7,['name',_0x317bc3[_0x5541ef][_0xd187('0xe')]]);if(_0x1982cd['field']){_0x1e58d4={};_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x317bc3[_0x5541ef][_0xd187('0x9')];_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{if(!_0x509815[_0xd187('0x83')]['id'])_0x509815[_0xd187('0x83')]['id']=[];_0x317bc3[_0x5541ef][_0xd187('0x9')][_0xd187('0xa4')](function(_0x37fd5a){_0x509815[_0xd187('0x83')]['id'][_0xd187('0x94')](_0x37fd5a);});}}}if(!_[_0xd187('0x8d')](_0x2879ff)){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$and':{'$or':_0x2879ff}});}_0x509815=_[_0xd187('0xa1')]({},_0x509815,_0x4f89a6['options']);if(_0x4f2875&&!_0x4f2875[_0xd187('0xa5')]&&_0x2f6a72[_0xd187('0x14')]===_0xd187('0x10')){if(_0x4f89a6[_0xd187('0x8a')]['includeAll']){_0x509815[_0xd187('0xa6')]=[{'all':!![]}];}return _0x18498b[_0x2f6a72[_0xd187('0x14')]]['findAll'](_0x509815)['then'](function(_0x20b680){var _0x3c993a=[];_0x20b680[_0xd187('0xa4')](function(_0x435fe8){var _0x371869;switch(_0x435fe8[_0xd187('0xa7')]){case'default':_0x371869=_[_0xd187('0x8f')](_0x4f2875[_0xd187('0x9')],function(_0x5b7870){return _0x5b7870['id']===_0x435fe8[_0xd187('0x74')]&&_0x5b7870[_0xd187('0x34')]===_0xd187('0xa8');});break;case _0xd187('0xa9'):_0x371869=_['find'](_0x4f2875['associatedResources'],function(_0x18d48d){return _0x18d48d['id']===_0x435fe8[_0xd187('0x74')]&&_0x18d48d[_0xd187('0x34')]==='CustomReports';});break;}if(_0x371869)_0x3c993a[_0xd187('0x94')](_0x435fe8);});_0x2c2a62[_0xd187('0xaa')]=_0x3c993a[_0xd187('0x9a')];_0x2c2a62[_0xd187('0xab')]=_0x3c993a;return _0x2c2a62;});}else{return _0x18498b[_0x2f6a72['childModel']][_0xd187('0xaa')]({'where':_0x509815['where']})['then'](function(_0x4a9310){_0x2c2a62['count']=_0x4a9310;if(_0x4f89a6['query']['includeAll']){if(_0x2f6a72['childModel']===_0xd187('0x1b')){_0x509815[_0xd187('0xa6')]=[{'model':_0x18498b['Tag'],'as':_0xd187('0xac'),'attributes':['id',_0xd187('0xe'),_0xd187('0xad')],'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]},{'model':_0x18498b['Tag'],'as':_0xd187('0xaf'),'attributes':['id','name',_0xd187('0xad')],'through':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?{'attributes':[],'where':{'TagId':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]||undefined}}:{},'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]}];}else{_0x509815['include']=[{'all':!![]}];}}return _0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x8')](_0x509815);})['then'](function(_0x2afb14){_0x2c2a62[_0xd187('0xab')]=_0x2afb14;if(_0x2870ad==='Agents'&&_0x4f89a6[_0xd187('0x8a')][_0xd187('0xb0')]===_0xd187('0xb1')){var _0x45b522=[];for(var _0x78604d=0x0;_0x78604d<_0x2c2a62[_0xd187('0xab')][_0xd187('0x9a')];_0x78604d++){_0x45b522[_0xd187('0x94')](_0x1675d9('chat',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb3'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9('fax',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9(_0xd187('0xb4'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb5'),_0x2c2a62[_0xd187('0xab')][_0x78604d]['dataValues']));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb6'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));}return Promise[_0xd187('0x91')](_0x45b522)[_0xd187('0xd')](function(){return _0x2c2a62;});}return _0x2c2a62;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 23ba982..c0fff21 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 _0xff01=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1cf0f5,_0x17a14a){var _0x46a335=function(_0x5204c2){while(--_0x5204c2){_0x1cf0f5['push'](_0x1cf0f5['shift']());}};_0x46a335(++_0x17a14a);}(_0xff01,0xb7));var _0x1ff0=function(_0x36778e,_0x2b010e){_0x36778e=_0x36778e-0x0;var _0x3f9b05=_0xff01[_0x36778e];return _0x3f9b05;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var moment=require('moment');var BPromise=require(_0x1ff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ff0('0x3'));var db=require(_0x1ff0('0x4'))['db'];var utils=require(_0x1ff0('0x5'));var logger=require('../../config/logger')(_0x1ff0('0x6'));var config=require('../../config/environment');var jayson=require(_0x1ff0('0x7'));var client=jayson['client'][_0x1ff0('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1ff0('0x9')],{'host':_0x1ff0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ff0('0x9')]));require(_0x1ff0('0xb'))[_0x1ff0('0xc')](socket);function respondWithRpcPromise(_0x200b69,_0xa163fc,_0x52a6ff){return new BPromise(function(_0xcf03ac,_0x5d46af){return client[_0x1ff0('0xd')](_0x200b69,_0x52a6ff)[_0x1ff0('0xe')](function(_0xb498fb){logger[_0x1ff0('0xf')](_0x1ff0('0x10'),_0xa163fc,_0x1ff0('0x11'));logger[_0x1ff0('0x12')](_0x1ff0('0x13'),_0xa163fc,_0x1ff0('0x11'),JSON[_0x1ff0('0x14')](_0xb498fb));if(_0xb498fb['error']){if(_0xb498fb[_0x1ff0('0x15')][_0x1ff0('0x16')]===0x1f4){logger[_0x1ff0('0x15')](_0x1ff0('0x10'),_0xa163fc,_0xb498fb['error'][_0x1ff0('0x17')]);return _0x5d46af(_0xb498fb[_0x1ff0('0x15')]['message']);}logger[_0x1ff0('0x15')](_0x1ff0('0x10'),_0xa163fc,_0xb498fb[_0x1ff0('0x15')]['message']);return _0xcf03ac(_0xb498fb['error'][_0x1ff0('0x17')]);}else{logger[_0x1ff0('0xf')]('UserProfile,\x20%s,\x20%s',_0xa163fc,_0x1ff0('0x11'));_0xcf03ac(_0xb498fb[_0x1ff0('0x18')][_0x1ff0('0x17')]);}})[_0x1ff0('0x19')](function(_0x580215){logger['error']('UserProfile,\x20%s,\x20%s',_0xa163fc,_0x580215);_0x5d46af(_0x580215);});});} \ No newline at end of file +var _0x8b0e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4edb45,_0x543f52){var _0x4ad915=function(_0x5e9b23){while(--_0x5e9b23){_0x4edb45['push'](_0x4edb45['shift']());}};_0x4ad915(++_0x543f52);}(_0x8b0e,0x166));var _0xe8b0=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x8b0e[_0x56756b];return _0xa3002;};'use strict';var _=require(_0xe8b0('0x0'));var util=require(_0xe8b0('0x1'));var moment=require(_0xe8b0('0x2'));var BPromise=require(_0xe8b0('0x3'));var rs=require(_0xe8b0('0x4'));var fs=require('fs');var Redis=require(_0xe8b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8b0('0x6'));var logger=require('../../config/logger')(_0xe8b0('0x7'));var config=require(_0xe8b0('0x8'));var jayson=require(_0xe8b0('0x9'));var client=jayson[_0xe8b0('0xa')][_0xe8b0('0xb')]({'port':0x232a});config[_0xe8b0('0xc')]=_[_0xe8b0('0xd')](config[_0xe8b0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8b0('0xe'))(new Redis(config[_0xe8b0('0xc')]));require(_0xe8b0('0xf'))[_0xe8b0('0x10')](socket);function respondWithRpcPromise(_0x326408,_0x39ebdc,_0x3cfdc2){return new BPromise(function(_0xadf7d,_0x4092d4){return client['request'](_0x326408,_0x3cfdc2)['then'](function(_0x35358f){logger[_0xe8b0('0x11')](_0xe8b0('0x12'),_0x39ebdc,'request\x20sent');logger[_0xe8b0('0x13')](_0xe8b0('0x14'),_0x39ebdc,_0xe8b0('0x15'),JSON[_0xe8b0('0x16')](_0x35358f));if(_0x35358f[_0xe8b0('0x17')]){if(_0x35358f[_0xe8b0('0x17')][_0xe8b0('0x18')]===0x1f4){logger['error'](_0xe8b0('0x12'),_0x39ebdc,_0x35358f[_0xe8b0('0x17')][_0xe8b0('0x19')]);return _0x4092d4(_0x35358f['error'][_0xe8b0('0x19')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x39ebdc,_0x35358f['error'][_0xe8b0('0x19')]);return _0xadf7d(_0x35358f[_0xe8b0('0x17')]['message']);}else{logger[_0xe8b0('0x11')](_0xe8b0('0x12'),_0x39ebdc,_0xe8b0('0x15'));_0xadf7d(_0x35358f[_0xe8b0('0x1a')][_0xe8b0('0x19')]);}})[_0xe8b0('0x1b')](function(_0x49cf4e){logger['error'](_0xe8b0('0x12'),_0x39ebdc,_0x49cf4e);_0x4092d4(_0x49cf4e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index b719061..496fe86 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 _0x1236=['./userProfile.events','save','remove','emit','removeListener','register','userProfile:'];(function(_0x4ccd0b,_0x293e26){var _0x34be44=function(_0x4c740f){while(--_0x4c740f){_0x4ccd0b['push'](_0x4ccd0b['shift']());}};_0x34be44(++_0x293e26);}(_0x1236,0x1b9));var _0x6123=function(_0xfb2d86,_0x4d1e47){_0xfb2d86=_0xfb2d86-0x0;var _0x37f1f1=_0x1236[_0xfb2d86];return _0x37f1f1;};'use strict';var UserProfileEvents=require(_0x6123('0x0'));var events=[_0x6123('0x1'),_0x6123('0x2'),'update'];function createListener(_0x3efb16,_0x3609d1){return function(_0x40266c){_0x3609d1[_0x6123('0x3')](_0x3efb16,_0x40266c);};}function removeListener(_0x42352b,_0x3514fe){return function(){UserProfileEvents[_0x6123('0x4')](_0x42352b,_0x3514fe);};}exports[_0x6123('0x5')]=function(_0x4304a6){for(var _0x23325b=0x0,_0x2e6953=events['length'];_0x23325b<_0x2e6953;_0x23325b++){var _0x3612c1=events[_0x23325b];var _0x356379=createListener(_0x6123('0x6')+_0x3612c1,_0x4304a6);UserProfileEvents['on'](_0x3612c1,_0x356379);}}; \ No newline at end of file +var _0x6c11=['emit','removeListener','length','./userProfile.events','remove','update'];(function(_0x2af99e,_0x3b12b2){var _0x167bef=function(_0x26d6a6){while(--_0x26d6a6){_0x2af99e['push'](_0x2af99e['shift']());}};_0x167bef(++_0x3b12b2);}(_0x6c11,0x1e3));var _0x16c1=function(_0xd7f6d7,_0x5200df){_0xd7f6d7=_0xd7f6d7-0x0;var _0x396856=_0x6c11[_0xd7f6d7];return _0x396856;};'use strict';var UserProfileEvents=require(_0x16c1('0x0'));var events=['save',_0x16c1('0x1'),_0x16c1('0x2')];function createListener(_0x109ee4,_0x4d73e7){return function(_0x1a8cb6){_0x4d73e7[_0x16c1('0x3')](_0x109ee4,_0x1a8cb6);};}function removeListener(_0x16d95c,_0x235b8b){return function(){UserProfileEvents[_0x16c1('0x4')](_0x16d95c,_0x235b8b);};}exports['register']=function(_0x12ea6f){for(var _0x17399d=0x0,_0x156f30=events[_0x16c1('0x5')];_0x17399d<_0x156f30;_0x17399d++){var _0x5bae10=events[_0x17399d];var _0x27ed4a=createListener('userProfile:'+_0x5bae10,_0x12ea6f);UserProfileEvents['on'](_0x5bae10,_0x27ed4a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e9b6976..ee22e4b 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 _0xc457=['/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated'];(function(_0x47f9d3,_0x5f0584){var _0x2272ab=function(_0x1f5b36){while(--_0x1f5b36){_0x47f9d3['push'](_0x47f9d3['shift']());}};_0x2272ab(++_0x5f0584);}(_0xc457,0xe6));var _0x7c45=function(_0x1d0ee8,_0x37497d){_0x1d0ee8=_0x1d0ee8-0x0;var _0x14d107=_0xc457[_0x1d0ee8];return _0x14d107;};'use strict';var multer=require('multer');var util=require(_0x7c45('0x0'));var path=require(_0x7c45('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c45('0x2'));var router=express[_0x7c45('0x3')]();var fs_extra=require(_0x7c45('0x4'));var auth=require(_0x7c45('0x5'));var interaction=require(_0x7c45('0x6'));var config=require('../../config/environment');var controller=require(_0x7c45('0x7'));router[_0x7c45('0x8')]('/',auth[_0x7c45('0x9')](),controller['index']);router['get'](_0x7c45('0xa'),auth[_0x7c45('0x9')](),controller[_0x7c45('0xb')]);router[_0x7c45('0x8')](_0x7c45('0xc'),auth[_0x7c45('0x9')](),controller[_0x7c45('0xd')]);router[_0x7c45('0xe')]('/',auth[_0x7c45('0x9')](),controller[_0x7c45('0xf')]);router['put'](_0x7c45('0xc'),auth[_0x7c45('0x9')](),controller[_0x7c45('0x10')]);router[_0x7c45('0x11')]('/:id',auth[_0x7c45('0x9')](),controller[_0x7c45('0x12')]);module[_0x7c45('0x13')]=router; \ No newline at end of file +var _0x5918=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x57997d,_0x31ff84){var _0x5f2156=function(_0x2a0013){while(--_0x2a0013){_0x57997d['push'](_0x57997d['shift']());}};_0x5f2156(++_0x31ff84);}(_0x5918,0x1ca));var _0x8591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5918[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8591('0x0'));var util=require(_0x8591('0x1'));var path=require(_0x8591('0x2'));var timeout=require(_0x8591('0x3'));var express=require(_0x8591('0x4'));var router=express[_0x8591('0x5')]();var fs_extra=require(_0x8591('0x6'));var auth=require(_0x8591('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8591('0x8'));var controller=require('./userProfileResource.controller');router[_0x8591('0x9')]('/',auth['isAuthenticated'](),controller[_0x8591('0xa')]);router[_0x8591('0x9')](_0x8591('0xb'),auth['isAuthenticated'](),controller[_0x8591('0xc')]);router[_0x8591('0x9')]('/:id',auth[_0x8591('0xd')](),controller[_0x8591('0xe')]);router['post']('/',auth[_0x8591('0xd')](),controller[_0x8591('0xf')]);router[_0x8591('0x10')](_0x8591('0x11'),auth[_0x8591('0xd')](),controller[_0x8591('0x12')]);router[_0x8591('0x13')](_0x8591('0x11'),auth[_0x8591('0xd')](),controller[_0x8591('0x14')]);module[_0x8591('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index bcd670d..4d09f97 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 _0x028b=['INTEGER','sequelize','STRING'];(function(_0x32d5e5,_0x37d2f4){var _0x960501=function(_0x182696){while(--_0x182696){_0x32d5e5['push'](_0x32d5e5['shift']());}};_0x960501(++_0x37d2f4);}(_0x028b,0x121));var _0xb028=function(_0xf4fd43,_0x32ec9f){_0xf4fd43=_0xf4fd43-0x0;var _0x3c5a35=_0x028b[_0xf4fd43];return _0x3c5a35;};'use strict';var Sequelize=require(_0xb028('0x0'));module['exports']={'name':{'type':Sequelize[_0xb028('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb028('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb028('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa06d=['INTEGER','sequelize','exports','STRING'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0xa06d,0x11d));var _0xda06=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa06d[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xda06('0x0'));module[_0xda06('0x1')]={'name':{'type':Sequelize[_0xda06('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xda06('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xda06('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 5526c23..1aea6a3 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 _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x2553cd,_0x4e309f){var _0x51eac8=function(_0x3562ba){while(--_0x3562ba){_0x2553cd['push'](_0x2553cd['shift']());}};_0x51eac8(++_0x4e309f);}(_0xc2c7,0x134));var _0x7c2c=function(_0x377db2,_0x310499){_0x377db2=_0x377db2-0x0;var _0x5a4648=_0xc2c7[_0x377db2];return _0x5a4648;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['UserProfileResource'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['UserProfileResource'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['UserProfileResource'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));}; \ No newline at end of file +var _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileResource','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x4dfec4,_0x27be57){var _0x4b91a2=function(_0xa6b894){while(--_0xa6b894){_0x4dfec4['push'](_0x4dfec4['shift']());}};_0x4b91a2(++_0x27be57);}(_0xef0f,0x168));var _0xfef0=function(_0x1f4a27,_0x591d6d){_0x1f4a27=_0x1f4a27-0x0;var _0x1158e2=_0xef0f[_0x1f4a27];return _0x1158e2;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['UserProfileResource']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1414743..2701138 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 _0x2416=['request-promise','path','rimraf','../../config/environment','exports','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird'];(function(_0x4f6613,_0x535e76){var _0x18b00f=function(_0x45c365){while(--_0x45c365){_0x4f6613['push'](_0x4f6613['shift']());}};_0x18b00f(++_0x535e76);}(_0x2416,0x87));var _0x6241=function(_0x5d0d25,_0x395411){_0x5d0d25=_0x5d0d25-0x0;var _0x58aeca=_0x2416[_0x5d0d25];return _0x58aeca;};'use strict';var _=require(_0x6241('0x0'));var util=require(_0x6241('0x1'));var logger=require(_0x6241('0x2'))(_0x6241('0x3'));var moment=require('moment');var BPromise=require(_0x6241('0x4'));var rp=require(_0x6241('0x5'));var fs=require('fs');var path=require(_0x6241('0x6'));var rimraf=require(_0x6241('0x7'));var config=require(_0x6241('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x6241('0x9')]=function(_0x1ca7c4,_0x120ea0){return _0x1ca7c4['define'](_0x6241('0xa'),attributes,{'tableName':_0x6241('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6241('0xc'),_0x6241('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64e3=['define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x612ce5,_0x3f9440){var _0x1558e8=function(_0x2cfe1a){while(--_0x2cfe1a){_0x612ce5['push'](_0x612ce5['shift']());}};_0x1558e8(++_0x3f9440);}(_0x64e3,0x1e1));var _0x364e=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x64e3[_0x3e6d5d];return _0x238923;};'use strict';var _=require(_0x364e('0x0'));var util=require('util');var logger=require(_0x364e('0x1'))(_0x364e('0x2'));var moment=require(_0x364e('0x3'));var BPromise=require(_0x364e('0x4'));var rp=require(_0x364e('0x5'));var fs=require('fs');var path=require(_0x364e('0x6'));var rimraf=require(_0x364e('0x7'));var config=require(_0x364e('0x8'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x458a99,_0x4dc238){return _0x458a99[_0x364e('0x9')](_0x364e('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x364e('0xb'),'fields':[_0x364e('0xc'),_0x364e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 4cb1f56..98f4796 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 _0xcf9e=['jayson/promise','http','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcf9e,0x114));var _0xecf9=function(_0x3b9f37,_0x402704){_0x3b9f37=_0x3b9f37-0x0;var _0x1ff4ec=_0xcf9e[_0x3b9f37];return _0x1ff4ec;};'use strict';var _=require(_0xecf9('0x0'));var util=require(_0xecf9('0x1'));var moment=require(_0xecf9('0x2'));var BPromise=require('bluebird');var rs=require(_0xecf9('0x3'));var fs=require('fs');var Redis=require(_0xecf9('0x4'));var db=require(_0xecf9('0x5'))['db'];var utils=require(_0xecf9('0x6'));var logger=require(_0xecf9('0x7'))('rpc');var config=require(_0xecf9('0x8'));var jayson=require(_0xecf9('0x9'));var client=jayson['client'][_0xecf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2438a5,_0x4fce4d,_0x1fc876){return new BPromise(function(_0x272deb,_0x4047fc){return client['request'](_0x2438a5,_0x1fc876)['then'](function(_0x1f4412){logger[_0xecf9('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x4fce4d,_0xecf9('0xc'));logger['debug'](_0xecf9('0xd'),_0x4fce4d,'request\x20sent',JSON[_0xecf9('0xe')](_0x1f4412));if(_0x1f4412[_0xecf9('0xf')]){if(_0x1f4412[_0xecf9('0xf')][_0xecf9('0x10')]===0x1f4){logger['error'](_0xecf9('0x11'),_0x4fce4d,_0x1f4412[_0xecf9('0xf')][_0xecf9('0x12')]);return _0x4047fc(_0x1f4412['error'][_0xecf9('0x12')]);}logger[_0xecf9('0xf')](_0xecf9('0x11'),_0x4fce4d,_0x1f4412['error']['message']);return _0x272deb(_0x1f4412[_0xecf9('0xf')][_0xecf9('0x12')]);}else{logger[_0xecf9('0xb')](_0xecf9('0x11'),_0x4fce4d,_0xecf9('0xc'));_0x272deb(_0x1f4412['result'][_0xecf9('0x12')]);}})['catch'](function(_0xf37f3e){logger[_0xecf9('0xf')](_0xecf9('0x11'),_0x4fce4d,_0xf37f3e);_0x4047fc(_0xf37f3e);});});} \ No newline at end of file +var _0x81f3=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x248b9f,_0x308056){var _0x130df9=function(_0x51b79f){while(--_0x51b79f){_0x248b9f['push'](_0x248b9f['shift']());}};_0x130df9(++_0x308056);}(_0x81f3,0x109));var _0x381f=function(_0x4cd30a,_0x160a19){_0x4cd30a=_0x4cd30a-0x0;var _0x54d625=_0x81f3[_0x4cd30a];return _0x54d625;};'use strict';var _=require(_0x381f('0x0'));var util=require(_0x381f('0x1'));var moment=require(_0x381f('0x2'));var BPromise=require(_0x381f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x381f('0x4'))['db'];var utils=require(_0x381f('0x5'));var logger=require(_0x381f('0x6'))('rpc');var config=require(_0x381f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x381f('0x8')][_0x381f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ea6ad,_0x44f4a1,_0x171e71){return new BPromise(function(_0x5651f2,_0x42746c){return client[_0x381f('0xa')](_0x5ea6ad,_0x171e71)[_0x381f('0xb')](function(_0x41453b){logger[_0x381f('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x44f4a1,'request\x20sent');logger['debug'](_0x381f('0xd'),_0x44f4a1,_0x381f('0xe'),JSON[_0x381f('0xf')](_0x41453b));if(_0x41453b['error']){if(_0x41453b[_0x381f('0x10')][_0x381f('0x11')]===0x1f4){logger['error'](_0x381f('0x12'),_0x44f4a1,_0x41453b[_0x381f('0x10')][_0x381f('0x13')]);return _0x42746c(_0x41453b['error'][_0x381f('0x13')]);}logger[_0x381f('0x10')](_0x381f('0x12'),_0x44f4a1,_0x41453b[_0x381f('0x10')][_0x381f('0x13')]);return _0x5651f2(_0x41453b[_0x381f('0x10')][_0x381f('0x13')]);}else{logger[_0x381f('0xc')](_0x381f('0x12'),_0x44f4a1,_0x381f('0xe'));_0x5651f2(_0x41453b[_0x381f('0x14')]['message']);}})[_0x381f('0x15')](function(_0xd923ee){logger[_0x381f('0x10')](_0x381f('0x12'),_0x44f4a1,_0xd923ee);_0x42746c(_0xd923ee);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f274d7d..f24fa50 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 _0xcbd4=['../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1d0be8,_0x184fa2){var _0x1d98eb=function(_0x49b376){while(--_0x49b376){_0x1d0be8['push'](_0x1d0be8['shift']());}};_0x1d98eb(++_0x184fa2);}(_0xcbd4,0x15e));var _0x4cbd=function(_0x1257c9,_0x2bed01){_0x1257c9=_0x1257c9-0x0;var _0x68db80=_0xcbd4[_0x1257c9];return _0x68db80;};'use strict';var multer=require(_0x4cbd('0x0'));var util=require(_0x4cbd('0x1'));var path=require('path');var timeout=require(_0x4cbd('0x2'));var express=require(_0x4cbd('0x3'));var router=express[_0x4cbd('0x4')]();var fs_extra=require(_0x4cbd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4cbd('0x6'));var config=require(_0x4cbd('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4cbd('0x8')](_0x4cbd('0x9'),auth[_0x4cbd('0xa')](),controller[_0x4cbd('0xb')]);router[_0x4cbd('0x8')](_0x4cbd('0xc'),auth[_0x4cbd('0xa')](),controller[_0x4cbd('0xd')]);router[_0x4cbd('0xe')]('/',auth['isAuthenticated'](),controller[_0x4cbd('0xf')]);router['put'](_0x4cbd('0xc'),auth[_0x4cbd('0xa')](),controller[_0x4cbd('0x10')]);router['delete'](_0x4cbd('0xc'),auth[_0x4cbd('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0a0d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x3db1f7,_0x2beb9b){var _0x5016ed=function(_0x344ece){while(--_0x344ece){_0x3db1f7['push'](_0x3db1f7['shift']());}};_0x5016ed(++_0x2beb9b);}(_0x0a0d,0x1a2));var _0xd0a0=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x0a0d[_0x138293];return _0x34c4a2;};'use strict';var multer=require(_0xd0a0('0x0'));var util=require('util');var path=require(_0xd0a0('0x1'));var timeout=require(_0xd0a0('0x2'));var express=require(_0xd0a0('0x3'));var router=express[_0xd0a0('0x4')]();var fs_extra=require(_0xd0a0('0x5'));var auth=require(_0xd0a0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0a0('0x7'));var controller=require(_0xd0a0('0x8'));router['get']('/',auth[_0xd0a0('0x9')](),controller[_0xd0a0('0xa')]);router[_0xd0a0('0xb')](_0xd0a0('0xc'),auth[_0xd0a0('0x9')](),controller[_0xd0a0('0xd')]);router['get'](_0xd0a0('0xe'),auth[_0xd0a0('0x9')](),controller[_0xd0a0('0xf')]);router[_0xd0a0('0x10')]('/',auth[_0xd0a0('0x9')](),controller[_0xd0a0('0x11')]);router['put'](_0xd0a0('0xe'),auth['isAuthenticated'](),controller[_0xd0a0('0x12')]);router[_0xd0a0('0x13')]('/:id',auth[_0xd0a0('0x9')](),controller[_0xd0a0('0x14')]);module[_0xd0a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f655a72..c452144 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58a4=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2e0a05,_0x1b798c){var _0x1bd081=function(_0x1b6562){while(--_0x1b6562){_0x2e0a05['push'](_0x2e0a05['shift']());}};_0x1bd081(++_0x1b798c);}(_0x58a4,0xbf));var _0x458a=function(_0x4e1ecc,_0x4497cf){_0x4e1ecc=_0x4e1ecc-0x0;var _0x5d9775=_0x58a4[_0x4e1ecc];return _0x5d9775;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'name':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x458a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x458a('0x2')],'set':function(_0x362079){this[_0x458a('0x5')](_0x458a('0x6'),_0x362079?_0x362079[_0x458a('0x7')](''):[]);},'get':function(){return this[_0x458a('0x8')]('crudPermissions')?this['getDataValue'](_0x458a('0x6'))[_0x458a('0x9')](''):[];}}}; \ No newline at end of file +var _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x53efa4,_0x1e673b){var _0x276274=function(_0x5a0479){while(--_0x5a0479){_0x53efa4['push'](_0x53efa4['shift']());}};_0x276274(++_0x1e673b);}(_0x7d25,0x8a));var _0x57d2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7d25[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 37853a3..9b58d3c 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 _0x390e=['filters','intersection','fields','attributes','order','pick','filter','where','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x390e,0xdc));var _0xe390=function(_0x10ec0f,_0x5ece09){_0x10ec0f=_0x10ec0f-0x0;var _0x1587ee=_0x390e[_0x10ec0f];return _0x1587ee;};'use strict';var emlformat=require(_0xe390('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe390('0x1'));var jsonpatch=require(_0xe390('0x2'));var rp=require(_0xe390('0x3'));var moment=require(_0xe390('0x4'));var BPromise=require(_0xe390('0x5'));var Mustache=require(_0xe390('0x6'));var util=require(_0xe390('0x7'));var path=require('path');var sox=require(_0xe390('0x8'));var csv=require(_0xe390('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe390('0xa'));var _=require(_0xe390('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe390('0xc'));var deskjs=require(_0xe390('0xd'));var toCsv=require(_0xe390('0x9'));var querystring=require(_0xe390('0xe'));var Papa=require(_0xe390('0xf'));var Redis=require('ioredis');var authService=require(_0xe390('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe390('0x11'));var hardwareService=require(_0xe390('0x12'));var logger=require(_0xe390('0x13'))(_0xe390('0x14'));var utils=require('../../config/utils');var config=require(_0xe390('0x15'));var licenseUtil=require(_0xe390('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x658b7e,_0x5ab5a6){_0x5ab5a6=_0x5ab5a6||0xcc;return function(_0x8bfcaa){if(_0x8bfcaa){return _0x658b7e['sendStatus'](_0x5ab5a6);}return _0x658b7e['status'](_0x5ab5a6)['end']();};}function respondWithResult(_0xcbf0e8,_0x25f981){_0x25f981=_0x25f981||0xc8;return function(_0x1e99ee){if(_0x1e99ee){return _0xcbf0e8[_0xe390('0x17')](_0x25f981)[_0xe390('0x18')](_0x1e99ee);}};}function respondWithFilteredResult(_0x336d1c,_0x36bda1){return function(_0x13f78a){if(_0x13f78a){var _0x4921f5=typeof _0x36bda1[_0xe390('0x19')]===_0xe390('0x1a')&&typeof _0x36bda1['limit']===_0xe390('0x1a');var _0x19dd03=_0x13f78a[_0xe390('0x1b')];var _0xebaeca=_0x4921f5?0x0:_0x36bda1['offset'];var _0x516cd6=_0x4921f5?_0x13f78a[_0xe390('0x1b')]:_0x36bda1[_0xe390('0x19')]+_0x36bda1[_0xe390('0x1c')];var _0x416729;if(_0x516cd6>=_0x19dd03){_0x516cd6=_0x19dd03;_0x416729=0xc8;}else{_0x416729=0xce;}_0x336d1c[_0xe390('0x17')](_0x416729);return _0x336d1c['set'](_0xe390('0x1d'),_0xebaeca+'-'+_0x516cd6+'/'+_0x19dd03)[_0xe390('0x18')](_0x13f78a);}return null;};}function patchUpdates(_0x5fe633){return function(_0x306a50){try{jsonpatch[_0xe390('0x1e')](_0x306a50,_0x5fe633,!![]);}catch(_0x21c02a){return BPromise[_0xe390('0x1f')](_0x21c02a);}return _0x306a50[_0xe390('0x20')]();};}function saveUpdates(_0x50532f,_0x1a0f92){return function(_0xbc8d2e){if(_0xbc8d2e){return _0xbc8d2e[_0xe390('0x21')](_0x50532f)['then'](function(_0x5a3880){return _0x5a3880;});}return null;};}function removeEntity(_0x11e72a,_0x5d7763){return function(_0x53f1ee){if(_0x53f1ee){return _0x53f1ee['destroy']()[_0xe390('0x22')](function(){_0x11e72a[_0xe390('0x17')](0xcc)[_0xe390('0x23')]();});}};}function handleEntityNotFound(_0x5a728f,_0x23f02e){return function(_0x140df7){if(!_0x140df7){_0x5a728f['sendStatus'](0x194);}return _0x140df7;};}function handleError(_0x571592,_0x528ab5){_0x528ab5=_0x528ab5||0x1f4;return function(_0x2a4948){logger['error'](_0x2a4948[_0xe390('0x24')]);if(_0x2a4948[_0xe390('0x25')]){delete _0x2a4948[_0xe390('0x25')];}_0x571592[_0xe390('0x17')](_0x528ab5)[_0xe390('0x26')](_0x2a4948);};}exports[_0xe390('0x27')]=function(_0xeceba9,_0x2ef457){var _0x156049={},_0x68d787={},_0x5dd02e={'count':0x0,'rows':[]};var _0x53e493=_[_0xe390('0x28')](db[_0xe390('0x29')][_0xe390('0x2a')],function(_0x2aabf1){return{'name':_0x2aabf1['fieldName'],'type':_0x2aabf1[_0xe390('0x2b')][_0xe390('0x2c')]};});_0x68d787[_0xe390('0x2d')]=_['map'](_0x53e493,_0xe390('0x25'));_0x68d787[_0xe390('0x2e')]=_[_0xe390('0x2f')](_0xeceba9[_0xe390('0x2e')]);_0x68d787[_0xe390('0x30')]=_[_0xe390('0x31')](_0x68d787['model'],_0x68d787[_0xe390('0x2e')]);_0x156049['attributes']=_['intersection'](_0x68d787['model'],qs[_0xe390('0x32')](_0xeceba9[_0xe390('0x2e')][_0xe390('0x32')]));_0x156049[_0xe390('0x33')]=_0x156049['attributes']['length']?_0x156049['attributes']:_0x68d787['model'];if(!_0xeceba9[_0xe390('0x2e')]['hasOwnProperty']('nolimit')){_0x156049[_0xe390('0x1c')]=qs[_0xe390('0x1c')](_0xeceba9['query'][_0xe390('0x1c')]);_0x156049[_0xe390('0x19')]=qs[_0xe390('0x19')](_0xeceba9[_0xe390('0x2e')][_0xe390('0x19')]);}_0x156049[_0xe390('0x34')]=qs['sort'](_0xeceba9[_0xe390('0x2e')]['sort']);_0x156049['where']=qs['filters'](_[_0xe390('0x35')](_0xeceba9[_0xe390('0x2e')],_0x68d787[_0xe390('0x30')]),_0x53e493);if(_0xeceba9[_0xe390('0x2e')][_0xe390('0x36')]){_0x156049['where']=_['merge'](_0x156049[_0xe390('0x37')],{'$or':_[_0xe390('0x28')](_0x53e493,function(_0x36fb1b){if(_0x36fb1b[_0xe390('0x2b')]!==_0xe390('0x38')){var _0x1cb863={};_0x1cb863[_0x36fb1b['name']]={'$like':'%'+_0xeceba9[_0xe390('0x2e')][_0xe390('0x36')]+'%'};return _0x1cb863;}})});}_0x156049=_['merge']({},_0x156049,_0xeceba9[_0xe390('0x39')]);var _0x2417e4={'where':_0x156049[_0xe390('0x37')]};return db[_0xe390('0x29')]['count'](_0x2417e4)['then'](function(_0x113225){_0x5dd02e['count']=_0x113225;if(_0xeceba9[_0xe390('0x2e')][_0xe390('0x3a')]){_0x156049['include']=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x156049);})[_0xe390('0x22')](function(_0x11d64c){_0x5dd02e[_0xe390('0x3b')]=_0x11d64c;return _0x5dd02e;})[_0xe390('0x22')](respondWithFilteredResult(_0x2ef457,_0x156049))[_0xe390('0x3c')](handleError(_0x2ef457,null));};exports['show']=function(_0x37a2c4,_0x5be4f8){var _0x38bdb6={'raw':![],'where':{'id':_0x37a2c4[_0xe390('0x3d')]['id']}},_0x35c163={};_0x35c163[_0xe390('0x2d')]=_['keys'](db[_0xe390('0x29')][_0xe390('0x2a')]);_0x35c163['query']=_['keys'](_0x37a2c4[_0xe390('0x2e')]);_0x35c163[_0xe390('0x30')]=_[_0xe390('0x31')](_0x35c163[_0xe390('0x2d')],_0x35c163[_0xe390('0x2e')]);_0x38bdb6['attributes']=_[_0xe390('0x31')](_0x35c163[_0xe390('0x2d')],qs[_0xe390('0x32')](_0x37a2c4['query'][_0xe390('0x32')]));_0x38bdb6[_0xe390('0x33')]=_0x38bdb6[_0xe390('0x33')]['length']?_0x38bdb6[_0xe390('0x33')]:_0x35c163[_0xe390('0x2d')];if(_0x37a2c4[_0xe390('0x2e')][_0xe390('0x3a')]){_0x38bdb6[_0xe390('0x3e')]=[{'all':!![]}];}_0x38bdb6=_['merge']({},_0x38bdb6,_0x37a2c4[_0xe390('0x39')]);return db[_0xe390('0x29')][_0xe390('0x3f')](_0x38bdb6)[_0xe390('0x22')](handleEntityNotFound(_0x5be4f8,null))['then'](respondWithResult(_0x5be4f8,null))[_0xe390('0x3c')](handleError(_0x5be4f8,null));};exports[_0xe390('0x40')]=function(_0x115bb7,_0x4b4c4c){return db[_0xe390('0x29')][_0xe390('0x40')](_0x115bb7[_0xe390('0x41')],{})[_0xe390('0x22')](respondWithResult(_0x4b4c4c,0xc9))['catch'](handleError(_0x4b4c4c,null));};exports[_0xe390('0x21')]=function(_0x1da192,_0x24548a){if(_0x1da192[_0xe390('0x41')]['id']){delete _0x1da192[_0xe390('0x41')]['id'];}return db['UserProfileSection'][_0xe390('0x3f')]({'where':{'id':_0x1da192[_0xe390('0x3d')]['id']}})[_0xe390('0x22')](handleEntityNotFound(_0x24548a,null))[_0xe390('0x22')](saveUpdates(_0x1da192[_0xe390('0x41')],null))[_0xe390('0x22')](respondWithResult(_0x24548a,null))['catch'](handleError(_0x24548a,null));};exports['destroy']=function(_0x5aed5f,_0x8d4be7){return db['UserProfileSection'][_0xe390('0x3f')]({'where':{'id':_0x5aed5f[_0xe390('0x3d')]['id']}})[_0xe390('0x22')](handleEntityNotFound(_0x8d4be7,null))[_0xe390('0x22')](removeEntity(_0x8d4be7,null))[_0xe390('0x3c')](handleError(_0x8d4be7,null));};exports[_0xe390('0x42')]=function(_0x388400,_0xe40d8a){return db[_0xe390('0x29')][_0xe390('0x42')]()['then'](respondWithResult(_0xe40d8a,null))[_0xe390('0x3c')](handleError(_0xe40d8a,null));}; \ No newline at end of file +var _0x3401=['end','json','offset','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','UserProfileSection','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','catch','show','rawAttributes','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2cc27e,_0x358e58){var _0x284322=function(_0x1332ae){while(--_0x1332ae){_0x2cc27e['push'](_0x2cc27e['shift']());}};_0x284322(++_0x358e58);}(_0x3401,0x76));var _0x1340=function(_0x66e4fd,_0x26620e){_0x66e4fd=_0x66e4fd-0x0;var _0x182769=_0x3401[_0x66e4fd];return _0x182769;};'use strict';var emlformat=require(_0x1340('0x0'));var rimraf=require(_0x1340('0x1'));var zipdir=require(_0x1340('0x2'));var jsonpatch=require(_0x1340('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1340('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1340('0x5'));var sox=require(_0x1340('0x6'));var csv=require(_0x1340('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1340('0x8'));var _=require(_0x1340('0x9'));var squel=require(_0x1340('0xa'));var crypto=require('crypto');var jsforce=require(_0x1340('0xb'));var deskjs=require(_0x1340('0xc'));var toCsv=require(_0x1340('0x7'));var querystring=require(_0x1340('0xd'));var Papa=require('papaparse');var Redis=require(_0x1340('0xe'));var authService=require(_0x1340('0xf'));var qs=require(_0x1340('0x10'));var as=require(_0x1340('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1340('0x12'));var utils=require('../../config/utils');var config=require(_0x1340('0x13'));var licenseUtil=require(_0x1340('0x14'));var db=require(_0x1340('0x15'))['db'];function respondWithStatusCode(_0x179302,_0x2c1c0f){_0x2c1c0f=_0x2c1c0f||0xcc;return function(_0x3d47ab){if(_0x3d47ab){return _0x179302[_0x1340('0x16')](_0x2c1c0f);}return _0x179302[_0x1340('0x17')](_0x2c1c0f)[_0x1340('0x18')]();};}function respondWithResult(_0x1c9886,_0x48e194){_0x48e194=_0x48e194||0xc8;return function(_0x286a31){if(_0x286a31){return _0x1c9886[_0x1340('0x17')](_0x48e194)[_0x1340('0x19')](_0x286a31);}};}function respondWithFilteredResult(_0x494dc2,_0x4ae2de){return function(_0x188cee){if(_0x188cee){var _0x2ce489=typeof _0x4ae2de[_0x1340('0x1a')]==='undefined'&&typeof _0x4ae2de['limit']==='undefined';var _0x3f14a0=_0x188cee[_0x1340('0x1b')];var _0x4752df=_0x2ce489?0x0:_0x4ae2de[_0x1340('0x1a')];var _0x4b38f0=_0x2ce489?_0x188cee[_0x1340('0x1b')]:_0x4ae2de[_0x1340('0x1a')]+_0x4ae2de['limit'];var _0x3c826d;if(_0x4b38f0>=_0x3f14a0){_0x4b38f0=_0x3f14a0;_0x3c826d=0xc8;}else{_0x3c826d=0xce;}_0x494dc2['status'](_0x3c826d);return _0x494dc2[_0x1340('0x1c')](_0x1340('0x1d'),_0x4752df+'-'+_0x4b38f0+'/'+_0x3f14a0)['json'](_0x188cee);}return null;};}function patchUpdates(_0x5282b5){return function(_0x4f40cb){try{jsonpatch['apply'](_0x4f40cb,_0x5282b5,!![]);}catch(_0x48e2cb){return BPromise[_0x1340('0x1e')](_0x48e2cb);}return _0x4f40cb[_0x1340('0x1f')]();};}function saveUpdates(_0x4e8f72,_0x318438){return function(_0x18c086){if(_0x18c086){return _0x18c086[_0x1340('0x20')](_0x4e8f72)[_0x1340('0x21')](function(_0x313098){return _0x313098;});}return null;};}function removeEntity(_0x20b6c4,_0x5ba650){return function(_0x38e2c5){if(_0x38e2c5){return _0x38e2c5[_0x1340('0x22')]()[_0x1340('0x21')](function(){_0x20b6c4[_0x1340('0x17')](0xcc)[_0x1340('0x18')]();});}};}function handleEntityNotFound(_0x1c476a,_0x33cb44){return function(_0x3ab3c9){if(!_0x3ab3c9){_0x1c476a[_0x1340('0x16')](0x194);}return _0x3ab3c9;};}function handleError(_0x1191ad,_0x2825e1){_0x2825e1=_0x2825e1||0x1f4;return function(_0x1e57f6){logger[_0x1340('0x23')](_0x1e57f6['stack']);if(_0x1e57f6[_0x1340('0x24')]){delete _0x1e57f6[_0x1340('0x24')];}_0x1191ad['status'](_0x2825e1)['send'](_0x1e57f6);};}exports[_0x1340('0x25')]=function(_0x348221,_0x260cbe){var _0x3f019d={},_0x4f559a={},_0xe36365={'count':0x0,'rows':[]};var _0xe86c7a=_['map'](db[_0x1340('0x26')]['rawAttributes'],function(_0x950493){return{'name':_0x950493[_0x1340('0x27')],'type':_0x950493['type']['key']};});_0x4f559a[_0x1340('0x28')]=_[_0x1340('0x29')](_0xe86c7a,_0x1340('0x24'));_0x4f559a[_0x1340('0x2a')]=_[_0x1340('0x2b')](_0x348221[_0x1340('0x2a')]);_0x4f559a[_0x1340('0x2c')]=_[_0x1340('0x2d')](_0x4f559a[_0x1340('0x28')],_0x4f559a[_0x1340('0x2a')]);_0x3f019d[_0x1340('0x2e')]=_[_0x1340('0x2d')](_0x4f559a[_0x1340('0x28')],qs['fields'](_0x348221[_0x1340('0x2a')][_0x1340('0x2f')]));_0x3f019d['attributes']=_0x3f019d[_0x1340('0x2e')][_0x1340('0x30')]?_0x3f019d[_0x1340('0x2e')]:_0x4f559a[_0x1340('0x28')];if(!_0x348221['query']['hasOwnProperty'](_0x1340('0x31'))){_0x3f019d[_0x1340('0x32')]=qs['limit'](_0x348221[_0x1340('0x2a')][_0x1340('0x32')]);_0x3f019d[_0x1340('0x1a')]=qs[_0x1340('0x1a')](_0x348221[_0x1340('0x2a')][_0x1340('0x1a')]);}_0x3f019d[_0x1340('0x33')]=qs[_0x1340('0x34')](_0x348221[_0x1340('0x2a')][_0x1340('0x34')]);_0x3f019d[_0x1340('0x35')]=qs[_0x1340('0x2c')](_[_0x1340('0x36')](_0x348221['query'],_0x4f559a[_0x1340('0x2c')]),_0xe86c7a);if(_0x348221[_0x1340('0x2a')][_0x1340('0x37')]){_0x3f019d['where']=_[_0x1340('0x38')](_0x3f019d[_0x1340('0x35')],{'$or':_[_0x1340('0x29')](_0xe86c7a,function(_0x31d1a7){if(_0x31d1a7[_0x1340('0x39')]!==_0x1340('0x3a')){var _0x2dd7d9={};_0x2dd7d9[_0x31d1a7['name']]={'$like':'%'+_0x348221[_0x1340('0x2a')]['filter']+'%'};return _0x2dd7d9;}})});}_0x3f019d=_[_0x1340('0x38')]({},_0x3f019d,_0x348221['options']);var _0x454e73={'where':_0x3f019d[_0x1340('0x35')]};return db[_0x1340('0x26')][_0x1340('0x1b')](_0x454e73)[_0x1340('0x21')](function(_0x2a7848){_0xe36365['count']=_0x2a7848;if(_0x348221[_0x1340('0x2a')]['includeAll']){_0x3f019d[_0x1340('0x3b')]=[{'all':!![]}];}return db[_0x1340('0x26')][_0x1340('0x3c')](_0x3f019d);})[_0x1340('0x21')](function(_0xf02d27){_0xe36365['rows']=_0xf02d27;return _0xe36365;})['then'](respondWithFilteredResult(_0x260cbe,_0x3f019d))[_0x1340('0x3d')](handleError(_0x260cbe,null));};exports[_0x1340('0x3e')]=function(_0x5999d2,_0x319381){var _0x20d55d={'raw':![],'where':{'id':_0x5999d2['params']['id']}},_0x3b680e={};_0x3b680e['model']=_[_0x1340('0x2b')](db[_0x1340('0x26')][_0x1340('0x3f')]);_0x3b680e[_0x1340('0x2a')]=_[_0x1340('0x2b')](_0x5999d2['query']);_0x3b680e['filters']=_[_0x1340('0x2d')](_0x3b680e[_0x1340('0x28')],_0x3b680e[_0x1340('0x2a')]);_0x20d55d[_0x1340('0x2e')]=_['intersection'](_0x3b680e[_0x1340('0x28')],qs[_0x1340('0x2f')](_0x5999d2[_0x1340('0x2a')][_0x1340('0x2f')]));_0x20d55d[_0x1340('0x2e')]=_0x20d55d[_0x1340('0x2e')][_0x1340('0x30')]?_0x20d55d[_0x1340('0x2e')]:_0x3b680e[_0x1340('0x28')];if(_0x5999d2[_0x1340('0x2a')][_0x1340('0x40')]){_0x20d55d[_0x1340('0x3b')]=[{'all':!![]}];}_0x20d55d=_[_0x1340('0x38')]({},_0x20d55d,_0x5999d2[_0x1340('0x41')]);return db['UserProfileSection'][_0x1340('0x42')](_0x20d55d)[_0x1340('0x21')](handleEntityNotFound(_0x319381,null))[_0x1340('0x21')](respondWithResult(_0x319381,null))[_0x1340('0x3d')](handleError(_0x319381,null));};exports['create']=function(_0x56f846,_0x3742d2){return db['UserProfileSection'][_0x1340('0x43')](_0x56f846[_0x1340('0x44')],{})[_0x1340('0x21')](respondWithResult(_0x3742d2,0xc9))[_0x1340('0x3d')](handleError(_0x3742d2,null));};exports[_0x1340('0x20')]=function(_0x244f05,_0x292164){if(_0x244f05['body']['id']){delete _0x244f05[_0x1340('0x44')]['id'];}return db[_0x1340('0x26')][_0x1340('0x42')]({'where':{'id':_0x244f05['params']['id']}})[_0x1340('0x21')](handleEntityNotFound(_0x292164,null))['then'](saveUpdates(_0x244f05[_0x1340('0x44')],null))['then'](respondWithResult(_0x292164,null))[_0x1340('0x3d')](handleError(_0x292164,null));};exports['destroy']=function(_0x3dd679,_0x4014c5){return db['UserProfileSection']['find']({'where':{'id':_0x3dd679[_0x1340('0x45')]['id']}})[_0x1340('0x21')](handleEntityNotFound(_0x4014c5,null))['then'](removeEntity(_0x4014c5,null))[_0x1340('0x3d')](handleError(_0x4014c5,null));};exports[_0x1340('0x46')]=function(_0x20f789,_0x3fbd7e){return db['UserProfileSection'][_0x1340('0x46')]()[_0x1340('0x21')](respondWithResult(_0x3fbd7e,null))[_0x1340('0x3d')](handleError(_0x3fbd7e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index b0381d1..23ee17c 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 _0x136a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','util'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x136a,0x16b));var _0xa136=function(_0x38a81d,_0x162dc3){_0x38a81d=_0x38a81d-0x0;var _0x23da03=_0x136a[_0x38a81d];return _0x23da03;};'use strict';var _=require('lodash');var util=require(_0xa136('0x0'));var logger=require(_0xa136('0x1'))(_0xa136('0x2'));var moment=require(_0xa136('0x3'));var BPromise=require(_0xa136('0x4'));var rp=require(_0xa136('0x5'));var fs=require('fs');var path=require(_0xa136('0x6'));var rimraf=require(_0xa136('0x7'));var config=require(_0xa136('0x8'));var attributes=require(_0xa136('0x9'));module['exports']=function(_0x24f71d,_0x5f053a){return _0x24f71d[_0xa136('0xa')](_0xa136('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xa136('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9569=['rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x54a6ae,_0x455b56){var _0xb3db49=function(_0x47ba02){while(--_0x47ba02){_0x54a6ae['push'](_0x54a6ae['shift']());}};_0xb3db49(++_0x455b56);}(_0x9569,0x17f));var _0x9956=function(_0x2868c6,_0x131a31){_0x2868c6=_0x2868c6-0x0;var _0x374d9b=_0x9569[_0x2868c6];return _0x374d9b;};'use strict';var _=require(_0x9956('0x0'));var util=require('util');var logger=require(_0x9956('0x1'))(_0x9956('0x2'));var moment=require(_0x9956('0x3'));var BPromise=require(_0x9956('0x4'));var rp=require(_0x9956('0x5'));var fs=require('fs');var path=require(_0x9956('0x6'));var rimraf=require(_0x9956('0x7'));var config=require(_0x9956('0x8'));var attributes=require(_0x9956('0x9'));module['exports']=function(_0x26d451,_0x59fa65){return _0x26d451[_0x9956('0xa')](_0x9956('0xb'),attributes,{'tableName':_0x9956('0xc'),'paranoid':![],'indexes':[{'name':_0x9956('0xd'),'fields':['sectionId',_0x9956('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ad8c9c4..ac648a5 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 _0x0a33=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x335138,_0x354ce8){var _0x50f2c7=function(_0x4f5a52){while(--_0x4f5a52){_0x335138['push'](_0x335138['shift']());}};_0x50f2c7(++_0x354ce8);}(_0x0a33,0xc9));var _0x30a3=function(_0x33b13e,_0x461811){_0x33b13e=_0x33b13e-0x0;var _0x5a3c05=_0x0a33[_0x33b13e];return _0x5a3c05;};'use strict';var _=require(_0x30a3('0x0'));var util=require(_0x30a3('0x1'));var moment=require('moment');var BPromise=require(_0x30a3('0x2'));var rs=require(_0x30a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30a3('0x5'))(_0x30a3('0x6'));var config=require(_0x30a3('0x7'));var jayson=require(_0x30a3('0x8'));var client=jayson[_0x30a3('0x9')][_0x30a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1673cf,_0xca68d7,_0xa84cce){return new BPromise(function(_0x2695a0,_0x13141e){return client[_0x30a3('0xb')](_0x1673cf,_0xa84cce)[_0x30a3('0xc')](function(_0x2c8271){logger['info'](_0x30a3('0xd'),_0xca68d7,_0x30a3('0xe'));logger[_0x30a3('0xf')](_0x30a3('0x10'),_0xca68d7,_0x30a3('0xe'),JSON[_0x30a3('0x11')](_0x2c8271));if(_0x2c8271['error']){if(_0x2c8271[_0x30a3('0x12')][_0x30a3('0x13')]===0x1f4){logger[_0x30a3('0x12')](_0x30a3('0xd'),_0xca68d7,_0x2c8271['error'][_0x30a3('0x14')]);return _0x13141e(_0x2c8271[_0x30a3('0x12')]['message']);}logger[_0x30a3('0x12')](_0x30a3('0xd'),_0xca68d7,_0x2c8271[_0x30a3('0x12')][_0x30a3('0x14')]);return _0x2695a0(_0x2c8271[_0x30a3('0x12')][_0x30a3('0x14')]);}else{logger[_0x30a3('0x15')](_0x30a3('0xd'),_0xca68d7,_0x30a3('0xe'));_0x2695a0(_0x2c8271['result'][_0x30a3('0x14')]);}})[_0x30a3('0x16')](function(_0x27b544){logger['error']('UserProfileSection,\x20%s,\x20%s',_0xca68d7,_0x27b544);_0x13141e(_0x27b544);});});} \ No newline at end of file +var _0xbef8=['stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xde927b,_0x5b1f68){var _0x139a46=function(_0x48745f){while(--_0x48745f){_0xde927b['push'](_0xde927b['shift']());}};_0x139a46(++_0x5b1f68);}(_0xbef8,0x1ea));var _0x8bef=function(_0x594ab1,_0x24f418){_0x594ab1=_0x594ab1-0x0;var _0x42966a=_0xbef8[_0x594ab1];return _0x42966a;};'use strict';var _=require(_0x8bef('0x0'));var util=require(_0x8bef('0x1'));var moment=require(_0x8bef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bef('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bef('0x4'))('rpc');var config=require(_0x8bef('0x5'));var jayson=require(_0x8bef('0x6'));var client=jayson['client'][_0x8bef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xab28e0,_0x247ad7,_0x13c187){return new BPromise(function(_0xf9f34e,_0x268149){return client[_0x8bef('0x8')](_0xab28e0,_0x13c187)[_0x8bef('0x9')](function(_0x446faa){logger['info'](_0x8bef('0xa'),_0x247ad7,'request\x20sent');logger[_0x8bef('0xb')](_0x8bef('0xc'),_0x247ad7,_0x8bef('0xd'),JSON[_0x8bef('0xe')](_0x446faa));if(_0x446faa[_0x8bef('0xf')]){if(_0x446faa[_0x8bef('0xf')][_0x8bef('0x10')]===0x1f4){logger[_0x8bef('0xf')](_0x8bef('0xa'),_0x247ad7,_0x446faa[_0x8bef('0xf')][_0x8bef('0x11')]);return _0x268149(_0x446faa[_0x8bef('0xf')][_0x8bef('0x11')]);}logger[_0x8bef('0xf')](_0x8bef('0xa'),_0x247ad7,_0x446faa[_0x8bef('0xf')][_0x8bef('0x11')]);return _0xf9f34e(_0x446faa[_0x8bef('0xf')][_0x8bef('0x11')]);}else{logger[_0x8bef('0x12')](_0x8bef('0xa'),_0x247ad7,_0x8bef('0xd'));_0xf9f34e(_0x446faa[_0x8bef('0x13')][_0x8bef('0x11')]);}})[_0x8bef('0x14')](function(_0x4ea56d){logger[_0x8bef('0xf')](_0x8bef('0xa'),_0x247ad7,_0x4ea56d);_0x268149(_0x4ea56d);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c3ddd0d..81244b1 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(_0x39f766,_0x3c165e){var _0x2f8968=function(_0x5c2152){while(--_0x5c2152){_0x39f766['push'](_0x39f766['shift']());}};_0x2f8968(++_0x3c165e);}(_0xe706,0xa3));var _0x6e70=function(_0x2b7868,_0x3c7807){_0x2b7868=_0x2b7868-0x0;var _0x1d66f3=_0xe706[_0x2b7868];return _0x1d66f3;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x509d9e,_0x2d1197){var _0x56b488=function(_0x1e98d0){while(--_0x1e98d0){_0x509d9e['push'](_0x509d9e['shift']());}};_0x56b488(++_0x2d1197);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 62d6b37..41a1930 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 _0x1376=['exports'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0x1376,0xd2));var _0x6137=function(_0x1245fc,_0x3bc86c){_0x1245fc=_0x1245fc-0x0;var _0x59cce1=_0x1376[_0x1245fc];return _0x59cce1;};'use strict';var Sequelize=require('sequelize');module[_0x6137('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xceb3=['exports','INTEGER','sequelize'];(function(_0x4aa0e2,_0x3f2095){var _0xac4163=function(_0x4df156){while(--_0x4df156){_0x4aa0e2['push'](_0x4aa0e2['shift']());}};_0xac4163(++_0x3f2095);}(_0xceb3,0xf5));var _0x3ceb=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xceb3[_0x5f08a6];return _0x5d0641;};'use strict';var Sequelize=require(_0x3ceb('0x0'));module[_0x3ceb('0x1')]={'penalty':{'type':Sequelize[_0x3ceb('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index ecfcff9..b07d6d7 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 _0x15ef=['request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','util','../../config/logger','moment','bluebird'];(function(_0x5dd69b,_0x118e05){var _0x1bc678=function(_0x4ff184){while(--_0x4ff184){_0x5dd69b['push'](_0x5dd69b['shift']());}};_0x1bc678(++_0x118e05);}(_0x15ef,0x80));var _0xf15e=function(_0x810971,_0x51edf1){_0x810971=_0x810971-0x0;var _0x481725=_0x15ef[_0x810971];return _0x481725;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var logger=require(_0xf15e('0x1'))('api');var moment=require(_0xf15e('0x2'));var BPromise=require(_0xf15e('0x3'));var rp=require(_0xf15e('0x4'));var fs=require('fs');var path=require(_0xf15e('0x5'));var rimraf=require(_0xf15e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf15e('0x7'));module[_0xf15e('0x8')]=function(_0x5e96b4,_0x5ba863){return _0x5e96b4[_0xf15e('0x9')](_0xf15e('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf98=['moment','bluebird','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api'];(function(_0x2a4c3a,_0x338cb0){var _0x2f41cb=function(_0x55c499){while(--_0x55c499){_0x2a4c3a['push'](_0x2a4c3a['shift']());}};_0x2f41cb(++_0x338cb0);}(_0xcf98,0x8d));var _0x8cf9=function(_0x36c4c7,_0x486512){_0x36c4c7=_0x36c4c7-0x0;var _0x5b9eb5=_0xcf98[_0x36c4c7];return _0x5b9eb5;};'use strict';var _=require('lodash');var util=require(_0x8cf9('0x0'));var logger=require(_0x8cf9('0x1'))(_0x8cf9('0x2'));var moment=require(_0x8cf9('0x3'));var BPromise=require(_0x8cf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var attributes=require(_0x8cf9('0x7'));module[_0x8cf9('0x8')]=function(_0x784c17,_0x3a5463){return _0x784c17[_0x8cf9('0x9')](_0x8cf9('0xa'),attributes,{'tableName':_0x8cf9('0xb'),'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 8aef571..c72b4f1 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 _0xa032=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa032,0x7e));var _0x2a03=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xa032[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x2a03('0x0'));var util=require('util');var moment=require(_0x2a03('0x1'));var BPromise=require(_0x2a03('0x2'));var rs=require(_0x2a03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a03('0x4'))['db'];var utils=require(_0x2a03('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2a03('0x6'));var jayson=require(_0x2a03('0x7'));var client=jayson[_0x2a03('0x8')][_0x2a03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4c92,_0x351297,_0x5584f2){return new BPromise(function(_0x41ffe8,_0x2191ef){return client['request'](_0x4e4c92,_0x5584f2)[_0x2a03('0xa')](function(_0x3c0aa4){logger[_0x2a03('0xb')](_0x2a03('0xc'),_0x351297,_0x2a03('0xd'));logger[_0x2a03('0xe')](_0x2a03('0xf'),_0x351297,_0x2a03('0xd'),JSON[_0x2a03('0x10')](_0x3c0aa4));if(_0x3c0aa4[_0x2a03('0x11')]){if(_0x3c0aa4[_0x2a03('0x11')]['code']===0x1f4){logger[_0x2a03('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x351297,_0x3c0aa4[_0x2a03('0x11')]['message']);return _0x2191ef(_0x3c0aa4[_0x2a03('0x11')][_0x2a03('0x12')]);}logger[_0x2a03('0x11')](_0x2a03('0xc'),_0x351297,_0x3c0aa4[_0x2a03('0x11')][_0x2a03('0x12')]);return _0x41ffe8(_0x3c0aa4[_0x2a03('0x11')][_0x2a03('0x12')]);}else{logger[_0x2a03('0xb')](_0x2a03('0xc'),_0x351297,_0x2a03('0xd'));_0x41ffe8(_0x3c0aa4[_0x2a03('0x13')][_0x2a03('0x12')]);}})[_0x2a03('0x14')](function(_0x399fe6){logger[_0x2a03('0x11')](_0x2a03('0xc'),_0x351297,_0x399fe6);_0x2191ef(_0x399fe6);});});} \ No newline at end of file +var _0xc728=['http','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x153b4d,_0x164efd){var _0x312e5e=function(_0x367796){while(--_0x367796){_0x153b4d['push'](_0x153b4d['shift']());}};_0x312e5e(++_0x164efd);}(_0xc728,0xbe));var _0x8c72=function(_0x3d40b2,_0x1b661b){_0x3d40b2=_0x3d40b2-0x0;var _0x1aebf7=_0xc728[_0x3d40b2];return _0x1aebf7;};'use strict';var _=require(_0x8c72('0x0'));var util=require(_0x8c72('0x1'));var moment=require(_0x8c72('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c72('0x3'));var fs=require('fs');var Redis=require(_0x8c72('0x4'));var db=require(_0x8c72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c72('0x6'))('rpc');var config=require(_0x8c72('0x7'));var jayson=require(_0x8c72('0x8'));var client=jayson[_0x8c72('0x9')][_0x8c72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b54fa,_0x3081ab,_0x2378a8){return new BPromise(function(_0x10bb2b,_0x38dc0e){return client['request'](_0x2b54fa,_0x2378a8)['then'](function(_0x42e9c7){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3081ab,'request\x20sent');logger[_0x8c72('0xb')](_0x8c72('0xc'),_0x3081ab,_0x8c72('0xd'),JSON[_0x8c72('0xe')](_0x42e9c7));if(_0x42e9c7[_0x8c72('0xf')]){if(_0x42e9c7[_0x8c72('0xf')][_0x8c72('0x10')]===0x1f4){logger[_0x8c72('0xf')](_0x8c72('0x11'),_0x3081ab,_0x42e9c7[_0x8c72('0xf')][_0x8c72('0x12')]);return _0x38dc0e(_0x42e9c7[_0x8c72('0xf')][_0x8c72('0x12')]);}logger['error'](_0x8c72('0x11'),_0x3081ab,_0x42e9c7[_0x8c72('0xf')][_0x8c72('0x12')]);return _0x10bb2b(_0x42e9c7['error'][_0x8c72('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3081ab,_0x8c72('0xd'));_0x10bb2b(_0x42e9c7['result'][_0x8c72('0x12')]);}})[_0x8c72('0x13')](function(_0x21b51d){logger[_0x8c72('0xf')](_0x8c72('0x11'),_0x3081ab,_0x21b51d);_0x38dc0e(_0x21b51d);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f91acd3..c0bd87a 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 _0xaa92=['sequelize','INTEGER'];(function(_0x2d00c6,_0x2d0b04){var _0x5913f7=function(_0x1503d4){while(--_0x1503d4){_0x2d00c6['push'](_0x2d00c6['shift']());}};_0x5913f7(++_0x2d0b04);}(_0xaa92,0x10c));var _0x2aa9=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0xaa92[_0x1e1020];return _0x464719;};'use strict';var Sequelize=require(_0x2aa9('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x2aa9('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2aa9('0x1')]}}; \ No newline at end of file +var _0x1f12=['sequelize','INTEGER'];(function(_0x57c818,_0x2c219b){var _0x25176e=function(_0x4e54f2){while(--_0x4e54f2){_0x57c818['push'](_0x57c818['shift']());}};_0x25176e(++_0x2c219b);}(_0x1f12,0x124));var _0x21f1=function(_0x5b9d9d,_0x31c264){_0x5b9d9d=_0x5b9d9d-0x0;var _0x4ba2cb=_0x1f12[_0x5b9d9d];return _0x4ba2cb;};'use strict';var Sequelize=require(_0x21f1('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x21f1('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 17ef2d1..c8c68fb 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(_0x17372a,_0x4e6ea1){var _0x58771b=function(_0x2c02eb){while(--_0x2c02eb){_0x17372a['push'](_0x17372a['shift']());}};_0x58771b(++_0x4e6ea1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x249e95,_0x1d6c21){var _0x340c3e=function(_0x5b9a41){while(--_0x5b9a41){_0x249e95['push'](_0x249e95['shift']());}};_0x340c3e(++_0x1d6c21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 4e03097..c8ca021 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(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=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(_0x8d24bb,_0x3720d3){var _0x5653bb=function(_0x7c5c61){while(--_0x7c5c61){_0x8d24bb['push'](_0x8d24bb['shift']());}};_0x5653bb(++_0x3720d3);}(_0xedd9,0xfc));var _0x9edd=function(_0x33bc14,_0x3834d8){_0x33bc14=_0x33bc14-0x0;var _0x3f58ad=_0xedd9[_0x33bc14];return _0x3f58ad;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0d5155e..597ec8a 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 _0xefa8=['exports'];(function(_0x3de786,_0xe3d992){var _0x22a7b6=function(_0x1bad5b){while(--_0x1bad5b){_0x3de786['push'](_0x3de786['shift']());}};_0x22a7b6(++_0xe3d992);}(_0xefa8,0x1a2));var _0x8efa=function(_0x221af2,_0x2beb1b){_0x221af2=_0x221af2-0x0;var _0x7dd957=_0xefa8[_0x221af2];return _0x7dd957;};'use strict';var Sequelize=require('sequelize');module[_0x8efa('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d93=['sequelize','exports','INTEGER'];(function(_0x3195de,_0x1f7121){var _0x3ead39=function(_0x2d6d59){while(--_0x2d6d59){_0x3195de['push'](_0x3195de['shift']());}};_0x3ead39(++_0x1f7121);}(_0x8d93,0xed));var _0x38d9=function(_0x3d2fe5,_0x2f9c71){_0x3d2fe5=_0x3d2fe5-0x0;var _0x48de9d=_0x8d93[_0x3d2fe5];return _0x48de9d;};'use strict';var Sequelize=require(_0x38d9('0x0'));module[_0x38d9('0x1')]={'penalty':{'type':Sequelize[_0x38d9('0x2')],'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 1949449..290ec95 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 _0x42e3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueue','util'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x42e3,0x128));var _0x342e=function(_0x452d02,_0x4179d9){_0x452d02=_0x452d02-0x0;var _0x40d512=_0x42e3[_0x452d02];return _0x40d512;};'use strict';var _=require('lodash');var util=require(_0x342e('0x0'));var logger=require(_0x342e('0x1'))(_0x342e('0x2'));var moment=require(_0x342e('0x3'));var BPromise=require(_0x342e('0x4'));var rp=require(_0x342e('0x5'));var fs=require('fs');var path=require(_0x342e('0x6'));var rimraf=require(_0x342e('0x7'));var config=require(_0x342e('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x342e('0x9')]=function(_0x266ca6,_0x4222fb){return _0x266ca6['define'](_0x342e('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c21=['moment','bluebird','rimraf','../../config/environment','exports','lodash','util','api'];(function(_0x227548,_0x26ead3){var _0x11a2cc=function(_0x421440){while(--_0x421440){_0x227548['push'](_0x227548['shift']());}};_0x11a2cc(++_0x26ead3);}(_0x0c21,0xad));var _0x10c2=function(_0x2200e1,_0x38c41d){_0x2200e1=_0x2200e1-0x0;var _0x1ab9cf=_0x0c21[_0x2200e1];return _0x1ab9cf;};'use strict';var _=require(_0x10c2('0x0'));var util=require(_0x10c2('0x1'));var logger=require('../../config/logger')(_0x10c2('0x2'));var moment=require(_0x10c2('0x3'));var BPromise=require(_0x10c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10c2('0x5'));var config=require(_0x10c2('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x10c2('0x7')]=function(_0x539f95,_0x1ed9cf){return _0x539f95['define']('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','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 9cfaa84..e15b5e6 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 _0xce31=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x25104e,_0x535a49){var _0x48f305=function(_0x3555f3){while(--_0x3555f3){_0x25104e['push'](_0x25104e['shift']());}};_0x48f305(++_0x535a49);}(_0xce31,0x13b));var _0x1ce3=function(_0x28b5d7,_0x292661){_0x28b5d7=_0x28b5d7-0x0;var _0x41f4b0=_0xce31[_0x28b5d7];return _0x41f4b0;};'use strict';var _=require('lodash');var util=require(_0x1ce3('0x0'));var moment=require(_0x1ce3('0x1'));var BPromise=require(_0x1ce3('0x2'));var rs=require(_0x1ce3('0x3'));var fs=require('fs');var Redis=require(_0x1ce3('0x4'));var db=require(_0x1ce3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ce3('0x6'))(_0x1ce3('0x7'));var config=require(_0x1ce3('0x8'));var jayson=require(_0x1ce3('0x9'));var client=jayson[_0x1ce3('0xa')][_0x1ce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x289222,_0x3eb6d1,_0x310e8b){return new BPromise(function(_0xfc0800,_0x3efc40){return client[_0x1ce3('0xc')](_0x289222,_0x310e8b)[_0x1ce3('0xd')](function(_0x1ede8f){logger[_0x1ce3('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x3eb6d1,'request\x20sent');logger['debug'](_0x1ce3('0xf'),_0x3eb6d1,'request\x20sent',JSON['stringify'](_0x1ede8f));if(_0x1ede8f[_0x1ce3('0x10')]){if(_0x1ede8f['error'][_0x1ce3('0x11')]===0x1f4){logger[_0x1ce3('0x10')](_0x1ce3('0x12'),_0x3eb6d1,_0x1ede8f['error']['message']);return _0x3efc40(_0x1ede8f[_0x1ce3('0x10')][_0x1ce3('0x13')]);}logger[_0x1ce3('0x10')](_0x1ce3('0x12'),_0x3eb6d1,_0x1ede8f[_0x1ce3('0x10')][_0x1ce3('0x13')]);return _0xfc0800(_0x1ede8f[_0x1ce3('0x10')][_0x1ce3('0x13')]);}else{logger[_0x1ce3('0xe')](_0x1ce3('0x12'),_0x3eb6d1,'request\x20sent');_0xfc0800(_0x1ede8f[_0x1ce3('0x14')][_0x1ce3('0x13')]);}})[_0x1ce3('0x15')](function(_0x585a4b){logger[_0x1ce3('0x10')](_0x1ce3('0x12'),_0x3eb6d1,_0x585a4b);_0x3efc40(_0x585a4b);});});} \ No newline at end of file +var _0xfa66=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x44acd6,_0x1e46b5){var _0xb11ce9=function(_0x5cd5f6){while(--_0x5cd5f6){_0x44acd6['push'](_0x44acd6['shift']());}};_0xb11ce9(++_0x1e46b5);}(_0xfa66,0xd0));var _0x6fa6=function(_0x3c3da4,_0x30422b){_0x3c3da4=_0x3c3da4-0x0;var _0x33f33e=_0xfa66[_0x3c3da4];return _0x33f33e;};'use strict';var _=require(_0x6fa6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6fa6('0x1'));var rs=require(_0x6fa6('0x2'));var fs=require('fs');var Redis=require(_0x6fa6('0x3'));var db=require(_0x6fa6('0x4'))['db'];var utils=require(_0x6fa6('0x5'));var logger=require(_0x6fa6('0x6'))(_0x6fa6('0x7'));var config=require(_0x6fa6('0x8'));var jayson=require(_0x6fa6('0x9'));var client=jayson[_0x6fa6('0xa')][_0x6fa6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41e7fd,_0x597afe,_0x398a26){return new BPromise(function(_0x14a7a0,_0x553de3){return client['request'](_0x41e7fd,_0x398a26)[_0x6fa6('0xc')](function(_0x5083ab){logger[_0x6fa6('0xd')](_0x6fa6('0xe'),_0x597afe,_0x6fa6('0xf'));logger[_0x6fa6('0x10')](_0x6fa6('0x11'),_0x597afe,_0x6fa6('0xf'),JSON['stringify'](_0x5083ab));if(_0x5083ab[_0x6fa6('0x12')]){if(_0x5083ab[_0x6fa6('0x12')][_0x6fa6('0x13')]===0x1f4){logger['error'](_0x6fa6('0xe'),_0x597afe,_0x5083ab[_0x6fa6('0x12')][_0x6fa6('0x14')]);return _0x553de3(_0x5083ab[_0x6fa6('0x12')][_0x6fa6('0x14')]);}logger[_0x6fa6('0x12')](_0x6fa6('0xe'),_0x597afe,_0x5083ab[_0x6fa6('0x12')]['message']);return _0x14a7a0(_0x5083ab[_0x6fa6('0x12')][_0x6fa6('0x14')]);}else{logger[_0x6fa6('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x597afe,_0x6fa6('0xf'));_0x14a7a0(_0x5083ab[_0x6fa6('0x15')][_0x6fa6('0x14')]);}})[_0x6fa6('0x16')](function(_0x1ce3ef){logger[_0x6fa6('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x597afe,_0x1ce3ef);_0x553de3(_0x1ce3ef);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 0241f3b..70ccefe 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xc5d3c8,_0x43352b){var _0x3537e4=function(_0x4bfe24){while(--_0x4bfe24){_0xc5d3c8['push'](_0xc5d3c8['shift']());}};_0x3537e4(++_0x43352b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8cac6c3..8acfdc1 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 _0xd325=['queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER'];(function(_0x32cabd,_0x498f5f){var _0x543e60=function(_0x33e7ab){while(--_0x33e7ab){_0x32cabd['push'](_0x32cabd['shift']());}};_0x543e60(++_0x498f5f);}(_0xd325,0x1f3));var _0x5d32=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0xd325[_0xae01dd];return _0x8c26df;};'use strict';var Sequelize=require(_0x5d32('0x0'));module[_0x5d32('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5d32('0x2')},'membername':{'type':Sequelize[_0x5d32('0x3')],'allowNull':![],'comment':_0x5d32('0x2')},'UserId':{'type':Sequelize[_0x5d32('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5d32('0x5'),'comment':_0x5d32('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5d32('0x5'),'comment':_0x5d32('0x2')},'penalty':{'type':Sequelize[_0x5d32('0x4')](0xb),'defaultValue':0x0,'comment':_0x5d32('0x2')},'paused':{'type':Sequelize[_0x5d32('0x4')](0xb),'defaultValue':0x0,'comment':_0x5d32('0x2')}}; \ No newline at end of file +var _0x7a33=['INTEGER','queue_interface','sequelize','Required\x20by\x20Asterisk','STRING'];(function(_0x427aa7,_0x5b4a63){var _0x24493b=function(_0x23494c){while(--_0x23494c){_0x427aa7['push'](_0x427aa7['shift']());}};_0x24493b(++_0x5b4a63);}(_0x7a33,0x1d8));var _0x37a3=function(_0x1e528c,_0x2306c0){_0x1e528c=_0x1e528c-0x0;var _0x3dbb64=_0x7a33[_0x1e528c];return _0x3dbb64;};'use strict';var Sequelize=require(_0x37a3('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x37a3('0x1')},'membername':{'type':Sequelize[_0x37a3('0x2')],'allowNull':![],'comment':_0x37a3('0x1')},'UserId':{'type':Sequelize[_0x37a3('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x37a3('0x2')],'allowNull':![],'unique':_0x37a3('0x4'),'comment':_0x37a3('0x1')},'VoiceQueueId':{'type':Sequelize[_0x37a3('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37a3('0x4'),'comment':_0x37a3('0x1')},'penalty':{'type':Sequelize[_0x37a3('0x3')](0xb),'defaultValue':0x0,'comment':_0x37a3('0x1')},'paused':{'type':Sequelize[_0x37a3('0x3')](0xb),'defaultValue':0x0,'comment':_0x37a3('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d0be9a6..c04263b 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 _0x1297=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','save','update','emit'];(function(_0x5a8ecf,_0x4a1c25){var _0x44b84c=function(_0xad69e8){while(--_0xad69e8){_0x5a8ecf['push'](_0x5a8ecf['shift']());}};_0x44b84c(++_0x4a1c25);}(_0x1297,0x92));var _0x7129=function(_0x4e7636,_0x2cd0a6){_0x4e7636=_0x4e7636-0x0;var _0x20c623=_0x1297[_0x4e7636];return _0x20c623;};'use strict';var EventEmitter=require(_0x7129('0x0'));var UserVoiceQueueRt=require(_0x7129('0x1'))['db'][_0x7129('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7129('0x3'),'afterUpdate':_0x7129('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1841b3){return function(_0x3156cb,_0x4847c8,_0x237fee){UserVoiceQueueRtEvents[_0x7129('0x5')](_0x1841b3+':'+_0x3156cb['id'],_0x3156cb);UserVoiceQueueRtEvents[_0x7129('0x5')](_0x1841b3,_0x3156cb);_0x237fee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7129('0x6')](e,emitEvent(event));}}module[_0x7129('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xc44b=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc44b,0x118));var _0xbc44=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0xc44b[_0x457c96];return _0x4e5ebc;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xbc44('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xbc44('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc44('0x2'),'afterDestroy':_0xbc44('0x3')};function emitEvent(_0x4307cc){return function(_0x4baf3f,_0x1b0e61,_0x3746ff){UserVoiceQueueRtEvents[_0xbc44('0x4')](_0x4307cc+':'+_0x4baf3f['id'],_0x4baf3f);UserVoiceQueueRtEvents[_0xbc44('0x4')](_0x4307cc,_0x4baf3f);_0x3746ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xbc44('0x5')](e,emitEvent(event));}}module[_0xbc44('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8e97d72..e241854 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 _0xdd2b=['./userVoiceQueueRt.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x21b4cc,_0xe15021){var _0x1e282a=function(_0x54dcc5){while(--_0x54dcc5){_0x21b4cc['push'](_0x21b4cc['shift']());}};_0x1e282a(++_0xe15021);}(_0xdd2b,0x153));var _0xbdd2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdd2b[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xbdd2('0x0'));var util=require(_0xbdd2('0x1'));var logger=require(_0xbdd2('0x2'))(_0xbdd2('0x3'));var moment=require(_0xbdd2('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdd2('0x5'));var fs=require('fs');var path=require(_0xbdd2('0x6'));var rimraf=require(_0xbdd2('0x7'));var config=require(_0xbdd2('0x8'));var attributes=require(_0xbdd2('0x9'));module[_0xbdd2('0xa')]=function(_0x50b59b,_0x568f9c){return _0x50b59b[_0xbdd2('0xb')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc053=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x46b5ea,_0x1672c4){var _0x2708dc=function(_0x52e5c5){while(--_0x52e5c5){_0x46b5ea['push'](_0x46b5ea['shift']());}};_0x2708dc(++_0x1672c4);}(_0xc053,0x14a));var _0x3c05=function(_0x5e2541,_0x55412c){_0x5e2541=_0x5e2541-0x0;var _0x965285=_0xc053[_0x5e2541];return _0x965285;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c05('0x0'))(_0x3c05('0x1'));var moment=require(_0x3c05('0x2'));var BPromise=require(_0x3c05('0x3'));var rp=require(_0x3c05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c05('0x5'));var config=require(_0x3c05('0x6'));var attributes=require(_0x3c05('0x7'));module[_0x3c05('0x8')]=function(_0x976e56,_0x39394f){return _0x976e56[_0x3c05('0x9')](_0x3c05('0xa'),attributes,{'tableName':_0x3c05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index ded466f..8db542b 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 _0xe7c6=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x183d3e,_0x2841d){var _0x4fd080=function(_0x32f26f){while(--_0x32f26f){_0x183d3e['push'](_0x183d3e['shift']());}};_0x4fd080(++_0x2841d);}(_0xe7c6,0x18f));var _0x6e7c=function(_0x1e40a0,_0x3dea5d){_0x1e40a0=_0x1e40a0-0x0;var _0x16196d=_0xe7c6[_0x1e40a0];return _0x16196d;};'use strict';var _=require(_0x6e7c('0x0'));var util=require(_0x6e7c('0x1'));var moment=require(_0x6e7c('0x2'));var BPromise=require(_0x6e7c('0x3'));var rs=require(_0x6e7c('0x4'));var fs=require('fs');var Redis=require(_0x6e7c('0x5'));var db=require(_0x6e7c('0x6'))['db'];var utils=require(_0x6e7c('0x7'));var logger=require(_0x6e7c('0x8'))(_0x6e7c('0x9'));var config=require(_0x6e7c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6e7c('0xb')][_0x6e7c('0xc')]({'port':0x232a});config[_0x6e7c('0xd')]=_[_0x6e7c('0xe')](config['redis'],{'host':_0x6e7c('0xf'),'port':0x18eb});var socket=require(_0x6e7c('0x10'))(new Redis(config[_0x6e7c('0xd')]));require(_0x6e7c('0x11'))[_0x6e7c('0x12')](socket);function respondWithRpcPromise(_0x205f3d,_0x2fd025,_0x51fdc5){return new BPromise(function(_0x2a9744,_0x31b862){return client['request'](_0x205f3d,_0x51fdc5)['then'](function(_0x4769d1){logger[_0x6e7c('0x13')](_0x6e7c('0x14'),_0x2fd025,_0x6e7c('0x15'));logger[_0x6e7c('0x16')](_0x6e7c('0x17'),_0x2fd025,_0x6e7c('0x15'),JSON[_0x6e7c('0x18')](_0x4769d1));if(_0x4769d1[_0x6e7c('0x19')]){if(_0x4769d1['error'][_0x6e7c('0x1a')]===0x1f4){logger[_0x6e7c('0x19')](_0x6e7c('0x14'),_0x2fd025,_0x4769d1[_0x6e7c('0x19')][_0x6e7c('0x1b')]);return _0x31b862(_0x4769d1[_0x6e7c('0x19')][_0x6e7c('0x1b')]);}logger[_0x6e7c('0x19')](_0x6e7c('0x14'),_0x2fd025,_0x4769d1['error'][_0x6e7c('0x1b')]);return _0x2a9744(_0x4769d1[_0x6e7c('0x19')][_0x6e7c('0x1b')]);}else{logger[_0x6e7c('0x13')](_0x6e7c('0x14'),_0x2fd025,_0x6e7c('0x15'));_0x2a9744(_0x4769d1[_0x6e7c('0x1c')][_0x6e7c('0x1b')]);}})['catch'](function(_0x2dfbd9){logger['error'](_0x6e7c('0x14'),_0x2fd025,_0x2dfbd9);_0x31b862(_0x2dfbd9);});});}exports[_0x6e7c('0x1d')]=function(_0x44bef5){var _0x4701a4=this;return new Promise(function(_0x2377c4,_0x39991b){return db[_0x6e7c('0x1e')]['findAll']({'raw':_0x44bef5[_0x6e7c('0x1f')]?_0x44bef5[_0x6e7c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x44bef5[_0x6e7c('0x1f')]?_0x44bef5[_0x6e7c('0x1f')]['where']||null:null,'attributes':[[db[_0x6e7c('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6e7c('0x20')][_0x6e7c('0x21')](_0x6e7c('0x22')))),_0x6e7c('0x23')]]})['then'](function(_0x192703){logger['info'](_0x6e7c('0x1d'),_0x44bef5);logger[_0x6e7c('0x16')](_0x6e7c('0x1d'),_0x44bef5,JSON['stringify'](_0x192703));_0x2377c4(_0x192703);})[_0x6e7c('0x24')](function(_0x19c415){logger[_0x6e7c('0x19')](_0x6e7c('0x1d'),_0x19c415[_0x6e7c('0x1b')],_0x44bef5);_0x39991b(_0x4701a4[_0x6e7c('0x19')](0x1f4,_0x19c415[_0x6e7c('0x1b')]));});});}; \ No newline at end of file +var _0x7f97=['outboundQueuePauses','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x16ff18,_0x234597){var _0x5aab6f=function(_0x5540a8){while(--_0x5540a8){_0x16ff18['push'](_0x16ff18['shift']());}};_0x5aab6f(++_0x234597);}(_0x7f97,0x173));var _0x77f9=function(_0x1a71ee,_0x5ecdbf){_0x1a71ee=_0x1a71ee-0x0;var _0x29b30f=_0x7f97[_0x1a71ee];return _0x29b30f;};'use strict';var _=require('lodash');var util=require(_0x77f9('0x0'));var moment=require('moment');var BPromise=require(_0x77f9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77f9('0x2'));var db=require(_0x77f9('0x3'))['db'];var utils=require(_0x77f9('0x4'));var logger=require(_0x77f9('0x5'))(_0x77f9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77f9('0x7')][_0x77f9('0x8')]({'port':0x232a});config['redis']=_[_0x77f9('0x9')](config[_0x77f9('0xa')],{'host':_0x77f9('0xb'),'port':0x18eb});var socket=require(_0x77f9('0xc'))(new Redis(config[_0x77f9('0xa')]));require(_0x77f9('0xd'))['register'](socket);function respondWithRpcPromise(_0x1e39e9,_0x1a6460,_0x3fb1dc){return new BPromise(function(_0x2a2b78,_0x4d45e7){return client[_0x77f9('0xe')](_0x1e39e9,_0x3fb1dc)[_0x77f9('0xf')](function(_0x4b1a54){logger['info'](_0x77f9('0x10'),_0x1a6460,'request\x20sent');logger[_0x77f9('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1a6460,_0x77f9('0x12'),JSON[_0x77f9('0x13')](_0x4b1a54));if(_0x4b1a54[_0x77f9('0x14')]){if(_0x4b1a54['error'][_0x77f9('0x15')]===0x1f4){logger[_0x77f9('0x14')](_0x77f9('0x10'),_0x1a6460,_0x4b1a54[_0x77f9('0x14')][_0x77f9('0x16')]);return _0x4d45e7(_0x4b1a54[_0x77f9('0x14')][_0x77f9('0x16')]);}logger[_0x77f9('0x14')](_0x77f9('0x10'),_0x1a6460,_0x4b1a54[_0x77f9('0x14')][_0x77f9('0x16')]);return _0x2a2b78(_0x4b1a54[_0x77f9('0x14')][_0x77f9('0x16')]);}else{logger[_0x77f9('0x17')](_0x77f9('0x10'),_0x1a6460,_0x77f9('0x12'));_0x2a2b78(_0x4b1a54[_0x77f9('0x18')][_0x77f9('0x16')]);}})[_0x77f9('0x19')](function(_0x4f4454){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1a6460,_0x4f4454);_0x4d45e7(_0x4f4454);});});}exports[_0x77f9('0x1a')]=function(_0x68c312){var _0x4826d4=this;return new Promise(function(_0x191402,_0x527807){return db[_0x77f9('0x1b')][_0x77f9('0x1c')]({'raw':_0x68c312[_0x77f9('0x1d')]?_0x68c312['options'][_0x77f9('0x1e')]===undefined?!![]:![]:!![],'where':_0x68c312[_0x77f9('0x1d')]?_0x68c312['options'][_0x77f9('0x1f')]||null:null,'attributes':[[db[_0x77f9('0x20')]['fn'](_0x77f9('0x21'),db[_0x77f9('0x20')]['fn']('IF',db[_0x77f9('0x20')][_0x77f9('0x22')](_0x77f9('0x23')))),_0x77f9('0x24')]]})[_0x77f9('0xf')](function(_0x5bfea6){logger[_0x77f9('0x17')]('GetVoiceQueueRtPauses',_0x68c312);logger[_0x77f9('0x11')](_0x77f9('0x1a'),_0x68c312,JSON[_0x77f9('0x13')](_0x5bfea6));_0x191402(_0x5bfea6);})['catch'](function(_0x17bd40){logger[_0x77f9('0x14')](_0x77f9('0x1a'),_0x17bd40[_0x77f9('0x16')],_0x68c312);_0x527807(_0x4826d4['error'](0x1f4,_0x17bd40[_0x77f9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8502f23..c9e6205 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 _0x6f7b=['save','remove','update','emit','register','userVoiceQueueRt:'];(function(_0x14dffc,_0xce2d4e){var _0x4b7144=function(_0x449187){while(--_0x449187){_0x14dffc['push'](_0x14dffc['shift']());}};_0x4b7144(++_0xce2d4e);}(_0x6f7b,0x168));var _0xb6f7=function(_0x668088,_0x43aa1f){_0x668088=_0x668088-0x0;var _0x4db3b0=_0x6f7b[_0x668088];return _0x4db3b0;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xb6f7('0x0'),_0xb6f7('0x1'),_0xb6f7('0x2')];function createListener(_0x2a90d2,_0x39639e){return function(_0xada16f){_0x39639e[_0xb6f7('0x3')](_0x2a90d2,_0xada16f);};}function removeListener(_0x572ba4,_0x284b07){return function(){UserVoiceQueueRtEvents['removeListener'](_0x572ba4,_0x284b07);};}exports[_0xb6f7('0x4')]=function(_0x25cec3){for(var _0x59b2d9=0x0,_0x11eefa=events['length'];_0x59b2d9<_0x11eefa;_0x59b2d9++){var _0x26b4cb=events[_0x59b2d9];var _0x10cbc1=createListener(_0xb6f7('0x5')+_0x26b4cb,_0x25cec3);UserVoiceQueueRtEvents['on'](_0x26b4cb,_0x10cbc1);}}; \ No newline at end of file +var _0x9aac=['emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9aac,0x135));var _0xc9aa=function(_0x1ae625,_0x125893){_0x1ae625=_0x1ae625-0x0;var _0x2b9e5b=_0x9aac[_0x1ae625];return _0x2b9e5b;};'use strict';var UserVoiceQueueRtEvents=require(_0xc9aa('0x0'));var events=['save',_0xc9aa('0x1'),_0xc9aa('0x2')];function createListener(_0x57da2f,_0xaee75d){return function(_0x4e88d6){_0xaee75d[_0xc9aa('0x3')](_0x57da2f,_0x4e88d6);};}function removeListener(_0x5c8ce2,_0x28c49c){return function(){UserVoiceQueueRtEvents[_0xc9aa('0x4')](_0x5c8ce2,_0x28c49c);};}exports['register']=function(_0x280687){for(var _0x2f9029=0x0,_0x34beeb=events['length'];_0x2f9029<_0x34beeb;_0x2f9029++){var _0x2f3fde=events[_0x2f9029];var _0x24829f=createListener(_0xc9aa('0x5')+_0x2f3fde,_0x280687);UserVoiceQueueRtEvents['on'](_0x2f3fde,_0x24829f);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index dc04d5d..a309a3a 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x29d96f,_0x4f2361){var _0x465ae8=function(_0x54fbc4){while(--_0x54fbc4){_0x29d96f['push'](_0x29d96f['shift']());}};_0x465ae8(++_0x4f2361);}(_0xe706,0xa3));var _0x6e70=function(_0x15c51a,_0x15941f){_0x15c51a=_0x15c51a-0x0;var _0x304bf6=_0xe706[_0x15c51a];return _0x304bf6;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x525ab8,_0x471bb5){var _0x549cd5=function(_0x1d2426){while(--_0x1d2426){_0x525ab8['push'](_0x525ab8['shift']());}};_0x549cd5(++_0x471bb5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 060dd79..3621ca4 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 _0xe69b=['sequelize','exports','INTEGER'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe69b,0x18f));var _0xbe69=function(_0x37c3b2,_0x978ad3){_0x37c3b2=_0x37c3b2-0x0;var _0x356e46=_0xe69b[_0x37c3b2];return _0x356e46;};'use strict';var Sequelize=require(_0xbe69('0x0'));module[_0xbe69('0x1')]={'penalty':{'type':Sequelize[_0xbe69('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf20b=['INTEGER'];(function(_0x2f33f7,_0x158200){var _0x185c5f=function(_0x537c82){while(--_0x537c82){_0x2f33f7['push'](_0x2f33f7['shift']());}};_0x185c5f(++_0x158200);}(_0xf20b,0x1da));var _0xbf20=function(_0x443658,_0x11d9be){_0x443658=_0x443658-0x0;var _0x219f4e=_0xf20b[_0x443658];return _0x219f4e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xbf20('0x0')],'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 213df34..81c02aa 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 _0x5d5f=['user_has_whatsapp_queues','api','moment','bluebird','path','./userWhatsappQueue.attributes','exports','define'];(function(_0xa532dd,_0x164e62){var _0x3044db=function(_0x5bec4a){while(--_0x5bec4a){_0xa532dd['push'](_0xa532dd['shift']());}};_0x3044db(++_0x164e62);}(_0x5d5f,0xd1));var _0xf5d5=function(_0x4de42e,_0x4f5344){_0x4de42e=_0x4de42e-0x0;var _0x534a10=_0x5d5f[_0x4de42e];return _0x534a10;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf5d5('0x0'));var moment=require(_0xf5d5('0x1'));var BPromise=require(_0xf5d5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5d5('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5d5('0x4'));module[_0xf5d5('0x5')]=function(_0x20e7e4,_0x313963){return _0x20e7e4[_0xf5d5('0x6')]('UserWhatsappQueue',attributes,{'tableName':_0xf5d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe46=['../../config/logger','api','moment','path','rimraf','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbe46,0x9f));var _0x6be4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbe46[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6be4('0x0'));var util=require('util');var logger=require(_0x6be4('0x1'))(_0x6be4('0x2'));var moment=require(_0x6be4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6be4('0x4'));var rimraf=require(_0x6be4('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x5742b7,_0x580a3d){return _0x5742b7['define'](_0x6be4('0x6'),attributes,{'tableName':_0x6be4('0x7'),'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 30b9349..ab7ba68 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 _0x33ac=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','moment'];(function(_0x9f4275,_0x50f4cf){var _0x22a463=function(_0x53fdb6){while(--_0x53fdb6){_0x9f4275['push'](_0x9f4275['shift']());}};_0x22a463(++_0x50f4cf);}(_0x33ac,0x9f));var _0xc33a=function(_0x39502d,_0x31464c){_0x39502d=_0x39502d-0x0;var _0x453796=_0x33ac[_0x39502d];return _0x453796;};'use strict';var _=require('lodash');var util=require(_0xc33a('0x0'));var moment=require(_0xc33a('0x1'));var BPromise=require(_0xc33a('0x2'));var rs=require(_0xc33a('0x3'));var fs=require('fs');var Redis=require(_0xc33a('0x4'));var db=require(_0xc33a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc33a('0x6'))(_0xc33a('0x7'));var config=require(_0xc33a('0x8'));var jayson=require(_0xc33a('0x9'));var client=jayson[_0xc33a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5219a6,_0x54f156,_0x366aac){return new BPromise(function(_0x22662c,_0x43db9e){return client[_0xc33a('0xb')](_0x5219a6,_0x366aac)[_0xc33a('0xc')](function(_0xc468fd){logger['info'](_0xc33a('0xd'),_0x54f156,'request\x20sent');logger[_0xc33a('0xe')](_0xc33a('0xf'),_0x54f156,_0xc33a('0x10'),JSON[_0xc33a('0x11')](_0xc468fd));if(_0xc468fd[_0xc33a('0x12')]){if(_0xc468fd[_0xc33a('0x12')][_0xc33a('0x13')]===0x1f4){logger[_0xc33a('0x12')](_0xc33a('0xd'),_0x54f156,_0xc468fd[_0xc33a('0x12')][_0xc33a('0x14')]);return _0x43db9e(_0xc468fd['error']['message']);}logger[_0xc33a('0x12')](_0xc33a('0xd'),_0x54f156,_0xc468fd[_0xc33a('0x12')][_0xc33a('0x14')]);return _0x22662c(_0xc468fd[_0xc33a('0x12')]['message']);}else{logger[_0xc33a('0x15')](_0xc33a('0xd'),_0x54f156,'request\x20sent');_0x22662c(_0xc468fd['result'][_0xc33a('0x14')]);}})[_0xc33a('0x16')](function(_0x3c9b5d){logger[_0xc33a('0x12')](_0xc33a('0xd'),_0x54f156,_0x3c9b5d);_0x43db9e(_0x3c9b5d);});});} \ No newline at end of file +var _0x7148=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x7148,0x132));var _0x8714=function(_0x10a0fc,_0x24173d){_0x10a0fc=_0x10a0fc-0x0;var _0x3265f3=_0x7148[_0x10a0fc];return _0x3265f3;};'use strict';var _=require(_0x8714('0x0'));var util=require(_0x8714('0x1'));var moment=require(_0x8714('0x2'));var BPromise=require(_0x8714('0x3'));var rs=require(_0x8714('0x4'));var fs=require('fs');var Redis=require(_0x8714('0x5'));var db=require(_0x8714('0x6'))['db'];var utils=require(_0x8714('0x7'));var logger=require('../../config/logger')(_0x8714('0x8'));var config=require(_0x8714('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8714('0xa')][_0x8714('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2250a1,_0xf4952c,_0x604f18){return new BPromise(function(_0x3287eb,_0x48d478){return client[_0x8714('0xc')](_0x2250a1,_0x604f18)[_0x8714('0xd')](function(_0x234aaf){logger[_0x8714('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xf4952c,_0x8714('0xf'));logger['debug'](_0x8714('0x10'),_0xf4952c,_0x8714('0xf'),JSON[_0x8714('0x11')](_0x234aaf));if(_0x234aaf[_0x8714('0x12')]){if(_0x234aaf[_0x8714('0x12')][_0x8714('0x13')]===0x1f4){logger[_0x8714('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0xf4952c,_0x234aaf[_0x8714('0x12')]['message']);return _0x48d478(_0x234aaf[_0x8714('0x12')][_0x8714('0x14')]);}logger[_0x8714('0x12')](_0x8714('0x15'),_0xf4952c,_0x234aaf[_0x8714('0x12')]['message']);return _0x3287eb(_0x234aaf[_0x8714('0x12')][_0x8714('0x14')]);}else{logger[_0x8714('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xf4952c,_0x8714('0xf'));_0x3287eb(_0x234aaf[_0x8714('0x16')][_0x8714('0x14')]);}})[_0x8714('0x17')](function(_0x3ce9b5){logger['error'](_0x8714('0x15'),_0xf4952c,_0x3ce9b5);_0x48d478(_0x3ce9b5);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 43e98f6..f5f5a8e 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 _0x00bb=['get','/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./variable.controller'];(function(_0x1a729e,_0x323cb0){var _0x245045=function(_0x4658e9){while(--_0x4658e9){_0x1a729e['push'](_0x1a729e['shift']());}};_0x245045(++_0x323cb0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'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'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xb')]);router[_0xb00b('0xc')]('/',auth[_0xb00b('0xa')](),controller['create']);router['put'](_0xb00b('0x9'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')](_0xb00b('0x9'),auth['isAuthenticated'](),controller[_0xb00b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xde64=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x1a909b,_0x14cca0){var _0x2dacbd=function(_0x9f6c6a){while(--_0x9f6c6a){_0x1a909b['push'](_0x1a909b['shift']());}};_0x2dacbd(++_0x14cca0);}(_0xde64,0x17c));var _0x4de6=function(_0x1da17e,_0x2e8453){_0x1da17e=_0x1da17e-0x0;var _0x3da70a=_0xde64[_0x1da17e];return _0x3da70a;};'use strict';var multer=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var path=require(_0x4de6('0x2'));var timeout=require(_0x4de6('0x3'));var express=require(_0x4de6('0x4'));var router=express[_0x4de6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4de6('0x6'));var interaction=require(_0x4de6('0x7'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x4de6('0x8')]('/',auth[_0x4de6('0x9')](),controller['index']);router['get'](_0x4de6('0xa'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xb')]);router[_0x4de6('0xc')]('/',auth[_0x4de6('0x9')](),controller[_0x4de6('0xd')]);router['put'](_0x4de6('0xa'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xe')]);router['delete'](_0x4de6('0xa'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xf')]);module[_0x4de6('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 931960b..54017d6 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 _0x2f29=['STRING','exports'];(function(_0x3e5a9d,_0x19ffb5){var _0x19ae40=function(_0x2bf68d){while(--_0x2bf68d){_0x3e5a9d['push'](_0x3e5a9d['shift']());}};_0x19ae40(++_0x19ffb5);}(_0x2f29,0x1af));var _0x92f2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2f29[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0x92f2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x92f2('0x1')]}}; \ No newline at end of file +var _0x3248=['exports','STRING'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3248,0x1bc));var _0x8324=function(_0x2b7a4f,_0x402e5e){_0x2b7a4f=_0x2b7a4f-0x0;var _0xd4ec3d=_0x3248[_0x2b7a4f];return _0xd4ec3d;};'use strict';var Sequelize=require('sequelize');module[_0x8324('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8324('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index fb4c33c..9603e05 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 _0xa8da=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','Variables','UserProfileResource','error','stack','name','send','Variable','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','model','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','catch','show','params','length','options','create','user'];(function(_0x52e63a,_0x48be2f){var _0x18dbc4=function(_0x3b11c7){while(--_0x3b11c7){_0x52e63a['push'](_0x52e63a['shift']());}};_0x18dbc4(++_0x48be2f);}(_0xa8da,0x10f));var _0xaa8d=function(_0xd194bb,_0x452af2){_0xd194bb=_0xd194bb-0x0;var _0x23dec2=_0xa8da[_0xd194bb];return _0x23dec2;};'use strict';var emlformat=require(_0xaa8d('0x0'));var rimraf=require(_0xaa8d('0x1'));var zipdir=require(_0xaa8d('0x2'));var jsonpatch=require(_0xaa8d('0x3'));var rp=require(_0xaa8d('0x4'));var moment=require(_0xaa8d('0x5'));var BPromise=require(_0xaa8d('0x6'));var Mustache=require('mustache');var util=require(_0xaa8d('0x7'));var path=require(_0xaa8d('0x8'));var sox=require(_0xaa8d('0x9'));var csv=require(_0xaa8d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa8d('0xb'));var _=require('lodash');var squel=require(_0xaa8d('0xc'));var crypto=require(_0xaa8d('0xd'));var jsforce=require(_0xaa8d('0xe'));var deskjs=require(_0xaa8d('0xf'));var toCsv=require(_0xaa8d('0xa'));var querystring=require(_0xaa8d('0x10'));var Papa=require(_0xaa8d('0x11'));var Redis=require(_0xaa8d('0x12'));var authService=require(_0xaa8d('0x13'));var qs=require(_0xaa8d('0x14'));var as=require(_0xaa8d('0x15'));var hardwareService=require(_0xaa8d('0x16'));var logger=require(_0xaa8d('0x17'))(_0xaa8d('0x18'));var utils=require('../../config/utils');var config=require(_0xaa8d('0x19'));var licenseUtil=require(_0xaa8d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a60cd,_0x2e6b73){_0x2e6b73=_0x2e6b73||0xcc;return function(_0x439754){if(_0x439754){return _0x1a60cd[_0xaa8d('0x1b')](_0x2e6b73);}return _0x1a60cd[_0xaa8d('0x1c')](_0x2e6b73)[_0xaa8d('0x1d')]();};}function respondWithResult(_0x2e67f8,_0x363c86){_0x363c86=_0x363c86||0xc8;return function(_0x3731cd){if(_0x3731cd){return _0x2e67f8[_0xaa8d('0x1c')](_0x363c86)[_0xaa8d('0x1e')](_0x3731cd);}};}function respondWithFilteredResult(_0xa110bb,_0x167baf){return function(_0x4fea1c){if(_0x4fea1c){var _0x476d02=typeof _0x167baf[_0xaa8d('0x1f')]===_0xaa8d('0x20')&&typeof _0x167baf[_0xaa8d('0x21')]===_0xaa8d('0x20');var _0x19e12a=_0x4fea1c[_0xaa8d('0x22')];var _0x17f420=_0x476d02?0x0:_0x167baf[_0xaa8d('0x1f')];var _0x33afda=_0x476d02?_0x4fea1c[_0xaa8d('0x22')]:_0x167baf[_0xaa8d('0x1f')]+_0x167baf[_0xaa8d('0x21')];var _0x45933f;if(_0x33afda>=_0x19e12a){_0x33afda=_0x19e12a;_0x45933f=0xc8;}else{_0x45933f=0xce;}_0xa110bb[_0xaa8d('0x1c')](_0x45933f);return _0xa110bb[_0xaa8d('0x23')](_0xaa8d('0x24'),_0x17f420+'-'+_0x33afda+'/'+_0x19e12a)[_0xaa8d('0x1e')](_0x4fea1c);}return null;};}function patchUpdates(_0x2c8136){return function(_0x3c5a43){try{jsonpatch[_0xaa8d('0x25')](_0x3c5a43,_0x2c8136,!![]);}catch(_0x5b1997){return BPromise[_0xaa8d('0x26')](_0x5b1997);}return _0x3c5a43[_0xaa8d('0x27')]();};}function saveUpdates(_0x556727,_0x187a8d){return function(_0x19457e){if(_0x19457e){return _0x19457e['update'](_0x556727)['then'](function(_0x1aa33d){return _0x1aa33d;});}return null;};}function removeEntity(_0x3bfc15,_0x3eab84){return function(_0x1e10f5){if(_0x1e10f5){return _0x1e10f5[_0xaa8d('0x28')]()[_0xaa8d('0x29')](function(){var _0x1f844c=_0x1e10f5['get']({'plain':!![]});var _0x219ca0=_0xaa8d('0x2a');return db[_0xaa8d('0x2b')][_0xaa8d('0x28')]({'where':{'type':_0x219ca0,'resourceId':_0x1f844c['id']}})[_0xaa8d('0x29')](function(){return _0x1e10f5;});})[_0xaa8d('0x29')](function(){_0x3bfc15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x606448,_0x1e6d8f){return function(_0x5ca70e){if(!_0x5ca70e){_0x606448[_0xaa8d('0x1b')](0x194);}return _0x5ca70e;};}function handleError(_0x1bbbb6,_0x58ecf7){_0x58ecf7=_0x58ecf7||0x1f4;return function(_0x48bfcf){logger[_0xaa8d('0x2c')](_0x48bfcf[_0xaa8d('0x2d')]);if(_0x48bfcf[_0xaa8d('0x2e')]){delete _0x48bfcf['name'];}_0x1bbbb6['status'](_0x58ecf7)[_0xaa8d('0x2f')](_0x48bfcf);};}exports['index']=function(_0x16a72d,_0x376ba0){var _0x3f21ba={},_0x274e0a={},_0x56bbe4={'count':0x0,'rows':[]};var _0x35d4db=_['map'](db[_0xaa8d('0x30')][_0xaa8d('0x31')],function(_0x143070){return{'name':_0x143070['fieldName'],'type':_0x143070[_0xaa8d('0x32')][_0xaa8d('0x33')]};});_0x274e0a['model']=_[_0xaa8d('0x34')](_0x35d4db,'name');_0x274e0a[_0xaa8d('0x35')]=_[_0xaa8d('0x36')](_0x16a72d[_0xaa8d('0x35')]);_0x274e0a['filters']=_[_0xaa8d('0x37')](_0x274e0a['model'],_0x274e0a[_0xaa8d('0x35')]);_0x3f21ba[_0xaa8d('0x38')]=_[_0xaa8d('0x37')](_0x274e0a['model'],qs[_0xaa8d('0x39')](_0x16a72d['query'][_0xaa8d('0x39')]));_0x3f21ba['attributes']=_0x3f21ba[_0xaa8d('0x38')]['length']?_0x3f21ba[_0xaa8d('0x38')]:_0x274e0a[_0xaa8d('0x3a')];if(!_0x16a72d[_0xaa8d('0x35')]['hasOwnProperty'](_0xaa8d('0x3b'))){_0x3f21ba[_0xaa8d('0x21')]=qs[_0xaa8d('0x21')](_0x16a72d[_0xaa8d('0x35')]['limit']);_0x3f21ba[_0xaa8d('0x1f')]=qs[_0xaa8d('0x1f')](_0x16a72d[_0xaa8d('0x35')][_0xaa8d('0x1f')]);}_0x3f21ba[_0xaa8d('0x3c')]=qs[_0xaa8d('0x3d')](_0x16a72d['query'][_0xaa8d('0x3d')]);_0x3f21ba[_0xaa8d('0x3e')]=qs[_0xaa8d('0x3f')](_[_0xaa8d('0x40')](_0x16a72d[_0xaa8d('0x35')],_0x274e0a[_0xaa8d('0x3f')]),_0x35d4db);if(_0x16a72d[_0xaa8d('0x35')][_0xaa8d('0x41')]){_0x3f21ba[_0xaa8d('0x3e')]=_[_0xaa8d('0x42')](_0x3f21ba[_0xaa8d('0x3e')],{'$or':_[_0xaa8d('0x34')](_0x35d4db,function(_0xa1f5e2){if(_0xa1f5e2[_0xaa8d('0x32')]!=='VIRTUAL'){var _0x7539c2={};_0x7539c2[_0xa1f5e2[_0xaa8d('0x2e')]]={'$like':'%'+_0x16a72d[_0xaa8d('0x35')][_0xaa8d('0x41')]+'%'};return _0x7539c2;}})});}_0x3f21ba=_['merge']({},_0x3f21ba,_0x16a72d['options']);var _0x72c464={'where':_0x3f21ba[_0xaa8d('0x3e')]};return db['Variable'][_0xaa8d('0x22')](_0x72c464)[_0xaa8d('0x29')](function(_0x2cfcb5){_0x56bbe4[_0xaa8d('0x22')]=_0x2cfcb5;if(_0x16a72d[_0xaa8d('0x35')][_0xaa8d('0x43')]){_0x3f21ba[_0xaa8d('0x44')]=[{'all':!![]}];}return db[_0xaa8d('0x30')][_0xaa8d('0x45')](_0x3f21ba);})[_0xaa8d('0x29')](function(_0x3bbc17){_0x56bbe4['rows']=_0x3bbc17;return _0x56bbe4;})[_0xaa8d('0x29')](respondWithFilteredResult(_0x376ba0,_0x3f21ba))[_0xaa8d('0x46')](handleError(_0x376ba0,null));};exports[_0xaa8d('0x47')]=function(_0x2c5eb0,_0x122c83){var _0x364d0a={'raw':!![],'where':{'id':_0x2c5eb0[_0xaa8d('0x48')]['id']}},_0x35e781={};_0x35e781[_0xaa8d('0x3a')]=_[_0xaa8d('0x36')](db[_0xaa8d('0x30')][_0xaa8d('0x31')]);_0x35e781[_0xaa8d('0x35')]=_[_0xaa8d('0x36')](_0x2c5eb0[_0xaa8d('0x35')]);_0x35e781[_0xaa8d('0x3f')]=_[_0xaa8d('0x37')](_0x35e781['model'],_0x35e781[_0xaa8d('0x35')]);_0x364d0a['attributes']=_[_0xaa8d('0x37')](_0x35e781['model'],qs[_0xaa8d('0x39')](_0x2c5eb0[_0xaa8d('0x35')][_0xaa8d('0x39')]));_0x364d0a[_0xaa8d('0x38')]=_0x364d0a[_0xaa8d('0x38')][_0xaa8d('0x49')]?_0x364d0a['attributes']:_0x35e781['model'];if(_0x2c5eb0[_0xaa8d('0x35')][_0xaa8d('0x43')]){_0x364d0a[_0xaa8d('0x44')]=[{'all':!![]}];}_0x364d0a=_[_0xaa8d('0x42')]({},_0x364d0a,_0x2c5eb0[_0xaa8d('0x4a')]);return db['Variable']['find'](_0x364d0a)[_0xaa8d('0x29')](handleEntityNotFound(_0x122c83,null))[_0xaa8d('0x29')](respondWithResult(_0x122c83,null))[_0xaa8d('0x46')](handleError(_0x122c83,null));};exports[_0xaa8d('0x4b')]=function(_0xfe8053,_0x14cf79){return db[_0xaa8d('0x30')]['create'](_0xfe8053['body'],{})[_0xaa8d('0x29')](function(_0x5d6488){var _0x7b96c1=_0xfe8053[_0xaa8d('0x4c')][_0xaa8d('0x4d')]({'plain':!![]});if(!_0x7b96c1)throw new Error(_0xaa8d('0x4e'));if(_0x7b96c1[_0xaa8d('0x4f')]===_0xaa8d('0x4c')){var _0x2829ce=_0x5d6488['get']({'plain':!![]});var _0x2c0e25=_0xaa8d('0x2a');return db[_0xaa8d('0x50')][_0xaa8d('0x51')]({'where':{'name':_0x2c0e25,'userProfileId':_0x7b96c1[_0xaa8d('0x52')]},'raw':!![]})[_0xaa8d('0x29')](function(_0x29063a){if(_0x29063a&&_0x29063a[_0xaa8d('0x53')]===0x0){return db[_0xaa8d('0x2b')][_0xaa8d('0x4b')]({'name':_0x2829ce[_0xaa8d('0x2e')],'resourceId':_0x2829ce['id'],'type':_0x29063a['name'],'sectionId':_0x29063a['id']},{})['then'](function(){return _0x5d6488;});}else{return _0x5d6488;}})[_0xaa8d('0x46')](function(_0x4f5b23){logger[_0xaa8d('0x2c')](_0xaa8d('0x54'),_0x4f5b23);throw _0x4f5b23;});}return _0x5d6488;})[_0xaa8d('0x29')](respondWithResult(_0x14cf79,0xc9))[_0xaa8d('0x46')](handleError(_0x14cf79,null));};exports[_0xaa8d('0x55')]=function(_0x5a92dd,_0x5d23b1){if(_0x5a92dd[_0xaa8d('0x56')]['id']){delete _0x5a92dd[_0xaa8d('0x56')]['id'];}return db['Variable'][_0xaa8d('0x51')]({'where':{'id':_0x5a92dd[_0xaa8d('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d23b1,null))[_0xaa8d('0x29')](saveUpdates(_0x5a92dd[_0xaa8d('0x56')],null))[_0xaa8d('0x29')](respondWithResult(_0x5d23b1,null))[_0xaa8d('0x46')](handleError(_0x5d23b1,null));};exports[_0xaa8d('0x28')]=function(_0x62d2b8,_0x4eb8a7){return db['Variable']['find']({'where':{'id':_0x62d2b8['params']['id']}})[_0xaa8d('0x29')](handleEntityNotFound(_0x4eb8a7,null))['then'](removeEntity(_0x4eb8a7,null))['catch'](handleError(_0x4eb8a7,null));}; \ No newline at end of file +var _0xb397=['includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','Variable','findAll','rows','params'];(function(_0x4cc271,_0x1a6427){var _0x47c6e1=function(_0x4bb6d8){while(--_0x4bb6d8){_0x4cc271['push'](_0x4cc271['shift']());}};_0x47c6e1(++_0x1a6427);}(_0xb397,0x151));var _0x7b39=function(_0x583a5b,_0x3c5333){_0x583a5b=_0x583a5b-0x0;var _0x143214=_0xb397[_0x583a5b];return _0x143214;};'use strict';var emlformat=require(_0x7b39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b39('0x1'));var jsonpatch=require(_0x7b39('0x2'));var rp=require(_0x7b39('0x3'));var moment=require(_0x7b39('0x4'));var BPromise=require(_0x7b39('0x5'));var Mustache=require(_0x7b39('0x6'));var util=require(_0x7b39('0x7'));var path=require(_0x7b39('0x8'));var sox=require(_0x7b39('0x9'));var csv=require(_0x7b39('0xa'));var ejs=require(_0x7b39('0xb'));var fs=require('fs');var fs_extra=require(_0x7b39('0xc'));var _=require('lodash');var squel=require(_0x7b39('0xd'));var crypto=require(_0x7b39('0xe'));var jsforce=require(_0x7b39('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7b39('0xa'));var querystring=require('querystring');var Papa=require(_0x7b39('0x10'));var Redis=require(_0x7b39('0x11'));var authService=require(_0x7b39('0x12'));var qs=require(_0x7b39('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b39('0x14'));var logger=require(_0x7b39('0x15'))('api');var utils=require(_0x7b39('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7b39('0x17'))['db'];function respondWithStatusCode(_0x657bf5,_0x175b60){_0x175b60=_0x175b60||0xcc;return function(_0x8333f9){if(_0x8333f9){return _0x657bf5[_0x7b39('0x18')](_0x175b60);}return _0x657bf5['status'](_0x175b60)[_0x7b39('0x19')]();};}function respondWithResult(_0x2a0571,_0x160779){_0x160779=_0x160779||0xc8;return function(_0xe02e69){if(_0xe02e69){return _0x2a0571[_0x7b39('0x1a')](_0x160779)[_0x7b39('0x1b')](_0xe02e69);}};}function respondWithFilteredResult(_0x4bc112,_0x1ff2eb){return function(_0x295773){if(_0x295773){var _0x2fd052=typeof _0x1ff2eb[_0x7b39('0x1c')]===_0x7b39('0x1d')&&typeof _0x1ff2eb[_0x7b39('0x1e')]===_0x7b39('0x1d');var _0x11d52c=_0x295773[_0x7b39('0x1f')];var _0x4d0eb9=_0x2fd052?0x0:_0x1ff2eb[_0x7b39('0x1c')];var _0x3ec4d0=_0x2fd052?_0x295773['count']:_0x1ff2eb[_0x7b39('0x1c')]+_0x1ff2eb[_0x7b39('0x1e')];var _0x59a10f;if(_0x3ec4d0>=_0x11d52c){_0x3ec4d0=_0x11d52c;_0x59a10f=0xc8;}else{_0x59a10f=0xce;}_0x4bc112['status'](_0x59a10f);return _0x4bc112['set'](_0x7b39('0x20'),_0x4d0eb9+'-'+_0x3ec4d0+'/'+_0x11d52c)[_0x7b39('0x1b')](_0x295773);}return null;};}function patchUpdates(_0x5aa7ad){return function(_0x29fab5){try{jsonpatch[_0x7b39('0x21')](_0x29fab5,_0x5aa7ad,!![]);}catch(_0x240dc3){return BPromise[_0x7b39('0x22')](_0x240dc3);}return _0x29fab5['save']();};}function saveUpdates(_0x90a36a,_0x4569bb){return function(_0xab91c4){if(_0xab91c4){return _0xab91c4[_0x7b39('0x23')](_0x90a36a)[_0x7b39('0x24')](function(_0x594b22){return _0x594b22;});}return null;};}function removeEntity(_0x1340cc,_0x348c65){return function(_0x1c0a48){if(_0x1c0a48){return _0x1c0a48[_0x7b39('0x25')]()['then'](function(){var _0x254d84=_0x1c0a48[_0x7b39('0x26')]({'plain':!![]});var _0x2940b3=_0x7b39('0x27');return db[_0x7b39('0x28')][_0x7b39('0x25')]({'where':{'type':_0x2940b3,'resourceId':_0x254d84['id']}})['then'](function(){return _0x1c0a48;});})['then'](function(){_0x1340cc['status'](0xcc)[_0x7b39('0x19')]();});}};}function handleEntityNotFound(_0x6dc47b,_0x724ada){return function(_0x3abd27){if(!_0x3abd27){_0x6dc47b[_0x7b39('0x18')](0x194);}return _0x3abd27;};}function handleError(_0x1dbe88,_0x1562ea){_0x1562ea=_0x1562ea||0x1f4;return function(_0x1f9c0b){logger['error'](_0x1f9c0b[_0x7b39('0x29')]);if(_0x1f9c0b[_0x7b39('0x2a')]){delete _0x1f9c0b[_0x7b39('0x2a')];}_0x1dbe88['status'](_0x1562ea)[_0x7b39('0x2b')](_0x1f9c0b);};}exports[_0x7b39('0x2c')]=function(_0x444ad3,_0x1b8d35){var _0x16110e={},_0x4cfca5={},_0xfc0fec={'count':0x0,'rows':[]};var _0x248064=_[_0x7b39('0x2d')](db['Variable'][_0x7b39('0x2e')],function(_0x24446e){return{'name':_0x24446e['fieldName'],'type':_0x24446e[_0x7b39('0x2f')][_0x7b39('0x30')]};});_0x4cfca5[_0x7b39('0x31')]=_['map'](_0x248064,_0x7b39('0x2a'));_0x4cfca5[_0x7b39('0x32')]=_[_0x7b39('0x33')](_0x444ad3['query']);_0x4cfca5[_0x7b39('0x34')]=_[_0x7b39('0x35')](_0x4cfca5[_0x7b39('0x31')],_0x4cfca5[_0x7b39('0x32')]);_0x16110e[_0x7b39('0x36')]=_[_0x7b39('0x35')](_0x4cfca5[_0x7b39('0x31')],qs['fields'](_0x444ad3[_0x7b39('0x32')]['fields']));_0x16110e['attributes']=_0x16110e[_0x7b39('0x36')][_0x7b39('0x37')]?_0x16110e['attributes']:_0x4cfca5[_0x7b39('0x31')];if(!_0x444ad3[_0x7b39('0x32')]['hasOwnProperty'](_0x7b39('0x38'))){_0x16110e[_0x7b39('0x1e')]=qs[_0x7b39('0x1e')](_0x444ad3[_0x7b39('0x32')][_0x7b39('0x1e')]);_0x16110e['offset']=qs[_0x7b39('0x1c')](_0x444ad3[_0x7b39('0x32')][_0x7b39('0x1c')]);}_0x16110e[_0x7b39('0x39')]=qs[_0x7b39('0x3a')](_0x444ad3[_0x7b39('0x32')][_0x7b39('0x3a')]);_0x16110e[_0x7b39('0x3b')]=qs['filters'](_[_0x7b39('0x3c')](_0x444ad3['query'],_0x4cfca5[_0x7b39('0x34')]),_0x248064);if(_0x444ad3[_0x7b39('0x32')][_0x7b39('0x3d')]){_0x16110e[_0x7b39('0x3b')]=_['merge'](_0x16110e[_0x7b39('0x3b')],{'$or':_[_0x7b39('0x2d')](_0x248064,function(_0x554003){if(_0x554003[_0x7b39('0x2f')]!=='VIRTUAL'){var _0x4c63b1={};_0x4c63b1[_0x554003[_0x7b39('0x2a')]]={'$like':'%'+_0x444ad3[_0x7b39('0x32')][_0x7b39('0x3d')]+'%'};return _0x4c63b1;}})});}_0x16110e=_[_0x7b39('0x3e')]({},_0x16110e,_0x444ad3[_0x7b39('0x3f')]);var _0x275151={'where':_0x16110e[_0x7b39('0x3b')]};return db[_0x7b39('0x40')][_0x7b39('0x1f')](_0x275151)[_0x7b39('0x24')](function(_0x3ec3b8){_0xfc0fec[_0x7b39('0x1f')]=_0x3ec3b8;if(_0x444ad3[_0x7b39('0x32')]['includeAll']){_0x16110e['include']=[{'all':!![]}];}return db[_0x7b39('0x40')][_0x7b39('0x41')](_0x16110e);})[_0x7b39('0x24')](function(_0x4ecf2e){_0xfc0fec[_0x7b39('0x42')]=_0x4ecf2e;return _0xfc0fec;})[_0x7b39('0x24')](respondWithFilteredResult(_0x1b8d35,_0x16110e))['catch'](handleError(_0x1b8d35,null));};exports['show']=function(_0x4033c4,_0x2b2d0b){var _0x2b7310={'raw':!![],'where':{'id':_0x4033c4[_0x7b39('0x43')]['id']}},_0x1c4b45={};_0x1c4b45[_0x7b39('0x31')]=_[_0x7b39('0x33')](db[_0x7b39('0x40')][_0x7b39('0x2e')]);_0x1c4b45[_0x7b39('0x32')]=_['keys'](_0x4033c4[_0x7b39('0x32')]);_0x1c4b45['filters']=_[_0x7b39('0x35')](_0x1c4b45[_0x7b39('0x31')],_0x1c4b45[_0x7b39('0x32')]);_0x2b7310['attributes']=_[_0x7b39('0x35')](_0x1c4b45[_0x7b39('0x31')],qs['fields'](_0x4033c4['query']['fields']));_0x2b7310['attributes']=_0x2b7310[_0x7b39('0x36')][_0x7b39('0x37')]?_0x2b7310[_0x7b39('0x36')]:_0x1c4b45[_0x7b39('0x31')];if(_0x4033c4['query'][_0x7b39('0x44')]){_0x2b7310[_0x7b39('0x45')]=[{'all':!![]}];}_0x2b7310=_[_0x7b39('0x3e')]({},_0x2b7310,_0x4033c4[_0x7b39('0x3f')]);return db[_0x7b39('0x40')]['find'](_0x2b7310)[_0x7b39('0x24')](handleEntityNotFound(_0x2b2d0b,null))['then'](respondWithResult(_0x2b2d0b,null))[_0x7b39('0x46')](handleError(_0x2b2d0b,null));};exports[_0x7b39('0x47')]=function(_0x45650b,_0x1c5cef){return db[_0x7b39('0x40')][_0x7b39('0x47')](_0x45650b[_0x7b39('0x48')],{})['then'](function(_0x5212d4){var _0x2aaf98=_0x45650b[_0x7b39('0x49')][_0x7b39('0x26')]({'plain':!![]});if(!_0x2aaf98)throw new Error(_0x7b39('0x4a'));if(_0x2aaf98[_0x7b39('0x4b')]===_0x7b39('0x49')){var _0x13390e=_0x5212d4['get']({'plain':!![]});var _0x4bbae8=_0x7b39('0x27');return db[_0x7b39('0x4c')][_0x7b39('0x4d')]({'where':{'name':_0x4bbae8,'userProfileId':_0x2aaf98[_0x7b39('0x4e')]},'raw':!![]})['then'](function(_0x2132b8){if(_0x2132b8&&_0x2132b8[_0x7b39('0x4f')]===0x0){return db[_0x7b39('0x28')][_0x7b39('0x47')]({'name':_0x13390e['name'],'resourceId':_0x13390e['id'],'type':_0x2132b8['name'],'sectionId':_0x2132b8['id']},{})[_0x7b39('0x24')](function(){return _0x5212d4;});}else{return _0x5212d4;}})['catch'](function(_0x4707be){logger['error'](_0x7b39('0x50'),_0x4707be);throw _0x4707be;});}return _0x5212d4;})[_0x7b39('0x24')](respondWithResult(_0x1c5cef,0xc9))[_0x7b39('0x46')](handleError(_0x1c5cef,null));};exports[_0x7b39('0x23')]=function(_0x3bfc08,_0x58da92){if(_0x3bfc08['body']['id']){delete _0x3bfc08['body']['id'];}return db[_0x7b39('0x40')]['find']({'where':{'id':_0x3bfc08[_0x7b39('0x43')]['id']}})[_0x7b39('0x24')](handleEntityNotFound(_0x58da92,null))[_0x7b39('0x24')](saveUpdates(_0x3bfc08[_0x7b39('0x48')],null))[_0x7b39('0x24')](respondWithResult(_0x58da92,null))[_0x7b39('0x46')](handleError(_0x58da92,null));};exports['destroy']=function(_0x4ebf33,_0x40594a){return db['Variable'][_0x7b39('0x4d')]({'where':{'id':_0x4ebf33[_0x7b39('0x43')]['id']}})['then'](handleEntityNotFound(_0x40594a,null))[_0x7b39('0x24')](removeEntity(_0x40594a,null))[_0x7b39('0x46')](handleError(_0x40594a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 449ba9d..8756d07 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 _0xb78f=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xbf4ddf,_0x66b3cb){var _0x3cb273=function(_0x3cf903){while(--_0x3cf903){_0xbf4ddf['push'](_0xbf4ddf['shift']());}};_0x3cb273(++_0x66b3cb);}(_0xb78f,0xe2));var _0xfb78=function(_0x136a21,_0x3fb3d3){_0x136a21=_0x136a21-0x0;var _0x1b2faa=_0xb78f[_0x136a21];return _0x1b2faa;};'use strict';var _=require(_0xfb78('0x0'));var util=require('util');var logger=require(_0xfb78('0x1'))(_0xfb78('0x2'));var moment=require(_0xfb78('0x3'));var BPromise=require(_0xfb78('0x4'));var rp=require(_0xfb78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb78('0x6'));var config=require(_0xfb78('0x7'));var attributes=require(_0xfb78('0x8'));module[_0xfb78('0x9')]=function(_0x4fd38d,_0x4fb83d){return _0x4fd38d[_0xfb78('0xa')](_0xfb78('0xb'),attributes,{'tableName':_0xfb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1def=['moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','api'];(function(_0x1fbd9f,_0x130ca3){var _0x55c8d7=function(_0x490015){while(--_0x490015){_0x1fbd9f['push'](_0x1fbd9f['shift']());}};_0x55c8d7(++_0x130ca3);}(_0x1def,0x195));var _0xf1de=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x1def[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xf1de('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf1de('0x1'));var moment=require(_0xf1de('0x2'));var BPromise=require(_0xf1de('0x3'));var rp=require(_0xf1de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1de('0x5'));var config=require(_0xf1de('0x6'));var attributes=require(_0xf1de('0x7'));module[_0xf1de('0x8')]=function(_0x24c10b,_0x32e037){return _0x24c10b['define'](_0xf1de('0x9'),attributes,{'tableName':_0xf1de('0xa'),'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 acb1d55..1dc8d3a 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x146d7a,_0x5cdd41){var _0x5498e3=function(_0x3633a6){while(--_0x3633a6){_0x146d7a['push'](_0x146d7a['shift']());}};_0x5498e3(++_0x5cdd41);}(_0xabce,0x103));var _0xeabc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xabce[_0x5e36d1];return _0x950b9e;};'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')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x14435b,_0x1f0bd9){var _0x32b25b=function(_0x226990){while(--_0x226990){_0x14435b['push'](_0x14435b['shift']());}};_0x32b25b(++_0x1f0bd9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4a3e45,_0x1e8ef3){_0x4a3e45=_0x4a3e45-0x0;var _0x48db76=_0x7fbe[_0x4a3e45];return _0x48db76;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 35158ef..9da45af 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 _0x18c3=['migrations','exports','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart'];(function(_0x2b1d79,_0x4051dd){var _0x330db3=function(_0xcf6b16){while(--_0xcf6b16){_0x2b1d79['push'](_0x2b1d79['shift']());}};_0x330db3(++_0x4051dd);}(_0x18c3,0x80));var _0x318c=function(_0x1980ad,_0xca16bc){_0x1980ad=_0x1980ad-0x0;var _0x179199=_0x18c3[_0x1980ad];return _0x179199;};'use strict';var express=require(_0x318c('0x0'));var router=express[_0x318c('0x1')]();var auth=require(_0x318c('0x2'));var controller=require(_0x318c('0x3'));router['get']('/',controller[_0x318c('0x4')]);router[_0x318c('0x5')](_0x318c('0x6'),auth[_0x318c('0x7')](),auth[_0x318c('0x8')](),controller[_0x318c('0x9')]);router['get'](_0x318c('0xa'),auth[_0x318c('0x7')](),auth[_0x318c('0x8')](),controller[_0x318c('0xb')]);router[_0x318c('0x5')](_0x318c('0xc'),auth[_0x318c('0x7')](),auth[_0x318c('0x8')](),controller[_0x318c('0xd')]);router[_0x318c('0x5')](_0x318c('0xe'),auth[_0x318c('0x7')](),controller[_0x318c('0xf')]);router[_0x318c('0x5')]('/migrations',controller[_0x318c('0x10')]);module[_0x318c('0x11')]=router; \ No newline at end of file +var _0x002e=['./version.controller','get','/fetch','canUpdate','reset','isAuthenticated','pull','/restart','restart','/migrations','migrations','Router','../../components/auth/service'];(function(_0x334837,_0x357cd1){var _0xa62133=function(_0x97559f){while(--_0x97559f){_0x334837['push'](_0x334837['shift']());}};_0xa62133(++_0x357cd1);}(_0x002e,0x8d));var _0xe002=function(_0x12254f,_0x100cfe){_0x12254f=_0x12254f-0x0;var _0x3a4fa2=_0x002e[_0x12254f];return _0x3a4fa2;};'use strict';var express=require('express');var router=express[_0xe002('0x0')]();var auth=require(_0xe002('0x1'));var controller=require(_0xe002('0x2'));router['get']('/',controller['index']);router[_0xe002('0x3')](_0xe002('0x4'),auth['isAuthenticated'](),auth[_0xe002('0x5')](),controller['fetch']);router[_0xe002('0x3')]('/reset',auth['isAuthenticated'](),auth[_0xe002('0x5')](),controller[_0xe002('0x6')]);router['get']('/pull',auth[_0xe002('0x7')](),auth[_0xe002('0x5')](),controller[_0xe002('0x8')]);router[_0xe002('0x3')](_0xe002('0x9'),auth[_0xe002('0x7')](),controller[_0xe002('0xa')]);router[_0xe002('0x3')](_0xe002('0xb'),controller[_0xe002('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3bd69f0..64cf3e6 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 _0x3cd0=['reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','replace','.js','push','Migration','sequelize','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','latest','exports','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master'];(function(_0x3ad46a,_0x420179){var _0x1f6cfc=function(_0x539f2b){while(--_0x539f2b){_0x3ad46a['push'](_0x3ad46a['shift']());}};_0x1f6cfc(++_0x420179);}(_0x3cd0,0x111));var _0x03cd=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x3cd0[_0x307bf6];return _0x2878fc;};'use strict';var Umzug=require(_0x03cd('0x0'));var path=require(_0x03cd('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x03cd('0x2'))(module,_0x03cd('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x03cd('0x4'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x03cd('0x5'));var pm2=require(_0x03cd('0x6'));var logger=require(_0x03cd('0x7'))(_0x03cd('0x8'));var git=require(_0x03cd('0x9'))(config[_0x03cd('0xa')]);exports['index']=function(_0x531c62,_0x4add0d){var _0x26cbec={'current':module['exports']['version'],'phonebar':0x2};if(_0x531c62['query']&&_0x531c62['query'][_0x03cd('0xb')]){return git['fetch']()['tags'](function(_0x587b14,_0x43e5d4){_0x26cbec[_0x03cd('0xb')]=(_0x587b14?module[_0x03cd('0xc')][_0x03cd('0x3')]:_0x43e5d4[_0x03cd('0xb')])||'2.0.0';return _0x4add0d[_0x03cd('0xd')](0xc8)[_0x03cd('0xe')](_0x26cbec);});}else{return _0x4add0d[_0x03cd('0xd')](0xc8)[_0x03cd('0xe')](_0x26cbec);}};exports['fetch']=function(_0x38b770,_0x4a0fe7){return git['fetch']([_0x03cd('0xf'),_0x03cd('0x10')],function(_0xd5d652){if(_0xd5d652){logger[_0x03cd('0x11')](_0xd5d652);return _0x4a0fe7[_0x03cd('0xd')](0x1f4)['json'](_0xd5d652);}logger[_0x03cd('0x12')](_0x03cd('0x13'));return _0x4a0fe7[_0x03cd('0xd')](0xc8)['json']({'output':_0x03cd('0x14')});});};exports[_0x03cd('0x15')]=function(_0x381b15,_0xa6954d){return git[_0x03cd('0x15')]([_0x03cd('0x16'),_0x03cd('0x17')],function(_0x2a88c3){if(_0x2a88c3){logger[_0x03cd('0x11')](_0x2a88c3);return _0xa6954d[_0x03cd('0xd')](0x1f4)[_0x03cd('0xe')](_0x2a88c3);}logger[_0x03cd('0x12')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xa6954d['status'](0xc8)[_0x03cd('0xe')]({'output':_0x03cd('0x18')});});};exports[_0x03cd('0x19')]=function(_0x83992d,_0x6729fd){exec(_0x03cd('0x1a'),function(_0x366586,_0x5b9a35,_0x57597b){logger['info'](_0x5b9a35);logger['info'](_0x57597b);if(_0x366586){logger[_0x03cd('0x11')](_0x366586);return _0x6729fd['status'](0x1f4)[_0x03cd('0xe')](_0x366586);}return _0x6729fd['status'](0xc8)[_0x03cd('0xe')]({'output':_0x5b9a35});});};exports[_0x03cd('0x1b')]=function(_0x34713a,_0x27254c){return pm2[_0x03cd('0x1b')](_0x03cd('0x1c'))[_0x03cd('0x1d')](function(_0x15daad){logger[_0x03cd('0x12')](_0x03cd('0x1e'),_0x15daad);return _0x27254c[_0x03cd('0xd')](0xc8)[_0x03cd('0xe')]({'output':_0x03cd('0x1f')});})[_0x03cd('0x20')](function(_0x4f7a51){logger[_0x03cd('0x11')](_0x4f7a51);return _0x27254c['status'](0x1f4)[_0x03cd('0xe')](_0x4f7a51);});};exports['migrations']=function(_0x12e536,_0x3a493b){var _0xe5f562=fs[_0x03cd('0x21')](path[_0x03cd('0x22')](config[_0x03cd('0xa')],_0x03cd('0x23'),_0x03cd('0x24')));var _0x2c6607=[];for(var _0x58f026=0x0;_0x58f026<_0xe5f562['length'];_0x58f026++){var _0x14d038=_0xe5f562[_0x58f026][_0x03cd('0x25')](_0x03cd('0x26'),'');if(compareVersions(module[_0x03cd('0xc')][_0x03cd('0x3')],_0x14d038)===-0x1){_0x2c6607[_0x03cd('0x27')](_0x14d038);}}if(_0x2c6607['length']){var _0x23544f=_0x2c6607['sort'](compareVersions);var _0x52d0b3=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x03cd('0x28'),'columnName':_0x03cd('0x3')},'migrations':{'params':[db[_0x03cd('0x29')][_0x03cd('0x2a')](),db[_0x03cd('0x29')][_0x03cd('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x03cd('0x22')](config[_0x03cd('0xa')],_0x03cd('0x23'),_0x03cd('0x24')),'pattern':/\.js$/}});_0x52d0b3['up']({'migrations':_[_0x03cd('0x2c')](_0x23544f,function(_0x4f21ec){return _0x4f21ec+_0x03cd('0x26');})})['then'](function(){return _0x3a493b[_0x03cd('0xd')](0xc8)['json']({'output':_0x03cd('0x2d')+module[_0x03cd('0xc')][_0x03cd('0x3')]+_0x03cd('0x2e')+_['last'](_0x23544f),'migrations':_[_0x03cd('0x22')](_0x23544f)});})['catch'](function(_0x54dd67){if(_0x54dd67 instanceof db[_0x03cd('0x29')][_0x03cd('0x2f')]){return _0x3a493b[_0x03cd('0xd')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x3a493b[_0x03cd('0xd')](0x1f4)[_0x03cd('0xe')](_0x54dd67);}});}else{return _0x3a493b[_0x03cd('0xd')](0xc8)[_0x03cd('0xe')]({'output':_0x03cd('0x30')});}}; \ No newline at end of file +var _0x62fd=['map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','index','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor'];(function(_0x477db9,_0x9e8f2b){var _0x56d1cc=function(_0x228528){while(--_0x228528){_0x477db9['push'](_0x477db9['shift']());}};_0x56d1cc(++_0x9e8f2b);}(_0x62fd,0x76));var _0xd62f=function(_0x544799,_0x592b0a){_0x544799=_0x544799-0x0;var _0x4af6bb=_0x62fd[_0x544799];return _0x4af6bb;};'use strict';var Umzug=require('umzug');var path=require(_0xd62f('0x0'));var fs=require('fs');var _=require(_0xd62f('0x1'));var pkginfo=require('pkginfo')(module,_0xd62f('0x2'));var compareVersions=require(_0xd62f('0x3'));var exec=require(_0xd62f('0x4'))[_0xd62f('0x5')];var db=require(_0xd62f('0x6'))['db'];var config=require(_0xd62f('0x7'));var pm2=require('../../config/pm2');var logger=require(_0xd62f('0x8'))(_0xd62f('0x9'));var git=require(_0xd62f('0xa'))(config['root']);exports[_0xd62f('0xb')]=function(_0x386cde,_0x59061a){var _0x3447a7={'current':module['exports'][_0xd62f('0x2')],'phonebar':0x2};if(_0x386cde[_0xd62f('0xc')]&&_0x386cde[_0xd62f('0xc')][_0xd62f('0xd')]){return git[_0xd62f('0xe')]()[_0xd62f('0xf')](function(_0x37d635,_0x5e2b48){_0x3447a7[_0xd62f('0xd')]=(_0x37d635?module[_0xd62f('0x10')][_0xd62f('0x2')]:_0x5e2b48['latest'])||_0xd62f('0x11');return _0x59061a[_0xd62f('0x12')](0xc8)[_0xd62f('0x13')](_0x3447a7);});}else{return _0x59061a[_0xd62f('0x12')](0xc8)[_0xd62f('0x13')](_0x3447a7);}};exports[_0xd62f('0xe')]=function(_0x1610a2,_0x325173){return git[_0xd62f('0xe')]([_0xd62f('0x14'),_0xd62f('0x15')],function(_0x3bba6e){if(_0x3bba6e){logger[_0xd62f('0x16')](_0x3bba6e);return _0x325173[_0xd62f('0x12')](0x1f4)[_0xd62f('0x13')](_0x3bba6e);}logger[_0xd62f('0x17')](_0xd62f('0x18'));return _0x325173[_0xd62f('0x12')](0xc8)[_0xd62f('0x13')]({'output':_0xd62f('0x19')});});};exports[_0xd62f('0x1a')]=function(_0x272297,_0x273795){return git['reset']([_0xd62f('0x1b'),'FETCH_HEAD'],function(_0x4f79c4){if(_0x4f79c4){logger[_0xd62f('0x16')](_0x4f79c4);return _0x273795[_0xd62f('0x12')](0x1f4)[_0xd62f('0x13')](_0x4f79c4);}logger[_0xd62f('0x17')](_0xd62f('0x1c'));return _0x273795[_0xd62f('0x12')](0xc8)['json']({'output':_0xd62f('0x1d')});});};exports[_0xd62f('0x1e')]=function(_0x4eaf0e,_0x552b0c){exec('npm\x20install\x20--production',function(_0x5a7033,_0x312da2,_0x3e4310){logger[_0xd62f('0x17')](_0x312da2);logger['info'](_0x3e4310);if(_0x5a7033){logger['error'](_0x5a7033);return _0x552b0c[_0xd62f('0x12')](0x1f4)[_0xd62f('0x13')](_0x5a7033);}return _0x552b0c[_0xd62f('0x12')](0xc8)[_0xd62f('0x13')]({'output':_0x312da2});});};exports[_0xd62f('0x1f')]=function(_0x76d534,_0x4bc583){return pm2[_0xd62f('0x1f')](_0xd62f('0x20'))[_0xd62f('0x21')](function(_0x2068ff){logger[_0xd62f('0x17')](_0xd62f('0x22'),_0x2068ff);return _0x4bc583['status'](0xc8)[_0xd62f('0x13')]({'output':_0xd62f('0x23')});})['catch'](function(_0x334ad4){logger[_0xd62f('0x16')](_0x334ad4);return _0x4bc583[_0xd62f('0x12')](0x1f4)[_0xd62f('0x13')](_0x334ad4);});};exports[_0xd62f('0x24')]=function(_0x196635,_0x21ec04){var _0x1a076c=fs[_0xd62f('0x25')](path[_0xd62f('0x26')](config[_0xd62f('0x27')],_0xd62f('0x28'),_0xd62f('0x24')));var _0x5c2fc9=[];for(var _0x3db141=0x0;_0x3db141<_0x1a076c[_0xd62f('0x29')];_0x3db141++){var _0x258ce3=_0x1a076c[_0x3db141][_0xd62f('0x2a')](_0xd62f('0x2b'),'');if(compareVersions(module['exports']['version'],_0x258ce3)===-0x1){_0x5c2fc9[_0xd62f('0x2c')](_0x258ce3);}}if(_0x5c2fc9['length']){var _0x3c9eb5=_0x5c2fc9[_0xd62f('0x2d')](compareVersions);var _0xe6812c=new Umzug({'storage':_0xd62f('0x2e'),'storageOptions':{'model':db['Migration'],'modelName':_0xd62f('0x2f'),'columnName':'version'},'migrations':{'params':[db[_0xd62f('0x2e')][_0xd62f('0x30')](),db[_0xd62f('0x2e')][_0xd62f('0x31')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0xd62f('0x27')],_0xd62f('0x28'),_0xd62f('0x24')),'pattern':/\.js$/}});_0xe6812c['up']({'migrations':_[_0xd62f('0x32')](_0x3c9eb5,function(_0x3d2c9f){return _0x3d2c9f+_0xd62f('0x2b');})})[_0xd62f('0x21')](function(){return _0x21ec04[_0xd62f('0x12')](0xc8)['json']({'output':_0xd62f('0x33')+module[_0xd62f('0x10')][_0xd62f('0x2')]+_0xd62f('0x34')+_[_0xd62f('0x35')](_0x3c9eb5),'migrations':_[_0xd62f('0x26')](_0x3c9eb5)});})['catch'](function(_0x41da0c){if(_0x41da0c instanceof db[_0xd62f('0x2e')][_0xd62f('0x36')]){return _0x21ec04[_0xd62f('0x12')](0xc8)['json']({'output':_0xd62f('0x37')});}else{return _0x21ec04[_0xd62f('0x12')](0x1f4)[_0xd62f('0x13')](_0x41da0c);}});}else{return _0x21ec04[_0xd62f('0x12')](0xc8)[_0xd62f('0x13')]({'output':_0xd62f('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 231baec..7e20970 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 _0x0cf5=['get','isAuthenticated','index','/describe','/:id','show','post','update','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0cf5,0x109));var _0x50cf=function(_0x11f736,_0x29472c){_0x11f736=_0x11f736-0x0;var _0x14ed6e=_0x0cf5[_0x11f736];return _0x14ed6e;};'use strict';var multer=require(_0x50cf('0x0'));var util=require('util');var path=require(_0x50cf('0x1'));var timeout=require('connect-timeout');var express=require(_0x50cf('0x2'));var router=express['Router']();var fs_extra=require(_0x50cf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x50cf('0x4'));var config=require(_0x50cf('0x5'));var controller=require(_0x50cf('0x6'));router[_0x50cf('0x7')]('/',auth[_0x50cf('0x8')](),controller[_0x50cf('0x9')]);router[_0x50cf('0x7')](_0x50cf('0xa'),auth[_0x50cf('0x8')](),controller['describe']);router[_0x50cf('0x7')](_0x50cf('0xb'),auth['isAuthenticated'](),controller[_0x50cf('0xc')]);router[_0x50cf('0xd')]('/',auth[_0x50cf('0x8')](),controller['create']);router['put'](_0x50cf('0xb'),auth[_0x50cf('0x8')](),controller[_0x50cf('0xe')]);router['delete'](_0x50cf('0xb'),auth[_0x50cf('0x8')](),controller[_0x50cf('0xf')]);module[_0x50cf('0x10')]=router; \ No newline at end of file +var _0xd868=['fs-extra','../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','util','connect-timeout','express','Router'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd868,0x164));var _0x8d86=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd868[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x8d86('0x0'));var path=require('path');var timeout=require(_0x8d86('0x1'));var express=require(_0x8d86('0x2'));var router=express[_0x8d86('0x3')]();var fs_extra=require(_0x8d86('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d86('0x5'));var controller=require(_0x8d86('0x6'));router[_0x8d86('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8d86('0x7')](_0x8d86('0x8'),auth[_0x8d86('0x9')](),controller[_0x8d86('0xa')]);router[_0x8d86('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8d86('0xb')]);router[_0x8d86('0xc')]('/',auth['isAuthenticated'](),controller[_0x8d86('0xd')]);router[_0x8d86('0xe')](_0x8d86('0xf'),auth['isAuthenticated'](),controller[_0x8d86('0x10')]);router['delete'](_0x8d86('0xf'),auth[_0x8d86('0x9')](),controller[_0x8d86('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 1765eed..5226b24 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 _0x3264=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3264,0x7f));var _0x4326=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x3264[_0x4a7631];return _0x1a5a6f;};'use strict';var Sequelize=require('sequelize');module[_0x4326('0x0')]={'type':{'type':Sequelize[_0x4326('0x1')]},'uniqueid':{'type':Sequelize[_0x4326('0x1')]},'calleridnum':{'type':Sequelize[_0x4326('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4326('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4326('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x4326('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x4326('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4326('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4326('0x4')]},'agentacw':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4326('0x4')]},'reason':{'type':Sequelize[_0x4326('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4326('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4326('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4326('0x1')]},'connectedlinename':{'type':Sequelize[_0x4326('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4326('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4326('0x1')]},'destchannel':{'type':Sequelize[_0x4326('0x1')]},'destchannelstate':{'type':Sequelize[_0x4326('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4326('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4326('0x1')]},'destaccountcode':{'type':Sequelize[_0x4326('0x1')]},'destcontext':{'type':Sequelize[_0x4326('0x1')]},'destexten':{'type':Sequelize[_0x4326('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x4326('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4326('0x1')],'comment':_0x4326('0x5')},'transferexten':{'type':Sequelize[_0x4326('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4326('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8952=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x8952,0x17e));var _0x2895=function(_0x57702b,_0x2590a5){_0x57702b=_0x57702b-0x0;var _0x52df11=_0x8952[_0x57702b];return _0x52df11;};'use strict';var Sequelize=require('sequelize');module[_0x2895('0x0')]={'type':{'type':Sequelize[_0x2895('0x1')]},'uniqueid':{'type':Sequelize[_0x2895('0x1')]},'calleridnum':{'type':Sequelize[_0x2895('0x1')]},'calleridname':{'type':Sequelize[_0x2895('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2895('0x1')]},'membername':{'type':Sequelize[_0x2895('0x1')]},'agentcalledAt':{'type':Sequelize[_0x2895('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x2895('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x2895('0x2')]},'agentdumpAt':{'type':Sequelize[_0x2895('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2895('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2895('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2895('0x4')]},'agentacw':{'type':Sequelize[_0x2895('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2895('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2895('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x2895('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2895('0x1')]},'accountcode':{'type':Sequelize[_0x2895('0x1')]},'context':{'type':Sequelize[_0x2895('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x2895('0x1')]},'destchannel':{'type':Sequelize[_0x2895('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x2895('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2895('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2895('0x1')]},'destlanguage':{'type':Sequelize[_0x2895('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2895('0x1')]},'destexten':{'type':Sequelize[_0x2895('0x1')]},'destpriority':{'type':Sequelize[_0x2895('0x1')]},'destuniqueid':{'type':Sequelize[_0x2895('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2895('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2895('0x1')]},'transfer':{'type':Sequelize[_0x2895('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2895('0x1')],'comment':_0x2895('0x5')},'transferexten':{'type':Sequelize[_0x2895('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2895('0x1')]},'agententerreason':{'type':Sequelize[_0x2895('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 60e878d..fec1bdb 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(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index bcb3730..1ae684b 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 _0x7c49=['request-promise','path','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','moment'];(function(_0x1070b5,_0x3761ce){var _0x312c24=function(_0x466b32){while(--_0x466b32){_0x1070b5['push'](_0x1070b5['shift']());}};_0x312c24(++_0x3761ce);}(_0x7c49,0x141));var _0x97c4=function(_0xf6fb8f,_0x9086){_0xf6fb8f=_0xf6fb8f-0x0;var _0x439c75=_0x7c49[_0xf6fb8f];return _0x439c75;};'use strict';var _=require(_0x97c4('0x0'));var util=require(_0x97c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97c4('0x2'));var BPromise=require('bluebird');var rp=require(_0x97c4('0x3'));var fs=require('fs');var path=require(_0x97c4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97c4('0x5'));module[_0x97c4('0x6')]=function(_0x2f02ec,_0x538c14){return _0x2f02ec[_0x97c4('0x7')](_0x97c4('0x8'),attributes,{'tableName':_0x97c4('0x9'),'paranoid':![],'indexes':[{'fields':[_0x97c4('0xa'),_0x97c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c84=['destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x6c84,0x112));var _0x46c8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6c84[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var logger=require(_0x46c8('0x2'))(_0x46c8('0x3'));var moment=require(_0x46c8('0x4'));var BPromise=require('bluebird');var rp=require(_0x46c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46c8('0x6'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x46c8('0x7')]=function(_0x378507,_0x322cba){return _0x378507[_0x46c8('0x8')](_0x46c8('0x9'),attributes,{'tableName':_0x46c8('0xa'),'paranoid':![],'indexes':[{'fields':[_0x46c8('0xb'),_0x46c8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index c92f5ce..afba4a8 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 _0xe834=['UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','update','limit'];(function(_0x987fe6,_0x24ac32){var _0x4fb549=function(_0x14a3d0){while(--_0x14a3d0){_0x987fe6['push'](_0x987fe6['shift']());}};_0x4fb549(++_0x24ac32);}(_0xe834,0x1a1));var _0x4e83=function(_0x3086e3,_0x42bab4){_0x3086e3=_0x3086e3-0x0;var _0x46369a=_0xe834[_0x3086e3];return _0x46369a;};'use strict';var _=require(_0x4e83('0x0'));var util=require(_0x4e83('0x1'));var moment=require('moment');var BPromise=require(_0x4e83('0x2'));var rs=require(_0x4e83('0x3'));var fs=require('fs');var Redis=require(_0x4e83('0x4'));var db=require(_0x4e83('0x5'))['db'];var utils=require(_0x4e83('0x6'));var logger=require('../../config/logger')(_0x4e83('0x7'));var config=require(_0x4e83('0x8'));var jayson=require(_0x4e83('0x9'));var client=jayson[_0x4e83('0xa')][_0x4e83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x322803,_0x1226a0,_0x4a50f3){return new BPromise(function(_0xa23152,_0x2070e8){return client['request'](_0x322803,_0x4a50f3)[_0x4e83('0xc')](function(_0x5059fc){logger[_0x4e83('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x1226a0,_0x4e83('0xe'));logger[_0x4e83('0xf')](_0x4e83('0x10'),_0x1226a0,_0x4e83('0xe'),JSON[_0x4e83('0x11')](_0x5059fc));if(_0x5059fc[_0x4e83('0x12')]){if(_0x5059fc[_0x4e83('0x12')][_0x4e83('0x13')]===0x1f4){logger['error'](_0x4e83('0x14'),_0x1226a0,_0x5059fc[_0x4e83('0x12')][_0x4e83('0x15')]);return _0x2070e8(_0x5059fc[_0x4e83('0x12')][_0x4e83('0x15')]);}logger['error'](_0x4e83('0x14'),_0x1226a0,_0x5059fc[_0x4e83('0x12')]['message']);return _0xa23152(_0x5059fc['error'][_0x4e83('0x15')]);}else{logger['info'](_0x4e83('0x14'),_0x1226a0,_0x4e83('0xe'));_0xa23152(_0x5059fc[_0x4e83('0x16')][_0x4e83('0x15')]);}})[_0x4e83('0x17')](function(_0x49f9de){logger[_0x4e83('0x12')](_0x4e83('0x14'),_0x1226a0,_0x49f9de);_0x2070e8(_0x49f9de);});});}exports['CreateVoiceAgentReport']=function(_0x3124a4){var _0x3087be=this;return new Promise(function(_0x4e2c8a,_0x76bdd5){return db[_0x4e83('0x18')]['create'](_0x3124a4[_0x4e83('0x19')],{'raw':_0x3124a4[_0x4e83('0x1a')]?_0x3124a4[_0x4e83('0x1a')][_0x4e83('0x1b')]===undefined?!![]:![]:!![]})[_0x4e83('0xc')](function(_0x1a28ca){logger[_0x4e83('0xd')](_0x4e83('0x1c'),_0x3124a4);logger[_0x4e83('0xf')]('CreateVoiceAgentReport',_0x3124a4,JSON[_0x4e83('0x11')](_0x1a28ca));_0x4e2c8a(_0x1a28ca);})['catch'](function(_0xfe8812){logger['error'](_0x4e83('0x1c'),_0xfe8812[_0x4e83('0x15')],_0x3124a4);_0x76bdd5(_0x3087be['error'](0x1f4,_0xfe8812[_0x4e83('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3b70b6){var _0x37a463=this;return new Promise(function(_0x18953a,_0x2064ce){return db['VoiceAgentReport'][_0x4e83('0x1d')](_0x3b70b6[_0x4e83('0x19')],{'raw':_0x3b70b6[_0x4e83('0x1a')]?_0x3b70b6[_0x4e83('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b70b6['options']?_0x3b70b6['options']['where']||null:null,'attributes':_0x3b70b6[_0x4e83('0x1a')]?_0x3b70b6['options']['attributes']||null:null,'limit':_0x3b70b6['options']?_0x3b70b6[_0x4e83('0x1a')][_0x4e83('0x1e')]||null:null})[_0x4e83('0xc')](function(_0x345d78){logger[_0x4e83('0xd')](_0x4e83('0x1f'),_0x3b70b6);logger[_0x4e83('0xf')](_0x4e83('0x1f'),_0x3b70b6,JSON[_0x4e83('0x11')](_0x345d78));_0x18953a(_0x345d78);})[_0x4e83('0x17')](function(_0x1aa84d){logger[_0x4e83('0x12')](_0x4e83('0x1f'),_0x1aa84d[_0x4e83('0x15')],_0x3b70b6);_0x2064ce(_0x37a463['error'](0x1f4,_0x1aa84d[_0x4e83('0x15')]));});});}; \ No newline at end of file +var _0x11b0=['../../config/logger','rpc','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceAgentReport','create','body','options','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','util','randomstring','ioredis','../../config/utils'];(function(_0x289066,_0x237191){var _0x5ba9a5=function(_0x332435){while(--_0x332435){_0x289066['push'](_0x289066['shift']());}};_0x5ba9a5(++_0x237191);}(_0x11b0,0x13b));var _0x011b=function(_0x500eea,_0x1251c1){_0x500eea=_0x500eea-0x0;var _0x3f43a8=_0x11b0[_0x500eea];return _0x3f43a8;};'use strict';var _=require('lodash');var util=require(_0x011b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x011b('0x1'));var fs=require('fs');var Redis=require(_0x011b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x011b('0x3'));var logger=require(_0x011b('0x4'))(_0x011b('0x5'));var config=require('../../config/environment');var jayson=require(_0x011b('0x6'));var client=jayson['client'][_0x011b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x383d49,_0x360531,_0x3f7908){return new BPromise(function(_0x58ae1f,_0x309536){return client[_0x011b('0x8')](_0x383d49,_0x3f7908)['then'](function(_0x444704){logger[_0x011b('0x9')](_0x011b('0xa'),_0x360531,_0x011b('0xb'));logger[_0x011b('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x360531,_0x011b('0xb'),JSON[_0x011b('0xd')](_0x444704));if(_0x444704[_0x011b('0xe')]){if(_0x444704[_0x011b('0xe')]['code']===0x1f4){logger[_0x011b('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x360531,_0x444704[_0x011b('0xe')]['message']);return _0x309536(_0x444704[_0x011b('0xe')][_0x011b('0xf')]);}logger[_0x011b('0xe')](_0x011b('0xa'),_0x360531,_0x444704[_0x011b('0xe')][_0x011b('0xf')]);return _0x58ae1f(_0x444704[_0x011b('0xe')]['message']);}else{logger[_0x011b('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x360531,_0x011b('0xb'));_0x58ae1f(_0x444704[_0x011b('0x10')][_0x011b('0xf')]);}})[_0x011b('0x11')](function(_0x1f165b){logger['error'](_0x011b('0xa'),_0x360531,_0x1f165b);_0x309536(_0x1f165b);});});}exports['CreateVoiceAgentReport']=function(_0x10e262){var _0x21657f=this;return new Promise(function(_0x5c100d,_0x53b8d2){return db[_0x011b('0x12')][_0x011b('0x13')](_0x10e262[_0x011b('0x14')],{'raw':_0x10e262[_0x011b('0x15')]?_0x10e262[_0x011b('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x011b('0x16')](function(_0x4bedad){logger[_0x011b('0x9')](_0x011b('0x17'),_0x10e262);logger[_0x011b('0xc')](_0x011b('0x17'),_0x10e262,JSON['stringify'](_0x4bedad));_0x5c100d(_0x4bedad);})['catch'](function(_0x5d7ca6){logger[_0x011b('0xe')](_0x011b('0x17'),_0x5d7ca6[_0x011b('0xf')],_0x10e262);_0x53b8d2(_0x21657f[_0x011b('0xe')](0x1f4,_0x5d7ca6[_0x011b('0xf')]));});});};exports[_0x011b('0x18')]=function(_0x9d64f6){var _0x18e8d4=this;return new Promise(function(_0x14bb6c,_0x28889f){return db[_0x011b('0x12')][_0x011b('0x19')](_0x9d64f6['body'],{'raw':_0x9d64f6['options']?_0x9d64f6[_0x011b('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9d64f6[_0x011b('0x15')]?_0x9d64f6[_0x011b('0x15')][_0x011b('0x1a')]||null:null,'attributes':_0x9d64f6[_0x011b('0x15')]?_0x9d64f6[_0x011b('0x15')][_0x011b('0x1b')]||null:null,'limit':_0x9d64f6['options']?_0x9d64f6[_0x011b('0x15')][_0x011b('0x1c')]||null:null})[_0x011b('0x16')](function(_0x4ddac6){logger[_0x011b('0x9')]('UpdateVoiceAgentReport',_0x9d64f6);logger[_0x011b('0xc')](_0x011b('0x18'),_0x9d64f6,JSON[_0x011b('0xd')](_0x4ddac6));_0x14bb6c(_0x4ddac6);})['catch'](function(_0x460120){logger[_0x011b('0xe')](_0x011b('0x18'),_0x460120[_0x011b('0xf')],_0x9d64f6);_0x28889f(_0x18e8d4[_0x011b('0xe')](0x1f4,_0x460120[_0x011b('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b553798..554196c 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 _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x1546c2,_0x22e822){var _0x24583c=function(_0x3906f8){while(--_0x3906f8){_0x1546c2['push'](_0x1546c2['shift']());}};_0x24583c(++_0x22e822);}(_0xae24,0x182));var _0x4ae2=function(_0x4ea9e1,_0x80fd10){_0x4ea9e1=_0x4ea9e1-0x0;var _0x598da9=_0xae24[_0x4ea9e1];return _0x598da9;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router; \ No newline at end of file +var _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x59b533,_0x59fdcc){var _0x2beced=function(_0xd3aaf3){while(--_0xd3aaf3){_0x59b533['push'](_0x59b533['shift']());}};_0x2beced(++_0x59fdcc);}(_0xae24,0x182));var _0x4ae2=function(_0x31a369,_0x105f89){_0x31a369=_0x31a369-0x0;var _0x154c76=_0xae24[_0x31a369];return _0x154c76;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 0fbc1e0..4a7696f 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 _0x5007=['inbound-fax','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5007,0xfe));var _0x7500=function(_0x5b8102,_0x46c37b){_0x5b8102=_0x5b8102-0x0;var _0x58c9b7=_0x5007[_0x5b8102];return _0x58c9b7;};'use strict';var Sequelize=require(_0x7500('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7500('0x1')]},'type':{'type':Sequelize[_0x7500('0x2')](_0x7500('0x3'),_0x7500('0x4'),_0x7500('0x5'),_0x7500('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x7500('0x1')]},'accountcode':{'type':Sequelize[_0x7500('0x1')]},'source':{'type':Sequelize[_0x7500('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7500('0x1')]},'channel':{'type':Sequelize[_0x7500('0x1')]},'destinationchannel':{'type':Sequelize[_0x7500('0x1')]},'lastapplication':{'type':Sequelize[_0x7500('0x1')]},'lastdata':{'type':Sequelize[_0x7500('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x7500('0x8')]},'answertime':{'type':Sequelize[_0x7500('0x8')]},'endtime':{'type':Sequelize[_0x7500('0x8')]},'duration':{'type':Sequelize[_0x7500('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7500('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7500('0x1')]},'userfield':{'type':Sequelize[_0x7500('0x1')]},'userDisposition':{'type':Sequelize[_0x7500('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x7500('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x7500('0x1')]},'note':{'type':Sequelize[_0x7500('0x1')]},'prefix':{'type':Sequelize[_0x7500('0x1')]},'routeid':{'type':Sequelize[_0x7500('0x9')]},'sipcallid':{'type':Sequelize[_0x7500('0x1')]}}; \ No newline at end of file +var _0x052c=['exports','STRING','ENUM','inbound','internal','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x43ce27,_0x206258){var _0x3abded=function(_0x23dd7a){while(--_0x23dd7a){_0x43ce27['push'](_0x43ce27['shift']());}};_0x3abded(++_0x206258);}(_0x052c,0xe6));var _0xc052=function(_0x3b507b,_0x7a2e5f){_0x3b507b=_0x3b507b-0x0;var _0x1e2992=_0x052c[_0x3b507b];return _0x1e2992;};'use strict';var Sequelize=require(_0xc052('0x0'));module[_0xc052('0x1')]={'uniqueid':{'type':Sequelize[_0xc052('0x2')]},'type':{'type':Sequelize[_0xc052('0x3')](_0xc052('0x4'),_0xc052('0x5'),'outbound','inbound-fax',_0xc052('0x6'),_0xc052('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc052('0x2')]},'source':{'type':Sequelize[_0xc052('0x2')]},'destination':{'type':Sequelize[_0xc052('0x2')]},'destinationcontext':{'type':Sequelize[_0xc052('0x2')]},'callerid':{'type':Sequelize[_0xc052('0x2')]},'channel':{'type':Sequelize[_0xc052('0x2')]},'destinationchannel':{'type':Sequelize[_0xc052('0x2')]},'lastapplication':{'type':Sequelize[_0xc052('0x2')]},'lastdata':{'type':Sequelize[_0xc052('0x8')]},'starttime':{'type':Sequelize[_0xc052('0x9')]},'systemanswertime':{'type':Sequelize[_0xc052('0x9')]},'answertime':{'type':Sequelize[_0xc052('0x9')]},'endtime':{'type':Sequelize[_0xc052('0x9')]},'duration':{'type':Sequelize[_0xc052('0xa')]},'billableseconds':{'type':Sequelize[_0xc052('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc052('0x2')]},'amaflags':{'type':Sequelize[_0xc052('0x2')]},'userfield':{'type':Sequelize[_0xc052('0x2')]},'userDisposition':{'type':Sequelize[_0xc052('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc052('0x2')]},'prefix':{'type':Sequelize[_0xc052('0x2')]},'routeid':{'type':Sequelize[_0xc052('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 013ea87..d8b8786 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f56eb,_0x1e3132){_0x1f56eb=_0x1f56eb-0x0;var _0xc86ec=_0x2ef3[_0x1f56eb];return _0xc86ec;};'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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x137b51,_0x21a1e1){_0x137b51=_0x137b51-0x0;var _0x1f98ea=_0x2032[_0x137b51];return _0x1f98ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e5ded52..e4352c5 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 _0xd136=['./voiceCallReport.attributes','exports','define','VoiceCallReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29d1ba,_0x7a5223){var _0x3de575=function(_0x10560b){while(--_0x10560b){_0x29d1ba['push'](_0x29d1ba['shift']());}};_0x3de575(++_0x7a5223);}(_0xd136,0x94));var _0x6d13=function(_0x86448f,_0x5bbc6e){_0x86448f=_0x86448f-0x0;var _0x3b0ffc=_0xd136[_0x86448f];return _0x3b0ffc;};'use strict';var _=require('lodash');var util=require(_0x6d13('0x0'));var logger=require(_0x6d13('0x1'))('api');var moment=require(_0x6d13('0x2'));var BPromise=require(_0x6d13('0x3'));var rp=require(_0x6d13('0x4'));var fs=require('fs');var path=require(_0x6d13('0x5'));var rimraf=require(_0x6d13('0x6'));var config=require(_0x6d13('0x7'));var attributes=require(_0x6d13('0x8'));module[_0x6d13('0x9')]=function(_0x147026,_0x4aabef){return _0x147026[_0x6d13('0xa')](_0x6d13('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b16=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x3cdf50,_0x3e8eb2){var _0x22d47a=function(_0xdc5336){while(--_0xdc5336){_0x3cdf50['push'](_0x3cdf50['shift']());}};_0x22d47a(++_0x3e8eb2);}(_0x0b16,0xf0));var _0x60b1=function(_0x4a3a6a,_0x3dc2de){_0x4a3a6a=_0x4a3a6a-0x0;var _0x599ed0=_0x0b16[_0x4a3a6a];return _0x599ed0;};'use strict';var _=require(_0x60b1('0x0'));var util=require(_0x60b1('0x1'));var logger=require('../../config/logger')(_0x60b1('0x2'));var moment=require('moment');var BPromise=require(_0x60b1('0x3'));var rp=require(_0x60b1('0x4'));var fs=require('fs');var path=require(_0x60b1('0x5'));var rimraf=require(_0x60b1('0x6'));var config=require(_0x60b1('0x7'));var attributes=require(_0x60b1('0x8'));module[_0x60b1('0x9')]=function(_0x5c5012,_0x346e12){return _0x5c5012[_0x60b1('0xa')](_0x60b1('0xb'),attributes,{'tableName':_0x60b1('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 02c14e4..f347d61 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 _0x3e04=['VoiceCallReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','where','include','model','map','attributes','GetVoiceCallReport','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport'];(function(_0x6cc506,_0x150151){var _0x310e18=function(_0x35c5f3){while(--_0x35c5f3){_0x6cc506['push'](_0x6cc506['shift']());}};_0x310e18(++_0x150151);}(_0x3e04,0x1a4));var _0x43e0=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x3e04[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x43e0('0x0'));var util=require(_0x43e0('0x1'));var moment=require('moment');var BPromise=require(_0x43e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43e0('0x3'));var db=require(_0x43e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43e0('0x5'))(_0x43e0('0x6'));var config=require(_0x43e0('0x7'));var jayson=require(_0x43e0('0x8'));var client=jayson[_0x43e0('0x9')][_0x43e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456990,_0x1390ea,_0x4ee995){return new BPromise(function(_0x3b8af1,_0x2d6a64){return client[_0x43e0('0xb')](_0x456990,_0x4ee995)[_0x43e0('0xc')](function(_0x3cae6c){logger[_0x43e0('0xd')](_0x43e0('0xe'),_0x1390ea,_0x43e0('0xf'));logger[_0x43e0('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1390ea,_0x43e0('0xf'),JSON[_0x43e0('0x11')](_0x3cae6c));if(_0x3cae6c[_0x43e0('0x12')]){if(_0x3cae6c['error'][_0x43e0('0x13')]===0x1f4){logger[_0x43e0('0x12')](_0x43e0('0xe'),_0x1390ea,_0x3cae6c[_0x43e0('0x12')][_0x43e0('0x14')]);return _0x2d6a64(_0x3cae6c[_0x43e0('0x12')][_0x43e0('0x14')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1390ea,_0x3cae6c[_0x43e0('0x12')][_0x43e0('0x14')]);return _0x3b8af1(_0x3cae6c[_0x43e0('0x12')][_0x43e0('0x14')]);}else{logger[_0x43e0('0xd')](_0x43e0('0xe'),_0x1390ea,'request\x20sent');_0x3b8af1(_0x3cae6c[_0x43e0('0x15')][_0x43e0('0x14')]);}})['catch'](function(_0x3fb06b){logger[_0x43e0('0x12')](_0x43e0('0xe'),_0x1390ea,_0x3fb06b);_0x2d6a64(_0x3fb06b);});});}exports['GetVoiceCallReport']=function(_0x142479){var _0xd2db74=this;return new Promise(function(_0x5ece3c,_0x4f0e53){return db['VoiceCallReport'][_0x43e0('0x16')]({'raw':_0x142479['options']?_0x142479[_0x43e0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x142479[_0x43e0('0x17')]?_0x142479[_0x43e0('0x17')][_0x43e0('0x18')]||null:null,'attributes':_0x142479['options']?_0x142479[_0x43e0('0x17')]['attributes']||null:null,'limit':_0x142479[_0x43e0('0x17')]?_0x142479[_0x43e0('0x17')]['limit']||null:null,'include':_0x142479[_0x43e0('0x17')]?_0x142479[_0x43e0('0x17')][_0x43e0('0x19')]?_['map'](_0x142479[_0x43e0('0x17')]['include'],function(_0x16cbda){return{'model':db[_0x16cbda[_0x43e0('0x1a')]],'as':_0x16cbda['as'],'attributes':_0x16cbda['attributes'],'include':_0x16cbda[_0x43e0('0x19')]?_[_0x43e0('0x1b')](_0x16cbda[_0x43e0('0x19')],function(_0x5b05cd){return{'model':db[_0x5b05cd[_0x43e0('0x1a')]],'as':_0x5b05cd['as'],'attributes':_0x5b05cd[_0x43e0('0x1c')],'include':_0x5b05cd[_0x43e0('0x19')]?_['map'](_0x5b05cd[_0x43e0('0x19')],function(_0x1310c9){return{'model':db[_0x1310c9['model']],'as':_0x1310c9['as'],'attributes':_0x1310c9['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e0('0xc')](function(_0x210429){logger[_0x43e0('0xd')]('GetVoiceCallReport',_0x142479);logger[_0x43e0('0x10')](_0x43e0('0x1d'),_0x142479,JSON[_0x43e0('0x11')](_0x210429));_0x5ece3c(_0x210429);})[_0x43e0('0x1e')](function(_0x504c70){logger[_0x43e0('0x12')]('GetVoiceCallReport',_0x504c70['message'],_0x142479);_0x4f0e53(_0xd2db74[_0x43e0('0x12')](0x1f4,_0x504c70[_0x43e0('0x14')]));});});};exports[_0x43e0('0x1f')]=function(_0x91de){var _0xcb4e51=this;return new Promise(function(_0x316643,_0x17a68a){return db['VoiceCallReport'][_0x43e0('0x20')](_0x91de[_0x43e0('0x21')],{'raw':_0x91de['options']?_0x91de[_0x43e0('0x17')][_0x43e0('0x22')]===undefined?!![]:![]:!![]})[_0x43e0('0xc')](function(_0x4d0146){logger['info'](_0x43e0('0x1f'),_0x91de);logger[_0x43e0('0x10')]('CreateVoiceCallReport',_0x91de,JSON[_0x43e0('0x11')](_0x4d0146));_0x316643(_0x4d0146);})['catch'](function(_0x4adb0b){logger[_0x43e0('0x12')]('CreateVoiceCallReport',_0x4adb0b['message'],_0x91de);_0x17a68a(_0xcb4e51[_0x43e0('0x12')](0x1f4,_0x4adb0b[_0x43e0('0x14')]));});});};exports[_0x43e0('0x23')]=function(_0x4a0360){var _0x53f1a2=this;return new Promise(function(_0x249e96,_0x238b92){return db[_0x43e0('0x24')][_0x43e0('0x25')](_0x4a0360['body'],{'raw':_0x4a0360[_0x43e0('0x17')]?_0x4a0360[_0x43e0('0x17')][_0x43e0('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0360['options']?_0x4a0360['options']['where']||null:null,'attributes':_0x4a0360[_0x43e0('0x17')]?_0x4a0360['options'][_0x43e0('0x1c')]||null:null,'limit':_0x4a0360['options']?_0x4a0360[_0x43e0('0x17')]['limit']||null:null})['then'](function(_0x2f5c1c){logger['info'](_0x43e0('0x23'),_0x4a0360);logger['debug'](_0x43e0('0x23'),_0x4a0360,JSON[_0x43e0('0x11')](_0x2f5c1c));_0x249e96(_0x2f5c1c);})[_0x43e0('0x1e')](function(_0x1cc76f){logger[_0x43e0('0x12')](_0x43e0('0x23'),_0x1cc76f[_0x43e0('0x14')],_0x4a0360);_0x238b92(_0x53f1a2['error'](0x1f4,_0x1cc76f[_0x43e0('0x14')]));});});}; \ No newline at end of file +var _0x6c1c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','model','map','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','bluebird'];(function(_0x5d4287,_0x20c651){var _0x1538a3=function(_0x59ff71){while(--_0x59ff71){_0x5d4287['push'](_0x5d4287['shift']());}};_0x1538a3(++_0x20c651);}(_0x6c1c,0x18d));var _0xc6c1=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0x6c1c[_0x350258];return _0x3714b3;};'use strict';var _=require(_0xc6c1('0x0'));var util=require(_0xc6c1('0x1'));var moment=require('moment');var BPromise=require(_0xc6c1('0x2'));var rs=require(_0xc6c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6c1('0x4'))['db'];var utils=require(_0xc6c1('0x5'));var logger=require(_0xc6c1('0x6'))(_0xc6c1('0x7'));var config=require(_0xc6c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc6c1('0x9')][_0xc6c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aa1b2,_0x2c8d79,_0xbbecc7){return new BPromise(function(_0x26fbf2,_0x4117fa){return client[_0xc6c1('0xb')](_0x1aa1b2,_0xbbecc7)[_0xc6c1('0xc')](function(_0x550fb4){logger[_0xc6c1('0xd')](_0xc6c1('0xe'),_0x2c8d79,'request\x20sent');logger[_0xc6c1('0xf')](_0xc6c1('0x10'),_0x2c8d79,_0xc6c1('0x11'),JSON[_0xc6c1('0x12')](_0x550fb4));if(_0x550fb4[_0xc6c1('0x13')]){if(_0x550fb4[_0xc6c1('0x13')][_0xc6c1('0x14')]===0x1f4){logger[_0xc6c1('0x13')](_0xc6c1('0xe'),_0x2c8d79,_0x550fb4[_0xc6c1('0x13')][_0xc6c1('0x15')]);return _0x4117fa(_0x550fb4[_0xc6c1('0x13')][_0xc6c1('0x15')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x2c8d79,_0x550fb4[_0xc6c1('0x13')][_0xc6c1('0x15')]);return _0x26fbf2(_0x550fb4[_0xc6c1('0x13')][_0xc6c1('0x15')]);}else{logger[_0xc6c1('0xd')](_0xc6c1('0xe'),_0x2c8d79,_0xc6c1('0x11'));_0x26fbf2(_0x550fb4[_0xc6c1('0x16')]['message']);}})['catch'](function(_0xb93658){logger[_0xc6c1('0x13')](_0xc6c1('0xe'),_0x2c8d79,_0xb93658);_0x4117fa(_0xb93658);});});}exports[_0xc6c1('0x17')]=function(_0x3f5d75){var _0xa6b3e3=this;return new Promise(function(_0x5e9891,_0x2028d2){return db[_0xc6c1('0x18')][_0xc6c1('0x19')]({'raw':_0x3f5d75['options']?_0x3f5d75[_0xc6c1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3f5d75[_0xc6c1('0x1a')]?_0x3f5d75[_0xc6c1('0x1a')][_0xc6c1('0x1b')]||null:null,'attributes':_0x3f5d75[_0xc6c1('0x1a')]?_0x3f5d75[_0xc6c1('0x1a')][_0xc6c1('0x1c')]||null:null,'limit':_0x3f5d75[_0xc6c1('0x1a')]?_0x3f5d75[_0xc6c1('0x1a')][_0xc6c1('0x1d')]||null:null,'include':_0x3f5d75[_0xc6c1('0x1a')]?_0x3f5d75['options'][_0xc6c1('0x1e')]?_['map'](_0x3f5d75[_0xc6c1('0x1a')]['include'],function(_0x1339fa){return{'model':db[_0x1339fa[_0xc6c1('0x1f')]],'as':_0x1339fa['as'],'attributes':_0x1339fa[_0xc6c1('0x1c')],'include':_0x1339fa[_0xc6c1('0x1e')]?_[_0xc6c1('0x20')](_0x1339fa[_0xc6c1('0x1e')],function(_0x63e521){return{'model':db[_0x63e521[_0xc6c1('0x1f')]],'as':_0x63e521['as'],'attributes':_0x63e521['attributes'],'include':_0x63e521[_0xc6c1('0x1e')]?_[_0xc6c1('0x20')](_0x63e521[_0xc6c1('0x1e')],function(_0x3f2923){return{'model':db[_0x3f2923['model']],'as':_0x3f2923['as'],'attributes':_0x3f2923[_0xc6c1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53438b){logger['info']('GetVoiceCallReport',_0x3f5d75);logger[_0xc6c1('0xf')](_0xc6c1('0x17'),_0x3f5d75,JSON['stringify'](_0x53438b));_0x5e9891(_0x53438b);})[_0xc6c1('0x21')](function(_0x137dd7){logger[_0xc6c1('0x13')]('GetVoiceCallReport',_0x137dd7[_0xc6c1('0x15')],_0x3f5d75);_0x2028d2(_0xa6b3e3[_0xc6c1('0x13')](0x1f4,_0x137dd7[_0xc6c1('0x15')]));});});};exports[_0xc6c1('0x22')]=function(_0x59259a){var _0x5b758b=this;return new Promise(function(_0x184c47,_0x4522c2){return db['VoiceCallReport'][_0xc6c1('0x23')](_0x59259a[_0xc6c1('0x24')],{'raw':_0x59259a[_0xc6c1('0x1a')]?_0x59259a[_0xc6c1('0x1a')][_0xc6c1('0x25')]===undefined?!![]:![]:!![]})[_0xc6c1('0xc')](function(_0x536048){logger[_0xc6c1('0xd')](_0xc6c1('0x22'),_0x59259a);logger[_0xc6c1('0xf')](_0xc6c1('0x22'),_0x59259a,JSON[_0xc6c1('0x12')](_0x536048));_0x184c47(_0x536048);})[_0xc6c1('0x21')](function(_0x4bafc9){logger['error'](_0xc6c1('0x22'),_0x4bafc9[_0xc6c1('0x15')],_0x59259a);_0x4522c2(_0x5b758b[_0xc6c1('0x13')](0x1f4,_0x4bafc9['message']));});});};exports[_0xc6c1('0x26')]=function(_0x1b0b52){var _0x2b634d=this;return new Promise(function(_0xe8e2f4,_0x1f64ca){return db[_0xc6c1('0x18')][_0xc6c1('0x27')](_0x1b0b52[_0xc6c1('0x24')],{'raw':_0x1b0b52[_0xc6c1('0x1a')]?_0x1b0b52[_0xc6c1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b0b52['options']?_0x1b0b52['options'][_0xc6c1('0x1b')]||null:null,'attributes':_0x1b0b52['options']?_0x1b0b52[_0xc6c1('0x1a')][_0xc6c1('0x1c')]||null:null,'limit':_0x1b0b52[_0xc6c1('0x1a')]?_0x1b0b52[_0xc6c1('0x1a')][_0xc6c1('0x1d')]||null:null})[_0xc6c1('0xc')](function(_0x11eb4c){logger[_0xc6c1('0xd')](_0xc6c1('0x26'),_0x1b0b52);logger[_0xc6c1('0xf')](_0xc6c1('0x26'),_0x1b0b52,JSON['stringify'](_0x11eb4c));_0xe8e2f4(_0x11eb4c);})[_0xc6c1('0x21')](function(_0x69d51){logger['error'](_0xc6c1('0x26'),_0x69d51[_0xc6c1('0x15')],_0x1b0b52);_0x1f64ca(_0x2b634d[_0xc6c1('0x13')](0x1f4,_0x69d51[_0xc6c1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 442772d..c79cb06 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 _0x3e40=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x3e40,0x95));var _0x03e4=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3e40[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x03e4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03e4('0x1'));var express=require(_0x03e4('0x2'));var router=express[_0x03e4('0x3')]();var fs_extra=require(_0x03e4('0x4'));var auth=require(_0x03e4('0x5'));var interaction=require(_0x03e4('0x6'));var config=require('../../config/environment');var controller=require(_0x03e4('0x7'));router[_0x03e4('0x8')]('/',auth[_0x03e4('0x9')](),controller[_0x03e4('0xa')]);router[_0x03e4('0x8')]('/:id',auth[_0x03e4('0x9')](),controller[_0x03e4('0xb')]);router[_0x03e4('0xc')]('/',auth[_0x03e4('0x9')](),controller['create']);router[_0x03e4('0xd')](_0x03e4('0xe'),auth[_0x03e4('0x9')](),controller[_0x03e4('0xf')]);router[_0x03e4('0x10')](_0x03e4('0xe'),auth['isAuthenticated'](),controller[_0x03e4('0x11')]);module[_0x03e4('0x12')]=router; \ No newline at end of file +var _0x4e35=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','post','create','put'];(function(_0x49e747,_0x15c626){var _0x5daf65=function(_0x5576a0){while(--_0x5576a0){_0x49e747['push'](_0x49e747['shift']());}};_0x5daf65(++_0x15c626);}(_0x4e35,0x159));var _0x54e3=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x4e35[_0x1a87b3];return _0x37e84d;};'use strict';var multer=require('multer');var util=require(_0x54e3('0x0'));var path=require(_0x54e3('0x1'));var timeout=require(_0x54e3('0x2'));var express=require(_0x54e3('0x3'));var router=express[_0x54e3('0x4')]();var fs_extra=require(_0x54e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x54e3('0x6'));var config=require(_0x54e3('0x7'));var controller=require(_0x54e3('0x8'));router[_0x54e3('0x9')]('/',auth[_0x54e3('0xa')](),controller[_0x54e3('0xb')]);router['get']('/:id',auth[_0x54e3('0xa')](),controller['show']);router[_0x54e3('0xc')]('/',auth[_0x54e3('0xa')](),controller[_0x54e3('0xd')]);router[_0x54e3('0xe')](_0x54e3('0xf'),auth[_0x54e3('0xa')](),controller[_0x54e3('0x10')]);router[_0x54e3('0x11')](_0x54e3('0xf'),auth['isAuthenticated'](),controller[_0x54e3('0x12')]);module[_0x54e3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4b2e2fe..7a72e2e 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 _0xce0a=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x35b865,_0x4737f8){var _0x32538b=function(_0x3ee66e){while(--_0x3ee66e){_0x35b865['push'](_0x35b865['shift']());}};_0x32538b(++_0x4737f8);}(_0xce0a,0x1dd));var _0xace0=function(_0x549fb4,_0x57140c){_0x549fb4=_0x549fb4-0x0;var _0xc64c37=_0xce0a[_0x549fb4];return _0xc64c37;};'use strict';var Sequelize=require(_0xace0('0x0'));module[_0xace0('0x1')]={'name':{'type':Sequelize[_0xace0('0x2')]},'prefix':{'type':Sequelize[_0xace0('0x2')],'unique':_0xace0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xace0('0x2')],'set':function(_0xcefc03){this[_0xace0('0x4')](_0xace0('0x5'),_0xcefc03?_0xcefc03[_0xace0('0x6')](''):[]);},'get':function(){return this[_0xace0('0x7')]('options')?this[_0xace0('0x7')](_0xace0('0x5'))[_0xace0('0x8')](''):[];}},'auth':{'type':Sequelize[_0xace0('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xace0('0x2')]},'description':{'type':Sequelize[_0xace0('0x2')]}}; \ No newline at end of file +var _0x0657=['getDataValue','options','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x489996,_0x1351ad){var _0x534a9b=function(_0x3a84f2){while(--_0x3a84f2){_0x489996['push'](_0x489996['shift']());}};_0x534a9b(++_0x1351ad);}(_0x0657,0xec));var _0x7065=function(_0x13c459,_0xa04a00){_0x13c459=_0x13c459-0x0;var _0x13902f=_0x0657[_0x13c459];return _0x13902f;};'use strict';var Sequelize=require('sequelize');module[_0x7065('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7065('0x1')],'unique':_0x7065('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x7065('0x1')],'set':function(_0x14bf80){this[_0x7065('0x3')]('options',_0x14bf80?_0x14bf80['join'](''):[]);},'get':function(){return this[_0x7065('0x4')]('options')?this[_0x7065('0x4')](_0x7065('0x5'))[_0x7065('0x6')](''):[];}},'auth':{'type':Sequelize[_0x7065('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x7065('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2efa87d..efb6763 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 _0xd71d=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','ChanSpies','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x3c8593,_0x2a9579){var _0x106229=function(_0x2c1960){while(--_0x2c1960){_0x3c8593['push'](_0x3c8593['shift']());}};_0x106229(++_0x2a9579);}(_0xd71d,0x1a5));var _0xdd71=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0xd71d[_0x2dbcef];return _0x5a90ea;};'use strict';var emlformat=require(_0xdd71('0x0'));var rimraf=require(_0xdd71('0x1'));var zipdir=require(_0xdd71('0x2'));var jsonpatch=require(_0xdd71('0x3'));var rp=require(_0xdd71('0x4'));var moment=require('moment');var BPromise=require(_0xdd71('0x5'));var Mustache=require(_0xdd71('0x6'));var util=require(_0xdd71('0x7'));var path=require('path');var sox=require(_0xdd71('0x8'));var csv=require(_0xdd71('0x9'));var ejs=require(_0xdd71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd71('0xb'));var squel=require(_0xdd71('0xc'));var crypto=require(_0xdd71('0xd'));var jsforce=require(_0xdd71('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdd71('0x9'));var querystring=require(_0xdd71('0xf'));var Papa=require(_0xdd71('0x10'));var Redis=require(_0xdd71('0x11'));var authService=require(_0xdd71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd71('0x13'));var hardwareService=require(_0xdd71('0x14'));var logger=require(_0xdd71('0x15'))(_0xdd71('0x16'));var utils=require('../../config/utils');var config=require(_0xdd71('0x17'));var licenseUtil=require(_0xdd71('0x18'));var db=require(_0xdd71('0x19'))['db'];function respondWithStatusCode(_0x29f12a,_0x21ebd3){_0x21ebd3=_0x21ebd3||0xcc;return function(_0x2e5393){if(_0x2e5393){return _0x29f12a['sendStatus'](_0x21ebd3);}return _0x29f12a[_0xdd71('0x1a')](_0x21ebd3)[_0xdd71('0x1b')]();};}function respondWithResult(_0x36a531,_0x3ede09){_0x3ede09=_0x3ede09||0xc8;return function(_0x4b1f2d){if(_0x4b1f2d){return _0x36a531[_0xdd71('0x1a')](_0x3ede09)[_0xdd71('0x1c')](_0x4b1f2d);}};}function respondWithFilteredResult(_0x654fda,_0x364dc9){return function(_0x27c527){if(_0x27c527){var _0x42b476=typeof _0x364dc9[_0xdd71('0x1d')]===_0xdd71('0x1e')&&typeof _0x364dc9[_0xdd71('0x1f')]===_0xdd71('0x1e');var _0x11accc=_0x27c527['count'];var _0x4c3601=_0x42b476?0x0:_0x364dc9[_0xdd71('0x1d')];var _0x689edf=_0x42b476?_0x27c527[_0xdd71('0x20')]:_0x364dc9[_0xdd71('0x1d')]+_0x364dc9[_0xdd71('0x1f')];var _0x3b4c67;if(_0x689edf>=_0x11accc){_0x689edf=_0x11accc;_0x3b4c67=0xc8;}else{_0x3b4c67=0xce;}_0x654fda['status'](_0x3b4c67);return _0x654fda[_0xdd71('0x21')](_0xdd71('0x22'),_0x4c3601+'-'+_0x689edf+'/'+_0x11accc)[_0xdd71('0x1c')](_0x27c527);}return null;};}function patchUpdates(_0x3635fc){return function(_0x3905d8){try{jsonpatch[_0xdd71('0x23')](_0x3905d8,_0x3635fc,!![]);}catch(_0x928bb8){return BPromise[_0xdd71('0x24')](_0x928bb8);}return _0x3905d8[_0xdd71('0x25')]();};}function saveUpdates(_0x3e1faa,_0x13f10e){return function(_0x5a9960){if(_0x5a9960){return _0x5a9960['update'](_0x3e1faa)[_0xdd71('0x26')](function(_0x10d988){return _0x10d988;});}return null;};}function removeEntity(_0x50ba0a,_0x10ebb0){return function(_0x52d386){if(_0x52d386){return _0x52d386[_0xdd71('0x27')]()['then'](function(){var _0x4a5690=_0x52d386['get']({'plain':!![]});var _0x4ae9b3=_0xdd71('0x28');return db['UserProfileResource'][_0xdd71('0x27')]({'where':{'type':_0x4ae9b3,'resourceId':_0x4a5690['id']}})[_0xdd71('0x26')](function(){return _0x52d386;});})[_0xdd71('0x26')](function(){_0x50ba0a[_0xdd71('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b094,_0x3e96cd){return function(_0x30acf0){if(!_0x30acf0){_0x56b094[_0xdd71('0x29')](0x194);}return _0x30acf0;};}function handleError(_0x5a240e,_0x4432af){_0x4432af=_0x4432af||0x1f4;return function(_0x3a57fc){logger[_0xdd71('0x2a')](_0x3a57fc['stack']);if(_0x3a57fc[_0xdd71('0x2b')]){delete _0x3a57fc['name'];}_0x5a240e['status'](_0x4432af)[_0xdd71('0x2c')](_0x3a57fc);};}exports[_0xdd71('0x2d')]=function(_0xd0a207,_0x31cb89){var _0x1dd303={},_0x10da75={},_0x39ef2e={'count':0x0,'rows':[]};var _0x2b6b07=_[_0xdd71('0x2e')](db['VoiceChanSpy'][_0xdd71('0x2f')],function(_0x2f3b51){return{'name':_0x2f3b51[_0xdd71('0x30')],'type':_0x2f3b51[_0xdd71('0x31')]['key']};});_0x10da75[_0xdd71('0x32')]=_['map'](_0x2b6b07,'name');_0x10da75[_0xdd71('0x33')]=_[_0xdd71('0x34')](_0xd0a207[_0xdd71('0x33')]);_0x10da75['filters']=_[_0xdd71('0x35')](_0x10da75['model'],_0x10da75[_0xdd71('0x33')]);_0x1dd303['attributes']=_['intersection'](_0x10da75[_0xdd71('0x32')],qs[_0xdd71('0x36')](_0xd0a207[_0xdd71('0x33')]['fields']));_0x1dd303['attributes']=_0x1dd303[_0xdd71('0x37')]['length']?_0x1dd303['attributes']:_0x10da75[_0xdd71('0x32')];if(!_0xd0a207['query']['hasOwnProperty'](_0xdd71('0x38'))){_0x1dd303[_0xdd71('0x1f')]=qs[_0xdd71('0x1f')](_0xd0a207[_0xdd71('0x33')][_0xdd71('0x1f')]);_0x1dd303[_0xdd71('0x1d')]=qs[_0xdd71('0x1d')](_0xd0a207[_0xdd71('0x33')][_0xdd71('0x1d')]);}_0x1dd303[_0xdd71('0x39')]=qs[_0xdd71('0x3a')](_0xd0a207[_0xdd71('0x33')][_0xdd71('0x3a')]);_0x1dd303[_0xdd71('0x3b')]=qs[_0xdd71('0x3c')](_[_0xdd71('0x3d')](_0xd0a207[_0xdd71('0x33')],_0x10da75['filters']),_0x2b6b07);if(_0xd0a207['query'][_0xdd71('0x3e')]){_0x1dd303[_0xdd71('0x3b')]=_[_0xdd71('0x3f')](_0x1dd303['where'],{'$or':_['map'](_0x2b6b07,function(_0x17d338){if(_0x17d338[_0xdd71('0x31')]!==_0xdd71('0x40')){var _0x5a0a6a={};_0x5a0a6a[_0x17d338['name']]={'$like':'%'+_0xd0a207[_0xdd71('0x33')]['filter']+'%'};return _0x5a0a6a;}})});}_0x1dd303=_[_0xdd71('0x3f')]({},_0x1dd303,_0xd0a207[_0xdd71('0x41')]);var _0x3af2a3={'where':_0x1dd303['where']};return db[_0xdd71('0x42')][_0xdd71('0x20')](_0x3af2a3)[_0xdd71('0x26')](function(_0x245dd5){_0x39ef2e[_0xdd71('0x20')]=_0x245dd5;if(_0xd0a207[_0xdd71('0x33')][_0xdd71('0x43')]){_0x1dd303[_0xdd71('0x44')]=[{'all':!![]}];}return db[_0xdd71('0x42')][_0xdd71('0x45')](_0x1dd303);})['then'](function(_0x3c554d){_0x39ef2e[_0xdd71('0x46')]=_0x3c554d;return _0x39ef2e;})[_0xdd71('0x26')](respondWithFilteredResult(_0x31cb89,_0x1dd303))[_0xdd71('0x47')](handleError(_0x31cb89,null));};exports[_0xdd71('0x48')]=function(_0x418d52,_0x2fc517){var _0x2db9fe={'raw':![],'where':{'id':_0x418d52[_0xdd71('0x49')]['id']}},_0x204ff5={};_0x204ff5[_0xdd71('0x32')]=_[_0xdd71('0x34')](db[_0xdd71('0x42')][_0xdd71('0x2f')]);_0x204ff5[_0xdd71('0x33')]=_[_0xdd71('0x34')](_0x418d52[_0xdd71('0x33')]);_0x204ff5[_0xdd71('0x3c')]=_[_0xdd71('0x35')](_0x204ff5[_0xdd71('0x32')],_0x204ff5[_0xdd71('0x33')]);_0x2db9fe['attributes']=_['intersection'](_0x204ff5[_0xdd71('0x32')],qs[_0xdd71('0x36')](_0x418d52[_0xdd71('0x33')][_0xdd71('0x36')]));_0x2db9fe[_0xdd71('0x37')]=_0x2db9fe[_0xdd71('0x37')][_0xdd71('0x4a')]?_0x2db9fe[_0xdd71('0x37')]:_0x204ff5['model'];if(_0x418d52['query'][_0xdd71('0x43')]){_0x2db9fe[_0xdd71('0x44')]=[{'all':!![]}];}_0x2db9fe=_[_0xdd71('0x3f')]({},_0x2db9fe,_0x418d52[_0xdd71('0x41')]);return db[_0xdd71('0x42')][_0xdd71('0x4b')](_0x2db9fe)['then'](handleEntityNotFound(_0x2fc517,null))[_0xdd71('0x26')](respondWithResult(_0x2fc517,null))[_0xdd71('0x47')](handleError(_0x2fc517,null));};exports[_0xdd71('0x4c')]=function(_0x55aa7d,_0x2bec2c){return db[_0xdd71('0x42')][_0xdd71('0x4c')](_0x55aa7d[_0xdd71('0x4d')],{})[_0xdd71('0x26')](function(_0x3b8895){var _0x5a20d1=_0x55aa7d[_0xdd71('0x4e')][_0xdd71('0x4f')]({'plain':!![]});if(!_0x5a20d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a20d1[_0xdd71('0x50')]===_0xdd71('0x4e')){var _0x2eeb82=_0x3b8895[_0xdd71('0x4f')]({'plain':!![]});var _0x4227d7=_0xdd71('0x28');return db[_0xdd71('0x51')][_0xdd71('0x4b')]({'where':{'name':_0x4227d7,'userProfileId':_0x5a20d1[_0xdd71('0x52')]},'raw':!![]})[_0xdd71('0x26')](function(_0x18f2bc){if(_0x18f2bc&&_0x18f2bc[_0xdd71('0x53')]===0x0){return db['UserProfileResource'][_0xdd71('0x4c')]({'name':_0x2eeb82['name'],'resourceId':_0x2eeb82['id'],'type':_0x18f2bc[_0xdd71('0x2b')],'sectionId':_0x18f2bc['id']},{})['then'](function(){return _0x3b8895;});}else{return _0x3b8895;}})[_0xdd71('0x47')](function(_0x59f4c4){logger['error'](_0xdd71('0x54'),_0x59f4c4);throw _0x59f4c4;});}return _0x3b8895;})[_0xdd71('0x26')](respondWithResult(_0x2bec2c,0xc9))[_0xdd71('0x47')](handleError(_0x2bec2c,null));};exports[_0xdd71('0x55')]=function(_0x58c846,_0xcfdd9){if(_0x58c846[_0xdd71('0x4d')]['id']){delete _0x58c846[_0xdd71('0x4d')]['id'];}return db[_0xdd71('0x42')][_0xdd71('0x4b')]({'where':{'id':_0x58c846[_0xdd71('0x49')]['id']}})['then'](handleEntityNotFound(_0xcfdd9,null))[_0xdd71('0x26')](saveUpdates(_0x58c846[_0xdd71('0x4d')],null))[_0xdd71('0x26')](respondWithResult(_0xcfdd9,null))[_0xdd71('0x47')](handleError(_0xcfdd9,null));};exports[_0xdd71('0x27')]=function(_0x1b32f2,_0x2b3e9a){return db['VoiceChanSpy'][_0xdd71('0x4b')]({'where':{'id':_0x1b32f2[_0xdd71('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b3e9a,null))[_0xdd71('0x26')](removeEntity(_0x2b3e9a,null))[_0xdd71('0x47')](handleError(_0x2b3e9a,null));}; \ No newline at end of file +var _0x5d31=['where','includeAll','include','findAll','rows','catch','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','UserProfileResource','create','body','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','error','name','send','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x33056f,_0x256f2d){var _0x134b7e=function(_0x2757eb){while(--_0x2757eb){_0x33056f['push'](_0x33056f['shift']());}};_0x134b7e(++_0x256f2d);}(_0x5d31,0xf7));var _0x15d3=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0x5d31[_0x51b362];return _0x18bd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219867,_0x1397d8){_0x1397d8=_0x1397d8||0xcc;return function(_0x2811b5){if(_0x2811b5){return _0x219867[_0x15d3('0x15')](_0x1397d8);}return _0x219867[_0x15d3('0x16')](_0x1397d8)[_0x15d3('0x17')]();};}function respondWithResult(_0x24eb07,_0x1658cf){_0x1658cf=_0x1658cf||0xc8;return function(_0x44b5a4){if(_0x44b5a4){return _0x24eb07[_0x15d3('0x16')](_0x1658cf)[_0x15d3('0x18')](_0x44b5a4);}};}function respondWithFilteredResult(_0x4af3a7,_0x304a13){return function(_0x17401b){if(_0x17401b){var _0x5bbfef=typeof _0x304a13[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x304a13[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x1b7b3f=_0x17401b[_0x15d3('0x1c')];var _0x46f9ce=_0x5bbfef?0x0:_0x304a13[_0x15d3('0x19')];var _0x46e18b=_0x5bbfef?_0x17401b[_0x15d3('0x1c')]:_0x304a13[_0x15d3('0x19')]+_0x304a13['limit'];var _0x41c358;if(_0x46e18b>=_0x1b7b3f){_0x46e18b=_0x1b7b3f;_0x41c358=0xc8;}else{_0x41c358=0xce;}_0x4af3a7[_0x15d3('0x16')](_0x41c358);return _0x4af3a7['set']('Content-Range',_0x46f9ce+'-'+_0x46e18b+'/'+_0x1b7b3f)['json'](_0x17401b);}return null;};}function patchUpdates(_0x4ebc97){return function(_0x39bb05){try{jsonpatch[_0x15d3('0x1d')](_0x39bb05,_0x4ebc97,!![]);}catch(_0x40a327){return BPromise[_0x15d3('0x1e')](_0x40a327);}return _0x39bb05[_0x15d3('0x1f')]();};}function saveUpdates(_0x2fa13c,_0x4da198){return function(_0x49eb89){if(_0x49eb89){return _0x49eb89[_0x15d3('0x20')](_0x2fa13c)[_0x15d3('0x21')](function(_0x444075){return _0x444075;});}return null;};}function removeEntity(_0x72852f,_0x5b06cc){return function(_0x232078){if(_0x232078){return _0x232078[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){var _0x539626=_0x232078[_0x15d3('0x23')]({'plain':!![]});var _0x240cf4='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x240cf4,'resourceId':_0x539626['id']}})[_0x15d3('0x21')](function(){return _0x232078;});})[_0x15d3('0x21')](function(){_0x72852f[_0x15d3('0x16')](0xcc)[_0x15d3('0x17')]();});}};}function handleEntityNotFound(_0x26ec4b,_0x24bf3c){return function(_0x247fab){if(!_0x247fab){_0x26ec4b[_0x15d3('0x15')](0x194);}return _0x247fab;};}function handleError(_0x3b1ba4,_0x49b865){_0x49b865=_0x49b865||0x1f4;return function(_0x5f445a){logger[_0x15d3('0x24')](_0x5f445a['stack']);if(_0x5f445a[_0x15d3('0x25')]){delete _0x5f445a['name'];}_0x3b1ba4[_0x15d3('0x16')](_0x49b865)[_0x15d3('0x26')](_0x5f445a);};}exports['index']=function(_0x424756,_0x29a947){var _0x477624={},_0x61822={},_0x246874={'count':0x0,'rows':[]};var _0x14491b=_[_0x15d3('0x27')](db[_0x15d3('0x28')][_0x15d3('0x29')],function(_0x18452c){return{'name':_0x18452c['fieldName'],'type':_0x18452c[_0x15d3('0x2a')][_0x15d3('0x2b')]};});_0x61822[_0x15d3('0x2c')]=_[_0x15d3('0x27')](_0x14491b,_0x15d3('0x25'));_0x61822[_0x15d3('0x2d')]=_[_0x15d3('0x2e')](_0x424756[_0x15d3('0x2d')]);_0x61822['filters']=_[_0x15d3('0x2f')](_0x61822['model'],_0x61822[_0x15d3('0x2d')]);_0x477624[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x61822[_0x15d3('0x2c')],qs[_0x15d3('0x31')](_0x424756[_0x15d3('0x2d')][_0x15d3('0x31')]));_0x477624[_0x15d3('0x30')]=_0x477624[_0x15d3('0x30')][_0x15d3('0x32')]?_0x477624[_0x15d3('0x30')]:_0x61822[_0x15d3('0x2c')];if(!_0x424756[_0x15d3('0x2d')][_0x15d3('0x33')](_0x15d3('0x34'))){_0x477624['limit']=qs[_0x15d3('0x1b')](_0x424756[_0x15d3('0x2d')]['limit']);_0x477624[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x424756[_0x15d3('0x2d')]['offset']);}_0x477624[_0x15d3('0x35')]=qs['sort'](_0x424756[_0x15d3('0x2d')][_0x15d3('0x36')]);_0x477624['where']=qs[_0x15d3('0x37')](_[_0x15d3('0x38')](_0x424756[_0x15d3('0x2d')],_0x61822[_0x15d3('0x37')]),_0x14491b);if(_0x424756[_0x15d3('0x2d')][_0x15d3('0x39')]){_0x477624['where']=_[_0x15d3('0x3a')](_0x477624['where'],{'$or':_[_0x15d3('0x27')](_0x14491b,function(_0x21c799){if(_0x21c799[_0x15d3('0x2a')]!==_0x15d3('0x3b')){var _0x204676={};_0x204676[_0x21c799[_0x15d3('0x25')]]={'$like':'%'+_0x424756[_0x15d3('0x2d')][_0x15d3('0x39')]+'%'};return _0x204676;}})});}_0x477624=_[_0x15d3('0x3a')]({},_0x477624,_0x424756[_0x15d3('0x3c')]);var _0x5a18b6={'where':_0x477624[_0x15d3('0x3d')]};return db[_0x15d3('0x28')]['count'](_0x5a18b6)['then'](function(_0x108254){_0x246874[_0x15d3('0x1c')]=_0x108254;if(_0x424756[_0x15d3('0x2d')][_0x15d3('0x3e')]){_0x477624[_0x15d3('0x3f')]=[{'all':!![]}];}return db[_0x15d3('0x28')][_0x15d3('0x40')](_0x477624);})[_0x15d3('0x21')](function(_0x25fa1d){_0x246874[_0x15d3('0x41')]=_0x25fa1d;return _0x246874;})['then'](respondWithFilteredResult(_0x29a947,_0x477624))[_0x15d3('0x42')](handleError(_0x29a947,null));};exports[_0x15d3('0x43')]=function(_0x534928,_0x1581dc){var _0x5c9829={'raw':![],'where':{'id':_0x534928[_0x15d3('0x44')]['id']}},_0x4d7f72={};_0x4d7f72[_0x15d3('0x2c')]=_[_0x15d3('0x2e')](db['VoiceChanSpy'][_0x15d3('0x29')]);_0x4d7f72['query']=_[_0x15d3('0x2e')](_0x534928[_0x15d3('0x2d')]);_0x4d7f72[_0x15d3('0x37')]=_[_0x15d3('0x2f')](_0x4d7f72[_0x15d3('0x2c')],_0x4d7f72['query']);_0x5c9829['attributes']=_['intersection'](_0x4d7f72[_0x15d3('0x2c')],qs['fields'](_0x534928[_0x15d3('0x2d')][_0x15d3('0x31')]));_0x5c9829[_0x15d3('0x30')]=_0x5c9829['attributes'][_0x15d3('0x32')]?_0x5c9829[_0x15d3('0x30')]:_0x4d7f72[_0x15d3('0x2c')];if(_0x534928[_0x15d3('0x2d')][_0x15d3('0x3e')]){_0x5c9829[_0x15d3('0x3f')]=[{'all':!![]}];}_0x5c9829=_[_0x15d3('0x3a')]({},_0x5c9829,_0x534928[_0x15d3('0x3c')]);return db[_0x15d3('0x28')][_0x15d3('0x45')](_0x5c9829)[_0x15d3('0x21')](handleEntityNotFound(_0x1581dc,null))[_0x15d3('0x21')](respondWithResult(_0x1581dc,null))['catch'](handleError(_0x1581dc,null));};exports['create']=function(_0x264487,_0x446929){return db[_0x15d3('0x28')]['create'](_0x264487['body'],{})[_0x15d3('0x21')](function(_0x4a825d){var _0x454ad3=_0x264487['user'][_0x15d3('0x23')]({'plain':!![]});if(!_0x454ad3)throw new Error(_0x15d3('0x46'));if(_0x454ad3['role']==='user'){var _0x480c9d=_0x4a825d['get']({'plain':!![]});var _0x5547ab=_0x15d3('0x47');return db[_0x15d3('0x48')]['find']({'where':{'name':_0x5547ab,'userProfileId':_0x454ad3[_0x15d3('0x49')]},'raw':!![]})[_0x15d3('0x21')](function(_0x323717){if(_0x323717&&_0x323717['autoAssociation']===0x0){return db[_0x15d3('0x4a')][_0x15d3('0x4b')]({'name':_0x480c9d[_0x15d3('0x25')],'resourceId':_0x480c9d['id'],'type':_0x323717[_0x15d3('0x25')],'sectionId':_0x323717['id']},{})[_0x15d3('0x21')](function(){return _0x4a825d;});}else{return _0x4a825d;}})[_0x15d3('0x42')](function(_0x5f0a42){logger[_0x15d3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f0a42);throw _0x5f0a42;});}return _0x4a825d;})['then'](respondWithResult(_0x446929,0xc9))[_0x15d3('0x42')](handleError(_0x446929,null));};exports['update']=function(_0x16e6bc,_0x54599a){if(_0x16e6bc[_0x15d3('0x4c')]['id']){delete _0x16e6bc[_0x15d3('0x4c')]['id'];}return db[_0x15d3('0x28')][_0x15d3('0x45')]({'where':{'id':_0x16e6bc[_0x15d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x54599a,null))['then'](saveUpdates(_0x16e6bc[_0x15d3('0x4c')],null))['then'](respondWithResult(_0x54599a,null))[_0x15d3('0x42')](handleError(_0x54599a,null));};exports[_0x15d3('0x22')]=function(_0x3cccc5,_0x23f439){return db[_0x15d3('0x28')][_0x15d3('0x45')]({'where':{'id':_0x3cccc5[_0x15d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x23f439,null))[_0x15d3('0x21')](removeEntity(_0x23f439,null))[_0x15d3('0x42')](handleError(_0x23f439,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7cd85e3..3b441d8 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 _0xcccb=['bulkCreate','catch','lodash','util','./voiceChanSpy.attributes','%s%s','prefix','system','push','merge','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','password','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcccb,0x8e));var _0xbccc=function(_0x242510,_0x5ab393){_0x242510=_0x242510-0x0;var _0x5006a5=_0xcccb[_0x242510];return _0x5006a5;};'use strict';var _=require(_0xbccc('0x0'));var util=require(_0xbccc('0x1'));var BPromise=require('bluebird');var attributes=require(_0xbccc('0x2'));var getUserApplications=function(_0x508d58,_0x333e23,_0x5be78a){var _0x2bbfb4=0x1;var _0x33da66=[];var _0x42d6ca={'context':_0x333e23['context']||'from-sip','exten':util['format'](_0xbccc('0x3'),_0x508d58[_0xbccc('0x4')],_0x5be78a),'type':_0xbccc('0x5'),'isApp':![],'ChanSpyId':_0x508d58['id'],'UserId':_0x333e23['id']};_0x33da66[_0xbccc('0x6')](_[_0xbccc('0x7')]({'app':'Set','appdata':util[_0xbccc('0x8')](_0xbccc('0x9'),_0xbccc('0xa')),'priority':_0x2bbfb4++},_0x42d6ca));if(_0x508d58[_0xbccc('0xb')]){_0x33da66[_0xbccc('0x6')](_[_0xbccc('0x7')]({'app':'MixMonitor','appdata':util[_0xbccc('0x8')](_0xbccc('0xc'),_0x508d58[_0xbccc('0xd')]),'priority':_0x2bbfb4++},_0x42d6ca));}if(_0x508d58[_0xbccc('0xe')]){_0x33da66[_0xbccc('0x6')](_[_0xbccc('0x7')]({'app':'Authenticate','appdata':_0x508d58[_0xbccc('0xf')],'priority':_0x2bbfb4++},_0x42d6ca));}_0x33da66[_0xbccc('0x6')](_[_0xbccc('0x7')]({'app':'ChanSpy','appdata':util[_0xbccc('0x8')](_0xbccc('0x10'),_0x333e23['name'],_0x508d58[_0xbccc('0x11')]?_0x508d58[_0xbccc('0x11')]['join'](''):''),'priority':_0x2bbfb4++},_0x42d6ca));if(_0x508d58[_0xbccc('0xb')]){_0x33da66['push'](_[_0xbccc('0x7')]({'app':_0xbccc('0x12'),'priority':_0x2bbfb4++},_0x42d6ca));}return _0x33da66;};var getChanSpyApplications=function(_0x47bbd4,_0x20f1ca){var _0x31c693=[];for(var _0x5a23d1=0x0,_0xe84aa8=0x1;_0x5a23d1<_0x20f1ca[_0xbccc('0x13')];_0x5a23d1++,_0xe84aa8=0x1){_0x31c693=_0x31c693[_0xbccc('0x14')](getUserApplications(_0x47bbd4,_0x20f1ca[_0x5a23d1],_0x20f1ca[_0x5a23d1]['internal']));if(_0x20f1ca[_0x5a23d1][_0xbccc('0x15')]!=_0x20f1ca[_0x5a23d1][_0xbccc('0x16')]){_0x31c693=_0x31c693['concat'](getUserApplications(_0x47bbd4,_0x20f1ca[_0x5a23d1],_0x20f1ca[_0x5a23d1][_0xbccc('0x16')]));}}return _0x31c693;};var getChanSpyPromise=function(_0xbe2303,_0x1258c9){return new BPromise(function(_0x1e7381,_0x44bc3c){return _0xbe2303[_0xbccc('0x17')][_0xbccc('0x18')]({'attributes':['id',_0xbccc('0x16'),'internal'],'where':{'role':_0xbccc('0x19'),'chanspy':!![]},'raw':!![]})[_0xbccc('0x1a')](function(_0xa6f034){if(_0xa6f034){return _0x1e7381(getChanSpyApplications(_0x1258c9,_0xa6f034));}return _0x1e7381([]);})['catch'](function(_0x12d426){_0x44bc3c(_0x12d426);});});};module[_0xbccc('0x1b')]=function(_0x4595dc,_0x30984e){var _0x20f6d6=_0x4595dc[_0xbccc('0x1c')];return _0x4595dc['define'](_0xbccc('0x1d'),attributes,{'tableName':_0xbccc('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b7bd8,_0x116be7,_0x2dbfae){return getChanSpyPromise(_0x20f6d6,_0x2b7bd8)[_0xbccc('0x1a')](function(_0xd91ad9){if(_0xd91ad9&&_0xd91ad9[_0xbccc('0x13')]){return _0x20f6d6[_0xbccc('0x1f')]['bulkCreate'](_0xd91ad9);}})[_0xbccc('0x1a')](function(){_0x2dbfae();})['catch'](function(_0x10ad40){_0x2dbfae(_0x10ad40);});},'afterUpdate':function(_0xddb766,_0x4f4b08,_0x3a5a38){return _0x20f6d6[_0xbccc('0x1f')][_0xbccc('0x20')]({'where':{'ChanSpyId':_0xddb766['id']}})[_0xbccc('0x1a')](function(){return getChanSpyPromise(_0x20f6d6,_0xddb766);})[_0xbccc('0x1a')](function(_0xe94c80){if(_0xe94c80&&_0xe94c80[_0xbccc('0x13')]){return _0x20f6d6[_0xbccc('0x1f')][_0xbccc('0x21')](_0xe94c80);}})[_0xbccc('0x1a')](function(){_0x3a5a38();})[_0xbccc('0x22')](function(_0x2759e7){_0x3a5a38(_0x2759e7);});},'afterDestroy':function(_0x4bef2c,_0x570924,_0x17eddf){return _0x20f6d6[_0xbccc('0x1f')]['destroy']({'where':{'ChanSpyId':_0x4bef2c['id']}})[_0xbccc('0x1a')](function(){_0x17eddf();})['catch'](function(_0x3c8e46){_0x17eddf(_0x3c8e46);});}}});}; \ No newline at end of file +var _0x8f48=['chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','push','merge','format','CDR(type)=%s'];(function(_0x4aa6bd,_0x3da6d0){var _0x4b3ef9=function(_0x3d7136){while(--_0x3d7136){_0x4aa6bd['push'](_0x4aa6bd['shift']());}};_0x4b3ef9(++_0x3da6d0);}(_0x8f48,0x87));var _0x88f4=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x8f48[_0x569caa];return _0x44cb5a;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x88f4('0x0'));var attributes=require(_0x88f4('0x1'));var getUserApplications=function(_0x9a34eb,_0x30cbb0,_0x177f20){var _0x4e922b=0x1;var _0x4f775d=[];var _0x2a3ed6={'context':_0x30cbb0[_0x88f4('0x2')]||_0x88f4('0x3'),'exten':util['format'](_0x88f4('0x4'),_0x9a34eb['prefix'],_0x177f20),'type':'system','isApp':![],'ChanSpyId':_0x9a34eb['id'],'UserId':_0x30cbb0['id']};_0x4f775d[_0x88f4('0x5')](_[_0x88f4('0x6')]({'app':'Set','appdata':util[_0x88f4('0x7')](_0x88f4('0x8'),_0x88f4('0x9')),'priority':_0x4e922b++},_0x2a3ed6));if(_0x9a34eb[_0x88f4('0xa')]){_0x4f775d[_0x88f4('0x5')](_[_0x88f4('0x6')]({'app':_0x88f4('0xb'),'appdata':util[_0x88f4('0x7')](_0x88f4('0xc'),_0x9a34eb[_0x88f4('0xd')]),'priority':_0x4e922b++},_0x2a3ed6));}if(_0x9a34eb[_0x88f4('0xe')]){_0x4f775d[_0x88f4('0x5')](_[_0x88f4('0x6')]({'app':_0x88f4('0xf'),'appdata':_0x9a34eb['password'],'priority':_0x4e922b++},_0x2a3ed6));}_0x4f775d[_0x88f4('0x5')](_['merge']({'app':'ChanSpy','appdata':util[_0x88f4('0x7')](_0x88f4('0x10'),_0x30cbb0[_0x88f4('0x11')],_0x9a34eb['options']?_0x9a34eb[_0x88f4('0x12')][_0x88f4('0x13')](''):''),'priority':_0x4e922b++},_0x2a3ed6));if(_0x9a34eb[_0x88f4('0xa')]){_0x4f775d[_0x88f4('0x5')](_[_0x88f4('0x6')]({'app':_0x88f4('0x14'),'priority':_0x4e922b++},_0x2a3ed6));}return _0x4f775d;};var getChanSpyApplications=function(_0x3a6438,_0x5db7a8){var _0x1a46a9=[];for(var _0x4cc795=0x0,_0xe5e7be=0x1;_0x4cc795<_0x5db7a8[_0x88f4('0x15')];_0x4cc795++,_0xe5e7be=0x1){_0x1a46a9=_0x1a46a9[_0x88f4('0x16')](getUserApplications(_0x3a6438,_0x5db7a8[_0x4cc795],_0x5db7a8[_0x4cc795]['internal']));if(_0x5db7a8[_0x4cc795][_0x88f4('0x17')]!=_0x5db7a8[_0x4cc795][_0x88f4('0x11')]){_0x1a46a9=_0x1a46a9[_0x88f4('0x16')](getUserApplications(_0x3a6438,_0x5db7a8[_0x4cc795],_0x5db7a8[_0x4cc795][_0x88f4('0x11')]));}}return _0x1a46a9;};var getChanSpyPromise=function(_0x54e0af,_0x5aed62){return new BPromise(function(_0x492c8f,_0x2dd756){return _0x54e0af[_0x88f4('0x18')][_0x88f4('0x19')]({'attributes':['id','name',_0x88f4('0x17')],'where':{'role':_0x88f4('0x1a'),'chanspy':!![]},'raw':!![]})[_0x88f4('0x1b')](function(_0x1f501b){if(_0x1f501b){return _0x492c8f(getChanSpyApplications(_0x5aed62,_0x1f501b));}return _0x492c8f([]);})[_0x88f4('0x1c')](function(_0x56259b){_0x2dd756(_0x56259b);});});};module[_0x88f4('0x1d')]=function(_0x85f686,_0x2489e8){var _0x5315ae=_0x85f686[_0x88f4('0x1e')];return _0x85f686[_0x88f4('0x1f')](_0x88f4('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x294baa,_0x56a655,_0x58930f){return getChanSpyPromise(_0x5315ae,_0x294baa)[_0x88f4('0x1b')](function(_0x21506a){if(_0x21506a&&_0x21506a[_0x88f4('0x15')]){return _0x5315ae[_0x88f4('0x21')][_0x88f4('0x22')](_0x21506a);}})[_0x88f4('0x1b')](function(){_0x58930f();})['catch'](function(_0x1f379b){_0x58930f(_0x1f379b);});},'afterUpdate':function(_0x5ac420,_0x3e5d59,_0x3997ec){return _0x5315ae[_0x88f4('0x21')][_0x88f4('0x23')]({'where':{'ChanSpyId':_0x5ac420['id']}})[_0x88f4('0x1b')](function(){return getChanSpyPromise(_0x5315ae,_0x5ac420);})['then'](function(_0xb48547){if(_0xb48547&&_0xb48547['length']){return _0x5315ae[_0x88f4('0x21')]['bulkCreate'](_0xb48547);}})['then'](function(){_0x3997ec();})[_0x88f4('0x1c')](function(_0x380e99){_0x3997ec(_0x380e99);});},'afterDestroy':function(_0x56bb38,_0x38ab53,_0x40a25e){return _0x5315ae[_0x88f4('0x21')][_0x88f4('0x23')]({'where':{'ChanSpyId':_0x56bb38['id']}})[_0x88f4('0x1b')](function(){_0x40a25e();})[_0x88f4('0x1c')](function(_0x5c7f57){_0x40a25e(_0x5c7f57);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b0421e3..809532d 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 _0x1306=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1fbd6d,_0x13d538){var _0x5a1849=function(_0x26d958){while(--_0x26d958){_0x1fbd6d['push'](_0x1fbd6d['shift']());}};_0x5a1849(++_0x13d538);}(_0x1306,0x17a));var _0x6130=function(_0x3ca683,_0xffaf1b){_0x3ca683=_0x3ca683-0x0;var _0x380cd7=_0x1306[_0x3ca683];return _0x380cd7;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});} \ No newline at end of file +var _0x6282=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x176cb2,_0x7e0ee2){var _0x965f73=function(_0x559fd5){while(--_0x559fd5){_0x176cb2['push'](_0x176cb2['shift']());}};_0x965f73(++_0x7e0ee2);}(_0x6282,0x76));var _0x2628=function(_0x254f9d,_0x2a00c0){_0x254f9d=_0x254f9d-0x0;var _0x436dd3=_0x6282[_0x254f9d];return _0x436dd3;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var moment=require(_0x2628('0x2'));var BPromise=require(_0x2628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2628('0x4'))['db'];var utils=require(_0x2628('0x5'));var logger=require('../../config/logger')(_0x2628('0x6'));var config=require(_0x2628('0x7'));var jayson=require(_0x2628('0x8'));var client=jayson[_0x2628('0x9')][_0x2628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50412a,_0xb6b945,_0x144ae8){return new BPromise(function(_0x2170a7,_0xbae7c3){return client[_0x2628('0xb')](_0x50412a,_0x144ae8)[_0x2628('0xc')](function(_0x403569){logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));logger[_0x2628('0x10')](_0x2628('0x11'),_0xb6b945,_0x2628('0xf'),JSON[_0x2628('0x12')](_0x403569));if(_0x403569[_0x2628('0x13')]){if(_0x403569['error']['code']===0x1f4){logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0xbae7c3(_0x403569['error']['message']);}logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0x2170a7(_0x403569[_0x2628('0x13')]['message']);}else{logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));_0x2170a7(_0x403569['result'][_0x2628('0x14')]);}})[_0x2628('0x15')](function(_0x51df16){logger[_0x2628('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0xb6b945,_0x51df16);_0xbae7c3(_0x51df16);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 84bf422..3cf16e2 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 _0xdd96=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer','util','express','Router'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xdd96,0x1ac));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6dd9('0x0'));var util=require(_0x6dd9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6dd9('0x2'));var router=express[_0x6dd9('0x3')]();var fs_extra=require(_0x6dd9('0x4'));var auth=require(_0x6dd9('0x5'));var interaction=require(_0x6dd9('0x6'));var config=require(_0x6dd9('0x7'));var controller=require(_0x6dd9('0x8'));router['get']('/',auth[_0x6dd9('0x9')](),controller['index']);router[_0x6dd9('0xa')](_0x6dd9('0xb'),auth['isAuthenticated'](),controller[_0x6dd9('0xc')]);router[_0x6dd9('0xd')]('/',auth[_0x6dd9('0x9')](),controller[_0x6dd9('0xe')]);router[_0x6dd9('0xf')](_0x6dd9('0xb'),auth[_0x6dd9('0x9')](),controller['update']);router[_0x6dd9('0x10')](_0x6dd9('0xb'),auth['isAuthenticated'](),controller[_0x6dd9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe4cb=['isAuthenticated','index','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get'];(function(_0x185238,_0x3c0fc8){var _0x143ad9=function(_0x1253e8){while(--_0x1253e8){_0x185238['push'](_0x185238['shift']());}};_0x143ad9(++_0x3c0fc8);}(_0xe4cb,0xfa));var _0xbe4c=function(_0x119c62,_0xdcd05e){_0x119c62=_0x119c62-0x0;var _0x2ca12a=_0xe4cb[_0x119c62];return _0x2ca12a;};'use strict';var multer=require(_0xbe4c('0x0'));var util=require(_0xbe4c('0x1'));var path=require('path');var timeout=require(_0xbe4c('0x2'));var express=require(_0xbe4c('0x3'));var router=express[_0xbe4c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbe4c('0x5'));var interaction=require(_0xbe4c('0x6'));var config=require(_0xbe4c('0x7'));var controller=require(_0xbe4c('0x8'));router[_0xbe4c('0x9')]('/',auth[_0xbe4c('0xa')](),controller[_0xbe4c('0xb')]);router[_0xbe4c('0x9')]('/:id',auth[_0xbe4c('0xa')](),controller['show']);router[_0xbe4c('0xc')]('/',auth[_0xbe4c('0xa')](),controller[_0xbe4c('0xd')]);router[_0xbe4c('0xe')]('/:id',auth[_0xbe4c('0xa')](),controller[_0xbe4c('0xf')]);router[_0xbe4c('0x10')](_0xbe4c('0x11'),auth[_0xbe4c('0xa')](),controller[_0xbe4c('0x12')]);module[_0xbe4c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6ecb939..b54a7b7 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 _0xdf8c=['STRING','BOOLEAN','sequelize','name'];(function(_0x208551,_0x4127df){var _0x3b6de5=function(_0x2d677d){while(--_0x2d677d){_0x208551['push'](_0x208551['shift']());}};_0x3b6de5(++_0x4127df);}(_0xdf8c,0x132));var _0xcdf8=function(_0x38e791,_0x572f6d){_0x38e791=_0x38e791-0x0;var _0x308012=_0xdf8c[_0x38e791];return _0x308012;};'use strict';var Sequelize=require(_0xcdf8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcdf8('0x1')},'description':{'type':Sequelize[_0xcdf8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xcdf8('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e32=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x8e32,0x64));var _0x28e3=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x8e32[_0x3cf5a3];return _0x39ba2d;};'use strict';var Sequelize=require(_0x28e3('0x0'));module[_0x28e3('0x1')]={'name':{'type':Sequelize[_0x28e3('0x2')],'unique':_0x28e3('0x3')},'description':{'type':Sequelize[_0x28e3('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x28e3('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 8022422..05a666a 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 _0xd4cc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','sendStatus','stack','name','VoiceContext','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','include','options','create','body','join','root','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','UserProfileResource','find','readFileSync','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x90e3d5,_0x3eea2b){var _0x5c2252=function(_0x3c7a2e){while(--_0x3c7a2e){_0x90e3d5['push'](_0x90e3d5['shift']());}};_0x5c2252(++_0x3eea2b);}(_0xd4cc,0xb7));var _0xcd4c=function(_0x43ab28,_0x2df861){_0x43ab28=_0x43ab28-0x0;var _0x219f8a=_0xd4cc[_0x43ab28];return _0x219f8a;};'use strict';var emlformat=require(_0xcd4c('0x0'));var rimraf=require(_0xcd4c('0x1'));var zipdir=require(_0xcd4c('0x2'));var jsonpatch=require(_0xcd4c('0x3'));var rp=require(_0xcd4c('0x4'));var moment=require(_0xcd4c('0x5'));var BPromise=require(_0xcd4c('0x6'));var Mustache=require(_0xcd4c('0x7'));var util=require(_0xcd4c('0x8'));var path=require(_0xcd4c('0x9'));var sox=require('sox');var csv=require(_0xcd4c('0xa'));var ejs=require(_0xcd4c('0xb'));var fs=require('fs');var fs_extra=require(_0xcd4c('0xc'));var _=require('lodash');var squel=require(_0xcd4c('0xd'));var crypto=require(_0xcd4c('0xe'));var jsforce=require(_0xcd4c('0xf'));var deskjs=require(_0xcd4c('0x10'));var toCsv=require(_0xcd4c('0xa'));var querystring=require(_0xcd4c('0x11'));var Papa=require(_0xcd4c('0x12'));var Redis=require(_0xcd4c('0x13'));var authService=require(_0xcd4c('0x14'));var qs=require(_0xcd4c('0x15'));var as=require(_0xcd4c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcd4c('0x17'));var utils=require(_0xcd4c('0x18'));var config=require(_0xcd4c('0x19'));var licenseUtil=require(_0xcd4c('0x1a'));var db=require(_0xcd4c('0x1b'))['db'];var jayson=require(_0xcd4c('0x1c'));var client=jayson['client'][_0xcd4c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2031e5,_0x45d158,_0x4b22cc,_0x43cdb1){return new BPromise(function(_0x257b2d,_0x20c4be){var _0x1e6eaa=_0x43cdb1||client;return _0x1e6eaa[_0xcd4c('0x1e')](_0x2031e5,_0x4b22cc)[_0xcd4c('0x1f')](function(_0x7ad277){logger[_0xcd4c('0x20')](_0xcd4c('0x21'),_0x45d158,_0xcd4c('0x22'));logger[_0xcd4c('0x23')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x45d158,_0xcd4c('0x22'),JSON[_0xcd4c('0x24')](_0x7ad277));if(_0x7ad277['error']){if(_0x7ad277[_0xcd4c('0x25')]['code']===0x1f4){logger[_0xcd4c('0x25')](_0xcd4c('0x21'),_0x45d158,_0x7ad277[_0xcd4c('0x25')]['message']);return _0x20c4be(_0x7ad277[_0xcd4c('0x25')][_0xcd4c('0x26')]);}logger[_0xcd4c('0x25')]('VoiceContext,\x20%s,\x20%s',_0x45d158,_0x7ad277['error'][_0xcd4c('0x26')]);return _0x257b2d(_0x7ad277[_0xcd4c('0x25')][_0xcd4c('0x26')]);}else{logger[_0xcd4c('0x20')](_0xcd4c('0x21'),_0x45d158,'request\x20sent');_0x257b2d(_0x7ad277['result'][_0xcd4c('0x26')]);}})['catch'](function(_0x164727){logger['error']('VoiceContext,\x20%s,\x20%s',_0x45d158,_0x164727);_0x20c4be(_0x164727);});});}function respondWithStatusCode(_0x560bcb,_0x15a0cb){_0x15a0cb=_0x15a0cb||0xcc;return function(_0x706c72){if(_0x706c72){return _0x560bcb['sendStatus'](_0x15a0cb);}return _0x560bcb[_0xcd4c('0x27')](_0x15a0cb)[_0xcd4c('0x28')]();};}function respondWithResult(_0x56245a,_0x3e1f89){_0x3e1f89=_0x3e1f89||0xc8;return function(_0x456f62){if(_0x456f62){return _0x56245a[_0xcd4c('0x27')](_0x3e1f89)[_0xcd4c('0x29')](_0x456f62);}};}function respondWithFilteredResult(_0x5c4b6e,_0x587b29){return function(_0x20b289){if(_0x20b289){var _0x521816=typeof _0x587b29[_0xcd4c('0x2a')]===_0xcd4c('0x2b')&&typeof _0x587b29[_0xcd4c('0x2c')]===_0xcd4c('0x2b');var _0x1e496e=_0x20b289['count'];var _0x99f578=_0x521816?0x0:_0x587b29[_0xcd4c('0x2a')];var _0x1d5176=_0x521816?_0x20b289[_0xcd4c('0x2d')]:_0x587b29['offset']+_0x587b29[_0xcd4c('0x2c')];var _0x3c8802;if(_0x1d5176>=_0x1e496e){_0x1d5176=_0x1e496e;_0x3c8802=0xc8;}else{_0x3c8802=0xce;}_0x5c4b6e['status'](_0x3c8802);return _0x5c4b6e[_0xcd4c('0x2e')](_0xcd4c('0x2f'),_0x99f578+'-'+_0x1d5176+'/'+_0x1e496e)[_0xcd4c('0x29')](_0x20b289);}return null;};}function patchUpdates(_0x4f0f37){return function(_0x5e5092){try{jsonpatch['apply'](_0x5e5092,_0x4f0f37,!![]);}catch(_0x2be7c0){return BPromise['reject'](_0x2be7c0);}return _0x5e5092['save']();};}function saveUpdates(_0x111710,_0x4d4845){return function(_0x24925e){if(_0x24925e){return _0x24925e[_0xcd4c('0x30')](_0x111710)[_0xcd4c('0x1f')](function(_0x210fec){return _0x210fec;});}return null;};}function removeEntity(_0x4a0eaa,_0x305241){return function(_0x2ebde3){if(_0x2ebde3){return _0x2ebde3[_0xcd4c('0x31')]()[_0xcd4c('0x1f')](function(){var _0x412a62=_0x2ebde3[_0xcd4c('0x32')]({'plain':!![]});var _0x417fd3='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x417fd3,'resourceId':_0x412a62['id']}})[_0xcd4c('0x1f')](function(){return _0x2ebde3;});})[_0xcd4c('0x1f')](function(){_0x4a0eaa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad472,_0x4d00fe){return function(_0x5a5605){if(!_0x5a5605){_0x2ad472[_0xcd4c('0x33')](0x194);}return _0x5a5605;};}function handleError(_0xa3c9ea,_0x5403cd){_0x5403cd=_0x5403cd||0x1f4;return function(_0x5e7bce){logger[_0xcd4c('0x25')](_0x5e7bce[_0xcd4c('0x34')]);if(_0x5e7bce[_0xcd4c('0x35')]){delete _0x5e7bce[_0xcd4c('0x35')];}_0xa3c9ea[_0xcd4c('0x27')](_0x5403cd)['send'](_0x5e7bce);};}exports['index']=function(_0x3c3676,_0x4b35ed){var _0x5cd0f0={},_0x4ef0f={},_0xf7e1d6={'count':0x0,'rows':[]};var _0xf4aa3c=_['map'](db[_0xcd4c('0x36')][_0xcd4c('0x37')],function(_0x44b1ab){return{'name':_0x44b1ab[_0xcd4c('0x38')],'type':_0x44b1ab['type'][_0xcd4c('0x39')]};});_0x4ef0f[_0xcd4c('0x3a')]=_[_0xcd4c('0x3b')](_0xf4aa3c,_0xcd4c('0x35'));_0x4ef0f[_0xcd4c('0x3c')]=_['keys'](_0x3c3676['query']);_0x4ef0f['filters']=_[_0xcd4c('0x3d')](_0x4ef0f['model'],_0x4ef0f[_0xcd4c('0x3c')]);_0x5cd0f0[_0xcd4c('0x3e')]=_['intersection'](_0x4ef0f[_0xcd4c('0x3a')],qs['fields'](_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x3f')]));_0x5cd0f0['attributes']=_0x5cd0f0[_0xcd4c('0x3e')][_0xcd4c('0x40')]?_0x5cd0f0[_0xcd4c('0x3e')]:_0x4ef0f['model'];if(!_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x41')]('nolimit')){_0x5cd0f0[_0xcd4c('0x2c')]=qs[_0xcd4c('0x2c')](_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x2c')]);_0x5cd0f0[_0xcd4c('0x2a')]=qs[_0xcd4c('0x2a')](_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x2a')]);}_0x5cd0f0[_0xcd4c('0x42')]=qs[_0xcd4c('0x43')](_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x43')]);_0x5cd0f0['where']=qs[_0xcd4c('0x44')](_[_0xcd4c('0x45')](_0x3c3676[_0xcd4c('0x3c')],_0x4ef0f[_0xcd4c('0x44')]),_0xf4aa3c);if(_0x3c3676[_0xcd4c('0x3c')]['filter']){_0x5cd0f0[_0xcd4c('0x46')]=_[_0xcd4c('0x47')](_0x5cd0f0['where'],{'$or':_['map'](_0xf4aa3c,function(_0x55e866){if(_0x55e866['type']!==_0xcd4c('0x48')){var _0x2423dd={};_0x2423dd[_0x55e866[_0xcd4c('0x35')]]={'$like':'%'+_0x3c3676[_0xcd4c('0x3c')][_0xcd4c('0x49')]+'%'};return _0x2423dd;}})});}_0x5cd0f0=_[_0xcd4c('0x47')]({},_0x5cd0f0,_0x3c3676['options']);var _0x3e203f={'where':_0x5cd0f0[_0xcd4c('0x46')]};return db[_0xcd4c('0x36')][_0xcd4c('0x2d')](_0x3e203f)[_0xcd4c('0x1f')](function(_0x2ccdfa){_0xf7e1d6[_0xcd4c('0x2d')]=_0x2ccdfa;if(_0x3c3676['query'][_0xcd4c('0x4a')]){_0x5cd0f0['include']=[{'all':!![]}];}return db[_0xcd4c('0x36')][_0xcd4c('0x4b')](_0x5cd0f0);})[_0xcd4c('0x1f')](function(_0x2a3555){_0xf7e1d6[_0xcd4c('0x4c')]=_0x2a3555;return _0xf7e1d6;})[_0xcd4c('0x1f')](respondWithFilteredResult(_0x4b35ed,_0x5cd0f0))[_0xcd4c('0x4d')](handleError(_0x4b35ed,null));};exports[_0xcd4c('0x4e')]=function(_0x3734ab,_0x1dc01c){var _0x2ce66a={'raw':![],'where':{'id':_0x3734ab[_0xcd4c('0x4f')]['id']}},_0x5bbd03={};_0x5bbd03[_0xcd4c('0x3a')]=_[_0xcd4c('0x50')](db[_0xcd4c('0x36')][_0xcd4c('0x37')]);_0x5bbd03[_0xcd4c('0x3c')]=_['keys'](_0x3734ab[_0xcd4c('0x3c')]);_0x5bbd03['filters']=_['intersection'](_0x5bbd03['model'],_0x5bbd03[_0xcd4c('0x3c')]);_0x2ce66a[_0xcd4c('0x3e')]=_[_0xcd4c('0x3d')](_0x5bbd03['model'],qs[_0xcd4c('0x3f')](_0x3734ab[_0xcd4c('0x3c')][_0xcd4c('0x3f')]));_0x2ce66a[_0xcd4c('0x3e')]=_0x2ce66a[_0xcd4c('0x3e')][_0xcd4c('0x40')]?_0x2ce66a[_0xcd4c('0x3e')]:_0x5bbd03['model'];if(_0x3734ab[_0xcd4c('0x3c')]['includeAll']){_0x2ce66a[_0xcd4c('0x51')]=[{'all':!![]}];}_0x2ce66a=_[_0xcd4c('0x47')]({},_0x2ce66a,_0x3734ab[_0xcd4c('0x52')]);return db[_0xcd4c('0x36')]['find'](_0x2ce66a)[_0xcd4c('0x1f')](handleEntityNotFound(_0x1dc01c,null))['then'](respondWithResult(_0x1dc01c,null))['catch'](handleError(_0x1dc01c,null));};exports[_0xcd4c('0x53')]=function(_0x2d0649,_0x39723f,_0x259684){var _0x272ba2;return db['VoiceContext'][_0xcd4c('0x53')](_0x2d0649[_0xcd4c('0x54')],{'raw':!![]})[_0xcd4c('0x1f')](function(_0x1da525){_0x272ba2=_0x1da525;return db[_0xcd4c('0x36')][_0xcd4c('0x4b')]({'raw':!![]});})[_0xcd4c('0x1f')](function(_0x5f2c9a){var _0x16ffea=fs['readFileSync'](path[_0xcd4c('0x55')](config[_0xcd4c('0x56')],'server/files/templates/context.ejs'),_0xcd4c('0x57'));var _0x4d9fdf=ejs[_0xcd4c('0x58')](_0x16ffea,{'contexts':_0x5f2c9a||[]});fs[_0xcd4c('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4d9fdf);})[_0xcd4c('0x1f')](function(){return respondWithRpcPromise(_0xcd4c('0x5a'),'create',{'module':_0xcd4c('0x5b')});})[_0xcd4c('0x1f')](function(){var _0xde7bc7=_0x2d0649[_0xcd4c('0x5c')][_0xcd4c('0x32')]({'plain':!![]});if(!_0xde7bc7)throw new Error(_0xcd4c('0x5d'));if(_0xde7bc7['role']===_0xcd4c('0x5c')){var _0x521d5a=_0x272ba2[_0xcd4c('0x32')]({'plain':!![]});return db[_0xcd4c('0x5e')]['find']({'where':{'name':_0xcd4c('0x5f'),'userProfileId':_0xde7bc7['userProfileId']},'raw':!![]})[_0xcd4c('0x1f')](function(_0x5142f0){if(_0x5142f0&&_0x5142f0['autoAssociation']===0x0){return db[_0xcd4c('0x60')]['create']({'name':_0x521d5a[_0xcd4c('0x35')],'resourceId':_0x521d5a['id'],'type':_0x5142f0['name'],'sectionId':_0x5142f0['id']},{})['then'](function(){return _0x272ba2;});}else{return _0x272ba2;}})[_0xcd4c('0x4d')](function(_0x3d4163){logger[_0xcd4c('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d4163);throw _0x3d4163;});}return _0x272ba2;})[_0xcd4c('0x1f')](respondWithResult(_0x39723f,0xc9))[_0xcd4c('0x4d')](handleError(_0x39723f,null));};exports[_0xcd4c('0x30')]=function(_0x256f4f,_0x5e7957,_0x26ef4a){var _0x4d94d2;return db[_0xcd4c('0x36')][_0xcd4c('0x61')]({'where':{'id':_0x256f4f[_0xcd4c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5e7957,null))[_0xcd4c('0x1f')](saveUpdates(_0x256f4f['body'],null))['then'](function(_0x1c04c7){if(_0x1c04c7){_0x4d94d2=_0x1c04c7;return db[_0xcd4c('0x36')][_0xcd4c('0x4b')]({'raw':!![]});}})['then'](function(_0x48e92a){var _0x595d17=fs[_0xcd4c('0x62')](path['join'](config[_0xcd4c('0x56')],_0xcd4c('0x63')),_0xcd4c('0x57'));var _0x3e67f3=ejs[_0xcd4c('0x58')](_0x595d17,{'contexts':_0x48e92a||[]});fs['writeFileSync'](_0xcd4c('0x64'),_0x3e67f3);})[_0xcd4c('0x1f')](function(){return respondWithRpcPromise(_0xcd4c('0x5a'),'update',{'module':_0xcd4c('0x5b')});})[_0xcd4c('0x1f')](function(){return _0x4d94d2;})[_0xcd4c('0x1f')](respondWithResult(_0x5e7957,null))[_0xcd4c('0x4d')](handleError(_0x5e7957,null));};exports[_0xcd4c('0x31')]=function(_0x4518ee,_0x174c8b,_0x17befe){var _0x54d5f1;return db[_0xcd4c('0x36')][_0xcd4c('0x61')]({'where':{'id':_0x4518ee['params']['id']}})['then'](handleEntityNotFound(_0x174c8b,null))[_0xcd4c('0x1f')](removeEntity(_0x174c8b,null))[_0xcd4c('0x1f')](function(){return db[_0xcd4c('0x36')]['findAll']({'raw':!![]});})[_0xcd4c('0x1f')](function(_0x1ca8ba){var _0x22d275=fs[_0xcd4c('0x62')](path[_0xcd4c('0x55')](config['root'],_0xcd4c('0x63')),_0xcd4c('0x57'));var _0xbd9d3b=ejs[_0xcd4c('0x58')](_0x22d275,{'contexts':_0x1ca8ba});fs['writeFileSync'](_0xcd4c('0x64'),_0xbd9d3b);return respondWithRpcPromise(_0xcd4c('0x5a'),'destroy',{'module':_0xcd4c('0x5b')});})[_0xcd4c('0x4d')](handleError(_0x174c8b,null));}; \ No newline at end of file +var _0xe30d=['findAll','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','render','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','UserProfileResource','stack','send','index','map','VoiceContext','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe30d,0x140));var _0xde30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe30d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xde30('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde30('0x1'));var moment=require('moment');var BPromise=require(_0xde30('0x2'));var Mustache=require(_0xde30('0x3'));var util=require(_0xde30('0x4'));var path=require('path');var sox=require(_0xde30('0x5'));var csv=require(_0xde30('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde30('0x7'));var _=require(_0xde30('0x8'));var squel=require(_0xde30('0x9'));var crypto=require(_0xde30('0xa'));var jsforce=require(_0xde30('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xde30('0x6'));var querystring=require(_0xde30('0xc'));var Papa=require(_0xde30('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde30('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xde30('0xf'))('api');var utils=require(_0xde30('0x10'));var config=require(_0xde30('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xde30('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xde30('0x13')][_0xde30('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x1132b4,_0x15a076,_0x1cd2e9,_0xba8044){return new BPromise(function(_0x4e5697,_0x408960){var _0x180112=_0xba8044||client;return _0x180112[_0xde30('0x15')](_0x1132b4,_0x1cd2e9)['then'](function(_0x5012d){logger['info']('VoiceContext,\x20%s,\x20%s',_0x15a076,_0xde30('0x16'));logger['debug'](_0xde30('0x17'),_0x15a076,_0xde30('0x16'),JSON[_0xde30('0x18')](_0x5012d));if(_0x5012d[_0xde30('0x19')]){if(_0x5012d[_0xde30('0x19')][_0xde30('0x1a')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x15a076,_0x5012d['error'][_0xde30('0x1b')]);return _0x408960(_0x5012d[_0xde30('0x19')][_0xde30('0x1b')]);}logger[_0xde30('0x19')](_0xde30('0x1c'),_0x15a076,_0x5012d['error'][_0xde30('0x1b')]);return _0x4e5697(_0x5012d[_0xde30('0x19')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x15a076,_0xde30('0x16'));_0x4e5697(_0x5012d[_0xde30('0x1d')][_0xde30('0x1b')]);}})['catch'](function(_0x56c350){logger[_0xde30('0x19')](_0xde30('0x1c'),_0x15a076,_0x56c350);_0x408960(_0x56c350);});});}function respondWithStatusCode(_0x381cd5,_0x27ad06){_0x27ad06=_0x27ad06||0xcc;return function(_0x1c9c99){if(_0x1c9c99){return _0x381cd5['sendStatus'](_0x27ad06);}return _0x381cd5[_0xde30('0x1e')](_0x27ad06)[_0xde30('0x1f')]();};}function respondWithResult(_0x1fc067,_0x3e0a29){_0x3e0a29=_0x3e0a29||0xc8;return function(_0x12289a){if(_0x12289a){return _0x1fc067[_0xde30('0x1e')](_0x3e0a29)[_0xde30('0x20')](_0x12289a);}};}function respondWithFilteredResult(_0x3efb46,_0x391e18){return function(_0x15c80a){if(_0x15c80a){var _0x325685=typeof _0x391e18['offset']===_0xde30('0x21')&&typeof _0x391e18['limit']==='undefined';var _0xe9710b=_0x15c80a[_0xde30('0x22')];var _0x5f2f5b=_0x325685?0x0:_0x391e18[_0xde30('0x23')];var _0xd08db2=_0x325685?_0x15c80a['count']:_0x391e18[_0xde30('0x23')]+_0x391e18[_0xde30('0x24')];var _0x1075e7;if(_0xd08db2>=_0xe9710b){_0xd08db2=_0xe9710b;_0x1075e7=0xc8;}else{_0x1075e7=0xce;}_0x3efb46[_0xde30('0x1e')](_0x1075e7);return _0x3efb46[_0xde30('0x25')](_0xde30('0x26'),_0x5f2f5b+'-'+_0xd08db2+'/'+_0xe9710b)[_0xde30('0x20')](_0x15c80a);}return null;};}function patchUpdates(_0x4b8874){return function(_0x36fdf7){try{jsonpatch['apply'](_0x36fdf7,_0x4b8874,!![]);}catch(_0x3c8e94){return BPromise['reject'](_0x3c8e94);}return _0x36fdf7[_0xde30('0x27')]();};}function saveUpdates(_0x21adb4,_0x93293c){return function(_0x5e714e){if(_0x5e714e){return _0x5e714e[_0xde30('0x28')](_0x21adb4)[_0xde30('0x29')](function(_0x48cb03){return _0x48cb03;});}return null;};}function removeEntity(_0x1b924e,_0x4133ae){return function(_0x4176eb){if(_0x4176eb){return _0x4176eb[_0xde30('0x2a')]()['then'](function(){var _0x5a18a0=_0x4176eb['get']({'plain':!![]});var _0x4984e7='Contexts';return db[_0xde30('0x2b')]['destroy']({'where':{'type':_0x4984e7,'resourceId':_0x5a18a0['id']}})[_0xde30('0x29')](function(){return _0x4176eb;});})[_0xde30('0x29')](function(){_0x1b924e[_0xde30('0x1e')](0xcc)[_0xde30('0x1f')]();});}};}function handleEntityNotFound(_0x1bb498,_0x32f9f4){return function(_0x1f56d4){if(!_0x1f56d4){_0x1bb498['sendStatus'](0x194);}return _0x1f56d4;};}function handleError(_0x42d0df,_0x1cb86a){_0x1cb86a=_0x1cb86a||0x1f4;return function(_0x94f102){logger[_0xde30('0x19')](_0x94f102[_0xde30('0x2c')]);if(_0x94f102['name']){delete _0x94f102['name'];}_0x42d0df['status'](_0x1cb86a)[_0xde30('0x2d')](_0x94f102);};}exports[_0xde30('0x2e')]=function(_0x2821d5,_0x1e7e2f){var _0x398058={},_0x2682ce={},_0x41e8dd={'count':0x0,'rows':[]};var _0xb019e=_[_0xde30('0x2f')](db[_0xde30('0x30')]['rawAttributes'],function(_0x123a04){return{'name':_0x123a04[_0xde30('0x31')],'type':_0x123a04[_0xde30('0x32')][_0xde30('0x33')]};});_0x2682ce[_0xde30('0x34')]=_[_0xde30('0x2f')](_0xb019e,_0xde30('0x35'));_0x2682ce[_0xde30('0x36')]=_[_0xde30('0x37')](_0x2821d5[_0xde30('0x36')]);_0x2682ce[_0xde30('0x38')]=_['intersection'](_0x2682ce[_0xde30('0x34')],_0x2682ce[_0xde30('0x36')]);_0x398058['attributes']=_[_0xde30('0x39')](_0x2682ce[_0xde30('0x34')],qs[_0xde30('0x3a')](_0x2821d5['query']['fields']));_0x398058['attributes']=_0x398058[_0xde30('0x3b')][_0xde30('0x3c')]?_0x398058[_0xde30('0x3b')]:_0x2682ce[_0xde30('0x34')];if(!_0x2821d5['query'][_0xde30('0x3d')](_0xde30('0x3e'))){_0x398058[_0xde30('0x24')]=qs[_0xde30('0x24')](_0x2821d5['query']['limit']);_0x398058[_0xde30('0x23')]=qs[_0xde30('0x23')](_0x2821d5[_0xde30('0x36')][_0xde30('0x23')]);}_0x398058[_0xde30('0x3f')]=qs[_0xde30('0x40')](_0x2821d5[_0xde30('0x36')][_0xde30('0x40')]);_0x398058[_0xde30('0x41')]=qs[_0xde30('0x38')](_[_0xde30('0x42')](_0x2821d5[_0xde30('0x36')],_0x2682ce[_0xde30('0x38')]),_0xb019e);if(_0x2821d5[_0xde30('0x36')][_0xde30('0x43')]){_0x398058['where']=_[_0xde30('0x44')](_0x398058[_0xde30('0x41')],{'$or':_[_0xde30('0x2f')](_0xb019e,function(_0x49e3aa){if(_0x49e3aa['type']!==_0xde30('0x45')){var _0xc1cfc2={};_0xc1cfc2[_0x49e3aa[_0xde30('0x35')]]={'$like':'%'+_0x2821d5['query'][_0xde30('0x43')]+'%'};return _0xc1cfc2;}})});}_0x398058=_['merge']({},_0x398058,_0x2821d5[_0xde30('0x46')]);var _0x262e97={'where':_0x398058[_0xde30('0x41')]};return db['VoiceContext'][_0xde30('0x22')](_0x262e97)[_0xde30('0x29')](function(_0x2889a0){_0x41e8dd[_0xde30('0x22')]=_0x2889a0;if(_0x2821d5[_0xde30('0x36')][_0xde30('0x47')]){_0x398058['include']=[{'all':!![]}];}return db[_0xde30('0x30')]['findAll'](_0x398058);})[_0xde30('0x29')](function(_0x16aecc){_0x41e8dd[_0xde30('0x48')]=_0x16aecc;return _0x41e8dd;})['then'](respondWithFilteredResult(_0x1e7e2f,_0x398058))[_0xde30('0x49')](handleError(_0x1e7e2f,null));};exports[_0xde30('0x4a')]=function(_0xfed4f0,_0x33e22b){var _0x5dc956={'raw':![],'where':{'id':_0xfed4f0[_0xde30('0x4b')]['id']}},_0x3ecb78={};_0x3ecb78['model']=_[_0xde30('0x37')](db['VoiceContext'][_0xde30('0x4c')]);_0x3ecb78['query']=_[_0xde30('0x37')](_0xfed4f0[_0xde30('0x36')]);_0x3ecb78[_0xde30('0x38')]=_[_0xde30('0x39')](_0x3ecb78['model'],_0x3ecb78[_0xde30('0x36')]);_0x5dc956[_0xde30('0x3b')]=_['intersection'](_0x3ecb78[_0xde30('0x34')],qs[_0xde30('0x3a')](_0xfed4f0[_0xde30('0x36')]['fields']));_0x5dc956[_0xde30('0x3b')]=_0x5dc956[_0xde30('0x3b')][_0xde30('0x3c')]?_0x5dc956['attributes']:_0x3ecb78[_0xde30('0x34')];if(_0xfed4f0[_0xde30('0x36')][_0xde30('0x47')]){_0x5dc956[_0xde30('0x4d')]=[{'all':!![]}];}_0x5dc956=_[_0xde30('0x44')]({},_0x5dc956,_0xfed4f0['options']);return db[_0xde30('0x30')][_0xde30('0x4e')](_0x5dc956)['then'](handleEntityNotFound(_0x33e22b,null))[_0xde30('0x29')](respondWithResult(_0x33e22b,null))[_0xde30('0x49')](handleError(_0x33e22b,null));};exports[_0xde30('0x4f')]=function(_0x4d1755,_0x24b71e,_0x12ed9a){var _0x4cda9c;return db[_0xde30('0x30')][_0xde30('0x4f')](_0x4d1755['body'],{'raw':!![]})[_0xde30('0x29')](function(_0x1334ae){_0x4cda9c=_0x1334ae;return db[_0xde30('0x30')][_0xde30('0x50')]({'raw':!![]});})['then'](function(_0x3f8b8f){var _0x204e0b=fs[_0xde30('0x51')](path['join'](config[_0xde30('0x52')],_0xde30('0x53')),_0xde30('0x54'));var _0x330668=ejs['render'](_0x204e0b,{'contexts':_0x3f8b8f||[]});fs[_0xde30('0x55')](_0xde30('0x56'),_0x330668);})[_0xde30('0x29')](function(){return respondWithRpcPromise(_0xde30('0x57'),'create',{'module':_0xde30('0x58')});})['then'](function(){var _0x354f1d=_0x4d1755['user'][_0xde30('0x59')]({'plain':!![]});if(!_0x354f1d)throw new Error(_0xde30('0x5a'));if(_0x354f1d[_0xde30('0x5b')]==='user'){var _0x37137e=_0x4cda9c[_0xde30('0x59')]({'plain':!![]});return db[_0xde30('0x5c')][_0xde30('0x4e')]({'where':{'name':_0xde30('0x5d'),'userProfileId':_0x354f1d[_0xde30('0x5e')]},'raw':!![]})[_0xde30('0x29')](function(_0x274899){if(_0x274899&&_0x274899[_0xde30('0x5f')]===0x0){return db[_0xde30('0x2b')][_0xde30('0x4f')]({'name':_0x37137e[_0xde30('0x35')],'resourceId':_0x37137e['id'],'type':_0x274899[_0xde30('0x35')],'sectionId':_0x274899['id']},{})[_0xde30('0x29')](function(){return _0x4cda9c;});}else{return _0x4cda9c;}})['catch'](function(_0x80cfc4){logger[_0xde30('0x19')](_0xde30('0x60'),_0x80cfc4);throw _0x80cfc4;});}return _0x4cda9c;})[_0xde30('0x29')](respondWithResult(_0x24b71e,0xc9))[_0xde30('0x49')](handleError(_0x24b71e,null));};exports[_0xde30('0x28')]=function(_0x223e44,_0x3ad416,_0x326351){var _0x4eee47;return db['VoiceContext']['find']({'where':{'id':_0x223e44[_0xde30('0x4b')]['id']}})[_0xde30('0x29')](handleEntityNotFound(_0x3ad416,null))[_0xde30('0x29')](saveUpdates(_0x223e44[_0xde30('0x61')],null))[_0xde30('0x29')](function(_0x46b534){if(_0x46b534){_0x4eee47=_0x46b534;return db['VoiceContext'][_0xde30('0x50')]({'raw':!![]});}})[_0xde30('0x29')](function(_0x289ac7){var _0x429fc1=fs[_0xde30('0x51')](path[_0xde30('0x62')](config[_0xde30('0x52')],_0xde30('0x53')),'utf8');var _0x2d6cad=ejs[_0xde30('0x63')](_0x429fc1,{'contexts':_0x289ac7||[]});fs[_0xde30('0x55')](_0xde30('0x56'),_0x2d6cad);})['then'](function(){return respondWithRpcPromise(_0xde30('0x57'),_0xde30('0x28'),{'module':_0xde30('0x58')});})[_0xde30('0x29')](function(){return _0x4eee47;})[_0xde30('0x29')](respondWithResult(_0x3ad416,null))[_0xde30('0x49')](handleError(_0x3ad416,null));};exports[_0xde30('0x2a')]=function(_0x3d8bc,_0x50c932,_0x4d8842){var _0xe5fab6;return db[_0xde30('0x30')][_0xde30('0x4e')]({'where':{'id':_0x3d8bc[_0xde30('0x4b')]['id']}})[_0xde30('0x29')](handleEntityNotFound(_0x50c932,null))['then'](removeEntity(_0x50c932,null))['then'](function(){return db[_0xde30('0x30')]['findAll']({'raw':!![]});})[_0xde30('0x29')](function(_0x23492f){var _0x3a31e5=fs[_0xde30('0x51')](path[_0xde30('0x62')](config[_0xde30('0x52')],_0xde30('0x53')),'utf8');var _0x37aac7=ejs[_0xde30('0x63')](_0x3a31e5,{'contexts':_0x23492f});fs[_0xde30('0x55')](_0xde30('0x56'),_0x37aac7);return respondWithRpcPromise('Reload',_0xde30('0x2a'),{'module':_0xde30('0x58')});})[_0xde30('0x49')](handleError(_0x50c932,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index db6cfc0..ec30553 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 _0x3c6a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util'];(function(_0x1ba069,_0x2f44a6){var _0x41c236=function(_0x81a497){while(--_0x81a497){_0x1ba069['push'](_0x1ba069['shift']());}};_0x41c236(++_0x2f44a6);}(_0x3c6a,0xd1));var _0xa3c6=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x3c6a[_0x13e300];return _0x5a3eea;};'use strict';var _=require('lodash');var util=require(_0xa3c6('0x0'));var logger=require(_0xa3c6('0x1'))(_0xa3c6('0x2'));var moment=require(_0xa3c6('0x3'));var BPromise=require(_0xa3c6('0x4'));var rp=require(_0xa3c6('0x5'));var fs=require('fs');var path=require(_0xa3c6('0x6'));var rimraf=require(_0xa3c6('0x7'));var config=require(_0xa3c6('0x8'));var attributes=require(_0xa3c6('0x9'));module[_0xa3c6('0xa')]=function(_0x5a8931,_0x25f92d){return _0x5a8931[_0xa3c6('0xb')](_0xa3c6('0xc'),attributes,{'tableName':_0xa3c6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbba=['../../config/environment','./voiceContext.attributes','exports','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x555d8c,_0x2424aa){var _0x235411=function(_0x36d3e0){while(--_0x36d3e0){_0x555d8c['push'](_0x555d8c['shift']());}};_0x235411(++_0x2424aa);}(_0xfbba,0x118));var _0xafbb=function(_0xfe0c4b,_0xb3fab7){_0xfe0c4b=_0xfe0c4b-0x0;var _0x3bc649=_0xfbba[_0xfe0c4b];return _0x3bc649;};'use strict';var _=require('lodash');var util=require(_0xafbb('0x0'));var logger=require(_0xafbb('0x1'))(_0xafbb('0x2'));var moment=require(_0xafbb('0x3'));var BPromise=require(_0xafbb('0x4'));var rp=require(_0xafbb('0x5'));var fs=require('fs');var path=require(_0xafbb('0x6'));var rimraf=require(_0xafbb('0x7'));var config=require(_0xafbb('0x8'));var attributes=require(_0xafbb('0x9'));module[_0xafbb('0xa')]=function(_0x1e3bd5,_0x2eee0c){return _0x1e3bd5['define']('VoiceContext',attributes,{'tableName':_0xafbb('0xb'),'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 48edfdf..888d9ef 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 _0xe40a=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5529de,_0xc562e4){var _0x1e8513=function(_0x31e38a){while(--_0x31e38a){_0x5529de['push'](_0x5529de['shift']());}};_0x1e8513(++_0xc562e4);}(_0xe40a,0x7d));var _0xae40=function(_0x5728ee,_0x7c32cc){_0x5728ee=_0x5728ee-0x0;var _0x47b03b=_0xe40a[_0x5728ee];return _0x47b03b;};'use strict';var _=require(_0xae40('0x0'));var util=require(_0xae40('0x1'));var moment=require(_0xae40('0x2'));var BPromise=require('bluebird');var rs=require(_0xae40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae40('0x4'))['db'];var utils=require(_0xae40('0x5'));var logger=require('../../config/logger')(_0xae40('0x6'));var config=require(_0xae40('0x7'));var jayson=require(_0xae40('0x8'));var client=jayson[_0xae40('0x9')][_0xae40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d80f4,_0x5c9641,_0x51d909){return new BPromise(function(_0x2fda86,_0x35d177){return client[_0xae40('0xb')](_0x4d80f4,_0x51d909)[_0xae40('0xc')](function(_0x4d0de0){logger[_0xae40('0xd')](_0xae40('0xe'),_0x5c9641,_0xae40('0xf'));logger['debug'](_0xae40('0x10'),_0x5c9641,_0xae40('0xf'),JSON[_0xae40('0x11')](_0x4d0de0));if(_0x4d0de0[_0xae40('0x12')]){if(_0x4d0de0[_0xae40('0x12')][_0xae40('0x13')]===0x1f4){logger[_0xae40('0x12')](_0xae40('0xe'),_0x5c9641,_0x4d0de0['error'][_0xae40('0x14')]);return _0x35d177(_0x4d0de0[_0xae40('0x12')]['message']);}logger[_0xae40('0x12')]('VoiceContext,\x20%s,\x20%s',_0x5c9641,_0x4d0de0[_0xae40('0x12')][_0xae40('0x14')]);return _0x2fda86(_0x4d0de0[_0xae40('0x12')][_0xae40('0x14')]);}else{logger[_0xae40('0xd')](_0xae40('0xe'),_0x5c9641,_0xae40('0xf'));_0x2fda86(_0x4d0de0[_0xae40('0x15')][_0xae40('0x14')]);}})[_0xae40('0x16')](function(_0x3adee2){logger['error'](_0xae40('0xe'),_0x5c9641,_0x3adee2);_0x35d177(_0x3adee2);});});} \ No newline at end of file +var _0x4bde=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','info','result'];(function(_0x25a756,_0x5d4dab){var _0x4494a0=function(_0x404e70){while(--_0x404e70){_0x25a756['push'](_0x25a756['shift']());}};_0x4494a0(++_0x5d4dab);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x91a646,_0x392902){_0x91a646=_0x91a646-0x0;var _0x5d469d=_0x4bde[_0x91a646];return _0x5d469d;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('VoiceContext,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c0b09b5..0b3f196 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 _0x6246=['update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','show','isAuthenticated','create','/:id'];(function(_0x5a3741,_0x56b9c8){var _0x1ed49d=function(_0x555335){while(--_0x555335){_0x5a3741['push'](_0x5a3741['shift']());}};_0x1ed49d(++_0x56b9c8);}(_0x6246,0x19a));var _0x6624=function(_0x52fe59,_0x388b5e){_0x52fe59=_0x52fe59-0x0;var _0xc64d4d=_0x6246[_0x52fe59];return _0xc64d4d;};'use strict';var multer=require(_0x6624('0x0'));var util=require(_0x6624('0x1'));var path=require(_0x6624('0x2'));var timeout=require('connect-timeout');var express=require(_0x6624('0x3'));var router=express[_0x6624('0x4')]();var fs_extra=require(_0x6624('0x5'));var auth=require(_0x6624('0x6'));var interaction=require(_0x6624('0x7'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x6624('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6624('0x8')](_0x6624('0x9'),auth['isAuthenticated'](),controller[_0x6624('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6624('0xb')]);router['post']('/',auth[_0x6624('0xc')](),controller[_0x6624('0xd')]);router['put'](_0x6624('0xe'),auth[_0x6624('0xc')](),controller[_0x6624('0xf')]);router['delete'](_0x6624('0xe'),auth[_0x6624('0xc')](),controller[_0x6624('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd50a=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x1133c9,_0x350d45){var _0x5ab46d=function(_0x8695fa){while(--_0x8695fa){_0x1133c9['push'](_0x1133c9['shift']());}};_0x5ab46d(++_0x350d45);}(_0xd50a,0x182));var _0xad50=function(_0x540630,_0xae73b2){_0x540630=_0x540630-0x0;var _0x45401d=_0xd50a[_0x540630];return _0x45401d;};'use strict';var multer=require(_0xad50('0x0'));var util=require('util');var path=require(_0xad50('0x1'));var timeout=require(_0xad50('0x2'));var express=require(_0xad50('0x3'));var router=express[_0xad50('0x4')]();var fs_extra=require(_0xad50('0x5'));var auth=require(_0xad50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad50('0x7'));var controller=require(_0xad50('0x8'));router[_0xad50('0x9')]('/',auth[_0xad50('0xa')](),controller[_0xad50('0xb')]);router['get'](_0xad50('0xc'),auth['isAuthenticated'](),controller[_0xad50('0xd')]);router['get'](_0xad50('0xe'),auth['isAuthenticated'](),controller[_0xad50('0xf')]);router[_0xad50('0x10')]('/',auth[_0xad50('0xa')](),controller[_0xad50('0x11')]);router[_0xad50('0x12')](_0xad50('0xe'),auth[_0xad50('0xa')](),controller[_0xad50('0x13')]);router[_0xad50('0x14')](_0xad50('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xad50('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c1f2edb..126a993 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 _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x3dd17d,_0x46b797){var _0x408fb7=function(_0x537bee){while(--_0x537bee){_0x3dd17d['push'](_0x3dd17d['shift']());}};_0x408fb7(++_0x46b797);}(_0x55ca,0x126));var _0xa55c=function(_0x239904,_0x4b11e2){_0x239904=_0x239904-0x0;var _0x259609=_0x55ca[_0x239904];return _0x259609;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0xdace=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x2cdf4e,_0x210079){var _0x5a4400=function(_0x297ee3){while(--_0x297ee3){_0x2cdf4e['push'](_0x2cdf4e['shift']());}};_0x5a4400(++_0x210079);}(_0xdace,0xc5));var _0xedac=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0xdace[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xedac('0x1')]},'channel':{'type':Sequelize[_0xedac('0x1')]},'channelstate':{'type':Sequelize[_0xedac('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'connectedlinenum':{'type':Sequelize[_0xedac('0x1')]},'connectedlinename':{'type':Sequelize[_0xedac('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xedac('0x1')]},'context':{'type':Sequelize[_0xedac('0x1')]},'exten':{'type':Sequelize[_0xedac('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'linkedid':{'type':Sequelize[_0xedac('0x1')]},'destchannel':{'type':Sequelize[_0xedac('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xedac('0x1')]},'destcalleridnum':{'type':Sequelize[_0xedac('0x1')]},'destcalleridname':{'type':Sequelize[_0xedac('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xedac('0x1')]},'destaccountcode':{'type':Sequelize[_0xedac('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xedac('0x2')]},'destuniqueid':{'type':Sequelize[_0xedac('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xedac('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xedac('0x3')]},'answertime':{'type':Sequelize[_0xedac('0x3')]},'endtime':{'type':Sequelize[_0xedac('0x3')]},'lastevent':{'type':Sequelize[_0xedac('0x1')],'comment':_0xedac('0x4')},'routeId':{'type':Sequelize[_0xedac('0x2')]},'duration':{'type':Sequelize[_0xedac('0x2')]},'holdtime':{'type':Sequelize[_0xedac('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 742a81f..0d181c4 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 _0xb200=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x113f0f,_0x4e0728){var _0x503851=function(_0x4dbd87){while(--_0x4dbd87){_0x113f0f['push'](_0x113f0f['shift']());}};_0x503851(++_0x4e0728);}(_0xb200,0x1b9));var _0x0b20=function(_0x40f46f,_0x16bba2){_0x40f46f=_0x40f46f-0x0;var _0x9d21a=_0xb200[_0x40f46f];return _0x9d21a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b20('0x0'));var zipdir=require(_0x0b20('0x1'));var jsonpatch=require(_0x0b20('0x2'));var rp=require(_0x0b20('0x3'));var moment=require(_0x0b20('0x4'));var BPromise=require(_0x0b20('0x5'));var Mustache=require('mustache');var util=require(_0x0b20('0x6'));var path=require(_0x0b20('0x7'));var sox=require(_0x0b20('0x8'));var csv=require(_0x0b20('0x9'));var ejs=require(_0x0b20('0xa'));var fs=require('fs');var fs_extra=require(_0x0b20('0xb'));var _=require(_0x0b20('0xc'));var squel=require('squel');var crypto=require(_0x0b20('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0b20('0xe'));var toCsv=require(_0x0b20('0x9'));var querystring=require(_0x0b20('0xf'));var Papa=require(_0x0b20('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b20('0x11'));var hardwareService=require(_0x0b20('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0b20('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b20('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347309,_0xa33c04){_0xa33c04=_0xa33c04||0xcc;return function(_0x51aeef){if(_0x51aeef){return _0x347309[_0x0b20('0x15')](_0xa33c04);}return _0x347309['status'](_0xa33c04)[_0x0b20('0x16')]();};}function respondWithResult(_0x17225a,_0x5bd71c){_0x5bd71c=_0x5bd71c||0xc8;return function(_0x4d8408){if(_0x4d8408){return _0x17225a[_0x0b20('0x17')](_0x5bd71c)[_0x0b20('0x18')](_0x4d8408);}};}function respondWithFilteredResult(_0x20982f,_0x11ae39){return function(_0x411a1a){if(_0x411a1a){var _0x2680cf=typeof _0x11ae39['offset']===_0x0b20('0x19')&&typeof _0x11ae39[_0x0b20('0x1a')]===_0x0b20('0x19');var _0x6dddbd=_0x411a1a[_0x0b20('0x1b')];var _0x2343d2=_0x2680cf?0x0:_0x11ae39[_0x0b20('0x1c')];var _0x5326a0=_0x2680cf?_0x411a1a[_0x0b20('0x1b')]:_0x11ae39['offset']+_0x11ae39[_0x0b20('0x1a')];var _0x303083;if(_0x5326a0>=_0x6dddbd){_0x5326a0=_0x6dddbd;_0x303083=0xc8;}else{_0x303083=0xce;}_0x20982f[_0x0b20('0x17')](_0x303083);return _0x20982f[_0x0b20('0x1d')](_0x0b20('0x1e'),_0x2343d2+'-'+_0x5326a0+'/'+_0x6dddbd)[_0x0b20('0x18')](_0x411a1a);}return null;};}function patchUpdates(_0x55e685){return function(_0x481b0f){try{jsonpatch[_0x0b20('0x1f')](_0x481b0f,_0x55e685,!![]);}catch(_0x51c0ea){return BPromise[_0x0b20('0x20')](_0x51c0ea);}return _0x481b0f['save']();};}function saveUpdates(_0x4c3cbc,_0x361eaf){return function(_0x243fe1){if(_0x243fe1){return _0x243fe1[_0x0b20('0x21')](_0x4c3cbc)['then'](function(_0x587534){return _0x587534;});}return null;};}function removeEntity(_0x51aaad,_0x3330c6){return function(_0x3cfa75){if(_0x3cfa75){return _0x3cfa75[_0x0b20('0x22')]()[_0x0b20('0x23')](function(){_0x51aaad['status'](0xcc)[_0x0b20('0x16')]();});}};}function handleEntityNotFound(_0x54a863,_0x202cf2){return function(_0x390598){if(!_0x390598){_0x54a863[_0x0b20('0x15')](0x194);}return _0x390598;};}function handleError(_0x2e6fae,_0x42d48f){_0x42d48f=_0x42d48f||0x1f4;return function(_0x29c58c){logger[_0x0b20('0x24')](_0x29c58c[_0x0b20('0x25')]);if(_0x29c58c['name']){delete _0x29c58c['name'];}_0x2e6fae['status'](_0x42d48f)[_0x0b20('0x26')](_0x29c58c);};}exports[_0x0b20('0x27')]=function(_0x3afa10,_0x422acf){var _0x131be1={},_0xf5d4bb={},_0x10754b={'count':0x0,'rows':[]};var _0x39ec30=_[_0x0b20('0x28')](db[_0x0b20('0x29')][_0x0b20('0x2a')],function(_0x521319){return{'name':_0x521319[_0x0b20('0x2b')],'type':_0x521319[_0x0b20('0x2c')][_0x0b20('0x2d')]};});_0xf5d4bb[_0x0b20('0x2e')]=_[_0x0b20('0x28')](_0x39ec30,_0x0b20('0x2f'));_0xf5d4bb['query']=_[_0x0b20('0x30')](_0x3afa10[_0x0b20('0x31')]);_0xf5d4bb['filters']=_[_0x0b20('0x32')](_0xf5d4bb['model'],_0xf5d4bb['query']);_0x131be1[_0x0b20('0x33')]=_['intersection'](_0xf5d4bb[_0x0b20('0x2e')],qs['fields'](_0x3afa10[_0x0b20('0x31')][_0x0b20('0x34')]));_0x131be1[_0x0b20('0x33')]=_0x131be1[_0x0b20('0x33')]['length']?_0x131be1[_0x0b20('0x33')]:_0xf5d4bb[_0x0b20('0x2e')];if(!_0x3afa10[_0x0b20('0x31')][_0x0b20('0x35')](_0x0b20('0x36'))){_0x131be1[_0x0b20('0x1a')]=qs[_0x0b20('0x1a')](_0x3afa10[_0x0b20('0x31')][_0x0b20('0x1a')]);_0x131be1['offset']=qs[_0x0b20('0x1c')](_0x3afa10[_0x0b20('0x31')][_0x0b20('0x1c')]);}_0x131be1[_0x0b20('0x37')]=qs['sort'](_0x3afa10[_0x0b20('0x31')][_0x0b20('0x38')]);_0x131be1[_0x0b20('0x39')]=qs[_0x0b20('0x3a')](_[_0x0b20('0x3b')](_0x3afa10[_0x0b20('0x31')],_0xf5d4bb[_0x0b20('0x3a')]),_0x39ec30);if(_0x3afa10[_0x0b20('0x31')]['filter']){_0x131be1['where']=_[_0x0b20('0x3c')](_0x131be1[_0x0b20('0x39')],{'$or':_[_0x0b20('0x28')](_0x39ec30,function(_0x1ec448){if(_0x1ec448['type']!==_0x0b20('0x3d')){var _0x23cbd2={};_0x23cbd2[_0x1ec448['name']]={'$like':'%'+_0x3afa10[_0x0b20('0x31')][_0x0b20('0x3e')]+'%'};return _0x23cbd2;}})});}_0x131be1=_[_0x0b20('0x3c')]({},_0x131be1,_0x3afa10[_0x0b20('0x3f')]);var _0x4f01d3={'where':_0x131be1[_0x0b20('0x39')]};return db[_0x0b20('0x29')]['count'](_0x4f01d3)[_0x0b20('0x23')](function(_0x2c2f23){_0x10754b['count']=_0x2c2f23;if(_0x3afa10[_0x0b20('0x31')]['includeAll']){_0x131be1[_0x0b20('0x40')]=[{'all':!![]}];}return db[_0x0b20('0x29')][_0x0b20('0x41')](_0x131be1);})[_0x0b20('0x23')](function(_0x48a4b5){_0x10754b[_0x0b20('0x42')]=_0x48a4b5;return _0x10754b;})[_0x0b20('0x23')](respondWithFilteredResult(_0x422acf,_0x131be1))[_0x0b20('0x43')](handleError(_0x422acf,null));};exports['show']=function(_0x450505,_0x3be9cd){var _0x1aaf6a={'raw':!![],'where':{'id':_0x450505[_0x0b20('0x44')]['id']}},_0x5a855a={};_0x5a855a[_0x0b20('0x2e')]=_['keys'](db[_0x0b20('0x29')]['rawAttributes']);_0x5a855a['query']=_[_0x0b20('0x30')](_0x450505[_0x0b20('0x31')]);_0x5a855a[_0x0b20('0x3a')]=_[_0x0b20('0x32')](_0x5a855a['model'],_0x5a855a[_0x0b20('0x31')]);_0x1aaf6a[_0x0b20('0x33')]=_[_0x0b20('0x32')](_0x5a855a[_0x0b20('0x2e')],qs[_0x0b20('0x34')](_0x450505[_0x0b20('0x31')]['fields']));_0x1aaf6a[_0x0b20('0x33')]=_0x1aaf6a[_0x0b20('0x33')]['length']?_0x1aaf6a[_0x0b20('0x33')]:_0x5a855a[_0x0b20('0x2e')];if(_0x450505[_0x0b20('0x31')][_0x0b20('0x45')]){_0x1aaf6a[_0x0b20('0x40')]=[{'all':!![]}];}_0x1aaf6a=_[_0x0b20('0x3c')]({},_0x1aaf6a,_0x450505[_0x0b20('0x3f')]);return db[_0x0b20('0x29')][_0x0b20('0x46')](_0x1aaf6a)[_0x0b20('0x23')](handleEntityNotFound(_0x3be9cd,null))[_0x0b20('0x23')](respondWithResult(_0x3be9cd,null))[_0x0b20('0x43')](handleError(_0x3be9cd,null));};exports[_0x0b20('0x47')]=function(_0x4bd189,_0x3858c5){return db[_0x0b20('0x29')]['create'](_0x4bd189[_0x0b20('0x48')],{})[_0x0b20('0x23')](respondWithResult(_0x3858c5,0xc9))['catch'](handleError(_0x3858c5,null));};exports[_0x0b20('0x21')]=function(_0x2dc81d,_0x484a37){if(_0x2dc81d['body']['id']){delete _0x2dc81d[_0x0b20('0x48')]['id'];}return db['VoiceDialReport'][_0x0b20('0x46')]({'where':{'id':_0x2dc81d[_0x0b20('0x44')]['id']}})[_0x0b20('0x23')](handleEntityNotFound(_0x484a37,null))['then'](saveUpdates(_0x2dc81d['body'],null))['then'](respondWithResult(_0x484a37,null))[_0x0b20('0x43')](handleError(_0x484a37,null));};exports[_0x0b20('0x22')]=function(_0x4bae9e,_0x27f56f){return db[_0x0b20('0x29')][_0x0b20('0x46')]({'where':{'id':_0x4bae9e[_0x0b20('0x44')]['id']}})[_0x0b20('0x23')](handleEntityNotFound(_0x27f56f,null))[_0x0b20('0x23')](removeEntity(_0x27f56f,null))[_0x0b20('0x43')](handleError(_0x27f56f,null));};exports[_0x0b20('0x49')]=function(_0xfed3b3,_0x1bcf14){return db[_0x0b20('0x29')]['describe']()[_0x0b20('0x23')](respondWithResult(_0x1bcf14,null))[_0x0b20('0x43')](handleError(_0x1bcf14,null));}; \ No newline at end of file +var _0x30e1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','map','VoiceDialReport','rawAttributes','fieldName','type','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30e1,0xf6));var _0x130e=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x30e1[_0x1b1e76];return _0x3d743a;};'use strict';var emlformat=require(_0x130e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x130e('0x1'));var jsonpatch=require(_0x130e('0x2'));var rp=require(_0x130e('0x3'));var moment=require(_0x130e('0x4'));var BPromise=require(_0x130e('0x5'));var Mustache=require(_0x130e('0x6'));var util=require('util');var path=require(_0x130e('0x7'));var sox=require(_0x130e('0x8'));var csv=require(_0x130e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x130e('0xa'));var squel=require('squel');var crypto=require(_0x130e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x130e('0x9'));var querystring=require(_0x130e('0xc'));var Papa=require(_0x130e('0xd'));var Redis=require(_0x130e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x130e('0xf'));var as=require(_0x130e('0x10'));var hardwareService=require(_0x130e('0x11'));var logger=require(_0x130e('0x12'))(_0x130e('0x13'));var utils=require('../../config/utils');var config=require(_0x130e('0x14'));var licenseUtil=require(_0x130e('0x15'));var db=require(_0x130e('0x16'))['db'];function respondWithStatusCode(_0x2295d5,_0xaf2f59){_0xaf2f59=_0xaf2f59||0xcc;return function(_0x52e3b3){if(_0x52e3b3){return _0x2295d5[_0x130e('0x17')](_0xaf2f59);}return _0x2295d5[_0x130e('0x18')](_0xaf2f59)['end']();};}function respondWithResult(_0x3a4711,_0x477e42){_0x477e42=_0x477e42||0xc8;return function(_0x19347e){if(_0x19347e){return _0x3a4711[_0x130e('0x18')](_0x477e42)['json'](_0x19347e);}};}function respondWithFilteredResult(_0x47500c,_0x2d4d35){return function(_0x1c1e47){if(_0x1c1e47){var _0x3a2271=typeof _0x2d4d35['offset']===_0x130e('0x19')&&typeof _0x2d4d35['limit']===_0x130e('0x19');var _0x40d961=_0x1c1e47[_0x130e('0x1a')];var _0x45a267=_0x3a2271?0x0:_0x2d4d35['offset'];var _0xa67ed2=_0x3a2271?_0x1c1e47[_0x130e('0x1a')]:_0x2d4d35[_0x130e('0x1b')]+_0x2d4d35[_0x130e('0x1c')];var _0x231cc8;if(_0xa67ed2>=_0x40d961){_0xa67ed2=_0x40d961;_0x231cc8=0xc8;}else{_0x231cc8=0xce;}_0x47500c['status'](_0x231cc8);return _0x47500c[_0x130e('0x1d')](_0x130e('0x1e'),_0x45a267+'-'+_0xa67ed2+'/'+_0x40d961)[_0x130e('0x1f')](_0x1c1e47);}return null;};}function patchUpdates(_0x5bc69b){return function(_0x59b9cc){try{jsonpatch[_0x130e('0x20')](_0x59b9cc,_0x5bc69b,!![]);}catch(_0x35b7ec){return BPromise[_0x130e('0x21')](_0x35b7ec);}return _0x59b9cc[_0x130e('0x22')]();};}function saveUpdates(_0x497f45,_0x55390d){return function(_0x404f69){if(_0x404f69){return _0x404f69[_0x130e('0x23')](_0x497f45)['then'](function(_0x22ad5d){return _0x22ad5d;});}return null;};}function removeEntity(_0x351590,_0x2b4aa0){return function(_0xbaa5d7){if(_0xbaa5d7){return _0xbaa5d7['destroy']()[_0x130e('0x24')](function(){_0x351590[_0x130e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8469,_0x2723b9){return function(_0x33c587){if(!_0x33c587){_0x1f8469['sendStatus'](0x194);}return _0x33c587;};}function handleError(_0x21f443,_0x32ff97){_0x32ff97=_0x32ff97||0x1f4;return function(_0x212a8e){logger[_0x130e('0x25')](_0x212a8e['stack']);if(_0x212a8e[_0x130e('0x26')]){delete _0x212a8e['name'];}_0x21f443[_0x130e('0x18')](_0x32ff97)['send'](_0x212a8e);};}exports['index']=function(_0x229167,_0x55fb6c){var _0x46095b={},_0x5bb1a6={},_0x4df307={'count':0x0,'rows':[]};var _0x514bd9=_[_0x130e('0x27')](db[_0x130e('0x28')][_0x130e('0x29')],function(_0x53b16f){return{'name':_0x53b16f[_0x130e('0x2a')],'type':_0x53b16f[_0x130e('0x2b')]['key']};});_0x5bb1a6['model']=_[_0x130e('0x27')](_0x514bd9,_0x130e('0x26'));_0x5bb1a6[_0x130e('0x2c')]=_[_0x130e('0x2d')](_0x229167[_0x130e('0x2c')]);_0x5bb1a6['filters']=_[_0x130e('0x2e')](_0x5bb1a6[_0x130e('0x2f')],_0x5bb1a6[_0x130e('0x2c')]);_0x46095b[_0x130e('0x30')]=_['intersection'](_0x5bb1a6[_0x130e('0x2f')],qs['fields'](_0x229167[_0x130e('0x2c')][_0x130e('0x31')]));_0x46095b['attributes']=_0x46095b[_0x130e('0x30')][_0x130e('0x32')]?_0x46095b[_0x130e('0x30')]:_0x5bb1a6['model'];if(!_0x229167['query'][_0x130e('0x33')](_0x130e('0x34'))){_0x46095b[_0x130e('0x1c')]=qs[_0x130e('0x1c')](_0x229167[_0x130e('0x2c')][_0x130e('0x1c')]);_0x46095b['offset']=qs[_0x130e('0x1b')](_0x229167['query'][_0x130e('0x1b')]);}_0x46095b[_0x130e('0x35')]=qs[_0x130e('0x36')](_0x229167[_0x130e('0x2c')]['sort']);_0x46095b[_0x130e('0x37')]=qs['filters'](_[_0x130e('0x38')](_0x229167[_0x130e('0x2c')],_0x5bb1a6[_0x130e('0x39')]),_0x514bd9);if(_0x229167[_0x130e('0x2c')]['filter']){_0x46095b[_0x130e('0x37')]=_[_0x130e('0x3a')](_0x46095b[_0x130e('0x37')],{'$or':_['map'](_0x514bd9,function(_0x5e9ade){if(_0x5e9ade[_0x130e('0x2b')]!==_0x130e('0x3b')){var _0xbec612={};_0xbec612[_0x5e9ade['name']]={'$like':'%'+_0x229167[_0x130e('0x2c')][_0x130e('0x3c')]+'%'};return _0xbec612;}})});}_0x46095b=_[_0x130e('0x3a')]({},_0x46095b,_0x229167[_0x130e('0x3d')]);var _0x480991={'where':_0x46095b[_0x130e('0x37')]};return db[_0x130e('0x28')][_0x130e('0x1a')](_0x480991)[_0x130e('0x24')](function(_0x320e54){_0x4df307[_0x130e('0x1a')]=_0x320e54;if(_0x229167[_0x130e('0x2c')][_0x130e('0x3e')]){_0x46095b[_0x130e('0x3f')]=[{'all':!![]}];}return db[_0x130e('0x28')][_0x130e('0x40')](_0x46095b);})[_0x130e('0x24')](function(_0xc449e3){_0x4df307[_0x130e('0x41')]=_0xc449e3;return _0x4df307;})[_0x130e('0x24')](respondWithFilteredResult(_0x55fb6c,_0x46095b))['catch'](handleError(_0x55fb6c,null));};exports[_0x130e('0x42')]=function(_0x4c1c52,_0x2ef5b8){var _0x35432a={'raw':!![],'where':{'id':_0x4c1c52[_0x130e('0x43')]['id']}},_0x36a171={};_0x36a171['model']=_[_0x130e('0x2d')](db[_0x130e('0x28')][_0x130e('0x29')]);_0x36a171[_0x130e('0x2c')]=_[_0x130e('0x2d')](_0x4c1c52[_0x130e('0x2c')]);_0x36a171[_0x130e('0x39')]=_[_0x130e('0x2e')](_0x36a171[_0x130e('0x2f')],_0x36a171[_0x130e('0x2c')]);_0x35432a[_0x130e('0x30')]=_[_0x130e('0x2e')](_0x36a171[_0x130e('0x2f')],qs['fields'](_0x4c1c52[_0x130e('0x2c')][_0x130e('0x31')]));_0x35432a[_0x130e('0x30')]=_0x35432a[_0x130e('0x30')]['length']?_0x35432a[_0x130e('0x30')]:_0x36a171[_0x130e('0x2f')];if(_0x4c1c52[_0x130e('0x2c')][_0x130e('0x3e')]){_0x35432a[_0x130e('0x3f')]=[{'all':!![]}];}_0x35432a=_[_0x130e('0x3a')]({},_0x35432a,_0x4c1c52['options']);return db[_0x130e('0x28')][_0x130e('0x44')](_0x35432a)[_0x130e('0x24')](handleEntityNotFound(_0x2ef5b8,null))[_0x130e('0x24')](respondWithResult(_0x2ef5b8,null))[_0x130e('0x45')](handleError(_0x2ef5b8,null));};exports[_0x130e('0x46')]=function(_0x58cd8b,_0x38388d){return db[_0x130e('0x28')][_0x130e('0x46')](_0x58cd8b[_0x130e('0x47')],{})['then'](respondWithResult(_0x38388d,0xc9))[_0x130e('0x45')](handleError(_0x38388d,null));};exports[_0x130e('0x23')]=function(_0x2a3c69,_0x273db6){if(_0x2a3c69[_0x130e('0x47')]['id']){delete _0x2a3c69[_0x130e('0x47')]['id'];}return db[_0x130e('0x28')][_0x130e('0x44')]({'where':{'id':_0x2a3c69[_0x130e('0x43')]['id']}})[_0x130e('0x24')](handleEntityNotFound(_0x273db6,null))['then'](saveUpdates(_0x2a3c69[_0x130e('0x47')],null))[_0x130e('0x24')](respondWithResult(_0x273db6,null))[_0x130e('0x45')](handleError(_0x273db6,null));};exports['destroy']=function(_0x5a9166,_0x1c0527){return db['VoiceDialReport']['find']({'where':{'id':_0x5a9166[_0x130e('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c0527,null))[_0x130e('0x24')](removeEntity(_0x1c0527,null))[_0x130e('0x45')](handleError(_0x1c0527,null));};exports[_0x130e('0x48')]=function(_0x3d5b49,_0xbba0d5){return db['VoiceDialReport'][_0x130e('0x48')]()[_0x130e('0x24')](respondWithResult(_0xbba0d5,null))[_0x130e('0x45')](handleError(_0xbba0d5,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 424d856..401b97c 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 _0xa529=['path','rimraf','../../config/environment','exports','define','VoiceDialReport','util','../../config/logger','moment','request-promise'];(function(_0x4b00ad,_0x1e6ca0){var _0x24bf0d=function(_0x52e0a8){while(--_0x52e0a8){_0x4b00ad['push'](_0x4b00ad['shift']());}};_0x24bf0d(++_0x1e6ca0);}(_0xa529,0x16e));var _0x9a52=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa529[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x9a52('0x0'));var logger=require(_0x9a52('0x1'))('api');var moment=require(_0x9a52('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a52('0x3'));var fs=require('fs');var path=require(_0x9a52('0x4'));var rimraf=require(_0x9a52('0x5'));var config=require(_0x9a52('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x9a52('0x7')]=function(_0x42efbd,_0x1fa1be){return _0x42efbd[_0x9a52('0x8')](_0x9a52('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd04=['rimraf','../../config/environment','exports','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4dd0('0x0'));var logger=require(_0x4dd0('0x1'))(_0x4dd0('0x2'));var moment=require(_0x4dd0('0x3'));var BPromise=require(_0x4dd0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4dd0('0x5'));var rimraf=require(_0x4dd0('0x6'));var config=require(_0x4dd0('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x4dd0('0x8')]=function(_0x35d489,_0x12bb71){return _0x35d489['define'](_0x4dd0('0x9'),attributes,{'tableName':_0x4dd0('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4dd0('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 38b63b9..4235975 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 _0x80be=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','VoiceDialReport','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','body','where','attributes'];(function(_0x359a7c,_0xb2aeba){var _0xa9e0b6=function(_0x5cc094){while(--_0x5cc094){_0x359a7c['push'](_0x359a7c['shift']());}};_0xa9e0b6(++_0xb2aeba);}(_0x80be,0xfc));var _0xe80b=function(_0xc10a88,_0x38b3f9){_0xc10a88=_0xc10a88-0x0;var _0x263183=_0x80be[_0xc10a88];return _0x263183;};'use strict';var _=require('lodash');var util=require(_0xe80b('0x0'));var moment=require(_0xe80b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe80b('0x2'));var db=require(_0xe80b('0x3'))['db'];var utils=require(_0xe80b('0x4'));var logger=require(_0xe80b('0x5'))(_0xe80b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe80b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13384d,_0x593174,_0x1d5182){return new BPromise(function(_0x1a276a,_0x115012){return client['request'](_0x13384d,_0x1d5182)[_0xe80b('0x8')](function(_0x2f6d21){logger['info'](_0xe80b('0x9'),_0x593174,'request\x20sent');logger[_0xe80b('0xa')](_0xe80b('0xb'),_0x593174,_0xe80b('0xc'),JSON[_0xe80b('0xd')](_0x2f6d21));if(_0x2f6d21['error']){if(_0x2f6d21[_0xe80b('0xe')]['code']===0x1f4){logger[_0xe80b('0xe')](_0xe80b('0x9'),_0x593174,_0x2f6d21[_0xe80b('0xe')][_0xe80b('0xf')]);return _0x115012(_0x2f6d21[_0xe80b('0xe')]['message']);}logger['error'](_0xe80b('0x9'),_0x593174,_0x2f6d21['error'][_0xe80b('0xf')]);return _0x1a276a(_0x2f6d21[_0xe80b('0xe')][_0xe80b('0xf')]);}else{logger[_0xe80b('0x10')](_0xe80b('0x9'),_0x593174,_0xe80b('0xc'));_0x1a276a(_0x2f6d21[_0xe80b('0x11')]['message']);}})[_0xe80b('0x12')](function(_0x59c412){logger[_0xe80b('0xe')](_0xe80b('0x9'),_0x593174,_0x59c412);_0x115012(_0x59c412);});});}exports['CreateVoiceDialReport']=function(_0x527e22){var _0x2e3463=this;return new Promise(function(_0x22c09c,_0x3e1360){return db[_0xe80b('0x13')]['create'](_0x527e22['body'],{'raw':_0x527e22[_0xe80b('0x14')]?_0x527e22[_0xe80b('0x14')][_0xe80b('0x15')]===undefined?!![]:![]:!![]})[_0xe80b('0x8')](function(_0x2b709a){logger['info'](_0xe80b('0x16'),_0x527e22);logger[_0xe80b('0xa')](_0xe80b('0x16'),_0x527e22,JSON['stringify'](_0x2b709a));_0x22c09c(_0x2b709a);})[_0xe80b('0x12')](function(_0x109f54){logger['error'](_0xe80b('0x16'),_0x109f54[_0xe80b('0xf')],_0x527e22);_0x3e1360(_0x2e3463[_0xe80b('0xe')](0x1f4,_0x109f54['message']));});});};exports[_0xe80b('0x17')]=function(_0x28f090){var _0x335e17=this;return new Promise(function(_0xae2356,_0x232605){return db[_0xe80b('0x13')][_0xe80b('0x18')](_0x28f090[_0xe80b('0x19')],{'raw':_0x28f090[_0xe80b('0x14')]?_0x28f090[_0xe80b('0x14')][_0xe80b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28f090[_0xe80b('0x14')]?_0x28f090[_0xe80b('0x14')][_0xe80b('0x1a')]||null:null,'attributes':_0x28f090[_0xe80b('0x14')]?_0x28f090['options'][_0xe80b('0x1b')]||null:null,'limit':_0x28f090[_0xe80b('0x14')]?_0x28f090[_0xe80b('0x14')]['limit']||null:null})['then'](function(_0x102379){logger['info'](_0xe80b('0x17'),_0x28f090);logger[_0xe80b('0xa')]('UpdateVoiceDialReport',_0x28f090,JSON[_0xe80b('0xd')](_0x102379));_0xae2356(_0x102379);})[_0xe80b('0x12')](function(_0x3b771d){logger[_0xe80b('0xe')](_0xe80b('0x17'),_0x3b771d[_0xe80b('0xf')],_0x28f090);_0x232605(_0x335e17[_0xe80b('0xe')](0x1f4,_0x3b771d['message']));});});}; \ No newline at end of file +var _0x2727=['debug','code','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ecd12,_0x5826dd){var _0x348b09=function(_0x45243b){while(--_0x45243b){_0x1ecd12['push'](_0x1ecd12['shift']());}};_0x348b09(++_0x5826dd);}(_0x2727,0x8a));var _0x7272=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x2727[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x7272('0x0'));var util=require(_0x7272('0x1'));var moment=require(_0x7272('0x2'));var BPromise=require(_0x7272('0x3'));var rs=require(_0x7272('0x4'));var fs=require('fs');var Redis=require(_0x7272('0x5'));var db=require(_0x7272('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7272('0x7'))(_0x7272('0x8'));var config=require(_0x7272('0x9'));var jayson=require(_0x7272('0xa'));var client=jayson[_0x7272('0xb')][_0x7272('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x597ac3,_0x4c250a,_0x31e69f){return new BPromise(function(_0x4144e0,_0x264bff){return client[_0x7272('0xd')](_0x597ac3,_0x31e69f)[_0x7272('0xe')](function(_0x443c59){logger['info'](_0x7272('0xf'),_0x4c250a,_0x7272('0x10'));logger[_0x7272('0x11')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4c250a,_0x7272('0x10'),JSON['stringify'](_0x443c59));if(_0x443c59['error']){if(_0x443c59['error'][_0x7272('0x12')]===0x1f4){logger[_0x7272('0x13')](_0x7272('0xf'),_0x4c250a,_0x443c59[_0x7272('0x13')]['message']);return _0x264bff(_0x443c59[_0x7272('0x13')]['message']);}logger['error'](_0x7272('0xf'),_0x4c250a,_0x443c59[_0x7272('0x13')][_0x7272('0x14')]);return _0x4144e0(_0x443c59['error']['message']);}else{logger[_0x7272('0x15')](_0x7272('0xf'),_0x4c250a,_0x7272('0x10'));_0x4144e0(_0x443c59[_0x7272('0x16')][_0x7272('0x14')]);}})[_0x7272('0x17')](function(_0x441f9d){logger[_0x7272('0x13')](_0x7272('0xf'),_0x4c250a,_0x441f9d);_0x264bff(_0x441f9d);});});}exports[_0x7272('0x18')]=function(_0x2f5831){var _0x53b7fb=this;return new Promise(function(_0x35c5e0,_0x1f7a8b){return db[_0x7272('0x19')][_0x7272('0x1a')](_0x2f5831['body'],{'raw':_0x2f5831[_0x7272('0x1b')]?_0x2f5831[_0x7272('0x1b')][_0x7272('0x1c')]===undefined?!![]:![]:!![]})[_0x7272('0xe')](function(_0x30db62){logger[_0x7272('0x15')](_0x7272('0x18'),_0x2f5831);logger[_0x7272('0x11')](_0x7272('0x18'),_0x2f5831,JSON['stringify'](_0x30db62));_0x35c5e0(_0x30db62);})['catch'](function(_0x50218e){logger[_0x7272('0x13')]('CreateVoiceDialReport',_0x50218e[_0x7272('0x14')],_0x2f5831);_0x1f7a8b(_0x53b7fb[_0x7272('0x13')](0x1f4,_0x50218e[_0x7272('0x14')]));});});};exports[_0x7272('0x1d')]=function(_0x267d3c){var _0x49b509=this;return new Promise(function(_0x2a9bac,_0x499ed5){return db[_0x7272('0x19')][_0x7272('0x1e')](_0x267d3c['body'],{'raw':_0x267d3c[_0x7272('0x1b')]?_0x267d3c[_0x7272('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267d3c[_0x7272('0x1b')]?_0x267d3c[_0x7272('0x1b')]['where']||null:null,'attributes':_0x267d3c['options']?_0x267d3c[_0x7272('0x1b')]['attributes']||null:null,'limit':_0x267d3c[_0x7272('0x1b')]?_0x267d3c['options']['limit']||null:null})['then'](function(_0x51003a){logger[_0x7272('0x15')](_0x7272('0x1d'),_0x267d3c);logger[_0x7272('0x11')](_0x7272('0x1d'),_0x267d3c,JSON['stringify'](_0x51003a));_0x2a9bac(_0x51003a);})[_0x7272('0x17')](function(_0x28ff5e){logger[_0x7272('0x13')](_0x7272('0x1d'),_0x28ff5e[_0x7272('0x14')],_0x267d3c);_0x499ed5(_0x49b509[_0x7272('0x13')](0x1f4,_0x28ff5e[_0x7272('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 09cc320..0b16064 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 _0x32a5=['./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20e17d,_0x892f37){var _0x147118=function(_0xf3816a){while(--_0xf3816a){_0x20e17d['push'](_0x20e17d['shift']());}};_0x147118(++_0x892f37);}(_0x32a5,0xd3));var _0x532a=function(_0x33511f,_0x8dad3c){_0x33511f=_0x33511f-0x0;var _0x41207c=_0x32a5[_0x33511f];return _0x41207c;};'use strict';var multer=require('multer');var util=require(_0x532a('0x0'));var path=require(_0x532a('0x1'));var timeout=require(_0x532a('0x2'));var express=require(_0x532a('0x3'));var router=express[_0x532a('0x4')]();var fs_extra=require(_0x532a('0x5'));var auth=require(_0x532a('0x6'));var interaction=require(_0x532a('0x7'));var config=require(_0x532a('0x8'));var controller=require(_0x532a('0x9'));router[_0x532a('0xa')]('/',auth[_0x532a('0xb')](),controller[_0x532a('0xc')]);router['get'](_0x532a('0xd'),auth[_0x532a('0xb')](),controller[_0x532a('0xe')]);router[_0x532a('0xf')]('/',auth['isAuthenticated'](),controller[_0x532a('0x10')]);router['post'](_0x532a('0x11'),auth[_0x532a('0xb')](),controller[_0x532a('0x12')]);router[_0x532a('0x13')](_0x532a('0xd'),auth[_0x532a('0xb')](),controller['update']);router[_0x532a('0x14')](_0x532a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x532a('0x15')]=router; \ No newline at end of file +var _0xd09d=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x48f791,_0x57dbd7){var _0x5ec5ea=function(_0x1b8718){while(--_0x1b8718){_0x48f791['push'](_0x48f791['shift']());}};_0x5ec5ea(++_0x57dbd7);}(_0xd09d,0xe0));var _0xdd09=function(_0xaf087f,_0x2ab90b){_0xaf087f=_0xaf087f-0x0;var _0x183eaa=_0xd09d[_0xaf087f];return _0x183eaa;};'use strict';var multer=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var path=require('path');var timeout=require(_0xdd09('0x2'));var express=require(_0xdd09('0x3'));var router=express[_0xdd09('0x4')]();var fs_extra=require(_0xdd09('0x5'));var auth=require(_0xdd09('0x6'));var interaction=require(_0xdd09('0x7'));var config=require('../../config/environment');var controller=require(_0xdd09('0x8'));router[_0xdd09('0x9')]('/',auth[_0xdd09('0xa')](),controller[_0xdd09('0xb')]);router[_0xdd09('0x9')](_0xdd09('0xc'),auth[_0xdd09('0xa')](),controller[_0xdd09('0xd')]);router[_0xdd09('0xe')]('/',auth[_0xdd09('0xa')](),controller[_0xdd09('0xf')]);router[_0xdd09('0xe')]('/:id/applications',auth[_0xdd09('0xa')](),controller['addApplications']);router['put'](_0xdd09('0xc'),auth[_0xdd09('0xa')](),controller[_0xdd09('0x10')]);router[_0xdd09('0x11')](_0xdd09('0xc'),auth[_0xdd09('0xa')](),controller[_0xdd09('0x12')]);module[_0xdd09('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 7e38c58..b45a7e5 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 _0x8412=['system','*,*,*,*','BOOLEAN','wav','exten','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax'];(function(_0xa51c4d,_0x585e16){var _0xf5e1a0=function(_0x4a4a75){while(--_0x4a4a75){_0xa51c4d['push'](_0xa51c4d['shift']());}};_0xf5e1a0(++_0x585e16);}(_0x8412,0x130));var _0x2841=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x8412[_0x25b24a];return _0x224e68;};'use strict';var Sequelize=require('sequelize');module[_0x2841('0x0')]={'context':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'unique':_0x2841('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'unique':_0x2841('0x2')},'priority':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x2841('0x2')},'tag':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'defaultValue':_0x2841('0x3')},'appdata':{'type':Sequelize[_0x2841('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x2841('0x4'),_0x2841('0x5'),_0x2841('0x6'),_0x2841('0x7'),'outbound-fax',_0x2841('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x2841('0x1')]},'interval':{'type':Sequelize[_0x2841('0x1')],'allowNull':![],'defaultValue':_0x2841('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x2841('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2841('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2841('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x2841('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x2841('0x1')],'defaultValue':_0x2841('0xb')},'answer':{'type':Sequelize[_0x2841('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1ced28){return this['getDataValue'](_0x2841('0xc'));}},'alias':{'type':Sequelize[_0x2841('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd244=['INTEGER','wav','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN'];(function(_0x1f83a7,_0x202444){var _0x5a1e5e=function(_0x1cd413){while(--_0x1cd413){_0x1f83a7['push'](_0x1f83a7['shift']());}};_0x5a1e5e(++_0x202444);}(_0xd244,0x1c6));var _0x4d24=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xd244[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x4d24('0x0'));module[_0x4d24('0x1')]={'context':{'type':Sequelize[_0x4d24('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x4d24('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4d24('0x3')},'tag':{'type':Sequelize[_0x4d24('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4d24('0x2')],'allowNull':![],'defaultValue':_0x4d24('0x4')},'appdata':{'type':Sequelize[_0x4d24('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4d24('0x5')]('inbound',_0x4d24('0x6'),_0x4d24('0x7'),_0x4d24('0x8'),_0x4d24('0x9'),_0x4d24('0xa'),_0x4d24('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x4d24('0x2')]},'interval':{'type':Sequelize[_0x4d24('0x2')],'allowNull':![],'defaultValue':_0x4d24('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x4d24('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x4d24('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4d24('0xe')]},'recordingFormat':{'type':Sequelize[_0x4d24('0x2')],'defaultValue':_0x4d24('0xf')},'answer':{'type':Sequelize[_0x4d24('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x368527){return this[_0x4d24('0x10')](_0x4d24('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 68d4741..05e7bd0 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 _0x59dd=['update','description','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','finally','ioredis','api','../../config/environment','defaults','redis','localhost','./voiceExtension.socket','register','status','end','offset','limit','undefined','count','Content-Range','json','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','type','find','name','UserProfileResource','destroy','then','sendStatus','error','stack','send','map','VoiceExtension','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4e1215,_0x4a8b15){var _0x563cd5=function(_0x173f91){while(--_0x173f91){_0x4e1215['push'](_0x4e1215['shift']());}};_0x563cd5(++_0x4a8b15);}(_0x59dd,0x67));var _0xd59d=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x59dd[_0x11c573];return _0x6b72de;};'use strict';var _=require('lodash');var Redis=require(_0xd59d('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd59d('0x1'));var config=require(_0xd59d('0x2'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd59d('0x3')](config[_0xd59d('0x4')],{'host':_0xd59d('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd59d('0x4')]));require(_0xd59d('0x6'))[_0xd59d('0x7')](socket);function respondWithStatusCode(_0x331d2b,_0x20627b){_0x20627b=_0x20627b||0xcc;return function(_0x339fe7){if(_0x339fe7){return _0x331d2b['sendStatus'](_0x20627b);}return _0x331d2b[_0xd59d('0x8')](_0x20627b)[_0xd59d('0x9')]();};}function respondWithResult(_0x39557e,_0x2fa6f7){_0x2fa6f7=_0x2fa6f7||0xc8;return function(_0x12fd69){if(_0x12fd69){return _0x39557e[_0xd59d('0x8')](_0x2fa6f7)['json'](_0x12fd69);}};}function respondWithFilteredResult(_0x3e4154,_0x4c5aeb){return function(_0xc0d0f9){if(_0xc0d0f9){var _0x132953=typeof _0x4c5aeb[_0xd59d('0xa')]==='undefined'&&typeof _0x4c5aeb[_0xd59d('0xb')]===_0xd59d('0xc');var _0xca4db9=_0xc0d0f9[_0xd59d('0xd')];var _0x286553=_0x132953?0x0:_0x4c5aeb[_0xd59d('0xa')];var _0x560757=_0x132953?_0xc0d0f9['count']:_0x4c5aeb[_0xd59d('0xa')]+_0x4c5aeb[_0xd59d('0xb')];var _0xea3a27;if(_0x560757>=_0xca4db9){_0x560757=_0xca4db9;_0xea3a27=0xc8;}else{_0xea3a27=0xce;}_0x3e4154[_0xd59d('0x8')](_0xea3a27);return _0x3e4154['set'](_0xd59d('0xe'),_0x286553+'-'+_0x560757+'/'+_0xca4db9)[_0xd59d('0xf')](_0xc0d0f9);}return null;};}function removeEntity(_0x3fa573){return function(_0x4a5305){if(_0x4a5305){return _0x4a5305['destroy']()['then'](function(){var _0x51bfec=_0x4a5305[_0xd59d('0x10')]({'plain':!![]});var _0x3d2312=[{'name':_0xd59d('0x11'),'value':_0xd59d('0x12'),'ignore':![]},{'name':_0xd59d('0x13'),'value':_0xd59d('0x14'),'ignore':![]},{'name':_0xd59d('0x15'),'value':_0xd59d('0x16'),'ignore':![]}];var _0x1037f6=_(_0x3d2312)[_0xd59d('0x17')](_0xd59d('0x18'))['map'](_0xd59d('0x19'))[_0xd59d('0x19')]();if(_['includes'](_0x1037f6,_0x51bfec[_0xd59d('0x1a')])){return;}var _0x2a58ce=_[_0xd59d('0x1b')](_0x3d2312,[_0xd59d('0x19'),_0x51bfec[_0xd59d('0x1a')]])[_0xd59d('0x1c')];return db[_0xd59d('0x1d')][_0xd59d('0x1e')]({'where':{'type':_0x2a58ce,'resourceId':_0x51bfec['id']}})[_0xd59d('0x1f')](function(){return _0x4a5305;});})[_0xd59d('0x1f')](function(){_0x3fa573['status'](0xcc)[_0xd59d('0x9')]();});}};}function handleEntityNotFound(_0x3da548){return function(_0x259aa0){if(!_0x259aa0){_0x3da548[_0xd59d('0x20')](0x194);}return _0x259aa0;};}function handleError(_0x500a11,_0x4ad153){_0x4ad153=_0x4ad153||0x1f4;return function(_0xaf232e){logger[_0xd59d('0x21')](_0xaf232e[_0xd59d('0x22')]);if(_0xaf232e[_0xd59d('0x1c')]){delete _0xaf232e[_0xd59d('0x1c')];}_0x500a11[_0xd59d('0x8')](_0x4ad153)[_0xd59d('0x23')](_0xaf232e);};}exports['index']=function(_0x3dcd91,_0x5af2a0){var _0xff85a={},_0x1b00f0={},_0x496097={'count':0x0,'rows':[]};var _0x2edaa5=_[_0xd59d('0x24')](db[_0xd59d('0x25')]['rawAttributes'],function(_0x1b81ea){return{'name':_0x1b81ea['fieldName'],'type':_0x1b81ea['type'][_0xd59d('0x26')]};});_0x1b00f0[_0xd59d('0x27')]=_['map'](_0x2edaa5,_0xd59d('0x1c'));_0x1b00f0[_0xd59d('0x28')]=_[_0xd59d('0x29')](_0x3dcd91[_0xd59d('0x28')]);_0x1b00f0[_0xd59d('0x2a')]=_['intersection'](_0x1b00f0[_0xd59d('0x27')],_0x1b00f0[_0xd59d('0x28')]);_0xff85a[_0xd59d('0x2b')]=_[_0xd59d('0x2c')](_0x1b00f0[_0xd59d('0x27')],qs[_0xd59d('0x2d')](_0x3dcd91[_0xd59d('0x28')]['fields']));_0xff85a[_0xd59d('0x2b')]=_0xff85a[_0xd59d('0x2b')][_0xd59d('0x2e')]?_0xff85a[_0xd59d('0x2b')]:_0x1b00f0['model'];if(!_0x3dcd91['query'][_0xd59d('0x2f')](_0xd59d('0x30'))){_0xff85a['limit']=qs[_0xd59d('0xb')](_0x3dcd91[_0xd59d('0x28')][_0xd59d('0xb')]);_0xff85a['offset']=qs[_0xd59d('0xa')](_0x3dcd91['query'][_0xd59d('0xa')]);}_0xff85a[_0xd59d('0x31')]=qs[_0xd59d('0x32')](_0x3dcd91[_0xd59d('0x28')]['sort']);_0xff85a[_0xd59d('0x33')]=qs[_0xd59d('0x2a')](_[_0xd59d('0x34')](_0x3dcd91['query'],_0x1b00f0[_0xd59d('0x2a')]),_0x2edaa5);if(_0x3dcd91[_0xd59d('0x28')][_0xd59d('0x17')]){_0xff85a[_0xd59d('0x33')]=_[_0xd59d('0x35')](_0xff85a[_0xd59d('0x33')],{'$or':_['map'](_0x2edaa5,function(_0x4e1ccf){if(_0x4e1ccf[_0xd59d('0x1a')]!=='VIRTUAL'){var _0xee1260={};_0xee1260[_0x4e1ccf[_0xd59d('0x1c')]]={'$like':'%'+_0x3dcd91[_0xd59d('0x28')]['filter']+'%'};return _0xee1260;}})});}_0xff85a=_[_0xd59d('0x35')]({},_0xff85a,_0x3dcd91[_0xd59d('0x36')]);var _0x1e2df5={'where':_0xff85a['where']};return db[_0xd59d('0x25')][_0xd59d('0xd')](_0x1e2df5)[_0xd59d('0x1f')](function(_0x3795b1){_0x496097[_0xd59d('0xd')]=_0x3795b1;if(_0x3dcd91[_0xd59d('0x28')][_0xd59d('0x37')]){_0xff85a[_0xd59d('0x38')]=[{'all':!![]}];}return db[_0xd59d('0x25')][_0xd59d('0x39')](_0xff85a);})['then'](function(_0x439e89){_0x496097[_0xd59d('0x3a')]=_0x439e89;return _0x496097;})[_0xd59d('0x1f')](respondWithFilteredResult(_0x5af2a0,_0xff85a))[_0xd59d('0x3b')](handleError(_0x5af2a0,null));};exports[_0xd59d('0x3c')]=function(_0x41fcec,_0x59d343){var _0x30bc52={'raw':![],'where':{'id':_0x41fcec[_0xd59d('0x3d')]['id']}},_0x13abec={};_0x13abec[_0xd59d('0x27')]=_['keys'](db[_0xd59d('0x25')]['rawAttributes']);_0x13abec[_0xd59d('0x28')]=_[_0xd59d('0x29')](_0x41fcec['query']);_0x13abec['filters']=_['intersection'](_0x13abec[_0xd59d('0x27')],_0x13abec[_0xd59d('0x28')]);_0x30bc52['attributes']=_[_0xd59d('0x2c')](_0x13abec['model'],qs[_0xd59d('0x2d')](_0x41fcec[_0xd59d('0x28')][_0xd59d('0x2d')]));_0x30bc52[_0xd59d('0x2b')]=_0x30bc52[_0xd59d('0x2b')][_0xd59d('0x2e')]?_0x30bc52['attributes']:_0x13abec[_0xd59d('0x27')];if(_0x41fcec[_0xd59d('0x28')]['includeAll']){_0x30bc52[_0xd59d('0x38')]=[{'all':!![]}];}_0x30bc52=_[_0xd59d('0x35')]({},_0x30bc52,_0x41fcec[_0xd59d('0x36')]);return db[_0xd59d('0x25')]['find'](_0x30bc52)['then'](handleEntityNotFound(_0x59d343,null))[_0xd59d('0x1f')](respondWithResult(_0x59d343,null))[_0xd59d('0x3b')](handleError(_0x59d343,null));};exports[_0xd59d('0x1e')]=function(_0x2bc065,_0x94361d){return db[_0xd59d('0x25')][_0xd59d('0x1b')]({'where':{'id':_0x2bc065[_0xd59d('0x3d')]['id']}})[_0xd59d('0x1f')](handleEntityNotFound(_0x94361d,null))[_0xd59d('0x1f')](removeEntity(_0x94361d,null))[_0xd59d('0x3b')](handleError(_0x94361d,null));};exports['create']=function(_0x40bb5f,_0x1be4ee){if(_0x40bb5f[_0xd59d('0x3e')][_0xd59d('0x1a')]==='outbound'&&!_[_0xd59d('0x3f')](_0x40bb5f['body'][_0xd59d('0x40')],'_')){_0x40bb5f[_0xd59d('0x3e')][_0xd59d('0x40')]='_'[_0xd59d('0x41')](_0x40bb5f['body'][_0xd59d('0x40')]);}return db[_0xd59d('0x25')][_0xd59d('0x42')](_0x40bb5f[_0xd59d('0x3e')],{'raw':![]})['then'](function(_0x5d63da){var _0x503560=_0x40bb5f[_0xd59d('0x43')][_0xd59d('0x10')]({'plain':!![]});if(!_0x503560)throw new Error(_0xd59d('0x44'));if(_0x503560[_0xd59d('0x45')]==='user'){var _0x4650e5=_0x5d63da[_0xd59d('0x10')]({'plain':!![]});var _0x4bff5a=[{'name':_0xd59d('0x11'),'value':_0xd59d('0x12')},{'name':_0xd59d('0x13'),'value':_0xd59d('0x14')},{'name':_0xd59d('0x15'),'value':_0xd59d('0x16')}];var _0x58b60f=_[_0xd59d('0x1b')](_0x4bff5a,[_0xd59d('0x19'),_0x4650e5[_0xd59d('0x1a')]])['name'];return db[_0xd59d('0x46')]['find']({'where':{'name':_0x58b60f,'userProfileId':_0x503560[_0xd59d('0x47')]},'raw':!![]})[_0xd59d('0x1f')](function(_0x1772ab){if(_0x1772ab&&_0x1772ab['autoAssociation']===0x0){return db[_0xd59d('0x1d')][_0xd59d('0x42')]({'name':_0x4650e5['name'],'resourceId':_0x4650e5['id'],'type':_0x1772ab[_0xd59d('0x1c')],'sectionId':_0x1772ab['id']},{})[_0xd59d('0x1f')](function(){return _0x5d63da;});}else{return _0x5d63da;}})[_0xd59d('0x3b')](function(_0x15762a){logger[_0xd59d('0x21')](_0xd59d('0x48'),_0x15762a);throw _0x15762a;});}return _0x5d63da;})[_0xd59d('0x1f')](respondWithResult(_0x1be4ee,0xc9))[_0xd59d('0x3b')](handleError(_0x1be4ee,null));};exports[_0xd59d('0x49')]=function(_0x2532cf,_0x1f01ea){if(_0x2532cf[_0xd59d('0x3e')]['id']){delete _0x2532cf[_0xd59d('0x3e')]['id'];}return db[_0xd59d('0x25')]['find']({'where':{'id':_0x2532cf['params']['id']}})['then'](handleEntityNotFound(_0x1f01ea,null))[_0xd59d('0x1f')](function(_0x4ffc75){if(_0x4ffc75){return db['VoiceExtension']['update'](_['pick'](_0x2532cf['body'],['exten','context',_0xd59d('0x4a'),'recordingFormat','cutdigits',_0xd59d('0x4b'),_0xd59d('0x4c')]),{'where':{'context':_0x4ffc75[_0xd59d('0x4d')],'exten':_0x4ffc75['exten']},'individualHooks':!![]})[_0xd59d('0x1f')](function(_0x5ce69d){return _0x5ce69d;});}return null;})[_0xd59d('0x1f')](respondWithStatusCode(_0x1f01ea,null))[_0xd59d('0x3b')](handleError(_0x1f01ea,null));};exports[_0xd59d('0x4e')]=function(_0x1bbff2,_0x1a579e){var _0x663e1e=_0x1bbff2[_0xd59d('0x3d')]['id'];var _0x345ebd=_0x1bbff2[_0xd59d('0x3e')];var _0x46341a=0xc8;var _0x239302=null;return db[_0xd59d('0x4f')][_0xd59d('0x50')]({'isolationLevel':db[_0xd59d('0x4f')]['Transaction'][_0xd59d('0x51')]['READ_COMMITTED']},function(_0x12dfae){return db['VoiceExtension'][_0xd59d('0x52')]({'where':{'id':_0x663e1e},'transaction':_0x12dfae})[_0xd59d('0x1f')](function(_0x711b55){if(_0x711b55){return db['VoiceExtension'][_0xd59d('0x1e')]({'where':{'VoiceExtensionId':_0x663e1e},'transaction':_0x12dfae})[_0xd59d('0x1f')](function(){var _0x54e572=_[_0xd59d('0x24')](_0x345ebd,function(_0x367d2c){_0x367d2c[_0xd59d('0x53')]=_0x663e1e;_0x367d2c['isApp']=!![];return _0x367d2c;});return _0x711b55[_0xd59d('0x54')](_0x54e572);})[_0xd59d('0x1f')](function(_0x1d2c43){return db[_0xd59d('0x25')][_0xd59d('0x55')](_0x1d2c43,{'transaction':_0x12dfae});});}else{_0x46341a=0x194;_0x239302=[];}});})[_0xd59d('0x1f')](function(){if(_0x46341a!==0x194){return db[_0xd59d('0x25')][_0xd59d('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x663e1e},'order':'priority'})['then'](function(_0x59330e){_0x239302=_0x59330e;});}})[_0xd59d('0x3b')](function(_0x402e22){_0x46341a=0x1f4;logger['error'](_0x402e22[_0xd59d('0x22')]);if(_0x402e22[_0xd59d('0x1c')]){delete _0x402e22[_0xd59d('0x1c')];}_0x239302=_0x402e22;})[_0xd59d('0x57')](function(){if(_0x239302===null){_0x1a579e[_0xd59d('0x20')](_0x46341a);}else{if(_0x46341a===0x1f4){_0x1a579e[_0xd59d('0x8')](_0x46341a)[_0xd59d('0x23')](_0x239302);}else{_0x1a579e['status'](_0x46341a)[_0xd59d('0xf')](_0x239302);}}});}; \ No newline at end of file +var _0x73b3=['get','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','priority','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','then','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','find','value','name','UserProfileResource','error','stack','index','map','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','params','keys','body','outbound','startsWith','exten','concat','create'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0x73b3,0x6b));var _0x373b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x73b3[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x373b('0x0'));var Redis=require('ioredis');var qs=require(_0x373b('0x1'));var logger=require('../../config/logger')(_0x373b('0x2'));var config=require(_0x373b('0x3'));var db=require(_0x373b('0x4'))['db'];config['redis']=_['defaults'](config[_0x373b('0x5')],{'host':_0x373b('0x6'),'port':0x18eb});var socket=require(_0x373b('0x7'))(new Redis(config[_0x373b('0x5')]));require(_0x373b('0x8'))['register'](socket);function respondWithStatusCode(_0x54313c,_0x525e09){_0x525e09=_0x525e09||0xcc;return function(_0x34889b){if(_0x34889b){return _0x54313c[_0x373b('0x9')](_0x525e09);}return _0x54313c[_0x373b('0xa')](_0x525e09)[_0x373b('0xb')]();};}function respondWithResult(_0x317bee,_0x3a177d){_0x3a177d=_0x3a177d||0xc8;return function(_0x26bde1){if(_0x26bde1){return _0x317bee[_0x373b('0xa')](_0x3a177d)[_0x373b('0xc')](_0x26bde1);}};}function respondWithFilteredResult(_0x4e00ca,_0x56522e){return function(_0x3b5146){if(_0x3b5146){var _0x1c1fb0=typeof _0x56522e['offset']===_0x373b('0xd')&&typeof _0x56522e[_0x373b('0xe')]===_0x373b('0xd');var _0x4a1652=_0x3b5146[_0x373b('0xf')];var _0x3e3b26=_0x1c1fb0?0x0:_0x56522e[_0x373b('0x10')];var _0x13a1ad=_0x1c1fb0?_0x3b5146[_0x373b('0xf')]:_0x56522e['offset']+_0x56522e[_0x373b('0xe')];var _0x2397ab;if(_0x13a1ad>=_0x4a1652){_0x13a1ad=_0x4a1652;_0x2397ab=0xc8;}else{_0x2397ab=0xce;}_0x4e00ca[_0x373b('0xa')](_0x2397ab);return _0x4e00ca[_0x373b('0x11')](_0x373b('0x12'),_0x3e3b26+'-'+_0x13a1ad+'/'+_0x4a1652)[_0x373b('0xc')](_0x3b5146);}return null;};}function removeEntity(_0x2da64d){return function(_0x2bff2a){if(_0x2bff2a){return _0x2bff2a[_0x373b('0x13')]()[_0x373b('0x14')](function(){var _0x50d106=_0x2bff2a['get']({'plain':!![]});var _0x47b459=[{'name':'InboundRoutes','value':_0x373b('0x15'),'ignore':![]},{'name':_0x373b('0x16'),'value':'outbound','ignore':![]},{'name':_0x373b('0x17'),'value':_0x373b('0x18'),'ignore':![]}];var _0x5f3b68=_(_0x47b459)[_0x373b('0x19')](_0x373b('0x1a'))['map']('value')['value']();if(_['includes'](_0x5f3b68,_0x50d106['type'])){return;}var _0x194b2b=_[_0x373b('0x1b')](_0x47b459,[_0x373b('0x1c'),_0x50d106['type']])[_0x373b('0x1d')];return db[_0x373b('0x1e')][_0x373b('0x13')]({'where':{'type':_0x194b2b,'resourceId':_0x50d106['id']}})[_0x373b('0x14')](function(){return _0x2bff2a;});})[_0x373b('0x14')](function(){_0x2da64d[_0x373b('0xa')](0xcc)[_0x373b('0xb')]();});}};}function handleEntityNotFound(_0x50984a){return function(_0x9121fe){if(!_0x9121fe){_0x50984a[_0x373b('0x9')](0x194);}return _0x9121fe;};}function handleError(_0xfe60c0,_0x51216b){_0x51216b=_0x51216b||0x1f4;return function(_0x25e9c3){logger[_0x373b('0x1f')](_0x25e9c3[_0x373b('0x20')]);if(_0x25e9c3['name']){delete _0x25e9c3[_0x373b('0x1d')];}_0xfe60c0[_0x373b('0xa')](_0x51216b)['send'](_0x25e9c3);};}exports[_0x373b('0x21')]=function(_0xd4309,_0x3adfdc){var _0xf88524={},_0x418b3c={},_0x835a48={'count':0x0,'rows':[]};var _0x36b0b6=_[_0x373b('0x22')](db['VoiceExtension'][_0x373b('0x23')],function(_0x285879){return{'name':_0x285879[_0x373b('0x24')],'type':_0x285879[_0x373b('0x25')][_0x373b('0x26')]};});_0x418b3c[_0x373b('0x27')]=_['map'](_0x36b0b6,_0x373b('0x1d'));_0x418b3c[_0x373b('0x28')]=_['keys'](_0xd4309[_0x373b('0x28')]);_0x418b3c[_0x373b('0x29')]=_['intersection'](_0x418b3c[_0x373b('0x27')],_0x418b3c['query']);_0xf88524['attributes']=_['intersection'](_0x418b3c['model'],qs[_0x373b('0x2a')](_0xd4309[_0x373b('0x28')][_0x373b('0x2a')]));_0xf88524[_0x373b('0x2b')]=_0xf88524[_0x373b('0x2b')]['length']?_0xf88524['attributes']:_0x418b3c[_0x373b('0x27')];if(!_0xd4309[_0x373b('0x28')][_0x373b('0x2c')](_0x373b('0x2d'))){_0xf88524[_0x373b('0xe')]=qs[_0x373b('0xe')](_0xd4309[_0x373b('0x28')][_0x373b('0xe')]);_0xf88524['offset']=qs[_0x373b('0x10')](_0xd4309[_0x373b('0x28')][_0x373b('0x10')]);}_0xf88524['order']=qs['sort'](_0xd4309['query'][_0x373b('0x2e')]);_0xf88524[_0x373b('0x2f')]=qs[_0x373b('0x29')](_['pick'](_0xd4309[_0x373b('0x28')],_0x418b3c[_0x373b('0x29')]),_0x36b0b6);if(_0xd4309[_0x373b('0x28')][_0x373b('0x19')]){_0xf88524[_0x373b('0x2f')]=_[_0x373b('0x30')](_0xf88524[_0x373b('0x2f')],{'$or':_[_0x373b('0x22')](_0x36b0b6,function(_0x3dba4f){if(_0x3dba4f[_0x373b('0x25')]!==_0x373b('0x31')){var _0x2e846d={};_0x2e846d[_0x3dba4f[_0x373b('0x1d')]]={'$like':'%'+_0xd4309[_0x373b('0x28')]['filter']+'%'};return _0x2e846d;}})});}_0xf88524=_[_0x373b('0x30')]({},_0xf88524,_0xd4309[_0x373b('0x32')]);var _0x404e48={'where':_0xf88524[_0x373b('0x2f')]};return db[_0x373b('0x33')][_0x373b('0xf')](_0x404e48)['then'](function(_0x476215){_0x835a48[_0x373b('0xf')]=_0x476215;if(_0xd4309['query'][_0x373b('0x34')]){_0xf88524[_0x373b('0x35')]=[{'all':!![]}];}return db[_0x373b('0x33')]['findAll'](_0xf88524);})[_0x373b('0x14')](function(_0x31984e){_0x835a48[_0x373b('0x36')]=_0x31984e;return _0x835a48;})[_0x373b('0x14')](respondWithFilteredResult(_0x3adfdc,_0xf88524))[_0x373b('0x37')](handleError(_0x3adfdc,null));};exports[_0x373b('0x38')]=function(_0x480b52,_0x399271){var _0x574f71={'raw':![],'where':{'id':_0x480b52[_0x373b('0x39')]['id']}},_0x53b684={};_0x53b684[_0x373b('0x27')]=_[_0x373b('0x3a')](db[_0x373b('0x33')][_0x373b('0x23')]);_0x53b684[_0x373b('0x28')]=_[_0x373b('0x3a')](_0x480b52[_0x373b('0x28')]);_0x53b684['filters']=_['intersection'](_0x53b684['model'],_0x53b684[_0x373b('0x28')]);_0x574f71['attributes']=_['intersection'](_0x53b684['model'],qs[_0x373b('0x2a')](_0x480b52[_0x373b('0x28')][_0x373b('0x2a')]));_0x574f71[_0x373b('0x2b')]=_0x574f71[_0x373b('0x2b')]['length']?_0x574f71[_0x373b('0x2b')]:_0x53b684[_0x373b('0x27')];if(_0x480b52['query'][_0x373b('0x34')]){_0x574f71[_0x373b('0x35')]=[{'all':!![]}];}_0x574f71=_['merge']({},_0x574f71,_0x480b52['options']);return db['VoiceExtension'][_0x373b('0x1b')](_0x574f71)[_0x373b('0x14')](handleEntityNotFound(_0x399271,null))[_0x373b('0x14')](respondWithResult(_0x399271,null))[_0x373b('0x37')](handleError(_0x399271,null));};exports[_0x373b('0x13')]=function(_0x533754,_0x6d1a6){return db['VoiceExtension'][_0x373b('0x1b')]({'where':{'id':_0x533754[_0x373b('0x39')]['id']}})[_0x373b('0x14')](handleEntityNotFound(_0x6d1a6,null))[_0x373b('0x14')](removeEntity(_0x6d1a6,null))[_0x373b('0x37')](handleError(_0x6d1a6,null));};exports['create']=function(_0x17c91e,_0x43e32b){if(_0x17c91e[_0x373b('0x3b')][_0x373b('0x25')]===_0x373b('0x3c')&&!_[_0x373b('0x3d')](_0x17c91e[_0x373b('0x3b')][_0x373b('0x3e')],'_')){_0x17c91e['body']['exten']='_'[_0x373b('0x3f')](_0x17c91e[_0x373b('0x3b')][_0x373b('0x3e')]);}return db[_0x373b('0x33')][_0x373b('0x40')](_0x17c91e['body'],{'raw':![]})[_0x373b('0x14')](function(_0x5a0a5c){var _0x2ab10e=_0x17c91e['user'][_0x373b('0x41')]({'plain':!![]});if(!_0x2ab10e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ab10e[_0x373b('0x42')]===_0x373b('0x43')){var _0x106871=_0x5a0a5c[_0x373b('0x41')]({'plain':!![]});var _0x5c1ee7=[{'name':'InboundRoutes','value':_0x373b('0x15')},{'name':_0x373b('0x16'),'value':_0x373b('0x3c')},{'name':_0x373b('0x17'),'value':'internal'}];var _0xe80d37=_['find'](_0x5c1ee7,['value',_0x106871[_0x373b('0x25')]])[_0x373b('0x1d')];return db['UserProfileSection'][_0x373b('0x1b')]({'where':{'name':_0xe80d37,'userProfileId':_0x2ab10e[_0x373b('0x44')]},'raw':!![]})[_0x373b('0x14')](function(_0x1a977c){if(_0x1a977c&&_0x1a977c[_0x373b('0x45')]===0x0){return db[_0x373b('0x1e')][_0x373b('0x40')]({'name':_0x106871[_0x373b('0x1d')],'resourceId':_0x106871['id'],'type':_0x1a977c[_0x373b('0x1d')],'sectionId':_0x1a977c['id']},{})[_0x373b('0x14')](function(){return _0x5a0a5c;});}else{return _0x5a0a5c;}})[_0x373b('0x37')](function(_0x28800d){logger[_0x373b('0x1f')](_0x373b('0x46'),_0x28800d);throw _0x28800d;});}return _0x5a0a5c;})['then'](respondWithResult(_0x43e32b,0xc9))[_0x373b('0x37')](handleError(_0x43e32b,null));};exports[_0x373b('0x47')]=function(_0x42c3d3,_0x4ca576){if(_0x42c3d3['body']['id']){delete _0x42c3d3[_0x373b('0x3b')]['id'];}return db[_0x373b('0x33')]['find']({'where':{'id':_0x42c3d3[_0x373b('0x39')]['id']}})[_0x373b('0x14')](handleEntityNotFound(_0x4ca576,null))[_0x373b('0x14')](function(_0x3f1372){if(_0x3f1372){return db[_0x373b('0x33')]['update'](_[_0x373b('0x48')](_0x42c3d3[_0x373b('0x3b')],[_0x373b('0x3e'),_0x373b('0x49'),'description',_0x373b('0x4a'),_0x373b('0x4b'),'mandatoryDisposition','alias']),{'where':{'context':_0x3f1372['context'],'exten':_0x3f1372[_0x373b('0x3e')]},'individualHooks':!![]})[_0x373b('0x14')](function(_0x4f4d01){return _0x4f4d01;});}return null;})[_0x373b('0x14')](respondWithStatusCode(_0x4ca576,null))[_0x373b('0x37')](handleError(_0x4ca576,null));};exports[_0x373b('0x4c')]=function(_0xce925f,_0x21222f){var _0x4912c4=_0xce925f[_0x373b('0x39')]['id'];var _0x5ddc88=_0xce925f[_0x373b('0x3b')];var _0xd2911d=0xc8;var _0x52f3d7=null;return db[_0x373b('0x4d')][_0x373b('0x4e')]({'isolationLevel':db[_0x373b('0x4d')][_0x373b('0x4f')][_0x373b('0x50')]['READ_COMMITTED']},function(_0x53b26b){return db['VoiceExtension']['findOne']({'where':{'id':_0x4912c4},'transaction':_0x53b26b})[_0x373b('0x14')](function(_0x185587){if(_0x185587){return db[_0x373b('0x33')][_0x373b('0x13')]({'where':{'VoiceExtensionId':_0x4912c4},'transaction':_0x53b26b})[_0x373b('0x14')](function(){var _0x4d4e4a=_[_0x373b('0x22')](_0x5ddc88,function(_0x54eeca){_0x54eeca[_0x373b('0x51')]=_0x4912c4;_0x54eeca[_0x373b('0x52')]=!![];return _0x54eeca;});return _0x185587['createRouting'](_0x4d4e4a);})[_0x373b('0x14')](function(_0x523aeb){return db[_0x373b('0x33')][_0x373b('0x53')](_0x523aeb,{'transaction':_0x53b26b});});}else{_0xd2911d=0x194;_0x52f3d7=[];}});})['then'](function(){if(_0xd2911d!==0x194){return db[_0x373b('0x33')][_0x373b('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4912c4},'order':_0x373b('0x55')})[_0x373b('0x14')](function(_0x294a4){_0x52f3d7=_0x294a4;});}})[_0x373b('0x37')](function(_0x8154b1){_0xd2911d=0x1f4;logger[_0x373b('0x1f')](_0x8154b1['stack']);if(_0x8154b1[_0x373b('0x1d')]){delete _0x8154b1[_0x373b('0x1d')];}_0x52f3d7=_0x8154b1;})['finally'](function(){if(_0x52f3d7===null){_0x21222f[_0x373b('0x9')](_0xd2911d);}else{if(_0xd2911d===0x1f4){_0x21222f['status'](_0xd2911d)['send'](_0x52f3d7);}else{_0x21222f[_0x373b('0xa')](_0xd2911d)['json'](_0x52f3d7);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ff9ea7b..c7e2d64 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 _0xbe6e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension'];(function(_0x384769,_0x45fc0c){var _0x4c8241=function(_0x291164){while(--_0x291164){_0x384769['push'](_0x384769['shift']());}};_0x4c8241(++_0x45fc0c);}(_0xbe6e,0x1b7));var _0xebe6=function(_0x107b1b,_0x13d8b3){_0x107b1b=_0x107b1b-0x0;var _0x463f4c=_0xbe6e[_0x107b1b];return _0x463f4c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xebe6('0x0'))['db'][_0xebe6('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xebe6('0x2')](0x0);var events={'afterCreate':_0xebe6('0x3'),'afterUpdate':'update','afterDestroy':_0xebe6('0x4')};function emitEvent(_0x1457fa){return function(_0x3325ff,_0x444866,_0x46a197){VoiceExtensionEvents['emit'](_0x1457fa+':'+_0x3325ff['id'],_0x3325ff);VoiceExtensionEvents[_0xebe6('0x5')](_0x1457fa,_0x3325ff);_0x46a197(null);};}for(var e in events){if(events[_0xebe6('0x6')](e)){var event=events[e];VoiceExtension[_0xebe6('0x7')](e,emitEvent(event));}}module[_0xebe6('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc07c=['../../mysqldb','VoiceExtension','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3b40e8,_0x2f26cb){var _0x1de914=function(_0x4481ad){while(--_0x4481ad){_0x3b40e8['push'](_0x3b40e8['shift']());}};_0x1de914(++_0x2f26cb);}(_0xc07c,0x17f));var _0xcc07=function(_0x361e3b,_0x21024f){_0x361e3b=_0x361e3b-0x0;var _0x2d0880=_0xc07c[_0x361e3b];return _0x2d0880;};'use strict';var EventEmitter=require(_0xcc07('0x0'));var VoiceExtension=require(_0xcc07('0x1'))['db'][_0xcc07('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc07('0x3')};function emitEvent(_0x9f8da3){return function(_0x23bec4,_0x340c1f,_0x3bf71){VoiceExtensionEvents['emit'](_0x9f8da3+':'+_0x23bec4['id'],_0x23bec4);VoiceExtensionEvents[_0xcc07('0x4')](_0x9f8da3,_0x23bec4);_0x3bf71(null);};}for(var e in events){if(events[_0xcc07('0x5')](e)){var event=events[e];VoiceExtension[_0xcc07('0x6')](e,emitEvent(event));}}module[_0xcc07('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 0dc5ac7..73e1012 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 _0x9490=['NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','wav','options','url','split','length','name','trunk','param','prefix','phone','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','includes','app','appType','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','priority','concat','last','catch','voice_extensions','get','models','Set','CDR(type)=','type','context','exten','alias'];(function(_0x34b3a7,_0x225ce5){var _0x22bec8=function(_0x3e3ba1){while(--_0x3e3ba1){_0x34b3a7['push'](_0x34b3a7['shift']());}};_0x22bec8(++_0x225ce5);}(_0x9490,0x15c));var _0x0949=function(_0x4cb73f,_0x1b9119){_0x4cb73f=_0x4cb73f-0x0;var _0x5f5016=_0x9490[_0x4cb73f];return _0x5f5016;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x1e4821){var _0x5689d4=_0x1e4821[_0x0949('0x0')];function _0x39a812(_0x15a280){var _0x114029=0x2;var _0x438a9c=[{'type':_0x15a280['type'],'app':_0x0949('0x1'),'appdata':_0x0949('0x2')+_0x15a280[_0x0949('0x3')],'context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280[_0x0949('0x5')],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']},{'type':_0x15a280['type'],'app':_0x15a280[_0x0949('0x6')]?_0x0949('0x1'):_0x0949('0x7'),'appdata':_0x15a280['alias']?_0x0949('0x8')+_0x15a280[_0x0949('0x6')]:_0x0949('0x9'),'context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280['exten'],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']}];if(_0x15a280[_0x0949('0x3')]===_0x0949('0xa')){_0x438a9c[_0x0949('0xb')]({'type':_0x0949('0xa'),'app':_0x0949('0x1'),'appdata':_0x0949('0xc')+_0x15a280['id'],'context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280[_0x0949('0x5')],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']});}_0x438a9c[_0x0949('0xb')]({'type':_0x15a280[_0x0949('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280[_0x0949('0x5')],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']},{'type':_0x15a280[_0x0949('0x3')],'app':_0x0949('0x1'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280['exten'],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']},{'type':_0x15a280[_0x0949('0x3')],'app':_0x0949('0x1'),'appdata':_0x0949('0xd'),'context':_0x15a280[_0x0949('0x4')],'exten':_0x15a280[_0x0949('0x5')],'priority':_0x114029++,'VoiceExtensionId':_0x15a280['id']});return _0x438a9c;}function _0x2a3462(_0x39baa9){var _0x227e5b=0x2;var _0x35437d=[{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':_0x0949('0xf'),'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x39baa9[_0x0949('0x6')]?_0x0949('0x1'):_0x0949('0x7'),'appdata':_0x39baa9['alias']?_0x0949('0x8')+_0x39baa9[_0x0949('0x6')]:_0x0949('0x9'),'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':'CDR(destination)='+(_0x39baa9[_0x0949('0x10')]?'${EXTEN:'+_0x39baa9[_0x0949('0x10')]+'}':_0x0949('0x11')),'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9['exten'],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':'outbound','app':_0x0949('0x1'),'appdata':'CDR(routeid)='+_0x39baa9['id'],'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':'outbound','app':_0x0949('0x12'),'appdata':_0x0949('0x13')+(_0x227e5b+0x2)+_0x0949('0x14')+(_0x227e5b+0x1)+')','context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9['exten'],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':_0x39baa9[_0x0949('0x10')]?_0x0949('0x15')+_0x39baa9[_0x0949('0x10')]+'}':_0x0949('0x16'),'context':_0x39baa9['context'],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':'outbound','app':_0x0949('0x1'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':_0x0949('0x17'),'context':_0x39baa9['context'],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':'Set','appdata':_0x0949('0xd'),'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':_0x0949('0x18')+_0x39baa9['id'],'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']}];if(_0x39baa9['hasOwnProperty'](_0x0949('0x19'))&&_0x39baa9[_0x0949('0x19')]!==_0x0949('0x1a')){_0x35437d[_0x0949('0xb')]({'type':_0x0949('0xe'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9[_0x0949('0x5')],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']},{'type':_0x0949('0xe'),'app':_0x0949('0x1'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x39baa9[_0x0949('0x19')]||_0x0949('0x1b'),'context':_0x39baa9[_0x0949('0x4')],'exten':_0x39baa9['exten'],'priority':_0x227e5b++,'VoiceExtensionId':_0x39baa9['id']});}return _0x35437d;}function _0x204d95(_0x413859,_0x1e59c0){var _0x1e4d1f=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x0949('0x1c'),'param':0x2},{'name':_0x0949('0x1d'),'param':0x3}];var _0x3a7806={};var _0x438040=_0x1e59c0[_0x0949('0x1e')](',');var _0x4e17f8=[];for(var _0x2c76e5=0x0;_0x2c76e5<_0x1e4d1f[_0x0949('0x1f')];_0x2c76e5++){switch(_0x1e4d1f[_0x2c76e5][_0x0949('0x20')]){case'trunk':_0x3a7806[_0x0949('0x21')]=_0x438040[_0x1e4d1f[_0x2c76e5][_0x0949('0x22')]]['split']('/')[0x1];_0x3a7806['phone']=_0x438040[_0x1e4d1f[_0x2c76e5]['param']][_0x0949('0x1e')]('/')[0x2];_0x3a7806[_0x0949('0x23')]=_0x3a7806[_0x0949('0x24')]?_0x3a7806[_0x0949('0x24')][_0x0949('0x1e')]('$')[0x0]:undefined;_0x3a7806[_0x0949('0x24')]=_0x413859[_0x0949('0x10')]?(_0x3a7806[_0x0949('0x23')]||'')+'${EXTEN:'+_0x413859[_0x0949('0x10')]+'}':(_0x3a7806[_0x0949('0x23')]||'')+_0x0949('0x11');_0x4e17f8[_0x1e4d1f[_0x2c76e5][_0x0949('0x22')]]=['SIP',_0x3a7806[_0x0949('0x21')],_0x3a7806[_0x0949('0x24')]][_0x0949('0x25')]('/');break;case'options':_0x3a7806['options']=_0x438040[_0x1e4d1f[_0x2c76e5][_0x0949('0x22')]];if(_0x413859[_0x0949('0x19')]!=='none'){if(_0x3a7806['options'][_0x0949('0x26')](_0x0949('0x27'))<0x0){_0x3a7806[_0x0949('0x1c')]+=_0x0949('0x27');}}else{_0x3a7806[_0x0949('0x1c')]=_0x3a7806[_0x0949('0x1c')][_0x0949('0x28')](_0x0949('0x27'),'');}_0x4e17f8[_0x1e4d1f[_0x2c76e5]['param']]=_0x3a7806[_0x0949('0x1c')];break;default:_0x4e17f8[_0x1e4d1f[_0x2c76e5]['param']]=_0x438040[_0x1e4d1f[_0x2c76e5][_0x0949('0x22')]];}}return _0x4e17f8[_0x0949('0x25')](',');}function _0x7639c2(_0x402ffc,_0x158c27,_0xe9f590){return new Promise(function(_0xf8caaf,_0x23041a){var _0x53747f=[];if(_[_0x0949('0x29')](_0x158c27))return _0xf8caaf(_0x53747f);_0x5689d4[_0x0949('0x2a')]['findAll']({'attributes':['id','interval',_0x0949('0x2b')],'raw':!![]})[_0x0949('0x2c')](function(_0x23be14){for(var _0x46ed1d=0x0,_0x34488d=0x0;_0x46ed1d<_0x158c27[_0x0949('0x1f')];_0x46ed1d++,_0x34488d=0x0){var _0xbf9a88=_0x158c27[_0x46ed1d];var _0x3fb98b=[];var _0x178491=[];delete _0xbf9a88['id'];if(_0xbf9a88[_0x0949('0x2d')]!==_0x0949('0x2e')){_0xbf9a88['intervals']=[_0xbf9a88[_0x0949('0x2d')]];}else{_0xbf9a88[_0x0949('0x2f')]=_0xbf9a88[_0x0949('0x2b')]?_[_0x0949('0x30')](_[_0x0949('0x31')](_0x23be14,{'IntervalId':_0xbf9a88[_0x0949('0x2b')]}),_0x0949('0x2d')):[];}_0xbf9a88[_0x0949('0x4')]=_0x402ffc[_0x0949('0x4')];_0xbf9a88[_0x0949('0x5')]=_0x402ffc[_0x0949('0x5')];if(_0xbf9a88[_0x0949('0x3')])_0xbf9a88['type']=_0xbf9a88[_0x0949('0x3')][_0x0949('0x32')]();if(_0x402ffc[_0x0949('0x3')]===_0x0949('0xe')){if(_0xbf9a88['hasOwnProperty'](_0x0949('0x33'))&&_0xbf9a88[_0x0949('0x33')]&&_0xbf9a88[_0x0949('0x33')]!=='--'){_0x3fb98b['push']({'type':_0xbf9a88[_0x0949('0x3')]['toLowerCase'](),'app':_0x0949('0x1'),'appdata':_0x0949('0x34')+_0xbf9a88[_0x0949('0x33')],'context':_0x402ffc['context'],'exten':_0x402ffc[_0x0949('0x5')],'priority':_0xbf9a88['intervals'][_0x0949('0x1f')]+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});}_0x3fb98b[_0x0949('0xb')]({'type':_0xbf9a88[_0x0949('0x3')][_0x0949('0x32')](),'app':_0x0949('0x12'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0xbf9a88['callerID']?_0x0949('0x35')+_0xbf9a88[_0x0949('0x36')]+')':_0x0949('0x37')),'context':_0x402ffc[_0x0949('0x4')],'exten':_0x402ffc[_0x0949('0x5')],'priority':_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')]+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});}else{if(_0xbf9a88[_0x0949('0x38')](_0x0949('0x39'))){if(['queue','playback'][_0x0949('0x3a')](_0xbf9a88[_0x0949('0x3b')][_0x0949('0x32')]())&&_0xbf9a88[_0x0949('0x3c')]!=='custom'){if(_0xbf9a88[_0x0949('0x39')]){_0x3fb98b['push']({'type':_0xbf9a88[_0x0949('0x3')]['toLowerCase'](),'app':_0x0949('0x12'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x402ffc[_0x0949('0x4')],'exten':_0x402ffc['exten'],'priority':_0xbf9a88['intervals']['length']+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});_0x3fb98b['push']({'type':_0xbf9a88[_0x0949('0x3')]['toLowerCase'](),'app':_0x0949('0x1'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x402ffc[_0x0949('0x4')],'exten':_0x402ffc[_0x0949('0x5')],'priority':_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')]+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});}else{_0x3fb98b[_0x0949('0xb')]({'type':_0xbf9a88['type'][_0x0949('0x32')](),'app':_0x0949('0x12'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x402ffc[_0x0949('0x4')],'exten':_0x402ffc[_0x0949('0x5')],'priority':_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')]+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});_0x3fb98b[_0x0949('0xb')]({'type':_0xbf9a88['type'][_0x0949('0x32')](),'app':_0x0949('0x1'),'appdata':_0x0949('0x3d'),'context':_0x402ffc[_0x0949('0x4')],'exten':_0x402ffc[_0x0949('0x5')],'priority':_0xbf9a88[_0x0949('0x2f')]['length']+_0xe9f590+_0x34488d++,'VoiceExtensionId':_0x402ffc['id']});}}}}for(var _0x32acbf=0x0;_0x32acbf<_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')];_0x32acbf++){var _0x22be5=_0xe9f590+_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')];var _0x1ff9c8=_0x32acbf===_0xbf9a88[_0x0949('0x2f')][_0x0949('0x1f')]-0x1?_0xe9f590+_0x3fb98b[_0x0949('0x1f')]+_0x178491['length']+0x2:_0xe9f590+_0x32acbf+0x1;_0x3fb98b['splice'](_0x32acbf,0x0,{'type':_0x402ffc['type'],'app':_0x0949('0x3e'),'appdata':_0xbf9a88[_0x0949('0x2f')][_0x32acbf]+'?'+_0x402ffc['context']+_0x0949('0x3f')+_0x22be5+':'+_0x402ffc[_0x0949('0x4')]+_0x0949('0x3f')+_0x1ff9c8,'exten':_0x402ffc[_0x0949('0x5')],'context':_0x402ffc[_0x0949('0x4')],'priority':_0xe9f590+_0x32acbf,'VoiceExtensionId':_0x402ffc['id']});}if(_0xbf9a88[_0x0949('0x3c')]===_0x0949('0x40'))_0xbf9a88['appdata']=_0x204d95(_0x402ffc,_0xbf9a88['appdata']);_0xbf9a88[_0x0949('0x41')]=_0x3fb98b['length']?_['last'](_0x3fb98b)[_0x0949('0x41')]+0x1:_0xe9f590;_0x53747f=_[_0x0949('0x42')](_0x53747f,_0x3fb98b,[_0xbf9a88],_0x178491);_0xe9f590=_[_0x0949('0x43')](_0x53747f)[_0x0949('0x41')]+0x1;}return _0xf8caaf(_0x53747f);})[_0x0949('0x44')](function(_0x359837){_0x23041a(_0x359837);});});}return _0x1e4821['define']('VoiceExtension',attributes,{'tableName':_0x0949('0x45'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xb03a38){var _0x58e65f=this[_0x0949('0x46')]({'plain':!![]});var _0x128d0c=_0x58e65f[_0x0949('0x3')]==='outbound'?_0x2a3462(_0x58e65f):_0x39a812(_0x58e65f);return _0x7639c2(_0x58e65f,_0xb03a38,_[_0x0949('0x43')](_0x128d0c)[_0x0949('0x41')]+0x1)[_0x0949('0x2c')](function(_0x3505aa){var _0xcf3c73=_[_0x0949('0x42')](_0x128d0c,_0x3505aa);_0xcf3c73['push']({'type':_0x58e65f[_0x0949('0x3')],'app':'Hangup','exten':_0x58e65f['exten'],'context':_0x58e65f[_0x0949('0x4')],'priority':_[_0x0949('0x43')](_0xcf3c73)[_0x0949('0x41')]+0x1,'VoiceExtensionId':_0x58e65f['id']});return _0xcf3c73;});}}});}; \ No newline at end of file +var _0x5577=['answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','voice_extensions','get','concat','Hangup','lodash','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','url','length','name','param','split','phone','cutdigits','prefix','SIP','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','then','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','app','appType','custom'];(function(_0x1d6822,_0x5af954){var _0x28fc6a=function(_0x59ad0a){while(--_0x59ad0a){_0x1d6822['push'](_0x1d6822['shift']());}};_0x28fc6a(++_0x5af954);}(_0x5577,0x1b4));var _0x7557=function(_0x2ae9f6,_0xd4264e){_0x2ae9f6=_0x2ae9f6-0x0;var _0xc2aead=_0x5577[_0x2ae9f6];return _0xc2aead;};'use strict';var _=require(_0x7557('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x7557('0x1')]=function(_0x389954){var _0x52a8c6=_0x389954[_0x7557('0x2')];function _0x289758(_0x25c0da){var _0x3c4697=0x2;var _0x1274d5=[{'type':_0x25c0da[_0x7557('0x3')],'app':'Set','appdata':_0x7557('0x4')+_0x25c0da[_0x7557('0x3')],'context':_0x25c0da[_0x7557('0x5')],'exten':_0x25c0da[_0x7557('0x6')],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']},{'type':_0x25c0da[_0x7557('0x3')],'app':_0x25c0da[_0x7557('0x7')]?_0x7557('0x8'):_0x7557('0x9'),'appdata':_0x25c0da[_0x7557('0x7')]?_0x7557('0xa')+_0x25c0da[_0x7557('0x7')]:_0x7557('0xb'),'context':_0x25c0da[_0x7557('0x5')],'exten':_0x25c0da[_0x7557('0x6')],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']}];if(_0x25c0da[_0x7557('0x3')]==='inbound'){_0x1274d5['push']({'type':_0x7557('0xc'),'app':_0x7557('0x8'),'appdata':_0x7557('0xd')+_0x25c0da['id'],'context':_0x25c0da[_0x7557('0x5')],'exten':_0x25c0da[_0x7557('0x6')],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']});}_0x1274d5[_0x7557('0xe')]({'type':_0x25c0da[_0x7557('0x3')],'app':_0x7557('0x8'),'appdata':_0x7557('0xf'),'context':_0x25c0da[_0x7557('0x5')],'exten':_0x25c0da['exten'],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']},{'type':_0x25c0da[_0x7557('0x3')],'app':_0x7557('0x8'),'appdata':_0x7557('0x10'),'context':_0x25c0da['context'],'exten':_0x25c0da[_0x7557('0x6')],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']},{'type':_0x25c0da[_0x7557('0x3')],'app':_0x7557('0x8'),'appdata':_0x7557('0x11'),'context':_0x25c0da['context'],'exten':_0x25c0da[_0x7557('0x6')],'priority':_0x3c4697++,'VoiceExtensionId':_0x25c0da['id']});return _0x1274d5;}function _0x46057c(_0x5e13d6){var _0x4a9cae=0x2;var _0x41b3db=[{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x7557('0x13'),'context':_0x5e13d6['context'],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':'outbound','app':_0x5e13d6[_0x7557('0x7')]?_0x7557('0x8'):_0x7557('0x9'),'appdata':_0x5e13d6[_0x7557('0x7')]?'CDR(routeAlias)='+_0x5e13d6[_0x7557('0x7')]:_0x7557('0xb'),'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':'Set','appdata':'CDR(destination)='+(_0x5e13d6['cutdigits']?_0x7557('0x14')+_0x5e13d6['cutdigits']+'}':_0x7557('0x15')),'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x7557('0xd')+_0x5e13d6['id'],'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6['exten'],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':'ExecIf','appdata':_0x7557('0x16')+(_0x4a9cae+0x2)+'):Goto('+(_0x4a9cae+0x1)+')','context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x5e13d6['cutdigits']?_0x7557('0x17')+_0x5e13d6['cutdigits']+'}':_0x7557('0x18'),'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':'outbound','app':_0x7557('0x8'),'appdata':_0x7557('0xf'),'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x7557('0x19')+_0x5e13d6['id'],'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']}];if(_0x5e13d6[_0x7557('0x1a')](_0x7557('0x1b'))&&_0x5e13d6[_0x7557('0x1b')]!==_0x7557('0x1c')){_0x41b3db[_0x7557('0xe')]({'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x7557('0x1d'),'context':_0x5e13d6[_0x7557('0x5')],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']},{'type':_0x7557('0x12'),'app':_0x7557('0x8'),'appdata':_0x7557('0x1e')+_0x5e13d6[_0x7557('0x1b')]||_0x7557('0x1f'),'context':_0x5e13d6['context'],'exten':_0x5e13d6[_0x7557('0x6')],'priority':_0x4a9cae++,'VoiceExtensionId':_0x5e13d6['id']});}return _0x41b3db;}function _0x597ebc(_0x5a8b5d,_0x363457){var _0x5d3ef6=[{'name':_0x7557('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x7557('0x21'),'param':0x3}];var _0x2c4075={};var _0x146671=_0x363457['split'](',');var _0xfd1144=[];for(var _0x20c332=0x0;_0x20c332<_0x5d3ef6[_0x7557('0x22')];_0x20c332++){switch(_0x5d3ef6[_0x20c332][_0x7557('0x23')]){case _0x7557('0x20'):_0x2c4075[_0x7557('0x20')]=_0x146671[_0x5d3ef6[_0x20c332][_0x7557('0x24')]][_0x7557('0x25')]('/')[0x1];_0x2c4075['phone']=_0x146671[_0x5d3ef6[_0x20c332]['param']]['split']('/')[0x2];_0x2c4075['prefix']=_0x2c4075['phone']?_0x2c4075['phone'][_0x7557('0x25')]('$')[0x0]:undefined;_0x2c4075[_0x7557('0x26')]=_0x5a8b5d[_0x7557('0x27')]?(_0x2c4075[_0x7557('0x28')]||'')+'${EXTEN:'+_0x5a8b5d['cutdigits']+'}':(_0x2c4075[_0x7557('0x28')]||'')+_0x7557('0x15');_0xfd1144[_0x5d3ef6[_0x20c332][_0x7557('0x24')]]=[_0x7557('0x29'),_0x2c4075[_0x7557('0x20')],_0x2c4075['phone']][_0x7557('0x2a')]('/');break;case _0x7557('0x2b'):_0x2c4075[_0x7557('0x2b')]=_0x146671[_0x5d3ef6[_0x20c332][_0x7557('0x24')]];if(_0x5a8b5d[_0x7557('0x1b')]!==_0x7557('0x1c')){if(_0x2c4075[_0x7557('0x2b')]['indexOf'](_0x7557('0x2c'))<0x0){_0x2c4075[_0x7557('0x2b')]+=_0x7557('0x2c');}}else{_0x2c4075[_0x7557('0x2b')]=_0x2c4075['options'][_0x7557('0x2d')](_0x7557('0x2c'),'');}_0xfd1144[_0x5d3ef6[_0x20c332][_0x7557('0x24')]]=_0x2c4075['options'];break;default:_0xfd1144[_0x5d3ef6[_0x20c332][_0x7557('0x24')]]=_0x146671[_0x5d3ef6[_0x20c332]['param']];}}return _0xfd1144[_0x7557('0x2a')](',');}function _0x5cd244(_0x4c414a,_0x4be1af,_0x58137a){return new Promise(function(_0x2f329f,_0x199f97){var _0x1ecb28=[];if(_[_0x7557('0x2e')](_0x4be1af))return _0x2f329f(_0x1ecb28);_0x52a8c6[_0x7557('0x2f')]['findAll']({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x7557('0x30')](function(_0x3dee0c){for(var _0x346873=0x0,_0x1b8f3e=0x0;_0x346873<_0x4be1af[_0x7557('0x22')];_0x346873++,_0x1b8f3e=0x0){var _0x4bb435=_0x4be1af[_0x346873];var _0xa05bb7=[];var _0x4aaa15=[];delete _0x4bb435['id'];if(_0x4bb435[_0x7557('0x31')]!==_0x7557('0x32')){_0x4bb435[_0x7557('0x33')]=[_0x4bb435[_0x7557('0x31')]];}else{_0x4bb435[_0x7557('0x33')]=_0x4bb435[_0x7557('0x34')]?_[_0x7557('0x35')](_[_0x7557('0x36')](_0x3dee0c,{'IntervalId':_0x4bb435['IntervalId']}),_0x7557('0x31')):[];}_0x4bb435[_0x7557('0x5')]=_0x4c414a[_0x7557('0x5')];_0x4bb435['exten']=_0x4c414a[_0x7557('0x6')];if(_0x4bb435['type'])_0x4bb435['type']=_0x4bb435[_0x7557('0x3')][_0x7557('0x37')]();if(_0x4c414a[_0x7557('0x3')]===_0x7557('0x12')){if(_0x4bb435[_0x7557('0x1a')]('tag')&&_0x4bb435[_0x7557('0x38')]&&_0x4bb435[_0x7557('0x38')]!=='--'){_0xa05bb7[_0x7557('0xe')]({'type':_0x4bb435[_0x7557('0x3')][_0x7557('0x37')](),'app':_0x7557('0x8'),'appdata':_0x7557('0x39')+_0x4bb435['tag'],'context':_0x4c414a['context'],'exten':_0x4c414a['exten'],'priority':_0x4bb435['intervals'][_0x7557('0x22')]+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});}_0xa05bb7[_0x7557('0xe')]({'type':_0x4bb435[_0x7557('0x3')][_0x7557('0x37')](),'app':_0x7557('0x3a'),'appdata':_0x7557('0x3b')+(_0x4bb435[_0x7557('0x3c')]?_0x7557('0x3d')+_0x4bb435['callerID']+')':_0x7557('0x3e')),'context':_0x4c414a[_0x7557('0x5')],'exten':_0x4c414a['exten'],'priority':_0x4bb435[_0x7557('0x33')]['length']+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});}else{if(_0x4bb435[_0x7557('0x1a')]('answer')){if([_0x7557('0x3f'),_0x7557('0x40')]['includes'](_0x4bb435[_0x7557('0x41')][_0x7557('0x37')]())&&_0x4bb435[_0x7557('0x42')]!==_0x7557('0x43')){if(_0x4bb435[_0x7557('0x44')]){_0xa05bb7['push']({'type':_0x4bb435[_0x7557('0x3')][_0x7557('0x37')](),'app':_0x7557('0x3a'),'appdata':_0x7557('0x45'),'context':_0x4c414a['context'],'exten':_0x4c414a['exten'],'priority':_0x4bb435[_0x7557('0x33')]['length']+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});_0xa05bb7[_0x7557('0xe')]({'type':_0x4bb435[_0x7557('0x3')][_0x7557('0x37')](),'app':_0x7557('0x8'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4c414a[_0x7557('0x5')],'exten':_0x4c414a['exten'],'priority':_0x4bb435['intervals'][_0x7557('0x22')]+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});}else{_0xa05bb7[_0x7557('0xe')]({'type':_0x4bb435['type']['toLowerCase'](),'app':_0x7557('0x3a'),'appdata':_0x7557('0x46'),'context':_0x4c414a[_0x7557('0x5')],'exten':_0x4c414a[_0x7557('0x6')],'priority':_0x4bb435[_0x7557('0x33')][_0x7557('0x22')]+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});_0xa05bb7['push']({'type':_0x4bb435['type']['toLowerCase'](),'app':_0x7557('0x8'),'appdata':_0x7557('0x47'),'context':_0x4c414a[_0x7557('0x5')],'exten':_0x4c414a[_0x7557('0x6')],'priority':_0x4bb435[_0x7557('0x33')][_0x7557('0x22')]+_0x58137a+_0x1b8f3e++,'VoiceExtensionId':_0x4c414a['id']});}}}}for(var _0x4dfd95=0x0;_0x4dfd95<_0x4bb435[_0x7557('0x33')][_0x7557('0x22')];_0x4dfd95++){var _0x1c1a44=_0x58137a+_0x4bb435[_0x7557('0x33')][_0x7557('0x22')];var _0x3241fe=_0x4dfd95===_0x4bb435[_0x7557('0x33')][_0x7557('0x22')]-0x1?_0x58137a+_0xa05bb7['length']+_0x4aaa15['length']+0x2:_0x58137a+_0x4dfd95+0x1;_0xa05bb7[_0x7557('0x48')](_0x4dfd95,0x0,{'type':_0x4c414a['type'],'app':_0x7557('0x49'),'appdata':_0x4bb435[_0x7557('0x33')][_0x4dfd95]+'?'+_0x4c414a['context']+',${EXTEN},'+_0x1c1a44+':'+_0x4c414a['context']+_0x7557('0x4a')+_0x3241fe,'exten':_0x4c414a[_0x7557('0x6')],'context':_0x4c414a[_0x7557('0x5')],'priority':_0x58137a+_0x4dfd95,'VoiceExtensionId':_0x4c414a['id']});}if(_0x4bb435['appType']===_0x7557('0x4b'))_0x4bb435[_0x7557('0x4c')]=_0x597ebc(_0x4c414a,_0x4bb435['appdata']);_0x4bb435[_0x7557('0x4d')]=_0xa05bb7[_0x7557('0x22')]?_[_0x7557('0x4e')](_0xa05bb7)[_0x7557('0x4d')]+0x1:_0x58137a;_0x1ecb28=_['concat'](_0x1ecb28,_0xa05bb7,[_0x4bb435],_0x4aaa15);_0x58137a=_[_0x7557('0x4e')](_0x1ecb28)[_0x7557('0x4d')]+0x1;}return _0x2f329f(_0x1ecb28);})[_0x7557('0x4f')](function(_0x56d34c){_0x199f97(_0x56d34c);});});}return _0x389954['define']('VoiceExtension',attributes,{'tableName':_0x7557('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2b669a){var _0x106ec6=this[_0x7557('0x51')]({'plain':!![]});var _0x5e333c=_0x106ec6[_0x7557('0x3')]===_0x7557('0x12')?_0x46057c(_0x106ec6):_0x289758(_0x106ec6);return _0x5cd244(_0x106ec6,_0x2b669a,_[_0x7557('0x4e')](_0x5e333c)[_0x7557('0x4d')]+0x1)[_0x7557('0x30')](function(_0x58c258){var _0x7a2411=_[_0x7557('0x52')](_0x5e333c,_0x58c258);_0x7a2411['push']({'type':_0x106ec6[_0x7557('0x3')],'app':_0x7557('0x53'),'exten':_0x106ec6[_0x7557('0x6')],'context':_0x106ec6[_0x7557('0x5')],'priority':_[_0x7557('0x4e')](_0x7a2411)['priority']+0x1,'VoiceExtensionId':_0x106ec6['id']});return _0x7a2411;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 97bd640..43c7df2 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 _0x4e83=['VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceExtension.socket','request','then','info','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension'];(function(_0x5b8876,_0x4cb679){var _0x3543a4=function(_0xd166cf){while(--_0xd166cf){_0x5b8876['push'](_0x5b8876['shift']());}};_0x3543a4(++_0x4cb679);}(_0x4e83,0x1ae));var _0x34e8=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x4e83[_0x53174f];return _0x1cbd1c;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});config[_0x34e8('0x8')]=_[_0x34e8('0x9')](config[_0x34e8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x34e8('0xa'))(new Redis(config[_0x34e8('0x8')]));require(_0x34e8('0xb'))['register'](socket);function respondWithRpcPromise(_0x8ad56d,_0x1e3038,_0x42bb8d){return new BPromise(function(_0x46fe66,_0x316e99){return client[_0x34e8('0xc')](_0x8ad56d,_0x42bb8d)[_0x34e8('0xd')](function(_0x6827a3){logger[_0x34e8('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'));logger[_0x34e8('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'),JSON[_0x34e8('0x11')](_0x6827a3));if(_0x6827a3[_0x34e8('0x12')]){if(_0x6827a3[_0x34e8('0x12')][_0x34e8('0x13')]===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x316e99(_0x6827a3['error'][_0x34e8('0x15')]);}logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x46fe66(_0x6827a3['error'][_0x34e8('0x15')]);}else{logger[_0x34e8('0xe')](_0x34e8('0x14'),_0x1e3038,_0x34e8('0xf'));_0x46fe66(_0x6827a3[_0x34e8('0x16')][_0x34e8('0x15')]);}})[_0x34e8('0x17')](function(_0x3eb461){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x3eb461);_0x316e99(_0x3eb461);});});}exports[_0x34e8('0x18')]=function(_0x53b90a){var _0x37fc9e=this;return new Promise(function(_0x368706,_0xe42e15){return db[_0x34e8('0x19')][_0x34e8('0x1a')]({'raw':_0x53b90a[_0x34e8('0x1b')]?_0x53b90a[_0x34e8('0x1b')][_0x34e8('0x1c')]===undefined?!![]:![]:!![],'where':_0x53b90a['options']?_0x53b90a[_0x34e8('0x1b')][_0x34e8('0x1d')]||null:null,'attributes':_0x53b90a['options']?_0x53b90a[_0x34e8('0x1b')]['attributes']||null:null,'limit':_0x53b90a[_0x34e8('0x1b')]?_0x53b90a[_0x34e8('0x1b')][_0x34e8('0x1e')]||null:null,'include':_0x53b90a['options']?_0x53b90a['options'][_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x53b90a[_0x34e8('0x1b')][_0x34e8('0x1f')],function(_0x2e29fb){return{'model':db[_0x2e29fb[_0x34e8('0x21')]],'as':_0x2e29fb['as'],'attributes':_0x2e29fb[_0x34e8('0x22')],'include':_0x2e29fb['include']?_[_0x34e8('0x20')](_0x2e29fb[_0x34e8('0x1f')],function(_0x46c2a0){return{'model':db[_0x46c2a0[_0x34e8('0x21')]],'as':_0x46c2a0['as'],'attributes':_0x46c2a0[_0x34e8('0x22')],'include':_0x46c2a0[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x46c2a0[_0x34e8('0x1f')],function(_0x2b445a){return{'model':db[_0x2b445a[_0x34e8('0x21')]],'as':_0x2b445a['as'],'attributes':_0x2b445a[_0x34e8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x34e8('0xd')](function(_0x1df399){logger[_0x34e8('0xe')](_0x34e8('0x18'),_0x53b90a);logger[_0x34e8('0x10')](_0x34e8('0x18'),_0x53b90a,JSON['stringify'](_0x1df399));_0x368706(_0x1df399);})[_0x34e8('0x17')](function(_0x1a3146){logger['error'](_0x34e8('0x18'),_0x1a3146[_0x34e8('0x15')],_0x53b90a);_0xe42e15(_0x37fc9e[_0x34e8('0x12')](0x1f4,_0x1a3146[_0x34e8('0x15')]));});});}; \ No newline at end of file +var _0xab3f=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model'];(function(_0x24748a,_0x58183b){var _0x5700d5=function(_0x1843dc){while(--_0x1843dc){_0x24748a['push'](_0x24748a['shift']());}};_0x5700d5(++_0x58183b);}(_0xab3f,0x72));var _0xfab3=function(_0x56a967,_0x10b1ef){_0x56a967=_0x56a967-0x0;var _0xba6c98=_0xab3f[_0x56a967];return _0xba6c98;};'use strict';var _=require(_0xfab3('0x0'));var util=require('util');var moment=require(_0xfab3('0x1'));var BPromise=require(_0xfab3('0x2'));var rs=require(_0xfab3('0x3'));var fs=require('fs');var Redis=require(_0xfab3('0x4'));var db=require(_0xfab3('0x5'))['db'];var utils=require(_0xfab3('0x6'));var logger=require(_0xfab3('0x7'))(_0xfab3('0x8'));var config=require(_0xfab3('0x9'));var jayson=require(_0xfab3('0xa'));var client=jayson[_0xfab3('0xb')]['http']({'port':0x232a});config[_0xfab3('0xc')]=_[_0xfab3('0xd')](config[_0xfab3('0xc')],{'host':_0xfab3('0xe'),'port':0x18eb});var socket=require(_0xfab3('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xfab3('0x10')](socket);function respondWithRpcPromise(_0x49cf15,_0x3ffe98,_0x4c8b28){return new BPromise(function(_0x75ff5b,_0x586647){return client[_0xfab3('0x11')](_0x49cf15,_0x4c8b28)[_0xfab3('0x12')](function(_0x7a24b4){logger[_0xfab3('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x3ffe98,'request\x20sent');logger['debug'](_0xfab3('0x14'),_0x3ffe98,_0xfab3('0x15'),JSON[_0xfab3('0x16')](_0x7a24b4));if(_0x7a24b4[_0xfab3('0x17')]){if(_0x7a24b4['error']['code']===0x1f4){logger[_0xfab3('0x17')](_0xfab3('0x18'),_0x3ffe98,_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);return _0x586647(_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);}logger[_0xfab3('0x17')](_0xfab3('0x18'),_0x3ffe98,_0x7a24b4['error']['message']);return _0x75ff5b(_0x7a24b4[_0xfab3('0x17')][_0xfab3('0x19')]);}else{logger[_0xfab3('0x13')](_0xfab3('0x18'),_0x3ffe98,_0xfab3('0x15'));_0x75ff5b(_0x7a24b4[_0xfab3('0x1a')][_0xfab3('0x19')]);}})[_0xfab3('0x1b')](function(_0x228615){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x3ffe98,_0x228615);_0x586647(_0x228615);});});}exports[_0xfab3('0x1c')]=function(_0x129e58){var _0x66f055=this;return new Promise(function(_0x4944c5,_0x43d66b){return db[_0xfab3('0x1d')][_0xfab3('0x1e')]({'raw':_0x129e58[_0xfab3('0x1f')]?_0x129e58[_0xfab3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x129e58['options']?_0x129e58['options'][_0xfab3('0x20')]||null:null,'attributes':_0x129e58[_0xfab3('0x1f')]?_0x129e58[_0xfab3('0x1f')][_0xfab3('0x21')]||null:null,'limit':_0x129e58['options']?_0x129e58[_0xfab3('0x1f')][_0xfab3('0x22')]||null:null,'include':_0x129e58[_0xfab3('0x1f')]?_0x129e58[_0xfab3('0x1f')][_0xfab3('0x23')]?_['map'](_0x129e58['options'][_0xfab3('0x23')],function(_0x1d6394){return{'model':db[_0x1d6394['model']],'as':_0x1d6394['as'],'attributes':_0x1d6394['attributes'],'include':_0x1d6394[_0xfab3('0x23')]?_[_0xfab3('0x24')](_0x1d6394[_0xfab3('0x23')],function(_0x55689d){return{'model':db[_0x55689d[_0xfab3('0x25')]],'as':_0x55689d['as'],'attributes':_0x55689d[_0xfab3('0x21')],'include':_0x55689d[_0xfab3('0x23')]?_[_0xfab3('0x24')](_0x55689d['include'],function(_0x215105){return{'model':db[_0x215105[_0xfab3('0x25')]],'as':_0x215105['as'],'attributes':_0x215105[_0xfab3('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfab3('0x12')](function(_0x7e05f1){logger[_0xfab3('0x13')](_0xfab3('0x1c'),_0x129e58);logger['debug'](_0xfab3('0x1c'),_0x129e58,JSON[_0xfab3('0x16')](_0x7e05f1));_0x4944c5(_0x7e05f1);})[_0xfab3('0x1b')](function(_0x43fdab){logger[_0xfab3('0x17')]('GetVoiceExtension',_0x43fdab[_0xfab3('0x19')],_0x129e58);_0x43d66b(_0x66f055['error'](0x1f4,_0x43fdab[_0xfab3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index aaed3c6..b1ca5a5 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x814b,0x1a2));var _0xb814=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x814b[_0x3f8759];return _0x2d33ca;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x1bf01c,_0x258965){var _0x57732e=function(_0x12cacf){while(--_0x12cacf){_0x1bf01c['push'](_0x1bf01c['shift']());}};_0x57732e(++_0x258965);}(_0x7a54,0x106));var _0x47a5=function(_0x378c99,_0x20afd7){_0x378c99=_0x378c99-0x0;var _0x21dfb2=_0x7a54[_0x378c99];return _0x21dfb2;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8b63de6..c7edfb5 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 _0xf2e3=['/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get'];(function(_0xcefd66,_0x5dca27){var _0x54659c=function(_0x42a489){while(--_0x42a489){_0xcefd66['push'](_0xcefd66['shift']());}};_0x54659c(++_0x5dca27);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xf2e3[_0x44946b];return _0x249bc4;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')]('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0x13')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0x15')](_0x3f2e('0xd'),auth['isAuthenticated'](),controller[_0x3f2e('0x16')]);module[_0x3f2e('0x17')]=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xadb5,0xad));var _0x5adb=function(_0x4bb224,_0x5b1927){_0x4bb224=_0x4bb224-0x0;var _0x229d1f=_0xadb5[_0x4bb224];return _0x229d1f;};'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('./voiceMail.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')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 58cde44..de92702 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 _0x4389=['fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x2dba64,_0x40a1bf){var _0x5f554a=function(_0x4fcd21){while(--_0x4fcd21){_0x2dba64['push'](_0x2dba64['shift']());}};_0x5f554a(++_0x40a1bf);}(_0x4389,0x135));var _0x9438=function(_0x19e835,_0x1b4235){_0x19e835=_0x19e835-0x0;var _0xe659ec=_0x4389[_0x19e835];return _0xe659ec;};'use strict';var Sequelize=require('sequelize');module[_0x9438('0x0')]={'customer_id':{'type':Sequelize[_0x9438('0x1')]},'context':{'type':Sequelize[_0x9438('0x1')],'defaultValue':_0x9438('0x2'),'unique':_0x9438('0x3')},'mailbox':{'type':Sequelize[_0x9438('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x9438('0x1')]},'fullname':{'type':Sequelize[_0x9438('0x1')]},'email':{'type':Sequelize[_0x9438('0x1')],'validate':{'isEmail':!![]},'set':function(_0x37301f){this['setDataValue'](_0x9438('0x4'),typeof _0x37301f==='string'&&_0x37301f[_0x9438('0x5')]()?_0x37301f[_0x9438('0x5')]():null);}},'pager':{'type':Sequelize[_0x9438('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x9438('0x6')},'attach':{'type':Sequelize[_0x9438('0x7')]('yes','no'),'defaultValue':_0x9438('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9438('0x7')]('yes','no'),'defaultValue':_0x9438('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x9438('0x1')]},'review':{'type':Sequelize['ENUM'](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9438('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':_0x9438('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9438('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9438('0x7')](_0x9438('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x9438('0xa')},'emailsubject':{'type':Sequelize[_0x9438('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9438('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9438('0xc')],'get':function(){return this[_0x9438('0xd')](_0x9438('0xe'))+_0x9438('0xf')+this[_0x9438('0xd')](_0x9438('0x10'));}}}; \ No newline at end of file +var _0x9506=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','exports','STRING','contest_mailbox','setDataValue','trim'];(function(_0x3708da,_0x166063){var _0x4eb85e=function(_0x473491){while(--_0x473491){_0x3708da['push'](_0x3708da['shift']());}};_0x4eb85e(++_0x166063);}(_0x9506,0x175));var _0x6950=function(_0x51c5e6,_0x38a0a2){_0x51c5e6=_0x51c5e6-0x0;var _0x5967a2=_0x9506[_0x51c5e6];return _0x5967a2;};'use strict';var Sequelize=require('sequelize');module[_0x6950('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6950('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x6950('0x2')},'password':{'type':Sequelize[_0x6950('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6950('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5ef690){this[_0x6950('0x3')]('email',typeof _0x5ef690==='string'&&_0x5ef690[_0x6950('0x4')]()?_0x5ef690['trim']():null);}},'pager':{'type':Sequelize[_0x6950('0x1')]},'tz':{'type':Sequelize[_0x6950('0x1')],'defaultValue':_0x6950('0x5')},'attach':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':_0x6950('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x6950('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x6950('0x1')]},'callback':{'type':Sequelize[_0x6950('0x1')]},'review':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6950('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6950('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x6950('0x7'),'no'),'defaultValue':_0x6950('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6950('0x6')](_0x6950('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6950('0x6')]('yes','no'),'defaultValue':_0x6950('0x7'),'allowNull':![]},'stamp':{'type':_0x6950('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x6950('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6950('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6950('0xb')],'get':function(){return this['getDataValue'](_0x6950('0xc'))+'\x20-\x20'+this[_0x6950('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 41e1214..be449c9 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 _0xeb74=['VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','error','stack','name','send','map'];(function(_0x42d22d,_0x1902a5){var _0x1a9c76=function(_0x5cb6ff){while(--_0x5cb6ff){_0x42d22d['push'](_0x42d22d['shift']());}};_0x1a9c76(++_0x1902a5);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4afac7,_0x90ed75){_0x4afac7=_0x4afac7-0x0;var _0x259db6=_0xeb74[_0x4afac7];return _0x259db6;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){var _0x2e8de8=_0x4de2d9[_0x4eb7('0x27')]({'plain':!![]});var _0x3e0da2=_0x4eb7('0x28');return db[_0x4eb7('0x29')][_0x4eb7('0x26')]({'where':{'type':_0x3e0da2,'resourceId':_0x2e8de8['id']}})[_0x4eb7('0x25')](function(){return _0x4de2d9;});})[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x2a')]();});}};}function handleEntityNotFound(_0x2d1773,_0x1b56a8){return function(_0x433794){if(!_0x433794){_0x2d1773[_0x4eb7('0x2b')](0x194);}return _0x433794;};}function handleError(_0x2be00c,_0x41e515){_0x41e515=_0x41e515||0x1f4;return function(_0x33a2c1){logger[_0x4eb7('0x2c')](_0x33a2c1[_0x4eb7('0x2d')]);if(_0x33a2c1[_0x4eb7('0x2e')]){delete _0x33a2c1[_0x4eb7('0x2e')];}_0x2be00c['status'](_0x41e515)[_0x4eb7('0x2f')](_0x33a2c1);};}exports['index']=function(_0x446872,_0x13f71a){var _0xc5aa21={},_0x1fe298={},_0x468195={'count':0x0,'rows':[]};var _0x1cec8e=_[_0x4eb7('0x30')](db[_0x4eb7('0x31')][_0x4eb7('0x32')],function(_0x4f8879){return{'name':_0x4f8879[_0x4eb7('0x33')],'type':_0x4f8879['type'][_0x4eb7('0x34')]};});_0x1fe298[_0x4eb7('0x35')]=_['map'](_0x1cec8e,'name');_0x1fe298[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x446872[_0x4eb7('0x36')]);_0x1fe298[_0x4eb7('0x38')]=_['intersection'](_0x1fe298[_0x4eb7('0x35')],_0x1fe298[_0x4eb7('0x36')]);_0xc5aa21[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x1fe298[_0x4eb7('0x35')],qs['fields'](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0xc5aa21[_0x4eb7('0x39')]=_0xc5aa21['attributes'][_0x4eb7('0x3c')]?_0xc5aa21[_0x4eb7('0x39')]:_0x1fe298[_0x4eb7('0x35')];if(!_0x446872['query'][_0x4eb7('0x3d')]('nolimit')){_0xc5aa21[_0x4eb7('0x1d')]=qs[_0x4eb7('0x1d')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0xc5aa21['offset']=qs[_0x4eb7('0x1b')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0xc5aa21[_0x4eb7('0x3e')]=qs['sort'](_0x446872['query']['sort']);_0xc5aa21[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x446872[_0x4eb7('0x36')],_0x1fe298[_0x4eb7('0x38')]),_0x1cec8e);if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0xc5aa21[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0xc5aa21[_0x4eb7('0x3f')],{'$or':_['map'](_0x1cec8e,function(_0x5d0e51){if(_0x5d0e51[_0x4eb7('0x43')]!==_0x4eb7('0x44')){var _0x4597c8={};_0x4597c8[_0x5d0e51[_0x4eb7('0x2e')]]={'$like':'%'+_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x4597c8;}})});}_0xc5aa21=_[_0x4eb7('0x42')]({},_0xc5aa21,_0x446872[_0x4eb7('0x45')]);var _0x3a31ce={'where':_0xc5aa21[_0x4eb7('0x3f')]};return db[_0x4eb7('0x31')][_0x4eb7('0x1e')](_0x3a31ce)[_0x4eb7('0x25')](function(_0x38af1f){_0x468195[_0x4eb7('0x1e')]=_0x38af1f;if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0xc5aa21[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x31')]['findAll'](_0xc5aa21);})[_0x4eb7('0x25')](function(_0x2df542){_0x468195[_0x4eb7('0x48')]=_0x2df542;return _0x468195;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x13f71a,_0xc5aa21))[_0x4eb7('0x49')](handleError(_0x13f71a,null));};exports[_0x4eb7('0x4a')]=function(_0x3cd9e5,_0x10fac2){var _0x3d6b0b={'raw':!![],'where':{'id':_0x3cd9e5[_0x4eb7('0x4b')]['id']}},_0x4969eb={};_0x4969eb['model']=_[_0x4eb7('0x37')](db[_0x4eb7('0x31')][_0x4eb7('0x32')]);_0x4969eb['query']=_[_0x4eb7('0x37')](_0x3cd9e5[_0x4eb7('0x36')]);_0x4969eb[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x4969eb['model'],_0x4969eb[_0x4eb7('0x36')]);_0x3d6b0b['attributes']=_[_0x4eb7('0x3a')](_0x4969eb[_0x4eb7('0x35')],qs[_0x4eb7('0x3b')](_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x3d6b0b['attributes']=_0x3d6b0b['attributes'][_0x4eb7('0x3c')]?_0x3d6b0b[_0x4eb7('0x39')]:_0x4969eb[_0x4eb7('0x35')];if(_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0x3d6b0b['include']=[{'all':!![]}];}_0x3d6b0b=_[_0x4eb7('0x42')]({},_0x3d6b0b,_0x3cd9e5[_0x4eb7('0x45')]);return db['VoiceMail'][_0x4eb7('0x4c')](_0x3d6b0b)[_0x4eb7('0x25')](handleEntityNotFound(_0x10fac2,null))['then'](respondWithResult(_0x10fac2,null))[_0x4eb7('0x49')](handleError(_0x10fac2,null));};exports[_0x4eb7('0x4d')]=function(_0x3c8049,_0x5774d5){return db[_0x4eb7('0x31')]['create'](_0x3c8049['body'],{})[_0x4eb7('0x25')](function(_0x312e9b){var _0x32d7d6=_0x3c8049[_0x4eb7('0x4e')][_0x4eb7('0x27')]({'plain':!![]});if(!_0x32d7d6)throw new Error(_0x4eb7('0x4f'));if(_0x32d7d6[_0x4eb7('0x50')]===_0x4eb7('0x4e')){var _0x2913c5=_0x312e9b[_0x4eb7('0x27')]({'plain':!![]});var _0x42a1d9=_0x4eb7('0x28');return db[_0x4eb7('0x51')][_0x4eb7('0x4c')]({'where':{'name':_0x42a1d9,'userProfileId':_0x32d7d6[_0x4eb7('0x52')]},'raw':!![]})[_0x4eb7('0x25')](function(_0x327f1e){if(_0x327f1e&&_0x327f1e[_0x4eb7('0x53')]===0x0){return db[_0x4eb7('0x29')][_0x4eb7('0x4d')]({'name':_0x2913c5['name'],'resourceId':_0x2913c5['id'],'type':_0x327f1e[_0x4eb7('0x2e')],'sectionId':_0x327f1e['id']},{})['then'](function(){return _0x312e9b;});}else{return _0x312e9b;}})['catch'](function(_0x3f3a5f){logger[_0x4eb7('0x2c')](_0x4eb7('0x54'),_0x3f3a5f);throw _0x3f3a5f;});}return _0x312e9b;})[_0x4eb7('0x25')](respondWithResult(_0x5774d5,0xc9))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports['update']=function(_0x4e3163,_0x2e5d28){if(_0x4e3163['body']['id']){delete _0x4e3163[_0x4eb7('0x55')]['id'];}return db[_0x4eb7('0x31')][_0x4eb7('0x4c')]({'where':{'id':_0x4e3163[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e5d28,null))[_0x4eb7('0x25')](saveUpdates(_0x4e3163[_0x4eb7('0x55')],null))[_0x4eb7('0x25')](respondWithResult(_0x2e5d28,null))[_0x4eb7('0x49')](handleError(_0x2e5d28,null));};exports['destroy']=function(_0x961de5,_0x340ffb){return db['VoiceMail'][_0x4eb7('0x4c')]({'where':{'id':_0x961de5[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x340ffb,null))[_0x4eb7('0x25')](removeEntity(_0x340ffb,null))['catch'](handleError(_0x340ffb,null));};exports[_0x4eb7('0x56')]=function(_0x5be4ad,_0x13847e,_0x456fe7){return db[_0x4eb7('0x31')][_0x4eb7('0x57')]({'where':{'id':_0x5be4ad[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x13847e,null))['then'](function(_0x4a4fc5){var _0x1b8514;var _0x1b4afe={},_0x24d33d={};_0x24d33d[_0x4eb7('0x35')]=_['keys'](db[_0x4eb7('0x58')][_0x4eb7('0x32')]);_0x24d33d['query']=_[_0x4eb7('0x37')](_0x5be4ad[_0x4eb7('0x36')]);_0x24d33d[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x24d33d[_0x4eb7('0x35')],_0x24d33d[_0x4eb7('0x36')]);_0x1b4afe[_0x4eb7('0x39')]=_['intersection'](_0x24d33d['model'],qs[_0x4eb7('0x3b')](_0x5be4ad['query'][_0x4eb7('0x3b')]));_0x1b4afe['attributes']=_0x1b4afe[_0x4eb7('0x39')]['length']?_0x1b4afe['attributes']:_0x24d33d[_0x4eb7('0x35')];if(!_0x5be4ad[_0x4eb7('0x36')]['hasOwnProperty'](_0x4eb7('0x59'))){_0x1b4afe['limit']=qs[_0x4eb7('0x1d')](_0x5be4ad[_0x4eb7('0x36')]['limit']);_0x1b4afe[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x5be4ad['query']['offset']);}_0x1b4afe['order']=qs['sort'](_0x5be4ad[_0x4eb7('0x36')]['sort']);_0x1b4afe[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_['pick'](_0x5be4ad[_0x4eb7('0x36')],_0x24d33d[_0x4eb7('0x38')]));if(_0x5be4ad[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x1b4afe[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x1b4afe['where'],{'$or':_['map'](_0x1b4afe['attributes'],function(_0x58d2c1){var _0x1775c4={};_0x1775c4[_0x58d2c1]={'$like':'%'+_0x5be4ad[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x1775c4;})});}_0x1b4afe[_0x4eb7('0x3f')]=_['merge'](_0x1b4afe['where'],{'mailboxuser':_0x4a4fc5[_0x4eb7('0x5a')]});_0x1b4afe=_[_0x4eb7('0x42')]({},_0x1b4afe,_0x5be4ad[_0x4eb7('0x45')]);return db[_0x4eb7('0x58')][_0x4eb7('0x5b')](_0x1b4afe)['then'](respondWithFilteredResult(_0x13847e,_0x1b4afe));})[_0x4eb7('0x49')](handleError(_0x13847e,null));}; \ No newline at end of file +var _0x2f68=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','destroy','getMessages','findOne','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel'];(function(_0x4653b1,_0x1d8c03){var _0xe72bfb=function(_0x52e1f7){while(--_0x52e1f7){_0x4653b1['push'](_0x4653b1['shift']());}};_0xe72bfb(++_0x1d8c03);}(_0x2f68,0x9a));var _0x82f6=function(_0x102bbe,_0x30cc94){_0x102bbe=_0x102bbe-0x0;var _0x45d6ff=_0x2f68[_0x102bbe];return _0x45d6ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];function respondWithStatusCode(_0x442262,_0x4cc967){_0x4cc967=_0x4cc967||0xcc;return function(_0x194da7){if(_0x194da7){return _0x442262[_0x82f6('0x15')](_0x4cc967);}return _0x442262[_0x82f6('0x16')](_0x4cc967)[_0x82f6('0x17')]();};}function respondWithResult(_0x371481,_0xa00275){_0xa00275=_0xa00275||0xc8;return function(_0x115c7b){if(_0x115c7b){return _0x371481[_0x82f6('0x16')](_0xa00275)[_0x82f6('0x18')](_0x115c7b);}};}function respondWithFilteredResult(_0x55b58e,_0x389949){return function(_0x5d0827){if(_0x5d0827){var _0x249222=typeof _0x389949[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x389949[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x2326ae=_0x5d0827[_0x82f6('0x1c')];var _0xcbc95f=_0x249222?0x0:_0x389949[_0x82f6('0x19')];var _0x2bfd57=_0x249222?_0x5d0827[_0x82f6('0x1c')]:_0x389949[_0x82f6('0x19')]+_0x389949[_0x82f6('0x1b')];var _0x4fe226;if(_0x2bfd57>=_0x2326ae){_0x2bfd57=_0x2326ae;_0x4fe226=0xc8;}else{_0x4fe226=0xce;}_0x55b58e[_0x82f6('0x16')](_0x4fe226);return _0x55b58e['set'](_0x82f6('0x1d'),_0xcbc95f+'-'+_0x2bfd57+'/'+_0x2326ae)[_0x82f6('0x18')](_0x5d0827);}return null;};}function patchUpdates(_0x55cbce){return function(_0x2b03ad){try{jsonpatch[_0x82f6('0x1e')](_0x2b03ad,_0x55cbce,!![]);}catch(_0x46713a){return BPromise[_0x82f6('0x1f')](_0x46713a);}return _0x2b03ad['save']();};}function saveUpdates(_0xdc4dea,_0x4beccf){return function(_0x8668bb){if(_0x8668bb){return _0x8668bb[_0x82f6('0x20')](_0xdc4dea)['then'](function(_0x516deb){return _0x516deb;});}return null;};}function removeEntity(_0x3af5f7,_0x1d96d5){return function(_0x4c57c5){if(_0x4c57c5){return _0x4c57c5['destroy']()[_0x82f6('0x21')](function(){var _0x31face=_0x4c57c5['get']({'plain':!![]});var _0xfd8b68=_0x82f6('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd8b68,'resourceId':_0x31face['id']}})[_0x82f6('0x21')](function(){return _0x4c57c5;});})['then'](function(){_0x3af5f7[_0x82f6('0x16')](0xcc)[_0x82f6('0x17')]();});}};}function handleEntityNotFound(_0x54ce11,_0x3795ef){return function(_0x15c9b7){if(!_0x15c9b7){_0x54ce11[_0x82f6('0x15')](0x194);}return _0x15c9b7;};}function handleError(_0x1125a0,_0x4f9fa4){_0x4f9fa4=_0x4f9fa4||0x1f4;return function(_0x40a071){logger[_0x82f6('0x23')](_0x40a071[_0x82f6('0x24')]);if(_0x40a071[_0x82f6('0x25')]){delete _0x40a071[_0x82f6('0x25')];}_0x1125a0[_0x82f6('0x16')](_0x4f9fa4)[_0x82f6('0x26')](_0x40a071);};}exports[_0x82f6('0x27')]=function(_0x1e1aa4,_0x402449){var _0x3c9419={},_0x20d1c5={},_0x6ce179={'count':0x0,'rows':[]};var _0x91117b=_['map'](db[_0x82f6('0x28')][_0x82f6('0x29')],function(_0x418f34){return{'name':_0x418f34['fieldName'],'type':_0x418f34[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x20d1c5[_0x82f6('0x2c')]=_[_0x82f6('0x2d')](_0x91117b,_0x82f6('0x25'));_0x20d1c5[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x1e1aa4[_0x82f6('0x2e')]);_0x20d1c5[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x20d1c5[_0x82f6('0x2c')],_0x20d1c5[_0x82f6('0x2e')]);_0x3c9419[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x20d1c5['model'],qs[_0x82f6('0x33')](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x3c9419[_0x82f6('0x32')]=_0x3c9419[_0x82f6('0x32')][_0x82f6('0x34')]?_0x3c9419[_0x82f6('0x32')]:_0x20d1c5[_0x82f6('0x2c')];if(!_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x3c9419[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1e1aa4[_0x82f6('0x2e')]['limit']);_0x3c9419[_0x82f6('0x19')]=qs['offset'](_0x1e1aa4['query'][_0x82f6('0x19')]);}_0x3c9419[_0x82f6('0x37')]=qs['sort'](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x3c9419[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x3a')](_0x1e1aa4['query'],_0x20d1c5[_0x82f6('0x30')]),_0x91117b);if(_0x1e1aa4['query'][_0x82f6('0x3b')]){_0x3c9419['where']=_[_0x82f6('0x3c')](_0x3c9419[_0x82f6('0x39')],{'$or':_['map'](_0x91117b,function(_0xfce1dd){if(_0xfce1dd[_0x82f6('0x2a')]!==_0x82f6('0x3d')){var _0x43dcd1={};_0x43dcd1[_0xfce1dd['name']]={'$like':'%'+_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0x43dcd1;}})});}_0x3c9419=_[_0x82f6('0x3c')]({},_0x3c9419,_0x1e1aa4[_0x82f6('0x3e')]);var _0x55ecd4={'where':_0x3c9419[_0x82f6('0x39')]};return db[_0x82f6('0x28')]['count'](_0x55ecd4)[_0x82f6('0x21')](function(_0x699803){_0x6ce179[_0x82f6('0x1c')]=_0x699803;if(_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3f')]){_0x3c9419['include']=[{'all':!![]}];}return db[_0x82f6('0x28')]['findAll'](_0x3c9419);})[_0x82f6('0x21')](function(_0x38e82d){_0x6ce179[_0x82f6('0x40')]=_0x38e82d;return _0x6ce179;})[_0x82f6('0x21')](respondWithFilteredResult(_0x402449,_0x3c9419))[_0x82f6('0x41')](handleError(_0x402449,null));};exports[_0x82f6('0x42')]=function(_0x43fefc,_0x47a0d1){var _0x165493={'raw':!![],'where':{'id':_0x43fefc[_0x82f6('0x43')]['id']}},_0x297cda={};_0x297cda[_0x82f6('0x2c')]=_['keys'](db[_0x82f6('0x28')]['rawAttributes']);_0x297cda[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x43fefc[_0x82f6('0x2e')]);_0x297cda[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],_0x297cda['query']);_0x165493[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],qs[_0x82f6('0x33')](_0x43fefc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x165493[_0x82f6('0x32')]=_0x165493[_0x82f6('0x32')]['length']?_0x165493[_0x82f6('0x32')]:_0x297cda[_0x82f6('0x2c')];if(_0x43fefc['query'][_0x82f6('0x3f')]){_0x165493['include']=[{'all':!![]}];}_0x165493=_[_0x82f6('0x3c')]({},_0x165493,_0x43fefc['options']);return db[_0x82f6('0x28')][_0x82f6('0x44')](_0x165493)[_0x82f6('0x21')](handleEntityNotFound(_0x47a0d1,null))[_0x82f6('0x21')](respondWithResult(_0x47a0d1,null))[_0x82f6('0x41')](handleError(_0x47a0d1,null));};exports[_0x82f6('0x45')]=function(_0x53f7d4,_0x3cb1f0){return db[_0x82f6('0x28')]['create'](_0x53f7d4['body'],{})[_0x82f6('0x21')](function(_0x2a6366){var _0x2c2b64=_0x53f7d4['user'][_0x82f6('0x46')]({'plain':!![]});if(!_0x2c2b64)throw new Error(_0x82f6('0x47'));if(_0x2c2b64[_0x82f6('0x48')]===_0x82f6('0x49')){var _0x4e9e13=_0x2a6366['get']({'plain':!![]});var _0x1695ea=_0x82f6('0x22');return db[_0x82f6('0x4a')]['find']({'where':{'name':_0x1695ea,'userProfileId':_0x2c2b64[_0x82f6('0x4b')]},'raw':!![]})[_0x82f6('0x21')](function(_0x4bc646){if(_0x4bc646&&_0x4bc646['autoAssociation']===0x0){return db['UserProfileResource'][_0x82f6('0x45')]({'name':_0x4e9e13['name'],'resourceId':_0x4e9e13['id'],'type':_0x4bc646[_0x82f6('0x25')],'sectionId':_0x4bc646['id']},{})['then'](function(){return _0x2a6366;});}else{return _0x2a6366;}})[_0x82f6('0x41')](function(_0x4f69de){logger[_0x82f6('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f69de);throw _0x4f69de;});}return _0x2a6366;})[_0x82f6('0x21')](respondWithResult(_0x3cb1f0,0xc9))[_0x82f6('0x41')](handleError(_0x3cb1f0,null));};exports[_0x82f6('0x20')]=function(_0x1633cf,_0xb8d7d8){if(_0x1633cf[_0x82f6('0x4c')]['id']){delete _0x1633cf['body']['id'];}return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x1633cf[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0xb8d7d8,null))['then'](saveUpdates(_0x1633cf[_0x82f6('0x4c')],null))[_0x82f6('0x21')](respondWithResult(_0xb8d7d8,null))[_0x82f6('0x41')](handleError(_0xb8d7d8,null));};exports[_0x82f6('0x4d')]=function(_0x49a204,_0x2c1c0e){return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x49a204['params']['id']}})['then'](handleEntityNotFound(_0x2c1c0e,null))['then'](removeEntity(_0x2c1c0e,null))[_0x82f6('0x41')](handleError(_0x2c1c0e,null));};exports[_0x82f6('0x4e')]=function(_0x221cfc,_0x59176d,_0x4013f0){return db[_0x82f6('0x28')][_0x82f6('0x4f')]({'where':{'id':_0x221cfc[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0x59176d,null))[_0x82f6('0x21')](function(_0x94aed4){var _0x12a5b9;var _0x33591b={},_0x4a8bdb={};_0x4a8bdb['model']=_[_0x82f6('0x2f')](db[_0x82f6('0x50')]['rawAttributes']);_0x4a8bdb[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x221cfc[_0x82f6('0x2e')]);_0x4a8bdb['filters']=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],_0x4a8bdb[_0x82f6('0x2e')]);_0x33591b[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],qs['fields'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x33591b[_0x82f6('0x32')]=_0x33591b[_0x82f6('0x32')][_0x82f6('0x34')]?_0x33591b['attributes']:_0x4a8bdb[_0x82f6('0x2c')];if(!_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x33591b[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x1b')]);_0x33591b['offset']=qs[_0x82f6('0x19')](_0x221cfc['query'][_0x82f6('0x19')]);}_0x33591b[_0x82f6('0x37')]=qs['sort'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x33591b[_0x82f6('0x39')]=qs['filters'](_['pick'](_0x221cfc[_0x82f6('0x2e')],_0x4a8bdb[_0x82f6('0x30')]));if(_0x221cfc['query']['filter']){_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'$or':_[_0x82f6('0x2d')](_0x33591b[_0x82f6('0x32')],function(_0x11581c){var _0xc1d784={};_0xc1d784[_0x11581c]={'$like':'%'+_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0xc1d784;})});}_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'mailboxuser':_0x94aed4['mailbox']});_0x33591b=_[_0x82f6('0x3c')]({},_0x33591b,_0x221cfc[_0x82f6('0x3e')]);return db[_0x82f6('0x50')][_0x82f6('0x51')](_0x33591b)[_0x82f6('0x21')](respondWithFilteredResult(_0x59176d,_0x33591b));})['catch'](handleError(_0x59176d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index a05787b..c4c5aab 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 _0xb4f4=['mailbox_context','mailbox','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x1c0c46,_0x3b22f9){var _0x419585=function(_0x4bdc87){while(--_0x4bdc87){_0x1c0c46['push'](_0x1c0c46['shift']());}};_0x419585(++_0x3b22f9);}(_0xb4f4,0x14c));var _0x4b4f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xb4f4[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x4b4f('0x0'));var util=require('util');var logger=require(_0x4b4f('0x1'))(_0x4b4f('0x2'));var moment=require(_0x4b4f('0x3'));var BPromise=require(_0x4b4f('0x4'));var rp=require(_0x4b4f('0x5'));var fs=require('fs');var path=require(_0x4b4f('0x6'));var rimraf=require(_0x4b4f('0x7'));var config=require('../../config/environment');var attributes=require(_0x4b4f('0x8'));module[_0x4b4f('0x9')]=function(_0x2a9ecd,_0x17216b){return _0x2a9ecd[_0x4b4f('0xa')](_0x4b4f('0xb'),attributes,{'tableName':_0x4b4f('0xc'),'paranoid':![],'indexes':[{'name':_0x4b4f('0xd'),'fields':[_0x4b4f('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x345d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x345d,0x1c1));var _0xd345=function(_0x476ac4,_0x4f1a77){_0x476ac4=_0x476ac4-0x0;var _0x49c3d1=_0x345d[_0x476ac4];return _0x49c3d1;};'use strict';var _=require('lodash');var util=require(_0xd345('0x0'));var logger=require('../../config/logger')(_0xd345('0x1'));var moment=require(_0xd345('0x2'));var BPromise=require(_0xd345('0x3'));var rp=require(_0xd345('0x4'));var fs=require('fs');var path=require(_0xd345('0x5'));var rimraf=require(_0xd345('0x6'));var config=require(_0xd345('0x7'));var attributes=require('./voiceMail.attributes');module[_0xd345('0x8')]=function(_0x83fc74,_0x41f352){return _0x83fc74[_0xd345('0x9')](_0xd345('0xa'),attributes,{'tableName':_0xd345('0xb'),'paranoid':![],'indexes':[{'name':_0xd345('0xc'),'fields':[_0xd345('0xd'),_0xd345('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0d9294a..e6fbaf1 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 _0x5966=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4c3296,_0x262566){var _0x5260de=function(_0x2543c6){while(--_0x2543c6){_0x4c3296['push'](_0x4c3296['shift']());}};_0x5260de(++_0x262566);}(_0x5966,0x1e2));var _0x6596=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x5966[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0x6596('0x0'));var util=require(_0x6596('0x1'));var moment=require(_0x6596('0x2'));var BPromise=require(_0x6596('0x3'));var rs=require(_0x6596('0x4'));var fs=require('fs');var Redis=require(_0x6596('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6596('0x6'))(_0x6596('0x7'));var config=require(_0x6596('0x8'));var jayson=require(_0x6596('0x9'));var client=jayson[_0x6596('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35fd94,_0x67b3c2,_0x256038){return new BPromise(function(_0x5e26c9,_0x3c6e11){return client['request'](_0x35fd94,_0x256038)[_0x6596('0xb')](function(_0x55b469){logger[_0x6596('0xc')](_0x6596('0xd'),_0x67b3c2,_0x6596('0xe'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x67b3c2,'request\x20sent',JSON[_0x6596('0xf')](_0x55b469));if(_0x55b469[_0x6596('0x10')]){if(_0x55b469['error'][_0x6596('0x11')]===0x1f4){logger[_0x6596('0x10')](_0x6596('0xd'),_0x67b3c2,_0x55b469[_0x6596('0x10')][_0x6596('0x12')]);return _0x3c6e11(_0x55b469[_0x6596('0x10')][_0x6596('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x67b3c2,_0x55b469[_0x6596('0x10')]['message']);return _0x5e26c9(_0x55b469[_0x6596('0x10')][_0x6596('0x12')]);}else{logger[_0x6596('0xc')](_0x6596('0xd'),_0x67b3c2,_0x6596('0xe'));_0x5e26c9(_0x55b469[_0x6596('0x13')][_0x6596('0x12')]);}})[_0x6596('0x14')](function(_0x555707){logger[_0x6596('0x10')](_0x6596('0xd'),_0x67b3c2,_0x555707);_0x3c6e11(_0x555707);});});} \ No newline at end of file +var _0xeed9=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','client','http','request','VoiceMail,\x20%s,\x20%s','debug'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xeed9,0x1b7));var _0x9eed=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0xeed9[_0x5d4ca7];return _0x3efc03;};'use strict';var _=require(_0x9eed('0x0'));var util=require(_0x9eed('0x1'));var moment=require(_0x9eed('0x2'));var BPromise=require('bluebird');var rs=require(_0x9eed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9eed('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9eed('0x6')][_0x9eed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f3ea5,_0x14eeb0,_0x3060f1){return new BPromise(function(_0x747d52,_0x1f36db){return client[_0x9eed('0x8')](_0x4f3ea5,_0x3060f1)['then'](function(_0x419936){logger['info'](_0x9eed('0x9'),_0x14eeb0,'request\x20sent');logger[_0x9eed('0xa')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x14eeb0,_0x9eed('0xb'),JSON[_0x9eed('0xc')](_0x419936));if(_0x419936[_0x9eed('0xd')]){if(_0x419936[_0x9eed('0xd')][_0x9eed('0xe')]===0x1f4){logger['error'](_0x9eed('0x9'),_0x14eeb0,_0x419936['error'][_0x9eed('0xf')]);return _0x1f36db(_0x419936[_0x9eed('0xd')][_0x9eed('0xf')]);}logger[_0x9eed('0xd')](_0x9eed('0x9'),_0x14eeb0,_0x419936['error'][_0x9eed('0xf')]);return _0x747d52(_0x419936['error']['message']);}else{logger['info'](_0x9eed('0x9'),_0x14eeb0,_0x9eed('0xb'));_0x747d52(_0x419936[_0x9eed('0x10')][_0x9eed('0xf')]);}})[_0x9eed('0x11')](function(_0x420688){logger[_0x9eed('0xd')](_0x9eed('0x9'),_0x14eeb0,_0x420688);_0x1f36db(_0x420688);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0aa55be..1deda03 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 _0x07f4=['index','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x07f4,0xe7));var _0x407f=function(_0x3849a7,_0x2b6b18){_0x3849a7=_0x3849a7-0x0;var _0x17c5f5=_0x07f4[_0x3849a7];return _0x17c5f5;};'use strict';var multer=require(_0x407f('0x0'));var util=require(_0x407f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x407f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x407f('0x3'));var interaction=require(_0x407f('0x4'));var config=require(_0x407f('0x5'));var controller=require(_0x407f('0x6'));router[_0x407f('0x7')]('/',auth[_0x407f('0x8')](),controller[_0x407f('0x9')]);router[_0x407f('0x7')](_0x407f('0xa'),auth[_0x407f('0x8')](),controller[_0x407f('0xb')]);router[_0x407f('0x7')](_0x407f('0xc'),auth[_0x407f('0x8')](),controller['download']);router[_0x407f('0xd')]('/',auth['isAuthenticated'](),controller[_0x407f('0xe')]);router[_0x407f('0xf')](_0x407f('0xa'),auth['isAuthenticated'](),controller[_0x407f('0x10')]);router[_0x407f('0x11')]('/:id',auth[_0x407f('0x8')](),controller[_0x407f('0x12')]);module[_0x407f('0x13')]=router; \ No newline at end of file +var _0xedc7=['show','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','index','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedc7,0x102));var _0x7edc=function(_0x394093,_0x569113){_0x394093=_0x394093-0x0;var _0x2971d5=_0xedc7[_0x394093];return _0x2971d5;};'use strict';var multer=require('multer');var util=require(_0x7edc('0x0'));var path=require('path');var timeout=require(_0x7edc('0x1'));var express=require(_0x7edc('0x2'));var router=express[_0x7edc('0x3')]();var fs_extra=require(_0x7edc('0x4'));var auth=require(_0x7edc('0x5'));var interaction=require(_0x7edc('0x6'));var config=require(_0x7edc('0x7'));var controller=require(_0x7edc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7edc('0x9')]);router[_0x7edc('0xa')]('/:id',auth[_0x7edc('0xb')](),controller[_0x7edc('0xc')]);router[_0x7edc('0xa')]('/:id/download',auth[_0x7edc('0xb')](),controller['download']);router['post']('/',auth[_0x7edc('0xb')](),controller[_0x7edc('0xd')]);router[_0x7edc('0xe')]('/:id',auth[_0x7edc('0xb')](),controller[_0x7edc('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7edc('0x10')]);module[_0x7edc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index e8c6fef..cf870a9 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 _0x4f42=['long','TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0xb82ecb,_0x55f985){var _0x80ee2e=function(_0x155acf){while(--_0x155acf){_0xb82ecb['push'](_0xb82ecb['shift']());}};_0x80ee2e(++_0x55f985);}(_0x4f42,0x12a));var _0x24f4=function(_0x5c80ac,_0x4d7e6f){_0x5c80ac=_0x5c80ac-0x0;var _0x3d7829=_0x4f42[_0x5c80ac];return _0x3d7829;};'use strict';var Sequelize=require(_0x24f4('0x0'));module[_0x24f4('0x1')]={'name':{'type':Sequelize[_0x24f4('0x2')],'get':function(_0x52afb5){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x24f4('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x24f4('0x5')](_0x24f4('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x24f4('0x4')],'defaultValue':''},'stamp':{'type':_0x24f4('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xde14=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x4932a6,_0x530e29){var _0x3b45b9=function(_0x1d1eb7){while(--_0x1d1eb7){_0x4932a6['push'](_0x4932a6['shift']());}};_0x3b45b9(++_0x530e29);}(_0xde14,0x97));var _0x4de1=function(_0x4b9d89,_0x4829ac){_0x4b9d89=_0x4b9d89-0x0;var _0x50fd35=_0xde14[_0x4b9d89];return _0x50fd35;};'use strict';var Sequelize=require(_0x4de1('0x0'));module[_0x4de1('0x1')]={'name':{'type':Sequelize[_0x4de1('0x2')],'get':function(_0x12678e){return this[_0x4de1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x4de1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x4de1('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4de1('0x5')],'defaultValue':''},'stamp':{'type':_0x4de1('0x7'),'defaultValue':Sequelize[_0x4de1('0x8')](_0x4de1('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ca886f1..37cc03f 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 _0xf1cf=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','error','name','send','index','map','rawAttributes','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','then','include','VoiceMailMessage','findAll','rows','catch','show','params','options','create','body','find','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0xf1cf,0x1a0));var _0xff1c=function(_0x5463aa,_0x3c15b2){_0x5463aa=_0x5463aa-0x0;var _0x9fa62f=_0xf1cf[_0x5463aa];return _0x9fa62f;};'use strict';var emlformat=require(_0xff1c('0x0'));var rimraf=require(_0xff1c('0x1'));var zipdir=require(_0xff1c('0x2'));var jsonpatch=require(_0xff1c('0x3'));var rp=require(_0xff1c('0x4'));var moment=require(_0xff1c('0x5'));var BPromise=require(_0xff1c('0x6'));var Mustache=require(_0xff1c('0x7'));var util=require(_0xff1c('0x8'));var path=require(_0xff1c('0x9'));var sox=require(_0xff1c('0xa'));var csv=require(_0xff1c('0xb'));var ejs=require(_0xff1c('0xc'));var fs=require('fs');var fs_extra=require(_0xff1c('0xd'));var _=require('lodash');var squel=require(_0xff1c('0xe'));var crypto=require(_0xff1c('0xf'));var jsforce=require(_0xff1c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xff1c('0xb'));var querystring=require(_0xff1c('0x11'));var Papa=require(_0xff1c('0x12'));var Redis=require('ioredis');var authService=require(_0xff1c('0x13'));var qs=require(_0xff1c('0x14'));var as=require(_0xff1c('0x15'));var hardwareService=require(_0xff1c('0x16'));var logger=require(_0xff1c('0x17'))(_0xff1c('0x18'));var utils=require(_0xff1c('0x19'));var config=require(_0xff1c('0x1a'));var licenseUtil=require(_0xff1c('0x1b'));var db=require(_0xff1c('0x1c'))['db'];function respondWithStatusCode(_0x2a653d,_0x2f5447){_0x2f5447=_0x2f5447||0xcc;return function(_0x4e77cc){if(_0x4e77cc){return _0x2a653d[_0xff1c('0x1d')](_0x2f5447);}return _0x2a653d[_0xff1c('0x1e')](_0x2f5447)[_0xff1c('0x1f')]();};}function respondWithResult(_0x149847,_0x3edc7d){_0x3edc7d=_0x3edc7d||0xc8;return function(_0x920dfc){if(_0x920dfc){return _0x149847[_0xff1c('0x1e')](_0x3edc7d)[_0xff1c('0x20')](_0x920dfc);}};}function respondWithFilteredResult(_0x2b2fa2,_0x14131b){return function(_0x478166){if(_0x478166){var _0x2fc396=typeof _0x14131b[_0xff1c('0x21')]===_0xff1c('0x22')&&typeof _0x14131b[_0xff1c('0x23')]===_0xff1c('0x22');var _0x28bc5b=_0x478166[_0xff1c('0x24')];var _0x403d6a=_0x2fc396?0x0:_0x14131b['offset'];var _0x494a34=_0x2fc396?_0x478166['count']:_0x14131b[_0xff1c('0x21')]+_0x14131b[_0xff1c('0x23')];var _0x812775;if(_0x494a34>=_0x28bc5b){_0x494a34=_0x28bc5b;_0x812775=0xc8;}else{_0x812775=0xce;}_0x2b2fa2['status'](_0x812775);return _0x2b2fa2['set'](_0xff1c('0x25'),_0x403d6a+'-'+_0x494a34+'/'+_0x28bc5b)[_0xff1c('0x20')](_0x478166);}return null;};}function patchUpdates(_0xb0d891){return function(_0x4f4d80){try{jsonpatch[_0xff1c('0x26')](_0x4f4d80,_0xb0d891,!![]);}catch(_0x3f8624){return BPromise['reject'](_0x3f8624);}return _0x4f4d80[_0xff1c('0x27')]();};}function saveUpdates(_0x40a935,_0x2ca688){return function(_0x59200f){if(_0x59200f){return _0x59200f[_0xff1c('0x28')](_0x40a935)['then'](function(_0x51897e){return _0x51897e;});}return null;};}function removeEntity(_0x24e270,_0x5f160c){return function(_0x14e1c6){if(_0x14e1c6){return _0x14e1c6[_0xff1c('0x29')]()['then'](function(){_0x24e270[_0xff1c('0x1e')](0xcc)[_0xff1c('0x1f')]();});}};}function handleEntityNotFound(_0x3bf066,_0x302057){return function(_0x675c49){if(!_0x675c49){_0x3bf066[_0xff1c('0x1d')](0x194);}return _0x675c49;};}function handleError(_0x52a89d,_0xf70085){_0xf70085=_0xf70085||0x1f4;return function(_0x578651){logger[_0xff1c('0x2a')](_0x578651['stack']);if(_0x578651[_0xff1c('0x2b')]){delete _0x578651['name'];}_0x52a89d[_0xff1c('0x1e')](_0xf70085)[_0xff1c('0x2c')](_0x578651);};}exports[_0xff1c('0x2d')]=function(_0x8f087a,_0x411185){var _0x3847ca={},_0x4397c1={},_0x2fe3a4={'count':0x0,'rows':[]};var _0x1e1539=_[_0xff1c('0x2e')](db['VoiceMailMessage'][_0xff1c('0x2f')],function(_0x2dc7da){return{'name':_0x2dc7da['fieldName'],'type':_0x2dc7da['type'][_0xff1c('0x30')]};});_0x4397c1['model']=_[_0xff1c('0x31')](_[_0xff1c('0x2e')](_0x1e1539,_0xff1c('0x2b')),['name']);_0x4397c1['query']=_[_0xff1c('0x32')](_0x8f087a[_0xff1c('0x33')]);_0x4397c1[_0xff1c('0x34')]=_[_0xff1c('0x35')](_0x4397c1[_0xff1c('0x36')],_0x4397c1[_0xff1c('0x33')]);_0x3847ca['attributes']=_['intersection'](_0x4397c1['model'],qs[_0xff1c('0x37')](_0x8f087a[_0xff1c('0x33')]['fields']));_0x3847ca[_0xff1c('0x38')]=_0x3847ca[_0xff1c('0x38')]['length']?_0x3847ca['attributes']:_0x4397c1[_0xff1c('0x36')];if(!_0x8f087a['query'][_0xff1c('0x39')](_0xff1c('0x3a'))){_0x3847ca[_0xff1c('0x23')]=qs[_0xff1c('0x23')](_0x8f087a[_0xff1c('0x33')][_0xff1c('0x23')]);_0x3847ca[_0xff1c('0x21')]=qs['offset'](_0x8f087a['query'][_0xff1c('0x21')]);}_0x3847ca[_0xff1c('0x3b')]=qs[_0xff1c('0x3c')](_0x8f087a[_0xff1c('0x33')][_0xff1c('0x3c')]);_0x3847ca[_0xff1c('0x3d')]=qs[_0xff1c('0x34')](_[_0xff1c('0x3e')](_0x8f087a[_0xff1c('0x33')],_0x4397c1[_0xff1c('0x34')]),_0x1e1539);if(_0x8f087a[_0xff1c('0x33')][_0xff1c('0x3f')]){_0x3847ca[_0xff1c('0x3d')]=_[_0xff1c('0x40')](_0x3847ca[_0xff1c('0x3d')],{'$or':_[_0xff1c('0x2e')](_0x1e1539,function(_0x4daf53){if(_0x4daf53[_0xff1c('0x41')]!==_0xff1c('0x42')){var _0x145b92={};_0x145b92[_0x4daf53[_0xff1c('0x2b')]]={'$like':'%'+_0x8f087a[_0xff1c('0x33')][_0xff1c('0x3f')]+'%'};return _0x145b92;}})});}_0x3847ca=_['merge']({},_0x3847ca,_0x8f087a['options']);var _0x16bcd4={'where':_0x3847ca[_0xff1c('0x3d')]};return db['VoiceMailMessage'][_0xff1c('0x24')](_0x16bcd4)[_0xff1c('0x43')](function(_0xa4f6b7){_0x2fe3a4[_0xff1c('0x24')]=_0xa4f6b7;if(_0x8f087a['query']['includeAll']){_0x3847ca[_0xff1c('0x44')]=[{'all':!![]}];}return db[_0xff1c('0x45')][_0xff1c('0x46')](_0x3847ca);})[_0xff1c('0x43')](function(_0x47ba21){_0x2fe3a4[_0xff1c('0x47')]=_0x47ba21;return _0x2fe3a4;})[_0xff1c('0x43')](respondWithFilteredResult(_0x411185,_0x3847ca))[_0xff1c('0x48')](handleError(_0x411185,null));};exports[_0xff1c('0x49')]=function(_0x3429eb,_0x2cc10c){var _0x460b35={'raw':!![],'where':{'id':_0x3429eb[_0xff1c('0x4a')]['id']}},_0x179a72={};_0x179a72[_0xff1c('0x36')]=_[_0xff1c('0x32')](db[_0xff1c('0x45')][_0xff1c('0x2f')]);_0x179a72['query']=_['keys'](_0x3429eb[_0xff1c('0x33')]);_0x179a72['filters']=_[_0xff1c('0x35')](_0x179a72['model'],_0x179a72['query']);_0x460b35[_0xff1c('0x38')]=_['intersection'](_0x179a72['model'],qs['fields'](_0x3429eb[_0xff1c('0x33')]['fields']));_0x460b35['attributes']=_0x460b35[_0xff1c('0x38')]['length']?_0x460b35[_0xff1c('0x38')]:_0x179a72[_0xff1c('0x36')];if(_0x3429eb[_0xff1c('0x33')]['includeAll']){_0x460b35[_0xff1c('0x44')]=[{'all':!![]}];}_0x460b35=_['merge']({},_0x460b35,_0x3429eb[_0xff1c('0x4b')]);return db[_0xff1c('0x45')]['find'](_0x460b35)[_0xff1c('0x43')](handleEntityNotFound(_0x2cc10c,null))[_0xff1c('0x43')](respondWithResult(_0x2cc10c,null))['catch'](handleError(_0x2cc10c,null));};exports[_0xff1c('0x4c')]=function(_0x389e41,_0x19fd4c){return db[_0xff1c('0x45')][_0xff1c('0x4c')](_0x389e41['body'],{})[_0xff1c('0x43')](respondWithResult(_0x19fd4c,0xc9))[_0xff1c('0x48')](handleError(_0x19fd4c,null));};exports[_0xff1c('0x28')]=function(_0x5b5cf7,_0x4151ef){if(_0x5b5cf7[_0xff1c('0x4d')]['id']){delete _0x5b5cf7[_0xff1c('0x4d')]['id'];}return db[_0xff1c('0x45')][_0xff1c('0x4e')]({'where':{'id':_0x5b5cf7[_0xff1c('0x4a')]['id']}})[_0xff1c('0x43')](handleEntityNotFound(_0x4151ef,null))[_0xff1c('0x43')](saveUpdates(_0x5b5cf7[_0xff1c('0x4d')],null))[_0xff1c('0x43')](respondWithResult(_0x4151ef,null))[_0xff1c('0x48')](handleError(_0x4151ef,null));};exports['destroy']=function(_0x6a7b3c,_0xdec131){return db[_0xff1c('0x45')][_0xff1c('0x4e')]({'where':{'id':_0x6a7b3c[_0xff1c('0x4a')]['id']}})[_0xff1c('0x43')](handleEntityNotFound(_0xdec131,null))[_0xff1c('0x43')](removeEntity(_0xdec131,null))[_0xff1c('0x48')](handleError(_0xdec131,null));};exports['download']=function(_0xf5ee0d,_0x3e4ab8,_0x1d3536){return db[_0xff1c('0x45')][_0xff1c('0x4e')]({'where':{'id':_0xf5ee0d[_0xff1c('0x4a')]['id']},'attributes':['id',_0xff1c('0x4f'),_0xff1c('0x50')]})['then'](handleEntityNotFound(_0x3e4ab8,null))[_0xff1c('0x43')](function(_0x554e24){if(_0x554e24){if(!_0x554e24[_0xff1c('0x4f')]){throw new db['Sequelize'][(_0xff1c('0x51'))](_0xff1c('0x52'));}var _0x55bf03={'Content-Type':_0xff1c('0x53'),'Content-Disposition':_0xff1c('0x54')};if(_0x554e24[_0xff1c('0x50')]){_0x55bf03[_0xff1c('0x55')]=_0xff1c('0x56')+_0x554e24['msg_id']+_0xff1c('0x57');}_0x3e4ab8[_0xff1c('0x58')](_0x55bf03);return _0x3e4ab8['send'](new Buffer(_0x554e24[_0xff1c('0x4f')]));}})[_0xff1c('0x48')](handleError(_0x3e4ab8,null));}; \ No newline at end of file +var _0xa89e=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','error','name','map','VoiceMailMessage','rawAttributes','type','differenceBy','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x38d26a,_0x5b31b2){var _0x1e8bb5=function(_0x1a0c78){while(--_0x1a0c78){_0x38d26a['push'](_0x38d26a['shift']());}};_0x1e8bb5(++_0x5b31b2);}(_0xa89e,0x114));var _0xea89=function(_0x77d479,_0x44d239){_0x77d479=_0x77d479-0x0;var _0xed7eb=_0xa89e[_0x77d479];return _0xed7eb;};'use strict';var emlformat=require(_0xea89('0x0'));var rimraf=require(_0xea89('0x1'));var zipdir=require(_0xea89('0x2'));var jsonpatch=require(_0xea89('0x3'));var rp=require(_0xea89('0x4'));var moment=require(_0xea89('0x5'));var BPromise=require(_0xea89('0x6'));var Mustache=require(_0xea89('0x7'));var util=require(_0xea89('0x8'));var path=require(_0xea89('0x9'));var sox=require(_0xea89('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea89('0xb'));var squel=require(_0xea89('0xc'));var crypto=require(_0xea89('0xd'));var jsforce=require(_0xea89('0xe'));var deskjs=require(_0xea89('0xf'));var toCsv=require('to-csv');var querystring=require(_0xea89('0x10'));var Papa=require(_0xea89('0x11'));var Redis=require('ioredis');var authService=require(_0xea89('0x12'));var qs=require(_0xea89('0x13'));var as=require(_0xea89('0x14'));var hardwareService=require(_0xea89('0x15'));var logger=require(_0xea89('0x16'))('api');var utils=require(_0xea89('0x17'));var config=require(_0xea89('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xea89('0x19'))['db'];function respondWithStatusCode(_0x2cb1a2,_0x10c4ba){_0x10c4ba=_0x10c4ba||0xcc;return function(_0x11edfd){if(_0x11edfd){return _0x2cb1a2[_0xea89('0x1a')](_0x10c4ba);}return _0x2cb1a2[_0xea89('0x1b')](_0x10c4ba)['end']();};}function respondWithResult(_0x2747d2,_0x27d5e5){_0x27d5e5=_0x27d5e5||0xc8;return function(_0x1690a7){if(_0x1690a7){return _0x2747d2[_0xea89('0x1b')](_0x27d5e5)['json'](_0x1690a7);}};}function respondWithFilteredResult(_0xecd520,_0x4657b6){return function(_0x562be2){if(_0x562be2){var _0x49c120=typeof _0x4657b6[_0xea89('0x1c')]===_0xea89('0x1d')&&typeof _0x4657b6['limit']===_0xea89('0x1d');var _0x15d970=_0x562be2[_0xea89('0x1e')];var _0x2a967a=_0x49c120?0x0:_0x4657b6[_0xea89('0x1c')];var _0x203b8c=_0x49c120?_0x562be2['count']:_0x4657b6[_0xea89('0x1c')]+_0x4657b6[_0xea89('0x1f')];var _0x7043d4;if(_0x203b8c>=_0x15d970){_0x203b8c=_0x15d970;_0x7043d4=0xc8;}else{_0x7043d4=0xce;}_0xecd520['status'](_0x7043d4);return _0xecd520[_0xea89('0x20')]('Content-Range',_0x2a967a+'-'+_0x203b8c+'/'+_0x15d970)['json'](_0x562be2);}return null;};}function patchUpdates(_0x36cd1b){return function(_0xa7d1c4){try{jsonpatch[_0xea89('0x21')](_0xa7d1c4,_0x36cd1b,!![]);}catch(_0x5a2cf5){return BPromise[_0xea89('0x22')](_0x5a2cf5);}return _0xa7d1c4['save']();};}function saveUpdates(_0x4b115f,_0x516ab9){return function(_0x18a294){if(_0x18a294){return _0x18a294[_0xea89('0x23')](_0x4b115f)[_0xea89('0x24')](function(_0x51f691){return _0x51f691;});}return null;};}function removeEntity(_0x4fd8ab,_0x44ffa2){return function(_0x1da59e){if(_0x1da59e){return _0x1da59e[_0xea89('0x25')]()[_0xea89('0x24')](function(){_0x4fd8ab['status'](0xcc)[_0xea89('0x26')]();});}};}function handleEntityNotFound(_0x5e1d51,_0x25e223){return function(_0x3dadfa){if(!_0x3dadfa){_0x5e1d51[_0xea89('0x1a')](0x194);}return _0x3dadfa;};}function handleError(_0x4018be,_0x47fd0a){_0x47fd0a=_0x47fd0a||0x1f4;return function(_0x465095){logger[_0xea89('0x27')](_0x465095['stack']);if(_0x465095[_0xea89('0x28')]){delete _0x465095['name'];}_0x4018be[_0xea89('0x1b')](_0x47fd0a)['send'](_0x465095);};}exports['index']=function(_0x4c9b39,_0x2008ff){var _0x583020={},_0x482c53={},_0x401050={'count':0x0,'rows':[]};var _0x565ff5=_[_0xea89('0x29')](db[_0xea89('0x2a')][_0xea89('0x2b')],function(_0x7c4186){return{'name':_0x7c4186['fieldName'],'type':_0x7c4186[_0xea89('0x2c')]['key']};});_0x482c53['model']=_[_0xea89('0x2d')](_[_0xea89('0x29')](_0x565ff5,_0xea89('0x28')),['name']);_0x482c53[_0xea89('0x2e')]=_['keys'](_0x4c9b39[_0xea89('0x2e')]);_0x482c53['filters']=_[_0xea89('0x2f')](_0x482c53[_0xea89('0x30')],_0x482c53[_0xea89('0x2e')]);_0x583020['attributes']=_['intersection'](_0x482c53[_0xea89('0x30')],qs['fields'](_0x4c9b39[_0xea89('0x2e')][_0xea89('0x31')]));_0x583020[_0xea89('0x32')]=_0x583020['attributes'][_0xea89('0x33')]?_0x583020[_0xea89('0x32')]:_0x482c53['model'];if(!_0x4c9b39[_0xea89('0x2e')][_0xea89('0x34')](_0xea89('0x35'))){_0x583020[_0xea89('0x1f')]=qs[_0xea89('0x1f')](_0x4c9b39['query'][_0xea89('0x1f')]);_0x583020[_0xea89('0x1c')]=qs[_0xea89('0x1c')](_0x4c9b39[_0xea89('0x2e')][_0xea89('0x1c')]);}_0x583020[_0xea89('0x36')]=qs['sort'](_0x4c9b39[_0xea89('0x2e')][_0xea89('0x37')]);_0x583020[_0xea89('0x38')]=qs[_0xea89('0x39')](_[_0xea89('0x3a')](_0x4c9b39['query'],_0x482c53['filters']),_0x565ff5);if(_0x4c9b39['query'][_0xea89('0x3b')]){_0x583020[_0xea89('0x38')]=_[_0xea89('0x3c')](_0x583020[_0xea89('0x38')],{'$or':_[_0xea89('0x29')](_0x565ff5,function(_0xa3e4f7){if(_0xa3e4f7[_0xea89('0x2c')]!==_0xea89('0x3d')){var _0x310a57={};_0x310a57[_0xa3e4f7['name']]={'$like':'%'+_0x4c9b39[_0xea89('0x2e')][_0xea89('0x3b')]+'%'};return _0x310a57;}})});}_0x583020=_[_0xea89('0x3c')]({},_0x583020,_0x4c9b39[_0xea89('0x3e')]);var _0x309d1f={'where':_0x583020[_0xea89('0x38')]};return db['VoiceMailMessage'][_0xea89('0x1e')](_0x309d1f)['then'](function(_0x2b01b3){_0x401050[_0xea89('0x1e')]=_0x2b01b3;if(_0x4c9b39[_0xea89('0x2e')][_0xea89('0x3f')]){_0x583020[_0xea89('0x40')]=[{'all':!![]}];}return db[_0xea89('0x2a')][_0xea89('0x41')](_0x583020);})[_0xea89('0x24')](function(_0x50e895){_0x401050[_0xea89('0x42')]=_0x50e895;return _0x401050;})[_0xea89('0x24')](respondWithFilteredResult(_0x2008ff,_0x583020))[_0xea89('0x43')](handleError(_0x2008ff,null));};exports['show']=function(_0x6d7067,_0x4a2f9e){var _0x2d0e03={'raw':!![],'where':{'id':_0x6d7067['params']['id']}},_0x219f0a={};_0x219f0a[_0xea89('0x30')]=_[_0xea89('0x44')](db[_0xea89('0x2a')][_0xea89('0x2b')]);_0x219f0a[_0xea89('0x2e')]=_[_0xea89('0x44')](_0x6d7067[_0xea89('0x2e')]);_0x219f0a['filters']=_[_0xea89('0x2f')](_0x219f0a[_0xea89('0x30')],_0x219f0a['query']);_0x2d0e03['attributes']=_[_0xea89('0x2f')](_0x219f0a[_0xea89('0x30')],qs[_0xea89('0x31')](_0x6d7067[_0xea89('0x2e')][_0xea89('0x31')]));_0x2d0e03[_0xea89('0x32')]=_0x2d0e03[_0xea89('0x32')][_0xea89('0x33')]?_0x2d0e03['attributes']:_0x219f0a[_0xea89('0x30')];if(_0x6d7067[_0xea89('0x2e')][_0xea89('0x3f')]){_0x2d0e03[_0xea89('0x40')]=[{'all':!![]}];}_0x2d0e03=_[_0xea89('0x3c')]({},_0x2d0e03,_0x6d7067[_0xea89('0x3e')]);return db['VoiceMailMessage'][_0xea89('0x45')](_0x2d0e03)[_0xea89('0x24')](handleEntityNotFound(_0x4a2f9e,null))['then'](respondWithResult(_0x4a2f9e,null))[_0xea89('0x43')](handleError(_0x4a2f9e,null));};exports[_0xea89('0x46')]=function(_0x536ae6,_0x2a79f4){return db['VoiceMailMessage'][_0xea89('0x46')](_0x536ae6[_0xea89('0x47')],{})[_0xea89('0x24')](respondWithResult(_0x2a79f4,0xc9))[_0xea89('0x43')](handleError(_0x2a79f4,null));};exports[_0xea89('0x23')]=function(_0x22a4b4,_0x261df6){if(_0x22a4b4[_0xea89('0x47')]['id']){delete _0x22a4b4[_0xea89('0x47')]['id'];}return db[_0xea89('0x2a')][_0xea89('0x45')]({'where':{'id':_0x22a4b4['params']['id']}})[_0xea89('0x24')](handleEntityNotFound(_0x261df6,null))[_0xea89('0x24')](saveUpdates(_0x22a4b4[_0xea89('0x47')],null))[_0xea89('0x24')](respondWithResult(_0x261df6,null))[_0xea89('0x43')](handleError(_0x261df6,null));};exports[_0xea89('0x25')]=function(_0x16e038,_0x5e6ee2){return db[_0xea89('0x2a')][_0xea89('0x45')]({'where':{'id':_0x16e038[_0xea89('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e6ee2,null))['then'](removeEntity(_0x5e6ee2,null))['catch'](handleError(_0x5e6ee2,null));};exports[_0xea89('0x49')]=function(_0x304901,_0x913b8f,_0x423d7c){return db[_0xea89('0x2a')][_0xea89('0x45')]({'where':{'id':_0x304901['params']['id']},'attributes':['id',_0xea89('0x4a'),_0xea89('0x4b')]})[_0xea89('0x24')](handleEntityNotFound(_0x913b8f,null))[_0xea89('0x24')](function(_0x5601c3){if(_0x5601c3){if(!_0x5601c3[_0xea89('0x4a')]){throw new db[(_0xea89('0x4c'))][(_0xea89('0x4d'))](_0xea89('0x4e'));}var _0x2ede07={'Content-Type':_0xea89('0x4f'),'Content-Disposition':_0xea89('0x50')};if(_0x5601c3[_0xea89('0x4b')]){_0x2ede07['Content-Disposition']=_0xea89('0x51')+_0x5601c3[_0xea89('0x4b')]+'.wav\x22';}_0x913b8f[_0xea89('0x20')](_0x2ede07);return _0x913b8f[_0xea89('0x52')](new Buffer(_0x5601c3[_0xea89('0x4a')]));}})[_0xea89('0x43')](handleError(_0x913b8f,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index d6c3c38..6ef49bc 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 _0x954d=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x477a57,_0x4e7342){var _0x1254e6=function(_0x52b566){while(--_0x52b566){_0x477a57['push'](_0x477a57['shift']());}};_0x1254e6(++_0x4e7342);}(_0x954d,0x1ae));var _0xd954=function(_0x3031e5,_0x2a73a9){_0x3031e5=_0x3031e5-0x0;var _0x2e48b4=_0x954d[_0x3031e5];return _0x2e48b4;};'use strict';var _=require(_0xd954('0x0'));var util=require(_0xd954('0x1'));var logger=require(_0xd954('0x2'))('api');var moment=require(_0xd954('0x3'));var BPromise=require('bluebird');var rp=require(_0xd954('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd954('0x5'));var config=require(_0xd954('0x6'));var attributes=require(_0xd954('0x7'));module['exports']=function(_0x49aec1,_0x2f8ad6){return _0x49aec1[_0xd954('0x8')](_0xd954('0x9'),attributes,{'tableName':_0xd954('0xa'),'paranoid':![],'indexes':[{'name':_0xd954('0xb'),'fields':[_0xd954('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc507=['../../config/logger','moment','request-promise','rimraf','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','util'];(function(_0x45f231,_0xfd8999){var _0x2fcfb1=function(_0xf7dc55){while(--_0xf7dc55){_0x45f231['push'](_0x45f231['shift']());}};_0x2fcfb1(++_0xfd8999);}(_0xc507,0x94));var _0x7c50=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xc507[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var logger=require(_0x7c50('0x2'))('api');var moment=require(_0x7c50('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c50('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c50('0x5'));var config=require('../../config/environment');var attributes=require(_0x7c50('0x6'));module['exports']=function(_0x48e996,_0x207f7e){return _0x48e996[_0x7c50('0x7')]('VoiceMailMessage',attributes,{'tableName':_0x7c50('0x8'),'paranoid':![],'indexes':[{'name':_0x7c50('0x9'),'fields':[_0x7c50('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 641cde5..1acec5e 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 _0xc575=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x1efdec,_0x2bfa71){var _0x5c0a6d=function(_0xd3141a){while(--_0xd3141a){_0x1efdec['push'](_0x1efdec['shift']());}};_0x5c0a6d(++_0x2bfa71);}(_0xc575,0x1b3));var _0x5c57=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0xc575[_0x4d121d];return _0xffa031;};'use strict';var _=require(_0x5c57('0x0'));var util=require(_0x5c57('0x1'));var moment=require(_0x5c57('0x2'));var BPromise=require(_0x5c57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c57('0x4'))['db'];var utils=require(_0x5c57('0x5'));var logger=require(_0x5c57('0x6'))(_0x5c57('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c57('0x8'));var client=jayson[_0x5c57('0x9')][_0x5c57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b0df3,_0x27c00b,_0x1ec4a8){return new BPromise(function(_0x576d2c,_0x476a5f){return client[_0x5c57('0xb')](_0x5b0df3,_0x1ec4a8)[_0x5c57('0xc')](function(_0x6ec926){logger[_0x5c57('0xd')](_0x5c57('0xe'),_0x27c00b,_0x5c57('0xf'));logger[_0x5c57('0x10')](_0x5c57('0x11'),_0x27c00b,_0x5c57('0xf'),JSON[_0x5c57('0x12')](_0x6ec926));if(_0x6ec926['error']){if(_0x6ec926[_0x5c57('0x13')][_0x5c57('0x14')]===0x1f4){logger[_0x5c57('0x13')](_0x5c57('0xe'),_0x27c00b,_0x6ec926[_0x5c57('0x13')]['message']);return _0x476a5f(_0x6ec926[_0x5c57('0x13')][_0x5c57('0x15')]);}logger[_0x5c57('0x13')](_0x5c57('0xe'),_0x27c00b,_0x6ec926['error'][_0x5c57('0x15')]);return _0x576d2c(_0x6ec926[_0x5c57('0x13')][_0x5c57('0x15')]);}else{logger['info'](_0x5c57('0xe'),_0x27c00b,_0x5c57('0xf'));_0x576d2c(_0x6ec926[_0x5c57('0x16')]['message']);}})['catch'](function(_0x29d59f){logger[_0x5c57('0x13')](_0x5c57('0xe'),_0x27c00b,_0x29d59f);_0x476a5f(_0x29d59f);});});} \ No newline at end of file +var _0x60d3=['code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error'];(function(_0x5ccb02,_0x3588fb){var _0x52a833=function(_0x1b61d5){while(--_0x1b61d5){_0x5ccb02['push'](_0x5ccb02['shift']());}};_0x52a833(++_0x3588fb);}(_0x60d3,0x191));var _0x360d=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x60d3[_0x2a0738];return _0x159679;};'use strict';var _=require(_0x360d('0x0'));var util=require(_0x360d('0x1'));var moment=require(_0x360d('0x2'));var BPromise=require(_0x360d('0x3'));var rs=require(_0x360d('0x4'));var fs=require('fs');var Redis=require(_0x360d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x360d('0x6'));var logger=require(_0x360d('0x7'))(_0x360d('0x8'));var config=require(_0x360d('0x9'));var jayson=require(_0x360d('0xa'));var client=jayson[_0x360d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d84d3,_0x1c9edf,_0x259cd3){return new BPromise(function(_0x2be1b3,_0x445d06){return client['request'](_0x4d84d3,_0x259cd3)[_0x360d('0xc')](function(_0x5bbf70){logger['info'](_0x360d('0xd'),_0x1c9edf,'request\x20sent');logger[_0x360d('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1c9edf,'request\x20sent',JSON[_0x360d('0xf')](_0x5bbf70));if(_0x5bbf70['error']){if(_0x5bbf70[_0x360d('0x10')][_0x360d('0x11')]===0x1f4){logger['error'](_0x360d('0xd'),_0x1c9edf,_0x5bbf70[_0x360d('0x10')][_0x360d('0x12')]);return _0x445d06(_0x5bbf70[_0x360d('0x10')]['message']);}logger['error'](_0x360d('0xd'),_0x1c9edf,_0x5bbf70['error'][_0x360d('0x12')]);return _0x2be1b3(_0x5bbf70[_0x360d('0x10')][_0x360d('0x12')]);}else{logger[_0x360d('0x13')](_0x360d('0xd'),_0x1c9edf,_0x360d('0x14'));_0x2be1b3(_0x5bbf70['result'][_0x360d('0x12')]);}})[_0x360d('0x15')](function(_0x86ee4d){logger[_0x360d('0x10')](_0x360d('0xd'),_0x1c9edf,_0x86ee4d);_0x445d06(_0x86ee4d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index acdec31..f20ce8b 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 _0x462a=['update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','addSound','put'];(function(_0x25dbab,_0x361b06){var _0x207aad=function(_0x40e176){while(--_0x40e176){_0x25dbab['push'](_0x25dbab['shift']());}};_0x207aad(++_0x361b06);}(_0x462a,0x139));var _0xa462=function(_0x27fc18,_0xc24f78){_0x27fc18=_0x27fc18-0x0;var _0x5b4caf=_0x462a[_0x27fc18];return _0x5b4caf;};'use strict';var multer=require(_0xa462('0x0'));var util=require(_0xa462('0x1'));var path=require(_0xa462('0x2'));var timeout=require(_0xa462('0x3'));var express=require(_0xa462('0x4'));var router=express['Router']();var fs_extra=require(_0xa462('0x5'));var auth=require(_0xa462('0x6'));var interaction=require(_0xa462('0x7'));var config=require(_0xa462('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xa462('0x9')]('/',auth[_0xa462('0xa')](),controller[_0xa462('0xb')]);router[_0xa462('0x9')](_0xa462('0xc'),auth[_0xa462('0xa')](),controller['show']);router[_0xa462('0x9')](_0xa462('0xd'),auth['isAuthenticated'](),controller[_0xa462('0xe')]);router['post']('/',auth[_0xa462('0xa')](),controller['create']);router['post'](_0xa462('0xd'),auth[_0xa462('0xa')](),controller[_0xa462('0xf')]);router[_0xa462('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa462('0x11')]);router[_0xa462('0x12')](_0xa462('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xa462('0x12')](_0xa462('0x13'),auth['isAuthenticated'](),controller[_0xa462('0x14')]);module[_0xa462('0x15')]=router; \ No newline at end of file +var _0xcbd6=['index','/:id','show','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x46650a,_0x5c9cfb){var _0xca6eb1=function(_0x3b9c8f){while(--_0x3b9c8f){_0x46650a['push'](_0x46650a['shift']());}};_0xca6eb1(++_0x5c9cfb);}(_0xcbd6,0xc5));var _0x6cbd=function(_0x4fd853,_0xd1679c){_0x4fd853=_0x4fd853-0x0;var _0x2aaadb=_0xcbd6[_0x4fd853];return _0x2aaadb;};'use strict';var multer=require(_0x6cbd('0x0'));var util=require('util');var path=require(_0x6cbd('0x1'));var timeout=require(_0x6cbd('0x2'));var express=require(_0x6cbd('0x3'));var router=express[_0x6cbd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cbd('0x5'));var interaction=require(_0x6cbd('0x6'));var config=require('../../config/environment');var controller=require(_0x6cbd('0x7'));router[_0x6cbd('0x8')]('/',auth[_0x6cbd('0x9')](),controller[_0x6cbd('0xa')]);router[_0x6cbd('0x8')](_0x6cbd('0xb'),auth[_0x6cbd('0x9')](),controller[_0x6cbd('0xc')]);router['get'](_0x6cbd('0xd'),auth['isAuthenticated'](),controller[_0x6cbd('0xe')]);router[_0x6cbd('0xf')]('/',auth[_0x6cbd('0x9')](),controller['create']);router[_0x6cbd('0xf')](_0x6cbd('0xd'),auth[_0x6cbd('0x9')](),controller['addSound']);router[_0x6cbd('0x10')](_0x6cbd('0xb'),auth['isAuthenticated'](),controller[_0x6cbd('0x11')]);router[_0x6cbd('0x12')](_0x6cbd('0xb'),auth[_0x6cbd('0x9')](),controller[_0x6cbd('0x13')]);router['delete'](_0x6cbd('0x14'),auth[_0x6cbd('0x9')](),controller[_0x6cbd('0x15')]);module[_0x6cbd('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 2e9b937..90750de 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 _0xca42=['mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','sequelize','STRING','name','ENUM','files'];(function(_0x17de8f,_0x2d5177){var _0xc19ec4=function(_0x3424c0){while(--_0x3424c0){_0x17de8f['push'](_0x17de8f['shift']());}};_0xc19ec4(++_0x2d5177);}(_0xca42,0x11d));var _0x2ca4=function(_0x671c4b,_0x418667){_0x671c4b=_0x671c4b-0x0;var _0x2dda87=_0xca42[_0x671c4b];return _0x2dda87;};'use strict';var Sequelize=require(_0x2ca4('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ca4('0x1')],'allowNull':![],'unique':_0x2ca4('0x2')},'mode':{'type':Sequelize[_0x2ca4('0x3')]('custom',_0x2ca4('0x4'),_0x2ca4('0x5'),_0x2ca4('0x6'),_0x2ca4('0x7'),_0x2ca4('0x8')),'allowNull':!![],'defaultValue':_0x2ca4('0x4')},'directory':{'type':Sequelize[_0x2ca4('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x2ca4('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2ca4('0x1')],'allowNull':!![]},'stamp':{'type':_0x2ca4('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x529f=['TIMESTAMP','sequelize','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x4d7b67,_0x5b3c9f){var _0x2d85e6=function(_0x4c1558){while(--_0x4c1558){_0x4d7b67['push'](_0x4d7b67['shift']());}};_0x2d85e6(++_0x5b3c9f);}(_0x529f,0xd2));var _0xf529=function(_0x57f4b4,_0x2db64a){_0x57f4b4=_0x57f4b4-0x0;var _0x1da67d=_0x529f[_0x57f4b4];return _0x1da67d;};'use strict';var Sequelize=require(_0xf529('0x0'));module[_0xf529('0x1')]={'name':{'type':Sequelize[_0xf529('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xf529('0x3')](_0xf529('0x4'),_0xf529('0x5'),_0xf529('0x6'),_0xf529('0x7'),_0xf529('0x8'),_0xf529('0x9')),'allowNull':!![],'defaultValue':_0xf529('0x5')},'directory':{'type':Sequelize[_0xf529('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xf529('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf529('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf529('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xf529('0xa')},'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 64d49d8..acd2d63 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 _0x715f=['hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','body','find','create','sequelize','transaction','mode','files','directory','join','root','mkdirSync','0777','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','extname','%s.%s','converted_format','symlinkSync','ValidationError','removeSound','id2','getSounds','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../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','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length'];(function(_0x38c7a8,_0x36a319){var _0x3f69a4=function(_0x4fc2cd){while(--_0x4fc2cd){_0x38c7a8['push'](_0x38c7a8['shift']());}};_0x3f69a4(++_0x36a319);}(_0x715f,0x189));var _0xf715=function(_0x1c922e,_0x26d9e1){_0x1c922e=_0x1c922e-0x0;var _0x4af09b=_0x715f[_0x1c922e];return _0x4af09b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf715('0x0'));var zipdir=require(_0xf715('0x1'));var jsonpatch=require(_0xf715('0x2'));var rp=require(_0xf715('0x3'));var moment=require(_0xf715('0x4'));var BPromise=require(_0xf715('0x5'));var Mustache=require(_0xf715('0x6'));var util=require('util');var path=require(_0xf715('0x7'));var sox=require('sox');var csv=require(_0xf715('0x8'));var ejs=require(_0xf715('0x9'));var fs=require('fs');var fs_extra=require(_0xf715('0xa'));var _=require(_0xf715('0xb'));var squel=require(_0xf715('0xc'));var crypto=require(_0xf715('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf715('0x8'));var querystring=require(_0xf715('0xe'));var Papa=require(_0xf715('0xf'));var Redis=require('ioredis');var authService=require(_0xf715('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf715('0x11'));var hardwareService=require(_0xf715('0x12'));var logger=require('../../config/logger')(_0xf715('0x13'));var utils=require(_0xf715('0x14'));var config=require(_0xf715('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf715('0x16'))['db'];function respondWithStatusCode(_0x4afaa6,_0x47bcaa){_0x47bcaa=_0x47bcaa||0xcc;return function(_0x4e576c){if(_0x4e576c){return _0x4afaa6[_0xf715('0x17')](_0x47bcaa);}return _0x4afaa6[_0xf715('0x18')](_0x47bcaa)[_0xf715('0x19')]();};}function respondWithResult(_0x289fdf,_0x1c7c78){_0x1c7c78=_0x1c7c78||0xc8;return function(_0x576dd3){if(_0x576dd3){return _0x289fdf[_0xf715('0x18')](_0x1c7c78)[_0xf715('0x1a')](_0x576dd3);}};}function respondWithFilteredResult(_0x370be1,_0x470012){return function(_0x10f427){if(_0x10f427){var _0x3911df=typeof _0x470012[_0xf715('0x1b')]===_0xf715('0x1c')&&typeof _0x470012[_0xf715('0x1d')]===_0xf715('0x1c');var _0x58d509=_0x10f427[_0xf715('0x1e')];var _0x2797c5=_0x3911df?0x0:_0x470012[_0xf715('0x1b')];var _0x7a5c16=_0x3911df?_0x10f427[_0xf715('0x1e')]:_0x470012[_0xf715('0x1b')]+_0x470012[_0xf715('0x1d')];var _0x3e2f15;if(_0x7a5c16>=_0x58d509){_0x7a5c16=_0x58d509;_0x3e2f15=0xc8;}else{_0x3e2f15=0xce;}_0x370be1[_0xf715('0x18')](_0x3e2f15);return _0x370be1[_0xf715('0x1f')](_0xf715('0x20'),_0x2797c5+'-'+_0x7a5c16+'/'+_0x58d509)[_0xf715('0x1a')](_0x10f427);}return null;};}function patchUpdates(_0x2a6dd6){return function(_0x54303a){try{jsonpatch[_0xf715('0x21')](_0x54303a,_0x2a6dd6,!![]);}catch(_0x3198b4){return BPromise[_0xf715('0x22')](_0x3198b4);}return _0x54303a['save']();};}function saveUpdates(_0x2e270e,_0x3e5f4a){return function(_0x32d5b2){if(_0x32d5b2){return _0x32d5b2[_0xf715('0x23')](_0x2e270e)[_0xf715('0x24')](function(_0x42f975){return _0x42f975;});}return null;};}function removeEntity(_0x1bffdd,_0x3c8cea){return function(_0xc1444f){if(_0xc1444f){return _0xc1444f[_0xf715('0x25')]()[_0xf715('0x24')](function(){var _0xfb86c=_0xc1444f[_0xf715('0x26')]({'plain':!![]});var _0x42df45=_0xf715('0x27');return db[_0xf715('0x28')][_0xf715('0x25')]({'where':{'type':_0x42df45,'resourceId':_0xfb86c['id']}})['then'](function(){return _0xc1444f;});})[_0xf715('0x24')](function(){_0x1bffdd[_0xf715('0x18')](0xcc)[_0xf715('0x19')]();});}};}function handleEntityNotFound(_0xbd8ecf,_0x485e60){return function(_0x496d6e){if(!_0x496d6e){_0xbd8ecf[_0xf715('0x17')](0x194);}return _0x496d6e;};}function handleError(_0x2c7426,_0x188e8e){_0x188e8e=_0x188e8e||0x1f4;return function(_0x3a1d95){logger[_0xf715('0x29')](_0x3a1d95[_0xf715('0x2a')]);if(_0x3a1d95[_0xf715('0x2b')]){delete _0x3a1d95[_0xf715('0x2b')];}_0x2c7426[_0xf715('0x18')](_0x188e8e)[_0xf715('0x2c')](_0x3a1d95);};}exports[_0xf715('0x2d')]=function(_0x187ba4,_0x5b0fbf){var _0x1930e8={},_0x543188={},_0x55bbe5={'count':0x0,'rows':[]};var _0x39fc66=_[_0xf715('0x2e')](db[_0xf715('0x2f')][_0xf715('0x30')],function(_0x3107f8){return{'name':_0x3107f8[_0xf715('0x31')],'type':_0x3107f8[_0xf715('0x32')][_0xf715('0x33')]};});_0x543188[_0xf715('0x34')]=_[_0xf715('0x2e')](_0x39fc66,'name');_0x543188['query']=_[_0xf715('0x35')](_0x187ba4['query']);_0x543188[_0xf715('0x36')]=_[_0xf715('0x37')](_0x543188[_0xf715('0x34')],_0x543188[_0xf715('0x38')]);_0x1930e8[_0xf715('0x39')]=_['intersection'](_0x543188[_0xf715('0x34')],qs['fields'](_0x187ba4[_0xf715('0x38')]['fields']));_0x1930e8[_0xf715('0x39')]=_0x1930e8[_0xf715('0x39')][_0xf715('0x3a')]?_0x1930e8[_0xf715('0x39')]:_0x543188[_0xf715('0x34')];if(!_0x187ba4[_0xf715('0x38')][_0xf715('0x3b')](_0xf715('0x3c'))){_0x1930e8['limit']=qs['limit'](_0x187ba4['query'][_0xf715('0x1d')]);_0x1930e8['offset']=qs[_0xf715('0x1b')](_0x187ba4[_0xf715('0x38')][_0xf715('0x1b')]);}_0x1930e8[_0xf715('0x3d')]=qs[_0xf715('0x3e')](_0x187ba4[_0xf715('0x38')][_0xf715('0x3e')]);delete _0x187ba4['query']['sort'];_0x1930e8['where']=qs['filters'](_[_0xf715('0x3f')](_0x187ba4[_0xf715('0x38')],_0x543188[_0xf715('0x36')]),_0x39fc66);if(_0x187ba4[_0xf715('0x38')]['filter']){_0x1930e8[_0xf715('0x40')]=_[_0xf715('0x41')](_0x1930e8[_0xf715('0x40')],{'$or':_['map'](_0x39fc66,function(_0x348d05){if(_0x348d05[_0xf715('0x32')]!==_0xf715('0x42')){var _0x3006ad={};_0x3006ad[_0x348d05[_0xf715('0x2b')]]={'$like':'%'+_0x187ba4[_0xf715('0x38')]['filter']+'%'};return _0x3006ad;}})});}_0x1930e8=_['merge']({},_0x1930e8,_0x187ba4[_0xf715('0x43')]);var _0x3c4a66={'where':_0x1930e8[_0xf715('0x40')]};return db[_0xf715('0x2f')][_0xf715('0x1e')](_0x3c4a66)[_0xf715('0x24')](function(_0x475782){_0x55bbe5['count']=_0x475782;if(_0x187ba4[_0xf715('0x38')][_0xf715('0x44')]){_0x1930e8[_0xf715('0x45')]=[{'all':!![]}];}return db[_0xf715('0x2f')][_0xf715('0x46')](_0x1930e8);})[_0xf715('0x24')](function(_0x18cd36){_0x55bbe5[_0xf715('0x47')]=_0x18cd36;return _0x55bbe5;})[_0xf715('0x24')](respondWithFilteredResult(_0x5b0fbf,_0x1930e8))[_0xf715('0x48')](handleError(_0x5b0fbf,null));};exports[_0xf715('0x49')]=function(_0x394731,_0x2ebe04){var _0x4e823d={'raw':![],'where':{'id':_0x394731[_0xf715('0x4a')]['id']}},_0x1edf3c={};_0x1edf3c[_0xf715('0x34')]=_['keys'](db[_0xf715('0x2f')][_0xf715('0x30')]);_0x1edf3c[_0xf715('0x38')]=_[_0xf715('0x35')](_0x394731['query']);_0x1edf3c[_0xf715('0x36')]=_[_0xf715('0x37')](_0x1edf3c[_0xf715('0x34')],_0x1edf3c[_0xf715('0x38')]);_0x4e823d[_0xf715('0x39')]=_['intersection'](_0x1edf3c[_0xf715('0x34')],qs[_0xf715('0x4b')](_0x394731['query'][_0xf715('0x4b')]));_0x4e823d[_0xf715('0x39')]=_0x4e823d[_0xf715('0x39')][_0xf715('0x3a')]?_0x4e823d[_0xf715('0x39')]:_0x1edf3c['model'];if(_0x394731[_0xf715('0x38')][_0xf715('0x44')]){_0x4e823d[_0xf715('0x45')]=[{'all':!![]}];}_0x4e823d=_['merge']({},_0x4e823d,_0x394731[_0xf715('0x43')]);return db['VoiceMusicOnHold']['find'](_0x4e823d)['then'](handleEntityNotFound(_0x2ebe04,null))[_0xf715('0x24')](respondWithResult(_0x2ebe04,null))['catch'](handleError(_0x2ebe04,null));};exports[_0xf715('0x23')]=function(_0x54ec5d,_0x363508){if(_0x54ec5d[_0xf715('0x4c')]['id']){delete _0x54ec5d[_0xf715('0x4c')]['id'];}return db[_0xf715('0x2f')][_0xf715('0x4d')]({'where':{'id':_0x54ec5d[_0xf715('0x4a')]['id']}})[_0xf715('0x24')](handleEntityNotFound(_0x363508,null))[_0xf715('0x24')](saveUpdates(_0x54ec5d[_0xf715('0x4c')],null))[_0xf715('0x24')](respondWithResult(_0x363508,null))[_0xf715('0x48')](handleError(_0x363508,null));};exports[_0xf715('0x4e')]=function(_0x143cf0,_0x539bb2,_0x28a07b){return db[_0xf715('0x4f')][_0xf715('0x50')](function(_0x5e369a){if(_0x143cf0[_0xf715('0x4c')][_0xf715('0x51')]===_0xf715('0x52')){_0x143cf0['body'][_0xf715('0x53')]=path[_0xf715('0x54')](config[_0xf715('0x55')],'server/files/moh',_0x143cf0[_0xf715('0x4c')]['name']);}return db['VoiceMusicOnHold'][_0xf715('0x4e')](_0x143cf0['body'],{'transaction':_0x5e369a})[_0xf715('0x24')](function(_0x183b4c){if(_0x143cf0['body'][_0xf715('0x51')]===_0xf715('0x52')){fs[_0xf715('0x56')](_0x183b4c[_0xf715('0x53')],parseInt(_0xf715('0x57'),0x8));}var _0x3e8922=_0x143cf0[_0xf715('0x58')][_0xf715('0x26')]({'plain':!![]});if(!_0x3e8922)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e8922[_0xf715('0x59')]===_0xf715('0x58')){var _0xd4e5f5=_0x183b4c[_0xf715('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xf715('0x4d')]({'where':{'name':_0xf715('0x27'),'userProfileId':_0x3e8922['userProfileId']},'raw':!![]})[_0xf715('0x24')](function(_0x11cb59){if(_0x11cb59&&_0x11cb59[_0xf715('0x5a')]===0x0){return db[_0xf715('0x28')][_0xf715('0x4e')]({'name':_0xd4e5f5[_0xf715('0x2b')],'resourceId':_0xd4e5f5['id'],'type':_0x11cb59['name'],'sectionId':_0x11cb59['id']},{})[_0xf715('0x24')](function(){return _0x183b4c;});}else{return _0x183b4c;}})[_0xf715('0x48')](function(_0x5ce180){logger['error'](_0xf715('0x5b'),_0x5ce180);});}return _0x183b4c;});})[_0xf715('0x24')](respondWithResult(_0x539bb2,0xc9))['catch'](handleError(_0x539bb2,null));};exports[_0xf715('0x25')]=function(_0x13d8ec,_0x24d4d2,_0x3287d1){var _0x161417;return db['VoiceMusicOnHold'][_0xf715('0x4d')]({'where':{'id':_0x13d8ec[_0xf715('0x4a')]['id']}})[_0xf715('0x24')](function(_0x416b0f){if(_0x416b0f){return db[_0xf715('0x4f')]['transaction'](function(_0x43eb34){return _0x416b0f['destroy']({'transaction':_0x43eb34,'raw':!![]})[_0xf715('0x24')](function(_0xb6f44){if(_0xb6f44['directory']){fs[_0xf715('0x5c')](_0xb6f44[_0xf715('0x53')])['forEach'](function(_0x233d2e){fs[_0xf715('0x5d')](path[_0xf715('0x54')](_0xb6f44[_0xf715('0x53')],_0x233d2e));});fs[_0xf715('0x5e')](_0xb6f44[_0xf715('0x53')]);}return _0xb6f44;});})[_0xf715('0x48')](function(_0xf88dfa){throw new db[(_0xf715('0x5f'))]['ValidationError'](_0xf88dfa[_0xf715('0x60')]);});}})[_0xf715('0x24')](handleEntityNotFound(_0x24d4d2,null))[_0xf715('0x24')](removeEntity(_0x24d4d2,null))[_0xf715('0x48')](handleError(_0x24d4d2,null));};exports[_0xf715('0x61')]=function(_0x5d8cb4,_0x29d8e6,_0x3892c5){return db['sequelize'][_0xf715('0x50')](function(_0x870b8b){var _0x26b9d6;return db[_0xf715('0x2f')]['find']({'where':{'id':_0x5d8cb4['params']['id']}})[_0xf715('0x24')](function(_0x4065e2){if(_0x4065e2){_0x26b9d6=_0x4065e2;return _0x4065e2[_0xf715('0x61')](_0x5d8cb4[_0xf715('0x4c')]['id'],{'transaction':_0x870b8b});}})[_0xf715('0x24')](function(_0x2e6bf1){if(_0x2e6bf1){return db[_0xf715('0x62')][_0xf715('0x63')]({'where':{'id':_0x5d8cb4[_0xf715('0x4c')]['id']},'attributes':['id','name',_0xf715('0x64'),'converted_format',_0xf715('0x65')],'raw':!![]});}})[_0xf715('0x24')](function(_0x5a2003){if(_0x5a2003){var _0x74940b=path[_0xf715('0x54')](config['root'],_0xf715('0x66'),util[_0xf715('0x67')]('%s.%s',path['basename'](_0x5a2003[_0xf715('0x64')],path[_0xf715('0x68')](_0x5a2003[_0xf715('0x64')])),_0x5a2003['converted_format']));var _0x45bac4=path[_0xf715('0x54')](config[_0xf715('0x55')],'server/files/moh',_0x26b9d6[_0xf715('0x2b')],util[_0xf715('0x67')](_0xf715('0x69'),_0x5a2003[_0xf715('0x2b')],_0x5a2003[_0xf715('0x6a')]));fs[_0xf715('0x6b')](_0x74940b,_0x45bac4);return _0x5a2003;}})[_0xf715('0x48')](function(_0x581958){throw new db['Sequelize'][(_0xf715('0x6c'))](_0x581958[_0xf715('0x60')]);});})[_0xf715('0x24')](handleEntityNotFound(_0x29d8e6,null))['then'](respondWithResult(_0x29d8e6,0xc9))[_0xf715('0x48')](handleError(_0x29d8e6,null));};exports[_0xf715('0x6d')]=function(_0x3c8f9a,_0x206a1f,_0x4889fa){return db[_0xf715('0x4f')][_0xf715('0x50')](function(_0x3097ff){var _0x598c16;return db['VoiceMusicOnHold'][_0xf715('0x63')]({'where':{'id':_0x3c8f9a[_0xf715('0x4a')]['id']}})[_0xf715('0x24')](handleEntityNotFound(_0x206a1f,null))[_0xf715('0x24')](function(_0x9ccedc){if(_0x9ccedc){_0x598c16=_0x9ccedc;return _0x9ccedc[_0xf715('0x6d')](_0x3c8f9a[_0xf715('0x4a')][_0xf715('0x6e')]);}})[_0xf715('0x24')](function(_0x1331e1){if(_0x1331e1){return db[_0xf715('0x62')][_0xf715('0x63')]({'where':{'id':_0x3c8f9a[_0xf715('0x4a')][_0xf715('0x6e')]},'attributes':['id',_0xf715('0x2b'),_0xf715('0x64'),_0xf715('0x6a'),_0xf715('0x65')],'raw':!![]});}})[_0xf715('0x24')](function(_0x3f75c0){if(_0x3f75c0){fs[_0xf715('0x5d')](path[_0xf715('0x54')](_0x598c16[_0xf715('0x53')],util[_0xf715('0x67')](_0xf715('0x69'),_0x3f75c0['name'],_0x3f75c0[_0xf715('0x6a')])));return _0x3f75c0;}})[_0xf715('0x48')](function(_0x56fcf5){throw new db['Sequelize']['ValidationError'](_0x56fcf5['message']);});})['then'](handleEntityNotFound(_0x206a1f,null))[_0xf715('0x24')](respondWithStatusCode(_0x206a1f,0xcc))['catch'](handleError(_0x206a1f,null));};exports[_0xf715('0x6f')]=function(_0x41418b,_0x3ec80b,_0x4aeec3){var _0x5b0818={};var _0x56148c={};var _0x1fbc85;var _0xa2db1f;return db['VoiceMusicOnHold'][_0xf715('0x63')]({'where':{'id':_0x41418b[_0xf715('0x4a')]['id']}})[_0xf715('0x24')](handleEntityNotFound(_0x3ec80b,null))[_0xf715('0x24')](function(_0x3c24b6){if(_0x3c24b6){_0x1fbc85=_0x3c24b6;_0x56148c[_0xf715('0x34')]=_[_0xf715('0x35')](db[_0xf715('0x62')]['rawAttributes']);_0x56148c[_0xf715('0x38')]=_[_0xf715('0x35')](_0x41418b['query']);_0x56148c[_0xf715('0x36')]=_['intersection'](_0x56148c[_0xf715('0x34')],_0x56148c[_0xf715('0x38')]);_0x5b0818['attributes']=_[_0xf715('0x37')](_0x56148c[_0xf715('0x34')],qs[_0xf715('0x4b')](_0x41418b['query'][_0xf715('0x4b')]));_0x5b0818['attributes']=_0x5b0818[_0xf715('0x39')][_0xf715('0x3a')]?_0x5b0818[_0xf715('0x39')]:_0x56148c[_0xf715('0x34')];_0x5b0818[_0xf715('0x3d')]=qs['sort'](_0x41418b[_0xf715('0x38')][_0xf715('0x3e')]);_0x5b0818[_0xf715('0x40')]=qs[_0xf715('0x36')](_[_0xf715('0x3f')](_0x41418b[_0xf715('0x38')],_0x56148c[_0xf715('0x36')]));if(_0x41418b[_0xf715('0x38')][_0xf715('0x70')]){_0x5b0818[_0xf715('0x40')]=_['merge'](_0x5b0818[_0xf715('0x40')],{'$or':_[_0xf715('0x2e')](_0x5b0818[_0xf715('0x39')],function(_0x56ebee){var _0x3e3cb1={};_0x3e3cb1[_0x56ebee]={'$like':'%'+_0x41418b['query'][_0xf715('0x70')]+'%'};return _0x3e3cb1;})});}_0x5b0818=_[_0xf715('0x41')]({},_0x5b0818,_0x41418b[_0xf715('0x43')]);return _0x1fbc85[_0xf715('0x6f')](_0x5b0818);}})[_0xf715('0x24')](function(_0x1f2ef7){if(_0x1f2ef7){_0xa2db1f=_0x1f2ef7[_0xf715('0x3a')];if(!_0x41418b[_0xf715('0x38')][_0xf715('0x3b')](_0xf715('0x3c'))){_0x5b0818[_0xf715('0x1d')]=qs[_0xf715('0x1d')](_0x41418b[_0xf715('0x38')][_0xf715('0x1d')]);_0x5b0818[_0xf715('0x1b')]=qs[_0xf715('0x1b')](_0x41418b[_0xf715('0x38')]['offset']);}return _0x1fbc85['getSounds'](_0x5b0818);}})[_0xf715('0x24')](function(_0x4eaaa3){if(_0x4eaaa3){return _0x4eaaa3?{'count':_0xa2db1f,'rows':_0x4eaaa3}:null;}})[_0xf715('0x24')](respondWithResult(_0x3ec80b,null))[_0xf715('0x48')](handleError(_0x3ec80b,null));}; \ No newline at end of file +var _0x3a26=['reject','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','filters','length','find','body','params','create','sequelize','mode','directory','join','root','server/files/moh','files','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','removeSound','transaction','id2','getSounds','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply'];(function(_0x2acfe8,_0x51c5dd){var _0x5a59d1=function(_0x3f9662){while(--_0x3f9662){_0x2acfe8['push'](_0x2acfe8['shift']());}};_0x5a59d1(++_0x51c5dd);}(_0x3a26,0x198));var _0x63a2=function(_0x10537b,_0x4ae5a7){_0x10537b=_0x10537b-0x0;var _0x2101f2=_0x3a26[_0x10537b];return _0x2101f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x63a2('0x0'));var jsonpatch=require(_0x63a2('0x1'));var rp=require('request-promise');var moment=require(_0x63a2('0x2'));var BPromise=require(_0x63a2('0x3'));var Mustache=require(_0x63a2('0x4'));var util=require(_0x63a2('0x5'));var path=require(_0x63a2('0x6'));var sox=require(_0x63a2('0x7'));var csv=require(_0x63a2('0x8'));var ejs=require(_0x63a2('0x9'));var fs=require('fs');var fs_extra=require(_0x63a2('0xa'));var _=require('lodash');var squel=require(_0x63a2('0xb'));var crypto=require(_0x63a2('0xc'));var jsforce=require(_0x63a2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x63a2('0x8'));var querystring=require('querystring');var Papa=require(_0x63a2('0xe'));var Redis=require(_0x63a2('0xf'));var authService=require(_0x63a2('0x10'));var qs=require(_0x63a2('0x11'));var as=require(_0x63a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63a2('0x13'))('api');var utils=require(_0x63a2('0x14'));var config=require(_0x63a2('0x15'));var licenseUtil=require(_0x63a2('0x16'));var db=require(_0x63a2('0x17'))['db'];function respondWithStatusCode(_0x3c98c7,_0x441a26){_0x441a26=_0x441a26||0xcc;return function(_0x10beb4){if(_0x10beb4){return _0x3c98c7[_0x63a2('0x18')](_0x441a26);}return _0x3c98c7[_0x63a2('0x19')](_0x441a26)[_0x63a2('0x1a')]();};}function respondWithResult(_0x28986e,_0x5651bd){_0x5651bd=_0x5651bd||0xc8;return function(_0x1ee3ee){if(_0x1ee3ee){return _0x28986e[_0x63a2('0x19')](_0x5651bd)['json'](_0x1ee3ee);}};}function respondWithFilteredResult(_0x282a66,_0x5a9e3e){return function(_0x19b081){if(_0x19b081){var _0xaf14d5=typeof _0x5a9e3e[_0x63a2('0x1b')]===_0x63a2('0x1c')&&typeof _0x5a9e3e[_0x63a2('0x1d')]===_0x63a2('0x1c');var _0x18959a=_0x19b081['count'];var _0x3efe3f=_0xaf14d5?0x0:_0x5a9e3e[_0x63a2('0x1b')];var _0xd70253=_0xaf14d5?_0x19b081['count']:_0x5a9e3e[_0x63a2('0x1b')]+_0x5a9e3e[_0x63a2('0x1d')];var _0x5edac1;if(_0xd70253>=_0x18959a){_0xd70253=_0x18959a;_0x5edac1=0xc8;}else{_0x5edac1=0xce;}_0x282a66[_0x63a2('0x19')](_0x5edac1);return _0x282a66[_0x63a2('0x1e')]('Content-Range',_0x3efe3f+'-'+_0xd70253+'/'+_0x18959a)['json'](_0x19b081);}return null;};}function patchUpdates(_0xc078fd){return function(_0x5ad72b){try{jsonpatch[_0x63a2('0x1f')](_0x5ad72b,_0xc078fd,!![]);}catch(_0xbefe59){return BPromise[_0x63a2('0x20')](_0xbefe59);}return _0x5ad72b['save']();};}function saveUpdates(_0x328418,_0x273cb1){return function(_0xd37346){if(_0xd37346){return _0xd37346['update'](_0x328418)[_0x63a2('0x21')](function(_0xa5dbd1){return _0xa5dbd1;});}return null;};}function removeEntity(_0x4da95d,_0x1cae5c){return function(_0x2af153){if(_0x2af153){return _0x2af153['destroy']()[_0x63a2('0x21')](function(){var _0x24b198=_0x2af153[_0x63a2('0x22')]({'plain':!![]});var _0x484059=_0x63a2('0x23');return db[_0x63a2('0x24')][_0x63a2('0x25')]({'where':{'type':_0x484059,'resourceId':_0x24b198['id']}})[_0x63a2('0x21')](function(){return _0x2af153;});})['then'](function(){_0x4da95d[_0x63a2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5ced,_0x192876){return function(_0xbb4b65){if(!_0xbb4b65){_0x2a5ced[_0x63a2('0x18')](0x194);}return _0xbb4b65;};}function handleError(_0x184d3c,_0x2b729b){_0x2b729b=_0x2b729b||0x1f4;return function(_0x17a216){logger[_0x63a2('0x26')](_0x17a216[_0x63a2('0x27')]);if(_0x17a216['name']){delete _0x17a216[_0x63a2('0x28')];}_0x184d3c[_0x63a2('0x19')](_0x2b729b)[_0x63a2('0x29')](_0x17a216);};}exports[_0x63a2('0x2a')]=function(_0xe65fb0,_0x48af15){var _0x5a91a2={},_0x3d086d={},_0x4add36={'count':0x0,'rows':[]};var _0x541caa=_[_0x63a2('0x2b')](db[_0x63a2('0x2c')]['rawAttributes'],function(_0x4fbf8e){return{'name':_0x4fbf8e[_0x63a2('0x2d')],'type':_0x4fbf8e['type'][_0x63a2('0x2e')]};});_0x3d086d[_0x63a2('0x2f')]=_['map'](_0x541caa,_0x63a2('0x28'));_0x3d086d[_0x63a2('0x30')]=_[_0x63a2('0x31')](_0xe65fb0[_0x63a2('0x30')]);_0x3d086d['filters']=_[_0x63a2('0x32')](_0x3d086d['model'],_0x3d086d[_0x63a2('0x30')]);_0x5a91a2[_0x63a2('0x33')]=_[_0x63a2('0x32')](_0x3d086d['model'],qs[_0x63a2('0x34')](_0xe65fb0['query'][_0x63a2('0x34')]));_0x5a91a2['attributes']=_0x5a91a2[_0x63a2('0x33')]['length']?_0x5a91a2[_0x63a2('0x33')]:_0x3d086d[_0x63a2('0x2f')];if(!_0xe65fb0[_0x63a2('0x30')][_0x63a2('0x35')](_0x63a2('0x36'))){_0x5a91a2['limit']=qs['limit'](_0xe65fb0[_0x63a2('0x30')][_0x63a2('0x1d')]);_0x5a91a2[_0x63a2('0x1b')]=qs[_0x63a2('0x1b')](_0xe65fb0[_0x63a2('0x30')]['offset']);}_0x5a91a2[_0x63a2('0x37')]=qs[_0x63a2('0x38')](_0xe65fb0['query'][_0x63a2('0x38')]);delete _0xe65fb0[_0x63a2('0x30')][_0x63a2('0x38')];_0x5a91a2[_0x63a2('0x39')]=qs['filters'](_[_0x63a2('0x3a')](_0xe65fb0['query'],_0x3d086d['filters']),_0x541caa);if(_0xe65fb0[_0x63a2('0x30')][_0x63a2('0x3b')]){_0x5a91a2[_0x63a2('0x39')]=_['merge'](_0x5a91a2[_0x63a2('0x39')],{'$or':_[_0x63a2('0x2b')](_0x541caa,function(_0x5bbd8e){if(_0x5bbd8e[_0x63a2('0x3c')]!=='VIRTUAL'){var _0xba240f={};_0xba240f[_0x5bbd8e[_0x63a2('0x28')]]={'$like':'%'+_0xe65fb0[_0x63a2('0x30')][_0x63a2('0x3b')]+'%'};return _0xba240f;}})});}_0x5a91a2=_[_0x63a2('0x3d')]({},_0x5a91a2,_0xe65fb0[_0x63a2('0x3e')]);var _0x1f543d={'where':_0x5a91a2[_0x63a2('0x39')]};return db[_0x63a2('0x2c')][_0x63a2('0x3f')](_0x1f543d)[_0x63a2('0x21')](function(_0x4e6b7e){_0x4add36[_0x63a2('0x3f')]=_0x4e6b7e;if(_0xe65fb0['query'][_0x63a2('0x40')]){_0x5a91a2[_0x63a2('0x41')]=[{'all':!![]}];}return db[_0x63a2('0x2c')][_0x63a2('0x42')](_0x5a91a2);})['then'](function(_0x3808f2){_0x4add36[_0x63a2('0x43')]=_0x3808f2;return _0x4add36;})[_0x63a2('0x21')](respondWithFilteredResult(_0x48af15,_0x5a91a2))[_0x63a2('0x44')](handleError(_0x48af15,null));};exports[_0x63a2('0x45')]=function(_0x3a0085,_0x40d4a3){var _0x3af445={'raw':![],'where':{'id':_0x3a0085['params']['id']}},_0x2ec8e2={};_0x2ec8e2[_0x63a2('0x2f')]=_['keys'](db[_0x63a2('0x2c')][_0x63a2('0x46')]);_0x2ec8e2[_0x63a2('0x30')]=_['keys'](_0x3a0085[_0x63a2('0x30')]);_0x2ec8e2[_0x63a2('0x47')]=_['intersection'](_0x2ec8e2[_0x63a2('0x2f')],_0x2ec8e2['query']);_0x3af445[_0x63a2('0x33')]=_['intersection'](_0x2ec8e2[_0x63a2('0x2f')],qs[_0x63a2('0x34')](_0x3a0085[_0x63a2('0x30')]['fields']));_0x3af445['attributes']=_0x3af445[_0x63a2('0x33')][_0x63a2('0x48')]?_0x3af445['attributes']:_0x2ec8e2[_0x63a2('0x2f')];if(_0x3a0085[_0x63a2('0x30')][_0x63a2('0x40')]){_0x3af445[_0x63a2('0x41')]=[{'all':!![]}];}_0x3af445=_[_0x63a2('0x3d')]({},_0x3af445,_0x3a0085[_0x63a2('0x3e')]);return db[_0x63a2('0x2c')][_0x63a2('0x49')](_0x3af445)[_0x63a2('0x21')](handleEntityNotFound(_0x40d4a3,null))[_0x63a2('0x21')](respondWithResult(_0x40d4a3,null))[_0x63a2('0x44')](handleError(_0x40d4a3,null));};exports['update']=function(_0x2b683c,_0x561b5e){if(_0x2b683c[_0x63a2('0x4a')]['id']){delete _0x2b683c[_0x63a2('0x4a')]['id'];}return db[_0x63a2('0x2c')][_0x63a2('0x49')]({'where':{'id':_0x2b683c[_0x63a2('0x4b')]['id']}})[_0x63a2('0x21')](handleEntityNotFound(_0x561b5e,null))['then'](saveUpdates(_0x2b683c[_0x63a2('0x4a')],null))[_0x63a2('0x21')](respondWithResult(_0x561b5e,null))[_0x63a2('0x44')](handleError(_0x561b5e,null));};exports[_0x63a2('0x4c')]=function(_0x3df023,_0x2a2e8f,_0x80e91f){return db[_0x63a2('0x4d')]['transaction'](function(_0x2cc451){if(_0x3df023[_0x63a2('0x4a')][_0x63a2('0x4e')]==='files'){_0x3df023['body'][_0x63a2('0x4f')]=path[_0x63a2('0x50')](config[_0x63a2('0x51')],_0x63a2('0x52'),_0x3df023[_0x63a2('0x4a')][_0x63a2('0x28')]);}return db[_0x63a2('0x2c')][_0x63a2('0x4c')](_0x3df023[_0x63a2('0x4a')],{'transaction':_0x2cc451})[_0x63a2('0x21')](function(_0x282fb4){if(_0x3df023['body'][_0x63a2('0x4e')]===_0x63a2('0x53')){fs['mkdirSync'](_0x282fb4[_0x63a2('0x4f')],parseInt('0777',0x8));}var _0x2e40d7=_0x3df023[_0x63a2('0x54')][_0x63a2('0x22')]({'plain':!![]});if(!_0x2e40d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40d7[_0x63a2('0x55')]===_0x63a2('0x54')){var _0x53ef13=_0x282fb4['get']({'plain':!![]});return db['UserProfileSection'][_0x63a2('0x49')]({'where':{'name':_0x63a2('0x23'),'userProfileId':_0x2e40d7['userProfileId']},'raw':!![]})['then'](function(_0x2de07f){if(_0x2de07f&&_0x2de07f['autoAssociation']===0x0){return db['UserProfileResource'][_0x63a2('0x4c')]({'name':_0x53ef13['name'],'resourceId':_0x53ef13['id'],'type':_0x2de07f['name'],'sectionId':_0x2de07f['id']},{})[_0x63a2('0x21')](function(){return _0x282fb4;});}else{return _0x282fb4;}})[_0x63a2('0x44')](function(_0x7373e7){logger['error'](_0x63a2('0x56'),_0x7373e7);});}return _0x282fb4;});})[_0x63a2('0x21')](respondWithResult(_0x2a2e8f,0xc9))[_0x63a2('0x44')](handleError(_0x2a2e8f,null));};exports[_0x63a2('0x25')]=function(_0x26de84,_0x10ec03,_0xdcdcdb){var _0x19c8d1;return db[_0x63a2('0x2c')][_0x63a2('0x49')]({'where':{'id':_0x26de84[_0x63a2('0x4b')]['id']}})[_0x63a2('0x21')](function(_0x1edc5e){if(_0x1edc5e){return db[_0x63a2('0x4d')]['transaction'](function(_0x20a49b){return _0x1edc5e[_0x63a2('0x25')]({'transaction':_0x20a49b,'raw':!![]})[_0x63a2('0x21')](function(_0x222ed2){if(_0x222ed2[_0x63a2('0x4f')]){fs[_0x63a2('0x57')](_0x222ed2[_0x63a2('0x4f')])[_0x63a2('0x58')](function(_0x738138){fs[_0x63a2('0x59')](path['join'](_0x222ed2[_0x63a2('0x4f')],_0x738138));});fs[_0x63a2('0x5a')](_0x222ed2[_0x63a2('0x4f')]);}return _0x222ed2;});})[_0x63a2('0x44')](function(_0x798fdf){throw new db[(_0x63a2('0x5b'))][(_0x63a2('0x5c'))](_0x798fdf[_0x63a2('0x5d')]);});}})[_0x63a2('0x21')](handleEntityNotFound(_0x10ec03,null))[_0x63a2('0x21')](removeEntity(_0x10ec03,null))[_0x63a2('0x44')](handleError(_0x10ec03,null));};exports[_0x63a2('0x5e')]=function(_0xfaea31,_0x45f1bb,_0x4b3e87){return db[_0x63a2('0x4d')]['transaction'](function(_0x8c19e2){var _0x24de84;return db[_0x63a2('0x2c')][_0x63a2('0x49')]({'where':{'id':_0xfaea31[_0x63a2('0x4b')]['id']}})['then'](function(_0x43d265){if(_0x43d265){_0x24de84=_0x43d265;return _0x43d265['addSound'](_0xfaea31['body']['id'],{'transaction':_0x8c19e2});}})['then'](function(_0x3cc2e3){if(_0x3cc2e3){return db[_0x63a2('0x5f')][_0x63a2('0x60')]({'where':{'id':_0xfaea31[_0x63a2('0x4a')]['id']},'attributes':['id','name',_0x63a2('0x61'),_0x63a2('0x62'),_0x63a2('0x63')],'raw':!![]});}})[_0x63a2('0x21')](function(_0x4b4640){if(_0x4b4640){var _0x2d7767=path[_0x63a2('0x50')](config['root'],_0x63a2('0x64'),util['format'](_0x63a2('0x65'),path[_0x63a2('0x66')](_0x4b4640[_0x63a2('0x61')],path[_0x63a2('0x67')](_0x4b4640['save_name'])),_0x4b4640[_0x63a2('0x62')]));var _0x2437c9=path[_0x63a2('0x50')](config[_0x63a2('0x51')],_0x63a2('0x52'),_0x24de84[_0x63a2('0x28')],util[_0x63a2('0x68')](_0x63a2('0x65'),_0x4b4640['name'],_0x4b4640['converted_format']));fs[_0x63a2('0x69')](_0x2d7767,_0x2437c9);return _0x4b4640;}})[_0x63a2('0x44')](function(_0x23d743){throw new db[(_0x63a2('0x5b'))]['ValidationError'](_0x23d743['message']);});})[_0x63a2('0x21')](handleEntityNotFound(_0x45f1bb,null))[_0x63a2('0x21')](respondWithResult(_0x45f1bb,0xc9))[_0x63a2('0x44')](handleError(_0x45f1bb,null));};exports[_0x63a2('0x6a')]=function(_0x6437d4,_0x11aa21,_0x35b20c){return db[_0x63a2('0x4d')][_0x63a2('0x6b')](function(_0x44e348){var _0x1b7de1;return db[_0x63a2('0x2c')][_0x63a2('0x60')]({'where':{'id':_0x6437d4[_0x63a2('0x4b')]['id']}})[_0x63a2('0x21')](handleEntityNotFound(_0x11aa21,null))[_0x63a2('0x21')](function(_0x9adf0e){if(_0x9adf0e){_0x1b7de1=_0x9adf0e;return _0x9adf0e[_0x63a2('0x6a')](_0x6437d4[_0x63a2('0x4b')][_0x63a2('0x6c')]);}})[_0x63a2('0x21')](function(_0x4a5ac5){if(_0x4a5ac5){return db[_0x63a2('0x5f')][_0x63a2('0x60')]({'where':{'id':_0x6437d4[_0x63a2('0x4b')][_0x63a2('0x6c')]},'attributes':['id',_0x63a2('0x28'),'save_name',_0x63a2('0x62'),_0x63a2('0x63')],'raw':!![]});}})[_0x63a2('0x21')](function(_0x5eab85){if(_0x5eab85){fs[_0x63a2('0x59')](path[_0x63a2('0x50')](_0x1b7de1[_0x63a2('0x4f')],util['format'](_0x63a2('0x65'),_0x5eab85[_0x63a2('0x28')],_0x5eab85[_0x63a2('0x62')])));return _0x5eab85;}})[_0x63a2('0x44')](function(_0x134dda){throw new db[(_0x63a2('0x5b'))][(_0x63a2('0x5c'))](_0x134dda['message']);});})[_0x63a2('0x21')](handleEntityNotFound(_0x11aa21,null))[_0x63a2('0x21')](respondWithStatusCode(_0x11aa21,0xcc))['catch'](handleError(_0x11aa21,null));};exports['getSounds']=function(_0x121e0c,_0x388316,_0x2bc2e1){var _0x4f5743={};var _0x1d59aa={};var _0x54044b;var _0x3fa5de;return db['VoiceMusicOnHold'][_0x63a2('0x60')]({'where':{'id':_0x121e0c[_0x63a2('0x4b')]['id']}})[_0x63a2('0x21')](handleEntityNotFound(_0x388316,null))[_0x63a2('0x21')](function(_0x34253b){if(_0x34253b){_0x54044b=_0x34253b;_0x1d59aa[_0x63a2('0x2f')]=_['keys'](db[_0x63a2('0x5f')][_0x63a2('0x46')]);_0x1d59aa[_0x63a2('0x30')]=_[_0x63a2('0x31')](_0x121e0c[_0x63a2('0x30')]);_0x1d59aa['filters']=_['intersection'](_0x1d59aa['model'],_0x1d59aa[_0x63a2('0x30')]);_0x4f5743['attributes']=_['intersection'](_0x1d59aa['model'],qs[_0x63a2('0x34')](_0x121e0c['query'][_0x63a2('0x34')]));_0x4f5743['attributes']=_0x4f5743[_0x63a2('0x33')][_0x63a2('0x48')]?_0x4f5743[_0x63a2('0x33')]:_0x1d59aa[_0x63a2('0x2f')];_0x4f5743[_0x63a2('0x37')]=qs['sort'](_0x121e0c[_0x63a2('0x30')][_0x63a2('0x38')]);_0x4f5743[_0x63a2('0x39')]=qs['filters'](_[_0x63a2('0x3a')](_0x121e0c[_0x63a2('0x30')],_0x1d59aa[_0x63a2('0x47')]));if(_0x121e0c[_0x63a2('0x30')][_0x63a2('0x3b')]){_0x4f5743[_0x63a2('0x39')]=_[_0x63a2('0x3d')](_0x4f5743['where'],{'$or':_[_0x63a2('0x2b')](_0x4f5743[_0x63a2('0x33')],function(_0x37342d){var _0x7d0cfc={};_0x7d0cfc[_0x37342d]={'$like':'%'+_0x121e0c[_0x63a2('0x30')]['filter']+'%'};return _0x7d0cfc;})});}_0x4f5743=_[_0x63a2('0x3d')]({},_0x4f5743,_0x121e0c[_0x63a2('0x3e')]);return _0x54044b[_0x63a2('0x6d')](_0x4f5743);}})[_0x63a2('0x21')](function(_0x42a471){if(_0x42a471){_0x3fa5de=_0x42a471[_0x63a2('0x48')];if(!_0x121e0c[_0x63a2('0x30')][_0x63a2('0x35')](_0x63a2('0x36'))){_0x4f5743[_0x63a2('0x1d')]=qs[_0x63a2('0x1d')](_0x121e0c[_0x63a2('0x30')][_0x63a2('0x1d')]);_0x4f5743['offset']=qs[_0x63a2('0x1b')](_0x121e0c[_0x63a2('0x30')][_0x63a2('0x1b')]);}return _0x54044b['getSounds'](_0x4f5743);}})[_0x63a2('0x21')](function(_0x4a306c){if(_0x4a306c){return _0x4a306c?{'count':_0x3fa5de,'rows':_0x4a306c}:null;}})[_0x63a2('0x21')](respondWithResult(_0x388316,null))[_0x63a2('0x44')](handleError(_0x388316,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index a42bf7a..f11d486 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 _0x0a9f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold','voice_musiconhold','lodash','util','api'];(function(_0x2e22ae,_0xe2b88f){var _0x29de09=function(_0x283ce7){while(--_0x283ce7){_0x2e22ae['push'](_0x2e22ae['shift']());}};_0x29de09(++_0xe2b88f);}(_0x0a9f,0xbd));var _0xf0a9=function(_0x40ca0c,_0x1d3ce0){_0x40ca0c=_0x40ca0c-0x0;var _0x5a1c45=_0x0a9f[_0x40ca0c];return _0x5a1c45;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var logger=require('../../config/logger')(_0xf0a9('0x2'));var moment=require(_0xf0a9('0x3'));var BPromise=require(_0xf0a9('0x4'));var rp=require(_0xf0a9('0x5'));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['exports']=function(_0x14b9c6,_0x54c9a0){return _0x14b9c6['define'](_0xf0a9('0xa'),attributes,{'tableName':_0xf0a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbb8=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','api','moment'];(function(_0x1e2174,_0x4331dc){var _0x2e71b8=function(_0x2b4c1d){while(--_0x2b4c1d){_0x1e2174['push'](_0x1e2174['shift']());}};_0x2e71b8(++_0x4331dc);}(_0xfbb8,0xe4));var _0x8fbb=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xfbb8[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0x8fbb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8fbb('0x1'));var moment=require(_0x8fbb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbb('0x3'));var rimraf=require(_0x8fbb('0x4'));var config=require(_0x8fbb('0x5'));var attributes=require(_0x8fbb('0x6'));module[_0x8fbb('0x7')]=function(_0x36a65e,_0x268a13){return _0x36a65e[_0x8fbb('0x8')](_0x8fbb('0x9'),attributes,{'tableName':_0x8fbb('0xa'),'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 5928c58..e6722f2 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x585bd4,_0x1e2772){var _0x7eed4a=function(_0x396da4){while(--_0x396da4){_0x585bd4['push'](_0x585bd4['shift']());}};_0x7eed4a(++_0x1e2772);}(_0x70e0,0x17b));var _0x070e=function(_0x3db8f9,_0x19ae45){_0x3db8f9=_0x3db8f9-0x0;var _0x322e2c=_0x70e0[_0x3db8f9];return _0x322e2c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x29b367,_0x107a78){var _0x18ae72=function(_0x5c3bfd){while(--_0x5c3bfd){_0x29b367['push'](_0x29b367['shift']());}};_0x18ae72(++_0x107a78);}(_0xe706,0xa3));var _0x6e70=function(_0x19b56f,_0x4cbbd9){_0x19b56f=_0x19b56f-0x0;var _0x1e69f9=_0xe706[_0x19b56f];return _0x1e69f9;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6185161..cc8fff1 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 _0xf483=['addAgents','addTeams','put','delete','removeAgents','/:id/teams','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users','getTeams','post','create'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0xf483,0xf2));var _0x3f48=function(_0x1b28e,_0x3837e5){_0x1b28e=_0x1b28e-0x0;var _0x48856f=_0xf483[_0x1b28e];return _0x48856f;};'use strict';var multer=require('multer');var util=require(_0x3f48('0x0'));var path=require('path');var timeout=require(_0x3f48('0x1'));var express=require(_0x3f48('0x2'));var router=express[_0x3f48('0x3')]();var fs_extra=require(_0x3f48('0x4'));var auth=require(_0x3f48('0x5'));var interaction=require(_0x3f48('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x3f48('0x7')](),controller[_0x3f48('0x8')]);router['get'](_0x3f48('0x9'),auth[_0x3f48('0x7')](),controller[_0x3f48('0xa')]);router[_0x3f48('0xb')](_0x3f48('0xc'),auth[_0x3f48('0x7')](),controller[_0x3f48('0xd')]);router['get'](_0x3f48('0xe'),auth[_0x3f48('0x7')](),controller['getAgents']);router[_0x3f48('0xb')]('/:id/teams',auth[_0x3f48('0x7')](),controller[_0x3f48('0xf')]);router[_0x3f48('0x10')]('/',auth[_0x3f48('0x7')](),controller[_0x3f48('0x11')]);router[_0x3f48('0x10')](_0x3f48('0xe'),auth[_0x3f48('0x7')](),controller[_0x3f48('0x12')]);router[_0x3f48('0x10')]('/:id/teams',auth[_0x3f48('0x7')](),controller[_0x3f48('0x13')]);router[_0x3f48('0x14')]('/:id',auth[_0x3f48('0x7')](),controller['update']);router[_0x3f48('0x15')](_0x3f48('0xc'),auth[_0x3f48('0x7')](),controller['destroy']);router[_0x3f48('0x15')](_0x3f48('0xe'),auth[_0x3f48('0x7')](),controller[_0x3f48('0x16')]);router['delete'](_0x3f48('0x17'),auth[_0x3f48('0x7')](),controller[_0x3f48('0x18')]);module[_0x3f48('0x19')]=router; \ No newline at end of file +var _0xdace=['get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','update','delete','destroy','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller'];(function(_0x354afe,_0x2a46aa){var _0x21442f=function(_0x230002){while(--_0x230002){_0x354afe['push'](_0x354afe['shift']());}};_0x21442f(++_0x2a46aa);}(_0xdace,0xc1));var _0xedac=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xdace[_0x2cfb58];return _0xd99951;};'use strict';var multer=require('multer');var util=require(_0xedac('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xedac('0x1'));var auth=require(_0xedac('0x2'));var interaction=require(_0xedac('0x3'));var config=require('../../config/environment');var controller=require(_0xedac('0x4'));router[_0xedac('0x5')]('/',auth[_0xedac('0x6')](),controller[_0xedac('0x7')]);router[_0xedac('0x5')](_0xedac('0x8'),auth[_0xedac('0x6')](),controller['describe']);router[_0xedac('0x5')](_0xedac('0x9'),auth[_0xedac('0x6')](),controller[_0xedac('0xa')]);router[_0xedac('0x5')](_0xedac('0xb'),auth[_0xedac('0x6')](),controller[_0xedac('0xc')]);router[_0xedac('0x5')](_0xedac('0xd'),auth[_0xedac('0x6')](),controller[_0xedac('0xe')]);router[_0xedac('0xf')]('/',auth[_0xedac('0x6')](),controller[_0xedac('0x10')]);router[_0xedac('0xf')](_0xedac('0xb'),auth[_0xedac('0x6')](),controller['addAgents']);router['post'](_0xedac('0xd'),auth[_0xedac('0x6')](),controller[_0xedac('0x11')]);router['put'](_0xedac('0x9'),auth[_0xedac('0x6')](),controller[_0xedac('0x12')]);router[_0xedac('0x13')](_0xedac('0x9'),auth['isAuthenticated'](),controller[_0xedac('0x14')]);router[_0xedac('0x13')]('/:id/users',auth[_0xedac('0x6')](),controller['removeAgents']);router[_0xedac('0x13')](_0xedac('0xd'),auth[_0xedac('0x6')](),controller['removeTeams']);module[_0xedac('0x15')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a0eacec..3f2a894 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 _0x967f=['getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x967f,0x68));var _0xf967=function(_0x1f0214,_0x4f4f84){_0x1f0214=_0x1f0214-0x0;var _0x22650e=_0x967f[_0x1f0214];return _0x22650e;};'use strict';var Sequelize=require(_0xf967('0x0'));module[_0xf967('0x1')]={'name':{'type':Sequelize[_0xf967('0x2')],'allowNull':![],'unique':_0xf967('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x118f56){return'system-'+this[_0xf967('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0xf967('0x2')]},'callerIdAll':{'type':Sequelize[_0xf967('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf967('0x5')]}}; \ No newline at end of file +var _0x5310=['INTEGER','sequelize','exports','STRING','VIRTUAL','getDataValue','name'];(function(_0x11e9a2,_0x3c802f){var _0x66253d=function(_0x1a44cd){while(--_0x1a44cd){_0x11e9a2['push'](_0x11e9a2['shift']());}};_0x66253d(++_0x3c802f);}(_0x5310,0xd3));var _0x0531=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x5310[_0x2ef44b];return _0x2405b9;};'use strict';var Sequelize=require(_0x0531('0x0'));module[_0x0531('0x1')]={'name':{'type':Sequelize[_0x0531('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x0531('0x3')],'get':function(_0x383a62){return'system-'+this[_0x0531('0x4')](_0x0531('0x5'))+'-';}},'description':{'type':Sequelize[_0x0531('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x0531('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index cdd7da8..22789a4 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 _0x66fa=['undefined','limit','count','offset','set','Content-Range','apply','save','destroy','get','VoicePrefixes','UserProfileResource','then','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','sequelize','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','nolimit','getTeams','addTeams','Team','voicePause','interface','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','union','compact','isEmpty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','sendStatus','status','end','json'];(function(_0xe5eb53,_0x8a6659){var _0x536b54=function(_0x34e850){while(--_0x34e850){_0xe5eb53['push'](_0xe5eb53['shift']());}};_0x536b54(++_0x8a6659);}(_0x66fa,0x117));var _0xa66f=function(_0x1302d0,_0x28a30c){_0x1302d0=_0x1302d0-0x0;var _0x58a5a1=_0x66fa[_0x1302d0];return _0x58a5a1;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];config[_0xa66f('0x15')]=_[_0xa66f('0x16')](config[_0xa66f('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa66f('0x15')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x5a7b16,_0x3ac0ac){_0x3ac0ac=_0x3ac0ac||0xcc;return function(_0x452c37){if(_0x452c37){return _0x5a7b16[_0xa66f('0x17')](_0x3ac0ac);}return _0x5a7b16[_0xa66f('0x18')](_0x3ac0ac)[_0xa66f('0x19')]();};}function respondWithResult(_0x567d4f,_0x5510dc){_0x5510dc=_0x5510dc||0xc8;return function(_0x19b5ac){if(_0x19b5ac){return _0x567d4f[_0xa66f('0x18')](_0x5510dc)[_0xa66f('0x1a')](_0x19b5ac);}};}function respondWithFilteredResult(_0x403f4d,_0x5c67f5){return function(_0x1cbe64){if(_0x1cbe64){var _0x55b59d=typeof _0x5c67f5['offset']===_0xa66f('0x1b')&&typeof _0x5c67f5[_0xa66f('0x1c')]===_0xa66f('0x1b');var _0x355ddc=_0x1cbe64[_0xa66f('0x1d')];var _0x408bc7=_0x55b59d?0x0:_0x5c67f5[_0xa66f('0x1e')];var _0x150291=_0x55b59d?_0x1cbe64[_0xa66f('0x1d')]:_0x5c67f5[_0xa66f('0x1e')]+_0x5c67f5[_0xa66f('0x1c')];var _0xbba376;if(_0x150291>=_0x355ddc){_0x150291=_0x355ddc;_0xbba376=0xc8;}else{_0xbba376=0xce;}_0x403f4d[_0xa66f('0x18')](_0xbba376);return _0x403f4d[_0xa66f('0x1f')](_0xa66f('0x20'),_0x408bc7+'-'+_0x150291+'/'+_0x355ddc)['json'](_0x1cbe64);}return null;};}function patchUpdates(_0x27f570){return function(_0xc5c82e){try{jsonpatch[_0xa66f('0x21')](_0xc5c82e,_0x27f570,!![]);}catch(_0x37ee13){return BPromise['reject'](_0x37ee13);}return _0xc5c82e[_0xa66f('0x22')]();};}function saveUpdates(_0x473822,_0x209f4d){return function(_0x16f1fa){if(_0x16f1fa){return _0x16f1fa['update'](_0x473822)['then'](function(_0xed98b9){return _0xed98b9;});}return null;};}function removeEntity(_0x598942,_0x3a3e4f){return function(_0xc661f2){if(_0xc661f2){return _0xc661f2[_0xa66f('0x23')]()['then'](function(){var _0x4683c7=_0xc661f2[_0xa66f('0x24')]({'plain':!![]});var _0x13495f=_0xa66f('0x25');return db[_0xa66f('0x26')][_0xa66f('0x23')]({'where':{'type':_0x13495f,'resourceId':_0x4683c7['id']}})[_0xa66f('0x27')](function(){return _0xc661f2;});})[_0xa66f('0x27')](function(){_0x598942[_0xa66f('0x18')](0xcc)[_0xa66f('0x19')]();});}};}function handleEntityNotFound(_0x45f71c,_0x63650b){return function(_0x42b966){if(!_0x42b966){_0x45f71c[_0xa66f('0x17')](0x194);}return _0x42b966;};}function handleError(_0x49f615,_0x4c0695){_0x4c0695=_0x4c0695||0x1f4;return function(_0x38daac){logger[_0xa66f('0x28')](_0x38daac['stack']);if(_0x38daac[_0xa66f('0x29')]){delete _0x38daac[_0xa66f('0x29')];}_0x49f615['status'](_0x4c0695)[_0xa66f('0x2a')](_0x38daac);};}exports[_0xa66f('0x2b')]=function(_0x9d78d5,_0x2c2ace){var _0x395623={},_0x548add={},_0x1b2c5a={'count':0x0,'rows':[]};var _0x4fcdc1=_[_0xa66f('0x2c')](db[_0xa66f('0x2d')][_0xa66f('0x2e')],function(_0x486e4e){return{'name':_0x486e4e[_0xa66f('0x2f')],'type':_0x486e4e[_0xa66f('0x30')]['key']};});_0x548add[_0xa66f('0x31')]=_[_0xa66f('0x2c')](_0x4fcdc1,_0xa66f('0x29'));_0x548add[_0xa66f('0x32')]=_[_0xa66f('0x33')](_0x9d78d5[_0xa66f('0x32')]);_0x548add[_0xa66f('0x34')]=_[_0xa66f('0x35')](_0x548add[_0xa66f('0x31')],_0x548add[_0xa66f('0x32')]);_0x395623['attributes']=_[_0xa66f('0x35')](_0x548add['model'],qs[_0xa66f('0x36')](_0x9d78d5[_0xa66f('0x32')][_0xa66f('0x36')]));_0x395623[_0xa66f('0x37')]=_0x395623[_0xa66f('0x37')][_0xa66f('0x38')]?_0x395623[_0xa66f('0x37')]:_0x548add[_0xa66f('0x31')];if(!_0x9d78d5['query'][_0xa66f('0x39')]('nolimit')){_0x395623[_0xa66f('0x1c')]=qs[_0xa66f('0x1c')](_0x9d78d5[_0xa66f('0x32')]['limit']);_0x395623['offset']=qs[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x32')][_0xa66f('0x1e')]);}_0x395623[_0xa66f('0x3a')]=qs[_0xa66f('0x3b')](_0x9d78d5['query']['sort']);_0x395623['where']=qs[_0xa66f('0x34')](_['pick'](_0x9d78d5['query'],_0x548add['filters']),_0x4fcdc1);if(_0x9d78d5[_0xa66f('0x32')]['filter']){_0x395623[_0xa66f('0x3c')]=_[_0xa66f('0x3d')](_0x395623[_0xa66f('0x3c')],{'$or':_[_0xa66f('0x2c')](_0x4fcdc1,function(_0xd65c5d){if(_0xd65c5d[_0xa66f('0x30')]!==_0xa66f('0x3e')){var _0x261089={};_0x261089[_0xd65c5d[_0xa66f('0x29')]]={'$like':'%'+_0x9d78d5[_0xa66f('0x32')][_0xa66f('0x3f')]+'%'};return _0x261089;}})});}_0x395623=_[_0xa66f('0x3d')]({},_0x395623,_0x9d78d5[_0xa66f('0x40')]);var _0x13875a={'where':_0x395623['where']};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x13875a)['then'](function(_0x248587){_0x1b2c5a['count']=_0x248587;if(_0x9d78d5[_0xa66f('0x32')][_0xa66f('0x41')]){_0x395623['include']=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x42')](_0x395623);})[_0xa66f('0x27')](function(_0x5276ea){_0x1b2c5a[_0xa66f('0x43')]=_0x5276ea;return _0x1b2c5a;})['then'](respondWithFilteredResult(_0x2c2ace,_0x395623))[_0xa66f('0x44')](handleError(_0x2c2ace,null));};exports[_0xa66f('0x45')]=function(_0xb52cc6,_0x3a499e){var _0x10b70a={'raw':![],'where':{'id':_0xb52cc6[_0xa66f('0x46')]['id']}},_0x46ae78={};_0x46ae78['model']=_[_0xa66f('0x33')](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0x46ae78[_0xa66f('0x32')]=_[_0xa66f('0x33')](_0xb52cc6['query']);_0x46ae78['filters']=_[_0xa66f('0x35')](_0x46ae78[_0xa66f('0x31')],_0x46ae78[_0xa66f('0x32')]);_0x10b70a[_0xa66f('0x37')]=_[_0xa66f('0x35')](_0x46ae78[_0xa66f('0x31')],qs['fields'](_0xb52cc6[_0xa66f('0x32')][_0xa66f('0x36')]));_0x10b70a[_0xa66f('0x37')]=_0x10b70a['attributes']['length']?_0x10b70a[_0xa66f('0x37')]:_0x46ae78[_0xa66f('0x31')];if(_0xb52cc6[_0xa66f('0x32')]['includeAll']){_0x10b70a['include']=[{'all':!![]}];}_0x10b70a=_['merge']({},_0x10b70a,_0xb52cc6[_0xa66f('0x40')]);return db[_0xa66f('0x2d')][_0xa66f('0x47')](_0x10b70a)[_0xa66f('0x27')](handleEntityNotFound(_0x3a499e,null))[_0xa66f('0x27')](respondWithResult(_0x3a499e,null))[_0xa66f('0x44')](handleError(_0x3a499e,null));};exports[_0xa66f('0x23')]=function(_0x15de06,_0x56758a){return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0x15de06[_0xa66f('0x46')]['id']}})[_0xa66f('0x27')](handleEntityNotFound(_0x56758a,null))[_0xa66f('0x27')](removeEntity(_0x56758a,null))[_0xa66f('0x44')](handleError(_0x56758a,null));};exports['describe']=function(_0x1840af,_0xf6984b){return db[_0xa66f('0x2d')][_0xa66f('0x48')]()[_0xa66f('0x27')](respondWithResult(_0xf6984b,null))['catch'](handleError(_0xf6984b,null));};exports[_0xa66f('0x49')]=function(_0x50e0cd,_0x292648){var _0x5dc2b8;return db['sequelize'][_0xa66f('0x4a')](function(_0x31233b){return db[_0xa66f('0x2d')][_0xa66f('0x49')](_0x50e0cd[_0xa66f('0x4b')],{'transaction':_0x31233b})[_0xa66f('0x27')](function(_0x53a62f){_0x5dc2b8=_0x53a62f[_0xa66f('0x24')]({'plain':!![]});return db[_0xa66f('0x4c')][_0xa66f('0x47')]({'where':{'id':_0x5dc2b8[_0xa66f('0x4d')]},'raw':!![]})['then'](function(_0x1a81c4){return createVoicePrefixExtensions(_0x5dc2b8,_0x1a81c4,_0x31233b);});});})['then'](function(){var _0x8247aa=_0x50e0cd[_0xa66f('0x4e')][_0xa66f('0x24')]({'plain':!![]});if(!_0x8247aa)throw new Error(_0xa66f('0x4f'));if(_0x8247aa[_0xa66f('0x50')]===_0xa66f('0x4e')){var _0x44ea10=_0x5dc2b8;return db['UserProfileSection'][_0xa66f('0x47')]({'where':{'name':_0xa66f('0x25'),'userProfileId':_0x8247aa[_0xa66f('0x51')]},'raw':!![]})[_0xa66f('0x27')](function(_0x38decb){if(_0x38decb&&_0x38decb[_0xa66f('0x52')]===0x0){return db[_0xa66f('0x26')][_0xa66f('0x49')]({'name':_0x44ea10[_0xa66f('0x29')],'resourceId':_0x44ea10['id'],'type':_0x38decb['name'],'sectionId':_0x38decb['id']},{})['then'](function(){return _0x5dc2b8;});}else{return _0x5dc2b8;}})[_0xa66f('0x44')](function(_0x8c7bdc){logger[_0xa66f('0x28')](_0xa66f('0x53'),_0x8c7bdc);throw _0x8c7bdc;});}return _0x5dc2b8;})[_0xa66f('0x27')](respondWithResult(_0x292648,null))[_0xa66f('0x44')](handleError(_0x292648,null));};function Extension(_0x8bea2b,_0x4b10cf,_0x1709eb,_0x11c89e){this[_0xa66f('0x54')]=_0xa66f('0x55');this['exten']=_0x8bea2b;this[_0xa66f('0x56')]=_0x1709eb;this[_0xa66f('0x30')]=_0xa66f('0x57');this[_0xa66f('0x58')]=_0xa66f('0x59');this[_0xa66f('0x5a')]=_0x4b10cf;this['appdata']=_0x11c89e;}function createVoicePrefixExtensions(_0x4b31f7,_0x15fea8,_0x31b81b){return new BPromise(function(_0x174aad,_0x52edb3){var _0x442dd1=new Extension(formatPrefixName(_0x4b31f7[_0xa66f('0x5b')]),0x1,_0xa66f('0x5c'),_0xa66f('0x5d'));_0x442dd1[_0xa66f('0x5e')]=_0x4b31f7['id'];return db[_0xa66f('0x4c')][_0xa66f('0x49')](_0x442dd1,{'transaction':_0x31b81b})[_0xa66f('0x27')](function(_0x3b8428){var _0x5d4299=_0x3b8428[_0xa66f('0x24')]({'plain':!![]});var _0x2d751e=_[_0xa66f('0x2c')](addVoicePrefixExtensions(_0x4b31f7,_0x15fea8),function(_0x172c42){_0x172c42[_0xa66f('0x4d')]=_0x5d4299['id'];_0x172c42[_0xa66f('0x5e')]=_0x4b31f7['id'];return _0x172c42;});return db[_0xa66f('0x4c')][_0xa66f('0x5f')](_0x2d751e,{'transaction':_0x31b81b})['then'](function(_0x52f22d){if(!_0x52f22d){return _0x52edb3(_0xa66f('0x60'));}else{return _0x174aad(_0x52f22d);}})[_0xa66f('0x44')](function(_0x2540ad){return _0x52edb3(_0x2540ad);});});;});};function addVoicePrefixExtensions(_0x10279b,_0x3b6644){var _0x508e73=[];var _0x44525a=formatPrefixName(_0x10279b['prefix']);_0x508e73[_0xa66f('0x61')](new Extension(_0x44525a,0x2,_0xa66f('0x62'),_0xa66f('0x63')+_0x10279b[_0xa66f('0x29')]));if(_0x10279b['callerIdAll']){_0x508e73[_0xa66f('0x61')](new Extension(_0x44525a,0x3,_0xa66f('0x62'),_0xa66f('0x64')+_0x10279b[_0xa66f('0x65')]));}else{_0x508e73[_0xa66f('0x61')](new Extension(_0x44525a,0x3,_0xa66f('0x5c'),_0xa66f('0x66')));}_0x508e73[_0xa66f('0x61')](new Extension(_0x44525a,0x4,_0xa66f('0x67'),_0x3b6644[_0xa66f('0x54')]+','+_0xa66f('0x68')+(0x8+_0x10279b[_0xa66f('0x29')]['length'])+'}'+','+0x1));return _0x508e73;}function formatPrefixName(_0x1854d3){var _0x41e7fc='_';for(var _0x3b36d5=0x0;_0x3b36d5<_0x1854d3[_0xa66f('0x38')];_0x3b36d5++){if(_0x1854d3[_0xa66f('0x69')](_0x3b36d5)=='-'){_0x41e7fc+=_0x1854d3[_0xa66f('0x69')](_0x3b36d5);}else{_0x41e7fc+='['+_0x1854d3[_0xa66f('0x69')](_0x3b36d5)+']';}}_0x41e7fc+='.';return _0x41e7fc;}exports[_0xa66f('0x6a')]=function(_0x4df1f5,_0x5173f0,_0xad9105){var _0x24a54c=_0x4df1f5[_0xa66f('0x4b')];_0x24a54c[_0xa66f('0x5b')]=_0xa66f('0x6b')+_0x24a54c[_0xa66f('0x29')]+'-';return db[_0xa66f('0x6c')]['transaction'](function(_0x4c882e){return db[_0xa66f('0x2d')][_0xa66f('0x6a')](_0x24a54c,{'where':{'id':_0x24a54c['id']},'transaction':_0x4c882e})[_0xa66f('0x27')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x24a54c['id']},'transaction':_0x4c882e})[_0xa66f('0x27')](function(){return db[_0xa66f('0x4c')][_0xa66f('0x47')]({'where':{'id':_0x24a54c[_0xa66f('0x4d')]},'raw':!![]})['then'](function(_0x43be19){return createVoicePrefixExtensions(_0x24a54c,_0x43be19,_0x4c882e);});});});})[_0xa66f('0x27')](function(){return db[_0xa66f('0x2d')][_0xa66f('0x6d')](_0x24a54c['id']);})[_0xa66f('0x27')](respondWithResult(_0x5173f0,null))[_0xa66f('0x44')](handleError(_0x5173f0,null));};exports[_0xa66f('0x6e')]=function(_0x1396ae,_0x534820,_0x231106){return db[_0xa66f('0x2d')]['find']({'where':{'id':_0x1396ae['params']['id']}})[_0xa66f('0x27')](handleEntityNotFound(_0x534820,null))[_0xa66f('0x27')](function(_0x4ee8e7){if(_0x4ee8e7){return _0x4ee8e7[_0xa66f('0x6e')](_0x1396ae['body'][_0xa66f('0x6f')],_['omit'](_0x1396ae['body'],['ids','id'])||{})[_0xa66f('0x70')](function(_0x26e4df){for(var _0x1f05bb=0x0;_0x1f05bb<_0x1396ae[_0xa66f('0x4b')][_0xa66f('0x6f')][_0xa66f('0x38')];_0x1f05bb+=0x1){socket[_0xa66f('0x71')](_0xa66f('0x72'),{'UserId':Number(_0x1396ae[_0xa66f('0x4b')][_0xa66f('0x6f')][_0x1f05bb]),'VoicePrefixId':Number(_0x1396ae[_0xa66f('0x46')]['id'])});}return _0x26e4df;});}})[_0xa66f('0x27')](respondWithResult(_0x534820,null))[_0xa66f('0x44')](handleError(_0x534820,null));};exports[_0xa66f('0x73')]=function(_0x5a7b97,_0x378538,_0x54a4af){return db[_0xa66f('0x2d')]['find']({'where':{'id':_0x5a7b97[_0xa66f('0x46')]['id']}})['then'](handleEntityNotFound(_0x378538,null))[_0xa66f('0x27')](function(_0x443a45){if(_0x443a45){return _0x443a45[_0xa66f('0x73')](_0x5a7b97['query']['ids'])[_0xa66f('0x27')](function(){if(_[_0xa66f('0x74')](_0x5a7b97[_0xa66f('0x32')][_0xa66f('0x6f')])){for(var _0x1f5853=0x0;_0x1f5853<_0x5a7b97[_0xa66f('0x32')][_0xa66f('0x6f')]['length'];_0x1f5853+=0x1){socket[_0xa66f('0x71')](_0xa66f('0x75'),{'UserId':Number(_0x5a7b97[_0xa66f('0x32')][_0xa66f('0x6f')][_0x1f5853]),'VoicePrefixId':Number(_0x5a7b97[_0xa66f('0x46')]['id'])});}}else{socket[_0xa66f('0x71')](_0xa66f('0x75'),{'UserId':Number(_0x5a7b97[_0xa66f('0x32')][_0xa66f('0x6f')]),'VoicePrefixId':Number(_0x5a7b97[_0xa66f('0x46')]['id'])});}});}})[_0xa66f('0x27')](respondWithStatusCode(_0x378538,null))[_0xa66f('0x44')](handleError(_0x378538,null));};exports[_0xa66f('0x76')]=function(_0x53f0fd,_0x38875e,_0x722786){var _0x34ebfd={};var _0x14722a={};var _0xcf9aa0;var _0x31db5c;return db[_0xa66f('0x2d')][_0xa66f('0x77')]({'where':{'id':_0x53f0fd[_0xa66f('0x46')]['id']}})['then'](handleEntityNotFound(_0x38875e,null))[_0xa66f('0x27')](function(_0x4e7352){if(_0x4e7352){_0xcf9aa0=_0x4e7352;_0x14722a[_0xa66f('0x31')]=_['keys'](db[_0xa66f('0x78')]['rawAttributes']);_0x14722a[_0xa66f('0x32')]=_['keys'](_0x53f0fd[_0xa66f('0x32')]);_0x14722a[_0xa66f('0x34')]=_[_0xa66f('0x35')](_0x14722a[_0xa66f('0x31')],_0x14722a[_0xa66f('0x32')]);_0x34ebfd[_0xa66f('0x37')]=_['intersection'](_0x14722a[_0xa66f('0x31')],qs[_0xa66f('0x36')](_0x53f0fd[_0xa66f('0x32')]['fields']));_0x34ebfd[_0xa66f('0x37')]=_0x34ebfd[_0xa66f('0x37')]['length']?_0x34ebfd[_0xa66f('0x37')]:_0x14722a[_0xa66f('0x31')];_0x34ebfd['order']=qs['sort'](_0x53f0fd[_0xa66f('0x32')][_0xa66f('0x3b')]);_0x34ebfd[_0xa66f('0x3c')]=qs[_0xa66f('0x34')](_[_0xa66f('0x79')](_0x53f0fd['query'],_0x14722a[_0xa66f('0x34')]));if(_0x53f0fd[_0xa66f('0x32')]['filter']){_0x34ebfd[_0xa66f('0x3c')]=_[_0xa66f('0x3d')](_0x34ebfd['where'],{'$or':_[_0xa66f('0x2c')](_0x34ebfd[_0xa66f('0x37')],function(_0x2c4c43){var _0x3a30ba={};_0x3a30ba[_0x2c4c43]={'$like':'%'+_0x53f0fd[_0xa66f('0x32')]['filter']+'%'};return _0x3a30ba;})});}_0x34ebfd=_[_0xa66f('0x3d')]({},_0x34ebfd,_0x53f0fd[_0xa66f('0x40')]);return _0xcf9aa0[_0xa66f('0x76')](_0x34ebfd);}})[_0xa66f('0x27')](function(_0x40fb75){if(_0x40fb75){_0x31db5c=_0x40fb75[_0xa66f('0x38')];if(!_0x53f0fd['query'][_0xa66f('0x39')](_0xa66f('0x7a'))){_0x34ebfd[_0xa66f('0x1c')]=qs[_0xa66f('0x1c')](_0x53f0fd[_0xa66f('0x32')][_0xa66f('0x1c')]);_0x34ebfd[_0xa66f('0x1e')]=qs['offset'](_0x53f0fd['query'][_0xa66f('0x1e')]);}return _0xcf9aa0['getAgents'](_0x34ebfd);}})[_0xa66f('0x27')](function(_0x148a8d){if(_0x148a8d){return _0x148a8d?{'count':_0x31db5c,'rows':_0x148a8d}:null;}})['then'](respondWithResult(_0x38875e,null))[_0xa66f('0x44')](handleError(_0x38875e,null));};exports[_0xa66f('0x7b')]=function(_0x3f84f9,_0x598586,_0x4a2409){var _0xfe65cc={};var _0x51b59b={};var _0x16e897;var _0x275957;return db[_0xa66f('0x2d')]['findOne']({'where':{'id':_0x3f84f9[_0xa66f('0x46')]['id']}})['then'](handleEntityNotFound(_0x598586,null))[_0xa66f('0x27')](function(_0xfdb067){if(_0xfdb067){_0x16e897=_0xfdb067;_0x51b59b[_0xa66f('0x31')]=_[_0xa66f('0x33')](db['Team'][_0xa66f('0x2e')]);_0x51b59b[_0xa66f('0x32')]=_[_0xa66f('0x33')](_0x3f84f9[_0xa66f('0x32')]);_0x51b59b[_0xa66f('0x34')]=_[_0xa66f('0x35')](_0x51b59b['model'],_0x51b59b[_0xa66f('0x32')]);_0xfe65cc[_0xa66f('0x37')]=_[_0xa66f('0x35')](_0x51b59b[_0xa66f('0x31')],qs[_0xa66f('0x36')](_0x3f84f9['query']['fields']));_0xfe65cc[_0xa66f('0x37')]=_0xfe65cc[_0xa66f('0x37')][_0xa66f('0x38')]?_0xfe65cc[_0xa66f('0x37')]:_0x51b59b[_0xa66f('0x31')];_0xfe65cc[_0xa66f('0x3a')]=qs[_0xa66f('0x3b')](_0x3f84f9[_0xa66f('0x32')][_0xa66f('0x3b')]);_0xfe65cc[_0xa66f('0x3c')]=qs[_0xa66f('0x34')](_[_0xa66f('0x79')](_0x3f84f9['query'],_0x51b59b[_0xa66f('0x34')]));if(_0x3f84f9[_0xa66f('0x32')]['filter']){_0xfe65cc[_0xa66f('0x3c')]=_[_0xa66f('0x3d')](_0xfe65cc[_0xa66f('0x3c')],{'$or':_['map'](_0xfe65cc['attributes'],function(_0x1de4df){var _0x5f4e48={};_0x5f4e48[_0x1de4df]={'$like':'%'+_0x3f84f9[_0xa66f('0x32')][_0xa66f('0x3f')]+'%'};return _0x5f4e48;})});}_0xfe65cc=_['merge']({},_0xfe65cc,_0x3f84f9[_0xa66f('0x40')]);return _0x16e897[_0xa66f('0x7b')](_0xfe65cc);}})['then'](function(_0xa568ed){if(_0xa568ed){_0x275957=_0xa568ed[_0xa66f('0x38')];if(!_0x3f84f9[_0xa66f('0x32')][_0xa66f('0x39')]('nolimit')){_0xfe65cc['limit']=qs[_0xa66f('0x1c')](_0x3f84f9[_0xa66f('0x32')][_0xa66f('0x1c')]);_0xfe65cc[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x3f84f9[_0xa66f('0x32')][_0xa66f('0x1e')]);}return _0x16e897[_0xa66f('0x7b')](_0xfe65cc);}})[_0xa66f('0x27')](function(_0x149e11){if(_0x149e11){return _0x149e11?{'count':_0x275957,'rows':_0x149e11}:null;}})['then'](respondWithResult(_0x598586,null))['catch'](handleError(_0x598586,null));};exports[_0xa66f('0x7c')]=function(_0x3cbbb6,_0x3cf40f,_0x4298ca){var _0x22ea68=_0x3cbbb6['body'][_0xa66f('0x6f')];var _0x3035ac;return db[_0xa66f('0x7d')]['findAll']({'where':{'id':_0x22ea68},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa66f('0x29'),'online',_0xa66f('0x7e'),_0xa66f('0x7f')],'raw':!![]}]})[_0xa66f('0x27')](function(_0x90b7f1){if(_0x90b7f1){_0x3035ac=_0x90b7f1;var _0x4bf3f6=_[_0xa66f('0x80')](_0x90b7f1,function(_0x25b0f8){var _0x50e60b=_0x25b0f8[_0xa66f('0x24')]({'plain':!![]});return _0x50e60b[_0xa66f('0x81')];});return db['VoicePrefix']['find']({'where':{'id':_0x3cbbb6[_0xa66f('0x46')]['id']}})[_0xa66f('0x27')](function(_0x118022){return db['sequelize']['transaction'](function(_0x4c139a){return _0x118022['addTeams'](_0x22ea68,{'transaction':_0x4c139a})[_0xa66f('0x27')](function(){return BPromise[_0xa66f('0x82')](_0x3035ac,function(_0x290e78){return db[_0xa66f('0x83')][_0xa66f('0x84')]({'TeamId':_0x290e78['id'],'VoicePrefixId':_0x3cbbb6[_0xa66f('0x46')]['id']},{'transaction':_0x4c139a});});})['then'](function(){return BPromise[_0xa66f('0x82')](_0x4bf3f6,function(_0x41e8ee){return db[_0xa66f('0x85')][_0xa66f('0x86')]({'where':{'UserId':_0x41e8ee['id'],'VoicePrefixId':_0x3cbbb6['params']['id']},'transaction':_0x4c139a});});})['then'](function(){_0x4bf3f6[_0xa66f('0x87')](function(_0xe11c2d){socket[_0xa66f('0x71')](_0xa66f('0x72'),{'UserId':_0xe11c2d['id'],'VoicePrefixId':_0x118022['id']});});});});});}})[_0xa66f('0x27')](respondWithStatusCode(_0x3cf40f,null))[_0xa66f('0x44')](handleError(_0x3cf40f,null));};exports[_0xa66f('0x88')]=function(_0xb01698,_0x7a57e9,_0x179eb7){return db[_0xa66f('0x7d')]['findAll']({'where':{'id':_0xb01698[_0xa66f('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa66f('0x78')],'as':_0xa66f('0x81'),'attributes':['id'],'raw':!![]}]})[_0xa66f('0x27')](handleEntityNotFound(_0x7a57e9,null))[_0xa66f('0x27')](function(_0x216668){var _0x535c41=_['map'](_0x216668,'id');var _0x599762=[];var _0x484c8e=[];var _0x728faa=squel[_0xa66f('0x89')]();_0x728faa[_0xa66f('0x8a')](_0xa66f('0x8b'))['from'](_0xa66f('0x8c'),'tq')[_0xa66f('0x8d')]('user_has_teams','ut',_0xa66f('0x8e'))[_0xa66f('0x3c')]('VoicePrefixId\x20=\x20?',_0xb01698[_0xa66f('0x46')]['id']);for(var _0x3c2367=0x0;_0x3c2367<_0x216668['length'];_0x3c2367+=0x1){let _0x4773b8=_0x216668[_0x3c2367];for(var _0x400223=0x0;_0x400223<_0x4773b8[_0xa66f('0x81')][_0xa66f('0x38')];_0x400223+=0x1){let _0x232a12=_0x4773b8[_0xa66f('0x81')][_0x400223];var _0x34c9a8=_0x728faa[_0xa66f('0x8f')]();_0x34c9a8[_0xa66f('0x3c')](_0xa66f('0x90'),_0x232a12['id']);_0x484c8e[_0xa66f('0x61')](db['sequelize']['query'](_0x34c9a8[_0xa66f('0x91')](),{'type':db[_0xa66f('0x6c')][_0xa66f('0x92')]['SELECT']})['then'](function(_0x2a6992){if(_0x2a6992[_0xa66f('0x38')]===0x1){return _0x232a12['id'];}else{var _0x9617dc=_[_0xa66f('0x93')](_[_0xa66f('0x2c')](_0x2a6992,'TeamId'),function(_0x39992c){return _[_0xa66f('0x94')](_0x535c41,_0x39992c);});if(_0x9617dc){return _0x232a12['id'];}}}));}}return BPromise[_0xa66f('0x95')](_0x484c8e)[_0xa66f('0x27')](function(_0x529e4c){_0x599762=_(_0x599762)[_0xa66f('0x96')](_0x529e4c)[_0xa66f('0x97')]()['value']();return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0xb01698['params']['id']}})[_0xa66f('0x27')](function(_0x20f266){return db[_0xa66f('0x6c')][_0xa66f('0x4a')](function(_0x308005){return _0x20f266[_0xa66f('0x88')](_0xb01698[_0xa66f('0x32')]['ids'],{'transaction':_0x308005})['then'](function(){if(!_[_0xa66f('0x98')](_0x599762)){return _0x20f266[_0xa66f('0x73')](_0x599762,{'transaction':_0x308005});}})[_0xa66f('0x27')](function(){_0x599762[_0xa66f('0x87')](function(_0x11379e){socket['emit'](_0xa66f('0x75'),{'UserId':_0x11379e,'VoicePrefixId':_0x20f266['id']});});});});});});})[_0xa66f('0x27')](respondWithStatusCode(_0x7a57e9,null))['catch'](handleError(_0x7a57e9,null));}; \ No newline at end of file +var _0x4991=['VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','describe','create','transaction','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','NoOp','goto','context','charAt','system-','findById','addAgents','ids','omit','emit','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','Team','findAll','User','interface','Agents','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map'];(function(_0x276c8d,_0x437fa6){var _0x51c99f=function(_0x474eb5){while(--_0x474eb5){_0x276c8d['push'](_0x276c8d['shift']());}};_0x51c99f(++_0x437fa6);}(_0x4991,0xf7));var _0x1499=function(_0x52ec66,_0x5af299){_0x52ec66=_0x52ec66-0x0;var _0x40f4b7=_0x4991[_0x52ec66];return _0x40f4b7;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1499('0x17')]=_[_0x1499('0x18')](config[_0x1499('0x17')],{'host':_0x1499('0x19'),'port':0x18eb});var socket=require(_0x1499('0x1a'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x1499('0x1b')](socket);function respondWithStatusCode(_0x4e5195,_0x37d99e){_0x37d99e=_0x37d99e||0xcc;return function(_0x12cde0){if(_0x12cde0){return _0x4e5195[_0x1499('0x1c')](_0x37d99e);}return _0x4e5195[_0x1499('0x1d')](_0x37d99e)['end']();};}function respondWithResult(_0x1ed43b,_0x373f57){_0x373f57=_0x373f57||0xc8;return function(_0x592c27){if(_0x592c27){return _0x1ed43b[_0x1499('0x1d')](_0x373f57)[_0x1499('0x1e')](_0x592c27);}};}function respondWithFilteredResult(_0x46b364,_0xc92272){return function(_0x1e45a9){if(_0x1e45a9){var _0x27e533=typeof _0xc92272['offset']==='undefined'&&typeof _0xc92272['limit']===_0x1499('0x1f');var _0xad534b=_0x1e45a9['count'];var _0x351da9=_0x27e533?0x0:_0xc92272[_0x1499('0x20')];var _0x28dff3=_0x27e533?_0x1e45a9[_0x1499('0x21')]:_0xc92272[_0x1499('0x20')]+_0xc92272[_0x1499('0x22')];var _0x2b0458;if(_0x28dff3>=_0xad534b){_0x28dff3=_0xad534b;_0x2b0458=0xc8;}else{_0x2b0458=0xce;}_0x46b364[_0x1499('0x1d')](_0x2b0458);return _0x46b364[_0x1499('0x23')](_0x1499('0x24'),_0x351da9+'-'+_0x28dff3+'/'+_0xad534b)[_0x1499('0x1e')](_0x1e45a9);}return null;};}function patchUpdates(_0x836081){return function(_0x223f4c){try{jsonpatch[_0x1499('0x25')](_0x223f4c,_0x836081,!![]);}catch(_0x4ec57a){return BPromise[_0x1499('0x26')](_0x4ec57a);}return _0x223f4c[_0x1499('0x27')]();};}function saveUpdates(_0x5615b4,_0x258e9c){return function(_0xc79f69){if(_0xc79f69){return _0xc79f69[_0x1499('0x28')](_0x5615b4)[_0x1499('0x29')](function(_0x3968e0){return _0x3968e0;});}return null;};}function removeEntity(_0x16d036,_0x54f3c2){return function(_0x501c0d){if(_0x501c0d){return _0x501c0d[_0x1499('0x2a')]()[_0x1499('0x29')](function(){var _0x3b9259=_0x501c0d[_0x1499('0x2b')]({'plain':!![]});var _0x32782a='VoicePrefixes';return db[_0x1499('0x2c')]['destroy']({'where':{'type':_0x32782a,'resourceId':_0x3b9259['id']}})['then'](function(){return _0x501c0d;});})['then'](function(){_0x16d036[_0x1499('0x1d')](0xcc)[_0x1499('0x2d')]();});}};}function handleEntityNotFound(_0x40932a,_0x1b460b){return function(_0x3dad86){if(!_0x3dad86){_0x40932a[_0x1499('0x1c')](0x194);}return _0x3dad86;};}function handleError(_0x3dd534,_0x5d3ec5){_0x5d3ec5=_0x5d3ec5||0x1f4;return function(_0x180171){logger[_0x1499('0x2e')](_0x180171[_0x1499('0x2f')]);if(_0x180171['name']){delete _0x180171[_0x1499('0x30')];}_0x3dd534[_0x1499('0x1d')](_0x5d3ec5)['send'](_0x180171);};}exports[_0x1499('0x31')]=function(_0x72ad,_0x497efd){var _0x464c5a={},_0x2eda80={},_0x15cc57={'count':0x0,'rows':[]};var _0x39f74f=_[_0x1499('0x32')](db[_0x1499('0x33')][_0x1499('0x34')],function(_0x18b662){return{'name':_0x18b662[_0x1499('0x35')],'type':_0x18b662[_0x1499('0x36')][_0x1499('0x37')]};});_0x2eda80[_0x1499('0x38')]=_[_0x1499('0x32')](_0x39f74f,_0x1499('0x30'));_0x2eda80[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x72ad[_0x1499('0x39')]);_0x2eda80[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],_0x2eda80['query']);_0x464c5a[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],qs[_0x1499('0x3e')](_0x72ad[_0x1499('0x39')][_0x1499('0x3e')]));_0x464c5a[_0x1499('0x3d')]=_0x464c5a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x464c5a[_0x1499('0x3d')]:_0x2eda80[_0x1499('0x38')];if(!_0x72ad['query']['hasOwnProperty'](_0x1499('0x40'))){_0x464c5a['limit']=qs[_0x1499('0x22')](_0x72ad['query'][_0x1499('0x22')]);_0x464c5a[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x72ad[_0x1499('0x39')]['offset']);}_0x464c5a[_0x1499('0x41')]=qs['sort'](_0x72ad[_0x1499('0x39')][_0x1499('0x42')]);_0x464c5a[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x72ad[_0x1499('0x39')],_0x2eda80[_0x1499('0x3b')]),_0x39f74f);if(_0x72ad[_0x1499('0x39')][_0x1499('0x44')]){_0x464c5a['where']=_[_0x1499('0x45')](_0x464c5a['where'],{'$or':_[_0x1499('0x32')](_0x39f74f,function(_0x38f449){if(_0x38f449[_0x1499('0x36')]!==_0x1499('0x46')){var _0x3ed978={};_0x3ed978[_0x38f449[_0x1499('0x30')]]={'$like':'%'+_0x72ad[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x3ed978;}})});}_0x464c5a=_[_0x1499('0x45')]({},_0x464c5a,_0x72ad[_0x1499('0x47')]);var _0x5ab521={'where':_0x464c5a[_0x1499('0x43')]};return db['VoicePrefix'][_0x1499('0x21')](_0x5ab521)[_0x1499('0x29')](function(_0x5646cf){_0x15cc57[_0x1499('0x21')]=_0x5646cf;if(_0x72ad[_0x1499('0x39')][_0x1499('0x48')]){_0x464c5a[_0x1499('0x49')]=[{'all':!![]}];}return db[_0x1499('0x33')]['findAll'](_0x464c5a);})['then'](function(_0x368fdb){_0x15cc57[_0x1499('0x4a')]=_0x368fdb;return _0x15cc57;})['then'](respondWithFilteredResult(_0x497efd,_0x464c5a))[_0x1499('0x4b')](handleError(_0x497efd,null));};exports[_0x1499('0x4c')]=function(_0x4a5529,_0x5de9b6){var _0x3814aa={'raw':![],'where':{'id':_0x4a5529[_0x1499('0x4d')]['id']}},_0x177147={};_0x177147['model']=_[_0x1499('0x3a')](db[_0x1499('0x33')][_0x1499('0x34')]);_0x177147[_0x1499('0x39')]=_['keys'](_0x4a5529[_0x1499('0x39')]);_0x177147[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],_0x177147['query']);_0x3814aa[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],qs['fields'](_0x4a5529['query'][_0x1499('0x3e')]));_0x3814aa['attributes']=_0x3814aa[_0x1499('0x3d')][_0x1499('0x3f')]?_0x3814aa[_0x1499('0x3d')]:_0x177147[_0x1499('0x38')];if(_0x4a5529[_0x1499('0x39')][_0x1499('0x48')]){_0x3814aa[_0x1499('0x49')]=[{'all':!![]}];}_0x3814aa=_['merge']({},_0x3814aa,_0x4a5529[_0x1499('0x47')]);return db['VoicePrefix'][_0x1499('0x4e')](_0x3814aa)[_0x1499('0x29')](handleEntityNotFound(_0x5de9b6,null))['then'](respondWithResult(_0x5de9b6,null))[_0x1499('0x4b')](handleError(_0x5de9b6,null));};exports[_0x1499('0x2a')]=function(_0x3de674,_0x4d1d24){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x3de674[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x4d1d24,null))[_0x1499('0x29')](removeEntity(_0x4d1d24,null))[_0x1499('0x4b')](handleError(_0x4d1d24,null));};exports[_0x1499('0x4f')]=function(_0x3b7a6b,_0x28822a){return db[_0x1499('0x33')]['describe']()[_0x1499('0x29')](respondWithResult(_0x28822a,null))[_0x1499('0x4b')](handleError(_0x28822a,null));};exports[_0x1499('0x50')]=function(_0x4dc648,_0x339471){var _0x2a7614;return db['sequelize'][_0x1499('0x51')](function(_0x162ddb){return db['VoicePrefix'][_0x1499('0x50')](_0x4dc648[_0x1499('0x52')],{'transaction':_0x162ddb})[_0x1499('0x29')](function(_0x30b27b){_0x2a7614=_0x30b27b[_0x1499('0x2b')]({'plain':!![]});return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x2a7614['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x2a9f23){return createVoicePrefixExtensions(_0x2a7614,_0x2a9f23,_0x162ddb);});});})[_0x1499('0x29')](function(){var _0x175b8d=_0x4dc648['user']['get']({'plain':!![]});if(!_0x175b8d)throw new Error(_0x1499('0x54'));if(_0x175b8d[_0x1499('0x55')]==='user'){var _0x3c3a20=_0x2a7614;return db[_0x1499('0x56')][_0x1499('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x175b8d['userProfileId']},'raw':!![]})['then'](function(_0x308ce2){if(_0x308ce2&&_0x308ce2[_0x1499('0x57')]===0x0){return db[_0x1499('0x2c')]['create']({'name':_0x3c3a20[_0x1499('0x30')],'resourceId':_0x3c3a20['id'],'type':_0x308ce2['name'],'sectionId':_0x308ce2['id']},{})[_0x1499('0x29')](function(){return _0x2a7614;});}else{return _0x2a7614;}})[_0x1499('0x4b')](function(_0x2fc6f9){logger[_0x1499('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fc6f9);throw _0x2fc6f9;});}return _0x2a7614;})['then'](respondWithResult(_0x339471,null))['catch'](handleError(_0x339471,null));};function Extension(_0x403832,_0x42629d,_0x1e9261,_0x28866f){this['context']=_0x1499('0x58');this[_0x1499('0x59')]=_0x403832;this['app']=_0x1e9261;this[_0x1499('0x36')]='system';this[_0x1499('0x5a')]=_0x1499('0x5b');this[_0x1499('0x5c')]=_0x42629d;this['appdata']=_0x28866f;}function createVoicePrefixExtensions(_0x739e63,_0xca5326,_0x253706){return new BPromise(function(_0x5b2dab,_0x761610){var _0x3ff1ce=new Extension(formatPrefixName(_0x739e63[_0x1499('0x5d')]),0x1,'NoOp',_0x1499('0x5e'));_0x3ff1ce[_0x1499('0x5f')]=_0x739e63['id'];return db[_0x1499('0x53')][_0x1499('0x50')](_0x3ff1ce,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x96a0ed){var _0x5c61dc=_0x96a0ed[_0x1499('0x2b')]({'plain':!![]});var _0x10b49f=_['map'](addVoicePrefixExtensions(_0x739e63,_0xca5326),function(_0x3839da){_0x3839da[_0x1499('0x60')]=_0x5c61dc['id'];_0x3839da[_0x1499('0x5f')]=_0x739e63['id'];return _0x3839da;});return db[_0x1499('0x53')][_0x1499('0x61')](_0x10b49f,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x5e5ee4){if(!_0x5e5ee4){return _0x761610(_0x1499('0x62'));}else{return _0x5b2dab(_0x5e5ee4);}})[_0x1499('0x4b')](function(_0x4eec83){return _0x761610(_0x4eec83);});});;});};function addVoicePrefixExtensions(_0x4a0487,_0x1ff29d){var _0x314d88=[];var _0x502474=formatPrefixName(_0x4a0487[_0x1499('0x5d')]);_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x2,_0x1499('0x64'),_0x1499('0x65')+_0x4a0487[_0x1499('0x30')]));if(_0x4a0487['callerIdAll']){_0x314d88['push'](new Extension(_0x502474,0x3,_0x1499('0x64'),'PREFIX-CALLERIDALL='+_0x4a0487['callerIdAll']));}else{_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x3,_0x1499('0x66'),'No\x20callerid\x20available'));}_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x4,_0x1499('0x67'),_0x1ff29d[_0x1499('0x68')]+','+'${EXTEN:'+(0x8+_0x4a0487['name'][_0x1499('0x3f')])+'}'+','+0x1));return _0x314d88;}function formatPrefixName(_0x2f3a3a){var _0x256893='_';for(var _0x392f6f=0x0;_0x392f6f<_0x2f3a3a[_0x1499('0x3f')];_0x392f6f++){if(_0x2f3a3a['charAt'](_0x392f6f)=='-'){_0x256893+=_0x2f3a3a[_0x1499('0x69')](_0x392f6f);}else{_0x256893+='['+_0x2f3a3a[_0x1499('0x69')](_0x392f6f)+']';}}_0x256893+='.';return _0x256893;}exports['update']=function(_0x358a76,_0x20e5f3,_0x44d970){var _0x5741e5=_0x358a76[_0x1499('0x52')];_0x5741e5[_0x1499('0x5d')]=_0x1499('0x6a')+_0x5741e5[_0x1499('0x30')]+'-';return db['sequelize'][_0x1499('0x51')](function(_0x74e09b){return db[_0x1499('0x33')]['update'](_0x5741e5,{'where':{'id':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x2a')]({'where':{'VoicePrefixId':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x5741e5['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x57e25b){return createVoicePrefixExtensions(_0x5741e5,_0x57e25b,_0x74e09b);});});});})['then'](function(){return db[_0x1499('0x33')][_0x1499('0x6b')](_0x5741e5['id']);})[_0x1499('0x29')](respondWithResult(_0x20e5f3,null))['catch'](handleError(_0x20e5f3,null));};exports['addAgents']=function(_0x320654,_0xb4a84b,_0x494d88){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x320654[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0xb4a84b,null))[_0x1499('0x29')](function(_0x3f6f36){if(_0x3f6f36){return _0x3f6f36[_0x1499('0x6c')](_0x320654['body'][_0x1499('0x6d')],_[_0x1499('0x6e')](_0x320654['body'],[_0x1499('0x6d'),'id'])||{})['spread'](function(_0x25a8c4){for(var _0x375576=0x0;_0x375576<_0x320654[_0x1499('0x52')][_0x1499('0x6d')]['length'];_0x375576+=0x1){socket[_0x1499('0x6f')]('userVoicePrefix:save',{'UserId':Number(_0x320654[_0x1499('0x52')]['ids'][_0x375576]),'VoicePrefixId':Number(_0x320654[_0x1499('0x4d')]['id'])});}return _0x25a8c4;});}})[_0x1499('0x29')](respondWithResult(_0xb4a84b,null))[_0x1499('0x4b')](handleError(_0xb4a84b,null));};exports['removeAgents']=function(_0x2349d7,_0x44511c,_0x585fe8){return db['VoicePrefix'][_0x1499('0x4e')]({'where':{'id':_0x2349d7['params']['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x44511c,null))['then'](function(_0x917508){if(_0x917508){return _0x917508['removeAgents'](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])[_0x1499('0x29')](function(){if(_[_0x1499('0x70')](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])){for(var _0x114aea=0x0;_0x114aea<_0x2349d7[_0x1499('0x39')]['ids'][_0x1499('0x3f')];_0x114aea+=0x1){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':Number(_0x2349d7['query'][_0x1499('0x6d')][_0x114aea]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}}else{socket['emit'](_0x1499('0x71'),{'UserId':Number(_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}});}})[_0x1499('0x29')](respondWithStatusCode(_0x44511c,null))['catch'](handleError(_0x44511c,null));};exports[_0x1499('0x72')]=function(_0x53700c,_0x5ed058,_0x5cc567){var _0x2a0525={};var _0x362d8c={};var _0x419d9a;var _0x23dfc0;return db[_0x1499('0x33')][_0x1499('0x73')]({'where':{'id':_0x53700c['params']['id']}})['then'](handleEntityNotFound(_0x5ed058,null))[_0x1499('0x29')](function(_0x20e0d7){if(_0x20e0d7){_0x419d9a=_0x20e0d7;_0x362d8c['model']=_[_0x1499('0x3a')](db['User'][_0x1499('0x34')]);_0x362d8c['query']=_[_0x1499('0x3a')](_0x53700c['query']);_0x362d8c[_0x1499('0x3b')]=_['intersection'](_0x362d8c[_0x1499('0x38')],_0x362d8c[_0x1499('0x39')]);_0x2a0525['attributes']=_[_0x1499('0x3c')](_0x362d8c[_0x1499('0x38')],qs['fields'](_0x53700c[_0x1499('0x39')][_0x1499('0x3e')]));_0x2a0525[_0x1499('0x3d')]=_0x2a0525[_0x1499('0x3d')][_0x1499('0x3f')]?_0x2a0525[_0x1499('0x3d')]:_0x362d8c[_0x1499('0x38')];_0x2a0525['order']=qs[_0x1499('0x42')](_0x53700c[_0x1499('0x39')]['sort']);_0x2a0525[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x53700c[_0x1499('0x39')],_0x362d8c[_0x1499('0x3b')]));if(_0x53700c['query'][_0x1499('0x44')]){_0x2a0525[_0x1499('0x43')]=_[_0x1499('0x45')](_0x2a0525[_0x1499('0x43')],{'$or':_[_0x1499('0x32')](_0x2a0525[_0x1499('0x3d')],function(_0x1f4794){var _0x43b74b={};_0x43b74b[_0x1f4794]={'$like':'%'+_0x53700c['query'][_0x1499('0x44')]+'%'};return _0x43b74b;})});}_0x2a0525=_[_0x1499('0x45')]({},_0x2a0525,_0x53700c[_0x1499('0x47')]);return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x3fa3a4){if(_0x3fa3a4){_0x23dfc0=_0x3fa3a4['length'];if(!_0x53700c['query']['hasOwnProperty'](_0x1499('0x40'))){_0x2a0525[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x53700c[_0x1499('0x39')][_0x1499('0x22')]);_0x2a0525[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x53700c[_0x1499('0x39')]['offset']);}return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x59a12f){if(_0x59a12f){return _0x59a12f?{'count':_0x23dfc0,'rows':_0x59a12f}:null;}})['then'](respondWithResult(_0x5ed058,null))[_0x1499('0x4b')](handleError(_0x5ed058,null));};exports['getTeams']=function(_0x52282e,_0x5666f5,_0x63c7b3){var _0x118d7a={};var _0x23fd46={};var _0x30ba76;var _0x3c91d2;return db['VoicePrefix']['findOne']({'where':{'id':_0x52282e[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x5666f5,null))[_0x1499('0x29')](function(_0x497619){if(_0x497619){_0x30ba76=_0x497619;_0x23fd46[_0x1499('0x38')]=_['keys'](db['Team'][_0x1499('0x34')]);_0x23fd46['query']=_[_0x1499('0x3a')](_0x52282e['query']);_0x23fd46[_0x1499('0x3b')]=_['intersection'](_0x23fd46[_0x1499('0x38')],_0x23fd46[_0x1499('0x39')]);_0x118d7a['attributes']=_[_0x1499('0x3c')](_0x23fd46['model'],qs[_0x1499('0x3e')](_0x52282e[_0x1499('0x39')][_0x1499('0x3e')]));_0x118d7a[_0x1499('0x3d')]=_0x118d7a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x118d7a[_0x1499('0x3d')]:_0x23fd46[_0x1499('0x38')];_0x118d7a[_0x1499('0x41')]=qs[_0x1499('0x42')](_0x52282e[_0x1499('0x39')][_0x1499('0x42')]);_0x118d7a[_0x1499('0x43')]=qs['filters'](_[_0x1499('0x74')](_0x52282e[_0x1499('0x39')],_0x23fd46[_0x1499('0x3b')]));if(_0x52282e[_0x1499('0x39')]['filter']){_0x118d7a[_0x1499('0x43')]=_[_0x1499('0x45')](_0x118d7a['where'],{'$or':_['map'](_0x118d7a[_0x1499('0x3d')],function(_0x1fbf21){var _0x2d4e5a={};_0x2d4e5a[_0x1fbf21]={'$like':'%'+_0x52282e[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x2d4e5a;})});}_0x118d7a=_[_0x1499('0x45')]({},_0x118d7a,_0x52282e[_0x1499('0x47')]);return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})[_0x1499('0x29')](function(_0x2dd404){if(_0x2dd404){_0x3c91d2=_0x2dd404['length'];if(!_0x52282e['query']['hasOwnProperty'](_0x1499('0x40'))){_0x118d7a[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x52282e[_0x1499('0x39')][_0x1499('0x22')]);_0x118d7a[_0x1499('0x20')]=qs['offset'](_0x52282e[_0x1499('0x39')][_0x1499('0x20')]);}return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})['then'](function(_0x4a11e4){if(_0x4a11e4){return _0x4a11e4?{'count':_0x3c91d2,'rows':_0x4a11e4}:null;}})[_0x1499('0x29')](respondWithResult(_0x5666f5,null))[_0x1499('0x4b')](handleError(_0x5666f5,null));};exports['addTeams']=function(_0x47f7e8,_0x4e5f60,_0x2f9c93){var _0x23e2c6=_0x47f7e8['body'][_0x1499('0x6d')];var _0x7dd273;return db[_0x1499('0x76')][_0x1499('0x77')]({'where':{'id':_0x23e2c6},'attributes':['id'],'include':[{'model':db[_0x1499('0x78')],'as':'Agents','attributes':['id','name','online','voicePause',_0x1499('0x79')],'raw':!![]}]})[_0x1499('0x29')](function(_0x14e4e8){if(_0x14e4e8){_0x7dd273=_0x14e4e8;var _0x5a675b=_['flatMap'](_0x14e4e8,function(_0x479936){var _0x2add75=_0x479936[_0x1499('0x2b')]({'plain':!![]});return _0x2add75[_0x1499('0x7a')];});return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x47f7e8[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](function(_0x420576){return db[_0x1499('0x7b')]['transaction'](function(_0x3f5aab){return _0x420576['addTeams'](_0x23e2c6,{'transaction':_0x3f5aab})[_0x1499('0x29')](function(){return BPromise[_0x1499('0x7c')](_0x7dd273,function(_0x425dac){return db[_0x1499('0x7d')][_0x1499('0x7e')]({'TeamId':_0x425dac['id'],'VoicePrefixId':_0x47f7e8[_0x1499('0x4d')]['id']},{'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){return BPromise['each'](_0x5a675b,function(_0x56507a){return db[_0x1499('0x7f')][_0x1499('0x80')]({'where':{'UserId':_0x56507a['id'],'VoicePrefixId':_0x47f7e8['params']['id']},'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){_0x5a675b[_0x1499('0x81')](function(_0x477bb9){socket['emit']('userVoicePrefix:save',{'UserId':_0x477bb9['id'],'VoicePrefixId':_0x420576['id']});});});});});}})[_0x1499('0x29')](respondWithStatusCode(_0x4e5f60,null))['catch'](handleError(_0x4e5f60,null));};exports[_0x1499('0x82')]=function(_0x3f366a,_0x11ef6,_0x548faf){return db['Team']['findAll']({'where':{'id':_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1499('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11ef6,null))['then'](function(_0x10f4cf){var _0x5d1170=_['map'](_0x10f4cf,'id');var _0x52de11=[];var _0x2e39ac=[];var _0x4a9e81=squel[_0x1499('0x83')]();_0x4a9e81[_0x1499('0x84')](_0x1499('0x85'))[_0x1499('0x86')](_0x1499('0x87'),'tq')['join'](_0x1499('0x88'),'ut',_0x1499('0x89'))[_0x1499('0x43')]('VoicePrefixId\x20=\x20?',_0x3f366a[_0x1499('0x4d')]['id']);for(var _0x772b0c=0x0;_0x772b0c<_0x10f4cf[_0x1499('0x3f')];_0x772b0c+=0x1){let _0x27135a=_0x10f4cf[_0x772b0c];for(var _0x1e9c28=0x0;_0x1e9c28<_0x27135a[_0x1499('0x7a')][_0x1499('0x3f')];_0x1e9c28+=0x1){let _0x2c1793=_0x27135a['Agents'][_0x1e9c28];var _0x39d6a9=_0x4a9e81[_0x1499('0x8a')]();_0x39d6a9[_0x1499('0x43')]('ut.UserId\x20=\x20?',_0x2c1793['id']);_0x2e39ac[_0x1499('0x63')](db[_0x1499('0x7b')][_0x1499('0x39')](_0x39d6a9[_0x1499('0x8b')](),{'type':db[_0x1499('0x7b')][_0x1499('0x8c')]['SELECT']})[_0x1499('0x29')](function(_0x18d9bc){if(_0x18d9bc['length']===0x1){return _0x2c1793['id'];}else{var _0x271d85=_[_0x1499('0x8d')](_[_0x1499('0x32')](_0x18d9bc,'TeamId'),function(_0x53659b){return _[_0x1499('0x8e')](_0x5d1170,_0x53659b);});if(_0x271d85){return _0x2c1793['id'];}}}));}}return BPromise[_0x1499('0x8f')](_0x2e39ac)[_0x1499('0x29')](function(_0x6478eb){_0x52de11=_(_0x52de11)[_0x1499('0x90')](_0x6478eb)[_0x1499('0x91')]()[_0x1499('0x92')]();return db[_0x1499('0x33')]['find']({'where':{'id':_0x3f366a['params']['id']}})['then'](function(_0x335af4){return db[_0x1499('0x7b')]['transaction'](function(_0x2c5702){return _0x335af4['removeTeams'](_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')],{'transaction':_0x2c5702})['then'](function(){if(!_[_0x1499('0x93')](_0x52de11)){return _0x335af4[_0x1499('0x94')](_0x52de11,{'transaction':_0x2c5702});}})[_0x1499('0x29')](function(){_0x52de11['forEach'](function(_0x3e7f29){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':_0x3e7f29,'VoicePrefixId':_0x335af4['id']});});});});});});})[_0x1499('0x29')](respondWithStatusCode(_0x11ef6,null))[_0x1499('0x4b')](handleError(_0x11ef6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 95b1600..81170a1 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 _0xed40=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x3cbaab,_0x3f2e8c){var _0x31cd1a=function(_0x3ad662){while(--_0x3ad662){_0x3cbaab['push'](_0x3cbaab['shift']());}};_0x31cd1a(++_0x3f2e8c);}(_0xed40,0x68));var _0x0ed4=function(_0x1ec31a,_0x646b7f){_0x1ec31a=_0x1ec31a-0x0;var _0x4db331=_0xed40[_0x1ec31a];return _0x4db331;};'use strict';var EventEmitter=require(_0x0ed4('0x0'));var VoicePrefix=require(_0x0ed4('0x1'))['db'][_0x0ed4('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0ed4('0x3')](0x0);var events={'afterCreate':_0x0ed4('0x4'),'afterUpdate':_0x0ed4('0x5'),'afterDestroy':_0x0ed4('0x6')};function emitEvent(_0x31eac0){return function(_0x2e7a19,_0x2fbf6b,_0x18670d){VoicePrefixEvents['emit'](_0x31eac0+':'+_0x2e7a19['id'],_0x2e7a19);VoicePrefixEvents[_0x0ed4('0x7')](_0x31eac0,_0x2e7a19);_0x18670d(null);};}for(var e in events){if(events[_0x0ed4('0x8')](e)){var event=events[e];VoicePrefix[_0x0ed4('0x9')](e,emitEvent(event));}}module[_0x0ed4('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0x7eaa=['VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x51c043,_0x4ba6f5){var _0x423c14=function(_0x30a5b7){while(--_0x30a5b7){_0x51c043['push'](_0x51c043['shift']());}};_0x423c14(++_0x4ba6f5);}(_0x7eaa,0x18e));var _0xa7ea=function(_0x1fa907,_0xd7b343){_0x1fa907=_0x1fa907-0x0;var _0x52f150=_0x7eaa[_0x1fa907];return _0x52f150;};'use strict';var EventEmitter=require(_0xa7ea('0x0'));var VoicePrefix=require(_0xa7ea('0x1'))['db'][_0xa7ea('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa7ea('0x3')](0x0);var events={'afterCreate':_0xa7ea('0x4'),'afterUpdate':'update','afterDestroy':_0xa7ea('0x5')};function emitEvent(_0xd804b4){return function(_0x1d5364,_0x154196,_0x232830){VoicePrefixEvents['emit'](_0xd804b4+':'+_0x1d5364['id'],_0x1d5364);VoicePrefixEvents[_0xa7ea('0x6')](_0xd804b4,_0x1d5364);_0x232830(null);};}for(var e in events){if(events[_0xa7ea('0x7')](e)){var event=events[e];VoicePrefix[_0xa7ea('0x8')](e,emitEvent(event));}}module[_0xa7ea('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 5929311..a037f86 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 _0x038a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x038a,0x114));var _0xa038=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x038a[_0x46c1d5];return _0x40fe7b;};'use strict';var _=require(_0xa038('0x0'));var util=require(_0xa038('0x1'));var logger=require(_0xa038('0x2'))(_0xa038('0x3'));var moment=require(_0xa038('0x4'));var BPromise=require(_0xa038('0x5'));var rp=require(_0xa038('0x6'));var fs=require('fs');var path=require(_0xa038('0x7'));var rimraf=require(_0xa038('0x8'));var config=require(_0xa038('0x9'));var attributes=require(_0xa038('0xa'));module[_0xa038('0xb')]=function(_0x1f2fe6,_0x322502){return _0x1f2fe6['define'](_0xa038('0xc'),attributes,{'tableName':_0xa038('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cf8=['exports','define','VoicePrefix','voice_prefixes','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x4b0f33,_0x38e377){var _0x234ee9=function(_0x24ac99){while(--_0x24ac99){_0x4b0f33['push'](_0x4b0f33['shift']());}};_0x234ee9(++_0x38e377);}(_0x2cf8,0x185));var _0x82cf=function(_0x4f3487,_0x143272){_0x4f3487=_0x4f3487-0x0;var _0x58d74f=_0x2cf8[_0x4f3487];return _0x58d74f;};'use strict';var _=require(_0x82cf('0x0'));var util=require(_0x82cf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x82cf('0x2'));var rp=require(_0x82cf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82cf('0x4'));var config=require(_0x82cf('0x5'));var attributes=require(_0x82cf('0x6'));module[_0x82cf('0x7')]=function(_0xb0971d,_0x3a6b87){return _0xb0971d[_0x82cf('0x8')](_0x82cf('0x9'),attributes,{'tableName':_0x82cf('0xa'),'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 b70c32c..4acf618 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 _0xcaaf=['redis','defaults','localhost','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x148592,_0x4a57e1){var _0x201668=function(_0x3d9f7b){while(--_0x3d9f7b){_0x148592['push'](_0x148592['shift']());}};_0x201668(++_0x4a57e1);}(_0xcaaf,0x66));var _0xfcaa=function(_0x4b98c0,_0x2b5647){_0x4b98c0=_0x4b98c0-0x0;var _0x11f9a5=_0xcaaf[_0x4b98c0];return _0x11f9a5;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var moment=require(_0xfcaa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcaa('0x2'));var db=require(_0xfcaa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcaa('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcaa('0x5'));var client=jayson[_0xfcaa('0x6')][_0xfcaa('0x7')]({'port':0x232a});config[_0xfcaa('0x8')]=_[_0xfcaa('0x9')](config[_0xfcaa('0x8')],{'host':_0xfcaa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcaa('0x8')]));require('./voicePrefix.socket')[_0xfcaa('0xb')](socket);function respondWithRpcPromise(_0x4bdec3,_0x101ac0,_0x593c04){return new BPromise(function(_0x586902,_0x345e39){return client['request'](_0x4bdec3,_0x593c04)[_0xfcaa('0xc')](function(_0x2e83f8){logger[_0xfcaa('0xd')](_0xfcaa('0xe'),_0x101ac0,_0xfcaa('0xf'));logger[_0xfcaa('0x10')](_0xfcaa('0x11'),_0x101ac0,_0xfcaa('0xf'),JSON['stringify'](_0x2e83f8));if(_0x2e83f8[_0xfcaa('0x12')]){if(_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x13')]===0x1f4){logger[_0xfcaa('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x101ac0,_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);return _0x345e39(_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);}logger['error'](_0xfcaa('0xe'),_0x101ac0,_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);return _0x586902(_0x2e83f8['error'][_0xfcaa('0x14')]);}else{logger[_0xfcaa('0xd')]('VoicePrefix,\x20%s,\x20%s',_0x101ac0,_0xfcaa('0xf'));_0x586902(_0x2e83f8['result']['message']);}})[_0xfcaa('0x15')](function(_0x327f31){logger[_0xfcaa('0x12')](_0xfcaa('0xe'),_0x101ac0,_0x327f31);_0x345e39(_0x327f31);});});} \ No newline at end of file +var _0x9300=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./voicePrefix.socket','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9300,0x153));var _0x0930=function(_0x4b2119,_0xaf829b){_0x4b2119=_0x4b2119-0x0;var _0x33d26e=_0x9300[_0x4b2119];return _0x33d26e;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});config[_0x0930('0xa')]=_[_0x0930('0xb')](config[_0x0930('0xa')],{'host':_0x0930('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0930('0xd'))['register'](socket);function respondWithRpcPromise(_0x1abf42,_0x1cc192,_0x5055c7){return new BPromise(function(_0x6db8ef,_0x5ba778){return client['request'](_0x1abf42,_0x5055c7)[_0x0930('0xe')](function(_0x20ab2e){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));logger[_0x0930('0x10')](_0x0930('0x11'),_0x1cc192,_0x0930('0xf'),JSON[_0x0930('0x12')](_0x20ab2e));if(_0x20ab2e[_0x0930('0x13')]){if(_0x20ab2e['error']['code']===0x1f4){logger['error'](_0x0930('0x14'),_0x1cc192,_0x20ab2e['error'][_0x0930('0x15')]);return _0x5ba778(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}logger[_0x0930('0x13')](_0x0930('0x14'),_0x1cc192,_0x20ab2e[_0x0930('0x13')]['message']);return _0x6db8ef(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));_0x6db8ef(_0x20ab2e[_0x0930('0x16')][_0x0930('0x15')]);}})[_0x0930('0x17')](function(_0x2fd170){logger['error'](_0x0930('0x14'),_0x1cc192,_0x2fd170);_0x5ba778(_0x2fd170);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index fad72da..eef5a26 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 _0xe829=['removeListener','length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xe829,0x1d8));var _0x9e82=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xe829[_0x3fa7d3];return _0x4c51bd;};'use strict';var VoicePrefixEvents=require(_0x9e82('0x0'));var events=[_0x9e82('0x1'),_0x9e82('0x2'),'update'];function createListener(_0x559076,_0xf56525){return function(_0x337730){_0xf56525[_0x9e82('0x3')](_0x559076,_0x337730);};}function removeListener(_0x168d3e,_0x31591a){return function(){VoicePrefixEvents[_0x9e82('0x4')](_0x168d3e,_0x31591a);};}exports['register']=function(_0x392df9){for(var _0x2338e7=0x0,_0x1a63b3=events[_0x9e82('0x5')];_0x2338e7<_0x1a63b3;_0x2338e7++){var _0x2d91ba=events[_0x2338e7];var _0x5c4c57=createListener(_0x9e82('0x6')+_0x2d91ba,_0x392df9);VoicePrefixEvents['on'](_0x2d91ba,_0x5c4c57);}}; \ No newline at end of file +var _0x4ea3=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x2e557d,_0x5becac){var _0xe80ca5=function(_0x36cfb4){while(--_0x36cfb4){_0x2e557d['push'](_0x2e557d['shift']());}};_0xe80ca5(++_0x5becac);}(_0x4ea3,0x70));var _0x34ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4ea3[_0x5ddb1c];return _0x354adc;};'use strict';var VoicePrefixEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){VoicePrefixEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);VoicePrefixEvents['on'](_0x22b09e,_0x5bec7c);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 85a78a7..5814dad 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(_0xbd7d8c,_0x299f93){var _0x250c62=function(_0x1a42b9){while(--_0x1a42b9){_0xbd7d8c['push'](_0xbd7d8c['shift']());}};_0x250c62(++_0x299f93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x514717,_0x3e4573){var _0x51caa7=function(_0xa70730){while(--_0xa70730){_0x514717['push'](_0x514717['shift']());}};_0x51caa7(++_0x3e4573);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 22ad1c8..44b99e1 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 _0x6467=['default','ENUM','ringall','leastrecent','fewestcalls','rrmemory','wrandom','getDataValue','type','dialMethod','strategy','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','split','setDataValue','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','Dial\x20Method.','UNSIGNED','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','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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','mandatoryDisposition','sequelize','exports','STRING','name','inbound'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x6467,0x9b));var _0x7646=function(_0x514cc8,_0x11a990){_0x514cc8=_0x514cc8-0x0;var _0x5807c9=_0x6467[_0x514cc8];return _0x5807c9;};'use strict';var Sequelize=require(_0x7646('0x0'));module[_0x7646('0x1')]={'name':{'type':Sequelize[_0x7646('0x2')],'allowNull':![],'unique':_0x7646('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7646('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x7646('0x4')},'musiconhold':{'type':Sequelize[_0x7646('0x2')],'defaultValue':_0x7646('0x5')},'announce':{'type':Sequelize[_0x7646('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x7646('0x6')]('rr',_0x7646('0x7'),_0x7646('0x8'),_0x7646('0x9'),'random',_0x7646('0xa'),'linear',_0x7646('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x589f98){this['setDataValue']('strategy',_0x589f98?_0x589f98:_0x7646('0xa'));},'get':function(){var _0x1d2e37=this[_0x7646('0xc')](_0x7646('0xd'));var _0x512f18=this['getDataValue'](_0x7646('0xe'));var _0xebc2f6=this[_0x7646('0xc')](_0x7646('0xf'));if(_0x1d2e37===_0x7646('0x4')){return _0xebc2f6;}if(_0x512f18===_0x7646('0x10')&&_0xebc2f6===_0x7646('0xa')||_0x512f18===_0x7646('0x10')&&_0xebc2f6===_0x7646('0x11')){return _0xebc2f6;}if(_0x512f18===_0x7646('0x12')||_0x512f18===_0x7646('0x13')||_0x512f18==='power'){return _0xebc2f6;}return null;}},'servicelevel':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7646('0x14')](0xb)},'timeout':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x7646('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x7646('0x15'),'no'),'defaultValue':_0x7646('0x15')},'autopause':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no',_0x7646('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7646('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7646('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x7646('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7646('0x6')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':_0x7646('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x7646('0x15'),'no',_0x7646('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7646('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7646('0x6')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x7646('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x7646('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7646('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x7646('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x7646('0x2')]},'queue_less_than':{'type':Sequelize[_0x7646('0x2')]},'periodic_announce':{'type':Sequelize[_0x7646('0x18')],'set':function(_0x128586){this['setDataValue'](_0x7646('0x19'),_0x128586?_0x128586['join'](','):[]);},'get':function(){return this[_0x7646('0xc')](_0x7646('0x19'))?this[_0x7646('0xc')](_0x7646('0x19'))[_0x7646('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x7646('0x2')],'defaultValue':'yes','set':function(_0x110021){this[_0x7646('0x1b')](_0x7646('0x1c'),_0x110021?_0x110021['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x7646('0x1c'))?this[_0x7646('0xc')](_0x7646('0x1c'))[_0x7646('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1bbe4d){this[_0x7646('0x1b')]('leavewhenempty',_0x1bbe4d?_0x1bbe4d[_0x7646('0x1d')](','):undefined);},'get':function(){return this[_0x7646('0xc')](_0x7646('0x1e'))?this[_0x7646('0xc')](_0x7646('0x1e'))[_0x7646('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x7646('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7646('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':0x0,'set':function(_0x38a004){this[_0x7646('0x1b')](_0x7646('0x20'),_0x38a004);if(_0x38a004){if(this[_0x7646('0xc')]('wrapuptime')<0x2){this[_0x7646('0x1b')](_0x7646('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7646('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':0x0,'comment':_0x7646('0x22')},'dialMethod':{'type':Sequelize[_0x7646('0x6')]('preview',_0x7646('0x12'),_0x7646('0x23'),'predictive',_0x7646('0x10')),'defaultValue':_0x7646('0x12'),'comment':_0x7646('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x7646('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x7646('0x14')](0x4)[_0x7646('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x7646('0x26')](0x2)[_0x7646('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x7646('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x28'),_0x7646('0x29')),'defaultValue':_0x7646('0x29'),'comment':_0x7646('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7646('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x7646('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7646('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7646('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x7646('0x2')],'defaultValue':_0x7646('0x2d'),'comment':_0x7646('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x2f')},'dialQueueProject':{'type':Sequelize[_0x7646('0x2')],'comment':_0x7646('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7646('0x14')](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7646('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7646('0x35')},'dialTimezone':{'type':Sequelize[_0x7646('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7646('0x2')],'defaultValue':_0x7646('0x36')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7646('0x6')]('always',_0x7646('0x37'),'onlyIfOpen'),'defaultValue':_0x7646('0x38')},'dialAMDActive':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7646('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7646('0x14')](0x9)[_0x7646('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7646('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7646('0x14')](0x9)[_0x7646('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7646('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7646('0x14')](0x9)[_0x7646('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7646('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x7646('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7646('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7646('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7646('0x14')](0x9)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7646('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7646('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7646('0x14')](0x9)[_0x7646('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7646('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7646('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':0x0,'comment':_0x7646('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7646('0x6')](_0x7646('0x41'),'ASC'),'defaultValue':_0x7646('0x41')},'dialQueueProject2':{'type':Sequelize[_0x7646('0x2')],'comment':_0x7646('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7646('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7646('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7646('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7646('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x7646('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7646('0x14')](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7646('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7646('0x14')](0x5)[_0x7646('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7646('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7646('0x14')],'allowNull':!![],'comment':_0x7646('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x557164){if(!_0x557164)this[_0x7646('0x1b')]('mandatoryDispositionPauseId',null);this[_0x7646('0x1b')](_0x7646('0x4f'),_0x557164);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7646('0x14')](0x3)[_0x7646('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x7646('0x1f')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0259=['wrapuptime','BOOLEAN','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','UNSIGNED','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','default','ringall','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory','getDataValue','type','booked','progressive','predictive','power','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','acw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0259,0xd4));var _0x9025=function(_0x4e5b49,_0x26f3fa){_0x4e5b49=_0x4e5b49-0x0;var _0x3d306d=_0x0259[_0x4e5b49];return _0x3d306d;};'use strict';var Sequelize=require(_0x9025('0x0'));module[_0x9025('0x1')]={'name':{'type':Sequelize[_0x9025('0x2')],'allowNull':![],'unique':_0x9025('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9025('0x4')]('inbound',_0x9025('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x9025('0x2')],'defaultValue':_0x9025('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x9025('0x4')]('rr',_0x9025('0x7'),_0x9025('0x8'),_0x9025('0x9'),_0x9025('0xa'),'rrmemory','linear',_0x9025('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0xcda38){this[_0x9025('0xc')](_0x9025('0xd'),_0xcda38?_0xcda38:_0x9025('0xe'));},'get':function(){var _0x399f6f=this[_0x9025('0xf')](_0x9025('0x10'));var _0x146666=this['getDataValue']('dialMethod');var _0x3df1d3=this[_0x9025('0xf')]('strategy');if(_0x399f6f==='inbound'){return _0x3df1d3;}if(_0x146666==='booked'&&_0x3df1d3==='rrmemory'||_0x146666===_0x9025('0x11')&&_0x3df1d3==='roundrobin'){return _0x3df1d3;}if(_0x146666===_0x9025('0x12')||_0x146666===_0x9025('0x13')||_0x146666===_0x9025('0x14')){return _0x3df1d3;}return null;}},'servicelevel':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9025('0x2')]},'weight':{'type':Sequelize[_0x9025('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9025('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x9025('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9025('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9025('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x9025('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9025('0x4')]('yes','no'),'defaultValue':_0x9025('0x16')},'announce_holdtime':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no',_0x9025('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9025('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9025('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9025('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x9025('0x2')]},'queue_quantity2':{'type':Sequelize[_0x9025('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x9025('0x2')]},'queue_less_than':{'type':Sequelize[_0x9025('0x2')]},'periodic_announce':{'type':Sequelize[_0x9025('0x18')],'set':function(_0x2e3e25){this['setDataValue']('periodic_announce',_0x2e3e25?_0x2e3e25[_0x9025('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x9025('0x1a'))?this[_0x9025('0xf')]('periodic_announce')[_0x9025('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x9025('0x2')],'defaultValue':_0x9025('0x16'),'set':function(_0x826292){this[_0x9025('0xc')]('joinempty',_0x826292?_0x826292['join'](','):undefined);},'get':function(){return this[_0x9025('0xf')](_0x9025('0x1c'))?this['getDataValue'](_0x9025('0x1c'))[_0x9025('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9025('0x2')],'defaultValue':'no','set':function(_0x583e62){this[_0x9025('0xc')](_0x9025('0x1d'),_0x583e62?_0x583e62[_0x9025('0x19')](','):undefined);},'get':function(){return this[_0x9025('0xf')](_0x9025('0x1d'))?this['getDataValue'](_0x9025('0x1d'))[_0x9025('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9025('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9025('0x2')]},'description':{'type':Sequelize[_0x9025('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5761){this[_0x9025('0xc')](_0x9025('0x1e'),_0x5761);if(_0x5761){if(this['getDataValue'](_0x9025('0x1f'))<0x2){this['setDataValue'](_0x9025('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9025('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x21'),'progressive',_0x9025('0x14'),_0x9025('0x13'),'booked'),'defaultValue':_0x9025('0x12'),'comment':_0x9025('0x22')},'dialLimitChannel':{'type':Sequelize[_0x9025('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9025('0x23')},'dialLimitQueue':{'type':Sequelize[_0x9025('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9025('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9025('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9025('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x9025('0x4')]('agentBusyFactor',_0x9025('0x27')),'defaultValue':_0x9025('0x27'),'comment':_0x9025('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9025('0x25')](0x2)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9025('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x9025('0x29')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9025('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9025('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9025('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9025('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x9025('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x2e')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9025('0x15')](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'comment':_0x9025('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9025('0x35')},'dialTimezone':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9025('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x9025('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x36'),_0x9025('0x37'),_0x9025('0x38')),'defaultValue':_0x9025('0x36')},'dialAMDActive':{'type':Sequelize[_0x9025('0x20')],'defaultValue':0x0,'comment':_0x9025('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9025('0x15')](0x9)[_0x9025('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9025('0x15')](0x9)[_0x9025('0x29')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9025('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9025('0x15')](0x9)[_0x9025('0x29')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9025('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9025('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9025('0x15')](0x9)[_0x9025('0x29')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9025('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9025('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9025('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9025('0x15')](0x9)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9025('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9025('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9025('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9025('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x9025('0x15')](0x5)[_0x9025('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9025('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9025('0x4')](_0x9025('0x41'),_0x9025('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x9025('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9025('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9025('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9025('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x9025('0x15')](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9025('0x15')](0x5)[_0x9025('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9025('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9025('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9025('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9025('0x15')],'allowNull':!![],'comment':_0x9025('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9025('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x37bf5c){if(!_0x37bf5c)this[_0x9025('0xc')](_0x9025('0x4f'),null);this[_0x9025('0xc')](_0x9025('0x50'),_0x37bf5c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9025('0x15')](0x3)[_0x9025('0x29')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9025('0x20')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index cb28b9d..cf08b42 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 _0x2e21=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','find','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','count','includeAll','findAll','catch','show','params','options','create','user','role','outbound','UserProfileSection','autoAssociation','UserProfileResource','error','clone','include','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','rows','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeTeams','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','updatedAt','phone','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x5ede1f,_0x561c2e){var _0x873fbb=function(_0xaaabfd){while(--_0xaaabfd){_0x5ede1f['push'](_0x5ede1f['shift']());}};_0x873fbb(++_0x561c2e);}(_0x2e21,0xaa));var _0x12e2=function(_0x79a896,_0x252941){_0x79a896=_0x79a896-0x0;var _0xd4ad7e=_0x2e21[_0x79a896];return _0xd4ad7e;};'use strict';var emlformat=require(_0x12e2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x12e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x12e2('0x2'));var util=require(_0x12e2('0x3'));var path=require(_0x12e2('0x4'));var sox=require(_0x12e2('0x5'));var csv=require(_0x12e2('0x6'));var ejs=require(_0x12e2('0x7'));var fs=require('fs');var fs_extra=require(_0x12e2('0x8'));var _=require('lodash');var squel=require(_0x12e2('0x9'));var crypto=require('crypto');var jsforce=require(_0x12e2('0xa'));var deskjs=require(_0x12e2('0xb'));var toCsv=require(_0x12e2('0x6'));var querystring=require(_0x12e2('0xc'));var Papa=require('papaparse');var Redis=require(_0x12e2('0xd'));var authService=require(_0x12e2('0xe'));var qs=require(_0x12e2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e2('0x10'));var logger=require(_0x12e2('0x11'))(_0x12e2('0x12'));var utils=require(_0x12e2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x12e2('0x14'));var db=require(_0x12e2('0x15'))['db'];config[_0x12e2('0x16')]=_[_0x12e2('0x17')](config['redis'],{'host':_0x12e2('0x18'),'port':0x18eb});var socket=require(_0x12e2('0x19'))(new Redis(config['redis']));require(_0x12e2('0x1a'))[_0x12e2('0x1b')](socket);function respondWithStatusCode(_0x7b00a5,_0x55856e){_0x55856e=_0x55856e||0xcc;return function(_0x533de6){if(_0x533de6){return _0x7b00a5[_0x12e2('0x1c')](_0x55856e);}return _0x7b00a5['status'](_0x55856e)[_0x12e2('0x1d')]();};}function respondWithResult(_0x2f5b62,_0x530e4e){_0x530e4e=_0x530e4e||0xc8;return function(_0x24bdf4){if(_0x24bdf4){return _0x2f5b62[_0x12e2('0x1e')](_0x530e4e)[_0x12e2('0x1f')](_0x24bdf4);}};}function respondWithFilteredResult(_0x3ea2b9,_0x5b127f){return function(_0x4bf3f8){if(_0x4bf3f8){var _0x3ddc55=typeof _0x5b127f['offset']===_0x12e2('0x20')&&typeof _0x5b127f[_0x12e2('0x21')]===_0x12e2('0x20');var _0x5707c8=_0x4bf3f8['count'];var _0x2703f9=_0x3ddc55?0x0:_0x5b127f['offset'];var _0x58855a=_0x3ddc55?_0x4bf3f8['count']:_0x5b127f[_0x12e2('0x22')]+_0x5b127f[_0x12e2('0x21')];var _0x271107;if(_0x58855a>=_0x5707c8){_0x58855a=_0x5707c8;_0x271107=0xc8;}else{_0x271107=0xce;}_0x3ea2b9[_0x12e2('0x1e')](_0x271107);return _0x3ea2b9['set'](_0x12e2('0x23'),_0x2703f9+'-'+_0x58855a+'/'+_0x5707c8)['json'](_0x4bf3f8);}return null;};}function patchUpdates(_0x5f36fd){return function(_0xf26baf){try{jsonpatch[_0x12e2('0x24')](_0xf26baf,_0x5f36fd,!![]);}catch(_0x1d7304){return BPromise[_0x12e2('0x25')](_0x1d7304);}return _0xf26baf[_0x12e2('0x26')]();};}function saveUpdates(_0x3f05ec,_0x47ddb6){return function(_0x1fd9f2){if(_0x1fd9f2){return _0x1fd9f2[_0x12e2('0x27')](_0x3f05ec)[_0x12e2('0x28')](function(_0x42be6b){return _0x42be6b;});}return null;};}function removeEntity(_0x577caa,_0x3aaac6){return function(_0x192e60){if(_0x192e60){return _0x192e60[_0x12e2('0x29')]()[_0x12e2('0x28')](function(){var _0x39795c=_0x192e60[_0x12e2('0x2a')]({'plain':!![]});var _0x29257c=[{'name':_0x12e2('0x2b'),'value':_0x12e2('0x2c'),'ignore':![]},{'name':_0x12e2('0x2d'),'value':'outbound','ignore':![]}];var _0x5ab7e7=_(_0x29257c)[_0x12e2('0x2e')](_0x12e2('0x2f'))[_0x12e2('0x30')](_0x12e2('0x31'))['value']();if(_[_0x12e2('0x32')](_0x5ab7e7,_0x39795c[_0x12e2('0x33')])){return;}var _0x311cbc=_[_0x12e2('0x34')](_0x29257c,['value',_0x39795c[_0x12e2('0x33')]])['name'];return db['UserProfileResource'][_0x12e2('0x29')]({'where':{'type':_0x311cbc,'resourceId':_0x39795c['id']}})[_0x12e2('0x28')](function(){return _0x192e60;});})[_0x12e2('0x28')](function(){_0x577caa['status'](0xcc)[_0x12e2('0x1d')]();});}};}function handleEntityNotFound(_0x4d4370,_0x37f0cd){return function(_0x2130c3){if(!_0x2130c3){_0x4d4370[_0x12e2('0x1c')](0x194);}return _0x2130c3;};}function handleError(_0x2a29bd,_0x16299d){_0x16299d=_0x16299d||0x1f4;return function(_0xc8d779){logger['error'](_0xc8d779[_0x12e2('0x35')]);if(_0xc8d779['name']){delete _0xc8d779[_0x12e2('0x36')];}_0x2a29bd['status'](_0x16299d)[_0x12e2('0x37')](_0xc8d779);};}exports[_0x12e2('0x38')]=function(_0x12019c,_0x4f4451){var _0x4850c3={},_0x5af48f={},_0x34dce6={'count':0x0,'rows':[]};var _0x2979f9=_[_0x12e2('0x30')](db[_0x12e2('0x39')][_0x12e2('0x3a')],function(_0x7a551b){return{'name':_0x7a551b[_0x12e2('0x3b')],'type':_0x7a551b[_0x12e2('0x33')]['key']};});_0x5af48f[_0x12e2('0x3c')]=_[_0x12e2('0x30')](_0x2979f9,_0x12e2('0x36'));_0x5af48f[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x12019c[_0x12e2('0x3d')]);_0x5af48f[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x5af48f[_0x12e2('0x3c')],_0x5af48f[_0x12e2('0x3d')]);_0x4850c3['attributes']=_[_0x12e2('0x40')](_0x5af48f['model'],qs[_0x12e2('0x41')](_0x12019c[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x4850c3[_0x12e2('0x42')]=_0x4850c3['attributes'][_0x12e2('0x43')]?_0x4850c3[_0x12e2('0x42')]:_0x5af48f[_0x12e2('0x3c')];if(!_0x12019c[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x4850c3[_0x12e2('0x21')]=qs['limit'](_0x12019c[_0x12e2('0x3d')][_0x12e2('0x21')]);_0x4850c3[_0x12e2('0x22')]=qs['offset'](_0x12019c[_0x12e2('0x3d')][_0x12e2('0x22')]);}_0x4850c3['order']=qs['sort'](_0x12019c[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x4850c3['where']=qs['filters'](_[_0x12e2('0x47')](_0x12019c[_0x12e2('0x3d')],_0x5af48f[_0x12e2('0x3f')]),_0x2979f9);if(_0x12019c[_0x12e2('0x3d')][_0x12e2('0x2e')]){_0x4850c3[_0x12e2('0x48')]=_['merge'](_0x4850c3['where'],{'$or':_[_0x12e2('0x30')](_0x2979f9,function(_0x9b4751){if(_0x9b4751[_0x12e2('0x33')]!==_0x12e2('0x49')){var _0x16e55b={};_0x16e55b[_0x9b4751[_0x12e2('0x36')]]={'$like':'%'+_0x12019c[_0x12e2('0x3d')]['filter']+'%'};return _0x16e55b;}})});}_0x4850c3=_[_0x12e2('0x4a')]({},_0x4850c3,_0x12019c['options']);var _0x420a2d={'where':_0x4850c3[_0x12e2('0x48')]};return db['VoiceQueue'][_0x12e2('0x4b')](_0x420a2d)['then'](function(_0xdb8394){_0x34dce6['count']=_0xdb8394;if(_0x12019c[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0x4850c3['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x12e2('0x4d')](_0x4850c3);})[_0x12e2('0x28')](function(_0x37c72a){_0x34dce6['rows']=_0x37c72a;return _0x34dce6;})['then'](respondWithFilteredResult(_0x4f4451,_0x4850c3))[_0x12e2('0x4e')](handleError(_0x4f4451,null));};exports[_0x12e2('0x4f')]=function(_0x2fd3c4,_0x15f5da){var _0x3d9826={'raw':![],'where':{'id':_0x2fd3c4[_0x12e2('0x50')]['id']}},_0x120f92={};_0x120f92[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0x39')][_0x12e2('0x3a')]);_0x120f92[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x2fd3c4['query']);_0x120f92[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x120f92[_0x12e2('0x3c')],_0x120f92[_0x12e2('0x3d')]);_0x3d9826['attributes']=_[_0x12e2('0x40')](_0x120f92[_0x12e2('0x3c')],qs['fields'](_0x2fd3c4[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x3d9826[_0x12e2('0x42')]=_0x3d9826[_0x12e2('0x42')]['length']?_0x3d9826[_0x12e2('0x42')]:_0x120f92[_0x12e2('0x3c')];if(_0x2fd3c4[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0x3d9826['include']=[{'all':!![]}];}_0x3d9826=_[_0x12e2('0x4a')]({},_0x3d9826,_0x2fd3c4[_0x12e2('0x51')]);return db[_0x12e2('0x39')][_0x12e2('0x34')](_0x3d9826)[_0x12e2('0x28')](handleEntityNotFound(_0x15f5da,null))[_0x12e2('0x28')](respondWithResult(_0x15f5da,null))['catch'](handleError(_0x15f5da,null));};exports['create']=function(_0x191cc4,_0xcd56ef){return db[_0x12e2('0x39')][_0x12e2('0x52')](_0x191cc4['body'],{})[_0x12e2('0x28')](function(_0x4d7e4c){var _0x197503=_0x191cc4[_0x12e2('0x53')][_0x12e2('0x2a')]({'plain':!![]});if(!_0x197503)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x197503[_0x12e2('0x54')]===_0x12e2('0x53')){var _0x463003=_0x4d7e4c[_0x12e2('0x2a')]({'plain':!![]});var _0x1a6ffe=[{'name':_0x12e2('0x2b'),'value':_0x12e2('0x2c')},{'name':'QueueCampaigns','value':_0x12e2('0x55')}];var _0x5d238f=_[_0x12e2('0x34')](_0x1a6ffe,[_0x12e2('0x31'),_0x463003['type']])[_0x12e2('0x36')];return db[_0x12e2('0x56')][_0x12e2('0x34')]({'where':{'name':_0x5d238f,'userProfileId':_0x197503['userProfileId']},'raw':!![]})[_0x12e2('0x28')](function(_0x4ff934){if(_0x4ff934&&_0x4ff934[_0x12e2('0x57')]===0x0){return db[_0x12e2('0x58')][_0x12e2('0x52')]({'name':_0x463003[_0x12e2('0x36')],'resourceId':_0x463003['id'],'type':_0x4ff934[_0x12e2('0x36')],'sectionId':_0x4ff934['id']},{})['then'](function(){return _0x4d7e4c;});}else{return _0x4d7e4c;}})[_0x12e2('0x4e')](function(_0x406c8e){logger[_0x12e2('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x406c8e);throw _0x406c8e;});}return _0x4d7e4c;})['then'](respondWithResult(_0xcd56ef,0xc9))['catch'](handleError(_0xcd56ef,null));};exports[_0x12e2('0x5a')]=function(_0x489dbf,_0x569b78){var _0x1189f0={'where':{'id':_0x489dbf['params']['id']}},_0x3006b1={};_0x3006b1[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db['VoiceQueue']['rawAttributes']);_0x1189f0[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x3006b1[_0x12e2('0x3c')],qs[_0x12e2('0x41')](_0x489dbf[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x1189f0[_0x12e2('0x42')]=_0x1189f0[_0x12e2('0x42')][_0x12e2('0x43')]?_0x1189f0['attributes']:_0x3006b1[_0x12e2('0x3c')];if(_0x489dbf[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0x1189f0[_0x12e2('0x5b')]=[{'all':!![]}];}_0x1189f0=_[_0x12e2('0x4a')]({},_0x1189f0,_0x489dbf[_0x12e2('0x51')]);return db[_0x12e2('0x39')][_0x12e2('0x34')](_0x1189f0)[_0x12e2('0x28')](handleEntityNotFound(_0x569b78,null))[_0x12e2('0x28')](function(_0x35b7d3){if(_0x35b7d3){var _0x397b42=_0x35b7d3[_0x12e2('0x2a')]({'plain':!![]});_0x397b42=qs[_0x12e2('0x5c')](_0x397b42,['id',_0x12e2('0x5d'),'updatedAt']);_0x489dbf[_0x12e2('0x5e')]=_[_0x12e2('0x5c')](_0x489dbf[_0x12e2('0x5e')],['id','createdAt','updatedAt']);return db[_0x12e2('0x39')][_0x12e2('0x52')](_[_0x12e2('0x4a')](_0x397b42,_0x489dbf[_0x12e2('0x5e')]),{'include':_0x489dbf[_0x12e2('0x3d')][_0x12e2('0x4c')]?[{'all':!![]}]:undefined})[_0x12e2('0x28')](function(_0x2b2782){var _0x2478e7=_0x489dbf[_0x12e2('0x53')]['get']({'plain':!![]});if(!_0x2478e7)throw new Error(_0x12e2('0x5f'));if(_0x2478e7['role']===_0x12e2('0x53')){var _0x2a6cd8=_0x2b2782[_0x12e2('0x2a')]({'plain':!![]});var _0x38a3c9=[{'name':'VoiceQueues','value':_0x12e2('0x2c')},{'name':_0x12e2('0x2d'),'value':_0x12e2('0x55')}];var _0x918401=_[_0x12e2('0x34')](_0x38a3c9,['value',_0x2a6cd8[_0x12e2('0x33')]])['name'];return db[_0x12e2('0x56')][_0x12e2('0x34')]({'where':{'name':_0x918401,'userProfileId':_0x2478e7['userProfileId']},'raw':!![]})['then'](function(_0x348b13){if(_0x348b13&&_0x348b13[_0x12e2('0x57')]===0x0){return db[_0x12e2('0x58')]['create']({'name':_0x2a6cd8['name'],'resourceId':_0x2a6cd8['id'],'type':_0x348b13[_0x12e2('0x36')],'sectionId':_0x348b13['id']},{})[_0x12e2('0x28')](function(){return _0x2b2782;});}else{return _0x2b2782;}})[_0x12e2('0x4e')](function(_0x25934e){logger['error'](_0x12e2('0x60'),_0x25934e);throw _0x25934e;});}return _0x2b2782;});}})[_0x12e2('0x28')](respondWithResult(_0x569b78,0xc9))['catch'](handleError(_0x569b78,null));};exports[_0x12e2('0x27')]=function(_0x347da5,_0x2c7221){if(_0x347da5['body']['id']){delete _0x347da5['body']['id'];}return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x347da5[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x2c7221,null))[_0x12e2('0x28')](saveUpdates(_0x347da5['body'],null))[_0x12e2('0x28')](respondWithResult(_0x2c7221,null))[_0x12e2('0x4e')](handleError(_0x2c7221,null));};exports['destroy']=function(_0xff3b49,_0x5af71e){return db['VoiceQueue']['find']({'where':{'id':_0xff3b49['params']['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x5af71e,null))['then'](removeEntity(_0x5af71e,null))[_0x12e2('0x4e')](handleError(_0x5af71e,null));};exports[_0x12e2('0x61')]=function(_0x5cb026,_0x579697,_0x375985){var _0x3e8e4a={'raw':![],'where':{}};var _0x208bba={};var _0x2915c1={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x12e2('0x62')]({'where':{'id':_0x5cb026[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x579697,null))[_0x12e2('0x28')](function(_0x4963ef){if(_0x4963ef){_0x208bba[_0x12e2('0x3c')]=_['keys'](db[_0x12e2('0x63')][_0x12e2('0x3a')]);_0x208bba[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x5cb026[_0x12e2('0x3d')]);_0x208bba[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x208bba[_0x12e2('0x3c')],_0x208bba[_0x12e2('0x3d')]);_0x3e8e4a[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x208bba['model'],qs[_0x12e2('0x41')](_0x5cb026[_0x12e2('0x3d')]['fields']));_0x3e8e4a[_0x12e2('0x42')]=_0x3e8e4a[_0x12e2('0x42')][_0x12e2('0x43')]?_0x3e8e4a['attributes']:_0x208bba[_0x12e2('0x3c')];if(!_0x5cb026[_0x12e2('0x3d')][_0x12e2('0x44')]('nolimit')){_0x3e8e4a[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x5cb026['query'][_0x12e2('0x21')]);_0x3e8e4a['offset']=qs[_0x12e2('0x22')](_0x5cb026[_0x12e2('0x3d')][_0x12e2('0x22')]);}_0x3e8e4a[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x5cb026[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x3e8e4a[_0x12e2('0x48')]=qs['filters'](_[_0x12e2('0x47')](_0x5cb026['query'],_0x208bba['filters']));_0x3e8e4a['where']['VoiceQueueId']=_0x4963ef['id'];if(_0x5cb026['query']['filter']){_0x3e8e4a[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x3e8e4a[_0x12e2('0x48')],{'$or':_['map'](_0x3e8e4a[_0x12e2('0x42')],function(_0x3f86c0){var _0x512d8d={};_0x512d8d[_0x3f86c0]={'$like':'%'+_0x5cb026['query'][_0x12e2('0x2e')]+'%'};return _0x512d8d;})});}_0x3e8e4a=_[_0x12e2('0x4a')]({},_0x3e8e4a,_0x5cb026[_0x12e2('0x51')]);return db[_0x12e2('0x63')][_0x12e2('0x4b')]({'where':_0x3e8e4a['where']})['then'](function(_0x26ab0c){_0x2915c1[_0x12e2('0x4b')]=_0x26ab0c;if(_0x5cb026['query']['includeAll']){_0x3e8e4a[_0x12e2('0x5b')]=[{'all':!![]}];}return db[_0x12e2('0x63')]['findAll'](_0x3e8e4a);})['then'](function(_0x1576f9){_0x2915c1[_0x12e2('0x65')]=_0x1576f9;return _0x2915c1;});}})[_0x12e2('0x28')](respondWithFilteredResult(_0x579697,_0x3e8e4a))['catch'](handleError(_0x579697,null));};exports[_0x12e2('0x66')]=function(_0x1553b1,_0x545930,_0x273108){var _0xf6e48b={'raw':!![],'where':{}};var _0x5da558={};var _0x106b82={'count':0x0,'rows':[]};return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x1553b1[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x545930,null))['then'](function(_0x1457ff){if(_0x1457ff){_0x5da558['model']=_[_0x12e2('0x3e')](db['CmHopperHistory'][_0x12e2('0x3a')]);_0x5da558[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x1553b1['query']);_0x5da558[_0x12e2('0x3f')]=_['intersection'](_0x5da558[_0x12e2('0x3c')],_0x5da558[_0x12e2('0x3d')]);_0xf6e48b[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x5da558[_0x12e2('0x3c')],qs[_0x12e2('0x41')](_0x1553b1['query'][_0x12e2('0x41')]));_0xf6e48b[_0x12e2('0x42')]=_0xf6e48b[_0x12e2('0x42')]['length']?_0xf6e48b[_0x12e2('0x42')]:_0x5da558[_0x12e2('0x3c')];if(!_0x1553b1[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0xf6e48b[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x1553b1[_0x12e2('0x3d')]['limit']);_0xf6e48b[_0x12e2('0x22')]=qs[_0x12e2('0x22')](_0x1553b1[_0x12e2('0x3d')]['offset']);}_0xf6e48b[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x1553b1[_0x12e2('0x3d')][_0x12e2('0x46')]);_0xf6e48b[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x47')](_0x1553b1[_0x12e2('0x3d')],_0x5da558[_0x12e2('0x3f')]));_0xf6e48b[_0x12e2('0x48')][_0x12e2('0x67')]=_0x1457ff['id'];if(_0x1553b1['query'][_0x12e2('0x2e')]){_0xf6e48b[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0xf6e48b[_0x12e2('0x48')],{'$or':_[_0x12e2('0x30')](_0xf6e48b[_0x12e2('0x42')],function(_0x35d4d9){var _0x9a6969={};_0x9a6969[_0x35d4d9]={'$like':'%'+_0x1553b1[_0x12e2('0x3d')][_0x12e2('0x2e')]+'%'};return _0x9a6969;})});}_0xf6e48b=_[_0x12e2('0x4a')]({},_0xf6e48b,_0x1553b1[_0x12e2('0x51')]);return db[_0x12e2('0x68')][_0x12e2('0x4b')]({'where':_0xf6e48b[_0x12e2('0x48')]})['then'](function(_0xe21310){_0x106b82[_0x12e2('0x4b')]=_0xe21310;if(_0x1553b1[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0xf6e48b[_0x12e2('0x5b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x12e2('0x4d')](_0xf6e48b);})['then'](function(_0x29aaf9){_0x106b82['rows']=_0x29aaf9;return _0x106b82;});}})[_0x12e2('0x28')](respondWithFilteredResult(_0x545930,_0xf6e48b))[_0x12e2('0x4e')](handleError(_0x545930,null));};exports[_0x12e2('0x69')]=function(_0x51056d,_0x34894f,_0x36d56e){var _0x541902={'raw':!![],'where':{}};var _0x5a7948={};var _0x69a96e={'count':0x0,'rows':[]};return db[_0x12e2('0x39')]['findOne']({'where':{'id':_0x51056d['params']['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x34894f,null))['then'](function(_0x4f7e67){if(_0x4f7e67){_0x5a7948[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0x6a')][_0x12e2('0x3a')]);_0x5a7948['query']=_[_0x12e2('0x3e')](_0x51056d[_0x12e2('0x3d')]);_0x5a7948[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x5a7948[_0x12e2('0x3c')],_0x5a7948[_0x12e2('0x3d')]);_0x541902[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x5a7948[_0x12e2('0x3c')],qs[_0x12e2('0x41')](_0x51056d[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x541902[_0x12e2('0x42')]=_0x541902[_0x12e2('0x42')][_0x12e2('0x43')]?_0x541902[_0x12e2('0x42')]:_0x5a7948[_0x12e2('0x3c')];if(!_0x51056d[_0x12e2('0x3d')]['hasOwnProperty'](_0x12e2('0x45'))){_0x541902[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x51056d[_0x12e2('0x3d')]['limit']);_0x541902[_0x12e2('0x22')]=qs[_0x12e2('0x22')](_0x51056d[_0x12e2('0x3d')][_0x12e2('0x22')]);}_0x541902[_0x12e2('0x64')]=qs['sort'](_0x51056d[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x541902[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x47')](_0x51056d[_0x12e2('0x3d')],_0x5a7948['filters']));_0x541902['where'][_0x12e2('0x67')]=_0x4f7e67['id'];if(_0x51056d['query']['filter']){_0x541902[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x541902[_0x12e2('0x48')],{'$or':_[_0x12e2('0x30')](_0x541902['attributes'],function(_0x12e552){var _0x2da476={};_0x2da476[_0x12e552]={'$like':'%'+_0x51056d['query']['filter']+'%'};return _0x2da476;})});}_0x541902=_['merge']({},_0x541902,_0x51056d[_0x12e2('0x51')]);return db[_0x12e2('0x6a')]['count']({'where':_0x541902[_0x12e2('0x48')]})[_0x12e2('0x28')](function(_0x1abb8e){_0x69a96e[_0x12e2('0x4b')]=_0x1abb8e;if(_0x51056d[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0x541902[_0x12e2('0x5b')]=[{'all':!![]}];}return db[_0x12e2('0x6a')][_0x12e2('0x4d')](_0x541902);})[_0x12e2('0x28')](function(_0x5e0b6c){_0x69a96e[_0x12e2('0x65')]=_0x5e0b6c;return _0x69a96e;});}})[_0x12e2('0x28')](respondWithFilteredResult(_0x34894f,_0x541902))[_0x12e2('0x4e')](handleError(_0x34894f,null));};exports[_0x12e2('0x6b')]=function(_0x745063,_0x1ec623,_0x1e401e){var _0x496575={'raw':!![],'where':{}};var _0x2369e3={};var _0x1db3e8={'count':0x0,'rows':[]};return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x745063[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x1ec623,null))[_0x12e2('0x28')](function(_0xae05bb){if(_0xae05bb){_0x2369e3[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0x6c')][_0x12e2('0x3a')]);_0x2369e3[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x745063[_0x12e2('0x3d')]);_0x2369e3[_0x12e2('0x3f')]=_['intersection'](_0x2369e3[_0x12e2('0x3c')],_0x2369e3[_0x12e2('0x3d')]);_0x496575[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x2369e3['model'],qs[_0x12e2('0x41')](_0x745063[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x496575['attributes']=_0x496575[_0x12e2('0x42')][_0x12e2('0x43')]?_0x496575[_0x12e2('0x42')]:_0x2369e3[_0x12e2('0x3c')];if(!_0x745063[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x496575[_0x12e2('0x21')]=qs['limit'](_0x745063['query']['limit']);_0x496575['offset']=qs[_0x12e2('0x22')](_0x745063[_0x12e2('0x3d')][_0x12e2('0x22')]);}_0x496575[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x745063[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x496575[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x47')](_0x745063[_0x12e2('0x3d')],_0x2369e3[_0x12e2('0x3f')]));_0x496575[_0x12e2('0x48')][_0x12e2('0x67')]=_0xae05bb['id'];if(_0x745063[_0x12e2('0x3d')][_0x12e2('0x2e')]){_0x496575[_0x12e2('0x48')]=_['merge'](_0x496575['where'],{'$or':_[_0x12e2('0x30')](_0x496575[_0x12e2('0x42')],function(_0x568e92){var _0x453a3e={};_0x453a3e[_0x568e92]={'$like':'%'+_0x745063[_0x12e2('0x3d')]['filter']+'%'};return _0x453a3e;})});}_0x496575=_[_0x12e2('0x4a')]({},_0x496575,_0x745063[_0x12e2('0x51')]);return db[_0x12e2('0x6c')][_0x12e2('0x4b')]({'where':_0x496575[_0x12e2('0x48')]})[_0x12e2('0x28')](function(_0x7aa715){_0x1db3e8['count']=_0x7aa715;if(_0x745063[_0x12e2('0x3d')][_0x12e2('0x4c')]){_0x496575[_0x12e2('0x5b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x12e2('0x4d')](_0x496575);})['then'](function(_0x34382d){_0x1db3e8[_0x12e2('0x65')]=_0x34382d;return _0x1db3e8;});}})['then'](respondWithFilteredResult(_0x1ec623,_0x496575))['catch'](handleError(_0x1ec623,null));};exports[_0x12e2('0x6d')]=function(_0x199bc6,_0x2402d7,_0x284ce4){var _0x38c925={};var _0x343561={};var _0x202c9d;var _0x4b5f34;return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x199bc6[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x2402d7,null))[_0x12e2('0x28')](function(_0x5e06f1){if(_0x5e06f1){_0x202c9d=_0x5e06f1;_0x343561[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0x6e')][_0x12e2('0x3a')]);_0x343561[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x199bc6[_0x12e2('0x3d')]);_0x343561[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x343561[_0x12e2('0x3c')],_0x343561['query']);_0x38c925[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x343561['model'],qs[_0x12e2('0x41')](_0x199bc6['query']['fields']));_0x38c925[_0x12e2('0x42')]=_0x38c925[_0x12e2('0x42')]['length']?_0x38c925[_0x12e2('0x42')]:_0x343561['model'];_0x38c925[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x199bc6[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x38c925[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x47')](_0x199bc6[_0x12e2('0x3d')],_0x343561[_0x12e2('0x3f')]));if(_0x199bc6[_0x12e2('0x3d')][_0x12e2('0x2e')]){_0x38c925[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x38c925['where'],{'$or':_[_0x12e2('0x30')](_0x38c925[_0x12e2('0x42')],function(_0x3d6d70){var _0x5eaf96={};_0x5eaf96[_0x3d6d70]={'$like':'%'+_0x199bc6[_0x12e2('0x3d')][_0x12e2('0x2e')]+'%'};return _0x5eaf96;})});}_0x38c925=_[_0x12e2('0x4a')]({},_0x38c925,_0x199bc6['options']);return _0x202c9d['getTeams'](_0x38c925);}})['then'](function(_0x37876a){if(_0x37876a){_0x4b5f34=_0x37876a[_0x12e2('0x43')];if(!_0x199bc6[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x38c925[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x199bc6[_0x12e2('0x3d')][_0x12e2('0x21')]);_0x38c925['offset']=qs[_0x12e2('0x22')](_0x199bc6[_0x12e2('0x3d')]['offset']);}return _0x202c9d[_0x12e2('0x6d')](_0x38c925);}})['then'](function(_0x3e0911){if(_0x3e0911){return _0x3e0911?{'count':_0x4b5f34,'rows':_0x3e0911}:null;}})[_0x12e2('0x28')](respondWithResult(_0x2402d7,null))['catch'](handleError(_0x2402d7,null));};exports[_0x12e2('0x6f')]=function(_0xb38cf7,_0x282157,_0x39c2ee){var _0x59b1a6=_0xb38cf7[_0x12e2('0x5e')][_0x12e2('0x70')];var _0x3644a6=_[_0x12e2('0x30')](_0x59b1a6,'id');return db[_0x12e2('0x6e')][_0x12e2('0x4d')]({'where':{'id':_0x3644a6},'attributes':['id'],'include':[{'model':db[_0x12e2('0x71')],'as':_0x12e2('0x72'),'attributes':['id',_0x12e2('0x36'),_0x12e2('0x73'),_0x12e2('0x74'),'interface'],'raw':!![]}]})[_0x12e2('0x28')](function(_0x319638){if(_0x319638){var _0x378fb1=_[_0x12e2('0x75')](_0x319638,function(_0x5e4d12){var _0x369b7a=_0x5e4d12[_0x12e2('0x2a')]({'plain':!![]});_0x369b7a['Agents'][_0x12e2('0x76')](function(_0x4a40b0){_0x4a40b0[_0x12e2('0x77')]=_[_0x12e2('0x34')](_0x59b1a6,{'id':_0x369b7a['id']})[_0x12e2('0x77')];});return _0x369b7a['Agents'];});return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0xb38cf7[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](function(_0x9b747f){return db['sequelize'][_0x12e2('0x78')](function(_0x4b4d4f){return _0x9b747f[_0x12e2('0x6f')](_0x3644a6,{'transaction':_0x4b4d4f})[_0x12e2('0x28')](function(){return BPromise['each'](_0x59b1a6,function(_0x562e17){return db[_0x12e2('0x79')]['upsert']({'TeamId':_0x562e17['id'],'VoiceQueueId':_0xb38cf7[_0x12e2('0x50')]['id'],'penalty':_0x562e17['penalty']},{'transaction':_0x4b4d4f});});})[_0x12e2('0x28')](function(){return BPromise[_0x12e2('0x7a')](_0x378fb1,function(_0x55b63e){return db[_0x12e2('0x7b')][_0x12e2('0x7c')]({'where':{'UserId':_0x55b63e['id'],'VoiceQueueId':_0xb38cf7['params']['id']},'defaults':{'penalty':_0x55b63e[_0x12e2('0x77')]},'transaction':_0x4b4d4f});});})[_0x12e2('0x28')](function(){return BPromise[_0x12e2('0x7a')](_['filter'](_0x378fb1,{'online':!![]}),function(_0x31c966){return db['UserVoiceQueueRt'][_0x12e2('0x7d')]({'membername':_0x31c966[_0x12e2('0x36')],'UserId':_0x31c966['id'],'queue_name':_0x9b747f[_0x12e2('0x36')],'VoiceQueueId':_0x9b747f['id'],'interface':_[_0x12e2('0x7e')](_0x31c966[_0x12e2('0x7f')])?util[_0x12e2('0x80')]('SIP/%s',_0x31c966[_0x12e2('0x36')]):_0x31c966['interface'],'paused':_0x31c966[_0x12e2('0x74')]||![],'penalty':_0x31c966['penalty']},{'transaction':_0x4b4d4f});});})[_0x12e2('0x28')](function(){_0x378fb1[_0x12e2('0x76')](function(_0x210adf){socket[_0x12e2('0x81')](_0x12e2('0x82'),{'UserId':_0x210adf['id'],'VoiceQueueId':_0x9b747f['id']});});});});});}})[_0x12e2('0x28')](respondWithStatusCode(_0x282157,null))[_0x12e2('0x4e')](handleError(_0x282157,null));};exports['removeTeams']=function(_0x58b228,_0x3617cf,_0x46476c){return db[_0x12e2('0x6e')][_0x12e2('0x4d')]({'where':{'id':_0x58b228[_0x12e2('0x3d')][_0x12e2('0x83')]},'attributes':['id'],'include':[{'model':db[_0x12e2('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x12e2('0x28')](handleEntityNotFound(_0x3617cf,null))[_0x12e2('0x28')](function(_0x30062c){var _0x98c75f=_[_0x12e2('0x30')](_0x30062c,'id');var _0x220658=[];var _0x48b1ba=[];var _0x263a85=squel[_0x12e2('0x84')]();_0x263a85[_0x12e2('0x85')](_0x12e2('0x86'))[_0x12e2('0x87')](_0x12e2('0x88'),'tq')[_0x12e2('0x89')](_0x12e2('0x8a'),'ut',_0x12e2('0x8b'))[_0x12e2('0x48')](_0x12e2('0x8c'),_0x58b228[_0x12e2('0x50')]['id']);for(var _0x47e8f1=0x0;_0x47e8f1<_0x30062c[_0x12e2('0x43')];_0x47e8f1+=0x1){let _0xa3abdb=_0x30062c[_0x47e8f1];for(var _0x2f7821=0x0;_0x2f7821<_0xa3abdb[_0x12e2('0x72')][_0x12e2('0x43')];_0x2f7821+=0x1){let _0x1e3c0c=_0xa3abdb[_0x12e2('0x72')][_0x2f7821];var _0x3722c8=_0x263a85['clone']();_0x3722c8[_0x12e2('0x48')](_0x12e2('0x8d'),_0x1e3c0c['id']);_0x48b1ba[_0x12e2('0x8e')](db[_0x12e2('0x8f')][_0x12e2('0x3d')](_0x3722c8[_0x12e2('0x90')](),{'type':db[_0x12e2('0x8f')][_0x12e2('0x91')][_0x12e2('0x92')]})[_0x12e2('0x28')](function(_0x4f8cff){if(_0x4f8cff['length']===0x1){return _0x1e3c0c['id'];}else{var _0x18bffa=_[_0x12e2('0x93')](_[_0x12e2('0x30')](_0x4f8cff,_0x12e2('0x94')),function(_0x5c1e34){return _[_0x12e2('0x32')](_0x98c75f,_0x5c1e34);});if(_0x18bffa){return _0x1e3c0c['id'];}}}));}}return BPromise[_0x12e2('0x95')](_0x48b1ba)['then'](function(_0x2e79e9){_0x220658=_(_0x220658)['union'](_0x2e79e9)[_0x12e2('0x96')]()[_0x12e2('0x31')]();return db[_0x12e2('0x39')]['find']({'where':{'id':_0x58b228[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](function(_0x224d2e){return db[_0x12e2('0x8f')][_0x12e2('0x78')](function(_0xba1e6f){return _0x224d2e[_0x12e2('0x97')](_0x58b228[_0x12e2('0x3d')][_0x12e2('0x83')],{'transaction':_0xba1e6f})[_0x12e2('0x28')](function(){if(!_[_0x12e2('0x98')](_0x220658)){return _0x224d2e[_0x12e2('0x99')](_0x220658,{'transaction':_0xba1e6f})[_0x12e2('0x28')](function(){return db[_0x12e2('0x9a')][_0x12e2('0x29')]({'where':{'VoiceQueueId':_0x58b228[_0x12e2('0x50')]['id'],'UserId':_0x220658},'transaction':_0xba1e6f});});}})[_0x12e2('0x28')](function(){_0x220658[_0x12e2('0x76')](function(_0x42f11d){socket[_0x12e2('0x81')]('userVoiceQueue:remove',{'UserId':_0x42f11d,'VoiceQueueId':_0x224d2e['id']});});});});});});})[_0x12e2('0x28')](respondWithStatusCode(_0x3617cf,null))[_0x12e2('0x4e')](handleError(_0x3617cf,null));};exports[_0x12e2('0x9b')]=function(_0x154aee,_0x4354ae,_0x4b5d11){var _0x77ae0b,_0x1af0f5;return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x154aee[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x4354ae,null))[_0x12e2('0x28')](function(_0x56178b){if(_0x56178b){_0x1af0f5=_0x56178b;return _0x56178b[_0x12e2('0x9b')](_0x154aee[_0x12e2('0x5e')][_0x12e2('0x83')],_[_0x12e2('0x5c')](_0x154aee[_0x12e2('0x5e')],['ids','id'])||{})[_0x12e2('0x9c')](function(_0x35642e){for(var _0x3d1cda=0x0;_0x3d1cda<_0x154aee[_0x12e2('0x5e')][_0x12e2('0x83')]['length'];_0x3d1cda+=0x1){socket[_0x12e2('0x81')](_0x12e2('0x82'),{'UserId':Number(_0x154aee[_0x12e2('0x5e')][_0x12e2('0x83')][_0x3d1cda]),'VoiceQueueId':Number(_0x154aee['params']['id'])});}return _0x35642e;});}})[_0x12e2('0x28')](function(_0x35149f){_0x77ae0b=_0x35149f||[];if(_0x1af0f5){return db[_0x12e2('0x71')]['findAll']({'where':{'id':_0x154aee['body'][_0x12e2('0x83')]},'attributes':['id',_0x12e2('0x36'),_0x12e2('0x73'),_0x12e2('0x74'),_0x12e2('0x7f')],'raw':!![]});}})[_0x12e2('0x28')](function(_0x4254fd){if(!_[_0x12e2('0x98')](_0x4254fd)){var _0x46652c=[];for(var _0xd968cb=0x0;_0xd968cb<_0x4254fd[_0x12e2('0x43')];_0xd968cb++){if(_0x4254fd[_0xd968cb][_0x12e2('0x73')]){_0x46652c[_0x12e2('0x8e')](db[_0x12e2('0x9a')][_0x12e2('0x7d')]({'membername':_0x4254fd[_0xd968cb][_0x12e2('0x36')],'UserId':_0x4254fd[_0xd968cb]['id'],'queue_name':_0x1af0f5[_0x12e2('0x36')],'VoiceQueueId':_0x1af0f5['id'],'interface':_['isNil'](_0x4254fd[_0xd968cb][_0x12e2('0x7f')])?util[_0x12e2('0x80')](_0x12e2('0x9d'),_0x4254fd[_0xd968cb][_0x12e2('0x36')]):_0x4254fd[_0xd968cb][_0x12e2('0x7f')],'paused':_0x4254fd[_0xd968cb][_0x12e2('0x74')]||![],'penalty':_0x154aee[_0x12e2('0x5e')][_0x12e2('0x77')]||0x0}));}}return BPromise['all'](_0x46652c);}})[_0x12e2('0x28')](function(){return _0x77ae0b;})[_0x12e2('0x28')](respondWithResult(_0x4354ae,null))['catch'](handleError(_0x4354ae,null));};exports[_0x12e2('0x99')]=function(_0x2b5fdd,_0x109e33,_0x149feb){return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x2b5fdd['params']['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x109e33,null))[_0x12e2('0x28')](function(_0x389af5){if(_0x389af5){return _0x389af5[_0x12e2('0x99')](_0x2b5fdd[_0x12e2('0x3d')][_0x12e2('0x83')])[_0x12e2('0x28')](function(){if(_[_0x12e2('0x9e')](_0x2b5fdd['query'][_0x12e2('0x83')])){for(var _0x36f389=0x0;_0x36f389<_0x2b5fdd[_0x12e2('0x3d')][_0x12e2('0x83')]['length'];_0x36f389+=0x1){socket[_0x12e2('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x2b5fdd[_0x12e2('0x3d')][_0x12e2('0x83')][_0x36f389]),'VoiceQueueId':Number(_0x2b5fdd[_0x12e2('0x50')]['id'])});}}else{socket[_0x12e2('0x81')](_0x12e2('0x9f'),{'UserId':Number(_0x2b5fdd['query'][_0x12e2('0x83')]),'VoiceQueueId':Number(_0x2b5fdd[_0x12e2('0x50')]['id'])});}});}})[_0x12e2('0x28')](function(_0x4e0559){return db[_0x12e2('0x9a')]['destroy']({'where':{'VoiceQueueId':_0x2b5fdd[_0x12e2('0x50')]['id'],'UserId':_0x2b5fdd[_0x12e2('0x3d')][_0x12e2('0x83')]}})[_0x12e2('0x28')](function(){return _0x4e0559;});})[_0x12e2('0x28')](respondWithStatusCode(_0x109e33,null))[_0x12e2('0x4e')](handleError(_0x109e33,null));};exports[_0x12e2('0xa0')]=function(_0x3328f6,_0x3fff8d,_0x729b74){var _0x5ae00d={};var _0x317298={};var _0xe18a17;var _0x1ae604;return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x3328f6[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x3fff8d,null))[_0x12e2('0x28')](function(_0x46623a){if(_0x46623a){_0xe18a17=_0x46623a;_0x317298[_0x12e2('0x3c')]=_['keys'](db['User'][_0x12e2('0x3a')]);_0x317298[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x3328f6['query']);_0x317298[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x317298[_0x12e2('0x3c')],_0x317298[_0x12e2('0x3d')]);_0x5ae00d[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x317298[_0x12e2('0x3c')],qs['fields'](_0x3328f6['query'][_0x12e2('0x41')]));_0x5ae00d['attributes']=_0x5ae00d[_0x12e2('0x42')][_0x12e2('0x43')]?_0x5ae00d[_0x12e2('0x42')]:_0x317298[_0x12e2('0x3c')];_0x5ae00d[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x3328f6['query'][_0x12e2('0x46')]);_0x5ae00d[_0x12e2('0x48')]=qs['filters'](_[_0x12e2('0x47')](_0x3328f6['query'],_0x317298['filters']));if(_0x3328f6[_0x12e2('0x3d')]['filter']){_0x5ae00d[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x5ae00d[_0x12e2('0x48')],{'$or':_[_0x12e2('0x30')](_0x5ae00d[_0x12e2('0x42')],function(_0x2d38c3){var _0x481c48={};_0x481c48[_0x2d38c3]={'$like':'%'+_0x3328f6[_0x12e2('0x3d')]['filter']+'%'};return _0x481c48;})});}_0x5ae00d=_[_0x12e2('0x4a')]({},_0x5ae00d,_0x3328f6[_0x12e2('0x51')]);return _0xe18a17[_0x12e2('0xa0')](_0x5ae00d);}})[_0x12e2('0x28')](function(_0x44a2bf){if(_0x44a2bf){_0x1ae604=_0x44a2bf[_0x12e2('0x43')];if(!_0x3328f6['query'][_0x12e2('0x44')](_0x12e2('0x45'))){_0x5ae00d[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x3328f6[_0x12e2('0x3d')][_0x12e2('0x21')]);_0x5ae00d['offset']=qs['offset'](_0x3328f6[_0x12e2('0x3d')][_0x12e2('0x22')]);}return _0xe18a17[_0x12e2('0xa0')](_0x5ae00d);}})[_0x12e2('0x28')](function(_0x20514d){if(_0x20514d){return _0x20514d?{'count':_0x1ae604,'rows':_0x20514d}:null;}})[_0x12e2('0x28')](respondWithResult(_0x3fff8d,null))[_0x12e2('0x4e')](handleError(_0x3fff8d,null));};exports[_0x12e2('0xa1')]=function(_0x420f0c,_0x49bcc1,_0x45448f){var _0x4847bc={};var _0x4235a7={};var _0x5a39d3;var _0x38af1d;return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x420f0c['params']['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x49bcc1,null))[_0x12e2('0x28')](function(_0x57f518){if(_0x57f518){_0x5a39d3=_0x57f518;_0x4235a7[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0x9a')][_0x12e2('0x3a')]);_0x4235a7[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x420f0c[_0x12e2('0x3d')]);_0x4235a7[_0x12e2('0x3f')]=_['intersection'](_0x4235a7[_0x12e2('0x3c')],_0x4235a7[_0x12e2('0x3d')]);_0x4847bc[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x4235a7[_0x12e2('0x3c')],qs[_0x12e2('0x41')](_0x420f0c['query'][_0x12e2('0x41')]));_0x4847bc[_0x12e2('0x42')]=_0x4847bc['attributes'][_0x12e2('0x43')]?_0x4847bc[_0x12e2('0x42')]:_0x4235a7['model'];_0x4847bc[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x420f0c[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x4847bc[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x47')](_0x420f0c[_0x12e2('0x3d')],_0x4235a7[_0x12e2('0x3f')]));if(_0x420f0c[_0x12e2('0x3d')]['filter']){_0x4847bc[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x4847bc[_0x12e2('0x48')],{'$or':_[_0x12e2('0x30')](_0x4847bc[_0x12e2('0x42')],function(_0x41df6b){var _0xd42825={};_0xd42825[_0x41df6b]={'$like':'%'+_0x420f0c[_0x12e2('0x3d')]['filter']+'%'};return _0xd42825;})});}_0x4847bc=_[_0x12e2('0x4a')]({},_0x4847bc,_0x420f0c['options']);return _0x5a39d3[_0x12e2('0xa1')](_0x4847bc);}})['then'](function(_0x440381){if(_0x440381){_0x38af1d=_0x440381['length'];if(!_0x420f0c[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x4847bc['limit']=qs[_0x12e2('0x21')](_0x420f0c[_0x12e2('0x3d')]['limit']);_0x4847bc[_0x12e2('0x22')]=qs[_0x12e2('0x22')](_0x420f0c['query'][_0x12e2('0x22')]);}return _0x5a39d3[_0x12e2('0xa1')](_0x4847bc);}})[_0x12e2('0x28')](function(_0x18a35e){return _0x18a35e?{'count':_0x38af1d,'rows':_0x18a35e}:null;})[_0x12e2('0x28')](respondWithResult(_0x49bcc1,null))['catch'](handleError(_0x49bcc1,null));};exports[_0x12e2('0xa2')]=function(_0x5e3e6c,_0xe02cea,_0x3728a0){var _0x352717={};var _0x555ca8={};var _0x3084bc;var _0x57034d;return db['VoiceQueue'][_0x12e2('0x62')]({'where':{'id':_0x5e3e6c[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0xe02cea,null))[_0x12e2('0x28')](function(_0x1e5ac5){if(_0x1e5ac5){_0x3084bc=_0x1e5ac5;_0x555ca8['model']=_[_0x12e2('0x3e')](db[_0x12e2('0xa3')][_0x12e2('0x3a')]);_0x555ca8[_0x12e2('0x3d')]=_['keys'](_0x5e3e6c[_0x12e2('0x3d')]);_0x555ca8[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x555ca8['model'],_0x555ca8['query']);_0x352717[_0x12e2('0x42')]=_[_0x12e2('0x40')](_0x555ca8[_0x12e2('0x3c')],qs['fields'](_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x41')]));_0x352717[_0x12e2('0x42')]=_0x352717['attributes'][_0x12e2('0x43')]?_0x352717[_0x12e2('0x42')]:_0x555ca8[_0x12e2('0x3c')];_0x352717[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x46')]);_0x352717[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_['pick'](_0x5e3e6c['query'],_0x555ca8[_0x12e2('0x3f')]));if(_0x5e3e6c['query'][_0x12e2('0x2e')]){_0x352717[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x352717[_0x12e2('0x48')],{'$or':_[_0x12e2('0x30')](_0x352717['attributes'],function(_0x3ed368){var _0x138300={};_0x138300[_0x3ed368]={'$like':'%'+_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x2e')]+'%'};return _0x138300;})});}_0x352717=_[_0x12e2('0x4a')]({},_0x352717,_0x5e3e6c[_0x12e2('0x51')]);return _0x3084bc[_0x12e2('0xa2')](_0x352717);}})['then'](function(_0x44fbdb){if(_0x44fbdb){_0x57034d=_0x44fbdb[_0x12e2('0x43')];if(!_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x352717[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x21')]);_0x352717[_0x12e2('0x22')]=qs[_0x12e2('0x22')](_0x5e3e6c[_0x12e2('0x3d')][_0x12e2('0x22')]);}return _0x3084bc['getLists'](_0x352717);}})[_0x12e2('0x28')](function(_0x328356){if(_0x328356){return _0x328356?{'count':_0x57034d,'rows':_0x328356}:null;}})[_0x12e2('0x28')](respondWithResult(_0xe02cea,null))[_0x12e2('0x4e')](handleError(_0xe02cea,null));};exports[_0x12e2('0xa4')]=function(_0x1ec4c9,_0x10a432,_0x1463f4){var _0x3000dd,_0x30f765;return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x1ec4c9[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x10a432,null))[_0x12e2('0x28')](function(_0xe1923b){if(_0xe1923b){_0x30f765=_0xe1923b;return _0xe1923b['addLists'](_0x1ec4c9[_0x12e2('0x5e')][_0x12e2('0x83')],_[_0x12e2('0x5c')](_0x1ec4c9[_0x12e2('0x5e')],['ids','id'])||{});}return null;})[_0x12e2('0x9c')](function(_0x2db91a){var _0x13113d;_0x3000dd=_0x2db91a||[];var _0xf67197=[];if(_0x2db91a){for(var _0x57ef0d=0x0;_0x57ef0d<_0x2db91a[_0x12e2('0x43')];_0x57ef0d+=0x1){var _0x1e17b=_0x2db91a[_0x57ef0d][_0x12e2('0x2a')]({'plain':!![]});_0x30f765[_0x12e2('0xa5')]=_0x1ec4c9[_0x12e2('0x5e')][_0x12e2('0xa5')]?_0x1ec4c9[_0x12e2('0x5e')][_0x12e2('0xa5')]:_0x30f765[_0x12e2('0xa5')];switch(_0x30f765[_0x12e2('0xa5')]){case _0x12e2('0xa6'):_0x13113d=squel[_0x12e2('0xa7')]()[_0x12e2('0xa8')](_0x12e2('0xa9'))[_0x12e2('0xaa')](['phone',_0x12e2('0xab'),'ContactId',_0x12e2('0xac'),_0x12e2('0x67'),'createdAt',_0x12e2('0xad')],squel[_0x12e2('0x84')]()[_0x12e2('0x85')](_0x12e2('0xae'),_0x12e2('0xae'))[_0x12e2('0x85')](_0x12e2('0xaf'),'scheduledAt')[_0x12e2('0x85')]('id',_0x12e2('0xb0'))[_0x12e2('0x85')](_0x1e17b[_0x12e2('0xb1')]['toString'](),'ListId')[_0x12e2('0x85')](_0x1ec4c9[_0x12e2('0x50')]['id'][_0x12e2('0x90')](),_0x12e2('0x67'))['field'](_0x12e2('0xaf'),_0x12e2('0x5d'))[_0x12e2('0x85')](_0x12e2('0xaf'),_0x12e2('0xad'))['from'](_0x12e2('0xb2'))[_0x12e2('0x48')](_0x12e2('0xb3'))[_0x12e2('0x48')]('ListId\x20=\x20?',_0x1e17b[_0x12e2('0xb1')][_0x12e2('0x90')]())[_0x12e2('0x48')](_0x12e2('0xb4'))[_0x12e2('0x48')](_0x12e2('0xb5'),squel[_0x12e2('0x84')]()[_0x12e2('0x85')](_0x12e2('0xb6'))[_0x12e2('0x87')](_0x12e2('0xb7'))['where'](_0x12e2('0x8c'),_0x1ec4c9[_0x12e2('0x50')]['id'][_0x12e2('0x90')]()))[_0x12e2('0x48')](_0x12e2('0xb5'),squel[_0x12e2('0x84')]()[_0x12e2('0x85')]('COALESCE(phone,\x27\x27)')[_0x12e2('0x87')](_0x12e2('0xa9'))[_0x12e2('0x48')](_0x12e2('0x8c'),_0x1ec4c9['params']['id']['toString']())))[_0x12e2('0x90')]();break;case _0x12e2('0xb8'):_0x13113d=squel[_0x12e2('0xa7')]()[_0x12e2('0xa8')](_0x12e2('0xa9'))['fromQuery'](['phone',_0x12e2('0xab'),_0x12e2('0xb0'),_0x12e2('0xac'),'VoiceQueueId',_0x12e2('0x5d'),_0x12e2('0xad')],squel[_0x12e2('0x84')]()[_0x12e2('0x85')](_0x12e2('0xae'),_0x12e2('0xae'))[_0x12e2('0x85')](_0x12e2('0xaf'),'scheduledAt')[_0x12e2('0x85')]('id',_0x12e2('0xb0'))[_0x12e2('0x85')](_0x1e17b[_0x12e2('0xb1')][_0x12e2('0x90')](),'ListId')[_0x12e2('0x85')](_0x1ec4c9[_0x12e2('0x50')]['id'][_0x12e2('0x90')](),_0x12e2('0x67'))[_0x12e2('0x85')]('NOW()',_0x12e2('0x5d'))['field']('NOW()',_0x12e2('0xad'))[_0x12e2('0x87')](_0x12e2('0xb2'))[_0x12e2('0x48')](_0x12e2('0xb3'))['where'](_0x12e2('0xb9'),_0x1e17b[_0x12e2('0xb1')]['toString']())['where'](_0x12e2('0xb4'))[_0x12e2('0x48')](_0x12e2('0xb5'),squel['select']()[_0x12e2('0x85')](_0x12e2('0xba'))['from'](_0x12e2('0xa9'))['where'](_0x12e2('0x8c'),_0x1ec4c9[_0x12e2('0x50')]['id'][_0x12e2('0x90')]())))[_0x12e2('0x90')]();break;default:_0x13113d=squel[_0x12e2('0xa7')]()[_0x12e2('0xa8')](_0x12e2('0xa9'))[_0x12e2('0xaa')]([_0x12e2('0xae'),_0x12e2('0xab'),'ContactId',_0x12e2('0xac'),'VoiceQueueId',_0x12e2('0x5d'),'updatedAt'],squel[_0x12e2('0x84')]()[_0x12e2('0x85')]('phone',_0x12e2('0xae'))[_0x12e2('0x85')](_0x12e2('0xaf'),_0x12e2('0xab'))[_0x12e2('0x85')]('id',_0x12e2('0xb0'))['field'](_0x1e17b[_0x12e2('0xb1')][_0x12e2('0x90')](),_0x12e2('0xac'))[_0x12e2('0x85')](_0x1ec4c9[_0x12e2('0x50')]['id']['toString'](),_0x12e2('0x67'))[_0x12e2('0x85')]('NOW()',_0x12e2('0x5d'))[_0x12e2('0x85')](_0x12e2('0xaf'),_0x12e2('0xad'))[_0x12e2('0x87')]('cm_contacts')[_0x12e2('0x48')](_0x12e2('0xb3'))['where'](_0x12e2('0xb9'),_0x1e17b[_0x12e2('0xb1')][_0x12e2('0x90')]())[_0x12e2('0x48')](_0x12e2('0xb4')))['toString']();}_0xf67197[_0x12e2('0x8e')](db[_0x12e2('0x8f')][_0x12e2('0x3d')](_0x13113d));}return BPromise[_0x12e2('0x95')](_0xf67197);}})[_0x12e2('0x28')](function(){return _0x3000dd;})['then'](respondWithResult(_0x10a432,null))[_0x12e2('0x4e')](handleError(_0x10a432,null));};exports[_0x12e2('0xbb')]=function(_0x49b9c0,_0x42479e,_0x150068){return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x49b9c0[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x42479e,null))['then'](function(_0xc4b33e){if(_0xc4b33e){return _0xc4b33e[_0x12e2('0xbb')](_0x49b9c0['query'][_0x12e2('0x83')]);}})['then'](function(_0x14a5bb){if(_0x14a5bb){return db[_0x12e2('0x63')][_0x12e2('0x29')]({'where':{'ListId':_0x49b9c0[_0x12e2('0x3d')][_0x12e2('0x83')],'VoiceQueueId':_0x49b9c0[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](function(){return _0x14a5bb;});}})[_0x12e2('0x28')](respondWithStatusCode(_0x42479e,null))[_0x12e2('0x4e')](handleError(_0x42479e,null));};exports[_0x12e2('0xbc')]=function(_0x46a35e,_0x965684,_0x3cbb01){var _0x579026={};var _0x1d811d={};var _0x23b686;var _0x5ef11;return db[_0x12e2('0x39')][_0x12e2('0x62')]({'where':{'id':_0x46a35e[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x965684,null))['then'](function(_0x8d5b20){if(_0x8d5b20){_0x23b686=_0x8d5b20;_0x1d811d[_0x12e2('0x3c')]=_[_0x12e2('0x3e')](db[_0x12e2('0xa3')]['rawAttributes']);_0x1d811d[_0x12e2('0x3d')]=_[_0x12e2('0x3e')](_0x46a35e[_0x12e2('0x3d')]);_0x1d811d[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x1d811d[_0x12e2('0x3c')],_0x1d811d[_0x12e2('0x3d')]);_0x579026[_0x12e2('0x42')]=_['intersection'](_0x1d811d[_0x12e2('0x3c')],qs[_0x12e2('0x41')](_0x46a35e['query'][_0x12e2('0x41')]));_0x579026[_0x12e2('0x42')]=_0x579026['attributes'][_0x12e2('0x43')]?_0x579026[_0x12e2('0x42')]:_0x1d811d[_0x12e2('0x3c')];_0x579026[_0x12e2('0x64')]=qs[_0x12e2('0x46')](_0x46a35e['query']['sort']);_0x579026[_0x12e2('0x48')]=qs[_0x12e2('0x3f')](_['pick'](_0x46a35e['query'],_0x1d811d[_0x12e2('0x3f')]));if(_0x46a35e[_0x12e2('0x3d')][_0x12e2('0x2e')]){_0x579026[_0x12e2('0x48')]=_[_0x12e2('0x4a')](_0x579026['where'],{'$or':_[_0x12e2('0x30')](_0x579026[_0x12e2('0x42')],function(_0x5a51ee){var _0x193544={};_0x193544[_0x5a51ee]={'$like':'%'+_0x46a35e['query'][_0x12e2('0x2e')]+'%'};return _0x193544;})});}_0x579026=_['merge']({},_0x579026,_0x46a35e[_0x12e2('0x51')]);return _0x23b686[_0x12e2('0xbc')](_0x579026);}})[_0x12e2('0x28')](function(_0x2430b3){if(_0x2430b3){_0x5ef11=_0x2430b3[_0x12e2('0x43')];if(!_0x46a35e[_0x12e2('0x3d')][_0x12e2('0x44')](_0x12e2('0x45'))){_0x579026[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x46a35e[_0x12e2('0x3d')][_0x12e2('0x21')]);_0x579026[_0x12e2('0x22')]=qs[_0x12e2('0x22')](_0x46a35e[_0x12e2('0x3d')][_0x12e2('0x22')]);}return _0x23b686['getBlackLists'](_0x579026);}})[_0x12e2('0x28')](function(_0x193cf4){if(_0x193cf4){return _0x193cf4?{'count':_0x5ef11,'rows':_0x193cf4}:null;}})[_0x12e2('0x28')](respondWithResult(_0x965684,null))['catch'](handleError(_0x965684,null));};exports[_0x12e2('0xbd')]=function(_0x3452a5,_0x3e0745,_0x3f1125){var _0x149204,_0xd1bb17;return db[_0x12e2('0x39')][_0x12e2('0x34')]({'where':{'id':_0x3452a5[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x3e0745,null))[_0x12e2('0x28')](function(_0x460f44){if(_0x460f44){_0xd1bb17=_0x460f44;return _0x460f44[_0x12e2('0xbd')](_0x3452a5[_0x12e2('0x5e')][_0x12e2('0x83')],_[_0x12e2('0x5c')](_0x3452a5['body'],['ids','id'])||{});}return null;})[_0x12e2('0x9c')](function(_0x33a3b1){var _0x1d598e;_0x149204=_0x33a3b1||[];var _0xfb9e8=[];if(_0x33a3b1){for(var _0x8a5fb8=0x0;_0x8a5fb8<_0x33a3b1[_0x12e2('0x43')];_0x8a5fb8+=0x1){var _0x1be760=_0x33a3b1[_0x8a5fb8][_0x12e2('0x2a')]({'plain':!![]});_0x1d598e=squel[_0x12e2('0xa7')]()[_0x12e2('0xa8')]('cm_hopper_black')[_0x12e2('0xaa')](['phone',_0x12e2('0xb0'),_0x12e2('0xac'),'VoiceQueueId',_0x12e2('0x5d'),_0x12e2('0xad')],squel[_0x12e2('0x84')]()[_0x12e2('0x85')]('phone',_0x12e2('0xae'))['field']('id','ContactId')[_0x12e2('0x85')](_0x1be760[_0x12e2('0xb1')][_0x12e2('0x90')](),_0x12e2('0xac'))[_0x12e2('0x85')](_0x3452a5[_0x12e2('0x50')]['id']['toString'](),_0x12e2('0x67'))['field'](_0x12e2('0xaf'),_0x12e2('0x5d'))[_0x12e2('0x85')]('NOW()',_0x12e2('0xad'))[_0x12e2('0x87')](_0x12e2('0xb2'))['where'](_0x12e2('0xb3'))[_0x12e2('0x48')](_0x12e2('0xb9'),_0x1be760[_0x12e2('0xb1')][_0x12e2('0x90')]())['where'](_0x12e2('0xb4')))[_0x12e2('0x90')]();_0xfb9e8[_0x12e2('0x8e')](db[_0x12e2('0x8f')][_0x12e2('0x3d')](_0x1d598e));}return BPromise[_0x12e2('0x95')](_0xfb9e8);}})[_0x12e2('0x28')](function(){return _0x149204;})[_0x12e2('0x28')](respondWithResult(_0x3e0745,null))['catch'](handleError(_0x3e0745,null));};exports[_0x12e2('0xbe')]=function(_0x149694,_0x115dab,_0x361f2f){return db['VoiceQueue']['find']({'where':{'id':_0x149694[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](handleEntityNotFound(_0x115dab,null))['then'](function(_0x4e1503){if(_0x4e1503){return _0x4e1503[_0x12e2('0xbe')](_0x149694[_0x12e2('0x3d')]['ids']);}})['then'](function(_0x499ba5){if(_0x499ba5){return db[_0x12e2('0x6c')]['destroy']({'where':{'ListId':_0x149694[_0x12e2('0x3d')]['ids'],'VoiceQueueId':_0x149694[_0x12e2('0x50')]['id']}})[_0x12e2('0x28')](function(){return _0x499ba5;});}})[_0x12e2('0x28')](respondWithStatusCode(_0x115dab,null))[_0x12e2('0x4e')](handleError(_0x115dab,null));}; \ No newline at end of file +var _0x4f8a=['cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','CmHopperBlack','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','destroy','then','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','VoiceQueue','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','include','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','inbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','UserProfileSection','userProfileId','update','getHoppers','CmHopper','VoiceQueueId','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','findOrCreate','isNil','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','SELECT','every','TeamId','all','union','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','NOW()','CmListId','ListId','from','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x4f8a,0xc7));var _0xa4f8=function(_0x40f27f,_0x528d15){_0x40f27f=_0x40f27f-0x0;var _0x5d3dcb=_0x4f8a[_0x40f27f];return _0x5d3dcb;};'use strict';var emlformat=require(_0xa4f8('0x0'));var rimraf=require(_0xa4f8('0x1'));var zipdir=require(_0xa4f8('0x2'));var jsonpatch=require(_0xa4f8('0x3'));var rp=require(_0xa4f8('0x4'));var moment=require('moment');var BPromise=require(_0xa4f8('0x5'));var Mustache=require(_0xa4f8('0x6'));var util=require(_0xa4f8('0x7'));var path=require('path');var sox=require(_0xa4f8('0x8'));var csv=require('to-csv');var ejs=require(_0xa4f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4f8('0xa'));var squel=require('squel');var crypto=require(_0xa4f8('0xb'));var jsforce=require(_0xa4f8('0xc'));var deskjs=require(_0xa4f8('0xd'));var toCsv=require(_0xa4f8('0xe'));var querystring=require(_0xa4f8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa4f8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4f8('0x11'));var logger=require(_0xa4f8('0x12'))(_0xa4f8('0x13'));var utils=require('../../config/utils');var config=require(_0xa4f8('0x14'));var licenseUtil=require(_0xa4f8('0x15'));var db=require(_0xa4f8('0x16'))['db'];config['redis']=_[_0xa4f8('0x17')](config[_0xa4f8('0x18')],{'host':_0xa4f8('0x19'),'port':0x18eb});var socket=require(_0xa4f8('0x1a'))(new Redis(config[_0xa4f8('0x18')]));require(_0xa4f8('0x1b'))[_0xa4f8('0x1c')](socket);function respondWithStatusCode(_0x53e884,_0x45d850){_0x45d850=_0x45d850||0xcc;return function(_0x455f4b){if(_0x455f4b){return _0x53e884[_0xa4f8('0x1d')](_0x45d850);}return _0x53e884[_0xa4f8('0x1e')](_0x45d850)[_0xa4f8('0x1f')]();};}function respondWithResult(_0x223b38,_0x1ab7fd){_0x1ab7fd=_0x1ab7fd||0xc8;return function(_0xb4e369){if(_0xb4e369){return _0x223b38['status'](_0x1ab7fd)['json'](_0xb4e369);}};}function respondWithFilteredResult(_0x3ab0f2,_0x2a17c3){return function(_0x2251ce){if(_0x2251ce){var _0x14455c=typeof _0x2a17c3[_0xa4f8('0x20')]==='undefined'&&typeof _0x2a17c3[_0xa4f8('0x21')]===_0xa4f8('0x22');var _0x1e9737=_0x2251ce[_0xa4f8('0x23')];var _0x15e209=_0x14455c?0x0:_0x2a17c3[_0xa4f8('0x20')];var _0x23c88b=_0x14455c?_0x2251ce[_0xa4f8('0x23')]:_0x2a17c3[_0xa4f8('0x20')]+_0x2a17c3['limit'];var _0x2456f4;if(_0x23c88b>=_0x1e9737){_0x23c88b=_0x1e9737;_0x2456f4=0xc8;}else{_0x2456f4=0xce;}_0x3ab0f2['status'](_0x2456f4);return _0x3ab0f2[_0xa4f8('0x24')](_0xa4f8('0x25'),_0x15e209+'-'+_0x23c88b+'/'+_0x1e9737)[_0xa4f8('0x26')](_0x2251ce);}return null;};}function patchUpdates(_0x4726bb){return function(_0x4ec780){try{jsonpatch['apply'](_0x4ec780,_0x4726bb,!![]);}catch(_0x1fb6ac){return BPromise[_0xa4f8('0x27')](_0x1fb6ac);}return _0x4ec780[_0xa4f8('0x28')]();};}function saveUpdates(_0x18b4f7,_0x499c80){return function(_0x35163e){if(_0x35163e){return _0x35163e['update'](_0x18b4f7)['then'](function(_0x407685){return _0x407685;});}return null;};}function removeEntity(_0x39730c,_0x20d23b){return function(_0x5e6de7){if(_0x5e6de7){return _0x5e6de7[_0xa4f8('0x29')]()[_0xa4f8('0x2a')](function(){var _0x1cb954=_0x5e6de7['get']({'plain':!![]});var _0xc5795d=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xa4f8('0x2b'),'value':_0xa4f8('0x2c'),'ignore':![]}];var _0x899212=_(_0xc5795d)[_0xa4f8('0x2d')](_0xa4f8('0x2e'))[_0xa4f8('0x2f')](_0xa4f8('0x30'))['value']();if(_[_0xa4f8('0x31')](_0x899212,_0x1cb954[_0xa4f8('0x32')])){return;}var _0x462142=_[_0xa4f8('0x33')](_0xc5795d,[_0xa4f8('0x30'),_0x1cb954[_0xa4f8('0x32')]])[_0xa4f8('0x34')];return db[_0xa4f8('0x35')][_0xa4f8('0x29')]({'where':{'type':_0x462142,'resourceId':_0x1cb954['id']}})[_0xa4f8('0x2a')](function(){return _0x5e6de7;});})[_0xa4f8('0x2a')](function(){_0x39730c['status'](0xcc)[_0xa4f8('0x1f')]();});}};}function handleEntityNotFound(_0x3e5ef0,_0xcc4e2e){return function(_0xf46137){if(!_0xf46137){_0x3e5ef0['sendStatus'](0x194);}return _0xf46137;};}function handleError(_0xaf2bd7,_0x46797a){_0x46797a=_0x46797a||0x1f4;return function(_0x139b3a){logger[_0xa4f8('0x36')](_0x139b3a[_0xa4f8('0x37')]);if(_0x139b3a[_0xa4f8('0x34')]){delete _0x139b3a[_0xa4f8('0x34')];}_0xaf2bd7['status'](_0x46797a)[_0xa4f8('0x38')](_0x139b3a);};}exports['index']=function(_0x39481e,_0x32a61d){var _0x19df41={},_0x4581b8={},_0x57b6a7={'count':0x0,'rows':[]};var _0x540c6b=_[_0xa4f8('0x2f')](db[_0xa4f8('0x39')][_0xa4f8('0x3a')],function(_0x4bec5f){return{'name':_0x4bec5f['fieldName'],'type':_0x4bec5f[_0xa4f8('0x32')][_0xa4f8('0x3b')]};});_0x4581b8['model']=_[_0xa4f8('0x2f')](_0x540c6b,_0xa4f8('0x34'));_0x4581b8['query']=_[_0xa4f8('0x3c')](_0x39481e[_0xa4f8('0x3d')]);_0x4581b8[_0xa4f8('0x3e')]=_[_0xa4f8('0x3f')](_0x4581b8[_0xa4f8('0x40')],_0x4581b8[_0xa4f8('0x3d')]);_0x19df41[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x4581b8['model'],qs['fields'](_0x39481e['query'][_0xa4f8('0x42')]));_0x19df41['attributes']=_0x19df41[_0xa4f8('0x41')]['length']?_0x19df41[_0xa4f8('0x41')]:_0x4581b8[_0xa4f8('0x40')];if(!_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x43')](_0xa4f8('0x44'))){_0x19df41['limit']=qs['limit'](_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x19df41[_0xa4f8('0x20')]=qs['offset'](_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}_0x19df41[_0xa4f8('0x45')]=qs['sort'](_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x19df41[_0xa4f8('0x47')]=qs[_0xa4f8('0x3e')](_[_0xa4f8('0x48')](_0x39481e[_0xa4f8('0x3d')],_0x4581b8[_0xa4f8('0x3e')]),_0x540c6b);if(_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x19df41['where']=_[_0xa4f8('0x49')](_0x19df41[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x540c6b,function(_0x2c9274){if(_0x2c9274[_0xa4f8('0x32')]!==_0xa4f8('0x4a')){var _0x125880={};_0x125880[_0x2c9274[_0xa4f8('0x34')]]={'$like':'%'+_0x39481e['query'][_0xa4f8('0x2d')]+'%'};return _0x125880;}})});}_0x19df41=_['merge']({},_0x19df41,_0x39481e['options']);var _0x7f783={'where':_0x19df41['where']};return db[_0xa4f8('0x39')][_0xa4f8('0x23')](_0x7f783)['then'](function(_0x2e03a6){_0x57b6a7[_0xa4f8('0x23')]=_0x2e03a6;if(_0x39481e[_0xa4f8('0x3d')][_0xa4f8('0x4b')]){_0x19df41['include']=[{'all':!![]}];}return db[_0xa4f8('0x39')][_0xa4f8('0x4c')](_0x19df41);})[_0xa4f8('0x2a')](function(_0x3f4852){_0x57b6a7[_0xa4f8('0x4d')]=_0x3f4852;return _0x57b6a7;})[_0xa4f8('0x2a')](respondWithFilteredResult(_0x32a61d,_0x19df41))[_0xa4f8('0x4e')](handleError(_0x32a61d,null));};exports['show']=function(_0x1de0b1,_0x5c9bb8){var _0x1b0906={'raw':![],'where':{'id':_0x1de0b1[_0xa4f8('0x4f')]['id']}},_0x500e0b={};_0x500e0b['model']=_[_0xa4f8('0x3c')](db[_0xa4f8('0x39')][_0xa4f8('0x3a')]);_0x500e0b[_0xa4f8('0x3d')]=_['keys'](_0x1de0b1[_0xa4f8('0x3d')]);_0x500e0b['filters']=_[_0xa4f8('0x3f')](_0x500e0b['model'],_0x500e0b[_0xa4f8('0x3d')]);_0x1b0906[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x500e0b['model'],qs[_0xa4f8('0x42')](_0x1de0b1[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x1b0906[_0xa4f8('0x41')]=_0x1b0906['attributes'][_0xa4f8('0x50')]?_0x1b0906[_0xa4f8('0x41')]:_0x500e0b[_0xa4f8('0x40')];if(_0x1de0b1[_0xa4f8('0x3d')][_0xa4f8('0x4b')]){_0x1b0906[_0xa4f8('0x51')]=[{'all':!![]}];}_0x1b0906=_['merge']({},_0x1b0906,_0x1de0b1[_0xa4f8('0x52')]);return db['VoiceQueue'][_0xa4f8('0x33')](_0x1b0906)[_0xa4f8('0x2a')](handleEntityNotFound(_0x5c9bb8,null))[_0xa4f8('0x2a')](respondWithResult(_0x5c9bb8,null))[_0xa4f8('0x4e')](handleError(_0x5c9bb8,null));};exports[_0xa4f8('0x53')]=function(_0x51d130,_0xc5bcd5){return db['VoiceQueue']['create'](_0x51d130[_0xa4f8('0x54')],{})['then'](function(_0x3ca355){var _0x38a486=_0x51d130[_0xa4f8('0x55')][_0xa4f8('0x56')]({'plain':!![]});if(!_0x38a486)throw new Error(_0xa4f8('0x57'));if(_0x38a486['role']==='user'){var _0x202bbe=_0x3ca355[_0xa4f8('0x56')]({'plain':!![]});var _0x50e07b=[{'name':_0xa4f8('0x58'),'value':_0xa4f8('0x59')},{'name':_0xa4f8('0x2b'),'value':_0xa4f8('0x2c')}];var _0x568e7d=_['find'](_0x50e07b,[_0xa4f8('0x30'),_0x202bbe[_0xa4f8('0x32')]])[_0xa4f8('0x34')];return db['UserProfileSection'][_0xa4f8('0x33')]({'where':{'name':_0x568e7d,'userProfileId':_0x38a486['userProfileId']},'raw':!![]})[_0xa4f8('0x2a')](function(_0x377125){if(_0x377125&&_0x377125[_0xa4f8('0x5a')]===0x0){return db[_0xa4f8('0x35')][_0xa4f8('0x53')]({'name':_0x202bbe[_0xa4f8('0x34')],'resourceId':_0x202bbe['id'],'type':_0x377125[_0xa4f8('0x34')],'sectionId':_0x377125['id']},{})[_0xa4f8('0x2a')](function(){return _0x3ca355;});}else{return _0x3ca355;}})[_0xa4f8('0x4e')](function(_0x421deb){logger[_0xa4f8('0x36')](_0xa4f8('0x5b'),_0x421deb);throw _0x421deb;});}return _0x3ca355;})['then'](respondWithResult(_0xc5bcd5,0xc9))[_0xa4f8('0x4e')](handleError(_0xc5bcd5,null));};exports['clone']=function(_0x452aff,_0x510493){var _0x556b6a={'where':{'id':_0x452aff[_0xa4f8('0x4f')]['id']}},_0x46771b={};_0x46771b['model']=_[_0xa4f8('0x3c')](db['VoiceQueue'][_0xa4f8('0x3a')]);_0x556b6a[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x46771b['model'],qs[_0xa4f8('0x42')](_0x452aff[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x556b6a[_0xa4f8('0x41')]=_0x556b6a[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x556b6a[_0xa4f8('0x41')]:_0x46771b[_0xa4f8('0x40')];if(_0x452aff[_0xa4f8('0x3d')][_0xa4f8('0x4b')]){_0x556b6a[_0xa4f8('0x51')]=[{'all':!![]}];}_0x556b6a=_[_0xa4f8('0x49')]({},_0x556b6a,_0x452aff['options']);return db['VoiceQueue'][_0xa4f8('0x33')](_0x556b6a)[_0xa4f8('0x2a')](handleEntityNotFound(_0x510493,null))['then'](function(_0x504b1a){if(_0x504b1a){var _0x54ee03=_0x504b1a[_0xa4f8('0x56')]({'plain':!![]});_0x54ee03=qs['omit'](_0x54ee03,['id',_0xa4f8('0x5c'),_0xa4f8('0x5d')]);_0x452aff['body']=_[_0xa4f8('0x5e')](_0x452aff['body'],['id',_0xa4f8('0x5c'),'updatedAt']);return db['VoiceQueue'][_0xa4f8('0x53')](_[_0xa4f8('0x49')](_0x54ee03,_0x452aff[_0xa4f8('0x54')]),{'include':_0x452aff['query'][_0xa4f8('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x323c0d){var _0x654698=_0x452aff[_0xa4f8('0x55')][_0xa4f8('0x56')]({'plain':!![]});if(!_0x654698)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x654698[_0xa4f8('0x5f')]==='user'){var _0x4a0fb2=_0x323c0d['get']({'plain':!![]});var _0x22b041=[{'name':'VoiceQueues','value':_0xa4f8('0x59')},{'name':'QueueCampaigns','value':_0xa4f8('0x2c')}];var _0x5ebf50=_['find'](_0x22b041,['value',_0x4a0fb2[_0xa4f8('0x32')]])[_0xa4f8('0x34')];return db[_0xa4f8('0x60')][_0xa4f8('0x33')]({'where':{'name':_0x5ebf50,'userProfileId':_0x654698[_0xa4f8('0x61')]},'raw':!![]})['then'](function(_0xe76fe6){if(_0xe76fe6&&_0xe76fe6['autoAssociation']===0x0){return db['UserProfileResource'][_0xa4f8('0x53')]({'name':_0x4a0fb2[_0xa4f8('0x34')],'resourceId':_0x4a0fb2['id'],'type':_0xe76fe6['name'],'sectionId':_0xe76fe6['id']},{})[_0xa4f8('0x2a')](function(){return _0x323c0d;});}else{return _0x323c0d;}})[_0xa4f8('0x4e')](function(_0x258f7d){logger[_0xa4f8('0x36')](_0xa4f8('0x5b'),_0x258f7d);throw _0x258f7d;});}return _0x323c0d;});}})[_0xa4f8('0x2a')](respondWithResult(_0x510493,0xc9))[_0xa4f8('0x4e')](handleError(_0x510493,null));};exports[_0xa4f8('0x62')]=function(_0x1f310f,_0x182aff){if(_0x1f310f[_0xa4f8('0x54')]['id']){delete _0x1f310f['body']['id'];}return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x1f310f[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x182aff,null))[_0xa4f8('0x2a')](saveUpdates(_0x1f310f[_0xa4f8('0x54')],null))[_0xa4f8('0x2a')](respondWithResult(_0x182aff,null))['catch'](handleError(_0x182aff,null));};exports[_0xa4f8('0x29')]=function(_0x2583ed,_0x2efaca){return db['VoiceQueue']['find']({'where':{'id':_0x2583ed[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2efaca,null))[_0xa4f8('0x2a')](removeEntity(_0x2efaca,null))['catch'](handleError(_0x2efaca,null));};exports[_0xa4f8('0x63')]=function(_0x146c51,_0x393c30,_0x30089b){var _0x33fbdb={'raw':![],'where':{}};var _0x3bfe25={};var _0x5ccf56={'count':0x0,'rows':[]};return db[_0xa4f8('0x39')]['findOne']({'where':{'id':_0x146c51[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x393c30,null))[_0xa4f8('0x2a')](function(_0x3b0870){if(_0x3b0870){_0x3bfe25[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db[_0xa4f8('0x64')][_0xa4f8('0x3a')]);_0x3bfe25[_0xa4f8('0x3d')]=_[_0xa4f8('0x3c')](_0x146c51[_0xa4f8('0x3d')]);_0x3bfe25['filters']=_[_0xa4f8('0x3f')](_0x3bfe25[_0xa4f8('0x40')],_0x3bfe25[_0xa4f8('0x3d')]);_0x33fbdb['attributes']=_['intersection'](_0x3bfe25[_0xa4f8('0x40')],qs['fields'](_0x146c51[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x33fbdb[_0xa4f8('0x41')]=_0x33fbdb['attributes'][_0xa4f8('0x50')]?_0x33fbdb[_0xa4f8('0x41')]:_0x3bfe25[_0xa4f8('0x40')];if(!_0x146c51[_0xa4f8('0x3d')][_0xa4f8('0x43')](_0xa4f8('0x44'))){_0x33fbdb['limit']=qs['limit'](_0x146c51[_0xa4f8('0x3d')]['limit']);_0x33fbdb[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x146c51['query'][_0xa4f8('0x20')]);}_0x33fbdb['order']=qs[_0xa4f8('0x46')](_0x146c51[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x33fbdb[_0xa4f8('0x47')]=qs['filters'](_[_0xa4f8('0x48')](_0x146c51[_0xa4f8('0x3d')],_0x3bfe25['filters']));_0x33fbdb[_0xa4f8('0x47')][_0xa4f8('0x65')]=_0x3b0870['id'];if(_0x146c51['query'][_0xa4f8('0x2d')]){_0x33fbdb[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x33fbdb[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x33fbdb[_0xa4f8('0x41')],function(_0x122d62){var _0x516ef5={};_0x516ef5[_0x122d62]={'$like':'%'+_0x146c51[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0x516ef5;})});}_0x33fbdb=_[_0xa4f8('0x49')]({},_0x33fbdb,_0x146c51[_0xa4f8('0x52')]);return db[_0xa4f8('0x64')]['count']({'where':_0x33fbdb[_0xa4f8('0x47')]})[_0xa4f8('0x2a')](function(_0x5e1a95){_0x5ccf56[_0xa4f8('0x23')]=_0x5e1a95;if(_0x146c51[_0xa4f8('0x3d')]['includeAll']){_0x33fbdb[_0xa4f8('0x51')]=[{'all':!![]}];}return db[_0xa4f8('0x64')][_0xa4f8('0x4c')](_0x33fbdb);})[_0xa4f8('0x2a')](function(_0xb5086a){_0x5ccf56[_0xa4f8('0x4d')]=_0xb5086a;return _0x5ccf56;});}})['then'](respondWithFilteredResult(_0x393c30,_0x33fbdb))['catch'](handleError(_0x393c30,null));};exports['getHopperHistories']=function(_0x3df5e0,_0x2c3356,_0x41daeb){var _0x1e3e66={'raw':!![],'where':{}};var _0x27e832={};var _0x4d080c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa4f8('0x66')]({'where':{'id':_0x3df5e0[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c3356,null))[_0xa4f8('0x2a')](function(_0x578274){if(_0x578274){_0x27e832[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db[_0xa4f8('0x67')][_0xa4f8('0x3a')]);_0x27e832[_0xa4f8('0x3d')]=_[_0xa4f8('0x3c')](_0x3df5e0[_0xa4f8('0x3d')]);_0x27e832[_0xa4f8('0x3e')]=_[_0xa4f8('0x3f')](_0x27e832['model'],_0x27e832[_0xa4f8('0x3d')]);_0x1e3e66[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x27e832[_0xa4f8('0x40')],qs[_0xa4f8('0x42')](_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x1e3e66[_0xa4f8('0x41')]=_0x1e3e66[_0xa4f8('0x41')]['length']?_0x1e3e66[_0xa4f8('0x41')]:_0x27e832[_0xa4f8('0x40')];if(!_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x43')]('nolimit')){_0x1e3e66[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x1e3e66[_0xa4f8('0x20')]=qs['offset'](_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}_0x1e3e66[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x3df5e0[_0xa4f8('0x3d')]['sort']);_0x1e3e66[_0xa4f8('0x47')]=qs[_0xa4f8('0x3e')](_['pick'](_0x3df5e0[_0xa4f8('0x3d')],_0x27e832[_0xa4f8('0x3e')]));_0x1e3e66['where'][_0xa4f8('0x65')]=_0x578274['id'];if(_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x1e3e66[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x1e3e66[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x1e3e66['attributes'],function(_0x121fd7){var _0x44d060={};_0x44d060[_0x121fd7]={'$like':'%'+_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0x44d060;})});}_0x1e3e66=_[_0xa4f8('0x49')]({},_0x1e3e66,_0x3df5e0['options']);return db['CmHopperHistory'][_0xa4f8('0x23')]({'where':_0x1e3e66[_0xa4f8('0x47')]})[_0xa4f8('0x2a')](function(_0x593a66){_0x4d080c[_0xa4f8('0x23')]=_0x593a66;if(_0x3df5e0[_0xa4f8('0x3d')][_0xa4f8('0x4b')]){_0x1e3e66[_0xa4f8('0x51')]=[{'all':!![]}];}return db[_0xa4f8('0x67')][_0xa4f8('0x4c')](_0x1e3e66);})[_0xa4f8('0x2a')](function(_0x5a1b47){_0x4d080c['rows']=_0x5a1b47;return _0x4d080c;});}})[_0xa4f8('0x2a')](respondWithFilteredResult(_0x2c3356,_0x1e3e66))['catch'](handleError(_0x2c3356,null));};exports[_0xa4f8('0x68')]=function(_0x212257,_0x5b6c4c,_0x545ea4){var _0x534459={'raw':!![],'where':{}};var _0x42478f={};var _0x237e90={'count':0x0,'rows':[]};return db[_0xa4f8('0x39')][_0xa4f8('0x66')]({'where':{'id':_0x212257['params']['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x5b6c4c,null))[_0xa4f8('0x2a')](function(_0x1662c3){if(_0x1662c3){_0x42478f[_0xa4f8('0x40')]=_['keys'](db[_0xa4f8('0x69')][_0xa4f8('0x3a')]);_0x42478f[_0xa4f8('0x3d')]=_[_0xa4f8('0x3c')](_0x212257[_0xa4f8('0x3d')]);_0x42478f['filters']=_[_0xa4f8('0x3f')](_0x42478f[_0xa4f8('0x40')],_0x42478f['query']);_0x534459[_0xa4f8('0x41')]=_['intersection'](_0x42478f['model'],qs[_0xa4f8('0x42')](_0x212257[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x534459[_0xa4f8('0x41')]=_0x534459[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x534459[_0xa4f8('0x41')]:_0x42478f[_0xa4f8('0x40')];if(!_0x212257['query'][_0xa4f8('0x43')]('nolimit')){_0x534459[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x212257[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x534459[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x212257['query'][_0xa4f8('0x20')]);}_0x534459[_0xa4f8('0x45')]=qs['sort'](_0x212257[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x534459['where']=qs['filters'](_['pick'](_0x212257[_0xa4f8('0x3d')],_0x42478f['filters']));_0x534459[_0xa4f8('0x47')][_0xa4f8('0x65')]=_0x1662c3['id'];if(_0x212257[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x534459['where']=_[_0xa4f8('0x49')](_0x534459['where'],{'$or':_[_0xa4f8('0x2f')](_0x534459[_0xa4f8('0x41')],function(_0x426b42){var _0x1cb8f9={};_0x1cb8f9[_0x426b42]={'$like':'%'+_0x212257['query'][_0xa4f8('0x2d')]+'%'};return _0x1cb8f9;})});}_0x534459=_['merge']({},_0x534459,_0x212257[_0xa4f8('0x52')]);return db['CmHopperFinal'][_0xa4f8('0x23')]({'where':_0x534459[_0xa4f8('0x47')]})[_0xa4f8('0x2a')](function(_0x402caa){_0x237e90[_0xa4f8('0x23')]=_0x402caa;if(_0x212257[_0xa4f8('0x3d')][_0xa4f8('0x4b')]){_0x534459['include']=[{'all':!![]}];}return db[_0xa4f8('0x69')][_0xa4f8('0x4c')](_0x534459);})[_0xa4f8('0x2a')](function(_0x4fb569){_0x237e90[_0xa4f8('0x4d')]=_0x4fb569;return _0x237e90;});}})[_0xa4f8('0x2a')](respondWithFilteredResult(_0x5b6c4c,_0x534459))[_0xa4f8('0x4e')](handleError(_0x5b6c4c,null));};exports[_0xa4f8('0x6a')]=function(_0x2f67af,_0xc41d90,_0x2f703a){var _0x1ee9a1={'raw':!![],'where':{}};var _0x1b782c={};var _0x1df2b8={'count':0x0,'rows':[]};return db[_0xa4f8('0x39')][_0xa4f8('0x66')]({'where':{'id':_0x2f67af[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc41d90,null))[_0xa4f8('0x2a')](function(_0xd63bed){if(_0xd63bed){_0x1b782c['model']=_[_0xa4f8('0x3c')](db['CmHopperBlack'][_0xa4f8('0x3a')]);_0x1b782c['query']=_[_0xa4f8('0x3c')](_0x2f67af[_0xa4f8('0x3d')]);_0x1b782c[_0xa4f8('0x3e')]=_['intersection'](_0x1b782c['model'],_0x1b782c[_0xa4f8('0x3d')]);_0x1ee9a1[_0xa4f8('0x41')]=_['intersection'](_0x1b782c[_0xa4f8('0x40')],qs[_0xa4f8('0x42')](_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x1ee9a1[_0xa4f8('0x41')]=_0x1ee9a1[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x1ee9a1['attributes']:_0x1b782c[_0xa4f8('0x40')];if(!_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x43')](_0xa4f8('0x44'))){_0x1ee9a1[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x1ee9a1[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}_0x1ee9a1[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x1ee9a1[_0xa4f8('0x47')]=qs[_0xa4f8('0x3e')](_[_0xa4f8('0x48')](_0x2f67af[_0xa4f8('0x3d')],_0x1b782c[_0xa4f8('0x3e')]));_0x1ee9a1['where'][_0xa4f8('0x65')]=_0xd63bed['id'];if(_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x1ee9a1[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x1ee9a1[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x1ee9a1[_0xa4f8('0x41')],function(_0x2b3f30){var _0x5a9ebb={};_0x5a9ebb[_0x2b3f30]={'$like':'%'+_0x2f67af[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0x5a9ebb;})});}_0x1ee9a1=_[_0xa4f8('0x49')]({},_0x1ee9a1,_0x2f67af[_0xa4f8('0x52')]);return db['CmHopperBlack'][_0xa4f8('0x23')]({'where':_0x1ee9a1[_0xa4f8('0x47')]})[_0xa4f8('0x2a')](function(_0x1b1079){_0x1df2b8[_0xa4f8('0x23')]=_0x1b1079;if(_0x2f67af['query'][_0xa4f8('0x4b')]){_0x1ee9a1[_0xa4f8('0x51')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa4f8('0x4c')](_0x1ee9a1);})[_0xa4f8('0x2a')](function(_0x1d9ba2){_0x1df2b8[_0xa4f8('0x4d')]=_0x1d9ba2;return _0x1df2b8;});}})[_0xa4f8('0x2a')](respondWithFilteredResult(_0xc41d90,_0x1ee9a1))[_0xa4f8('0x4e')](handleError(_0xc41d90,null));};exports[_0xa4f8('0x6b')]=function(_0x4cfb87,_0x73a13a,_0x1bc848){var _0x24332b={};var _0x73658d={};var _0x51cd1b;var _0x31a324;return db[_0xa4f8('0x39')][_0xa4f8('0x66')]({'where':{'id':_0x4cfb87[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x73a13a,null))['then'](function(_0xa7f6ba){if(_0xa7f6ba){_0x51cd1b=_0xa7f6ba;_0x73658d['model']=_[_0xa4f8('0x3c')](db[_0xa4f8('0x6c')][_0xa4f8('0x3a')]);_0x73658d['query']=_[_0xa4f8('0x3c')](_0x4cfb87['query']);_0x73658d[_0xa4f8('0x3e')]=_['intersection'](_0x73658d['model'],_0x73658d[_0xa4f8('0x3d')]);_0x24332b[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x73658d[_0xa4f8('0x40')],qs[_0xa4f8('0x42')](_0x4cfb87[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x24332b[_0xa4f8('0x41')]=_0x24332b['attributes'][_0xa4f8('0x50')]?_0x24332b[_0xa4f8('0x41')]:_0x73658d[_0xa4f8('0x40')];_0x24332b[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x4cfb87[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x24332b['where']=qs[_0xa4f8('0x3e')](_[_0xa4f8('0x48')](_0x4cfb87[_0xa4f8('0x3d')],_0x73658d[_0xa4f8('0x3e')]));if(_0x4cfb87['query'][_0xa4f8('0x2d')]){_0x24332b[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x24332b[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x24332b[_0xa4f8('0x41')],function(_0x3fd42f){var _0xe626d0={};_0xe626d0[_0x3fd42f]={'$like':'%'+_0x4cfb87[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0xe626d0;})});}_0x24332b=_[_0xa4f8('0x49')]({},_0x24332b,_0x4cfb87[_0xa4f8('0x52')]);return _0x51cd1b['getTeams'](_0x24332b);}})['then'](function(_0x2f5cd6){if(_0x2f5cd6){_0x31a324=_0x2f5cd6[_0xa4f8('0x50')];if(!_0x4cfb87['query'][_0xa4f8('0x43')](_0xa4f8('0x44'))){_0x24332b[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x4cfb87[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x24332b[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x4cfb87[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}return _0x51cd1b[_0xa4f8('0x6b')](_0x24332b);}})[_0xa4f8('0x2a')](function(_0x4ae4ca){if(_0x4ae4ca){return _0x4ae4ca?{'count':_0x31a324,'rows':_0x4ae4ca}:null;}})[_0xa4f8('0x2a')](respondWithResult(_0x73a13a,null))[_0xa4f8('0x4e')](handleError(_0x73a13a,null));};exports[_0xa4f8('0x6d')]=function(_0x1fef58,_0x13e7cd,_0x50a8c7){var _0x201bdb=_0x1fef58[_0xa4f8('0x54')]['teams'];var _0x1580c0=_[_0xa4f8('0x2f')](_0x201bdb,'id');return db[_0xa4f8('0x6c')][_0xa4f8('0x4c')]({'where':{'id':_0x1580c0},'attributes':['id'],'include':[{'model':db[_0xa4f8('0x6e')],'as':_0xa4f8('0x6f'),'attributes':['id',_0xa4f8('0x34'),_0xa4f8('0x70'),_0xa4f8('0x71'),_0xa4f8('0x72')],'raw':!![]}]})[_0xa4f8('0x2a')](function(_0x5befc0){if(_0x5befc0){var _0x4e9289=_['flatMap'](_0x5befc0,function(_0x2c31c8){var _0x2042e9=_0x2c31c8[_0xa4f8('0x56')]({'plain':!![]});_0x2042e9[_0xa4f8('0x6f')][_0xa4f8('0x73')](function(_0x1a6c80){_0x1a6c80[_0xa4f8('0x74')]=_[_0xa4f8('0x33')](_0x201bdb,{'id':_0x2042e9['id']})[_0xa4f8('0x74')];});return _0x2042e9['Agents'];});return db[_0xa4f8('0x39')]['find']({'where':{'id':_0x1fef58[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](function(_0x103273){return db['sequelize'][_0xa4f8('0x75')](function(_0x9217d){return _0x103273[_0xa4f8('0x6d')](_0x1580c0,{'transaction':_0x9217d})[_0xa4f8('0x2a')](function(){return BPromise[_0xa4f8('0x76')](_0x201bdb,function(_0xed0a6){return db[_0xa4f8('0x77')][_0xa4f8('0x78')]({'TeamId':_0xed0a6['id'],'VoiceQueueId':_0x1fef58['params']['id'],'penalty':_0xed0a6[_0xa4f8('0x74')]},{'transaction':_0x9217d});});})[_0xa4f8('0x2a')](function(){return BPromise['each'](_0x4e9289,function(_0x5376ea){return db['UserVoiceQueue'][_0xa4f8('0x79')]({'where':{'UserId':_0x5376ea['id'],'VoiceQueueId':_0x1fef58[_0xa4f8('0x4f')]['id']},'defaults':{'penalty':_0x5376ea['penalty']},'transaction':_0x9217d});});})[_0xa4f8('0x2a')](function(){return BPromise['each'](_['filter'](_0x4e9289,{'online':!![]}),function(_0x49aaf9){return db['UserVoiceQueueRt'][_0xa4f8('0x78')]({'membername':_0x49aaf9[_0xa4f8('0x34')],'UserId':_0x49aaf9['id'],'queue_name':_0x103273[_0xa4f8('0x34')],'VoiceQueueId':_0x103273['id'],'interface':_[_0xa4f8('0x7a')](_0x49aaf9[_0xa4f8('0x72')])?util['format'](_0xa4f8('0x7b'),_0x49aaf9['name']):_0x49aaf9['interface'],'paused':_0x49aaf9[_0xa4f8('0x71')]||![],'penalty':_0x49aaf9[_0xa4f8('0x74')]},{'transaction':_0x9217d});});})[_0xa4f8('0x2a')](function(){_0x4e9289[_0xa4f8('0x73')](function(_0x330eaa){socket[_0xa4f8('0x7c')](_0xa4f8('0x7d'),{'UserId':_0x330eaa['id'],'VoiceQueueId':_0x103273['id']});});});});});}})['then'](respondWithStatusCode(_0x13e7cd,null))[_0xa4f8('0x4e')](handleError(_0x13e7cd,null));};exports[_0xa4f8('0x7e')]=function(_0x4e836c,_0x5cc210,_0x38dcf2){return db[_0xa4f8('0x6c')][_0xa4f8('0x4c')]({'where':{'id':_0x4e836c[_0xa4f8('0x3d')][_0xa4f8('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa4f8('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xa4f8('0x2a')](handleEntityNotFound(_0x5cc210,null))[_0xa4f8('0x2a')](function(_0x1835b4){var _0x5d0d57=_[_0xa4f8('0x2f')](_0x1835b4,'id');var _0x48711c=[];var _0x17a8d4=[];var _0xb671d7=squel[_0xa4f8('0x80')]();_0xb671d7[_0xa4f8('0x81')](_0xa4f8('0x82'))['from'](_0xa4f8('0x83'),'tq')[_0xa4f8('0x84')](_0xa4f8('0x85'),'ut',_0xa4f8('0x86'))['where'](_0xa4f8('0x87'),_0x4e836c[_0xa4f8('0x4f')]['id']);for(var _0xd9035f=0x0;_0xd9035f<_0x1835b4[_0xa4f8('0x50')];_0xd9035f+=0x1){let _0x554af6=_0x1835b4[_0xd9035f];for(var _0x40abc5=0x0;_0x40abc5<_0x554af6[_0xa4f8('0x6f')][_0xa4f8('0x50')];_0x40abc5+=0x1){let _0x1d3947=_0x554af6[_0xa4f8('0x6f')][_0x40abc5];var _0x2f13fd=_0xb671d7[_0xa4f8('0x88')]();_0x2f13fd[_0xa4f8('0x47')](_0xa4f8('0x89'),_0x1d3947['id']);_0x17a8d4['push'](db['sequelize'][_0xa4f8('0x3d')](_0x2f13fd[_0xa4f8('0x8a')](),{'type':db[_0xa4f8('0x8b')]['QueryTypes'][_0xa4f8('0x8c')]})[_0xa4f8('0x2a')](function(_0x389c29){if(_0x389c29[_0xa4f8('0x50')]===0x1){return _0x1d3947['id'];}else{var _0x70bb94=_[_0xa4f8('0x8d')](_['map'](_0x389c29,_0xa4f8('0x8e')),function(_0x3516f4){return _[_0xa4f8('0x31')](_0x5d0d57,_0x3516f4);});if(_0x70bb94){return _0x1d3947['id'];}}}));}}return BPromise[_0xa4f8('0x8f')](_0x17a8d4)[_0xa4f8('0x2a')](function(_0x15360d){_0x48711c=_(_0x48711c)[_0xa4f8('0x90')](_0x15360d)['compact']()['value']();return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x4e836c[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](function(_0x31fc3e){return db[_0xa4f8('0x8b')][_0xa4f8('0x75')](function(_0x49795b){return _0x31fc3e[_0xa4f8('0x7e')](_0x4e836c[_0xa4f8('0x3d')][_0xa4f8('0x7f')],{'transaction':_0x49795b})[_0xa4f8('0x2a')](function(){if(!_[_0xa4f8('0x91')](_0x48711c)){return _0x31fc3e['removeAgents'](_0x48711c,{'transaction':_0x49795b})[_0xa4f8('0x2a')](function(){return db[_0xa4f8('0x92')][_0xa4f8('0x29')]({'where':{'VoiceQueueId':_0x4e836c[_0xa4f8('0x4f')]['id'],'UserId':_0x48711c},'transaction':_0x49795b});});}})['then'](function(){_0x48711c[_0xa4f8('0x73')](function(_0x332fdc){socket[_0xa4f8('0x7c')](_0xa4f8('0x93'),{'UserId':_0x332fdc,'VoiceQueueId':_0x31fc3e['id']});});});});});});})['then'](respondWithStatusCode(_0x5cc210,null))[_0xa4f8('0x4e')](handleError(_0x5cc210,null));};exports[_0xa4f8('0x94')]=function(_0x3a45e3,_0x139aaf,_0x4c6ae8){var _0x4ee958,_0x48517e;return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x3a45e3['params']['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x139aaf,null))[_0xa4f8('0x2a')](function(_0x4504d6){if(_0x4504d6){_0x48517e=_0x4504d6;return _0x4504d6[_0xa4f8('0x94')](_0x3a45e3[_0xa4f8('0x54')][_0xa4f8('0x7f')],_[_0xa4f8('0x5e')](_0x3a45e3['body'],[_0xa4f8('0x7f'),'id'])||{})['spread'](function(_0x5b93ef){for(var _0x1eaebf=0x0;_0x1eaebf<_0x3a45e3[_0xa4f8('0x54')]['ids'][_0xa4f8('0x50')];_0x1eaebf+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x3a45e3[_0xa4f8('0x54')]['ids'][_0x1eaebf]),'VoiceQueueId':Number(_0x3a45e3[_0xa4f8('0x4f')]['id'])});}return _0x5b93ef;});}})[_0xa4f8('0x2a')](function(_0x1b838e){_0x4ee958=_0x1b838e||[];if(_0x48517e){return db['User']['findAll']({'where':{'id':_0x3a45e3[_0xa4f8('0x54')][_0xa4f8('0x7f')]},'attributes':['id',_0xa4f8('0x34'),_0xa4f8('0x70'),_0xa4f8('0x71'),_0xa4f8('0x72')],'raw':!![]});}})['then'](function(_0x5cb0c6){if(!_[_0xa4f8('0x91')](_0x5cb0c6)){var _0x25f8eb=[];for(var _0x4f4846=0x0;_0x4f4846<_0x5cb0c6[_0xa4f8('0x50')];_0x4f4846++){if(_0x5cb0c6[_0x4f4846][_0xa4f8('0x70')]){_0x25f8eb['push'](db[_0xa4f8('0x92')][_0xa4f8('0x78')]({'membername':_0x5cb0c6[_0x4f4846][_0xa4f8('0x34')],'UserId':_0x5cb0c6[_0x4f4846]['id'],'queue_name':_0x48517e[_0xa4f8('0x34')],'VoiceQueueId':_0x48517e['id'],'interface':_[_0xa4f8('0x7a')](_0x5cb0c6[_0x4f4846][_0xa4f8('0x72')])?util['format'](_0xa4f8('0x7b'),_0x5cb0c6[_0x4f4846][_0xa4f8('0x34')]):_0x5cb0c6[_0x4f4846][_0xa4f8('0x72')],'paused':_0x5cb0c6[_0x4f4846][_0xa4f8('0x71')]||![],'penalty':_0x3a45e3[_0xa4f8('0x54')][_0xa4f8('0x74')]||0x0}));}}return BPromise[_0xa4f8('0x8f')](_0x25f8eb);}})[_0xa4f8('0x2a')](function(){return _0x4ee958;})[_0xa4f8('0x2a')](respondWithResult(_0x139aaf,null))[_0xa4f8('0x4e')](handleError(_0x139aaf,null));};exports[_0xa4f8('0x95')]=function(_0x23b3e6,_0x536ed5,_0x56046d){return db['VoiceQueue']['find']({'where':{'id':_0x23b3e6[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x536ed5,null))['then'](function(_0x25299e){if(_0x25299e){return _0x25299e[_0xa4f8('0x95')](_0x23b3e6[_0xa4f8('0x3d')][_0xa4f8('0x7f')])[_0xa4f8('0x2a')](function(){if(_[_0xa4f8('0x96')](_0x23b3e6['query'][_0xa4f8('0x7f')])){for(var _0x49e87c=0x0;_0x49e87c<_0x23b3e6[_0xa4f8('0x3d')][_0xa4f8('0x7f')][_0xa4f8('0x50')];_0x49e87c+=0x1){socket[_0xa4f8('0x7c')](_0xa4f8('0x93'),{'UserId':Number(_0x23b3e6[_0xa4f8('0x3d')][_0xa4f8('0x7f')][_0x49e87c]),'VoiceQueueId':Number(_0x23b3e6[_0xa4f8('0x4f')]['id'])});}}else{socket[_0xa4f8('0x7c')](_0xa4f8('0x93'),{'UserId':Number(_0x23b3e6[_0xa4f8('0x3d')]['ids']),'VoiceQueueId':Number(_0x23b3e6[_0xa4f8('0x4f')]['id'])});}});}})[_0xa4f8('0x2a')](function(_0xf804f3){return db[_0xa4f8('0x92')]['destroy']({'where':{'VoiceQueueId':_0x23b3e6['params']['id'],'UserId':_0x23b3e6[_0xa4f8('0x3d')][_0xa4f8('0x7f')]}})[_0xa4f8('0x2a')](function(){return _0xf804f3;});})[_0xa4f8('0x2a')](respondWithStatusCode(_0x536ed5,null))[_0xa4f8('0x4e')](handleError(_0x536ed5,null));};exports[_0xa4f8('0x97')]=function(_0x42dd63,_0x119e3f,_0x7b131a){var _0x39282d={};var _0x48b3d9={};var _0x13ff27;var _0x1397b0;return db[_0xa4f8('0x39')]['findOne']({'where':{'id':_0x42dd63[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x119e3f,null))[_0xa4f8('0x2a')](function(_0x20c4fb){if(_0x20c4fb){_0x13ff27=_0x20c4fb;_0x48b3d9[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db[_0xa4f8('0x6e')]['rawAttributes']);_0x48b3d9[_0xa4f8('0x3d')]=_[_0xa4f8('0x3c')](_0x42dd63[_0xa4f8('0x3d')]);_0x48b3d9[_0xa4f8('0x3e')]=_[_0xa4f8('0x3f')](_0x48b3d9[_0xa4f8('0x40')],_0x48b3d9[_0xa4f8('0x3d')]);_0x39282d[_0xa4f8('0x41')]=_[_0xa4f8('0x3f')](_0x48b3d9[_0xa4f8('0x40')],qs['fields'](_0x42dd63[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x39282d[_0xa4f8('0x41')]=_0x39282d[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x39282d['attributes']:_0x48b3d9['model'];_0x39282d[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x42dd63[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x39282d[_0xa4f8('0x47')]=qs['filters'](_[_0xa4f8('0x48')](_0x42dd63[_0xa4f8('0x3d')],_0x48b3d9[_0xa4f8('0x3e')]));if(_0x42dd63[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x39282d['where']=_['merge'](_0x39282d[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x39282d['attributes'],function(_0x3c592d){var _0x4ae323={};_0x4ae323[_0x3c592d]={'$like':'%'+_0x42dd63['query'][_0xa4f8('0x2d')]+'%'};return _0x4ae323;})});}_0x39282d=_['merge']({},_0x39282d,_0x42dd63[_0xa4f8('0x52')]);return _0x13ff27[_0xa4f8('0x97')](_0x39282d);}})[_0xa4f8('0x2a')](function(_0x4559ae){if(_0x4559ae){_0x1397b0=_0x4559ae[_0xa4f8('0x50')];if(!_0x42dd63[_0xa4f8('0x3d')]['hasOwnProperty'](_0xa4f8('0x44'))){_0x39282d[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x42dd63[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x39282d[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x42dd63[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}return _0x13ff27[_0xa4f8('0x97')](_0x39282d);}})[_0xa4f8('0x2a')](function(_0x2de375){if(_0x2de375){return _0x2de375?{'count':_0x1397b0,'rows':_0x2de375}:null;}})[_0xa4f8('0x2a')](respondWithResult(_0x119e3f,null))['catch'](handleError(_0x119e3f,null));};exports[_0xa4f8('0x98')]=function(_0x5751dd,_0x5c251c,_0x2165df){var _0x48f006={};var _0x372525={};var _0xd7643b;var _0x1f20c3;return db['VoiceQueue'][_0xa4f8('0x66')]({'where':{'id':_0x5751dd[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c251c,null))[_0xa4f8('0x2a')](function(_0x2d0142){if(_0x2d0142){_0xd7643b=_0x2d0142;_0x372525[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db['UserVoiceQueueRt'][_0xa4f8('0x3a')]);_0x372525[_0xa4f8('0x3d')]=_[_0xa4f8('0x3c')](_0x5751dd[_0xa4f8('0x3d')]);_0x372525['filters']=_[_0xa4f8('0x3f')](_0x372525['model'],_0x372525['query']);_0x48f006[_0xa4f8('0x41')]=_['intersection'](_0x372525[_0xa4f8('0x40')],qs[_0xa4f8('0x42')](_0x5751dd[_0xa4f8('0x3d')]['fields']));_0x48f006[_0xa4f8('0x41')]=_0x48f006['attributes'][_0xa4f8('0x50')]?_0x48f006[_0xa4f8('0x41')]:_0x372525[_0xa4f8('0x40')];_0x48f006[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x5751dd[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x48f006[_0xa4f8('0x47')]=qs['filters'](_[_0xa4f8('0x48')](_0x5751dd['query'],_0x372525[_0xa4f8('0x3e')]));if(_0x5751dd['query'][_0xa4f8('0x2d')]){_0x48f006['where']=_[_0xa4f8('0x49')](_0x48f006[_0xa4f8('0x47')],{'$or':_[_0xa4f8('0x2f')](_0x48f006['attributes'],function(_0x9995d1){var _0x166781={};_0x166781[_0x9995d1]={'$like':'%'+_0x5751dd[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0x166781;})});}_0x48f006=_['merge']({},_0x48f006,_0x5751dd[_0xa4f8('0x52')]);return _0xd7643b['getMembers'](_0x48f006);}})[_0xa4f8('0x2a')](function(_0x1036d0){if(_0x1036d0){_0x1f20c3=_0x1036d0[_0xa4f8('0x50')];if(!_0x5751dd[_0xa4f8('0x3d')][_0xa4f8('0x43')]('nolimit')){_0x48f006[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x5751dd[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x48f006[_0xa4f8('0x20')]=qs['offset'](_0x5751dd[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}return _0xd7643b[_0xa4f8('0x98')](_0x48f006);}})[_0xa4f8('0x2a')](function(_0x519f07){return _0x519f07?{'count':_0x1f20c3,'rows':_0x519f07}:null;})[_0xa4f8('0x2a')](respondWithResult(_0x5c251c,null))[_0xa4f8('0x4e')](handleError(_0x5c251c,null));};exports['getLists']=function(_0x207f3b,_0x3675dd,_0x1207bc){var _0x355fdb={};var _0x190001={};var _0x1c5439;var _0x1f13fc;return db[_0xa4f8('0x39')][_0xa4f8('0x66')]({'where':{'id':_0x207f3b[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x3675dd,null))[_0xa4f8('0x2a')](function(_0xa36922){if(_0xa36922){_0x1c5439=_0xa36922;_0x190001[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db[_0xa4f8('0x99')][_0xa4f8('0x3a')]);_0x190001['query']=_[_0xa4f8('0x3c')](_0x207f3b[_0xa4f8('0x3d')]);_0x190001['filters']=_[_0xa4f8('0x3f')](_0x190001['model'],_0x190001[_0xa4f8('0x3d')]);_0x355fdb[_0xa4f8('0x41')]=_['intersection'](_0x190001['model'],qs['fields'](_0x207f3b[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x355fdb['attributes']=_0x355fdb[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x355fdb['attributes']:_0x190001[_0xa4f8('0x40')];_0x355fdb[_0xa4f8('0x45')]=qs[_0xa4f8('0x46')](_0x207f3b[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x355fdb[_0xa4f8('0x47')]=qs['filters'](_[_0xa4f8('0x48')](_0x207f3b[_0xa4f8('0x3d')],_0x190001[_0xa4f8('0x3e')]));if(_0x207f3b[_0xa4f8('0x3d')][_0xa4f8('0x2d')]){_0x355fdb[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x355fdb[_0xa4f8('0x47')],{'$or':_['map'](_0x355fdb[_0xa4f8('0x41')],function(_0x5ef108){var _0x419ced={};_0x419ced[_0x5ef108]={'$like':'%'+_0x207f3b[_0xa4f8('0x3d')]['filter']+'%'};return _0x419ced;})});}_0x355fdb=_[_0xa4f8('0x49')]({},_0x355fdb,_0x207f3b[_0xa4f8('0x52')]);return _0x1c5439['getLists'](_0x355fdb);}})[_0xa4f8('0x2a')](function(_0x3560d4){if(_0x3560d4){_0x1f13fc=_0x3560d4[_0xa4f8('0x50')];if(!_0x207f3b[_0xa4f8('0x3d')]['hasOwnProperty'](_0xa4f8('0x44'))){_0x355fdb[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x207f3b[_0xa4f8('0x3d')][_0xa4f8('0x21')]);_0x355fdb[_0xa4f8('0x20')]=qs[_0xa4f8('0x20')](_0x207f3b[_0xa4f8('0x3d')]['offset']);}return _0x1c5439[_0xa4f8('0x9a')](_0x355fdb);}})['then'](function(_0x3e41f0){if(_0x3e41f0){return _0x3e41f0?{'count':_0x1f13fc,'rows':_0x3e41f0}:null;}})[_0xa4f8('0x2a')](respondWithResult(_0x3675dd,null))[_0xa4f8('0x4e')](handleError(_0x3675dd,null));};exports[_0xa4f8('0x9b')]=function(_0x5a9046,_0x30a0ee,_0x364120){var _0x3f08ad,_0xf23a39;return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x5a9046[_0xa4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30a0ee,null))['then'](function(_0x56b908){if(_0x56b908){_0xf23a39=_0x56b908;return _0x56b908[_0xa4f8('0x9b')](_0x5a9046[_0xa4f8('0x54')]['ids'],_[_0xa4f8('0x5e')](_0x5a9046[_0xa4f8('0x54')],[_0xa4f8('0x7f'),'id'])||{});}return null;})[_0xa4f8('0x9c')](function(_0x1d8dc6){var _0x276e5f;_0x3f08ad=_0x1d8dc6||[];var _0xbbce4d=[];if(_0x1d8dc6){for(var _0xca660e=0x0;_0xca660e<_0x1d8dc6[_0xa4f8('0x50')];_0xca660e+=0x1){var _0x2fe1cb=_0x1d8dc6[_0xca660e]['get']({'plain':!![]});_0xf23a39[_0xa4f8('0x9d')]=_0x5a9046[_0xa4f8('0x54')][_0xa4f8('0x9d')]?_0x5a9046[_0xa4f8('0x54')]['dialCheckDuplicateType']:_0xf23a39['dialCheckDuplicateType'];switch(_0xf23a39[_0xa4f8('0x9d')]){case'always':_0x276e5f=squel[_0xa4f8('0x9e')]()[_0xa4f8('0x9f')](_0xa4f8('0xa0'))[_0xa4f8('0xa1')](['phone',_0xa4f8('0xa2'),_0xa4f8('0xa3'),'ListId',_0xa4f8('0x65'),_0xa4f8('0x5c'),_0xa4f8('0x5d')],squel[_0xa4f8('0x80')]()['field']('phone',_0xa4f8('0xa4'))[_0xa4f8('0x81')](_0xa4f8('0xa5'),_0xa4f8('0xa2'))[_0xa4f8('0x81')]('id',_0xa4f8('0xa3'))[_0xa4f8('0x81')](_0x2fe1cb[_0xa4f8('0xa6')]['toString'](),_0xa4f8('0xa7'))[_0xa4f8('0x81')](_0x5a9046[_0xa4f8('0x4f')]['id']['toString'](),_0xa4f8('0x65'))['field'](_0xa4f8('0xa5'),_0xa4f8('0x5c'))['field'](_0xa4f8('0xa5'),_0xa4f8('0x5d'))[_0xa4f8('0xa8')]('cm_contacts')[_0xa4f8('0x47')](_0xa4f8('0xa9'))['where']('ListId\x20=\x20?',_0x2fe1cb[_0xa4f8('0xa6')][_0xa4f8('0x8a')]())[_0xa4f8('0x47')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa4f8('0x80')]()[_0xa4f8('0x81')](_0xa4f8('0xaa'))[_0xa4f8('0xa8')](_0xa4f8('0xab'))[_0xa4f8('0x47')](_0xa4f8('0x87'),_0x5a9046[_0xa4f8('0x4f')]['id'][_0xa4f8('0x8a')]()))[_0xa4f8('0x47')](_0xa4f8('0xac'),squel[_0xa4f8('0x80')]()['field'](_0xa4f8('0xad'))[_0xa4f8('0xa8')]('cm_hopper')[_0xa4f8('0x47')](_0xa4f8('0x87'),_0x5a9046[_0xa4f8('0x4f')]['id']['toString']())))[_0xa4f8('0x8a')]();break;case _0xa4f8('0xae'):_0x276e5f=squel['insert']()[_0xa4f8('0x9f')]('cm_hopper')['fromQuery']([_0xa4f8('0xa4'),_0xa4f8('0xa2'),_0xa4f8('0xa3'),_0xa4f8('0xa7'),_0xa4f8('0x65'),_0xa4f8('0x5c'),'updatedAt'],squel[_0xa4f8('0x80')]()[_0xa4f8('0x81')](_0xa4f8('0xa4'),_0xa4f8('0xa4'))[_0xa4f8('0x81')](_0xa4f8('0xa5'),_0xa4f8('0xa2'))[_0xa4f8('0x81')]('id',_0xa4f8('0xa3'))[_0xa4f8('0x81')](_0x2fe1cb[_0xa4f8('0xa6')]['toString'](),_0xa4f8('0xa7'))[_0xa4f8('0x81')](_0x5a9046['params']['id'][_0xa4f8('0x8a')](),_0xa4f8('0x65'))[_0xa4f8('0x81')](_0xa4f8('0xa5'),_0xa4f8('0x5c'))[_0xa4f8('0x81')]('NOW()',_0xa4f8('0x5d'))[_0xa4f8('0xa8')](_0xa4f8('0xaf'))[_0xa4f8('0x47')]('deletedAt\x20IS\x20NULL')[_0xa4f8('0x47')]('ListId\x20=\x20?',_0x2fe1cb[_0xa4f8('0xa6')][_0xa4f8('0x8a')]())[_0xa4f8('0x47')](_0xa4f8('0xb0'))['where'](_0xa4f8('0xac'),squel[_0xa4f8('0x80')]()[_0xa4f8('0x81')](_0xa4f8('0xad'))[_0xa4f8('0xa8')](_0xa4f8('0xa0'))[_0xa4f8('0x47')](_0xa4f8('0x87'),_0x5a9046[_0xa4f8('0x4f')]['id'][_0xa4f8('0x8a')]())))[_0xa4f8('0x8a')]();break;default:_0x276e5f=squel['insert']()['into'](_0xa4f8('0xa0'))[_0xa4f8('0xa1')]([_0xa4f8('0xa4'),_0xa4f8('0xa2'),_0xa4f8('0xa3'),_0xa4f8('0xa7'),_0xa4f8('0x65'),_0xa4f8('0x5c'),_0xa4f8('0x5d')],squel['select']()[_0xa4f8('0x81')](_0xa4f8('0xa4'),_0xa4f8('0xa4'))[_0xa4f8('0x81')]('NOW()',_0xa4f8('0xa2'))[_0xa4f8('0x81')]('id',_0xa4f8('0xa3'))['field'](_0x2fe1cb[_0xa4f8('0xa6')][_0xa4f8('0x8a')](),_0xa4f8('0xa7'))[_0xa4f8('0x81')](_0x5a9046[_0xa4f8('0x4f')]['id'][_0xa4f8('0x8a')](),_0xa4f8('0x65'))['field']('NOW()',_0xa4f8('0x5c'))[_0xa4f8('0x81')](_0xa4f8('0xa5'),_0xa4f8('0x5d'))[_0xa4f8('0xa8')](_0xa4f8('0xaf'))[_0xa4f8('0x47')](_0xa4f8('0xa9'))['where'](_0xa4f8('0xb1'),_0x2fe1cb[_0xa4f8('0xa6')]['toString']())[_0xa4f8('0x47')](_0xa4f8('0xb0')))['toString']();}_0xbbce4d[_0xa4f8('0xb2')](db[_0xa4f8('0x8b')][_0xa4f8('0x3d')](_0x276e5f));}return BPromise['all'](_0xbbce4d);}})[_0xa4f8('0x2a')](function(){return _0x3f08ad;})[_0xa4f8('0x2a')](respondWithResult(_0x30a0ee,null))[_0xa4f8('0x4e')](handleError(_0x30a0ee,null));};exports[_0xa4f8('0xb3')]=function(_0x333c6d,_0x1514af,_0x62b736){return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x333c6d[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x1514af,null))['then'](function(_0x1b2c72){if(_0x1b2c72){return _0x1b2c72[_0xa4f8('0xb3')](_0x333c6d[_0xa4f8('0x3d')][_0xa4f8('0x7f')]);}})[_0xa4f8('0x2a')](function(_0x4517e0){if(_0x4517e0){return db[_0xa4f8('0x64')][_0xa4f8('0x29')]({'where':{'ListId':_0x333c6d['query'][_0xa4f8('0x7f')],'VoiceQueueId':_0x333c6d[_0xa4f8('0x4f')]['id']}})['then'](function(){return _0x4517e0;});}})[_0xa4f8('0x2a')](respondWithStatusCode(_0x1514af,null))[_0xa4f8('0x4e')](handleError(_0x1514af,null));};exports['getBlackLists']=function(_0x4f6f4c,_0x5bef8b,_0xf02513){var _0x2b7054={};var _0x5429c6={};var _0x5bb55a;var _0x5e5341;return db['VoiceQueue'][_0xa4f8('0x66')]({'where':{'id':_0x4f6f4c[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x5bef8b,null))[_0xa4f8('0x2a')](function(_0x5d9b5b){if(_0x5d9b5b){_0x5bb55a=_0x5d9b5b;_0x5429c6[_0xa4f8('0x40')]=_[_0xa4f8('0x3c')](db[_0xa4f8('0x99')][_0xa4f8('0x3a')]);_0x5429c6[_0xa4f8('0x3d')]=_['keys'](_0x4f6f4c['query']);_0x5429c6[_0xa4f8('0x3e')]=_[_0xa4f8('0x3f')](_0x5429c6[_0xa4f8('0x40')],_0x5429c6[_0xa4f8('0x3d')]);_0x2b7054['attributes']=_[_0xa4f8('0x3f')](_0x5429c6[_0xa4f8('0x40')],qs[_0xa4f8('0x42')](_0x4f6f4c[_0xa4f8('0x3d')][_0xa4f8('0x42')]));_0x2b7054[_0xa4f8('0x41')]=_0x2b7054[_0xa4f8('0x41')][_0xa4f8('0x50')]?_0x2b7054[_0xa4f8('0x41')]:_0x5429c6['model'];_0x2b7054['order']=qs['sort'](_0x4f6f4c[_0xa4f8('0x3d')][_0xa4f8('0x46')]);_0x2b7054[_0xa4f8('0x47')]=qs[_0xa4f8('0x3e')](_[_0xa4f8('0x48')](_0x4f6f4c[_0xa4f8('0x3d')],_0x5429c6[_0xa4f8('0x3e')]));if(_0x4f6f4c['query'][_0xa4f8('0x2d')]){_0x2b7054[_0xa4f8('0x47')]=_[_0xa4f8('0x49')](_0x2b7054[_0xa4f8('0x47')],{'$or':_['map'](_0x2b7054['attributes'],function(_0x5078e7){var _0x715f98={};_0x715f98[_0x5078e7]={'$like':'%'+_0x4f6f4c[_0xa4f8('0x3d')][_0xa4f8('0x2d')]+'%'};return _0x715f98;})});}_0x2b7054=_['merge']({},_0x2b7054,_0x4f6f4c[_0xa4f8('0x52')]);return _0x5bb55a[_0xa4f8('0xb4')](_0x2b7054);}})[_0xa4f8('0x2a')](function(_0x2c604b){if(_0x2c604b){_0x5e5341=_0x2c604b[_0xa4f8('0x50')];if(!_0x4f6f4c[_0xa4f8('0x3d')][_0xa4f8('0x43')](_0xa4f8('0x44'))){_0x2b7054[_0xa4f8('0x21')]=qs[_0xa4f8('0x21')](_0x4f6f4c['query'][_0xa4f8('0x21')]);_0x2b7054['offset']=qs[_0xa4f8('0x20')](_0x4f6f4c[_0xa4f8('0x3d')][_0xa4f8('0x20')]);}return _0x5bb55a['getBlackLists'](_0x2b7054);}})[_0xa4f8('0x2a')](function(_0x386715){if(_0x386715){return _0x386715?{'count':_0x5e5341,'rows':_0x386715}:null;}})[_0xa4f8('0x2a')](respondWithResult(_0x5bef8b,null))[_0xa4f8('0x4e')](handleError(_0x5bef8b,null));};exports[_0xa4f8('0xb5')]=function(_0x15129c,_0x3eeb0b,_0x4b9ff8){var _0x1db493,_0x48de1b;return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x15129c[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x3eeb0b,null))[_0xa4f8('0x2a')](function(_0x3c580f){if(_0x3c580f){_0x48de1b=_0x3c580f;return _0x3c580f[_0xa4f8('0xb5')](_0x15129c['body']['ids'],_[_0xa4f8('0x5e')](_0x15129c[_0xa4f8('0x54')],[_0xa4f8('0x7f'),'id'])||{});}return null;})[_0xa4f8('0x9c')](function(_0x3827c8){var _0xb33710;_0x1db493=_0x3827c8||[];var _0x319f6a=[];if(_0x3827c8){for(var _0x1ff1dd=0x0;_0x1ff1dd<_0x3827c8['length'];_0x1ff1dd+=0x1){var _0xfc5e31=_0x3827c8[_0x1ff1dd]['get']({'plain':!![]});_0xb33710=squel[_0xa4f8('0x9e')]()[_0xa4f8('0x9f')](_0xa4f8('0xb6'))[_0xa4f8('0xa1')]([_0xa4f8('0xa4'),_0xa4f8('0xa3'),_0xa4f8('0xa7'),_0xa4f8('0x65'),_0xa4f8('0x5c'),_0xa4f8('0x5d')],squel[_0xa4f8('0x80')]()[_0xa4f8('0x81')](_0xa4f8('0xa4'),_0xa4f8('0xa4'))[_0xa4f8('0x81')]('id','ContactId')[_0xa4f8('0x81')](_0xfc5e31[_0xa4f8('0xa6')][_0xa4f8('0x8a')](),_0xa4f8('0xa7'))[_0xa4f8('0x81')](_0x15129c['params']['id'][_0xa4f8('0x8a')](),_0xa4f8('0x65'))[_0xa4f8('0x81')](_0xa4f8('0xa5'),'createdAt')['field'](_0xa4f8('0xa5'),_0xa4f8('0x5d'))[_0xa4f8('0xa8')]('cm_contacts')[_0xa4f8('0x47')](_0xa4f8('0xa9'))['where'](_0xa4f8('0xb1'),_0xfc5e31[_0xa4f8('0xa6')][_0xa4f8('0x8a')]())[_0xa4f8('0x47')](_0xa4f8('0xb0')))[_0xa4f8('0x8a')]();_0x319f6a['push'](db[_0xa4f8('0x8b')]['query'](_0xb33710));}return BPromise[_0xa4f8('0x8f')](_0x319f6a);}})[_0xa4f8('0x2a')](function(){return _0x1db493;})[_0xa4f8('0x2a')](respondWithResult(_0x3eeb0b,null))[_0xa4f8('0x4e')](handleError(_0x3eeb0b,null));};exports[_0xa4f8('0xb7')]=function(_0x4c4152,_0x351290,_0x2620bc){return db[_0xa4f8('0x39')][_0xa4f8('0x33')]({'where':{'id':_0x4c4152[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](handleEntityNotFound(_0x351290,null))['then'](function(_0x3288c8){if(_0x3288c8){return _0x3288c8[_0xa4f8('0xb7')](_0x4c4152[_0xa4f8('0x3d')][_0xa4f8('0x7f')]);}})[_0xa4f8('0x2a')](function(_0x58555f){if(_0x58555f){return db[_0xa4f8('0xb8')][_0xa4f8('0x29')]({'where':{'ListId':_0x4c4152[_0xa4f8('0x3d')][_0xa4f8('0x7f')],'VoiceQueueId':_0x4c4152[_0xa4f8('0x4f')]['id']}})[_0xa4f8('0x2a')](function(){return _0x58555f;});}})[_0xa4f8('0x2a')](respondWithStatusCode(_0x351290,null))[_0xa4f8('0x4e')](handleError(_0x351290,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5e6a970..e63e631 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 _0x59d8=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2443b9,_0x40b12a){var _0x3f48b7=function(_0x2f496a){while(--_0x2f496a){_0x2443b9['push'](_0x2443b9['shift']());}};_0x3f48b7(++_0x40b12a);}(_0x59d8,0x182));var _0x859d=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x59d8[_0x424357];return _0x29c68e;};'use strict';var EventEmitter=require(_0x859d('0x0'));var VoiceQueue=require(_0x859d('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x859d('0x2')](0x0);var events={'afterCreate':_0x859d('0x3'),'afterUpdate':'update','afterDestroy':_0x859d('0x4')};function emitEvent(_0x5aabb1){return function(_0x4f7b3e,_0x1e095a,_0x5b9cd3){VoiceQueueEvents[_0x859d('0x5')](_0x5aabb1+':'+_0x4f7b3e['id'],_0x4f7b3e);VoiceQueueEvents[_0x859d('0x5')](_0x5aabb1,_0x4f7b3e);_0x5b9cd3(null);};}for(var e in events){if(events[_0x859d('0x6')](e)){var event=events[e];VoiceQueue[_0x859d('0x7')](e,emitEvent(event));}}module[_0x859d('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xd413=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd413,0xe6));var _0x3d41=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0xd413[_0x92713a];return _0x1893e1;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x3d41('0x0'))['db'][_0x3d41('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3d41('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d41('0x3'),'afterDestroy':_0x3d41('0x4')};function emitEvent(_0x5d869f){return function(_0x45d4fa,_0x3fad66,_0x2232ed){VoiceQueueEvents[_0x3d41('0x5')](_0x5d869f+':'+_0x45d4fa['id'],_0x45d4fa);VoiceQueueEvents[_0x3d41('0x5')](_0x5d869f,_0x45d4fa);_0x2232ed(null);};}for(var e in events){if(events[_0x3d41('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x3d41('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index a1c07d7..f4d8f39 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(_0x364040,_0x2661d5){var _0x4328dc=function(_0x29a477){while(--_0x29a477){_0x364040['push'](_0x364040['shift']());}};_0x4328dc(++_0x2661d5);}(_0x3e74,0x175));var _0x43e7=function(_0x28e672,_0x26727b){_0x28e672=_0x28e672-0x0;var _0x500af0=_0x3e74[_0x28e672];return _0x500af0;};'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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x55ca,0x126));var _0xa55c=function(_0x8fb092,_0x883290){_0x8fb092=_0x8fb092-0x0;var _0xd63883=_0x55ca[_0x8fb092];return _0xd63883;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 993ed55..8eabd5e 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 _0x2057=['rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowVoiceQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x2057,0x1d9));var _0x7205=function(_0x5372bc,_0x3171ad){_0x5372bc=_0x5372bc-0x0;var _0x1b8f84=_0x2057[_0x5372bc];return _0x1b8f84;};'use strict';var _=require(_0x7205('0x0'));var util=require(_0x7205('0x1'));var moment=require(_0x7205('0x2'));var BPromise=require(_0x7205('0x3'));var rs=require(_0x7205('0x4'));var fs=require('fs');var Redis=require(_0x7205('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7205('0x6'));var logger=require('../../config/logger')(_0x7205('0x7'));var config=require('../../config/environment');var jayson=require(_0x7205('0x8'));var client=jayson['client'][_0x7205('0x9')]({'port':0x232a});config[_0x7205('0xa')]=_[_0x7205('0xb')](config[_0x7205('0xa')],{'host':_0x7205('0xc'),'port':0x18eb});var socket=require(_0x7205('0xd'))(new Redis(config[_0x7205('0xa')]));require(_0x7205('0xe'))[_0x7205('0xf')](socket);function respondWithRpcPromise(_0x3ae436,_0x5ec62e,_0x2fef29){return new BPromise(function(_0x44b4d4,_0x26b8a1){return client[_0x7205('0x10')](_0x3ae436,_0x2fef29)['then'](function(_0x5713f4){logger[_0x7205('0x11')](_0x7205('0x12'),_0x5ec62e,_0x7205('0x13'));logger[_0x7205('0x14')](_0x7205('0x15'),_0x5ec62e,'request\x20sent',JSON['stringify'](_0x5713f4));if(_0x5713f4[_0x7205('0x16')]){if(_0x5713f4[_0x7205('0x16')]['code']===0x1f4){logger[_0x7205('0x16')](_0x7205('0x12'),_0x5ec62e,_0x5713f4[_0x7205('0x16')][_0x7205('0x17')]);return _0x26b8a1(_0x5713f4[_0x7205('0x16')]['message']);}logger[_0x7205('0x16')](_0x7205('0x12'),_0x5ec62e,_0x5713f4[_0x7205('0x16')][_0x7205('0x17')]);return _0x44b4d4(_0x5713f4[_0x7205('0x16')][_0x7205('0x17')]);}else{logger['info'](_0x7205('0x12'),_0x5ec62e,_0x7205('0x13'));_0x44b4d4(_0x5713f4[_0x7205('0x18')][_0x7205('0x17')]);}})[_0x7205('0x19')](function(_0x2fa4eb){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x5ec62e,_0x2fa4eb);_0x26b8a1(_0x2fa4eb);});});}exports[_0x7205('0x1a')]=function(_0x36b246){var _0x5b6655=this;return new Promise(function(_0x1e5e3f,_0x3664a3){return db[_0x7205('0x1b')][_0x7205('0x1c')]({'raw':_0x36b246[_0x7205('0x1d')]?_0x36b246['options'][_0x7205('0x1e')]===undefined?!![]:![]:!![],'where':_0x36b246[_0x7205('0x1d')]?_0x36b246['options']['where']||null:null,'attributes':_0x36b246[_0x7205('0x1d')]?_0x36b246[_0x7205('0x1d')][_0x7205('0x1f')]||null:null,'limit':_0x36b246[_0x7205('0x1d')]?_0x36b246['options'][_0x7205('0x20')]||null:null,'include':_0x36b246[_0x7205('0x1d')]?_0x36b246[_0x7205('0x1d')][_0x7205('0x21')]?_[_0x7205('0x22')](_0x36b246[_0x7205('0x1d')][_0x7205('0x21')],function(_0x2a004d){return{'model':db[_0x2a004d[_0x7205('0x23')]],'as':_0x2a004d['as'],'attributes':_0x2a004d[_0x7205('0x1f')],'include':_0x2a004d[_0x7205('0x21')]?_[_0x7205('0x22')](_0x2a004d[_0x7205('0x21')],function(_0x1d4d91){return{'model':db[_0x1d4d91[_0x7205('0x23')]],'as':_0x1d4d91['as'],'attributes':_0x1d4d91[_0x7205('0x1f')],'include':_0x1d4d91[_0x7205('0x21')]?_['map'](_0x1d4d91[_0x7205('0x21')],function(_0x723afc){return{'model':db[_0x723afc[_0x7205('0x23')]],'as':_0x723afc['as'],'attributes':_0x723afc['attributes']};}):[]};}):[]};}):[]:[]})[_0x7205('0x24')](function(_0x2be839){logger[_0x7205('0x11')]('GetVoiceQueue',_0x36b246);logger['debug'](_0x7205('0x1a'),_0x36b246,JSON['stringify'](_0x2be839));_0x1e5e3f(_0x2be839);})[_0x7205('0x19')](function(_0x40cd29){logger[_0x7205('0x16')](_0x7205('0x1a'),_0x40cd29[_0x7205('0x17')],_0x36b246);_0x3664a3(_0x5b6655['error'](0x1f4,_0x40cd29['message']));});});};exports[_0x7205('0x25')]=function(_0x68062a){var _0x530602=this;return new Promise(function(_0x5b3e05,_0x383b22){return db[_0x7205('0x1b')][_0x7205('0x26')]({'raw':_0x68062a['options']?_0x68062a[_0x7205('0x1d')][_0x7205('0x1e')]===undefined?!![]:![]:!![],'where':_0x68062a[_0x7205('0x1d')]?_0x68062a[_0x7205('0x1d')]['where']||null:null,'attributes':_0x68062a[_0x7205('0x1d')]?_0x68062a[_0x7205('0x1d')][_0x7205('0x1f')]||null:null,'include':_0x68062a['options']?_0x68062a[_0x7205('0x1d')][_0x7205('0x21')]?_['map'](_0x68062a[_0x7205('0x1d')]['include'],function(_0xc33f39){return{'model':db[_0xc33f39['model']],'as':_0xc33f39['as'],'attributes':_0xc33f39[_0x7205('0x1f')],'include':_0xc33f39[_0x7205('0x21')]?_[_0x7205('0x22')](_0xc33f39['include'],function(_0x4a975c){return{'model':db[_0x4a975c[_0x7205('0x23')]],'as':_0x4a975c['as'],'attributes':_0x4a975c['attributes'],'include':_0x4a975c[_0x7205('0x21')]?_[_0x7205('0x22')](_0x4a975c[_0x7205('0x21')],function(_0x337235){return{'model':db[_0x337235[_0x7205('0x23')]],'as':_0x337235['as'],'attributes':_0x337235[_0x7205('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7205('0x24')](function(_0x30a307){logger['info'](_0x7205('0x25'),_0x68062a);logger[_0x7205('0x14')](_0x7205('0x25'),_0x68062a,JSON[_0x7205('0x27')](_0x30a307));_0x5b3e05(_0x30a307);})[_0x7205('0x19')](function(_0x9bff00){logger[_0x7205('0x16')](_0x7205('0x25'),_0x9bff00[_0x7205('0x17')],_0x68062a);_0x383b22(_0x530602[_0x7205('0x16')](0x1f4,_0x9bff00['message']));});});}; \ No newline at end of file +var _0x5b57=['request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceQueue','findAll','options','where','attributes','limit','map','include','model','GetVoiceQueue','debug','stringify','ShowVoiceQueue','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x5ac8f0,_0x42ab66){var _0x9933e6=function(_0x316042){while(--_0x316042){_0x5ac8f0['push'](_0x5ac8f0['shift']());}};_0x9933e6(++_0x42ab66);}(_0x5b57,0xe2));var _0x75b5=function(_0x3f5b9b,_0x1114d0){_0x3f5b9b=_0x3f5b9b-0x0;var _0xa2d04=_0x5b57[_0x3f5b9b];return _0xa2d04;};'use strict';var _=require(_0x75b5('0x0'));var util=require(_0x75b5('0x1'));var moment=require('moment');var BPromise=require(_0x75b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75b5('0x3'));var db=require(_0x75b5('0x4'))['db'];var utils=require(_0x75b5('0x5'));var logger=require(_0x75b5('0x6'))(_0x75b5('0x7'));var config=require(_0x75b5('0x8'));var jayson=require(_0x75b5('0x9'));var client=jayson[_0x75b5('0xa')]['http']({'port':0x232a});config[_0x75b5('0xb')]=_[_0x75b5('0xc')](config[_0x75b5('0xb')],{'host':_0x75b5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75b5('0xb')]));require(_0x75b5('0xe'))[_0x75b5('0xf')](socket);function respondWithRpcPromise(_0x14e4d7,_0x4edd27,_0x4c60e0){return new BPromise(function(_0x2b75c4,_0x8d5d8c){return client[_0x75b5('0x10')](_0x14e4d7,_0x4c60e0)[_0x75b5('0x11')](function(_0x496f88){logger[_0x75b5('0x12')](_0x75b5('0x13'),_0x4edd27,_0x75b5('0x14'));logger['debug'](_0x75b5('0x15'),_0x4edd27,_0x75b5('0x14'),JSON['stringify'](_0x496f88));if(_0x496f88['error']){if(_0x496f88[_0x75b5('0x16')][_0x75b5('0x17')]===0x1f4){logger[_0x75b5('0x16')](_0x75b5('0x13'),_0x4edd27,_0x496f88['error'][_0x75b5('0x18')]);return _0x8d5d8c(_0x496f88[_0x75b5('0x16')]['message']);}logger[_0x75b5('0x16')](_0x75b5('0x13'),_0x4edd27,_0x496f88[_0x75b5('0x16')][_0x75b5('0x18')]);return _0x2b75c4(_0x496f88[_0x75b5('0x16')][_0x75b5('0x18')]);}else{logger[_0x75b5('0x12')](_0x75b5('0x13'),_0x4edd27,_0x75b5('0x14'));_0x2b75c4(_0x496f88[_0x75b5('0x19')][_0x75b5('0x18')]);}})[_0x75b5('0x1a')](function(_0x4a6b99){logger[_0x75b5('0x16')](_0x75b5('0x13'),_0x4edd27,_0x4a6b99);_0x8d5d8c(_0x4a6b99);});});}exports['GetVoiceQueue']=function(_0x39ac9e){var _0xcc7e77=this;return new Promise(function(_0x316537,_0x30ee0d){return db[_0x75b5('0x1b')][_0x75b5('0x1c')]({'raw':_0x39ac9e[_0x75b5('0x1d')]?_0x39ac9e[_0x75b5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x39ac9e[_0x75b5('0x1d')]?_0x39ac9e[_0x75b5('0x1d')][_0x75b5('0x1e')]||null:null,'attributes':_0x39ac9e[_0x75b5('0x1d')]?_0x39ac9e['options'][_0x75b5('0x1f')]||null:null,'limit':_0x39ac9e[_0x75b5('0x1d')]?_0x39ac9e[_0x75b5('0x1d')][_0x75b5('0x20')]||null:null,'include':_0x39ac9e['options']?_0x39ac9e[_0x75b5('0x1d')]['include']?_[_0x75b5('0x21')](_0x39ac9e[_0x75b5('0x1d')][_0x75b5('0x22')],function(_0x130ead){return{'model':db[_0x130ead[_0x75b5('0x23')]],'as':_0x130ead['as'],'attributes':_0x130ead[_0x75b5('0x1f')],'include':_0x130ead[_0x75b5('0x22')]?_[_0x75b5('0x21')](_0x130ead[_0x75b5('0x22')],function(_0x296e27){return{'model':db[_0x296e27[_0x75b5('0x23')]],'as':_0x296e27['as'],'attributes':_0x296e27[_0x75b5('0x1f')],'include':_0x296e27[_0x75b5('0x22')]?_[_0x75b5('0x21')](_0x296e27[_0x75b5('0x22')],function(_0x2a36bd){return{'model':db[_0x2a36bd[_0x75b5('0x23')]],'as':_0x2a36bd['as'],'attributes':_0x2a36bd[_0x75b5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x75b5('0x11')](function(_0x206ce1){logger[_0x75b5('0x12')](_0x75b5('0x24'),_0x39ac9e);logger[_0x75b5('0x25')](_0x75b5('0x24'),_0x39ac9e,JSON[_0x75b5('0x26')](_0x206ce1));_0x316537(_0x206ce1);})[_0x75b5('0x1a')](function(_0x1ca88b){logger[_0x75b5('0x16')](_0x75b5('0x24'),_0x1ca88b['message'],_0x39ac9e);_0x30ee0d(_0xcc7e77[_0x75b5('0x16')](0x1f4,_0x1ca88b[_0x75b5('0x18')]));});});};exports[_0x75b5('0x27')]=function(_0x322d89){var _0x23b9e9=this;return new Promise(function(_0x50aba4,_0x195d84){return db[_0x75b5('0x1b')]['find']({'raw':_0x322d89[_0x75b5('0x1d')]?_0x322d89[_0x75b5('0x1d')][_0x75b5('0x28')]===undefined?!![]:![]:!![],'where':_0x322d89['options']?_0x322d89[_0x75b5('0x1d')]['where']||null:null,'attributes':_0x322d89[_0x75b5('0x1d')]?_0x322d89[_0x75b5('0x1d')][_0x75b5('0x1f')]||null:null,'include':_0x322d89[_0x75b5('0x1d')]?_0x322d89[_0x75b5('0x1d')][_0x75b5('0x22')]?_[_0x75b5('0x21')](_0x322d89[_0x75b5('0x1d')]['include'],function(_0x20bcc8){return{'model':db[_0x20bcc8[_0x75b5('0x23')]],'as':_0x20bcc8['as'],'attributes':_0x20bcc8[_0x75b5('0x1f')],'include':_0x20bcc8[_0x75b5('0x22')]?_[_0x75b5('0x21')](_0x20bcc8['include'],function(_0x147854){return{'model':db[_0x147854[_0x75b5('0x23')]],'as':_0x147854['as'],'attributes':_0x147854[_0x75b5('0x1f')],'include':_0x147854[_0x75b5('0x22')]?_[_0x75b5('0x21')](_0x147854[_0x75b5('0x22')],function(_0x4becd4){return{'model':db[_0x4becd4[_0x75b5('0x23')]],'as':_0x4becd4['as'],'attributes':_0x4becd4['attributes']};}):[]};}):[]};}):[]:[]})[_0x75b5('0x11')](function(_0x243ec7){logger['info'](_0x75b5('0x27'),_0x322d89);logger[_0x75b5('0x25')](_0x75b5('0x27'),_0x322d89,JSON[_0x75b5('0x26')](_0x243ec7));_0x50aba4(_0x243ec7);})['catch'](function(_0xb49235){logger['error']('ShowVoiceQueue',_0xb49235['message'],_0x322d89);_0x195d84(_0x23b9e9[_0x75b5('0x16')](0x1f4,_0xb49235['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index a81aef5..d812081 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 _0x7aef=['register','length','save','remove','removeListener'];(function(_0x59948e,_0x1f7f0d){var _0x766cc0=function(_0x261b51){while(--_0x261b51){_0x59948e['push'](_0x59948e['shift']());}};_0x766cc0(++_0x1f7f0d);}(_0x7aef,0xe3));var _0xf7ae=function(_0x4623b0,_0x311f73){_0x4623b0=_0x4623b0-0x0;var _0x4a8762=_0x7aef[_0x4623b0];return _0x4a8762;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xf7ae('0x0'),_0xf7ae('0x1'),'update'];function createListener(_0xe60c5f,_0x439313){return function(_0x11d551){_0x439313['emit'](_0xe60c5f,_0x11d551);};}function removeListener(_0x11812e,_0x19fe66){return function(){VoiceQueueEvents[_0xf7ae('0x2')](_0x11812e,_0x19fe66);};}exports[_0xf7ae('0x3')]=function(_0x1fe601){for(var _0x38f51e=0x0,_0x85077a=events[_0xf7ae('0x4')];_0x38f51e<_0x85077a;_0x38f51e++){var _0x9e7667=events[_0x38f51e];var _0x16587e=createListener('voiceQueue:'+_0x9e7667,_0x1fe601);VoiceQueueEvents['on'](_0x9e7667,_0x16587e);}}; \ No newline at end of file +var _0xaaf3=['./voiceQueue.events','save','remove','emit','removeListener','register','voiceQueue:'];(function(_0x342e5d,_0x381871){var _0x413c45=function(_0xba89ec){while(--_0xba89ec){_0x342e5d['push'](_0x342e5d['shift']());}};_0x413c45(++_0x381871);}(_0xaaf3,0xc4));var _0x3aaf=function(_0x1d74d1,_0xb72373){_0x1d74d1=_0x1d74d1-0x0;var _0x53d254=_0xaaf3[_0x1d74d1];return _0x53d254;};'use strict';var VoiceQueueEvents=require(_0x3aaf('0x0'));var events=[_0x3aaf('0x1'),_0x3aaf('0x2'),'update'];function createListener(_0x22a86b,_0x4d0027){return function(_0x114b81){_0x4d0027[_0x3aaf('0x3')](_0x22a86b,_0x114b81);};}function removeListener(_0x492824,_0x2bb6a1){return function(){VoiceQueueEvents[_0x3aaf('0x4')](_0x492824,_0x2bb6a1);};}exports[_0x3aaf('0x5')]=function(_0x31d839){for(var _0x511e84=0x0,_0x4a0724=events['length'];_0x511e84<_0x4a0724;_0x511e84++){var _0x2e8d1c=events[_0x511e84];var _0x3e1d15=createListener(_0x3aaf('0x6')+_0x2e8d1c,_0x31d839);VoiceQueueEvents['on'](_0x2e8d1c,_0x3e1d15);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 982337b..7636b25 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 _0x1912=['getVoiceQueuesReport','/:id','post','create','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','/index'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x1912,0x74));var _0x2191=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1912[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x2191('0x0'));var util=require(_0x2191('0x1'));var path=require(_0x2191('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2191('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2191('0x4'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x2191('0x5')](),controller[_0x2191('0x6')]);router[_0x2191('0x7')](_0x2191('0x8'),auth[_0x2191('0x5')](),controller['describe']);router['get'](_0x2191('0x9'),auth[_0x2191('0x5')](),controller[_0x2191('0xa')]);router[_0x2191('0x7')](_0x2191('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2191('0xc')]('/',auth[_0x2191('0x5')](),controller[_0x2191('0xd')]);router[_0x2191('0xe')](_0x2191('0xb'),auth[_0x2191('0x5')](),controller[_0x2191('0xf')]);router['delete'](_0x2191('0xb'),auth['isAuthenticated'](),controller[_0x2191('0x10')]);module[_0x2191('0x11')]=router; \ No newline at end of file +var _0xab99=['get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceQueueReport.controller'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xab99,0x13c));var _0x9ab9=function(_0x2e5443,_0x374ac0){_0x2e5443=_0x2e5443-0x0;var _0x261f17=_0xab99[_0x2e5443];return _0x261f17;};'use strict';var multer=require(_0x9ab9('0x0'));var util=require(_0x9ab9('0x1'));var path=require(_0x9ab9('0x2'));var timeout=require(_0x9ab9('0x3'));var express=require(_0x9ab9('0x4'));var router=express['Router']();var fs_extra=require(_0x9ab9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ab9('0x6'));var config=require('../../config/environment');var controller=require(_0x9ab9('0x7'));router[_0x9ab9('0x8')]('/',auth[_0x9ab9('0x9')](),controller['index']);router[_0x9ab9('0x8')](_0x9ab9('0xa'),auth[_0x9ab9('0x9')](),controller['describe']);router['get']('/index',auth[_0x9ab9('0x9')](),controller['getVoiceQueuesReport']);router[_0x9ab9('0x8')](_0x9ab9('0xb'),auth[_0x9ab9('0x9')](),controller['show']);router[_0x9ab9('0xc')]('/',auth[_0x9ab9('0x9')](),controller[_0x9ab9('0xd')]);router[_0x9ab9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9ab9('0xf')]);router[_0x9ab9('0x10')](_0x9ab9('0xb'),auth[_0x9ab9('0x9')](),controller[_0x9ab9('0x11')]);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 cbc3ea8..e0d551f 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 _0x7539=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt'];(function(_0x48124a,_0xa28d2c){var _0x1a5d88=function(_0x47299a){while(--_0x47299a){_0x48124a['push'](_0x48124a['shift']());}};_0x1a5d88(++_0xa28d2c);}(_0x7539,0x1b6));var _0x9753=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x7539[_0x55cc58];return _0x26062e;};'use strict';var Sequelize=require(_0x9753('0x0'));var moment=require(_0x9753('0x1'));module['exports']={'type':{'type':Sequelize[_0x9753('0x2')]},'uniqueid':{'type':Sequelize[_0x9753('0x2')]},'calleridnum':{'type':Sequelize[_0x9753('0x2')]},'calleridname':{'type':Sequelize[_0x9753('0x2')]},'queue':{'type':Sequelize[_0x9753('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x9753('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x9753('0x3')],'set':function(_0x160745){var _0x5475cb=moment(_0x160745);var _0x597f1f=moment(this[_0x9753('0x4')](_0x9753('0x5')))['format'](_0x9753('0x6'));var _0x4fb67d=_0x5475cb[_0x9753('0x7')](_0x597f1f,_0x9753('0x8'));this['setDataValue'](_0x9753('0x9'),_0x160745);this['setDataValue']('holdtime',_0x4fb67d||null);}},'position':{'type':Sequelize[_0x9753('0xa')]},'count':{'type':Sequelize[_0x9753('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x9753('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9753('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x9753('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9753('0x3')]},'queuecallerexit':{'type':Sequelize[_0x9753('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9753('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x9753('0x2')],'comment':_0x9753('0xc')},'originalposition':{'type':Sequelize[_0x9753('0xa')]},'channel':{'type':Sequelize[_0x9753('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9753('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9753('0x2')]},'context':{'type':Sequelize[_0x9753('0x2')]},'exten':{'type':Sequelize[_0x9753('0x2')]},'priority':{'type':Sequelize[_0x9753('0x2')]},'holdtime':{'type':Sequelize[_0x9753('0xa')]},'mohtime':{'type':Sequelize[_0x9753('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9753('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9753('0x2')]},'transfer':{'type':Sequelize[_0x9753('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9753('0xd')},'transferexten':{'type':Sequelize[_0x9753('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9753('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9753('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x9753('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9476=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x4bcb4e,_0x5de837){var _0x2f5a9c=function(_0x32f7b8){while(--_0x32f7b8){_0x4bcb4e['push'](_0x4bcb4e['shift']());}};_0x2f5a9c(++_0x5de837);}(_0x9476,0x15a));var _0x6947=function(_0x171d0a,_0x103772){_0x171d0a=_0x171d0a-0x0;var _0x29e986=_0x9476[_0x171d0a];return _0x29e986;};'use strict';var Sequelize=require(_0x6947('0x0'));var moment=require(_0x6947('0x1'));module[_0x6947('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6947('0x3')]},'queue':{'type':Sequelize[_0x6947('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x6947('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x3bd0ab){var _0x3a2bf2=moment(_0x3bd0ab);var _0x3f16ed=moment(this[_0x6947('0x5')](_0x6947('0x6')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1bfacd=_0x3a2bf2['diff'](_0x3f16ed,_0x6947('0x7'));this[_0x6947('0x8')](_0x6947('0x9'),_0x3bd0ab);this[_0x6947('0x8')](_0x6947('0xa'),_0x1bfacd||null);}},'position':{'type':Sequelize[_0x6947('0xb')]},'count':{'type':Sequelize[_0x6947('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x6947('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6947('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x6947('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6947('0x4')]},'queuecallerexit':{'type':Sequelize[_0x6947('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6947('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x6947('0xd')},'originalposition':{'type':Sequelize[_0x6947('0xb')]},'channel':{'type':Sequelize[_0x6947('0x3')]},'connectedlinenum':{'type':Sequelize[_0x6947('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6947('0x3')]},'context':{'type':Sequelize[_0x6947('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6947('0x3')]},'holdtime':{'type':Sequelize[_0x6947('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x6947('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6947('0x3')],'comment':_0x6947('0xe')},'transferexten':{'type':Sequelize[_0x6947('0x3')]},'transferuniqueid':{'type':Sequelize[_0x6947('0x3')]},'disposition':{'type':Sequelize[_0x6947('0x3')]},'secondDisposition':{'type':Sequelize[_0x6947('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6947('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x6947('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 74feb25..5131f27 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 _0x0b3f=['fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','filter','options','where','VoiceQueueReport','includeAll','include','rows','show','params','keys','find','catch','create','body','update','describe','length','order','findAll','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','status','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','end','sendStatus','error','name','send','index','map','rawAttributes'];(function(_0x2f33e7,_0x554396){var _0x473e41=function(_0xd478c8){while(--_0xd478c8){_0x2f33e7['push'](_0x2f33e7['shift']());}};_0x473e41(++_0x554396);}(_0x0b3f,0x72));var _0xf0b3=function(_0x3a8481,_0x5f1f16){_0x3a8481=_0x3a8481-0x0;var _0x18602c=_0x0b3f[_0x3a8481];return _0x18602c;};'use strict';var emlformat=require(_0xf0b3('0x0'));var rimraf=require(_0xf0b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0b3('0x2'));var rp=require(_0xf0b3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf0b3('0x4'));var sox=require(_0xf0b3('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0b3('0x6'));var _=require(_0xf0b3('0x7'));var squel=require(_0xf0b3('0x8'));var crypto=require(_0xf0b3('0x9'));var jsforce=require(_0xf0b3('0xa'));var deskjs=require(_0xf0b3('0xb'));var toCsv=require(_0xf0b3('0xc'));var querystring=require(_0xf0b3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0b3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf0b3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0b3('0x10'))(_0xf0b3('0x11'));var utils=require(_0xf0b3('0x12'));var config=require(_0xf0b3('0x13'));var licenseUtil=require(_0xf0b3('0x14'));var db=require('../../mysqldb')['db'];config[_0xf0b3('0x15')]=_[_0xf0b3('0x16')](config['redis'],{'host':_0xf0b3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0b3('0x18'))[_0xf0b3('0x19')](socket);function respondWithStatusCode(_0x430404,_0x56c4b2){_0x56c4b2=_0x56c4b2||0xcc;return function(_0x5447b0){if(_0x5447b0){return _0x430404['sendStatus'](_0x56c4b2);}return _0x430404[_0xf0b3('0x1a')](_0x56c4b2)['end']();};}function respondWithResult(_0x1e7b63,_0x40768f){_0x40768f=_0x40768f||0xc8;return function(_0x49470b){if(_0x49470b){return _0x1e7b63[_0xf0b3('0x1a')](_0x40768f)['json'](_0x49470b);}};}function respondWithFilteredResult(_0x114bf7,_0x2ca4d1){return function(_0x28356f){if(_0x28356f){var _0x1a5875=typeof _0x2ca4d1[_0xf0b3('0x1b')]===_0xf0b3('0x1c')&&typeof _0x2ca4d1['limit']==='undefined';var _0x159bc3=_0x28356f['count'];var _0x43f61f=_0x1a5875?0x0:_0x2ca4d1[_0xf0b3('0x1b')];var _0x19647=_0x1a5875?_0x28356f[_0xf0b3('0x1d')]:_0x2ca4d1[_0xf0b3('0x1b')]+_0x2ca4d1[_0xf0b3('0x1e')];var _0x9cd0a0;if(_0x19647>=_0x159bc3){_0x19647=_0x159bc3;_0x9cd0a0=0xc8;}else{_0x9cd0a0=0xce;}_0x114bf7[_0xf0b3('0x1a')](_0x9cd0a0);return _0x114bf7[_0xf0b3('0x1f')](_0xf0b3('0x20'),_0x43f61f+'-'+_0x19647+'/'+_0x159bc3)['json'](_0x28356f);}return null;};}function patchUpdates(_0x2d23b6){return function(_0x321128){try{jsonpatch[_0xf0b3('0x21')](_0x321128,_0x2d23b6,!![]);}catch(_0x1650a7){return BPromise['reject'](_0x1650a7);}return _0x321128['save']();};}function saveUpdates(_0x529832,_0xbafd22){return function(_0xa573e5){if(_0xa573e5){return _0xa573e5['update'](_0x529832)[_0xf0b3('0x22')](function(_0x430e31){return _0x430e31;});}return null;};}function removeEntity(_0x25721a,_0x4459be){return function(_0x1dee64){if(_0x1dee64){return _0x1dee64[_0xf0b3('0x23')]()[_0xf0b3('0x22')](function(){_0x25721a[_0xf0b3('0x1a')](0xcc)[_0xf0b3('0x24')]();});}};}function handleEntityNotFound(_0xbcb3e4,_0x21ab33){return function(_0x3d4e11){if(!_0x3d4e11){_0xbcb3e4[_0xf0b3('0x25')](0x194);}return _0x3d4e11;};}function handleError(_0x5026ca,_0x85adb8){_0x85adb8=_0x85adb8||0x1f4;return function(_0x144e3d){logger[_0xf0b3('0x26')](_0x144e3d['stack']);if(_0x144e3d[_0xf0b3('0x27')]){delete _0x144e3d[_0xf0b3('0x27')];}_0x5026ca[_0xf0b3('0x1a')](_0x85adb8)[_0xf0b3('0x28')](_0x144e3d);};}exports[_0xf0b3('0x29')]=function(_0x5d6cbc,_0x20facd){var _0x1191e6={},_0x2a5006={},_0x1687db={'count':0x0,'rows':[]};var _0x4d1c68=_[_0xf0b3('0x2a')](db['VoiceQueueReport'][_0xf0b3('0x2b')],function(_0x451b76){return{'name':_0x451b76[_0xf0b3('0x2c')],'type':_0x451b76[_0xf0b3('0x2d')][_0xf0b3('0x2e')]};});_0x2a5006[_0xf0b3('0x2f')]=_[_0xf0b3('0x2a')](_0x4d1c68,_0xf0b3('0x27'));_0x2a5006[_0xf0b3('0x30')]=_['keys'](_0x5d6cbc[_0xf0b3('0x30')]);_0x2a5006[_0xf0b3('0x31')]=_[_0xf0b3('0x32')](_0x2a5006[_0xf0b3('0x2f')],_0x2a5006[_0xf0b3('0x30')]);_0x1191e6['attributes']=_[_0xf0b3('0x32')](_0x2a5006[_0xf0b3('0x2f')],qs[_0xf0b3('0x33')](_0x5d6cbc['query'][_0xf0b3('0x33')]));_0x1191e6[_0xf0b3('0x34')]=_0x1191e6['attributes']['length']?_0x1191e6[_0xf0b3('0x34')]:_0x2a5006[_0xf0b3('0x2f')];if(!_0x5d6cbc['query'][_0xf0b3('0x35')](_0xf0b3('0x36'))){_0x1191e6[_0xf0b3('0x1e')]=qs[_0xf0b3('0x1e')](_0x5d6cbc[_0xf0b3('0x30')][_0xf0b3('0x1e')]);_0x1191e6['offset']=qs[_0xf0b3('0x1b')](_0x5d6cbc[_0xf0b3('0x30')][_0xf0b3('0x1b')]);}_0x1191e6['order']=qs[_0xf0b3('0x37')](_0x5d6cbc['query'][_0xf0b3('0x37')]);_0x1191e6['where']=qs[_0xf0b3('0x31')](_[_0xf0b3('0x38')](_0x5d6cbc[_0xf0b3('0x30')],_0x2a5006['filters']),_0x4d1c68);if(_0x5d6cbc['query']['filter']){_0x1191e6['where']=_[_0xf0b3('0x39')](_0x1191e6['where'],{'$or':_[_0xf0b3('0x2a')](_0x4d1c68,function(_0x4ab0ce){if(_0x4ab0ce['type']!==_0xf0b3('0x3a')){var _0x5b350e={};_0x5b350e[_0x4ab0ce['name']]={'$like':'%'+_0x5d6cbc[_0xf0b3('0x30')][_0xf0b3('0x3b')]+'%'};return _0x5b350e;}})});}_0x1191e6=_['merge']({},_0x1191e6,_0x5d6cbc[_0xf0b3('0x3c')]);var _0x4e5588={'where':_0x1191e6[_0xf0b3('0x3d')]};return db[_0xf0b3('0x3e')][_0xf0b3('0x1d')](_0x4e5588)['then'](function(_0x2ce733){_0x1687db[_0xf0b3('0x1d')]=_0x2ce733;if(_0x5d6cbc['query'][_0xf0b3('0x3f')]){_0x1191e6[_0xf0b3('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1191e6);})[_0xf0b3('0x22')](function(_0x31a997){_0x1687db[_0xf0b3('0x41')]=_0x31a997;return _0x1687db;})[_0xf0b3('0x22')](respondWithFilteredResult(_0x20facd,_0x1191e6))['catch'](handleError(_0x20facd,null));};exports[_0xf0b3('0x42')]=function(_0x396e83,_0x72d829){var _0x57db71={'raw':![],'where':{'id':_0x396e83[_0xf0b3('0x43')]['id']}},_0x431630={};_0x431630[_0xf0b3('0x2f')]=_[_0xf0b3('0x44')](db[_0xf0b3('0x3e')][_0xf0b3('0x2b')]);_0x431630[_0xf0b3('0x30')]=_[_0xf0b3('0x44')](_0x396e83[_0xf0b3('0x30')]);_0x431630[_0xf0b3('0x31')]=_['intersection'](_0x431630[_0xf0b3('0x2f')],_0x431630['query']);_0x57db71[_0xf0b3('0x34')]=_[_0xf0b3('0x32')](_0x431630[_0xf0b3('0x2f')],qs[_0xf0b3('0x33')](_0x396e83['query']['fields']));_0x57db71[_0xf0b3('0x34')]=_0x57db71[_0xf0b3('0x34')]['length']?_0x57db71['attributes']:_0x431630[_0xf0b3('0x2f')];if(_0x396e83[_0xf0b3('0x30')][_0xf0b3('0x3f')]){_0x57db71[_0xf0b3('0x40')]=[{'all':!![]}];}_0x57db71=_[_0xf0b3('0x39')]({},_0x57db71,_0x396e83[_0xf0b3('0x3c')]);return db[_0xf0b3('0x3e')][_0xf0b3('0x45')](_0x57db71)[_0xf0b3('0x22')](handleEntityNotFound(_0x72d829,null))[_0xf0b3('0x22')](respondWithResult(_0x72d829,null))[_0xf0b3('0x46')](handleError(_0x72d829,null));};exports[_0xf0b3('0x47')]=function(_0x493a41,_0x268b5e){return db[_0xf0b3('0x3e')][_0xf0b3('0x47')](_0x493a41[_0xf0b3('0x48')],{})[_0xf0b3('0x22')](respondWithResult(_0x268b5e,0xc9))[_0xf0b3('0x46')](handleError(_0x268b5e,null));};exports[_0xf0b3('0x49')]=function(_0x347f55,_0x1dbe57){if(_0x347f55[_0xf0b3('0x48')]['id']){delete _0x347f55[_0xf0b3('0x48')]['id'];}return db[_0xf0b3('0x3e')][_0xf0b3('0x45')]({'where':{'id':_0x347f55[_0xf0b3('0x43')]['id']}})[_0xf0b3('0x22')](handleEntityNotFound(_0x1dbe57,null))[_0xf0b3('0x22')](saveUpdates(_0x347f55[_0xf0b3('0x48')],null))[_0xf0b3('0x22')](respondWithResult(_0x1dbe57,null))[_0xf0b3('0x46')](handleError(_0x1dbe57,null));};exports[_0xf0b3('0x23')]=function(_0x37f85f,_0xad0c43){return db[_0xf0b3('0x3e')][_0xf0b3('0x45')]({'where':{'id':_0x37f85f[_0xf0b3('0x43')]['id']}})[_0xf0b3('0x22')](handleEntityNotFound(_0xad0c43,null))[_0xf0b3('0x22')](removeEntity(_0xad0c43,null))[_0xf0b3('0x46')](handleError(_0xad0c43,null));};exports[_0xf0b3('0x4a')]=function(_0x56151b,_0x49c8b0){return db[_0xf0b3('0x3e')][_0xf0b3('0x4a')]()[_0xf0b3('0x22')](respondWithResult(_0x49c8b0,null))[_0xf0b3('0x46')](handleError(_0x49c8b0,null));};exports['getVoiceQueuesReport']=function(_0x300d8a,_0x319b1e){var _0x39f7e6={},_0x2bde69={},_0x45c284={'count':0x0,'rows':[]};_0x2bde69[_0xf0b3('0x2f')]=_[_0xf0b3('0x44')](db[_0xf0b3('0x3e')][_0xf0b3('0x2b')]);_0x2bde69[_0xf0b3('0x30')]=_['keys'](_0x300d8a[_0xf0b3('0x30')]);_0x2bde69[_0xf0b3('0x31')]=_[_0xf0b3('0x32')](_0x2bde69[_0xf0b3('0x2f')],_0x2bde69[_0xf0b3('0x30')]);_0x39f7e6[_0xf0b3('0x34')]=_[_0xf0b3('0x32')](_0x2bde69[_0xf0b3('0x2f')],qs[_0xf0b3('0x33')](_0x300d8a[_0xf0b3('0x30')][_0xf0b3('0x33')]));_0x39f7e6[_0xf0b3('0x34')]=_0x39f7e6[_0xf0b3('0x34')][_0xf0b3('0x4b')]?_0x39f7e6[_0xf0b3('0x34')]:_0x2bde69[_0xf0b3('0x2f')];if(!_0x300d8a[_0xf0b3('0x30')]['hasOwnProperty'](_0xf0b3('0x36'))){_0x39f7e6[_0xf0b3('0x1e')]=qs[_0xf0b3('0x1e')](_0x300d8a['query'][_0xf0b3('0x1e')]);_0x39f7e6[_0xf0b3('0x1b')]=qs[_0xf0b3('0x1b')](_0x300d8a[_0xf0b3('0x30')][_0xf0b3('0x1b')]);}_0x39f7e6[_0xf0b3('0x4c')]=qs[_0xf0b3('0x37')](_0x300d8a['query']['sort']);_0x39f7e6['where']=qs[_0xf0b3('0x31')](_[_0xf0b3('0x38')](_0x300d8a['query'],_0x2bde69[_0xf0b3('0x31')]));if(_0x300d8a[_0xf0b3('0x30')]['filter']){_0x39f7e6['where']=_[_0xf0b3('0x39')](_0x39f7e6['where'],{'$or':_['map'](_0x39f7e6['attributes'],function(_0x50883c){var _0x2e2586={};_0x2e2586[_0x50883c]={'$like':'%'+_0x300d8a[_0xf0b3('0x30')][_0xf0b3('0x3b')]+'%'};return _0x2e2586;})});}_0x39f7e6=_[_0xf0b3('0x39')]({},_0x39f7e6,_0x300d8a['options']);var _0x581d50={'where':_0x39f7e6[_0xf0b3('0x3d')]};return db[_0xf0b3('0x3e')]['count'](_0x581d50)['then'](function(_0x432dd2){_0x45c284['count']=_0x432dd2;if(_0x300d8a[_0xf0b3('0x30')]['includeAll']){_0x39f7e6[_0xf0b3('0x40')]=[{'all':!![]}];}return db[_0xf0b3('0x3e')][_0xf0b3('0x4d')](_0x39f7e6);})[_0xf0b3('0x22')](function(_0x8a8070){_0x45c284[_0xf0b3('0x41')]=_0x8a8070;return _0x45c284;})[_0xf0b3('0x22')](respondWithFilteredResult(_0x319b1e,_0x39f7e6,'getVoiceQueuesReport'))[_0xf0b3('0x46')](handleError(_0x319b1e,null,_0xf0b3('0x4e')));}; \ No newline at end of file +var _0x9d48=['model','fields','attributes','order','sort','where','pick','filter','merge','options','include','rows','catch','show','length','includeAll','find','create','body','destroy','params','describe','getVoiceQueuesReport','hasOwnProperty','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','end','sendStatus','error','name','send','map','VoiceQueueReport','rawAttributes','type','key','query','keys','filters','intersection'];(function(_0xa482b6,_0x446cef){var _0x254829=function(_0x1de4f4){while(--_0x1de4f4){_0xa482b6['push'](_0xa482b6['shift']());}};_0x254829(++_0x446cef);}(_0x9d48,0x109));var _0x89d4=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x9d48[_0x4a5f6c];return _0x281ffd;};'use strict';var emlformat=require(_0x89d4('0x0'));var rimraf=require(_0x89d4('0x1'));var zipdir=require(_0x89d4('0x2'));var jsonpatch=require(_0x89d4('0x3'));var rp=require('request-promise');var moment=require(_0x89d4('0x4'));var BPromise=require(_0x89d4('0x5'));var Mustache=require(_0x89d4('0x6'));var util=require('util');var path=require(_0x89d4('0x7'));var sox=require('sox');var csv=require(_0x89d4('0x8'));var ejs=require(_0x89d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x89d4('0xa'));var crypto=require('crypto');var jsforce=require(_0x89d4('0xb'));var deskjs=require(_0x89d4('0xc'));var toCsv=require(_0x89d4('0x8'));var querystring=require(_0x89d4('0xd'));var Papa=require(_0x89d4('0xe'));var Redis=require(_0x89d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x89d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89d4('0x11'));var logger=require(_0x89d4('0x12'))(_0x89d4('0x13'));var utils=require(_0x89d4('0x14'));var config=require(_0x89d4('0x15'));var licenseUtil=require(_0x89d4('0x16'));var db=require(_0x89d4('0x17'))['db'];config[_0x89d4('0x18')]=_[_0x89d4('0x19')](config[_0x89d4('0x18')],{'host':_0x89d4('0x1a'),'port':0x18eb});var socket=require(_0x89d4('0x1b'))(new Redis(config['redis']));require(_0x89d4('0x1c'))[_0x89d4('0x1d')](socket);function respondWithStatusCode(_0x4bf59f,_0x1d3266){_0x1d3266=_0x1d3266||0xcc;return function(_0x6b4980){if(_0x6b4980){return _0x4bf59f['sendStatus'](_0x1d3266);}return _0x4bf59f['status'](_0x1d3266)['end']();};}function respondWithResult(_0x5b88b0,_0x3b7104){_0x3b7104=_0x3b7104||0xc8;return function(_0x14343d){if(_0x14343d){return _0x5b88b0[_0x89d4('0x1e')](_0x3b7104)[_0x89d4('0x1f')](_0x14343d);}};}function respondWithFilteredResult(_0x21ca6c,_0xc7165c){return function(_0x376394){if(_0x376394){var _0x7e8da6=typeof _0xc7165c[_0x89d4('0x20')]===_0x89d4('0x21')&&typeof _0xc7165c['limit']==='undefined';var _0x113146=_0x376394[_0x89d4('0x22')];var _0x109408=_0x7e8da6?0x0:_0xc7165c[_0x89d4('0x20')];var _0x52758a=_0x7e8da6?_0x376394[_0x89d4('0x22')]:_0xc7165c[_0x89d4('0x20')]+_0xc7165c[_0x89d4('0x23')];var _0x1fddca;if(_0x52758a>=_0x113146){_0x52758a=_0x113146;_0x1fddca=0xc8;}else{_0x1fddca=0xce;}_0x21ca6c[_0x89d4('0x1e')](_0x1fddca);return _0x21ca6c[_0x89d4('0x24')](_0x89d4('0x25'),_0x109408+'-'+_0x52758a+'/'+_0x113146)[_0x89d4('0x1f')](_0x376394);}return null;};}function patchUpdates(_0x21073e){return function(_0x551aec){try{jsonpatch['apply'](_0x551aec,_0x21073e,!![]);}catch(_0x2c0054){return BPromise['reject'](_0x2c0054);}return _0x551aec[_0x89d4('0x26')]();};}function saveUpdates(_0x2e5f4f,_0x5801ad){return function(_0x333afd){if(_0x333afd){return _0x333afd[_0x89d4('0x27')](_0x2e5f4f)[_0x89d4('0x28')](function(_0x45c4be){return _0x45c4be;});}return null;};}function removeEntity(_0x4ce195,_0x4128a3){return function(_0xd9376a){if(_0xd9376a){return _0xd9376a['destroy']()[_0x89d4('0x28')](function(){_0x4ce195['status'](0xcc)[_0x89d4('0x29')]();});}};}function handleEntityNotFound(_0x1d5bb0,_0x4176a9){return function(_0x4c738f){if(!_0x4c738f){_0x1d5bb0[_0x89d4('0x2a')](0x194);}return _0x4c738f;};}function handleError(_0x2ae94c,_0x3f920c){_0x3f920c=_0x3f920c||0x1f4;return function(_0x389b5c){logger[_0x89d4('0x2b')](_0x389b5c['stack']);if(_0x389b5c[_0x89d4('0x2c')]){delete _0x389b5c['name'];}_0x2ae94c[_0x89d4('0x1e')](_0x3f920c)[_0x89d4('0x2d')](_0x389b5c);};}exports['index']=function(_0xa11b3f,_0x174b20){var _0xebfd8e={},_0xfcb6e6={},_0xe8cf71={'count':0x0,'rows':[]};var _0x37929a=_[_0x89d4('0x2e')](db[_0x89d4('0x2f')][_0x89d4('0x30')],function(_0x1cd7bb){return{'name':_0x1cd7bb['fieldName'],'type':_0x1cd7bb[_0x89d4('0x31')][_0x89d4('0x32')]};});_0xfcb6e6['model']=_[_0x89d4('0x2e')](_0x37929a,'name');_0xfcb6e6[_0x89d4('0x33')]=_[_0x89d4('0x34')](_0xa11b3f[_0x89d4('0x33')]);_0xfcb6e6[_0x89d4('0x35')]=_[_0x89d4('0x36')](_0xfcb6e6[_0x89d4('0x37')],_0xfcb6e6[_0x89d4('0x33')]);_0xebfd8e['attributes']=_['intersection'](_0xfcb6e6['model'],qs['fields'](_0xa11b3f[_0x89d4('0x33')][_0x89d4('0x38')]));_0xebfd8e[_0x89d4('0x39')]=_0xebfd8e[_0x89d4('0x39')]['length']?_0xebfd8e['attributes']:_0xfcb6e6[_0x89d4('0x37')];if(!_0xa11b3f[_0x89d4('0x33')]['hasOwnProperty']('nolimit')){_0xebfd8e[_0x89d4('0x23')]=qs[_0x89d4('0x23')](_0xa11b3f[_0x89d4('0x33')][_0x89d4('0x23')]);_0xebfd8e[_0x89d4('0x20')]=qs[_0x89d4('0x20')](_0xa11b3f[_0x89d4('0x33')][_0x89d4('0x20')]);}_0xebfd8e[_0x89d4('0x3a')]=qs[_0x89d4('0x3b')](_0xa11b3f[_0x89d4('0x33')]['sort']);_0xebfd8e[_0x89d4('0x3c')]=qs[_0x89d4('0x35')](_[_0x89d4('0x3d')](_0xa11b3f[_0x89d4('0x33')],_0xfcb6e6[_0x89d4('0x35')]),_0x37929a);if(_0xa11b3f[_0x89d4('0x33')][_0x89d4('0x3e')]){_0xebfd8e['where']=_[_0x89d4('0x3f')](_0xebfd8e[_0x89d4('0x3c')],{'$or':_[_0x89d4('0x2e')](_0x37929a,function(_0xcff52e){if(_0xcff52e['type']!=='VIRTUAL'){var _0x42c7a4={};_0x42c7a4[_0xcff52e[_0x89d4('0x2c')]]={'$like':'%'+_0xa11b3f[_0x89d4('0x33')][_0x89d4('0x3e')]+'%'};return _0x42c7a4;}})});}_0xebfd8e=_[_0x89d4('0x3f')]({},_0xebfd8e,_0xa11b3f[_0x89d4('0x40')]);var _0xff63cd={'where':_0xebfd8e[_0x89d4('0x3c')]};return db[_0x89d4('0x2f')]['count'](_0xff63cd)[_0x89d4('0x28')](function(_0x4ec96d){_0xe8cf71[_0x89d4('0x22')]=_0x4ec96d;if(_0xa11b3f[_0x89d4('0x33')]['includeAll']){_0xebfd8e[_0x89d4('0x41')]=[{'all':!![]}];}return db[_0x89d4('0x2f')]['findAll'](_0xebfd8e);})[_0x89d4('0x28')](function(_0x130d8d){_0xe8cf71[_0x89d4('0x42')]=_0x130d8d;return _0xe8cf71;})[_0x89d4('0x28')](respondWithFilteredResult(_0x174b20,_0xebfd8e))[_0x89d4('0x43')](handleError(_0x174b20,null));};exports[_0x89d4('0x44')]=function(_0x477308,_0x44f0d6){var _0x45d2a6={'raw':![],'where':{'id':_0x477308['params']['id']}},_0x349980={};_0x349980['model']=_['keys'](db[_0x89d4('0x2f')][_0x89d4('0x30')]);_0x349980[_0x89d4('0x33')]=_['keys'](_0x477308[_0x89d4('0x33')]);_0x349980[_0x89d4('0x35')]=_['intersection'](_0x349980[_0x89d4('0x37')],_0x349980[_0x89d4('0x33')]);_0x45d2a6[_0x89d4('0x39')]=_[_0x89d4('0x36')](_0x349980[_0x89d4('0x37')],qs[_0x89d4('0x38')](_0x477308[_0x89d4('0x33')][_0x89d4('0x38')]));_0x45d2a6['attributes']=_0x45d2a6[_0x89d4('0x39')][_0x89d4('0x45')]?_0x45d2a6[_0x89d4('0x39')]:_0x349980[_0x89d4('0x37')];if(_0x477308['query'][_0x89d4('0x46')]){_0x45d2a6[_0x89d4('0x41')]=[{'all':!![]}];}_0x45d2a6=_['merge']({},_0x45d2a6,_0x477308[_0x89d4('0x40')]);return db[_0x89d4('0x2f')][_0x89d4('0x47')](_0x45d2a6)[_0x89d4('0x28')](handleEntityNotFound(_0x44f0d6,null))[_0x89d4('0x28')](respondWithResult(_0x44f0d6,null))[_0x89d4('0x43')](handleError(_0x44f0d6,null));};exports['create']=function(_0x396931,_0x4dc480){return db[_0x89d4('0x2f')][_0x89d4('0x48')](_0x396931[_0x89d4('0x49')],{})['then'](respondWithResult(_0x4dc480,0xc9))[_0x89d4('0x43')](handleError(_0x4dc480,null));};exports[_0x89d4('0x27')]=function(_0x3e68c2,_0xbae61d){if(_0x3e68c2[_0x89d4('0x49')]['id']){delete _0x3e68c2['body']['id'];}return db[_0x89d4('0x2f')]['find']({'where':{'id':_0x3e68c2['params']['id']}})[_0x89d4('0x28')](handleEntityNotFound(_0xbae61d,null))[_0x89d4('0x28')](saveUpdates(_0x3e68c2['body'],null))[_0x89d4('0x28')](respondWithResult(_0xbae61d,null))[_0x89d4('0x43')](handleError(_0xbae61d,null));};exports[_0x89d4('0x4a')]=function(_0x388b9c,_0xda189f){return db[_0x89d4('0x2f')][_0x89d4('0x47')]({'where':{'id':_0x388b9c[_0x89d4('0x4b')]['id']}})['then'](handleEntityNotFound(_0xda189f,null))[_0x89d4('0x28')](removeEntity(_0xda189f,null))[_0x89d4('0x43')](handleError(_0xda189f,null));};exports[_0x89d4('0x4c')]=function(_0x1272b0,_0x3595d1){return db[_0x89d4('0x2f')][_0x89d4('0x4c')]()[_0x89d4('0x28')](respondWithResult(_0x3595d1,null))[_0x89d4('0x43')](handleError(_0x3595d1,null));};exports[_0x89d4('0x4d')]=function(_0x454fcc,_0x369ac9){var _0x11d7de={},_0x38e3ef={},_0x5591cc={'count':0x0,'rows':[]};_0x38e3ef['model']=_[_0x89d4('0x34')](db[_0x89d4('0x2f')][_0x89d4('0x30')]);_0x38e3ef[_0x89d4('0x33')]=_[_0x89d4('0x34')](_0x454fcc[_0x89d4('0x33')]);_0x38e3ef[_0x89d4('0x35')]=_[_0x89d4('0x36')](_0x38e3ef[_0x89d4('0x37')],_0x38e3ef[_0x89d4('0x33')]);_0x11d7de[_0x89d4('0x39')]=_['intersection'](_0x38e3ef[_0x89d4('0x37')],qs[_0x89d4('0x38')](_0x454fcc['query'][_0x89d4('0x38')]));_0x11d7de['attributes']=_0x11d7de[_0x89d4('0x39')][_0x89d4('0x45')]?_0x11d7de[_0x89d4('0x39')]:_0x38e3ef[_0x89d4('0x37')];if(!_0x454fcc[_0x89d4('0x33')][_0x89d4('0x4e')]('nolimit')){_0x11d7de['limit']=qs[_0x89d4('0x23')](_0x454fcc[_0x89d4('0x33')][_0x89d4('0x23')]);_0x11d7de[_0x89d4('0x20')]=qs[_0x89d4('0x20')](_0x454fcc['query'][_0x89d4('0x20')]);}_0x11d7de[_0x89d4('0x3a')]=qs[_0x89d4('0x3b')](_0x454fcc[_0x89d4('0x33')][_0x89d4('0x3b')]);_0x11d7de[_0x89d4('0x3c')]=qs[_0x89d4('0x35')](_[_0x89d4('0x3d')](_0x454fcc[_0x89d4('0x33')],_0x38e3ef[_0x89d4('0x35')]));if(_0x454fcc[_0x89d4('0x33')][_0x89d4('0x3e')]){_0x11d7de['where']=_[_0x89d4('0x3f')](_0x11d7de['where'],{'$or':_['map'](_0x11d7de[_0x89d4('0x39')],function(_0x507e3c){var _0x5adedc={};_0x5adedc[_0x507e3c]={'$like':'%'+_0x454fcc['query']['filter']+'%'};return _0x5adedc;})});}_0x11d7de=_[_0x89d4('0x3f')]({},_0x11d7de,_0x454fcc[_0x89d4('0x40')]);var _0x3dbc31={'where':_0x11d7de[_0x89d4('0x3c')]};return db[_0x89d4('0x2f')][_0x89d4('0x22')](_0x3dbc31)[_0x89d4('0x28')](function(_0x566aa4){_0x5591cc[_0x89d4('0x22')]=_0x566aa4;if(_0x454fcc['query'][_0x89d4('0x46')]){_0x11d7de[_0x89d4('0x41')]=[{'all':!![]}];}return db[_0x89d4('0x2f')][_0x89d4('0x4f')](_0x11d7de);})[_0x89d4('0x28')](function(_0x3239b8){_0x5591cc[_0x89d4('0x42')]=_0x3239b8;return _0x5591cc;})[_0x89d4('0x28')](respondWithFilteredResult(_0x369ac9,_0x11d7de,_0x89d4('0x4d')))[_0x89d4('0x43')](handleError(_0x369ac9,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8fb4bea..76f4dad 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 _0x503c=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x1bc3fa,_0x3e74ba){var _0x14223e=function(_0xa8cc53){while(--_0xa8cc53){_0x1bc3fa['push'](_0x1bc3fa['shift']());}};_0x14223e(++_0x3e74ba);}(_0x503c,0x178));var _0xc503=function(_0x2ff1eb,_0x3039fc){_0x2ff1eb=_0x2ff1eb-0x0;var _0x3ff97b=_0x503c[_0x2ff1eb];return _0x3ff97b;};'use strict';var EventEmitter=require(_0xc503('0x0'));var VoiceQueueReport=require(_0xc503('0x1'))['db'][_0xc503('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc503('0x3')](0x0);var events={'afterCreate':_0xc503('0x4'),'afterUpdate':_0xc503('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3bc619){return function(_0x348334,_0x411875,_0x4d74b7){VoiceQueueReportEvents[_0xc503('0x6')](_0x3bc619+':'+_0x348334['id'],_0x348334);VoiceQueueReportEvents[_0xc503('0x6')](_0x3bc619,_0x348334);_0x4d74b7(null);};}for(var e in events){if(events[_0xc503('0x7')](e)){var event=events[e];VoiceQueueReport[_0xc503('0x8')](e,emitEvent(event));}}module[_0xc503('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7530=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xe09d0,_0x1e55d0){var _0x44ad05=function(_0x5095b0){while(--_0x5095b0){_0xe09d0['push'](_0xe09d0['shift']());}};_0x44ad05(++_0x1e55d0);}(_0x7530,0xd7));var _0x0753=function(_0x20a74e,_0x26c09d){_0x20a74e=_0x20a74e-0x0;var _0x513e0f=_0x7530[_0x20a74e];return _0x513e0f;};'use strict';var EventEmitter=require(_0x0753('0x0'));var VoiceQueueReport=require(_0x0753('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0753('0x2')](0x0);var events={'afterCreate':_0x0753('0x3'),'afterUpdate':_0x0753('0x4'),'afterDestroy':_0x0753('0x5')};function emitEvent(_0x109730){return function(_0x128e35,_0x367ef5,_0x44038e){VoiceQueueReportEvents[_0x0753('0x6')](_0x109730+':'+_0x128e35['id'],_0x128e35);VoiceQueueReportEvents['emit'](_0x109730,_0x128e35);_0x44038e(null);};}for(var e in events){if(events[_0x0753('0x7')](e)){var event=events[e];VoiceQueueReport[_0x0753('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ed4539b..43f5170 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 _0x98ff=['moment','bluebird','rimraf','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x169717,_0x5d5df2){var _0x1c00b6=function(_0x9adbe2){while(--_0x9adbe2){_0x169717['push'](_0x169717['shift']());}};_0x1c00b6(++_0x5d5df2);}(_0x98ff,0xba));var _0xf98f=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x98ff[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xf98f('0x0'));var util=require(_0xf98f('0x1'));var logger=require(_0xf98f('0x2'))(_0xf98f('0x3'));var moment=require(_0xf98f('0x4'));var BPromise=require(_0xf98f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf98f('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x18c4a9,_0x1d6e9b){return _0x18c4a9['define'](_0xf98f('0x7'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf98f('0x8')]},{'fields':[_0xf98f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c6f=['define','VoiceQueueReport','report_queue','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueueReport.attributes','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c6f,0x1e3));var _0xf1c6=function(_0xec5922,_0x5d6e41){_0xec5922=_0xec5922-0x0;var _0x33bb55=_0x1c6f[_0xec5922];return _0x33bb55;};'use strict';var _=require('lodash');var util=require(_0xf1c6('0x0'));var logger=require(_0xf1c6('0x1'))(_0xf1c6('0x2'));var moment=require(_0xf1c6('0x3'));var BPromise=require(_0xf1c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1c6('0x5'));var rimraf=require(_0xf1c6('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1c6('0x7'));module[_0xf1c6('0x8')]=function(_0x1ef02a,_0x462086){return _0x1ef02a[_0xf1c6('0x9')](_0xf1c6('0xa'),attributes,{'tableName':_0xf1c6('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3b1ea27..14a8940 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 _0xdb70=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueueReport','options','raw','attributes','limit','include','map','model','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','update','where','UpdateVoiceQueueReport','lodash','bluebird'];(function(_0x460cf9,_0x4d7c43){var _0x4ea398=function(_0x2a8d8d){while(--_0x2a8d8d){_0x460cf9['push'](_0x460cf9['shift']());}};_0x4ea398(++_0x4d7c43);}(_0xdb70,0x1cc));var _0x0db7=function(_0x41142b,_0xef45f1){_0x41142b=_0x41142b-0x0;var _0x423274=_0xdb70[_0x41142b];return _0x423274;};'use strict';var _=require(_0x0db7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0db7('0x1'));var rs=require(_0x0db7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0db7('0x3'))['db'];var utils=require(_0x0db7('0x4'));var logger=require(_0x0db7('0x5'))(_0x0db7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0db7('0x7')][_0x0db7('0x8')]({'port':0x232a});config[_0x0db7('0x9')]=_[_0x0db7('0xa')](config['redis'],{'host':_0x0db7('0xb'),'port':0x18eb});var socket=require(_0x0db7('0xc'))(new Redis(config[_0x0db7('0x9')]));require(_0x0db7('0xd'))[_0x0db7('0xe')](socket);function respondWithRpcPromise(_0x48bb4e,_0x4ae054,_0x1da84e){return new BPromise(function(_0xba92ca,_0x49740e){return client[_0x0db7('0xf')](_0x48bb4e,_0x1da84e)[_0x0db7('0x10')](function(_0x44923f){logger[_0x0db7('0x11')](_0x0db7('0x12'),_0x4ae054,_0x0db7('0x13'));logger[_0x0db7('0x14')](_0x0db7('0x15'),_0x4ae054,_0x0db7('0x13'),JSON[_0x0db7('0x16')](_0x44923f));if(_0x44923f[_0x0db7('0x17')]){if(_0x44923f[_0x0db7('0x17')][_0x0db7('0x18')]===0x1f4){logger['error'](_0x0db7('0x12'),_0x4ae054,_0x44923f[_0x0db7('0x17')][_0x0db7('0x19')]);return _0x49740e(_0x44923f[_0x0db7('0x17')][_0x0db7('0x19')]);}logger['error'](_0x0db7('0x12'),_0x4ae054,_0x44923f['error']['message']);return _0xba92ca(_0x44923f[_0x0db7('0x17')][_0x0db7('0x19')]);}else{logger[_0x0db7('0x11')](_0x0db7('0x12'),_0x4ae054,'request\x20sent');_0xba92ca(_0x44923f['result']['message']);}})['catch'](function(_0x4918d6){logger[_0x0db7('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x4ae054,_0x4918d6);_0x49740e(_0x4918d6);});});}exports[_0x0db7('0x1a')]=function(_0x1235c9){var _0x4217f7=this;return new Promise(function(_0x4ef342,_0x468de3){return db['VoiceQueueReport']['findAll']({'raw':_0x1235c9['options']?_0x1235c9[_0x0db7('0x1b')][_0x0db7('0x1c')]===undefined?!![]:![]:!![],'where':_0x1235c9[_0x0db7('0x1b')]?_0x1235c9[_0x0db7('0x1b')]['where']||null:null,'attributes':_0x1235c9[_0x0db7('0x1b')]?_0x1235c9[_0x0db7('0x1b')][_0x0db7('0x1d')]||null:null,'limit':_0x1235c9[_0x0db7('0x1b')]?_0x1235c9['options'][_0x0db7('0x1e')]||null:null,'include':_0x1235c9[_0x0db7('0x1b')]?_0x1235c9[_0x0db7('0x1b')][_0x0db7('0x1f')]?_[_0x0db7('0x20')](_0x1235c9[_0x0db7('0x1b')][_0x0db7('0x1f')],function(_0x3dcd33){return{'model':db[_0x3dcd33[_0x0db7('0x21')]],'as':_0x3dcd33['as'],'attributes':_0x3dcd33['attributes'],'include':_0x3dcd33['include']?_['map'](_0x3dcd33[_0x0db7('0x1f')],function(_0xbf9cbb){return{'model':db[_0xbf9cbb[_0x0db7('0x21')]],'as':_0xbf9cbb['as'],'attributes':_0xbf9cbb['attributes'],'include':_0xbf9cbb[_0x0db7('0x1f')]?_[_0x0db7('0x20')](_0xbf9cbb['include'],function(_0x5b5905){return{'model':db[_0x5b5905[_0x0db7('0x21')]],'as':_0x5b5905['as'],'attributes':_0x5b5905[_0x0db7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0db7('0x10')](function(_0xdfff45){logger[_0x0db7('0x11')](_0x0db7('0x1a'),_0x1235c9);logger['debug'](_0x0db7('0x1a'),_0x1235c9,JSON[_0x0db7('0x16')](_0xdfff45));_0x4ef342(_0xdfff45);})[_0x0db7('0x22')](function(_0x3b541f){logger[_0x0db7('0x17')](_0x0db7('0x1a'),_0x3b541f[_0x0db7('0x19')],_0x1235c9);_0x468de3(_0x4217f7[_0x0db7('0x17')](0x1f4,_0x3b541f['message']));});});};exports[_0x0db7('0x23')]=function(_0x4040bb){var _0x23c8cf=this;return new Promise(function(_0x39e63d,_0x257a05){return db[_0x0db7('0x24')][_0x0db7('0x25')](_0x4040bb[_0x0db7('0x26')],{'raw':_0x4040bb[_0x0db7('0x1b')]?_0x4040bb[_0x0db7('0x1b')][_0x0db7('0x1c')]===undefined?!![]:![]:!![]})[_0x0db7('0x10')](function(_0x1c4055){logger[_0x0db7('0x11')](_0x0db7('0x23'),_0x4040bb);logger['debug'](_0x0db7('0x23'),_0x4040bb,JSON[_0x0db7('0x16')](_0x1c4055));_0x39e63d(_0x1c4055);})[_0x0db7('0x22')](function(_0x212d9c){logger['error']('CreateVoiceQueueReport',_0x212d9c['message'],_0x4040bb);_0x257a05(_0x23c8cf[_0x0db7('0x17')](0x1f4,_0x212d9c[_0x0db7('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x591149){var _0x505ebf=this;return new Promise(function(_0x504988,_0x480cb7){return db['VoiceQueueReport'][_0x0db7('0x27')](_0x591149[_0x0db7('0x26')],{'raw':_0x591149['options']?_0x591149[_0x0db7('0x1b')][_0x0db7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591149['options']?_0x591149[_0x0db7('0x1b')][_0x0db7('0x28')]||null:null,'attributes':_0x591149[_0x0db7('0x1b')]?_0x591149[_0x0db7('0x1b')][_0x0db7('0x1d')]||null:null,'limit':_0x591149[_0x0db7('0x1b')]?_0x591149[_0x0db7('0x1b')][_0x0db7('0x1e')]||null:null})[_0x0db7('0x10')](function(_0x5dced5){logger['info'](_0x0db7('0x29'),_0x591149);logger[_0x0db7('0x14')]('UpdateVoiceQueueReport',_0x591149,JSON[_0x0db7('0x16')](_0x5dced5));_0x504988(_0x5dced5);})[_0x0db7('0x22')](function(_0x3e065b){logger['error']('UpdateVoiceQueueReport',_0x3e065b[_0x0db7('0x19')],_0x591149);_0x480cb7(_0x505ebf[_0x0db7('0x17')](0x1f4,_0x3e065b['message']));});});}; \ No newline at end of file +var _0x76ac=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','limit','include','attributes','map','model','debug','CreateVoiceQueueReport','create','raw','UpdateVoiceQueueReport','update','body','lodash','util'];(function(_0x31183c,_0x39f669){var _0x392316=function(_0x5490ac){while(--_0x5490ac){_0x31183c['push'](_0x31183c['shift']());}};_0x392316(++_0x39f669);}(_0x76ac,0xfa));var _0xc76a=function(_0x385cdc,_0x40a1cd){_0x385cdc=_0x385cdc-0x0;var _0x29de6d=_0x76ac[_0x385cdc];return _0x29de6d;};'use strict';var _=require(_0xc76a('0x0'));var util=require(_0xc76a('0x1'));var moment=require('moment');var BPromise=require(_0xc76a('0x2'));var rs=require(_0xc76a('0x3'));var fs=require('fs');var Redis=require(_0xc76a('0x4'));var db=require(_0xc76a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76a('0x6'))(_0xc76a('0x7'));var config=require(_0xc76a('0x8'));var jayson=require(_0xc76a('0x9'));var client=jayson[_0xc76a('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc76a('0xb')](config[_0xc76a('0xc')],{'host':_0xc76a('0xd'),'port':0x18eb});var socket=require(_0xc76a('0xe'))(new Redis(config[_0xc76a('0xc')]));require('./voiceQueueReport.socket')[_0xc76a('0xf')](socket);function respondWithRpcPromise(_0x3de3c8,_0x1a3f03,_0x2b68db){return new BPromise(function(_0x330789,_0x3517d1){return client[_0xc76a('0x10')](_0x3de3c8,_0x2b68db)[_0xc76a('0x11')](function(_0xd712b3){logger[_0xc76a('0x12')](_0xc76a('0x13'),_0x1a3f03,_0xc76a('0x14'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1a3f03,_0xc76a('0x14'),JSON[_0xc76a('0x15')](_0xd712b3));if(_0xd712b3[_0xc76a('0x16')]){if(_0xd712b3['error']['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1a3f03,_0xd712b3['error'][_0xc76a('0x17')]);return _0x3517d1(_0xd712b3[_0xc76a('0x16')][_0xc76a('0x17')]);}logger['error'](_0xc76a('0x13'),_0x1a3f03,_0xd712b3['error'][_0xc76a('0x17')]);return _0x330789(_0xd712b3[_0xc76a('0x16')][_0xc76a('0x17')]);}else{logger[_0xc76a('0x12')](_0xc76a('0x13'),_0x1a3f03,_0xc76a('0x14'));_0x330789(_0xd712b3[_0xc76a('0x18')][_0xc76a('0x17')]);}})[_0xc76a('0x19')](function(_0x584614){logger[_0xc76a('0x16')](_0xc76a('0x13'),_0x1a3f03,_0x584614);_0x3517d1(_0x584614);});});}exports[_0xc76a('0x1a')]=function(_0x1a1536){var _0x292e4d=this;return new Promise(function(_0x2964c5,_0x15547a){return db[_0xc76a('0x1b')]['findAll']({'raw':_0x1a1536[_0xc76a('0x1c')]?_0x1a1536[_0xc76a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1a1536['options']?_0x1a1536[_0xc76a('0x1c')][_0xc76a('0x1d')]||null:null,'attributes':_0x1a1536[_0xc76a('0x1c')]?_0x1a1536[_0xc76a('0x1c')]['attributes']||null:null,'limit':_0x1a1536['options']?_0x1a1536[_0xc76a('0x1c')][_0xc76a('0x1e')]||null:null,'include':_0x1a1536['options']?_0x1a1536['options'][_0xc76a('0x1f')]?_['map'](_0x1a1536[_0xc76a('0x1c')][_0xc76a('0x1f')],function(_0x2c5277){return{'model':db[_0x2c5277['model']],'as':_0x2c5277['as'],'attributes':_0x2c5277[_0xc76a('0x20')],'include':_0x2c5277[_0xc76a('0x1f')]?_[_0xc76a('0x21')](_0x2c5277[_0xc76a('0x1f')],function(_0x233a66){return{'model':db[_0x233a66[_0xc76a('0x22')]],'as':_0x233a66['as'],'attributes':_0x233a66['attributes'],'include':_0x233a66[_0xc76a('0x1f')]?_[_0xc76a('0x21')](_0x233a66['include'],function(_0x2dbc45){return{'model':db[_0x2dbc45[_0xc76a('0x22')]],'as':_0x2dbc45['as'],'attributes':_0x2dbc45[_0xc76a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc76a('0x11')](function(_0x51c042){logger[_0xc76a('0x12')](_0xc76a('0x1a'),_0x1a1536);logger[_0xc76a('0x23')]('GetVoiceQueueReport',_0x1a1536,JSON[_0xc76a('0x15')](_0x51c042));_0x2964c5(_0x51c042);})[_0xc76a('0x19')](function(_0x27bafb){logger[_0xc76a('0x16')](_0xc76a('0x1a'),_0x27bafb[_0xc76a('0x17')],_0x1a1536);_0x15547a(_0x292e4d[_0xc76a('0x16')](0x1f4,_0x27bafb[_0xc76a('0x17')]));});});};exports[_0xc76a('0x24')]=function(_0x5b6953){var _0x2fe2a9=this;return new Promise(function(_0xbe225a,_0x32fa66){return db[_0xc76a('0x1b')][_0xc76a('0x25')](_0x5b6953['body'],{'raw':_0x5b6953['options']?_0x5b6953[_0xc76a('0x1c')][_0xc76a('0x26')]===undefined?!![]:![]:!![]})[_0xc76a('0x11')](function(_0x4d2a49){logger[_0xc76a('0x12')](_0xc76a('0x24'),_0x5b6953);logger['debug'](_0xc76a('0x24'),_0x5b6953,JSON[_0xc76a('0x15')](_0x4d2a49));_0xbe225a(_0x4d2a49);})['catch'](function(_0x224f0c){logger['error'](_0xc76a('0x24'),_0x224f0c[_0xc76a('0x17')],_0x5b6953);_0x32fa66(_0x2fe2a9['error'](0x1f4,_0x224f0c[_0xc76a('0x17')]));});});};exports[_0xc76a('0x27')]=function(_0x2d27f5){var _0x5b00a3=this;return new Promise(function(_0xefcc63,_0xcb17d2){return db[_0xc76a('0x1b')][_0xc76a('0x28')](_0x2d27f5[_0xc76a('0x29')],{'raw':_0x2d27f5[_0xc76a('0x1c')]?_0x2d27f5['options'][_0xc76a('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d27f5[_0xc76a('0x1c')]?_0x2d27f5[_0xc76a('0x1c')][_0xc76a('0x1d')]||null:null,'attributes':_0x2d27f5[_0xc76a('0x1c')]?_0x2d27f5[_0xc76a('0x1c')]['attributes']||null:null,'limit':_0x2d27f5[_0xc76a('0x1c')]?_0x2d27f5[_0xc76a('0x1c')][_0xc76a('0x1e')]||null:null})[_0xc76a('0x11')](function(_0xb6d055){logger[_0xc76a('0x12')]('UpdateVoiceQueueReport',_0x2d27f5);logger[_0xc76a('0x23')](_0xc76a('0x27'),_0x2d27f5,JSON[_0xc76a('0x15')](_0xb6d055));_0xefcc63(_0xb6d055);})[_0xc76a('0x19')](function(_0x52dc3d){logger[_0xc76a('0x16')](_0xc76a('0x27'),_0x52dc3d[_0xc76a('0x17')],_0x2d27f5);_0xcb17d2(_0x5b00a3[_0xc76a('0x16')](0x1f4,_0x52dc3d[_0xc76a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 28dfd6e..fb98e41 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 _0x3edb=['removeListener','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x3edb,0x1c9));var _0xb3ed=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3edb[_0x311c35];return _0x5cc50c;};'use strict';var VoiceQueueReportEvents=require(_0xb3ed('0x0'));var events=[_0xb3ed('0x1'),'remove',_0xb3ed('0x2')];function createListener(_0x118064,_0x1c88cc){return function(_0x423984){_0x1c88cc['emit'](_0x118064,_0x423984);};}function removeListener(_0x1992b6,_0x5bfbb5){return function(){VoiceQueueReportEvents[_0xb3ed('0x3')](_0x1992b6,_0x5bfbb5);};}exports['register']=function(_0xa51c35){for(var _0x28a1c6=0x0,_0xa0f681=events['length'];_0x28a1c6<_0xa0f681;_0x28a1c6++){var _0xcd6a84=events[_0x28a1c6];var _0x3c968c=createListener(_0xb3ed('0x4')+_0xcd6a84,_0xa51c35);VoiceQueueReportEvents['on'](_0xcd6a84,_0x3c968c);}}; \ No newline at end of file +var _0x2a9b=['emit','removeListener','register','save'];(function(_0xd6e300,_0x2c17ac){var _0x6cf4ea=function(_0x1a6840){while(--_0x1a6840){_0xd6e300['push'](_0xd6e300['shift']());}};_0x6cf4ea(++_0x2c17ac);}(_0x2a9b,0x14b));var _0xb2a9=function(_0x5afd5f,_0x5974b2){_0x5afd5f=_0x5afd5f-0x0;var _0x5cdfd9=_0x2a9b[_0x5afd5f];return _0x5cdfd9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xb2a9('0x0'),'remove','update'];function createListener(_0xab3b2e,_0x12b405){return function(_0x5ae17b){_0x12b405[_0xb2a9('0x1')](_0xab3b2e,_0x5ae17b);};}function removeListener(_0x172f5e,_0x29a4b2){return function(){VoiceQueueReportEvents[_0xb2a9('0x2')](_0x172f5e,_0x29a4b2);};}exports[_0xb2a9('0x3')]=function(_0x2770a8){for(var _0x15c049=0x0,_0x2f8c31=events['length'];_0x15c049<_0x2f8c31;_0x15c049++){var _0x4e9c63=events[_0x15c049];var _0x4edddd=createListener('voiceQueueReport:'+_0x4e9c63,_0x2770a8);VoiceQueueReportEvents['on'](_0x4e9c63,_0x4edddd);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 2175300..44c0054 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 _0xa3d1=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x1ec4e3,_0x5af05a){var _0xb2f1bd=function(_0x3a984f){while(--_0x3a984f){_0x1ec4e3['push'](_0x1ec4e3['shift']());}};_0xb2f1bd(++_0x5af05a);}(_0xa3d1,0x126));var _0x1a3d=function(_0xb366f1,_0x1b9197){_0xb366f1=_0xb366f1-0x0;var _0x879beb=_0xa3d1[_0xb366f1];return _0x879beb;};'use strict';var multer=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var path=require(_0x1a3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a3d('0x3'));var router=express['Router']();var fs_extra=require(_0x1a3d('0x4'));var auth=require(_0x1a3d('0x5'));var interaction=require(_0x1a3d('0x6'));var config=require(_0x1a3d('0x7'));var controller=require(_0x1a3d('0x8'));router[_0x1a3d('0x9')]('/',auth[_0x1a3d('0xa')](),controller[_0x1a3d('0xb')]);router['get'](_0x1a3d('0xc'),auth['isAuthenticated'](),controller[_0x1a3d('0xd')]);router[_0x1a3d('0xe')]('/',auth[_0x1a3d('0xa')](),controller['create']);router[_0x1a3d('0xf')](_0x1a3d('0xc'),auth[_0x1a3d('0xa')](),controller[_0x1a3d('0x10')]);router[_0x1a3d('0x11')](_0x1a3d('0xc'),auth[_0x1a3d('0xa')](),controller[_0x1a3d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x95d3=['index','/:id','show','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated'];(function(_0x5a2a53,_0x271a76){var _0x56bfbc=function(_0x3eac48){while(--_0x3eac48){_0x5a2a53['push'](_0x5a2a53['shift']());}};_0x56bfbc(++_0x271a76);}(_0x95d3,0x126));var _0x395d=function(_0x145520,_0x1c8fa6){_0x145520=_0x145520-0x0;var _0x47ef1c=_0x95d3[_0x145520];return _0x47ef1c;};'use strict';var multer=require(_0x395d('0x0'));var util=require('util');var path=require(_0x395d('0x1'));var timeout=require(_0x395d('0x2'));var express=require(_0x395d('0x3'));var router=express[_0x395d('0x4')]();var fs_extra=require(_0x395d('0x5'));var auth=require(_0x395d('0x6'));var interaction=require(_0x395d('0x7'));var config=require(_0x395d('0x8'));var controller=require(_0x395d('0x9'));router[_0x395d('0xa')]('/',auth[_0x395d('0xb')](),controller[_0x395d('0xc')]);router[_0x395d('0xa')](_0x395d('0xd'),auth['isAuthenticated'](),controller[_0x395d('0xe')]);router['post']('/',auth[_0x395d('0xb')](),controller['create']);router[_0x395d('0xf')](_0x395d('0xd'),auth['isAuthenticated'](),controller[_0x395d('0x10')]);router['delete'](_0x395d('0xd'),auth[_0x395d('0xb')](),controller[_0x395d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index fc733cc..9911447 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 _0xa9fd=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xa9fd,0xa0));var _0xda9f=function(_0x265465,_0x1b643d){_0x265465=_0x265465-0x0;var _0x1a23a7=_0xa9fd[_0x265465];return _0x1a23a7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xda9f('0x0'));module[_0xda9f('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xda9f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xda9f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xda9f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xda9f('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xda9f('0x3')],'allowNull':![],'defaultValue':moment()[_0xda9f('0x4')](_0xda9f('0x5'))}}; \ No newline at end of file +var _0xca93=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xca93,0x123));var _0x3ca9=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xca93[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x3ca9('0x0'));var moment=require(_0x3ca9('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3ca9('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3ca9('0x3')],'allowNull':![],'defaultValue':moment()[_0x3ca9('0x4')](_0x3ca9('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 52b0c3f..05db393 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 _0x38ac=['reject','then','stack','send','index','map','VoiceQueuesLog','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','body','update','destroy','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','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','count','set'];(function(_0x3c8499,_0x2bfc75){var _0x3f9914=function(_0x5978f5){while(--_0x5978f5){_0x3c8499['push'](_0x3c8499['shift']());}};_0x3f9914(++_0x2bfc75);}(_0x38ac,0x1f0));var _0xc38a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x38ac[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xc38a('0x0'));var rimraf=require(_0xc38a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc38a('0x2'));var rp=require(_0xc38a('0x3'));var moment=require(_0xc38a('0x4'));var BPromise=require(_0xc38a('0x5'));var Mustache=require(_0xc38a('0x6'));var util=require(_0xc38a('0x7'));var path=require(_0xc38a('0x8'));var sox=require(_0xc38a('0x9'));var csv=require(_0xc38a('0xa'));var ejs=require(_0xc38a('0xb'));var fs=require('fs');var fs_extra=require(_0xc38a('0xc'));var _=require(_0xc38a('0xd'));var squel=require('squel');var crypto=require(_0xc38a('0xe'));var jsforce=require(_0xc38a('0xf'));var deskjs=require(_0xc38a('0x10'));var toCsv=require(_0xc38a('0xa'));var querystring=require(_0xc38a('0x11'));var Papa=require(_0xc38a('0x12'));var Redis=require(_0xc38a('0x13'));var authService=require(_0xc38a('0x14'));var qs=require(_0xc38a('0x15'));var as=require(_0xc38a('0x16'));var hardwareService=require(_0xc38a('0x17'));var logger=require(_0xc38a('0x18'))(_0xc38a('0x19'));var utils=require(_0xc38a('0x1a'));var config=require(_0xc38a('0x1b'));var licenseUtil=require(_0xc38a('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1817,_0x37abde){_0x37abde=_0x37abde||0xcc;return function(_0x1184ac){if(_0x1184ac){return _0x4b1817[_0xc38a('0x1d')](_0x37abde);}return _0x4b1817[_0xc38a('0x1e')](_0x37abde)['end']();};}function respondWithResult(_0x356ad3,_0x4c90a7){_0x4c90a7=_0x4c90a7||0xc8;return function(_0x1a5224){if(_0x1a5224){return _0x356ad3[_0xc38a('0x1e')](_0x4c90a7)[_0xc38a('0x1f')](_0x1a5224);}};}function respondWithFilteredResult(_0x33c6ee,_0x18b0ad){return function(_0x4250c5){if(_0x4250c5){var _0x1d0c48=typeof _0x18b0ad[_0xc38a('0x20')]===_0xc38a('0x21')&&typeof _0x18b0ad['limit']==='undefined';var _0x38413a=_0x4250c5[_0xc38a('0x22')];var _0x54d033=_0x1d0c48?0x0:_0x18b0ad[_0xc38a('0x20')];var _0x5db1e8=_0x1d0c48?_0x4250c5[_0xc38a('0x22')]:_0x18b0ad[_0xc38a('0x20')]+_0x18b0ad['limit'];var _0x588100;if(_0x5db1e8>=_0x38413a){_0x5db1e8=_0x38413a;_0x588100=0xc8;}else{_0x588100=0xce;}_0x33c6ee[_0xc38a('0x1e')](_0x588100);return _0x33c6ee[_0xc38a('0x23')]('Content-Range',_0x54d033+'-'+_0x5db1e8+'/'+_0x38413a)[_0xc38a('0x1f')](_0x4250c5);}return null;};}function patchUpdates(_0x227564){return function(_0x4bbbd9){try{jsonpatch['apply'](_0x4bbbd9,_0x227564,!![]);}catch(_0x5e8b7c){return BPromise[_0xc38a('0x24')](_0x5e8b7c);}return _0x4bbbd9['save']();};}function saveUpdates(_0x334f5a,_0x491186){return function(_0x3da795){if(_0x3da795){return _0x3da795['update'](_0x334f5a)['then'](function(_0x26c1c1){return _0x26c1c1;});}return null;};}function removeEntity(_0x5b3395,_0x245a7a){return function(_0x30daa3){if(_0x30daa3){return _0x30daa3['destroy']()[_0xc38a('0x25')](function(){_0x5b3395['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fb8f,_0x24de77){return function(_0x5c510a){if(!_0x5c510a){_0x8fb8f[_0xc38a('0x1d')](0x194);}return _0x5c510a;};}function handleError(_0x520bd8,_0x57273a){_0x57273a=_0x57273a||0x1f4;return function(_0x4dc3eb){logger['error'](_0x4dc3eb[_0xc38a('0x26')]);if(_0x4dc3eb['name']){delete _0x4dc3eb['name'];}_0x520bd8['status'](_0x57273a)[_0xc38a('0x27')](_0x4dc3eb);};}exports[_0xc38a('0x28')]=function(_0xf0c1c,_0xb939dc){var _0x578324={},_0x2558a4={},_0x2f4408={'count':0x0,'rows':[]};var _0x67a33c=_[_0xc38a('0x29')](db[_0xc38a('0x2a')]['rawAttributes'],function(_0x82e612){return{'name':_0x82e612[_0xc38a('0x2b')],'type':_0x82e612[_0xc38a('0x2c')][_0xc38a('0x2d')]};});_0x2558a4[_0xc38a('0x2e')]=_[_0xc38a('0x29')](_0x67a33c,_0xc38a('0x2f'));_0x2558a4['query']=_['keys'](_0xf0c1c[_0xc38a('0x30')]);_0x2558a4[_0xc38a('0x31')]=_[_0xc38a('0x32')](_0x2558a4['model'],_0x2558a4[_0xc38a('0x30')]);_0x578324[_0xc38a('0x33')]=_[_0xc38a('0x32')](_0x2558a4[_0xc38a('0x2e')],qs[_0xc38a('0x34')](_0xf0c1c[_0xc38a('0x30')][_0xc38a('0x34')]));_0x578324['attributes']=_0x578324[_0xc38a('0x33')][_0xc38a('0x35')]?_0x578324['attributes']:_0x2558a4[_0xc38a('0x2e')];if(!_0xf0c1c[_0xc38a('0x30')][_0xc38a('0x36')](_0xc38a('0x37'))){_0x578324[_0xc38a('0x38')]=qs[_0xc38a('0x38')](_0xf0c1c[_0xc38a('0x30')]['limit']);_0x578324['offset']=qs[_0xc38a('0x20')](_0xf0c1c[_0xc38a('0x30')][_0xc38a('0x20')]);}_0x578324['order']=qs[_0xc38a('0x39')](_0xf0c1c['query'][_0xc38a('0x39')]);_0x578324[_0xc38a('0x3a')]=qs[_0xc38a('0x31')](_[_0xc38a('0x3b')](_0xf0c1c[_0xc38a('0x30')],_0x2558a4[_0xc38a('0x31')]),_0x67a33c);if(_0xf0c1c[_0xc38a('0x30')]['filter']){_0x578324['where']=_[_0xc38a('0x3c')](_0x578324[_0xc38a('0x3a')],{'$or':_['map'](_0x67a33c,function(_0x441139){if(_0x441139[_0xc38a('0x2c')]!==_0xc38a('0x3d')){var _0x71429e={};_0x71429e[_0x441139['name']]={'$like':'%'+_0xf0c1c['query'][_0xc38a('0x3e')]+'%'};return _0x71429e;}})});}_0x578324=_[_0xc38a('0x3c')]({},_0x578324,_0xf0c1c[_0xc38a('0x3f')]);var _0x5a6640={'where':_0x578324[_0xc38a('0x3a')]};return db['VoiceQueuesLog'][_0xc38a('0x22')](_0x5a6640)[_0xc38a('0x25')](function(_0x4d8c66){_0x2f4408[_0xc38a('0x22')]=_0x4d8c66;if(_0xf0c1c[_0xc38a('0x30')][_0xc38a('0x40')]){_0x578324[_0xc38a('0x41')]=[{'all':!![]}];}return db[_0xc38a('0x2a')]['findAll'](_0x578324);})['then'](function(_0x32a874){_0x2f4408[_0xc38a('0x42')]=_0x32a874;return _0x2f4408;})[_0xc38a('0x25')](respondWithFilteredResult(_0xb939dc,_0x578324))[_0xc38a('0x43')](handleError(_0xb939dc,null));};exports[_0xc38a('0x44')]=function(_0x529606,_0x72b733){var _0x39e0ff={'raw':!![],'where':{'id':_0x529606[_0xc38a('0x45')]['id']}},_0x3af414={};_0x3af414[_0xc38a('0x2e')]=_['keys'](db[_0xc38a('0x2a')][_0xc38a('0x46')]);_0x3af414[_0xc38a('0x30')]=_[_0xc38a('0x47')](_0x529606['query']);_0x3af414[_0xc38a('0x31')]=_[_0xc38a('0x32')](_0x3af414[_0xc38a('0x2e')],_0x3af414[_0xc38a('0x30')]);_0x39e0ff[_0xc38a('0x33')]=_[_0xc38a('0x32')](_0x3af414[_0xc38a('0x2e')],qs[_0xc38a('0x34')](_0x529606[_0xc38a('0x30')]['fields']));_0x39e0ff['attributes']=_0x39e0ff[_0xc38a('0x33')][_0xc38a('0x35')]?_0x39e0ff['attributes']:_0x3af414[_0xc38a('0x2e')];if(_0x529606[_0xc38a('0x30')][_0xc38a('0x40')]){_0x39e0ff[_0xc38a('0x41')]=[{'all':!![]}];}_0x39e0ff=_[_0xc38a('0x3c')]({},_0x39e0ff,_0x529606[_0xc38a('0x3f')]);return db[_0xc38a('0x2a')][_0xc38a('0x48')](_0x39e0ff)[_0xc38a('0x25')](handleEntityNotFound(_0x72b733,null))[_0xc38a('0x25')](respondWithResult(_0x72b733,null))['catch'](handleError(_0x72b733,null));};exports['create']=function(_0x2d7640,_0x1ec65c){return db[_0xc38a('0x2a')]['create'](_0x2d7640[_0xc38a('0x49')],{})['then'](respondWithResult(_0x1ec65c,0xc9))[_0xc38a('0x43')](handleError(_0x1ec65c,null));};exports[_0xc38a('0x4a')]=function(_0x5ce10b,_0x1f1558){if(_0x5ce10b[_0xc38a('0x49')]['id']){delete _0x5ce10b[_0xc38a('0x49')]['id'];}return db[_0xc38a('0x2a')]['find']({'where':{'id':_0x5ce10b['params']['id']}})[_0xc38a('0x25')](handleEntityNotFound(_0x1f1558,null))['then'](saveUpdates(_0x5ce10b[_0xc38a('0x49')],null))['then'](respondWithResult(_0x1f1558,null))[_0xc38a('0x43')](handleError(_0x1f1558,null));};exports[_0xc38a('0x4b')]=function(_0x10873e,_0x47277b){return db[_0xc38a('0x2a')][_0xc38a('0x48')]({'where':{'id':_0x10873e[_0xc38a('0x45')]['id']}})[_0xc38a('0x25')](handleEntityNotFound(_0x47277b,null))[_0xc38a('0x25')](removeEntity(_0x47277b,null))[_0xc38a('0x43')](handleError(_0x47277b,null));}; \ No newline at end of file +var _0x107e=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','keys'];(function(_0x28243e,_0x41ab63){var _0x26dd92=function(_0x302f80){while(--_0x302f80){_0x28243e['push'](_0x28243e['shift']());}};_0x26dd92(++_0x41ab63);}(_0x107e,0x155));var _0xe107=function(_0x1b6302,_0x1715ba){_0x1b6302=_0x1b6302-0x0;var _0x4f042a=_0x107e[_0x1b6302];return _0x4f042a;};'use strict';var emlformat=require(_0xe107('0x0'));var rimraf=require(_0xe107('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe107('0x2'));var moment=require(_0xe107('0x3'));var BPromise=require(_0xe107('0x4'));var Mustache=require(_0xe107('0x5'));var util=require(_0xe107('0x6'));var path=require(_0xe107('0x7'));var sox=require(_0xe107('0x8'));var csv=require(_0xe107('0x9'));var ejs=require(_0xe107('0xa'));var fs=require('fs');var fs_extra=require(_0xe107('0xb'));var _=require(_0xe107('0xc'));var squel=require(_0xe107('0xd'));var crypto=require(_0xe107('0xe'));var jsforce=require(_0xe107('0xf'));var deskjs=require(_0xe107('0x10'));var toCsv=require(_0xe107('0x9'));var querystring=require(_0xe107('0x11'));var Papa=require(_0xe107('0x12'));var Redis=require(_0xe107('0x13'));var authService=require(_0xe107('0x14'));var qs=require(_0xe107('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe107('0x16'));var logger=require(_0xe107('0x17'))(_0xe107('0x18'));var utils=require(_0xe107('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe107('0x1a'));var db=require(_0xe107('0x1b'))['db'];function respondWithStatusCode(_0x2e158d,_0x1f0bd1){_0x1f0bd1=_0x1f0bd1||0xcc;return function(_0x339cb9){if(_0x339cb9){return _0x2e158d[_0xe107('0x1c')](_0x1f0bd1);}return _0x2e158d['status'](_0x1f0bd1)[_0xe107('0x1d')]();};}function respondWithResult(_0x11d490,_0x133d8a){_0x133d8a=_0x133d8a||0xc8;return function(_0x35f7eb){if(_0x35f7eb){return _0x11d490['status'](_0x133d8a)[_0xe107('0x1e')](_0x35f7eb);}};}function respondWithFilteredResult(_0x4119f9,_0x241858){return function(_0x5836fc){if(_0x5836fc){var _0x3a6f68=typeof _0x241858['offset']===_0xe107('0x1f')&&typeof _0x241858[_0xe107('0x20')]===_0xe107('0x1f');var _0x2e345a=_0x5836fc[_0xe107('0x21')];var _0x5f2fdf=_0x3a6f68?0x0:_0x241858[_0xe107('0x22')];var _0x508565=_0x3a6f68?_0x5836fc[_0xe107('0x21')]:_0x241858[_0xe107('0x22')]+_0x241858[_0xe107('0x20')];var _0x27f4a0;if(_0x508565>=_0x2e345a){_0x508565=_0x2e345a;_0x27f4a0=0xc8;}else{_0x27f4a0=0xce;}_0x4119f9[_0xe107('0x23')](_0x27f4a0);return _0x4119f9['set'](_0xe107('0x24'),_0x5f2fdf+'-'+_0x508565+'/'+_0x2e345a)[_0xe107('0x1e')](_0x5836fc);}return null;};}function patchUpdates(_0x2ee95b){return function(_0x23167a){try{jsonpatch[_0xe107('0x25')](_0x23167a,_0x2ee95b,!![]);}catch(_0x4f57fc){return BPromise[_0xe107('0x26')](_0x4f57fc);}return _0x23167a[_0xe107('0x27')]();};}function saveUpdates(_0x19efa4,_0x3d8d7e){return function(_0x43312a){if(_0x43312a){return _0x43312a[_0xe107('0x28')](_0x19efa4)[_0xe107('0x29')](function(_0x4757d0){return _0x4757d0;});}return null;};}function removeEntity(_0x4a897f,_0x26b380){return function(_0xb10bff){if(_0xb10bff){return _0xb10bff[_0xe107('0x2a')]()[_0xe107('0x29')](function(){_0x4a897f[_0xe107('0x23')](0xcc)[_0xe107('0x1d')]();});}};}function handleEntityNotFound(_0x5104e0,_0x3ce895){return function(_0x39c50c){if(!_0x39c50c){_0x5104e0['sendStatus'](0x194);}return _0x39c50c;};}function handleError(_0x100c5f,_0x4f62ee){_0x4f62ee=_0x4f62ee||0x1f4;return function(_0x4bf37a){logger[_0xe107('0x2b')](_0x4bf37a['stack']);if(_0x4bf37a[_0xe107('0x2c')]){delete _0x4bf37a['name'];}_0x100c5f[_0xe107('0x23')](_0x4f62ee)[_0xe107('0x2d')](_0x4bf37a);};}exports[_0xe107('0x2e')]=function(_0x36f5e7,_0x1193c2){var _0x22ea49={},_0x4cf5f7={},_0x5321a2={'count':0x0,'rows':[]};var _0x476db9=_[_0xe107('0x2f')](db[_0xe107('0x30')][_0xe107('0x31')],function(_0x4609b3){return{'name':_0x4609b3['fieldName'],'type':_0x4609b3[_0xe107('0x32')][_0xe107('0x33')]};});_0x4cf5f7[_0xe107('0x34')]=_['map'](_0x476db9,_0xe107('0x2c'));_0x4cf5f7['query']=_[_0xe107('0x35')](_0x36f5e7[_0xe107('0x36')]);_0x4cf5f7['filters']=_[_0xe107('0x37')](_0x4cf5f7[_0xe107('0x34')],_0x4cf5f7[_0xe107('0x36')]);_0x22ea49[_0xe107('0x38')]=_[_0xe107('0x37')](_0x4cf5f7['model'],qs[_0xe107('0x39')](_0x36f5e7[_0xe107('0x36')][_0xe107('0x39')]));_0x22ea49[_0xe107('0x38')]=_0x22ea49['attributes'][_0xe107('0x3a')]?_0x22ea49[_0xe107('0x38')]:_0x4cf5f7[_0xe107('0x34')];if(!_0x36f5e7[_0xe107('0x36')][_0xe107('0x3b')](_0xe107('0x3c'))){_0x22ea49['limit']=qs[_0xe107('0x20')](_0x36f5e7[_0xe107('0x36')][_0xe107('0x20')]);_0x22ea49[_0xe107('0x22')]=qs[_0xe107('0x22')](_0x36f5e7[_0xe107('0x36')][_0xe107('0x22')]);}_0x22ea49['order']=qs[_0xe107('0x3d')](_0x36f5e7[_0xe107('0x36')]['sort']);_0x22ea49['where']=qs['filters'](_[_0xe107('0x3e')](_0x36f5e7[_0xe107('0x36')],_0x4cf5f7[_0xe107('0x3f')]),_0x476db9);if(_0x36f5e7['query'][_0xe107('0x40')]){_0x22ea49['where']=_[_0xe107('0x41')](_0x22ea49[_0xe107('0x42')],{'$or':_[_0xe107('0x2f')](_0x476db9,function(_0x1158c3){if(_0x1158c3['type']!==_0xe107('0x43')){var _0x528ac2={};_0x528ac2[_0x1158c3['name']]={'$like':'%'+_0x36f5e7[_0xe107('0x36')]['filter']+'%'};return _0x528ac2;}})});}_0x22ea49=_['merge']({},_0x22ea49,_0x36f5e7[_0xe107('0x44')]);var _0x3dcddb={'where':_0x22ea49[_0xe107('0x42')]};return db[_0xe107('0x30')][_0xe107('0x21')](_0x3dcddb)[_0xe107('0x29')](function(_0x31a6af){_0x5321a2[_0xe107('0x21')]=_0x31a6af;if(_0x36f5e7[_0xe107('0x36')][_0xe107('0x45')]){_0x22ea49[_0xe107('0x46')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xe107('0x47')](_0x22ea49);})['then'](function(_0x410d3e){_0x5321a2[_0xe107('0x48')]=_0x410d3e;return _0x5321a2;})[_0xe107('0x29')](respondWithFilteredResult(_0x1193c2,_0x22ea49))['catch'](handleError(_0x1193c2,null));};exports[_0xe107('0x49')]=function(_0x42abed,_0x37ccc1){var _0x5ef09c={'raw':!![],'where':{'id':_0x42abed['params']['id']}},_0x34c5f5={};_0x34c5f5[_0xe107('0x34')]=_[_0xe107('0x35')](db['VoiceQueuesLog'][_0xe107('0x31')]);_0x34c5f5[_0xe107('0x36')]=_[_0xe107('0x35')](_0x42abed[_0xe107('0x36')]);_0x34c5f5['filters']=_[_0xe107('0x37')](_0x34c5f5[_0xe107('0x34')],_0x34c5f5[_0xe107('0x36')]);_0x5ef09c[_0xe107('0x38')]=_[_0xe107('0x37')](_0x34c5f5[_0xe107('0x34')],qs['fields'](_0x42abed[_0xe107('0x36')][_0xe107('0x39')]));_0x5ef09c[_0xe107('0x38')]=_0x5ef09c[_0xe107('0x38')][_0xe107('0x3a')]?_0x5ef09c[_0xe107('0x38')]:_0x34c5f5['model'];if(_0x42abed[_0xe107('0x36')]['includeAll']){_0x5ef09c[_0xe107('0x46')]=[{'all':!![]}];}_0x5ef09c=_[_0xe107('0x41')]({},_0x5ef09c,_0x42abed[_0xe107('0x44')]);return db[_0xe107('0x30')][_0xe107('0x4a')](_0x5ef09c)['then'](handleEntityNotFound(_0x37ccc1,null))[_0xe107('0x29')](respondWithResult(_0x37ccc1,null))['catch'](handleError(_0x37ccc1,null));};exports['create']=function(_0x28982b,_0x3879cc){return db['VoiceQueuesLog'][_0xe107('0x4b')](_0x28982b[_0xe107('0x4c')],{})[_0xe107('0x29')](respondWithResult(_0x3879cc,0xc9))['catch'](handleError(_0x3879cc,null));};exports[_0xe107('0x28')]=function(_0x24153c,_0x9975aa){if(_0x24153c['body']['id']){delete _0x24153c['body']['id'];}return db['VoiceQueuesLog'][_0xe107('0x4a')]({'where':{'id':_0x24153c[_0xe107('0x4d')]['id']}})[_0xe107('0x29')](handleEntityNotFound(_0x9975aa,null))[_0xe107('0x29')](saveUpdates(_0x24153c[_0xe107('0x4c')],null))[_0xe107('0x29')](respondWithResult(_0x9975aa,null))[_0xe107('0x4e')](handleError(_0x9975aa,null));};exports[_0xe107('0x2a')]=function(_0x3ce43f,_0x3151c6){return db[_0xe107('0x30')][_0xe107('0x4a')]({'where':{'id':_0x3ce43f['params']['id']}})['then'](handleEntityNotFound(_0x3151c6,null))[_0xe107('0x29')](removeEntity(_0x3151c6,null))[_0xe107('0x4e')](handleError(_0x3151c6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index d63429f..4e42cfb 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 _0x9c13=['moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api'];(function(_0x27ae1a,_0x17a347){var _0x396ea1=function(_0xe562e4){while(--_0xe562e4){_0x27ae1a['push'](_0x27ae1a['shift']());}};_0x396ea1(++_0x17a347);}(_0x9c13,0x127));var _0x39c1=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x9c13[_0x404cde];return _0x139882;};'use strict';var _=require(_0x39c1('0x0'));var util=require(_0x39c1('0x1'));var logger=require(_0x39c1('0x2'))(_0x39c1('0x3'));var moment=require(_0x39c1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x39c1('0x5'));var rimraf=require(_0x39c1('0x6'));var config=require(_0x39c1('0x7'));var attributes=require(_0x39c1('0x8'));module['exports']=function(_0x26ec94,_0x1e98e4){return _0x26ec94['define']('VoiceQueuesLog',attributes,{'tableName':_0x39c1('0x9'),'paranoid':![],'indexes':[{'name':_0x39c1('0xa'),'fields':[_0x39c1('0xb'),_0x39c1('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa991=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event'];(function(_0x51a57d,_0x35b93e){var _0x4d392a=function(_0x30de58){while(--_0x30de58){_0x51a57d['push'](_0x51a57d['shift']());}};_0x4d392a(++_0x35b93e);}(_0xa991,0x143));var _0x1a99=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa991[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x1a99('0x0'));var util=require('util');var logger=require(_0x1a99('0x1'))(_0x1a99('0x2'));var moment=require(_0x1a99('0x3'));var BPromise=require(_0x1a99('0x4'));var rp=require(_0x1a99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a99('0x6'));var config=require(_0x1a99('0x7'));var attributes=require(_0x1a99('0x8'));module[_0x1a99('0x9')]=function(_0x22990b,_0xabf36a){return _0x22990b[_0x1a99('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0x1a99('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x1a99('0xc'),_0x1a99('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index ddc314a..b3c3ee3 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 _0x8192=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x57ddb8,_0x28c66d){var _0x6b9f15=function(_0x391703){while(--_0x391703){_0x57ddb8['push'](_0x57ddb8['shift']());}};_0x6b9f15(++_0x28c66d);}(_0x8192,0x82));var _0x2819=function(_0x33e5ed,_0x200786){_0x33e5ed=_0x33e5ed-0x0;var _0x5f246d=_0x8192[_0x33e5ed];return _0x5f246d;};'use strict';var _=require(_0x2819('0x0'));var util=require(_0x2819('0x1'));var moment=require(_0x2819('0x2'));var BPromise=require(_0x2819('0x3'));var rs=require(_0x2819('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2819('0x5'))['db'];var utils=require(_0x2819('0x6'));var logger=require(_0x2819('0x7'))(_0x2819('0x8'));var config=require(_0x2819('0x9'));var jayson=require(_0x2819('0xa'));var client=jayson[_0x2819('0xb')][_0x2819('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x583c18,_0x3d68c8,_0x15437f){return new BPromise(function(_0x27f37e,_0x555a6b){return client['request'](_0x583c18,_0x15437f)[_0x2819('0xd')](function(_0x310875){logger[_0x2819('0xe')](_0x2819('0xf'),_0x3d68c8,_0x2819('0x10'));logger[_0x2819('0x11')](_0x2819('0x12'),_0x3d68c8,_0x2819('0x10'),JSON[_0x2819('0x13')](_0x310875));if(_0x310875[_0x2819('0x14')]){if(_0x310875[_0x2819('0x14')][_0x2819('0x15')]===0x1f4){logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x310875[_0x2819('0x14')][_0x2819('0x16')]);return _0x555a6b(_0x310875['error'][_0x2819('0x16')]);}logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x310875[_0x2819('0x14')]['message']);return _0x27f37e(_0x310875[_0x2819('0x14')][_0x2819('0x16')]);}else{logger[_0x2819('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3d68c8,_0x2819('0x10'));_0x27f37e(_0x310875['result'][_0x2819('0x16')]);}})[_0x2819('0x17')](function(_0x3a731e){logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x3a731e);_0x555a6b(_0x3a731e);});});} \ No newline at end of file +var _0x867f=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0xa6d252,_0xf664a8){var _0x498d25=function(_0x2b83d8){while(--_0x2b83d8){_0xa6d252['push'](_0xa6d252['shift']());}};_0x498d25(++_0xf664a8);}(_0x867f,0xe6));var _0xf867=function(_0x5774af,_0x411c94){_0x5774af=_0x5774af-0x0;var _0x480589=_0x867f[_0x5774af];return _0x480589;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3f527b5..744c3df 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 _0x0318=['downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','destroy','exports','util','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/downloads'];(function(_0x92c4b4,_0x3bb55c){var _0x16a72f=function(_0x46cca9){while(--_0x46cca9){_0x92c4b4['push'](_0x92c4b4['shift']());}};_0x16a72f(++_0x3bb55c);}(_0x0318,0x1c1));var _0x8031=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0318[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x8031('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8031('0x1')]();var fs_extra=require(_0x8031('0x2'));var auth=require(_0x8031('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x8031('0x4')]('/',auth[_0x8031('0x5')](),controller['index']);router[_0x8031('0x4')](_0x8031('0x6'),auth[_0x8031('0x5')](),controller[_0x8031('0x7')]);router[_0x8031('0x4')](_0x8031('0x8'),auth[_0x8031('0x5')](),controller[_0x8031('0x9')]);router[_0x8031('0x4')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x8031('0x4')](_0x8031('0xa'),controller['downloads']);router[_0x8031('0x4')]('/:id/transcribe',auth[_0x8031('0x5')](),controller[_0x8031('0xb')]);router[_0x8031('0xc')]('/',auth[_0x8031('0x5')](),controller[_0x8031('0xd')]);router[_0x8031('0xc')](_0x8031('0xe'),auth[_0x8031('0x5')](),controller[_0x8031('0xf')]);router[_0x8031('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8031('0x11')]);router['delete']('/:id',auth[_0x8031('0x5')](),controller[_0x8031('0x12')]);module[_0x8031('0x13')]=router; \ No newline at end of file +var _0x4916=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','downloads','post','create','/:id/transcribe','put','update','delete','destroy'];(function(_0x4fe03b,_0x32636a){var _0x1a1887=function(_0x3b2dbd){while(--_0x3b2dbd){_0x4fe03b['push'](_0x4fe03b['shift']());}};_0x1a1887(++_0x32636a);}(_0x4916,0x9d));var _0x6491=function(_0x30fc92,_0x2e427){_0x30fc92=_0x30fc92-0x0;var _0x19939f=_0x4916[_0x30fc92];return _0x19939f;};'use strict';var multer=require('multer');var util=require(_0x6491('0x0'));var path=require(_0x6491('0x1'));var timeout=require(_0x6491('0x2'));var express=require(_0x6491('0x3'));var router=express[_0x6491('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6491('0x5'));var interaction=require(_0x6491('0x6'));var config=require(_0x6491('0x7'));var controller=require(_0x6491('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6491('0x9')](_0x6491('0xa'),auth[_0x6491('0xb')](),controller[_0x6491('0xc')]);router['get'](_0x6491('0xd'),auth[_0x6491('0xb')](),controller[_0x6491('0xe')]);router['get'](_0x6491('0xf'),auth[_0x6491('0xb')](),controller[_0x6491('0x10')]);router[_0x6491('0x9')]('/:id/downloads',controller[_0x6491('0x11')]);router[_0x6491('0x9')]('/:id/transcribe',auth[_0x6491('0xb')](),controller['downloadTranscribe']);router[_0x6491('0x12')]('/',auth[_0x6491('0xb')](),controller[_0x6491('0x13')]);router[_0x6491('0x12')](_0x6491('0x14'),auth[_0x6491('0xb')](),controller['runTranscribe']);router[_0x6491('0x15')](_0x6491('0xd'),auth[_0x6491('0xb')](),controller[_0x6491('0x16')]);router[_0x6491('0x17')]('/:id',auth[_0x6491('0xb')](),controller[_0x6491('0x18')]);module[_0x6491('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 5daed59..293ee12 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(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 9008567..55ef605 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 _0x353a=['destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','type','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','downloads','sequelize','MD5','$and','push','decryptFile','VoiceRecording\x20not\x20found'];(function(_0x4644a7,_0x12530b){var _0x263dcd=function(_0x40f895){while(--_0x40f895){_0x4644a7['push'](_0x4644a7['shift']());}};_0x263dcd(++_0x12530b);}(_0x353a,0x15b));var _0xa353=function(_0x3746ff,_0x5dfa8f){_0x3746ff=_0x3746ff-0x0;var _0x353055=_0x353a[_0x3746ff];return _0x353055;};'use strict';var emlformat=require(_0xa353('0x0'));var rimraf=require(_0xa353('0x1'));var zipdir=require(_0xa353('0x2'));var jsonpatch=require(_0xa353('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa353('0x4'));var Mustache=require(_0xa353('0x5'));var util=require(_0xa353('0x6'));var path=require(_0xa353('0x7'));var sox=require(_0xa353('0x8'));var csv=require(_0xa353('0x9'));var ejs=require(_0xa353('0xa'));var fs=require('fs');var fs_extra=require(_0xa353('0xb'));var _=require(_0xa353('0xc'));var squel=require(_0xa353('0xd'));var crypto=require('crypto');var jsforce=require(_0xa353('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa353('0x9'));var querystring=require(_0xa353('0xf'));var Papa=require(_0xa353('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0xa353('0x11'));var Redis=require(_0xa353('0x12'));var authService=require(_0xa353('0x13'));var qs=require(_0xa353('0x14'));var as=require(_0xa353('0x15'));var hardwareService=require(_0xa353('0x16'));var logger=require('../../config/logger')(_0xa353('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa353('0x18'));var db=require(_0xa353('0x19'))['db'];function respondWithStatusCode(_0x23ba7a,_0x3c1f15){_0x3c1f15=_0x3c1f15||0xcc;return function(_0x2a1217){if(_0x2a1217){return _0x23ba7a[_0xa353('0x1a')](_0x3c1f15);}return _0x23ba7a[_0xa353('0x1b')](_0x3c1f15)[_0xa353('0x1c')]();};}function respondWithResult(_0x5428f1,_0x2f210b){_0x2f210b=_0x2f210b||0xc8;return function(_0x3070aa){if(_0x3070aa){return _0x5428f1[_0xa353('0x1b')](_0x2f210b)[_0xa353('0x1d')](_0x3070aa);}};}function respondWithFilteredResult(_0x29730c,_0x3554aa){return function(_0x3764af){if(_0x3764af){var _0x1627f6=typeof _0x3554aa['offset']===_0xa353('0x1e')&&typeof _0x3554aa[_0xa353('0x1f')]===_0xa353('0x1e');var _0x2a5a89=_0x3764af[_0xa353('0x20')];var _0xc7c224=_0x1627f6?0x0:_0x3554aa['offset'];var _0x252d47=_0x1627f6?_0x3764af[_0xa353('0x20')]:_0x3554aa[_0xa353('0x21')]+_0x3554aa[_0xa353('0x1f')];var _0x50ec84;if(_0x252d47>=_0x2a5a89){_0x252d47=_0x2a5a89;_0x50ec84=0xc8;}else{_0x50ec84=0xce;}_0x29730c[_0xa353('0x1b')](_0x50ec84);return _0x29730c[_0xa353('0x22')](_0xa353('0x23'),_0xc7c224+'-'+_0x252d47+'/'+_0x2a5a89)[_0xa353('0x1d')](_0x3764af);}return null;};}function patchUpdates(_0x345d18){return function(_0x2bf6f5){try{jsonpatch[_0xa353('0x24')](_0x2bf6f5,_0x345d18,!![]);}catch(_0x27fffa){return BPromise[_0xa353('0x25')](_0x27fffa);}return _0x2bf6f5['save']();};}function saveUpdates(_0x22c503,_0x116c46){return function(_0x55204b){if(_0x55204b){return _0x55204b[_0xa353('0x26')](_0x22c503)['then'](function(_0x30a057){return _0x30a057;});}return null;};}function removeEntity(_0x340abb,_0x92cf9){return function(_0x2737fb){if(_0x2737fb){return _0x2737fb['destroy']()[_0xa353('0x27')](function(){_0x340abb[_0xa353('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477ebf,_0x12b457){return function(_0x7d9412){if(!_0x7d9412){_0x477ebf[_0xa353('0x1a')](0x194);}return _0x7d9412;};}function handleError(_0x1bb225,_0x2c282d){_0x2c282d=_0x2c282d||0x1f4;return function(_0x5041d5){logger[_0xa353('0x28')](_0x5041d5['stack']);if(_0x5041d5[_0xa353('0x29')]){delete _0x5041d5[_0xa353('0x29')];}_0x1bb225['status'](_0x2c282d)[_0xa353('0x2a')](_0x5041d5);};}exports[_0xa353('0x2b')]=function(_0x56d36b,_0x5b1e5a){var _0x1b1745={},_0x36b509={},_0x5eaf00={'count':0x0,'rows':[]};var _0x2f6c81=_[_0xa353('0x2c')](db[_0xa353('0x2d')][_0xa353('0x2e')],function(_0x4c7610){return{'name':_0x4c7610[_0xa353('0x2f')],'type':_0x4c7610['type'][_0xa353('0x30')]};});_0x36b509[_0xa353('0x31')]=_['differenceBy'](_['map'](_0x2f6c81,_0xa353('0x29')),['format']);_0x36b509['query']=_[_0xa353('0x32')](_0x56d36b[_0xa353('0x33')]);_0x36b509['filters']=_[_0xa353('0x34')](_0x36b509[_0xa353('0x31')],_0x36b509[_0xa353('0x33')]);_0x1b1745[_0xa353('0x35')]=_['intersection'](_0x36b509['model'],qs[_0xa353('0x36')](_0x56d36b['query'][_0xa353('0x36')]));_0x1b1745[_0xa353('0x35')]=_0x1b1745[_0xa353('0x35')][_0xa353('0x37')]?_0x1b1745[_0xa353('0x35')]:_0x36b509[_0xa353('0x31')];if(!_0x56d36b['query'][_0xa353('0x38')](_0xa353('0x39'))){_0x1b1745[_0xa353('0x1f')]=qs['limit'](_0x56d36b[_0xa353('0x33')][_0xa353('0x1f')]);_0x1b1745[_0xa353('0x21')]=qs[_0xa353('0x21')](_0x56d36b['query'][_0xa353('0x21')]);}_0x1b1745[_0xa353('0x3a')]=qs[_0xa353('0x3b')](_0x56d36b[_0xa353('0x33')]['sort']);_0x1b1745[_0xa353('0x3c')]=qs[_0xa353('0x3d')](_['pick'](_0x56d36b[_0xa353('0x33')],_0x36b509['filters']),_0x2f6c81);if(_0x56d36b[_0xa353('0x33')][_0xa353('0x3e')]){_0x1b1745[_0xa353('0x3c')]=_[_0xa353('0x3f')](_0x1b1745[_0xa353('0x3c')],{'$or':_[_0xa353('0x2c')](_0x2f6c81,function(_0x38d166){if(_0x38d166['type']!==_0xa353('0x40')){var _0x30d042={};_0x30d042[_0x38d166[_0xa353('0x29')]]={'$like':'%'+_0x56d36b[_0xa353('0x33')]['filter']+'%'};return _0x30d042;}})});}_0x1b1745=_[_0xa353('0x3f')]({},_0x1b1745,_0x56d36b[_0xa353('0x41')]);var _0x481c3c={'where':_0x1b1745[_0xa353('0x3c')]};return db[_0xa353('0x2d')][_0xa353('0x20')](_0x481c3c)[_0xa353('0x27')](function(_0x523ad7){_0x5eaf00[_0xa353('0x20')]=_0x523ad7;if(_0x56d36b[_0xa353('0x33')][_0xa353('0x42')]){_0x1b1745[_0xa353('0x43')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa353('0x44')](_0x1b1745);})['then'](function(_0x42f2f4){_0x5eaf00[_0xa353('0x45')]=_0x42f2f4;return _0x5eaf00;})[_0xa353('0x27')](respondWithFilteredResult(_0x5b1e5a,_0x1b1745))[_0xa353('0x46')](handleError(_0x5b1e5a,null));};exports[_0xa353('0x47')]=function(_0x6bbd8b,_0x9aaf02){var _0x107421={'raw':![],'where':{'id':_0x6bbd8b[_0xa353('0x48')]['id']}},_0x37af9e={};_0x37af9e[_0xa353('0x31')]=_[_0xa353('0x32')](db['VoiceRecording'][_0xa353('0x2e')]);_0x37af9e[_0xa353('0x33')]=_[_0xa353('0x32')](_0x6bbd8b[_0xa353('0x33')]);_0x37af9e[_0xa353('0x3d')]=_[_0xa353('0x34')](_0x37af9e[_0xa353('0x31')],_0x37af9e[_0xa353('0x33')]);_0x107421['attributes']=_[_0xa353('0x34')](_0x37af9e[_0xa353('0x31')],qs['fields'](_0x6bbd8b[_0xa353('0x33')][_0xa353('0x36')]));_0x107421[_0xa353('0x35')]=_0x107421[_0xa353('0x35')][_0xa353('0x37')]?_0x107421[_0xa353('0x35')]:_0x37af9e[_0xa353('0x31')];if(_0x6bbd8b['query'][_0xa353('0x42')]){_0x107421[_0xa353('0x43')]=[{'all':!![]}];}_0x107421=_[_0xa353('0x3f')]({},_0x107421,_0x6bbd8b[_0xa353('0x41')]);return db[_0xa353('0x2d')]['find'](_0x107421)[_0xa353('0x27')](handleEntityNotFound(_0x9aaf02,null))['then'](respondWithResult(_0x9aaf02,null))[_0xa353('0x46')](handleError(_0x9aaf02,null));};exports['create']=function(_0xcd0adb,_0x22b96e){return db[_0xa353('0x2d')][_0xa353('0x49')](_0xcd0adb[_0xa353('0x4a')],{})[_0xa353('0x27')](respondWithResult(_0x22b96e,0xc9))[_0xa353('0x46')](handleError(_0x22b96e,null));};exports[_0xa353('0x26')]=function(_0x11978a,_0x15f484){if(_0x11978a[_0xa353('0x4a')]['id']){delete _0x11978a[_0xa353('0x4a')]['id'];}return db[_0xa353('0x2d')][_0xa353('0x4b')]({'where':{'id':_0x11978a[_0xa353('0x48')]['id']}})['then'](handleEntityNotFound(_0x15f484,null))['then'](saveUpdates(_0x11978a[_0xa353('0x4a')],null))[_0xa353('0x27')](respondWithResult(_0x15f484,null))['catch'](handleError(_0x15f484,null));};exports[_0xa353('0x4c')]=function(_0x2c5f3f,_0x2b5b83){return db[_0xa353('0x2d')]['describe']()[_0xa353('0x27')](respondWithResult(_0x2b5b83,null))[_0xa353('0x46')](handleError(_0x2b5b83,null));};exports[_0xa353('0x4d')]=function(_0x25f762,_0x194023,_0x3b383c){var _0x5d2b4f=require(_0xa353('0x4e'));var _0x88854c=![];var _0x1015e6={};if(_0x25f762[_0xa353('0x33')][_0xa353('0x4f')]&&_0x25f762[_0xa353('0x33')][_0xa353('0x4f')]===_0xa353('0x50')){_0x1015e6[_0xa353('0x50')]=_0x25f762['params']['id'];}else{_0x1015e6['id']=_0x25f762[_0xa353('0x48')]['id'];}return db[_0xa353('0x2d')][_0xa353('0x4b')]({'where':_0x1015e6,'attributes':['id',_0xa353('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x194023,null))['then'](function(_0x4a395c){if(_0x4a395c){var _0x29720d=_0x4a395c['value'];var _0x49969c=util[_0xa353('0x52')](_0xa353('0x53'),_0x29720d);if(fs[_0xa353('0x54')](_0x49969c)){_0x88854c=!![];return _0x5d2b4f['decryptFile'](_0x49969c,_0x29720d,config[_0xa353('0x55')][_0xa353('0x56')])[_0xa353('0x27')](function(){return _0x4a395c;});}return _0x4a395c;}})[_0xa353('0x27')](function(_0x741aae){if(_0x741aae){var _0x3d927c=_0x741aae['value'];if(!fs[_0xa353('0x54')](_0x3d927c)){throw new db[(_0xa353('0x57'))][(_0xa353('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x741aae[_0xa353('0x59')]){return _0x194023[_0xa353('0x4d')](_0x3d927c,_0x741aae['filename']+path[_0xa353('0x5a')](_0x3d927c),function(){if(_0x88854c){fs[_0xa353('0x5b')](_0x3d927c);}});}else{return _0x194023[_0xa353('0x4d')](_0x3d927c,function(_0x48dc10){if(_0x88854c){fs[_0xa353('0x5b')](_0x3d927c);}});}}})[_0xa353('0x46')](function(_0x1ac96e){if(_0x1ac96e[_0xa353('0x5c')]==='VoiceRecording\x20not\x20found'){_0x194023[_0xa353('0x1b')](0x194)[_0xa353('0x2a')]('Not\x20found');}else{return handleError(_0x194023,null);}});};exports[_0xa353('0x5d')]=function(_0x5c8717,_0x4863dc,_0xbf0e84){var _0x383175=require('../../components/encryptor');var _0x347a73=![];var _0x188521={'$and':[db[_0xa353('0x5e')][_0xa353('0x3c')](db[_0xa353('0x5e')]['fn'](_0xa353('0x5f'),db['sequelize']['col']('uniqueid')),_0x5c8717[_0xa353('0x33')]['token'])]};if(_0x5c8717[_0xa353('0x33')][_0xa353('0x4f')]&&_0x5c8717['query']['type']===_0xa353('0x50')){_0x188521[_0xa353('0x60')]['push']({'uniqueid':_0x5c8717['params']['id']});}else{_0x188521[_0xa353('0x60')][_0xa353('0x61')]({'id':_0x5c8717[_0xa353('0x48')]['id']});}return db['VoiceRecording'][_0xa353('0x4b')]({'where':_0x188521,'attributes':['id',_0xa353('0x51')],'raw':!![]})[_0xa353('0x27')](handleEntityNotFound(_0x4863dc,null))[_0xa353('0x27')](function(_0x56da9c){if(_0x56da9c){var _0x27c23c=util['format'](_0xa353('0x53'),_0x56da9c[_0xa353('0x51')]);if(fs['existsSync'](_0x27c23c)){_0x347a73=!![];return _0x383175[_0xa353('0x62')](_0x27c23c,_0x56da9c[_0xa353('0x51')],config[_0xa353('0x55')]['recording'])[_0xa353('0x27')](function(){return _0x56da9c;});}return _0x56da9c;}})[_0xa353('0x27')](function(_0x27369b){if(_0x27369b){if(!fs['existsSync'](_0x27369b[_0xa353('0x51')])){throw new db['Sequelize'][(_0xa353('0x58'))](_0xa353('0x63'));}if(_0x27369b[_0xa353('0x59')]){return _0x4863dc['download'](_0x27369b[_0xa353('0x51')],_0x27369b['filename']+path[_0xa353('0x5a')](_0x27369b[_0xa353('0x51')]),function(){if(_0x347a73){fs[_0xa353('0x5b')](_0x27369b[_0xa353('0x51')]);}});}else{return _0x4863dc[_0xa353('0x4d')](_0x27369b[_0xa353('0x51')],function(_0x5bf4db){if(_0x347a73){fs[_0xa353('0x5b')](_0x27369b[_0xa353('0x51')]);}});}}})[_0xa353('0x46')](handleError(_0x4863dc,null));};exports[_0xa353('0x64')]=function(_0x45cabf,_0xc1897e){return db[_0xa353('0x2d')][_0xa353('0x4b')]({'where':{'id':_0x45cabf[_0xa353('0x48')]['id']}})[_0xa353('0x27')](function(_0x1b7884){if(_[_0xa353('0x65')](_0x1b7884)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1b7884;})[_0xa353('0x27')](function(_0x465ff3){var _0x55faaf=_0x465ff3[_0xa353('0x51')];logger[_0xa353('0x66')](_0xa353('0x67'),_0x55faaf);if(!_[_0xa353('0x65')](_0x465ff3[_0xa353('0x51')])&&fs[_0xa353('0x54')](_0x55faaf)){logger[_0xa353('0x66')](_0xa353('0x68')+_0x55faaf+_0xa353('0x69'));fs[_0xa353('0x6a')](_0x55faaf);}_0x55faaf=_0x55faaf+'.cypher';if(!_[_0xa353('0x65')](_0x465ff3[_0xa353('0x51')])&&fs[_0xa353('0x54')](_0x55faaf)){logger[_0xa353('0x66')]('File:\x20\x22'+_0x55faaf+_0xa353('0x69'));fs[_0xa353('0x6a')](_0x55faaf);}return _0x465ff3;})['then'](function(_0x41a497){if(!_0x41a497)throw new InternalError();return _0x41a497[_0xa353('0x64')]();})[_0xa353('0x27')](function(){_0xc1897e[_0xa353('0x1b')](0xcc)['end']();})[_0xa353('0x46')](handleError(_0xc1897e,null));};function getBucketslist(_0x397ce7,_0x53648c,_0x5d9494){return new Promise(function(_0x2b419d,_0x4ea9db){var _0x38e986=new AWS['S3']({'accessKeyId':_0x53648c,'secretAccessKey':_0x397ce7,'region':_0x5d9494});_0x38e986[_0xa353('0x6b')]({},function(_0x2cff01,_0x3b39ad){if(_0x2cff01){return _0x4ea9db(_0x2cff01);}else{return _0x2b419d(_0x3b39ad);}});});}function createBucket(_0x5a2326,_0x69b678,_0x5dfaf7,_0x4cd100){return new Promise(function(_0x25bf1a,_0x247413){var _0x511b1d=new AWS['S3']({'accessKeyId':_0x69b678,'secretAccessKey':_0x5a2326,'region':_0x5dfaf7});_0x511b1d['createBucket']({'Bucket':_0x4cd100},function(_0x23e725,_0x2d6c0f){if(_0x23e725){return _0x247413(_0x23e725);}else{return _0x25bf1a(_0x2d6c0f);}});});}function uploadFile(_0x5b1fdc,_0x587d4f,_0x18cc2a,_0x13b672,_0x288b3a,_0x15e8de){return new Promise(function(_0x31fca4,_0x18de21){var _0x3870d7=new AWS['S3']({'accessKeyId':_0x587d4f,'secretAccessKey':_0x5b1fdc,'region':_0x18cc2a});_0x3870d7[_0xa353('0x6c')]({'Bucket':_0x13b672,'Key':_0x288b3a,'Body':_0x15e8de},function(_0x18b2b3,_0x213946){if(_0x18b2b3){return _0x18de21(_0x18b2b3);}else{return _0x31fca4(_0x213946);}});});}function startTranscribe(_0x560164,_0x5ecf71,_0x569e85,_0x5a2766,_0x9c1d1a,_0x3e518a){return new Promise(function(_0x2e1f7b,_0x1fce8c){var _0x5b5edb=new AWS['TranscribeService']({'accessKeyId':_0x5ecf71,'secretAccessKey':_0x560164,'region':_0x569e85});_0x5b5edb[_0xa353('0x6d')]({'TranscriptionJobName':_0x5a2766,'LanguageCode':_0x9c1d1a,'Media':{'MediaFileUri':_0x3e518a}},function(_0x12df79,_0x4d6795){if(_0x12df79){return _0x1fce8c(_0x12df79);}else{return _0x2e1f7b(_0x4d6795);}});});}function transcribe(_0x27b87b,_0x2c7cb7,_0xa2776f,_0x4db9b8,_0x3c90ac,_0x37f994,_0x47ce56){return new Promise(function(_0x57fe74,_0x34416c){var _0x14e4c4={};logger['info'](util[_0xa353('0x52')](_0xa353('0x6e'),_0x27b87b,_0x3c90ac));return uploadFile(_0x2c7cb7,_0xa2776f,_0x4db9b8,_0x3c90ac,path[_0xa353('0x6f')](_0x37f994),fs[_0xa353('0x70')](_0x37f994))[_0xa353('0x27')](function(_0xd3023d){logger[_0xa353('0x66')](util[_0xa353('0x52')](_0xa353('0x71'),_0x27b87b,_0x3c90ac,_0xd3023d['Location']));_0x14e4c4[_0xa353('0x72')]=_0xd3023d[_0xa353('0x73')];_0x14e4c4['location']=_0xd3023d[_0xa353('0x74')];logger['info'](util[_0xa353('0x52')](_0xa353('0x75'),_0x27b87b));return startTranscribe(_0x2c7cb7,_0xa2776f,_0x4db9b8,uuidv4(),_0x47ce56,_0xd3023d[_0xa353('0x74')]);})[_0xa353('0x27')](function(_0x14859f){logger['info'](util[_0xa353('0x52')](_0xa353('0x76'),_0x27b87b,_0x14859f[_0xa353('0x77')][_0xa353('0x78')]));_0x14e4c4['transcribeName']=_0x14859f['TranscriptionJob']['TranscriptionJobName'];_0x14e4c4[_0xa353('0x79')]=_0x14859f[_0xa353('0x77')][_0xa353('0x7a')];return _0x57fe74(_0x14e4c4);})[_0xa353('0x46')](function(_0x36180b){return _0x34416c(_0x36180b);});});}exports[_0xa353('0x7b')]=function(_0xbe6f61,_0x159dd9,_0x4df217){var _0x23c6ee;var _0x8dd17;var _0xf3f50a;var _0x339760=require('../../components/encryptor');return db['VoiceRecording'][_0xa353('0x7c')]({'where':{'id':_0xbe6f61[_0xa353('0x48')]['id']}})[_0xa353('0x27')](function(_0x3e7df9){if(_0x3e7df9){var _0x4f13ec=util['format']('%s.cypher',_0x3e7df9[_0xa353('0x51')]);if(fs['existsSync'](_0x4f13ec)){cypher=!![];return _0x339760[_0xa353('0x62')](_0x4f13ec,_0x3e7df9[_0xa353('0x51')],config[_0xa353('0x55')]['recording'])['then'](function(){return _0x3e7df9;});}return _0x3e7df9;}})['then'](function(_0x25b01a){if(!_0x25b01a){throw new db[(_0xa353('0x57'))][(_0xa353('0x58'))](_0xa353('0x7d'));}_0x8dd17=_0x25b01a;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xa353('0x27')](handleEntityNotFound(_0x159dd9,null))[_0xa353('0x27')](function(_0xf6e08c){if(_0xf6e08c){_0x23c6ee=_0xf6e08c;if(!_0x23c6ee['transcribe']||!_0x23c6ee[_0xa353('0x7e')]||!_0x23c6ee[_0xa353('0x7f')]||!_0x23c6ee[_0xa353('0x80')]||!_0x23c6ee[_0xa353('0x72')]){throw new db[(_0xa353('0x57'))]['ValidationError'](_0xa353('0x81'));}if(_0xbe6f61[_0xa353('0x4a')][_0xa353('0x82')]&&(!_0x23c6ee[_0xa353('0x83')]||!_0x23c6ee[_0xa353('0x84')]||!_0x23c6ee['sentimentRegion']||!_0x23c6ee[_0xa353('0x80')]||!_0x23c6ee[_0xa353('0x72')])){throw new db[(_0xa353('0x57'))][(_0xa353('0x58'))](_0xa353('0x85'));}return db['CloudProvider']['findOne']({'where':{'id':_0x23c6ee[_0xa353('0x7e')]}});}})[_0xa353('0x27')](function(_0x23a49c){if(!_0x23a49c){throw new db[(_0xa353('0x57'))][(_0xa353('0x58'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x23a49c[_0xa353('0x86')]||!_0x23a49c[_0xa353('0x87')]){throw new db[(_0xa353('0x57'))][(_0xa353('0x58'))](_0xa353('0x88'));}_0xf3f50a=_0x23a49c;return getBucketslist(_0xf3f50a[_0xa353('0x86')],_0xf3f50a[_0xa353('0x87')],_0x23c6ee['transcribeRegion']);})['then'](function(_0x4716d5){if(_0x4716d5&&_0x4716d5[_0xa353('0x89')]){var _0x44f855=_['find'](_0x4716d5['Buckets'],function(_0x43cab1){return _0x43cab1[_0xa353('0x8a')]===_0x23c6ee[_0xa353('0x72')];});if(!_0x44f855){logger[_0xa353('0x66')](util['format'](_0xa353('0x8b'),_0xbe6f61[_0xa353('0x48')]['id'],_0x23c6ee[_0xa353('0x72')]));return createBucket(_0xf3f50a[_0xa353('0x86')],_0xf3f50a[_0xa353('0x87')],_0x23c6ee[_0xa353('0x7f')],_0x23c6ee['bucket']);}logger[_0xa353('0x66')](util['format'](_0xa353('0x8c'),_0xbe6f61[_0xa353('0x48')]['id'],_0x23c6ee[_0xa353('0x72')]));return;}})[_0xa353('0x27')](function(_0x2bb643){if(_0x8dd17['transcribeStatus']===_0xa353('0x8d')){return transcribe(_0xbe6f61[_0xa353('0x48')]['id'],_0xf3f50a[_0xa353('0x86')],_0xf3f50a[_0xa353('0x87')],_0x23c6ee[_0xa353('0x7f')],_0x23c6ee[_0xa353('0x72')],_0x8dd17[_0xa353('0x51')],_0x23c6ee[_0xa353('0x80')]);}else{logger[_0xa353('0x66')](util['format'](_0xa353('0x8e'),_0xbe6f61[_0xa353('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x335f57){if(_0x335f57){_0x335f57[_0xa353('0x8f')]=_0xbe6f61['body'][_0xa353('0x82')];return _0x8dd17['updateAttributes'](_0x335f57);}})['then'](respondWithResult(_0x159dd9,null))['catch'](handleError(_0x159dd9,null));};function writeFile(_0x4867fc,_0x1a9a1e){return new Promise(function(_0x3d4d1f,_0x5f47b1){fs[_0xa353('0x90')](_0x1a9a1e,_0x4867fc,function(_0x1e533f,_0x33b3f4){if(_0x1e533f){return _0x5f47b1(_0x1e533f);}else{return _0x3d4d1f(_0x33b3f4);}});});}exports['downloadTranscribe']=function(_0x20d686,_0x10f605,_0x9ef18f){return db[_0xa353('0x2d')][_0xa353('0x7c')]({'where':{'id':_0x20d686[_0xa353('0x48')]['id']}})[_0xa353('0x27')](handleEntityNotFound(_0x10f605))[_0xa353('0x27')](function(_0x3ef736){if(_0x3ef736&&_0x3ef736[_0xa353('0x91')]){var _0x375bba=_0x3ef736[_0xa353('0x91')];var _0x1f080d=config[_0xa353('0x92')]+_0xa353('0x93')+_0x3ef736['id']+'.txt';if(fs['existsSync'](_0x1f080d)){return _0x1f080d;}return writeFile(_0x375bba,_0x1f080d)[_0xa353('0x27')](function(){return _0x1f080d;});}else{throw new db[(_0xa353('0x57'))]['ValidationError'](_0xa353('0x94'));}})[_0xa353('0x27')](function(_0x11750c){return _0x10f605[_0xa353('0x4d')](_0x11750c);})[_0xa353('0x46')](handleError(_0x10f605));}; \ No newline at end of file +var _0x0212=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','catch','params','options','find','create','body','describe','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','secrets','extname','download','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','end','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','ValidationError','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0212,0x7d));var _0x2021=function(_0x536669,_0x2e13cb){_0x536669=_0x536669-0x0;var _0x3a51c7=_0x0212[_0x536669];return _0x3a51c7;};'use strict';var emlformat=require(_0x2021('0x0'));var rimraf=require(_0x2021('0x1'));var zipdir=require(_0x2021('0x2'));var jsonpatch=require(_0x2021('0x3'));var rp=require(_0x2021('0x4'));var moment=require(_0x2021('0x5'));var BPromise=require(_0x2021('0x6'));var Mustache=require(_0x2021('0x7'));var util=require('util');var path=require(_0x2021('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2021('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2021('0xa'));var squel=require(_0x2021('0xb'));var crypto=require(_0x2021('0xc'));var jsforce=require(_0x2021('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2021('0xe'));var querystring=require(_0x2021('0xf'));var Papa=require(_0x2021('0x10'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x2021('0x11'));var authService=require(_0x2021('0x12'));var qs=require(_0x2021('0x13'));var as=require(_0x2021('0x14'));var hardwareService=require(_0x2021('0x15'));var logger=require('../../config/logger')(_0x2021('0x16'));var utils=require(_0x2021('0x17'));var config=require(_0x2021('0x18'));var licenseUtil=require(_0x2021('0x19'));var db=require(_0x2021('0x1a'))['db'];function respondWithStatusCode(_0x272373,_0x43323f){_0x43323f=_0x43323f||0xcc;return function(_0x289822){if(_0x289822){return _0x272373[_0x2021('0x1b')](_0x43323f);}return _0x272373[_0x2021('0x1c')](_0x43323f)['end']();};}function respondWithResult(_0x4b0277,_0x113b93){_0x113b93=_0x113b93||0xc8;return function(_0x15d8ac){if(_0x15d8ac){return _0x4b0277[_0x2021('0x1c')](_0x113b93)[_0x2021('0x1d')](_0x15d8ac);}};}function respondWithFilteredResult(_0x3c1986,_0x1ed47a){return function(_0x8026db){if(_0x8026db){var _0x4d809b=typeof _0x1ed47a[_0x2021('0x1e')]===_0x2021('0x1f')&&typeof _0x1ed47a[_0x2021('0x20')]===_0x2021('0x1f');var _0x3f0154=_0x8026db[_0x2021('0x21')];var _0x23bc53=_0x4d809b?0x0:_0x1ed47a[_0x2021('0x1e')];var _0x5131a9=_0x4d809b?_0x8026db['count']:_0x1ed47a['offset']+_0x1ed47a[_0x2021('0x20')];var _0x486b58;if(_0x5131a9>=_0x3f0154){_0x5131a9=_0x3f0154;_0x486b58=0xc8;}else{_0x486b58=0xce;}_0x3c1986[_0x2021('0x1c')](_0x486b58);return _0x3c1986[_0x2021('0x22')]('Content-Range',_0x23bc53+'-'+_0x5131a9+'/'+_0x3f0154)[_0x2021('0x1d')](_0x8026db);}return null;};}function patchUpdates(_0x37f6de){return function(_0x15dc20){try{jsonpatch[_0x2021('0x23')](_0x15dc20,_0x37f6de,!![]);}catch(_0x248e27){return BPromise[_0x2021('0x24')](_0x248e27);}return _0x15dc20[_0x2021('0x25')]();};}function saveUpdates(_0xda0c97,_0x4c3864){return function(_0x5e970b){if(_0x5e970b){return _0x5e970b[_0x2021('0x26')](_0xda0c97)[_0x2021('0x27')](function(_0x364a7e){return _0x364a7e;});}return null;};}function removeEntity(_0x4c8d04,_0x32a546){return function(_0x57eae8){if(_0x57eae8){return _0x57eae8[_0x2021('0x28')]()[_0x2021('0x27')](function(){_0x4c8d04[_0x2021('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104bfc,_0x6c4ad6){return function(_0x5b51e9){if(!_0x5b51e9){_0x104bfc[_0x2021('0x1b')](0x194);}return _0x5b51e9;};}function handleError(_0x5ecd22,_0x4832b4){_0x4832b4=_0x4832b4||0x1f4;return function(_0x2880ec){logger[_0x2021('0x29')](_0x2880ec['stack']);if(_0x2880ec[_0x2021('0x2a')]){delete _0x2880ec[_0x2021('0x2a')];}_0x5ecd22[_0x2021('0x1c')](_0x4832b4)[_0x2021('0x2b')](_0x2880ec);};}exports[_0x2021('0x2c')]=function(_0xe67143,_0x356b76){var _0x3859d1={},_0x319f3a={},_0x2a9354={'count':0x0,'rows':[]};var _0x57a652=_[_0x2021('0x2d')](db[_0x2021('0x2e')][_0x2021('0x2f')],function(_0x2c1e68){return{'name':_0x2c1e68['fieldName'],'type':_0x2c1e68[_0x2021('0x30')][_0x2021('0x31')]};});_0x319f3a[_0x2021('0x32')]=_[_0x2021('0x33')](_[_0x2021('0x2d')](_0x57a652,_0x2021('0x2a')),[_0x2021('0x34')]);_0x319f3a[_0x2021('0x35')]=_[_0x2021('0x36')](_0xe67143['query']);_0x319f3a[_0x2021('0x37')]=_[_0x2021('0x38')](_0x319f3a['model'],_0x319f3a[_0x2021('0x35')]);_0x3859d1[_0x2021('0x39')]=_[_0x2021('0x38')](_0x319f3a[_0x2021('0x32')],qs[_0x2021('0x3a')](_0xe67143[_0x2021('0x35')]['fields']));_0x3859d1['attributes']=_0x3859d1[_0x2021('0x39')][_0x2021('0x3b')]?_0x3859d1['attributes']:_0x319f3a[_0x2021('0x32')];if(!_0xe67143[_0x2021('0x35')][_0x2021('0x3c')]('nolimit')){_0x3859d1[_0x2021('0x20')]=qs[_0x2021('0x20')](_0xe67143[_0x2021('0x35')][_0x2021('0x20')]);_0x3859d1['offset']=qs['offset'](_0xe67143[_0x2021('0x35')][_0x2021('0x1e')]);}_0x3859d1[_0x2021('0x3d')]=qs[_0x2021('0x3e')](_0xe67143['query']['sort']);_0x3859d1[_0x2021('0x3f')]=qs[_0x2021('0x37')](_['pick'](_0xe67143['query'],_0x319f3a[_0x2021('0x37')]),_0x57a652);if(_0xe67143[_0x2021('0x35')][_0x2021('0x40')]){_0x3859d1[_0x2021('0x3f')]=_[_0x2021('0x41')](_0x3859d1[_0x2021('0x3f')],{'$or':_[_0x2021('0x2d')](_0x57a652,function(_0x4c941d){if(_0x4c941d[_0x2021('0x30')]!=='VIRTUAL'){var _0x107efd={};_0x107efd[_0x4c941d[_0x2021('0x2a')]]={'$like':'%'+_0xe67143[_0x2021('0x35')][_0x2021('0x40')]+'%'};return _0x107efd;}})});}_0x3859d1=_[_0x2021('0x41')]({},_0x3859d1,_0xe67143['options']);var _0x5da7c0={'where':_0x3859d1['where']};return db[_0x2021('0x2e')][_0x2021('0x21')](_0x5da7c0)[_0x2021('0x27')](function(_0x1cc9b1){_0x2a9354[_0x2021('0x21')]=_0x1cc9b1;if(_0xe67143[_0x2021('0x35')][_0x2021('0x42')]){_0x3859d1[_0x2021('0x43')]=[{'all':!![]}];}return db[_0x2021('0x2e')]['findAll'](_0x3859d1);})[_0x2021('0x27')](function(_0x39dff4){_0x2a9354['rows']=_0x39dff4;return _0x2a9354;})['then'](respondWithFilteredResult(_0x356b76,_0x3859d1))[_0x2021('0x44')](handleError(_0x356b76,null));};exports['show']=function(_0xac968f,_0x5cd58c){var _0x3c882f={'raw':![],'where':{'id':_0xac968f[_0x2021('0x45')]['id']}},_0x448053={};_0x448053[_0x2021('0x32')]=_[_0x2021('0x36')](db[_0x2021('0x2e')][_0x2021('0x2f')]);_0x448053[_0x2021('0x35')]=_[_0x2021('0x36')](_0xac968f['query']);_0x448053[_0x2021('0x37')]=_['intersection'](_0x448053[_0x2021('0x32')],_0x448053[_0x2021('0x35')]);_0x3c882f[_0x2021('0x39')]=_['intersection'](_0x448053[_0x2021('0x32')],qs[_0x2021('0x3a')](_0xac968f[_0x2021('0x35')][_0x2021('0x3a')]));_0x3c882f[_0x2021('0x39')]=_0x3c882f[_0x2021('0x39')][_0x2021('0x3b')]?_0x3c882f[_0x2021('0x39')]:_0x448053[_0x2021('0x32')];if(_0xac968f[_0x2021('0x35')]['includeAll']){_0x3c882f[_0x2021('0x43')]=[{'all':!![]}];}_0x3c882f=_['merge']({},_0x3c882f,_0xac968f[_0x2021('0x46')]);return db[_0x2021('0x2e')][_0x2021('0x47')](_0x3c882f)[_0x2021('0x27')](handleEntityNotFound(_0x5cd58c,null))['then'](respondWithResult(_0x5cd58c,null))[_0x2021('0x44')](handleError(_0x5cd58c,null));};exports['create']=function(_0x1b9726,_0x5a4278){return db[_0x2021('0x2e')][_0x2021('0x48')](_0x1b9726[_0x2021('0x49')],{})['then'](respondWithResult(_0x5a4278,0xc9))['catch'](handleError(_0x5a4278,null));};exports['update']=function(_0x567cc1,_0x2ad1f0){if(_0x567cc1['body']['id']){delete _0x567cc1[_0x2021('0x49')]['id'];}return db[_0x2021('0x2e')][_0x2021('0x47')]({'where':{'id':_0x567cc1['params']['id']}})[_0x2021('0x27')](handleEntityNotFound(_0x2ad1f0,null))[_0x2021('0x27')](saveUpdates(_0x567cc1[_0x2021('0x49')],null))['then'](respondWithResult(_0x2ad1f0,null))[_0x2021('0x44')](handleError(_0x2ad1f0,null));};exports[_0x2021('0x4a')]=function(_0x1d92ba,_0x203c68){return db['VoiceRecording'][_0x2021('0x4a')]()[_0x2021('0x27')](respondWithResult(_0x203c68,null))[_0x2021('0x44')](handleError(_0x203c68,null));};exports['download']=function(_0x676c5a,_0x291aa5,_0x491ba6){var _0x3ac608=require('../../components/encryptor');var _0x56b0d4=![];var _0x5be6ed={};if(_0x676c5a[_0x2021('0x35')]['type']&&_0x676c5a['query'][_0x2021('0x30')]===_0x2021('0x4b')){_0x5be6ed[_0x2021('0x4b')]=_0x676c5a[_0x2021('0x45')]['id'];}else{_0x5be6ed['id']=_0x676c5a[_0x2021('0x45')]['id'];}return db[_0x2021('0x2e')][_0x2021('0x47')]({'where':_0x5be6ed,'attributes':['id',_0x2021('0x4c')],'raw':!![]})[_0x2021('0x27')](handleEntityNotFound(_0x291aa5,null))[_0x2021('0x27')](function(_0x2e8074){if(_0x2e8074){var _0x26a889=_0x2e8074[_0x2021('0x4c')];var _0x5b277e=util[_0x2021('0x34')](_0x2021('0x4d'),_0x26a889);if(fs[_0x2021('0x4e')](_0x5b277e)){_0x56b0d4=!![];return _0x3ac608[_0x2021('0x4f')](_0x5b277e,_0x26a889,config['secrets'][_0x2021('0x50')])[_0x2021('0x27')](function(){return _0x2e8074;});}return _0x2e8074;}})['then'](function(_0x310a08){if(_0x310a08){var _0x26c683=_0x310a08[_0x2021('0x4c')];if(!fs[_0x2021('0x4e')](_0x26c683)){throw new db[(_0x2021('0x51'))]['ValidationError'](_0x2021('0x52'));}if(_0x310a08[_0x2021('0x53')]){return _0x291aa5['download'](_0x26c683,_0x310a08[_0x2021('0x53')]+path['extname'](_0x26c683),function(){if(_0x56b0d4){fs['unlink'](_0x26c683);}});}else{return _0x291aa5['download'](_0x26c683,function(_0x393ea1){if(_0x56b0d4){fs[_0x2021('0x54')](_0x26c683);}});}}})[_0x2021('0x44')](function(_0x49c8e4){if(_0x49c8e4[_0x2021('0x55')]===_0x2021('0x52')){_0x291aa5[_0x2021('0x1c')](0x194)[_0x2021('0x2b')](_0x2021('0x56'));}else{return handleError(_0x291aa5,null);}});};exports[_0x2021('0x57')]=function(_0x30b582,_0x5d4338,_0x21ab6d){var _0x3bbc83=require('../../components/encryptor');var _0x3decf8=![];var _0x506656={'$and':[db['sequelize'][_0x2021('0x3f')](db[_0x2021('0x58')]['fn']('MD5',db[_0x2021('0x58')][_0x2021('0x59')]('uniqueid')),_0x30b582[_0x2021('0x35')][_0x2021('0x5a')])]};if(_0x30b582[_0x2021('0x35')]['type']&&_0x30b582[_0x2021('0x35')]['type']===_0x2021('0x4b')){_0x506656[_0x2021('0x5b')][_0x2021('0x5c')]({'uniqueid':_0x30b582['params']['id']});}else{_0x506656['$and']['push']({'id':_0x30b582[_0x2021('0x45')]['id']});}return db[_0x2021('0x2e')][_0x2021('0x47')]({'where':_0x506656,'attributes':['id',_0x2021('0x4c')],'raw':!![]})[_0x2021('0x27')](handleEntityNotFound(_0x5d4338,null))[_0x2021('0x27')](function(_0x3c7205){if(_0x3c7205){var _0x387a52=util[_0x2021('0x34')]('%s.cypher',_0x3c7205[_0x2021('0x4c')]);if(fs[_0x2021('0x4e')](_0x387a52)){_0x3decf8=!![];return _0x3bbc83[_0x2021('0x4f')](_0x387a52,_0x3c7205[_0x2021('0x4c')],config[_0x2021('0x5d')][_0x2021('0x50')])[_0x2021('0x27')](function(){return _0x3c7205;});}return _0x3c7205;}})[_0x2021('0x27')](function(_0x26c2ba){if(_0x26c2ba){if(!fs[_0x2021('0x4e')](_0x26c2ba[_0x2021('0x4c')])){throw new db[(_0x2021('0x51'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x26c2ba[_0x2021('0x53')]){return _0x5d4338['download'](_0x26c2ba['value'],_0x26c2ba[_0x2021('0x53')]+path[_0x2021('0x5e')](_0x26c2ba[_0x2021('0x4c')]),function(){if(_0x3decf8){fs[_0x2021('0x54')](_0x26c2ba[_0x2021('0x4c')]);}});}else{return _0x5d4338[_0x2021('0x5f')](_0x26c2ba['value'],function(_0xd71ca4){if(_0x3decf8){fs[_0x2021('0x54')](_0x26c2ba[_0x2021('0x4c')]);}});}}})[_0x2021('0x44')](handleError(_0x5d4338,null));};exports['destroy']=function(_0x447a96,_0x4f1692){return db[_0x2021('0x2e')][_0x2021('0x47')]({'where':{'id':_0x447a96[_0x2021('0x45')]['id']}})[_0x2021('0x27')](function(_0x1ecd9e){if(_[_0x2021('0x60')](_0x1ecd9e)){throw new ReferenceError(_0x2021('0x61'));}return _0x1ecd9e;})[_0x2021('0x27')](function(_0x806810){var _0x332930=_0x806810['value'];logger[_0x2021('0x62')](_0x2021('0x63'),_0x332930);if(!_[_0x2021('0x60')](_0x806810[_0x2021('0x4c')])&&fs['existsSync'](_0x332930)){logger[_0x2021('0x62')]('File:\x20\x22'+_0x332930+_0x2021('0x64'));fs[_0x2021('0x65')](_0x332930);}_0x332930=_0x332930+_0x2021('0x66');if(!_['isNil'](_0x806810[_0x2021('0x4c')])&&fs['existsSync'](_0x332930)){logger[_0x2021('0x62')](_0x2021('0x67')+_0x332930+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2021('0x65')](_0x332930);}return _0x806810;})[_0x2021('0x27')](function(_0x1736d2){if(!_0x1736d2)throw new InternalError();return _0x1736d2[_0x2021('0x28')]();})['then'](function(){_0x4f1692[_0x2021('0x1c')](0xcc)[_0x2021('0x68')]();})[_0x2021('0x44')](handleError(_0x4f1692,null));};function getBucketslist(_0x200ee2,_0x5778cd,_0x43acdd){return new Promise(function(_0x57d363,_0x9d0cec){var _0x41f309=new AWS['S3']({'accessKeyId':_0x5778cd,'secretAccessKey':_0x200ee2,'region':_0x43acdd});_0x41f309[_0x2021('0x69')]({},function(_0xc414c3,_0x4dfc7c){if(_0xc414c3){return _0x9d0cec(_0xc414c3);}else{return _0x57d363(_0x4dfc7c);}});});}function createBucket(_0xede7d6,_0x27332b,_0x135718,_0x48e2e5){return new Promise(function(_0x1d3e6a,_0x4a8d73){var _0x509180=new AWS['S3']({'accessKeyId':_0x27332b,'secretAccessKey':_0xede7d6,'region':_0x135718});_0x509180[_0x2021('0x6a')]({'Bucket':_0x48e2e5},function(_0x3aed4b,_0xcaab05){if(_0x3aed4b){return _0x4a8d73(_0x3aed4b);}else{return _0x1d3e6a(_0xcaab05);}});});}function uploadFile(_0x2ffa99,_0x246485,_0x35c4b8,_0x5054a0,_0x6972ef,_0x2af8d5){return new Promise(function(_0x2547fa,_0x532a80){var _0xc6e94f=new AWS['S3']({'accessKeyId':_0x246485,'secretAccessKey':_0x2ffa99,'region':_0x35c4b8});_0xc6e94f['upload']({'Bucket':_0x5054a0,'Key':_0x6972ef,'Body':_0x2af8d5},function(_0x528fad,_0x410fe1){if(_0x528fad){return _0x532a80(_0x528fad);}else{return _0x2547fa(_0x410fe1);}});});}function startTranscribe(_0x5906e6,_0x9e6f30,_0x6a2f2e,_0x59bbbe,_0x299967,_0x44d491){return new Promise(function(_0x170b35,_0x4487f2){var _0x3b41fc=new AWS[(_0x2021('0x6b'))]({'accessKeyId':_0x9e6f30,'secretAccessKey':_0x5906e6,'region':_0x6a2f2e});_0x3b41fc['startTranscriptionJob']({'TranscriptionJobName':_0x59bbbe,'LanguageCode':_0x299967,'Media':{'MediaFileUri':_0x44d491}},function(_0x324927,_0x4ea3ee){if(_0x324927){return _0x4487f2(_0x324927);}else{return _0x170b35(_0x4ea3ee);}});});}function transcribe(_0x54a043,_0x4a5279,_0x2ec2f2,_0x16107b,_0x45b2e9,_0x548ad1,_0x5ea617){return new Promise(function(_0x11bcb7,_0x51b865){var _0x13e95e={};logger['info'](util['format'](_0x2021('0x6c'),_0x54a043,_0x45b2e9));return uploadFile(_0x4a5279,_0x2ec2f2,_0x16107b,_0x45b2e9,path[_0x2021('0x6d')](_0x548ad1),fs['readFileSync'](_0x548ad1))[_0x2021('0x27')](function(_0x14c702){logger['info'](util[_0x2021('0x34')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x54a043,_0x45b2e9,_0x14c702[_0x2021('0x6e')]));_0x13e95e[_0x2021('0x6f')]=_0x14c702[_0x2021('0x70')];_0x13e95e[_0x2021('0x71')]=_0x14c702['Location'];logger[_0x2021('0x62')](util['format'](_0x2021('0x72'),_0x54a043));return startTranscribe(_0x4a5279,_0x2ec2f2,_0x16107b,uuidv4(),_0x5ea617,_0x14c702[_0x2021('0x6e')]);})[_0x2021('0x27')](function(_0x4557b1){logger[_0x2021('0x62')](util[_0x2021('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x54a043,_0x4557b1[_0x2021('0x73')][_0x2021('0x74')]));_0x13e95e[_0x2021('0x75')]=_0x4557b1[_0x2021('0x73')][_0x2021('0x74')];_0x13e95e[_0x2021('0x76')]=_0x4557b1[_0x2021('0x73')][_0x2021('0x77')];return _0x11bcb7(_0x13e95e);})[_0x2021('0x44')](function(_0x4aba07){return _0x51b865(_0x4aba07);});});}exports[_0x2021('0x78')]=function(_0x148fb0,_0x1f819c,_0x27d060){var _0x5f4e3e;var _0xefa722;var _0x4b2d9b;var _0xa9c71c=require(_0x2021('0x79'));return db[_0x2021('0x2e')][_0x2021('0x7a')]({'where':{'id':_0x148fb0['params']['id']}})[_0x2021('0x27')](function(_0x47d21a){if(_0x47d21a){var _0x5e2b95=util['format'](_0x2021('0x4d'),_0x47d21a['value']);if(fs[_0x2021('0x4e')](_0x5e2b95)){cypher=!![];return _0xa9c71c[_0x2021('0x4f')](_0x5e2b95,_0x47d21a[_0x2021('0x4c')],config['secrets']['recording'])[_0x2021('0x27')](function(){return _0x47d21a;});}return _0x47d21a;}})['then'](function(_0x2c7a6c){if(!_0x2c7a6c){throw new db[(_0x2021('0x51'))][(_0x2021('0x7b'))](_0x2021('0x7c'));}_0xefa722=_0x2c7a6c;return db['Setting'][_0x2021('0x7a')]({'where':{'id':0x1}});})[_0x2021('0x27')](handleEntityNotFound(_0x1f819c,null))['then'](function(_0x3c0670){if(_0x3c0670){_0x5f4e3e=_0x3c0670;if(!_0x5f4e3e['transcribe']||!_0x5f4e3e[_0x2021('0x7d')]||!_0x5f4e3e[_0x2021('0x7e')]||!_0x5f4e3e[_0x2021('0x7f')]||!_0x5f4e3e[_0x2021('0x6f')]){throw new db[(_0x2021('0x51'))]['ValidationError'](_0x2021('0x80'));}if(_0x148fb0[_0x2021('0x49')][_0x2021('0x81')]&&(!_0x5f4e3e[_0x2021('0x82')]||!_0x5f4e3e[_0x2021('0x83')]||!_0x5f4e3e[_0x2021('0x84')]||!_0x5f4e3e[_0x2021('0x7f')]||!_0x5f4e3e[_0x2021('0x6f')])){throw new db[(_0x2021('0x51'))]['ValidationError'](_0x2021('0x85'));}return db['CloudProvider'][_0x2021('0x7a')]({'where':{'id':_0x5f4e3e[_0x2021('0x7d')]}});}})[_0x2021('0x27')](function(_0x4a7e4d){if(!_0x4a7e4d){throw new db[(_0x2021('0x51'))][(_0x2021('0x7b'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4a7e4d[_0x2021('0x86')]||!_0x4a7e4d[_0x2021('0x87')]){throw new db[(_0x2021('0x51'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x4b2d9b=_0x4a7e4d;return getBucketslist(_0x4b2d9b[_0x2021('0x86')],_0x4b2d9b['data2'],_0x5f4e3e[_0x2021('0x7e')]);})['then'](function(_0x5d6503){if(_0x5d6503&&_0x5d6503[_0x2021('0x88')]){var _0x2df77f=_['find'](_0x5d6503['Buckets'],function(_0x31aa5a){return _0x31aa5a[_0x2021('0x89')]===_0x5f4e3e[_0x2021('0x6f')];});if(!_0x2df77f){logger[_0x2021('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x148fb0[_0x2021('0x45')]['id'],_0x5f4e3e[_0x2021('0x6f')]));return createBucket(_0x4b2d9b[_0x2021('0x86')],_0x4b2d9b[_0x2021('0x87')],_0x5f4e3e[_0x2021('0x7e')],_0x5f4e3e[_0x2021('0x6f')]);}logger[_0x2021('0x62')](util[_0x2021('0x34')](_0x2021('0x8a'),_0x148fb0[_0x2021('0x45')]['id'],_0x5f4e3e[_0x2021('0x6f')]));return;}})['then'](function(_0x5800ab){if(_0xefa722['transcribeStatus']===_0x2021('0x8b')){return transcribe(_0x148fb0['params']['id'],_0x4b2d9b[_0x2021('0x86')],_0x4b2d9b[_0x2021('0x87')],_0x5f4e3e[_0x2021('0x7e')],_0x5f4e3e[_0x2021('0x6f')],_0xefa722[_0x2021('0x4c')],_0x5f4e3e['language']);}else{logger[_0x2021('0x62')](util[_0x2021('0x34')](_0x2021('0x8c'),_0x148fb0[_0x2021('0x45')]['id']));return{'transcribeStatus':_0x2021('0x8d')};}})['then'](function(_0x4c43d4){if(_0x4c43d4){_0x4c43d4[_0x2021('0x8e')]=_0x148fb0[_0x2021('0x49')][_0x2021('0x81')];return _0xefa722[_0x2021('0x8f')](_0x4c43d4);}})[_0x2021('0x27')](respondWithResult(_0x1f819c,null))[_0x2021('0x44')](handleError(_0x1f819c,null));};function writeFile(_0x266ca0,_0x1d1f3){return new Promise(function(_0x32a4da,_0xe4244b){fs['writeFile'](_0x1d1f3,_0x266ca0,function(_0x52368d,_0x5a590a){if(_0x52368d){return _0xe4244b(_0x52368d);}else{return _0x32a4da(_0x5a590a);}});});}exports[_0x2021('0x90')]=function(_0x165683,_0x159bdf,_0x1cd033){return db[_0x2021('0x2e')][_0x2021('0x7a')]({'where':{'id':_0x165683['params']['id']}})[_0x2021('0x27')](handleEntityNotFound(_0x159bdf))[_0x2021('0x27')](function(_0x2002d9){if(_0x2002d9&&_0x2002d9['fileText']){var _0x1f21c3=_0x2002d9[_0x2021('0x91')];var _0x3690c0=config[_0x2021('0x92')]+'/server/files/transcribes/transcribe_'+_0x2002d9['id']+_0x2021('0x93');if(fs[_0x2021('0x4e')](_0x3690c0)){return _0x3690c0;}return writeFile(_0x1f21c3,_0x3690c0)[_0x2021('0x27')](function(){return _0x3690c0;});}else{throw new db[(_0x2021('0x51'))][(_0x2021('0x7b'))]('Transcript\x20not\x20available');}})['then'](function(_0x531e56){return _0x159bdf[_0x2021('0x5f')](_0x531e56);})[_0x2021('0x44')](handleError(_0x159bdf));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8fbe248..30f5d24 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 _0xf7d6=['voice_recordings','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xb5e222,_0x431ee4){var _0xb8501a=function(_0x60a936){while(--_0x60a936){_0xb5e222['push'](_0xb5e222['shift']());}};_0xb8501a(++_0x431ee4);}(_0xf7d6,0x136));var _0x6f7d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf7d6[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6f7d('0x0'));var util=require(_0x6f7d('0x1'));var logger=require('../../config/logger')(_0x6f7d('0x2'));var moment=require('moment');var BPromise=require(_0x6f7d('0x3'));var rp=require(_0x6f7d('0x4'));var fs=require('fs');var path=require(_0x6f7d('0x5'));var rimraf=require(_0x6f7d('0x6'));var config=require(_0x6f7d('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x6f7d('0x8')]=function(_0x45da40,_0x44c0fe){return _0x45da40['define']('VoiceRecording',attributes,{'tableName':_0x6f7d('0x9'),'paranoid':![],'indexes':[{'name':_0x6f7d('0xa'),'fields':[_0x6f7d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b97=['bluebird','request-promise','rimraf','exports','VoiceRecording','uniqueid','lodash','util','moment'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x1b97,0x15c));var _0x71b9=function(_0x4f4597,_0x54f5a0){_0x4f4597=_0x4f4597-0x0;var _0x1ec5d1=_0x1b97[_0x4f4597];return _0x1ec5d1;};'use strict';var _=require(_0x71b9('0x0'));var util=require(_0x71b9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x71b9('0x2'));var BPromise=require(_0x71b9('0x3'));var rp=require(_0x71b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71b9('0x5'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0x71b9('0x6')]=function(_0xaaa54b,_0x3de7da){return _0xaaa54b['define'](_0x71b9('0x7'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x71b9('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index fec8a77..2519893 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 _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2ece5b,_0x1c2a47){var _0x145190=function(_0x2714c2){while(--_0x2714c2){_0x2ece5b['push'](_0x2ece5b['shift']());}};_0x145190(++_0x1c2a47);}(_0x2da6,0x1dd));var _0x62da=function(_0x46b52e,_0x5c2508){_0x46b52e=_0x46b52e-0x0;var _0x54604b=_0x2da6[_0x46b52e];return _0x54604b;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});}; \ No newline at end of file +var _0x33af=['error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4e90f0,_0x3b7e3c){var _0x1a2cee=function(_0xc0c5f5){while(--_0xc0c5f5){_0x4e90f0['push'](_0x4e90f0['shift']());}};_0x1a2cee(++_0x3b7e3c);}(_0x33af,0xec));var _0xf33a=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x33af[_0xbc4659];return _0x5831f9;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['update'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1a')]||null:null,'attributes':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null,'limit':_0x524109['options']?_0x524109[_0xf33a('0x18')][_0xf33a('0x1c')]||null:null})[_0xf33a('0xa')](function(_0x27faa1){logger[_0xf33a('0xb')]('UpdateVoiceRecording',_0x524109);logger[_0xf33a('0xe')]('UpdateVoiceRecording',_0x524109,JSON[_0xf33a('0xf')](_0x27faa1));_0x23d9e2(_0x27faa1);})[_0xf33a('0x14')](function(_0x394468){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x394468['message'],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x394468[_0xf33a('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4af24a){var _0x16ef31=this;return new Promise(function(_0x5f0a53,_0x5cf981){var _0x38eba2=require('../../components/encryptor');var _0x79d653;return db['Setting'][_0xf33a('0x1d')]({'attributes':['id',_0xf33a('0x1e')],'where':{'id':0x1},'raw':!![]})[_0xf33a('0xa')](function(_0x729fca){_0x79d653=_0x729fca;return db[_0xf33a('0x16')][_0xf33a('0x1f')](_0x4af24a[_0xf33a('0x17')]);})[_0xf33a('0xa')](function(_0x26e81){if(_0x79d653[_0xf33a('0x1e')]&&fs[_0xf33a('0x20')](_0x26e81[_0xf33a('0x21')])){var _0x22c9f2=util[_0xf33a('0x22')](_0xf33a('0x23'),_0x26e81['value']);return _0x38eba2[_0xf33a('0x24')](_0x26e81[_0xf33a('0x21')],_0x22c9f2,config[_0xf33a('0x25')][_0xf33a('0x26')])['then'](function(){fs[_0xf33a('0x27')](_0x26e81[_0xf33a('0x21')]);logger[_0xf33a('0xb')](_0xf33a('0x28'));return _0x26e81;});}return _0x26e81;})[_0xf33a('0xa')](function(_0x109d84){logger['info'](_0xf33a('0x29'),_0x4af24a);logger[_0xf33a('0xe')](_0xf33a('0x29'),_0x4af24a,JSON[_0xf33a('0xf')](_0x109d84));_0x5f0a53(_0x109d84);})[_0xf33a('0x14')](function(_0x57e7be){logger['error'](_0xf33a('0x29'),_0x57e7be['message'],_0x4af24a);_0x5cf981(_0x16ef31['error'](0x1f4,_0x57e7be['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b2f736a..45bb2f5 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 _0x470d=['get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','Router','../../config/environment','./voiceTransferReport.controller'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x470d,0x1ec));var _0xd470=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x470d[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd470('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd470('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd470('0x2'));var controller=require(_0xd470('0x3'));router[_0xd470('0x4')]('/',auth[_0xd470('0x5')](),controller['index']);router[_0xd470('0x4')]('/describe',auth[_0xd470('0x5')](),controller[_0xd470('0x6')]);router['get'](_0xd470('0x7'),auth[_0xd470('0x5')](),controller[_0xd470('0x8')]);router[_0xd470('0x9')]('/',auth[_0xd470('0x5')](),controller[_0xd470('0xa')]);router[_0xd470('0xb')](_0xd470('0x7'),auth[_0xd470('0x5')](),controller[_0xd470('0xc')]);router[_0xd470('0xd')]('/:id',auth[_0xd470('0x5')](),controller[_0xd470('0xe')]);module[_0xd470('0xf')]=router; \ No newline at end of file +var _0x608b=['describe','isAuthenticated','create','put','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','get'];(function(_0x506cbe,_0x818678){var _0x4fdaa7=function(_0x28db18){while(--_0x28db18){_0x506cbe['push'](_0x506cbe['shift']());}};_0x4fdaa7(++_0x818678);}(_0x608b,0x18e));var _0xb608=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x608b[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require('multer');var util=require(_0xb608('0x0'));var path=require(_0xb608('0x1'));var timeout=require(_0xb608('0x2'));var express=require(_0xb608('0x3'));var router=express[_0xb608('0x4')]();var fs_extra=require(_0xb608('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb608('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xb608('0x7')]);router[_0xb608('0x6')]('/:id',auth[_0xb608('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb608('0x9')]);router[_0xb608('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb608('0xb')]);router['delete'](_0xb608('0xc'),auth[_0xb608('0x8')](),controller[_0xb608('0xd')]);module[_0xb608('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 923a01a..29e1e9b 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 _0xed69=['STRING','moment','exports','ENUM','blind','attended'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xed69,0x8b));var _0x9ed6=function(_0x47bc58,_0x1e1998){_0x47bc58=_0x47bc58-0x0;var _0x4a0860=_0xed69[_0x47bc58];return _0x4a0860;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9ed6('0x0'));module[_0x9ed6('0x1')]={'type':{'type':Sequelize[_0x9ed6('0x2')](_0x9ed6('0x3'),_0x9ed6('0x4'))},'result':{'type':Sequelize[_0x9ed6('0x5')]},'transfererchannel':{'type':Sequelize[_0x9ed6('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x9ed6('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9ed6('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x9ed6('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x9ed6('0x5')]},'transfererexten':{'type':Sequelize[_0x9ed6('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x9ed6('0x5')]},'transfereechannel':{'type':Sequelize[_0x9ed6('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x9ed6('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x9ed6('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x9ed6('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x9ed6('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x9ed6('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x9ed6('0x5')]},'isexternal':{'type':Sequelize[_0x9ed6('0x2')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9ed6('0x5')]}}; \ No newline at end of file +var _0x6f7a=['sequelize','moment','exports','attended','STRING','ENUM','Yes'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x6f7a,0x17a));var _0xa6f7=function(_0x213584,_0x2a0d81){_0x213584=_0x213584-0x0;var _0x44ed12=_0x6f7a[_0x213584];return _0x44ed12;};'use strict';var Sequelize=require(_0xa6f7('0x0'));var moment=require(_0xa6f7('0x1'));module[_0xa6f7('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xa6f7('0x3'))},'result':{'type':Sequelize[_0xa6f7('0x4')]},'transfererchannel':{'type':Sequelize[_0xa6f7('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xa6f7('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa6f7('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa6f7('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xa6f7('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xa6f7('0x4')]},'transferercontext':{'type':Sequelize[_0xa6f7('0x4')]},'transfererexten':{'type':Sequelize[_0xa6f7('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa6f7('0x4')]},'transfereechannel':{'type':Sequelize[_0xa6f7('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xa6f7('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xa6f7('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xa6f7('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xa6f7('0x4')]},'transfereecontext':{'type':Sequelize[_0xa6f7('0x4')]},'transfereeexten':{'type':Sequelize[_0xa6f7('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xa6f7('0x5')](_0xa6f7('0x6'),'No')},'context':{'type':Sequelize[_0xa6f7('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b8dba44..0cc2d4c 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 _0x0364=['bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','show','params','rawAttributes','keys','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x120820,_0x4bdbb4){var _0x389f14=function(_0x1de3d8){while(--_0x1de3d8){_0x120820['push'](_0x120820['shift']());}};_0x389f14(++_0x4bdbb4);}(_0x0364,0x16d));var _0x4036=function(_0xa67e05,_0x27171d){_0xa67e05=_0xa67e05-0x0;var _0x19d799=_0x0364[_0xa67e05];return _0x19d799;};'use strict';var emlformat=require(_0x4036('0x0'));var rimraf=require(_0x4036('0x1'));var zipdir=require(_0x4036('0x2'));var jsonpatch=require(_0x4036('0x3'));var rp=require(_0x4036('0x4'));var moment=require('moment');var BPromise=require(_0x4036('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4036('0x6'));var sox=require(_0x4036('0x7'));var csv=require('to-csv');var ejs=require(_0x4036('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4036('0x9'));var squel=require('squel');var crypto=require(_0x4036('0xa'));var jsforce=require(_0x4036('0xb'));var deskjs=require(_0x4036('0xc'));var toCsv=require(_0x4036('0xd'));var querystring=require('querystring');var Papa=require(_0x4036('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4036('0xf'));var hardwareService=require(_0x4036('0x10'));var logger=require(_0x4036('0x11'))('api');var utils=require(_0x4036('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4036('0x13'));var db=require(_0x4036('0x14'))['db'];function respondWithStatusCode(_0x5a6590,_0x3ebdaf){_0x3ebdaf=_0x3ebdaf||0xcc;return function(_0xafe58c){if(_0xafe58c){return _0x5a6590[_0x4036('0x15')](_0x3ebdaf);}return _0x5a6590[_0x4036('0x16')](_0x3ebdaf)['end']();};}function respondWithResult(_0x8cdedd,_0x103253){_0x103253=_0x103253||0xc8;return function(_0x3c5333){if(_0x3c5333){return _0x8cdedd[_0x4036('0x16')](_0x103253)['json'](_0x3c5333);}};}function respondWithFilteredResult(_0xd0fa3e,_0x14f992){return function(_0x2e769a){if(_0x2e769a){var _0x1b0850=typeof _0x14f992[_0x4036('0x17')]===_0x4036('0x18')&&typeof _0x14f992[_0x4036('0x19')]===_0x4036('0x18');var _0x2111f7=_0x2e769a[_0x4036('0x1a')];var _0xf38a2d=_0x1b0850?0x0:_0x14f992[_0x4036('0x17')];var _0x5759f1=_0x1b0850?_0x2e769a[_0x4036('0x1a')]:_0x14f992[_0x4036('0x17')]+_0x14f992['limit'];var _0x3a7564;if(_0x5759f1>=_0x2111f7){_0x5759f1=_0x2111f7;_0x3a7564=0xc8;}else{_0x3a7564=0xce;}_0xd0fa3e['status'](_0x3a7564);return _0xd0fa3e[_0x4036('0x1b')](_0x4036('0x1c'),_0xf38a2d+'-'+_0x5759f1+'/'+_0x2111f7)['json'](_0x2e769a);}return null;};}function patchUpdates(_0x2f0dc4){return function(_0xb62fe1){try{jsonpatch[_0x4036('0x1d')](_0xb62fe1,_0x2f0dc4,!![]);}catch(_0x4d0c09){return BPromise[_0x4036('0x1e')](_0x4d0c09);}return _0xb62fe1[_0x4036('0x1f')]();};}function saveUpdates(_0x399bf4,_0x2baf28){return function(_0x4c8bd3){if(_0x4c8bd3){return _0x4c8bd3[_0x4036('0x20')](_0x399bf4)[_0x4036('0x21')](function(_0xf0b462){return _0xf0b462;});}return null;};}function removeEntity(_0x4d8af9,_0x494d91){return function(_0x114434){if(_0x114434){return _0x114434[_0x4036('0x22')]()['then'](function(){_0x4d8af9[_0x4036('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319abe,_0x25af53){return function(_0x3bc227){if(!_0x3bc227){_0x319abe[_0x4036('0x15')](0x194);}return _0x3bc227;};}function handleError(_0x4d9c2d,_0x1dabd3){_0x1dabd3=_0x1dabd3||0x1f4;return function(_0x4dc1b6){logger[_0x4036('0x23')](_0x4dc1b6[_0x4036('0x24')]);if(_0x4dc1b6['name']){delete _0x4dc1b6[_0x4036('0x25')];}_0x4d9c2d[_0x4036('0x16')](_0x1dabd3)[_0x4036('0x26')](_0x4dc1b6);};}exports['index']=function(_0x4d92b3,_0x1c2fbf){var _0x33687a={},_0x464731={},_0x47e86f={'count':0x0,'rows':[]};var _0x12cfc=_[_0x4036('0x27')](db['VoiceTransferReport']['rawAttributes'],function(_0x58b02f){return{'name':_0x58b02f[_0x4036('0x28')],'type':_0x58b02f[_0x4036('0x29')][_0x4036('0x2a')]};});_0x464731['model']=_[_0x4036('0x27')](_0x12cfc,'name');_0x464731[_0x4036('0x2b')]=_['keys'](_0x4d92b3[_0x4036('0x2b')]);_0x464731[_0x4036('0x2c')]=_[_0x4036('0x2d')](_0x464731['model'],_0x464731[_0x4036('0x2b')]);_0x33687a[_0x4036('0x2e')]=_['intersection'](_0x464731['model'],qs['fields'](_0x4d92b3[_0x4036('0x2b')][_0x4036('0x2f')]));_0x33687a[_0x4036('0x2e')]=_0x33687a[_0x4036('0x2e')]['length']?_0x33687a['attributes']:_0x464731[_0x4036('0x30')];if(!_0x4d92b3['query'][_0x4036('0x31')](_0x4036('0x32'))){_0x33687a[_0x4036('0x19')]=qs[_0x4036('0x19')](_0x4d92b3['query'][_0x4036('0x19')]);_0x33687a['offset']=qs[_0x4036('0x17')](_0x4d92b3['query']['offset']);}_0x33687a[_0x4036('0x33')]=qs[_0x4036('0x34')](_0x4d92b3[_0x4036('0x2b')][_0x4036('0x34')]);_0x33687a[_0x4036('0x35')]=qs[_0x4036('0x2c')](_[_0x4036('0x36')](_0x4d92b3[_0x4036('0x2b')],_0x464731[_0x4036('0x2c')]),_0x12cfc);if(_0x4d92b3[_0x4036('0x2b')][_0x4036('0x37')]){_0x33687a[_0x4036('0x35')]=_[_0x4036('0x38')](_0x33687a[_0x4036('0x35')],{'$or':_['map'](_0x12cfc,function(_0x5eecc5){if(_0x5eecc5[_0x4036('0x29')]!==_0x4036('0x39')){var _0x31573e={};_0x31573e[_0x5eecc5[_0x4036('0x25')]]={'$like':'%'+_0x4d92b3[_0x4036('0x2b')][_0x4036('0x37')]+'%'};return _0x31573e;}})});}_0x33687a=_['merge']({},_0x33687a,_0x4d92b3[_0x4036('0x3a')]);var _0x3c07b6={'where':_0x33687a['where']};return db[_0x4036('0x3b')][_0x4036('0x1a')](_0x3c07b6)[_0x4036('0x21')](function(_0x2fbcf4){_0x47e86f[_0x4036('0x1a')]=_0x2fbcf4;if(_0x4d92b3[_0x4036('0x2b')][_0x4036('0x3c')]){_0x33687a[_0x4036('0x3d')]=[{'all':!![]}];}return db[_0x4036('0x3b')][_0x4036('0x3e')](_0x33687a);})[_0x4036('0x21')](function(_0x21228c){_0x47e86f[_0x4036('0x3f')]=_0x21228c;return _0x47e86f;})[_0x4036('0x21')](respondWithFilteredResult(_0x1c2fbf,_0x33687a))['catch'](handleError(_0x1c2fbf,null));};exports[_0x4036('0x40')]=function(_0x25965a,_0x461974){var _0x1ab664={'raw':!![],'where':{'id':_0x25965a[_0x4036('0x41')]['id']}},_0x2b83a8={};_0x2b83a8['model']=_['keys'](db[_0x4036('0x3b')][_0x4036('0x42')]);_0x2b83a8[_0x4036('0x2b')]=_[_0x4036('0x43')](_0x25965a[_0x4036('0x2b')]);_0x2b83a8['filters']=_[_0x4036('0x2d')](_0x2b83a8['model'],_0x2b83a8['query']);_0x1ab664[_0x4036('0x2e')]=_['intersection'](_0x2b83a8['model'],qs[_0x4036('0x2f')](_0x25965a[_0x4036('0x2b')][_0x4036('0x2f')]));_0x1ab664[_0x4036('0x2e')]=_0x1ab664['attributes'][_0x4036('0x44')]?_0x1ab664[_0x4036('0x2e')]:_0x2b83a8[_0x4036('0x30')];if(_0x25965a[_0x4036('0x2b')][_0x4036('0x3c')]){_0x1ab664[_0x4036('0x3d')]=[{'all':!![]}];}_0x1ab664=_[_0x4036('0x38')]({},_0x1ab664,_0x25965a['options']);return db['VoiceTransferReport'][_0x4036('0x45')](_0x1ab664)[_0x4036('0x21')](handleEntityNotFound(_0x461974,null))[_0x4036('0x21')](respondWithResult(_0x461974,null))[_0x4036('0x46')](handleError(_0x461974,null));};exports[_0x4036('0x47')]=function(_0x31e82a,_0xf663c1){return db['VoiceTransferReport'][_0x4036('0x47')](_0x31e82a[_0x4036('0x48')],{})[_0x4036('0x21')](respondWithResult(_0xf663c1,0xc9))['catch'](handleError(_0xf663c1,null));};exports[_0x4036('0x20')]=function(_0x48c6cb,_0x4cbd82){if(_0x48c6cb[_0x4036('0x48')]['id']){delete _0x48c6cb[_0x4036('0x48')]['id'];}return db[_0x4036('0x3b')][_0x4036('0x45')]({'where':{'id':_0x48c6cb[_0x4036('0x41')]['id']}})[_0x4036('0x21')](handleEntityNotFound(_0x4cbd82,null))['then'](saveUpdates(_0x48c6cb[_0x4036('0x48')],null))[_0x4036('0x21')](respondWithResult(_0x4cbd82,null))[_0x4036('0x46')](handleError(_0x4cbd82,null));};exports[_0x4036('0x22')]=function(_0x2b91b3,_0x4aaace){return db[_0x4036('0x3b')][_0x4036('0x45')]({'where':{'id':_0x2b91b3[_0x4036('0x41')]['id']}})[_0x4036('0x21')](handleEntityNotFound(_0x4aaace,null))['then'](removeEntity(_0x4aaace,null))[_0x4036('0x46')](handleError(_0x4aaace,null));};exports[_0x4036('0x49')]=function(_0x4121c7,_0xec492c){return db['VoiceTransferReport']['describe']()['then'](respondWithResult(_0xec492c,null))[_0x4036('0x46')](handleError(_0xec492c,null));}; \ No newline at end of file +var _0x3a79=['query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','then','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','VoiceTransferReport','rawAttributes','fieldName','key'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3a79,0xaf));var _0x93a7=function(_0x546cfe,_0x46287a){_0x546cfe=_0x546cfe-0x0;var _0x56d253=_0x3a79[_0x546cfe];return _0x56d253;};'use strict';var emlformat=require(_0x93a7('0x0'));var rimraf=require(_0x93a7('0x1'));var zipdir=require(_0x93a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93a7('0x3'));var moment=require('moment');var BPromise=require(_0x93a7('0x4'));var Mustache=require(_0x93a7('0x5'));var util=require(_0x93a7('0x6'));var path=require(_0x93a7('0x7'));var sox=require(_0x93a7('0x8'));var csv=require('to-csv');var ejs=require(_0x93a7('0x9'));var fs=require('fs');var fs_extra=require(_0x93a7('0xa'));var _=require(_0x93a7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x93a7('0xc'));var deskjs=require(_0x93a7('0xd'));var toCsv=require(_0x93a7('0xe'));var querystring=require(_0x93a7('0xf'));var Papa=require(_0x93a7('0x10'));var Redis=require('ioredis');var authService=require(_0x93a7('0x11'));var qs=require(_0x93a7('0x12'));var as=require(_0x93a7('0x13'));var hardwareService=require(_0x93a7('0x14'));var logger=require(_0x93a7('0x15'))(_0x93a7('0x16'));var utils=require(_0x93a7('0x17'));var config=require(_0x93a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x93a7('0x19'))['db'];function respondWithStatusCode(_0x54d97f,_0x49bee8){_0x49bee8=_0x49bee8||0xcc;return function(_0x4888c6){if(_0x4888c6){return _0x54d97f['sendStatus'](_0x49bee8);}return _0x54d97f[_0x93a7('0x1a')](_0x49bee8)[_0x93a7('0x1b')]();};}function respondWithResult(_0x53966e,_0x48a3ca){_0x48a3ca=_0x48a3ca||0xc8;return function(_0x532c90){if(_0x532c90){return _0x53966e[_0x93a7('0x1a')](_0x48a3ca)[_0x93a7('0x1c')](_0x532c90);}};}function respondWithFilteredResult(_0x4f415a,_0x52028d){return function(_0x246a63){if(_0x246a63){var _0x34d610=typeof _0x52028d[_0x93a7('0x1d')]==='undefined'&&typeof _0x52028d[_0x93a7('0x1e')]===_0x93a7('0x1f');var _0x457b9f=_0x246a63[_0x93a7('0x20')];var _0x53cf80=_0x34d610?0x0:_0x52028d['offset'];var _0x37df43=_0x34d610?_0x246a63[_0x93a7('0x20')]:_0x52028d[_0x93a7('0x1d')]+_0x52028d[_0x93a7('0x1e')];var _0x1713d0;if(_0x37df43>=_0x457b9f){_0x37df43=_0x457b9f;_0x1713d0=0xc8;}else{_0x1713d0=0xce;}_0x4f415a['status'](_0x1713d0);return _0x4f415a[_0x93a7('0x21')](_0x93a7('0x22'),_0x53cf80+'-'+_0x37df43+'/'+_0x457b9f)[_0x93a7('0x1c')](_0x246a63);}return null;};}function patchUpdates(_0x3fbd92){return function(_0x22f1ec){try{jsonpatch[_0x93a7('0x23')](_0x22f1ec,_0x3fbd92,!![]);}catch(_0xaa3fd1){return BPromise[_0x93a7('0x24')](_0xaa3fd1);}return _0x22f1ec[_0x93a7('0x25')]();};}function saveUpdates(_0x115eb6,_0x125d24){return function(_0x581e91){if(_0x581e91){return _0x581e91[_0x93a7('0x26')](_0x115eb6)['then'](function(_0x2a23b3){return _0x2a23b3;});}return null;};}function removeEntity(_0xa44989,_0x5fc0f7){return function(_0x388c02){if(_0x388c02){return _0x388c02[_0x93a7('0x27')]()['then'](function(){_0xa44989[_0x93a7('0x1a')](0xcc)[_0x93a7('0x1b')]();});}};}function handleEntityNotFound(_0x556ba2,_0x3f67ed){return function(_0x5d0e64){if(!_0x5d0e64){_0x556ba2['sendStatus'](0x194);}return _0x5d0e64;};}function handleError(_0x4171dc,_0x15bd56){_0x15bd56=_0x15bd56||0x1f4;return function(_0x387898){logger[_0x93a7('0x28')](_0x387898[_0x93a7('0x29')]);if(_0x387898[_0x93a7('0x2a')]){delete _0x387898[_0x93a7('0x2a')];}_0x4171dc[_0x93a7('0x1a')](_0x15bd56)['send'](_0x387898);};}exports['index']=function(_0x1aeacb,_0x111f28){var _0x58de6f={},_0x211566={},_0x593cea={'count':0x0,'rows':[]};var _0x337c5d=_['map'](db[_0x93a7('0x2b')][_0x93a7('0x2c')],function(_0x1aa517){return{'name':_0x1aa517[_0x93a7('0x2d')],'type':_0x1aa517['type'][_0x93a7('0x2e')]};});_0x211566['model']=_['map'](_0x337c5d,_0x93a7('0x2a'));_0x211566[_0x93a7('0x2f')]=_[_0x93a7('0x30')](_0x1aeacb[_0x93a7('0x2f')]);_0x211566[_0x93a7('0x31')]=_[_0x93a7('0x32')](_0x211566[_0x93a7('0x33')],_0x211566[_0x93a7('0x2f')]);_0x58de6f[_0x93a7('0x34')]=_[_0x93a7('0x32')](_0x211566[_0x93a7('0x33')],qs[_0x93a7('0x35')](_0x1aeacb[_0x93a7('0x2f')][_0x93a7('0x35')]));_0x58de6f[_0x93a7('0x34')]=_0x58de6f['attributes'][_0x93a7('0x36')]?_0x58de6f[_0x93a7('0x34')]:_0x211566[_0x93a7('0x33')];if(!_0x1aeacb[_0x93a7('0x2f')]['hasOwnProperty'](_0x93a7('0x37'))){_0x58de6f[_0x93a7('0x1e')]=qs[_0x93a7('0x1e')](_0x1aeacb[_0x93a7('0x2f')]['limit']);_0x58de6f[_0x93a7('0x1d')]=qs[_0x93a7('0x1d')](_0x1aeacb[_0x93a7('0x2f')][_0x93a7('0x1d')]);}_0x58de6f[_0x93a7('0x38')]=qs[_0x93a7('0x39')](_0x1aeacb[_0x93a7('0x2f')][_0x93a7('0x39')]);_0x58de6f[_0x93a7('0x3a')]=qs[_0x93a7('0x31')](_[_0x93a7('0x3b')](_0x1aeacb[_0x93a7('0x2f')],_0x211566[_0x93a7('0x31')]),_0x337c5d);if(_0x1aeacb[_0x93a7('0x2f')]['filter']){_0x58de6f[_0x93a7('0x3a')]=_['merge'](_0x58de6f['where'],{'$or':_[_0x93a7('0x3c')](_0x337c5d,function(_0x315505){if(_0x315505['type']!==_0x93a7('0x3d')){var _0x283107={};_0x283107[_0x315505[_0x93a7('0x2a')]]={'$like':'%'+_0x1aeacb[_0x93a7('0x2f')][_0x93a7('0x3e')]+'%'};return _0x283107;}})});}_0x58de6f=_[_0x93a7('0x3f')]({},_0x58de6f,_0x1aeacb['options']);var _0x5c8d2a={'where':_0x58de6f['where']};return db[_0x93a7('0x2b')]['count'](_0x5c8d2a)[_0x93a7('0x40')](function(_0x59322a){_0x593cea[_0x93a7('0x20')]=_0x59322a;if(_0x1aeacb[_0x93a7('0x2f')][_0x93a7('0x41')]){_0x58de6f[_0x93a7('0x42')]=[{'all':!![]}];}return db[_0x93a7('0x2b')]['findAll'](_0x58de6f);})[_0x93a7('0x40')](function(_0x4eed50){_0x593cea['rows']=_0x4eed50;return _0x593cea;})[_0x93a7('0x40')](respondWithFilteredResult(_0x111f28,_0x58de6f))[_0x93a7('0x43')](handleError(_0x111f28,null));};exports[_0x93a7('0x44')]=function(_0x4c59f1,_0x2ec258){var _0x54af6b={'raw':!![],'where':{'id':_0x4c59f1[_0x93a7('0x45')]['id']}},_0x301b0a={};_0x301b0a[_0x93a7('0x33')]=_[_0x93a7('0x30')](db[_0x93a7('0x2b')]['rawAttributes']);_0x301b0a[_0x93a7('0x2f')]=_[_0x93a7('0x30')](_0x4c59f1[_0x93a7('0x2f')]);_0x301b0a[_0x93a7('0x31')]=_[_0x93a7('0x32')](_0x301b0a[_0x93a7('0x33')],_0x301b0a['query']);_0x54af6b['attributes']=_[_0x93a7('0x32')](_0x301b0a[_0x93a7('0x33')],qs[_0x93a7('0x35')](_0x4c59f1[_0x93a7('0x2f')][_0x93a7('0x35')]));_0x54af6b[_0x93a7('0x34')]=_0x54af6b['attributes']['length']?_0x54af6b[_0x93a7('0x34')]:_0x301b0a[_0x93a7('0x33')];if(_0x4c59f1['query'][_0x93a7('0x41')]){_0x54af6b[_0x93a7('0x42')]=[{'all':!![]}];}_0x54af6b=_[_0x93a7('0x3f')]({},_0x54af6b,_0x4c59f1['options']);return db['VoiceTransferReport'][_0x93a7('0x46')](_0x54af6b)[_0x93a7('0x40')](handleEntityNotFound(_0x2ec258,null))[_0x93a7('0x40')](respondWithResult(_0x2ec258,null))[_0x93a7('0x43')](handleError(_0x2ec258,null));};exports[_0x93a7('0x47')]=function(_0x35535a,_0x354a41){return db['VoiceTransferReport']['create'](_0x35535a[_0x93a7('0x48')],{})[_0x93a7('0x40')](respondWithResult(_0x354a41,0xc9))['catch'](handleError(_0x354a41,null));};exports[_0x93a7('0x26')]=function(_0x3a601c,_0x4334c4){if(_0x3a601c[_0x93a7('0x48')]['id']){delete _0x3a601c[_0x93a7('0x48')]['id'];}return db[_0x93a7('0x2b')][_0x93a7('0x46')]({'where':{'id':_0x3a601c['params']['id']}})[_0x93a7('0x40')](handleEntityNotFound(_0x4334c4,null))[_0x93a7('0x40')](saveUpdates(_0x3a601c[_0x93a7('0x48')],null))['then'](respondWithResult(_0x4334c4,null))[_0x93a7('0x43')](handleError(_0x4334c4,null));};exports[_0x93a7('0x27')]=function(_0x4ac390,_0x4394ef){return db['VoiceTransferReport'][_0x93a7('0x46')]({'where':{'id':_0x4ac390[_0x93a7('0x45')]['id']}})[_0x93a7('0x40')](handleEntityNotFound(_0x4394ef,null))[_0x93a7('0x40')](removeEntity(_0x4394ef,null))[_0x93a7('0x43')](handleError(_0x4394ef,null));};exports[_0x93a7('0x49')]=function(_0xa59ad,_0x55d467){return db[_0x93a7('0x2b')][_0x93a7('0x49')]()['then'](respondWithResult(_0x55d467,null))[_0x93a7('0x43')](handleError(_0x55d467,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index df7018b..3c04fc9 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 _0x2778=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash'];(function(_0x2068e2,_0x24494f){var _0x4e61f2=function(_0x22ffc4){while(--_0x22ffc4){_0x2068e2['push'](_0x2068e2['shift']());}};_0x4e61f2(++_0x24494f);}(_0x2778,0x83));var _0x8277=function(_0x2d7a65,_0x404597){_0x2d7a65=_0x2d7a65-0x0;var _0x4668b2=_0x2778[_0x2d7a65];return _0x4668b2;};'use strict';var _=require(_0x8277('0x0'));var util=require(_0x8277('0x1'));var logger=require(_0x8277('0x2'))(_0x8277('0x3'));var moment=require(_0x8277('0x4'));var BPromise=require(_0x8277('0x5'));var rp=require(_0x8277('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8277('0x7'));var config=require('../../config/environment');var attributes=require(_0x8277('0x8'));module[_0x8277('0x9')]=function(_0xb5bcb6,_0xff03bc){return _0xb5bcb6[_0x8277('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x8277('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb47a=['util','moment','path','rimraf','exports','define','VoiceTransferReport'];(function(_0xefcc81,_0x7b053){var _0x586009=function(_0x43e3df){while(--_0x43e3df){_0xefcc81['push'](_0xefcc81['shift']());}};_0x586009(++_0x7b053);}(_0xb47a,0x69));var _0xab47=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb47a[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require(_0xab47('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xab47('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab47('0x2'));var rimraf=require(_0xab47('0x3'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xab47('0x4')]=function(_0x10345c,_0x4fe870){return _0x10345c[_0xab47('0x5')](_0xab47('0x6'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index b456d76..edcebe7 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 _0x3ff9=['body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x581d17,_0x951b0a){var _0x2014bb=function(_0x44fb08){while(--_0x44fb08){_0x581d17['push'](_0x581d17['shift']());}};_0x2014bb(++_0x951b0a);}(_0x3ff9,0x109));var _0x93ff=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3ff9[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x93ff('0x0'));var util=require(_0x93ff('0x1'));var moment=require(_0x93ff('0x2'));var BPromise=require(_0x93ff('0x3'));var rs=require(_0x93ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93ff('0x5'))(_0x93ff('0x6'));var config=require(_0x93ff('0x7'));var jayson=require(_0x93ff('0x8'));var client=jayson[_0x93ff('0x9')][_0x93ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d675f,_0x5ddbed,_0x2a50f4){return new BPromise(function(_0x222fad,_0x132e75){return client[_0x93ff('0xb')](_0x3d675f,_0x2a50f4)[_0x93ff('0xc')](function(_0x3e7557){logger[_0x93ff('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5ddbed,'request\x20sent');logger[_0x93ff('0xe')](_0x93ff('0xf'),_0x5ddbed,_0x93ff('0x10'),JSON['stringify'](_0x3e7557));if(_0x3e7557['error']){if(_0x3e7557[_0x93ff('0x11')]['code']===0x1f4){logger[_0x93ff('0x11')](_0x93ff('0x12'),_0x5ddbed,_0x3e7557[_0x93ff('0x11')][_0x93ff('0x13')]);return _0x132e75(_0x3e7557[_0x93ff('0x11')][_0x93ff('0x13')]);}logger[_0x93ff('0x11')](_0x93ff('0x12'),_0x5ddbed,_0x3e7557['error']['message']);return _0x222fad(_0x3e7557[_0x93ff('0x11')][_0x93ff('0x13')]);}else{logger[_0x93ff('0xd')](_0x93ff('0x12'),_0x5ddbed,'request\x20sent');_0x222fad(_0x3e7557[_0x93ff('0x14')][_0x93ff('0x13')]);}})[_0x93ff('0x15')](function(_0x3089f0){logger[_0x93ff('0x11')](_0x93ff('0x12'),_0x5ddbed,_0x3089f0);_0x132e75(_0x3089f0);});});}exports[_0x93ff('0x16')]=function(_0x245667){var _0x10a10a=this;return new Promise(function(_0x312450,_0x30062a){return db[_0x93ff('0x17')][_0x93ff('0x18')](_0x245667[_0x93ff('0x19')],{'raw':_0x245667[_0x93ff('0x1a')]?_0x245667[_0x93ff('0x1a')][_0x93ff('0x1b')]===undefined?!![]:![]:!![]})[_0x93ff('0xc')](function(_0x5d8e0e){logger[_0x93ff('0xd')](_0x93ff('0x16'),_0x245667);logger[_0x93ff('0xe')](_0x93ff('0x16'),_0x245667,JSON[_0x93ff('0x1c')](_0x5d8e0e));_0x312450(_0x5d8e0e);})[_0x93ff('0x15')](function(_0x735cb0){logger[_0x93ff('0x11')](_0x93ff('0x16'),_0x735cb0[_0x93ff('0x13')],_0x245667);_0x30062a(_0x10a10a[_0x93ff('0x11')](0x1f4,_0x735cb0['message']));});});}; \ No newline at end of file +var _0xf3e7=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','then','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf3e7,0x16b));var _0x7f3e=function(_0x555aa9,_0x3a607f){_0x555aa9=_0x555aa9-0x0;var _0x20aecd=_0xf3e7[_0x555aa9];return _0x20aecd;};'use strict';var _=require(_0x7f3e('0x0'));var util=require(_0x7f3e('0x1'));var moment=require(_0x7f3e('0x2'));var BPromise=require(_0x7f3e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f3e('0x4'));var db=require(_0x7f3e('0x5'))['db'];var utils=require(_0x7f3e('0x6'));var logger=require(_0x7f3e('0x7'))('rpc');var config=require(_0x7f3e('0x8'));var jayson=require(_0x7f3e('0x9'));var client=jayson[_0x7f3e('0xa')][_0x7f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31d202,_0x176a2f,_0x1c07d0){return new BPromise(function(_0x16457a,_0x3100e2){return client['request'](_0x31d202,_0x1c07d0)['then'](function(_0xffedb5){logger[_0x7f3e('0xc')](_0x7f3e('0xd'),_0x176a2f,_0x7f3e('0xe'));logger[_0x7f3e('0xf')](_0x7f3e('0x10'),_0x176a2f,_0x7f3e('0xe'),JSON[_0x7f3e('0x11')](_0xffedb5));if(_0xffedb5[_0x7f3e('0x12')]){if(_0xffedb5[_0x7f3e('0x12')][_0x7f3e('0x13')]===0x1f4){logger['error'](_0x7f3e('0xd'),_0x176a2f,_0xffedb5['error'][_0x7f3e('0x14')]);return _0x3100e2(_0xffedb5[_0x7f3e('0x12')][_0x7f3e('0x14')]);}logger['error'](_0x7f3e('0xd'),_0x176a2f,_0xffedb5['error'][_0x7f3e('0x14')]);return _0x16457a(_0xffedb5['error'][_0x7f3e('0x14')]);}else{logger['info'](_0x7f3e('0xd'),_0x176a2f,_0x7f3e('0xe'));_0x16457a(_0xffedb5[_0x7f3e('0x15')][_0x7f3e('0x14')]);}})[_0x7f3e('0x16')](function(_0x43bbe0){logger['error'](_0x7f3e('0xd'),_0x176a2f,_0x43bbe0);_0x3100e2(_0x43bbe0);});});}exports['CreateVoiceTransferReport']=function(_0x85a7bb){var _0x570c30=this;return new Promise(function(_0x5c3d69,_0x46e8d4){return db[_0x7f3e('0x17')][_0x7f3e('0x18')](_0x85a7bb['body'],{'raw':_0x85a7bb['options']?_0x85a7bb['options']['raw']===undefined?!![]:![]:!![]})[_0x7f3e('0x19')](function(_0x41a68e){logger[_0x7f3e('0xc')](_0x7f3e('0x1a'),_0x85a7bb);logger[_0x7f3e('0xf')](_0x7f3e('0x1a'),_0x85a7bb,JSON[_0x7f3e('0x11')](_0x41a68e));_0x5c3d69(_0x41a68e);})[_0x7f3e('0x16')](function(_0x5306b2){logger[_0x7f3e('0x12')]('CreateVoiceTransferReport',_0x5306b2[_0x7f3e('0x14')],_0x85a7bb);_0x46e8d4(_0x570c30[_0x7f3e('0x12')](0x1f4,_0x5306b2[_0x7f3e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index f7317b8..81d1137 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 _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file +var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index b2097d3..c4ccde0 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 _0xec56=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','catch','calls','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise'];(function(_0x187d90,_0x503f5e){var _0xfbc7fd=function(_0x522eea){while(--_0x522eea){_0x187d90['push'](_0x187d90['shift']());}};_0xfbc7fd(++_0x503f5e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x528817,_0x398292){_0x528817=_0x528817-0x0;var _0x36c62d=_0xec56[_0x528817];return _0x36c62d;};'use strict';var path=require(_0x6ec5('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x6ec5('0x1'));var util=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var jayson=require(_0x6ec5('0x4'));var amiClient=jayson[_0x6ec5('0x5')][_0x6ec5('0x6')]({'port':0x232a});var logger=require(_0x6ec5('0x7'))(_0x6ec5('0x8'));var Redis=require(_0x6ec5('0x9'));config[_0x6ec5('0xa')]=_[_0x6ec5('0xb')](config[_0x6ec5('0xa')],{'host':_0x6ec5('0xc'),'port':0x18eb});var io=require(_0x6ec5('0xd'))(new Redis(config[_0x6ec5('0xa')]));var Schema=require(_0x6ec5('0xe'));var originateValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'callNumber':{'type':_0x6ec5('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x6ec5('0x11')},'callbackUrl':{'type':_0x6ec5('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x12')]},'transferNumber':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});function emit(_0x4d09fe,_0x13b725,_0x3df696){logger[_0x6ec5('0x14')](_0x4d09fe,_0x13b725,JSON[_0x6ec5('0x15')](_0x3df696));io['to'](_0x4d09fe)[_0x6ec5('0x16')](_0x13b725,_0x3df696);}function handleError(_0x42b690){return function(_0x1dbee9){console[_0x6ec5('0x17')](_0x6ec5('0x18'),_0x1dbee9,_0x1dbee9 instanceof RangeError);logger[_0x6ec5('0x19')](_0x1dbee9[_0x6ec5('0x1a')]);if(_0x1dbee9 instanceof RangeError){if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690[_0x6ec5('0x1c')](0x194)[_0x6ec5('0x1d')](_0x1dbee9);}else{if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690['status'](0x1f4)[_0x6ec5('0x1d')](_0x1dbee9);}};}function checkError(){return function(_0x1b1d96){if(!_0x1b1d96){throw new RangeError(_0x6ec5('0x1e'));}return _0x1b1d96;};}function respondWithRpcPromise(_0x20f5a6,_0x3fc9d7){return new BPromise(function(_0x38a821,_0x18243f){var _0x48733b=amiClient;return _0x48733b[_0x6ec5('0x1f')](_0x20f5a6,_0x3fc9d7)[_0x6ec5('0x20')](function(_0x358d18){if(_0x358d18[_0x6ec5('0x19')]){if(_0x358d18['error'][_0x6ec5('0x21')]===0x1f4){return _0x18243f(_0x358d18[_0x6ec5('0x19')]['message']);}return _0x38a821(_0x358d18[_0x6ec5('0x19')][_0x6ec5('0x22')]);}else{_0x38a821(_0x358d18[_0x6ec5('0x23')]);}})['catch'](function(_0x1b779a){_0x18243f(_0x1b779a);});});}function getAgent(_0xd0e8d7){return db[_0x6ec5('0x24')][_0x6ec5('0x25')]({'where':{'id':_0xd0e8d7,'role':_0x6ec5('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x171e2a,_0x267a30){return new BPromise(function(_0x4a9860,_0x2570c7){var _0x3f5ee0=respondWithRpcPromise('VoiceChannels');var _0x3d36cb=getAgent(_0x171e2a);Promise[_0x6ec5('0x27')]([_0x3f5ee0,_0x3d36cb])[_0x6ec5('0x20')](function(_0xa227ff){var _0x116659=_0xa227ff[0x0];var _0x5a30ba=_0xa227ff[0x1];var _0x2b8c99=_[_0x6ec5('0x28')](_0x116659[_0x6ec5('0x29')],function(_0x174164){return _0x174164[_0x6ec5('0x2a')]==_0x5a30ba['id']&&_0x174164[_0x6ec5('0x2b')]==_0x267a30;});if(_0x2b8c99[_0x6ec5('0x2c')]==0x1){_0x4a9860(_0x5a30ba);}else{_0x2570c7(new RangeError('sessionId\x20'+_0x267a30+_0x6ec5('0x2d')));}});});}exports['originate']=function(_0x15e1f6,_0x5c6517){logger[_0x6ec5('0x14')](_0x6ec5('0x2e'),_0x15e1f6['body']);var _0x5db924=originateValidation[_0x6ec5('0xe')](_0x15e1f6[_0x6ec5('0x2f')]);if(_0x5db924['length']>0x0){return _0x5c6517[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x5db924);}var _0x54ab73=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x391c01=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x32')];var _0x23a73c=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x33')];var _0x4b7a08=_0x15e1f6[_0x6ec5('0x2f')]['callbackUrl'];return getAgent(_0x54ab73)[_0x6ec5('0x20')](function(_0xe1e58){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xe1e58[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0xe1e58[_0x6ec5('0x1b')]),_0x6ec5('0x37'),{'callNumber':_0x391c01,'callerId':_0x23a73c,'callbackUrl':_0x4b7a08});return _0x5c6517[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5c6517));};exports[_0x6ec5('0x38')]=function(_0x519017,_0xf65d54){logger[_0x6ec5('0x14')](_0x6ec5('0x39'),_0x519017[_0x6ec5('0x2f')]);var _0x2b47ab=hangupValidation[_0x6ec5('0xe')](_0x519017[_0x6ec5('0x2f')]);if(_0x2b47ab['length']>0x0){return _0xf65d54[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2b47ab);}var _0x42b134=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x32db57=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x42b134)[_0x6ec5('0x20')](function(_0x53dcd8){logger[_0x6ec5('0x14')]('entityFound:',_0x53dcd8[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0x53dcd8[_0x6ec5('0x1b')]),'webbar:hangup',{'sessionId':_0x32db57});return _0xf65d54[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x3a')});})['catch'](handleError(_0xf65d54));};exports[_0x6ec5('0x3b')]=function(_0x1fc5cb,_0x4a3e6b){logger[_0x6ec5('0x14')](_0x6ec5('0x3c'),_0x1fc5cb[_0x6ec5('0x2f')]);var _0xb8324=answerValidation[_0x6ec5('0xe')](_0x1fc5cb[_0x6ec5('0x2f')]);if(_0xb8324[_0x6ec5('0x2c')]>0x0){return _0x4a3e6b[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0xb8324);}var _0x5a7b9c=_0x1fc5cb[_0x6ec5('0x2f')]['userId'];var _0x17cfed=_0x1fc5cb[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5a7b9c)[_0x6ec5('0x20')](function(_0x4be992){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x4be992['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x4be992[_0x6ec5('0x1b')]),_0x6ec5('0x3d'),{'sessionId':_0x17cfed});return _0x4a3e6b[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x4a3e6b));};exports[_0x6ec5('0x3e')]=function(_0x56dc23,_0x2e69ff){logger[_0x6ec5('0x14')](_0x6ec5('0x3f'),_0x56dc23[_0x6ec5('0x2f')]);var _0x2cf8c7=holdValidation['validate'](_0x56dc23['body']);if(_0x2cf8c7[_0x6ec5('0x2c')]>0x0){return _0x2e69ff[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2cf8c7);}var _0x45972a=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x4013b1=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x45972a)[_0x6ec5('0x20')](function(_0xd265c){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xd265c[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0xd265c['name']),_0x6ec5('0x40'),{'sessionId':_0x4013b1});return _0x2e69ff[_0x6ec5('0x1c')](0xc8)['json']({'error':![],'message':_0x6ec5('0x41')});})[_0x6ec5('0x42')](handleError(_0x2e69ff));};exports['unhold']=function(_0x23a64d,_0x21a910){logger['info']('unhold\x20fired:',_0x23a64d[_0x6ec5('0x2f')]);var _0x49fa43=unholdValidation['validate'](_0x23a64d[_0x6ec5('0x2f')]);if(_0x49fa43[_0x6ec5('0x2c')]>0x0){return _0x21a910[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x49fa43);}var _0x5aecab=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x2bad24=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5aecab)[_0x6ec5('0x20')](function(_0x15c0d7){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x15c0d7[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x15c0d7[_0x6ec5('0x1b')]),'webbar:unhold',{'sessionId':_0x2bad24});return _0x21a910[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x6ec5('0x42')](handleError(_0x21a910));};exports[_0x6ec5('0x43')]=function(_0x377c08,_0x1e80bc){logger[_0x6ec5('0x14')]('calls\x20fired:',_0x1e80bc['body']);var _0x282cbc=callsValidation['validate'](_0x377c08[_0x6ec5('0x2f')]);if(_0x282cbc[_0x6ec5('0x2c')]>0x0){return _0x1e80bc[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x282cbc);}var _0x301e31=_0x377c08['body'][_0x6ec5('0x31')];var _0x4838a9=respondWithRpcPromise('VoiceChannels');var _0x5cedd7=getAgent(_0x301e31);return Promise[_0x6ec5('0x27')]([_0x4838a9,_0x5cedd7])[_0x6ec5('0x20')](function(_0x47d81f){var _0x59fd7f=_0x47d81f[0x0];var _0x36d685=_0x47d81f[0x1];var _0x14d38=_[_0x6ec5('0x28')](_0x59fd7f[_0x6ec5('0x29')],function(_0x34578a){return _0x34578a['UserId']==_0x36d685['id'];});return _0x1e80bc[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'count':_0x14d38[_0x6ec5('0x2c')],'rows':_0x14d38});})[_0x6ec5('0x42')](handleError(_0x1e80bc));};exports[_0x6ec5('0x44')]=function(_0x522966,_0x34a136){logger[_0x6ec5('0x14')](_0x6ec5('0x45'),_0x522966[_0x6ec5('0x2f')]);var _0x2a5a1=conferenceValidation[_0x6ec5('0xe')](_0x522966[_0x6ec5('0x2f')]);if(_0x2a5a1[_0x6ec5('0x2c')]>0x0){return _0x34a136[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2a5a1);}var _0x42623c=_0x522966[_0x6ec5('0x2f')][_0x6ec5('0x31')];return getAgent(_0x42623c)[_0x6ec5('0x20')](function(_0x3ed512){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x3ed512['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x3ed512[_0x6ec5('0x1b')]),'webbar:conference');return _0x34a136['status'](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x46')});})[_0x6ec5('0x42')](handleError(_0x34a136));};exports[_0x6ec5('0x47')]=function(_0x1d4424,_0x48b5a9){logger[_0x6ec5('0x14')](_0x6ec5('0x48'),_0x1d4424[_0x6ec5('0x2f')]);var _0x189dbc=transferValidation[_0x6ec5('0xe')](_0x1d4424['body']);if(_0x189dbc[_0x6ec5('0x2c')]>0x0){return _0x48b5a9[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x189dbc);}var _0x974b90=_0x1d4424['body'][_0x6ec5('0x31')];var _0x39f48a=_0x1d4424['body']['sessionId'];var _0x12f741=_0x1d4424[_0x6ec5('0x2f')][_0x6ec5('0x49')];return getAgent(_0x974b90)[_0x6ec5('0x20')](function(_0x23e750){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x23e750[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x23e750[_0x6ec5('0x1b')]),'webbar:transfer',{'sessionId':_0x39f48a,'transferNumber':_0x12f741});return _0x48b5a9[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x4a')});})[_0x6ec5('0x42')](handleError(_0x48b5a9));}; \ No newline at end of file +var _0xbe02=['unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x1b9607,_0x5a3a10){var _0x129e2e=function(_0x1d9547){while(--_0x1d9547){_0x1b9607['push'](_0x1b9607['shift']());}};_0x129e2e(++_0x5a3a10);}(_0xbe02,0x146));var _0x2be0=function(_0x2a16fe,_0x275305){_0x2a16fe=_0x2a16fe-0x0;var _0x3b5d5e=_0xbe02[_0x2a16fe];return _0x3b5d5e;};'use strict';var path=require(_0x2be0('0x0'));var fs=require('fs');var _=require(_0x2be0('0x1'));var db=require(_0x2be0('0x2'))['db'];var config=require(_0x2be0('0x3'));var util=require('util');var BPromise=require(_0x2be0('0x4'));var jayson=require(_0x2be0('0x5'));var amiClient=jayson[_0x2be0('0x6')][_0x2be0('0x7')]({'port':0x232a});var logger=require(_0x2be0('0x8'))(_0x2be0('0x9'));var Redis=require(_0x2be0('0xa'));config[_0x2be0('0xb')]=_[_0x2be0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2be0('0xd'))(new Redis(config[_0x2be0('0xb')]));var Schema=require(_0x2be0('0xe'));var originateValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'callNumber':{'type':_0x2be0('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x12')]},'transferNumber':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]}});function emit(_0x5bcbc5,_0x334070,_0x30d623){logger[_0x2be0('0x14')](_0x5bcbc5,_0x334070,JSON[_0x2be0('0x15')](_0x30d623));io['to'](_0x5bcbc5)[_0x2be0('0x16')](_0x334070,_0x30d623);}function handleError(_0x1ae700){return function(_0x48d386){console[_0x2be0('0x17')](_0x2be0('0x18'),_0x48d386,_0x48d386 instanceof RangeError);logger[_0x2be0('0x19')](_0x48d386[_0x2be0('0x1a')]);if(_0x48d386 instanceof RangeError){if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700[_0x2be0('0x1c')](0x194)[_0x2be0('0x1d')](_0x48d386);}else{if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700['status'](0x1f4)['send'](_0x48d386);}};}function checkError(){return function(_0x3292af){if(!_0x3292af){throw new RangeError('NotFound');}return _0x3292af;};}function respondWithRpcPromise(_0x5d1a32,_0x40cc4d){return new BPromise(function(_0x4d2c62,_0x2da0d5){var _0x2b3f88=amiClient;return _0x2b3f88[_0x2be0('0x1e')](_0x5d1a32,_0x40cc4d)[_0x2be0('0x1f')](function(_0x105fa6){if(_0x105fa6[_0x2be0('0x19')]){if(_0x105fa6['error'][_0x2be0('0x20')]===0x1f4){return _0x2da0d5(_0x105fa6['error']['message']);}return _0x4d2c62(_0x105fa6[_0x2be0('0x19')][_0x2be0('0x21')]);}else{_0x4d2c62(_0x105fa6[_0x2be0('0x22')]);}})[_0x2be0('0x23')](function(_0x3fb87f){_0x2da0d5(_0x3fb87f);});});}function getAgent(_0x4b5f21){return db[_0x2be0('0x24')]['findOne']({'where':{'id':_0x4b5f21,'role':_0x2be0('0x25')}})[_0x2be0('0x1f')](checkError());}function getAgentCheckSession(_0x559a66,_0x5260d3){return new BPromise(function(_0x1fd3eb,_0x20f866){var _0x4bdf61=respondWithRpcPromise(_0x2be0('0x26'));var _0x36b490=getAgent(_0x559a66);Promise[_0x2be0('0x27')]([_0x4bdf61,_0x36b490])[_0x2be0('0x1f')](function(_0x3b97c0){var _0x4184e4=_0x3b97c0[0x0];var _0x463fd5=_0x3b97c0[0x1];var _0x58846a=_[_0x2be0('0x28')](_0x4184e4['rows'],function(_0x11abcf){return _0x11abcf[_0x2be0('0x29')]==_0x463fd5['id']&&_0x11abcf[_0x2be0('0x2a')]==_0x5260d3;});if(_0x58846a[_0x2be0('0x2b')]==0x1){_0x1fd3eb(_0x463fd5);}else{_0x20f866(new RangeError(_0x2be0('0x2c')+_0x5260d3+_0x2be0('0x2d')));}});});}exports[_0x2be0('0x2e')]=function(_0x5191e6,_0x121e5b){logger[_0x2be0('0x14')](_0x2be0('0x2f'),_0x5191e6[_0x2be0('0x30')]);var _0x101114=originateValidation['validate'](_0x5191e6[_0x2be0('0x30')]);if(_0x101114[_0x2be0('0x2b')]>0x0){return _0x121e5b[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x101114);}var _0x779ef2=_0x5191e6['body']['userId'];var _0x22458d=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x32')];var _0x5a53ac=_0x5191e6['body']['callerId'];var _0x41afcb=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x33')];return getAgent(_0x779ef2)[_0x2be0('0x1f')](function(_0x3c7227){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3c7227[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3c7227[_0x2be0('0x1b')]),'webbar:originate',{'callNumber':_0x22458d,'callerId':_0x5a53ac,'callbackUrl':_0x41afcb});return _0x121e5b[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x37')});})[_0x2be0('0x23')](handleError(_0x121e5b));};exports[_0x2be0('0x38')]=function(_0x565623,_0x27d35e){logger[_0x2be0('0x14')](_0x2be0('0x39'),_0x565623['body']);var _0x1123bc=hangupValidation['validate'](_0x565623[_0x2be0('0x30')]);if(_0x1123bc['length']>0x0){return _0x27d35e['status'](0x190)[_0x2be0('0x31')](_0x1123bc);}var _0x4d6ccf=_0x565623[_0x2be0('0x30')]['userId'];var _0x3017c4=_0x565623['body'][_0x2be0('0x2a')];return getAgent(_0x4d6ccf)[_0x2be0('0x1f')](function(_0xa4d6f0){logger['info'](_0x2be0('0x34'),_0xa4d6f0['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0xa4d6f0[_0x2be0('0x1b')]),_0x2be0('0x3a'),{'sessionId':_0x3017c4});return _0x27d35e[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x3b')});})[_0x2be0('0x23')](handleError(_0x27d35e));};exports[_0x2be0('0x3c')]=function(_0x1d7540,_0xa1f755){logger[_0x2be0('0x14')](_0x2be0('0x3d'),_0x1d7540[_0x2be0('0x30')]);var _0x1c669d=answerValidation['validate'](_0x1d7540[_0x2be0('0x30')]);if(_0x1c669d['length']>0x0){return _0xa1f755[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x1c669d);}var _0x20869a=_0x1d7540[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x35eea1=_0x1d7540[_0x2be0('0x30')]['sessionId'];return getAgent(_0x20869a)[_0x2be0('0x1f')](function(_0x268d24){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x268d24[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0x268d24['name']),_0x2be0('0x3f'),{'sessionId':_0x35eea1});return _0xa1f755[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x40')});})[_0x2be0('0x23')](handleError(_0xa1f755));};exports[_0x2be0('0x41')]=function(_0x5ed58e,_0x2d3a11){logger['info'](_0x2be0('0x42'),_0x5ed58e[_0x2be0('0x30')]);var _0x5b78a1=holdValidation[_0x2be0('0xe')](_0x5ed58e[_0x2be0('0x30')]);if(_0x5b78a1[_0x2be0('0x2b')]>0x0){return _0x2d3a11[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x5b78a1);}var _0x59bb83=_0x5ed58e['body'][_0x2be0('0x3e')];var _0x362915=_0x5ed58e['body']['sessionId'];return getAgent(_0x59bb83)[_0x2be0('0x1f')](function(_0x3e6f94){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3e6f94['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3e6f94[_0x2be0('0x1b')]),_0x2be0('0x43'),{'sessionId':_0x362915});return _0x2d3a11[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x44')});})['catch'](handleError(_0x2d3a11));};exports[_0x2be0('0x45')]=function(_0x400f59,_0x52dd0c){logger[_0x2be0('0x14')](_0x2be0('0x46'),_0x400f59[_0x2be0('0x30')]);var _0x556235=unholdValidation[_0x2be0('0xe')](_0x400f59[_0x2be0('0x30')]);if(_0x556235[_0x2be0('0x2b')]>0x0){return _0x52dd0c[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x556235);}var _0x1b7c41=_0x400f59[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x2835b4=_0x400f59['body'][_0x2be0('0x2a')];return getAgent(_0x1b7c41)[_0x2be0('0x1f')](function(_0xc33e5b){logger[_0x2be0('0x14')]('entityFound:',_0xc33e5b[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0xc33e5b[_0x2be0('0x1b')]),'webbar:unhold',{'sessionId':_0x2835b4});return _0x52dd0c[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x47')});})[_0x2be0('0x23')](handleError(_0x52dd0c));};exports['calls']=function(_0xa641d7,_0x24a64a){logger[_0x2be0('0x14')](_0x2be0('0x48'),_0x24a64a[_0x2be0('0x30')]);var _0x210df5=callsValidation[_0x2be0('0xe')](_0xa641d7[_0x2be0('0x30')]);if(_0x210df5[_0x2be0('0x2b')]>0x0){return _0x24a64a['status'](0x190)[_0x2be0('0x31')](_0x210df5);}var _0x3cb80b=_0xa641d7[_0x2be0('0x30')]['userId'];var _0x38278b=respondWithRpcPromise(_0x2be0('0x26'));var _0x2ec0dc=getAgent(_0x3cb80b);return Promise[_0x2be0('0x27')]([_0x38278b,_0x2ec0dc])[_0x2be0('0x1f')](function(_0x126eda){var _0x328a16=_0x126eda[0x0];var _0x4c3e21=_0x126eda[0x1];var _0x43e76a=_[_0x2be0('0x28')](_0x328a16[_0x2be0('0x49')],function(_0x2152a1){return _0x2152a1[_0x2be0('0x29')]==_0x4c3e21['id'];});return _0x24a64a[_0x2be0('0x1c')](0xc8)['json']({'count':_0x43e76a[_0x2be0('0x2b')],'rows':_0x43e76a});})['catch'](handleError(_0x24a64a));};exports['conference']=function(_0x2d2e79,_0x3c1967){logger[_0x2be0('0x14')]('conference\x20fired:',_0x2d2e79[_0x2be0('0x30')]);var _0x436d7a=conferenceValidation[_0x2be0('0xe')](_0x2d2e79[_0x2be0('0x30')]);if(_0x436d7a[_0x2be0('0x2b')]>0x0){return _0x3c1967['status'](0x190)[_0x2be0('0x31')](_0x436d7a);}var _0x2553e0=_0x2d2e79[_0x2be0('0x30')][_0x2be0('0x3e')];return getAgent(_0x2553e0)[_0x2be0('0x1f')](function(_0x27b8e6){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x27b8e6[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x27b8e6['name']),_0x2be0('0x4a'));return _0x3c1967[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x4b')});})[_0x2be0('0x23')](handleError(_0x3c1967));};exports[_0x2be0('0x4c')]=function(_0x32ed3a,_0x2f733a){logger['info']('transfer\x20fired:',_0x32ed3a[_0x2be0('0x30')]);var _0x3a0154=transferValidation[_0x2be0('0xe')](_0x32ed3a['body']);if(_0x3a0154[_0x2be0('0x2b')]>0x0){return _0x2f733a[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x3a0154);}var _0xc34958=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x3e')];var _0xc10295=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x2a')];var _0x435a14=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x4d')];return getAgent(_0xc34958)[_0x2be0('0x1f')](function(_0x10e9a7){logger['info'](_0x2be0('0x34'),_0x10e9a7[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x10e9a7['name']),'webbar:transfer',{'sessionId':_0xc10295,'transferNumber':_0x435a14});return _0x2f733a[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x4e')});})[_0x2be0('0x23')](handleError(_0x2f733a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 29018a1..c2069c9 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 _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x192add,_0x4490e4){var _0x1b9d9d=function(_0x55084d){while(--_0x55084d){_0x192add['push'](_0x192add['shift']());}};_0x1b9d9d(++_0x4490e4);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x928b53,_0x2657b9){_0x928b53=_0x928b53-0x0;var _0x2ef2d9=_0xc6ac[_0x928b53];return _0x2ef2d9;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router; \ No newline at end of file +var _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x377bff,_0x18405e){var _0x18576e=function(_0x4a0f03){while(--_0x4a0f03){_0x377bff['push'](_0x377bff['shift']());}};_0x18576e(++_0x18405e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x31bd8b,_0x56fa02){_0x31bd8b=_0x31bd8b-0x0;var _0x1506e4=_0x0b0e[_0x31bd8b];return _0x1506e4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1198ff6..ce497a2 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 _0xdc96=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x221295,_0x263ab0){var _0x25b055=function(_0x51233d){while(--_0x51233d){_0x221295['push'](_0x221295['shift']());}};_0x25b055(++_0x263ab0);}(_0xdc96,0x164));var _0x6dc9=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xdc96[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0x6dc9('0x0'));var rs=require(_0x6dc9('0x1'));module['exports']={'name':{'type':Sequelize[_0x6dc9('0x2')],'unique':_0x6dc9('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x6dc9('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x6dc9('0x4'),_0x6dc9('0x5'))},'accountSid':{'type':Sequelize[_0x6dc9('0x2')]},'baseUrl':{'type':Sequelize[_0x6dc9('0x2')]},'authToken':{'type':Sequelize[_0x6dc9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6dc9('0x6')],'defaultValue':function(){return _0x6dc9('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6dc9('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dc9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dc9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dc9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dc9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6dc9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dc9('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6dc9('0x8')],'defaultValue':![],'comment':_0x6dc9('0xa'),'set':function(_0x28c27a){if(!_0x28c27a){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x6dc9('0xb')](_0x6dc9('0xc'),_0x28c27a);}},'description':{'type':Sequelize[_0x6dc9('0x2')]}}; \ No newline at end of file +var _0xd3da=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','STRING','name','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x1e0846,_0x4aea1b){var _0x57e5d7=function(_0x2f9fb3){while(--_0x2f9fb3){_0x1e0846['push'](_0x1e0846['shift']());}};_0x57e5d7(++_0x4aea1b);}(_0xd3da,0xa0));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xad3d('0x0'));module['exports']={'name':{'type':Sequelize[_0xad3d('0x1')],'unique':_0xad3d('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xad3d('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xad3d('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xad3d('0x1')]},'type':{'type':Sequelize[_0xad3d('0x3')]('twilio',_0xad3d('0x4'))},'accountSid':{'type':Sequelize[_0xad3d('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xad3d('0x1')]},'notificationTemplate':{'type':Sequelize[_0xad3d('0x5')],'defaultValue':function(){return _0xad3d('0x6');}},'notificationSound':{'type':Sequelize[_0xad3d('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xad3d('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xad3d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xad3d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xad3d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xad3d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xad3d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad3d('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xad3d('0x7')],'defaultValue':![],'comment':_0xad3d('0x9'),'set':function(_0x18da6e){if(!_0x18da6e){this[_0xad3d('0xa')]('mandatoryDispositionPauseId',null);}this[_0xad3d('0xa')](_0xad3d('0xb'),_0x18da6e);}},'description':{'type':Sequelize[_0xad3d('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 8e768f1..0400c22 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 _0x852d=['options','includeAll','include','findAll','rows','catch','mandatoryDispositionPause','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','WhatsappAccountId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','message_id','applications','priority','asc','CmContact','Sequelize','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','then','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x1bf4f2,_0x45c744){var _0x1a4b3c=function(_0x4ac4aa){while(--_0x4ac4aa){_0x1bf4f2['push'](_0x1bf4f2['shift']());}};_0x1a4b3c(++_0x45c744);}(_0x852d,0x12b));var _0xd852=function(_0x236386,_0x3f0e4f){_0x236386=_0x236386-0x0;var _0xb0eddd=_0x852d[_0x236386];return _0xb0eddd;};'use strict';var emlformat=require(_0xd852('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd852('0x1'));var jsonpatch=require(_0xd852('0x2'));var rp=require(_0xd852('0x3'));var moment=require('moment');var BPromise=require(_0xd852('0x4'));var Mustache=require(_0xd852('0x5'));var util=require(_0xd852('0x6'));var path=require(_0xd852('0x7'));var sox=require('sox');var csv=require(_0xd852('0x8'));var ejs=require(_0xd852('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd852('0xa'));var squel=require('squel');var crypto=require(_0xd852('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd852('0x8'));var querystring=require('querystring');var Papa=require(_0xd852('0xc'));var Redis=require('ioredis');var authService=require(_0xd852('0xd'));var qs=require(_0xd852('0xe'));var as=require(_0xd852('0xf'));var hardwareService=require(_0xd852('0x10'));var logger=require(_0xd852('0x11'))(_0xd852('0x12'));var utils=require(_0xd852('0x13'));var config=require(_0xd852('0x14'));var licenseUtil=require(_0xd852('0x15'));var db=require(_0xd852('0x16'))['db'];config[_0xd852('0x17')]=_[_0xd852('0x18')](config[_0xd852('0x17')],{'host':_0xd852('0x19'),'port':0x18eb});var socket=require(_0xd852('0x1a'))(new Redis(config['redis']));require(_0xd852('0x1b'))['register'](socket);var jayson=require(_0xd852('0x1c'));var client=jayson[_0xd852('0x1d')][_0xd852('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x22e49b,_0x161924,_0x14cb63,_0xfbf752){return new BPromise(function(_0x57690c,_0x45a733){var _0x27c72f=_0xfbf752||client;return _0x27c72f[_0xd852('0x1f')](_0x22e49b,_0x14cb63)['then'](function(_0x3f6476){logger[_0xd852('0x20')](_0xd852('0x21'),_0x161924,_0xd852('0x22'));logger[_0xd852('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x161924,'request\x20sent',JSON[_0xd852('0x24')](_0x3f6476));if(_0x3f6476[_0xd852('0x25')]){if(_0x3f6476[_0xd852('0x25')][_0xd852('0x26')]===0x1f4){logger[_0xd852('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x161924,_0x3f6476[_0xd852('0x25')][_0xd852('0x27')]);return _0x45a733(_0x3f6476[_0xd852('0x25')][_0xd852('0x27')]);}logger[_0xd852('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x161924,_0x3f6476[_0xd852('0x25')]['message']);return _0x57690c(_0x3f6476[_0xd852('0x25')][_0xd852('0x27')]);}else{logger[_0xd852('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x161924,_0xd852('0x22'));_0x57690c(_0x3f6476['result']['message']);}})['catch'](function(_0x23bbf7){logger[_0xd852('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x161924,_0x23bbf7);_0x45a733(_0x23bbf7);});});}function respondWithStatusCode(_0x201d37,_0x1c727f){_0x1c727f=_0x1c727f||0xcc;return function(_0x3caa12){if(_0x3caa12){return _0x201d37[_0xd852('0x28')](_0x1c727f);}return _0x201d37[_0xd852('0x29')](_0x1c727f)[_0xd852('0x2a')]();};}function respondWithResult(_0x2249d3,_0x19e9a1){_0x19e9a1=_0x19e9a1||0xc8;return function(_0x410129){if(_0x410129){return _0x2249d3[_0xd852('0x29')](_0x19e9a1)[_0xd852('0x2b')](_0x410129);}};}function respondWithFilteredResult(_0x30eb0d,_0x401e45){return function(_0x1b2b13){if(_0x1b2b13){var _0x4a57ff=typeof _0x401e45[_0xd852('0x2c')]==='undefined'&&typeof _0x401e45[_0xd852('0x2d')]==='undefined';var _0x39802d=_0x1b2b13[_0xd852('0x2e')];var _0x437a8f=_0x4a57ff?0x0:_0x401e45[_0xd852('0x2c')];var _0x3ba3e5=_0x4a57ff?_0x1b2b13[_0xd852('0x2e')]:_0x401e45[_0xd852('0x2c')]+_0x401e45[_0xd852('0x2d')];var _0xb7f93a;if(_0x3ba3e5>=_0x39802d){_0x3ba3e5=_0x39802d;_0xb7f93a=0xc8;}else{_0xb7f93a=0xce;}_0x30eb0d['status'](_0xb7f93a);return _0x30eb0d[_0xd852('0x2f')](_0xd852('0x30'),_0x437a8f+'-'+_0x3ba3e5+'/'+_0x39802d)[_0xd852('0x2b')](_0x1b2b13);}return null;};}function patchUpdates(_0x2f8b17){return function(_0x23db88){try{jsonpatch[_0xd852('0x31')](_0x23db88,_0x2f8b17,!![]);}catch(_0x1b2dda){return BPromise[_0xd852('0x32')](_0x1b2dda);}return _0x23db88['save']();};}function saveUpdates(_0x304768,_0x387f4a){return function(_0x1cc36c){if(_0x1cc36c){return _0x1cc36c[_0xd852('0x33')](_0x304768)['then'](function(_0x1cacdf){return _0x1cacdf;});}return null;};}function removeEntity(_0x4e462a,_0x37f5e9){return function(_0x13ce85){if(_0x13ce85){return _0x13ce85[_0xd852('0x34')]()['then'](function(){var _0x255365=_0x13ce85['get']({'plain':!![]});var _0x3e6c3a=_0xd852('0x35');return db[_0xd852('0x36')]['destroy']({'where':{'type':_0x3e6c3a,'resourceId':_0x255365['id']}})[_0xd852('0x37')](function(){return _0x13ce85;});})['then'](function(){_0x4e462a[_0xd852('0x29')](0xcc)[_0xd852('0x2a')]();});}};}function handleEntityNotFound(_0x19cb4e,_0x48bd5f){return function(_0x3d5ddf){if(!_0x3d5ddf){_0x19cb4e[_0xd852('0x28')](0x194);}return _0x3d5ddf;};}function handleError(_0x496827,_0x476c79){_0x476c79=_0x476c79||0x1f4;return function(_0x439cd4){logger[_0xd852('0x25')](_0x439cd4[_0xd852('0x38')]);if(_0x439cd4[_0xd852('0x39')]){delete _0x439cd4[_0xd852('0x39')];}_0x496827[_0xd852('0x29')](_0x476c79)[_0xd852('0x3a')](_0x439cd4);};}exports[_0xd852('0x3b')]=function(_0xc8d5bc,_0x2e0623){var _0x556cff={'include':[{'model':db[_0xd852('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4b5408={},_0x1e9aea={'count':0x0,'rows':[]};var _0x237c97=_[_0xd852('0x3d')](db[_0xd852('0x3e')][_0xd852('0x3f')],function(_0x28adc7){return{'name':_0x28adc7[_0xd852('0x40')],'type':_0x28adc7[_0xd852('0x41')]['key']};});_0x4b5408['model']=_[_0xd852('0x3d')](_0x237c97,_0xd852('0x39'));_0x4b5408[_0xd852('0x42')]=_['keys'](_0xc8d5bc[_0xd852('0x42')]);_0x4b5408[_0xd852('0x43')]=_[_0xd852('0x44')](_0x4b5408[_0xd852('0x45')],_0x4b5408[_0xd852('0x42')]);_0x556cff['attributes']=_[_0xd852('0x44')](_0x4b5408[_0xd852('0x45')],qs[_0xd852('0x46')](_0xc8d5bc[_0xd852('0x42')]['fields']));_0x556cff[_0xd852('0x47')]=_0x556cff['attributes'][_0xd852('0x48')]?_0x556cff['attributes']:_0x4b5408[_0xd852('0x45')];if(!_0xc8d5bc[_0xd852('0x42')]['hasOwnProperty'](_0xd852('0x49'))){_0x556cff[_0xd852('0x2d')]=qs['limit'](_0xc8d5bc[_0xd852('0x42')]['limit']);_0x556cff[_0xd852('0x2c')]=qs['offset'](_0xc8d5bc[_0xd852('0x42')][_0xd852('0x2c')]);}_0x556cff[_0xd852('0x4a')]=qs[_0xd852('0x4b')](_0xc8d5bc[_0xd852('0x42')][_0xd852('0x4b')]);_0x556cff[_0xd852('0x4c')]=qs[_0xd852('0x43')](_[_0xd852('0x4d')](_0xc8d5bc[_0xd852('0x42')],_0x4b5408[_0xd852('0x43')]),_0x237c97);if(_0xc8d5bc[_0xd852('0x42')][_0xd852('0x4e')]){_0x556cff[_0xd852('0x4c')]=_[_0xd852('0x4f')](_0x556cff[_0xd852('0x4c')],{'$or':_[_0xd852('0x3d')](_0x237c97,function(_0x1c1f30){if(_0x1c1f30[_0xd852('0x41')]!==_0xd852('0x50')){var _0x15ccb7={};_0x15ccb7[_0x1c1f30[_0xd852('0x39')]]={'$like':'%'+_0xc8d5bc[_0xd852('0x42')][_0xd852('0x4e')]+'%'};return _0x15ccb7;}})});}_0x556cff=_[_0xd852('0x4f')]({},_0x556cff,_0xc8d5bc[_0xd852('0x51')]);var _0xa4b942={'where':_0x556cff[_0xd852('0x4c')]};return db['WhatsappAccount']['count'](_0xa4b942)[_0xd852('0x37')](function(_0x46dfb5){_0x1e9aea[_0xd852('0x2e')]=_0x46dfb5;if(_0xc8d5bc[_0xd852('0x42')][_0xd852('0x52')]){_0x556cff[_0xd852('0x53')]=[{'all':!![]}];}return db[_0xd852('0x3e')][_0xd852('0x54')](_0x556cff);})[_0xd852('0x37')](function(_0x42be8a){_0x1e9aea[_0xd852('0x55')]=_0x42be8a;return _0x1e9aea;})['then'](respondWithFilteredResult(_0x2e0623,_0x556cff))[_0xd852('0x56')](handleError(_0x2e0623,null));};exports['show']=function(_0x41cb98,_0x5afe7e){var _0x4da8ae={'raw':![],'where':{'id':_0x41cb98['params']['id']},'include':[{'model':db[_0xd852('0x3c')],'as':_0xd852('0x57')}]},_0x4ce12e={};_0x4ce12e[_0xd852('0x45')]=_[_0xd852('0x58')](db['WhatsappAccount']['rawAttributes']);_0x4ce12e[_0xd852('0x42')]=_[_0xd852('0x58')](_0x41cb98[_0xd852('0x42')]);_0x4ce12e[_0xd852('0x43')]=_[_0xd852('0x44')](_0x4ce12e[_0xd852('0x45')],_0x4ce12e[_0xd852('0x42')]);_0x4da8ae[_0xd852('0x47')]=_[_0xd852('0x44')](_0x4ce12e[_0xd852('0x45')],qs[_0xd852('0x46')](_0x41cb98['query']['fields']));_0x4da8ae['attributes']=_0x4da8ae[_0xd852('0x47')][_0xd852('0x48')]?_0x4da8ae['attributes']:_0x4ce12e[_0xd852('0x45')];if(_0x41cb98[_0xd852('0x42')]['includeAll']){_0x4da8ae[_0xd852('0x53')]=[{'all':!![]}];}_0x4da8ae=_[_0xd852('0x4f')]({},_0x4da8ae,_0x41cb98[_0xd852('0x51')]);return db['WhatsappAccount'][_0xd852('0x59')](_0x4da8ae)[_0xd852('0x37')](handleEntityNotFound(_0x5afe7e,null))['then'](respondWithResult(_0x5afe7e,null))[_0xd852('0x56')](handleError(_0x5afe7e,null));};exports[_0xd852('0x5a')]=function(_0x2ae083,_0xf5fb87){return db[_0xd852('0x3e')][_0xd852('0x5a')](_0x2ae083['body'],{})['then'](function(_0x46cfc9){var _0x53cf6f=_0x2ae083[_0xd852('0x5b')][_0xd852('0x5c')]({'plain':!![]});if(!_0x53cf6f)throw new Error(_0xd852('0x5d'));if(_0x53cf6f[_0xd852('0x5e')]==='user'){var _0x307fb3=_0x46cfc9[_0xd852('0x5c')]({'plain':!![]});var _0x445592=_0xd852('0x35');return db[_0xd852('0x5f')][_0xd852('0x59')]({'where':{'name':_0x445592,'userProfileId':_0x53cf6f['userProfileId']},'raw':!![]})['then'](function(_0x54e8fd){if(_0x54e8fd&&_0x54e8fd[_0xd852('0x60')]===0x0){return db[_0xd852('0x36')]['create']({'name':_0x307fb3['name'],'resourceId':_0x307fb3['id'],'type':_0x54e8fd['name'],'sectionId':_0x54e8fd['id']},{})[_0xd852('0x37')](function(){return _0x46cfc9;});}else{return _0x46cfc9;}})[_0xd852('0x56')](function(_0x8072ee){logger[_0xd852('0x25')](_0xd852('0x61'),_0x8072ee);throw _0x8072ee;});}return _0x46cfc9;})[_0xd852('0x37')](respondWithResult(_0xf5fb87,0xc9))['catch'](handleError(_0xf5fb87,null));};exports[_0xd852('0x33')]=function(_0x3361ce,_0x3e4ec4){if(_0x3361ce[_0xd852('0x62')]['id']){delete _0x3361ce[_0xd852('0x62')]['id'];}return db[_0xd852('0x3e')]['find']({'where':{'id':_0x3361ce[_0xd852('0x63')]['id']},'include':[{'model':db[_0xd852('0x3c')],'as':_0xd852('0x57')}]})['then'](handleEntityNotFound(_0x3e4ec4,null))[_0xd852('0x37')](saveUpdates(_0x3361ce[_0xd852('0x62')],null))[_0xd852('0x37')](respondWithResult(_0x3e4ec4,null))[_0xd852('0x56')](handleError(_0x3e4ec4,null));};exports['destroy']=function(_0x37e709,_0x5cdc8a){return db[_0xd852('0x3e')]['find']({'where':{'id':_0x37e709[_0xd852('0x63')]['id']}})['then'](handleEntityNotFound(_0x5cdc8a,null))['then'](removeEntity(_0x5cdc8a,null))[_0xd852('0x56')](handleError(_0x5cdc8a,null));};exports[_0xd852('0x64')]=function(_0x4c294a,_0x3ab0b1){return db[_0xd852('0x3e')][_0xd852('0x64')]()[_0xd852('0x37')](respondWithResult(_0x3ab0b1,null))[_0xd852('0x56')](handleError(_0x3ab0b1,null));};exports['addDisposition']=function(_0x2ff146,_0x113e2b,_0x55025c){if(_0x2ff146[_0xd852('0x62')]['id']){delete _0x2ff146[_0xd852('0x62')]['id'];}return db[_0xd852('0x3e')][_0xd852('0x59')]({'where':{'id':_0x2ff146[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x113e2b,null))[_0xd852('0x37')](function(_0x38a74c){if(_0x38a74c){_0x2ff146[_0xd852('0x62')][_0xd852('0x65')]=_0x38a74c['id'];return db['Disposition']['create'](_0x2ff146[_0xd852('0x62')]);}})[_0xd852('0x37')](respondWithResult(_0x113e2b,null))[_0xd852('0x56')](handleError(_0x113e2b,null));};exports['getDispositions']=function(_0xa5adb2,_0x16e5de,_0x45e80e){var _0x56a61e={'raw':![],'where':{}};var _0x2cbf33={};var _0x51a5fc={'count':0x0,'rows':[]};return db[_0xd852('0x3e')][_0xd852('0x66')]({'where':{'id':_0xa5adb2['params']['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x16e5de,null))[_0xd852('0x37')](function(_0x1fc175){if(_0x1fc175){_0x2cbf33['model']=_[_0xd852('0x58')](db[_0xd852('0x67')][_0xd852('0x3f')]);_0x2cbf33[_0xd852('0x42')]=_['keys'](_0xa5adb2[_0xd852('0x42')]);_0x2cbf33[_0xd852('0x43')]=_[_0xd852('0x44')](_0x2cbf33[_0xd852('0x45')],_0x2cbf33['query']);_0x56a61e[_0xd852('0x47')]=_[_0xd852('0x44')](_0x2cbf33[_0xd852('0x45')],qs[_0xd852('0x46')](_0xa5adb2[_0xd852('0x42')]['fields']));_0x56a61e[_0xd852('0x47')]=_0x56a61e['attributes'][_0xd852('0x48')]?_0x56a61e[_0xd852('0x47')]:_0x2cbf33[_0xd852('0x45')];if(!_0xa5adb2[_0xd852('0x42')][_0xd852('0x68')](_0xd852('0x49'))){_0x56a61e['limit']=qs[_0xd852('0x2d')](_0xa5adb2[_0xd852('0x42')][_0xd852('0x2d')]);_0x56a61e[_0xd852('0x2c')]=qs[_0xd852('0x2c')](_0xa5adb2[_0xd852('0x42')][_0xd852('0x2c')]);}_0x56a61e[_0xd852('0x4a')]=qs[_0xd852('0x4b')](_0xa5adb2[_0xd852('0x42')][_0xd852('0x4b')]);_0x56a61e[_0xd852('0x4c')]=qs[_0xd852('0x43')](_[_0xd852('0x4d')](_0xa5adb2['query'],_0x2cbf33['filters']));_0x56a61e[_0xd852('0x4c')][_0xd852('0x65')]=_0x1fc175['id'];if(_0xa5adb2[_0xd852('0x42')][_0xd852('0x4e')]){_0x56a61e['where']=_[_0xd852('0x4f')](_0x56a61e['where'],{'$or':_[_0xd852('0x3d')](_0x56a61e[_0xd852('0x47')],function(_0x549f57){var _0xc2cb84={};_0xc2cb84[_0x549f57]={'$like':'%'+_0xa5adb2[_0xd852('0x42')]['filter']+'%'};return _0xc2cb84;})});}_0x56a61e=_['merge']({},_0x56a61e,_0xa5adb2[_0xd852('0x51')]);return db[_0xd852('0x67')][_0xd852('0x2e')]({'where':_0x56a61e[_0xd852('0x4c')]})['then'](function(_0x4c4bc3){_0x51a5fc[_0xd852('0x2e')]=_0x4c4bc3;if(_0xa5adb2[_0xd852('0x42')][_0xd852('0x52')]){_0x56a61e[_0xd852('0x53')]=[{'all':!![]}];}return db[_0xd852('0x67')][_0xd852('0x54')](_0x56a61e);})[_0xd852('0x37')](function(_0xb569ee){_0x51a5fc[_0xd852('0x55')]=_0xb569ee;return _0x51a5fc;});}})[_0xd852('0x37')](respondWithFilteredResult(_0x16e5de,_0x56a61e))[_0xd852('0x56')](handleError(_0x16e5de,null));};exports[_0xd852('0x69')]=function(_0x3acb1d,_0x442b47,_0x533a24){return db[_0xd852('0x3e')]['find']({'where':{'id':_0x3acb1d['params']['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x442b47,null))['then'](function(_0x11d695){if(_0x11d695){return _0x11d695['removeDispositions'](_0x3acb1d['query'][_0xd852('0x6a')]);}})['then'](respondWithStatusCode(_0x442b47,null))[_0xd852('0x56')](handleError(_0x442b47,null));};exports[_0xd852('0x6b')]=function(_0x112fb4,_0x3ef761,_0x47c68a){if(_0x112fb4['body']['id']){delete _0x112fb4[_0xd852('0x62')]['id'];}return db[_0xd852('0x3e')]['find']({'where':{'id':_0x112fb4[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x3ef761,null))['then'](function(_0x1e3e95){if(_0x1e3e95){_0x112fb4[_0xd852('0x62')][_0xd852('0x65')]=_0x1e3e95['id'];return db[_0xd852('0x6c')][_0xd852('0x5a')](_0x112fb4[_0xd852('0x62')]);}})[_0xd852('0x37')](respondWithResult(_0x3ef761,null))['catch'](handleError(_0x3ef761,null));};exports[_0xd852('0x6d')]=function(_0x59f9dc,_0x3a6365,_0x2cb3e3){var _0x347057={'raw':![],'where':{}};var _0x159311={};var _0x598cc7={'count':0x0,'rows':[]};return db[_0xd852('0x3e')][_0xd852('0x66')]({'where':{'id':_0x59f9dc[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x3a6365,null))[_0xd852('0x37')](function(_0x53289e){if(_0x53289e){_0x159311[_0xd852('0x45')]=_['keys'](db[_0xd852('0x6c')][_0xd852('0x3f')]);_0x159311[_0xd852('0x42')]=_[_0xd852('0x58')](_0x59f9dc[_0xd852('0x42')]);_0x159311[_0xd852('0x43')]=_['intersection'](_0x159311['model'],_0x159311[_0xd852('0x42')]);_0x347057[_0xd852('0x47')]=_[_0xd852('0x44')](_0x159311[_0xd852('0x45')],qs['fields'](_0x59f9dc[_0xd852('0x42')][_0xd852('0x46')]));_0x347057[_0xd852('0x47')]=_0x347057[_0xd852('0x47')][_0xd852('0x48')]?_0x347057['attributes']:_0x159311[_0xd852('0x45')];if(!_0x59f9dc[_0xd852('0x42')]['hasOwnProperty'](_0xd852('0x49'))){_0x347057['limit']=qs[_0xd852('0x2d')](_0x59f9dc[_0xd852('0x42')][_0xd852('0x2d')]);_0x347057[_0xd852('0x2c')]=qs['offset'](_0x59f9dc[_0xd852('0x42')]['offset']);}_0x347057[_0xd852('0x4a')]=qs['sort'](_0x59f9dc[_0xd852('0x42')]['sort']);_0x347057['where']=qs[_0xd852('0x43')](_[_0xd852('0x4d')](_0x59f9dc[_0xd852('0x42')],_0x159311[_0xd852('0x43')]));_0x347057['where']['WhatsappAccountId']=_0x53289e['id'];if(_0x59f9dc[_0xd852('0x42')][_0xd852('0x4e')]){_0x347057[_0xd852('0x4c')]=_[_0xd852('0x4f')](_0x347057['where'],{'$or':_[_0xd852('0x3d')](_0x347057['attributes'],function(_0x9d763){var _0x444cbc={};_0x444cbc[_0x9d763]={'$like':'%'+_0x59f9dc['query'][_0xd852('0x4e')]+'%'};return _0x444cbc;})});}_0x347057=_['merge']({},_0x347057,_0x59f9dc[_0xd852('0x51')]);return db[_0xd852('0x6c')][_0xd852('0x2e')]({'where':_0x347057['where']})[_0xd852('0x37')](function(_0x3da9a0){_0x598cc7[_0xd852('0x2e')]=_0x3da9a0;if(_0x59f9dc[_0xd852('0x42')][_0xd852('0x52')]){_0x347057[_0xd852('0x53')]=[{'all':!![]}];}return db[_0xd852('0x6c')][_0xd852('0x54')](_0x347057);})[_0xd852('0x37')](function(_0x5f26c7){_0x598cc7[_0xd852('0x55')]=_0x5f26c7;return _0x598cc7;});}})['then'](respondWithFilteredResult(_0x3a6365,_0x347057))[_0xd852('0x56')](handleError(_0x3a6365,null));};exports[_0xd852('0x6e')]=function(_0x297781,_0x281f19,_0x46f023){return db[_0xd852('0x3e')][_0xd852('0x59')]({'where':{'id':_0x297781[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x281f19,null))['then'](function(_0x320c83){if(_0x320c83){return _0x320c83[_0xd852('0x6e')](_0x297781[_0xd852('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x281f19,null))['catch'](handleError(_0x281f19,null));};exports['addAgents']=function(_0x411048,_0x2015e4,_0x123acb){return db['WhatsappAccount'][_0xd852('0x59')]({'where':{'id':_0x411048[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x2015e4,null))[_0xd852('0x37')](function(_0x1228cf){if(_0x1228cf){return _0x1228cf[_0xd852('0x6f')](_0x411048[_0xd852('0x62')]['ids'],_[_0xd852('0x70')](_0x411048[_0xd852('0x62')],[_0xd852('0x6a'),'id'])||{})[_0xd852('0x71')](function(_0x13eca2){for(var _0x3f4d77=0x0;_0x3f4d77<_0x411048[_0xd852('0x62')]['ids'][_0xd852('0x48')];_0x3f4d77+=0x1){socket[_0xd852('0x72')](_0xd852('0x73'),{'UserId':Number(_0x411048[_0xd852('0x62')][_0xd852('0x6a')][_0x3f4d77]),'WhatsappAccountId':Number(_0x411048[_0xd852('0x63')]['id'])});}return _0x13eca2;});}})[_0xd852('0x37')](respondWithResult(_0x2015e4,null))[_0xd852('0x56')](handleError(_0x2015e4,null));};exports[_0xd852('0x74')]=function(_0x355aa0,_0x32909b,_0x1b75d2){return db['WhatsappAccount']['find']({'where':{'id':_0x355aa0['params']['id']}})['then'](handleEntityNotFound(_0x32909b,null))[_0xd852('0x37')](function(_0x44ca26){if(_0x44ca26){return _0x44ca26[_0xd852('0x74')](_0x355aa0[_0xd852('0x42')][_0xd852('0x6a')])['then'](function(){if(_[_0xd852('0x75')](_0x355aa0['query']['ids'])){for(var _0x38c6e8=0x0;_0x38c6e8<_0x355aa0[_0xd852('0x42')][_0xd852('0x6a')][_0xd852('0x48')];_0x38c6e8+=0x1){socket['emit'](_0xd852('0x76'),{'UserId':Number(_0x355aa0[_0xd852('0x42')][_0xd852('0x6a')][_0x38c6e8]),'WhatsappAccountId':Number(_0x355aa0[_0xd852('0x63')]['id'])});}}else{socket[_0xd852('0x72')](_0xd852('0x76'),{'UserId':Number(_0x355aa0[_0xd852('0x42')]['ids']),'WhatsappAccountId':Number(_0x355aa0[_0xd852('0x63')]['id'])});}});}})[_0xd852('0x37')](respondWithStatusCode(_0x32909b,null))[_0xd852('0x56')](handleError(_0x32909b,null));};exports[_0xd852('0x77')]=function(_0x524d93,_0x29bc8d,_0x18c6f8){var _0x129f8c={};var _0x1dd674={};var _0x495418;var _0x4a1a69;return db[_0xd852('0x3e')]['findOne']({'where':{'id':_0x524d93['params']['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x29bc8d,null))['then'](function(_0x3b1371){if(_0x3b1371){_0x495418=_0x3b1371;_0x1dd674[_0xd852('0x45')]=_[_0xd852('0x58')](db[_0xd852('0x78')]['rawAttributes']);_0x1dd674['query']=_[_0xd852('0x58')](_0x524d93[_0xd852('0x42')]);_0x1dd674[_0xd852('0x43')]=_['intersection'](_0x1dd674['model'],_0x1dd674[_0xd852('0x42')]);_0x129f8c[_0xd852('0x47')]=_[_0xd852('0x44')](_0x1dd674[_0xd852('0x45')],qs[_0xd852('0x46')](_0x524d93['query'][_0xd852('0x46')]));_0x129f8c[_0xd852('0x47')]=_0x129f8c[_0xd852('0x47')]['length']?_0x129f8c['attributes']:_0x1dd674['model'];_0x129f8c[_0xd852('0x4a')]=qs[_0xd852('0x4b')](_0x524d93[_0xd852('0x42')][_0xd852('0x4b')]);_0x129f8c[_0xd852('0x4c')]=qs[_0xd852('0x43')](_[_0xd852('0x4d')](_0x524d93[_0xd852('0x42')],_0x1dd674[_0xd852('0x43')]));if(_0x524d93[_0xd852('0x42')][_0xd852('0x4e')]){_0x129f8c['where']=_[_0xd852('0x4f')](_0x129f8c[_0xd852('0x4c')],{'$or':_[_0xd852('0x3d')](_0x129f8c[_0xd852('0x47')],function(_0x1b8966){var _0x567c5e={};_0x567c5e[_0x1b8966]={'$like':'%'+_0x524d93['query'][_0xd852('0x4e')]+'%'};return _0x567c5e;})});}_0x129f8c=_[_0xd852('0x4f')]({},_0x129f8c,_0x524d93[_0xd852('0x51')]);return _0x495418[_0xd852('0x77')](_0x129f8c);}})[_0xd852('0x37')](function(_0x19029b){if(_0x19029b){_0x4a1a69=_0x19029b['length'];if(!_0x524d93[_0xd852('0x42')][_0xd852('0x68')]('nolimit')){_0x129f8c[_0xd852('0x2d')]=qs[_0xd852('0x2d')](_0x524d93[_0xd852('0x42')]['limit']);_0x129f8c[_0xd852('0x2c')]=qs[_0xd852('0x2c')](_0x524d93[_0xd852('0x42')]['offset']);}return _0x495418[_0xd852('0x77')](_0x129f8c);}})[_0xd852('0x37')](function(_0x1e510f){if(_0x1e510f){return _0x1e510f?{'count':_0x4a1a69,'rows':_0x1e510f}:null;}})[_0xd852('0x37')](respondWithResult(_0x29bc8d,null))[_0xd852('0x56')](handleError(_0x29bc8d,null));};exports[_0xd852('0x79')]=function(_0x446559,_0x2d5a4a){var _0x28254c=_0x446559[_0xd852('0x63')]['id'];var _0x764c34=_0x446559['body'];var _0x30f0e5=0xc8;var _0x5a220f=null;return db[_0xd852('0x7a')][_0xd852('0x7b')]({'isolationLevel':db[_0xd852('0x7a')]['Transaction'][_0xd852('0x7c')][_0xd852('0x7d')]},function(_0x4da672){return db[_0xd852('0x3e')]['findOne']({'where':{'id':_0x28254c},'transaction':_0x4da672})[_0xd852('0x37')](function(_0x249b63){if(_0x249b63){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x28254c},'transaction':_0x4da672})[_0xd852('0x37')](function(){var _0x1aeb6c=_['map'](_0x764c34,function(_0x127138){_0x127138[_0xd852('0x65')]=_0x28254c;return _0x127138;});return db[_0xd852('0x7e')][_0xd852('0x7f')](_0x1aeb6c,{'transaction':_0x4da672});});}else{_0x30f0e5=0x194;_0x5a220f=[];}});})[_0xd852('0x37')](function(){if(_0x30f0e5!==0x194){return db[_0xd852('0x7e')][_0xd852('0x80')]({'where':{'WhatsappAccountId':_0x28254c},'order':'priority'})[_0xd852('0x37')](function(_0x480fe2){_0x5a220f=_0x480fe2;});}})[_0xd852('0x56')](function(_0xc2fd71){_0x30f0e5=0x1f4;logger['error'](_0xc2fd71['stack']);if(_0xc2fd71['name']){delete _0xc2fd71['name'];}_0x5a220f=_0xc2fd71;})[_0xd852('0x81')](function(){if(_0x5a220f===null){_0x2d5a4a[_0xd852('0x28')](_0x30f0e5);}else{if(_0x30f0e5===0x1f4){_0x2d5a4a[_0xd852('0x29')](_0x30f0e5)[_0xd852('0x3a')](_0x5a220f);}else{_0x2d5a4a[_0xd852('0x29')](_0x30f0e5)['json'](_0x5a220f);}}});};exports[_0xd852('0x82')]=function(_0x3cb6ff,_0x50c296,_0x3fcdf8){var _0x4c0d36={};var _0xb454f1={};var _0x4a22af;var _0x276406;return db[_0xd852('0x3e')]['findOne']({'where':{'id':_0x3cb6ff[_0xd852('0x63')]['id']}})[_0xd852('0x37')](handleEntityNotFound(_0x50c296,null))[_0xd852('0x37')](function(_0x480e1e){if(_0x480e1e){_0x4a22af=_0x480e1e;_0xb454f1[_0xd852('0x45')]=_[_0xd852('0x58')](db[_0xd852('0x7e')][_0xd852('0x3f')]);_0xb454f1['query']=_[_0xd852('0x58')](_0x3cb6ff['query']);_0xb454f1['filters']=_['intersection'](_0xb454f1[_0xd852('0x45')],_0xb454f1['query']);_0x4c0d36[_0xd852('0x47')]=_[_0xd852('0x44')](_0xb454f1[_0xd852('0x45')],qs[_0xd852('0x46')](_0x3cb6ff[_0xd852('0x42')]['fields']));_0x4c0d36[_0xd852('0x47')]=_0x4c0d36['attributes'][_0xd852('0x48')]?_0x4c0d36[_0xd852('0x47')]:_0xb454f1['model'];_0x4c0d36[_0xd852('0x4a')]=qs[_0xd852('0x4b')](_0x3cb6ff['query'][_0xd852('0x4b')]);_0x4c0d36[_0xd852('0x4c')]=qs[_0xd852('0x43')](_['pick'](_0x3cb6ff['query'],_0xb454f1[_0xd852('0x43')]));if(_0x3cb6ff[_0xd852('0x42')][_0xd852('0x4e')]){_0x4c0d36[_0xd852('0x4c')]=_[_0xd852('0x4f')](_0x4c0d36[_0xd852('0x4c')],{'$or':_[_0xd852('0x3d')](_0x4c0d36[_0xd852('0x47')],function(_0xeb24fb){var _0x32ef56={};_0x32ef56[_0xeb24fb]={'$like':'%'+_0x3cb6ff[_0xd852('0x42')]['filter']+'%'};return _0x32ef56;})});}_0x4c0d36=_[_0xd852('0x4f')]({},_0x4c0d36,_0x3cb6ff['options']);return _0x4a22af[_0xd852('0x82')](_0x4c0d36);}})[_0xd852('0x37')](function(_0x2b7fea){if(_0x2b7fea){_0x276406=_0x2b7fea[_0xd852('0x48')];if(!_0x3cb6ff['query'][_0xd852('0x68')]('nolimit')){_0x4c0d36[_0xd852('0x2d')]=qs['limit'](_0x3cb6ff[_0xd852('0x42')][_0xd852('0x2d')]);_0x4c0d36[_0xd852('0x2c')]=qs[_0xd852('0x2c')](_0x3cb6ff[_0xd852('0x42')][_0xd852('0x2c')]);}return _0x4a22af[_0xd852('0x82')](_0x4c0d36);}})[_0xd852('0x37')](function(_0x7f8b70){if(_0x7f8b70){return _0x7f8b70?{'count':_0x276406,'rows':_0x7f8b70}:null;}})[_0xd852('0x37')](respondWithResult(_0x50c296,null))[_0xd852('0x56')](handleError(_0x50c296,null));};exports[_0xd852('0x83')]=function(_0xcdc143,_0x233624,_0xae8107){var _0x1eaf5d={'channel':_0xd852('0x84')};var _0x1d29bf=[];var _0x483cf8=[];var _0x5a966e={};return db['WhatsappAccount'][_0xd852('0x59')]({'where':{'id':_0xcdc143['params']['id']},'include':[{'model':db[_0xd852('0x7e')],'as':_0xd852('0x85')}]})['then'](handleEntityNotFound(_0x233624,null))['then'](function(_0x52bc2f){_0x1eaf5d[_0xd852('0x86')]=_0x52bc2f;if(_0x1eaf5d['account']&&_0x1eaf5d[_0xd852('0x86')][_0xd852('0x41')]===_0xd852('0x87')&&_0xcdc143[_0xd852('0x62')][_0xd852('0x88')]){if(_0xcdc143[_0xd852('0x62')]['statuses'][_0xd852('0x48')]===0x0)return;if(_0xcdc143[_0xd852('0x62')][_0xd852('0x88')][0x0]['state']!=='read')return;return db['WhatsappMessage'][_0xd852('0x33')]({'read':!![],'readAt':_0xcdc143[_0xd852('0x62')][_0xd852('0x88')][0x0]['timestamp']},{'where':{'messageId':_0xcdc143['body'][_0xd852('0x88')][0x0][_0xd852('0x89')]},'individualHooks':!![]})['then'](function(_0x96e8d8){return _0x233624[_0xd852('0x29')](0xc8)[_0xd852('0x2b')](_0x96e8d8);});}_0x1eaf5d[_0xd852('0x8a')]=_['orderBy'](_0x52bc2f[_0xd852('0x85')],[_0xd852('0x8b')],[_0xd852('0x8c')]);if(_0x1eaf5d[_0xd852('0x86')][_0xd852('0x85')]){delete _0x1eaf5d[_0xd852('0x86')][_0xd852('0x85')];}return db[_0xd852('0x8d')]['describe']()[_0xd852('0x37')](function(_0x643e0a){if(!_0x643e0a){throw new db[(_0xd852('0x8e'))]['ValidationError']('no\x20available\x20attributes');}_0x1d29bf=_[_0xd852('0x8f')](_['keys'](_0x643e0a),[_0xd852('0x90'),_0xd852('0x91')]);_0x483cf8=_[_0xd852('0x8f')](_[_0xd852('0x58')](_0x643e0a),[_0xd852('0x90'),_0xd852('0x91'),'CompanyId',_0xd852('0x92')]);_0x1eaf5d[_0xd852('0x62')]={'mapKey':_0xd852('0x93')};if(_0x1eaf5d[_0xd852('0x86')]&&_0x1eaf5d[_0xd852('0x86')][_0xd852('0x41')]===_0xd852('0x94')){_0x1eaf5d[_0xd852('0x62')][_0xd852('0x95')]=_0xcdc143[_0xd852('0x62')][_0xd852('0x96')][_0xd852('0x97')](_0xd852('0x98'),'');_0x1eaf5d[_0xd852('0x62')][_0xd852('0x62')]=_0xcdc143[_0xd852('0x62')][_0xd852('0x99')];_0x1eaf5d[_0xd852('0x62')][_0xd852('0x9a')]=_0xcdc143[_0xd852('0x62')][_0xd852('0x9b')];}if(_0x1eaf5d[_0xd852('0x86')]&&_0x1eaf5d[_0xd852('0x86')][_0xd852('0x41')]===_0xd852('0x87')){_0x1eaf5d[_0xd852('0x62')][_0xd852('0x95')]=_0xcdc143[_0xd852('0x62')][_0xd852('0x9c')][0x0][_0xd852('0x95')];_0x1eaf5d['body'][_0xd852('0x62')]=_0xcdc143['body'][_0xd852('0x9c')][0x0]['message'][_0xd852('0x62')];_0x1eaf5d['body'][_0xd852('0x9a')]=_0xcdc143['body']['notifications'][0x0][_0xd852('0x89')];}if(_0x1eaf5d[_0xd852('0x62')]['id']){delete _0x1eaf5d['body']['id'];}if(_['isNil'](_0x1eaf5d[_0xd852('0x62')][_0xd852('0x95')])){throw new db[(_0xd852('0x8e'))][(_0xd852('0x9d'))]('from\x20is\x20mandatory');}if(_[_0xd852('0x9e')](_0x1eaf5d[_0xd852('0x62')][_0xd852('0x62')])||_0x1eaf5d[_0xd852('0x62')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xd852('0x9f'));}if(_[_0xd852('0x9e')](_0x1eaf5d[_0xd852('0x62')]['mapKey'])){throw new db[(_0xd852('0x8e'))][(_0xd852('0x9d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x483cf8);}if(!_[_0xd852('0xa0')](_0x483cf8,_0x1eaf5d['body'][_0xd852('0xa1')])){throw new db[(_0xd852('0x8e'))][(_0xd852('0x9d'))](_0xd852('0xa2')+_0x483cf8);}_0x5a966e[_0x1eaf5d[_0xd852('0x62')][_0xd852('0xa1')]]=_0x1eaf5d['body'][_0xd852('0x95')];return db[_0xd852('0xa3')][_0xd852('0x59')]({'where':{'id':_0x1eaf5d[_0xd852('0x86')][_0xd852('0x92')]},'include':[{'model':db[_0xd852('0x8d')],'as':'Contacts','where':_0x5a966e,'limit':0x1,'order':[[_0xd852('0x91'),_0xd852('0xa4')]]}]});})['then'](handleEntityNotFound(_0x233624,null))['then'](function(_0x2b6626){if(_0x2b6626){_0x1eaf5d[_0xd852('0xa5')]=_[_0xd852('0x70')](_0x2b6626,[_0xd852('0xa6')]);if(_0x2b6626[_0xd852('0xa6')]['length']){return _0x2b6626[_0xd852('0xa6')][0x0];}var _0x4885f7=_[_0xd852('0x18')](_0x1eaf5d['body'],{'firstName':_0x1eaf5d[_0xd852('0x62')]['from'],'ListId':_0x2b6626['id']});_0x4885f7[_0x1eaf5d['body'][_0xd852('0xa1')]]=_0x1eaf5d[_0xd852('0x62')][_0xd852('0x95')];return db[_0xd852('0x8d')][_0xd852('0x5a')](_0x4885f7,{'fields':_0x1d29bf,'raw':!![]});}})[_0xd852('0x37')](handleEntityNotFound(_0x233624,null))[_0xd852('0x37')](function(_0x4ab559){if(_0x4ab559){_0x1eaf5d[_0xd852('0xa7')]=_0x4ab559;var _0x50d8ef={'ContactId':_0x4ab559['id'],'phone':_0x1eaf5d[_0xd852('0x62')]['from'],'WhatsappAccountId':_0xcdc143[_0xd852('0x63')]['id']};var _0x4a54be={'ContactId':_0x4ab559['id'],'WhatsappAccountId':_0xcdc143[_0xd852('0x63')]['id'],'closed':![]};return db[_0xd852('0xa8')][_0xd852('0x59')]({'where':_0x4a54be})['then'](function(_0xd8f9b0){if(_0xd8f9b0){return[_0xd8f9b0,![]];}return db['WhatsappInteraction'][_0xd852('0x5a')](_0x50d8ef)['then'](function(_0x429e3b){return[_0x429e3b,!![]];});});}})[_0xd852('0x71')](function(_0x4b9701,_0x50c085){_0x1eaf5d[_0xd852('0xa9')]=_0x4b9701['get']({'plain':!![]});_0x1eaf5d[_0xd852('0xa9')][_0xd852('0xaa')]=![];if(_0x50c085){if(_0x1eaf5d[_0xd852('0x86')][_0xd852('0xab')]){_0x1eaf5d[_0xd852('0x8a')][_0xd852('0xac')]({'id':0x0,'priority':_0x1eaf5d[_0xd852('0x8a')][_0xd852('0x48')]+0x1,'app':_0xd852('0xad'),'appdata':'unmanaged','interval':_0xd852('0xae')});}_0x1eaf5d['interaction'][_0xd852('0xaa')]=!![];}return db[_0xd852('0xaf')][_0xd852('0x5a')]({'phone':_0x1eaf5d['body'][_0xd852('0x95')],'messageId':_0x1eaf5d[_0xd852('0x62')][_0xd852('0x9a')],'body':_0x1eaf5d[_0xd852('0x62')][_0xd852('0x62')],'WhatsappAccountId':_0xcdc143[_0xd852('0x63')]['id'],'WhatsappInteractionId':_0x4b9701['id'],'direction':'in','ContactId':_0x4b9701['ContactId'],'AttachmentId':_0x1eaf5d[_0xd852('0x62')][_0xd852('0xb0')]});})[_0xd852('0x37')](function(_0x3f844d){_0x1eaf5d[_0xd852('0x27')]=_0x3f844d;if(_0x1eaf5d[_0xd852('0xa9')]['UserId']){return db[_0xd852('0x78')][_0xd852('0x59')]({'attributes':['id',_0xd852('0x39')],'where':{'id':_0x1eaf5d[_0xd852('0xa9')][_0xd852('0xb1')]}})['then'](function(_0x18b16d){if(_0x18b16d){_0x1eaf5d[_0xd852('0x8a')][_0xd852('0xb2')]({'id':0x0,'priority':0x0,'app':_0xd852('0xb3'),'appdata':_0x18b16d['name']+','+(_0x1eaf5d[_0xd852('0x86')][_0xd852('0xb4')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd852('0xb5'),'startRouting',_0x1eaf5d);});}return respondWithRpcPromise(_0xd852('0xb5'),'startRouting',_0x1eaf5d);})[_0xd852('0x37')](function(_0x2dbcf3){if(_0x2dbcf3){var _0x55a7dc=0xc8;var _0x2afa07='receiveMessage';logger[_0xd852('0x20')](_0xd852('0xb6'),_0x2afa07,_0x55a7dc,'entity\x20found');logger[_0xd852('0x23')](_0xd852('0xb7'),_0x2afa07,_0x55a7dc,_0xd852('0xb8'),JSON[_0xd852('0x24')](_0x2dbcf3));if(_0x1eaf5d['account'][_0xd852('0x41')]===_0xd852('0x94')){return _0x233624[_0xd852('0x29')](_0x55a7dc)[_0xd852('0x2f')]('Content-Type',_0xd852('0xb9'))['send']('\x0a');}else{return _0x233624[_0xd852('0x29')](_0x55a7dc)['json'](_0x2dbcf3);}}});})[_0xd852('0x56')](handleError(_0x233624,null));};exports[_0xd852('0x3a')]=function(_0x1502f8,_0x1fea73,_0x25357e){var _0x3a2e57,_0x565c78,_0x18eca6;if(_[_0xd852('0x9e')](_0x1502f8['body'][_0xd852('0x62')])||_0x1502f8[_0xd852('0x62')]['body']===''){throw new db[(_0xd852('0x8e'))][(_0xd852('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd852('0x9e')](_0x1502f8[_0xd852('0x62')]['to'])){throw new db[(_0xd852('0x8e'))][(_0xd852('0x9d'))]('to\x20is\x20mandatory');}_0x3a2e57=_0x1502f8['body']['to'];return db[_0xd852('0x3e')]['find']({'where':{'id':_0x1502f8[_0xd852('0x63')]['id']},'include':[{'model':db[_0xd852('0xa3')],'as':_0xd852('0xba'),'include':[{'model':db[_0xd852('0x8d')],'as':_0xd852('0xa6'),'where':{'mobile':_0x3a2e57},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xd852('0x37')](handleEntityNotFound(_0x1fea73,null))[_0xd852('0x37')](function(_0x533345){if(_0x533345&&_0x533345[_0xd852('0xba')]){_0x565c78=_0x533345[_0xd852('0x5c')]({'plain':!![]});if(_0x565c78[_0xd852('0xba')]&&_0x565c78[_0xd852('0xba')][_0xd852('0xa6')]['length']){return _0x565c78['List'][_0xd852('0xa6')][0x0];}return db[_0xd852('0x8d')][_0xd852('0x5a')](_[_0xd852('0x18')](_0x1502f8['body'],{'firstName':_0x3a2e57,'mobile':_0x3a2e57,'phone':_0x3a2e57,'ListId':_0x565c78['ListId']}));}})[_0xd852('0x37')](handleEntityNotFound(_0x1fea73,null))[_0xd852('0x37')](function(_0x78f80b){if(_0x78f80b){_0x18eca6=_0x78f80b;return db[_0xd852('0xa8')][_0xd852('0x59')]({'where':{'ContactId':_0x18eca6['id'],'closed':![],'WhatsappAccountId':_0x565c78['id']}})[_0xd852('0x37')](function(_0x19beb2){if(_0x19beb2){return[_0x19beb2,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x1502f8['user']['id'],'ContactId':_0x18eca6['id'],'WhatsappAccountId':_0x565c78['id'],'phone':_0x3a2e57,'firstMsgDirection':_0xd852('0xbb'),'Messages':[_[_0xd852('0x4f')](_0x1502f8['body'],{'read':![],'body':_0x1502f8[_0xd852('0x62')][_0xd852('0x62')],'phone':_0x3a2e57,'WhatsappAccountId':_0x565c78['id'],'UserId':_0x1502f8[_0xd852('0x5b')]['id'],'ContactId':_0x18eca6['id']})]},{'include':[{'model':db[_0xd852('0xaf')],'as':_0xd852('0xbc')}]})[_0xd852('0x37')](function(_0x4229f2){return[_0x4229f2,!![]];});});}})['spread'](function(_0x34457f,_0xeb7e1e){if(_0xeb7e1e){return _0x34457f;}return db['WhatsappMessage'][_0xd852('0x5a')](_['merge'](_0x1502f8[_0xd852('0x62')],{'read':![],'body':_0x1502f8[_0xd852('0x62')][_0xd852('0x62')],'phone':_0x3a2e57,'WhatsappAccountId':_0x565c78['id'],'WhatsappInteractionId':_0x34457f['id'],'UserId':_0x1502f8[_0xd852('0x5b')]['id'],'ContactId':_0x18eca6['id']}))[_0xd852('0x37')](function(_0x308c15){_0x34457f[_0xd852('0xbd')]['Messages']=[];_0x34457f[_0xd852('0xbd')][_0xd852('0xbc')]['push'](_0x308c15[_0xd852('0xbd')]);return _0x34457f;});})[_0xd852('0x37')](respondWithResult(_0x1fea73,null))[_0xd852('0x56')](handleError(_0x1fea73,null));}; \ No newline at end of file +var _0x3b74=['getApplications','notify','account','sinch','statuses','state','WhatsappMessage','applications','Applications','asc','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','From','replace','whatsapp:','Body','from','notifications','messageId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','omit','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','ContactId','AttachmentId','UserId','agent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','user','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','WhatsappAccount','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','Pause','keys','include','options','find','create','body','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addAgents','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','priority'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3b74,0xf7));var _0x43b7=function(_0x24128e,_0x362699){_0x24128e=_0x24128e-0x0;var _0x34bd69=_0x3b74[_0x24128e];return _0x34bd69;};'use strict';var emlformat=require(_0x43b7('0x0'));var rimraf=require(_0x43b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x43b7('0x2'));var rp=require('request-promise');var moment=require(_0x43b7('0x3'));var BPromise=require(_0x43b7('0x4'));var Mustache=require(_0x43b7('0x5'));var util=require(_0x43b7('0x6'));var path=require(_0x43b7('0x7'));var sox=require(_0x43b7('0x8'));var csv=require(_0x43b7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43b7('0xa'));var _=require(_0x43b7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x43b7('0x9'));var querystring=require(_0x43b7('0xc'));var Papa=require(_0x43b7('0xd'));var Redis=require('ioredis');var authService=require(_0x43b7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x43b7('0xf'));var hardwareService=require(_0x43b7('0x10'));var logger=require(_0x43b7('0x11'))(_0x43b7('0x12'));var utils=require(_0x43b7('0x13'));var config=require(_0x43b7('0x14'));var licenseUtil=require(_0x43b7('0x15'));var db=require(_0x43b7('0x16'))['db'];config[_0x43b7('0x17')]=_[_0x43b7('0x18')](config[_0x43b7('0x17')],{'host':_0x43b7('0x19'),'port':0x18eb});var socket=require(_0x43b7('0x1a'))(new Redis(config[_0x43b7('0x17')]));require(_0x43b7('0x1b'))['register'](socket);var jayson=require(_0x43b7('0x1c'));var client=jayson[_0x43b7('0x1d')][_0x43b7('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0xe06521,_0x257b6c,_0x34a049,_0x36ad89){return new BPromise(function(_0x3ed33c,_0x1d3961){var _0x510a54=_0x36ad89||client;return _0x510a54[_0x43b7('0x1f')](_0xe06521,_0x34a049)[_0x43b7('0x20')](function(_0x265ba9){logger[_0x43b7('0x21')](_0x43b7('0x22'),_0x257b6c,_0x43b7('0x23'));logger[_0x43b7('0x24')](_0x43b7('0x25'),_0x257b6c,'request\x20sent',JSON[_0x43b7('0x26')](_0x265ba9));if(_0x265ba9[_0x43b7('0x27')]){if(_0x265ba9[_0x43b7('0x27')][_0x43b7('0x28')]===0x1f4){logger[_0x43b7('0x27')](_0x43b7('0x22'),_0x257b6c,_0x265ba9[_0x43b7('0x27')][_0x43b7('0x29')]);return _0x1d3961(_0x265ba9['error'][_0x43b7('0x29')]);}logger['error'](_0x43b7('0x22'),_0x257b6c,_0x265ba9[_0x43b7('0x27')][_0x43b7('0x29')]);return _0x3ed33c(_0x265ba9[_0x43b7('0x27')]['message']);}else{logger[_0x43b7('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x257b6c,_0x43b7('0x23'));_0x3ed33c(_0x265ba9[_0x43b7('0x2a')][_0x43b7('0x29')]);}})['catch'](function(_0x36c163){logger['error'](_0x43b7('0x22'),_0x257b6c,_0x36c163);_0x1d3961(_0x36c163);});});}function respondWithStatusCode(_0x5afc44,_0x20050f){_0x20050f=_0x20050f||0xcc;return function(_0x2fe1ac){if(_0x2fe1ac){return _0x5afc44[_0x43b7('0x2b')](_0x20050f);}return _0x5afc44['status'](_0x20050f)[_0x43b7('0x2c')]();};}function respondWithResult(_0x42dcc4,_0x36935e){_0x36935e=_0x36935e||0xc8;return function(_0xa38131){if(_0xa38131){return _0x42dcc4[_0x43b7('0x2d')](_0x36935e)[_0x43b7('0x2e')](_0xa38131);}};}function respondWithFilteredResult(_0x130fcc,_0x180387){return function(_0x5a3092){if(_0x5a3092){var _0x4a52ca=typeof _0x180387[_0x43b7('0x2f')]===_0x43b7('0x30')&&typeof _0x180387[_0x43b7('0x31')]===_0x43b7('0x30');var _0xf05c5c=_0x5a3092[_0x43b7('0x32')];var _0x9dfba7=_0x4a52ca?0x0:_0x180387[_0x43b7('0x2f')];var _0x118cc7=_0x4a52ca?_0x5a3092['count']:_0x180387['offset']+_0x180387['limit'];var _0x235694;if(_0x118cc7>=_0xf05c5c){_0x118cc7=_0xf05c5c;_0x235694=0xc8;}else{_0x235694=0xce;}_0x130fcc[_0x43b7('0x2d')](_0x235694);return _0x130fcc[_0x43b7('0x33')](_0x43b7('0x34'),_0x9dfba7+'-'+_0x118cc7+'/'+_0xf05c5c)[_0x43b7('0x2e')](_0x5a3092);}return null;};}function patchUpdates(_0x3923cc){return function(_0x1f9763){try{jsonpatch[_0x43b7('0x35')](_0x1f9763,_0x3923cc,!![]);}catch(_0x466810){return BPromise[_0x43b7('0x36')](_0x466810);}return _0x1f9763[_0x43b7('0x37')]();};}function saveUpdates(_0x16e560,_0x225e09){return function(_0x214d87){if(_0x214d87){return _0x214d87['update'](_0x16e560)[_0x43b7('0x20')](function(_0x47514b){return _0x47514b;});}return null;};}function removeEntity(_0x79fd73,_0x5db3c4){return function(_0x26677c){if(_0x26677c){return _0x26677c[_0x43b7('0x38')]()[_0x43b7('0x20')](function(){var _0x1ce8ba=_0x26677c['get']({'plain':!![]});var _0x447ccc=_0x43b7('0x39');return db[_0x43b7('0x3a')]['destroy']({'where':{'type':_0x447ccc,'resourceId':_0x1ce8ba['id']}})[_0x43b7('0x20')](function(){return _0x26677c;});})[_0x43b7('0x20')](function(){_0x79fd73['status'](0xcc)[_0x43b7('0x2c')]();});}};}function handleEntityNotFound(_0x271ff3,_0x1e6701){return function(_0x33f1ac){if(!_0x33f1ac){_0x271ff3[_0x43b7('0x2b')](0x194);}return _0x33f1ac;};}function handleError(_0x20abc3,_0x53c825){_0x53c825=_0x53c825||0x1f4;return function(_0x3461c4){logger[_0x43b7('0x27')](_0x3461c4[_0x43b7('0x3b')]);if(_0x3461c4[_0x43b7('0x3c')]){delete _0x3461c4[_0x43b7('0x3c')];}_0x20abc3['status'](_0x53c825)[_0x43b7('0x3d')](_0x3461c4);};}exports['index']=function(_0x34b40f,_0x158ff4){var _0x3c03e9={'include':[{'model':db['Pause'],'as':_0x43b7('0x3e')}]},_0x50d9ce={},_0x1dff5c={'count':0x0,'rows':[]};var _0x966a2b=_['map'](db[_0x43b7('0x3f')][_0x43b7('0x40')],function(_0x599868){return{'name':_0x599868['fieldName'],'type':_0x599868[_0x43b7('0x41')]['key']};});_0x50d9ce[_0x43b7('0x42')]=_[_0x43b7('0x43')](_0x966a2b,_0x43b7('0x3c'));_0x50d9ce[_0x43b7('0x44')]=_['keys'](_0x34b40f[_0x43b7('0x44')]);_0x50d9ce[_0x43b7('0x45')]=_[_0x43b7('0x46')](_0x50d9ce['model'],_0x50d9ce[_0x43b7('0x44')]);_0x3c03e9[_0x43b7('0x47')]=_['intersection'](_0x50d9ce[_0x43b7('0x42')],qs[_0x43b7('0x48')](_0x34b40f['query'][_0x43b7('0x48')]));_0x3c03e9[_0x43b7('0x47')]=_0x3c03e9['attributes'][_0x43b7('0x49')]?_0x3c03e9[_0x43b7('0x47')]:_0x50d9ce['model'];if(!_0x34b40f['query'][_0x43b7('0x4a')](_0x43b7('0x4b'))){_0x3c03e9[_0x43b7('0x31')]=qs[_0x43b7('0x31')](_0x34b40f['query'][_0x43b7('0x31')]);_0x3c03e9['offset']=qs[_0x43b7('0x2f')](_0x34b40f[_0x43b7('0x44')][_0x43b7('0x2f')]);}_0x3c03e9['order']=qs[_0x43b7('0x4c')](_0x34b40f[_0x43b7('0x44')]['sort']);_0x3c03e9[_0x43b7('0x4d')]=qs[_0x43b7('0x45')](_[_0x43b7('0x4e')](_0x34b40f[_0x43b7('0x44')],_0x50d9ce['filters']),_0x966a2b);if(_0x34b40f['query'][_0x43b7('0x4f')]){_0x3c03e9[_0x43b7('0x4d')]=_[_0x43b7('0x50')](_0x3c03e9['where'],{'$or':_['map'](_0x966a2b,function(_0x3c9880){if(_0x3c9880['type']!==_0x43b7('0x51')){var _0x49ff69={};_0x49ff69[_0x3c9880['name']]={'$like':'%'+_0x34b40f['query'][_0x43b7('0x4f')]+'%'};return _0x49ff69;}})});}_0x3c03e9=_[_0x43b7('0x50')]({},_0x3c03e9,_0x34b40f['options']);var _0x1abf3c={'where':_0x3c03e9[_0x43b7('0x4d')]};return db[_0x43b7('0x3f')][_0x43b7('0x32')](_0x1abf3c)['then'](function(_0x5a16b4){_0x1dff5c[_0x43b7('0x32')]=_0x5a16b4;if(_0x34b40f[_0x43b7('0x44')][_0x43b7('0x52')]){_0x3c03e9['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x43b7('0x53')](_0x3c03e9);})[_0x43b7('0x20')](function(_0x41ec8e){_0x1dff5c[_0x43b7('0x54')]=_0x41ec8e;return _0x1dff5c;})[_0x43b7('0x20')](respondWithFilteredResult(_0x158ff4,_0x3c03e9))[_0x43b7('0x55')](handleError(_0x158ff4,null));};exports['show']=function(_0x45fccb,_0x33abaa){var _0x2ab729={'raw':![],'where':{'id':_0x45fccb[_0x43b7('0x56')]['id']},'include':[{'model':db[_0x43b7('0x57')],'as':'mandatoryDispositionPause'}]},_0x1dba08={};_0x1dba08[_0x43b7('0x42')]=_[_0x43b7('0x58')](db[_0x43b7('0x3f')][_0x43b7('0x40')]);_0x1dba08[_0x43b7('0x44')]=_[_0x43b7('0x58')](_0x45fccb[_0x43b7('0x44')]);_0x1dba08[_0x43b7('0x45')]=_[_0x43b7('0x46')](_0x1dba08[_0x43b7('0x42')],_0x1dba08['query']);_0x2ab729[_0x43b7('0x47')]=_['intersection'](_0x1dba08['model'],qs['fields'](_0x45fccb[_0x43b7('0x44')][_0x43b7('0x48')]));_0x2ab729[_0x43b7('0x47')]=_0x2ab729[_0x43b7('0x47')][_0x43b7('0x49')]?_0x2ab729['attributes']:_0x1dba08[_0x43b7('0x42')];if(_0x45fccb[_0x43b7('0x44')][_0x43b7('0x52')]){_0x2ab729[_0x43b7('0x59')]=[{'all':!![]}];}_0x2ab729=_[_0x43b7('0x50')]({},_0x2ab729,_0x45fccb[_0x43b7('0x5a')]);return db[_0x43b7('0x3f')][_0x43b7('0x5b')](_0x2ab729)[_0x43b7('0x20')](handleEntityNotFound(_0x33abaa,null))[_0x43b7('0x20')](respondWithResult(_0x33abaa,null))['catch'](handleError(_0x33abaa,null));};exports[_0x43b7('0x5c')]=function(_0x4712d6,_0x2706c7){return db[_0x43b7('0x3f')]['create'](_0x4712d6[_0x43b7('0x5d')],{})['then'](function(_0x27251a){var _0x503e3e=_0x4712d6['user'][_0x43b7('0x5e')]({'plain':!![]});if(!_0x503e3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x503e3e[_0x43b7('0x5f')]==='user'){var _0x1ff2b6=_0x27251a[_0x43b7('0x5e')]({'plain':!![]});var _0x502ae3='WhatsappAccounts';return db['UserProfileSection'][_0x43b7('0x5b')]({'where':{'name':_0x502ae3,'userProfileId':_0x503e3e['userProfileId']},'raw':!![]})[_0x43b7('0x20')](function(_0x3dba63){if(_0x3dba63&&_0x3dba63[_0x43b7('0x60')]===0x0){return db[_0x43b7('0x3a')][_0x43b7('0x5c')]({'name':_0x1ff2b6[_0x43b7('0x3c')],'resourceId':_0x1ff2b6['id'],'type':_0x3dba63[_0x43b7('0x3c')],'sectionId':_0x3dba63['id']},{})[_0x43b7('0x20')](function(){return _0x27251a;});}else{return _0x27251a;}})[_0x43b7('0x55')](function(_0x2a7b05){logger[_0x43b7('0x27')](_0x43b7('0x61'),_0x2a7b05);throw _0x2a7b05;});}return _0x27251a;})[_0x43b7('0x20')](respondWithResult(_0x2706c7,0xc9))[_0x43b7('0x55')](handleError(_0x2706c7,null));};exports[_0x43b7('0x62')]=function(_0x4e7849,_0x3d429e){if(_0x4e7849['body']['id']){delete _0x4e7849[_0x43b7('0x5d')]['id'];}return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x4e7849[_0x43b7('0x56')]['id']},'include':[{'model':db[_0x43b7('0x57')],'as':_0x43b7('0x3e')}]})[_0x43b7('0x20')](handleEntityNotFound(_0x3d429e,null))[_0x43b7('0x20')](saveUpdates(_0x4e7849[_0x43b7('0x5d')],null))[_0x43b7('0x20')](respondWithResult(_0x3d429e,null))[_0x43b7('0x55')](handleError(_0x3d429e,null));};exports[_0x43b7('0x38')]=function(_0x19537b,_0x1e9c9a){return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x19537b[_0x43b7('0x56')]['id']}})[_0x43b7('0x20')](handleEntityNotFound(_0x1e9c9a,null))[_0x43b7('0x20')](removeEntity(_0x1e9c9a,null))[_0x43b7('0x55')](handleError(_0x1e9c9a,null));};exports[_0x43b7('0x63')]=function(_0xe57599,_0x41605e){return db[_0x43b7('0x3f')]['describe']()[_0x43b7('0x20')](respondWithResult(_0x41605e,null))[_0x43b7('0x55')](handleError(_0x41605e,null));};exports[_0x43b7('0x64')]=function(_0x7b55cd,_0x28e5ab,_0x38066a){if(_0x7b55cd['body']['id']){delete _0x7b55cd['body']['id'];}return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x7b55cd['params']['id']}})[_0x43b7('0x20')](handleEntityNotFound(_0x28e5ab,null))[_0x43b7('0x20')](function(_0xf0dee){if(_0xf0dee){_0x7b55cd[_0x43b7('0x5d')][_0x43b7('0x65')]=_0xf0dee['id'];return db[_0x43b7('0x66')][_0x43b7('0x5c')](_0x7b55cd[_0x43b7('0x5d')]);}})[_0x43b7('0x20')](respondWithResult(_0x28e5ab,null))[_0x43b7('0x55')](handleError(_0x28e5ab,null));};exports[_0x43b7('0x67')]=function(_0x495128,_0x9ca92d,_0x82aff3){var _0x26a872={'raw':![],'where':{}};var _0x345ee1={};var _0x257f51={'count':0x0,'rows':[]};return db[_0x43b7('0x3f')]['findOne']({'where':{'id':_0x495128[_0x43b7('0x56')]['id']}})[_0x43b7('0x20')](handleEntityNotFound(_0x9ca92d,null))[_0x43b7('0x20')](function(_0x1e80ce){if(_0x1e80ce){_0x345ee1[_0x43b7('0x42')]=_['keys'](db['Disposition']['rawAttributes']);_0x345ee1[_0x43b7('0x44')]=_['keys'](_0x495128[_0x43b7('0x44')]);_0x345ee1[_0x43b7('0x45')]=_[_0x43b7('0x46')](_0x345ee1[_0x43b7('0x42')],_0x345ee1[_0x43b7('0x44')]);_0x26a872['attributes']=_['intersection'](_0x345ee1[_0x43b7('0x42')],qs[_0x43b7('0x48')](_0x495128[_0x43b7('0x44')][_0x43b7('0x48')]));_0x26a872['attributes']=_0x26a872[_0x43b7('0x47')][_0x43b7('0x49')]?_0x26a872[_0x43b7('0x47')]:_0x345ee1[_0x43b7('0x42')];if(!_0x495128[_0x43b7('0x44')][_0x43b7('0x4a')]('nolimit')){_0x26a872['limit']=qs[_0x43b7('0x31')](_0x495128[_0x43b7('0x44')][_0x43b7('0x31')]);_0x26a872['offset']=qs[_0x43b7('0x2f')](_0x495128[_0x43b7('0x44')]['offset']);}_0x26a872[_0x43b7('0x68')]=qs['sort'](_0x495128['query'][_0x43b7('0x4c')]);_0x26a872['where']=qs['filters'](_[_0x43b7('0x4e')](_0x495128[_0x43b7('0x44')],_0x345ee1['filters']));_0x26a872[_0x43b7('0x4d')][_0x43b7('0x65')]=_0x1e80ce['id'];if(_0x495128[_0x43b7('0x44')][_0x43b7('0x4f')]){_0x26a872[_0x43b7('0x4d')]=_[_0x43b7('0x50')](_0x26a872[_0x43b7('0x4d')],{'$or':_[_0x43b7('0x43')](_0x26a872[_0x43b7('0x47')],function(_0x287c43){var _0x97d62e={};_0x97d62e[_0x287c43]={'$like':'%'+_0x495128['query'][_0x43b7('0x4f')]+'%'};return _0x97d62e;})});}_0x26a872=_['merge']({},_0x26a872,_0x495128[_0x43b7('0x5a')]);return db[_0x43b7('0x66')][_0x43b7('0x32')]({'where':_0x26a872['where']})[_0x43b7('0x20')](function(_0x2331f8){_0x257f51[_0x43b7('0x32')]=_0x2331f8;if(_0x495128['query'][_0x43b7('0x52')]){_0x26a872[_0x43b7('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x26a872);})[_0x43b7('0x20')](function(_0x5307ff){_0x257f51['rows']=_0x5307ff;return _0x257f51;});}})[_0x43b7('0x20')](respondWithFilteredResult(_0x9ca92d,_0x26a872))[_0x43b7('0x55')](handleError(_0x9ca92d,null));};exports['removeDispositions']=function(_0x53595a,_0x56fe33,_0x43223f){return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x53595a[_0x43b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x56fe33,null))[_0x43b7('0x20')](function(_0x58c03b){if(_0x58c03b){return _0x58c03b[_0x43b7('0x69')](_0x53595a[_0x43b7('0x44')][_0x43b7('0x6a')]);}})[_0x43b7('0x20')](respondWithStatusCode(_0x56fe33,null))[_0x43b7('0x55')](handleError(_0x56fe33,null));};exports[_0x43b7('0x6b')]=function(_0x2257b,_0x20d7e9,_0xac5a7){if(_0x2257b['body']['id']){delete _0x2257b['body']['id'];}return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x2257b['params']['id']}})['then'](handleEntityNotFound(_0x20d7e9,null))[_0x43b7('0x20')](function(_0x1a8100){if(_0x1a8100){_0x2257b[_0x43b7('0x5d')]['WhatsappAccountId']=_0x1a8100['id'];return db[_0x43b7('0x6c')][_0x43b7('0x5c')](_0x2257b['body']);}})['then'](respondWithResult(_0x20d7e9,null))[_0x43b7('0x55')](handleError(_0x20d7e9,null));};exports['getAnswers']=function(_0x1f295a,_0x31fead,_0x13d616){var _0x485f9b={'raw':![],'where':{}};var _0x54575d={};var _0x18cb70={'count':0x0,'rows':[]};return db[_0x43b7('0x3f')][_0x43b7('0x6d')]({'where':{'id':_0x1f295a[_0x43b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x31fead,null))[_0x43b7('0x20')](function(_0x57ecb4){if(_0x57ecb4){_0x54575d[_0x43b7('0x42')]=_[_0x43b7('0x58')](db[_0x43b7('0x6c')][_0x43b7('0x40')]);_0x54575d[_0x43b7('0x44')]=_[_0x43b7('0x58')](_0x1f295a[_0x43b7('0x44')]);_0x54575d[_0x43b7('0x45')]=_[_0x43b7('0x46')](_0x54575d[_0x43b7('0x42')],_0x54575d['query']);_0x485f9b['attributes']=_[_0x43b7('0x46')](_0x54575d[_0x43b7('0x42')],qs[_0x43b7('0x48')](_0x1f295a[_0x43b7('0x44')]['fields']));_0x485f9b[_0x43b7('0x47')]=_0x485f9b['attributes'][_0x43b7('0x49')]?_0x485f9b[_0x43b7('0x47')]:_0x54575d[_0x43b7('0x42')];if(!_0x1f295a[_0x43b7('0x44')][_0x43b7('0x4a')](_0x43b7('0x4b'))){_0x485f9b['limit']=qs['limit'](_0x1f295a[_0x43b7('0x44')][_0x43b7('0x31')]);_0x485f9b[_0x43b7('0x2f')]=qs['offset'](_0x1f295a[_0x43b7('0x44')]['offset']);}_0x485f9b[_0x43b7('0x68')]=qs[_0x43b7('0x4c')](_0x1f295a[_0x43b7('0x44')][_0x43b7('0x4c')]);_0x485f9b[_0x43b7('0x4d')]=qs[_0x43b7('0x45')](_[_0x43b7('0x4e')](_0x1f295a['query'],_0x54575d['filters']));_0x485f9b[_0x43b7('0x4d')][_0x43b7('0x65')]=_0x57ecb4['id'];if(_0x1f295a[_0x43b7('0x44')][_0x43b7('0x4f')]){_0x485f9b[_0x43b7('0x4d')]=_[_0x43b7('0x50')](_0x485f9b[_0x43b7('0x4d')],{'$or':_['map'](_0x485f9b['attributes'],function(_0x278ac7){var _0x6be2d0={};_0x6be2d0[_0x278ac7]={'$like':'%'+_0x1f295a[_0x43b7('0x44')][_0x43b7('0x4f')]+'%'};return _0x6be2d0;})});}_0x485f9b=_[_0x43b7('0x50')]({},_0x485f9b,_0x1f295a[_0x43b7('0x5a')]);return db[_0x43b7('0x6c')][_0x43b7('0x32')]({'where':_0x485f9b['where']})['then'](function(_0x4a29e7){_0x18cb70[_0x43b7('0x32')]=_0x4a29e7;if(_0x1f295a[_0x43b7('0x44')]['includeAll']){_0x485f9b[_0x43b7('0x59')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x485f9b);})[_0x43b7('0x20')](function(_0x154627){_0x18cb70[_0x43b7('0x54')]=_0x154627;return _0x18cb70;});}})[_0x43b7('0x20')](respondWithFilteredResult(_0x31fead,_0x485f9b))[_0x43b7('0x55')](handleError(_0x31fead,null));};exports['removeAnswers']=function(_0x59514a,_0x5312c,_0x493326){return db['WhatsappAccount'][_0x43b7('0x5b')]({'where':{'id':_0x59514a['params']['id']}})['then'](handleEntityNotFound(_0x5312c,null))[_0x43b7('0x20')](function(_0x515ae3){if(_0x515ae3){return _0x515ae3[_0x43b7('0x6e')](_0x59514a['query'][_0x43b7('0x6a')]);}})['then'](respondWithStatusCode(_0x5312c,null))[_0x43b7('0x55')](handleError(_0x5312c,null));};exports[_0x43b7('0x6f')]=function(_0x5e9977,_0x1be870,_0x2fdb42){return db['WhatsappAccount'][_0x43b7('0x5b')]({'where':{'id':_0x5e9977[_0x43b7('0x56')]['id']}})[_0x43b7('0x20')](handleEntityNotFound(_0x1be870,null))[_0x43b7('0x20')](function(_0x268615){if(_0x268615){return _0x268615[_0x43b7('0x6f')](_0x5e9977['body'][_0x43b7('0x6a')],_['omit'](_0x5e9977[_0x43b7('0x5d')],[_0x43b7('0x6a'),'id'])||{})[_0x43b7('0x70')](function(_0x37efd2){for(var _0x411253=0x0;_0x411253<_0x5e9977[_0x43b7('0x5d')][_0x43b7('0x6a')]['length'];_0x411253+=0x1){socket[_0x43b7('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x5e9977['body'][_0x43b7('0x6a')][_0x411253]),'WhatsappAccountId':Number(_0x5e9977[_0x43b7('0x56')]['id'])});}return _0x37efd2;});}})[_0x43b7('0x20')](respondWithResult(_0x1be870,null))[_0x43b7('0x55')](handleError(_0x1be870,null));};exports[_0x43b7('0x72')]=function(_0xbac16c,_0x155763,_0x426095){return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0xbac16c[_0x43b7('0x56')]['id']}})[_0x43b7('0x20')](handleEntityNotFound(_0x155763,null))['then'](function(_0x1a0193){if(_0x1a0193){return _0x1a0193[_0x43b7('0x72')](_0xbac16c[_0x43b7('0x44')][_0x43b7('0x6a')])[_0x43b7('0x20')](function(){if(_['isArray'](_0xbac16c[_0x43b7('0x44')][_0x43b7('0x6a')])){for(var _0x17379c=0x0;_0x17379c<_0xbac16c['query']['ids'][_0x43b7('0x49')];_0x17379c+=0x1){socket[_0x43b7('0x71')](_0x43b7('0x73'),{'UserId':Number(_0xbac16c[_0x43b7('0x44')][_0x43b7('0x6a')][_0x17379c]),'WhatsappAccountId':Number(_0xbac16c['params']['id'])});}}else{socket[_0x43b7('0x71')](_0x43b7('0x73'),{'UserId':Number(_0xbac16c['query'][_0x43b7('0x6a')]),'WhatsappAccountId':Number(_0xbac16c['params']['id'])});}});}})[_0x43b7('0x20')](respondWithStatusCode(_0x155763,null))[_0x43b7('0x55')](handleError(_0x155763,null));};exports[_0x43b7('0x74')]=function(_0x294673,_0xa5443e,_0x1972ab){var _0x703166={};var _0x385855={};var _0x4010a4;var _0x458b47;return db[_0x43b7('0x3f')][_0x43b7('0x6d')]({'where':{'id':_0x294673[_0x43b7('0x56')]['id']}})['then'](handleEntityNotFound(_0xa5443e,null))[_0x43b7('0x20')](function(_0x116ca6){if(_0x116ca6){_0x4010a4=_0x116ca6;_0x385855[_0x43b7('0x42')]=_[_0x43b7('0x58')](db[_0x43b7('0x75')]['rawAttributes']);_0x385855[_0x43b7('0x44')]=_[_0x43b7('0x58')](_0x294673[_0x43b7('0x44')]);_0x385855['filters']=_[_0x43b7('0x46')](_0x385855[_0x43b7('0x42')],_0x385855[_0x43b7('0x44')]);_0x703166[_0x43b7('0x47')]=_[_0x43b7('0x46')](_0x385855['model'],qs['fields'](_0x294673['query'][_0x43b7('0x48')]));_0x703166['attributes']=_0x703166[_0x43b7('0x47')]['length']?_0x703166[_0x43b7('0x47')]:_0x385855[_0x43b7('0x42')];_0x703166['order']=qs[_0x43b7('0x4c')](_0x294673[_0x43b7('0x44')]['sort']);_0x703166['where']=qs[_0x43b7('0x45')](_[_0x43b7('0x4e')](_0x294673[_0x43b7('0x44')],_0x385855[_0x43b7('0x45')]));if(_0x294673[_0x43b7('0x44')]['filter']){_0x703166['where']=_[_0x43b7('0x50')](_0x703166['where'],{'$or':_[_0x43b7('0x43')](_0x703166[_0x43b7('0x47')],function(_0x279483){var _0x7362dd={};_0x7362dd[_0x279483]={'$like':'%'+_0x294673[_0x43b7('0x44')][_0x43b7('0x4f')]+'%'};return _0x7362dd;})});}_0x703166=_[_0x43b7('0x50')]({},_0x703166,_0x294673[_0x43b7('0x5a')]);return _0x4010a4[_0x43b7('0x74')](_0x703166);}})[_0x43b7('0x20')](function(_0x1eeba9){if(_0x1eeba9){_0x458b47=_0x1eeba9['length'];if(!_0x294673[_0x43b7('0x44')][_0x43b7('0x4a')](_0x43b7('0x4b'))){_0x703166[_0x43b7('0x31')]=qs['limit'](_0x294673[_0x43b7('0x44')][_0x43b7('0x31')]);_0x703166[_0x43b7('0x2f')]=qs[_0x43b7('0x2f')](_0x294673[_0x43b7('0x44')][_0x43b7('0x2f')]);}return _0x4010a4[_0x43b7('0x74')](_0x703166);}})[_0x43b7('0x20')](function(_0x1612ae){if(_0x1612ae){return _0x1612ae?{'count':_0x458b47,'rows':_0x1612ae}:null;}})['then'](respondWithResult(_0xa5443e,null))[_0x43b7('0x55')](handleError(_0xa5443e,null));};exports[_0x43b7('0x76')]=function(_0x74bbae,_0x1fbeaa){var _0x4f37e9=_0x74bbae[_0x43b7('0x56')]['id'];var _0x5811dd=_0x74bbae[_0x43b7('0x5d')];var _0x6780a3=0xc8;var _0x20a8ac=null;return db[_0x43b7('0x77')]['transaction']({'isolationLevel':db[_0x43b7('0x77')][_0x43b7('0x78')]['ISOLATION_LEVELS'][_0x43b7('0x79')]},function(_0x46bf9b){return db[_0x43b7('0x3f')][_0x43b7('0x6d')]({'where':{'id':_0x4f37e9},'transaction':_0x46bf9b})['then'](function(_0x4c6727){if(_0x4c6727){return db[_0x43b7('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0x4f37e9},'transaction':_0x46bf9b})[_0x43b7('0x20')](function(){var _0x561f2c=_[_0x43b7('0x43')](_0x5811dd,function(_0x3858e6){_0x3858e6[_0x43b7('0x65')]=_0x4f37e9;return _0x3858e6;});return db[_0x43b7('0x7a')][_0x43b7('0x7b')](_0x561f2c,{'transaction':_0x46bf9b});});}else{_0x6780a3=0x194;_0x20a8ac=[];}});})[_0x43b7('0x20')](function(){if(_0x6780a3!==0x194){return db[_0x43b7('0x7a')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4f37e9},'order':_0x43b7('0x7c')})[_0x43b7('0x20')](function(_0x1af469){_0x20a8ac=_0x1af469;});}})[_0x43b7('0x55')](function(_0x40ec96){_0x6780a3=0x1f4;logger[_0x43b7('0x27')](_0x40ec96['stack']);if(_0x40ec96[_0x43b7('0x3c')]){delete _0x40ec96['name'];}_0x20a8ac=_0x40ec96;})['finally'](function(){if(_0x20a8ac===null){_0x1fbeaa[_0x43b7('0x2b')](_0x6780a3);}else{if(_0x6780a3===0x1f4){_0x1fbeaa[_0x43b7('0x2d')](_0x6780a3)[_0x43b7('0x3d')](_0x20a8ac);}else{_0x1fbeaa[_0x43b7('0x2d')](_0x6780a3)[_0x43b7('0x2e')](_0x20a8ac);}}});};exports[_0x43b7('0x7d')]=function(_0x5e8c39,_0x16c139,_0x20dcca){var _0x4badc8={};var _0x1cf8dc={};var _0x326d23;var _0x2fd3aa;return db['WhatsappAccount'][_0x43b7('0x6d')]({'where':{'id':_0x5e8c39[_0x43b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x16c139,null))['then'](function(_0x3a00db){if(_0x3a00db){_0x326d23=_0x3a00db;_0x1cf8dc[_0x43b7('0x42')]=_[_0x43b7('0x58')](db['WhatsappApplication']['rawAttributes']);_0x1cf8dc[_0x43b7('0x44')]=_[_0x43b7('0x58')](_0x5e8c39[_0x43b7('0x44')]);_0x1cf8dc['filters']=_[_0x43b7('0x46')](_0x1cf8dc[_0x43b7('0x42')],_0x1cf8dc['query']);_0x4badc8['attributes']=_['intersection'](_0x1cf8dc[_0x43b7('0x42')],qs['fields'](_0x5e8c39[_0x43b7('0x44')][_0x43b7('0x48')]));_0x4badc8[_0x43b7('0x47')]=_0x4badc8[_0x43b7('0x47')][_0x43b7('0x49')]?_0x4badc8['attributes']:_0x1cf8dc[_0x43b7('0x42')];_0x4badc8['order']=qs[_0x43b7('0x4c')](_0x5e8c39[_0x43b7('0x44')][_0x43b7('0x4c')]);_0x4badc8[_0x43b7('0x4d')]=qs[_0x43b7('0x45')](_[_0x43b7('0x4e')](_0x5e8c39[_0x43b7('0x44')],_0x1cf8dc[_0x43b7('0x45')]));if(_0x5e8c39[_0x43b7('0x44')][_0x43b7('0x4f')]){_0x4badc8['where']=_[_0x43b7('0x50')](_0x4badc8[_0x43b7('0x4d')],{'$or':_[_0x43b7('0x43')](_0x4badc8[_0x43b7('0x47')],function(_0x5d03bc){var _0x1e4a84={};_0x1e4a84[_0x5d03bc]={'$like':'%'+_0x5e8c39['query'][_0x43b7('0x4f')]+'%'};return _0x1e4a84;})});}_0x4badc8=_[_0x43b7('0x50')]({},_0x4badc8,_0x5e8c39[_0x43b7('0x5a')]);return _0x326d23[_0x43b7('0x7d')](_0x4badc8);}})['then'](function(_0x285be4){if(_0x285be4){_0x2fd3aa=_0x285be4[_0x43b7('0x49')];if(!_0x5e8c39['query'][_0x43b7('0x4a')](_0x43b7('0x4b'))){_0x4badc8[_0x43b7('0x31')]=qs['limit'](_0x5e8c39[_0x43b7('0x44')]['limit']);_0x4badc8['offset']=qs[_0x43b7('0x2f')](_0x5e8c39['query']['offset']);}return _0x326d23[_0x43b7('0x7d')](_0x4badc8);}})[_0x43b7('0x20')](function(_0x17f622){if(_0x17f622){return _0x17f622?{'count':_0x2fd3aa,'rows':_0x17f622}:null;}})[_0x43b7('0x20')](respondWithResult(_0x16c139,null))[_0x43b7('0x55')](handleError(_0x16c139,null));};exports[_0x43b7('0x7e')]=function(_0x37e3d0,_0x3c4a7d,_0x2197d6){var _0x12aad0={'channel':'whatsapp'};var _0x450f35=[];var _0x2300e0=[];var _0x34fb5c={};return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x37e3d0['params']['id']},'include':[{'model':db[_0x43b7('0x7a')],'as':'Applications'}]})[_0x43b7('0x20')](handleEntityNotFound(_0x3c4a7d,null))[_0x43b7('0x20')](function(_0x5c9c89){_0x12aad0[_0x43b7('0x7f')]=_0x5c9c89;if(_0x12aad0[_0x43b7('0x7f')]&&_0x12aad0['account']['type']===_0x43b7('0x80')&&_0x37e3d0[_0x43b7('0x5d')][_0x43b7('0x81')]){if(_0x37e3d0[_0x43b7('0x5d')]['statuses'][_0x43b7('0x49')]===0x0)return;if(_0x37e3d0['body'][_0x43b7('0x81')][0x0][_0x43b7('0x82')]!=='read')return;return db[_0x43b7('0x83')]['update']({'read':!![],'readAt':_0x37e3d0['body'][_0x43b7('0x81')][0x0]['timestamp']},{'where':{'messageId':_0x37e3d0['body'][_0x43b7('0x81')][0x0]['message_id']},'individualHooks':!![]})[_0x43b7('0x20')](function(_0x3b4b17){return _0x3c4a7d['status'](0xc8)[_0x43b7('0x2e')](_0x3b4b17);});}_0x12aad0[_0x43b7('0x84')]=_['orderBy'](_0x5c9c89[_0x43b7('0x85')],[_0x43b7('0x7c')],[_0x43b7('0x86')]);if(_0x12aad0[_0x43b7('0x7f')][_0x43b7('0x85')]){delete _0x12aad0['account'][_0x43b7('0x85')];}return db['CmContact'][_0x43b7('0x63')]()[_0x43b7('0x20')](function(_0x530836){if(!_0x530836){throw new db[(_0x43b7('0x87'))]['ValidationError'](_0x43b7('0x88'));}_0x450f35=_[_0x43b7('0x89')](_[_0x43b7('0x58')](_0x530836),['createdAt',_0x43b7('0x8a')]);_0x2300e0=_[_0x43b7('0x89')](_[_0x43b7('0x58')](_0x530836),[_0x43b7('0x8b'),_0x43b7('0x8a'),_0x43b7('0x8c'),_0x43b7('0x8d')]);_0x12aad0['body']={'mapKey':_0x43b7('0x8e')};if(_0x12aad0['account']&&_0x12aad0[_0x43b7('0x7f')][_0x43b7('0x41')]==='twilio'){_0x12aad0[_0x43b7('0x5d')]['from']=_0x37e3d0[_0x43b7('0x5d')][_0x43b7('0x8f')][_0x43b7('0x90')](_0x43b7('0x91'),'');_0x12aad0[_0x43b7('0x5d')]['body']=_0x37e3d0[_0x43b7('0x5d')][_0x43b7('0x92')];_0x12aad0[_0x43b7('0x5d')]['messageId']=_0x37e3d0['body']['MessageSid'];}if(_0x12aad0[_0x43b7('0x7f')]&&_0x12aad0['account'][_0x43b7('0x41')]==='sinch'){_0x12aad0['body'][_0x43b7('0x93')]=_0x37e3d0[_0x43b7('0x5d')][_0x43b7('0x94')][0x0][_0x43b7('0x93')];_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x5d')]=_0x37e3d0[_0x43b7('0x5d')]['notifications'][0x0][_0x43b7('0x29')][_0x43b7('0x5d')];_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x95')]=_0x37e3d0['body']['notifications'][0x0]['message_id'];}if(_0x12aad0[_0x43b7('0x5d')]['id']){delete _0x12aad0[_0x43b7('0x5d')]['id'];}if(_[_0x43b7('0x96')](_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x93')])){throw new db[(_0x43b7('0x87'))]['ValidationError'](_0x43b7('0x97'));}if(_[_0x43b7('0x96')](_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x5d')])||_0x12aad0['body'][_0x43b7('0x5d')]===''){throw new db[(_0x43b7('0x87'))][(_0x43b7('0x98'))](_0x43b7('0x99'));}if(_[_0x43b7('0x96')](_0x12aad0['body']['mapKey'])){throw new db['Sequelize'][(_0x43b7('0x98'))](_0x43b7('0x9a')+_0x2300e0);}if(!_[_0x43b7('0x9b')](_0x2300e0,_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x9c')])){throw new db[(_0x43b7('0x87'))][(_0x43b7('0x98'))](_0x43b7('0x9d')+_0x2300e0);}_0x34fb5c[_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x9c')]]=_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x93')];return db[_0x43b7('0x9e')][_0x43b7('0x5b')]({'where':{'id':_0x12aad0[_0x43b7('0x7f')][_0x43b7('0x8d')]},'include':[{'model':db[_0x43b7('0x9f')],'as':_0x43b7('0xa0'),'where':_0x34fb5c,'limit':0x1,'order':[[_0x43b7('0x8a'),'DESC']]}]});})[_0x43b7('0x20')](handleEntityNotFound(_0x3c4a7d,null))['then'](function(_0x50d256){if(_0x50d256){_0x12aad0['list']=_[_0x43b7('0xa1')](_0x50d256,[_0x43b7('0xa0')]);if(_0x50d256[_0x43b7('0xa0')]['length']){return _0x50d256[_0x43b7('0xa0')][0x0];}var _0x31227e=_[_0x43b7('0x18')](_0x12aad0['body'],{'firstName':_0x12aad0['body'][_0x43b7('0x93')],'ListId':_0x50d256['id']});_0x31227e[_0x12aad0[_0x43b7('0x5d')]['mapKey']]=_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x93')];return db[_0x43b7('0x9f')][_0x43b7('0x5c')](_0x31227e,{'fields':_0x450f35,'raw':!![]});}})['then'](handleEntityNotFound(_0x3c4a7d,null))[_0x43b7('0x20')](function(_0x595400){if(_0x595400){_0x12aad0[_0x43b7('0xa2')]=_0x595400;var _0xcc90d0={'ContactId':_0x595400['id'],'phone':_0x12aad0[_0x43b7('0x5d')]['from'],'WhatsappAccountId':_0x37e3d0['params']['id']};var _0x5b69ff={'ContactId':_0x595400['id'],'WhatsappAccountId':_0x37e3d0[_0x43b7('0x56')]['id'],'closed':![]};return db[_0x43b7('0xa3')][_0x43b7('0x5b')]({'where':_0x5b69ff})[_0x43b7('0x20')](function(_0x4205ce){if(_0x4205ce){return[_0x4205ce,![]];}return db['WhatsappInteraction'][_0x43b7('0x5c')](_0xcc90d0)['then'](function(_0x15be34){return[_0x15be34,!![]];});});}})['spread'](function(_0x3fbadd,_0x56a641){_0x12aad0[_0x43b7('0xa4')]=_0x3fbadd[_0x43b7('0x5e')]({'plain':!![]});_0x12aad0[_0x43b7('0xa4')][_0x43b7('0xa5')]=![];if(_0x56a641){if(_0x12aad0[_0x43b7('0x7f')][_0x43b7('0xa6')]){_0x12aad0[_0x43b7('0x84')]['push']({'id':0x0,'priority':_0x12aad0[_0x43b7('0x84')][_0x43b7('0x49')]+0x1,'app':_0x43b7('0xa7'),'appdata':'unmanaged','interval':_0x43b7('0xa8')});}_0x12aad0[_0x43b7('0xa4')]['created']=!![];}return db[_0x43b7('0x83')][_0x43b7('0x5c')]({'phone':_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x93')],'messageId':_0x12aad0[_0x43b7('0x5d')]['messageId'],'body':_0x12aad0[_0x43b7('0x5d')][_0x43b7('0x5d')],'WhatsappAccountId':_0x37e3d0[_0x43b7('0x56')]['id'],'WhatsappInteractionId':_0x3fbadd['id'],'direction':'in','ContactId':_0x3fbadd[_0x43b7('0xa9')],'AttachmentId':_0x12aad0[_0x43b7('0x5d')][_0x43b7('0xaa')]});})[_0x43b7('0x20')](function(_0x1e0a7d){_0x12aad0[_0x43b7('0x29')]=_0x1e0a7d;if(_0x12aad0[_0x43b7('0xa4')][_0x43b7('0xab')]){return db[_0x43b7('0x75')][_0x43b7('0x5b')]({'attributes':['id',_0x43b7('0x3c')],'where':{'id':_0x12aad0[_0x43b7('0xa4')][_0x43b7('0xab')]}})[_0x43b7('0x20')](function(_0x3b8d7f){if(_0x3b8d7f){_0x12aad0['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x43b7('0xac'),'appdata':_0x3b8d7f[_0x43b7('0x3c')]+','+(_0x12aad0['account']['waitForTheAssignedAgent']||0xa),'interval':_0x43b7('0xa8')});}return respondWithRpcPromise(_0x43b7('0xad'),_0x43b7('0xae'),_0x12aad0);});}return respondWithRpcPromise(_0x43b7('0xad'),_0x43b7('0xae'),_0x12aad0);})['then'](function(_0x40e262){if(_0x40e262){var _0x211620=0xc8;var _0x4a99c6='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a99c6,_0x211620,_0x43b7('0xaf'));logger['debug'](_0x43b7('0xb0'),_0x4a99c6,_0x211620,_0x43b7('0xaf'),JSON['stringify'](_0x40e262));if(_0x12aad0['account'][_0x43b7('0x41')]===_0x43b7('0xb1')){return _0x3c4a7d[_0x43b7('0x2d')](_0x211620)[_0x43b7('0x33')](_0x43b7('0xb2'),_0x43b7('0xb3'))['send'](_0x43b7('0xb4'));}else{return _0x3c4a7d[_0x43b7('0x2d')](_0x211620)['json'](_0x40e262);}}});})[_0x43b7('0x55')](handleError(_0x3c4a7d,null));};exports[_0x43b7('0x3d')]=function(_0x2e0a6a,_0xe242c7,_0x3e7985){var _0x4eb1ea,_0x205e5b,_0x54134b;if(_[_0x43b7('0x96')](_0x2e0a6a[_0x43b7('0x5d')][_0x43b7('0x5d')])||_0x2e0a6a[_0x43b7('0x5d')][_0x43b7('0x5d')]===''){throw new db[(_0x43b7('0x87'))][(_0x43b7('0x98'))](_0x43b7('0x99'));}if(_[_0x43b7('0x96')](_0x2e0a6a[_0x43b7('0x5d')]['to'])){throw new db[(_0x43b7('0x87'))][(_0x43b7('0x98'))](_0x43b7('0xb5'));}_0x4eb1ea=_0x2e0a6a[_0x43b7('0x5d')]['to'];return db[_0x43b7('0x3f')][_0x43b7('0x5b')]({'where':{'id':_0x2e0a6a[_0x43b7('0x56')]['id']},'include':[{'model':db[_0x43b7('0x9e')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x4eb1ea},'limit':0x1,'order':[[_0x43b7('0x8a'),'DESC']]}]}]})['then'](handleEntityNotFound(_0xe242c7,null))[_0x43b7('0x20')](function(_0x57622e){if(_0x57622e&&_0x57622e['List']){_0x205e5b=_0x57622e['get']({'plain':!![]});if(_0x205e5b[_0x43b7('0xb6')]&&_0x205e5b[_0x43b7('0xb6')]['Contacts'][_0x43b7('0x49')]){return _0x205e5b[_0x43b7('0xb6')][_0x43b7('0xa0')][0x0];}return db[_0x43b7('0x9f')][_0x43b7('0x5c')](_[_0x43b7('0x18')](_0x2e0a6a[_0x43b7('0x5d')],{'firstName':_0x4eb1ea,'mobile':_0x4eb1ea,'phone':_0x4eb1ea,'ListId':_0x205e5b[_0x43b7('0x8d')]}));}})[_0x43b7('0x20')](handleEntityNotFound(_0xe242c7,null))[_0x43b7('0x20')](function(_0x3632f3){if(_0x3632f3){_0x54134b=_0x3632f3;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x54134b['id'],'closed':![],'WhatsappAccountId':_0x205e5b['id']}})[_0x43b7('0x20')](function(_0x5238c3){if(_0x5238c3){return[_0x5238c3,![]];}return db[_0x43b7('0xa3')][_0x43b7('0x5c')]({'UserId':_0x2e0a6a[_0x43b7('0xb7')]['id'],'ContactId':_0x54134b['id'],'WhatsappAccountId':_0x205e5b['id'],'phone':_0x4eb1ea,'firstMsgDirection':'out','Messages':[_[_0x43b7('0x50')](_0x2e0a6a[_0x43b7('0x5d')],{'read':![],'body':_0x2e0a6a[_0x43b7('0x5d')][_0x43b7('0x5d')],'phone':_0x4eb1ea,'WhatsappAccountId':_0x205e5b['id'],'UserId':_0x2e0a6a[_0x43b7('0xb7')]['id'],'ContactId':_0x54134b['id']})]},{'include':[{'model':db[_0x43b7('0x83')],'as':_0x43b7('0xb8')}]})['then'](function(_0xb2d9fd){return[_0xb2d9fd,!![]];});});}})['spread'](function(_0x3d5839,_0x379a5d){if(_0x379a5d){return _0x3d5839;}return db[_0x43b7('0x83')]['create'](_[_0x43b7('0x50')](_0x2e0a6a[_0x43b7('0x5d')],{'read':![],'body':_0x2e0a6a[_0x43b7('0x5d')][_0x43b7('0x5d')],'phone':_0x4eb1ea,'WhatsappAccountId':_0x205e5b['id'],'WhatsappInteractionId':_0x3d5839['id'],'UserId':_0x2e0a6a['user']['id'],'ContactId':_0x54134b['id']}))[_0x43b7('0x20')](function(_0x5a3080){_0x3d5839[_0x43b7('0xb9')][_0x43b7('0xb8')]=[];_0x3d5839[_0x43b7('0xb9')][_0x43b7('0xb8')]['push'](_0x5a3080['dataValues']);return _0x3d5839;});})[_0x43b7('0x20')](respondWithResult(_0xe242c7,null))['catch'](handleError(_0xe242c7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 25c55a8..5fe9b16 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 _0x60e9=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60e9,0x97));var _0x960e=function(_0x2b4a54,_0x5c338b){_0x2b4a54=_0x2b4a54-0x0;var _0x456a7a=_0x60e9[_0x2b4a54];return _0x456a7a;};'use strict';var EventEmitter=require(_0x960e('0x0'));var WhatsappAccount=require(_0x960e('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x960e('0x2')](0x0);var events={'afterCreate':_0x960e('0x3'),'afterUpdate':_0x960e('0x4'),'afterDestroy':_0x960e('0x5')};function emitEvent(_0x44fd49){return function(_0x248c1a,_0x681a52,_0xb0d775){WhatsappAccountEvents[_0x960e('0x6')](_0x44fd49+':'+_0x248c1a['id'],_0x248c1a);WhatsappAccountEvents['emit'](_0x44fd49,_0x248c1a);_0xb0d775(null);};}for(var e in events){if(events[_0x960e('0x7')](e)){var event=events[e];WhatsappAccount[_0x960e('0x8')](e,emitEvent(event));}}module[_0x960e('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x6fda=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6fda,0x99));var _0xa6fd=function(_0x45fa59,_0x46f123){_0x45fa59=_0x45fa59-0x0;var _0x599a2c=_0x6fda[_0x45fa59];return _0x599a2c;};'use strict';var EventEmitter=require(_0xa6fd('0x0'));var WhatsappAccount=require(_0xa6fd('0x1'))['db'][_0xa6fd('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa6fd('0x3')](0x0);var events={'afterCreate':_0xa6fd('0x4'),'afterUpdate':_0xa6fd('0x5'),'afterDestroy':_0xa6fd('0x6')};function emitEvent(_0x3d43a5){return function(_0x1033c8,_0xa764cf,_0x22bed2){WhatsappAccountEvents[_0xa6fd('0x7')](_0x3d43a5+':'+_0x1033c8['id'],_0x1033c8);WhatsappAccountEvents[_0xa6fd('0x7')](_0x3d43a5,_0x1033c8);_0x22bed2(null);};}for(var e in events){if(events[_0xa6fd('0x8')](e)){var event=events[e];WhatsappAccount[_0xa6fd('0x9')](e,emitEvent(event));}}module[_0xa6fd('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index f404587..387076f 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 _0x0432=['define','WhatsappAccount','util','api','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x56e9fb,_0x11b179){var _0x3008a4=function(_0xaa7a00){while(--_0xaa7a00){_0x56e9fb['push'](_0x56e9fb['shift']());}};_0x3008a4(++_0x11b179);}(_0x0432,0x12e));var _0x2043=function(_0x369d2e,_0x257ce6){_0x369d2e=_0x369d2e-0x0;var _0x4c1d75=_0x0432[_0x369d2e];return _0x4c1d75;};'use strict';var _=require('lodash');var util=require(_0x2043('0x0'));var logger=require('../../config/logger')(_0x2043('0x1'));var moment=require('moment');var BPromise=require(_0x2043('0x2'));var rp=require(_0x2043('0x3'));var fs=require('fs');var path=require(_0x2043('0x4'));var rimraf=require('rimraf');var config=require(_0x2043('0x5'));var attributes=require(_0x2043('0x6'));module[_0x2043('0x7')]=function(_0x20d157,_0x38db7d){return _0x20d157[_0x2043('0x8')](_0x2043('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7980=['whatsapp_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','WhatsappAccount'];(function(_0x4f1821,_0xbbbf0f){var _0x2dc421=function(_0x4c0b4c){while(--_0x4c0b4c){_0x4f1821['push'](_0x4f1821['shift']());}};_0x2dc421(++_0xbbbf0f);}(_0x7980,0x115));var _0x0798=function(_0xb8771c,_0x428e6f){_0xb8771c=_0xb8771c-0x0;var _0x31fadd=_0x7980[_0xb8771c];return _0x31fadd;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var logger=require(_0x0798('0x2'))(_0x0798('0x3'));var moment=require(_0x0798('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0798('0x5'));var rimraf=require(_0x0798('0x6'));var config=require(_0x0798('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x0798('0x8')]=function(_0x3d727f,_0x82d878){return _0x3d727f[_0x0798('0x9')](_0x0798('0xa'),attributes,{'tableName':_0x0798('0xb'),'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 1f02a30..0e9edce 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 _0x59ae=['request','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','register'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x59ae,0x11a));var _0xe59a=function(_0x30ed2b,_0x4feaf8){_0x30ed2b=_0x30ed2b-0x0;var _0x5b3678=_0x59ae[_0x30ed2b];return _0x5b3678;};'use strict';var _=require(_0xe59a('0x0'));var util=require('util');var moment=require(_0xe59a('0x1'));var BPromise=require(_0xe59a('0x2'));var rs=require(_0xe59a('0x3'));var fs=require('fs');var Redis=require(_0xe59a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe59a('0x5'));var logger=require(_0xe59a('0x6'))(_0xe59a('0x7'));var config=require('../../config/environment');var jayson=require(_0xe59a('0x8'));var client=jayson[_0xe59a('0x9')]['http']({'port':0x232a});config['redis']=_[_0xe59a('0xa')](config[_0xe59a('0xb')],{'host':_0xe59a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe59a('0xb')]));require('./whatsappAccount.socket')[_0xe59a('0xd')](socket);function respondWithRpcPromise(_0x3e4034,_0x3940a7,_0x53739d){return new BPromise(function(_0x3d381b,_0x55874c){return client[_0xe59a('0xe')](_0x3e4034,_0x53739d)['then'](function(_0x4a1f7e){logger[_0xe59a('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x3940a7,'request\x20sent');logger[_0xe59a('0x10')](_0xe59a('0x11'),_0x3940a7,_0xe59a('0x12'),JSON[_0xe59a('0x13')](_0x4a1f7e));if(_0x4a1f7e[_0xe59a('0x14')]){if(_0x4a1f7e[_0xe59a('0x14')][_0xe59a('0x15')]===0x1f4){logger[_0xe59a('0x14')](_0xe59a('0x16'),_0x3940a7,_0x4a1f7e['error'][_0xe59a('0x17')]);return _0x55874c(_0x4a1f7e[_0xe59a('0x14')][_0xe59a('0x17')]);}logger[_0xe59a('0x14')](_0xe59a('0x16'),_0x3940a7,_0x4a1f7e[_0xe59a('0x14')][_0xe59a('0x17')]);return _0x3d381b(_0x4a1f7e['error']['message']);}else{logger[_0xe59a('0xf')](_0xe59a('0x16'),_0x3940a7,'request\x20sent');_0x3d381b(_0x4a1f7e[_0xe59a('0x18')]['message']);}})[_0xe59a('0x19')](function(_0x37962d){logger[_0xe59a('0x14')](_0xe59a('0x16'),_0x3940a7,_0x37962d);_0x55874c(_0x37962d);});});}exports['ShowWhatsappAccount']=function(_0x37d0f8){var _0x33eb2e=this;return new Promise(function(_0x344622,_0x3d2020){return db[_0xe59a('0x1a')][_0xe59a('0x1b')]({'raw':_0x37d0f8[_0xe59a('0x1c')]?_0x37d0f8[_0xe59a('0x1c')][_0xe59a('0x1d')]===undefined?!![]:![]:!![],'where':_0x37d0f8[_0xe59a('0x1c')]?_0x37d0f8['options'][_0xe59a('0x1e')]||null:null,'attributes':_0x37d0f8[_0xe59a('0x1c')]?_0x37d0f8[_0xe59a('0x1c')][_0xe59a('0x1f')]||null:null,'include':_0x37d0f8[_0xe59a('0x1c')]?_0x37d0f8[_0xe59a('0x1c')][_0xe59a('0x20')]?_[_0xe59a('0x21')](_0x37d0f8['options'][_0xe59a('0x20')],function(_0xefa38a){return{'model':db[_0xefa38a[_0xe59a('0x22')]],'as':_0xefa38a['as'],'attributes':_0xefa38a[_0xe59a('0x1f')],'include':_0xefa38a[_0xe59a('0x20')]?_['map'](_0xefa38a['include'],function(_0x554a38){return{'model':db[_0x554a38[_0xe59a('0x22')]],'as':_0x554a38['as'],'attributes':_0x554a38['attributes'],'include':_0x554a38[_0xe59a('0x20')]?_[_0xe59a('0x21')](_0x554a38[_0xe59a('0x20')],function(_0x417d8f){return{'model':db[_0x417d8f[_0xe59a('0x22')]],'as':_0x417d8f['as'],'attributes':_0x417d8f[_0xe59a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe59a('0x23')](function(_0x2720b9){logger['info'](_0xe59a('0x24'),_0x37d0f8);logger['debug'](_0xe59a('0x24'),_0x37d0f8,JSON['stringify'](_0x2720b9));_0x344622(_0x2720b9);})['catch'](function(_0x2b3fa7){logger[_0xe59a('0x14')](_0xe59a('0x24'),_0x2b3fa7[_0xe59a('0x17')],_0x37d0f8);_0x3d2020(_0x33eb2e['error'](0x1f4,_0x2b3fa7[_0xe59a('0x17')]));});});}; \ No newline at end of file +var _0x3563=['include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes'];(function(_0x5d6ae3,_0x131c70){var _0x4d291c=function(_0x442d09){while(--_0x442d09){_0x5d6ae3['push'](_0x5d6ae3['shift']());}};_0x4d291c(++_0x131c70);}(_0x3563,0x159));var _0x3356=function(_0x5a8015,_0x37e4f1){_0x5a8015=_0x5a8015-0x0;var _0x362bf8=_0x3563[_0x5a8015];return _0x362bf8;};'use strict';var _=require(_0x3356('0x0'));var util=require(_0x3356('0x1'));var moment=require(_0x3356('0x2'));var BPromise=require(_0x3356('0x3'));var rs=require(_0x3356('0x4'));var fs=require('fs');var Redis=require(_0x3356('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3356('0x6'));var logger=require(_0x3356('0x7'))(_0x3356('0x8'));var config=require(_0x3356('0x9'));var jayson=require(_0x3356('0xa'));var client=jayson[_0x3356('0xb')]['http']({'port':0x232a});config[_0x3356('0xc')]=_[_0x3356('0xd')](config['redis'],{'host':_0x3356('0xe'),'port':0x18eb});var socket=require(_0x3356('0xf'))(new Redis(config[_0x3356('0xc')]));require(_0x3356('0x10'))['register'](socket);function respondWithRpcPromise(_0x5950c8,_0x1ce952,_0x3c2055){return new BPromise(function(_0x3e2dd2,_0x195b7f){return client['request'](_0x5950c8,_0x3c2055)[_0x3356('0x11')](function(_0x59089d){logger['info'](_0x3356('0x12'),_0x1ce952,_0x3356('0x13'));logger[_0x3356('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1ce952,'request\x20sent',JSON[_0x3356('0x15')](_0x59089d));if(_0x59089d[_0x3356('0x16')]){if(_0x59089d[_0x3356('0x16')][_0x3356('0x17')]===0x1f4){logger[_0x3356('0x16')](_0x3356('0x12'),_0x1ce952,_0x59089d[_0x3356('0x16')][_0x3356('0x18')]);return _0x195b7f(_0x59089d[_0x3356('0x16')][_0x3356('0x18')]);}logger[_0x3356('0x16')](_0x3356('0x12'),_0x1ce952,_0x59089d[_0x3356('0x16')][_0x3356('0x18')]);return _0x3e2dd2(_0x59089d[_0x3356('0x16')]['message']);}else{logger[_0x3356('0x19')](_0x3356('0x12'),_0x1ce952,_0x3356('0x13'));_0x3e2dd2(_0x59089d[_0x3356('0x1a')][_0x3356('0x18')]);}})[_0x3356('0x1b')](function(_0x1bdb72){logger[_0x3356('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x1ce952,_0x1bdb72);_0x195b7f(_0x1bdb72);});});}exports[_0x3356('0x1c')]=function(_0x48fac){var _0x422c2d=this;return new Promise(function(_0x109bc2,_0x2e34af){return db[_0x3356('0x1d')][_0x3356('0x1e')]({'raw':_0x48fac[_0x3356('0x1f')]?_0x48fac[_0x3356('0x1f')][_0x3356('0x20')]===undefined?!![]:![]:!![],'where':_0x48fac[_0x3356('0x1f')]?_0x48fac[_0x3356('0x1f')][_0x3356('0x21')]||null:null,'attributes':_0x48fac['options']?_0x48fac[_0x3356('0x1f')][_0x3356('0x22')]||null:null,'include':_0x48fac['options']?_0x48fac[_0x3356('0x1f')][_0x3356('0x23')]?_[_0x3356('0x24')](_0x48fac[_0x3356('0x1f')][_0x3356('0x23')],function(_0x2fe02d){return{'model':db[_0x2fe02d[_0x3356('0x25')]],'as':_0x2fe02d['as'],'attributes':_0x2fe02d[_0x3356('0x22')],'include':_0x2fe02d['include']?_[_0x3356('0x24')](_0x2fe02d['include'],function(_0x476161){return{'model':db[_0x476161[_0x3356('0x25')]],'as':_0x476161['as'],'attributes':_0x476161[_0x3356('0x22')],'include':_0x476161[_0x3356('0x23')]?_[_0x3356('0x24')](_0x476161[_0x3356('0x23')],function(_0x50ddab){return{'model':db[_0x50ddab['model']],'as':_0x50ddab['as'],'attributes':_0x50ddab[_0x3356('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3356('0x11')](function(_0x418dae){logger['info'](_0x3356('0x1c'),_0x48fac);logger[_0x3356('0x14')](_0x3356('0x1c'),_0x48fac,JSON[_0x3356('0x15')](_0x418dae));_0x109bc2(_0x418dae);})[_0x3356('0x1b')](function(_0x2a8a2b){logger['error'](_0x3356('0x1c'),_0x2a8a2b[_0x3356('0x18')],_0x48fac);_0x2e34af(_0x422c2d[_0x3356('0x16')](0x1f4,_0x2a8a2b[_0x3356('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 859e650..875eeb4 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 _0xba16=['emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xba16,0x14c));var _0x6ba1=function(_0x2bff9c,_0xe5758){_0x2bff9c=_0x2bff9c-0x0;var _0x24ca0b=_0xba16[_0x2bff9c];return _0x24ca0b;};'use strict';var WhatsappAccountEvents=require(_0x6ba1('0x0'));var events=[_0x6ba1('0x1'),_0x6ba1('0x2'),_0x6ba1('0x3')];function createListener(_0x2fa5f7,_0x32d73e){return function(_0x2543a8){_0x32d73e[_0x6ba1('0x4')](_0x2fa5f7,_0x2543a8);};}function removeListener(_0x459f65,_0x4d9da9){return function(){WhatsappAccountEvents[_0x6ba1('0x5')](_0x459f65,_0x4d9da9);};}exports['register']=function(_0x3487c9){for(var _0xd3b084=0x0,_0x168f7a=events[_0x6ba1('0x6')];_0xd3b084<_0x168f7a;_0xd3b084++){var _0x32bc3c=events[_0xd3b084];var _0x32aed2=createListener(_0x6ba1('0x7')+_0x32bc3c,_0x3487c9);WhatsappAccountEvents['on'](_0x32bc3c,_0x32aed2);}}; \ No newline at end of file +var _0x8ebb=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','removeListener'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x8ebb,0x143));var _0xb8eb=function(_0x2ac1eb,_0x5955e0){_0x2ac1eb=_0x2ac1eb-0x0;var _0x22d131=_0x8ebb[_0x2ac1eb];return _0x22d131;};'use strict';var WhatsappAccountEvents=require(_0xb8eb('0x0'));var events=[_0xb8eb('0x1'),_0xb8eb('0x2'),_0xb8eb('0x3')];function createListener(_0x5b0b44,_0x46c6e0){return function(_0x2eed0c){_0x46c6e0['emit'](_0x5b0b44,_0x2eed0c);};}function removeListener(_0x2c51f1,_0x3e0db9){return function(){WhatsappAccountEvents[_0xb8eb('0x4')](_0x2c51f1,_0x3e0db9);};}exports[_0xb8eb('0x5')]=function(_0x4e597f){for(var _0x1fd049=0x0,_0x74545b=events[_0xb8eb('0x6')];_0x1fd049<_0x74545b;_0x1fd049++){var _0x2f891f=events[_0x1fd049];var _0xe69d93=createListener(_0xb8eb('0x7')+_0x2f891f,_0x4e597f);WhatsappAccountEvents['on'](_0x2f891f,_0xe69d93);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index beb6220..0ea96f2 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 _0x9726=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','/:id','show','post','isAuthenticated','create'];(function(_0x298ab1,_0x50e237){var _0x3b7cff=function(_0x112608){while(--_0x112608){_0x298ab1['push'](_0x298ab1['shift']());}};_0x3b7cff(++_0x50e237);}(_0x9726,0x111));var _0x6972=function(_0x38a16e,_0x39f143){_0x38a16e=_0x38a16e-0x0;var _0x45722a=_0x9726[_0x38a16e];return _0x45722a;};'use strict';var multer=require('multer');var util=require(_0x6972('0x0'));var path=require(_0x6972('0x1'));var timeout=require(_0x6972('0x2'));var express=require(_0x6972('0x3'));var router=express[_0x6972('0x4')]();var fs_extra=require(_0x6972('0x5'));var auth=require(_0x6972('0x6'));var interaction=require(_0x6972('0x7'));var config=require('../../config/environment');var controller=require(_0x6972('0x8'));router[_0x6972('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6972('0x9')](_0x6972('0xa'),auth['isAuthenticated'](),controller[_0x6972('0xb')]);router[_0x6972('0xc')]('/',auth[_0x6972('0xd')](),controller[_0x6972('0xe')]);router['put']('/:id',auth[_0x6972('0xd')](),controller['update']);router['delete'](_0x6972('0xa'),auth[_0x6972('0xd')](),controller['destroy']);module[_0x6972('0xf')]=router; \ No newline at end of file +var _0x7e96=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout'];(function(_0x206c34,_0x211ce3){var _0x1a42c9=function(_0x404136){while(--_0x404136){_0x206c34['push'](_0x206c34['shift']());}};_0x1a42c9(++_0x211ce3);}(_0x7e96,0xe3));var _0x67e9=function(_0x27d6e8,_0x332f83){_0x27d6e8=_0x27d6e8-0x0;var _0x4d7f51=_0x7e96[_0x27d6e8];return _0x4d7f51;};'use strict';var multer=require(_0x67e9('0x0'));var util=require(_0x67e9('0x1'));var path=require(_0x67e9('0x2'));var timeout=require(_0x67e9('0x3'));var express=require(_0x67e9('0x4'));var router=express[_0x67e9('0x5')]();var fs_extra=require(_0x67e9('0x6'));var auth=require(_0x67e9('0x7'));var interaction=require(_0x67e9('0x8'));var config=require(_0x67e9('0x9'));var controller=require(_0x67e9('0xa'));router[_0x67e9('0xb')]('/',auth[_0x67e9('0xc')](),controller[_0x67e9('0xd')]);router[_0x67e9('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x67e9('0xe')]);router[_0x67e9('0xf')]('/',auth[_0x67e9('0xc')](),controller[_0x67e9('0x10')]);router[_0x67e9('0x11')](_0x67e9('0x12'),auth['isAuthenticated'](),controller[_0x67e9('0x13')]);router['delete'](_0x67e9('0x12'),auth[_0x67e9('0xc')](),controller['destroy']);module[_0x67e9('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 1f7ea65..dc70b60 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 _0xad1f=['STRING','*,*,*,*','exports','noop','TEXT'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xad1f,0xb6));var _0xfad1=function(_0x3e9de6,_0x22b3ee){_0x3e9de6=_0x3e9de6-0x0;var _0x1d2f3c=_0xad1f[_0x3e9de6];return _0x1d2f3c;};'use strict';var Sequelize=require('sequelize');module[_0xfad1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfad1('0x1')},'appdata':{'type':Sequelize[_0xfad1('0x2')]()},'description':{'type':Sequelize[_0xfad1('0x3')]},'interval':{'type':Sequelize[_0xfad1('0x3')],'defaultValue':_0xfad1('0x4')}}; \ No newline at end of file +var _0x5435=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x163000,_0x4ee91){var _0xacd5af=function(_0x38139d){while(--_0x38139d){_0x163000['push'](_0x163000['shift']());}};_0xacd5af(++_0x4ee91);}(_0x5435,0x1c6));var _0x5543=function(_0x449978,_0x33e040){_0x449978=_0x449978-0x0;var _0xa232d4=_0x5435[_0x449978];return _0xa232d4;};'use strict';var Sequelize=require(_0x5543('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5543('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5543('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5543('0x3')]()},'description':{'type':Sequelize[_0x5543('0x2')]},'interval':{'type':Sequelize[_0x5543('0x2')],'defaultValue':_0x5543('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fec96d3..6f97a54 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 _0x4329=['query','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','filters','intersection','attributes'];(function(_0x14ec9e,_0x1677ff){var _0x3efa71=function(_0x391186){while(--_0x391186){_0x14ec9e['push'](_0x14ec9e['shift']());}};_0x3efa71(++_0x1677ff);}(_0x4329,0x13b));var _0x9432=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4329[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x9432('0x0'));var rimraf=require(_0x9432('0x1'));var zipdir=require(_0x9432('0x2'));var jsonpatch=require(_0x9432('0x3'));var rp=require(_0x9432('0x4'));var moment=require(_0x9432('0x5'));var BPromise=require(_0x9432('0x6'));var Mustache=require(_0x9432('0x7'));var util=require(_0x9432('0x8'));var path=require(_0x9432('0x9'));var sox=require(_0x9432('0xa'));var csv=require(_0x9432('0xb'));var ejs=require(_0x9432('0xc'));var fs=require('fs');var fs_extra=require(_0x9432('0xd'));var _=require('lodash');var squel=require(_0x9432('0xe'));var crypto=require('crypto');var jsforce=require(_0x9432('0xf'));var deskjs=require(_0x9432('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9432('0x11'));var Papa=require(_0x9432('0x12'));var Redis=require(_0x9432('0x13'));var authService=require(_0x9432('0x14'));var qs=require(_0x9432('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9432('0x16'));var logger=require(_0x9432('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x9432('0x18'));var licenseUtil=require(_0x9432('0x19'));var db=require(_0x9432('0x1a'))['db'];function respondWithStatusCode(_0x3a49db,_0x50a287){_0x50a287=_0x50a287||0xcc;return function(_0x1d8ca4){if(_0x1d8ca4){return _0x3a49db[_0x9432('0x1b')](_0x50a287);}return _0x3a49db[_0x9432('0x1c')](_0x50a287)[_0x9432('0x1d')]();};}function respondWithResult(_0x4a9793,_0x5e3c0d){_0x5e3c0d=_0x5e3c0d||0xc8;return function(_0x3c2eea){if(_0x3c2eea){return _0x4a9793[_0x9432('0x1c')](_0x5e3c0d)['json'](_0x3c2eea);}};}function respondWithFilteredResult(_0x15329f,_0x37bd72){return function(_0x5678c4){if(_0x5678c4){var _0x2b8d4b=typeof _0x37bd72[_0x9432('0x1e')]==='undefined'&&typeof _0x37bd72['limit']==='undefined';var _0x5e2163=_0x5678c4['count'];var _0x2eabe3=_0x2b8d4b?0x0:_0x37bd72[_0x9432('0x1e')];var _0xac7dce=_0x2b8d4b?_0x5678c4['count']:_0x37bd72[_0x9432('0x1e')]+_0x37bd72['limit'];var _0x18fd9d;if(_0xac7dce>=_0x5e2163){_0xac7dce=_0x5e2163;_0x18fd9d=0xc8;}else{_0x18fd9d=0xce;}_0x15329f[_0x9432('0x1c')](_0x18fd9d);return _0x15329f[_0x9432('0x1f')]('Content-Range',_0x2eabe3+'-'+_0xac7dce+'/'+_0x5e2163)[_0x9432('0x20')](_0x5678c4);}return null;};}function patchUpdates(_0x1122ee){return function(_0x450101){try{jsonpatch[_0x9432('0x21')](_0x450101,_0x1122ee,!![]);}catch(_0xf62a59){return BPromise[_0x9432('0x22')](_0xf62a59);}return _0x450101[_0x9432('0x23')]();};}function saveUpdates(_0x57721f,_0x47c4aa){return function(_0x4e247c){if(_0x4e247c){return _0x4e247c[_0x9432('0x24')](_0x57721f)[_0x9432('0x25')](function(_0xf1b400){return _0xf1b400;});}return null;};}function removeEntity(_0x1c4829,_0x4a9895){return function(_0x243225){if(_0x243225){return _0x243225['destroy']()[_0x9432('0x25')](function(){_0x1c4829[_0x9432('0x1c')](0xcc)[_0x9432('0x1d')]();});}};}function handleEntityNotFound(_0x1dfee6,_0x274610){return function(_0x21aab4){if(!_0x21aab4){_0x1dfee6[_0x9432('0x1b')](0x194);}return _0x21aab4;};}function handleError(_0x205ce9,_0x9d258d){_0x9d258d=_0x9d258d||0x1f4;return function(_0x14627b){logger['error'](_0x14627b['stack']);if(_0x14627b[_0x9432('0x26')]){delete _0x14627b['name'];}_0x205ce9['status'](_0x9d258d)[_0x9432('0x27')](_0x14627b);};}exports['index']=function(_0x4bf4ae,_0x3c8992){var _0x27a638={},_0x146a06={},_0x22ba3d={'count':0x0,'rows':[]};var _0x5d4f68=_['map'](db[_0x9432('0x28')][_0x9432('0x29')],function(_0x45f6ca){return{'name':_0x45f6ca[_0x9432('0x2a')],'type':_0x45f6ca[_0x9432('0x2b')][_0x9432('0x2c')]};});_0x146a06[_0x9432('0x2d')]=_[_0x9432('0x2e')](_0x5d4f68,_0x9432('0x26'));_0x146a06['query']=_['keys'](_0x4bf4ae['query']);_0x146a06[_0x9432('0x2f')]=_[_0x9432('0x30')](_0x146a06['model'],_0x146a06['query']);_0x27a638[_0x9432('0x31')]=_[_0x9432('0x30')](_0x146a06[_0x9432('0x2d')],qs['fields'](_0x4bf4ae[_0x9432('0x32')][_0x9432('0x33')]));_0x27a638[_0x9432('0x31')]=_0x27a638['attributes'][_0x9432('0x34')]?_0x27a638['attributes']:_0x146a06[_0x9432('0x2d')];if(!_0x4bf4ae[_0x9432('0x32')]['hasOwnProperty'](_0x9432('0x35'))){_0x27a638[_0x9432('0x36')]=qs[_0x9432('0x36')](_0x4bf4ae[_0x9432('0x32')][_0x9432('0x36')]);_0x27a638[_0x9432('0x1e')]=qs[_0x9432('0x1e')](_0x4bf4ae[_0x9432('0x32')][_0x9432('0x1e')]);}_0x27a638[_0x9432('0x37')]=qs['sort'](_0x4bf4ae['query'][_0x9432('0x38')]);_0x27a638[_0x9432('0x39')]=qs[_0x9432('0x2f')](_[_0x9432('0x3a')](_0x4bf4ae[_0x9432('0x32')],_0x146a06[_0x9432('0x2f')]),_0x5d4f68);if(_0x4bf4ae[_0x9432('0x32')][_0x9432('0x3b')]){_0x27a638['where']=_[_0x9432('0x3c')](_0x27a638[_0x9432('0x39')],{'$or':_[_0x9432('0x2e')](_0x5d4f68,function(_0x4c9ba8){if(_0x4c9ba8[_0x9432('0x2b')]!=='VIRTUAL'){var _0x392d69={};_0x392d69[_0x4c9ba8['name']]={'$like':'%'+_0x4bf4ae[_0x9432('0x32')]['filter']+'%'};return _0x392d69;}})});}_0x27a638=_[_0x9432('0x3c')]({},_0x27a638,_0x4bf4ae[_0x9432('0x3d')]);var _0x26eb35={'where':_0x27a638['where']};return db[_0x9432('0x28')][_0x9432('0x3e')](_0x26eb35)['then'](function(_0x5b7665){_0x22ba3d[_0x9432('0x3e')]=_0x5b7665;if(_0x4bf4ae[_0x9432('0x32')][_0x9432('0x3f')]){_0x27a638[_0x9432('0x40')]=[{'all':!![]}];}return db[_0x9432('0x28')]['findAll'](_0x27a638);})[_0x9432('0x25')](function(_0x16b539){_0x22ba3d['rows']=_0x16b539;return _0x22ba3d;})[_0x9432('0x25')](respondWithFilteredResult(_0x3c8992,_0x27a638))[_0x9432('0x41')](handleError(_0x3c8992,null));};exports[_0x9432('0x42')]=function(_0x345dc9,_0x2a5820){var _0x284786={'raw':!![],'where':{'id':_0x345dc9[_0x9432('0x43')]['id']}},_0xc59ab={};_0xc59ab[_0x9432('0x2d')]=_['keys'](db[_0x9432('0x28')][_0x9432('0x29')]);_0xc59ab[_0x9432('0x32')]=_[_0x9432('0x44')](_0x345dc9['query']);_0xc59ab['filters']=_[_0x9432('0x30')](_0xc59ab[_0x9432('0x2d')],_0xc59ab[_0x9432('0x32')]);_0x284786[_0x9432('0x31')]=_['intersection'](_0xc59ab[_0x9432('0x2d')],qs[_0x9432('0x33')](_0x345dc9[_0x9432('0x32')][_0x9432('0x33')]));_0x284786[_0x9432('0x31')]=_0x284786[_0x9432('0x31')][_0x9432('0x34')]?_0x284786['attributes']:_0xc59ab[_0x9432('0x2d')];if(_0x345dc9[_0x9432('0x32')]['includeAll']){_0x284786['include']=[{'all':!![]}];}_0x284786=_[_0x9432('0x3c')]({},_0x284786,_0x345dc9[_0x9432('0x3d')]);return db['WhatsappApplication'][_0x9432('0x45')](_0x284786)['then'](handleEntityNotFound(_0x2a5820,null))[_0x9432('0x25')](respondWithResult(_0x2a5820,null))[_0x9432('0x41')](handleError(_0x2a5820,null));};exports[_0x9432('0x46')]=function(_0x528dd3,_0x4cb50a){return db[_0x9432('0x28')]['create'](_0x528dd3[_0x9432('0x47')],{})['then'](respondWithResult(_0x4cb50a,0xc9))['catch'](handleError(_0x4cb50a,null));};exports['update']=function(_0x36e887,_0x246257){if(_0x36e887['body']['id']){delete _0x36e887[_0x9432('0x47')]['id'];}return db[_0x9432('0x28')][_0x9432('0x45')]({'where':{'id':_0x36e887[_0x9432('0x43')]['id']}})[_0x9432('0x25')](handleEntityNotFound(_0x246257,null))['then'](saveUpdates(_0x36e887[_0x9432('0x47')],null))['then'](respondWithResult(_0x246257,null))[_0x9432('0x41')](handleError(_0x246257,null));};exports[_0x9432('0x48')]=function(_0x233917,_0x8c728d){return db[_0x9432('0x28')][_0x9432('0x45')]({'where':{'id':_0x233917['params']['id']}})[_0x9432('0x25')](handleEntityNotFound(_0x8c728d,null))[_0x9432('0x25')](removeEntity(_0x8c728d,null))[_0x9432('0x41')](handleError(_0x8c728d,null));}; \ No newline at end of file +var _0xd1ca=['name','index','WhatsappApplication','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','eml-format','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xd1ca,0x140));var _0xad1c=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xd1ca[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0xad1c('0x0'));var rimraf=require(_0xad1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xad1c('0x2'));var BPromise=require(_0xad1c('0x3'));var Mustache=require(_0xad1c('0x4'));var util=require('util');var path=require(_0xad1c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad1c('0x6'));var fs=require('fs');var fs_extra=require(_0xad1c('0x7'));var _=require(_0xad1c('0x8'));var squel=require('squel');var crypto=require(_0xad1c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad1c('0xa'));var toCsv=require(_0xad1c('0xb'));var querystring=require(_0xad1c('0xc'));var Papa=require(_0xad1c('0xd'));var Redis=require(_0xad1c('0xe'));var authService=require(_0xad1c('0xf'));var qs=require(_0xad1c('0x10'));var as=require(_0xad1c('0x11'));var hardwareService=require(_0xad1c('0x12'));var logger=require(_0xad1c('0x13'))('api');var utils=require(_0xad1c('0x14'));var config=require(_0xad1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad1c('0x16'))['db'];function respondWithStatusCode(_0x7494c3,_0xd5bdd7){_0xd5bdd7=_0xd5bdd7||0xcc;return function(_0xd0c3f0){if(_0xd0c3f0){return _0x7494c3[_0xad1c('0x17')](_0xd5bdd7);}return _0x7494c3[_0xad1c('0x18')](_0xd5bdd7)[_0xad1c('0x19')]();};}function respondWithResult(_0x4ce86e,_0x324030){_0x324030=_0x324030||0xc8;return function(_0x3a7308){if(_0x3a7308){return _0x4ce86e[_0xad1c('0x18')](_0x324030)[_0xad1c('0x1a')](_0x3a7308);}};}function respondWithFilteredResult(_0x210eba,_0x494b59){return function(_0x4194c0){if(_0x4194c0){var _0x48c651=typeof _0x494b59[_0xad1c('0x1b')]===_0xad1c('0x1c')&&typeof _0x494b59['limit']===_0xad1c('0x1c');var _0x5d188a=_0x4194c0[_0xad1c('0x1d')];var _0x417112=_0x48c651?0x0:_0x494b59['offset'];var _0x587867=_0x48c651?_0x4194c0[_0xad1c('0x1d')]:_0x494b59[_0xad1c('0x1b')]+_0x494b59[_0xad1c('0x1e')];var _0x35c246;if(_0x587867>=_0x5d188a){_0x587867=_0x5d188a;_0x35c246=0xc8;}else{_0x35c246=0xce;}_0x210eba['status'](_0x35c246);return _0x210eba[_0xad1c('0x1f')](_0xad1c('0x20'),_0x417112+'-'+_0x587867+'/'+_0x5d188a)[_0xad1c('0x1a')](_0x4194c0);}return null;};}function patchUpdates(_0x51d25c){return function(_0x5e2d17){try{jsonpatch[_0xad1c('0x21')](_0x5e2d17,_0x51d25c,!![]);}catch(_0x395037){return BPromise[_0xad1c('0x22')](_0x395037);}return _0x5e2d17[_0xad1c('0x23')]();};}function saveUpdates(_0x1008c3,_0x16f940){return function(_0x2a6953){if(_0x2a6953){return _0x2a6953['update'](_0x1008c3)[_0xad1c('0x24')](function(_0xfe9e59){return _0xfe9e59;});}return null;};}function removeEntity(_0x2b33ab,_0x509c13){return function(_0x42e527){if(_0x42e527){return _0x42e527[_0xad1c('0x25')]()['then'](function(){_0x2b33ab[_0xad1c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3893a3,_0x18bd4c){return function(_0x3f2edc){if(!_0x3f2edc){_0x3893a3[_0xad1c('0x17')](0x194);}return _0x3f2edc;};}function handleError(_0x5951b2,_0x233061){_0x233061=_0x233061||0x1f4;return function(_0x996162){logger[_0xad1c('0x26')](_0x996162[_0xad1c('0x27')]);if(_0x996162[_0xad1c('0x28')]){delete _0x996162['name'];}_0x5951b2[_0xad1c('0x18')](_0x233061)['send'](_0x996162);};}exports[_0xad1c('0x29')]=function(_0x2a70f9,_0x537965){var _0x35406d={},_0x8e1238={},_0x474f6f={'count':0x0,'rows':[]};var _0x49c827=_['map'](db[_0xad1c('0x2a')]['rawAttributes'],function(_0x34d32c){return{'name':_0x34d32c['fieldName'],'type':_0x34d32c[_0xad1c('0x2b')]['key']};});_0x8e1238[_0xad1c('0x2c')]=_[_0xad1c('0x2d')](_0x49c827,_0xad1c('0x28'));_0x8e1238[_0xad1c('0x2e')]=_[_0xad1c('0x2f')](_0x2a70f9[_0xad1c('0x2e')]);_0x8e1238[_0xad1c('0x30')]=_[_0xad1c('0x31')](_0x8e1238[_0xad1c('0x2c')],_0x8e1238[_0xad1c('0x2e')]);_0x35406d['attributes']=_[_0xad1c('0x31')](_0x8e1238[_0xad1c('0x2c')],qs['fields'](_0x2a70f9[_0xad1c('0x2e')][_0xad1c('0x32')]));_0x35406d[_0xad1c('0x33')]=_0x35406d['attributes']['length']?_0x35406d[_0xad1c('0x33')]:_0x8e1238['model'];if(!_0x2a70f9[_0xad1c('0x2e')][_0xad1c('0x34')](_0xad1c('0x35'))){_0x35406d[_0xad1c('0x1e')]=qs[_0xad1c('0x1e')](_0x2a70f9['query'][_0xad1c('0x1e')]);_0x35406d[_0xad1c('0x1b')]=qs[_0xad1c('0x1b')](_0x2a70f9[_0xad1c('0x2e')][_0xad1c('0x1b')]);}_0x35406d['order']=qs[_0xad1c('0x36')](_0x2a70f9[_0xad1c('0x2e')][_0xad1c('0x36')]);_0x35406d[_0xad1c('0x37')]=qs[_0xad1c('0x30')](_[_0xad1c('0x38')](_0x2a70f9[_0xad1c('0x2e')],_0x8e1238[_0xad1c('0x30')]),_0x49c827);if(_0x2a70f9[_0xad1c('0x2e')]['filter']){_0x35406d[_0xad1c('0x37')]=_[_0xad1c('0x39')](_0x35406d[_0xad1c('0x37')],{'$or':_['map'](_0x49c827,function(_0x50d597){if(_0x50d597['type']!=='VIRTUAL'){var _0x3d63ea={};_0x3d63ea[_0x50d597[_0xad1c('0x28')]]={'$like':'%'+_0x2a70f9[_0xad1c('0x2e')][_0xad1c('0x3a')]+'%'};return _0x3d63ea;}})});}_0x35406d=_[_0xad1c('0x39')]({},_0x35406d,_0x2a70f9[_0xad1c('0x3b')]);var _0x54ab52={'where':_0x35406d[_0xad1c('0x37')]};return db[_0xad1c('0x2a')][_0xad1c('0x1d')](_0x54ab52)['then'](function(_0x478be4){_0x474f6f[_0xad1c('0x1d')]=_0x478be4;if(_0x2a70f9['query'][_0xad1c('0x3c')]){_0x35406d[_0xad1c('0x3d')]=[{'all':!![]}];}return db[_0xad1c('0x2a')][_0xad1c('0x3e')](_0x35406d);})['then'](function(_0x1b5a1a){_0x474f6f[_0xad1c('0x3f')]=_0x1b5a1a;return _0x474f6f;})[_0xad1c('0x24')](respondWithFilteredResult(_0x537965,_0x35406d))[_0xad1c('0x40')](handleError(_0x537965,null));};exports[_0xad1c('0x41')]=function(_0x52bb1b,_0x52d808){var _0x4ac3bc={'raw':!![],'where':{'id':_0x52bb1b[_0xad1c('0x42')]['id']}},_0x27d78d={};_0x27d78d[_0xad1c('0x2c')]=_[_0xad1c('0x2f')](db[_0xad1c('0x2a')][_0xad1c('0x43')]);_0x27d78d[_0xad1c('0x2e')]=_[_0xad1c('0x2f')](_0x52bb1b[_0xad1c('0x2e')]);_0x27d78d[_0xad1c('0x30')]=_[_0xad1c('0x31')](_0x27d78d[_0xad1c('0x2c')],_0x27d78d[_0xad1c('0x2e')]);_0x4ac3bc[_0xad1c('0x33')]=_[_0xad1c('0x31')](_0x27d78d['model'],qs[_0xad1c('0x32')](_0x52bb1b['query'][_0xad1c('0x32')]));_0x4ac3bc[_0xad1c('0x33')]=_0x4ac3bc[_0xad1c('0x33')][_0xad1c('0x44')]?_0x4ac3bc[_0xad1c('0x33')]:_0x27d78d[_0xad1c('0x2c')];if(_0x52bb1b[_0xad1c('0x2e')]['includeAll']){_0x4ac3bc['include']=[{'all':!![]}];}_0x4ac3bc=_[_0xad1c('0x39')]({},_0x4ac3bc,_0x52bb1b[_0xad1c('0x3b')]);return db[_0xad1c('0x2a')]['find'](_0x4ac3bc)[_0xad1c('0x24')](handleEntityNotFound(_0x52d808,null))['then'](respondWithResult(_0x52d808,null))['catch'](handleError(_0x52d808,null));};exports[_0xad1c('0x45')]=function(_0x1d4e86,_0x39d597){return db[_0xad1c('0x2a')][_0xad1c('0x45')](_0x1d4e86[_0xad1c('0x46')],{})[_0xad1c('0x24')](respondWithResult(_0x39d597,0xc9))['catch'](handleError(_0x39d597,null));};exports['update']=function(_0x3ed569,_0x35c5e7){if(_0x3ed569[_0xad1c('0x46')]['id']){delete _0x3ed569[_0xad1c('0x46')]['id'];}return db[_0xad1c('0x2a')][_0xad1c('0x47')]({'where':{'id':_0x3ed569['params']['id']}})[_0xad1c('0x24')](handleEntityNotFound(_0x35c5e7,null))[_0xad1c('0x24')](saveUpdates(_0x3ed569[_0xad1c('0x46')],null))[_0xad1c('0x24')](respondWithResult(_0x35c5e7,null))[_0xad1c('0x40')](handleError(_0x35c5e7,null));};exports[_0xad1c('0x25')]=function(_0x3f679e,_0x124600){return db['WhatsappApplication'][_0xad1c('0x47')]({'where':{'id':_0x3f679e['params']['id']}})['then'](handleEntityNotFound(_0x124600,null))[_0xad1c('0x24')](removeEntity(_0x124600,null))['catch'](handleError(_0x124600,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index f6883ac..0d315ff 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 _0x7a72=['moment','request-promise','rimraf','./whatsappApplication.attributes','whatsapp_applications','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0x7a72,0x1be));var _0x27a7=function(_0x4f216c,_0x4ad679){_0x4f216c=_0x4f216c-0x0;var _0x400573=_0x7a72[_0x4f216c];return _0x400573;};'use strict';var _=require('lodash');var util=require(_0x27a7('0x0'));var logger=require(_0x27a7('0x1'))('api');var moment=require(_0x27a7('0x2'));var BPromise=require('bluebird');var rp=require(_0x27a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27a7('0x4'));var config=require('../../config/environment');var attributes=require(_0x27a7('0x5'));module['exports']=function(_0x320fad,_0x372bb8){return _0x320fad['define']('WhatsappApplication',attributes,{'tableName':_0x27a7('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x27a7('0x7')});}; \ No newline at end of file +var _0x524a=['./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x275f66,_0x25fa4c){var _0x1bdad4=function(_0x5d4957){while(--_0x5d4957){_0x275f66['push'](_0x275f66['shift']());}};_0x1bdad4(++_0x25fa4c);}(_0x524a,0xf5));var _0xa524=function(_0x4d6ba6,_0x2c1cdd){_0x4d6ba6=_0x4d6ba6-0x0;var _0x2a08d8=_0x524a[_0x4d6ba6];return _0x2a08d8;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require('moment');var BPromise=require(_0xa524('0x4'));var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa524('0x7'));module[_0xa524('0x8')]=function(_0x16227b,_0x5f472f){return _0x16227b[_0xa524('0x9')]('WhatsappApplication',attributes,{'tableName':_0xa524('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa524('0xb'),'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 5b3c0b3..c89f5e4 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 _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xeec6,0x1c2));var _0x6eec=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xeec6[_0x16539a];return _0x200796;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x4671d6,_0x5b75ab){var _0x56e3f3=function(_0x3128b8){while(--_0x3128b8){_0x4671d6['push'](_0x4671d6['shift']());}};_0x56e3f3(++_0x5b75ab);}(_0xa8a8,0xec));var _0x8a8a=function(_0x28bbf7,_0x5e32e5){_0x28bbf7=_0x28bbf7-0x0;var _0x104b16=_0xa8a8[_0x28bbf7];return _0x104b16;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0003354..c6e90e7 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 _0xbd0a=['get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','put','/:id','tracked','whatsapp','whatsappinteraction:update','update','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller'];(function(_0x539d7b,_0x5f2eba){var _0x31953c=function(_0x2c792a){while(--_0x2c792a){_0x539d7b['push'](_0x539d7b['shift']());}};_0x31953c(++_0x5f2eba);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x406926,_0x12726a){_0x406926=_0x406926-0x0;var _0x43259a=_0xbd0a[_0x406926];return _0x43259a;};'use strict';var multer=require(_0xabd0('0x0'));var util=require('util');var path=require(_0xabd0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabd0('0x2'));var auth=require(_0xabd0('0x3'));var interaction=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var controller=require(_0xabd0('0x6'));router[_0xabd0('0x7')]('/',auth[_0xabd0('0x8')](),controller[_0xabd0('0x9')]);router[_0xabd0('0x7')]('/describe',auth[_0xabd0('0x8')](),controller[_0xabd0('0xa')]);router[_0xabd0('0x7')]('/:id',auth[_0xabd0('0x8')](),controller['show']);router[_0xabd0('0x7')](_0xabd0('0xb'),auth[_0xabd0('0x8')](),controller[_0xabd0('0xc')]);router['get'](_0xabd0('0xd'),auth['isAuthenticated'](),controller[_0xabd0('0xe')]);router[_0xabd0('0xf')]('/',auth[_0xabd0('0x8')](),controller[_0xabd0('0x10')]);router[_0xabd0('0xf')](_0xabd0('0xb'),auth['isAuthenticated'](),controller[_0xabd0('0x11')]);router['post'](_0xabd0('0x12'),auth[_0xabd0('0x8')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller['addTags']);router[_0xabd0('0x13')](_0xabd0('0x14'),auth[_0xabd0('0x8')](),interaction[_0xabd0('0x15')](_0xabd0('0x16'),_0xabd0('0x17')),controller[_0xabd0('0x18')]);router[_0xabd0('0x19')](_0xabd0('0x14'),auth['isAuthenticated'](),interaction[_0xabd0('0x15')]('whatsapp','whatsappinteraction:destroy'),controller[_0xabd0('0x1a')]);router[_0xabd0('0x19')](_0xabd0('0x12'),auth[_0xabd0('0x8')](),controller['removeTags']);module[_0xabd0('0x1b')]=router; \ No newline at end of file +var _0xc1c6=['/describe','isAuthenticated','describe','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x5a0d53,_0x169646){var _0x277d17=function(_0x417563){while(--_0x417563){_0x5a0d53['push'](_0x5a0d53['shift']());}};_0x277d17(++_0x169646);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x384b6f,_0x33ed03){_0x384b6f=_0x384b6f-0x0;var _0x176de0=_0xc1c6[_0x384b6f];return _0x176de0;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x7')]('/:id/download',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x10')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x11')]);router[_0x6c1c('0x10')](_0x6c1c('0xd'),auth['isAuthenticated'](),controller[_0x6c1c('0x12')]);router['post'](_0x6c1c('0x13'),auth[_0x6c1c('0xa')](),interaction[_0x6c1c('0x14')](_0x6c1c('0x15'),_0x6c1c('0x16')),controller[_0x6c1c('0x17')]);router[_0x6c1c('0x18')](_0x6c1c('0x19'),auth[_0x6c1c('0xa')](),interaction['tracked'](_0x6c1c('0x15'),_0x6c1c('0x1a')),controller['update']);router[_0x6c1c('0x1b')](_0x6c1c('0x19'),auth['isAuthenticated'](),interaction[_0x6c1c('0x14')]('whatsapp',_0x6c1c('0x1c')),controller[_0x6c1c('0x1d')]);router['delete'](_0x6c1c('0x13'),auth['isAuthenticated'](),controller[_0x6c1c('0x1e')]);module[_0x6c1c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 84a8d2e..d658c88 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 _0xbe52=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x1b91cf,_0x3c5876){var _0x3326f6=function(_0x2d85ae){while(--_0x2d85ae){_0x1b91cf['push'](_0x1b91cf['shift']());}};_0x3326f6(++_0x3c5876);}(_0xbe52,0x164));var _0x2be5=function(_0x3c7363,_0xe6bca3){_0x3c7363=_0x3c7363-0x0;var _0x119707=_0xbe52[_0x3c7363];return _0x119707;};'use strict';var Sequelize=require(_0x2be5('0x0'));var moment=require(_0x2be5('0x1'));module[_0x2be5('0x2')]={'closed':{'type':Sequelize[_0x2be5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2be5('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2be5('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2be5('0x5')]},'note':{'type':Sequelize[_0x2be5('0x5')]},'phone':{'type':Sequelize[_0x2be5('0x5')]},'read1stAt':{'type':Sequelize[_0x2be5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2be5('0x6')]('in',_0x2be5('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2be5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2be5('0x6')]('in',_0x2be5('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2be5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd5da=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd5da,0x9f));var _0xad5d=function(_0x22f515,_0x450313){_0x22f515=_0x22f515-0x0;var _0x57ea76=_0xd5da[_0x22f515];return _0x57ea76;};'use strict';var Sequelize=require(_0xad5d('0x0'));var moment=require(_0xad5d('0x1'));module['exports']={'closed':{'type':Sequelize[_0xad5d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xad5d('0x3')]},'disposition':{'type':Sequelize[_0xad5d('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xad5d('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xad5d('0x4')]},'read1stAt':{'type':Sequelize[_0xad5d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xad5d('0x5')]('in',_0xad5d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xad5d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xad5d('0x5')]('in',_0xad5d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xad5d('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 2016f73..e7bc61d 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 _0x8af6=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','WhatsappInteraction','includeAll','options','create','body','describe','addMessage','ids','getMessages','findOne','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','include','findAll','addTags','setTags','omit','spread','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','createReadStream','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','end','stack','name','Users','map','fullname','TagIds','split','Tags','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse'];(function(_0x18ebb2,_0x9ad3){var _0x4e71d5=function(_0x1dab06){while(--_0x1dab06){_0x18ebb2['push'](_0x18ebb2['shift']());}};_0x4e71d5(++_0x9ad3);}(_0x8af6,0x76));var _0x68af=function(_0x3ee5c9,_0x37d15f){_0x3ee5c9=_0x3ee5c9-0x0;var _0x311165=_0x8af6[_0x3ee5c9];return _0x311165;};'use strict';var emlformat=require(_0x68af('0x0'));var rimraf=require(_0x68af('0x1'));var zipdir=require(_0x68af('0x2'));var jsonpatch=require(_0x68af('0x3'));var rp=require(_0x68af('0x4'));var moment=require(_0x68af('0x5'));var BPromise=require(_0x68af('0x6'));var Mustache=require(_0x68af('0x7'));var util=require(_0x68af('0x8'));var path=require(_0x68af('0x9'));var sox=require('sox');var csv=require(_0x68af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68af('0xb'));var _=require(_0x68af('0xc'));var squel=require(_0x68af('0xd'));var crypto=require(_0x68af('0xe'));var jsforce=require(_0x68af('0xf'));var deskjs=require(_0x68af('0x10'));var toCsv=require(_0x68af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x68af('0x11'));var authService=require(_0x68af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x68af('0x13'));var pdf=require(_0x68af('0x14'));var hardwareService=require(_0x68af('0x15'));var logger=require(_0x68af('0x16'))(_0x68af('0x17'));var utils=require(_0x68af('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68af('0x19'))['db'];config['redis']=_['defaults'](config[_0x68af('0x1a')],{'host':_0x68af('0x1b'),'port':0x18eb});var socket=require(_0x68af('0x1c'))(new Redis(config['redis']));require(_0x68af('0x1d'))['register'](socket);function respondWithStatusCode(_0x3a6d18,_0x3c37db){_0x3c37db=_0x3c37db||0xcc;return function(_0x23fc49){if(_0x23fc49){return _0x3a6d18[_0x68af('0x1e')](_0x3c37db);}return _0x3a6d18[_0x68af('0x1f')](_0x3c37db)['end']();};}function respondWithResult(_0x43c1d9,_0xcdf590){_0xcdf590=_0xcdf590||0xc8;return function(_0x326b12){if(_0x326b12){return _0x43c1d9[_0x68af('0x1f')](_0xcdf590)['json'](_0x326b12);}};}function respondWithFilteredResult(_0x5357b1,_0x3aa998){return function(_0x29ddbf){if(_0x29ddbf){var _0x4e1c41=typeof _0x3aa998[_0x68af('0x20')]===_0x68af('0x21')&&typeof _0x3aa998[_0x68af('0x22')]===_0x68af('0x21');var _0x53ecde=_0x29ddbf[_0x68af('0x23')];var _0x11f94d=_0x4e1c41?0x0:_0x3aa998['offset'];var _0x5ad458=_0x4e1c41?_0x29ddbf[_0x68af('0x23')]:_0x3aa998[_0x68af('0x20')]+_0x3aa998[_0x68af('0x22')];var _0x2383f8;if(_0x5ad458>=_0x53ecde){_0x5ad458=_0x53ecde;_0x2383f8=0xc8;}else{_0x2383f8=0xce;}_0x5357b1[_0x68af('0x1f')](_0x2383f8);return _0x5357b1[_0x68af('0x24')]('Content-Range',_0x11f94d+'-'+_0x5ad458+'/'+_0x53ecde)[_0x68af('0x25')](_0x29ddbf);}return null;};}function patchUpdates(_0x3c71ef){return function(_0x5c28c9){try{jsonpatch[_0x68af('0x26')](_0x5c28c9,_0x3c71ef,!![]);}catch(_0x539bc0){return BPromise[_0x68af('0x27')](_0x539bc0);}return _0x5c28c9[_0x68af('0x28')]();};}function saveUpdates(_0xa489c3,_0x16e07a){return function(_0x2deb06){if(_0x2deb06){return _0x2deb06[_0x68af('0x29')](_0xa489c3)['then'](function(_0x514ebc){return _0x514ebc;});}return null;};}function removeEntity(_0x29f003,_0x6c175e){return function(_0x351909){if(_0x351909){return _0x351909[_0x68af('0x2a')]()[_0x68af('0x2b')](function(){_0x29f003[_0x68af('0x1f')](0xcc)[_0x68af('0x2c')]();});}};}function handleEntityNotFound(_0x2729fd,_0x5417e9){return function(_0x1f3963){if(!_0x1f3963){_0x2729fd[_0x68af('0x1e')](0x194);}return _0x1f3963;};}function handleError(_0xec7c01,_0x3d1303){_0x3d1303=_0x3d1303||0x1f4;return function(_0x4c3b67){logger['error'](_0x4c3b67[_0x68af('0x2d')]);if(_0x4c3b67[_0x68af('0x2e')]){delete _0x4c3b67[_0x68af('0x2e')];}_0xec7c01['status'](_0x3d1303)['send'](_0x4c3b67);};}function getInteractionUsers(_0x3c3268,_0x135dc1){return new BPromise(function(_0x5c0adb,_0x718b39){try{if(_0x135dc1[_0x3c3268['id']]){_0x3c3268[_0x68af('0x2f')]=_[_0x68af('0x30')](_0x135dc1[_0x3c3268['id']],function(_0x2eb9f2){return{'id':_0x2eb9f2['id'],'fullname':_0x2eb9f2[_0x68af('0x31')]};});}}catch(_0x38de14){_0x718b39(_0x38de14);}_0x5c0adb(_0x3c3268);});}function getInteractionTags(_0x18120e,_0x482f85){return new BPromise(function(_0xb27414,_0x1f6459){try{if(_0x18120e[_0x68af('0x32')]){_0x18120e['Tags']=[];_0x18120e[_0x68af('0x32')][_0x68af('0x33')](',')['forEach'](function(_0x6e74b9){_0x18120e[_0x68af('0x34')]['push'](_0x482f85[_0x6e74b9]);});}delete _0x18120e[_0x68af('0x32')];}catch(_0x4bff3d){_0x1f6459(_0x4bff3d);}_0xb27414(_0x18120e);});}function updateWhatsappInteraction(_0x48c8b4,_0x179cee,_0x54afc3){return new BPromise(function(_0x348193,_0x3264aa){return getInteractionUsers(_0x48c8b4,_0x54afc3)[_0x68af('0x2b')](function(_0x39152a){return getInteractionTags(_0x39152a,_0x179cee);})['then'](function(_0x565a9e){return getStateInteraction(_0x565a9e);})['then'](function(_0x294ead){_0x348193(_0x294ead);})[_0x68af('0x35')](function(_0x47c527){_0x3264aa(_0x47c527);});});}function getStateInteraction(_0x3ddbde){return new BPromise(function(_0x369bc2){_0x3ddbde[_0x68af('0x36')]=0x0;_0x3ddbde['talking']=0x0;_0x3ddbde[_0x68af('0x37')]=0x0;_0x3ddbde[_0x68af('0x38')]=0x0;_0x3ddbde[_0x68af('0x39')]=0x0;if(!_0x3ddbde[_0x68af('0x3a')]&&!_0x3ddbde[_0x68af('0x3b')]){_0x3ddbde['waiting']+=0x1;}if(!_0x3ddbde[_0x68af('0x3a')]&&_0x3ddbde[_0x68af('0x3b')]){_0x3ddbde[_0x68af('0x3c')]+=0x1;if(_0x3ddbde[_0x68af('0x36')]){_0x3ddbde[_0x68af('0x36')]-=0x1;}}if(_0x3ddbde[_0x68af('0x3a')]&&_0x3ddbde[_0x68af('0x3b')]){_0x3ddbde[_0x68af('0x37')]+=0x1;if(_0x3ddbde[_0x68af('0x3c')]){_0x3ddbde[_0x68af('0x3c')]-=0x1;}}if(_0x3ddbde['closed']&&!_0x3ddbde[_0x68af('0x3b')]){_0x3ddbde[_0x68af('0x38')]+=0x1;if(_0x3ddbde['waiting']){_0x3ddbde[_0x68af('0x36')]-=0x1;}}_0x3ddbde[_0x68af('0x39')]+=0x1;_0x369bc2(_0x3ddbde);});}exports[_0x68af('0x3d')]=function(_0x47292c,_0x28fdf8){var _0x55013f={},_0x509177={},_0x5a674d={'count':0x0,'rows':[]};var _0x2777f0=_[_0x68af('0x30')](db['WhatsappInteraction'][_0x68af('0x3e')],function(_0x7e1a4d){return{'name':_0x7e1a4d[_0x68af('0x3f')],'type':_0x7e1a4d[_0x68af('0x40')]['key']};});_0x509177[_0x68af('0x41')]=_[_0x68af('0x30')](_0x2777f0,_0x68af('0x2e'));_0x509177[_0x68af('0x42')]=_[_0x68af('0x43')](_0x47292c[_0x68af('0x42')]);_0x509177[_0x68af('0x44')]=_[_0x68af('0x45')](_0x509177[_0x68af('0x41')],_0x509177[_0x68af('0x42')]);_0x55013f['attributes']=_['intersection'](_0x509177[_0x68af('0x41')],qs[_0x68af('0x46')](_0x47292c[_0x68af('0x42')][_0x68af('0x46')]));_0x55013f[_0x68af('0x47')]=_0x55013f['attributes'][_0x68af('0x48')]?_0x55013f[_0x68af('0x47')]:_0x509177[_0x68af('0x41')];if(!_0x47292c['query'][_0x68af('0x49')](_0x68af('0x4a'))){_0x55013f[_0x68af('0x22')]=qs[_0x68af('0x22')](_0x47292c[_0x68af('0x42')][_0x68af('0x22')]);_0x55013f[_0x68af('0x20')]=qs['offset'](_0x47292c[_0x68af('0x42')][_0x68af('0x20')]);}_0x55013f[_0x68af('0x4b')]=qs[_0x68af('0x4c')](_0x47292c['query'][_0x68af('0x4c')]);_0x55013f[_0x68af('0x4d')]=qs['filters'](_[_0x68af('0x4e')](_0x47292c['query'],_0x509177[_0x68af('0x44')]),_0x2777f0);var _0x5bab92=[];var _0xbec158=squel[_0x68af('0x4f')]()[_0x68af('0x50')]('id')[_0x68af('0x50')](_0x68af('0x2e'))[_0x68af('0x50')](_0x68af('0x51'))[_0x68af('0x52')](_0x68af('0x53'));var _0x303c21=squel[_0x68af('0x4f')]()[_0x68af('0x50')]('u.id')[_0x68af('0x50')](_0x68af('0x54'))['field'](_0x68af('0x55'))[_0x68af('0x52')](_0x68af('0x56'),'ui')['left_join'](_0x68af('0x57'),'u',_0x68af('0x58'));var _0x641c67=squel[_0x68af('0x4f')]()[_0x68af('0x52')]('whatsapp_interactions','i')[_0x68af('0x59')](_0x68af('0x5a'),'c',_0x68af('0x5b'))[_0x68af('0x59')](_0x68af('0x57'),'o',_0x68af('0x5c'))[_0x68af('0x59')](_0x68af('0x5d'),'a',_0x68af('0x5e'))[_0x68af('0x59')]('whatsapp_messages','me',_0x68af('0x5f'))[_0x68af('0x59')](_0x68af('0x60'),'it',_0x68af('0x61'))[_0x68af('0x59')](_0x68af('0x53'),'t','t.id\x20=\x20it.TagId');var _0x5ca2ae=squel[_0x68af('0x62')]();var _0x5550cd=[];var _0x50424a=squel[_0x68af('0x62')]();var _0xdb98a2;if(_0x47292c[_0x68af('0x42')][_0x68af('0x63')]){_0xdb98a2=as[_0x68af('0x64')](_0x47292c[_0x68af('0x42')][_0x68af('0x63')]);var _0x53e6ea=_0xdb98a2[_0x68af('0x65')];for(var _0x1b236f=0x0;_0x1b236f<_0xdb98a2[_0x68af('0x66')][_0x68af('0x48')];_0x1b236f++){var _0x75884a=_0xdb98a2[_0x68af('0x66')][_0x1b236f];var _0x24198e='i';var _0x3c284f=_[_0x68af('0x67')](_0x2777f0,['name',_0x75884a[_0x68af('0x50')]]);if(!_0x3c284f){switch(_0x75884a[_0x68af('0x50')]){case _0x68af('0x68'):if(_0x75884a[_0x68af('0x69')]==0x1){_0x641c67[_0x68af('0x6a')]('`'+_0x75884a[_0x68af('0x50')]+'`\x20=\x200');}else{_0x641c67[_0x68af('0x6a')]('`'+_0x75884a['field']+_0x68af('0x6b'));}break;case'Contact':if(_0x75884a['operator']==='$substring'){if(_0x75884a[_0x68af('0x69')]['split']('\x20')[_0x68af('0x48')]>0x1){_0x5ca2ae[_0x53e6ea](_0x68af('0x6c'),qs[_0x68af('0x6d')](_0x75884a[_0x68af('0x69')]),null);}else{var _0x4178ca='%'+_0x75884a[_0x68af('0x69')]+'%';_0x5ca2ae[_0x53e6ea](_0x68af('0x6e'),_0x4178ca,_0x4178ca,_0x4178ca);}}else{_0x3c284f=_['find'](_0x2777f0,[_0x68af('0x2e'),'ContactId']);_0x75884a[_0x68af('0x50')]=_0x68af('0x6f');_0x2f7a3a=as[_0x68af('0x70')](_0x24198e,_0x3c284f['type'],_0x75884a);_0x5ca2ae[_0x53e6ea](_0x2f7a3a[_0x68af('0x71')],_0x2f7a3a[_0x68af('0x69')][_0x68af('0x72')],_0x2f7a3a[_0x68af('0x69')]['end']);}break;case _0x68af('0x73'):var _0x5f4c4d=_0x75884a[_0x68af('0x69')]['split'](',')[_0x68af('0x30')](function(_0x21a530){return Number(_0x21a530);});_0x5f4c4d[_0x68af('0x74')](function(_0x4deb3e){_0x50424a['or'](_0x68af('0x75'),'%,'+_0x4deb3e+',%');});_0x5550cd=_[_0x68af('0x76')](_0x5550cd,_0x5f4c4d);break;case _0x68af('0x77'):if(_0x75884a[_0x68af('0x78')]==='$substring'){_0x5ca2ae[_0x53e6ea](_0x68af('0x79'),'%'+_0x75884a['value']+'%',null);}else{_0x3c284f=_[_0x68af('0x67')](_0x2777f0,['name','UserId']);_0x75884a[_0x68af('0x50')]='UserId';_0x2f7a3a=as[_0x68af('0x70')](_0x24198e,_0x3c284f['type'],_0x75884a);_0x5ca2ae[_0x53e6ea](_0x2f7a3a[_0x68af('0x71')],_0x2f7a3a[_0x68af('0x69')]['start'],_0x2f7a3a[_0x68af('0x69')][_0x68af('0x2c')]);}break;case'body':_0x2f7a3a=as[_0x68af('0x70')]('me',null,_0x75884a);_0x5ca2ae[_0x53e6ea](_0x2f7a3a[_0x68af('0x71')],_0x2f7a3a[_0x68af('0x69')][_0x68af('0x72')],_0x2f7a3a[_0x68af('0x69')]['end']);break;}}else{var _0x2f7a3a=as[_0x68af('0x70')](_0x24198e,_0x3c284f[_0x68af('0x40')],_0x75884a);_0x5ca2ae[_0x53e6ea](_0x2f7a3a[_0x68af('0x71')],_0x2f7a3a[_0x68af('0x69')][_0x68af('0x72')],_0x2f7a3a[_0x68af('0x69')][_0x68af('0x2c')]);}}}else{var _0x2d814a=_(_0x47292c['query'])[_0x68af('0x43')]()['map'](function(_0x1605d9){return _[_0x68af('0x7a')](_0x2777f0,[_0x68af('0x2e'),_0x1605d9])?_0x1605d9:undefined;})['compact']()[_0x68af('0x69')]();if(!_[_0x68af('0x7b')](_0x2d814a)){_0x2d814a['forEach'](function(_0x3fbc00){if(_0x3fbc00===_0x68af('0x7c')){_0x641c67[_0x68af('0x4d')](_0x68af('0x7d'),[]['concat'](_0x47292c[_0x68af('0x42')][_0x3fbc00]));}else if(_0x3fbc00===_0x68af('0x7e')){var _0x1acb3e=JSON[_0x68af('0x7f')](_0x47292c['query'][_0x3fbc00])['$gte'];var _0x1d12eb=JSON[_0x68af('0x7f')](_0x47292c['query'][_0x3fbc00])[_0x68af('0x80')];_0x641c67[_0x68af('0x4d')](_0x68af('0x81'),_0x1acb3e,_0x1d12eb);}else{if(_0x47292c[_0x68af('0x42')][_0x3fbc00]===_0x68af('0x82')){_0x641c67['where']('i.'+_0x3fbc00+_0x68af('0x83'));}else{_0x641c67[_0x68af('0x4d')]('i.'+_0x3fbc00+_0x68af('0x84'),_0x47292c['query'][_0x3fbc00]);}}});}if(_0x47292c[_0x68af('0x42')][_0x68af('0x85')]){if(_0x47292c['query']['read']==0x1){_0x641c67[_0x68af('0x6a')](_0x68af('0x86'));}else{_0x641c67[_0x68af('0x6a')](_0x68af('0x87'));}}if(_0x47292c['query'][_0x68af('0x88')]){_0x5550cd=_['isArray'](_0x47292c['query']['tag'])?_0x47292c[_0x68af('0x42')]['tag']:new Array(_0x47292c['query'][_0x68af('0x88')]);_0x5550cd[_0x68af('0x74')](function(_0xbe5aee){_0x50424a['or'](_0x68af('0x75'),'%,'+_0xbe5aee+',%');});}if(_0x47292c[_0x68af('0x42')][_0x68af('0x89')]){var _0x365f8c=_0x47292c['query'][_0x68af('0x89')][_0x68af('0x8a')]('\x5c','\x5c\x5c')[_0x68af('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x365f8c)){_0x5ca2ae['or'](_0x68af('0x8b'),_0x365f8c+'%')['or']('i.phone\x20LIKE\x20?',_0x365f8c+'%');}else{_0x5ca2ae['or'](_0x68af('0x8c'),qs[_0x68af('0x6d')](_0x365f8c))['or'](_0x68af('0x8d'),_0x365f8c+'%');}}}_0x641c67[_0x68af('0x4d')](_0x5ca2ae);_0x641c67[_0x68af('0x8e')](_0x68af('0x8f'));var _0x379960={'type':db[_0x68af('0x90')][_0x68af('0x91')][_0x68af('0x92')],'raw':!![]};var _0x3e8660=_0x641c67[_0x68af('0x93')]();_0x3e8660[_0x68af('0x50')]('i.id');_0x3e8660[_0x68af('0x50')](_0x68af('0x94'),'unreadMessages');if(_0x55013f[_0x68af('0x4b')]){_0x55013f[_0x68af('0x4b')][_0x68af('0x74')](function(_0x469711){var _0x3c9ed4=_0x469711[0x0]===_0x68af('0x95')?_0x469711[0x0]:'i.'+_0x469711[0x0];_0x641c67['order'](_0x3c9ed4,_0x469711[0x1]===_0x68af('0x96')?![]:!![]);});}if(!_[_0x68af('0x7b')](_0x5550cd)){_0x641c67[_0x68af('0x6a')](_0x50424a);_0x3e8660['where']('t.id\x20IN\x20?',_0x5550cd);}BPromise[_0x68af('0x97')]()[_0x68af('0x2b')](function(){if(!_0xdb98a2){if(_0x47292c[_0x68af('0x42')]['WhatsappAccountId'])return;_0x3e8660[_0x68af('0x4d')](_0x68af('0x98'));_0x641c67[_0x68af('0x4d')](_0x68af('0x98'));return;}if(_0x47292c['user'][_0x68af('0x99')]!==_0x68af('0x9a'))return;return _0x47292c[_0x68af('0x9b')][_0x68af('0x9c')]({'attributes':['id'],'raw':!![]})[_0x68af('0x2b')](function(_0x4d2fca){if(_[_0x68af('0x7b')](_0x4d2fca)){_0x3e8660[_0x68af('0x4d')](_0x68af('0x9d'));_0x641c67['where'](_0x68af('0x9d'));}else{_0x3e8660[_0x68af('0x4d')](_0x68af('0x7d'),_[_0x68af('0x30')](_0x4d2fca,'id'));_0x641c67[_0x68af('0x4d')](_0x68af('0x7d'),_['map'](_0x4d2fca,'id'));}});})[_0x68af('0x2b')](function(){if(_0x47292c[_0x68af('0x9b')][_0x68af('0x99')]==='agent'&&!_0xdb98a2&&!_0x47292c['query'][_0x68af('0x7c')])return[];return db[_0x68af('0x9e')][_0x68af('0x42')](_0x3e8660[_0x68af('0x9f')](),_0x379960);})['then'](function(_0x3f7011){_0x5a674d[_0x68af('0x23')]=_0x3f7011['length'];if(_0x5a674d['count']===0x0)return[];return db[_0x68af('0x9e')][_0x68af('0x42')](_0xbec158['toString'](),_0x379960)[_0x68af('0x2b')](function(_0x22842d){_0x5bab92=_[_0x68af('0xa0')](_0x22842d,'id');_0x379960=_[_0x68af('0xa1')](_0x379960,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47292c[_0x68af('0x42')][_0x68af('0x46')]){_0x55013f['attributes']['forEach'](function(_0x71cd13){_0x641c67[_0x68af('0x50')]('i.'+_0x71cd13);});}else{_0x641c67['field'](_0x68af('0x94'),'unreadMessages');_0x641c67[_0x68af('0x50')]('a.key','Account.key');_0x641c67['field'](_0x68af('0xa2'),_0x68af('0xa3'));_0x641c67[_0x68af('0x50')](_0x68af('0xa4'),_0x68af('0x95'));_0x641c67['field'](_0x68af('0xa5'));_0x641c67[_0x68af('0x50')]('c.firstName',_0x68af('0xa6'));_0x641c67[_0x68af('0x50')]('c.lastName',_0x68af('0xa7'));_0x641c67[_0x68af('0x50')](_0x68af('0xa8'),_0x68af('0xa9'));_0x641c67['field'](_0x68af('0xaa'),_0x68af('0xab'));_0x641c67[_0x68af('0x50')]('c.mobile',_0x68af('0xac'));_0x641c67[_0x68af('0x50')](_0x68af('0xad'),_0x68af('0xae'));_0x641c67[_0x68af('0x50')](_0x68af('0xaf'),_0x68af('0xb0'));_0x641c67['field'](_0x68af('0xb1'),'Owner.internal');_0x641c67[_0x68af('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x68af('0x32'));}if(_0x55013f[_0x68af('0x22')])_0x641c67[_0x68af('0x22')](_0x55013f[_0x68af('0x22')]);if(_0x55013f[_0x68af('0x20')])_0x641c67[_0x68af('0x20')](_0x55013f[_0x68af('0x20')]);return db[_0x68af('0x9e')][_0x68af('0x42')](_0x641c67[_0x68af('0x9f')](),_0x379960);})['then'](function(_0x3afa1e){if(_0x3afa1e['length']>0x0)_0x303c21[_0x68af('0x4d')](_0x68af('0xb2'),_[_0x68af('0x30')](_0x3afa1e,'id'));return db['sequelize'][_0x68af('0x42')](_0x303c21['toString'](),_0x379960)['then'](function(_0x132812){var _0x2357c8=_[_0x68af('0xb3')](_0x132812,'WhatsappInteractionId');var _0x1e798a=[];_0x3afa1e['forEach'](function(_0x17af6b){_0x1e798a[_0x68af('0xb4')](updateWhatsappInteraction(_0x17af6b,_0x5bab92,_0x2357c8));});return BPromise[_0x68af('0xb5')](_0x1e798a);});});})[_0x68af('0x2b')](function(_0x35959c){_0x5a674d[_0x68af('0xb6')]=_0x35959c;return _0x5a674d;})['then'](respondWithFilteredResult(_0x28fdf8,_0x55013f))['catch'](handleError(_0x28fdf8,null));};exports[_0x68af('0xb7')]=function(_0x3dbea6,_0x3a68d8){var _0x2a2fd0={'raw':![],'where':{'id':_0x3dbea6[_0x68af('0xb8')]['id']}},_0xc8061c={};_0xc8061c['model']=_['keys'](db[_0x68af('0xb9')][_0x68af('0x3e')]);_0xc8061c[_0x68af('0x42')]=_[_0x68af('0x43')](_0x3dbea6['query']);_0xc8061c['filters']=_[_0x68af('0x45')](_0xc8061c[_0x68af('0x41')],_0xc8061c[_0x68af('0x42')]);_0x2a2fd0[_0x68af('0x47')]=_[_0x68af('0x45')](_0xc8061c['model'],qs[_0x68af('0x46')](_0x3dbea6[_0x68af('0x42')][_0x68af('0x46')]));_0x2a2fd0['attributes']=_0x2a2fd0[_0x68af('0x47')]['length']?_0x2a2fd0[_0x68af('0x47')]:_0xc8061c[_0x68af('0x41')];if(_0x3dbea6[_0x68af('0x42')][_0x68af('0xba')]){_0x2a2fd0['include']=[{'all':!![]}];}_0x2a2fd0=_[_0x68af('0xa1')]({},_0x2a2fd0,_0x3dbea6[_0x68af('0xbb')]);return db[_0x68af('0xb9')][_0x68af('0x67')](_0x2a2fd0)[_0x68af('0x2b')](handleEntityNotFound(_0x3a68d8,null))[_0x68af('0x2b')](respondWithResult(_0x3a68d8,null))[_0x68af('0x35')](handleError(_0x3a68d8,null));};exports['create']=function(_0x1e84c7,_0x3c3f5b){return db['WhatsappInteraction'][_0x68af('0xbc')](_0x1e84c7[_0x68af('0xbd')],{})[_0x68af('0x2b')](respondWithResult(_0x3c3f5b,0xc9))['catch'](handleError(_0x3c3f5b,null));};exports[_0x68af('0x29')]=function(_0x1731a9,_0x276de3){if(_0x1731a9[_0x68af('0xbd')]['id']){delete _0x1731a9[_0x68af('0xbd')]['id'];}return db[_0x68af('0xb9')]['find']({'where':{'id':_0x1731a9['params']['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x276de3,null))[_0x68af('0x2b')](saveUpdates(_0x1731a9['body'],null))[_0x68af('0x2b')](respondWithResult(_0x276de3,null))[_0x68af('0x35')](handleError(_0x276de3,null));};exports['destroy']=function(_0x2e519e,_0x529399){return db[_0x68af('0xb9')][_0x68af('0x67')]({'where':{'id':_0x2e519e[_0x68af('0xb8')]['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x529399,null))[_0x68af('0x2b')](removeEntity(_0x529399,null))[_0x68af('0x35')](handleError(_0x529399,null));};exports[_0x68af('0xbe')]=function(_0x153285,_0x6d8e50){return db[_0x68af('0xb9')][_0x68af('0xbe')]()[_0x68af('0x2b')](respondWithResult(_0x6d8e50,null))[_0x68af('0x35')](handleError(_0x6d8e50,null));};exports['addMessage']=function(_0x2da949,_0x12c932,_0x4c20d7){return db['WhatsappMessage'][_0x68af('0x67')]({'where':{'id':_0x2da949[_0x68af('0xb8')]['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x12c932,null))[_0x68af('0x2b')](function(_0x4b159c){if(_0x4b159c){return _0x4b159c[_0x68af('0xbf')](_0x2da949[_0x68af('0xbd')]['ids'],_['omit'](_0x2da949[_0x68af('0xbd')],[_0x68af('0xc0'),'id'])||{});}})[_0x68af('0x2b')](respondWithResult(_0x12c932,null))[_0x68af('0x35')](handleError(_0x12c932,null));};exports[_0x68af('0xc1')]=function(_0x1aad6b,_0x1b4c77,_0x292744){var _0x1eb5ad={'raw':![],'where':{}};var _0xf11c52={};var _0x440270={'count':0x0,'rows':[]};return db[_0x68af('0xb9')][_0x68af('0xc2')]({'where':{'id':_0x1aad6b[_0x68af('0xb8')]['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x1b4c77,null))[_0x68af('0x2b')](function(_0x1daee6){if(_0x1daee6){_0xf11c52[_0x68af('0x41')]=_[_0x68af('0x43')](db['WhatsappMessage']['rawAttributes']);_0xf11c52[_0x68af('0x42')]=_[_0x68af('0x43')](_0x1aad6b[_0x68af('0x42')]);_0xf11c52[_0x68af('0x44')]=_['intersection'](_0xf11c52['model'],_0xf11c52[_0x68af('0x42')]);_0x1eb5ad['attributes']=_[_0x68af('0x45')](_0xf11c52['model'],qs[_0x68af('0x46')](_0x1aad6b[_0x68af('0x42')][_0x68af('0x46')]));_0x1eb5ad[_0x68af('0x47')]=_0x1eb5ad[_0x68af('0x47')][_0x68af('0x48')]?_0x1eb5ad[_0x68af('0x47')]:_0xf11c52[_0x68af('0x41')];if(!_0x1aad6b[_0x68af('0x42')][_0x68af('0x49')](_0x68af('0x4a'))){_0x1eb5ad[_0x68af('0x22')]=qs[_0x68af('0x22')](_0x1aad6b[_0x68af('0x42')][_0x68af('0x22')]);_0x1eb5ad[_0x68af('0x20')]=qs[_0x68af('0x20')](_0x1aad6b[_0x68af('0x42')][_0x68af('0x20')]);}_0x1eb5ad[_0x68af('0x4b')]=qs[_0x68af('0x4c')](_0x1aad6b[_0x68af('0x42')][_0x68af('0x4c')]);_0x1eb5ad[_0x68af('0x4d')]=qs['filters'](_[_0x68af('0x4e')](_0x1aad6b[_0x68af('0x42')],_0xf11c52[_0x68af('0x44')]));_0x1eb5ad[_0x68af('0x4d')][_0x68af('0xc3')]=_0x1daee6['id'];if(_0x1aad6b[_0x68af('0x42')]['filter']){_0x1eb5ad[_0x68af('0x4d')]=_[_0x68af('0xa1')](_0x1eb5ad[_0x68af('0x4d')],{'$or':_[_0x68af('0x30')](_0x1eb5ad['attributes'],function(_0x529654){var _0x52b195={};_0x52b195[_0x529654]={'$like':'%'+_0x1aad6b[_0x68af('0x42')][_0x68af('0x89')]+'%'};return _0x52b195;})});}if(_0x1aad6b[_0x68af('0x42')][_0x68af('0xc4')]){var _0x2635fa=_0x1aad6b[_0x68af('0x42')][_0x68af('0xc4')][_0x68af('0x33')](',');var _0x1f8a69={};_0x1f8a69[_0x2635fa[0x0]]={'$gte':moment(_0x2635fa[0x1])[_0x68af('0xc5')](_0x68af('0xc6'))};_0x1eb5ad[_0x68af('0x4d')]=_[_0x68af('0xa1')](_0x1eb5ad[_0x68af('0x4d')],_0x1f8a69);}_0x1eb5ad=_[_0x68af('0xa1')]({},_0x1eb5ad,_0x1aad6b[_0x68af('0xbb')]);return db[_0x68af('0xc7')][_0x68af('0x23')]({'where':_0x1eb5ad['where']})[_0x68af('0x2b')](function(_0x133308){_0x440270[_0x68af('0x23')]=_0x133308;if(_0x1aad6b[_0x68af('0x42')]['includeAll']){_0x1eb5ad[_0x68af('0xc8')]=[{'all':!![]}];}return db[_0x68af('0xc7')][_0x68af('0xc9')](_0x1eb5ad);})[_0x68af('0x2b')](function(_0x270286){_0x440270[_0x68af('0xb6')]=_0x270286;return _0x440270;});}})[_0x68af('0x2b')](respondWithFilteredResult(_0x1b4c77,_0x1eb5ad))[_0x68af('0x35')](handleError(_0x1b4c77,null));};exports[_0x68af('0xca')]=function(_0x2c91e4,_0x8be577,_0x43e231){return db[_0x68af('0xb9')][_0x68af('0x67')]({'where':{'id':_0x2c91e4[_0x68af('0xb8')]['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x8be577,null))[_0x68af('0x2b')](function(_0x54d3fc){if(_0x54d3fc){return _0x54d3fc[_0x68af('0xcb')](_0x2c91e4[_0x68af('0xbd')][_0x68af('0xc0')],_[_0x68af('0xcc')](_0x2c91e4[_0x68af('0xbd')],['ids','id'])||{})[_0x68af('0xcd')](function(){return db[_0x68af('0x73')][_0x68af('0xc9')]({'attributes':['id','name',_0x68af('0x51')],'where':{'id':_0x2c91e4[_0x68af('0xbd')][_0x68af('0xc0')]}});})[_0x68af('0x2b')](function(_0x5dbad8){socket['emit'](_0x68af('0xce'),{'id':Number(_0x2c91e4[_0x68af('0xb8')]['id']),'tags':_0x5dbad8||[]});return{'id':Number(_0x2c91e4[_0x68af('0xb8')]['id']),'tags':_0x5dbad8||[]};});}})[_0x68af('0x2b')](respondWithResult(_0x8be577,null))['catch'](handleError(_0x8be577,null));};exports[_0x68af('0xcf')]=function(_0x577c72,_0x1eb394,_0x375ed8){return db[_0x68af('0xb9')]['find']({'where':{'id':_0x577c72[_0x68af('0xb8')]['id']}})[_0x68af('0x2b')](handleEntityNotFound(_0x1eb394,null))[_0x68af('0x2b')](function(_0x2a33f0){if(_0x2a33f0){return _0x2a33f0[_0x68af('0xcf')](_0x577c72[_0x68af('0x42')]['ids']);}})[_0x68af('0x2b')](respondWithStatusCode(_0x1eb394,null))[_0x68af('0x35')](handleError(_0x1eb394,null));};exports['download']=function(_0x5d587b,_0x40fe79){var _0x489e15=moment()[_0x68af('0xd0')]()[_0x68af('0x9f')]();var _0x6204f5=path[_0x68af('0xd1')](config[_0x68af('0xd2')],_0x68af('0xd3'),_0x68af('0xd4'),_0x68af('0xd5'));var _0x79865b=path['join'](config[_0x68af('0xd2')],_0x68af('0xd3'),_0x68af('0xd4'),_0x68af('0xd6'));var _0x5cc6fb=path['join'](_0x6204f5,_0x489e15);var _0x576f78=util['format'](_0x68af('0xd7'),_0x5d587b[_0x68af('0xb8')]['id'],_0x489e15);var _0x30927a=path[_0x68af('0xd1')](_0x6204f5,_0x576f78);var _0x4d9b5a=[];_0x4d9b5a[_0x68af('0xb4')]({'model':db[_0x68af('0x77')],'as':_0x68af('0x77'),'attributes':['id',_0x68af('0x31')],'raw':!![]});_0x4d9b5a[_0x68af('0xb4')]({'model':db[_0x68af('0xd8')],'as':_0x68af('0xd9'),'attributes':['id',_0x68af('0xda'),_0x68af('0xdb')],'raw':!![]});if(_0x5d587b['query'][_0x68af('0xd6')]){_0x4d9b5a[_0x68af('0xb4')]({'model':db[_0x68af('0xdc')],'as':_0x68af('0xdc'),'raw':!![]});}var _0x4e443a=[{'model':db[_0x68af('0xc7')],'as':_0x68af('0xdd'),'attributes':['id',_0x68af('0xbd'),_0x68af('0x7e'),'direction',_0x68af('0xde'),_0x68af('0x85')],'include':_0x4d9b5a}];_0x4e443a['push']({'model':db['WhatsappAccount'],'as':_0x68af('0xdf'),'attributes':['id',_0x68af('0x2e')]});_0x4e443a['push']({'model':db['User'],'as':_0x68af('0xe0'),'attributes':['id',_0x68af('0x31')]});return db[_0x68af('0xb9')][_0x68af('0x67')]({'where':{'id':_0x5d587b[_0x68af('0xb8')]['id']},'include':_0x4e443a})['then'](handleEntityNotFound(_0x40fe79,null))['then'](function(_0x5db3c5){if(_0x5db3c5){var _0x34a11e=_0x5db3c5[_0x68af('0xe1')]({'plain':!![]});fs[_0x68af('0xe2')](_0x5cc6fb);var _0x19a162={'channel':_0x68af('0xe3'),'account':_0x34a11e[_0x68af('0xdf')]['name'],'agent':_0x34a11e[_0x68af('0xe0')]?_0x34a11e['Owner'][_0x68af('0x31')]:_0x68af('0xe4'),'createdAt':moment(_0x34a11e[_0x68af('0x7e')])[_0x68af('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x68af('0x9f')](),'closedAt':_0x34a11e[_0x68af('0x3a')]?moment(_0x34a11e[_0x68af('0xe5')])[_0x68af('0xc5')](_0x68af('0xc6'))['toString']():'','disposition':_0x34a11e[_0x68af('0xe6')],'messages':_(_0x34a11e[_0x68af('0xdd')])[_0x68af('0x89')]({'secret':![]})[_0x68af('0x30')](function(_0x2f6d36){if(_0x2f6d36['Attachment']){var _0x4dee7c=path[_0x68af('0xd1')](_0x79865b,_0x2f6d36[_0x68af('0xdc')][_0x68af('0xe7')]);if(fs[_0x68af('0xe8')](_0x4dee7c)){fs[_0x68af('0xe9')](_0x4dee7c)['pipe'](fs[_0x68af('0xea')](path[_0x68af('0xd1')](_0x5cc6fb,_0x2f6d36[_0x68af('0xdc')][_0x68af('0xe7')])));}}return{'date':moment(_0x2f6d36[_0x68af('0x7e')])[_0x68af('0xc5')](_0x68af('0xc6'))[_0x68af('0x9f')](),'sender':_0x2f6d36['direction']===_0x68af('0xeb')?_0x2f6d36[_0x68af('0x77')]?_0x2f6d36['User'][_0x68af('0x31')]:_0x68af('0xec'):_0x2f6d36['Contact'][_0x68af('0xda')]+(_0x2f6d36[_0x68af('0xd9')][_0x68af('0xdb')]?'\x20'+_0x2f6d36[_0x68af('0xd9')][_0x68af('0xdb')]:''),'body':_0x2f6d36[_0x68af('0xdc')]?_0x2f6d36[_0x68af('0xdc')][_0x68af('0xe7')]:_0x2f6d36[_0x68af('0xbd')],'direction':_0x2f6d36['direction']===_0x68af('0xeb')?'A':'C','secret':_0x2f6d36[_0x68af('0xde')],'read':_0x2f6d36['read'],'attachment':_0x2f6d36[_0x68af('0xdc')]};})[_0x68af('0x69')]()};return ejs['renderFile'](path['join'](config['root'],_0x68af('0xd3'),_0x68af('0xed'),_0x68af('0xee')),{'interaction':_0x19a162})['then'](function(_0x181f7e){var _0x2e29be=path[_0x68af('0xd1')](_0x5cc6fb,_0x68af('0xef')+_0x34a11e['id']+'-'+_0x489e15+_0x68af('0xf0'));var _0x199b69={'path':_0x2e29be,'channel':_0x68af('0xe3'),'interactionId':_0x34a11e['id']};return pdf[_0x68af('0xf1')](_0x181f7e,_0x199b69);})[_0x68af('0x2b')](function(){return new BPromise(function(_0x291bac,_0x566c75){zipdir(_0x5cc6fb,{'saveTo':_0x30927a},function(_0x303c51,_0x47c4b4){if(_0x303c51)return _0x566c75(_0x303c51);return _0x291bac(_0x47c4b4);});})['then'](function(){return new BPromise(function(_0x2b9b6d,_0x5178cb){rimraf(_0x5cc6fb,function(_0x227e56){if(_0x227e56)_0x5178cb(_0x227e56);return _0x2b9b6d();});});})[_0x68af('0x2b')](function(){return _0x40fe79[_0x68af('0xf2')](_0x30927a,_0x576f78,function(_0x367b55){if(_0x367b55){console[_0x68af('0xf3')](_0x68af('0xf4'),_0x367b55);}else{fs[_0x68af('0xf5')](_0x30927a);}});});});}else{return _0x40fe79[_0x68af('0x1e')](0xc8);}})[_0x68af('0x35')](handleError(_0x40fe79,null));}; \ No newline at end of file +var _0xffb1=['whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','catch','show','params','includeAll','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','format','include','findAll','setTags','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','fullname','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','views','transcript-','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','set','json','apply','update','then','destroy','end','error','name','send','map','TagIds','split','forEach','Tags','push','talking','answered','unmanaged','total','closed','UserId','waiting','index','WhatsappInteraction','rawAttributes','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId'];(function(_0x130abf,_0x12dc07){var _0x20e1dc=function(_0x36378f){while(--_0x36378f){_0x130abf['push'](_0x130abf['shift']());}};_0x20e1dc(++_0x12dc07);}(_0xffb1,0x93));var _0x1ffb=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xffb1[_0x2f57b2];return _0x5ace77;};'use strict';var emlformat=require(_0x1ffb('0x0'));var rimraf=require(_0x1ffb('0x1'));var zipdir=require(_0x1ffb('0x2'));var jsonpatch=require(_0x1ffb('0x3'));var rp=require(_0x1ffb('0x4'));var moment=require(_0x1ffb('0x5'));var BPromise=require(_0x1ffb('0x6'));var Mustache=require(_0x1ffb('0x7'));var util=require(_0x1ffb('0x8'));var path=require(_0x1ffb('0x9'));var sox=require('sox');var csv=require(_0x1ffb('0xa'));var ejs=require(_0x1ffb('0xb'));var fs=require('fs');var fs_extra=require(_0x1ffb('0xc'));var _=require(_0x1ffb('0xd'));var squel=require(_0x1ffb('0xe'));var crypto=require('crypto');var jsforce=require(_0x1ffb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ffb('0x10'));var Papa=require(_0x1ffb('0x11'));var Redis=require(_0x1ffb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ffb('0x13'));var pdf=require(_0x1ffb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ffb('0x15'))('api');var utils=require(_0x1ffb('0x16'));var config=require(_0x1ffb('0x17'));var licenseUtil=require(_0x1ffb('0x18'));var db=require(_0x1ffb('0x19'))['db'];config[_0x1ffb('0x1a')]=_[_0x1ffb('0x1b')](config['redis'],{'host':_0x1ffb('0x1c'),'port':0x18eb});var socket=require(_0x1ffb('0x1d'))(new Redis(config[_0x1ffb('0x1a')]));require('./whatsappInteraction.socket')[_0x1ffb('0x1e')](socket);function respondWithStatusCode(_0x5d1fba,_0x4c9431){_0x4c9431=_0x4c9431||0xcc;return function(_0x4b2001){if(_0x4b2001){return _0x5d1fba[_0x1ffb('0x1f')](_0x4c9431);}return _0x5d1fba[_0x1ffb('0x20')](_0x4c9431)['end']();};}function respondWithResult(_0x3e0681,_0xf343b5){_0xf343b5=_0xf343b5||0xc8;return function(_0x1a1f21){if(_0x1a1f21){return _0x3e0681[_0x1ffb('0x20')](_0xf343b5)['json'](_0x1a1f21);}};}function respondWithFilteredResult(_0x112a1f,_0x4a2d6c){return function(_0xd004f){if(_0xd004f){var _0x239bbf=typeof _0x4a2d6c[_0x1ffb('0x21')]===_0x1ffb('0x22')&&typeof _0x4a2d6c[_0x1ffb('0x23')]==='undefined';var _0x3794f9=_0xd004f['count'];var _0x30e2fd=_0x239bbf?0x0:_0x4a2d6c[_0x1ffb('0x21')];var _0x34dede=_0x239bbf?_0xd004f['count']:_0x4a2d6c[_0x1ffb('0x21')]+_0x4a2d6c['limit'];var _0x3d7514;if(_0x34dede>=_0x3794f9){_0x34dede=_0x3794f9;_0x3d7514=0xc8;}else{_0x3d7514=0xce;}_0x112a1f['status'](_0x3d7514);return _0x112a1f[_0x1ffb('0x24')]('Content-Range',_0x30e2fd+'-'+_0x34dede+'/'+_0x3794f9)[_0x1ffb('0x25')](_0xd004f);}return null;};}function patchUpdates(_0x5ac526){return function(_0x42a515){try{jsonpatch[_0x1ffb('0x26')](_0x42a515,_0x5ac526,!![]);}catch(_0x530203){return BPromise['reject'](_0x530203);}return _0x42a515['save']();};}function saveUpdates(_0x16e288,_0x4c9380){return function(_0x5a44bf){if(_0x5a44bf){return _0x5a44bf[_0x1ffb('0x27')](_0x16e288)[_0x1ffb('0x28')](function(_0x5b7ff5){return _0x5b7ff5;});}return null;};}function removeEntity(_0x142ae0,_0x4298fd){return function(_0x10b8ea){if(_0x10b8ea){return _0x10b8ea[_0x1ffb('0x29')]()[_0x1ffb('0x28')](function(){_0x142ae0[_0x1ffb('0x20')](0xcc)[_0x1ffb('0x2a')]();});}};}function handleEntityNotFound(_0x55d07b,_0x634d91){return function(_0x15d636){if(!_0x15d636){_0x55d07b[_0x1ffb('0x1f')](0x194);}return _0x15d636;};}function handleError(_0x4dfa4b,_0x2c68fc){_0x2c68fc=_0x2c68fc||0x1f4;return function(_0x471eaf){logger[_0x1ffb('0x2b')](_0x471eaf['stack']);if(_0x471eaf[_0x1ffb('0x2c')]){delete _0x471eaf[_0x1ffb('0x2c')];}_0x4dfa4b[_0x1ffb('0x20')](_0x2c68fc)[_0x1ffb('0x2d')](_0x471eaf);};}function getInteractionUsers(_0x12e31f,_0x95e337){return new BPromise(function(_0x3f2d64,_0x27bcef){try{if(_0x95e337[_0x12e31f['id']]){_0x12e31f['Users']=_[_0x1ffb('0x2e')](_0x95e337[_0x12e31f['id']],function(_0x3c2c89){return{'id':_0x3c2c89['id'],'fullname':_0x3c2c89['fullname']};});}}catch(_0x301b22){_0x27bcef(_0x301b22);}_0x3f2d64(_0x12e31f);});}function getInteractionTags(_0x588bad,_0x57bdef){return new BPromise(function(_0x137cfb,_0x3f8331){try{if(_0x588bad[_0x1ffb('0x2f')]){_0x588bad['Tags']=[];_0x588bad[_0x1ffb('0x2f')][_0x1ffb('0x30')](',')[_0x1ffb('0x31')](function(_0x3d6eda){_0x588bad[_0x1ffb('0x32')][_0x1ffb('0x33')](_0x57bdef[_0x3d6eda]);});}delete _0x588bad[_0x1ffb('0x2f')];}catch(_0x1bd337){_0x3f8331(_0x1bd337);}_0x137cfb(_0x588bad);});}function updateWhatsappInteraction(_0x2c9ed2,_0x58e887,_0x456554){return new BPromise(function(_0x398c3c,_0x1bcd96){return getInteractionUsers(_0x2c9ed2,_0x456554)[_0x1ffb('0x28')](function(_0x2f58b5){return getInteractionTags(_0x2f58b5,_0x58e887);})[_0x1ffb('0x28')](function(_0x17e481){return getStateInteraction(_0x17e481);})[_0x1ffb('0x28')](function(_0x187cbe){_0x398c3c(_0x187cbe);})['catch'](function(_0x28c66d){_0x1bcd96(_0x28c66d);});});}function getStateInteraction(_0x493fff){return new BPromise(function(_0x26f226){_0x493fff['waiting']=0x0;_0x493fff[_0x1ffb('0x34')]=0x0;_0x493fff[_0x1ffb('0x35')]=0x0;_0x493fff[_0x1ffb('0x36')]=0x0;_0x493fff[_0x1ffb('0x37')]=0x0;if(!_0x493fff[_0x1ffb('0x38')]&&!_0x493fff[_0x1ffb('0x39')]){_0x493fff['waiting']+=0x1;}if(!_0x493fff[_0x1ffb('0x38')]&&_0x493fff[_0x1ffb('0x39')]){_0x493fff[_0x1ffb('0x34')]+=0x1;if(_0x493fff[_0x1ffb('0x3a')]){_0x493fff['waiting']-=0x1;}}if(_0x493fff['closed']&&_0x493fff[_0x1ffb('0x39')]){_0x493fff[_0x1ffb('0x35')]+=0x1;if(_0x493fff[_0x1ffb('0x34')]){_0x493fff[_0x1ffb('0x34')]-=0x1;}}if(_0x493fff[_0x1ffb('0x38')]&&!_0x493fff['UserId']){_0x493fff[_0x1ffb('0x36')]+=0x1;if(_0x493fff[_0x1ffb('0x3a')]){_0x493fff[_0x1ffb('0x3a')]-=0x1;}}_0x493fff[_0x1ffb('0x37')]+=0x1;_0x26f226(_0x493fff);});}exports[_0x1ffb('0x3b')]=function(_0x1d3b29,_0xc3805c){var _0x296bac={},_0x35fc15={},_0xfd72d0={'count':0x0,'rows':[]};var _0x487ac9=_[_0x1ffb('0x2e')](db[_0x1ffb('0x3c')][_0x1ffb('0x3d')],function(_0x1bdd86){return{'name':_0x1bdd86['fieldName'],'type':_0x1bdd86[_0x1ffb('0x3e')]['key']};});_0x35fc15['model']=_['map'](_0x487ac9,_0x1ffb('0x2c'));_0x35fc15[_0x1ffb('0x3f')]=_[_0x1ffb('0x40')](_0x1d3b29[_0x1ffb('0x3f')]);_0x35fc15[_0x1ffb('0x41')]=_['intersection'](_0x35fc15['model'],_0x35fc15[_0x1ffb('0x3f')]);_0x296bac[_0x1ffb('0x42')]=_[_0x1ffb('0x43')](_0x35fc15[_0x1ffb('0x44')],qs[_0x1ffb('0x45')](_0x1d3b29['query'][_0x1ffb('0x45')]));_0x296bac[_0x1ffb('0x42')]=_0x296bac['attributes'][_0x1ffb('0x46')]?_0x296bac['attributes']:_0x35fc15[_0x1ffb('0x44')];if(!_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x47')](_0x1ffb('0x48'))){_0x296bac[_0x1ffb('0x23')]=qs['limit'](_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x23')]);_0x296bac[_0x1ffb('0x21')]=qs[_0x1ffb('0x21')](_0x1d3b29['query']['offset']);}_0x296bac[_0x1ffb('0x49')]=qs[_0x1ffb('0x4a')](_0x1d3b29['query']['sort']);_0x296bac[_0x1ffb('0x4b')]=qs['filters'](_[_0x1ffb('0x4c')](_0x1d3b29[_0x1ffb('0x3f')],_0x35fc15[_0x1ffb('0x41')]),_0x487ac9);var _0x36b11a=[];var _0x953c27=squel[_0x1ffb('0x4d')]()[_0x1ffb('0x4e')]('id')['field'](_0x1ffb('0x2c'))[_0x1ffb('0x4e')](_0x1ffb('0x4f'))[_0x1ffb('0x50')]('tools_tags');var _0x1d965b=squel[_0x1ffb('0x4d')]()[_0x1ffb('0x4e')](_0x1ffb('0x51'))[_0x1ffb('0x4e')](_0x1ffb('0x52'))[_0x1ffb('0x4e')](_0x1ffb('0x53'))[_0x1ffb('0x50')](_0x1ffb('0x54'),'ui')[_0x1ffb('0x55')](_0x1ffb('0x56'),'u',_0x1ffb('0x57'));var _0x419563=squel[_0x1ffb('0x4d')]()[_0x1ffb('0x50')](_0x1ffb('0x58'),'i')[_0x1ffb('0x55')]('cm_contacts','c',_0x1ffb('0x59'))['left_join'](_0x1ffb('0x56'),'o','o.id\x20=\x20i.UserId')[_0x1ffb('0x55')](_0x1ffb('0x5a'),'a',_0x1ffb('0x5b'))['left_join']('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0x1ffb('0x55')](_0x1ffb('0x5c'),'it',_0x1ffb('0x5d'))[_0x1ffb('0x55')](_0x1ffb('0x5e'),'t',_0x1ffb('0x5f'));var _0x26f8c9=squel[_0x1ffb('0x60')]();var _0x1163a4=[];var _0x9b2dae=squel['expr']();var _0x2c7d36;if(_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x61')]){_0x2c7d36=as['parseSearch'](_0x1d3b29['query'][_0x1ffb('0x61')]);var _0x442a7b=_0x2c7d36[_0x1ffb('0x62')];for(var _0x553283=0x0;_0x553283<_0x2c7d36[_0x1ffb('0x63')][_0x1ffb('0x46')];_0x553283++){var _0x4b6af5=_0x2c7d36['conditions'][_0x553283];var _0x51a60a='i';var _0x31de85=_['find'](_0x487ac9,['name',_0x4b6af5[_0x1ffb('0x4e')]]);if(!_0x31de85){switch(_0x4b6af5[_0x1ffb('0x4e')]){case _0x1ffb('0x64'):if(_0x4b6af5[_0x1ffb('0x65')]==0x1){_0x419563[_0x1ffb('0x66')]('`'+_0x4b6af5[_0x1ffb('0x4e')]+'`\x20=\x200');}else{_0x419563['having']('`'+_0x4b6af5['field']+_0x1ffb('0x67'));}break;case _0x1ffb('0x68'):if(_0x4b6af5[_0x1ffb('0x69')]==='$substring'){if(_0x4b6af5[_0x1ffb('0x65')]['split']('\x20')['length']>0x1){_0x26f8c9[_0x442a7b](_0x1ffb('0x6a'),qs['getFullTextValue'](_0x4b6af5[_0x1ffb('0x65')]),null);}else{var _0x2fd079='%'+_0x4b6af5[_0x1ffb('0x65')]+'%';_0x26f8c9[_0x442a7b](_0x1ffb('0x6b'),_0x2fd079,_0x2fd079,_0x2fd079);}}else{_0x31de85=_[_0x1ffb('0x6c')](_0x487ac9,['name',_0x1ffb('0x6d')]);_0x4b6af5[_0x1ffb('0x4e')]=_0x1ffb('0x6d');_0x59ec8e=as['buildExpression'](_0x51a60a,_0x31de85[_0x1ffb('0x3e')],_0x4b6af5);_0x26f8c9[_0x442a7b](_0x59ec8e[_0x1ffb('0x6e')],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x6f')],_0x59ec8e['value'][_0x1ffb('0x2a')]);}break;case _0x1ffb('0x70'):var _0x3d54aa=_0x4b6af5['value']['split'](',')[_0x1ffb('0x2e')](function(_0x26622b){return Number(_0x26622b);});_0x3d54aa[_0x1ffb('0x31')](function(_0x12b931){_0x9b2dae['or'](_0x1ffb('0x71'),'%,'+_0x12b931+',%');});_0x1163a4=_[_0x1ffb('0x72')](_0x1163a4,_0x3d54aa);break;case _0x1ffb('0x73'):if(_0x4b6af5['operator']===_0x1ffb('0x74')){_0x26f8c9[_0x442a7b](_0x1ffb('0x75'),'%'+_0x4b6af5[_0x1ffb('0x65')]+'%',null);}else{_0x31de85=_[_0x1ffb('0x6c')](_0x487ac9,[_0x1ffb('0x2c'),_0x1ffb('0x39')]);_0x4b6af5[_0x1ffb('0x4e')]='UserId';_0x59ec8e=as[_0x1ffb('0x76')](_0x51a60a,_0x31de85[_0x1ffb('0x3e')],_0x4b6af5);_0x26f8c9[_0x442a7b](_0x59ec8e[_0x1ffb('0x6e')],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x6f')],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x2a')]);}break;case'body':_0x59ec8e=as[_0x1ffb('0x76')]('me',null,_0x4b6af5);_0x26f8c9[_0x442a7b](_0x59ec8e[_0x1ffb('0x6e')],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x6f')],_0x59ec8e[_0x1ffb('0x65')]['end']);break;}}else{var _0x59ec8e=as[_0x1ffb('0x76')](_0x51a60a,_0x31de85[_0x1ffb('0x3e')],_0x4b6af5);_0x26f8c9[_0x442a7b](_0x59ec8e['text'],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x6f')],_0x59ec8e[_0x1ffb('0x65')][_0x1ffb('0x2a')]);}}}else{var _0x276600=_(_0x1d3b29[_0x1ffb('0x3f')])[_0x1ffb('0x40')]()['map'](function(_0x415a41){return _[_0x1ffb('0x77')](_0x487ac9,[_0x1ffb('0x2c'),_0x415a41])?_0x415a41:undefined;})[_0x1ffb('0x78')]()[_0x1ffb('0x65')]();if(!_[_0x1ffb('0x79')](_0x276600)){_0x276600[_0x1ffb('0x31')](function(_0x78b41){if(_0x78b41===_0x1ffb('0x7a')){_0x419563[_0x1ffb('0x4b')](_0x1ffb('0x7b'),[]['concat'](_0x1d3b29['query'][_0x78b41]));}else if(_0x78b41===_0x1ffb('0x7c')){var _0x351865=JSON['parse'](_0x1d3b29[_0x1ffb('0x3f')][_0x78b41])[_0x1ffb('0x7d')];var _0x14e6c0=JSON['parse'](_0x1d3b29[_0x1ffb('0x3f')][_0x78b41])[_0x1ffb('0x7e')];_0x419563[_0x1ffb('0x4b')](_0x1ffb('0x7f'),_0x351865,_0x14e6c0);}else{if(_0x1d3b29[_0x1ffb('0x3f')][_0x78b41]===_0x1ffb('0x80')){_0x419563['where']('i.'+_0x78b41+_0x1ffb('0x81'));}else{_0x419563[_0x1ffb('0x4b')]('i.'+_0x78b41+'\x20=\x20?',_0x1d3b29['query'][_0x78b41]);}}});}if(_0x1d3b29['query'][_0x1ffb('0x82')]){if(_0x1d3b29['query'][_0x1ffb('0x82')]==0x1){_0x419563[_0x1ffb('0x66')](_0x1ffb('0x83'));}else{_0x419563[_0x1ffb('0x66')](_0x1ffb('0x84'));}}if(_0x1d3b29['query']['tag']){_0x1163a4=_['isArray'](_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x85')])?_0x1d3b29['query']['tag']:new Array(_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x85')]);_0x1163a4[_0x1ffb('0x31')](function(_0x53a4af){_0x9b2dae['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x53a4af+',%');});}if(_0x1d3b29[_0x1ffb('0x3f')]['filter']){var _0x2a73a3=_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x86')][_0x1ffb('0x87')]('\x5c','\x5c\x5c')[_0x1ffb('0x87')](/'/g,'\x27\x27');if(qs[_0x1ffb('0x88')](_0x2a73a3)){_0x26f8c9['or'](_0x1ffb('0x89'),_0x2a73a3+'%')['or'](_0x1ffb('0x8a'),_0x2a73a3+'%');}else{_0x26f8c9['or'](_0x1ffb('0x8b'),qs['getFullTextValue'](_0x2a73a3))['or'](_0x1ffb('0x8c'),_0x2a73a3+'%');}}}_0x419563['where'](_0x26f8c9);_0x419563['group'](_0x1ffb('0x8d'));var _0x1b6311={'type':db[_0x1ffb('0x8e')]['QueryTypes'][_0x1ffb('0x8f')],'raw':!![]};var _0x3b681f=_0x419563[_0x1ffb('0x90')]();_0x3b681f['field'](_0x1ffb('0x8d'));_0x3b681f[_0x1ffb('0x4e')](_0x1ffb('0x91'),_0x1ffb('0x64'));if(_0x296bac[_0x1ffb('0x49')]){_0x296bac[_0x1ffb('0x49')][_0x1ffb('0x31')](function(_0x5757dd){var _0x319532=_0x5757dd[0x0]===_0x1ffb('0x92')?_0x5757dd[0x0]:'i.'+_0x5757dd[0x0];_0x419563[_0x1ffb('0x49')](_0x319532,_0x5757dd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1ffb('0x79')](_0x1163a4)){_0x419563[_0x1ffb('0x66')](_0x9b2dae);_0x3b681f[_0x1ffb('0x4b')]('t.id\x20IN\x20?',_0x1163a4);}BPromise['resolve']()[_0x1ffb('0x28')](function(){if(!_0x2c7d36){if(_0x1d3b29['query'][_0x1ffb('0x7a')])return;_0x3b681f[_0x1ffb('0x4b')](_0x1ffb('0x93'));_0x419563[_0x1ffb('0x4b')](_0x1ffb('0x93'));return;}if(_0x1d3b29[_0x1ffb('0x94')][_0x1ffb('0x95')]!==_0x1ffb('0x96'))return;return _0x1d3b29[_0x1ffb('0x94')][_0x1ffb('0x97')]({'attributes':['id'],'raw':!![]})[_0x1ffb('0x28')](function(_0x45271a){if(_[_0x1ffb('0x79')](_0x45271a)){_0x3b681f[_0x1ffb('0x4b')](_0x1ffb('0x98'));_0x419563['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3b681f[_0x1ffb('0x4b')](_0x1ffb('0x7b'),_[_0x1ffb('0x2e')](_0x45271a,'id'));_0x419563[_0x1ffb('0x4b')](_0x1ffb('0x7b'),_[_0x1ffb('0x2e')](_0x45271a,'id'));}});})[_0x1ffb('0x28')](function(){if(_0x1d3b29[_0x1ffb('0x94')]['role']===_0x1ffb('0x96')&&!_0x2c7d36&&!_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x7a')])return[];return db[_0x1ffb('0x99')][_0x1ffb('0x3f')](_0x3b681f[_0x1ffb('0x9a')](),_0x1b6311);})[_0x1ffb('0x28')](function(_0x431056){_0xfd72d0['count']=_0x431056['length'];if(_0xfd72d0[_0x1ffb('0x9b')]===0x0)return[];return db['sequelize'][_0x1ffb('0x3f')](_0x953c27[_0x1ffb('0x9a')](),_0x1b6311)['then'](function(_0x72243b){_0x36b11a=_[_0x1ffb('0x9c')](_0x72243b,'id');_0x1b6311=_[_0x1ffb('0x9d')](_0x1b6311,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d3b29[_0x1ffb('0x3f')][_0x1ffb('0x45')]){_0x296bac['attributes'][_0x1ffb('0x31')](function(_0xa0fab7){_0x419563[_0x1ffb('0x4e')]('i.'+_0xa0fab7);});}else{_0x419563[_0x1ffb('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1ffb('0x64'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0x9e'),_0x1ffb('0x9f'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa0'),_0x1ffb('0xa1'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa2'),'contactName');_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa3'));_0x419563['field'](_0x1ffb('0xa4'),'Contact.firstName');_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa5'),_0x1ffb('0xa6'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa7'),_0x1ffb('0xa8'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xa9'),_0x1ffb('0xaa'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xab'),_0x1ffb('0xac'));_0x419563['field'](_0x1ffb('0xad'),_0x1ffb('0xae'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xaf'),'Owner.fullname');_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xb0'),_0x1ffb('0xb1'));_0x419563[_0x1ffb('0x4e')](_0x1ffb('0xb2'),_0x1ffb('0x2f'));}if(_0x296bac[_0x1ffb('0x23')])_0x419563[_0x1ffb('0x23')](_0x296bac['limit']);if(_0x296bac[_0x1ffb('0x21')])_0x419563[_0x1ffb('0x21')](_0x296bac[_0x1ffb('0x21')]);return db[_0x1ffb('0x99')][_0x1ffb('0x3f')](_0x419563[_0x1ffb('0x9a')](),_0x1b6311);})[_0x1ffb('0x28')](function(_0x1a053d){if(_0x1a053d[_0x1ffb('0x46')]>0x0)_0x1d965b['where'](_0x1ffb('0xb3'),_[_0x1ffb('0x2e')](_0x1a053d,'id'));return db[_0x1ffb('0x99')][_0x1ffb('0x3f')](_0x1d965b['toString'](),_0x1b6311)[_0x1ffb('0x28')](function(_0x586629){var _0x13b2f4=_['groupBy'](_0x586629,_0x1ffb('0xb4'));var _0x47eede=[];_0x1a053d[_0x1ffb('0x31')](function(_0x115273){_0x47eede[_0x1ffb('0x33')](updateWhatsappInteraction(_0x115273,_0x36b11a,_0x13b2f4));});return BPromise[_0x1ffb('0xb5')](_0x47eede);});});})['then'](function(_0x27a081){_0xfd72d0[_0x1ffb('0xb6')]=_0x27a081;return _0xfd72d0;})[_0x1ffb('0x28')](respondWithFilteredResult(_0xc3805c,_0x296bac))[_0x1ffb('0xb7')](handleError(_0xc3805c,null));};exports[_0x1ffb('0xb8')]=function(_0x48360e,_0x223d68){var _0x2d2fae={'raw':![],'where':{'id':_0x48360e[_0x1ffb('0xb9')]['id']}},_0x244cbd={};_0x244cbd[_0x1ffb('0x44')]=_['keys'](db[_0x1ffb('0x3c')][_0x1ffb('0x3d')]);_0x244cbd[_0x1ffb('0x3f')]=_[_0x1ffb('0x40')](_0x48360e[_0x1ffb('0x3f')]);_0x244cbd[_0x1ffb('0x41')]=_[_0x1ffb('0x43')](_0x244cbd[_0x1ffb('0x44')],_0x244cbd[_0x1ffb('0x3f')]);_0x2d2fae[_0x1ffb('0x42')]=_[_0x1ffb('0x43')](_0x244cbd[_0x1ffb('0x44')],qs[_0x1ffb('0x45')](_0x48360e[_0x1ffb('0x3f')][_0x1ffb('0x45')]));_0x2d2fae[_0x1ffb('0x42')]=_0x2d2fae[_0x1ffb('0x42')][_0x1ffb('0x46')]?_0x2d2fae[_0x1ffb('0x42')]:_0x244cbd[_0x1ffb('0x44')];if(_0x48360e['query'][_0x1ffb('0xba')]){_0x2d2fae['include']=[{'all':!![]}];}_0x2d2fae=_[_0x1ffb('0x9d')]({},_0x2d2fae,_0x48360e[_0x1ffb('0xbb')]);return db['WhatsappInteraction'][_0x1ffb('0x6c')](_0x2d2fae)[_0x1ffb('0x28')](handleEntityNotFound(_0x223d68,null))[_0x1ffb('0x28')](respondWithResult(_0x223d68,null))[_0x1ffb('0xb7')](handleError(_0x223d68,null));};exports[_0x1ffb('0xbc')]=function(_0x3b8780,_0x69e9d1){return db[_0x1ffb('0x3c')][_0x1ffb('0xbc')](_0x3b8780['body'],{})[_0x1ffb('0x28')](respondWithResult(_0x69e9d1,0xc9))[_0x1ffb('0xb7')](handleError(_0x69e9d1,null));};exports['update']=function(_0x88273c,_0x5ba1bd){if(_0x88273c['body']['id']){delete _0x88273c[_0x1ffb('0xbd')]['id'];}return db[_0x1ffb('0x3c')][_0x1ffb('0x6c')]({'where':{'id':_0x88273c[_0x1ffb('0xb9')]['id']}})[_0x1ffb('0x28')](handleEntityNotFound(_0x5ba1bd,null))[_0x1ffb('0x28')](saveUpdates(_0x88273c[_0x1ffb('0xbd')],null))[_0x1ffb('0x28')](respondWithResult(_0x5ba1bd,null))[_0x1ffb('0xb7')](handleError(_0x5ba1bd,null));};exports[_0x1ffb('0x29')]=function(_0x3b29d0,_0x22dc46){return db[_0x1ffb('0x3c')]['find']({'where':{'id':_0x3b29d0[_0x1ffb('0xb9')]['id']}})[_0x1ffb('0x28')](handleEntityNotFound(_0x22dc46,null))[_0x1ffb('0x28')](removeEntity(_0x22dc46,null))[_0x1ffb('0xb7')](handleError(_0x22dc46,null));};exports[_0x1ffb('0xbe')]=function(_0x22b925,_0x195ac5){return db['WhatsappInteraction'][_0x1ffb('0xbe')]()[_0x1ffb('0x28')](respondWithResult(_0x195ac5,null))[_0x1ffb('0xb7')](handleError(_0x195ac5,null));};exports[_0x1ffb('0xbf')]=function(_0x469822,_0x1f6571,_0x481845){return db[_0x1ffb('0xc0')][_0x1ffb('0x6c')]({'where':{'id':_0x469822[_0x1ffb('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1f6571,null))['then'](function(_0x4d6abe){if(_0x4d6abe){return _0x4d6abe[_0x1ffb('0xbf')](_0x469822[_0x1ffb('0xbd')][_0x1ffb('0xc1')],_[_0x1ffb('0xc2')](_0x469822['body'],[_0x1ffb('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x1f6571,null))[_0x1ffb('0xb7')](handleError(_0x1f6571,null));};exports[_0x1ffb('0xc3')]=function(_0x5e3f37,_0x1b30f2,_0x261fd9){var _0x5dd12f={'raw':![],'where':{}};var _0x294bfa={};var _0x4e642f={'count':0x0,'rows':[]};return db[_0x1ffb('0x3c')]['findOne']({'where':{'id':_0x5e3f37['params']['id']}})['then'](handleEntityNotFound(_0x1b30f2,null))[_0x1ffb('0x28')](function(_0x29f28d){if(_0x29f28d){_0x294bfa[_0x1ffb('0x44')]=_['keys'](db[_0x1ffb('0xc0')][_0x1ffb('0x3d')]);_0x294bfa[_0x1ffb('0x3f')]=_['keys'](_0x5e3f37[_0x1ffb('0x3f')]);_0x294bfa[_0x1ffb('0x41')]=_[_0x1ffb('0x43')](_0x294bfa['model'],_0x294bfa[_0x1ffb('0x3f')]);_0x5dd12f[_0x1ffb('0x42')]=_[_0x1ffb('0x43')](_0x294bfa['model'],qs['fields'](_0x5e3f37[_0x1ffb('0x3f')][_0x1ffb('0x45')]));_0x5dd12f[_0x1ffb('0x42')]=_0x5dd12f['attributes'][_0x1ffb('0x46')]?_0x5dd12f[_0x1ffb('0x42')]:_0x294bfa['model'];if(!_0x5e3f37[_0x1ffb('0x3f')][_0x1ffb('0x47')]('nolimit')){_0x5dd12f[_0x1ffb('0x23')]=qs[_0x1ffb('0x23')](_0x5e3f37[_0x1ffb('0x3f')][_0x1ffb('0x23')]);_0x5dd12f['offset']=qs[_0x1ffb('0x21')](_0x5e3f37[_0x1ffb('0x3f')]['offset']);}_0x5dd12f[_0x1ffb('0x49')]=qs[_0x1ffb('0x4a')](_0x5e3f37[_0x1ffb('0x3f')]['sort']);_0x5dd12f[_0x1ffb('0x4b')]=qs['filters'](_[_0x1ffb('0x4c')](_0x5e3f37[_0x1ffb('0x3f')],_0x294bfa[_0x1ffb('0x41')]));_0x5dd12f[_0x1ffb('0x4b')]['WhatsappInteractionId']=_0x29f28d['id'];if(_0x5e3f37[_0x1ffb('0x3f')][_0x1ffb('0x86')]){_0x5dd12f[_0x1ffb('0x4b')]=_[_0x1ffb('0x9d')](_0x5dd12f[_0x1ffb('0x4b')],{'$or':_[_0x1ffb('0x2e')](_0x5dd12f[_0x1ffb('0x42')],function(_0x5e289b){var _0x11f8ad={};_0x11f8ad[_0x5e289b]={'$like':'%'+_0x5e3f37['query'][_0x1ffb('0x86')]+'%'};return _0x11f8ad;})});}if(_0x5e3f37[_0x1ffb('0x3f')][_0x1ffb('0x7d')]){var _0x1298be=_0x5e3f37[_0x1ffb('0x3f')]['$gte'][_0x1ffb('0x30')](',');var _0x435275={};_0x435275[_0x1298be[0x0]]={'$gte':moment(_0x1298be[0x1])[_0x1ffb('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5dd12f[_0x1ffb('0x4b')]=_[_0x1ffb('0x9d')](_0x5dd12f[_0x1ffb('0x4b')],_0x435275);}_0x5dd12f=_[_0x1ffb('0x9d')]({},_0x5dd12f,_0x5e3f37[_0x1ffb('0xbb')]);return db[_0x1ffb('0xc0')]['count']({'where':_0x5dd12f[_0x1ffb('0x4b')]})[_0x1ffb('0x28')](function(_0x50e0e7){_0x4e642f['count']=_0x50e0e7;if(_0x5e3f37['query'][_0x1ffb('0xba')]){_0x5dd12f[_0x1ffb('0xc5')]=[{'all':!![]}];}return db[_0x1ffb('0xc0')][_0x1ffb('0xc6')](_0x5dd12f);})[_0x1ffb('0x28')](function(_0x1fe0d1){_0x4e642f[_0x1ffb('0xb6')]=_0x1fe0d1;return _0x4e642f;});}})[_0x1ffb('0x28')](respondWithFilteredResult(_0x1b30f2,_0x5dd12f))[_0x1ffb('0xb7')](handleError(_0x1b30f2,null));};exports['addTags']=function(_0x285351,_0x598b35,_0x24c7e3){return db[_0x1ffb('0x3c')]['find']({'where':{'id':_0x285351[_0x1ffb('0xb9')]['id']}})[_0x1ffb('0x28')](handleEntityNotFound(_0x598b35,null))['then'](function(_0x16b95b){if(_0x16b95b){return _0x16b95b[_0x1ffb('0xc7')](_0x285351['body']['ids'],_['omit'](_0x285351[_0x1ffb('0xbd')],[_0x1ffb('0xc1'),'id'])||{})['spread'](function(){return db[_0x1ffb('0x70')][_0x1ffb('0xc6')]({'attributes':['id',_0x1ffb('0x2c'),_0x1ffb('0x4f')],'where':{'id':_0x285351['body']['ids']}});})[_0x1ffb('0x28')](function(_0x426835){socket[_0x1ffb('0xc8')](_0x1ffb('0xc9'),{'id':Number(_0x285351[_0x1ffb('0xb9')]['id']),'tags':_0x426835||[]});return{'id':Number(_0x285351['params']['id']),'tags':_0x426835||[]};});}})[_0x1ffb('0x28')](respondWithResult(_0x598b35,null))[_0x1ffb('0xb7')](handleError(_0x598b35,null));};exports['removeTags']=function(_0x570aa9,_0x180a8e,_0x7a8126){return db[_0x1ffb('0x3c')]['find']({'where':{'id':_0x570aa9[_0x1ffb('0xb9')]['id']}})[_0x1ffb('0x28')](handleEntityNotFound(_0x180a8e,null))[_0x1ffb('0x28')](function(_0x311b6c){if(_0x311b6c){return _0x311b6c[_0x1ffb('0xca')](_0x570aa9['query'][_0x1ffb('0xc1')]);}})['then'](respondWithStatusCode(_0x180a8e,null))[_0x1ffb('0xb7')](handleError(_0x180a8e,null));};exports[_0x1ffb('0xcb')]=function(_0x27ecdb,_0x395d26){var _0x31704c=moment()[_0x1ffb('0xcc')]()[_0x1ffb('0x9a')]();var _0x5f2944=path[_0x1ffb('0xcd')](config[_0x1ffb('0xce')],_0x1ffb('0xcf'),_0x1ffb('0xd0'),_0x1ffb('0xd1'));var _0x333be3=path[_0x1ffb('0xcd')](config[_0x1ffb('0xce')],_0x1ffb('0xcf'),'files',_0x1ffb('0xd2'));var _0x21c2a9=path[_0x1ffb('0xcd')](_0x5f2944,_0x31704c);var _0x34f66b=util['format'](_0x1ffb('0xd3'),_0x27ecdb[_0x1ffb('0xb9')]['id'],_0x31704c);var _0x125f84=path['join'](_0x5f2944,_0x34f66b);var _0x25a673=[];_0x25a673[_0x1ffb('0x33')]({'model':db['User'],'as':_0x1ffb('0x73'),'attributes':['id','fullname'],'raw':!![]});_0x25a673[_0x1ffb('0x33')]({'model':db[_0x1ffb('0xd4')],'as':_0x1ffb('0x68'),'attributes':['id','firstName',_0x1ffb('0xd5')],'raw':!![]});if(_0x27ecdb[_0x1ffb('0x3f')][_0x1ffb('0xd2')]){_0x25a673[_0x1ffb('0x33')]({'model':db[_0x1ffb('0xd6')],'as':_0x1ffb('0xd6'),'raw':!![]});}var _0x4c7564=[{'model':db['WhatsappMessage'],'as':_0x1ffb('0xd7'),'attributes':['id',_0x1ffb('0xbd'),_0x1ffb('0x7c'),_0x1ffb('0xd8'),_0x1ffb('0xd9'),'read'],'include':_0x25a673}];_0x4c7564[_0x1ffb('0x33')]({'model':db[_0x1ffb('0xda')],'as':_0x1ffb('0xdb'),'attributes':['id',_0x1ffb('0x2c')]});_0x4c7564[_0x1ffb('0x33')]({'model':db['User'],'as':_0x1ffb('0xdc'),'attributes':['id',_0x1ffb('0xdd')]});return db['WhatsappInteraction'][_0x1ffb('0x6c')]({'where':{'id':_0x27ecdb['params']['id']},'include':_0x4c7564})[_0x1ffb('0x28')](handleEntityNotFound(_0x395d26,null))[_0x1ffb('0x28')](function(_0x1330fc){if(_0x1330fc){var _0x5c5df7=_0x1330fc[_0x1ffb('0xde')]({'plain':!![]});fs[_0x1ffb('0xdf')](_0x21c2a9);var _0x1b9457={'channel':_0x1ffb('0xe0'),'account':_0x5c5df7[_0x1ffb('0xdb')][_0x1ffb('0x2c')],'agent':_0x5c5df7['Owner']?_0x5c5df7[_0x1ffb('0xdc')][_0x1ffb('0xdd')]:_0x1ffb('0xe1'),'createdAt':moment(_0x5c5df7[_0x1ffb('0x7c')])['format'](_0x1ffb('0xe2'))[_0x1ffb('0x9a')](),'closedAt':_0x5c5df7[_0x1ffb('0x38')]?moment(_0x5c5df7[_0x1ffb('0xe3')])[_0x1ffb('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1ffb('0x9a')]():'','disposition':_0x5c5df7['disposition'],'messages':_(_0x5c5df7['Messages'])[_0x1ffb('0x86')]({'secret':![]})[_0x1ffb('0x2e')](function(_0x265163){if(_0x265163[_0x1ffb('0xd6')]){var _0x5c688e=path[_0x1ffb('0xcd')](_0x333be3,_0x265163[_0x1ffb('0xd6')]['basename']);if(fs['existsSync'](_0x5c688e)){fs[_0x1ffb('0xe4')](_0x5c688e)[_0x1ffb('0xe5')](fs[_0x1ffb('0xe6')](path['join'](_0x21c2a9,_0x265163[_0x1ffb('0xd6')]['basename'])));}}return{'date':moment(_0x265163[_0x1ffb('0x7c')])[_0x1ffb('0xc4')](_0x1ffb('0xe2'))[_0x1ffb('0x9a')](),'sender':_0x265163[_0x1ffb('0xd8')]===_0x1ffb('0xe7')?_0x265163[_0x1ffb('0x73')]?_0x265163[_0x1ffb('0x73')][_0x1ffb('0xdd')]:_0x1ffb('0xe8'):_0x265163[_0x1ffb('0x68')][_0x1ffb('0xe9')]+(_0x265163[_0x1ffb('0x68')][_0x1ffb('0xd5')]?'\x20'+_0x265163[_0x1ffb('0x68')][_0x1ffb('0xd5')]:''),'body':_0x265163[_0x1ffb('0xd6')]?_0x265163[_0x1ffb('0xd6')]['basename']:_0x265163[_0x1ffb('0xbd')],'direction':_0x265163[_0x1ffb('0xd8')]===_0x1ffb('0xe7')?'A':'C','secret':_0x265163[_0x1ffb('0xd9')],'read':_0x265163[_0x1ffb('0x82')],'attachment':_0x265163[_0x1ffb('0xd6')]};})['value']()};return ejs[_0x1ffb('0xea')](path[_0x1ffb('0xcd')](config[_0x1ffb('0xce')],_0x1ffb('0xcf'),_0x1ffb('0xeb'),'downloadInteraction.ejs'),{'interaction':_0x1b9457})[_0x1ffb('0x28')](function(_0x2fd9f1){var _0x207bb2=path[_0x1ffb('0xcd')](_0x21c2a9,_0x1ffb('0xec')+_0x5c5df7['id']+'-'+_0x31704c+'.pdf');var _0x139fdb={'path':_0x207bb2,'channel':'Whatsapp','interactionId':_0x5c5df7['id']};return pdf[_0x1ffb('0xed')](_0x2fd9f1,_0x139fdb);})[_0x1ffb('0x28')](function(){return new BPromise(function(_0x3dbbb7,_0x5b7929){zipdir(_0x21c2a9,{'saveTo':_0x125f84},function(_0x2256d5,_0x49b251){if(_0x2256d5)return _0x5b7929(_0x2256d5);return _0x3dbbb7(_0x49b251);});})[_0x1ffb('0x28')](function(){return new BPromise(function(_0x4861b9,_0x17747c){rimraf(_0x21c2a9,function(_0x2627d3){if(_0x2627d3)_0x17747c(_0x2627d3);return _0x4861b9();});});})[_0x1ffb('0x28')](function(){return _0x395d26[_0x1ffb('0xcb')](_0x125f84,_0x34f66b,function(_0x434cfb){if(_0x434cfb){console['log']('err',_0x434cfb);}else{fs[_0x1ffb('0xee')](_0x125f84);}});});});}else{return _0x395d26['sendStatus'](0xc8);}})[_0x1ffb('0xb7')](handleError(_0x395d26,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 51a72b6..f4b7934 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 _0x35ba=['length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x35ba,0x8c));var _0xa35b=function(_0x1bf6b7,_0x12519b){_0x1bf6b7=_0x1bf6b7-0x0;var _0x5e2768=_0x35ba[_0x1bf6b7];return _0x5e2768;};'use strict';var EventEmitter=require(_0xa35b('0x0'));var WhatsappInteraction=require(_0xa35b('0x1'))['db'][_0xa35b('0x2')];var WhatsappMessage=require(_0xa35b('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa35b('0x3')](0x0);var events={'afterCreate':_0xa35b('0x4'),'afterUpdate':_0xa35b('0x5'),'afterDestroy':_0xa35b('0x6')};function emitEvent(_0x26742f){return function(_0xf11b36,_0x54cbf3,_0x3b342a){_0xf11b36['getUsers']({'attributes':['id'],'raw':!![]})[_0xa35b('0x7')](function(_0x121c8b){_0xf11b36[_0xa35b('0x8')](_0xa35b('0x9'),_0x121c8b[_0xa35b('0xa')](function(_0x5cc20a){return{'id':_0x5cc20a['id']};}));return WhatsappMessage[_0xa35b('0xb')]({'where':{'WhatsappInteractionId':_0xf11b36['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa35b('0x7')](function(_0x15702c){_0xf11b36[_0xa35b('0x8')](_0xa35b('0xc'),_0x15702c[_0xa35b('0xd')]);WhatsappInteractionEvents[_0xa35b('0xe')](_0x26742f+':'+_0xf11b36['id'],_0xf11b36);WhatsappInteractionEvents[_0xa35b('0xe')](_0x26742f,_0xf11b36);_0x3b342a(null);})[_0xa35b('0xf')](_0x3b342a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xa35b('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x63c6=['setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x63c6,0xbb));var _0x663c=function(_0x1f9f03,_0x56d035){_0x1f9f03=_0x1f9f03-0x0;var _0x3c7c89=_0x63c6[_0x1f9f03];return _0x3c7c89;};'use strict';var EventEmitter=require(_0x663c('0x0'));var WhatsappInteraction=require(_0x663c('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x663c('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x663c('0x3')](0x0);var events={'afterCreate':_0x663c('0x4'),'afterUpdate':_0x663c('0x5'),'afterDestroy':_0x663c('0x6')};function emitEvent(_0x153d08){return function(_0x404af2,_0x255994,_0x6bdbd1){_0x404af2['getUsers']({'attributes':['id'],'raw':!![]})[_0x663c('0x7')](function(_0xe6ac97){_0x404af2[_0x663c('0x8')](_0x663c('0x9'),_0xe6ac97['map'](function(_0x324e71){return{'id':_0x324e71['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x404af2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x663c('0x7')](function(_0x555aac){_0x404af2[_0x663c('0x8')](_0x663c('0xa'),_0x555aac[_0x663c('0xb')]);WhatsappInteractionEvents[_0x663c('0xc')](_0x153d08+':'+_0x404af2['id'],_0x404af2);WhatsappInteractionEvents[_0x663c('0xc')](_0x153d08,_0x404af2);_0x6bdbd1(null);})[_0x663c('0xd')](_0x6bdbd1(null));};}for(var e in events){if(events[_0x663c('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 79cb7c7..d92fda3 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 _0x6037=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions'];(function(_0x454cdb,_0x1a3f85){var _0x29f576=function(_0x1ed961){while(--_0x1ed961){_0x454cdb['push'](_0x454cdb['shift']());}};_0x29f576(++_0x1a3f85);}(_0x6037,0x1c0));var _0x7603=function(_0x3c0d90,_0x4dfaac){_0x3c0d90=_0x3c0d90-0x0;var _0xabd3be=_0x6037[_0x3c0d90];return _0xabd3be;};'use strict';var _=require(_0x7603('0x0'));var util=require('util');var logger=require(_0x7603('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7603('0x2'));var fs=require('fs');var path=require(_0x7603('0x3'));var rimraf=require(_0x7603('0x4'));var config=require(_0x7603('0x5'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x3b3755,_0x569340){return _0x3b3755['define'](_0x7603('0x6'),attributes,{'tableName':_0x7603('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3443cc,_0x544540,_0x312577){if(_0x3443cc[_0x7603('0x8')](_0x7603('0x9'))){_0x3443cc['closedAt']=moment()[_0x7603('0xa')](_0x7603('0xb'));}_0x312577(null,_0x3443cc);}}});}; \ No newline at end of file +var _0x13c4=['whatsapp_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction'];(function(_0x2f66c4,_0xb6bf25){var _0x3ca992=function(_0x3c1702){while(--_0x3c1702){_0x2f66c4['push'](_0x2f66c4['shift']());}};_0x3ca992(++_0xb6bf25);}(_0x13c4,0x121));var _0x413c=function(_0x2c0a23,_0x5e7678){_0x2c0a23=_0x2c0a23-0x0;var _0x415df4=_0x13c4[_0x2c0a23];return _0x415df4;};'use strict';var _=require('lodash');var util=require(_0x413c('0x0'));var logger=require(_0x413c('0x1'))('api');var moment=require(_0x413c('0x2'));var BPromise=require(_0x413c('0x3'));var rp=require(_0x413c('0x4'));var fs=require('fs');var path=require(_0x413c('0x5'));var rimraf=require('rimraf');var config=require(_0x413c('0x6'));var attributes=require(_0x413c('0x7'));module[_0x413c('0x8')]=function(_0x2a3c20,_0x3de37a){return _0x2a3c20[_0x413c('0x9')](_0x413c('0xa'),attributes,{'tableName':_0x413c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5729eb,_0x35f5fb,_0xcb9cde){if(_0x5729eb[_0x413c('0xc')]('closed')){_0x5729eb['closedAt']=moment()[_0x413c('0xd')](_0x413c('0xe'));}_0xcb9cde(null,_0x5729eb);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d963cac..4f33098 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 _0x61c5=['defaults','redis','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','where','limit','addTags','body','ids','omit','AddTags','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ea913,_0x41095a){var _0x4a3158=function(_0x382f15){while(--_0x382f15){_0x1ea913['push'](_0x1ea913['shift']());}};_0x4a3158(++_0x41095a);}(_0x61c5,0x1e8));var _0x561c=function(_0x964cb2,_0x301c35){_0x964cb2=_0x964cb2-0x0;var _0x397e9c=_0x61c5[_0x964cb2];return _0x397e9c;};'use strict';var _=require(_0x561c('0x0'));var util=require('util');var moment=require(_0x561c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x561c('0x2'));var logger=require(_0x561c('0x3'))(_0x561c('0x4'));var config=require(_0x561c('0x5'));var jayson=require(_0x561c('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x561c('0x7')](config[_0x561c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x561c('0x9'))(new Redis(config[_0x561c('0x8')]));require(_0x561c('0xa'))['register'](socket);function respondWithRpcPromise(_0x2dafe2,_0x10f796,_0x370db8){return new BPromise(function(_0x29eefc,_0xe93822){return client[_0x561c('0xb')](_0x2dafe2,_0x370db8)[_0x561c('0xc')](function(_0x61cd1c){logger[_0x561c('0xd')](_0x561c('0xe'),_0x10f796,_0x561c('0xf'));logger[_0x561c('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x10f796,_0x561c('0xf'),JSON[_0x561c('0x11')](_0x61cd1c));if(_0x61cd1c[_0x561c('0x12')]){if(_0x61cd1c[_0x561c('0x12')][_0x561c('0x13')]===0x1f4){logger[_0x561c('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x10f796,_0x61cd1c[_0x561c('0x12')]['message']);return _0xe93822(_0x61cd1c[_0x561c('0x12')]['message']);}logger[_0x561c('0x12')](_0x561c('0xe'),_0x10f796,_0x61cd1c[_0x561c('0x12')][_0x561c('0x14')]);return _0x29eefc(_0x61cd1c[_0x561c('0x12')][_0x561c('0x14')]);}else{logger[_0x561c('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x10f796,_0x561c('0xf'));_0x29eefc(_0x61cd1c[_0x561c('0x15')][_0x561c('0x14')]);}})[_0x561c('0x16')](function(_0x2c77b2){logger[_0x561c('0x12')](_0x561c('0xe'),_0x10f796,_0x2c77b2);_0xe93822(_0x2c77b2);});});}exports[_0x561c('0x17')]=function(_0x5cd52a){var _0x464a82=this;return new Promise(function(_0x4920f9,_0x2beb05){return db[_0x561c('0x18')]['update'](_0x5cd52a['body'],{'raw':_0x5cd52a[_0x561c('0x19')]?_0x5cd52a[_0x561c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd52a[_0x561c('0x19')]?_0x5cd52a[_0x561c('0x19')][_0x561c('0x1a')]||null:null,'attributes':_0x5cd52a[_0x561c('0x19')]?_0x5cd52a[_0x561c('0x19')]['attributes']||null:null,'limit':_0x5cd52a[_0x561c('0x19')]?_0x5cd52a[_0x561c('0x19')][_0x561c('0x1b')]||null:null})[_0x561c('0xc')](function(_0x3dcbbe){logger[_0x561c('0xd')](_0x561c('0x17'),_0x5cd52a);logger[_0x561c('0x10')](_0x561c('0x17'),_0x5cd52a,JSON['stringify'](_0x3dcbbe));_0x4920f9(_0x3dcbbe);})[_0x561c('0x16')](function(_0x369b7d){logger[_0x561c('0x12')](_0x561c('0x17'),_0x369b7d[_0x561c('0x14')],_0x5cd52a);_0x2beb05(_0x464a82[_0x561c('0x12')](0x1f4,_0x369b7d[_0x561c('0x14')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x35bb1e){return new Promise(function(_0x57be32,_0x32ea22){return db[_0x561c('0x18')]['find']({'where':_0x35bb1e[_0x561c('0x19')]?_0x35bb1e[_0x561c('0x19')][_0x561c('0x1a')]||null:null})['then'](function(_0x20ba73){if(_0x20ba73){return _0x20ba73[_0x561c('0x1c')](_0x35bb1e[_0x561c('0x1d')][_0x561c('0x1e')],_[_0x561c('0x1f')](_0x35bb1e[_0x561c('0x1d')],[_0x561c('0x1e'),'id'])||{});}})['spread'](function(_0x4a67f8){logger[_0x561c('0xd')](_0x561c('0x20'),_0x35bb1e);logger['debug'](_0x561c('0x20'),_0x35bb1e,JSON[_0x561c('0x11')](_0x4a67f8));_0x57be32(_0x4a67f8);})[_0x561c('0x16')](function(_0x17628c){logger[_0x561c('0x12')]('AddTags',_0x17628c[_0x561c('0x14')],_0x35bb1e);_0x32ea22(_this[_0x561c('0x12')](0x1f4,_0x17628c[_0x561c('0x14')]));});});}; \ No newline at end of file +var _0x19ff=['socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','attributes','limit','AddTagsToWhatsappInteraction','then','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','localhost'];(function(_0x1e2a0e,_0x3395a0){var _0x4acbe2=function(_0x5fa34b){while(--_0x5fa34b){_0x1e2a0e['push'](_0x1e2a0e['shift']());}};_0x4acbe2(++_0x3395a0);}(_0x19ff,0x1a3));var _0xf19f=function(_0x3b4f89,_0x9164fb){_0x3b4f89=_0x3b4f89-0x0;var _0x458a10=_0x19ff[_0x3b4f89];return _0x458a10;};'use strict';var _=require(_0xf19f('0x0'));var util=require('util');var moment=require(_0xf19f('0x1'));var BPromise=require(_0xf19f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf19f('0x3'));var db=require(_0xf19f('0x4'))['db'];var utils=require(_0xf19f('0x5'));var logger=require(_0xf19f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf19f('0x7')]['http']({'port':0x232a});config[_0xf19f('0x8')]=_['defaults'](config[_0xf19f('0x8')],{'host':_0xf19f('0x9'),'port':0x18eb});var socket=require(_0xf19f('0xa'))(new Redis(config[_0xf19f('0x8')]));require(_0xf19f('0xb'))[_0xf19f('0xc')](socket);function respondWithRpcPromise(_0x115578,_0x133ff9,_0x1f4956){return new BPromise(function(_0x254b97,_0x235ecb){return client[_0xf19f('0xd')](_0x115578,_0x1f4956)['then'](function(_0x4ad089){logger[_0xf19f('0xe')](_0xf19f('0xf'),_0x133ff9,'request\x20sent');logger[_0xf19f('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x133ff9,_0xf19f('0x11'),JSON[_0xf19f('0x12')](_0x4ad089));if(_0x4ad089['error']){if(_0x4ad089['error'][_0xf19f('0x13')]===0x1f4){logger[_0xf19f('0x14')](_0xf19f('0xf'),_0x133ff9,_0x4ad089[_0xf19f('0x14')][_0xf19f('0x15')]);return _0x235ecb(_0x4ad089[_0xf19f('0x14')][_0xf19f('0x15')]);}logger[_0xf19f('0x14')](_0xf19f('0xf'),_0x133ff9,_0x4ad089[_0xf19f('0x14')][_0xf19f('0x15')]);return _0x254b97(_0x4ad089[_0xf19f('0x14')][_0xf19f('0x15')]);}else{logger['info'](_0xf19f('0xf'),_0x133ff9,_0xf19f('0x11'));_0x254b97(_0x4ad089[_0xf19f('0x16')]['message']);}})[_0xf19f('0x17')](function(_0xc1be2c){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x133ff9,_0xc1be2c);_0x235ecb(_0xc1be2c);});});}exports[_0xf19f('0x18')]=function(_0x4d139a){var _0x177d53=this;return new Promise(function(_0x3d0bbb,_0x472a18){return db[_0xf19f('0x19')][_0xf19f('0x1a')](_0x4d139a['body'],{'raw':_0x4d139a[_0xf19f('0x1b')]?_0x4d139a[_0xf19f('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d139a[_0xf19f('0x1b')]?_0x4d139a[_0xf19f('0x1b')][_0xf19f('0x1c')]||null:null,'attributes':_0x4d139a[_0xf19f('0x1b')]?_0x4d139a['options'][_0xf19f('0x1d')]||null:null,'limit':_0x4d139a['options']?_0x4d139a[_0xf19f('0x1b')][_0xf19f('0x1e')]||null:null})['then'](function(_0x4d2a62){logger[_0xf19f('0xe')](_0xf19f('0x18'),_0x4d139a);logger[_0xf19f('0x10')]('UpdateWhatsappInteraction',_0x4d139a,JSON[_0xf19f('0x12')](_0x4d2a62));_0x3d0bbb(_0x4d2a62);})[_0xf19f('0x17')](function(_0x37fe46){logger[_0xf19f('0x14')](_0xf19f('0x18'),_0x37fe46[_0xf19f('0x15')],_0x4d139a);_0x472a18(_0x177d53[_0xf19f('0x14')](0x1f4,_0x37fe46['message']));});});};exports[_0xf19f('0x1f')]=function(_0x1ecec0){return new Promise(function(_0x1aa9b7,_0x20134a){return db[_0xf19f('0x19')]['find']({'where':_0x1ecec0['options']?_0x1ecec0[_0xf19f('0x1b')]['where']||null:null})[_0xf19f('0x20')](function(_0x5d6a78){if(_0x5d6a78){return _0x5d6a78[_0xf19f('0x21')](_0x1ecec0[_0xf19f('0x22')][_0xf19f('0x23')],_[_0xf19f('0x24')](_0x1ecec0[_0xf19f('0x22')],[_0xf19f('0x23'),'id'])||{});}})[_0xf19f('0x25')](function(_0x36c01a){logger[_0xf19f('0xe')](_0xf19f('0x26'),_0x1ecec0);logger[_0xf19f('0x10')]('AddTags',_0x1ecec0,JSON[_0xf19f('0x12')](_0x36c01a));_0x1aa9b7(_0x36c01a);})[_0xf19f('0x17')](function(_0x28a218){logger[_0xf19f('0x14')](_0xf19f('0x26'),_0x28a218[_0xf19f('0x15')],_0x1ecec0);_0x20134a(_this['error'](0x1f4,_0x28a218[_0xf19f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index a2f2042..a4f6af2 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 _0xaef2=['emit','register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0xa9c870,_0x111b20){var _0x2d13a3=function(_0x2e41f4){while(--_0x2e41f4){_0xa9c870['push'](_0xa9c870['shift']());}};_0x2d13a3(++_0x111b20);}(_0xaef2,0xdc));var _0x2aef=function(_0x1f2142,_0x3b88ba){_0x1f2142=_0x1f2142-0x0;var _0x108b15=_0xaef2[_0x1f2142];return _0x108b15;};'use strict';var WhatsappInteractionEvents=require(_0x2aef('0x0'));var events=[_0x2aef('0x1'),_0x2aef('0x2'),_0x2aef('0x3')];function createListener(_0x7b9a69,_0x413d05){return function(_0x205846){_0x413d05[_0x2aef('0x4')](_0x7b9a69,_0x205846);};}function removeListener(_0x22d424,_0x3efec4){return function(){WhatsappInteractionEvents['removeListener'](_0x22d424,_0x3efec4);};}exports[_0x2aef('0x5')]=function(_0x4b76bd){for(var _0x146343=0x0,_0x3a71b6=events['length'];_0x146343<_0x3a71b6;_0x146343++){var _0x46f84b=events[_0x146343];var _0xa209f6=createListener(_0x2aef('0x6')+_0x46f84b,_0x4b76bd);WhatsappInteractionEvents['on'](_0x46f84b,_0xa209f6);}}; \ No newline at end of file +var _0xc3b9=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x16530b,_0x1ad3b6){var _0x17ca82=function(_0x6cbe7a){while(--_0x6cbe7a){_0x16530b['push'](_0x16530b['shift']());}};_0x17ca82(++_0x1ad3b6);}(_0xc3b9,0x1cd));var _0x9c3b=function(_0x4d8524,_0x1e8925){_0x4d8524=_0x4d8524-0x0;var _0xbdb413=_0xc3b9[_0x4d8524];return _0xbdb413;};'use strict';var WhatsappInteractionEvents=require(_0x9c3b('0x0'));var events=[_0x9c3b('0x1'),_0x9c3b('0x2'),_0x9c3b('0x3')];function createListener(_0x47c1e6,_0x57d9ee){return function(_0xa65f15){_0x57d9ee[_0x9c3b('0x4')](_0x47c1e6,_0xa65f15);};}function removeListener(_0x4d9111,_0x522568){return function(){WhatsappInteractionEvents[_0x9c3b('0x5')](_0x4d9111,_0x522568);};}exports[_0x9c3b('0x6')]=function(_0x45526e){for(var _0x398f3b=0x0,_0x32ce39=events[_0x9c3b('0x7')];_0x398f3b<_0x32ce39;_0x398f3b++){var _0x102a77=events[_0x398f3b];var _0x5e8925=createListener(_0x9c3b('0x8')+_0x102a77,_0x45526e);WhatsappInteractionEvents['on'](_0x102a77,_0x5e8925);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 608d21f..f034305 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 _0xaaa7=['create','status','put','update','/:id/accept','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create'];(function(_0xdd183c,_0x341a88){var _0x2f89cb=function(_0x31a10a){while(--_0x31a10a){_0xdd183c['push'](_0xdd183c['shift']());}};_0x2f89cb(++_0x341a88);}(_0xaaa7,0x1e2));var _0x7aaa=function(_0x514e87,_0x278ac9){_0x514e87=_0x514e87-0x0;var _0x300a5f=_0xaaa7[_0x514e87];return _0x300a5f;};'use strict';var multer=require(_0x7aaa('0x0'));var util=require('util');var path=require(_0x7aaa('0x1'));var timeout=require('connect-timeout');var express=require(_0x7aaa('0x2'));var router=express[_0x7aaa('0x3')]();var fs_extra=require(_0x7aaa('0x4'));var auth=require(_0x7aaa('0x5'));var interaction=require(_0x7aaa('0x6'));var config=require('../../config/environment');var controller=require(_0x7aaa('0x7'));router['get']('/',auth[_0x7aaa('0x8')](),controller[_0x7aaa('0x9')]);router[_0x7aaa('0xa')](_0x7aaa('0xb'),auth[_0x7aaa('0x8')](),controller['describe']);router[_0x7aaa('0xa')](_0x7aaa('0xc'),auth[_0x7aaa('0x8')](),controller[_0x7aaa('0xd')]);router[_0x7aaa('0xe')]('/',auth[_0x7aaa('0x8')](),interaction[_0x7aaa('0xf')](_0x7aaa('0x10'),_0x7aaa('0x11')),controller[_0x7aaa('0x12')]);router['post']('/:id/status',controller[_0x7aaa('0x13')]);router[_0x7aaa('0x14')](_0x7aaa('0xc'),auth[_0x7aaa('0x8')](),controller[_0x7aaa('0x15')]);router[_0x7aaa('0x14')](_0x7aaa('0x16'),auth[_0x7aaa('0x8')](),controller['accept']);router[_0x7aaa('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x7aaa('0x17')](_0x7aaa('0xc'),auth[_0x7aaa('0x8')](),controller['destroy']);module[_0x7aaa('0x18')]=router; \ No newline at end of file +var _0x7752=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','create','post','/:id/status','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x1af09a,_0x27b40b){var _0x480e5e=function(_0x1fb77e){while(--_0x1fb77e){_0x1af09a['push'](_0x1af09a['shift']());}};_0x480e5e(++_0x27b40b);}(_0x7752,0xbd));var _0x2775=function(_0xa19b73,_0x978ab8){_0xa19b73=_0xa19b73-0x0;var _0x4dde7b=_0x7752[_0xa19b73];return _0x4dde7b;};'use strict';var multer=require(_0x2775('0x0'));var util=require('util');var path=require(_0x2775('0x1'));var timeout=require(_0x2775('0x2'));var express=require('express');var router=express[_0x2775('0x3')]();var fs_extra=require(_0x2775('0x4'));var auth=require(_0x2775('0x5'));var interaction=require(_0x2775('0x6'));var config=require(_0x2775('0x7'));var controller=require('./whatsappMessage.controller');router[_0x2775('0x8')]('/',auth[_0x2775('0x9')](),controller[_0x2775('0xa')]);router['get'](_0x2775('0xb'),auth['isAuthenticated'](),controller[_0x2775('0xc')]);router[_0x2775('0x8')](_0x2775('0xd'),auth[_0x2775('0x9')](),controller[_0x2775('0xe')]);router['post']('/',auth[_0x2775('0x9')](),interaction[_0x2775('0xf')](_0x2775('0x10'),'whatsappmessage:create'),controller[_0x2775('0x11')]);router[_0x2775('0x12')](_0x2775('0x13'),controller['status']);router['put'](_0x2775('0xd'),auth['isAuthenticated'](),controller[_0x2775('0x14')]);router['put'](_0x2775('0x15'),auth[_0x2775('0x9')](),controller[_0x2775('0x16')]);router[_0x2775('0x17')](_0x2775('0x18'),auth[_0x2775('0x9')](),controller[_0x2775('0x19')]);router[_0x2775('0x1a')](_0x2775('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 0fc07f5..0a58b5a 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 _0x5d87=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0xec006b,_0x1b9442){var _0x5473f0=function(_0x4031ca){while(--_0x4031ca){_0xec006b['push'](_0xec006b['shift']());}};_0x5473f0(++_0x1b9442);}(_0x5d87,0x1b0));var _0x75d8=function(_0x28cc86,_0x2f72d5){_0x28cc86=_0x28cc86-0x0;var _0x416d19=_0x5d87[_0x28cc86];return _0x416d19;};'use strict';var Sequelize=require('sequelize');module[_0x75d8('0x0')]={'body':{'type':Sequelize[_0x75d8('0x1')](_0x75d8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x75d8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x75d8('0x4')]('in','out'),'defaultValue':_0x75d8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x75d8('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x75d8('0x7')]},'secret':{'type':Sequelize[_0x75d8('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x75d8('0x1')]}}; \ No newline at end of file +var _0x4db5=['out','STRING','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0xf43113,_0x24246b){var _0x2f060d=function(_0x28d0dc){while(--_0x28d0dc){_0xf43113['push'](_0xf43113['shift']());}};_0x2f060d(++_0x24246b);}(_0x4db5,0xab));var _0x54db=function(_0x513fb7,_0x28a899){_0x513fb7=_0x513fb7-0x0;var _0x358d08=_0x4db5[_0x513fb7];return _0x358d08;};'use strict';var Sequelize=require(_0x54db('0x0'));module[_0x54db('0x1')]={'body':{'type':Sequelize['TEXT'](_0x54db('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x54db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x54db('0x4')]('in',_0x54db('0x5')),'defaultValue':_0x54db('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x54db('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x54db('0x7')]},'secret':{'type':Sequelize[_0x54db('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x54db('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index de88ad5..230ab01 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 _0x918c=['sort','where','pick','merge','filter','options','findAll','rows','show','params','fields','includeAll','include','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','format','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','agent','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','fullname','email','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x918c,0xcd));var _0xc918=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x918c[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xc918('0x0'));var rimraf=require(_0xc918('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc918('0x2'));var rp=require(_0xc918('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc918('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc918('0x5'));var ejs=require(_0xc918('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc918('0x7'));var squel=require(_0xc918('0x8'));var crypto=require(_0xc918('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc918('0x5'));var querystring=require('querystring');var Papa=require(_0xc918('0xa'));var Redis=require(_0xc918('0xb'));var authService=require(_0xc918('0xc'));var qs=require(_0xc918('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc918('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xc918('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xc918('0x10'));var db=require(_0xc918('0x11'))['db'];config['redis']=_[_0xc918('0x12')](config[_0xc918('0x13')],{'host':_0xc918('0x14'),'port':0x18eb});var socket=require(_0xc918('0x15'))(new Redis(config[_0xc918('0x13')]));require(_0xc918('0x16'))[_0xc918('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc918('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xc918('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c59b1,_0x3ef249,_0x59f7c5,_0x39ef67){return new BPromise(function(_0x3b8151,_0x254002){var _0x4444b9=_0x39ef67||client;return _0x4444b9[_0xc918('0x19')](_0x5c59b1,_0x59f7c5)[_0xc918('0x1a')](function(_0x2afa41){logger['info'](_0xc918('0x1b'),_0x3ef249,'request\x20sent');logger[_0xc918('0x1c')](_0xc918('0x1d'),_0x3ef249,_0xc918('0x1e'),JSON['stringify'](_0x2afa41));if(_0x2afa41['error']){if(_0x2afa41['error'][_0xc918('0x1f')]===0x1f4){logger['error'](_0xc918('0x1b'),_0x3ef249,_0x2afa41[_0xc918('0x20')][_0xc918('0x21')]);return _0x254002(_0x2afa41[_0xc918('0x20')]['message']);}logger['error'](_0xc918('0x1b'),_0x3ef249,_0x2afa41[_0xc918('0x20')][_0xc918('0x21')]);return _0x3b8151(_0x2afa41[_0xc918('0x20')][_0xc918('0x21')]);}else{logger['info'](_0xc918('0x1b'),_0x3ef249,_0xc918('0x1e'));_0x3b8151(_0x2afa41['result'][_0xc918('0x21')]);}})[_0xc918('0x22')](function(_0x2a720f){logger[_0xc918('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x3ef249,_0x2a720f);_0x254002(_0x2a720f);});});}function respondWithStatusCode(_0x2ff530,_0x543eaf){_0x543eaf=_0x543eaf||0xcc;return function(_0x430ca4){if(_0x430ca4){return _0x2ff530[_0xc918('0x23')](_0x543eaf);}return _0x2ff530[_0xc918('0x24')](_0x543eaf)[_0xc918('0x25')]();};}function respondWithResult(_0x5d33f6,_0x38baf4){_0x38baf4=_0x38baf4||0xc8;return function(_0x499277){if(_0x499277){return _0x5d33f6[_0xc918('0x24')](_0x38baf4)['json'](_0x499277);}};}function respondWithFilteredResult(_0x32d57a,_0x228b99){return function(_0x4aafba){if(_0x4aafba){var _0x5f3078=typeof _0x228b99[_0xc918('0x26')]===_0xc918('0x27')&&typeof _0x228b99[_0xc918('0x28')]===_0xc918('0x27');var _0x37e8cf=_0x4aafba[_0xc918('0x29')];var _0x40638=_0x5f3078?0x0:_0x228b99[_0xc918('0x26')];var _0x4d0655=_0x5f3078?_0x4aafba[_0xc918('0x29')]:_0x228b99[_0xc918('0x26')]+_0x228b99[_0xc918('0x28')];var _0x38e5a1;if(_0x4d0655>=_0x37e8cf){_0x4d0655=_0x37e8cf;_0x38e5a1=0xc8;}else{_0x38e5a1=0xce;}_0x32d57a[_0xc918('0x24')](_0x38e5a1);return _0x32d57a['set'](_0xc918('0x2a'),_0x40638+'-'+_0x4d0655+'/'+_0x37e8cf)[_0xc918('0x2b')](_0x4aafba);}return null;};}function patchUpdates(_0x407e0f){return function(_0xf17cf7){try{jsonpatch['apply'](_0xf17cf7,_0x407e0f,!![]);}catch(_0x5ce039){return BPromise[_0xc918('0x2c')](_0x5ce039);}return _0xf17cf7[_0xc918('0x2d')]();};}function saveUpdates(_0x3d30cd,_0x5ae813){return function(_0x364678){if(_0x364678){return _0x364678[_0xc918('0x2e')](_0x3d30cd)[_0xc918('0x1a')](function(_0x269ca4){return _0x269ca4;});}return null;};}function removeEntity(_0x42147d,_0x2c6b71){return function(_0x1f3c2c){if(_0x1f3c2c){return _0x1f3c2c[_0xc918('0x2f')]()[_0xc918('0x1a')](function(){_0x42147d[_0xc918('0x24')](0xcc)[_0xc918('0x25')]();});}};}function handleEntityNotFound(_0x497a0f,_0x9643){return function(_0x41dcb9){if(!_0x41dcb9){_0x497a0f[_0xc918('0x23')](0x194);}return _0x41dcb9;};}function handleError(_0x4a6a72,_0x2597b4){_0x2597b4=_0x2597b4||0x1f4;return function(_0x23bb0b){logger[_0xc918('0x20')](_0x23bb0b['stack']);if(_0x23bb0b[_0xc918('0x30')]){delete _0x23bb0b[_0xc918('0x30')];}_0x4a6a72['status'](_0x2597b4)[_0xc918('0x31')](_0x23bb0b);};}exports[_0xc918('0x32')]=function(_0x2ba316,_0x37fa34){var _0x117e70={},_0x55b089={},_0x3061a7={'count':0x0,'rows':[]};var _0x39bedb=_[_0xc918('0x33')](db[_0xc918('0x34')][_0xc918('0x35')],function(_0x4f6e56){return{'name':_0x4f6e56[_0xc918('0x36')],'type':_0x4f6e56[_0xc918('0x37')][_0xc918('0x38')]};});_0x55b089[_0xc918('0x39')]=_[_0xc918('0x33')](_0x39bedb,'name');_0x55b089[_0xc918('0x3a')]=_[_0xc918('0x3b')](_0x2ba316[_0xc918('0x3a')]);_0x55b089[_0xc918('0x3c')]=_[_0xc918('0x3d')](_0x55b089[_0xc918('0x39')],_0x55b089[_0xc918('0x3a')]);_0x117e70[_0xc918('0x3e')]=_[_0xc918('0x3d')](_0x55b089['model'],qs['fields'](_0x2ba316[_0xc918('0x3a')]['fields']));_0x117e70[_0xc918('0x3e')]=_0x117e70['attributes'][_0xc918('0x3f')]?_0x117e70[_0xc918('0x3e')]:_0x55b089['model'];if(!_0x2ba316[_0xc918('0x3a')][_0xc918('0x40')](_0xc918('0x41'))){_0x117e70['limit']=qs['limit'](_0x2ba316[_0xc918('0x3a')][_0xc918('0x28')]);_0x117e70[_0xc918('0x26')]=qs[_0xc918('0x26')](_0x2ba316[_0xc918('0x3a')][_0xc918('0x26')]);}_0x117e70[_0xc918('0x42')]=qs['sort'](_0x2ba316[_0xc918('0x3a')][_0xc918('0x43')]);_0x117e70[_0xc918('0x44')]=qs[_0xc918('0x3c')](_[_0xc918('0x45')](_0x2ba316[_0xc918('0x3a')],_0x55b089[_0xc918('0x3c')]),_0x39bedb);if(_0x2ba316[_0xc918('0x3a')]['filter']){_0x117e70['where']=_[_0xc918('0x46')](_0x117e70[_0xc918('0x44')],{'$or':_[_0xc918('0x33')](_0x39bedb,function(_0x43182a){if(_0x43182a[_0xc918('0x37')]!=='VIRTUAL'){var _0x1c9cc9={};_0x1c9cc9[_0x43182a[_0xc918('0x30')]]={'$like':'%'+_0x2ba316['query'][_0xc918('0x47')]+'%'};return _0x1c9cc9;}})});}_0x117e70=_[_0xc918('0x46')]({},_0x117e70,_0x2ba316[_0xc918('0x48')]);var _0x41e1f4={'where':_0x117e70[_0xc918('0x44')]};return db['WhatsappMessage'][_0xc918('0x29')](_0x41e1f4)[_0xc918('0x1a')](function(_0x3ca2d6){_0x3061a7['count']=_0x3ca2d6;if(_0x2ba316[_0xc918('0x3a')]['includeAll']){_0x117e70['include']=[{'all':!![]}];}return db[_0xc918('0x34')][_0xc918('0x49')](_0x117e70);})['then'](function(_0xa8d92e){_0x3061a7[_0xc918('0x4a')]=_0xa8d92e;return _0x3061a7;})[_0xc918('0x1a')](respondWithFilteredResult(_0x37fa34,_0x117e70))[_0xc918('0x22')](handleError(_0x37fa34,null));};exports[_0xc918('0x4b')]=function(_0x4ea867,_0x4f3450){var _0x586f94={'raw':!![],'where':{'id':_0x4ea867[_0xc918('0x4c')]['id']}},_0x32964b={};_0x32964b[_0xc918('0x39')]=_['keys'](db['WhatsappMessage'][_0xc918('0x35')]);_0x32964b[_0xc918('0x3a')]=_[_0xc918('0x3b')](_0x4ea867[_0xc918('0x3a')]);_0x32964b['filters']=_['intersection'](_0x32964b[_0xc918('0x39')],_0x32964b['query']);_0x586f94[_0xc918('0x3e')]=_[_0xc918('0x3d')](_0x32964b[_0xc918('0x39')],qs[_0xc918('0x4d')](_0x4ea867['query']['fields']));_0x586f94[_0xc918('0x3e')]=_0x586f94[_0xc918('0x3e')][_0xc918('0x3f')]?_0x586f94['attributes']:_0x32964b[_0xc918('0x39')];if(_0x4ea867['query'][_0xc918('0x4e')]){_0x586f94[_0xc918('0x4f')]=[{'all':!![]}];}_0x586f94=_[_0xc918('0x46')]({},_0x586f94,_0x4ea867[_0xc918('0x48')]);return db[_0xc918('0x34')][_0xc918('0x50')](_0x586f94)['then'](handleEntityNotFound(_0x4f3450,null))[_0xc918('0x1a')](respondWithResult(_0x4f3450,null))[_0xc918('0x22')](handleError(_0x4f3450,null));};exports[_0xc918('0x51')]=function(_0x333245,_0x3001fd){return db[_0xc918('0x34')][_0xc918('0x51')](_0x333245[_0xc918('0x52')],{})[_0xc918('0x1a')](respondWithResult(_0x3001fd,0xc9))[_0xc918('0x22')](handleError(_0x3001fd,null));};exports[_0xc918('0x2e')]=function(_0x43ae0a,_0xf97797){if(_0x43ae0a[_0xc918('0x52')]['id']){delete _0x43ae0a['body']['id'];}return db[_0xc918('0x34')][_0xc918('0x50')]({'where':{'id':_0x43ae0a[_0xc918('0x4c')]['id']}})[_0xc918('0x1a')](handleEntityNotFound(_0xf97797,null))[_0xc918('0x1a')](saveUpdates(_0x43ae0a[_0xc918('0x52')],null))['then'](respondWithResult(_0xf97797,null))[_0xc918('0x22')](handleError(_0xf97797,null));};exports['destroy']=function(_0x30fc68,_0x2fb612){return db[_0xc918('0x34')][_0xc918('0x50')]({'where':{'id':_0x30fc68[_0xc918('0x4c')]['id']}})[_0xc918('0x1a')](handleEntityNotFound(_0x2fb612,null))['then'](removeEntity(_0x2fb612,null))['catch'](handleError(_0x2fb612,null));};exports[_0xc918('0x53')]=function(_0x19891f,_0x451ba3){return db['WhatsappMessage'][_0xc918('0x53')]()[_0xc918('0x1a')](respondWithResult(_0x451ba3,null))[_0xc918('0x22')](handleError(_0x451ba3,null));};var interaction_log=require(_0xc918('0x54'))(_0xc918('0x55'));exports[_0xc918('0x56')]=function(_0x591a03,_0x11f1f9,_0x39d9c1){var _0x7a7f28={'agent':{},'channel':_0xc918('0x57')};if(_0x591a03['body']['id']){delete _0x591a03[_0xc918('0x52')]['id'];}_0x591a03[_0xc918('0x52')][_0xc918('0x58')]=!![];_0x591a03[_0xc918('0x52')][_0xc918('0x59')]=moment()['format'](_0xc918('0x5a'));_0x591a03[_0xc918('0x52')][_0xc918('0x5b')]=_0x591a03[_0xc918('0x52')][_0xc918('0x5b')]||_0x591a03[_0xc918('0x5c')]['id'];_0x7a7f28['agent']['id']=_0x591a03[_0xc918('0x52')][_0xc918('0x5b')];return db[_0xc918('0x34')]['find']({'where':{'id':_0x591a03[_0xc918('0x4c')]['id'],'UserId':null}})[_0xc918('0x1a')](handleEntityNotFound(_0x11f1f9,null))[_0xc918('0x1a')](saveUpdates(_0x591a03[_0xc918('0x52')],null))[_0xc918('0x1a')](function(_0x4bc1c5){if(_0x4bc1c5){_0x7a7f28['message']=_0x4bc1c5[_0xc918('0x5d')]({'plain':!![]});return db[_0xc918('0x5e')][_0xc918('0x50')]({'where':{'id':_0x4bc1c5['WhatsappInteractionId']}});}return null;})[_0xc918('0x1a')](handleEntityNotFound(_0x11f1f9,null))['then'](function(_0x4a33f5){if(_0x4a33f5){return _0x4a33f5[_0xc918('0x2e')]({'UserId':_0x591a03[_0xc918('0x52')]['UserId'],'read1stAt':_[_0xc918('0x5f')](_0x4a33f5[_0xc918('0x60')])?moment()[_0xc918('0x61')](_0xc918('0x5a')):undefined});}return null;})[_0xc918('0x1a')](function(_0x3aa390){if(_0x3aa390){_0x7a7f28['interaction']=_0x3aa390[_0xc918('0x5d')]({'plain':!![]});interaction_log[_0xc918('0x62')](_0xc918('0x63'),_0x591a03[_0xc918('0x5c')]['id'],_0x591a03[_0xc918('0x5c')][_0xc918('0x30')],_0x591a03[_0xc918('0x5c')]['role'],_0x7a7f28[_0xc918('0x64')]['id'],_0x591a03[_0xc918('0x52')]?JSON['stringify'](_0x591a03['body']):'null');return respondWithRpcPromise(_0xc918('0x65'),_0xc918('0x66'),_0x7a7f28);}return null;})['then'](function(_0x220a13){var _0x46d760='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x220a13[_0xc918('0x21')][_0xc918('0x67')];return db[_0xc918('0x68')][_0xc918('0x3a')](_0x46d760,{'type':db['Sequelize'][_0xc918('0x69')]['SELECT'],'raw':!![]})[_0xc918('0x1a')](function(_0x46175b){return _0x46175b;});})[_0xc918('0x1a')](function(_0x3f84b3){if(_0x3f84b3){_0x7a7f28[_0xc918('0x21')][_0xc918('0x6a')]=_0x3f84b3[0x0];if(!_0x591a03[_0xc918('0x52')][_0xc918('0x5b')])return;return db[_0xc918('0x6b')][_0xc918('0x50')]({'where':{'id':_0x591a03[_0xc918('0x52')][_0xc918('0x5b')],'role':_0xc918('0x6c')},'attributes':['id',_0xc918('0x30'),'fullname','email',_0xc918('0x6d')],'raw':!![]});}return null;})[_0xc918('0x1a')](function(_0x64a221){if(!_0x64a221)return null;_0x7a7f28[_0xc918('0x21')][_0xc918('0x6c')]=_0x64a221;return _0x7a7f28;})[_0xc918('0x1a')](function(_0x5bb098){if(_0x5bb098){if(_0x591a03[_0xc918('0x52')]['manual']){_0x7a7f28[_0xc918('0x21')][_0xc918('0x6e')]=util[_0xc918('0x61')](_0xc918('0x6f'),_0x591a03[_0xc918('0x5c')][_0xc918('0x30')]);_0x7a7f28['message']['channel']=_0x7a7f28[_0xc918('0x70')];_0x7a7f28['message'][_0xc918('0x71')]=_0x7a7f28['channel'];_0x7a7f28[_0xc918('0x21')][_0xc918('0x72')]='accept';return respondWithRpcPromise('EventManager',_0xc918('0x73'),{'event':_0xc918('0x74'),'message':_0x7a7f28['message']},client9002)[_0xc918('0x1a')](function(){return _0x7a7f28;});}return _0x7a7f28;}return null;})[_0xc918('0x1a')](respondWithResult(_0x11f1f9,null))[_0xc918('0x22')](handleError(_0x11f1f9,null));};var interaction_log=require(_0xc918('0x54'))('whatsapp-interactions');exports[_0xc918('0x2c')]=function(_0x4309fd,_0x671e47,_0x40f3df){var _0x58c494={'agent':{},'channel':_0xc918('0x57')};if(_0x4309fd[_0xc918('0x52')]['id']){delete _0x4309fd[_0xc918('0x52')]['id'];}_0x4309fd[_0xc918('0x52')][_0xc918('0x5b')]=_0x4309fd[_0xc918('0x52')]['UserId']||_0x4309fd[_0xc918('0x5c')]['id'];_0x58c494['agent']['id']=_0x4309fd[_0xc918('0x52')][_0xc918('0x5b')];return db[_0xc918('0x34')]['find']({'where':{'id':_0x4309fd['params']['id'],'UserId':null}})[_0xc918('0x1a')](handleEntityNotFound(_0x671e47,null))[_0xc918('0x1a')](function(_0x1f594a){if(_0x1f594a){_0x58c494[_0xc918('0x21')]=_0x1f594a[_0xc918('0x5d')]({'plain':!![]});return db[_0xc918('0x5e')]['find']({'where':{'id':_0x1f594a[_0xc918('0x75')]}});}return null;})[_0xc918('0x1a')](handleEntityNotFound(_0x671e47,null))['then'](function(_0x172440){if(_0x172440){_0x58c494[_0xc918('0x64')]=_0x172440[_0xc918('0x5d')]({'plain':!![]});interaction_log['info'](_0xc918('0x76'),_0x4309fd[_0xc918('0x5c')]['id'],_0x4309fd['user'][_0xc918('0x30')],_0x4309fd[_0xc918('0x5c')][_0xc918('0x77')],_0x58c494[_0xc918('0x64')]['id'],_0x4309fd[_0xc918('0x52')]?JSON[_0xc918('0x78')](_0x4309fd[_0xc918('0x52')]):'null');return respondWithRpcPromise(_0xc918('0x79'),_0xc918('0x7a'),_0x58c494);}return null;})[_0xc918('0x1a')](function(_0x531918){var _0xef224c=_0xc918('0x7b')+_0x531918[_0xc918('0x21')]['ContactId'];return db[_0xc918('0x68')][_0xc918('0x3a')](_0xef224c,{'type':db[_0xc918('0x7c')][_0xc918('0x69')][_0xc918('0x7d')],'raw':!![]})[_0xc918('0x1a')](function(_0x7a866b){return _0x7a866b;});})[_0xc918('0x1a')](function(_0xdffd1f){if(_0xdffd1f){_0x58c494[_0xc918('0x21')][_0xc918('0x6a')]=_0xdffd1f[0x0];if(!_0x4309fd[_0xc918('0x52')][_0xc918('0x5b')])return;return db['User'][_0xc918('0x50')]({'where':{'id':_0x4309fd[_0xc918('0x52')]['UserId'],'role':_0xc918('0x6c')},'attributes':['id',_0xc918('0x30'),_0xc918('0x7e'),_0xc918('0x7f'),_0xc918('0x6d')],'raw':!![]});}return null;})['then'](function(_0x49d637){if(!_0x49d637)return null;_0x58c494[_0xc918('0x21')][_0xc918('0x6c')]=_0x49d637;return _0x58c494;})[_0xc918('0x1a')](function(_0x131c1a){if(_0x131c1a){_0x131c1a['message']['interface']=util[_0xc918('0x61')](_0xc918('0x6f'),_0x4309fd['user']['name']);_0x131c1a[_0xc918('0x21')][_0xc918('0x70')]=_0x58c494[_0xc918('0x70')];_0x131c1a[_0xc918('0x21')][_0xc918('0x71')]=_0x58c494['channel'];_0x131c1a[_0xc918('0x21')][_0xc918('0x72')]='reject';respondWithRpcPromise(_0xc918('0x73'),'EventManager',{'event':_0xc918('0x80'),'message':_0x131c1a[_0xc918('0x21')]},client9002);return _0x58c494;}return null;})[_0xc918('0x1a')](respondWithResult(_0x671e47,null))[_0xc918('0x22')](handleError(_0x671e47,null));};exports[_0xc918('0x24')]=function(_0x300726,_0x5c47ac,_0x2b64d0){if(_0x300726[_0xc918('0x52')]['id']){delete _0x300726[_0xc918('0x52')]['id'];}var _0x4ac879;return db[_0xc918('0x34')][_0xc918('0x50')]({'where':{'id':_0x300726[_0xc918('0x4c')]['id']}})[_0xc918('0x1a')](handleEntityNotFound(_0x5c47ac,null))['then'](function(_0x5c7d7e){if(_0x5c7d7e){_0x4ac879=_0x5c7d7e;return db['WhatsappAccount']['find']({'where':{'id':_0x5c7d7e[_0xc918('0x81')]}});}})[_0xc918('0x1a')](handleEntityNotFound(_0x5c47ac,null))[_0xc918('0x1a')](function(_0x205353){if(_0x205353){logger[_0xc918('0x1c')](_0xc918('0x82'),'status','received\x20delivery\x20report\x20from',_0x205353[_0xc918('0x37')],util[_0xc918('0x83')](_0x300726[_0xc918('0x52')],{'showHidden':![],'depth':null}));switch(_0x205353[_0xc918('0x37')]){case _0xc918('0x84'):if(_0x300726[_0xc918('0x52')][_0xc918('0x85')]&&_0x300726['body']['MessageSid']===_0x4ac879['messageId']&&_0x300726['body'][_0xc918('0x86')]&&_0x300726[_0xc918('0x52')]['MessageStatus']===_0xc918('0x58')){return _0x4ac879[_0xc918('0x2e')]({'read':!![]});}else{logger[_0xc918('0x20')](_0xc918('0x87'),_0xc918('0x24'),_0xc918('0x84'),util[_0xc918('0x83')](_0x300726[_0xc918('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x4ac879;}})[_0xc918('0x1a')](respondWithResult(_0x5c47ac,null))[_0xc918('0x22')](handleError(_0x5c47ac,null));}; \ No newline at end of file +var _0xa04a=['internal','interface','SIP/%s','channel','event','EventManager','reject','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','motionChannel','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','end','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','fields','include','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','contact','User','fullname','email'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xa04a,0x1c8));var _0xaa04=function(_0x5b4e1b,_0x4fcde1){_0x5b4e1b=_0x5b4e1b-0x0;var _0x119e2=_0xa04a[_0x5b4e1b];return _0x119e2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa04('0x0'));var jsonpatch=require(_0xaa04('0x1'));var rp=require(_0xaa04('0x2'));var moment=require(_0xaa04('0x3'));var BPromise=require(_0xaa04('0x4'));var Mustache=require('mustache');var util=require(_0xaa04('0x5'));var path=require(_0xaa04('0x6'));var sox=require(_0xaa04('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa04('0x8'));var _=require('lodash');var squel=require(_0xaa04('0x9'));var crypto=require(_0xaa04('0xa'));var jsforce=require(_0xaa04('0xb'));var deskjs=require(_0xaa04('0xc'));var toCsv=require(_0xaa04('0xd'));var querystring=require(_0xaa04('0xe'));var Papa=require(_0xaa04('0xf'));var Redis=require('ioredis');var authService=require(_0xaa04('0x10'));var qs=require(_0xaa04('0x11'));var as=require(_0xaa04('0x12'));var hardwareService=require(_0xaa04('0x13'));var logger=require(_0xaa04('0x14'))(_0xaa04('0x15'));var utils=require(_0xaa04('0x16'));var config=require(_0xaa04('0x17'));var licenseUtil=require(_0xaa04('0x18'));var db=require('../../mysqldb')['db'];config[_0xaa04('0x19')]=_[_0xaa04('0x1a')](config[_0xaa04('0x19')],{'host':_0xaa04('0x1b'),'port':0x18eb});var socket=require(_0xaa04('0x1c'))(new Redis(config['redis']));require(_0xaa04('0x1d'))[_0xaa04('0x1e')](socket);var jayson=require(_0xaa04('0x1f'));var client=jayson[_0xaa04('0x20')][_0xaa04('0x21')]({'port':0x232c});var client9002=jayson[_0xaa04('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4364bd,_0x3f6587,_0x1286c0,_0x202c5e){return new BPromise(function(_0x4e6749,_0x34890b){var _0x235a2b=_0x202c5e||client;return _0x235a2b[_0xaa04('0x22')](_0x4364bd,_0x1286c0)[_0xaa04('0x23')](function(_0xa7d99c){logger[_0xaa04('0x24')](_0xaa04('0x25'),_0x3f6587,_0xaa04('0x26'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3f6587,'request\x20sent',JSON[_0xaa04('0x27')](_0xa7d99c));if(_0xa7d99c[_0xaa04('0x28')]){if(_0xa7d99c[_0xaa04('0x28')][_0xaa04('0x29')]===0x1f4){logger[_0xaa04('0x28')](_0xaa04('0x25'),_0x3f6587,_0xa7d99c[_0xaa04('0x28')][_0xaa04('0x2a')]);return _0x34890b(_0xa7d99c[_0xaa04('0x28')][_0xaa04('0x2a')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3f6587,_0xa7d99c[_0xaa04('0x28')][_0xaa04('0x2a')]);return _0x4e6749(_0xa7d99c['error'][_0xaa04('0x2a')]);}else{logger[_0xaa04('0x24')](_0xaa04('0x25'),_0x3f6587,'request\x20sent');_0x4e6749(_0xa7d99c['result'][_0xaa04('0x2a')]);}})[_0xaa04('0x2b')](function(_0x5324b2){logger[_0xaa04('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x3f6587,_0x5324b2);_0x34890b(_0x5324b2);});});}function respondWithStatusCode(_0x2b345b,_0x45a275){_0x45a275=_0x45a275||0xcc;return function(_0x2563ad){if(_0x2563ad){return _0x2b345b['sendStatus'](_0x45a275);}return _0x2b345b[_0xaa04('0x2c')](_0x45a275)['end']();};}function respondWithResult(_0x4fe13a,_0x43b4d2){_0x43b4d2=_0x43b4d2||0xc8;return function(_0xe666b2){if(_0xe666b2){return _0x4fe13a[_0xaa04('0x2c')](_0x43b4d2)[_0xaa04('0x2d')](_0xe666b2);}};}function respondWithFilteredResult(_0x4156b1,_0x595551){return function(_0x413b87){if(_0x413b87){var _0x380ffa=typeof _0x595551[_0xaa04('0x2e')]===_0xaa04('0x2f')&&typeof _0x595551[_0xaa04('0x30')]==='undefined';var _0x1a2782=_0x413b87[_0xaa04('0x31')];var _0x12fbef=_0x380ffa?0x0:_0x595551[_0xaa04('0x2e')];var _0x5f4bf8=_0x380ffa?_0x413b87[_0xaa04('0x31')]:_0x595551[_0xaa04('0x2e')]+_0x595551[_0xaa04('0x30')];var _0x4bf275;if(_0x5f4bf8>=_0x1a2782){_0x5f4bf8=_0x1a2782;_0x4bf275=0xc8;}else{_0x4bf275=0xce;}_0x4156b1[_0xaa04('0x2c')](_0x4bf275);return _0x4156b1['set'](_0xaa04('0x32'),_0x12fbef+'-'+_0x5f4bf8+'/'+_0x1a2782)[_0xaa04('0x2d')](_0x413b87);}return null;};}function patchUpdates(_0x18eeac){return function(_0x303440){try{jsonpatch['apply'](_0x303440,_0x18eeac,!![]);}catch(_0x47c3f7){return BPromise['reject'](_0x47c3f7);}return _0x303440[_0xaa04('0x33')]();};}function saveUpdates(_0x42adcc,_0x4a65a1){return function(_0x2bdfc2){if(_0x2bdfc2){return _0x2bdfc2[_0xaa04('0x34')](_0x42adcc)[_0xaa04('0x23')](function(_0x16a562){return _0x16a562;});}return null;};}function removeEntity(_0x3eaf1b,_0x32b484){return function(_0xa8c8db){if(_0xa8c8db){return _0xa8c8db[_0xaa04('0x35')]()[_0xaa04('0x23')](function(){_0x3eaf1b[_0xaa04('0x2c')](0xcc)[_0xaa04('0x36')]();});}};}function handleEntityNotFound(_0x232773,_0x42cd29){return function(_0x2660ff){if(!_0x2660ff){_0x232773[_0xaa04('0x37')](0x194);}return _0x2660ff;};}function handleError(_0x3aea2a,_0x5a52d8){_0x5a52d8=_0x5a52d8||0x1f4;return function(_0x1bb6c1){logger[_0xaa04('0x28')](_0x1bb6c1[_0xaa04('0x38')]);if(_0x1bb6c1['name']){delete _0x1bb6c1[_0xaa04('0x39')];}_0x3aea2a[_0xaa04('0x2c')](_0x5a52d8)[_0xaa04('0x3a')](_0x1bb6c1);};}exports[_0xaa04('0x3b')]=function(_0x3e299b,_0x3cc83b){var _0x11ad62={},_0x119065={},_0x1df129={'count':0x0,'rows':[]};var _0x286cae=_[_0xaa04('0x3c')](db[_0xaa04('0x3d')][_0xaa04('0x3e')],function(_0x308ba4){return{'name':_0x308ba4[_0xaa04('0x3f')],'type':_0x308ba4[_0xaa04('0x40')][_0xaa04('0x41')]};});_0x119065[_0xaa04('0x42')]=_[_0xaa04('0x3c')](_0x286cae,_0xaa04('0x39'));_0x119065[_0xaa04('0x43')]=_['keys'](_0x3e299b[_0xaa04('0x43')]);_0x119065[_0xaa04('0x44')]=_[_0xaa04('0x45')](_0x119065[_0xaa04('0x42')],_0x119065[_0xaa04('0x43')]);_0x11ad62[_0xaa04('0x46')]=_['intersection'](_0x119065[_0xaa04('0x42')],qs['fields'](_0x3e299b[_0xaa04('0x43')]['fields']));_0x11ad62[_0xaa04('0x46')]=_0x11ad62['attributes'][_0xaa04('0x47')]?_0x11ad62['attributes']:_0x119065[_0xaa04('0x42')];if(!_0x3e299b['query'][_0xaa04('0x48')](_0xaa04('0x49'))){_0x11ad62[_0xaa04('0x30')]=qs[_0xaa04('0x30')](_0x3e299b['query']['limit']);_0x11ad62[_0xaa04('0x2e')]=qs[_0xaa04('0x2e')](_0x3e299b[_0xaa04('0x43')][_0xaa04('0x2e')]);}_0x11ad62['order']=qs[_0xaa04('0x4a')](_0x3e299b[_0xaa04('0x43')][_0xaa04('0x4a')]);_0x11ad62[_0xaa04('0x4b')]=qs[_0xaa04('0x44')](_[_0xaa04('0x4c')](_0x3e299b['query'],_0x119065[_0xaa04('0x44')]),_0x286cae);if(_0x3e299b[_0xaa04('0x43')][_0xaa04('0x4d')]){_0x11ad62['where']=_[_0xaa04('0x4e')](_0x11ad62[_0xaa04('0x4b')],{'$or':_[_0xaa04('0x3c')](_0x286cae,function(_0x336ea9){if(_0x336ea9[_0xaa04('0x40')]!=='VIRTUAL'){var _0x4177fc={};_0x4177fc[_0x336ea9[_0xaa04('0x39')]]={'$like':'%'+_0x3e299b[_0xaa04('0x43')][_0xaa04('0x4d')]+'%'};return _0x4177fc;}})});}_0x11ad62=_[_0xaa04('0x4e')]({},_0x11ad62,_0x3e299b[_0xaa04('0x4f')]);var _0x5af572={'where':_0x11ad62[_0xaa04('0x4b')]};return db[_0xaa04('0x3d')][_0xaa04('0x31')](_0x5af572)[_0xaa04('0x23')](function(_0x3a5a3a){_0x1df129[_0xaa04('0x31')]=_0x3a5a3a;if(_0x3e299b[_0xaa04('0x43')][_0xaa04('0x50')]){_0x11ad62['include']=[{'all':!![]}];}return db[_0xaa04('0x3d')][_0xaa04('0x51')](_0x11ad62);})[_0xaa04('0x23')](function(_0x2c0937){_0x1df129[_0xaa04('0x52')]=_0x2c0937;return _0x1df129;})[_0xaa04('0x23')](respondWithFilteredResult(_0x3cc83b,_0x11ad62))['catch'](handleError(_0x3cc83b,null));};exports[_0xaa04('0x53')]=function(_0x2759b6,_0x439efe){var _0x4b21d3={'raw':!![],'where':{'id':_0x2759b6[_0xaa04('0x54')]['id']}},_0x376912={};_0x376912[_0xaa04('0x42')]=_['keys'](db[_0xaa04('0x3d')][_0xaa04('0x3e')]);_0x376912[_0xaa04('0x43')]=_[_0xaa04('0x55')](_0x2759b6['query']);_0x376912[_0xaa04('0x44')]=_[_0xaa04('0x45')](_0x376912[_0xaa04('0x42')],_0x376912[_0xaa04('0x43')]);_0x4b21d3[_0xaa04('0x46')]=_[_0xaa04('0x45')](_0x376912[_0xaa04('0x42')],qs[_0xaa04('0x56')](_0x2759b6[_0xaa04('0x43')][_0xaa04('0x56')]));_0x4b21d3['attributes']=_0x4b21d3[_0xaa04('0x46')][_0xaa04('0x47')]?_0x4b21d3['attributes']:_0x376912['model'];if(_0x2759b6[_0xaa04('0x43')][_0xaa04('0x50')]){_0x4b21d3[_0xaa04('0x57')]=[{'all':!![]}];}_0x4b21d3=_[_0xaa04('0x4e')]({},_0x4b21d3,_0x2759b6[_0xaa04('0x4f')]);return db[_0xaa04('0x3d')][_0xaa04('0x58')](_0x4b21d3)[_0xaa04('0x23')](handleEntityNotFound(_0x439efe,null))[_0xaa04('0x23')](respondWithResult(_0x439efe,null))[_0xaa04('0x2b')](handleError(_0x439efe,null));};exports[_0xaa04('0x59')]=function(_0x5e23f1,_0x33f7e3){return db[_0xaa04('0x3d')][_0xaa04('0x59')](_0x5e23f1[_0xaa04('0x5a')],{})[_0xaa04('0x23')](respondWithResult(_0x33f7e3,0xc9))[_0xaa04('0x2b')](handleError(_0x33f7e3,null));};exports[_0xaa04('0x34')]=function(_0x386d64,_0x3708f0){if(_0x386d64[_0xaa04('0x5a')]['id']){delete _0x386d64['body']['id'];}return db[_0xaa04('0x3d')][_0xaa04('0x58')]({'where':{'id':_0x386d64['params']['id']}})[_0xaa04('0x23')](handleEntityNotFound(_0x3708f0,null))[_0xaa04('0x23')](saveUpdates(_0x386d64[_0xaa04('0x5a')],null))[_0xaa04('0x23')](respondWithResult(_0x3708f0,null))['catch'](handleError(_0x3708f0,null));};exports[_0xaa04('0x35')]=function(_0x371d73,_0x3c4fa7){return db[_0xaa04('0x3d')][_0xaa04('0x58')]({'where':{'id':_0x371d73[_0xaa04('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c4fa7,null))[_0xaa04('0x23')](removeEntity(_0x3c4fa7,null))['catch'](handleError(_0x3c4fa7,null));};exports[_0xaa04('0x5b')]=function(_0x505c71,_0x3543b0){return db[_0xaa04('0x3d')][_0xaa04('0x5b')]()[_0xaa04('0x23')](respondWithResult(_0x3543b0,null))[_0xaa04('0x2b')](handleError(_0x3543b0,null));};var interaction_log=require('../../config/logger')(_0xaa04('0x5c'));exports[_0xaa04('0x5d')]=function(_0x9b8291,_0x20313d,_0x2d9208){var _0x230a08={'agent':{},'channel':_0xaa04('0x5e')};if(_0x9b8291[_0xaa04('0x5a')]['id']){delete _0x9b8291[_0xaa04('0x5a')]['id'];}_0x9b8291['body'][_0xaa04('0x5f')]=!![];_0x9b8291['body'][_0xaa04('0x60')]=moment()[_0xaa04('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')]=_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')]||_0x9b8291[_0xaa04('0x63')]['id'];_0x230a08[_0xaa04('0x64')]['id']=_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')];return db[_0xaa04('0x3d')]['find']({'where':{'id':_0x9b8291[_0xaa04('0x54')]['id'],'UserId':null}})[_0xaa04('0x23')](handleEntityNotFound(_0x20313d,null))[_0xaa04('0x23')](saveUpdates(_0x9b8291[_0xaa04('0x5a')],null))[_0xaa04('0x23')](function(_0x484268){if(_0x484268){_0x230a08['message']=_0x484268[_0xaa04('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0xaa04('0x58')]({'where':{'id':_0x484268[_0xaa04('0x66')]}});}return null;})[_0xaa04('0x23')](handleEntityNotFound(_0x20313d,null))['then'](function(_0x132bd4){if(_0x132bd4){return _0x132bd4[_0xaa04('0x34')]({'UserId':_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')],'read1stAt':_['isNil'](_0x132bd4[_0xaa04('0x67')])?moment()[_0xaa04('0x61')](_0xaa04('0x68')):undefined});}return null;})[_0xaa04('0x23')](function(_0x5b1b69){if(_0x5b1b69){_0x230a08['interaction']=_0x5b1b69[_0xaa04('0x65')]({'plain':!![]});interaction_log[_0xaa04('0x24')](_0xaa04('0x69'),_0x9b8291[_0xaa04('0x63')]['id'],_0x9b8291[_0xaa04('0x63')][_0xaa04('0x39')],_0x9b8291[_0xaa04('0x63')][_0xaa04('0x6a')],_0x230a08['interaction']['id'],_0x9b8291[_0xaa04('0x5a')]?JSON[_0xaa04('0x27')](_0x9b8291['body']):_0xaa04('0x6b'));return respondWithRpcPromise(_0xaa04('0x6c'),_0xaa04('0x6d'),_0x230a08);}return null;})['then'](function(_0x3e35c5){var _0x2160a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e35c5['message'][_0xaa04('0x6e')];return db[_0xaa04('0x6f')][_0xaa04('0x43')](_0x2160a3,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xaa04('0x23')](function(_0x3e22ad){return _0x3e22ad;});})[_0xaa04('0x23')](function(_0x1f7434){if(_0x1f7434){_0x230a08[_0xaa04('0x2a')][_0xaa04('0x70')]=_0x1f7434[0x0];if(!_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')])return;return db[_0xaa04('0x71')][_0xaa04('0x58')]({'where':{'id':_0x9b8291[_0xaa04('0x5a')][_0xaa04('0x62')],'role':_0xaa04('0x64')},'attributes':['id',_0xaa04('0x39'),_0xaa04('0x72'),_0xaa04('0x73'),_0xaa04('0x74')],'raw':!![]});}return null;})[_0xaa04('0x23')](function(_0x493ad7){if(!_0x493ad7)return null;_0x230a08[_0xaa04('0x2a')][_0xaa04('0x64')]=_0x493ad7;return _0x230a08;})['then'](function(_0x60d290){if(_0x60d290){if(_0x9b8291['body']['manual']){_0x230a08[_0xaa04('0x2a')][_0xaa04('0x75')]=util['format'](_0xaa04('0x76'),_0x9b8291[_0xaa04('0x63')][_0xaa04('0x39')]);_0x230a08['message'][_0xaa04('0x77')]=_0x230a08['channel'];_0x230a08[_0xaa04('0x2a')]['motionChannel']=_0x230a08[_0xaa04('0x77')];_0x230a08[_0xaa04('0x2a')][_0xaa04('0x78')]='accept';return respondWithRpcPromise(_0xaa04('0x79'),_0xaa04('0x79'),{'event':'acceptmessage','message':_0x230a08[_0xaa04('0x2a')]},client9002)[_0xaa04('0x23')](function(){return _0x230a08;});}return _0x230a08;}return null;})[_0xaa04('0x23')](respondWithResult(_0x20313d,null))[_0xaa04('0x2b')](handleError(_0x20313d,null));};var interaction_log=require('../../config/logger')(_0xaa04('0x5c'));exports[_0xaa04('0x7a')]=function(_0x43a384,_0x5efc1f,_0x51535e){var _0x35695f={'agent':{},'channel':_0xaa04('0x5e')};if(_0x43a384[_0xaa04('0x5a')]['id']){delete _0x43a384['body']['id'];}_0x43a384[_0xaa04('0x5a')][_0xaa04('0x62')]=_0x43a384[_0xaa04('0x5a')][_0xaa04('0x62')]||_0x43a384['user']['id'];_0x35695f[_0xaa04('0x64')]['id']=_0x43a384[_0xaa04('0x5a')][_0xaa04('0x62')];return db[_0xaa04('0x3d')][_0xaa04('0x58')]({'where':{'id':_0x43a384['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5efc1f,null))['then'](function(_0x1a965b){if(_0x1a965b){_0x35695f[_0xaa04('0x2a')]=_0x1a965b[_0xaa04('0x65')]({'plain':!![]});return db[_0xaa04('0x7b')]['find']({'where':{'id':_0x1a965b[_0xaa04('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5efc1f,null))[_0xaa04('0x23')](function(_0x7ca388){if(_0x7ca388){_0x35695f[_0xaa04('0x7c')]=_0x7ca388[_0xaa04('0x65')]({'plain':!![]});interaction_log[_0xaa04('0x24')](_0xaa04('0x7d'),_0x43a384[_0xaa04('0x63')]['id'],_0x43a384[_0xaa04('0x63')][_0xaa04('0x39')],_0x43a384[_0xaa04('0x63')][_0xaa04('0x6a')],_0x35695f[_0xaa04('0x7c')]['id'],_0x43a384[_0xaa04('0x5a')]?JSON[_0xaa04('0x27')](_0x43a384[_0xaa04('0x5a')]):_0xaa04('0x6b'));return respondWithRpcPromise(_0xaa04('0x7e'),_0xaa04('0x7f'),_0x35695f);}return null;})[_0xaa04('0x23')](function(_0x1e633d){var _0x3a203f=_0xaa04('0x80')+_0x1e633d['message'][_0xaa04('0x6e')];return db[_0xaa04('0x6f')][_0xaa04('0x43')](_0x3a203f,{'type':db[_0xaa04('0x81')][_0xaa04('0x82')][_0xaa04('0x83')],'raw':!![]})[_0xaa04('0x23')](function(_0x220d4c){return _0x220d4c;});})[_0xaa04('0x23')](function(_0x4c1756){if(_0x4c1756){_0x35695f[_0xaa04('0x2a')][_0xaa04('0x70')]=_0x4c1756[0x0];if(!_0x43a384['body'][_0xaa04('0x62')])return;return db[_0xaa04('0x71')][_0xaa04('0x58')]({'where':{'id':_0x43a384[_0xaa04('0x5a')][_0xaa04('0x62')],'role':_0xaa04('0x64')},'attributes':['id',_0xaa04('0x39'),_0xaa04('0x72'),_0xaa04('0x73'),_0xaa04('0x74')],'raw':!![]});}return null;})[_0xaa04('0x23')](function(_0x30cd0b){if(!_0x30cd0b)return null;_0x35695f['message'][_0xaa04('0x64')]=_0x30cd0b;return _0x35695f;})['then'](function(_0x525a40){if(_0x525a40){_0x525a40['message'][_0xaa04('0x75')]=util[_0xaa04('0x61')](_0xaa04('0x76'),_0x43a384[_0xaa04('0x63')]['name']);_0x525a40[_0xaa04('0x2a')][_0xaa04('0x77')]=_0x35695f[_0xaa04('0x77')];_0x525a40[_0xaa04('0x2a')][_0xaa04('0x84')]=_0x35695f[_0xaa04('0x77')];_0x525a40['message'][_0xaa04('0x78')]=_0xaa04('0x7a');respondWithRpcPromise(_0xaa04('0x79'),'EventManager',{'event':_0xaa04('0x85'),'message':_0x525a40[_0xaa04('0x2a')]},client9002);return _0x35695f;}return null;})[_0xaa04('0x23')](respondWithResult(_0x5efc1f,null))['catch'](handleError(_0x5efc1f,null));};exports[_0xaa04('0x2c')]=function(_0x41b755,_0x3e506e,_0x102720){if(_0x41b755['body']['id']){delete _0x41b755[_0xaa04('0x5a')]['id'];}var _0x350d5e;return db[_0xaa04('0x3d')]['find']({'where':{'id':_0x41b755[_0xaa04('0x54')]['id']}})[_0xaa04('0x23')](handleEntityNotFound(_0x3e506e,null))[_0xaa04('0x23')](function(_0x31db82){if(_0x31db82){_0x350d5e=_0x31db82;return db['WhatsappAccount'][_0xaa04('0x58')]({'where':{'id':_0x31db82[_0xaa04('0x86')]}});}})['then'](handleEntityNotFound(_0x3e506e,null))[_0xaa04('0x23')](function(_0x1fed90){if(_0x1fed90){logger[_0xaa04('0x87')](_0xaa04('0x88'),_0xaa04('0x2c'),_0xaa04('0x89'),_0x1fed90[_0xaa04('0x40')],util['inspect'](_0x41b755[_0xaa04('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1fed90[_0xaa04('0x40')]){case _0xaa04('0x8a'):if(_0x41b755['body'][_0xaa04('0x8b')]&&_0x41b755['body']['MessageSid']===_0x350d5e[_0xaa04('0x8c')]&&_0x41b755['body'][_0xaa04('0x8d')]&&_0x41b755[_0xaa04('0x5a')][_0xaa04('0x8d')]==='read'){return _0x350d5e['update']({'read':!![]});}else{logger[_0xaa04('0x28')](_0xaa04('0x8e'),_0xaa04('0x2c'),_0xaa04('0x8a'),util['inspect'](_0x41b755['body'],{'showHidden':![],'depth':null}));}break;}return _0x350d5e;}})[_0xaa04('0x23')](respondWithResult(_0x3e506e,null))[_0xaa04('0x2b')](handleError(_0x3e506e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 8a4d011..71bdc0e 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 _0xde2c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xde2c,0x7f));var _0xcde2=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0xde2c[_0x296144];return _0x5329b1;};'use strict';var EventEmitter=require(_0xcde2('0x0'));var WhatsappMessage=require(_0xcde2('0x1'))['db'][_0xcde2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcde2('0x3')](0x0);var events={'afterCreate':_0xcde2('0x4'),'afterUpdate':_0xcde2('0x5'),'afterDestroy':_0xcde2('0x6')};function emitEvent(_0x3a309f){return function(_0x55c175,_0x4353c8,_0x196898){WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f+':'+_0x55c175['id'],_0x55c175);WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f,_0x55c175);_0x196898(null);};}for(var e in events){if(events[_0xcde2('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xcde2('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0xac4a=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hook','events'];(function(_0x26e7be,_0x1032e5){var _0x51120d=function(_0x43d99e){while(--_0x43d99e){_0x26e7be['push'](_0x26e7be['shift']());}};_0x51120d(++_0x1032e5);}(_0xac4a,0x13f));var _0xaac4=function(_0x55d1f1,_0x1d2483){_0x55d1f1=_0x55d1f1-0x0;var _0x40f2ce=_0xac4a[_0x55d1f1];return _0x40f2ce;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var WhatsappMessage=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){WhatsappMessageEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);WhatsappMessageEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1a7b85f..cd00689 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 _0xfd92=['path','rimraf','exports','WhatsappMessage','messageId','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','catch','find','WhatsappAccountId','type','authToken','phone','accountSid','messages','remote','token','then','sid','update','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0xbc0377,_0x16d211){var _0x5d9e4c=function(_0xaed795){while(--_0xaed795){_0xbc0377['push'](_0xbc0377['shift']());}};_0x5d9e4c(++_0x16d211);}(_0xfd92,0x1a3));var _0x2fd9=function(_0x56cc28,_0x4a921e){_0x56cc28=_0x56cc28-0x0;var _0x1f5798=_0xfd92[_0x56cc28];return _0x1f5798;};'use strict';var _=require('lodash');var util=require(_0x2fd9('0x0'));var logger=require(_0x2fd9('0x1'))(_0x2fd9('0x2'));var moment=require(_0x2fd9('0x3'));var BPromise=require('bluebird');var rp=require(_0x2fd9('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x2fd9('0x5'));var rimraf=require(_0x2fd9('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x2fd9('0x7')]=function(_0x11a7bc,_0xc03f1a){return _0x11a7bc['define'](_0x2fd9('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2fd9('0x9')]},{'name':'fti_whatsapp_messages','fields':[_0x2fd9('0xa')],'type':_0x2fd9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ba398,_0x5018a9,_0x3d7d41){var _0x501f4e=_0x11a7bc['models'];var _0x25553a=_0x5ba398['get']({'plain':!![]});if(_0x25553a[_0x2fd9('0xc')][_0x2fd9('0xd')]()==='in'||_0x25553a[_0x2fd9('0xc')][_0x2fd9('0xd')]()===_0x2fd9('0xe')&&!_0x25553a[_0x2fd9('0xf')]&&!_[_0x2fd9('0x10')](_0x25553a[_0x2fd9('0x11')])){_0x501f4e[_0x2fd9('0x12')][_0x2fd9('0x13')]({'where':{'id':_0x25553a[_0x2fd9('0x14')]}})['then'](function(_0x332aae){if(_0x332aae){_0x332aae['update']({'lastMsgAt':_0x25553a[_0x2fd9('0x15')],'lastMsgDirection':_0x25553a[_0x2fd9('0xc')][_0x2fd9('0xd')]()});}})[_0x2fd9('0x16')](function(_0x49ef60){console['error'](_0x49ef60);});}if(_0x25553a[_0x2fd9('0xc')]===_0x2fd9('0xe')&&!_0x25553a['secret']){var _0x55d93e;_0x501f4e['WhatsappAccount'][_0x2fd9('0x17')]({'where':{'id':_0x25553a[_0x2fd9('0x18')]},'raw':!![]})['then'](function(_0x171d64){_0x55d93e=_0x171d64;if(_0x55d93e&&_0x55d93e[_0x2fd9('0x19')]){switch(_0x55d93e[_0x2fd9('0x19')]){case'twilio':var _0x1eaf05=require('twilio');if(_0x55d93e['accountSid']&&_0x55d93e[_0x2fd9('0x1a')]&&_0x55d93e[_0x2fd9('0x1b')]){var _0x402cd3=new _0x1eaf05(_0x55d93e[_0x2fd9('0x1c')],_0x55d93e[_0x2fd9('0x1a')]);_0x402cd3[_0x2fd9('0x1d')]['create']({'body':_0x25553a[_0x2fd9('0xa')],'to':'whatsapp:'+_0x25553a['phone'],'from':'whatsapp:'+_0x55d93e[_0x2fd9('0x1b')],'statusCallback':_0x55d93e[_0x2fd9('0x1e')]+'/api/whatsapp/messages/'+_0x25553a['id']+'/status?token='+_0x55d93e[_0x2fd9('0x1f')]})[_0x2fd9('0x20')](function(_0xc1300){if(_0xc1300[_0x2fd9('0x21')]){return _0x5ba398[_0x2fd9('0x22')]({'messageId':_0xc1300[_0x2fd9('0x21')]});}})[_0x2fd9('0x16')](function(_0xae1825){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2fd9('0x23'),'twilio',util[_0x2fd9('0x24')](_0xae1825,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2fd9('0x25'),_0x2fd9('0x23'),_0x2fd9('0x26'),_0x2fd9('0x27'));}break;case _0x2fd9('0x28'):var _0x4faf68=_0x55d93e[_0x2fd9('0x1c')];var _0x5ae8d7=_0x55d93e[_0x2fd9('0x1a')];var _0x3f862f=_0x55d93e[_0x2fd9('0x29')]+'/whatsapp/v1/'+_0x4faf68+_0x2fd9('0x2a');var _0x2a587f={'to':[_0x25553a['phone']],'message':{'type':_0x2fd9('0x2b'),'text':_0x25553a['body']}};var _0x1aee15={'method':_0x2fd9('0x2c'),'uri':_0x3f862f,'headers':{'Authorization':_0x2fd9('0x2d')+_0x5ae8d7,'Content-Type':_0x2fd9('0x2e')},'body':_0x2a587f,'json':!![]};rp(_0x1aee15)['then'](function(_0x1d4822){if(_0x1d4822['statuses'][0x0][_0x2fd9('0x2f')]){return _0x5ba398['update']({'messageId':_0x1d4822[_0x2fd9('0x30')][0x0][_0x2fd9('0x2f')]});}})['catch'](function(_0x58b8e3){logger[_0x2fd9('0x31')](_0x2fd9('0x32'),_0x58b8e3);});break;}}})[_0x2fd9('0x33')](function(){_0x3d7d41();});}else{_0x3d7d41();}}},'charset':'utf8mb4','collate':_0x2fd9('0x34')});}; \ No newline at end of file +var _0xb3e9=['body','FULLTEXT','get','toLowerCase','direction','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','find','WhatsappAccountId','type','twilio','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','exports','WhatsappMessage','messageId','fti_whatsapp_messages'];(function(_0x111eb4,_0x3819b3){var _0x5afadf=function(_0x25ea02){while(--_0x25ea02){_0x111eb4['push'](_0x111eb4['shift']());}};_0x5afadf(++_0x3819b3);}(_0xb3e9,0x1eb));var _0x9b3e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb3e9[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x9b3e('0x0'));var util=require('util');var logger=require(_0x9b3e('0x1'))(_0x9b3e('0x2'));var moment=require(_0x9b3e('0x3'));var BPromise=require(_0x9b3e('0x4'));var rp=require(_0x9b3e('0x5'));var fetch=require(_0x9b3e('0x6'));var fs=require('fs');var path=require(_0x9b3e('0x7'));var rimraf=require('rimraf');var config=require(_0x9b3e('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x9b3e('0x9')]=function(_0x5dd905,_0x4ef2b1){return _0x5dd905['define'](_0x9b3e('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9b3e('0xb')]},{'name':_0x9b3e('0xc'),'fields':[_0x9b3e('0xd')],'type':_0x9b3e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a0e7d,_0x23f23d,_0x496f4d){var _0x58eed8=_0x5dd905['models'];var _0x2e51bf=_0x2a0e7d[_0x9b3e('0xf')]({'plain':!![]});if(_0x2e51bf['direction'][_0x9b3e('0x10')]()==='in'||_0x2e51bf[_0x9b3e('0x11')][_0x9b3e('0x10')]()===_0x9b3e('0x12')&&!_0x2e51bf[_0x9b3e('0x13')]&&!_['isNil'](_0x2e51bf['UserId'])){_0x58eed8[_0x9b3e('0x14')][_0x9b3e('0x15')]({'where':{'id':_0x2e51bf[_0x9b3e('0x16')]}})[_0x9b3e('0x17')](function(_0x82ec8d){if(_0x82ec8d){_0x82ec8d[_0x9b3e('0x18')]({'lastMsgAt':_0x2e51bf[_0x9b3e('0x19')],'lastMsgDirection':_0x2e51bf[_0x9b3e('0x11')][_0x9b3e('0x10')]()});}})[_0x9b3e('0x1a')](function(_0x2a98ec){console[_0x9b3e('0x1b')](_0x2a98ec);});}if(_0x2e51bf[_0x9b3e('0x11')]===_0x9b3e('0x12')&&!_0x2e51bf[_0x9b3e('0x13')]){var _0x3d4f63;_0x58eed8['WhatsappAccount'][_0x9b3e('0x1c')]({'where':{'id':_0x2e51bf[_0x9b3e('0x1d')]},'raw':!![]})[_0x9b3e('0x17')](function(_0x5f11c6){_0x3d4f63=_0x5f11c6;if(_0x3d4f63&&_0x3d4f63[_0x9b3e('0x1e')]){switch(_0x3d4f63[_0x9b3e('0x1e')]){case _0x9b3e('0x1f'):var _0x5dc76f=require(_0x9b3e('0x1f'));if(_0x3d4f63['accountSid']&&_0x3d4f63[_0x9b3e('0x20')]&&_0x3d4f63[_0x9b3e('0x21')]){var _0x2c9c1f=new _0x5dc76f(_0x3d4f63['accountSid'],_0x3d4f63['authToken']);_0x2c9c1f[_0x9b3e('0x22')][_0x9b3e('0x23')]({'body':_0x2e51bf[_0x9b3e('0xd')],'to':_0x9b3e('0x24')+_0x2e51bf['phone'],'from':_0x9b3e('0x24')+_0x3d4f63[_0x9b3e('0x21')],'statusCallback':_0x3d4f63[_0x9b3e('0x25')]+'/api/whatsapp/messages/'+_0x2e51bf['id']+_0x9b3e('0x26')+_0x3d4f63[_0x9b3e('0x27')]})[_0x9b3e('0x17')](function(_0x2d9ed8){if(_0x2d9ed8[_0x9b3e('0x28')]){return _0x2a0e7d['update']({'messageId':_0x2d9ed8[_0x9b3e('0x28')]});}})['catch'](function(_0x3f1c42){logger[_0x9b3e('0x1b')](_0x9b3e('0x29'),'afterCreate',_0x9b3e('0x1f'),util[_0x9b3e('0x2a')](_0x3f1c42,{'showHidden':![],'depth':null}));});}else{logger[_0x9b3e('0x1b')](_0x9b3e('0x29'),'afterCreate',_0x9b3e('0x1f'),_0x9b3e('0x2b'));}break;case _0x9b3e('0x2c'):var _0x4be9c1=_0x3d4f63[_0x9b3e('0x2d')];var _0x5b2fb1=_0x3d4f63[_0x9b3e('0x20')];var _0x32133b=_0x3d4f63['baseUrl']+_0x9b3e('0x2e')+_0x4be9c1+_0x9b3e('0x2f');var _0x336a2f={'to':[_0x2e51bf[_0x9b3e('0x21')]],'message':{'type':_0x9b3e('0x30'),'text':_0x2e51bf['body']}};var _0x58ca61={'method':'POST','uri':_0x32133b,'headers':{'Authorization':_0x9b3e('0x31')+_0x5b2fb1,'Content-Type':_0x9b3e('0x32')},'body':_0x336a2f,'json':!![]};rp(_0x58ca61)[_0x9b3e('0x17')](function(_0x4e858c){if(_0x4e858c[_0x9b3e('0x33')][0x0][_0x9b3e('0x34')]){return _0x2a0e7d['update']({'messageId':_0x4e858c['statuses'][0x0][_0x9b3e('0x34')]});}})['catch'](function(_0x4448be){logger['err'](_0x9b3e('0x35'),_0x4448be);});break;}}})[_0x9b3e('0x36')](function(){_0x496f4d();});}else{_0x496f4d();}}},'charset':'utf8mb4','collate':_0x9b3e('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 9450fe1..4227777 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 _0xd963=['WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','then','stringify','lodash','util','moment','bluebird','ioredis','rpc','client','http','defaults','socket.io-emitter','redis','./whatsappMessage.socket','register','info'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xd963,0xda));var _0x3d96=function(_0x214642,_0xc9fac6){_0x214642=_0x214642-0x0;var _0x4ec937=_0xd963[_0x214642];return _0x4ec937;};'use strict';var _=require(_0x3d96('0x0'));var util=require(_0x3d96('0x1'));var moment=require(_0x3d96('0x2'));var BPromise=require(_0x3d96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d96('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d96('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d96('0x6')][_0x3d96('0x7')]({'port':0x232a});config['redis']=_[_0x3d96('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d96('0x9'))(new Redis(config[_0x3d96('0xa')]));require(_0x3d96('0xb'))[_0x3d96('0xc')](socket);function respondWithRpcPromise(_0x39b6e8,_0x18e9c0,_0x2baf08){return new BPromise(function(_0x46d808,_0x755a38){return client['request'](_0x39b6e8,_0x2baf08)['then'](function(_0x4ec46d){logger[_0x3d96('0xd')](_0x3d96('0xe'),_0x18e9c0,'request\x20sent');logger[_0x3d96('0xf')](_0x3d96('0x10'),_0x18e9c0,_0x3d96('0x11'),JSON['stringify'](_0x4ec46d));if(_0x4ec46d['error']){if(_0x4ec46d[_0x3d96('0x12')]['code']===0x1f4){logger[_0x3d96('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x18e9c0,_0x4ec46d[_0x3d96('0x12')][_0x3d96('0x13')]);return _0x755a38(_0x4ec46d[_0x3d96('0x12')][_0x3d96('0x13')]);}logger[_0x3d96('0x12')](_0x3d96('0xe'),_0x18e9c0,_0x4ec46d['error'][_0x3d96('0x13')]);return _0x46d808(_0x4ec46d['error'][_0x3d96('0x13')]);}else{logger[_0x3d96('0xd')](_0x3d96('0xe'),_0x18e9c0,_0x3d96('0x11'));_0x46d808(_0x4ec46d[_0x3d96('0x14')][_0x3d96('0x13')]);}})[_0x3d96('0x15')](function(_0x2c4d25){logger[_0x3d96('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x18e9c0,_0x2c4d25);_0x755a38(_0x2c4d25);});});}exports[_0x3d96('0x16')]=function(_0x16c6ea){var _0x160376=this;return new Promise(function(_0x42a02c,_0x182420){return db[_0x3d96('0x17')][_0x3d96('0x18')](_0x16c6ea[_0x3d96('0x19')],{'raw':_0x16c6ea[_0x3d96('0x1a')]?_0x16c6ea[_0x3d96('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3d96('0x1b')](function(_0x47e2b3){logger[_0x3d96('0xd')](_0x3d96('0x16'),_0x16c6ea);logger[_0x3d96('0xf')]('CreateWhatsappMessage',_0x16c6ea,JSON[_0x3d96('0x1c')](_0x47e2b3));_0x42a02c(_0x47e2b3);})[_0x3d96('0x15')](function(_0x4f539b){logger['error'](_0x3d96('0x16'),_0x4f539b[_0x3d96('0x13')],_0x16c6ea);_0x182420(_0x160376['error'](0x1f4,_0x4f539b[_0x3d96('0x13')]));});});}; \ No newline at end of file +var _0xed62=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','info','request\x20sent','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','debug','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xed62,0x17b));var _0x2ed6=function(_0x2b40ac,_0x123891){_0x2b40ac=_0x2b40ac-0x0;var _0x5d0df6=_0xed62[_0x2b40ac];return _0x5d0df6;};'use strict';var _=require(_0x2ed6('0x0'));var util=require(_0x2ed6('0x1'));var moment=require(_0x2ed6('0x2'));var BPromise=require(_0x2ed6('0x3'));var rs=require(_0x2ed6('0x4'));var fs=require('fs');var Redis=require(_0x2ed6('0x5'));var db=require(_0x2ed6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ed6('0x7'))(_0x2ed6('0x8'));var config=require(_0x2ed6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2ed6('0xa')]({'port':0x232a});config[_0x2ed6('0xb')]=_[_0x2ed6('0xc')](config[_0x2ed6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ed6('0xd'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x2ed6('0xe')](socket);function respondWithRpcPromise(_0xee3b9,_0x39f2bc,_0x41beee){return new BPromise(function(_0x2c4eef,_0x2feb89){return client[_0x2ed6('0xf')](_0xee3b9,_0x41beee)['then'](function(_0x15dbc6){logger[_0x2ed6('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x39f2bc,_0x2ed6('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x39f2bc,_0x2ed6('0x11'),JSON['stringify'](_0x15dbc6));if(_0x15dbc6[_0x2ed6('0x12')]){if(_0x15dbc6[_0x2ed6('0x12')][_0x2ed6('0x13')]===0x1f4){logger[_0x2ed6('0x12')](_0x2ed6('0x14'),_0x39f2bc,_0x15dbc6[_0x2ed6('0x12')][_0x2ed6('0x15')]);return _0x2feb89(_0x15dbc6[_0x2ed6('0x12')]['message']);}logger[_0x2ed6('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x39f2bc,_0x15dbc6[_0x2ed6('0x12')][_0x2ed6('0x15')]);return _0x2c4eef(_0x15dbc6['error']['message']);}else{logger[_0x2ed6('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x39f2bc,_0x2ed6('0x11'));_0x2c4eef(_0x15dbc6[_0x2ed6('0x16')][_0x2ed6('0x15')]);}})['catch'](function(_0x46b9ee){logger[_0x2ed6('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x39f2bc,_0x46b9ee);_0x2feb89(_0x46b9ee);});});}exports[_0x2ed6('0x17')]=function(_0x5c56d4){var _0x27d966=this;return new Promise(function(_0x162466,_0x148ac5){return db[_0x2ed6('0x18')][_0x2ed6('0x19')](_0x5c56d4[_0x2ed6('0x1a')],{'raw':_0x5c56d4[_0x2ed6('0x1b')]?_0x5c56d4[_0x2ed6('0x1b')][_0x2ed6('0x1c')]===undefined?!![]:![]:!![]})[_0x2ed6('0x1d')](function(_0x13d60d){logger[_0x2ed6('0x10')](_0x2ed6('0x17'),_0x5c56d4);logger[_0x2ed6('0x1e')](_0x2ed6('0x17'),_0x5c56d4,JSON[_0x2ed6('0x1f')](_0x13d60d));_0x162466(_0x13d60d);})['catch'](function(_0x14262c){logger[_0x2ed6('0x12')]('CreateWhatsappMessage',_0x14262c[_0x2ed6('0x15')],_0x5c56d4);_0x148ac5(_0x27d966[_0x2ed6('0x12')](0x1f4,_0x14262c[_0x2ed6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2c3b28c..ea34070 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 _0xe64e=['remove','update','emit','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xe64e,0xde));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappMessageEvents=require(_0xee64('0x0'));var events=[_0xee64('0x1'),_0xee64('0x2'),_0xee64('0x3')];function createListener(_0x45b19d,_0x1e528a){return function(_0x2a73a4){_0x1e528a[_0xee64('0x4')](_0x45b19d,_0x2a73a4);};}function removeListener(_0x10888c,_0x3bdade){return function(){WhatsappMessageEvents['removeListener'](_0x10888c,_0x3bdade);};}exports[_0xee64('0x5')]=function(_0x3ae2a7){for(var _0x3ce741=0x0,_0x5ad5e1=events[_0xee64('0x6')];_0x3ce741<_0x5ad5e1;_0x3ce741++){var _0x4c5935=events[_0x3ce741];var _0x4fd1ec=createListener(_0xee64('0x7')+_0x4c5935,_0x3ae2a7);WhatsappMessageEvents['on'](_0x4c5935,_0x4fd1ec);}}; \ No newline at end of file +var _0xe4f3=['whatsappMessage:','./whatsappMessage.events','save','remove','removeListener','register'];(function(_0x1e2586,_0x10c8d5){var _0x3c3640=function(_0x411af4){while(--_0x411af4){_0x1e2586['push'](_0x1e2586['shift']());}};_0x3c3640(++_0x10c8d5);}(_0xe4f3,0xa9));var _0x3e4f=function(_0x31537c,_0x5c66a8){_0x31537c=_0x31537c-0x0;var _0x3978d7=_0xe4f3[_0x31537c];return _0x3978d7;};'use strict';var WhatsappMessageEvents=require(_0x3e4f('0x0'));var events=[_0x3e4f('0x1'),_0x3e4f('0x2'),'update'];function createListener(_0x65c129,_0x10d074){return function(_0x5c8e71){_0x10d074['emit'](_0x65c129,_0x5c8e71);};}function removeListener(_0x3c8699,_0x4056a7){return function(){WhatsappMessageEvents[_0x3e4f('0x3')](_0x3c8699,_0x4056a7);};}exports[_0x3e4f('0x4')]=function(_0x46f695){for(var _0x199a01=0x0,_0x3d1628=events['length'];_0x199a01<_0x3d1628;_0x199a01++){var _0x5de957=events[_0x199a01];var _0x35b111=createListener(_0x3e4f('0x5')+_0x5de957,_0x46f695);WhatsappMessageEvents['on'](_0x5de957,_0x35b111);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index bc5d823..3cb5b30 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 _0x959f=['create','post','addAgents','put','update','delete','/:id','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x57fa5c,_0x22d1e7){var _0x270ebe=function(_0xf97a43){while(--_0xf97a43){_0x57fa5c['push'](_0x57fa5c['shift']());}};_0x270ebe(++_0x22d1e7);}(_0x959f,0x8b));var _0xf959=function(_0x29d954,_0x7cd87e){_0x29d954=_0x29d954-0x0;var _0x516d75=_0x959f[_0x29d954];return _0x516d75;};'use strict';var multer=require(_0xf959('0x0'));var util=require(_0xf959('0x1'));var path=require(_0xf959('0x2'));var timeout=require(_0xf959('0x3'));var express=require(_0xf959('0x4'));var router=express[_0xf959('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf959('0x6'));var controller=require('./whatsappQueue.controller');router[_0xf959('0x7')]('/',auth[_0xf959('0x8')](),controller[_0xf959('0x9')]);router[_0xf959('0x7')](_0xf959('0xa'),auth['isAuthenticated'](),controller[_0xf959('0xb')]);router[_0xf959('0x7')]('/:id',auth[_0xf959('0x8')](),controller[_0xf959('0xc')]);router[_0xf959('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xf959('0x7')](_0xf959('0xd'),auth[_0xf959('0x8')](),controller[_0xf959('0xe')]);router[_0xf959('0x7')](_0xf959('0xf'),auth[_0xf959('0x8')](),controller[_0xf959('0x10')]);router['post']('/',auth[_0xf959('0x8')](),controller[_0xf959('0x11')]);router['post']('/:id/teams',auth[_0xf959('0x8')](),controller['addTeams']);router[_0xf959('0x12')](_0xf959('0xf'),auth['isAuthenticated'](),controller[_0xf959('0x13')]);router[_0xf959('0x14')]('/:id',auth[_0xf959('0x8')](),controller[_0xf959('0x15')]);router[_0xf959('0x16')](_0xf959('0x17'),auth[_0xf959('0x8')](),controller[_0xf959('0x18')]);router[_0xf959('0x16')](_0xf959('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xf959('0x16')](_0xf959('0xf'),auth[_0xf959('0x8')](),controller[_0xf959('0x19')]);module['exports']=router; \ No newline at end of file +var _0x229d=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','put','update','destroy','delete','removeAgents','exports','multer'];(function(_0x3d9869,_0x277f44){var _0xb30206=function(_0x4beb00){while(--_0x4beb00){_0x3d9869['push'](_0x3d9869['shift']());}};_0xb30206(++_0x277f44);}(_0x229d,0xa7));var _0xd229=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x229d[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xd229('0x0'));var util=require(_0xd229('0x1'));var path=require(_0xd229('0x2'));var timeout=require('connect-timeout');var express=require(_0xd229('0x3'));var router=express[_0xd229('0x4')]();var fs_extra=require(_0xd229('0x5'));var auth=require(_0xd229('0x6'));var interaction=require(_0xd229('0x7'));var config=require(_0xd229('0x8'));var controller=require(_0xd229('0x9'));router[_0xd229('0xa')]('/',auth[_0xd229('0xb')](),controller[_0xd229('0xc')]);router['get']('/describe',auth[_0xd229('0xb')](),controller[_0xd229('0xd')]);router[_0xd229('0xa')](_0xd229('0xe'),auth[_0xd229('0xb')](),controller[_0xd229('0xf')]);router['get'](_0xd229('0x10'),auth[_0xd229('0xb')](),controller[_0xd229('0x11')]);router[_0xd229('0xa')](_0xd229('0x12'),auth[_0xd229('0xb')](),controller['getTeams']);router[_0xd229('0xa')](_0xd229('0x13'),auth[_0xd229('0xb')](),controller[_0xd229('0x14')]);router[_0xd229('0x15')]('/',auth[_0xd229('0xb')](),controller['create']);router[_0xd229('0x15')](_0xd229('0x12'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xd229('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xd229('0x16')](_0xd229('0xe'),auth['isAuthenticated'](),controller[_0xd229('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd229('0x18')]);router[_0xd229('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xd229('0x19')](_0xd229('0x13'),auth[_0xd229('0xb')](),controller[_0xd229('0x1a')]);module[_0xd229('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 bb4b8a5..a47eefa 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 _0xa477=['ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','exports','name','INTEGER'];(function(_0x3b35c9,_0x281b2a){var _0x75c9c3=function(_0x2d9d72){while(--_0x2d9d72){_0x3b35c9['push'](_0x3b35c9['shift']());}};_0x75c9c3(++_0x281b2a);}(_0xa477,0xe6));var _0x7a47=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa477[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x7a47('0x0'));module[_0x7a47('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7a47('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7a47('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7a47('0x4')](_0x7a47('0x5'),_0x7a47('0x6'),_0x7a47('0x7'))},'description':{'type':Sequelize[_0x7a47('0x8')]}}; \ No newline at end of file +var _0xba47=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xba47,0x1ac));var _0x7ba4=function(_0x43e894,_0x57330f){_0x43e894=_0x43e894-0x0;var _0x3c7c36=_0xba47[_0x43e894];return _0x3c7c36;};'use strict';var Sequelize=require(_0x7ba4('0x0'));module[_0x7ba4('0x1')]={'name':{'type':Sequelize[_0x7ba4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7ba4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7ba4('0x4')](_0x7ba4('0x5'),_0x7ba4('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x7ba4('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d12592c..2c85bde 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 _0xdc5b=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','userWhatsappQueue:remove','getAgents','eml-format','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc5b,0x85));var _0xbdc5=function(_0xc612b5,_0x5cee0){_0xc612b5=_0xc612b5-0x0;var _0x10b828=_0xdc5b[_0xc612b5];return _0x10b828;};'use strict';var emlformat=require(_0xbdc5('0x0'));var rimraf=require(_0xbdc5('0x1'));var zipdir=require(_0xbdc5('0x2'));var jsonpatch=require(_0xbdc5('0x3'));var rp=require(_0xbdc5('0x4'));var moment=require(_0xbdc5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbdc5('0x6'));var util=require(_0xbdc5('0x7'));var path=require(_0xbdc5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbdc5('0x9'));var fs=require('fs');var fs_extra=require(_0xbdc5('0xa'));var _=require(_0xbdc5('0xb'));var squel=require(_0xbdc5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdc5('0xd'));var toCsv=require(_0xbdc5('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbdc5('0xf'));var authService=require(_0xbdc5('0x10'));var qs=require(_0xbdc5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdc5('0x12'));var logger=require(_0xbdc5('0x13'))(_0xbdc5('0x14'));var utils=require('../../config/utils');var config=require(_0xbdc5('0x15'));var licenseUtil=require(_0xbdc5('0x16'));var db=require('../../mysqldb')['db'];config[_0xbdc5('0x17')]=_[_0xbdc5('0x18')](config[_0xbdc5('0x17')],{'host':_0xbdc5('0x19'),'port':0x18eb});var socket=require(_0xbdc5('0x1a'))(new Redis(config[_0xbdc5('0x17')]));require('./whatsappQueue.socket')[_0xbdc5('0x1b')](socket);function respondWithStatusCode(_0x1534e2,_0x12d21b){_0x12d21b=_0x12d21b||0xcc;return function(_0x5d2fcf){if(_0x5d2fcf){return _0x1534e2[_0xbdc5('0x1c')](_0x12d21b);}return _0x1534e2[_0xbdc5('0x1d')](_0x12d21b)[_0xbdc5('0x1e')]();};}function respondWithResult(_0x2e32f2,_0x307b33){_0x307b33=_0x307b33||0xc8;return function(_0x3dad17){if(_0x3dad17){return _0x2e32f2[_0xbdc5('0x1d')](_0x307b33)['json'](_0x3dad17);}};}function respondWithFilteredResult(_0x3c3ae9,_0x464399){return function(_0x1acb83){if(_0x1acb83){var _0x24fba7=typeof _0x464399[_0xbdc5('0x1f')]===_0xbdc5('0x20')&&typeof _0x464399[_0xbdc5('0x21')]===_0xbdc5('0x20');var _0x4b3fbe=_0x1acb83['count'];var _0x586485=_0x24fba7?0x0:_0x464399[_0xbdc5('0x1f')];var _0x28671b=_0x24fba7?_0x1acb83[_0xbdc5('0x22')]:_0x464399['offset']+_0x464399[_0xbdc5('0x21')];var _0x3a7653;if(_0x28671b>=_0x4b3fbe){_0x28671b=_0x4b3fbe;_0x3a7653=0xc8;}else{_0x3a7653=0xce;}_0x3c3ae9[_0xbdc5('0x1d')](_0x3a7653);return _0x3c3ae9['set'](_0xbdc5('0x23'),_0x586485+'-'+_0x28671b+'/'+_0x4b3fbe)['json'](_0x1acb83);}return null;};}function patchUpdates(_0x1c6e1f){return function(_0x528409){try{jsonpatch['apply'](_0x528409,_0x1c6e1f,!![]);}catch(_0x1afeef){return BPromise['reject'](_0x1afeef);}return _0x528409[_0xbdc5('0x24')]();};}function saveUpdates(_0x37104e,_0x2412e3){return function(_0x51ba72){if(_0x51ba72){return _0x51ba72[_0xbdc5('0x25')](_0x37104e)['then'](function(_0x4fc62b){return _0x4fc62b;});}return null;};}function removeEntity(_0xafccda,_0x30d9e1){return function(_0x5eff4c){if(_0x5eff4c){return _0x5eff4c[_0xbdc5('0x26')]()[_0xbdc5('0x27')](function(){var _0x19b41b=_0x5eff4c[_0xbdc5('0x28')]({'plain':!![]});var _0x9f8f27=_0xbdc5('0x29');return db[_0xbdc5('0x2a')][_0xbdc5('0x26')]({'where':{'type':_0x9f8f27,'resourceId':_0x19b41b['id']}})[_0xbdc5('0x27')](function(){return _0x5eff4c;});})[_0xbdc5('0x27')](function(){_0xafccda[_0xbdc5('0x1d')](0xcc)[_0xbdc5('0x1e')]();});}};}function handleEntityNotFound(_0x5250e0,_0x1d4f2b){return function(_0x7127b){if(!_0x7127b){_0x5250e0[_0xbdc5('0x1c')](0x194);}return _0x7127b;};}function handleError(_0x283a13,_0x39101f){_0x39101f=_0x39101f||0x1f4;return function(_0x42281f){logger[_0xbdc5('0x2b')](_0x42281f[_0xbdc5('0x2c')]);if(_0x42281f['name']){delete _0x42281f[_0xbdc5('0x2d')];}_0x283a13[_0xbdc5('0x1d')](_0x39101f)[_0xbdc5('0x2e')](_0x42281f);};}exports[_0xbdc5('0x2f')]=function(_0x2a5913,_0x22343d){var _0x478f28={},_0x5c0003={},_0x1b098b={'count':0x0,'rows':[]};var _0x483b6b=_[_0xbdc5('0x30')](db[_0xbdc5('0x31')][_0xbdc5('0x32')],function(_0x390c7f){return{'name':_0x390c7f[_0xbdc5('0x33')],'type':_0x390c7f[_0xbdc5('0x34')]['key']};});_0x5c0003[_0xbdc5('0x35')]=_[_0xbdc5('0x30')](_0x483b6b,'name');_0x5c0003[_0xbdc5('0x36')]=_[_0xbdc5('0x37')](_0x2a5913[_0xbdc5('0x36')]);_0x5c0003[_0xbdc5('0x38')]=_[_0xbdc5('0x39')](_0x5c0003['model'],_0x5c0003[_0xbdc5('0x36')]);_0x478f28[_0xbdc5('0x3a')]=_[_0xbdc5('0x39')](_0x5c0003[_0xbdc5('0x35')],qs['fields'](_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x3b')]));_0x478f28[_0xbdc5('0x3a')]=_0x478f28[_0xbdc5('0x3a')][_0xbdc5('0x3c')]?_0x478f28[_0xbdc5('0x3a')]:_0x5c0003[_0xbdc5('0x35')];if(!_0x2a5913['query'][_0xbdc5('0x3d')](_0xbdc5('0x3e'))){_0x478f28[_0xbdc5('0x21')]=qs[_0xbdc5('0x21')](_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x21')]);_0x478f28['offset']=qs[_0xbdc5('0x1f')](_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x1f')]);}_0x478f28[_0xbdc5('0x3f')]=qs['sort'](_0x2a5913['query'][_0xbdc5('0x40')]);_0x478f28[_0xbdc5('0x41')]=qs[_0xbdc5('0x38')](_[_0xbdc5('0x42')](_0x2a5913['query'],_0x5c0003['filters']),_0x483b6b);if(_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x43')]){_0x478f28[_0xbdc5('0x41')]=_[_0xbdc5('0x44')](_0x478f28['where'],{'$or':_[_0xbdc5('0x30')](_0x483b6b,function(_0x19dc58){if(_0x19dc58['type']!==_0xbdc5('0x45')){var _0x1bdc4a={};_0x1bdc4a[_0x19dc58[_0xbdc5('0x2d')]]={'$like':'%'+_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x43')]+'%'};return _0x1bdc4a;}})});}_0x478f28=_['merge']({},_0x478f28,_0x2a5913[_0xbdc5('0x46')]);var _0xc0ea01={'where':_0x478f28[_0xbdc5('0x41')]};return db[_0xbdc5('0x31')]['count'](_0xc0ea01)[_0xbdc5('0x27')](function(_0x2747a6){_0x1b098b[_0xbdc5('0x22')]=_0x2747a6;if(_0x2a5913[_0xbdc5('0x36')][_0xbdc5('0x47')]){_0x478f28[_0xbdc5('0x48')]=[{'all':!![]}];}return db[_0xbdc5('0x31')][_0xbdc5('0x49')](_0x478f28);})[_0xbdc5('0x27')](function(_0x37847b){_0x1b098b[_0xbdc5('0x4a')]=_0x37847b;return _0x1b098b;})[_0xbdc5('0x27')](respondWithFilteredResult(_0x22343d,_0x478f28))[_0xbdc5('0x4b')](handleError(_0x22343d,null));};exports['show']=function(_0x336fb8,_0x1b0938){var _0x4b58bd={'raw':!![],'where':{'id':_0x336fb8['params']['id']}},_0x134ef6={};_0x134ef6[_0xbdc5('0x35')]=_[_0xbdc5('0x37')](db[_0xbdc5('0x31')][_0xbdc5('0x32')]);_0x134ef6[_0xbdc5('0x36')]=_[_0xbdc5('0x37')](_0x336fb8['query']);_0x134ef6[_0xbdc5('0x38')]=_[_0xbdc5('0x39')](_0x134ef6[_0xbdc5('0x35')],_0x134ef6[_0xbdc5('0x36')]);_0x4b58bd['attributes']=_['intersection'](_0x134ef6['model'],qs[_0xbdc5('0x3b')](_0x336fb8[_0xbdc5('0x36')]['fields']));_0x4b58bd[_0xbdc5('0x3a')]=_0x4b58bd[_0xbdc5('0x3a')][_0xbdc5('0x3c')]?_0x4b58bd['attributes']:_0x134ef6[_0xbdc5('0x35')];if(_0x336fb8['query'][_0xbdc5('0x47')]){_0x4b58bd[_0xbdc5('0x48')]=[{'all':!![]}];}_0x4b58bd=_[_0xbdc5('0x44')]({},_0x4b58bd,_0x336fb8[_0xbdc5('0x46')]);return db[_0xbdc5('0x31')]['find'](_0x4b58bd)[_0xbdc5('0x27')](handleEntityNotFound(_0x1b0938,null))[_0xbdc5('0x27')](respondWithResult(_0x1b0938,null))[_0xbdc5('0x4b')](handleError(_0x1b0938,null));};exports[_0xbdc5('0x4c')]=function(_0xb1c87d,_0x5728e2){return db[_0xbdc5('0x31')][_0xbdc5('0x4c')](_0xb1c87d[_0xbdc5('0x4d')],{})[_0xbdc5('0x27')](function(_0x58a86d){var _0x40bce8=_0xb1c87d[_0xbdc5('0x4e')][_0xbdc5('0x28')]({'plain':!![]});if(!_0x40bce8)throw new Error(_0xbdc5('0x4f'));if(_0x40bce8['role']===_0xbdc5('0x4e')){var _0x32d215=_0x58a86d['get']({'plain':!![]});var _0x41b145=_0xbdc5('0x29');return db[_0xbdc5('0x50')]['find']({'where':{'name':_0x41b145,'userProfileId':_0x40bce8['userProfileId']},'raw':!![]})['then'](function(_0x3969a5){if(_0x3969a5&&_0x3969a5['autoAssociation']===0x0){return db[_0xbdc5('0x2a')][_0xbdc5('0x4c')]({'name':_0x32d215[_0xbdc5('0x2d')],'resourceId':_0x32d215['id'],'type':_0x3969a5[_0xbdc5('0x2d')],'sectionId':_0x3969a5['id']},{})[_0xbdc5('0x27')](function(){return _0x58a86d;});}else{return _0x58a86d;}})[_0xbdc5('0x4b')](function(_0x57d177){logger[_0xbdc5('0x2b')](_0xbdc5('0x51'),_0x57d177);throw _0x57d177;});}return _0x58a86d;})[_0xbdc5('0x27')](respondWithResult(_0x5728e2,0xc9))[_0xbdc5('0x4b')](handleError(_0x5728e2,null));};exports[_0xbdc5('0x25')]=function(_0x4515ed,_0x258473){if(_0x4515ed[_0xbdc5('0x4d')]['id']){delete _0x4515ed[_0xbdc5('0x4d')]['id'];}return db['WhatsappQueue'][_0xbdc5('0x52')]({'where':{'id':_0x4515ed['params']['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0x258473,null))['then'](saveUpdates(_0x4515ed[_0xbdc5('0x4d')],null))[_0xbdc5('0x27')](respondWithResult(_0x258473,null))['catch'](handleError(_0x258473,null));};exports['destroy']=function(_0x4e295a,_0x371030){return db['WhatsappQueue'][_0xbdc5('0x52')]({'where':{'id':_0x4e295a[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0x371030,null))['then'](removeEntity(_0x371030,null))[_0xbdc5('0x4b')](handleError(_0x371030,null));};exports['describe']=function(_0x200c73,_0x3d8d39){return db[_0xbdc5('0x31')][_0xbdc5('0x54')]()[_0xbdc5('0x27')](respondWithResult(_0x3d8d39,null))[_0xbdc5('0x4b')](handleError(_0x3d8d39,null));};exports[_0xbdc5('0x55')]=function(_0xa26cb4,_0xc588bd,_0x597de7){var _0x4034f8={'raw':!![],'where':{}},_0x2c8a05={},_0x311c92;return db[_0xbdc5('0x31')]['findOne']({'where':{'id':_0xa26cb4['params']['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0xc588bd,null))[_0xbdc5('0x27')](function(_0x4945f2){if(_0x4945f2){_0x311c92=_0x4945f2[_0xbdc5('0x28')]({'plain':!![]});_0x2c8a05[_0xbdc5('0x35')]=_['keys'](db[_0xbdc5('0x56')][_0xbdc5('0x32')]);_0x2c8a05['query']=_[_0xbdc5('0x37')](_0xa26cb4[_0xbdc5('0x36')]);_0x2c8a05[_0xbdc5('0x38')]=_[_0xbdc5('0x39')](_0x2c8a05[_0xbdc5('0x35')],_0x2c8a05['query']);_0x4034f8[_0xbdc5('0x3a')]=_[_0xbdc5('0x39')](_0x2c8a05[_0xbdc5('0x35')],qs[_0xbdc5('0x3b')](_0xa26cb4[_0xbdc5('0x36')][_0xbdc5('0x3b')]));_0x4034f8[_0xbdc5('0x3a')]=_0x4034f8['attributes'][_0xbdc5('0x3c')]?_0x4034f8[_0xbdc5('0x3a')]:_0x2c8a05[_0xbdc5('0x35')];if(!_0xa26cb4['query']['hasOwnProperty'](_0xbdc5('0x3e'))){_0x4034f8[_0xbdc5('0x21')]=qs['limit'](_0xa26cb4[_0xbdc5('0x36')][_0xbdc5('0x21')]);_0x4034f8['offset']=qs[_0xbdc5('0x1f')](_0xa26cb4[_0xbdc5('0x36')]['offset']);}_0x4034f8['order']=qs[_0xbdc5('0x40')](_0xa26cb4[_0xbdc5('0x36')][_0xbdc5('0x40')]);_0x4034f8[_0xbdc5('0x41')]=qs[_0xbdc5('0x38')](_[_0xbdc5('0x42')](_0xa26cb4[_0xbdc5('0x36')],_0x2c8a05[_0xbdc5('0x38')]));_0x4034f8[_0xbdc5('0x41')]['WhatsappQueueId']=_0x4945f2['id'];if(_0xa26cb4[_0xbdc5('0x36')][_0xbdc5('0x43')]){_0x4034f8[_0xbdc5('0x41')]=_['merge'](_0x4034f8[_0xbdc5('0x41')],{'$or':_[_0xbdc5('0x30')](_0x4034f8['attributes'],function(_0x11953d){var _0x3fe487={};_0x3fe487[_0x11953d]={'$like':'%'+_0xa26cb4[_0xbdc5('0x36')][_0xbdc5('0x43')]+'%'};return _0x3fe487;})});}_0x4034f8=_[_0xbdc5('0x44')]({},_0x4034f8,_0xa26cb4[_0xbdc5('0x46')]);return db[_0xbdc5('0x56')]['findAll'](_0x4034f8);}})[_0xbdc5('0x27')](function(_0x20f55c){if(_0x20f55c){return db[_0xbdc5('0x57')][_0xbdc5('0x58')]({'where':{'id':_[_0xbdc5('0x30')](_0x20f55c,_0xbdc5('0x59')),'role':_0xbdc5('0x5a')},'attributes':['id','name',_0xbdc5('0x5b'),_0xbdc5('0x5c'),_0xbdc5('0x5d')]});}})[_0xbdc5('0x27')](function(_0x4380b7){if(_0x4380b7){return{'count':_0x4380b7[_0xbdc5('0x22')],'rows':_[_0xbdc5('0x30')](_0x4380b7[_0xbdc5('0x4a')],function(_0xd84afe){return{'membername':_0xd84afe[_0xbdc5('0x2d')],'UserId':_0xd84afe['id'],'queue_name':_0x311c92['name'],'WhatsappQueueId':_0x311c92['id'],'interface':util[_0xbdc5('0x5e')](_0xbdc5('0x5f'),_0xbdc5('0x60'),_0xd84afe['name']),'penalty':0x0,'paused':_0xd84afe['whatsappPause'],'createdAt':_0xd84afe['createdAt'],'updatedAt':_0xd84afe['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdc5('0x27')](respondWithFilteredResult(_0xc588bd,_0x4034f8))[_0xbdc5('0x4b')](handleError(_0xc588bd,null));};exports['getTeams']=function(_0x4a350b,_0x105dfa,_0x3d9991){var _0x32f24c={};var _0x2eb717={};var _0x172e14;var _0x310448;return db[_0xbdc5('0x31')][_0xbdc5('0x61')]({'where':{'id':_0x4a350b['params']['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0x105dfa,null))[_0xbdc5('0x27')](function(_0x34c420){if(_0x34c420){_0x172e14=_0x34c420;_0x2eb717[_0xbdc5('0x35')]=_[_0xbdc5('0x37')](db[_0xbdc5('0x62')]['rawAttributes']);_0x2eb717[_0xbdc5('0x36')]=_[_0xbdc5('0x37')](_0x4a350b[_0xbdc5('0x36')]);_0x2eb717[_0xbdc5('0x38')]=_['intersection'](_0x2eb717[_0xbdc5('0x35')],_0x2eb717[_0xbdc5('0x36')]);_0x32f24c[_0xbdc5('0x3a')]=_[_0xbdc5('0x39')](_0x2eb717[_0xbdc5('0x35')],qs['fields'](_0x4a350b[_0xbdc5('0x36')][_0xbdc5('0x3b')]));_0x32f24c[_0xbdc5('0x3a')]=_0x32f24c['attributes']['length']?_0x32f24c[_0xbdc5('0x3a')]:_0x2eb717[_0xbdc5('0x35')];_0x32f24c[_0xbdc5('0x3f')]=qs[_0xbdc5('0x40')](_0x4a350b[_0xbdc5('0x36')][_0xbdc5('0x40')]);_0x32f24c[_0xbdc5('0x41')]=qs[_0xbdc5('0x38')](_['pick'](_0x4a350b[_0xbdc5('0x36')],_0x2eb717[_0xbdc5('0x38')]));if(_0x4a350b['query'][_0xbdc5('0x43')]){_0x32f24c[_0xbdc5('0x41')]=_[_0xbdc5('0x44')](_0x32f24c['where'],{'$or':_[_0xbdc5('0x30')](_0x32f24c[_0xbdc5('0x3a')],function(_0x3777a4){var _0xc4324f={};_0xc4324f[_0x3777a4]={'$like':'%'+_0x4a350b['query'][_0xbdc5('0x43')]+'%'};return _0xc4324f;})});}_0x32f24c=_[_0xbdc5('0x44')]({},_0x32f24c,_0x4a350b['options']);return _0x172e14[_0xbdc5('0x63')](_0x32f24c);}})[_0xbdc5('0x27')](function(_0x380cc1){if(_0x380cc1){_0x310448=_0x380cc1[_0xbdc5('0x3c')];if(!_0x4a350b[_0xbdc5('0x36')][_0xbdc5('0x3d')]('nolimit')){_0x32f24c['limit']=qs['limit'](_0x4a350b[_0xbdc5('0x36')][_0xbdc5('0x21')]);_0x32f24c[_0xbdc5('0x1f')]=qs[_0xbdc5('0x1f')](_0x4a350b[_0xbdc5('0x36')][_0xbdc5('0x1f')]);}return _0x172e14['getTeams'](_0x32f24c);}})['then'](function(_0x3e3866){if(_0x3e3866){return _0x3e3866?{'count':_0x310448,'rows':_0x3e3866}:null;}})[_0xbdc5('0x27')](respondWithResult(_0x105dfa,null))[_0xbdc5('0x4b')](handleError(_0x105dfa,null));};exports['addTeams']=function(_0x2b6e86,_0x5e47fc,_0x312714){var _0x35b21d=_0x2b6e86[_0xbdc5('0x4d')][_0xbdc5('0x64')];return db[_0xbdc5('0x62')][_0xbdc5('0x49')]({'where':{'id':_0x35b21d},'attributes':['id'],'include':[{'model':db[_0xbdc5('0x57')],'as':_0xbdc5('0x65'),'attributes':['id',_0xbdc5('0x2d'),_0xbdc5('0x66'),'voicePause',_0xbdc5('0x67')],'raw':!![]}]})[_0xbdc5('0x27')](function(_0x28222c){if(_0x28222c){var _0x266999=_['flatMap'](_0x28222c,function(_0x6332df){var _0x33851b=_0x6332df[_0xbdc5('0x28')]({'plain':!![]});return _0x33851b[_0xbdc5('0x65')];});return db[_0xbdc5('0x31')]['find']({'where':{'id':_0x2b6e86[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](function(_0x3f09a9){return db[_0xbdc5('0x68')][_0xbdc5('0x69')](function(_0x121c0e){return _0x3f09a9['addTeams'](_0x35b21d,{'transaction':_0x121c0e})[_0xbdc5('0x27')](function(){return BPromise[_0xbdc5('0x6a')](_0x266999,function(_0x4e27c3){return db['UserWhatsappQueue'][_0xbdc5('0x6b')]({'where':{'UserId':_0x4e27c3['id'],'WhatsappQueueId':_0x2b6e86[_0xbdc5('0x53')]['id']},'transaction':_0x121c0e});});})[_0xbdc5('0x27')](function(){_0x266999[_0xbdc5('0x6c')](function(_0x25bf8f){socket[_0xbdc5('0x6d')](_0xbdc5('0x6e'),{'UserId':_0x25bf8f['id'],'WhatsappQueueId':_0x3f09a9['id']});});});});});}})[_0xbdc5('0x27')](respondWithStatusCode(_0x5e47fc,null))['catch'](handleError(_0x5e47fc,null));};exports[_0xbdc5('0x6f')]=function(_0x5ba1e0,_0x467dd8,_0x2f1dc4){return db[_0xbdc5('0x62')][_0xbdc5('0x49')]({'where':{'id':_0x5ba1e0[_0xbdc5('0x36')][_0xbdc5('0x64')]},'attributes':['id'],'include':[{'model':db[_0xbdc5('0x57')],'as':_0xbdc5('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x467dd8,null))[_0xbdc5('0x27')](function(_0x3f8817){var _0x4e5623=_[_0xbdc5('0x30')](_0x3f8817,'id');var _0x5254dd=[];var _0x5edb24=[];var _0x752a35=squel['select']();_0x752a35['field'](_0xbdc5('0x70'))[_0xbdc5('0x71')](_0xbdc5('0x72'),'tq')['join'](_0xbdc5('0x73'),'ut',_0xbdc5('0x74'))[_0xbdc5('0x41')](_0xbdc5('0x75'),_0x5ba1e0[_0xbdc5('0x53')]['id']);for(var _0x529bc5=0x0;_0x529bc5<_0x3f8817[_0xbdc5('0x3c')];_0x529bc5+=0x1){let _0x311ffd=_0x3f8817[_0x529bc5];for(var _0x431939=0x0;_0x431939<_0x311ffd['Agents'][_0xbdc5('0x3c')];_0x431939+=0x1){let _0x13a8b6=_0x311ffd['Agents'][_0x431939];var _0x42e4b1=_0x752a35[_0xbdc5('0x76')]();_0x42e4b1['where'](_0xbdc5('0x77'),_0x13a8b6['id']);_0x5edb24[_0xbdc5('0x78')](db[_0xbdc5('0x68')][_0xbdc5('0x36')](_0x42e4b1['toString'](),{'type':db[_0xbdc5('0x68')][_0xbdc5('0x79')][_0xbdc5('0x7a')]})[_0xbdc5('0x27')](function(_0x5afb5a){if(_0x5afb5a[_0xbdc5('0x3c')]===0x1){return _0x13a8b6['id'];}else{var _0x538413=_[_0xbdc5('0x7b')](_['map'](_0x5afb5a,_0xbdc5('0x7c')),function(_0x21ba57){return _['includes'](_0x4e5623,_0x21ba57);});if(_0x538413){return _0x13a8b6['id'];}}}));}}return BPromise[_0xbdc5('0x7d')](_0x5edb24)[_0xbdc5('0x27')](function(_0x4696ab){_0x5254dd=_(_0x5254dd)[_0xbdc5('0x7e')](_0x4696ab)[_0xbdc5('0x7f')]()[_0xbdc5('0x80')]();return db[_0xbdc5('0x31')][_0xbdc5('0x52')]({'where':{'id':_0x5ba1e0[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](function(_0x5469f8){return db[_0xbdc5('0x68')][_0xbdc5('0x69')](function(_0x1bb72c){return _0x5469f8[_0xbdc5('0x6f')](_0x5ba1e0[_0xbdc5('0x36')][_0xbdc5('0x64')],{'transaction':_0x1bb72c})[_0xbdc5('0x27')](function(){if(!_[_0xbdc5('0x81')](_0x5254dd)){return _0x5469f8[_0xbdc5('0x82')](_0x5254dd,{'transaction':_0x1bb72c});}})[_0xbdc5('0x27')](function(){_0x5254dd[_0xbdc5('0x6c')](function(_0x47ca10){socket[_0xbdc5('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x47ca10,'WhatsappQueueId':_0x5469f8['id']});});});});});});})['then'](respondWithStatusCode(_0x467dd8,null))[_0xbdc5('0x4b')](handleError(_0x467dd8,null));};exports['addAgents']=function(_0x2c66cb,_0x4249aa,_0x1f1117){return db[_0xbdc5('0x31')][_0xbdc5('0x52')]({'where':{'id':_0x2c66cb[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0x4249aa,null))[_0xbdc5('0x27')](function(_0x1d27fb){if(_0x1d27fb){return _0x1d27fb[_0xbdc5('0x83')](_0x2c66cb[_0xbdc5('0x4d')]['ids'],_[_0xbdc5('0x84')](_0x2c66cb[_0xbdc5('0x4d')],[_0xbdc5('0x64'),'id'])||{})['spread'](function(_0x5281cc){for(var _0x2b6d25=0x0;_0x2b6d25<_0x2c66cb[_0xbdc5('0x4d')][_0xbdc5('0x64')][_0xbdc5('0x3c')];_0x2b6d25+=0x1){socket[_0xbdc5('0x6d')](_0xbdc5('0x6e'),{'UserId':Number(_0x2c66cb[_0xbdc5('0x4d')][_0xbdc5('0x64')][_0x2b6d25]),'WhatsappQueueId':Number(_0x2c66cb[_0xbdc5('0x53')]['id'])});}return _0x5281cc;});}})['then'](respondWithResult(_0x4249aa,null))[_0xbdc5('0x4b')](handleError(_0x4249aa,null));};exports['removeAgents']=function(_0x2df32b,_0x4dca08,_0x2a609b){return db[_0xbdc5('0x31')][_0xbdc5('0x52')]({'where':{'id':_0x2df32b[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0x4dca08,null))[_0xbdc5('0x27')](function(_0x5afa98){if(_0x5afa98){return _0x5afa98['removeAgents'](_0x2df32b[_0xbdc5('0x36')][_0xbdc5('0x64')])[_0xbdc5('0x27')](function(){if(_['isArray'](_0x2df32b[_0xbdc5('0x36')][_0xbdc5('0x64')])){for(var _0x40d8b0=0x0;_0x40d8b0<_0x2df32b[_0xbdc5('0x36')]['ids'][_0xbdc5('0x3c')];_0x40d8b0+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2df32b['query'][_0xbdc5('0x64')][_0x40d8b0]),'WhatsappQueueId':Number(_0x2df32b[_0xbdc5('0x53')]['id'])});}}else{socket[_0xbdc5('0x6d')](_0xbdc5('0x85'),{'UserId':Number(_0x2df32b[_0xbdc5('0x36')]['ids']),'WhatsappQueueId':Number(_0x2df32b[_0xbdc5('0x53')]['id'])});}});}})[_0xbdc5('0x27')](respondWithStatusCode(_0x4dca08,null))[_0xbdc5('0x4b')](handleError(_0x4dca08,null));};exports[_0xbdc5('0x86')]=function(_0x17f7c8,_0xc5959c,_0x104123){var _0x1b608d={};var _0x2c523e={};var _0x12109d;var _0xe10699;return db['WhatsappQueue'][_0xbdc5('0x61')]({'where':{'id':_0x17f7c8[_0xbdc5('0x53')]['id']}})[_0xbdc5('0x27')](handleEntityNotFound(_0xc5959c,null))[_0xbdc5('0x27')](function(_0x36dffe){if(_0x36dffe){_0x12109d=_0x36dffe;_0x2c523e[_0xbdc5('0x35')]=_['keys'](db[_0xbdc5('0x57')][_0xbdc5('0x32')]);_0x2c523e[_0xbdc5('0x36')]=_['keys'](_0x17f7c8[_0xbdc5('0x36')]);_0x2c523e[_0xbdc5('0x38')]=_['intersection'](_0x2c523e['model'],_0x2c523e['query']);_0x1b608d[_0xbdc5('0x3a')]=_[_0xbdc5('0x39')](_0x2c523e[_0xbdc5('0x35')],qs[_0xbdc5('0x3b')](_0x17f7c8[_0xbdc5('0x36')][_0xbdc5('0x3b')]));_0x1b608d['attributes']=_0x1b608d[_0xbdc5('0x3a')][_0xbdc5('0x3c')]?_0x1b608d[_0xbdc5('0x3a')]:_0x2c523e[_0xbdc5('0x35')];_0x1b608d[_0xbdc5('0x3f')]=qs['sort'](_0x17f7c8[_0xbdc5('0x36')][_0xbdc5('0x40')]);_0x1b608d['where']=qs['filters'](_[_0xbdc5('0x42')](_0x17f7c8[_0xbdc5('0x36')],_0x2c523e[_0xbdc5('0x38')]));if(_0x17f7c8[_0xbdc5('0x36')][_0xbdc5('0x43')]){_0x1b608d['where']=_[_0xbdc5('0x44')](_0x1b608d[_0xbdc5('0x41')],{'$or':_[_0xbdc5('0x30')](_0x1b608d[_0xbdc5('0x3a')],function(_0x3b3f1d){var _0x505ca1={};_0x505ca1[_0x3b3f1d]={'$like':'%'+_0x17f7c8[_0xbdc5('0x36')]['filter']+'%'};return _0x505ca1;})});}_0x1b608d=_[_0xbdc5('0x44')]({},_0x1b608d,_0x17f7c8[_0xbdc5('0x46')]);return _0x12109d['getAgents'](_0x1b608d);}})['then'](function(_0x320e52){if(_0x320e52){_0xe10699=_0x320e52['length'];if(!_0x17f7c8[_0xbdc5('0x36')][_0xbdc5('0x3d')](_0xbdc5('0x3e'))){_0x1b608d[_0xbdc5('0x21')]=qs[_0xbdc5('0x21')](_0x17f7c8['query'][_0xbdc5('0x21')]);_0x1b608d['offset']=qs[_0xbdc5('0x1f')](_0x17f7c8[_0xbdc5('0x36')]['offset']);}return _0x12109d[_0xbdc5('0x86')](_0x1b608d);}})['then'](function(_0x43758c){if(_0x43758c){return _0x43758c?{'count':_0xe10699,'rows':_0x43758c}:null;}})[_0xbdc5('0x27')](respondWithResult(_0xc5959c,null))[_0xbdc5('0x4b')](handleError(_0xc5959c,null));}; \ No newline at end of file +var _0x4d22=['catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','update','describe','getMembers','findOne','UserWhatsappQueue','intersection','order','sort','WhatsappQueueId','findAndCountAll','whatsappPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','field','tq.TeamId','from','join','user_has_teams','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','end','status','json','limit','count','offset','set','apply','reject','then','destroy','get','WhatsappQueues','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x2288e9,_0x15e163){var _0x24bec9=function(_0xf4dd47){while(--_0xf4dd47){_0x2288e9['push'](_0x2288e9['shift']());}};_0x24bec9(++_0x15e163);}(_0x4d22,0xc8));var _0x24d2=function(_0x206e59,_0x204450){_0x206e59=_0x206e59-0x0;var _0x5f0aef=_0x4d22[_0x206e59];return _0x5f0aef;};'use strict';var emlformat=require(_0x24d2('0x0'));var rimraf=require(_0x24d2('0x1'));var zipdir=require(_0x24d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24d2('0x3'));var moment=require(_0x24d2('0x4'));var BPromise=require(_0x24d2('0x5'));var Mustache=require('mustache');var util=require(_0x24d2('0x6'));var path=require(_0x24d2('0x7'));var sox=require(_0x24d2('0x8'));var csv=require(_0x24d2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24d2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x24d2('0xb'));var jsforce=require(_0x24d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x24d2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x24d2('0xd'));var authService=require(_0x24d2('0xe'));var qs=require(_0x24d2('0xf'));var as=require(_0x24d2('0x10'));var hardwareService=require(_0x24d2('0x11'));var logger=require(_0x24d2('0x12'))(_0x24d2('0x13'));var utils=require('../../config/utils');var config=require(_0x24d2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x24d2('0x15'))['db'];config[_0x24d2('0x16')]=_['defaults'](config[_0x24d2('0x16')],{'host':_0x24d2('0x17'),'port':0x18eb});var socket=require(_0x24d2('0x18'))(new Redis(config[_0x24d2('0x16')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x516ac3,_0x5c07fc){_0x5c07fc=_0x5c07fc||0xcc;return function(_0x14a608){if(_0x14a608){return _0x516ac3[_0x24d2('0x19')](_0x5c07fc);}return _0x516ac3['status'](_0x5c07fc)[_0x24d2('0x1a')]();};}function respondWithResult(_0x15d21d,_0x32eb5f){_0x32eb5f=_0x32eb5f||0xc8;return function(_0x65a378){if(_0x65a378){return _0x15d21d[_0x24d2('0x1b')](_0x32eb5f)[_0x24d2('0x1c')](_0x65a378);}};}function respondWithFilteredResult(_0x47bc25,_0xa49635){return function(_0xdb1ea){if(_0xdb1ea){var _0xa5b8f4=typeof _0xa49635['offset']==='undefined'&&typeof _0xa49635[_0x24d2('0x1d')]==='undefined';var _0x11a92e=_0xdb1ea[_0x24d2('0x1e')];var _0x36993f=_0xa5b8f4?0x0:_0xa49635[_0x24d2('0x1f')];var _0x55898a=_0xa5b8f4?_0xdb1ea[_0x24d2('0x1e')]:_0xa49635[_0x24d2('0x1f')]+_0xa49635[_0x24d2('0x1d')];var _0x765ae0;if(_0x55898a>=_0x11a92e){_0x55898a=_0x11a92e;_0x765ae0=0xc8;}else{_0x765ae0=0xce;}_0x47bc25[_0x24d2('0x1b')](_0x765ae0);return _0x47bc25[_0x24d2('0x20')]('Content-Range',_0x36993f+'-'+_0x55898a+'/'+_0x11a92e)['json'](_0xdb1ea);}return null;};}function patchUpdates(_0x48cc63){return function(_0x35fc30){try{jsonpatch[_0x24d2('0x21')](_0x35fc30,_0x48cc63,!![]);}catch(_0x415c9d){return BPromise[_0x24d2('0x22')](_0x415c9d);}return _0x35fc30['save']();};}function saveUpdates(_0x57b14a,_0x3076de){return function(_0x1bca9a){if(_0x1bca9a){return _0x1bca9a['update'](_0x57b14a)[_0x24d2('0x23')](function(_0x579d2d){return _0x579d2d;});}return null;};}function removeEntity(_0x2be28a,_0x36f274){return function(_0x38191a){if(_0x38191a){return _0x38191a[_0x24d2('0x24')]()[_0x24d2('0x23')](function(){var _0x357547=_0x38191a[_0x24d2('0x25')]({'plain':!![]});var _0x5117b5=_0x24d2('0x26');return db['UserProfileResource'][_0x24d2('0x24')]({'where':{'type':_0x5117b5,'resourceId':_0x357547['id']}})[_0x24d2('0x23')](function(){return _0x38191a;});})[_0x24d2('0x23')](function(){_0x2be28a[_0x24d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x336cc4,_0x4d7bfb){return function(_0x49a933){if(!_0x49a933){_0x336cc4['sendStatus'](0x194);}return _0x49a933;};}function handleError(_0x9f038d,_0x541afd){_0x541afd=_0x541afd||0x1f4;return function(_0x4c6de7){logger[_0x24d2('0x27')](_0x4c6de7[_0x24d2('0x28')]);if(_0x4c6de7['name']){delete _0x4c6de7[_0x24d2('0x29')];}_0x9f038d[_0x24d2('0x1b')](_0x541afd)[_0x24d2('0x2a')](_0x4c6de7);};}exports[_0x24d2('0x2b')]=function(_0x29555e,_0x1b4662){var _0x577bbb={},_0x1fe0c0={},_0x2838c5={'count':0x0,'rows':[]};var _0x3cb9ac=_[_0x24d2('0x2c')](db[_0x24d2('0x2d')][_0x24d2('0x2e')],function(_0x3800cf){return{'name':_0x3800cf[_0x24d2('0x2f')],'type':_0x3800cf[_0x24d2('0x30')][_0x24d2('0x31')]};});_0x1fe0c0[_0x24d2('0x32')]=_['map'](_0x3cb9ac,_0x24d2('0x29'));_0x1fe0c0['query']=_[_0x24d2('0x33')](_0x29555e['query']);_0x1fe0c0['filters']=_['intersection'](_0x1fe0c0['model'],_0x1fe0c0[_0x24d2('0x34')]);_0x577bbb['attributes']=_['intersection'](_0x1fe0c0['model'],qs[_0x24d2('0x35')](_0x29555e[_0x24d2('0x34')][_0x24d2('0x35')]));_0x577bbb[_0x24d2('0x36')]=_0x577bbb[_0x24d2('0x36')][_0x24d2('0x37')]?_0x577bbb[_0x24d2('0x36')]:_0x1fe0c0[_0x24d2('0x32')];if(!_0x29555e[_0x24d2('0x34')][_0x24d2('0x38')](_0x24d2('0x39'))){_0x577bbb[_0x24d2('0x1d')]=qs['limit'](_0x29555e[_0x24d2('0x34')][_0x24d2('0x1d')]);_0x577bbb[_0x24d2('0x1f')]=qs['offset'](_0x29555e['query'][_0x24d2('0x1f')]);}_0x577bbb['order']=qs['sort'](_0x29555e[_0x24d2('0x34')]['sort']);_0x577bbb[_0x24d2('0x3a')]=qs[_0x24d2('0x3b')](_[_0x24d2('0x3c')](_0x29555e[_0x24d2('0x34')],_0x1fe0c0['filters']),_0x3cb9ac);if(_0x29555e[_0x24d2('0x34')]['filter']){_0x577bbb[_0x24d2('0x3a')]=_[_0x24d2('0x3d')](_0x577bbb[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2c')](_0x3cb9ac,function(_0x50c67c){if(_0x50c67c[_0x24d2('0x30')]!==_0x24d2('0x3e')){var _0x22f9d0={};_0x22f9d0[_0x50c67c[_0x24d2('0x29')]]={'$like':'%'+_0x29555e[_0x24d2('0x34')][_0x24d2('0x3f')]+'%'};return _0x22f9d0;}})});}_0x577bbb=_[_0x24d2('0x3d')]({},_0x577bbb,_0x29555e[_0x24d2('0x40')]);var _0x585839={'where':_0x577bbb['where']};return db[_0x24d2('0x2d')][_0x24d2('0x1e')](_0x585839)[_0x24d2('0x23')](function(_0x65de74){_0x2838c5[_0x24d2('0x1e')]=_0x65de74;if(_0x29555e[_0x24d2('0x34')][_0x24d2('0x41')]){_0x577bbb[_0x24d2('0x42')]=[{'all':!![]}];}return db[_0x24d2('0x2d')][_0x24d2('0x43')](_0x577bbb);})[_0x24d2('0x23')](function(_0x35bb7e){_0x2838c5['rows']=_0x35bb7e;return _0x2838c5;})[_0x24d2('0x23')](respondWithFilteredResult(_0x1b4662,_0x577bbb))[_0x24d2('0x44')](handleError(_0x1b4662,null));};exports[_0x24d2('0x45')]=function(_0x116e90,_0x1f022b){var _0x591214={'raw':!![],'where':{'id':_0x116e90[_0x24d2('0x46')]['id']}},_0x3f37d6={};_0x3f37d6['model']=_[_0x24d2('0x33')](db['WhatsappQueue'][_0x24d2('0x2e')]);_0x3f37d6[_0x24d2('0x34')]=_[_0x24d2('0x33')](_0x116e90[_0x24d2('0x34')]);_0x3f37d6[_0x24d2('0x3b')]=_['intersection'](_0x3f37d6[_0x24d2('0x32')],_0x3f37d6['query']);_0x591214['attributes']=_['intersection'](_0x3f37d6[_0x24d2('0x32')],qs['fields'](_0x116e90['query'][_0x24d2('0x35')]));_0x591214[_0x24d2('0x36')]=_0x591214[_0x24d2('0x36')][_0x24d2('0x37')]?_0x591214[_0x24d2('0x36')]:_0x3f37d6[_0x24d2('0x32')];if(_0x116e90['query'][_0x24d2('0x41')]){_0x591214[_0x24d2('0x42')]=[{'all':!![]}];}_0x591214=_[_0x24d2('0x3d')]({},_0x591214,_0x116e90[_0x24d2('0x40')]);return db[_0x24d2('0x2d')][_0x24d2('0x47')](_0x591214)[_0x24d2('0x23')](handleEntityNotFound(_0x1f022b,null))[_0x24d2('0x23')](respondWithResult(_0x1f022b,null))[_0x24d2('0x44')](handleError(_0x1f022b,null));};exports[_0x24d2('0x48')]=function(_0x1bcbf6,_0x23f134){return db[_0x24d2('0x2d')][_0x24d2('0x48')](_0x1bcbf6[_0x24d2('0x49')],{})[_0x24d2('0x23')](function(_0x5c3505){var _0x256a02=_0x1bcbf6[_0x24d2('0x4a')][_0x24d2('0x25')]({'plain':!![]});if(!_0x256a02)throw new Error(_0x24d2('0x4b'));if(_0x256a02[_0x24d2('0x4c')]===_0x24d2('0x4a')){var _0x4f3a5d=_0x5c3505[_0x24d2('0x25')]({'plain':!![]});var _0x13cbff=_0x24d2('0x26');return db['UserProfileSection'][_0x24d2('0x47')]({'where':{'name':_0x13cbff,'userProfileId':_0x256a02[_0x24d2('0x4d')]},'raw':!![]})['then'](function(_0x109de5){if(_0x109de5&&_0x109de5[_0x24d2('0x4e')]===0x0){return db[_0x24d2('0x4f')]['create']({'name':_0x4f3a5d[_0x24d2('0x29')],'resourceId':_0x4f3a5d['id'],'type':_0x109de5[_0x24d2('0x29')],'sectionId':_0x109de5['id']},{})[_0x24d2('0x23')](function(){return _0x5c3505;});}else{return _0x5c3505;}})[_0x24d2('0x44')](function(_0x1b92d1){logger[_0x24d2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b92d1);throw _0x1b92d1;});}return _0x5c3505;})[_0x24d2('0x23')](respondWithResult(_0x23f134,0xc9))[_0x24d2('0x44')](handleError(_0x23f134,null));};exports[_0x24d2('0x50')]=function(_0x217243,_0x49cdae){if(_0x217243[_0x24d2('0x49')]['id']){delete _0x217243[_0x24d2('0x49')]['id'];}return db[_0x24d2('0x2d')][_0x24d2('0x47')]({'where':{'id':_0x217243[_0x24d2('0x46')]['id']}})['then'](handleEntityNotFound(_0x49cdae,null))[_0x24d2('0x23')](saveUpdates(_0x217243[_0x24d2('0x49')],null))[_0x24d2('0x23')](respondWithResult(_0x49cdae,null))[_0x24d2('0x44')](handleError(_0x49cdae,null));};exports[_0x24d2('0x24')]=function(_0x36f6b3,_0x188c64){return db[_0x24d2('0x2d')][_0x24d2('0x47')]({'where':{'id':_0x36f6b3['params']['id']}})['then'](handleEntityNotFound(_0x188c64,null))[_0x24d2('0x23')](removeEntity(_0x188c64,null))['catch'](handleError(_0x188c64,null));};exports['describe']=function(_0x3e7b10,_0x3756eb){return db[_0x24d2('0x2d')][_0x24d2('0x51')]()['then'](respondWithResult(_0x3756eb,null))['catch'](handleError(_0x3756eb,null));};exports[_0x24d2('0x52')]=function(_0x7cd8d8,_0x3527ea,_0xb3ff82){var _0x4d976f={'raw':!![],'where':{}},_0x5bec23={},_0x51fe60;return db['WhatsappQueue'][_0x24d2('0x53')]({'where':{'id':_0x7cd8d8[_0x24d2('0x46')]['id']}})[_0x24d2('0x23')](handleEntityNotFound(_0x3527ea,null))[_0x24d2('0x23')](function(_0x17cdf7){if(_0x17cdf7){_0x51fe60=_0x17cdf7[_0x24d2('0x25')]({'plain':!![]});_0x5bec23[_0x24d2('0x32')]=_[_0x24d2('0x33')](db[_0x24d2('0x54')][_0x24d2('0x2e')]);_0x5bec23[_0x24d2('0x34')]=_['keys'](_0x7cd8d8[_0x24d2('0x34')]);_0x5bec23[_0x24d2('0x3b')]=_['intersection'](_0x5bec23[_0x24d2('0x32')],_0x5bec23['query']);_0x4d976f[_0x24d2('0x36')]=_[_0x24d2('0x55')](_0x5bec23[_0x24d2('0x32')],qs[_0x24d2('0x35')](_0x7cd8d8['query']['fields']));_0x4d976f[_0x24d2('0x36')]=_0x4d976f[_0x24d2('0x36')]['length']?_0x4d976f[_0x24d2('0x36')]:_0x5bec23[_0x24d2('0x32')];if(!_0x7cd8d8[_0x24d2('0x34')][_0x24d2('0x38')](_0x24d2('0x39'))){_0x4d976f['limit']=qs['limit'](_0x7cd8d8[_0x24d2('0x34')][_0x24d2('0x1d')]);_0x4d976f['offset']=qs[_0x24d2('0x1f')](_0x7cd8d8[_0x24d2('0x34')][_0x24d2('0x1f')]);}_0x4d976f[_0x24d2('0x56')]=qs['sort'](_0x7cd8d8[_0x24d2('0x34')][_0x24d2('0x57')]);_0x4d976f[_0x24d2('0x3a')]=qs[_0x24d2('0x3b')](_['pick'](_0x7cd8d8[_0x24d2('0x34')],_0x5bec23[_0x24d2('0x3b')]));_0x4d976f[_0x24d2('0x3a')][_0x24d2('0x58')]=_0x17cdf7['id'];if(_0x7cd8d8[_0x24d2('0x34')][_0x24d2('0x3f')]){_0x4d976f[_0x24d2('0x3a')]=_['merge'](_0x4d976f[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2c')](_0x4d976f[_0x24d2('0x36')],function(_0x3e168a){var _0x5c47f5={};_0x5c47f5[_0x3e168a]={'$like':'%'+_0x7cd8d8[_0x24d2('0x34')]['filter']+'%'};return _0x5c47f5;})});}_0x4d976f=_[_0x24d2('0x3d')]({},_0x4d976f,_0x7cd8d8[_0x24d2('0x40')]);return db[_0x24d2('0x54')][_0x24d2('0x43')](_0x4d976f);}})[_0x24d2('0x23')](function(_0x5212ef){if(_0x5212ef){return db['User'][_0x24d2('0x59')]({'where':{'id':_[_0x24d2('0x2c')](_0x5212ef,'UserId'),'role':'agent'},'attributes':['id','name',_0x24d2('0x5a'),_0x24d2('0x5b'),_0x24d2('0x5c')]});}})['then'](function(_0x4fc2e5){if(_0x4fc2e5){return{'count':_0x4fc2e5[_0x24d2('0x1e')],'rows':_['map'](_0x4fc2e5[_0x24d2('0x5d')],function(_0x192946){return{'membername':_0x192946[_0x24d2('0x29')],'UserId':_0x192946['id'],'queue_name':_0x51fe60[_0x24d2('0x29')],'WhatsappQueueId':_0x51fe60['id'],'interface':util[_0x24d2('0x5e')]('%s/%s',_0x24d2('0x5f'),_0x192946['name']),'penalty':0x0,'paused':_0x192946[_0x24d2('0x5a')],'createdAt':_0x192946['createdAt'],'updatedAt':_0x192946[_0x24d2('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x24d2('0x23')](respondWithFilteredResult(_0x3527ea,_0x4d976f))[_0x24d2('0x44')](handleError(_0x3527ea,null));};exports[_0x24d2('0x60')]=function(_0x4d4697,_0x2795ba,_0x33cafc){var _0x4e72a9={};var _0x274fc7={};var _0x428167;var _0x1a5da2;return db['WhatsappQueue'][_0x24d2('0x53')]({'where':{'id':_0x4d4697[_0x24d2('0x46')]['id']}})[_0x24d2('0x23')](handleEntityNotFound(_0x2795ba,null))[_0x24d2('0x23')](function(_0x481e72){if(_0x481e72){_0x428167=_0x481e72;_0x274fc7[_0x24d2('0x32')]=_['keys'](db[_0x24d2('0x61')][_0x24d2('0x2e')]);_0x274fc7[_0x24d2('0x34')]=_[_0x24d2('0x33')](_0x4d4697[_0x24d2('0x34')]);_0x274fc7[_0x24d2('0x3b')]=_[_0x24d2('0x55')](_0x274fc7['model'],_0x274fc7['query']);_0x4e72a9[_0x24d2('0x36')]=_[_0x24d2('0x55')](_0x274fc7[_0x24d2('0x32')],qs[_0x24d2('0x35')](_0x4d4697[_0x24d2('0x34')][_0x24d2('0x35')]));_0x4e72a9['attributes']=_0x4e72a9[_0x24d2('0x36')][_0x24d2('0x37')]?_0x4e72a9[_0x24d2('0x36')]:_0x274fc7[_0x24d2('0x32')];_0x4e72a9[_0x24d2('0x56')]=qs[_0x24d2('0x57')](_0x4d4697['query']['sort']);_0x4e72a9[_0x24d2('0x3a')]=qs['filters'](_[_0x24d2('0x3c')](_0x4d4697[_0x24d2('0x34')],_0x274fc7[_0x24d2('0x3b')]));if(_0x4d4697[_0x24d2('0x34')][_0x24d2('0x3f')]){_0x4e72a9['where']=_[_0x24d2('0x3d')](_0x4e72a9[_0x24d2('0x3a')],{'$or':_['map'](_0x4e72a9[_0x24d2('0x36')],function(_0x2fc0ff){var _0x5a6ba5={};_0x5a6ba5[_0x2fc0ff]={'$like':'%'+_0x4d4697[_0x24d2('0x34')][_0x24d2('0x3f')]+'%'};return _0x5a6ba5;})});}_0x4e72a9=_[_0x24d2('0x3d')]({},_0x4e72a9,_0x4d4697[_0x24d2('0x40')]);return _0x428167[_0x24d2('0x60')](_0x4e72a9);}})[_0x24d2('0x23')](function(_0x44cf89){if(_0x44cf89){_0x1a5da2=_0x44cf89[_0x24d2('0x37')];if(!_0x4d4697['query'][_0x24d2('0x38')](_0x24d2('0x39'))){_0x4e72a9[_0x24d2('0x1d')]=qs[_0x24d2('0x1d')](_0x4d4697['query'][_0x24d2('0x1d')]);_0x4e72a9['offset']=qs[_0x24d2('0x1f')](_0x4d4697[_0x24d2('0x34')][_0x24d2('0x1f')]);}return _0x428167[_0x24d2('0x60')](_0x4e72a9);}})[_0x24d2('0x23')](function(_0xb72252){if(_0xb72252){return _0xb72252?{'count':_0x1a5da2,'rows':_0xb72252}:null;}})['then'](respondWithResult(_0x2795ba,null))[_0x24d2('0x44')](handleError(_0x2795ba,null));};exports[_0x24d2('0x62')]=function(_0x269dfc,_0x3121c0,_0x427125){var _0x2e9e4f=_0x269dfc['body']['ids'];return db[_0x24d2('0x61')][_0x24d2('0x43')]({'where':{'id':_0x2e9e4f},'attributes':['id'],'include':[{'model':db[_0x24d2('0x63')],'as':_0x24d2('0x64'),'attributes':['id',_0x24d2('0x29'),'online',_0x24d2('0x65'),_0x24d2('0x66')],'raw':!![]}]})[_0x24d2('0x23')](function(_0x5c1f30){if(_0x5c1f30){var _0x160145=_[_0x24d2('0x67')](_0x5c1f30,function(_0x53394e){var _0x29acdc=_0x53394e[_0x24d2('0x25')]({'plain':!![]});return _0x29acdc['Agents'];});return db[_0x24d2('0x2d')][_0x24d2('0x47')]({'where':{'id':_0x269dfc[_0x24d2('0x46')]['id']}})['then'](function(_0x2e0a98){return db[_0x24d2('0x68')][_0x24d2('0x69')](function(_0x30ce1b){return _0x2e0a98[_0x24d2('0x62')](_0x2e9e4f,{'transaction':_0x30ce1b})['then'](function(){return BPromise[_0x24d2('0x6a')](_0x160145,function(_0x374926){return db[_0x24d2('0x54')][_0x24d2('0x6b')]({'where':{'UserId':_0x374926['id'],'WhatsappQueueId':_0x269dfc['params']['id']},'transaction':_0x30ce1b});});})['then'](function(){_0x160145['forEach'](function(_0x5dfa30){socket[_0x24d2('0x6c')](_0x24d2('0x6d'),{'UserId':_0x5dfa30['id'],'WhatsappQueueId':_0x2e0a98['id']});});});});});}})[_0x24d2('0x23')](respondWithStatusCode(_0x3121c0,null))[_0x24d2('0x44')](handleError(_0x3121c0,null));};exports[_0x24d2('0x6e')]=function(_0x5a2a8d,_0x4ce667,_0x4053f1){return db[_0x24d2('0x61')][_0x24d2('0x43')]({'where':{'id':_0x5a2a8d['query'][_0x24d2('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24d2('0x64'),'attributes':['id'],'raw':!![]}]})[_0x24d2('0x23')](handleEntityNotFound(_0x4ce667,null))['then'](function(_0x264f2d){var _0x226c6b=_[_0x24d2('0x2c')](_0x264f2d,'id');var _0x45d7ff=[];var _0x27d54a=[];var _0x4259b2=squel['select']();_0x4259b2[_0x24d2('0x70')](_0x24d2('0x71'))[_0x24d2('0x72')]('team_has_whatsapp_queues','tq')[_0x24d2('0x73')](_0x24d2('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x24d2('0x3a')]('WhatsappQueueId\x20=\x20?',_0x5a2a8d['params']['id']);for(var _0x58c3af=0x0;_0x58c3af<_0x264f2d[_0x24d2('0x37')];_0x58c3af+=0x1){let _0x2b59eb=_0x264f2d[_0x58c3af];for(var _0x44de64=0x0;_0x44de64<_0x2b59eb[_0x24d2('0x64')][_0x24d2('0x37')];_0x44de64+=0x1){let _0x42180d=_0x2b59eb[_0x24d2('0x64')][_0x44de64];var _0xb5a309=_0x4259b2['clone']();_0xb5a309[_0x24d2('0x3a')]('ut.UserId\x20=\x20?',_0x42180d['id']);_0x27d54a[_0x24d2('0x75')](db[_0x24d2('0x68')]['query'](_0xb5a309[_0x24d2('0x76')](),{'type':db[_0x24d2('0x68')][_0x24d2('0x77')][_0x24d2('0x78')]})[_0x24d2('0x23')](function(_0x2a0e8f){if(_0x2a0e8f[_0x24d2('0x37')]===0x1){return _0x42180d['id'];}else{var _0x10fee6=_[_0x24d2('0x79')](_['map'](_0x2a0e8f,_0x24d2('0x7a')),function(_0x3f8c61){return _['includes'](_0x226c6b,_0x3f8c61);});if(_0x10fee6){return _0x42180d['id'];}}}));}}return BPromise['all'](_0x27d54a)[_0x24d2('0x23')](function(_0x4c6f2d){_0x45d7ff=_(_0x45d7ff)[_0x24d2('0x7b')](_0x4c6f2d)[_0x24d2('0x7c')]()[_0x24d2('0x7d')]();return db[_0x24d2('0x2d')][_0x24d2('0x47')]({'where':{'id':_0x5a2a8d[_0x24d2('0x46')]['id']}})[_0x24d2('0x23')](function(_0x12f625){return db[_0x24d2('0x68')]['transaction'](function(_0x5b2ade){return _0x12f625['removeTeams'](_0x5a2a8d[_0x24d2('0x34')][_0x24d2('0x6f')],{'transaction':_0x5b2ade})[_0x24d2('0x23')](function(){if(!_[_0x24d2('0x7e')](_0x45d7ff)){return _0x12f625[_0x24d2('0x7f')](_0x45d7ff,{'transaction':_0x5b2ade});}})[_0x24d2('0x23')](function(){_0x45d7ff['forEach'](function(_0x2b456a){socket[_0x24d2('0x6c')]('userWhatsappQueue:remove',{'UserId':_0x2b456a,'WhatsappQueueId':_0x12f625['id']});});});});});});})[_0x24d2('0x23')](respondWithStatusCode(_0x4ce667,null))['catch'](handleError(_0x4ce667,null));};exports[_0x24d2('0x80')]=function(_0x567a5c,_0x473884,_0x533d03){return db[_0x24d2('0x2d')][_0x24d2('0x47')]({'where':{'id':_0x567a5c[_0x24d2('0x46')]['id']}})[_0x24d2('0x23')](handleEntityNotFound(_0x473884,null))[_0x24d2('0x23')](function(_0x31b5d0){if(_0x31b5d0){return _0x31b5d0[_0x24d2('0x80')](_0x567a5c[_0x24d2('0x49')][_0x24d2('0x6f')],_[_0x24d2('0x81')](_0x567a5c[_0x24d2('0x49')],[_0x24d2('0x6f'),'id'])||{})[_0x24d2('0x82')](function(_0x339a5a){for(var _0xc274dc=0x0;_0xc274dc<_0x567a5c[_0x24d2('0x49')][_0x24d2('0x6f')][_0x24d2('0x37')];_0xc274dc+=0x1){socket[_0x24d2('0x6c')](_0x24d2('0x6d'),{'UserId':Number(_0x567a5c[_0x24d2('0x49')][_0x24d2('0x6f')][_0xc274dc]),'WhatsappQueueId':Number(_0x567a5c[_0x24d2('0x46')]['id'])});}return _0x339a5a;});}})['then'](respondWithResult(_0x473884,null))[_0x24d2('0x44')](handleError(_0x473884,null));};exports[_0x24d2('0x7f')]=function(_0x2b1608,_0x2ed110,_0x543d64){return db['WhatsappQueue'][_0x24d2('0x47')]({'where':{'id':_0x2b1608['params']['id']}})['then'](handleEntityNotFound(_0x2ed110,null))[_0x24d2('0x23')](function(_0x1387f3){if(_0x1387f3){return _0x1387f3[_0x24d2('0x7f')](_0x2b1608[_0x24d2('0x34')][_0x24d2('0x6f')])[_0x24d2('0x23')](function(){if(_[_0x24d2('0x83')](_0x2b1608[_0x24d2('0x34')]['ids'])){for(var _0x19a30a=0x0;_0x19a30a<_0x2b1608[_0x24d2('0x34')][_0x24d2('0x6f')]['length'];_0x19a30a+=0x1){socket[_0x24d2('0x6c')](_0x24d2('0x84'),{'UserId':Number(_0x2b1608[_0x24d2('0x34')][_0x24d2('0x6f')][_0x19a30a]),'WhatsappQueueId':Number(_0x2b1608['params']['id'])});}}else{socket[_0x24d2('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x2b1608['query'][_0x24d2('0x6f')]),'WhatsappQueueId':Number(_0x2b1608[_0x24d2('0x46')]['id'])});}});}})[_0x24d2('0x23')](respondWithStatusCode(_0x2ed110,null))[_0x24d2('0x44')](handleError(_0x2ed110,null));};exports['getAgents']=function(_0x1e1610,_0x5ac3f2,_0x2d43c0){var _0x4fe661={};var _0x41275a={};var _0x47b204;var _0x398df2;return db[_0x24d2('0x2d')][_0x24d2('0x53')]({'where':{'id':_0x1e1610[_0x24d2('0x46')]['id']}})[_0x24d2('0x23')](handleEntityNotFound(_0x5ac3f2,null))[_0x24d2('0x23')](function(_0x25ce26){if(_0x25ce26){_0x47b204=_0x25ce26;_0x41275a['model']=_['keys'](db[_0x24d2('0x63')][_0x24d2('0x2e')]);_0x41275a[_0x24d2('0x34')]=_['keys'](_0x1e1610[_0x24d2('0x34')]);_0x41275a[_0x24d2('0x3b')]=_[_0x24d2('0x55')](_0x41275a[_0x24d2('0x32')],_0x41275a['query']);_0x4fe661[_0x24d2('0x36')]=_[_0x24d2('0x55')](_0x41275a[_0x24d2('0x32')],qs['fields'](_0x1e1610[_0x24d2('0x34')][_0x24d2('0x35')]));_0x4fe661[_0x24d2('0x36')]=_0x4fe661[_0x24d2('0x36')][_0x24d2('0x37')]?_0x4fe661[_0x24d2('0x36')]:_0x41275a[_0x24d2('0x32')];_0x4fe661[_0x24d2('0x56')]=qs[_0x24d2('0x57')](_0x1e1610[_0x24d2('0x34')][_0x24d2('0x57')]);_0x4fe661[_0x24d2('0x3a')]=qs[_0x24d2('0x3b')](_[_0x24d2('0x3c')](_0x1e1610[_0x24d2('0x34')],_0x41275a[_0x24d2('0x3b')]));if(_0x1e1610['query'][_0x24d2('0x3f')]){_0x4fe661['where']=_[_0x24d2('0x3d')](_0x4fe661[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2c')](_0x4fe661[_0x24d2('0x36')],function(_0x4291a6){var _0x1d3bfc={};_0x1d3bfc[_0x4291a6]={'$like':'%'+_0x1e1610[_0x24d2('0x34')][_0x24d2('0x3f')]+'%'};return _0x1d3bfc;})});}_0x4fe661=_[_0x24d2('0x3d')]({},_0x4fe661,_0x1e1610['options']);return _0x47b204[_0x24d2('0x85')](_0x4fe661);}})[_0x24d2('0x23')](function(_0x332979){if(_0x332979){_0x398df2=_0x332979[_0x24d2('0x37')];if(!_0x1e1610[_0x24d2('0x34')][_0x24d2('0x38')](_0x24d2('0x39'))){_0x4fe661['limit']=qs[_0x24d2('0x1d')](_0x1e1610[_0x24d2('0x34')][_0x24d2('0x1d')]);_0x4fe661[_0x24d2('0x1f')]=qs[_0x24d2('0x1f')](_0x1e1610[_0x24d2('0x34')][_0x24d2('0x1f')]);}return _0x47b204[_0x24d2('0x85')](_0x4fe661);}})[_0x24d2('0x23')](function(_0x56fc78){if(_0x56fc78){return _0x56fc78?{'count':_0x398df2,'rows':_0x56fc78}:null;}})['then'](respondWithResult(_0x5ac3f2,null))[_0x24d2('0x44')](handleError(_0x5ac3f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6cde3b4..3267f9a 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 _0x2dab=['setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2dab,0x85));var _0xb2da=function(_0x45c05d,_0x51630c){_0x45c05d=_0x45c05d-0x0;var _0x592f36=_0x2dab[_0x45c05d];return _0x592f36;};'use strict';var EventEmitter=require(_0xb2da('0x0'));var WhatsappQueue=require(_0xb2da('0x1'))['db'][_0xb2da('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb2da('0x3')](0x0);var events={'afterCreate':_0xb2da('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x57ac38){return function(_0x59b9ec,_0x2447da,_0x4bdcc7){WhatsappQueueEvents[_0xb2da('0x5')](_0x57ac38+':'+_0x59b9ec['id'],_0x59b9ec);WhatsappQueueEvents[_0xb2da('0x5')](_0x57ac38,_0x59b9ec);_0x4bdcc7(null);};}for(var e in events){if(events[_0xb2da('0x6')](e)){var event=events[e];WhatsappQueue[_0xb2da('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x1ad0=['events','WhatsappQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2b53c4,_0x1f92d7){var _0xd78e2a=function(_0x3ee413){while(--_0x3ee413){_0x2b53c4['push'](_0x2b53c4['shift']());}};_0xd78e2a(++_0x1f92d7);}(_0x1ad0,0x150));var _0x01ad=function(_0x41fd45,_0x5baf60){_0x41fd45=_0x41fd45-0x0;var _0xb77779=_0x1ad0[_0x41fd45];return _0xb77779;};'use strict';var EventEmitter=require(_0x01ad('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x01ad('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01ad('0x2'),'afterUpdate':'update','afterDestroy':_0x01ad('0x3')};function emitEvent(_0x1a8041){return function(_0x3b40f9,_0x454331,_0x5d6d77){WhatsappQueueEvents[_0x01ad('0x4')](_0x1a8041+':'+_0x3b40f9['id'],_0x3b40f9);WhatsappQueueEvents['emit'](_0x1a8041,_0x3b40f9);_0x5d6d77(null);};}for(var e in events){if(events[_0x01ad('0x5')](e)){var event=events[e];WhatsappQueue[_0x01ad('0x6')](e,emitEvent(event));}}module[_0x01ad('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 f39fb12..5834850 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 _0x550c=['bluebird','path','define','whatsapp_queues','lodash','util','../../config/logger','moment'];(function(_0x460976,_0x5bf706){var _0x6e49c7=function(_0x188bc6){while(--_0x188bc6){_0x460976['push'](_0x460976['shift']());}};_0x6e49c7(++_0x5bf706);}(_0x550c,0x1cc));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc550('0x0'));var util=require(_0xc550('0x1'));var logger=require(_0xc550('0x2'))('api');var moment=require(_0xc550('0x3'));var BPromise=require(_0xc550('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc550('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x268162,_0x519dc2){return _0x268162[_0xc550('0x6')]('WhatsappQueue',attributes,{'tableName':_0xc550('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29fa=['whatsapp_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x29fa,0x140));var _0xa29f=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x29fa[_0x4d337e];return _0x247963;};'use strict';var _=require(_0xa29f('0x0'));var util=require(_0xa29f('0x1'));var logger=require('../../config/logger')(_0xa29f('0x2'));var moment=require('moment');var BPromise=require(_0xa29f('0x3'));var rp=require(_0xa29f('0x4'));var fs=require('fs');var path=require(_0xa29f('0x5'));var rimraf=require(_0xa29f('0x6'));var config=require(_0xa29f('0x7'));var attributes=require(_0xa29f('0x8'));module['exports']=function(_0x358fcf,_0x56ca7d){return _0x358fcf['define'](_0xa29f('0x9'),attributes,{'tableName':_0xa29f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 0010a3b..9e722ed 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 _0xf2cf=['where','attributes','limit','include','map','model','debug','stringify','ShowWhatsappQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw'];(function(_0x3d80ae,_0x115102){var _0x5be6cc=function(_0x548937){while(--_0x548937){_0x3d80ae['push'](_0x3d80ae['shift']());}};_0x5be6cc(++_0x115102);}(_0xf2cf,0x11b));var _0xff2c=function(_0x57f3b8,_0x532dcd){_0x57f3b8=_0x57f3b8-0x0;var _0x2165d5=_0xf2cf[_0x57f3b8];return _0x2165d5;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var moment=require(_0xff2c('0x1'));var BPromise=require('bluebird');var rs=require(_0xff2c('0x2'));var fs=require('fs');var Redis=require(_0xff2c('0x3'));var db=require(_0xff2c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xff2c('0x5'))(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff2c('0x8')][_0xff2c('0x9')]({'port':0x232a});config[_0xff2c('0xa')]=_[_0xff2c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff2c('0xa')]));require(_0xff2c('0xc'))[_0xff2c('0xd')](socket);function respondWithRpcPromise(_0x37dfb9,_0x3156b6,_0x2a57de){return new BPromise(function(_0x587105,_0x3f223f){return client[_0xff2c('0xe')](_0x37dfb9,_0x2a57de)[_0xff2c('0xf')](function(_0x7c8c93){logger[_0xff2c('0x10')](_0xff2c('0x11'),_0x3156b6,'request\x20sent');logger['debug'](_0xff2c('0x12'),_0x3156b6,_0xff2c('0x13'),JSON['stringify'](_0x7c8c93));if(_0x7c8c93['error']){if(_0x7c8c93['error']['code']===0x1f4){logger['error'](_0xff2c('0x11'),_0x3156b6,_0x7c8c93[_0xff2c('0x14')][_0xff2c('0x15')]);return _0x3f223f(_0x7c8c93[_0xff2c('0x14')]['message']);}logger[_0xff2c('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3156b6,_0x7c8c93[_0xff2c('0x14')][_0xff2c('0x15')]);return _0x587105(_0x7c8c93[_0xff2c('0x14')][_0xff2c('0x15')]);}else{logger[_0xff2c('0x10')](_0xff2c('0x11'),_0x3156b6,'request\x20sent');_0x587105(_0x7c8c93[_0xff2c('0x16')][_0xff2c('0x15')]);}})[_0xff2c('0x17')](function(_0x138083){logger[_0xff2c('0x14')](_0xff2c('0x11'),_0x3156b6,_0x138083);_0x3f223f(_0x138083);});});}exports[_0xff2c('0x18')]=function(_0x264455){var _0x952af2=this;return new Promise(function(_0x34d5f7,_0xd96a64){return db[_0xff2c('0x19')][_0xff2c('0x1a')]({'raw':_0x264455[_0xff2c('0x1b')]?_0x264455[_0xff2c('0x1b')][_0xff2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x264455[_0xff2c('0x1b')]?_0x264455[_0xff2c('0x1b')][_0xff2c('0x1d')]||null:null,'attributes':_0x264455[_0xff2c('0x1b')]?_0x264455['options'][_0xff2c('0x1e')]||null:null,'limit':_0x264455[_0xff2c('0x1b')]?_0x264455[_0xff2c('0x1b')][_0xff2c('0x1f')]||null:null,'include':_0x264455[_0xff2c('0x1b')]?_0x264455[_0xff2c('0x1b')][_0xff2c('0x20')]?_[_0xff2c('0x21')](_0x264455[_0xff2c('0x1b')][_0xff2c('0x20')],function(_0x552460){return{'model':db[_0x552460[_0xff2c('0x22')]],'as':_0x552460['as'],'attributes':_0x552460[_0xff2c('0x1e')],'include':_0x552460[_0xff2c('0x20')]?_[_0xff2c('0x21')](_0x552460[_0xff2c('0x20')],function(_0x238590){return{'model':db[_0x238590['model']],'as':_0x238590['as'],'attributes':_0x238590[_0xff2c('0x1e')],'include':_0x238590[_0xff2c('0x20')]?_[_0xff2c('0x21')](_0x238590['include'],function(_0xbb18ac){return{'model':db[_0xbb18ac[_0xff2c('0x22')]],'as':_0xbb18ac['as'],'attributes':_0xbb18ac[_0xff2c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xff2c('0xf')](function(_0xe15685){logger[_0xff2c('0x10')](_0xff2c('0x18'),_0x264455);logger[_0xff2c('0x23')](_0xff2c('0x18'),_0x264455,JSON[_0xff2c('0x24')](_0xe15685));_0x34d5f7(_0xe15685);})[_0xff2c('0x17')](function(_0x45c918){logger[_0xff2c('0x14')](_0xff2c('0x18'),_0x45c918[_0xff2c('0x15')],_0x264455);_0xd96a64(_0x952af2[_0xff2c('0x14')](0x1f4,_0x45c918[_0xff2c('0x15')]));});});};exports[_0xff2c('0x25')]=function(_0x2c137f){var _0x372adb=this;return new Promise(function(_0xbbd8cc,_0x1e7570){return db['WhatsappQueue'][_0xff2c('0x26')]({'raw':_0x2c137f['options']?_0x2c137f['options'][_0xff2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c137f[_0xff2c('0x1b')]?_0x2c137f[_0xff2c('0x1b')]['where']||null:null,'attributes':_0x2c137f[_0xff2c('0x1b')]?_0x2c137f['options'][_0xff2c('0x1e')]||null:null,'include':_0x2c137f[_0xff2c('0x1b')]?_0x2c137f[_0xff2c('0x1b')][_0xff2c('0x20')]?_[_0xff2c('0x21')](_0x2c137f[_0xff2c('0x1b')]['include'],function(_0x4361d9){return{'model':db[_0x4361d9['model']],'as':_0x4361d9['as'],'attributes':_0x4361d9['attributes'],'include':_0x4361d9[_0xff2c('0x20')]?_['map'](_0x4361d9[_0xff2c('0x20')],function(_0x505392){return{'model':db[_0x505392['model']],'as':_0x505392['as'],'attributes':_0x505392[_0xff2c('0x1e')],'include':_0x505392['include']?_['map'](_0x505392[_0xff2c('0x20')],function(_0x3be9bd){return{'model':db[_0x3be9bd[_0xff2c('0x22')]],'as':_0x3be9bd['as'],'attributes':_0x3be9bd[_0xff2c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xff2c('0xf')](function(_0x34c797){logger[_0xff2c('0x10')](_0xff2c('0x25'),_0x2c137f);logger[_0xff2c('0x23')](_0xff2c('0x25'),_0x2c137f,JSON[_0xff2c('0x24')](_0x34c797));_0xbbd8cc(_0x34c797);})[_0xff2c('0x17')](function(_0x23de3c){logger[_0xff2c('0x14')]('ShowWhatsappQueue',_0x23de3c['message'],_0x2c137f);_0x1e7570(_0x372adb[_0xff2c('0x14')](0x1f4,_0x23de3c[_0xff2c('0x15')]));});});}; \ No newline at end of file +var _0x3ed2=['include','map','model','attributes','debug','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x3ed2,0x1e1));var _0x23ed=function(_0x2a22f9,_0x3edd66){_0x2a22f9=_0x2a22f9-0x0;var _0x2fc650=_0x3ed2[_0x2a22f9];return _0x2fc650;};'use strict';var _=require(_0x23ed('0x0'));var util=require(_0x23ed('0x1'));var moment=require(_0x23ed('0x2'));var BPromise=require(_0x23ed('0x3'));var rs=require(_0x23ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23ed('0x5'))['db'];var utils=require(_0x23ed('0x6'));var logger=require(_0x23ed('0x7'))(_0x23ed('0x8'));var config=require('../../config/environment');var jayson=require(_0x23ed('0x9'));var client=jayson[_0x23ed('0xa')][_0x23ed('0xb')]({'port':0x232a});config['redis']=_[_0x23ed('0xc')](config[_0x23ed('0xd')],{'host':_0x23ed('0xe'),'port':0x18eb});var socket=require(_0x23ed('0xf'))(new Redis(config[_0x23ed('0xd')]));require(_0x23ed('0x10'))[_0x23ed('0x11')](socket);function respondWithRpcPromise(_0x2f8998,_0x50ba03,_0xfc96d5){return new BPromise(function(_0x1d5238,_0x2d09df){return client[_0x23ed('0x12')](_0x2f8998,_0xfc96d5)[_0x23ed('0x13')](function(_0x3b3b9b){logger[_0x23ed('0x14')](_0x23ed('0x15'),_0x50ba03,_0x23ed('0x16'));logger['debug'](_0x23ed('0x17'),_0x50ba03,_0x23ed('0x16'),JSON[_0x23ed('0x18')](_0x3b3b9b));if(_0x3b3b9b[_0x23ed('0x19')]){if(_0x3b3b9b[_0x23ed('0x19')][_0x23ed('0x1a')]===0x1f4){logger[_0x23ed('0x19')](_0x23ed('0x15'),_0x50ba03,_0x3b3b9b[_0x23ed('0x19')]['message']);return _0x2d09df(_0x3b3b9b[_0x23ed('0x19')][_0x23ed('0x1b')]);}logger[_0x23ed('0x19')](_0x23ed('0x15'),_0x50ba03,_0x3b3b9b[_0x23ed('0x19')][_0x23ed('0x1b')]);return _0x1d5238(_0x3b3b9b[_0x23ed('0x19')][_0x23ed('0x1b')]);}else{logger[_0x23ed('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x50ba03,_0x23ed('0x16'));_0x1d5238(_0x3b3b9b[_0x23ed('0x1c')]['message']);}})[_0x23ed('0x1d')](function(_0x1c6323){logger[_0x23ed('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x50ba03,_0x1c6323);_0x2d09df(_0x1c6323);});});}exports[_0x23ed('0x1e')]=function(_0x598f88){var _0x28bc3b=this;return new Promise(function(_0x3245fc,_0x288851){return db[_0x23ed('0x1f')][_0x23ed('0x20')]({'raw':_0x598f88[_0x23ed('0x21')]?_0x598f88[_0x23ed('0x21')][_0x23ed('0x22')]===undefined?!![]:![]:!![],'where':_0x598f88[_0x23ed('0x21')]?_0x598f88['options']['where']||null:null,'attributes':_0x598f88[_0x23ed('0x21')]?_0x598f88[_0x23ed('0x21')]['attributes']||null:null,'limit':_0x598f88[_0x23ed('0x21')]?_0x598f88[_0x23ed('0x21')]['limit']||null:null,'include':_0x598f88[_0x23ed('0x21')]?_0x598f88[_0x23ed('0x21')][_0x23ed('0x23')]?_[_0x23ed('0x24')](_0x598f88[_0x23ed('0x21')][_0x23ed('0x23')],function(_0x57807c){return{'model':db[_0x57807c[_0x23ed('0x25')]],'as':_0x57807c['as'],'attributes':_0x57807c[_0x23ed('0x26')],'include':_0x57807c[_0x23ed('0x23')]?_['map'](_0x57807c['include'],function(_0x25a2b2){return{'model':db[_0x25a2b2['model']],'as':_0x25a2b2['as'],'attributes':_0x25a2b2['attributes'],'include':_0x25a2b2[_0x23ed('0x23')]?_[_0x23ed('0x24')](_0x25a2b2[_0x23ed('0x23')],function(_0x1fe4be){return{'model':db[_0x1fe4be['model']],'as':_0x1fe4be['as'],'attributes':_0x1fe4be[_0x23ed('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd1393a){logger[_0x23ed('0x14')]('GetWhatsappQueue',_0x598f88);logger[_0x23ed('0x27')](_0x23ed('0x1e'),_0x598f88,JSON['stringify'](_0xd1393a));_0x3245fc(_0xd1393a);})[_0x23ed('0x1d')](function(_0x1f909f){logger[_0x23ed('0x19')](_0x23ed('0x1e'),_0x1f909f['message'],_0x598f88);_0x288851(_0x28bc3b[_0x23ed('0x19')](0x1f4,_0x1f909f['message']));});});};exports[_0x23ed('0x28')]=function(_0x27f885){var _0xd40150=this;return new Promise(function(_0x12ca86,_0x3fae6d){return db['WhatsappQueue'][_0x23ed('0x29')]({'raw':_0x27f885[_0x23ed('0x21')]?_0x27f885[_0x23ed('0x21')][_0x23ed('0x22')]===undefined?!![]:![]:!![],'where':_0x27f885[_0x23ed('0x21')]?_0x27f885[_0x23ed('0x21')][_0x23ed('0x2a')]||null:null,'attributes':_0x27f885['options']?_0x27f885[_0x23ed('0x21')][_0x23ed('0x26')]||null:null,'include':_0x27f885[_0x23ed('0x21')]?_0x27f885[_0x23ed('0x21')][_0x23ed('0x23')]?_[_0x23ed('0x24')](_0x27f885[_0x23ed('0x21')]['include'],function(_0xd33b20){return{'model':db[_0xd33b20[_0x23ed('0x25')]],'as':_0xd33b20['as'],'attributes':_0xd33b20[_0x23ed('0x26')],'include':_0xd33b20['include']?_['map'](_0xd33b20[_0x23ed('0x23')],function(_0x292b58){return{'model':db[_0x292b58['model']],'as':_0x292b58['as'],'attributes':_0x292b58[_0x23ed('0x26')],'include':_0x292b58[_0x23ed('0x23')]?_[_0x23ed('0x24')](_0x292b58[_0x23ed('0x23')],function(_0x3a07e2){return{'model':db[_0x3a07e2[_0x23ed('0x25')]],'as':_0x3a07e2['as'],'attributes':_0x3a07e2[_0x23ed('0x26')]};}):[]};}):[]};}):[]:[]})[_0x23ed('0x13')](function(_0x43bba6){logger[_0x23ed('0x14')]('ShowWhatsappQueue',_0x27f885);logger[_0x23ed('0x27')](_0x23ed('0x28'),_0x27f885,JSON[_0x23ed('0x18')](_0x43bba6));_0x12ca86(_0x43bba6);})[_0x23ed('0x1d')](function(_0x699bd6){logger[_0x23ed('0x19')](_0x23ed('0x28'),_0x699bd6[_0x23ed('0x1b')],_0x27f885);_0x3fae6d(_0xd40150[_0x23ed('0x19')](0x1f4,_0x699bd6[_0x23ed('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f0bdf65..71cb6ae 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 _0x3dbb=['emit','removeListener','register','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x1e0360,_0x1dd380){var _0x49ecad=function(_0x5f0e8b){while(--_0x5f0e8b){_0x1e0360['push'](_0x1e0360['shift']());}};_0x49ecad(++_0x1dd380);}(_0x3dbb,0x154));var _0xb3db=function(_0x2ea08a,_0x240f73){_0x2ea08a=_0x2ea08a-0x0;var _0x5401ad=_0x3dbb[_0x2ea08a];return _0x5401ad;};'use strict';var WhatsappQueueEvents=require(_0xb3db('0x0'));var events=[_0xb3db('0x1'),_0xb3db('0x2'),_0xb3db('0x3')];function createListener(_0x41feeb,_0x2de497){return function(_0x1bcfec){_0x2de497[_0xb3db('0x4')](_0x41feeb,_0x1bcfec);};}function removeListener(_0x31c4d2,_0x5618be){return function(){WhatsappQueueEvents[_0xb3db('0x5')](_0x31c4d2,_0x5618be);};}exports[_0xb3db('0x6')]=function(_0x74d317){for(var _0x5c7167=0x0,_0x140cc=events['length'];_0x5c7167<_0x140cc;_0x5c7167++){var _0x1b61f0=events[_0x5c7167];var _0x36c4f7=createListener(_0xb3db('0x7')+_0x1b61f0,_0x74d317);WhatsappQueueEvents['on'](_0x1b61f0,_0x36c4f7);}}; \ No newline at end of file +var _0xcab1=['length','whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xcab1,0xaa));var _0x1cab=function(_0x485a8b,_0x480b29){_0x485a8b=_0x485a8b-0x0;var _0x53a7ad=_0xcab1[_0x485a8b];return _0x53a7ad;};'use strict';var WhatsappQueueEvents=require(_0x1cab('0x0'));var events=[_0x1cab('0x1'),'remove',_0x1cab('0x2')];function createListener(_0x402b26,_0x4e7d83){return function(_0x42a91c){_0x4e7d83[_0x1cab('0x3')](_0x402b26,_0x42a91c);};}function removeListener(_0xbcc475,_0x30330d){return function(){WhatsappQueueEvents[_0x1cab('0x4')](_0xbcc475,_0x30330d);};}exports[_0x1cab('0x5')]=function(_0x4768f9){for(var _0x4fc3fd=0x0,_0x5d0d78=events[_0x1cab('0x6')];_0x4fc3fd<_0x5d0d78;_0x4fc3fd++){var _0x2a3b9f=events[_0x4fc3fd];var _0x8935a=createListener(_0x1cab('0x7')+_0x2a3b9f,_0x4768f9);WhatsappQueueEvents['on'](_0x2a3b9f,_0x8935a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e833088..6148ca3 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 _0x1617=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1617,0xbd));var _0x7161=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1617[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7161('0x0'));var timeout=require(_0x7161('0x1'));var express=require('express');var router=express[_0x7161('0x2')]();var fs_extra=require(_0x7161('0x3'));var auth=require(_0x7161('0x4'));var interaction=require(_0x7161('0x5'));var config=require(_0x7161('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x7161('0x7')]('/',auth['isAuthenticated'](),controller[_0x7161('0x8')]);router[_0x7161('0x7')](_0x7161('0x9'),auth[_0x7161('0xa')](),controller[_0x7161('0xb')]);router['get'](_0x7161('0xc'),auth['isAuthenticated'](),controller[_0x7161('0xd')]);router[_0x7161('0xe')]('/',auth[_0x7161('0xa')](),controller[_0x7161('0xf')]);router[_0x7161('0x10')](_0x7161('0xc'),auth[_0x7161('0xa')](),controller[_0x7161('0x11')]);router['delete'](_0x7161('0xc'),auth[_0x7161('0xa')](),controller[_0x7161('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf860=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xf860,0x71));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0f86('0x0'));var util=require(_0x0f86('0x1'));var path=require(_0x0f86('0x2'));var timeout=require(_0x0f86('0x3'));var express=require(_0x0f86('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0f86('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f86('0x6'));var controller=require(_0x0f86('0x7'));router[_0x0f86('0x8')]('/',auth[_0x0f86('0x9')](),controller[_0x0f86('0xa')]);router[_0x0f86('0x8')]('/describe',auth[_0x0f86('0x9')](),controller['describe']);router['get'](_0x0f86('0xb'),auth['isAuthenticated'](),controller[_0x0f86('0xc')]);router[_0x0f86('0xd')]('/',auth[_0x0f86('0x9')](),controller[_0x0f86('0xe')]);router[_0x0f86('0xf')](_0x0f86('0xb'),auth[_0x0f86('0x9')](),controller[_0x0f86('0x10')]);router[_0x0f86('0x11')]('/:id',auth[_0x0f86('0x9')](),controller['destroy']);module[_0x0f86('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index c1c5959..d512c9b 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(_0x27d91e,_0x2b9eab){var _0x5a2c41=function(_0x3fa010){while(--_0x3fa010){_0x27d91e['push'](_0x27d91e['shift']());}};_0x5a2c41(++_0x2b9eab);}(_0x7a54,0x106));var _0x47a5=function(_0x325438,_0x1f4f88){_0x325438=_0x325438-0x0;var _0x4b66c4=_0x7a54[_0x325438];return _0x4b66c4;};'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(_0x937fe7,_0x46567b){var _0x4fc595=function(_0x1a777f){while(--_0x1a777f){_0x937fe7['push'](_0x937fe7['shift']());}};_0x4fc595(++_0x46567b);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3a4047d..000f817 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 _0xa5fa=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','rows','catch','show','params','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1918f,_0x2a8725){var _0x3bd2f5=function(_0x5962c4){while(--_0x5962c4){_0x1918f['push'](_0x1918f['shift']());}};_0x3bd2f5(++_0x2a8725);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3f758f,_0x302451){_0x3f758f=_0x3f758f-0x0;var _0x26e4ae=_0xa5fa[_0x3f758f];return _0x26e4ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x1f66c0,_0xacbded){return function(_0x3d7bca){if(!_0x3d7bca){_0x1f66c0[_0xaa5f('0x17')](0x194);}return _0x3d7bca;};}function handleError(_0x51eb55,_0x2445a6){_0x2445a6=_0x2445a6||0x1f4;return function(_0x3a66e8){logger[_0xaa5f('0x27')](_0x3a66e8['stack']);if(_0x3a66e8[_0xaa5f('0x28')]){delete _0x3a66e8[_0xaa5f('0x28')];}_0x51eb55[_0xaa5f('0x19')](_0x2445a6)['send'](_0x3a66e8);};}exports[_0xaa5f('0x29')]=function(_0x479f29,_0x5990d2){var _0x27d1a4={},_0x50998f={},_0x1bffec={'count':0x0,'rows':[]};var _0x4e0ec9=_['map'](db['WhatsappQueueReport'][_0xaa5f('0x2a')],function(_0x4ddebd){return{'name':_0x4ddebd[_0xaa5f('0x2b')],'type':_0x4ddebd[_0xaa5f('0x2c')]['key']};});_0x50998f['model']=_[_0xaa5f('0x2d')](_0x4e0ec9,'name');_0x50998f[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0x479f29['query']);_0x50998f[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x50998f[_0xaa5f('0x32')],_0x50998f['query']);_0x27d1a4[_0xaa5f('0x33')]=_[_0xaa5f('0x31')](_0x50998f['model'],qs['fields'](_0x479f29['query']['fields']));_0x27d1a4[_0xaa5f('0x33')]=_0x27d1a4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x27d1a4[_0xaa5f('0x33')]:_0x50998f[_0xaa5f('0x32')];if(!_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x35')]('nolimit')){_0x27d1a4[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x1c')]);_0x27d1a4[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x479f29['query'][_0xaa5f('0x1a')]);}_0x27d1a4[_0xaa5f('0x36')]=qs[_0xaa5f('0x37')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x37')]);_0x27d1a4['where']=qs['filters'](_[_0xaa5f('0x38')](_0x479f29[_0xaa5f('0x2e')],_0x50998f[_0xaa5f('0x30')]),_0x4e0ec9);if(_0x479f29[_0xaa5f('0x2e')]['filter']){_0x27d1a4[_0xaa5f('0x39')]=_[_0xaa5f('0x3a')](_0x27d1a4[_0xaa5f('0x39')],{'$or':_[_0xaa5f('0x2d')](_0x4e0ec9,function(_0x37db88){if(_0x37db88[_0xaa5f('0x2c')]!==_0xaa5f('0x3b')){var _0x2c4d29={};_0x2c4d29[_0x37db88[_0xaa5f('0x28')]]={'$like':'%'+_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3c')]+'%'};return _0x2c4d29;}})});}_0x27d1a4=_['merge']({},_0x27d1a4,_0x479f29[_0xaa5f('0x3d')]);var _0x2562ce={'where':_0x27d1a4[_0xaa5f('0x39')]};return db[_0xaa5f('0x3e')][_0xaa5f('0x1d')](_0x2562ce)[_0xaa5f('0x25')](function(_0x1fb572){_0x1bffec[_0xaa5f('0x1d')]=_0x1fb572;if(_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3f')]){_0x27d1a4['include']=[{'all':!![]}];}return db[_0xaa5f('0x3e')]['findAll'](_0x27d1a4);})[_0xaa5f('0x25')](function(_0x21f4bc){_0x1bffec[_0xaa5f('0x40')]=_0x21f4bc;return _0x1bffec;})['then'](respondWithFilteredResult(_0x5990d2,_0x27d1a4))[_0xaa5f('0x41')](handleError(_0x5990d2,null));};exports[_0xaa5f('0x42')]=function(_0xe49f8,_0x528b08){var _0x12a8e4={'raw':!![],'where':{'id':_0xe49f8[_0xaa5f('0x43')]['id']}},_0x179be8={};_0x179be8[_0xaa5f('0x32')]=_['keys'](db[_0xaa5f('0x3e')][_0xaa5f('0x2a')]);_0x179be8[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0xe49f8[_0xaa5f('0x2e')]);_0x179be8[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x179be8[_0xaa5f('0x32')],_0x179be8['query']);_0x12a8e4[_0xaa5f('0x33')]=_['intersection'](_0x179be8[_0xaa5f('0x32')],qs['fields'](_0xe49f8[_0xaa5f('0x2e')][_0xaa5f('0x44')]));_0x12a8e4['attributes']=_0x12a8e4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x12a8e4[_0xaa5f('0x33')]:_0x179be8['model'];if(_0xe49f8['query']['includeAll']){_0x12a8e4[_0xaa5f('0x45')]=[{'all':!![]}];}_0x12a8e4=_['merge']({},_0x12a8e4,_0xe49f8[_0xaa5f('0x3d')]);return db[_0xaa5f('0x3e')][_0xaa5f('0x46')](_0x12a8e4)[_0xaa5f('0x25')](handleEntityNotFound(_0x528b08,null))['then'](respondWithResult(_0x528b08,null))[_0xaa5f('0x41')](handleError(_0x528b08,null));};exports[_0xaa5f('0x47')]=function(_0x3c6a17,_0x231ad1){return db[_0xaa5f('0x3e')][_0xaa5f('0x47')](_0x3c6a17[_0xaa5f('0x48')],{})[_0xaa5f('0x25')](respondWithResult(_0x231ad1,0xc9))[_0xaa5f('0x41')](handleError(_0x231ad1,null));};exports[_0xaa5f('0x24')]=function(_0x3ea553,_0x2de737){if(_0x3ea553[_0xaa5f('0x48')]['id']){delete _0x3ea553[_0xaa5f('0x48')]['id'];}return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x3ea553['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2de737,null))[_0xaa5f('0x25')](saveUpdates(_0x3ea553[_0xaa5f('0x48')],null))[_0xaa5f('0x25')](respondWithResult(_0x2de737,null))[_0xaa5f('0x41')](handleError(_0x2de737,null));};exports[_0xaa5f('0x26')]=function(_0x32bbed,_0x4aa556){return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x32bbed[_0xaa5f('0x43')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4aa556,null))['then'](removeEntity(_0x4aa556,null))[_0xaa5f('0x41')](handleError(_0x4aa556,null));};exports[_0xaa5f('0x49')]=function(_0x36c4aa,_0x575803){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x575803,null))['catch'](handleError(_0x575803,null));}; \ No newline at end of file +var _0x4e81=['limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x4e81[_0x4f8f3b];return _0x4c250c;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};exports[_0x14e8('0x4e')]=function(_0x4cc86a,_0x519c9c){return db[_0x14e8('0x2b')][_0x14e8('0x4e')]()[_0x14e8('0x24')](respondWithResult(_0x519c9c,null))[_0x14e8('0x49')](handleError(_0x519c9c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 884ddb9..2d7b047 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 _0xb04f=['request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','lodash','../../config/logger','bluebird'];(function(_0x2059ed,_0x86ecf4){var _0x5073ab=function(_0x320c95){while(--_0x320c95){_0x2059ed['push'](_0x2059ed['shift']());}};_0x5073ab(++_0x86ecf4);}(_0xb04f,0x13d));var _0xfb04=function(_0x1467b3,_0x2bd11a){_0x1467b3=_0x1467b3-0x0;var _0x2e704a=_0xb04f[_0x1467b3];return _0x2e704a;};'use strict';var _=require(_0xfb04('0x0'));var util=require('util');var logger=require(_0xfb04('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfb04('0x2'));var rp=require(_0xfb04('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb04('0x4'));var config=require(_0xfb04('0x5'));var attributes=require(_0xfb04('0x6'));module[_0xfb04('0x7')]=function(_0x304893,_0x1f3067){return _0x304893['define']('WhatsappQueueReport',attributes,{'tableName':_0xfb04('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfb04('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf8d=['report_whatsapp_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xaf8d,0xb8));var _0xdaf8=function(_0x291d47,_0x1fdd62){_0x291d47=_0x291d47-0x0;var _0x380ff0=_0xaf8d[_0x291d47];return _0x380ff0;};'use strict';var _=require(_0xdaf8('0x0'));var util=require(_0xdaf8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdaf8('0x2'));var BPromise=require(_0xdaf8('0x3'));var rp=require(_0xdaf8('0x4'));var fs=require('fs');var path=require(_0xdaf8('0x5'));var rimraf=require(_0xdaf8('0x6'));var config=require(_0xdaf8('0x7'));var attributes=require(_0xdaf8('0x8'));module[_0xdaf8('0x9')]=function(_0x11cd5f,_0x11e80d){return _0x11cd5f[_0xdaf8('0xa')](_0xdaf8('0xb'),attributes,{'tableName':_0xdaf8('0xc'),'paranoid':![],'indexes':[{'name':_0xdaf8('0xd'),'fields':[_0xdaf8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 1ee1414..136921b 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 _0xc37a=['message','result','catch','create','body','options','CreateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3349ac,_0x889beb){var _0x18d071=function(_0x2993d3){while(--_0x2993d3){_0x3349ac['push'](_0x3349ac['shift']());}};_0x18d071(++_0x889beb);}(_0xc37a,0xcd));var _0xac37=function(_0x389590,_0x2a3179){_0x389590=_0x389590-0x0;var _0x3bce39=_0xc37a[_0x389590];return _0x3bce39;};'use strict';var _=require(_0xac37('0x0'));var util=require(_0xac37('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac37('0x2'))['db'];var utils=require(_0xac37('0x3'));var logger=require(_0xac37('0x4'))(_0xac37('0x5'));var config=require(_0xac37('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xac37('0x7')][_0xac37('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21188b,_0x4c326b,_0x528965){return new BPromise(function(_0x28e534,_0x1d6fd3){return client[_0xac37('0x9')](_0x21188b,_0x528965)[_0xac37('0xa')](function(_0x560312){logger[_0xac37('0xb')](_0xac37('0xc'),_0x4c326b,_0xac37('0xd'));logger[_0xac37('0xe')](_0xac37('0xf'),_0x4c326b,_0xac37('0xd'),JSON[_0xac37('0x10')](_0x560312));if(_0x560312['error']){if(_0x560312[_0xac37('0x11')][_0xac37('0x12')]===0x1f4){logger[_0xac37('0x11')](_0xac37('0xc'),_0x4c326b,_0x560312[_0xac37('0x11')][_0xac37('0x13')]);return _0x1d6fd3(_0x560312[_0xac37('0x11')][_0xac37('0x13')]);}logger['error'](_0xac37('0xc'),_0x4c326b,_0x560312[_0xac37('0x11')][_0xac37('0x13')]);return _0x28e534(_0x560312[_0xac37('0x11')][_0xac37('0x13')]);}else{logger[_0xac37('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4c326b,_0xac37('0xd'));_0x28e534(_0x560312[_0xac37('0x14')][_0xac37('0x13')]);}})[_0xac37('0x15')](function(_0x4815a8){logger[_0xac37('0x11')](_0xac37('0xc'),_0x4c326b,_0x4815a8);_0x1d6fd3(_0x4815a8);});});}exports['CreateWhatsappQueueReport']=function(_0x40ebd7){var _0x4d7368=this;return new Promise(function(_0x44e944,_0x26e186){return db['WhatsappQueueReport'][_0xac37('0x16')](_0x40ebd7[_0xac37('0x17')],{'raw':_0x40ebd7[_0xac37('0x18')]?_0x40ebd7[_0xac37('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xac37('0xa')](function(_0x32c79f){logger[_0xac37('0xb')](_0xac37('0x19'),_0x40ebd7);logger['debug'](_0xac37('0x19'),_0x40ebd7,JSON['stringify'](_0x32c79f));_0x44e944(_0x32c79f);})['catch'](function(_0x5d95d1){logger[_0xac37('0x11')](_0xac37('0x19'),_0x5d95d1['message'],_0x40ebd7);_0x26e186(_0x4d7368[_0xac37('0x11')](0x1f4,_0x5d95d1['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x5d18c5){var _0x57f2a2=this;return new Promise(function(_0x713120,_0x4d53c1){return db[_0xac37('0x1a')][_0xac37('0x1b')](_0x5d18c5[_0xac37('0x17')],{'raw':_0x5d18c5[_0xac37('0x18')]?_0x5d18c5[_0xac37('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d18c5[_0xac37('0x18')]?_0x5d18c5[_0xac37('0x18')][_0xac37('0x1c')]||null:null,'attributes':_0x5d18c5['options']?_0x5d18c5[_0xac37('0x18')][_0xac37('0x1d')]||null:null,'limit':_0x5d18c5[_0xac37('0x18')]?_0x5d18c5[_0xac37('0x18')][_0xac37('0x1e')]||null:null})[_0xac37('0xa')](function(_0xb52c2a){logger[_0xac37('0xb')](_0xac37('0x1f'),_0x5d18c5);logger['debug'](_0xac37('0x1f'),_0x5d18c5,JSON[_0xac37('0x10')](_0xb52c2a));_0x713120(_0xb52c2a);})[_0xac37('0x15')](function(_0x33e7ec){logger[_0xac37('0x11')](_0xac37('0x1f'),_0x33e7ec[_0xac37('0x13')],_0x5d18c5);_0x4d53c1(_0x57f2a2[_0xac37('0x11')](0x1f4,_0x33e7ec[_0xac37('0x13')]));});});}; \ No newline at end of file +var _0x838d=['request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','stringify','catch','UpdateWhatsappQueueReport','update','where','lodash','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x23b30e,_0x59fb2e){var _0x5b0c65=function(_0x1757ae){while(--_0x1757ae){_0x23b30e['push'](_0x23b30e['shift']());}};_0x5b0c65(++_0x59fb2e);}(_0x838d,0xa0));var _0xd838=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x838d[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xd838('0x0'));var util=require('util');var moment=require(_0xd838('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd838('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd838('0x3'))(_0xd838('0x4'));var config=require('../../config/environment');var jayson=require(_0xd838('0x5'));var client=jayson[_0xd838('0x6')][_0xd838('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f2621,_0x825715,_0x59e1a4){return new BPromise(function(_0x18bfe8,_0x59d097){return client[_0xd838('0x8')](_0x4f2621,_0x59e1a4)[_0xd838('0x9')](function(_0x5b5bde){logger[_0xd838('0xa')](_0xd838('0xb'),_0x825715,_0xd838('0xc'));logger[_0xd838('0xd')](_0xd838('0xe'),_0x825715,_0xd838('0xc'),JSON['stringify'](_0x5b5bde));if(_0x5b5bde[_0xd838('0xf')]){if(_0x5b5bde[_0xd838('0xf')]['code']===0x1f4){logger[_0xd838('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x825715,_0x5b5bde[_0xd838('0xf')][_0xd838('0x10')]);return _0x59d097(_0x5b5bde['error']['message']);}logger[_0xd838('0xf')](_0xd838('0xb'),_0x825715,_0x5b5bde[_0xd838('0xf')][_0xd838('0x10')]);return _0x18bfe8(_0x5b5bde['error'][_0xd838('0x10')]);}else{logger['info'](_0xd838('0xb'),_0x825715,'request\x20sent');_0x18bfe8(_0x5b5bde[_0xd838('0x11')][_0xd838('0x10')]);}})['catch'](function(_0xb85617){logger[_0xd838('0xf')](_0xd838('0xb'),_0x825715,_0xb85617);_0x59d097(_0xb85617);});});}exports[_0xd838('0x12')]=function(_0x3ee26f){var _0x5314f2=this;return new Promise(function(_0x312525,_0x477208){return db[_0xd838('0x13')][_0xd838('0x14')](_0x3ee26f[_0xd838('0x15')],{'raw':_0x3ee26f[_0xd838('0x16')]?_0x3ee26f['options']['raw']===undefined?!![]:![]:!![]})[_0xd838('0x9')](function(_0x5044c1){logger['info'](_0xd838('0x12'),_0x3ee26f);logger['debug']('CreateWhatsappQueueReport',_0x3ee26f,JSON[_0xd838('0x17')](_0x5044c1));_0x312525(_0x5044c1);})[_0xd838('0x18')](function(_0x209fc0){logger[_0xd838('0xf')](_0xd838('0x12'),_0x209fc0[_0xd838('0x10')],_0x3ee26f);_0x477208(_0x5314f2[_0xd838('0xf')](0x1f4,_0x209fc0[_0xd838('0x10')]));});});};exports[_0xd838('0x19')]=function(_0x1cf2b8){var _0x523080=this;return new Promise(function(_0x336331,_0x4d293e){return db[_0xd838('0x13')][_0xd838('0x1a')](_0x1cf2b8['body'],{'raw':_0x1cf2b8[_0xd838('0x16')]?_0x1cf2b8[_0xd838('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cf2b8[_0xd838('0x16')]?_0x1cf2b8['options'][_0xd838('0x1b')]||null:null,'attributes':_0x1cf2b8['options']?_0x1cf2b8[_0xd838('0x16')]['attributes']||null:null,'limit':_0x1cf2b8['options']?_0x1cf2b8[_0xd838('0x16')]['limit']||null:null})['then'](function(_0x1e10b4){logger[_0xd838('0xa')](_0xd838('0x19'),_0x1cf2b8);logger[_0xd838('0xd')](_0xd838('0x19'),_0x1cf2b8,JSON[_0xd838('0x17')](_0x1e10b4));_0x336331(_0x1e10b4);})['catch'](function(_0x335f1f){logger[_0xd838('0xf')](_0xd838('0x19'),_0x335f1f[_0xd838('0x10')],_0x1cf2b8);_0x4d293e(_0x523080[_0xd838('0xf')](0x1f4,_0x335f1f[_0xd838('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 81aeedf..991e540 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 _0xe6b4=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x129422,_0x4af03c){var _0x3f7f3a=function(_0x1b1fcd){while(--_0x1b1fcd){_0x129422['push'](_0x129422['shift']());}};_0x3f7f3a(++_0x4af03c);}(_0xe6b4,0x8d));var _0x4e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4e6b('0x0'));var util=require(_0x4e6b('0x1'));var path=require(_0x4e6b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e6b('0x3'));var router=express[_0x4e6b('0x4')]();var fs_extra=require(_0x4e6b('0x5'));var auth=require(_0x4e6b('0x6'));var interaction=require(_0x4e6b('0x7'));var config=require(_0x4e6b('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x4e6b('0x9')]('/',auth[_0x4e6b('0xa')](),controller[_0x4e6b('0xb')]);router[_0x4e6b('0x9')](_0x4e6b('0xc'),auth[_0x4e6b('0xa')](),controller[_0x4e6b('0xd')]);router[_0x4e6b('0x9')](_0x4e6b('0xe'),auth[_0x4e6b('0xa')](),controller[_0x4e6b('0xf')]);router[_0x4e6b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e6b('0x11')](_0x4e6b('0xe'),auth[_0x4e6b('0xa')](),controller[_0x4e6b('0x12')]);router[_0x4e6b('0x13')](_0x4e6b('0xe'),auth[_0x4e6b('0xa')](),controller['destroy']);module[_0x4e6b('0x14')]=router; \ No newline at end of file +var _0xa38a=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3d5c7a,_0x5c640f){var _0x1caee0=function(_0xb245e){while(--_0xb245e){_0x3d5c7a['push'](_0x3d5c7a['shift']());}};_0x1caee0(++_0x5c640f);}(_0xa38a,0xe8));var _0xaa38=function(_0x3a86ed,_0x30a3ca){_0x3a86ed=_0x3a86ed-0x0;var _0x3d4857=_0xa38a[_0x3a86ed];return _0x3d4857;};'use strict';var multer=require(_0xaa38('0x0'));var util=require('util');var path=require(_0xaa38('0x1'));var timeout=require(_0xaa38('0x2'));var express=require(_0xaa38('0x3'));var router=express[_0xaa38('0x4')]();var fs_extra=require(_0xaa38('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa38('0x6'));var config=require('../../config/environment');var controller=require(_0xaa38('0x7'));router[_0xaa38('0x8')]('/',auth[_0xaa38('0x9')](),controller[_0xaa38('0xa')]);router[_0xaa38('0x8')](_0xaa38('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xaa38('0x8')](_0xaa38('0xc'),auth[_0xaa38('0x9')](),controller[_0xaa38('0xd')]);router[_0xaa38('0xe')]('/',auth['isAuthenticated'](),controller[_0xaa38('0xf')]);router[_0xaa38('0x10')](_0xaa38('0xc'),auth[_0xaa38('0x9')](),controller[_0xaa38('0x11')]);router[_0xaa38('0x12')]('/:id',auth[_0xaa38('0x9')](),controller[_0xaa38('0x13')]);module[_0xaa38('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 682929e..be1bedf 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 _0xe1aa=['sequelize','exports','account','agent','queue','DATE'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xe1aa,0xfc));var _0xae1a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe1aa[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xae1a('0x0'));module[_0xae1a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xae1a('0x2'),_0xae1a('0x3'),_0xae1a('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xae1a('0x5')]}}; \ No newline at end of file +var _0x3d2f=['sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0xb1be3b,_0x56f018){var _0x1819f2=function(_0x38cedc){while(--_0x38cedc){_0xb1be3b['push'](_0xb1be3b['shift']());}};_0x1819f2(++_0x56f018);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x320112,_0x5f10ae){_0x320112=_0x320112-0x0;var _0x353564=_0x3d2f[_0x320112];return _0x353564;};'use strict';var Sequelize=require(_0xf3d2('0x0'));module[_0xf3d2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf3d2('0x2')](_0xf3d2('0x3'),_0xf3d2('0x4'),_0xf3d2('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf3d2('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index d95cc77..f0a4800 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 _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x38b36e,_0x3097de){var _0x12d5a8=function(_0x4bfd8b){while(--_0x4bfd8b){_0x38b36e['push'](_0x38b36e['shift']());}};_0x12d5a8(++_0x3097de);}(_0x5b12,0xa3));var _0x25b1=function(_0x1835f4,_0x2f3e9d){_0x1835f4=_0x1835f4-0x0;var _0x26b67f=_0x5b12[_0x1835f4];return _0x26b67f;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['WhatsappTransferReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file +var _0x1aab=['../../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','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x21f4d9,_0x558a77){var _0x2bb41a=function(_0x341b7d){while(--_0x341b7d){_0x21f4d9['push'](_0x21f4d9['shift']());}};_0x2bb41a(++_0x558a77);}(_0x1aab,0x122));var _0xb1aa=function(_0x206e32,_0x1b8cf7){_0x206e32=_0x206e32-0x0;var _0x41f497=_0x1aab[_0x206e32];return _0x41f497;};'use strict';var emlformat=require(_0xb1aa('0x0'));var rimraf=require(_0xb1aa('0x1'));var zipdir=require(_0xb1aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1aa('0x3'));var moment=require('moment');var BPromise=require(_0xb1aa('0x4'));var Mustache=require(_0xb1aa('0x5'));var util=require(_0xb1aa('0x6'));var path=require(_0xb1aa('0x7'));var sox=require(_0xb1aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1aa('0x9'));var _=require(_0xb1aa('0xa'));var squel=require(_0xb1aa('0xb'));var crypto=require(_0xb1aa('0xc'));var jsforce=require(_0xb1aa('0xd'));var deskjs=require(_0xb1aa('0xe'));var toCsv=require(_0xb1aa('0xf'));var querystring=require('querystring');var Papa=require(_0xb1aa('0x10'));var Redis=require(_0xb1aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb1aa('0x12'));var as=require(_0xb1aa('0x13'));var hardwareService=require(_0xb1aa('0x14'));var logger=require(_0xb1aa('0x15'))(_0xb1aa('0x16'));var utils=require(_0xb1aa('0x17'));var config=require(_0xb1aa('0x18'));var licenseUtil=require(_0xb1aa('0x19'));var db=require(_0xb1aa('0x1a'))['db'];function respondWithStatusCode(_0x330c54,_0x46d422){_0x46d422=_0x46d422||0xcc;return function(_0x419c79){if(_0x419c79){return _0x330c54[_0xb1aa('0x1b')](_0x46d422);}return _0x330c54[_0xb1aa('0x1c')](_0x46d422)[_0xb1aa('0x1d')]();};}function respondWithResult(_0x48543b,_0x4d9ad5){_0x4d9ad5=_0x4d9ad5||0xc8;return function(_0xc75972){if(_0xc75972){return _0x48543b['status'](_0x4d9ad5)[_0xb1aa('0x1e')](_0xc75972);}};}function respondWithFilteredResult(_0x47bdde,_0x7a3b6a){return function(_0x49bf6b){if(_0x49bf6b){var _0x24b12d=typeof _0x7a3b6a['offset']===_0xb1aa('0x1f')&&typeof _0x7a3b6a[_0xb1aa('0x20')]==='undefined';var _0x2531f2=_0x49bf6b[_0xb1aa('0x21')];var _0x1d1450=_0x24b12d?0x0:_0x7a3b6a[_0xb1aa('0x22')];var _0x2c67f3=_0x24b12d?_0x49bf6b[_0xb1aa('0x21')]:_0x7a3b6a[_0xb1aa('0x22')]+_0x7a3b6a[_0xb1aa('0x20')];var _0x36dc82;if(_0x2c67f3>=_0x2531f2){_0x2c67f3=_0x2531f2;_0x36dc82=0xc8;}else{_0x36dc82=0xce;}_0x47bdde[_0xb1aa('0x1c')](_0x36dc82);return _0x47bdde[_0xb1aa('0x23')](_0xb1aa('0x24'),_0x1d1450+'-'+_0x2c67f3+'/'+_0x2531f2)[_0xb1aa('0x1e')](_0x49bf6b);}return null;};}function patchUpdates(_0x5ca191){return function(_0x5a3ec5){try{jsonpatch[_0xb1aa('0x25')](_0x5a3ec5,_0x5ca191,!![]);}catch(_0x2e6725){return BPromise[_0xb1aa('0x26')](_0x2e6725);}return _0x5a3ec5[_0xb1aa('0x27')]();};}function saveUpdates(_0x5b9a93,_0x465630){return function(_0x143e99){if(_0x143e99){return _0x143e99['update'](_0x5b9a93)[_0xb1aa('0x28')](function(_0x17298c){return _0x17298c;});}return null;};}function removeEntity(_0x2be697,_0x5f2aa7){return function(_0x5bb543){if(_0x5bb543){return _0x5bb543[_0xb1aa('0x29')]()[_0xb1aa('0x28')](function(){_0x2be697[_0xb1aa('0x1c')](0xcc)[_0xb1aa('0x1d')]();});}};}function handleEntityNotFound(_0x3a9c9e,_0x2f1db9){return function(_0x26ec21){if(!_0x26ec21){_0x3a9c9e[_0xb1aa('0x1b')](0x194);}return _0x26ec21;};}function handleError(_0x1ba189,_0x470705){_0x470705=_0x470705||0x1f4;return function(_0x1cd714){logger[_0xb1aa('0x2a')](_0x1cd714[_0xb1aa('0x2b')]);if(_0x1cd714[_0xb1aa('0x2c')]){delete _0x1cd714[_0xb1aa('0x2c')];}_0x1ba189['status'](_0x470705)[_0xb1aa('0x2d')](_0x1cd714);};}exports[_0xb1aa('0x2e')]=function(_0x3c1b92,_0x13f92d){var _0x4b2c43={},_0xa4a319={},_0x44ac69={'count':0x0,'rows':[]};var _0x5b2cde=_[_0xb1aa('0x2f')](db[_0xb1aa('0x30')][_0xb1aa('0x31')],function(_0x505542){return{'name':_0x505542[_0xb1aa('0x32')],'type':_0x505542[_0xb1aa('0x33')]['key']};});_0xa4a319['model']=_[_0xb1aa('0x2f')](_0x5b2cde,_0xb1aa('0x2c'));_0xa4a319[_0xb1aa('0x34')]=_[_0xb1aa('0x35')](_0x3c1b92[_0xb1aa('0x34')]);_0xa4a319[_0xb1aa('0x36')]=_['intersection'](_0xa4a319[_0xb1aa('0x37')],_0xa4a319['query']);_0x4b2c43['attributes']=_['intersection'](_0xa4a319[_0xb1aa('0x37')],qs[_0xb1aa('0x38')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x38')]));_0x4b2c43[_0xb1aa('0x39')]=_0x4b2c43['attributes'][_0xb1aa('0x3a')]?_0x4b2c43[_0xb1aa('0x39')]:_0xa4a319[_0xb1aa('0x37')];if(!_0x3c1b92['query']['hasOwnProperty']('nolimit')){_0x4b2c43[_0xb1aa('0x20')]=qs[_0xb1aa('0x20')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x20')]);_0x4b2c43['offset']=qs[_0xb1aa('0x22')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x22')]);}_0x4b2c43[_0xb1aa('0x3b')]=qs['sort'](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3c')]);_0x4b2c43[_0xb1aa('0x3d')]=qs['filters'](_[_0xb1aa('0x3e')](_0x3c1b92[_0xb1aa('0x34')],_0xa4a319[_0xb1aa('0x36')]),_0x5b2cde);if(_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]){_0x4b2c43[_0xb1aa('0x3d')]=_[_0xb1aa('0x40')](_0x4b2c43[_0xb1aa('0x3d')],{'$or':_[_0xb1aa('0x2f')](_0x5b2cde,function(_0x5069c6){if(_0x5069c6[_0xb1aa('0x33')]!=='VIRTUAL'){var _0xa79749={};_0xa79749[_0x5069c6[_0xb1aa('0x2c')]]={'$like':'%'+_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]+'%'};return _0xa79749;}})});}_0x4b2c43=_['merge']({},_0x4b2c43,_0x3c1b92[_0xb1aa('0x41')]);var _0x125f45={'where':_0x4b2c43[_0xb1aa('0x3d')]};return db['WhatsappTransferReport'][_0xb1aa('0x21')](_0x125f45)[_0xb1aa('0x28')](function(_0x56cb5b){_0x44ac69['count']=_0x56cb5b;if(_0x3c1b92['query'][_0xb1aa('0x42')]){_0x4b2c43[_0xb1aa('0x43')]=[{'all':!![]}];}return db[_0xb1aa('0x30')][_0xb1aa('0x44')](_0x4b2c43);})['then'](function(_0xcf3f4f){_0x44ac69[_0xb1aa('0x45')]=_0xcf3f4f;return _0x44ac69;})[_0xb1aa('0x28')](respondWithFilteredResult(_0x13f92d,_0x4b2c43))[_0xb1aa('0x46')](handleError(_0x13f92d,null));};exports[_0xb1aa('0x47')]=function(_0x581ca5,_0x25da68){var _0x1f2817={'raw':!![],'where':{'id':_0x581ca5[_0xb1aa('0x48')]['id']}},_0xe5be48={};_0xe5be48[_0xb1aa('0x37')]=_[_0xb1aa('0x35')](db[_0xb1aa('0x30')][_0xb1aa('0x31')]);_0xe5be48['query']=_[_0xb1aa('0x35')](_0x581ca5[_0xb1aa('0x34')]);_0xe5be48['filters']=_[_0xb1aa('0x49')](_0xe5be48[_0xb1aa('0x37')],_0xe5be48[_0xb1aa('0x34')]);_0x1f2817[_0xb1aa('0x39')]=_['intersection'](_0xe5be48['model'],qs[_0xb1aa('0x38')](_0x581ca5[_0xb1aa('0x34')]['fields']));_0x1f2817[_0xb1aa('0x39')]=_0x1f2817[_0xb1aa('0x39')][_0xb1aa('0x3a')]?_0x1f2817['attributes']:_0xe5be48[_0xb1aa('0x37')];if(_0x581ca5[_0xb1aa('0x34')]['includeAll']){_0x1f2817['include']=[{'all':!![]}];}_0x1f2817=_[_0xb1aa('0x40')]({},_0x1f2817,_0x581ca5[_0xb1aa('0x41')]);return db[_0xb1aa('0x30')]['find'](_0x1f2817)[_0xb1aa('0x28')](handleEntityNotFound(_0x25da68,null))[_0xb1aa('0x28')](respondWithResult(_0x25da68,null))[_0xb1aa('0x46')](handleError(_0x25da68,null));};exports[_0xb1aa('0x4a')]=function(_0x12baec,_0x54d7c1){return db[_0xb1aa('0x30')][_0xb1aa('0x4a')](_0x12baec[_0xb1aa('0x4b')],{})[_0xb1aa('0x28')](respondWithResult(_0x54d7c1,0xc9))['catch'](handleError(_0x54d7c1,null));};exports['update']=function(_0x213ab2,_0xfd9d9e){if(_0x213ab2['body']['id']){delete _0x213ab2[_0xb1aa('0x4b')]['id'];}return db[_0xb1aa('0x30')][_0xb1aa('0x4c')]({'where':{'id':_0x213ab2['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0xfd9d9e,null))[_0xb1aa('0x28')](saveUpdates(_0x213ab2[_0xb1aa('0x4b')],null))[_0xb1aa('0x28')](respondWithResult(_0xfd9d9e,null))[_0xb1aa('0x46')](handleError(_0xfd9d9e,null));};exports[_0xb1aa('0x29')]=function(_0x764e3a,_0x278a56){return db[_0xb1aa('0x30')]['find']({'where':{'id':_0x764e3a['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0x278a56,null))[_0xb1aa('0x28')](removeEntity(_0x278a56,null))[_0xb1aa('0x46')](handleError(_0x278a56,null));};exports['describe']=function(_0x5ec073,_0x5c9842){return db['WhatsappTransferReport']['describe']()['then'](respondWithResult(_0x5c9842,null))[_0xb1aa('0x46')](handleError(_0x5c9842,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 1b449e5..d4320e9 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 _0x9c59=['exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9c59,0x162));var _0x99c5=function(_0xc54223,_0x123d5d){_0xc54223=_0xc54223-0x0;var _0x5b2431=_0x9c59[_0xc54223];return _0x5b2431;};'use strict';var _=require(_0x99c5('0x0'));var util=require(_0x99c5('0x1'));var logger=require(_0x99c5('0x2'))(_0x99c5('0x3'));var moment=require(_0x99c5('0x4'));var BPromise=require(_0x99c5('0x5'));var rp=require(_0x99c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99c5('0x7'));var config=require(_0x99c5('0x8'));var attributes=require(_0x99c5('0x9'));module[_0x99c5('0xa')]=function(_0x2706ce,_0x12ff33){return _0x2706ce['define'](_0x99c5('0xb'),attributes,{'tableName':_0x99c5('0xc'),'paranoid':![],'indexes':[{'name':_0x99c5('0xd'),'fields':[_0x99c5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d65=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','lodash','util','api','bluebird'];(function(_0x369c70,_0x5892f0){var _0xb7e463=function(_0x3822c8){while(--_0x3822c8){_0x369c70['push'](_0x369c70['shift']());}};_0xb7e463(++_0x5892f0);}(_0x0d65,0xa4));var _0x50d6=function(_0x4a0fe1,_0x14650e){_0x4a0fe1=_0x4a0fe1-0x0;var _0xc5dc85=_0x0d65[_0x4a0fe1];return _0xc5dc85;};'use strict';var _=require(_0x50d6('0x0'));var util=require(_0x50d6('0x1'));var logger=require('../../config/logger')(_0x50d6('0x2'));var moment=require('moment');var BPromise=require(_0x50d6('0x3'));var rp=require(_0x50d6('0x4'));var fs=require('fs');var path=require(_0x50d6('0x5'));var rimraf=require(_0x50d6('0x6'));var config=require(_0x50d6('0x7'));var attributes=require(_0x50d6('0x8'));module[_0x50d6('0x9')]=function(_0xf6bb32,_0x294fde){return _0xf6bb32['define'](_0x50d6('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x50d6('0xb'),'fields':[_0x50d6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index cbe4dc6..0617256 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 _0x6244=['client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x19c493,_0x1153f3){var _0x479039=function(_0x180d73){while(--_0x180d73){_0x19c493['push'](_0x19c493['shift']());}};_0x479039(++_0x1153f3);}(_0x6244,0x11c));var _0x4624=function(_0x268119,_0x8771fe){_0x268119=_0x268119-0x0;var _0x5b5b56=_0x6244[_0x268119];return _0x5b5b56;};'use strict';var _=require(_0x4624('0x0'));var util=require(_0x4624('0x1'));var moment=require(_0x4624('0x2'));var BPromise=require('bluebird');var rs=require(_0x4624('0x3'));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('jayson/promise');var client=jayson[_0x4624('0x4')][_0x4624('0x5')]({'port':0x232a});function respondWithRpcPromise(_0xab0af6,_0x34ec27,_0x336796){return new BPromise(function(_0x461e12,_0x1f307b){return client['request'](_0xab0af6,_0x336796)[_0x4624('0x6')](function(_0x386a44){logger[_0x4624('0x7')](_0x4624('0x8'),_0x34ec27,_0x4624('0x9'));logger[_0x4624('0xa')](_0x4624('0xb'),_0x34ec27,_0x4624('0x9'),JSON[_0x4624('0xc')](_0x386a44));if(_0x386a44[_0x4624('0xd')]){if(_0x386a44[_0x4624('0xd')][_0x4624('0xe')]===0x1f4){logger[_0x4624('0xd')](_0x4624('0x8'),_0x34ec27,_0x386a44['error']['message']);return _0x1f307b(_0x386a44[_0x4624('0xd')][_0x4624('0xf')]);}logger['error'](_0x4624('0x8'),_0x34ec27,_0x386a44[_0x4624('0xd')][_0x4624('0xf')]);return _0x461e12(_0x386a44[_0x4624('0xd')][_0x4624('0xf')]);}else{logger[_0x4624('0x7')](_0x4624('0x8'),_0x34ec27,_0x4624('0x9'));_0x461e12(_0x386a44[_0x4624('0x10')][_0x4624('0xf')]);}})[_0x4624('0x11')](function(_0x114f18){logger[_0x4624('0xd')](_0x4624('0x8'),_0x34ec27,_0x114f18);_0x1f307b(_0x114f18);});});} \ No newline at end of file +var _0x773c=['result','lodash','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message'];(function(_0xdb71c8,_0x21880a){var _0x532fa4=function(_0x2f9411){while(--_0x2f9411){_0xdb71c8['push'](_0xdb71c8['shift']());}};_0x532fa4(++_0x21880a);}(_0x773c,0x86));var _0xc773=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x773c[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xc773('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc773('0x1'))['db'];var utils=require(_0xc773('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xc773('0x3'));var jayson=require(_0xc773('0x4'));var client=jayson[_0xc773('0x5')][_0xc773('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33cedf,_0x2d20b4,_0xf029ef){return new BPromise(function(_0x32c473,_0x42d60d){return client[_0xc773('0x7')](_0x33cedf,_0xf029ef)[_0xc773('0x8')](function(_0x1bb38c){logger[_0xc773('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d20b4,'request\x20sent');logger[_0xc773('0xa')](_0xc773('0xb'),_0x2d20b4,_0xc773('0xc'),JSON[_0xc773('0xd')](_0x1bb38c));if(_0x1bb38c[_0xc773('0xe')]){if(_0x1bb38c[_0xc773('0xe')][_0xc773('0xf')]===0x1f4){logger[_0xc773('0xe')](_0xc773('0x10'),_0x2d20b4,_0x1bb38c['error']['message']);return _0x42d60d(_0x1bb38c[_0xc773('0xe')]['message']);}logger[_0xc773('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d20b4,_0x1bb38c[_0xc773('0xe')][_0xc773('0x11')]);return _0x32c473(_0x1bb38c[_0xc773('0xe')][_0xc773('0x11')]);}else{logger['info'](_0xc773('0x10'),_0x2d20b4,'request\x20sent');_0x32c473(_0x1bb38c[_0xc773('0x12')][_0xc773('0x11')]);}})['catch'](function(_0xb49d6e){logger[_0xc773('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d20b4,_0xb49d6e);_0x42d60d(_0xb49d6e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index b15740b..13e6605 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x824c=['filter','online','name','join','Offline\x20apps:','map','status','seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','listen','then','info','start','Online\x20apps:'];(function(_0x278bfd,_0x7b1774){var _0x5587b5=function(_0x33ef87){while(--_0x33ef87){_0x278bfd['push'](_0x278bfd['shift']());}};_0x5587b5(++_0x7b1774);}(_0x824c,0x1a1));var _0xc824=function(_0x13239a,_0x4fad76){_0x13239a=_0x13239a-0x0;var _0x43370b=_0x824c[_0x13239a];return _0x43370b;};'use strict';var _=require(_0xc824('0x0'));var mysqldb=require(_0xc824('0x1'));var rpc=require('./rpc');var config=require(_0xc824('0x2'));var logger=require(_0xc824('0x3'))(_0xc824('0x4'));var pm2=require(_0xc824('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xc824('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xc824('0x7'));var transcribe=require(_0xc824('0x8'));function main(){return mysqldb['db'][_0xc824('0x9')]['sync']()['then'](function(){return rpc[_0xc824('0xa')]();})[_0xc824('0xb')](function(_0x2efaa0){logger[_0xc824('0xc')](_0x2efaa0);return chat['start']();})[_0xc824('0xb')](function(){return whatsapp[_0xc824('0xd')]();})[_0xc824('0xb')](function(){return schedule[_0xc824('0xd')]();})[_0xc824('0xb')](function(){return transcribe[_0xc824('0xd')]();})['then'](function(_0x194246){logger[_0xc824('0xc')](_0x194246);return pm2[_0xc824('0xd')](pm2Config);})['then'](function(_0x5c7c2b){logger['info'](_0xc824('0xe'),_['map'](_[_0xc824('0xf')](_0x5c7c2b,{'status':_0xc824('0x10')}),_0xc824('0x11'))[_0xc824('0x12')]());logger['info'](_0xc824('0x13'),_[_0xc824('0x14')](_[_0xc824('0xf')](_0x5c7c2b,function(_0x2abc35){return _0x2abc35[_0xc824('0x15')]!==_0xc824('0x10');}),'name')['join']()||'None');config[_0xc824('0x16')]&&require('./config/seedDB')[_0xc824('0x17')]();require(_0xc824('0x18'))['default']();})['catch'](function(_0x198ade){logger['error'](_0xc824('0x19'),_0x198ade);process[_0xc824('0x1a')](0x1);});}main(); \ No newline at end of file +var _0xf28f=['status','None','seedDB','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','Online\x20apps:','map','online','name','join'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf28f,0x17f));var _0xff28=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xf28f[_0x38a7ac];return _0x53061a;};'use strict';var _=require('lodash');var mysqldb=require(_0xff28('0x0'));var rpc=require('./rpc');var config=require(_0xff28('0x1'));var logger=require(_0xff28('0x2'))('app');var pm2=require(_0xff28('0x3'));var pm2Config=require(_0xff28('0x4'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xff28('0x5'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xff28('0x6')][_0xff28('0x7')]()[_0xff28('0x8')](function(){return rpc[_0xff28('0x9')]();})['then'](function(_0x5f008a){logger[_0xff28('0xa')](_0x5f008a);return chat[_0xff28('0xb')]();})[_0xff28('0x8')](function(){return whatsapp['start']();})[_0xff28('0x8')](function(){return schedule[_0xff28('0xb')]();})[_0xff28('0x8')](function(){return transcribe[_0xff28('0xb')]();})[_0xff28('0x8')](function(_0xfe371a){logger['info'](_0xfe371a);return pm2['start'](pm2Config);})[_0xff28('0x8')](function(_0x5662f0){logger[_0xff28('0xa')](_0xff28('0xc'),_[_0xff28('0xd')](_['filter'](_0x5662f0,{'status':_0xff28('0xe')}),_0xff28('0xf'))[_0xff28('0x10')]());logger['info']('Offline\x20apps:',_[_0xff28('0xd')](_['filter'](_0x5662f0,function(_0x3b7993){return _0x3b7993[_0xff28('0x11')]!=='online';}),_0xff28('0xf'))['join']()||_0xff28('0x12'));config[_0xff28('0x13')]&&require(_0xff28('0x14'))[_0xff28('0x15')]();require('./config/license')[_0xff28('0x15')]();})[_0xff28('0x16')](function(_0x12482c){logger['error'](_0xff28('0x17'),_0x12482c);process[_0xff28('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 8d9ef1b..96eab34 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 _0x0737=['User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','split','length','splice','unshift','join','promisify','sign','session','payload','options','verify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','bluebird','secrets','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','smsPause','pauseType','showWebBar','lastLoginAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','settingsEnabled','downloadOmnichannelInteractions','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.'];(function(_0x52e9e3,_0xe465a7){var _0x960a8d=function(_0x572a0d){while(--_0x572a0d){_0x52e9e3['push'](_0x52e9e3['shift']());}};_0x960a8d(++_0xe465a7);}(_0x0737,0x116));var _0x7073=function(_0x5612c5,_0x333e4d){_0x5612c5=_0x5612c5-0x0;var _0x2d5c0d=_0x0737[_0x5612c5];return _0x2d5c0d;};'use strict';var db=require(_0x7073('0x0'))['db'];var config=require(_0x7073('0x1'));var hardwareConf=require(_0x7073('0x2'));var licenseUtil=require(_0x7073('0x3'));var encryptor=require(_0x7073('0x4'));var _=require('lodash');var jwt=require(_0x7073('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x7073('0x6'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0x7073('0x7'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x7073('0x8')]['session']});var userAttributes=['id','role',_0x7073('0x9'),'name',_0x7073('0xa'),_0x7073('0xb'),_0x7073('0xc'),_0x7073('0xd'),_0x7073('0xe'),_0x7073('0xf'),_0x7073('0x10'),'mailPause','faxPause',_0x7073('0x11'),'openchannelPause',_0x7073('0x12'),_0x7073('0x13'),_0x7073('0x14'),'lastPauseAt','crudPermissions',_0x7073('0x15'),'passwordResetAt',_0x7073('0x16'),_0x7073('0x17'),_0x7073('0x18'),_0x7073('0x19'),'phoneBarEnableRecording',_0x7073('0x1a'),_0x7073('0x1b'),_0x7073('0x1c'),_0x7073('0x1d'),_0x7073('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0x7073('0x1f'),_0x7073('0x20'),'privacyEnabled',_0x7073('0x21'),'wssPort','downloadVoiceRecordings',_0x7073('0x22'),'downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign'];exports[_0x7073('0x23')]=function(){return this['isAuthenticated'](!![])[_0x7073('0x24')](function(_0x4ea2f9,_0x4e0aae,_0x50302b){if(_0x4ea2f9[_0x7073('0x25')]){_0x50302b();}else{return db[_0x7073('0x26')][_0x7073('0x27')]({'where':{'id':_0x4ea2f9[_0x7073('0x28')]['id']},'attributes':['id',_0x7073('0x29'),_0x7073('0x2a')],'raw':!![]})[_0x7073('0x2b')](function(_0x1c3a3f){if(_0x1c3a3f&&_0x1c3a3f[_0x7073('0x29')]){return _0x4e0aae[_0x7073('0x2c')](_0x1c3a3f[_0x7073('0x2a')]===_0x7073('0x2d')?0x195:0x193)[_0x7073('0x2e')]({'message':_0x1c3a3f[_0x7073('0x2a')]===_0x7073('0x2d')?_0x7073('0x2f'):_0x7073('0x30')});}else{_0x50302b();}})[_0x7073('0x31')](function(_0xd28b60){_0x50302b(_0xd28b60);});}});};exports[_0x7073('0x32')]=function isAuthenticated(_0x43bcea){return compose()[_0x7073('0x24')](function(_0x5340ac,_0x3f6e3c,_0x3fbb1e){var _0x486e88;if(_0x5340ac[_0x7073('0x33')][_0x7073('0x34')]){if(_[_0x7073('0x35')](_0x5340ac['headers']['authorization'],_0x7073('0x36'))){var _0xeab550=basicAuth(_0x5340ac);db[_0x7073('0x37')][_0x7073('0x38')]({'where':{'name':_0xeab550['name']}})[_0x7073('0x2b')](function(_0x2f770b){if(!_0x2f770b||!_0x2f770b[_0x7073('0x39')](_0xeab550[_0x7073('0x3a')])){return _0x3f6e3c[_0x7073('0x2c')](0x191)[_0x7073('0x2e')]({'message':_0x7073('0x3b')});}_0x5340ac[_0x7073('0x25')]={'id':_0x2f770b['id']};_0x3fbb1e();})[_0x7073('0x31')](function(_0x4f7996){_0x3fbb1e(_0x4f7996);});}else if(_[_0x7073('0x35')](_0x5340ac[_0x7073('0x33')][_0x7073('0x34')],'Bearer')){validateJwt(_0x5340ac,_0x3f6e3c,_0x3fbb1e);}else{if(_0x43bcea){_0x3fbb1e();}else{return _0x3f6e3c[_0x7073('0x2c')](0x193)['json']({'message':_0x7073('0x3c')});}}}else if(_0x5340ac[_0x7073('0x3d')]['apikey']){try{var _0x2d3bd1={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7073('0x3e')]()};verifyJwt(_0x5340ac[_0x7073('0x3d')][_0x7073('0x3f')],_0x2d3bd1)['then'](function(_0x554239){return db['User']['find']({'where':{'id':_0x554239[_0x7073('0x40')]}})[_0x7073('0x2b')](function(_0x43176d){_0x486e88=_0x43176d;return db['Setting'][_0x7073('0x27')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7073('0x41')],'raw':!![]});})['then'](function(_0x816916){if(!_0x486e88||!_[_0x7073('0x42')](_0x486e88['apiKeyNonce'],_0x554239[_0x7073('0x43')])){return _0x3f6e3c[_0x7073('0x2c')](0x191)[_0x7073('0x2e')]({'message':_0x7073('0x44')});}if(_0x486e88[_0x7073('0x45')]){return _0x3f6e3c['status'](0x191)[_0x7073('0x2e')]({'message':_0x7073('0x46')});}if(_0x486e88[_0x7073('0x47')]){if(_0x816916[_0x7073('0x41')]>0x0){if(moment(_0x486e88[_0x7073('0x48')])[_0x7073('0x49')](_0x816916[_0x7073('0x41')],_0x7073('0x4a'))>moment()){return _0x3f6e3c[_0x7073('0x2c')](0x191)[_0x7073('0x2e')]({'message':_0x7073('0x46')});}}else{return _0x3f6e3c[_0x7073('0x2c')](0x191)['json']({'message':_0x7073('0x46')});}}_0x5340ac['user']={'id':_0x486e88['id']};_0x3fbb1e();});})[_0x7073('0x31')](function(){return _0x3f6e3c[_0x7073('0x2c')](0x191)[_0x7073('0x2e')]({'message':_0x7073('0x46')});});}catch(_0x1284c9){_0x3fbb1e(_0x1284c9);}}else if(_0x43bcea){_0x3fbb1e();}else{return _0x3f6e3c[_0x7073('0x2c')](0x193)[_0x7073('0x2e')]({'message':_0x7073('0x3c')});}})[_0x7073('0x24')](function(_0x222905,_0x41407b,_0x5a9b46){if(_0x222905[_0x7073('0x25')]){db[_0x7073('0x37')]['find']({'where':{'id':_0x222905['user']['id']},'attributes':userAttributes})[_0x7073('0x2b')](function(_0x2e58c8){if(!_0x2e58c8){return _0x41407b[_0x7073('0x2c')](0x194)[_0x7073('0x2e')]({'message':_0x7073('0x4b')});}_0x222905[_0x7073('0x25')]=_0x2e58c8;_0x5a9b46();})[_0x7073('0x31')](function(_0x58f547){_0x5a9b46(_0x58f547);});}else if(_0x43bcea){_0x5a9b46();}else{return _0x41407b['status'](0x194)[_0x7073('0x2e')]({'message':_0x7073('0x4c')});}});};exports[_0x7073('0x4d')]=function canUpdate(){return compose()[_0x7073('0x24')](function(_0x2db938,_0xb7e7d1,_0x4862a3){return licenseUtil[_0x7073('0x4e')]()[_0x7073('0x2b')](function(_0x18e1db){if(_0x18e1db['update']){_0x4862a3();}else{return _0xb7e7d1['status'](0x193)['json']({'message':_0x7073('0x4f')});}})[_0x7073('0x31')](function(_0x17bf0a){_0x4862a3(_0x17bf0a);});});};exports[_0x7073('0x50')]=function isWebrtcLicence(){return compose()['use'](function(_0x2a408c,_0x5f13e9,_0x42bccb){return licenseUtil[_0x7073('0x4e')]()[_0x7073('0x2b')](function(_0x8b8053){if(_0x8b8053['webrtc']){_0x42bccb();}else{return _0x5f13e9[_0x7073('0x2c')](0x193)['json']({'message':_0x7073('0x4f')});}})[_0x7073('0x31')](function(_0x99dbde){_0x42bccb(_0x99dbde);});});};exports['isMiddleware']=function(_0x1b28ec,_0x3a8d5a,_0x345fc5){_0x1b28ec[_0x7073('0x51')]=!![];return _0x345fc5();};exports[_0x7073('0x52')]=function signToken(_0x2efcf6){return signJwt(_0x2efcf6);};exports[_0x7073('0x53')]=function(_0x505e2f,_0x49c99d){if(!_0x505e2f['user']){return _0x49c99d[_0x7073('0x2c')](0x194)[_0x7073('0x2e')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x2d1c26={'payload':{'id':_0x505e2f[_0x7073('0x25')]['id'],'role':_0x505e2f[_0x7073('0x25')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2d1c26)[_0x7073('0x2b')](function(_0x30fa03){_0x49c99d[_0x7073('0x54')]('motion.token',_0x30fa03);_0x49c99d['redirect'](_0x7073('0x55'));})[_0x7073('0x31')](function(_0x137e69){return _0x49c99d[_0x7073('0x2c')](0x1f4)[_0x7073('0x56')](_0x137e69);});};exports[_0x7073('0x57')]=function(_0x50a0dd){if(_[_0x7073('0x58')](_0x50a0dd[_0x7073('0x59')])||_['isNil'](_0x50a0dd[_0x7073('0x5a')])){return null;}else{return createJwt(_0x50a0dd);}};exports[_0x7073('0x5b')]=function(_0x453f43){_0x453f43[_0x7073('0x59')]=generateNonce();_0x453f43[_0x7073('0x5a')]=generateIssuedAt();return createJwt(_0x453f43);};exports[_0x7073('0x5c')]=function(_0x45fd24,_0x5d8afa){var _0x157ad5=_0x45fd24['query'][_0x7073('0x3f')];if(_0x157ad5){var _0x32db1={'nonce':_0x5d8afa[_0x7073('0x59')],'iat':_0x5d8afa[_0x7073('0x5a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x157ad5,_0x32db1)[_0x7073('0x2b')](function(){return generateApiKey(_0x5d8afa);});}else{throw{'message':_0x7073('0x5d')};}};exports[_0x7073('0x5e')]=function(_0x6897e){var _0x50dcea=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x50dcea['test'](_0x6897e))throw new db[(_0x7073('0x5f'))]['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~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x1216dc,_0x4e2582,_0x149292){var _0x338551=encryptor[_0x7073('0x60')](_0x4e2582)['split'](',');for(var _0x243b7d=0x0;_0x243b7d<_0x149292;_0x243b7d++){if(!_0x338551[_0x243b7d])break;if(_0x1216dc[_0x7073('0x61')]()===_0x338551[_0x243b7d][_0x7073('0x61')]()){var _0x39d2bf=util[_0x7073('0x62')](_0x7073('0x63'),_0x149292);if(_0x149292===0x1){_0x39d2bf='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x7073('0x5f'))][(_0x7073('0x64'))](_0x39d2bf);}}return;};exports[_0x7073('0x65')]=function(_0x36e2ae,_0xee9529){var _0x1b19ef=_0xee9529?encryptor[_0x7073('0x60')](_0xee9529)[_0x7073('0x66')](','):[];if(_0x1b19ef[_0x7073('0x67')]===0x5){_0x1b19ef[_0x7073('0x68')](-0x1,0x1);}_0x1b19ef[_0x7073('0x69')](_0x36e2ae);return encryptor['encryptString'](_0x1b19ef[_0x7073('0x6a')](','));};function signJwt(_0x41dc93){var _0x5ced0e=BPromise[_0x7073('0x6b')](jwt[_0x7073('0x6c')],{'context':jwt});var _0x3ffcb5=_0x41dc93['secret']||config[_0x7073('0x8')][_0x7073('0x6d')];return new BPromise(function(_0xaaf09a,_0x4ee69c){_0x5ced0e(_0x41dc93[_0x7073('0x6e')],_0x3ffcb5,_0x41dc93[_0x7073('0x6f')])['then'](function(_0x24df49){_0xaaf09a(_0x24df49);})[_0x7073('0x31')](function(_0x50c317){_0x4ee69c(_0x50c317);});});}function verifyJwt(_0x8f0d0d,_0x125ee1,_0x2a845f){var _0x236dc3=BPromise['promisify'](jwt[_0x7073('0x70')],{'context':jwt});var _0x25f84c=_0x2a845f||config[_0x7073('0x8')][_0x7073('0x6d')];return new BPromise(function(_0x443818,_0x397308){_0x236dc3(_0x8f0d0d,_0x25f84c,_0x125ee1)[_0x7073('0x2b')](function(_0x19ed05){_0x443818(_0x19ed05);})[_0x7073('0x31')](function(_0x167df4){_0x397308(_0x167df4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x7073('0x71')](_0x7073('0x72'));}function generateIssuedAt(){return Math[_0x7073('0x73')](Date[_0x7073('0x74')]()/0x3e8)['toString']();}function createJwt(_0x28a9f5){var _0xdab78e={'payload':{'iat':_0x28a9f5['apiKeyIat'],'nonce':_0x28a9f5[_0x7073('0x59')]},'options':{'algorithm':_0x7073('0x75'),'subject':_0x28a9f5['id'][_0x7073('0x71')](),'issuer':hardwareConf[_0x7073('0x3e')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xdab78e)[_0x7073('0x2b')](function(_0x4a1b3e){return{'iat':_0x28a9f5['apiKeyIat'],'nonce':_0x28a9f5[_0x7073('0x59')],'token':_0x4a1b3e};});} \ No newline at end of file +var _0x615a=['closed','then','status','disposition','unmanaged','json','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','moment','secrets','session','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','ChatInteraction'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x615a,0x1d1));var _0xa615=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x615a[_0xbd77c1];return _0x47fa83;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa615('0x0'));var hardwareConf=require(_0xa615('0x1'));var licenseUtil=require(_0xa615('0x2'));var encryptor=require('../encryptor');var _=require(_0xa615('0x3'));var jwt=require(_0xa615('0x4'));var expressJwt=require(_0xa615('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0xa615('0x6'));var validateJwt=expressJwt({'secret':config[_0xa615('0x7')][_0xa615('0x8')]});var userAttributes=['id','role','fullname','name',_0xa615('0x9'),_0xa615('0xa'),_0xa615('0xb'),_0xa615('0xc'),_0xa615('0xd'),_0xa615('0xe'),_0xa615('0xf'),_0xa615('0x10'),'faxPause','smsPause',_0xa615('0x11'),_0xa615('0x12'),_0xa615('0x13'),_0xa615('0x14'),_0xa615('0x15'),'crudPermissions',_0xa615('0x16'),_0xa615('0x17'),_0xa615('0x18'),_0xa615('0x19'),_0xa615('0x1a'),'phoneBarDnd','phoneBarEnableRecording',_0xa615('0x1b'),_0xa615('0x1c'),_0xa615('0x1d'),_0xa615('0x1e'),_0xa615('0x1f'),_0xa615('0x20'),_0xa615('0x21'),_0xa615('0x22'),_0xa615('0x23'),'privacyEnabled',_0xa615('0x24'),_0xa615('0x25'),_0xa615('0x26'),_0xa615('0x27'),_0xa615('0x28'),_0xa615('0x29'),_0xa615('0x2a')];exports[_0xa615('0x2b')]=function(){return this['isAuthenticated'](!![])[_0xa615('0x2c')](function(_0x3bef27,_0x227d04,_0x2e1251){if(_0x3bef27[_0xa615('0x2d')]){_0x2e1251();}else{return db[_0xa615('0x2e')]['findOne']({'where':{'id':_0x3bef27['params']['id']},'attributes':['id',_0xa615('0x2f'),'disposition'],'raw':!![]})[_0xa615('0x30')](function(_0x453e76){if(_0x453e76&&_0x453e76[_0xa615('0x2f')]){return _0x227d04[_0xa615('0x31')](_0x453e76[_0xa615('0x32')]===_0xa615('0x33')?0x195:0x193)[_0xa615('0x34')]({'message':_0x453e76['disposition']===_0xa615('0x33')?'Unmanaged.':'Forbidden.'});}else{_0x2e1251();}})[_0xa615('0x35')](function(_0x46c68b){_0x2e1251(_0x46c68b);});}});};exports[_0xa615('0x36')]=function isAuthenticated(_0x2ce88e){return compose()[_0xa615('0x2c')](function(_0x5cddc5,_0x5e8506,_0x10bd7e){var _0x3ea8d7;if(_0x5cddc5[_0xa615('0x37')][_0xa615('0x38')]){if(_[_0xa615('0x39')](_0x5cddc5[_0xa615('0x37')][_0xa615('0x38')],_0xa615('0x3a'))){var _0x2d3016=basicAuth(_0x5cddc5);db[_0xa615('0x3b')][_0xa615('0x3c')]({'where':{'name':_0x2d3016['name']}})[_0xa615('0x30')](function(_0x2c3c6b){if(!_0x2c3c6b||!_0x2c3c6b[_0xa615('0x3d')](_0x2d3016['pass'])){return _0x5e8506[_0xa615('0x31')](0x191)[_0xa615('0x34')]({'message':_0xa615('0x3e')});}_0x5cddc5['user']={'id':_0x2c3c6b['id']};_0x10bd7e();})['catch'](function(_0x2ed938){_0x10bd7e(_0x2ed938);});}else if(_['startsWith'](_0x5cddc5[_0xa615('0x37')][_0xa615('0x38')],_0xa615('0x3f'))){validateJwt(_0x5cddc5,_0x5e8506,_0x10bd7e);}else{if(_0x2ce88e){_0x10bd7e();}else{return _0x5e8506[_0xa615('0x31')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5cddc5[_0xa615('0x40')][_0xa615('0x41')]){try{var _0x36c9d4={'audience':hardwareConf[_0xa615('0x42')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5cddc5['query'][_0xa615('0x41')],_0x36c9d4)[_0xa615('0x30')](function(_0x480223){return db['User'][_0xa615('0x3c')]({'where':{'id':_0x480223[_0xa615('0x43')]}})['then'](function(_0x31665a){_0x3ea8d7=_0x31665a;return db[_0xa615('0x44')]['findOne']({'where':{'id':0x1},'attributes':[_0xa615('0x45'),_0xa615('0x46')],'raw':!![]});})['then'](function(_0x3356c4){if(!_0x3ea8d7||!_[_0xa615('0x47')](_0x3ea8d7[_0xa615('0x48')],_0x480223[_0xa615('0x49')])){return _0x5e8506[_0xa615('0x31')](0x191)[_0xa615('0x34')]({'message':_0xa615('0x4a')});}if(_0x3ea8d7[_0xa615('0x4b')]){return _0x5e8506[_0xa615('0x31')](0x191)[_0xa615('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3ea8d7['blocked']){if(_0x3356c4[_0xa615('0x46')]>0x0){if(moment(_0x3ea8d7[_0xa615('0x4c')])[_0xa615('0x4d')](_0x3356c4['blockDuration'],_0xa615('0x4e'))>moment()){return _0x5e8506[_0xa615('0x31')](0x191)[_0xa615('0x34')]({'message':_0xa615('0x4f')});}}else{return _0x5e8506['status'](0x191)['json']({'message':_0xa615('0x4f')});}}_0x5cddc5[_0xa615('0x2d')]={'id':_0x3ea8d7['id']};_0x10bd7e();});})[_0xa615('0x35')](function(){return _0x5e8506[_0xa615('0x31')](0x191)['json']({'message':_0xa615('0x4f')});});}catch(_0x2d5c53){_0x10bd7e(_0x2d5c53);}}else if(_0x2ce88e){_0x10bd7e();}else{return _0x5e8506[_0xa615('0x31')](0x193)['json']({'message':_0xa615('0x50')});}})[_0xa615('0x2c')](function(_0x9a4cb5,_0x1abfcb,_0x128133){if(_0x9a4cb5['user']){db['User']['find']({'where':{'id':_0x9a4cb5[_0xa615('0x2d')]['id']},'attributes':userAttributes})[_0xa615('0x30')](function(_0x42ff9c){if(!_0x42ff9c){return _0x1abfcb[_0xa615('0x31')](0x194)[_0xa615('0x34')]({'message':_0xa615('0x51')});}_0x9a4cb5[_0xa615('0x2d')]=_0x42ff9c;_0x128133();})[_0xa615('0x35')](function(_0x1a2955){_0x128133(_0x1a2955);});}else if(_0x2ce88e){_0x128133();}else{return _0x1abfcb[_0xa615('0x31')](0x194)[_0xa615('0x34')]({'message':_0xa615('0x52')});}});};exports[_0xa615('0x53')]=function canUpdate(){return compose()[_0xa615('0x2c')](function(_0x5424ff,_0x48b089,_0x5ee5ee){return licenseUtil[_0xa615('0x54')]()[_0xa615('0x30')](function(_0x44d73a){if(_0x44d73a['update']){_0x5ee5ee();}else{return _0x48b089[_0xa615('0x31')](0x193)[_0xa615('0x34')]({'message':_0xa615('0x55')});}})[_0xa615('0x35')](function(_0x10f191){_0x5ee5ee(_0x10f191);});});};exports[_0xa615('0x56')]=function isWebrtcLicence(){return compose()[_0xa615('0x2c')](function(_0x1116e7,_0x31fd50,_0x7000f4){return licenseUtil[_0xa615('0x54')]()[_0xa615('0x30')](function(_0x560813){if(_0x560813[_0xa615('0x57')]){_0x7000f4();}else{return _0x31fd50['status'](0x193)[_0xa615('0x34')]({'message':'Forbidden'});}})['catch'](function(_0x455ad3){_0x7000f4(_0x455ad3);});});};exports[_0xa615('0x58')]=function(_0x294393,_0x13025f,_0x274071){_0x294393[_0xa615('0x58')]=!![];return _0x274071();};exports[_0xa615('0x59')]=function signToken(_0x136bf3){return signJwt(_0x136bf3);};exports[_0xa615('0x5a')]=function(_0x1d05a3,_0x35baeb){if(!_0x1d05a3['user']){return _0x35baeb['status'](0x194)['json']({'message':_0xa615('0x5b')});}var _0x52ecca={'payload':{'id':_0x1d05a3[_0xa615('0x2d')]['id'],'role':_0x1d05a3[_0xa615('0x2d')][_0xa615('0x5c')]},'options':{'expiresIn':0x15180}};return signJwt(_0x52ecca)[_0xa615('0x30')](function(_0x571ae2){_0x35baeb[_0xa615('0x5d')](_0xa615('0x5e'),_0x571ae2);_0x35baeb[_0xa615('0x5f')](_0xa615('0x60'));})[_0xa615('0x35')](function(_0x9047fa){return _0x35baeb[_0xa615('0x31')](0x1f4)['send'](_0x9047fa);});};exports[_0xa615('0x61')]=function(_0x499a91){if(_[_0xa615('0x62')](_0x499a91['apiKeyNonce'])||_[_0xa615('0x62')](_0x499a91[_0xa615('0x63')])){return null;}else{return createJwt(_0x499a91);}};exports[_0xa615('0x64')]=function(_0x14f350){_0x14f350[_0xa615('0x48')]=generateNonce();_0x14f350[_0xa615('0x63')]=generateIssuedAt();return createJwt(_0x14f350);};exports['regenerateApiKey']=function(_0x444d50,_0x19fc6d){var _0x4d22e9=_0x444d50[_0xa615('0x40')]['apikey'];if(_0x4d22e9){var _0xab207e={'nonce':_0x19fc6d[_0xa615('0x48')],'iat':_0x19fc6d[_0xa615('0x63')],'audience':hardwareConf[_0xa615('0x42')](),'issuer':hardwareConf[_0xa615('0x42')]()};return verifyJwt(_0x4d22e9,_0xab207e)[_0xa615('0x30')](function(){return generateApiKey(_0x19fc6d);});}else{throw{'message':_0xa615('0x65')};}};exports[_0xa615('0x66')]=function(_0x475a0a){var _0x1461cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1461cc[_0xa615('0x67')](_0x475a0a))throw new db[(_0xa615('0x68'))][(_0xa615('0x69'))](_0xa615('0x6a'));return;};exports[_0xa615('0x6b')]=function(_0x20bf67,_0x2715e4,_0x483d75){var _0x568a58=encryptor[_0xa615('0x6c')](_0x2715e4)[_0xa615('0x6d')](',');for(var _0x337baa=0x0;_0x337baa<_0x483d75;_0x337baa++){if(!_0x568a58[_0x337baa])break;if(_0x20bf67[_0xa615('0x6e')]()===_0x568a58[_0x337baa]['toLowerCase']()){var _0x41d5e5=util[_0xa615('0x6f')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x483d75);if(_0x483d75===0x1){_0x41d5e5=_0xa615('0x70');}throw new db['Sequelize'][(_0xa615('0x69'))](_0x41d5e5);}}return;};exports[_0xa615('0x71')]=function(_0x136b55,_0x3baa11){var _0x1f5c96=_0x3baa11?encryptor['decryptString'](_0x3baa11)[_0xa615('0x6d')](','):[];if(_0x1f5c96[_0xa615('0x72')]===0x5){_0x1f5c96[_0xa615('0x73')](-0x1,0x1);}_0x1f5c96['unshift'](_0x136b55);return encryptor[_0xa615('0x74')](_0x1f5c96[_0xa615('0x75')](','));};function signJwt(_0x5296fd){var _0x1f7179=BPromise[_0xa615('0x76')](jwt[_0xa615('0x77')],{'context':jwt});var _0xe5594c=_0x5296fd['secret']||config[_0xa615('0x7')][_0xa615('0x8')];return new BPromise(function(_0x262026,_0x528b4d){_0x1f7179(_0x5296fd[_0xa615('0x78')],_0xe5594c,_0x5296fd[_0xa615('0x79')])['then'](function(_0x4202e6){_0x262026(_0x4202e6);})[_0xa615('0x35')](function(_0x12b8ac){_0x528b4d(_0x12b8ac);});});}function verifyJwt(_0x4f31c9,_0x77df7a,_0x185909){var _0x55f6f4=BPromise['promisify'](jwt[_0xa615('0x7a')],{'context':jwt});var _0x2f1b4f=_0x185909||config[_0xa615('0x7')][_0xa615('0x8')];return new BPromise(function(_0x7d452a,_0x1fc0a4){_0x55f6f4(_0x4f31c9,_0x2f1b4f,_0x77df7a)[_0xa615('0x30')](function(_0x57a961){_0x7d452a(_0x57a961);})['catch'](function(_0x432986){_0x1fc0a4(_0x432986);});});}function generateNonce(){return crypto[_0xa615('0x7b')](0x10)[_0xa615('0x7c')](_0xa615('0x7d'));}function generateIssuedAt(){return Math[_0xa615('0x7e')](Date['now']()/0x3e8)[_0xa615('0x7c')]();}function createJwt(_0x3438cb){var _0x47cea0={'payload':{'iat':_0x3438cb[_0xa615('0x63')],'nonce':_0x3438cb['apiKeyNonce']},'options':{'algorithm':_0xa615('0x7f'),'subject':_0x3438cb['id'][_0xa615('0x7c')](),'issuer':hardwareConf[_0xa615('0x42')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x47cea0)[_0xa615('0x30')](function(_0x2b54de){return{'iat':_0x3438cb[_0xa615('0x63')],'nonce':_0x3438cb[_0xa615('0x48')],'token':_0x2b54de};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 46ff110..93170c6 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 _0x2864=['data','update','write','end','binary','close','unlink','decryptFile','final','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','createReadStream','createCipher'];(function(_0x48e57a,_0x54456a){var _0x2473dd=function(_0x4a8ea7){while(--_0x4a8ea7){_0x48e57a['push'](_0x48e57a['shift']());}};_0x2473dd(++_0x54456a);}(_0x2864,0x96));var _0x4286=function(_0x52991d,_0x429d72){_0x52991d=_0x52991d-0x0;var _0x5b9004=_0x2864[_0x52991d];return _0x5b9004;};'use strict';var crypto=require(_0x4286('0x0'));var fs=require('fs');var BPromise=require(_0x4286('0x1'));var _=require('lodash');var config=require(_0x4286('0x2'));var logger=require(_0x4286('0x3'))(_0x4286('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4286('0x5')][_0x4286('0x6')],'algorithm':_0x4286('0x7')};const fileOptions={'algorithm':_0x4286('0x8')};if(config[_0x4286('0x9')]&&config['encrypt'][_0x4286('0xa')]){var isSupported=isAlgorithmSupported(config[_0x4286('0x9')][_0x4286('0xa')]);if(isSupported){fileOptions[_0x4286('0xa')]=config['encrypt'][_0x4286('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4286('0xb')](',\x20');logger[_0x4286('0xc')](config['encrypt'][_0x4286('0xa')],_0x4286('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x52304f){return AES_SUPPORTED_RX[_0x4286('0xe')](_0x52304f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x4286('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x4b48b0){return getSupportedCiphers()['indexOf'](_0x4b48b0)>-0x1;}function combineOptions(_0x2efdfa){var _0x2d5bd1={};for(var _0x5c3b9b in fileOptions){if(fileOptions['hasOwnProperty'](_0x5c3b9b)){_0x2d5bd1[_0x5c3b9b]=fileOptions[_0x5c3b9b];}}if(_0x2efdfa){for(var _0x1c53fe in _0x2efdfa){if(_0x2efdfa[_0x4286('0x10')](_0x1c53fe)){_0x2d5bd1[_0x1c53fe]=_0x2efdfa[_0x1c53fe];}}}return _0x2d5bd1;}exports[_0x4286('0x11')]=function(_0x1640a7,_0x5213c6,_0x2ebfda,_0x4dc780){return new BPromise(function(_0x4e7950,_0x56a5e9){_0x4dc780=combineOptions(_0x4dc780);var _0x4353e6=new Buffer(_0x2ebfda);var _0x4e4c5d=fs[_0x4286('0x12')](_0x1640a7);var _0x5e6e8b=fs['createWriteStream'](_0x5213c6);var _0x71c4=crypto[_0x4286('0x13')](_0x4dc780['algorithm'],_0x4353e6);_0x4e4c5d['on'](_0x4286('0x14'),function(_0x4b941e){var _0xc58a0=new Buffer(_0x71c4[_0x4286('0x15')](_0x4b941e),'binary');_0x5e6e8b[_0x4286('0x16')](_0xc58a0);});_0x4e4c5d['on'](_0x4286('0x17'),function(){try{var _0x1f12a0=new Buffer(_0x71c4['final']('binary'),_0x4286('0x18'));_0x5e6e8b[_0x4286('0x16')](_0x1f12a0);_0x5e6e8b[_0x4286('0x17')]();_0x5e6e8b['on'](_0x4286('0x19'),function(){return _0x4e7950(_0x5213c6);});}catch(_0x3b7e09){fs[_0x4286('0x1a')](_0x5213c6);return _0x56a5e9(_0x3b7e09);}});});};exports[_0x4286('0x1b')]=function(_0x2c9c27,_0x242c78,_0x25f105,_0x65424b){return new BPromise(function(_0x1686d8,_0x274171){_0x65424b=combineOptions(_0x65424b);var _0x581c7c=new Buffer(_0x25f105);var _0x2b5f97=fs[_0x4286('0x12')](_0x2c9c27);var _0x3636ef=fs['createWriteStream'](_0x242c78);var _0x13219a=crypto['createDecipher'](_0x65424b[_0x4286('0xa')],_0x581c7c);_0x2b5f97['on'](_0x4286('0x14'),function(_0x453639){var _0x3b215a=new Buffer(_0x13219a['update'](_0x453639),_0x4286('0x18'));_0x3636ef[_0x4286('0x16')](_0x3b215a);});_0x2b5f97['on'](_0x4286('0x17'),function(){try{var _0x254f83=new Buffer(_0x13219a[_0x4286('0x1c')](_0x4286('0x18')),_0x4286('0x18'));_0x3636ef['write'](_0x254f83);_0x3636ef['end']();_0x3636ef['on'](_0x4286('0x19'),function(){return _0x1686d8(_0x242c78);});}catch(_0xf7282){fs['unlink'](_0x242c78);return _0x274171(_0xf7282);}});});};exports[_0x4286('0x1d')]=function(_0x5662fe,_0x508b78,_0x1d0b7){var _0x30b8be=_0x1d0b7||stringOptions[_0x4286('0xa')];var _0x142498=_0x508b78||stringOptions['secret'];var _0x40955e=crypto[_0x4286('0x13')](_0x30b8be,_0x142498);var _0x751eba=_0x40955e[_0x4286('0x15')](_0x5662fe,_0x4286('0x1e'),'base64');_0x751eba+=_0x40955e[_0x4286('0x1c')](_0x4286('0x1f'));return _0x751eba;};exports[_0x4286('0x20')]=function(_0x1fcac1,_0xc169c,_0x13462d){var _0x55bfb7=_0x13462d||stringOptions[_0x4286('0xa')];var _0x52558a=_0xc169c||stringOptions[_0x4286('0x21')];var _0x3a23c4=crypto['createDecipher'](_0x55bfb7,_0x52558a);var _0x3158ab=_0x3a23c4[_0x4286('0x15')](_0x1fcac1,_0x4286('0x1f'),_0x4286('0x1e'));_0x3158ab+=_0x3a23c4[_0x4286('0x1c')](_0x4286('0x1e'));return _0x3158ab;}; \ No newline at end of file +var _0x62ef=['aes-256-ctr','encrypt','algorithm','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','write','end','binary','close','unlink','decryptFile','createReadStream','createDecipher','final','encryptString','utf8','decryptString','secret','base64','crypto','bluebird','lodash','../../config/logger','session'];(function(_0xb801e9,_0x5c432a){var _0x53a9b7=function(_0x4277f6){while(--_0x4277f6){_0xb801e9['push'](_0xb801e9['shift']());}};_0x53a9b7(++_0x5c432a);}(_0x62ef,0xdb));var _0xf62e=function(_0xbb1add,_0x489d26){_0xbb1add=_0xbb1add-0x0;var _0x1620b1=_0x62ef[_0xbb1add];return _0x1620b1;};'use strict';var crypto=require(_0xf62e('0x0'));var fs=require('fs');var BPromise=require(_0xf62e('0x1'));var _=require(_0xf62e('0x2'));var config=require('../../config/environment');var logger=require(_0xf62e('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xf62e('0x4')],'algorithm':_0xf62e('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xf62e('0x6')]&&config[_0xf62e('0x6')][_0xf62e('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xf62e('0x7')]);if(isSupported){fileOptions[_0xf62e('0x7')]=config[_0xf62e('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xf62e('0x8')](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x27e6bf){return AES_SUPPORTED_RX[_0xf62e('0x9')](_0x27e6bf);}function getSupportedCiphers(){return crypto[_0xf62e('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x47bed7){return getSupportedCiphers()[_0xf62e('0xb')](_0x47bed7)>-0x1;}function combineOptions(_0x4809f4){var _0x2a14a9={};for(var _0x496e57 in fileOptions){if(fileOptions[_0xf62e('0xc')](_0x496e57)){_0x2a14a9[_0x496e57]=fileOptions[_0x496e57];}}if(_0x4809f4){for(var _0x1a21f2 in _0x4809f4){if(_0x4809f4[_0xf62e('0xc')](_0x1a21f2)){_0x2a14a9[_0x1a21f2]=_0x4809f4[_0x1a21f2];}}}return _0x2a14a9;}exports[_0xf62e('0xd')]=function(_0x14bbef,_0x5230ae,_0xb7436b,_0x5d91a6){return new BPromise(function(_0x2a1a15,_0x40ed45){_0x5d91a6=combineOptions(_0x5d91a6);var _0x80344a=new Buffer(_0xb7436b);var _0x47c4bf=fs['createReadStream'](_0x14bbef);var _0x9c8a21=fs[_0xf62e('0xe')](_0x5230ae);var _0x420768=crypto[_0xf62e('0xf')](_0x5d91a6[_0xf62e('0x7')],_0x80344a);_0x47c4bf['on'](_0xf62e('0x10'),function(_0x4a1e91){var _0x56899c=new Buffer(_0x420768[_0xf62e('0x11')](_0x4a1e91),'binary');_0x9c8a21[_0xf62e('0x12')](_0x56899c);});_0x47c4bf['on'](_0xf62e('0x13'),function(){try{var _0x532120=new Buffer(_0x420768['final'](_0xf62e('0x14')),'binary');_0x9c8a21[_0xf62e('0x12')](_0x532120);_0x9c8a21['end']();_0x9c8a21['on'](_0xf62e('0x15'),function(){return _0x2a1a15(_0x5230ae);});}catch(_0x1b29dc){fs[_0xf62e('0x16')](_0x5230ae);return _0x40ed45(_0x1b29dc);}});});};exports[_0xf62e('0x17')]=function(_0x193802,_0x55851d,_0x2aa580,_0x381209){return new BPromise(function(_0x25d2c0,_0x5c1593){_0x381209=combineOptions(_0x381209);var _0x599f45=new Buffer(_0x2aa580);var _0x29ea10=fs[_0xf62e('0x18')](_0x193802);var _0x1f8ba8=fs['createWriteStream'](_0x55851d);var _0xd3dcb4=crypto[_0xf62e('0x19')](_0x381209[_0xf62e('0x7')],_0x599f45);_0x29ea10['on'](_0xf62e('0x10'),function(_0x116e84){var _0x3a6634=new Buffer(_0xd3dcb4['update'](_0x116e84),_0xf62e('0x14'));_0x1f8ba8[_0xf62e('0x12')](_0x3a6634);});_0x29ea10['on'](_0xf62e('0x13'),function(){try{var _0x3e42ab=new Buffer(_0xd3dcb4[_0xf62e('0x1a')]('binary'),_0xf62e('0x14'));_0x1f8ba8['write'](_0x3e42ab);_0x1f8ba8[_0xf62e('0x13')]();_0x1f8ba8['on'](_0xf62e('0x15'),function(){return _0x25d2c0(_0x55851d);});}catch(_0x1fbc38){fs['unlink'](_0x55851d);return _0x5c1593(_0x1fbc38);}});});};exports[_0xf62e('0x1b')]=function(_0xe812b3,_0x452e25,_0x32678e){var _0x41b418=_0x32678e||stringOptions[_0xf62e('0x7')];var _0x4624d8=_0x452e25||stringOptions['secret'];var _0x2abfca=crypto['createCipher'](_0x41b418,_0x4624d8);var _0x545e88=_0x2abfca['update'](_0xe812b3,_0xf62e('0x1c'),'base64');_0x545e88+=_0x2abfca['final']('base64');return _0x545e88;};exports[_0xf62e('0x1d')]=function(_0x5a4dac,_0x1275e7,_0x29bf35){var _0x2f19cb=_0x29bf35||stringOptions[_0xf62e('0x7')];var _0x43b3c4=_0x1275e7||stringOptions[_0xf62e('0x1e')];var _0x4dc642=crypto['createDecipher'](_0x2f19cb,_0x43b3c4);var _0x527cca=_0x4dc642[_0xf62e('0x11')](_0x5a4dac,_0xf62e('0x1f'),_0xf62e('0x1c'));_0x527cca+=_0x4dc642['final']('utf8');return _0x527cca;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 77fb741..e5c3489 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 _0x0a99=['../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','then','num','Empty','split','range','isInteger','forEach','push','format','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','zip','zip\x20finished','info','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','to-csv','bluebird','zip-dir','rimraf'];(function(_0xfb9f08,_0x99efa3){var _0x55062c=function(_0x2a2cf4){while(--_0x2a2cf4){_0xfb9f08['push'](_0xfb9f08['shift']());}};_0x55062c(++_0x99efa3);}(_0x0a99,0x166));var _0x90a9=function(_0x3f0764,_0x5dad27){_0x3f0764=_0x3f0764-0x0;var _0x112371=_0x0a99[_0x3f0764];return _0x112371;};'use strict';var util=require(_0x90a9('0x0'));var path=require(_0x90a9('0x1'));var _=require('lodash');var csv=require(_0x90a9('0x2'));var fs=require('fs');var BPromise=require(_0x90a9('0x3'));var zipdir=require(_0x90a9('0x4'));var rimraf=require(_0x90a9('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x90a9('0x6'))['dbH'];var logger=require(_0x90a9('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x90a9('0x8')][0x2]);var QUERY=process[_0x90a9('0x8')][0x3];var PATH=process[_0x90a9('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x54808e,_0x2c40ee){var _0x1de5b6={'status':_0x54808e};var _0x57548e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c40ee){_0x1de5b6[_0x90a9('0x9')]=_0x2c40ee;}return db[_0x90a9('0xa')]['update'](_0x1de5b6,_0x57548e);}function main(){var _0x159bca=0x1388;var _0x1d11f5;logger['info'](util['format'](_0x90a9('0xb'),EXTRACTED_REPORT_ID,_0x90a9('0xc')));return db[_0x90a9('0xd')][_0x90a9('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x42140b){if(_0x42140b){_0x1d11f5=_0x42140b;_0x159bca=_0x1d11f5['splitSizeCsv']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x90a9('0xf')](util['format'](_0x90a9('0x10'),QUERY),{'type':dbH[_0x90a9('0x11')]['QueryTypes'][_0x90a9('0x12')]});})[_0x90a9('0x13')](function(_0x3a4f25){if(!_0x3a4f25[0x0][_0x90a9('0x14')]){return analyticExtractedReport(_0x90a9('0x15'));}var _0x1e43d8=[];var _0x3c03fa=0x0;if(_0x1d11f5[_0x90a9('0x16')]){if(_0x3a4f25&&_0x3a4f25['length']){var _0x27fb72=_[_0x90a9('0x17')](_0x3a4f25[0x0][_0x90a9('0x14')]/_0x159bca);var _0xbe5865=Number[_0x90a9('0x18')](_0x3a4f25[0x0]['num']/_0x159bca)?_0x3a4f25[0x0][_0x90a9('0x14')]%_0x159bca:0x0;_0x27fb72[_0x90a9('0x19')](function(_0x53e593){if(_0x53e593>0x0){_0x3c03fa+=_0x159bca;}_0x1e43d8[_0x90a9('0x1a')](dbH[_0x90a9('0x11')][_0x90a9('0xf')](util[_0x90a9('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x159bca,_0x3c03fa),{'type':dbH[_0x90a9('0x11')][_0x90a9('0x1c')]['SELECT']}));});if(_0xbe5865>0x0){_0x3c03fa+=_0x159bca;_0x1e43d8[_0x90a9('0x1a')](dbH[_0x90a9('0x11')][_0x90a9('0xf')](util[_0x90a9('0x1b')](_0x90a9('0x1d'),QUERY,_0xbe5865,_0x3c03fa),{'type':dbH[_0x90a9('0x11')]['QueryTypes'][_0x90a9('0x12')]}));}}}else{_0x1e43d8[_0x90a9('0x1a')](dbH['sequelize'][_0x90a9('0xf')](QUERY,{'type':dbH[_0x90a9('0x11')][_0x90a9('0x1c')][_0x90a9('0x12')]}));}var _0x5edd27=path[_0x90a9('0x1e')](PATH);var _0x2a08da=path[_0x90a9('0x1f')](PATH,_0x90a9('0x20'));var _0x5aa510=_0x1d11f5['split']&&_0x1e43d8[_0x90a9('0x21')]>0x1;var _0x16f225=[];if(!fs[_0x90a9('0x22')](path[_0x90a9('0x23')](_0x5edd27,_0x2a08da))&&_0x5aa510){fs[_0x90a9('0x24')](path[_0x90a9('0x23')](_0x5edd27,_0x2a08da));}return BPromise[_0x90a9('0x25')](_0x1e43d8,function(_0x2873fa){_0x16f225[_0x90a9('0x1a')](_0x2873fa);})[_0x90a9('0x13')](function(){for(var _0x2e7bdb=0x0;_0x2e7bdb<_0x16f225[_0x90a9('0x21')];_0x2e7bdb+=0x1){var _0x5b0c1d;var _0xa0abc9=_0x16f225[_0x2e7bdb];if(_0x5aa510){_0x5b0c1d=path[_0x90a9('0x23')](_0x5edd27,_0x2a08da,util[_0x90a9('0x1b')](_0x90a9('0x26'),_0x2a08da,_0x2e7bdb,'csv'));}else{_0x5b0c1d=path[_0x90a9('0x23')](_0x5edd27,util[_0x90a9('0x1b')](_0x90a9('0x27'),_0x2a08da,_0x90a9('0x28')));}fs['writeFileSync'](_0x5b0c1d,csv(_0xa0abc9));}})[_0x90a9('0x13')](function(){if(_0x5aa510){return new Promise(function(_0x32797c){zipdir(path[_0x90a9('0x23')](_0x5edd27,_0x2a08da),{'saveTo':path[_0x90a9('0x23')](_0x5edd27,util[_0x90a9('0x1b')](_0x90a9('0x27'),_0x2a08da,_0x90a9('0x29')))},function(_0x318de0,_0x5b749a){rimraf(path['join'](_0x5edd27,_0x2a08da),function(){});_0x32797c(_0x90a9('0x2a'));});});}})[_0x90a9('0x13')](function(){logger[_0x90a9('0x2b')](util[_0x90a9('0x1b')](_0x90a9('0x2c'),EXTRACTED_REPORT_ID,_0x90a9('0xc')));return analyticExtractedReport(_0x90a9('0x2d'),_0x5aa510?util[_0x90a9('0x1b')](_0x90a9('0x27'),_0x2a08da,_0x5aa510?_0x90a9('0x29'):_0x90a9('0x28')):null);});})[_0x90a9('0x2e')](function(_0x4b75e2){logger[_0x90a9('0x2b')](util['format'](_0x90a9('0x2f'),EXTRACTED_REPORT_ID,_0x90a9('0xc')),util[_0x90a9('0x30')](_0x4b75e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x90a9('0x31'));})[_0x90a9('0x32')](function(){process[_0x90a9('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7ca1=['Empty','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','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','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num'];(function(_0xb93474,_0x5a245d){var _0x20d688=function(_0x17e9f1){while(--_0x17e9f1){_0xb93474['push'](_0xb93474['shift']());}};_0x20d688(++_0x5a245d);}(_0x7ca1,0x197));var _0x17ca=function(_0x5f2f42,_0x1cad56){_0x5f2f42=_0x5f2f42-0x0;var _0x5975c5=_0x7ca1[_0x5f2f42];return _0x5975c5;};'use strict';var util=require(_0x17ca('0x0'));var path=require(_0x17ca('0x1'));var _=require(_0x17ca('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x17ca('0x3'));var zipdir=require(_0x17ca('0x4'));var rimraf=require(_0x17ca('0x5'));var db=require(_0x17ca('0x6'))['db'];var dbH=require(_0x17ca('0x6'))[_0x17ca('0x7')];var logger=require(_0x17ca('0x8'))(_0x17ca('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x17ca('0xa')][0x2]);var QUERY=process[_0x17ca('0xa')][0x3];var PATH=process[_0x17ca('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3c4ecc,_0x55ef5f){var _0x15ea15={'status':_0x3c4ecc};var _0x53ec4c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x55ef5f){_0x15ea15['savename']=_0x55ef5f;}return db[_0x17ca('0xb')][_0x17ca('0xc')](_0x15ea15,_0x53ec4c);}function main(){var _0x2ba609=0x1388;var _0x1a23be;logger[_0x17ca('0xd')](util[_0x17ca('0xe')](_0x17ca('0xf'),EXTRACTED_REPORT_ID,_0x17ca('0x10')));return db[_0x17ca('0x11')][_0x17ca('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x17ca('0x13')]})[_0x17ca('0x14')](function(_0x259647){if(_0x259647){_0x1a23be=_0x259647;_0x2ba609=_0x1a23be['splitSizeCsv']||0x1388;}})[_0x17ca('0x14')](function(){return dbH['sequelize']['query'](util[_0x17ca('0xe')](_0x17ca('0x15'),QUERY),{'type':dbH[_0x17ca('0x16')][_0x17ca('0x17')]['SELECT']});})[_0x17ca('0x14')](function(_0x5c8ef9){if(!_0x5c8ef9[0x0][_0x17ca('0x18')]){return analyticExtractedReport(_0x17ca('0x19'));}var _0x329f7e=[];var _0x1cdd6a=0x0;if(_0x1a23be['split']){if(_0x5c8ef9&&_0x5c8ef9[_0x17ca('0x1a')]){var _0x36cedb=_[_0x17ca('0x1b')](_0x5c8ef9[0x0][_0x17ca('0x18')]/_0x2ba609);var _0x210d81=Number['isInteger'](_0x5c8ef9[0x0][_0x17ca('0x18')]/_0x2ba609)?_0x5c8ef9[0x0][_0x17ca('0x18')]%_0x2ba609:0x0;_0x36cedb['forEach'](function(_0x408fcc){if(_0x408fcc>0x0){_0x1cdd6a+=_0x2ba609;}_0x329f7e[_0x17ca('0x1c')](dbH[_0x17ca('0x16')]['query'](util[_0x17ca('0xe')](_0x17ca('0x1d'),QUERY,_0x2ba609,_0x1cdd6a),{'type':dbH[_0x17ca('0x16')][_0x17ca('0x17')][_0x17ca('0x1e')]}));});if(_0x210d81>0x0){_0x1cdd6a+=_0x2ba609;_0x329f7e['push'](dbH['sequelize'][_0x17ca('0x1f')](util[_0x17ca('0xe')](_0x17ca('0x1d'),QUERY,_0x210d81,_0x1cdd6a),{'type':dbH[_0x17ca('0x16')][_0x17ca('0x17')][_0x17ca('0x1e')]}));}}}else{_0x329f7e[_0x17ca('0x1c')](dbH[_0x17ca('0x16')][_0x17ca('0x1f')](QUERY,{'type':dbH[_0x17ca('0x16')][_0x17ca('0x17')][_0x17ca('0x1e')]}));}var _0x40f44e=path['dirname'](PATH);var _0x2fc774=path['basename'](PATH,_0x17ca('0x20'));var _0x14e791=_0x1a23be['split']&&_0x329f7e[_0x17ca('0x1a')]>0x1;var _0x146e14=[];if(!fs[_0x17ca('0x21')](path[_0x17ca('0x22')](_0x40f44e,_0x2fc774))&&_0x14e791){fs[_0x17ca('0x23')](path[_0x17ca('0x22')](_0x40f44e,_0x2fc774));}return BPromise[_0x17ca('0x24')](_0x329f7e,function(_0x2e0682){_0x146e14['push'](_0x2e0682);})['then'](function(){for(var _0x17947b=0x0;_0x17947b<_0x146e14[_0x17ca('0x1a')];_0x17947b+=0x1){var _0x534dff;var _0x35a705=_0x146e14[_0x17947b];if(_0x14e791){_0x534dff=path[_0x17ca('0x22')](_0x40f44e,_0x2fc774,util[_0x17ca('0xe')](_0x17ca('0x25'),_0x2fc774,_0x17947b,'csv'));}else{_0x534dff=path[_0x17ca('0x22')](_0x40f44e,util[_0x17ca('0xe')](_0x17ca('0x26'),_0x2fc774,_0x17ca('0x27')));}fs[_0x17ca('0x28')](_0x534dff,csv(_0x35a705));}})['then'](function(){if(_0x14e791){return new Promise(function(_0x4071b4){zipdir(path[_0x17ca('0x22')](_0x40f44e,_0x2fc774),{'saveTo':path[_0x17ca('0x22')](_0x40f44e,util['format'](_0x17ca('0x26'),_0x2fc774,_0x17ca('0x29')))},function(_0x94fa86,_0x11011f){rimraf(path[_0x17ca('0x22')](_0x40f44e,_0x2fc774),function(){});_0x4071b4(_0x17ca('0x2a'));});});}})[_0x17ca('0x14')](function(){logger['info'](util[_0x17ca('0xe')](_0x17ca('0x2b'),EXTRACTED_REPORT_ID,_0x17ca('0x10')));return analyticExtractedReport(_0x17ca('0x2c'),_0x14e791?util[_0x17ca('0xe')](_0x17ca('0x26'),_0x2fc774,_0x14e791?_0x17ca('0x29'):_0x17ca('0x27')):null);});})[_0x17ca('0x2d')](function(_0x4047e6){logger[_0x17ca('0xd')](util[_0x17ca('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x17ca('0x2e')](_0x4047e6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x17ca('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 28b5a9c..593d786 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 _0xce9a=['endDate','header','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','path','lodash','util','html-to-pdfmake','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','pick','map','toString','fill','length','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate'];(function(_0x289cf5,_0x501dfc){var _0x1f316d=function(_0x4180c4){while(--_0x4180c4){_0x289cf5['push'](_0x289cf5['shift']());}};_0x1f316d(++_0x501dfc);}(_0xce9a,0x192));var _0xace9=function(_0x4ad3d8,_0xdf1bb3){_0x4ad3d8=_0x4ad3d8-0x0;var _0x5ee462=_0xce9a[_0x4ad3d8];return _0x5ee462;};'use strict';var _=require(_0xace9('0x0'));var fs=require('fs');var util=require(_0xace9('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xace9('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xace9('0x3'));var JSDOM=require(_0xace9('0x4'))[_0xace9('0x5')];var window=new JSDOM('')[_0xace9('0x6')];var BPromise=require(_0xace9('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xace9('0x8'))[_0xace9('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xace9('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xace9('0xa')][0x5];var FORMAT=_0xace9('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x42c7a0,_0x5d16a6){var _0x1ab3ef={'status':_0x42c7a0};var _0x3a86bb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d16a6){_0x1ab3ef['savename']=_0x5d16a6;}return db[_0xace9('0xc')][_0xace9('0xd')](_0x1ab3ef,_0x3a86bb);}function getHeaders(_0x9b299f){return _['map'](_0x9b299f,function(_0x765dd5){return{'text':_0x765dd5,'style':'tableHeader'};});}function getRows(_0x8c5b7,_0x27ec20){return _['map'](_0x27ec20,function(_0xb0058){return _(_0xb0058)[_0xace9('0xe')](_0x8c5b7)[_0xace9('0xf')](function(_0x1665c4){return _0x1665c4?_[_0xace9('0x10')](_0x1665c4):'';})['value']();});}function createTable(_0x304cb7,_0x259331){var _0x1904a6={'widths':_[_0xace9('0x11')](Array(_0x304cb7[_0xace9('0x12')]),0x91),'heights':function(_0x43d062){return _0x43d062===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x45d843=getHeaders(_0x304cb7);_0x1904a6[_0xace9('0x13')]['push'](_0x45d843);var _0x2248b6=getRows(_0x304cb7,_0x259331);_0x1904a6['body']=_0x1904a6['body'][_0xace9('0x14')](_0x2248b6);return _0x1904a6;}function createTables(_0xb4978f){var _0x5f5a96=[];var _0x515903=_[_0xace9('0x15')](Object[_0xace9('0x16')](_0xb4978f[0x0]),0x5);_0x515903[_0xace9('0x17')](function(_0x595cf8){_0x5f5a96[_0xace9('0x18')](createTable(_0x595cf8,_0xb4978f));});return _0x5f5a96;}function getPDFDocDefinition(_0x1aa581){var _0x566e1d=util[_0xace9('0x19')](_0xace9('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xace9('0x1b')])[_0xace9('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xace9('0x1c')])['format'](FORMAT));var _0x104728=[];for(var _0x536be1=0x0;_0x536be1<_0x1aa581[_0xace9('0x12')];_0x536be1++){var _0x10d3f4=[];if(_0x536be1===0x0){_0x10d3f4[_0xace9('0x18')]({'text':_0x566e1d,'style':_0xace9('0x1d')});}var _0x430d1f={'table':_0x1aa581[_0x536be1]};if(_0x536be1>0x0){_0x430d1f['pageBreak']='before';_0x430d1f['margin']=[0x0,0x46,0x0,0x0];}_0x10d3f4[_0xace9('0x18')](_0x430d1f);_0x104728[_0xace9('0x18')](_0x10d3f4);}return{'pageSize':'A4','pageOrientation':_0xace9('0x1e'),'content':_0x104728,'footer':function(_0x177a69,_0x204961){return{'text':_0x177a69[_0xace9('0x10')]()+_0xace9('0x1f')+_0x204961,'style':_0xace9('0x20')};},'defaultStyle':{'font':_0xace9('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xace9('0x22')},'footer':{'alignment':_0xace9('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x275829){var _0x4fd22b=0x1388;var _0x32d46f;if(!_0x275829[0x0][_0xace9('0x24')]){return analyticExtractedReport(_0xace9('0x25'));}return db['Setting'][_0xace9('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xace9('0x27'),_0xace9('0x28')]})[_0xace9('0x29')](function(_0x2a98b2){if(_0x2a98b2){_0x32d46f=_0x2a98b2;_0x4fd22b=_0x32d46f[_0xace9('0x28')]||0x3e8;}})[_0xace9('0x29')](function(){var _0x3ff576=[];var _0x201a54=0x0;if(_0x32d46f[_0xace9('0x27')]){if(_0x275829&&_0x275829['length']){var _0x34eb21=_[_0xace9('0x2a')](_0x275829[0x0]['num']/_0x4fd22b);var _0x201fe7=Number[_0xace9('0x2b')](_0x275829[0x0][_0xace9('0x24')]/_0x4fd22b)?_0x275829[0x0][_0xace9('0x24')]%_0x4fd22b:0x0;_0x34eb21['forEach'](function(_0x4e79cf){if(_0x4e79cf>0x0){_0x201a54+=_0x4fd22b;}_0x3ff576[_0xace9('0x18')](dbH[_0xace9('0x2c')][_0xace9('0x2d')](util[_0xace9('0x19')](_0xace9('0x2e'),QUERY,_0x4fd22b,_0x201a54),{'type':dbH[_0xace9('0x2c')][_0xace9('0x2f')][_0xace9('0x30')]}));});if(_0x201fe7>0x0){_0x201a54+=_0x4fd22b;_0x3ff576['push'](dbH[_0xace9('0x2c')][_0xace9('0x2d')](util[_0xace9('0x19')](_0xace9('0x2e'),QUERY,_0x201fe7,_0x201a54),{'type':dbH[_0xace9('0x2c')][_0xace9('0x2f')][_0xace9('0x30')]}));}}}else{_0x3ff576[_0xace9('0x18')](dbH[_0xace9('0x2c')]['query'](QUERY,{'type':dbH[_0xace9('0x2c')][_0xace9('0x2f')][_0xace9('0x30')]}));}var _0x114dc8=path[_0xace9('0x31')](PATH);var _0x537b42=path[_0xace9('0x32')](PATH,_0xace9('0x33'));var _0x338b02=_0x32d46f[_0xace9('0x27')]&&_0x3ff576[_0xace9('0x12')]>0x1;var _0x279857=[];if(!fs[_0xace9('0x34')](path['join'](_0x114dc8,_0x537b42))&&_0x338b02){fs[_0xace9('0x35')](path[_0xace9('0x36')](_0x114dc8,_0x537b42));}return BPromise[_0xace9('0x37')](_0x3ff576,function(_0x50d135){_0x279857[_0xace9('0x18')](_0x50d135);})[_0xace9('0x29')](function(){var _0x48638d=[];for(var _0x35686e=0x0;_0x35686e<_0x279857[_0xace9('0x12')];_0x35686e+=0x1){var _0x30c693=_0x279857[_0x35686e];var _0x251f4f=createTables(_[_0xace9('0x38')](_0x30c693));var _0x5d3584;var _0x43c5b6=getPDFDocDefinition(_0x251f4f);var _0x3e8f21=getPDFPrinter();var _0x2ccede=_0x3e8f21[_0xace9('0x39')](_0x43c5b6);if(_0x338b02){_0x5d3584=path['join'](_0x114dc8,_0x537b42,util[_0xace9('0x19')](_0xace9('0x3a'),_0x537b42,_0x35686e,_0xace9('0x3b')));}else{_0x5d3584=path[_0xace9('0x36')](_0x114dc8,util[_0xace9('0x19')](_0xace9('0x3c'),_0x537b42,'pdf'));}_0x48638d[_0xace9('0x18')](writePDFDocument(_0x2ccede,_0x5d3584));}return Promise['all'](_0x48638d);})['then'](function(){if(_0x338b02){return new Promise(function(_0x3f97b2){zipdir(path[_0xace9('0x36')](_0x114dc8,_0x537b42),{'saveTo':path['join'](_0x114dc8,util[_0xace9('0x19')](_0xace9('0x3c'),_0x537b42,_0xace9('0x3d')))},function(){rimraf(path[_0xace9('0x36')](_0x114dc8,_0x537b42),function(){});_0x3f97b2(_0xace9('0x3e'));});});}})[_0xace9('0x29')](function(){if(!_0x338b02)return;rimraf(path['join'](_0x114dc8,_0x537b42),function(){});})['then'](function(){logger[_0xace9('0x3f')](util[_0xace9('0x19')](_0xace9('0x40'),EXTRACTED_REPORT_ID,_0xace9('0x41')));return analyticExtractedReport('Completed',_0x338b02?util[_0xace9('0x19')]('%s.%s',_0x537b42,_0x338b02?_0xace9('0x3d'):_0xace9('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xace9('0x19')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xace9('0x41')));return db[_0xace9('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x48d891){EXTRACTED_REPORT=_0x48d891;return dbH['sequelize'][_0xace9('0x2d')](util[_0xace9('0x19')](_0xace9('0x42'),QUERY),{'type':dbH[_0xace9('0x2c')][_0xace9('0x2f')][_0xace9('0x30')]});})['then'](extractReport)[_0xace9('0x43')](function(_0x17030f){logger['info'](util['format'](_0xace9('0x44'),EXTRACTED_REPORT_ID,_0xace9('0x41')),util[_0xace9('0x45')](_0x17030f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xace9('0x46'));})[_0xace9('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x40f236=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xace9('0x48'),'italics':__dirname+_0xace9('0x49'),'bolditalics':__dirname+_0xace9('0x4a')}});return _0x40f236;}function getPDFDocDefinitionFromHTML(_0x1d83b4,_0x4c71a4){var _0x16fba8=util['format'](_0xace9('0x4b'),_0x4c71a4['channel'],_0x4c71a4[_0xace9('0x4c')]);var _0x5e4299=moment()[_0xace9('0x19')](_0xace9('0x4d'))[_0xace9('0x10')]();var _0x3e40d7=htmlToPdfmake(_0x1d83b4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e40d7],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xace9('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xace9('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xace9('0x4e')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xace9('0x1d')}];},'footer':function(_0x236b5b,_0x51c768){return[{'text':util[_0xace9('0x19')](_0xace9('0x4f'),_0x16fba8,_0x236b5b,_0x51c768,_0x5e4299),'style':_0xace9('0x20')}];}};}function writePDFDocument(_0x4b2d3e,_0x4a59e5){return new Promise(function(_0x4a679a,_0x3f431d){var _0x2973ce=_0x4b2d3e[_0xace9('0x50')](fs['createWriteStream'](_0x4a59e5));_0x2973ce['on'](_0xace9('0x51'),function(){_0x4a679a(_0xace9('0x51'));});_0x2973ce['on'](_0xace9('0x52'),function(_0x1783b3){_0x3f431d(_0x1783b3);});_0x4b2d3e[_0xace9('0x53')]();});}exports[_0xace9('0x54')]=function(_0x4bd12e,_0x2fe9a9){var _0x381ffd=getPDFPrinter();var _0x376329=getPDFDocDefinitionFromHTML(_0x4bd12e,_0x2fe9a9);var _0x562ebe=_0x381ffd[_0xace9('0x39')](_0x376329);return writePDFDocument(_0x562ebe,_0x2fe9a9[_0xace9('0x55')])[_0xace9('0x43')](function(_0x4a8adf){throw _0x4a8adf;});}; \ No newline at end of file +var _0xd1d6=['interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','auto','body','push','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','basename','.pdf','split','length','existsSync','join','each','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','info','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','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel'];(function(_0x552fc5,_0x54972e){var _0x3ae584=function(_0x4fa784){while(--_0x4fa784){_0x552fc5['push'](_0x552fc5['shift']());}};_0x3ae584(++_0x54972e);}(_0xd1d6,0x182));var _0x6d1d=function(_0x33d1c8,_0x4f2e96){_0x33d1c8=_0x33d1c8-0x0;var _0x5a964a=_0xd1d6[_0x33d1c8];return _0x5a964a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x6d1d('0x0'));var moment=require('moment');var htmlToPdfmake=require(_0x6d1d('0x1'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x6d1d('0x2'));var rimraf=require(_0x6d1d('0x3'));var JSDOM=require(_0x6d1d('0x4'))[_0x6d1d('0x5')];var window=new JSDOM('')[_0x6d1d('0x6')];var BPromise=require('bluebird');var db=require(_0x6d1d('0x7'))['db'];var dbH=require(_0x6d1d('0x7'))[_0x6d1d('0x8')];var logger=require('../../config/logger')(_0x6d1d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x6d1d('0xa')][0x2]);var QUERY=process[_0x6d1d('0xa')][0x3];var PATH=process[_0x6d1d('0xa')][0x4];var NAME=process[_0x6d1d('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b56c6,_0x17229a){var _0x9f123={'status':_0x1b56c6};var _0x23ea8d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17229a){_0x9f123[_0x6d1d('0xb')]=_0x17229a;}return db[_0x6d1d('0xc')][_0x6d1d('0xd')](_0x9f123,_0x23ea8d);}function getHeaders(_0x15b226){return _[_0x6d1d('0xe')](_0x15b226,function(_0x29d638){return{'text':_0x29d638,'style':_0x6d1d('0xf')};});}function getRows(_0x91ed8f,_0x4f86fb){return _[_0x6d1d('0xe')](_0x4f86fb,function(_0x98a045){return _(_0x98a045)[_0x6d1d('0x10')](_0x91ed8f)['map'](function(_0xa84409){return _0xa84409?_[_0x6d1d('0x11')](_0xa84409):'';})[_0x6d1d('0x12')]();});}function createTable(_0x4a961c,_0x11e3f7){var _0x299f75={'widths':_[_0x6d1d('0x13')](Array(_0x4a961c['length']),0x91),'heights':function(_0x357695){return _0x357695===0x0?_0x6d1d('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x567392=getHeaders(_0x4a961c);_0x299f75[_0x6d1d('0x15')][_0x6d1d('0x16')](_0x567392);var _0x184e2d=getRows(_0x4a961c,_0x11e3f7);_0x299f75[_0x6d1d('0x15')]=_0x299f75['body']['concat'](_0x184e2d);return _0x299f75;}function createTables(_0x15a4c2){var _0x20b213=[];var _0xc79002=_['chunk'](Object[_0x6d1d('0x17')](_0x15a4c2[0x0]),0x5);_0xc79002[_0x6d1d('0x18')](function(_0x26ca55){_0x20b213[_0x6d1d('0x16')](createTable(_0x26ca55,_0x15a4c2));});return _0x20b213;}function getPDFDocDefinition(_0x5a587f){var _0xa4b872=util[_0x6d1d('0x19')](_0x6d1d('0x1a'),NAME,EXTRACTED_REPORT[_0x6d1d('0x1b')],moment(EXTRACTED_REPORT[_0x6d1d('0x1c')])[_0x6d1d('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x6d1d('0x1d')])[_0x6d1d('0x19')](FORMAT));var _0x80f22f=[];for(var _0x219de9=0x0;_0x219de9<_0x5a587f['length'];_0x219de9++){var _0x3d92f3=[];if(_0x219de9===0x0){_0x3d92f3[_0x6d1d('0x16')]({'text':_0xa4b872,'style':_0x6d1d('0x1e')});}var _0x454c78={'table':_0x5a587f[_0x219de9]};if(_0x219de9>0x0){_0x454c78[_0x6d1d('0x1f')]='before';_0x454c78[_0x6d1d('0x20')]=[0x0,0x46,0x0,0x0];}_0x3d92f3[_0x6d1d('0x16')](_0x454c78);_0x80f22f[_0x6d1d('0x16')](_0x3d92f3);}return{'pageSize':'A4','pageOrientation':_0x6d1d('0x21'),'content':_0x80f22f,'footer':function(_0x273ca7,_0x1169e9){return{'text':_0x273ca7[_0x6d1d('0x11')]()+_0x6d1d('0x22')+_0x1169e9,'style':_0x6d1d('0x23')};},'defaultStyle':{'font':_0x6d1d('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6d1d('0x25')},'footer':{'alignment':_0x6d1d('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x543dde){var _0x562077=0x1388;var _0x3c918e;if(!_0x543dde[0x0][_0x6d1d('0x27')]){return analyticExtractedReport(_0x6d1d('0x28'));}return db[_0x6d1d('0x29')][_0x6d1d('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6d1d('0x2b')]})[_0x6d1d('0x2c')](function(_0x40130f){if(_0x40130f){_0x3c918e=_0x40130f;_0x562077=_0x3c918e['splitSizePdf']||0x3e8;}})[_0x6d1d('0x2c')](function(){var _0x565bc2=[];var _0x594de1=0x0;if(_0x3c918e['split']){if(_0x543dde&&_0x543dde['length']){var _0x54d39b=_[_0x6d1d('0x2d')](_0x543dde[0x0][_0x6d1d('0x27')]/_0x562077);var _0x21b2c4=Number[_0x6d1d('0x2e')](_0x543dde[0x0][_0x6d1d('0x27')]/_0x562077)?_0x543dde[0x0][_0x6d1d('0x27')]%_0x562077:0x0;_0x54d39b['forEach'](function(_0x5c1317){if(_0x5c1317>0x0){_0x594de1+=_0x562077;}_0x565bc2[_0x6d1d('0x16')](dbH['sequelize'][_0x6d1d('0x2f')](util[_0x6d1d('0x19')](_0x6d1d('0x30'),QUERY,_0x562077,_0x594de1),{'type':dbH[_0x6d1d('0x31')][_0x6d1d('0x32')]['SELECT']}));});if(_0x21b2c4>0x0){_0x594de1+=_0x562077;_0x565bc2[_0x6d1d('0x16')](dbH['sequelize'][_0x6d1d('0x2f')](util[_0x6d1d('0x19')](_0x6d1d('0x30'),QUERY,_0x21b2c4,_0x594de1),{'type':dbH[_0x6d1d('0x31')][_0x6d1d('0x32')][_0x6d1d('0x33')]}));}}}else{_0x565bc2[_0x6d1d('0x16')](dbH['sequelize'][_0x6d1d('0x2f')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x6d1d('0x33')]}));}var _0x526eba=path['dirname'](PATH);var _0x2b340e=path[_0x6d1d('0x34')](PATH,_0x6d1d('0x35'));var _0x2be8e8=_0x3c918e[_0x6d1d('0x36')]&&_0x565bc2[_0x6d1d('0x37')]>0x1;var _0x4cec20=[];if(!fs[_0x6d1d('0x38')](path['join'](_0x526eba,_0x2b340e))&&_0x2be8e8){fs['mkdirSync'](path[_0x6d1d('0x39')](_0x526eba,_0x2b340e));}return BPromise[_0x6d1d('0x3a')](_0x565bc2,function(_0x344690){_0x4cec20[_0x6d1d('0x16')](_0x344690);})[_0x6d1d('0x2c')](function(){var _0x4bd079=[];for(var _0x3e2b8=0x0;_0x3e2b8<_0x4cec20[_0x6d1d('0x37')];_0x3e2b8+=0x1){var _0x135c77=_0x4cec20[_0x3e2b8];var _0x4ca19b=createTables(_['flatten'](_0x135c77));var _0x24cc19;var _0x1a93e7=getPDFDocDefinition(_0x4ca19b);var _0x483d89=getPDFPrinter();var _0xead545=_0x483d89[_0x6d1d('0x3b')](_0x1a93e7);if(_0x2be8e8){_0x24cc19=path[_0x6d1d('0x39')](_0x526eba,_0x2b340e,util[_0x6d1d('0x19')](_0x6d1d('0x3c'),_0x2b340e,_0x3e2b8,'pdf'));}else{_0x24cc19=path[_0x6d1d('0x39')](_0x526eba,util[_0x6d1d('0x19')](_0x6d1d('0x3d'),_0x2b340e,_0x6d1d('0x3e')));}_0x4bd079[_0x6d1d('0x16')](writePDFDocument(_0xead545,_0x24cc19));}return Promise[_0x6d1d('0x3f')](_0x4bd079);})['then'](function(){if(_0x2be8e8){return new Promise(function(_0x3e35ca){zipdir(path['join'](_0x526eba,_0x2b340e),{'saveTo':path[_0x6d1d('0x39')](_0x526eba,util['format'](_0x6d1d('0x3d'),_0x2b340e,_0x6d1d('0x40')))},function(){rimraf(path[_0x6d1d('0x39')](_0x526eba,_0x2b340e),function(){});_0x3e35ca(_0x6d1d('0x41'));});});}})[_0x6d1d('0x2c')](function(){if(!_0x2be8e8)return;rimraf(path[_0x6d1d('0x39')](_0x526eba,_0x2b340e),function(){});})[_0x6d1d('0x2c')](function(){logger['info'](util['format'](_0x6d1d('0x42'),EXTRACTED_REPORT_ID,_0x6d1d('0x43')));return analyticExtractedReport('Completed',_0x2be8e8?util[_0x6d1d('0x19')](_0x6d1d('0x3d'),_0x2b340e,_0x2be8e8?_0x6d1d('0x40'):_0x6d1d('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6d1d('0x44')](util[_0x6d1d('0x19')](_0x6d1d('0x45'),EXTRACTED_REPORT_ID,_0x6d1d('0x43')));return db[_0x6d1d('0xc')][_0x6d1d('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3f4376){EXTRACTED_REPORT=_0x3f4376;return dbH['sequelize'][_0x6d1d('0x2f')](util[_0x6d1d('0x19')](_0x6d1d('0x47'),QUERY),{'type':dbH[_0x6d1d('0x31')][_0x6d1d('0x32')][_0x6d1d('0x33')]});})[_0x6d1d('0x2c')](extractReport)[_0x6d1d('0x48')](function(_0x47001e){logger[_0x6d1d('0x44')](util[_0x6d1d('0x19')](_0x6d1d('0x49'),EXTRACTED_REPORT_ID,'PDF'),util[_0x6d1d('0x4a')](_0x47001e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6d1d('0x4b'));})[_0x6d1d('0x4c')](function(){process[_0x6d1d('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x409fd3=new PdfPrinter({'Arial':{'normal':__dirname+_0x6d1d('0x4e'),'bold':__dirname+_0x6d1d('0x4f'),'italics':__dirname+_0x6d1d('0x50'),'bolditalics':__dirname+_0x6d1d('0x51')}});return _0x409fd3;}function getPDFDocDefinitionFromHTML(_0x119885,_0x121d60){var _0xb706f8=util[_0x6d1d('0x19')](_0x6d1d('0x52'),_0x121d60[_0x6d1d('0x53')],_0x121d60[_0x6d1d('0x54')]);var _0xffb18c=moment()[_0x6d1d('0x19')](_0x6d1d('0x55'))[_0x6d1d('0x11')]();var _0x188841=htmlToPdfmake(_0x119885,{'window':window,'tableAutoSize':!![]});return{'content':[_0x188841],'defaultStyle':{'font':_0x6d1d('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6d1d('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6d1d('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6d1d('0x56')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0xb1539b,_0x5c55be){return[{'text':util[_0x6d1d('0x19')](_0x6d1d('0x57'),_0xb706f8,_0xb1539b,_0x5c55be,_0xffb18c),'style':'footer'}];}};}function writePDFDocument(_0x3c31ab,_0x31c3a1){return new Promise(function(_0x39bb92,_0x390e76){var _0x4993cd=_0x3c31ab[_0x6d1d('0x58')](fs[_0x6d1d('0x59')](_0x31c3a1));_0x4993cd['on'](_0x6d1d('0x5a'),function(){_0x39bb92(_0x6d1d('0x5a'));});_0x4993cd['on'](_0x6d1d('0x5b'),function(_0x202054){_0x390e76(_0x202054);});_0x3c31ab[_0x6d1d('0x5c')]();});}exports[_0x6d1d('0x5d')]=function(_0x19c0e6,_0x42842c){var _0x50cc43=getPDFPrinter();var _0x456a8b=getPDFDocDefinitionFromHTML(_0x19c0e6,_0x42842c);var _0x26dfab=_0x50cc43[_0x6d1d('0x3b')](_0x456a8b);return writePDFDocument(_0x26dfab,_0x42842c[_0x6d1d('0x0')])['catch'](function(_0x4d42ce){throw _0x4d42ce;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 39d3858..5e6e7e7 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 _0xa0ed=['writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s'];(function(_0x5dba9a,_0x1e3b9f){var _0xd55dcb=function(_0x4121a4){while(--_0x4121a4){_0x5dba9a['push'](_0x5dba9a['shift']());}};_0xd55dcb(++_0x1e3b9f);}(_0xa0ed,0x1a2));var _0xda0e=function(_0x51670c,_0x142567){_0x51670c=_0x51670c-0x0;var _0x16d36c=_0xa0ed[_0x51670c];return _0x16d36c;};'use strict';var util=require(_0xda0e('0x0'));var path=require(_0xda0e('0x1'));var _=require(_0xda0e('0x2'));var fs=require('fs');var json2xls=require(_0xda0e('0x3'));var BPromise=require(_0xda0e('0x4'));var zipdir=require(_0xda0e('0x5'));var rimraf=require(_0xda0e('0x6'));var db=require(_0xda0e('0x7'))['db'];var dbH=require(_0xda0e('0x7'))[_0xda0e('0x8')];var logger=require(_0xda0e('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xda0e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xda0e('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x447dfd,_0x2874db){var _0x4a008f={'status':_0x447dfd};var _0x9f145d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2874db){_0x4a008f[_0xda0e('0xb')]=_0x2874db;}return db[_0xda0e('0xc')][_0xda0e('0xd')](_0x4a008f,_0x9f145d);}function main(){var _0x4443c5=0x1388;var _0x2e9731;logger[_0xda0e('0xe')](util[_0xda0e('0xf')](_0xda0e('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xda0e('0x11')][_0xda0e('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xda0e('0x13'),_0xda0e('0x14')]})['then'](function(_0x101a00){if(_0x101a00){_0x2e9731=_0x101a00;_0x4443c5=_0x2e9731[_0xda0e('0x14')]||0x1388;}})[_0xda0e('0x15')](function(){return dbH['sequelize'][_0xda0e('0x16')](util['format'](_0xda0e('0x17'),QUERY),{'type':dbH[_0xda0e('0x18')]['QueryTypes'][_0xda0e('0x19')]});})['then'](function(_0x155d4a){if(!_0x155d4a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x3e51c2=[];var _0x55c570=0x0;if(_0x2e9731[_0xda0e('0x13')]){if(_0x155d4a&&_0x155d4a['length']){var _0x3e0f48=_['range'](_0x155d4a[0x0][_0xda0e('0x1a')]/_0x4443c5);var _0x17ff8f=Number['isInteger'](_0x155d4a[0x0]['num']/_0x4443c5)?_0x155d4a[0x0][_0xda0e('0x1a')]%_0x4443c5:0x0;_0x3e0f48[_0xda0e('0x1b')](function(_0x3e40eb){if(_0x3e40eb>0x0){_0x55c570+=_0x4443c5;}_0x3e51c2[_0xda0e('0x1c')](dbH[_0xda0e('0x18')][_0xda0e('0x16')](util['format'](_0xda0e('0x1d'),QUERY,_0x4443c5,_0x55c570),{'type':dbH[_0xda0e('0x18')][_0xda0e('0x1e')][_0xda0e('0x19')]}));});if(_0x17ff8f>0x0){_0x55c570+=_0x4443c5;_0x3e51c2[_0xda0e('0x1c')](dbH[_0xda0e('0x18')][_0xda0e('0x16')](util[_0xda0e('0xf')](_0xda0e('0x1d'),QUERY,_0x17ff8f,_0x55c570),{'type':dbH[_0xda0e('0x18')][_0xda0e('0x1e')][_0xda0e('0x19')]}));}}}else{_0x3e51c2[_0xda0e('0x1c')](dbH[_0xda0e('0x18')][_0xda0e('0x16')](QUERY,{'type':dbH[_0xda0e('0x18')]['QueryTypes']['SELECT']}));}var _0x263db8=path[_0xda0e('0x1f')](PATH);var _0x4be5ee=path[_0xda0e('0x20')](PATH,_0xda0e('0x21'));var _0x197e97=_0x2e9731[_0xda0e('0x13')]&&_0x3e51c2[_0xda0e('0x22')]>0x1;var _0x5ba47c=[];if(!fs[_0xda0e('0x23')](path[_0xda0e('0x24')](_0x263db8,_0x4be5ee))&&_0x197e97){fs['mkdirSync'](path[_0xda0e('0x24')](_0x263db8,_0x4be5ee));}return BPromise[_0xda0e('0x25')](_0x3e51c2,function(_0x4b6707){_0x5ba47c[_0xda0e('0x1c')](_0x4b6707);})[_0xda0e('0x15')](function(){for(var _0x3e2e7c=0x0;_0x3e2e7c<_0x5ba47c[_0xda0e('0x22')];_0x3e2e7c+=0x1){var _0x390cee;var _0x544609=_0x5ba47c[_0x3e2e7c];if(_0x197e97){_0x390cee=path[_0xda0e('0x24')](_0x263db8,_0x4be5ee,util[_0xda0e('0xf')](_0xda0e('0x26'),_0x4be5ee,_0x3e2e7c,_0xda0e('0x27')));}else{_0x390cee=path[_0xda0e('0x24')](_0x263db8,util[_0xda0e('0xf')](_0xda0e('0x28'),_0x4be5ee,_0xda0e('0x27')));}fs[_0xda0e('0x29')](_0x390cee,json2xls(_0x544609),_0xda0e('0x2a'));}})[_0xda0e('0x15')](function(){if(_0x197e97){return new Promise(function(_0x1c8aff){zipdir(path[_0xda0e('0x24')](_0x263db8,_0x4be5ee),{'saveTo':path[_0xda0e('0x24')](_0x263db8,util[_0xda0e('0xf')](_0xda0e('0x28'),_0x4be5ee,_0xda0e('0x2b')))},function(_0x50f29f,_0x2f307f){rimraf(path[_0xda0e('0x24')](_0x263db8,_0x4be5ee),function(){});_0x1c8aff(_0xda0e('0x2c'));});});}})['then'](function(){logger[_0xda0e('0xe')](util[_0xda0e('0xf')](_0xda0e('0x2d'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xda0e('0x2e'),_0x197e97?util[_0xda0e('0xf')]('%s.%s',_0x4be5ee,_0x197e97?_0xda0e('0x2b'):_0xda0e('0x27')):null);});})['catch'](function(_0x47cda3){logger['info'](util[_0xda0e('0xf')](_0xda0e('0x2f'),EXTRACTED_REPORT_ID,_0xda0e('0x30')),util['inspect'](_0x47cda3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xda0e('0x31')](function(){process[_0xda0e('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2d7b=['lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.xlsx','existsSync','mkdirSync','join','each','xlsx','%s.%s','binary','zip','zip\x20finished','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util'];(function(_0x178345,_0x2eb3dd){var _0x68a735=function(_0x1f321d){while(--_0x1f321d){_0x178345['push'](_0x178345['shift']());}};_0x68a735(++_0x2eb3dd);}(_0x2d7b,0x1ee));var _0xb2d7=function(_0x547778,_0x25b1b3){_0x547778=_0x547778-0x0;var _0x5ae971=_0x2d7b[_0x547778];return _0x5ae971;};'use strict';var util=require(_0xb2d7('0x0'));var path=require('path');var _=require(_0xb2d7('0x1'));var fs=require('fs');var json2xls=require(_0xb2d7('0x2'));var BPromise=require(_0xb2d7('0x3'));var zipdir=require(_0xb2d7('0x4'));var rimraf=require(_0xb2d7('0x5'));var db=require(_0xb2d7('0x6'))['db'];var dbH=require(_0xb2d7('0x6'))[_0xb2d7('0x7')];var logger=require(_0xb2d7('0x8'))(_0xb2d7('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xb2d7('0xa')][0x2]);var QUERY=process[_0xb2d7('0xa')][0x3];var PATH=process[_0xb2d7('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2bde92,_0x5f3b78){var _0xdd5daf={'status':_0x2bde92};var _0x3b7c9a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f3b78){_0xdd5daf['savename']=_0x5f3b78;}return db['AnalyticExtractedReport']['update'](_0xdd5daf,_0x3b7c9a);}function main(){var _0x38b771=0x1388;var _0x1c2e14;logger[_0xb2d7('0xb')](util[_0xb2d7('0xc')](_0xb2d7('0xd'),EXTRACTED_REPORT_ID,_0xb2d7('0xe')));return db[_0xb2d7('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb2d7('0x10'),_0xb2d7('0x11')]})['then'](function(_0x1b969f){if(_0x1b969f){_0x1c2e14=_0x1b969f;_0x38b771=_0x1c2e14[_0xb2d7('0x11')]||0x1388;}})[_0xb2d7('0x12')](function(){return dbH['sequelize'][_0xb2d7('0x13')](util[_0xb2d7('0xc')](_0xb2d7('0x14'),QUERY),{'type':dbH[_0xb2d7('0x15')][_0xb2d7('0x16')][_0xb2d7('0x17')]});})[_0xb2d7('0x12')](function(_0x49195d){if(!_0x49195d[0x0][_0xb2d7('0x18')]){return analyticExtractedReport('Empty');}var _0x39449d=[];var _0x1b13bb=0x0;if(_0x1c2e14['split']){if(_0x49195d&&_0x49195d[_0xb2d7('0x19')]){var _0x235840=_[_0xb2d7('0x1a')](_0x49195d[0x0]['num']/_0x38b771);var _0x21712d=Number[_0xb2d7('0x1b')](_0x49195d[0x0][_0xb2d7('0x18')]/_0x38b771)?_0x49195d[0x0]['num']%_0x38b771:0x0;_0x235840[_0xb2d7('0x1c')](function(_0x117f5c){if(_0x117f5c>0x0){_0x1b13bb+=_0x38b771;}_0x39449d[_0xb2d7('0x1d')](dbH['sequelize']['query'](util[_0xb2d7('0xc')](_0xb2d7('0x1e'),QUERY,_0x38b771,_0x1b13bb),{'type':dbH[_0xb2d7('0x15')][_0xb2d7('0x16')][_0xb2d7('0x17')]}));});if(_0x21712d>0x0){_0x1b13bb+=_0x38b771;_0x39449d[_0xb2d7('0x1d')](dbH['sequelize']['query'](util['format'](_0xb2d7('0x1e'),QUERY,_0x21712d,_0x1b13bb),{'type':dbH['sequelize']['QueryTypes'][_0xb2d7('0x17')]}));}}}else{_0x39449d[_0xb2d7('0x1d')](dbH[_0xb2d7('0x15')][_0xb2d7('0x13')](QUERY,{'type':dbH[_0xb2d7('0x15')][_0xb2d7('0x16')]['SELECT']}));}var _0x28a1c0=path['dirname'](PATH);var _0x2385f1=path['basename'](PATH,_0xb2d7('0x1f'));var _0xbf314a=_0x1c2e14['split']&&_0x39449d[_0xb2d7('0x19')]>0x1;var _0x55c0a5=[];if(!fs[_0xb2d7('0x20')](path['join'](_0x28a1c0,_0x2385f1))&&_0xbf314a){fs[_0xb2d7('0x21')](path[_0xb2d7('0x22')](_0x28a1c0,_0x2385f1));}return BPromise[_0xb2d7('0x23')](_0x39449d,function(_0x5dd959){_0x55c0a5[_0xb2d7('0x1d')](_0x5dd959);})['then'](function(){for(var _0x2228a8=0x0;_0x2228a8<_0x55c0a5[_0xb2d7('0x19')];_0x2228a8+=0x1){var _0x180508;var _0x279a88=_0x55c0a5[_0x2228a8];if(_0xbf314a){_0x180508=path[_0xb2d7('0x22')](_0x28a1c0,_0x2385f1,util[_0xb2d7('0xc')]('%s%d.%s',_0x2385f1,_0x2228a8,_0xb2d7('0x24')));}else{_0x180508=path[_0xb2d7('0x22')](_0x28a1c0,util[_0xb2d7('0xc')](_0xb2d7('0x25'),_0x2385f1,_0xb2d7('0x24')));}fs['writeFileSync'](_0x180508,json2xls(_0x279a88),_0xb2d7('0x26'));}})[_0xb2d7('0x12')](function(){if(_0xbf314a){return new Promise(function(_0x1a2f99){zipdir(path[_0xb2d7('0x22')](_0x28a1c0,_0x2385f1),{'saveTo':path[_0xb2d7('0x22')](_0x28a1c0,util[_0xb2d7('0xc')](_0xb2d7('0x25'),_0x2385f1,_0xb2d7('0x27')))},function(_0x10a419,_0x2b0e04){rimraf(path['join'](_0x28a1c0,_0x2385f1),function(){});_0x1a2f99(_0xb2d7('0x28'));});});}})[_0xb2d7('0x12')](function(){logger[_0xb2d7('0xb')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb2d7('0xe')));return analyticExtractedReport('Completed',_0xbf314a?util[_0xb2d7('0xc')]('%s.%s',_0x2385f1,_0xbf314a?'zip':_0xb2d7('0x24')):null);});})['catch'](function(_0x58e9f0){logger[_0xb2d7('0xb')](util[_0xb2d7('0xc')](_0xb2d7('0x29'),EXTRACTED_REPORT_ID,_0xb2d7('0xe')),util[_0xb2d7('0x2a')](_0x58e9f0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb2d7('0x2b'));})['finally'](function(){process[_0xb2d7('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index eefabd4..d9cc143 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 _0xd171=['find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','CDR(routeid)=','context','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','filter','hasOwnProperty','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','groupBy','queue','playback','priority','extensions','extension'];(function(_0x76c57e,_0x265d95){var _0x4c1fd0=function(_0x4f1456){while(--_0x4f1456){_0x76c57e['push'](_0x76c57e['shift']());}};_0x4c1fd0(++_0x265d95);}(_0xd171,0x1df));var _0x1d17=function(_0x3c3982,_0x163010){_0x3c3982=_0x3c3982-0x0;var _0x66448f=_0xd171[_0x3c3982];return _0x66448f;};'use strict';var _=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));function rewrite(_0x4a599c,_0x1e24db){var _0xdb41e7=this;return _0x4a599c[_0x1d17('0x2')][_0x1d17('0x3')][_0x1d17('0x4')]({'raw':!![]})[_0x1d17('0x5')](function(_0x1c2d10){_0xdb41e7[_0x1d17('0x6')]=_0x1c2d10;return _0x4a599c[_0x1d17('0x2')]['VoiceExtension'][_0x1d17('0x4')]({'where':{'IntervalId':_0x1e24db[_0x1d17('0x7')]},'raw':!![]});})[_0x1d17('0x5')](function(_0x4127eb){return _0x4a599c['models'][_0x1d17('0x8')][_0x1d17('0x4')]({'where':{'exten':{'$in':_[_0x1d17('0x9')](_[_0x1d17('0xa')](_0x4127eb,_0x1d17('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x75b4f6){var _0x3eee9f=_['filter'](_0x75b4f6,{'priority':'1'});var _0x4d2eb4=_['filter'](_0x75b4f6,{'isApp':0x1});var _0x55a76d=_[_0x1d17('0xc')](_0x4d2eb4,_0x1d17('0xb'));var _0x4505d8=[_0x1d17('0xd'),_0x1d17('0xe')];var _0x272f0d=[];var _0x1dd49f=[];for(var _0x99059d in _0x55a76d){if(_0x55a76d['hasOwnProperty'](_0x99059d)){_0xdb41e7[_0x1d17('0xf')]=0x2;_0xdb41e7[_0x1d17('0x10')]=[];_0xdb41e7[_0x1d17('0x11')]=_[_0x1d17('0x12')](_0x3eee9f,{'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')]});_0xdb41e7[_0x1d17('0x10')][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':util[_0x1d17('0x16')](_0x1d17('0x17'),_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')]),'context':_0x55a76d[_0x99059d][0x0]['context'],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});if(_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')]==='inbound'){_0xdb41e7['extensions'][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x19')+_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')],'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0]['exten'],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});}else if(_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')]==='outbound'){if(_0xdb41e7[_0x1d17('0x11')]){_0xdb41e7[_0x1d17('0x10')]['push']({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x1b')+(_0xdb41e7[_0x1d17('0x11')]['cutdigits']?_0x1d17('0x1c')+_0xdb41e7['extension'][_0x1d17('0x1d')]+'}':_0x1d17('0x1e')),'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});}_0xdb41e7['extensions']['push']({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':'CDR(routeid)='+_0x55a76d[_0x99059d][0x0]['VoiceExtensionId'],'context':_0x55a76d[_0x99059d][0x0]['context'],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7['priority']++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});var _0x55ba52=_0xdb41e7[_0x1d17('0xf')]++;_0xdb41e7['extensions'][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x1f'),'appdata':_0x1d17('0x20')+(_0x55ba52+0x2)+_0x1d17('0x21')+(_0x55ba52+0x1)+')','context':_0x55a76d[_0x99059d][0x0]['context'],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0x55ba52,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});if(_0xdb41e7[_0x1d17('0x11')]){_0xdb41e7[_0x1d17('0x10')][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0xdb41e7[_0x1d17('0x11')][_0x1d17('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0xdb41e7[_0x1d17('0x11')]['cutdigits']+'}':_0x1d17('0x22'),'context':_0x55a76d[_0x99059d][0x0]['context'],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});}_0xdb41e7['extensions']['push']({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':'outboundrouteid='+_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')],'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});if(_0xdb41e7[_0x1d17('0x11')]&&_0xdb41e7[_0x1d17('0x11')]['hasOwnProperty']('recordingFormat')&&_0xdb41e7[_0x1d17('0x11')][_0x1d17('0x23')]!==_0x1d17('0x24')){_0xdb41e7[_0x1d17('0x10')][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x55a76d[_0x99059d][0x0]['context'],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});_0xdb41e7['extensions'][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x25')+_0xdb41e7[_0x1d17('0x11')][_0x1d17('0x23')]||_0x1d17('0x26'),'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});}}_0xdb41e7['extensions'][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0]['type'],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x27'),'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});_0xdb41e7['extensions'][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0][_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x28'),'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});_0xdb41e7[_0x1d17('0x10')][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0]['type'],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x29'),'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'priority':_0xdb41e7[_0x1d17('0xf')]++,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});for(var _0x22cb66=0x0,_0x2602b3=0x0;_0x22cb66<_0x55a76d[_0x99059d]['length'];_0x22cb66+=0x1,_0x2602b3=0x0){var _0x4730e9=_0x55a76d[_0x99059d][_0x22cb66];if(_0x4730e9[_0x1d17('0x14')]){_0x4730e9[_0x1d17('0x14')]=_0x4730e9[_0x1d17('0x14')]['toLowerCase']();}var _0x3dc0ba=[];var _0x3ab3bf=[];delete _0x4730e9['id'];delete _0x4730e9[_0x1d17('0x2a')];delete _0x4730e9[_0x1d17('0x2b')];var _0x7a3a37=_0x4730e9[_0x1d17('0x2c')]!=='*,*,*,*'?[_0x4730e9[_0x1d17('0x2c')]]:_0x4730e9[_0x1d17('0x7')]?_[_0x1d17('0xa')](_[_0x1d17('0x2d')](_0xdb41e7[_0x1d17('0x6')],{'IntervalId':_0x4730e9[_0x1d17('0x7')]}),_0x1d17('0x2c')):[];if(_0x4730e9[_0x1d17('0x2e')](_0x1d17('0x2f'))){if(_0x4730e9[_0x1d17('0x2f')]&&_0x4730e9[_0x1d17('0x2f')]!=='--'){_0x3dc0ba['push']({'type':_0x4730e9[_0x1d17('0x14')],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x30')+_0x4730e9[_0x1d17('0x2f')],'context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9[_0x1d17('0xb')],'priority':_0x7a3a37[_0x1d17('0x31')]+_0xdb41e7['priority']+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});}}if(_0x4730e9[_0x1d17('0x14')]==='outbound'&&_0x4730e9[_0x1d17('0x2e')](_0x1d17('0x32'))){if(_0x4730e9[_0x1d17('0x32')]){_0x3dc0ba[_0x1d17('0x13')]({'type':_0x4730e9[_0x1d17('0x14')],'app':_0x1d17('0x1f'),'appdata':_0x1d17('0x33')+_0x4730e9['callerID']+')','context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9['exten'],'priority':_0x7a3a37[_0x1d17('0x31')]+_0xdb41e7['priority']+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});}else{_0x3dc0ba['push']({'type':_0x4730e9[_0x1d17('0x14')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9[_0x1d17('0xb')],'priority':_0x7a3a37['length']+_0xdb41e7[_0x1d17('0xf')]+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});}}if(_0x4730e9[_0x1d17('0x2e')](_0x1d17('0x34'))){if(_0x4505d8[_0x1d17('0x35')](_0x4730e9[_0x1d17('0x36')][_0x1d17('0x37')]())>=0x0&&_0x4730e9[_0x1d17('0x38')]!=='custom'){if(_0x4730e9[_0x1d17('0x34')]){_0x3dc0ba['push']({'type':_0x4730e9[_0x1d17('0x14')],'app':_0x1d17('0x1f'),'appdata':_0x1d17('0x39'),'context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9['exten'],'priority':_0x7a3a37[_0x1d17('0x31')]+_0xdb41e7[_0x1d17('0xf')]+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});_0x3dc0ba[_0x1d17('0x13')]({'type':_0x4730e9['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9[_0x1d17('0xb')],'priority':_0x7a3a37[_0x1d17('0x31')]+_0xdb41e7[_0x1d17('0xf')]+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});}else{_0x3dc0ba['push']({'type':_0x4730e9[_0x1d17('0x14')],'app':_0x1d17('0x1f'),'appdata':_0x1d17('0x3a'),'context':_0x4730e9[_0x1d17('0x1a')],'exten':_0x4730e9[_0x1d17('0xb')],'priority':_0x7a3a37['length']+_0xdb41e7[_0x1d17('0xf')]+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});_0x3dc0ba[_0x1d17('0x13')]({'type':_0x4730e9['type'],'app':_0x1d17('0x15'),'appdata':_0x1d17('0x3b'),'context':_0x4730e9['context'],'exten':_0x4730e9[_0x1d17('0xb')],'priority':_0x7a3a37['length']+_0xdb41e7[_0x1d17('0xf')]+_0x2602b3++,'VoiceExtensionId':_0x4730e9[_0x1d17('0x18')]});}}}for(var _0x3c860d=0x0;_0x3c860d<_0x7a3a37[_0x1d17('0x31')];_0x3c860d+=0x1){var _0x39313b=_0xdb41e7[_0x1d17('0xf')]+_0x7a3a37[_0x1d17('0x31')];var _0x5790c7=_0x3c860d===_0x7a3a37[_0x1d17('0x31')]-0x1?_0xdb41e7[_0x1d17('0xf')]+_0x3dc0ba[_0x1d17('0x31')]+_0x3ab3bf['length']+0x2:_0xdb41e7[_0x1d17('0xf')]+_0x3c860d+0x1;_0x3dc0ba[_0x1d17('0x3c')](_0x3c860d,0x0,{'type':_0x4730e9[_0x1d17('0x14')],'app':_0x1d17('0x3d'),'appdata':_0x7a3a37[_0x3c860d]+'?'+_0x4730e9[_0x1d17('0x1a')]+',${EXTEN},'+_0x39313b+':'+_0x4730e9[_0x1d17('0x1a')]+_0x1d17('0x3e')+_0x5790c7,'exten':_0x4730e9['exten'],'context':_0x4730e9[_0x1d17('0x1a')],'priority':_0xdb41e7[_0x1d17('0xf')]+_0x3c860d,'VoiceExtensionId':_0x55a76d[_0x99059d][0x0][_0x1d17('0x18')]});}_0x4730e9[_0x1d17('0xf')]=_0x3dc0ba[_0x1d17('0x31')]?_[_0x1d17('0x3f')](_0x3dc0ba)[_0x1d17('0xf')]+0x1:_0xdb41e7[_0x1d17('0xf')];_0xdb41e7[_0x1d17('0xf')]=(_0x3ab3bf['length']?_['last'](_0x3ab3bf)['priority']:_0x4730e9[_0x1d17('0xf')])+0x1;_0xdb41e7[_0x1d17('0x10')]=_[_0x1d17('0x40')](_0xdb41e7[_0x1d17('0x10')],_0x3dc0ba,[_0x4730e9],_0x3ab3bf);}_0xdb41e7[_0x1d17('0x10')][_0x1d17('0x13')]({'type':_0x55a76d[_0x99059d][0x0]['type'],'app':_0x1d17('0x41'),'exten':_0x55a76d[_0x99059d][0x0][_0x1d17('0xb')],'context':_0x55a76d[_0x99059d][0x0][_0x1d17('0x1a')],'priority':_0xdb41e7[_0x1d17('0xf')],'VoiceExtensionId':_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']});_0x272f0d['push'](_0x55a76d[_0x99059d][0x0]['VoiceExtensionId']);_0x1dd49f=_[_0x1d17('0x40')](_0x1dd49f,_0xdb41e7[_0x1d17('0x10')]);}}return _0x4a599c['transaction'](function(_0xf7d292){return _0x4a599c[_0x1d17('0x2')]['VoiceExtension'][_0x1d17('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x272f0d}},'transaction':_0xf7d292})['then'](function(_0x160b54){return _0x4a599c[_0x1d17('0x2')][_0x1d17('0x8')][_0x1d17('0x43')](_['sortBy'](_0x1dd49f,'priority'),{'transaction':_0xf7d292});});});})[_0x1d17('0x44')](function(_0x5e12c8){console[_0x1d17('0x45')](_0x5e12c8);});}exports[_0x1d17('0x46')]=rewrite; \ No newline at end of file +var _0xe626=['then','intervals','VoiceExtension','map','exten','filter','groupBy','queue','playback','priority','extension','find','extensions','push','type','format','CDR(type)=%s','inbound','Set','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','transaction','destroy','catch','error','rewrite','lodash','util','models','Interval','findAll'];(function(_0x1d4663,_0x17cb51){var _0x581eb5=function(_0x3106ac){while(--_0x3106ac){_0x1d4663['push'](_0x1d4663['shift']());}};_0x581eb5(++_0x17cb51);}(_0xe626,0x1b4));var _0x6e62=function(_0xe0a2d8,_0x1f74fe){_0xe0a2d8=_0xe0a2d8-0x0;var _0x2afce1=_0xe626[_0xe0a2d8];return _0x2afce1;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));function rewrite(_0x31cfa9,_0x82c02a){var _0x198320=this;return _0x31cfa9[_0x6e62('0x2')][_0x6e62('0x3')][_0x6e62('0x4')]({'raw':!![]})[_0x6e62('0x5')](function(_0x24ae41){_0x198320[_0x6e62('0x6')]=_0x24ae41;return _0x31cfa9[_0x6e62('0x2')][_0x6e62('0x7')][_0x6e62('0x4')]({'where':{'IntervalId':_0x82c02a['IntervalId']},'raw':!![]});})['then'](function(_0x560454){return _0x31cfa9[_0x6e62('0x2')][_0x6e62('0x7')][_0x6e62('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x6e62('0x8')](_0x560454,_0x6e62('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6e62('0x5')](function(_0xa10fae){var _0x55fa79=_[_0x6e62('0xa')](_0xa10fae,{'priority':'1'});var _0x24b09c=_['filter'](_0xa10fae,{'isApp':0x1});var _0x101719=_[_0x6e62('0xb')](_0x24b09c,_0x6e62('0x9'));var _0x143ffb=[_0x6e62('0xc'),_0x6e62('0xd')];var _0xb7f50e=[];var _0x3b0829=[];for(var _0x3e1e99 in _0x101719){if(_0x101719['hasOwnProperty'](_0x3e1e99)){_0x198320[_0x6e62('0xe')]=0x2;_0x198320['extensions']=[];_0x198320[_0x6e62('0xf')]=_[_0x6e62('0x10')](_0x55fa79,{'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')]});_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':'Set','appdata':util[_0x6e62('0x14')](_0x6e62('0x15'),_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')]),'context':_0x101719[_0x3e1e99][0x0]['context'],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0]['VoiceExtensionId']});if(_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')]===_0x6e62('0x16')){_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0]['type'],'app':_0x6e62('0x17'),'appdata':'CDR(routeid)='+_0x101719[_0x3e1e99][0x0]['VoiceExtensionId'],'context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});}else if(_0x101719[_0x3e1e99][0x0]['type']===_0x6e62('0x1a')){if(_0x198320[_0x6e62('0xf')]){_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':_0x6e62('0x1b')+(_0x198320[_0x6e62('0xf')][_0x6e62('0x1c')]?_0x6e62('0x1d')+_0x198320['extension'][_0x6e62('0x1c')]+'}':_0x6e62('0x1e')),'context':_0x101719[_0x3e1e99][0x0]['context'],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320['priority']++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0]['VoiceExtensionId']});}_0x198320['extensions']['push']({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':_0x6e62('0x1f')+_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')],'context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0]['exten'],'priority':_0x198320['priority']++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});var _0x58f32a=_0x198320[_0x6e62('0xe')]++;_0x198320['extensions'][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x58f32a+0x2)+_0x6e62('0x21')+(_0x58f32a+0x1)+')','context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x58f32a,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0]['VoiceExtensionId']});if(_0x198320[_0x6e62('0xf')]){_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0]['type'],'app':_0x6e62('0x17'),'appdata':_0x198320[_0x6e62('0xf')]['cutdigits']?_0x6e62('0x22')+_0x198320[_0x6e62('0xf')][_0x6e62('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});}_0x198320[_0x6e62('0x11')]['push']({'type':_0x101719[_0x3e1e99][0x0]['type'],'app':_0x6e62('0x17'),'appdata':'outboundrouteid='+_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')],'context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});if(_0x198320[_0x6e62('0xf')]&&_0x198320[_0x6e62('0xf')][_0x6e62('0x23')](_0x6e62('0x24'))&&_0x198320[_0x6e62('0xf')][_0x6e62('0x24')]!==_0x6e62('0x25')){_0x198320['extensions']['push']({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':_0x6e62('0x26'),'context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0]['exten'],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':_0x6e62('0x27')+_0x198320[_0x6e62('0xf')][_0x6e62('0x24')]||'wav','context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});}}_0x198320[_0x6e62('0x11')]['push']({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320['priority']++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0]['type'],'app':_0x6e62('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x101719[_0x3e1e99][0x0]['context'],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320['priority']++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});_0x198320['extensions'][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x101719[_0x3e1e99][0x0][_0x6e62('0x18')],'exten':_0x101719[_0x3e1e99][0x0][_0x6e62('0x9')],'priority':_0x198320[_0x6e62('0xe')]++,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});for(var _0x239b02=0x0,_0x3843fe=0x0;_0x239b02<_0x101719[_0x3e1e99][_0x6e62('0x28')];_0x239b02+=0x1,_0x3843fe=0x0){var _0x8cfcca=_0x101719[_0x3e1e99][_0x239b02];if(_0x8cfcca['type']){_0x8cfcca['type']=_0x8cfcca['type'][_0x6e62('0x29')]();}var _0x296bdf=[];var _0x18dc91=[];delete _0x8cfcca['id'];delete _0x8cfcca[_0x6e62('0x2a')];delete _0x8cfcca[_0x6e62('0x2b')];var _0x33319f=_0x8cfcca[_0x6e62('0x2c')]!==_0x6e62('0x2d')?[_0x8cfcca[_0x6e62('0x2c')]]:_0x8cfcca[_0x6e62('0x2e')]?_[_0x6e62('0x8')](_[_0x6e62('0xa')](_0x198320[_0x6e62('0x6')],{'IntervalId':_0x8cfcca[_0x6e62('0x2e')]}),'interval'):[];if(_0x8cfcca[_0x6e62('0x23')](_0x6e62('0x2f'))){if(_0x8cfcca[_0x6e62('0x2f')]&&_0x8cfcca['tag']!=='--'){_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca['type'],'app':'Set','appdata':_0x6e62('0x30')+_0x8cfcca[_0x6e62('0x2f')],'context':_0x8cfcca['context'],'exten':_0x8cfcca[_0x6e62('0x9')],'priority':_0x33319f['length']+_0x198320[_0x6e62('0xe')]+_0x3843fe++,'VoiceExtensionId':_0x8cfcca[_0x6e62('0x19')]});}}if(_0x8cfcca[_0x6e62('0x13')]===_0x6e62('0x1a')&&_0x8cfcca[_0x6e62('0x23')](_0x6e62('0x31'))){if(_0x8cfcca[_0x6e62('0x31')]){_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca[_0x6e62('0x13')],'app':_0x6e62('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x8cfcca[_0x6e62('0x31')]+')','context':_0x8cfcca['context'],'exten':_0x8cfcca[_0x6e62('0x9')],'priority':_0x33319f[_0x6e62('0x28')]+_0x198320['priority']+_0x3843fe++,'VoiceExtensionId':_0x8cfcca['VoiceExtensionId']});}else{_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca[_0x6e62('0x13')],'app':'ExecIf','appdata':_0x6e62('0x32'),'context':_0x8cfcca['context'],'exten':_0x8cfcca[_0x6e62('0x9')],'priority':_0x33319f['length']+_0x198320[_0x6e62('0xe')]+_0x3843fe++,'VoiceExtensionId':_0x8cfcca['VoiceExtensionId']});}}if(_0x8cfcca[_0x6e62('0x23')](_0x6e62('0x33'))){if(_0x143ffb[_0x6e62('0x34')](_0x8cfcca[_0x6e62('0x35')][_0x6e62('0x29')]())>=0x0&&_0x8cfcca[_0x6e62('0x36')]!=='custom'){if(_0x8cfcca[_0x6e62('0x33')]){_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca['type'],'app':_0x6e62('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x8cfcca[_0x6e62('0x18')],'exten':_0x8cfcca['exten'],'priority':_0x33319f['length']+_0x198320['priority']+_0x3843fe++,'VoiceExtensionId':_0x8cfcca[_0x6e62('0x19')]});_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca[_0x6e62('0x13')],'app':_0x6e62('0x17'),'appdata':_0x6e62('0x37'),'context':_0x8cfcca[_0x6e62('0x18')],'exten':_0x8cfcca['exten'],'priority':_0x33319f[_0x6e62('0x28')]+_0x198320['priority']+_0x3843fe++,'VoiceExtensionId':_0x8cfcca['VoiceExtensionId']});}else{_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca['type'],'app':_0x6e62('0x20'),'appdata':_0x6e62('0x38'),'context':_0x8cfcca[_0x6e62('0x18')],'exten':_0x8cfcca[_0x6e62('0x9')],'priority':_0x33319f['length']+_0x198320['priority']+_0x3843fe++,'VoiceExtensionId':_0x8cfcca[_0x6e62('0x19')]});_0x296bdf[_0x6e62('0x12')]({'type':_0x8cfcca[_0x6e62('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x8cfcca[_0x6e62('0x18')],'exten':_0x8cfcca['exten'],'priority':_0x33319f[_0x6e62('0x28')]+_0x198320[_0x6e62('0xe')]+_0x3843fe++,'VoiceExtensionId':_0x8cfcca[_0x6e62('0x19')]});}}}for(var _0xb2ca56=0x0;_0xb2ca56<_0x33319f[_0x6e62('0x28')];_0xb2ca56+=0x1){var _0x4cdceb=_0x198320[_0x6e62('0xe')]+_0x33319f['length'];var _0x34abac=_0xb2ca56===_0x33319f['length']-0x1?_0x198320['priority']+_0x296bdf[_0x6e62('0x28')]+_0x18dc91['length']+0x2:_0x198320['priority']+_0xb2ca56+0x1;_0x296bdf['splice'](_0xb2ca56,0x0,{'type':_0x8cfcca['type'],'app':'GotoIfTime','appdata':_0x33319f[_0xb2ca56]+'?'+_0x8cfcca['context']+_0x6e62('0x39')+_0x4cdceb+':'+_0x8cfcca[_0x6e62('0x18')]+_0x6e62('0x39')+_0x34abac,'exten':_0x8cfcca[_0x6e62('0x9')],'context':_0x8cfcca[_0x6e62('0x18')],'priority':_0x198320[_0x6e62('0xe')]+_0xb2ca56,'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});}_0x8cfcca[_0x6e62('0xe')]=_0x296bdf['length']?_['last'](_0x296bdf)['priority']+0x1:_0x198320['priority'];_0x198320[_0x6e62('0xe')]=(_0x18dc91['length']?_['last'](_0x18dc91)['priority']:_0x8cfcca[_0x6e62('0xe')])+0x1;_0x198320[_0x6e62('0x11')]=_['concat'](_0x198320[_0x6e62('0x11')],_0x296bdf,[_0x8cfcca],_0x18dc91);}_0x198320[_0x6e62('0x11')][_0x6e62('0x12')]({'type':_0x101719[_0x3e1e99][0x0][_0x6e62('0x13')],'app':'Hangup','exten':_0x101719[_0x3e1e99][0x0]['exten'],'context':_0x101719[_0x3e1e99][0x0]['context'],'priority':_0x198320[_0x6e62('0xe')],'VoiceExtensionId':_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]});_0xb7f50e[_0x6e62('0x12')](_0x101719[_0x3e1e99][0x0][_0x6e62('0x19')]);_0x3b0829=_['concat'](_0x3b0829,_0x198320[_0x6e62('0x11')]);}}return _0x31cfa9[_0x6e62('0x3a')](function(_0x4e2be8){return _0x31cfa9['models'][_0x6e62('0x7')][_0x6e62('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0xb7f50e}},'transaction':_0x4e2be8})[_0x6e62('0x5')](function(_0x2451ba){return _0x31cfa9[_0x6e62('0x2')][_0x6e62('0x7')]['bulkCreate'](_['sortBy'](_0x3b0829,_0x6e62('0xe')),{'transaction':_0x4e2be8});});});})[_0x6e62('0x3c')](function(_0x2b81f4){console[_0x6e62('0x3d')](_0x2b81f4);});}exports[_0x6e62('0x3e')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5ce131a..eefaf3e 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 _0x4718=['toString','NOW()','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','into','ListId','cm_contacts','deletedAt\x20IS\x20NULL','str','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','CmList','BlackLists','Lists','always','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','message','join','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','duplicate','Duplicate\x20Contact','CmContact','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field'];(function(_0x598f21,_0x122523){var _0x127aab=function(_0x1860b8){while(--_0x1860b8){_0x598f21['push'](_0x598f21['shift']());}};_0x127aab(++_0x122523);}(_0x4718,0xa1));var _0x8471=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0x4718[_0x5e3701];return _0x345dcf;};'use strict';var BPromise=require('bluebird');var util=require(_0x8471('0x0'));var _=require(_0x8471('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x8471('0x2'));var Redis=require(_0x8471('0x3'));var db=require(_0x8471('0x4'))['db'];var config=require(_0x8471('0x5'));var logger=require('../../../config/logger')(_0x8471('0x6'));config[_0x8471('0x7')]=_[_0x8471('0x8')](config[_0x8471('0x7')],{'host':_0x8471('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8471('0x7')]));require(_0x8471('0xa'))[_0x8471('0xb')](socket);try{if(!process[_0x8471('0xc')][0x2]||process[_0x8471('0xc')][0x2]===_0x8471('0xd')||process[_0x8471('0xc')][0x2]===_0x8471('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x8471('0xc')][0x2];if(!process[_0x8471('0xc')][0x3]||process['argv'][0x3]===_0x8471('0xd')||process[_0x8471('0xc')][0x3]==='null'||!process[_0x8471('0xc')][0x4]||process[_0x8471('0xc')][0x4]==='undefined'||process[_0x8471('0xc')][0x4]===_0x8471('0xe')){throw new Error(_0x8471('0xf'));}var FIELDS=_[_0x8471('0x10')](process[_0x8471('0xc')][0x3]['split'](','),process[_0x8471('0xc')][0x4][_0x8471('0x11')](','));if(!process[_0x8471('0xc')][0x5]||process[_0x8471('0xc')][0x5]===_0x8471('0xd')||process[_0x8471('0xc')][0x5]==='null'){throw new Error(_0x8471('0x12'));}var LISTID=process[_0x8471('0xc')][0x5];var COMPANYID=process[_0x8471('0xc')][0x6]&&process[_0x8471('0xc')][0x6]!==_0x8471('0xd')&&process['argv'][0x6]!==_0x8471('0xe')?process[_0x8471('0xc')][0x6]:null;var DUPLICATES=process[_0x8471('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x8471('0xc')][0x7]!==_0x8471('0xe')?process[_0x8471('0xc')][0x7]:null;if(!process[_0x8471('0xc')][0x8]||process[_0x8471('0xc')][0x8]==='undefined'||process[_0x8471('0xc')][0x8]===_0x8471('0xe')){throw new Error(_0x8471('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x1568b9){logger[_0x8471('0x14')](_0x1568b9);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(_0x3f591e,_0x5afe9c,_0x3fb686,_0x59761c){var _0x276792={'message':_0x5afe9c};_0x276792[_0x3f591e]=!![];if(_0x3fb686){_0x276792[_0x8471('0x15')]=_0x3fb686;}if(_0x59761c){_0x276792[_0x8471('0x16')]=_0x59761c;}return _0x276792;}function isEmail(_0x172b46){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))*$/[_0x8471('0x17')](_0x172b46);}function checkRow(_0x5d8e2d,_0x250f23,_0x44cbce){return new BPromise(function(_0xc1e21f,_0x5f3cad){if(_['isNil'](_0x5d8e2d)){return _0x5f3cad(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x44cbce));}if(_0x5d8e2d[_0x8471('0x18')]&&_0x5d8e2d[_0x8471('0x18')][_0x8471('0x19')]){var _0x5a5503=_[_0x8471('0x1a')](_0x5d8e2d[_0x8471('0x18')],_0x8471('0x1b'))[_0x8471('0x1c')](';');return _0x5f3cad(handleCheckRowError(_0x8471('0x14'),_0x5a5503,null,_0x44cbce));}var _0x40a685={};for(var _0x5a682b in FIELDS){if(FIELDS[_0x8471('0x1d')](_0x5a682b)&&FIELDS[_0x5a682b]){_0x40a685[_0x5a682b]=_0x5d8e2d[_0x8471('0x1e')][0x0][FIELDS[_0x5a682b]]||_0x5d8e2d['data'][0x0]['\ufeff'+FIELDS[_0x5a682b]];}}if(!_0x40a685['firstName']){return _0x5f3cad(handleCheckRowError(_0x8471('0x14'),'firstName\x20not\x20specified!',null,_0x44cbce));}if(!_0x40a685[_0x8471('0x1f')]){return _0x5f3cad(handleCheckRowError('error',_0x8471('0x20'),null,_0x44cbce));}if(_0x40a685[_0x8471('0x21')]){var _0x1f6ca8=moment(_0x40a685[_0x8471('0x21')],_0x8471('0x22'));if(!_0x1f6ca8[_0x8471('0x23')]()){return _0x5f3cad(handleCheckRowError('error',_0x8471('0x24'),null,_0x44cbce));}}if(_0x40a685[_0x8471('0x25')]){if(!isEmail(_0x40a685['email'])){return _0x5f3cad(handleCheckRowError(_0x8471('0x14'),_0x8471('0x26'),null,_0x44cbce));}}_0x40a685['ListId']=LISTID;_0x40a685['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8471('0x19')]&&_0x250f23){var _0x44fc90={};for(var _0x4731d3=0x0,_0x1c8ece=DUPLICATES[_0x8471('0x19')];_0x4731d3<_0x1c8ece;_0x4731d3+=0x1){_0x44fc90[DUPLICATES[_0x4731d3]]=_0x40a685[DUPLICATES[_0x4731d3]];}var _0x249f72=_['find'](_0x250f23,_0x44fc90);if(_0x249f72){return _0x5f3cad(handleCheckRowError(_0x8471('0x27'),_0x8471('0x28'),_0x249f72,_0x44cbce));}}return db[_0x8471('0x29')]['create'](_0x40a685,{'raw':!![],'hooks':![],'fields':_[_0x8471('0x2a')](_0x40a685)})[_0x8471('0x2b')](function(_0x47a535){if(DUPLICATES&&DUPLICATES[_0x8471('0x19')]&&_0x250f23){_0x250f23['push'](_['pick'](_0x40a685,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x47a535['id'];return _0xc1e21f();})[_0x8471('0x2c')](function(_0x234610){return _0x5f3cad(handleCheckRowError(_0x8471('0x14'),_0x8471('0x2d')+(_0x234610[_0x8471('0x1b')]||JSON[_0x8471('0x2e')](_0x234610)),null,_0x44cbce));});});}function checkHopper(){function _0xc922b4(){return function(_0x6e434e){logger[_0x8471('0x14')]('cmContact','checkHopper',util[_0x8471('0x2f')](_0x6e434e,{'showHidden':![],'depth':null}));};}var _0x17a4a9=function(_0x101adb,_0x3a7812){var _0x5176d8=squel[_0x8471('0x30')]()['into'](_0x8471('0x31'))[_0x8471('0x32')]([_0x8471('0x1f'),_0x8471('0x33'),_0x8471('0x34'),'ListId',_0x3a7812,_0x8471('0x35'),_0x8471('0x36')],squel[_0x8471('0x37')]()[_0x8471('0x38')](_0x8471('0x1f'),_0x8471('0x1f'))[_0x8471('0x38')]('NOW()',_0x8471('0x33'))[_0x8471('0x38')]('id',_0x8471('0x34'))[_0x8471('0x38')](LISTID[_0x8471('0x39')](),'ListId')[_0x8471('0x38')](_0x101adb['id'][_0x8471('0x39')](),_0x3a7812)[_0x8471('0x38')](_0x8471('0x3a'),'createdAt')[_0x8471('0x38')](_0x8471('0x3a'),_0x8471('0x36'))['from']('cm_contacts')[_0x8471('0x3b')]('deletedAt\x20IS\x20NULL')[_0x8471('0x3b')](_0x8471('0x3c'),LISTID['toString']())[_0x8471('0x3b')](_0x8471('0x3d'))[_0x8471('0x3b')](_0x8471('0x3e'),squel[_0x8471('0x37')]()['field']('phone')[_0x8471('0x3f')](_0x8471('0x31'))['where'](_0x3a7812+_0x8471('0x40'),_0x101adb['id'][_0x8471('0x39')]())))[_0x8471('0x39')]();return _0x5176d8;};var _0x5c7639=function(_0x2bdbb5,_0x3911a4){var _0x4a21ff=squel['insert']()[_0x8471('0x41')](_0x8471('0x31'))['fromQuery']([_0x8471('0x1f'),'scheduledAt','ContactId',_0x8471('0x42'),_0x3911a4,_0x8471('0x35'),_0x8471('0x36')],squel['select']()['field'](_0x8471('0x1f'),_0x8471('0x1f'))[_0x8471('0x38')](_0x8471('0x3a'),_0x8471('0x33'))[_0x8471('0x38')]('id','ContactId')[_0x8471('0x38')](LISTID[_0x8471('0x39')](),_0x8471('0x42'))['field'](_0x2bdbb5['id']['toString'](),_0x3911a4)[_0x8471('0x38')]('NOW()',_0x8471('0x35'))[_0x8471('0x38')](_0x8471('0x3a'),_0x8471('0x36'))['from'](_0x8471('0x43'))[_0x8471('0x3b')](_0x8471('0x44'))[_0x8471('0x3b')](_0x8471('0x3c'),LISTID[_0x8471('0x39')]())[_0x8471('0x3b')]('id\x20IN\x20?',squel[_0x8471('0x45')](hopperContacts))[_0x8471('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x8471('0x3b')](_0x8471('0x3e'),squel[_0x8471('0x37')]()['field']('calleridnum')[_0x8471('0x3f')](_0x8471('0x46'))[_0x8471('0x3b')](_0x3911a4+_0x8471('0x40'),_0x2bdbb5['id'][_0x8471('0x39')]()))[_0x8471('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x8471('0x38')](_0x8471('0x1f'))[_0x8471('0x3f')](_0x8471('0x31'))[_0x8471('0x3b')](_0x3911a4+_0x8471('0x40'),_0x2bdbb5['id']['toString']())))[_0x8471('0x39')]();return _0x4a21ff;};function _0x5c70f3(_0x4a700e,_0x165e67){var _0x47794d=squel[_0x8471('0x30')]()[_0x8471('0x41')]('cm_hopper')[_0x8471('0x32')]([_0x8471('0x1f'),'scheduledAt',_0x8471('0x34'),_0x8471('0x42'),_0x165e67,_0x8471('0x35'),'updatedAt'],squel[_0x8471('0x37')]()[_0x8471('0x38')]('phone',_0x8471('0x1f'))[_0x8471('0x38')]('NOW()',_0x8471('0x33'))[_0x8471('0x38')]('id',_0x8471('0x34'))[_0x8471('0x38')](LISTID[_0x8471('0x39')](),_0x8471('0x42'))[_0x8471('0x38')](_0x4a700e['id'][_0x8471('0x39')](),_0x165e67)[_0x8471('0x38')](_0x8471('0x3a'),'createdAt')[_0x8471('0x38')]('NOW()','updatedAt')['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x8471('0x3b')](_0x8471('0x3c'),LISTID[_0x8471('0x39')]())[_0x8471('0x3b')](_0x8471('0x47'),squel['str'](hopperContacts))[_0x8471('0x3b')](_0x8471('0x3d')))['toString']();return _0x47794d;}function _0xef8033(_0x36e568,_0xc45419){var _0x1ece2e=squel['insert']()[_0x8471('0x41')](_0x8471('0x48'))[_0x8471('0x32')](['phone',_0x8471('0x34'),'ListId',_0xc45419,_0x8471('0x35'),'updatedAt'],squel[_0x8471('0x37')]()['field'](_0x8471('0x1f'),_0x8471('0x1f'))[_0x8471('0x38')]('id',_0x8471('0x34'))[_0x8471('0x38')](LISTID[_0x8471('0x39')](),_0x8471('0x42'))[_0x8471('0x38')](_0x36e568['id'][_0x8471('0x39')](),_0xc45419)[_0x8471('0x38')](_0x8471('0x3a'),'createdAt')[_0x8471('0x38')](_0x8471('0x3a'),_0x8471('0x36'))[_0x8471('0x3f')](_0x8471('0x43'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x8471('0x3c'),LISTID[_0x8471('0x39')]())['where'](_0x8471('0x47'),squel['str'](hopperContacts))[_0x8471('0x3b')](_0x8471('0x3d')))[_0x8471('0x39')]();return _0x1ece2e;}return db[_0x8471('0x49')][_0x8471('0x4a')]({'where':{'type':'outbound'},'attributes':['id',_0x8471('0x4b')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x8471('0x2b')](function(_0x1e8631){var _0x4331f2=[];if(_0x1e8631){var _0x5e7a6f;for(var _0xc983c=0x0,_0x52f71f;_0xc983c<_0x1e8631['length'];_0xc983c+=0x1){_0x52f71f=_0x1e8631[_0xc983c][_0x8471('0x4c')]({'plain':!![]});switch(_0x52f71f[_0x8471('0x4b')]){case'always':_0x4331f2[_0x8471('0x4d')](db[_0x8471('0x4e')][_0x8471('0x4f')](_0x5c7639(_0x52f71f,_0x8471('0x50')))[_0x8471('0x2b')](function(){})[_0x8471('0x2c')](_0xc922b4()));break;case _0x8471('0x51'):_0x4331f2[_0x8471('0x4d')](db[_0x8471('0x4e')][_0x8471('0x4f')](_0x17a4a9(_0x52f71f,'VoiceQueueId'))[_0x8471('0x2b')](function(){})['catch'](_0xc922b4()));break;default:_0x4331f2[_0x8471('0x4d')](db[_0x8471('0x4e')][_0x8471('0x4f')](_0x5c70f3(_0x52f71f,_0x8471('0x50')))[_0x8471('0x2b')](function(){})[_0x8471('0x2c')](_0xc922b4()));}}}return _0x4331f2;})[_0x8471('0x52')]()[_0x8471('0x2b')](function(){return db[_0x8471('0x49')][_0x8471('0x4a')]({'where':{'type':_0x8471('0x53')},'attributes':['id'],'include':[{'model':db[_0x8471('0x54')],'as':_0x8471('0x55'),'where':{'id':LISTID}}]})[_0x8471('0x2b')](function(_0x4aa45b){var _0x55a529=[];if(_0x4aa45b){var _0x14a88e;for(var _0x27269e=0x0,_0x2e74a6;_0x27269e<_0x4aa45b[_0x8471('0x19')];_0x27269e+=0x1){_0x2e74a6=_0x4aa45b[_0x27269e]['get']({'plain':!![]});_0x55a529['push'](db[_0x8471('0x4e')][_0x8471('0x4f')](_0xef8033(_0x2e74a6,'VoiceQueueId'))[_0x8471('0x2b')](function(){})[_0x8471('0x2c')](_0xc922b4()));}}return _0x55a529;})[_0x8471('0x52')]();})['then'](function(){return db['Campaign'][_0x8471('0x4a')]({'attributes':['id',_0x8471('0x4b')],'include':[{'model':db['CmList'],'as':_0x8471('0x56'),'where':{'id':LISTID}}]})[_0x8471('0x2b')](function(_0x16e760){var _0x65c4fd=[];if(_0x16e760){for(var _0x3d76e5=0x0,_0x4de1bf;_0x3d76e5<_0x16e760[_0x8471('0x19')];_0x3d76e5+=0x1){_0x4de1bf=_0x16e760[_0x3d76e5][_0x8471('0x4c')]({'plain':!![]});switch(_0x4de1bf[_0x8471('0x4b')]){case _0x8471('0x57'):_0x65c4fd[_0x8471('0x4d')](db[_0x8471('0x4e')][_0x8471('0x4f')](_0x5c7639(_0x4de1bf,_0x8471('0x58')))[_0x8471('0x2b')](function(){})[_0x8471('0x2c')](_0xc922b4()));break;case _0x8471('0x51'):_0x65c4fd[_0x8471('0x4d')](db['sequelize'][_0x8471('0x4f')](_0x17a4a9(_0x4de1bf,_0x8471('0x58')))[_0x8471('0x2b')](function(){})['catch'](_0xc922b4()));break;default:_0x65c4fd[_0x8471('0x4d')](db['sequelize'][_0x8471('0x4f')](_0x5c70f3(_0x4de1bf,_0x8471('0x58')))['then'](function(){})[_0x8471('0x2c')](_0xc922b4()));}}}return _0x65c4fd;})['all']();})['then'](function(){return db[_0x8471('0x59')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8471('0x55'),'where':{'id':LISTID}}]})[_0x8471('0x2b')](function(_0x400b90){var _0x5364ef=[];if(_0x400b90){for(var _0x5af7cb=0x0,_0x5d4640;_0x5af7cb<_0x400b90[_0x8471('0x19')];_0x5af7cb+=0x1){_0x5d4640=_0x400b90[_0x5af7cb]['get']({'plain':!![]});_0x5364ef[_0x8471('0x4d')](db[_0x8471('0x4e')][_0x8471('0x4f')](_0xef8033(_0x5d4640,_0x8471('0x58')))[_0x8471('0x2b')](function(){})[_0x8471('0x2c')](_0xc922b4()));}}return _0x5364ef;})['all']();})[_0x8471('0x2c')](function(_0xbee531){logger[_0x8471('0x14')](_0x8471('0x5a'),_0x8471('0x5b'),_0xbee531[_0x8471('0x1b')]);});}var processPromises=function(_0xab32bc){return BPromise[_0x8471('0x52')](promises)[_0x8471('0x2b')](function(_0x3608ec){})['catch'](function(_0x224131){logger[_0x8471('0x14')](_0x8471('0x5c'),JSON[_0x8471('0x2e')](_0x224131));})[_0x8471('0x5d')](function(){socket[_0x8471('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xab32bc){return _0xab32bc[_0x8471('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x8471('0x2b')](function(){socket[_0x8471('0x5e')](_0x8471('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8471('0x61')](FILEPATH);}catch(_0x986d9d){logger['error'](_0x8471('0x62'),JSON[_0x8471('0x2e')](_0x986d9d));}finally{process['exit'](0x0);}});};process['on'](_0x8471('0x63'),function(){logger[_0x8471('0x64')](_0x8471('0x65'));endCsv();});function main(){return BPromise[_0x8471('0x66')]()[_0x8471('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8471('0x11')](',');return db[_0x8471('0x29')][_0x8471('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8471('0x2b')](function(_0x1d3ab3){var _0x3b48b6=fs[_0x8471('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8471('0x68')](_0x3b48b6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4deea6,_0x260de7){total+=0x1;var _0x220cdb=total;promises['push'](checkRow(_0x4deea6,_0x1d3ab3,_0x220cdb)['then'](function(){success+=0x1;})[_0x8471('0x2c')](function(_0x4c4285){if(_0x4c4285[_0x8471('0x14')]){errors+=0x1;delete _0x4c4285['error'];}else if(_0x4c4285['duplicate']){duplicates+=0x1;delete _0x4c4285[_0x8471('0x27')];}rows['push'](_0x4c4285);}));if(total%0xc8===0x0){_0x260de7[_0x8471('0x69')]();return processPromises(_0x260de7);}},'complete':function(){return processPromises()[_0x8471('0x2b')](function(){logger[_0x8471('0x64')](_0x8471('0x6a'));endCsv();});},'error':function(_0x3a4356,_0x5994c0){logger['info'](_0x8471('0x6b'),JSON[_0x8471('0x2e')](_0x3a4356));endCsv();}});})[_0x8471('0x2c')](function(_0x204663){logger[_0x8471('0x14')](_0x8471('0x6c'),JSON[_0x8471('0x2e')](_0x204663));});}main(); \ No newline at end of file +var _0x8cf2=['query','VoiceQueueId','all','Campaign','Lists','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','bluebird','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','scheduledAt','updatedAt','select','field','NOW()','ContactId','toString','createdAt','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','fromQuery','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','push','sequelize'];(function(_0x399809,_0x5d989e){var _0x34f071=function(_0x39a877){while(--_0x39a877){_0x399809['push'](_0x399809['shift']());}};_0x34f071(++_0x5d989e);}(_0x8cf2,0xeb));var _0x28cf=function(_0x5d647d,_0x4943bd){_0x5d647d=_0x5d647d-0x0;var _0x224bd4=_0x8cf2[_0x5d647d];return _0x224bd4;};'use strict';var BPromise=require(_0x28cf('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x28cf('0x1'));var Papa=require(_0x28cf('0x2'));var Redis=require(_0x28cf('0x3'));var db=require(_0x28cf('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x28cf('0x5'))('api');config[_0x28cf('0x6')]=_[_0x28cf('0x7')](config[_0x28cf('0x6')],{'host':_0x28cf('0x8'),'port':0x18eb});var socket=require(_0x28cf('0x9'))(new Redis(config[_0x28cf('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x28cf('0xa')](socket);try{if(!process[_0x28cf('0xb')][0x2]||process[_0x28cf('0xb')][0x2]===_0x28cf('0xc')||process[_0x28cf('0xb')][0x2]==='null'){throw new Error(_0x28cf('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x28cf('0xb')][0x3]||process['argv'][0x3]===_0x28cf('0xc')||process[_0x28cf('0xb')][0x3]===_0x28cf('0xe')||!process[_0x28cf('0xb')][0x4]||process[_0x28cf('0xb')][0x4]===_0x28cf('0xc')||process[_0x28cf('0xb')][0x4]===_0x28cf('0xe')){throw new Error(_0x28cf('0xf'));}var FIELDS=_[_0x28cf('0x10')](process[_0x28cf('0xb')][0x3][_0x28cf('0x11')](','),process['argv'][0x4][_0x28cf('0x11')](','));if(!process[_0x28cf('0xb')][0x5]||process['argv'][0x5]===_0x28cf('0xc')||process[_0x28cf('0xb')][0x5]===_0x28cf('0xe')){throw new Error(_0x28cf('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x28cf('0xb')][0x6]!==_0x28cf('0xc')&&process[_0x28cf('0xb')][0x6]!==_0x28cf('0xe')?process[_0x28cf('0xb')][0x6]:null;var DUPLICATES=process[_0x28cf('0xb')][0x7]&&process[_0x28cf('0xb')][0x7]!==_0x28cf('0xc')&&process['argv'][0x7]!=='null'?process[_0x28cf('0xb')][0x7]:null;if(!process[_0x28cf('0xb')][0x8]||process[_0x28cf('0xb')][0x8]==='undefined'||process[_0x28cf('0xb')][0x8]===_0x28cf('0xe')){throw new Error(_0x28cf('0x13'));}var SOCKET_TIMESTAMP=process[_0x28cf('0xb')][0x8];}catch(_0x98fd96){logger[_0x28cf('0x14')](_0x98fd96);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(_0x49ccf6,_0x189a95,_0x484271,_0x4067e3){var _0x44ae2e={'message':_0x189a95};_0x44ae2e[_0x49ccf6]=!![];if(_0x484271){_0x44ae2e[_0x28cf('0x15')]=_0x484271;}if(_0x4067e3){_0x44ae2e[_0x28cf('0x16')]=_0x4067e3;}return _0x44ae2e;}function isEmail(_0x42d93a){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'](_0x42d93a);}function checkRow(_0x35401a,_0x4907ec,_0x3c0977){return new BPromise(function(_0x51327e,_0x3e5a52){if(_['isNil'](_0x35401a)){return _0x3e5a52(handleCheckRowError(_0x28cf('0x14'),_0x28cf('0x17'),null,_0x3c0977));}if(_0x35401a[_0x28cf('0x18')]&&_0x35401a[_0x28cf('0x18')][_0x28cf('0x19')]){var _0x1bf165=_[_0x28cf('0x1a')](_0x35401a[_0x28cf('0x18')],_0x28cf('0x1b'))[_0x28cf('0x1c')](';');return _0x3e5a52(handleCheckRowError(_0x28cf('0x14'),_0x1bf165,null,_0x3c0977));}var _0x1fe347={};for(var _0x47acfe in FIELDS){if(FIELDS['hasOwnProperty'](_0x47acfe)&&FIELDS[_0x47acfe]){_0x1fe347[_0x47acfe]=_0x35401a[_0x28cf('0x1d')][0x0][FIELDS[_0x47acfe]]||_0x35401a['data'][0x0]['\ufeff'+FIELDS[_0x47acfe]];}}if(!_0x1fe347[_0x28cf('0x1e')]){return _0x3e5a52(handleCheckRowError('error',_0x28cf('0x1f'),null,_0x3c0977));}if(!_0x1fe347[_0x28cf('0x20')]){return _0x3e5a52(handleCheckRowError(_0x28cf('0x14'),_0x28cf('0x21'),null,_0x3c0977));}if(_0x1fe347[_0x28cf('0x22')]){var _0x4702cc=moment(_0x1fe347['birthDate'],_0x28cf('0x23'));if(!_0x4702cc[_0x28cf('0x24')]()){return _0x3e5a52(handleCheckRowError(_0x28cf('0x14'),_0x28cf('0x25'),null,_0x3c0977));}}if(_0x1fe347[_0x28cf('0x26')]){if(!isEmail(_0x1fe347['email'])){return _0x3e5a52(handleCheckRowError('error',_0x28cf('0x27'),null,_0x3c0977));}}_0x1fe347[_0x28cf('0x28')]=LISTID;_0x1fe347[_0x28cf('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x28cf('0x19')]&&_0x4907ec){var _0x5ae9e0={};for(var _0x258807=0x0,_0x2a067c=DUPLICATES[_0x28cf('0x19')];_0x258807<_0x2a067c;_0x258807+=0x1){_0x5ae9e0[DUPLICATES[_0x258807]]=_0x1fe347[DUPLICATES[_0x258807]];}var _0x385b85=_[_0x28cf('0x2a')](_0x4907ec,_0x5ae9e0);if(_0x385b85){return _0x3e5a52(handleCheckRowError(_0x28cf('0x2b'),'Duplicate\x20Contact',_0x385b85,_0x3c0977));}}return db[_0x28cf('0x2c')][_0x28cf('0x2d')](_0x1fe347,{'raw':!![],'hooks':![],'fields':_[_0x28cf('0x2e')](_0x1fe347)})[_0x28cf('0x2f')](function(_0x5d94e5){if(DUPLICATES&&DUPLICATES['length']&&_0x4907ec){_0x4907ec['push'](_['pick'](_0x1fe347,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5d94e5['id'];return _0x51327e();})[_0x28cf('0x30')](function(_0x52d803){return _0x3e5a52(handleCheckRowError(_0x28cf('0x14'),_0x28cf('0x31')+(_0x52d803['message']||JSON[_0x28cf('0x32')](_0x52d803)),null,_0x3c0977));});});}function checkHopper(){function _0x3bdb38(){return function(_0x3fc585){logger[_0x28cf('0x14')](_0x28cf('0x33'),'checkHopper',util[_0x28cf('0x34')](_0x3fc585,{'showHidden':![],'depth':null}));};}var _0x18ca73=function(_0x2ee18f,_0x515f61){var _0x3d7e59=squel[_0x28cf('0x35')]()[_0x28cf('0x36')](_0x28cf('0x37'))['fromQuery'](['phone',_0x28cf('0x38'),'ContactId',_0x28cf('0x28'),_0x515f61,'createdAt',_0x28cf('0x39')],squel[_0x28cf('0x3a')]()[_0x28cf('0x3b')](_0x28cf('0x20'),'phone')['field'](_0x28cf('0x3c'),_0x28cf('0x38'))[_0x28cf('0x3b')]('id',_0x28cf('0x3d'))['field'](LISTID['toString'](),_0x28cf('0x28'))[_0x28cf('0x3b')](_0x2ee18f['id'][_0x28cf('0x3e')](),_0x515f61)['field'](_0x28cf('0x3c'),_0x28cf('0x3f'))['field']('NOW()','updatedAt')['from']('cm_contacts')[_0x28cf('0x40')](_0x28cf('0x41'))[_0x28cf('0x40')]('ListId\x20=\x20?',LISTID[_0x28cf('0x3e')]())[_0x28cf('0x40')](_0x28cf('0x42'))['where'](_0x28cf('0x43'),squel[_0x28cf('0x3a')]()['field'](_0x28cf('0x20'))[_0x28cf('0x44')](_0x28cf('0x37'))['where'](_0x515f61+_0x28cf('0x45'),_0x2ee18f['id'][_0x28cf('0x3e')]())))[_0x28cf('0x3e')]();return _0x3d7e59;};var _0x398b65=function(_0x572580,_0xb3d32){var _0x1a619c=squel[_0x28cf('0x35')]()[_0x28cf('0x36')]('cm_hopper')['fromQuery']([_0x28cf('0x20'),_0x28cf('0x38'),_0x28cf('0x3d'),_0x28cf('0x28'),_0xb3d32,'createdAt',_0x28cf('0x39')],squel['select']()[_0x28cf('0x3b')](_0x28cf('0x20'),_0x28cf('0x20'))[_0x28cf('0x3b')](_0x28cf('0x3c'),_0x28cf('0x38'))['field']('id',_0x28cf('0x3d'))[_0x28cf('0x3b')](LISTID[_0x28cf('0x3e')](),'ListId')[_0x28cf('0x3b')](_0x572580['id']['toString'](),_0xb3d32)[_0x28cf('0x3b')](_0x28cf('0x3c'),_0x28cf('0x3f'))[_0x28cf('0x3b')](_0x28cf('0x3c'),'updatedAt')[_0x28cf('0x44')](_0x28cf('0x46'))[_0x28cf('0x40')](_0x28cf('0x41'))[_0x28cf('0x40')](_0x28cf('0x47'),LISTID['toString']())['where'](_0x28cf('0x48'),squel['str'](hopperContacts))['where'](_0x28cf('0x42'))[_0x28cf('0x40')](_0x28cf('0x43'),squel[_0x28cf('0x3a')]()['field']('calleridnum')[_0x28cf('0x44')]('cm_hopper_final')['where'](_0xb3d32+_0x28cf('0x45'),_0x572580['id']['toString']()))[_0x28cf('0x40')](_0x28cf('0x43'),squel[_0x28cf('0x3a')]()['field'](_0x28cf('0x20'))['from'](_0x28cf('0x37'))['where'](_0xb3d32+_0x28cf('0x45'),_0x572580['id'][_0x28cf('0x3e')]())))[_0x28cf('0x3e')]();return _0x1a619c;};function _0x229a7c(_0x5f33c9,_0x5a6ecc){var _0x55540f=squel['insert']()[_0x28cf('0x36')](_0x28cf('0x37'))['fromQuery']([_0x28cf('0x20'),'scheduledAt',_0x28cf('0x3d'),_0x28cf('0x28'),_0x5a6ecc,'createdAt',_0x28cf('0x39')],squel['select']()[_0x28cf('0x3b')](_0x28cf('0x20'),_0x28cf('0x20'))['field'](_0x28cf('0x3c'),_0x28cf('0x38'))[_0x28cf('0x3b')]('id',_0x28cf('0x3d'))[_0x28cf('0x3b')](LISTID[_0x28cf('0x3e')](),_0x28cf('0x28'))[_0x28cf('0x3b')](_0x5f33c9['id']['toString'](),_0x5a6ecc)[_0x28cf('0x3b')](_0x28cf('0x3c'),'createdAt')['field'](_0x28cf('0x3c'),_0x28cf('0x39'))[_0x28cf('0x44')](_0x28cf('0x46'))[_0x28cf('0x40')](_0x28cf('0x41'))[_0x28cf('0x40')]('ListId\x20=\x20?',LISTID['toString']())[_0x28cf('0x40')](_0x28cf('0x48'),squel['str'](hopperContacts))[_0x28cf('0x40')](_0x28cf('0x42')))[_0x28cf('0x3e')]();return _0x55540f;}function _0x55240b(_0x2d2b0e,_0x1e9bb2){var _0x4ab233=squel[_0x28cf('0x35')]()[_0x28cf('0x36')](_0x28cf('0x49'))[_0x28cf('0x4a')]([_0x28cf('0x20'),_0x28cf('0x3d'),_0x28cf('0x28'),_0x1e9bb2,_0x28cf('0x3f'),_0x28cf('0x39')],squel[_0x28cf('0x3a')]()[_0x28cf('0x3b')](_0x28cf('0x20'),_0x28cf('0x20'))['field']('id','ContactId')[_0x28cf('0x3b')](LISTID[_0x28cf('0x3e')](),'ListId')[_0x28cf('0x3b')](_0x2d2b0e['id'][_0x28cf('0x3e')](),_0x1e9bb2)[_0x28cf('0x3b')](_0x28cf('0x3c'),_0x28cf('0x3f'))[_0x28cf('0x3b')](_0x28cf('0x3c'),_0x28cf('0x39'))[_0x28cf('0x44')](_0x28cf('0x46'))[_0x28cf('0x40')](_0x28cf('0x41'))[_0x28cf('0x40')](_0x28cf('0x47'),LISTID[_0x28cf('0x3e')]())[_0x28cf('0x40')](_0x28cf('0x48'),squel['str'](hopperContacts))[_0x28cf('0x40')](_0x28cf('0x42')))[_0x28cf('0x3e')]();return _0x4ab233;}return db[_0x28cf('0x4b')][_0x28cf('0x4c')]({'where':{'type':_0x28cf('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x28cf('0x4e')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0xf25657){var _0x3795f2=[];if(_0xf25657){var _0x37790a;for(var _0x1a6a55=0x0,_0x130e91;_0x1a6a55<_0xf25657[_0x28cf('0x19')];_0x1a6a55+=0x1){_0x130e91=_0xf25657[_0x1a6a55][_0x28cf('0x4f')]({'plain':!![]});switch(_0x130e91[_0x28cf('0x50')]){case'always':_0x3795f2[_0x28cf('0x51')](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x398b65(_0x130e91,_0x28cf('0x54')))[_0x28cf('0x2f')](function(){})['catch'](_0x3bdb38()));break;case'onlyIfOpen':_0x3795f2[_0x28cf('0x51')](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x18ca73(_0x130e91,_0x28cf('0x54')))[_0x28cf('0x2f')](function(){})[_0x28cf('0x30')](_0x3bdb38()));break;default:_0x3795f2[_0x28cf('0x51')](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x229a7c(_0x130e91,_0x28cf('0x54')))[_0x28cf('0x2f')](function(){})[_0x28cf('0x30')](_0x3bdb38()));}}}return _0x3795f2;})['all']()[_0x28cf('0x2f')](function(){return db[_0x28cf('0x4b')]['findAll']({'where':{'type':_0x28cf('0x4d')},'attributes':['id'],'include':[{'model':db[_0x28cf('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x28cf('0x2f')](function(_0x19dd8d){var _0x3da1ee=[];if(_0x19dd8d){var _0x59c15b;for(var _0x5afc97=0x0,_0x242125;_0x5afc97<_0x19dd8d['length'];_0x5afc97+=0x1){_0x242125=_0x19dd8d[_0x5afc97][_0x28cf('0x4f')]({'plain':!![]});_0x3da1ee['push'](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x55240b(_0x242125,_0x28cf('0x54')))[_0x28cf('0x2f')](function(){})[_0x28cf('0x30')](_0x3bdb38()));}}return _0x3da1ee;})[_0x28cf('0x55')]();})[_0x28cf('0x2f')](function(){return db[_0x28cf('0x56')]['findAll']({'attributes':['id',_0x28cf('0x50')],'include':[{'model':db[_0x28cf('0x4e')],'as':_0x28cf('0x57'),'where':{'id':LISTID}}]})[_0x28cf('0x2f')](function(_0x4ff5e4){var _0x27e056=[];if(_0x4ff5e4){for(var _0x400891=0x0,_0x54e093;_0x400891<_0x4ff5e4[_0x28cf('0x19')];_0x400891+=0x1){_0x54e093=_0x4ff5e4[_0x400891][_0x28cf('0x4f')]({'plain':!![]});switch(_0x54e093[_0x28cf('0x50')]){case _0x28cf('0x58'):_0x27e056['push'](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x398b65(_0x54e093,_0x28cf('0x59')))['then'](function(){})[_0x28cf('0x30')](_0x3bdb38()));break;case _0x28cf('0x5a'):_0x27e056[_0x28cf('0x51')](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x18ca73(_0x54e093,'CampaignId'))[_0x28cf('0x2f')](function(){})['catch'](_0x3bdb38()));break;default:_0x27e056[_0x28cf('0x51')](db[_0x28cf('0x52')][_0x28cf('0x53')](_0x229a7c(_0x54e093,_0x28cf('0x59')))[_0x28cf('0x2f')](function(){})[_0x28cf('0x30')](_0x3bdb38()));}}}return _0x27e056;})[_0x28cf('0x55')]();})[_0x28cf('0x2f')](function(){return db[_0x28cf('0x56')][_0x28cf('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x28cf('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x28cf('0x2f')](function(_0x434ed7){var _0x37c84b=[];if(_0x434ed7){for(var _0xece06b=0x0,_0x5e45b2;_0xece06b<_0x434ed7[_0x28cf('0x19')];_0xece06b+=0x1){_0x5e45b2=_0x434ed7[_0xece06b]['get']({'plain':!![]});_0x37c84b[_0x28cf('0x51')](db[_0x28cf('0x52')]['query'](_0x55240b(_0x5e45b2,'CampaignId'))[_0x28cf('0x2f')](function(){})[_0x28cf('0x30')](_0x3bdb38()));}}return _0x37c84b;})[_0x28cf('0x55')]();})[_0x28cf('0x30')](function(_0x27f3de){logger[_0x28cf('0x14')](_0x28cf('0x5b'),_0x28cf('0x5c'),_0x27f3de[_0x28cf('0x1b')]);});}var processPromises=function(_0x5be212){return BPromise['all'](promises)[_0x28cf('0x2f')](function(_0x45d2ee){})[_0x28cf('0x30')](function(_0x516e5d){logger['error'](_0x28cf('0x5d'),JSON[_0x28cf('0x32')](_0x516e5d));})[_0x28cf('0x5e')](function(){socket[_0x28cf('0x5f')](_0x28cf('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5be212){return _0x5be212[_0x28cf('0x61')]();}});};var endCsv=function(){return BPromise[_0x28cf('0x62')]()[_0x28cf('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x28cf('0x2f')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x28cf('0x63')](FILEPATH);}catch(_0x114785){logger[_0x28cf('0x14')](_0x28cf('0x64'),JSON['stringify'](_0x114785));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x28cf('0x65')](_0x28cf('0x66'));endCsv();});function main(){return BPromise[_0x28cf('0x62')]()[_0x28cf('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x28cf('0x11')](',');return db['CmContact'][_0x28cf('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x28cf('0x2f')](function(_0x3371f8){var _0xfa2139=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x28cf('0x67')](_0xfa2139,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2db2b5,_0x38090a){total+=0x1;var _0x2a6a0f=total;promises[_0x28cf('0x51')](checkRow(_0x2db2b5,_0x3371f8,_0x2a6a0f)[_0x28cf('0x2f')](function(){success+=0x1;})[_0x28cf('0x30')](function(_0x1e1ac9){if(_0x1e1ac9[_0x28cf('0x14')]){errors+=0x1;delete _0x1e1ac9[_0x28cf('0x14')];}else if(_0x1e1ac9[_0x28cf('0x2b')]){duplicates+=0x1;delete _0x1e1ac9[_0x28cf('0x2b')];}rows[_0x28cf('0x51')](_0x1e1ac9);}));if(total%0xc8===0x0){_0x38090a[_0x28cf('0x68')]();return processPromises(_0x38090a);}},'complete':function(){return processPromises()[_0x28cf('0x2f')](function(){logger[_0x28cf('0x65')](_0x28cf('0x69'));endCsv();});},'error':function(_0x73e536,_0x2ac3d1){logger[_0x28cf('0x65')]('CSV\x20parse\x20error',JSON[_0x28cf('0x32')](_0x73e536));endCsv();}});})['catch'](function(_0x5ee846){logger[_0x28cf('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x28cf('0x32')](_0x5ee846));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index ee6f9f1..be4f7bc 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 _0x069f=['redis','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','insert','select','fields','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','keys','id\x20IN\x20?','MIN(id)','group','info','error','message','exit','push','code','query','spread','catch','main','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','errors','replace','scheduledat','isValid','priority','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','Abort\x20parser','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','affectedRows','emit','unlink','complete','arguments\x20\x20\x20','root','file\x20doesn\x27t\x20exists','argv','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','defaults'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x069f,0x1e4));var _0xf069=function(_0x1aa289,_0x47d758){_0x1aa289=_0x1aa289-0x0;var _0xb7f13f=_0x069f[_0x1aa289];return _0xb7f13f;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xf069('0x0'));var util=require(_0xf069('0x1'));var BPromise=require(_0xf069('0x2'));var moment=require('moment');var squel=require(_0xf069('0x3'));var Redis=require(_0xf069('0x4'));var db=require(_0xf069('0x5'))['db'];var config=require(_0xf069('0x6'));var logger=require('../../../config/logger')('import');config['redis']=_[_0xf069('0x7')](config[_0xf069('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf069('0x9'))(new Redis(config[_0xf069('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xf069('0xa'));function isEmail(_0x236532){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))*$/[_0xf069('0xb')](_0x236532);}function selectNotIn(_0x5d307d,_0x19a59f,_0x2c93f4,_0x3fe85b,_0xcb57ce){return squel['select']()[_0xf069('0xc')](_0xf069('0xd'))[_0xf069('0xe')](_0x3fe85b)[_0xf069('0xf')](_0x19a59f,null,_0x19a59f+'.id\x20=\x20'+_0x3fe85b+'.'+_0x2c93f4)[_0xf069('0x10')](_0x3fe85b+'.'+_0x2c93f4+_0xf069('0x11')+_0x5d307d+'.'+_0x2c93f4)[_0xf069('0x10')](_0x19a59f+'.dialCheckDuplicateType\x20IN\x20('+_0xcb57ce['join']()+')');}function insertCmHopper(_0x3aaf92,_0x4e0355,_0x47d912,_0x4fdd0a,_0x10f01c){var _0x3b87a0=[_0xf069('0x12'),_0xf069('0x13'),_0xf069('0x14'),_0xf069('0x15'),_0x4e0355+'.'+_0x4fdd0a,_0xf069('0x16'),'cm_contacts.updatedAt','cm_contacts.priority',_0xf069('0x17'),'\x22'+_0x10f01c+'\x22'];return squel['insert']()[_0xf069('0x18')](_0xf069('0x19'))[_0xf069('0x1a')]([_0xf069('0xd'),'scheduledat',_0xf069('0x1b'),_0xf069('0x1c'),_0x4fdd0a,_0xf069('0x1d'),_0xf069('0x1e'),'priority',_0xf069('0x1f'),'recallme'],squel['select']()['fields'](_0x3b87a0)[_0xf069('0xe')](_0x4e0355)['join'](_0xf069('0x20'),null,_0xf069('0x21')+_0x4e0355+_0xf069('0x22'))[_0xf069('0xf')](_0x47d912,null,_0x47d912+_0xf069('0x23')+_0x4e0355+'.'+_0x4fdd0a)['where'](_0x4e0355+'.CmListId\x20=\x20?',_0x3aaf92)[_0xf069('0x10')](_0xf069('0x24'),NOW)[_0xf069('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4e0355,_0x47d912,_0x4fdd0a,_0xf069('0x19'),[_0xf069('0x25'),_0xf069('0x26')]))[_0xf069('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4e0355,_0x47d912,_0x4fdd0a,_0xf069('0x19'),[_0xf069('0x25')])))[_0xf069('0x27')]();}function insertCmHopperBlack(_0x10805f,_0xfead99,_0x195507,_0x3c7bc0){var _0x185b51=[_0xf069('0x12'),_0xf069('0x14'),'cm_contacts.ListId',_0xfead99+'.'+_0x3c7bc0,_0xf069('0x16'),_0xf069('0x28')];return squel[_0xf069('0x29')]()[_0xf069('0x18')]('cm_hopper_black')[_0xf069('0x1a')](['phone','ContactId','ListId',_0x3c7bc0,_0xf069('0x1d'),_0xf069('0x1e')],squel[_0xf069('0x2a')]()[_0xf069('0x2b')](_0x185b51)[_0xf069('0xe')](_0xfead99)['join'](_0xf069('0x20'),null,_0xf069('0x21')+_0xfead99+_0xf069('0x22'))[_0xf069('0xf')](_0x195507,null,_0x195507+_0xf069('0x23')+_0xfead99+'.'+_0x3c7bc0)[_0xf069('0x10')](_0xfead99+_0xf069('0x2c'),_0x10805f)['where'](_0xf069('0x24'),NOW)[_0xf069('0x10')](_0xf069('0x2d'),squel['select']()[_0xf069('0xc')](_0xf069('0xd'))[_0xf069('0xe')](_0xf069('0x2e'))[_0xf069('0x10')](_0xf069('0x2f'),_0x10805f)['where'](_0x3c7bc0+_0xf069('0x30'),_0xfead99+'.'+_0x3c7bc0)))[_0xf069('0x27')]();}function insertCmContact(_0x4aa26d,_0x1444db,_0x479bf7,_0x135732){var _0x9c38ff=_['concat'](_[_0xf069('0x31')](_0x135732),[_0xf069('0x1c'),'CompanyId',_0xf069('0x1d'),_0xf069('0x1e')]);return squel['insert']()[_0xf069('0x18')](_0xf069('0x20'))[_0xf069('0x1a')](_0x9c38ff,squel['select']()[_0xf069('0x2b')](_0x9c38ff)[_0xf069('0xe')](_0x1444db)[_0xf069('0x10')]('('+_0x479bf7[_0xf069('0xf')](',')+')\x20NOT\x20IN\x20?',squel[_0xf069('0x2a')]()[_0xf069('0x2b')](_0x479bf7)['from'](_0xf069('0x20'))[_0xf069('0x10')]('ListId\x20=\x20?',_0x4aa26d)[_0xf069('0x10')]('deletedAt\x20IS\x20NULL'))[_0xf069('0x10')](_0xf069('0x32'),squel[_0xf069('0x2a')]()[_0xf069('0xc')](_0xf069('0x33'),'min_id')[_0xf069('0xe')](_0x1444db)[_0xf069('0x34')](_0x479bf7[_0xf069('0xf')](','))))[_0xf069('0x27')]();}function handleStop(){logger[_0xf069('0x35')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x24a0c6){logger[_0xf069('0x36')](_0x24a0c6[_0xf069('0x37')]);process[_0xf069('0x38')](0x1);}function handleError(_0x392327,_0x23f861){stats['errors'][_0xf069('0x39')]({'name':_0x23f861[_0xf069('0x3a')],'message':_0x23f861[_0xf069('0x37')],'row':_0x392327});}function handleQuery(_0x4fba79){logger[_0xf069('0x35')](_0x4fba79);return db['sequelize'][_0xf069('0x3b')](_0x4fba79)[_0xf069('0x3c')](function(_0x489e98){results[_0xf069('0x39')](_0x489e98);})[_0xf069('0x3d')](function(_0x34f688){logger['error'](_0x34f688[_0xf069('0x37')]);});}function main(_0xb00806,_0x4a0f78,_0x384d9e,_0x1ae1f0){logger[_0xf069('0x35')](_0xf069('0x3e'),_0xb00806,JSON['stringify'](_0x4a0f78));process[_0xf069('0x3f')](_0xf069('0x40'));var _0xd1820f=_0x4a0f78[_0xf069('0x41')];var _0x5d0fe2=_0x4a0f78[_0xf069('0x42')];var _0x560767=path['join'](config['root'],_0xf069('0x43'),_0x5d0fe2+_0xf069('0x44'));var _0x363ab3=_[_0xf069('0x31')](_0xd1820f)['join']();logger[_0xf069('0x35')](_0xf069('0x45'),_0x363ab3);fs[_0xf069('0x46')](_0x560767,_0x363ab3+'\x0a');Papa[_0xf069('0x47')](fs[_0xf069('0x48')](_0xb00806),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a7812,_0xc706fd){try{for(var _0x268fad=0x0,_0xa7184=[];_0x268fad<_0x1a7812[_0xf069('0x49')][_0xf069('0x4a')];_0x268fad++){stats[_0xf069('0x4b')]+=0x1;if(_0x1a7812['errors'][_0x268fad]){handleError(_0x1a7812[_0xf069('0x49')][_0x268fad],_0x1a7812[_0xf069('0x4c')][_0x268fad]);}else{var _0x4295ae=[];for(var _0x47b34a in _0xd1820f){if(_0xd1820f['hasOwnProperty'](_0x47b34a)){if(_0x1a7812[_0xf069('0x49')][_0x268fad][_0xd1820f[_0x47b34a]]){var _0x5eb991=_['trim'](_0x1a7812['data'][_0x268fad][_0xd1820f[_0x47b34a]][_0xf069('0x4d')](/"/g,'\x27'));switch(_0x47b34a){case _0xf069('0x4e'):var _0x432259=moment(_0x5eb991,_0xf069('0xa'),!![]);if(_0x432259[_0xf069('0x4f')]()){_0xa7184[_0xf069('0x39')]('\x22'+_0x5eb991+'\x22');}else{_0x4295ae[_0xf069('0x39')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xf069('0x50'):var _0x211835=parseInt(_0x5eb991);_0x5eb991=_['isNaN'](_0x211835)||_0x211835<0x0||_0x211835>0x4?_0x1ae1f0?0x3:0x2:_0x211835;_0xa7184[_0xf069('0x39')]('\x22'+_0x5eb991+'\x22');break;case _0xf069('0x1f'):var _0x4ee574=parseInt(_0x5eb991);if(_[_0xf069('0x51')](_0x4ee574)&&_[_0xf069('0x52')](_0x384d9e,_0x4ee574)){_0xa7184[_0xf069('0x39')]('\x22'+_0x4ee574+'\x22');}else{_0x4295ae[_0xf069('0x39')](_0xf069('0x53'));}break;case'email':if(isEmail(_0x5eb991)){_0xa7184[_0xf069('0x39')]('\x22'+_0x5eb991+'\x22');}else{_0x4295ae[_0xf069('0x39')](_0xf069('0x54'));}break;case'dateOfBirth':var _0x3dde42=moment(_0x5eb991,_0xf069('0x55'),!![]);if(_0x3dde42[_0xf069('0x4f')]()){_0xa7184[_0xf069('0x39')]('\x22'+_0x5eb991+'\x22');}else{_0x4295ae[_0xf069('0x39')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xa7184[_0xf069('0x39')]('\x22'+_0x5eb991+'\x22');}}else{switch(_0x47b34a){case _0xf069('0x56'):case _0xf069('0xd'):_0x4295ae[_0xf069('0x39')](_0x47b34a+_0xf069('0x57'));break;default:_0xa7184['push']('\x22\x22');}}}}if(_0x4295ae[_0xf069('0x4a')]){handleError(_0x1a7812[_0xf069('0x49')][_0x268fad],{'code':_0xf069('0x58'),'message':_0x4295ae[_0xf069('0xf')]()});}else{fs[_0xf069('0x59')](_0x560767,_0xa7184['join']()+'\x0a');}_0xa7184=[];}if(!(stats[_0xf069('0x4b')]%0xc8)){socket['emit']('contact:import:'+_0x5d0fe2,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xf069('0x5a'));_0xc706fd['abort']();}}catch(_0x16b4df){handleError(_0x1a7812[_0xf069('0x49')][_0x268fad],{'code':'SystemError','message':_0x16b4df[_0xf069('0x37')]});logger['error'](_0xf069('0x5b'),_0x16b4df[_0xf069('0x37')]);}},'complete':function(){try{var _0x5b78de=[];var _0x401470=_0xf069('0x20');if(_0x4a0f78[_0xf069('0x5c')]&&_0x4a0f78[_0xf069('0x5c')]['length']){_0x401470=_0xf069('0x5d')+_0x5d0fe2;_0x5b78de[_0xf069('0x39')]('CREATE\x20TABLE\x20'+_0x401470+_0xf069('0x5e'));}var _0x1f7e7d=util[_0xf069('0x5f')](_0xf069('0x60'),_0x560767,_0x401470,_0x363ab3,_0x4a0f78[_0xf069('0x1c')],_0x4a0f78['CompanyId']||null,NOW,NOW);if(_['isNil'](_0xd1820f[_0xf069('0x4e')])){_0x1f7e7d+=_0xf069('0x61');}_0x5b78de[_0xf069('0x39')](_0x1f7e7d);if(_0x4a0f78[_0xf069('0x5c')]&&_0x4a0f78['duplicates']['length']){_0x5b78de[_0xf069('0x39')](insertCmContact(_0x4a0f78[_0xf069('0x1c')],_0x401470,_0x4a0f78[_0xf069('0x5c')],_0xd1820f));_0x5b78de[_0xf069('0x39')](_0xf069('0x62')+_0x401470+';');}_0x5b78de[_0xf069('0x39')](insertCmHopper(_0x4a0f78[_0xf069('0x1c')],_0xf069('0x63'),_0xf069('0x64'),_0xf069('0x65'),_0x1ae1f0));_0x5b78de[_0xf069('0x39')](insertCmHopperBlack(_0x4a0f78[_0xf069('0x1c')],_0xf069('0x66'),_0xf069('0x64'),_0xf069('0x65')));_0x5b78de['push'](insertCmHopper(_0x4a0f78[_0xf069('0x1c')],_0xf069('0x67'),_0xf069('0x68'),_0xf069('0x69'),_0x1ae1f0));_0x5b78de[_0xf069('0x39')](insertCmHopperBlack(_0x4a0f78[_0xf069('0x1c')],_0xf069('0x6a'),_0xf069('0x68'),_0xf069('0x69')));BPromise['each'](_0x5b78de,handleQuery)[_0xf069('0x6b')](function(_0x39d920){stats['finish']=!![];stats['affectedRows']=_0x4a0f78['duplicates']&&_0x4a0f78[_0xf069('0x5c')][_0xf069('0x4a')]?results[0x2][_0xf069('0x6c')]:results[0x0][_0xf069('0x6c')];socket[_0xf069('0x6d')]('contact:import:'+_0x5d0fe2,stats);fs[_0xf069('0x6e')](_0xb00806);fs[_0xf069('0x6e')](_0x560767);process[_0xf069('0x38')](0x0);})[_0xf069('0x3d')](function(_0x578e33){logger[_0xf069('0x36')](_0x578e33['message']);process[_0xf069('0x38')](0x1);});}catch(_0x3d2d75){logger[_0xf069('0x36')](_0xf069('0x6f'),_0x3d2d75[_0xf069('0x37')]);process[_0xf069('0x38')](0x1);}},'error':function(_0xfe463c,_0xa0a734,_0x80fa14,_0x13ff78){throw new Error(_0x13ff78);}});}function validate(){if(process['argv']&&process['argv'][_0xf069('0x4a')]<0x4){throw new Error(_0xf069('0x70'));}var _0x20ad77=path[_0xf069('0xf')](config[_0xf069('0x71')],_0xf069('0x43'),process['argv'][0x2]);if(!fs['existsSync'](_0x20ad77)){throw new Error(_0xf069('0x72'));}var _0x38beec={};try{_0x38beec=JSON[_0xf069('0x47')](process[_0xf069('0x73')][0x3]);if(!_0x38beec[_0xf069('0x41')]){throw new Error(_0xf069('0x74'));}if(!_0x38beec[_0xf069('0x41')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x38beec['binding'][_0xf069('0x56')]){throw new Error(_0xf069('0x75'));}var _0x29550d=0x0;if(_0x38beec[_0xf069('0x41')][_0xf069('0x1f')]){_0x29550d=0x1;}if(!_0x38beec[_0xf069('0x1c')]){throw new Error(_0xf069('0x76'));}}catch(_0x30e05e){throw new Error(_0xf069('0x77'));}var _0x1db35a=[];try{_0x1db35a=_[_0xf069('0x78')](JSON[_0xf069('0x47')](process['argv'][0x4]),'id');}catch(_0x41631b){logger['info'](_0xf069('0x79'));}main(_0x20ad77,_0x38beec,_0x1db35a,_0x29550d);}validate();process['on'](_0xf069('0x7a'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xb900=['id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','push','sequelize','spread','catch','main','stringify','start','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','rows','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns','each','then','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','papaparse','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','from','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','cm_contacts','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','fields'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb900,0xce));var _0x0b90=function(_0x475630,_0x541230){_0x475630=_0x475630-0x0;var _0x176187=_0xb900[_0x475630];return _0x176187;};'use strict';var fs=require('fs');var path=require(_0x0b90('0x0'));var _=require('lodash');var Papa=require(_0x0b90('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x0b90('0x2'));var Redis=require(_0x0b90('0x3'));var db=require(_0x0b90('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x0b90('0x5'))(_0x0b90('0x6'));config[_0x0b90('0x7')]=_[_0x0b90('0x8')](config[_0x0b90('0x7')],{'host':_0x0b90('0x9'),'port':0x18eb});var socket=require(_0x0b90('0xa'))(new Redis(config[_0x0b90('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x0b90('0xb')](_0x0b90('0xc'));function isEmail(_0x37605d){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))*$/[_0x0b90('0xd')](_0x37605d);}function selectNotIn(_0x2da634,_0x496b1f,_0x2300c6,_0x2987d4,_0x3e6a6c){return squel['select']()[_0x0b90('0xe')](_0x0b90('0xf'))['from'](_0x2987d4)[_0x0b90('0x10')](_0x496b1f,null,_0x496b1f+_0x0b90('0x11')+_0x2987d4+'.'+_0x2300c6)['where'](_0x2987d4+'.'+_0x2300c6+'\x20=\x20'+_0x2da634+'.'+_0x2300c6)['where'](_0x496b1f+_0x0b90('0x12')+_0x3e6a6c[_0x0b90('0x10')]()+')');}function insertCmHopper(_0x40f789,_0x2766e6,_0x4d63e4,_0x134144,_0x4a8cfc){var _0x1c3453=['cm_contacts.phone','cm_contacts.scheduledat',_0x0b90('0x13'),'cm_contacts.ListId',_0x2766e6+'.'+_0x134144,_0x0b90('0x14'),_0x0b90('0x15'),_0x0b90('0x16'),_0x0b90('0x17'),'\x22'+_0x4a8cfc+'\x22'];return squel[_0x0b90('0x18')]()[_0x0b90('0x19')](_0x0b90('0x1a'))[_0x0b90('0x1b')]([_0x0b90('0xf'),_0x0b90('0x1c'),_0x0b90('0x1d'),_0x0b90('0x1e'),_0x134144,_0x0b90('0x1f'),_0x0b90('0x20'),_0x0b90('0x21'),_0x0b90('0x22'),_0x0b90('0x23')],squel[_0x0b90('0x24')]()['fields'](_0x1c3453)[_0x0b90('0x25')](_0x2766e6)[_0x0b90('0x10')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2766e6+_0x0b90('0x26'))['join'](_0x4d63e4,null,_0x4d63e4+'.id\x20=\x20'+_0x2766e6+'.'+_0x134144)[_0x0b90('0x27')](_0x2766e6+_0x0b90('0x28'),_0x40f789)[_0x0b90('0x27')](_0x0b90('0x29'),NOW)[_0x0b90('0x27')](_0x0b90('0x2a'),selectNotIn(_0x2766e6,_0x4d63e4,_0x134144,_0x0b90('0x1a'),[_0x0b90('0x2b'),'\x22onlyIfOpen\x22']))[_0x0b90('0x27')](_0x0b90('0x2a'),selectNotIn(_0x2766e6,_0x4d63e4,_0x134144,_0x0b90('0x1a'),[_0x0b90('0x2b')])))[_0x0b90('0x2c')]();}function insertCmHopperBlack(_0x4fb0e6,_0x4f5db4,_0x670e18,_0x55c698){var _0x1a3db3=[_0x0b90('0x2d'),_0x0b90('0x13'),'cm_contacts.ListId',_0x4f5db4+'.'+_0x55c698,'cm_contacts.createdAt',_0x0b90('0x15')];return squel['insert']()[_0x0b90('0x19')](_0x0b90('0x2e'))[_0x0b90('0x1b')]([_0x0b90('0xf'),'ContactId',_0x0b90('0x1e'),_0x55c698,_0x0b90('0x1f'),_0x0b90('0x20')],squel[_0x0b90('0x24')]()['fields'](_0x1a3db3)[_0x0b90('0x25')](_0x4f5db4)[_0x0b90('0x10')](_0x0b90('0x2f'),null,_0x0b90('0x30')+_0x4f5db4+_0x0b90('0x26'))[_0x0b90('0x10')](_0x670e18,null,_0x670e18+_0x0b90('0x11')+_0x4f5db4+'.'+_0x55c698)[_0x0b90('0x27')](_0x4f5db4+_0x0b90('0x28'),_0x4fb0e6)[_0x0b90('0x27')](_0x0b90('0x29'),NOW)[_0x0b90('0x27')](_0x0b90('0x2a'),squel[_0x0b90('0x24')]()['field']('phone')[_0x0b90('0x25')](_0x0b90('0x2e'))[_0x0b90('0x27')](_0x0b90('0x31'),_0x4fb0e6)[_0x0b90('0x27')](_0x55c698+_0x0b90('0x32'),_0x4f5db4+'.'+_0x55c698)))[_0x0b90('0x2c')]();}function insertCmContact(_0x34ddd8,_0x3e1dd8,_0x22bc25,_0x3330a9){var _0x368f27=_[_0x0b90('0x33')](_[_0x0b90('0x34')](_0x3330a9),[_0x0b90('0x1e'),_0x0b90('0x35'),_0x0b90('0x1f'),_0x0b90('0x20')]);return squel['insert']()[_0x0b90('0x19')](_0x0b90('0x2f'))['fromQuery'](_0x368f27,squel['select']()['fields'](_0x368f27)[_0x0b90('0x25')](_0x3e1dd8)[_0x0b90('0x27')]('('+_0x22bc25[_0x0b90('0x10')](',')+_0x0b90('0x36'),squel[_0x0b90('0x24')]()[_0x0b90('0x37')](_0x22bc25)[_0x0b90('0x25')](_0x0b90('0x2f'))['where']('ListId\x20=\x20?',_0x34ddd8)[_0x0b90('0x27')]('deletedAt\x20IS\x20NULL'))[_0x0b90('0x27')](_0x0b90('0x38'),squel[_0x0b90('0x24')]()[_0x0b90('0xe')]('MIN(id)',_0x0b90('0x39'))[_0x0b90('0x25')](_0x3e1dd8)[_0x0b90('0x3a')](_0x22bc25[_0x0b90('0x10')](','))))[_0x0b90('0x2c')]();}function handleStop(){logger[_0x0b90('0x3b')](_0x0b90('0x3c'));stopped=!![];}function handleUncaughtException(_0x5d24e1){logger[_0x0b90('0x3d')](_0x5d24e1[_0x0b90('0x3e')]);process[_0x0b90('0x3f')](0x1);}function handleError(_0x549bd4,_0x12c8e6){stats['errors'][_0x0b90('0x40')]({'name':_0x12c8e6['code'],'message':_0x12c8e6[_0x0b90('0x3e')],'row':_0x549bd4});}function handleQuery(_0x47e6f2){logger[_0x0b90('0x3b')](_0x47e6f2);return db[_0x0b90('0x41')]['query'](_0x47e6f2)[_0x0b90('0x42')](function(_0x3019c3){results[_0x0b90('0x40')](_0x3019c3);})[_0x0b90('0x43')](function(_0x3d1999){logger[_0x0b90('0x3d')](_0x3d1999[_0x0b90('0x3e')]);});}function main(_0x569d6e,_0x3affdb,_0x304643,_0x3a104b){logger[_0x0b90('0x3b')](_0x0b90('0x44'),_0x569d6e,JSON[_0x0b90('0x45')](_0x3affdb));process['send'](_0x0b90('0x46'));var _0xe1985=_0x3affdb['binding'];var _0x1b3abd=_0x3affdb['socket_timestamp'];var _0x23f6c7=path[_0x0b90('0x10')](config[_0x0b90('0x47')],_0x0b90('0x48'),_0x1b3abd+_0x0b90('0x49'));var _0x255bc2=_[_0x0b90('0x34')](_0xe1985)[_0x0b90('0x10')]();logger[_0x0b90('0x3b')](_0x0b90('0x4a'),_0x255bc2);fs[_0x0b90('0x4b')](_0x23f6c7,_0x255bc2+'\x0a');Papa[_0x0b90('0x4c')](fs[_0x0b90('0x4d')](_0x569d6e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3344d5,_0x1a87d9){try{for(var _0x24f235=0x0,_0x452218=[];_0x24f235<_0x3344d5[_0x0b90('0x4e')][_0x0b90('0x4f')];_0x24f235++){stats['rows']+=0x1;if(_0x3344d5[_0x0b90('0x50')][_0x24f235]){handleError(_0x3344d5[_0x0b90('0x4e')][_0x24f235],_0x3344d5['errors'][_0x24f235]);}else{var _0x3db9c7=[];for(var _0x298716 in _0xe1985){if(_0xe1985[_0x0b90('0x51')](_0x298716)){if(_0x3344d5[_0x0b90('0x4e')][_0x24f235][_0xe1985[_0x298716]]){var _0x4c12f6=_[_0x0b90('0x52')](_0x3344d5[_0x0b90('0x4e')][_0x24f235][_0xe1985[_0x298716]][_0x0b90('0x53')](/"/g,'\x27'));switch(_0x298716){case _0x0b90('0x1c'):var _0xda510c=moment(_0x4c12f6,_0x0b90('0xc'),!![]);if(_0xda510c[_0x0b90('0x54')]()){_0x452218[_0x0b90('0x40')]('\x22'+_0x4c12f6+'\x22');}else{_0x3db9c7['push'](_0x0b90('0x55'));}break;case _0x0b90('0x21'):var _0x1b6016=parseInt(_0x4c12f6);_0x4c12f6=_['isNaN'](_0x1b6016)||_0x1b6016<0x0||_0x1b6016>0x4?_0x3a104b?0x3:0x2:_0x1b6016;_0x452218[_0x0b90('0x40')]('\x22'+_0x4c12f6+'\x22');break;case'UserId':var _0x309d2a=parseInt(_0x4c12f6);if(_[_0x0b90('0x56')](_0x309d2a)&&_[_0x0b90('0x57')](_0x304643,_0x309d2a)){_0x452218[_0x0b90('0x40')]('\x22'+_0x309d2a+'\x22');}else{_0x3db9c7[_0x0b90('0x40')](_0x0b90('0x58'));}break;case _0x0b90('0x59'):if(isEmail(_0x4c12f6)){_0x452218[_0x0b90('0x40')]('\x22'+_0x4c12f6+'\x22');}else{_0x3db9c7[_0x0b90('0x40')](_0x0b90('0x5a'));}break;case'dateOfBirth':var _0x2939ea=moment(_0x4c12f6,_0x0b90('0x5b'),!![]);if(_0x2939ea[_0x0b90('0x54')]()){_0x452218['push']('\x22'+_0x4c12f6+'\x22');}else{_0x3db9c7['push'](_0x0b90('0x5c'));}break;default:_0x452218[_0x0b90('0x40')]('\x22'+_0x4c12f6+'\x22');}}else{switch(_0x298716){case'firstName':case _0x0b90('0xf'):_0x3db9c7[_0x0b90('0x40')](_0x298716+_0x0b90('0x5d'));break;default:_0x452218[_0x0b90('0x40')]('\x22\x22');}}}}if(_0x3db9c7['length']){handleError(_0x3344d5[_0x0b90('0x4e')][_0x24f235],{'code':_0x0b90('0x5e'),'message':_0x3db9c7[_0x0b90('0x10')]()});}else{fs[_0x0b90('0x5f')](_0x23f6c7,_0x452218[_0x0b90('0x10')]()+'\x0a');}_0x452218=[];}if(!(stats[_0x0b90('0x60')]%0xc8)){socket['emit']('contact:import:'+_0x1b3abd,stats);stats[_0x0b90('0x50')]=[];}}if(stopped){logger[_0x0b90('0x3b')](_0x0b90('0x61'));_0x1a87d9[_0x0b90('0x62')]();}}catch(_0x3ac97b){handleError(_0x3344d5[_0x0b90('0x4e')][_0x24f235],{'code':_0x0b90('0x63'),'message':_0x3ac97b['message']});logger[_0x0b90('0x3d')](_0x0b90('0x64'),_0x3ac97b[_0x0b90('0x3e')]);}},'complete':function(){try{var _0x525fc0=[];var _0xff73a1='cm_contacts';if(_0x3affdb[_0x0b90('0x65')]&&_0x3affdb[_0x0b90('0x65')]['length']){_0xff73a1=_0x0b90('0x66')+_0x1b3abd;_0x525fc0[_0x0b90('0x40')](_0x0b90('0x67')+_0xff73a1+_0x0b90('0x68'));}var _0x5c9bc7=util[_0x0b90('0xb')](_0x0b90('0x69'),_0x23f6c7,_0xff73a1,_0x255bc2,_0x3affdb[_0x0b90('0x1e')],_0x3affdb[_0x0b90('0x35')]||null,NOW,NOW);if(_[_0x0b90('0x6a')](_0xe1985[_0x0b90('0x1c')])){_0x5c9bc7+=_0x0b90('0x6b');}_0x525fc0['push'](_0x5c9bc7);if(_0x3affdb['duplicates']&&_0x3affdb[_0x0b90('0x65')]['length']){_0x525fc0[_0x0b90('0x40')](insertCmContact(_0x3affdb[_0x0b90('0x1e')],_0xff73a1,_0x3affdb['duplicates'],_0xe1985));_0x525fc0[_0x0b90('0x40')]('DROP\x20TABLE\x20'+_0xff73a1+';');}_0x525fc0[_0x0b90('0x40')](insertCmHopper(_0x3affdb[_0x0b90('0x1e')],_0x0b90('0x6c'),_0x0b90('0x6d'),_0x0b90('0x6e'),_0x3a104b));_0x525fc0['push'](insertCmHopperBlack(_0x3affdb['ListId'],_0x0b90('0x6f'),_0x0b90('0x6d'),_0x0b90('0x6e')));_0x525fc0[_0x0b90('0x40')](insertCmHopper(_0x3affdb[_0x0b90('0x1e')],_0x0b90('0x70'),'campaigns',_0x0b90('0x71'),_0x3a104b));_0x525fc0[_0x0b90('0x40')](insertCmHopperBlack(_0x3affdb[_0x0b90('0x1e')],'campaigns_has_cm_blacklists',_0x0b90('0x72'),_0x0b90('0x71')));BPromise[_0x0b90('0x73')](_0x525fc0,handleQuery)[_0x0b90('0x74')](function(_0x3f4169){stats['finish']=!![];stats[_0x0b90('0x75')]=_0x3affdb[_0x0b90('0x65')]&&_0x3affdb[_0x0b90('0x65')][_0x0b90('0x4f')]?results[0x2][_0x0b90('0x75')]:results[0x0][_0x0b90('0x75')];socket[_0x0b90('0x76')](_0x0b90('0x77')+_0x1b3abd,stats);fs[_0x0b90('0x78')](_0x569d6e);fs['unlink'](_0x23f6c7);process[_0x0b90('0x3f')](0x0);})['catch'](function(_0x44754a){logger[_0x0b90('0x3d')](_0x44754a[_0x0b90('0x3e')]);process[_0x0b90('0x3f')](0x1);});}catch(_0x3a193b){logger[_0x0b90('0x3d')](_0x0b90('0x79'),_0x3a193b['message']);process[_0x0b90('0x3f')](0x1);}},'error':function(_0x2d1ae6,_0x59e60b,_0x2e96b0,_0x27653e){throw new Error(_0x27653e);}});}function validate(){if(process[_0x0b90('0x7a')]&&process[_0x0b90('0x7a')][_0x0b90('0x4f')]<0x4){throw new Error(_0x0b90('0x7b'));}var _0x40219a=path[_0x0b90('0x10')](config[_0x0b90('0x47')],_0x0b90('0x48'),process[_0x0b90('0x7a')][0x2]);if(!fs['existsSync'](_0x40219a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2bb2ab={};try{_0x2bb2ab=JSON[_0x0b90('0x4c')](process[_0x0b90('0x7a')][0x3]);if(!_0x2bb2ab[_0x0b90('0x7c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x2bb2ab[_0x0b90('0x7c')]['phone']){throw new Error(_0x0b90('0x7d'));}if(!_0x2bb2ab[_0x0b90('0x7c')]['firstName']){throw new Error(_0x0b90('0x7e'));}var _0x17b6b1=0x0;if(_0x2bb2ab[_0x0b90('0x7c')][_0x0b90('0x22')]){_0x17b6b1=0x1;}if(!_0x2bb2ab[_0x0b90('0x1e')]){throw new Error(_0x0b90('0x7f'));}}catch(_0x1a4d65){throw new Error(_0x0b90('0x80'));}var _0x9cc195=[];try{_0x9cc195=_[_0x0b90('0x81')](JSON['parse'](process[_0x0b90('0x7a')][0x4]),'id');}catch(_0x221f9){logger[_0x0b90('0x3b')](_0x0b90('0x82'));}main(_0x40219a,_0x2bb2ab,_0x9cc195,_0x17b6b1);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 295eecc..a5f2c2c 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf103=['agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','push','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','calleridnum','keyValue','destexten','Queue','queue','UniqueId','Date'];(function(_0x5767af,_0x552873){var _0x211aea=function(_0x5310af){while(--_0x5310af){_0x5767af['push'](_0x5767af['shift']());}};_0x211aea(++_0x552873);}(_0xf103,0xe3));var _0x3f10=function(_0x2d159a,_0x208f99){_0x2d159a=_0x2d159a-0x0;var _0x3b7ebe=_0xf103[_0x2d159a];return _0x3b7ebe;};'use strict';exports[_0x3f10('0x0')]=function(_0x19301f,_0x56695d){var _0x1705b7=[{'type':_0x3f10('0x1'),'content':_0x3f10('0x2'),'variableName':null}];switch(_0x19301f[_0x3f10('0x3')]()){case _0x3f10('0x4'):switch(_0x56695d['toLowerCase']()){case _0x3f10('0x5'):_0x1705b7['push']({'type':_0x3f10('0x6'),'content':'','variableName':'queue'});_0x1705b7[_0x3f10('0x7')]({'type':'variable','content':'','variableName':'calleridnum'});break;case _0x3f10('0x8'):_0x1705b7[_0x3f10('0x7')]({'type':_0x3f10('0x1'),'content':_0x3f10('0x9'),'variableName':null});_0x1705b7['push']({'type':_0x3f10('0x6'),'content':'','variableName':_0x3f10('0xa')});break;}}return _0x1705b7;};exports[_0x3f10('0xb')]=function(_0x2f6b46,_0x4f4014){var _0x1a72eb=[];switch(_0x2f6b46['toLowerCase']()){case _0x3f10('0x4'):switch(_0x4f4014['toLowerCase']()){case _0x3f10('0x5'):_0x1a72eb=[{'type':_0x3f10('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x3f10('0xc')},{'type':_0x3f10('0xd'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':'calleridname'},{'type':_0x3f10('0xd'),'content':'','key':'Call\x20To','keyType':_0x3f10('0x6'),'variableName':_0x3f10('0xe')},{'type':'keyValue','content':'','key':_0x3f10('0xf'),'keyType':_0x3f10('0x6'),'variableName':_0x3f10('0x10')},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x11'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x12'),'keyType':'variable','variableName':_0x3f10('0x13')},{'type':_0x3f10('0x1'),'content':_0x3f10('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x15'),'keyType':_0x3f10('0x6'),'variableName':_0x3f10('0x16')},{'type':_0x3f10('0xd'),'content':'','key':'Agent\x20Number','keyType':_0x3f10('0x6'),'variableName':_0x3f10('0xa')},{'type':'string','content':_0x3f10('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3f10('0x18'),'keyType':_0x3f10('0x6'),'variableName':_0x3f10('0x13')},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x19'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x1a'),'keyType':_0x3f10('0x6'),'variableName':_0x3f10('0x1b')},{'type':_0x3f10('0xd'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x3f10('0x1c')},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x1d'),'keyType':_0x3f10('0x6'),'variableName':_0x3f10('0x1e')}];break;case _0x3f10('0x8'):_0x1a72eb=[{'type':_0x3f10('0x1'),'content':_0x3f10('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0x3f10('0x6'),'keyContent':'','variableName':_0x3f10('0xa')},{'type':_0x3f10('0xd'),'content':'','key':'Member\x20Name','keyType':_0x3f10('0x6'),'keyContent':'','variableName':'membername'},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x11'),'keyType':_0x3f10('0x6'),'keyContent':'','variableName':_0x3f10('0x20')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0x3f10('0x21')},{'type':_0x3f10('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x3f10('0x22'),'keyType':_0x3f10('0x6'),'keyContent':'','variableName':_0x3f10('0x23')},{'type':'keyValue','content':'','key':_0x3f10('0x24'),'keyType':_0x3f10('0x6'),'keyContent':'','variableName':_0x3f10('0x25')},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x26'),'keyType':_0x3f10('0x6'),'keyContent':'','variableName':_0x3f10('0x27')},{'type':_0x3f10('0xd'),'content':'','key':_0x3f10('0x28'),'keyType':_0x3f10('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x1a72eb;}; \ No newline at end of file +var _0xab5c=['starttime','Answer\x20Time','Complete\x20Time','Duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','keyValue','calleridname','Call\x20To','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Called\x20Number','Member\x20Name','membername','UniqueId'];(function(_0x5917e8,_0x5e3e0d){var _0x28ee7b=function(_0x40d776){while(--_0x40d776){_0x5917e8['push'](_0x5917e8['shift']());}};_0x28ee7b(++_0x5e3e0d);}(_0xab5c,0x1aa));var _0xcab5=function(_0x333db8,_0x5343e0){_0x333db8=_0x333db8-0x0;var _0x1aaf14=_0xab5c[_0x333db8];return _0x1aaf14;};'use strict';exports['getSubjects']=function(_0x794275,_0x453102){var _0x43fdc1=[{'type':_0xcab5('0x0'),'content':_0xcab5('0x1'),'variableName':null}];switch(_0x794275['toLowerCase']()){case _0xcab5('0x2'):switch(_0x453102[_0xcab5('0x3')]()){case _0xcab5('0x4'):_0x43fdc1[_0xcab5('0x5')]({'type':_0xcab5('0x6'),'content':'','variableName':_0xcab5('0x7')});_0x43fdc1['push']({'type':'variable','content':'','variableName':'calleridnum'});break;case _0xcab5('0x8'):_0x43fdc1[_0xcab5('0x5')]({'type':_0xcab5('0x0'),'content':_0xcab5('0x9'),'variableName':null});_0x43fdc1[_0xcab5('0x5')]({'type':'variable','content':'','variableName':_0xcab5('0xa')});break;}}return _0x43fdc1;};exports['getDescriptions']=function(_0x37eb33,_0x21890b){var _0x3a8335=[];switch(_0x37eb33[_0xcab5('0x3')]()){case _0xcab5('0x2'):switch(_0x21890b[_0xcab5('0x3')]()){case _0xcab5('0x4'):_0x3a8335=[{'type':_0xcab5('0x0'),'content':_0xcab5('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xcab5('0xc'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0xd')},{'type':_0xcab5('0xe'),'content':'','key':'Caller\x20Name','keyType':_0xcab5('0x6'),'variableName':_0xcab5('0xf')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x10'),'keyType':_0xcab5('0x6'),'variableName':'destexten'},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x11'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x7')},{'type':_0xcab5('0xe'),'content':'','key':'UniqueId','keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x12')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x13'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x14')},{'type':_0xcab5('0x0'),'content':_0xcab5('0x15'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x16')},{'type':'keyValue','content':'','key':_0xcab5('0x17'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0xa')},{'type':_0xcab5('0x0'),'content':_0xcab5('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x19'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x14')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x1a'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x1b')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x1c'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x1d')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x1e'),'keyType':_0xcab5('0x6'),'variableName':_0xcab5('0x1f')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xcab5('0x6'),'variableName':'talktime'}];break;case _0xcab5('0x8'):_0x3a8335=[{'type':'string','content':_0xcab5('0xb'),'variableName':null},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x20'),'keyType':'variable','keyContent':'','variableName':_0xcab5('0xa')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x21'),'keyType':'variable','keyContent':'','variableName':_0xcab5('0x22')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x23'),'keyType':_0xcab5('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xcab5('0x13'),'keyType':_0xcab5('0x6'),'keyContent':'','variableName':_0xcab5('0x24')},{'type':_0xcab5('0x0'),'content':_0xcab5('0x18')},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x25'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xcab5('0x26'),'keyType':_0xcab5('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x27'),'keyType':_0xcab5('0x6'),'keyContent':'','variableName':'duration'},{'type':_0xcab5('0xe'),'content':'','key':_0xcab5('0x28'),'keyType':_0xcab5('0x6'),'keyContent':'','variableName':_0xcab5('0x29')}];break;}}return _0x3a8335;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index be8c6e6..daed8ec 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x613e=['toUpperCase','name','stringify','null','Interaction','then','update','info','error','tracked','user','query','body','omit','html','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x4f7284,_0x1bf4a9){var _0x3ef16f=function(_0x27d38f){while(--_0x27d38f){_0x4f7284['push'](_0x4f7284['shift']());}};_0x3ef16f(++_0x1bf4a9);}(_0x613e,0x1c1));var _0xe613=function(_0x951e9e,_0x531025){_0x951e9e=_0x951e9e-0x0;var _0x32b0d3=_0x613e[_0x951e9e];return _0x32b0d3;};'use strict';var _=require('lodash');var db=require(_0xe613('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xe613('0x1')),'mail':require(_0xe613('0x2'))(_0xe613('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0xe613('0x4')),'chat':require(_0xe613('0x2'))('chat-interactions'),'whatsapp':require(_0xe613('0x2'))('whatsapp-interactions')};function getInteractionId(_0x5dcf1e,_0x4c239b,_0x3b694a){if(_0x5dcf1e&&_0x5dcf1e[_[_0xe613('0x5')](_0x3b694a)+_0xe613('0x6')]){return _0x5dcf1e[_[_0xe613('0x5')](_0x3b694a)+_0xe613('0x6')];}else if(_0x5dcf1e&&_0x5dcf1e['id']){return _0x5dcf1e['id'];}else if(_0x4c239b&&_0x4c239b['id']){return _0x4c239b['id'];}else{return _0xe613('0x7');}}function log(_0xba2903,_0x263d27,_0x5987af,_0x23b936,_0x1af36d,_0xb6d702){loggers[_0x1af36d[_0xe613('0x8')]()][_0xba2903](_0xe613('0x9'),_0xb6d702[_0xe613('0xa')](),_0x263d27?_0x263d27['id']:null,_0x263d27?_0x263d27[_0xe613('0xb')]:null,_0x263d27?_0x263d27['role']:null,getInteractionId(_0x5987af,_0x23b936,_0x1af36d),_0x5987af?JSON[_0xe613('0xc')](_0x5987af):_0xe613('0xd'));}function updateUser(_0x39483b,_0x72cd4d,_0x4315d7,_0xdbec32,_0x3e347b){db[_[_0xe613('0x5')](_0xdbec32)+_0xe613('0xe')]['findOne']({'where':{'id':getInteractionId(_0x72cd4d,_0x4315d7,_0xdbec32)}})[_0xe613('0xf')](function(_0x1c2397){if(_0x1c2397){return _0x1c2397[_0xe613('0x10')]({'UserId':_0x39483b?_0x39483b['id']:null});}})['then'](function(_0x336d75){if(_0x336d75){log(_0xe613('0x11'),_0x39483b,_0x72cd4d,_0x4315d7,_0xdbec32,_0x3e347b);}})['catch'](function(){log(_0xe613('0x12'),_0x39483b,_0x72cd4d,_0x4315d7,_0xdbec32,_0x3e347b);});}exports[_0xe613('0x13')]=function(_0x47a3ac,_0xb3a600){return function(_0x16f9e7,_0x360f96,_0x3b9fc5){var _0x249606=_0x16f9e7[_0xe613('0x14')];var _0x1e2f38={};var _0x141a1d=_0x16f9e7[_0xe613('0x15')];if(_0x1e2f38){_0x1e2f38=_['clone'](_0x16f9e7[_0xe613('0x16')]);_0x1e2f38=_[_0xe613('0x17')](_0x1e2f38,['body',_0xe613('0x18'),'phone',_0xe613('0x19'),_0xe613('0x1a')]);}updateUser(_0x249606,_0x1e2f38,_0x141a1d,_0x47a3ac,_0xb3a600);_0x3b9fc5(null);};}; \ No newline at end of file +var _0xfc32=['user','query','clone','omit','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','tracked'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xfc32,0x149));var _0x2fc3=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xfc32[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x2fc3('0x0'));var db=require(_0x2fc3('0x1'))['db'];var loggers={'openchannel':require(_0x2fc3('0x2'))('openchannel-interactions'),'mail':require(_0x2fc3('0x2'))(_0x2fc3('0x3')),'fax':require(_0x2fc3('0x2'))(_0x2fc3('0x4')),'sms':require(_0x2fc3('0x2'))(_0x2fc3('0x5')),'chat':require(_0x2fc3('0x2'))(_0x2fc3('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x4537b1,_0x2ca20d,_0x2dab27){if(_0x4537b1&&_0x4537b1[_['upperFirst'](_0x2dab27)+_0x2fc3('0x7')]){return _0x4537b1[_[_0x2fc3('0x8')](_0x2dab27)+_0x2fc3('0x7')];}else if(_0x4537b1&&_0x4537b1['id']){return _0x4537b1['id'];}else if(_0x2ca20d&&_0x2ca20d['id']){return _0x2ca20d['id'];}else{return _0x2fc3('0x9');}}function log(_0x52af61,_0x3a6bcc,_0x4e3460,_0xf8b74a,_0x133118,_0x526885){loggers[_0x133118[_0x2fc3('0xa')]()][_0x52af61](_0x2fc3('0xb'),_0x526885[_0x2fc3('0xc')](),_0x3a6bcc?_0x3a6bcc['id']:null,_0x3a6bcc?_0x3a6bcc[_0x2fc3('0xd')]:null,_0x3a6bcc?_0x3a6bcc[_0x2fc3('0xe')]:null,getInteractionId(_0x4e3460,_0xf8b74a,_0x133118),_0x4e3460?JSON[_0x2fc3('0xf')](_0x4e3460):'null');}function updateUser(_0x10260c,_0xcdb6f,_0x5bbbb8,_0x109c8b,_0x4efa4d){db[_[_0x2fc3('0x8')](_0x109c8b)+_0x2fc3('0x10')][_0x2fc3('0x11')]({'where':{'id':getInteractionId(_0xcdb6f,_0x5bbbb8,_0x109c8b)}})[_0x2fc3('0x12')](function(_0x40b351){if(_0x40b351){return _0x40b351[_0x2fc3('0x13')]({'UserId':_0x10260c?_0x10260c['id']:null});}})[_0x2fc3('0x12')](function(_0x170e52){if(_0x170e52){log(_0x2fc3('0x14'),_0x10260c,_0xcdb6f,_0x5bbbb8,_0x109c8b,_0x4efa4d);}})[_0x2fc3('0x15')](function(){log('error',_0x10260c,_0xcdb6f,_0x5bbbb8,_0x109c8b,_0x4efa4d);});}exports[_0x2fc3('0x16')]=function(_0x341799,_0x541513){return function(_0x270d6a,_0x3f8476,_0x10edd8){var _0x3afb36=_0x270d6a[_0x2fc3('0x17')];var _0x4a8e0e={};var _0x430549=_0x270d6a[_0x2fc3('0x18')];if(_0x4a8e0e){_0x4a8e0e=_[_0x2fc3('0x19')](_0x270d6a['body']);_0x4a8e0e=_[_0x2fc3('0x1a')](_0x4a8e0e,[_0x2fc3('0x1b'),_0x2fc3('0x1c'),_0x2fc3('0x1d'),_0x2fc3('0x1e'),_0x2fc3('0x1f')]);}updateUser(_0x3afb36,_0x4a8e0e,_0x430549,_0x341799,_0x541513);_0x10edd8(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 393a9c8..7938c7b 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 _0x4dc4=['isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','aes-256-ctr','%s:%s:%s','base64','utf8','final','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x4dc4,0x12d));var _0x44dc=function(_0x26460b,_0x11dee5){_0x26460b=_0x26460b-0x0;var _0x373e31=_0x4dc4[_0x26460b];return _0x373e31;};'use strict';var crypto=require(_0x44dc('0x0'));var util=require(_0x44dc('0x1'));var compose=require(_0x44dc('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x44dc('0x3'));function getValueFromLicense(_0x48bf99,_0x437932){if(_0x48bf99&&_0x437932){if(_0x437932[_0x44dc('0x4')]&&_0x437932[_0x44dc('0x5')]){var _0xc6282=_0x437932[_0x44dc('0x4')];var _0x72d9a6=_0x437932[_0x44dc('0x5')];var _0x1ee250=_0xc6282[_0x44dc('0x6')]('-')[0x4];var _0x10325e=_0xc6282[_0x44dc('0x6')]('-')[0x0];var _0x40e0a7=crypto['createDecipher'](_0x44dc('0x7'),util['format'](_0x44dc('0x8'),_0x1ee250,_0xc6282,_0x10325e));var _0x3a5469=_0x40e0a7['update'](_0x72d9a6,_0x44dc('0x9'),_0x44dc('0xa'));_0x3a5469+=_0x40e0a7[_0x44dc('0xb')](_0x44dc('0xa'));var _0x1de36e=JSON['parse'](_0x3a5469);return _0x1de36e[_0x44dc('0xc')](_0x48bf99)?_0x1de36e[_0x48bf99]:null;}}return null;}function isLimit(_0x2948c6,_0x4f915f,_0x19477a,_0x3daf01){var _0x45344d=_0x4f915f;return compose()[_0x44dc('0xd')](function(_0x241bc6,_0x228985,_0x1a419f){return db['License'][_0x44dc('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x54a7f9){var _0x46a37c=getValueFromLicense(_0x2948c6,_0x54a7f9);return _0x46a37c?_0x46a37c:_0x45344d;})[_0x44dc('0xf')](function(_0x27edee){_0x45344d=_0x27edee;return _0x19477a[_0x44dc('0x10')](_0x3daf01);})[_0x44dc('0xf')](function(_0x4c29d1){if(_0x4c29d1>=_0x45344d){return _0x228985[_0x44dc('0x11')](0x193)[_0x44dc('0x12')]({'message':util['format'](_0x44dc('0x13'),_0x2948c6)});}_0x1a419f();})[_0x44dc('0x14')](function(_0xca1ab7){_0x1a419f(_0xca1ab7);});});}function isUserLimit(){return isLimit(_0x44dc('0x15'),0x1,db[_0x44dc('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x44dc('0x17')}]}});}exports[_0x44dc('0x18')]=isUserLimit; \ No newline at end of file +var _0x33ad=['status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use','findOne','count','then'];(function(_0x27a4c9,_0x5aa961){var _0x2b7db1=function(_0x4d23a1){while(--_0x4d23a1){_0x27a4c9['push'](_0x27a4c9['shift']());}};_0x2b7db1(++_0x5aa961);}(_0x33ad,0x74));var _0xd33a=function(_0x482389,_0x3b0a27){_0x482389=_0x482389-0x0;var _0x54a267=_0x33ad[_0x482389];return _0x54a267;};'use strict';var crypto=require('crypto');var util=require(_0xd33a('0x0'));var compose=require(_0xd33a('0x1'));var db=require(_0xd33a('0x2'))['db'];var config=require(_0xd33a('0x3'));function getValueFromLicense(_0x2b9f42,_0xfedee4){if(_0x2b9f42&&_0xfedee4){if(_0xfedee4[_0xd33a('0x4')]&&_0xfedee4['license']){var _0x54a345=_0xfedee4['data1'];var _0x521653=_0xfedee4[_0xd33a('0x5')];var _0x1dd81f=_0x54a345[_0xd33a('0x6')]('-')[0x4];var _0x2abe1d=_0x54a345[_0xd33a('0x6')]('-')[0x0];var _0x5ebcf0=crypto['createDecipher'](_0xd33a('0x7'),util[_0xd33a('0x8')](_0xd33a('0x9'),_0x1dd81f,_0x54a345,_0x2abe1d));var _0x51fb80=_0x5ebcf0[_0xd33a('0xa')](_0x521653,'base64','utf8');_0x51fb80+=_0x5ebcf0[_0xd33a('0xb')](_0xd33a('0xc'));var _0xb45d0c=JSON[_0xd33a('0xd')](_0x51fb80);return _0xb45d0c[_0xd33a('0xe')](_0x2b9f42)?_0xb45d0c[_0x2b9f42]:null;}}return null;}function isLimit(_0xf89b19,_0x4770d4,_0x171f1f,_0x46e77e){var _0x15e8fe=_0x4770d4;return compose()[_0xd33a('0xf')](function(_0x414ce0,_0x254dd6,_0x752224){return db['License'][_0xd33a('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x16db6b){var _0x74c31b=getValueFromLicense(_0xf89b19,_0x16db6b);return _0x74c31b?_0x74c31b:_0x15e8fe;})['then'](function(_0x289dc5){_0x15e8fe=_0x289dc5;return _0x171f1f[_0xd33a('0x11')](_0x46e77e);})[_0xd33a('0x12')](function(_0x5ce0ab){if(_0x5ce0ab>=_0x15e8fe){return _0x254dd6[_0xd33a('0x13')](0x193)[_0xd33a('0x14')]({'message':util[_0xd33a('0x8')](_0xd33a('0x15'),_0xf89b19)});}_0x752224();})[_0xd33a('0x16')](function(_0x56e93a){_0x752224(_0x56e93a);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xd33a('0x17')],{'where':{'$or':[{'role':_0xd33a('0x18')},{'role':_0xd33a('0x19')}]}});}exports[_0xd33a('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 3e99a7c..60ef4cd 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 _0x809d=['<\x20?','>\x20?','<=\x20?','$gte','$between','start','$substring','shift','pop','DATE','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','[$or]','split','slice','forEach','indexOf','map','conditions','push','buildExpression','$eq','operator','includes','$gt','$lte','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$endsWith','LIKE\x20?','$lt'];(function(_0x5a82a5,_0x5a1dee){var _0x427d33=function(_0x7210aa){while(--_0x7210aa){_0x5a82a5['push'](_0x5a82a5['shift']());}};_0x427d33(++_0x5a1dee);}(_0x809d,0xae));var _0xd809=function(_0x5db4be,_0x2d03f7){_0x5db4be=_0x5db4be-0x0;var _0x533397=_0x809d[_0x5db4be];return _0x533397;};'use strict';var _=require(_0xd809('0x0'));var moment=require(_0xd809('0x1'));exports[_0xd809('0x2')]=function(_0x3caa52){var _0x59e74a={'conditions':[]};_0x59e74a[_0xd809('0x3')]=_[_0xd809('0x4')](_0x3caa52,'[$or]')?'or':'and';var _0x41224c=_0x3caa52[_0xd809('0x5')](_0xd809('0x6'),'')['replace'](_0xd809('0x7'),'')['split']('||');for(var _0xe481ee=0x0;_0xe481ee<_0x41224c['length'];_0xe481ee++){var _0x19922f=_0x41224c[_0xe481ee][_0xd809('0x8')](':=');var _0x110343=_0x19922f[0x0];var _0x2595be=_0x19922f[_0xd809('0x9')](0x1);_0x2595be[_0xd809('0xa')](function(_0xbbe44b){var _0x3aed67=_0xbbe44b['split']('[')['shift']();var _0x5b1305=_0xbbe44b['match'](/\[(.*?)\]/g);_0x5b1305[_0xd809('0xa')](function(_0x555bf3){var _0x3ec45f=_0x555bf3['split']('[')['filter'](function(_0x48898c){return _0x48898c[_0xd809('0xb')](']')>-0x1;})[_0xd809('0xc')](function(_0x43c66f){return _0x43c66f['split'](']')[0x0];})[0x0];_0x59e74a[_0xd809('0xd')][_0xd809('0xe')]({'field':_0x110343,'operator':_0x3aed67,'value':_0x3ec45f});});});}return _0x59e74a;};exports[_0xd809('0xf')]=function(_0x168703,_0x5117ff,_0x5cfd59){var _0x23f488={};if(_0x5117ff==='DATE'){if(_0x5cfd59['operator']===_0xd809('0x10')){_0x5cfd59[_0xd809('0x11')]='$between';_0x5cfd59['value']+=','+_0x5cfd59['value'];}else if(_[_0xd809('0x12')]([_0xd809('0x13'),_0xd809('0x14')],_0x5cfd59[_0xd809('0x11')])){_0x5cfd59[_0xd809('0x15')]=moment(_0x5cfd59[_0xd809('0x15')])[_0xd809('0x16')](0x1,_0xd809('0x17'))[_0xd809('0x18')](_0xd809('0x19'));}}if(_0x5cfd59[_0xd809('0x1a')]){_0x5117ff=_0x5cfd59[_0xd809('0x1a')];_0x23f488[_0xd809('0x1b')]=_0xd809('0x1c')+_0x168703+'.'+_0x5cfd59[_0xd809('0x1d')]+_0xd809('0x1e')+_0x5cfd59[_0xd809('0x1a')]+')\x20'+parseOperator(_0x5cfd59[_0xd809('0x11')]);}else{_0x23f488['text']=_0x168703+'.'+_0x5cfd59[_0xd809('0x1d')]+'\x20'+parseOperator(_0x5cfd59[_0xd809('0x11')]);}if(_[_0xd809('0x12')]([_0xd809('0x1f'),_0xd809('0x20')],_0x5cfd59[_0xd809('0x11')]))_0x23f488[_0xd809('0x1b')]='('+_0x23f488[_0xd809('0x1b')]+_0xd809('0x21')+_0x168703+'.'+_0x5cfd59['field']+'\x20IS\x20NULL)';_0x23f488[_0xd809('0x15')]=parseValue(_0x5117ff,_0x5cfd59[_0xd809('0x11')],_0x5cfd59[_0xd809('0x15')]);return _0x23f488;};function parseOperator(_0x80298e){var _0x15b062;switch(_0x80298e){case _0xd809('0x22'):_0x15b062=_0xd809('0x23');break;case'$notIn':_0x15b062=_0xd809('0x24');break;case _0xd809('0x10'):_0x15b062=_0xd809('0x25');break;case _0xd809('0x1f'):_0x15b062=_0xd809('0x26');break;case'$substring':case'$startsWith':case _0xd809('0x27'):_0x15b062=_0xd809('0x28');break;case _0xd809('0x29'):_0x15b062=_0xd809('0x2a');break;case _0xd809('0x13'):_0x15b062=_0xd809('0x2b');break;case _0xd809('0x14'):_0x15b062=_0xd809('0x2c');break;case _0xd809('0x2d'):_0x15b062='>=\x20?';break;case _0xd809('0x2e'):_0x15b062='BETWEEN\x20?\x20AND\x20?';break;}return _0x15b062;}function parseValue(_0x48eabc,_0x33b1f4,_0x4d6d92){var _0x184bb0={'start':undefined,'end':undefined};switch(_0x33b1f4){case'$in':case _0xd809('0x20'):_0x184bb0[_0xd809('0x2f')]=_0x4d6d92[_0xd809('0x8')](',');break;case _0xd809('0x30'):_0x184bb0[_0xd809('0x2f')]='%'+_0x4d6d92+'%';break;case'$startsWith':_0x184bb0[_0xd809('0x2f')]=_0x4d6d92+'%';break;case _0xd809('0x27'):_0x184bb0['start']='%'+_0x4d6d92;break;case'$between':var _0x4111b3=_0x4d6d92[_0xd809('0x8')](',');var _0x4d6d92=_0x4111b3[_0xd809('0x31')]();var _0x239eb1=_0x4111b3[_0xd809('0x32')]();if(_0x48eabc===_0xd809('0x33')){_0x4d6d92=moment(_0x4d6d92)['utcOffset'](0x0,!![])[_0xd809('0x18')]();_0x239eb1=moment(_0x239eb1)['utcOffset'](0x0,!![])[_0xd809('0x16')](0x17,'hours')[_0xd809('0x16')](0x3b,_0xd809('0x34'))[_0xd809('0x16')](0x3b,_0xd809('0x35'))['format']();}_0x184bb0={'start':_0x4d6d92,'end':_0x239eb1};break;default:_0x184bb0[_0xd809('0x2f')]=_0x4d6d92;break;}return _0x184bb0;} \ No newline at end of file +var _0xa3f2=['<\x20?','$gte','>=\x20?','start','utcOffset','add','hours','minutes','seconds','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','days','format','castTo','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt'];(function(_0x1f37e1,_0x1b42ea){var _0x329f45=function(_0x1fa98c){while(--_0x1fa98c){_0x1f37e1['push'](_0x1f37e1['shift']());}};_0x329f45(++_0x1b42ea);}(_0xa3f2,0x199));var _0x2a3f=function(_0x51c71b,_0x2ab01c){_0x51c71b=_0x51c71b-0x0;var _0x33ec5d=_0xa3f2[_0x51c71b];return _0x33ec5d;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x2a3f('0x0')]=function(_0x5289e6){var _0x2666e5={'conditions':[]};_0x2666e5['sqlOperator']=_[_0x2a3f('0x1')](_0x5289e6,_0x2a3f('0x2'))?'or':_0x2a3f('0x3');var _0x5418a4=_0x5289e6[_0x2a3f('0x4')](_0x2a3f('0x5'),'')[_0x2a3f('0x4')](_0x2a3f('0x2'),'')[_0x2a3f('0x6')]('||');for(var _0x3365c0=0x0;_0x3365c0<_0x5418a4[_0x2a3f('0x7')];_0x3365c0++){var _0xd71f6f=_0x5418a4[_0x3365c0][_0x2a3f('0x6')](':=');var _0x3e59d2=_0xd71f6f[0x0];var _0x1cb1c3=_0xd71f6f[_0x2a3f('0x8')](0x1);_0x1cb1c3[_0x2a3f('0x9')](function(_0x3220b6){var _0x4534f0=_0x3220b6[_0x2a3f('0x6')]('[')[_0x2a3f('0xa')]();var _0x3f6923=_0x3220b6[_0x2a3f('0xb')](/\[(.*?)\]/g);_0x3f6923['forEach'](function(_0x19a63f){var _0x3c6d13=_0x19a63f['split']('[')['filter'](function(_0x1dc131){return _0x1dc131[_0x2a3f('0xc')](']')>-0x1;})['map'](function(_0x2d428a){return _0x2d428a[_0x2a3f('0x6')](']')[0x0];})[0x0];_0x2666e5[_0x2a3f('0xd')][_0x2a3f('0xe')]({'field':_0x3e59d2,'operator':_0x4534f0,'value':_0x3c6d13});});});}return _0x2666e5;};exports[_0x2a3f('0xf')]=function(_0x1b098d,_0x29c99d,_0x4c495f){var _0x2c1122={};if(_0x29c99d===_0x2a3f('0x10')){if(_0x4c495f[_0x2a3f('0x11')]===_0x2a3f('0x12')){_0x4c495f[_0x2a3f('0x11')]=_0x2a3f('0x13');_0x4c495f[_0x2a3f('0x14')]+=','+_0x4c495f[_0x2a3f('0x14')];}else if(_['includes']([_0x2a3f('0x15'),_0x2a3f('0x16')],_0x4c495f[_0x2a3f('0x11')])){_0x4c495f[_0x2a3f('0x14')]=moment(_0x4c495f['value'])['add'](0x1,_0x2a3f('0x17'))[_0x2a3f('0x18')]('YYYY-MM-DD');}}if(_0x4c495f[_0x2a3f('0x19')]){_0x29c99d=_0x4c495f[_0x2a3f('0x19')];_0x2c1122['text']=_0x2a3f('0x1a')+_0x1b098d+'.'+_0x4c495f[_0x2a3f('0x1b')]+_0x2a3f('0x1c')+_0x4c495f[_0x2a3f('0x19')]+')\x20'+parseOperator(_0x4c495f[_0x2a3f('0x11')]);}else{_0x2c1122['text']=_0x1b098d+'.'+_0x4c495f[_0x2a3f('0x1b')]+'\x20'+parseOperator(_0x4c495f[_0x2a3f('0x11')]);}if(_['includes']([_0x2a3f('0x1d'),'$notIn'],_0x4c495f[_0x2a3f('0x11')]))_0x2c1122['text']='('+_0x2c1122['text']+_0x2a3f('0x1e')+_0x1b098d+'.'+_0x4c495f['field']+_0x2a3f('0x1f');_0x2c1122[_0x2a3f('0x14')]=parseValue(_0x29c99d,_0x4c495f[_0x2a3f('0x11')],_0x4c495f[_0x2a3f('0x14')]);return _0x2c1122;};function parseOperator(_0x5dd214){var _0x26895c;switch(_0x5dd214){case _0x2a3f('0x20'):_0x26895c='IN\x20?';break;case _0x2a3f('0x21'):_0x26895c=_0x2a3f('0x22');break;case _0x2a3f('0x12'):_0x26895c=_0x2a3f('0x23');break;case _0x2a3f('0x1d'):_0x26895c='<>\x20?';break;case _0x2a3f('0x24'):case _0x2a3f('0x25'):case _0x2a3f('0x26'):_0x26895c=_0x2a3f('0x27');break;case _0x2a3f('0x28'):_0x26895c=_0x2a3f('0x29');break;case _0x2a3f('0x15'):_0x26895c='>\x20?';break;case _0x2a3f('0x16'):_0x26895c='<=\x20?';break;case _0x2a3f('0x2a'):_0x26895c=_0x2a3f('0x2b');break;case _0x2a3f('0x13'):_0x26895c='BETWEEN\x20?\x20AND\x20?';break;}return _0x26895c;}function parseValue(_0x3f87e6,_0x16194d,_0x218ff8){var _0x17b648={'start':undefined,'end':undefined};switch(_0x16194d){case _0x2a3f('0x20'):case _0x2a3f('0x21'):_0x17b648['start']=_0x218ff8[_0x2a3f('0x6')](',');break;case _0x2a3f('0x24'):_0x17b648[_0x2a3f('0x2c')]='%'+_0x218ff8+'%';break;case'$startsWith':_0x17b648['start']=_0x218ff8+'%';break;case _0x2a3f('0x26'):_0x17b648['start']='%'+_0x218ff8;break;case _0x2a3f('0x13'):var _0x484ef8=_0x218ff8[_0x2a3f('0x6')](',');var _0x218ff8=_0x484ef8['shift']();var _0x4b40f1=_0x484ef8['pop']();if(_0x3f87e6==='DATE'){_0x218ff8=moment(_0x218ff8)[_0x2a3f('0x2d')](0x0,!![])[_0x2a3f('0x18')]();_0x4b40f1=moment(_0x4b40f1)[_0x2a3f('0x2d')](0x0,!![])[_0x2a3f('0x2e')](0x17,_0x2a3f('0x2f'))[_0x2a3f('0x2e')](0x3b,_0x2a3f('0x30'))[_0x2a3f('0x2e')](0x3b,_0x2a3f('0x31'))[_0x2a3f('0x18')]();}_0x17b648={'start':_0x218ff8,'end':_0x4b40f1};break;default:_0x17b648[_0x2a3f('0x2c')]=_0x218ff8;break;}return _0x17b648;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 287efda..1dd9ab8 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 _0x9434=['substr','DESC','col','unsigned','ASC','length','isString','unset','hasOwnProperty','omit','isNumeric','match','isEmail','getFullTextValue','forEach','push','join','$id','query','model','filters','intersection','attributes','nolimit','limit','order','where','filter','object','columns','value','VIRTUAL','merge','options','lodash','sequelize','moment','keys','includes','parse','fields','split','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast'];(function(_0x594a77,_0x324d0c){var _0x4c574c=function(_0x3ea487){while(--_0x3ea487){_0x594a77['push'](_0x594a77['shift']());}};_0x4c574c(++_0x324d0c);}(_0x9434,0x153));var _0x4943=function(_0x43eb4d,_0x2440d4){_0x43eb4d=_0x43eb4d-0x0;var _0x4e5295=_0x9434[_0x43eb4d];return _0x4e5295;};'use strict';var _=require(_0x4943('0x0'));var sequelize=require(_0x4943('0x1'));var moment=require(_0x4943('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3b5aae){var _0x4c27f8=['ne'];try{var _0x892f24=JSON['parse'](_0x3b5aae);var _0x4900a3=Object[_0x4943('0x3')](_0x892f24)[0x0];return _0x4c27f8[_0x4943('0x4')](_0x4900a3);}catch(_0x4abf6f){return![];}}function getOperatorValue(_0x346844){var _0x4fda96=JSON[_0x4943('0x5')](_0x346844);var _0x1c5d01=Object[_0x4943('0x3')](_0x4fda96)[0x0];var _0x3303bb=_0x4fda96[_0x1c5d01];return{['$'+_0x1c5d01]:_0x3303bb};}exports[_0x4943('0x6')]=function(_0x358b0d){var _0x35c91c=null;if(_0x358b0d){_0x35c91c=_0x358b0d[_0x4943('0x7')](',');}return _0x35c91c;};exports['filters']=function(_0x5ba5fd,_0x1d821b){var _0x25cd60={};if(!_[_0x4943('0x8')](_0x5ba5fd)){_[_0x4943('0x9')](_0x5ba5fd,function(_0x315aa2,_0x3efaf4){try{if(_0x1d821b){var _0x3bf3e0=_[_0x4943('0xa')](_0x1d821b,{'name':_0x3efaf4})||{};if(hasSequelizeOperator(_0x315aa2)){_0x25cd60[_0x3efaf4]=getOperatorValue(_0x315aa2);}else if(_0x3bf3e0[_0x4943('0xb')]===_0x4943('0xc')&&_['isPlainObject'](_0x315aa2)){var _0x14b8e3=JSON[_0x4943('0x5')](_0x315aa2);var _0x4ae7ad={'$gte':moment(moment(_0x14b8e3[_0x4943('0xd')])[_0x4943('0xe')](_0x4943('0xf')))[_0x4943('0x10')]()[_0x4943('0xe')](),'$lte':moment(moment(_0x14b8e3[_0x4943('0x11')])[_0x4943('0xe')](_0x4943('0xf')))[_0x4943('0x10')]()[_0x4943('0x12')](0x1,'s')[_0x4943('0xe')]()};_0x25cd60[_0x3efaf4]=_0x4ae7ad;}else if(_0x3bf3e0[_0x4943('0x13')]===_0x4943('0x14')){_0x25cd60[_0x3efaf4]=_0x315aa2;}else{_0x25cd60[_0x3efaf4]=_[_0x4943('0x15')](_0x315aa2)?_0x315aa2:JSON[_0x4943('0x5')](_0x315aa2);}}else{_0x25cd60[_0x3efaf4]=_[_0x4943('0x15')](_0x315aa2)?_0x315aa2:JSON[_0x4943('0x5')](_0x315aa2);}}catch(_0x99a9c3){_0x25cd60[_0x3efaf4]=_0x315aa2[_0x4943('0x7')](',');}});}return _0x25cd60;};exports['limit']=function(_0x1cb7a4){_0x1cb7a4=parseInt(_0x1cb7a4,0xa);if(!_0x1cb7a4||_0x1cb7a4<0x0){_0x1cb7a4=LIMIT_VALUE;}return _0x1cb7a4;};exports[_0x4943('0x16')]=function(_0x385e7b){_0x385e7b=parseInt(_0x385e7b,0xa);if(!_0x385e7b||_0x385e7b<0x0){_0x385e7b=0x0;}return _0x385e7b;};exports[_0x4943('0x17')]=function(_0x59c73c){var _0x1d949a,_0x505737=null;if(_0x59c73c){_0x1d949a=_0x59c73c['split'](',');_0x505737=_[_0x4943('0x18')](_0x1d949a,function(_0x53f126){if(_0x53f126['indexOf']('-')===0x0){return[_0x53f126===_0x4943('0x19')?sequelize[_0x4943('0x1a')](sequelize['col'](_0x4943('0x19')),'unsigned'):_0x53f126[_0x4943('0x1b')](0x1),_0x4943('0x1c')];}else{return[_0x53f126===_0x4943('0x19')?sequelize[_0x4943('0x1a')](sequelize[_0x4943('0x1d')](_0x4943('0x19')),_0x4943('0x1e')):_0x53f126,_0x4943('0x1f')];}});}return _0x505737;};exports['omit']=function(_0x27f405,_0x2a0cc1){if(_[_0x4943('0x8')](_0x27f405)){return _0x27f405;}if(_['isArray'](_0x27f405)){for(var _0x430384=0x0;_0x430384<_0x27f405[_0x4943('0x20')];_0x430384+=0x1){_0x27f405[_0x430384]=this['omit'](_0x27f405[_0x430384],_0x2a0cc1);}return _0x27f405;}if(!_['isObject'](_0x27f405)){return _0x27f405;}if(_[_0x4943('0x21')](_0x2a0cc1)){_0x2a0cc1=[_0x2a0cc1];}if(!_[_0x4943('0x15')](_0x2a0cc1)){return _0x27f405;}for(var _0x29d445=0x0;_0x29d445<_0x2a0cc1[_0x4943('0x20')];_0x29d445+=0x1){_[_0x4943('0x22')](_0x27f405,_0x2a0cc1[_0x29d445]);}for(var _0x1b150a in _0x27f405){if(_0x27f405[_0x4943('0x23')](_0x1b150a)){_0x27f405[_0x1b150a]=this[_0x4943('0x24')](_0x27f405[_0x1b150a],_0x2a0cc1);}}return _0x27f405;};exports[_0x4943('0x25')]=function(_0x2f86e7){return _0x2f86e7[_0x4943('0x26')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x4943('0x27')]=function(_0x11aee6){return _0x11aee6[_0x4943('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x4943('0x28')]=function(_0x1085e3){var _0x23959c=[];_0x1085e3[_0x4943('0x7')](/[ ,]+/)[_0x4943('0x29')](function(_0x19ad0c){_0x19ad0c=_0x19ad0c['replace'](/([^:]")"+/g,'$1');_0x19ad0c='+'+_0x19ad0c+'*';var _0x29ed60=/[ `!@#$%^&*()_\-?~]/;if(_0x19ad0c[_0x4943('0x26')](_0x29ed60))_0x19ad0c='\x22'+_0x19ad0c+'\x22';_0x23959c[_0x4943('0x2a')](_0x19ad0c);});return _0x23959c[_0x4943('0x2b')]('\x20');};exports['getOptions']=function(_0x2c728c,_0x436d4e,_0x2207e1){var _0x1d53e4={},_0x24c50a={};if(_0x436d4e['query'][_0x4943('0x2c')]){_0x436d4e[_0x4943('0x2d')]['id']=_0x436d4e['query'][_0x4943('0x2c')];delete _0x436d4e[_0x4943('0x2d')][_0x4943('0x2c')];}_0x1d53e4[_0x4943('0x2e')]=_['map'](_0x2c728c,_0x4943('0x13'));_0x1d53e4[_0x4943('0x2d')]=_[_0x4943('0x3')](_0x436d4e[_0x4943('0x2d')]);_0x1d53e4[_0x4943('0x2f')]=_['intersection'](_0x1d53e4['model'],_0x1d53e4[_0x4943('0x2d')]);_0x24c50a['attributes']=_[_0x4943('0x30')](_0x1d53e4[_0x4943('0x2e')],this[_0x4943('0x6')](_0x436d4e[_0x4943('0x2d')]['fields']));_0x24c50a[_0x4943('0x31')]=_0x24c50a['attributes'][_0x4943('0x20')]?_0x24c50a['attributes']:_0x1d53e4[_0x4943('0x2e')];if(!_0x436d4e[_0x4943('0x2d')]['hasOwnProperty'](_0x4943('0x32'))){_0x24c50a['limit']=this[_0x4943('0x33')](_0x436d4e[_0x4943('0x2d')]['limit']);_0x24c50a['offset']=this['offset'](_0x436d4e[_0x4943('0x2d')][_0x4943('0x16')]);}_0x24c50a[_0x4943('0x34')]=this['sort'](_0x436d4e[_0x4943('0x2d')][_0x4943('0x17')]);_0x24c50a[_0x4943('0x35')]=this[_0x4943('0x2f')](_['pick'](_0x436d4e[_0x4943('0x2d')],_0x1d53e4[_0x4943('0x2f')]),_0x2c728c);if(_0x436d4e['query'][_0x4943('0x36')]){var _0x35aebc=_0x2c728c;var _0x50cf1e=_0x436d4e[_0x4943('0x2d')][_0x4943('0x36')];if(typeof _0x50cf1e===_0x4943('0x37')){_0x35aebc=_[_0x4943('0x36')](_0x2c728c,function(_0x47f38b){return _['includes'](_0x50cf1e[_0x4943('0x38')],_0x47f38b[_0x4943('0x13')]);});_0x50cf1e=_0x50cf1e[_0x4943('0x39')];}_0x24c50a['where']=_['merge'](_0x24c50a['where'],{'$or':_[_0x4943('0x18')](_0x35aebc,function(_0xec0bc1){if(_0xec0bc1[_0x4943('0xb')]!==_0x4943('0x3a')){if(_0x2207e1){return sequelize[_0x4943('0x35')](sequelize['fn']('lower',sequelize['col'](_0xec0bc1[_0x4943('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x436d4e[_0x4943('0x2d')]['filter']+'%')});}else{var _0x2c715f={};_0x2c715f[_0xec0bc1['name']]={'$like':'%'+_0x436d4e[_0x4943('0x2d')]['filter']+'%'};return _0x2c715f;}}})});}_0x24c50a=_[_0x4943('0x3b')]({},_0x24c50a,_0x436d4e[_0x4943('0x3c')]);return _0x24c50a;}; \ No newline at end of file +var _0xf007=['pick','filter','object','columns','merge','VIRTUAL','lower','lodash','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','ASC','omit','length','isObject','isString','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','map','intersection','attributes','nolimit','where'];(function(_0x208b8c,_0x36c276){var _0x12e359=function(_0x47838a){while(--_0x47838a){_0x208b8c['push'](_0x208b8c['shift']());}};_0x12e359(++_0x36c276);}(_0xf007,0x1b2));var _0x7f00=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xf007[_0x1857c6];return _0x51011c;};'use strict';var _=require(_0x7f00('0x0'));var sequelize=require(_0x7f00('0x1'));var moment=require(_0x7f00('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x127af9){var _0x26e5cf=['ne'];try{var _0x26800d=JSON['parse'](_0x127af9);var _0x557249=Object[_0x7f00('0x3')](_0x26800d)[0x0];return _0x26e5cf[_0x7f00('0x4')](_0x557249);}catch(_0x2db1bf){return![];}}function getOperatorValue(_0x18385f){var _0x5155ac=JSON[_0x7f00('0x5')](_0x18385f);var _0x82cbf3=Object[_0x7f00('0x3')](_0x5155ac)[0x0];var _0x252d0a=_0x5155ac[_0x82cbf3];return{['$'+_0x82cbf3]:_0x252d0a};}exports[_0x7f00('0x6')]=function(_0x284853){var _0x3570ff=null;if(_0x284853){_0x3570ff=_0x284853[_0x7f00('0x7')](',');}return _0x3570ff;};exports[_0x7f00('0x8')]=function(_0x21042a,_0xc3d3ea){var _0x542f48={};if(!_[_0x7f00('0x9')](_0x21042a)){_['forOwn'](_0x21042a,function(_0x4f4224,_0x2eb77a){try{if(_0xc3d3ea){var _0x5d67c8=_['find'](_0xc3d3ea,{'name':_0x2eb77a})||{};if(hasSequelizeOperator(_0x4f4224)){_0x542f48[_0x2eb77a]=getOperatorValue(_0x4f4224);}else if(_0x5d67c8[_0x7f00('0xa')]===_0x7f00('0xb')&&_[_0x7f00('0xc')](_0x4f4224)){var _0x4c2ad1=JSON[_0x7f00('0x5')](_0x4f4224);var _0x3042bf={'$gte':moment(moment(_0x4c2ad1[_0x7f00('0xd')])[_0x7f00('0xe')]('YYYY-MM-DD'))[_0x7f00('0xf')]()[_0x7f00('0xe')](),'$lte':moment(moment(_0x4c2ad1[_0x7f00('0x10')])['format'](_0x7f00('0x11')))[_0x7f00('0xf')]()[_0x7f00('0x12')](0x1,'s')[_0x7f00('0xe')]()};_0x542f48[_0x2eb77a]=_0x3042bf;}else if(_0x5d67c8[_0x7f00('0x13')]===_0x7f00('0x14')){_0x542f48[_0x2eb77a]=_0x4f4224;}else{_0x542f48[_0x2eb77a]=_[_0x7f00('0x15')](_0x4f4224)?_0x4f4224:JSON['parse'](_0x4f4224);}}else{_0x542f48[_0x2eb77a]=_[_0x7f00('0x15')](_0x4f4224)?_0x4f4224:JSON[_0x7f00('0x5')](_0x4f4224);}}catch(_0x29487e){_0x542f48[_0x2eb77a]=_0x4f4224[_0x7f00('0x7')](',');}});}return _0x542f48;};exports[_0x7f00('0x16')]=function(_0x3b1b2e){_0x3b1b2e=parseInt(_0x3b1b2e,0xa);if(!_0x3b1b2e||_0x3b1b2e<0x0){_0x3b1b2e=LIMIT_VALUE;}return _0x3b1b2e;};exports[_0x7f00('0x17')]=function(_0x2643ce){_0x2643ce=parseInt(_0x2643ce,0xa);if(!_0x2643ce||_0x2643ce<0x0){_0x2643ce=0x0;}return _0x2643ce;};exports[_0x7f00('0x18')]=function(_0x56f291){var _0x4ed428,_0x30129b=null;if(_0x56f291){_0x4ed428=_0x56f291['split'](',');_0x30129b=_['map'](_0x4ed428,function(_0x2df2bc){if(_0x2df2bc[_0x7f00('0x19')]('-')===0x0){return[_0x2df2bc===_0x7f00('0x1a')?sequelize[_0x7f00('0x1b')](sequelize[_0x7f00('0x1c')]('priority'),_0x7f00('0x1d')):_0x2df2bc[_0x7f00('0x1e')](0x1),'DESC'];}else{return[_0x2df2bc==='priority'?sequelize[_0x7f00('0x1b')](sequelize[_0x7f00('0x1c')]('priority'),_0x7f00('0x1d')):_0x2df2bc,_0x7f00('0x1f')];}});}return _0x30129b;};exports[_0x7f00('0x20')]=function(_0x45ca7a,_0x3e8f38){if(_['isEmpty'](_0x45ca7a)){return _0x45ca7a;}if(_['isArray'](_0x45ca7a)){for(var _0x1093a4=0x0;_0x1093a4<_0x45ca7a[_0x7f00('0x21')];_0x1093a4+=0x1){_0x45ca7a[_0x1093a4]=this['omit'](_0x45ca7a[_0x1093a4],_0x3e8f38);}return _0x45ca7a;}if(!_[_0x7f00('0x22')](_0x45ca7a)){return _0x45ca7a;}if(_[_0x7f00('0x23')](_0x3e8f38)){_0x3e8f38=[_0x3e8f38];}if(!_[_0x7f00('0x15')](_0x3e8f38)){return _0x45ca7a;}for(var _0x54a41c=0x0;_0x54a41c<_0x3e8f38[_0x7f00('0x21')];_0x54a41c+=0x1){_['unset'](_0x45ca7a,_0x3e8f38[_0x54a41c]);}for(var _0x240f28 in _0x45ca7a){if(_0x45ca7a['hasOwnProperty'](_0x240f28)){_0x45ca7a[_0x240f28]=this['omit'](_0x45ca7a[_0x240f28],_0x3e8f38);}}return _0x45ca7a;};exports[_0x7f00('0x24')]=function(_0x4c93ae){return _0x4c93ae['match'](RegExp(_0x7f00('0x25')))?!![]:![];};exports[_0x7f00('0x26')]=function(_0x1ed0ec){return _0x1ed0ec[_0x7f00('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x7f00('0x28')]=function(_0x20067b){var _0x3f2b86=[];_0x20067b[_0x7f00('0x7')](/[ ,]+/)[_0x7f00('0x29')](function(_0x23c325){_0x23c325=_0x23c325[_0x7f00('0x2a')](/([^:]")"+/g,'$1');_0x23c325='+'+_0x23c325+'*';var _0x4a0d5e=/[ `!@#$%^&*()_\-?~]/;if(_0x23c325[_0x7f00('0x27')](_0x4a0d5e))_0x23c325='\x22'+_0x23c325+'\x22';_0x3f2b86[_0x7f00('0x2b')](_0x23c325);});return _0x3f2b86[_0x7f00('0x2c')]('\x20');};exports[_0x7f00('0x2d')]=function(_0x124ef2,_0x5b3f0f,_0x46241){var _0x379a26={},_0x3c2f0c={};if(_0x5b3f0f[_0x7f00('0x2e')]['$id']){_0x5b3f0f[_0x7f00('0x2e')]['id']=_0x5b3f0f['query'][_0x7f00('0x2f')];delete _0x5b3f0f['query']['$id'];}_0x379a26[_0x7f00('0x30')]=_[_0x7f00('0x31')](_0x124ef2,_0x7f00('0x13'));_0x379a26[_0x7f00('0x2e')]=_[_0x7f00('0x3')](_0x5b3f0f[_0x7f00('0x2e')]);_0x379a26[_0x7f00('0x8')]=_[_0x7f00('0x32')](_0x379a26['model'],_0x379a26[_0x7f00('0x2e')]);_0x3c2f0c[_0x7f00('0x33')]=_[_0x7f00('0x32')](_0x379a26[_0x7f00('0x30')],this[_0x7f00('0x6')](_0x5b3f0f[_0x7f00('0x2e')][_0x7f00('0x6')]));_0x3c2f0c[_0x7f00('0x33')]=_0x3c2f0c[_0x7f00('0x33')][_0x7f00('0x21')]?_0x3c2f0c[_0x7f00('0x33')]:_0x379a26[_0x7f00('0x30')];if(!_0x5b3f0f[_0x7f00('0x2e')]['hasOwnProperty'](_0x7f00('0x34'))){_0x3c2f0c[_0x7f00('0x16')]=this[_0x7f00('0x16')](_0x5b3f0f[_0x7f00('0x2e')][_0x7f00('0x16')]);_0x3c2f0c[_0x7f00('0x17')]=this[_0x7f00('0x17')](_0x5b3f0f[_0x7f00('0x2e')]['offset']);}_0x3c2f0c['order']=this[_0x7f00('0x18')](_0x5b3f0f[_0x7f00('0x2e')]['sort']);_0x3c2f0c[_0x7f00('0x35')]=this[_0x7f00('0x8')](_[_0x7f00('0x36')](_0x5b3f0f[_0x7f00('0x2e')],_0x379a26[_0x7f00('0x8')]),_0x124ef2);if(_0x5b3f0f['query'][_0x7f00('0x37')]){var _0x202e0a=_0x124ef2;var _0x4c59fd=_0x5b3f0f['query'][_0x7f00('0x37')];if(typeof _0x4c59fd===_0x7f00('0x38')){_0x202e0a=_['filter'](_0x124ef2,function(_0x593465){return _[_0x7f00('0x4')](_0x4c59fd[_0x7f00('0x39')],_0x593465[_0x7f00('0x13')]);});_0x4c59fd=_0x4c59fd['value'];}_0x3c2f0c[_0x7f00('0x35')]=_[_0x7f00('0x3a')](_0x3c2f0c['where'],{'$or':_[_0x7f00('0x31')](_0x202e0a,function(_0x22640f){if(_0x22640f['type']!==_0x7f00('0x3b')){if(_0x46241){return sequelize['where'](sequelize['fn'](_0x7f00('0x3c'),sequelize[_0x7f00('0x1c')](_0x22640f[_0x7f00('0x13')])),{'$like':sequelize['fn'](_0x7f00('0x3c'),'%'+_0x5b3f0f['query'][_0x7f00('0x37')]+'%')});}else{var _0x33d756={};_0x33d756[_0x22640f[_0x7f00('0x13')]]={'$like':'%'+_0x5b3f0f[_0x7f00('0x2e')][_0x7f00('0x37')]+'%'};return _0x33d756;}}})});}_0x3c2f0c=_[_0x7f00('0x3a')]({},_0x3c2f0c,_0x5b3f0f['options']);return _0x3c2f0c;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 0b67eef..8486e3f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e91=['test','client','json\x20replacer','toISOString','split','use','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','json','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','default','get','env','set','appPath','join','root'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x4e91,0x105));var _0x14e9=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x4e91[_0x213518];return _0x1baf75;};'use strict';var express=require(_0x14e9('0x0'));var favicon=require(_0x14e9('0x1'));var bodyParser=require(_0x14e9('0x2'));var methodOverride=require(_0x14e9('0x3'));var cookieParser=require(_0x14e9('0x4'));var errorHandler=require(_0x14e9('0x5'));var path=require(_0x14e9('0x6'));var passport=require(_0x14e9('0x7'));var cors=require(_0x14e9('0x8'));var moment=require(_0x14e9('0x9'));var config=require('./environment');var db=require(_0x14e9('0xa'))['db'];exports[_0x14e9('0xb')]=function(_0x3f13be){var _0x46f8be=_0x3f13be[_0x14e9('0xc')](_0x14e9('0xd'));if(_0x46f8be==='production'){_0x3f13be[_0x14e9('0xe')](_0x14e9('0xf'),path[_0x14e9('0x10')](config[_0x14e9('0x11')],'public'));}if(_0x46f8be==='development'||_0x46f8be===_0x14e9('0x12')){_0x3f13be['set'](_0x14e9('0xf'),path[_0x14e9('0x10')](config[_0x14e9('0x11')],_0x14e9('0x13')));_0x3f13be['use'](errorHandler());}_0x3f13be[_0x14e9('0xe')](_0x14e9('0x14'),function(_0x4edd0a,_0x4da0e7){if(this[_0x4edd0a]instanceof Date){_0x4da0e7=this[_0x4edd0a][_0x14e9('0x15')]()[_0x14e9('0x16')]('.')[0x0]+'Z';}return _0x4da0e7;});_0x3f13be[_0x14e9('0x17')](express['static'](_0x3f13be['get'](_0x14e9('0xf'))));_0x3f13be[_0x14e9('0xe')]('views',config[_0x14e9('0x11')]+_0x14e9('0x18'));_0x3f13be['engine'](_0x14e9('0x19'),require(_0x14e9('0x1a'))[_0x14e9('0x1b')]);_0x3f13be[_0x14e9('0xe')](_0x14e9('0x1c'),_0x14e9('0x19'));_0x3f13be[_0x14e9('0x17')](bodyParser[_0x14e9('0x1d')]({'limit':'50mb','extended':!![]}));_0x3f13be['use'](bodyParser[_0x14e9('0x1e')]({'limit':'50mb'}));_0x3f13be[_0x14e9('0x17')](cors());_0x3f13be[_0x14e9('0x17')](methodOverride());_0x3f13be['use'](cookieParser());_0x3f13be[_0x14e9('0x17')](passport['initialize']());}; \ No newline at end of file +var _0xbed0=['cors','moment','./environment','../mysqldb','default','get','production','set','appPath','root','public','development','test','join','use','json\x20replacer','toISOString','split','views','/server/views','engine','html','ejs','view\x20engine','50mb','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbed0,0xc5));var _0x0bed=function(_0x4e5eaf,_0x17924f){_0x4e5eaf=_0x4e5eaf-0x0;var _0x56e75b=_0xbed0[_0x4e5eaf];return _0x56e75b;};'use strict';var express=require(_0x0bed('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x0bed('0x1'));var methodOverride=require(_0x0bed('0x2'));var cookieParser=require(_0x0bed('0x3'));var errorHandler=require(_0x0bed('0x4'));var path=require(_0x0bed('0x5'));var passport=require(_0x0bed('0x6'));var cors=require(_0x0bed('0x7'));var moment=require(_0x0bed('0x8'));var config=require(_0x0bed('0x9'));var db=require(_0x0bed('0xa'))['db'];exports[_0x0bed('0xb')]=function(_0x6533b3){var _0x24e1f9=_0x6533b3[_0x0bed('0xc')]('env');if(_0x24e1f9===_0x0bed('0xd')){_0x6533b3[_0x0bed('0xe')](_0x0bed('0xf'),path['join'](config[_0x0bed('0x10')],_0x0bed('0x11')));}if(_0x24e1f9===_0x0bed('0x12')||_0x24e1f9===_0x0bed('0x13')){_0x6533b3['set']('appPath',path[_0x0bed('0x14')](config[_0x0bed('0x10')],'client'));_0x6533b3[_0x0bed('0x15')](errorHandler());}_0x6533b3['set'](_0x0bed('0x16'),function(_0x85ff30,_0x19c604){if(this[_0x85ff30]instanceof Date){_0x19c604=this[_0x85ff30][_0x0bed('0x17')]()[_0x0bed('0x18')]('.')[0x0]+'Z';}return _0x19c604;});_0x6533b3[_0x0bed('0x15')](express['static'](_0x6533b3[_0x0bed('0xc')](_0x0bed('0xf'))));_0x6533b3['set'](_0x0bed('0x19'),config[_0x0bed('0x10')]+_0x0bed('0x1a'));_0x6533b3[_0x0bed('0x1b')](_0x0bed('0x1c'),require(_0x0bed('0x1d'))['renderFile']);_0x6533b3[_0x0bed('0xe')](_0x0bed('0x1e'),'html');_0x6533b3[_0x0bed('0x15')](bodyParser['urlencoded']({'limit':_0x0bed('0x1f'),'extended':!![]}));_0x6533b3[_0x0bed('0x15')](bodyParser[_0x0bed('0x20')]({'limit':_0x0bed('0x1f')}));_0x6533b3[_0x0bed('0x15')](cors());_0x6533b3[_0x0bed('0x15')](methodOverride());_0x6533b3[_0x0bed('0x15')](cookieParser());_0x6533b3[_0x0bed('0x15')](passport[_0x0bed('0x21')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ebbabb7..52faf48 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 _0x7047=['ipAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','head','address','getFirstInterface','cpus','map','model','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x3b6a9c,_0x1dcdb7){var _0x1406b0=function(_0x21b95f){while(--_0x21b95f){_0x3b6a9c['push'](_0x3b6a9c['shift']());}};_0x1406b0(++_0x1dcdb7);}(_0x7047,0x1ca));var _0x7704=function(_0x2223b2,_0x109005){_0x2223b2=_0x2223b2-0x0;var _0x6444ee=_0x7047[_0x2223b2];return _0x6444ee;};'use strict';var _=require(_0x7704('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x7704('0x1'));var exec=require(_0x7704('0x2'))['execSync'];var config=require(_0x7704('0x3'));function getInterfaces(){var _0x26fd23=[];var _0x30f47f=os[_0x7704('0x4')]();var _0x2ca66c=_[_0x7704('0x5')](_[_0x7704('0x6')](_0x30f47f));for(var _0x282246=0x0;_0x282246<_0x2ca66c[_0x7704('0x7')];_0x282246++){var _0x4851c8=_0x30f47f[_0x2ca66c[_0x282246]][_0x7704('0x8')](function(_0x6b7fd5){return _0x6b7fd5[_0x7704('0x9')]===_0x7704('0xa')&&_0x6b7fd5['internal']===![];});_0x26fd23=_0x26fd23[_0x7704('0xb')](_0x4851c8);}return _0x26fd23;}function getFirstInterface(){var _0x50a634=_[_0x7704('0xc')](getInterfaces());return{'macAddress':_0x50a634&&_0x50a634['mac']?_0x50a634['mac']:'00:00:00:00:00:00','ipAddress':_0x50a634&&_0x50a634[_0x7704('0xd')]?_0x50a634[_0x7704('0xd')]:'127.0.0.1'};}exports[_0x7704('0xe')]=getFirstInterface;function getCPUhash(){var _0x5abe01=_['orderBy'](os[_0x7704('0xf')]()[_0x7704('0x10')](function(_0x12bd44){return _0x12bd44[_0x7704('0x11')];}))['join'](':');return crypto[_0x7704('0x12')](_0x7704('0x13'))[_0x7704('0x14')](_0x5abe01)['digest'](_0x7704('0x15'));}exports[_0x7704('0x16')]=function(){var _0x41e17d=os[_0x7704('0x17')]();var _0xedb0db=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xedb0db[_0x7704('0x18')](config[_0x7704('0x19')])){return config[_0x7704('0x19')];}else if(_0x41e17d===_0x7704('0x1a')){return exec(_0x7704('0x1b'),{'encoding':_0x7704('0x1c')})[_0x7704('0x1d')]('\x0d\x0a','');}else{var _0x2a9c3b=getFirstInterface();var _0x18eef1=getCPUhash();var _0x5bed0e=_0x18eef1+'|'+os[_0x7704('0x1e')]()+'|'+_0x2a9c3b[_0x7704('0x1f')]+'|'+_0x2a9c3b[_0x7704('0x20')];var _0x4c645c=crypto[_0x7704('0x12')](_0x7704('0x13'))[_0x7704('0x14')](_0x5bed0e)[_0x7704('0x21')](_0x7704('0x15'));return _0x4c645c[_0x7704('0x22')](0x0,0x8)+'-'+_0x4c645c[_0x7704('0x22')](0x8,0xc)+'-'+_0x4c645c['substring'](0xc,0x10)+'-'+_0x4c645c['substring'](0x10,0x14)+'-'+_0x4c645c[_0x7704('0x22')](0x14);}}; \ No newline at end of file +var _0x6ea3=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','model','join','createHash','md5','update','digest','hex','platform','licenseToken','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','length','filter','family','IPv4','internal'];(function(_0x2df515,_0x4d1a60){var _0xf06270=function(_0x31f325){while(--_0x31f325){_0x2df515['push'](_0x2df515['shift']());}};_0xf06270(++_0x4d1a60);}(_0x6ea3,0xd0));var _0x36ea=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x6ea3[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x36ea('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x36ea('0x1'));var exec=require('child_process')[_0x36ea('0x2')];var config=require('../environment');function getInterfaces(){var _0x57400b=[];var _0x16e1c1=os[_0x36ea('0x3')]();var _0x2903a7=_['orderBy'](_['keys'](_0x16e1c1));for(var _0x57fe2b=0x0;_0x57fe2b<_0x2903a7[_0x36ea('0x4')];_0x57fe2b++){var _0x4f4779=_0x16e1c1[_0x2903a7[_0x57fe2b]][_0x36ea('0x5')](function(_0x3cebc5){return _0x3cebc5[_0x36ea('0x6')]===_0x36ea('0x7')&&_0x3cebc5[_0x36ea('0x8')]===![];});_0x57400b=_0x57400b[_0x36ea('0x9')](_0x4f4779);}return _0x57400b;}function getFirstInterface(){var _0x3a9564=_[_0x36ea('0xa')](getInterfaces());return{'macAddress':_0x3a9564&&_0x3a9564['mac']?_0x3a9564[_0x36ea('0xb')]:_0x36ea('0xc'),'ipAddress':_0x3a9564&&_0x3a9564[_0x36ea('0xd')]?_0x3a9564[_0x36ea('0xd')]:_0x36ea('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xddc82a=_[_0x36ea('0xf')](os[_0x36ea('0x10')]()['map'](function(_0x3a2416){return _0x3a2416[_0x36ea('0x11')];}))[_0x36ea('0x12')](':');return crypto[_0x36ea('0x13')](_0x36ea('0x14'))[_0x36ea('0x15')](_0xddc82a)[_0x36ea('0x16')](_0x36ea('0x17'));}exports['getUuid']=function(){var _0x3cffd3=os[_0x36ea('0x18')]();var _0x4c053a=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4c053a['test'](config[_0x36ea('0x19')])){return config[_0x36ea('0x19')];}else if(_0x3cffd3==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x36ea('0x1a')]('\x0d\x0a','');}else{var _0x202c81=getFirstInterface();var _0x16e9ef=getCPUhash();var _0x3d466d=_0x16e9ef+'|'+os[_0x36ea('0x1b')]()+'|'+_0x202c81[_0x36ea('0x1c')]+'|'+_0x202c81[_0x36ea('0x1d')];var _0x5739f9=crypto[_0x36ea('0x13')]('md5')['update'](_0x3d466d)[_0x36ea('0x16')](_0x36ea('0x17'));return _0x5739f9['substring'](0x0,0x8)+'-'+_0x5739f9['substring'](0x8,0xc)+'-'+_0x5739f9[_0x36ea('0x1e')](0xc,0x10)+'-'+_0x5739f9[_0x36ea('0x1e')](0x10,0x14)+'-'+_0x5739f9[_0x36ea('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0fcd4f5..90e98e0 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 _0x39d9=['info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','moment','bluebird','../../mysqldb','../../components/encryptor','license','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','get','data1','active','data2'];(function(_0xdd4941,_0xfbd48f){var _0x16b617=function(_0x10c4c0){while(--_0x10c4c0){_0xdd4941['push'](_0xdd4941['shift']());}};_0x16b617(++_0xfbd48f);}(_0x39d9,0x65));var _0x939d=function(_0x16c1eb,_0x4448b0){_0x16c1eb=_0x16c1eb-0x0;var _0x23af3f=_0x39d9[_0x16c1eb];return _0x23af3f;};'use strict';var util=require('util');var moment=require(_0x939d('0x0'));var rp=require('request-promise');var BPromise=require(_0x939d('0x1'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x939d('0x2'))['db'];var encryptor=require(_0x939d('0x3'));var hardware=require('./hardware');var logger=require('../logger')(_0x939d('0x4'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x29ad49){return new BPromise(function(_0x3cb90c,_0x3b9b60){var _0x33359d=util[_0x939d('0x5')](_0x939d('0x6'),HOST,_0x29ad49,module['exports'][_0x939d('0x7')]);if(oldToken){_0x33359d=util[_0x939d('0x5')](_0x939d('0x8'),HOST,_0x29ad49,module[_0x939d('0x9')][_0x939d('0x7')],oldToken);}var _0x4991f4={'uri':_0x33359d,'method':_0x939d('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x4991f4)[_0x939d('0xb')](function(_0x3ad067){_0x3cb90c(_0x3ad067);})['catch'](function(_0x787b56){_0x3b9b60(_0x787b56);});});}function manageLicense(_0x2b3cae,_0x4053d8){var _0x24540a=_0x4053d8[_0x939d('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x24540a[_0x939d('0xd')]!==_0x2b3cae&&!_0x24540a['data2']){oldToken=_0x24540a[_0x939d('0xd')];}httpRequest(_0x2b3cae)['then'](function(_0x1fb672){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1fb672[_0x939d('0xe')]){isOldTokenSent=![];if(!_0x24540a[_0x939d('0x4')]&&_0x24540a['license']!=_0x1fb672[_0x939d('0x4')]||_0x24540a[_0x939d('0x4')]&&_0x24540a[_0x939d('0xf')]){logger[_0x939d('0x10')](_0x939d('0x11'));}if(_0x24540a[_0x939d('0x4')]&&!_0x24540a[_0x939d('0xf')]&&_0x24540a[_0x939d('0x4')]!=_0x1fb672[_0x939d('0x4')]){logger[_0x939d('0x10')](_0x939d('0x12'));}if(_0x24540a['license']&&!_0x24540a[_0x939d('0xf')]&&_0x24540a[_0x939d('0x4')]==_0x1fb672[_0x939d('0x4')]){return _0x4053d8;}return _0x4053d8[_0x939d('0x13')]({'data1':_0x2b3cae,'data2':null,'license':_0x1fb672[_0x939d('0x4')]});}else{if(_0x1fb672['license']||_0x24540a[_0x939d('0x4')]){if(!_0x24540a['data2']){if(_0x24540a['data1']==_0x2b3cae){GRAY_PERIOD_REASON=_0x939d('0x14');logger[_0x939d('0x10')](_0x939d('0x15'));}else{GRAY_PERIOD_REASON=_0x939d('0x16');logger[_0x939d('0x10')](_0x939d('0x17'),_0x24540a['data1'],_0x2b3cae);}logger[_0x939d('0x10')](_0x939d('0x18'),GRAY_PERIOD_REASON[_0x939d('0x19')](),moment()[_0x939d('0x5')](_0x939d('0x1a')));return _0x4053d8[_0x939d('0x13')]({'data2':encryptor['encryptString'](moment()[_0x939d('0x5')](_0x939d('0x1a')))});}else{if(moment()[_0x939d('0x1b')](encryptor[_0x939d('0x1c')](_0x24540a[_0x939d('0xf')]),_0x939d('0x1d'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4053d8[_0x939d('0x13')]({'data1':_0x2b3cae,'data2':null,'license':null});}}}else{if(_0x24540a[_0x939d('0xd')]!=_0x2b3cae){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x24540a[_0x939d('0xd')],_0x2b3cae);return _0x4053d8['update']({'data1':_0x2b3cae,'data2':null,'license':null});}}}return _0x4053d8;})[_0x939d('0xb')](function(_0x3d825a){_0x4053d8=_0x3d825a;})[_0x939d('0x1e')](function(_0xd7e865){logger[_0x939d('0x1f')](_0xd7e865[_0x939d('0x20')]);})[_0x939d('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x939d('0x22')](),_0x4053d8);},TIME);});}function defaultLicense(){var _0x819d84=hardware[_0x939d('0x22')]();if(_0x819d84){return db[_0x939d('0x23')][_0x939d('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x819d84}})[_0x939d('0x25')](function(_0x284272,_0x4b655c){logger[_0x939d('0x10')](_0x939d('0x26'),_0x819d84);manageLicense(_0x819d84,_0x284272);})['catch'](function(_0x584ee9){logger['error'](_0x584ee9['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x7cf5=['then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x29e327,_0x2b6ea9){var _0x3dac9e=function(_0x5c0e02){while(--_0x5c0e02){_0x29e327['push'](_0x29e327['shift']());}};_0x3dac9e(++_0x2b6ea9);}(_0x7cf5,0x9a));var _0x57cf=function(_0x2e29b0,_0x5c544b){_0x2e29b0=_0x2e29b0-0x0;var _0x1219cc=_0x7cf5[_0x2e29b0];return _0x1219cc;};'use strict';var util=require(_0x57cf('0x0'));var moment=require(_0x57cf('0x1'));var rp=require('request-promise');var BPromise=require(_0x57cf('0x2'));var pkginfo=require(_0x57cf('0x3'))(module,'version');var db=require(_0x57cf('0x4'))['db'];var encryptor=require(_0x57cf('0x5'));var hardware=require(_0x57cf('0x6'));var logger=require('../logger')(_0x57cf('0x7'));var HOST=_0x57cf('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x462176){return new BPromise(function(_0x10ae48,_0x1d16f9){var _0x424cc3=util['format'](_0x57cf('0x9'),HOST,_0x462176,module[_0x57cf('0xa')][_0x57cf('0xb')]);if(oldToken){_0x424cc3=util[_0x57cf('0xc')](_0x57cf('0xd'),HOST,_0x462176,module[_0x57cf('0xa')][_0x57cf('0xb')],oldToken);}var _0x631d5b={'uri':_0x424cc3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x631d5b)[_0x57cf('0xe')](function(_0x5f50f4){_0x10ae48(_0x5f50f4);})[_0x57cf('0xf')](function(_0x328438){_0x1d16f9(_0x328438);});});}function manageLicense(_0x3d762a,_0x2732f2){var _0x492f13=_0x2732f2[_0x57cf('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x492f13[_0x57cf('0x11')]!==_0x3d762a&&!_0x492f13[_0x57cf('0x12')]){oldToken=_0x492f13[_0x57cf('0x11')];}httpRequest(_0x3d762a)[_0x57cf('0xe')](function(_0x2b086f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b086f[_0x57cf('0x13')]){isOldTokenSent=![];if(!_0x492f13[_0x57cf('0x7')]&&_0x492f13[_0x57cf('0x7')]!=_0x2b086f['license']||_0x492f13[_0x57cf('0x7')]&&_0x492f13[_0x57cf('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x492f13[_0x57cf('0x7')]&&!_0x492f13[_0x57cf('0x12')]&&_0x492f13[_0x57cf('0x7')]!=_0x2b086f['license']){logger[_0x57cf('0x14')](_0x57cf('0x15'));}if(_0x492f13[_0x57cf('0x7')]&&!_0x492f13[_0x57cf('0x12')]&&_0x492f13['license']==_0x2b086f[_0x57cf('0x7')]){return _0x2732f2;}return _0x2732f2[_0x57cf('0x16')]({'data1':_0x3d762a,'data2':null,'license':_0x2b086f['license']});}else{if(_0x2b086f[_0x57cf('0x7')]||_0x492f13[_0x57cf('0x7')]){if(!_0x492f13[_0x57cf('0x12')]){if(_0x492f13[_0x57cf('0x11')]==_0x3d762a){GRAY_PERIOD_REASON=_0x57cf('0x17');logger[_0x57cf('0x14')](_0x57cf('0x18'));}else{GRAY_PERIOD_REASON=_0x57cf('0x19');logger[_0x57cf('0x14')](_0x57cf('0x1a'),_0x492f13[_0x57cf('0x11')],_0x3d762a);}logger[_0x57cf('0x14')](_0x57cf('0x1b'),GRAY_PERIOD_REASON[_0x57cf('0x1c')](),moment()['format'](_0x57cf('0x1d')));return _0x2732f2['update']({'data2':encryptor[_0x57cf('0x1e')](moment()[_0x57cf('0xc')](_0x57cf('0x1d')))});}else{if(moment()['diff'](encryptor[_0x57cf('0x1f')](_0x492f13['data2']),_0x57cf('0x20'))>DAYS){logger[_0x57cf('0x14')](_0x57cf('0x21'),moment()['format'](_0x57cf('0x1d')));isOldTokenSent=![];return _0x2732f2[_0x57cf('0x16')]({'data1':_0x3d762a,'data2':null,'license':null});}}}else{if(_0x492f13[_0x57cf('0x11')]!=_0x3d762a){logger[_0x57cf('0x14')](_0x57cf('0x1a'),_0x492f13['data1'],_0x3d762a);return _0x2732f2[_0x57cf('0x16')]({'data1':_0x3d762a,'data2':null,'license':null});}}}return _0x2732f2;})['then'](function(_0x4e804d){_0x2732f2=_0x4e804d;})[_0x57cf('0xf')](function(_0x55b603){logger['error'](_0x55b603[_0x57cf('0x22')]);})[_0x57cf('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x57cf('0x24')](),_0x2732f2);},TIME);});}function defaultLicense(){var _0x1dcd9a=hardware[_0x57cf('0x24')]();if(_0x1dcd9a){return db[_0x57cf('0x25')][_0x57cf('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x1dcd9a}})['spread'](function(_0x23bc27,_0xbfbaad){logger[_0x57cf('0x14')](_0x57cf('0x27'),_0x1dcd9a);manageLicense(_0x1dcd9a,_0x23bc27);})[_0x57cf('0xf')](function(_0xaade5a){logger[_0x57cf('0x28')](_0xaade5a[_0x57cf('0x22')]);});}}exports[_0x57cf('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b06ae05..d32dc48 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 _0xb2f6=['catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','machineUuid','gray','add','days','changed','disabled','message','findAll','role','sequelize','col','admin','user','telephone','telephones','count','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','License','defaults','then'];(function(_0x80104e,_0xd02d7c){var _0x18d490=function(_0x1f7ab5){while(--_0x1f7ab5){_0x80104e['push'](_0x80104e['shift']());}};_0x18d490(++_0xd02d7c);}(_0xb2f6,0x6c));var _0x6b2f=function(_0x440166,_0x117ea6){_0x440166=_0x440166-0x0;var _0x96277b=_0xb2f6[_0x440166];return _0x96277b;};'use strict';var util=require('util');var _=require(_0x6b2f('0x0'));var moment=require(_0x6b2f('0x1'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x6b2f('0x2'));var db=require(_0x6b2f('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x6b2f('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6b2f('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x6b2f('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x374834){return new BPromise(function(_0x58bfeb,_0xd3926){return db[_0x6b2f('0x6')]['find'](_[_0x6b2f('0x7')](_0x374834,{'raw':!![],'where':{'id':0x1}}))[_0x6b2f('0x8')](function(_0x24cab3){return checkLicense(_0x24cab3,null);})[_0x6b2f('0x8')](function(_0x51861e){_0x58bfeb(_0x51861e);return;})[_0x6b2f('0x9')](function(_0x2c0a78){_0xd3926(_0x2c0a78);});});}function checkLicense(_0x499ff7,_0x1bba1f){if(!_0x499ff7){demoLicense[_0x6b2f('0xa')]=_0x499ff7[_0x6b2f('0xb')];return demoLicense;}try{var _0x50acaa=_0x1bba1f||_0x499ff7['license'];if(_[_0x6b2f('0xc')](_0x50acaa)){throw new Error(_0x6b2f('0xd'));}var _0x47ad54=_0x499ff7[_0x6b2f('0xb')];var _0x629611=_0x499ff7[_0x6b2f('0xe')];var _0x48abf1=_0x47ad54[_0x6b2f('0xf')]('-')[0x4];var _0x167933=_0x47ad54[_0x6b2f('0xf')]('-')[0x0];var _0xbe8b9c=encryptor[_0x6b2f('0x10')](_0x50acaa,util[_0x6b2f('0x11')]('%s:%s:%s',_0x48abf1,_0x47ad54,_0x167933));var _0x39f9c6=JSON[_0x6b2f('0x12')](_0xbe8b9c);_0x39f9c6['demo']=![];_0x39f9c6[_0x6b2f('0xa')]=_0x47ad54;_0x39f9c6[_0x6b2f('0x13')]=hardware[_0x6b2f('0x4')]();if(_0x629611){var _0x10541c=encryptor[_0x6b2f('0x10')](_0x629611);_0x39f9c6[_0x6b2f('0x14')]=_0x10541c;_0x39f9c6['deadline']=moment(_0x10541c)[_0x6b2f('0x15')](0x7,_0x6b2f('0x16'))[_0x6b2f('0x11')]();_0x39f9c6['grayReason']=_0x39f9c6['uuid']!=_0x39f9c6['machineUuid']?_0x6b2f('0x17'):_0x6b2f('0x18');}return _0x39f9c6;}catch(_0x466427){breakingLicense[_0x6b2f('0xa')]=_0x499ff7[_0x6b2f('0xb')];breakingLicense[_0x6b2f('0x19')]=_0x466427[_0x6b2f('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4db9a6,_0x452955){getLicense()[_0x6b2f('0x8')](function(_0x32d8bc){return db['User'][_0x6b2f('0x1a')]({'attributes':[_0x6b2f('0x1b'),[db[_0x6b2f('0x1c')]['fn']('COUNT',db[_0x6b2f('0x1c')][_0x6b2f('0x1d')]('role')),'count']],'group':_0x6b2f('0x1b'),'where':{'role':{'$or':[_0x6b2f('0x1e'),_0x6b2f('0x1f'),_0x6b2f('0x20')]}},'raw':!![]})[_0x6b2f('0x8')](function(_0x32aee0){var _0xb3a038={'user':_0x32d8bc['users']||0x0,'telephone':_0x32d8bc[_0x6b2f('0x21')]||0x0};_0x32aee0['forEach'](function(_0x5953f8){var _0x521e4d=_0x5953f8[_0x6b2f('0x1b')]===_0x6b2f('0x1e')?_0x6b2f('0x1f'):_0x5953f8[_0x6b2f('0x1b')];_0xb3a038[_0x521e4d]-=_0x5953f8[_0x6b2f('0x22')];if(_0xb3a038[_0x521e4d]<0x0)_0xb3a038[_0x521e4d]=0x0;});_0x4db9a6(_0xb3a038);return;});})[_0x6b2f('0x9')](function(_0x50c897){_0x452955(_0x50c897);});});}function checkUserLimits(_0x534899){return new BPromise(function(_0x171e42,_0x470bf2){getLimits()[_0x6b2f('0x8')](function(_0x567500){var _0x13035d=_[_0x6b2f('0x23')](_[_0x6b2f('0x24')](_0x534899,'role'),['admin','user',_0x6b2f('0x20')]);var _0x4fc92e=(_0x13035d[_0x6b2f('0x1e')]||0x0)+(_0x13035d[_0x6b2f('0x1f')]||0x0);var _0x4caab1=_0x13035d['telephone']||0x0;if(_0x4fc92e>_0x567500[_0x6b2f('0x1f')])return _0x470bf2('License\x20limit\x20reached\x20for\x20users');if(_0x4caab1>_0x567500['telephone'])return _0x470bf2(_0x6b2f('0x25'));return _0x171e42();})[_0x6b2f('0x9')](function(_0x2be658){_0x470bf2(_0x2be658);});});}module[_0x6b2f('0x26')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xe640=['user','telephone','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','gray','days','disabled','message','User','role','sequelize','COUNT','count','admin'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0xe640,0x125));var _0x0e64=function(_0x9e6156,_0x29fe7d){_0x9e6156=_0x9e6156-0x0;var _0x5c7f79=_0xe640[_0x9e6156];return _0x5c7f79;};'use strict';var util=require(_0x0e64('0x0'));var _=require(_0x0e64('0x1'));var moment=require(_0x0e64('0x2'));var BPromise=require(_0x0e64('0x3'));var hardware=require(_0x0e64('0x4'));var encryptor=require(_0x0e64('0x5'));var db=require(_0x0e64('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x0e64('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0e64('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x0e64('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xa92568){return new BPromise(function(_0x9be8d1,_0x345578){return db[_0x0e64('0x9')][_0x0e64('0xa')](_[_0x0e64('0xb')](_0xa92568,{'raw':!![],'where':{'id':0x1}}))[_0x0e64('0xc')](function(_0xbafec4){return checkLicense(_0xbafec4,null);})[_0x0e64('0xc')](function(_0x3d9fed){_0x9be8d1(_0x3d9fed);return;})[_0x0e64('0xd')](function(_0x38eab7){_0x345578(_0x38eab7);});});}function checkLicense(_0x53cd3b,_0x5ab87c){if(!_0x53cd3b){demoLicense[_0x0e64('0xe')]=_0x53cd3b[_0x0e64('0xf')];return demoLicense;}try{var _0x296e30=_0x5ab87c||_0x53cd3b[_0x0e64('0x10')];if(_['isEmpty'](_0x296e30)){throw new Error(_0x0e64('0x11'));}var _0x54dbd2=_0x53cd3b['data1'];var _0xda7f4=_0x53cd3b[_0x0e64('0x12')];var _0x29aa14=_0x54dbd2[_0x0e64('0x13')]('-')[0x4];var _0x337d9c=_0x54dbd2[_0x0e64('0x13')]('-')[0x0];var _0x388c81=encryptor[_0x0e64('0x14')](_0x296e30,util[_0x0e64('0x15')]('%s:%s:%s',_0x29aa14,_0x54dbd2,_0x337d9c));var _0x38c704=JSON[_0x0e64('0x16')](_0x388c81);_0x38c704[_0x0e64('0x17')]=![];_0x38c704['uuid']=_0x54dbd2;_0x38c704[_0x0e64('0x18')]=hardware[_0x0e64('0x7')]();if(_0xda7f4){var _0x5ed8e9=encryptor[_0x0e64('0x14')](_0xda7f4);_0x38c704[_0x0e64('0x19')]=_0x5ed8e9;_0x38c704['deadline']=moment(_0x5ed8e9)['add'](0x7,_0x0e64('0x1a'))[_0x0e64('0x15')]();_0x38c704['grayReason']=_0x38c704[_0x0e64('0xe')]!=_0x38c704[_0x0e64('0x18')]?'changed':_0x0e64('0x1b');}return _0x38c704;}catch(_0x248c7c){breakingLicense[_0x0e64('0xe')]=_0x53cd3b[_0x0e64('0xf')];breakingLicense[_0x0e64('0x1c')]=_0x248c7c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4ae593,_0xfe57c5){getLicense()[_0x0e64('0xc')](function(_0x307e96){return db[_0x0e64('0x1d')]['findAll']({'attributes':[_0x0e64('0x1e'),[db[_0x0e64('0x1f')]['fn'](_0x0e64('0x20'),db[_0x0e64('0x1f')]['col'](_0x0e64('0x1e'))),_0x0e64('0x21')]],'group':'role','where':{'role':{'$or':[_0x0e64('0x22'),_0x0e64('0x23'),_0x0e64('0x24')]}},'raw':!![]})[_0x0e64('0xc')](function(_0x1f6896){var _0x5d1b3d={'user':_0x307e96['users']||0x0,'telephone':_0x307e96['telephones']||0x0};_0x1f6896['forEach'](function(_0x37b9ee){var _0x2c9c2a=_0x37b9ee[_0x0e64('0x1e')]==='admin'?'user':_0x37b9ee[_0x0e64('0x1e')];_0x5d1b3d[_0x2c9c2a]-=_0x37b9ee[_0x0e64('0x21')];if(_0x5d1b3d[_0x2c9c2a]<0x0)_0x5d1b3d[_0x2c9c2a]=0x0;});_0x4ae593(_0x5d1b3d);return;});})['catch'](function(_0x2201a0){_0xfe57c5(_0x2201a0);});});}function checkUserLimits(_0x237b43){return new BPromise(function(_0x5f2e0a,_0x2c2731){getLimits()[_0x0e64('0xc')](function(_0x3f9f5d){var _0x240fb4=_[_0x0e64('0x25')](_['countBy'](_0x237b43,'role'),[_0x0e64('0x22'),'user',_0x0e64('0x24')]);var _0x36b6de=(_0x240fb4['admin']||0x0)+(_0x240fb4[_0x0e64('0x23')]||0x0);var _0x264508=_0x240fb4[_0x0e64('0x24')]||0x0;if(_0x36b6de>_0x3f9f5d[_0x0e64('0x23')])return _0x2c2731(_0x0e64('0x26'));if(_0x264508>_0x3f9f5d[_0x0e64('0x24')])return _0x2c2731(_0x0e64('0x27'));return _0x5f2e0a();})[_0x0e64('0xd')](function(_0x199f92){_0x2c2731(_0x199f92);});});}module[_0x0e64('0x28')]={'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 3e06a4d..c8f9a7d 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 _0xd943=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x360a9d,_0x41c65c){_0x360a9d=_0x360a9d-0x0;var _0x55672a=_0xd943[_0x360a9d];return _0x55672a;};'use strict';module[_0x3d94('0x0')]={'DOMAIN':_0x3d94('0x1'),'SESSION_SECRET':_0x3d94('0x2'),'GOOGLE_ID':_0x3d94('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x1399=['app-id','exports','http://localhost:9000'];(function(_0x5b139a,_0x145027){var _0x2ef232=function(_0x5258cd){while(--_0x5258cd){_0x5b139a['push'](_0x5b139a['shift']());}};_0x2ef232(++_0x145027);}(_0x1399,0x16c));var _0x9139=function(_0x18b20e,_0x46903c){_0x18b20e=_0x18b20e-0x0;var _0xadd3a9=_0x1399[_0x18b20e];return _0xadd3a9;};'use strict';module[_0x9139('0x0')]={'DOMAIN':_0x9139('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x9139('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 53165f1..e511a4d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52a7=['info','Console','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','File','error','transports','%s-%s'];(function(_0x5800a5,_0x2823f6){var _0x420c85=function(_0x42e2e7){while(--_0x42e2e7){_0x5800a5['push'](_0x5800a5['shift']());}};_0x420c85(++_0x2823f6);}(_0x52a7,0x162));var _0x752a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x52a7[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0x752a('0x0'));var winston=require(_0x752a('0x1'));var util=require(_0x752a('0x2'));var path=require(_0x752a('0x3'));var debugLevel=_0x752a('0x4');function filename(_0x3af844,_0x378045){return path[_0x752a('0x5')](_0x752a('0x6'),_0x752a('0x7'),_0x752a('0x8'),util[_0x752a('0x9')](_0x752a('0xa'),_0x3af844,_0x378045));}function formatter(_0x3b8d0a,_0x5c136b){_0x5c136b[_0x752a('0xb')]=_0x5c136b['message'][_0x752a('0xc')](/@@{/g,_0x752a('0xd'))[_0x752a('0xc')](/}@@/g,_0x752a('0xe'))['replace'](/@{/g,'{{')[_0x752a('0xc')](/}@/g,'}}');return util[_0x752a('0x9')](_0x752a('0xf'),moment()[_0x752a('0x9')](_0x752a('0x10')),_0x5c136b['level'][_0x752a('0x11')](),_0x3b8d0a,_0x5c136b['message']);}module[_0x752a('0x12')]=function(_0x2ecaff){return new winston[(_0x752a('0x13'))]({'transports':[new winston['transports'][(_0x752a('0x14'))]({'name':util[_0x752a('0x9')]('%s-%s',_0x2ecaff,'error'),'filename':filename(_0x2ecaff,_0x752a('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x511467){return formatter(_0x2ecaff,_0x511467);}}),new winston[(_0x752a('0x16'))][(_0x752a('0x14'))]({'name':util[_0x752a('0x9')](_0x752a('0x17'),_0x2ecaff,_0x752a('0x18')),'filename':filename(_0x2ecaff,_0x752a('0x18')),'level':_0x752a('0x18'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38bdd1){return formatter(_0x2ecaff,_0x38bdd1);}}),new winston[(_0x752a('0x16'))][(_0x752a('0x19'))]({'level':process['env'][_0x752a('0x1a')]||debugLevel,'json':![],'formatter':function(_0x28094b){return formatter(_0x2ecaff,_0x28094b);}})]});}; \ No newline at end of file +var _0xa756=['Console','env','debugLevel','winston','util','INFO','join','/var','xcally','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','%s-%s','error','info'];(function(_0x20008a,_0x362490){var _0x5d0f1c=function(_0x122ecf){while(--_0x122ecf){_0x20008a['push'](_0x20008a['shift']());}};_0x5d0f1c(++_0x362490);}(_0xa756,0x117));var _0x6a75=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0xa756[_0x2867d8];return _0x3b8176;};'use strict';var moment=require('moment');var winston=require(_0x6a75('0x0'));var util=require(_0x6a75('0x1'));var path=require('path');var debugLevel=_0x6a75('0x2');function filename(_0x41c955,_0x43937a){return path[_0x6a75('0x3')](_0x6a75('0x4'),'log',_0x6a75('0x5'),util[_0x6a75('0x6')](_0x6a75('0x7'),_0x41c955,_0x43937a));}function formatter(_0xaa4d16,_0x3e87bd){_0x3e87bd[_0x6a75('0x8')]=_0x3e87bd['message'][_0x6a75('0x9')](/@@{/g,'{{{')[_0x6a75('0x9')](/}@@/g,_0x6a75('0xa'))[_0x6a75('0x9')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6a75('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x6a75('0x6')](_0x6a75('0xb')),_0x3e87bd[_0x6a75('0xc')][_0x6a75('0xd')](),_0xaa4d16,_0x3e87bd['message']);}module[_0x6a75('0xe')]=function(_0x3b0676){return new winston[(_0x6a75('0xf'))]({'transports':[new winston[(_0x6a75('0x10'))]['File']({'name':util[_0x6a75('0x6')](_0x6a75('0x11'),_0x3b0676,_0x6a75('0x12')),'filename':filename(_0x3b0676,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5cd584){return formatter(_0x3b0676,_0x5cd584);}}),new winston[(_0x6a75('0x10'))]['File']({'name':util[_0x6a75('0x6')]('%s-%s',_0x3b0676,'info'),'filename':filename(_0x3b0676,_0x6a75('0x13')),'level':_0x6a75('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1dc321){return formatter(_0x3b0676,_0x1dc321);}}),new winston['transports'][(_0x6a75('0x14'))]({'level':process[_0x6a75('0x15')][_0x6a75('0x16')]||debugLevel,'json':![],'formatter':function(_0x6d4051){return formatter(_0x3b0676,_0x6d4051);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 3547100..fcaae53 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 _0x8b33=['join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x8b33,0x9a));var _0x38b3=function(_0x59b479,_0x5b6286){_0x59b479=_0x59b479-0x0;var _0x1c374c=_0x8b33[_0x59b479];return _0x1c374c;};'use strict';var path=require(_0x38b3('0x0'));var os=require('os');var config={'apps':[{'name':_0x38b3('0x1'),'script':path[_0x38b3('0x2')](__dirname,_0x38b3('0x3'))},{'name':_0x38b3('0x4'),'script':path[_0x38b3('0x2')](__dirname,_0x38b3('0x5'))},{'name':'agi','script':path['join'](__dirname,_0x38b3('0x6'))},{'name':_0x38b3('0x7'),'script':path[_0x38b3('0x2')](__dirname,_0x38b3('0x8'))},{'name':_0x38b3('0x9'),'script':path[_0x38b3('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x38b3('0xa'),'script':path['join'](__dirname,_0x38b3('0xb'))}]};module[_0x38b3('0xc')]=config; \ No newline at end of file +var _0x3695=['../../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','join','../../services/express/index.js','ami'];(function(_0x474f47,_0x2303b7){var _0x21bfe6=function(_0x1121d1){while(--_0x1121d1){_0x474f47['push'](_0x474f47['shift']());}};_0x21bfe6(++_0x2303b7);}(_0x3695,0x168));var _0x5369=function(_0x3eefe0,_0x4b49c8){_0x3eefe0=_0x3eefe0-0x0;var _0x662e3d=_0x3695[_0x3eefe0];return _0x662e3d;};'use strict';var path=require(_0x5369('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x5369('0x1')](__dirname,_0x5369('0x2'))},{'name':_0x5369('0x3'),'script':path[_0x5369('0x1')](__dirname,_0x5369('0x4'))},{'name':_0x5369('0x5'),'script':path[_0x5369('0x1')](__dirname,_0x5369('0x6'))},{'name':_0x5369('0x7'),'script':path[_0x5369('0x1')](__dirname,_0x5369('0x8'))},{'name':_0x5369('0x9'),'script':path[_0x5369('0x1')](__dirname,_0x5369('0xa'))},{'name':_0x5369('0xb'),'script':path[_0x5369('0x1')](__dirname,_0x5369('0xc'))}]};module[_0x5369('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f830975..ad9e0da 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 _0x1320=['list','describe','delete','dump','saved','./config','connect','connected','start','disconnect','stop','then','restart'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1320,0x1a5));var _0x0132=function(_0x1ba704,_0x58e5de){_0x1ba704=_0x1ba704-0x0;var _0x43c3d9=_0x1320[_0x1ba704];return _0x43c3d9;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x0132('0x0'));function connect(){return new BPromise(function(_0x293672,_0x4165a3){return pm2[_0x0132('0x1')](function(_0x6ebfec){if(_0x6ebfec){return _0x4165a3(_0x6ebfec);}return _0x293672(_0x0132('0x2'));});});};exports[_0x0132('0x3')]=function(_0x3a141d){return connect()['then'](function(){return new BPromise(function(_0x20a9f4,_0x4a4423){return pm2[_0x0132('0x3')](_0x3a141d,function(_0x3aec7e,_0x31e3b3){if(_0x3aec7e){return _0x4a4423(_0x3aec7e);}pm2[_0x0132('0x4')]();return _0x20a9f4(_0x31e3b3);});});});};exports[_0x0132('0x5')]=function(_0x9b18fc){return connect()[_0x0132('0x6')](function(){return new BPromise(function(_0x4b496c,_0x50a8e6){return pm2[_0x0132('0x5')](_0x9b18fc,function(_0x579f7d,_0xbe12c3){if(_0x579f7d){return _0x50a8e6(_0x579f7d);}pm2[_0x0132('0x4')]();return _0x4b496c(_0xbe12c3);});});});};exports[_0x0132('0x7')]=function(_0x451982){return connect()[_0x0132('0x6')](function(){return new BPromise(function(_0x4246e6,_0x206002){return pm2['restart'](_0x451982,function(_0xc00793,_0x5ad5e3){if(_0xc00793){return _0x206002(_0xc00793);}pm2[_0x0132('0x4')]();return _0x4246e6(_0x5ad5e3);});});});};exports[_0x0132('0x8')]=function(){return connect()[_0x0132('0x6')](function(){return new BPromise(function(_0x283444,_0x2d9ed4){return pm2[_0x0132('0x8')](function(_0x3f07a3,_0x3b933b){if(_0x3f07a3){return _0x2d9ed4(_0x3f07a3);}pm2[_0x0132('0x4')]();return _0x283444(_0x3b933b);});});});};exports['describe']=function(_0x1ee1cb){return connect()[_0x0132('0x6')](function(){return new BPromise(function(_0x4797b4,_0x18328d){return pm2[_0x0132('0x9')](_0x1ee1cb,function(_0x522e97,_0x311d01){if(_0x522e97){return _0x18328d(_0x522e97);}pm2['disconnect']();return _0x4797b4(_0x311d01);});});});};exports['delete']=function(_0x51e801){return connect()[_0x0132('0x6')](function(){return new BPromise(function(_0x3387e7,_0x39a7b3){return pm2[_0x0132('0xa')](_0x51e801,function(_0x2180a2,_0x281a4b){if(_0x2180a2){return _0x39a7b3(_0x2180a2);}pm2['disconnect']();return _0x3387e7(_0x281a4b);});});});};exports[_0x0132('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1c4c71,_0xf1e607){return pm2['dump'](function(_0x412cd7){if(_0x412cd7){return _0xf1e607(_0x412cd7);}return _0x1c4c71(_0x0132('0xc'));});});});}; \ No newline at end of file +var _0x1276=['pm2','bluebird','connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x433fce,_0x3151bb){var _0x3dc611=function(_0x38dcc1){while(--_0x38dcc1){_0x433fce['push'](_0x433fce['shift']());}};_0x3dc611(++_0x3151bb);}(_0x1276,0xe0));var _0x6127=function(_0x1a0a17,_0x3ea574){_0x1a0a17=_0x1a0a17-0x0;var _0x35abea=_0x1276[_0x1a0a17];return _0x35abea;};'use strict';var pm2=require(_0x6127('0x0'));var BPromise=require(_0x6127('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x158b2b,_0x5c73a7){return pm2[_0x6127('0x2')](function(_0x3e2bd6){if(_0x3e2bd6){return _0x5c73a7(_0x3e2bd6);}return _0x158b2b(_0x6127('0x3'));});});};exports['start']=function(_0x48e648){return connect()[_0x6127('0x4')](function(){return new BPromise(function(_0xdea325,_0x39f416){return pm2[_0x6127('0x5')](_0x48e648,function(_0x1bf853,_0x2ea036){if(_0x1bf853){return _0x39f416(_0x1bf853);}pm2[_0x6127('0x6')]();return _0xdea325(_0x2ea036);});});});};exports[_0x6127('0x7')]=function(_0x4715f8){return connect()[_0x6127('0x4')](function(){return new BPromise(function(_0x253456,_0x5c7c1d){return pm2[_0x6127('0x7')](_0x4715f8,function(_0x422de3,_0x1df915){if(_0x422de3){return _0x5c7c1d(_0x422de3);}pm2['disconnect']();return _0x253456(_0x1df915);});});});};exports[_0x6127('0x8')]=function(_0xa95d2c){return connect()[_0x6127('0x4')](function(){return new BPromise(function(_0x11c0fa,_0x50fc9f){return pm2[_0x6127('0x8')](_0xa95d2c,function(_0x354bb5,_0x1d96d8){if(_0x354bb5){return _0x50fc9f(_0x354bb5);}pm2[_0x6127('0x6')]();return _0x11c0fa(_0x1d96d8);});});});};exports[_0x6127('0x9')]=function(){return connect()[_0x6127('0x4')](function(){return new BPromise(function(_0x13cd8b,_0x3247ef){return pm2[_0x6127('0x9')](function(_0xed0d52,_0x4f3de1){if(_0xed0d52){return _0x3247ef(_0xed0d52);}pm2[_0x6127('0x6')]();return _0x13cd8b(_0x4f3de1);});});});};exports[_0x6127('0xa')]=function(_0x2efff5){return connect()[_0x6127('0x4')](function(){return new BPromise(function(_0x22587a,_0x310d60){return pm2[_0x6127('0xa')](_0x2efff5,function(_0x3e35ca,_0x100029){if(_0x3e35ca){return _0x310d60(_0x3e35ca);}pm2[_0x6127('0x6')]();return _0x22587a(_0x100029);});});});};exports[_0x6127('0xb')]=function(_0x233693){return connect()['then'](function(){return new BPromise(function(_0x19bb2c,_0x26c9da){return pm2[_0x6127('0xb')](_0x233693,function(_0x5c1535,_0x1fd156){if(_0x5c1535){return _0x26c9da(_0x5c1535);}pm2[_0x6127('0x6')]();return _0x19bb2c(_0x1fd156);});});});};exports[_0x6127('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x238ae7,_0x467e30){return pm2[_0x6127('0xc')](function(_0x30d90a){if(_0x30d90a){return _0x467e30(_0x30d90a);}return _0x238ae7(_0x6127('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a1ce7a8..4a75194 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 _0x0e89=['start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x1c3871,_0x290d71){var _0x40be9b=function(_0x5571b9){while(--_0x5571b9){_0x1c3871['push'](_0x1c3871['shift']());}};_0x40be9b(++_0x290d71);}(_0x0e89,0x7d));var _0x90e8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0e89[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x90e8('0x0'));var moment=require(_0x90e8('0x1'));var Redis=require('ioredis');var util=require(_0x90e8('0x2'));var config=require(_0x90e8('0x3'));var db=require(_0x90e8('0x4'))['db'];var logger=require('../logger')(_0x90e8('0x5'));config['redis']=_[_0x90e8('0x6')](config[_0x90e8('0x7')],{'host':_0x90e8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90e8('0x7')]));function closeInteractions(){var _0x2f9add=0x0;var _0x5807b5=[];return db['Setting'][_0x90e8('0x9')]({'raw':!![],'attributes':['id',_0x90e8('0xa')],'where':{'id':0x1}})[_0x90e8('0xb')](function(_0x1ddbaf){_0x2f9add=_0x1ddbaf[_0x90e8('0xa')];if(_0x2f9add){return db[_0x90e8('0xc')][_0x90e8('0xd')]({'raw':!![],'attributes':['id',_0x90e8('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x90e8('0xf')](_0x1ddbaf['chatTimeout'],'minutes')}}});}else{return[];}})['then'](function(_0x269fcf){if(_0x269fcf&&_0x269fcf[_0x90e8('0x10')]){_0x5807b5=_['map'](_0x269fcf||[],'id');logger[_0x90e8('0x11')](_0x90e8('0x12'),_0x5807b5[_0x90e8('0x13')]());return db[_0x90e8('0xc')][_0x90e8('0x14')]({'closeReason':_0x90e8('0x15'),'disposition':_0x90e8('0x16'),'closed':!![],'closedAt':moment()['format'](_0x90e8('0x17'))},{'where':{'id':_0x5807b5}});}})[_0x90e8('0xb')](function(){if(_0x5807b5&&_0x5807b5[_0x90e8('0x10')]){logger[_0x90e8('0x11')](_0x90e8('0x18'),_0x5807b5[_0x90e8('0x13')]());for(var _0x481d7a=0x0;_0x481d7a<_0x5807b5[_0x90e8('0x10')];_0x481d7a++){io[_0x90e8('0x19')](_0x90e8('0x1a'),{'id':_0x5807b5[_0x481d7a],'closed':!![]});}}})['catch'](function(_0x10b92c){logger[_0x90e8('0x1b')](_0x90e8('0x1c'),_0x10b92c?util[_0x90e8('0x1d')](_0x10b92c,{'showHidden':![],'depth':null}):'');});}exports[_0x90e8('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x876e=['findAll','subtract','minutes','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','start','moment','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction'];(function(_0x276c38,_0x3bb7d9){var _0x5c3a1e=function(_0x26d1c1){while(--_0x26d1c1){_0x276c38['push'](_0x276c38['shift']());}};_0x5c3a1e(++_0x3bb7d9);}(_0x876e,0xef));var _0xe876=function(_0x1f73ef,_0x3518e7){_0x1f73ef=_0x1f73ef-0x0;var _0x46b785=_0x876e[_0x1f73ef];return _0x46b785;};'use strict';var _=require('lodash');var moment=require(_0xe876('0x0'));var Redis=require(_0xe876('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0xe876('0x2'))['db'];var logger=require(_0xe876('0x3'))(_0xe876('0x4'));config[_0xe876('0x5')]=_[_0xe876('0x6')](config[_0xe876('0x5')],{'host':_0xe876('0x7'),'port':0x18eb});var io=require(_0xe876('0x8'))(new Redis(config[_0xe876('0x5')]));function closeInteractions(){var _0x59c48a=0x0;var _0x496fba=[];return db['Setting'][_0xe876('0x9')]({'raw':!![],'attributes':['id',_0xe876('0xa')],'where':{'id':0x1}})[_0xe876('0xb')](function(_0x312eea){_0x59c48a=_0x312eea['chatTimeout'];if(_0x59c48a){return db[_0xe876('0xc')][_0xe876('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe876('0xe')](_0x312eea[_0xe876('0xa')],_0xe876('0xf'))}}});}else{return[];}})[_0xe876('0xb')](function(_0x2e5495){if(_0x2e5495&&_0x2e5495[_0xe876('0x10')]){_0x496fba=_[_0xe876('0x11')](_0x2e5495||[],'id');logger[_0xe876('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x496fba[_0xe876('0x13')]());return db[_0xe876('0xc')][_0xe876('0x14')]({'closeReason':_0xe876('0x15'),'disposition':_0xe876('0x16'),'closed':!![],'closedAt':moment()[_0xe876('0x17')](_0xe876('0x18'))},{'where':{'id':_0x496fba}});}})['then'](function(){if(_0x496fba&&_0x496fba['length']){logger[_0xe876('0x12')](_0xe876('0x19'),_0x496fba[_0xe876('0x13')]());for(var _0x42e350=0x0;_0x42e350<_0x496fba[_0xe876('0x10')];_0x42e350++){io['emit'](_0xe876('0x1a'),{'id':_0x496fba[_0x42e350],'closed':!![]});}}})['catch'](function(_0x468b3e){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x468b3e?util['inspect'](_0x468b3e,{'showHidden':![],'depth':null}):'');});}exports[_0xe876('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 7f0b8cd..e05a4ef 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 _0xd794=['catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','exists','deleteJob','stop\x20cron','active','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd794,0x1b5));var _0x4d79=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd794[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var util=require(_0x4d79('0x0'));var path=require('path');var _=require(_0x4d79('0x1'));var moment=require('moment');var CronJobManager=require(_0x4d79('0x2'));var jayson=require(_0x4d79('0x3'));var BPromise=require(_0x4d79('0x4'));var logger=require(_0x4d79('0x5'))(_0x4d79('0x6'));var db=require(_0x4d79('0x7'))['db'];var analyticCustomReportController=require(_0x4d79('0x8'));var analyticDefaultReportController=require(_0x4d79('0x9'));var client=jayson[_0x4d79('0xa')][_0x4d79('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4a7dec,_0x400999){return function(){logger['info'](_0x4d79('0xc'),_0x4a7dec[_0x4d79('0xd')]);var _0x4197a6=!![];var _0x263ab7={'tls':{'rejectUnauthorized':![]}};if(_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')][_0x4d79('0x10')]){_0x263ab7[_0x4d79('0x10')]=_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')]['service'];}else{_0x263ab7[_0x4d79('0x11')]=_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')][_0x4d79('0x11')];_0x263ab7[_0x4d79('0x12')]=_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')][_0x4d79('0x12')];_0x263ab7[_0x4d79('0x13')]=_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')][_0x4d79('0x13')];}if(_0x4a7dec['MailAccount']['Smtp'][_0x4d79('0x14')]){_0x263ab7['auth']={'user':_0x4a7dec[_0x4d79('0xe')]['Smtp'][_0x4d79('0x15')],'pass':_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')]['pass']};}var _0x342e28={'account':_0x263ab7,'message':{'from':util[_0x4d79('0x16')](_0x4d79('0x17'),_0x4a7dec['MailAccount'][_0x4d79('0x18')],_0x4a7dec['MailAccount'][_0x4d79('0xd')]||_0x4a7dec[_0x4d79('0xe')][_0x4d79('0xf')][_0x4d79('0x15')]),'to':_0x4a7dec['email'],'cc':_0x4a7dec['cc'],'bcc':_0x4a7dec[_0x4d79('0x19')],'subject':util[_0x4d79('0x16')](_0x4d79('0x1a'),_0x400999[_0x4d79('0x18')],_0x4a7dec[_0x4d79('0x1b')],_0x4a7dec[_0x4d79('0x1c')])}};var _0x484946=path['join'](__dirname,_0x4d79('0x1d'));var _0x2e3eb1=_0x400999[_0x4d79('0x1e')];var _0x533c46=util[_0x4d79('0x16')](_0x4d79('0x1f'),path[_0x4d79('0x20')](_0x400999[_0x4d79('0x1e')],path[_0x4d79('0x21')](_0x400999['savename'])),_0x4d79('0x22'));var _0x1bc0a5=path[_0x4d79('0x23')](_0x484946,_0x2e3eb1);var _0x22114e=path[_0x4d79('0x23')](_0x484946,_0x533c46);if(fs[_0x4d79('0x24')](_0x1bc0a5)){_0x400999[_0x4d79('0x25')]=_0x4d79('0x26');_0x342e28['message'][_0x4d79('0x27')]=[{'filename':_0x2e3eb1,'path':_0x1bc0a5}];_0x342e28[_0x4d79('0x28')][_0x4d79('0x29')]=util[_0x4d79('0x16')](_0x4d79('0x2a'),JSON[_0x4d79('0x2b')](_0x400999,null,0x2));}else if(fs[_0x4d79('0x24')](_0x22114e)){_0x400999[_0x4d79('0x25')]='Sent';_0x342e28[_0x4d79('0x28')][_0x4d79('0x27')]=[{'filename':_0x533c46,'path':_0x22114e}];}else{_0x342e28[_0x4d79('0x28')][_0x4d79('0x29')]=_0x4d79('0x2c');if(!_0x4a7dec[_0x4d79('0x2d')]){_0x4197a6=![];logger[_0x4d79('0x2e')](_0x4d79('0x2f'));}}if(_0x4197a6){return client[_0x4d79('0x30')](_0x4d79('0x31'),_0x342e28)['then'](function(_0x1930a2){if(_0x1930a2['error']){return logger[_0x4d79('0x32')](_0x4d79('0x33'),JSON[_0x4d79('0x2b')](_0x1930a2));}return logger[_0x4d79('0x2e')](_0x4d79('0x34'));})[_0x4d79('0x35')](function(_0x23c351){return logger[_0x4d79('0x32')](_0x4d79('0x33'),JSON[_0x4d79('0x2b')](_0x23c351));});}};}function handleError(){return function(_0x7201c1){return logger[_0x4d79('0x32')](JSON['stringify'](_0x7201c1));};}function handleResult(_0x3e8f5f){return function(_0x376139){logger[_0x4d79('0x2e')](_0x4d79('0x36'),JSON[_0x4d79('0x2b')](_0x376139));if(_0x3e8f5f[_0x4d79('0xe')]&&_0x3e8f5f['MailAccount'][_0x4d79('0xf')]&&!_[_0x4d79('0x37')](_0x3e8f5f['email'])){setTimeout(handleSendEmail(_0x3e8f5f,_0x376139),0x3c*0x3e8);}};}function handleJob(_0x27d0db){return function(){try{if(_[_0x4d79('0x37')](_0x27d0db[_0x4d79('0x1b')])){return logger[_0x4d79('0x2e')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x27d0db[_0x4d79('0x1c')])){return logger['info'](_0x4d79('0x38'));}var _0x183021={'startDate':moment()[_0x4d79('0x39')](_0x27d0db[_0x4d79('0x1b')],_0x27d0db['subtractUnit'])[_0x4d79('0x16')](_0x4d79('0x3a')),'endDate':moment()[_0x4d79('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x4d79('0x3b'),'output':_0x27d0db[_0x4d79('0x3c')],'name':_0x27d0db[_0x4d79('0x18')]};if(!_[_0x4d79('0x37')](_0x27d0db[_0x4d79('0x3d')])){logger[_0x4d79('0x2e')](_0x4d79('0x3e'),_0x27d0db[_0x4d79('0x3d')]);return analyticDefaultReportController[_0x4d79('0x3f')]({'id':_0x27d0db[_0x4d79('0x3d')]},_0x183021)[_0x4d79('0x40')](handleResult(_0x27d0db))['catch'](handleError());}if(!_[_0x4d79('0x37')](_0x27d0db['CustomReportId'])){logger[_0x4d79('0x2e')]('exec\x20custom\x20report\x20id:%s',_0x27d0db[_0x4d79('0x41')]);return analyticCustomReportController[_0x4d79('0x3f')]({'id':_0x27d0db[_0x4d79('0x41')]},_0x183021)[_0x4d79('0x40')](handleResult(_0x27d0db))[_0x4d79('0x35')](handleError());}}catch(_0x9fbc70){logger['error'](JSON[_0x4d79('0x2b')](_0x9fbc70));}return logger['info'](_0x4d79('0x42'));};}function getJobs(_0x1681c7){var _0x139c42={};if(_0x1681c7){_0x139c42['id']=_0x1681c7;}return db['Schedule'][_0x4d79('0x43')]({'where':_0x139c42,'include':[{'model':db[_0x4d79('0xe')],'attributes':['id',_0x4d79('0x18'),_0x4d79('0xd')],'include':[{'model':db[_0x4d79('0x44')],'as':_0x4d79('0xf')}]}]})['then'](function(_0x284f43){var _0x4dc459=_[_0x4d79('0x45')](manager[_0x4d79('0x46')]);var _0xbfcb35=_[_0x4d79('0x47')](_0x284f43,function(_0x88f31){return _0x88f31['id']['toString']();});var _0x25c776=_[_0x4d79('0x48')](_0x284f43,function(_0x5e2fc4){return _0x5e2fc4['id'][_0x4d79('0x49')]();});var _0x39f3d3=_0x1681c7?_0xbfcb35:_[_0x4d79('0x4a')](_0xbfcb35,_0x4dc459);var _0x113ec1=_[_0x4d79('0x4b')](_0xbfcb35,_0x4dc459);var _0x48f925=_[_0x4d79('0x4a')](_0x4dc459,_0xbfcb35);var _0x1147f1;var _0x484954;for(_0x1147f1=0x0;_0x1147f1<_0x48f925[_0x4d79('0x4c')]&&!_0x1681c7;_0x1147f1+=0x1){_0x484954=_0x48f925[_0x1147f1][_0x4d79('0x49')]();if(manager['exists'](_0x484954)){manager[_0x4d79('0x4d')](_0x484954);manager['deleteJob'](_0x484954);logger['info'](_0x4d79('0x4e'),_0x484954);}}logger[_0x4d79('0x2e')](_0x4d79('0x4f'),JSON[_0x4d79('0x2b')](_0x39f3d3));for(_0x1147f1=0x0;_0x1147f1<_0x39f3d3['length'];_0x1147f1+=0x1){_0x484954=_0x39f3d3[_0x1147f1]['toString']();logger[_0x4d79('0x2e')](_0x4d79('0x50'),_0x484954);if(_0x1681c7){logger['info'](_0x4d79('0x51'),_0x1681c7);logger[_0x4d79('0x2e')](JSON[_0x4d79('0x2b')](_0x25c776[_0x484954]));BPromise[_0x4d79('0x52')]()['then'](handleJob(_0x25c776[_0x484954]));logger['info'](_0x4d79('0x53'),_0x25c776[_0x484954][_0x4d79('0x18')],_0x25c776[_0x484954]['cron']);}else if(_0x25c776[_0x484954][_0x4d79('0x54')]&&_0x25c776[_0x484954]['active']&&moment()[_0x4d79('0x55')](_0x25c776[_0x484954][_0x4d79('0x56')],_0x25c776[_0x484954][_0x4d79('0x57')])){manager[_0x4d79('0x58')](_0x484954,_0x25c776[_0x484954][_0x4d79('0x54')],handleJob(_0x25c776[_0x484954]));manager[_0x4d79('0x59')](_0x484954);logger[_0x4d79('0x2e')](_0x4d79('0x5a'),_0x25c776[_0x484954][_0x4d79('0x18')],_0x25c776[_0x484954][_0x4d79('0x54')]);}else if(manager[_0x4d79('0x5b')](_0x484954)){manager[_0x4d79('0x4d')](_0x484954);manager[_0x4d79('0x5c')](_0x484954);logger[_0x4d79('0x2e')](_0x4d79('0x5d'),_0x25c776[_0x484954][_0x4d79('0x18')],_0x25c776[_0x484954][_0x4d79('0x54')]);}}for(_0x1147f1=0x0,_0x484954;_0x1147f1<_0x113ec1[_0x4d79('0x4c')]&&!_0x1681c7;_0x1147f1+=0x1){_0x484954=_0x113ec1[_0x1147f1][_0x4d79('0x49')]();if(manager['exists'](_0x484954)){if(_0x25c776[_0x484954][_0x4d79('0x54')]&&_0x25c776[_0x484954][_0x4d79('0x5e')]&&moment()[_0x4d79('0x55')](_0x25c776[_0x484954][_0x4d79('0x56')],_0x25c776[_0x484954]['endAt'])){manager[_0x4d79('0x5f')](_0x484954,_0x25c776[_0x484954]['cron'],handleJob(_0x25c776[_0x484954]));logger[_0x4d79('0x2e')](_0x4d79('0x60'),_0x25c776[_0x484954][_0x4d79('0x18')],_0x25c776[_0x484954][_0x4d79('0x54')]);}else{manager['stop'](_0x484954);manager[_0x4d79('0x5c')](_0x484954);logger[_0x4d79('0x2e')](_0x4d79('0x5d'),_0x25c776[_0x484954][_0x4d79('0x18')],_0x25c776[_0x484954][_0x4d79('0x54')]);}}}})[_0x4d79('0x35')](function(_0x115fd3){logger[_0x4d79('0x32')](JSON['stringify'](_0x115fd3));});}exports[_0x4d79('0x61')]=function(_0x32f334){return getJobs(_0x32f334);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9846=['CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','difference','intersection','length','exists','stop','deleteJob','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s'];(function(_0x20069c,_0x1eae4a){var _0xcc665a=function(_0x4717bc){while(--_0x4717bc){_0x20069c['push'](_0x20069c['shift']());}};_0xcc665a(++_0x1eae4a);}(_0x9846,0x130));var _0x6984=function(_0x30e67b,_0x540b1e){_0x30e67b=_0x30e67b-0x0;var _0xcd1e56=_0x9846[_0x30e67b];return _0xcd1e56;};'use strict';var fs=require('fs');var util=require(_0x6984('0x0'));var path=require(_0x6984('0x1'));var _=require(_0x6984('0x2'));var moment=require(_0x6984('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x6984('0x4'));var logger=require(_0x6984('0x5'))(_0x6984('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x6984('0x7'));var analyticDefaultReportController=require(_0x6984('0x8'));var client=jayson[_0x6984('0x9')][_0x6984('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e01da,_0x1b7084){return function(){logger[_0x6984('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x1e01da[_0x6984('0xc')]);var _0x48368d=!![];var _0x457282={'tls':{'rejectUnauthorized':![]}};if(_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0xf')]){_0x457282[_0x6984('0xf')]=_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0xf')];}else{_0x457282[_0x6984('0x10')]=_0x1e01da[_0x6984('0xd')][_0x6984('0xe')]['host'];_0x457282[_0x6984('0x11')]=_0x1e01da[_0x6984('0xd')]['Smtp'][_0x6984('0x11')];_0x457282[_0x6984('0x12')]=_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0x12')];}if(_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0x13')]){_0x457282[_0x6984('0x14')]={'user':_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0x15')],'pass':_0x1e01da['MailAccount'][_0x6984('0xe')][_0x6984('0x16')]};}var _0x2512ed={'account':_0x457282,'message':{'from':util['format'](_0x6984('0x17'),_0x1e01da['MailAccount'][_0x6984('0x18')],_0x1e01da['MailAccount'][_0x6984('0xc')]||_0x1e01da[_0x6984('0xd')][_0x6984('0xe')][_0x6984('0x15')]),'to':_0x1e01da['email'],'cc':_0x1e01da['cc'],'bcc':_0x1e01da['bcc'],'subject':util[_0x6984('0x19')](_0x6984('0x1a'),_0x1b7084[_0x6984('0x18')],_0x1e01da[_0x6984('0x1b')],_0x1e01da['subtractUnit'])}};var _0x31f52f=path[_0x6984('0x1c')](__dirname,_0x6984('0x1d'));var _0x44027f=_0x1b7084[_0x6984('0x1e')];var _0x4a80ca=util[_0x6984('0x19')](_0x6984('0x1f'),path[_0x6984('0x20')](_0x1b7084[_0x6984('0x1e')],path['extname'](_0x1b7084[_0x6984('0x1e')])),_0x6984('0x21'));var _0x5bba56=path[_0x6984('0x1c')](_0x31f52f,_0x44027f);var _0x33e299=path['join'](_0x31f52f,_0x4a80ca);if(fs[_0x6984('0x22')](_0x5bba56)){_0x1b7084[_0x6984('0x23')]=_0x6984('0x24');_0x2512ed[_0x6984('0x25')][_0x6984('0x26')]=[{'filename':_0x44027f,'path':_0x5bba56}];_0x2512ed[_0x6984('0x25')][_0x6984('0x27')]=util[_0x6984('0x19')](_0x6984('0x28'),JSON[_0x6984('0x29')](_0x1b7084,null,0x2));}else if(fs[_0x6984('0x22')](_0x33e299)){_0x1b7084[_0x6984('0x23')]='Sent';_0x2512ed[_0x6984('0x25')][_0x6984('0x26')]=[{'filename':_0x4a80ca,'path':_0x33e299}];}else{_0x2512ed[_0x6984('0x25')][_0x6984('0x27')]=_0x6984('0x2a');if(!_0x1e01da[_0x6984('0x2b')]){_0x48368d=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x48368d){return client[_0x6984('0x2c')](_0x6984('0x2d'),_0x2512ed)['then'](function(_0x1bb043){if(_0x1bb043['error']){return logger[_0x6984('0x2e')]('error\x20mail',JSON[_0x6984('0x29')](_0x1bb043));}return logger[_0x6984('0xb')](_0x6984('0x2f'));})[_0x6984('0x30')](function(_0x11ec58){return logger[_0x6984('0x2e')](_0x6984('0x31'),JSON[_0x6984('0x29')](_0x11ec58));});}};}function handleError(){return function(_0xa4950c){return logger[_0x6984('0x2e')](JSON['stringify'](_0xa4950c));};}function handleResult(_0x3da15c){return function(_0x4dc85f){logger[_0x6984('0xb')](_0x6984('0x32'),JSON[_0x6984('0x29')](_0x4dc85f));if(_0x3da15c[_0x6984('0xd')]&&_0x3da15c[_0x6984('0xd')][_0x6984('0xe')]&&!_[_0x6984('0x33')](_0x3da15c[_0x6984('0xc')])){setTimeout(handleSendEmail(_0x3da15c,_0x4dc85f),0x3c*0x3e8);}};}function handleJob(_0x3597d6){return function(){try{if(_[_0x6984('0x33')](_0x3597d6[_0x6984('0x1b')])){return logger['info'](_0x6984('0x34'));}if(_['isNil'](_0x3597d6[_0x6984('0x35')])){return logger[_0x6984('0xb')](_0x6984('0x36'));}var _0x217e25={'startDate':moment()[_0x6984('0x37')](_0x3597d6[_0x6984('0x1b')],_0x3597d6[_0x6984('0x35')])[_0x6984('0x19')](_0x6984('0x38')),'endDate':moment()[_0x6984('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x6984('0x39'),'output':_0x3597d6[_0x6984('0x3a')],'name':_0x3597d6[_0x6984('0x18')]};if(!_['isNil'](_0x3597d6[_0x6984('0x3b')])){logger[_0x6984('0xb')](_0x6984('0x3c'),_0x3597d6[_0x6984('0x3b')]);return analyticDefaultReportController[_0x6984('0x3d')]({'id':_0x3597d6[_0x6984('0x3b')]},_0x217e25)[_0x6984('0x3e')](handleResult(_0x3597d6))['catch'](handleError());}if(!_[_0x6984('0x33')](_0x3597d6['CustomReportId'])){logger[_0x6984('0xb')](_0x6984('0x3f'),_0x3597d6[_0x6984('0x40')]);return analyticCustomReportController['runReport']({'id':_0x3597d6[_0x6984('0x40')]},_0x217e25)[_0x6984('0x3e')](handleResult(_0x3597d6))[_0x6984('0x30')](handleError());}}catch(_0x12a4b7){logger['error'](JSON['stringify'](_0x12a4b7));}return logger[_0x6984('0xb')](_0x6984('0x41'));};}function getJobs(_0xcc61c3){var _0xac055d={};if(_0xcc61c3){_0xac055d['id']=_0xcc61c3;}return db[_0x6984('0x42')][_0x6984('0x43')]({'where':_0xac055d,'include':[{'model':db[_0x6984('0xd')],'attributes':['id',_0x6984('0x18'),_0x6984('0xc')],'include':[{'model':db[_0x6984('0x44')],'as':_0x6984('0xe')}]}]})[_0x6984('0x3e')](function(_0x3e1972){var _0x55379b=_[_0x6984('0x45')](manager['jobs']);var _0x2b5b2e=_[_0x6984('0x46')](_0x3e1972,function(_0x3cb9b6){return _0x3cb9b6['id'][_0x6984('0x47')]();});var _0x6d326c=_['keyBy'](_0x3e1972,function(_0x1823ed){return _0x1823ed['id'][_0x6984('0x47')]();});var _0x107aaf=_0xcc61c3?_0x2b5b2e:_[_0x6984('0x48')](_0x2b5b2e,_0x55379b);var _0x581da0=_[_0x6984('0x49')](_0x2b5b2e,_0x55379b);var _0x5a3564=_[_0x6984('0x48')](_0x55379b,_0x2b5b2e);var _0x14e4bb;var _0x38fad4;for(_0x14e4bb=0x0;_0x14e4bb<_0x5a3564[_0x6984('0x4a')]&&!_0xcc61c3;_0x14e4bb+=0x1){_0x38fad4=_0x5a3564[_0x14e4bb][_0x6984('0x47')]();if(manager[_0x6984('0x4b')](_0x38fad4)){manager[_0x6984('0x4c')](_0x38fad4);manager[_0x6984('0x4d')](_0x38fad4);logger[_0x6984('0xb')]('delete\x20cron',_0x38fad4);}}logger[_0x6984('0xb')]('toRun',JSON['stringify'](_0x107aaf));for(_0x14e4bb=0x0;_0x14e4bb<_0x107aaf['length'];_0x14e4bb+=0x1){_0x38fad4=_0x107aaf[_0x14e4bb][_0x6984('0x47')]();logger['info']('index',_0x38fad4);if(_0xcc61c3){logger[_0x6984('0xb')](_0x6984('0x4e'),_0xcc61c3);logger['info'](JSON[_0x6984('0x29')](_0x6d326c[_0x38fad4]));BPromise[_0x6984('0x4f')]()[_0x6984('0x3e')](handleJob(_0x6d326c[_0x38fad4]));logger[_0x6984('0xb')]('run\x20job',_0x6d326c[_0x38fad4][_0x6984('0x18')],_0x6d326c[_0x38fad4][_0x6984('0x50')]);}else if(_0x6d326c[_0x38fad4][_0x6984('0x50')]&&_0x6d326c[_0x38fad4][_0x6984('0x51')]&&moment()[_0x6984('0x52')](_0x6d326c[_0x38fad4][_0x6984('0x53')],_0x6d326c[_0x38fad4][_0x6984('0x54')])){manager[_0x6984('0x55')](_0x38fad4,_0x6d326c[_0x38fad4][_0x6984('0x50')],handleJob(_0x6d326c[_0x38fad4]));manager[_0x6984('0x56')](_0x38fad4);logger[_0x6984('0xb')](_0x6984('0x57'),_0x6d326c[_0x38fad4][_0x6984('0x18')],_0x6d326c[_0x38fad4]['cron']);}else if(manager[_0x6984('0x4b')](_0x38fad4)){manager[_0x6984('0x4c')](_0x38fad4);manager[_0x6984('0x4d')](_0x38fad4);logger[_0x6984('0xb')]('stop\x20cron',_0x6d326c[_0x38fad4][_0x6984('0x18')],_0x6d326c[_0x38fad4][_0x6984('0x50')]);}}for(_0x14e4bb=0x0,_0x38fad4;_0x14e4bb<_0x581da0[_0x6984('0x4a')]&&!_0xcc61c3;_0x14e4bb+=0x1){_0x38fad4=_0x581da0[_0x14e4bb][_0x6984('0x47')]();if(manager[_0x6984('0x4b')](_0x38fad4)){if(_0x6d326c[_0x38fad4][_0x6984('0x50')]&&_0x6d326c[_0x38fad4][_0x6984('0x51')]&&moment()[_0x6984('0x52')](_0x6d326c[_0x38fad4][_0x6984('0x53')],_0x6d326c[_0x38fad4][_0x6984('0x54')])){manager[_0x6984('0x58')](_0x38fad4,_0x6d326c[_0x38fad4][_0x6984('0x50')],handleJob(_0x6d326c[_0x38fad4]));logger[_0x6984('0xb')](_0x6984('0x59'),_0x6d326c[_0x38fad4][_0x6984('0x18')],_0x6d326c[_0x38fad4]['cron']);}else{manager[_0x6984('0x4c')](_0x38fad4);manager[_0x6984('0x4d')](_0x38fad4);logger['info'](_0x6984('0x5a'),_0x6d326c[_0x38fad4]['name'],_0x6d326c[_0x38fad4][_0x6984('0x50')]);}}}})[_0x6984('0x30')](function(_0x87fa5d){logger[_0x6984('0x2e')](JSON[_0x6984('0x29')](_0x87fa5d));});}exports[_0x6984('0x5b')]=function(_0x35bb0f){return getJobs(_0x35bb0f);};exports[_0x6984('0x56')]=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 21a3805..1b107b7 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 _0xf46a=['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','forEach','push','all','start','lodash','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','resolve','Sentiment'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xf46a,0xa4));var _0xaf46=function(_0x1eb560,_0x3f856b){_0x1eb560=_0x1eb560-0x0;var _0x47df96=_0xf46a[_0x1eb560];return _0x47df96;};var _=require(_0xaf46('0x0'));var AWS=require('aws-sdk');var rp=require(_0xaf46('0x1'));var util=require(_0xaf46('0x2'));var BPromise=require('bluebird');var db=require(_0xaf46('0x3'))['db'];var logger=require(_0xaf46('0x4'))(_0xaf46('0x5'));function getTranscriptionJob(_0x14a6b6,_0x34c69d,_0xb39163,_0x35f997){return new Promise(function(_0x399251,_0x3aef9c){var _0x9e9887=new AWS[(_0xaf46('0x6'))]({'accessKeyId':_0x34c69d,'secretAccessKey':_0x14a6b6,'region':_0xb39163});_0x9e9887[_0xaf46('0x7')]({'TranscriptionJobName':_0x35f997},function(_0x105943,_0x328d92){if(_0x105943){return _0x3aef9c(_0x105943);}else{return _0x399251(_0x328d92);}});});}function sentiment(_0x56f9c8,_0x15315b,_0x4e67c0,_0x54eb46,_0x51f679){return new Promise(function(_0x179cad,_0x2c67d0){var _0x4dc986=new AWS[(_0xaf46('0x8'))]({'accessKeyId':_0x15315b,'secretAccessKey':_0x56f9c8,'region':_0x4e67c0});_0x4dc986[_0xaf46('0x9')]({'Text':_0x54eb46,'LanguageCode':_0x51f679[_0xaf46('0xa')](0x0,0x2)},function(_0x4f2f89,_0x39e812){if(_0x4f2f89){return _0x2c67d0(_0x4f2f89);}else{return _0x179cad(_0x39e812);}});});}function checkTranscribeJob(_0x4af13a,_0x356c69,_0x54fd90){var _0x18e367;return new BPromise(function(_0x560232,_0x20fc28){logger[_0xaf46('0xb')](util[_0xaf46('0xc')](_0xaf46('0xd'),_0x4af13a['id'],_0x4af13a[_0xaf46('0xe')]));return getTranscriptionJob(_0x54fd90[_0xaf46('0xf')],_0x54fd90[_0xaf46('0x10')],_0x356c69[_0xaf46('0x11')],_0x4af13a['transcribeName'])['then'](function(_0x5819e3){logger[_0xaf46('0xb')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4af13a['id'],_0x4af13a[_0xaf46('0xe')],_0x5819e3[_0xaf46('0x12')]['TranscriptionJobStatus']));if(!_0x4af13a[_0xaf46('0x13')]){switch(_0x5819e3[_0xaf46('0x12')][_0xaf46('0x14')]){case _0xaf46('0x15'):var _0x3dd0c2={'transcribeStatus':_0x5819e3[_0xaf46('0x12')]['TranscriptionJobStatus'],'fileUri':_0x5819e3[_0xaf46('0x12')][_0xaf46('0x16')]['TranscriptFileUri']};logger[_0xaf46('0xb')](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x4af13a['id']));return rp({'uri':_0x5819e3['TranscriptionJob']['Transcript'][_0xaf46('0x17')],'json':!![]})[_0xaf46('0x18')](function(_0x4d1c36){logger[_0xaf46('0xb')](util['format'](_0xaf46('0x19'),_0x4af13a['id']));if(_0x4d1c36&&_0x4d1c36[_0xaf46('0x1a')]&&_0x4d1c36[_0xaf46('0x1a')][_0xaf46('0x1b')]&&_0x4d1c36[_0xaf46('0x1a')][_0xaf46('0x1b')][_0xaf46('0x1c')]){_0x3dd0c2[_0xaf46('0x13')]='';for(var _0xabed9f=0x0;_0xabed9f<_0x4d1c36[_0xaf46('0x1a')]['transcripts']['length'];_0xabed9f++){_0x3dd0c2[_0xaf46('0x13')]+=_0x4d1c36[_0xaf46('0x1a')][_0xaf46('0x1b')][_0xabed9f][_0xaf46('0x1d')]+'';}}return _0x4af13a[_0xaf46('0x1e')](_0x3dd0c2);})[_0xaf46('0x18')](function(){logger[_0xaf46('0xb')](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4af13a['id']));if(!_0x4af13a[_0xaf46('0x1f')]){throw new db[(_0xaf46('0x20'))]['ValidationError'](_0xaf46('0x21'));}if(!_0x356c69[_0xaf46('0x22')]||!_0x356c69[_0xaf46('0x23')]||!_0x356c69[_0xaf46('0x24')]||!_0x356c69[_0xaf46('0x25')]||!_0x356c69[_0xaf46('0x26')]){throw new db['Sequelize'][(_0xaf46('0x27'))](_0xaf46('0x28'));}if(!_0x3dd0c2['fileText']){throw new Error(_0xaf46('0x29'));}if(_0x356c69[_0xaf46('0x23')]===_0x54fd90['id']){return _0x54fd90;}else{return db[_0xaf46('0x2a')][_0xaf46('0x2b')]({'where':{'id':_settings[_0xaf46('0x23')]}});}})[_0xaf46('0x18')](function(_0x1dfa19){if(!_0x1dfa19){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x2c'));}if(!_0x1dfa19[_0xaf46('0xf')]||!_0x1dfa19['data2']){throw new db[(_0xaf46('0x20'))]['ValidationError'](_0xaf46('0x2d'));}_0x18e367=_0x1dfa19;logger[_0xaf46('0xb')](util[_0xaf46('0xc')](_0xaf46('0x2e'),_0x4af13a['id']));return sentiment(_0x18e367['data1'],_0x18e367[_0xaf46('0x10')],_0x356c69[_0xaf46('0x24')],_0x3dd0c2[_0xaf46('0x13')],_0x356c69[_0xaf46('0x25')]);})['then'](function(_0x5f31b8){logger[_0xaf46('0xb')](util[_0xaf46('0xc')](_0xaf46('0x2f'),_0x4af13a['id']));return _0x4af13a[_0xaf46('0x1e')]({'sentiment':_0x5f31b8['Sentiment'],'sPositive':_0x5f31b8[_0xaf46('0x30')][_0xaf46('0x31')],'sNegative':_0x5f31b8[_0xaf46('0x30')][_0xaf46('0x32')],'sMixed':_0x5f31b8[_0xaf46('0x30')][_0xaf46('0x33')],'sNeutral':_0x5f31b8['SentimentScore'][_0xaf46('0x34')]});})['then'](function(){logger[_0xaf46('0xb')](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4af13a['id']));_0x560232();});case _0xaf46('0x35'):return _0x4af13a[_0xaf46('0x1e')]({'transcribeStatus':_0xaf46('0x35'),'failureReason':_0x5819e3[_0xaf46('0x12')][_0xaf46('0x36')]})['then'](function(){logger[_0xaf46('0xb')](util[_0xaf46('0xc')](_0xaf46('0x37'),_0x4af13a['id']));_0x560232();});default:logger['info'](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4af13a['id']));break;}}else{return BPromise[_0xaf46('0x38')]()[_0xaf46('0x18')](function(){if(!_0x4af13a['tempSentiment']){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x21'));}if(!_0x356c69[_0xaf46('0x22')]||!_0x356c69[_0xaf46('0x23')]||!_0x356c69[_0xaf46('0x24')]||!_0x356c69[_0xaf46('0x25')]||!_0x356c69[_0xaf46('0x26')]){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x28'));}if(!_0x4af13a[_0xaf46('0x13')]){throw new Error(_0xaf46('0x29'));}if(_0x356c69[_0xaf46('0x23')]===_0x54fd90['id']){return _0x54fd90;}else{return db[_0xaf46('0x2a')][_0xaf46('0x2b')]({'where':{'id':_settings[_0xaf46('0x23')]}});}})[_0xaf46('0x18')](function(_0xb34cc0){if(!_0xb34cc0){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x2c'));}if(!_0xb34cc0['data1']||!_0xb34cc0[_0xaf46('0x10')]){throw new db['Sequelize'][(_0xaf46('0x27'))](_0xaf46('0x2d'));}_0x18e367=_0xb34cc0;logger[_0xaf46('0xb')](util[_0xaf46('0xc')](_0xaf46('0x2e'),_0x4af13a['id']));return sentiment(_0x18e367[_0xaf46('0xf')],_0x18e367[_0xaf46('0x10')],_0x356c69[_0xaf46('0x24')],_0x4af13a[_0xaf46('0x13')],_0x356c69['language']);})['then'](function(_0x504c4a){logger[_0xaf46('0xb')](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4af13a['id']));return _0x4af13a[_0xaf46('0x1e')]({'sentiment':_0x504c4a[_0xaf46('0x39')],'sPositive':_0x504c4a[_0xaf46('0x30')]['Positive'],'sNegative':_0x504c4a[_0xaf46('0x30')][_0xaf46('0x32')],'sMixed':_0x504c4a[_0xaf46('0x30')][_0xaf46('0x33')],'sNeutral':_0x504c4a[_0xaf46('0x30')]['Neutral'],'transcribeStatus':_0xaf46('0x15')});})[_0xaf46('0x18')](function(){logger[_0xaf46('0xb')](util[_0xaf46('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4af13a['id']));_0x560232();});}})[_0xaf46('0x3a')](function(_0x6d20cd){if(_0x6d20cd){if(!_0x6d20cd['name']||_0x6d20cd[_0xaf46('0x3b')]!==_0xaf46('0x3c')){logger[_0xaf46('0x3d')](util['format'](_0xaf46('0x3e'),_0x4af13a['id']),util[_0xaf46('0x3f')](_0x6d20cd,{'showHidden':![],'depth':null}));}}_0x560232();});});}function checkTranscribe(){var _0x21c321;var _0x25c2a3;var _0x409f9f;return db['VoiceRecording'][_0xaf46('0x40')]({'where':{'transcribeStatus':_0xaf46('0x41')}})['then'](function(_0x44e42c){if(!_0x44e42c||!_0x44e42c[_0xaf46('0x1c')]){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x42'));}_0x21c321=_0x44e42c;return db[_0xaf46('0x43')][_0xaf46('0x2b')]({'where':{'id':0x1}});})[_0xaf46('0x18')](function(_0x115ffd){if(!_0x115ffd){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x44'));}_0x25c2a3=_0x115ffd;if(!_0x25c2a3[_0xaf46('0x5')]||!_0x25c2a3[_0xaf46('0x45')]||!_0x25c2a3[_0xaf46('0x11')]||!_0x25c2a3[_0xaf46('0x25')]||!_0x25c2a3['bucket']){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xaf46('0x2b')]({'where':{'id':_0x25c2a3[_0xaf46('0x45')]}});})[_0xaf46('0x18')](function(_0x5a819e){if(!_0x5a819e){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x2c'));}if(!_0x5a819e['data1']||!_0x5a819e[_0xaf46('0x10')]){throw new db[(_0xaf46('0x20'))][(_0xaf46('0x27'))](_0xaf46('0x2d'));}_0x409f9f=_0x5a819e;var _0x56fc4e=[];_0x21c321[_0xaf46('0x46')](function(_0x3dd2c0){_0x56fc4e[_0xaf46('0x47')](checkTranscribeJob(_0x3dd2c0,_0x25c2a3,_0x409f9f));});return BPromise[_0xaf46('0x48')](_0x56fc4e);})[_0xaf46('0x3a')](function(_0x13ed2b){if(_0x13ed2b){if(!_0x13ed2b['name']||_0x13ed2b[_0xaf46('0x3b')]!==_0xaf46('0x3c')){logger[_0xaf46('0x3d')](util[_0xaf46('0x3f')](_0x13ed2b,{'showHidden':![],'depth':null}));}}});}exports[_0xaf46('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xbb35=['findOne','Cloud\x20Provider\x20not\x20configured','Sentiment','Mixed','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','then','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','bucket','Transcript\x20not\x20available'];(function(_0x21457a,_0x5e5343){var _0x27666e=function(_0x1d0ac8){while(--_0x1d0ac8){_0x21457a['push'](_0x21457a['shift']());}};_0x27666e(++_0x5e5343);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x4f7aca,_0x5a944d){_0x4f7aca=_0x4f7aca-0x0;var _0x213cab=_0xbb35[_0x4f7aca];return _0x213cab;};var _=require('lodash');var AWS=require(_0x5bb3('0x0'));var rp=require(_0x5bb3('0x1'));var util=require(_0x5bb3('0x2'));var BPromise=require(_0x5bb3('0x3'));var db=require(_0x5bb3('0x4'))['db'];var logger=require('../../config/logger')(_0x5bb3('0x5'));function getTranscriptionJob(_0x3d71f2,_0x3f992b,_0x3fc728,_0x1d3554){return new Promise(function(_0x321535,_0x46ef03){var _0xbd7a90=new AWS[(_0x5bb3('0x6'))]({'accessKeyId':_0x3f992b,'secretAccessKey':_0x3d71f2,'region':_0x3fc728});_0xbd7a90['getTranscriptionJob']({'TranscriptionJobName':_0x1d3554},function(_0x14986f,_0x11d7df){if(_0x14986f){return _0x46ef03(_0x14986f);}else{return _0x321535(_0x11d7df);}});});}function sentiment(_0x182c0f,_0x383d1b,_0x534872,_0x399f28,_0x5621a8){return new Promise(function(_0x4035d1,_0x5a8b3b){var _0x12513f=new AWS[(_0x5bb3('0x7'))]({'accessKeyId':_0x383d1b,'secretAccessKey':_0x182c0f,'region':_0x534872});_0x12513f[_0x5bb3('0x8')]({'Text':_0x399f28,'LanguageCode':_0x5621a8[_0x5bb3('0x9')](0x0,0x2)},function(_0xdc37a2,_0x573d78){if(_0xdc37a2){return _0x5a8b3b(_0xdc37a2);}else{return _0x4035d1(_0x573d78);}});});}function checkTranscribeJob(_0x10e5ee,_0xdf7055,_0x159793){var _0x5a1040;return new BPromise(function(_0x693078,_0x2f9eb3){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0xc'),_0x10e5ee['id'],_0x10e5ee[_0x5bb3('0xd')]));return getTranscriptionJob(_0x159793[_0x5bb3('0xe')],_0x159793[_0x5bb3('0xf')],_0xdf7055['transcribeRegion'],_0x10e5ee['transcribeName'])['then'](function(_0x3722f3){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x10'),_0x10e5ee['id'],_0x10e5ee[_0x5bb3('0xd')],_0x3722f3[_0x5bb3('0x11')][_0x5bb3('0x12')]));if(!_0x10e5ee[_0x5bb3('0x13')]){switch(_0x3722f3[_0x5bb3('0x11')][_0x5bb3('0x12')]){case'COMPLETED':var _0x5a541b={'transcribeStatus':_0x3722f3[_0x5bb3('0x11')][_0x5bb3('0x12')],'fileUri':_0x3722f3[_0x5bb3('0x11')][_0x5bb3('0x14')][_0x5bb3('0x15')]};logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x10e5ee['id']));return rp({'uri':_0x3722f3[_0x5bb3('0x11')][_0x5bb3('0x14')][_0x5bb3('0x15')],'json':!![]})['then'](function(_0x30c982){logger['info'](util[_0x5bb3('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x10e5ee['id']));if(_0x30c982&&_0x30c982[_0x5bb3('0x16')]&&_0x30c982[_0x5bb3('0x16')][_0x5bb3('0x17')]&&_0x30c982[_0x5bb3('0x16')][_0x5bb3('0x17')][_0x5bb3('0x18')]){_0x5a541b[_0x5bb3('0x13')]='';for(var _0x4977df=0x0;_0x4977df<_0x30c982[_0x5bb3('0x16')][_0x5bb3('0x17')]['length'];_0x4977df++){_0x5a541b[_0x5bb3('0x13')]+=_0x30c982[_0x5bb3('0x16')][_0x5bb3('0x17')][_0x4977df][_0x5bb3('0x19')]+'';}}return _0x10e5ee[_0x5bb3('0x1a')](_0x5a541b);})[_0x5bb3('0x1b')](function(){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x10e5ee['id']));if(!_0x10e5ee['tempSentiment']){throw new db[(_0x5bb3('0x1c'))]['ValidationError'](_0x5bb3('0x1d'));}if(!_0xdf7055['sentiment']||!_0xdf7055[_0x5bb3('0x1e')]||!_0xdf7055[_0x5bb3('0x1f')]||!_0xdf7055[_0x5bb3('0x20')]||!_0xdf7055['bucket']){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))](_0x5bb3('0x22'));}if(!_0x5a541b[_0x5bb3('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0xdf7055['sentimentAccountId']===_0x159793['id']){return _0x159793;}else{return db[_0x5bb3('0x23')]['findOne']({'where':{'id':_settings[_0x5bb3('0x1e')]}});}})[_0x5bb3('0x1b')](function(_0x5217ca){if(!_0x5217ca){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))](_0x5bb3('0x24'));}if(!_0x5217ca[_0x5bb3('0xe')]||!_0x5217ca[_0x5bb3('0xf')]){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x5a1040=_0x5217ca;logger[_0x5bb3('0xa')](util['format'](_0x5bb3('0x25'),_0x10e5ee['id']));return sentiment(_0x5a1040[_0x5bb3('0xe')],_0x5a1040[_0x5bb3('0xf')],_0xdf7055[_0x5bb3('0x1f')],_0x5a541b['fileText'],_0xdf7055['language']);})[_0x5bb3('0x1b')](function(_0x5ba9ab){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x26'),_0x10e5ee['id']));return _0x10e5ee[_0x5bb3('0x1a')]({'sentiment':_0x5ba9ab['Sentiment'],'sPositive':_0x5ba9ab[_0x5bb3('0x27')][_0x5bb3('0x28')],'sNegative':_0x5ba9ab[_0x5bb3('0x27')][_0x5bb3('0x29')],'sMixed':_0x5ba9ab[_0x5bb3('0x27')]['Mixed'],'sNeutral':_0x5ba9ab[_0x5bb3('0x27')][_0x5bb3('0x2a')]});})[_0x5bb3('0x1b')](function(){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x2b'),_0x10e5ee['id']));_0x693078();});case _0x5bb3('0x2c'):return _0x10e5ee[_0x5bb3('0x1a')]({'transcribeStatus':_0x5bb3('0x2c'),'failureReason':_0x3722f3[_0x5bb3('0x11')]['FailureReason']})[_0x5bb3('0x1b')](function(){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x2b'),_0x10e5ee['id']));_0x693078();});default:logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x2d'),_0x10e5ee['id']));break;}}else{return BPromise[_0x5bb3('0x2e')]()[_0x5bb3('0x1b')](function(){if(!_0x10e5ee[_0x5bb3('0x2f')]){throw new db[(_0x5bb3('0x1c'))]['ValidationError'](_0x5bb3('0x1d'));}if(!_0xdf7055[_0x5bb3('0x30')]||!_0xdf7055['sentimentAccountId']||!_0xdf7055[_0x5bb3('0x1f')]||!_0xdf7055[_0x5bb3('0x20')]||!_0xdf7055[_0x5bb3('0x31')]){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x10e5ee[_0x5bb3('0x13')]){throw new Error(_0x5bb3('0x32'));}if(_0xdf7055[_0x5bb3('0x1e')]===_0x159793['id']){return _0x159793;}else{return db[_0x5bb3('0x23')][_0x5bb3('0x33')]({'where':{'id':_settings[_0x5bb3('0x1e')]}});}})['then'](function(_0x6d6c39){if(!_0x6d6c39){throw new db['Sequelize'][(_0x5bb3('0x21'))](_0x5bb3('0x24'));}if(!_0x6d6c39['data1']||!_0x6d6c39[_0x5bb3('0xf')]){throw new db['Sequelize'][(_0x5bb3('0x21'))](_0x5bb3('0x34'));}_0x5a1040=_0x6d6c39;logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x25'),_0x10e5ee['id']));return sentiment(_0x5a1040[_0x5bb3('0xe')],_0x5a1040['data2'],_0xdf7055[_0x5bb3('0x1f')],_0x10e5ee[_0x5bb3('0x13')],_0xdf7055[_0x5bb3('0x20')]);})[_0x5bb3('0x1b')](function(_0x47cad3){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x26'),_0x10e5ee['id']));return _0x10e5ee[_0x5bb3('0x1a')]({'sentiment':_0x47cad3[_0x5bb3('0x35')],'sPositive':_0x47cad3[_0x5bb3('0x27')][_0x5bb3('0x28')],'sNegative':_0x47cad3[_0x5bb3('0x27')][_0x5bb3('0x29')],'sMixed':_0x47cad3['SentimentScore'][_0x5bb3('0x36')],'sNeutral':_0x47cad3[_0x5bb3('0x27')][_0x5bb3('0x2a')],'transcribeStatus':_0x5bb3('0x37')});})[_0x5bb3('0x1b')](function(){logger[_0x5bb3('0xa')](util[_0x5bb3('0xb')](_0x5bb3('0x2b'),_0x10e5ee['id']));_0x693078();});}})[_0x5bb3('0x38')](function(_0x165e72){if(_0x165e72){if(!_0x165e72[_0x5bb3('0x39')]||_0x165e72[_0x5bb3('0x39')]!==_0x5bb3('0x3a')){logger[_0x5bb3('0x3b')](util[_0x5bb3('0xb')](_0x5bb3('0x3c'),_0x10e5ee['id']),util[_0x5bb3('0x3d')](_0x165e72,{'showHidden':![],'depth':null}));}}_0x693078();});});}function checkTranscribe(){var _0x398219;var _0x133f4c;var _0x3ad935;return db[_0x5bb3('0x3e')][_0x5bb3('0x3f')]({'where':{'transcribeStatus':_0x5bb3('0x40')}})[_0x5bb3('0x1b')](function(_0x22c773){if(!_0x22c773||!_0x22c773[_0x5bb3('0x18')]){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))](_0x5bb3('0x41'));}_0x398219=_0x22c773;return db[_0x5bb3('0x42')][_0x5bb3('0x33')]({'where':{'id':0x1}});})['then'](function(_0x114c35){if(!_0x114c35){throw new db[(_0x5bb3('0x1c'))]['ValidationError'](_0x5bb3('0x43'));}_0x133f4c=_0x114c35;if(!_0x133f4c[_0x5bb3('0x5')]||!_0x133f4c[_0x5bb3('0x44')]||!_0x133f4c['transcribeRegion']||!_0x133f4c[_0x5bb3('0x20')]||!_0x133f4c[_0x5bb3('0x31')]){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))](_0x5bb3('0x45'));}return db[_0x5bb3('0x23')]['findOne']({'where':{'id':_0x133f4c[_0x5bb3('0x44')]}});})['then'](function(_0xffa73e){if(!_0xffa73e){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))](_0x5bb3('0x24'));}if(!_0xffa73e['data1']||!_0xffa73e['data2']){throw new db[(_0x5bb3('0x1c'))][(_0x5bb3('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x3ad935=_0xffa73e;var _0x5d6bf0=[];_0x398219[_0x5bb3('0x46')](function(_0x937d9f){_0x5d6bf0[_0x5bb3('0x47')](checkTranscribeJob(_0x937d9f,_0x133f4c,_0x3ad935));});return BPromise[_0x5bb3('0x48')](_0x5d6bf0);})['catch'](function(_0x2122d1){if(_0x2122d1){if(!_0x2122d1[_0x5bb3('0x39')]||_0x2122d1[_0x5bb3('0x39')]!==_0x5bb3('0x3a')){logger['error'](util[_0x5bb3('0x3d')](_0x2122d1,{'showHidden':![],'depth':null}));}}});}exports[_0x5bb3('0x49')]=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 612104d..68cdda7 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 _0xc4d8=['util','../logger','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','ioredis'];(function(_0x37e4a8,_0x111154){var _0x4ac4e5=function(_0x2abe45){while(--_0x2abe45){_0x37e4a8['push'](_0x37e4a8['shift']());}};_0x4ac4e5(++_0x111154);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xc4d8[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x8c4d('0x0'));var moment=require('moment');var Redis=require(_0x8c4d('0x1'));var util=require(_0x8c4d('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x8c4d('0x3'))('schedule');config['redis']=_[_0x8c4d('0x4')](config[_0x8c4d('0x5')],{'host':_0x8c4d('0x6'),'port':0x18eb});var io=require(_0x8c4d('0x7'))(new Redis(config[_0x8c4d('0x5')]));function closeInteractions(){var _0x15da54=[];return db[_0x8c4d('0x8')][_0x8c4d('0x9')]({'raw':!![],'attributes':['id',_0x8c4d('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x8c4d('0xb'))}}})[_0x8c4d('0xc')](function(_0x36b577){if(_0x36b577&&_0x36b577[_0x8c4d('0xd')]){_0x15da54=_['map'](_0x36b577||[],'id');logger['info'](_0x8c4d('0xe'),_0x15da54[_0x8c4d('0xf')]());return db[_0x8c4d('0x8')][_0x8c4d('0x10')]({'closeReason':_0x8c4d('0x11'),'disposition':_0x8c4d('0x12'),'closed':!![],'closedAt':moment()[_0x8c4d('0x13')](_0x8c4d('0x14'))},{'where':{'id':_0x15da54}});}})['then'](function(){if(_0x15da54&&_0x15da54[_0x8c4d('0xd')]){logger[_0x8c4d('0x15')](_0x8c4d('0x16'),_0x15da54[_0x8c4d('0xf')]());for(var _0xda4bf5=0x0;_0xda4bf5<_0x15da54[_0x8c4d('0xd')];_0xda4bf5++){io[_0x8c4d('0x17')](_0x8c4d('0x18'),{'id':_0x15da54[_0xda4bf5],'closed':!![]});}}})['catch'](function(_0x512f85){logger[_0x8c4d('0x19')](_0x8c4d('0x1a'),_0x512f85?util['inspect'](_0x512f85,{'showHidden':![],'depth':null}):'');});}exports[_0x8c4d('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7d5d=['start','moment','ioredis','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x25c03a,_0x1193ee){_0x25c03a=_0x25c03a-0x0;var _0x434678=_0x7d5d[_0x25c03a];return _0x434678;};'use strict';var _=require('lodash');var moment=require(_0xd7d5('0x0'));var Redis=require(_0xd7d5('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0xd7d5('0x2'))['db'];var logger=require(_0xd7d5('0x3'))(_0xd7d5('0x4'));config['redis']=_[_0xd7d5('0x5')](config[_0xd7d5('0x6')],{'host':_0xd7d5('0x7'),'port':0x18eb});var io=require(_0xd7d5('0x8'))(new Redis(config[_0xd7d5('0x6')]));function closeInteractions(){var _0x559f36=[];return db[_0xd7d5('0x9')][_0xd7d5('0xa')]({'raw':!![],'attributes':['id',_0xd7d5('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xd7d5('0xc'))}}})[_0xd7d5('0xd')](function(_0x4c3b64){if(_0x4c3b64&&_0x4c3b64[_0xd7d5('0xe')]){_0x559f36=_[_0xd7d5('0xf')](_0x4c3b64||[],'id');logger[_0xd7d5('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x559f36[_0xd7d5('0x11')]());return db[_0xd7d5('0x9')][_0xd7d5('0x12')]({'closeReason':_0xd7d5('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xd7d5('0x14'))},{'where':{'id':_0x559f36}});}})[_0xd7d5('0xd')](function(){if(_0x559f36&&_0x559f36[_0xd7d5('0xe')]){logger[_0xd7d5('0x10')](_0xd7d5('0x15'),_0x559f36[_0xd7d5('0x11')]());for(var _0x54e2f1=0x0;_0x54e2f1<_0x559f36[_0xd7d5('0xe')];_0x54e2f1++){io[_0xd7d5('0x16')](_0xd7d5('0x17'),{'id':_0x559f36[_0x54e2f1],'closed':!![]});}}})[_0xd7d5('0x18')](function(_0x237c1f){logger['error'](_0xd7d5('0x19'),_0x237c1f?util[_0xd7d5('0x1a')](_0x237c1f,{'showHidden':![],'depth':null}):'');});}exports[_0xd7d5('0x1b')]=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 9b4500a..e05354e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d48=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','hopper2','catch','util','../mysqldb'];(function(_0xeecbed,_0x5af859){var _0x3636e8=function(_0x12283d){while(--_0x12283d){_0xeecbed['push'](_0xeecbed['shift']());}};_0x3636e8(++_0x5af859);}(_0x2d48,0x1c9));var _0x82d4=function(_0x41ddf3,_0x4c5db7){_0x41ddf3=_0x41ddf3-0x0;var _0x2adac3=_0x2d48[_0x41ddf3];return _0x2adac3;};'use strict';var util=require(_0x82d4('0x0'));var db=require(_0x82d4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x82d4('0x2')]({'id':i,'firstName':_0x82d4('0x3')+i,'lastName':_0x82d4('0x4')+i,'phone':0xf879fb460+i,'email':_0x82d4('0x5')+i+_0x82d4('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x82d4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x82d4('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x82d4('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x82d4('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x82d4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x82d4('0x7')](),'updatedAt':Date['now']()});}db[_0x82d4('0x8')]['destroy']({'where':{}})[_0x82d4('0x9')](function(){return db[_0x82d4('0x8')][_0x82d4('0xa')](contacts);})[_0x82d4('0x9')](function(){console[_0x82d4('0xb')](_0x82d4('0xc'),'contacts1');return db[_0x82d4('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0x82d4('0xd')][_0x82d4('0xa')](hopper);})[_0x82d4('0x9')](function(){console[_0x82d4('0xb')](_0x82d4('0xc'),_0x82d4('0xe'));return db['CmContact'][_0x82d4('0xa')](contacts2);})['then'](function(){console[_0x82d4('0xb')](_0x82d4('0xc'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0x82d4('0x9')](function(){console['log'](_0x82d4('0xc'),_0x82d4('0xf'));})[_0x82d4('0x10')](function(_0x204b49){console[_0x82d4('0xb')](_0x204b49);}); \ No newline at end of file +var _0x64c2=['Biondo','@xcally.com','now','innocenzo.biondo','CmContact','then','log','destroy','CmHopper','bulkCreate','hopper1','finished\x20populating','hopper2','catch','util','../mysqldb','push','Innocenzo'];(function(_0x353319,_0x26519d){var _0x328a0c=function(_0x29f383){while(--_0x29f383){_0x353319['push'](_0x353319['shift']());}};_0x328a0c(++_0x26519d);}(_0x64c2,0x8c));var _0x264c=function(_0x556c19,_0x32106a){_0x556c19=_0x556c19-0x0;var _0x3b87c4=_0x64c2[_0x556c19];return _0x3b87c4;};'use strict';var util=require(_0x264c('0x0'));var db=require(_0x264c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x264c('0x2')]({'id':i,'firstName':_0x264c('0x3')+i,'lastName':_0x264c('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x264c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x264c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x264c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x264c('0x2')]({'id':i,'firstName':_0x264c('0x3')+i,'lastName':_0x264c('0x4')+i,'phone':0xf879fb460+i,'email':_0x264c('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x264c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x264c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x264c('0x6')]()});}db[_0x264c('0x8')]['destroy']({'where':{}})[_0x264c('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x264c('0xa')]('finished\x20populating','contacts1');return db['CmHopper'][_0x264c('0xb')]({'where':{}});})[_0x264c('0x9')](function(){return db[_0x264c('0xc')][_0x264c('0xd')](hopper);})[_0x264c('0x9')](function(){console[_0x264c('0xa')]('finished\x20populating',_0x264c('0xe'));return db[_0x264c('0x8')][_0x264c('0xd')](contacts2);})[_0x264c('0x9')](function(){console[_0x264c('0xa')](_0x264c('0xf'),'contacts2');return db[_0x264c('0xc')][_0x264c('0xd')](hopper2);})[_0x264c('0x9')](function(){console[_0x264c('0xa')](_0x264c('0xf'),_0x264c('0x10'));})[_0x264c('0x11')](function(_0x250656){console[_0x264c('0xa')](_0x250656);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index a0d90eb..bc64705 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x483d=['agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','util','../mysqldb','format','%s%s'];(function(_0x5b03ad,_0x4c884f){var _0x56da22=function(_0x57152d){while(--_0x57152d){_0x5b03ad['push'](_0x5b03ad['shift']());}};_0x56da22(++_0x4c884f);}(_0x483d,0x1a0));var _0xd483=function(_0x3c7354,_0x4ff563){_0x3c7354=_0x3c7354-0x0;var _0x22cc09=_0x483d[_0x3c7354];return _0x22cc09;};'use strict';var util=require(_0xd483('0x0'));var db=require(_0xd483('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xd483('0x2')](_0xd483('0x3'),_0xd483('0x4'),i),'fullname':util['format']('%s%s',_0xd483('0x4'),i),'email':util['format'](_0xd483('0x5'),_0xd483('0x4'),i),'role':_0xd483('0x4'),'password':_0xd483('0x6'),'internal':0xfa0+i,'type':_0xd483('0x7'),'transport':[_0xd483('0x8'),'ws',_0xd483('0x9')],'disallow':[_0xd483('0xa')],'allow':[_0xd483('0xb')],'defaultuser':util[_0xd483('0x2')](_0xd483('0x3'),_0xd483('0x4'),i),'encryption':_0xd483('0xc'),'avpf':_0xd483('0xc'),'force_avp':_0xd483('0xc'),'icesupport':'yes','dtlsenable':_0xd483('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd483('0xd'),'dtlssetup':_0xd483('0xe'),'callerid':util[_0xd483('0x2')](_0xd483('0xf'),util['format'](_0xd483('0x3'),_0xd483('0x4'),i),0xfa0+i)});}db[_0xd483('0x10')][_0xd483('0x11')](users)[_0xd483('0x12')](function(){console['log']('add\x20user');})[_0xd483('0x13')](function(_0x433502){console['log'](_0x433502);}); \ No newline at end of file +var _0xf070=['password','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','log','add\x20user','util','push','format','%s%s','agent'];(function(_0x4d3727,_0x4ec590){var _0x3ab42b=function(_0x1807e5){while(--_0x1807e5){_0x4d3727['push'](_0x4d3727['shift']());}};_0x3ab42b(++_0x4ec590);}(_0xf070,0x12d));var _0x0f07=function(_0x5a7b17,_0x13e440){_0x5a7b17=_0x5a7b17-0x0;var _0x38752a=_0xf070[_0x5a7b17];return _0x38752a;};'use strict';var util=require(_0x0f07('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x0f07('0x1')]({'name':util[_0x0f07('0x2')](_0x0f07('0x3'),_0x0f07('0x4'),i),'fullname':util[_0x0f07('0x2')](_0x0f07('0x3'),_0x0f07('0x4'),i),'email':util[_0x0f07('0x2')]('%s%s@xcally.com',_0x0f07('0x4'),i),'role':_0x0f07('0x4'),'password':_0x0f07('0x5'),'internal':0xfa0+i,'type':_0x0f07('0x6'),'transport':[_0x0f07('0x7'),'ws','wss'],'disallow':[_0x0f07('0x8')],'allow':[_0x0f07('0x9')],'defaultuser':util[_0x0f07('0x2')](_0x0f07('0x3'),_0x0f07('0x4'),i),'encryption':_0x0f07('0xa'),'avpf':_0x0f07('0xa'),'force_avp':_0x0f07('0xa'),'icesupport':_0x0f07('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x0f07('0xb'),'dtlsprivatekey':_0x0f07('0xc'),'dtlssetup':'actpass','callerid':util[_0x0f07('0x2')](_0x0f07('0xd'),util[_0x0f07('0x2')]('%s%s',_0x0f07('0x4'),i),0xfa0+i)});}db[_0x0f07('0xe')]['bulkCreate'](users)['then'](function(){console[_0x0f07('0xf')](_0x0f07('0x10'));})['catch'](function(_0x28f3d9){console[_0x0f07('0xf')](_0x28f3d9);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 172de64..11514c7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbc6=['join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','bluebird','./environment','name','Agents','User','role','telephone','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','MailQueues','Campaign','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x5f5af1,_0x283986){_0x5f5af1=_0x5f5af1-0x0;var _0x15d27d=_0xdbc6[_0x5f5af1];return _0x15d27d;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x6dbc('0x0'));var db=require('../mysqldb')['db'];var config=require(_0x6dbc('0x1'));var queryQueues={'attributes':['id',_0x6dbc('0x2')],'include':[{'as':_0x6dbc('0x3'),'model':db[_0x6dbc('0x4')],'attributes':['id',_0x6dbc('0x2'),_0x6dbc('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6dbc('0x2')],'where':{'role':_0x6dbc('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x6dbc('0x2')],'where':{'role':_0x6dbc('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6dbc('0x2'),_0x6dbc('0x8')],'where':{'type':_0x6dbc('0x9')}};function getAssociatedResources(_0x5ea822,_0x3494e2,_0x3c57b4){return db['UserProfileSection'][_0x6dbc('0xa')]({'where':{'name':_0x5ea822,'userProfileId':_0x3494e2},'raw':!![]})[_0x6dbc('0xb')](function(_0x5bbb3c){if(_0x5bbb3c){if(_0x5bbb3c[_0x6dbc('0xc')]){switch(_0x5ea822){case _0x6dbc('0xd'):case _0x6dbc('0xe'):case _0x6dbc('0xf'):case _0x6dbc('0x10'):case'MailQueues':case'OpenchannelQueues':case _0x6dbc('0x11'):return db[_0x3c57b4][_0x6dbc('0x12')](queryQueues);case _0x6dbc('0x13'):return db[_0x3c57b4][_0x6dbc('0x12')](queryTelephones);case _0x6dbc('0x14'):return db[_0x3c57b4][_0x6dbc('0x12')](queryTrunks);case _0x6dbc('0x15'):return db[_0x3c57b4][_0x6dbc('0x12')](queryCampaigns);}}else{return db[_0x6dbc('0x16')]['findAll']({'attributes':[_0x6dbc('0x17')],'where':{'sectionId':_0x5bbb3c['id']},'raw':!![]})[_0x6dbc('0xb')](function(_0x12a257){if(_0x12a257){var _0x418e71={'where':{'id':_[_0x6dbc('0x18')](_0x12a257,_0x6dbc('0x17'))},'raw':!![]};switch(_0x3c57b4){case _0x6dbc('0x4'):_0x418e71[_0x6dbc('0x19')]['role']='telephone';break;case'Campaign':_0x418e71[_0x6dbc('0x19')][_0x6dbc('0x8')]=_0x6dbc('0x9');break;}return db[_0x3c57b4][_0x6dbc('0x12')](_0x418e71);}else{return[];}});}}else{return[];}})[_0x6dbc('0xb')](function(_0x581381){return _0x581381;});}function joinOrLeaveQueues(_0x44435c,_0x12311d,_0xb270df,_0x294803){_0x44435c[_0x12311d](util[_0x6dbc('0x1a')](_0x6dbc('0x1b'),_0xb270df,_0x294803[_0x6dbc('0x2')]));if(_0x294803[_0x6dbc('0x3')]){for(var _0x9edc7a=0x0;_0x9edc7a<_0x294803[_0x6dbc('0x3')][_0x6dbc('0x1c')];_0x9edc7a+=0x1){_0x44435c[_0x12311d](util['format'](_0x6dbc('0x1d'),_0x294803[_0x6dbc('0x3')][_0x9edc7a][_0x6dbc('0x2')]));}}}function joinOrLeave(_0x52b772,_0x1b8e84,_0x47d55b){var _0x3e98b2;if(_0x52b772[_0x6dbc('0x1e')][_0x6dbc('0x1f')]['id']){db['User'][_0x6dbc('0x20')]({'attributes':['id',_0x6dbc('0x2'),_0x6dbc('0x5'),_0x6dbc('0x21')],'where':{'id':_0x52b772[_0x6dbc('0x1e')][_0x6dbc('0x1f')]['id']},'include':[{'model':db[_0x6dbc('0x22')],'as':_0x6dbc('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x6dbc('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dbc('0x25')],'as':_0x6dbc('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dbc('0x27')],'as':_0x6dbc('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dbc('0x29')],'as':_0x6dbc('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dbc('0x2b')],'as':_0x6dbc('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x23ea7d){if(_0x23ea7d){_0x3e98b2=_0x23ea7d;_0x52b772[_0x1b8e84](util[_0x6dbc('0x1a')](_0x6dbc('0x1d'),_0x23ea7d[_0x6dbc('0x2')]));var _0x564920=[];switch(_0x23ea7d['role']){case _0x6dbc('0x2d'):_0x52b772[_0x1b8e84](_0x6dbc('0x2e'));_0x52b772[_0x1b8e84](_0x6dbc('0x2f'));if(queryQueues[_0x6dbc('0x30')](_0x6dbc('0x31'))){delete queryQueues[_0x6dbc('0x31')];}_0x564920['push'](db[_0x6dbc('0x32')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x34')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x35')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x36')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x37')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x38')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x39')][_0x6dbc('0x12')](queryQueues));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x4')][_0x6dbc('0x12')](queryTelephones));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x3a')][_0x6dbc('0x12')](queryTrunks));_0x564920['push'](db['Campaign'][_0x6dbc('0x12')](queryCampaigns));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x4')]['findAll'](queryAgents));break;case _0x6dbc('0x3b'):_0x52b772[_0x1b8e84]('voice:inbound');_0x52b772[_0x1b8e84]('voice:outbound');_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0xd'),_0x23ea7d['userProfileId'],_0x6dbc('0x32')));_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0xe'),_0x23ea7d[_0x6dbc('0x21')],_0x6dbc('0x34')));_0x564920['push'](getAssociatedResources(_0x6dbc('0xf'),_0x23ea7d['userProfileId'],_0x6dbc('0x35')));_0x564920[_0x6dbc('0x33')](getAssociatedResources('SmsQueues',_0x23ea7d[_0x6dbc('0x21')],_0x6dbc('0x36')));_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0x3c'),_0x23ea7d[_0x6dbc('0x21')],'MailQueue'));_0x564920[_0x6dbc('0x33')](getAssociatedResources('OpenchannelQueues',_0x23ea7d['userProfileId'],'OpenchannelQueue'));_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0x11'),_0x23ea7d[_0x6dbc('0x21')],_0x6dbc('0x39')));_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0x13'),_0x23ea7d[_0x6dbc('0x21')],_0x6dbc('0x4')));_0x564920[_0x6dbc('0x33')](getAssociatedResources(_0x6dbc('0x14'),_0x23ea7d['userProfileId'],_0x6dbc('0x3a')));_0x564920[_0x6dbc('0x33')](getAssociatedResources('IvrCampaigns',_0x23ea7d[_0x6dbc('0x21')],_0x6dbc('0x3d')));_0x564920[_0x6dbc('0x33')](db[_0x6dbc('0x4')][_0x6dbc('0x12')](queryAgents));break;case'agent':_0x52b772[_0x1b8e84](_0x6dbc('0x2e'));_0x52b772[_0x1b8e84](_0x6dbc('0x2f'));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x3e')]({'attributes':['id',_0x6dbc('0x2')]}));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x3f')]({'attributes':['id','name']}));_0x564920[_0x6dbc('0x33')](_0x23ea7d['getFaxQueues']({'attributes':['id',_0x6dbc('0x2')]}));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x40')]({'attributes':['id',_0x6dbc('0x2')]}));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x41')]({'attributes':['id',_0x6dbc('0x2')]}));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x42')]({'attributes':['id','name']}));_0x564920[_0x6dbc('0x33')](_0x23ea7d[_0x6dbc('0x43')]({'attributes':['id',_0x6dbc('0x2')]}));break;}return BPromise[_0x6dbc('0x44')](_0x564920);}})['then'](function(_0x561570){if(_0x561570&&_0x561570[_0x6dbc('0x1c')]){for(var _0x4fc9b9=0x0;_0x4fc9b9<_0x561570[_0x6dbc('0x1c')];_0x4fc9b9+=0x1){for(var _0x426059=0x0;_0x426059<_0x561570[_0x4fc9b9][_0x6dbc('0x1c')];_0x426059+=0x1){switch(_0x4fc9b9){case 0x0:joinOrLeaveQueues(_0x52b772,_0x1b8e84,_0x6dbc('0x45'),_0x561570[_0x4fc9b9][_0x426059]);break;case 0x1:joinOrLeaveQueues(_0x52b772,_0x1b8e84,_0x6dbc('0x46'),_0x561570[_0x4fc9b9][_0x426059]);break;case 0x2:joinOrLeaveQueues(_0x52b772,_0x1b8e84,'fax',_0x561570[_0x4fc9b9][_0x426059]);break;case 0x3:joinOrLeaveQueues(_0x52b772,_0x1b8e84,_0x6dbc('0x47'),_0x561570[_0x4fc9b9][_0x426059]);break;case 0x4:joinOrLeaveQueues(_0x52b772,_0x1b8e84,_0x6dbc('0x48'),_0x561570[_0x4fc9b9][_0x426059]);break;case 0x5:joinOrLeaveQueues(_0x52b772,_0x1b8e84,_0x6dbc('0x49'),_0x561570[_0x4fc9b9][_0x426059]);break;case 0x6:joinOrLeaveQueues(_0x52b772,_0x1b8e84,'whatsapp',_0x561570[_0x4fc9b9][_0x426059]);break;case 0x7:if(_0x3e98b2[_0x6dbc('0x5')]!==_0x6dbc('0x7'))_0x52b772[_0x1b8e84](util['format'](_0x6dbc('0x4a'),_0x561570[_0x4fc9b9][_0x426059][_0x6dbc('0x2')]));break;case 0x8:if(_0x3e98b2[_0x6dbc('0x5')]!=='agent')_0x52b772[_0x1b8e84](util['format']('trunk:%s',_0x561570[_0x4fc9b9][_0x426059]['name']));break;case 0x9:if(_0x3e98b2[_0x6dbc('0x5')]!==_0x6dbc('0x7'))_0x52b772[_0x1b8e84](util[_0x6dbc('0x1a')]('campaign:%s:%s',_0x561570[_0x4fc9b9][_0x426059][_0x6dbc('0x8')],_0x561570[_0x4fc9b9][_0x426059][_0x6dbc('0x2')]));break;case 0xa:_0x52b772[_0x1b8e84](util[_0x6dbc('0x1a')]('user:%s',_0x561570[_0x4fc9b9][_0x426059]['name']));break;}}}}})[_0x6dbc('0xb')](function(){if(_0x1b8e84===_0x6dbc('0x4b')){var _0x38c85b=_[_0x6dbc('0x18')](_0x3e98b2[_0x6dbc('0x23')],'id');return _0x3e98b2['removeChatInteractions'](_0x38c85b)[_0x6dbc('0xb')](function(){for(var _0x431c48=0x0;_0x431c48<_0x38c85b['length'];_0x431c48+=0x1){_0x47d55b[_0x6dbc('0x4c')](_0x6dbc('0x4d'),{'ChatInteractionId':Number(_0x38c85b[_0x431c48]),'UserId':Number(_0x3e98b2['id'])});}});}})['then'](function(){if(_0x1b8e84===_0x6dbc('0x4b')){var _0x3045a1=_['map'](_0x3e98b2[_0x6dbc('0x24')],'id');return _0x3e98b2[_0x6dbc('0x4e')](_0x3045a1)[_0x6dbc('0xb')](function(){for(var _0x2907e5=0x0;_0x2907e5<_0x3045a1[_0x6dbc('0x1c')];_0x2907e5+=0x1){_0x47d55b['emit'](_0x6dbc('0x4f'),{'MailInteractionId':Number(_0x3045a1[_0x2907e5]),'UserId':Number(_0x3e98b2['id'])});}});}})['then'](function(){if(_0x1b8e84===_0x6dbc('0x4b')){var _0x1e55de=_[_0x6dbc('0x18')](_0x3e98b2[_0x6dbc('0x26')],'id');return _0x3e98b2[_0x6dbc('0x50')](_0x1e55de)[_0x6dbc('0xb')](function(){for(var _0x673597=0x0;_0x673597<_0x1e55de['length'];_0x673597+=0x1){_0x47d55b[_0x6dbc('0x4c')](_0x6dbc('0x51'),{'FaxInteractionId':Number(_0x1e55de[_0x673597]),'UserId':Number(_0x3e98b2['id'])});}});}})[_0x6dbc('0xb')](function(){if(_0x1b8e84===_0x6dbc('0x4b')){var _0x45dcbf=_[_0x6dbc('0x18')](_0x3e98b2[_0x6dbc('0x28')],'id');return _0x3e98b2['removeSmsInteractions'](_0x45dcbf)[_0x6dbc('0xb')](function(){for(var _0x2cce4c=0x0;_0x2cce4c<_0x45dcbf['length'];_0x2cce4c+=0x1){_0x47d55b['emit'](_0x6dbc('0x52'),{'SmsInteractionId':Number(_0x45dcbf[_0x2cce4c]),'UserId':Number(_0x3e98b2['id'])});}});}})['then'](function(){if(_0x1b8e84===_0x6dbc('0x4b')){var _0x13e1b7=_['map'](_0x3e98b2[_0x6dbc('0x2a')],'id');return _0x3e98b2[_0x6dbc('0x53')](_0x13e1b7)[_0x6dbc('0xb')](function(){for(var _0x4b71a0=0x0;_0x4b71a0<_0x13e1b7[_0x6dbc('0x1c')];_0x4b71a0+=0x1){_0x47d55b[_0x6dbc('0x4c')](_0x6dbc('0x54'),{'OpenchannelInteractionId':Number(_0x13e1b7[_0x4b71a0]),'UserId':Number(_0x3e98b2['id'])});}});}})[_0x6dbc('0xb')](function(){if(_0x1b8e84==='leave'){var _0x280562=_['map'](_0x3e98b2[_0x6dbc('0x2c')],'id');return _0x3e98b2[_0x6dbc('0x55')](_0x280562)[_0x6dbc('0xb')](function(){for(var _0x33d972=0x0;_0x33d972<_0x280562[_0x6dbc('0x1c')];_0x33d972+=0x1){_0x47d55b[_0x6dbc('0x4c')](_0x6dbc('0x56'),{'WhatsappInteractionId':Number(_0x280562[_0x33d972]),'UserId':Number(_0x3e98b2['id'])});}});}})[_0x6dbc('0x57')](function(_0x2856a1){_0x52b772[_0x6dbc('0x58')](_0x2856a1);});}}function onDisconnect(_0x4a3fde,_0x3bb839){joinOrLeave(_0x4a3fde,_0x6dbc('0x4b'),_0x3bb839);}function onConnect(_0x15b7fb){joinOrLeave(_0x15b7fb,_0x6dbc('0x59'));}exports[_0x6dbc('0x5a')]=function(_0x1e5f6f){_0x1e5f6f['on'](_0x6dbc('0x5b'),function(_0x206582){_0x206582[_0x6dbc('0x5c')](0x0);_0x206582[_0x6dbc('0x5d')]=_0x206582[_0x6dbc('0x5e')][_0x6dbc('0x5b')][_0x6dbc('0x5f')]+':'+_0x206582['request'][_0x6dbc('0x5b')][_0x6dbc('0x60')];_0x206582[_0x6dbc('0x61')]=new Date();_0x206582['log']=function(_0xc60021){console[_0x6dbc('0x58')](_0x6dbc('0x62')+_0x206582[_0x6dbc('0x63')][_0x6dbc('0x2')]+'['+_0x206582[_0x6dbc('0x5d')]+']',_0xc60021);};_0x206582['on'](_0x6dbc('0x64'),function(){onDisconnect(_0x206582,_0x1e5f6f);_0x206582['log']('DISCONNECTED');});onConnect(_0x206582);_0x206582[_0x6dbc('0x58')]('CONNECTED');});}; \ No newline at end of file +var _0xee65=['user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','address','request','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','Campaign','where','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','ChatQueues','FaxQueue','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','map','emit','removeMailInteractions','user_has_mail_interactions:remove','leave','FaxInteractions','removeSmsInteractions'];(function(_0x4eb036,_0x638bea){var _0x39f562=function(_0x2eb18a){while(--_0x2eb18a){_0x4eb036['push'](_0x4eb036['shift']());}};_0x39f562(++_0x638bea);}(_0xee65,0x138));var _0x5ee6=function(_0x250707,_0x197f9d){_0x250707=_0x250707-0x0;var _0x3cacb5=_0xee65[_0x250707];return _0x3cacb5;};'use strict';var _=require(_0x5ee6('0x0'));var util=require(_0x5ee6('0x1'));var BPromise=require(_0x5ee6('0x2'));var db=require(_0x5ee6('0x3'))['db'];var config=require(_0x5ee6('0x4'));var queryQueues={'attributes':['id',_0x5ee6('0x5')],'include':[{'as':_0x5ee6('0x6'),'model':db['User'],'attributes':['id',_0x5ee6('0x5'),_0x5ee6('0x7')],'raw':!![],'where':{'role':_0x5ee6('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5ee6('0x5')],'where':{'role':_0x5ee6('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x5ee6('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5ee6('0x5'),_0x5ee6('0xa')],'where':{'type':_0x5ee6('0xb')}};function getAssociatedResources(_0x165f18,_0x3b4f26,_0x542a89){return db[_0x5ee6('0xc')]['findOne']({'where':{'name':_0x165f18,'userProfileId':_0x3b4f26},'raw':!![]})[_0x5ee6('0xd')](function(_0x351530){if(_0x351530){if(_0x351530[_0x5ee6('0xe')]){switch(_0x165f18){case _0x5ee6('0xf'):case'ChatQueues':case _0x5ee6('0x10'):case _0x5ee6('0x11'):case _0x5ee6('0x12'):case _0x5ee6('0x13'):case _0x5ee6('0x14'):return db[_0x542a89]['findAll'](queryQueues);case _0x5ee6('0x15'):return db[_0x542a89][_0x5ee6('0x16')](queryTelephones);case _0x5ee6('0x17'):return db[_0x542a89][_0x5ee6('0x16')](queryTrunks);case _0x5ee6('0x18'):return db[_0x542a89][_0x5ee6('0x16')](queryCampaigns);}}else{return db[_0x5ee6('0x19')][_0x5ee6('0x16')]({'attributes':[_0x5ee6('0x1a')],'where':{'sectionId':_0x351530['id']},'raw':!![]})[_0x5ee6('0xd')](function(_0x403cbd){if(_0x403cbd){var _0x456198={'where':{'id':_['map'](_0x403cbd,'resourceId')},'raw':!![]};switch(_0x542a89){case _0x5ee6('0x1b'):_0x456198['where'][_0x5ee6('0x7')]=_0x5ee6('0x9');break;case _0x5ee6('0x1c'):_0x456198[_0x5ee6('0x1d')][_0x5ee6('0xa')]='ivr';break;}return db[_0x542a89][_0x5ee6('0x16')](_0x456198);}else{return[];}});}}else{return[];}})[_0x5ee6('0xd')](function(_0x59ebd5){return _0x59ebd5;});}function joinOrLeaveQueues(_0x2e9cae,_0x14a94b,_0x38c224,_0x5e762e){_0x2e9cae[_0x14a94b](util[_0x5ee6('0x1e')](_0x5ee6('0x1f'),_0x38c224,_0x5e762e[_0x5ee6('0x5')]));if(_0x5e762e['Agents']){for(var _0x3e449e=0x0;_0x3e449e<_0x5e762e[_0x5ee6('0x6')][_0x5ee6('0x20')];_0x3e449e+=0x1){_0x2e9cae[_0x14a94b](util['format'](_0x5ee6('0x21'),_0x5e762e[_0x5ee6('0x6')][_0x3e449e][_0x5ee6('0x5')]));}}}function joinOrLeave(_0x54d574,_0x25ed7d,_0xc099c8){var _0x251146;if(_0x54d574[_0x5ee6('0x22')][_0x5ee6('0x23')]['id']){db['User'][_0x5ee6('0x24')]({'attributes':['id',_0x5ee6('0x5'),_0x5ee6('0x7'),_0x5ee6('0x25')],'where':{'id':_0x54d574[_0x5ee6('0x22')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x5ee6('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee6('0x27')],'as':_0x5ee6('0x28'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5ee6('0x29')],'as':_0x5ee6('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee6('0x2b')],'as':_0x5ee6('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x5ee6('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x5ee6('0xd')](function(_0xf95a72){if(_0xf95a72){_0x251146=_0xf95a72;_0x54d574[_0x25ed7d](util['format'](_0x5ee6('0x21'),_0xf95a72[_0x5ee6('0x5')]));var _0x11eec3=[];switch(_0xf95a72[_0x5ee6('0x7')]){case _0x5ee6('0x2e'):_0x54d574[_0x25ed7d](_0x5ee6('0x2f'));_0x54d574[_0x25ed7d](_0x5ee6('0x30'));if(queryQueues['hasOwnProperty'](_0x5ee6('0x31'))){delete queryQueues[_0x5ee6('0x31')];}_0x11eec3['push'](db[_0x5ee6('0x32')][_0x5ee6('0x16')](queryQueues));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x34')][_0x5ee6('0x16')](queryQueues));_0x11eec3[_0x5ee6('0x33')](db['FaxQueue'][_0x5ee6('0x16')](queryQueues));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x35')][_0x5ee6('0x16')](queryQueues));_0x11eec3['push'](db[_0x5ee6('0x36')][_0x5ee6('0x16')](queryQueues));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x37')][_0x5ee6('0x16')](queryQueues));_0x11eec3['push'](db[_0x5ee6('0x38')][_0x5ee6('0x16')](queryQueues));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x1b')][_0x5ee6('0x16')](queryTelephones));_0x11eec3[_0x5ee6('0x33')](db['Trunk'][_0x5ee6('0x16')](queryTrunks));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x1c')][_0x5ee6('0x16')](queryCampaigns));_0x11eec3[_0x5ee6('0x33')](db[_0x5ee6('0x1b')][_0x5ee6('0x16')](queryAgents));break;case _0x5ee6('0x39'):_0x54d574[_0x25ed7d]('voice:inbound');_0x54d574[_0x25ed7d](_0x5ee6('0x30'));_0x11eec3['push'](getAssociatedResources('VoiceQueues',_0xf95a72['userProfileId'],'VoiceQueue'));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources(_0x5ee6('0x3a'),_0xf95a72['userProfileId'],_0x5ee6('0x34')));_0x11eec3['push'](getAssociatedResources('FaxQueues',_0xf95a72['userProfileId'],_0x5ee6('0x3b')));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources('SmsQueues',_0xf95a72[_0x5ee6('0x25')],_0x5ee6('0x35')));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources(_0x5ee6('0x12'),_0xf95a72[_0x5ee6('0x25')],_0x5ee6('0x36')));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources(_0x5ee6('0x13'),_0xf95a72[_0x5ee6('0x25')],'OpenchannelQueue'));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources(_0x5ee6('0x14'),_0xf95a72[_0x5ee6('0x25')],_0x5ee6('0x38')));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources('Telephones',_0xf95a72[_0x5ee6('0x25')],'User'));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources('Trunks',_0xf95a72[_0x5ee6('0x25')],_0x5ee6('0x3c')));_0x11eec3[_0x5ee6('0x33')](getAssociatedResources('IvrCampaigns',_0xf95a72[_0x5ee6('0x25')],_0x5ee6('0x1c')));_0x11eec3[_0x5ee6('0x33')](db['User'][_0x5ee6('0x16')](queryAgents));break;case'agent':_0x54d574[_0x25ed7d](_0x5ee6('0x2f'));_0x54d574[_0x25ed7d](_0x5ee6('0x30'));_0x11eec3[_0x5ee6('0x33')](_0xf95a72['getVoiceQueues']({'attributes':['id',_0x5ee6('0x5')]}));_0x11eec3[_0x5ee6('0x33')](_0xf95a72[_0x5ee6('0x3d')]({'attributes':['id','name']}));_0x11eec3[_0x5ee6('0x33')](_0xf95a72[_0x5ee6('0x3e')]({'attributes':['id',_0x5ee6('0x5')]}));_0x11eec3[_0x5ee6('0x33')](_0xf95a72[_0x5ee6('0x3f')]({'attributes':['id',_0x5ee6('0x5')]}));_0x11eec3[_0x5ee6('0x33')](_0xf95a72[_0x5ee6('0x40')]({'attributes':['id',_0x5ee6('0x5')]}));_0x11eec3[_0x5ee6('0x33')](_0xf95a72[_0x5ee6('0x41')]({'attributes':['id','name']}));_0x11eec3['push'](_0xf95a72[_0x5ee6('0x42')]({'attributes':['id',_0x5ee6('0x5')]}));break;}return BPromise[_0x5ee6('0x43')](_0x11eec3);}})['then'](function(_0x25ca0c){if(_0x25ca0c&&_0x25ca0c[_0x5ee6('0x20')]){for(var _0x911751=0x0;_0x911751<_0x25ca0c[_0x5ee6('0x20')];_0x911751+=0x1){for(var _0x29baa7=0x0;_0x29baa7<_0x25ca0c[_0x911751][_0x5ee6('0x20')];_0x29baa7+=0x1){switch(_0x911751){case 0x0:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x44'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x1:joinOrLeaveQueues(_0x54d574,_0x25ed7d,'chat',_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x2:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x45'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x3:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x46'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x4:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x47'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x5:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x48'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x6:joinOrLeaveQueues(_0x54d574,_0x25ed7d,_0x5ee6('0x49'),_0x25ca0c[_0x911751][_0x29baa7]);break;case 0x7:if(_0x251146[_0x5ee6('0x7')]!==_0x5ee6('0x8'))_0x54d574[_0x25ed7d](util[_0x5ee6('0x1e')](_0x5ee6('0x4a'),_0x25ca0c[_0x911751][_0x29baa7][_0x5ee6('0x5')]));break;case 0x8:if(_0x251146[_0x5ee6('0x7')]!=='agent')_0x54d574[_0x25ed7d](util[_0x5ee6('0x1e')](_0x5ee6('0x4b'),_0x25ca0c[_0x911751][_0x29baa7][_0x5ee6('0x5')]));break;case 0x9:if(_0x251146[_0x5ee6('0x7')]!==_0x5ee6('0x8'))_0x54d574[_0x25ed7d](util[_0x5ee6('0x1e')](_0x5ee6('0x4c'),_0x25ca0c[_0x911751][_0x29baa7]['type'],_0x25ca0c[_0x911751][_0x29baa7][_0x5ee6('0x5')]));break;case 0xa:_0x54d574[_0x25ed7d](util[_0x5ee6('0x1e')]('user:%s',_0x25ca0c[_0x911751][_0x29baa7][_0x5ee6('0x5')]));break;}}}}})[_0x5ee6('0xd')](function(){if(_0x25ed7d==='leave'){var _0x3a0e2c=_[_0x5ee6('0x4d')](_0x251146[_0x5ee6('0x26')],'id');return _0x251146['removeChatInteractions'](_0x3a0e2c)['then'](function(){for(var _0x3aae72=0x0;_0x3aae72<_0x3a0e2c[_0x5ee6('0x20')];_0x3aae72+=0x1){_0xc099c8[_0x5ee6('0x4e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3a0e2c[_0x3aae72]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0xd')](function(){if(_0x25ed7d==='leave'){var _0x21fbdb=_[_0x5ee6('0x4d')](_0x251146[_0x5ee6('0x28')],'id');return _0x251146[_0x5ee6('0x4f')](_0x21fbdb)[_0x5ee6('0xd')](function(){for(var _0x5f5af8=0x0;_0x5f5af8<_0x21fbdb[_0x5ee6('0x20')];_0x5f5af8+=0x1){_0xc099c8[_0x5ee6('0x4e')](_0x5ee6('0x50'),{'MailInteractionId':Number(_0x21fbdb[_0x5f5af8]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0xd')](function(){if(_0x25ed7d===_0x5ee6('0x51')){var _0x5a4d26=_[_0x5ee6('0x4d')](_0x251146[_0x5ee6('0x52')],'id');return _0x251146['removeFaxInteractions'](_0x5a4d26)[_0x5ee6('0xd')](function(){for(var _0x2394c0=0x0;_0x2394c0<_0x5a4d26[_0x5ee6('0x20')];_0x2394c0+=0x1){_0xc099c8[_0x5ee6('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5a4d26[_0x2394c0]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0xd')](function(){if(_0x25ed7d==='leave'){var _0x22362f=_['map'](_0x251146[_0x5ee6('0x2a')],'id');return _0x251146[_0x5ee6('0x53')](_0x22362f)['then'](function(){for(var _0x292017=0x0;_0x292017<_0x22362f['length'];_0x292017+=0x1){_0xc099c8[_0x5ee6('0x4e')](_0x5ee6('0x54'),{'SmsInteractionId':Number(_0x22362f[_0x292017]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0xd')](function(){if(_0x25ed7d==='leave'){var _0x46d553=_[_0x5ee6('0x4d')](_0x251146['OpenchannelInteractions'],'id');return _0x251146['removeOpenchannelInteractions'](_0x46d553)[_0x5ee6('0xd')](function(){for(var _0x5ab169=0x0;_0x5ab169<_0x46d553[_0x5ee6('0x20')];_0x5ab169+=0x1){_0xc099c8[_0x5ee6('0x4e')](_0x5ee6('0x55'),{'OpenchannelInteractionId':Number(_0x46d553[_0x5ab169]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0xd')](function(){if(_0x25ed7d===_0x5ee6('0x51')){var _0x16f24c=_['map'](_0x251146[_0x5ee6('0x2d')],'id');return _0x251146[_0x5ee6('0x56')](_0x16f24c)['then'](function(){for(var _0x45fbfd=0x0;_0x45fbfd<_0x16f24c[_0x5ee6('0x20')];_0x45fbfd+=0x1){_0xc099c8[_0x5ee6('0x4e')](_0x5ee6('0x57'),{'WhatsappInteractionId':Number(_0x16f24c[_0x45fbfd]),'UserId':Number(_0x251146['id'])});}});}})[_0x5ee6('0x58')](function(_0x2d6157){_0x54d574[_0x5ee6('0x59')](_0x2d6157);});}}function onDisconnect(_0x4c9e88,_0x5d1386){joinOrLeave(_0x4c9e88,_0x5ee6('0x51'),_0x5d1386);}function onConnect(_0x1698d5){joinOrLeave(_0x1698d5,'join');}exports[_0x5ee6('0x5a')]=function(_0x323259){_0x323259['on'](_0x5ee6('0x5b'),function(_0x56a6a2){_0x56a6a2['setMaxListeners'](0x0);_0x56a6a2[_0x5ee6('0x5c')]=_0x56a6a2[_0x5ee6('0x5d')][_0x5ee6('0x5b')]['remoteAddress']+':'+_0x56a6a2[_0x5ee6('0x5d')][_0x5ee6('0x5b')]['remotePort'];_0x56a6a2[_0x5ee6('0x5e')]=new Date();_0x56a6a2[_0x5ee6('0x59')]=function(_0x53eb9b){console[_0x5ee6('0x59')](_0x5ee6('0x5f')+_0x56a6a2[_0x5ee6('0x60')][_0x5ee6('0x5')]+'['+_0x56a6a2['address']+']',_0x53eb9b);};_0x56a6a2['on']('disconnect',function(){onDisconnect(_0x56a6a2,_0x323259);_0x56a6a2[_0x5ee6('0x59')](_0x5ee6('0x61'));});onConnect(_0x56a6a2);_0x56a6a2['log'](_0x5ee6('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 06434cc..3cdf79c 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 _0xebcb=['Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','Sms','SmsInteraction','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','get','motionChannel','event','direction','resolve','ContactId','undefined','QueryTypes','SELECT','UserId','interface','format','SIP/%s','channel','catch','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','contact','agent','AfterCreate','closed','substatus','Sequelize','name','User','find','fullname','email','internal','default','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http'];(function(_0x161be6,_0x2c6418){var _0xa761e7=function(_0x2c9379){while(--_0x2c9379){_0x161be6['push'](_0x161be6['shift']());}};_0xa761e7(++_0x2c6418);}(_0xebcb,0x8b));var _0xbebc=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0xebcb[_0x11946c];return _0x383935;};'use strict';var util=require(_0xbebc('0x0'));var db=require(_0xbebc('0x1'))['db'];var jayson=require(_0xbebc('0x2'));var logger=require(_0xbebc('0x3'))(_0xbebc('0x4'));var client=jayson[_0xbebc('0x5')][_0xbebc('0x6')]({'port':0x232a});var triggers=[{'channel':_0xbebc('0x7'),'model':_0xbebc('0x8'),'event':_0xbebc('0x9'),'condition':_0xbebc('0xa'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xbebc('0xb'),'condition':_0xbebc('0xc'),'callback':afterUpdate},{'channel':_0xbebc('0x7'),'model':_0xbebc('0xd'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbebc('0xe'),'model':'SmsInteraction','event':_0xbebc('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0xbebc('0xf'),'event':_0xbebc('0xb'),'condition':_0xbebc('0xc'),'callback':afterUpdate},{'channel':_0xbebc('0xe'),'model':_0xbebc('0x10'),'event':_0xbebc('0x9'),'condition':_0xbebc('0x11'),'callback':afterCreateMessage},{'channel':_0xbebc('0x12'),'model':_0xbebc('0x13'),'event':'afterCreate','condition':_0xbebc('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xbebc('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbebc('0x12'),'model':_0xbebc('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbebc('0x15'),'model':_0xbebc('0x16'),'event':_0xbebc('0x9'),'condition':_0xbebc('0xa'),'callback':afterCreate},{'channel':_0xbebc('0x15'),'model':_0xbebc('0x16'),'event':_0xbebc('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0xbebc('0x17'),'event':_0xbebc('0x9'),'condition':_0xbebc('0x11'),'callback':afterCreateMessage},{'channel':_0xbebc('0x18'),'model':_0xbebc('0x19'),'event':_0xbebc('0x9'),'condition':_0xbebc('0xa'),'callback':afterCreate},{'channel':'Mail','model':_0xbebc('0x19'),'event':_0xbebc('0xb'),'condition':_0xbebc('0xc'),'callback':afterUpdate},{'channel':_0xbebc('0x18'),'model':_0xbebc('0x1a'),'event':_0xbebc('0x9'),'condition':_0xbebc('0x11'),'callback':afterCreateMessage},{'channel':_0xbebc('0x1b'),'model':_0xbebc('0x1c'),'event':'afterCreate','condition':_0xbebc('0xa'),'callback':afterCreate},{'channel':_0xbebc('0x1b'),'model':_0xbebc('0x1c'),'event':_0xbebc('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbebc('0x1b'),'model':'OpenchannelMessage','event':_0xbebc('0x9'),'condition':_0xbebc('0x11'),'callback':afterCreateMessage}];function request(_0x522596){return client[_0xbebc('0x1d')](_0xbebc('0x1e'),_0x522596)[_0xbebc('0x1f')](function(_0xdb0437){logger[_0xbebc('0x20')](_0xbebc('0x21'),_0xbebc('0x1e'),_0xdb0437);if(_0xdb0437[_0xbebc('0x22')]){if(_0xdb0437[_0xbebc('0x22')][_0xbebc('0x23')]===0x1f4){logger[_0xbebc('0x22')](_0xbebc('0x21'),_0xbebc('0x1e'),_0xdb0437[_0xbebc('0x22')]);}}})['catch'](function(_0x35aa61){logger['error'](_0xbebc('0x21'),'EventManager',_0x35aa61);});}function afterCreateMessage(_0x100fab){return function(_0x25dd97){_0x25dd97=_0x25dd97[_0xbebc('0x24')]({'plain':!![]});_0x25dd97['channel']=_0x100fab;_0x25dd97[_0xbebc('0x25')]=_0x100fab;_0x25dd97[_0xbebc('0x26')]=_0x25dd97[_0xbebc('0x27')];Promise[_0xbebc('0x28')]()['then'](function(){if(typeof _0x25dd97[_0xbebc('0x29')]===_0xbebc('0x2a'))return null;var _0x52481c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25dd97[_0xbebc('0x29')];return db['sequelize']['query'](_0x52481c,{'type':db['Sequelize'][_0xbebc('0x2b')][_0xbebc('0x2c')],'raw':!![]});})[_0xbebc('0x1f')](function(_0x436608){if(_0x436608){_0x25dd97['contact']=_0x436608[0x0];}if(typeof _0x25dd97[_0xbebc('0x2d')]===_0xbebc('0x2a'))return;return getAgent(_0x25dd97[_0xbebc('0x2d')]);})[_0xbebc('0x1f')](function(_0x2a3f9b){if(_0x2a3f9b){_0x25dd97[_0xbebc('0x2e')]=util[_0xbebc('0x2f')](_0xbebc('0x30'),_0x2a3f9b['name']);_0x25dd97['agent']=_0x2a3f9b;_0x25dd97[_0xbebc('0x31')]=_0x100fab;return request({'event':'incomingmessage','message':_0x25dd97});}else{return request({'event':'outgoingmessage','message':_0x25dd97});}})[_0xbebc('0x32')](function(_0x413f7f){logger[_0xbebc('0x22')](_0xbebc('0x21'),'AfterCreateMessage',_0x413f7f);});};}function afterCreate(_0x22d2b4,_0x24f085){return function(_0x141c5b){_0x141c5b=_0x141c5b[_0xbebc('0x24')]({'plain':!![]});_0x141c5b[_0xbebc('0x31')]=_0x22d2b4;_0x141c5b['motionChannel']=_0x22d2b4;_0x141c5b[_0xbebc('0x26')]=_0xbebc('0x33');Promise['resolve']()['then'](function(){var _0x145774=_0xbebc('0x34')+_0x141c5b['ContactId'];return db[_0xbebc('0x35')][_0xbebc('0x36')](_0x145774,{'type':db['Sequelize'][_0xbebc('0x2b')]['SELECT'],'raw':!![]});})[_0xbebc('0x1f')](function(_0x4d260d){if(_0x4d260d){_0x141c5b[_0xbebc('0x37')]=_0x4d260d[0x0];}if(typeof _0x141c5b[_0xbebc('0x2d')]===_0xbebc('0x2a'))return;return getAgent(_0x141c5b['UserId']);})[_0xbebc('0x1f')](function(_0xb36266){if(_0xb36266){_0x141c5b[_0xbebc('0x2e')]=util[_0xbebc('0x2f')]('SIP/%s',_0xb36266['name']);_0x141c5b[_0xbebc('0x38')]=_0xb36266;}return request({'event':_0x24f085,'message':_0x141c5b});})[_0xbebc('0x32')](function(_0x3527cf){logger[_0xbebc('0x22')](_0xbebc('0x21'),_0xbebc('0x39'),_0x3527cf);});};}function afterUpdate(_0x2ebd15){return function(_0xbfdeb0){var _0x5a1e0c=_0xbfdeb0['changed']('closed')&&_0xbfdeb0[_0xbebc('0x3a')];var _0x5421a3=_0xbfdeb0['changed'](_0xbebc('0x3b'));if(_0x5a1e0c||_0x5421a3){var _0x2eae66=_0x5a1e0c?'closedinteraction':'substatus';var _0x191937=_0xbfdeb0[_0xbebc('0x24')]({'plain':!![]});_0x191937[_0xbebc('0x31')]=_0x2ebd15;_0x191937[_0xbebc('0x25')]=_0x2ebd15;_0x191937[_0xbebc('0x26')]=_0x5a1e0c?'closed':'substatus';var _0xdafe53=_0xbebc('0x34')+_0x191937[_0xbebc('0x29')];return db['sequelize'][_0xbebc('0x36')](_0xdafe53,{'type':db[_0xbebc('0x3c')][_0xbebc('0x2b')][_0xbebc('0x2c')],'raw':!![]})[_0xbebc('0x1f')](function(_0x41c6fc){if(_0x41c6fc){_0x191937[_0xbebc('0x37')]=_0x41c6fc[0x0];}if(typeof _0x191937[_0xbebc('0x2d')]==='undefined')return;return getAgent(_0x191937[_0xbebc('0x2d')]);})[_0xbebc('0x1f')](function(_0x2862e0){if(_0x2862e0){_0x191937[_0xbebc('0x2e')]=util['format']('SIP/%s',_0x2862e0[_0xbebc('0x3d')]);_0x191937[_0xbebc('0x38')]=_0x2862e0;}return request({'event':_0x2eae66,'message':_0x191937});})[_0xbebc('0x32')](function(_0x4a01fc){logger[_0xbebc('0x22')](_0xbebc('0x21'),'AfterUpdate',_0x4a01fc);});}};}function getAgent(_0x5507a2){return db[_0xbebc('0x3e')][_0xbebc('0x3f')]({'where':{'id':_0x5507a2},'attributes':['id',_0xbebc('0x3d'),_0xbebc('0x40'),_0xbebc('0x41'),_0xbebc('0x42')],'raw':!![]})[_0xbebc('0x1f')](function(_0x5a9bd0){return _0x5a9bd0;});}exports[_0xbebc('0x43')]=function(){for(var _0x55c38b=0x0;_0x55c38b=_0x9d5e3b[_0x37c1('0x16')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x3bade4(_0x15eb22);})[_0x37c1('0x17')](function(_0x25818a){_0x3762f5(_0x25818a);});});}; \ No newline at end of file +var _0x2b27=['blockedAt','updateAttributes','getLicense','role','agent','then','agents','lodash','bluebird','./license/util','voice','mail','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x2b27,0x1b7));var _0x72b2=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x2b27[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x72b2('0x0'));var BPromise=require(_0x72b2('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x72b2('0x2'));var channels=[_0x72b2('0x3'),_0x72b2('0x4'),'chat','fax','sms','whatsapp',_0x72b2('0x5')];exports['getChannels']=function(){return channels;};exports[_0x72b2('0x6')]=function(_0x3ebf3d){_0x3ebf3d=_0x3ebf3d[_0x72b2('0x7')]();return _[_0x72b2('0x8')](channels,_0x3ebf3d);};exports[_0x72b2('0x9')]=function(_0x33df50,_0x263427,_0x4fd580,_0x418731){var _0x5529ea={'loginAttempts':_0x263427,'blocked':_0x4fd580};if(!_[_0x72b2('0xa')](_0x418731)){_0x5529ea[_0x72b2('0xb')]=_0x418731;}return _0x33df50[_0x72b2('0xc')](_0x5529ea);};exports[_0x72b2('0xd')]=function(_0x9f8e5b){return new BPromise(function(_0x4f7ee,_0x1a9cb7){var _0x2a9549=0x0;if(_0x9f8e5b[_0x72b2('0xe')]!==_0x72b2('0xf')){_0x4f7ee(_0x9f8e5b);}db['User']['count']({'where':{'role':_0x72b2('0xf'),'online':!![],'id':{'$ne':_0x9f8e5b['id']}}})[_0x72b2('0x10')](function(_0x193d79){_0x2a9549=_0x193d79;return util[_0x72b2('0xd')]();})['then'](function(_0x4b7c5b){if(_0x4b7c5b&&_0x4b7c5b[_0x72b2('0x11')]&&_0x2a9549>=_0x4b7c5b[_0x72b2('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4f7ee(_0x9f8e5b);})['catch'](function(_0x542f04){_0x1a9cb7(_0x542f04);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 4df0544..9492ed3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x220b=['send','404','status'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x220b,0x1a2));var _0xb220=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x220b[_0x5093e9];return _0x4c9a22;};'use strict';module['exports'][0x194]=function pageNotFound(_0x299caa,_0x69e237){var _0xd89d7d=_0xb220('0x0');var _0x53992c=0x194;var _0x2d2ad3={'status':_0x53992c};_0x69e237['status'](_0x2d2ad3[_0xb220('0x1')]);_0x69e237['render'](_0xd89d7d,{},function(_0x124b93,_0x2ff855){if(_0x124b93){return _0x69e237[_0xb220('0x1')](_0x2d2ad3[_0xb220('0x1')])['json'](_0x2d2ad3);}_0x69e237[_0xb220('0x2')](_0x2ff855);});}; \ No newline at end of file +var _0xe896=['404','status','render','exports'];(function(_0x32ef48,_0x275bf8){var _0x3f3546=function(_0x11ccbe){while(--_0x11ccbe){_0x32ef48['push'](_0x32ef48['shift']());}};_0x3f3546(++_0x275bf8);}(_0xe896,0x15f));var _0x6e89=function(_0x3827e6,_0x3dd74f){_0x3827e6=_0x3827e6-0x0;var _0x3df83c=_0xe896[_0x3827e6];return _0x3df83c;};'use strict';module[_0x6e89('0x0')][0x194]=function pageNotFound(_0x5d372e,_0x2a839e){var _0x4f3bd5=_0x6e89('0x1');var _0x485ffd=0x194;var _0x482d2c={'status':_0x485ffd};_0x2a839e[_0x6e89('0x2')](_0x482d2c[_0x6e89('0x2')]);_0x2a839e[_0x6e89('0x3')](_0x4f3bd5,{},function(_0x5955ca,_0x4a847e){if(_0x5955ca){return _0x2a839e[_0x6e89('0x2')](_0x482d2c['status'])['json'](_0x482d2c);}_0x2a839e['send'](_0x4a847e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a327195..225b5d1 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','SenderId','belongsTo','userProfileId','ChatGroup','Groups','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','Smtp','Disposition','Dispositions','Answers','MailApplication','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','Items','FaxAccountId','Interactions','FaxApplication','Exntensions','FaxMessage','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','ProactiveActions','Agent','Website','chat_interaction_has_tags','ThroughTags','ChatInteractionId','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','FaxApplications','AnalyticDefaultReport','CustomReportId','Mohs','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','Fields','DefaultReportId','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','Configurations','int_desk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','Dynamics365Field','FromId','ToId','SessionId','SmsQueueReport','ProjectId','ChatQueues','team_has_fax_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','whatsapp_interaction_has_tags','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','xcall','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','utf8','database','options','username','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../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','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount'];(function(_0x43f170,_0x537264){var _0x453e96=function(_0x35a103){while(--_0x35a103){_0x43f170['push'](_0x43f170['shift']());}};_0x453e96(++_0x537264);}(_0x6324,0x142));var _0x4632=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0x6324[_0x1ebe2f];return _0xdeb06f;};'use strict';var config=require(_0x4632('0x0'));var Sequelize=require(_0x4632('0x1'));var _=require(_0x4632('0x2'));var jstz=require(_0x4632('0x3'));var timezone=jstz['determine']();config[_0x4632('0x1')]=_['defaultsDeep'](config[_0x4632('0x1')],{'database':'motion2','username':_0x4632('0x4'),'password':'xC@LL1234','options':{'host':_0x4632('0x5'),'port':0xcea,'dialect':_0x4632('0x6'),'dialectOptions':{'charset':_0x4632('0x7')},'logging':![],'timezone':timezone[_0x4632('0x8')](),'define':{'charset':'utf8','collate':_0x4632('0x9')}}});config[_0x4632('0xa')]=_[_0x4632('0xb')](config['sequelizeHistory'],{'database':_0x4632('0xc'),'username':_0x4632('0x4'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4632('0x6'),'dialectOptions':{'charset':_0x4632('0x7')},'logging':![],'timezone':timezone[_0x4632('0x8')](),'define':{'charset':_0x4632('0xd'),'collate':_0x4632('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4632('0x1')][_0x4632('0xe')],config[_0x4632('0x1')]['username'],config[_0x4632('0x1')]['password'],config[_0x4632('0x1')][_0x4632('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4632('0xa')][_0x4632('0xe')],config['sequelizeHistory'][_0x4632('0x10')],config[_0x4632('0xa')][_0x4632('0x11')],config[_0x4632('0xa')][_0x4632('0xf')])};db['User']=db['sequelize'][_0x4632('0x12')](_0x4632('0x13'));db[_0x4632('0x14')]=db[_0x4632('0x1')]['import'](_0x4632('0x15'));db[_0x4632('0x16')]=db[_0x4632('0x1')]['import'](_0x4632('0x17'));db[_0x4632('0x18')]=db['sequelize']['import'](_0x4632('0x19'));db[_0x4632('0x1a')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x1b'));db[_0x4632('0x1c')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x1d'));db[_0x4632('0x1e')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x1f'));db[_0x4632('0x20')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x21'));db[_0x4632('0x22')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x23'));db[_0x4632('0x24')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x25'));db[_0x4632('0x26')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x27'));db[_0x4632('0x28')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x29'));db['VoiceAgentReport']=db['sequelize'][_0x4632('0x12')](_0x4632('0x2a'));db[_0x4632('0x2b')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x2c'));db[_0x4632('0x2d')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x2e'));db['Trunk']=db[_0x4632('0x1')]['import'](_0x4632('0x2f'));db['VoiceTransferReport']=db['sequelize'][_0x4632('0x12')](_0x4632('0x30'));db[_0x4632('0x31')]=db['sequelize']['import'](_0x4632('0x32'));db[_0x4632('0x33')]=db['sequelize']['import'](_0x4632('0x34'));db[_0x4632('0x35')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x36'));db[_0x4632('0x37')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x4632('0x38')]=db[_0x4632('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x4632('0x39')]=db['sequelize']['import'](_0x4632('0x3a'));db['UserOpenchannelQueue']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x3b'));db['UserWhatsappQueue']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x3c'));db[_0x4632('0x3d')]=db[_0x4632('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db[_0x4632('0x3e')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db['sequelize'][_0x4632('0x12')](_0x4632('0x3f'));db['MailQueue']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x40'));db[_0x4632('0x41')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x42'));db[_0x4632('0x43')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x44'));db[_0x4632('0x45')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x46'));db['MailApplication']=db[_0x4632('0x1')][_0x4632('0x12')]('../api/mailApplication/mailApplication.model');db[_0x4632('0x47')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x48'));db[_0x4632('0x49')]=db[_0x4632('0x1')]['import'](_0x4632('0x4a'));db[_0x4632('0x4b')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x4c'));db['FaxApplication']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x4d'));db[_0x4632('0x4e')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x4f'));db['FaxMessage']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x50'));db[_0x4632('0x51')]=db[_0x4632('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x4632('0x52')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x53'));db['SmsAccount']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x54'));db[_0x4632('0x55')]=db[_0x4632('0x1')]['import'](_0x4632('0x56'));db[_0x4632('0x57')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x58'));db[_0x4632('0x59')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x5a'));db[_0x4632('0x5b')]=db[_0x4632('0x1')]['import'](_0x4632('0x5c'));db[_0x4632('0x5d')]=db[_0x4632('0x1')]['import'](_0x4632('0x5e'));db[_0x4632('0x5f')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x60'));db[_0x4632('0x61')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x62'));db[_0x4632('0x63')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x64'));db['OpenchannelQueue']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x65'));db[_0x4632('0x66')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x67'));db[_0x4632('0x68')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x69'));db[_0x4632('0x6a')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x6b'));db[_0x4632('0x6c')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x6d'));db[_0x4632('0x6e')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x6f'));db[_0x4632('0x70')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x71'));db['ChatQueue']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x72'));db['ChatGroup']=db[_0x4632('0x1')][_0x4632('0x12')]('../api/chatGroup/chatGroup.model');db[_0x4632('0x73')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x4632('0x74')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x75'));db[_0x4632('0x76')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x77'));db[_0x4632('0x78')]=db[_0x4632('0x1')]['import'](_0x4632('0x79'));db[_0x4632('0x7a')]=db['sequelize'][_0x4632('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x7b'));db[_0x4632('0x7c')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x7d'));db[_0x4632('0x7e')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x7f'));db[_0x4632('0x80')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x81'));db[_0x4632('0x82')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/automation/automation.model');db[_0x4632('0x83')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x84'));db['Disposition']=db['sequelize'][_0x4632('0x12')]('../api/disposition/disposition.model');db[_0x4632('0x85')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x86'));db[_0x4632('0x87')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x88'));db['Pause']=db['sequelize'][_0x4632('0x12')](_0x4632('0x89'));db[_0x4632('0x8a')]=db[_0x4632('0x1')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x4632('0x1')]['import'](_0x4632('0x8b'));db[_0x4632('0x8c')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x8d'));db[_0x4632('0x8e')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x8f'));db[_0x4632('0x90')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x91'));db[_0x4632('0x92')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/template/template.model');db[_0x4632('0x93')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x94'));db[_0x4632('0x95')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x96'));db[_0x4632('0x97')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x98'));db[_0x4632('0x99')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x9a'));db[_0x4632('0x9b')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x9c'));db['AnalyticDefaultReport']=db[_0x4632('0x1')][_0x4632('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4632('0x9d')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x9e'));db[_0x4632('0x9f')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xa0'));db[_0x4632('0xa1')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xa2'));db[_0x4632('0xa3')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xa4'));db[_0x4632('0xa5')]=db[_0x4632('0x1')]['import'](_0x4632('0xa6'));db[_0x4632('0xa7')]=db[_0x4632('0x1')]['import'](_0x4632('0xa8'));db[_0x4632('0xa9')]=db['sequelize']['import'](_0x4632('0xaa'));db[_0x4632('0xab')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xac'));db[_0x4632('0xad')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xae'));db[_0x4632('0xaf')]=db[_0x4632('0x1')]['import'](_0x4632('0xb0'));db[_0x4632('0xb1')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x4632('0xb2')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xb3'));db[_0x4632('0xb4')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xb5'));db[_0x4632('0xb6')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xb7'));db[_0x4632('0xb8')]=db[_0x4632('0x1')]['import'](_0x4632('0xb9'));db[_0x4632('0xba')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xbb'));db[_0x4632('0xbc')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xbd'));db[_0x4632('0xbe')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xbf'));db[_0x4632('0xc0')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xc1'));db[_0x4632('0xc2')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xc3'));db[_0x4632('0xc4')]=db['sequelize'][_0x4632('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4632('0xc5')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xc6'));db[_0x4632('0xc7')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xc8'));db[_0x4632('0xc9')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xca'));db[_0x4632('0xcb')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xcc'));db[_0x4632('0xcd')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xce'));db['ServicenowConfiguration']=db['sequelize'][_0x4632('0x12')](_0x4632('0xcf'));db[_0x4632('0xd0')]=db['sequelize'][_0x4632('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x4632('0xd1')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xd2'));db['Dynamics365Configuration']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xd3'));db['Dynamics365Field']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xd4'));db[_0x4632('0xd5')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xd6'));db[_0x4632('0xd7')]=db[_0x4632('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x4632('0xd8')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xd9'));db[_0x4632('0x97')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/integration/integration.model');db[_0x4632('0xda')]=db[_0x4632('0x1')]['import']('../api/network/network.model');db[_0x4632('0xdb')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xdc'));db[_0x4632('0xdd')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xde'));db[_0x4632('0xdf')]=db[_0x4632('0x1')]['import'](_0x4632('0xe0'));db[_0x4632('0xe1')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xe2'));db[_0x4632('0xe3')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xe4'));db['SmsQueueReport']=db[_0x4632('0x1')]['import'](_0x4632('0xe5'));db['SquareReport']=db[_0x4632('0x1')]['import'](_0x4632('0xe6'));db[_0x4632('0xe7')]=db[_0x4632('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x4632('0xe8')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xe9'));db[_0x4632('0xea')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xeb'));db['SquareOdbc']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xec'));db[_0x4632('0xed')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xee'));db[_0x4632('0xef')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/squareRecording/squareRecording.model');db[_0x4632('0xf0')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/squareMessage/squareMessage.model');db[_0x4632('0xf1')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xf2'));db[_0x4632('0xf3')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xf4'));db[_0x4632('0xf5')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/campaign/campaign.model');db[_0x4632('0xf6')]=db['sequelize'][_0x4632('0x12')](_0x4632('0xf7'));db['Attachment']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xf8'));db['Plugin']=db[_0x4632('0x1')][_0x4632('0x12')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xf9'));db[_0x4632('0xfa')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xfb'));db[_0x4632('0xfc')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0xfd'));db[_0x4632('0xfe')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4632('0xff')]=db[_0x4632('0x1')][_0x4632('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0x4632('0x100')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x101'));db[_0x4632('0x102')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x103'));db[_0x4632('0x104')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x105'));db[_0x4632('0x106')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x107'));db['UserProfileResource']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x108'));db['UserNotification']=db['sequelize']['import'](_0x4632('0x109'));db['WhatsappAccount']=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x10a'));db[_0x4632('0x10b')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x10c'));db[_0x4632('0x10d')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x10e'));db[_0x4632('0x10f')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x110'));db[_0x4632('0x111')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x112'));db[_0x4632('0x113')]=db['sequelize'][_0x4632('0x12')](_0x4632('0x114'));db[_0x4632('0x115')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x116'));db[_0x4632('0x117')]=db['sequelize'][_0x4632('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize']['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x4632('0x118')]=db[_0x4632('0x1')][_0x4632('0x12')](_0x4632('0x119'));db[_0x4632('0x11a')]=db['sequelize']['import'](_0x4632('0x11b'));db[_0x4632('0x11c')][_0x4632('0x11d')](db[_0x4632('0x22')],{'as':_0x4632('0x22'),'onDelete':_0x4632('0x11e'),'foreignKey':'UserId'});db['User'][_0x4632('0x11f')](db[_0x4632('0x1e')],{'as':_0x4632('0x120'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')]['hasMany'](db[_0x4632('0x31')],{'as':_0x4632('0x122'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')][_0x4632('0x11f')](db['VoiceExtension'],{'as':_0x4632('0x123'),'onDelete':_0x4632('0x11e'),'hooks':!![]});db['User']['hasMany'](db[_0x4632('0x124')],{'as':_0x4632('0x125'),'foreignKey':_0x4632('0x121')});db['User']['hasMany'](db[_0x4632('0x7c')],{'as':_0x4632('0x126'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')][_0x4632('0x11f')](db['ReportAgentPreview'],{'as':_0x4632('0x7e'),'foreignKey':'UserId'});db[_0x4632('0x11c')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x4632('0x127'),'foreignKey':'UserId'});db[_0x4632('0x11c')][_0x4632('0x11f')](db[_0x4632('0x6c')],{'as':'ChatInteractions','foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')]['hasMany'](db['SmsInteraction'],{'as':_0x4632('0x128'),'foreignKey':'UserId'});db[_0x4632('0x11c')][_0x4632('0x11f')](db[_0x4632('0x4e')],{'as':_0x4632('0x129'),'foreignKey':'UserId'});db['User']['hasMany'](db['MailInteraction'],{'as':_0x4632('0x12a'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')][_0x4632('0x11f')](db[_0x4632('0x10d')],{'as':_0x4632('0x12b'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x11c')][_0x4632('0x11f')](db[_0x4632('0x12c')],{'as':'UserNotifications','foreignKey':_0x4632('0x12d')});db['User'][_0x4632('0x12e')](db[_0x4632('0x104')],{'as':_0x4632('0x104'),'foreignKey':_0x4632('0x12f')});db[_0x4632('0x11c')]['belongsToMany'](db[_0x4632('0x130')],{'as':_0x4632('0x131'),'through':'chat_group_has_users'});db[_0x4632('0x11c')][_0x4632('0x132')](db['CmContact'],{'as':_0x4632('0x133'),'through':_0x4632('0x134')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x100')],{'as':_0x4632('0x135'),'through':_0x4632('0x136')});db[_0x4632('0x11c')]['belongsToMany'](db[_0x4632('0xf1')],{'through':_0x4632('0x137')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x43')],{'as':_0x4632('0x12a'),'through':_0x4632('0x138')});db['User'][_0x4632('0x132')](db[_0x4632('0x6c')],{'as':_0x4632('0x139'),'through':_0x4632('0x13a')});db[_0x4632('0x11c')]['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x4632('0x13b')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x57')],{'as':_0x4632('0x128'),'through':_0x4632('0x13c')});db['User']['belongsToMany'](db[_0x4632('0x61')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x10d')],{'as':_0x4632('0x12b'),'through':_0x4632('0x13d')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x1c')],{'as':_0x4632('0x13e'),'through':_0x4632('0x33'),'required':![]});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x102')],{'as':_0x4632('0x13f'),'through':_0x4632('0x11a'),'required':![]});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x140')],{'as':_0x4632('0x141'),'through':_0x4632('0x37'),'required':![]});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x142')],{'as':'ChatQueues','through':_0x4632('0x35'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x4632('0x51')],{'as':_0x4632('0x143'),'through':'UserFaxQueue','required':![]});db[_0x4632('0x11c')]['belongsToMany'](db['SmsQueue'],{'as':_0x4632('0x144'),'through':'UserSmsQueue','required':![]});db['User'][_0x4632('0x132')](db[_0x4632('0x145')],{'as':_0x4632('0x146'),'through':_0x4632('0x147'),'required':![]});db[_0x4632('0x11c')][_0x4632('0x132')](db['WhatsappQueue'],{'as':_0x4632('0x148'),'through':_0x4632('0x149'),'required':![]});db[_0x4632('0x11c')]['belongsToMany'](db[_0x4632('0x100')],{'through':'cm_user_has_lists'});db[_0x4632('0x11c')]['belongsToMany'](db['ChatWebsite'],{'as':_0x4632('0x14a'),'through':_0x4632('0x14b')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x14c')],{'as':'FaxAccounts','through':_0x4632('0x14d')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x14e')],{'as':_0x4632('0x14f'),'through':_0x4632('0x150')});db[_0x4632('0x11c')][_0x4632('0x132')](db['OpenchannelAccount'],{'as':_0x4632('0x151'),'through':_0x4632('0x152')});db[_0x4632('0x11c')]['belongsToMany'](db[_0x4632('0x153')],{'as':_0x4632('0x154'),'through':_0x4632('0x155')});db[_0x4632('0x11c')][_0x4632('0x132')](db[_0x4632('0x156')],{'as':_0x4632('0x157'),'through':'user_has_whatsapp_accounts'});db[_0x4632('0x11c')]['belongsToMany'](db['SquareProject'],{'as':_0x4632('0x158'),'through':_0x4632('0x159')});db[_0x4632('0x14')][_0x4632('0x11f')](db[_0x4632('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x4632('0x16')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x4632('0x11e')});db[_0x4632('0x18')][_0x4632('0x11f')](db[_0x4632('0x18')],{'as':_0x4632('0x15a'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x1a')]['belongsToMany'](db[_0x4632('0x8e')],{'as':_0x4632('0x15b'),'through':'moh_has_sounds'});db['VoiceQueue'][_0x4632('0x11f')](db[_0x4632('0x31')],{'as':_0x4632('0x15c'),'foreignKey':_0x4632('0x15d')});db[_0x4632('0x1c')][_0x4632('0x11f')](db[_0x4632('0x78')],{'as':_0x4632('0x15e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x4632('0x11f')](db['CmHopperFinal'],{'as':_0x4632('0x125'),'foreignKey':_0x4632('0x15d')});db[_0x4632('0x1c')][_0x4632('0x11f')](db['CmHopperHistory'],{'as':_0x4632('0x15f'),'foreignKey':_0x4632('0x15d')});db['VoiceQueue'][_0x4632('0x11f')](db['ReportAgentPreview'],{'as':_0x4632('0x7e'),'foreignKey':_0x4632('0x15d')});db[_0x4632('0x1c')][_0x4632('0x11f')](db[_0x4632('0x7a')],{'as':_0x4632('0x160'),'foreignKey':_0x4632('0x15d')});db[_0x4632('0x1c')][_0x4632('0x11f')](db[_0x4632('0xe3')],{'as':_0x4632('0x161'),'foreignKey':_0x4632('0x15d')});db[_0x4632('0x1c')][_0x4632('0x12e')](db[_0x4632('0x162')],{'as':_0x4632('0x162'),'foreignKey':_0x4632('0x163')});db['VoiceQueue'][_0x4632('0x12e')](db[_0x4632('0x162')],{'as':_0x4632('0x164'),'foreignKey':_0x4632('0x165')});db[_0x4632('0x1c')][_0x4632('0x12e')](db[_0x4632('0x87')],{'as':'Interval','foreignKey':_0x4632('0x166')});db[_0x4632('0x1c')][_0x4632('0x12e')](db[_0x4632('0x167')],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db[_0x4632('0x1c')][_0x4632('0x132')](db[_0x4632('0x100')],{'as':_0x4632('0x135'),'through':_0x4632('0x16a')});db[_0x4632('0x1c')][_0x4632('0x132')](db['User'],{'as':_0x4632('0x16b'),'through':_0x4632('0x33')});db[_0x4632('0x1c')][_0x4632('0x132')](db[_0x4632('0xf1')],{'as':_0x4632('0x16c'),'through':_0x4632('0x16d')});db[_0x4632('0x1c')][_0x4632('0x132')](db['CmList'],{'as':'BlackLists','through':_0x4632('0x16e')});db[_0x4632('0x1e')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':_0x4632('0x11c'),'foreignKey':_0x4632('0x121')});db['ScreenRecording'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':'User','foreignKey':_0x4632('0x121')});db[_0x4632('0x22')]['hasMany'](db['VoiceMailMessage'],{'as':_0x4632('0x16f'),'onDelete':_0x4632('0x11e'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x4632('0x24')][_0x4632('0x12e')](db[_0x4632('0x22')],{'foreignKey':_0x4632('0x170'),'targetKey':_0x4632('0x171')});db[_0x4632('0x26')][_0x4632('0x11f')](db['VoiceQueueReport'],{'as':_0x4632('0x172'),'foreignKey':_0x4632('0x173'),'constraints':![]});db[_0x4632('0x26')][_0x4632('0x11f')](db[_0x4632('0x174')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x4632('0x26')]['belongsTo'](db[_0x4632('0x11c')],{'as':_0x4632('0x11c'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x26')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x3d')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x4632('0x177')});db[_0x4632('0x3e')][_0x4632('0x12e')](db['MailAccount'],{'as':_0x4632('0x14e'),'foreignKey':_0x4632('0x177')});db[_0x4632('0x14e')][_0x4632('0x11d')](db[_0x4632('0x3d')],{'as':'Imap','onDelete':_0x4632('0x11e')});db[_0x4632('0x14e')][_0x4632('0x11d')](db[_0x4632('0x3e')],{'as':_0x4632('0x178'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x14e')][_0x4632('0x11f')](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':'MailAccountId','onDelete':_0x4632('0x11e')});db[_0x4632('0x14e')][_0x4632('0x11f')](db[_0x4632('0x83')],{'as':_0x4632('0x17b'),'foreignKey':_0x4632('0x177')});db[_0x4632('0x14e')][_0x4632('0x11f')](db[_0x4632('0x45')],{'as':_0x4632('0x16f'),'foreignKey':_0x4632('0x177')});db[_0x4632('0x14e')][_0x4632('0x11f')](db[_0x4632('0x43')],{'as':'Interactions'});db[_0x4632('0x14e')][_0x4632('0x11f')](db[_0x4632('0x17c')],{'as':_0x4632('0x15a')});db[_0x4632('0x14e')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e')});db['MailAccount']['belongsTo'](db[_0x4632('0x92')],{'as':'Template','foreignKey':_0x4632('0x17f')});db['MailAccount'][_0x4632('0x12e')](db[_0x4632('0x167')],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db['MailAccount'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x4632('0x140')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':'UserMailQueue'});db[_0x4632('0x140')]['belongsToMany'](db[_0x4632('0xf1')],{'through':_0x4632('0x180'),'as':'Teams'});db['MailInteraction'][_0x4632('0x11f')](db[_0x4632('0x45')],{'as':_0x4632('0x16f'),'onDelete':'cascade','foreignKey':_0x4632('0x181')});db['MailInteraction']['belongsTo'](db[_0x4632('0x14e')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x177')});db[_0x4632('0x43')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x43')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':_0x4632('0x183'),'foreignKey':_0x4632('0x121')});db[_0x4632('0x43')]['belongsToMany'](db[_0x4632('0x90')],{'through':_0x4632('0x184'),'as':'Tags'});db[_0x4632('0x43')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x184'),'as':'ThroughTags'});db[_0x4632('0x43')]['belongsToMany'](db[_0x4632('0x11c')],{'as':_0x4632('0x185'),'through':_0x4632('0x138'),'foreignKey':_0x4632('0x181')});db[_0x4632('0x45')][_0x4632('0x11f')](db[_0x4632('0x186')],{'as':_0x4632('0x187'),'onDelete':_0x4632('0x11e')});db['MailMessage'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':_0x4632('0x11c')});db[_0x4632('0x45')]['belongsTo'](db[_0x4632('0x76')],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x175')});db[_0x4632('0x45')]['belongsTo'](db['MailInteraction'],{'as':_0x4632('0x188'),'foreignKey':_0x4632('0x181')});db[_0x4632('0x45')]['belongsTo'](db[_0x4632('0x14e')],{'as':'Account','foreignKey':_0x4632('0x177')});db[_0x4632('0x45')][_0x4632('0x12e')](db[_0x4632('0x66')],{'as':_0x4632('0x66'),'foreignKey':_0x4632('0x189')});db['MailMessage'][_0x4632('0x12e')](db[_0x4632('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0x4632('0x18a')});db[_0x4632('0x17c')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'onDelete':'restrict'});db[_0x4632('0x17c')][_0x4632('0x12e')](db[_0x4632('0x140')],{'onDelete':'restrict'});db[_0x4632('0x17c')][_0x4632('0x12e')](db[_0x4632('0x14e')],{'onDelete':_0x4632('0x18b')});db['MailApplication'][_0x4632('0x12e')](db[_0x4632('0x87')],{'onDelete':'restrict','foreignKey':_0x4632('0x166')});db[_0x4632('0x17c')][_0x4632('0x12e')](db[_0x4632('0x90')],{'onDelete':_0x4632('0x18b'),'foreignKey':'TagId'});db[_0x4632('0x47')]['belongsTo'](db[_0x4632('0x14e')],{});db['MailQueueReport'][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':'List','foreignKey':_0x4632('0x17e')});db[_0x4632('0x47')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':'ContactId'});db[_0x4632('0x47')]['belongsTo'](db[_0x4632('0x43')],{});db[_0x4632('0x47')][_0x4632('0x12e')](db[_0x4632('0x45')],{});db[_0x4632('0x47')][_0x4632('0x12e')](db['User'],{});db[_0x4632('0x47')][_0x4632('0x12e')](db[_0x4632('0x140')],{});db[_0x4632('0x49')]['hasMany'](db[_0x4632('0x4b')],{'as':_0x4632('0x18c'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x14c')]['hasMany'](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':_0x4632('0x18d'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x14c')]['hasMany'](db[_0x4632('0x83')],{'as':_0x4632('0x17b'),'foreignKey':_0x4632('0x18d')});db['FaxAccount'][_0x4632('0x11f')](db[_0x4632('0x4e')],{'as':_0x4632('0x18e')});db[_0x4632('0x14c')][_0x4632('0x11f')](db[_0x4632('0x18f')],{'as':'Applications'});db[_0x4632('0x14c')][_0x4632('0x11f')](db[_0x4632('0x18')],{'as':_0x4632('0x190'),'onDelete':_0x4632('0x11e')});db['FaxAccount']['hasMany'](db[_0x4632('0x191')],{'as':'Messages'});db[_0x4632('0x14c')][_0x4632('0x12e')](db[_0x4632('0x162')],{'as':_0x4632('0x162')});db[_0x4632('0x14c')][_0x4632('0x12e')](db['CmList'],{'as':'List','foreignKey':_0x4632('0x17e')});db[_0x4632('0x14c')][_0x4632('0x12e')](db[_0x4632('0x167')],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db[_0x4632('0x14c')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':_0x4632('0x14d')});db['FaxApplication'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'onDelete':'restrict'});db[_0x4632('0x18f')][_0x4632('0x12e')](db[_0x4632('0x51')],{'onDelete':_0x4632('0x18b')});db['FaxApplication']['belongsTo'](db['FaxAccount'],{'onDelete':_0x4632('0x18b')});db[_0x4632('0x18f')][_0x4632('0x12e')](db['Tag'],{'onDelete':_0x4632('0x18b'),'foreignKey':_0x4632('0x192')});db['FaxInteraction'][_0x4632('0x11f')](db[_0x4632('0x191')],{'as':_0x4632('0x16f'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x193')});db[_0x4632('0x4e')]['belongsTo'](db[_0x4632('0x14c')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x18d')});db[_0x4632('0x4e')][_0x4632('0x12e')](db['CmContact'],{'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x4e')]['belongsTo'](db[_0x4632('0x11c')],{'as':_0x4632('0x183'),'foreignKey':_0x4632('0x121')});db['FaxInteraction'][_0x4632('0x132')](db['Tag'],{'through':_0x4632('0x194'),'as':_0x4632('0x195')});db[_0x4632('0x4e')]['belongsToMany'](db[_0x4632('0x90')],{'through':_0x4632('0x194'),'as':'ThroughTags'});db[_0x4632('0x4e')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x185'),'through':_0x4632('0x13b'),'foreignKey':'FaxInteractionId'});db[_0x4632('0x191')][_0x4632('0x12e')](db['User'],{'onDelete':'cascade','as':_0x4632('0x11c')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0x4632('0x188'),'foreignKey':_0x4632('0x193')});db[_0x4632('0x191')]['belongsTo'](db['CmContact'],{'onDelete':_0x4632('0x11e'),'as':'Contact'});db[_0x4632('0x191')][_0x4632('0x12e')](db[_0x4632('0x186')],{'as':_0x4632('0x186'),'foreignKey':_0x4632('0x196')});db[_0x4632('0x191')]['belongsTo'](db[_0x4632('0x14c')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x18d')});db[_0x4632('0x51')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':'UserFaxQueue'});db[_0x4632('0x51')]['belongsToMany'](db[_0x4632('0xf1')],{'through':'team_has_fax_queues','as':_0x4632('0x16c')});db[_0x4632('0x52')]['belongsTo'](db['FaxAccount'],{});db[_0x4632('0x52')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e')});db[_0x4632('0x52')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':_0x4632('0x176')});db[_0x4632('0x52')]['belongsTo'](db[_0x4632('0x4e')],{});db['FaxQueueReport'][_0x4632('0x12e')](db[_0x4632('0x191')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db['FaxQueueReport']['belongsTo'](db[_0x4632('0x51')],{});db[_0x4632('0x153')][_0x4632('0x11f')](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':'SmsAccountId','onDelete':_0x4632('0x11e')});db[_0x4632('0x153')]['hasMany'](db[_0x4632('0x83')],{'as':'Answers','foreignKey':_0x4632('0x197')});db[_0x4632('0x153')][_0x4632('0x11f')](db[_0x4632('0x59')],{'as':_0x4632('0x16f'),'foreignKey':_0x4632('0x197')});db[_0x4632('0x153')][_0x4632('0x11f')](db[_0x4632('0x57')],{'as':_0x4632('0x18e')});db[_0x4632('0x153')][_0x4632('0x11f')](db[_0x4632('0x55')],{'as':_0x4632('0x15a')});db[_0x4632('0x153')]['belongsTo'](db[_0x4632('0x100')],{'as':'List','foreignKey':_0x4632('0x17e')});db[_0x4632('0x153')][_0x4632('0x12e')](db[_0x4632('0x167')],{'as':_0x4632('0x168'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4632('0x153')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':_0x4632('0x155')});db[_0x4632('0x55')]['belongsTo'](db[_0x4632('0x11c')],{'onDelete':_0x4632('0x18b')});db['SmsApplication']['belongsTo'](db[_0x4632('0x5b')],{'onDelete':_0x4632('0x18b')});db['SmsApplication'][_0x4632('0x12e')](db[_0x4632('0x153')],{'onDelete':_0x4632('0x18b')});db[_0x4632('0x55')][_0x4632('0x12e')](db['Interval'],{'onDelete':_0x4632('0x18b'),'foreignKey':_0x4632('0x166')});db['SmsApplication'][_0x4632('0x12e')](db[_0x4632('0x90')],{'onDelete':_0x4632('0x18b'),'foreignKey':_0x4632('0x192')});db['SmsInteraction'][_0x4632('0x11f')](db[_0x4632('0x59')],{'as':'Messages','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x198')});db[_0x4632('0x57')][_0x4632('0x12e')](db[_0x4632('0x153')],{'as':'Account','foreignKey':_0x4632('0x197')});db[_0x4632('0x57')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':'ContactId'});db[_0x4632('0x57')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':_0x4632('0x183'),'foreignKey':'UserId'});db[_0x4632('0x57')][_0x4632('0x132')](db['Tag'],{'through':_0x4632('0x199'),'as':_0x4632('0x195')});db[_0x4632('0x57')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x199'),'as':'ThroughTags'});db[_0x4632('0x57')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x185'),'through':'user_has_sms_interactions','foreignKey':_0x4632('0x198')});db['SmsMessage']['belongsTo'](db['User'],{'as':_0x4632('0x11c')});db[_0x4632('0x59')]['belongsTo'](db[_0x4632('0x76')],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x175')});db['SmsMessage']['belongsTo'](db[_0x4632('0x57')],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x188'),'foreignKey':'SmsInteractionId'});db[_0x4632('0x59')][_0x4632('0x12e')](db[_0x4632('0x153')],{'as':'Account','foreignKey':_0x4632('0x197')});db['SmsQueue'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':_0x4632('0x39'),'foreignKey':_0x4632('0x19a')});db[_0x4632('0x5b')][_0x4632('0x132')](db['Team'],{'through':_0x4632('0x19b'),'as':_0x4632('0x16c')});db['OpenchannelAccount']['hasMany'](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':_0x4632('0x19c'),'onDelete':_0x4632('0x11e')});db['OpenchannelAccount'][_0x4632('0x11f')](db[_0x4632('0x83')],{'as':_0x4632('0x17b'),'foreignKey':_0x4632('0x19c')});db['OpenchannelAccount'][_0x4632('0x11f')](db[_0x4632('0x61')],{'as':_0x4632('0x18e'),'foreignKey':_0x4632('0x19c')});db[_0x4632('0x5d')][_0x4632('0x11f')](db[_0x4632('0x63')],{'as':_0x4632('0x16f'),'foreignKey':_0x4632('0x19c')});db['OpenchannelAccount'][_0x4632('0x11f')](db['OpenchannelApplication'],{'as':_0x4632('0x15a'),'foreignKey':'OpenchannelAccountId'});db[_0x4632('0x5d')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':'List','foreignKey':_0x4632('0x17e')});db['OpenchannelAccount'][_0x4632('0x12e')](db['Pause'],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db[_0x4632('0x5d')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':_0x4632('0x152')});db['OpenchannelApplication']['belongsTo'](db[_0x4632('0x11c')],{'onDelete':'restrict'});db[_0x4632('0x5f')][_0x4632('0x12e')](db[_0x4632('0x145')],{'onDelete':_0x4632('0x18b'),'foreignKey':_0x4632('0x19d')});db[_0x4632('0x5f')]['belongsTo'](db[_0x4632('0x5d')],{'onDelete':'restrict','foreignKey':_0x4632('0x19c')});db[_0x4632('0x5f')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x4632('0x166')});db[_0x4632('0x5f')][_0x4632('0x12e')](db[_0x4632('0x90')],{'onDelete':_0x4632('0x18b'),'foreignKey':_0x4632('0x192')});db['OpenchannelInteraction'][_0x4632('0x11f')](db[_0x4632('0x63')],{'as':_0x4632('0x16f'),'onDelete':_0x4632('0x11e'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0x4632('0x12e')](db[_0x4632('0x5d')],{'as':_0x4632('0x182'),'foreignKey':'OpenchannelAccountId'});db[_0x4632('0x61')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':_0x4632('0x176')});db[_0x4632('0x61')]['belongsTo'](db[_0x4632('0x11c')],{'as':_0x4632('0x183'),'foreignKey':'UserId'});db[_0x4632('0x61')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x19e'),'as':_0x4632('0x195')});db[_0x4632('0x61')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x19e'),'as':'ThroughTags'});db[_0x4632('0x61')]['belongsToMany'](db[_0x4632('0x11c')],{'as':'Users','through':_0x4632('0x19f'),'foreignKey':_0x4632('0x1a0')});db['OpenchannelMessage'][_0x4632('0x12e')](db['User'],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x11c')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x4632('0x175')});db[_0x4632('0x63')][_0x4632('0x12e')](db[_0x4632('0x61')],{'onDelete':'cascade','as':_0x4632('0x188'),'foreignKey':_0x4632('0x1a0')});db[_0x4632('0x63')][_0x4632('0x12e')](db[_0x4632('0x186')],{'as':_0x4632('0x186'),'foreignKey':_0x4632('0x196')});db[_0x4632('0x63')][_0x4632('0x12e')](db[_0x4632('0x5d')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x19c')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0x4632('0x16b'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x4632('0x145')][_0x4632('0x132')](db[_0x4632('0xf1')],{'through':'team_has_openchannel_queues','as':_0x4632('0x16c')});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':'ChatWebsiteId','onDelete':_0x4632('0x11e')});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x83')],{'as':_0x4632('0x17b'),'foreignKey':_0x4632('0x189')});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x73')],{'as':_0x4632('0x1a1')});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x6c')],{'as':'Interactions'});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x6a')],{'as':_0x4632('0x15a')});db[_0x4632('0x66')][_0x4632('0x11f')](db[_0x4632('0x6e')],{'as':'Messages'});db[_0x4632('0x66')]['belongsTo'](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e')});db[_0x4632('0x66')][_0x4632('0x12e')](db[_0x4632('0x87')],{'as':'Interval','foreignKey':_0x4632('0x166')});db[_0x4632('0x66')]['belongsTo'](db[_0x4632('0x14e')],{'as':'MailAccount','foreignKey':_0x4632('0x177')});db[_0x4632('0x66')][_0x4632('0x12e')](db['Pause'],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db[_0x4632('0x66')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':_0x4632('0x14b')});db['OpenchannelQueueReport'][_0x4632('0x12e')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x4632('0x100')],{'as':'List','foreignKey':_0x4632('0x17e')});db[_0x4632('0x68')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0x4632('0x12e')](db[_0x4632('0x61')],{});db[_0x4632('0x68')][_0x4632('0x12e')](db[_0x4632('0x63')],{});db[_0x4632('0x68')][_0x4632('0x12e')](db['User'],{});db[_0x4632('0x68')][_0x4632('0x12e')](db[_0x4632('0x145')],{});db[_0x4632('0x6a')][_0x4632('0x12e')](db['User'],{'as':_0x4632('0x1a2'),'foreignKey':_0x4632('0x121'),'onDelete':_0x4632('0x18b')});db[_0x4632('0x6a')]['belongsTo'](db['ChatQueue'],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x4632('0x18b')});db['ChatApplication'][_0x4632('0x12e')](db[_0x4632('0x66')],{'as':_0x4632('0x1a3'),'foreignKey':'ChatWebsiteId','onDelete':_0x4632('0x18b')});db[_0x4632('0x6a')][_0x4632('0x12e')](db['Tag'],{'onDelete':_0x4632('0x18b'),'foreignKey':'TagId'});db[_0x4632('0x6c')][_0x4632('0x11f')](db[_0x4632('0x6e')],{'as':_0x4632('0x16f'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x4632('0x6c')][_0x4632('0x12e')](db[_0x4632('0x66')],{'as':_0x4632('0x182'),'foreignKey':'ChatWebsiteId'});db[_0x4632('0x6c')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4632('0x6c')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':'Owner','foreignKey':_0x4632('0x121')});db[_0x4632('0x6c')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x1a4'),'as':_0x4632('0x195')});db['ChatInteraction'][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x1a4'),'as':_0x4632('0x1a5')});db['ChatInteraction'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x185'),'through':'user_has_chat_interactions','foreignKey':_0x4632('0x1a6')});db[_0x4632('0x6e')]['belongsTo'](db[_0x4632('0x11c')],{'onDelete':'cascade','as':_0x4632('0x11c')});db['ChatMessage']['belongsTo'](db[_0x4632('0x76')],{'onDelete':_0x4632('0x11e'),'as':'Contact','foreignKey':_0x4632('0x176')});db[_0x4632('0x6e')]['belongsTo'](db[_0x4632('0x6c')],{'onDelete':_0x4632('0x11e'),'as':'Interaction','foreignKey':_0x4632('0x1a6')});db[_0x4632('0x6e')]['belongsTo'](db[_0x4632('0x186')],{'as':_0x4632('0x186'),'foreignKey':_0x4632('0x196')});db[_0x4632('0x6e')][_0x4632('0x12e')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4632('0x189')});db[_0x4632('0x70')][_0x4632('0x11f')](db[_0x4632('0x186')],{'as':_0x4632('0x187'),'foreignKey':_0x4632('0x18a'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x4632('0x12e')](db[_0x4632('0x76')],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176')});db['ChatOfflineMessage'][_0x4632('0x12e')](db[_0x4632('0x66')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':_0x4632('0x35'),'hooks':!![]});db[_0x4632('0x142')][_0x4632('0x132')](db[_0x4632('0xf1')],{'through':_0x4632('0x1a7'),'as':_0x4632('0x16c')});db[_0x4632('0x130')]['hasMany'](db[_0x4632('0xdd')],{'as':_0x4632('0x16f'),'foreignKey':_0x4632('0x1a8'),'onDelete':'cascade'});db['ChatGroup'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x15c'),'through':_0x4632('0x1a9')});db[_0x4632('0x73')]['belongsTo'](db['ChatWebsite'],{'as':_0x4632('0x1a3'),'foreignKey':_0x4632('0x189')});db[_0x4632('0x74')][_0x4632('0x11f')](db['CmContact'],{'as':'Contacts','foreignKey':_0x4632('0x1aa')});db[_0x4632('0x76')][_0x4632('0x11f')](db['CmHopper'],{'as':_0x4632('0x15e'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x76')][_0x4632('0x11f')](db[_0x4632('0x124')],{'as':_0x4632('0x125'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x76')]['hasMany'](db[_0x4632('0x7c')],{'as':'HopperHistories','foreignKey':_0x4632('0x176')});db[_0x4632('0x76')][_0x4632('0x11f')](db['ReportAgentPreview'],{'as':_0x4632('0x7e'),'foreignKey':'ContactId'});db['CmContact'][_0x4632('0x11f')](db[_0x4632('0xe3')],{'as':_0x4632('0x161'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x76')]['hasMany'](db[_0x4632('0x61')],{'as':_0x4632('0x127'),'foreignKey':_0x4632('0x176'),'onDelete':_0x4632('0x18b')});db[_0x4632('0x76')][_0x4632('0x11f')](db[_0x4632('0x6c')],{'as':_0x4632('0x139'),'foreignKey':_0x4632('0x176'),'onDelete':'restrict'});db[_0x4632('0x76')][_0x4632('0x11f')](db[_0x4632('0x57')],{'as':'SmsInteractions','foreignKey':_0x4632('0x176'),'onDelete':_0x4632('0x18b')});db[_0x4632('0x76')][_0x4632('0x11f')](db['FaxInteraction'],{'as':_0x4632('0x129'),'foreignKey':_0x4632('0x176'),'onDelete':_0x4632('0x18b')});db['CmContact']['hasMany'](db[_0x4632('0x43')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x4632('0x18b')});db[_0x4632('0x76')][_0x4632('0x12e')](db[_0x4632('0x74')],{'as':_0x4632('0x1ab'),'foreignKey':_0x4632('0x1aa')});db[_0x4632('0x76')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x76')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Users','through':_0x4632('0x134')});db[_0x4632('0x76')][_0x4632('0x132')](db[_0x4632('0x90')],{'as':_0x4632('0x195'),'through':_0x4632('0x1ac')});db[_0x4632('0x76')]['belongsToMany'](db[_0x4632('0x90')],{'through':_0x4632('0x1ac'),'as':_0x4632('0x1a5')});db[_0x4632('0x78')][_0x4632('0x12e')](db['CmContact'],{'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176'),'onDelete':'cascade'});db['CmHopper'][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x78')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':_0x4632('0x1a2'),'foreignKey':'UserId'});db[_0x4632('0x78')][_0x4632('0x12e')](db['VoiceQueue'],{'as':_0x4632('0x1ad'),'foreignKey':_0x4632('0x15d'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x78')][_0x4632('0x12e')](db[_0x4632('0xf5')],{'as':_0x4632('0xf5'),'foreignKey':_0x4632('0x1ae'),'onDelete':'cascade'});db[_0x4632('0x78')]['belongsTo'](db[_0x4632('0x11c')],{'as':_0x4632('0x183'),'foreignKey':_0x4632('0x1af')});db[_0x4632('0x7a')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':_0x4632('0x176'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x7a')][_0x4632('0x12e')](db['CmList'],{'as':'List','foreignKey':_0x4632('0x17e'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x7a')][_0x4632('0x12e')](db[_0x4632('0x1c')],{'as':_0x4632('0x1ad'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x4632('0x7a')][_0x4632('0x12e')](db[_0x4632('0xf5')],{'as':_0x4632('0xf5'),'foreignKey':_0x4632('0x1ae'),'onDelete':_0x4632('0x11e')});db[_0x4632('0x82')]['hasMany'](db['Condition'],{'as':{'plural':_0x4632('0x1b0'),'singular':'OneAll'},'foreignKey':_0x4632('0x1b1'),'onDelete':'cascade','hooks':!![]});db[_0x4632('0x82')][_0x4632('0x11f')](db['Condition'],{'as':{'plural':_0x4632('0x1b2'),'singular':_0x4632('0x1b3')},'foreignKey':_0x4632('0x1b4'),'onDelete':_0x4632('0x11e'),'hooks':!![]});db[_0x4632('0x82')][_0x4632('0x11f')](db[_0x4632('0x1b5')],{'as':_0x4632('0x1b6'),'foreignKey':_0x4632('0x1b7'),'onDelete':_0x4632('0x11e'),'hooks':!![]});db[_0x4632('0x179')][_0x4632('0x11f')](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':_0x4632('0x1b8'),'onDelete':'cascade'});db[_0x4632('0x87')][_0x4632('0x11f')](db[_0x4632('0x87')],{'as':_0x4632('0x1b9'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x4632('0x87')][_0x4632('0x11f')](db[_0x4632('0x18')],{'as':_0x4632('0x123'),'foreignKey':_0x4632('0x166'),'onDelete':_0x4632('0x18b')});db[_0x4632('0x87')][_0x4632('0x11f')](db[_0x4632('0x17c')],{'as':'MailApplications','foreignKey':_0x4632('0x166')});db[_0x4632('0x87')][_0x4632('0x11f')](db[_0x4632('0x6a')],{'as':'ChatApplications','foreignKey':_0x4632('0x166')});db[_0x4632('0x87')][_0x4632('0x11f')](db[_0x4632('0x18f')],{'as':_0x4632('0x1ba'),'foreignKey':_0x4632('0x166')});db['Interval'][_0x4632('0x11f')](db[_0x4632('0x55')],{'as':'SmsApplications','foreignKey':_0x4632('0x166')});db[_0x4632('0x8c')][_0x4632('0x12e')](db[_0x4632('0x14e')],{});db[_0x4632('0x8c')][_0x4632('0x12e')](db[_0x4632('0x1bb')],{'foreignKey':'DefaultReportId'});db[_0x4632('0x8c')][_0x4632('0x12e')](db[_0x4632('0x9b')],{'foreignKey':_0x4632('0x1bc')});db[_0x4632('0x8e')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x4632('0x1bd'),'through':_0x4632('0x1be'),'onDelete':_0x4632('0x18b')});db['Tag']['belongsToMany'](db[_0x4632('0x76')],{'through':_0x4632('0x1ac')});db[_0x4632('0x90')][_0x4632('0x132')](db[_0x4632('0x6c')],{'through':_0x4632('0x1a4')});db['Tag'][_0x4632('0x132')](db[_0x4632('0x43')],{'through':_0x4632('0x184')});db[_0x4632('0x90')]['belongsToMany'](db[_0x4632('0x57')],{'through':_0x4632('0x199')});db[_0x4632('0x90')][_0x4632('0x132')](db[_0x4632('0x4e')],{'through':_0x4632('0x194')});db['Tag'][_0x4632('0x132')](db[_0x4632('0x61')],{'through':_0x4632('0x19e')});db[_0x4632('0x90')][_0x4632('0x132')](db[_0x4632('0x10d')],{'through':'whatsapp_interaction_has_tags'});db[_0x4632('0x93')][_0x4632('0x11f')](db['Condition'],{'as':{'plural':_0x4632('0x1bf'),'singular':_0x4632('0x1c0')},'foreignKey':_0x4632('0x1c1'),'onDelete':_0x4632('0x11e'),'hooks':!![]});db[_0x4632('0x93')][_0x4632('0x11f')](db[_0x4632('0x85')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x4632('0x93')][_0x4632('0x11f')](db[_0x4632('0x1b5')],{'as':_0x4632('0x1b6'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x4632('0x9b')][_0x4632('0x11f')](db[_0x4632('0xa1')],{'as':_0x4632('0x1c2'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1bc'),'hooks':!![]});db['AnalyticDefaultReport'][_0x4632('0x11f')](db[_0x4632('0xa1')],{'as':_0x4632('0x1c2'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c3')});db['AnalyticMetric']['hasMany'](db[_0x4632('0xa1')],{'as':_0x4632('0x1c2'),'onDelete':'cascade','foreignKey':_0x4632('0x1c4')});db[_0x4632('0xa1')]['belongsTo'](db[_0x4632('0x9f')],{'foreignKey':_0x4632('0x1c4')});db[_0x4632('0xa5')][_0x4632('0x11f')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xa7')][_0x4632('0x11f')](db[_0x4632('0xa9')],{'as':_0x4632('0x1c6'),'onDelete':'cascade','foreignKey':_0x4632('0x1c7')});db[_0x4632('0xa7')][_0x4632('0x11f')](db[_0x4632('0xa9')],{'as':_0x4632('0x1c8'),'onDelete':_0x4632('0x11e'),'foreignKey':'DescriptionId'});db[_0x4632('0xa7')][_0x4632('0x11f')](db[_0x4632('0xa9')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4632('0x1c9')});db[_0x4632('0xa7')][_0x4632('0x12e')](db[_0x4632('0xa5')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xa9')][_0x4632('0x11f')](db[_0x4632('0xa9')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xa9')][_0x4632('0x11f')](db[_0x4632('0xa9')],{'as':_0x4632('0x1cb'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xa9')][_0x4632('0x11f')](db['SalesforceField'],{'as':_0x4632('0x1cd'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xa9')]['belongsTo'](db[_0x4632('0x95')],{'as':'Variable','foreignKey':_0x4632('0x1ce')});db[_0x4632('0xab')]['hasMany'](db[_0x4632('0xad')],{'as':_0x4632('0x1cf'),'onDelete':_0x4632('0x11e'),'foreignKey':'AccountId'});db[_0x4632('0xad')][_0x4632('0x11f')](db[_0x4632('0xaf')],{'as':_0x4632('0x1c6'),'onDelete':_0x4632('0x11e'),'foreignKey':'SubjectId'});db[_0x4632('0xad')]['hasMany'](db[_0x4632('0xaf')],{'as':_0x4632('0x1c8'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xad')][_0x4632('0x11f')](db['SugarcrmField'],{'as':_0x4632('0x1c2'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xad')]['belongsTo'](db[_0x4632('0xab')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db['SugarcrmField'][_0x4632('0x11f')](db[_0x4632('0xaf')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db['SugarcrmField'][_0x4632('0x11f')](db[_0x4632('0xaf')],{'as':_0x4632('0x1cb'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xaf')]['hasMany'](db[_0x4632('0xaf')],{'as':_0x4632('0x1cd'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xaf')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':_0x4632('0x95'),'foreignKey':'VariableId'});db[_0x4632('0xb1')][_0x4632('0x11f')](db[_0x4632('0xb2')],{'as':_0x4632('0x1cf'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xb2')][_0x4632('0x11f')](db[_0x4632('0xb4')],{'as':'Subjects','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xb2')]['hasMany'](db[_0x4632('0xb4')],{'as':_0x4632('0x1c8'),'onDelete':'cascade','foreignKey':_0x4632('0x1cc')});db[_0x4632('0xb2')][_0x4632('0x11f')](db[_0x4632('0xb4')],{'as':_0x4632('0x1c2'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xb2')][_0x4632('0x12e')](db[_0x4632('0xb1')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db['DeskConfiguration']['belongsToMany'](db[_0x4632('0x90')],{'through':_0x4632('0x1d0')});db[_0x4632('0xb4')][_0x4632('0x11f')](db['DeskField'],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xb4')][_0x4632('0x11f')](db[_0x4632('0xb4')],{'as':'Description','foreignKey':_0x4632('0x1cc')});db[_0x4632('0xb4')][_0x4632('0x11f')](db[_0x4632('0xb4')],{'as':'Field','foreignKey':_0x4632('0x1c9')});db[_0x4632('0xb4')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':_0x4632('0x95'),'foreignKey':'VariableId'});db[_0x4632('0xb6')][_0x4632('0x11f')](db[_0x4632('0xb8')],{'as':'Configurations','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db['ZohoConfiguration']['hasMany'](db[_0x4632('0xba')],{'as':_0x4632('0x1c6'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xb8')][_0x4632('0x11f')](db[_0x4632('0xba')],{'as':_0x4632('0x1c8'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xb8')][_0x4632('0x11f')](db[_0x4632('0xba')],{'as':_0x4632('0x1c2'),'onDelete':'cascade','foreignKey':_0x4632('0x1c9')});db['ZohoConfiguration'][_0x4632('0x12e')](db[_0x4632('0xb6')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db['ZohoField']['hasMany'](db[_0x4632('0xba')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db['ZohoField'][_0x4632('0x11f')](db['ZohoField'],{'as':_0x4632('0x1cb'),'foreignKey':'DescriptionId'});db['ZohoField'][_0x4632('0x11f')](db[_0x4632('0xba')],{'as':'Field','foreignKey':'FieldId'});db[_0x4632('0xba')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':_0x4632('0x95'),'foreignKey':_0x4632('0x1ce')});db[_0x4632('0xbc')][_0x4632('0x11f')](db[_0x4632('0xbe')],{'as':'Configurations','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xbe')][_0x4632('0x11f')](db[_0x4632('0xc0')],{'as':_0x4632('0x1c6'),'foreignKey':_0x4632('0x1c7')});db['ZendeskConfiguration']['hasMany'](db[_0x4632('0xc0')],{'as':_0x4632('0x1c8'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xbe')][_0x4632('0x11f')](db[_0x4632('0xc0')],{'as':_0x4632('0x1c2'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xbe')][_0x4632('0x12e')](db['ZendeskAccount'],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xbe')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db[_0x4632('0xc0')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xc0')][_0x4632('0x11f')](db[_0x4632('0xc0')],{'as':'Description','foreignKey':_0x4632('0x1cc')});db['ZendeskField'][_0x4632('0x11f')](db[_0x4632('0xc0')],{'as':'Field','foreignKey':_0x4632('0x1c9')});db[_0x4632('0xc0')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':_0x4632('0x95'),'foreignKey':_0x4632('0x1ce')});db[_0x4632('0xc2')][_0x4632('0x11f')](db[_0x4632('0xc4')],{'as':_0x4632('0x1cf'),'onDelete':_0x4632('0x11e'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x4632('0x11f')](db[_0x4632('0xc5')],{'as':'Subjects','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xc4')][_0x4632('0x11f')](db[_0x4632('0xc5')],{'as':'Descriptions','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xc4')][_0x4632('0x11f')](db[_0x4632('0xc5')],{'as':_0x4632('0x1c2'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xc4')]['belongsTo'](db[_0x4632('0xc2')],{'as':_0x4632('0x182'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0x4632('0x90')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x4632('0xc5')][_0x4632('0x11f')](db[_0x4632('0xc5')],{'as':'Subject','foreignKey':_0x4632('0x1c7')});db[_0x4632('0xc5')][_0x4632('0x11f')](db['FreshdeskField'],{'as':_0x4632('0x1cb'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xc5')]['hasMany'](db[_0x4632('0xc5')],{'as':_0x4632('0x1cd'),'foreignKey':'FieldId'});db[_0x4632('0xc5')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':'Variable','foreignKey':_0x4632('0x1ce')});db[_0x4632('0xc7')][_0x4632('0x11f')](db[_0x4632('0xc9')],{'as':_0x4632('0x1cf'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xc9')]['hasMany'](db[_0x4632('0xcb')],{'as':_0x4632('0x1c6'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xc9')][_0x4632('0x11f')](db[_0x4632('0xcb')],{'as':'Descriptions','foreignKey':_0x4632('0x1cc')});db[_0x4632('0xc9')]['hasMany'](db['VtigerField'],{'as':_0x4632('0x1c2'),'foreignKey':_0x4632('0x1c9')});db['VtigerConfiguration'][_0x4632('0x12e')](db['VtigerAccount'],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xcb')][_0x4632('0x11f')](db['VtigerField'],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xcb')]['hasMany'](db['VtigerField'],{'as':_0x4632('0x1cb'),'foreignKey':'DescriptionId'});db[_0x4632('0xcb')][_0x4632('0x11f')](db[_0x4632('0xcb')],{'as':'Field','foreignKey':_0x4632('0x1c9')});db[_0x4632('0xcb')][_0x4632('0x12e')](db[_0x4632('0x95')],{'as':_0x4632('0x95'),'foreignKey':_0x4632('0x1ce')});db[_0x4632('0xcd')][_0x4632('0x11f')](db[_0x4632('0x1d1')],{'as':'Configurations','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db['ServicenowConfiguration'][_0x4632('0x11f')](db[_0x4632('0xd0')],{'as':_0x4632('0x1c6'),'foreignKey':_0x4632('0x1c7')});db['ServicenowConfiguration']['hasMany'](db[_0x4632('0xd0')],{'as':_0x4632('0x1c8'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0x1d1')][_0x4632('0x11f')](db[_0x4632('0xd0')],{'as':_0x4632('0x1c2'),'foreignKey':_0x4632('0x1c9')});db['ServicenowConfiguration']['belongsTo'](db[_0x4632('0xcd')],{'as':'Account','foreignKey':'AccountId'});db[_0x4632('0xd0')][_0x4632('0x11f')](db['ServicenowField'],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xd0')][_0x4632('0x11f')](db['ServicenowField'],{'as':_0x4632('0x1cb'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0xd0')][_0x4632('0x11f')](db[_0x4632('0xd0')],{'as':'Field','foreignKey':_0x4632('0x1c9')});db['ServicenowField'][_0x4632('0x12e')](db['Variable'],{'as':_0x4632('0x95'),'foreignKey':_0x4632('0x1ce')});db[_0x4632('0xd1')][_0x4632('0x11f')](db['Dynamics365Configuration'],{'as':_0x4632('0x1cf'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x4632('0x1d2')]['hasMany'](db[_0x4632('0x1d3')],{'as':'Subjects','onDelete':_0x4632('0x11e'),'foreignKey':'SubjectId'});db[_0x4632('0x1d2')][_0x4632('0x11f')](db[_0x4632('0x1d3')],{'as':_0x4632('0x1c8'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0x1d2')][_0x4632('0x11f')](db[_0x4632('0x1d3')],{'as':'Fields','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0x1d2')][_0x4632('0x12e')](db[_0x4632('0xd1')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db['Dynamics365Field']['hasMany'](db[_0x4632('0x1d3')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0x1d3')][_0x4632('0x11f')](db[_0x4632('0x1d3')],{'as':_0x4632('0x1cb'),'foreignKey':_0x4632('0x1cc')});db[_0x4632('0x1d3')]['hasMany'](db[_0x4632('0x1d3')],{'as':_0x4632('0x1cd'),'foreignKey':_0x4632('0x1c9')});db['Dynamics365Field']['belongsTo'](db[_0x4632('0x95')],{'as':'Variable','foreignKey':_0x4632('0x1ce')});db[_0x4632('0xd5')][_0x4632('0x11f')](db[_0x4632('0xd7')],{'as':_0x4632('0x1cf'),'onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xd7')]['hasMany'](db[_0x4632('0xd8')],{'as':_0x4632('0x1c6'),'foreignKey':_0x4632('0x1c7')});db[_0x4632('0xd7')]['hasMany'](db[_0x4632('0xd8')],{'as':_0x4632('0x1c8'),'foreignKey':_0x4632('0x1cc')});db['FreshsalesConfiguration'][_0x4632('0x11f')](db['FreshsalesField'],{'as':_0x4632('0x1c2'),'foreignKey':_0x4632('0x1c9')});db[_0x4632('0xd7')]['belongsTo'](db[_0x4632('0xd5')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1c5')});db[_0x4632('0xd8')][_0x4632('0x11f')](db[_0x4632('0xd8')],{'as':_0x4632('0x1ca'),'foreignKey':_0x4632('0x1c7')});db['FreshsalesField'][_0x4632('0x11f')](db[_0x4632('0xd8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4632('0xd8')][_0x4632('0x11f')](db[_0x4632('0xd8')],{'as':_0x4632('0x1cd'),'foreignKey':'FieldId'});db[_0x4632('0xd8')][_0x4632('0x12e')](db['Variable'],{'as':_0x4632('0x95'),'foreignKey':_0x4632('0x1ce')});db[_0x4632('0xdb')][_0x4632('0x12e')](db[_0x4632('0x66')],{});db[_0x4632('0xdb')]['belongsTo'](db[_0x4632('0x100')],{'as':'List','foreignKey':_0x4632('0x17e')});db['ChatQueueReport'][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x4632('0x6c')],{});db['ChatQueueReport'][_0x4632('0x12e')](db[_0x4632('0x6e')],{});db[_0x4632('0xdb')][_0x4632('0x12e')](db['User'],{});db[_0x4632('0xdb')][_0x4632('0x12e')](db[_0x4632('0x142')],{});db[_0x4632('0xdd')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'onDelete':'cascade','foreignKey':_0x4632('0x1d4')});db[_0x4632('0xdd')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'onDelete':'cascade','foreignKey':_0x4632('0x1d5')});db['JscriptySessionReport']['hasMany'](db[_0x4632('0xe1')],{'foreignKey':_0x4632('0x1d6'),'onDelete':_0x4632('0x11e')});db['JscriptySessionReport'][_0x4632('0x11f')](db[_0x4632('0xdf')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x4632('0x1d7')][_0x4632('0x12e')](db[_0x4632('0x153')],{});db[_0x4632('0x1d7')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':_0x4632('0x17e')});db['SmsQueueReport'][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':'ContactId'});db['SmsQueueReport'][_0x4632('0x12e')](db['SmsInteraction'],{});db[_0x4632('0x1d7')][_0x4632('0x12e')](db[_0x4632('0x59')],{});db['SmsQueueReport'][_0x4632('0x12e')](db[_0x4632('0x11c')],{});db[_0x4632('0x1d7')][_0x4632('0x12e')](db[_0x4632('0x5b')],{});db['JscriptyProject'][_0x4632('0x11f')](db[_0x4632('0xe3')],{'foreignKey':'ProjectId'});db[_0x4632('0xe8')]['hasMany'](db[_0x4632('0xe1')],{'foreignKey':_0x4632('0x1d8')});db[_0x4632('0xe8')]['hasMany'](db[_0x4632('0xdf')],{'foreignKey':_0x4632('0x1d8')});db['SquareProject'][_0x4632('0x132')](db['User'],{'as':_0x4632('0x185'),'through':_0x4632('0x159')});db['Team'][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':'Agents','through':'user_has_teams'});db[_0x4632('0xf1')][_0x4632('0x132')](db[_0x4632('0x1c')],{'through':_0x4632('0x16d'),'as':_0x4632('0x13e')});db[_0x4632('0xf1')]['belongsToMany'](db[_0x4632('0x140')],{'through':'team_has_mail_queues','as':_0x4632('0x141')});db[_0x4632('0xf1')][_0x4632('0x132')](db[_0x4632('0x142')],{'through':'team_has_chat_queues','as':_0x4632('0x1d9')});db[_0x4632('0xf1')]['belongsToMany'](db[_0x4632('0x51')],{'through':_0x4632('0x1da'),'as':_0x4632('0x143')});db['Team'][_0x4632('0x132')](db[_0x4632('0x5b')],{'through':_0x4632('0x19b'),'as':_0x4632('0x144')});db['Team'][_0x4632('0x132')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x4632('0x146')});db[_0x4632('0xf1')][_0x4632('0x132')](db[_0x4632('0x115')],{'through':_0x4632('0x1db'),'as':_0x4632('0x148')});db[_0x4632('0xf1')][_0x4632('0x132')](db[_0x4632('0x102')],{'through':_0x4632('0x118'),'as':'VoicePrefixes'});db['Campaign'][_0x4632('0x11f')](db['CmHopper'],{'as':_0x4632('0x15e'),'foreignKey':_0x4632('0x1ae')});db[_0x4632('0xf5')][_0x4632('0x11f')](db[_0x4632('0x124')],{'as':_0x4632('0x125'),'foreignKey':_0x4632('0x1ae')});db['Campaign'][_0x4632('0x11f')](db[_0x4632('0x7c')],{'as':_0x4632('0x15f'),'foreignKey':'CampaignId'});db[_0x4632('0xf5')][_0x4632('0x11f')](db['CmHopperBlack'],{'as':_0x4632('0x160'),'foreignKey':_0x4632('0x1ae')});db[_0x4632('0xf5')][_0x4632('0x12e')](db['Trunk'],{'as':_0x4632('0x162'),'foreignKey':'TrunkId'});db[_0x4632('0xf5')][_0x4632('0x12e')](db['Trunk'],{'as':_0x4632('0x164'),'foreignKey':_0x4632('0x165')});db[_0x4632('0xf5')]['belongsTo'](db[_0x4632('0x87')],{'as':_0x4632('0x87'),'foreignKey':_0x4632('0x166')});db[_0x4632('0xf5')][_0x4632('0x12e')](db[_0x4632('0xed')],{'as':'SquareProject','foreignKey':_0x4632('0x1dc')});db[_0x4632('0xf5')][_0x4632('0x132')](db[_0x4632('0x100')],{'as':_0x4632('0x135'),'through':_0x4632('0x1dd')});db[_0x4632('0xf5')]['belongsToMany'](db[_0x4632('0x100')],{'as':_0x4632('0x1de'),'through':'campaigns_has_cm_blacklists'});db[_0x4632('0x186')][_0x4632('0x12e')](db[_0x4632('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0x4632('0x18a')});db[_0x4632('0x1df')][_0x4632('0x12e')](db[_0x4632('0x45')],{});db[_0x4632('0x1df')]['belongsTo'](db[_0x4632('0x43')],{});db[_0x4632('0x1df')]['belongsTo'](db[_0x4632('0x14e')],{'foreignKey':_0x4632('0x1e0'),'as':_0x4632('0x1e1')});db[_0x4632('0x1df')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db[_0x4632('0x1df')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e4'),'as':_0x4632('0x1e5')});db[_0x4632('0x1df')][_0x4632('0x12e')](db[_0x4632('0x140')],{'foreignKey':_0x4632('0x1e6'),'as':_0x4632('0x1e7')});db[_0x4632('0x1df')][_0x4632('0x12e')](db[_0x4632('0x14e')],{'foreignKey':_0x4632('0x1e8'),'as':_0x4632('0x1e9')});db[_0x4632('0xfa')][_0x4632('0x12e')](db[_0x4632('0x6e')],{});db[_0x4632('0xfa')]['belongsTo'](db[_0x4632('0x6c')],{});db[_0x4632('0xfa')][_0x4632('0x12e')](db[_0x4632('0x66')],{'foreignKey':'FromChatWebsiteId','as':_0x4632('0x1e1')});db[_0x4632('0xfa')]['belongsTo'](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db[_0x4632('0xfa')]['belongsTo'](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e4'),'as':_0x4632('0x1e5')});db['ChatTransferReport'][_0x4632('0x12e')](db[_0x4632('0x142')],{'foreignKey':_0x4632('0x1ea'),'as':_0x4632('0x1e7')});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x4632('0x1eb'),'as':_0x4632('0x1e9')});db[_0x4632('0xfc')][_0x4632('0x12e')](db[_0x4632('0x191')],{});db[_0x4632('0xfc')][_0x4632('0x12e')](db[_0x4632('0x4e')],{});db['FaxTransferReport'][_0x4632('0x12e')](db[_0x4632('0x14c')],{'foreignKey':'FromFaxAccountId','as':_0x4632('0x1e1')});db[_0x4632('0xfc')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db['FaxTransferReport'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e4'),'as':'ToAgent'});db[_0x4632('0xfc')][_0x4632('0x12e')](db[_0x4632('0x51')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0x4632('0x1ec'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x4632('0x12e')](db[_0x4632('0x63')],{});db['OpenchannelTransferReport'][_0x4632('0x12e')](db['OpenchannelInteraction'],{});db[_0x4632('0xfe')][_0x4632('0x12e')](db[_0x4632('0x5d')],{'foreignKey':_0x4632('0x1ed'),'as':_0x4632('0x1e1')});db['OpenchannelTransferReport'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db[_0x4632('0xfe')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e4'),'as':'ToAgent'});db[_0x4632('0xfe')][_0x4632('0x12e')](db[_0x4632('0x145')],{'foreignKey':_0x4632('0x1ee'),'as':_0x4632('0x1e7')});db['OpenchannelTransferReport'][_0x4632('0x12e')](db['OpenchannelAccount'],{'foreignKey':_0x4632('0x1ef'),'as':_0x4632('0x1e9')});db['SmsTransferReport']['belongsTo'](db['SmsMessage'],{});db[_0x4632('0xff')]['belongsTo'](db['SmsInteraction'],{});db[_0x4632('0xff')][_0x4632('0x12e')](db[_0x4632('0x153')],{'foreignKey':_0x4632('0x1f0'),'as':_0x4632('0x1e1')});db[_0x4632('0xff')][_0x4632('0x12e')](db['User'],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db[_0x4632('0xff')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e4'),'as':_0x4632('0x1e5')});db['SmsTransferReport'][_0x4632('0x12e')](db[_0x4632('0x5b')],{'foreignKey':'ToSmsQueueId','as':_0x4632('0x1e7')});db[_0x4632('0xff')][_0x4632('0x12e')](db['SmsAccount'],{'foreignKey':_0x4632('0x1f1'),'as':_0x4632('0x1e9')});db['CmList'][_0x4632('0x11f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4632('0x17e'),'onDelete':_0x4632('0x11e')});db['CmList'][_0x4632('0x11f')](db[_0x4632('0x80')],{'as':_0x4632('0x1f2'),'foreignKey':'ListId'});db[_0x4632('0x100')]['hasMany'](db[_0x4632('0x76')],{'as':'Contacts','onDelete':_0x4632('0x11e'),'foreignKey':_0x4632('0x17e')});db[_0x4632('0x100')]['hasMany'](db[_0x4632('0x124')],{'as':'HopperFinals','foreignKey':_0x4632('0x17e')});db[_0x4632('0x100')][_0x4632('0x11f')](db[_0x4632('0x7c')],{'as':_0x4632('0x126'),'foreignKey':_0x4632('0x17e')});db[_0x4632('0x100')][_0x4632('0x11f')](db[_0x4632('0x7e')],{'as':_0x4632('0x7e'),'foreignKey':_0x4632('0x17e')});db[_0x4632('0x100')][_0x4632('0x132')](db[_0x4632('0x1c')],{'as':'Queues','through':_0x4632('0x16a')});db[_0x4632('0x100')]['belongsToMany'](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':_0x4632('0x136')});db[_0x4632('0x102')]['hasMany'](db[_0x4632('0x18')],{'as':_0x4632('0x123'),'onDelete':'cascade'});db[_0x4632('0x102')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':_0x4632('0x11a')});db[_0x4632('0x102')][_0x4632('0x132')](db['Team'],{'through':_0x4632('0x118'),'as':'Teams'});db[_0x4632('0x104')][_0x4632('0x11f')](db[_0x4632('0x11c')],{'as':'Users','foreignKey':_0x4632('0x12f')});db[_0x4632('0x104')]['hasMany'](db[_0x4632('0x106')],{'as':_0x4632('0x1f3'),'foreignKey':'userProfileId','onDelete':_0x4632('0x11e')});db[_0x4632('0x106')][_0x4632('0x11f')](db[_0x4632('0x1f4')],{'as':_0x4632('0x1f5'),'foreignKey':_0x4632('0x1f6'),'onDelete':'cascade'});db[_0x4632('0x156')]['hasMany'](db[_0x4632('0x179')],{'as':_0x4632('0x17a'),'foreignKey':_0x4632('0x1f7'),'onDelete':'cascade'});db['WhatsappAccount'][_0x4632('0x11f')](db['CannedAnswer'],{'as':_0x4632('0x17b'),'foreignKey':_0x4632('0x1f7')});db['WhatsappAccount']['hasMany'](db['WhatsappMessage'],{'as':_0x4632('0x16f'),'foreignKey':_0x4632('0x1f7')});db['WhatsappAccount'][_0x4632('0x11f')](db[_0x4632('0x10d')],{'as':_0x4632('0x18e')});db[_0x4632('0x156')][_0x4632('0x11f')](db['WhatsappApplication'],{'as':_0x4632('0x15a')});db[_0x4632('0x156')][_0x4632('0x12e')](db[_0x4632('0x100')],{'as':'List','foreignKey':'ListId'});db[_0x4632('0x156')]['belongsTo'](db['Pause'],{'as':_0x4632('0x168'),'foreignKey':_0x4632('0x169')});db[_0x4632('0x156')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x16b'),'through':'user_has_whatsapp_accounts'});db[_0x4632('0x10b')]['belongsTo'](db[_0x4632('0x11c')],{'onDelete':_0x4632('0x18b')});db[_0x4632('0x10b')]['belongsTo'](db[_0x4632('0x115')],{'onDelete':_0x4632('0x18b')});db[_0x4632('0x10b')]['belongsTo'](db[_0x4632('0x156')],{'onDelete':_0x4632('0x18b')});db[_0x4632('0x10b')]['belongsTo'](db[_0x4632('0x87')],{'onDelete':_0x4632('0x18b'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x4632('0x12e')](db[_0x4632('0x90')],{'onDelete':_0x4632('0x18b'),'foreignKey':'TagId'});db[_0x4632('0x10d')][_0x4632('0x11f')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x4632('0x11e'),'foreignKey':'WhatsappInteractionId'});db[_0x4632('0x10d')][_0x4632('0x12e')](db[_0x4632('0x156')],{'as':_0x4632('0x182'),'foreignKey':_0x4632('0x1f7')});db[_0x4632('0x10d')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':'Contact','foreignKey':_0x4632('0x176')});db[_0x4632('0x10d')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'as':'Owner','foreignKey':_0x4632('0x121')});db[_0x4632('0x10d')][_0x4632('0x132')](db['Tag'],{'through':_0x4632('0x1f8'),'as':_0x4632('0x195')});db[_0x4632('0x10d')][_0x4632('0x132')](db[_0x4632('0x90')],{'through':_0x4632('0x1f8'),'as':_0x4632('0x1a5')});db[_0x4632('0x10d')][_0x4632('0x132')](db[_0x4632('0x11c')],{'as':_0x4632('0x185'),'through':_0x4632('0x13d'),'foreignKey':'WhatsappInteractionId'});db[_0x4632('0x10f')]['belongsTo'](db[_0x4632('0x11c')],{'as':_0x4632('0x11c')});db[_0x4632('0x10f')][_0x4632('0x12e')](db[_0x4632('0x76')],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x175')});db['WhatsappMessage'][_0x4632('0x12e')](db['WhatsappInteraction'],{'onDelete':_0x4632('0x11e'),'as':_0x4632('0x188'),'foreignKey':_0x4632('0x1f9')});db[_0x4632('0x10f')][_0x4632('0x12e')](db[_0x4632('0x156')],{'as':_0x4632('0x182'),'foreignKey':'WhatsappAccountId'});db[_0x4632('0x111')][_0x4632('0x12e')](db['WhatsappAccount'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x4632('0x100')],{'as':_0x4632('0x17d'),'foreignKey':'ListId'});db[_0x4632('0x111')][_0x4632('0x12e')](db[_0x4632('0x76')],{'as':_0x4632('0x175'),'foreignKey':_0x4632('0x176')});db[_0x4632('0x111')][_0x4632('0x12e')](db[_0x4632('0x10d')],{});db[_0x4632('0x111')][_0x4632('0x12e')](db['WhatsappQueue'],{});db[_0x4632('0x111')][_0x4632('0x12e')](db[_0x4632('0x10f')],{});db['WhatsappQueueReport'][_0x4632('0x12e')](db['User'],{});db[_0x4632('0x113')][_0x4632('0x12e')](db[_0x4632('0x10f')],{});db[_0x4632('0x113')]['belongsTo'](db[_0x4632('0x10d')],{});db[_0x4632('0x113')][_0x4632('0x12e')](db[_0x4632('0x156')],{'foreignKey':_0x4632('0x1fa'),'as':_0x4632('0x1e1')});db[_0x4632('0x113')][_0x4632('0x12e')](db[_0x4632('0x156')],{'foreignKey':_0x4632('0x1fb'),'as':'ToAccount'});db[_0x4632('0x113')][_0x4632('0x12e')](db['WhatsappQueue'],{'foreignKey':_0x4632('0x1fc'),'as':_0x4632('0x1e7')});db['WhatsappTransferReport'][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':_0x4632('0x1e2'),'as':_0x4632('0x1e3')});db[_0x4632('0x113')][_0x4632('0x12e')](db[_0x4632('0x11c')],{'foreignKey':'ToUserId','as':'ToAgent'});db['WhatsappQueue']['belongsToMany'](db[_0x4632('0x11c')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x4632('0x1fd')});db[_0x4632('0x115')]['belongsToMany'](db[_0x4632('0xf1')],{'through':_0x4632('0x1db'),'as':_0x4632('0x16c')});module[_0x4632('0x1fe')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x13f6=['JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','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','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','hasMany','Recordings','UserId','HopperFinals','ReportAgentPreview','ChatInteractions','SmsInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','user_has_fax_interactions','OpenchannelInteraction','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefix','UserVoicePrefix','MailQueue','ChatQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','CmContact','ContactId','MailAccountId','MailServerOut','Imap','Disposition','Dispositions','Interactions','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessageId','restrict','IntervalId','List','Items','FaxAccountId','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','Account','fax_interaction_has_tags','SmsAccountId','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Answers','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueue','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','ChatMessage','Agent','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','FaxInteractions','Company','cm_user_has_contacts','cm_contact_has_tags','OwnerId','CampaignId','All','Automation','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Action','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','ServicenowAccount','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','VoiceQueues','MailQueues','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','TeamVoicePrefix','VoicePrefixes','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToUserId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Extensions','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','WhatsappQueueId','../config/environment','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','sequelizeHistory','127.0.0.1','utf8','utf8_general_ci','username','options','database','password','User','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelMessage/openchannelMessage.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../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','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x13f6,0x124));var _0x613f=function(_0x4daf25,_0x5c84d3){_0x4daf25=_0x4daf25-0x0;var _0x187690=_0x13f6[_0x4daf25];return _0x187690;};'use strict';var config=require(_0x613f('0x0'));var Sequelize=require(_0x613f('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x613f('0x2')]();config[_0x613f('0x1')]=_[_0x613f('0x3')](config['sequelize'],{'database':_0x613f('0x4'),'username':_0x613f('0x5'),'password':_0x613f('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x613f('0x7'),'dialectOptions':{'charset':_0x613f('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x613f('0x3')](config[_0x613f('0x9')],{'database':_0x613f('0x4'),'username':_0x613f('0x5'),'password':'xC@LL1234','options':{'host':_0x613f('0xa'),'port':0xcea,'dialect':_0x613f('0x7'),'dialectOptions':{'charset':_0x613f('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x613f('0xb'),'collate':_0x613f('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x613f('0x1')]['database'],config[_0x613f('0x1')][_0x613f('0xd')],config['sequelize']['password'],config['sequelize'][_0x613f('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x613f('0x9')][_0x613f('0xf')],config[_0x613f('0x9')][_0x613f('0xd')],config[_0x613f('0x9')][_0x613f('0x10')],config[_0x613f('0x9')][_0x613f('0xe')])};db[_0x613f('0x11')]=db['sequelize'][_0x613f('0x12')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x613f('0x13')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x14'));db[_0x613f('0x15')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x16'));db['VoiceMusicOnHold']=db['sequelize'][_0x613f('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0x613f('0x17')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x18'));db['VoiceMail']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x19'));db[_0x613f('0x1a')]=db[_0x613f('0x1')]['import'](_0x613f('0x1b'));db[_0x613f('0x1c')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x1d'));db[_0x613f('0x1e')]=db['sequelize']['import']('../api/voiceDialReport/voiceDialReport.model');db[_0x613f('0x1f')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x20'));db['VoiceQueueReport']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize'][_0x613f('0x12')](_0x613f('0x21'));db[_0x613f('0x22')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x23'));db[_0x613f('0x24')]=db[_0x613f('0x1')]['import'](_0x613f('0x25'));db[_0x613f('0x26')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x27'));db[_0x613f('0x28')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x29'));db[_0x613f('0x2a')]=db['sequelize'][_0x613f('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x613f('0x2b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x2c'));db[_0x613f('0x2d')]=db[_0x613f('0x1')]['import'](_0x613f('0x2e'));db[_0x613f('0x2f')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x30'));db['UserOpenchannelQueue']=db['sequelize']['import'](_0x613f('0x31'));db[_0x613f('0x32')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x613f('0x33')]=db[_0x613f('0x1')]['import'](_0x613f('0x34'));db['MailServerOut']=db[_0x613f('0x1')]['import'](_0x613f('0x35'));db['MailAccount']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x36'));db['MailQueue']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x37'));db[_0x613f('0x38')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x39'));db[_0x613f('0x3a')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x613f('0x3b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x3c'));db[_0x613f('0x3d')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/mailApplication/mailApplication.model');db[_0x613f('0x3e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x3f'));db[_0x613f('0x40')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/dashboard/dashboard.model');db[_0x613f('0x41')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x42'));db[_0x613f('0x43')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x44'));db[_0x613f('0x45')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x46'));db[_0x613f('0x47')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x48'));db[_0x613f('0x49')]=db[_0x613f('0x1')]['import'](_0x613f('0x4a'));db[_0x613f('0x4b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x4c'));db[_0x613f('0x4d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x4e'));db[_0x613f('0x4f')]=db['sequelize']['import'](_0x613f('0x50'));db[_0x613f('0x51')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x52'));db[_0x613f('0x53')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x54'));db[_0x613f('0x55')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x56'));db[_0x613f('0x57')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x58'));db[_0x613f('0x59')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5a'));db['OpenchannelApplication']=db['sequelize'][_0x613f('0x12')](_0x613f('0x5b'));db['OpenchannelInteraction']=db['sequelize'][_0x613f('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5c'));db['OpenchannelQueue']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5d'));db[_0x613f('0x5e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5f'));db['ChatApplication']=db['sequelize'][_0x613f('0x12')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x60'));db['ChatMessage']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x61'));db[_0x613f('0x62')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x63'));db['ChatQueue']=db[_0x613f('0x1')]['import'](_0x613f('0x64'));db[_0x613f('0x65')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x66'));db[_0x613f('0x67')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x68'));db[_0x613f('0x69')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6a'));db['CmContact']=db['sequelize'][_0x613f('0x12')]('../api/cmContact/cmContact.model');db[_0x613f('0x6b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6c'));db[_0x613f('0x6d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6e'));db[_0x613f('0x6f')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x613f('0x70')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x71'));db['ReportAgentPreview']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x613f('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x613f('0x1')]['import']('../api/action/action.model');db['Automation']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/automation/automation.model');db[_0x613f('0x72')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x73'));db['Disposition']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/disposition/disposition.model');db[_0x613f('0x74')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x75'));db[_0x613f('0x76')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x77'));db[_0x613f('0x78')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x79'));db['Cdr']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x7a'));db[_0x613f('0x7b')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x613f('0x7c')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x7d'));db[_0x613f('0x7e')]=db[_0x613f('0x1')]['import']('../api/sound/sound.model');db[_0x613f('0x7f')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x80'));db['Template']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x81'));db[_0x613f('0x82')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x83'));db[_0x613f('0x84')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x85'));db[_0x613f('0x86')]=db[_0x613f('0x1')]['import'](_0x613f('0x87'));db[_0x613f('0x88')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x89'));db[_0x613f('0x8a')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x8b'));db[_0x613f('0x8c')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x8d'));db[_0x613f('0x8e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x8f'));db[_0x613f('0x90')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x91'));db[_0x613f('0x92')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x93'));db[_0x613f('0x94')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x95'));db[_0x613f('0x96')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x97'));db[_0x613f('0x98')]=db[_0x613f('0x1')]['import'](_0x613f('0x99'));db[_0x613f('0x9a')]=db['sequelize'][_0x613f('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x613f('0x9b')]=db['sequelize']['import'](_0x613f('0x9c'));db[_0x613f('0x9d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x9e'));db[_0x613f('0x9f')]=db[_0x613f('0x1')]['import'](_0x613f('0xa0'));db[_0x613f('0xa1')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa2'));db['DeskConfiguration']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x613f('0xa3')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db['sequelize'][_0x613f('0x12')](_0x613f('0xa4'));db['ZohoConfiguration']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa5'));db['ZohoField']=db[_0x613f('0x1')]['import'](_0x613f('0xa6'));db['ZendeskAccount']=db['sequelize'][_0x613f('0x12')](_0x613f('0xa7'));db[_0x613f('0xa8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa9'));db[_0x613f('0xaa')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xab'));db[_0x613f('0xac')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xad'));db[_0x613f('0xae')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xaf'));db[_0x613f('0xb0')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xb1'));db[_0x613f('0xb2')]=db[_0x613f('0x1')]['import'](_0x613f('0xb3'));db[_0x613f('0xb4')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xb5'));db[_0x613f('0xb6')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xb7'));db['ServicenowAccount']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xb8'));db[_0x613f('0xb9')]=db[_0x613f('0x1')]['import'](_0x613f('0xba'));db[_0x613f('0xbb')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xbc'));db[_0x613f('0xbd')]=db['sequelize']['import'](_0x613f('0xbe'));db[_0x613f('0xbf')]=db[_0x613f('0x1')]['import'](_0x613f('0xc0'));db[_0x613f('0xc1')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x613f('0xc2')]=db[_0x613f('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x613f('0x1')]['import'](_0x613f('0xc3'));db[_0x613f('0xc4')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x613f('0x86')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x87'));db[_0x613f('0xc5')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/network/network.model');db[_0x613f('0xc6')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x613f('0xc7')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x613f('0xc8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xc9'));db[_0x613f('0xca')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xcb'));db['JscriptySessionReport']=db['sequelize'][_0x613f('0x12')](_0x613f('0xcc'));db[_0x613f('0xcd')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x613f('0xce')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xcf'));db[_0x613f('0xd0')]=db[_0x613f('0x1')]['import'](_0x613f('0xd1'));db[_0x613f('0xd2')]=db['sequelize'][_0x613f('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x613f('0xd3')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xd4'));db[_0x613f('0xd5')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xd6'));db['SquareProject']=db[_0x613f('0x1')]['import'](_0x613f('0xd7'));db[_0x613f('0xd8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xd9'));db[_0x613f('0xda')]=db[_0x613f('0x1')]['import'](_0x613f('0xdb'));db[_0x613f('0xdc')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xdd'));db[_0x613f('0xde')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xdf'));db[_0x613f('0xe0')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xe1'));db['Migration']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/migration/migration.model');db[_0x613f('0xe2')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe3'));db[_0x613f('0xe4')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe5'));db[_0x613f('0xe6')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe7'));db[_0x613f('0xe8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe9'));db[_0x613f('0xea')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xeb'));db['OpenchannelTransferReport']=db[_0x613f('0x1')]['import'](_0x613f('0xec'));db[_0x613f('0xed')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xee'));db[_0x613f('0xef')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf0'));db['VoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x613f('0xf1')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf2'));db[_0x613f('0xf3')]=db[_0x613f('0x1')]['import'](_0x613f('0xf4'));db[_0x613f('0xf5')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf6'));db[_0x613f('0xf7')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/userNotification/userNotification.model');db[_0x613f('0xf8')]=db['sequelize']['import'](_0x613f('0xf9'));db[_0x613f('0xfa')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xfb'));db[_0x613f('0xfc')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xfd'));db[_0x613f('0xfe')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/whatsappMessage/whatsappMessage.model');db[_0x613f('0xff')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x100'));db['WhatsappTransferReport']=db[_0x613f('0x1')]['import'](_0x613f('0x101'));db[_0x613f('0x102')]=db[_0x613f('0x1')]['import'](_0x613f('0x103'));db[_0x613f('0x104')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x105'));db[_0x613f('0x106')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x107'));db['TeamVoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x108'));db['UserVoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x109'));db[_0x613f('0x11')][_0x613f('0x10a')](db[_0x613f('0x10b')],{'as':_0x613f('0x10b'),'onDelete':_0x613f('0x10c'),'foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x17')],{'as':_0x613f('0x10e'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x26')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':'Extensions','onDelete':_0x613f('0x10c'),'hooks':!![]});db[_0x613f('0x11')][_0x613f('0x10d')](db['CmHopperFinal'],{'as':_0x613f('0x110'),'foreignKey':'UserId'});db['User'][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':'HopperHistory','foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')]['hasMany'](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x613f('0x10f')});db['User'][_0x613f('0x10d')](db['ChatInteraction'],{'as':_0x613f('0x112'),'foreignKey':'UserId'});db[_0x613f('0x11')]['hasMany'](db['SmsInteraction'],{'as':_0x613f('0x113'),'foreignKey':_0x613f('0x10f')});db['User'][_0x613f('0x10d')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x3a')],{'as':'MailInteractions','foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db['WhatsappInteraction'],{'as':_0x613f('0x114'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0xf7')],{'as':_0x613f('0x115'),'foreignKey':_0x613f('0x116')});db['User'][_0x613f('0x117')](db[_0x613f('0xf1')],{'as':_0x613f('0xf1'),'foreignKey':'userProfileId'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x65')],{'as':'Groups','through':_0x613f('0x119')});db[_0x613f('0x11')][_0x613f('0x118')](db['CmContact'],{'as':_0x613f('0x11a'),'through':'cm_user_has_contacts'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x11b'),'through':_0x613f('0x11c')});db[_0x613f('0x11')][_0x613f('0x118')](db['Team'],{'through':'user_has_teams'});db['User'][_0x613f('0x118')](db[_0x613f('0x3a')],{'as':_0x613f('0x11d'),'through':_0x613f('0x11e')});db['User']['belongsToMany'](db[_0x613f('0x11f')],{'as':_0x613f('0x112'),'through':_0x613f('0x120')});db[_0x613f('0x11')][_0x613f('0x118')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x613f('0x121')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x53')],{'as':_0x613f('0x113'),'through':'user_has_sms_interactions'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x122')],{'as':_0x613f('0x123'),'through':_0x613f('0x124')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0xfc')],{'as':_0x613f('0x114'),'through':_0x613f('0x125')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x126')],{'as':'VoiceQueues','through':_0x613f('0x28'),'required':![]});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x127')],{'as':'VoicePrefixes','through':_0x613f('0x128'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0x129')],{'as':'MailQueues','through':_0x613f('0x2b'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db['ChatQueue'],{'as':_0x613f('0x12a'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x613f('0x118')](db[_0x613f('0x4b')],{'as':'FaxQueues','through':_0x613f('0x2d'),'required':![]});db['User'][_0x613f('0x118')](db['SmsQueue'],{'as':_0x613f('0x12b'),'through':_0x613f('0x2f'),'required':![]});db[_0x613f('0x11')][_0x613f('0x118')](db['OpenchannelQueue'],{'as':_0x613f('0x12c'),'through':_0x613f('0x12d'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x613f('0x32'),'required':![]});db['User'][_0x613f('0x118')](db['CmList'],{'through':_0x613f('0x11c')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x12e')],{'as':_0x613f('0x12f'),'through':_0x613f('0x130')});db['User'][_0x613f('0x118')](db[_0x613f('0x43')],{'as':_0x613f('0x131'),'through':'user_has_fax_accounts'});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0x132')],{'as':_0x613f('0x133'),'through':_0x613f('0x134')});db['User'][_0x613f('0x118')](db['OpenchannelAccount'],{'as':_0x613f('0x135'),'through':'user_has_openchannel_accounts'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x4f')],{'as':_0x613f('0x136'),'through':'user_has_sms_accounts'});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0xf8')],{'as':_0x613f('0x137'),'through':_0x613f('0x138')});db['User'][_0x613f('0x118')](db[_0x613f('0x139')],{'as':_0x613f('0x13a'),'through':_0x613f('0x13b')});db[_0x613f('0x13c')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':_0x613f('0x13d'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x13e')});db['VoiceContext']['hasMany'](db[_0x613f('0x15')],{'onDelete':_0x613f('0x10c')});db['VoiceExtension']['hasMany'](db['VoiceExtension'],{'as':_0x613f('0x13f'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x613f('0x118')](db[_0x613f('0x7e')],{'as':'Sounds','through':_0x613f('0x140')});db[_0x613f('0x126')][_0x613f('0x10d')](db['UserVoiceQueueRt'],{'as':_0x613f('0x141'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')]['hasMany'](db['CmHopper'],{'as':_0x613f('0x143'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':'HopperFinals','foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':_0x613f('0x144'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x6d')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x145')],{'as':_0x613f('0x146'),'foreignKey':_0x613f('0x142')});db['VoiceQueue']['belongsTo'](db[_0x613f('0x22')],{'as':_0x613f('0x22'),'foreignKey':_0x613f('0x147')});db[_0x613f('0x126')]['belongsTo'](db[_0x613f('0x22')],{'as':_0x613f('0x148'),'foreignKey':_0x613f('0x149')});db['VoiceQueue'][_0x613f('0x117')](db[_0x613f('0x76')],{'as':_0x613f('0x76'),'foreignKey':'IntervalId'});db[_0x613f('0x126')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x613f('0x126')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':'Lists','through':_0x613f('0x14b')});db[_0x613f('0x126')]['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x28')});db['VoiceQueue'][_0x613f('0x118')](db['Team'],{'as':_0x613f('0x14d'),'through':_0x613f('0x106')});db['VoiceQueue'][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x14e'),'through':'voice_queues_has_cm_blacklists'});db[_0x613f('0x17')][_0x613f('0x117')](db['User'],{'as':_0x613f('0x11'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x14f')][_0x613f('0x117')](db['User'],{'as':'User','foreignKey':_0x613f('0x10f')});db[_0x613f('0x10b')][_0x613f('0x10d')](db['VoiceMailMessage'],{'as':_0x613f('0x150'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0x613f('0x117')](db[_0x613f('0x10b')],{'foreignKey':_0x613f('0x151'),'targetKey':_0x613f('0x152')});db[_0x613f('0x1c')][_0x613f('0x10d')](db[_0x613f('0x153')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x613f('0x1f')],{'as':'AgentReports','foreignKey':_0x613f('0x154'),'constraints':![]});db[_0x613f('0x1c')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11'),'foreignKey':'UserId'});db[_0x613f('0x1c')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db[_0x613f('0x33')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':_0x613f('0x132'),'foreignKey':_0x613f('0x157')});db[_0x613f('0x158')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x613f('0x132')][_0x613f('0x10a')](db[_0x613f('0x33')],{'as':_0x613f('0x159'),'onDelete':'cascade'});db[_0x613f('0x132')][_0x613f('0x10a')](db[_0x613f('0x158')],{'as':'Smtp','onDelete':_0x613f('0x10c')});db[_0x613f('0x132')]['hasMany'](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x157'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x132')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x613f('0x132')][_0x613f('0x10d')](db[_0x613f('0x3b')],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x157')});db[_0x613f('0x132')][_0x613f('0x10d')](db[_0x613f('0x3a')],{'as':_0x613f('0x15c')});db['MailAccount'][_0x613f('0x10d')](db[_0x613f('0x3d')],{'as':_0x613f('0x13f')});db[_0x613f('0x132')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d')});db['MailAccount'][_0x613f('0x117')](db['Template'],{'as':_0x613f('0x15e'),'foreignKey':_0x613f('0x15f')});db[_0x613f('0x132')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x134')});db[_0x613f('0x129')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x14c'),'through':'UserMailQueue'});db[_0x613f('0x129')][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':_0x613f('0x160'),'as':'Teams'});db[_0x613f('0x3a')][_0x613f('0x10d')](db[_0x613f('0x3b')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3a')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':'Account','foreignKey':_0x613f('0x157')});db[_0x613f('0x3a')]['belongsTo'](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x3a')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['MailInteraction'][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x164'),'as':_0x613f('0x165')});db[_0x613f('0x3a')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x164'),'as':_0x613f('0x166')});db[_0x613f('0x3a')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'through':_0x613f('0x11e'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3b')][_0x613f('0x10d')](db[_0x613f('0xe2')],{'as':_0x613f('0x168'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x3b')]['belongsTo'](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db['MailMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x162')});db[_0x613f('0x3b')][_0x613f('0x117')](db[_0x613f('0x3a')],{'as':_0x613f('0x169'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3b')]['belongsTo'](db[_0x613f('0x132')],{'as':'Account','foreignKey':_0x613f('0x157')});db['MailMessage'][_0x613f('0x117')](db['ChatWebsite'],{'as':_0x613f('0x12e'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x613f('0x117')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x613f('0x16a')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x129')],{'onDelete':'restrict'});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x132')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':'TagId'});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0x132')],{});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId'});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db[_0x613f('0x3e')]['belongsTo'](db[_0x613f('0x3a')],{});db['MailQueueReport'][_0x613f('0x117')](db[_0x613f('0x3b')],{});db['MailQueueReport'][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0x3e')]['belongsTo'](db[_0x613f('0x129')],{});db[_0x613f('0x40')][_0x613f('0x10d')](db[_0x613f('0x41')],{'as':_0x613f('0x16e'),'onDelete':_0x613f('0x10c')});db['FaxAccount'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':'FaxAccountId','onDelete':_0x613f('0x10c')});db[_0x613f('0x43')][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':'Answers','foreignKey':_0x613f('0x16f')});db[_0x613f('0x43')][_0x613f('0x10d')](db['FaxInteraction'],{'as':_0x613f('0x15c')});db[_0x613f('0x43')]['hasMany'](db['FaxApplication'],{'as':_0x613f('0x13f')});db[_0x613f('0x43')][_0x613f('0x10d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x613f('0x10c')});db[_0x613f('0x43')]['hasMany'](db[_0x613f('0x49')],{'as':_0x613f('0x150')});db[_0x613f('0x43')][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x22')});db[_0x613f('0x43')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['FaxAccount'][_0x613f('0x117')](db['Pause'],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x43')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x14c'),'through':_0x613f('0x171')});db['FaxApplication']['belongsTo'](db[_0x613f('0x11')],{'onDelete':'restrict'});db[_0x613f('0x45')][_0x613f('0x117')](db[_0x613f('0x4b')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x45')][_0x613f('0x117')](db[_0x613f('0x43')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x45')][_0x613f('0x117')](db['Tag'],{'onDelete':_0x613f('0x16b'),'foreignKey':'TagId'});db[_0x613f('0x47')][_0x613f('0x10d')](db[_0x613f('0x49')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x172')});db[_0x613f('0x47')]['belongsTo'](db[_0x613f('0x43')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x16f')});db[_0x613f('0x47')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0x47')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x47')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x174'),'as':_0x613f('0x165')});db[_0x613f('0x47')]['belongsToMany'](db[_0x613f('0x7f')],{'through':'fax_interaction_has_tags','as':_0x613f('0x166')});db['FaxInteraction'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'through':_0x613f('0x121'),'foreignKey':_0x613f('0x172')});db['FaxMessage'][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'as':'User'});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0x47')],{'as':_0x613f('0x169'),'foreignKey':_0x613f('0x172')});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':'Contact'});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':'AttachmentId'});db[_0x613f('0x49')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x613f('0x16f')});db['FaxQueue']['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'UserFaxQueue'});db['FaxQueue'][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':'team_has_fax_queues','as':_0x613f('0x14d')});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0x43')],{});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x4d')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0x47')],{});db['FaxQueueReport'][_0x613f('0x117')](db[_0x613f('0x49')],{});db[_0x613f('0x4d')][_0x613f('0x117')](db['User'],{});db[_0x613f('0x4d')]['belongsTo'](db[_0x613f('0x4b')],{});db[_0x613f('0x4f')][_0x613f('0x10d')](db['Disposition'],{'as':_0x613f('0x15b'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x613f('0x4f')][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':'Answers','foreignKey':_0x613f('0x175')});db[_0x613f('0x4f')]['hasMany'](db[_0x613f('0x55')],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x175')});db[_0x613f('0x4f')][_0x613f('0x10d')](db[_0x613f('0x53')],{'as':_0x613f('0x15c')});db['SmsAccount']['hasMany'](db[_0x613f('0x51')],{'as':_0x613f('0x13f')});db[_0x613f('0x4f')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d')});db[_0x613f('0x4f')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x4f')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x176')});db[_0x613f('0x51')]['belongsTo'](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x51')][_0x613f('0x117')](db['SmsQueue'],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x51')][_0x613f('0x117')](db[_0x613f('0x4f')],{'onDelete':'restrict'});db[_0x613f('0x51')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db['SmsApplication'][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db[_0x613f('0x53')][_0x613f('0x10d')](db['SmsMessage'],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x178')});db[_0x613f('0x53')]['belongsTo'](db['SmsAccount'],{'as':_0x613f('0x173'),'foreignKey':'SmsAccountId'});db[_0x613f('0x53')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db['SmsInteraction'][_0x613f('0x117')](db[_0x613f('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x613f('0x53')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x179'),'as':'Tags'});db['SmsInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x179'),'as':_0x613f('0x166')});db[_0x613f('0x53')][_0x613f('0x118')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':'Contact'});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x53')],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x169'),'foreignKey':_0x613f('0x178')});db[_0x613f('0x55')][_0x613f('0x117')](db['SmsAccount'],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x175')});db['SmsQueue'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x2f'),'foreignKey':_0x613f('0x17a')});db[_0x613f('0x57')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x17b'),'as':_0x613f('0x14d')});db[_0x613f('0x59')][_0x613f('0x10d')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x613f('0x10c')});db['OpenchannelAccount'][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')]['hasMany'](db[_0x613f('0x122')],{'as':_0x613f('0x15c'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x10d')](db[_0x613f('0x17e')],{'as':'Messages','foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x10d')](db[_0x613f('0x17f')],{'as':_0x613f('0x13f'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['OpenchannelAccount'][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x613f('0x59')]['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_openchannel_accounts'});db[_0x613f('0x17f')][_0x613f('0x117')](db['User'],{'onDelete':'restrict'});db[_0x613f('0x17f')][_0x613f('0x117')](db[_0x613f('0x180')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x181')});db[_0x613f('0x17f')]['belongsTo'](db[_0x613f('0x59')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication']['belongsTo'](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x17f')][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db[_0x613f('0x122')]['hasMany'](db[_0x613f('0x17e')],{'as':'Messages','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x122')][_0x613f('0x117')](db[_0x613f('0x59')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x17d')});db['OpenchannelInteraction'][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x122')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0x613f('0x7f')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x613f('0x122')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x183'),'as':'ThroughTags'});db[_0x613f('0x122')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':_0x613f('0x124'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'as':'User'});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':_0x613f('0x162')});db[_0x613f('0x17e')][_0x613f('0x117')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x613f('0x169'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':_0x613f('0x184')});db[_0x613f('0x17e')]['belongsTo'](db[_0x613f('0x59')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x180')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x12d'),'foreignKey':_0x613f('0x181')});db[_0x613f('0x180')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x185'),'as':'Teams'});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x186'),'onDelete':'cascade'});db[_0x613f('0x12e')][_0x613f('0x10d')](db['CannedAnswer'],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x186')});db['ChatWebsite'][_0x613f('0x10d')](db[_0x613f('0x67')],{'as':_0x613f('0x187')});db['ChatWebsite'][_0x613f('0x10d')](db[_0x613f('0x11f')],{'as':_0x613f('0x15c')});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x188')],{'as':_0x613f('0x13f')});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x189')],{'as':'Messages'});db[_0x613f('0x12e')]['belongsTo'](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x12e')][_0x613f('0x117')](db['Interval'],{'as':'Interval','foreignKey':_0x613f('0x16c')});db[_0x613f('0x12e')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':_0x613f('0x132'),'foreignKey':'MailAccountId'});db[_0x613f('0x12e')]['belongsTo'](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x12e')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_chat_websites'});db[_0x613f('0x5e')]['belongsTo'](db[_0x613f('0x59')],{});db[_0x613f('0x5e')][_0x613f('0x117')](db['CmList'],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x5e')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db['OpenchannelQueueReport'][_0x613f('0x117')](db[_0x613f('0x122')],{});db[_0x613f('0x5e')][_0x613f('0x117')](db['OpenchannelMessage'],{});db[_0x613f('0x5e')][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0x5e')]['belongsTo'](db[_0x613f('0x180')],{});db[_0x613f('0x188')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x18a'),'foreignKey':_0x613f('0x10f'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x188')]['belongsTo'](db[_0x613f('0x18b')],{'as':_0x613f('0x18c'),'foreignKey':_0x613f('0x18d'),'onDelete':_0x613f('0x16b')});db['ChatApplication'][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':_0x613f('0x18e'),'foreignKey':_0x613f('0x186'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x188')][_0x613f('0x117')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x613f('0x177')});db[_0x613f('0x11f')]['hasMany'](db['ChatMessage'],{'as':_0x613f('0x150'),'onDelete':'cascade','foreignKey':_0x613f('0x18f')});db[_0x613f('0x11f')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x186')});db[_0x613f('0x11f')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0x11f')][_0x613f('0x117')](db['User'],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db[_0x613f('0x11f')]['belongsToMany'](db['Tag'],{'through':_0x613f('0x190'),'as':'Tags'});db['ChatInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x190'),'as':_0x613f('0x166')});db[_0x613f('0x11f')]['belongsToMany'](db[_0x613f('0x11')],{'as':'Users','through':_0x613f('0x120'),'foreignKey':'ChatInteractionId'});db[_0x613f('0x189')][_0x613f('0x117')](db['User'],{'onDelete':'cascade','as':_0x613f('0x11')});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0x11f')],{'onDelete':_0x613f('0x10c'),'as':'Interaction','foreignKey':_0x613f('0x18f')});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':_0x613f('0x184')});db['ChatMessage']['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x613f('0x62')][_0x613f('0x10d')](db[_0x613f('0xe2')],{'as':_0x613f('0x168'),'foreignKey':_0x613f('0x16a'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x62')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':'Account','foreignKey':_0x613f('0x186')});db[_0x613f('0x18b')][_0x613f('0x118')](db['User'],{'as':'Agents','through':_0x613f('0x2a'),'hooks':!![]});db[_0x613f('0x18b')][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':_0x613f('0x191'),'as':'Teams'});db[_0x613f('0x65')][_0x613f('0x10d')](db['ChatInternalMessage'],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x192'),'onDelete':'cascade'});db[_0x613f('0x65')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x141'),'through':_0x613f('0x119')});db[_0x613f('0x67')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':'Website','foreignKey':_0x613f('0x186')});db[_0x613f('0x69')][_0x613f('0x10d')](db[_0x613f('0x155')],{'as':_0x613f('0x11a'),'foreignKey':_0x613f('0x193')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x6b')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':_0x613f('0x110'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x613f('0x10d')](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x145')],{'as':_0x613f('0x146'),'foreignKey':_0x613f('0x156')});db['CmContact'][_0x613f('0x10d')](db[_0x613f('0x122')],{'as':'OpenchannelInteractions','foreignKey':_0x613f('0x156'),'onDelete':'restrict'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x11f')],{'as':_0x613f('0x112'),'foreignKey':'ContactId','onDelete':_0x613f('0x16b')});db[_0x613f('0x155')][_0x613f('0x10d')](db['SmsInteraction'],{'as':_0x613f('0x113'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x47')],{'as':_0x613f('0x194'),'foreignKey':_0x613f('0x156'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x155')][_0x613f('0x10d')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['belongsTo'](db[_0x613f('0x69')],{'as':_0x613f('0x195'),'foreignKey':_0x613f('0x193')});db[_0x613f('0x155')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId','onDelete':_0x613f('0x10c')});db['CmContact'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Users','through':_0x613f('0x196')});db['CmContact'][_0x613f('0x118')](db[_0x613f('0x7f')],{'as':'Tags','through':_0x613f('0x197')});db[_0x613f('0x155')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x197'),'as':_0x613f('0x166')});db[_0x613f('0x6b')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db['User'],{'as':_0x613f('0x18a'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x6b')][_0x613f('0x117')](db[_0x613f('0x126')],{'as':_0x613f('0x18c'),'foreignKey':_0x613f('0x142'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0xe0')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0x11')],{'as':'Owner','foreignKey':_0x613f('0x198')});db[_0x613f('0x6d')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId','onDelete':_0x613f('0x10c')});db[_0x613f('0x6d')]['belongsTo'](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId','onDelete':_0x613f('0x10c')});db['CmHopperBlack'][_0x613f('0x117')](db[_0x613f('0x126')],{'as':'Queue','foreignKey':_0x613f('0x142'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6d')][_0x613f('0x117')](db[_0x613f('0xe0')],{'as':'Campaign','foreignKey':_0x613f('0x199'),'onDelete':'cascade'});db['Automation'][_0x613f('0x10d')](db[_0x613f('0x74')],{'as':{'plural':_0x613f('0x19a'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x613f('0x19b')]['hasMany'](db[_0x613f('0x74')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x613f('0x19c'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x613f('0x19d'),'foreignKey':_0x613f('0x19e'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db[_0x613f('0x15a')][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x19f'),'onDelete':'cascade'});db[_0x613f('0x76')][_0x613f('0x10d')](db['Interval'],{'as':_0x613f('0x1a0'),'foreignKey':_0x613f('0x16c'),'onDelete':_0x613f('0x10c'),'hooks':!![],'required':![]});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':'Extensions','foreignKey':_0x613f('0x16c'),'onDelete':_0x613f('0x16b')});db['Interval'][_0x613f('0x10d')](db[_0x613f('0x3d')],{'as':_0x613f('0x1a1'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x188')],{'as':'ChatApplications','foreignKey':_0x613f('0x16c')});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x45')],{'as':_0x613f('0x1a2'),'foreignKey':'IntervalId'});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x51')],{'as':_0x613f('0x1a3'),'foreignKey':_0x613f('0x16c')});db['Schedule']['belongsTo'](db[_0x613f('0x132')],{});db[_0x613f('0x7c')][_0x613f('0x117')](db[_0x613f('0x8c')],{'foreignKey':_0x613f('0x1a4')});db[_0x613f('0x7c')][_0x613f('0x117')](db['AnalyticCustomReport'],{'foreignKey':_0x613f('0x1a5')});db[_0x613f('0x7e')][_0x613f('0x118')](db['VoiceMusicOnHold'],{'as':_0x613f('0x1a6'),'through':'moh_has_sounds','onDelete':'restrict'});db['Tag'][_0x613f('0x118')](db[_0x613f('0x155')],{'through':'cm_contact_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0x11f')],{'through':'chat_interaction_has_tags'});db[_0x613f('0x7f')]['belongsToMany'](db[_0x613f('0x3a')],{'through':'mail_interaction_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0x47')],{'through':_0x613f('0x174')});db[_0x613f('0x7f')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x613f('0x183')});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0xfc')],{'through':_0x613f('0x1a7')});db[_0x613f('0x82')][_0x613f('0x10d')](db['Condition'],{'as':{'plural':_0x613f('0x1a8'),'singular':_0x613f('0x1a9')},'foreignKey':'TriggerAllId','onDelete':_0x613f('0x10c'),'hooks':!![]});db['Trigger'][_0x613f('0x10d')](db[_0x613f('0x74')],{'as':{'plural':_0x613f('0x1aa'),'singular':'AnyCondition'},'foreignKey':_0x613f('0x1ab'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db[_0x613f('0x1ac')],{'as':_0x613f('0x19d'),'foreignKey':_0x613f('0x1ad'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['AnalyticCustomReport'][_0x613f('0x10d')](db[_0x613f('0x92')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1a5'),'hooks':!![]});db[_0x613f('0x8c')][_0x613f('0x10d')](db[_0x613f('0x92')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1a4')});db[_0x613f('0x90')][_0x613f('0x10d')](db['AnalyticFieldReport'],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1af')});db[_0x613f('0x92')][_0x613f('0x117')](db[_0x613f('0x90')],{'foreignKey':_0x613f('0x1af')});db[_0x613f('0x96')][_0x613f('0x10d')](db[_0x613f('0x98')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x98')][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1b3'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0x98')][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x98')][_0x613f('0x117')](db[_0x613f('0x96')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db['SalesforceField']['hasMany'](db[_0x613f('0x9a')],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x9a')][_0x613f('0x10d')](db[_0x613f('0x9a')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0x9a')][_0x613f('0x10d')](db[_0x613f('0x9a')],{'as':'Field','foreignKey':_0x613f('0x1b5')});db['SalesforceField'][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':'VariableId'});db[_0x613f('0x9b')][_0x613f('0x10d')](db[_0x613f('0x9d')],{'as':'Configurations','onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x9d')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x9d')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x613f('0x9d')][_0x613f('0x10d')](db[_0x613f('0x9f')],{'as':'Fields','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x9d')][_0x613f('0x117')](db[_0x613f('0x9b')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x9f')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db['SugarcrmField']['hasMany'](db[_0x613f('0x9f')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db['SugarcrmField'][_0x613f('0x10d')](db[_0x613f('0x9f')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0x9f')][_0x613f('0x117')](db['Variable'],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db['DeskAccount'][_0x613f('0x10d')](db[_0x613f('0x1bb')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x1bb')][_0x613f('0x10d')](db[_0x613f('0xa3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x613f('0x1b7')});db['DeskConfiguration']['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1b3'),'onDelete':'cascade','foreignKey':_0x613f('0x1b4')});db[_0x613f('0x1bb')]['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db['DeskConfiguration'][_0x613f('0x117')](db[_0x613f('0xa1')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x1bb')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x1bc')});db[_0x613f('0xa3')][_0x613f('0x10d')](db[_0x613f('0xa3')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xa3')]['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db['DeskField'][_0x613f('0x10d')](db['DeskField'],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0xa3')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1bd')][_0x613f('0x10d')](db[_0x613f('0x1be')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x1be')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b2'),'onDelete':'cascade','foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1be')]['hasMany'](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b3'),'onDelete':_0x613f('0x10c'),'foreignKey':'DescriptionId'});db[_0x613f('0x1be')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':'FieldId'});db[_0x613f('0x1be')][_0x613f('0x117')](db[_0x613f('0x1bd')],{'as':_0x613f('0x173'),'foreignKey':'AccountId'});db[_0x613f('0x1bf')][_0x613f('0x10d')](db['ZohoField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1bf')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0x1bf')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x1bf')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1c0')][_0x613f('0x10d')](db['ZendeskConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':'cascade','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xa8')]['hasMany'](db[_0x613f('0xaa')],{'as':_0x613f('0x1b2'),'foreignKey':'SubjectId'});db[_0x613f('0xa8')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':'Descriptions','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xa8')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0xa8')][_0x613f('0x117')](db[_0x613f('0x1c0')],{'as':'Account','foreignKey':'AccountId'});db[_0x613f('0xa8')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':'int_zendesk_configuration_has_tags'});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':'Description','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xaa')][_0x613f('0x117')](db['Variable'],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db['FreshdeskAccount'][_0x613f('0x10d')](db['FreshdeskConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':'cascade','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xae')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db['FreshdeskConfiguration'][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xae')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db['FreshdeskConfiguration'][_0x613f('0x117')](db[_0x613f('0xac')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xae')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x613f('0xb0')][_0x613f('0x10d')](db['FreshdeskField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db['FreshdeskField'][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0xb0')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db['FreshdeskField'][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xb2')][_0x613f('0x10d')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb4')]['hasMany'](db[_0x613f('0xb6')],{'as':_0x613f('0x1b2'),'foreignKey':'SubjectId'});db[_0x613f('0xb4')][_0x613f('0x10d')](db['VtigerField'],{'as':_0x613f('0x1b3'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xb4')][_0x613f('0x10d')](db[_0x613f('0xb6')],{'as':_0x613f('0x1ae'),'foreignKey':'FieldId'});db[_0x613f('0xb4')][_0x613f('0x117')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb6')]['hasMany'](db[_0x613f('0xb6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x613f('0xb6')][_0x613f('0x10d')](db[_0x613f('0xb6')],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db[_0x613f('0xb6')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xb6')]['belongsTo'](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1c1')][_0x613f('0x10d')](db['ServicenowConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb9')]['hasMany'](db[_0x613f('0xbb')],{'as':'Subjects','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xb9')][_0x613f('0x10d')](db[_0x613f('0xbb')],{'as':_0x613f('0x1b3'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xb9')][_0x613f('0x10d')](db[_0x613f('0xbb')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db['ServicenowConfiguration'][_0x613f('0x117')](db[_0x613f('0x1c1')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xbb')][_0x613f('0x10d')](db['ServicenowField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xbb')]['hasMany'](db[_0x613f('0xbb')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xbb')][_0x613f('0x10d')](db['ServicenowField'],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xbb')]['belongsTo'](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0xbd')]['hasMany'](db[_0x613f('0xbf')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db['Dynamics365Configuration']['hasMany'](db[_0x613f('0xc1')],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xbf')]['hasMany'](db[_0x613f('0xc1')],{'as':'Descriptions','onDelete':_0x613f('0x10c'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db[_0x613f('0xbf')]['belongsTo'](db[_0x613f('0xbd')],{'as':'Account','foreignKey':'AccountId'});db[_0x613f('0xc1')][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xc1')][_0x613f('0x10d')](db['Dynamics365Field'],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xc1')][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xc1')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xc2')][_0x613f('0x10d')](db[_0x613f('0x1c2')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x1c2')]['hasMany'](db['FreshsalesField'],{'as':_0x613f('0x1b2'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1c2')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':'Descriptions','foreignKey':_0x613f('0x1b4')});db[_0x613f('0x1c2')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x1c2')][_0x613f('0x117')](db[_0x613f('0xc2')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xc4')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xc4')]['hasMany'](db[_0x613f('0xc4')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db['FreshsalesField']['hasMany'](db[_0x613f('0xc4')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xc4')]['belongsTo'](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xc6')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId'});db[_0x613f('0xc6')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0xc6')]['belongsTo'](db[_0x613f('0x11f')],{});db[_0x613f('0xc6')]['belongsTo'](db[_0x613f('0x189')],{});db[_0x613f('0xc6')][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0xc6')][_0x613f('0x117')](db['ChatQueue'],{});db[_0x613f('0xc7')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':'cascade','foreignKey':_0x613f('0x1c3')});db[_0x613f('0xc7')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1c4')});db[_0x613f('0x145')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0x613f('0x10d')](db['JscriptyAnswerReport'],{'foreignKey':_0x613f('0x1c5'),'onDelete':_0x613f('0x10c')});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x4f')],{});db['SmsQueueReport'][_0x613f('0x117')](db['CmList'],{'as':'List','foreignKey':_0x613f('0x15d')});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0xcd')]['belongsTo'](db[_0x613f('0x53')],{});db['SmsQueueReport'][_0x613f('0x117')](db[_0x613f('0x55')],{});db[_0x613f('0xcd')]['belongsTo'](db['User'],{});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x57')],{});db['JscriptyProject'][_0x613f('0x10d')](db[_0x613f('0x145')],{'foreignKey':_0x613f('0x1c6')});db[_0x613f('0xd2')][_0x613f('0x10d')](db[_0x613f('0xca')],{'foreignKey':'ProjectId'});db[_0x613f('0xd2')][_0x613f('0x10d')](db[_0x613f('0xc8')],{'foreignKey':_0x613f('0x1c6')});db[_0x613f('0x139')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':'user_has_square_projects'});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_teams'});db[_0x613f('0xdc')][_0x613f('0x118')](db['VoiceQueue'],{'through':_0x613f('0x106'),'as':_0x613f('0x1c7')});db[_0x613f('0xdc')]['belongsToMany'](db['MailQueue'],{'through':_0x613f('0x160'),'as':_0x613f('0x1c8')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x18b')],{'through':_0x613f('0x191'),'as':_0x613f('0x12a')});db[_0x613f('0xdc')]['belongsToMany'](db[_0x613f('0x4b')],{'through':'team_has_fax_queues','as':_0x613f('0x1c9')});db['Team']['belongsToMany'](db[_0x613f('0x57')],{'through':_0x613f('0x17b'),'as':_0x613f('0x12b')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x180')],{'through':_0x613f('0x185'),'as':_0x613f('0x12c')});db['Team'][_0x613f('0x118')](db[_0x613f('0x102')],{'through':_0x613f('0x1ca'),'as':_0x613f('0x1cb')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x127')],{'through':_0x613f('0x1cc'),'as':_0x613f('0x1cd')});db[_0x613f('0xe0')][_0x613f('0x10d')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x613f('0xe0')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':'HopperFinals','foreignKey':_0x613f('0x199')});db[_0x613f('0xe0')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':_0x613f('0x144'),'foreignKey':'CampaignId'});db[_0x613f('0xe0')][_0x613f('0x10d')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x613f('0x199')});db[_0x613f('0xe0')][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x22'),'foreignKey':'TrunkId'});db['Campaign'][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x148'),'foreignKey':'TrunkBackupId'});db[_0x613f('0xe0')][_0x613f('0x117')](db[_0x613f('0x76')],{'as':'Interval','foreignKey':_0x613f('0x16c')});db['Campaign']['belongsTo'](db[_0x613f('0x139')],{'as':'SquareProject','foreignKey':_0x613f('0x1ce')});db[_0x613f('0xe0')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x11b'),'through':'campaigns_has_cm_lists'});db[_0x613f('0xe0')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x14e'),'through':_0x613f('0x1cf')});db[_0x613f('0xe2')][_0x613f('0x117')](db[_0x613f('0x62')],{'as':_0x613f('0x62'),'foreignKey':_0x613f('0x16a')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x3b')],{});db[_0x613f('0xe6')]['belongsTo'](db['MailInteraction'],{});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x132')],{'foreignKey':_0x613f('0x1d0'),'as':_0x613f('0x1d1')});db[_0x613f('0xe6')][_0x613f('0x117')](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'ToUserId','as':_0x613f('0x1d4')});db['MailTransferReport']['belongsTo'](db[_0x613f('0x129')],{'foreignKey':_0x613f('0x1d5'),'as':_0x613f('0x1d6')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x132')],{'foreignKey':_0x613f('0x1d7'),'as':_0x613f('0x1d8')});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x189')],{});db[_0x613f('0xe8')][_0x613f('0x117')](db['ChatInteraction'],{});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x12e')],{'foreignKey':_0x613f('0x1d9'),'as':_0x613f('0x1d1')});db[_0x613f('0xe8')][_0x613f('0x117')](db['User'],{'foreignKey':'FromUserId','as':_0x613f('0x1d3')});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'ToUserId','as':_0x613f('0x1d4')});db[_0x613f('0xe8')][_0x613f('0x117')](db['ChatQueue'],{'foreignKey':_0x613f('0x1da'),'as':_0x613f('0x1d6')});db[_0x613f('0xe8')]['belongsTo'](db[_0x613f('0x12e')],{'foreignKey':'ToChatWebsiteId','as':_0x613f('0x1d8')});db[_0x613f('0xea')]['belongsTo'](db[_0x613f('0x49')],{});db[_0x613f('0xea')]['belongsTo'](db[_0x613f('0x47')],{});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x43')],{'foreignKey':'FromFaxAccountId','as':_0x613f('0x1d1')});db[_0x613f('0xea')]['belongsTo'](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':'FromAgent'});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x4b')],{'foreignKey':_0x613f('0x1dc'),'as':_0x613f('0x1d6')});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x43')],{'foreignKey':_0x613f('0x1dd'),'as':_0x613f('0x1d8')});db[_0x613f('0x1de')]['belongsTo'](db[_0x613f('0x17e')],{});db[_0x613f('0x1de')][_0x613f('0x117')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x613f('0x117')](db[_0x613f('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':_0x613f('0x1d1')});db['OpenchannelTransferReport'][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db['OpenchannelTransferReport'][_0x613f('0x117')](db['User'],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x613f('0x180')],{'foreignKey':_0x613f('0x1df'),'as':_0x613f('0x1d6')});db[_0x613f('0x1de')]['belongsTo'](db[_0x613f('0x59')],{'foreignKey':_0x613f('0x1e0'),'as':_0x613f('0x1d8')});db[_0x613f('0xed')][_0x613f('0x117')](db[_0x613f('0x55')],{});db[_0x613f('0xed')][_0x613f('0x117')](db[_0x613f('0x53')],{});db[_0x613f('0xed')][_0x613f('0x117')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x613f('0xed')]['belongsTo'](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db['SmsTransferReport'][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db['SmsTransferReport']['belongsTo'](db['SmsQueue'],{'foreignKey':_0x613f('0x1e1'),'as':_0x613f('0x1d6')});db['SmsTransferReport'][_0x613f('0x117')](db[_0x613f('0x4f')],{'foreignKey':_0x613f('0x1e2'),'as':_0x613f('0x1d8')});db['CmList'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x15d'),'onDelete':_0x613f('0x10c')});db['CmList']['hasMany'](db[_0x613f('0x1e3')],{'as':_0x613f('0x1e4'),'foreignKey':'ListId'});db[_0x613f('0xef')][_0x613f('0x10d')](db[_0x613f('0x155')],{'as':_0x613f('0x11a'),'onDelete':_0x613f('0x10c'),'foreignKey':'ListId'});db[_0x613f('0xef')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':_0x613f('0x110'),'foreignKey':_0x613f('0x15d')});db['CmList'][_0x613f('0x10d')](db['CmHopperHistory'],{'as':_0x613f('0x1e5'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0xef')]['hasMany'](db['ReportAgentPreview'],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0xef')][_0x613f('0x118')](db['VoiceQueue'],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x613f('0xef')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x11c')});db['VoicePrefix'][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':_0x613f('0x1e6'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x127')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x128')});db[_0x613f('0x127')][_0x613f('0x118')](db['Team'],{'through':_0x613f('0x1cc'),'as':_0x613f('0x14d')});db['UserProfile']['hasMany'](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'foreignKey':_0x613f('0x1e7')});db[_0x613f('0xf1')]['hasMany'](db[_0x613f('0xf3')],{'as':_0x613f('0x1e8'),'foreignKey':_0x613f('0x1e7'),'onDelete':'cascade'});db[_0x613f('0xf3')][_0x613f('0x10d')](db[_0x613f('0xf5')],{'as':'Resources','foreignKey':_0x613f('0x1e9'),'onDelete':'cascade'});db['WhatsappAccount'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x1ea'),'onDelete':_0x613f('0x10c')});db[_0x613f('0xf8')]['hasMany'](db[_0x613f('0x72')],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x1ea')});db[_0x613f('0xf8')]['hasMany'](db[_0x613f('0xfe')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x613f('0xf8')][_0x613f('0x10d')](db['WhatsappInteraction'],{'as':_0x613f('0x15c')});db['WhatsappAccount'][_0x613f('0x10d')](db[_0x613f('0xfa')],{'as':_0x613f('0x13f')});db[_0x613f('0xf8')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':'ListId'});db[_0x613f('0xf8')][_0x613f('0x117')](db['Pause'],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount']['belongsToMany'](db['User'],{'as':'Agents','through':_0x613f('0x138')});db[_0x613f('0xfa')]['belongsTo'](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0x102')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0xf8')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':'IntervalId'});db[_0x613f('0xfa')]['belongsTo'](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db['WhatsappInteraction'][_0x613f('0x10d')](db[_0x613f('0xfe')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':'WhatsappInteractionId'});db[_0x613f('0xfc')][_0x613f('0x117')](db[_0x613f('0xf8')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1ea')});db[_0x613f('0xfc')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x1a7'),'as':_0x613f('0x165')});db['WhatsappInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x1a7'),'as':'ThroughTags'});db[_0x613f('0xfc')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':_0x613f('0x125'),'foreignKey':_0x613f('0x1eb')});db[_0x613f('0xfe')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db[_0x613f('0xfe')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':_0x613f('0x162')});db[_0x613f('0xfe')][_0x613f('0x117')](db['WhatsappInteraction'],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x169'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x613f('0x117')](db['WhatsappAccount'],{'as':_0x613f('0x173'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xf8')],{});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['WhatsappQueueReport']['belongsTo'](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xfc')],{});db[_0x613f('0xff')]['belongsTo'](db[_0x613f('0x102')],{});db[_0x613f('0xff')]['belongsTo'](db['WhatsappMessage'],{});db[_0x613f('0xff')][_0x613f('0x117')](db['User'],{});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0xfe')],{});db[_0x613f('0x1ec')]['belongsTo'](db[_0x613f('0xfc')],{});db['WhatsappTransferReport'][_0x613f('0x117')](db[_0x613f('0xf8')],{'foreignKey':'FromWhatsappAccountId','as':_0x613f('0x1d1')});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0xf8')],{'foreignKey':'ToWhatsappAccountId','as':_0x613f('0x1d8')});db['WhatsappTransferReport'][_0x613f('0x117')](db[_0x613f('0x102')],{'foreignKey':'ToQueueId','as':_0x613f('0x1d6')});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x613f('0x1ec')]['belongsTo'](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db[_0x613f('0x102')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x32'),'foreignKey':_0x613f('0x1ed')});db[_0x613f('0x102')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x1ca'),'as':_0x613f('0x14d')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5ac33d1..a036273 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda33=['./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/teams','/api/license','./api/license','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','join','root','/apidoc','/www','/demo','/snippet','static','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','lastName','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerSecret','membername','calleridname','exten','privateKey','accesskeyid','key','pass','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','includes','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','./safe-template','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','role','inspect','%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)','responseTime','other','agent_id','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount'];(function(_0x5430db,_0x44a639){var _0x16b5fd=function(_0x4164b0){while(--_0x4164b0){_0x5430db['push'](_0x5430db['shift']());}};_0x16b5fd(++_0x44a639);}(_0xda33,0x1d4));var _0x3da3=function(_0x3943fa,_0x3a46d6){_0x3943fa=_0x3943fa-0x0;var _0x15f5e9=_0xda33[_0x3943fa];return _0x15f5e9;};'use strict';var _=require('lodash');var path=require(_0x3da3('0x0'));var express=require(_0x3da3('0x1'));var ewinston=require(_0x3da3('0x2'));var util=require(_0x3da3('0x3'));var errors=require(_0x3da3('0x4'));var config=require(_0x3da3('0x5'));var logger=require(_0x3da3('0x6'))(_0x3da3('0x7'));var authLogger=require(_0x3da3('0x6'))('auth');var safeTemplate=require(_0x3da3('0x8'))['safeTemplate'];exports['default']=function(_0x34bd10){_0x34bd10[_0x3da3('0x9')](ewinston[_0x3da3('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5a30a9,_0x4ef3b7){var _0x104cee=_0x3da3('0xb');if(!_['isEmpty'](_0x5a30a9[_0x3da3('0xc')])){_0x104cee+=_0x3da3('0xd');var _0x3e26e6=_0x5a30a9[_0x3da3('0xc')];maskSensitiveData(_0x3e26e6);}return safeTemplate(util[_0x3da3('0xe')](_0x104cee,_0x5a30a9[_0x3da3('0xf')],_0x5a30a9[_0x3da3('0x10')][_0x3da3('0x11')]?_0x5a30a9[_0x3da3('0x10')][_0x3da3('0x11')]:_0x5a30a9[_0x3da3('0x12')][_0x3da3('0x13')]||_0x5a30a9['ip'],_0x5a30a9[_0x3da3('0x14')],_0x4ef3b7[_0x3da3('0x15')],_0x4ef3b7['responseTime'],_0x5a30a9[_0x3da3('0x16')]?_0x5a30a9['user']['id']:null,_0x5a30a9[_0x3da3('0x16')]?_0x5a30a9[_0x3da3('0x16')][_0x3da3('0x17')]:null,_0x5a30a9[_0x3da3('0x16')]?_0x5a30a9['user'][_0x3da3('0x18')]:null,_0x3e26e6?util[_0x3da3('0x19')](_0x3e26e6,![],null):''));}}));_0x34bd10[_0x3da3('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1beb05,_0x159927){var _0x6ae074=_0x3da3('0x1a');if(_0x1beb05[_0x3da3('0xc')]&&_0x1beb05['body'][_0x3da3('0x1b')]&&_0x1beb05[_0x3da3('0xc')]['agent_id']){_0x6ae074=_0x3da3('0x1c');}return util[_0x3da3('0xe')](_0x6ae074,_0x1beb05['method'],_0x1beb05[_0x3da3('0x10')][_0x3da3('0x11')]?_0x1beb05[_0x3da3('0x10')][_0x3da3('0x11')]:_0x1beb05[_0x3da3('0x12')]['remoteAddress']||_0x1beb05['ip'],_0x1beb05[_0x3da3('0x14')],_0x159927[_0x3da3('0x15')],_0x159927[_0x3da3('0x1d')],_0x1beb05[_0x3da3('0x16')]?_0x1beb05['user']['id']:null,_0x1beb05[_0x3da3('0x16')]?_0x1beb05['user'][_0x3da3('0x17')]:null,_0x1beb05[_0x3da3('0x16')]?_0x1beb05[_0x3da3('0x16')][_0x3da3('0x18')]:null,_0x1beb05['body']&&_0x1beb05['body'][_0x3da3('0x1b')]?_0x1beb05[_0x3da3('0xc')][_0x3da3('0x1b')]:_0x3da3('0x1e'),_0x1beb05['body']&&_0x1beb05[_0x3da3('0xc')][_0x3da3('0x1f')]?_0x1beb05[_0x3da3('0xc')][_0x3da3('0x1f')]:'',_0x1beb05['body']&&_0x1beb05[_0x3da3('0xc')][_0x3da3('0x20')]?_0x1beb05[_0x3da3('0xc')][_0x3da3('0x20')]:'');},'ignoreRoute':function(_0x4d716f){var _0x4cf64d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4cf64d[_0x3da3('0x21')](_0x4d716f['url']);}}));_0x34bd10[_0x3da3('0x9')]('/api/users',require(_0x3da3('0x22')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x23'),require(_0x3da3('0x24')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x25'),require(_0x3da3('0x26')));_0x34bd10['use'](_0x3da3('0x27'),require(_0x3da3('0x28')));_0x34bd10[_0x3da3('0x9')]('/api/voice/mohs',require(_0x3da3('0x29')));_0x34bd10['use'](_0x3da3('0x2a'),require('./api/voiceQueue'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x2b'),require(_0x3da3('0x2c')));_0x34bd10[_0x3da3('0x9')]('/api/screen/recordings',require(_0x3da3('0x2d')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x2e'),require(_0x3da3('0x2f')));_0x34bd10[_0x3da3('0x9')]('/api/voice/mails/messages',require(_0x3da3('0x30')));_0x34bd10['use'](_0x3da3('0x31'),require(_0x3da3('0x32')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x33'),require(_0x3da3('0x34')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x35'),require('./api/voiceAgentReport'));_0x34bd10['use']('/api/voice/queues/reports',require(_0x3da3('0x36')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x37'),require(_0x3da3('0x38')));_0x34bd10['use'](_0x3da3('0x39'),require(_0x3da3('0x3a')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x3b'),require(_0x3da3('0x3c')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x3d'),require(_0x3da3('0x3e')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x3f'),require(_0x3da3('0x40')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x41'),require(_0x3da3('0x42')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x43'),require(_0x3da3('0x44')));_0x34bd10['use'](_0x3da3('0x45'),require(_0x3da3('0x46')));_0x34bd10['use'](_0x3da3('0x47'),require('./api/mailMessage'));_0x34bd10[_0x3da3('0x9')]('/api/mail/applications',require(_0x3da3('0x48')));_0x34bd10['use']('/api/mail/reports/queue',require(_0x3da3('0x49')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x4a'),require('./api/dashboard'));_0x34bd10['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x4b'),require(_0x3da3('0x4c')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x4d'),require(_0x3da3('0x4e')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x4f'),require(_0x3da3('0x50')));_0x34bd10[_0x3da3('0x9')]('/api/fax/messages',require(_0x3da3('0x51')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x52'),require(_0x3da3('0x53')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x54'),require(_0x3da3('0x55')));_0x34bd10['use'](_0x3da3('0x56'),require(_0x3da3('0x57')));_0x34bd10[_0x3da3('0x9')]('/api/sms/applications',require('./api/smsApplication'));_0x34bd10['use'](_0x3da3('0x58'),require('./api/smsInteraction'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x59'),require('./api/smsMessage'));_0x34bd10['use']('/api/sms/queues',require(_0x3da3('0x5a')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x5b'),require('./api/openchannelAccount'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x5c'),require(_0x3da3('0x5d')));_0x34bd10['use'](_0x3da3('0x5e'),require('./api/openchannelInteraction'));_0x34bd10['use'](_0x3da3('0x5f'),require(_0x3da3('0x60')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x61'),require(_0x3da3('0x62')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x63'),require(_0x3da3('0x64')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x65'),require('./api/openchannelQueueReport'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x66'),require('./api/chatApplication'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x67'),require('./api/chatInteraction'));_0x34bd10['use'](_0x3da3('0x68'),require(_0x3da3('0x69')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x6a'),require(_0x3da3('0x6b')));_0x34bd10['use']('/api/chat/queues',require(_0x3da3('0x6c')));_0x34bd10['use'](_0x3da3('0x6d'),require(_0x3da3('0x6e')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x6f'),require('./api/chatProactiveAction'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x70'),require(_0x3da3('0x71')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x72'),require(_0x3da3('0x73')));_0x34bd10[_0x3da3('0x9')]('/api/cm/hopper',require(_0x3da3('0x74')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x75'),require(_0x3da3('0x76')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x77'),require('./api/cmHopperFinal'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x78'),require(_0x3da3('0x79')));_0x34bd10[_0x3da3('0x9')]('/api/cm/custom_fields',require(_0x3da3('0x7a')));_0x34bd10['use'](_0x3da3('0x7b'),require(_0x3da3('0x7c')));_0x34bd10[_0x3da3('0x9')]('/api/automations',require(_0x3da3('0x7d')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x7e'),require(_0x3da3('0x7f')));_0x34bd10[_0x3da3('0x9')]('/api/dispositions',require('./api/disposition'));_0x34bd10['use'](_0x3da3('0x80'),require(_0x3da3('0x81')));_0x34bd10[_0x3da3('0x9')]('/api/intervals',require(_0x3da3('0x82')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x83'),require(_0x3da3('0x84')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x85'),require(_0x3da3('0x86')));_0x34bd10['use'](_0x3da3('0x87'),require(_0x3da3('0x88')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x89'),require('./api/schedule'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x8a'),require(_0x3da3('0x8b')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x8c'),require(_0x3da3('0x8d')));_0x34bd10['use'](_0x3da3('0x8e'),require(_0x3da3('0x8f')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x90'),require('./api/trigger'));_0x34bd10['use'](_0x3da3('0x91'),require(_0x3da3('0x92')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x93'),require(_0x3da3('0x94')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x95'),require(_0x3da3('0x96')));_0x34bd10[_0x3da3('0x9')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x97'),require(_0x3da3('0x98')));_0x34bd10['use'](_0x3da3('0x99'),require(_0x3da3('0x9a')));_0x34bd10[_0x3da3('0x9')]('/api/analytics/metrics',require(_0x3da3('0x9b')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x9c'),require('./api/analyticFieldReport'));_0x34bd10['use'](_0x3da3('0x9d'),require(_0x3da3('0x9e')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x9f'),require(_0x3da3('0xa0')));_0x34bd10['use'](_0x3da3('0xa1'),require(_0x3da3('0xa2')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/salesforce/fields',require(_0x3da3('0xa3')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xa4'),require('./api/intSugarcrmAccount'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xa5'),require(_0x3da3('0xa6')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xa7'),require(_0x3da3('0xa8')));_0x34bd10['use'](_0x3da3('0xa9'),require(_0x3da3('0xaa')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xab'),require('./api/intDeskConfiguration'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xac'),require('./api/intDeskField'));_0x34bd10[_0x3da3('0x9')]('/api/integrations/zoho/accounts',require(_0x3da3('0xad')));_0x34bd10['use'](_0x3da3('0xae'),require(_0x3da3('0xaf')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb0'),require(_0x3da3('0xb1')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb2'),require('./api/intZendeskAccount'));_0x34bd10[_0x3da3('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb3'),require(_0x3da3('0xb4')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb5'),require('./api/intFreshdeskConfiguration'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb6'),require(_0x3da3('0xb7')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb8'),require('./api/intVtigerAccount'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xb9'),require(_0x3da3('0xba')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xbb'),require(_0x3da3('0xbc')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/servicenow/accounts',require(_0x3da3('0xbd')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/servicenow/configurations',require(_0x3da3('0xbe')));_0x34bd10['use']('/api/integrations/servicenow/fields',require(_0x3da3('0xbf')));_0x34bd10['use'](_0x3da3('0xc0'),require(_0x3da3('0xc1')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/dynamics365/configurations',require(_0x3da3('0xc2')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/dynamics365/fields',require(_0x3da3('0xc3')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xc4'),require(_0x3da3('0xc5')));_0x34bd10['use'](_0x3da3('0xc6'),require(_0x3da3('0xc7')));_0x34bd10[_0x3da3('0x9')]('/api/integrations/freshsales/fields',require(_0x3da3('0xc8')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xc9'),require('./api/network'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xca'),require(_0x3da3('0xcb')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xcc'),require('./api/chatInternalMessage'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xcd'),require(_0x3da3('0xce')));_0x34bd10[_0x3da3('0x9')]('/api/jscripty/questions/reports',require(_0x3da3('0xcf')));_0x34bd10[_0x3da3('0x9')]('/api/jscripty/sessions/reports',require(_0x3da3('0xd0')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xd1'),require(_0x3da3('0xd2')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xd3'),require(_0x3da3('0xd4')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xd5'),require(_0x3da3('0xd6')));_0x34bd10['use'](_0x3da3('0xd7'),require('./api/jscriptyProject'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xd8'),require(_0x3da3('0xd9')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xda'),require(_0x3da3('0xdb')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xdc'),require(_0x3da3('0xdd')));_0x34bd10[_0x3da3('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x34bd10[_0x3da3('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xde'),require('./api/team'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xdf'),require(_0x3da3('0xe0')));_0x34bd10[_0x3da3('0x9')]('/api/campaigns',require('./api/campaign'));_0x34bd10['use'](_0x3da3('0xe1'),require('./api/migration'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xe2'),require(_0x3da3('0xe3')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xe4'),require(_0x3da3('0xe5')));_0x34bd10['use'](_0x3da3('0xe6'),require(_0x3da3('0xe7')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xe8'),require(_0x3da3('0xe9')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xea'),require('./api/faxTransferReport'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xeb'),require(_0x3da3('0xec')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xed'),require(_0x3da3('0xee')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xef'),require('./api/cmList'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xf0'),require('./api/voicePrefix'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xf1'),require(_0x3da3('0xf2')));_0x34bd10[_0x3da3('0x9')]('/api/userProfile/sections',require(_0x3da3('0xf3')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xf4'),require(_0x3da3('0xf5')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xf6'),require(_0x3da3('0xf7')));_0x34bd10[_0x3da3('0x9')]('/api/whatsapp/accounts',require(_0x3da3('0xf8')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xf9'),require(_0x3da3('0xfa')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xfb'),require('./api/whatsappInteraction'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xfc'),require('./api/whatsappMessage'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0xfd'),require(_0x3da3('0xfe')));_0x34bd10[_0x3da3('0x9')]('/api/whatsapp/reports/transfer',require(_0x3da3('0xff')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x100'),require(_0x3da3('0x101')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x102'),require(_0x3da3('0x103')));_0x34bd10['use']('/api/realtime',require('./api/realtime'));_0x34bd10['use'](_0x3da3('0x104'),require(_0x3da3('0x105')));_0x34bd10['use'](_0x3da3('0x106'),require(_0x3da3('0x107')));_0x34bd10['use']('/api/auth/activedirectory',require(_0x3da3('0x108')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x109'),require(_0x3da3('0x10a')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x10b'),require(_0x3da3('0x10c')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x10d'),require('./api/version'));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x10e'),require(_0x3da3('0x10f')));_0x34bd10['use'](_0x3da3('0x110'),require(_0x3da3('0x111')));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x112'),require('./api/webbar'));_0x34bd10[_0x3da3('0x9')]('/apidoc',express['static'](path[_0x3da3('0x113')](config[_0x3da3('0x114')],_0x3da3('0x115'))));_0x34bd10['use'](_0x3da3('0x116'),express['static'](path[_0x3da3('0x113')](config[_0x3da3('0x114')],_0x3da3('0x116'))));_0x34bd10['use'](_0x3da3('0x117'),express['static'](path[_0x3da3('0x113')](config[_0x3da3('0x114')],_0x3da3('0x117'))));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x118'),express[_0x3da3('0x119')](path[_0x3da3('0x113')](config[_0x3da3('0x114')],_0x3da3('0x11a'),_0x3da3('0x11b'))));_0x34bd10[_0x3da3('0x9')](_0x3da3('0x11c'),express[_0x3da3('0x119')](path[_0x3da3('0x113')](config[_0x3da3('0x114')],_0x3da3('0x11d'))));_0x34bd10['route'](_0x3da3('0x11e'))[_0x3da3('0x11f')](errors[0x194]);_0x34bd10['route']('/*')['get'](function(_0x4cc377,_0x13d6a8){_0x13d6a8[_0x3da3('0x120')](path[_0x3da3('0x121')](_0x34bd10[_0x3da3('0x11f')](_0x3da3('0x122'))+_0x3da3('0x123')));});};var sensitiveFields=[_0x3da3('0x124'),_0x3da3('0x125'),_0x3da3('0x126'),_0x3da3('0x127'),'firstName',_0x3da3('0x128'),'street',_0x3da3('0x129'),_0x3da3('0x12a'),_0x3da3('0x12b'),'email',_0x3da3('0x12c'),_0x3da3('0x12d'),_0x3da3('0x12e'),_0x3da3('0x12f'),_0x3da3('0x130'),_0x3da3('0x131'),_0x3da3('0x132'),_0x3da3('0x133'),'accessToken',_0x3da3('0x134'),_0x3da3('0x135'),'consumerKey',_0x3da3('0x136'),_0x3da3('0x137'),_0x3da3('0x138'),'calleridnum',_0x3da3('0x139'),'vidaooApiKey','clientEmail',_0x3da3('0x13a'),_0x3da3('0x13b'),'secretaccesskey',_0x3da3('0x13c'),'user',_0x3da3('0x13d'),'accountSid',_0x3da3('0x13e'),_0x3da3('0x13f'),_0x3da3('0x140'),'registry',_0x3da3('0x141')];function maskSensitiveData(_0x3fa33b){var _0x20452f=/(?!^)[\s\S](?!$)/g;if(!_[_0x3da3('0x142')](_0x3fa33b))return;for(var _0x5b3eef in _0x3fa33b){if(_[_0x3da3('0x143')](_0x3fa33b[_0x5b3eef])){for(var _0x3cb48d=0x0;_0x3cb48d<_0x3fa33b[_0x5b3eef][_0x3da3('0x144')];_0x3cb48d++){maskSensitiveData(_0x3fa33b[_0x5b3eef][_0x3cb48d]);}}else if(_[_0x3da3('0x142')](_0x3fa33b[_0x5b3eef])){maskSensitiveData(_0x3fa33b[_0x5b3eef]);}else if(_[_0x3da3('0x145')](_0x3fa33b[_0x5b3eef])){_0x3fa33b[_0x5b3eef]=_0x3fa33b[_0x5b3eef]['replace'](/{{{/g,_0x3da3('0x146'))[_0x3da3('0x147')](/}}}/g,'}@@')[_0x3da3('0x147')](/{{/g,'@{')[_0x3da3('0x147')](/}}/g,'}@');if(_[_0x3da3('0x148')](sensitiveFields,_0x5b3eef)){_0x3fa33b[_0x5b3eef]=_0x3fa33b[_0x5b3eef][_0x3da3('0x147')](_0x20452f,'*');}}}} \ No newline at end of file +var _0xfcf8=['/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','./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/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','fax','email','clientSecret','securityToken','code','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','secretaccesskey','key','pass','localstationid','dsn','registry','isArray','length','isString','replace','}@@','lodash','path','express','express-winston','util','./errors','./config/logger','api','./safe-template','default','use','logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','url','statusCode','agent_name','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/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/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField'];(function(_0x1b1dc7,_0x1483b8){var _0x20ef6f=function(_0x4e1623){while(--_0x4e1623){_0x1b1dc7['push'](_0x1b1dc7['shift']());}};_0x20ef6f(++_0x1483b8);}(_0xfcf8,0x8f));var _0x8fcf=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfcf8[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x8fcf('0x0'));var path=require(_0x8fcf('0x1'));var express=require(_0x8fcf('0x2'));var ewinston=require(_0x8fcf('0x3'));var util=require(_0x8fcf('0x4'));var errors=require(_0x8fcf('0x5'));var config=require('./config/environment');var logger=require(_0x8fcf('0x6'))(_0x8fcf('0x7'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0x8fcf('0x8'))['safeTemplate'];exports[_0x8fcf('0x9')]=function(_0x2f6db6){_0x2f6db6[_0x8fcf('0xa')](ewinston[_0x8fcf('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3d2bdb,_0x596ff9){var _0x35b9ed='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x8fcf('0xc')](_0x3d2bdb[_0x8fcf('0xd')])){_0x35b9ed+=_0x8fcf('0xe');var _0x403bc6=_0x3d2bdb['body'];maskSensitiveData(_0x403bc6);}return safeTemplate(util[_0x8fcf('0xf')](_0x35b9ed,_0x3d2bdb[_0x8fcf('0x10')],_0x3d2bdb['headers'][_0x8fcf('0x11')]?_0x3d2bdb['headers'][_0x8fcf('0x11')]:_0x3d2bdb[_0x8fcf('0x12')][_0x8fcf('0x13')]||_0x3d2bdb['ip'],_0x3d2bdb['url'],_0x596ff9['statusCode'],_0x596ff9[_0x8fcf('0x14')],_0x3d2bdb[_0x8fcf('0x15')]?_0x3d2bdb[_0x8fcf('0x15')]['id']:null,_0x3d2bdb[_0x8fcf('0x15')]?_0x3d2bdb[_0x8fcf('0x15')][_0x8fcf('0x16')]:null,_0x3d2bdb[_0x8fcf('0x15')]?_0x3d2bdb[_0x8fcf('0x15')][_0x8fcf('0x17')]:null,_0x403bc6?util[_0x8fcf('0x18')](_0x403bc6,![],null):''));}}));_0x2f6db6[_0x8fcf('0xa')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x46b988,_0x392733){var _0x545c19='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x46b988['body']&&_0x46b988[_0x8fcf('0xd')][_0x8fcf('0x19')]&&_0x46b988[_0x8fcf('0xd')][_0x8fcf('0x1a')]){_0x545c19=_0x8fcf('0x1b');}return util['format'](_0x545c19,_0x46b988[_0x8fcf('0x10')],_0x46b988[_0x8fcf('0x1c')][_0x8fcf('0x11')]?_0x46b988[_0x8fcf('0x1c')][_0x8fcf('0x11')]:_0x46b988[_0x8fcf('0x12')][_0x8fcf('0x13')]||_0x46b988['ip'],_0x46b988[_0x8fcf('0x1d')],_0x392733[_0x8fcf('0x1e')],_0x392733[_0x8fcf('0x14')],_0x46b988[_0x8fcf('0x15')]?_0x46b988[_0x8fcf('0x15')]['id']:null,_0x46b988[_0x8fcf('0x15')]?_0x46b988[_0x8fcf('0x15')][_0x8fcf('0x16')]:null,_0x46b988['user']?_0x46b988[_0x8fcf('0x15')][_0x8fcf('0x17')]:null,_0x46b988['body']&&_0x46b988[_0x8fcf('0xd')]['device']?_0x46b988[_0x8fcf('0xd')]['device']:'other',_0x46b988[_0x8fcf('0xd')]&&_0x46b988[_0x8fcf('0xd')]['agent_id']?_0x46b988['body']['agent_id']:'',_0x46b988['body']&&_0x46b988['body'][_0x8fcf('0x1f')]?_0x46b988['body'][_0x8fcf('0x1f')]:'');},'ignoreRoute':function(_0x19f185){var _0x4a9b98=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a9b98['test'](_0x19f185[_0x8fcf('0x1d')]);}}));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x20'),require(_0x8fcf('0x21')));_0x2f6db6[_0x8fcf('0xa')]('/api/voice/chanspy',require(_0x8fcf('0x22')));_0x2f6db6['use'](_0x8fcf('0x23'),require('./api/voiceContext'));_0x2f6db6[_0x8fcf('0xa')]('/api/voice/extensions',require('./api/voiceExtension'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x24'),require('./api/voiceMusicOnHold'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x25'),require(_0x8fcf('0x26')));_0x2f6db6[_0x8fcf('0xa')]('/api/voice/recordings',require('./api/voiceRecording'));_0x2f6db6[_0x8fcf('0xa')]('/api/screen/recordings',require(_0x8fcf('0x27')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x28'),require(_0x8fcf('0x29')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x2a'),require('./api/voiceMailMessage'));_0x2f6db6[_0x8fcf('0xa')]('/api/voice/calls/reports',require(_0x8fcf('0x2b')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x2c'),require('./api/voiceDialReport'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x2d'),require(_0x8fcf('0x2e')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x2f'),require(_0x8fcf('0x30')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x31'),require('./api/memberReport'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x32'),require(_0x8fcf('0x33')));_0x2f6db6['use'](_0x8fcf('0x34'),require(_0x8fcf('0x35')));_0x2f6db6['use'](_0x8fcf('0x36'),require('./api/mailServerOut'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x37'),require(_0x8fcf('0x38')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x39'),require('./api/mailQueue'));_0x2f6db6[_0x8fcf('0xa')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x2f6db6[_0x8fcf('0xa')]('/api/mail/interactions',require(_0x8fcf('0x3a')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x3b'),require('./api/mailMessage'));_0x2f6db6[_0x8fcf('0xa')]('/api/mail/applications',require(_0x8fcf('0x3c')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x3d'),require(_0x8fcf('0x3e')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x3f'),require(_0x8fcf('0x40')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x41'),require(_0x8fcf('0x42')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x43'),require(_0x8fcf('0x44')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x45'),require(_0x8fcf('0x46')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x47'),require(_0x8fcf('0x48')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x49'),require(_0x8fcf('0x4a')));_0x2f6db6['use']('/api/fax/queues',require('./api/faxQueue'));_0x2f6db6[_0x8fcf('0xa')]('/api/fax/reports/queue',require(_0x8fcf('0x4b')));_0x2f6db6['use'](_0x8fcf('0x4c'),require(_0x8fcf('0x4d')));_0x2f6db6[_0x8fcf('0xa')]('/api/sms/applications',require(_0x8fcf('0x4e')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x4f'),require(_0x8fcf('0x50')));_0x2f6db6['use']('/api/sms/messages',require(_0x8fcf('0x51')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x52'),require(_0x8fcf('0x53')));_0x2f6db6[_0x8fcf('0xa')]('/api/openchannel/accounts',require(_0x8fcf('0x54')));_0x2f6db6[_0x8fcf('0xa')]('/api/openchannel/applications',require(_0x8fcf('0x55')));_0x2f6db6[_0x8fcf('0xa')]('/api/openchannel/interactions',require(_0x8fcf('0x56')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x57'),require(_0x8fcf('0x58')));_0x2f6db6['use'](_0x8fcf('0x59'),require(_0x8fcf('0x5a')));_0x2f6db6['use'](_0x8fcf('0x5b'),require(_0x8fcf('0x5c')));_0x2f6db6[_0x8fcf('0xa')]('/api/openchannel/reports/queue',require(_0x8fcf('0x5d')));_0x2f6db6[_0x8fcf('0xa')]('/api/chat/applications',require(_0x8fcf('0x5e')));_0x2f6db6['use'](_0x8fcf('0x5f'),require(_0x8fcf('0x60')));_0x2f6db6['use'](_0x8fcf('0x61'),require(_0x8fcf('0x62')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x63'),require(_0x8fcf('0x64')));_0x2f6db6[_0x8fcf('0xa')]('/api/chat/queues',require(_0x8fcf('0x65')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x66'),require(_0x8fcf('0x67')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x68'),require(_0x8fcf('0x69')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x6a'),require(_0x8fcf('0x6b')));_0x2f6db6['use'](_0x8fcf('0x6c'),require('./api/cmContact'));_0x2f6db6[_0x8fcf('0xa')]('/api/cm/hopper',require(_0x8fcf('0x6d')));_0x2f6db6['use'](_0x8fcf('0x6e'),require(_0x8fcf('0x6f')));_0x2f6db6[_0x8fcf('0xa')]('/api/cm/hopper_final',require(_0x8fcf('0x70')));_0x2f6db6['use'](_0x8fcf('0x71'),require(_0x8fcf('0x72')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x73'),require(_0x8fcf('0x74')));_0x2f6db6['use']('/api/actions',require('./api/action'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x75'),require(_0x8fcf('0x76')));_0x2f6db6['use'](_0x8fcf('0x77'),require(_0x8fcf('0x78')));_0x2f6db6[_0x8fcf('0xa')]('/api/dispositions',require('./api/disposition'));_0x2f6db6['use'](_0x8fcf('0x79'),require(_0x8fcf('0x7a')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x7b'),require('./api/interval'));_0x2f6db6['use'](_0x8fcf('0x7c'),require(_0x8fcf('0x7d')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x7e'),require(_0x8fcf('0x7f')));_0x2f6db6[_0x8fcf('0xa')]('/api/voiceQueuesLog',require(_0x8fcf('0x80')));_0x2f6db6[_0x8fcf('0xa')]('/api/schedules',require('./api/schedule'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x81'),require(_0x8fcf('0x82')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x83'),require('./api/tag'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x84'),require(_0x8fcf('0x85')));_0x2f6db6[_0x8fcf('0xa')]('/api/triggers',require(_0x8fcf('0x86')));_0x2f6db6['use'](_0x8fcf('0x87'),require('./api/variable'));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations',require(_0x8fcf('0x88')));_0x2f6db6['use'](_0x8fcf('0x89'),require(_0x8fcf('0x8a')));_0x2f6db6['use']('/api/analytics/custom_reports',require(_0x8fcf('0x8b')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x8c'),require(_0x8fcf('0x8d')));_0x2f6db6[_0x8fcf('0xa')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x8e'),require(_0x8fcf('0x8f')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x90'),require(_0x8fcf('0x91')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x92'),require('./api/analyticTreeReport'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x93'),require(_0x8fcf('0x94')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x95'),require(_0x8fcf('0x96')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x97'),require(_0x8fcf('0x98')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x99'),require(_0x8fcf('0x9a')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x9b'),require(_0x8fcf('0x9c')));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations/sugarcrm/fields',require(_0x8fcf('0x9d')));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations/desk/accounts',require(_0x8fcf('0x9e')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x9f'),require(_0x8fcf('0xa0')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xa1'),require('./api/intDeskField'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xa2'),require('./api/intZohoAccount'));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations/zoho/configurations',require(_0x8fcf('0xa3')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xa4'),require(_0x8fcf('0xa5')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xa6'),require('./api/intZendeskAccount'));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations/zendesk/configurations',require(_0x8fcf('0xa7')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xa8'),require(_0x8fcf('0xa9')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xaa'),require('./api/intFreshdeskAccount'));_0x2f6db6['use'](_0x8fcf('0xab'),require('./api/intFreshdeskConfiguration'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xac'),require(_0x8fcf('0xad')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xae'),require('./api/intVtigerAccount'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xaf'),require('./api/intVtigerConfiguration'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xb0'),require(_0x8fcf('0xb1')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xb2'),require('./api/intServicenowAccount'));_0x2f6db6['use'](_0x8fcf('0xb3'),require('./api/intServicenowConfiguration'));_0x2f6db6[_0x8fcf('0xa')]('/api/integrations/servicenow/fields',require(_0x8fcf('0xb4')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xb5'),require('./api/intDynamics365Account'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xb6'),require(_0x8fcf('0xb7')));_0x2f6db6['use'](_0x8fcf('0xb8'),require('./api/intDynamics365Field'));_0x2f6db6['use'](_0x8fcf('0xb9'),require(_0x8fcf('0xba')));_0x2f6db6['use']('/api/integrations/freshsales/configurations',require(_0x8fcf('0xbb')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xbc'),require(_0x8fcf('0xbd')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xbe'),require(_0x8fcf('0xbf')));_0x2f6db6['use']('/api/chat/reports/queue',require(_0x8fcf('0xc0')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xc1'),require('./api/chatInternalMessage'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xc2'),require(_0x8fcf('0xc3')));_0x2f6db6['use'](_0x8fcf('0xc4'),require(_0x8fcf('0xc5')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xc6'),require(_0x8fcf('0xc7')));_0x2f6db6['use'](_0x8fcf('0xc8'),require(_0x8fcf('0xc9')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xca'),require(_0x8fcf('0xcb')));_0x2f6db6[_0x8fcf('0xa')]('/api/square/details/reports',require(_0x8fcf('0xcc')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xcd'),require(_0x8fcf('0xce')));_0x2f6db6[_0x8fcf('0xa')]('/api/settings',require(_0x8fcf('0xcf')));_0x2f6db6[_0x8fcf('0xa')]('/api/square/odbc',require(_0x8fcf('0xd0')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xd1'),require(_0x8fcf('0xd2')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xd3'),require(_0x8fcf('0xd4')));_0x2f6db6[_0x8fcf('0xa')]('/api/square/messages',require(_0x8fcf('0xd5')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xd6'),require(_0x8fcf('0xd7')));_0x2f6db6['use'](_0x8fcf('0xd8'),require(_0x8fcf('0xd9')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xda'),require(_0x8fcf('0xdb')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xdc'),require('./api/migration'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xdd'),require(_0x8fcf('0xde')));_0x2f6db6['use']('/api/plugins',require(_0x8fcf('0xdf')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xe0'),require(_0x8fcf('0xe1')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xe2'),require(_0x8fcf('0xe3')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xe4'),require(_0x8fcf('0xe5')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xe6'),require(_0x8fcf('0xe7')));_0x2f6db6['use']('/api/sms/reports/transfer',require(_0x8fcf('0xe8')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xe9'),require('./api/cmList'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xea'),require(_0x8fcf('0xeb')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xec'),require('./api/userProfile'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xed'),require('./api/userProfileSection'));_0x2f6db6['use'](_0x8fcf('0xee'),require(_0x8fcf('0xef')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xf0'),require(_0x8fcf('0xf1')));_0x2f6db6[_0x8fcf('0xa')]('/api/whatsapp/accounts',require(_0x8fcf('0xf2')));_0x2f6db6[_0x8fcf('0xa')]('/api/whatsapp/applications',require(_0x8fcf('0xf3')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xf4'),require(_0x8fcf('0xf5')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xf6'),require('./api/whatsappMessage'));_0x2f6db6['use'](_0x8fcf('0xf7'),require(_0x8fcf('0xf8')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xf9'),require(_0x8fcf('0xfa')));_0x2f6db6['use'](_0x8fcf('0xfb'),require(_0x8fcf('0xfc')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xfd'),require(_0x8fcf('0xfe')));_0x2f6db6[_0x8fcf('0xa')]('/api/realtime',require('./api/realtime'));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0xff'),require(_0x8fcf('0x100')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x101'),require(_0x8fcf('0x102')));_0x2f6db6[_0x8fcf('0xa')]('/api/auth/activedirectory',require(_0x8fcf('0x103')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x104'),require(_0x8fcf('0x105')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x106'),require(_0x8fcf('0x107')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x108'),require(_0x8fcf('0x109')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x10a'),require(_0x8fcf('0x10b')));_0x2f6db6['use'](_0x8fcf('0x10c'),require(_0x8fcf('0x10d')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x10e'),require(_0x8fcf('0x10f')));_0x2f6db6[_0x8fcf('0xa')](_0x8fcf('0x110'),express[_0x8fcf('0x111')](path[_0x8fcf('0x112')](config[_0x8fcf('0x113')],'/apidoc')));_0x2f6db6['use'](_0x8fcf('0x114'),express[_0x8fcf('0x111')](path[_0x8fcf('0x112')](config[_0x8fcf('0x113')],_0x8fcf('0x114'))));_0x2f6db6['use'](_0x8fcf('0x115'),express['static'](path[_0x8fcf('0x112')](config[_0x8fcf('0x113')],'/demo')));_0x2f6db6[_0x8fcf('0xa')]('/snippet',express[_0x8fcf('0x111')](path[_0x8fcf('0x112')](config[_0x8fcf('0x113')],_0x8fcf('0x116'),_0x8fcf('0x117'))));_0x2f6db6['use'](_0x8fcf('0x118'),express[_0x8fcf('0x111')](path[_0x8fcf('0x112')](config['root'],_0x8fcf('0x119'))));_0x2f6db6[_0x8fcf('0x11a')](_0x8fcf('0x11b'))[_0x8fcf('0x11c')](errors[0x194]);_0x2f6db6[_0x8fcf('0x11a')]('/*')[_0x8fcf('0x11c')](function(_0x2916c2,_0x2c803f){_0x2c803f[_0x8fcf('0x11d')](path[_0x8fcf('0x11e')](_0x2f6db6['get']('appPath')+_0x8fcf('0x11f')));});};var sensitiveFields=[_0x8fcf('0x120'),_0x8fcf('0x121'),_0x8fcf('0x122'),_0x8fcf('0x123'),_0x8fcf('0x124'),_0x8fcf('0x125'),_0x8fcf('0x126'),_0x8fcf('0x127'),'mobile',_0x8fcf('0x128'),_0x8fcf('0x129'),'clientId',_0x8fcf('0x12a'),_0x8fcf('0x12b'),_0x8fcf('0x12c'),'accessKey','tenantId',_0x8fcf('0x12d'),_0x8fcf('0x12e'),_0x8fcf('0x12f'),_0x8fcf('0x130'),_0x8fcf('0x131'),_0x8fcf('0x132'),_0x8fcf('0x133'),_0x8fcf('0x134'),_0x8fcf('0x135'),'calleridnum',_0x8fcf('0x136'),_0x8fcf('0x137'),_0x8fcf('0x138'),'privateKey','accesskeyid',_0x8fcf('0x139'),_0x8fcf('0x13a'),_0x8fcf('0x15'),_0x8fcf('0x13b'),'accountSid',_0x8fcf('0x13c'),_0x8fcf('0x13d'),'secret',_0x8fcf('0x13e'),'oldPassword'];function maskSensitiveData(_0x407fe0){var _0x5b6b71=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x407fe0))return;for(var _0x1f5f05 in _0x407fe0){if(_[_0x8fcf('0x13f')](_0x407fe0[_0x1f5f05])){for(var _0x18e56e=0x0;_0x18e56e<_0x407fe0[_0x1f5f05][_0x8fcf('0x140')];_0x18e56e++){maskSensitiveData(_0x407fe0[_0x1f5f05][_0x18e56e]);}}else if(_['isPlainObject'](_0x407fe0[_0x1f5f05])){maskSensitiveData(_0x407fe0[_0x1f5f05]);}else if(_[_0x8fcf('0x141')](_0x407fe0[_0x1f5f05])){_0x407fe0[_0x1f5f05]=_0x407fe0[_0x1f5f05][_0x8fcf('0x142')](/{{{/g,'@@{')[_0x8fcf('0x142')](/}}}/g,_0x8fcf('0x143'))[_0x8fcf('0x142')](/{{/g,'@{')[_0x8fcf('0x142')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x1f5f05)){_0x407fe0[_0x1f5f05]=_0x407fe0[_0x1f5f05][_0x8fcf('0x142')](_0x5b6b71,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 57b9de5..075ffb0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d46=['../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.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/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6d46,0x122));var _0x66d4=function(_0x309ad8,_0x3365a0){_0x309ad8=_0x309ad8-0x0;var _0x3114d4=_0x6d46[_0x309ad8];return _0x3114d4;};'use strict';var jayson=require(_0x66d4('0x0'));var BPromise=require(_0x66d4('0x1'));var _=require(_0x66d4('0x2'));var config=require(_0x66d4('0x3'));exports[_0x66d4('0x4')]=function(){return new BPromise(function(_0x3e9cd4,_0x5e2fe2){var _0x5757c6={};_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/user/user.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/voiceExtension/voiceExtension.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x6')));_0x5757c6=_['merge'](_0x5757c6,require('../api/voiceRecording/voiceRecording.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x7')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x8')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x9')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/memberReport/memberReport.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/trunk/trunk.rpc'));_0x5757c6=_['merge'](_0x5757c6,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0xa')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0xb')));_0x5757c6=_['merge'](_0x5757c6,require('../api/mailAccount/mailAccount.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/mailQueue/mailQueue.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0xc')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/mailMessage/mailMessage.rpc'));_0x5757c6=_['merge'](_0x5757c6,require('../api/mailApplication/mailApplication.rpc'));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0xd')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0xe')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0xf')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/faxInteraction/faxInteraction.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/faxMessage/faxMessage.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x10')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x11')));_0x5757c6=_['merge'](_0x5757c6,require('../api/smsAccount/smsAccount.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x12')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x13')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x14')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x15')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x16')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x17')));_0x5757c6=_['merge'](_0x5757c6,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x18')));_0x5757c6=_['merge'](_0x5757c6,require('../api/chatInteraction/chatInteraction.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x19')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1a')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1b')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1c')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1d')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1e')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x1f')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x20')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x21')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x22')));_0x5757c6=_['merge'](_0x5757c6,require('../api/template/template.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x23')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x24')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x25')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x26')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x27')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x28')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x29')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x2a')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x2b')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x2c')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x2d')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x2e')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x2f')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x30')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x31')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x32')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x33')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x34')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x35')));_0x5757c6=_['merge'](_0x5757c6,require(_0x66d4('0x36')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x37')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x38')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require(_0x66d4('0x39')));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5757c6=_[_0x66d4('0x5')](_0x5757c6,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3c04f6=jayson[_0x66d4('0x3a')](_0x5757c6)[_0x66d4('0x3b')]();var _0x64a2e4=config[_0x66d4('0x3c')][_0x66d4('0x3d')]||config[_0x66d4('0x3d')]+0x1;var _0xa59cc8=config['rpc']['ip']||_0x66d4('0x3e');_0x3c04f6['on']('error',function(_0x2423e9){return _0x5e2fe2(_0x2423e9);});_0x3c04f6[_0x66d4('0x4')](_0x64a2e4,_0xa59cc8,function(){console['log'](_0x66d4('0x3f'),_0xa59cc8,_0x64a2e4);require(_0x66d4('0x40'))[_0x66d4('0x41')]();return _0x3e9cd4('RPC\x20listening\x20on\x20'+_0xa59cc8+':'+_0x64a2e4);});});}; \ No newline at end of file +var _0xe763=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x4ecd76,_0x79f1f3){var _0x240f34=function(_0x563f79){while(--_0x563f79){_0x4ecd76['push'](_0x4ecd76['shift']());}};_0x240f34(++_0x79f1f3);}(_0xe763,0x1a1));var _0x3e76=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xe763[_0x12833b];return _0x3acad3;};'use strict';var jayson=require(_0x3e76('0x0'));var BPromise=require(_0x3e76('0x1'));var _=require('lodash');var config=require(_0x3e76('0x2'));exports['listen']=function(){return new BPromise(function(_0x50f64c,_0x1f1ccd){var _0x5e6ec3={};_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x3')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/voiceExtension/voiceExtension.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x5')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x6')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x7')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x8')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x9')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0xa')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0xb')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/trunk/trunk.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0xc')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0xd')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0xe')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0xf')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x10')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/mailInteraction/mailInteraction.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x11')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/mailApplication/mailApplication.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x12')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/faxAccount/faxAccount.rpc'));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x13')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x14')));_0x5e6ec3=_['merge'](_0x5e6ec3,require('../api/faxMessage/faxMessage.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x15')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x16')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x17')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x18')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x19')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x1a')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x1b')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x1c')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x1d')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x1e')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x1f')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x20')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x21')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x22')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/cmHopper/cmHopper.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x23')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x24')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x25')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x26')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x27')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x28')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/sound/sound.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x29')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x2a')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/variable/variable.rpc'));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x2b')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x2c')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x2d')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x2e')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x2f')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x30')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x31')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x32')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x33')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x34')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x35')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x36')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x37')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/squareOdbc/squareOdbc.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require('../api/squareProject/squareProject.rpc'));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x38')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x39')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x3a')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x3b')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x3c')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x3d')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x3e')));_0x5e6ec3=_['merge'](_0x5e6ec3,require(_0x3e76('0x3f')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x40')));_0x5e6ec3=_[_0x3e76('0x4')](_0x5e6ec3,require(_0x3e76('0x41')));var _0x20fe3d=jayson[_0x3e76('0x42')](_0x5e6ec3)[_0x3e76('0x43')]();var _0x4e45f8=config[_0x3e76('0x44')][_0x3e76('0x45')]||config['port']+0x1;var _0x1c1c10=config[_0x3e76('0x44')]['ip']||'localhost';_0x20fe3d['on']('error',function(_0x38d0ec){return _0x1f1ccd(_0x38d0ec);});_0x20fe3d[_0x3e76('0x46')](_0x4e45f8,_0x1c1c10,function(){console[_0x3e76('0x47')](_0x3e76('0x48'),_0x1c1c10,_0x4e45f8);require(_0x3e76('0x49'))['default']();return _0x50f64c(_0x3e76('0x4a')+_0x1c1c10+':'+_0x4e45f8);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 6f83e06..614215c 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0xf2e701,_0x3e3f9b){var _0x42b2a8=function(_0x50b1e6){while(--_0x50b1e6){_0xf2e701['push'](_0xf2e701['shift']());}};_0x42b2a8(++_0x3e3f9b);}(_0xb688,0xcf));var _0x8b68=function(_0x58b2ee,_0x5b56c3){_0x58b2ee=_0x58b2ee-0x0;var _0x29606c=_0xb688[_0x58b2ee];return _0x29606c;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x39c8c5){return _0x39c8c5==='{{'?_0x8b68('0x0'):_0x8b68('0x1');}function safeTemplate(_0x1080e8){var _0x23bbaa=_0x1080e8;if(typeof _0x1080e8===_0x8b68('0x2')){_0x23bbaa=_0x1080e8['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8b68('0x3')](_0x1080e8)){_0x23bbaa=_0x1080e8[_0x8b68('0x4')](function(_0x30f33d){return safeTemplate(_0x30f33d);});}else if(_[_0x8b68('0x5')](_0x1080e8)){_0x23bbaa=Object['keys'](_0x1080e8)[_0x8b68('0x6')](function(_0x57ee56,_0x37677d){_0x57ee56[_0x37677d]=safeTemplate(_0x1080e8[_0x37677d]);return _0x57ee56;},{});}return _0x23bbaa;}module[_0x8b68('0x7')][_0x8b68('0x8')]=safeTemplate; \ No newline at end of file +var _0x087b=['exports','safeTemplate','lodash','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x24de57,_0x493553){var _0x3299d2=function(_0x346226){while(--_0x346226){_0x24de57['push'](_0x24de57['shift']());}};_0x3299d2(++_0x493553);}(_0x087b,0x11a));var _0xb087=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x087b[_0x432fca];return _0x3adba4;};var _=require(_0xb087('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x35e3d3){return _0x35e3d3==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x40e6d6){var _0x5aa7a8=_0x40e6d6;if(typeof _0x40e6d6===_0xb087('0x1')){_0x5aa7a8=_0x40e6d6[_0xb087('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xb087('0x3')](_0x40e6d6)){_0x5aa7a8=_0x40e6d6[_0xb087('0x4')](function(_0x183efd){return safeTemplate(_0x183efd);});}else if(_[_0xb087('0x5')](_0x40e6d6)){_0x5aa7a8=Object[_0xb087('0x6')](_0x40e6d6)[_0xb087('0x7')](function(_0xecf080,_0x36ac30){_0xecf080[_0x36ac30]=safeTemplate(_0x40e6d6[_0x36ac30]);return _0xecf080;},{});}return _0x5aa7a8;}module[_0xb087('0x8')][_0xb087('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0e3da25..3763202 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 _0x032f=['close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sendRequest','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','getVariable','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','function','substring','replace','result=','indexOf','substr','startsWith','split','length','match','E_AGI_SOCKET_ERROR','code'];(function(_0x165f67,_0x50724e){var _0x516778=function(_0x5f0b8f){while(--_0x5f0b8f){_0x165f67['push'](_0x165f67['shift']());}};_0x516778(++_0x50724e);}(_0x032f,0x7b));var _0xf032=function(_0x15b273,_0x20c272){_0x15b273=_0x15b273-0x0;var _0x3da9ea=_0x032f[_0x15b273];return _0x3da9ea;};'use strict';var util=require(_0xf032('0x0'));var _=require(_0xf032('0x1'));var EventEmitter=require(_0xf032('0x2'))[_0xf032('0x3')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x529181){var _0x4556c4=this,_0x1881ce=new AGIReply(),_0x8add1=![],_0x16b401={};EventEmitter[_0xf032('0x4')](_0x4556c4);_0x529181[_0xf032('0x5')](_0xf032('0x6'));_0x529181[_0xf032('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1881ce[_0xf032('0x5')](_0xf032('0x6'));_0x1881ce['on'](_0xf032('0x8'),function(_0x4d3507){for(var _0x46d034 in _0x4d3507){_0x4556c4[_0x46d034]=_0x4d3507[_0x46d034];}_0x4556c4[_0xf032('0x9')](_0xf032('0xa'));});_0x1881ce['on'](_0xf032('0xb'),function(_0x546179){if(_0x546179[_0xf032('0xc')]()==_0xf032('0xd')){_0x4556c4['emit']('hangup');return;}if(_0x546179['substring'](0x0,0xb)==_0xf032('0xe')){_0x8add1=!![];}if(_0x8add1){_0x16b401['rx']+=_0x546179+'\x0a';if(_0x546179['search']('520\x20End\x20of\x20proper')!=-0x1){_0x8add1=![];}}else{_0x16b401['rx']=_0x546179;}if(_0x8add1){return;}if(typeof _0x16b401['cb']==_0xf032('0xf')){var _0x3c2a78=_0x16b401['rx'][_0xf032('0x10')](0x0,0x3),_0x25ae7e=null,_0x21ea31=null;_0x3c2a78=parseInt(_0x3c2a78);if(isNaN(_0x3c2a78)){_0x16b401['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3c2a78!=0xc8){_0x16b401['cb'](null,{'code':_0x3c2a78,'result':-0x1,'extra':'KO'});return;}_0x25ae7e=_0x16b401['rx']['substring'](0x4)[_0xf032('0x11')](_0xf032('0x12'),'');if(_0x25ae7e[_0xf032('0x13')]('\x20')!=-0x1){_0x25ae7e=_0x25ae7e[_0xf032('0x14')](0x0,_0x25ae7e['indexOf']('\x20'));}if(_[_0xf032('0x15')](_0x25ae7e,'-1')){_0x25ae7e=parseInt(_0x25ae7e);}_0x21ea31=_0x16b401['rx'][_0xf032('0x16')]('\x20');if(_0x21ea31[_0xf032('0x17')]==0x3){_0x21ea31=_0x21ea31[0x2][_0xf032('0x10')](0x1,_0x21ea31[0x2][_0xf032('0x17')]-0x1);}else if(_0x21ea31[_0xf032('0x17')]>0x3){var _0x2fdc38=/\((.+)\)/;var _0x460121=_0x16b401['rx'][_0xf032('0x18')](_0x2fdc38);if(_0x460121){_0x21ea31=_0x460121[0x1];}else{_0x21ea31=null;}}else{_0x21ea31=null;}_0x16b401['cb'](null,{'code':_0x3c2a78,'result':_0x25ae7e,'extra':_0x21ea31});}});_0x529181['on']('error',function(_0x47d6de){_0x4556c4[_0xf032('0x9')]('error',new AGIError(_0xf032('0x19'),_0x47d6de[_0xf032('0x1a')]));});_0x529181['on'](_0xf032('0x1b'),function(){_0x4556c4[_0xf032('0x9')](_0xf032('0x1b'),new AGIError(_0xf032('0x1c')));});_0x529181['on'](_0xf032('0x1d'),function(){_0x4556c4['emit'](_0xf032('0x1d'),new AGIError(_0xf032('0x1e')));_0x529181[_0xf032('0x1f')]();});_0x529181[_0xf032('0x20')](_0x1881ce);this['command']=function(_0x40966d,_0x4954c6){var _0x40966d=_0x40966d||'',_0x4954c6=typeof _0x4954c6==_0xf032('0xf')?_0x4954c6:new Function();_0x16b401={'tx':_0x40966d,'rx':'','cb':_0x4954c6};_0x529181[_0xf032('0x21')](_0x40966d+'\x0a');},this[_0xf032('0x1b')]=function(){_0x529181[_0xf032('0x1f')]();};}util[_0xf032('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf032('0x23')][_0xf032('0x24')]=function(_0x185dfe){return this['command']['sync'](this,_0x185dfe);};AGIChannel[_0xf032('0x23')][_0xf032('0x25')]=function(){return this[_0xf032('0x24')](_0xf032('0x26'));};AGIChannel[_0xf032('0x23')][_0xf032('0x27')]=function(_0x258f1f,_0x5e3124,_0x56b834){_0x258f1f=_0x258f1f===undefined?_0xf032('0x28'):_0x258f1f;_0x5e3124=_0x5e3124===undefined?'5':_0x5e3124;_0x56b834=_0x56b834===undefined?'1':_0x56b834;return this[_0xf032('0x24')](util['format'](_0xf032('0x29'),_0x258f1f,_0x5e3124*0x3e8,_0x56b834));};AGIChannel[_0xf032('0x23')][_0xf032('0x2a')]=function(_0x513d46){_0x513d46=_0x513d46||_0xf032('0x2b');return this[_0xf032('0x24')](util[_0xf032('0x2c')]('VERBOSE\x20\x22%s\x22',_0x513d46));};AGIChannel[_0xf032('0x23')][_0xf032('0x2d')]=function(_0x46b889,_0x4af26f){if(_[_0xf032('0x2e')](_0x4af26f)){return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x2f'),_0x46b889,_0x4af26f['join'](',')));}return this['sendRequest'](util[_0xf032('0x2c')](_0xf032('0x2f'),_0x46b889,_0x4af26f));};AGIChannel[_0xf032('0x23')][_0xf032('0x30')]=function(_0x16c32a){return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x31'),_0x16c32a));};AGIChannel[_0xf032('0x23')][_0xf032('0x32')]=function(_0x51551f){return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x33'),_0x51551f));};AGIChannel[_0xf032('0x23')]['setPriority']=function(_0x1b2d19){return this[_0xf032('0x24')](util[_0xf032('0x2c')]('SET\x20PRIORITY\x20%s',_0x1b2d19));};AGIChannel[_0xf032('0x23')][_0xf032('0xd')]=function(){return this[_0xf032('0x24')]('HANGUP');};AGIChannel[_0xf032('0x23')][_0xf032('0x34')]=function(_0x171924,_0x3bc69f){var _0x3f654e=_['isBoolean'](_0x3bc69f)||_[_0xf032('0x35')](_0x3bc69f)?_0x3bc69f[_0xf032('0x36')]():_0x3bc69f;return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x37'),_0x171924,_0x3f654e?_0x3f654e[_0xf032('0x36')]()[_0xf032('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf032('0x23')][_0xf032('0x38')]=function(_0x23c02f,_0x2487d4){return this[_0xf032('0x24')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x23c02f,_0x2487d4));};AGIChannel['prototype'][_0xf032('0x39')]=function(_0x59262c,_0x22ac61){return this[_0xf032('0x24')](util['format'](_0xf032('0x3a'),_0x59262c,_0x22ac61));};AGIChannel[_0xf032('0x23')][_0xf032('0x3b')]=function(_0x39236c,_0x39d484){return this['sendRequest'](util[_0xf032('0x2c')](_0xf032('0x3c'),_0x39236c,_0x39d484));};AGIChannel[_0xf032('0x23')][_0xf032('0x3d')]=function(_0x1984c2,_0x5a98ee,_0x1c71b5){_0x5a98ee=_0x5a98ee||this[_0xf032('0x3e')];_0x1c71b5=_0x1c71b5||0x1;this[_0xf032('0x30')](_0x1984c2);this[_0xf032('0x32')](_0x5a98ee);this[_0xf032('0x3f')](_0x1c71b5);return this[_0xf032('0x2a')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x1984c2,_0x5a98ee,_0x1c71b5));};AGIChannel[_0xf032('0x23')][_0xf032('0x40')]=function(_0x5c07d1){return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x41'),_0x5c07d1));};AGIChannel[_0xf032('0x23')][_0xf032('0x42')]=function(_0x1bea3e,_0x76cb59,_0x23e6a1,_0x31c92d,_0x51348f,_0x563e25){_0x76cb59=_0x76cb59||_0xf032('0x43');_0x23e6a1=_0x23e6a1||'';_0x31c92d=_0x31c92d===undefined?-0x1:_0x31c92d==='-1'?-0x1:_0x31c92d*0x3e8;_0x51348f=_0x51348f===undefined?'':'s='+_0x51348f;_0x563e25=_0x563e25?'BEEP':'';return this['sendRequest'](util[_0xf032('0x2c')](_0xf032('0x44'),_0x1bea3e,_0x76cb59,_0x23e6a1,_0x31c92d,_0x563e25,_0x51348f));};AGIChannel['prototype']['streamFile']=function(_0x59f347,_0x3d85af){_0x3d85af=_0x3d85af||'';return this[_0xf032('0x24')](util[_0xf032('0x2c')](_0xf032('0x45'),_0x59f347,_0x3d85af));};AGIChannel[_0xf032('0x23')]['agi']=function(_0x7f9b42){return this[_0xf032('0x2d')](_0xf032('0x46'),_0x7f9b42);};AGIChannel[_0xf032('0x23')]['wait']=function(_0x3c3e1a){return this[_0xf032('0x2d')](_0xf032('0x47'),_0x3c3e1a);};AGIChannel[_0xf032('0x23')][_0xf032('0x48')]=function(_0x49f8b8,_0x562ef9){this['noop'](util[_0xf032('0x2c')](_0xf032('0x49'),_0x49f8b8['id'],_0x49f8b8['label'],_0x562ef9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf032('0x4a')]=AGIChannel; \ No newline at end of file +var _0xe767=['replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sync','prototype','answer','sendRequest','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','AGI','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','toLowerCase','hangup','emit','520-Invalid','520\x20End\x20of\x20proper','function','substring','no\x20code'];(function(_0x4b870e,_0x390eca){var _0x234d51=function(_0x22133a){while(--_0x22133a){_0x4b870e['push'](_0x4b870e['shift']());}};_0x234d51(++_0x390eca);}(_0xe767,0x11e));var _0x7e76=function(_0x2054b4,_0x2d0e5f){_0x2054b4=_0x2054b4-0x0;var _0x2b29da=_0xe767[_0x2054b4];return _0x2b29da;};'use strict';var util=require('util');var _=require(_0x7e76('0x0'));var EventEmitter=require(_0x7e76('0x1'))[_0x7e76('0x2')];var AGIReply=require(_0x7e76('0x3'));var AGIError=require(_0x7e76('0x4'));function AGIChannel(_0x1418d2){var _0x4aa35e=this,_0x4fa707=new AGIReply(),_0x473b73=![],_0x4ddc33={};EventEmitter[_0x7e76('0x5')](_0x4aa35e);_0x1418d2['setEncoding'](_0x7e76('0x6'));_0x1418d2[_0x7e76('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4fa707[_0x7e76('0x8')](_0x7e76('0x6'));_0x4fa707['on'](_0x7e76('0x9'),function(_0x177223){for(var _0x7ad075 in _0x177223){_0x4aa35e[_0x7ad075]=_0x177223[_0x7ad075];}_0x4aa35e['emit']('ready');});_0x4fa707['on']('line',function(_0x572469){if(_0x572469[_0x7e76('0xa')]()==_0x7e76('0xb')){_0x4aa35e[_0x7e76('0xc')]('hangup');return;}if(_0x572469['substring'](0x0,0xb)==_0x7e76('0xd')){_0x473b73=!![];}if(_0x473b73){_0x4ddc33['rx']+=_0x572469+'\x0a';if(_0x572469['search'](_0x7e76('0xe'))!=-0x1){_0x473b73=![];}}else{_0x4ddc33['rx']=_0x572469;}if(_0x473b73){return;}if(typeof _0x4ddc33['cb']==_0x7e76('0xf')){var _0x113c43=_0x4ddc33['rx'][_0x7e76('0x10')](0x0,0x3),_0x590b61=null,_0x26a1c3=null;_0x113c43=parseInt(_0x113c43);if(isNaN(_0x113c43)){_0x4ddc33['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7e76('0x11')});return;}if(_0x113c43!=0xc8){_0x4ddc33['cb'](null,{'code':_0x113c43,'result':-0x1,'extra':'KO'});return;}_0x590b61=_0x4ddc33['rx'][_0x7e76('0x10')](0x4)[_0x7e76('0x12')](_0x7e76('0x13'),'');if(_0x590b61[_0x7e76('0x14')]('\x20')!=-0x1){_0x590b61=_0x590b61[_0x7e76('0x15')](0x0,_0x590b61[_0x7e76('0x14')]('\x20'));}if(_[_0x7e76('0x16')](_0x590b61,'-1')){_0x590b61=parseInt(_0x590b61);}_0x26a1c3=_0x4ddc33['rx']['split']('\x20');if(_0x26a1c3[_0x7e76('0x17')]==0x3){_0x26a1c3=_0x26a1c3[0x2][_0x7e76('0x10')](0x1,_0x26a1c3[0x2][_0x7e76('0x17')]-0x1);}else if(_0x26a1c3[_0x7e76('0x17')]>0x3){var _0x5aeeb0=/\((.+)\)/;var _0x2390b4=_0x4ddc33['rx'][_0x7e76('0x18')](_0x5aeeb0);if(_0x2390b4){_0x26a1c3=_0x2390b4[0x1];}else{_0x26a1c3=null;}}else{_0x26a1c3=null;}_0x4ddc33['cb'](null,{'code':_0x113c43,'result':_0x590b61,'extra':_0x26a1c3});}});_0x1418d2['on'](_0x7e76('0x19'),function(_0x479313){_0x4aa35e[_0x7e76('0xc')](_0x7e76('0x19'),new AGIError(_0x7e76('0x1a'),_0x479313['code']));});_0x1418d2['on'](_0x7e76('0x1b'),function(){_0x4aa35e[_0x7e76('0xc')]('close',new AGIError(_0x7e76('0x1c')));});_0x1418d2['on']('timeout',function(){_0x4aa35e[_0x7e76('0xc')](_0x7e76('0x1d'),new AGIError(_0x7e76('0x1e')));_0x1418d2[_0x7e76('0x1f')]();});_0x1418d2[_0x7e76('0x20')](_0x4fa707);this[_0x7e76('0x21')]=function(_0x5e4303,_0x241e5b){var _0x5e4303=_0x5e4303||'',_0x241e5b=typeof _0x241e5b==_0x7e76('0xf')?_0x241e5b:new Function();_0x4ddc33={'tx':_0x5e4303,'rx':'','cb':_0x241e5b};_0x1418d2[_0x7e76('0x22')](_0x5e4303+'\x0a');},this['close']=function(){_0x1418d2[_0x7e76('0x1f')]();};}util[_0x7e76('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5286ef){return this[_0x7e76('0x21')][_0x7e76('0x24')](this,_0x5286ef);};AGIChannel[_0x7e76('0x25')][_0x7e76('0x26')]=function(){return this[_0x7e76('0x27')]('ANSWER');};AGIChannel[_0x7e76('0x25')][_0x7e76('0x28')]=function(_0x3e5716,_0x17c249,_0x31ab2f){_0x3e5716=_0x3e5716===undefined?_0x7e76('0x29'):_0x3e5716;_0x17c249=_0x17c249===undefined?'5':_0x17c249;_0x31ab2f=_0x31ab2f===undefined?'1':_0x31ab2f;return this[_0x7e76('0x27')](util['format'](_0x7e76('0x2a'),_0x3e5716,_0x17c249*0x3e8,_0x31ab2f));};AGIChannel['prototype'][_0x7e76('0x2b')]=function(_0x50e814){_0x50e814=_0x50e814||'NO\x20MESSAGE';return this[_0x7e76('0x27')](util[_0x7e76('0x2c')]('VERBOSE\x20\x22%s\x22',_0x50e814));};AGIChannel[_0x7e76('0x25')]['exec']=function(_0x5028ee,_0x3af011){if(_['isArray'](_0x3af011)){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x2d'),_0x5028ee,_0x3af011[_0x7e76('0x2e')](',')));}return this[_0x7e76('0x27')](util['format']('EXEC\x20%s\x20%s',_0x5028ee,_0x3af011));};AGIChannel[_0x7e76('0x25')]['setContext']=function(_0x5389fe){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')]('SET\x20CONTEXT\x20%s',_0x5389fe));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x2f')]=function(_0x348382){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x30'),_0x348382));};AGIChannel['prototype']['setPriority']=function(_0x299f46){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')]('SET\x20PRIORITY\x20%s',_0x299f46));};AGIChannel[_0x7e76('0x25')][_0x7e76('0xb')]=function(){return this[_0x7e76('0x27')](_0x7e76('0x31'));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x32')]=function(_0x1522f5,_0x4a61d6){var _0x54186b=_[_0x7e76('0x33')](_0x4a61d6)||_[_0x7e76('0x34')](_0x4a61d6)?_0x4a61d6[_0x7e76('0x35')]():_0x4a61d6;return this[_0x7e76('0x27')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1522f5,_0x54186b?_0x54186b[_0x7e76('0x35')]()[_0x7e76('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7e76('0x25')]['sayNumber']=function(_0x329bc4,_0xc6bf19){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x329bc4,_0xc6bf19));};AGIChannel[_0x7e76('0x25')]['sayDigits']=function(_0x289105,_0x3a4449){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x36'),_0x289105,_0x3a4449));};AGIChannel['prototype'][_0x7e76('0x37')]=function(_0x367a38,_0xd2c2f1){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x38'),_0x367a38,_0xd2c2f1));};AGIChannel['prototype']['continueAt']=function(_0x2b8d45,_0x479ed7,_0x464c8f){_0x479ed7=_0x479ed7||this[_0x7e76('0x39')];_0x464c8f=_0x464c8f||0x1;this[_0x7e76('0x3a')](_0x2b8d45);this[_0x7e76('0x2f')](_0x479ed7);this[_0x7e76('0x3b')](_0x464c8f);return this[_0x7e76('0x2b')](util[_0x7e76('0x2c')](_0x7e76('0x3c'),_0x2b8d45,_0x479ed7,_0x464c8f));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x3d')]=function(_0x59802d){return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x3e'),_0x59802d));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x3f')]=function(_0x4f16d5,_0x325c6f,_0x5c6f00,_0x7ebb02,_0x11875f,_0xe0c0e9){_0x325c6f=_0x325c6f||_0x7e76('0x40');_0x5c6f00=_0x5c6f00||'';_0x7ebb02=_0x7ebb02===undefined?-0x1:_0x7ebb02==='-1'?-0x1:_0x7ebb02*0x3e8;_0x11875f=_0x11875f===undefined?'':'s='+_0x11875f;_0xe0c0e9=_0xe0c0e9?_0x7e76('0x41'):'';return this[_0x7e76('0x27')](util[_0x7e76('0x2c')](_0x7e76('0x42'),_0x4f16d5,_0x325c6f,_0x5c6f00,_0x7ebb02,_0xe0c0e9,_0x11875f));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x43')]=function(_0x3a04a4,_0x3ed2da){_0x3ed2da=_0x3ed2da||'';return this['sendRequest'](util[_0x7e76('0x2c')](_0x7e76('0x44'),_0x3a04a4,_0x3ed2da));};AGIChannel[_0x7e76('0x25')][_0x7e76('0x45')]=function(_0x57364e){return this['exec'](_0x7e76('0x46'),_0x57364e);};AGIChannel['prototype']['wait']=function(_0x306610){return this[_0x7e76('0x47')](_0x7e76('0x48'),_0x306610);};AGIChannel[_0x7e76('0x25')][_0x7e76('0x19')]=function(_0x361370,_0x2160b9){this[_0x7e76('0x2b')](util[_0x7e76('0x2c')](_0x7e76('0x49'),_0x361370['id'],_0x361370[_0x7e76('0x4a')],_0x2160b9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7e76('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0d0476e..a2bbb56 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 _0x6de1=['Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6de1,0xe2));var _0x16de=function(_0x1282a0,_0x58b2f9){_0x1282a0=_0x1282a0-0x0;var _0x18af0c=_0x6de1[_0x1282a0];return _0x18af0c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x16de('0x0'),'E_AGI_ARGUMENT_PORT':_0x16de('0x1'),'E_AGI_SERVER_ERROR':_0x16de('0x2'),'E_AGI_SERVER_CLOSE':_0x16de('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x16de('0x4'),'E_AGI_SOCKET_ERROR':_0x16de('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x16de('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x16de('0x7'),'E_AGI_IVR_ENTRY':_0x16de('0x8')};function AGIError(_0x4172cd){var _0x4172cd=_0x4172cd||null,_0x33d943=_0x33d943||[],_0x416d25=0x1,_0x2447e7='';if(!error[_0x4172cd]){_0x4172cd='E_AGI_UNDEFINED';}_0x33d943[_0x16de('0x9')](error[_0x4172cd]);while(arguments[_0x416d25]){_0x33d943[_0x16de('0x9')](arguments[_0x416d25]);_0x416d25++;}_0x2447e7=util[_0x16de('0xa')][_0x16de('0xb')](util,_0x33d943);this['message']=_0x2447e7;this[_0x16de('0xc')]=_0x4172cd;}module['exports']=AGIError; \ No newline at end of file +var _0x451b=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x451b,0x11e));var _0xb451=function(_0x31aed5,_0x234cad){_0x31aed5=_0x31aed5-0x0;var _0x1caf3c=_0x451b[_0x31aed5];return _0x1caf3c;};'use strict';var util=require(_0xb451('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xb451('0x1'),'E_AGI_SERVER_ERROR':_0xb451('0x2'),'E_AGI_SERVER_CLOSE':_0xb451('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xb451('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xb451('0x5'),'E_AGI_SOCKET_ERROR':_0xb451('0x6'),'E_AGI_SOCKET_CLOSE':_0xb451('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xb451('0x8'),'E_AGI_COMMAND_EMPTY':_0xb451('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xb451('0xa')};function AGIError(_0x43b667){var _0x43b667=_0x43b667||null,_0x576adc=_0x576adc||[],_0x49a994=0x1,_0x3ab203='';if(!error[_0x43b667]){_0x43b667=_0xb451('0xb');}_0x576adc[_0xb451('0xc')](error[_0x43b667]);while(arguments[_0x49a994]){_0x576adc['push'](arguments[_0x49a994]);_0x49a994++;}_0x3ab203=util[_0xb451('0xd')]['apply'](util,_0x576adc);this[_0xb451('0xe')]=_0x3ab203;this[_0xb451('0xf')]=_0x43b667;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 27014e4..b0c57ed 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 _0x4c4f=['vertices','addEdge','push','numberOfEdges','size','relations','info','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','invalid','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','edges','prototype','addVertex'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x4c4f,0x18d));var _0xf4c4=function(_0x53b11f,_0x412ec2){_0x53b11f=_0x53b11f-0x0;var _0x4bbb87=_0x4c4f[_0x53b11f];return _0x4bbb87;};'use strict';var _=require(_0xf4c4('0x0'));var logger=require(_0xf4c4('0x1'))('agi');var verticesWithRetry=[_0xf4c4('0x2'),_0xf4c4('0x3'),_0xf4c4('0x4')];var Graph=function(){this['vertices']={};this[_0xf4c4('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0xf4c4('0x6')][_0xf4c4('0x7')]=function(_0x5d6328){this[_0xf4c4('0x8')][_0x5d6328['id']]=_0x5d6328;this[_0xf4c4('0x5')][_0x5d6328['id']]=[];};Graph[_0xf4c4('0x6')][_0xf4c4('0x9')]=function(_0x27fc0e,_0x2711e3,_0x2470a5){this[_0xf4c4('0x5')][_0x27fc0e][_0xf4c4('0xa')]({'target':_0x2711e3,'condition':_0x2470a5});this[_0xf4c4('0xb')]+=0x1;};Graph['prototype'][_0xf4c4('0xc')]=function(){return _[_0xf4c4('0xc')](this['vertices']);};Graph[_0xf4c4('0x6')][_0xf4c4('0xd')]=function(){return this['numberOfEdges'];};Graph[_0xf4c4('0x6')]['getVertex']=function(_0x7d257f){return this[_0xf4c4('0x8')][_0x7d257f];};Graph[_0xf4c4('0x6')]['traverseBFS']=function(_0x444510,_0x4cc0ee){if(!this['vertices'][_0x444510]){return logger[_0xf4c4('0xe')]('no\x20vertex\x20found');}var _0x2a01a3=_0x4cc0ee(this['vertices'][_0x444510]);if(!_0x2a01a3){return logger[_0xf4c4('0xe')]('stop\x20traverse');}if(this[_0xf4c4('0x5')][_0x444510][_0xf4c4('0xf')]===0x0){return logger['info'](_0xf4c4('0x10'));}for(var _0x656579=0x0,_0x38cb08=[],_0x20e3df=![];_0x656579\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','info','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','mxCell','isArray','source','target','addEdge','value','getSquareProject','then','catch','substring','inspect','debug','stringify','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published'];(function(_0x2364ef,_0x2d977f){var _0x3ad5fe=function(_0x58c192){while(--_0x58c192){_0x2364ef['push'](_0x2364ef['shift']());}};_0x3ad5fe(++_0x2d977f);}(_0xe147,0xc2));var _0x7e14=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe147[_0x501510];return _0x1e6ee5;};'use strict';var parser=require(_0x7e14('0x0'));var _=require(_0x7e14('0x1'));var syncho=require('syncho');var util=require(_0x7e14('0x2'));var moment=require(_0x7e14('0x3'));var config=require(_0x7e14('0x4'));var logger=require('../../config/logger')(_0x7e14('0x5'));var utilLicense=require(_0x7e14('0x6'));var rpc=require(_0x7e14('0x7'));var mailRpc=require(_0x7e14('0x8'));var Graph=require(_0x7e14('0x9'));var Vertices=require(_0x7e14('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7e14('0x5')]=_['defaults'](config[_0x7e14('0x5')],{'ip':_0x7e14('0xb'),'port':0x11dd});function connectionHandler(_0x35b040){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x35b040);agiHandler(_0x35b040);}catch(_0x30e5f5){logger['error'](_0x30e5f5[_0x7e14('0xc')]);}});});}function listeningHandler(){console[_0x7e14('0xd')](_0x7e14('0xe'),config[_0x7e14('0x5')][_0x7e14('0xf')]);logger['info'](util[_0x7e14('0x10')](_0x7e14('0x11'),config[_0x7e14('0x5')]['ip'],config[_0x7e14('0x5')][_0x7e14('0xf')]));}function errorHandler(_0x2395ce){if(_0x2395ce&&_0x2395ce['name']&&_0x2395ce[_0x7e14('0x12')]){logger[_0x7e14('0x13')](util['format'](_0x7e14('0x14'),_0x2395ce[_0x7e14('0x15')],_0x2395ce[_0x7e14('0x12')]));}else{logger[_0x7e14('0x13')](util[_0x7e14('0x10')](_0x7e14('0x16'),_0x2395ce[_0x7e14('0xc')]));}}function closeHandler(){logger['info'](util[_0x7e14('0x10')](_0x7e14('0x17'),this[_0x7e14('0x18')],this[_0x7e14('0x19')],this[_0x7e14('0x1a')],this[_0x7e14('0x1b')],this[_0x7e14('0x1c')]));try{createSquareReport(this);}catch(_0x1c4aaf){logger[_0x7e14('0x13')](_0x1c4aaf[_0x7e14('0xc')]);}}function timeoutHandler(){logger['info'](util[_0x7e14('0x10')](_0x7e14('0x1d'),this[_0x7e14('0x18')],this[_0x7e14('0x19')],this[_0x7e14('0x1a')],this[_0x7e14('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x7e14('0x1e')](util[_0x7e14('0x10')](_0x7e14('0x1f'),this[_0x7e14('0x18')],this[_0x7e14('0x19')],this['callerid'],this['dnid'],this[_0x7e14('0x1c')]));this[_0x7e14('0x20')]=!![];}function getRoot(_0xa28de){return parser[_0x7e14('0x21')](_0xa28de,{'object':!![]})[_0x7e14('0x22')][_0x7e14('0x23')];}function addVertex(_0x1dc5c7,_0x34079a,_0x5db11f){_0x34079a[_0x7e14('0x24')]=_0x5db11f;if(_0x34079a[_0x7e14('0x25')](_0x7e14('0x26'))){_0x34079a['maxRetry']=parseInt(_0x34079a[_0x7e14('0x26')],0xa);}_0x1dc5c7[_0x7e14('0x27')](_['omit'](_0x34079a,_0x7e14('0x28')));}function initGraph(_0x28adc0,_0x2fd808){var _0x343b94=new Graph();for(var _0x47cee4 in _0x28adc0){if(_0x28adc0[_0x7e14('0x25')](_0x47cee4)){if(_[_0x7e14('0x29')](_0x28adc0[_0x47cee4])){for(var _0x4141e3=0x0;_0x4141e3<_0x28adc0[_0x47cee4]['length'];_0x4141e3+=0x1){addVertex(_0x343b94,_0x28adc0[_0x47cee4][_0x4141e3],_0x47cee4);}}else{addVertex(_0x343b94,_0x28adc0[_0x47cee4],_0x47cee4);}}}for(var _0x95fdb8=0x0;_0x95fdb8<_0x2fd808['length'];_0x95fdb8+=0x1){if(_0x2fd808[_0x95fdb8][_0x7e14('0x2a')]&&_0x2fd808[_0x95fdb8][_0x7e14('0x2b')]){_0x343b94[_0x7e14('0x2c')](_0x2fd808[_0x95fdb8][_0x7e14('0x2a')],_0x2fd808[_0x95fdb8]['target'],_0x2fd808[_0x95fdb8][_0x7e14('0x2d')]);}}return _0x343b94;}function getSquareProject(_0x27ccec,_0xfabb76){rpc[_0x7e14('0x2e')](_0x27ccec)[_0x7e14('0x2f')](function(_0x29fbe7){_0xfabb76(null,_0x29fbe7);})[_0x7e14('0x30')](function(_0x293864){_0xfabb76(null,_0x293864);});}function createSquareReport(_0x5f1851,_0x3b1c9b){rpc['createSquareReport'](_0x5f1851)[_0x7e14('0x2f')](function(_0x3cc560){if(_0x3b1c9b){_0x3b1c9b(null,_0x3cc560);}})[_0x7e14('0x30')](function(_0x4ad440){if(_0x3b1c9b){_0x3b1c9b(null,_0x4ad440);}});}function setChannelVariables(_0x53fe56){for(var _0x4bf268 in _0x53fe56){if(_0x53fe56[_0x7e14('0x25')](_0x4bf268)){if(_0x4bf268['indexOf']('agi_')===0x0){_0x53fe56[_0x4bf268[_0x7e14('0x31')](0x4)]=_0x53fe56[_0x4bf268];delete _0x53fe56[_0x4bf268];}}}}function getLogFromObject(_0x56de1b){return util[_0x7e14('0x32')](_0x56de1b,{'showHidden':![],'depth':null});}function agiHandler(_0x140486){var _0x1c0243,_0x537b56,_0x560415,_0x395090,_0x504fc2;logger[_0x7e14('0x33')]('variables',JSON[_0x7e14('0x34')](_0x140486,null,0x2));logger[_0x7e14('0x1e')](util[_0x7e14('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x140486[_0x7e14('0x18')],_0x140486[_0x7e14('0x19')],_0x140486[_0x7e14('0x1a')],_0x140486[_0x7e14('0x1b')],_0x140486[_0x7e14('0x1c')]));_0x140486['on']('error',errorHandler);_0x140486['on'](_0x7e14('0x35'),closeHandler);_0x140486['on'](_0x7e14('0x36'),timeoutHandler);_0x140486[_0x7e14('0x20')]=![];_0x140486['on'](_0x7e14('0x37'),hangupHandler);var _0x2ced85=getSquareProject[_0x7e14('0x38')](null,_0x140486['arg_1']);if(_0x2ced85){if(_0x2ced85['production']){_0x1c0243=getRoot(_0x2ced85[_0x7e14('0x39')]);if(_0x1c0243&&_0x1c0243[_0x7e14('0x3a')]){logger['debug'](_0x7e14('0x23'),JSON[_0x7e14('0x34')](_0x1c0243,null,0x2));_0x140486[_0x7e14('0x3b')]=moment()[_0x7e14('0x10')](_0x7e14('0x3c'));_0x537b56=initGraph(_[_0x7e14('0x3d')](_0x1c0243,_0x7e14('0x28')),_0x1c0243['mxCell']);_0x560415=new Vertices(_0x140486,rpc,mailRpc);logger[_0x7e14('0x1e')](util['format'](_0x7e14('0x3e'),_0x140486[_0x7e14('0x18')],_0x140486[_0x7e14('0x19')],_0x140486[_0x7e14('0x1a')],_0x140486[_0x7e14('0x1b')],_0x140486[_0x7e14('0x1c')]));_0x537b56[_0x7e14('0x3f')](_0x1c0243[_0x7e14('0x3a')]['id'],function(_0x3a413c){try{_0x3a413c=_0x560415[_0x7e14('0x40')](_0x3a413c);logger['debug'](_0x7e14('0x41'),JSON[_0x7e14('0x34')](_0x3a413c,null,0x2));if(_0x3a413c[_0x7e14('0x24')]===_0x7e14('0x42')){logger[_0x7e14('0x1e')](_0x7e14('0x43'));_0x140486[_0x7e14('0x44')]=_0x3a413c['context']||_0x140486['context'];_0x140486[_0x7e14('0x45')]=_0x3a413c['extension'];_0x140486['priority']=_0x3a413c['priority']?_0x3a413c[_0x7e14('0x46')]-0x1:0x1;return null;}else if(_0x3a413c&&_0x560415[_0x3a413c[_0x7e14('0x24')]]){_0x504fc2=_0x560415[_0x3a413c[_0x7e14('0x24')]](_0x3a413c);logger['info'](_0x7e14('0x47'),JSON[_0x7e14('0x34')](_0x504fc2,null,0x2));if(_0x504fc2&&_0x504fc2[_0x7e14('0x48')]===AGI_CODE_SUCCESS&&_0x504fc2[_0x7e14('0x49')]!==AGI_RESULT_ERROR&&!_0x140486[_0x7e14('0x20')]){logger[_0x7e14('0x33')](_0x7e14('0x47'),getLogFromObject(_0x504fc2));return _[_0x7e14('0x4a')](_0x504fc2[_0x7e14('0x49')])?null:_0x504fc2[_0x7e14('0x49')][_0x7e14('0x4b')]();}else{logger[_0x7e14('0x13')](_0x7e14('0x47'),getLogFromObject(_0x504fc2));return null;}}else{logger[_0x7e14('0x13')](_0x7e14('0x4c'));return null;}}catch(_0x379bd1){logger[_0x7e14('0x13')](_0x379bd1[_0x7e14('0xc')]);return null;}});if(_0x1c0243[_0x7e14('0x4d')]){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x140486[_0x7e14('0x18')],_0x140486['calleridname'],_0x140486[_0x7e14('0x1a')],_0x140486[_0x7e14('0x1b')],_0x140486[_0x7e14('0x1c')]));_0x537b56[_0x7e14('0x3f')](_0x1c0243['finally']['id'],function(_0x58eb23){try{_0x58eb23=_0x560415[_0x7e14('0x40')](_0x58eb23);logger[_0x7e14('0x33')](_0x7e14('0x41'),JSON[_0x7e14('0x34')](_0x58eb23,null,0x2));if(_0x58eb23&&_0x560415[_0x58eb23[_0x7e14('0x24')]]){_0x504fc2=_0x560415[_0x58eb23[_0x7e14('0x24')]](_0x58eb23);if(_0x504fc2){logger[_0x7e14('0x33')]('response',getLogFromObject(_0x504fc2));return _[_0x7e14('0x4a')](_0x504fc2[_0x7e14('0x49')])?null:_0x504fc2[_0x7e14('0x49')][_0x7e14('0x4b')]();}else{logger[_0x7e14('0x13')](_0x7e14('0x47'),getLogFromObject(_0x504fc2));return null;}}else{logger['error'](_0x7e14('0x4c'));return null;}}catch(_0x3f6b42){logger[_0x7e14('0x13')](_0x3f6b42['stack']);return null;}});}logger[_0x7e14('0x1e')](util[_0x7e14('0x10')](_0x7e14('0x4e'),_0x140486[_0x7e14('0x18')],_0x140486['calleridname'],_0x140486[_0x7e14('0x1a')],_0x140486[_0x7e14('0x1b')],_0x140486[_0x7e14('0x1c')]));logger[_0x7e14('0x1e')](util['format'](_0x7e14('0x4f'),_0x140486['context'],_0x140486[_0x7e14('0x45')],parseInt(_0x140486['priority'],0xa)+0x1));_0x140486[_0x7e14('0x50')](_0x140486[_0x7e14('0x44')],_0x140486[_0x7e14('0x45')],parseInt(_0x140486[_0x7e14('0x46')],0xa)+0x1);_0x140486[_0x7e14('0x35')]();}}else{logger[_0x7e14('0x13')](util[_0x7e14('0x10')](_0x7e14('0x51'),_0x140486[_0x7e14('0x18')]));_0x140486[_0x7e14('0x50')](_0x140486[_0x7e14('0x44')],_0x140486[_0x7e14('0x45')],parseInt(_0x140486[_0x7e14('0x46')],0xa)+0x1);_0x140486[_0x7e14('0x35')]();}}else{logger[_0x7e14('0x13')](util[_0x7e14('0x10')](_0x7e14('0x52'),_0x140486[_0x7e14('0x18')]));_0x140486['continueAt'](_0x140486[_0x7e14('0x44')],_0x140486[_0x7e14('0x45')],parseInt(_0x140486[_0x7e14('0x46')],0xa)+0x1);_0x140486[_0x7e14('0x35')]();}}function main(){var _0x353aab;return utilLicense['getLicense']()[_0x7e14('0x2f')](function(_0x19c002){if(_0x19c002){if(_0x19c002[_0x7e14('0x53')]){if(_0x19c002[_0x7e14('0x54')]&&_0x19c002['callysquare']>0x0){logger[_0x7e14('0x1e')](util['format'](_0x7e14('0x55'),_0x19c002['callysquare']));_0x353aab=_0x19c002[_0x7e14('0x54')];}else{logger[_0x7e14('0x1e')](_0x7e14('0x56'));}}else{logger['info'](_0x7e14('0x57'));_0x353aab=-0x1;}}})[_0x7e14('0x30')](function(_0x304f30){logger[_0x7e14('0x13')](_0x7e14('0x58'),_0x304f30[_0x7e14('0xc')]);})[_0x7e14('0x4d')](function(){var _0x415bf3=require(_0x7e14('0x59'))(config[_0x7e14('0x5')][_0x7e14('0xf')],config['agi']['ip'],_0x353aab);_0x415bf3['on']('error',errorHandler);_0x415bf3['on'](_0x7e14('0x5a'),listeningHandler);_0x415bf3['on'](_0x7e14('0x5b'),connectionHandler);_0x415bf3['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x2e61=['code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response'];(function(_0x80f98b,_0x4730a0){var _0x3d0e9a=function(_0x90635c){while(--_0x90635c){_0x80f98b['push'](_0x80f98b['shift']());}};_0x3d0e9a(++_0x4730a0);}(_0x2e61,0x18d));var _0x12e6=function(_0x24a7ba,_0x4a644d){_0x24a7ba=_0x24a7ba-0x0;var _0x431d14=_0x2e61[_0x24a7ba];return _0x431d14;};'use strict';var parser=require(_0x12e6('0x0'));var _=require(_0x12e6('0x1'));var syncho=require('syncho');var util=require(_0x12e6('0x2'));var moment=require(_0x12e6('0x3'));var config=require(_0x12e6('0x4'));var logger=require(_0x12e6('0x5'))(_0x12e6('0x6'));var utilLicense=require(_0x12e6('0x7'));var rpc=require(_0x12e6('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x12e6('0x9'));var Vertices=require(_0x12e6('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x12e6('0xb')](config[_0x12e6('0x6')],{'ip':_0x12e6('0xc'),'port':0x11dd});function connectionHandler(_0x3bc494){process[_0x12e6('0xd')](function(){syncho(function(){try{setChannelVariables(_0x3bc494);agiHandler(_0x3bc494);}catch(_0x109440){logger[_0x12e6('0xe')](_0x109440[_0x12e6('0xf')]);}});});}function listeningHandler(){console['log'](_0x12e6('0x10'),config[_0x12e6('0x6')][_0x12e6('0x11')]);logger['info'](util[_0x12e6('0x12')](_0x12e6('0x13'),config[_0x12e6('0x6')]['ip'],config['agi'][_0x12e6('0x11')]));}function errorHandler(_0x481871){if(_0x481871&&_0x481871['name']&&_0x481871[_0x12e6('0x14')]){logger[_0x12e6('0xe')](util[_0x12e6('0x12')](_0x12e6('0x15'),_0x481871[_0x12e6('0x16')],_0x481871[_0x12e6('0x14')]));}else{logger['error'](util[_0x12e6('0x12')](_0x12e6('0x17'),_0x481871['stack']));}}function closeHandler(){logger[_0x12e6('0x18')](util[_0x12e6('0x12')](_0x12e6('0x19'),this[_0x12e6('0x1a')],this[_0x12e6('0x1b')],this[_0x12e6('0x1c')],this[_0x12e6('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x141899){logger[_0x12e6('0xe')](_0x141899[_0x12e6('0xf')]);}}function timeoutHandler(){logger[_0x12e6('0x18')](util[_0x12e6('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x12e6('0x1a')],this[_0x12e6('0x1b')],this['callerid'],this[_0x12e6('0x1d')],this[_0x12e6('0x1e')]));}function hangupHandler(){logger[_0x12e6('0x18')](util[_0x12e6('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x12e6('0x1b')],this[_0x12e6('0x1c')],this[_0x12e6('0x1d')],this[_0x12e6('0x1e')]));this[_0x12e6('0x1f')]=!![];}function getRoot(_0x354ec6){return parser[_0x12e6('0x20')](_0x354ec6,{'object':!![]})[_0x12e6('0x21')]['root'];}function addVertex(_0x44f8b7,_0xe36104,_0x55f4a9){_0xe36104[_0x12e6('0x22')]=_0x55f4a9;if(_0xe36104[_0x12e6('0x23')](_0x12e6('0x24'))){_0xe36104[_0x12e6('0x25')]=parseInt(_0xe36104[_0x12e6('0x24')],0xa);}_0x44f8b7[_0x12e6('0x26')](_[_0x12e6('0x27')](_0xe36104,_0x12e6('0x28')));}function initGraph(_0x8bd218,_0x46609f){var _0x4372a2=new Graph();for(var _0x3c2708 in _0x8bd218){if(_0x8bd218[_0x12e6('0x23')](_0x3c2708)){if(_[_0x12e6('0x29')](_0x8bd218[_0x3c2708])){for(var _0x419f3a=0x0;_0x419f3a<_0x8bd218[_0x3c2708][_0x12e6('0x2a')];_0x419f3a+=0x1){addVertex(_0x4372a2,_0x8bd218[_0x3c2708][_0x419f3a],_0x3c2708);}}else{addVertex(_0x4372a2,_0x8bd218[_0x3c2708],_0x3c2708);}}}for(var _0x1ad527=0x0;_0x1ad527<_0x46609f[_0x12e6('0x2a')];_0x1ad527+=0x1){if(_0x46609f[_0x1ad527][_0x12e6('0x2b')]&&_0x46609f[_0x1ad527][_0x12e6('0x2c')]){_0x4372a2[_0x12e6('0x2d')](_0x46609f[_0x1ad527][_0x12e6('0x2b')],_0x46609f[_0x1ad527][_0x12e6('0x2c')],_0x46609f[_0x1ad527]['value']);}}return _0x4372a2;}function getSquareProject(_0x3313d4,_0x5bdf30){rpc[_0x12e6('0x2e')](_0x3313d4)[_0x12e6('0x2f')](function(_0x1ef0a2){_0x5bdf30(null,_0x1ef0a2);})[_0x12e6('0x30')](function(_0x40c77e){_0x5bdf30(null,_0x40c77e);});}function createSquareReport(_0x1d58cf,_0x2968ee){rpc[_0x12e6('0x31')](_0x1d58cf)[_0x12e6('0x2f')](function(_0x36a84a){if(_0x2968ee){_0x2968ee(null,_0x36a84a);}})[_0x12e6('0x30')](function(_0x5a3afc){if(_0x2968ee){_0x2968ee(null,_0x5a3afc);}});}function setChannelVariables(_0x4612fa){for(var _0x29ff6d in _0x4612fa){if(_0x4612fa[_0x12e6('0x23')](_0x29ff6d)){if(_0x29ff6d['indexOf'](_0x12e6('0x32'))===0x0){_0x4612fa[_0x29ff6d[_0x12e6('0x33')](0x4)]=_0x4612fa[_0x29ff6d];delete _0x4612fa[_0x29ff6d];}}}}function getLogFromObject(_0x3ec826){return util[_0x12e6('0x34')](_0x3ec826,{'showHidden':![],'depth':null});}function agiHandler(_0x3883a3){var _0x433c1e,_0x521fd1,_0x13778d,_0x4d697e,_0x30a296;logger[_0x12e6('0x35')](_0x12e6('0x36'),JSON[_0x12e6('0x37')](_0x3883a3,null,0x2));logger[_0x12e6('0x18')](util['format'](_0x12e6('0x38'),_0x3883a3[_0x12e6('0x1a')],_0x3883a3[_0x12e6('0x1b')],_0x3883a3[_0x12e6('0x1c')],_0x3883a3['dnid'],_0x3883a3[_0x12e6('0x1e')]));_0x3883a3['on'](_0x12e6('0xe'),errorHandler);_0x3883a3['on'](_0x12e6('0x39'),closeHandler);_0x3883a3['on']('timeout',timeoutHandler);_0x3883a3[_0x12e6('0x1f')]=![];_0x3883a3['on'](_0x12e6('0x3a'),hangupHandler);var _0x27bdd2=getSquareProject[_0x12e6('0x3b')](null,_0x3883a3[_0x12e6('0x1a')]);if(_0x27bdd2){if(_0x27bdd2[_0x12e6('0x3c')]){_0x433c1e=getRoot(_0x27bdd2[_0x12e6('0x3c')]);if(_0x433c1e&&_0x433c1e[_0x12e6('0x3d')]){logger[_0x12e6('0x35')](_0x12e6('0x3e'),JSON['stringify'](_0x433c1e,null,0x2));_0x3883a3[_0x12e6('0x3f')]=moment()[_0x12e6('0x12')](_0x12e6('0x40'));_0x521fd1=initGraph(_[_0x12e6('0x27')](_0x433c1e,_0x12e6('0x28')),_0x433c1e[_0x12e6('0x28')]);_0x13778d=new Vertices(_0x3883a3,rpc,mailRpc);logger['info'](util[_0x12e6('0x12')](_0x12e6('0x41'),_0x3883a3[_0x12e6('0x1a')],_0x3883a3[_0x12e6('0x1b')],_0x3883a3[_0x12e6('0x1c')],_0x3883a3[_0x12e6('0x1d')],_0x3883a3[_0x12e6('0x1e')]));_0x521fd1['traverseBFS'](_0x433c1e['start']['id'],function(_0x4a29a2){try{_0x4a29a2=_0x13778d[_0x12e6('0x42')](_0x4a29a2);logger[_0x12e6('0x35')]('vertex',JSON[_0x12e6('0x37')](_0x4a29a2,null,0x2));if(_0x4a29a2[_0x12e6('0x22')]===_0x12e6('0x43')){logger[_0x12e6('0x18')](_0x12e6('0x44'));_0x3883a3[_0x12e6('0x45')]=_0x4a29a2[_0x12e6('0x45')]||_0x3883a3[_0x12e6('0x45')];_0x3883a3['extension']=_0x4a29a2[_0x12e6('0x46')];_0x3883a3[_0x12e6('0x47')]=_0x4a29a2[_0x12e6('0x47')]?_0x4a29a2[_0x12e6('0x47')]-0x1:0x1;return null;}else if(_0x4a29a2&&_0x13778d[_0x4a29a2[_0x12e6('0x22')]]){_0x30a296=_0x13778d[_0x4a29a2['agicommand']](_0x4a29a2);logger[_0x12e6('0x18')](_0x12e6('0x48'),JSON[_0x12e6('0x37')](_0x30a296,null,0x2));if(_0x30a296&&_0x30a296[_0x12e6('0x49')]===AGI_CODE_SUCCESS&&_0x30a296[_0x12e6('0x4a')]!==AGI_RESULT_ERROR&&!_0x3883a3['evtHangup']){logger[_0x12e6('0x35')](_0x12e6('0x48'),getLogFromObject(_0x30a296));return _['isUndefined'](_0x30a296[_0x12e6('0x4a')])?null:_0x30a296[_0x12e6('0x4a')][_0x12e6('0x4b')]();}else{logger[_0x12e6('0xe')](_0x12e6('0x48'),getLogFromObject(_0x30a296));return null;}}else{logger[_0x12e6('0xe')](_0x12e6('0x4c'));return null;}}catch(_0x444ff6){logger[_0x12e6('0xe')](_0x444ff6[_0x12e6('0xf')]);return null;}});if(_0x433c1e[_0x12e6('0x4d')]){logger[_0x12e6('0x18')](util[_0x12e6('0x12')](_0x12e6('0x4e'),_0x3883a3['arg_1'],_0x3883a3[_0x12e6('0x1b')],_0x3883a3[_0x12e6('0x1c')],_0x3883a3['dnid'],_0x3883a3[_0x12e6('0x1e')]));_0x521fd1[_0x12e6('0x4f')](_0x433c1e[_0x12e6('0x4d')]['id'],function(_0x35fb9d){try{_0x35fb9d=_0x13778d['clear'](_0x35fb9d);logger[_0x12e6('0x35')](_0x12e6('0x50'),JSON['stringify'](_0x35fb9d,null,0x2));if(_0x35fb9d&&_0x13778d[_0x35fb9d['agicommand']]){_0x30a296=_0x13778d[_0x35fb9d['agicommand']](_0x35fb9d);if(_0x30a296){logger['debug'](_0x12e6('0x48'),getLogFromObject(_0x30a296));return _['isUndefined'](_0x30a296['result'])?null:_0x30a296[_0x12e6('0x4a')][_0x12e6('0x4b')]();}else{logger[_0x12e6('0xe')](_0x12e6('0x48'),getLogFromObject(_0x30a296));return null;}}else{logger[_0x12e6('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x56221b){logger[_0x12e6('0xe')](_0x56221b[_0x12e6('0xf')]);return null;}});}logger['info'](util[_0x12e6('0x12')](_0x12e6('0x51'),_0x3883a3['arg_1'],_0x3883a3[_0x12e6('0x1b')],_0x3883a3[_0x12e6('0x1c')],_0x3883a3[_0x12e6('0x1d')],_0x3883a3[_0x12e6('0x1e')]));logger[_0x12e6('0x18')](util[_0x12e6('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3883a3['context'],_0x3883a3[_0x12e6('0x46')],parseInt(_0x3883a3[_0x12e6('0x47')],0xa)+0x1));_0x3883a3[_0x12e6('0x52')](_0x3883a3[_0x12e6('0x45')],_0x3883a3[_0x12e6('0x46')],parseInt(_0x3883a3[_0x12e6('0x47')],0xa)+0x1);_0x3883a3[_0x12e6('0x39')]();}}else{logger[_0x12e6('0xe')](util[_0x12e6('0x12')](_0x12e6('0x53'),_0x3883a3[_0x12e6('0x1a')]));_0x3883a3[_0x12e6('0x52')](_0x3883a3[_0x12e6('0x45')],_0x3883a3[_0x12e6('0x46')],parseInt(_0x3883a3[_0x12e6('0x47')],0xa)+0x1);_0x3883a3[_0x12e6('0x39')]();}}else{logger[_0x12e6('0xe')](util[_0x12e6('0x12')]('Project\x20%s\x20not\x20found',_0x3883a3[_0x12e6('0x1a')]));_0x3883a3[_0x12e6('0x52')](_0x3883a3['context'],_0x3883a3[_0x12e6('0x46')],parseInt(_0x3883a3[_0x12e6('0x47')],0xa)+0x1);_0x3883a3['close']();}}function main(){var _0x24b271;return utilLicense[_0x12e6('0x54')]()[_0x12e6('0x2f')](function(_0x13802b){if(_0x13802b){if(_0x13802b[_0x12e6('0x55')]){if(_0x13802b['callysquare']&&_0x13802b['callysquare']>0x0){logger['info'](util[_0x12e6('0x12')](_0x12e6('0x56'),_0x13802b[_0x12e6('0x57')]));_0x24b271=_0x13802b[_0x12e6('0x57')];}else{logger[_0x12e6('0x18')](_0x12e6('0x58'));}}else{logger[_0x12e6('0x18')](_0x12e6('0x59'));_0x24b271=-0x1;}}})[_0x12e6('0x30')](function(_0x2e7c09){logger[_0x12e6('0xe')](_0x12e6('0x5a'),_0x2e7c09[_0x12e6('0xf')]);})[_0x12e6('0x4d')](function(){var _0x85425e=require(_0x12e6('0x5b'))(config[_0x12e6('0x6')]['port'],config['agi']['ip'],_0x24b271);_0x85425e['on']('error',errorHandler);_0x85425e['on'](_0x12e6('0x5c'),listeningHandler);_0x85425e['on'](_0x12e6('0x5d'),connectionHandler);_0x85425e['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index d710fb5..8623c93 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 _0x7192=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result','sendMailMessage'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x7192,0xfe));var _0x2719=function(_0x56547d,_0x5167fe){_0x56547d=_0x56547d-0x0;var _0x482f80=_0x7192[_0x56547d];return _0x482f80;};'use strict';var BPromise=require(_0x2719('0x0'));var jayson=require(_0x2719('0x1'));var client=jayson[_0x2719('0x2')][_0x2719('0x3')]({'port':0x232b});function request(_0x150cf7,_0x3c7219){return new BPromise(function(_0x42e6e9,_0x35fd2b){return client[_0x2719('0x4')](_0x150cf7,_0x3c7219)[_0x2719('0x5')](function(_0x123061){if(_0x123061[_0x2719('0x6')]){return _0x35fd2b(_0x123061[_0x2719('0x6')][_0x2719('0x7')]);}else{return _0x42e6e9(_0x123061[_0x2719('0x8')]);}})['catch'](function(_0x234008){return _0x35fd2b(_0x234008);});});}exports[_0x2719('0x9')]=function(_0x2ec708,_0x57dc9b){return request(_0x2719('0xa'),{'account':_0x2ec708,'message':_0x57dc9b});}; \ No newline at end of file +var _0x34db=['client','request','then','error','result','SendMail','bluebird','jayson/promise'];(function(_0x4dbeaa,_0x3fb85d){var _0x889e79=function(_0x737998){while(--_0x737998){_0x4dbeaa['push'](_0x4dbeaa['shift']());}};_0x889e79(++_0x3fb85d);}(_0x34db,0x1c6));var _0xb34d=function(_0x5e1e57,_0x39711c){_0x5e1e57=_0x5e1e57-0x0;var _0x44fba0=_0x34db[_0x5e1e57];return _0x44fba0;};'use strict';var BPromise=require(_0xb34d('0x0'));var jayson=require(_0xb34d('0x1'));var client=jayson[_0xb34d('0x2')]['http']({'port':0x232b});function request(_0x1f5e8b,_0x368073){return new BPromise(function(_0x50388c,_0x4c6bb3){return client[_0xb34d('0x3')](_0x1f5e8b,_0x368073)[_0xb34d('0x4')](function(_0x2f5dc2){if(_0x2f5dc2[_0xb34d('0x5')]){return _0x4c6bb3(_0x2f5dc2['error']['message']);}else{return _0x50388c(_0x2f5dc2[_0xb34d('0x6')]);}})['catch'](function(_0x571481){return _0x4c6bb3(_0x571481);});});}exports['sendMailMessage']=function(_0x1d74d2,_0xf2383){return request(_0xb34d('0x7'),{'account':_0x1d74d2,'message':_0xf2383});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b675b2a..1572207 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 _0x3830=['_transform','\x0d\x0a\x0d\x0a','toString','_inBody','substring','length','split','indexOf','slice','trim','headers','emit','line','exports','util','stream','Transform','_localBuffer','inherits','prototype'];(function(_0x4eee61,_0x48c4db){var _0x29a220=function(_0x26ba25){while(--_0x26ba25){_0x4eee61['push'](_0x4eee61['shift']());}};_0x29a220(++_0x48c4db);}(_0x3830,0x162));var _0x0383=function(_0x426f00,_0x4f7131){_0x426f00=_0x426f00-0x0;var _0x324a41=_0x3830[_0x426f00];return _0x324a41;};'use strict';var util=require(_0x0383('0x0'));var Transform=require(_0x0383('0x1'))[_0x0383('0x2')];function AGIReply(_0x51263d){Transform['call'](this,_0x51263d);this[_0x0383('0x3')]='';this['_inBody']=![];}util[_0x0383('0x4')](AGIReply,Transform);AGIReply[_0x0383('0x5')][_0x0383('0x6')]=function(_0x3c0070,_0x2d6282,_0x4ee47c){var _0x2020dc='\x0a',_0x5806a6=['\x0a\x0a',_0x0383('0x7')],_0x543359=-0x1,_0xcd89b0=-0x1,_0x118a53='',_0x1286a1=0x0,_0x464d18='',_0x32756f='';this[_0x0383('0x3')]+=_0x3c0070[_0x0383('0x8')]();_0x464d18=this[_0x0383('0x3')];if(!this[_0x0383('0x9')]){_0x1286a1=0x0;while(_0x5806a6[_0x1286a1]){while((_0xcd89b0=_0x464d18['indexOf'](_0x5806a6[_0x1286a1]))!=-0x1){_0x118a53=_0x5806a6[_0x1286a1];_0x32756f=_0x464d18['substring'](0x0,_0xcd89b0);_0x464d18=_0x464d18[_0x0383('0xa')](_0xcd89b0+_0x118a53[_0x0383('0xb')]);var _0x31fdc1=_0x32756f[_0x0383('0xc')](_0x2020dc),_0x594551=0x0,_0x547ca2={},_0x3671d3='',_0x1f5e23='',_0xcd1fb8=-0x1;while(_0x31fdc1[_0x594551]){_0xcd1fb8=_0x31fdc1[_0x594551][_0x0383('0xd')](':');if(_0xcd1fb8!=-0x1){_0x3671d3=_0x31fdc1[_0x594551][_0x0383('0xe')](0x0,_0xcd1fb8)[_0x0383('0xf')]();_0x1f5e23=_0x31fdc1[_0x594551][_0x0383('0xe')](_0xcd1fb8+0x1)[_0x0383('0xf')]();if(_0x3671d3[_0x0383('0xb')]>0x0){_0x547ca2[_0x3671d3]=_0x1f5e23;}}else{}_0x594551++;}this['emit'](_0x0383('0x10'),_0x547ca2);this[_0x0383('0x9')]=!![];}_0x1286a1++;}this[_0x0383('0x3')]=_0x464d18;}else{while((_0x543359=_0x464d18[_0x0383('0xd')](_0x2020dc))!=-0x1){_0x32756f=_0x464d18[_0x0383('0xa')](0x0,_0x543359);this[_0x0383('0x11')](_0x0383('0x12'),_0x32756f);_0x464d18=_0x464d18[_0x0383('0xa')](_0x543359+_0x2020dc[_0x0383('0xb')]);}this['_localBuffer']=_0x464d18;}_0x4ee47c();};module[_0x0383('0x13')]=AGIReply; \ No newline at end of file +var _0x4e86=['inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','emit','headers','_inBody','line','util','stream','Transform','call','_localBuffer'];(function(_0x50b070,_0x30126f){var _0x8b27ed=function(_0x5dbd3c){while(--_0x5dbd3c){_0x50b070['push'](_0x50b070['shift']());}};_0x8b27ed(++_0x30126f);}(_0x4e86,0x109));var _0x64e8=function(_0x25d2c7,_0x1f6740){_0x25d2c7=_0x25d2c7-0x0;var _0x5082dc=_0x4e86[_0x25d2c7];return _0x5082dc;};'use strict';var util=require(_0x64e8('0x0'));var Transform=require(_0x64e8('0x1'))[_0x64e8('0x2')];function AGIReply(_0x53dd26){Transform[_0x64e8('0x3')](this,_0x53dd26);this[_0x64e8('0x4')]='';this['_inBody']=![];}util[_0x64e8('0x5')](AGIReply,Transform);AGIReply[_0x64e8('0x6')]['_transform']=function(_0x93865d,_0x419e4d,_0xb7a6e4){var _0x4e9668='\x0a',_0x35c4f8=['\x0a\x0a',_0x64e8('0x7')],_0x403cb5=-0x1,_0x2e7866=-0x1,_0x294330='',_0x3e5108=0x0,_0x373113='',_0x304bb8='';this[_0x64e8('0x4')]+=_0x93865d[_0x64e8('0x8')]();_0x373113=this[_0x64e8('0x4')];if(!this['_inBody']){_0x3e5108=0x0;while(_0x35c4f8[_0x3e5108]){while((_0x2e7866=_0x373113[_0x64e8('0x9')](_0x35c4f8[_0x3e5108]))!=-0x1){_0x294330=_0x35c4f8[_0x3e5108];_0x304bb8=_0x373113['substring'](0x0,_0x2e7866);_0x373113=_0x373113[_0x64e8('0xa')](_0x2e7866+_0x294330[_0x64e8('0xb')]);var _0xc5d2a2=_0x304bb8[_0x64e8('0xc')](_0x4e9668),_0x8cf276=0x0,_0x5ed8eb={},_0x3c9837='',_0x33bc56='',_0x30dcab=-0x1;while(_0xc5d2a2[_0x8cf276]){_0x30dcab=_0xc5d2a2[_0x8cf276][_0x64e8('0x9')](':');if(_0x30dcab!=-0x1){_0x3c9837=_0xc5d2a2[_0x8cf276]['slice'](0x0,_0x30dcab)['trim']();_0x33bc56=_0xc5d2a2[_0x8cf276]['slice'](_0x30dcab+0x1)[_0x64e8('0xd')]();if(_0x3c9837['length']>0x0){_0x5ed8eb[_0x3c9837]=_0x33bc56;}}else{}_0x8cf276++;}this[_0x64e8('0xe')](_0x64e8('0xf'),_0x5ed8eb);this[_0x64e8('0x10')]=!![];}_0x3e5108++;}this[_0x64e8('0x4')]=_0x373113;}else{while((_0x403cb5=_0x373113['indexOf'](_0x4e9668))!=-0x1){_0x304bb8=_0x373113['substring'](0x0,_0x403cb5);this[_0x64e8('0xe')](_0x64e8('0x11'),_0x304bb8);_0x373113=_0x373113[_0x64e8('0xa')](_0x403cb5+_0x4e9668[_0x64e8('0xb')]);}this[_0x64e8('0x4')]=_0x373113;}_0xb7a6e4();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 6002734..a439cb8 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 _0xbac4=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getTrunkById','getSoundById','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','then','ShowPause','agentLogin','LoginUser','agentPause','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','client','http','request','error','message','result','catch','ShowSquareProject','production'];(function(_0x5cf132,_0x3b3804){var _0x202bd4=function(_0x161f9a){while(--_0x161f9a){_0x5cf132['push'](_0x5cf132['shift']());}};_0x202bd4(++_0x3b3804);}(_0xbac4,0xcf));var _0x4bac=function(_0x48b2c7,_0x2f901e){_0x48b2c7=_0x48b2c7-0x0;var _0x11d205=_0xbac4[_0x48b2c7];return _0x11d205;};'use strict';var BPromise=require('bluebird');var moment=require(_0x4bac('0x0'));var _=require(_0x4bac('0x1'));var util=require(_0x4bac('0x2'));var jayson=require(_0x4bac('0x3'));var client=jayson[_0x4bac('0x4')][_0x4bac('0x5')]({'port':0x2329});function request(_0x4954dc,_0x363bb3){return new BPromise(function(_0x1be239,_0x2e4ac7){return client[_0x4bac('0x6')](_0x4954dc,_0x363bb3)['then'](function(_0x3460a2){if(_0x3460a2[_0x4bac('0x7')]){return _0x2e4ac7(_0x3460a2[_0x4bac('0x7')][_0x4bac('0x8')]);}else{return _0x1be239(_0x3460a2[_0x4bac('0x9')]);}})[_0x4bac('0xa')](function(_0x20d87a){return _0x2e4ac7(_0x20d87a);});});}exports['getSquareProject']=function(_0x1087ef){return request(_0x4bac('0xb'),{'options':{'raw':![],'where':{'name':_0x1087ef},'attributes':[_0x4bac('0xc')]}});};exports[_0x4bac('0xd')]=function(_0x2f99df){return request(_0x4bac('0xe'),{'options':{'raw':![],'where':{'id':_0x2f99df},'include':[{'model':_0x4bac('0xf'),'as':_0x4bac('0x10')}],'attributes':['id','name',_0x4bac('0x11')]}});};exports[_0x4bac('0x12')]=function(_0xe57d85){return request(_0x4bac('0xb'),{'options':{'where':{'id':_0xe57d85},'attributes':[_0x4bac('0x13')]}});};exports[_0x4bac('0x14')]=function(_0x415a43){return request(_0x4bac('0x15'),{'options':{'where':{'id':_0x415a43},'attributes':[_0x4bac('0x13')]}});};exports[_0x4bac('0x16')]=function(_0x1ea761){return request(_0x4bac('0x17'),{'options':{'where':{'id':_0x1ea761},'attributes':['name']}});};exports[_0x4bac('0x18')]=function(_0x3b1ecb){return request(_0x4bac('0x19'),{'options':{'where':{'id':_0x3b1ecb},'attributes':['dsn']}});};exports['getUserById']=function(_0x2a94b7){return request(_0x4bac('0x1a'),{'options':{'where':{'id':_0x2a94b7},'attributes':[_0x4bac('0x13')]}});};exports[_0x4bac('0x1b')]=function(_0x529439){return request('ShowTrunk',{'options':{'where':{'id':_0x529439},'attributes':[_0x4bac('0x13')]}});};exports[_0x4bac('0x1c')]=function(_0x4eebf4){return request(_0x4bac('0x1d'),{'options':{'where':{'id':_0x4eebf4},'attributes':['save_name']}});};exports[_0x4bac('0x1e')]=function(_0x4f2f77){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4f2f77},'include':[{'model':_0x4bac('0x1f'),'as':_0x4bac('0x20')}]}});};exports[_0x4bac('0x21')]=function(_0x409b62){return request(_0x4bac('0x22'),{'options':{'where':{'id':_0x409b62},'attributes':['id','name']}});};exports[_0x4bac('0x23')]=function(_0xdffd86){return request(_0x4bac('0x24'),{'body':_0xdffd86});};exports['createSquareDetailsReport']=function(_0x20b659){return request(_0x4bac('0x25'),{'body':_0x20b659});};exports[_0x4bac('0x26')]=function(_0x3b5edf){return request(_0x4bac('0x27'),{'body':_['merge'](_0x3b5edf,{'project_name':_0x3b5edf[_0x4bac('0x28')],'prev_project_name':_0x3b5edf[_0x4bac('0x29')]||'','is_subproject':_0x3b5edf[_0x4bac('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x4bac('0x2a'))})});};exports['createSquareRecording']=function(_0x4ae641){return request(_0x4bac('0x2b'),{'body':_0x4ae641});};exports[_0x4bac('0x2c')]=function(_0x12e467){return request('CreateSquareMessage',{'body':_0x12e467});};exports[_0x4bac('0x2d')]=function(_0x370330){return request(_0x4bac('0x2e'),{'options':{'raw':![],'where':{'phone':_0x370330['phone'],'ListId':_0x370330[_0x4bac('0x2f')]}}})[_0x4bac('0x30')](function(_0x399318){if(_0x399318){return _0x399318;}return request('CreateCmContact',{'body':_0x370330});});};exports['getPauseById']=function(_0x36662b){return request(_0x4bac('0x31'),{'options':{'where':{'id':_0x36662b},'attributes':['name']}});};exports[_0x4bac('0x32')]=function(_0x4394a7,_0x41d253){return request(_0x4bac('0x33'),{'body':{'interface':_0x41d253},'options':{'where':_0x4394a7}});};exports[_0x4bac('0x34')]=function(_0x217e59,_0x3fdb9f,_0x185cc8){return request('PauseUser',{'body':{'type':_0x3fdb9f,'uniqueid':_0x185cc8},'options':{'where':_0x217e59}});};exports['agentUnpause']=function(_0x39f95a){return request('UnpauseUser',{'body':{},'options':{'where':_0x39f95a}});};exports[_0x4bac('0x35')]=function(_0x56d82b){return request(_0x4bac('0x36'),{'body':{},'options':{'where':_0x56d82b}});}; \ No newline at end of file +var _0x25bb=['ShowVariable','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','ShowPause','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','lodash','util','jayson/promise','client','http','error','message','result','catch','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowSquareProject','ShowVoiceQueue','getVariableById'];(function(_0x498a7e,_0xcc9e84){var _0x5e50cf=function(_0x14f673){while(--_0x14f673){_0x498a7e['push'](_0x498a7e['shift']());}};_0x5e50cf(++_0xcc9e84);}(_0x25bb,0x1db));var _0xb25b=function(_0x54af50,_0x505414){_0x54af50=_0x54af50-0x0;var _0x4f8a5f=_0x25bb[_0x54af50];return _0x4f8a5f;};'use strict';var BPromise=require(_0xb25b('0x0'));var moment=require('moment');var _=require(_0xb25b('0x1'));var util=require(_0xb25b('0x2'));var jayson=require(_0xb25b('0x3'));var client=jayson[_0xb25b('0x4')][_0xb25b('0x5')]({'port':0x2329});function request(_0x4dde8b,_0x483b08){return new BPromise(function(_0x59d3c4,_0x243344){return client['request'](_0x4dde8b,_0x483b08)['then'](function(_0x19c292){if(_0x19c292['error']){return _0x243344(_0x19c292[_0xb25b('0x6')][_0xb25b('0x7')]);}else{return _0x59d3c4(_0x19c292[_0xb25b('0x8')]);}})[_0xb25b('0x9')](function(_0x17718b){return _0x243344(_0x17718b);});});}exports[_0xb25b('0xa')]=function(_0x2b154f){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2b154f},'attributes':['production']}});};exports[_0xb25b('0xb')]=function(_0x5ed357){return request(_0xb25b('0xc'),{'options':{'raw':![],'where':{'id':_0x5ed357},'include':[{'model':_0xb25b('0xd'),'as':_0xb25b('0xe')}],'attributes':['id',_0xb25b('0xf'),_0xb25b('0x10')]}});};exports['getSquareProjectById']=function(_0x58d23e){return request(_0xb25b('0x11'),{'options':{'where':{'id':_0x58d23e},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x43eef4){return request(_0xb25b('0x12'),{'options':{'where':{'id':_0x43eef4},'attributes':['name']}});};exports[_0xb25b('0x13')]=function(_0x83ced4){return request(_0xb25b('0x14'),{'options':{'where':{'id':_0x83ced4},'attributes':[_0xb25b('0xf')]}});};exports['getSquareOdbcById']=function(_0x265683){return request(_0xb25b('0x15'),{'options':{'where':{'id':_0x265683},'attributes':[_0xb25b('0x16')]}});};exports[_0xb25b('0x17')]=function(_0x2319d4){return request('ShowUser',{'options':{'where':{'id':_0x2319d4},'attributes':[_0xb25b('0xf')]}});};exports[_0xb25b('0x18')]=function(_0x548a5a){return request(_0xb25b('0x19'),{'options':{'where':{'id':_0x548a5a},'attributes':[_0xb25b('0xf')]}});};exports[_0xb25b('0x1a')]=function(_0x4dcb8a){return request(_0xb25b('0x1b'),{'options':{'where':{'id':_0x4dcb8a},'attributes':[_0xb25b('0x1c')]}});};exports[_0xb25b('0x1d')]=function(_0x3c3dc6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3c3dc6},'include':[{'model':'Interval','as':_0xb25b('0x1e')}]}});};exports[_0xb25b('0x1f')]=function(_0x277698){return request(_0xb25b('0x20'),{'options':{'where':{'id':_0x277698},'attributes':['id',_0xb25b('0xf')]}});};exports[_0xb25b('0x21')]=function(_0x411737){return request(_0xb25b('0x22'),{'body':_0x411737});};exports[_0xb25b('0x23')]=function(_0x489128){return request(_0xb25b('0x24'),{'body':_0x489128});};exports['createSquareReport']=function(_0x4c106c){return request('CreateSquareReport',{'body':_[_0xb25b('0x25')](_0x4c106c,{'project_name':_0x4c106c[_0xb25b('0x26')],'prev_project_name':_0x4c106c['arg_2']||'','is_subproject':_0x4c106c[_0xb25b('0x27')]?!![]:![],'leaveAt':moment()[_0xb25b('0x28')](_0xb25b('0x29'))})});};exports['createSquareRecording']=function(_0x4e701f){return request(_0xb25b('0x2a'),{'body':_0x4e701f});};exports[_0xb25b('0x2b')]=function(_0x24ebba){return request(_0xb25b('0x2c'),{'body':_0x24ebba});};exports['createCmContact']=function(_0x3f9bdb){return request(_0xb25b('0x2d'),{'options':{'raw':![],'where':{'phone':_0x3f9bdb[_0xb25b('0x2e')],'ListId':_0x3f9bdb[_0xb25b('0x2f')]}}})[_0xb25b('0x30')](function(_0xeab887){if(_0xeab887){return _0xeab887;}return request('CreateCmContact',{'body':_0x3f9bdb});});};exports['getPauseById']=function(_0x5303ed){return request(_0xb25b('0x31'),{'options':{'where':{'id':_0x5303ed},'attributes':[_0xb25b('0xf')]}});};exports['agentLogin']=function(_0x42c3aa,_0x4f5033){return request(_0xb25b('0x32'),{'body':{'interface':_0x4f5033},'options':{'where':_0x42c3aa}});};exports['agentPause']=function(_0x1d9783,_0xdc695b,_0x173c07){return request(_0xb25b('0x33'),{'body':{'type':_0xdc695b,'uniqueid':_0x173c07},'options':{'where':_0x1d9783}});};exports[_0xb25b('0x34')]=function(_0x1d89db){return request(_0xb25b('0x35'),{'body':{},'options':{'where':_0x1d89db}});};exports[_0xb25b('0x36')]=function(_0x5d97ad){return request('LogoutUser',{'body':{},'options':{'where':_0x5d97ad}});}; \ 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 a488144..47cd4c7 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 _0x49df=['exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x49df,0xad));var _0xf49d=function(_0x57411a,_0x59328f){_0x57411a=_0x57411a-0x0;var _0xd487ba=_0x49df[_0x57411a];return _0xd487ba;};var polly=require('./polly');var lex=require('./lex');module[_0xf49d('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x02ca=['exports','./polly'];(function(_0x210bd9,_0x3d5bfc){var _0x2c32bf=function(_0x203b92){while(--_0x203b92){_0x210bd9['push'](_0x210bd9['shift']());}};_0x2c32bf(++_0x3d5bfc);}(_0x02ca,0x97));var _0xa02c=function(_0x4f17cf,_0x41b2d3){_0x4f17cf=_0x4f17cf-0x0;var _0x1f1e95=_0x02ca[_0x4f17cf];return _0x1f1e95;};var polly=require(_0xa02c('0x0'));var lex=require('./lex');module[_0xa02c('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 139e714..c29c3b8 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 _0xf109=['./lib/api','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf109,0xce));var _0x9f10=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xf109[_0x2e4e19];return _0x9ba20b;};'use strict';var lex=require(_0x9f10('0x0'));module[_0x9f10('0x1')]=function(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517){return lex(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517);}; \ No newline at end of file +var _0x6f7a=['./lib/api','exports'];(function(_0x153a1f,_0x41e84c){var _0x252668=function(_0x1f551a){while(--_0x1f551a){_0x153a1f['push'](_0x153a1f['shift']());}};_0x252668(++_0x41e84c);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x47da95,_0x5b495){_0x47da95=_0x47da95-0x0;var _0x5b3895=_0x6f7a[_0x47da95];return _0x5b3895;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 3af180f..ebb1005 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(_0x217ea8,_0x3f4460){var _0x37a95c=function(_0x594d46){while(--_0x594d46){_0x217ea8['push'](_0x217ea8['shift']());}};_0x37a95c(++_0x3f4460);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x515646,_0x29ca22){var _0x154cbd=function(_0x5c56e4){while(--_0x5c56e4){_0x515646['push'](_0x515646['shift']());}};_0x154cbd(++_0x29ca22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 52515ad..efca793 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 _0x8c8f=['./lib/api','exports'];(function(_0x3252b1,_0x54e32d){var _0x5f189d=function(_0x57e83a){while(--_0x57e83a){_0x3252b1['push'](_0x3252b1['shift']());}};_0x5f189d(++_0x54e32d);}(_0x8c8f,0xbe));var _0xf8c8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x8c8f[_0x243b59];return _0x3e1676;};'use strict';var polly=require(_0xf8c8('0x0'));module[_0xf8c8('0x1')]=function(_0xdc147d,_0x257970,_0x3c13fc,_0x473689,_0x8c0208,_0x2fcb81,_0x5415de){return polly(_0xdc147d,_0x257970,_0x3c13fc,_0x473689,_0x8c0208,_0x2fcb81,_0x5415de);}; \ No newline at end of file +var _0xf5cd=['./lib/api'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0xf5cd,0xa4));var _0xdf5c=function(_0x90d1ea,_0x217e6f){_0x90d1ea=_0x90d1ea-0x0;var _0x50ab65=_0xf5cd[_0x90d1ea];return _0x50ab65;};'use strict';var polly=require(_0xdf5c('0x0'));module['exports']=function(_0x36d7fb,_0xaf0c9c,_0x13a0c1,_0x343887,_0x30135f,_0x4d4e4e,_0x1aa657){return polly(_0x36d7fb,_0xaf0c9c,_0x13a0c1,_0x343887,_0x30135f,_0x4d4e4e,_0x1aa657);}; \ 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 e5f66c5..1e9f9ef 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 _0xbef5=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x20439e,_0x2c7c66){var _0x4a1d5f=function(_0x19b688){while(--_0x19b688){_0x20439e['push'](_0x20439e['shift']());}};_0x4a1d5f(++_0x2c7c66);}(_0xbef5,0x67));var _0x5bef=function(_0x5da6d5,_0x2b8a38){_0x5da6d5=_0x5da6d5-0x0;var _0x3d163d=_0xbef5[_0x5da6d5];return _0x3d163d;};'use strict';var fs=require('fs');var path=require(_0x5bef('0x0'));var BPromise=require(_0x5bef('0x1'));var rs=require(_0x5bef('0x2'));var AWS=require(_0x5bef('0x3'));function pollyResult(_0x4ea37a,_0x23860e,_0x45f3da){return new BPromise(function(_0x5624ec,_0x2368d0){_0x4ea37a[_0x5bef('0x4')](_0x23860e,function(_0x31da3f,_0xaa3c88){if(_0x31da3f){_0x2368d0(_0x31da3f);}else if(_0xaa3c88){if(_0xaa3c88[_0x5bef('0x5')]instanceof Buffer){fs['writeFile'](_0x45f3da,_0xaa3c88['AudioStream'],function(_0x2084c3){if(_0x2084c3){_0x2368d0(_0x2084c3);}else{_0x5624ec();}});}else{_0x2368d0(new Error(_0x5bef('0x6')));}}else{_0x2368d0(new Error(_0x5bef('0x7')));}});});}module[_0x5bef('0x8')]=function(_0x5b5d25,_0x10123b,_0x1d4015,_0x171499,_0x576dc7,_0x27dcf2,_0x57d973){var _0x25c601=new AWS['Polly']({'accessKeyId':_0x5b5d25,'secretAccessKey':_0x10123b,'region':_0x1d4015});var _0x4c2c09={'Text':_0x576dc7,'TextType':_0x27dcf2||_0x5bef('0x9'),'OutputFormat':_0x5bef('0xa'),'VoiceId':_0x171499};return pollyResult(_0x25c601,_0x4c2c09,_0x57d973);}; \ No newline at end of file +var _0x1c63=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c63,0x153));var _0x31c6=function(_0x7d9c0d,_0x165295){_0x7d9c0d=_0x7d9c0d-0x0;var _0x26a3c7=_0x1c63[_0x7d9c0d];return _0x26a3c7;};'use strict';var fs=require('fs');var path=require(_0x31c6('0x0'));var BPromise=require(_0x31c6('0x1'));var rs=require('randomstring');var AWS=require(_0x31c6('0x2'));function pollyResult(_0x4f2e63,_0x22632f,_0x4377bf){return new BPromise(function(_0x41cf43,_0xce1630){_0x4f2e63[_0x31c6('0x3')](_0x22632f,function(_0x19c47e,_0x17267f){if(_0x19c47e){_0xce1630(_0x19c47e);}else if(_0x17267f){if(_0x17267f[_0x31c6('0x4')]instanceof Buffer){fs['writeFile'](_0x4377bf,_0x17267f[_0x31c6('0x4')],function(_0x2040f8){if(_0x2040f8){_0xce1630(_0x2040f8);}else{_0x41cf43();}});}else{_0xce1630(new Error(_0x31c6('0x5')));}}else{_0xce1630(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x31c6('0x6')]=function(_0x2b5a3c,_0x297f06,_0x1f68c6,_0x5d41ee,_0x54775f,_0x25fd8a,_0x14ee8e){var _0x2dceac=new AWS[(_0x31c6('0x7'))]({'accessKeyId':_0x2b5a3c,'secretAccessKey':_0x297f06,'region':_0x1f68c6});var _0x27f720={'Text':_0x54775f,'TextType':_0x25fd8a||'text','OutputFormat':'mp3','VoiceId':_0x5d41ee};return pollyResult(_0x2dceac,_0x27f720,_0x14ee8e);}; \ 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 9d897d6..fac9824 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 _0xd86b=['exports'];(function(_0x34cedb,_0x111a2c){var _0x5965f3=function(_0x18a3f4){while(--_0x18a3f4){_0x34cedb['push'](_0x34cedb['shift']());}};_0x5965f3(++_0x111a2c);}(_0xd86b,0x17a));var _0xbd86=function(_0x2bb452,_0x2dbbc0){_0x2bb452=_0x2bb452-0x0;var _0x5f50a6=_0xd86b[_0x2bb452];return _0x5f50a6;};'use strict';var asr=require('./lib/api');module[_0xbd86('0x0')]=function(_0x494726,_0x3a0b0f,_0x5326fe,_0x4b87a3){return asr(_0x494726,_0x3a0b0f,_0x5326fe);}; \ No newline at end of file +var _0x2096=['exports','./lib/api'];(function(_0x5ea6ba,_0x59c423){var _0x5efc4c=function(_0x430527){while(--_0x430527){_0x5ea6ba['push'](_0x5ea6ba['shift']());}};_0x5efc4c(++_0x59c423);}(_0x2096,0x12f));var _0x6209=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x2096[_0x4fbfd9];return _0x31dc94;};'use strict';var asr=require(_0x6209('0x0'));module[_0x6209('0x1')]=function(_0x4c665b,_0x38ca8b,_0x12095c,_0x9647c5){return asr(_0x4c665b,_0x38ca8b,_0x12095c);}; \ 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 de4c273..90256a4 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 _0xc1c4=['url','bluebird','https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x551f8c,_0x3a13d3){_0x551f8c=_0x551f8c-0x0;var _0x440c5c=_0xc1c4[_0x551f8c];return _0x440c5c;};'use strict';var url=require(_0x4c1c('0x0'));var BPromise=require(_0x4c1c('0x1'));var fs=require('fs');var host=_0x4c1c('0x2');module[_0x4c1c('0x3')]=function(_0xf92045,_0x40fa5e,_0x22dbe8){return new BPromise(function(_0x5b8a39,_0x5c1e2c){var _0xf4ace6;if(typeof _0xf92045!==_0x4c1c('0x4')||_0xf92045[_0x4c1c('0x5')]===0x0){return _0x5c1e2c('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x40fa5e!==_0x4c1c('0x4')||_0x40fa5e['length']===0x0){return _0x5c1e2c('key\x20should\x20be\x20a\x20string');}if(typeof _0x22dbe8!==_0x4c1c('0x6')&&(typeof _0x22dbe8!==_0x4c1c('0x4')||_0x22dbe8['length']===0x0)){return _0x5c1e2c(_0x4c1c('0x7'));}try{_0xf4ace6=fs[_0x4c1c('0x8')](_0xf92045)[_0x4c1c('0x9')](_0x4c1c('0xa'));}catch(_0x1ac32d){return _0x5c1e2c(_0x1ac32d);}return _0x5b8a39({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x40fa5e,'body':{'config':{'encoding':_0x4c1c('0xb'),'sampleRateHertz':_0x4c1c('0xc'),'languageCode':_0x22dbe8},'audio':{'content':_0xf4ace6}},'json':!![]});});}; \ No newline at end of file +var _0x750a=['/v1/speech:recognize?key=','bluebird','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST'];(function(_0x3c7951,_0x13cb40){var _0x18dda7=function(_0x38e3e2){while(--_0x38e3e2){_0x3c7951['push'](_0x3c7951['shift']());}};_0x18dda7(++_0x13cb40);}(_0x750a,0x140));var _0xa750=function(_0x42adca,_0x28efe1){_0x42adca=_0x42adca-0x0;var _0x1c61b9=_0x750a[_0x42adca];return _0x1c61b9;};'use strict';var url=require('url');var BPromise=require(_0xa750('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x139fa5,_0xeb020d,_0x1b459c){return new BPromise(function(_0x19bd5f,_0x457cae){var _0x43d704;if(typeof _0x139fa5!==_0xa750('0x1')||_0x139fa5[_0xa750('0x2')]===0x0){return _0x457cae(_0xa750('0x3'));}if(typeof _0xeb020d!==_0xa750('0x1')||_0xeb020d[_0xa750('0x2')]===0x0){return _0x457cae(_0xa750('0x4'));}if(typeof _0x1b459c!==_0xa750('0x5')&&(typeof _0x1b459c!=='string'||_0x1b459c['length']===0x0)){return _0x457cae(_0xa750('0x6'));}try{_0x43d704=fs['readFileSync'](_0x139fa5)[_0xa750('0x7')](_0xa750('0x8'));}catch(_0x51f594){return _0x457cae(_0x51f594);}return _0x19bd5f({'method':_0xa750('0x9'),'uri':host+_0xa750('0xa')+_0xeb020d,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1b459c},'audio':{'content':_0x43d704}},'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 c95c8eb..675bea2 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 _0xd7d4=['./asr'];(function(_0x17a501,_0xb84f85){var _0x4ed303=function(_0x3f3644){while(--_0x3f3644){_0x17a501['push'](_0x17a501['shift']());}};_0x4ed303(++_0xb84f85);}(_0xd7d4,0x15c));var _0x4d7d=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xd7d4[_0x307086];return _0x699043;};var asr=require(_0x4d7d('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x70f9=['exports'];(function(_0x73c629,_0x5d4a75){var _0x2633d3=function(_0x2cd51a){while(--_0x2cd51a){_0x73c629['push'](_0x73c629['shift']());}};_0x2633d3(++_0x5d4a75);}(_0x70f9,0x114));var _0x970f=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x70f9[_0x46d0c9];return _0x174506;};var asr=require('./asr');module[_0x970f('0x0')]={'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 fb6d055..7d219f8 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 _0x9f50=['path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','download\x20error','pipe','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','split','readFileSync','toString','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','data','goggleTTS\x20path','googleASR','uri','results','map','transcript','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','isFallbackIntent','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','queryText','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','https','md5'];(function(_0x551a1c,_0x1cec68){var _0x57f6e6=function(_0x274805){while(--_0x274805){_0x551a1c['push'](_0x551a1c['shift']());}};_0x57f6e6(++_0x1cec68);}(_0x9f50,0x84));var _0x09f5=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0x9f50[_0x2673a4];return _0x5e3a6a;};'use strict';var apiai=require(_0x09f5('0x0'));var BPromise=require(_0x09f5('0x1'));var dialogflow=require(_0x09f5('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x09f5('0x3'));var md5=require(_0x09f5('0x4'));var path=require(_0x09f5('0x5'));var querystring=require(_0x09f5('0x6'));var rp=require(_0x09f5('0x7'));var rs=require(_0x09f5('0x8'));var sox=require(_0x09f5('0x9'));var tts=require(_0x09f5('0xa'));var urlParse=require(_0x09f5('0xb'))[_0x09f5('0xc')];var util=require(_0x09f5('0xd'));var aws=require(_0x09f5('0xe'));var google=require('./google');var sestek=require(_0x09f5('0xf'));var tilde=require(_0x09f5('0x10'));var logger=require(_0x09f5('0x11'))(_0x09f5('0x12'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2f0dcd,_0x1c7e6b){return new BPromise(function(_0x30c497,_0x2afaee){var _0x11a4ea=urlParse(_0x2f0dcd);var _0x4ff5f1=_0x11a4ea[_0x09f5('0x13')]===_0x09f5('0x14')?https:http;var _0x2d5242={'host':_0x11a4ea[_0x09f5('0x15')],'path':_0x11a4ea[_0x09f5('0x5')],'headers':{'user-agent':_0x09f5('0x16')}};_0x4ff5f1[_0x09f5('0x17')](_0x2d5242,function(_0x314837){if(_0x314837[_0x09f5('0x18')]!==0xc8){logger[_0x09f5('0x19')]('request\x20to\x20'+_0x2f0dcd+_0x09f5('0x1a')+_0x314837[_0x09f5('0x18')]+'\x20('+_0x314837[_0x09f5('0x1b')]+')');_0x2afaee(new Error('request\x20to\x20'+_0x2f0dcd+'\x20failed,\x20status\x20code\x20=\x20'+_0x314837[_0x09f5('0x18')]+'\x20('+_0x314837['statusMessage']+')'));return;}var _0x5c1521=fs[_0x09f5('0x1c')](_0x1c7e6b);_0x5c1521['on']('finish',function(){logger[_0x09f5('0x1d')](_0x09f5('0x1e'));_0x5c1521[_0x09f5('0x1f')](_0x30c497);});_0x5c1521['on'](_0x09f5('0x19'),function(_0x4400d4){fs['unlink'](_0x1c7e6b);logger[_0x09f5('0x19')](_0x09f5('0x20'),_0x4400d4);_0x2afaee(_0x4400d4);});_0x314837[_0x09f5('0x21')](_0x5c1521);})['on']('error',function(_0x1197ab){logger[_0x09f5('0x19')](_0x1197ab);_0x2afaee(_0x1197ab);})[_0x09f5('0x22')]();});}function uploadFile(_0x10a416){return new BPromise(function(_0x325422,_0x5d2df9){var _0x1b3c50=urlParse(_0x10a416);var _0x3a2098=_0x1b3c50[_0x09f5('0x13')]===_0x09f5('0x14')?https:http;var _0x48c248={'host':_0x1b3c50[_0x09f5('0x15')],'path':_0x1b3c50['path'],'headers':{'user-agent':_0x09f5('0x16')}};_0x3a2098[_0x09f5('0x17')](_0x48c248,function(_0x2196b1){if(_0x2196b1[_0x09f5('0x18')]!==0xc8){_0x5d2df9(new Error('request\x20to\x20'+_0x10a416+_0x09f5('0x1a')+_0x2196b1['statusCode']+'\x20('+_0x2196b1['statusMessage']+')'));return;}var _0x857e0f='';_0x2196b1['on']('data',function(_0x5d4eb7){_0x857e0f+=_0x5d4eb7;});_0x2196b1['on']('end',function(){_0x325422(_0x857e0f);});})['on'](_0x09f5('0x19'),function(_0x2fe5f7){_0x5d2df9(_0x2fe5f7);})[_0x09f5('0x22')]();});}function convertFile(_0x3abb10,_0x1949f6){return new BPromise(function(_0x5c2d0e,_0x5ab28d){var _0x1a0fa4=sox[_0x09f5('0x23')](_0x3abb10,_0x1949f6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1a0fa4['on']('error',function(_0x4d9ba3){logger[_0x09f5('0x19')](_0x09f5('0x24'),_0x4d9ba3);_0x5ab28d(_0x4d9ba3);});_0x1a0fa4['on'](_0x09f5('0x22'),function(){logger[_0x09f5('0x1d')](_0x09f5('0x25'));_0x5c2d0e();});_0x1a0fa4[_0x09f5('0x26')]();});}function base64Decode(_0x40c939,_0x245d2e){var _0x57d2f4=path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs[_0x09f5('0x29')](0x4)+_0x09f5('0x2a'));fs[_0x09f5('0x2b')](_0x57d2f4,_0x40c939,_0x09f5('0x2c'));return convertFile(_0x57d2f4,_0x245d2e)[_0x09f5('0x2d')](function(){try{fs[_0x09f5('0x2e')](_0x57d2f4);fs[_0x09f5('0x2f')](_0x245d2e,'777');}catch(_0x4e9f00){logger[_0x09f5('0x19')](_0x4e9f00);}return _0x245d2e[_0x09f5('0x30')]('.')[0x0];});}function base64Encode(_0x25897f){var _0xafa2b8=fs[_0x09f5('0x31')](_0x25897f);return new Buffer(_0xafa2b8)[_0x09f5('0x32')](_0x09f5('0x2c'));}exports['googleCloudTTS']=function(_0x51eb1a,_0x34eb38,_0x418275,_0x5b10af,_0x3d7c09,_0x56b22a){var _0x4a281a,_0x368c36;var _0x35afc9='https://texttospeech.googleapis.com/v1/';var _0x578720='?key='+_0x51eb1a;var _0xda07b0={};if(_0x34eb38==='ssml'){_0xda07b0[_0x09f5('0x33')]={'ssml':_0x418275};}else{_0xda07b0[_0x09f5('0x33')]={'text':_0x418275};};_0xda07b0[_0x09f5('0x34')]={'languageCode':_0x5b10af,'ssmlGender':_0x3d7c09};_0xda07b0[_0x09f5('0x35')]={'audioEncoding':_0x09f5('0x36'),'sampleRateHertz':0x1f40};var _0x20509b={'url':_0x35afc9+_0x09f5('0x37')+_0x578720,'method':_0x09f5('0x38'),'json':!![],'body':_0xda07b0};return rp(_0x20509b)[_0x09f5('0x2d')](function(_0xa25f46){return new BPromise(function(_0x1a6604,_0x31ee68){_0x4a281a=path['resolve'](__dirname,'tmp',rs[_0x09f5('0x29')](0x4)+_0x09f5('0x39'));var _0x25d1ba=Buffer[_0x09f5('0x3a')](_0xa25f46[_0x09f5('0x3b')],_0x09f5('0x2c'));return fs[_0x09f5('0x3c')](_0x4a281a,_0x25d1ba,function(_0x5bfc7b){_0x31ee68(_0x5bfc7b);},function(_0x35a427){fs[_0x09f5('0x2f')](_0x4a281a,_0x09f5('0x3d'));_0x1a6604(_0x35a427);});});})['then'](function(_0x47fc32){_0x368c36=path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs[_0x09f5('0x29')](0x4)+'.wav');return convertFile(_0x4a281a,_0x368c36);})[_0x09f5('0x2d')](function(){try{fs[_0x09f5('0x2e')](_0x4a281a);fs[_0x09f5('0x2f')](_0x368c36,_0x09f5('0x3d'));}catch(_0x44e466){logger[_0x09f5('0x19')](_0x44e466);}logger[_0x09f5('0x1d')](_0x09f5('0x3e'),_0x368c36[_0x09f5('0x30')]('.')[0x0]);return _0x368c36[_0x09f5('0x30')]('.')[0x0];});};exports[_0x09f5('0x3f')]=function(_0x247a34,_0x400f21){var _0x16cfd4=_0x09f5('0x40');var _0x375ba5,_0x20dc24;var _0x3de412;var _0x4e7efe={'encoding':_0x09f5('0x41'),'method':'POST','timeout':0x2710,'url':_0x16cfd4,'headers':{'Content-Type':_0x09f5('0x42')},'body':_0x09f5('0x43')+encodeURIComponent(JSON[_0x09f5('0x44')]([[[_0x09f5('0x45'),JSON[_0x09f5('0x44')]([_0x247a34,_0x400f21||'en',![],_0x09f5('0x46')]),null,_0x09f5('0x47')]]]))};return rp(_0x4e7efe)[_0x09f5('0x2d')](function(_0x29cca5){try{_0x3de412=eval(_0x29cca5['slice'](0x5))[0x0][0x2];}catch(_0x410d11){throw new Error(_0x09f5('0x48')+_0x29cca5['data']);}if(!_0x3de412){if(_0x247a34[_0x09f5('0x49')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x09f5('0x4a')+_0x400f21+_0x09f5('0x4b'));}}try{_0x3de412=eval(_0x3de412)[0x0];}catch(_0x1f7a75){throw new Error(_0x09f5('0x48')+res[_0x09f5('0x4c')]);}const _0x30fb61=_0x3de412;_0x375ba5=path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs[_0x09f5('0x29')](0x4)+_0x09f5('0x39'));fs['writeFileSync'](_0x375ba5,_0x3de412,{'encoding':'base64'});_0x20dc24=path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs[_0x09f5('0x29')](0x4)+_0x09f5('0x2a'));return convertFile(_0x375ba5,_0x20dc24);})[_0x09f5('0x2d')](function(){try{fs['unlink'](_0x375ba5);fs[_0x09f5('0x2f')](_0x20dc24,'777');}catch(_0x369c3b){logger[_0x09f5('0x19')](_0x369c3b);}logger[_0x09f5('0x1d')](_0x09f5('0x4d'),_0x20dc24[_0x09f5('0x30')]('.')[0x0]);return _0x20dc24['split']('.')[0x0];});};exports[_0x09f5('0x4e')]=function(_0x117b1e,_0x6bceb6,_0x9ccad){return google['asr'](_0x117b1e,_0x6bceb6,_0x9ccad)[_0x09f5('0x2d')](function(_0x1460b7){logger[_0x09f5('0x1d')](_0x1460b7[_0x09f5('0x4f')]);return rp(_0x1460b7);})['then'](function(_0x471c70){var _0x3808a0='';var _0x44e16e=0x0;try{fs[_0x09f5('0x2e')](_0x117b1e);}catch(_0x5d02c2){logger[_0x09f5('0x19')](_0x5d02c2);}if(_0x471c70&&_0x471c70[_0x09f5('0x50')]){_0x3808a0=_0x471c70[_0x09f5('0x50')][_0x09f5('0x51')](function(_0x491caa){return _0x491caa&&_0x491caa['alternatives'][0x0]&&_0x491caa['alternatives'][0x0][_0x09f5('0x52')]?_0x491caa[_0x09f5('0x53')][0x0][_0x09f5('0x52')]:'';})[_0x09f5('0x54')]('\x0a');_0x44e16e=_0x471c70[_0x09f5('0x50')][_0x09f5('0x51')](function(_0x1822f2){return _0x1822f2&&_0x1822f2[_0x09f5('0x53')][0x0]&&_0x1822f2['alternatives'][0x0][_0x09f5('0x55')]?_0x1822f2[_0x09f5('0x53')][0x0][_0x09f5('0x55')]:0x0;})[_0x09f5('0x54')]('\x0a');}logger[_0x09f5('0x1d')](_0x09f5('0x56'),_0x3808a0);logger['info'](_0x09f5('0x57'),_0x44e16e);return{'transcript':_0x3808a0,'confidence':_0x44e16e};})[_0x09f5('0x58')](function(_0x26aff1){logger[_0x09f5('0x19')](_0x09f5('0x59'),_0x26aff1[_0x09f5('0x18')],_0x26aff1[_0x09f5('0x5a')],_0x26aff1[_0x09f5('0x5b')]);});};exports['googleDialogflow']=function(_0x5218ff,_0x2bd9e9,_0x19bfd5,_0x49a848){var _0x34f083=apiai(_0x2bd9e9,{'language':_0x49a848||'en'});return _0x34f083[_0x09f5('0x5c')](_0x19bfd5,{'sessionId':md5(_0x5218ff)})['then'](function(_0x1a0f7f){logger['info'](JSON[_0x09f5('0x44')](_0x1a0f7f));return{'source':_0x1a0f7f['result'][_0x09f5('0x5d')],'resolvedQuery':_0x1a0f7f[_0x09f5('0x5e')][_0x09f5('0x5f')],'action':_0x1a0f7f[_0x09f5('0x5e')][_0x09f5('0x60')],'actionIncomplete':_0x1a0f7f[_0x09f5('0x5e')][_0x09f5('0x61')],'speech':_0x1a0f7f[_0x09f5('0x5e')][_0x09f5('0x62')][_0x09f5('0x63')],'score':_0x1a0f7f[_0x09f5('0x5e')][_0x09f5('0x64')],'statusCode':_0x1a0f7f[_0x09f5('0x65')][_0x09f5('0x66')],'endConversation':_0x1a0f7f['result']['metadata'][_0x09f5('0x67')]||![],'isFallbackIntent':_0x1a0f7f['result'][_0x09f5('0x68')][_0x09f5('0x69')]};});};exports['googleDialogflowV2']=function(_0x36c546,_0x3a6a1e,_0x298b42,_0x5be46e,_0x3f47ff,_0xb37dc4){var _0x504420=_0x5be46e[_0x09f5('0x6a')](/\\n/g,'\x0a');var _0x461d3d={'credentials':{'private_key':_0x504420,'client_email':_0x298b42}};var _0x14034e=new dialogflow['SessionsClient'](_0x461d3d);var _0xa4894=_0x14034e[_0x09f5('0x6b')](_0x3a6a1e,md5(_0x36c546));var _0x849d9d={'session':_0xa4894,'queryInput':{'text':{'text':_0x3f47ff,'languageCode':_0xb37dc4}}};return _0x14034e['detectIntent'](_0x849d9d)[_0x09f5('0x2d')](function(_0xecc9ef){if(_0xecc9ef&&_0xecc9ef[_0x09f5('0x49')]){logger['info'](_0x09f5('0x6c'),JSON['stringify'](_0xecc9ef));var _0x4e3dcd=_0xecc9ef[0x0];if(_0x4e3dcd){var _0x1d8c15={'action':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x60')],'allRequiredParamsPresent':_0x4e3dcd['queryResult'][_0x09f5('0x6e')],'endConversation':_0x4e3dcd['queryResult'][_0x09f5('0x6f')]&&_0x4e3dcd['queryResult'][_0x09f5('0x6f')][_0x09f5('0x70')]?_0x4e3dcd['queryResult']['diagnosticInfo'][_0x09f5('0x70')][_0x09f5('0x71')]['boolValue']:![],'fulfillmentText':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x72')],'intentName':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x73')][_0x09f5('0x5a')],'intentDisplayName':_0x4e3dcd['queryResult'][_0x09f5('0x73')][_0x09f5('0x74')],'isFallbackIntent':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x73')][_0x09f5('0x75')],'languageCode':_0x4e3dcd[_0x09f5('0x6d')]['languageCode'],'queryText':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x76')],'responseId':_0x4e3dcd['responseId'],'score':_0x4e3dcd[_0x09f5('0x6d')]['intentDetectionConfidence'],'speech':_0x4e3dcd[_0x09f5('0x6d')][_0x09f5('0x72')],'providerResponse':JSON[_0x09f5('0x44')](_0xecc9ef)};return _0x1d8c15;}}});};exports['tildeASR']=function(_0x4e07c7,_0x49d6b3,_0x52e702,_0x5e857c){return tilde[_0x09f5('0x77')](_0x4e07c7,_0x49d6b3,_0x52e702,_0x5e857c)['then'](function(_0x3f608d){try{fs[_0x09f5('0x2e')](_0x4e07c7);}catch(_0x54bcf7){logger['error'](_0x54bcf7);}logger['info'](_0x09f5('0x78'),_0x3f608d[_0x09f5('0x52')]);logger[_0x09f5('0x1d')](_0x09f5('0x79'),_0x3f608d[_0x09f5('0x55')]);return _0x3f608d;});};exports[_0x09f5('0x7a')]=function(_0x12ef99,_0xc9bf0b,_0x540c15,_0x6995ad,_0x3fd880,_0x1ada60){var _0x5e38ba=path[_0x09f5('0x27')](__dirname,'tmp',rs[_0x09f5('0x29')](0x4)+_0x09f5('0x39'));var _0x2840ff;return aws[_0x09f5('0x7b')](_0x12ef99,_0xc9bf0b,_0x540c15,_0x6995ad,_0x3fd880,_0x1ada60,_0x5e38ba)[_0x09f5('0x2d')](function(){_0x2840ff=path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs['generate'](0x4)+_0x09f5('0x2a'));return convertFile(_0x5e38ba,_0x2840ff);})[_0x09f5('0x2d')](function(){try{fs[_0x09f5('0x2e')](_0x5e38ba);fs[_0x09f5('0x2f')](_0x2840ff,_0x09f5('0x3d'));}catch(_0x3bf5cf){logger[_0x09f5('0x19')](_0x3bf5cf);}return _0x2840ff[_0x09f5('0x30')]('.')[0x0];});};exports['awsLex']=function(_0xb19376,_0x4a4df0,_0x4eca20,_0x1314f9,_0x211988,_0x4e0407){return aws['lex'](_0xb19376,_0x4a4df0,_0x4eca20,_0x1314f9,_0x211988,_0x4e0407)[_0x09f5('0x2d')](function(_0x9fafdb){logger[_0x09f5('0x1d')](JSON[_0x09f5('0x44')](_0x9fafdb));return _0x9fafdb;});};exports[_0x09f5('0x7c')]=function(_0x57a5bd,_0x1e1f8c,_0x1dcfff,_0xaf0440){var _0x68375b=util['format'](_0x09f5('0x7d'),ISPEECH_API,_0x57a5bd,encodeURIComponent(_0x1e1f8c),_0x1dcfff,_0xaf0440);var _0x306f71=path[_0x09f5('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x09f5('0x39'));var _0x5d012b;return downloadFile(_0x68375b,_0x306f71)[_0x09f5('0x2d')](function(){_0x5d012b=path[_0x09f5('0x27')](__dirname,'tmp',rs[_0x09f5('0x29')](0x4)+_0x09f5('0x2a'));return convertFile(_0x306f71,_0x5d012b);})[_0x09f5('0x2d')](function(){try{fs[_0x09f5('0x2e')](_0x306f71);fs[_0x09f5('0x2f')](_0x5d012b,_0x09f5('0x3d'));}catch(_0x5a7af6){logger[_0x09f5('0x19')](_0x5a7af6);}return _0x5d012b[_0x09f5('0x30')]('.')[0x0];});};exports[_0x09f5('0x7e')]=function(_0xc3af44,_0xb15416,_0xa8c0a9,_0x35e978){var _0x268a68=util[_0x09f5('0x7f')](_0x09f5('0x80'),ISPEECH_API,_0xb15416,_0xa8c0a9,base64Encode(_0xc3af44),_0x35e978?util[_0x09f5('0x7f')](_0x09f5('0x81'),encodeURIComponent(_0x35e978)):_0x09f5('0x82'));return uploadFile(_0x268a68)[_0x09f5('0x2d')](function(_0x331496){return querystring[_0x09f5('0xc')](_0x331496);});};exports['sestekNDA']=function(_0xc8fce0,_0x1a810c){return sestek[_0x09f5('0x83')](_0xc8fce0,_0x1a810c)[_0x09f5('0x2d')](function(_0x5b2093){logger[_0x09f5('0x1d')](JSON[_0x09f5('0x44')](_0x5b2093));var _0x146b2a={'speech':_0x5b2093['text'],'action':_0x5b2093[_0x09f5('0x84')]?_0x5b2093[_0x09f5('0x84')][_0x09f5('0x85')]:undefined,'actiondata':_0x5b2093[_0x09f5('0x84')]?_0x5b2093[_0x09f5('0x84')][_0x09f5('0x86')]:undefined};if(_0x5b2093['channelData']&&_0x5b2093[_0x09f5('0x84')]['AudioFromTts']){return base64Decode(_0x5b2093[_0x09f5('0x84')][_0x09f5('0x87')][_0x09f5('0x88')],path[_0x09f5('0x27')](__dirname,_0x09f5('0x28'),rs[_0x09f5('0x29')](0x4)+_0x09f5('0x2a')))[_0x09f5('0x2d')](function(_0x3449c9){_0x146b2a['audiofile']=_0x3449c9;return _0x146b2a;});}return _0x146b2a;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xec7f=['get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','WHAT_EVER','data','wav','error\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','777','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','audioContent','chmodSync','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','textRequest','result','resolvedQuery','action','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','awsPolly','.mp3','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xec7f,0xfe));var _0xfec7=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xec7f[_0x422905];return _0x33dc6c;};'use strict';var apiai=require(_0xfec7('0x0'));var BPromise=require(_0xfec7('0x1'));var dialogflow=require(_0xfec7('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xfec7('0x3'));var md5=require(_0xfec7('0x4'));var path=require(_0xfec7('0x5'));var querystring=require(_0xfec7('0x6'));var rp=require(_0xfec7('0x7'));var rs=require(_0xfec7('0x8'));var sox=require(_0xfec7('0x9'));var tts=require('google-tts-api');var urlParse=require(_0xfec7('0xa'))[_0xfec7('0xb')];var util=require(_0xfec7('0xc'));var aws=require(_0xfec7('0xd'));var google=require(_0xfec7('0xe'));var sestek=require(_0xfec7('0xf'));var tilde=require(_0xfec7('0x10'));var logger=require(_0xfec7('0x11'))(_0xfec7('0x12'));var ISPEECH_API=_0xfec7('0x13');function downloadFile(_0x2743e0,_0x2c5804){return new BPromise(function(_0x3319fe,_0x3442db){var _0x3e646a=urlParse(_0x2743e0);var _0x15381a=_0x3e646a[_0xfec7('0x14')]===_0xfec7('0x15')?https:http;var _0x78c9db={'host':_0x3e646a['host'],'path':_0x3e646a[_0xfec7('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x15381a[_0xfec7('0x16')](_0x78c9db,function(_0x4c5932){if(_0x4c5932[_0xfec7('0x17')]!==0xc8){logger[_0xfec7('0x18')](_0xfec7('0x19')+_0x2743e0+_0xfec7('0x1a')+_0x4c5932['statusCode']+'\x20('+_0x4c5932['statusMessage']+')');_0x3442db(new Error(_0xfec7('0x19')+_0x2743e0+_0xfec7('0x1a')+_0x4c5932[_0xfec7('0x17')]+'\x20('+_0x4c5932['statusMessage']+')'));return;}var _0x4a8b82=fs[_0xfec7('0x1b')](_0x2c5804);_0x4a8b82['on'](_0xfec7('0x1c'),function(){logger[_0xfec7('0x1d')](_0xfec7('0x1e'));_0x4a8b82[_0xfec7('0x1f')](_0x3319fe);});_0x4a8b82['on'](_0xfec7('0x18'),function(_0x3adfd7){fs[_0xfec7('0x20')](_0x2c5804);logger[_0xfec7('0x18')](_0xfec7('0x21'),_0x3adfd7);_0x3442db(_0x3adfd7);});_0x4c5932[_0xfec7('0x22')](_0x4a8b82);})['on'](_0xfec7('0x18'),function(_0x6a0758){logger[_0xfec7('0x18')](_0x6a0758);_0x3442db(_0x6a0758);})[_0xfec7('0x23')]();});}function uploadFile(_0x233548){return new BPromise(function(_0x1af008,_0x2f267d){var _0x423ba0=urlParse(_0x233548);var _0xbb7d6f=_0x423ba0[_0xfec7('0x14')]===_0xfec7('0x15')?https:http;var _0xcfcbfa={'host':_0x423ba0[_0xfec7('0x24')],'path':_0x423ba0[_0xfec7('0x5')],'headers':{'user-agent':_0xfec7('0x25')}};_0xbb7d6f[_0xfec7('0x16')](_0xcfcbfa,function(_0x21f43f){if(_0x21f43f['statusCode']!==0xc8){_0x2f267d(new Error(_0xfec7('0x19')+_0x233548+_0xfec7('0x1a')+_0x21f43f[_0xfec7('0x17')]+'\x20('+_0x21f43f['statusMessage']+')'));return;}var _0x47b0b8='';_0x21f43f['on'](_0xfec7('0x26'),function(_0x5bafa4){_0x47b0b8+=_0x5bafa4;});_0x21f43f['on'](_0xfec7('0x23'),function(){_0x1af008(_0x47b0b8);});})['on']('error',function(_0x150a15){_0x2f267d(_0x150a15);})[_0xfec7('0x23')]();});}function convertFile(_0x294795,_0x367dc8){return new BPromise(function(_0x1e4e34,_0x39bff3){var _0x13cc44=sox['transcode'](_0x294795,_0x367dc8,{'sampleRate':0x1f40,'format':_0xfec7('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x13cc44['on'](_0xfec7('0x18'),function(_0x2d0916){logger['error'](_0xfec7('0x28'),_0x2d0916);_0x39bff3(_0x2d0916);});_0x13cc44['on'](_0xfec7('0x23'),function(){logger[_0xfec7('0x1d')]('finish\x20to\x20convert');_0x1e4e34();});_0x13cc44[_0xfec7('0x29')]();});}function base64Decode(_0x260c0f,_0x5b739f){var _0x2139e7=path[_0xfec7('0x2a')](__dirname,'tmp',rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x2c'));fs[_0xfec7('0x2d')](_0x2139e7,_0x260c0f,_0xfec7('0x2e'));return convertFile(_0x2139e7,_0x5b739f)[_0xfec7('0x2f')](function(){try{fs[_0xfec7('0x20')](_0x2139e7);fs['chmodSync'](_0x5b739f,_0xfec7('0x30'));}catch(_0x1ce321){logger['error'](_0x1ce321);}return _0x5b739f['split']('.')[0x0];});}function base64Encode(_0x496c7a){var _0x469c03=fs['readFileSync'](_0x496c7a);return new Buffer(_0x469c03)[_0xfec7('0x31')](_0xfec7('0x2e'));}exports[_0xfec7('0x32')]=function(_0x27f510,_0x364cd9,_0x1c8699,_0x3f274e,_0x47fbd1,_0x17c7f6){var _0x5cd270,_0x405840;var _0x221e32=_0xfec7('0x33');var _0x357054=_0xfec7('0x34')+_0x27f510;var _0x31e3ce={};if(_0x364cd9===_0xfec7('0x35')){_0x31e3ce[_0xfec7('0x36')]={'ssml':_0x1c8699};}else{_0x31e3ce[_0xfec7('0x36')]={'text':_0x1c8699};};_0x31e3ce[_0xfec7('0x37')]={'languageCode':_0x3f274e,'ssmlGender':_0x47fbd1};_0x31e3ce[_0xfec7('0x38')]={'audioEncoding':_0xfec7('0x39'),'sampleRateHertz':0x1f40};var _0x5c4798={'url':_0x221e32+_0xfec7('0x3a')+_0x357054,'method':_0xfec7('0x3b'),'json':!![],'body':_0x31e3ce};return rp(_0x5c4798)[_0xfec7('0x2f')](function(_0x5eb97f){return new BPromise(function(_0x2933d4,_0x497cd0){_0x5cd270=path[_0xfec7('0x2a')](__dirname,_0xfec7('0x3c'),rs[_0xfec7('0x2b')](0x4)+'.mp3');var _0x436199=Buffer['from'](_0x5eb97f[_0xfec7('0x3d')],_0xfec7('0x2e'));return fs['writeFile'](_0x5cd270,_0x436199,function(_0x7f9e70){_0x497cd0(_0x7f9e70);},function(_0x5aa584){fs[_0xfec7('0x3e')](_0x5cd270,_0xfec7('0x30'));_0x2933d4(_0x5aa584);});});})[_0xfec7('0x2f')](function(_0x3a3db7){_0x405840=path[_0xfec7('0x2a')](__dirname,'tmp',rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x2c'));return convertFile(_0x5cd270,_0x405840);})[_0xfec7('0x2f')](function(){try{fs[_0xfec7('0x20')](_0x5cd270);fs[_0xfec7('0x3e')](_0x405840,_0xfec7('0x30'));}catch(_0x47a667){logger['error'](_0x47a667);}logger[_0xfec7('0x1d')](_0xfec7('0x3f'),_0x405840[_0xfec7('0x40')]('.')[0x0]);return _0x405840[_0xfec7('0x40')]('.')[0x0];});};exports['googleTTS']=function(_0x1af6fc,_0x2fa0b3){var _0x8cc186=_0xfec7('0x41');var _0x2ff19d,_0x5d143b;var _0x3be366;var _0x585867={'encoding':_0xfec7('0x42'),'method':_0xfec7('0x3b'),'timeout':0x2710,'url':_0x8cc186,'headers':{'Content-Type':_0xfec7('0x43')},'body':_0xfec7('0x44')+encodeURIComponent(JSON[_0xfec7('0x45')]([[[_0xfec7('0x46'),JSON[_0xfec7('0x45')]([_0x1af6fc,_0x2fa0b3||'en',![],_0xfec7('0x47')]),null,'generic']]]))};return rp(_0x585867)[_0xfec7('0x2f')](function(_0x2a73a2){try{_0x3be366=eval(_0x2a73a2[_0xfec7('0x48')](0x5))[0x0][0x2];}catch(_0x2c184a){throw new Error(_0xfec7('0x49')+_0x2a73a2['data']);}if(!_0x3be366){if(_0x1af6fc['length']>0xc8){throw new Error(_0xfec7('0x4a'));}else{throw new Error(_0xfec7('0x4b')+_0x2fa0b3+_0xfec7('0x4c'));}}try{_0x3be366=eval(_0x3be366)[0x0];}catch(_0x5631f4){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xfec7('0x26')]);}const _0x50ac3a=_0x3be366;_0x2ff19d=path[_0xfec7('0x2a')](__dirname,_0xfec7('0x3c'),rs[_0xfec7('0x2b')](0x4)+'.mp3');fs['writeFileSync'](_0x2ff19d,_0x3be366,{'encoding':_0xfec7('0x2e')});_0x5d143b=path[_0xfec7('0x2a')](__dirname,_0xfec7('0x3c'),rs[_0xfec7('0x2b')](0x4)+'.wav');return convertFile(_0x2ff19d,_0x5d143b);})[_0xfec7('0x2f')](function(){try{fs['unlink'](_0x2ff19d);fs[_0xfec7('0x3e')](_0x5d143b,_0xfec7('0x30'));}catch(_0x4db403){logger[_0xfec7('0x18')](_0x4db403);}logger[_0xfec7('0x1d')](_0xfec7('0x4d'),_0x5d143b['split']('.')[0x0]);return _0x5d143b[_0xfec7('0x40')]('.')[0x0];});};exports[_0xfec7('0x4e')]=function(_0x4b533a,_0x347a4e,_0x1e725f){return google[_0xfec7('0x4f')](_0x4b533a,_0x347a4e,_0x1e725f)[_0xfec7('0x2f')](function(_0x3b6fb6){logger[_0xfec7('0x1d')](_0x3b6fb6[_0xfec7('0x50')]);return rp(_0x3b6fb6);})[_0xfec7('0x2f')](function(_0x4e7229){var _0x4fe3cc='';var _0x49512b=0x0;try{fs[_0xfec7('0x20')](_0x4b533a);}catch(_0x45fb0e){logger[_0xfec7('0x18')](_0x45fb0e);}if(_0x4e7229&&_0x4e7229[_0xfec7('0x51')]){_0x4fe3cc=_0x4e7229[_0xfec7('0x51')][_0xfec7('0x52')](function(_0x226562){return _0x226562&&_0x226562['alternatives'][0x0]&&_0x226562[_0xfec7('0x53')][0x0]['transcript']?_0x226562[_0xfec7('0x53')][0x0][_0xfec7('0x54')]:'';})[_0xfec7('0x55')]('\x0a');_0x49512b=_0x4e7229[_0xfec7('0x51')][_0xfec7('0x52')](function(_0x1fe52a){return _0x1fe52a&&_0x1fe52a['alternatives'][0x0]&&_0x1fe52a[_0xfec7('0x53')][0x0][_0xfec7('0x56')]?_0x1fe52a['alternatives'][0x0][_0xfec7('0x56')]:0x0;})[_0xfec7('0x55')]('\x0a');}logger[_0xfec7('0x1d')]('googleASR\x20transcription',_0x4fe3cc);logger['info']('googleASR\x20confidence',_0x49512b);return{'transcript':_0x4fe3cc,'confidence':_0x49512b};})[_0xfec7('0x57')](function(_0x43f646){logger['error'](_0xfec7('0x58'),_0x43f646[_0xfec7('0x17')],_0x43f646[_0xfec7('0x59')],_0x43f646['message']);});};exports['googleDialogflow']=function(_0x256adb,_0x449760,_0x1c5867,_0x34e143){var _0x24028b=apiai(_0x449760,{'language':_0x34e143||'en'});return _0x24028b[_0xfec7('0x5a')](_0x1c5867,{'sessionId':md5(_0x256adb)})[_0xfec7('0x2f')](function(_0x26f695){logger[_0xfec7('0x1d')](JSON[_0xfec7('0x45')](_0x26f695));return{'source':_0x26f695[_0xfec7('0x5b')]['source'],'resolvedQuery':_0x26f695['result'][_0xfec7('0x5c')],'action':_0x26f695['result'][_0xfec7('0x5d')],'actionIncomplete':_0x26f695[_0xfec7('0x5b')]['actionIncomplete'],'speech':_0x26f695[_0xfec7('0x5b')]['fulfillment'][_0xfec7('0x5e')],'score':_0x26f695[_0xfec7('0x5b')][_0xfec7('0x5f')],'statusCode':_0x26f695[_0xfec7('0x60')][_0xfec7('0x61')],'endConversation':_0x26f695[_0xfec7('0x5b')][_0xfec7('0x62')]['endConversation']||![],'isFallbackIntent':_0x26f695[_0xfec7('0x5b')]['metadata'][_0xfec7('0x63')]};});};exports[_0xfec7('0x64')]=function(_0x1a0680,_0x59c90d,_0x4aacef,_0x1e6a9c,_0x4ba3bf,_0x11575b){var _0x1062b1=_0x1e6a9c[_0xfec7('0x65')](/\\n/g,'\x0a');var _0xc3f333={'credentials':{'private_key':_0x1062b1,'client_email':_0x4aacef}};var _0x54655b=new dialogflow[(_0xfec7('0x66'))](_0xc3f333);var _0x3de640=_0x54655b[_0xfec7('0x67')](_0x59c90d,md5(_0x1a0680));var _0x11e2e5={'session':_0x3de640,'queryInput':{'text':{'text':_0x4ba3bf,'languageCode':_0x11575b}}};return _0x54655b[_0xfec7('0x68')](_0x11e2e5)['then'](function(_0x1203d7){if(_0x1203d7&&_0x1203d7[_0xfec7('0x69')]){logger[_0xfec7('0x1d')](_0xfec7('0x6a'),JSON['stringify'](_0x1203d7));var _0x312c9f=_0x1203d7[0x0];if(_0x312c9f){var _0x164ac7={'action':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x5d')],'allRequiredParamsPresent':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x6c')],'endConversation':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x6d')]&&_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x6d')][_0xfec7('0x6e')]?_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x6d')][_0xfec7('0x6e')][_0xfec7('0x6f')][_0xfec7('0x70')]:![],'fulfillmentText':_0x312c9f['queryResult'][_0xfec7('0x71')],'intentName':_0x312c9f[_0xfec7('0x6b')]['intent']['name'],'intentDisplayName':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x72')][_0xfec7('0x73')],'isFallbackIntent':_0x312c9f['queryResult'][_0xfec7('0x72')][_0xfec7('0x74')],'languageCode':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x75')],'queryText':_0x312c9f[_0xfec7('0x6b')][_0xfec7('0x76')],'responseId':_0x312c9f[_0xfec7('0x77')],'score':_0x312c9f[_0xfec7('0x6b')]['intentDetectionConfidence'],'speech':_0x312c9f['queryResult'][_0xfec7('0x71')],'providerResponse':JSON[_0xfec7('0x45')](_0x1203d7)};return _0x164ac7;}}});};exports[_0xfec7('0x78')]=function(_0x459676,_0x584b40,_0x2bc939,_0x177837){return tilde['asr'](_0x459676,_0x584b40,_0x2bc939,_0x177837)[_0xfec7('0x2f')](function(_0x372aad){try{fs[_0xfec7('0x20')](_0x459676);}catch(_0x58a66c){logger[_0xfec7('0x18')](_0x58a66c);}logger['info']('Tilde\x20ASR\x20transcription',_0x372aad[_0xfec7('0x54')]);logger[_0xfec7('0x1d')]('Tilde\x20ASR\x20confidence',_0x372aad[_0xfec7('0x56')]);return _0x372aad;});};exports[_0xfec7('0x79')]=function(_0x386d94,_0x172dcd,_0x1ae5da,_0x15aad4,_0x1e3f56,_0x4f3852){var _0x3600e2=path[_0xfec7('0x2a')](__dirname,'tmp',rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x7a'));var _0xa5f019;return aws[_0xfec7('0x7b')](_0x386d94,_0x172dcd,_0x1ae5da,_0x15aad4,_0x1e3f56,_0x4f3852,_0x3600e2)[_0xfec7('0x2f')](function(){_0xa5f019=path[_0xfec7('0x2a')](__dirname,'tmp',rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x2c'));return convertFile(_0x3600e2,_0xa5f019);})[_0xfec7('0x2f')](function(){try{fs['unlink'](_0x3600e2);fs['chmodSync'](_0xa5f019,'777');}catch(_0x4d0de5){logger['error'](_0x4d0de5);}return _0xa5f019[_0xfec7('0x40')]('.')[0x0];});};exports['awsLex']=function(_0x19d727,_0x30e828,_0x499dfa,_0x2a03ae,_0x56f616,_0x24edd6){return aws[_0xfec7('0x7c')](_0x19d727,_0x30e828,_0x499dfa,_0x2a03ae,_0x56f616,_0x24edd6)[_0xfec7('0x2f')](function(_0xc5cecd){logger[_0xfec7('0x1d')](JSON['stringify'](_0xc5cecd));return _0xc5cecd;});};exports[_0xfec7('0x7d')]=function(_0x1ce99e,_0x541832,_0x1272fb,_0x3c05c9){var _0x18c78a=util[_0xfec7('0x7e')](_0xfec7('0x7f'),ISPEECH_API,_0x1ce99e,encodeURIComponent(_0x541832),_0x1272fb,_0x3c05c9);var _0x46b96f=path[_0xfec7('0x2a')](__dirname,_0xfec7('0x3c'),rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x7a'));var _0x3349e9;return downloadFile(_0x18c78a,_0x46b96f)[_0xfec7('0x2f')](function(){_0x3349e9=path[_0xfec7('0x2a')](__dirname,_0xfec7('0x3c'),rs[_0xfec7('0x2b')](0x4)+'.wav');return convertFile(_0x46b96f,_0x3349e9);})['then'](function(){try{fs[_0xfec7('0x20')](_0x46b96f);fs[_0xfec7('0x3e')](_0x3349e9,_0xfec7('0x30'));}catch(_0x22c860){logger[_0xfec7('0x18')](_0x22c860);}return _0x3349e9[_0xfec7('0x40')]('.')[0x0];});};exports['ispeechASR']=function(_0x50410f,_0x3373d7,_0x5c495a,_0x5a0043){var _0x52a5e8=util[_0xfec7('0x7e')](_0xfec7('0x80'),ISPEECH_API,_0x3373d7,_0x5c495a,base64Encode(_0x50410f),_0x5a0043?util[_0xfec7('0x7e')]('model=%s',encodeURIComponent(_0x5a0043)):_0xfec7('0x81'));return uploadFile(_0x52a5e8)[_0xfec7('0x2f')](function(_0x4a9c42){return querystring[_0xfec7('0xb')](_0x4a9c42);});};exports['sestekNDA']=function(_0x20cc94,_0x138f47){return sestek[_0xfec7('0x82')](_0x20cc94,_0x138f47)[_0xfec7('0x2f')](function(_0x4da7d8){logger[_0xfec7('0x1d')](JSON[_0xfec7('0x45')](_0x4da7d8));var _0x94e24e={'speech':_0x4da7d8[_0xfec7('0x83')],'action':_0x4da7d8[_0xfec7('0x84')]?_0x4da7d8[_0xfec7('0x84')][_0xfec7('0x85')]:undefined,'actiondata':_0x4da7d8[_0xfec7('0x84')]?_0x4da7d8[_0xfec7('0x84')][_0xfec7('0x86')]:undefined};if(_0x4da7d8[_0xfec7('0x84')]&&_0x4da7d8[_0xfec7('0x84')]['AudioFromTts']){return base64Decode(_0x4da7d8[_0xfec7('0x84')][_0xfec7('0x87')]['Data'],path[_0xfec7('0x2a')](__dirname,'tmp',rs[_0xfec7('0x2b')](0x4)+_0xfec7('0x2c')))[_0xfec7('0x2f')](function(_0x3feaea){_0x94e24e[_0xfec7('0x88')]=_0x3feaea;return _0x94e24e;});}return _0x94e24e;});};exports[_0xfec7('0x89')]=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 3bd7207..545d703 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 _0x2064=['./nda'];(function(_0x314d54,_0x571931){var _0x5d37eb=function(_0x453c8f){while(--_0x453c8f){_0x314d54['push'](_0x314d54['shift']());}};_0x5d37eb(++_0x571931);}(_0x2064,0x171));var _0x4206=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0x2064[_0xc889e1];return _0x17ab9e;};var nda=require(_0x4206('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xffa4=['exports','./nda'];(function(_0x7ee44,_0x2e0bdf){var _0x184617=function(_0x51f8a4){while(--_0x51f8a4){_0x7ee44['push'](_0x7ee44['shift']());}};_0x184617(++_0x2e0bdf);}(_0xffa4,0x67));var _0x4ffa=function(_0x4e29e5,_0x5ce388){_0x4e29e5=_0x4e29e5-0x0;var _0x312749=_0xffa4[_0x4e29e5];return _0x312749;};var nda=require(_0x4ffa('0x0'));module[_0x4ffa('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 f2be3d1..05c0a42 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 _0xf996=['uniqueid','callerid','calleridname','dnid','text','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xf996,0x74));var _0x6f99=function(_0x15a738,_0x1b8638){_0x15a738=_0x15a738-0x0;var _0x8dc61d=_0xf996[_0x15a738];return _0x8dc61d;};'use strict';var rp=require(_0x6f99('0x0'));var url=require(_0x6f99('0x1'));var logger=require(_0x6f99('0x2'))('agi');module[_0x6f99('0x3')]=function(_0x56fd3f,_0x5ceb57){var _0x2eb1fc={'method':_0x6f99('0x4'),'uri':url[_0x6f99('0x5')](_0x5ceb57[_0x6f99('0x6')],_0x6f99('0x7')),'form':{'grant_type':_0x6f99('0x8'),'username':_0x5ceb57[_0x6f99('0x9')],'password':_0x5ceb57[_0x6f99('0x8')]},'json':!![]};return rp(_0x2eb1fc)[_0x6f99('0xa')](function(_0x1e4805){var _0x5d8b7f={'method':_0x6f99('0x4'),'uri':url['resolve'](_0x5ceb57[_0x6f99('0xb')],_0x6f99('0xc')),'body':{'type':_0x5ceb57[_0x6f99('0xd')]||_0x6f99('0xe'),'channelId':_0x6f99('0xf'),'conversation':{'id':_0x56fd3f[_0x6f99('0x10')]},'from':{'id':_0x56fd3f[_0x6f99('0x11')],'name':_0x56fd3f[_0x6f99('0x12')]},'recipient':{'id':_0x56fd3f[_0x6f99('0x13')],'name':_0x56fd3f['extension']},'text':_0x5ceb57[_0x6f99('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1e4805['access_token']},'json':!![]};if(_0x5ceb57['project']){_0x5d8b7f[_0x6f99('0x15')][_0x6f99('0x16')][_0x6f99('0x17')]=_0x5ceb57[_0x6f99('0x18')];}if(_0x5ceb57[_0x6f99('0x19')]=='1'){_0x5d8b7f[_0x6f99('0x15')][_0x6f99('0x16')][_0x6f99('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6f99('0x1b')};}if(_0x5ceb57[_0x6f99('0x1c')]){_0x5d8b7f[_0x6f99('0x15')][_0x6f99('0x16')]['CustomAction']=_0x5ceb57[_0x6f99('0x1c')];if(_0x5ceb57[_0x6f99('0x1d')]){_0x5d8b7f['body']['channelData'][_0x6f99('0x1e')]=_0x5ceb57['custom_action_data'];}}logger[_0x6f99('0x1f')](JSON[_0x6f99('0x20')](_0x5d8b7f));return rp(_0x5d8b7f);});}; \ No newline at end of file +var _0x4345=['Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','ndauth_url','/token','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x14ba8b,_0x306a0a){var _0x44aaf0=function(_0x5d1142){while(--_0x5d1142){_0x14ba8b['push'](_0x14ba8b['shift']());}};_0x44aaf0(++_0x306a0a);}(_0x4345,0x77));var _0x5434=function(_0x56d7c5,_0x1eca46){_0x56d7c5=_0x56d7c5-0x0;var _0x22bfdf=_0x4345[_0x56d7c5];return _0x22bfdf;};'use strict';var rp=require(_0x5434('0x0'));var url=require(_0x5434('0x1'));var logger=require('../../../../../config/logger')(_0x5434('0x2'));module[_0x5434('0x3')]=function(_0x38d317,_0x46df60){var _0x4e755c={'method':_0x5434('0x4'),'uri':url['resolve'](_0x46df60[_0x5434('0x5')],_0x5434('0x6')),'form':{'grant_type':_0x5434('0x7'),'username':_0x46df60['username'],'password':_0x46df60[_0x5434('0x7')]},'json':!![]};return rp(_0x4e755c)['then'](function(_0x395e5c){var _0x457fe8={'method':_0x5434('0x4'),'uri':url[_0x5434('0x8')](_0x46df60[_0x5434('0x9')],_0x5434('0xa')),'body':{'type':_0x46df60[_0x5434('0xb')]||_0x5434('0xc'),'channelId':_0x5434('0xd'),'conversation':{'id':_0x38d317[_0x5434('0xe')]},'from':{'id':_0x38d317[_0x5434('0xf')],'name':_0x38d317[_0x5434('0x10')]},'recipient':{'id':_0x38d317[_0x5434('0x11')],'name':_0x38d317[_0x5434('0x12')]},'text':_0x46df60['text'],'channelData':{}},'headers':{'Authorization':_0x5434('0x13')+_0x395e5c['access_token']},'json':!![]};if(_0x46df60[_0x5434('0x14')]){_0x457fe8[_0x5434('0x15')][_0x5434('0x16')][_0x5434('0x17')]=_0x46df60['project'];}if(_0x46df60[_0x5434('0x18')]=='1'){_0x457fe8[_0x5434('0x15')]['channelData'][_0x5434('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5434('0x1a')};}if(_0x46df60[_0x5434('0x1b')]){_0x457fe8[_0x5434('0x15')]['channelData'][_0x5434('0x1c')]=_0x46df60[_0x5434('0x1b')];if(_0x46df60['custom_action_data']){_0x457fe8[_0x5434('0x15')]['channelData'][_0x5434('0x1d')]=_0x46df60[_0x5434('0x1e')];}}logger[_0x5434('0x1f')](JSON[_0x5434('0x20')](_0x457fe8));return rp(_0x457fe8);});}; \ 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 74a0e31..011f11e 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 _0x8445=['./lib/api','exports'];(function(_0x55b7a4,_0x32f472){var _0x1fe954=function(_0x2019e3){while(--_0x2019e3){_0x55b7a4['push'](_0x55b7a4['shift']());}};_0x1fe954(++_0x32f472);}(_0x8445,0x166));var _0x5844=function(_0x80bea0,_0x4c30f4){_0x80bea0=_0x80bea0-0x0;var _0x50fb90=_0x8445[_0x80bea0];return _0x50fb90;};'use strict';var asr=require(_0x5844('0x0'));module[_0x5844('0x1')]=function(_0x4609bc,_0x11d3b4,_0x3d90b,_0x193414){return asr(_0x4609bc,_0x11d3b4,_0x3d90b,_0x193414);}; \ No newline at end of file +var _0xfa83=['exports'];(function(_0x4a2e9b,_0x174d05){var _0x5ba2a5=function(_0x56f7bb){while(--_0x56f7bb){_0x4a2e9b['push'](_0x4a2e9b['shift']());}};_0x5ba2a5(++_0x174d05);}(_0xfa83,0x105));var _0x3fa8=function(_0x4f8c11,_0xe603ea){_0x4f8c11=_0x4f8c11-0x0;var _0x51f12c=_0xfa83[_0x4f8c11];return _0x51f12c;};'use strict';var asr=require('./lib/api');module[_0x3fa8('0x0')]=function(_0x5b6906,_0x4ccc46,_0x75f44,_0xbdfec2){return asr(_0x5b6906,_0x4ccc46,_0x75f44,_0xbdfec2);}; \ 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 c44ce6e..263dc6a 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 _0xc248=['parse','status','result','final','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','terminate'];(function(_0x3f154f,_0x2c74e8){var _0x3ff6af=function(_0x49149e){while(--_0x49149e){_0x3f154f['push'](_0x3f154f['shift']());}};_0x3ff6af(++_0x2c74e8);}(_0xc248,0x10c));var _0x8c24=function(_0x261453,_0x43a430){_0x261453=_0x261453-0x0;var _0xcbc772=_0xc248[_0x261453];return _0xcbc772;};'use strict';var BPromise=require(_0x8c24('0x0'));var _=require(_0x8c24('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x8c24('0x2'));var logger=require(_0x8c24('0x3'))(_0x8c24('0x4'));module[_0x8c24('0x5')]=function(_0x53078e,_0x1a8bf5,_0xe98d38,_0x5b8ecc){return new BPromise(function(_0xf9de2e,_0x1e587a){logger[_0x8c24('0x6')]('Tilde\x20URI',_0x5b8ecc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x396fa3=new WebSocket(_0x5b8ecc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4742de='';var _0x6241c6='0';var _0x56bd45='1';var _0x46deb2=_0x8c24('0x7');function _0x4d4c51(_0x3fb454){var _0x5383d5=crypto['createHash'](_0x8c24('0x8'));_0x5383d5['update'](_0x3fb454);return _0x5383d5[_0x8c24('0x9')]('hex');}function _0x43da0d(){try{logger[_0x8c24('0x6')](_0x8c24('0xa'));var _0x27ed0c=moment()[_0x8c24('0xb')]();var _0xa56065=_0x4d4c51(_0x27ed0c+_0x1a8bf5+_0xe98d38);_0x396fa3[_0x8c24('0xc')](JSON[_0x8c24('0xd')]({'appID':_0x1a8bf5,'timestamp':_0x27ed0c,'appKey':_0xa56065}));var _0x278b6c=fs[_0x8c24('0xe')](_0x53078e);_0x278b6c['on'](_0x8c24('0xf'),function(_0x5937e3){_0x396fa3['send'](_0x5937e3);});_0x278b6c['on'](_0x8c24('0x10'),function(){_0x396fa3[_0x8c24('0xc')](_0x8c24('0x11'));});}catch(_0x4c66c6){logger[_0x8c24('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x4c66c6));_0x396fa3[_0x8c24('0x13')]();}}function _0x51f978(_0x103fa2){try{if(_0x103fa2){var _0x14da00=JSON[_0x8c24('0x14')](_0x103fa2);switch(_0x14da00[_0x8c24('0x15')]){case 0x0:if(_0x14da00[_0x8c24('0x16')]){if(_0x14da00[_0x8c24('0x16')][_0x8c24('0x17')]){logger[_0x8c24('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0x8c24('0xd')](_0x14da00['result'][_0x8c24('0x18')]));_0x4742de=_0x14da00[_0x8c24('0x16')][_0x8c24('0x18')][0x0]['transcript'];_0x6241c6=_0x14da00[_0x8c24('0x16')]['hypotheses'][0x0][_0x8c24('0x19')];_0x56bd45='0';_0x46deb2='Success.';_0x396fa3['terminate']();}}break;case 0x1:logger['info'](_0x8c24('0x7'));_0x56bd45='1';_0x46deb2=_0x8c24('0x7');break;case 0x2:logger['info'](_0x8c24('0x1a'));_0x56bd45='2';_0x46deb2=_0x8c24('0x1a');break;case 0x9:logger[_0x8c24('0x6')](_0x8c24('0x1b'));_0x56bd45='9';_0x46deb2='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x8c24('0x1c'));_0x56bd45='10';_0x46deb2=_0x8c24('0x1c');break;case 0xb:logger[_0x8c24('0x6')](_0x8c24('0x1d'));_0x56bd45='11';_0x46deb2=_0x8c24('0x1d');}}}catch(_0x3649b4){logger['error'](_0x8c24('0x1e'),JSON['stringify'](_0x3649b4));_0x396fa3[_0x8c24('0x13')]();}}function _0x396f3e(){logger[_0x8c24('0x6')](_0x8c24('0x1f'));_0xf9de2e({'transcript':_0x4742de,'confidence':_0x6241c6,'status':_0x56bd45,'status_message':_0x46deb2});}function _0x28df6a(_0xec29d8){logger[_0x8c24('0x12')](_0x8c24('0x20'));if(!_['isNil'](_0xec29d8)){logger[_0x8c24('0x12')](_[_0x8c24('0x21')](_0xec29d8)?JSON[_0x8c24('0xd')](_0xec29d8):_0xec29d8);}}_0x396fa3['on'](_0x8c24('0x22'),_0x43da0d);_0x396fa3['on'](_0x8c24('0x23'),_0x51f978);_0x396fa3['on'](_0x8c24('0x10'),_0x396f3e);_0x396fa3['on'](_0x8c24('0x12'),_0x28df6a);});}; \ No newline at end of file +var _0xa0f2=['agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','EOS','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','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','Error\x20Tilde\x20ASR\x20socket','isNil','crypto','../../../../../../config/logger'];(function(_0x3ba934,_0x48c8d6){var _0x232137=function(_0x53ff22){while(--_0x53ff22){_0x3ba934['push'](_0x3ba934['shift']());}};_0x232137(++_0x48c8d6);}(_0xa0f2,0x11e));var _0x2a0f=function(_0x167705,_0x5e0a2c){_0x167705=_0x167705-0x0;var _0x51b5f=_0xa0f2[_0x167705];return _0x51b5f;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x2a0f('0x0'));var logger=require(_0x2a0f('0x1'))(_0x2a0f('0x2'));module['exports']=function(_0x268017,_0x15ab13,_0x5014dd,_0x7d9f29){return new BPromise(function(_0x4f551f,_0x677cc3){logger[_0x2a0f('0x3')]('Tilde\x20URI',_0x7d9f29||_0x2a0f('0x4'));var _0x349799=new WebSocket(_0x7d9f29||_0x2a0f('0x4'),{'perMessageDeflate':![]});var _0x4c756a='';var _0xb0ebc8='0';var _0x2e9dbc='1';var _0x4685d2=_0x2a0f('0x5');function _0x8a3f65(_0x117e07){var _0x2dd310=crypto[_0x2a0f('0x6')](_0x2a0f('0x7'));_0x2dd310[_0x2a0f('0x8')](_0x117e07);return _0x2dd310['digest'](_0x2a0f('0x9'));}function _0x3b803d(){try{logger[_0x2a0f('0x3')](_0x2a0f('0xa'));var _0x3132cb=moment()['unix']();var _0x27e9d8=_0x8a3f65(_0x3132cb+_0x15ab13+_0x5014dd);_0x349799[_0x2a0f('0xb')](JSON[_0x2a0f('0xc')]({'appID':_0x15ab13,'timestamp':_0x3132cb,'appKey':_0x27e9d8}));var _0x5758be=fs[_0x2a0f('0xd')](_0x268017);_0x5758be['on'](_0x2a0f('0xe'),function(_0x29e842){_0x349799[_0x2a0f('0xb')](_0x29e842);});_0x5758be['on'](_0x2a0f('0xf'),function(){_0x349799[_0x2a0f('0xb')](_0x2a0f('0x10'));});}catch(_0x54a5c3){logger['error']('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x54a5c3));_0x349799[_0x2a0f('0x11')]();}}function _0xa4e846(_0x13f535){try{if(_0x13f535){var _0x57f8f9=JSON[_0x2a0f('0x12')](_0x13f535);switch(_0x57f8f9[_0x2a0f('0x13')]){case 0x0:if(_0x57f8f9[_0x2a0f('0x14')]){if(_0x57f8f9[_0x2a0f('0x14')][_0x2a0f('0x15')]){logger['info'](_0x2a0f('0x16'),JSON[_0x2a0f('0xc')](_0x57f8f9[_0x2a0f('0x14')][_0x2a0f('0x17')]));_0x4c756a=_0x57f8f9[_0x2a0f('0x14')][_0x2a0f('0x17')][0x0][_0x2a0f('0x18')];_0xb0ebc8=_0x57f8f9[_0x2a0f('0x14')][_0x2a0f('0x17')][0x0][_0x2a0f('0x19')];_0x2e9dbc='0';_0x4685d2=_0x2a0f('0x1a');_0x349799['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2e9dbc='1';_0x4685d2=_0x2a0f('0x5');break;case 0x2:logger['info'](_0x2a0f('0x1b'));_0x2e9dbc='2';_0x4685d2=_0x2a0f('0x1b');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2e9dbc='9';_0x4685d2=_0x2a0f('0x1c');break;case 0xa:logger[_0x2a0f('0x3')](_0x2a0f('0x1d'));_0x2e9dbc='10';_0x4685d2=_0x2a0f('0x1d');break;case 0xb:logger[_0x2a0f('0x3')](_0x2a0f('0x1e'));_0x2e9dbc='11';_0x4685d2=_0x2a0f('0x1e');}}}catch(_0x1ac8d0){logger['error'](_0x2a0f('0x1f'),JSON[_0x2a0f('0xc')](_0x1ac8d0));_0x349799['terminate']();}}function _0x4cbdca(){logger[_0x2a0f('0x3')](_0x2a0f('0x20'));_0x4f551f({'transcript':_0x4c756a,'confidence':_0xb0ebc8,'status':_0x2e9dbc,'status_message':_0x4685d2});}function _0x596f55(_0x2a2327){logger[_0x2a0f('0x21')](_0x2a0f('0x22'));if(!_[_0x2a0f('0x23')](_0x2a2327)){logger[_0x2a0f('0x21')](_['isObject'](_0x2a2327)?JSON[_0x2a0f('0xc')](_0x2a2327):_0x2a2327);}}_0x349799['on']('open',_0x3b803d);_0x349799['on']('message',_0xa4e846);_0x349799['on'](_0x2a0f('0xf'),_0x4cbdca);_0x349799['on'](_0x2a0f('0x21'),_0x596f55);});}; \ 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 a98630a..8a86ef3 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 _0x7131=['./asr','exports'];(function(_0x1674de,_0x562cb4){var _0x296ce7=function(_0x12146f){while(--_0x12146f){_0x1674de['push'](_0x1674de['shift']());}};_0x296ce7(++_0x562cb4);}(_0x7131,0x102));var _0x1713=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x7131[_0x580647];return _0x5f0792;};var asr=require(_0x1713('0x0'));module[_0x1713('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6052=['exports','./asr'];(function(_0x4ed357,_0x591090){var _0x294c32=function(_0x2397b6){while(--_0x2397b6){_0x4ed357['push'](_0x4ed357['shift']());}};_0x294c32(++_0x591090);}(_0x6052,0xa1));var _0x2605=function(_0x4068a0,_0xdcb8dd){_0x4068a0=_0x4068a0-0x0;var _0x2877f1=_0x6052[_0x4068a0];return _0x2877f1;};var asr=require(_0x2605('0x0'));module[_0x2605('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5aac43a..fcf73a2 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 _0x36a1=['createServer','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT'];(function(_0x2bbad6,_0x414b26){var _0x131cf3=function(_0x538e2f){while(--_0x538e2f){_0x2bbad6['push'](_0x2bbad6['shift']());}};_0x131cf3(++_0x414b26);}(_0x36a1,0x1b8));var _0x136a=function(_0x581d31,_0x4d79d9){_0x581d31=_0x581d31-0x0;var _0x23fb62=_0x36a1[_0x581d31];return _0x23fb62;};'use strict';var util=require(_0x136a('0x0'));var net=require(_0x136a('0x1'));var EventEmitter=require(_0x136a('0x2'))[_0x136a('0x3')];var AGIError=require(_0x136a('0x4'));var AGIChannel=require(_0x136a('0x5'));var AGIServer=function(_0x507b6f,_0x14cd06,_0x4b51b6){var _0x1805d8=this,_0x507b6f=_0x507b6f||0x11dd,_0x14cd06=_0x14cd06||_0x136a('0x6'),_0x1af4f7=null,_0x47b77a=0x0;EventEmitter[_0x136a('0x7')](_0x1805d8);function _0x3c0caa(){if(!_0x507b6f){_0x1805d8['emit'](_0x136a('0x8'),new AGIError(_0x136a('0x9')));return![];}_0x1af4f7=net[_0x136a('0xa')]();_0x1af4f7['listen'](_0x507b6f,_0x14cd06);_0x1af4f7['on'](_0x136a('0xb'),function(){_0x1805d8[_0x136a('0xc')](_0x136a('0xb'));});_0x1af4f7['on'](_0x136a('0xd'),function(_0x5482bc){_0x1af4f7[_0x136a('0xe')](function(_0x1e43c5,_0x13807d){if(_0x1e43c5){_0x1805d8['emit']('error',new AGIError(_0x136a('0xf'),_0x1e43c5));}else if(_0x4b51b6&&_0x4b51b6<0x0){_0x1805d8[_0x136a('0xc')]('error',new AGIError(_0x136a('0x10')));_0x5482bc[_0x136a('0x11')]();}else if(_0x4b51b6&&_0x4b51b6>0x0&&_0x4b51b6<_0x13807d){_0x47b77a+=0x1;_0x1805d8[_0x136a('0xc')](_0x136a('0x8'),new AGIError(_0x136a('0x12'),_0x47b77a));_0x5482bc['destroy']();}else{var _0x1a7fed=new AGIChannel(_0x5482bc);_0x1a7fed['on'](_0x136a('0x13'),function(){_0x1805d8[_0x136a('0xc')](_0x136a('0xd'),_0x1a7fed);});}});});_0x1af4f7['on'](_0x136a('0x8'),function(_0x13103b){_0x1805d8[_0x136a('0xc')]('error',new AGIError(_0x136a('0xf'),_0x13103b['code']));});_0x1af4f7['on'](_0x136a('0x14'),function(){_0x1805d8[_0x136a('0xc')](_0x136a('0x14'),new AGIError(_0x136a('0x15')));});}process[_0x136a('0x16')](function(){_0x3c0caa();});};util[_0x136a('0x17')](AGIServer,EventEmitter);module[_0x136a('0x18')]=function(_0x5b22b6,_0x377cce,_0x25c817){return new AGIServer(_0x5b22b6,_0x377cce,_0x25c817);}; \ No newline at end of file +var _0xd869=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','events','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x2017cc,_0x267ffb){var _0x2e2ec5=function(_0x29b50e){while(--_0x29b50e){_0x2017cc['push'](_0x2017cc['shift']());}};_0x2e2ec5(++_0x267ffb);}(_0xd869,0x82));var _0x9d86=function(_0x170310,_0x31acf9){_0x170310=_0x170310-0x0;var _0x1b6006=_0xd869[_0x170310];return _0x1b6006;};'use strict';var util=require('util');var net=require(_0x9d86('0x0'));var EventEmitter=require(_0x9d86('0x1'))['EventEmitter'];var AGIError=require(_0x9d86('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x5c9f29,_0x42aca1,_0x543edb){var _0xd7615c=this,_0x5c9f29=_0x5c9f29||0x11dd,_0x42aca1=_0x42aca1||_0x9d86('0x3'),_0x1b5bfa=null,_0x141442=0x0;EventEmitter[_0x9d86('0x4')](_0xd7615c);function _0x3c2c56(){if(!_0x5c9f29){_0xd7615c[_0x9d86('0x5')](_0x9d86('0x6'),new AGIError(_0x9d86('0x7')));return![];}_0x1b5bfa=net[_0x9d86('0x8')]();_0x1b5bfa[_0x9d86('0x9')](_0x5c9f29,_0x42aca1);_0x1b5bfa['on']('listening',function(){_0xd7615c['emit']('listening');});_0x1b5bfa['on'](_0x9d86('0xa'),function(_0x4ad503){_0x1b5bfa[_0x9d86('0xb')](function(_0x379cbd,_0x50f0f9){if(_0x379cbd){_0xd7615c[_0x9d86('0x5')](_0x9d86('0x6'),new AGIError(_0x9d86('0xc'),_0x379cbd));}else if(_0x543edb&&_0x543edb<0x0){_0xd7615c[_0x9d86('0x5')]('error',new AGIError(_0x9d86('0xd')));_0x4ad503[_0x9d86('0xe')]();}else if(_0x543edb&&_0x543edb>0x0&&_0x543edb<_0x50f0f9){_0x141442+=0x1;_0xd7615c['emit'](_0x9d86('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x141442));_0x4ad503[_0x9d86('0xe')]();}else{var _0x9599f5=new AGIChannel(_0x4ad503);_0x9599f5['on'](_0x9d86('0xf'),function(){_0xd7615c['emit']('connection',_0x9599f5);});}});});_0x1b5bfa['on'](_0x9d86('0x6'),function(_0x4bb144){_0xd7615c[_0x9d86('0x5')](_0x9d86('0x6'),new AGIError(_0x9d86('0xc'),_0x4bb144['code']));});_0x1b5bfa['on'](_0x9d86('0x10'),function(){_0xd7615c['emit'](_0x9d86('0x10'),new AGIError(_0x9d86('0x11')));});}process[_0x9d86('0x12')](function(){_0x3c2c56();});};util[_0x9d86('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x6a0a7b,_0xb5fb82,_0x28e6c4){return new AGIServer(_0x6a0a7b,_0xb5fb82,_0x28e6c4);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d00c8c0..0789e4f 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 _0xd96d=['uri','render','url','stringify','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','isString','saveRestApiResult','%s.%s','replaceObjectAllVariables','split','length','replaceAll','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','maxRetry','sync','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','toUpperCase','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','maxdigit','test','mindigit','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','no\x20appsecret\x20configured','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','escape_digits','restapi','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','service','host','port','secure','authentication','auth','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','odbc','randomstring','moment','mustache','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','extension','priority','accountcode','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xd96d,0x160));var _0xdd96=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xd96d[_0x29b609];return _0x54c952;};'use strict';var fs=require('fs');var path=require(_0xdd96('0x0'));var util=require(_0xdd96('0x1'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xdd96('0x2'))();var rs=require(_0xdd96('0x3'));var moment=require(_0xdd96('0x4'));var Mustache=require(_0xdd96('0x5'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xdd96('0x6'));var scripts=require(_0xdd96('0x7'));var FILES_PATH=_0xdd96('0x8');var recursiveMapAttributes=[_0xdd96('0x9'),_0xdd96('0xa')];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x14246b,_0x4b059a,_0x4b41b0){this['channel']=_0x14246b;this[_0xdd96('0xb')]=_0x4b059a;this['mailRpc']=_0x4b41b0;};AGIVertices[_0xdd96('0xc')][_0xdd96('0xd')]=function(_0x5b6e0d,_0x1992af){this[_0xdd96('0xb')][_0xdd96('0xe')](_0x5b6e0d)[_0xdd96('0xf')](function(_0x1b722d){_0x1992af(null,_0x1b722d?_0x1b722d[_0xdd96('0x10')]:![]);})[_0xdd96('0x11')](function(_0x53cc12){_0x1992af(_0x53cc12);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x12')]=function(_0x16e8e8,_0x55498f){this['rpc'][_0xdd96('0x13')](_0x16e8e8)[_0xdd96('0xf')](function(_0x302d8c){_0x55498f(null,_0x302d8c?_0x302d8c[_0xdd96('0x10')]:![]);})['catch'](function(_0x34d43a){_0x55498f(_0x34d43a);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x14')]=function(_0x457fca,_0x52eff4){this[_0xdd96('0xb')][_0xdd96('0x15')](_0x457fca)[_0xdd96('0xf')](function(_0x971031){_0x52eff4(null,_0x971031?_0x971031[_0xdd96('0x10')]:![]);})[_0xdd96('0x11')](function(_0x4ae8cc){_0x52eff4(_0x4ae8cc);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x16')]=function(_0x25c4cb,_0x4c84f1){this[_0xdd96('0xb')][_0xdd96('0x17')](_0x25c4cb)[_0xdd96('0xf')](function(_0x4c80b7){_0x4c84f1(null,_0x4c80b7?_0x4c80b7['dsn']:![]);})[_0xdd96('0x11')](function(_0x7e0d2f){_0x4c84f1(_0x7e0d2f);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x18')]=function(_0x1f35a6,_0x4ef2ba){this[_0xdd96('0xb')][_0xdd96('0x19')](_0x1f35a6)[_0xdd96('0xf')](function(_0x676b82){_0x4ef2ba(null,_0x676b82?_0x676b82['name']:![]);})[_0xdd96('0x11')](function(_0x441fba){_0x4ef2ba(_0x441fba);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1a')]=function(_0x2387e7,_0x54ef0e){this[_0xdd96('0xb')]['getTrunkById'](_0x2387e7)[_0xdd96('0xf')](function(_0x3ae7e5){_0x54ef0e(null,_0x3ae7e5?_0x3ae7e5[_0xdd96('0x10')]:![]);})[_0xdd96('0x11')](function(_0xe41762){_0x54ef0e(_0xe41762);});};AGIVertices[_0xdd96('0xc')]['getSound']=function(_0x4a9104,_0x5c2cbd){var _0x23b1aa=this;this['rpc'][_0xdd96('0x1b')](_0x4a9104)[_0xdd96('0xf')](function(_0x29aac0){_0x5c2cbd(null,_0x29aac0?_0x23b1aa[_0xdd96('0x1c')](_0x29aac0[_0xdd96('0x1d')]):![]);})['catch'](function(_0x396e84){_0x5c2cbd(_0x396e84);});};AGIVertices[_0xdd96('0xc')]['getMailAccount']=function(_0x562877,_0x239f72){this[_0xdd96('0xb')]['getMailAccountById'](_0x562877)['then'](function(_0x37b92a){_0x239f72(null,_0x37b92a?_0x37b92a:![]);})[_0xdd96('0x11')](function(_0x5e8f18){_0x239f72(_0x5e8f18);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1e')]=function(_0x3d229b,_0x564edd,_0x18eaeb){this['mailRpc']['sendMailMessage'](_0x3d229b,_0x564edd)[_0xdd96('0xf')](function(){_0x18eaeb(null);})['catch'](function(_0x4f551a){_0x18eaeb(_0x4f551a);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1f')]=function(_0x12dd21,_0x5f5b74){this['rpc'][_0xdd96('0x20')](_0x12dd21)[_0xdd96('0xf')](function(_0x2fcce6){if(_0x2fcce6){if(_0x2fcce6[_0xdd96('0x21')]){_0x5f5b74(null,[_0x2fcce6[_0xdd96('0x22')]]);}else{_0x5f5b74(null,_[_0xdd96('0x23')](_0x2fcce6[_0xdd96('0x24')],_0xdd96('0x22')));}}else{_0x5f5b74(null,![]);}})['catch'](function(_0x49770e){_0x5f5b74(_0x49770e);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1c')]=function(_0xedb4c1){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0xedb4c1);};AGIVertices[_0xdd96('0xc')]['getQueryOdbc']=function(_0x222014,_0x18ade8,_0x265ce1){odbc['open'](_0x222014,function(_0x459157){if(_0x459157){logger[_0xdd96('0x25')](_0xdd96('0x26'),_0x459157);_0x265ce1(_0x459157);}else{logger[_0xdd96('0x27')](_0xdd96('0x28'));odbc[_0xdd96('0x29')](_0x18ade8,function(_0x11f26a,_0x443f18){if(_0x11f26a){logger[_0xdd96('0x27')]('Error\x20executing\x20query\x20%s',_0x18ade8);_0x265ce1(_0x11f26a);}else{logger['info'](_0xdd96('0x2a'),_0x18ade8);odbc['close'](function(_0x243187){if(_0x243187){logger[_0xdd96('0x25')](_0xdd96('0x2b'),_0x243187);}_0x265ce1(null,_0x443f18);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x2c6fb6,_0x130e6b){this[_0xdd96('0xb')][_0xdd96('0x2c')](_0x2c6fb6)[_0xdd96('0xf')](function(_0x19e450){_0x130e6b(null,_0x19e450?_0x19e450:![]);})[_0xdd96('0x11')](function(_0x547b5e){_0x130e6b(_0x547b5e);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x2d')]=function(_0x5255d9,_0x2b129d){this['rpc']['createSmsMessage'](_0x5255d9)[_0xdd96('0xf')](function(_0x59601b){_0x2b129d(null,_0x59601b);})[_0xdd96('0x11')](function(_0x4e8601){_0x2b129d(_0x4e8601);});};AGIVertices[_0xdd96('0xc')]['createSquareDetailsReport']=function(_0x2c7739,_0x35fff8,_0x27390a){this[_0xdd96('0xb')][_0xdd96('0x2e')]({'uniqueid':this[_0xdd96('0x2f')][_0xdd96('0x30')],'node':_0x2c7739[_0xdd96('0x31')],'application':_0x2c7739[_0xdd96('0x32')],'data':_0x35fff8||null,'project_name':this[_0xdd96('0x2f')]['arg_1'],'callerid':this[_0xdd96('0x2f')][_0xdd96('0x33')]})['then'](function(_0x280314){if(_0x27390a){_0x27390a(null,_0x280314);}})[_0xdd96('0x11')](function(_0x15ef8c){if(_0x27390a){_0x27390a(_0x15ef8c);}});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x34')]=function(_0x146f40,_0x1413f7,_0x5cd00c,_0x31675f){this[_0xdd96('0xb')][_0xdd96('0x34')]({'uniqueid':this[_0xdd96('0x2f')][_0xdd96('0x30')],'callerid':this[_0xdd96('0x2f')][_0xdd96('0x33')],'calleridname':this[_0xdd96('0x2f')][_0xdd96('0x35')],'context':this[_0xdd96('0x2f')]['context'],'extension':this[_0xdd96('0x2f')][_0xdd96('0x36')],'priority':this[_0xdd96('0x2f')][_0xdd96('0x37')],'accountcode':this[_0xdd96('0x2f')][_0xdd96('0x38')],'dnid':this[_0xdd96('0x2f')]['dnid'],'projectName':this[_0xdd96('0x2f')][_0xdd96('0x39')],'saveName':_0x1413f7,'filename':_0x146f40['file']||_0x1413f7,'savePath':_0x5cd00c})[_0xdd96('0xf')](function(_0x119284){_0x31675f(null,_0x119284);})[_0xdd96('0x11')](function(_0x2ee101){_0x31675f(_0x2ee101);});};AGIVertices['prototype']['createSquareMessage']=function(_0x1d92c6,_0xf67e7,_0x131f41,_0x51485d,_0xd6c098){this[_0xdd96('0xb')][_0xdd96('0x3a')]({'uniqueid':this[_0xdd96('0x2f')][_0xdd96('0x30')],'body':_0x1d92c6,'direction':_0xf67e7,'providerName':_0x131f41,'providerResponse':_0x51485d})[_0xdd96('0xf')](function(_0x323907){if(_0xd6c098){_0xd6c098(null,_0x323907);}})['catch'](function(_0x4ba056){if(_0xd6c098){_0xd6c098(_0x4ba056);}});};AGIVertices['prototype'][_0xdd96('0x3b')]=function(_0x19ff24,_0x3cec05){this[_0xdd96('0xb')][_0xdd96('0x3b')]({'firstName':_[_0xdd96('0x3c')](_0x19ff24[_0xdd96('0x10')])||_[_0xdd96('0x3d')](_0x19ff24[_0xdd96('0x10')])?_0xdd96('0x3e')+Math['random']():_0x19ff24[_0xdd96('0x10')],'lastName':_[_0xdd96('0x3c')](_0x19ff24[_0xdd96('0x3f')])||_[_0xdd96('0x3d')](_0x19ff24['lastName'])?null:_0x19ff24[_0xdd96('0x3f')],'phone':_0x19ff24[_0xdd96('0x40')],'ListId':_0x19ff24[_0xdd96('0x41')],'scheduledat':_0x19ff24[_0xdd96('0x42')],'callbackUniqueid':this['channel'][_0xdd96('0x30')],'tags':'callback','description':_0xdd96('0x43')+_0x19ff24[_0xdd96('0x42')]['toString'](),'priority':_0x19ff24[_0xdd96('0x44')]})[_0xdd96('0xf')](function(_0x12dc5d){_0x3cec05(null,_0x12dc5d);})['catch'](function(_0x13572e){_0x3cec05(_0x13572e);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x45')]=function(_0x5edf23,_0x168c88){this['rpc'][_0xdd96('0x46')](_0x5edf23)[_0xdd96('0xf')](function(_0x242f3d){_0x168c88(null,_0x242f3d?_0x242f3d[_0xdd96('0x10')]:![]);})[_0xdd96('0x11')](function(_0x24e17f){_0x168c88(_0x24e17f);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x47')]=function(_0x5c7995,_0x1aad41,_0x5582f0){var _0x345d7b={'role':_0xdd96('0x48')};_0x345d7b[_0x5c7995]=this['channel'][_0xdd96('0x33')];this[_0xdd96('0xb')][_0xdd96('0x47')](_0x345d7b,_0x1aad41,this['channel'][_0xdd96('0x30')])['then'](function(_0x4ecdb2){_0x5582f0(null,_['isNil'](_0x4ecdb2)?![]:!![]);})[_0xdd96('0x11')](function(_0xa36aa3){logger[_0xdd96('0x25')](_0xa36aa3);_0x5582f0(null,![]);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x49')]=function(_0x46c90e,_0x308ff7){var _0x34e87b={'role':_0xdd96('0x48')};_0x34e87b[_0x46c90e]=this[_0xdd96('0x2f')][_0xdd96('0x33')];this['rpc'][_0xdd96('0x49')](_0x34e87b)[_0xdd96('0xf')](function(_0x7eeef7){_0x308ff7(null,_['isNil'](_0x7eeef7)?![]:!![]);})[_0xdd96('0x11')](function(_0x3188ee){logger[_0xdd96('0x25')](_0x3188ee);_0x308ff7(null,![]);});};AGIVertices[_0xdd96('0xc')]['agentLogout']=function(_0x37d221,_0x2a0281){var _0x20262f={'role':'agent'};_0x20262f[_0x37d221]=this[_0xdd96('0x2f')][_0xdd96('0x33')];this[_0xdd96('0xb')][_0xdd96('0x4a')](_0x20262f)[_0xdd96('0xf')](function(_0x438fe0){_0x2a0281(null,_['isNil'](_0x438fe0)?![]:!![]);})[_0xdd96('0x11')](function(_0x2c8f2d){logger['error'](_0x2c8f2d);_0x2a0281(null,![]);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x4b')]=function(_0x1878a2,_0x5562c7){var _0x280a3d={'role':_0xdd96('0x48')};_0x280a3d[_0x1878a2]=this['channel']['callerid'];var _0x3486a1=_0x1878a2!=_0xdd96('0x4c')?util[_0xdd96('0x4d')](_0xdd96('0x4e'),_0xdd96('0x4f'),this['channel']['callerid']):undefined;this[_0xdd96('0xb')][_0xdd96('0x4b')](_0x280a3d,_0x3486a1)[_0xdd96('0xf')](function(_0x402d42){_0x5562c7(null,_[_0xdd96('0x3d')](_0x402d42)?![]:!![]);})[_0xdd96('0x11')](function(_0xa4c448){logger[_0xdd96('0x25')](_0xa4c448);_0x5562c7(null,![]);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x50')]=function(_0x3d79d6,_0x4e9e69){sh[_0xdd96('0x51')](_[_0xdd96('0x52')](_0x3d79d6),function(_0x26726e,_0x1eb454){var _0x512110=_0x1eb454[_0xdd96('0x53')](/(\r\n|\n|\r)/gm,'');_0x4e9e69(null,_0x512110);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x54')]=function(_0x3890b1,_0x5e9086){scripts[_0xdd96('0x54')](_0x3890b1[_0xdd96('0x55')],_0x3890b1[_0xdd96('0x56')]||'text',_0x3890b1[_0xdd96('0x57')],_0x3890b1['languageCode']||_0xdd96('0x58'),_0x3890b1['ssmlGender']||'MALE',_0x3890b1[_0xdd96('0x59')]||_0xdd96('0x5a'))[_0xdd96('0xf')](function(_0xb673f8){_0x5e9086(null,_0xb673f8);})[_0xdd96('0x11')](function(_0x4f619d){_0x5e9086(_0x4f619d);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x5b')]=function(_0x46061b,_0x22c676){scripts[_0xdd96('0x5b')](_0x46061b[_0xdd96('0x57')],_0x46061b[_0xdd96('0x5c')]||'en',0x1)['then'](function(_0x2c1f36){_0x22c676(null,_0x2c1f36);})[_0xdd96('0x11')](function(_0x1d2a21){_0x22c676(_0x1d2a21);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x5d')]=function(_0x293533,_0x27ab76){var _0x406e89={'uri':_0x293533['url'],'method':_0x293533[_0xdd96('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x293533[_0xdd96('0x5f')])===_0xdd96('0x60')&&parseInt(_0x293533[_0xdd96('0x5f')])>=0x1?parseInt(_0x293533[_0xdd96('0x5f')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xdd96('0x61')],_0x406e89[_0xdd96('0x5e')]['toUpperCase']())){try{_0x406e89[_0xdd96('0x62')]=_0x293533[_0xdd96('0xa')]?JSON[_0xdd96('0x63')](_0x293533[_0xdd96('0xa')]):{};}catch(_0x4f1d74){logger[_0xdd96('0x25')](_0xdd96('0x64'),_0x4f1d74);}}try{_0x406e89[_0xdd96('0x65')]=_0x293533[_0xdd96('0x9')]?JSON['parse'](_0x293533[_0xdd96('0x9')]):{};}catch(_0x4777a1){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4777a1);}if(_0x293533[_0xdd96('0x66')]){try{var _0x2efc2e=require(_0x293533['computedVariables'])['sync'](this,_0x406e89);_0x406e89[_0xdd96('0x67')]=Mustache[_0xdd96('0x68')](_0x293533[_0xdd96('0x69')],_0x2efc2e,{},['$$','$$']);if(_0x406e89[_0xdd96('0x65')]){_0x406e89[_0xdd96('0x65')]=JSON['parse'](Mustache[_0xdd96('0x68')](JSON[_0xdd96('0x6a')](_0x406e89['headers']),_0x2efc2e,{},['$$','$$']));}if(_0x406e89[_0xdd96('0x62')]){_0x406e89[_0xdd96('0x62')]=JSON[_0xdd96('0x63')](Mustache[_0xdd96('0x68')](JSON['stringify'](_0x406e89[_0xdd96('0x62')]),_0x2efc2e,{},['$$','$$']));}}catch(_0x6be490){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x6be490);}}rp(_0x406e89)[_0xdd96('0xf')](function(_0x22c159){var _0x2dfbaf={'statusCode':_0x22c159[_0xdd96('0x6b')]||0xc8,'statusMessage':_0x22c159[_0xdd96('0x6c')]||'OK','headers':_0x22c159[_0xdd96('0x65')]||{},'body':_0x22c159['body']||{}};_0x27ab76(null,_0x2dfbaf);})[_0xdd96('0x11')](function(_0x4cc9af){var _0x2bca09={'statusCode':_0x4cc9af[_0xdd96('0x6b')]||0x1f4,'statusMessage':_0x4cc9af['message']||_0xdd96('0x6d'),'headers':_0x4cc9af[_0xdd96('0x6e')][_0xdd96('0x65')]||{},'body':_0x4cc9af['options']['body']||{}};_0x27ab76(null,_0x2bca09);});};AGIVertices[_0xdd96('0xc')]['googleDialogflow']=function(_0x578786,_0x10d5b6){scripts[_0xdd96('0x6f')](this[_0xdd96('0x2f')][_0xdd96('0x30')],_0x578786[_0xdd96('0x70')],_0x578786[_0xdd96('0x57')],_0x578786['dialogflow_language']||'en')[_0xdd96('0xf')](function(_0x548a7d){_0x10d5b6(null,_0x548a7d);})[_0xdd96('0x11')](function(_0x247e81){_0x10d5b6(_0x247e81);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x71')]=function(_0xd375b7,_0x56ecb0){scripts[_0xdd96('0x71')](this[_0xdd96('0x2f')][_0xdd96('0x30')],_0xd375b7[_0xdd96('0x72')],_0xd375b7[_0xdd96('0x73')],_0xd375b7['private_key'],_0xd375b7['text'],_0xd375b7[_0xdd96('0x74')]||'en')[_0xdd96('0xf')](function(_0x44c92f){_0x56ecb0(null,_0x44c92f);})[_0xdd96('0x11')](function(_0x1b586b){_0x56ecb0(_0x1b586b);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x75')]=function(_0x39640f,_0x9f1053){scripts['sestekNDA'](this[_0xdd96('0x2f')],_0x39640f)[_0xdd96('0xf')](function(_0x518aaf){_0x9f1053(null,_0x518aaf);})['catch'](function(_0x424f9e){_0x9f1053(_0x424f9e);});};AGIVertices['prototype'][_0xdd96('0x76')]=function(_0x4a05e5,_0xb81bfd){scripts['ispeechTTS'](_0x4a05e5[_0xdd96('0x70')],_0x4a05e5['text'],_0x4a05e5[_0xdd96('0x77')]||_0xdd96('0x58'),_0x4a05e5[_0xdd96('0x78')])[_0xdd96('0xf')](function(_0xf4937d){_0xb81bfd(null,_0xf4937d);})['catch'](function(_0x2f57d4){_0xb81bfd(_0x2f57d4);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x79')]=function(_0x16e5a6,_0xcfeea4,_0x2a7652){scripts[_0xdd96('0x79')](_0xcfeea4,_0x16e5a6['key'],_0x16e5a6[_0xdd96('0x7a')]||_0xdd96('0x58'),this[_0xdd96('0x7b')](_0x16e5a6[_0xdd96('0x7c')])?_0x16e5a6[_0xdd96('0x7c')]:undefined)['then'](function(_0x49d774){_0x2a7652(null,_0x49d774);})[_0xdd96('0x11')](function(_0x15cdfe){_0x2a7652(_0x15cdfe);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x7d')]=function(_0x162f79,_0x26f39d){scripts[_0xdd96('0x7d')](_0x162f79[_0xdd96('0x7e')],_0x162f79['aws_secret_access_key'],_0x162f79[_0xdd96('0x7f')],_0x162f79[_0xdd96('0x80')]||_0xdd96('0x81'),_0x162f79[_0xdd96('0x57')],_0x162f79['aws_text_type']||_0xdd96('0x57'))[_0xdd96('0xf')](function(_0x18de96){_0x26f39d(null,_0x18de96);})[_0xdd96('0x11')](function(_0x51d0f2){_0x26f39d(_0x51d0f2);});};AGIVertices[_0xdd96('0xc')]['awsLex']=function(_0x3e4e6e,_0x518133){scripts[_0xdd96('0x82')](this[_0xdd96('0x2f')][_0xdd96('0x30')],_0x3e4e6e[_0xdd96('0x7e')],_0x3e4e6e[_0xdd96('0x83')],_0x3e4e6e['aws_lex_region'],_0x3e4e6e[_0xdd96('0x57')],_0x3e4e6e[_0xdd96('0x84')])[_0xdd96('0xf')](function(_0x3c0896){_0x518133(null,_0x3c0896);})[_0xdd96('0x11')](function(_0x55094f){_0x518133(_0x55094f);});};AGIVertices[_0xdd96('0xc')]['googleASR']=function(_0x147d8c,_0x25ef89,_0x2e7407){scripts['googleASR'](_0x25ef89,_0x147d8c[_0xdd96('0x70')],_0x147d8c[_0xdd96('0x85')]||_0xdd96('0x58'))[_0xdd96('0xf')](function(_0xf0585a){_0x2e7407(null,_0xf0585a);})[_0xdd96('0x11')](function(_0x41b092){_0x2e7407(_0x41b092);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x86')]=function(_0x41bd92,_0x117c0d,_0x45c7d0){scripts['tildeASR'](_0x117c0d,_0x41bd92[_0xdd96('0x87')],_0x41bd92[_0xdd96('0x88')],_0x41bd92['uri'])['then'](function(_0x41d943){_0x45c7d0(null,_0x41d943);})[_0xdd96('0x11')](function(_0x2009e3){_0x45c7d0(_0x2009e3);});};AGIVertices[_0xdd96('0xc')][_0xdd96('0x89')]=function(_0x24b5ee){var _0x5bf728=_[_0xdd96('0x8a')](verticesWithRetry,_0x24b5ee[_0xdd96('0x32')])?_0x24b5ee:_[_0xdd96('0x8b')](_0x24b5ee);for(var _0x4ecafe in _0x5bf728){if(_0x5bf728[_0xdd96('0x8c')](_0x4ecafe)){if(_0x5bf728[_0x4ecafe]&&_['isString'](_0x5bf728[_0x4ecafe])){if(_['includes'](recursiveMapAttributes,_0x4ecafe)){_0x5bf728[_0x4ecafe]=this['replaceObjectAllVariables'](_0x5bf728[_0x4ecafe]);}else{_0x5bf728[_0x4ecafe]=this[_0xdd96('0x8d')](_0x5bf728[_0x4ecafe]);}}}}return _0x5bf728;};AGIVertices[_0xdd96('0xc')][_0xdd96('0x8e')]=function(_0x5828ab){for(var _0x1656ff in _0x5828ab){if(_0x5828ab[_0xdd96('0x8c')](_0x1656ff)){if(_[_0xdd96('0x8f')](_0x5828ab[_0x1656ff])){this['recursiveNodeIndex'](_0x5828ab[_0x1656ff]);}else if(_['isArray'](_0x5828ab[_0x1656ff])){for(var _0x1cea38=0x0;_0x1cea38<_0x5828ab[_0x1656ff]['length'];_0x1cea38++){this[_0xdd96('0x8e')](_0x5828ab[_0x1656ff][_0x1cea38]);}}else if(_[_0xdd96('0x90')](_0x5828ab[_0x1656ff])){_0x5828ab[_0x1656ff]=this['replaceAllVariables'](_0x5828ab[_0x1656ff]);}}}};AGIVertices[_0xdd96('0xc')][_0xdd96('0x91')]=function(_0x2f52fc,_0x161080){for(var _0x1e8d59 in _0x2f52fc){if(_0x2f52fc[_0xdd96('0x8c')](_0x1e8d59)){if(_[_0xdd96('0x8f')](_0x2f52fc[_0x1e8d59])){if(!_[_0xdd96('0x3c')](_0x2f52fc[_0x1e8d59])){this[_0xdd96('0x91')](_0x2f52fc[_0x1e8d59],util['format'](_0xdd96('0x92'),_0x161080,_0x1e8d59));}}else if(_['isArray'](_0x2f52fc[_0x1e8d59])){for(var _0x539e80=0x0;_0x539e80<_0x2f52fc[_0x1e8d59]['length'];_0x539e80++){this[_0xdd96('0x91')](_0x2f52fc[_0x1e8d59][_0x539e80],util[_0xdd96('0x4d')](_0xdd96('0x92'),_0x161080,_0x1e8d59+'['+_0x539e80+']'));}}else{if(!_[_0xdd96('0x3d')](_0x2f52fc[_0x1e8d59])){this[_0xdd96('0x2f')]['setVariable'](util[_0xdd96('0x4d')]('%s.%s',_0x161080,_0x1e8d59),_0x2f52fc[_0x1e8d59]);}}}}};AGIVertices[_0xdd96('0xc')][_0xdd96('0x93')]=function(_0xc13e7a){try{var _0xa41fe7=JSON['parse'](_0xc13e7a);this[_0xdd96('0x8e')](_0xa41fe7);return JSON[_0xdd96('0x6a')](_0xa41fe7);}catch(_0x3ec82f){return this[_0xdd96('0x8d')](_0xc13e7a);}};AGIVertices[_0xdd96('0xc')][_0xdd96('0x8d')]=function(_0x307170){var _0x16b9fc=_0x307170[_0xdd96('0x94')]('{');for(var _0x5919f5=0x1;_0x5919f5<_0x16b9fc[_0xdd96('0x95')];_0x5919f5+=0x1){var _0x195ee4=_0x16b9fc[_0x5919f5][_0xdd96('0x94')]('}');if(_0x195ee4[_0xdd96('0x95')]>0x1){_0x307170=_0x307170[_0xdd96('0x96')]('{'+_0x195ee4[0x0]+'}',this[_0xdd96('0x2f')]['getVariable'](_0x195ee4[0x0])['extra']||_0x195ee4[0x0]);}}if(_0x16b9fc['length']===0x1){return _0x307170['toString']();}return this[_0xdd96('0x8d')](_0x307170);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x97')]=function(_0xe7645,_0x5a719c){var _0x231297=this[_0xdd96('0x2f')][_0xdd96('0xd')](_0xe7645);if(_0x231297['result']===-0x1){return _0x231297;}logger[_0xdd96('0x27')](util['format'](_0xdd96('0x98'),_0x5a719c,_0x231297[_0xdd96('0x99')]));return this[_0xdd96('0x2f')][_0xdd96('0x9a')](_0x5a719c,_0x231297[_0xdd96('0x99')]);};AGIVertices['prototype'][_0xdd96('0x7b')]=function(_0x591cca){return _0x591cca&&_0x591cca!=='0'&&_0x591cca!=='-1'&&_0x591cca!=='';};AGIVertices['prototype'][_0xdd96('0x9b')]=function(_0x5a28f0){this[_0xdd96('0x2e')][_0xdd96('0x9c')](this,_0x5a28f0,'-');_0x5a28f0['retry']=_0x5a28f0[_0xdd96('0x9b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xdd96('0xc')][_0xdd96('0x9d')]=function(_0x2e6f7b){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2e6f7b[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x2e6f7b[_0xdd96('0x57')])){return this['channel'][_0xdd96('0x9e')](_0xdd96('0x9f'));}var _0x41c20c='\x22'+_0x2e6f7b[_0xdd96('0x57')]+'\x22';if(this[_0xdd96('0x7b')](_0x2e6f7b['options'])){_0x41c20c+=','+_0x2e6f7b['options'];}var _0x333f2d=this['channel'][_0xdd96('0x51')](_0xdd96('0xa0'),_0x41c20c);if(_0x333f2d[_0xdd96('0xa1')]===-0x1){return _0x333f2d;}return this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xa2'),_0x41c20c));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xa3')]=function(_0x1ddbff){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0xa4'),_0x1ddbff[_0xdd96('0x31')]));if(!this['isConfigured'](_0x1ddbff[_0xdd96('0xa5')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20grammar\x20configured');}var _0x2326ec=_0x1ddbff[_0xdd96('0xa5')];if(this[_0xdd96('0x7b')](_0x1ddbff['options'])){_0x2326ec+=','+_0x1ddbff[_0xdd96('0x6e')];}var _0x92e9a7=this[_0xdd96('0x2f')][_0xdd96('0x51')](_0xdd96('0xa6'),_0x2326ec);if(_0x92e9a7['result']===-0x1){return _0x92e9a7;}var _0x164311=this[_0xdd96('0x97')](_0xdd96('0xa7'),_0xdd96('0xa8'));if(_0x164311[_0xdd96('0xa1')]===-0x1){return _0x164311;}var _0x1654d3=this['getAndSetVariable'](_0xdd96('0xa9'),_0xdd96('0xaa'));if(_0x1654d3[_0xdd96('0xa1')]===-0x1){return _0x1654d3;}var _0x52e677=this[_0xdd96('0x97')](_0xdd96('0xab'),_0xdd96('0xac'));if(_0x52e677[_0xdd96('0xa1')]===-0x1){return _0x52e677;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xad'),_0x2326ec));};AGIVertices[_0xdd96('0xc')]['agi']=function(_0x14b11a){logger[_0xdd96('0x27')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x14b11a['label']));return this[_0xdd96('0x2f')][_0xdd96('0xae')]([_0x14b11a[_0xdd96('0xaf')],_0x14b11a[_0xdd96('0xb0')]]);};AGIVertices[_0xdd96('0xc')]['answer']=function(_0x429789){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x429789[_0xdd96('0x31')]));if(this['isConfigured'](_0x429789[_0xdd96('0x5f')])){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x429789['timeout']));var _0x25d4ac=this[_0xdd96('0x2f')]['wait'](_0x429789[_0xdd96('0x5f')]);if(_0x25d4ac[_0xdd96('0xa1')]===-0x1){return _0x25d4ac;}}return this[_0xdd96('0x2f')]['answer']();};AGIVertices[_0xdd96('0xc')][_0xdd96('0xb1')]=function(_0x4165a4){logger[_0xdd96('0x27')](util['format'](_0xdd96('0xb2'),_0x4165a4[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x4165a4[_0xdd96('0x41')])){return this[_0xdd96('0x2f')]['error'](_0x4165a4,_0xdd96('0xb3'));}_0x4165a4[_0xdd96('0x42')]=moment();if(this[_0xdd96('0x7b')](_0x4165a4[_0xdd96('0xb4')])){_0x4165a4[_0xdd96('0x42')]=moment()[_0xdd96('0xb5')](_0x4165a4[_0xdd96('0xb4')],_0xdd96('0xb6'));}if(!this[_0xdd96('0x7b')](_0x4165a4[_0xdd96('0x44')])){_0x4165a4[_0xdd96('0x44')]=0x2;}this['createCmContact'][_0xdd96('0x9c')](this,_0x4165a4);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xb7'),_0x4165a4[_0xdd96('0x40')],_0x4165a4[_0xdd96('0x41')],_0x4165a4[_0xdd96('0x42')]));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xb8')]=function(_0x25f51c){logger[_0xdd96('0x27')](util['format'](_0xdd96('0xb9'),_0x25f51c[_0xdd96('0x31')]));var _0x10a075=this[_0xdd96('0x2f')]['exec'](_0x25f51c[_0xdd96('0xba')],_0x25f51c[_0xdd96('0x6e')]);if(_0x10a075[_0xdd96('0xa1')]===-0x1){return _0x10a075;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xbb'),_0x25f51c['application'],_0x25f51c['options']));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xbc')]=function(_0x536e88){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x536e88[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x536e88['text'])){return this[_0xdd96('0x2f')]['noop'](_0xdd96('0x9f'));}var _0xb56da6='\x22'+_0x536e88[_0xdd96('0x57')]+'\x22';if(this[_0xdd96('0x7b')](_0x536e88[_0xdd96('0x6e')])){_0xb56da6+=','+_0x536e88[_0xdd96('0x6e')];}var _0x417a3f=this[_0xdd96('0x2f')][_0xdd96('0x51')]('MRCPSynth',_0xb56da6);if(_0x417a3f['result']===-0x1){return _0x417a3f;}return this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')](_0xdd96('0xa2'),_0xb56da6));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xbd')]=function(_0x39ecfd){logger['info'](util[_0xdd96('0x4d')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x39ecfd[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x39ecfd[_0xdd96('0x57')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x9f'));}var _0x500567='\x22'+_0x39ecfd['text']+'\x22';if(this['isConfigured'](_0x39ecfd[_0xdd96('0x6e')])){_0x500567+=','+_0x39ecfd[_0xdd96('0x6e')];}var _0x397b66=this[_0xdd96('0x2f')][_0xdd96('0x51')]('MRCPSynth',_0x500567);if(_0x397b66[_0xdd96('0xa1')]===-0x1){return _0x397b66;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xa2'),_0x500567));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xbe')]=function(_0x1f91ea){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0xbf'),_0x1f91ea[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x1f91ea[_0xdd96('0xa5')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xc0'));}var _0x3047c7=_0x1f91ea[_0xdd96('0xa5')];if(this[_0xdd96('0x7b')](_0x1f91ea[_0xdd96('0x6e')])){_0x3047c7+=','+_0x1f91ea['options'];}var _0xa1f36d=this[_0xdd96('0x2f')][_0xdd96('0x51')](_0xdd96('0xa6'),_0x3047c7);if(_0xa1f36d[_0xdd96('0xa1')]===-0x1){return _0xa1f36d;}var _0x1db4c8=this[_0xdd96('0x97')](_0xdd96('0xa7'),_0xdd96('0xc1'));if(_0x1db4c8[_0xdd96('0xa1')]===-0x1){return _0x1db4c8;}var _0x44068=this[_0xdd96('0x97')](_0xdd96('0xa9'),_0xdd96('0xc2'));if(_0x44068[_0xdd96('0xa1')]===-0x1){return _0x44068;}var _0x3b82d5=this[_0xdd96('0x97')](_0xdd96('0xab'),_0xdd96('0xc3'));if(_0x3b82d5[_0xdd96('0xa1')]===-0x1){return _0x3b82d5;}return this['channel']['noop'](util['format'](_0xdd96('0xad'),_0x3047c7));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xc4')]=function(_0x378c3d){logger[_0xdd96('0x27')](util['format'](_0xdd96('0xc5'),_0x378c3d[_0xdd96('0x31')]));if(!this['isConfigured'](_0x378c3d['grammar'])){return this['channel']['noop'](_0xdd96('0xc0'));}var _0x2819cb=_0x378c3d[_0xdd96('0xa5')];if(this[_0xdd96('0x7b')](_0x378c3d[_0xdd96('0x6e')])){_0x2819cb+=','+_0x378c3d[_0xdd96('0x6e')];}var _0x5e675a=this[_0xdd96('0x2f')][_0xdd96('0x51')](_0xdd96('0xa6'),_0x2819cb);if(_0x5e675a[_0xdd96('0xa1')]===-0x1){return _0x5e675a;}var _0x5f28be=this['getAndSetVariable'](_0xdd96('0xa7'),_0xdd96('0xc6'));if(_0x5f28be[_0xdd96('0xa1')]===-0x1){return _0x5f28be;}var _0x3b6214=this['getAndSetVariable'](_0xdd96('0xa9'),_0xdd96('0xc7'));if(_0x3b6214[_0xdd96('0xa1')]===-0x1){return _0x3b6214;}var _0x376c6d=this[_0xdd96('0x97')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x376c6d[_0xdd96('0xa1')]===-0x1){return _0x376c6d;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2819cb));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xc8')]=function(_0x581b07){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x581b07[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x581b07[_0xdd96('0xc9')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x581b07,_0xdd96('0xca'));}var _0x2a2307=this[_0xdd96('0x16')][_0xdd96('0x9c')](this,_0x581b07[_0xdd96('0xc9')]);if(!_0x2a2307){return this['channel'][_0xdd96('0x25')](_0x581b07,_0xdd96('0xcb'));}if(!this[_0xdd96('0x7b')](_0x581b07[_0xdd96('0x29')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x581b07,_0xdd96('0xcc'));}var _0x1e8933=_0x581b07[_0xdd96('0x29')][_0xdd96('0x53')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xcd'),_0x1e8933));var _0x10e17d=this[_0xdd96('0xce')]['sync'](this,_0x2a2307,_0x1e8933);this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x581b07,_0x1e8933);if(!this['isConfigured'](_0x581b07[_0xdd96('0xcf')])){return this[_0xdd96('0x2f')]['noop'](_0xdd96('0xd0'));}var _0x78bf6a=this[_0xdd96('0xd')][_0xdd96('0x9c')](this,_0x581b07[_0xdd96('0xcf')]);if(!_0x78bf6a){return this['channel']['error'](_0x581b07,_0xdd96('0xd1'));}var _0x1fa741=this;_0x10e17d[_0xdd96('0xd2')](function(_0x38686a,_0x2ff755){Object[_0xdd96('0xd3')](_0x38686a)[_0xdd96('0xd2')](function(_0xb31717){_0x1fa741[_0xdd96('0x2f')][_0xdd96('0x9a')](util[_0xdd96('0x4d')]('%s[%s][%s]',_0x78bf6a,_0x2ff755,_0xb31717),_0x38686a[_0xb31717]);});});this[_0xdd96('0x2f')][_0xdd96('0x9a')](util['format'](_0xdd96('0xd4'),_0x78bf6a),_0x10e17d[_0xdd96('0x95')]);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xd5'),_0x78bf6a));};AGIVertices[_0xdd96('0xc')]['dial']=function(_0x399b3e){logger['debug'](util[_0xdd96('0x4d')](_0xdd96('0xd6'),_0x399b3e[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x399b3e[_0xdd96('0xd7')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x399b3e,'no\x20user\x20selected');}var _0x4c0a58=this[_0xdd96('0x18')][_0xdd96('0x9c')](this,_0x399b3e[_0xdd96('0xd7')]);if(!_0x4c0a58){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x399b3e,_0xdd96('0xd8'));}var _0x302581=this['channel'][_0xdd96('0x51')](_0xdd96('0xd9'),[util[_0xdd96('0x4d')](_0xdd96('0xda'),_0x4c0a58),_0x399b3e[_0xdd96('0x5f')],_0x399b3e['opts'],_0x399b3e[_0xdd96('0x69')]]);if(_0x302581['result']===-0x1){return _0x302581;}return this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')](_0xdd96('0xdb'),_0xdd96('0xd9')));};AGIVertices[_0xdd96('0xc')]['dialogflow']=function(_0x4dbbf5){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0xdc'),_0x4dbbf5[_0xdd96('0x31')]));if(!this['isConfigured'](_0x4dbbf5[_0xdd96('0x70')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xdd'));}if(!this[_0xdd96('0x7b')](_0x4dbbf5['text'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20text\x20configured');}this[_0xdd96('0x2f')][_0xdd96('0xde')]=!![];this[_0xdd96('0x2e')](_0x4dbbf5);this[_0xdd96('0x3a')](_0x4dbbf5[_0xdd96('0x57')],'in','','');this['channel']['noop'](util['format'](_0xdd96('0xdf'),_0x4dbbf5[_0xdd96('0x57')]));var _0x2b4a8c=this[_0xdd96('0x6f')][_0xdd96('0x9c')](this,_0x4dbbf5);if(_0x2b4a8c){for(var _0x4518fa in _0x2b4a8c){if(_0x2b4a8c[_0xdd96('0x8c')](_0x4518fa)){this[_0xdd96('0x2f')][_0xdd96('0x9a')](util[_0xdd96('0x4d')]('DIALOGFLOW_%s',_0x4518fa['toUpperCase']()),_0x2b4a8c[_0x4518fa]);}}this[_0xdd96('0x3a')](_0x2b4a8c[_0xdd96('0xe0')],_0xdd96('0xe1'),_0xdd96('0xe2'),'');return this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')](_0xdd96('0xe3'),_0x2b4a8c[_0xdd96('0xe0')]));}return this[_0xdd96('0x2f')]['error'](_0x4dbbf5,_0xdd96('0xe4'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xe5')]=function(_0xdf7e3c){logger[_0xdd96('0x27')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xdf7e3c[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0xdf7e3c[_0xdd96('0x72')])){return this[_0xdd96('0x2f')]['noop']('no\x20project_id\x20configured');}if(!this[_0xdd96('0x7b')](_0xdf7e3c[_0xdd96('0x73')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xe6'));}if(!this['isConfigured'](_0xdf7e3c[_0xdd96('0xe7')])){return this['channel'][_0xdd96('0x9e')]('no\x20private_key\x20configured');}if(!this[_0xdd96('0x7b')](_0xdf7e3c[_0xdd96('0x74')])){return this['channel'][_0xdd96('0x9e')](_0xdd96('0xe8'));}if(!this['isConfigured'](_0xdf7e3c[_0xdd96('0x57')])){return this[_0xdd96('0x2f')]['noop'](_0xdd96('0x9f'));}this[_0xdd96('0x2f')]['bot']=!![];this[_0xdd96('0x2e')](_0xdf7e3c);this['createSquareMessage'](_0xdf7e3c[_0xdd96('0x57')],'in','','');this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0xe9'),_0xdf7e3c[_0xdd96('0x57')]));var _0x44fdae=this[_0xdd96('0x71')][_0xdd96('0x9c')](this,_0xdf7e3c);if(_0x44fdae){for(var _0x245346 in _0x44fdae){if(_0x44fdae[_0xdd96('0x8c')](_0x245346)){if(_0x245346!=='providerResponse'){this[_0xdd96('0x2f')]['setVariable'](util[_0xdd96('0x4d')](_0xdd96('0xea'),_0x245346[_0xdd96('0xeb')]()),_0x44fdae[_0x245346]);}}}this['createSquareMessage'](_0x44fdae[_0xdd96('0xe0')],_0xdd96('0xe1'),_0xdd96('0xe5'),_0x44fdae[_0xdd96('0xec')]);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xed'),_0x44fdae[_0xdd96('0xe0')]));}return this[_0xdd96('0x2f')]['error'](_0xdf7e3c,_0xdd96('0xee'));};AGIVertices['prototype'][_0xdd96('0xef')]=function(_0x587410){logger['info'](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x587410['label']));if(!this[_0xdd96('0x7b')](_0x587410['ndauth_url'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xf0'));}if(!this['isConfigured'](_0x587410['username'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xf1'));}if(!this[_0xdd96('0x7b')](_0x587410['password'])){return this['channel'][_0xdd96('0x9e')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x587410[_0xdd96('0xf2')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x9f'));}this[_0xdd96('0x2f')][_0xdd96('0xde')]=!![];this['createSquareDetailsReport'](_0x587410);this[_0xdd96('0x3a')](_0x587410[_0xdd96('0x57')],'in','','');this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xf3'),_0x587410[_0xdd96('0x57')]));var _0x23d383=this[_0xdd96('0x75')][_0xdd96('0x9c')](this,_0x587410);if(_0x23d383){for(var _0x88784d in _0x23d383){if(_0x23d383[_0xdd96('0x8c')](_0x88784d)){this['channel']['setVariable'](util['format'](_0xdd96('0xf4'),_0x88784d[_0xdd96('0xeb')]()),_0x23d383[_0x88784d]);}}this[_0xdd96('0x3a')](_0x23d383[_0xdd96('0xe0')],_0xdd96('0xe1'),'sesteknda','');if(_0x23d383[_0xdd96('0xf5')]){this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xf6'),_0x23d383[_0xdd96('0xf5')]));var _0x32543d=this['channel'][_0xdd96('0xf7')](_0x23d383[_0xdd96('0xf5')]);try{fs[_0xdd96('0xf8')](_0x23d383[_0xdd96('0xf5')]+_0xdd96('0xf9'));}catch(_0x483e49){logger[_0xdd96('0x25')](_0x483e49);}return _0x32543d;}else{return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xfa'),_0x23d383[_0xdd96('0xe0')]));}}return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x587410,_0xdd96('0xfb'));};AGIVertices['prototype'][_0xdd96('0xfc')]=function(_0x577de3){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0xfd'),_0x577de3[_0xdd96('0x31')]));return this['channel'][_0xdd96('0x9e')](_0xdd96('0xfc'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0xfe')]=function(_0x29bfc3){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0xff'),_0x29bfc3[_0xdd96('0x31')]));var _0x28cfb4='';if(_0x29bfc3['trunk_id']){if(!this[_0xdd96('0x7b')](_0x29bfc3[_0xdd96('0x100')])){return this[_0xdd96('0x2f')]['error'](_0x29bfc3,_0xdd96('0x101'));}else{var _0x5a15b2=parseInt(_0x29bfc3[_0xdd96('0x100')],0xa);if(isNaN(_0x5a15b2)){_0x28cfb4=_0x29bfc3[_0xdd96('0x100')];}else{_0x28cfb4=this[_0xdd96('0x1a')][_0xdd96('0x9c')](this,_0x29bfc3[_0xdd96('0x100')]);if(!_0x28cfb4){return this['channel'][_0xdd96('0x25')](_0x29bfc3,_0xdd96('0x102'));}}}}else if(_0x29bfc3[_0xdd96('0x103')]){_0x28cfb4=_0x29bfc3[_0xdd96('0x103')];}else{return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x29bfc3,'no\x20trunk\x20selected');}var _0x567ec2=this['channel'][_0xdd96('0x51')](_0xdd96('0xd9'),[util['format'](_0xdd96('0x104'),_0x28cfb4,_0x29bfc3[_0xdd96('0x40')]),_0x29bfc3[_0xdd96('0x5f')],_0x29bfc3[_0xdd96('0x105')],_0x29bfc3[_0xdd96('0x69')]]);if(_0x567ec2[_0xdd96('0xa1')]===-0x1){return _0x567ec2;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xdb'),'DIAL'));};AGIVertices[_0xdd96('0xc')]['finally']=function(_0x334ae1){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x334ae1['label']));return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x106'));};AGIVertices[_0xdd96('0xc')]['getdigits']=function(_0x34839e){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x107'),_0x34839e[_0xdd96('0x31')]));if(_0x34839e[_0xdd96('0x108')]===0x0){return this[_0xdd96('0x9b')](_0x34839e);}_0x34839e[_0xdd96('0x108')]-=0x1;if(!this['isConfigured'](_0x34839e[_0xdd96('0x109')])){return this[_0xdd96('0x2f')]['error'](_0x34839e,_0xdd96('0x10a'));}var _0x4e7179=this[_0xdd96('0x10b')][_0xdd96('0x9c')](this,_0x34839e[_0xdd96('0x109')]);if(!_0x4e7179){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x34839e,_0xdd96('0x10c'));}if(!this[_0xdd96('0x7b')](_0x34839e[_0xdd96('0xcf')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0xdd96('0xd0'));}var _0x429668=this[_0xdd96('0x2f')]['getData'](_0x4e7179,_0x34839e['response'],_0x34839e[_0xdd96('0x10d')]);var _0xffc8de=_0x429668[_0xdd96('0xa1')]?_0x429668[_0xdd96('0xa1')]['toString']():'';logger['info'](_0xdd96('0x10e'),JSON[_0xdd96('0x6a')](_0x429668));if(_0x429668['result']===-0x1){this[_0xdd96('0x2e')][_0xdd96('0x9c')](this,_0x34839e,_0xffc8de);return _0x429668;}else if(_0x429668['extra']==='timeout'){_0x429668[_0xdd96('0xa1')]=_0xffc8de[_0xdd96('0x95')]>=parseInt(_0x34839e['mindigit'])?'x':'i';}else{_0x429668[_0xdd96('0xa1')]=_0xffc8de[_0xdd96('0x95')]>=parseInt(_0x34839e[_0xdd96('0x10f')])&&_0xffc8de[_0xdd96('0x95')]<=parseInt(_0x34839e['maxdigit'])?'x':'i';}var _0x3f41e2=this['getVariable']['sync'](this,_0x34839e[_0xdd96('0xcf')]);if(!_0x3f41e2){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x34839e,_0xdd96('0xd1'));}this['channel']['setVariable'](_0x3f41e2,_0xffc8de);if(this[_0xdd96('0x7b')](_0x34839e['hiddendigitsnum'])){var _0x3ebee4=parseInt(_0x34839e['hiddendigitsnum'],0xa);var _0x45ad5f=rs[_0xdd96('0x110')]({'charset':'*','length':_0x3ebee4});var _0x164cbc=_0xffc8de[_0xdd96('0x95')];if(_0x164cbc>0x0){if(_0x164cbc>_0x3ebee4){this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x34839e,_0x34839e['hiddendigitspos']===_0xdd96('0x111')?_0x45ad5f+_0xffc8de[_0xdd96('0x112')](_0x3ebee4):_0xffc8de[_0xdd96('0x112')](0x0,_0x164cbc-_0x3ebee4)+_0x45ad5f);}else{this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x34839e,rs[_0xdd96('0x110')]({'charset':'*','length':_0x164cbc}));}}else{this[_0xdd96('0x2e')]['sync'](this,_0x34839e,'');}}else{this[_0xdd96('0x2e')][_0xdd96('0x9c')](this,_0x34839e,_0xffc8de);}return _0x429668;};AGIVertices[_0xdd96('0xc')][_0xdd96('0x113')]=function(_0x21c454){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x114'),_0x21c454[_0xdd96('0x31')]));return this[_0xdd96('0x115')](_0x21c454);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x116')]=function(_0x58e4ea){logger[_0xdd96('0x27')](util['format'](_0xdd96('0x117'),_0x58e4ea[_0xdd96('0x31')]));this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x58e4ea,_0x58e4ea[_0xdd96('0x118')]);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x119'),_0x58e4ea[_0xdd96('0x118')]));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x11a')]=function(_0x591f2e){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x11b'),_0x591f2e[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x591f2e['aws_access_key_id'])||!this[_0xdd96('0x7b')](_0x591f2e[_0xdd96('0x83')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x591f2e[_0xdd96('0x57')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x9f'));}this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x11c'),_0x591f2e[_0xdd96('0x57')]));var _0x53a2b1=this['awsPolly'][_0xdd96('0x9c')](this,_0x591f2e);if(_0x53a2b1){this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('aws\x20Polly\x20%s\x20file\x20created',_0x53a2b1));var _0xf85b86=this[_0xdd96('0x2f')][_0xdd96('0xf7')](_0x53a2b1);try{fs[_0xdd96('0xf8')](_0x53a2b1+_0xdd96('0xf9'));}catch(_0x49302b){logger[_0xdd96('0x25')](_0x49302b);}return _0xf85b86;}return this['channel'][_0xdd96('0x25')](_0x591f2e,_0xdd96('0x11d'));};AGIVertices[_0xdd96('0xc')]['awslex']=function(_0x7138f5){logger['info'](util['format'](_0xdd96('0x11e'),_0x7138f5[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x7138f5[_0xdd96('0x7e')])||!this[_0xdd96('0x7b')](_0x7138f5[_0xdd96('0x83')])){return this['channel'][_0xdd96('0x9e')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xdd96('0x7b')](_0x7138f5[_0xdd96('0x84')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20bot\x20name\x20configured');}if(!this[_0xdd96('0x7b')](_0x7138f5[_0xdd96('0x57')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x9f'));}this['channel'][_0xdd96('0xde')]=!![];this[_0xdd96('0x2e')](_0x7138f5);this['createSquareMessage'](_0x7138f5[_0xdd96('0x57')],'in','','');this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x11f'),_0x7138f5['text']));var _0x72f8db=this[_0xdd96('0x82')][_0xdd96('0x9c')](this,_0x7138f5);if(_0x72f8db){for(var _0x285998 in _0x72f8db){if(_0x72f8db[_0xdd96('0x8c')](_0x285998)&&_[_0xdd96('0x90')](_0x72f8db[_0x285998])){this[_0xdd96('0x2f')][_0xdd96('0x9a')](util[_0xdd96('0x4d')](_0xdd96('0x120'),_0x285998[_0xdd96('0xeb')]()),_0x72f8db[_0x285998]);}}if(_['isNil'](_0x72f8db['message'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x121'));}else{this[_0xdd96('0x3a')](_0x72f8db['message'],_0xdd96('0xe1'),'amazonlex','');return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x122'),_0x72f8db[_0xdd96('0x123')]));}}return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x7138f5,_0xdd96('0x124'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x125')]=function(_0x482b5f){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x126'),_0x482b5f[_0xdd96('0x31')],_0x482b5f['timeout']));if(!this[_0xdd96('0x7b')](_0x482b5f[_0xdd96('0x70')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20key\x20configured');}var _0x15b51d=_0xdd96('0x127');var _0x2a8625=util[_0xdd96('0x4d')](_0xdd96('0x128'),FILES_PATH,rs[_0xdd96('0x110')](0x4));var _0x239ddf=util['format'](_0xdd96('0x92'),_0x2a8625,_0x15b51d);var _0x5a3aec=!![];if(_0x482b5f[_0xdd96('0x129')]==='NOBEEP'){_0x5a3aec=![];}var _0x4a0409=this[_0xdd96('0x2f')][_0xdd96('0x12a')](_0x2a8625,_0x15b51d,_0x482b5f['intKey'],_0x482b5f['timeout'],undefined,_0x5a3aec);if(_0x4a0409[_0xdd96('0xa1')]!==-0x1){this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x12b'),_0x239ddf));var _0x2d4e7c=this[_0xdd96('0x12c')]['sync'](this,_0x482b5f,_0x239ddf);if(_0x2d4e7c){for(var _0x4477f4 in _0x2d4e7c){if(_0x2d4e7c[_0xdd96('0x8c')](_0x4477f4)){this[_0xdd96('0x2f')][_0xdd96('0x9a')](util[_0xdd96('0x4d')](_0xdd96('0x12d'),_0x4477f4['toUpperCase']()),_0x2d4e7c[_0x4477f4]);}}return this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')]('GoogleASR\x20Result\x20%s',JSON[_0xdd96('0x6a')](_0x2d4e7c)));}}return _0x4a0409;};AGIVertices['prototype']['tildeasr']=function(_0x410c87){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x410c87[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x410c87['appid'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20appid\x20configured');}if(!this[_0xdd96('0x7b')](_0x410c87[_0xdd96('0x88')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x12e'));}var _0x5408f9='wav';var _0x4efdf1=util[_0xdd96('0x4d')](_0xdd96('0x128'),FILES_PATH,rs[_0xdd96('0x110')](0x4));var _0x440845=util[_0xdd96('0x4d')](_0xdd96('0x92'),_0x4efdf1,_0x5408f9);var _0x42cadf=!![];if(_0x410c87['beep']===_0xdd96('0x12f')){_0x42cadf=![];}var _0x3bc668=this[_0xdd96('0x2f')][_0xdd96('0x12a')](_0x4efdf1,_0x5408f9,_0x410c87[_0xdd96('0x130')],_0x410c87[_0xdd96('0x5f')],undefined,_0x42cadf);if(_0x3bc668[_0xdd96('0xa1')]!==-0x1){this['channel'][_0xdd96('0x9e')](util['format'](_0xdd96('0x131'),_0x440845));var _0x147ce0=this[_0xdd96('0x86')]['sync'](this,_0x410c87,_0x440845);if(_0x147ce0){for(var _0x43e82e in _0x147ce0){if(_0x147ce0['hasOwnProperty'](_0x43e82e)){this[_0xdd96('0x2f')]['setVariable'](util[_0xdd96('0x4d')](_0xdd96('0x132'),_0x43e82e[_0xdd96('0xeb')]()),_0x147ce0[_0x43e82e]);}}return this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x133'),JSON[_0xdd96('0x6a')](_0x147ce0)));}}return _0x3bc668;};AGIVertices['prototype']['gotoc']=function(_0x3d9e01){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x134'),_0x3d9e01[_0xdd96('0x31')]));return this[_0xdd96('0x2f')][_0xdd96('0x135')](_0x3d9e01[_0xdd96('0x136')],_0x3d9e01[_0xdd96('0x36')],_0x3d9e01[_0xdd96('0x37')]);};AGIVertices['prototype']['gotoif']=function(_0x222aaa){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x137'),_0x222aaa['label']));if(!this['isConfigured'](_0x222aaa['condition'])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x222aaa,_0xdd96('0x138'));}try{var _0x56cb35=eval(_0x222aaa[_0xdd96('0x139')])?_0xdd96('0x13a'):_0xdd96('0x13b');this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('EVAL\x20CONDITION\x20%s\x20%s',_0x222aaa[_0xdd96('0x139')],_0x56cb35));return{'code':0xc8,'result':_0x56cb35};}catch(_0x2c4146){return{'code':0xc8,'result':_0xdd96('0x13b')};}};AGIVertices['prototype'][_0xdd96('0x13c')]=function(_0x2e77e2){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x13d'),_0x2e77e2['label']));if(!this['isConfigured'](_0x2e77e2[_0xdd96('0x13e')])){return this[_0xdd96('0x2f')]['error'](_0x2e77e2,_0xdd96('0x13f'));}var _0x3d473a=this[_0xdd96('0x1f')][_0xdd96('0x9c')](this,_0x2e77e2[_0xdd96('0x13e')]);if(!_0x3d473a){return this['channel']['error'](_0x2e77e2,_0xdd96('0x140'));}for(var _0x1bdc46=0x0;_0x1bdc46<_0x3d473a[_0xdd96('0x95')];_0x1bdc46+=0x1){var _0x4cb65f=this[_0xdd96('0x2f')][_0xdd96('0xd')](util[_0xdd96('0x4d')](_0xdd96('0x141'),_0x3d473a[_0x1bdc46]));if(_0x4cb65f[_0xdd96('0xa1')]===-0x1){return _0x4cb65f;}logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x142'),_0x3d473a[_0x1bdc46],_0x4cb65f['extra']));if(_0x4cb65f['extra']===_0xdd96('0x13a')){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x142'),_0x3d473a[_0x1bdc46],'true'));this['channel'][_0xdd96('0x9e')](util['format'](_0xdd96('0x142'),_0x3d473a[_0x1bdc46],_0xdd96('0x13a')));return{'code':0xc8,'result':_0xdd96('0x13a')};}else{logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x142'),_0x3d473a[_0x1bdc46],_0xdd96('0x13b')));this['channel']['noop'](util['format'](_0xdd96('0x142'),_0x3d473a[_0x1bdc46],_0xdd96('0x13b')));}}return{'code':0xc8,'result':_0xdd96('0x13b')};};AGIVertices['prototype'][_0xdd96('0x143')]=function(_0x493aea){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x144'),_0x493aea[_0xdd96('0x31')]));return this[_0xdd96('0x2f')]['hangup']();};AGIVertices['prototype'][_0xdd96('0x145')]=function(_0x39967d){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x146'),_0x39967d['label']));if(!this[_0xdd96('0x7b')](_0x39967d[_0xdd96('0x70')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xdd'));}var _0x2d8c84=_0xdd96('0x127');var _0x1e4be6=util[_0xdd96('0x4d')](_0xdd96('0x128'),FILES_PATH,rs['generate'](0x4));var _0x577f83=util[_0xdd96('0x4d')]('%s.%s',_0x1e4be6,_0x2d8c84);var _0x553886=!![];if(_0x39967d[_0xdd96('0x129')]===_0xdd96('0x12f')){_0x553886=![];}var _0x229820=this[_0xdd96('0x2f')][_0xdd96('0x12a')](_0x1e4be6,_0x2d8c84,_0x39967d[_0xdd96('0x130')],_0x39967d['timeout'],undefined,_0x553886);if(_0x229820[_0xdd96('0xa1')]!==-0x1){this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')](_0xdd96('0x147'),_0x577f83));var _0xd939a0=this['ispeechASR'][_0xdd96('0x9c')](this,_0x39967d,_0x577f83);if(_0xd939a0){for(var _0x101825 in _0xd939a0){if(_0xd939a0['hasOwnProperty'](_0x101825)){this[_0xdd96('0x2f')]['setVariable'](util[_0xdd96('0x4d')](_0xdd96('0x148'),_0x101825['toUpperCase']()),_0xd939a0[_0x101825]);}}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0xd939a0)));}}return _0x229820;};AGIVertices['prototype']['ispeechtts']=function(_0x344a53){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x149'),_0x344a53[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x344a53['key'])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xdd'));}if(!this[_0xdd96('0x7b')](_0x344a53[_0xdd96('0x57')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x9f'));}this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x14a'),_0x344a53[_0xdd96('0x57')]));var _0x3fd53f=this[_0xdd96('0x76')][_0xdd96('0x9c')](this,_0x344a53);if(_0x3fd53f){this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x147'),_0x3fd53f));var _0x563916=this[_0xdd96('0x2f')]['streamFile'](_0x3fd53f,_0x344a53[_0xdd96('0x130')]);try{fs[_0xdd96('0xf8')](_0x3fd53f+_0xdd96('0xf9'));}catch(_0x3fcfca){logger[_0xdd96('0x25')](_0x3fcfca);}return _0x563916;}return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x344a53,_0xdd96('0x14b'));};AGIVertices['prototype'][_0xdd96('0x14c')]=function(_0x5e4ce9){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x14d'),_0x5e4ce9[_0xdd96('0x31')]));if(!this['isConfigured'](_0x5e4ce9[_0xdd96('0x14e')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x5e4ce9,_0xdd96('0x14f'));}logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x150'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x5e4ce9[_0xdd96('0x14e')]));var _0x4d2356=this[_0xdd96('0x4b')][_0xdd96('0x9c')](this,_0x5e4ce9[_0xdd96('0x14e')]);if(_0x4d2356){logger[_0xdd96('0x27')](util['format'](_0xdd96('0x151'),this['channel'][_0xdd96('0x33')],_0x5e4ce9[_0xdd96('0x14e')]));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x5e4ce9['findBy']));return{'code':0xc8,'result':_0xdd96('0x152')};}else{logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x153'),this[_0xdd96('0x2f')]['callerid'],_0x5e4ce9[_0xdd96('0x14e')]));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x153'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x5e4ce9[_0xdd96('0x14e')]));return{'code':0xc8,'result':_0xdd96('0x154')};}};AGIVertices[_0xdd96('0xc')][_0xdd96('0x155')]=function(_0x58f52d){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x156'),_0x58f52d['label']));if(!this[_0xdd96('0x7b')](_0x58f52d[_0xdd96('0x14e')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x58f52d,_0xdd96('0x14f'));}logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x150'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x58f52d['findBy']));var _0x3e7864=this['agentLogout'][_0xdd96('0x9c')](this,_0x58f52d[_0xdd96('0x14e')]);if(_0x3e7864){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x58f52d['findBy']));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x58f52d['findBy']));return{'code':0xc8,'result':_0xdd96('0x152')};}else{logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x153'),this['channel']['callerid'],_0x58f52d[_0xdd96('0x14e')]));this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdd96('0x2f')]['callerid'],_0x58f52d['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdd96('0xc')]['math']=function(_0x488fcb){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x488fcb[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x488fcb[_0xdd96('0x157')])){return this[_0xdd96('0x2f')]['error'](_0x488fcb,_0xdd96('0x158'));}this['channel']['noop'](util[_0xdd96('0x4d')](_0xdd96('0x159'),_0x488fcb[_0xdd96('0x157')]));var _0x2abd2f=eval(_0x488fcb['operation']);if(!this['isConfigured'](_0x488fcb[_0xdd96('0xcf')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3317a9=this['getVariable'][_0xdd96('0x9c')](this,_0x488fcb[_0xdd96('0xcf')]);if(!_0x3317a9){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x488fcb,_0xdd96('0xd1'));}if(_[_0xdd96('0x15a')](_0x2abd2f)){var _0x3d84dd=this;_0x2abd2f['forEach'](function(_0x204c1a,_0x3befe6){_0x3d84dd['channel']['setVariable'](util[_0xdd96('0x4d')](_0xdd96('0x15b'),_0x3317a9,_0x3befe6),_0x204c1a);});return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x15c'),_0x3317a9));}else{return this[_0xdd96('0x2f')][_0xdd96('0x9a')](_0x3317a9,_0x2abd2f);}};AGIVertices[_0xdd96('0xc')]['menu']=function(_0x1e1b83){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x15d'),_0x1e1b83['label']));if(_0x1e1b83[_0xdd96('0x108')]===0x0){return this[_0xdd96('0x9b')](_0x1e1b83);}_0x1e1b83[_0xdd96('0x108')]-=0x1;if(!this['isConfigured'](_0x1e1b83[_0xdd96('0x109')])){return this[_0xdd96('0x2f')]['error'](_0x1e1b83,_0xdd96('0x10a'));}var _0x4718ee=this[_0xdd96('0x10b')]['sync'](this,_0x1e1b83['file_id']);if(!_0x4718ee){return this[_0xdd96('0x2f')]['error'](_0x1e1b83,_0xdd96('0x10c'));}var _0x2ba248=this['channel'][_0xdd96('0x15e')](_0x4718ee,_0x1e1b83[_0xdd96('0x15f')],_0x1e1b83[_0xdd96('0x160')]);var _0x1aa2f1=_0x2ba248['result'];if(_0x2ba248[_0xdd96('0xa1')]===-0x1){this[_0xdd96('0x2e')][_0xdd96('0x9c')](this,_0x1e1b83,'-1');return _0x2ba248;}else if(_0x2ba248['extra']===_0xdd96('0x5f')){_0x2ba248[_0xdd96('0xa1')]=_0x2ba248[_0xdd96('0xa1')][_0xdd96('0x95')]>0x0?_0x2ba248[_0xdd96('0xa1')]:'t';}else if(_[_0xdd96('0x3c')](_0x2ba248[_0xdd96('0xa1')])){_0x2ba248['result']='#';_0x1aa2f1='#';}if(!this[_0xdd96('0x7b')](_0x1e1b83[_0xdd96('0xcf')])){this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0xd0'));}else{var _0x1cdaf5=this[_0xdd96('0xd')]['sync'](this,_0x1e1b83[_0xdd96('0xcf')]);if(!_0x1cdaf5){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x1e1b83,_0xdd96('0xd1'));}this[_0xdd96('0x2f')][_0xdd96('0x9a')](_0x1cdaf5,_0x1aa2f1);}this[_0xdd96('0x2e')]['sync'](this,_0x1e1b83,_0x1aa2f1);return _0x2ba248;};AGIVertices['prototype'][_0xdd96('0x9e')]=function(_0x3b6d29){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x161'),_0x3b6d29[_0xdd96('0x31')]));return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0x3b6d29['output']||_0x3b6d29[_0xdd96('0x31')]);};AGIVertices[_0xdd96('0xc')]['pause']=function(_0x48e36c){logger[_0xdd96('0x27')](util['format'](_0xdd96('0x162'),_0x48e36c[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x48e36c[_0xdd96('0x14e')])){return this[_0xdd96('0x2f')]['error'](_0x48e36c,_0xdd96('0x14f'));}logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x150'),this[_0xdd96('0x2f')]['callerid'],_0x48e36c[_0xdd96('0x14e')]));var _0x4a9782=this[_0xdd96('0x45')][_0xdd96('0x9c')](this,_0x48e36c[_0xdd96('0x163')]);var _0x85627a=this['agentPause'][_0xdd96('0x9c')](this,_0x48e36c[_0xdd96('0x14e')],_0x4a9782);if(_0x85627a){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x48e36c['findBy']));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x48e36c[_0xdd96('0x14e')]));return{'code':0xc8,'result':_0xdd96('0x152')};}else{logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x153'),this['channel'][_0xdd96('0x33')],_0x48e36c[_0xdd96('0x14e')]));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x151'),this[_0xdd96('0x2f')]['callerid'],_0x48e36c[_0xdd96('0x14e')]));return{'code':0xc8,'result':_0xdd96('0x154')};}};AGIVertices['prototype'][_0xdd96('0x164')]=function(_0x1c310a){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x165'),_0x1c310a[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x1c310a[_0xdd96('0x109')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x1c310a,'no\x20file\x20audio\x20selected');}var _0x217752=this[_0xdd96('0x10b')]['sync'](this,_0x1c310a['file_id']);if(!_0x217752){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x1c310a,_0xdd96('0x10c'));}var _0x2cc85e=this[_0xdd96('0x2f')][_0xdd96('0x51')]('PLAYBACK',[_0x217752,_0x1c310a[_0xdd96('0x105')]]);if(_0x2cc85e[_0xdd96('0xa1')]===-0x1){return _0x2cc85e;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xbb'),_0xdd96('0x166'),_0x217752));};AGIVertices['prototype'][_0xdd96('0x167')]=function(_0x5b6a70){logger[_0xdd96('0x27')](util['format'](_0xdd96('0x168'),_0x5b6a70[_0xdd96('0x31')]));if(!this['isConfigured'](_0x5b6a70['queue_id'])){return this['channel'][_0xdd96('0x25')](_0x5b6a70,_0xdd96('0x169'));}var _0x2f15ee='';var _0x32d2b7=parseInt(_0x5b6a70['queue_id'],0xa);if(isNaN(_0x32d2b7)){_0x2f15ee=_0x5b6a70[_0xdd96('0x16a')];}else{_0x2f15ee=this[_0xdd96('0x12')][_0xdd96('0x9c')](this,_0x5b6a70[_0xdd96('0x16a')]);if(!_0x2f15ee){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x5b6a70,_0xdd96('0x16b'));}}var _0x389ec5='';if(this[_0xdd96('0x7b')](_0x5b6a70[_0xdd96('0x109')])){var _0x49a033=this[_0xdd96('0x10b')][_0xdd96('0x9c')](this,_0x5b6a70[_0xdd96('0x109')]);if(_0x49a033){_0x389ec5=_0x49a033;}}this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x5b6a70,_0x2f15ee);if(_0x5b6a70['opts'][_0xdd96('0x16c')]('x')<0x0){_0x5b6a70[_0xdd96('0x105')]+='x';}if(_0x5b6a70[_0xdd96('0x105')][_0xdd96('0x16c')]('X')<0x0){_0x5b6a70[_0xdd96('0x105')]+='X';}this[_0xdd96('0x2f')][_0xdd96('0x9a')]('XMCS-QUEUE',_0x2f15ee?_0x2f15ee[_0xdd96('0x16d')]():'');var _0x4530cf=this[_0xdd96('0x2f')][_0xdd96('0x51')](_0xdd96('0x16e'),[_0x2f15ee,_0x5b6a70[_0xdd96('0x105')],_0x5b6a70[_0xdd96('0x69')],_0x389ec5,_0x5b6a70[_0xdd96('0x5f')],_0x5b6a70[_0xdd96('0xae')],_0x5b6a70['macro'],_0x5b6a70[_0xdd96('0x16f')],'',_0x5b6a70[_0xdd96('0x170')]]);if(_0x4530cf[_0xdd96('0xa1')]===-0x1){return _0x4530cf;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('Executed\x20command\x20%s\x20%s',_0xdd96('0x16e'),_0x2f15ee));};AGIVertices[_0xdd96('0xc')]['record']=function(_0x5574bd){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x171'),_0x5574bd['label']));var _0x6f69b7=_0x5574bd[_0xdd96('0x172')]||'wav';var _0x19ffec=util[_0xdd96('0x4d')](_0xdd96('0x173'),this[_0xdd96('0x2f')][_0xdd96('0x30')],rs[_0xdd96('0x110')](0x5));var _0x189734=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x19ffec,_0x6f69b7);var _0x3118f4=util[_0xdd96('0x4d')]('%s/recordings/%s',FILES_PATH,_0x19ffec);this['createSquareRecording'][_0xdd96('0x9c')](this,_0x5574bd,_0x19ffec,_0x189734);this['channel'][_0xdd96('0x9a')]('RECORDING_SAVENAME',_0x19ffec);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x3118f4,_0x6f69b7,_0x5574bd[_0xdd96('0x174')],_0x5574bd['timeout']);return this['channel'][_0xdd96('0x12a')](_0x3118f4,_0x6f69b7,_0x5574bd[_0xdd96('0x174')],_0x5574bd['timeout'],undefined,!![]);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x175')]=function(_0x1fd85e){logger['info'](util[_0xdd96('0x4d')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1fd85e[_0xdd96('0x31')]));if(!this['isConfigured'](_0x1fd85e['url'])){return this['channel']['noop'](_0xdd96('0x176'));}var _0x37dcaf=this[_0xdd96('0x5d')][_0xdd96('0x9c')](this,_0x1fd85e);logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Response:',util[_0xdd96('0x177')](_0x37dcaf,{'showHidden':![],'depth':null})));if(!this[_0xdd96('0x7b')](_0x1fd85e[_0xdd96('0xcf')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x178'));}var _0x5e12d1=this['getVariable'][_0xdd96('0x9c')](this,_0x1fd85e[_0xdd96('0xcf')]);if(!_0x5e12d1){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x1fd85e,_0xdd96('0xd1'));}this[_0xdd96('0x2f')][_0xdd96('0x9a')](util[_0xdd96('0x4d')]('%s_STATUS_CODE',_0x5e12d1),_0x37dcaf['statusCode']?_0x37dcaf[_0xdd96('0x6b')]:_0xdd96('0x179'));this['channel'][_0xdd96('0x9a')](util['format']('%s_STATUS_MESSAGE',_0x5e12d1),_0x37dcaf['statusMessage']?_0x37dcaf[_0xdd96('0x6c')]:'OK');if(_0x37dcaf[_0xdd96('0x62')]){try{this[_0xdd96('0x91')](_0x37dcaf[_0xdd96('0x62')],_0x5e12d1);}catch(_0x4b6bd8){logger['error'](util[_0xdd96('0x4d')](_0xdd96('0x17a'),_0x5e12d1));}}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0xd5'),_0x5e12d1));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x17b')]=function(_0x534dbb){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x17c'),_0x534dbb[_0xdd96('0x31')]));return this[_0xdd96('0x2f')][_0xdd96('0x17d')](_0x534dbb[_0xdd96('0x17e')]['replace'](/\s+/g,''),_0x534dbb[_0xdd96('0x174')]);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x17f')]=function(_0x364be7){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x180'),_0x364be7[_0xdd96('0x31')]));return this['channel'][_0xdd96('0x181')](_0x364be7[_0xdd96('0x60')]['replace'](/\s+/g,''),_0x364be7[_0xdd96('0x174')]);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x182')]=function(_0x5a8967){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x183'),_0x5a8967[_0xdd96('0x31')]));return this[_0xdd96('0x2f')]['sayPhonetic'](_0x5a8967[_0xdd96('0x57')],_0x5a8967[_0xdd96('0x174')]);};AGIVertices[_0xdd96('0xc')][_0xdd96('0x184')]=function(_0x2b600d){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x185'),_0x2b600d[_0xdd96('0x31')]));if(!this[_0xdd96('0x7b')](_0x2b600d[_0xdd96('0x186')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x187'));}var _0x3252f2=this[_0xdd96('0x188')][_0xdd96('0x9c')](this,_0x2b600d['account_id']);if(!_0x3252f2||!_0x3252f2[_0xdd96('0x189')]){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x2b600d,_0xdd96('0x18a'));}var _0x8d79f5={'from':util[_0xdd96('0x4d')](_0xdd96('0x18b'),_0x3252f2['name'],_0x3252f2['email']||_0x3252f2['Smtp']['user']),'to':_0x2b600d['to']||'','cc':_0x2b600d['cc']||'','bcc':_0x2b600d[_0xdd96('0x18c')]||'','subject':_0x2b600d['subject'],'html':_0x2b600d[_0xdd96('0x57')],'text':_0x2b600d['text']};var _0x200b15={'tls':{'rejectUnauthorized':![]}};if(_0x3252f2[_0xdd96('0x189')][_0xdd96('0x18d')]){_0x200b15[_0xdd96('0x18d')]=_0x3252f2['Smtp']['service'];}else{_0x200b15['host']=_0x3252f2['Smtp'][_0xdd96('0x18e')];_0x200b15[_0xdd96('0x18f')]=_0x3252f2[_0xdd96('0x189')]['port'];_0x200b15[_0xdd96('0x190')]=_0x3252f2[_0xdd96('0x189')]['secure'];}if(_0x3252f2[_0xdd96('0x189')][_0xdd96('0x191')]){_0x200b15[_0xdd96('0x192')]={'user':_0x3252f2[_0xdd96('0x189')]['user'],'pass':_0x3252f2[_0xdd96('0x189')][_0xdd96('0x193')]};}if(this[_0xdd96('0x7b')](_0x2b600d[_0xdd96('0x194')])){}logger[_0xdd96('0x195')](_0xdd96('0x196'),JSON[_0xdd96('0x6a')](_0x8d79f5));this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x2b600d,_0x2b600d[_0xdd96('0x186')]);this['channel'][_0xdd96('0x9e')](util['format'](_0xdd96('0x197'),_0x3252f2[_0xdd96('0x10')]));this[_0xdd96('0x1e')][_0xdd96('0x9c')](this,_0x200b15,_0x8d79f5);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x198'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x199')]=function(_0x350964){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x19a'),_0x350964[_0xdd96('0x31')]));return this[_0xdd96('0x2f')]['noop'](_0xdd96('0x19b'));};AGIVertices['prototype'][_0xdd96('0x19c')]=function(_0x139c6c){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x19d'),_0x139c6c['label']));if(!this[_0xdd96('0x7b')](_0x139c6c[_0xdd96('0x19e')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x19f'));}var _0x22dc1e=this[_0xdd96('0x1a0')][_0xdd96('0x9c')](this,_0x139c6c[_0xdd96('0x19e')]);if(!_0x22dc1e){return this[_0xdd96('0x2f')]['error'](_0x139c6c,_0xdd96('0x1a1'));}var _0x25d0ad={'body':_0x139c6c[_0xdd96('0x1a2')],'phone':_0x139c6c['to']||'','SmsAccountId':_0x22dc1e['id']};logger['debug'](_0xdd96('0x1a3'),JSON['stringify'](_0x25d0ad));this[_0xdd96('0x2e')][_0xdd96('0x9c')](this,_0x139c6c,_0x139c6c[_0xdd96('0x19e')]);this['channel'][_0xdd96('0x9e')](util['format'](_0xdd96('0x1a4'),_0x22dc1e[_0xdd96('0x10')]));this[_0xdd96('0x2d')][_0xdd96('0x9c')](this,_0x25d0ad);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x1a5'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1a6')]=function(_0xefc449){logger['info'](util['format'](_0xdd96('0x1a7'),_0xefc449[_0xdd96('0x31')]));if(!this['isConfigured'](_0xefc449['variable_id'])){return this['channel'][_0xdd96('0x25')](_0xefc449,_0xdd96('0x1a8'));}var _0x40be05=this[_0xdd96('0xd')][_0xdd96('0x9c')](this,_0xefc449[_0xdd96('0xcf')]);if(!_0x40be05){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0xefc449,_0xdd96('0xd1'));}return this[_0xdd96('0x2f')][_0xdd96('0x9a')](_0x40be05,_0xefc449['variable_value']);};AGIVertices['prototype']['start']=function(_0x1bcd93){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x1a9'),_0x1bcd93[_0xdd96('0x31')]));this['channel'][_0xdd96('0x9e')](_0xdd96('0x1aa'));if(_0x1bcd93[_0xdd96('0x1ab')]===_0xdd96('0x1ac')){this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x1ad'));return this[_0xdd96('0x2f')][_0xdd96('0x1ab')]();}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](_0xdd96('0x1ae'));};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1af')]=function(_0x4dfc04){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x1b0'),_0x4dfc04['label']));if(!this['isConfigured'](_0x4dfc04[_0xdd96('0x1b1')])){return this[_0xdd96('0x2f')]['error'](_0x4dfc04,_0xdd96('0x1b2'));}var _0x2af92a=this[_0xdd96('0x14')][_0xdd96('0x9c')](this,_0x4dfc04[_0xdd96('0x1b1')]);if(!this[_0xdd96('0x7b')](_0x2af92a)){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x4dfc04,util[_0xdd96('0x4d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x4dfc04[_0xdd96('0x1b1')]));}if(_0x2af92a===this[_0xdd96('0x2f')][_0xdd96('0x39')]){return this[_0xdd96('0x2f')]['error'](_0x4dfc04,_0xdd96('0x1b3'));}this['createSquareDetailsReport'][_0xdd96('0x9c')](this,_0x4dfc04,_0x2af92a);var _0x108cee=this['channel'][_0xdd96('0x51')]('AGI',util[_0xdd96('0x4d')](_0xdd96('0x1b4'),config['agi'][_0xdd96('0x18e')]||'127.0.0.1',_0x2af92a,this[_0xdd96('0x2f')][_0xdd96('0x39')]));if(_0x108cee[_0xdd96('0xa1')]===-0x1){return _0x108cee;}return this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0xbb'),'AGI',_0x2af92a));};AGIVertices[_0xdd96('0xc')]['system']=function(_0x4c57f4){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x1b5'),_0x4c57f4['label']));var _0x2feb07=this['shellCommand']['sync'](this,_0x4c57f4[_0xdd96('0xaf')]);this['createSquareDetailsReport']['sync'](this,_0x4c57f4,_0x4c57f4[_0xdd96('0xaf')]);if(this[_0xdd96('0x7b')](_0x4c57f4[_0xdd96('0xcf')])){var _0x516d0c=this['getVariable'][_0xdd96('0x9c')](this,_0x4c57f4[_0xdd96('0xcf')]);if(_0x516d0c){this[_0xdd96('0x2f')][_0xdd96('0x9a')](_0x516d0c,_0x2feb07);return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x1b6'),_0x4c57f4['command'],_0x516d0c));}}return this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4c57f4['command']));};AGIVertices['prototype'][_0xdd96('0x1b7')]=function(_0x195749){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x195749['label']));_0x195749[_0xdd96('0x57')]=_0x195749[_0xdd96('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdd96('0x7b')](_0x195749[_0xdd96('0x55')])){return this['channel'][_0xdd96('0x9e')](_0xdd96('0x1b8'));}if(!this[_0xdd96('0x7b')](_0x195749[_0xdd96('0x57')])){return this[_0xdd96('0x2f')][_0xdd96('0x9e')]('no\x20text\x20configured');}this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')](_0xdd96('0x1b9'),_0x195749[_0xdd96('0x57')]));var _0x2cc5af=this[_0xdd96('0x54')][_0xdd96('0x9c')](this,_0x195749);if(_0x2cc5af){this['channel'][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2cc5af));var _0x3e0713=this[_0xdd96('0x2f')][_0xdd96('0xf7')](_0x2cc5af);try{fs[_0xdd96('0xf8')](_0x2cc5af+_0xdd96('0xf9'));}catch(_0x2ecb1f){logger['error'](_0x2ecb1f);}return _0x3e0713;}return this['channel'][_0xdd96('0x25')](_0x195749,_0xdd96('0x1ba'));};AGIVertices[_0xdd96('0xc')]['tts']=function(_0x249b6a){logger[_0xdd96('0x27')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x249b6a[_0xdd96('0x31')]));_0x249b6a[_0xdd96('0x57')]=_0x249b6a[_0xdd96('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdd96('0x7b')](_0x249b6a[_0xdd96('0x57')])){return this[_0xdd96('0x2f')]['noop'](_0xdd96('0x9f'));}this['channel'][_0xdd96('0x9e')](util['format'](_0xdd96('0x1bb'),_0x249b6a['text']));var _0x540518=this[_0xdd96('0x5b')]['sync'](this,_0x249b6a);if(_0x540518){this[_0xdd96('0x2f')]['noop'](util[_0xdd96('0x4d')](_0xdd96('0x1bc'),_0x540518));var _0x4dc8bb=this[_0xdd96('0x2f')][_0xdd96('0xf7')](_0x540518);try{fs[_0xdd96('0xf8')](_0x540518+_0xdd96('0xf9'));}catch(_0x518e3b){logger[_0xdd96('0x25')](_0x518e3b);}return _0x4dc8bb;}return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x249b6a,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1bd')]=function(_0x327a7f){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x1be'),_0x327a7f['label']));if(!this[_0xdd96('0x7b')](_0x327a7f[_0xdd96('0x14e')])){return this['channel'][_0xdd96('0x25')](_0x327a7f,'no\x20find\x20by\x20configured');}logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x150'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x327a7f['findBy']));var _0x2f18a1=this[_0xdd96('0x49')][_0xdd96('0x9c')](this,_0x327a7f[_0xdd96('0x14e')]);if(_0x2f18a1){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x327a7f[_0xdd96('0x14e')]));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util['format'](_0xdd96('0x151'),this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x327a7f[_0xdd96('0x14e')]));return{'code':0xc8,'result':_0xdd96('0x152')};}else{logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x153'),this[_0xdd96('0x2f')]['callerid'],_0x327a7f[_0xdd96('0x14e')]));this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdd96('0x2f')][_0xdd96('0x33')],_0x327a7f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdd96('0xc')][_0xdd96('0x1bf')]=function(_0x1b373e){logger[_0xdd96('0x27')](util[_0xdd96('0x4d')](_0xdd96('0x1c0'),_0x1b373e[_0xdd96('0x31')]));var _0x1002c9=this[_0xdd96('0x2f')]['exec'](_0xdd96('0x1c1'),[_0x1b373e[_0xdd96('0x1c2')],_0x1b373e[_0xdd96('0x6e')]]);if(_0x1002c9['result']===-0x1){return _0x1002c9;}return this[_0xdd96('0x2f')][_0xdd96('0x9e')](util[_0xdd96('0x4d')]('Executed\x20command\x20%s\x20%s',_0xdd96('0x1c1'),_0x1b373e[_0xdd96('0x1c2')]));};AGIVertices['prototype'][_0xdd96('0x1c3')]=function(_0x562397){logger['info'](util[_0xdd96('0x4d')](_0xdd96('0x1c4'),_0x562397['label']));if(!this[_0xdd96('0x7b')](_0x562397[_0xdd96('0xcf')])){return this[_0xdd96('0x2f')][_0xdd96('0x25')](_0x562397,_0xdd96('0x1a8'));}var _0x923450=this['getVariable'][_0xdd96('0x9c')](this,_0x562397[_0xdd96('0xcf')]);if(!_0x923450){return this[_0xdd96('0x2f')]['error'](_0x562397,_0xdd96('0xd1'));}var _0x53bf7d=this[_0xdd96('0x2f')][_0xdd96('0xd')](_0x923450);return{'code':0xc8,'result':_0x53bf7d[_0xdd96('0x99')]?_0x53bf7d[_0xdd96('0x99')]:'-'};};String[_0xdd96('0xc')][_0xdd96('0x96')]=function(_0x48bc6a,_0x2aba96){return this[_0xdd96('0x94')](_0x48bc6a)[_0xdd96('0x1c5')](_0x2aba96);};module[_0xdd96('0x1c6')]=AGIVertices; \ No newline at end of file +var _0x11fa=['no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','isEmpty','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','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','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isNil','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','text','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block'];(function(_0x248cd6,_0x24e04f){var _0x2a0ad0=function(_0x1e485e){while(--_0x1e485e){_0x248cd6['push'](_0x248cd6['shift']());}};_0x2a0ad0(++_0x24e04f);}(_0x11fa,0xa0));var _0xa11f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x11fa[_0x413feb];return _0x40ee88;};'use strict';var fs=require('fs');var path=require(_0xa11f('0x0'));var util=require(_0xa11f('0x1'));var _=require(_0xa11f('0x2'));var sh=require(_0xa11f('0x3'));var odbc=require(_0xa11f('0x4'))();var rs=require(_0xa11f('0x5'));var moment=require(_0xa11f('0x6'));var Mustache=require(_0xa11f('0x7'));var rp=require(_0xa11f('0x8'));var logger=require(_0xa11f('0x9'))(_0xa11f('0xa'));var config=require(_0xa11f('0xb'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xa11f('0xc'),_0xa11f('0xd')];var verticesWithRetry=[_0xa11f('0xe'),_0xa11f('0xf'),_0xa11f('0x10')];var AGIVertices=function(_0x3e4406,_0x4c5859,_0xb529b7){this[_0xa11f('0x11')]=_0x3e4406;this[_0xa11f('0x12')]=_0x4c5859;this[_0xa11f('0x13')]=_0xb529b7;};AGIVertices[_0xa11f('0x14')][_0xa11f('0x15')]=function(_0x29a31a,_0x535301){this['rpc']['getVariableById'](_0x29a31a)[_0xa11f('0x16')](function(_0x13395b){_0x535301(null,_0x13395b?_0x13395b[_0xa11f('0x17')]:![]);})[_0xa11f('0x18')](function(_0x426aa5){_0x535301(_0x426aa5);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x19')]=function(_0x2f5e91,_0x54f857){this[_0xa11f('0x12')][_0xa11f('0x1a')](_0x2f5e91)[_0xa11f('0x16')](function(_0x3f8d8d){_0x54f857(null,_0x3f8d8d?_0x3f8d8d[_0xa11f('0x17')]:![]);})[_0xa11f('0x18')](function(_0x5e1e4e){_0x54f857(_0x5e1e4e);});};AGIVertices['prototype']['getSquareProject']=function(_0x2b5034,_0x4a8d2e){this['rpc'][_0xa11f('0x1b')](_0x2b5034)[_0xa11f('0x16')](function(_0x772f13){_0x4a8d2e(null,_0x772f13?_0x772f13[_0xa11f('0x17')]:![]);})[_0xa11f('0x18')](function(_0x5c5baf){_0x4a8d2e(_0x5c5baf);});};AGIVertices['prototype'][_0xa11f('0x1c')]=function(_0xdbfdc0,_0x37aeb1){this[_0xa11f('0x12')][_0xa11f('0x1d')](_0xdbfdc0)[_0xa11f('0x16')](function(_0x5d3209){_0x37aeb1(null,_0x5d3209?_0x5d3209[_0xa11f('0x1e')]:![]);})[_0xa11f('0x18')](function(_0x31f75c){_0x37aeb1(_0x31f75c);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1f')]=function(_0x367cf8,_0x437358){this[_0xa11f('0x12')][_0xa11f('0x20')](_0x367cf8)[_0xa11f('0x16')](function(_0x1bb2f8){_0x437358(null,_0x1bb2f8?_0x1bb2f8[_0xa11f('0x17')]:![]);})[_0xa11f('0x18')](function(_0x1159c3){_0x437358(_0x1159c3);});};AGIVertices['prototype'][_0xa11f('0x21')]=function(_0x463c71,_0x89ab8e){this['rpc']['getTrunkById'](_0x463c71)['then'](function(_0x110756){_0x89ab8e(null,_0x110756?_0x110756[_0xa11f('0x17')]:![]);})[_0xa11f('0x18')](function(_0x54cc2e){_0x89ab8e(_0x54cc2e);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x22')]=function(_0xea4284,_0x1f628a){var _0xed4060=this;this[_0xa11f('0x12')][_0xa11f('0x23')](_0xea4284)['then'](function(_0x350b1d){_0x1f628a(null,_0x350b1d?_0xed4060[_0xa11f('0x24')](_0x350b1d['save_name']):![]);})['catch'](function(_0x55ead3){_0x1f628a(_0x55ead3);});};AGIVertices['prototype']['getMailAccount']=function(_0x465a1c,_0x1a8096){this['rpc'][_0xa11f('0x25')](_0x465a1c)[_0xa11f('0x16')](function(_0xc5c4fc){_0x1a8096(null,_0xc5c4fc?_0xc5c4fc:![]);})[_0xa11f('0x18')](function(_0x165e54){_0x1a8096(_0x165e54);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x26')]=function(_0x187c8b,_0x3613c3,_0x1778fe){this[_0xa11f('0x13')][_0xa11f('0x26')](_0x187c8b,_0x3613c3)['then'](function(){_0x1778fe(null);})['catch'](function(_0xbf2cc0){_0x1778fe(_0xbf2cc0);});};AGIVertices['prototype'][_0xa11f('0x27')]=function(_0x44d16b,_0x524e2b){this[_0xa11f('0x12')]['getIntervalById'](_0x44d16b)[_0xa11f('0x16')](function(_0x428592){if(_0x428592){if(_0x428592[_0xa11f('0x28')]){_0x524e2b(null,[_0x428592['interval']]);}else{_0x524e2b(null,_[_0xa11f('0x29')](_0x428592['Intervals'],_0xa11f('0x2a')));}}else{_0x524e2b(null,![]);}})[_0xa11f('0x18')](function(_0x24ae02){_0x524e2b(_0x24ae02);});};AGIVertices['prototype']['getSoundPath']=function(_0x38403b){return util[_0xa11f('0x2b')](_0xa11f('0x2c'),FILES_PATH,_0x38403b);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x2d')]=function(_0x38d3f6,_0x51ec79,_0x10827a){odbc[_0xa11f('0x2e')](_0x38d3f6,function(_0x48b6fb){if(_0x48b6fb){logger[_0xa11f('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x48b6fb);_0x10827a(_0x48b6fb);}else{logger[_0xa11f('0x30')](_0xa11f('0x31'));odbc[_0xa11f('0x32')](_0x51ec79,function(_0x3d1e8c,_0x41eed4){if(_0x3d1e8c){logger[_0xa11f('0x30')](_0xa11f('0x33'),_0x51ec79);_0x10827a(_0x3d1e8c);}else{logger[_0xa11f('0x30')](_0xa11f('0x34'),_0x51ec79);odbc[_0xa11f('0x35')](function(_0x564f13){if(_0x564f13){logger[_0xa11f('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x564f13);}_0x10827a(null,_0x41eed4);});}});}});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x36')]=function(_0x1f88f1,_0x4e3dd9){this[_0xa11f('0x12')][_0xa11f('0x37')](_0x1f88f1)[_0xa11f('0x16')](function(_0x25a44c){_0x4e3dd9(null,_0x25a44c?_0x25a44c:![]);})['catch'](function(_0x34a262){_0x4e3dd9(_0x34a262);});};AGIVertices['prototype'][_0xa11f('0x38')]=function(_0x38692b,_0x3c1933){this[_0xa11f('0x12')][_0xa11f('0x38')](_0x38692b)[_0xa11f('0x16')](function(_0x283f70){_0x3c1933(null,_0x283f70);})[_0xa11f('0x18')](function(_0x5408f6){_0x3c1933(_0x5408f6);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x39')]=function(_0x3f4160,_0x575559,_0x1cce2e){this['rpc'][_0xa11f('0x39')]({'uniqueid':this[_0xa11f('0x11')][_0xa11f('0x3a')],'node':_0x3f4160['label'],'application':_0x3f4160[_0xa11f('0x3b')],'data':_0x575559||null,'project_name':this[_0xa11f('0x11')][_0xa11f('0x3c')],'callerid':this[_0xa11f('0x11')][_0xa11f('0x3d')]})['then'](function(_0x24bf91){if(_0x1cce2e){_0x1cce2e(null,_0x24bf91);}})[_0xa11f('0x18')](function(_0x472f3d){if(_0x1cce2e){_0x1cce2e(_0x472f3d);}});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x3e')]=function(_0x186053,_0x59623b,_0x379308,_0x1ca30e){this[_0xa11f('0x12')]['createSquareRecording']({'uniqueid':this[_0xa11f('0x11')][_0xa11f('0x3a')],'callerid':this['channel'][_0xa11f('0x3d')],'calleridname':this[_0xa11f('0x11')]['calleridname'],'context':this[_0xa11f('0x11')][_0xa11f('0x3f')],'extension':this[_0xa11f('0x11')][_0xa11f('0x40')],'priority':this[_0xa11f('0x11')][_0xa11f('0x41')],'accountcode':this[_0xa11f('0x11')][_0xa11f('0x42')],'dnid':this[_0xa11f('0x11')][_0xa11f('0x43')],'projectName':this[_0xa11f('0x11')][_0xa11f('0x3c')],'saveName':_0x59623b,'filename':_0x186053['file']||_0x59623b,'savePath':_0x379308})[_0xa11f('0x16')](function(_0x144699){_0x1ca30e(null,_0x144699);})[_0xa11f('0x18')](function(_0x474381){_0x1ca30e(_0x474381);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x44')]=function(_0xb786ca,_0x3a1c19,_0x4c4df3,_0xacded7,_0x429912){this[_0xa11f('0x12')]['createSquareMessage']({'uniqueid':this[_0xa11f('0x11')][_0xa11f('0x3a')],'body':_0xb786ca,'direction':_0x3a1c19,'providerName':_0x4c4df3,'providerResponse':_0xacded7})[_0xa11f('0x16')](function(_0x27fe0d){if(_0x429912){_0x429912(null,_0x27fe0d);}})[_0xa11f('0x18')](function(_0x273275){if(_0x429912){_0x429912(_0x273275);}});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x45')]=function(_0x5cf48b,_0x40d451){this['rpc'][_0xa11f('0x45')]({'firstName':_['isEmpty'](_0x5cf48b[_0xa11f('0x17')])||_[_0xa11f('0x46')](_0x5cf48b['name'])?'callback_'+Math['random']():_0x5cf48b[_0xa11f('0x17')],'lastName':_['isEmpty'](_0x5cf48b['lastName'])||_[_0xa11f('0x46')](_0x5cf48b[_0xa11f('0x47')])?null:_0x5cf48b['lastName'],'phone':_0x5cf48b[_0xa11f('0x48')],'ListId':_0x5cf48b['list_id'],'scheduledat':_0x5cf48b[_0xa11f('0x49')],'callbackUniqueid':this['channel'][_0xa11f('0x3a')],'tags':_0xa11f('0x4a'),'description':_0xa11f('0x4b')+_0x5cf48b[_0xa11f('0x49')]['toString'](),'priority':_0x5cf48b['callback_priority']})['then'](function(_0x5c0210){_0x40d451(null,_0x5c0210);})[_0xa11f('0x18')](function(_0x150f54){_0x40d451(_0x150f54);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x4c')]=function(_0x5636c3,_0x195366){this[_0xa11f('0x12')]['getPauseById'](_0x5636c3)[_0xa11f('0x16')](function(_0x560b92){_0x195366(null,_0x560b92?_0x560b92['name']:![]);})['catch'](function(_0x3dfbb7){_0x195366(_0x3dfbb7);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x4d')]=function(_0x3c5634,_0x5d0058,_0x41ff22){var _0x252592={'role':_0xa11f('0x4e')};_0x252592[_0x3c5634]=this['channel'][_0xa11f('0x3d')];this[_0xa11f('0x12')][_0xa11f('0x4d')](_0x252592,_0x5d0058,this[_0xa11f('0x11')][_0xa11f('0x3a')])[_0xa11f('0x16')](function(_0x7aef93){_0x41ff22(null,_[_0xa11f('0x46')](_0x7aef93)?![]:!![]);})[_0xa11f('0x18')](function(_0xc40ce5){logger[_0xa11f('0x2f')](_0xc40ce5);_0x41ff22(null,![]);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x4f')]=function(_0xe11fe8,_0x380071){var _0x37701d={'role':'agent'};_0x37701d[_0xe11fe8]=this[_0xa11f('0x11')][_0xa11f('0x3d')];this['rpc'][_0xa11f('0x4f')](_0x37701d)[_0xa11f('0x16')](function(_0x597ef8){_0x380071(null,_[_0xa11f('0x46')](_0x597ef8)?![]:!![]);})[_0xa11f('0x18')](function(_0x3d25d5){logger[_0xa11f('0x2f')](_0x3d25d5);_0x380071(null,![]);});};AGIVertices[_0xa11f('0x14')]['agentLogout']=function(_0x1ca390,_0x27ad24){var _0x3b5df1={'role':_0xa11f('0x4e')};_0x3b5df1[_0x1ca390]=this[_0xa11f('0x11')][_0xa11f('0x3d')];this['rpc'][_0xa11f('0x50')](_0x3b5df1)[_0xa11f('0x16')](function(_0x19a54e){_0x27ad24(null,_[_0xa11f('0x46')](_0x19a54e)?![]:!![]);})[_0xa11f('0x18')](function(_0x8c1122){logger[_0xa11f('0x2f')](_0x8c1122);_0x27ad24(null,![]);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x51')]=function(_0x5e5b8a,_0x5e05ec){var _0x433b2c={'role':_0xa11f('0x4e')};_0x433b2c[_0x5e5b8a]=this[_0xa11f('0x11')][_0xa11f('0x3d')];var _0x24d617=_0x5e5b8a!=_0xa11f('0x52')?util[_0xa11f('0x2b')](_0xa11f('0x53'),'LOCAL',this['channel']['callerid']):undefined;this['rpc'][_0xa11f('0x51')](_0x433b2c,_0x24d617)[_0xa11f('0x16')](function(_0x28efaf){_0x5e05ec(null,_[_0xa11f('0x46')](_0x28efaf)?![]:!![]);})[_0xa11f('0x18')](function(_0x243285){logger[_0xa11f('0x2f')](_0x243285);_0x5e05ec(null,![]);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x54')]=function(_0x16ba0c,_0x287533){sh[_0xa11f('0x55')](_[_0xa11f('0x56')](_0x16ba0c),function(_0x956cc4,_0x32cea0){var _0xed6d20=_0x32cea0['replace'](/(\r\n|\n|\r)/gm,'');_0x287533(null,_0xed6d20);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x57')]=function(_0x52eec3,_0x412b05){scripts[_0xa11f('0x57')](_0x52eec3[_0xa11f('0x58')],_0x52eec3['google_cloud_tts_text_type']||_0xa11f('0x59'),_0x52eec3[_0xa11f('0x59')],_0x52eec3['languageCode']||'en-US',_0x52eec3['ssmlGender']||_0xa11f('0x5a'),_0x52eec3[_0xa11f('0x5b')]||_0xa11f('0x5c'))[_0xa11f('0x16')](function(_0x10ff55){_0x412b05(null,_0x10ff55);})[_0xa11f('0x18')](function(_0x1b44bc){_0x412b05(_0x1b44bc);});};AGIVertices[_0xa11f('0x14')]['googleTTS']=function(_0x2455ef,_0x5af8b4){scripts[_0xa11f('0x5d')](_0x2455ef[_0xa11f('0x59')],_0x2455ef[_0xa11f('0x5e')]||'en',0x1)[_0xa11f('0x16')](function(_0x508be4){_0x5af8b4(null,_0x508be4);})[_0xa11f('0x18')](function(_0x4b92bc){_0x5af8b4(_0x4b92bc);});};AGIVertices['prototype'][_0xa11f('0x5f')]=function(_0x37bf29,_0x553c0f){var _0x194e68={'uri':_0x37bf29[_0xa11f('0x60')],'method':_0x37bf29[_0xa11f('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37bf29[_0xa11f('0x62')])===_0xa11f('0x63')&&parseInt(_0x37bf29[_0xa11f('0x62')])>=0x1?parseInt(_0x37bf29[_0xa11f('0x62')])*0x3e8:0x5*0x3e8};if(_[_0xa11f('0x64')]([_0xa11f('0x65'),'PUT'],_0x194e68['method'][_0xa11f('0x66')]())){try{_0x194e68[_0xa11f('0x67')]=_0x37bf29[_0xa11f('0xd')]?JSON['parse'](_0x37bf29[_0xa11f('0xd')]):{};}catch(_0x300d87){logger[_0xa11f('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x300d87);}}try{_0x194e68['headers']=_0x37bf29['rawHeaders']?JSON[_0xa11f('0x68')](_0x37bf29[_0xa11f('0xc')]):{};}catch(_0x12b73e){logger[_0xa11f('0x2f')](_0xa11f('0x69'),_0x12b73e);}if(_0x37bf29['computedVariables']){try{var _0x509150=require(_0x37bf29[_0xa11f('0x6a')])[_0xa11f('0x6b')](this,_0x194e68);_0x194e68[_0xa11f('0x6c')]=Mustache[_0xa11f('0x6d')](_0x37bf29['url'],_0x509150,{},['$$','$$']);if(_0x194e68[_0xa11f('0x6e')]){_0x194e68[_0xa11f('0x6e')]=JSON[_0xa11f('0x68')](Mustache[_0xa11f('0x6d')](JSON[_0xa11f('0x6f')](_0x194e68[_0xa11f('0x6e')]),_0x509150,{},['$$','$$']));}if(_0x194e68[_0xa11f('0x67')]){_0x194e68[_0xa11f('0x67')]=JSON[_0xa11f('0x68')](Mustache[_0xa11f('0x6d')](JSON[_0xa11f('0x6f')](_0x194e68[_0xa11f('0x67')]),_0x509150,{},['$$','$$']));}}catch(_0x347b4b){logger[_0xa11f('0x2f')](_0xa11f('0x70'),_0x347b4b);}}rp(_0x194e68)[_0xa11f('0x16')](function(_0x31742d){var _0x1bcdd2={'statusCode':_0x31742d[_0xa11f('0x71')]||0xc8,'statusMessage':_0x31742d[_0xa11f('0x72')]||'OK','headers':_0x31742d[_0xa11f('0x6e')]||{},'body':_0x31742d[_0xa11f('0x67')]||{}};_0x553c0f(null,_0x1bcdd2);})[_0xa11f('0x18')](function(_0x130881){var _0x419ce7={'statusCode':_0x130881[_0xa11f('0x71')]||0x1f4,'statusMessage':_0x130881[_0xa11f('0x73')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x130881[_0xa11f('0x74')][_0xa11f('0x6e')]||{},'body':_0x130881[_0xa11f('0x74')][_0xa11f('0x67')]||{}};_0x553c0f(null,_0x419ce7);});};AGIVertices['prototype'][_0xa11f('0x75')]=function(_0x5d673d,_0x5286c0){scripts[_0xa11f('0x75')](this['channel']['uniqueid'],_0x5d673d['key'],_0x5d673d[_0xa11f('0x59')],_0x5d673d[_0xa11f('0x76')]||'en')[_0xa11f('0x16')](function(_0x31f146){_0x5286c0(null,_0x31f146);})[_0xa11f('0x18')](function(_0x4da58b){_0x5286c0(_0x4da58b);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x77')]=function(_0x24b742,_0x52801a){scripts[_0xa11f('0x77')](this['channel']['uniqueid'],_0x24b742[_0xa11f('0x78')],_0x24b742[_0xa11f('0x79')],_0x24b742['private_key'],_0x24b742[_0xa11f('0x59')],_0x24b742[_0xa11f('0x7a')]||'en')['then'](function(_0x4bcfb4){_0x52801a(null,_0x4bcfb4);})[_0xa11f('0x18')](function(_0x26d09e){_0x52801a(_0x26d09e);});};AGIVertices['prototype'][_0xa11f('0x7b')]=function(_0x46371b,_0x29073a){scripts[_0xa11f('0x7b')](this['channel'],_0x46371b)[_0xa11f('0x16')](function(_0x3ef067){_0x29073a(null,_0x3ef067);})[_0xa11f('0x18')](function(_0x3ffe8c){_0x29073a(_0x3ffe8c);});};AGIVertices['prototype'][_0xa11f('0x7c')]=function(_0x4b49f0,_0x37a369){scripts['ispeechTTS'](_0x4b49f0['key'],_0x4b49f0[_0xa11f('0x59')],_0x4b49f0[_0xa11f('0x7d')]||_0xa11f('0x7e'),_0x4b49f0[_0xa11f('0x7f')])[_0xa11f('0x16')](function(_0x33f0ba){_0x37a369(null,_0x33f0ba);})[_0xa11f('0x18')](function(_0x42134e){_0x37a369(_0x42134e);});};AGIVertices[_0xa11f('0x14')]['ispeechASR']=function(_0xdaec51,_0x25e787,_0x7d14ed){scripts[_0xa11f('0x80')](_0x25e787,_0xdaec51[_0xa11f('0x81')],_0xdaec51[_0xa11f('0x82')]||_0xa11f('0x7e'),this[_0xa11f('0x83')](_0xdaec51[_0xa11f('0x84')])?_0xdaec51[_0xa11f('0x84')]:undefined)['then'](function(_0x79a666){_0x7d14ed(null,_0x79a666);})[_0xa11f('0x18')](function(_0x17f752){_0x7d14ed(_0x17f752);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x85')]=function(_0x9c1698,_0x48c1f9){scripts[_0xa11f('0x85')](_0x9c1698[_0xa11f('0x86')],_0x9c1698[_0xa11f('0x87')],_0x9c1698[_0xa11f('0x88')],_0x9c1698[_0xa11f('0x89')]||_0xa11f('0x8a'),_0x9c1698[_0xa11f('0x59')],_0x9c1698['aws_text_type']||'text')[_0xa11f('0x16')](function(_0x38e1a1){_0x48c1f9(null,_0x38e1a1);})[_0xa11f('0x18')](function(_0x553e18){_0x48c1f9(_0x553e18);});};AGIVertices[_0xa11f('0x14')]['awsLex']=function(_0x126df0,_0x19b2b0){scripts[_0xa11f('0x8b')](this[_0xa11f('0x11')][_0xa11f('0x3a')],_0x126df0['aws_access_key_id'],_0x126df0[_0xa11f('0x87')],_0x126df0[_0xa11f('0x8c')],_0x126df0[_0xa11f('0x59')],_0x126df0[_0xa11f('0x8d')])['then'](function(_0x3d9801){_0x19b2b0(null,_0x3d9801);})[_0xa11f('0x18')](function(_0x49d35c){_0x19b2b0(_0x49d35c);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x8e')]=function(_0x286968,_0x2f81c5,_0x5b0e36){scripts[_0xa11f('0x8e')](_0x2f81c5,_0x286968[_0xa11f('0x81')],_0x286968[_0xa11f('0x8f')]||_0xa11f('0x7e'))['then'](function(_0x3d5b5a){_0x5b0e36(null,_0x3d5b5a);})['catch'](function(_0xddcb6d){_0x5b0e36(_0xddcb6d);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x90')]=function(_0x1b26ae,_0x58a471,_0x59e935){scripts[_0xa11f('0x90')](_0x58a471,_0x1b26ae[_0xa11f('0x91')],_0x1b26ae[_0xa11f('0x92')],_0x1b26ae[_0xa11f('0x6c')])[_0xa11f('0x16')](function(_0x5402db){_0x59e935(null,_0x5402db);})[_0xa11f('0x18')](function(_0x46cce8){_0x59e935(_0x46cce8);});};AGIVertices[_0xa11f('0x14')][_0xa11f('0x93')]=function(_0x5519ca){var _0x288477=_[_0xa11f('0x64')](verticesWithRetry,_0x5519ca[_0xa11f('0x3b')])?_0x5519ca:_[_0xa11f('0x94')](_0x5519ca);for(var _0x3a0330 in _0x288477){if(_0x288477[_0xa11f('0x95')](_0x3a0330)){if(_0x288477[_0x3a0330]&&_['isString'](_0x288477[_0x3a0330])){if(_[_0xa11f('0x64')](recursiveMapAttributes,_0x3a0330)){_0x288477[_0x3a0330]=this[_0xa11f('0x96')](_0x288477[_0x3a0330]);}else{_0x288477[_0x3a0330]=this[_0xa11f('0x97')](_0x288477[_0x3a0330]);}}}}return _0x288477;};AGIVertices[_0xa11f('0x14')][_0xa11f('0x98')]=function(_0x47fa1f){for(var _0x373c10 in _0x47fa1f){if(_0x47fa1f[_0xa11f('0x95')](_0x373c10)){if(_['isPlainObject'](_0x47fa1f[_0x373c10])){this[_0xa11f('0x98')](_0x47fa1f[_0x373c10]);}else if(_[_0xa11f('0x99')](_0x47fa1f[_0x373c10])){for(var _0xcca7a7=0x0;_0xcca7a7<_0x47fa1f[_0x373c10][_0xa11f('0x9a')];_0xcca7a7++){this[_0xa11f('0x98')](_0x47fa1f[_0x373c10][_0xcca7a7]);}}else if(_[_0xa11f('0x9b')](_0x47fa1f[_0x373c10])){_0x47fa1f[_0x373c10]=this[_0xa11f('0x97')](_0x47fa1f[_0x373c10]);}}}};AGIVertices[_0xa11f('0x14')][_0xa11f('0x9c')]=function(_0x45d1b3,_0x802c60){for(var _0x5a9378 in _0x45d1b3){if(_0x45d1b3[_0xa11f('0x95')](_0x5a9378)){if(_['isPlainObject'](_0x45d1b3[_0x5a9378])){if(!_['isEmpty'](_0x45d1b3[_0x5a9378])){this['saveRestApiResult'](_0x45d1b3[_0x5a9378],util[_0xa11f('0x2b')](_0xa11f('0x9d'),_0x802c60,_0x5a9378));}}else if(_[_0xa11f('0x99')](_0x45d1b3[_0x5a9378])){for(var _0x578e67=0x0;_0x578e67<_0x45d1b3[_0x5a9378][_0xa11f('0x9a')];_0x578e67++){this[_0xa11f('0x9c')](_0x45d1b3[_0x5a9378][_0x578e67],util[_0xa11f('0x2b')](_0xa11f('0x9d'),_0x802c60,_0x5a9378+'['+_0x578e67+']'));}}else{if(!_[_0xa11f('0x46')](_0x45d1b3[_0x5a9378])){this['channel'][_0xa11f('0x9e')](util['format'](_0xa11f('0x9d'),_0x802c60,_0x5a9378),_0x45d1b3[_0x5a9378]);}}}}};AGIVertices['prototype'][_0xa11f('0x96')]=function(_0x38c2f3){try{var _0x5b12d7=JSON[_0xa11f('0x68')](_0x38c2f3);this[_0xa11f('0x98')](_0x5b12d7);return JSON['stringify'](_0x5b12d7);}catch(_0x5792a3){return this[_0xa11f('0x97')](_0x38c2f3);}};AGIVertices[_0xa11f('0x14')][_0xa11f('0x97')]=function(_0x31d22c){var _0x34d5cd=_0x31d22c[_0xa11f('0x9f')]('{');for(var _0x23a178=0x1;_0x23a178<_0x34d5cd['length'];_0x23a178+=0x1){var _0x5acab2=_0x34d5cd[_0x23a178][_0xa11f('0x9f')]('}');if(_0x5acab2['length']>0x1){_0x31d22c=_0x31d22c[_0xa11f('0xa0')]('{'+_0x5acab2[0x0]+'}',this[_0xa11f('0x11')][_0xa11f('0x15')](_0x5acab2[0x0])[_0xa11f('0xa1')]||_0x5acab2[0x0]);}}if(_0x34d5cd[_0xa11f('0x9a')]===0x1){return _0x31d22c[_0xa11f('0xa2')]();}return this['replaceAllVariables'](_0x31d22c);};AGIVertices['prototype'][_0xa11f('0xa3')]=function(_0x486e91,_0x54b1d6){var _0x285c44=this[_0xa11f('0x11')]['getVariable'](_0x486e91);if(_0x285c44[_0xa11f('0xa4')]===-0x1){return _0x285c44;}logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xa5'),_0x54b1d6,_0x285c44[_0xa11f('0xa1')]));return this['channel'][_0xa11f('0x9e')](_0x54b1d6,_0x285c44[_0xa11f('0xa1')]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x83')]=function(_0x2e2a69){return _0x2e2a69&&_0x2e2a69!=='0'&&_0x2e2a69!=='-1'&&_0x2e2a69!=='';};AGIVertices[_0xa11f('0x14')][_0xa11f('0xa6')]=function(_0x23db69){this[_0xa11f('0x39')][_0xa11f('0x6b')](this,_0x23db69,'-');_0x23db69[_0xa11f('0xa7')]=_0x23db69['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa11f('0x14')][_0xa11f('0xa8')]=function(_0x1b72b6){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xa9'),_0x1b72b6[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x1b72b6['text'])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0xab'));}var _0x9ca16f='\x22'+_0x1b72b6[_0xa11f('0x59')]+'\x22';if(this[_0xa11f('0x83')](_0x1b72b6[_0xa11f('0x74')])){_0x9ca16f+=','+_0x1b72b6[_0xa11f('0x74')];}var _0x57e21d=this[_0xa11f('0x11')]['exec'](_0xa11f('0xac'),_0x9ca16f);if(_0x57e21d[_0xa11f('0xa4')]===-0x1){return _0x57e21d;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x9ca16f));};AGIVertices['prototype'][_0xa11f('0xae')]=function(_0x2c10d9){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xaf'),_0x2c10d9['label']));if(!this[_0xa11f('0x83')](_0x2c10d9[_0xa11f('0xb0')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xb1'));}var _0x497257=_0x2c10d9['grammar'];if(this[_0xa11f('0x83')](_0x2c10d9[_0xa11f('0x74')])){_0x497257+=','+_0x2c10d9['options'];}var _0x4333e0=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0xb2'),_0x497257);if(_0x4333e0[_0xa11f('0xa4')]===-0x1){return _0x4333e0;}var _0x34e48e=this[_0xa11f('0xa3')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x34e48e['result']===-0x1){return _0x34e48e;}var _0x2464a7=this[_0xa11f('0xa3')](_0xa11f('0xb3'),_0xa11f('0xb4'));if(_0x2464a7['result']===-0x1){return _0x2464a7;}var _0x274af0=this[_0xa11f('0xa3')]('RECOG_INSTANCE()',_0xa11f('0xb5'));if(_0x274af0[_0xa11f('0xa4')]===-0x1){return _0x274af0;}return this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0xb6'),_0x497257));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xa')]=function(_0x18e05d){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xb7'),_0x18e05d[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0xa')]([_0x18e05d[_0xa11f('0xb8')],_0x18e05d[_0xa11f('0xb9')]]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0xba')]=function(_0x38c095){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x38c095[_0xa11f('0xaa')]));if(this[_0xa11f('0x83')](_0x38c095[_0xa11f('0x62')])){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x38c095['timeout']));var _0x108ca9=this[_0xa11f('0x11')][_0xa11f('0xbb')](_0x38c095[_0xa11f('0x62')]);if(_0x108ca9[_0xa11f('0xa4')]===-0x1){return _0x108ca9;}}return this[_0xa11f('0x11')][_0xa11f('0xba')]();};AGIVertices[_0xa11f('0x14')][_0xa11f('0x4a')]=function(_0xe48eff){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xbc'),_0xe48eff[_0xa11f('0xaa')]));if(!this['isConfigured'](_0xe48eff[_0xa11f('0xbd')])){return this['channel'][_0xa11f('0x2f')](_0xe48eff,_0xa11f('0xbe'));}_0xe48eff[_0xa11f('0x49')]=moment();if(this[_0xa11f('0x83')](_0xe48eff[_0xa11f('0xbf')])){_0xe48eff[_0xa11f('0x49')]=moment()['add'](_0xe48eff[_0xa11f('0xbf')],_0xa11f('0xc0'));}if(!this[_0xa11f('0x83')](_0xe48eff['callback_priority'])){_0xe48eff[_0xa11f('0xc1')]=0x2;}this[_0xa11f('0x45')][_0xa11f('0x6b')](this,_0xe48eff);return this[_0xa11f('0x11')][_0xa11f('0xad')](util['format'](_0xa11f('0xc2'),_0xe48eff[_0xa11f('0x48')],_0xe48eff[_0xa11f('0xbd')],_0xe48eff[_0xa11f('0x49')]));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xc3')]=function(_0x512d42){logger[_0xa11f('0x30')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x512d42[_0xa11f('0xaa')]));var _0x49b49d=this[_0xa11f('0x11')][_0xa11f('0x55')](_0x512d42['application'],_0x512d42[_0xa11f('0x74')]);if(_0x49b49d[_0xa11f('0xa4')]===-0x1){return _0x49b49d;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Executed\x20command\x20%s\x20%s',_0x512d42[_0xa11f('0xc4')],_0x512d42['options']));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xc5')]=function(_0x4968fd){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xc6'),_0x4968fd[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x4968fd[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20text\x20configured');}var _0x42cb49='\x22'+_0x4968fd[_0xa11f('0x59')]+'\x22';if(this['isConfigured'](_0x4968fd[_0xa11f('0x74')])){_0x42cb49+=','+_0x4968fd[_0xa11f('0x74')];}var _0x2ea154=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0xac'),_0x42cb49);if(_0x2ea154['result']===-0x1){return _0x2ea154;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x42cb49));};AGIVertices[_0xa11f('0x14')]['sestektts']=function(_0x1caaea){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x1caaea[_0xa11f('0xaa')]));if(!this['isConfigured'](_0x1caaea[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20text\x20configured');}var _0x2d77bd='\x22'+_0x1caaea[_0xa11f('0x59')]+'\x22';if(this[_0xa11f('0x83')](_0x1caaea['options'])){_0x2d77bd+=','+_0x1caaea[_0xa11f('0x74')];}var _0x15cf16=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0xac'),_0x2d77bd);if(_0x15cf16[_0xa11f('0xa4')]===-0x1){return _0x15cf16;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xc7'),_0x2d77bd));};AGIVertices['prototype'][_0xa11f('0xc8')]=function(_0x4be897){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xc9'),_0x4be897[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x4be897[_0xa11f('0xb0')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0xb1'));}var _0x198f0b=_0x4be897[_0xa11f('0xb0')];if(this['isConfigured'](_0x4be897['options'])){_0x198f0b+=','+_0x4be897[_0xa11f('0x74')];}var _0x23cec7=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0xb2'),_0x198f0b);if(_0x23cec7[_0xa11f('0xa4')]===-0x1){return _0x23cec7;}var _0x42e4f0=this[_0xa11f('0xa3')](_0xa11f('0xca'),_0xa11f('0xcb'));if(_0x42e4f0[_0xa11f('0xa4')]===-0x1){return _0x42e4f0;}var _0x5de29a=this['getAndSetVariable'](_0xa11f('0xb3'),_0xa11f('0xcc'));if(_0x5de29a['result']===-0x1){return _0x5de29a;}var _0x40f58c=this[_0xa11f('0xa3')](_0xa11f('0xcd'),_0xa11f('0xce'));if(_0x40f58c['result']===-0x1){return _0x40f58c;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xb6'),_0x198f0b));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xcf')]=function(_0x1d5d75){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1d5d75['label']));if(!this[_0xa11f('0x83')](_0x1d5d75[_0xa11f('0xb0')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xb1'));}var _0x5cf5ca=_0x1d5d75[_0xa11f('0xb0')];if(this[_0xa11f('0x83')](_0x1d5d75[_0xa11f('0x74')])){_0x5cf5ca+=','+_0x1d5d75[_0xa11f('0x74')];}var _0x2bdefa=this['channel'][_0xa11f('0x55')](_0xa11f('0xb2'),_0x5cf5ca);if(_0x2bdefa['result']===-0x1){return _0x2bdefa;}var _0x45007e=this['getAndSetVariable'](_0xa11f('0xca'),_0xa11f('0xd0'));if(_0x45007e[_0xa11f('0xa4')]===-0x1){return _0x45007e;}var _0x4bfd7e=this[_0xa11f('0xa3')](_0xa11f('0xb3'),_0xa11f('0xd1'));if(_0x4bfd7e[_0xa11f('0xa4')]===-0x1){return _0x4bfd7e;}var _0x563d6e=this['getAndSetVariable'](_0xa11f('0xcd'),_0xa11f('0xd2'));if(_0x563d6e[_0xa11f('0xa4')]===-0x1){return _0x563d6e;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xb6'),_0x5cf5ca));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xd3')]=function(_0x3b8c37){logger[_0xa11f('0x30')](util['format'](_0xa11f('0xd4'),_0x3b8c37[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x3b8c37[_0xa11f('0xd5')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3b8c37,_0xa11f('0xd6'));}var _0x22126a=this[_0xa11f('0x1c')][_0xa11f('0x6b')](this,_0x3b8c37[_0xa11f('0xd5')]);if(!_0x22126a){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3b8c37,_0xa11f('0xd7'));}if(!this[_0xa11f('0x83')](_0x3b8c37[_0xa11f('0x32')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3b8c37,_0xa11f('0xd8'));}var _0x54cd0e=_0x3b8c37[_0xa11f('0x32')][_0xa11f('0xd9')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xda'),_0x54cd0e));var _0xc4b7e6=this[_0xa11f('0x2d')]['sync'](this,_0x22126a,_0x54cd0e);this[_0xa11f('0x39')][_0xa11f('0x6b')](this,_0x3b8c37,_0x54cd0e);if(!this[_0xa11f('0x83')](_0x3b8c37[_0xa11f('0xdb')])){return this['channel'][_0xa11f('0xad')](_0xa11f('0xdc'));}var _0x316ef0=this[_0xa11f('0x15')][_0xa11f('0x6b')](this,_0x3b8c37['variable_id']);if(!_0x316ef0){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3b8c37,_0xa11f('0xdd'));}var _0x4db6d0=this;_0xc4b7e6[_0xa11f('0xde')](function(_0x45c246,_0x33586a){Object[_0xa11f('0xdf')](_0x45c246)[_0xa11f('0xde')](function(_0x323334){_0x4db6d0[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0xe0'),_0x316ef0,_0x33586a,_0x323334),_0x45c246[_0x323334]);});});this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0xe1'),_0x316ef0),_0xc4b7e6[_0xa11f('0x9a')]);return this[_0xa11f('0x11')][_0xa11f('0xad')](util['format'](_0xa11f('0xe2'),_0x316ef0));};AGIVertices[_0xa11f('0x14')][_0xa11f('0xe3')]=function(_0xfa75be){logger[_0xa11f('0xe4')](util[_0xa11f('0x2b')](_0xa11f('0xe5'),_0xfa75be[_0xa11f('0xaa')]));if(!this['isConfigured'](_0xfa75be[_0xa11f('0xe6')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0xfa75be,_0xa11f('0xe7'));}var _0x4f963f=this[_0xa11f('0x1f')]['sync'](this,_0xfa75be[_0xa11f('0xe6')]);if(!_0x4f963f){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0xfa75be,_0xa11f('0xe8'));}var _0x8fd3fe=this['channel'][_0xa11f('0x55')]('DIAL',[util[_0xa11f('0x2b')](_0xa11f('0xe9'),_0x4f963f),_0xfa75be[_0xa11f('0x62')],_0xfa75be['opts'],_0xfa75be[_0xa11f('0x60')]]);if(_0x8fd3fe[_0xa11f('0xa4')]===-0x1){return _0x8fd3fe;}return this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0xea'),_0xa11f('0xeb')));};AGIVertices['prototype'][_0xa11f('0xec')]=function(_0x23eb31){logger[_0xa11f('0x30')](util['format'](_0xa11f('0xed'),_0x23eb31[_0xa11f('0xaa')]));if(!this['isConfigured'](_0x23eb31['key'])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x23eb31[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xab'));}this[_0xa11f('0x11')][_0xa11f('0xee')]=!![];this[_0xa11f('0x39')](_0x23eb31);this[_0xa11f('0x44')](_0x23eb31['text'],'in','','');this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xef'),_0x23eb31[_0xa11f('0x59')]));var _0x5c3ae8=this[_0xa11f('0x75')][_0xa11f('0x6b')](this,_0x23eb31);if(_0x5c3ae8){for(var _0x5d945e in _0x5c3ae8){if(_0x5c3ae8[_0xa11f('0x95')](_0x5d945e)){this[_0xa11f('0x11')]['setVariable'](util[_0xa11f('0x2b')](_0xa11f('0xf0'),_0x5d945e[_0xa11f('0x66')]()),_0x5c3ae8[_0x5d945e]);}}this['createSquareMessage'](_0x5c3ae8[_0xa11f('0xf1')],_0xa11f('0xf2'),_0xa11f('0xec'),'');return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xf3'),_0x5c3ae8[_0xa11f('0xf1')]));}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x23eb31,_0xa11f('0xf4'));};AGIVertices['prototype'][_0xa11f('0xf5')]=function(_0x49ace2){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0xf6'),_0x49ace2[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x49ace2[_0xa11f('0x78')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0xf7'));}if(!this[_0xa11f('0x83')](_0x49ace2[_0xa11f('0x79')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xf8'));}if(!this['isConfigured'](_0x49ace2[_0xa11f('0xf9')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xfa'));}if(!this[_0xa11f('0x83')](_0x49ace2[_0xa11f('0x7a')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xfb'));}if(!this['isConfigured'](_0x49ace2[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xab'));}this[_0xa11f('0x11')][_0xa11f('0xee')]=!![];this['createSquareDetailsReport'](_0x49ace2);this[_0xa11f('0x44')](_0x49ace2[_0xa11f('0x59')],'in','','');this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xfc'),_0x49ace2[_0xa11f('0x59')]));var _0x2c3123=this['googleDialogflowV2'][_0xa11f('0x6b')](this,_0x49ace2);if(_0x2c3123){for(var _0x16ccc5 in _0x2c3123){if(_0x2c3123[_0xa11f('0x95')](_0x16ccc5)){if(_0x16ccc5!=='providerResponse'){this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0xf0'),_0x16ccc5[_0xa11f('0x66')]()),_0x2c3123[_0x16ccc5]);}}}this[_0xa11f('0x44')](_0x2c3123[_0xa11f('0xf1')],_0xa11f('0xf2'),'dialogflowV2',_0x2c3123[_0xa11f('0xfd')]);return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xfe'),_0x2c3123[_0xa11f('0xf1')]));}return this[_0xa11f('0x11')]['error'](_0x49ace2,_0xa11f('0xff'));};AGIVertices[_0xa11f('0x14')]['sesteknda']=function(_0x34d793){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x100'),_0x34d793[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x34d793[_0xa11f('0x101')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0x102'));}if(!this[_0xa11f('0x83')](_0x34d793['username'])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x103'));}if(!this['isConfigured'](_0x34d793[_0xa11f('0x104')])){return this['channel'][_0xa11f('0xad')](_0xa11f('0x105'));}if(!this[_0xa11f('0x83')](_0x34d793[_0xa11f('0x106')])){return this[_0xa11f('0x11')]['noop']('no\x20text\x20configured');}this['channel'][_0xa11f('0xee')]=!![];this[_0xa11f('0x39')](_0x34d793);this[_0xa11f('0x44')](_0x34d793[_0xa11f('0x59')],'in','','');this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x107'),_0x34d793[_0xa11f('0x59')]));var _0x13e433=this[_0xa11f('0x7b')][_0xa11f('0x6b')](this,_0x34d793);if(_0x13e433){for(var _0x804175 in _0x13e433){if(_0x13e433[_0xa11f('0x95')](_0x804175)){this['channel']['setVariable'](util[_0xa11f('0x2b')](_0xa11f('0x108'),_0x804175[_0xa11f('0x66')]()),_0x13e433[_0x804175]);}}this[_0xa11f('0x44')](_0x13e433[_0xa11f('0xf1')],_0xa11f('0xf2'),'sesteknda','');if(_0x13e433[_0xa11f('0x109')]){this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x10a'),_0x13e433[_0xa11f('0x109')]));var _0x17cd34=this[_0xa11f('0x11')][_0xa11f('0x10b')](_0x13e433[_0xa11f('0x109')]);try{fs[_0xa11f('0x10c')](_0x13e433[_0xa11f('0x109')]+_0xa11f('0x10d'));}catch(_0x131a63){logger[_0xa11f('0x2f')](_0x131a63);}return _0x17cd34;}else{return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('SestekNDA\x20Result\x20%s',_0x13e433[_0xa11f('0xf1')]));}}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x34d793,_0xa11f('0x10e'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x10f')]=function(_0x187d6b){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x187d6b['label']));return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x10f'));};AGIVertices[_0xa11f('0x14')]['ext_dial']=function(_0x25f9ec){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x110'),_0x25f9ec['label']));var _0x137a41='';if(_0x25f9ec['trunk_id']){if(!this[_0xa11f('0x83')](_0x25f9ec[_0xa11f('0x111')])){return this[_0xa11f('0x11')]['error'](_0x25f9ec,_0xa11f('0x112'));}else{var _0x27015d=parseInt(_0x25f9ec[_0xa11f('0x111')],0xa);if(isNaN(_0x27015d)){_0x137a41=_0x25f9ec['trunk_id'];}else{_0x137a41=this[_0xa11f('0x21')][_0xa11f('0x6b')](this,_0x25f9ec[_0xa11f('0x111')]);if(!_0x137a41){return this['channel'][_0xa11f('0x2f')](_0x25f9ec,_0xa11f('0x113'));}}}}else if(_0x25f9ec[_0xa11f('0x114')]){_0x137a41=_0x25f9ec[_0xa11f('0x114')];}else{return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x25f9ec,'no\x20trunk\x20selected');}var _0xa384de=this[_0xa11f('0x11')]['exec'](_0xa11f('0xeb'),[util[_0xa11f('0x2b')](_0xa11f('0x115'),_0x137a41,_0x25f9ec[_0xa11f('0x48')]),_0x25f9ec['timeout'],_0x25f9ec[_0xa11f('0x116')],_0x25f9ec['url']]);if(_0xa384de[_0xa11f('0xa4')]===-0x1){return _0xa384de;}return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0xea'),_0xa11f('0xeb')));};AGIVertices['prototype'][_0xa11f('0x117')]=function(_0x40fd52){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x118'),_0x40fd52['label']));return this['channel'][_0xa11f('0xad')](_0xa11f('0x117'));};AGIVertices['prototype'][_0xa11f('0xf')]=function(_0x21a052){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x119'),_0x21a052['label']));if(_0x21a052[_0xa11f('0xa7')]===0x0){return this[_0xa11f('0xa6')](_0x21a052);}_0x21a052['retry']-=0x1;if(!this[_0xa11f('0x83')](_0x21a052[_0xa11f('0x11a')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x21a052,_0xa11f('0x11b'));}var _0x134204=this[_0xa11f('0x22')][_0xa11f('0x6b')](this,_0x21a052[_0xa11f('0x11a')]);if(!_0x134204){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x21a052,_0xa11f('0x11c'));}if(!this[_0xa11f('0x83')](_0x21a052[_0xa11f('0xdb')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0xa11f('0xdc'));}var _0x47e7ad=this['channel']['getData'](_0x134204,_0x21a052[_0xa11f('0x11d')],_0x21a052[_0xa11f('0x11e')]);var _0x231449=_0x47e7ad['result']?_0x47e7ad[_0xa11f('0xa4')][_0xa11f('0xa2')]():'';logger[_0xa11f('0x30')](_0xa11f('0x11f'),JSON['stringify'](_0x47e7ad));if(_0x47e7ad[_0xa11f('0xa4')]===-0x1){this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x21a052,_0x231449);return _0x47e7ad;}else if(_0x47e7ad[_0xa11f('0xa1')]===_0xa11f('0x62')){_0x47e7ad[_0xa11f('0xa4')]=_0x231449[_0xa11f('0x9a')]>=parseInt(_0x21a052['mindigit'])?'x':'i';}else{_0x47e7ad[_0xa11f('0xa4')]=_0x231449['length']>=parseInt(_0x21a052[_0xa11f('0x120')])&&_0x231449[_0xa11f('0x9a')]<=parseInt(_0x21a052['maxdigit'])?'x':'i';}var _0x52b6d9=this['getVariable'][_0xa11f('0x6b')](this,_0x21a052[_0xa11f('0xdb')]);if(!_0x52b6d9){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x21a052,_0xa11f('0xdd'));}this[_0xa11f('0x11')][_0xa11f('0x9e')](_0x52b6d9,_0x231449);if(this[_0xa11f('0x83')](_0x21a052[_0xa11f('0x121')])){var _0x5ad723=parseInt(_0x21a052['hiddendigitsnum'],0xa);var _0x5d19d9=rs['generate']({'charset':'*','length':_0x5ad723});var _0x40c453=_0x231449[_0xa11f('0x9a')];if(_0x40c453>0x0){if(_0x40c453>_0x5ad723){this[_0xa11f('0x39')][_0xa11f('0x6b')](this,_0x21a052,_0x21a052[_0xa11f('0x122')]===_0xa11f('0x123')?_0x5d19d9+_0x231449[_0xa11f('0x124')](_0x5ad723):_0x231449[_0xa11f('0x124')](0x0,_0x40c453-_0x5ad723)+_0x5d19d9);}else{this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x21a052,rs[_0xa11f('0x125')]({'charset':'*','length':_0x40c453}));}}else{this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x21a052,'');}}else{this[_0xa11f('0x39')]['sync'](this,_0x21a052,_0x231449);}return _0x47e7ad;};AGIVertices[_0xa11f('0x14')][_0xa11f('0x10')]=function(_0x240594){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x240594[_0xa11f('0xaa')]));return this[_0xa11f('0xf')](_0x240594);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x126')]=function(_0x4f0d45){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x127'),_0x4f0d45[_0xa11f('0xaa')]));this[_0xa11f('0x39')][_0xa11f('0x6b')](this,_0x4f0d45,_0x4f0d45['goalname']);return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('GOAL\x20%s',_0x4f0d45['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x309fb2){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x128'),_0x309fb2[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x309fb2[_0xa11f('0x86')])||!this[_0xa11f('0x83')](_0x309fb2[_0xa11f('0x87')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xa11f('0x83')](_0x309fb2[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20text\x20configured');}this['channel'][_0xa11f('0xad')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x309fb2[_0xa11f('0x59')]));var _0x45f786=this[_0xa11f('0x85')][_0xa11f('0x6b')](this,_0x309fb2);if(_0x45f786){this[_0xa11f('0x11')][_0xa11f('0xad')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x45f786));var _0x14d947=this[_0xa11f('0x11')][_0xa11f('0x10b')](_0x45f786);try{fs[_0xa11f('0x10c')](_0x45f786+'.wav');}catch(_0x222c49){logger[_0xa11f('0x2f')](_0x222c49);}return _0x14d947;}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x309fb2,_0xa11f('0x129'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x12a')]=function(_0x4a691f){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x12b'),_0x4a691f[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x4a691f[_0xa11f('0x86')])||!this[_0xa11f('0x83')](_0x4a691f[_0xa11f('0x87')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x12c'));}if(!this['isConfigured'](_0x4a691f[_0xa11f('0x8d')])){return this['channel'][_0xa11f('0xad')](_0xa11f('0x12d'));}if(!this[_0xa11f('0x83')](_0x4a691f[_0xa11f('0x59')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0xab'));}this['channel']['bot']=!![];this[_0xa11f('0x39')](_0x4a691f);this[_0xa11f('0x44')](_0x4a691f[_0xa11f('0x59')],'in','','');this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x12e'),_0x4a691f['text']));var _0x56bef1=this[_0xa11f('0x8b')][_0xa11f('0x6b')](this,_0x4a691f);if(_0x56bef1){for(var _0x515d35 in _0x56bef1){if(_0x56bef1[_0xa11f('0x95')](_0x515d35)&&_[_0xa11f('0x9b')](_0x56bef1[_0x515d35])){this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0x12f'),_0x515d35[_0xa11f('0x66')]()),_0x56bef1[_0x515d35]);}}if(_['isNil'](_0x56bef1[_0xa11f('0x73')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xa11f('0x44')](_0x56bef1[_0xa11f('0x73')],_0xa11f('0xf2'),'amazonlex','');return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x130'),_0x56bef1[_0xa11f('0x73')]));}}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x4a691f,_0xa11f('0x131'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x132')]=function(_0x27d356){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x27d356[_0xa11f('0xaa')],_0x27d356[_0xa11f('0x62')]));if(!this[_0xa11f('0x83')](_0x27d356[_0xa11f('0x81')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x133'));}var _0x172aad=_0xa11f('0x134');var _0xbcbba2=util['format'](_0xa11f('0x135'),FILES_PATH,rs[_0xa11f('0x125')](0x4));var _0x1ab56b=util[_0xa11f('0x2b')](_0xa11f('0x9d'),_0xbcbba2,_0x172aad);var _0x3b9599=!![];if(_0x27d356[_0xa11f('0x136')]===_0xa11f('0x137')){_0x3b9599=![];}var _0x20f53b=this[_0xa11f('0x11')][_0xa11f('0x138')](_0xbcbba2,_0x172aad,_0x27d356[_0xa11f('0x139')],_0x27d356[_0xa11f('0x62')],undefined,_0x3b9599);if(_0x20f53b[_0xa11f('0xa4')]!==-0x1){this['channel']['noop'](util[_0xa11f('0x2b')](_0xa11f('0x13a'),_0x1ab56b));var _0x5c1ed3=this[_0xa11f('0x8e')]['sync'](this,_0x27d356,_0x1ab56b);if(_0x5c1ed3){for(var _0x562fdb in _0x5c1ed3){if(_0x5c1ed3['hasOwnProperty'](_0x562fdb)){this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0x13b'),_0x562fdb['toUpperCase']()),_0x5c1ed3[_0x562fdb]);}}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x13c'),JSON['stringify'](_0x5c1ed3)));}}return _0x20f53b;};AGIVertices[_0xa11f('0x14')][_0xa11f('0x13d')]=function(_0x540be2){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x13e'),_0x540be2[_0xa11f('0xaa')]));if(!this['isConfigured'](_0x540be2[_0xa11f('0x91')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x13f'));}if(!this[_0xa11f('0x83')](_0x540be2[_0xa11f('0x92')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x140'));}var _0x1caf4a=_0xa11f('0x134');var _0x1d6982=util['format'](_0xa11f('0x135'),FILES_PATH,rs[_0xa11f('0x125')](0x4));var _0x12b4ee=util[_0xa11f('0x2b')](_0xa11f('0x9d'),_0x1d6982,_0x1caf4a);var _0x4fad23=!![];if(_0x540be2[_0xa11f('0x136')]===_0xa11f('0x137')){_0x4fad23=![];}var _0x2e24ed=this[_0xa11f('0x11')][_0xa11f('0x138')](_0x1d6982,_0x1caf4a,_0x540be2['intKey'],_0x540be2[_0xa11f('0x62')],undefined,_0x4fad23);if(_0x2e24ed[_0xa11f('0xa4')]!==-0x1){this['channel'][_0xa11f('0xad')](util['format']('tilde\x20%s\x20file\x20created',_0x12b4ee));var _0x1f727f=this[_0xa11f('0x90')][_0xa11f('0x6b')](this,_0x540be2,_0x12b4ee);if(_0x1f727f){for(var _0x2d631d in _0x1f727f){if(_0x1f727f[_0xa11f('0x95')](_0x2d631d)){this['channel'][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0x141'),_0x2d631d[_0xa11f('0x66')]()),_0x1f727f[_0x2d631d]);}}return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0xa11f('0x6f')](_0x1f727f)));}}return _0x2e24ed;};AGIVertices[_0xa11f('0x14')]['gotoc']=function(_0x1ed9ba){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1ed9ba[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0x142')](_0x1ed9ba[_0xa11f('0x3f')],_0x1ed9ba[_0xa11f('0x40')],_0x1ed9ba[_0xa11f('0x41')]);};AGIVertices[_0xa11f('0x14')]['gotoif']=function(_0x73c3f3){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x143'),_0x73c3f3[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x73c3f3[_0xa11f('0x144')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x73c3f3,_0xa11f('0x145'));}try{var _0x103d87=eval(_0x73c3f3[_0xa11f('0x144')])?_0xa11f('0x146'):_0xa11f('0x147');this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x148'),_0x73c3f3['condition'],_0x103d87));return{'code':0xc8,'result':_0x103d87};}catch(_0x2c69e7){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xa11f('0x14')]['gotoiftime']=function(_0x334648){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x149'),_0x334648[_0xa11f('0xaa')]));if(!this['isConfigured'](_0x334648[_0xa11f('0x14a')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x334648,_0xa11f('0x14b'));}var _0x12c0e2=this['getIntervals'][_0xa11f('0x6b')](this,_0x334648[_0xa11f('0x14a')]);if(!_0x12c0e2){return this['channel']['error'](_0x334648,'no\x20intervals\x20found');}for(var _0x5e4841=0x0;_0x5e4841<_0x12c0e2[_0xa11f('0x9a')];_0x5e4841+=0x1){var _0xb19da5=this[_0xa11f('0x11')]['getVariable'](util[_0xa11f('0x2b')]('IFTIME(%s?true:false)',_0x12c0e2[_0x5e4841]));if(_0xb19da5[_0xa11f('0xa4')]===-0x1){return _0xb19da5;}logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('IFTIME\x20%s\x20%s',_0x12c0e2[_0x5e4841],_0xb19da5[_0xa11f('0xa1')]));if(_0xb19da5[_0xa11f('0xa1')]===_0xa11f('0x146')){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x14c'),_0x12c0e2[_0x5e4841],_0xa11f('0x146')));this[_0xa11f('0x11')]['noop'](util['format'](_0xa11f('0x14c'),_0x12c0e2[_0x5e4841],_0xa11f('0x146')));return{'code':0xc8,'result':'true'};}else{logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('IFTIME\x20%s\x20%s',_0x12c0e2[_0x5e4841],_0xa11f('0x147')));this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')]('IFTIME\x20%s\x20%s',_0x12c0e2[_0x5e4841],'false'));}}return{'code':0xc8,'result':_0xa11f('0x147')};};AGIVertices[_0xa11f('0x14')]['hangup']=function(_0x296b3c){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x14d'),_0x296b3c[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0x14e')]();};AGIVertices[_0xa11f('0x14')][_0xa11f('0x14f')]=function(_0x33d7e7){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x150'),_0x33d7e7[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x33d7e7['key'])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x133'));}var _0x1c6eae=_0xa11f('0x134');var _0x6309c=util['format'](_0xa11f('0x135'),FILES_PATH,rs['generate'](0x4));var _0x1a6a80=util[_0xa11f('0x2b')](_0xa11f('0x9d'),_0x6309c,_0x1c6eae);var _0x54bd5e=!![];if(_0x33d7e7[_0xa11f('0x136')]===_0xa11f('0x137')){_0x54bd5e=![];}var _0xbaa332=this[_0xa11f('0x11')][_0xa11f('0x138')](_0x6309c,_0x1c6eae,_0x33d7e7[_0xa11f('0x139')],_0x33d7e7[_0xa11f('0x62')],undefined,_0x54bd5e);if(_0xbaa332['result']!==-0x1){this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x151'),_0x1a6a80));var _0x4d0594=this['ispeechASR'][_0xa11f('0x6b')](this,_0x33d7e7,_0x1a6a80);if(_0x4d0594){for(var _0x3549e8 in _0x4d0594){if(_0x4d0594[_0xa11f('0x95')](_0x3549e8)){this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')]('ISPEECH_ASR_%s',_0x3549e8['toUpperCase']()),_0x4d0594[_0x3549e8]);}}return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0xa11f('0x6f')](_0x4d0594)));}}return _0xbaa332;};AGIVertices[_0xa11f('0x14')]['ispeechtts']=function(_0x41bd2e){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x152'),_0x41bd2e[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x41bd2e['key'])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x133'));}if(!this['isConfigured'](_0x41bd2e[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20text\x20configured');}this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x153'),_0x41bd2e['text']));var _0x44cde6=this[_0xa11f('0x7c')][_0xa11f('0x6b')](this,_0x41bd2e);if(_0x44cde6){this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x151'),_0x44cde6));var _0x45d7b7=this[_0xa11f('0x11')][_0xa11f('0x10b')](_0x44cde6,_0x41bd2e[_0xa11f('0x139')]);try{fs[_0xa11f('0x10c')](_0x44cde6+_0xa11f('0x10d'));}catch(_0x3c6a7e){logger[_0xa11f('0x2f')](_0x3c6a7e);}return _0x45d7b7;}return this[_0xa11f('0x11')]['error'](_0x41bd2e,_0xa11f('0x154'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x155')]=function(_0x462894){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x462894[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x462894[_0xa11f('0x156')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x462894,_0xa11f('0x157'));}logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x158'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x462894[_0xa11f('0x156')]));var _0x4c18e4=this[_0xa11f('0x51')][_0xa11f('0x6b')](this,_0x462894[_0xa11f('0x156')]);if(_0x4c18e4){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x159'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x462894['findBy']));this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x462894[_0xa11f('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')]['callerid'],_0x462894[_0xa11f('0x156')]));this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa11f('0x3d')],_0x462894[_0xa11f('0x156')]));return{'code':0xc8,'result':_0xa11f('0x15b')};}};AGIVertices[_0xa11f('0x14')][_0xa11f('0x15c')]=function(_0x2f47b5){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x15d'),_0x2f47b5['label']));if(!this[_0xa11f('0x83')](_0x2f47b5[_0xa11f('0x156')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x2f47b5,_0xa11f('0x157'));}logger[_0xa11f('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x2f47b5[_0xa11f('0x156')]));var _0x497863=this[_0xa11f('0x50')][_0xa11f('0x6b')](this,_0x2f47b5[_0xa11f('0x156')]);if(_0x497863){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x159'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x2f47b5[_0xa11f('0x156')]));this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x159'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x2f47b5[_0xa11f('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')]['callerid'],_0x2f47b5[_0xa11f('0x156')]));this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')]['callerid'],_0x2f47b5['findBy']));return{'code':0xc8,'result':_0xa11f('0x15b')};}};AGIVertices['prototype']['math']=function(_0x5551aa){logger['info'](util['format'](_0xa11f('0x15e'),_0x5551aa[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x5551aa[_0xa11f('0x15f')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x5551aa,_0xa11f('0x160'));}this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x161'),_0x5551aa[_0xa11f('0x15f')]));var _0x2e424a=eval(_0x5551aa[_0xa11f('0x15f')]);if(!this['isConfigured'](_0x5551aa[_0xa11f('0xdb')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xdc'));}var _0xf496c2=this[_0xa11f('0x15')]['sync'](this,_0x5551aa[_0xa11f('0xdb')]);if(!_0xf496c2){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x5551aa,_0xa11f('0xdd'));}if(_[_0xa11f('0x99')](_0x2e424a)){var _0x239594=this;_0x2e424a['forEach'](function(_0x1aeef9,_0x1b6c1f){_0x239594[_0xa11f('0x11')]['setVariable'](util[_0xa11f('0x2b')]('%s[%s]',_0xf496c2,_0x1b6c1f),_0x1aeef9);});return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x162'),_0xf496c2));}else{return this[_0xa11f('0x11')][_0xa11f('0x9e')](_0xf496c2,_0x2e424a);}};AGIVertices[_0xa11f('0x14')][_0xa11f('0xe')]=function(_0x5d0be4){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x163'),_0x5d0be4[_0xa11f('0xaa')]));if(_0x5d0be4['retry']===0x0){return this[_0xa11f('0xa6')](_0x5d0be4);}_0x5d0be4[_0xa11f('0xa7')]-=0x1;if(!this['isConfigured'](_0x5d0be4[_0xa11f('0x11a')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x5d0be4,_0xa11f('0x11b'));}var _0x3a4a3a=this[_0xa11f('0x22')]['sync'](this,_0x5d0be4[_0xa11f('0x11a')]);if(!_0x3a4a3a){return this['channel'][_0xa11f('0x2f')](_0x5d0be4,_0xa11f('0x11c'));}var _0x9a42f=this['channel']['getData'](_0x3a4a3a,_0x5d0be4[_0xa11f('0x11d')],_0x5d0be4['digit']);var _0x1d1eaa=_0x9a42f[_0xa11f('0xa4')];if(_0x9a42f[_0xa11f('0xa4')]===-0x1){this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x5d0be4,'-1');return _0x9a42f;}else if(_0x9a42f[_0xa11f('0xa1')]==='timeout'){_0x9a42f[_0xa11f('0xa4')]=_0x9a42f[_0xa11f('0xa4')]['length']>0x0?_0x9a42f[_0xa11f('0xa4')]:'t';}else if(_[_0xa11f('0x164')](_0x9a42f[_0xa11f('0xa4')])){_0x9a42f[_0xa11f('0xa4')]='#';_0x1d1eaa='#';}if(!this[_0xa11f('0x83')](_0x5d0be4['variable_id'])){this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xdc'));}else{var _0x2771f0=this['getVariable'][_0xa11f('0x6b')](this,_0x5d0be4[_0xa11f('0xdb')]);if(!_0x2771f0){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x5d0be4,_0xa11f('0xdd'));}this[_0xa11f('0x11')][_0xa11f('0x9e')](_0x2771f0,_0x1d1eaa);}this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x5d0be4,_0x1d1eaa);return _0x9a42f;};AGIVertices['prototype']['noop']=function(_0x28dfe2){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x165'),_0x28dfe2[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0xad')](_0x28dfe2[_0xa11f('0x166')]||_0x28dfe2['label']);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x167')]=function(_0x5cd857){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x168'),_0x5cd857['label']));if(!this[_0xa11f('0x83')](_0x5cd857[_0xa11f('0x156')])){return this['channel']['error'](_0x5cd857,_0xa11f('0x157'));}logger[_0xa11f('0x30')](util['format'](_0xa11f('0x158'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x5cd857['findBy']));var _0x2bb935=this[_0xa11f('0x4c')][_0xa11f('0x6b')](this,_0x5cd857[_0xa11f('0x169')]);var _0x246047=this[_0xa11f('0x4d')][_0xa11f('0x6b')](this,_0x5cd857['findBy'],_0x2bb935);if(_0x246047){logger[_0xa11f('0x30')](util['format'](_0xa11f('0x159'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x5cd857[_0xa11f('0x156')]));this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x5cd857[_0xa11f('0x156')]));return{'code':0xc8,'result':_0xa11f('0x16a')};}else{logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x5cd857['findBy']));this[_0xa11f('0x11')][_0xa11f('0xad')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa11f('0x11')]['callerid'],_0x5cd857[_0xa11f('0x156')]));return{'code':0xc8,'result':_0xa11f('0x15b')};}};AGIVertices[_0xa11f('0x14')]['playback']=function(_0x461e34){logger['info'](util['format'](_0xa11f('0x16b'),_0x461e34[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x461e34[_0xa11f('0x11a')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x461e34,_0xa11f('0x11b'));}var _0x334ddd=this[_0xa11f('0x22')][_0xa11f('0x6b')](this,_0x461e34[_0xa11f('0x11a')]);if(!_0x334ddd){return this[_0xa11f('0x11')]['error'](_0x461e34,_0xa11f('0x11c'));}var _0x214042=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0x16c'),[_0x334ddd,_0x461e34[_0xa11f('0x116')]]);if(_0x214042[_0xa11f('0xa4')]===-0x1){return _0x214042;}return this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x16d'),_0xa11f('0x16c'),_0x334ddd));};AGIVertices['prototype'][_0xa11f('0x16e')]=function(_0x4f4625){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x16f'),_0x4f4625['label']));if(!this[_0xa11f('0x83')](_0x4f4625['queue_id'])){return this[_0xa11f('0x11')]['error'](_0x4f4625,_0xa11f('0x170'));}var _0x35ff53='';var _0x40e65e=parseInt(_0x4f4625[_0xa11f('0x171')],0xa);if(isNaN(_0x40e65e)){_0x35ff53=_0x4f4625[_0xa11f('0x171')];}else{_0x35ff53=this[_0xa11f('0x19')][_0xa11f('0x6b')](this,_0x4f4625[_0xa11f('0x171')]);if(!_0x35ff53){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x4f4625,_0xa11f('0x172'));}}var _0x5842f5='';if(this['isConfigured'](_0x4f4625[_0xa11f('0x11a')])){var _0x2d2800=this['getSound'][_0xa11f('0x6b')](this,_0x4f4625[_0xa11f('0x11a')]);if(_0x2d2800){_0x5842f5=_0x2d2800;}}this['createSquareDetailsReport'][_0xa11f('0x6b')](this,_0x4f4625,_0x35ff53);if(_0x4f4625[_0xa11f('0x116')][_0xa11f('0x173')]('x')<0x0){_0x4f4625[_0xa11f('0x116')]+='x';}if(_0x4f4625[_0xa11f('0x116')]['indexOf']('X')<0x0){_0x4f4625[_0xa11f('0x116')]+='X';}this['channel']['setVariable'](_0xa11f('0x174'),_0x35ff53?_0x35ff53[_0xa11f('0x175')]():'');var _0x561eca=this[_0xa11f('0x11')]['exec'](_0xa11f('0x176'),[_0x35ff53,_0x4f4625[_0xa11f('0x116')],_0x4f4625['url'],_0x5842f5,_0x4f4625[_0xa11f('0x62')],_0x4f4625['agi'],_0x4f4625[_0xa11f('0x177')],_0x4f4625[_0xa11f('0x178')],'',_0x4f4625[_0xa11f('0x179')]]);if(_0x561eca[_0xa11f('0xa4')]===-0x1){return _0x561eca;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Executed\x20command\x20%s\x20%s',_0xa11f('0x176'),_0x35ff53));};AGIVertices['prototype']['record']=function(_0x56c4c9){logger['info'](util['format'](_0xa11f('0x17a'),_0x56c4c9[_0xa11f('0xaa')]));var _0x154860=_0x56c4c9[_0xa11f('0x17b')]||_0xa11f('0x134');var _0x12ab7f=util[_0xa11f('0x2b')](_0xa11f('0x17c'),this[_0xa11f('0x11')][_0xa11f('0x3a')],rs[_0xa11f('0x125')](0x5));var _0x4c9dd6=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x12ab7f,_0x154860);var _0x2413d0=util['format'](_0xa11f('0x135'),FILES_PATH,_0x12ab7f);this[_0xa11f('0x3e')]['sync'](this,_0x56c4c9,_0x12ab7f,_0x4c9dd6);this[_0xa11f('0x11')][_0xa11f('0x9e')]('RECORDING_SAVENAME',_0x12ab7f);logger[_0xa11f('0x30')](_0xa11f('0x17d'),_0x2413d0,_0x154860,_0x56c4c9['escape_digits'],_0x56c4c9[_0xa11f('0x62')]);return this[_0xa11f('0x11')][_0xa11f('0x138')](_0x2413d0,_0x154860,_0x56c4c9[_0xa11f('0x17e')],_0x56c4c9[_0xa11f('0x62')],undefined,!![]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x17f')]=function(_0x5d4725){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x180'),_0x5d4725[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x5d4725[_0xa11f('0x60')])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20url\x20configured');}var _0x1cc90f=this[_0xa11f('0x5f')][_0xa11f('0x6b')](this,_0x5d4725);logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x181'),util[_0xa11f('0x182')](_0x1cc90f,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x5d4725[_0xa11f('0xdb')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0x183'));}var _0xde0d9e=this[_0xa11f('0x15')][_0xa11f('0x6b')](this,_0x5d4725['variable_id']);if(!_0xde0d9e){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x5d4725,_0xa11f('0xdd'));}this[_0xa11f('0x11')][_0xa11f('0x9e')](util[_0xa11f('0x2b')](_0xa11f('0x184'),_0xde0d9e),_0x1cc90f[_0xa11f('0x71')]?_0x1cc90f['statusCode']:_0xa11f('0x185'));this['channel']['setVariable'](util[_0xa11f('0x2b')](_0xa11f('0x186'),_0xde0d9e),_0x1cc90f['statusMessage']?_0x1cc90f[_0xa11f('0x72')]:'OK');if(_0x1cc90f[_0xa11f('0x67')]){try{this['saveRestApiResult'](_0x1cc90f[_0xa11f('0x67')],_0xde0d9e);}catch(_0x460278){logger[_0xa11f('0x2f')](util[_0xa11f('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xde0d9e));}}return this[_0xa11f('0x11')][_0xa11f('0xad')](util['format'](_0xa11f('0xe2'),_0xde0d9e));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x187')]=function(_0x3d515e){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x188'),_0x3d515e[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0x189')](_0x3d515e[_0xa11f('0x18a')][_0xa11f('0xd9')](/\s+/g,''),_0x3d515e[_0xa11f('0x17e')]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x18b')]=function(_0x97e767){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x18c'),_0x97e767[_0xa11f('0xaa')]));return this['channel'][_0xa11f('0x18d')](_0x97e767['number'][_0xa11f('0xd9')](/\s+/g,''),_0x97e767[_0xa11f('0x17e')]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x18e')]=function(_0x1839d3){logger[_0xa11f('0x30')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x1839d3[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0x18f')](_0x1839d3['text'],_0x1839d3[_0xa11f('0x17e')]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x190')]=function(_0x58fe2d){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x58fe2d[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x58fe2d['account_id'])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x191'));}var _0x2c6bde=this[_0xa11f('0x192')][_0xa11f('0x6b')](this,_0x58fe2d['account_id']);if(!_0x2c6bde||!_0x2c6bde[_0xa11f('0x193')]){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x58fe2d,_0xa11f('0x194'));}var _0x3cf2e2={'from':util['format'](_0xa11f('0x195'),_0x2c6bde[_0xa11f('0x17')],_0x2c6bde[_0xa11f('0x196')]||_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x197')]),'to':_0x58fe2d['to']||'','cc':_0x58fe2d['cc']||'','bcc':_0x58fe2d[_0xa11f('0x198')]||'','subject':_0x58fe2d[_0xa11f('0x199')],'html':_0x58fe2d[_0xa11f('0x59')],'text':_0x58fe2d[_0xa11f('0x59')]};var _0x5352e6={'tls':{'rejectUnauthorized':![]}};if(_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x19a')]){_0x5352e6[_0xa11f('0x19a')]=_0x2c6bde[_0xa11f('0x193')]['service'];}else{_0x5352e6[_0xa11f('0x19b')]=_0x2c6bde['Smtp'][_0xa11f('0x19b')];_0x5352e6[_0xa11f('0x19c')]=_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x19c')];_0x5352e6['secure']=_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x19d')];}if(_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x19e')]){_0x5352e6['auth']={'user':_0x2c6bde[_0xa11f('0x193')][_0xa11f('0x197')],'pass':_0x2c6bde['Smtp'][_0xa11f('0x19f')]};}if(this['isConfigured'](_0x58fe2d[_0xa11f('0x1a0')])){}logger[_0xa11f('0xe4')]('sendMail\x20message',JSON[_0xa11f('0x6f')](_0x3cf2e2));this[_0xa11f('0x39')][_0xa11f('0x6b')](this,_0x58fe2d,_0x58fe2d[_0xa11f('0x1a1')]);this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x1a2'),_0x2c6bde['name']));this[_0xa11f('0x26')][_0xa11f('0x6b')](this,_0x5352e6,_0x3cf2e2);return this[_0xa11f('0x11')][_0xa11f('0xad')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x24d4de){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1a3'),_0x24d4de[_0xa11f('0xaa')]));return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x1a4'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1a5')]=function(_0x2ce29){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1a6'),_0x2ce29[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x2ce29['sms_account_id'])){return this[_0xa11f('0x11')][_0xa11f('0xad')]('no\x20sms\x20account\x20configured');}var _0xbe010b=this[_0xa11f('0x36')][_0xa11f('0x6b')](this,_0x2ce29[_0xa11f('0x1a7')]);if(!_0xbe010b){return this['channel'][_0xa11f('0x2f')](_0x2ce29,_0xa11f('0x1a8'));}var _0x17294a={'body':_0x2ce29[_0xa11f('0x1a9')],'phone':_0x2ce29['to']||'','SmsAccountId':_0xbe010b['id']};logger[_0xa11f('0xe4')](_0xa11f('0x1aa'),JSON[_0xa11f('0x6f')](_0x17294a));this[_0xa11f('0x39')]['sync'](this,_0x2ce29,_0x2ce29[_0xa11f('0x1a7')]);this['channel'][_0xa11f('0xad')](util['format'](_0xa11f('0x1ab'),_0xbe010b[_0xa11f('0x17')]));this[_0xa11f('0x38')][_0xa11f('0x6b')](this,_0x17294a);return this[_0xa11f('0x11')]['noop'](_0xa11f('0x1ac'));};AGIVertices[_0xa11f('0x14')]['set']=function(_0x21f916){logger['info'](util['format'](_0xa11f('0x1ad'),_0x21f916[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x21f916[_0xa11f('0xdb')])){return this['channel'][_0xa11f('0x2f')](_0x21f916,_0xa11f('0x1ae'));}var _0x1edf65=this[_0xa11f('0x15')][_0xa11f('0x6b')](this,_0x21f916[_0xa11f('0xdb')]);if(!_0x1edf65){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x21f916,_0xa11f('0xdd'));}return this[_0xa11f('0x11')][_0xa11f('0x9e')](_0x1edf65,_0x21f916[_0xa11f('0x1af')]);};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1b0')]=function(_0x4dd731){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1b1'),_0x4dd731[_0xa11f('0xaa')]));this['channel'][_0xa11f('0xad')](_0xa11f('0x1b2'));if(_0x4dd731[_0xa11f('0xba')]==='yes'){this['channel']['noop']('Answer');return this[_0xa11f('0x11')][_0xa11f('0xba')]();}return this[_0xa11f('0x11')][_0xa11f('0xad')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xa11f('0x1b3')]=function(_0x3784be){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1b4'),_0x3784be[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x3784be['project_id'])){return this[_0xa11f('0x11')]['error'](_0x3784be,_0xa11f('0x1b5'));}var _0x10c808=this['getSquareProject'][_0xa11f('0x6b')](this,_0x3784be[_0xa11f('0x1b6')]);if(!this[_0xa11f('0x83')](_0x10c808)){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3784be,util[_0xa11f('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3784be[_0xa11f('0x1b6')]));}if(_0x10c808===this[_0xa11f('0x11')][_0xa11f('0x3c')]){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3784be,_0xa11f('0x1b7'));}this[_0xa11f('0x39')]['sync'](this,_0x3784be,_0x10c808);var _0x1f84d7=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0x1b8'),util[_0xa11f('0x2b')](_0xa11f('0x1b9'),config[_0xa11f('0xa')][_0xa11f('0x19b')]||'127.0.0.1',_0x10c808,this[_0xa11f('0x11')][_0xa11f('0x3c')]));if(_0x1f84d7[_0xa11f('0xa4')]===-0x1){return _0x1f84d7;}return this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x16d'),_0xa11f('0x1b8'),_0x10c808));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1ba')]=function(_0x142b44){logger[_0xa11f('0x30')](util['format'](_0xa11f('0x1bb'),_0x142b44['label']));var _0x2cc3b2=this[_0xa11f('0x54')][_0xa11f('0x6b')](this,_0x142b44[_0xa11f('0xb8')]);this[_0xa11f('0x39')]['sync'](this,_0x142b44,_0x142b44[_0xa11f('0xb8')]);if(this['isConfigured'](_0x142b44[_0xa11f('0xdb')])){var _0x5f12b2=this[_0xa11f('0x15')][_0xa11f('0x6b')](this,_0x142b44[_0xa11f('0xdb')]);if(_0x5f12b2){this[_0xa11f('0x11')][_0xa11f('0x9e')](_0x5f12b2,_0x2cc3b2);return this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x1bc'),_0x142b44['command'],_0x5f12b2));}}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x1bd'),_0x142b44[_0xa11f('0xb8')]));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1be')]=function(_0x3c504f){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3c504f[_0xa11f('0xaa')]));_0x3c504f[_0xa11f('0x59')]=_0x3c504f[_0xa11f('0x59')][_0xa11f('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa11f('0x83')](_0x3c504f[_0xa11f('0x58')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0x1bf'));}if(!this['isConfigured'](_0x3c504f[_0xa11f('0x59')])){return this[_0xa11f('0x11')][_0xa11f('0xad')](_0xa11f('0xab'));}this[_0xa11f('0x11')][_0xa11f('0xad')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3c504f[_0xa11f('0x59')]));var _0x29d2f4=this[_0xa11f('0x57')][_0xa11f('0x6b')](this,_0x3c504f);if(_0x29d2f4){this['channel'][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x29d2f4));var _0x4cfbeb=this['channel'][_0xa11f('0x10b')](_0x29d2f4);try{fs[_0xa11f('0x10c')](_0x29d2f4+_0xa11f('0x10d'));}catch(_0x5bd799){logger['error'](_0x5bd799);}return _0x4cfbeb;}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x3c504f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa11f('0x14')]['tts']=function(_0x16517f){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1c0'),_0x16517f[_0xa11f('0xaa')]));_0x16517f['text']=_0x16517f[_0xa11f('0x59')][_0xa11f('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x16517f[_0xa11f('0x59')])){return this[_0xa11f('0x11')]['noop'](_0xa11f('0xab'));}this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')](_0xa11f('0x1c1'),_0x16517f[_0xa11f('0x59')]));var _0x1518ba=this[_0xa11f('0x5d')][_0xa11f('0x6b')](this,_0x16517f);if(_0x1518ba){this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x1518ba));var _0x170840=this[_0xa11f('0x11')]['streamFile'](_0x1518ba);try{fs[_0xa11f('0x10c')](_0x1518ba+_0xa11f('0x10d'));}catch(_0x2b3b25){logger[_0xa11f('0x2f')](_0x2b3b25);}return _0x170840;}return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x16517f,_0xa11f('0x1c2'));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1c3')]=function(_0x3eb587){logger['info'](util['format'](_0xa11f('0x1c4'),_0x3eb587[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x3eb587[_0xa11f('0x156')])){return this['channel'][_0xa11f('0x2f')](_0x3eb587,_0xa11f('0x157'));}logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x158'),this[_0xa11f('0x11')]['callerid'],_0x3eb587['findBy']));var _0x4e1e1c=this[_0xa11f('0x4f')][_0xa11f('0x6b')](this,_0x3eb587[_0xa11f('0x156')]);if(_0x4e1e1c){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x159'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x3eb587[_0xa11f('0x156')]));this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x159'),this[_0xa11f('0x11')]['callerid'],_0x3eb587[_0xa11f('0x156')]));return{'code':0xc8,'result':_0xa11f('0x16a')};}else{logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')]['callerid'],_0x3eb587[_0xa11f('0x156')]));this[_0xa11f('0x11')]['noop'](util[_0xa11f('0x2b')](_0xa11f('0x15a'),this[_0xa11f('0x11')][_0xa11f('0x3d')],_0x3eb587[_0xa11f('0x156')]));return{'code':0xc8,'result':_0xa11f('0x15b')};}};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1c5')]=function(_0x4e2bd4){logger['info'](util[_0xa11f('0x2b')](_0xa11f('0x1c6'),_0x4e2bd4[_0xa11f('0xaa')]));var _0x9a19fa=this[_0xa11f('0x11')][_0xa11f('0x55')](_0xa11f('0x1c7'),[_0x4e2bd4[_0xa11f('0x1c8')],_0x4e2bd4[_0xa11f('0x74')]]);if(_0x9a19fa['result']===-0x1){return _0x9a19fa;}return this[_0xa11f('0x11')][_0xa11f('0xad')](util[_0xa11f('0x2b')]('Executed\x20command\x20%s\x20%s',_0xa11f('0x1c7'),_0x4e2bd4[_0xa11f('0x1c8')]));};AGIVertices[_0xa11f('0x14')][_0xa11f('0x1c9')]=function(_0x173289){logger[_0xa11f('0x30')](util[_0xa11f('0x2b')](_0xa11f('0x1ca'),_0x173289[_0xa11f('0xaa')]));if(!this[_0xa11f('0x83')](_0x173289[_0xa11f('0xdb')])){return this[_0xa11f('0x11')][_0xa11f('0x2f')](_0x173289,_0xa11f('0x1ae'));}var _0x439f15=this[_0xa11f('0x15')][_0xa11f('0x6b')](this,_0x173289[_0xa11f('0xdb')]);if(!_0x439f15){return this[_0xa11f('0x11')]['error'](_0x173289,'no\x20variable\x20found');}var _0x16b21e=this[_0xa11f('0x11')]['getVariable'](_0x439f15);return{'code':0xc8,'result':_0x16b21e['extra']?_0x16b21e['extra']:'-'};};String[_0xa11f('0x14')][_0xa11f('0xa0')]=function(_0xeeb6bb,_0x82fee1){return this[_0xa11f('0x9f')](_0xeeb6bb)['join'](_0x82fee1);};module[_0xa11f('0x1cb')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 32667c3..daad444 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 _0x3109=['syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','attendedtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','error','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3109,0x1dc));var _0x9310=function(_0x4ca204,_0x39a3c3){_0x4ca204=_0x4ca204-0x0;var _0xd9343d=_0x3109[_0x4ca204];return _0xd9343d;};'use strict';var util=require(_0x9310('0x0'));var _=require('lodash');var moment=require(_0x9310('0x1'));var ami=require(_0x9310('0x2'));var logger=require('../../../config/logger')(_0x9310('0x3'));var RpcUser=require(_0x9310('0x4'));var RpcVoiceAgentReport=require(_0x9310('0x5'));function Acw(_0x5da99f){this[_0x9310('0x6')]=_0x5da99f[_0x9310('0x6')];this[_0x9310('0x7')]=_0x5da99f[_0x9310('0x7')];this[_0x9310('0x8')]=_0x5da99f[_0x9310('0x8')];this[_0x9310('0x9')]={};ami['on']('agentconnect',this[_0x9310('0xa')][_0x9310('0xb')](this));ami['on'](_0x9310('0xc'),this['syncHangupRequest']['bind'](this));ami['on'](_0x9310('0xd'),this['syncHangup']['bind'](this));ami['on'](_0x9310('0xe'),this['syncAgentRingNoAnswer'][_0x9310('0xb')](this));ami['on'](_0x9310('0xf'),this['syncAttendedTransfer'][_0x9310('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x9310('0x10'),this[_0x9310('0x11')][_0x9310('0xb')](this));}function getDiff(_0x4960ac){var _0x4e352a=moment()['milliseconds'](0x0);var _0x31d223=moment(_0x4960ac)[_0x9310('0x12')](0x0);return _0x4e352a[_0x9310('0x13')](_0x31d223,_0x9310('0x14'));}Acw[_0x9310('0x15')][_0x9310('0x16')]=function(_0x6bff16){try{var _0x447254=this;var _0x4cc44a=this[_0x9310('0x9')][_0x6bff16][_0x9310('0x17')];var _0x23861f=this['channels'][_0x6bff16][_0x9310('0x18')];var _0x58116a=this['voiceQueues'][_0x23861f];var _0x52270a=![];var _0x3481e6='ACW';if(_0x58116a[_0x9310('0x19')]){if(_0x58116a['mandatoryDispositionPause'][_0x9310('0x1a')]){_0x52270a=!![];_0x3481e6=_0x58116a[_0x9310('0x1b')][_0x9310('0x1a')];}}ami[_0x9310('0x1c')]({'action':'QueuePause','interface':_0x4cc44a,'paused':!![],'reason':_0x3481e6})[_0x9310('0x1d')](function(_0x5257a0){if(_0x447254[_0x9310('0x7')][_0x4cc44a]){return RpcUser[_0x9310('0x1e')](_0x447254[_0x9310('0x7')][_0x4cc44a]['id'])[_0x9310('0x1d')](function(_0x12b68e){if(_0x12b68e&&!_0x12b68e[_0x9310('0x1f')]){logger[_0x9310('0x20')](_0x9310('0x21'),_0x6bff16,_0x4cc44a,_0x23861f);var _0x328921=_0x447254[_0x9310('0x9')][_0x6bff16]['attended']&&_0x447254[_0x9310('0x9')][_0x6bff16][_0x9310('0x22')]?_0x447254[_0x9310('0x9')][_0x6bff16][_0x9310('0x22')]:_0x6bff16;return RpcUser[_0x9310('0x23')](_0x447254[_0x9310('0x7')][_0x4cc44a],_0x3481e6,_0x328921)['then'](function(_0x5169df){if(!_0x52270a){_0x447254[_0x9310('0x8')][_0x4cc44a]={};logger[_0x9310('0x20')](_0x9310('0x24'),_0x6bff16,_0x447254[_0x9310('0x6')][_0x23861f][_0x9310('0x25')],_0x4cc44a,_0x23861f);_0x447254['timers'][_0x4cc44a][_0x9310('0x26')]=setTimeout(_0x447254[_0x9310('0x27')]['bind'](_0x447254,_0x4cc44a),_0x447254[_0x9310('0x6')][_0x23861f]['acwTimeout']*0x3e8);_0x447254['timers'][_0x4cc44a][_0x9310('0x28')]=moment()[_0x9310('0x29')](_0x9310('0x2a'));_0x447254[_0x9310('0x8')][_0x4cc44a][_0x9310('0x2b')]=_0x6bff16;_0x447254['timers'][_0x4cc44a][_0x9310('0x18')]=_0x23861f;_0x447254[_0x9310('0x8')][_0x4cc44a]['updateAcw']=function(){var _0x273142=getDiff(_0x447254[_0x9310('0x8')][_0x4cc44a]['lastPauseAt']);clearTimeout(_0x447254[_0x9310('0x8')][_0x4cc44a][_0x9310('0x26')]);_0x447254[_0x9310('0x8')][_0x4cc44a]['timer']=![];RpcVoiceAgentReport[_0x9310('0x2c')]({'acwtime':_0x273142},_0x447254[_0x9310('0x8')][_0x4cc44a][_0x9310('0x2b')],_0x4cc44a)['then'](function(_0x94cecc){logger[_0x9310('0x20')](_0x9310('0x2d'),_0x6bff16,_0x273142,_0x94cecc);})['catch'](function(_0x540be4){logger[_0x9310('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x6bff16,_0x540be4);});delete _0x447254[_0x9310('0x8')][_0x4cc44a];};}});}else{logger[_0x9310('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x6bff16,_0x4cc44a,_0x23861f);}});}})[_0x9310('0x2f')](function(_0x1c86c2){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6bff16,_0x447254[_0x9310('0x6')][_0x23861f][_0x9310('0x25')],_0x4cc44a,_0x23861f);})[_0x9310('0x30')](function(){delete _0x447254['channels'][_0x6bff16];});}catch(_0x162bc0){logger[_0x9310('0x2e')](_0x9310('0x31'),_0x162bc0[_0x9310('0x32')]);}};Acw[_0x9310('0x15')][_0x9310('0x27')]=function(_0x3daaa7){try{var _0x5424bd=this;if(_0x5424bd[_0x9310('0x8')][_0x3daaa7]){_0x5424bd['timers'][_0x3daaa7][_0x9310('0x26')]=![];var _0x3ea520=_0x5424bd[_0x9310('0x8')][_0x3daaa7]['uniqueid'];var _0x21793e=_0x5424bd['timers'][_0x3daaa7][_0x9310('0x18')];var _0x31f08e=_0x5424bd[_0x9310('0x6')][_0x21793e][_0x9310('0x25')];logger[_0x9310('0x20')](_0x9310('0x33'),_0x3ea520,_0x3daaa7);RpcUser['saveUnpause'](this[_0x9310('0x7')][_0x3daaa7]);RpcVoiceAgentReport[_0x9310('0x2c')]({'acwtime':_0x31f08e,'agentacw':!![]},_0x3ea520,_0x3daaa7)[_0x9310('0x1d')](function(_0x2d7027){logger[_0x9310('0x20')](_0x9310('0x2d'),_0x3ea520,_0x31f08e,_0x2d7027);})[_0x9310('0x2f')](function(_0x4430c8){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3ea520,_0x4430c8);});}else{logger[_0x9310('0x2e')](_0x9310('0x34'),_0x3daaa7);if(_0x5424bd['timers']){logger['info']('[ACW][TIMERS]',JSON[_0x9310('0x35')](_0x5424bd[_0x9310('0x8')]));}}}catch(_0x44aa91){logger[_0x9310('0x2e')](_0x9310('0x36'),_0x44aa91[_0x9310('0x32')]);}};Acw[_0x9310('0x15')]['syncAgentConnect']=function(_0x58447e){try{if(this['voiceQueues'][_0x58447e[_0x9310('0x18')]]&&(this[_0x9310('0x6')][_0x58447e[_0x9310('0x18')]][_0x9310('0x3')]||this[_0x9310('0x6')][_0x58447e[_0x9310('0x18')]]['mandatoryDisposition'])){if(this['agents'][_0x58447e[_0x9310('0x17')]]){this[_0x9310('0x9')][_0x58447e['uniqueid']]={'queue':_0x58447e[_0x9310('0x18')],'interface':_0x58447e[_0x9310('0x17')],'destlinkedid':_0x58447e['destlinkedid']};}}}catch(_0x1d4f1e){logger['error'](_0x9310('0x37'),_0x1d4f1e[_0x9310('0x32')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x1f8c67){try{if(this[_0x9310('0x6')][_0x1f8c67[_0x9310('0x18')]]&&(this[_0x9310('0x6')][_0x1f8c67['queue']]['acw']||this[_0x9310('0x6')][_0x1f8c67['queue']]['mandatoryDisposition'])){if(this[_0x9310('0x7')][_0x1f8c67[_0x9310('0x17')]]){this['channels'][_0x1f8c67[_0x9310('0x2b')]]={'queue':_0x1f8c67[_0x9310('0x18')],'interface':_0x1f8c67[_0x9310('0x17')]};}}}catch(_0x57da8f){logger[_0x9310('0x2e')](_0x9310('0x38'),_0x57da8f['message']);}};Acw[_0x9310('0x15')][_0x9310('0x39')]=function(_0x42a455){try{if(this['channels'][_0x42a455[_0x9310('0x2b')]]&&_[_0x9310('0x3a')](this[_0x9310('0x9')][_0x42a455['uniqueid']][_0x9310('0x3b')])){logger[_0x9310('0x20')](_0x9310('0x3c'),_0x42a455[_0x9310('0x2b')]);this['startAcw'](_0x42a455[_0x9310('0x2b')]);}else if(this[_0x9310('0x9')][_0x42a455[_0x9310('0x3d')]]&&_[_0x9310('0x3a')](this[_0x9310('0x9')][_0x42a455[_0x9310('0x3d')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x42a455['linkedid']);this[_0x9310('0x16')](_0x42a455[_0x9310('0x3d')]);}}catch(_0x3428c9){logger[_0x9310('0x2e')](_0x9310('0x3e'),_0x3428c9[_0x9310('0x32')]);}};Acw[_0x9310('0x15')][_0x9310('0x3f')]=function(_0x110a82){try{if(this['channels'][_0x110a82[_0x9310('0x2b')]]&&this['channels'][_0x110a82[_0x9310('0x2b')]][_0x9310('0x3b')]){logger[_0x9310('0x20')](_0x9310('0x40'),_0x110a82[_0x9310('0x2b')]);this[_0x9310('0x16')](_0x110a82['uniqueid']);}else if(this[_0x9310('0x9')][_0x110a82[_0x9310('0x3d')]]&&this['channels'][_0x110a82[_0x9310('0x3d')]]['attended']){logger[_0x9310('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x110a82['linkedid']);this['startAcw'](_0x110a82['linkedid']);}}catch(_0x3c54cc){logger[_0x9310('0x2e')]('[ACW][syncHangup]\x20%s',_0x3c54cc[_0x9310('0x32')]);}};Acw[_0x9310('0x15')][_0x9310('0x41')]=function(_0xa7c918){try{if(!_['isNil'](this[_0x9310('0x9')][_0xa7c918[_0x9310('0x42')]])){this['startAcw'](_0xa7c918['transfereeuniqueid']);if(this[_0x9310('0x9')][_0xa7c918['secondtransfereruniqueid']]){this['channels'][_0xa7c918[_0x9310('0x43')]][_0x9310('0x3b')]=!![];this[_0x9310('0x9')][_0xa7c918[_0x9310('0x44')]]=this[_0x9310('0x9')][_0xa7c918['secondtransfereruniqueid']];delete this[_0x9310('0x9')][_0xa7c918['secondtransfereruniqueid']];}}else if(!_[_0x9310('0x45')](this['channels'][_0xa7c918[_0x9310('0x44')]])){this[_0x9310('0x16')](_0xa7c918[_0x9310('0x44')]);if(this[_0x9310('0x9')][_0xa7c918[_0x9310('0x46')]]){this[_0x9310('0x9')][_0xa7c918[_0x9310('0x46')]][_0x9310('0x3b')]=!![];this[_0x9310('0x9')][_0xa7c918['transfereeuniqueid']]=this[_0x9310('0x9')][_0xa7c918[_0x9310('0x46')]];delete this[_0x9310('0x9')][_0xa7c918['origtransfereruniqueid']];}}}catch(_0x4ca8b8){logger[_0x9310('0x2e')](_0x9310('0x47'),_0x4ca8b8[_0x9310('0x32')]);}};Acw['prototype'][_0x9310('0x48')]=function(_0x21ce48){try{if(this['channels'][_0x21ce48['transfereruniqueid']]){logger[_0x9310('0x20')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x9310('0x35')](_0x21ce48[_0x9310('0x49')]));this['startAcw'](_0x21ce48[_0x9310('0x49')]);}else if(this['channels'][_0x21ce48[_0x9310('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x9310('0x35')](_0x21ce48[_0x9310('0x4a')]));this[_0x9310('0x16')](_0x21ce48[_0x9310('0x4a')]);}}catch(_0xd1da0a){logger['error'](_0x9310('0x4b'),_0xd1da0a[_0x9310('0x32')]);}};Acw[_0x9310('0x15')]['syncAgentRingNoAnswer']=function(_0xee6579){try{if(this[_0x9310('0x6')][_0xee6579['queue']]&&this[_0x9310('0x6')][_0xee6579['queue']]['autopause']===_0x9310('0x4c')){if(this[_0x9310('0x7')][_0xee6579[_0x9310('0x17')]]){logger['info'](_0x9310('0x4d'),_0xee6579[_0x9310('0x2b')],_0xee6579[_0x9310('0x17')],_0xee6579[_0x9310('0x18')]);return RpcUser[_0x9310('0x23')](this['agents'][_0xee6579[_0x9310('0x17')]],_0x9310('0x4e'),_0xee6579[_0x9310('0x2b')]);}}}catch(_0x49bd45){logger[_0x9310('0x2e')](_0x9310('0x4f'),_0x49bd45[_0x9310('0x32')]);}};module[_0x9310('0x50')]=Acw; \ No newline at end of file +var _0x7bef=['syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','name','QueuePause','agents','getAgent','info','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','timer','update','catch','error','[%s][UPDATE][ERRORS:%s]','acwTimeout','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x7bef,0x198));var _0xf7be=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x7bef[_0x3f3bad];return _0x4f0801;};'use strict';var util=require(_0xf7be('0x0'));var _=require('lodash');var moment=require(_0xf7be('0x1'));var ami=require(_0xf7be('0x2'));var logger=require(_0xf7be('0x3'))('acw');var RpcUser=require(_0xf7be('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0xf908d2){this['voiceQueues']=_0xf908d2[_0xf7be('0x5')];this['agents']=_0xf908d2['agents'];this[_0xf7be('0x6')]=_0xf908d2[_0xf7be('0x6')];this[_0xf7be('0x7')]={};ami['on'](_0xf7be('0x8'),this[_0xf7be('0x9')][_0xf7be('0xa')](this));ami['on'](_0xf7be('0xb'),this[_0xf7be('0xc')][_0xf7be('0xa')](this));ami['on'](_0xf7be('0xd'),this[_0xf7be('0xe')][_0xf7be('0xa')](this));ami['on'](_0xf7be('0xf'),this[_0xf7be('0x10')][_0xf7be('0xa')](this));ami['on'](_0xf7be('0x11'),this[_0xf7be('0x12')][_0xf7be('0xa')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xf7be('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0xf7be('0x13')][_0xf7be('0xa')](this));}function getDiff(_0x2801ab){var _0x4e5eae=moment()[_0xf7be('0x14')](0x0);var _0x40c1c1=moment(_0x2801ab)['milliseconds'](0x0);return _0x4e5eae[_0xf7be('0x15')](_0x40c1c1,_0xf7be('0x16'));}Acw[_0xf7be('0x17')]['startAcw']=function(_0x3b5bad){try{var _0x10fa27=this;var _0x1d4391=this[_0xf7be('0x7')][_0x3b5bad][_0xf7be('0x18')];var _0x1f881e=this[_0xf7be('0x7')][_0x3b5bad]['queue'];var _0xb4b1a0=this['voiceQueues'][_0x1f881e];var _0x41fae4=![];var _0x439749=_0xf7be('0x19');if(_0xb4b1a0['mandatoryDisposition']){if(_0xb4b1a0['mandatoryDispositionPause'][_0xf7be('0x1a')]){_0x41fae4=!![];_0x439749=_0xb4b1a0['mandatoryDispositionPause'][_0xf7be('0x1a')];}}ami['Action']({'action':_0xf7be('0x1b'),'interface':_0x1d4391,'paused':!![],'reason':_0x439749})['then'](function(_0x5ee166){if(_0x10fa27[_0xf7be('0x1c')][_0x1d4391]){return RpcUser[_0xf7be('0x1d')](_0x10fa27[_0xf7be('0x1c')][_0x1d4391]['id'])['then'](function(_0xfa8c32){if(_0xfa8c32&&!_0xfa8c32['voicePause']){logger[_0xf7be('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3b5bad,_0x1d4391,_0x1f881e);var _0x3c93a4=_0x10fa27[_0xf7be('0x7')][_0x3b5bad][_0xf7be('0x1f')]&&_0x10fa27[_0xf7be('0x7')][_0x3b5bad][_0xf7be('0x20')]?_0x10fa27['channels'][_0x3b5bad][_0xf7be('0x20')]:_0x3b5bad;return RpcUser[_0xf7be('0x21')](_0x10fa27[_0xf7be('0x1c')][_0x1d4391],_0x439749,_0x3c93a4)[_0xf7be('0x22')](function(_0x496f17){if(!_0x41fae4){_0x10fa27[_0xf7be('0x6')][_0x1d4391]={};logger[_0xf7be('0x1e')](_0xf7be('0x23'),_0x3b5bad,_0x10fa27['voiceQueues'][_0x1f881e]['acwTimeout'],_0x1d4391,_0x1f881e);_0x10fa27[_0xf7be('0x6')][_0x1d4391]['timer']=setTimeout(_0x10fa27[_0xf7be('0x24')][_0xf7be('0xa')](_0x10fa27,_0x1d4391),_0x10fa27[_0xf7be('0x5')][_0x1f881e]['acwTimeout']*0x3e8);_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x25')]=moment()['format'](_0xf7be('0x26'));_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x27')]=_0x3b5bad;_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x28')]=_0x1f881e;_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x29')]=function(){var _0x12928b=getDiff(_0x10fa27[_0xf7be('0x6')][_0x1d4391]['lastPauseAt']);clearTimeout(_0x10fa27['timers'][_0x1d4391][_0xf7be('0x2a')]);_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x2a')]=![];RpcVoiceAgentReport[_0xf7be('0x2b')]({'acwtime':_0x12928b},_0x10fa27[_0xf7be('0x6')][_0x1d4391][_0xf7be('0x27')],_0x1d4391)[_0xf7be('0x22')](function(_0x498c34){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x3b5bad,_0x12928b,_0x498c34);})[_0xf7be('0x2c')](function(_0x2eb93b){logger[_0xf7be('0x2d')](_0xf7be('0x2e'),_0x3b5bad,_0x2eb93b);});delete _0x10fa27[_0xf7be('0x6')][_0x1d4391];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x3b5bad,_0x1d4391,_0x1f881e);}});}})[_0xf7be('0x2c')](function(_0x2f65de){logger[_0xf7be('0x2d')](_0xf7be('0x23'),_0x3b5bad,_0x10fa27[_0xf7be('0x5')][_0x1f881e][_0xf7be('0x2f')],_0x1d4391,_0x1f881e);})[_0xf7be('0x30')](function(){delete _0x10fa27[_0xf7be('0x7')][_0x3b5bad];});}catch(_0x26676d){logger['error'](_0xf7be('0x31'),_0x26676d[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')][_0xf7be('0x24')]=function(_0x270a67){try{var _0x1058ff=this;if(_0x1058ff[_0xf7be('0x6')][_0x270a67]){_0x1058ff[_0xf7be('0x6')][_0x270a67][_0xf7be('0x2a')]=![];var _0x485f38=_0x1058ff[_0xf7be('0x6')][_0x270a67]['uniqueid'];var _0x1e353d=_0x1058ff[_0xf7be('0x6')][_0x270a67][_0xf7be('0x28')];var _0x2f5e7d=_0x1058ff[_0xf7be('0x5')][_0x1e353d]['acwTimeout'];logger['info'](_0xf7be('0x33'),_0x485f38,_0x270a67);RpcUser['saveUnpause'](this[_0xf7be('0x1c')][_0x270a67]);RpcVoiceAgentReport[_0xf7be('0x2b')]({'acwtime':_0x2f5e7d,'agentacw':!![]},_0x485f38,_0x270a67)['then'](function(_0x35fab1){logger[_0xf7be('0x1e')](_0xf7be('0x34'),_0x485f38,_0x2f5e7d,_0x35fab1);})[_0xf7be('0x2c')](function(_0x4b7395){logger[_0xf7be('0x2d')](_0xf7be('0x2e'),_0x485f38,_0x4b7395);});}else{logger[_0xf7be('0x2d')](_0xf7be('0x35'),_0x270a67);if(_0x1058ff[_0xf7be('0x6')]){logger['info'](_0xf7be('0x36'),JSON[_0xf7be('0x37')](_0x1058ff[_0xf7be('0x6')]));}}}catch(_0x2a87fa){logger[_0xf7be('0x2d')]('[ACW][STOP]\x20%s',_0x2a87fa['message']);}};Acw[_0xf7be('0x17')][_0xf7be('0x9')]=function(_0x534292){try{if(this['voiceQueues'][_0x534292[_0xf7be('0x28')]]&&(this[_0xf7be('0x5')][_0x534292[_0xf7be('0x28')]][_0xf7be('0x38')]||this[_0xf7be('0x5')][_0x534292['queue']]['mandatoryDisposition'])){if(this[_0xf7be('0x1c')][_0x534292['interface']]){this[_0xf7be('0x7')][_0x534292[_0xf7be('0x27')]]={'queue':_0x534292[_0xf7be('0x28')],'interface':_0x534292[_0xf7be('0x18')],'destlinkedid':_0x534292[_0xf7be('0x20')]};}}}catch(_0x314798){logger[_0xf7be('0x2d')](_0xf7be('0x39'),_0x314798[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')][_0xf7be('0x13')]=function(_0x138d7e){try{if(this[_0xf7be('0x5')][_0x138d7e['queue']]&&(this[_0xf7be('0x5')][_0x138d7e[_0xf7be('0x28')]][_0xf7be('0x38')]||this['voiceQueues'][_0x138d7e[_0xf7be('0x28')]][_0xf7be('0x3a')])){if(this[_0xf7be('0x1c')][_0x138d7e[_0xf7be('0x18')]]){this[_0xf7be('0x7')][_0x138d7e[_0xf7be('0x27')]]={'queue':_0x138d7e['queue'],'interface':_0x138d7e['interface']};}}}catch(_0x87ef0){logger['error'](_0xf7be('0x3b'),_0x87ef0[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')][_0xf7be('0xc')]=function(_0x492fa1){try{if(this['channels'][_0x492fa1['uniqueid']]&&_[_0xf7be('0x3c')](this[_0xf7be('0x7')][_0x492fa1[_0xf7be('0x27')]][_0xf7be('0x1f')])){logger[_0xf7be('0x1e')](_0xf7be('0x3d'),_0x492fa1[_0xf7be('0x27')]);this[_0xf7be('0x3e')](_0x492fa1[_0xf7be('0x27')]);}else if(this['channels'][_0x492fa1[_0xf7be('0x3f')]]&&_[_0xf7be('0x3c')](this['channels'][_0x492fa1[_0xf7be('0x3f')]]['attended'])){logger[_0xf7be('0x1e')](_0xf7be('0x40'),_0x492fa1[_0xf7be('0x3f')]);this[_0xf7be('0x3e')](_0x492fa1['linkedid']);}}catch(_0x1c3033){logger['error'](_0xf7be('0x41'),_0x1c3033[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')]['syncHangup']=function(_0x36726b){try{if(this['channels'][_0x36726b[_0xf7be('0x27')]]&&this['channels'][_0x36726b['uniqueid']][_0xf7be('0x1f')]){logger[_0xf7be('0x1e')](_0xf7be('0x42'),_0x36726b[_0xf7be('0x27')]);this[_0xf7be('0x3e')](_0x36726b['uniqueid']);}else if(this['channels'][_0x36726b[_0xf7be('0x3f')]]&&this[_0xf7be('0x7')][_0x36726b[_0xf7be('0x3f')]][_0xf7be('0x1f')]){logger[_0xf7be('0x1e')](_0xf7be('0x43'),_0x36726b['linkedid']);this[_0xf7be('0x3e')](_0x36726b[_0xf7be('0x3f')]);}}catch(_0x57297d){logger['error'](_0xf7be('0x44'),_0x57297d[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')][_0xf7be('0x12')]=function(_0x28f132){try{if(!_[_0xf7be('0x45')](this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x46')]])){this['startAcw'](_0x28f132[_0xf7be('0x46')]);if(this['channels'][_0x28f132['secondtransfereruniqueid']]){this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x47')]][_0xf7be('0x1f')]=!![];this[_0xf7be('0x7')][_0x28f132['transfertargetuniqueid']]=this['channels'][_0x28f132[_0xf7be('0x47')]];delete this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x47')]];}}else if(!_[_0xf7be('0x45')](this[_0xf7be('0x7')][_0x28f132['transfertargetuniqueid']])){this[_0xf7be('0x3e')](_0x28f132[_0xf7be('0x48')]);if(this['channels'][_0x28f132['origtransfereruniqueid']]){this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x49')]][_0xf7be('0x1f')]=!![];this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x46')]]=this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x49')]];delete this[_0xf7be('0x7')][_0x28f132[_0xf7be('0x49')]];}}}catch(_0x74e5bc){logger['error'](_0xf7be('0x4a'),_0x74e5bc[_0xf7be('0x32')]);}};Acw['prototype'][_0xf7be('0x4b')]=function(_0x137a88){try{if(this[_0xf7be('0x7')][_0x137a88['transfereruniqueid']]){logger[_0xf7be('0x1e')](_0xf7be('0x4c'),JSON['stringify'](_0x137a88[_0xf7be('0x4d')]));this[_0xf7be('0x3e')](_0x137a88['transfereruniqueid']);}else if(this[_0xf7be('0x7')][_0x137a88[_0xf7be('0x4e')]]){logger[_0xf7be('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x137a88[_0xf7be('0x4e')]));this[_0xf7be('0x3e')](_0x137a88[_0xf7be('0x4e')]);}}catch(_0x42d30c){logger[_0xf7be('0x2d')](_0xf7be('0x4f'),_0x42d30c[_0xf7be('0x32')]);}};Acw[_0xf7be('0x17')]['syncAgentRingNoAnswer']=function(_0x149cd0){try{if(this['voiceQueues'][_0x149cd0[_0xf7be('0x28')]]&&this[_0xf7be('0x5')][_0x149cd0['queue']]['autopause']==='all'){if(this[_0xf7be('0x1c')][_0x149cd0[_0xf7be('0x18')]]){logger[_0xf7be('0x1e')](_0xf7be('0x50'),_0x149cd0[_0xf7be('0x27')],_0x149cd0[_0xf7be('0x18')],_0x149cd0[_0xf7be('0x28')]);return RpcUser['savePause'](this['agents'][_0x149cd0[_0xf7be('0x18')]],_0xf7be('0x51'),_0x149cd0['uniqueid']);}}}catch(_0x156cbe){logger[_0xf7be('0x2d')](_0xf7be('0x52'),_0x156cbe['message']);}};module[_0xf7be('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 513fc3d..8c90e0b 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 _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x101a3b,_0x1b87ba){var _0x5ed0d3=function(_0x1d25f0){while(--_0x1d25f0){_0x101a3b['push'](_0x101a3b['shift']());}};_0x5ed0d3(++_0x1b87ba);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x164724,_0x12c024){var _0x408e0b=function(_0xdc8553){while(--_0xdc8553){_0x164724['push'](_0x164724['shift']());}};_0x408e0b(++_0x12c024);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f9714f6..51525d6 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x5b7820,_0x36ab53){var _0x17db47=function(_0x4805d3){while(--_0x4805d3){_0x5b7820['push'](_0x5b7820['shift']());}};_0x17db47(++_0x36ab53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x70e0,0x17b));var _0x070e=function(_0xce1a47,_0x4bc1cb){_0xce1a47=_0xce1a47-0x0;var _0x576d18=_0x70e0[_0xce1a47];return _0x576d18;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index d3bc816..8f70da2 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 _0xb19d=['ContactId','ListId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','queue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x4754b6,_0x1b74dd){var _0x228084=function(_0x4dd6b1){while(--_0x4dd6b1){_0x4754b6['push'](_0x4754b6['shift']());}};_0x228084(++_0x1b74dd);}(_0xb19d,0x173));var _0xdb19=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0xb19d[_0x54381d];return _0x5308a7;};'use strict';var util=require(_0xdb19('0x0'));var _=require(_0xdb19('0x1'));var moment=require(_0xdb19('0x2'));function checkNameSurname(_0x1fadd1,_0x4ad83b,_0x49b60d){var _0x3409e8='';if(!_['isNil'](_0x4ad83b)&&_0xdb19('0x3')===typeof _0x4ad83b){_0x3409e8+=_0x4ad83b;}if(!_[_0xdb19('0x4')](_0x49b60d)&&_0xdb19('0x3')===typeof _0x49b60d){_0x3409e8+='\x20'+_0x49b60d;}if(_0x3409e8!==''){return _0x3409e8;}return _0x1fadd1;}function Action(_0x217a20,_0x5ddb52,_0x4237d1){this[_0xdb19('0x5')]=_0x217a20;this[_0xdb19('0x6')]=_0x4237d1||undefined;this[_0xdb19('0x7')]=checkNameSurname(_0x5ddb52['Contact'][_0xdb19('0x8')],_0x5ddb52[_0xdb19('0x9')][_0xdb19('0xa')],_0x5ddb52[_0xdb19('0x9')][_0xdb19('0xb')]);this[_0xdb19('0xc')]=_0x5ddb52[_0xdb19('0x9')][_0xdb19('0x8')];this['queue']=_0x217a20[_0xdb19('0x7')];this[_0xdb19('0xd')]=_0x5ddb52[_0xdb19('0xd')]||![];this[_0xdb19('0xe')]=_0x217a20[_0xdb19('0xe')];this[_0xdb19('0xf')]=_0x217a20[_0xdb19('0xf')]||0x3;this['scheduledat']=_0x5ddb52[_0xdb19('0x10')];this[_0xdb19('0x11')]=_0x5ddb52['countbusyretry'];this[_0xdb19('0x12')]=_0x5ddb52[_0xdb19('0x12')];this[_0xdb19('0x13')]=_0x5ddb52[_0xdb19('0x13')];this['countnosuchnumberretry']=_0x5ddb52[_0xdb19('0x14')];this[_0xdb19('0x15')]=_0x5ddb52[_0xdb19('0x15')];this[_0xdb19('0x16')]=_0x5ddb52['countabandonedretry'];this[_0xdb19('0x17')]=_0x5ddb52[_0xdb19('0x17')];this[_0xdb19('0x18')]=_0x5ddb52[_0xdb19('0x18')];this[_0xdb19('0x19')]=_0x5ddb52[_0xdb19('0x19')];this[_0xdb19('0x1a')]=_0x5ddb52[_0xdb19('0x1a')];this['UserId']=_0x5ddb52['UserId'];this[_0xdb19('0x1b')]=_0x5ddb52[_0xdb19('0x1b')];this[_0xdb19('0x1c')]=_0x5ddb52[_0xdb19('0x1c')];this['idHopper']=_0x5ddb52['id'];this[_0xdb19('0x1d')]=_0x5ddb52['Contact'][_0xdb19('0xa')]||'';this['starttime']=moment()['format'](_0xdb19('0x1e'));this[_0xdb19('0x1f')]=_0x5ddb52[_0xdb19('0x1f')];this[_0xdb19('0x20')]=_0x5ddb52[_0xdb19('0x20')];this[_0xdb19('0x21')]=_0x5ddb52['callbackat'];this[_0xdb19('0x22')]=_0x5ddb52['recallme'];this[_0xdb19('0x23')]='';this[_0xdb19('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0xdb19('0x25'),this['name'],this[_0xdb19('0x5')][_0xdb19('0x26')]>0x0?this[_0xdb19('0xc')][_0xdb19('0x27')](this[_0xdb19('0x5')][_0xdb19('0x26')]):this[_0xdb19('0xc')]);};Action[_0xdb19('0x28')][_0xdb19('0x29')]=function(){return this[_0xdb19('0x2a')];};module[_0xdb19('0x2b')]=Action; \ No newline at end of file +var _0x02c5=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','dialCutDigit','substring','exports','util','lodash','isNil','string','voiceQueue','name','phone','Contact','lastName','number','queue','active','dialQueueTimeout','scheduledat'];(function(_0x7bf747,_0x5a3e7e){var _0x198866=function(_0xd47712){while(--_0xd47712){_0x7bf747['push'](_0x7bf747['shift']());}};_0x198866(++_0x5a3e7e);}(_0x02c5,0x163));var _0x502c=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0x02c5[_0x39a04c];return _0x580cb0;};'use strict';var util=require(_0x502c('0x0'));var _=require(_0x502c('0x1'));var moment=require('moment');function checkNameSurname(_0x17399f,_0x50482b,_0x88072){var _0x130481='';if(!_[_0x502c('0x2')](_0x50482b)&&'string'===typeof _0x50482b){_0x130481+=_0x50482b;}if(!_[_0x502c('0x2')](_0x88072)&&_0x502c('0x3')===typeof _0x88072){_0x130481+='\x20'+_0x88072;}if(_0x130481!==''){return _0x130481;}return _0x17399f;}function Action(_0x2facec,_0xb5a8a0,_0x46f06c){this[_0x502c('0x4')]=_0x2facec;this['uniqueid']=_0x46f06c||undefined;this[_0x502c('0x5')]=checkNameSurname(_0xb5a8a0['Contact'][_0x502c('0x6')],_0xb5a8a0[_0x502c('0x7')]['firstName'],_0xb5a8a0[_0x502c('0x7')][_0x502c('0x8')]);this[_0x502c('0x9')]=_0xb5a8a0[_0x502c('0x7')][_0x502c('0x6')];this[_0x502c('0xa')]=_0x2facec[_0x502c('0x5')];this[_0x502c('0xb')]=_0xb5a8a0[_0x502c('0xb')]||![];this['type']=_0x2facec['type'];this[_0x502c('0xc')]=_0x2facec[_0x502c('0xc')]||0x3;this['scheduledat']=_0xb5a8a0[_0x502c('0xd')];this[_0x502c('0xe')]=_0xb5a8a0['countbusyretry'];this['countcongestionretry']=_0xb5a8a0[_0x502c('0xf')];this[_0x502c('0x10')]=_0xb5a8a0['countnoanswerretry'];this[_0x502c('0x11')]=_0xb5a8a0[_0x502c('0x11')];this[_0x502c('0x12')]=_0xb5a8a0[_0x502c('0x12')];this[_0x502c('0x13')]=_0xb5a8a0[_0x502c('0x13')];this['countmachineretry']=_0xb5a8a0[_0x502c('0x14')];this[_0x502c('0x15')]=_0xb5a8a0[_0x502c('0x15')];this[_0x502c('0x16')]=_0xb5a8a0['ContactId'];this[_0x502c('0x17')]=_0xb5a8a0[_0x502c('0x17')];this[_0x502c('0x18')]=_0xb5a8a0['UserId'];this[_0x502c('0x19')]=_0xb5a8a0[_0x502c('0x19')];this[_0x502c('0x1a')]=_0xb5a8a0['CampaignId'];this[_0x502c('0x1b')]=_0xb5a8a0['id'];this['ContactFirstName']=_0xb5a8a0[_0x502c('0x7')][_0x502c('0x1c')]||'';this[_0x502c('0x1d')]=moment()[_0x502c('0x1e')](_0x502c('0x1f'));this['callback']=_0xb5a8a0['callback'];this[_0x502c('0x20')]=_0xb5a8a0[_0x502c('0x20')];this[_0x502c('0x21')]=_0xb5a8a0[_0x502c('0x21')];this[_0x502c('0x22')]=_0xb5a8a0['recallme'];this['originatecalleridnum']='';this[_0x502c('0x23')]='';}Action[_0x502c('0x24')][_0x502c('0x25')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x502c('0x5')],this[_0x502c('0x4')][_0x502c('0x26')]>0x0?this[_0x502c('0x9')][_0x502c('0x27')](this['voiceQueue']['dialCutDigit']):this[_0x502c('0x9')]);};Action[_0x502c('0x24')]['getQueue']=function(){return this[_0x502c('0xa')];};module[_0x502c('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 7bb6c95..e74f0f8 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 _0x2893=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry'];(function(_0x84a238,_0x31ab22){var _0x475e0e=function(_0x99b8f8){while(--_0x99b8f8){_0x84a238['push'](_0x84a238['shift']());}};_0x475e0e(++_0x31ab22);}(_0x2893,0x81));var _0x3289=function(_0x2f06b3,_0x12feb6){_0x2f06b3=_0x2f06b3-0x0;var _0x270d4d=_0x2893[_0x2f06b3];return _0x270d4d;};'use strict';var util=require(_0x3289('0x0'));var _=require('lodash');var moment=require(_0x3289('0x1'));function getSeconds(_0x56811a,_0x34b8f4){var _0x5e9229=moment(_0x56811a)[_0x3289('0x2')](0x0);var _0x23ca50=moment(_0x34b8f4)[_0x3289('0x2')](0x0);return _0x5e9229['diff'](_0x23ca50,_0x3289('0x3'));}function AgentComplete(_0x1007ce,_0x3745a7){this[_0x3289('0x4')]=0x4;this[_0x3289('0x5')]=_0x3289('0x6');this[_0x3289('0x7')]=_0x1007ce['scheduledat'];this[_0x3289('0x8')]=_0x1007ce[_0x3289('0x8')];this['campaigntype']=_0x1007ce['type']===_0x3289('0x9')?_0x3289('0xa'):_0x1007ce[_0x3289('0x8')];this[_0x3289('0xb')]=_0x1007ce[_0x3289('0xb')];this[_0x3289('0xc')]=_0x1007ce[_0x3289('0xc')];this[_0x3289('0xd')]=_0x1007ce['countnoanswerretry'];this[_0x3289('0xe')]=_0x1007ce[_0x3289('0xb')]+_0x1007ce[_0x3289('0xc')]+_0x1007ce[_0x3289('0xd')]+_0x1007ce[_0x3289('0xf')]+_0x1007ce['countdropretry']+_0x1007ce[_0x3289('0x10')]+_0x1007ce[_0x3289('0x11')]+_0x1007ce['countagentrejectretry'];this['countnosuchnumberretry']=_0x1007ce[_0x3289('0xf')];this[_0x3289('0x12')]=_0x1007ce[_0x3289('0x12')];this['countabandonedretry']=_0x1007ce[_0x3289('0x10')];this['countmachineretry']=_0x1007ce['countmachineretry'];this[_0x3289('0x13')]=_0x1007ce['countagentrejectretry'];this[_0x3289('0x14')]=_0x3745a7[_0x3289('0x14')];this[_0x3289('0x15')]=_0x1007ce[_0x3289('0x16')];this[_0x3289('0x17')]=_0x1007ce[_0x3289('0x18')];this[_0x3289('0x19')]=_0x1007ce['starttime'];this[_0x3289('0x1a')]=_0x1007ce[_0x3289('0x1a')];this['answertime']=_0x1007ce[_0x3289('0x1b')];this[_0x3289('0x1c')]=moment()[_0x3289('0x1d')](_0x3289('0x1e'));this[_0x3289('0x1f')]=getSeconds(_0x1007ce[_0x3289('0x1a')],_0x1007ce[_0x3289('0x19')]);this[_0x3289('0x20')]=getSeconds(_0x1007ce[_0x3289('0x1b')],_0x1007ce[_0x3289('0x1a')]);this[_0x3289('0x21')]=getSeconds(this[_0x3289('0x1c')],_0x1007ce[_0x3289('0x1b')]);this[_0x3289('0xa')]=_0x3745a7['queue'];this[_0x3289('0x22')]=_0x3745a7[_0x3289('0x22')];this[_0x3289('0x23')]=_0x3745a7['reason'];this[_0x3289('0x24')]=_0x1007ce['callback'];this[_0x3289('0x25')]=_0x1007ce[_0x3289('0x25')];this['callbackat']=_0x1007ce[_0x3289('0x26')];this[_0x3289('0x27')]=_0x1007ce[_0x3289('0x27')];this['ContactId']=_0x1007ce[_0x3289('0x28')];this[_0x3289('0x29')]=_0x1007ce[_0x3289('0x29')];this['UserId']=_0x1007ce[_0x3289('0x2a')];this[_0x3289('0x2b')]=_0x1007ce[_0x3289('0x2b')];this[_0x3289('0x2c')]=_0x1007ce[_0x3289('0x2c')];this[_0x3289('0x2d')]=_0x1007ce[_0x3289('0x2d')]||'';this['originatecalleridname']=_0x1007ce[_0x3289('0x2e')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xf644=['ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime'];(function(_0xed1a9a,_0x2ec9b0){var _0x505d87=function(_0x544a59){while(--_0x544a59){_0xed1a9a['push'](_0xed1a9a['shift']());}};_0x505d87(++_0x2ec9b0);}(_0xf644,0x1eb));var _0x4f64=function(_0x1ae43b,_0x3783f6){_0x1ae43b=_0x1ae43b-0x0;var _0x7c8e14=_0xf644[_0x1ae43b];return _0x7c8e14;};'use strict';var util=require(_0x4f64('0x0'));var _=require(_0x4f64('0x1'));var moment=require(_0x4f64('0x2'));function getSeconds(_0x550a44,_0x2476af){var _0x9a31b1=moment(_0x550a44)[_0x4f64('0x3')](0x0);var _0x2658d4=moment(_0x2476af)[_0x4f64('0x3')](0x0);return _0x9a31b1[_0x4f64('0x4')](_0x2658d4,_0x4f64('0x5'));}function AgentComplete(_0x43ab41,_0x23255b){this['state']=0x4;this[_0x4f64('0x6')]='Answer';this['scheduledat']=_0x43ab41[_0x4f64('0x7')];this[_0x4f64('0x8')]=_0x43ab41[_0x4f64('0x8')];this['campaigntype']=_0x43ab41[_0x4f64('0x8')]===_0x4f64('0x9')?_0x4f64('0xa'):_0x43ab41[_0x4f64('0x8')];this[_0x4f64('0xb')]=_0x43ab41[_0x4f64('0xb')];this[_0x4f64('0xc')]=_0x43ab41[_0x4f64('0xc')];this[_0x4f64('0xd')]=_0x43ab41[_0x4f64('0xd')];this['countglobal']=_0x43ab41[_0x4f64('0xb')]+_0x43ab41['countcongestionretry']+_0x43ab41[_0x4f64('0xd')]+_0x43ab41['countnosuchnumberretry']+_0x43ab41[_0x4f64('0xe')]+_0x43ab41[_0x4f64('0xf')]+_0x43ab41[_0x4f64('0x10')]+_0x43ab41[_0x4f64('0x11')];this['countnosuchnumberretry']=_0x43ab41['countnosuchnumberretry'];this[_0x4f64('0xe')]=_0x43ab41[_0x4f64('0xe')];this['countabandonedretry']=_0x43ab41['countabandonedretry'];this['countmachineretry']=_0x43ab41[_0x4f64('0x10')];this[_0x4f64('0x11')]=_0x43ab41[_0x4f64('0x11')];this[_0x4f64('0x12')]=_0x23255b[_0x4f64('0x12')];this[_0x4f64('0x13')]=_0x43ab41[_0x4f64('0x14')];this['calleridnum']=_0x43ab41[_0x4f64('0x15')];this[_0x4f64('0x16')]=_0x43ab41[_0x4f64('0x16')];this[_0x4f64('0x17')]=_0x43ab41['responsetime'];this[_0x4f64('0x18')]=_0x43ab41[_0x4f64('0x18')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x4f64('0x19')]=getSeconds(_0x43ab41['responsetime'],_0x43ab41[_0x4f64('0x16')]);this[_0x4f64('0x1a')]=getSeconds(_0x43ab41[_0x4f64('0x18')],_0x43ab41[_0x4f64('0x17')]);this[_0x4f64('0x1b')]=getSeconds(this[_0x4f64('0x1c')],_0x43ab41[_0x4f64('0x18')]);this['queue']=_0x23255b['queue'];this['membername']=_0x23255b[_0x4f64('0x1d')];this[_0x4f64('0x1e')]=_0x23255b[_0x4f64('0x1e')];this['callback']=_0x43ab41[_0x4f64('0x1f')];this[_0x4f64('0x20')]=_0x43ab41[_0x4f64('0x20')];this[_0x4f64('0x21')]=_0x43ab41[_0x4f64('0x21')];this[_0x4f64('0x22')]=_0x43ab41['recallme'];this[_0x4f64('0x23')]=_0x43ab41[_0x4f64('0x23')];this[_0x4f64('0x24')]=_0x43ab41[_0x4f64('0x24')];this[_0x4f64('0x25')]=_0x43ab41[_0x4f64('0x25')];this[_0x4f64('0x26')]=_0x43ab41[_0x4f64('0x26')];this[_0x4f64('0x27')]=_0x43ab41['CampaignId'];this[_0x4f64('0x28')]=_0x43ab41[_0x4f64('0x28')]||'';this[_0x4f64('0x29')]=_0x43ab41['originatecalleridname']||'';}module[_0x4f64('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 3b8915b..729a5f4 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 _0x6b8f=['originatecalleridname','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridnum','starttime','endtime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x4a690d,_0x51473d){var _0x31e44c=function(_0x442593){while(--_0x442593){_0x4a690d['push'](_0x4a690d['shift']());}};_0x31e44c(++_0x51473d);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x43387d,_0x43ce6b){_0x43387d=_0x43387d-0x0;var _0x132315=_0x6b8f[_0x43387d];return _0x132315;};'use strict';var util=require('util');var _=require(_0xf6b8('0x0'));var moment=require('moment');function getSeconds(_0x311ae7,_0x4e006e){var _0x5443a1=moment(_0x311ae7)[_0xf6b8('0x1')](0x0);var _0x15de3a=moment(_0x4e006e)['milliseconds'](0x0);return _0x5443a1[_0xf6b8('0x2')](_0x15de3a,_0xf6b8('0x3'));}function Final(_0x347a0b){this['uniqueid']=_0x347a0b[_0xf6b8('0x4')];this[_0xf6b8('0x5')]=_0x347a0b[_0xf6b8('0x5')];this[_0xf6b8('0x6')]=_0x347a0b['type'];this['campaigntype']=_0x347a0b[_0xf6b8('0x6')]==='outbound'?_0xf6b8('0x7'):_0x347a0b[_0xf6b8('0x6')];this[_0xf6b8('0x8')]=_0x347a0b[_0xf6b8('0x8')];this[_0xf6b8('0x9')]=_0x347a0b[_0xf6b8('0x9')];this['countnoanswerretry']=_0x347a0b['countnoanswerretry'];this['countglobal']=_0x347a0b[_0xf6b8('0x8')]+_0x347a0b[_0xf6b8('0x9')]+_0x347a0b[_0xf6b8('0xa')]+_0x347a0b[_0xf6b8('0xb')]+_0x347a0b['countdropretry']+_0x347a0b['countabandonedretry']+_0x347a0b[_0xf6b8('0xc')]+_0x347a0b[_0xf6b8('0xd')];this['countnosuchnumberretry']=_0x347a0b[_0xf6b8('0xb')];this[_0xf6b8('0xe')]=_0x347a0b[_0xf6b8('0xe')];this['countabandonedretry']=_0x347a0b[_0xf6b8('0xf')];this['countmachineretry']=_0x347a0b[_0xf6b8('0xc')];this[_0xf6b8('0xd')]=_0x347a0b[_0xf6b8('0xd')];this[_0xf6b8('0x7')]=_0x347a0b[_0xf6b8('0x7')];this['calleridname']=_0x347a0b['calleridname'];this[_0xf6b8('0x10')]=_0x347a0b['calleridnum'];this[_0xf6b8('0x11')]=_0x347a0b[_0xf6b8('0x11')];this['responsetime']=_0x347a0b['responsetime'];this[_0xf6b8('0x12')]=_0x347a0b[_0xf6b8('0x13')];this[_0xf6b8('0x14')]=_0x347a0b[_0xf6b8('0x14')]||0x0;this['holdtime']=_0x347a0b['holdtime']||0x0;this['talktime']=_0x347a0b[_0xf6b8('0x15')]||0x0;this[_0xf6b8('0x16')]=_0x347a0b[_0xf6b8('0x16')];this['callbackuniqueid']=_0x347a0b[_0xf6b8('0x17')];this[_0xf6b8('0x18')]=_0x347a0b[_0xf6b8('0x18')];this[_0xf6b8('0x19')]=_0x347a0b['recallme'];this[_0xf6b8('0x1a')]=_0x347a0b['ContactId'];this[_0xf6b8('0x1b')]=_0x347a0b[_0xf6b8('0x1b')];this[_0xf6b8('0x1c')]=_0x347a0b[_0xf6b8('0x1c')];this[_0xf6b8('0x1d')]=_0x347a0b[_0xf6b8('0x1d')];this['CampaignId']=_0x347a0b[_0xf6b8('0x1e')];this[_0xf6b8('0x1f')]=_0x347a0b['originatecalleridnum']||'';this[_0xf6b8('0x20')]=_0x347a0b[_0xf6b8('0x20')]||'';}module[_0xf6b8('0x21')]=Final; \ No newline at end of file +var _0xeff8=['util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x5c4095,_0x4db38e){var _0x1f0084=function(_0x87ce){while(--_0x87ce){_0x5c4095['push'](_0x5c4095['shift']());}};_0x1f0084(++_0x4db38e);}(_0xeff8,0x186));var _0x8eff=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0xeff8[_0x2077c2];return _0x312f9f;};'use strict';var util=require(_0x8eff('0x0'));var _=require(_0x8eff('0x1'));var moment=require('moment');function getSeconds(_0x367eaf,_0x354ff4){var _0x1e55a0=moment(_0x367eaf)['milliseconds'](0x0);var _0x2d7c9c=moment(_0x354ff4)[_0x8eff('0x2')](0x0);return _0x1e55a0[_0x8eff('0x3')](_0x2d7c9c,_0x8eff('0x4'));}function Final(_0x4ac51c){this[_0x8eff('0x5')]=_0x4ac51c[_0x8eff('0x5')];this[_0x8eff('0x6')]=_0x4ac51c[_0x8eff('0x6')];this['type']=_0x4ac51c[_0x8eff('0x7')];this[_0x8eff('0x8')]=_0x4ac51c[_0x8eff('0x7')]===_0x8eff('0x9')?'queue':_0x4ac51c['type'];this[_0x8eff('0xa')]=_0x4ac51c[_0x8eff('0xa')];this[_0x8eff('0xb')]=_0x4ac51c['countcongestionretry'];this[_0x8eff('0xc')]=_0x4ac51c[_0x8eff('0xc')];this['countglobal']=_0x4ac51c[_0x8eff('0xa')]+_0x4ac51c[_0x8eff('0xb')]+_0x4ac51c['countnoanswerretry']+_0x4ac51c['countnosuchnumberretry']+_0x4ac51c[_0x8eff('0xd')]+_0x4ac51c[_0x8eff('0xe')]+_0x4ac51c[_0x8eff('0xf')]+_0x4ac51c[_0x8eff('0x10')];this[_0x8eff('0x11')]=_0x4ac51c['countnosuchnumberretry'];this[_0x8eff('0xd')]=_0x4ac51c[_0x8eff('0xd')];this[_0x8eff('0xe')]=_0x4ac51c[_0x8eff('0xe')];this[_0x8eff('0xf')]=_0x4ac51c[_0x8eff('0xf')];this[_0x8eff('0x10')]=_0x4ac51c[_0x8eff('0x10')];this[_0x8eff('0x12')]=_0x4ac51c[_0x8eff('0x12')];this[_0x8eff('0x13')]=_0x4ac51c['calleridname'];this[_0x8eff('0x14')]=_0x4ac51c[_0x8eff('0x14')];this[_0x8eff('0x15')]=_0x4ac51c[_0x8eff('0x15')];this[_0x8eff('0x16')]=_0x4ac51c[_0x8eff('0x16')];this[_0x8eff('0x17')]=_0x4ac51c[_0x8eff('0x16')];this[_0x8eff('0x18')]=_0x4ac51c[_0x8eff('0x18')]||0x0;this[_0x8eff('0x19')]=_0x4ac51c[_0x8eff('0x19')]||0x0;this[_0x8eff('0x1a')]=_0x4ac51c[_0x8eff('0x1a')]||0x0;this[_0x8eff('0x1b')]=_0x4ac51c[_0x8eff('0x1b')];this['callbackuniqueid']=_0x4ac51c[_0x8eff('0x1c')];this[_0x8eff('0x1d')]=_0x4ac51c['callbackat'];this[_0x8eff('0x1e')]=_0x4ac51c['recallme'];this[_0x8eff('0x1f')]=_0x4ac51c[_0x8eff('0x1f')];this[_0x8eff('0x20')]=_0x4ac51c[_0x8eff('0x20')];this[_0x8eff('0x21')]=_0x4ac51c['UserId'];this[_0x8eff('0x22')]=_0x4ac51c[_0x8eff('0x22')];this['CampaignId']=_0x4ac51c[_0x8eff('0x23')];this[_0x8eff('0x24')]=_0x4ac51c[_0x8eff('0x24')]||'';this[_0x8eff('0x25')]=_0x4ac51c[_0x8eff('0x25')]||'';}module[_0x8eff('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 6e538fa..8617cb6 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 _0x27fb=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer'];(function(_0x5c17d9,_0x1fdd50){var _0xc1121b=function(_0x38001a){while(--_0x38001a){_0x5c17d9['push'](_0x5c17d9['shift']());}};_0xc1121b(++_0x1fdd50);}(_0x27fb,0xa4));var _0xb27f=function(_0x1065e8,_0xa4d8e2){_0x1065e8=_0x1065e8-0x0;var _0x70328a=_0x27fb[_0x1065e8];return _0x70328a;};'use strict';var util=require(_0xb27f('0x0'));var _=require(_0xb27f('0x1'));var moment=require(_0xb27f('0x2'));function getSeconds(_0x3d9b73,_0x360551){var _0x272c02=moment(_0x3d9b73)[_0xb27f('0x3')](0x0);var _0x20bacb=moment(_0x360551)[_0xb27f('0x3')](0x0);return _0x272c02[_0xb27f('0x4')](_0x20bacb,_0xb27f('0x5'));}function Hangup(_0x8994d6,_0x3e3aed){this['state']=0x4;this[_0xb27f('0x6')]=_0xb27f('0x7');this[_0xb27f('0x8')]=_0x8994d6['scheduledat'];this[_0xb27f('0x9')]=_0x8994d6[_0xb27f('0x9')];this['campaigntype']=_0x8994d6['type']===_0xb27f('0xa')?_0xb27f('0xb'):_0x8994d6[_0xb27f('0x9')];this[_0xb27f('0xc')]=_0x8994d6[_0xb27f('0xc')];this[_0xb27f('0xd')]=_0x8994d6[_0xb27f('0xd')];this[_0xb27f('0xe')]=_0x8994d6['countnoanswerretry'];this[_0xb27f('0xf')]=_0x8994d6[_0xb27f('0xc')]+_0x8994d6[_0xb27f('0xd')]+_0x8994d6[_0xb27f('0xe')]+_0x8994d6['countnosuchnumberretry']+_0x8994d6[_0xb27f('0x10')]+_0x8994d6[_0xb27f('0x11')]+_0x8994d6[_0xb27f('0x12')]+_0x8994d6['countagentrejectretry'];this[_0xb27f('0x13')]=_0x8994d6[_0xb27f('0x13')];this[_0xb27f('0x10')]=_0x8994d6[_0xb27f('0x10')];this[_0xb27f('0x11')]=_0x8994d6[_0xb27f('0x11')];this[_0xb27f('0x12')]=_0x8994d6[_0xb27f('0x12')];this[_0xb27f('0x14')]=_0x8994d6['countagentrejectretry'];this['uniqueid']=_0x3e3aed['uniqueid'];this[_0xb27f('0x15')]=_0x8994d6[_0xb27f('0x16')];this[_0xb27f('0x17')]=_0x8994d6[_0xb27f('0x18')];this[_0xb27f('0x19')]=_0x8994d6[_0xb27f('0x19')];this[_0xb27f('0x1a')]=_0x8994d6[_0xb27f('0x1a')];this[_0xb27f('0x1b')]=moment()['format'](_0xb27f('0x1c'));this[_0xb27f('0x1d')]=getSeconds(_0x8994d6[_0xb27f('0x1a')],_0x8994d6[_0xb27f('0x19')]);this[_0xb27f('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xb27f('0x1b')],_0x8994d6['responsetime']);this[_0xb27f('0xb')]=_0x8994d6[_0xb27f('0xb')];this['membername']=_0xb27f('0x1f');this['reason']=_0x3e3aed[_0xb27f('0x20')];this[_0xb27f('0x21')]=_0x8994d6['callback'];this[_0xb27f('0x22')]=_0x8994d6['callbackuniqueid'];this['callbackat']=_0x8994d6[_0xb27f('0x23')];this['recallme']=_0x8994d6[_0xb27f('0x24')];this['ContactId']=_0x8994d6[_0xb27f('0x25')];this[_0xb27f('0x26')]=_0x8994d6[_0xb27f('0x26')];this[_0xb27f('0x27')]=_0x8994d6[_0xb27f('0x27')];this[_0xb27f('0x28')]=_0x8994d6[_0xb27f('0x28')];this[_0xb27f('0x29')]=_0x8994d6['CampaignId'];}module[_0xb27f('0x2a')]=Hangup; \ No newline at end of file +var _0x0bf6=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','queue','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','statedesc','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x0bf6,0xd7));var _0x60bf=function(_0x420aa1,_0x44892c){_0x420aa1=_0x420aa1-0x0;var _0x58cd49=_0x0bf6[_0x420aa1];return _0x58cd49;};'use strict';var util=require(_0x60bf('0x0'));var _=require(_0x60bf('0x1'));var moment=require(_0x60bf('0x2'));function getSeconds(_0x384318,_0x257e9c){var _0x106bfd=moment(_0x384318)[_0x60bf('0x3')](0x0);var _0x5119fa=moment(_0x257e9c)[_0x60bf('0x3')](0x0);return _0x106bfd['diff'](_0x5119fa,_0x60bf('0x4'));}function Hangup(_0x3bd088,_0x21d7e0){this['state']=0x4;this[_0x60bf('0x5')]='Answer';this['scheduledat']=_0x3bd088['scheduledat'];this[_0x60bf('0x6')]=_0x3bd088[_0x60bf('0x6')];this[_0x60bf('0x7')]=_0x3bd088[_0x60bf('0x6')]===_0x60bf('0x8')?'queue':_0x3bd088[_0x60bf('0x6')];this[_0x60bf('0x9')]=_0x3bd088[_0x60bf('0x9')];this[_0x60bf('0xa')]=_0x3bd088['countcongestionretry'];this[_0x60bf('0xb')]=_0x3bd088[_0x60bf('0xb')];this[_0x60bf('0xc')]=_0x3bd088[_0x60bf('0x9')]+_0x3bd088['countcongestionretry']+_0x3bd088[_0x60bf('0xb')]+_0x3bd088['countnosuchnumberretry']+_0x3bd088['countdropretry']+_0x3bd088[_0x60bf('0xd')]+_0x3bd088[_0x60bf('0xe')]+_0x3bd088[_0x60bf('0xf')];this['countnosuchnumberretry']=_0x3bd088[_0x60bf('0x10')];this[_0x60bf('0x11')]=_0x3bd088[_0x60bf('0x11')];this[_0x60bf('0xd')]=_0x3bd088['countabandonedretry'];this[_0x60bf('0xe')]=_0x3bd088[_0x60bf('0xe')];this[_0x60bf('0xf')]=_0x3bd088[_0x60bf('0xf')];this[_0x60bf('0x12')]=_0x21d7e0[_0x60bf('0x12')];this['calleridname']=_0x3bd088['name'];this[_0x60bf('0x13')]=_0x3bd088[_0x60bf('0x14')];this[_0x60bf('0x15')]=_0x3bd088[_0x60bf('0x15')];this[_0x60bf('0x16')]=_0x3bd088[_0x60bf('0x16')];this[_0x60bf('0x17')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x60bf('0x18')]=getSeconds(_0x3bd088[_0x60bf('0x16')],_0x3bd088[_0x60bf('0x15')]);this['holdtime']=0x0;this[_0x60bf('0x19')]=getSeconds(this['endtime'],_0x3bd088[_0x60bf('0x16')]);this[_0x60bf('0x1a')]=_0x3bd088[_0x60bf('0x1a')];this['membername']=_0x60bf('0x1b');this[_0x60bf('0x1c')]=_0x21d7e0['cause-txt'];this['callback']=_0x3bd088[_0x60bf('0x1d')];this[_0x60bf('0x1e')]=_0x3bd088[_0x60bf('0x1e')];this['callbackat']=_0x3bd088[_0x60bf('0x1f')];this['recallme']=_0x3bd088[_0x60bf('0x20')];this[_0x60bf('0x21')]=_0x3bd088['ContactId'];this[_0x60bf('0x22')]=_0x3bd088[_0x60bf('0x22')];this['UserId']=_0x3bd088['UserId'];this[_0x60bf('0x23')]=_0x3bd088['VoiceQueueId'];this[_0x60bf('0x24')]=_0x3bd088[_0x60bf('0x24')];}module[_0x60bf('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 654ab26..a7e9f49 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 _0xb6d3=['uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x1523b6,_0x30d0ba){var _0x3f5ead=function(_0x26e9a3){while(--_0x26e9a3){_0x1523b6['push'](_0x1523b6['shift']());}};_0x3f5ead(++_0x30d0ba);}(_0xb6d3,0x174));var _0x3b6d=function(_0x4f8258,_0x18fe18){_0x4f8258=_0x4f8258-0x0;var _0x2882f9=_0xb6d3[_0x4f8258];return _0x2882f9;};'use strict';var util=require(_0x3b6d('0x0'));var _=require(_0x3b6d('0x1'));var moment=require(_0x3b6d('0x2'));function getSeconds(_0x43f8b8,_0x180297){var _0x4919b7=moment(_0x43f8b8)[_0x3b6d('0x3')](0x0);var _0x7ea3aa=moment(_0x180297)[_0x3b6d('0x3')](0x0);return _0x4919b7[_0x3b6d('0x4')](_0x7ea3aa,_0x3b6d('0x5'));}function History(_0x51d461){this['uniqueid']=_0x51d461[_0x3b6d('0x6')];this[_0x3b6d('0x7')]=_0x51d461[_0x3b6d('0x7')]||undefined;this[_0x3b6d('0x8')]=_0x51d461[_0x3b6d('0x8')];this[_0x3b6d('0x9')]=_0x51d461['type']===_0x3b6d('0xa')?_0x3b6d('0xb'):_0x51d461[_0x3b6d('0x8')];this[_0x3b6d('0xc')]=_0x51d461[_0x3b6d('0xc')];this[_0x3b6d('0xd')]=_0x51d461[_0x3b6d('0xd')];this[_0x3b6d('0xe')]=_0x51d461[_0x3b6d('0xe')];this[_0x3b6d('0xf')]=_0x51d461['countbusyretry']+_0x51d461['countcongestionretry']+_0x51d461['countnoanswerretry']+_0x51d461[_0x3b6d('0x10')]+_0x51d461[_0x3b6d('0x11')]+_0x51d461[_0x3b6d('0x12')]+_0x51d461[_0x3b6d('0x13')]+_0x51d461[_0x3b6d('0x14')];this[_0x3b6d('0x10')]=_0x51d461['countnosuchnumberretry'];this[_0x3b6d('0x11')]=_0x51d461[_0x3b6d('0x11')];this[_0x3b6d('0x12')]=_0x51d461[_0x3b6d('0x12')];this[_0x3b6d('0x13')]=_0x51d461['countmachineretry'];this[_0x3b6d('0x14')]=_0x51d461[_0x3b6d('0x14')];this[_0x3b6d('0xb')]=_0x51d461[_0x3b6d('0xb')];this[_0x3b6d('0x15')]=_0x51d461[_0x3b6d('0x16')];this[_0x3b6d('0x17')]=_0x51d461[_0x3b6d('0x18')];this[_0x3b6d('0x19')]=_0x51d461['starttime'];this['responsetime']=_0x51d461[_0x3b6d('0x1a')];this[_0x3b6d('0x1b')]=_0x51d461['responsetime'];this[_0x3b6d('0x1c')]=getSeconds(_0x51d461['responsetime'],_0x51d461[_0x3b6d('0x19')]);this[_0x3b6d('0x1d')]=0x0;this[_0x3b6d('0x1e')]=0x0;this['callback']=_0x51d461[_0x3b6d('0x1f')];this[_0x3b6d('0x20')]=_0x51d461[_0x3b6d('0x20')];this[_0x3b6d('0x21')]=_0x51d461[_0x3b6d('0x21')];this['recallme']=_0x51d461[_0x3b6d('0x22')];this['ContactId']=_0x51d461[_0x3b6d('0x23')];this[_0x3b6d('0x24')]=_0x51d461[_0x3b6d('0x24')];this[_0x3b6d('0x25')]=_0x51d461[_0x3b6d('0x25')];this['VoiceQueueId']=_0x51d461[_0x3b6d('0x26')];this[_0x3b6d('0x27')]=_0x51d461[_0x3b6d('0x27')];this[_0x3b6d('0x28')]=_0x51d461[_0x3b6d('0x28')]||'';this['originatecalleridname']=_0x51d461['originatecalleridname']||'';}module[_0x3b6d('0x29')]=History; \ No newline at end of file +var _0x365a=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment'];(function(_0x163981,_0x123971){var _0x5b03d7=function(_0x3b162b){while(--_0x3b162b){_0x163981['push'](_0x163981['shift']());}};_0x5b03d7(++_0x123971);}(_0x365a,0x18d));var _0xa365=function(_0x3a225a,_0x29fd5c){_0x3a225a=_0x3a225a-0x0;var _0x5bb5bd=_0x365a[_0x3a225a];return _0x5bb5bd;};'use strict';var util=require(_0xa365('0x0'));var _=require(_0xa365('0x1'));var moment=require(_0xa365('0x2'));function getSeconds(_0x19edc8,_0x50fcb3){var _0x59a3f2=moment(_0x19edc8)[_0xa365('0x3')](0x0);var _0x44dc4f=moment(_0x50fcb3)['milliseconds'](0x0);return _0x59a3f2[_0xa365('0x4')](_0x44dc4f,_0xa365('0x5'));}function History(_0x940c21){this[_0xa365('0x6')]=_0x940c21['uniqueid'];this[_0xa365('0x7')]=_0x940c21['scheduledat']||undefined;this['type']=_0x940c21[_0xa365('0x8')];this[_0xa365('0x9')]=_0x940c21[_0xa365('0x8')]===_0xa365('0xa')?_0xa365('0xb'):_0x940c21[_0xa365('0x8')];this[_0xa365('0xc')]=_0x940c21['countbusyretry'];this['countcongestionretry']=_0x940c21[_0xa365('0xd')];this[_0xa365('0xe')]=_0x940c21[_0xa365('0xe')];this[_0xa365('0xf')]=_0x940c21['countbusyretry']+_0x940c21[_0xa365('0xd')]+_0x940c21[_0xa365('0xe')]+_0x940c21[_0xa365('0x10')]+_0x940c21[_0xa365('0x11')]+_0x940c21[_0xa365('0x12')]+_0x940c21[_0xa365('0x13')]+_0x940c21[_0xa365('0x14')];this[_0xa365('0x10')]=_0x940c21[_0xa365('0x10')];this['countdropretry']=_0x940c21['countdropretry'];this['countabandonedretry']=_0x940c21[_0xa365('0x12')];this['countmachineretry']=_0x940c21[_0xa365('0x13')];this[_0xa365('0x14')]=_0x940c21['countagentrejectretry'];this[_0xa365('0xb')]=_0x940c21['queue'];this[_0xa365('0x15')]=_0x940c21['name'];this[_0xa365('0x16')]=_0x940c21[_0xa365('0x17')];this['starttime']=_0x940c21[_0xa365('0x18')];this[_0xa365('0x19')]=_0x940c21[_0xa365('0x19')];this['endtime']=_0x940c21['responsetime'];this[_0xa365('0x1a')]=getSeconds(_0x940c21[_0xa365('0x19')],_0x940c21[_0xa365('0x18')]);this[_0xa365('0x1b')]=0x0;this[_0xa365('0x1c')]=0x0;this[_0xa365('0x1d')]=_0x940c21[_0xa365('0x1d')];this[_0xa365('0x1e')]=_0x940c21['callbackuniqueid'];this[_0xa365('0x1f')]=_0x940c21[_0xa365('0x1f')];this['recallme']=_0x940c21[_0xa365('0x20')];this[_0xa365('0x21')]=_0x940c21[_0xa365('0x21')];this[_0xa365('0x22')]=_0x940c21['ListId'];this['UserId']=_0x940c21[_0xa365('0x23')];this[_0xa365('0x24')]=_0x940c21['VoiceQueueId'];this[_0xa365('0x25')]=_0x940c21[_0xa365('0x25')];this['originatecalleridnum']=_0x940c21[_0xa365('0x26')]||'';this[_0xa365('0x27')]=_0x940c21[_0xa365('0x27')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9207420..98abc8f 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 _0x9095=['campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','inspect','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','campaigns','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','outboundAnswerCallsDay','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','dialAMDActive','value','Machine','countmachineretry','countglobal','amd','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','HangupInAMD','[syncHangupInAMDIvr][createHistory]','MACHINE','countnosuchnumberretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','droptime','dropreason','dialQueueProject2','queueCallerAbandonCreateState','dialDropRetryFrequency','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','calleridnum','channel','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','length','command','interval','true','iftime\x20%s,%s','content','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','power','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','finally','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerMaxRetry','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','dialPredictiveInterval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','checkContactBlack','recallme','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','outboundReCallsDay','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','[busyFactor]','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','format','voice:queue:%s','voice_queue:save','ivr'];(function(_0x4b4b24,_0x1df7be){var _0x20f206=function(_0x297409){while(--_0x297409){_0x4b4b24['push'](_0x4b4b24['shift']());}};_0x20f206(++_0x1df7be);}(_0x9095,0x192));var _0x5909=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x9095[_0x5235a6];return _0x1cf37e;};'use strict';var util=require('util');var _=require(_0x5909('0x0'));var BPromise=require(_0x5909('0x1'));var uuid=require(_0x5909('0x2'));var moment=require(_0x5909('0x3'));var rr=require('rr');var md5=require(_0x5909('0x4'));var Redis=require(_0x5909('0x5'));var ut=require(_0x5909('0x6'));var config=require(_0x5909('0x7'));var logger=require(_0x5909('0x8'))(_0x5909('0x9'));var loggerBooked=require('../../../config/logger')(_0x5909('0xa'));var loggerPredictive=require('../../../config/logger')(_0x5909('0xb'));var loggerPredictiveCalls=require(_0x5909('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x5909('0x8'))(_0x5909('0xc'));var ami=require(_0x5909('0xd'));config[_0x5909('0xe')]=_[_0x5909('0xf')](config[_0x5909('0xe')],{'host':_0x5909('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5909('0xe')]));var cmHopper=require(_0x5909('0x11'));var cmHopperHistory=require(_0x5909('0x12'));var cmHopperBlack=require(_0x5909('0x13'));var voiceQueueRt=require(_0x5909('0x14'));var Action=require(_0x5909('0x15'));var History=require(_0x5909('0x16'));var Final=require(_0x5909('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x5909('0x18'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x5909('0x19')]||_0x5909('0x1a');var strategy={'rrmemory':_0x5909('0x1b'),'roundrobin':_0x5909('0x1c')};var Sequence=function(){};Sequence['prototype'][_0x5909('0x1d')]=function(_0xfc86d){this[_0x5909('0x1e')]=this[_0x5909('0x1e')]?this['tail']['finally'](_0xfc86d):_0xfc86d();};function Dialer(_0x4da0a5,_0x3e132f){this[_0x5909('0x1f')]=new Sequence();this[_0x5909('0x20')]=_0x3e132f;this[_0x5909('0x21')]=_0x4da0a5[_0x5909('0x21')];this['campaigns']=_0x4da0a5['campaigns'];this['agents']=_0x4da0a5[_0x5909('0x22')];this[_0x5909('0x23')]=_0x4da0a5[_0x5909('0x23')];this[_0x5909('0x24')]=config['maxNumberOriginate']||0x2;this[_0x5909('0x25')]={};this[_0x5909('0x26')]={};this[_0x5909('0x27')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x5909('0x28')]={};this['ivrOriginated']={};this[_0x5909('0x29')]={};this[_0x5909('0x2a')]={};ami['on'](_0x5909('0x2b'),this[_0x5909('0x2c')][_0x5909('0x2d')](this));ami['on']('queuecallerabandon',this[_0x5909('0x2e')]['bind'](this));ami['on'](_0x5909('0x2f'),this[_0x5909('0x30')][_0x5909('0x2d')](this));ami['on'](_0x5909('0x31'),this[_0x5909('0x32')]['bind'](this));ami['on'](_0x5909('0x33'),this[_0x5909('0xc')][_0x5909('0x2d')](this));ami['on'](_0x5909('0x34'),this[_0x5909('0x35')]['bind'](this));ami['on'](_0x5909('0x36'),this['syncNewExten'][_0x5909('0x2d')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0x5909('0x37')][_0x5909('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x5909('0x38')][_0x5909('0x2d')](this));this[_0x5909('0x39')]();this[_0x5909('0x3a')]();}function isNotNull(_0xa1541){return _0xa1541!==null&&!_[_0x5909('0x3b')](_0xa1541);}function checkIsLoggedIn(_0x402e3c,_0x20abec){return function(){if(_0x20abec<=0x0){_0x402e3c[_0x5909('0x3c')]=_0x5909('0x3d');throw _0x402e3c['name']+_0x5909('0x3e');}};}function isActive(_0x2e8abf){return _0x2e8abf;}function checkIsActive(_0x782988,_0x28a6ba){return function(){if(!isActive(_0x28a6ba)){_0x782988[_0x5909('0x3c')]='NOT_ACTIVE';throw _0x782988[_0x5909('0x3f')]+_0x5909('0x40');}};}function checkInterval(_0x3d7616){return function(){if(!isNotNull(_0x3d7616[_0x5909('0x41')])){_0x3d7616[_0x5909('0x3c')]=_0x5909('0x42');throw _0x3d7616[_0x5909('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3d7616[_0x5909('0x41')][_0x5909('0x43')])){_0x3d7616[_0x5909('0x3c')]=_0x5909('0x42');throw _0x3d7616['name']+_0x5909('0x44');}if(!isNotNull(_[_0x5909('0x45')](_0x3d7616[_0x5909('0x41')][_0x5909('0x43')]))){_0x3d7616['message']=_0x5909('0x42');throw _0x3d7616[_0x5909('0x3f')]+_0x5909('0x44');}};}function msgResponse(_0x52ada6,_0x1c157b,_0x11dbb5){return{'action':_0x52ada6,'response':_0x1c157b,'message':_0x11dbb5,'stack':_0x11dbb5};}function myreject(_0x212c45){return function(_0x56ec15){return _0x212c45(msgResponse(_0x5909('0x46'),_0x5909('0x47'),JSON[_0x5909('0x48')](_0x56ec15)));};}function getSeconds(_0x3631e1,_0x2419c4){var _0x32a3d0=moment(_0x3631e1)[_0x5909('0x49')](0x0);var _0x4f8ffd=moment(_0x2419c4)[_0x5909('0x49')](0x0);return _0x32a3d0[_0x5909('0x4a')](_0x4f8ffd,'seconds');}function emit(_0x57ab6b,_0xc16749,_0x4fbb61){io['to'](_0x57ab6b)[_0x5909('0x4b')](_0xc16749,_0x4fbb61);}function emitVoiceQueueSummary(_0x46147d){if(_0x46147d['type']==='outbound'){var _0x143c8={'id':_0x46147d['id'],'name':_0x46147d[_0x5909('0x3f')],'strategy':_0x46147d[_0x5909('0x4c')],'answered':_0x46147d[_0x5909('0x4d')],'available':_0x46147d[_0x5909('0x4e')],'loggedIn':_0x46147d[_0x5909('0x4f')],'pTalking':_0x46147d[_0x5909('0x50')],'sumBillable':_0x46147d[_0x5909('0x51')],'sumDuration':_0x46147d[_0x5909('0x52')],'sumHoldTime':_0x46147d[_0x5909('0x53')]||0x0,'talking':_0x46147d[_0x5909('0x54')],'total':_0x46147d[_0x5909('0x55')],'type':_0x46147d[_0x5909('0x56')],'unmanaged':_0x46147d[_0x5909('0x57')],'abandoned':_0x46147d[_0x5909('0x58')],'waiting':_0x46147d[_0x5909('0x59')],'loggedInDb':_0x46147d[_0x5909('0x5a')],'dialActive':_0x46147d[_0x5909('0x5b')],'dialMethod':_0x46147d[_0x5909('0x5c')],'dialOriginateCallerIdName':_0x46147d[_0x5909('0x5d')],'dialOriginateCallerIdNumber':_0x46147d[_0x5909('0x5e')],'dialOriginateTimeout':_0x46147d['dialOriginateTimeout'],'dialPrefix':_0x46147d[_0x5909('0x5f')],'outboundAnswerAgiCallsDay':_0x46147d[_0x5909('0x60')],'outboundAnswerCallsDay':_0x46147d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x46147d[_0x5909('0x61')],'outboundBusyCallsDay':_0x46147d[_0x5909('0x62')],'outboundCongestionCallsDay':_0x46147d[_0x5909('0x63')],'outboundDropCallsDayACS':_0x46147d[_0x5909('0x64')],'outboundDropCallsDayCallersExit':_0x46147d[_0x5909('0x65')],'outboundDropCallsDayTimeout':_0x46147d[_0x5909('0x66')],'outboundNoAnswerCallsDay':_0x46147d[_0x5909('0x67')],'outboundNoSuchCallsDay':_0x46147d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x46147d[_0x5909('0x68')],'outboundReCallsDay':_0x46147d['outboundReCallsDay'],'outboundRejectCallsDay':_0x46147d[_0x5909('0x69')],'outboundUnknownCallsDay':_0x46147d['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x46147d[_0x5909('0x6a')],'predictiveIntervalAvgHoldtime':_0x46147d[_0x5909('0x6b')],'predictiveIntervalAvgTalktime':_0x46147d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x46147d[_0x5909('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x46147d[_0x5909('0x6d')],'predictiveIntervalErlangCalls':_0x46147d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x46147d[_0x5909('0x6e')],'predictiveIntervalHitRate':_0x46147d['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x46147d[_0x5909('0x6f')],'predictiveIntervalPauses':_0x46147d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x46147d[_0x5909('0x70')],'predictiveIntervalTotalCalls':_0x46147d[_0x5909('0x71')],'message':_0x46147d['message'],'originated':_0x46147d['originated'],'erlangCalls':_0x46147d[_0x5909('0x72')],'erlangCallToSecond':_0x46147d[_0x5909('0x73')],'erlangAbandonmentRate':_0x46147d[_0x5909('0x74')],'erlangBusyFactor':_0x46147d[_0x5909('0x75')],'startPredictive':_0x46147d[_0x5909('0x76')],'startProgressive':_0x46147d[_0x5909('0x28')]};if(_0x46147d[_0x5909('0x77')]){_0x143c8[_0x5909('0x77')]={'id':_0x46147d[_0x5909('0x77')]['id'],'name':_0x46147d[_0x5909('0x77')][_0x5909('0x3f')],'active':_0x46147d[_0x5909('0x77')]['active'],'callerid':_0x46147d[_0x5909('0x77')][_0x5909('0x78')]};}if(_0x46147d['Interval']){_0x143c8['Interval']={'id':_0x46147d[_0x5909('0x41')]['id'],'name':_0x46147d[_0x5909('0x41')][_0x5909('0x3f')]};}var _0x34c6e8=md5(JSON['stringify'](_0x143c8));if(_0x46147d[_0x5909('0x4')]!==_0x34c6e8){_0x46147d[_0x5909('0x4')]=_0x34c6e8;emit(util[_0x5909('0x79')](_0x5909('0x7a'),_0x143c8[_0x5909('0x3f')]),_0x5909('0x7b'),_0x143c8);}}}function emitCampaignSummary(_0x42a790){if(_0x42a790[_0x5909('0x56')]===_0x5909('0x7c')){emit(util['format'](_0x5909('0x7d'),_0x42a790[_0x5909('0x3f')]),_0x5909('0x7e'),_0x42a790);}}function checkGetDataPredictive(_0x364748){if(isNotNull(_0x364748)&&!_[_0x5909('0x45')](_0x364748)){loggerPredictive[_0x5909('0x7f')](_0x5909('0x80'));loggerPredictive['info'](_0x5909('0x81'),_0x364748[_0x5909('0x71')]);loggerPredictive[_0x5909('0x7f')](_0x5909('0x82'),_0x364748['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x5909('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x364748[_0x5909('0x6d')]);loggerPredictive[_0x5909('0x7f')](_0x5909('0x83'),_0x364748['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x5909('0x84'),_0x364748[_0x5909('0x6b')]);loggerPredictive[_0x5909('0x7f')](_0x5909('0x85'),_0x364748['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5909('0x7f')](_0x5909('0x86'));if(_0x364748['predictiveIntervalTotalCalls']>0x0){if(!_[_0x5909('0x3b')](_0x364748['predictiveIntervalAvgTalktime'])&&_0x364748[_0x5909('0x87')]>0x0){return!![];}loggerPredictive[_0x5909('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x364748[_0x5909('0x6b')])&&_0x364748[_0x5909('0x6b')]>0x0){return!![];}loggerPredictive[_0x5909('0x7f')](_0x5909('0x88'));}else{loggerPredictive['info'](_0x5909('0x89'));}}else{loggerPredictive[_0x5909('0x7f')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x15d2ab){return function(_0x50af0f){loggerPredictive[_0x5909('0x7f')](_0x5909('0x8a'));loggerPredictive[_0x5909('0x7f')](_0x5909('0x8b'),_0x50af0f[_0x5909('0x72')]);loggerPredictive[_0x5909('0x7f')](_0x5909('0x8c'),_0x50af0f['erlangCallToSecond']);loggerPredictive[_0x5909('0x7f')](_0x5909('0x8d'),_0x50af0f['erlangAbandonmentRate']);loggerPredictive[_0x5909('0x7f')](_0x5909('0x8e'),_0x50af0f[_0x5909('0x75')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50af0f[_0x5909('0x74')]);loggerPredictive[_0x5909('0x7f')](_0x5909('0x86'));_[_0x5909('0x8f')](_0x15d2ab,_0x50af0f);};}function getDiff(_0x2cf75d){var _0xad6e88=moment()[_0x5909('0x49')](0x0);var _0x519031=moment(_0x2cf75d)[_0x5909('0x49')](0x0);return _0xad6e88['diff'](_0x519031,_0x5909('0x90'));}function ifInterval(_0x2720f3,_0x31ee4a){if(_['isUndefined'](_0x31ee4a)){return![];}return getDiff(_0x31ee4a)<_0x2720f3*0x3c;}function freeVariablesPredictive(_0x4307e8){if(isNotNull(_0x4307e8)){if(!_['isUndefined'](_0x4307e8[_0x5909('0x28')])){_0x4307e8['startProgressive']=undefined;loggerPredictive[_0x5909('0x7f')](_0x4307e8[_0x5909('0x3f')],_0x5909('0x91'));}if(!_[_0x5909('0x3b')](_0x4307e8['startPredictive'])){_0x4307e8[_0x5909('0x76')]=undefined;loggerPredictive[_0x5909('0x7f')](_0x4307e8['name'],_0x5909('0x92'));}if(!_[_0x5909('0x3b')](_0x4307e8[_0x5909('0x93')])){clearInterval(_0x4307e8[_0x5909('0x93')]);_0x4307e8[_0x5909('0x93')]=undefined;loggerPredictive['info'](_0x4307e8['name'],_0x5909('0x94'));}}}function erlangb(_0x504a81,_0x215b7f){if(_0x215b7f===0x0){return 0x0;}var _0x46592e=0x1;for(var _0x35006f=0x1;_0x35006f<=_0x215b7f;_0x35006f+=0x1){_0x46592e=0x1+_0x46592e*_0x35006f/_0x504a81;}return 0x1/_0x46592e;}function isVoiceQueueOutbound(_0x4da530){return _0x4da530===_0x5909('0x95');}function isNotPreview(_0x48b596){return _0x48b596!==_0x5909('0x20');}function isCampaignIvr(_0x359ff1){return _0x359ff1===_0x5909('0x7c');}function getCallerId(_0x726f0,_0x461b7f,_0x9c632c){if(!_[_0x5909('0x3b')](_0x9c632c)&&typeof _0x9c632c===_0x5909('0x96')&&!_[_0x5909('0x45')](_0x9c632c)){if(!_[_0x5909('0x3b')](_0x461b7f)&&typeof _0x461b7f===_0x5909('0x96')&&!_[_0x5909('0x45')](_0x461b7f)){return util[_0x5909('0x79')](_0x5909('0x97'),_0x461b7f,_0x9c632c);}return util[_0x5909('0x79')](_0x5909('0x97'),_0x9c632c,_0x9c632c);}if(!_[_0x5909('0x3b')](_0x726f0)&&typeof _0x726f0==='string'&&!_[_0x5909('0x45')](_0x726f0)){return _0x726f0;}return _0x5909('0x98');}function loggerCatchQueueSummary(_0x52271c,_0x3a5e6e){return function(_0x14d0a9){freeVariablesPredictive(_0x3a5e6e);emitVoiceQueueSummary(_0x3a5e6e);emitCampaignSummary(_0x3a5e6e);loggerSyncQueueSummary[_0x5909('0x99')](_0x52271c,util['inspect'](_0x14d0a9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x34b0eb,_0x1045ba){return function(_0x363805){loggerPredictive[_0x5909('0x99')](_0x1045ba[_0x5909('0x3f')],_0x34b0eb);loggerPredictive['error'](_0x363805['stack']);freeVariablesPredictive(_0x1045ba);};}function loggerCatch(_0x3223f4){return function(_0x26729a){logger[_0x5909('0x99')](_0x3223f4,util['inspect'](_0x26729a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xeae463){return _0xeae463&&!_['isUndefined'](_0xeae463)&&_0xeae463['length']>0x0;}function decremetOriginate(_0x418271){if(!_[_0x5909('0x3b')](_0x418271)&&_0x418271!==null){if(typeof _0x418271['originated']!==_0x5909('0x9a')){if(_0x418271[_0x5909('0x9b')]>0x0){_0x418271[_0x5909('0x9b')]-=0x1;}else{logger[_0x5909('0x99')](_0x5909('0x9c'));}}}else{logger[_0x5909('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2789ac,_0x309a02,_0x1ffd18){if(_0x309a02>_0x1ffd18){for(var _0x40b65c=0x0;_0x40b65c<_0x309a02-_0x1ffd18;_0x40b65c+=0x1){decremetOriginate(_0x2789ac);}}}function loggerGetContactDialer(_0x534928,_0x198a2c,_0x1af3b2){return function(_0xc75f7b){checkContactLowerLimitOriginate(_0x198a2c,_0x1af3b2,0x0);logger[_0x5909('0x99')](_0x534928,util[_0x5909('0x9d')](_0xc75f7b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x136dae){return function(_0x4c087b){if(isNotNull(_0x4c087b)&&isNotNull(_0x4c087b[0x0])){if(_0x4c087b[0x0][_0x5909('0x9e')]>0x0){_0x136dae[_0x5909('0x3c')]=_0x5909('0x9f');logger[_0x5909('0x7f')](_0x5909('0xa0')+_0x136dae[_0x5909('0x3f')],_0x4c087b[0x0][_0x5909('0x9e')],'contacts');}else{_0x136dae[_0x5909('0x3c')]=_0x5909('0xa1');logger['info']('[getContactDialer2][Empty]'+_0x136dae['name']);}}};}function notSendMessagesQueue(_0x508db3){if(_0x508db3[_0x5909('0xa2')]){freeVariablesPredictive(_0x508db3);if(_0x508db3[_0x5909('0x9b')]===0x0&&_0x508db3[_0x5909('0x54')]===0x0&&_0x508db3[_0x5909('0x59')]===0x0&&(_0x508db3[_0x5909('0x50')]||0x0)===0x0){_0x508db3['sendMessageOneNotActive']=![];_0x508db3[_0x5909('0x4e')]=0x0;_0x508db3[_0x5909('0x3c')]=_0x5909('0xa3');loggerSyncQueueSummary[_0x5909('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x508db3[_0x5909('0x3f')],'is\x20not\x20active');}else{_0x508db3['message']=_0x5909('0xa4');loggerSyncQueueSummary[_0x5909('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x508db3[_0x5909('0x3f')],_0x5909('0xa5'));}emitVoiceQueueSummary(_0x508db3);}}function notSendMessagesCampaign(_0x58abe3){if(_0x58abe3['sendMessageOneNotActive']){if(_0x58abe3['originated']===0x0){_0x58abe3['sendMessageOneNotActive']=![];_0x58abe3[_0x5909('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x5909('0x99')](_0x5909('0xa6'),_0x58abe3[_0x5909('0x3f')],_0x5909('0xa7'));}else{_0x58abe3['message']=_0x5909('0xa4');loggerSyncQueueSummary[_0x5909('0x99')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x58abe3[_0x5909('0x3f')],_0x5909('0xa5'));}emitCampaignSummary(_0x58abe3);}}function createObjHistory(_0x1dc27f,_0x4d9de1,_0x10db6f,_0x1a7949,_0x520780){_0x1dc27f[_0x5909('0x3c')]=_0x10db6f;var _0x249361=new Action(_0x1dc27f,_0x4d9de1);var _0x54afa4=new History(_0x249361);_0x54afa4[_0x5909('0xa8')]=_0x1a7949;_0x54afa4[_0x5909('0xa9')]=_0x520780;_0x54afa4[_0x5909('0xaa')]=_0x249361[_0x5909('0xab')];return _0x54afa4;}Dialer[_0x5909('0xac')][_0x5909('0x3a')]=function(){var _0x4806ae=this;setInterval(function(){_0x4806ae[_0x5909('0xad')](_0x4806ae[_0x5909('0xae')],_0x5909('0xaf'));_0x4806ae[_0x5909('0xad')](_0x4806ae[_0x5909('0x26')],_0x5909('0xb0'));},0x32c8);};Dialer[_0x5909('0xac')]['clearZombieChannels']=function(_0x214001,_0x570957){var _0xa1e52a=this;for(var _0x125344 in _0x214001){if(typeof _0x214001[_0x125344]!==_0x5909('0x9a')){this[_0x5909('0x1f')][_0x5909('0x1d')](function(){if(!_[_0x5909('0xb1')](_0x214001[_0x125344])){return ami[_0x5909('0xb2')]({'action':_0x5909('0xb3'),'channel':_0x214001[_0x125344]['channel']})[_0x5909('0xb4')](function(_0x18f123){if(_0x18f123[_0x5909('0x3c')]===_0x5909('0xb5')){setTimeout(function(){if(_0x214001[_0x125344]&&_0x214001[_0x125344]['type']!==_0x5909('0x7c')){_0xa1e52a[_0x5909('0xb6')](_0xa1e52a[_0x5909('0x21')][_0x214001[_0x125344][_0x5909('0xb7')]]);logger['error'](_0x5909('0xb8'),_0x570957,_0x125344,_0x214001[_0x125344][_0x5909('0xb7')]);delete _0x214001[_0x125344];}if(_0x214001[_0x125344]&&_0x214001[_0x125344][_0x5909('0x56')]===_0x5909('0x7c')){_0xa1e52a['updateOriginated'](_0xa1e52a[_0x5909('0xb9')][_0x214001[_0x125344][_0x5909('0xb7')]]);logger[_0x5909('0x99')]('[Dialer][checkChannel][ivr]',_0x570957,_0x125344,_0x214001[_0x125344]['queue']);delete _0x214001[_0x125344];}},0x2328);}});}});}}};Dialer[_0x5909('0xac')]['countReScheduled']=function(_0x5bcdb6){return BPromise[_0x5909('0xba')]()['then'](cmHopper[_0x5909('0xbb')](_0x5bcdb6))[_0x5909('0xb4')](loggerCatch(_0x5909('0xbc')));};Dialer[_0x5909('0xac')][_0x5909('0xbd')]=function(_0x3ab0a7){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopperBlack[_0x5909('0xbd')](_0x3ab0a7))[_0x5909('0xb4')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0x5909('0xbf')]=function(_0x3a2c7a){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopperBlack['checkIsBlackListIvr'](_0x3a2c7a))[_0x5909('0xb4')](loggerCatch(_0x5909('0xc0')));};Dialer[_0x5909('0xac')][_0x5909('0xc1')]=function(_0xc734db){return BPromise['resolve']()[_0x5909('0xbe')](cmHopperHistory[_0x5909('0xc2')](_0xc734db))[_0x5909('0xb4')](loggerCatch(_0x5909('0xc3')));};Dialer[_0x5909('0xac')][_0x5909('0xc4')]=function(_0xa867c8){return BPromise['resolve']()[_0x5909('0xbe')](cmHopper[_0x5909('0xc4')](_0xa867c8))[_0x5909('0xb4')](loggerCatch(_0x5909('0xc5')));};Dialer[_0x5909('0xac')]['unlockContact']=function(_0x8f7ea2,_0x822048,_0x3c5f09){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopper[_0x5909('0xc6')](_0x8f7ea2,_0x822048,_0x3c5f09))[_0x5909('0xb4')](loggerCatch(_0x5909('0xc7')));};Dialer[_0x5909('0xac')][_0x5909('0xc8')]=function(_0x26a4c7,_0x32f420,_0x54b214,_0x177e0d,_0x313d76){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopper[_0x5909('0xc8')](_0x26a4c7,_0x32f420,_0x54b214,_0x177e0d))[_0x5909('0xb4')](function(_0x3edb5f){_0x313d76[_0x5909('0xc9')]-=_0x54b214;_0x313d76['temp']=_0x313d76[_0x5909('0xc9')]>0x0?_0x313d76[_0x5909('0xc9')]:0x0;loggerCatch(_0x5909('0xca'))(_0x3edb5f);});};Dialer[_0x5909('0xac')]['getContactDialerIvr']=function(_0x59bf15,_0x25e766,_0x4e938d,_0x4b0d57){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopper[_0x5909('0xcb')](_0x59bf15,_0x25e766,_0x4e938d))['catch'](function(_0x201c8b){_0x4b0d57[_0x5909('0xc9')]-=_0x25e766;_0x4b0d57['temp']=_0x4b0d57[_0x5909('0xc9')]>0x0?_0x4b0d57[_0x5909('0xc9')]:0x0;loggerCatch(_0x5909('0xcc'))(_0x201c8b);});};Dialer[_0x5909('0xac')][_0x5909('0xcd')]=function(_0x56601b){return BPromise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x56601b))[_0x5909('0xb4')](loggerCatch(_0x5909('0xce')));};Dialer[_0x5909('0xac')]['moveContactManagedDialer']=function(_0x446ae7){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopper[_0x5909('0xcf')](_0x446ae7))[_0x5909('0xb4')](loggerCatch(_0x5909('0xd0')));};Dialer[_0x5909('0xac')]['createHistory']=function(_0x37e9a4){return BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](cmHopperHistory[_0x5909('0xd1')](_0x37e9a4))[_0x5909('0xb4')](loggerCatch(_0x5909('0xd2')));};Dialer['prototype']['updateOriginated']=function(_0x15b00f){if(!_['isUndefined'](_0x15b00f)&&_0x15b00f!==null){if(typeof _0x15b00f[_0x5909('0x9b')]!==_0x5909('0x9a')){if(_0x15b00f[_0x5909('0x9b')]>0x0){_0x15b00f[_0x5909('0x9b')]-=0x1;}else{logger['error'](_0x5909('0xd3'));}}}else{logger[_0x5909('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5909('0xac')][_0x5909('0xd4')]=function(_0x1fceca,_0x24d075){var _0xbc946a=this;return function(_0x59e5af){_0xbc946a[_0x5909('0xb6')](_0x24d075);logger[_0x5909('0x99')](_0x1fceca,util[_0x5909('0x9d')](_0x59e5af,{'showHidden':![],'depth':null}));};};Dialer[_0x5909('0xac')][_0x5909('0xd5')]=function(_0x15aba3,_0x4fb10e,_0x19c601){var _0x121bd5={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x4fb10e);this[_0x5909('0xd6')](_[_0x5909('0x8f')](_0x121bd5,_[_0x5909('0xd7')](_0x19c601,['ContactId',_0x5909('0xd8'),_0x5909('0xd9'),_0x5909('0xda'),_0x5909('0xdb')])),_0x5909('0xdc'),'[emptyContact]');logger['error'](_0x15aba3);};Dialer[_0x5909('0xac')]['isSuccess']=function(_0x12c8dc){return _0x12c8dc===_0x5909('0xdd');};Dialer[_0x5909('0xac')][_0x5909('0xde')]=function(_0x247cae){return!_['isUndefined'](_0x247cae)&&_0x247cae&&!_['isUndefined'](_0x247cae[_0x5909('0x3f')])&&!_[_0x5909('0x3b')](_0x247cae[_0x5909('0xdf')])&&_0x247cae[_0x5909('0xdf')]&&(this[_0x5909('0x23')][util['format'](_0x5909('0xe0'),_0x247cae['name'])][_0x5909('0xb3')]===_0x5909('0xe1')||this['trunks'][util[_0x5909('0x79')](_0x5909('0xe0'),_0x247cae[_0x5909('0x3f')])][_0x5909('0xb3')]===_0x5909('0xe2'));};Dialer[_0x5909('0xac')][_0x5909('0xd6')]=function(_0x378c1d,_0x39573e,_0x146e72){this[_0x5909('0xd1')](_0x378c1d)['catch'](loggerCatch(_0x39573e));this[_0x5909('0xcf')](_0x378c1d)['catch'](loggerCatch(_0x146e72));};Dialer['prototype']['syncVarSet']=function(_0x35b231){var _0x209b9b=this[_0x5909('0xae')][_0x35b231[_0x5909('0xe3')]];var _0x53cb6d;if(!_['isNil'](_0x35b231)&&!_[_0x5909('0xb1')](_0x35b231[_0x5909('0xe4')])&&!_[_0x5909('0xb1')](_0x35b231[_0x5909('0xe4')]['amdstatus'])&&_0x35b231[_0x5909('0xe5')]===_0x5909('0xe6')&&_0x209b9b){if(_0x209b9b['type']!==_0x5909('0x7c')&&this['voiceQueues'][_0x209b9b[_0x5909('0xb7')]]['dialAMDActive']&&_0x35b231['value']==='HANGUP'){delete this[_0x5909('0xae')][_0x35b231[_0x5909('0xe3')]];this[_0x5909('0xb6')](this[_0x5909('0x21')][_0x209b9b[_0x5909('0xb7')]]);this[_0x5909('0x21')][_0x209b9b['queue']][_0x5909('0xe7')]+=0x1;this[_0x5909('0x21')][_0x209b9b[_0x5909('0xb7')]][_0x5909('0x60')]+=0x1;_0x53cb6d=new Hangup(_0x209b9b,_0x35b231);_0x53cb6d[_0x5909('0xa8')]=0x12;_0x53cb6d[_0x5909('0xa9')]='HangupInAMD';_0x53cb6d[_0x5909('0xe8')]=_0x5909('0xe9');ami[_0x5909('0x4b')](_0x5909('0xea'),ut[_0x5909('0xeb')](_0x53cb6d,'amd'));this[_0x5909('0xd6')](_0x53cb6d,_0x5909('0xec'),'[syncHangupInAMD]');}if(_0x209b9b['type']!==_0x5909('0x7c')&&this[_0x5909('0x21')][_0x209b9b[_0x5909('0xb7')]][_0x5909('0xed')]&&_0x35b231[_0x5909('0xee')]==='MACHINE'){var _0x2ac2b3=this;return new BPromise(function(_0xe66838,_0x1bba05){delete _0x2ac2b3[_0x5909('0xae')][_0x35b231[_0x5909('0xe3')]];_0x2ac2b3[_0x5909('0xb6')](_0x2ac2b3[_0x5909('0x21')][_0x209b9b['queue']]);_0x2ac2b3[_0x5909('0x21')][_0x209b9b[_0x5909('0xb7')]][_0x5909('0xe7')]+=0x1;_0x2ac2b3['voiceQueues'][_0x209b9b[_0x5909('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x500aee=_0x2ac2b3[_0x5909('0x21')][_0x209b9b[_0x5909('0xb7')]];var _0x334850=new Hangup(_0x209b9b,_0x35b231);_0x334850[_0x5909('0xa8')]=0x13;_0x334850[_0x5909('0xa9')]=_0x5909('0xef');_0x334850['membername']=_0x5909('0xe9');_0x334850[_0x5909('0xf0')]+=0x1;_0x334850[_0x5909('0xf1')]+=0x1;_0x334850[_0x5909('0xf2')]=!![];ami[_0x5909('0x4b')](_0x5909('0xea'),ut[_0x5909('0xeb')](_0x334850,_0x5909('0xf2')));_0x2ac2b3[_0x5909('0xd1')](_0x334850)[_0x5909('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x334850['countbusyretry']+_0x334850[_0x5909('0xf3')]+_0x334850[_0x5909('0xf4')]+_0x334850['countnosuchnumberretry']+_0x334850[_0x5909('0xf5')]+_0x334850[_0x5909('0xf6')]+_0x334850['countmachineretry']+_0x334850[_0x5909('0xf7')]>=_0x500aee[_0x5909('0xf8')]){_0x2ac2b3[_0x5909('0xf9')](_0x334850,_0xe66838,_0x1bba05,_0x5909('0xfa'));}else{if(_0x334850[_0x5909('0xf0')]>=_0x500aee[_0x5909('0xfb')]){_0x2ac2b3[_0x5909('0xfc')](_0x334850,_0xe66838,_0x1bba05,_0x5909('0xfd'));}else{_0x2ac2b3[_0x5909('0xc4')]({'active':![],'countmachineretry':_0x334850['countmachineretry'],'scheduledat':moment()[_0x5909('0xfe')](_0x500aee[_0x5909('0xff')],_0x5909('0x100'))[_0x5909('0x79')](_0x5909('0x101')),'ContactId':_0x334850[_0x5909('0x102')],'ListId':_0x334850[_0x5909('0xd8')],'VoiceQueueId':_0x334850['VoiceQueueId']||undefined,'CampaignId':_0x334850['CampaignId']||undefined})[_0x5909('0xb4')](loggerCatch('[rescheduleContact][Machine]'));_0xe66838({'reschedule':0x1});}}});}if(_0x209b9b[_0x5909('0x56')]===_0x5909('0x7c')&&this[_0x5909('0xb9')][_0x209b9b['queue']][_0x5909('0xed')]&&_0x35b231[_0x5909('0xee')]==='HANGUP'){delete this[_0x5909('0xae')][_0x35b231[_0x5909('0xe3')]];this[_0x5909('0xb6')](this['campaigns'][_0x209b9b[_0x5909('0xb7')]]);_0x53cb6d=new Hangup(_0x209b9b,_0x35b231);_0x53cb6d[_0x5909('0xa8')]=0x12;_0x53cb6d[_0x5909('0xa9')]=_0x5909('0x103');_0x53cb6d[_0x5909('0xe8')]=_0x5909('0xe9');ami['emit'](_0x5909('0xea'),ut[_0x5909('0xeb')](_0x53cb6d,_0x5909('0xf2')));this[_0x5909('0xd6')](_0x53cb6d,_0x5909('0x104'),'[syncHangupInAMDIvr]');}if(_0x209b9b[_0x5909('0x56')]==='ivr'&&this[_0x5909('0xb9')][_0x209b9b[_0x5909('0xb7')]]['dialAMDActive']&&_0x35b231[_0x5909('0xee')]===_0x5909('0x105')){var _0x2ac2b3=this;return new BPromise(function(_0x15ffd7,_0x108a0a){delete _0x2ac2b3[_0x5909('0xae')][_0x35b231[_0x5909('0xe3')]];_0x2ac2b3[_0x5909('0xb6')](_0x2ac2b3[_0x5909('0xb9')][_0x209b9b['queue']]);_0x2ac2b3['campaigns'][_0x209b9b[_0x5909('0xb7')]][_0x5909('0xe7')]+=0x1;_0x2ac2b3[_0x5909('0xb9')][_0x209b9b[_0x5909('0xb7')]][_0x5909('0x60')]+=0x1;var _0x395cb2=_0x2ac2b3[_0x5909('0xb9')][_0x209b9b[_0x5909('0xb7')]];var _0x31dbd7=new Hangup(_0x209b9b,_0x35b231);_0x31dbd7[_0x5909('0xa8')]=0x13;_0x31dbd7['statedesc']=_0x5909('0xef');_0x31dbd7[_0x5909('0xe8')]=_0x5909('0xe9');_0x31dbd7['countmachineretry']+=0x1;_0x31dbd7[_0x5909('0xf1')]+=0x1;_0x31dbd7[_0x5909('0xf2')]=!![];ami[_0x5909('0x4b')]('custom:amd',ut[_0x5909('0xeb')](_0x31dbd7,_0x5909('0xf2')));_0x2ac2b3[_0x5909('0xd1')](_0x31dbd7)[_0x5909('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x31dbd7['countbusyretry']+_0x31dbd7[_0x5909('0xf3')]+_0x31dbd7[_0x5909('0xf4')]+_0x31dbd7[_0x5909('0x106')]+_0x31dbd7[_0x5909('0xf5')]+_0x31dbd7[_0x5909('0xf6')]+_0x31dbd7['countmachineretry']+_0x31dbd7[_0x5909('0xf7')]>=_0x395cb2[_0x5909('0xf8')]){_0x2ac2b3['stateGlobal'](_0x31dbd7,_0x15ffd7,_0x108a0a,_0x5909('0xfa'));}else{if(_0x31dbd7[_0x5909('0xf0')]>=_0x395cb2[_0x5909('0xfb')]){_0x2ac2b3[_0x5909('0xfc')](_0x31dbd7,_0x15ffd7,_0x108a0a,'reason\x2019\x20machine....');}else{_0x2ac2b3[_0x5909('0xc4')]({'active':![],'countmachineretry':_0x31dbd7[_0x5909('0xf0')],'scheduledat':moment()[_0x5909('0xfe')](_0x395cb2[_0x5909('0xff')],_0x5909('0x100'))['format'](_0x5909('0x101')),'ContactId':_0x31dbd7[_0x5909('0x102')],'ListId':_0x31dbd7['ListId'],'VoiceQueueId':_0x31dbd7[_0x5909('0xda')]||undefined,'CampaignId':_0x31dbd7['CampaignId']||undefined})[_0x5909('0xb4')](loggerCatch('[rescheduleContact][Machine]'));_0x15ffd7({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x5909('0x35')]=function(_0x22ced1){var _0x3acd84=this[_0x5909('0xae')][_0x22ced1[_0x5909('0xe3')]];var _0x382db9=this;var _0x25b93f;if(_0x3acd84&&_0x3acd84[_0x5909('0x56')]===_0x5909('0x7c')){delete this['uniqueId'][_0x22ced1[_0x5909('0xe3')]];this[_0x5909('0xb6')](this[_0x5909('0xb9')][_0x3acd84[_0x5909('0xb7')]]);this[_0x5909('0xb9')][_0x3acd84[_0x5909('0xb7')]][_0x5909('0x107')]+=0x1;_0x25b93f=new Hangup(_0x3acd84,_0x22ced1);this[_0x5909('0xd1')](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x108')));this['moveContactManagedDialer'](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x109')));}if(_0x3acd84&&_0x3acd84[_0x5909('0x56')]!==_0x5909('0x7c')&&isNotNull(this['voiceQueues'][_0x3acd84[_0x5909('0xb7')]][_0x5909('0x10a')])){delete this[_0x5909('0xae')][_0x22ced1[_0x5909('0xe3')]];this[_0x5909('0xb6')](this[_0x5909('0x21')][_0x3acd84[_0x5909('0xb7')]]);this[_0x5909('0x21')][_0x3acd84[_0x5909('0xb7')]][_0x5909('0xe7')]+=0x1;this['voiceQueues'][_0x3acd84['queue']][_0x5909('0x60')]+=0x1;_0x25b93f=new Hangup(_0x3acd84,_0x22ced1);_0x25b93f[_0x5909('0xa8')]=0x10;_0x25b93f['statedesc']=_0x5909('0x10b');_0x25b93f[_0x5909('0xe8')]=_0x5909('0x10c');this[_0x5909('0xd1')](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x108')));this[_0x5909('0xcf')](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x109')));}if(_0x3acd84&&_0x3acd84[_0x5909('0x56')]!==_0x5909('0x7c')&&!isNotNull(this[_0x5909('0x21')][_0x3acd84['queue']][_0x5909('0x10a')])){delete this[_0x5909('0xae')][_0x22ced1[_0x5909('0xe3')]];this[_0x5909('0xb6')](this[_0x5909('0x21')][_0x3acd84[_0x5909('0xb7')]]);this[_0x5909('0x21')][_0x3acd84[_0x5909('0xb7')]][_0x5909('0x10d')]+=0x1;_0x25b93f=new Hangup(_0x3acd84,_0x22ced1);_0x25b93f[_0x5909('0xa8')]=0xc;_0x25b93f['statedesc']=_0x22ced1[_0x5909('0x10e')];_0x25b93f[_0x5909('0xe8')]=_0x5909('0x10f');this[_0x5909('0xd1')](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x108')));this[_0x5909('0xcf')](_0x25b93f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x109')));}};Dialer[_0x5909('0xac')]['syncAgentComplete']=function(_0x136488){var _0x39717e=this['uniqueId'][_0x136488[_0x5909('0xe3')]];var _0x21d9d4=this;if(this[_0x5909('0x21')][_0x136488[_0x5909('0xb7')]]){if(_0x39717e&&_0x39717e[_0x5909('0x56')]!=='ivr'){delete this['uniqueId'][_0x136488[_0x5909('0xe3')]];this['voiceQueues'][_0x136488[_0x5909('0xb7')]][_0x5909('0xe7')]+=0x1;var _0x11480f=new AgentComplete(_0x39717e,_0x136488);if(_0x136488['reason']===_0x5909('0x110')){_0x11480f[_0x5909('0x111')]=this[_0x5909('0x21')][_0x136488[_0x5909('0xb7')]]['dialQueueProject2']&&this[_0x5909('0x21')][_0x136488[_0x5909('0xb7')]][_0x5909('0x112')]?moment()[_0x5909('0x79')](_0x5909('0x101')):undefined;}this[_0x5909('0xd1')](_0x11480f)[_0x5909('0xb4')](loggerCatch(_0x5909('0x113')));this[_0x5909('0xcf')](_0x11480f)[_0x5909('0xb4')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x5909('0xac')][_0x5909('0x2c')]=function(_0x26cbc4){if(this['voiceQueues'][_0x26cbc4[_0x5909('0xb7')]]){if(this[_0x5909('0xae')][_0x26cbc4[_0x5909('0xe3')]]&&this[_0x5909('0xae')][_0x26cbc4[_0x5909('0xe3')]][_0x5909('0x56')]!==_0x5909('0x7c')){this[_0x5909('0xb6')](this[_0x5909('0x21')][_0x26cbc4['queue']]);this[_0x5909('0xae')][_0x26cbc4[_0x5909('0xe3')]][_0x5909('0x114')]=moment()['format'](_0x5909('0x101'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4e70da){this[_0x5909('0xd1')](_0x4e70da)[_0x5909('0xb4')](loggerCatch(_0x5909('0x113')));this[_0x5909('0xcf')](_0x4e70da)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x5909('0x2e')]=function(_0xbb0cf1){var _0x4deee8=this[_0x5909('0xae')][_0xbb0cf1[_0x5909('0xe3')]];var _0x521b34=this;if(this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]]){if(_0x4deee8&&_0x4deee8[_0x5909('0x56')]!=='ivr'){delete this[_0x5909('0xae')][_0xbb0cf1['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0xbb0cf1[_0x5909('0xb7')]]);_0x4deee8[_0x5909('0x115')]=moment()[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x525948=new QueueCallerAbandon(_0x4deee8,_0xbb0cf1);if(getSeconds(_0x4deee8[_0x5909('0x115')],_0x4deee8['responsetime'])>=_0x4deee8['dialQueueTimeout']){this[_0x5909('0x21')][_0xbb0cf1['queue']][_0x5909('0x6d')]+=0x1;this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]][_0x5909('0x6e')]+=0x1;_0x525948['state']=0xa;_0x525948[_0x5909('0xa9')]='Drop';_0x525948[_0x5909('0x116')]='TIMEOUT';_0x525948[_0x5909('0x111')]=this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]][_0x5909('0x117')]?moment()[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x525948[_0x5909('0xf5')]+=0x1;_0x525948[_0x5909('0xf1')]+=0x1;if(_0x525948['countdropretry']>=this['voiceQueues'][_0xbb0cf1[_0x5909('0xb7')]]['dialDropMaxRetry']){this[_0x5909('0x118')](_0x525948);}else{this[_0x5909('0xc4')]({'active':![],'countdropretry':_0x525948['countdropretry'],'scheduledat':moment()[_0x5909('0xfe')](this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]][_0x5909('0x119')],_0x5909('0x100'))[_0x5909('0x79')](_0x5909('0x101')),'ContactId':_0x4deee8['ContactId'],'ListId':_0x4deee8['ListId'],'VoiceQueueId':_0x4deee8['VoiceQueueId']||undefined,'CampaignId':_0x4deee8['CampaignId']||undefined})[_0x5909('0xb4')](loggerCatch('[rescheduleContact][Drop]'));var _0x2950d5=new History(_0x525948);_0x2950d5[_0x5909('0xa8')]=0xa;_0x2950d5[_0x5909('0xa9')]='Drop';_0x2950d5[_0x5909('0xab')]=moment()['format'](_0x5909('0x101'));_0x2950d5[_0x5909('0xaa')]=_0x2950d5[_0x5909('0xab')];_0x2950d5[_0x5909('0x11a')]=_0x525948[_0x5909('0x11a')];_0x2950d5['calleridnum']=_0x525948['calleridnum'];this[_0x5909('0xd1')](_0x2950d5)[_0x5909('0xb4')](loggerCatch(_0x5909('0x11b')));}}else{this['voiceQueues'][_0xbb0cf1[_0x5909('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5909('0x21')][_0xbb0cf1['queue']][_0x5909('0x65')]+=0x1;_0x525948['state']=0xb;_0x525948['statedesc']=_0x5909('0x11c');_0x525948[_0x5909('0x116')]='CALLEREXIT';_0x525948[_0x5909('0xf6')]+=0x1;_0x525948[_0x5909('0xf1')]+=0x1;if(_0x525948[_0x5909('0xf6')]>=this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]][_0x5909('0x11d')]){this['queueCallerAbandonCreateState'](_0x525948);}else{this[_0x5909('0xc4')]({'active':![],'countabandonedretry':_0x525948[_0x5909('0xf6')],'scheduledat':moment()[_0x5909('0xfe')](this[_0x5909('0x21')][_0xbb0cf1[_0x5909('0xb7')]]['dialAbandonedRetryFrequency'],'minutes')[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4deee8[_0x5909('0x102')],'ListId':_0x4deee8[_0x5909('0xd8')],'VoiceQueueId':_0x4deee8[_0x5909('0xda')]||undefined,'CampaignId':_0x4deee8['CampaignId']||undefined})['catch'](loggerCatch(_0x5909('0x11e')));var _0x2950d5=new History(_0x525948);_0x2950d5['state']=0xb;_0x2950d5[_0x5909('0xa9')]='Abandoned';_0x2950d5[_0x5909('0xab')]=moment()[_0x5909('0x79')](_0x5909('0x101'));_0x2950d5['endtime']=_0x2950d5[_0x5909('0xab')];_0x2950d5[_0x5909('0x11a')]=_0x525948[_0x5909('0x11a')];_0x2950d5[_0x5909('0x11f')]=_0x525948[_0x5909('0x11f')];this[_0x5909('0xd1')](_0x2950d5)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype']['syncNewExten']=function(_0xa4278){if(this[_0x5909('0x26')][_0xa4278[_0x5909('0xe3')]]){this[_0x5909('0x26')][_0xa4278['uniqueid']]['channel']=_0xa4278[_0x5909('0x120')];}if(this[_0x5909('0xae')][_0xa4278[_0x5909('0xe3')]]){this[_0x5909('0xae')][_0xa4278[_0x5909('0xe3')]]['channel']=_0xa4278[_0x5909('0x120')];}};Dialer[_0x5909('0xac')][_0x5909('0x37')]=function(_0x28660f){if(strategy[this['voiceQueues'][this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0xb7')]]['strategy']]===_0x5909('0x1c')){if(this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]]&&_['isNil'](this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0x122')])&&_0x28660f[_0x5909('0xb3')]==='1'&&_0x28660f[_0x5909('0x123')]==='0'){if(this[_0x5909('0x22')][_0x28660f[_0x5909('0x124')]]){if(!this[_0x5909('0x22')][_0x28660f[_0x5909('0x124')]][_0x5909('0x122')]){this['agents'][_0x28660f[_0x5909('0x124')]][_0x5909('0x122')]=!![];this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0x122')]=!![];this[_0x5909('0x26')][_0x28660f['actionid']]['stateinterface']=_0x28660f[_0x5909('0x124')];}}}}else if((strategy[this[_0x5909('0x21')][this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0xb7')]]['strategy']]||_0x5909('0x1b'))===_0x5909('0x1b')){if(this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]]){if(this[_0x5909('0x22')][_0x28660f['stateinterface']]){this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0x124')]=_0x28660f[_0x5909('0x124')];if(_[_0x5909('0xb1')](this[_0x5909('0x29')][this[_0x5909('0x26')][_0x28660f[_0x5909('0x121')]][_0x5909('0xb7')]])){this['queueBooked'][this['actions'][_0x28660f[_0x5909('0x121')]][_0x5909('0xb7')]]=[];}this[_0x5909('0x29')][this[_0x5909('0x26')][_0x28660f['actionid']][_0x5909('0xb7')]][_0x5909('0x125')](_[_0x5909('0x8f')](_[_0x5909('0xd7')](this[_0x5909('0x26')][_0x28660f['actionid']],[_0x5909('0x126'),_0x5909('0x124')]),{'status':_0x28660f[_0x5909('0xb3')],'paused':_0x28660f[_0x5909('0x123')]}));}}}};function unlockQueueStatus(_0x37a539,_0x54d5e1){setTimeout(function(){if(_[_0x5909('0x3b')](_0x37a539[_0x5909('0x127')])){loggerBooked[_0x5909('0x99')](_0x5909('0x128'),_0x54d5e1);}_0x37a539[_0x5909('0x127')]=!![];loggerBooked['info'](_0x5909('0x129'),_0x54d5e1,JSON[_0x5909('0x48')](_['pick'](_0x37a539,[_0x5909('0x3f'),_0x5909('0x127')])));},0x1f3);}Dialer[_0x5909('0xac')][_0x5909('0x38')]=function(_0x5903ae){var _0x435ba3=this;var _0x364e6d=_0x435ba3[_0x5909('0x21')][_0x435ba3[_0x5909('0x26')][_0x5903ae['actionid']]['queue']];if(strategy[this[_0x5909('0x21')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]][_0x5909('0x4c')]]===_0x5909('0x1c')){if(this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]&&this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0x124')]){this[_0x5909('0x20')]['run'](this[_0x5909('0x26')][_0x5903ae['actionid']][_0x5909('0x126')],this['actions'][_0x5903ae[_0x5909('0x121')]][_0x5909('0x124')])[_0x5909('0xb4')](function(_0x2590c5){logger[_0x5909('0x99')](_0x5909('0x12a'),util[_0x5909('0x9d')](_0x2590c5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x435ba3[_0x5909('0xb6')](_0x435ba3[_0x5909('0x21')][_0x435ba3[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]['queue']]);_0x435ba3['agents'][_0x435ba3[_0x5909('0x26')][_0x5903ae['actionid']][_0x5909('0x124')]]['locked']=![];delete _0x435ba3['actions'][_0x5903ae['actionid']];unlockQueueStatus(_0x364e6d);});}else{this[_0x5909('0xb6')](this[_0x5909('0x21')][this[_0x5909('0x26')][_0x5903ae['actionid']]['queue']]);this[_0x5909('0xc4')]({'active':![],'ContactId':this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0x102')],'ListId':this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]['ListId'],'VoiceQueueId':this['actions'][_0x5903ae[_0x5909('0x121')]][_0x5909('0xda')]||undefined,'CampaignId':this['actions'][_0x5903ae['actionid']]['CampaignId']||undefined})[_0x5909('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]];unlockQueueStatus(_0x364e6d);}}else if((strategy[this[_0x5909('0x21')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]][_0x5909('0x4c')]]||_0x5909('0x1b'))===_0x5909('0x1b')){var _0x4b464e;if(this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]&&!_[_0x5909('0x45')](this[_0x5909('0x29')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]])){if(this['queueBookedRR'][_0x435ba3[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]]){this[_0x5909('0x2a')][_0x435ba3['actions'][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]]=this[_0x5909('0x2a')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]]?this[_0x5909('0x2a')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]['queue']]:this[_0x5909('0x29')][this[_0x5909('0x26')][_0x5903ae['actionid']][_0x5909('0xb7')]]?this[_0x5909('0x29')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]['queue']][_0x5909('0x12b')]||0x0:0x0;}this['queueBooked'][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]][_0x5909('0xb7')]][_0x5909('0x12b')]=this[_0x5909('0x2a')][this[_0x5909('0x26')][_0x5903ae[_0x5909('0x121')]]['queue']];for(var _0x5c1496=0x0;_0x5c1496=0x0;})[_0x5909('0xb4')](myreject(_0x5ace80)));}}else{_0x272d9b[_0x5909('0x125')](ami['Action']({'action':_0x5909('0x146'),'command':util[_0x5909('0x79')](_0x5909('0x149'),_0x239aef,!_[_0x5909('0x3b')](config[_0x5909('0x142')][_0x37ed03])?_0x37ed03:'')})['then'](function(_0x25a8e7){return _0x25a8e7[_0x5909('0x14a')][_0x5909('0x14b')](_0x5909('0x148'))>=0x0;})[_0x5909('0xb4')](myreject(_0x5ace80)));}BPromise['all'](_0x272d9b)[_0x5909('0xbe')](function(_0x9421c5){var _0x3d6b4e=_[_0x5909('0x14c')](_0x9421c5);if(_0x3d6b4e){return _0xad99ca(_0x3d6b4e);}else{_0x398de2['message']=_0x1bbaf7?_0x5909('0x14d'):_0x5909('0x14e');return _0x5ace80(msgResponse('[ifTime][promiseAll]',_0x5909('0x13f'),_0x5909('0x14f')+_0x1bbaf7+'\x20'+_0x96240+_0x5909('0x150')+util[_0x5909('0x9d')](_0x239aef,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x37ed03));}})[_0x5909('0xb4')](function(_0x4a5fbe){return _0x5ace80(msgResponse(_0x5909('0x13d'),_0x5909('0x13f'),JSON['stringify'](_0x4a5fbe)));});});};Dialer[_0x5909('0xac')][_0x5909('0x151')]=function(_0x57cfbb){var _0x1b1fc4=this;return function(){switch(_0x57cfbb[_0x5909('0x5c')]){case'progressive':freeVariablesPredictive(_0x57cfbb);_0x1b1fc4['handlePower'](_0x57cfbb,0x1);break;case _0x5909('0x152'):freeVariablesPredictive(_0x57cfbb);_0x1b1fc4[_0x5909('0x153')](_0x57cfbb,_0x57cfbb['dialPowerLevel']);break;case'predictive':_0x1b1fc4['predictive'](_0x57cfbb);break;case _0x5909('0xa'):freeVariablesPredictive(_0x57cfbb);_0x1b1fc4[_0x5909('0x153')](_0x57cfbb,0x1);break;default:freeVariablesPredictive(_0x57cfbb);logger[_0x5909('0x99')](_0x5909('0x154'),_0x57cfbb[_0x5909('0x3f')],_0x5909('0x155'));}};};Dialer[_0x5909('0xac')][_0x5909('0x156')]=function(_0x430a66){var _0x31f3cb=this;return function(){_0x31f3cb['handleIvr'](_0x430a66);};};Dialer[_0x5909('0xac')][_0x5909('0xc')]=function(_0x2be346){var _0x31ea8b=this;if(isNotPreview(_0x2be346['dialMethod'])){if(isVoiceQueueOutbound(_0x2be346[_0x5909('0x56')])&&isActive(_0x2be346['dialActive'])){_0x2be346[_0x5909('0xa2')]=!![];BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](checkIsLoggedIn(_0x2be346,_0x2be346[_0x5909('0x4f')]))[_0x5909('0xbe')](checkIsActive(_0x2be346,_0x2be346[_0x5909('0x5b')]))['then'](checkInterval(_0x2be346))[_0x5909('0xbe')](_0x31ea8b[_0x5909('0x13a')](_0x2be346))['then'](_0x31ea8b[_0x5909('0x13c')](_0x2be346[_0x5909('0x157')],_0x2be346[_0x5909('0x158')],_0x2be346[_0x5909('0x3f')],_0x2be346))[_0x5909('0xbe')](_0x31ea8b[_0x5909('0x13e')](_0x2be346[_0x5909('0x41')],_0x2be346[_0x5909('0x158')],_0x2be346[_0x5909('0x3f')],_0x2be346))[_0x5909('0xbe')](_0x31ea8b[_0x5909('0x151')](_0x2be346))[_0x5909('0xb4')](loggerCatchQueueSummary('[syncQueueSummary]',_0x2be346));}else{notSendMessagesQueue(_0x2be346);}}else{freeVariablesPredictive(_0x2be346);}};Dialer['prototype'][_0x5909('0x139')]=function(){var _0x3f7f80=this;var _0x191739;for(var _0x510ebb in this[_0x5909('0xb9')]){if(typeof this['campaigns'][_0x510ebb]!==_0x5909('0x9a')){_0x191739=this[_0x5909('0xb9')][_0x510ebb];if(isCampaignIvr(_0x191739[_0x5909('0x56')])&&isActive(_0x191739[_0x5909('0xdf')])){_0x191739[_0x5909('0xa2')]=!![];BPromise[_0x5909('0xba')]()[_0x5909('0xbe')](checkIsActive(_0x191739,_0x191739['active']))[_0x5909('0xbe')](checkInterval(_0x191739))[_0x5909('0xbe')](_0x3f7f80[_0x5909('0x13a')](_0x191739))[_0x5909('0xbe')](_0x3f7f80[_0x5909('0x13c')](_0x191739[_0x5909('0x157')],_0x191739[_0x5909('0x158')],_0x191739[_0x5909('0x3f')],_0x191739))[_0x5909('0xbe')](_0x3f7f80[_0x5909('0x13e')](_0x191739['Interval'],_0x191739[_0x5909('0x158')],_0x191739[_0x5909('0x3f')],_0x191739))['then'](_0x3f7f80[_0x5909('0x156')](_0x191739))[_0x5909('0xb4')](loggerCatchQueueSummary(_0x5909('0x159'),_0x191739));}else{notSendMessagesCampaign(_0x191739);}}}};function getCallerIdRandom(_0x4a0192,_0x454970){var _0x2f6ec9;var _0x2e1e9e;var _0x9cd659;if(_0x454970<=0x0){_0x454970=0x1;}_0x2f6ec9=new RegExp(_0x5909('0x15a')+_0x454970+'}$');_0x2e1e9e=Math[_0x5909('0x15b')](0xa,_0x454970-0x1);_0x9cd659=Math['pow'](0xa,_0x454970)-0x1;return util[_0x5909('0x79')]('%s',_['replace'](_0x4a0192,_0x2f6ec9,_[_0x5909('0x15c')](_0x2e1e9e,_0x9cd659)));}function extractCalleridName(_0x296f25){var _0x352060=_0x296f25[_0x5909('0x15d')](/"(.*?)"/);return _0x352060?_0x352060[0x1]:_0x296f25;}function extractCalleridNumber(_0x214437){var _0x24c288=_0x214437[_0x5909('0x15d')](/<(.*?)>/);return _0x24c288?_0x24c288[0x1]:_0x214437;}Dialer['prototype'][_0x5909('0x15e')]=function(_0x4623a3,_0x4ac856){var _0x3fcf40=this;var _0x56ea4d=uuid['v4']();this[_0x5909('0x26')][_0x56ea4d]=new Action(_0x4623a3,_0x4ac856,_0x56ea4d);return new BPromise(function(_0xb03d55,_0x4ec5fb){if(_['isUndefined'](_0x4623a3)&&typeof _0x4623a3!==_0x5909('0x15f')){return _0x4ec5fb(msgResponse(_0x5909('0x160'),_0x5909('0x13f'),_0x5909('0x161')));}if(_[_0x5909('0x3b')](_0x4ac856[_0x5909('0x162')]['phone'])||_0x4ac856['Contact'][_0x5909('0x163')]===null){return _0x4ec5fb(msgResponse(_0x5909('0x160'),_0x5909('0x13f'),'contact\x20is\x20undefine'));}var _0x27f717={'XMD-CALLERID':_0x3fcf40['actions'][_0x56ea4d][_0x5909('0x164')](),'XMD-AGI':_0x4623a3[_0x5909('0x10a')]?util[_0x5909('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4623a3[_0x5909('0x10a')]):_0x5909('0x165'),'XMD-AGIAFTER':_0x4623a3[_0x5909('0x117')]?util[_0x5909('0x79')](_0x5909('0x166'),ipAgi,_0x4623a3[_0x5909('0x117')]):'NONE','XMD-QUEUE':_0x4623a3[_0x5909('0x56')]===_0x5909('0x95')?util['format'](_0x5909('0x167'),_0x4623a3['name'],_0x4623a3[_0x5909('0x168')]||'',_0x4623a3[_0x5909('0x112')]?'c':'',_0x4623a3['dialQueueTimeout']||0x3):_0x5909('0x165'),'XMD-CONTACTID':_0x4ac856[_0x5909('0x102')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3fcf40[_0x5909('0x26')][_0x56ea4d][_0x5909('0x164')](),'XMD-AMD':_0x4623a3['dialAMDActive']?'ACTIVE':_0x5909('0x165'),'XMD-DESTINATION':_0x5909('0xe6')};if(_0x4623a3[_0x5909('0xed')]){_0x27f717[_0x5909('0x169')]=_0x4623a3[_0x5909('0x16a')]||0x9c4;_0x27f717['XMD-AMDGREETING']=_0x4623a3[_0x5909('0x16b')]||0x5dc;_0x27f717[_0x5909('0x16c')]=_0x4623a3['dialAMDAfterGreetingSilence']||0x320;_0x27f717[_0x5909('0x16d')]=_0x4623a3[_0x5909('0x16e')]||0x1388;_0x27f717[_0x5909('0x16f')]=_0x4623a3['dialAMDMinWordLength']||0x64;_0x27f717[_0x5909('0x170')]=_0x4623a3[_0x5909('0x171')]||0x32;_0x27f717['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4623a3[_0x5909('0x172')]||0x3;_0x27f717[_0x5909('0x173')]=_0x4623a3[_0x5909('0x174')]||0x100;_0x27f717['XMD-AMDMAXIMUMWORDLENGTH']=_0x4623a3[_0x5909('0x175')]||0x1388;}if(_0x4623a3[_0x5909('0x56')]===_0x5909('0x95')){_0x27f717[_0x5909('0x176')]=_0x4ac856[_0x5909('0xda')];}else{_0x27f717[_0x5909('0x177')]=_0x4ac856[_0x5909('0xdb')];}for(var _0x288d4c in _0x4ac856[_0x5909('0x162')]){if(typeof _0x4ac856['Contact'][_0x288d4c]!==_0x5909('0x9a')){if(isNotNull(_0x4ac856[_0x5909('0x162')][_0x288d4c])&&_0x288d4c!=='id'&&_0x288d4c!==_0x5909('0x178')&&_0x288d4c!==_0x5909('0x179')&&_0x288d4c!==_0x5909('0x17a')){_0x27f717[util[_0x5909('0x79')]('%s%s',_0x5909('0x17b'),_['toUpper'](_0x288d4c))]=_0x4ac856[_0x5909('0x162')][_0x288d4c];}}}var _0x3d9f7b=_0x3fcf40[_0x5909('0xde')](_0x4623a3['Trunk'])?getCallerId(_0x4623a3[_0x5909('0x77')][_0x5909('0x78')],_0x4623a3['dialOriginateCallerIdName'],_0x4623a3[_0x5909('0x17c')]>0x0?getCallerIdRandom(_0x4623a3[_0x5909('0x5e')],_0x4623a3[_0x5909('0x17c')]):_0x4623a3[_0x5909('0x5e')]):getCallerId(_['isNil'](_0x4623a3['TrunkBackup'])?_0x4623a3['Trunk'][_0x5909('0x78')]:_0x4623a3[_0x5909('0x17d')][_0x5909('0x78')],_0x4623a3[_0x5909('0x5d')],_0x4623a3[_0x5909('0x17c')]>0x0?getCallerIdRandom(_0x4623a3[_0x5909('0x5e')],_0x4623a3['dialRandomLastDigitCallerIdNumber']):_0x4623a3[_0x5909('0x5e')]);if(_0x3d9f7b){_0x27f717[_0x5909('0x17e')]=_0x3fcf40[_0x5909('0x26')][_0x56ea4d][_0x5909('0x17f')]=extractCalleridName(_0x3d9f7b);_0x27f717['XMD-ORIGINATECALLERIDNUM']=_0x3fcf40[_0x5909('0x26')][_0x56ea4d][_0x5909('0x180')]=extractCalleridNumber(_0x3d9f7b);}return ami[_0x5909('0xb2')]({'actionid':_0x56ea4d,'action':_0x5909('0x160'),'channel':_0x3fcf40[_0x5909('0xde')](_0x4623a3['Trunk'])?util[_0x5909('0x79')](_0x5909('0x181'),_0x4623a3['Trunk'][_0x5909('0x3f')],isNotNull(_0x4623a3[_0x5909('0x5f')])?_0x4623a3[_0x5909('0x5f')][_0x5909('0x182')]()||'':'',_0x4623a3[_0x5909('0x183')]>0x0?_0x4ac856[_0x5909('0x162')]['phone'][_0x5909('0x184')](_0x4623a3[_0x5909('0x183')]):_0x4ac856[_0x5909('0x162')][_0x5909('0x163')]):util[_0x5909('0x79')](_0x5909('0x181'),_[_0x5909('0xb1')](_0x4623a3['TrunkBackup'])?_0x4623a3[_0x5909('0x77')][_0x5909('0x3f')]:_0x4623a3[_0x5909('0x17d')][_0x5909('0x3f')],isNotNull(_0x4623a3['dialPrefix'])?_0x4623a3[_0x5909('0x5f')][_0x5909('0x182')]()||'':'',_0x4623a3[_0x5909('0x183')]>0x0?_0x4ac856[_0x5909('0x162')][_0x5909('0x163')]['substring'](_0x4623a3['dialCutDigit']):_0x4ac856[_0x5909('0x162')]['phone']),'callerid':_0x3d9f7b,'Exten':_0x5909('0xe6'),'Context':_0x5909('0x185'),'Priority':'1','variable':_0x27f717,'timeout':(_0x4623a3[_0x5909('0x186')]||0x1e)*0x3e8,'async':!![],'channelid':_0x56ea4d})[_0x5909('0xbe')](function(_0x58e99a){return _0xb03d55(_0x58e99a);})[_0x5909('0xb4')](function(_0x47dfc4){_0x4623a3[_0x5909('0x68')]+=0x1;var _0x5266da=new History(_0x3fcf40[_0x5909('0x26')][_0x56ea4d]);logger[_0x5909('0x99')](util['format'](_0x5909('0x187'),JSON[_0x5909('0x48')](_0x47dfc4)));_0x5266da[_0x5909('0xa8')]=0xe;_0x5266da[_0x5909('0xa9')]=_0x5909('0x188');_0x5266da[_0x5909('0xab')]=moment()['format'](_0x5909('0x101'));_0x5266da[_0x5909('0xaa')]=_0x5266da[_0x5909('0xab')];_0x3fcf40[_0x5909('0xd1')](_0x5266da)[_0x5909('0xb4')](loggerCatch(_0x5909('0x189')));_0x3fcf40[_0x5909('0xcf')](_0x5266da)[_0x5909('0xb4')](loggerCatch(_0x5909('0x189')))[_0x5909('0x18a')](function(){delete _0x3fcf40[_0x5909('0x26')][_0x56ea4d];return _0x4ec5fb(msgResponse(_0x5909('0x160'),_0x5909('0x47'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x5909('0x30')]=function(_0x19c4cb){var _0x169a8e=this[_0x5909('0x26')][_0x19c4cb['actionid']];if(_0x169a8e){delete this['actions'][_0x19c4cb[_0x5909('0x121')]];_0x169a8e[_0x5909('0x18b')]=moment()[_0x5909('0x79')](_0x5909('0x101'));var _0x3121d6=_0x169a8e[_0x5909('0x56')]===_0x5909('0x7c')?this[_0x5909('0xb9')][_0x169a8e[_0x5909('0xb7')]]:this['voiceQueues'][_0x169a8e[_0x5909('0x18c')]()];if(!this['isSuccess'](_0x19c4cb[_0x5909('0x18d')])){this['updateOriginated'](_0x3121d6);return this[_0x5909('0x18e')](_0x169a8e,_0x3121d6,_0x19c4cb)[_0x5909('0xb4')](loggerCatch(_0x5909('0x18f')));}this[_0x5909('0xae')][_0x19c4cb[_0x5909('0xe3')]]=_0x169a8e;}};Dialer[_0x5909('0xac')][_0x5909('0x190')]=function(_0x54a1ec,_0x1da003,_0x5337c7){var _0xec90cf=new History(_0x1da003);if(_0xec90cf[_0x5909('0x191')]+_0xec90cf[_0x5909('0xf3')]+_0xec90cf[_0x5909('0xf4')]+_0xec90cf[_0x5909('0x106')]+_0xec90cf[_0x5909('0xf5')]+_0xec90cf[_0x5909('0xf6')]+_0xec90cf[_0x5909('0xf0')]+_0xec90cf[_0x5909('0xf7')]>=_0x5337c7[_0x5909('0xf8')]-0x1){return!![];}switch(_0x54a1ec){case 0x3:if(_0xec90cf['countnoanswerretry']>=_0x5337c7['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0xec90cf[_0x5909('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x5337c7[_0x5909('0x192')],_0x5909('0x100'))['format'](_0x5909('0x101')),'ContactId':_0xec90cf[_0x5909('0x102')],'ListId':_0xec90cf[_0x5909('0xd8')],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x193')));break;case 0x5:if(_0xec90cf[_0x5909('0x191')]>=_0x5337c7[_0x5909('0x194')]-0x1){return!![];}this[_0x5909('0xc4')]({'active':![],'countbusyretry':_0xec90cf[_0x5909('0x191')]+=0x1,'scheduledat':moment()['add'](_0x5337c7[_0x5909('0x195')],_0x5909('0x100'))['format'](_0x5909('0x101')),'ContactId':_0xec90cf['ContactId'],'ListId':_0xec90cf[_0x5909('0xd8')],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x196')));break;case 0x8:if(_0xec90cf[_0x5909('0xf3')]>=_0x5337c7[_0x5909('0x197')]-0x1){return!![];}this[_0x5909('0xc4')]({'active':![],'countcongestionretry':_0xec90cf[_0x5909('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x5337c7[_0x5909('0x198')],'minutes')[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xec90cf[_0x5909('0x102')],'ListId':_0xec90cf['ListId'],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})['catch'](loggerCatch(_0x5909('0x199')));break;case 0x0:if(_0xec90cf[_0x5909('0x106')]>=_0x5337c7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x5909('0xc4')]({'active':![],'countnosuchnumberretry':_0xec90cf[_0x5909('0x106')]+=0x1,'scheduledat':moment()[_0x5909('0xfe')](_0x5337c7[_0x5909('0x19a')],_0x5909('0x100'))[_0x5909('0x79')](_0x5909('0x101')),'ContactId':_0xec90cf['ContactId'],'ListId':_0xec90cf[_0x5909('0xd8')],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x19b')));}break;case 0xa:if(_0xec90cf[_0x5909('0xf5')]>=_0x5337c7[_0x5909('0x19c')]-0x1){return!![];}this[_0x5909('0xc4')]({'active':![],'countdropretry':_0xec90cf['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x5337c7[_0x5909('0x119')],'minutes')[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xec90cf[_0x5909('0x102')],'ListId':_0xec90cf[_0x5909('0xd8')],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xec90cf[_0x5909('0xf6')]>=_0x5337c7[_0x5909('0x11d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0xec90cf[_0x5909('0xf6')]+=0x1,'scheduledat':moment()[_0x5909('0xfe')](_0x5337c7['dialAbandonedRetryFrequency'],_0x5909('0x100'))[_0x5909('0x79')](_0x5909('0x101')),'ContactId':_0xec90cf[_0x5909('0x102')],'ListId':_0xec90cf['ListId'],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf['CampaignId']||undefined})['catch'](loggerCatch(_0x5909('0x11e')));break;case 0x13:if(_0xec90cf['countmachineretry']>=_0x5337c7[_0x5909('0xfb')]-0x1){return!![];}this[_0x5909('0xc4')]({'active':![],'countmachineretry':_0xec90cf[_0x5909('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x5337c7['dialMachineRetryFrequency'],_0x5909('0x100'))[_0x5909('0x79')](_0x5909('0x101')),'ContactId':_0xec90cf[_0x5909('0x102')],'ListId':_0xec90cf[_0x5909('0xd8')],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf['CampaignId']||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x19d')));break;case 0x14:if(_0xec90cf[_0x5909('0xf7')]>=_0x5337c7[_0x5909('0x19e')]-0x1){return!![];}this[_0x5909('0xc4')]({'active':![],'countagentrejectretry':_0xec90cf[_0x5909('0xf7')]+=0x1,'scheduledat':moment()[_0x5909('0xfe')](_0x5337c7[_0x5909('0x19f')],_0x5909('0x100'))[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xec90cf['ContactId'],'ListId':_0xec90cf['ListId'],'VoiceQueueId':_0xec90cf[_0x5909('0xda')]||undefined,'CampaignId':_0xec90cf[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x1a0')));break;default:return!![];}};Dialer['prototype'][_0x5909('0x18e')]=function(_0x585c5e,_0x1c9efc,_0x1c2873){var _0x375db5=this;var _0x490b3b=new History(_0x585c5e);return new BPromise(function(_0x5c66d1,_0x107303){if(_[_0x5909('0x3b')](_0x1c9efc)&&typeof _0x1c9efc!==_0x5909('0x15f')){return _0x107303(msgResponse(_0x5909('0x1a1'),_0x5909('0x13f'),_0x5909('0x1a2')));}if(_[_0x5909('0x3b')](_0x1c2873)&&typeof _0x1c2873!==_0x5909('0x15f')){return _0x107303(msgResponse(_0x5909('0x1a1'),_0x5909('0x13f'),'evt\x20is\x20undefine'));}switch(_0x1c2873[_0x5909('0x1a3')]){case'0':_0x1c9efc['outboundNoSuchCallsDay']+=0x1;_0x490b3b[_0x5909('0xa8')]=0x0;_0x490b3b[_0x5909('0xa9')]='NoSuchNumber';_0x490b3b[_0x5909('0x106')]+=0x1;_0x490b3b[_0x5909('0xf1')]+=0x1;ami[_0x5909('0x4b')](_0x5909('0x1a4'),ut['buildObj'](_0x585c5e,_0x5909('0x1a5')));_0x375db5['createHistory'](_0x490b3b)[_0x5909('0xb4')](loggerCatch(_0x5909('0x1a6')));if(_0x375db5[_0x5909('0x190')](0x0,_0x585c5e,_0x1c9efc)){if(_0x490b3b[_0x5909('0x106')]>=_0x1c9efc[_0x5909('0x1a7')]){_0x375db5['createStateFinal'](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1a8'));}else{_0x375db5[_0x5909('0xf9')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1a8'));}}break;case'3':_0x1c9efc[_0x5909('0x67')]+=0x1;_0x490b3b[_0x5909('0xa8')]=0x3;_0x490b3b['statedesc']=_0x5909('0x1a9');_0x490b3b[_0x5909('0xf4')]+=0x1;_0x490b3b[_0x5909('0xf1')]+=0x1;ami[_0x5909('0x4b')](_0x5909('0x1aa'),ut[_0x5909('0xeb')](_0x585c5e,_0x5909('0x1ab')));_0x375db5[_0x5909('0xd1')](_0x490b3b)[_0x5909('0xb4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x375db5['checkRetriveMax'](0x3,_0x585c5e,_0x1c9efc)){if(_0x490b3b['countnoanswerretry']>=_0x1c9efc[_0x5909('0x1ac')]){_0x375db5[_0x5909('0xfc')](_0x490b3b,_0x5c66d1,_0x107303,'reason\x203\x20ringing\x20no\x20answer');}else{_0x375db5['stateGlobal'](_0x490b3b,_0x5c66d1,_0x107303,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1c9efc[_0x5909('0x62')]+=0x1;_0x490b3b[_0x5909('0xa8')]=0x5;_0x490b3b['statedesc']=_0x5909('0x1ad');_0x490b3b['countbusyretry']+=0x1;_0x490b3b[_0x5909('0xf1')]+=0x1;ami[_0x5909('0x4b')](_0x5909('0x1ae'),ut['buildObj'](_0x585c5e,_0x5909('0x1af')));_0x375db5[_0x5909('0xd1')](_0x490b3b)[_0x5909('0xb4')](loggerCatch(_0x5909('0x1b0')));if(_0x375db5[_0x5909('0x190')](0x5,_0x585c5e,_0x1c9efc)){if(_0x490b3b[_0x5909('0x191')]>=_0x1c9efc['dialBusyMaxRetry']){_0x375db5[_0x5909('0xfc')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b1'));}else{_0x375db5[_0x5909('0xf9')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b1'));}}break;case'8':_0x1c9efc[_0x5909('0x63')]+=0x1;_0x490b3b['state']=0x8;_0x490b3b[_0x5909('0xa9')]=_0x5909('0x1b2');_0x490b3b[_0x5909('0xf3')]+=0x1;_0x490b3b['countglobal']+=0x1;ami[_0x5909('0x4b')](_0x5909('0x1b3'),ut['buildObj'](_0x585c5e,_0x5909('0x1b4')));_0x375db5[_0x5909('0xd1')](_0x490b3b)[_0x5909('0xb4')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x375db5[_0x5909('0x190')](0x8,_0x585c5e,_0x1c9efc)){if(_0x490b3b[_0x5909('0xf3')]>=_0x1c9efc[_0x5909('0x197')]){_0x375db5[_0x5909('0xfc')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b5'));}else{_0x375db5['stateGlobal'](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b5'));}}break;case'11':_0x1c9efc[_0x5909('0x1b6')]+=0x1;_0x490b3b[_0x5909('0xa8')]=0xb;_0x490b3b[_0x5909('0xa9')]=_0x5909('0x11c');_0x490b3b['countabandonedretry']+=0x1;_0x490b3b[_0x5909('0xf1')]+=0x1;_0x375db5[_0x5909('0xd1')](_0x490b3b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x375db5[_0x5909('0x190')](0xb,_0x585c5e,_0x1c9efc)){if(_0x490b3b[_0x5909('0xf6')]>=_0x1c9efc[_0x5909('0x11d')]){_0x375db5[_0x5909('0xfc')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b7'));}else{_0x375db5[_0x5909('0xf9')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1b7'));}}break;case'20':_0x1c9efc[_0x5909('0x69')]+=0x1;_0x490b3b[_0x5909('0xa8')]=0x14;_0x490b3b['statedesc']=_0x5909('0x1b8');_0x490b3b[_0x5909('0xf7')]+=0x1;_0x490b3b[_0x5909('0xf1')]+=0x1;ami[_0x5909('0x4b')](_0x5909('0x1b9'),ut['buildObj'](_0x585c5e,_0x5909('0x1ba')));_0x375db5['createHistory'](_0x490b3b)[_0x5909('0xb4')](loggerCatch(_0x5909('0x1bb')));if(_0x375db5['checkRetriveMax'](0x14,_0x585c5e,_0x1c9efc)){if(_0x490b3b['countagentrejectretry']>=_0x1c9efc['dialAgentRejectMaxRetry']){_0x375db5[_0x5909('0xfc')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1bc'));}else{_0x375db5[_0x5909('0xf9')](_0x490b3b,_0x5c66d1,_0x107303,_0x5909('0x1bc'));}}break;default:_0x1c9efc['outboundUnknownCallsDay']+=0x1;_0x490b3b['state']=0xc;_0x490b3b['statedesc']=_0x1c2873[_0x5909('0x1a3')];_0x375db5[_0x5909('0xd1')](_0x490b3b)[_0x5909('0xb4')](loggerCatch(_0x5909('0x1bd')));if(_0x375db5[_0x5909('0x190')](_0x1c2873[_0x5909('0x1a3')],_0x585c5e,_0x1c9efc)){if(_0x490b3b['countbusyretry']+_0x490b3b[_0x5909('0xf3')]+_0x490b3b['countnoanswerretry']+_0x490b3b['countnosuchnumberretry']+_0x490b3b[_0x5909('0xf5')]+_0x490b3b[_0x5909('0xf6')]+_0x490b3b[_0x5909('0xf0')]+_0x490b3b[_0x5909('0xf7')]>=_0x1c9efc[_0x5909('0xf8')]){_0x375db5['stateGlobal'](_0x490b3b,_0x5c66d1,_0x107303,_0x1c2873[_0x5909('0x1a3')]);}else{_0x375db5['createStateFinal'](_0x490b3b,_0x5c66d1,_0x107303,_0x1c2873['reason']);}}}});};Dialer[_0x5909('0xac')][_0x5909('0xf9')]=function(_0x500480,_0x29421c,_0x3a4a63,_0x405c7b){var _0x4146f6=new Final(_0x500480);_0x4146f6[_0x5909('0xa8')]=0xf;_0x4146f6[_0x5909('0xa9')]=_0x5909('0x1be');this[_0x5909('0xfc')](_0x4146f6,_0x29421c,_0x3a4a63,_0x405c7b);};Dialer[_0x5909('0xac')][_0x5909('0xfc')]=function(_0x4bfdb1,_0x122690,_0xbf3ea7,_0x335b6f){this[_0x5909('0xcf')](_0x4bfdb1)[_0x5909('0xbe')](function(){return _0x122690(msgResponse(_0x5909('0x1a1'),_0x5909('0xdd'),_0x335b6f));})[_0x5909('0xb4')](function(){return _0xbf3ea7(msgResponse(_0x5909('0x1bf'),_0x5909('0x13f'),_0x5909('0x1c0')));});};Dialer[_0x5909('0xac')]['predictive']=function(_0x3dbd68){var _0x568e1a=_0x3dbd68[_0x5909('0x1c1')]/0x64;var _0x173249=_0x3dbd68[_0x5909('0x66')]/(_0x3dbd68[_0x5909('0x66')]+_0x3dbd68[_0x5909('0xe7')]);var _0x58752c=Math[_0x5909('0x1c2')](_0x3dbd68['predictiveIntervalAvailable']*(_0x3dbd68['predictiveIntervalMaxThreshold']/0x64));var _0x5bced6=Math[_0x5909('0x1c2')](_0x3dbd68[_0x5909('0x70')]*(_0x3dbd68[_0x5909('0x1c3')]/0x64));var _0x5c1ffb=_0x3dbd68[_0x5909('0x4e')]+_0x3dbd68[_0x5909('0x54')];var _0x250394=Math[_0x5909('0x1c4')](_0x3dbd68[_0x5909('0x72')]*_0x3dbd68['erlangAbandonmentRate']*_0x3dbd68[_0x5909('0x1c5')]*_0x3dbd68['predictiveIntervalMultiplicativeFactor']);if(_[_0x5909('0x3b')](_0x3dbd68[_0x5909('0x28')])){if(!_[_0x5909('0x3b')](_0x3dbd68[_0x5909('0x76')])){_0x3dbd68[_0x5909('0x76')]=undefined;loggerPredictive[_0x5909('0x99')](_0x5909('0x1c6'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x5909('0x3b')](_0x3dbd68[_0x5909('0x93')])){loggerPredictive[_0x5909('0x99')]('[startMethodPredictive][StartProgressive]',_0x5909('0x1c7'));clearInterval(_0x3dbd68[_0x5909('0x93')]);_0x3dbd68[_0x5909('0x93')]=undefined;}_0x3dbd68[_0x5909('0x28')]=moment()[_0x5909('0x79')](_0x5909('0x101'));loggerPredictive['info'](_0x3dbd68[_0x5909('0x3f')],_0x5909('0x1c8'),_0x3dbd68[_0x5909('0x28')]);this['handlePower'](_0x3dbd68,0x1);}else if(ifInterval(_0x3dbd68['dialPredictiveInterval'],_0x3dbd68['startProgressive'])){this['handlePower'](_0x3dbd68,0x1);loggerPredictiveCalls[_0x5909('0x7f')](_0x5909('0x1c9'),_0x3dbd68[_0x5909('0x28')],_0x3dbd68[_0x5909('0x3f')]);_0x3dbd68[_0x5909('0x72')]=0x0;_0x3dbd68[_0x5909('0x6e')]=0x0;}else if(_0x568e1a<_0x173249&&_0x3dbd68[_0x5909('0x1ca')]===_0x5909('0x1cb')){freeVariablesPredictive(_0x3dbd68);loggerPredictive[_0x5909('0x7f')](_0x5909('0x1cc'),_0x5909('0x1cd'),_0x173249,_0x5909('0x28'),_0x3dbd68['name']);}else if(_0x250394<_0x3dbd68['predictiveIntervalErlangCallsDroppedCalls']&&_0x3dbd68[_0x5909('0x1ca')]==='dropRate'){freeVariablesPredictive(_0x3dbd68);loggerPredictive[_0x5909('0x7f')](_0x5909('0x1ce'),_0x5909('0x1cf'),_0x250394,'Drop\x20in\x20this\x20interval',_0x3dbd68[_0x5909('0x6e')],_0x5909('0x28'),_0x3dbd68[_0x5909('0x3f')]);}else if(!ifInterval(_0x3dbd68['dialPredictiveInterval'],_0x3dbd68[_0x5909('0x28')])&&_[_0x5909('0x3b')](_0x3dbd68['startPredictive'])&&!_['isUndefined'](_0x3dbd68[_0x5909('0x28')])){_0x3dbd68[_0x5909('0x76')]=moment()[_0x5909('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5909('0x7f')](_0x3dbd68[_0x5909('0x3f')],_0x5909('0x1d0'),_0x3dbd68['startPredictive']);this[_0x5909('0xc1')](_0x3dbd68['dialPredictiveInterval'])[_0x5909('0xbe')](this[_0x5909('0x1d1')](_0x3dbd68))['then'](mergeDataErlangB(_0x3dbd68))[_0x5909('0xbe')](this[_0x5909('0x1d2')](_0x3dbd68))[_0x5909('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3dbd68));}else if(!ifInterval(_0x3dbd68[_0x5909('0x1d3')],_0x3dbd68[_0x5909('0x76')])){_0x3dbd68[_0x5909('0x6e')]=0x0;_0x3dbd68['startPredictive']=moment()[_0x5909('0x79')](_0x5909('0x101'));loggerPredictive[_0x5909('0x7f')](_0x3dbd68[_0x5909('0x3f')],_0x5909('0x1d4'),_0x3dbd68['startPredictive']);clearInterval(_0x3dbd68[_0x5909('0x93')]);_0x3dbd68[_0x5909('0x93')]=undefined;this['averageHandleTime'](_0x3dbd68['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x3dbd68))[_0x5909('0xbe')](mergeDataErlangB(_0x3dbd68))['then'](this[_0x5909('0x1d2')](_0x3dbd68))[_0x5909('0xb4')](loggerCatchPredictive(_0x5909('0x1d5'),_0x3dbd68));}else if(_0x3dbd68['predictiveIntervalAvailable']&&_0x5c1ffb<_0x3dbd68[_0x5909('0x70')]-_0x5bced6){freeVariablesPredictive(_0x3dbd68);loggerPredictive['info'](_0x3dbd68[_0x5909('0x3f')],_0x5909('0x1d6'),_0x5c1ffb,_0x5909('0x1d7'),_0x3dbd68[_0x5909('0x70')],'-',_0x5bced6,'=',_0x3dbd68[_0x5909('0x70')]-_0x5bced6,')');}else if(_0x3dbd68[_0x5909('0x70')]&&_0x5c1ffb>_0x3dbd68['predictiveIntervalAvailable']+_0x58752c){freeVariablesPredictive(_0x3dbd68);loggerPredictive[_0x5909('0x7f')](_0x3dbd68[_0x5909('0x3f')],_0x5909('0x1d6'),_0x5c1ffb,_0x5909('0x1d8'),_0x3dbd68[_0x5909('0x70')],'+',_0x58752c,'=',_0x3dbd68[_0x5909('0x70')]+_0x58752c,')');}};Dialer['prototype'][_0x5909('0x1d1')]=function(_0x1670e8){var _0x3d4e23=this;return function(_0x55a993){return new BPromise(function(_0x529a90,_0x1b1b5e){_[_0x5909('0x8f')](_0x1670e8,_0x55a993[0x0]);if(checkGetDataPredictive(_0x55a993[0x0])){var _0x2d8ef7=_0x1670e8[_0x5909('0x70')]=_0x1670e8[_0x5909('0x54')]+_0x1670e8[_0x5909('0x4e')];var _0x4a67d3=_0x1670e8[_0x5909('0x1d3')]*0x3c;var _0x1dbc8d=_0x55a993[0x0][_0x5909('0x87')]+_0x55a993[0x0][_0x5909('0x6b')];var _0x174ee3=(_0x55a993[0x0][_0x5909('0x6a')]+_0x55a993[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x55a993[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x55a993[0x0][_0x5909('0x71')];_0x1670e8[_0x5909('0x1c5')]=_0x174ee3>0x0?_0x174ee3:0x1;switch(_0x1670e8['dialPredictiveOptimization']){case _0x5909('0x1cb'):var _0xbf2ffa=_0x1670e8[_0x5909('0x1c1')]/0x64;return _0x3d4e23[_0x5909('0x1d9')](_0x2d8ef7,_0x4a67d3,_0x1dbc8d,_0x174ee3,_0xbf2ffa)[_0x5909('0xbe')](function(_0x3437f5){return _0x529a90(_0x3437f5);});case _0x5909('0x1da'):var _0x1c4bbd=_0x1670e8[_0x5909('0x1c1')]/0x64;return _0x3d4e23[_0x5909('0x1db')](_0x2d8ef7,_0x4a67d3,_0x1dbc8d,_0x174ee3,_0x1c4bbd)[_0x5909('0xbe')](function(_0xf515e2){return _0x529a90(_0xf515e2);});default:return _0x1b1b5e(msgResponse('[getDataPredictive]','Failure',_0x5909('0x1dc')));}}else{return _0x1b1b5e(msgResponse(_0x5909('0x1dd'),_0x5909('0x13f'),_0x5909('0x1de')));}});};};Dialer[_0x5909('0xac')][_0x5909('0x1df')]=function(_0x6392ef){var _0x444bf7=this;return function(_0x293705){return new BPromise(function(_0x4fd12b,_0x35c745){_[_0x5909('0x8f')](_0x6392ef,_0x293705[0x0]);if(checkGetDataPredictive(_0x293705[0x0])){loggerPredictive[_0x5909('0x7f')](JSON[_0x5909('0x48')](_0x293705[0x0]));if(_0x6392ef[_0x5909('0x1ca')]===_0x5909('0x1cb')){return _0x444bf7[_0x5909('0xcd')](_0x6392ef['id'])[_0x5909('0xbe')](function(_0x1722d0){var _0x5d2062=_0x6392ef[_0x5909('0x4f')]-_0x1722d0[0x0]['outboundQueuePauses'];var _0x1591e0=_0x6392ef[_0x5909('0x1d3')]*0x3c;var _0x5c2cea=_0x293705[0x0][_0x5909('0x87')]+_0x293705[0x0][_0x5909('0x6b')];var _0x3cae3e=(_0x293705[0x0][_0x5909('0x6a')]+_0x293705[0x0][_0x5909('0x6d')]+_0x293705[0x0][_0x5909('0x6c')])/_0x293705[0x0][_0x5909('0x71')];var _0x5e929e=_0x6392ef[_0x5909('0x1c1')]/0x64;_0x6392ef[_0x5909('0x1e0')]=_0x1722d0[0x0][_0x5909('0x1e1')]||0x0;_0x6392ef[_0x5909('0x1c5')]=_0x3cae3e>0x0?_0x3cae3e:0x1;return _0x444bf7['abandonmentRate'](_0x5d2062,_0x1591e0,_0x5c2cea,_0x3cae3e,_0x5e929e);})[_0x5909('0xbe')](function(_0xab63b){return _0x4fd12b(_0xab63b);})[_0x5909('0xb4')](function(_0x1dc80a){return _0x35c745(msgResponse(_0x5909('0x1e2'),_0x5909('0x13f'),JSON[_0x5909('0x48')](_0x1dc80a)));});}if(_0x6392ef[_0x5909('0x1ca')]===_0x5909('0x1da')){return _0x444bf7[_0x5909('0xcd')](_0x6392ef['id'])[_0x5909('0xbe')](function(_0x3290f1){var _0x4a1076=_0x6392ef[_0x5909('0x4f')]-_0x3290f1[0x0][_0x5909('0x1e1')];var _0x558894=_0x6392ef[_0x5909('0x1d3')]*0x3c;var _0x16da75=_0x293705[0x0][_0x5909('0x87')]+_0x293705[0x0][_0x5909('0x6b')];var _0x3c8c54=(_0x293705[0x0][_0x5909('0x6a')]+_0x293705[0x0][_0x5909('0x6d')]+_0x293705[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x293705[0x0]['predictiveIntervalTotalCalls'];var _0x5104cb=_0x6392ef[_0x5909('0x1c1')]/0x64;_0x6392ef[_0x5909('0x1e0')]=_0x3290f1[0x0][_0x5909('0x1e1')]||0x0;_0x6392ef['predictiveIntervalHitRate']=_0x3c8c54>0x0?_0x3c8c54:0x1;return _0x444bf7[_0x5909('0x1db')](_0x4a1076,_0x558894,_0x16da75,_0x3c8c54,_0x5104cb);})[_0x5909('0xbe')](function(_0x1302f7){return _0x4fd12b(_0x1302f7);})[_0x5909('0xb4')](function(_0x1619c4){return _0x35c745(msgResponse(_0x5909('0x1e2'),_0x5909('0x13f'),JSON['stringify'](_0x1619c4)));});}}else{return _0x35c745(msgResponse(_0x5909('0x1dd'),'Failure',_0x5909('0x1de')));}});};};Dialer[_0x5909('0xac')]['startMethodPredictive']=function(_0x17f7c0){var _0x54f40a=this;return function(){var _0x1e779=0x0;var _0x59864d=Math[_0x5909('0x1c4')](_0x17f7c0[_0x5909('0x73')]*0x3e8);if(_0x59864d>0x0){_0x59864d=_0x59864d<0x64?0x64:_0x59864d;loggerPredictive[_0x5909('0x7f')](_0x17f7c0[_0x5909('0x3f')],'one\x20call\x20every:',_0x59864d,_0x5909('0x49'));_0x17f7c0[_0x5909('0x93')]=setInterval(function(){_0x54f40a[_0x5909('0x93')](_0x17f7c0);loggerPredictiveCalls['info'](_0x5909('0x1e3'),_0x1e779+=0x1);},_0x59864d);}else{loggerPredictive[_0x5909('0x7f')](_0x17f7c0['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5909('0xac')][_0x5909('0x1e4')]=function(_0x74a773,_0x20cf5e){var _0x3caf8b=this;return function(_0x19b94c){if(_['isEmpty'](_0x19b94c)){if(_['isNil'](_0x20cf5e[_0x5909('0xd9')])||!_0x20cf5e[_0x5909('0x1e5')]){if(_0x74a773[_0x5909('0x5c')]==='booked'){_0x74a773[_0x5909('0x127')]=_[_0x5909('0x3b')](_0x74a773[_0x5909('0x127')])?!![]:_0x74a773[_0x5909('0x127')];var _0x27eff1=uuid['v4']();_0x3caf8b[_0x5909('0x26')][_0x27eff1]=new Action(_0x74a773,_0x20cf5e,_0x27eff1);loggerBooked[_0x5909('0x7f')]('[booked][checkContactBlack]',_0x27eff1,'queueStatusComplete:\x20',JSON[_0x5909('0x48')](_0x74a773[_0x5909('0x127')]),_0x5909('0x1e6'),_0x74a773[_0x5909('0x3f')]);if(_0x74a773[_0x5909('0x127')]){_0x74a773[_0x5909('0x127')]=![];_0x3caf8b[_0x5909('0x29')][_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0xb7')]]=[];ami[_0x5909('0xb2')]({'actionid':_0x27eff1,'action':'queuestatus','queue':_0x74a773[_0x5909('0x3f')]})[_0x5909('0xb4')](function(){_0x3caf8b[_0x5909('0xb6')](_0x74a773);_0x3caf8b[_0x5909('0xc4')]({'active':![],'ContactId':_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0x102')],'ListId':_0x3caf8b['actions'][_0x27eff1][_0x5909('0xd8')],'VoiceQueueId':_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0xda')]||undefined,'CampaignId':_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0xdb')]||undefined})['catch'](loggerCatch(_0x5909('0x1e7')));delete _0x3caf8b[_0x5909('0x26')][_0x27eff1];});}else{loggerBooked[_0x5909('0x7f')](_0x5909('0x1e8'),JSON[_0x5909('0x48')](_0x74a773[_0x5909('0x127')]),_0x5909('0x1e6'),_0x74a773[_0x5909('0x3f')]);_0x3caf8b[_0x5909('0xb6')](_0x74a773);_0x3caf8b[_0x5909('0xc4')]({'active':![],'ContactId':_0x3caf8b['actions'][_0x27eff1]['ContactId'],'ListId':_0x3caf8b['actions'][_0x27eff1]['ListId'],'VoiceQueueId':_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0xda')]||undefined,'CampaignId':_0x3caf8b[_0x5909('0x26')][_0x27eff1][_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch(_0x5909('0x1e7')));delete _0x3caf8b[_0x5909('0x26')][_0x27eff1];}}else{return _0x3caf8b[_0x5909('0x15e')](_0x74a773,_0x20cf5e);}}else{if(getDiff(_0x20cf5e[_0x5909('0x1e9')])<_0x74a773['dialRecallMeTimeout']*0x3c){if(_0x20cf5e[_0x5909('0x1ea')]&&!_0x20cf5e[_0x5909('0x1ea')]['voicePause']){_0x3caf8b[_0x5909('0x20')][_0x5909('0x12f')](_0x20cf5e['id'])['finally'](function(){_0x3caf8b[_0x5909('0xb6')](_0x74a773);});}else{_0x3caf8b[_0x5909('0xc6')]({'active':![]},_0x20cf5e['id'],0x1)[_0x5909('0x18a')](function(){_0x3caf8b['updateOriginated'](_0x74a773);});}}else{_0x74a773[_0x5909('0x1eb')]+=0x1;_0x3caf8b[_0x5909('0xb6')](_0x74a773);if(_0x74a773[_0x5909('0x1ec')]){_0x3caf8b[_0x5909('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x20cf5e[_0x5909('0x102')],'ListId':_0x20cf5e['ListId'],'VoiceQueueId':_0x20cf5e['VoiceQueueId']||undefined,'CampaignId':_0x20cf5e[_0x5909('0xdb')]||undefined})[_0x5909('0xb4')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3caf8b[_0x5909('0xd1')](createObjHistory(_0x74a773,_0x20cf5e,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0x5909('0xb4')](loggerCatch(_0x5909('0x1ed')));}else{_0x3caf8b[_0x5909('0xd6')](createObjHistory(_0x74a773,_0x20cf5e,'RECALLFAILEDTIMEOUT',0x16,_0x5909('0x1ee')),_0x5909('0x1ef'),_0x5909('0x1f0'));}}}}else{_0x74a773[_0x5909('0x61')]+=0x1;_0x3caf8b[_0x5909('0xd6')](createObjHistory(_0x74a773,_0x20cf5e,_0x5909('0x1f1'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x5909('0x1f2'));throw _0x5909('0x1f3');}};};Dialer[_0x5909('0xac')][_0x5909('0x1f4')]=function(_0x1a6eef){var _0x240dd5=this;var _0x48c0b5=_0x1a6eef[_0x5909('0x1f5')]-_0x1a6eef['originated']-_0x1a6eef['temp'];emitCampaignSummary(_0x1a6eef);if(_0x48c0b5>0x0){if(_0x48c0b5>this[_0x5909('0x24')]){_0x48c0b5=this['maxNumberOriginate'];}_0x1a6eef[_0x5909('0xc9')]+=_0x48c0b5;this[_0x5909('0xcb')](_0x1a6eef['id'],_0x48c0b5,_0x1a6eef['dialOrderByScheduledAt'],_0x1a6eef)[_0x5909('0xbe')](function(_0x66f125){_0x1a6eef[_0x5909('0xc9')]-=_0x48c0b5;_0x1a6eef['temp']=_0x1a6eef[_0x5909('0xc9')]>0x0?_0x1a6eef['temp']:0x0;if(!checkContactEmpty(_0x66f125)){_0x1a6eef[_0x5909('0x3c')]=_0x5909('0xa1');logger['info']('[getContactCampaign2][Empty]'+_0x1a6eef[_0x5909('0x3f')]);}else{_0x1a6eef[_0x5909('0x9b')]+=_0x66f125[_0x5909('0x145')];_0x1a6eef[_0x5909('0x3c')]=_0x5909('0x1f6');for(var _0x478a57=0x0;_0x478a57<_0x66f125[_0x5909('0x145')];_0x478a57+=0x1){_0x1a6eef[_0x5909('0x1f7')]+=0x1;if(_[_0x5909('0xb1')](_0x66f125[_0x478a57])||_[_0x5909('0xb1')](_0x66f125[_0x478a57][_0x5909('0x162')])||_[_0x5909('0xb1')](_0x66f125[_0x478a57][_0x5909('0x162')]['phone'])){_0x240dd5[_0x5909('0xd5')](_0x5909('0x1f8'),_0x1a6eef,_0x66f125[_0x478a57]);}else{_0x240dd5[_0x5909('0xbf')](_[_0x5909('0xd7')](_0x66f125[_0x478a57],[_0x5909('0xdb'),_0x5909('0x1f9')]))[_0x5909('0xbe')](_0x240dd5[_0x5909('0x1e4')](_0x1a6eef,_0x66f125[_0x478a57]))[_0x5909('0xb4')](_0x240dd5[_0x5909('0xd4')](_0x5909('0x1fa'),_0x1a6eef));}}}})[_0x5909('0xb4')](loggerGetContactDialer(_0x5909('0x1fb'),_0x1a6eef,_0x48c0b5));}};Dialer[_0x5909('0xac')]['handlePower']=function(_0x2c0887,_0x590482){var _0x1d237c=this;var _0x14e77e=[];var _0x313b43=_0x590482>=0x1?_0x590482:0x1;if(_0x2c0887[_0x5909('0x5c')]===_0x5909('0xa')){_0x313b43=0x1;}var _0x342540=Math[_0x5909('0x1c4')](_0x2c0887[_0x5909('0x4e')]*_0x313b43)-_0x2c0887[_0x5909('0x9b')]-_0x2c0887[_0x5909('0xc9')];emitVoiceQueueSummary(_0x2c0887);if(_0x2c0887[_0x5909('0x1fc')]>0x0){var _0x549e7c=_0x2c0887[_0x5909('0x1fc')]-_0x2c0887[_0x5909('0x9b')]-_0x2c0887[_0x5909('0x54')]-_0x2c0887['temp']-_0x2c0887[_0x5909('0x50')];if(_0x342540>_0x549e7c){_0x342540=_0x549e7c;}}if(_0x342540>0x0){if(_0x2c0887[_0x5909('0x5c')]===_0x5909('0xa')){_0x342540=0x1;}if(_0x342540>this[_0x5909('0x24')]){_0x342540=this[_0x5909('0x24')];}_0x2c0887[_0x5909('0xc9')]+=_0x342540;for(var _0x1134a9 in this[_0x5909('0x22')]){if(typeof this[_0x5909('0x22')][_0x1134a9]!=='undefined'){if(this[_0x5909('0x22')][_0x1134a9][_0x5909('0xa8')]===_0x5909('0x1fd')&&this[_0x5909('0x22')][_0x1134a9][_0x5909('0xb3')]===_0x5909('0xe1')){_0x14e77e[_0x5909('0x125')](this[_0x5909('0x22')][_0x1134a9]['id']);}}}this['getContactDialer'](_0x2c0887['id'],_0x14e77e,_0x342540,_0x2c0887['dialOrderByScheduledAt'],_0x2c0887)['then'](function(_0x529d7a){_0x2c0887[_0x5909('0xc9')]-=_0x342540;_0x2c0887[_0x5909('0xc9')]=_0x2c0887[_0x5909('0xc9')]>0x0?_0x2c0887[_0x5909('0xc9')]:0x0;if(!checkContactEmpty(_0x529d7a)){_0x1d237c[_0x5909('0xbb')](_0x2c0887)['then'](sendMessageReschedule(_0x2c0887))[_0x5909('0xb4')](loggerCatch('[countReScheduled]\x20'));}else{_0x2c0887[_0x5909('0x9b')]+=_0x529d7a[_0x5909('0x145')];_0x2c0887[_0x5909('0x3c')]=_0x2c0887[_0x5909('0x5c')]===_0x5909('0xa')?'ACTIVE':_0x5909('0x1f6');for(var _0x171f43=0x0;_0x171f43<_0x529d7a[_0x5909('0x145')];_0x171f43+=0x1){if(_[_0x5909('0xb1')](_0x529d7a[_0x171f43])||_[_0x5909('0xb1')](_0x529d7a[_0x171f43][_0x5909('0x162')])||_[_0x5909('0xb1')](_0x529d7a[_0x171f43][_0x5909('0x162')]['phone'])){_0x1d237c[_0x5909('0xd5')](_0x5909('0x1f8'),_0x2c0887,_0x529d7a[_0x171f43]);}else{_0x1d237c[_0x5909('0xbd')](_['pick'](_0x529d7a[_0x171f43],[_0x5909('0xda'),_0x5909('0x1f9')]))[_0x5909('0xbe')](_0x1d237c['checkContactBlack'](_0x2c0887,_0x529d7a[_0x171f43]))[_0x5909('0xb4')](_0x1d237c[_0x5909('0xd4')]('[actionOriginate]\x20',_0x2c0887));}}}})['catch'](loggerGetContactDialer(_0x5909('0x1fe'),_0x2c0887,_0x342540));}};Dialer['prototype'][_0x5909('0x93')]=function(_0x2bbf74){if(_0x2bbf74['dialLimitQueue']>0x0){var _0x303a4c=_0x2bbf74['dialLimitQueue']-_0x2bbf74[_0x5909('0x9b')]-_0x2bbf74[_0x5909('0x54')];if(_0x303a4c>0x0){this[_0x5909('0x1ff')](_0x2bbf74);}else{loggerPredictiveCalls[_0x5909('0x7f')](_0x5909('0x200'));}}else{this[_0x5909('0x1ff')](_0x2bbf74);}};Dialer[_0x5909('0xac')]['tryOriginatePredictive']=function(_0x2e0bc9){var _0x2451ce=this;var _0x5d260e=[];_0x2e0bc9[_0x5909('0x9b')]+=0x1;for(var _0x4af1be in this[_0x5909('0x22')]){if(typeof this[_0x5909('0x22')][_0x4af1be]!==_0x5909('0x9a')){if(this['agents'][_0x4af1be]['state']===_0x5909('0x1fd')&&this[_0x5909('0x22')][_0x4af1be][_0x5909('0xb3')]===_0x5909('0xe1')){_0x5d260e[_0x5909('0x125')](this[_0x5909('0x22')][_0x4af1be]['id']);}}}this[_0x5909('0xc8')](_0x2e0bc9['id'],_0x5d260e,0x1,_0x2e0bc9['dialOrderByScheduledAt'],_0x2e0bc9)['then'](function(_0x4ab97a){if(!checkContactEmpty(_0x4ab97a)){checkContactLowerLimitOriginate(_0x2e0bc9,0x1,0x0);_0x2451ce[_0x5909('0xbb')](_0x2e0bc9)[_0x5909('0xbe')](sendMessageReschedule(_0x2e0bc9))['catch'](loggerCatch(_0x5909('0xbc')));}else{_0x2e0bc9[_0x5909('0x3c')]=_0x5909('0x1f6');if(_[_0x5909('0xb1')](_0x4ab97a[0x0])||_[_0x5909('0xb1')](_0x4ab97a[0x0][_0x5909('0x162')])||_['isNil'](_0x4ab97a[0x0][_0x5909('0x162')][_0x5909('0x163')])){_0x2451ce[_0x5909('0xd5')](_0x5909('0x1f8'),_0x2e0bc9,_0x4ab97a[0x0]);}else{_0x2451ce[_0x5909('0xbd')](_[_0x5909('0xd7')](_0x4ab97a[0x0],['VoiceQueueId',_0x5909('0x1f9')]))[_0x5909('0xbe')](_0x2451ce[_0x5909('0x1e4')](_0x2e0bc9,_0x4ab97a[0x0]))[_0x5909('0xb4')](_0x2451ce['loggerHandler'](_0x5909('0x201'),_0x2e0bc9));}}})['catch'](loggerGetContactDialer(_0x5909('0x202'),_0x2e0bc9,0x1));emitVoiceQueueSummary(_0x2e0bc9);};Dialer['prototype']['abandonmentRate']=function(_0x30d65f,_0x4eaf53,_0x2634d9,_0x30f8ce,_0x144d4e,_0x204228){loggerPredictive['info'](_0x5909('0x203'));loggerPredictive[_0x5909('0x7f')](_0x5909('0x204'),_0x30d65f);loggerPredictive[_0x5909('0x7f')](_0x5909('0x205'),_0x4eaf53);loggerPredictive['info'](_0x5909('0x206'),_0x2634d9);loggerPredictive[_0x5909('0x7f')](_0x5909('0x207'),_0x30f8ce);loggerPredictive[_0x5909('0x7f')](_0x5909('0x208'),_0x144d4e);loggerPredictive[_0x5909('0x7f')](_0x5909('0x86'));return new BPromise(function(_0x5c49e7,_0x5684c7){if(_0x30d65f<=0x0||isNaN(_0x30d65f)){return _0x5684c7(msgResponse(_0x5909('0x209'),_0x5909('0x47'),_0x5909('0x20a')+_0x30d65f));}if(_0x2634d9<=0x0||isNaN(_0x2634d9)){return _0x5684c7(msgResponse(_0x5909('0x209'),_0x5909('0x47'),_0x5909('0x20b')+_0x2634d9));}if(_0x30f8ce<=0x0||isNaN(_0x30f8ce)){return _0x5684c7(msgResponse(_0x5909('0x209'),_0x5909('0x47'),_0x5909('0x20c')+_0x30f8ce));}if(_0x4eaf53<=0x0||isNaN(_0x4eaf53)){return _0x5684c7(msgResponse(_0x5909('0x209'),_0x5909('0x47'),'interval\x20=\x20'+_0x4eaf53));}if(_0x144d4e<=0x0||isNaN(_0x144d4e)){return _0x5684c7(msgResponse('[abandonmentRate]','Error',_0x5909('0x20d')+_0x144d4e));}_0x204228=_0x204228||0x0;var _0x1185b2=0x1/_0x2634d9;var _0x16f277=0x0;var _0x51256c=0x0;var _0x561cbf=0x0;var _0x3443a5=0x0;for(var _0x6c674d=0x0;_0x561cbf<_0x144d4e;_0x6c674d+=0x1){_0x51256c=_0x6c674d/_0x4eaf53;_0x16f277=(_0x30f8ce*_0x51256c+_0x204228)/_0x1185b2;_0x561cbf=erlangb(_0x16f277,_0x30d65f);_0x3443a5=_0x16f277/_0x30d65f*(0x1-erlangb(_0x16f277,_0x30d65f));}return _0x5c49e7({'erlangCalls':_0x6c674d,'erlangCallToSecond':_0x4eaf53/_0x6c674d,'erlangAbandonmentRate':_0x561cbf,'erlangBusyFactor':_0x3443a5});});};Dialer[_0x5909('0xac')][_0x5909('0x1db')]=function(_0x5b23a1,_0x3e2c45,_0x53f230,_0x3ed633,_0x3a9125,_0x4f4ab7){loggerPredictive[_0x5909('0x7f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x5909('0x7f')](_0x5909('0x204'),_0x5b23a1);loggerPredictive['info'](_0x5909('0x205'),_0x3e2c45);loggerPredictive[_0x5909('0x7f')]('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',_0x53f230);loggerPredictive[_0x5909('0x7f')](_0x5909('0x207'),_0x3ed633);loggerPredictive[_0x5909('0x7f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a9125);loggerPredictive[_0x5909('0x7f')](_0x5909('0x86'));return new BPromise(function(_0x69e8ad,_0x51f76a){if(_0x5b23a1<=0x0||isNaN(_0x5b23a1)){return _0x51f76a(msgResponse(_0x5909('0x20e'),_0x5909('0x47'),_0x5909('0x20a')+_0x5b23a1));}if(_0x53f230<=0x0||isNaN(_0x53f230)){return _0x51f76a(msgResponse(_0x5909('0x20e'),_0x5909('0x47'),_0x5909('0x20b')+_0x53f230));}if(_0x3ed633<=0x0||isNaN(_0x3ed633)){return _0x51f76a(msgResponse(_0x5909('0x20e'),_0x5909('0x47'),_0x5909('0x20c')+_0x3ed633));}if(_0x3e2c45<=0x0||isNaN(_0x3e2c45)){return _0x51f76a(msgResponse(_0x5909('0x20e'),_0x5909('0x47'),'interval\x20=\x20'+_0x3e2c45));}if(_0x3a9125<=0x0||isNaN(_0x3a9125)){return _0x51f76a(msgResponse(_0x5909('0x20e'),_0x5909('0x47'),'Umin\x20=\x20'+_0x3a9125));}_0x4f4ab7=_0x4f4ab7||0x0;var _0x582669=0x1/_0x53f230;var _0x4f5183=0x0;var _0x30aad0=0x0;var _0x510cd4=0x0;var _0x2d2701=0x0;for(var _0x5dc7ff=0x0;_0x2d2701<_0x3a9125;_0x5dc7ff+=0x1){_0x30aad0=_0x5dc7ff/_0x3e2c45;_0x4f5183=(_0x3ed633*_0x30aad0+_0x4f4ab7)/_0x582669;_0x510cd4=erlangb(_0x4f5183,_0x5b23a1);_0x2d2701=_0x4f5183/_0x5b23a1*(0x1-erlangb(_0x4f5183,_0x5b23a1));}return _0x69e8ad({'erlangCalls':_0x5dc7ff,'erlangCallToSecond':_0x3e2c45/_0x5dc7ff,'erlangAbandonmentRate':_0x510cd4,'erlangBusyFactor':_0x2d2701});});};module['exports']=Dialer; \ No newline at end of file +var _0x86a2=['checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ListId','UserId','VoiceQueueId','[emptyContact]','Success','trunks','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','voiceQueues','dialAMDActive','value','HANGUP','state','statedesc','HangupInAMD','membername','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','AMD','countmachineretry','countglobal','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countnoanswerretry','countnosuchnumberretry','stateGlobal','CampaignId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','droptime','dialQueueTimeout','Drop','dropreason','dialQueueProject2','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','actionid','locked','paused','stateinterface','queueBooked','push','pick','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','interval','iftime\x20%s,%s','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','handleIvr','sendMessageOneNotActive','checkIfTime','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','OriginateError','[originate][error]','originate\x20action\x20Error','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','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(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','booked','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','ivrTotalCallsDays','Contact.phone','dialLimitQueue','not_inuse','RUNNING','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginate]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','preview','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','seconds','emit','type','strategy','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','status','channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20'];(function(_0x320a52,_0x12b8b5){var _0x21b055=function(_0x4c01eb){while(--_0x4c01eb){_0x320a52['push'](_0x320a52['shift']());}};_0x21b055(++_0x12b8b5);}(_0x86a2,0x161));var _0x286a=function(_0x2118f2,_0x294cfa){_0x2118f2=_0x2118f2-0x0;var _0x4769df=_0x86a2[_0x2118f2];return _0x4769df;};'use strict';var util=require('util');var _=require(_0x286a('0x0'));var BPromise=require(_0x286a('0x1'));var uuid=require(_0x286a('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x286a('0x3'));var Redis=require(_0x286a('0x4'));var ut=require(_0x286a('0x5'));var config=require(_0x286a('0x6'));var logger=require(_0x286a('0x7'))(_0x286a('0x8'));var loggerBooked=require(_0x286a('0x7'))('booked');var loggerPredictive=require(_0x286a('0x7'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x286a('0x9'));var ami=require(_0x286a('0xa'));config[_0x286a('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x286a('0xc'))(new Redis(config[_0x286a('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x286a('0xd'));var cmHopperBlack=require(_0x286a('0xe'));var voiceQueueRt=require(_0x286a('0xf'));var Action=require('./action');var History=require(_0x286a('0x10'));var Final=require(_0x286a('0x11'));var AgentComplete=require(_0x286a('0x12'));var QueueCallerAbandon=require(_0x286a('0x13'));var Hangup=require(_0x286a('0x14'));var ipAgi=process[_0x286a('0x15')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x286a('0x16'),'roundrobin':_0x286a('0x17')};var Sequence=function(){};Sequence[_0x286a('0x18')][_0x286a('0x19')]=function(_0x95599){this[_0x286a('0x1a')]=this[_0x286a('0x1a')]?this[_0x286a('0x1a')]['finally'](_0x95599):_0x95599();};function Dialer(_0x45a40d,_0x22005d){this['sequence']=new Sequence();this[_0x286a('0x1b')]=_0x22005d;this['voiceQueues']=_0x45a40d['voiceQueues'];this[_0x286a('0x1c')]=_0x45a40d[_0x286a('0x1c')];this[_0x286a('0x1d')]=_0x45a40d['agents'];this['trunks']=_0x45a40d['trunks'];this[_0x286a('0x1e')]=config[_0x286a('0x1e')]||0x2;this[_0x286a('0x1f')]={};this[_0x286a('0x20')]={};this[_0x286a('0x21')]={};this[_0x286a('0x22')]={};this[_0x286a('0x23')]={};this['startPredictive']={};this['startProgressive']={};this[_0x286a('0x24')]={};this['queueBooked']={};this[_0x286a('0x25')]={};ami['on'](_0x286a('0x26'),this['syncAgentConnect']['bind'](this));ami['on'](_0x286a('0x27'),this[_0x286a('0x28')][_0x286a('0x29')](this));ami['on']('originateresponse',this[_0x286a('0x2a')]['bind'](this));ami['on'](_0x286a('0x2b'),this['syncAgentComplete'][_0x286a('0x29')](this));ami['on'](_0x286a('0x2c'),this[_0x286a('0x9')][_0x286a('0x29')](this));ami['on'](_0x286a('0x2d'),this['syncHangup']['bind'](this));ami['on'](_0x286a('0x2e'),this[_0x286a('0x2f')][_0x286a('0x29')](this));ami['on'](_0x286a('0x30'),this['syncVarSet']['bind'](this));ami['on'](_0x286a('0x31'),this[_0x286a('0x32')][_0x286a('0x29')](this));ami['on'](_0x286a('0x33'),this[_0x286a('0x34')][_0x286a('0x29')](this));this[_0x286a('0x35')]();this[_0x286a('0x36')]();}function isNotNull(_0x1e341b){return _0x1e341b!==null&&!_[_0x286a('0x37')](_0x1e341b);}function checkIsLoggedIn(_0x28479d,_0x31495b){return function(){if(_0x31495b<=0x0){_0x28479d['message']='AGENTS_NOT_LOGGED';throw _0x28479d[_0x286a('0x38')]+_0x286a('0x39');}};}function isActive(_0x32e84c){return _0x32e84c;}function checkIsActive(_0xa0912f,_0x168507){return function(){if(!isActive(_0x168507)){_0xa0912f['message']='NOT_ACTIVE';throw _0xa0912f['name']+_0x286a('0x3a');}};}function checkInterval(_0x47b3fb){return function(){if(!isNotNull(_0x47b3fb[_0x286a('0x3b')])){_0x47b3fb[_0x286a('0x3c')]=_0x286a('0x3d');throw _0x47b3fb[_0x286a('0x38')]+_0x286a('0x3e');}if(!isNotNull(_0x47b3fb['Interval'][_0x286a('0x3f')])){_0x47b3fb[_0x286a('0x3c')]=_0x286a('0x3d');throw _0x47b3fb[_0x286a('0x38')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x286a('0x40')](_0x47b3fb[_0x286a('0x3b')][_0x286a('0x3f')]))){_0x47b3fb[_0x286a('0x3c')]=_0x286a('0x3d');throw _0x47b3fb[_0x286a('0x38')]+_0x286a('0x3e');}};}function msgResponse(_0x1d606f,_0x3fbd26,_0xc4edd8){return{'action':_0x1d606f,'response':_0x3fbd26,'message':_0xc4edd8,'stack':_0xc4edd8};}function myreject(_0x261b69){return function(_0x24e8e9){return _0x261b69(msgResponse(_0x286a('0x41'),_0x286a('0x42'),JSON['stringify'](_0x24e8e9)));};}function getSeconds(_0x5ab3cc,_0xa3c9fc){var _0x3dd339=moment(_0x5ab3cc)[_0x286a('0x43')](0x0);var _0x3108fb=moment(_0xa3c9fc)['milliseconds'](0x0);return _0x3dd339['diff'](_0x3108fb,_0x286a('0x44'));}function emit(_0x52d834,_0x5a46f,_0x161a4b){io['to'](_0x52d834)[_0x286a('0x45')](_0x5a46f,_0x161a4b);}function emitVoiceQueueSummary(_0x2e3856){if(_0x2e3856[_0x286a('0x46')]==='outbound'){var _0x49ed98={'id':_0x2e3856['id'],'name':_0x2e3856[_0x286a('0x38')],'strategy':_0x2e3856[_0x286a('0x47')],'answered':_0x2e3856['answered'],'available':_0x2e3856['available'],'loggedIn':_0x2e3856[_0x286a('0x48')],'pTalking':_0x2e3856[_0x286a('0x49')],'sumBillable':_0x2e3856[_0x286a('0x4a')],'sumDuration':_0x2e3856[_0x286a('0x4b')],'sumHoldTime':_0x2e3856['sumHoldTime']||0x0,'talking':_0x2e3856[_0x286a('0x4c')],'total':_0x2e3856[_0x286a('0x4d')],'type':_0x2e3856[_0x286a('0x46')],'unmanaged':_0x2e3856[_0x286a('0x4e')],'abandoned':_0x2e3856['abandoned'],'waiting':_0x2e3856[_0x286a('0x4f')],'loggedInDb':_0x2e3856['loggedInDb'],'dialActive':_0x2e3856[_0x286a('0x50')],'dialMethod':_0x2e3856[_0x286a('0x51')],'dialOriginateCallerIdName':_0x2e3856[_0x286a('0x52')],'dialOriginateCallerIdNumber':_0x2e3856[_0x286a('0x53')],'dialOriginateTimeout':_0x2e3856[_0x286a('0x54')],'dialPrefix':_0x2e3856[_0x286a('0x55')],'outboundAnswerAgiCallsDay':_0x2e3856[_0x286a('0x56')],'outboundAnswerCallsDay':_0x2e3856[_0x286a('0x57')],'outboundBlacklistCallsDay':_0x2e3856[_0x286a('0x58')],'outboundBusyCallsDay':_0x2e3856[_0x286a('0x59')],'outboundCongestionCallsDay':_0x2e3856['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2e3856[_0x286a('0x5a')],'outboundDropCallsDayCallersExit':_0x2e3856[_0x286a('0x5b')],'outboundDropCallsDayTimeout':_0x2e3856[_0x286a('0x5c')],'outboundNoAnswerCallsDay':_0x2e3856[_0x286a('0x5d')],'outboundNoSuchCallsDay':_0x2e3856[_0x286a('0x5e')],'outboundOriginateFailureCallsDay':_0x2e3856[_0x286a('0x5f')],'outboundReCallsDay':_0x2e3856[_0x286a('0x60')],'outboundRejectCallsDay':_0x2e3856['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2e3856['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2e3856[_0x286a('0x61')],'predictiveIntervalAvgHoldtime':_0x2e3856[_0x286a('0x62')],'predictiveIntervalAvgTalktime':_0x2e3856[_0x286a('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x2e3856[_0x286a('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x2e3856[_0x286a('0x65')],'predictiveIntervalErlangCalls':_0x2e3856[_0x286a('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x2e3856[_0x286a('0x67')],'predictiveIntervalHitRate':_0x2e3856['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2e3856['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2e3856[_0x286a('0x68')],'predictiveIntervalAvailable':_0x2e3856['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2e3856[_0x286a('0x69')],'message':_0x2e3856[_0x286a('0x3c')],'originated':_0x2e3856[_0x286a('0x6a')],'erlangCalls':_0x2e3856[_0x286a('0x6b')],'erlangCallToSecond':_0x2e3856[_0x286a('0x6c')],'erlangAbandonmentRate':_0x2e3856[_0x286a('0x6d')],'erlangBusyFactor':_0x2e3856['erlangBusyFactor'],'startPredictive':_0x2e3856[_0x286a('0x6e')],'startProgressive':_0x2e3856[_0x286a('0x6f')]};if(_0x2e3856[_0x286a('0x70')]){_0x49ed98[_0x286a('0x70')]={'id':_0x2e3856[_0x286a('0x70')]['id'],'name':_0x2e3856[_0x286a('0x70')][_0x286a('0x38')],'active':_0x2e3856['Trunk'][_0x286a('0x71')],'callerid':_0x2e3856[_0x286a('0x70')][_0x286a('0x72')]};}if(_0x2e3856['Interval']){_0x49ed98[_0x286a('0x3b')]={'id':_0x2e3856[_0x286a('0x3b')]['id'],'name':_0x2e3856[_0x286a('0x3b')][_0x286a('0x38')]};}var _0x2fae66=md5(JSON['stringify'](_0x49ed98));if(_0x2e3856['md5']!==_0x2fae66){_0x2e3856['md5']=_0x2fae66;emit(util[_0x286a('0x73')](_0x286a('0x74'),_0x49ed98['name']),_0x286a('0x75'),_0x49ed98);}}}function emitCampaignSummary(_0xf253e5){if(_0xf253e5[_0x286a('0x46')]==='ivr'){emit(util[_0x286a('0x73')](_0x286a('0x76'),_0xf253e5[_0x286a('0x38')]),_0x286a('0x77'),_0xf253e5);}}function checkGetDataPredictive(_0x261474){if(isNotNull(_0x261474)&&!_['isEmpty'](_0x261474)){loggerPredictive[_0x286a('0x78')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x286a('0x78')](_0x286a('0x79'),_0x261474[_0x286a('0x69')]);loggerPredictive[_0x286a('0x78')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x261474[_0x286a('0x61')]);loggerPredictive[_0x286a('0x78')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x261474[_0x286a('0x65')]);loggerPredictive[_0x286a('0x78')](_0x286a('0x7a'),_0x261474['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x286a('0x78')](_0x286a('0x7b'),_0x261474[_0x286a('0x62')]);loggerPredictive[_0x286a('0x78')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x261474[_0x286a('0x63')]);loggerPredictive[_0x286a('0x78')](_0x286a('0x7c'));if(_0x261474[_0x286a('0x69')]>0x0){if(!_[_0x286a('0x37')](_0x261474[_0x286a('0x63')])&&_0x261474[_0x286a('0x63')]>0x0){return!![];}loggerPredictive[_0x286a('0x78')](_0x286a('0x7d'));if(!_[_0x286a('0x37')](_0x261474[_0x286a('0x62')])&&_0x261474[_0x286a('0x62')]>0x0){return!![];}loggerPredictive[_0x286a('0x78')](_0x286a('0x7e'));}else{loggerPredictive[_0x286a('0x78')](_0x286a('0x7f'));}}else{loggerPredictive[_0x286a('0x78')](_0x286a('0x80'));}return![];}function mergeDataErlangB(_0x5b3c15){return function(_0x2c96de){loggerPredictive[_0x286a('0x78')](_0x286a('0x81'));loggerPredictive[_0x286a('0x78')](_0x286a('0x82'),_0x2c96de['erlangCalls']);loggerPredictive[_0x286a('0x78')](_0x286a('0x83'),_0x2c96de['erlangCallToSecond']);loggerPredictive[_0x286a('0x78')](_0x286a('0x84'),_0x2c96de[_0x286a('0x6d')]);loggerPredictive[_0x286a('0x78')](_0x286a('0x85'),_0x2c96de[_0x286a('0x86')]);loggerPredictive['info'](_0x286a('0x84'),_0x2c96de[_0x286a('0x6d')]);loggerPredictive[_0x286a('0x78')](_0x286a('0x7c'));_[_0x286a('0x87')](_0x5b3c15,_0x2c96de);};}function getDiff(_0x2b3e2a){var _0x3e9498=moment()[_0x286a('0x43')](0x0);var _0x402fb9=moment(_0x2b3e2a)[_0x286a('0x43')](0x0);return _0x3e9498[_0x286a('0x88')](_0x402fb9,_0x286a('0x44'));}function ifInterval(_0x38b8f2,_0x182897){if(_['isUndefined'](_0x182897)){return![];}return getDiff(_0x182897)<_0x38b8f2*0x3c;}function freeVariablesPredictive(_0x122253){if(isNotNull(_0x122253)){if(!_[_0x286a('0x37')](_0x122253[_0x286a('0x6f')])){_0x122253['startProgressive']=undefined;loggerPredictive[_0x286a('0x78')](_0x122253[_0x286a('0x38')],_0x286a('0x89'));}if(!_['isUndefined'](_0x122253[_0x286a('0x6e')])){_0x122253[_0x286a('0x6e')]=undefined;loggerPredictive[_0x286a('0x78')](_0x122253['name'],_0x286a('0x8a'));}if(!_[_0x286a('0x37')](_0x122253[_0x286a('0x8b')])){clearInterval(_0x122253[_0x286a('0x8b')]);_0x122253['handlePredictive']=undefined;loggerPredictive[_0x286a('0x78')](_0x122253['name'],_0x286a('0x8c'));}}}function erlangb(_0x4d6af7,_0xbb172c){if(_0xbb172c===0x0){return 0x0;}var _0xbd0e06=0x1;for(var _0x20341f=0x1;_0x20341f<=_0xbb172c;_0x20341f+=0x1){_0xbd0e06=0x1+_0xbd0e06*_0x20341f/_0x4d6af7;}return 0x1/_0xbd0e06;}function isVoiceQueueOutbound(_0x42e843){return _0x42e843===_0x286a('0x8d');}function isNotPreview(_0x2c5d4b){return _0x2c5d4b!==_0x286a('0x1b');}function isCampaignIvr(_0x6bada9){return _0x6bada9===_0x286a('0x8e');}function getCallerId(_0x240d82,_0x11c61a,_0x3bcf61){if(!_[_0x286a('0x37')](_0x3bcf61)&&typeof _0x3bcf61===_0x286a('0x8f')&&!_[_0x286a('0x40')](_0x3bcf61)){if(!_[_0x286a('0x37')](_0x11c61a)&&typeof _0x11c61a===_0x286a('0x8f')&&!_['isEmpty'](_0x11c61a)){return util['format'](_0x286a('0x90'),_0x11c61a,_0x3bcf61);}return util[_0x286a('0x73')](_0x286a('0x90'),_0x3bcf61,_0x3bcf61);}if(!_[_0x286a('0x37')](_0x240d82)&&typeof _0x240d82===_0x286a('0x8f')&&!_[_0x286a('0x40')](_0x240d82)){return _0x240d82;}return _0x286a('0x91');}function loggerCatchQueueSummary(_0x4b6522,_0x2805bb){return function(_0x1da3ad){freeVariablesPredictive(_0x2805bb);emitVoiceQueueSummary(_0x2805bb);emitCampaignSummary(_0x2805bb);loggerSyncQueueSummary[_0x286a('0x92')](_0x4b6522,util['inspect'](_0x1da3ad,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x598c07,_0x30fc51){return function(_0x18f6b9){loggerPredictive[_0x286a('0x92')](_0x30fc51[_0x286a('0x38')],_0x598c07);loggerPredictive['error'](_0x18f6b9[_0x286a('0x93')]);freeVariablesPredictive(_0x30fc51);};}function loggerCatch(_0x197d75){return function(_0xabafc5){logger[_0x286a('0x92')](_0x197d75,util[_0x286a('0x94')](_0xabafc5,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xcb94d1){return _0xcb94d1&&!_[_0x286a('0x37')](_0xcb94d1)&&_0xcb94d1[_0x286a('0x95')]>0x0;}function decremetOriginate(_0x562520){if(!_[_0x286a('0x37')](_0x562520)&&_0x562520!==null){if(typeof _0x562520[_0x286a('0x6a')]!==_0x286a('0x96')){if(_0x562520[_0x286a('0x6a')]>0x0){_0x562520[_0x286a('0x6a')]-=0x1;}else{logger[_0x286a('0x92')](_0x286a('0x97'));}}}else{logger[_0x286a('0x92')](_0x286a('0x98'));}}function checkContactLowerLimitOriginate(_0x4c2ab9,_0x5df50d,_0x429669){if(_0x5df50d>_0x429669){for(var _0x388f40=0x0;_0x388f40<_0x5df50d-_0x429669;_0x388f40+=0x1){decremetOriginate(_0x4c2ab9);}}}function loggerGetContactDialer(_0x31127d,_0x2b8157,_0x3c37bf){return function(_0xe14871){checkContactLowerLimitOriginate(_0x2b8157,_0x3c37bf,0x0);logger[_0x286a('0x92')](_0x31127d,util['inspect'](_0xe14871,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5af46e){return function(_0x2c4684){if(isNotNull(_0x2c4684)&&isNotNull(_0x2c4684[0x0])){if(_0x2c4684[0x0][_0x286a('0x99')]>0x0){_0x5af46e[_0x286a('0x3c')]=_0x286a('0x9a');logger[_0x286a('0x78')](_0x286a('0x9b')+_0x5af46e[_0x286a('0x38')],_0x2c4684[0x0][_0x286a('0x99')],_0x286a('0x9c'));}else{_0x5af46e[_0x286a('0x3c')]=_0x286a('0x9d');logger[_0x286a('0x78')]('[getContactDialer2][Empty]'+_0x5af46e[_0x286a('0x38')]);}}};}function notSendMessagesQueue(_0x3d2fcd){if(_0x3d2fcd['sendMessageOneNotActive']){freeVariablesPredictive(_0x3d2fcd);if(_0x3d2fcd[_0x286a('0x6a')]===0x0&&_0x3d2fcd['talking']===0x0&&_0x3d2fcd['waiting']===0x0&&(_0x3d2fcd['pTalking']||0x0)===0x0){_0x3d2fcd['sendMessageOneNotActive']=![];_0x3d2fcd[_0x286a('0x9e')]=0x0;_0x3d2fcd[_0x286a('0x3c')]=_0x286a('0x9f');loggerSyncQueueSummary['error'](_0x286a('0xa0'),_0x3d2fcd[_0x286a('0x38')],_0x286a('0xa1'));}else{_0x3d2fcd[_0x286a('0x3c')]=_0x286a('0xa2');loggerSyncQueueSummary[_0x286a('0x92')](_0x286a('0xa0'),_0x3d2fcd['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x3d2fcd);}}function notSendMessagesCampaign(_0xa1210c){if(_0xa1210c['sendMessageOneNotActive']){if(_0xa1210c[_0x286a('0x6a')]===0x0){_0xa1210c['sendMessageOneNotActive']=![];_0xa1210c[_0x286a('0x3c')]=_0x286a('0x9f');loggerSyncQueueSummary['error'](_0x286a('0xa3'),_0xa1210c['name'],_0x286a('0xa1'));}else{_0xa1210c[_0x286a('0x3c')]=_0x286a('0xa2');loggerSyncQueueSummary[_0x286a('0x92')](_0x286a('0xa3'),_0xa1210c[_0x286a('0x38')],_0x286a('0xa4'));}emitCampaignSummary(_0xa1210c);}}function createObjHistory(_0x3fd8a6,_0x3a8140,_0x1a3535,_0x1e519d,_0x21d086){_0x3fd8a6[_0x286a('0x3c')]=_0x1a3535;var _0x39a517=new Action(_0x3fd8a6,_0x3a8140);var _0x1d2e38=new History(_0x39a517);_0x1d2e38['state']=_0x1e519d;_0x1d2e38['statedesc']=_0x21d086;_0x1d2e38[_0x286a('0xa5')]=_0x39a517[_0x286a('0xa6')];return _0x1d2e38;}Dialer['prototype'][_0x286a('0x36')]=function(){var _0x3fda5a=this;setInterval(function(){_0x3fda5a[_0x286a('0xa7')](_0x3fda5a[_0x286a('0x22')],_0x286a('0xa8'));_0x3fda5a[_0x286a('0xa7')](_0x3fda5a['actions'],_0x286a('0xa9'));},0x32c8);};Dialer[_0x286a('0x18')][_0x286a('0xa7')]=function(_0x422053,_0x1972c5){var _0xf2772d=this;for(var _0x2f907e in _0x422053){if(typeof _0x422053[_0x2f907e]!=='undefined'){this[_0x286a('0xaa')][_0x286a('0x19')](function(){if(!_['isNil'](_0x422053[_0x2f907e])){return ami['Action']({'action':_0x286a('0xab'),'channel':_0x422053[_0x2f907e][_0x286a('0xac')]})['catch'](function(_0x227020){if(_0x227020[_0x286a('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x422053[_0x2f907e]&&_0x422053[_0x2f907e]['type']!==_0x286a('0x8e')){_0xf2772d[_0x286a('0xad')](_0xf2772d['voiceQueues'][_0x422053[_0x2f907e]['queue']]);logger[_0x286a('0x92')](_0x286a('0xae'),_0x1972c5,_0x2f907e,_0x422053[_0x2f907e][_0x286a('0xaf')]);delete _0x422053[_0x2f907e];}if(_0x422053[_0x2f907e]&&_0x422053[_0x2f907e]['type']===_0x286a('0x8e')){_0xf2772d[_0x286a('0xad')](_0xf2772d[_0x286a('0x1c')][_0x422053[_0x2f907e]['queue']]);logger[_0x286a('0x92')](_0x286a('0xb0'),_0x1972c5,_0x2f907e,_0x422053[_0x2f907e]['queue']);delete _0x422053[_0x2f907e];}},0x2328);}});}});}}};Dialer[_0x286a('0x18')][_0x286a('0xb1')]=function(_0x14c2b9){return BPromise[_0x286a('0xb2')]()['then'](cmHopper[_0x286a('0xb1')](_0x14c2b9))[_0x286a('0xb3')](loggerCatch(_0x286a('0xb4')));};Dialer[_0x286a('0x18')][_0x286a('0xb5')]=function(_0x26f721){return BPromise[_0x286a('0xb2')]()['then'](cmHopperBlack[_0x286a('0xb5')](_0x26f721))['catch'](loggerCatch(_0x286a('0xb6')));};Dialer[_0x286a('0x18')][_0x286a('0xb7')]=function(_0x3a2db8){return BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](cmHopperBlack[_0x286a('0xb7')](_0x3a2db8))[_0x286a('0xb3')](loggerCatch(_0x286a('0xb9')));};Dialer['prototype'][_0x286a('0xba')]=function(_0x1142d5){return BPromise['resolve']()[_0x286a('0xb8')](cmHopperHistory[_0x286a('0xbb')](_0x1142d5))[_0x286a('0xb3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x286a('0x18')][_0x286a('0xbc')]=function(_0x465656){return BPromise['resolve']()[_0x286a('0xb8')](cmHopper[_0x286a('0xbc')](_0x465656))['catch'](loggerCatch(_0x286a('0xbd')));};Dialer[_0x286a('0x18')]['unlockContact']=function(_0x4fedba,_0x12ef58,_0x9c44f6){return BPromise[_0x286a('0xb2')]()['then'](cmHopper[_0x286a('0xbe')](_0x4fedba,_0x12ef58,_0x9c44f6))[_0x286a('0xb3')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x286a('0x18')][_0x286a('0xbf')]=function(_0x1db2ec,_0x13fb39,_0x2d4d7c,_0x252c1f,_0x3926fe){return BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](cmHopper['getContactDialer'](_0x1db2ec,_0x13fb39,_0x2d4d7c,_0x252c1f))[_0x286a('0xb3')](function(_0x4850cb){_0x3926fe['temp']-=_0x2d4d7c;_0x3926fe[_0x286a('0xc0')]=_0x3926fe[_0x286a('0xc0')]>0x0?_0x3926fe[_0x286a('0xc0')]:0x0;loggerCatch(_0x286a('0xc1'))(_0x4850cb);});};Dialer[_0x286a('0x18')][_0x286a('0xc2')]=function(_0x430752,_0x4ca3ed,_0x5b8450,_0x4728b1){return BPromise['resolve']()[_0x286a('0xb8')](cmHopper['getContactDialerIvr'](_0x430752,_0x4ca3ed,_0x5b8450))[_0x286a('0xb3')](function(_0x5e4866){_0x4728b1['temp']-=_0x4ca3ed;_0x4728b1['temp']=_0x4728b1['temp']>0x0?_0x4728b1['temp']:0x0;loggerCatch(_0x286a('0xc3'))(_0x5e4866);});};Dialer[_0x286a('0x18')][_0x286a('0xc4')]=function(_0x4a21b0){return BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](voiceQueueRt[_0x286a('0xc4')](_0x4a21b0))[_0x286a('0xb3')](loggerCatch(_0x286a('0xc5')));};Dialer[_0x286a('0x18')][_0x286a('0xc6')]=function(_0x15183b){return BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](cmHopper[_0x286a('0xc6')](_0x15183b))[_0x286a('0xb3')](loggerCatch(_0x286a('0xc7')));};Dialer['prototype'][_0x286a('0xc8')]=function(_0x1f61c7){return BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](cmHopperHistory[_0x286a('0xc8')](_0x1f61c7))['catch'](loggerCatch(_0x286a('0xc9')));};Dialer[_0x286a('0x18')]['updateOriginated']=function(_0x46333e){if(!_[_0x286a('0x37')](_0x46333e)&&_0x46333e!==null){if(typeof _0x46333e[_0x286a('0x6a')]!==_0x286a('0x96')){if(_0x46333e[_0x286a('0x6a')]>0x0){_0x46333e[_0x286a('0x6a')]-=0x1;}else{logger[_0x286a('0x92')](_0x286a('0xca'));}}}else{logger['error'](_0x286a('0xcb'));}};Dialer['prototype'][_0x286a('0xcc')]=function(_0x27c31a,_0x55dabb){var _0x14a52c=this;return function(_0xfdb70a){_0x14a52c[_0x286a('0xad')](_0x55dabb);logger[_0x286a('0x92')](_0x27c31a,util[_0x286a('0x94')](_0xfdb70a,{'showHidden':![],'depth':null}));};};Dialer[_0x286a('0x18')][_0x286a('0xcd')]=function(_0xb31274,_0x26f08a,_0x3004ee){var _0xcbc994={'state':0x19,'statedesc':_0x286a('0xce')};this[_0x286a('0xad')](_0x26f08a);this['saveInDb'](_[_0x286a('0x87')](_0xcbc994,_['pick'](_0x3004ee,['ContactId',_0x286a('0xcf'),_0x286a('0xd0'),_0x286a('0xd1'),'CampaignId'])),'[emptyContact][createHistory]',_0x286a('0xd2'));logger[_0x286a('0x92')](_0xb31274);};Dialer[_0x286a('0x18')]['isSuccess']=function(_0x4003fc){return _0x4003fc===_0x286a('0xd3');};Dialer['prototype']['isTrunkReachable']=function(_0x3866d1){return!_[_0x286a('0x37')](_0x3866d1)&&_0x3866d1&&!_['isUndefined'](_0x3866d1['name'])&&!_[_0x286a('0x37')](_0x3866d1['active'])&&_0x3866d1[_0x286a('0x71')]&&(this[_0x286a('0xd4')][util[_0x286a('0x73')](_0x286a('0xd5'),_0x3866d1[_0x286a('0x38')])][_0x286a('0xab')]===_0x286a('0xd6')||this[_0x286a('0xd4')][util['format'](_0x286a('0xd5'),_0x3866d1[_0x286a('0x38')])][_0x286a('0xab')]===_0x286a('0xd7'));};Dialer[_0x286a('0x18')]['saveInDb']=function(_0x5f3a25,_0x597a4c,_0x1ef0db){this[_0x286a('0xc8')](_0x5f3a25)['catch'](loggerCatch(_0x597a4c));this[_0x286a('0xc6')](_0x5f3a25)['catch'](loggerCatch(_0x1ef0db));};Dialer[_0x286a('0x18')][_0x286a('0xd8')]=function(_0x21faf0){var _0x3e1987=this['uniqueId'][_0x21faf0[_0x286a('0xd9')]];var _0x448cc2;if(!_[_0x286a('0xda')](_0x21faf0)&&!_[_0x286a('0xda')](_0x21faf0['variable'])&&!_[_0x286a('0xda')](_0x21faf0[_0x286a('0xdb')][_0x286a('0xdc')])&&_0x21faf0[_0x286a('0xdd')]===_0x286a('0xde')&&_0x3e1987){if(_0x3e1987['type']!==_0x286a('0x8e')&&this[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0xe0')]&&_0x21faf0[_0x286a('0xe1')]===_0x286a('0xe2')){delete this[_0x286a('0x22')][_0x21faf0[_0x286a('0xd9')]];this[_0x286a('0xad')](this[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]]);this['voiceQueues'][_0x3e1987['queue']][_0x286a('0x57')]+=0x1;this[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0x56')]+=0x1;_0x448cc2=new Hangup(_0x3e1987,_0x21faf0);_0x448cc2[_0x286a('0xe3')]=0x12;_0x448cc2[_0x286a('0xe4')]=_0x286a('0xe5');_0x448cc2[_0x286a('0xe6')]='AMD';ami[_0x286a('0x45')]('custom:amd',ut['buildObj'](_0x448cc2,_0x286a('0xe7')));this['saveInDb'](_0x448cc2,_0x286a('0xe8'),_0x286a('0xe9'));}if(_0x3e1987[_0x286a('0x46')]!==_0x286a('0x8e')&&this[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0xe0')]&&_0x21faf0[_0x286a('0xe1')]==='MACHINE'){var _0x5178d6=this;return new BPromise(function(_0x2f1ca3,_0x15dedc){delete _0x5178d6[_0x286a('0x22')][_0x21faf0[_0x286a('0xd9')]];_0x5178d6[_0x286a('0xad')](_0x5178d6[_0x286a('0xdf')][_0x3e1987['queue']]);_0x5178d6[_0x286a('0xdf')][_0x3e1987['queue']][_0x286a('0x57')]+=0x1;_0x5178d6[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0x56')]+=0x1;var _0x5b829a=_0x5178d6[_0x286a('0xdf')][_0x3e1987[_0x286a('0xaf')]];var _0x5551d8=new Hangup(_0x3e1987,_0x21faf0);_0x5551d8[_0x286a('0xe3')]=0x13;_0x5551d8[_0x286a('0xe4')]=_0x286a('0xea');_0x5551d8['membername']=_0x286a('0xeb');_0x5551d8[_0x286a('0xec')]+=0x1;_0x5551d8[_0x286a('0xed')]+=0x1;_0x5551d8[_0x286a('0xe7')]=!![];ami[_0x286a('0x45')](_0x286a('0xee'),ut[_0x286a('0xef')](_0x5551d8,_0x286a('0xe7')));_0x5178d6[_0x286a('0xc8')](_0x5551d8)['catch'](loggerCatch(_0x286a('0xf0')));if(_0x5551d8[_0x286a('0xf1')]+_0x5551d8[_0x286a('0xf2')]+_0x5551d8['countnoanswerretry']+_0x5551d8['countnosuchnumberretry']+_0x5551d8[_0x286a('0xf3')]+_0x5551d8[_0x286a('0xf4')]+_0x5551d8[_0x286a('0xec')]+_0x5551d8[_0x286a('0xf5')]>=_0x5b829a[_0x286a('0xf6')]){_0x5178d6['stateGlobal'](_0x5551d8,_0x2f1ca3,_0x15dedc,_0x286a('0xf7'));}else{if(_0x5551d8[_0x286a('0xec')]>=_0x5b829a[_0x286a('0xf8')]){_0x5178d6[_0x286a('0xf9')](_0x5551d8,_0x2f1ca3,_0x15dedc,_0x286a('0xfa'));}else{_0x5178d6['rescheduleContact']({'active':![],'countmachineretry':_0x5551d8[_0x286a('0xec')],'scheduledat':moment()[_0x286a('0xfb')](_0x5b829a[_0x286a('0xfc')],_0x286a('0xfd'))[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x5551d8[_0x286a('0xff')],'ListId':_0x5551d8[_0x286a('0xcf')],'VoiceQueueId':_0x5551d8[_0x286a('0xd1')]||undefined,'CampaignId':_0x5551d8['CampaignId']||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x100')));_0x2f1ca3({'reschedule':0x1});}}});}if(_0x3e1987[_0x286a('0x46')]===_0x286a('0x8e')&&this[_0x286a('0x1c')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0xe0')]&&_0x21faf0[_0x286a('0xe1')]===_0x286a('0xe2')){delete this[_0x286a('0x22')][_0x21faf0[_0x286a('0xd9')]];this[_0x286a('0xad')](this[_0x286a('0x1c')][_0x3e1987[_0x286a('0xaf')]]);_0x448cc2=new Hangup(_0x3e1987,_0x21faf0);_0x448cc2['state']=0x12;_0x448cc2['statedesc']=_0x286a('0xe5');_0x448cc2[_0x286a('0xe6')]='AMD';ami['emit'](_0x286a('0xee'),ut[_0x286a('0xef')](_0x448cc2,_0x286a('0xe7')));this[_0x286a('0x101')](_0x448cc2,_0x286a('0x102'),_0x286a('0x103'));}if(_0x3e1987[_0x286a('0x46')]==='ivr'&&this[_0x286a('0x1c')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0xe0')]&&_0x21faf0[_0x286a('0xe1')]===_0x286a('0x104')){var _0x5178d6=this;return new BPromise(function(_0x5776c1,_0x15fb01){delete _0x5178d6['uniqueId'][_0x21faf0[_0x286a('0xd9')]];_0x5178d6[_0x286a('0xad')](_0x5178d6[_0x286a('0x1c')][_0x3e1987['queue']]);_0x5178d6[_0x286a('0x1c')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0x57')]+=0x1;_0x5178d6[_0x286a('0x1c')][_0x3e1987[_0x286a('0xaf')]][_0x286a('0x56')]+=0x1;var _0x2b412d=_0x5178d6['campaigns'][_0x3e1987[_0x286a('0xaf')]];var _0x54da18=new Hangup(_0x3e1987,_0x21faf0);_0x54da18[_0x286a('0xe3')]=0x13;_0x54da18[_0x286a('0xe4')]=_0x286a('0xea');_0x54da18[_0x286a('0xe6')]=_0x286a('0xeb');_0x54da18[_0x286a('0xec')]+=0x1;_0x54da18['countglobal']+=0x1;_0x54da18[_0x286a('0xe7')]=!![];ami[_0x286a('0x45')](_0x286a('0xee'),ut[_0x286a('0xef')](_0x54da18,_0x286a('0xe7')));_0x5178d6['createHistory'](_0x54da18)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54da18[_0x286a('0xf1')]+_0x54da18[_0x286a('0xf2')]+_0x54da18[_0x286a('0x105')]+_0x54da18[_0x286a('0x106')]+_0x54da18[_0x286a('0xf3')]+_0x54da18[_0x286a('0xf4')]+_0x54da18[_0x286a('0xec')]+_0x54da18['countagentrejectretry']>=_0x2b412d[_0x286a('0xf6')]){_0x5178d6[_0x286a('0x107')](_0x54da18,_0x5776c1,_0x15fb01,_0x286a('0xf7'));}else{if(_0x54da18[_0x286a('0xec')]>=_0x2b412d['dialMachineMaxRetry']){_0x5178d6[_0x286a('0xf9')](_0x54da18,_0x5776c1,_0x15fb01,_0x286a('0xfa'));}else{_0x5178d6[_0x286a('0xbc')]({'active':![],'countmachineretry':_0x54da18[_0x286a('0xec')],'scheduledat':moment()[_0x286a('0xfb')](_0x2b412d[_0x286a('0xfc')],'minutes')[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x54da18[_0x286a('0xff')],'ListId':_0x54da18[_0x286a('0xcf')],'VoiceQueueId':_0x54da18[_0x286a('0xd1')]||undefined,'CampaignId':_0x54da18[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x100')));_0x5776c1({'reschedule':0x1});}}});}}};Dialer[_0x286a('0x18')][_0x286a('0x109')]=function(_0x489747){var _0x8d29dc=this['uniqueId'][_0x489747[_0x286a('0xd9')]];var _0xff769c=this;var _0x3433ab;if(_0x8d29dc&&_0x8d29dc[_0x286a('0x46')]===_0x286a('0x8e')){delete this[_0x286a('0x22')][_0x489747[_0x286a('0xd9')]];this[_0x286a('0xad')](this[_0x286a('0x1c')][_0x8d29dc[_0x286a('0xaf')]]);this[_0x286a('0x1c')][_0x8d29dc[_0x286a('0xaf')]][_0x286a('0x10a')]+=0x1;_0x3433ab=new Hangup(_0x8d29dc,_0x489747);this[_0x286a('0xc8')](_0x3433ab)[_0x286a('0xb3')](loggerCatch(_0x286a('0x10b')));this['moveContactManagedDialer'](_0x3433ab)['catch'](loggerCatch(_0x286a('0x10c')));}if(_0x8d29dc&&_0x8d29dc['type']!=='ivr'&&isNotNull(this[_0x286a('0xdf')][_0x8d29dc[_0x286a('0xaf')]][_0x286a('0x10d')])){delete this[_0x286a('0x22')][_0x489747[_0x286a('0xd9')]];this[_0x286a('0xad')](this[_0x286a('0xdf')][_0x8d29dc[_0x286a('0xaf')]]);this[_0x286a('0xdf')][_0x8d29dc['queue']][_0x286a('0x57')]+=0x1;this[_0x286a('0xdf')][_0x8d29dc[_0x286a('0xaf')]][_0x286a('0x56')]+=0x1;_0x3433ab=new Hangup(_0x8d29dc,_0x489747);_0x3433ab[_0x286a('0xe3')]=0x10;_0x3433ab[_0x286a('0xe4')]=_0x286a('0x10e');_0x3433ab[_0x286a('0xe6')]=_0x286a('0x10f');this[_0x286a('0xc8')](_0x3433ab)[_0x286a('0xb3')](loggerCatch(_0x286a('0x10b')));this[_0x286a('0xc6')](_0x3433ab)[_0x286a('0xb3')](loggerCatch(_0x286a('0x10c')));}if(_0x8d29dc&&_0x8d29dc['type']!==_0x286a('0x8e')&&!isNotNull(this['voiceQueues'][_0x8d29dc[_0x286a('0xaf')]]['dialQueueProject'])){delete this[_0x286a('0x22')][_0x489747[_0x286a('0xd9')]];this[_0x286a('0xad')](this['voiceQueues'][_0x8d29dc[_0x286a('0xaf')]]);this['voiceQueues'][_0x8d29dc[_0x286a('0xaf')]][_0x286a('0x110')]+=0x1;_0x3433ab=new Hangup(_0x8d29dc,_0x489747);_0x3433ab['state']=0xc;_0x3433ab['statedesc']=_0x489747[_0x286a('0x111')];_0x3433ab[_0x286a('0xe6')]=_0x286a('0x112');this[_0x286a('0xc8')](_0x3433ab)['catch'](loggerCatch(_0x286a('0x10b')));this['moveContactManagedDialer'](_0x3433ab)[_0x286a('0xb3')](loggerCatch(_0x286a('0x10c')));}};Dialer['prototype'][_0x286a('0x113')]=function(_0x5b1f7c){var _0x291182=this[_0x286a('0x22')][_0x5b1f7c[_0x286a('0xd9')]];var _0x4d8aa0=this;if(this['voiceQueues'][_0x5b1f7c[_0x286a('0xaf')]]){if(_0x291182&&_0x291182[_0x286a('0x46')]!==_0x286a('0x8e')){delete this[_0x286a('0x22')][_0x5b1f7c[_0x286a('0xd9')]];this['voiceQueues'][_0x5b1f7c[_0x286a('0xaf')]][_0x286a('0x57')]+=0x1;var _0x25bd7b=new AgentComplete(_0x291182,_0x5b1f7c);if(_0x5b1f7c[_0x286a('0x114')]===_0x286a('0x115')){_0x25bd7b[_0x286a('0x116')]=this[_0x286a('0xdf')][_0x5b1f7c['queue']]['dialQueueProject2']&&this[_0x286a('0xdf')][_0x5b1f7c[_0x286a('0xaf')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x286a('0xfe')):undefined;}this['createHistory'](_0x25bd7b)[_0x286a('0xb3')](loggerCatch(_0x286a('0x117')));this[_0x286a('0xc6')](_0x25bd7b)[_0x286a('0xb3')](loggerCatch(_0x286a('0x118')));}}};Dialer[_0x286a('0x18')][_0x286a('0x119')]=function(_0x16f887){if(this[_0x286a('0xdf')][_0x16f887[_0x286a('0xaf')]]){if(this['uniqueId'][_0x16f887['uniqueid']]&&this[_0x286a('0x22')][_0x16f887['uniqueid']]['type']!==_0x286a('0x8e')){this[_0x286a('0xad')](this[_0x286a('0xdf')][_0x16f887[_0x286a('0xaf')]]);this[_0x286a('0x22')][_0x16f887[_0x286a('0xd9')]]['answertime']=moment()['format'](_0x286a('0xfe'));}}};Dialer['prototype'][_0x286a('0x11a')]=function(_0xb4d5ed){this[_0x286a('0xc8')](_0xb4d5ed)[_0x286a('0xb3')](loggerCatch(_0x286a('0x117')));this[_0x286a('0xc6')](_0xb4d5ed)[_0x286a('0xb3')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x286a('0x18')]['syncQueueCallerAbandon']=function(_0x49ef1e){var _0x37f20e=this['uniqueId'][_0x49ef1e[_0x286a('0xd9')]];var _0x45fa5b=this;if(this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]]){if(_0x37f20e&&_0x37f20e['type']!==_0x286a('0x8e')){delete this[_0x286a('0x22')][_0x49ef1e[_0x286a('0xd9')]];this[_0x286a('0xad')](this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]]);_0x37f20e[_0x286a('0x11b')]=moment()[_0x286a('0x73')](_0x286a('0xfe'));var _0x3eace1=new QueueCallerAbandon(_0x37f20e,_0x49ef1e);if(getSeconds(_0x37f20e[_0x286a('0x11b')],_0x37f20e['responsetime'])>=_0x37f20e[_0x286a('0x11c')]){this['voiceQueues'][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x65')]+=0x1;this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x5c')]+=0x1;this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3eace1[_0x286a('0xe3')]=0xa;_0x3eace1['statedesc']=_0x286a('0x11d');_0x3eace1[_0x286a('0x11e')]='TIMEOUT';_0x3eace1[_0x286a('0x116')]=this['voiceQueues'][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x11f')]?moment()[_0x286a('0x73')](_0x286a('0xfe')):undefined;_0x3eace1[_0x286a('0xf3')]+=0x1;_0x3eace1[_0x286a('0xed')]+=0x1;if(_0x3eace1[_0x286a('0xf3')]>=this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x120')]){this[_0x286a('0x11a')](_0x3eace1);}else{this[_0x286a('0xbc')]({'active':![],'countdropretry':_0x3eace1[_0x286a('0xf3')],'scheduledat':moment()['add'](this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]]['dialDropRetryFrequency'],'minutes')[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x37f20e['ContactId'],'ListId':_0x37f20e['ListId'],'VoiceQueueId':_0x37f20e[_0x286a('0xd1')]||undefined,'CampaignId':_0x37f20e[_0x286a('0x108')]||undefined})['catch'](loggerCatch(_0x286a('0x121')));var _0x361680=new History(_0x3eace1);_0x361680['state']=0xa;_0x361680[_0x286a('0xe4')]='Drop';_0x361680['starttime']=moment()[_0x286a('0x73')](_0x286a('0xfe'));_0x361680[_0x286a('0xa5')]=_0x361680[_0x286a('0xa6')];_0x361680[_0x286a('0x122')]=_0x3eace1[_0x286a('0x122')];_0x361680['calleridnum']=_0x3eace1['calleridnum'];this[_0x286a('0xc8')](_0x361680)[_0x286a('0xb3')](loggerCatch(_0x286a('0x123')));}}else{this['voiceQueues'][_0x49ef1e['queue']][_0x286a('0x64')]+=0x1;this[_0x286a('0xdf')][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x5b')]+=0x1;_0x3eace1[_0x286a('0xe3')]=0xb;_0x3eace1[_0x286a('0xe4')]=_0x286a('0x124');_0x3eace1[_0x286a('0x11e')]=_0x286a('0x125');_0x3eace1['countabandonedretry']+=0x1;_0x3eace1[_0x286a('0xed')]+=0x1;if(_0x3eace1['countabandonedretry']>=this['voiceQueues'][_0x49ef1e[_0x286a('0xaf')]][_0x286a('0x126')]){this[_0x286a('0x11a')](_0x3eace1);}else{this[_0x286a('0xbc')]({'active':![],'countabandonedretry':_0x3eace1[_0x286a('0xf4')],'scheduledat':moment()[_0x286a('0xfb')](this[_0x286a('0xdf')][_0x49ef1e['queue']][_0x286a('0x127')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x37f20e['ContactId'],'ListId':_0x37f20e[_0x286a('0xcf')],'VoiceQueueId':_0x37f20e[_0x286a('0xd1')]||undefined,'CampaignId':_0x37f20e['CampaignId']||undefined})['catch'](loggerCatch(_0x286a('0x128')));var _0x361680=new History(_0x3eace1);_0x361680['state']=0xb;_0x361680[_0x286a('0xe4')]=_0x286a('0x124');_0x361680[_0x286a('0xa6')]=moment()[_0x286a('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x361680[_0x286a('0xa5')]=_0x361680[_0x286a('0xa6')];_0x361680[_0x286a('0x122')]=_0x3eace1[_0x286a('0x122')];_0x361680['calleridnum']=_0x3eace1[_0x286a('0x129')];this[_0x286a('0xc8')](_0x361680)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x286a('0x18')][_0x286a('0x2f')]=function(_0x193c4b){if(this[_0x286a('0x20')][_0x193c4b[_0x286a('0xd9')]]){this[_0x286a('0x20')][_0x193c4b[_0x286a('0xd9')]][_0x286a('0xac')]=_0x193c4b['channel'];}if(this[_0x286a('0x22')][_0x193c4b[_0x286a('0xd9')]]){this[_0x286a('0x22')][_0x193c4b[_0x286a('0xd9')]][_0x286a('0xac')]=_0x193c4b[_0x286a('0xac')];}};Dialer[_0x286a('0x18')][_0x286a('0x32')]=function(_0x5790d6){if(strategy[this['voiceQueues'][this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0xaf')]]['strategy']]===_0x286a('0x17')){if(this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]]&&_[_0x286a('0xda')](this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0x12b')])&&_0x5790d6[_0x286a('0xab')]==='1'&&_0x5790d6[_0x286a('0x12c')]==='0'){if(this[_0x286a('0x1d')][_0x5790d6[_0x286a('0x12d')]]){if(!this[_0x286a('0x1d')][_0x5790d6[_0x286a('0x12d')]]['locked']){this[_0x286a('0x1d')][_0x5790d6[_0x286a('0x12d')]]['locked']=!![];this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]]['locked']=!![];this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0x12d')]=_0x5790d6[_0x286a('0x12d')];}}}}else if((strategy[this[_0x286a('0xdf')][this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0xaf')]][_0x286a('0x47')]]||_0x286a('0x16'))===_0x286a('0x16')){if(this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]]){if(this[_0x286a('0x1d')][_0x5790d6['stateinterface']]){this['actions'][_0x5790d6[_0x286a('0x12a')]][_0x286a('0x12d')]=_0x5790d6[_0x286a('0x12d')];if(_[_0x286a('0xda')](this['queueBooked'][this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0xaf')]])){this[_0x286a('0x12e')][this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]]['queue']]=[];}this[_0x286a('0x12e')][this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]][_0x286a('0xaf')]][_0x286a('0x12f')](_[_0x286a('0x87')](_[_0x286a('0x130')](this[_0x286a('0x20')][_0x5790d6[_0x286a('0x12a')]],[_0x286a('0x131'),_0x286a('0x12d')]),{'status':_0x5790d6['status'],'paused':_0x5790d6['paused']}));}}}};function unlockQueueStatus(_0x1b4084,_0x489382){setTimeout(function(){if(_[_0x286a('0x37')](_0x1b4084[_0x286a('0x132')])){loggerBooked[_0x286a('0x92')]('[unlockQueueStatus][undefined]',_0x489382);}_0x1b4084[_0x286a('0x132')]=!![];loggerBooked[_0x286a('0x78')](_0x286a('0x133'),_0x489382,JSON[_0x286a('0x134')](_['pick'](_0x1b4084,['name',_0x286a('0x132')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0xcd74c3){var _0x659f13=this;var _0x439e61=_0x659f13[_0x286a('0xdf')][_0x659f13[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]];if(strategy[this[_0x286a('0xdf')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]][_0x286a('0x47')]]===_0x286a('0x17')){if(this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]]&&this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]]['stateinterface']){this[_0x286a('0x1b')][_0x286a('0x135')](this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0x131')],this['actions'][_0xcd74c3[_0x286a('0x12a')]]['stateinterface'])[_0x286a('0xb3')](function(_0x4dabe9){logger[_0x286a('0x92')](_0x286a('0x136'),util[_0x286a('0x94')](_0x4dabe9,{'showHidden':![],'depth':null}));})[_0x286a('0x137')](function(){_0x659f13[_0x286a('0xad')](_0x659f13[_0x286a('0xdf')][_0x659f13[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]]);_0x659f13['agents'][_0x659f13[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0x12d')]][_0x286a('0x12b')]=![];delete _0x659f13[_0x286a('0x20')][_0xcd74c3['actionid']];unlockQueueStatus(_0x439e61);});}else{this[_0x286a('0xad')](this[_0x286a('0xdf')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xff')],'ListId':this[_0x286a('0x20')][_0xcd74c3['actionid']]['ListId'],'VoiceQueueId':this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xd1')]||undefined,'CampaignId':this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x286a('0x20')][_0xcd74c3['actionid']];unlockQueueStatus(_0x439e61);}}else if((strategy[this[_0x286a('0xdf')][this[_0x286a('0x20')][_0xcd74c3['actionid']][_0x286a('0xaf')]][_0x286a('0x47')]]||'rrmemory')===_0x286a('0x16')){var _0x8530fe;if(this['actions'][_0xcd74c3[_0x286a('0x12a')]]&&!_[_0x286a('0x40')](this[_0x286a('0x12e')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]])){if(this['queueBookedRR'][_0x659f13[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]]){this[_0x286a('0x25')][_0x659f13['actions'][_0xcd74c3[_0x286a('0x12a')]]['queue']]=this['queueBookedRR'][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]]?this[_0x286a('0x25')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]]:this['queueBooked'][this[_0x286a('0x20')][_0xcd74c3['actionid']][_0x286a('0xaf')]]?this[_0x286a('0x12e')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]]['queue']]['_rr']||0x0:0x0;}this[_0x286a('0x12e')][this[_0x286a('0x20')][_0xcd74c3['actionid']]['queue']]['_rr']=this[_0x286a('0x25')][this[_0x286a('0x20')][_0xcd74c3[_0x286a('0x12a')]][_0x286a('0xaf')]];for(var _0x53ed8d=0x0;_0x53ed8d=0x0;})[_0x286a('0xb3')](myreject(_0x4d67e4)));}}else{_0x1ee7c2['push'](ami[_0x286a('0x150')]({'action':'command','command':util[_0x286a('0x73')](_0x286a('0x153'),_0x4f3549,!_['isUndefined'](config[_0x286a('0x14c')][_0x2309e6])?_0x2309e6:'')})[_0x286a('0xb8')](function(_0x366e67){return _0x366e67[_0x286a('0x154')][_0x286a('0x155')](_0x286a('0x156'))>=0x0;})[_0x286a('0xb3')](myreject(_0x4d67e4)));}BPromise[_0x286a('0x157')](_0x1ee7c2)['then'](function(_0x407a7a){var _0x2c6717=_['some'](_0x407a7a);if(_0x2c6717){return _0x50797c(_0x2c6717);}else{_0x478282[_0x286a('0x3c')]=_0x137705?_0x286a('0x158'):_0x286a('0x159');return _0x4d67e4(msgResponse(_0x286a('0x15a'),_0x286a('0x148'),_0x286a('0x15b')+_0x137705+'\x20'+_0x4e5978+'\x20Interval\x20is\x20overtime:\x20'+util[_0x286a('0x94')](_0x4f3549,{'showHidden':![],'depth':null})+_0x286a('0x15c')+_0x2309e6));}})[_0x286a('0xb3')](function(_0x8947cb){return _0x4d67e4(msgResponse(_0x286a('0x146'),'Failure',JSON['stringify'](_0x8947cb)));});});};Dialer[_0x286a('0x18')][_0x286a('0x15d')]=function(_0x2fae7d){var _0x7a4f56=this;return function(){switch(_0x2fae7d[_0x286a('0x51')]){case _0x286a('0x15e'):freeVariablesPredictive(_0x2fae7d);_0x7a4f56[_0x286a('0x15f')](_0x2fae7d,0x1);break;case _0x286a('0x160'):freeVariablesPredictive(_0x2fae7d);_0x7a4f56['handlePower'](_0x2fae7d,_0x2fae7d[_0x286a('0x161')]);break;case _0x286a('0x162'):_0x7a4f56[_0x286a('0x162')](_0x2fae7d);break;case'booked':freeVariablesPredictive(_0x2fae7d);_0x7a4f56['handlePower'](_0x2fae7d,0x1);break;default:freeVariablesPredictive(_0x2fae7d);logger[_0x286a('0x92')](_0x286a('0x163'),_0x2fae7d[_0x286a('0x38')],'method\x20not\x20recognized');}};};Dialer['prototype']['launchHandleIvr']=function(_0x2a0084){var _0x5c88f0=this;return function(){_0x5c88f0[_0x286a('0x164')](_0x2a0084);};};Dialer[_0x286a('0x18')]['syncQueueSummary']=function(_0x5ab457){var _0x492774=this;if(isNotPreview(_0x5ab457[_0x286a('0x51')])){if(isVoiceQueueOutbound(_0x5ab457[_0x286a('0x46')])&&isActive(_0x5ab457[_0x286a('0x50')])){_0x5ab457[_0x286a('0x165')]=!![];BPromise['resolve']()[_0x286a('0xb8')](checkIsLoggedIn(_0x5ab457,_0x5ab457['loggedIn']))[_0x286a('0xb8')](checkIsActive(_0x5ab457,_0x5ab457[_0x286a('0x50')]))[_0x286a('0xb8')](checkInterval(_0x5ab457))['then'](_0x492774['checkIsTrunkReachable'](_0x5ab457))[_0x286a('0xb8')](_0x492774[_0x286a('0x166')](_0x5ab457['dialGlobalInterval'],_0x5ab457['dialTimezone'],_0x5ab457[_0x286a('0x38')],_0x5ab457))[_0x286a('0xb8')](_0x492774['checkIfTimeIntervals'](_0x5ab457[_0x286a('0x3b')],_0x5ab457[_0x286a('0x167')],_0x5ab457[_0x286a('0x38')],_0x5ab457))[_0x286a('0xb8')](_0x492774[_0x286a('0x15d')](_0x5ab457))['catch'](loggerCatchQueueSummary(_0x286a('0x168'),_0x5ab457));}else{notSendMessagesQueue(_0x5ab457);}}else{freeVariablesPredictive(_0x5ab457);}};Dialer[_0x286a('0x18')]['syncCampaigns']=function(){var _0x2d0793=this;var _0x5643de;for(var _0x274145 in this[_0x286a('0x1c')]){if(typeof this[_0x286a('0x1c')][_0x274145]!=='undefined'){_0x5643de=this['campaigns'][_0x274145];if(isCampaignIvr(_0x5643de[_0x286a('0x46')])&&isActive(_0x5643de[_0x286a('0x71')])){_0x5643de[_0x286a('0x165')]=!![];BPromise[_0x286a('0xb2')]()[_0x286a('0xb8')](checkIsActive(_0x5643de,_0x5643de[_0x286a('0x71')]))[_0x286a('0xb8')](checkInterval(_0x5643de))[_0x286a('0xb8')](_0x2d0793['checkIsTrunkReachable'](_0x5643de))['then'](_0x2d0793[_0x286a('0x166')](_0x5643de[_0x286a('0x169')],_0x5643de['dialTimezone'],_0x5643de[_0x286a('0x38')],_0x5643de))[_0x286a('0xb8')](_0x2d0793[_0x286a('0x147')](_0x5643de['Interval'],_0x5643de[_0x286a('0x167')],_0x5643de[_0x286a('0x38')],_0x5643de))[_0x286a('0xb8')](_0x2d0793['launchHandleIvr'](_0x5643de))[_0x286a('0xb3')](loggerCatchQueueSummary(_0x286a('0x16a'),_0x5643de));}else{notSendMessagesCampaign(_0x5643de);}}}};function getCallerIdRandom(_0x1941ac,_0x7140a7){var _0x4d1a26;var _0x3d1cd3;var _0x25a554;if(_0x7140a7<=0x0){_0x7140a7=0x1;}_0x4d1a26=new RegExp('\x5cw{0,'+_0x7140a7+'}$');_0x3d1cd3=Math[_0x286a('0x16b')](0xa,_0x7140a7-0x1);_0x25a554=Math[_0x286a('0x16b')](0xa,_0x7140a7)-0x1;return util['format']('%s',_[_0x286a('0x16c')](_0x1941ac,_0x4d1a26,_[_0x286a('0x16d')](_0x3d1cd3,_0x25a554)));}function extractCalleridName(_0x263014){var _0x18ef4a=_0x263014['match'](/"(.*?)"/);return _0x18ef4a?_0x18ef4a[0x1]:_0x263014;}function extractCalleridNumber(_0x19dac3){var _0x33810f=_0x19dac3[_0x286a('0x16e')](/<(.*?)>/);return _0x33810f?_0x33810f[0x1]:_0x19dac3;}Dialer[_0x286a('0x18')][_0x286a('0x16f')]=function(_0x184d39,_0x2ecc1e){var _0x513c9c=this;var _0x201561=uuid['v4']();this[_0x286a('0x20')][_0x201561]=new Action(_0x184d39,_0x2ecc1e,_0x201561);return new BPromise(function(_0x5ea9b2,_0x4d5928){if(_[_0x286a('0x37')](_0x184d39)&&typeof _0x184d39!==_0x286a('0x170')){return _0x4d5928(msgResponse(_0x286a('0x171'),_0x286a('0x148'),_0x286a('0x172')));}if(_[_0x286a('0x37')](_0x2ecc1e[_0x286a('0x173')][_0x286a('0x174')])||_0x2ecc1e[_0x286a('0x173')][_0x286a('0x174')]===null){return _0x4d5928(msgResponse('originate',_0x286a('0x148'),_0x286a('0x175')));}var _0x156701={'XMD-CALLERID':_0x513c9c[_0x286a('0x20')][_0x201561][_0x286a('0x176')](),'XMD-AGI':_0x184d39[_0x286a('0x10d')]?util[_0x286a('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x184d39[_0x286a('0x10d')]):'NONE','XMD-AGIAFTER':_0x184d39['dialQueueProject2']?util[_0x286a('0x73')](_0x286a('0x177'),ipAgi,_0x184d39[_0x286a('0x11f')]):_0x286a('0x178'),'XMD-QUEUE':_0x184d39[_0x286a('0x46')]==='outbound'?util[_0x286a('0x73')](_0x286a('0x179'),_0x184d39[_0x286a('0x38')],_0x184d39[_0x286a('0x17a')]||'',_0x184d39[_0x286a('0x17b')]?'c':'',_0x184d39['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x2ecc1e[_0x286a('0xff')],'XMD-CDRTYPE':_0x286a('0x8'),'CALLERID(all)':_0x513c9c[_0x286a('0x20')][_0x201561][_0x286a('0x176')](),'XMD-AMD':_0x184d39[_0x286a('0xe0')]?_0x286a('0x17c'):_0x286a('0x178'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x184d39['dialAMDActive']){_0x156701['XMD-AMDINITIALSILENCE']=_0x184d39[_0x286a('0x17d')]||0x9c4;_0x156701['XMD-AMDGREETING']=_0x184d39['dialAMDGreeting']||0x5dc;_0x156701[_0x286a('0x17e')]=_0x184d39[_0x286a('0x17f')]||0x320;_0x156701[_0x286a('0x180')]=_0x184d39['dialAMDTotalAnalysisTime']||0x1388;_0x156701[_0x286a('0x181')]=_0x184d39[_0x286a('0x182')]||0x64;_0x156701[_0x286a('0x183')]=_0x184d39[_0x286a('0x184')]||0x32;_0x156701[_0x286a('0x185')]=_0x184d39['dialAMDMaximumNumberOfWords']||0x3;_0x156701[_0x286a('0x186')]=_0x184d39['dialAMDSilenceThreshold']||0x100;_0x156701[_0x286a('0x187')]=_0x184d39[_0x286a('0x188')]||0x1388;}if(_0x184d39['type']===_0x286a('0x8d')){_0x156701[_0x286a('0x189')]=_0x2ecc1e['VoiceQueueId'];}else{_0x156701['XMD-CAMPAIGNID']=_0x2ecc1e[_0x286a('0x108')];}for(var _0x431d44 in _0x2ecc1e[_0x286a('0x173')]){if(typeof _0x2ecc1e[_0x286a('0x173')][_0x431d44]!==_0x286a('0x96')){if(isNotNull(_0x2ecc1e['Contact'][_0x431d44])&&_0x431d44!=='id'&&_0x431d44!=='tags'&&_0x431d44!==_0x286a('0x18a')&&_0x431d44!==_0x286a('0x18b')){_0x156701[util[_0x286a('0x73')](_0x286a('0x18c'),_0x286a('0x18d'),_[_0x286a('0x18e')](_0x431d44))]=_0x2ecc1e[_0x286a('0x173')][_0x431d44];}}}var _0x3eb7ce=_0x513c9c['isTrunkReachable'](_0x184d39['Trunk'])?getCallerId(_0x184d39[_0x286a('0x70')][_0x286a('0x72')],_0x184d39['dialOriginateCallerIdName'],_0x184d39['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x184d39[_0x286a('0x53')],_0x184d39[_0x286a('0x18f')]):_0x184d39[_0x286a('0x53')]):getCallerId(_[_0x286a('0xda')](_0x184d39['TrunkBackup'])?_0x184d39[_0x286a('0x70')][_0x286a('0x72')]:_0x184d39['TrunkBackup']['callerid'],_0x184d39[_0x286a('0x52')],_0x184d39[_0x286a('0x18f')]>0x0?getCallerIdRandom(_0x184d39[_0x286a('0x53')],_0x184d39['dialRandomLastDigitCallerIdNumber']):_0x184d39[_0x286a('0x53')]);if(_0x3eb7ce){_0x156701[_0x286a('0x190')]=_0x513c9c['actions'][_0x201561][_0x286a('0x191')]=extractCalleridName(_0x3eb7ce);_0x156701[_0x286a('0x192')]=_0x513c9c[_0x286a('0x20')][_0x201561]['originatecalleridnum']=extractCalleridNumber(_0x3eb7ce);}return ami[_0x286a('0x150')]({'actionid':_0x201561,'action':_0x286a('0x171'),'channel':_0x513c9c[_0x286a('0x143')](_0x184d39[_0x286a('0x70')])?util[_0x286a('0x73')]('SIP/%s/%s%s',_0x184d39[_0x286a('0x70')]['name'],isNotNull(_0x184d39[_0x286a('0x55')])?_0x184d39[_0x286a('0x55')][_0x286a('0x193')]()||'':'',_0x184d39[_0x286a('0x194')]>0x0?_0x2ecc1e[_0x286a('0x173')][_0x286a('0x174')][_0x286a('0x195')](_0x184d39['dialCutDigit']):_0x2ecc1e[_0x286a('0x173')]['phone']):util[_0x286a('0x73')](_0x286a('0x196'),_[_0x286a('0xda')](_0x184d39['TrunkBackup'])?_0x184d39[_0x286a('0x70')][_0x286a('0x38')]:_0x184d39['TrunkBackup'][_0x286a('0x38')],isNotNull(_0x184d39['dialPrefix'])?_0x184d39[_0x286a('0x55')]['trim']()||'':'',_0x184d39[_0x286a('0x194')]>0x0?_0x2ecc1e[_0x286a('0x173')][_0x286a('0x174')]['substring'](_0x184d39['dialCutDigit']):_0x2ecc1e[_0x286a('0x173')]['phone']),'callerid':_0x3eb7ce,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x156701,'timeout':(_0x184d39[_0x286a('0x54')]||0x1e)*0x3e8,'async':!![],'channelid':_0x201561})[_0x286a('0xb8')](function(_0x45f219){return _0x5ea9b2(_0x45f219);})[_0x286a('0xb3')](function(_0x3a5288){_0x184d39['outboundOriginateFailureCallsDay']+=0x1;var _0x101f25=new History(_0x513c9c[_0x286a('0x20')][_0x201561]);logger[_0x286a('0x92')](util['format']('[originateError]:\x20%s',JSON[_0x286a('0x134')](_0x3a5288)));_0x101f25[_0x286a('0xe3')]=0xe;_0x101f25['statedesc']=_0x286a('0x197');_0x101f25[_0x286a('0xa6')]=moment()[_0x286a('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x101f25[_0x286a('0xa5')]=_0x101f25['starttime'];_0x513c9c[_0x286a('0xc8')](_0x101f25)['catch'](loggerCatch(_0x286a('0x198')));_0x513c9c[_0x286a('0xc6')](_0x101f25)[_0x286a('0xb3')](loggerCatch(_0x286a('0x198')))[_0x286a('0x137')](function(){delete _0x513c9c['actions'][_0x201561];return _0x4d5928(msgResponse(_0x286a('0x171'),_0x286a('0x42'),_0x286a('0x199')));});});});};Dialer['prototype'][_0x286a('0x2a')]=function(_0x3b6c3c){var _0x48207e=this[_0x286a('0x20')][_0x3b6c3c[_0x286a('0x12a')]];if(_0x48207e){delete this[_0x286a('0x20')][_0x3b6c3c['actionid']];_0x48207e['responsetime']=moment()[_0x286a('0x73')](_0x286a('0xfe'));var _0x39f123=_0x48207e['type']===_0x286a('0x8e')?this[_0x286a('0x1c')][_0x48207e[_0x286a('0xaf')]]:this[_0x286a('0xdf')][_0x48207e['getQueue']()];if(!this['isSuccess'](_0x3b6c3c['response'])){this[_0x286a('0xad')](_0x39f123);return this['callProgressDetecting'](_0x48207e,_0x39f123,_0x3b6c3c)[_0x286a('0xb3')](loggerCatch(_0x286a('0x19a')));}this[_0x286a('0x22')][_0x3b6c3c[_0x286a('0xd9')]]=_0x48207e;}};Dialer['prototype'][_0x286a('0x19b')]=function(_0x24e7a7,_0x19f5dc,_0x5c746a){var _0x508516=new History(_0x19f5dc);if(_0x508516['countbusyretry']+_0x508516[_0x286a('0xf2')]+_0x508516[_0x286a('0x105')]+_0x508516[_0x286a('0x106')]+_0x508516[_0x286a('0xf3')]+_0x508516[_0x286a('0xf4')]+_0x508516[_0x286a('0xec')]+_0x508516[_0x286a('0xf5')]>=_0x5c746a[_0x286a('0xf6')]-0x1){return!![];}switch(_0x24e7a7){case 0x3:if(_0x508516['countnoanswerretry']>=_0x5c746a[_0x286a('0x19c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x508516[_0x286a('0x105')]+=0x1,'scheduledat':moment()['add'](_0x5c746a['dialNoAnswerRetryFrequency'],_0x286a('0xfd'))['format'](_0x286a('0xfe')),'ContactId':_0x508516['ContactId'],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516[_0x286a('0xd1')]||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x19d')));break;case 0x5:if(_0x508516['countbusyretry']>=_0x5c746a[_0x286a('0x19e')]-0x1){return!![];}this[_0x286a('0xbc')]({'active':![],'countbusyretry':_0x508516[_0x286a('0xf1')]+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0x19f')],_0x286a('0xfd'))['format'](_0x286a('0xfe')),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516['VoiceQueueId']||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})['catch'](loggerCatch(_0x286a('0x1a0')));break;case 0x8:if(_0x508516[_0x286a('0xf2')]>=_0x5c746a[_0x286a('0x1a1')]-0x1){return!![];}this[_0x286a('0xbc')]({'active':![],'countcongestionretry':_0x508516[_0x286a('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x5c746a[_0x286a('0x1a2')],_0x286a('0xfd'))['format'](_0x286a('0xfe')),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516[_0x286a('0xd1')]||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})['catch'](loggerCatch(_0x286a('0x1a3')));break;case 0x0:if(_0x508516[_0x286a('0x106')]>=_0x5c746a[_0x286a('0x1a4')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x508516[_0x286a('0x106')]+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0x1a5')],_0x286a('0xfd'))[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x508516['ContactId'],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516['VoiceQueueId']||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x1a6')));}break;case 0xa:if(_0x508516[_0x286a('0xf3')]>=_0x5c746a[_0x286a('0x120')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x508516['countdropretry']+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0x1a7')],'minutes')[_0x286a('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516['VoiceQueueId']||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x121')));break;case 0xb:if(_0x508516[_0x286a('0xf4')]>=_0x5c746a['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x286a('0xbc')]({'active':![],'countabandonedretry':_0x508516[_0x286a('0xf4')]+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0x127')],_0x286a('0xfd'))[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516[_0x286a('0xd1')]||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x128')));break;case 0x13:if(_0x508516[_0x286a('0xec')]>=_0x5c746a['dialMachineMaxRetry']-0x1){return!![];}this[_0x286a('0xbc')]({'active':![],'countmachineretry':_0x508516[_0x286a('0xec')]+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0xfc')],_0x286a('0xfd'))[_0x286a('0x73')](_0x286a('0xfe')),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516[_0x286a('0xd1')]||undefined,'CampaignId':_0x508516['CampaignId']||undefined})[_0x286a('0xb3')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x508516[_0x286a('0xf5')]>=_0x5c746a[_0x286a('0x1a8')]-0x1){return!![];}this[_0x286a('0xbc')]({'active':![],'countagentrejectretry':_0x508516['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x286a('0xfb')](_0x5c746a[_0x286a('0x1a9')],'minutes')['format'](_0x286a('0xfe')),'ContactId':_0x508516[_0x286a('0xff')],'ListId':_0x508516[_0x286a('0xcf')],'VoiceQueueId':_0x508516['VoiceQueueId']||undefined,'CampaignId':_0x508516[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x286a('0x18')]['callProgressDetecting']=function(_0x47128a,_0x5083ea,_0x524175){var _0x1615d7=this;var _0x8a2477=new History(_0x47128a);return new BPromise(function(_0x34952f,_0x8462bb){if(_[_0x286a('0x37')](_0x5083ea)&&typeof _0x5083ea!=='object'){return _0x8462bb(msgResponse(_0x286a('0x1aa'),_0x286a('0x148'),'entity\x20is\x20undefine'));}if(_[_0x286a('0x37')](_0x524175)&&typeof _0x524175!==_0x286a('0x170')){return _0x8462bb(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}switch(_0x524175[_0x286a('0x114')]){case'0':_0x5083ea[_0x286a('0x5e')]+=0x1;_0x8a2477[_0x286a('0xe3')]=0x0;_0x8a2477['statedesc']='NoSuchNumber';_0x8a2477[_0x286a('0x106')]+=0x1;_0x8a2477[_0x286a('0xed')]+=0x1;ami[_0x286a('0x45')](_0x286a('0x1ab'),ut[_0x286a('0xef')](_0x47128a,'nosuchnumber'));_0x1615d7[_0x286a('0xc8')](_0x8a2477)['catch'](loggerCatch(_0x286a('0xf0')));if(_0x1615d7['checkRetriveMax'](0x0,_0x47128a,_0x5083ea)){if(_0x8a2477['countnosuchnumberretry']>=_0x5083ea[_0x286a('0x1a4')]){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1ac'));}else{_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1ac'));}}break;case'3':_0x5083ea[_0x286a('0x5d')]+=0x1;_0x8a2477[_0x286a('0xe3')]=0x3;_0x8a2477[_0x286a('0xe4')]=_0x286a('0x1ad');_0x8a2477[_0x286a('0x105')]+=0x1;_0x8a2477[_0x286a('0xed')]+=0x1;ami[_0x286a('0x45')](_0x286a('0x1ae'),ut[_0x286a('0xef')](_0x47128a,'noanswer'));_0x1615d7[_0x286a('0xc8')](_0x8a2477)[_0x286a('0xb3')](loggerCatch(_0x286a('0x1af')));if(_0x1615d7[_0x286a('0x19b')](0x3,_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0x105')]>=_0x5083ea['dialNoAnswerMaxRetry']){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1b0'));}else{_0x1615d7['stateGlobal'](_0x8a2477,_0x34952f,_0x8462bb,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5083ea[_0x286a('0x59')]+=0x1;_0x8a2477[_0x286a('0xe3')]=0x5;_0x8a2477[_0x286a('0xe4')]='Busy';_0x8a2477[_0x286a('0xf1')]+=0x1;_0x8a2477['countglobal']+=0x1;ami[_0x286a('0x45')](_0x286a('0x1b1'),ut[_0x286a('0xef')](_0x47128a,_0x286a('0x1b2')));_0x1615d7['createHistory'](_0x8a2477)[_0x286a('0xb3')](loggerCatch(_0x286a('0x1b3')));if(_0x1615d7['checkRetriveMax'](0x5,_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0xf1')]>=_0x5083ea[_0x286a('0x19e')]){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,'reason\x205\x20busy');}else{_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1b4'));}}break;case'8':_0x5083ea[_0x286a('0x1b5')]+=0x1;_0x8a2477[_0x286a('0xe3')]=0x8;_0x8a2477[_0x286a('0xe4')]=_0x286a('0x1b6');_0x8a2477[_0x286a('0xf2')]+=0x1;_0x8a2477[_0x286a('0xed')]+=0x1;ami['emit']('custom:agentcongestion',ut[_0x286a('0xef')](_0x47128a,_0x286a('0x1b7')));_0x1615d7[_0x286a('0xc8')](_0x8a2477)[_0x286a('0xb3')](loggerCatch(_0x286a('0x1b8')));if(_0x1615d7[_0x286a('0x19b')](0x8,_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0xf2')]>=_0x5083ea[_0x286a('0x1a1')]){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1b9'));}else{_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1b9'));}}break;case'11':_0x5083ea['outboundAbandonedCallsDay']+=0x1;_0x8a2477[_0x286a('0xe3')]=0xb;_0x8a2477['statedesc']=_0x286a('0x124');_0x8a2477[_0x286a('0xf4')]+=0x1;_0x8a2477[_0x286a('0xed')]+=0x1;_0x1615d7[_0x286a('0xc8')](_0x8a2477)[_0x286a('0xb3')](loggerCatch(_0x286a('0x1ba')));if(_0x1615d7[_0x286a('0x19b')](0xb,_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0xf4')]>=_0x5083ea[_0x286a('0x126')]){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1bb'));}else{_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,'reason\x2011\x20abandoned');}}break;case'20':_0x5083ea[_0x286a('0x1bc')]+=0x1;_0x8a2477['state']=0x14;_0x8a2477[_0x286a('0xe4')]=_0x286a('0x1bd');_0x8a2477['countagentrejectretry']+=0x1;_0x8a2477[_0x286a('0xed')]+=0x1;ami[_0x286a('0x45')](_0x286a('0x1be'),ut['buildObj'](_0x47128a,_0x286a('0x1bf')));_0x1615d7['createHistory'](_0x8a2477)['catch'](loggerCatch(_0x286a('0x1c0')));if(_0x1615d7['checkRetriveMax'](0x14,_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0xf5')]>=_0x5083ea['dialAgentRejectMaxRetry']){_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1c1'));}else{_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,_0x286a('0x1c1'));}}break;default:_0x5083ea[_0x286a('0x110')]+=0x1;_0x8a2477[_0x286a('0xe3')]=0xc;_0x8a2477[_0x286a('0xe4')]=_0x524175[_0x286a('0x114')];_0x1615d7['createHistory'](_0x8a2477)[_0x286a('0xb3')](loggerCatch(_0x286a('0x1c2')));if(_0x1615d7[_0x286a('0x19b')](_0x524175['reason'],_0x47128a,_0x5083ea)){if(_0x8a2477[_0x286a('0xf1')]+_0x8a2477[_0x286a('0xf2')]+_0x8a2477[_0x286a('0x105')]+_0x8a2477['countnosuchnumberretry']+_0x8a2477[_0x286a('0xf3')]+_0x8a2477['countabandonedretry']+_0x8a2477[_0x286a('0xec')]+_0x8a2477[_0x286a('0xf5')]>=_0x5083ea['dialGlobalMaxRetry']){_0x1615d7[_0x286a('0x107')](_0x8a2477,_0x34952f,_0x8462bb,_0x524175[_0x286a('0x114')]);}else{_0x1615d7[_0x286a('0xf9')](_0x8a2477,_0x34952f,_0x8462bb,_0x524175['reason']);}}}});};Dialer['prototype']['stateGlobal']=function(_0x430810,_0x53f0ca,_0x5be2ce,_0x260a8f){var _0xe9be87=new Final(_0x430810);_0xe9be87[_0x286a('0xe3')]=0xf;_0xe9be87[_0x286a('0xe4')]=_0x286a('0x1c3');this[_0x286a('0xf9')](_0xe9be87,_0x53f0ca,_0x5be2ce,_0x260a8f);};Dialer[_0x286a('0x18')][_0x286a('0xf9')]=function(_0x1dfde3,_0x3ac997,_0x8e2839,_0x2727fe){this[_0x286a('0xc6')](_0x1dfde3)['then'](function(){return _0x3ac997(msgResponse(_0x286a('0x1aa'),_0x286a('0xd3'),_0x2727fe));})[_0x286a('0xb3')](function(){return _0x8e2839(msgResponse(_0x286a('0x1c4'),_0x286a('0x148'),'contact\x20not\x20moved'));});};Dialer[_0x286a('0x18')][_0x286a('0x162')]=function(_0x373831){var _0x10f2f7=_0x373831[_0x286a('0x1c5')]/0x64;var _0x5669d1=_0x373831['outboundDropCallsDayTimeout']/(_0x373831[_0x286a('0x5c')]+_0x373831[_0x286a('0x57')]);var _0x24f3c4=Math[_0x286a('0x1c6')](_0x373831[_0x286a('0x1c7')]*(_0x373831[_0x286a('0x1c8')]/0x64));var _0x44a209=Math[_0x286a('0x1c6')](_0x373831['predictiveIntervalAvailable']*(_0x373831[_0x286a('0x1c9')]/0x64));var _0x250c10=_0x373831[_0x286a('0x9e')]+_0x373831[_0x286a('0x4c')];var _0x235ddc=Math[_0x286a('0x1ca')](_0x373831[_0x286a('0x6b')]*_0x373831[_0x286a('0x6d')]*_0x373831[_0x286a('0x1cb')]*_0x373831[_0x286a('0x1cc')]);if(_[_0x286a('0x37')](_0x373831[_0x286a('0x6f')])){if(!_[_0x286a('0x37')](_0x373831[_0x286a('0x6e')])){_0x373831[_0x286a('0x6e')]=undefined;loggerPredictive[_0x286a('0x92')]('[startMethodPredictive][StartProgressive]',_0x286a('0x1cd'));}if(!_['isUndefined'](_0x373831['handlePredictive'])){loggerPredictive[_0x286a('0x92')]('[startMethodPredictive][StartProgressive]',_0x286a('0x1ce'));clearInterval(_0x373831['handlePredictive']);_0x373831[_0x286a('0x8b')]=undefined;}_0x373831[_0x286a('0x6f')]=moment()[_0x286a('0x73')](_0x286a('0xfe'));loggerPredictive[_0x286a('0x78')](_0x373831[_0x286a('0x38')],'collection\x20data\x20in\x20progressive\x20at',_0x373831[_0x286a('0x6f')]);this['handlePower'](_0x373831,0x1);}else if(ifInterval(_0x373831[_0x286a('0x1cf')],_0x373831[_0x286a('0x6f')])){this['handlePower'](_0x373831,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x373831[_0x286a('0x6f')],_0x373831[_0x286a('0x38')]);_0x373831[_0x286a('0x6b')]=0x0;_0x373831[_0x286a('0x67')]=0x0;}else if(_0x10f2f7<_0x5669d1&&_0x373831[_0x286a('0x1d0')]===_0x286a('0x1d1')){freeVariablesPredictive(_0x373831);loggerPredictive['info'](_0x286a('0x1d2'),_0x286a('0x1d3'),_0x5669d1,_0x286a('0x6f'),_0x373831[_0x286a('0x38')]);}else if(_0x235ddc<_0x373831['predictiveIntervalErlangCallsDroppedCalls']&&_0x373831[_0x286a('0x1d0')]===_0x286a('0x1d1')){freeVariablesPredictive(_0x373831);loggerPredictive['info'](_0x286a('0x1d4'),_0x286a('0x1d5'),_0x235ddc,_0x286a('0x1d6'),_0x373831[_0x286a('0x67')],'startProgressive',_0x373831[_0x286a('0x38')]);}else if(!ifInterval(_0x373831[_0x286a('0x1cf')],_0x373831[_0x286a('0x6f')])&&_[_0x286a('0x37')](_0x373831[_0x286a('0x6e')])&&!_[_0x286a('0x37')](_0x373831[_0x286a('0x6f')])){_0x373831[_0x286a('0x6e')]=moment()[_0x286a('0x73')](_0x286a('0xfe'));loggerPredictive[_0x286a('0x78')](_0x373831['name'],'started\x20in\x20predictive\x20at',_0x373831[_0x286a('0x6e')]);this['averageHandleTime'](_0x373831['dialPredictiveInterval'])[_0x286a('0xb8')](this[_0x286a('0x1d7')](_0x373831))[_0x286a('0xb8')](mergeDataErlangB(_0x373831))[_0x286a('0xb8')](this[_0x286a('0x1d8')](_0x373831))[_0x286a('0xb3')](loggerCatchPredictive(_0x286a('0x1d9'),_0x373831));}else if(!ifInterval(_0x373831[_0x286a('0x1cf')],_0x373831[_0x286a('0x6e')])){_0x373831['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x373831['startPredictive']=moment()[_0x286a('0x73')](_0x286a('0xfe'));loggerPredictive['info'](_0x373831[_0x286a('0x38')],_0x286a('0x1da'),_0x373831[_0x286a('0x6e')]);clearInterval(_0x373831[_0x286a('0x8b')]);_0x373831[_0x286a('0x8b')]=undefined;this['averageHandleTime'](_0x373831[_0x286a('0x1cf')])['then'](this['getDataPredictive'](_0x373831))['then'](mergeDataErlangB(_0x373831))['then'](this[_0x286a('0x1d8')](_0x373831))[_0x286a('0xb3')](loggerCatchPredictive(_0x286a('0x1db'),_0x373831));}else if(_0x373831['predictiveIntervalAvailable']&&_0x250c10<_0x373831[_0x286a('0x1c7')]-_0x44a209){freeVariablesPredictive(_0x373831);loggerPredictive[_0x286a('0x78')](_0x373831[_0x286a('0x38')],_0x286a('0x1dc'),_0x250c10,_0x286a('0x1dd'),_0x373831[_0x286a('0x1c7')],'-',_0x44a209,'=',_0x373831[_0x286a('0x1c7')]-_0x44a209,')');}else if(_0x373831[_0x286a('0x1c7')]&&_0x250c10>_0x373831[_0x286a('0x1c7')]+_0x24f3c4){freeVariablesPredictive(_0x373831);loggerPredictive[_0x286a('0x78')](_0x373831['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x250c10,_0x286a('0x1de'),_0x373831[_0x286a('0x1c7')],'+',_0x24f3c4,'=',_0x373831['predictiveIntervalAvailable']+_0x24f3c4,')');}};Dialer[_0x286a('0x18')]['getDataPredictive']=function(_0x15ed00){var _0x180855=this;return function(_0x19247c){return new BPromise(function(_0x2c140a,_0x329fef){_[_0x286a('0x87')](_0x15ed00,_0x19247c[0x0]);if(checkGetDataPredictive(_0x19247c[0x0])){var _0x28eae6=_0x15ed00[_0x286a('0x1c7')]=_0x15ed00['talking']+_0x15ed00[_0x286a('0x9e')];var _0x1f857e=_0x15ed00[_0x286a('0x1cf')]*0x3c;var _0x4af8f8=_0x19247c[0x0][_0x286a('0x63')]+_0x19247c[0x0][_0x286a('0x62')];var _0x294308=(_0x19247c[0x0][_0x286a('0x61')]+_0x19247c[0x0][_0x286a('0x65')]+_0x19247c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x19247c[0x0]['predictiveIntervalTotalCalls'];_0x15ed00[_0x286a('0x1cb')]=_0x294308>0x0?_0x294308:0x1;switch(_0x15ed00[_0x286a('0x1d0')]){case _0x286a('0x1d1'):var _0x476981=_0x15ed00[_0x286a('0x1c5')]/0x64;return _0x180855[_0x286a('0x1df')](_0x28eae6,_0x1f857e,_0x4af8f8,_0x294308,_0x476981)['then'](function(_0x587f18){return _0x2c140a(_0x587f18);});case _0x286a('0x1e0'):var _0x227249=_0x15ed00[_0x286a('0x1c5')]/0x64;return _0x180855[_0x286a('0x1e1')](_0x28eae6,_0x1f857e,_0x4af8f8,_0x294308,_0x227249)[_0x286a('0xb8')](function(_0x4db678){return _0x2c140a(_0x4db678);});default:return _0x329fef(msgResponse(_0x286a('0x1e2'),_0x286a('0x148'),_0x286a('0x1e3')));}}else{return _0x329fef(msgResponse(_0x286a('0x1e2'),_0x286a('0x148'),_0x286a('0x1e4')));}});};};Dialer[_0x286a('0x18')]['getDataPredictiveOld']=function(_0x74e470){var _0x47ce0=this;return function(_0x7414c){return new BPromise(function(_0x5aba2e,_0x140e89){_[_0x286a('0x87')](_0x74e470,_0x7414c[0x0]);if(checkGetDataPredictive(_0x7414c[0x0])){loggerPredictive[_0x286a('0x78')](JSON[_0x286a('0x134')](_0x7414c[0x0]));if(_0x74e470['dialPredictiveOptimization']==='dropRate'){return _0x47ce0[_0x286a('0xc4')](_0x74e470['id'])[_0x286a('0xb8')](function(_0x193fcd){var _0x309d42=_0x74e470[_0x286a('0x48')]-_0x193fcd[0x0][_0x286a('0x1e5')];var _0x4552b6=_0x74e470['dialPredictiveInterval']*0x3c;var _0x5555ee=_0x7414c[0x0][_0x286a('0x63')]+_0x7414c[0x0][_0x286a('0x62')];var _0x4f3293=(_0x7414c[0x0][_0x286a('0x61')]+_0x7414c[0x0][_0x286a('0x65')]+_0x7414c[0x0][_0x286a('0x64')])/_0x7414c[0x0][_0x286a('0x69')];var _0x3b4b18=_0x74e470[_0x286a('0x1c5')]/0x64;_0x74e470['predictiveIntervalPauses']=_0x193fcd[0x0][_0x286a('0x1e5')]||0x0;_0x74e470[_0x286a('0x1cb')]=_0x4f3293>0x0?_0x4f3293:0x1;return _0x47ce0['abandonmentRate'](_0x309d42,_0x4552b6,_0x5555ee,_0x4f3293,_0x3b4b18);})['then'](function(_0x5aaed6){return _0x5aba2e(_0x5aaed6);})[_0x286a('0xb3')](function(_0x5b8a22){return _0x140e89(msgResponse(_0x286a('0x1e6'),_0x286a('0x148'),JSON[_0x286a('0x134')](_0x5b8a22)));});}if(_0x74e470[_0x286a('0x1d0')]===_0x286a('0x1e0')){return _0x47ce0[_0x286a('0xc4')](_0x74e470['id'])[_0x286a('0xb8')](function(_0x38399a){var _0x27b421=_0x74e470[_0x286a('0x48')]-_0x38399a[0x0][_0x286a('0x1e5')];var _0x21c50f=_0x74e470['dialPredictiveInterval']*0x3c;var _0x1873d6=_0x7414c[0x0][_0x286a('0x63')]+_0x7414c[0x0][_0x286a('0x62')];var _0x3c052b=(_0x7414c[0x0][_0x286a('0x61')]+_0x7414c[0x0][_0x286a('0x65')]+_0x7414c[0x0][_0x286a('0x64')])/_0x7414c[0x0][_0x286a('0x69')];var _0x214d7f=_0x74e470[_0x286a('0x1c5')]/0x64;_0x74e470[_0x286a('0x68')]=_0x38399a[0x0]['outboundQueuePauses']||0x0;_0x74e470[_0x286a('0x1cb')]=_0x3c052b>0x0?_0x3c052b:0x1;return _0x47ce0[_0x286a('0x1e1')](_0x27b421,_0x21c50f,_0x1873d6,_0x3c052b,_0x214d7f);})[_0x286a('0xb8')](function(_0x5dbb60){return _0x5aba2e(_0x5dbb60);})['catch'](function(_0x497157){return _0x140e89(msgResponse(_0x286a('0x1e6'),_0x286a('0x148'),JSON[_0x286a('0x134')](_0x497157)));});}}else{return _0x140e89(msgResponse(_0x286a('0x1e2'),_0x286a('0x148'),_0x286a('0x1e4')));}});};};Dialer[_0x286a('0x18')]['startMethodPredictive']=function(_0x1b3e78){var _0x152500=this;return function(){var _0x4b49b5=0x0;var _0x211442=Math[_0x286a('0x1ca')](_0x1b3e78[_0x286a('0x6c')]*0x3e8);if(_0x211442>0x0){_0x211442=_0x211442<0x64?0x64:_0x211442;loggerPredictive['info'](_0x1b3e78[_0x286a('0x38')],_0x286a('0x1e7'),_0x211442,_0x286a('0x43'));_0x1b3e78[_0x286a('0x8b')]=setInterval(function(){_0x152500[_0x286a('0x8b')](_0x1b3e78);loggerPredictiveCalls[_0x286a('0x78')](_0x286a('0x1e8'),_0x4b49b5+=0x1);},_0x211442);}else{loggerPredictive['info'](_0x1b3e78[_0x286a('0x38')],_0x286a('0x1e9'));}};};Dialer[_0x286a('0x18')][_0x286a('0x1ea')]=function(_0x333fa1,_0x45488c){var _0x239a37=this;return function(_0x59f25b){if(_[_0x286a('0x40')](_0x59f25b)){if(_[_0x286a('0xda')](_0x45488c[_0x286a('0xd0')])||!_0x45488c['recallme']){if(_0x333fa1[_0x286a('0x51')]===_0x286a('0x1eb')){_0x333fa1[_0x286a('0x132')]=_[_0x286a('0x37')](_0x333fa1[_0x286a('0x132')])?!![]:_0x333fa1[_0x286a('0x132')];var _0x345834=uuid['v4']();_0x239a37[_0x286a('0x20')][_0x345834]=new Action(_0x333fa1,_0x45488c,_0x345834);loggerBooked[_0x286a('0x78')](_0x286a('0x1ec'),_0x345834,'queueStatusComplete:\x20',JSON[_0x286a('0x134')](_0x333fa1[_0x286a('0x132')]),'Queue:\x20',_0x333fa1[_0x286a('0x38')]);if(_0x333fa1[_0x286a('0x132')]){_0x333fa1[_0x286a('0x132')]=![];_0x239a37[_0x286a('0x12e')][_0x239a37[_0x286a('0x20')][_0x345834]['queue']]=[];ami[_0x286a('0x150')]({'actionid':_0x345834,'action':_0x286a('0x1ed'),'queue':_0x333fa1['name']})[_0x286a('0xb3')](function(){_0x239a37['updateOriginated'](_0x333fa1);_0x239a37[_0x286a('0xbc')]({'active':![],'ContactId':_0x239a37['actions'][_0x345834][_0x286a('0xff')],'ListId':_0x239a37[_0x286a('0x20')][_0x345834][_0x286a('0xcf')],'VoiceQueueId':_0x239a37[_0x286a('0x20')][_0x345834][_0x286a('0xd1')]||undefined,'CampaignId':_0x239a37['actions'][_0x345834][_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x1ee')));delete _0x239a37[_0x286a('0x20')][_0x345834];});}else{loggerBooked[_0x286a('0x78')](_0x286a('0x1ef'),JSON[_0x286a('0x134')](_0x333fa1['queueStatusComplete']),_0x286a('0x1f0'),_0x333fa1[_0x286a('0x38')]);_0x239a37[_0x286a('0xad')](_0x333fa1);_0x239a37[_0x286a('0xbc')]({'active':![],'ContactId':_0x239a37[_0x286a('0x20')][_0x345834][_0x286a('0xff')],'ListId':_0x239a37[_0x286a('0x20')][_0x345834]['ListId'],'VoiceQueueId':_0x239a37[_0x286a('0x20')][_0x345834][_0x286a('0xd1')]||undefined,'CampaignId':_0x239a37[_0x286a('0x20')][_0x345834][_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x239a37[_0x286a('0x20')][_0x345834];}}else{return _0x239a37[_0x286a('0x16f')](_0x333fa1,_0x45488c);}}else{if(getDiff(_0x45488c[_0x286a('0x1f1')])<_0x333fa1[_0x286a('0x1f2')]*0x3c){if(_0x45488c[_0x286a('0x1f3')]&&!_0x45488c[_0x286a('0x1f3')]['voicePause']){_0x239a37['preview'][_0x286a('0x135')](_0x45488c['id'])['finally'](function(){_0x239a37[_0x286a('0xad')](_0x333fa1);});}else{_0x239a37[_0x286a('0xbe')]({'active':![]},_0x45488c['id'],0x1)[_0x286a('0x137')](function(){_0x239a37[_0x286a('0xad')](_0x333fa1);});}}else{_0x333fa1[_0x286a('0x60')]+=0x1;_0x239a37[_0x286a('0xad')](_0x333fa1);if(_0x333fa1[_0x286a('0x1f4')]){_0x239a37[_0x286a('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x45488c[_0x286a('0xff')],'ListId':_0x45488c[_0x286a('0xcf')],'VoiceQueueId':_0x45488c[_0x286a('0xd1')]||undefined,'CampaignId':_0x45488c[_0x286a('0x108')]||undefined})[_0x286a('0xb3')](loggerCatch(_0x286a('0x1f5')));_0x239a37[_0x286a('0xc8')](createObjHistory(_0x333fa1,_0x45488c,_0x286a('0x1f6'),0x17,_0x286a('0x1f7')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x239a37[_0x286a('0x101')](createObjHistory(_0x333fa1,_0x45488c,_0x286a('0x1f8'),0x16,'RecallFailedTimeout'),_0x286a('0x1f9'),_0x286a('0x1fa'));}}}}else{_0x333fa1[_0x286a('0x58')]+=0x1;_0x239a37[_0x286a('0x101')](createObjHistory(_0x333fa1,_0x45488c,_0x286a('0x1fb'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x286a('0x1fc'));throw _0x286a('0x1fd');}};};Dialer[_0x286a('0x18')]['handleIvr']=function(_0x5025ea){var _0x234bba=this;var _0x29c7ce=_0x5025ea[_0x286a('0x1fe')]-_0x5025ea[_0x286a('0x6a')]-_0x5025ea['temp'];emitCampaignSummary(_0x5025ea);if(_0x29c7ce>0x0){if(_0x29c7ce>this[_0x286a('0x1e')]){_0x29c7ce=this[_0x286a('0x1e')];}_0x5025ea[_0x286a('0xc0')]+=_0x29c7ce;this[_0x286a('0xc2')](_0x5025ea['id'],_0x29c7ce,_0x5025ea[_0x286a('0x1ff')],_0x5025ea)['then'](function(_0x2ee6be){_0x5025ea[_0x286a('0xc0')]-=_0x29c7ce;_0x5025ea[_0x286a('0xc0')]=_0x5025ea['temp']>0x0?_0x5025ea['temp']:0x0;if(!checkContactEmpty(_0x2ee6be)){_0x5025ea[_0x286a('0x3c')]=_0x286a('0x9d');logger[_0x286a('0x78')]('[getContactCampaign2][Empty]'+_0x5025ea[_0x286a('0x38')]);}else{_0x5025ea[_0x286a('0x6a')]+=_0x2ee6be['length'];_0x5025ea['message']='RUNNING';for(var _0x6cfc81=0x0;_0x6cfc81<_0x2ee6be['length'];_0x6cfc81+=0x1){_0x5025ea[_0x286a('0x200')]+=0x1;if(_[_0x286a('0xda')](_0x2ee6be[_0x6cfc81])||_[_0x286a('0xda')](_0x2ee6be[_0x6cfc81][_0x286a('0x173')])||_[_0x286a('0xda')](_0x2ee6be[_0x6cfc81]['Contact'][_0x286a('0x174')])){_0x234bba['emptyContact']('[actionOriginate]\x20',_0x5025ea,_0x2ee6be[_0x6cfc81]);}else{_0x234bba[_0x286a('0xb7')](_[_0x286a('0x130')](_0x2ee6be[_0x6cfc81],['CampaignId',_0x286a('0x201')]))['then'](_0x234bba[_0x286a('0x1ea')](_0x5025ea,_0x2ee6be[_0x6cfc81]))[_0x286a('0xb3')](_0x234bba[_0x286a('0xcc')]('[actionOriginateIvr]\x20',_0x5025ea));}}}})[_0x286a('0xb3')](loggerGetContactDialer('[getContactCampaign2]',_0x5025ea,_0x29c7ce));}};Dialer['prototype'][_0x286a('0x15f')]=function(_0x3af569,_0x4ffaf2){var _0x4994cc=this;var _0x5462db=[];var _0x28017f=_0x4ffaf2>=0x1?_0x4ffaf2:0x1;if(_0x3af569[_0x286a('0x51')]===_0x286a('0x1eb')){_0x28017f=0x1;}var _0x29d737=Math[_0x286a('0x1ca')](_0x3af569[_0x286a('0x9e')]*_0x28017f)-_0x3af569[_0x286a('0x6a')]-_0x3af569[_0x286a('0xc0')];emitVoiceQueueSummary(_0x3af569);if(_0x3af569['dialLimitQueue']>0x0){var _0x1c5064=_0x3af569[_0x286a('0x202')]-_0x3af569['originated']-_0x3af569[_0x286a('0x4c')]-_0x3af569['temp']-_0x3af569['pTalking'];if(_0x29d737>_0x1c5064){_0x29d737=_0x1c5064;}}if(_0x29d737>0x0){if(_0x3af569[_0x286a('0x51')]===_0x286a('0x1eb')){_0x29d737=0x1;}if(_0x29d737>this[_0x286a('0x1e')]){_0x29d737=this[_0x286a('0x1e')];}_0x3af569['temp']+=_0x29d737;for(var _0xc2ce64 in this[_0x286a('0x1d')]){if(typeof this['agents'][_0xc2ce64]!==_0x286a('0x96')){if(this['agents'][_0xc2ce64][_0x286a('0xe3')]===_0x286a('0x203')&&this[_0x286a('0x1d')][_0xc2ce64][_0x286a('0xab')]===_0x286a('0xd6')){_0x5462db[_0x286a('0x12f')](this['agents'][_0xc2ce64]['id']);}}}this['getContactDialer'](_0x3af569['id'],_0x5462db,_0x29d737,_0x3af569[_0x286a('0x1ff')],_0x3af569)[_0x286a('0xb8')](function(_0xf0e94e){_0x3af569[_0x286a('0xc0')]-=_0x29d737;_0x3af569['temp']=_0x3af569['temp']>0x0?_0x3af569[_0x286a('0xc0')]:0x0;if(!checkContactEmpty(_0xf0e94e)){_0x4994cc[_0x286a('0xb1')](_0x3af569)[_0x286a('0xb8')](sendMessageReschedule(_0x3af569))[_0x286a('0xb3')](loggerCatch(_0x286a('0xb4')));}else{_0x3af569[_0x286a('0x6a')]+=_0xf0e94e[_0x286a('0x95')];_0x3af569[_0x286a('0x3c')]=_0x3af569['dialMethod']===_0x286a('0x1eb')?_0x286a('0x17c'):_0x286a('0x204');for(var _0x11046d=0x0;_0x11046d<_0xf0e94e['length'];_0x11046d+=0x1){if(_[_0x286a('0xda')](_0xf0e94e[_0x11046d])||_[_0x286a('0xda')](_0xf0e94e[_0x11046d][_0x286a('0x173')])||_[_0x286a('0xda')](_0xf0e94e[_0x11046d][_0x286a('0x173')]['phone'])){_0x4994cc[_0x286a('0xcd')]('[actionOriginate]\x20',_0x3af569,_0xf0e94e[_0x11046d]);}else{_0x4994cc['checkIsBlackList'](_[_0x286a('0x130')](_0xf0e94e[_0x11046d],[_0x286a('0xd1'),_0x286a('0x201')]))[_0x286a('0xb8')](_0x4994cc['checkContactBlack'](_0x3af569,_0xf0e94e[_0x11046d]))[_0x286a('0xb3')](_0x4994cc[_0x286a('0xcc')]('[actionOriginate]\x20',_0x3af569));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3af569,_0x29d737));}};Dialer[_0x286a('0x18')][_0x286a('0x8b')]=function(_0x4ab8e0){if(_0x4ab8e0[_0x286a('0x202')]>0x0){var _0x271fc0=_0x4ab8e0[_0x286a('0x202')]-_0x4ab8e0['originated']-_0x4ab8e0[_0x286a('0x4c')];if(_0x271fc0>0x0){this['tryOriginatePredictive'](_0x4ab8e0);}else{loggerPredictiveCalls[_0x286a('0x78')](_0x286a('0x205'));}}else{this[_0x286a('0x206')](_0x4ab8e0);}};Dialer[_0x286a('0x18')][_0x286a('0x206')]=function(_0x3acacb){var _0x53b083=this;var _0x4ffaff=[];_0x3acacb[_0x286a('0x6a')]+=0x1;for(var _0x1c21b3 in this[_0x286a('0x1d')]){if(typeof this[_0x286a('0x1d')][_0x1c21b3]!==_0x286a('0x96')){if(this[_0x286a('0x1d')][_0x1c21b3][_0x286a('0xe3')]==='not_inuse'&&this[_0x286a('0x1d')][_0x1c21b3][_0x286a('0xab')]==='reachable'){_0x4ffaff[_0x286a('0x12f')](this[_0x286a('0x1d')][_0x1c21b3]['id']);}}}this['getContactDialer'](_0x3acacb['id'],_0x4ffaff,0x1,_0x3acacb[_0x286a('0x1ff')],_0x3acacb)[_0x286a('0xb8')](function(_0x1e33d4){if(!checkContactEmpty(_0x1e33d4)){checkContactLowerLimitOriginate(_0x3acacb,0x1,0x0);_0x53b083['countReScheduled'](_0x3acacb)[_0x286a('0xb8')](sendMessageReschedule(_0x3acacb))['catch'](loggerCatch(_0x286a('0xb4')));}else{_0x3acacb[_0x286a('0x3c')]=_0x286a('0x204');if(_['isNil'](_0x1e33d4[0x0])||_[_0x286a('0xda')](_0x1e33d4[0x0][_0x286a('0x173')])||_[_0x286a('0xda')](_0x1e33d4[0x0][_0x286a('0x173')][_0x286a('0x174')])){_0x53b083[_0x286a('0xcd')](_0x286a('0x207'),_0x3acacb,_0x1e33d4[0x0]);}else{_0x53b083['checkIsBlackList'](_[_0x286a('0x130')](_0x1e33d4[0x0],[_0x286a('0xd1'),_0x286a('0x201')]))[_0x286a('0xb8')](_0x53b083['checkContactBlack'](_0x3acacb,_0x1e33d4[0x0]))[_0x286a('0xb3')](_0x53b083[_0x286a('0xcc')]('[actionOriginatePredictive]\x20',_0x3acacb));}}})[_0x286a('0xb3')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3acacb,0x1));emitVoiceQueueSummary(_0x3acacb);};Dialer['prototype'][_0x286a('0x1df')]=function(_0x52c931,_0x437021,_0x29ae4e,_0x5752a8,_0x259213,_0x4cc4cd){loggerPredictive[_0x286a('0x78')](_0x286a('0x208'));loggerPredictive['info'](_0x286a('0x209'),_0x52c931);loggerPredictive[_0x286a('0x78')](_0x286a('0x20a'),_0x437021);loggerPredictive['info'](_0x286a('0x20b'),_0x29ae4e);loggerPredictive['info'](_0x286a('0x20c'),_0x5752a8);loggerPredictive[_0x286a('0x78')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x259213);loggerPredictive[_0x286a('0x78')](_0x286a('0x7c'));return new BPromise(function(_0x36ffe5,_0xe88ce0){if(_0x52c931<=0x0||isNaN(_0x52c931)){return _0xe88ce0(msgResponse('[abandonmentRate]','Error',_0x286a('0x20d')+_0x52c931));}if(_0x29ae4e<=0x0||isNaN(_0x29ae4e)){return _0xe88ce0(msgResponse('[abandonmentRate]',_0x286a('0x42'),_0x286a('0x20e')+_0x29ae4e));}if(_0x5752a8<=0x0||isNaN(_0x5752a8)){return _0xe88ce0(msgResponse(_0x286a('0x20f'),_0x286a('0x42'),_0x286a('0x210')+_0x5752a8));}if(_0x437021<=0x0||isNaN(_0x437021)){return _0xe88ce0(msgResponse(_0x286a('0x20f'),'Error',_0x286a('0x211')+_0x437021));}if(_0x259213<=0x0||isNaN(_0x259213)){return _0xe88ce0(msgResponse(_0x286a('0x20f'),_0x286a('0x42'),_0x286a('0x212')+_0x259213));}_0x4cc4cd=_0x4cc4cd||0x0;var _0x358d7a=0x1/_0x29ae4e;var _0xfdd23e=0x0;var _0x53a7ce=0x0;var _0x16632e=0x0;var _0x4f63b1=0x0;for(var _0x4d560f=0x0;_0x16632e<_0x259213;_0x4d560f+=0x1){_0x53a7ce=_0x4d560f/_0x437021;_0xfdd23e=(_0x5752a8*_0x53a7ce+_0x4cc4cd)/_0x358d7a;_0x16632e=erlangb(_0xfdd23e,_0x52c931);_0x4f63b1=_0xfdd23e/_0x52c931*(0x1-erlangb(_0xfdd23e,_0x52c931));}return _0x36ffe5({'erlangCalls':_0x4d560f,'erlangCallToSecond':_0x437021/_0x4d560f,'erlangAbandonmentRate':_0x16632e,'erlangBusyFactor':_0x4f63b1});});};Dialer[_0x286a('0x18')][_0x286a('0x1e1')]=function(_0x373a4d,_0x55342b,_0x1f6d24,_0x55a1f9,_0x418ac9,_0x473927){loggerPredictive[_0x286a('0x78')](_0x286a('0x213'));loggerPredictive[_0x286a('0x78')]('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',_0x373a4d);loggerPredictive[_0x286a('0x78')](_0x286a('0x20a'),_0x55342b);loggerPredictive[_0x286a('0x78')](_0x286a('0x20b'),_0x1f6d24);loggerPredictive[_0x286a('0x78')]('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',_0x55a1f9);loggerPredictive[_0x286a('0x78')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x418ac9);loggerPredictive[_0x286a('0x78')](_0x286a('0x7c'));return new BPromise(function(_0x1c8944,_0x2ba6a2){if(_0x373a4d<=0x0||isNaN(_0x373a4d)){return _0x2ba6a2(msgResponse('[busyFactor]',_0x286a('0x42'),_0x286a('0x20d')+_0x373a4d));}if(_0x1f6d24<=0x0||isNaN(_0x1f6d24)){return _0x2ba6a2(msgResponse(_0x286a('0x214'),_0x286a('0x42'),'Ts\x20=\x20'+_0x1f6d24));}if(_0x55a1f9<=0x0||isNaN(_0x55a1f9)){return _0x2ba6a2(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x55a1f9));}if(_0x55342b<=0x0||isNaN(_0x55342b)){return _0x2ba6a2(msgResponse(_0x286a('0x214'),_0x286a('0x42'),_0x286a('0x211')+_0x55342b));}if(_0x418ac9<=0x0||isNaN(_0x418ac9)){return _0x2ba6a2(msgResponse(_0x286a('0x214'),_0x286a('0x42'),_0x286a('0x215')+_0x418ac9));}_0x473927=_0x473927||0x0;var _0x535060=0x1/_0x1f6d24;var _0x4a1f01=0x0;var _0x566301=0x0;var _0xa987a2=0x0;var _0xb9ba9b=0x0;for(var _0x1784f5=0x0;_0xb9ba9b<_0x418ac9;_0x1784f5+=0x1){_0x566301=_0x1784f5/_0x55342b;_0x4a1f01=(_0x55a1f9*_0x566301+_0x473927)/_0x535060;_0xa987a2=erlangb(_0x4a1f01,_0x373a4d);_0xb9ba9b=_0x4a1f01/_0x373a4d*(0x1-erlangb(_0x4a1f01,_0x373a4d));}return _0x1c8944({'erlangCalls':_0x1784f5,'erlangCallToSecond':_0x55342b/_0x1784f5,'erlangAbandonmentRate':_0xa987a2,'erlangBusyFactor':_0xb9ba9b});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 1cfe74f..8657878 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 _0x4320=['queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','ringtime','starttime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound'];(function(_0x3e982e,_0x462e57){var _0x2ac7c1=function(_0x5a48fe){while(--_0x5a48fe){_0x3e982e['push'](_0x3e982e['shift']());}};_0x2ac7c1(++_0x462e57);}(_0x4320,0x1f0));var _0x0432=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x4320[_0x3de8a4];return _0x4635cf;};'use strict';var util=require(_0x0432('0x0'));var _=require('lodash');var moment=require(_0x0432('0x1'));function getSeconds(_0x1c689d,_0x4cd5f0){var _0x10a178=moment(_0x1c689d)[_0x0432('0x2')](0x0);var _0x24879f=moment(_0x4cd5f0)[_0x0432('0x2')](0x0);return _0x10a178[_0x0432('0x3')](_0x24879f,_0x0432('0x4'));}function QueueCallerAbandon(_0x355101,_0x1e7f7d){this[_0x0432('0x5')]=_0x355101[_0x0432('0x5')];this['type']=_0x355101[_0x0432('0x6')];this['campaigntype']=_0x355101[_0x0432('0x6')]===_0x0432('0x7')?_0x0432('0x8'):_0x355101['type'];this[_0x0432('0x9')]=_0x355101['countbusyretry'];this['countcongestionretry']=_0x355101['countcongestionretry'];this[_0x0432('0xa')]=_0x355101[_0x0432('0xa')];this[_0x0432('0xb')]=_0x355101[_0x0432('0x9')]+_0x355101[_0x0432('0xc')]+_0x355101[_0x0432('0xa')]+_0x355101[_0x0432('0xd')]+_0x355101[_0x0432('0xe')]+_0x355101[_0x0432('0xf')]+_0x355101[_0x0432('0x10')]+_0x355101[_0x0432('0x11')];this['countnosuchnumberretry']=_0x355101[_0x0432('0xd')];this[_0x0432('0xe')]=_0x355101['countdropretry'];this[_0x0432('0xf')]=_0x355101[_0x0432('0xf')];this[_0x0432('0x10')]=_0x355101['countmachineretry'];this[_0x0432('0x11')]=_0x355101['countagentrejectretry'];this[_0x0432('0x12')]=_0x1e7f7d['uniqueid'];this[_0x0432('0x13')]=_0x355101[_0x0432('0x14')];this[_0x0432('0x15')]=_0x355101[_0x0432('0x16')];this['starttime']=_0x355101['starttime'];this[_0x0432('0x17')]=_0x355101[_0x0432('0x17')];this[_0x0432('0x18')]=_0x355101[_0x0432('0x18')];this['endtime']=this[_0x0432('0x18')];this[_0x0432('0x19')]=getSeconds(_0x355101[_0x0432('0x17')],_0x355101[_0x0432('0x1a')]);this[_0x0432('0x1b')]=getSeconds(this['droptime'],_0x355101[_0x0432('0x17')]);this[_0x0432('0x1c')]=0x0;this[_0x0432('0x8')]=_0x1e7f7d[_0x0432('0x8')];this[_0x0432('0x1d')]=_0x1e7f7d['connectedlinename'];this[_0x0432('0x1e')]=_0x1e7f7d[_0x0432('0x1e')];this['callback']=_0x355101[_0x0432('0x1f')];this[_0x0432('0x20')]=_0x355101['callbackuniqueid'];this['callbackat']=_0x355101[_0x0432('0x21')];this[_0x0432('0x22')]=_0x355101[_0x0432('0x22')];this['ContactId']=_0x355101[_0x0432('0x23')];this[_0x0432('0x24')]=_0x355101[_0x0432('0x24')];this[_0x0432('0x25')]=_0x355101[_0x0432('0x25')];this['VoiceQueueId']=_0x355101[_0x0432('0x26')];this[_0x0432('0x27')]=_0x355101[_0x0432('0x27')];this[_0x0432('0x28')]=_0x355101['originatecalleridnum']||'';this[_0x0432('0x29')]=_0x355101['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xd535=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','droptime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry'];(function(_0x12c5d7,_0xebc29f){var _0x3e7d23=function(_0x51a2bd){while(--_0x51a2bd){_0x12c5d7['push'](_0x12c5d7['shift']());}};_0x3e7d23(++_0xebc29f);}(_0xd535,0x167));var _0x5d53=function(_0x500049,_0x46adc8){_0x500049=_0x500049-0x0;var _0x49d0cf=_0xd535[_0x500049];return _0x49d0cf;};'use strict';var util=require(_0x5d53('0x0'));var _=require(_0x5d53('0x1'));var moment=require('moment');function getSeconds(_0x17dd80,_0x204ddd){var _0x3edfb4=moment(_0x17dd80)['milliseconds'](0x0);var _0x5a6a40=moment(_0x204ddd)[_0x5d53('0x2')](0x0);return _0x3edfb4[_0x5d53('0x3')](_0x5a6a40,_0x5d53('0x4'));}function QueueCallerAbandon(_0x4ecb2d,_0x2884b9){this['scheduledat']=_0x4ecb2d[_0x5d53('0x5')];this[_0x5d53('0x6')]=_0x4ecb2d[_0x5d53('0x6')];this[_0x5d53('0x7')]=_0x4ecb2d[_0x5d53('0x6')]===_0x5d53('0x8')?_0x5d53('0x9'):_0x4ecb2d[_0x5d53('0x6')];this[_0x5d53('0xa')]=_0x4ecb2d[_0x5d53('0xa')];this[_0x5d53('0xb')]=_0x4ecb2d['countcongestionretry'];this['countnoanswerretry']=_0x4ecb2d[_0x5d53('0xc')];this[_0x5d53('0xd')]=_0x4ecb2d[_0x5d53('0xa')]+_0x4ecb2d['countcongestionretry']+_0x4ecb2d['countnoanswerretry']+_0x4ecb2d[_0x5d53('0xe')]+_0x4ecb2d['countdropretry']+_0x4ecb2d[_0x5d53('0xf')]+_0x4ecb2d[_0x5d53('0x10')]+_0x4ecb2d[_0x5d53('0x11')];this['countnosuchnumberretry']=_0x4ecb2d[_0x5d53('0xe')];this['countdropretry']=_0x4ecb2d[_0x5d53('0x12')];this[_0x5d53('0xf')]=_0x4ecb2d['countabandonedretry'];this['countmachineretry']=_0x4ecb2d['countmachineretry'];this['countagentrejectretry']=_0x4ecb2d[_0x5d53('0x11')];this[_0x5d53('0x13')]=_0x2884b9[_0x5d53('0x13')];this[_0x5d53('0x14')]=_0x4ecb2d[_0x5d53('0x15')];this[_0x5d53('0x16')]=_0x4ecb2d[_0x5d53('0x17')];this[_0x5d53('0x18')]=_0x4ecb2d['starttime'];this['responsetime']=_0x4ecb2d[_0x5d53('0x19')];this['droptime']=_0x4ecb2d['droptime'];this[_0x5d53('0x1a')]=this[_0x5d53('0x1b')];this[_0x5d53('0x1c')]=getSeconds(_0x4ecb2d['responsetime'],_0x4ecb2d[_0x5d53('0x18')]);this[_0x5d53('0x1d')]=getSeconds(this[_0x5d53('0x1b')],_0x4ecb2d[_0x5d53('0x19')]);this['talktime']=0x0;this[_0x5d53('0x9')]=_0x2884b9[_0x5d53('0x9')];this[_0x5d53('0x1e')]=_0x2884b9['connectedlinename'];this[_0x5d53('0x1f')]=_0x2884b9[_0x5d53('0x1f')];this[_0x5d53('0x20')]=_0x4ecb2d[_0x5d53('0x20')];this[_0x5d53('0x21')]=_0x4ecb2d['callbackuniqueid'];this[_0x5d53('0x22')]=_0x4ecb2d[_0x5d53('0x22')];this[_0x5d53('0x23')]=_0x4ecb2d[_0x5d53('0x23')];this[_0x5d53('0x24')]=_0x4ecb2d['ContactId'];this['ListId']=_0x4ecb2d['ListId'];this[_0x5d53('0x25')]=_0x4ecb2d[_0x5d53('0x25')];this['VoiceQueueId']=_0x4ecb2d[_0x5d53('0x26')];this['CampaignId']=_0x4ecb2d[_0x5d53('0x27')];this['originatecalleridnum']=_0x4ecb2d['originatecalleridnum']||'';this[_0x5d53('0x28')]=_0x4ecb2d[_0x5d53('0x28')]||'';}module[_0x5d53('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f907a0b..b56129d 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(_0x5b1a5a,_0x38b31a){var _0x94a387=function(_0x38fecd){while(--_0x38fecd){_0x5b1a5a['push'](_0x5b1a5a['shift']());}};_0x94a387(++_0x38b31a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x5ad0d0,_0x2620e8){var _0x2b546e=function(_0x705960){while(--_0x705960){_0x5ad0d0['push'](_0x5ad0d0['shift']());}};_0x2b546e(++_0x2620e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 6c9e612..f5ef4cc 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 _0x9c00=['remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','hasOwnProperty','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20'];(function(_0x2a20ad,_0xe452e8){var _0x54d453=function(_0x58dcf2){while(--_0x58dcf2){_0x2a20ad['push'](_0x2a20ad['shift']());}};_0x54d453(++_0xe452e8);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3a023f,_0x3a0789){_0x3a023f=_0x3a023f-0x0;var _0x1de363=_0x9c00[_0x3a023f];return _0x1de363;};'use strict';var util=require(_0x09c0('0x0'));var _=require(_0x09c0('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x09c0('0x2'));var path=require(_0x09c0('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var ami=require(_0x09c0('0x7'));var rpcDb=require(_0x09c0('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x09c0('0x9'));var faxAccount=require(_0x09c0('0xa'));var attachment=require(_0x09c0('0xb'));var faxMessage=require(_0x09c0('0xc'));function Fax(_0x17cd9d){this['channels']={};this[_0x09c0('0xd')]=_0x17cd9d[_0x09c0('0xd')];this[_0x09c0('0xe')]=_0x17cd9d[_0x09c0('0xe')];this[_0x09c0('0xf')]={};ami['on'](_0x09c0('0x10'),this[_0x09c0('0x11')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x13'),this[_0x09c0('0x14')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x15'),this[_0x09c0('0x16')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x17'),this[_0x09c0('0x18')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x19'),this[_0x09c0('0x1a')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x1b'),this[_0x09c0('0x1c')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x1d'),this[_0x09c0('0x1e')][_0x09c0('0x12')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x09c0('0x1f')][_0x09c0('0x11')]=function(_0x3991c6){if(_0x3991c6[_0x09c0('0x20')]==='from-voip-provider'){for(var _0x2c4440 in this['faxAccounts']){if(this['faxAccounts'][_0x09c0('0x21')](_0x2c4440)){if(_0x3991c6['exten']===this[_0x09c0('0xd')][_0x2c4440][_0x09c0('0x22')]){this[_0x09c0('0x23')][_0x3991c6['uniqueid']]={};this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]][_0x09c0('0x25')]=_0x3991c6[_0x09c0('0x25')];this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]]['id']=this[_0x09c0('0xd')][_0x2c4440]['id'];this['channels'][_0x3991c6[_0x09c0('0x24')]][_0x09c0('0x26')]=this[_0x09c0('0xd')][_0x2c4440][_0x09c0('0x26')];logger['info'](_0x3991c6['uniqueid'],_0x09c0('0x27'));}}}}if(this[_0x09c0('0xf')][_0x3991c6[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x3991c6['uniqueid']]={};this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]]['channel']=_0x3991c6[_0x09c0('0x25')];logger[_0x09c0('0x28')](_0x3991c6[_0x09c0('0x24')],_0x09c0('0x27'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x14')]=function(_0x45cc64){if(this[_0x09c0('0x23')][_0x45cc64[_0x09c0('0x24')]]){for(var _0x1aa80e in _0x45cc64[_0x09c0('0x29')]){if(_0x45cc64['variable'][_0x09c0('0x21')](_0x1aa80e)){this[_0x09c0('0x23')][_0x45cc64['uniqueid']][_0x1aa80e]=_0x45cc64[_0x09c0('0x2a')];}}}};Fax['prototype'][_0x09c0('0x16')]=function(_0x4d6bdc){if(this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]]['channelstate']=_0x4d6bdc['channelstate'];this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]][_0x09c0('0x2b')]=_0x4d6bdc['channelstatedesc'];}};Fax[_0x09c0('0x1f')]['syncNewExten']=function(_0x350cd3){if(this[_0x09c0('0x23')][_0x350cd3[_0x09c0('0x24')]]){for(var _0x500cf8 in _0x350cd3[_0x09c0('0x29')]){if(_0x350cd3[_0x09c0('0x29')][_0x09c0('0x21')](_0x500cf8)){this[_0x09c0('0x23')][_0x350cd3[_0x09c0('0x24')]][_0x500cf8]=_0x350cd3[_0x09c0('0x2a')];}}}};Fax[_0x09c0('0x1f')]['syncFaxStatus']=function(_0x26da22){if(this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]]['operation']=_0x26da22[_0x09c0('0x2c')];this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x2d')]=_0x26da22[_0x09c0('0x2d')];this['channels'][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x22')]=_0x26da22[_0x09c0('0x22')];this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x2e')]=_0x26da22[_0x09c0('0x2e')];logger['info'](_0x26da22[_0x09c0('0x24')],_0x09c0('0x2f'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x1c')]=function(_0x453c23){var _0x4e98f1=this;if(this['channels'][_0x453c23['uniqueid']]){var _0x4a14dc=this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]]['id'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x30')]=_0x453c23['remotestationid'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]]['pagestransferred']=_0x453c23[_0x09c0('0x31')];this['channels'][_0x453c23[_0x09c0('0x24')]]['localstationid']=_0x453c23[_0x09c0('0x22')];this[_0x09c0('0x23')][_0x453c23['uniqueid']][_0x09c0('0x32')]=_0x453c23[_0x09c0('0x32')];this['channels'][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x33')]=_0x453c23[_0x09c0('0x33')];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x2e')]=_0x453c23['filename'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x34')]=_0x453c23['calleridnum'];if(this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x31')]>0x0){tiff2pdf(_0x453c23['filename'],_0x09c0('0x35'),function(_0x59d188){logger['info'](_0x453c23['uniqueid'],_0x09c0('0x36'),_0x59d188[_0x09c0('0x37')]);attachment['create']({'name':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])['name'],'basename':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])[_0x09c0('0x26')]+_0x09c0('0x39'),'type':_0x09c0('0x3a')})['then'](function(_0x330fe7){faxAccount['notify'](_0x4a14dc,{'from':_0x453c23['calleridnum'],'mapKey':_0x09c0('0x6'),'body':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])[_0x09c0('0x26')]+_0x09c0('0x39'),'AttachmentId':_0x330fe7['id']})[_0x09c0('0x3b')](function(_0x52a4ff){logger['error'](_0x453c23['uniqueid'],_0x09c0('0x3c'),JSON[_0x09c0('0x3d')](_0x52a4ff));});})[_0x09c0('0x3b')](function(_0x56ec01){logger[_0x09c0('0x3e')](_0x453c23[_0x09c0('0x24')],_0x09c0('0x3f'),JSON[_0x09c0('0x3d')](_0x56ec01));});});}logger[_0x09c0('0x28')](_0x453c23[_0x09c0('0x24')],_0x09c0('0x3f'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x40')]=function(_0x38085c){if(this[_0x09c0('0xf')][_0x38085c[_0x09c0('0x24')]]){_[_0x09c0('0x41')](this[_0x09c0('0x23')][_0x38085c[_0x09c0('0x24')]],_[_0x09c0('0x42')](_0x38085c,[_0x09c0('0x43'),_0x09c0('0x44')]));}};function updateStatus(_0x3ae68f){if(_0x3ae68f[_0x09c0('0x45')]){faxMessage['update'](_0x3ae68f[_0x09c0('0x45')],{'failMessage':_0x09c0('0x46')})[_0x09c0('0x47')](function(_0x30206e){ut[_0x09c0('0x48')]('[Fax][Message][Error][Updated]',_0x30206e);})[_0x09c0('0x3b')](function(_0x866d31){ut[_0x09c0('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x866d31);});}else{ut[_0x09c0('0x48')](_0x09c0('0x49'));}}Fax[_0x09c0('0x1f')][_0x09c0('0x4a')]=function(_0x55b0f0,_0xebfd6d,_0x45ecd0){var _0x499905=this;var _0x1285f8={};if(_0xebfd6d){_0x1285f8={'read':_0xebfd6d};}else{_0x1285f8={'failMessage':_0x45ecd0};}if(this[_0x09c0('0xf')][_0x55b0f0][_0x09c0('0x45')]){faxMessage[_0x09c0('0x4b')](this[_0x09c0('0xf')][_0x55b0f0][_0x09c0('0x45')],_0x1285f8)[_0x09c0('0x47')](function(_0x4987cf){ut['logger'](_0x09c0('0x4c'),_0x4987cf);})[_0x09c0('0x3b')](function(_0x1ab662){ut['logger'](_0x09c0('0x4d'),_0x1ab662);})['finally'](function(){delete _0x499905[_0x09c0('0x23')][_0x55b0f0];delete _0x499905[_0x09c0('0xf')][_0x55b0f0];});}else{ut[_0x09c0('0x48')](_0x09c0('0x4e'));delete this[_0x09c0('0x23')][_0x55b0f0];delete this[_0x09c0('0xf')][_0x55b0f0];}};Fax[_0x09c0('0x1f')]['syncHangup']=function(_0xa201bf){var _0x2d6201=this;if(this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]]){if(this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]]['id']=this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]['id'];this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x26')]=this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x26')];}logger['info'](_0xa201bf[_0x09c0('0x24')],this['actions'][_0xa201bf[_0x09c0('0x24')]]?_0x09c0('0x4f'):_0x09c0('0x50'),JSON['stringify'](this['channels'][_0xa201bf[_0x09c0('0x24')]]));if(this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]){if(this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x51')]>0x0&&this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x19')]===_0x09c0('0x52')){this[_0x09c0('0x4a')](_0xa201bf[_0x09c0('0x24')],!![]);}else{this['updateStatus'](_0xa201bf[_0x09c0('0x24')],![],this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x53')]?_0x09c0('0x54')+this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x53')]:_0x09c0('0x55'));}}}};Fax[_0x09c0('0x1f')][_0x09c0('0x56')]=function(_0x2906cb){var _0x2d67e8=this;return new BPromise(function(_0x484df5,_0x13f3af){_0x2d67e8[_0x09c0('0x57')](_0x2906cb,_0x2d67e8[_0x09c0('0xd')][_0x2906cb[_0x09c0('0x58')]])[_0x09c0('0x47')](function(_0x54295a){ut[_0x09c0('0x48')](_0x09c0('0x59'),_0x54295a);_0x484df5(ut[_0x09c0('0x37')](_0x09c0('0x5a')));})['catch'](function(_0x1d395e){ut[_0x09c0('0x48')]('[Fax][execOriginate][failure]',_0x1d395e);updateStatus(_0x2906cb);_0x13f3af(ut[_0x09c0('0x37')](_0x09c0('0x5b')));});});};Fax[_0x09c0('0x1f')][_0x09c0('0x5c')]=function(_0x1e9dd5){var _0x5a9516=this;return new BPromise(function(_0x19503e,_0x302c81){var _0x3a3f24=_0x5a9516[_0x09c0('0x5d')](_0x5a9516[_0x09c0('0xd')][_0x1e9dd5['FaxAccountId']][_0x09c0('0x5e')],_0x1e9dd5);if(_0x3a3f24[_0x09c0('0x5f')]){_0x19503e(ut[_0x09c0('0x37')](_0x09c0('0x60')));}else{_0x302c81(ut[_0x09c0('0x37')](_0x3a3f24[_0x09c0('0x37')]));}});};function originate(_0x59c57a,_0x51fc84,_0x583c0d){return new BPromise(function(_0x52fe65,_0x7c1cb8){if(_0x583c0d){var _0x1dcd69=util[_0x09c0('0x61')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x09c0('0x38')](_0x59c57a['path'])[_0x09c0('0x26')],_0x59c57a[_0x09c0('0x3')]);gs['execute'](_0x1dcd69)[_0x09c0('0x47')](function(){_0x59c57a['path']=util['format'](_0x09c0('0x62'),path[_0x09c0('0x38')](_0x59c57a[_0x09c0('0x3')])[_0x09c0('0x63')],path[_0x09c0('0x38')](_0x59c57a[_0x09c0('0x3')])[_0x09c0('0x26')]);_0x51fc84[_0x09c0('0x64')]=_0x59c57a[_0x09c0('0x3')];ut[_0x09c0('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x09c0('0x65')](ut[_0x09c0('0x66')](_0x59c57a,_0x51fc84))['then'](function(_0x4e1d42){_0x52fe65(_0x4e1d42);})[_0x09c0('0x3b')](function(_0x164bac){_0x7c1cb8(_0x164bac);});})[_0x09c0('0x3b')](function(_0x302e0d){_0x7c1cb8(_0x302e0d);});}else{ami[_0x09c0('0x65')](ut[_0x09c0('0x66')](_0x59c57a,_0x51fc84))[_0x09c0('0x47')](function(_0x53c5dd){_0x52fe65(_0x53c5dd);})[_0x09c0('0x3b')](function(_0x56b94b){_0x7c1cb8(_0x56b94b);});}});}Fax[_0x09c0('0x1f')][_0x09c0('0x57')]=function(_0x3ecf97,_0x1a81b1){var _0x2d97cb=this;return new BPromise(function(_0x4f35d1,_0x167303){var _0x4ce49a=uuid['v4']();var _0x28e4b7=ut['addVariables'](_0x3ecf97,_0x1a81b1);_0x2d97cb[_0x09c0('0xf')][_0x4ce49a]=new Action(_0x4ce49a,_0x1a81b1,_0x3ecf97);var _0x3e8b19=_0x2d97cb[_0x09c0('0xf')][_0x4ce49a];if(path[_0x09c0('0x38')](_0x3ecf97[_0x09c0('0x3')])[_0x09c0('0x67')]===_0x09c0('0x39')){originate(_0x3e8b19,_0x28e4b7,!![])['then'](function(_0x4ab50d){_0x4f35d1(_0x4ab50d);})[_0x09c0('0x3b')](function(_0x430a78){_0x167303(_0x430a78);});}else{originate(_0x3e8b19,_0x28e4b7,![])[_0x09c0('0x47')](function(_0x309d0a){_0x4f35d1(_0x309d0a);})[_0x09c0('0x3b')](function(_0x1041d9){_0x167303(_0x1041d9);});}});};Fax[_0x09c0('0x1f')][_0x09c0('0x68')]=function(_0x97cc44){return!_[_0x09c0('0x69')](_0x97cc44)&&!_['isNil'](_0x97cc44['name'])&&!_['isNil'](_0x97cc44[_0x09c0('0x6a')])&&_0x97cc44[_0x09c0('0x6a')]&&!_[_0x09c0('0x69')](this['trunks'][util['format'](_0x09c0('0x6b'),_0x97cc44['name'])])&&!_[_0x09c0('0x69')](this[_0x09c0('0xe')][util['format'](_0x09c0('0x6b'),_0x97cc44['name'])][_0x09c0('0x2d')])&&(this[_0x09c0('0xe')][util[_0x09c0('0x61')]('SIP/%s',_0x97cc44[_0x09c0('0x26')])][_0x09c0('0x2d')]===_0x09c0('0x6c')||this[_0x09c0('0xe')][util[_0x09c0('0x61')](_0x09c0('0x6b'),_0x97cc44[_0x09c0('0x26')])][_0x09c0('0x2d')]===_0x09c0('0x6d'));};Fax[_0x09c0('0x1f')][_0x09c0('0x5d')]=function(_0xf25624,_0x592151){if(!this[_0x09c0('0x68')](_0xf25624)){ut[_0x09c0('0x48')](_0x09c0('0x6e'),_[_0x09c0('0x69')](_0xf25624)?'':_0xf25624[_0x09c0('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x09c0('0x6f')};}if(_['isNil'](_0x592151['fax'])){ut[_0x09c0('0x48')](_0x09c0('0x70'),JSON[_0x09c0('0x3d')](_0x592151));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x09c0('0x69')](_0x592151[_0x09c0('0x3')])){ut[_0x09c0('0x48')](_0x09c0('0x71'),JSON[_0x09c0('0x3d')](_0x592151));return{'isValid':![],'message':_0x09c0('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x09c0('0x73')]=Fax; \ No newline at end of file +var _0xd87e=['uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','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','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','./util/gs','fax','../ami','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','newstate','syncNewState','syncNewExten','bind','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels'];(function(_0x474ebb,_0x466331){var _0x9de619=function(_0x4f74fc){while(--_0x4f74fc){_0x474ebb['push'](_0x474ebb['shift']());}};_0x9de619(++_0x466331);}(_0xd87e,0x1bf));var _0xed87=function(_0x9119f3,_0x5364d3){_0x9119f3=_0x9119f3-0x0;var _0x336cc3=_0xd87e[_0x9119f3];return _0x336cc3;};'use strict';var util=require(_0xed87('0x0'));var _=require(_0xed87('0x1'));var BPromise=require('bluebird');var uuid=require(_0xed87('0x2'));var moment=require(_0xed87('0x3'));var path=require(_0xed87('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xed87('0x5'));var logger=require('../../../config/logger')(_0xed87('0x6'));var ami=require(_0xed87('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0xed87('0x8'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0xed87('0x9'));var attachment=require(_0xed87('0xa'));var faxMessage=require(_0xed87('0xb'));function Fax(_0x2f348a){this['channels']={};this[_0xed87('0xc')]=_0x2f348a[_0xed87('0xc')];this[_0xed87('0xd')]=_0x2f348a[_0xed87('0xd')];this[_0xed87('0xe')]={};ami['on'](_0xed87('0xf'),this[_0xed87('0x10')]['bind'](this));ami['on'](_0xed87('0x11'),this[_0xed87('0x12')]['bind'](this));ami['on'](_0xed87('0x13'),this[_0xed87('0x14')]['bind'](this));ami['on']('newexten',this[_0xed87('0x15')][_0xed87('0x16')](this));ami['on'](_0xed87('0x17'),this[_0xed87('0x18')][_0xed87('0x16')](this));ami['on'](_0xed87('0x19'),this['syncReceiveFax'][_0xed87('0x16')](this));ami['on'](_0xed87('0x1a'),this[_0xed87('0x1b')][_0xed87('0x16')](this));ami['on'](_0xed87('0x1c'),this[_0xed87('0x1d')][_0xed87('0x16')](this));}Fax[_0xed87('0x1e')][_0xed87('0x10')]=function(_0x5164c8){if(_0x5164c8[_0xed87('0x1f')]===_0xed87('0x20')){for(var _0x2c386a in this[_0xed87('0xc')]){if(this['faxAccounts'][_0xed87('0x21')](_0x2c386a)){if(_0x5164c8[_0xed87('0x22')]===this[_0xed87('0xc')][_0x2c386a][_0xed87('0x23')]){this[_0xed87('0x24')][_0x5164c8[_0xed87('0x25')]]={};this[_0xed87('0x24')][_0x5164c8[_0xed87('0x25')]][_0xed87('0x26')]=_0x5164c8['channel'];this['channels'][_0x5164c8['uniqueid']]['id']=this['faxAccounts'][_0x2c386a]['id'];this[_0xed87('0x24')][_0x5164c8['uniqueid']][_0xed87('0x27')]=this[_0xed87('0xc')][_0x2c386a]['name'];logger[_0xed87('0x28')](_0x5164c8['uniqueid'],_0xed87('0x29'));}}}}if(this[_0xed87('0xe')][_0x5164c8[_0xed87('0x25')]]){this[_0xed87('0x24')][_0x5164c8[_0xed87('0x25')]]={};this['channels'][_0x5164c8[_0xed87('0x25')]][_0xed87('0x26')]=_0x5164c8[_0xed87('0x26')];logger[_0xed87('0x28')](_0x5164c8[_0xed87('0x25')],_0xed87('0x29'));}};Fax[_0xed87('0x1e')][_0xed87('0x12')]=function(_0x40b2fa){if(this[_0xed87('0x24')][_0x40b2fa[_0xed87('0x25')]]){for(var _0x341a35 in _0x40b2fa[_0xed87('0x2a')]){if(_0x40b2fa[_0xed87('0x2a')]['hasOwnProperty'](_0x341a35)){this[_0xed87('0x24')][_0x40b2fa[_0xed87('0x25')]][_0x341a35]=_0x40b2fa['value'];}}}};Fax[_0xed87('0x1e')][_0xed87('0x14')]=function(_0x21c93b){if(this['channels'][_0x21c93b['uniqueid']]){this[_0xed87('0x24')][_0x21c93b[_0xed87('0x25')]][_0xed87('0x2b')]=_0x21c93b['channelstate'];this[_0xed87('0x24')][_0x21c93b[_0xed87('0x25')]][_0xed87('0x2c')]=_0x21c93b[_0xed87('0x2c')];}};Fax[_0xed87('0x1e')][_0xed87('0x15')]=function(_0x137891){if(this[_0xed87('0x24')][_0x137891[_0xed87('0x25')]]){for(var _0x4c0bc0 in _0x137891[_0xed87('0x2a')]){if(_0x137891[_0xed87('0x2a')]['hasOwnProperty'](_0x4c0bc0)){this[_0xed87('0x24')][_0x137891['uniqueid']][_0x4c0bc0]=_0x137891[_0xed87('0x2d')];}}}};Fax[_0xed87('0x1e')][_0xed87('0x18')]=function(_0x46b41b){if(this[_0xed87('0x24')][_0x46b41b[_0xed87('0x25')]]){this[_0xed87('0x24')][_0x46b41b[_0xed87('0x25')]][_0xed87('0x2e')]=_0x46b41b[_0xed87('0x2e')];this[_0xed87('0x24')][_0x46b41b['uniqueid']][_0xed87('0x2f')]=_0x46b41b[_0xed87('0x2f')];this['channels'][_0x46b41b[_0xed87('0x25')]]['localstationid']=_0x46b41b[_0xed87('0x23')];this[_0xed87('0x24')][_0x46b41b['uniqueid']][_0xed87('0x30')]=_0x46b41b[_0xed87('0x30')];logger[_0xed87('0x28')](_0x46b41b[_0xed87('0x25')],_0xed87('0x31'));}};Fax['prototype'][_0xed87('0x32')]=function(_0x525a11){var _0x4302e8=this;if(this['channels'][_0x525a11[_0xed87('0x25')]]){var _0xb6fe59=this[_0xed87('0x24')][_0x525a11[_0xed87('0x25')]]['id'];this[_0xed87('0x24')][_0x525a11[_0xed87('0x25')]][_0xed87('0x33')]=_0x525a11[_0xed87('0x33')];this[_0xed87('0x24')][_0x525a11['uniqueid']]['pagestransferred']=_0x525a11[_0xed87('0x34')];this[_0xed87('0x24')][_0x525a11[_0xed87('0x25')]][_0xed87('0x23')]=_0x525a11[_0xed87('0x23')];this[_0xed87('0x24')][_0x525a11['uniqueid']][_0xed87('0x35')]=_0x525a11[_0xed87('0x35')];this[_0xed87('0x24')][_0x525a11['uniqueid']][_0xed87('0x36')]=_0x525a11[_0xed87('0x36')];this[_0xed87('0x24')][_0x525a11[_0xed87('0x25')]][_0xed87('0x30')]=_0x525a11[_0xed87('0x30')];this[_0xed87('0x24')][_0x525a11[_0xed87('0x25')]][_0xed87('0x37')]=_0x525a11[_0xed87('0x37')];if(this['channels'][_0x525a11[_0xed87('0x25')]][_0xed87('0x34')]>0x0){tiff2pdf(_0x525a11[_0xed87('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x51d4b8){logger[_0xed87('0x28')](_0x525a11[_0xed87('0x25')],_0xed87('0x38'),_0x51d4b8[_0xed87('0x39')]);attachment['create']({'name':path[_0xed87('0x3a')](_0x525a11[_0xed87('0x30')])['name'],'basename':path[_0xed87('0x3a')](_0x525a11[_0xed87('0x30')])[_0xed87('0x27')]+_0xed87('0x3b'),'type':_0xed87('0x3c')})[_0xed87('0x3d')](function(_0x43921d){faxAccount[_0xed87('0x3e')](_0xb6fe59,{'from':_0x525a11[_0xed87('0x37')],'mapKey':_0xed87('0x6'),'body':path[_0xed87('0x3a')](_0x525a11['filename'])[_0xed87('0x27')]+_0xed87('0x3b'),'AttachmentId':_0x43921d['id']})[_0xed87('0x3f')](function(_0x11f97d){logger[_0xed87('0x40')](_0x525a11[_0xed87('0x25')],_0xed87('0x41'),JSON[_0xed87('0x42')](_0x11f97d));});})[_0xed87('0x3f')](function(_0x11ac3e){logger[_0xed87('0x40')](_0x525a11[_0xed87('0x25')],_0xed87('0x43'),JSON[_0xed87('0x42')](_0x11ac3e));});});}logger[_0xed87('0x28')](_0x525a11[_0xed87('0x25')],_0xed87('0x43'));}};Fax['prototype'][_0xed87('0x1d')]=function(_0x1a68a7){if(this[_0xed87('0xe')][_0x1a68a7['uniqueid']]){_[_0xed87('0x44')](this[_0xed87('0x24')][_0x1a68a7['uniqueid']],_[_0xed87('0x45')](_0x1a68a7,[_0xed87('0x46'),_0xed87('0x47')]));}};function updateStatus(_0x20652f){if(_0x20652f['AttachmentId']){faxMessage[_0xed87('0x48')](_0x20652f[_0xed87('0x49')],{'failMessage':_0xed87('0x4a')})[_0xed87('0x3d')](function(_0x3ef093){ut[_0xed87('0x4b')](_0xed87('0x4c'),_0x3ef093);})[_0xed87('0x3f')](function(_0x6da596){ut[_0xed87('0x4b')](_0xed87('0x4d'),_0x6da596);});}else{ut[_0xed87('0x4b')](_0xed87('0x4e'));}}Fax['prototype'][_0xed87('0x4f')]=function(_0x4ea4e3,_0x17cad7,_0x329973){var _0x446725=this;var _0x27ad77={};if(_0x17cad7){_0x27ad77={'read':_0x17cad7};}else{_0x27ad77={'failMessage':_0x329973};}if(this[_0xed87('0xe')][_0x4ea4e3][_0xed87('0x49')]){faxMessage[_0xed87('0x48')](this[_0xed87('0xe')][_0x4ea4e3][_0xed87('0x49')],_0x27ad77)[_0xed87('0x3d')](function(_0x55084f){ut[_0xed87('0x4b')](_0xed87('0x50'),_0x55084f);})[_0xed87('0x3f')](function(_0xa4b94e){ut[_0xed87('0x4b')](_0xed87('0x51'),_0xa4b94e);})[_0xed87('0x52')](function(){delete _0x446725[_0xed87('0x24')][_0x4ea4e3];delete _0x446725[_0xed87('0xe')][_0x4ea4e3];});}else{ut[_0xed87('0x4b')](_0xed87('0x53'));delete this['channels'][_0x4ea4e3];delete this['actions'][_0x4ea4e3];}};Fax[_0xed87('0x1e')][_0xed87('0x1b')]=function(_0xcd82d1){var _0x2ef4a9=this;if(this[_0xed87('0x24')][_0xcd82d1['uniqueid']]){if(this[_0xed87('0xe')][_0xcd82d1[_0xed87('0x25')]]){this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]]['id']=this[_0xed87('0xe')][_0xcd82d1[_0xed87('0x25')]]['id'];this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]][_0xed87('0x27')]=this[_0xed87('0xe')][_0xcd82d1[_0xed87('0x25')]][_0xed87('0x27')];}logger[_0xed87('0x28')](_0xcd82d1[_0xed87('0x25')],this['actions'][_0xcd82d1[_0xed87('0x25')]]?_0xed87('0x54'):_0xed87('0x55'),JSON[_0xed87('0x42')](this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]]));if(this[_0xed87('0xe')][_0xcd82d1[_0xed87('0x25')]]){if(this['channels'][_0xcd82d1[_0xed87('0x25')]][_0xed87('0x56')]>0x0&&this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]][_0xed87('0x17')]===_0xed87('0x57')){this['updateStatus'](_0xcd82d1['uniqueid'],!![]);}else{this[_0xed87('0x4f')](_0xcd82d1[_0xed87('0x25')],![],this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]][_0xed87('0x58')]?_0xed87('0x59')+this[_0xed87('0x24')][_0xcd82d1[_0xed87('0x25')]]['faxstatusstring']:_0xed87('0x5a'));}}}};Fax['prototype'][_0xed87('0x5b')]=function(_0x3c82de){var _0x4e5055=this;return new BPromise(function(_0x11b3a8,_0x30f9d0){_0x4e5055['execOriginate'](_0x3c82de,_0x4e5055[_0xed87('0xc')][_0x3c82de[_0xed87('0x5c')]])[_0xed87('0x3d')](function(_0x44aedb){ut[_0xed87('0x4b')]('[Fax][execOriginate][success]',_0x44aedb);_0x11b3a8(ut[_0xed87('0x39')](_0xed87('0x5d')));})[_0xed87('0x3f')](function(_0x34cb67){ut['logger']('[Fax][execOriginate][failure]',_0x34cb67);updateStatus(_0x3c82de);_0x30f9d0(ut[_0xed87('0x39')](_0xed87('0x5e')));});});};Fax['prototype'][_0xed87('0x5f')]=function(_0x40d5f6){var _0x4e8f6=this;return new BPromise(function(_0xa1c262,_0x1621ef){var _0x3eaf59=_0x4e8f6[_0xed87('0x60')](_0x4e8f6[_0xed87('0xc')][_0x40d5f6[_0xed87('0x5c')]][_0xed87('0x61')],_0x40d5f6);if(_0x3eaf59[_0xed87('0x62')]){_0xa1c262(ut[_0xed87('0x39')](_0xed87('0x63')));}else{_0x1621ef(ut[_0xed87('0x39')](_0x3eaf59['message']));}});};function originate(_0xa81cc8,_0x2686cd,_0x566ace){return new BPromise(function(_0x4f7b92,_0x5136c9){if(_0x566ace){var _0x288256=util[_0xed87('0x64')](_0xed87('0x65'),path[_0xed87('0x3a')](_0xa81cc8[_0xed87('0x4')])[_0xed87('0x27')],_0xa81cc8[_0xed87('0x4')]);gs['execute'](_0x288256)[_0xed87('0x3d')](function(){_0xa81cc8[_0xed87('0x4')]=util[_0xed87('0x64')](_0xed87('0x66'),path[_0xed87('0x3a')](_0xa81cc8[_0xed87('0x4')])[_0xed87('0x67')],path[_0xed87('0x3a')](_0xa81cc8[_0xed87('0x4')])[_0xed87('0x27')]);_0x2686cd['XMF-PATH']=_0xa81cc8['path'];ut['logger'](_0xed87('0x68'),'');ami[_0xed87('0x69')](ut[_0xed87('0x6a')](_0xa81cc8,_0x2686cd))[_0xed87('0x3d')](function(_0xb13b0b){_0x4f7b92(_0xb13b0b);})['catch'](function(_0x3f642c){_0x5136c9(_0x3f642c);});})[_0xed87('0x3f')](function(_0x3ed0e4){_0x5136c9(_0x3ed0e4);});}else{ami[_0xed87('0x69')](ut[_0xed87('0x6a')](_0xa81cc8,_0x2686cd))[_0xed87('0x3d')](function(_0x5e4e16){_0x4f7b92(_0x5e4e16);})['catch'](function(_0x2f5b5b){_0x5136c9(_0x2f5b5b);});}});}Fax[_0xed87('0x1e')][_0xed87('0x6b')]=function(_0xd03ea8,_0x720d5d){var _0x41e132=this;return new BPromise(function(_0x1b7fa7,_0x3b1b8d){var _0x23512f=uuid['v4']();var _0x2a4781=ut[_0xed87('0x6c')](_0xd03ea8,_0x720d5d);_0x41e132[_0xed87('0xe')][_0x23512f]=new Action(_0x23512f,_0x720d5d,_0xd03ea8);var _0x52af5c=_0x41e132[_0xed87('0xe')][_0x23512f];if(path[_0xed87('0x3a')](_0xd03ea8[_0xed87('0x4')])[_0xed87('0x6d')]===_0xed87('0x3b')){originate(_0x52af5c,_0x2a4781,!![])[_0xed87('0x3d')](function(_0x4ae84c){_0x1b7fa7(_0x4ae84c);})[_0xed87('0x3f')](function(_0x1b8f9d){_0x3b1b8d(_0x1b8f9d);});}else{originate(_0x52af5c,_0x2a4781,![])[_0xed87('0x3d')](function(_0xacd9d4){_0x1b7fa7(_0xacd9d4);})['catch'](function(_0x54277b){_0x3b1b8d(_0x54277b);});}});};Fax['prototype']['isTrunkReachable']=function(_0x51bc63){return!_[_0xed87('0x6e')](_0x51bc63)&&!_[_0xed87('0x6e')](_0x51bc63[_0xed87('0x27')])&&!_[_0xed87('0x6e')](_0x51bc63[_0xed87('0x6f')])&&_0x51bc63[_0xed87('0x6f')]&&!_[_0xed87('0x6e')](this[_0xed87('0xd')][util[_0xed87('0x64')]('SIP/%s',_0x51bc63['name'])])&&!_[_0xed87('0x6e')](this[_0xed87('0xd')][util[_0xed87('0x64')](_0xed87('0x70'),_0x51bc63[_0xed87('0x27')])]['status'])&&(this['trunks'][util[_0xed87('0x64')](_0xed87('0x70'),_0x51bc63['name'])][_0xed87('0x2f')]==='reachable'||this[_0xed87('0xd')][util['format'](_0xed87('0x70'),_0x51bc63[_0xed87('0x27')])][_0xed87('0x2f')]===_0xed87('0x71'));};Fax[_0xed87('0x1e')]['checkTrunk']=function(_0x27557d,_0x2c06b8){if(!this['isTrunkReachable'](_0x27557d)){ut[_0xed87('0x4b')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xed87('0x6e')](_0x27557d)?'':_0x27557d[_0xed87('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xed87('0x72')};}if(_[_0xed87('0x6e')](_0x2c06b8['fax'])){ut[_0xed87('0x4b')](_0xed87('0x73'),JSON[_0xed87('0x42')](_0x2c06b8));return{'isValid':![],'message':_0xed87('0x74')};}if(_['isNil'](_0x2c06b8[_0xed87('0x4')])){ut[_0xed87('0x4b')](_0xed87('0x75'),JSON[_0xed87('0x42')](_0x2c06b8));return{'isValid':![],'message':_0xed87('0x76')};}return{'isValid':!![],'message':_0xed87('0x77')};};module[_0xed87('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index bd28a73..e78fe12 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 _0x34c8=['bluebird','../../../config/logger','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x2383eb,_0x51db2b){var _0x1860ca=function(_0x185a5d){while(--_0x185a5d){_0x2383eb['push'](_0x2383eb['shift']());}};_0x1860ca(++_0x51db2b);}(_0x34c8,0x140));var _0x834c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x34c8[_0x1589dd];return _0x1bddd1;};'use strict';var util=require('util');var BPromise=require(_0x834c('0x0'));var logger=require(_0x834c('0x1'))('preview');var _=require('lodash');var faxAccount=require(_0x834c('0x2'));function loggerCatch(_0x3f0fc0){return function(_0x2fcca0){logger[_0x834c('0x3')](_0x3f0fc0,util[_0x834c('0x4')](_0x2fcca0,{'showHidden':![],'depth':null}));};}exports[_0x834c('0x5')]=function(_0x122ec0,_0x36ce93){return BPromise[_0x834c('0x6')]()[_0x834c('0x7')](faxAccount[_0x834c('0x5')](_0x122ec0,_0x36ce93))[_0x834c('0x8')](loggerCatch(_0x834c('0x9')));}; \ No newline at end of file +var _0xcab7=['bluebird','preview','error','inspect','notify','resolve','then','[Notify]\x20','util'];(function(_0x24a9f0,_0x565325){var _0x33399e=function(_0x2a5f6c){while(--_0x2a5f6c){_0x24a9f0['push'](_0x24a9f0['shift']());}};_0x33399e(++_0x565325);}(_0xcab7,0x18b));var _0x7cab=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0xcab7[_0x7ea1fb];return _0x478241;};'use strict';var util=require(_0x7cab('0x0'));var BPromise=require(_0x7cab('0x1'));var logger=require('../../../config/logger')(_0x7cab('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2c5224){return function(_0x8ef543){logger[_0x7cab('0x3')](_0x2c5224,util[_0x7cab('0x4')](_0x8ef543,{'showHidden':![],'depth':null}));};}exports[_0x7cab('0x5')]=function(_0x57a55d,_0x561b21){return BPromise[_0x7cab('0x6')]()[_0x7cab('0x7')](faxAccount[_0x7cab('0x5')](_0x57a55d,_0x561b21))['catch'](loggerCatch(_0x7cab('0x8')));}; \ 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 7e7472b..ba0d6dd 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 _0x69bc=['../../../../config/logger','fax','child_process','exec','Exec\x20gs','info','util'];(function(_0x5f5af9,_0xba23e9){var _0x33748c=function(_0x3d413e){while(--_0x3d413e){_0x5f5af9['push'](_0x5f5af9['shift']());}};_0x33748c(++_0xba23e9);}(_0x69bc,0x109));var _0xc69b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x69bc[_0x2bf141];return _0x48277b;};'use strict';var util=require(_0xc69b('0x0'));var logger=require(_0xc69b('0x1'))(_0xc69b('0x2'));var BPromise=require('bluebird');var exec=require(_0xc69b('0x3'))[_0xc69b('0x4')];exports['execute']=function(_0x1a798c){return new BPromise(function(_0x528ddb,_0x18a31c){exec(_0x1a798c,function(_0x5c4cae,_0x5d9347,_0x4f4192){logger['info'](_0xc69b('0x5'),_0x5d9347);if(_0x5c4cae){logger[_0xc69b('0x6')](_0xc69b('0x5'),'\x20Error\x20:',util['inspect'](_0x5c4cae,{'showHidden':![],'depth':null}),_0x5d9347,_0x4f4192);_0x18a31c(_0x5c4cae);}_0x528ddb(_0x5d9347);});});}; \ No newline at end of file +var _0x3107=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x3107,0x157));var _0x7310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3107[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7310('0x0'));var logger=require(_0x7310('0x1'))(_0x7310('0x2'));var BPromise=require(_0x7310('0x3'));var exec=require(_0x7310('0x4'))[_0x7310('0x5')];exports[_0x7310('0x6')]=function(_0x5046fc){return new BPromise(function(_0x27717d,_0x4e2675){exec(_0x5046fc,function(_0x524a6f,_0x3c14a6,_0x3fc66a){logger[_0x7310('0x7')]('Exec\x20gs',_0x3c14a6);if(_0x524a6f){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x7310('0x8')](_0x524a6f,{'showHidden':![],'depth':null}),_0x3c14a6,_0x3fc66a);_0x4e2675(_0x524a6f);}_0x27717d(_0x3c14a6);});});}; \ 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 d49d884..1d6c724 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 _0xecac=['moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','minrate','gateway','faxdetect','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util'];(function(_0x5445ad,_0x3665a6){var _0x109ec5=function(_0x3fabcd){while(--_0x3fabcd){_0x5445ad['push'](_0x5445ad['shift']());}};_0x109ec5(++_0x3665a6);}(_0xecac,0x71));var _0xceca=function(_0x5d7f49,_0x2db828){_0x5d7f49=_0x5d7f49-0x0;var _0x5dac0a=_0xecac[_0x5d7f49];return _0x5dac0a;};'use strict';var util=require(_0xceca('0x0'));var _=require('lodash');var moment=require(_0xceca('0x1'));var logger=require(_0xceca('0x2'))(_0xceca('0x3'));exports[_0xceca('0x4')]=function(_0x1e4b5a){return{'message':_0x1e4b5a};};exports[_0xceca('0x5')]=function(_0xc75ad1,_0x488366){logger[_0xceca('0x6')](_0xc75ad1,util['inspect'](_0x488366,{'showHidden':![],'depth':null}));};exports[_0xceca('0x7')]=function(_0x3b4659,_0x12c455){var _0x377822={'XMF-ECM':_0x12c455['ecm'],'XMF-HEADERINFO':_0x12c455[_0xceca('0x8')],'XMF-MINRATE':_0x12c455[_0xceca('0x9')],'XMF-MAXRATE':_0x12c455['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x12c455['modem']),'XMF-GATEWAY':_0x12c455[_0xceca('0xa')],'XMF-FAXDETECT':_0x12c455[_0xceca('0xb')],'XMF-T38TIMEOUT':_0x12c455['t38timeout'],'XMF-LOCALSTATIONID':_0x12c455[_0xceca('0xc')],'XMF-PATH':_0x3b4659['path']};return _0x377822;};exports[_0xceca('0xd')]=function(_0x96190c,_0x4be83e){return{'actionid':_0x96190c[_0xceca('0xe')],'action':'originate','channel':_0x96190c[_0xceca('0xf')],'Exten':_0xceca('0x10'),'Context':_0xceca('0x11'),'Priority':'1','callerid':util['format'](_0xceca('0x12'),_0x96190c[_0xceca('0x8')]?_0x96190c[_0xceca('0x8')]:'',_0x96190c[_0xceca('0xc')]),'variable':_0x4be83e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x96190c['uniqueid']};}; \ No newline at end of file +var _0xc805=['faxdetect','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','inspect','headerinfo','minrate','maxrate','format','gateway'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xc805,0x171));var _0x5c80=function(_0x3a2225,_0xb6600){_0x3a2225=_0x3a2225-0x0;var _0x5c8040=_0xc805[_0x3a2225];return _0x5c8040;};'use strict';var util=require(_0x5c80('0x0'));var _=require('lodash');var moment=require(_0x5c80('0x1'));var logger=require(_0x5c80('0x2'))(_0x5c80('0x3'));exports[_0x5c80('0x4')]=function(_0x222706){return{'message':_0x222706};};exports['logger']=function(_0xc535db,_0xcc02b3){logger['info'](_0xc535db,util[_0x5c80('0x5')](_0xcc02b3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x313e56,_0xc7f27e){var _0xb5d868={'XMF-ECM':_0xc7f27e['ecm'],'XMF-HEADERINFO':_0xc7f27e[_0x5c80('0x6')],'XMF-MINRATE':_0xc7f27e[_0x5c80('0x7')],'XMF-MAXRATE':_0xc7f27e[_0x5c80('0x8')],'XMF-MODEM':util[_0x5c80('0x9')]('\x22%s\x22',_0xc7f27e['modem']),'XMF-GATEWAY':_0xc7f27e[_0x5c80('0xa')],'XMF-FAXDETECT':_0xc7f27e[_0x5c80('0xb')],'XMF-T38TIMEOUT':_0xc7f27e['t38timeout'],'XMF-LOCALSTATIONID':_0xc7f27e[_0x5c80('0xc')],'XMF-PATH':_0x313e56[_0x5c80('0xd')]};return _0xb5d868;};exports[_0x5c80('0xe')]=function(_0xcb1611,_0x579a62){return{'actionid':_0xcb1611[_0x5c80('0xf')],'action':_0x5c80('0x10'),'channel':_0xcb1611['channel'],'Exten':_0x5c80('0x11'),'Context':_0x5c80('0x12'),'Priority':'1','callerid':util[_0x5c80('0x9')](_0x5c80('0x13'),_0xcb1611[_0x5c80('0x6')]?_0xcb1611[_0x5c80('0x6')]:'',_0xcb1611[_0x5c80('0xc')]),'variable':_0x579a62,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xcb1611['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 7e6069d..3102a70 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 _0x0fd9=['./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','bluebird','util','moment','./server','./report','./acw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd9,0x1dd));var _0x90fd=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0x0fd9[_0x368587];return _0x42d33c;};'use strict';var BPromise=require(_0x90fd('0x0'));var util=require(_0x90fd('0x1'));var moment=require(_0x90fd('0x2'));var server=require(_0x90fd('0x3'));var Realtime=require('./realtime');var Report=require(_0x90fd('0x4'));var Acw=require(_0x90fd('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x90fd('0x6'));var Fax=require(_0x90fd('0x7'));var user=require(_0x90fd('0x8'));var voiceQueue=require(_0x90fd('0x9'));var voiceQueueReport=require(_0x90fd('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x90fd('0xb'));var trigger=require(_0x90fd('0xc'));var template=require(_0x90fd('0xd'));var cmHopperHistory=require(_0x90fd('0xe'));var campaign=require(_0x90fd('0xf'));var voiceExtension=require(_0x90fd('0x10'));var faxAccount=require(_0x90fd('0x11'));var zendesk=require(_0x90fd('0x12'));var salesforce=require(_0x90fd('0x13'));var sugarcrm=require(_0x90fd('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x90fd('0x15'));var zoho=require(_0x90fd('0x16'));var vtiger=require(_0x90fd('0x17'));var freshsales=require(_0x90fd('0x18'));var servicenow=require(_0x90fd('0x19'));var dynamics365=require(_0x90fd('0x1a'));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(_0x90fd('0x1b'))(_0x90fd('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x90fd('0x1d')](_0x90fd('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x90fd('0x1f')]()[_0x90fd('0x20')](user[_0x90fd('0x21')]())[_0x90fd('0x20')](realtime[_0x90fd('0x22')]())[_0x90fd('0x20')](user['getTelephones']())[_0x90fd('0x20')](realtime[_0x90fd('0x23')]())[_0x90fd('0x20')](trunk[_0x90fd('0x24')]())[_0x90fd('0x20')](realtime[_0x90fd('0x25')]())[_0x90fd('0x20')](voiceQueue[_0x90fd('0x26')]())[_0x90fd('0x20')](realtime['initVoiceQueues']())[_0x90fd('0x20')](trigger[_0x90fd('0x27')]())[_0x90fd('0x20')](realtime[_0x90fd('0x28')]())['then'](template[_0x90fd('0x29')]())[_0x90fd('0x20')](realtime['initTemplates']())['then'](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())['then'](salesforce[_0x90fd('0x2a')]())[_0x90fd('0x20')](realtime['initSalesforceAccounts']())[_0x90fd('0x20')](sugarcrm[_0x90fd('0x2b')]())[_0x90fd('0x20')](realtime[_0x90fd('0x2c')]())[_0x90fd('0x20')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x90fd('0x2d')]())[_0x90fd('0x20')](desk[_0x90fd('0x2e')]())['then'](realtime[_0x90fd('0x2f')]())[_0x90fd('0x20')](zoho[_0x90fd('0x30')]())[_0x90fd('0x20')](realtime['initZohoAccounts']())[_0x90fd('0x20')](vtiger['getVtigerAccounts']())[_0x90fd('0x20')](realtime['initVtigerAccounts']())[_0x90fd('0x20')](freshsales[_0x90fd('0x31')]())[_0x90fd('0x20')](realtime[_0x90fd('0x32')]())[_0x90fd('0x20')](servicenow[_0x90fd('0x33')]())[_0x90fd('0x20')](realtime['initServicenowAccounts']())[_0x90fd('0x20')](dynamics365[_0x90fd('0x34')]())['then'](realtime[_0x90fd('0x35')]())[_0x90fd('0x20')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0x90fd('0x20')](voiceExtension[_0x90fd('0x36')]())[_0x90fd('0x20')](realtime['initVoiceExtensions']())[_0x90fd('0x20')](faxAccount[_0x90fd('0x37')]())[_0x90fd('0x20')](realtime[_0x90fd('0x38')]())[_0x90fd('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x90fd('0x1f')]()[_0x90fd('0x20')](voiceQueueReport['getVoiceQueueReports']())[_0x90fd('0x20')](realtime[_0x90fd('0x39')]())[_0x90fd('0x20')](cmHopperHistory[_0x90fd('0x3a')]())[_0x90fd('0x20')](realtime[_0x90fd('0x3b')]())['then'](cmHopperHistory[_0x90fd('0x3c')]())[_0x90fd('0x20')](realtime[_0x90fd('0x3d')]())['then'](voiceCallReport[_0x90fd('0x3e')]())['then'](realtime[_0x90fd('0x3f')]())[_0x90fd('0x40')](function(_0x44d075){logger[_0x90fd('0x41')]('[index.js][initParams]',util[_0x90fd('0x42')](_0x44d075,{'showHidden':![],'depth':null}));});}function main(){return server[_0x90fd('0x43')](realtime,preview,fax)['then'](function(_0x3ef2a6){return initRealtime();})[_0x90fd('0x20')](function(){return initParams();})[_0x90fd('0x20')](function(){report[_0x90fd('0x44')]();setInterval(initRealtime,0x1388);})[_0x90fd('0x40')](function(_0x6d6455){logger[_0x90fd('0x41')]('[index.js][main]',util[_0x90fd('0x42')](_0x6d6455,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x7797=['./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','bluebird','util','./server','./report','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow'];(function(_0x495c47,_0x20e4e1){var _0x204106=function(_0x360602){while(--_0x360602){_0x495c47['push'](_0x495c47['shift']());}};_0x204106(++_0x20e4e1);}(_0x7797,0x19e));var _0x7779=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x7797[_0x5a3cf0];return _0x5a64ee;};'use strict';var BPromise=require(_0x7779('0x0'));var util=require(_0x7779('0x1'));var moment=require('moment');var server=require(_0x7779('0x2'));var Realtime=require('./realtime');var Report=require(_0x7779('0x3'));var Acw=require('./acw');var Trigger=require(_0x7779('0x4'));var Dialer=require(_0x7779('0x5'));var Preview=require(_0x7779('0x6'));var Fax=require(_0x7779('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x7779('0x8'));var voiceQueueReport=require(_0x7779('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x7779('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x7779('0xb'));var cmHopperHistory=require(_0x7779('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x7779('0xd'));var faxAccount=require(_0x7779('0xe'));var zendesk=require(_0x7779('0xf'));var salesforce=require(_0x7779('0x10'));var sugarcrm=require(_0x7779('0x11'));var freshdesk=require(_0x7779('0x12'));var desk=require(_0x7779('0x13'));var zoho=require(_0x7779('0x14'));var vtiger=require(_0x7779('0x15'));var freshsales=require(_0x7779('0x16'));var servicenow=require(_0x7779('0x17'));var dynamics365=require(_0x7779('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x7779('0x19'))(_0x7779('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7779('0x1b')](_0x7779('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7779('0x1b')](_0x7779('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7779('0x1d')]()[_0x7779('0x1e')](user[_0x7779('0x1f')]())[_0x7779('0x1e')](realtime[_0x7779('0x20')]())['then'](user['getTelephones']())[_0x7779('0x1e')](realtime[_0x7779('0x21')]())[_0x7779('0x1e')](trunk[_0x7779('0x22')]())[_0x7779('0x1e')](realtime[_0x7779('0x23')]())['then'](voiceQueue[_0x7779('0x24')]())['then'](realtime[_0x7779('0x25')]())['then'](trigger[_0x7779('0x26')]())[_0x7779('0x1e')](realtime['initTriggers']())['then'](template[_0x7779('0x27')]())[_0x7779('0x1e')](realtime[_0x7779('0x28')]())[_0x7779('0x1e')](zendesk[_0x7779('0x29')]())['then'](realtime['initZendeskAccounts']())[_0x7779('0x1e')](salesforce[_0x7779('0x2a')]())[_0x7779('0x1e')](realtime[_0x7779('0x2b')]())['then'](sugarcrm[_0x7779('0x2c')]())['then'](realtime[_0x7779('0x2d')]())['then'](freshdesk[_0x7779('0x2e')]())['then'](realtime[_0x7779('0x2f')]())[_0x7779('0x1e')](desk[_0x7779('0x30')]())['then'](realtime[_0x7779('0x31')]())[_0x7779('0x1e')](zoho['getZohoAccounts']())[_0x7779('0x1e')](realtime['initZohoAccounts']())[_0x7779('0x1e')](vtiger[_0x7779('0x32')]())[_0x7779('0x1e')](realtime[_0x7779('0x33')]())[_0x7779('0x1e')](freshsales[_0x7779('0x34')]())['then'](realtime[_0x7779('0x35')]())[_0x7779('0x1e')](servicenow['getServicenowAccounts']())[_0x7779('0x1e')](realtime[_0x7779('0x36')]())[_0x7779('0x1e')](dynamics365[_0x7779('0x37')]())['then'](realtime['initDynamics365Accounts']())[_0x7779('0x1e')](campaign[_0x7779('0x38')]())[_0x7779('0x1e')](realtime[_0x7779('0x39')]())['then'](voiceExtension[_0x7779('0x3a')]())[_0x7779('0x1e')](realtime[_0x7779('0x3b')]())['then'](faxAccount[_0x7779('0x3c')]())[_0x7779('0x1e')](realtime[_0x7779('0x3d')]())[_0x7779('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x7779('0x1d')]()['then'](voiceQueueReport[_0x7779('0x3e')]())[_0x7779('0x1e')](realtime['initVoiceQueueReports']())[_0x7779('0x1e')](cmHopperHistory[_0x7779('0x3f')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x7779('0x1e')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x7779('0x40')]())[_0x7779('0x1e')](voiceCallReport[_0x7779('0x41')]())[_0x7779('0x1e')](realtime['initVoiceCallReports']())['catch'](function(_0x55a5bd){logger[_0x7779('0x42')](_0x7779('0x43'),util[_0x7779('0x44')](_0x55a5bd,{'showHidden':![],'depth':null}));});}function main(){return server[_0x7779('0x45')](realtime,preview,fax)['then'](function(_0x328fe1){return initRealtime();})['then'](function(){return initParams();})[_0x7779('0x1e')](function(){report[_0x7779('0x46')]();setInterval(initRealtime,0x1388);})[_0x7779('0x47')](function(_0x1a3320){logger[_0x7779('0x42')](_0x7779('0x48'),util['inspect'](_0x1a3320,{'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 44fbd60..a6ba195 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x47acda,_0x36345f){var _0x39d242=function(_0x535555){while(--_0x535555){_0x47acda['push'](_0x47acda['shift']());}};_0x39d242(++_0x36345f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0xcb91[_0x4c5c97];return _0xd5d2cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x21abe1,_0x179864){var _0x3f0b8f=function(_0x1e4382){while(--_0x1e4382){_0x21abe1['push'](_0x21abe1['shift']());}};_0x3f0b8f(++_0x179864);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcb91[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a9502f4..7731120 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 _0xd91e=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x3ef510,_0x1ff279){var _0x55c666=function(_0x40cb31){while(--_0x40cb31){_0x3ef510['push'](_0x3ef510['shift']());}};_0x55c666(++_0x1ff279);}(_0xd91e,0x122));var _0xed91=function(_0x125b82,_0x4607a9){_0x125b82=_0x125b82-0x0;var _0x325600=_0xd91e[_0x125b82];return _0x325600;};'use strict';function Campaign(_0xb780ef){this['id']=_0xb780ef['id']||0x0;this['name']=_0xb780ef[_0xed91('0x0')]||'';this[_0xed91('0x1')]=_0xb780ef[_0xed91('0x1')]||_0xed91('0x2');this[_0xed91('0x3')]=0x0;this[_0xed91('0x4')]=0x0;this[_0xed91('0x5')]=0x0;this[_0xed91('0x6')]=0x0;this[_0xed91('0x7')]='';this[_0xed91('0x8')]=!![];this[_0xed91('0x9')]=_0xb780ef[_0xed91('0x9')];this[_0xed91('0xa')]=_0xb780ef[_0xed91('0xa')];this['dialTimezone']=_0xb780ef[_0xed91('0xb')]||null;this[_0xed91('0xc')]=_0xb780ef[_0xed91('0xc')]?_0xb780ef[_0xed91('0xc')]:null;this[_0xed91('0xd')]=_0xb780ef['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xb780ef[_0xed91('0xe')];this[_0xed91('0xf')]=_0xb780ef[_0xed91('0xf')]||0x1e;this[_0xed91('0x10')]=_0xb780ef[_0xed91('0x10')];this[_0xed91('0x11')]=_0xb780ef[_0xed91('0x11')];this[_0xed91('0x12')]=_0xb780ef['dialBusyMaxRetry'];this[_0xed91('0x13')]=_0xb780ef[_0xed91('0x13')];this['dialNoAnswerMaxRetry']=_0xb780ef[_0xed91('0x14')];this[_0xed91('0x15')]=_0xb780ef[_0xed91('0x15')];this[_0xed91('0x16')]=_0xb780ef[_0xed91('0x16')];this['dialNoSuchNumberMaxRetry']=_0xb780ef[_0xed91('0x17')]||0x3;this[_0xed91('0x18')]=_0xb780ef[_0xed91('0x18')]||0x96;this[_0xed91('0x19')]=_0xb780ef['dialDropMaxRetry']||0x3;this[_0xed91('0x1a')]=_0xb780ef[_0xed91('0x1a')]||0x96;this[_0xed91('0x1b')]=_0xb780ef[_0xed91('0x1b')]||0x3;this['dialAbandonedRetryFrequency']=_0xb780ef[_0xed91('0x1c')]||0x96;this[_0xed91('0x1d')]=_0xb780ef[_0xed91('0x1d')]||0x3;this['dialMachineRetryFrequency']=_0xb780ef[_0xed91('0x1e')]||0x96;this['dialAgentRejectMaxRetry']=_0xb780ef[_0xed91('0x1f')]||0x3;this[_0xed91('0x20')]=_0xb780ef[_0xed91('0x20')]||0x96;this['dialOrderByScheduledAt']=_0xb780ef[_0xed91('0x21')]||_0xed91('0x22');this[_0xed91('0x23')]=_0xb780ef[_0xed91('0x23')]||undefined;this[_0xed91('0x24')]=_0xb780ef[_0xed91('0x24')]||undefined;this[_0xed91('0x25')]=_0xb780ef[_0xed91('0x25')]||undefined;this[_0xed91('0x26')]=_0xb780ef[_0xed91('0x26')]?_0xb780ef['TrunkBackup']:undefined;this['Trunk']=_0xb780ef['Trunk']?_0xb780ef['Trunk']:undefined;this['Interval']=_0xb780ef[_0xed91('0x27')]?_0xb780ef['Interval']:undefined;this['SquareProject']=_0xb780ef[_0xed91('0x28')]?_0xb780ef[_0xed91('0x28')]:undefined;this[_0xed91('0x29')]=_0xb780ef[_0xed91('0x28')]?_0xb780ef[_0xed91('0x28')]['name']:undefined;this[_0xed91('0x2a')]=_0xb780ef[_0xed91('0x2a')]||![];this[_0xed91('0x2b')]=_0xb780ef[_0xed91('0x2b')];this[_0xed91('0x2c')]=_0xb780ef[_0xed91('0x2c')];this[_0xed91('0x2d')]=_0xb780ef[_0xed91('0x2d')];this[_0xed91('0x2e')]=_0xb780ef['dialAMDTotalAnalysisTime'];this[_0xed91('0x2f')]=_0xb780ef['dialAMDMinWordLength'];this[_0xed91('0x30')]=_0xb780ef[_0xed91('0x30')];this['dialAMDMaximumNumberOfWords']=_0xb780ef[_0xed91('0x31')];this[_0xed91('0x32')]=_0xb780ef[_0xed91('0x32')];this[_0xed91('0x33')]=_0xb780ef['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0xb9a3=['active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive'];(function(_0x1e6aa7,_0x3282c6){var _0x5f20c3=function(_0x1dd529){while(--_0x1dd529){_0x1e6aa7['push'](_0x1e6aa7['shift']());}};_0x5f20c3(++_0x3282c6);}(_0xb9a3,0xfd));var _0x3b9a=function(_0x188a81,_0xd7c923){_0x188a81=_0x188a81-0x0;var _0xa0ac18=_0xb9a3[_0x188a81];return _0xa0ac18;};'use strict';function Campaign(_0x3ece0d){this['id']=_0x3ece0d['id']||0x0;this[_0x3b9a('0x0')]=_0x3ece0d[_0x3b9a('0x0')]||'';this[_0x3b9a('0x1')]=_0x3ece0d[_0x3b9a('0x1')]||'campaign';this[_0x3b9a('0x2')]=0x0;this[_0x3b9a('0x3')]=0x0;this[_0x3b9a('0x4')]=0x0;this[_0x3b9a('0x5')]=0x0;this['message']='';this[_0x3b9a('0x6')]=!![];this['active']=_0x3ece0d[_0x3b9a('0x7')];this[_0x3b9a('0x8')]=_0x3ece0d[_0x3b9a('0x8')];this[_0x3b9a('0x9')]=_0x3ece0d[_0x3b9a('0x9')]||null;this[_0x3b9a('0xa')]=_0x3ece0d['dialGlobalInterval']?_0x3ece0d[_0x3b9a('0xa')]:null;this[_0x3b9a('0xb')]=_0x3ece0d[_0x3b9a('0xb')];this[_0x3b9a('0xc')]=_0x3ece0d[_0x3b9a('0xc')];this[_0x3b9a('0xd')]=_0x3ece0d[_0x3b9a('0xd')]||0x1e;this[_0x3b9a('0xe')]=_0x3ece0d['dialCongestionMaxRetry'];this[_0x3b9a('0xf')]=_0x3ece0d[_0x3b9a('0xf')];this[_0x3b9a('0x10')]=_0x3ece0d[_0x3b9a('0x10')];this['dialBusyRetryFrequency']=_0x3ece0d[_0x3b9a('0x11')];this['dialNoAnswerMaxRetry']=_0x3ece0d[_0x3b9a('0x12')];this[_0x3b9a('0x13')]=_0x3ece0d['dialNoAnswerRetryFrequency'];this[_0x3b9a('0x14')]=_0x3ece0d[_0x3b9a('0x14')];this[_0x3b9a('0x15')]=_0x3ece0d['dialNoSuchNumberMaxRetry']||0x3;this[_0x3b9a('0x16')]=_0x3ece0d[_0x3b9a('0x16')]||0x96;this[_0x3b9a('0x17')]=_0x3ece0d['dialDropMaxRetry']||0x3;this[_0x3b9a('0x18')]=_0x3ece0d[_0x3b9a('0x18')]||0x96;this[_0x3b9a('0x19')]=_0x3ece0d['dialAbandonedMaxRetry']||0x3;this[_0x3b9a('0x1a')]=_0x3ece0d['dialAbandonedRetryFrequency']||0x96;this[_0x3b9a('0x1b')]=_0x3ece0d[_0x3b9a('0x1b')]||0x3;this[_0x3b9a('0x1c')]=_0x3ece0d[_0x3b9a('0x1c')]||0x96;this[_0x3b9a('0x1d')]=_0x3ece0d[_0x3b9a('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3ece0d[_0x3b9a('0x1e')]||0x96;this[_0x3b9a('0x1f')]=_0x3ece0d[_0x3b9a('0x1f')]||_0x3b9a('0x20');this['dialPrefix']=_0x3ece0d[_0x3b9a('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3ece0d[_0x3b9a('0x22')]||undefined;this[_0x3b9a('0x23')]=_0x3ece0d[_0x3b9a('0x23')]||undefined;this['TrunkBackup']=_0x3ece0d[_0x3b9a('0x24')]?_0x3ece0d[_0x3b9a('0x24')]:undefined;this[_0x3b9a('0x25')]=_0x3ece0d['Trunk']?_0x3ece0d[_0x3b9a('0x25')]:undefined;this[_0x3b9a('0x26')]=_0x3ece0d['Interval']?_0x3ece0d[_0x3b9a('0x26')]:undefined;this[_0x3b9a('0x27')]=_0x3ece0d[_0x3b9a('0x27')]?_0x3ece0d[_0x3b9a('0x27')]:undefined;this[_0x3b9a('0x28')]=_0x3ece0d['SquareProject']?_0x3ece0d[_0x3b9a('0x27')]['name']:undefined;this[_0x3b9a('0x29')]=_0x3ece0d[_0x3b9a('0x29')]||![];this[_0x3b9a('0x2a')]=_0x3ece0d[_0x3b9a('0x2a')];this[_0x3b9a('0x2b')]=_0x3ece0d[_0x3b9a('0x2b')];this[_0x3b9a('0x2c')]=_0x3ece0d[_0x3b9a('0x2c')];this[_0x3b9a('0x2d')]=_0x3ece0d[_0x3b9a('0x2d')];this[_0x3b9a('0x2e')]=_0x3ece0d['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x3ece0d[_0x3b9a('0x2f')];this[_0x3b9a('0x30')]=_0x3ece0d[_0x3b9a('0x30')];this['dialAMDSilenceThreshold']=_0x3ece0d[_0x3b9a('0x31')];this['dialAMDMaximumWordLength']=_0x3ece0d[_0x3b9a('0x32')];}module[_0x3b9a('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3f33e13..2f61c84 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 _0xf846=['endtime','unmanaged','lastapplication','lastdata','duration','holdtime','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','answertime'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0xf846,0x85));var _0x6f84=function(_0x2c16a6,_0x4e85aa){_0x2c16a6=_0x2c16a6-0x0;var _0x44b044=_0xf846[_0x2c16a6];return _0x44b044;};'use strict';function Channel(){this[_0x6f84('0x0')]=null;this[_0x6f84('0x1')]='';this[_0x6f84('0x2')]='';this[_0x6f84('0x3')]=0x0;this['calleridname']='';this[_0x6f84('0x4')]=undefined;this[_0x6f84('0x5')]=undefined;this[_0x6f84('0x6')]=0x0;this[_0x6f84('0x7')]='';this['uniqueid']=0x0;this[_0x6f84('0x8')]=0x0;this[_0x6f84('0x9')]=0x0;this[_0x6f84('0xa')]=![];this[_0x6f84('0xb')]=null;this[_0x6f84('0xc')]=null;this[_0x6f84('0xd')]=![];this['abandoned']=![];this[_0x6f84('0xe')]='';this[_0x6f84('0xf')]='';this[_0x6f84('0x10')]=0x0;this['billableseconds']=0x0;this[_0x6f84('0x11')]=0x0;this[_0x6f84('0x12')]=null;this['tag']=null;this[_0x6f84('0x13')]=null;this[_0x6f84('0x14')]=![];this[_0x6f84('0x15')]=null;this[_0x6f84('0x16')]=null;this[_0x6f84('0x17')]=[];this[_0x6f84('0x18')]=undefined;this[_0x6f84('0x19')]=undefined;this[_0x6f84('0x1a')]=undefined;this[_0x6f84('0x1b')]=0x0;}module[_0x6f84('0x1c')]=Channel; \ No newline at end of file +var _0x7e74=['lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0x7e74,0xbd));var _0x47e7=function(_0x22a0bf,_0x544300){_0x22a0bf=_0x22a0bf-0x0;var _0x517814=_0x7e74[_0x22a0bf];return _0x517814;};'use strict';function Channel(){this[_0x47e7('0x0')]=null;this['channel']='';this[_0x47e7('0x1')]='';this[_0x47e7('0x2')]=0x0;this[_0x47e7('0x3')]='';this[_0x47e7('0x4')]=undefined;this[_0x47e7('0x5')]=undefined;this['accountcode']=0x0;this[_0x47e7('0x6')]='';this[_0x47e7('0x7')]=0x0;this[_0x47e7('0x8')]=0x0;this[_0x47e7('0x9')]=0x0;this[_0x47e7('0xa')]=![];this[_0x47e7('0xb')]=null;this[_0x47e7('0xc')]=null;this['unmanaged']=![];this[_0x47e7('0xd')]=![];this['lastapplication']='';this[_0x47e7('0xe')]='';this[_0x47e7('0xf')]=0x0;this[_0x47e7('0x10')]=0x0;this[_0x47e7('0x11')]=0x0;this[_0x47e7('0x12')]=null;this[_0x47e7('0x13')]=null;this[_0x47e7('0x14')]=null;this[_0x47e7('0x15')]=![];this[_0x47e7('0x16')]=null;this[_0x47e7('0x17')]=null;this[_0x47e7('0x18')]=[];this[_0x47e7('0x19')]=undefined;this[_0x47e7('0x1a')]=undefined;this['transferType']=undefined;this[_0x47e7('0x1b')]=0x0;}module[_0x47e7('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 3436c62..5b88c3c 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 _0x55e8=['token','tokenSecret','type','serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x505c70,_0x4df129){var _0x210fb3=function(_0x9dbdd0){while(--_0x9dbdd0){_0x505c70['push'](_0x505c70['shift']());}};_0x210fb3(++_0x4df129);}(_0x55e8,0x8a));var _0x855e=function(_0x7514b4,_0x597a6c){_0x7514b4=_0x7514b4-0x0;var _0x4008c0=_0x55e8[_0x7514b4];return _0x4008c0;};'use strict';function DeskAccount(_0x4ef78b){this['id']=_0x4ef78b['id']||0x0;this['name']=_0x4ef78b[_0x855e('0x0')]||'';this['username']=_0x4ef78b['username']||'';this[_0x855e('0x1')]=_0x4ef78b[_0x855e('0x1')]||'';this[_0x855e('0x2')]=_0x4ef78b[_0x855e('0x2')]||'';this[_0x855e('0x3')]=_0x4ef78b[_0x855e('0x3')]||'';this[_0x855e('0x4')]=_0x4ef78b[_0x855e('0x4')]||'';this[_0x855e('0x5')]=_0x4ef78b[_0x855e('0x5')]||'';this['token']=_0x4ef78b[_0x855e('0x6')]||'';this['tokenSecret']=_0x4ef78b[_0x855e('0x7')]||'';this[_0x855e('0x8')]=_0x4ef78b['type']||'';this[_0x855e('0x9')]=_0x4ef78b[_0x855e('0x9')]||'';this[_0x855e('0xa')]=_0x4ef78b[_0x855e('0xa')]||{};}module[_0x855e('0xb')]=DeskAccount; \ No newline at end of file +var _0x5efc=['remoteUri','authType','consumerKey','consumerSecret','token','type','serverUrl','Configurations','exports','name','username'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x5efc,0xf0));var _0xc5ef=function(_0x3c17fd,_0x19dda1){_0x3c17fd=_0x3c17fd-0x0;var _0x29beba=_0x5efc[_0x3c17fd];return _0x29beba;};'use strict';function DeskAccount(_0x1db0ae){this['id']=_0x1db0ae['id']||0x0;this[_0xc5ef('0x0')]=_0x1db0ae[_0xc5ef('0x0')]||'';this[_0xc5ef('0x1')]=_0x1db0ae[_0xc5ef('0x1')]||'';this[_0xc5ef('0x2')]=_0x1db0ae[_0xc5ef('0x2')]||'';this[_0xc5ef('0x3')]=_0x1db0ae[_0xc5ef('0x3')]||'';this['password']=_0x1db0ae['password']||'';this[_0xc5ef('0x4')]=_0x1db0ae[_0xc5ef('0x4')]||'';this[_0xc5ef('0x5')]=_0x1db0ae[_0xc5ef('0x5')]||'';this[_0xc5ef('0x6')]=_0x1db0ae[_0xc5ef('0x6')]||'';this['tokenSecret']=_0x1db0ae['tokenSecret']||'';this[_0xc5ef('0x7')]=_0x1db0ae['type']||'';this[_0xc5ef('0x8')]=_0x1db0ae[_0xc5ef('0x8')]||'';this[_0xc5ef('0x9')]=_0x1db0ae['Configurations']||{};}module[_0xc5ef('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index dcbf14d..22695bb 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 _0xb4e6=['tenantId','clientId','clientSecret','Configurations','name','username','password','remoteUri'];(function(_0x589acc,_0x10d84f){var _0xc504ea=function(_0xc46735){while(--_0xc46735){_0x589acc['push'](_0x589acc['shift']());}};_0xc504ea(++_0x10d84f);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xb4e6[_0x354164];return _0x5db9a8;};'use strict';function Dynamics365Account(_0x54acd0){this['id']=_0x54acd0['id']||0x0;this['name']=_0x54acd0[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x54acd0[_0x6b4e('0x1')]||'';this[_0x6b4e('0x2')]=_0x54acd0[_0x6b4e('0x2')]||'';this[_0x6b4e('0x3')]=_0x54acd0[_0x6b4e('0x3')]||'';this['tenantId']=_0x54acd0[_0x6b4e('0x4')]||'';this[_0x6b4e('0x5')]=_0x54acd0[_0x6b4e('0x5')]||'';this['clientSecret']=_0x54acd0[_0x6b4e('0x6')]||{};this['serverUrl']=_0x54acd0['serverUrl']||'';this[_0x6b4e('0x7')]=_0x54acd0['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x750a=['tenantId','clientId','clientSecret','serverUrl','exports','name','username','password','remoteUri'];(function(_0x3e54c0,_0x249ca1){var _0x5e27dd=function(_0x150760){while(--_0x150760){_0x3e54c0['push'](_0x3e54c0['shift']());}};_0x5e27dd(++_0x249ca1);}(_0x750a,0x140));var _0xa750=function(_0x109b08,_0xf8e44c){_0x109b08=_0x109b08-0x0;var _0x317ae1=_0x750a[_0x109b08];return _0x317ae1;};'use strict';function Dynamics365Account(_0x4eae95){this['id']=_0x4eae95['id']||0x0;this[_0xa750('0x0')]=_0x4eae95['name']||'';this['username']=_0x4eae95[_0xa750('0x1')]||'';this[_0xa750('0x2')]=_0x4eae95[_0xa750('0x2')]||'';this[_0xa750('0x3')]=_0x4eae95[_0xa750('0x3')]||'';this[_0xa750('0x4')]=_0x4eae95[_0xa750('0x4')]||'';this[_0xa750('0x5')]=_0x4eae95[_0xa750('0x5')]||'';this[_0xa750('0x6')]=_0x4eae95[_0xa750('0x6')]||{};this[_0xa750('0x7')]=_0x4eae95[_0xa750('0x7')]||'';this['Configurations']=_0x4eae95['Configurations']||{};}module[_0xa750('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index bfeadd7..8f3246f 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 _0xa8fc=['t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x560985,_0x56ec80){var _0x5e72e6=function(_0xcd84ea){while(--_0xcd84ea){_0x560985['push'](_0x560985['shift']());}};_0x5e72e6(++_0x56ec80);}(_0xa8fc,0x1f3));var _0xca8f=function(_0x5c790b,_0x1c6e09){_0x5c790b=_0x5c790b-0x0;var _0x1e3bad=_0xa8fc[_0x5c790b];return _0x1e3bad;};'use strict';function FaxAccount(_0x4b9e28){this['id']=_0x4b9e28['id']||0x0;this[_0xca8f('0x0')]=_0x4b9e28[_0xca8f('0x0')]||'';this[_0xca8f('0x1')]=_0x4b9e28[_0xca8f('0x1')];this[_0xca8f('0x2')]=_0x4b9e28['ecm'];this[_0xca8f('0x3')]=_0x4b9e28[_0xca8f('0x3')];this['localstationid']=_0x4b9e28[_0xca8f('0x4')];this[_0xca8f('0x5')]=_0x4b9e28['minrate']||0x960;this[_0xca8f('0x6')]=_0x4b9e28['maxrate']||0x3840;this[_0xca8f('0x7')]=_0x4b9e28[_0xca8f('0x7')]||_0xca8f('0x8');this[_0xca8f('0x9')]=_0x4b9e28[_0xca8f('0x9')]||'no';this[_0xca8f('0xa')]=_0x4b9e28[_0xca8f('0xa')]||'no';this[_0xca8f('0xb')]=_0x4b9e28['t38timeout']||0x1388;this['tech']=_0x4b9e28[_0xca8f('0xc')]||'SIP';this[_0xca8f('0xd')]=_0x4b9e28[_0xca8f('0xd')]?_0x4b9e28[_0xca8f('0xd')]:undefined;this[_0xca8f('0xe')]=_0x4b9e28[_0xca8f('0xe')];this[_0xca8f('0xf')]=_0x4b9e28[_0xca8f('0xf')];}module[_0xca8f('0x10')]=FaxAccount; \ No newline at end of file +var _0xbaa8=['headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0xbaa8,0x11e));var _0x8baa=function(_0x2da77f,_0x4583a1){_0x2da77f=_0x2da77f-0x0;var _0x4b9eaa=_0xbaa8[_0x2da77f];return _0x4b9eaa;};'use strict';function FaxAccount(_0x248984){this['id']=_0x248984['id']||0x0;this[_0x8baa('0x0')]=_0x248984[_0x8baa('0x0')]||'';this['description']=_0x248984[_0x8baa('0x1')];this['ecm']=_0x248984['ecm'];this['headerinfo']=_0x248984[_0x8baa('0x2')];this[_0x8baa('0x3')]=_0x248984[_0x8baa('0x3')];this['minrate']=_0x248984['minrate']||0x960;this[_0x8baa('0x4')]=_0x248984['maxrate']||0x3840;this[_0x8baa('0x5')]=_0x248984[_0x8baa('0x5')]||_0x8baa('0x6');this[_0x8baa('0x7')]=_0x248984[_0x8baa('0x7')]||'no';this[_0x8baa('0x8')]=_0x248984[_0x8baa('0x8')]||'no';this[_0x8baa('0x9')]=_0x248984[_0x8baa('0x9')]||0x1388;this[_0x8baa('0xa')]=_0x248984[_0x8baa('0xa')]||_0x8baa('0xb');this['Trunk']=_0x248984['Trunk']?_0x248984[_0x8baa('0xc')]:undefined;this['ListId']=_0x248984[_0x8baa('0xd')];this[_0x8baa('0xe')]=_0x248984['key'];}module[_0x8baa('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 4da7653..f6cc45f 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 _0x165d=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0xc58152,_0x138a07){var _0x2828b4=function(_0x2cddf7){while(--_0x2cddf7){_0xc58152['push'](_0xc58152['shift']());}};_0x2828b4(++_0x138a07);}(_0x165d,0xb9));var _0xd165=function(_0x205f4f,_0x36fe50){_0x205f4f=_0x205f4f-0x0;var _0x1da9f7=_0x165d[_0x205f4f];return _0x1da9f7;};'use strict';function FreshdeskAccount(_0x484225){this['id']=_0x484225['id']||0x0;this[_0xd165('0x0')]=_0x484225[_0xd165('0x0')]||'';this[_0xd165('0x1')]=_0x484225['username']||'';this[_0xd165('0x2')]=_0x484225[_0xd165('0x3')]||'';this[_0xd165('0x4')]=_0x484225[_0xd165('0x4')]||'';this['serverUrl']=_0x484225[_0xd165('0x5')]||'';this[_0xd165('0x6')]=_0x484225['Configurations']||{};}module[_0xd165('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x02b4=['apiKey','token','remoteUri','Configurations','exports','name','username'];(function(_0x1af2d9,_0xe04498){var _0x51aa30=function(_0x2e396f){while(--_0x2e396f){_0x1af2d9['push'](_0x1af2d9['shift']());}};_0x51aa30(++_0xe04498);}(_0x02b4,0x140));var _0x402b=function(_0x25475d,_0x458ca3){_0x25475d=_0x25475d-0x0;var _0x155cf6=_0x02b4[_0x25475d];return _0x155cf6;};'use strict';function FreshdeskAccount(_0x4331d1){this['id']=_0x4331d1['id']||0x0;this[_0x402b('0x0')]=_0x4331d1['name']||'';this[_0x402b('0x1')]=_0x4331d1[_0x402b('0x1')]||'';this[_0x402b('0x2')]=_0x4331d1[_0x402b('0x3')]||'';this[_0x402b('0x4')]=_0x4331d1[_0x402b('0x4')]||'';this['serverUrl']=_0x4331d1['serverUrl']||'';this[_0x402b('0x5')]=_0x4331d1[_0x402b('0x5')]||{};}module[_0x402b('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 323bc5d..2ecbf14 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 _0xf50b=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xf50b,0xc8));var _0xbf50=function(_0x197cce,_0x49eab1){_0x197cce=_0x197cce-0x0;var _0x53576e=_0xf50b[_0x197cce];return _0x53576e;};'use strict';function FreshsalesAccount(_0x96c029){this['id']=_0x96c029['id']||0x0;this[_0xbf50('0x0')]=_0x96c029['name']||'';this[_0xbf50('0x1')]=_0x96c029[_0xbf50('0x1')]||'';this[_0xbf50('0x2')]=_0x96c029[_0xbf50('0x3')]||'';this['remoteUri']=_0x96c029[_0xbf50('0x4')]||'';this['serverUrl']=_0x96c029[_0xbf50('0x5')]||'';this[_0xbf50('0x6')]=_0x96c029[_0xbf50('0x6')]||{};}module[_0xbf50('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x4006=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x14f187,_0x366e04){var _0x1c972c=function(_0x3f09b7){while(--_0x3f09b7){_0x14f187['push'](_0x14f187['shift']());}};_0x1c972c(++_0x366e04);}(_0x4006,0x1c7));var _0x6400=function(_0x1ee1e9,_0x540e24){_0x1ee1e9=_0x1ee1e9-0x0;var _0x43194e=_0x4006[_0x1ee1e9];return _0x43194e;};'use strict';function FreshsalesAccount(_0x2ed8d6){this['id']=_0x2ed8d6['id']||0x0;this[_0x6400('0x0')]=_0x2ed8d6[_0x6400('0x0')]||'';this[_0x6400('0x1')]=_0x2ed8d6[_0x6400('0x1')]||'';this['apiKey']=_0x2ed8d6['token']||'';this[_0x6400('0x2')]=_0x2ed8d6['remoteUri']||'';this[_0x6400('0x3')]=_0x2ed8d6['serverUrl']||'';this['Configurations']=_0x2ed8d6[_0x6400('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index d4db186..ca41b61 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 _0xc342=['position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','context','exten','priority','holdtime','lastAssignedTo','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x412367,_0x1c74fc){var _0x51895a=function(_0x591daa){while(--_0x591daa){_0x412367['push'](_0x412367['shift']());}};_0x51895a(++_0x1c74fc);}(_0xc342,0x1ba));var _0x2c34=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0xc342[_0x15fa77];return _0x1385ff;};'use strict';function QueueReport(){this[_0x2c34('0x0')]=_0x2c34('0x1');this[_0x2c34('0x2')]='';this[_0x2c34('0x3')]='';this[_0x2c34('0x4')]='';this[_0x2c34('0x5')]='';this[_0x2c34('0x6')]=null;this[_0x2c34('0x7')]=null;this[_0x2c34('0x8')]=0x1;this[_0x2c34('0x9')]=0x1;this[_0x2c34('0xa')]=![];this['queuecallerabandonAt']=null;this[_0x2c34('0xb')]=![];this[_0x2c34('0xc')]=null;this['queuecallerexit']=![];this[_0x2c34('0xd')]=null;this[_0x2c34('0xe')]=0x1;this[_0x2c34('0xf')]='';this[_0x2c34('0x10')]='';this['connectedlinename']='';this['accountcode']='';this[_0x2c34('0x11')]='';this[_0x2c34('0x12')]='';this[_0x2c34('0x13')]='';this[_0x2c34('0x14')]=0x0;this['assigned']=![];this[_0x2c34('0x15')]='';this['motionChannel']=_0x2c34('0x16');this[_0x2c34('0x17')]=0x0;this[_0x2c34('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x5a9b=['context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode'];(function(_0x1caa67,_0x5c1298){var _0x1c3ea0=function(_0xa817ee){while(--_0xa817ee){_0x1caa67['push'](_0x1caa67['shift']());}};_0x1c3ea0(++_0x5c1298);}(_0x5a9b,0xa0));var _0xb5a9=function(_0x4f5033,_0x289213){_0x4f5033=_0x4f5033-0x0;var _0x14a669=_0x5a9b[_0x4f5033];return _0x14a669;};'use strict';function QueueReport(){this['type']='inbound';this[_0xb5a9('0x0')]='';this['calleridnum']='';this[_0xb5a9('0x1')]='';this[_0xb5a9('0x2')]='';this[_0xb5a9('0x3')]=null;this[_0xb5a9('0x4')]=null;this[_0xb5a9('0x5')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xb5a9('0x6')]=null;this[_0xb5a9('0x7')]=![];this[_0xb5a9('0x8')]=null;this[_0xb5a9('0x9')]=![];this[_0xb5a9('0xa')]=null;this[_0xb5a9('0xb')]=0x1;this[_0xb5a9('0xc')]='';this[_0xb5a9('0xd')]='';this['connectedlinename']='';this[_0xb5a9('0xe')]='';this[_0xb5a9('0xf')]='';this[_0xb5a9('0x10')]='';this[_0xb5a9('0x11')]='';this['holdtime']=0x0;this[_0xb5a9('0x12')]=![];this[_0xb5a9('0x13')]='';this[_0xb5a9('0x14')]=_0xb5a9('0x15');this[_0xb5a9('0x16')]=0x0;this[_0xb5a9('0x17')]={};}module[_0xb5a9('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 3ca795b..c5dd860 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 _0x5cd1=['exports','name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x5cd1,0x1cf));var _0x15cd=function(_0x47e63f,_0x14a4e9){_0x47e63f=_0x47e63f-0x0;var _0x5e65f9=_0x5cd1[_0x47e63f];return _0x5e65f9;};'use strict';function SalesforceAccount(_0x58d720){this['id']=_0x58d720['id']||0x0;this[_0x15cd('0x0')]=_0x58d720['name']||'';this['username']=_0x58d720[_0x15cd('0x1')]||'';this[_0x15cd('0x2')]=_0x58d720[_0x15cd('0x2')]||'';this['password']=_0x58d720['password']||'';this['clientId']=_0x58d720[_0x15cd('0x3')]||'';this[_0x15cd('0x4')]=_0x58d720[_0x15cd('0x4')]||'';this[_0x15cd('0x5')]=_0x58d720[_0x15cd('0x5')]||'';this[_0x15cd('0x6')]=_0x58d720[_0x15cd('0x6')]||_0x15cd('0x7');this[_0x15cd('0x8')]=_0x58d720[_0x15cd('0x8')]||'';this[_0x15cd('0x9')]=_0x58d720[_0x15cd('0x9')]||{};}module[_0x15cd('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xc591=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x2923f1,_0x48e12c){var _0x598bd4=function(_0x4fe221){while(--_0x4fe221){_0x2923f1['push'](_0x2923f1['shift']());}};_0x598bd4(++_0x48e12c);}(_0xc591,0xe0));var _0x1c59=function(_0x1fc36f,_0x464552){_0x1fc36f=_0x1fc36f-0x0;var _0x2856b4=_0xc591[_0x1fc36f];return _0x2856b4;};'use strict';function SalesforceAccount(_0x34739a){this['id']=_0x34739a['id']||0x0;this[_0x1c59('0x0')]=_0x34739a[_0x1c59('0x0')]||'';this[_0x1c59('0x1')]=_0x34739a[_0x1c59('0x1')]||'';this[_0x1c59('0x2')]=_0x34739a[_0x1c59('0x2')]||'';this[_0x1c59('0x3')]=_0x34739a[_0x1c59('0x3')]||'';this['clientId']=_0x34739a[_0x1c59('0x4')]||'';this[_0x1c59('0x5')]=_0x34739a[_0x1c59('0x5')]||'';this[_0x1c59('0x6')]=_0x34739a[_0x1c59('0x6')]||'';this[_0x1c59('0x7')]=_0x34739a[_0x1c59('0x7')]||_0x1c59('0x8');this[_0x1c59('0x9')]=_0x34739a['serverUrl']||'';this[_0x1c59('0xa')]=_0x34739a['Configurations']||{};}module[_0x1c59('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 9aaf6e1..6748121 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 _0x444f=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x444f,0x64));var _0xf444=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x444f[_0x152678];return _0x311a9;};'use strict';function ServicenowAccount(_0x3c2d41){this['id']=_0x3c2d41['id']||0x0;this['name']=_0x3c2d41[_0xf444('0x0')]||'';this[_0xf444('0x1')]=_0x3c2d41[_0xf444('0x1')]||'';this['password']=_0x3c2d41[_0xf444('0x2')]||'';this[_0xf444('0x3')]=_0x3c2d41['remoteUri']||'';this[_0xf444('0x4')]=_0x3c2d41['serverUrl']||'';this[_0xf444('0x5')]=_0x3c2d41[_0xf444('0x5')]||{};}module[_0xf444('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x14e1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x120d76,_0x118986){var _0x225d6e=function(_0xb7ad86){while(--_0xb7ad86){_0x120d76['push'](_0x120d76['shift']());}};_0x225d6e(++_0x118986);}(_0x14e1,0x187));var _0x114e=function(_0x4ed1ee,_0x4bfbf9){_0x4ed1ee=_0x4ed1ee-0x0;var _0x3e6784=_0x14e1[_0x4ed1ee];return _0x3e6784;};'use strict';function ServicenowAccount(_0xa44b05){this['id']=_0xa44b05['id']||0x0;this[_0x114e('0x0')]=_0xa44b05[_0x114e('0x0')]||'';this[_0x114e('0x1')]=_0xa44b05[_0x114e('0x1')]||'';this[_0x114e('0x2')]=_0xa44b05[_0x114e('0x2')]||'';this[_0x114e('0x3')]=_0xa44b05[_0x114e('0x3')]||'';this[_0x114e('0x4')]=_0xa44b05['serverUrl']||'';this[_0x114e('0x5')]=_0xa44b05['Configurations']||{};}module[_0x114e('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 dbebada..7e9e9b5 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 _0x2c1a=['name','username','remoteUri','serverUrl','exports'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x2c1a,0x96));var _0xa2c1=function(_0x7d2d21,_0xdb7e51){_0x7d2d21=_0x7d2d21-0x0;var _0x5f19df=_0x2c1a[_0x7d2d21];return _0x5f19df;};'use strict';function SugarcrmAccount(_0x3026f4){this['id']=_0x3026f4['id']||0x0;this[_0xa2c1('0x0')]=_0x3026f4['name']||'';this[_0xa2c1('0x1')]=_0x3026f4['username']||'';this['password']=_0x3026f4['password']||'';this[_0xa2c1('0x2')]=_0x3026f4['remoteUri']||'';this[_0xa2c1('0x3')]=_0x3026f4[_0xa2c1('0x3')]||'';this['Configurations']=_0x3026f4['Configurations']||{};}module[_0xa2c1('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0x1f52=['exports','name','password','remoteUri','Configurations'];(function(_0xd537c3,_0x2f9d0e){var _0xcc36=function(_0x3e63f8){while(--_0x3e63f8){_0xd537c3['push'](_0xd537c3['shift']());}};_0xcc36(++_0x2f9d0e);}(_0x1f52,0x105));var _0x21f5=function(_0x5b628a,_0x3da33c){_0x5b628a=_0x5b628a-0x0;var _0x10d10f=_0x1f52[_0x5b628a];return _0x10d10f;};'use strict';function SugarcrmAccount(_0x1d9659){this['id']=_0x1d9659['id']||0x0;this[_0x21f5('0x0')]=_0x1d9659[_0x21f5('0x0')]||'';this['username']=_0x1d9659['username']||'';this[_0x21f5('0x1')]=_0x1d9659[_0x21f5('0x1')]||'';this[_0x21f5('0x2')]=_0x1d9659[_0x21f5('0x2')]||'';this['serverUrl']=_0x1d9659['serverUrl']||'';this[_0x21f5('0x3')]=_0x1d9659['Configurations']||{};}module[_0x21f5('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 1458495..ef3d330 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 _0xaf2c=['status','exports','name','accountcode','state','unknown'];(function(_0x5b3b3d,_0x3808cf){var _0x54ef1b=function(_0x432ec4){while(--_0x432ec4){_0x5b3b3d['push'](_0x5b3b3d['shift']());}};_0x54ef1b(++_0x3808cf);}(_0xaf2c,0xaa));var _0xcaf2=function(_0x3a5dae,_0x20e1d0){_0x3a5dae=_0x3a5dae-0x0;var _0x4c2763=_0xaf2c[_0x3a5dae];return _0x4c2763;};'use strict';function Telephone(_0x181abf){this['id']=_0x181abf['id']||0x0;this['name']=_0x181abf[_0xcaf2('0x0')]||'';this[_0xcaf2('0x1')]=_0x181abf[_0xcaf2('0x1')]||'';this[_0xcaf2('0x2')]=_0xcaf2('0x3');this['stateTime']=0x0;this[_0xcaf2('0x4')]=_0xcaf2('0x3');this['address']='';}module[_0xcaf2('0x5')]=Telephone; \ No newline at end of file +var _0x5227=['status','unknown','address','name','accountcode','state','stateTime'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5227,0x1d1));var _0x7522=function(_0x208961,_0x5e6cf6){_0x208961=_0x208961-0x0;var _0x4236f5=_0x5227[_0x208961];return _0x4236f5;};'use strict';function Telephone(_0x350007){this['id']=_0x350007['id']||0x0;this[_0x7522('0x0')]=_0x350007[_0x7522('0x0')]||'';this[_0x7522('0x1')]=_0x350007[_0x7522('0x1')]||'';this[_0x7522('0x2')]='unknown';this[_0x7522('0x3')]=0x0;this[_0x7522('0x4')]=_0x7522('0x5');this[_0x7522('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 5abde16..1ae7a3c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x2ac0d8,_0x491ab4){var _0x3c11c5=function(_0x18ffb2){while(--_0x18ffb2){_0x2ac0d8['push'](_0x2ac0d8['shift']());}};_0x3c11c5(++_0x491ab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x57ab65,_0x4bc5d8){var _0x13caaf=function(_0x46453a){while(--_0x46453a){_0x57ab65['push'](_0x57ab65['shift']());}};_0x13caaf(++_0x4bc5d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ccd98a8..030a891 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(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0x5eb8[_0x5b734b];return _0x2a15a3;};'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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4d05e9,_0x361c7d){var _0x197a51=function(_0x1442f7){while(--_0x1442f7){_0x4d05e9['push'](_0x4d05e9['shift']());}};_0x197a51(++_0x361c7d);}(_0x2032,0xd9));var _0x2203=function(_0xbd7d93,_0x5d817f){_0xbd7d93=_0xbd7d93-0x0;var _0x5d4346=_0x2032[_0xbd7d93];return _0x5d4346;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e13d81f..c110b01 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 _0x6b54=['stateTime','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown'];(function(_0x33090b,_0x40eb47){var _0x2f8399=function(_0x4f9529){while(--_0x4f9529){_0x33090b['push'](_0x33090b['shift']());}};_0x2f8399(++_0x40eb47);}(_0x6b54,0x150));var _0x46b5=function(_0x46d68b,_0x154971){_0x46d68b=_0x46d68b-0x0;var _0x3a7893=_0x6b54[_0x46d68b];return _0x3a7893;};'use strict';function Trunk(_0x1a5c3c){this['id']=_0x1a5c3c['id']||0x0;this[_0x46b5('0x0')]=_0x1a5c3c[_0x46b5('0x0')]||![];this[_0x46b5('0x1')]=_0x1a5c3c[_0x46b5('0x1')]||'';this[_0x46b5('0x2')]=_0x46b5('0x3');this[_0x46b5('0x4')]=0x0;this['status']=_0x46b5('0x3');this[_0x46b5('0x5')]=_0x1a5c3c[_0x46b5('0x5')]&&_0x1a5c3c['registry'][_0x46b5('0x6')](':')?_0x1a5c3c[_0x46b5('0x5')][_0x46b5('0x7')](':')[0x0]:'';this[_0x46b5('0x8')]='';this[_0x46b5('0x9')]='';this[_0x46b5('0xa')]='';this[_0x46b5('0xb')]='';this[_0x46b5('0xc')]='';this[_0x46b5('0xd')]='unknown';this[_0x46b5('0xe')]='';this['address']='';this[_0x46b5('0xf')]=_0x1a5c3c[_0x46b5('0xf')]||'';}module[_0x46b5('0x10')]=Trunk; \ No newline at end of file +var _0x964f=['split','port','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x532ea3,_0xcbfca1){var _0x25a46e=function(_0x320706){while(--_0x320706){_0x532ea3['push'](_0x532ea3['shift']());}};_0x25a46e(++_0xcbfca1);}(_0x964f,0x1d4));var _0xf964=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x964f[_0x4e676e];return _0x336a3c;};'use strict';function Trunk(_0x427f68){this['id']=_0x427f68['id']||0x0;this['active']=_0x427f68[_0xf964('0x0')]||![];this['name']=_0x427f68[_0xf964('0x1')]||'';this[_0xf964('0x2')]=_0xf964('0x3');this[_0xf964('0x4')]=0x0;this[_0xf964('0x5')]=_0xf964('0x3');this[_0xf964('0x6')]=_0x427f68[_0xf964('0x6')]&&_0x427f68['registry'][_0xf964('0x7')](':')?_0x427f68['registry'][_0xf964('0x8')](':')[0x0]:'';this['host']='';this[_0xf964('0x9')]='';this['domain']='';this[_0xf964('0xa')]='';this[_0xf964('0xb')]='';this[_0xf964('0xc')]=_0xf964('0x3');this[_0xf964('0xd')]='';this[_0xf964('0xe')]='';this[_0xf964('0xf')]=_0x427f68[_0xf964('0xf')]||'';}module[_0xf964('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index f2a6a3e..28ce031 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 _0x5b0c=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x1c892f,_0x19f830){var _0x541b00=function(_0x2d8f9a){while(--_0x2d8f9a){_0x1c892f['push'](_0x1c892f['shift']());}};_0x541b00(++_0x19f830);}(_0x5b0c,0x1b7));var _0xc5b0=function(_0x27a900,_0x1cc305){_0x27a900=_0x27a900-0x0;var _0xea9b1f=_0x5b0c[_0x27a900];return _0xea9b1f;};'use strict';function voiceExtension(_0x588ca5){this['id']=_0x588ca5['id']||0x0;this[_0xc5b0('0x0')]=_0x588ca5[_0xc5b0('0x0')]||'';this[_0xc5b0('0x1')]=_0x588ca5[_0xc5b0('0x1')]||_0xc5b0('0x2');this[_0xc5b0('0x3')]=_0x588ca5[_0xc5b0('0x3')]||![];}module[_0xc5b0('0x4')]=voiceExtension; \ No newline at end of file +var _0xc603=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x1c8845,_0x3de0e7){var _0x43cef4=function(_0xf7b308){while(--_0xf7b308){_0x1c8845['push'](_0x1c8845['shift']());}};_0x43cef4(++_0x3de0e7);}(_0xc603,0xf0));var _0x3c60=function(_0x5f4ad2,_0x267858){_0x5f4ad2=_0x5f4ad2-0x0;var _0xb9882a=_0xc603[_0x5f4ad2];return _0xb9882a;};'use strict';function voiceExtension(_0x17a86c){this['id']=_0x17a86c['id']||0x0;this[_0x3c60('0x0')]=_0x17a86c[_0x3c60('0x0')]||'';this[_0x3c60('0x1')]=_0x17a86c[_0x3c60('0x1')]||_0x3c60('0x2');this[_0x3c60('0x3')]=_0x17a86c[_0x3c60('0x3')]||![];}module[_0x3c60('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 a3df511..044d727 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 _0x337f=['available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','ringing','ringinuse','onhold','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','loggedIn'];(function(_0x318a2e,_0x583848){var _0x54d0b6=function(_0x494034){while(--_0x494034){_0x318a2e['push'](_0x318a2e['shift']());}};_0x54d0b6(++_0x583848);}(_0x337f,0xc7));var _0xf337=function(_0x934a83,_0x5c5952){_0x934a83=_0x934a83-0x0;var _0xd3bc7f=_0x337f[_0x934a83];return _0xd3bc7f;};'use strict';var statusDesc=[_0xf337('0x0'),_0xf337('0x1'),'inuse','busy','invalid','unavailable',_0xf337('0x2'),_0xf337('0x3'),_0xf337('0x4')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xf337('0x5')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xf337('0x6')};function VoiceQueue(_0x42ad99){this['id']=_0x42ad99['id']||0x0;this[_0xf337('0x7')]=_0x42ad99[_0xf337('0x7')]||'';this[_0xf337('0x8')]=_0x42ad99[_0xf337('0x8')]||'';this[_0xf337('0x9')]=_0x42ad99[_0xf337('0x9')]||_0xf337('0xa');this[_0xf337('0xb')]=0x0;this[_0xf337('0xc')]=0x0;this[_0xf337('0xd')]=0x0;this[_0xf337('0xe')]=0x0;this[_0xf337('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xf337('0x10')]=0x0;this[_0xf337('0x11')]=0x0;this[_0xf337('0x12')]=_0x42ad99[_0xf337('0x12')]||![];this[_0xf337('0x13')]=_0x42ad99['acwTimeout']||0xa;this[_0xf337('0x14')]=_0x42ad99['autopause']||'no';this[_0xf337('0x15')]=!![];this['message']='';this[_0xf337('0x16')]=0x0;this[_0xf337('0x17')]=0x0;this[_0xf337('0x18')]=_0x42ad99['dialTimezone']||null;this[_0xf337('0x19')]=_0x42ad99['dialGlobalInterval']?_0x42ad99[_0xf337('0x19')]:null;this[_0xf337('0x1a')]=_0x42ad99[_0xf337('0x1a')];this[_0xf337('0x1b')]=_0x42ad99[_0xf337('0x1b')]||_0xf337('0x1c');this['dialLimitChannel']=_0x42ad99[_0xf337('0x1d')]||0x0;this['dialLimitQueue']=_0x42ad99[_0xf337('0x1e')]||0x0;this[_0xf337('0x1f')]=_0x42ad99[_0xf337('0x1f')]||0x1;this[_0xf337('0x20')]=_0x42ad99['dialPredictiveOptimization']||_0xf337('0x21');this[_0xf337('0x22')]=_0x42ad99[_0xf337('0x22')]||0.03;this['dialPredictiveInterval']=_0x42ad99['dialPredictiveInterval']||0x258;this[_0xf337('0x23')]=_0x42ad99[_0xf337('0x23')]||_0xf337('0x24');this['dialOriginateCallerIdNumber']=_0x42ad99[_0xf337('0x25')]||_0xf337('0x24');this[_0xf337('0x26')]=_0x42ad99[_0xf337('0x26')]||0x1e;this['dialQueueOptions']=_0x42ad99[_0xf337('0x27')]||_0xf337('0x28');this['dialQueueTimeout']=_0x42ad99['dialQueueTimeout']||0x3;this[_0xf337('0x29')]=_0x42ad99[_0xf337('0x29')]||undefined;this[_0xf337('0x2a')]=_0x42ad99[_0xf337('0x2a')]||0x3;this[_0xf337('0x2b')]=_0x42ad99['dialCongestionRetryFrequency']||0x96;this[_0xf337('0x2c')]=_0x42ad99[_0xf337('0x2c')]||0x3;this[_0xf337('0x2d')]=_0x42ad99[_0xf337('0x2d')]||0x96;this['dialNoAnswerMaxRetry']=_0x42ad99[_0xf337('0x2e')]||0x3;this[_0xf337('0x2f')]=_0x42ad99[_0xf337('0x2f')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x42ad99[_0xf337('0x30')]||0x3;this[_0xf337('0x31')]=_0x42ad99[_0xf337('0x31')]||0x96;this[_0xf337('0x32')]=_0x42ad99[_0xf337('0x32')]||0x3;this[_0xf337('0x33')]=_0x42ad99[_0xf337('0x33')]||0x96;this[_0xf337('0x34')]=_0x42ad99[_0xf337('0x34')]||0x3;this[_0xf337('0x35')]=_0x42ad99[_0xf337('0x35')]||0x96;this['dialMachineMaxRetry']=_0x42ad99['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x42ad99[_0xf337('0x36')]||0x96;this[_0xf337('0x37')]=_0x42ad99[_0xf337('0x37')]||0x3;this[_0xf337('0x38')]=_0x42ad99['dialAgentRejectRetryFrequency']||0x96;this[_0xf337('0x39')]=_0x42ad99[_0xf337('0x39')]||0x4;this[_0xf337('0x3a')]=_0x42ad99[_0xf337('0x3a')]?_0x42ad99[_0xf337('0x3a')]:undefined;this[_0xf337('0x3b')]=_0x42ad99['TrunkBackup']?_0x42ad99[_0xf337('0x3b')]:undefined;this[_0xf337('0x3c')]=_0x42ad99[_0xf337('0x3c')]||undefined;this[_0xf337('0x3d')]=_0x42ad99[_0xf337('0x3d')]?_0x42ad99[_0xf337('0x3d')]:undefined;this[_0xf337('0x3e')]=_0x42ad99[_0xf337('0x3e')]||'DESC';this[_0xf337('0x3f')]=_0x42ad99['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xf337('0x40')]=_0x42ad99[_0xf337('0x40')]||undefined;this[_0xf337('0x41')]=strategy[_0x42ad99['strategy']]||'rrmemory';this[_0xf337('0x42')]=!![];this[_0xf337('0x43')]=_0x42ad99[_0xf337('0x43')]||![];this[_0xf337('0x44')]=_0x42ad99['dialAMDInitialSilence'];this[_0xf337('0x45')]=_0x42ad99[_0xf337('0x45')];this['dialAMDAfterGreetingSilence']=_0x42ad99['dialAMDAfterGreetingSilence'];this[_0xf337('0x46')]=_0x42ad99['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x42ad99['dialAMDMinWordLength'];this[_0xf337('0x47')]=_0x42ad99[_0xf337('0x47')];this[_0xf337('0x48')]=_0x42ad99[_0xf337('0x48')];this[_0xf337('0x49')]=_0x42ad99[_0xf337('0x49')];this[_0xf337('0x4a')]=_0x42ad99[_0xf337('0x4a')];this[_0xf337('0x4b')]=0x0;this['pTalking']=0x0;this[_0xf337('0x4c')]=_0x42ad99[_0xf337('0x4c')];this[_0xf337('0x4d')]=0x0;this[_0xf337('0x4e')]=0x0;this[_0xf337('0x4f')]=0x0;this[_0xf337('0x50')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xf337('0x51')]=0x0;this[_0xf337('0x52')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xf337('0x53')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xf337('0x54')]=0x0;this[_0xf337('0x55')]=undefined;this['startPredictive']=undefined;this[_0xf337('0x56')]=undefined;this[_0xf337('0x57')]=1.05;this[_0xf337('0x58')]=0x0;this[_0xf337('0x59')]=0x0;this[_0xf337('0x5a')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xf337('0x5b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0xf337('0x5c')]=0x0;this[_0xf337('0x5d')]=_0x42ad99[_0xf337('0x5e')]||0x14;this[_0xf337('0x5f')]=_0x42ad99[_0xf337('0x5e')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xf337('0x60')]=0x0;this[_0xf337('0x61')]=0x1;this['erlangCalls']=0x0;this[_0xf337('0x62')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xf337('0x63')]=_0x42ad99['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x42ad99[_0xf337('0x64')]||![];this[_0xf337('0x65')]=!!_0x42ad99['dialPreviewAutoRecallMe']||![];this['dialQueueProject2']=_0x42ad99[_0xf337('0x66')]||undefined;this[_0xf337('0x67')]=_0x42ad99[_0xf337('0x67')]||![];this[_0xf337('0x68')]=_0x42ad99['dialAgiAfterHangupAgent']||![];this[_0xf337('0x8')]=monitorFormat[_0x42ad99[_0xf337('0x8')]]?monitorFormat[_0x42ad99[_0xf337('0x8')]]:undefined;this[_0xf337('0x69')]=_0x42ad99[_0xf337('0x69')]||![];this[_0xf337('0x6a')]=_0x42ad99['mandatoryDispositionPause']?_0x42ad99[_0xf337('0x6a')]:undefined;}module[_0xf337('0x6b')]=VoiceQueue; \ No newline at end of file +var _0x25bb=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel'];(function(_0x3cec45,_0x37d817){var _0x51d691=function(_0x2c671f){while(--_0x2c671f){_0x3cec45['push'](_0x3cec45['shift']());}};_0x51d691(++_0x37d817);}(_0x25bb,0xc9));var _0xb25b=function(_0x1e7197,_0x13e3ec){_0x1e7197=_0x1e7197-0x0;var _0x257d58=_0x25bb[_0x1e7197];return _0x257d58;};'use strict';var statusDesc=['unknown',_0xb25b('0x0'),_0xb25b('0x1'),_0xb25b('0x2'),_0xb25b('0x3'),'unavailable','ringing',_0xb25b('0x4'),_0xb25b('0x5')];var monitorFormat={'wav':_0xb25b('0x6'),'wav49':'wav49','gsm':_0xb25b('0x7')};var strategy={'rrmemory':_0xb25b('0x8'),'roundrobin':_0xb25b('0x9')};function VoiceQueue(_0x3a4cb8){this['id']=_0x3a4cb8['id']||0x0;this[_0xb25b('0xa')]=_0x3a4cb8[_0xb25b('0xa')]||'';this[_0xb25b('0xb')]=_0x3a4cb8[_0xb25b('0xb')]||'';this[_0xb25b('0xc')]=_0x3a4cb8[_0xb25b('0xc')]||_0xb25b('0xd');this['waiting']=0x0;this[_0xb25b('0xe')]=0x0;this[_0xb25b('0xf')]=0x0;this[_0xb25b('0x10')]=0x0;this[_0xb25b('0x11')]=0x0;this[_0xb25b('0x12')]=0x0;this[_0xb25b('0x13')]=0x0;this[_0xb25b('0x14')]=0x0;this[_0xb25b('0x15')]=0x0;this[_0xb25b('0x16')]=0x0;this[_0xb25b('0x17')]=0x0;this[_0xb25b('0x18')]=_0x3a4cb8[_0xb25b('0x18')]||![];this[_0xb25b('0x19')]=_0x3a4cb8[_0xb25b('0x19')]||0xa;this[_0xb25b('0x1a')]=_0x3a4cb8[_0xb25b('0x1a')]||'no';this[_0xb25b('0x1b')]=!![];this[_0xb25b('0x1c')]='';this[_0xb25b('0x1d')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x3a4cb8[_0xb25b('0x1e')]||null;this[_0xb25b('0x1f')]=_0x3a4cb8[_0xb25b('0x1f')]?_0x3a4cb8[_0xb25b('0x1f')]:null;this['dialActive']=_0x3a4cb8['dialActive'];this['dialMethod']=_0x3a4cb8[_0xb25b('0x20')]||_0xb25b('0x21');this[_0xb25b('0x22')]=_0x3a4cb8[_0xb25b('0x22')]||0x0;this[_0xb25b('0x23')]=_0x3a4cb8[_0xb25b('0x23')]||0x0;this[_0xb25b('0x24')]=_0x3a4cb8[_0xb25b('0x24')]||0x1;this[_0xb25b('0x25')]=_0x3a4cb8[_0xb25b('0x25')]||_0xb25b('0x26');this[_0xb25b('0x27')]=_0x3a4cb8['dialPredictiveOptimizationPercentage']||0.03;this[_0xb25b('0x28')]=_0x3a4cb8['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x3a4cb8[_0xb25b('0x29')]||_0xb25b('0x2a');this['dialOriginateCallerIdNumber']=_0x3a4cb8[_0xb25b('0x2b')]||_0xb25b('0x2a');this[_0xb25b('0x2c')]=_0x3a4cb8[_0xb25b('0x2c')]||0x1e;this[_0xb25b('0x2d')]=_0x3a4cb8[_0xb25b('0x2d')]||_0xb25b('0x2e');this['dialQueueTimeout']=_0x3a4cb8[_0xb25b('0x2f')]||0x3;this['dialQueueProject']=_0x3a4cb8['dialQueueProject']||undefined;this[_0xb25b('0x30')]=_0x3a4cb8[_0xb25b('0x30')]||0x3;this[_0xb25b('0x31')]=_0x3a4cb8['dialCongestionRetryFrequency']||0x96;this[_0xb25b('0x32')]=_0x3a4cb8['dialBusyMaxRetry']||0x3;this[_0xb25b('0x33')]=_0x3a4cb8[_0xb25b('0x33')]||0x96;this[_0xb25b('0x34')]=_0x3a4cb8['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x3a4cb8[_0xb25b('0x35')]||0x96;this[_0xb25b('0x36')]=_0x3a4cb8['dialNoSuchNumberMaxRetry']||0x3;this[_0xb25b('0x37')]=_0x3a4cb8[_0xb25b('0x37')]||0x96;this['dialDropMaxRetry']=_0x3a4cb8['dialDropMaxRetry']||0x3;this[_0xb25b('0x38')]=_0x3a4cb8[_0xb25b('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x3a4cb8['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3a4cb8[_0xb25b('0x39')]||0x96;this[_0xb25b('0x3a')]=_0x3a4cb8[_0xb25b('0x3a')]||0x3;this[_0xb25b('0x3b')]=_0x3a4cb8[_0xb25b('0x3b')]||0x96;this[_0xb25b('0x3c')]=_0x3a4cb8[_0xb25b('0x3c')]||0x3;this[_0xb25b('0x3d')]=_0x3a4cb8[_0xb25b('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x3a4cb8['dialGlobalMaxRetry']||0x4;this[_0xb25b('0x3e')]=_0x3a4cb8[_0xb25b('0x3e')]?_0x3a4cb8['Trunk']:undefined;this[_0xb25b('0x3f')]=_0x3a4cb8['TrunkBackup']?_0x3a4cb8[_0xb25b('0x3f')]:undefined;this[_0xb25b('0x40')]=_0x3a4cb8[_0xb25b('0x40')]||undefined;this[_0xb25b('0x41')]=_0x3a4cb8[_0xb25b('0x41')]?_0x3a4cb8['Interval']:undefined;this['dialOrderByScheduledAt']=_0x3a4cb8[_0xb25b('0x42')]||_0xb25b('0x43');this[_0xb25b('0x44')]=_0x3a4cb8[_0xb25b('0x44')]||undefined;this[_0xb25b('0x45')]=_0x3a4cb8[_0xb25b('0x45')]||undefined;this[_0xb25b('0x46')]=strategy[_0x3a4cb8[_0xb25b('0x46')]]||_0xb25b('0x8');this[_0xb25b('0x47')]=!![];this[_0xb25b('0x48')]=_0x3a4cb8[_0xb25b('0x48')]||![];this[_0xb25b('0x49')]=_0x3a4cb8[_0xb25b('0x49')];this['dialAMDGreeting']=_0x3a4cb8['dialAMDGreeting'];this[_0xb25b('0x4a')]=_0x3a4cb8[_0xb25b('0x4a')];this[_0xb25b('0x4b')]=_0x3a4cb8['dialAMDTotalAnalysisTime'];this[_0xb25b('0x4c')]=_0x3a4cb8[_0xb25b('0x4c')];this[_0xb25b('0x4d')]=_0x3a4cb8['dialAMDBetweenWordsSilence'];this[_0xb25b('0x4e')]=_0x3a4cb8[_0xb25b('0x4e')];this['dialAMDSilenceThreshold']=_0x3a4cb8[_0xb25b('0x4f')];this['dialAMDMaximumWordLength']=_0x3a4cb8[_0xb25b('0x50')];this[_0xb25b('0x51')]=0x0;this[_0xb25b('0x52')]=0x0;this['timeout']=_0x3a4cb8['timeout'];this[_0xb25b('0x53')]=0x0;this[_0xb25b('0x54')]=0x0;this[_0xb25b('0x55')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xb25b('0x56')]=0x0;this[_0xb25b('0x57')]=0x0;this[_0xb25b('0x58')]=0x0;this[_0xb25b('0x59')]=0x0;this[_0xb25b('0x5a')]=0x0;this[_0xb25b('0x5b')]=0x0;this[_0xb25b('0x5c')]=0x0;this[_0xb25b('0x5d')]=0x0;this[_0xb25b('0x5e')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xb25b('0x5f')]=undefined;this[_0xb25b('0x60')]=undefined;this[_0xb25b('0x61')]=1.05;this[_0xb25b('0x62')]=0x0;this[_0xb25b('0x63')]=0x0;this[_0xb25b('0x64')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb25b('0x65')]=0x0;this[_0xb25b('0x66')]=0x0;this[_0xb25b('0x67')]=0x0;this[_0xb25b('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3a4cb8['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb25b('0x69')]=_0x3a4cb8[_0xb25b('0x6a')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xb25b('0x6b')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0xb25b('0x6c')]=0x0;this['erlangBusyFactor']=0x0;this[_0xb25b('0x6d')]=_0x3a4cb8[_0xb25b('0x6d')]||0x1e;this['dialRecallInQueue']=_0x3a4cb8[_0xb25b('0x6e')]||![];this['dialPreviewAutoRecallMe']=!!_0x3a4cb8[_0xb25b('0x6f')]||![];this[_0xb25b('0x70')]=_0x3a4cb8['dialQueueProject2']||undefined;this[_0xb25b('0x71')]=_0x3a4cb8[_0xb25b('0x71')]||![];this[_0xb25b('0x72')]=_0x3a4cb8['dialAgiAfterHangupAgent']||![];this[_0xb25b('0xb')]=monitorFormat[_0x3a4cb8[_0xb25b('0xb')]]?monitorFormat[_0x3a4cb8['monitor_format']]:undefined;this[_0xb25b('0x73')]=_0x3a4cb8[_0xb25b('0x73')]||![];this[_0xb25b('0x74')]=_0x3a4cb8[_0xb25b('0x74')]?_0x3a4cb8[_0xb25b('0x74')]:undefined;}module[_0xb25b('0x75')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0081cec..ee7585d 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 _0xbc1d=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbc1d,0x127));var _0xdbc1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xbc1d[_0x138adb];return _0x1b27f2;};'use strict';function VtigerAccount(_0x5c6241){this['id']=_0x5c6241['id']||0x0;this[_0xdbc1('0x0')]=_0x5c6241[_0xdbc1('0x0')]||'';this[_0xdbc1('0x1')]=_0x5c6241[_0xdbc1('0x1')]||'';this['accessKey']=_0x5c6241['accessKey']||'';this[_0xdbc1('0x2')]=_0x5c6241[_0xdbc1('0x2')]||'';this[_0xdbc1('0x3')]=_0x5c6241[_0xdbc1('0x3')]||'';this[_0xdbc1('0x4')]=_0x5c6241[_0xdbc1('0x4')]||{};}module[_0xdbc1('0x5')]=VtigerAccount; \ No newline at end of file +var _0x8b98=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0xc6d89e,_0x20e99c){var _0x3d5476=function(_0x268ec1){while(--_0x268ec1){_0xc6d89e['push'](_0xc6d89e['shift']());}};_0x3d5476(++_0x20e99c);}(_0x8b98,0x1dc));var _0x88b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8b98[_0x4cf98e];return _0x1623ac;};'use strict';function VtigerAccount(_0x31d0fa){this['id']=_0x31d0fa['id']||0x0;this[_0x88b9('0x0')]=_0x31d0fa[_0x88b9('0x0')]||'';this[_0x88b9('0x1')]=_0x31d0fa['username']||'';this[_0x88b9('0x2')]=_0x31d0fa[_0x88b9('0x2')]||'';this[_0x88b9('0x3')]=_0x31d0fa[_0x88b9('0x3')]||'';this[_0x88b9('0x4')]=_0x31d0fa['serverUrl']||'';this[_0x88b9('0x5')]=_0x31d0fa[_0x88b9('0x5')]||{};}module[_0x88b9('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 365e1e0..77fa963 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 _0x7442=['authType','type','integrationTab','serverUrl','Configurations','exports','name','password','token','remoteUri'];(function(_0x50a448,_0x3d1a4d){var _0x5da8c6=function(_0x3310a6){while(--_0x3310a6){_0x50a448['push'](_0x50a448['shift']());}};_0x5da8c6(++_0x3d1a4d);}(_0x7442,0xec));var _0x2744=function(_0x3995dd,_0x24f96f){_0x3995dd=_0x3995dd-0x0;var _0x410f8a=_0x7442[_0x3995dd];return _0x410f8a;};'use strict';function ZendeskAccount(_0x5c4605){this['id']=_0x5c4605['id']||0x0;this[_0x2744('0x0')]=_0x5c4605[_0x2744('0x0')]||'';this['username']=_0x5c4605['username']||'';this[_0x2744('0x1')]=_0x5c4605[_0x2744('0x1')]||'';this[_0x2744('0x2')]=_0x5c4605[_0x2744('0x2')]||'';this['remoteUri']=_0x5c4605[_0x2744('0x3')]||'';this[_0x2744('0x4')]=_0x5c4605[_0x2744('0x4')]||'';this[_0x2744('0x5')]=_0x5c4605[_0x2744('0x5')]||_0x2744('0x6');this[_0x2744('0x7')]=_0x5c4605[_0x2744('0x7')]||'';this['Configurations']=_0x5c4605[_0x2744('0x8')]||{};}module[_0x2744('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xa852=['serverUrl','Configurations','exports','name','username','password','remoteUri','authType','type','integrationTab'];(function(_0x1111b6,_0x406ede){var _0x2b4945=function(_0x31ec4f){while(--_0x31ec4f){_0x1111b6['push'](_0x1111b6['shift']());}};_0x2b4945(++_0x406ede);}(_0xa852,0x99));var _0x2a85=function(_0x49559e,_0x68362c){_0x49559e=_0x49559e-0x0;var _0x1faf22=_0xa852[_0x49559e];return _0x1faf22;};'use strict';function ZendeskAccount(_0x3bd191){this['id']=_0x3bd191['id']||0x0;this[_0x2a85('0x0')]=_0x3bd191[_0x2a85('0x0')]||'';this[_0x2a85('0x1')]=_0x3bd191[_0x2a85('0x1')]||'';this[_0x2a85('0x2')]=_0x3bd191['password']||'';this['token']=_0x3bd191['token']||'';this[_0x2a85('0x3')]=_0x3bd191[_0x2a85('0x3')]||'';this[_0x2a85('0x4')]=_0x3bd191[_0x2a85('0x4')]||'';this['type']=_0x3bd191[_0x2a85('0x5')]||_0x2a85('0x6');this[_0x2a85('0x7')]=_0x3bd191[_0x2a85('0x7')]||'';this[_0x2a85('0x8')]=_0x3bd191['Configurations']||{};}module[_0x2a85('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4809255..e109702 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 _0x04f3=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x5d93c7,_0x580b09){var _0x54a38b=function(_0x38c4c2){while(--_0x38c4c2){_0x5d93c7['push'](_0x5d93c7['shift']());}};_0x54a38b(++_0x580b09);}(_0x04f3,0x19c));var _0x304f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x04f3[_0x2dafbe];return _0x58a45a;};'use strict';function ZohoAccount(_0x3ca31e){this['id']=_0x3ca31e['id']||0x0;this[_0x304f('0x0')]=_0x3ca31e['name']||'';this[_0x304f('0x1')]=_0x3ca31e['description']||'';this[_0x304f('0x2')]=_0x3ca31e[_0x304f('0x2')]||'';this[_0x304f('0x3')]=_0x3ca31e[_0x304f('0x3')]||'';this[_0x304f('0x4')]=_0x3ca31e[_0x304f('0x4')]||'';this[_0x304f('0x5')]=_0x3ca31e[_0x304f('0x5')]||'';this['serverUrl']=_0x3ca31e[_0x304f('0x6')]||'';this[_0x304f('0x7')]=_0x3ca31e[_0x304f('0x7')]||'';this[_0x304f('0x8')]=_0x3ca31e[_0x304f('0x8')]||'';this[_0x304f('0x9')]=_0x3ca31e[_0x304f('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x0538=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x3f8b3c,_0x41b2bc){var _0x4bb679=function(_0x252040){while(--_0x252040){_0x3f8b3c['push'](_0x3f8b3c['shift']());}};_0x4bb679(++_0x41b2bc);}(_0x0538,0x129));var _0x8053=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0x0538[_0x13524d];return _0x9918b4;};'use strict';function ZohoAccount(_0x19a0e0){this['id']=_0x19a0e0['id']||0x0;this[_0x8053('0x0')]=_0x19a0e0[_0x8053('0x0')]||'';this[_0x8053('0x1')]=_0x19a0e0[_0x8053('0x1')]||'';this[_0x8053('0x2')]=_0x19a0e0['host']||'';this[_0x8053('0x3')]=_0x19a0e0[_0x8053('0x3')]||'';this[_0x8053('0x4')]=_0x19a0e0[_0x8053('0x4')]||'';this[_0x8053('0x5')]=_0x19a0e0[_0x8053('0x5')]||'';this[_0x8053('0x6')]=_0x19a0e0[_0x8053('0x6')]||'';this[_0x8053('0x7')]=_0x19a0e0[_0x8053('0x7')]||'';this['refreshToken']=_0x19a0e0[_0x8053('0x8')]||'';this['Configurations']=_0x19a0e0[_0x8053('0x9')]||{};}module[_0x8053('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 88dd828..c48c390 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 _0xcd59=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackat','recallme','ContactId'];(function(_0x2e5cfd,_0x3e18a1){var _0x171636=function(_0xdf3162){while(--_0xdf3162){_0x2e5cfd['push'](_0x2e5cfd['shift']());}};_0x171636(++_0x3e18a1);}(_0xcd59,0x110));var _0x9cd5=function(_0x520945,_0x28b144){_0x520945=_0x520945-0x0;var _0x17067a=_0xcd59[_0x520945];return _0x17067a;};'use strict';var util=require(_0x9cd5('0x0'));var _=require(_0x9cd5('0x1'));var moment=require(_0x9cd5('0x2'));function checkNameSurname(_0x2ccb4a,_0xc032e9,_0x55d0c6){var _0x222c55='';if(!_['isNil'](_0xc032e9)&&_0x9cd5('0x3')===typeof _0xc032e9){_0x222c55+=_0xc032e9;}if(!_[_0x9cd5('0x4')](_0x55d0c6)&&_0x9cd5('0x3')===typeof _0x55d0c6){_0x222c55+='\x20'+_0x55d0c6;}if(_0x222c55!==''){return _0x222c55;}return _0x2ccb4a;}function Action(_0x7e27a1,_0x338e07,_0x31f3f5,_0x9b0039,_0xc029be){this[_0x9cd5('0x5')]=_0x31f3f5||undefined;this[_0x9cd5('0x6')]=_0x7e27a1['id'];this[_0x9cd5('0x7')]=_0x338e07[_0x9cd5('0x8')];this[_0x9cd5('0x9')]=_0x338e07[_0x9cd5('0x9')];this[_0x9cd5('0xa')]=_0x9cd5('0x7');this[_0x9cd5('0xb')]=![];this['membername']=_[_0x9cd5('0x4')](_0x7e27a1[_0x9cd5('0xc')])?undefined:_0x7e27a1[_0x9cd5('0xc')][_0x9cd5('0x8')];this[_0x9cd5('0xd')]=this[_0x9cd5('0xe')]?util[_0x9cd5('0xf')](_0x9cd5('0x10'),this[_0x9cd5('0xe')]):_0x9b0039||undefined;this[_0x9cd5('0x11')]=checkNameSurname(_0x7e27a1[_0x9cd5('0x12')]['phone'],_0x7e27a1[_0x9cd5('0x12')][_0x9cd5('0x13')],_0x7e27a1[_0x9cd5('0x12')][_0x9cd5('0x14')]);this[_0x9cd5('0x15')]=_0x7e27a1[_0x9cd5('0x15')]||![];this['calleridnum']=_0x7e27a1[_0x9cd5('0x12')][_0x9cd5('0x16')];this['scheduledat']=_0x7e27a1[_0x9cd5('0x17')];this[_0x9cd5('0x18')]=_0x7e27a1[_0x9cd5('0x18')]||0x0;this['countcongestionretry']=_0x7e27a1[_0x9cd5('0x19')]||0x0;this[_0x9cd5('0x1a')]=_0x7e27a1[_0x9cd5('0x1a')]||0x0;this['countglobal']=(_0x7e27a1['countbusyretry']||0x0)+(_0x7e27a1['countcongestionretry']||0x0)+(_0x7e27a1[_0x9cd5('0x1a')]||0x0)+(_0x7e27a1['countnosuchnumberretry']||0x0)+(_0x7e27a1[_0x9cd5('0x1b')]||0x0)+(_0x7e27a1[_0x9cd5('0x1c')]||0x0)+(_0x7e27a1[_0x9cd5('0x1d')]||0x0)+(_0x7e27a1[_0x9cd5('0x1e')]||0x0);this[_0x9cd5('0x1f')]=_0x7e27a1[_0x9cd5('0x1f')]||0x0;this['countdropretry']=_0x7e27a1[_0x9cd5('0x1b')]||0x0;this['countabandonedretry']=_0x7e27a1[_0x9cd5('0x1c')]||0x0;this[_0x9cd5('0x1d')]=_0x7e27a1[_0x9cd5('0x1d')]||0x0;this['countagentrejectretry']=_0x7e27a1[_0x9cd5('0x1e')]||0x0;this['callback']=_0x7e27a1[_0x9cd5('0x20')];this['callbackuniqueid']=_0x7e27a1['callbackuniqueid'];this[_0x9cd5('0x21')]=_0x7e27a1['callbackat'];this[_0x9cd5('0x22')]=_0x7e27a1[_0x9cd5('0x22')];this[_0x9cd5('0x23')]=_0x7e27a1[_0x9cd5('0x23')];this[_0x9cd5('0x24')]=_0x7e27a1[_0x9cd5('0x24')];this[_0x9cd5('0x25')]=_[_0x9cd5('0x4')](_0x7e27a1['Agent'])?_0x7e27a1[_0x9cd5('0x25')]:_0x7e27a1[_0x9cd5('0xc')]['id'];this['VoiceQueueId']=_0x7e27a1[_0x9cd5('0x26')];this[_0x9cd5('0x27')]='';this[_0x9cd5('0x28')]='';}Action['prototype'][_0x9cd5('0x29')]=function(){return util[_0x9cd5('0xf')]('\x22%s\x22\x20<%s>',this[_0x9cd5('0x11')],this[_0x9cd5('0x2a')]);};module[_0x9cd5('0x2b')]=Action; \ No newline at end of file +var _0x911b=['countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','format','number','exports','lodash','moment','isNil','string','uniqueid','idContact','name','campaigntype','queue','dialAnswer','Agent','channelAgent','membername','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x3ace8b,_0x10431e){var _0x5a2a2c=function(_0x6ec664){while(--_0x6ec664){_0x3ace8b['push'](_0x3ace8b['shift']());}};_0x5a2a2c(++_0x10431e);}(_0x911b,0x17a));var _0xb911=function(_0x3fc09a,_0x4c5d4d){_0x3fc09a=_0x3fc09a-0x0;var _0x4d0ddb=_0x911b[_0x3fc09a];return _0x4d0ddb;};'use strict';var util=require('util');var _=require(_0xb911('0x0'));var moment=require(_0xb911('0x1'));function checkNameSurname(_0x53723f,_0x78e6a8,_0x8234e){var _0x578c19='';if(!_[_0xb911('0x2')](_0x78e6a8)&&_0xb911('0x3')===typeof _0x78e6a8){_0x578c19+=_0x78e6a8;}if(!_['isNil'](_0x8234e)&&_0xb911('0x3')===typeof _0x8234e){_0x578c19+='\x20'+_0x8234e;}if(_0x578c19!==''){return _0x578c19;}return _0x53723f;}function Action(_0x17b676,_0x2875b0,_0x3cb177,_0x33e3c0,_0x5b0203){this[_0xb911('0x4')]=_0x3cb177||undefined;this[_0xb911('0x5')]=_0x17b676['id'];this['queue']=_0x2875b0[_0xb911('0x6')];this['type']=_0x2875b0['type'];this[_0xb911('0x7')]=_0xb911('0x8');this[_0xb911('0x9')]=![];this['membername']=_[_0xb911('0x2')](_0x17b676[_0xb911('0xa')])?undefined:_0x17b676['Agent'][_0xb911('0x6')];this[_0xb911('0xb')]=this[_0xb911('0xc')]?util['format'](_0xb911('0xd'),this[_0xb911('0xc')]):_0x33e3c0||undefined;this[_0xb911('0xe')]=checkNameSurname(_0x17b676[_0xb911('0xf')][_0xb911('0x10')],_0x17b676[_0xb911('0xf')][_0xb911('0x11')],_0x17b676[_0xb911('0xf')][_0xb911('0x12')]);this[_0xb911('0x13')]=_0x17b676['active']||![];this[_0xb911('0x14')]=_0x17b676[_0xb911('0xf')][_0xb911('0x10')];this[_0xb911('0x15')]=_0x17b676['scheduledat'];this[_0xb911('0x16')]=_0x17b676[_0xb911('0x16')]||0x0;this[_0xb911('0x17')]=_0x17b676[_0xb911('0x17')]||0x0;this[_0xb911('0x18')]=_0x17b676[_0xb911('0x18')]||0x0;this[_0xb911('0x19')]=(_0x17b676[_0xb911('0x16')]||0x0)+(_0x17b676['countcongestionretry']||0x0)+(_0x17b676[_0xb911('0x18')]||0x0)+(_0x17b676[_0xb911('0x1a')]||0x0)+(_0x17b676['countdropretry']||0x0)+(_0x17b676['countabandonedretry']||0x0)+(_0x17b676['countmachineretry']||0x0)+(_0x17b676[_0xb911('0x1b')]||0x0);this[_0xb911('0x1a')]=_0x17b676[_0xb911('0x1a')]||0x0;this[_0xb911('0x1c')]=_0x17b676[_0xb911('0x1c')]||0x0;this[_0xb911('0x1d')]=_0x17b676[_0xb911('0x1d')]||0x0;this[_0xb911('0x1e')]=_0x17b676['countmachineretry']||0x0;this[_0xb911('0x1b')]=_0x17b676[_0xb911('0x1b')]||0x0;this[_0xb911('0x1f')]=_0x17b676[_0xb911('0x1f')];this[_0xb911('0x20')]=_0x17b676['callbackuniqueid'];this['callbackat']=_0x17b676[_0xb911('0x21')];this[_0xb911('0x22')]=_0x17b676['recallme'];this[_0xb911('0x23')]=_0x17b676['ContactId'];this[_0xb911('0x24')]=_0x17b676[_0xb911('0x24')];this[_0xb911('0x25')]=_[_0xb911('0x2')](_0x17b676['Agent'])?_0x17b676['UserId']:_0x17b676[_0xb911('0xa')]['id'];this['VoiceQueueId']=_0x17b676[_0xb911('0x26')];this[_0xb911('0x27')]='';this['originatecalleridname']='';}Action[_0xb911('0x28')][_0xb911('0x29')]=function(){return util[_0xb911('0x2a')]('\x22%s\x22\x20<%s>',this[_0xb911('0xe')],this[_0xb911('0x2b')]);};module[_0xb911('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 200bb54..41b60e6 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 _0x00bb=['[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','object','isUndefined','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','isEmpty','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','catch','Call\x20failed','logBlacklist','SIP/%s','status','reachable','unmonitored','execRun','unlockContact','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','Empty\x20Contact','ACTIVE','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','actionid','lookAgent','logLookAgent','isFailure','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','destlinkedid','destuniqueid','variables','syncVarSet','filterKey','variable','addVariable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','moment','ioredis','../../../config/environment','preview','../../../config/logger','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','syncHangupRequest','syncDialEnd','bind','newexten','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','outbound','name','strategy','available','loggedIn','sumBillable','sumDuration','talking','total','type','unmanaged','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','isNil','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime'];(function(_0x11281d,_0x323b6b){var _0x2aa9a1=function(_0x318441){while(--_0x318441){_0x11281d['push'](_0x11281d['shift']());}};_0x2aa9a1(++_0x323b6b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var BPromise=require(_0xb00b('0x2'));var uuid=require('uuid');var moment=require(_0xb00b('0x3'));var md5=require('md5');var Redis=require(_0xb00b('0x4'));var config=require(_0xb00b('0x5'));var logger=require('../../../config/logger')(_0xb00b('0x6'));var loggerAction=require(_0xb00b('0x7'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xb00b('0x8'));var ut=require(_0xb00b('0x9'));config[_0xb00b('0xa')]=_[_0xb00b('0xb')](config[_0xb00b('0xa')],{'host':_0xb00b('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb00b('0xd')][_0xb00b('0xe')]=function(_0x5851d4){this[_0xb00b('0xf')]=this[_0xb00b('0xf')]?this['tail'][_0xb00b('0x10')](_0x5851d4):_0x5851d4();};function Preview(_0x5a63ed){this['sequence']=new Sequence();this['campaignsPreview']=_0x5a63ed[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x5a63ed[_0xb00b('0x12')];this[_0xb00b('0x13')]={};this[_0xb00b('0x14')]=_0x5a63ed[_0xb00b('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0xb00b('0x15'),this[_0xb00b('0x16')]['bind'](this));ami['on'](_0xb00b('0x17'),this[_0xb00b('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xb00b('0x19')]['bind'](this));ami['on']('dialend',this[_0xb00b('0x1a')][_0xb00b('0x1b')](this));ami['on'](_0xb00b('0x1c'),this[_0xb00b('0x1d')]['bind'](this));ami['on'](_0xb00b('0x1e'),this['syncVarSet'][_0xb00b('0x1b')](this));ami['on']('attendedtransfer',this[_0xb00b('0x1f')]['bind'](this));ami['on'](_0xb00b('0x20'),this[_0xb00b('0x21')]['bind'](this));this['loopCampaigns'](this[_0xb00b('0x22')]);}function emit(_0x4a334b,_0x1344c4,_0x43da66){io['to'](_0x4a334b)[_0xb00b('0x23')](_0x1344c4,_0x43da66);}function emitCampaignPreview(_0x3501af){if(_0x3501af['type']===_0xb00b('0x24')){var _0x4df284={'id':_0x3501af['id'],'name':_0x3501af[_0xb00b('0x25')],'strategy':_0x3501af[_0xb00b('0x26')],'answered':_0x3501af['answered'],'available':_0x3501af[_0xb00b('0x27')],'loggedIn':_0x3501af[_0xb00b('0x28')],'pTalking':_0x3501af['pTalking'],'sumBillable':_0x3501af[_0xb00b('0x29')],'sumDuration':_0x3501af[_0xb00b('0x2a')],'sumHoldTime':_0x3501af['sumHoldTime']||0x0,'talking':_0x3501af[_0xb00b('0x2b')],'total':_0x3501af[_0xb00b('0x2c')],'type':_0x3501af[_0xb00b('0x2d')],'unmanaged':_0x3501af[_0xb00b('0x2e')],'abandoned':_0x3501af['abandoned'],'waiting':_0x3501af['waiting'],'loggedInDb':_0x3501af[_0xb00b('0x2f')],'dialActive':_0x3501af['dialActive'],'dialMethod':_0x3501af['dialMethod'],'dialOriginateCallerIdName':_0x3501af['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3501af[_0xb00b('0x30')],'dialOriginateTimeout':_0x3501af[_0xb00b('0x31')],'dialPrefix':_0x3501af[_0xb00b('0x32')],'outboundAnswerAgiCallsDay':_0x3501af[_0xb00b('0x33')],'outboundAnswerCallsDay':_0x3501af[_0xb00b('0x34')],'outboundBlacklistCallsDay':_0x3501af[_0xb00b('0x35')],'outboundBusyCallsDay':_0x3501af[_0xb00b('0x36')],'outboundCongestionCallsDay':_0x3501af['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3501af[_0xb00b('0x37')],'outboundDropCallsDayCallersExit':_0x3501af['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3501af[_0xb00b('0x38')],'outboundNoAnswerCallsDay':_0x3501af[_0xb00b('0x39')],'outboundNoSuchCallsDay':_0x3501af[_0xb00b('0x3a')],'outboundOriginateFailureCallsDay':_0x3501af['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3501af[_0xb00b('0x3b')],'outboundRejectCallsDay':_0x3501af[_0xb00b('0x3c')],'outboundUnknownCallsDay':_0x3501af[_0xb00b('0x3d')],'outboundAbandonedCallsDay':_0x3501af[_0xb00b('0x3e')],'predictiveIntervalAnsweredCalls':_0x3501af[_0xb00b('0x3f')],'predictiveIntervalAvgHoldtime':_0x3501af[_0xb00b('0x40')],'predictiveIntervalAvgTalktime':_0x3501af[_0xb00b('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x3501af[_0xb00b('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x3501af[_0xb00b('0x43')],'predictiveIntervalErlangCalls':_0x3501af['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3501af[_0xb00b('0x44')],'predictiveIntervalHitRate':_0x3501af[_0xb00b('0x45')],'predictiveIntervalMultiplicativeFactor':_0x3501af['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3501af[_0xb00b('0x46')],'predictiveIntervalAvailable':_0x3501af[_0xb00b('0x47')],'predictiveIntervalTotalCalls':_0x3501af['predictiveIntervalTotalCalls'],'message':_0x3501af[_0xb00b('0x48')],'originated':_0x3501af['originated'],'erlangCalls':_0x3501af[_0xb00b('0x49')],'erlangCallToSecond':_0x3501af[_0xb00b('0x4a')],'erlangAbandonmentRate':_0x3501af[_0xb00b('0x4b')],'erlangBusyFactor':_0x3501af[_0xb00b('0x4c')],'startPredictive':_0x3501af[_0xb00b('0x4d')],'startProgressive':_0x3501af[_0xb00b('0x4e')]};if(_0x3501af[_0xb00b('0x4f')]){_0x4df284['Trunk']={'id':_0x3501af['Trunk']['id'],'name':_0x3501af['Trunk'][_0xb00b('0x25')],'active':_0x3501af[_0xb00b('0x4f')][_0xb00b('0x50')],'callerid':_0x3501af[_0xb00b('0x4f')]['callerid']};}if(_0x3501af[_0xb00b('0x51')]){_0x4df284[_0xb00b('0x51')]={'id':_0x3501af[_0xb00b('0x51')]['id'],'name':_0x3501af[_0xb00b('0x51')][_0xb00b('0x25')]};}var _0x39da49=md5(JSON[_0xb00b('0x52')](_0x4df284));if(_0x3501af[_0xb00b('0x53')]!==_0x39da49){_0x3501af['md5']=_0x39da49;emit(util['format'](_0xb00b('0x54'),_0x4df284['name']),_0xb00b('0x55'),_0x4df284);}}}function emitVoiceQueueChannelRemove(_0x1c5400){logger[_0xb00b('0x56')](_0xb00b('0x57'),JSON[_0xb00b('0x52')](_0x1c5400));emit(util[_0xb00b('0x58')](_0xb00b('0x54'),_0x1c5400['name']),_0xb00b('0x59'),_0x1c5400);io[_0xb00b('0x23')](_0xb00b('0x5a'),_0x1c5400);}function notSendMessagesQueue(_0xd9c03f){if(_0xd9c03f[_0xb00b('0x5b')]){if(_0xd9c03f[_0xb00b('0x5c')]===0x0&&_0xd9c03f['pTalking']===0x0){_0xd9c03f[_0xb00b('0x5b')]=![];_0xd9c03f[_0xb00b('0x27')]=0x0;_0xd9c03f['paused']=0x0;_0xd9c03f[_0xb00b('0x48')]=_0xb00b('0x5d');ut[_0xb00b('0x5e')](_0xb00b('0x5f'),_0xd9c03f[_0xb00b('0x25')]+'\x20is\x20not\x20active');}else{_0xd9c03f[_0xb00b('0x48')]=_0xb00b('0x60');ut[_0xb00b('0x5e')](_0xb00b('0x5f'),_0xd9c03f['name']+'\x20is\x20disactive');}emitCampaignPreview(_0xd9c03f);}}Preview[_0xb00b('0xd')][_0xb00b('0x61')]=function(){var _0x10a348=this;setInterval(function(){_0x10a348[_0xb00b('0x62')]();},0x7cf);};Preview[_0xb00b('0xd')][_0xb00b('0x62')]=function(){var _0x275664=this['campaignsPreview'];this[_0xb00b('0x63')]+=0x1;for(var _0x3b72c4 in _0x275664){if(_0x275664[_0xb00b('0x64')](_0x3b72c4)&&(_0x275664[_0x3b72c4][_0xb00b('0x65')]===_0xb00b('0x6')||_0x275664[_0x3b72c4][_0xb00b('0x65')]===_0xb00b('0x66'))&&_0x275664[_0x3b72c4][_0xb00b('0x2d')]===_0xb00b('0x24')){if(this[_0xb00b('0x63')]>0x7){this[_0xb00b('0x63')]=0x0;this[_0xb00b('0x67')]();}}if(_0x275664['hasOwnProperty'](_0x3b72c4)&&_0x275664[_0x3b72c4][_0xb00b('0x65')]===_0xb00b('0x6')&&_0x275664[_0x3b72c4][_0xb00b('0x2d')]===_0xb00b('0x24')){if(_0x275664[_0x3b72c4][_0xb00b('0x68')]){this[_0xb00b('0x69')](_0x275664[_0x3b72c4]);if(_0x275664[_0x3b72c4][_0xb00b('0x6a')])this[_0xb00b('0x6b')](_0x275664[_0x3b72c4]);}else{notSendMessagesQueue(_0x275664[_0x3b72c4]);}}}};Preview[_0xb00b('0xd')][_0xb00b('0x6c')]=function(_0x1eec12){var _0x3b3031=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x3b3031[_0xb00b('0x13')][_0x1eec12])){loggerAction[_0xb00b('0x56')]('[clearZombieChannels][talking]',_0x1eec12,_0xb00b('0x6d'),_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x6e')],_0xb00b('0x6f'),JSON['stringify'](_0x3b3031['campaignsPreview'][_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x6e')]]['originated']),'pTalking:\x20',JSON[_0xb00b('0x52')](_0x3b3031[_0xb00b('0x22')][_0x3b3031['actions'][_0x1eec12][_0xb00b('0x6e')]]['pTalking']),JSON['stringify'](_0x3b3031['actions'][_0x1eec12][_0xb00b('0x70')]),JSON['stringify'](_[_0xb00b('0x71')](_0x3b3031[_0xb00b('0x13')][_0x1eec12],[_0xb00b('0x72'),_0xb00b('0x73'),_0xb00b('0x74'),_0xb00b('0x75')])));return ami['Action']({'action':'status','channel':_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x76')]})['catch'](function(_0x114750){if(_0x114750[_0xb00b('0x48')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3b3031[_0xb00b('0x13')][_0x1eec12]){ut[_0xb00b('0x77')](_0x3b3031[_0xb00b('0x22')][_0x3b3031['actions'][_0x1eec12]['queue']],_0xb00b('0x78'));if(_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x70')]===!![]){ut[_0xb00b('0x79')](_0x3b3031['campaignsPreview'][_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x6e')]],'[clearZombieChannel]');ut['loggerError'](_0xb00b('0x7a')+_0x1eec12,_0x3b3031['actions'][_0x1eec12][_0xb00b('0x6e')]);}ut[_0xb00b('0x7b')](_0xb00b('0x7c')+_0x1eec12,_0x3b3031[_0xb00b('0x13')][_0x1eec12][_0xb00b('0x6e')]);delete _0x3b3031[_0xb00b('0x13')][_0x1eec12];}},0x2328);}});}});};Preview['prototype'][_0xb00b('0x67')]=function(){var _0x51c9e3=this;loggerAction[_0xb00b('0x56')](_0xb00b('0x7d'),_[_0xb00b('0x7e')](this['actions']));for(var _0x248335 in this[_0xb00b('0x13')]){if(_0x51c9e3[_0xb00b('0x13')]['hasOwnProperty'](_0x248335)){_0x51c9e3[_0xb00b('0x6c')](_0x248335);}}};Preview[_0xb00b('0xd')][_0xb00b('0x6b')]=function(_0x385029){var _0x131848=this;rpcDb[_0xb00b('0x7f')](_0x385029['id'],ut[_0xb00b('0x80')](this[_0xb00b('0x14')]))['then'](function(_0x153551){if(!_[_0xb00b('0x81')](_0x153551)){for(var _0x1b4860=0x0;_0x1b4860<_0x153551['length'];_0x1b4860+=0x1){if(ut[_0xb00b('0x82')](_0x153551[_0x1b4860][_0xb00b('0x83')])<_0x385029[_0xb00b('0x84')]*0x3c){if(_0x153551[_0x1b4860][_0xb00b('0x85')]&&!_0x153551[_0x1b4860][_0xb00b('0x85')]['voicePause']){_0x131848[_0xb00b('0x86')](_0x153551[_0x1b4860]['id'])[_0xb00b('0x87')](ut[_0xb00b('0x88')](_0xb00b('0x89')))['catch'](ut[_0xb00b('0x88')](_0xb00b('0x89')));}else{rpcDb[_0xb00b('0x8a')](_0x153551[_0x1b4860]['id']);}}else{var _0x2d73bb=new Action(_0x153551[_0x1b4860],_0x385029);_0x2d73bb[_0xb00b('0x8b')]=moment()[_0xb00b('0x58')](_0xb00b('0x8c'));_0x385029['outboundReCallsDay']+=0x1;ut[_0xb00b('0x8d')](_0x2d73bb,0x17,'RecallInQueue');if(_0x385029[_0xb00b('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0xb00b('0x8f')](_0x153551[_0x1b4860]));rpcDb['createCustomerHistory'](_0x2d73bb,_0xb00b('0x90'));}else{ut['logCustomer'](_0x2d73bb,0x16,_0xb00b('0x91'));rpcDb[_0xb00b('0x92')](_0x2d73bb,_0xb00b('0x93'));rpcDb['createCustomerFinal'](_0x2d73bb,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xb00b('0x88')](_0xb00b('0x94')));};Preview[_0xb00b('0xd')]['setMessage']=function(_0x311f49){_0x311f49[_0xb00b('0x5b')]=!![];if(ut[_0xb00b('0x95')](_0x311f49[_0xb00b('0x28')])){_0x311f49[_0xb00b('0x48')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xb00b('0x96')](_0x311f49[_0xb00b('0x68')])){_0x311f49['message']=_0xb00b('0x5d');}else if(!this[_0xb00b('0x97')](_0x311f49[_0xb00b('0x4f')])){if(!this['isTrunkReachable'](_0x311f49['TrunkBackup'])){_0x311f49[_0xb00b('0x48')]=_0xb00b('0x98');}else{_0x311f49[_0xb00b('0x48')]='ACTIVE';}}else{_0x311f49['message']='ACTIVE';}emitCampaignPreview(_0x311f49);};Preview['prototype'][_0xb00b('0x99')]=function(_0x4df7fa,_0x2434a0,_0x30c0a7){var _0x53dd22=this;var _0x7523d5=this[_0xb00b('0x13')][_0x2434a0];var _0x2d21ec=this[_0xb00b('0x22')][_0x7523d5[_0xb00b('0x6e')]];var _0x48a57e;if(_0x2d21ec){switch(_0x30c0a7){case'1':_0x2d21ec[_0xb00b('0x3a')]+=0x1;_0x7523d5[_0xb00b('0x9a')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x0,_0xb00b('0x9d'));ami[_0xb00b('0x23')]('custom:agentnosuchnumber',ut[_0xb00b('0x9e')](_0x7523d5,_0xb00b('0x9f')));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xa0'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec[_0xb00b('0xa1')]){_0x48a57e=ut[_0xb00b('0xa2')](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb['createCustomerFinal'](_0x48a57e,_0xb00b('0xa4'));}else{if(_0x7523d5[_0xb00b('0x9a')]>=_0x2d21ec[_0xb00b('0xa5')]){rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xa4'));}else{rpcDb[_0xb00b('0xa7')](ut[_0xb00b('0xa8')](_0x7523d5,_0xb00b('0x9a'),_0x2d21ec['dialNoSuchNumberRetryFrequency']),_0x7523d5[_0xb00b('0xa9')],_0x7523d5[_0xb00b('0xaa')]);}}delete this[_0xb00b('0x13')][_0x4df7fa[_0xb00b('0xab')]];break;case _0xb00b('0xac'):var _0x376adc=moment()[_0xb00b('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x7523d5[_0xb00b('0xad')]=_0x376adc;_0x7523d5[_0xb00b('0xae')]=_0x376adc;_0x7523d5[_0xb00b('0x70')]=!![];_0x2d21ec[_0xb00b('0xaf')]+=0x1;logger[_0xb00b('0x56')](_0xb00b('0xb0'),_0x7523d5['uniqueid'],_0xb00b('0xb1'),_0x2d21ec['name'],_0xb00b('0xb2'),_0x2d21ec['pTalking']);ami[_0xb00b('0x23')](_0xb00b('0xb3'),ut[_0xb00b('0x9e')](_0x7523d5,'connect',this['campaignsPreview'][_0x7523d5[_0xb00b('0x6e')]]));if(_0x2d21ec[_0xb00b('0xb4')]){ami[_0xb00b('0x23')](_0xb00b('0xb5'),ut[_0xb00b('0xb6')](_0x7523d5));}break;case'16':ami[_0xb00b('0x23')](_0xb00b('0xb7'),ut[_0xb00b('0x9e')](_0x7523d5,_0xb00b('0xb8'),this[_0xb00b('0x22')][_0x7523d5[_0xb00b('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0xb00b('0x9e')](_0x7523d5,_0xb00b('0xb8')));_0x2d21ec[_0xb00b('0x34')]+=0x1;_0x2d21ec['total']+=0x1;_0x2d21ec['answered']+=0x1;ut[_0xb00b('0x79')](_0x2d21ec,_0xb00b('0xb9'));_0x7523d5['countglobal']=ut['totalGlobal'](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x4,_0xb00b('0xba'));rpcDb[_0xb00b('0x92')](_0x7523d5,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xbb'));rpcDb[_0xb00b('0xbc')](_0x7523d5);_0x2d21ec[_0xb00b('0x2a')]+=_0x7523d5[_0xb00b('0xbd')];_0x2d21ec[_0xb00b('0x29')]+=_0x7523d5[_0xb00b('0xbd')];logger['info'](_0xb00b('0xbe'),_0x7523d5['uniqueid'],_0xb00b('0xb1'),_0x2d21ec[_0xb00b('0x25')],'pTalking:\x20',_0x2d21ec[_0xb00b('0xaf')]);delete this[_0xb00b('0x13')][_0x4df7fa[_0xb00b('0xab')]];break;case _0xb00b('0xbf'):_0x2d21ec[_0xb00b('0x36')]+=0x1;_0x7523d5[_0xb00b('0xc0')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x5,_0xb00b('0xc1'));ami[_0xb00b('0x23')](_0xb00b('0xc2'),ut['buildObj'](_0x7523d5,_0xb00b('0xc3')));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xc4'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec['dialGlobalMaxRetry']){_0x48a57e=ut[_0xb00b('0xa2')](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,_0xb00b('0xc5'));}else{if(_0x7523d5[_0xb00b('0xc0')]>=_0x2d21ec['dialBusyMaxRetry']){rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xc4'));}else{rpcDb[_0xb00b('0xa7')](ut[_0xb00b('0xa8')](_0x7523d5,'countbusyretry',_0x2d21ec[_0xb00b('0xc6')]),_0x7523d5['unlockAgent'],_0x7523d5[_0xb00b('0xaa')]);}}break;case _0xb00b('0xc7'):_0x2d21ec[_0xb00b('0x39')]+=0x1;_0x7523d5[_0xb00b('0xc8')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x3,_0xb00b('0xc9'));ami[_0xb00b('0x23')](_0xb00b('0xca'),ut[_0xb00b('0x9e')](_0x7523d5,'noanswer'));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xcb'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec[_0xb00b('0xa1')]){_0x48a57e=ut['cloneAction'](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x7523d5[_0xb00b('0xc8')]>=_0x2d21ec['dialNoAnswerMaxRetry']){rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xcb'));}else{rpcDb[_0xb00b('0xa7')](ut['scheduledAt'](_0x7523d5,_0xb00b('0xc8'),_0x2d21ec[_0xb00b('0xcc')]),_0x7523d5[_0xb00b('0xa9')],_0x7523d5[_0xb00b('0xaa')]);}}break;case _0xb00b('0xcd'):_0x2d21ec[_0xb00b('0xce')]+=0x1;_0x7523d5[_0xb00b('0xcf')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut['logCustomer'](_0x7523d5,0x8,'Congestion');ami[_0xb00b('0x23')](_0xb00b('0xd0'),ut[_0xb00b('0x9e')](_0x7523d5,_0xb00b('0xd1')));rpcDb['createCustomerHistory'](_0x7523d5,_0xb00b('0xd2'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec['dialGlobalMaxRetry']){_0x48a57e=ut[_0xb00b('0xa2')](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x7523d5[_0xb00b('0xcf')]>=_0x2d21ec[_0xb00b('0xd3')]){rpcDb['createCustomerFinal'](_0x7523d5,_0xb00b('0xd2'));}else{rpcDb[_0xb00b('0xa7')](ut[_0xb00b('0xa8')](_0x7523d5,_0xb00b('0xcf'),_0x2d21ec[_0xb00b('0xc6')]),_0x7523d5[_0xb00b('0xa9')],_0x7523d5[_0xb00b('0xaa')]);}}break;case _0xb00b('0xd4'):_0x2d21ec['outboundRejectCallsDay']+=0x1;_0x7523d5[_0xb00b('0xd5')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x14,'AgentReject');ami[_0xb00b('0x23')]('custom:agentreject',ut[_0xb00b('0x9e')](_0x7523d5,'agentreject'));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xd6'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec[_0xb00b('0xa1')]){_0x48a57e=ut[_0xb00b('0xa2')](_0x7523d5,0x14,'AgentReject');rpcDb[_0xb00b('0xa6')](_0x48a57e,_0xb00b('0xd7'));}else{if(_0x7523d5['countagentrejectretry']>=_0x2d21ec[_0xb00b('0xd8')]){rpcDb['createCustomerFinal'](_0x7523d5,_0xb00b('0xd7'));}else{rpcDb[_0xb00b('0xa7')](ut[_0xb00b('0xa8')](_0x7523d5,_0xb00b('0xd5'),_0x2d21ec['dialAgentRejectRetryFrequency']),_0x7523d5[_0xb00b('0xa9')],_0x7523d5[_0xb00b('0xaa')]);}}break;case _0xb00b('0xd9'):_0x2d21ec[_0xb00b('0x3e')]+=0x1;_0x7523d5[_0xb00b('0xda')]+=0x1;_0x7523d5['countglobal']=ut['totalGlobal'](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0xb,_0xb00b('0xdb'));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xdc'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec['dialGlobalMaxRetry']){_0x48a57e=ut['cloneAction'](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,_0xb00b('0xdc'));}else{if(_0x7523d5[_0xb00b('0xdd')]>=_0x2d21ec[_0xb00b('0xde')]){rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xdc'));}else{rpcDb['rescheduleContact'](ut[_0xb00b('0xa8')](_0x7523d5,'countabandonedretry',_0x2d21ec[_0xb00b('0xdf')]),_0x7523d5['unlockAgent'],_0x7523d5[_0xb00b('0xaa')]);}}break;case'18':_0x2d21ec[_0xb00b('0x3d')]+=0x1;_0x7523d5[_0xb00b('0xe0')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x12,_0x4df7fa[_0xb00b('0xe1')]||_0x4df7fa[_0xb00b('0xe2')]);ami[_0xb00b('0x23')](_0xb00b('0xe3'),ut[_0xb00b('0x9e')](_0x7523d5,'amd'));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xe4'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec[_0xb00b('0xa1')]){_0x48a57e=ut['cloneAction'](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xb00b('0xa6')](_0x7523d5,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xb00b('0x13')][_0x4df7fa[_0xb00b('0xab')]];break;case'19':_0x2d21ec['outboundUnknownCallsDay']+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut[_0xb00b('0x9c')](_0x7523d5);ut[_0xb00b('0x8d')](_0x7523d5,0x13,_0x4df7fa[_0xb00b('0xe1')]||_0x4df7fa[_0xb00b('0xe2')]);ami[_0xb00b('0x23')]('custom:amd',ut[_0xb00b('0x9e')](_0x7523d5,'amd'));rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xe5'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec[_0xb00b('0xa1')]){_0x48a57e=ut['cloneAction'](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,_0xb00b('0xe5'));}else{rpcDb['createCustomerFinal'](_0x7523d5,_0xb00b('0xe5'));}delete this[_0xb00b('0x13')][_0x4df7fa[_0xb00b('0xab')]];break;default:if(_0x7523d5[_0xb00b('0x70')]){ut['decrementTalkink'](_0x2d21ec,_0xb00b('0xe6'));ut[_0xb00b('0x7b')](_0xb00b('0xe7')+_0x2d21ec[_0xb00b('0x25')],_0x4df7fa);}_0x2d21ec[_0xb00b('0x3d')]+=0x1;_0x7523d5[_0xb00b('0x9b')]=ut['totalGlobal'](_0x7523d5);ut['logCustomer'](_0x7523d5,0xc,_0x4df7fa[_0xb00b('0xe1')]||_0x4df7fa[_0xb00b('0xe2')]);rpcDb[_0xb00b('0x92')](_0x7523d5,_0xb00b('0xe8'));if(ut[_0xb00b('0x9c')](_0x7523d5)>=_0x2d21ec['dialGlobalMaxRetry']){_0x48a57e=ut[_0xb00b('0xa2')](_0x7523d5,0xf,_0xb00b('0xa3'));rpcDb[_0xb00b('0xa6')](_0x48a57e,_0xb00b('0xe9'));}else{rpcDb[_0xb00b('0xa6')](_0x7523d5,_0xb00b('0xe9'));}delete this['actions'][_0x4df7fa[_0xb00b('0xab')]];}if(!(_0x7523d5[_0xb00b('0x70')]&&_0x30c0a7==='16')){ut[_0xb00b('0x77')](_0x2d21ec,_0xb00b('0xea'));logger[_0xb00b('0x56')](_0xb00b('0xeb'),_0x7523d5[_0xb00b('0xec')],_0xb00b('0xb1'),_0x2d21ec[_0xb00b('0x25')],_0xb00b('0x6f'),_0x2d21ec['originated']);}if(_0x30c0a7!=='ANSWER'){delete this[_0xb00b('0x13')][_0x4df7fa[_0xb00b('0xab')]];delete this[_0xb00b('0x13')][_0x4df7fa['destlinkedid']];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0xf6c3bc,_0x1e50ca,_0xce62a){if(_['isUndefined'](_0x1e50ca)&&_0xb00b('0xed')!==typeof _0x1e50ca){return;}if(_[_0xb00b('0xee')](_0xce62a)&&_0xb00b('0xed')!==typeof _0xce62a){return;}switch(_0xce62a[_0xb00b('0xef')]){case'0':ut['logAgent'](_0xf6c3bc,0x0,_0xb00b('0x9d'));rpcDb[_0xb00b('0xf0')](_0xf6c3bc,_0xb00b('0xf1'));break;case'3':ut[_0xb00b('0xf2')](_0xf6c3bc,0x3,_0xb00b('0xc9'));rpcDb[_0xb00b('0xf0')](_0xf6c3bc,_0xb00b('0xf3'));break;case'5':ut[_0xb00b('0xf2')](_0xf6c3bc,0x5,'Busy');rpcDb[_0xb00b('0xf0')](_0xf6c3bc,_0xb00b('0xf4'));break;case'8':ut[_0xb00b('0xf2')](_0xf6c3bc,0x8,_0xb00b('0xf5'));rpcDb[_0xb00b('0xf0')](_0xf6c3bc,_0xb00b('0xf6'));break;case'22':ut[_0xb00b('0xf2')](_0xf6c3bc,0x16,_0xb00b('0xf7'));rpcDb['createAgentHistory'](_0xf6c3bc,_0xb00b('0xf8'));break;default:ut[_0xb00b('0xf2')](_0xf6c3bc,0xc,_0xce62a[_0xb00b('0xef')]);rpcDb[_0xb00b('0xf0')](_0xf6c3bc,'[callProgressDetectingAgent][logCongestion]');}ut[_0xb00b('0x77')](_0x1e50ca,_0xb00b('0xf9'));logger[_0xb00b('0x56')](_0xb00b('0xfa'),_0xf6c3bc[_0xb00b('0xec')],_0xb00b('0xb1'),_0x1e50ca[_0xb00b('0x25')],_0xb00b('0x6f'),_0x1e50ca['originated']);delete this['actions'][_0xf6c3bc[_0xb00b('0xec')]];};Preview[_0xb00b('0xd')][_0xb00b('0xfb')]=function(_0x58894a,_0x3aa890,_0xdf20d6,_0xfae545,_0x581548){var _0x44d3c0=this;return new BPromise(function(_0x3d5880,_0x3d9e1e){if(_['isNil'](_0x3aa890)||_['isNil'](_0x3aa890[_0xb00b('0xfc')])||_['isNil'](_0x3aa890[_0xb00b('0xfc')]['phone'])||_['isNil'](_0x3aa890[_0xb00b('0x74')])){_0x3d9e1e(ut[_0xb00b('0x48')](_0xb00b('0xfd'),_0xfae545,_0x581548));return;}var _0xcbfe37=uuid['v4']();var _0x41ee74=_0x44d3c0['campaignsPreview'][_0x3aa890[_0xb00b('0x6d')]['name']];var _0x592206=_0xdf20d6?_0x44d3c0[_0xb00b('0x14')][_0xdf20d6]['id']:undefined;_0x44d3c0[_0xb00b('0x13')][_0xcbfe37]=new Action(_0x3aa890,_0x41ee74,_0xcbfe37,_0xdf20d6,_0x592206);var _0xf3a747=_0x44d3c0[_0xb00b('0x13')][_0xcbfe37];_0xf3a747[_0xb00b('0xa9')]=_0xfae545;_0xf3a747[_0xb00b('0xaa')]=_0x581548;_0xf3a747['lookAgent']=_0xdf20d6;if(_[_0xb00b('0xfe')](_0x58894a)){_0x44d3c0['execCall'](_0xf3a747,_0x41ee74,_0x3aa890,_0xdf20d6)[_0xb00b('0x87')](function(_0x8abc0b){logger[_0xb00b('0x56')]('[Preview][execCall][success]',_0xb00b('0xff')+_0xf3a747[_0xb00b('0x6e')]+_0xb00b('0x100')+_0xf3a747[_0xb00b('0x101')],JSON['stringify'](_0x8abc0b));ami['emit'](_0xb00b('0x102'),ut['buildObj'](_0xf3a747,'called',_0x44d3c0[_0xb00b('0x22')][_0xf3a747['queue']]));_0x3d5880(ut['message'](_0xb00b('0x103')));})[_0xb00b('0x104')](function(_0x745803){ut[_0xb00b('0x5e')]('[Preview][execCall][failure]',_0x745803);_0x3d9e1e(ut['message'](_0xb00b('0x105'),_0xfae545,_0x581548));});}else{_0x41ee74[_0xb00b('0x35')]+=0x1;ut[_0xb00b('0x106')](_0xf3a747);rpcDb['createHistory'](_0xf3a747,'[Blacklist][error]');delete _0x44d3c0[_0xb00b('0x13')][_0xcbfe37];_0x3d9e1e(ut['message']('Contact\x20in\x20black\x20List',_0xfae545,_0x581548));}});};Preview[_0xb00b('0xd')]['isTrunkReachable']=function(_0x291010){return!_['isNil'](_0x291010)&&!_[_0xb00b('0x81')](_0x291010['name'])&&!_[_0xb00b('0x81')](_0x291010[_0xb00b('0x50')])&&_0x291010[_0xb00b('0x50')]&&!_['isNil'](this[_0xb00b('0x12')][util['format'](_0xb00b('0x107'),_0x291010[_0xb00b('0x25')])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x291010[_0xb00b('0x25')])]['status'])&&(this[_0xb00b('0x12')][util['format'](_0xb00b('0x107'),_0x291010[_0xb00b('0x25')])][_0xb00b('0x108')]===_0xb00b('0x109')||this[_0xb00b('0x12')][util['format'](_0xb00b('0x107'),_0x291010[_0xb00b('0x25')])][_0xb00b('0x108')]===_0xb00b('0x10a'));};Preview['prototype']['run']=function(_0xe1f667,_0xfee3f5){var _0x181393=this;return new BPromise(function(_0x226d78,_0xa100a4){_0x181393[_0xb00b('0x10b')](_0xe1f667,_0xfee3f5)[_0xb00b('0x87')](function(_0x8dc8f7){_0x226d78(_[_0xb00b('0x71')](_0x8dc8f7,['message']));})[_0xb00b('0x104')](function(_0x2fd7f1){if(_0x2fd7f1['unlock']){rpcDb[_0xb00b('0x10c')](_0xe1f667);}if(_0x2fd7f1['active']){rpcDb[_0xb00b('0x8a')](_0xe1f667);}_0xa100a4(_[_0xb00b('0x71')](_0x2fd7f1,['message']));});});};Preview['prototype'][_0xb00b('0x10b')]=function(_0x3b9285,_0x240f04){var _0x4a5a72=this;return new BPromise(function(_0x3b3a53,_0x69b160){var _0x9acbff,_0x47a0b8;rpcDb[_0xb00b('0x10d')](_0x3b9285)['then'](function(_0x5bf454){if(!_['isNil'](_0x5bf454[0x0])){_0x47a0b8=_0x5bf454[0x0][_0xb00b('0x10e')]?![]:!![];_0x9acbff=_0x5bf454[0x0]['recallme']?!![]:![];_0x9acbff=_0x240f04?!![]:_0x9acbff;}var _0x1b8d45=_0x4a5a72[_0xb00b('0x10f')](_0x5bf454);if(_0x1b8d45['isValid']){rpcDb['checkIsBlackList'](_[_0xb00b('0x71')](_0x5bf454[0x0],[_0xb00b('0x74'),'Contact.phone']))[_0xb00b('0x87')](function(_0x3bcd75){_0x4a5a72[_0xb00b('0xfb')](_0x3bcd75,_0x5bf454[0x0],_0x240f04,_0x47a0b8,_0x9acbff)[_0xb00b('0x87')](function(_0x1ceb60){_0x3b3a53(_0x1ceb60);})[_0xb00b('0x104')](function(_0x49cfd5){_0x69b160(_0x49cfd5);});})[_0xb00b('0x104')](function(_0x22b425){ut['logger'](_0xb00b('0x110'),_0x22b425);_0x69b160(ut['message']('Call\x20unsuccessful',_0x47a0b8,_0x9acbff));});}else{_0x69b160(ut[_0xb00b('0x48')](_0x1b8d45['message'],_0x47a0b8,_0x9acbff));}})[_0xb00b('0x104')](function(_0xd75be6){ut[_0xb00b('0x5e')]('[Preview][getContactPreview]',_0xd75be6);_0x69b160(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xb00b('0xd')][_0xb00b('0x10f')]=function(_0x4cb653){if(_[_0xb00b('0x81')](_0x4cb653)||_[_0xb00b('0xfe')](_0x4cb653)||!_[_0xb00b('0x81')](_0x4cb653[0x0][_0xb00b('0x85')])&&_[_0xb00b('0x81')](_0x4cb653[0x0][_0xb00b('0x85')][_0xb00b('0x25')])){ut[_0xb00b('0x5e')]('[Preview][validateContact][Empty\x20Contact]',_0x4cb653);return{'isValid':![],'message':_0xb00b('0x111')};}var _0x3da033=this[_0xb00b('0x22')][_0x4cb653[0x0]['Queue']['name']];_0x3da033['message']=_0xb00b('0x112');if(_[_0xb00b('0x81')](_0x3da033)){ut[_0xb00b('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x3da033);return{'isValid':![],'message':_0xb00b('0x113')};}if(!this[_0xb00b('0x97')](_0x3da033[_0xb00b('0x4f')])){ut[_0xb00b('0x5e')](_0xb00b('0x114'),'campaign\x20Name:\x20'+_0x3da033[_0xb00b('0x25')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xb00b('0x97')](_0x3da033[_0xb00b('0x115')])){ut[_0xb00b('0x5e')](_0xb00b('0x114'),_0x3da033[_0xb00b('0x25')]+_0xb00b('0x116'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xb00b('0x96')](_0x3da033[_0xb00b('0x68')])){ut[_0xb00b('0x5e')](_0xb00b('0x117'),_0x3da033[_0xb00b('0x25')]+_0xb00b('0x118'));return{'isValid':![],'message':_0xb00b('0x119')+_0x3da033[_0xb00b('0x25')]+_0xb00b('0x118')};}return{'isValid':!![],'message':_0xb00b('0x11a')};};Preview['prototype'][_0xb00b('0x11b')]=function(_0x33952b,_0x4cd459,_0x3c4684,_0x5175c6){var _0x4c1a3a=this;return new BPromise(function(_0x5c95c2,_0x384a16){var _0x4d6930=_0x33952b[_0xb00b('0xec')];var _0x2cfe9f=_0x4c1a3a[_0xb00b('0x97')](_0x4cd459[_0xb00b('0x4f')])?util[_0xb00b('0x58')](_0xb00b('0x11c'),_0x4cd459[_0xb00b('0x4f')][_0xb00b('0x25')],_[_0xb00b('0x81')](_0x4cd459[_0xb00b('0x32')])?'':_0x4cd459[_0xb00b('0x32')][_0xb00b('0x11d')]()||'',_0x4cd459[_0xb00b('0x11e')]>0x0?_0x3c4684[_0xb00b('0xfc')]['phone'][_0xb00b('0x11f')](_0x4cd459[_0xb00b('0x11e')]):_0x3c4684[_0xb00b('0xfc')][_0xb00b('0x120')]):util[_0xb00b('0x58')]('SIP/%s/%s%s',_[_0xb00b('0x81')](_0x4cd459[_0xb00b('0x115')])?_0x4cd459['Trunk']['name']:_0x4cd459[_0xb00b('0x115')][_0xb00b('0x25')],_[_0xb00b('0x81')](_0x4cd459[_0xb00b('0x32')])?'':_0x4cd459[_0xb00b('0x32')][_0xb00b('0x11d')]()||'',_0x4cd459[_0xb00b('0x11e')]>0x0?_0x3c4684[_0xb00b('0xfc')][_0xb00b('0x120')][_0xb00b('0x11f')](_0x4cd459[_0xb00b('0x11e')]):_0x3c4684['Contact'][_0xb00b('0x120')]);var _0x4d067a=_0x4c1a3a[_0xb00b('0x97')](_0x4cd459[_0xb00b('0x4f')])?ut[_0xb00b('0x121')](_0x4cd459[_0xb00b('0x4f')][_0xb00b('0x122')],_0x4cd459[_0xb00b('0x123')],_0x4cd459['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb00b('0x124')](_0x4cd459[_0xb00b('0x30')],_0x4cd459[_0xb00b('0x125')]):_0x4cd459[_0xb00b('0x30')]):ut['getCallerId'](_[_0xb00b('0x81')](_0x4cd459[_0xb00b('0x115')])?_0x4cd459['Trunk'][_0xb00b('0x122')]:_0x4cd459[_0xb00b('0x115')][_0xb00b('0x122')],_0x4cd459[_0xb00b('0x123')],_0x4cd459[_0xb00b('0x125')]>0x0?ut[_0xb00b('0x124')](_0x4cd459[_0xb00b('0x30')],_0x4cd459[_0xb00b('0x125')]):_0x4cd459[_0xb00b('0x30')]);if(_0x4d067a){_0x33952b['originatecalleridname']=ut[_0xb00b('0x126')](_0x4d067a);_0x33952b[_0xb00b('0x127')]=ut['extractCalleridNumber'](_0x4d067a);}var _0x51995c=ut[_0xb00b('0x128')](_0x4cd459,_0x3c4684,_0x2cfe9f,_0x4d067a,_0x4d6930,_0x33952b);_[_0xb00b('0x129')](_0x33952b,ut[_0xb00b('0x12a')](_0x51995c));_0x33952b[_0xb00b('0x8b')]=moment()[_0xb00b('0x58')](_0xb00b('0x8c'));ami[_0xb00b('0x12b')](ut[_0xb00b('0x12c')](_0x33952b,_0x4cd459,_0x51995c,_0x33952b[_0xb00b('0xaa')],_0x5175c6))[_0xb00b('0x87')](function(_0x5943a2){_0x4cd459[_0xb00b('0x5c')]+=0x1;logger[_0xb00b('0x56')](_0xb00b('0x12d'),_0x4d6930,'\x20Queue',_0x4cd459[_0xb00b('0x25')],_0xb00b('0x6f'),_0x4cd459[_0xb00b('0x5c')]);_0x5c95c2(_0x5943a2);})[_0xb00b('0x104')](function(_0x49ccb6){ut[_0xb00b('0xf2')](_0x33952b,0xe,_0xb00b('0x12e'));rpcDb['createAgentHistory'](_0x33952b,'[originateFailure][logOriginateFailure]');_0x384a16(_0x49ccb6);});});};Preview[_0xb00b('0xd')][_0xb00b('0x1d')]=function(_0x482f60){if(this[_0xb00b('0x13')][_0x482f60['linkedid']]){this['actions'][_0x482f60[_0xb00b('0xab')]]['channel']=_0x482f60['channel'];}};Preview[_0xb00b('0xd')][_0xb00b('0x16')]=function(_0x37d3d1){var _0xb34a7c=this;var _0x11e9b4=this[_0xb00b('0x13')][_0x37d3d1[_0xb00b('0x12f')]];if(_0x11e9b4){if(_0x11e9b4[_0xb00b('0x130')]&&this[_0xb00b('0x14')][_0x11e9b4[_0xb00b('0x130')]]){ut[_0xb00b('0x131')](_0x11e9b4,this[_0xb00b('0x14')][_0x11e9b4[_0xb00b('0x130')]][_0xb00b('0x25')],this['agents'][_0x11e9b4[_0xb00b('0x130')]]['id']);}var _0x388bf8=_['clone'](_0x11e9b4);_0x388bf8[_0xb00b('0xad')]=moment()['format'](_0xb00b('0x8c'));var _0x40546f=_0xb34a7c[_0xb00b('0x22')][_0x11e9b4['queue']];if(ut[_0xb00b('0x132')](_0x37d3d1[_0xb00b('0x133')])){if(_0x11e9b4['unlockAgent']){rpcDb[_0xb00b('0x10c')](_0x11e9b4[_0xb00b('0x101')]);}if(_0x11e9b4[_0xb00b('0xaa')]){rpcDb[_0xb00b('0x8a')](_0x11e9b4['idContact']);}ami[_0xb00b('0x23')](_0xb00b('0x134'),ut[_0xb00b('0x9e')](_0x11e9b4,'rejected',this['campaignsPreview'][_0x11e9b4['queue']]));this[_0xb00b('0x135')](_0x388bf8,_0x40546f,_0x37d3d1);}else{_0x11e9b4[_0xb00b('0x8b')]=moment()[_0xb00b('0x58')](_0xb00b('0x8c'));ut[_0xb00b('0xf2')](_0x388bf8,0x4,_0xb00b('0xba'));rpcDb[_0xb00b('0xf0')](_0x388bf8,_0xb00b('0x136'));}}};Preview[_0xb00b('0xd')]['syncHangup']=function(_0x59e4eb){var _0x5cee95=this;var _0x198da1=this['actions'][_0x59e4eb[_0xb00b('0xab')]];var _0x525fb3;if(_0x198da1){_0x525fb3=this[_0xb00b('0x22')][_0x198da1['queue']];logger[_0xb00b('0x56')](_0xb00b('0x137'),_0x59e4eb['linkedid'],_0xb00b('0xb1'),_0x525fb3[_0xb00b('0x25')],'pTalking:\x20',_0x525fb3[_0xb00b('0xaf')]);}if(this['actions'][_0x59e4eb[_0xb00b('0xab')]]&&_0x59e4eb[_0xb00b('0xab')]!==_0x59e4eb[_0xb00b('0xec')]){if(_0x59e4eb[_0xb00b('0x138')]==='16'&&this[_0xb00b('0x13')][_0x59e4eb[_0xb00b('0xab')]][_0xb00b('0x70')]){this[_0xb00b('0x99')](_0x59e4eb,_0x59e4eb[_0xb00b('0xab')],_0x59e4eb[_0xb00b('0x138')]);}else if(this['actions'][_0x59e4eb['linkedid']][_0xb00b('0x70')]){logger['info'](_0xb00b('0x139'),_0x59e4eb['linkedid'],_0x59e4eb[_0xb00b('0x138')],_0xb00b('0xb1'),_0x525fb3['name'],_0xb00b('0xb2'),_0x525fb3['pTalking']);this[_0xb00b('0x99')](_0x59e4eb,_0x59e4eb[_0xb00b('0xab')],_0x59e4eb['cause']);}}else if(_0x198da1&&_[_0xb00b('0x81')](_0x198da1[_0xb00b('0x13a')])&&_0x525fb3[_0xb00b('0x13b')]&&_0x59e4eb[_0xb00b('0xab')]===_0x59e4eb[_0xb00b('0xec')]&&_['isNil'](_0x59e4eb[_0xb00b('0xef')])&&_0x59e4eb[_0xb00b('0x138')]==='16'&&_0x59e4eb['channelstate']==='6'&&_['isUndefined'](_0x198da1[_0xb00b('0x13c')])){if(_0x198da1['unlockAgent']){rpcDb['unlockContact'](_0x198da1['idContact']);}if(_0x198da1[_0xb00b('0xaa')]){rpcDb[_0xb00b('0x8a')](_0x198da1[_0xb00b('0x101')]);}_0x59e4eb[_0xb00b('0xef')]='22';this['callProgressDetectingAgent'](_0x198da1,_0x525fb3,_0x59e4eb);}else if(_0x198da1&&_0x198da1[_0xb00b('0x13c')]){if(_0x59e4eb['cause']==='16'&&this[_0xb00b('0x13')][_0x59e4eb[_0xb00b('0xab')]][_0xb00b('0x70')]){logger[_0xb00b('0x56')]('[syncHangup][talking][transfer]',_0x59e4eb[_0xb00b('0xab')],_0x59e4eb[_0xb00b('0x138')],'\x20Queue',_0x525fb3[_0xb00b('0x25')],_0xb00b('0xb2'),_0x525fb3[_0xb00b('0xaf')]);this['callProgressDetectingCustomer'](_0x59e4eb,_0x59e4eb['linkedid'],_0x59e4eb[_0xb00b('0x138')]);}else if(this[_0xb00b('0x13')][_0x59e4eb[_0xb00b('0xab')]][_0xb00b('0x70')]){logger[_0xb00b('0x56')](_0xb00b('0x139'),_0x59e4eb[_0xb00b('0xab')],_0x59e4eb['cause'],'\x20Queue',_0x525fb3[_0xb00b('0x25')],'pTalking:\x20',_0x525fb3['pTalking']);this[_0xb00b('0x99')](_0x59e4eb,_0x59e4eb[_0xb00b('0xab')],_0x59e4eb['cause']);}}};Preview[_0xb00b('0xd')][_0xb00b('0x1a')]=function(_0x13783c){if(this['actions'][_0x13783c[_0xb00b('0x13d')]]&&_0x13783c[_0xb00b('0x13d')]!==_0x13783c[_0xb00b('0x13e')]){this[_0xb00b('0x99')](_0x13783c,_0x13783c[_0xb00b('0x13d')],_0x13783c[_0xb00b('0xe2')]);}};Preview[_0xb00b('0xd')]['syncHangupRequest']=function(_0x22e757){if(this[_0xb00b('0x13')][_0x22e757['linkedid']]&&_0x22e757['linkedid']!==_0x22e757['uniqueid']&&!this[_0xb00b('0x13')][_0x22e757[_0xb00b('0xab')]][_0xb00b('0x70')]){if(_0x22e757[_0xb00b('0x138')]==='1'){this[_0xb00b('0x99')](_0x22e757,_0x22e757[_0xb00b('0xab')],_0x22e757[_0xb00b('0x138')]);}}};Preview['prototype']['addVariable']=function(_0x1290d9,_0x19d624,_0x50d9a3){if(this[_0xb00b('0x13')][_0x1290d9]){if(_[_0xb00b('0x81')](this['actions'][_0x1290d9][_0xb00b('0x13f')])){this['actions'][_0x1290d9][_0xb00b('0x13f')]={};}this['actions'][_0x1290d9]['variables'][_0x19d624]=_0x50d9a3;}};Preview['prototype'][_0xb00b('0x140')]=function(_0x230223){try{if(!_[_0xb00b('0x81')](_0x230223)){if(ut[_0xb00b('0x141')](_['keys'](_0x230223[_0xb00b('0x142')])[0x0])){this[_0xb00b('0x143')](_0x230223[_0xb00b('0xec')],_[_0xb00b('0x144')](_0x230223[_0xb00b('0x142')])[0x0],_0x230223[_0xb00b('0x145')]);}}}catch(_0x1cc9fb){logger[_0xb00b('0x146')](_0xb00b('0x147'),util[_0xb00b('0x148')](_0x1cc9fb,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x3fe113){if(_0x3fe113){if(this[_0xb00b('0x13')][_0x3fe113[_0xb00b('0x149')]]){this[_0xb00b('0x13')][_0x3fe113[_0xb00b('0x149')]][_0xb00b('0x13c')]=!![];}}};Preview[_0xb00b('0xd')][_0xb00b('0x21')]=function(_0x2bba6e){if(_0x2bba6e){if(this['actions'][_0x2bba6e[_0xb00b('0x14a')]]){this[_0xb00b('0x13')][_0x2bba6e[_0xb00b('0x14a')]][_0xb00b('0x13c')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xe14b=['sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','Calling','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','unlock','execRun','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','phone','substring','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','error','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','strategy','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','message','erlangCalls','erlangCallToSecond','startProgressive','Trunk','name','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','preview','clearZombieChannels','outbound','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','decrementTalkink','loggerError','[action]','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','getDiff','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue'];(function(_0x1aee84,_0x1f1031){var _0x3fec17=function(_0x11baa4){while(--_0x11baa4){_0x1aee84['push'](_0x1aee84['shift']());}};_0x3fec17(++_0x1f1031);}(_0xe14b,0x93));var _0xbe14=function(_0x5caa93,_0x18b23d){_0x5caa93=_0x5caa93-0x0;var _0x2d56a6=_0xe14b[_0x5caa93];return _0x2d56a6;};'use strict';var util=require(_0xbe14('0x0'));var _=require(_0xbe14('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xbe14('0x2'));var md5=require(_0xbe14('0x3'));var Redis=require('ioredis');var config=require(_0xbe14('0x4'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xbe14('0x5'))(_0xbe14('0x6'));var ami=require(_0xbe14('0x7'));var rpcDb=require(_0xbe14('0x8'));var Action=require(_0xbe14('0x9'));var ut=require(_0xbe14('0xa'));config[_0xbe14('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbe14('0xc'))(new Redis(config[_0xbe14('0xb')]));var Sequence=function(){};Sequence[_0xbe14('0xd')][_0xbe14('0xe')]=function(_0x53c7ea){this['tail']=this[_0xbe14('0xf')]?this[_0xbe14('0xf')]['finally'](_0x53c7ea):_0x53c7ea();};function Preview(_0x254c3b){this[_0xbe14('0x10')]=new Sequence();this[_0xbe14('0x11')]=_0x254c3b[_0xbe14('0x12')];this[_0xbe14('0x13')]=_0x254c3b[_0xbe14('0x13')];this[_0xbe14('0x14')]={};this[_0xbe14('0x15')]=_0x254c3b[_0xbe14('0x15')];this[_0xbe14('0x16')]=0x0;ami['on'](_0xbe14('0x17'),this[_0xbe14('0x18')][_0xbe14('0x19')](this));ami['on']('hangup',this['syncHangup'][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1a'),this[_0xbe14('0x1b')][_0xbe14('0x19')](this));ami['on']('dialend',this[_0xbe14('0x1c')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1d'),this[_0xbe14('0x1e')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1f'),this[_0xbe14('0x20')]['bind'](this));ami['on'](_0xbe14('0x21'),this[_0xbe14('0x22')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x23'),this[_0xbe14('0x24')][_0xbe14('0x19')](this));this['loopCampaigns'](this[_0xbe14('0x11')]);}function emit(_0x4a1bbd,_0x417c8d,_0xc12977){io['to'](_0x4a1bbd)[_0xbe14('0x25')](_0x417c8d,_0xc12977);}function emitCampaignPreview(_0x51dc0b){if(_0x51dc0b[_0xbe14('0x26')]==='outbound'){var _0x3c1c85={'id':_0x51dc0b['id'],'name':_0x51dc0b['name'],'strategy':_0x51dc0b[_0xbe14('0x27')],'answered':_0x51dc0b['answered'],'available':_0x51dc0b[_0xbe14('0x28')],'loggedIn':_0x51dc0b[_0xbe14('0x29')],'pTalking':_0x51dc0b['pTalking'],'sumBillable':_0x51dc0b[_0xbe14('0x2a')],'sumDuration':_0x51dc0b['sumDuration'],'sumHoldTime':_0x51dc0b[_0xbe14('0x2b')]||0x0,'talking':_0x51dc0b['talking'],'total':_0x51dc0b[_0xbe14('0x2c')],'type':_0x51dc0b[_0xbe14('0x26')],'unmanaged':_0x51dc0b[_0xbe14('0x2d')],'abandoned':_0x51dc0b[_0xbe14('0x2e')],'waiting':_0x51dc0b[_0xbe14('0x2f')],'loggedInDb':_0x51dc0b[_0xbe14('0x30')],'dialActive':_0x51dc0b['dialActive'],'dialMethod':_0x51dc0b[_0xbe14('0x31')],'dialOriginateCallerIdName':_0x51dc0b[_0xbe14('0x32')],'dialOriginateCallerIdNumber':_0x51dc0b[_0xbe14('0x33')],'dialOriginateTimeout':_0x51dc0b[_0xbe14('0x34')],'dialPrefix':_0x51dc0b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x51dc0b[_0xbe14('0x35')],'outboundAnswerCallsDay':_0x51dc0b[_0xbe14('0x36')],'outboundBlacklistCallsDay':_0x51dc0b['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x51dc0b[_0xbe14('0x37')],'outboundCongestionCallsDay':_0x51dc0b[_0xbe14('0x38')],'outboundDropCallsDayACS':_0x51dc0b[_0xbe14('0x39')],'outboundDropCallsDayCallersExit':_0x51dc0b[_0xbe14('0x3a')],'outboundDropCallsDayTimeout':_0x51dc0b[_0xbe14('0x3b')],'outboundNoAnswerCallsDay':_0x51dc0b[_0xbe14('0x3c')],'outboundNoSuchCallsDay':_0x51dc0b[_0xbe14('0x3d')],'outboundOriginateFailureCallsDay':_0x51dc0b[_0xbe14('0x3e')],'outboundReCallsDay':_0x51dc0b[_0xbe14('0x3f')],'outboundRejectCallsDay':_0x51dc0b[_0xbe14('0x40')],'outboundUnknownCallsDay':_0x51dc0b[_0xbe14('0x41')],'outboundAbandonedCallsDay':_0x51dc0b[_0xbe14('0x42')],'predictiveIntervalAnsweredCalls':_0x51dc0b[_0xbe14('0x43')],'predictiveIntervalAvgHoldtime':_0x51dc0b[_0xbe14('0x44')],'predictiveIntervalAvgTalktime':_0x51dc0b[_0xbe14('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x51dc0b[_0xbe14('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x51dc0b[_0xbe14('0x47')],'predictiveIntervalErlangCalls':_0x51dc0b[_0xbe14('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x51dc0b[_0xbe14('0x49')],'predictiveIntervalHitRate':_0x51dc0b[_0xbe14('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x51dc0b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x51dc0b[_0xbe14('0x4b')],'predictiveIntervalAvailable':_0x51dc0b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x51dc0b['predictiveIntervalTotalCalls'],'message':_0x51dc0b[_0xbe14('0x4c')],'originated':_0x51dc0b['originated'],'erlangCalls':_0x51dc0b[_0xbe14('0x4d')],'erlangCallToSecond':_0x51dc0b[_0xbe14('0x4e')],'erlangAbandonmentRate':_0x51dc0b['erlangAbandonmentRate'],'erlangBusyFactor':_0x51dc0b['erlangBusyFactor'],'startPredictive':_0x51dc0b['startPredictive'],'startProgressive':_0x51dc0b[_0xbe14('0x4f')]};if(_0x51dc0b[_0xbe14('0x50')]){_0x3c1c85['Trunk']={'id':_0x51dc0b[_0xbe14('0x50')]['id'],'name':_0x51dc0b[_0xbe14('0x50')][_0xbe14('0x51')],'active':_0x51dc0b[_0xbe14('0x50')][_0xbe14('0x52')],'callerid':_0x51dc0b['Trunk']['callerid']};}if(_0x51dc0b[_0xbe14('0x53')]){_0x3c1c85['Interval']={'id':_0x51dc0b['Interval']['id'],'name':_0x51dc0b['Interval'][_0xbe14('0x51')]};}var _0x393f6b=md5(JSON[_0xbe14('0x54')](_0x3c1c85));if(_0x51dc0b[_0xbe14('0x3')]!==_0x393f6b){_0x51dc0b[_0xbe14('0x3')]=_0x393f6b;emit(util[_0xbe14('0x55')](_0xbe14('0x56'),_0x3c1c85[_0xbe14('0x51')]),_0xbe14('0x57'),_0x3c1c85);}}}function emitVoiceQueueChannelRemove(_0x2dfd5a){logger[_0xbe14('0x58')](_0xbe14('0x59'),JSON['stringify'](_0x2dfd5a));emit(util['format'](_0xbe14('0x56'),_0x2dfd5a[_0xbe14('0x51')]),_0xbe14('0x5a'),_0x2dfd5a);io['emit'](_0xbe14('0x5b'),_0x2dfd5a);}function notSendMessagesQueue(_0x2aa453){if(_0x2aa453[_0xbe14('0x5c')]){if(_0x2aa453[_0xbe14('0x5d')]===0x0&&_0x2aa453[_0xbe14('0x5e')]===0x0){_0x2aa453[_0xbe14('0x5c')]=![];_0x2aa453[_0xbe14('0x28')]=0x0;_0x2aa453[_0xbe14('0x5f')]=0x0;_0x2aa453[_0xbe14('0x4c')]='NOT_ACTIVE';ut[_0xbe14('0x60')](_0xbe14('0x61'),_0x2aa453[_0xbe14('0x51')]+_0xbe14('0x62'));}else{_0x2aa453[_0xbe14('0x4c')]=_0xbe14('0x63');ut['logger'](_0xbe14('0x61'),_0x2aa453[_0xbe14('0x51')]+_0xbe14('0x64'));}emitCampaignPreview(_0x2aa453);}}Preview[_0xbe14('0xd')]['loopCampaigns']=function(){var _0x4bfa96=this;setInterval(function(){_0x4bfa96[_0xbe14('0x65')]();},0x7cf);};Preview[_0xbe14('0xd')][_0xbe14('0x65')]=function(){var _0x51c859=this['campaignsPreview'];this[_0xbe14('0x16')]+=0x1;for(var _0x59ae4d in _0x51c859){if(_0x51c859['hasOwnProperty'](_0x59ae4d)&&(_0x51c859[_0x59ae4d][_0xbe14('0x31')]===_0xbe14('0x66')||_0x51c859[_0x59ae4d][_0xbe14('0x31')]==='booked')&&_0x51c859[_0x59ae4d]['type']==='outbound'){if(this[_0xbe14('0x16')]>0x7){this[_0xbe14('0x16')]=0x0;this[_0xbe14('0x67')]();}}if(_0x51c859['hasOwnProperty'](_0x59ae4d)&&_0x51c859[_0x59ae4d][_0xbe14('0x31')]===_0xbe14('0x66')&&_0x51c859[_0x59ae4d][_0xbe14('0x26')]===_0xbe14('0x68')){if(_0x51c859[_0x59ae4d]['dialActive']){this['setMessage'](_0x51c859[_0x59ae4d]);if(_0x51c859[_0x59ae4d][_0xbe14('0x69')])this[_0xbe14('0x6a')](_0x51c859[_0x59ae4d]);}else{notSendMessagesQueue(_0x51c859[_0x59ae4d]);}}}};Preview[_0xbe14('0xd')][_0xbe14('0x6b')]=function(_0x2550dc){var _0x4f2d95=this;this['sequence'][_0xbe14('0xe')](function(){if(!_[_0xbe14('0x6c')](_0x4f2d95[_0xbe14('0x14')][_0x2550dc])){loggerAction[_0xbe14('0x58')]('[clearZombieChannels][talking]',_0x2550dc,_0xbe14('0x6d'),_0x4f2d95[_0xbe14('0x14')][_0x2550dc]['queue'],_0xbe14('0x6e'),JSON[_0xbe14('0x54')](_0x4f2d95[_0xbe14('0x11')][_0x4f2d95[_0xbe14('0x14')][_0x2550dc]['queue']]['originated']),_0xbe14('0x6f'),JSON[_0xbe14('0x54')](_0x4f2d95['campaignsPreview'][_0x4f2d95['actions'][_0x2550dc][_0xbe14('0x70')]][_0xbe14('0x5e')]),JSON[_0xbe14('0x54')](_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x71')]),JSON[_0xbe14('0x54')](_[_0xbe14('0x72')](_0x4f2d95['actions'][_0x2550dc],[_0xbe14('0x73'),_0xbe14('0x74'),_0xbe14('0x75'),_0xbe14('0x76')])));return ami[_0xbe14('0x77')]({'action':'status','channel':_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x78')]})[_0xbe14('0x79')](function(_0x20f46d){if(_0x20f46d[_0xbe14('0x4c')]===_0xbe14('0x7a')){setTimeout(function(){if(_0x4f2d95['actions'][_0x2550dc]){ut['updateOriginated'](_0x4f2d95[_0xbe14('0x11')][_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]],'[clearZombieChannel]');if(_0x4f2d95['actions'][_0x2550dc][_0xbe14('0x71')]===!![]){ut[_0xbe14('0x7b')](_0x4f2d95['campaignsPreview'][_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]],'[clearZombieChannel]');ut[_0xbe14('0x7c')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2550dc,_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]);}ut[_0xbe14('0x7c')]('[Dialer][checkChannel][Preview]'+_0x2550dc,_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]);delete _0x4f2d95['actions'][_0x2550dc];}},0x2328);}});}});};Preview[_0xbe14('0xd')][_0xbe14('0x67')]=function(){var _0x2210cc=this;loggerAction[_0xbe14('0x58')](_0xbe14('0x7d'),_['size'](this[_0xbe14('0x14')]));for(var _0x34cd66 in this[_0xbe14('0x14')]){if(_0x2210cc[_0xbe14('0x14')][_0xbe14('0x7e')](_0x34cd66)){_0x2210cc[_0xbe14('0x6b')](_0x34cd66);}}};Preview[_0xbe14('0xd')]['recallMe']=function(_0x72c875){var _0x1b47a4=this;rpcDb[_0xbe14('0x7f')](_0x72c875['id'],ut[_0xbe14('0x80')](this[_0xbe14('0x15')]))[_0xbe14('0x81')](function(_0xd8f78f){if(!_[_0xbe14('0x6c')](_0xd8f78f)){for(var _0x285b6e=0x0;_0x285b6e<_0xd8f78f[_0xbe14('0x82')];_0x285b6e+=0x1){if(ut[_0xbe14('0x83')](_0xd8f78f[_0x285b6e]['scheduledat'])<_0x72c875['dialRecallMeTimeout']*0x3c){if(_0xd8f78f[_0x285b6e]['Agent']&&!_0xd8f78f[_0x285b6e][_0xbe14('0x84')][_0xbe14('0x85')]){_0x1b47a4[_0xbe14('0x86')](_0xd8f78f[_0x285b6e]['id'])[_0xbe14('0x81')](ut[_0xbe14('0x87')](_0xbe14('0x88')))[_0xbe14('0x79')](ut[_0xbe14('0x87')](_0xbe14('0x88')));}else{rpcDb[_0xbe14('0x89')](_0xd8f78f[_0x285b6e]['id']);}}else{var _0x603816=new Action(_0xd8f78f[_0x285b6e],_0x72c875);_0x603816[_0xbe14('0x8a')]=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));_0x72c875[_0xbe14('0x3f')]+=0x1;ut[_0xbe14('0x8c')](_0x603816,0x17,_0xbe14('0x8d'));if(_0x72c875[_0xbe14('0x8e')]){rpcDb[_0xbe14('0x8f')](ut[_0xbe14('0x90')](_0xd8f78f[_0x285b6e]));rpcDb['createCustomerHistory'](_0x603816,_0xbe14('0x91'));}else{ut[_0xbe14('0x8c')](_0x603816,0x16,_0xbe14('0x92'));rpcDb[_0xbe14('0x93')](_0x603816,_0xbe14('0x94'));rpcDb[_0xbe14('0x95')](_0x603816,_0xbe14('0x94'));}}}}})[_0xbe14('0x79')](ut[_0xbe14('0x87')](_0xbe14('0x96')));};Preview['prototype'][_0xbe14('0x97')]=function(_0x442ec4){_0x442ec4[_0xbe14('0x5c')]=!![];if(ut[_0xbe14('0x98')](_0x442ec4[_0xbe14('0x29')])){_0x442ec4['message']=_0xbe14('0x99');}else if(!ut[_0xbe14('0x9a')](_0x442ec4[_0xbe14('0x9b')])){_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0x9c');}else if(!this['isTrunkReachable'](_0x442ec4[_0xbe14('0x50')])){if(!this[_0xbe14('0x9d')](_0x442ec4[_0xbe14('0x9e')])){_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0x9f');}else{_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0xa0');}}else{_0x442ec4[_0xbe14('0x4c')]='ACTIVE';}emitCampaignPreview(_0x442ec4);};Preview[_0xbe14('0xd')][_0xbe14('0xa1')]=function(_0x2fdf5d,_0x20b12e,_0x5982b7){var _0xa4b2a3=this;var _0x445302=this['actions'][_0x20b12e];var _0x4eedd2=this[_0xbe14('0x11')][_0x445302[_0xbe14('0x70')]];var _0x2d2643;if(_0x4eedd2){switch(_0x5982b7){case'1':_0x4eedd2[_0xbe14('0x3d')]+=0x1;_0x445302[_0xbe14('0xa2')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x0,'NoSuchNumber');ami['emit'](_0xbe14('0xa5'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xa7')));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xa8'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xac'));}else{if(_0x445302['countnosuchnumberretry']>=_0x4eedd2[_0xbe14('0xad')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xac'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xa2'),_0x4eedd2[_0xbe14('0xb0')]),_0x445302['unlockAgent'],_0x445302[_0xbe14('0xb1')]);}}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;case _0xbe14('0xb3'):var _0x28da4a=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));_0x445302[_0xbe14('0xb4')]=_0x28da4a;_0x445302['answertime']=_0x28da4a;_0x445302[_0xbe14('0x71')]=!![];_0x4eedd2[_0xbe14('0x5e')]+=0x1;logger[_0xbe14('0x58')](_0xbe14('0xb5'),_0x445302[_0xbe14('0xb6')],_0xbe14('0xb7'),_0x4eedd2['name'],_0xbe14('0x6f'),_0x4eedd2[_0xbe14('0x5e')]);ami[_0xbe14('0x25')](_0xbe14('0xb8'),ut['buildObj'](_0x445302,_0xbe14('0xb9'),this[_0xbe14('0x11')][_0x445302[_0xbe14('0x70')]]));if(_0x4eedd2[_0xbe14('0xba')]){ami[_0xbe14('0x25')](_0xbe14('0xbb'),ut[_0xbe14('0xbc')](_0x445302));}break;case'16':ami['emit'](_0xbe14('0xbd'),ut['buildObj'](_0x445302,_0xbe14('0xbe'),this['campaignsPreview'][_0x445302[_0xbe14('0x70')]]));emitVoiceQueueChannelRemove(ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xbe')));_0x4eedd2['outboundAnswerCallsDay']+=0x1;_0x4eedd2[_0xbe14('0x2c')]+=0x1;_0x4eedd2[_0xbe14('0xbf')]+=0x1;ut[_0xbe14('0x7b')](_0x4eedd2,'[16]');_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x4,_0xbe14('0xc0'));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xc1'));rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xc2'));rpcDb[_0xbe14('0xc3')](_0x445302);_0x4eedd2[_0xbe14('0xc4')]+=_0x445302[_0xbe14('0xc5')];_0x4eedd2[_0xbe14('0x2a')]+=_0x445302['talktime'];logger[_0xbe14('0x58')](_0xbe14('0xc6'),_0x445302[_0xbe14('0xb6')],'\x20Queue',_0x4eedd2[_0xbe14('0x51')],_0xbe14('0x6f'),_0x4eedd2[_0xbe14('0x5e')]);delete this['actions'][_0x2fdf5d[_0xbe14('0xb2')]];break;case _0xbe14('0xc7'):_0x4eedd2['outboundBusyCallsDay']+=0x1;_0x445302[_0xbe14('0xc8')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x5,'Busy');ami['emit'](_0xbe14('0xc9'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xca')));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xcb'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,'Global');rpcDb['createCustomerFinal'](_0x2d2643,_0xbe14('0xcc'));}else{if(_0x445302[_0xbe14('0xc8')]>=_0x4eedd2[_0xbe14('0xcd')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xcb'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,'countbusyretry',_0x4eedd2[_0xbe14('0xce')]),_0x445302['unlockAgent'],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xcf'):_0x4eedd2[_0xbe14('0x3c')]+=0x1;_0x445302[_0xbe14('0xd0')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x3,_0xbe14('0xd1'));ami['emit'](_0xbe14('0xd2'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xd3')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xd4'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xd5'));}else{if(_0x445302[_0xbe14('0xd0')]>=_0x4eedd2[_0xbe14('0xd6')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xd4'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xd0'),_0x4eedd2[_0xbe14('0xd7')]),_0x445302[_0xbe14('0xd8')],_0x445302['activeContact']);}}break;case _0xbe14('0xd9'):_0x4eedd2['outboundCongestionCallsDay']+=0x1;_0x445302[_0xbe14('0xda')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x8,_0xbe14('0xdb'));ami['emit']('custom:agentcongestion',ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xdc')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xdd'));if(ut['totalGlobal'](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,'Global');rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xde'));}else{if(_0x445302[_0xbe14('0xda')]>=_0x4eedd2[_0xbe14('0xdf')]){rpcDb['createCustomerFinal'](_0x445302,_0xbe14('0xdd'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x445302,_0xbe14('0xda'),_0x4eedd2[_0xbe14('0xce')]),_0x445302[_0xbe14('0xd8')],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xe0'):_0x4eedd2['outboundRejectCallsDay']+=0x1;_0x445302[_0xbe14('0xe1')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut['totalGlobal'](_0x445302);ut['logCustomer'](_0x445302,0x14,_0xbe14('0xe2'));ami[_0xbe14('0x25')]('custom:agentreject',ut[_0xbe14('0xa6')](_0x445302,'agentreject'));rpcDb[_0xbe14('0x93')](_0x445302,'[syncHangupRequest][logAgentReject]');if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2['dialGlobalMaxRetry']){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0x14,'AgentReject');rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xe3'));}else{if(_0x445302['countagentrejectretry']>=_0x4eedd2['dialAgentRejectMaxRetry']){rpcDb[_0xbe14('0x95')](_0x445302,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xe1'),_0x4eedd2[_0xbe14('0xe4')]),_0x445302[_0xbe14('0xd8')],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xe5'):_0x4eedd2[_0xbe14('0x42')]+=0x1;_0x445302['countabandonedretry']+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0xb,_0xbe14('0xe6'));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xe7'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut['cloneAction'](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x445302[_0xbe14('0xe8')]>=_0x4eedd2['dialAbandonedMaxRety']){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xe7'));}else{rpcDb[_0xbe14('0xae')](ut['scheduledAt'](_0x445302,_0xbe14('0xe9'),_0x4eedd2['dialAbandonedRetryFrequency']),_0x445302[_0xbe14('0xd8')],_0x445302['activeContact']);}}break;case'18':_0x4eedd2['outboundUnknownCallsDay']+=0x1;_0x445302[_0xbe14('0xea')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut['logCustomer'](_0x445302,0x12,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);ami[_0xbe14('0x25')](_0xbe14('0xed'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xee')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xef'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xef'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;case'19':_0x4eedd2[_0xbe14('0x41')]+=0x1;_0x445302['countglobal']=ut['totalGlobal'](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x13,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);ami[_0xbe14('0x25')](_0xbe14('0xed'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xee')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xf0'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xf0'));}else{rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xf0'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;default:if(_0x445302[_0xbe14('0x71')]){ut[_0xbe14('0x7b')](_0x4eedd2,_0xbe14('0xf1'));ut[_0xbe14('0x7c')](_0xbe14('0xf2')+_0x4eedd2[_0xbe14('0x51')],_0x2fdf5d);}_0x4eedd2['outboundUnknownCallsDay']+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0xc,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);rpcDb[_0xbe14('0x93')](_0x445302,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut['cloneAction'](_0x445302,0xf,_0xbe14('0xab'));rpcDb['createCustomerFinal'](_0x2d2643,_0xbe14('0xf3'));}else{rpcDb['createCustomerFinal'](_0x445302,_0xbe14('0xf3'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];}if(!(_0x445302[_0xbe14('0x71')]&&_0x5982b7==='16')){ut[_0xbe14('0xf4')](_0x4eedd2,_0xbe14('0xf5'));logger[_0xbe14('0x58')](_0xbe14('0xf6'),_0x445302[_0xbe14('0xb6')],'\x20Queue',_0x4eedd2[_0xbe14('0x51')],_0xbe14('0x6e'),_0x4eedd2[_0xbe14('0x5d')]);}if(_0x5982b7!==_0xbe14('0xb3')){delete this['actions'][_0x2fdf5d[_0xbe14('0xb2')]];delete this['actions'][_0x2fdf5d[_0xbe14('0xf7')]];}}};Preview['prototype'][_0xbe14('0xf8')]=function(_0x3e7588,_0x24fa89,_0x5c134f){if(_[_0xbe14('0xf9')](_0x24fa89)&&'object'!==typeof _0x24fa89){return;}if(_[_0xbe14('0xf9')](_0x5c134f)&&_0xbe14('0xfa')!==typeof _0x5c134f){return;}switch(_0x5c134f[_0xbe14('0xfb')]){case'0':ut[_0xbe14('0xfc')](_0x3e7588,0x0,_0xbe14('0xfd'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0xff'));break;case'3':ut[_0xbe14('0xfc')](_0x3e7588,0x3,_0xbe14('0xd1'));rpcDb['createAgentHistory'](_0x3e7588,_0xbe14('0x100'));break;case'5':ut['logAgent'](_0x3e7588,0x5,_0xbe14('0x101'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x102'));break;case'8':ut['logAgent'](_0x3e7588,0x8,_0xbe14('0xdb'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x103'));break;case'22':ut[_0xbe14('0xfc')](_0x3e7588,0x16,_0xbe14('0x104'));rpcDb['createAgentHistory'](_0x3e7588,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbe14('0xfc')](_0x3e7588,0xc,_0x5c134f['reason']);rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x103'));}ut[_0xbe14('0xf4')](_0x24fa89,_0xbe14('0x105'));logger['info'](_0xbe14('0x106'),_0x3e7588[_0xbe14('0xb6')],'\x20Queue',_0x24fa89[_0xbe14('0x51')],_0xbe14('0x6e'),_0x24fa89[_0xbe14('0x5d')]);delete this[_0xbe14('0x14')][_0x3e7588['uniqueid']];};Preview[_0xbe14('0xd')][_0xbe14('0x107')]=function(_0x37aff6,_0x3374d8,_0x3b7920,_0x469ef3,_0x208fae){var _0x310d42=this;return new BPromise(function(_0x9c229f,_0x1e8989){if(_['isNil'](_0x3374d8)||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x108')])||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x108')]['phone'])||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x75')])){_0x1e8989(ut[_0xbe14('0x4c')]('Contact\x20is\x20undefined',_0x469ef3,_0x208fae));return;}var _0x431602=uuid['v4']();var _0x3778e0=_0x310d42[_0xbe14('0x11')][_0x3374d8[_0xbe14('0x6d')][_0xbe14('0x51')]];var _0x2306f6=_0x3b7920?_0x310d42[_0xbe14('0x15')][_0x3b7920]['id']:undefined;_0x310d42['actions'][_0x431602]=new Action(_0x3374d8,_0x3778e0,_0x431602,_0x3b7920,_0x2306f6);var _0x2c2e46=_0x310d42['actions'][_0x431602];_0x2c2e46[_0xbe14('0xd8')]=_0x469ef3;_0x2c2e46[_0xbe14('0xb1')]=_0x208fae;_0x2c2e46[_0xbe14('0x109')]=_0x3b7920;if(_[_0xbe14('0x10a')](_0x37aff6)){_0x310d42[_0xbe14('0x10b')](_0x2c2e46,_0x3778e0,_0x3374d8,_0x3b7920)['then'](function(_0x5db8e8){logger[_0xbe14('0x58')](_0xbe14('0x10c'),_0xbe14('0x10d')+_0x2c2e46[_0xbe14('0x70')]+'\x20IdHopper:\x20'+_0x2c2e46[_0xbe14('0x10e')],JSON[_0xbe14('0x54')](_0x5db8e8));ami[_0xbe14('0x25')]('custom:agentcalled',ut[_0xbe14('0xa6')](_0x2c2e46,'called',_0x310d42['campaignsPreview'][_0x2c2e46[_0xbe14('0x70')]]));_0x9c229f(ut[_0xbe14('0x4c')](_0xbe14('0x10f')));})['catch'](function(_0x3ea9c2){ut[_0xbe14('0x60')]('[Preview][execCall][failure]',_0x3ea9c2);_0x1e8989(ut[_0xbe14('0x4c')](_0xbe14('0x110'),_0x469ef3,_0x208fae));});}else{_0x3778e0[_0xbe14('0x111')]+=0x1;ut['logBlacklist'](_0x2c2e46);rpcDb[_0xbe14('0x112')](_0x2c2e46,_0xbe14('0x113'));delete _0x310d42[_0xbe14('0x14')][_0x431602];_0x1e8989(ut[_0xbe14('0x4c')](_0xbe14('0x114'),_0x469ef3,_0x208fae));}});};Preview['prototype'][_0xbe14('0x9d')]=function(_0x2dc3a6){return!_[_0xbe14('0x6c')](_0x2dc3a6)&&!_['isNil'](_0x2dc3a6[_0xbe14('0x51')])&&!_[_0xbe14('0x6c')](_0x2dc3a6[_0xbe14('0x52')])&&_0x2dc3a6[_0xbe14('0x52')]&&!_[_0xbe14('0x6c')](this[_0xbe14('0x13')][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])])&&!_[_0xbe14('0x6c')](this[_0xbe14('0x13')][util['format'](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])][_0xbe14('0x116')])&&(this['trunks'][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])]['status']===_0xbe14('0x117')||this['trunks'][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6['name'])][_0xbe14('0x116')]===_0xbe14('0x118'));};Preview['prototype'][_0xbe14('0x86')]=function(_0x1e1540,_0x133ae9){var _0x27c892=this;return new BPromise(function(_0x246a02,_0x1662df){_0x27c892['execRun'](_0x1e1540,_0x133ae9)['then'](function(_0x319d08){_0x246a02(_[_0xbe14('0x72')](_0x319d08,[_0xbe14('0x4c')]));})[_0xbe14('0x79')](function(_0x48ec55){if(_0x48ec55[_0xbe14('0x119')]){rpcDb['unlockContact'](_0x1e1540);}if(_0x48ec55[_0xbe14('0x52')]){rpcDb[_0xbe14('0x89')](_0x1e1540);}_0x1662df(_['pick'](_0x48ec55,[_0xbe14('0x4c')]));});});};Preview[_0xbe14('0xd')][_0xbe14('0x11a')]=function(_0x1f06ec,_0x1137a9){var _0x17c8cc=this;return new BPromise(function(_0x1b7d69,_0x8625bb){var _0x220d5d,_0x3117fc;rpcDb[_0xbe14('0x11b')](_0x1f06ec)[_0xbe14('0x81')](function(_0x4ed1f7){if(!_[_0xbe14('0x6c')](_0x4ed1f7[0x0])){_0x3117fc=_0x4ed1f7[0x0][_0xbe14('0x11c')]?![]:!![];_0x220d5d=_0x4ed1f7[0x0][_0xbe14('0x11c')]?!![]:![];_0x220d5d=_0x1137a9?!![]:_0x220d5d;}var _0x4087b6=_0x17c8cc['validateContact'](_0x4ed1f7);if(_0x4087b6[_0xbe14('0x11d')]){rpcDb[_0xbe14('0x11e')](_['pick'](_0x4ed1f7[0x0],[_0xbe14('0x75'),_0xbe14('0x11f')]))[_0xbe14('0x81')](function(_0x4a6fc3){_0x17c8cc[_0xbe14('0x107')](_0x4a6fc3,_0x4ed1f7[0x0],_0x1137a9,_0x3117fc,_0x220d5d)[_0xbe14('0x81')](function(_0x25a038){_0x1b7d69(_0x25a038);})[_0xbe14('0x79')](function(_0x2279d1){_0x8625bb(_0x2279d1);});})['catch'](function(_0x23208d){ut[_0xbe14('0x60')](_0xbe14('0x120'),_0x23208d);_0x8625bb(ut[_0xbe14('0x4c')](_0xbe14('0x121'),_0x3117fc,_0x220d5d));});}else{_0x8625bb(ut['message'](_0x4087b6[_0xbe14('0x4c')],_0x3117fc,_0x220d5d));}})[_0xbe14('0x79')](function(_0x8eeaef){ut[_0xbe14('0x60')](_0xbe14('0x122'),_0x8eeaef);_0x8625bb(ut[_0xbe14('0x4c')](_0xbe14('0x121'),![],!![]));});});};Preview[_0xbe14('0xd')]['validateContact']=function(_0x5c25dc){if(_[_0xbe14('0x6c')](_0x5c25dc)||_[_0xbe14('0x10a')](_0x5c25dc)||!_[_0xbe14('0x6c')](_0x5c25dc[0x0][_0xbe14('0x84')])&&_[_0xbe14('0x6c')](_0x5c25dc[0x0]['Agent'][_0xbe14('0x51')])){ut[_0xbe14('0x60')](_0xbe14('0x123'),_0x5c25dc);return{'isValid':![],'message':_0xbe14('0x124')};}var _0x1257b2=this[_0xbe14('0x11')][_0x5c25dc[0x0][_0xbe14('0x6d')][_0xbe14('0x51')]];_0x1257b2['message']=_0xbe14('0xa0');if(_[_0xbe14('0x6c')](_0x1257b2)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x1257b2);return{'isValid':![],'message':_0xbe14('0x125')};}if(!this['isTrunkReachable'](_0x1257b2[_0xbe14('0x50')])){ut[_0xbe14('0x60')](_0xbe14('0x126'),_0xbe14('0x127')+_0x1257b2[_0xbe14('0x51')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xbe14('0x9d')](_0x1257b2[_0xbe14('0x9e')])){ut[_0xbe14('0x60')](_0xbe14('0x126'),_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x128'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x1257b2[_0xbe14('0x9b')])){ut['logger'](_0xbe14('0x129'),_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x12a'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x12a')};}return{'isValid':!![],'message':_0xbe14('0x12b')};};Preview[_0xbe14('0xd')][_0xbe14('0x10b')]=function(_0x2e5106,_0x156fb3,_0x513b6f,_0x2fd64c){var _0x5d5fad=this;return new BPromise(function(_0x5e8d27,_0x4e849c){var _0x4e3261=_0x2e5106[_0xbe14('0xb6')];var _0x1c899d=_0x5d5fad['isTrunkReachable'](_0x156fb3[_0xbe14('0x50')])?util['format'](_0xbe14('0x12c'),_0x156fb3['Trunk'][_0xbe14('0x51')],_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x12d')])?'':_0x156fb3[_0xbe14('0x12d')][_0xbe14('0x12e')]()||'',_0x156fb3['dialCutDigit']>0x0?_0x513b6f[_0xbe14('0x108')][_0xbe14('0x12f')][_0xbe14('0x130')](_0x156fb3[_0xbe14('0x131')]):_0x513b6f['Contact']['phone']):util['format'](_0xbe14('0x12c'),_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x9e')])?_0x156fb3[_0xbe14('0x50')][_0xbe14('0x51')]:_0x156fb3['TrunkBackup']['name'],_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x12d')])?'':_0x156fb3[_0xbe14('0x12d')][_0xbe14('0x12e')]()||'',_0x156fb3[_0xbe14('0x131')]>0x0?_0x513b6f['Contact'][_0xbe14('0x12f')]['substring'](_0x156fb3[_0xbe14('0x131')]):_0x513b6f[_0xbe14('0x108')][_0xbe14('0x12f')]);var _0x1d1c84=_0x5d5fad['isTrunkReachable'](_0x156fb3[_0xbe14('0x50')])?ut[_0xbe14('0x132')](_0x156fb3[_0xbe14('0x50')][_0xbe14('0x133')],_0x156fb3['dialOriginateCallerIdName'],_0x156fb3[_0xbe14('0x134')]>0x0?ut[_0xbe14('0x135')](_0x156fb3[_0xbe14('0x33')],_0x156fb3['dialRandomLastDigitCallerIdNumber']):_0x156fb3['dialOriginateCallerIdNumber']):ut[_0xbe14('0x132')](_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x9e')])?_0x156fb3['Trunk'][_0xbe14('0x133')]:_0x156fb3[_0xbe14('0x9e')][_0xbe14('0x133')],_0x156fb3[_0xbe14('0x32')],_0x156fb3[_0xbe14('0x134')]>0x0?ut[_0xbe14('0x135')](_0x156fb3['dialOriginateCallerIdNumber'],_0x156fb3[_0xbe14('0x134')]):_0x156fb3[_0xbe14('0x33')]);if(_0x1d1c84){_0x2e5106[_0xbe14('0x136')]=ut[_0xbe14('0x137')](_0x1d1c84);_0x2e5106[_0xbe14('0x138')]=ut['extractCalleridNumber'](_0x1d1c84);}var _0x4d2094=ut[_0xbe14('0x139')](_0x156fb3,_0x513b6f,_0x1c899d,_0x1d1c84,_0x4e3261,_0x2e5106);_['merge'](_0x2e5106,ut[_0xbe14('0x13a')](_0x4d2094));_0x2e5106['starttime']=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));ami[_0xbe14('0x77')](ut['variablesAction'](_0x2e5106,_0x156fb3,_0x4d2094,_0x2e5106[_0xbe14('0xb1')],_0x2fd64c))[_0xbe14('0x81')](function(_0x2602ec){_0x156fb3[_0xbe14('0x5d')]+=0x1;logger[_0xbe14('0x58')](_0xbe14('0x13b'),_0x4e3261,_0xbe14('0xb7'),_0x156fb3[_0xbe14('0x51')],_0xbe14('0x6e'),_0x156fb3[_0xbe14('0x5d')]);_0x5e8d27(_0x2602ec);})['catch'](function(_0x1f1fb9){ut[_0xbe14('0xfc')](_0x2e5106,0xe,_0xbe14('0x13c'));rpcDb[_0xbe14('0xfe')](_0x2e5106,_0xbe14('0x13d'));_0x4e849c(_0x1f1fb9);});});};Preview[_0xbe14('0xd')][_0xbe14('0x1e')]=function(_0x36010e){if(this['actions'][_0x36010e[_0xbe14('0xb2')]]){this[_0xbe14('0x14')][_0x36010e[_0xbe14('0xb2')]][_0xbe14('0x78')]=_0x36010e[_0xbe14('0x78')];}};Preview[_0xbe14('0xd')]['syncOriginateResponse']=function(_0x479c1a){var _0x4f09fb=this;var _0x598ccc=this[_0xbe14('0x14')][_0x479c1a[_0xbe14('0x13e')]];if(_0x598ccc){if(_0x598ccc['lookAgent']&&this[_0xbe14('0x15')][_0x598ccc['lookAgent']]){ut[_0xbe14('0x13f')](_0x598ccc,this[_0xbe14('0x15')][_0x598ccc[_0xbe14('0x109')]][_0xbe14('0x51')],this[_0xbe14('0x15')][_0x598ccc[_0xbe14('0x109')]]['id']);}var _0x4f727c=_[_0xbe14('0x140')](_0x598ccc);_0x4f727c[_0xbe14('0xb4')]=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));var _0xc7acb6=_0x4f09fb[_0xbe14('0x11')][_0x598ccc[_0xbe14('0x70')]];if(ut[_0xbe14('0x141')](_0x479c1a[_0xbe14('0x142')])){if(_0x598ccc['unlockAgent']){rpcDb[_0xbe14('0x143')](_0x598ccc['idContact']);}if(_0x598ccc[_0xbe14('0xb1')]){rpcDb['disableContact'](_0x598ccc['idContact']);}ami[_0xbe14('0x25')](_0xbe14('0x144'),ut[_0xbe14('0xa6')](_0x598ccc,'rejected',this[_0xbe14('0x11')][_0x598ccc['queue']]));this[_0xbe14('0xf8')](_0x4f727c,_0xc7acb6,_0x479c1a);}else{_0x598ccc['starttime']=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));ut[_0xbe14('0xfc')](_0x4f727c,0x4,_0xbe14('0xc0'));rpcDb[_0xbe14('0xfe')](_0x4f727c,_0xbe14('0x145'));}}};Preview['prototype'][_0xbe14('0x146')]=function(_0x1100c1){var _0x4d46a3=this;var _0x52cdfd=this['actions'][_0x1100c1[_0xbe14('0xb2')]];var _0x40ef0a;if(_0x52cdfd){_0x40ef0a=this[_0xbe14('0x11')][_0x52cdfd[_0xbe14('0x70')]];logger[_0xbe14('0x58')](_0xbe14('0x147'),_0x1100c1[_0xbe14('0xb2')],'\x20Queue',_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a[_0xbe14('0x5e')]);}if(this['actions'][_0x1100c1[_0xbe14('0xb2')]]&&_0x1100c1[_0xbe14('0xb2')]!==_0x1100c1[_0xbe14('0xb6')]){if(_0x1100c1['cause']==='16'&&this['actions'][_0x1100c1[_0xbe14('0xb2')]]['dialAnswer']){this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}else if(this[_0xbe14('0x14')][_0x1100c1[_0xbe14('0xb2')]][_0xbe14('0x71')]){logger['info'](_0xbe14('0x149'),_0x1100c1['linkedid'],_0x1100c1[_0xbe14('0x148')],_0xbe14('0xb7'),_0x40ef0a[_0xbe14('0x51')],'pTalking:\x20',_0x40ef0a[_0xbe14('0x5e')]);this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1['linkedid'],_0x1100c1['cause']);}}else if(_0x52cdfd&&_[_0xbe14('0x6c')](_0x52cdfd[_0xbe14('0x14a')])&&_0x40ef0a[_0xbe14('0x14b')]&&_0x1100c1['linkedid']===_0x1100c1[_0xbe14('0xb6')]&&_[_0xbe14('0x6c')](_0x1100c1['reason'])&&_0x1100c1['cause']==='16'&&_0x1100c1['channelstate']==='6'&&_['isUndefined'](_0x52cdfd[_0xbe14('0x14c')])){if(_0x52cdfd[_0xbe14('0xd8')]){rpcDb['unlockContact'](_0x52cdfd['idContact']);}if(_0x52cdfd[_0xbe14('0xb1')]){rpcDb[_0xbe14('0x89')](_0x52cdfd[_0xbe14('0x10e')]);}_0x1100c1['reason']='22';this[_0xbe14('0xf8')](_0x52cdfd,_0x40ef0a,_0x1100c1);}else if(_0x52cdfd&&_0x52cdfd[_0xbe14('0x14c')]){if(_0x1100c1[_0xbe14('0x148')]==='16'&&this[_0xbe14('0x14')][_0x1100c1['linkedid']][_0xbe14('0x71')]){logger[_0xbe14('0x58')]('[syncHangup][talking][transfer]',_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')],_0xbe14('0xb7'),_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a['pTalking']);this['callProgressDetectingCustomer'](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}else if(this[_0xbe14('0x14')][_0x1100c1[_0xbe14('0xb2')]]['dialAnswer']){logger[_0xbe14('0x58')](_0xbe14('0x149'),_0x1100c1['linkedid'],_0x1100c1[_0xbe14('0x148')],'\x20Queue',_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a['pTalking']);this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}}};Preview[_0xbe14('0xd')][_0xbe14('0x1c')]=function(_0xac2d63){if(this[_0xbe14('0x14')][_0xac2d63[_0xbe14('0xf7')]]&&_0xac2d63['destlinkedid']!==_0xac2d63[_0xbe14('0x14d')]){this[_0xbe14('0xa1')](_0xac2d63,_0xac2d63[_0xbe14('0xf7')],_0xac2d63['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x2a5e45){if(this[_0xbe14('0x14')][_0x2a5e45[_0xbe14('0xb2')]]&&_0x2a5e45['linkedid']!==_0x2a5e45['uniqueid']&&!this[_0xbe14('0x14')][_0x2a5e45[_0xbe14('0xb2')]][_0xbe14('0x71')]){if(_0x2a5e45[_0xbe14('0x148')]==='1'){this[_0xbe14('0xa1')](_0x2a5e45,_0x2a5e45[_0xbe14('0xb2')],_0x2a5e45[_0xbe14('0x148')]);}}};Preview[_0xbe14('0xd')][_0xbe14('0x14e')]=function(_0x4b76dd,_0x43509d,_0x3a2890){if(this[_0xbe14('0x14')][_0x4b76dd]){if(_[_0xbe14('0x6c')](this[_0xbe14('0x14')][_0x4b76dd]['variables'])){this[_0xbe14('0x14')][_0x4b76dd]['variables']={};}this['actions'][_0x4b76dd][_0xbe14('0x14f')][_0x43509d]=_0x3a2890;}};Preview[_0xbe14('0xd')]['syncVarSet']=function(_0x494083){try{if(!_[_0xbe14('0x6c')](_0x494083)){if(ut[_0xbe14('0x150')](_[_0xbe14('0x151')](_0x494083[_0xbe14('0x152')])[0x0])){this[_0xbe14('0x14e')](_0x494083['uniqueid'],_['keys'](_0x494083[_0xbe14('0x152')])[0x0],_0x494083['value']);}}}catch(_0x76e84){logger[_0xbe14('0x153')]('[syncVarSet][Preview]',util['inspect'](_0x76e84,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xbe14('0x22')]=function(_0x4ee0ad){if(_0x4ee0ad){if(this[_0xbe14('0x14')][_0x4ee0ad[_0xbe14('0x154')]]){this['actions'][_0x4ee0ad[_0xbe14('0x154')]][_0xbe14('0x14c')]=!![];}}};Preview[_0xbe14('0xd')][_0xbe14('0x24')]=function(_0x2ed138){if(_0x2ed138){if(this['actions'][_0x2ed138[_0xbe14('0x155')]]){this[_0xbe14('0x14')][_0x2ed138[_0xbe14('0x155')]][_0xbe14('0x14c')]=!![];}}};module[_0xbe14('0x156')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 48d7e0f..63cdf10 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 _0x118d=['getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20'];(function(_0x223abd,_0x557ae0){var _0x84414d=function(_0x1a1e06){while(--_0x1a1e06){_0x223abd['push'](_0x223abd['shift']());}};_0x84414d(++_0x557ae0);}(_0x118d,0x1e9));var _0xd118=function(_0x201244,_0x164b93){_0x201244=_0x201244-0x0;var _0x3a5598=_0x118d[_0x201244];return _0x3a5598;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xd118('0x0'))(_0xd118('0x1'));var _=require('lodash');var cmHopper=require(_0xd118('0x2'));var cmHopperFinal=require(_0xd118('0x3'));var cmHopperHistory=require(_0xd118('0x4'));var cmHopperBlack=require(_0xd118('0x5'));var voiceQueueRt=require(_0xd118('0x6'));var agentReportPreview=require(_0xd118('0x7'));var voiceQueueReport=require(_0xd118('0x8'));function loggerCatch(_0x328fbe){return function(_0x4a4c6b){logger[_0xd118('0x9')](_0x328fbe,util[_0xd118('0xa')](_0x4a4c6b,{'showHidden':![],'depth':null}));};}function create(_0x2764b8){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopperHistory[_0xd118('0xd')](_0x2764b8))[_0xd118('0xe')](loggerCatch(_0xd118('0xf')));}function createAgent(_0xcaeac7){return BPromise[_0xd118('0xb')]()['then'](agentReportPreview['createHistory'](_0xcaeac7))[_0xd118('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2160e2){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper[_0xd118('0x10')](_0x2160e2,!![]))[_0xd118('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xd118('0x11')]=function(_0x3cd8b2){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopperBlack['checkIsBlackList'](_0x3cd8b2))[_0xd118('0xe')](loggerCatch(_0xd118('0x12')));};exports[_0xd118('0x13')]=function(_0x16a764){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper['getContactPreview'](_0x16a764))[_0xd118('0xe')](loggerCatch(_0xd118('0x14')));};exports[_0xd118('0xd')]=function(_0x10bdd8,_0x51a32a){create(_0x10bdd8)['catch'](loggerCatch(_0x51a32a));moveContact(_0x10bdd8)[_0xd118('0xe')](loggerCatch(_0x51a32a));};exports[_0xd118('0x15')]=function(_0x3d0d69,_0x567fbd){createAgent(_0x3d0d69)[_0xd118('0xe')](loggerCatch(_0x567fbd));};exports['createCustomerHistory']=function(_0x4c45e5,_0x4c30e4){create(_0x4c45e5)[_0xd118('0xe')](loggerCatch(_0x4c30e4));};exports['createCustomerFinal']=function(_0x536df3,_0x42555a){moveContact(_0x536df3)[_0xd118('0xe')](loggerCatch(_0x42555a));};exports['rescheduleContact']=function(_0x4e52ec,_0x1bcae9,_0x13c87d){if(_0x1bcae9){_0x4e52ec[_0xd118('0x16')]=null;}if(_0x13c87d){_0x4e52ec[_0xd118('0x17')]=![];}return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper[_0xd118('0x18')](_0x4e52ec))[_0xd118('0xe')](loggerCatch(_0xd118('0x19')));};exports[_0xd118('0x1a')]=function(_0x2b82a2){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper[_0xd118('0x1a')](_0x2b82a2))[_0xd118('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0xd118('0x1b')]=function(_0x256949){return BPromise['resolve']()[_0xd118('0xc')](cmHopper[_0xd118('0x1b')]({'UserId':null},_0x256949,0x1))['catch'](loggerCatch(_0xd118('0x1c')));};exports[_0xd118('0x1d')]=function(_0x32f794){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper[_0xd118('0x1b')]({'active':![]},_0x32f794,0x1))[_0xd118('0xe')](loggerCatch(_0xd118('0x1e')));};exports[_0xd118('0x1f')]=function(_0x170dba){var _0x2a243c={};_0x2a243c[_0xd118('0x20')]=_0x170dba['type'];_0x2a243c[_0xd118('0x21')]=_0x170dba[_0xd118('0x21')];_0x2a243c[_0xd118('0x22')]=_0x170dba['calleridnum'];_0x2a243c['calleridname']=_0x170dba['calleridname'];_0x2a243c[_0xd118('0x23')]=_0x170dba['queue'];_0x2a243c[_0xd118('0x24')]=_0x170dba[_0xd118('0x25')];_0x2a243c[_0xd118('0x26')]=_0x170dba[_0xd118('0x25')];_0x2a243c[_0xd118('0x27')]=0x1;_0x2a243c[_0xd118('0x28')]=_0x170dba[_0xd118('0x29')];_0x2a243c[_0xd118('0x2a')]=_0x170dba[_0xd118('0x2b')];_0x2a243c[_0xd118('0x2c')]=_0xd118('0x2d');_0x2a243c[_0xd118('0x2e')]='xcally-motion-preview';_0x2a243c[_0xd118('0x2f')]=0x0;_0x2a243c['assigned']=0x1;_0x2a243c['lastAssignedTo']=_0x170dba[_0xd118('0x2b')];_0x2a243c[_0xd118('0x30')]=_0xd118('0x31');return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](voiceQueueReport['create'](_0x2a243c))['catch'](loggerCatch(_0xd118('0x32')));};exports['getContactRecallMe']=function(_0x4a702e,_0x59b2d8){return BPromise['resolve']()['then'](cmHopper[_0xd118('0x33')](_0x4a702e,_0x59b2d8))[_0xd118('0xe')](loggerCatch(_0xd118('0x34')));};exports[_0xd118('0x35')]=function(_0x56da19){return BPromise[_0xd118('0xb')]()[_0xd118('0xc')](cmHopper[_0xd118('0x18')](_0x56da19,!![],!![]))[_0xd118('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x4c30=['then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20'];(function(_0x555ddc,_0x57d7e9){var _0x2dc5a2=function(_0x42f6b1){while(--_0x42f6b1){_0x555ddc['push'](_0x555ddc['shift']());}};_0x2dc5a2(++_0x57d7e9);}(_0x4c30,0x96));var _0x04c3=function(_0x45122a,_0x328224){_0x45122a=_0x45122a-0x0;var _0x3cd075=_0x4c30[_0x45122a];return _0x3cd075;};'use strict';var util=require(_0x04c3('0x0'));var BPromise=require(_0x04c3('0x1'));var logger=require(_0x04c3('0x2'))(_0x04c3('0x3'));var _=require(_0x04c3('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x04c3('0x5'));var cmHopperHistory=require(_0x04c3('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x04c3('0x7'));var agentReportPreview=require(_0x04c3('0x8'));var voiceQueueReport=require(_0x04c3('0x9'));function loggerCatch(_0x1c08a9){return function(_0x399a72){logger['error'](_0x1c08a9,util[_0x04c3('0xa')](_0x399a72,{'showHidden':![],'depth':null}));};}function create(_0x3a0990){return BPromise[_0x04c3('0xb')]()['then'](cmHopperHistory[_0x04c3('0xc')](_0x3a0990))[_0x04c3('0xd')](loggerCatch(_0x04c3('0xe')));}function createAgent(_0x476018){return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](agentReportPreview[_0x04c3('0xc')](_0x476018))['catch'](loggerCatch(_0x04c3('0xe')));}function moveContact(_0x2cf597){return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](cmHopper[_0x04c3('0x10')](_0x2cf597,!![]))[_0x04c3('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x04c3('0x11')]=function(_0x4d0d44){return BPromise['resolve']()[_0x04c3('0xf')](cmHopperBlack['checkIsBlackList'](_0x4d0d44))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x12')));};exports[_0x04c3('0x13')]=function(_0x13731b){return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](cmHopper[_0x04c3('0x13')](_0x13731b))[_0x04c3('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x04c3('0xc')]=function(_0x2a397b,_0x3b9153){create(_0x2a397b)[_0x04c3('0xd')](loggerCatch(_0x3b9153));moveContact(_0x2a397b)[_0x04c3('0xd')](loggerCatch(_0x3b9153));};exports[_0x04c3('0x14')]=function(_0x27c17f,_0x5df7d0){createAgent(_0x27c17f)[_0x04c3('0xd')](loggerCatch(_0x5df7d0));};exports[_0x04c3('0x15')]=function(_0x17dc19,_0x2aeb4b){create(_0x17dc19)[_0x04c3('0xd')](loggerCatch(_0x2aeb4b));};exports[_0x04c3('0x16')]=function(_0xf0c0c3,_0x6459e9){moveContact(_0xf0c0c3)[_0x04c3('0xd')](loggerCatch(_0x6459e9));};exports[_0x04c3('0x17')]=function(_0x363031,_0x5123a1,_0xd0610){if(_0x5123a1){_0x363031['UserId']=null;}if(_0xd0610){_0x363031[_0x04c3('0x18')]=![];}return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](cmHopper['rescheduleContact'](_0x363031))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x19')));};exports[_0x04c3('0x1a')]=function(_0x12f70c){return BPromise[_0x04c3('0xb')]()['then'](cmHopper['countReScheduled'](_0x12f70c))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x1b')));};exports[_0x04c3('0x1c')]=function(_0x4afbf9){return BPromise[_0x04c3('0xb')]()['then'](cmHopper[_0x04c3('0x1c')]({'UserId':null},_0x4afbf9,0x1))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x1d')));};exports[_0x04c3('0x1e')]=function(_0xff783e){return BPromise['resolve']()[_0x04c3('0xf')](cmHopper[_0x04c3('0x1c')]({'active':![]},_0xff783e,0x1))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x1f')));};exports[_0x04c3('0x20')]=function(_0x5b2c7b){var _0x4812b5={};_0x4812b5[_0x04c3('0x21')]=_0x5b2c7b['type'];_0x4812b5[_0x04c3('0x22')]=_0x5b2c7b['uniqueid'];_0x4812b5[_0x04c3('0x23')]=_0x5b2c7b[_0x04c3('0x23')];_0x4812b5['calleridname']=_0x5b2c7b[_0x04c3('0x24')];_0x4812b5[_0x04c3('0x25')]=_0x5b2c7b['queue'];_0x4812b5[_0x04c3('0x26')]=_0x5b2c7b[_0x04c3('0x27')];_0x4812b5[_0x04c3('0x28')]=_0x5b2c7b[_0x04c3('0x27')];_0x4812b5['queuecallercomplete']=0x1;_0x4812b5[_0x04c3('0x29')]=_0x5b2c7b[_0x04c3('0x2a')];_0x4812b5['connectedlinename']=_0x5b2c7b['membername'];_0x4812b5[_0x04c3('0x2b')]=_0x04c3('0x2c');_0x4812b5[_0x04c3('0x2d')]=_0x04c3('0x2e');_0x4812b5[_0x04c3('0x2f')]=0x0;_0x4812b5['assigned']=0x1;_0x4812b5[_0x04c3('0x30')]=_0x5b2c7b['membername'];_0x4812b5[_0x04c3('0x31')]='COMPLETED';return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](voiceQueueReport[_0x04c3('0x32')](_0x4812b5))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x33')));};exports[_0x04c3('0x34')]=function(_0x59ba8b,_0x130a90){return BPromise[_0x04c3('0xb')]()[_0x04c3('0xf')](cmHopper[_0x04c3('0x34')](_0x59ba8b,_0x130a90))[_0x04c3('0xd')](loggerCatch(_0x04c3('0x35')));};exports['rescheduleContactInQueue']=function(_0x19e74e){return BPromise[_0x04c3('0xb')]()['then'](cmHopper[_0x04c3('0x17')](_0x19e74e,!![],!![]))[_0x04c3('0xd')](loggerCatch(_0x04c3('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 1275996..35ed156 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 _0x1f32=['idContact','type','campaigntype','dialAnswer','channelAgent','active','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','milliseconds','diff','seconds','loggerCatch','logger','info','loggerError','error','inspect','logger2','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','Queue','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','statedesc','Blacklist','starttime','responsetime','logAgent','state','ringtime','membername','UserId','YYYY-MM-DD\x20HH:mm:ss','endtime','talktime','answertime','isFailure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','from-sip','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','filterKey'];(function(_0x30b4aa,_0x167cfd){var _0x248d47=function(_0x1ded35){while(--_0x1ded35){_0x30b4aa['push'](_0x30b4aa['shift']());}};_0x248d47(++_0x167cfd);}(_0x1f32,0xb9));var _0x21f3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1f32[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x21f3('0x0'));var _=require(_0x21f3('0x1'));var moment=require(_0x21f3('0x2'));var logger=require(_0x21f3('0x3'))('preview');var ipAgi=process[_0x21f3('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0xbe047c,_0x447a20){var _0x2e9dc3=moment(_0xbe047c)['milliseconds'](0x0);var _0x4171da=moment(_0x447a20)[_0x21f3('0x5')](0x0);return _0x2e9dc3[_0x21f3('0x6')](_0x4171da,_0x21f3('0x7'));}exports[_0x21f3('0x8')]=function(_0x464295){return function(_0x177628){logger['error'](_0x464295,util['inspect'](_0x177628,{'showHidden':![],'depth':null}));};};exports[_0x21f3('0x9')]=function(_0x138d39,_0x2a773e){logger[_0x21f3('0xa')](_0x138d39,util['inspect'](_0x2a773e,{'showHidden':![],'depth':null}));};exports[_0x21f3('0xb')]=function(_0x2d0f4f,_0x39a9bf){logger[_0x21f3('0xc')](_0x2d0f4f,util[_0x21f3('0xd')](_0x39a9bf,{'showHidden':![],'depth':null}));};exports[_0x21f3('0xe')]=function(_0x5f0626){return function(_0x400734){logger[_0x21f3('0xa')](_0x5f0626,util[_0x21f3('0xd')](_0x400734,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x158850,_0x2f8957,_0x1ade19){return{'message':_0x158850,'unlock':_0x2f8957,'active':_0x1ade19};};exports['getCallerId']=function(_0x529af8,_0xaf53db,_0x48b2e6){if(!_[_0x21f3('0xf')](_0x48b2e6)&&_0x21f3('0x10')===typeof _0x48b2e6&&!_[_0x21f3('0x11')](_0x48b2e6)){if(!_['isUndefined'](_0xaf53db)&&_0x21f3('0x10')===typeof _0xaf53db&&!_[_0x21f3('0x11')](_0xaf53db)){return util[_0x21f3('0x12')](_0x21f3('0x13'),_0xaf53db,_0x48b2e6);}return util['format'](_0x21f3('0x13'),_0x48b2e6,_0x48b2e6);}if(!_[_0x21f3('0xf')](_0x529af8)&&'string'===typeof _0x529af8&&!_[_0x21f3('0x11')](_0x529af8)){return _0x529af8;}return _0x21f3('0x14');};exports[_0x21f3('0x15')]=function(_0xd7607d){if(_['isNil'](_0xd7607d)){return![];}return _0xd7607d;};exports['addVariables']=function(_0x3812cc,_0x140ec5,_0x440059,_0x1d5a3c,_0x3508fe,_0x1bd53b){var _0x52071b={'XMD-QUEUE':_0x140ec5[_0x21f3('0x16')]?_0x140ec5[_0x21f3('0x16')]['name']:'','XMD-CALLERID':_0x1d5a3c,'XMD-CALLERID-PREVIEW':_0x1bd53b?util[_0x21f3('0x12')](_0x21f3('0x13'),_0x1bd53b['calleridname'],_0x1bd53b['calleridnum']):_0x1d5a3c,'XMD-DIALID':_0x3508fe,'XMD-CONTACTID':_0x140ec5[_0x21f3('0x17')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1d5a3c,'XMD-VOICEQUEUEID':_0x140ec5[_0x21f3('0x18')],'XMD-DIALCHANNEL':_0x440059,'XMD-DIALTIMEOUT':_0x3812cc[_0x21f3('0x19')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x21f3('0x1a'),_0x3812cc['dialQueueProject2']?'g':'',_[_0x21f3('0x11')](_0x3812cc[_0x21f3('0x1b')])?'':_0x21f3('0x1c')),'XMD-DIALURL':_0x3812cc[_0x21f3('0x1d')]||'','XMD-AGI':_0x3812cc[_0x21f3('0x1e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3812cc[_0x21f3('0x1e')]):_0x21f3('0x1f'),'XMD-AGIAFTER':_0x3812cc['dialQueueProject2']?util[_0x21f3('0x12')](_0x21f3('0x20'),ipAgi,_0x3812cc[_0x21f3('0x21')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1bd53b?_0x1bd53b[_0x21f3('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x1bd53b?_0x1bd53b[_0x21f3('0x23')]:'','XMD-DESTINATION':_0x21f3('0x24'),'SIPADDHEADER':_0x21f3('0x25')};if(!_['isEmpty'](_0x3812cc[_0x21f3('0x1b')])){_0x52071b[util[_0x21f3('0x12')]('%s',_0x21f3('0x26'))]=_0x3812cc['monitor_format'];_0x52071b[util[_0x21f3('0x12')]('%s',_0x21f3('0x27'))]=_0x3508fe;}if(_0x140ec5&&_0x140ec5[_0x21f3('0x28')]){for(var _0x5f103a in _0x140ec5[_0x21f3('0x28')]){if(_0x140ec5[_0x21f3('0x28')][_0x21f3('0x29')](_0x5f103a)){if(!_[_0x21f3('0x2a')](_0x140ec5[_0x21f3('0x28')][_0x5f103a])&&_0x5f103a!=='id'&&_0x5f103a!==_0x21f3('0x2b')&&_0x5f103a!==_0x21f3('0x2c')&&_0x5f103a!=='updatedAt'){_0x52071b[util[_0x21f3('0x12')](_0x21f3('0x2d'),_0x21f3('0x2e'),_[_0x21f3('0x2f')](_0x5f103a))]=_0x140ec5[_0x21f3('0x28')][_0x5f103a];}}}}return _0x52071b;};exports['toLowerVariables']=function(_0x146ffd){var _0x5d77fc={};for(var _0x6a0ee8 in _0x146ffd){if(_0x146ffd[_0x21f3('0x29')](_0x6a0ee8)){_0x5d77fc[util['format']('%s',_[_0x21f3('0x30')](_0x6a0ee8))]=_0x146ffd[_0x6a0ee8];}}return{'variables':_0x5d77fc};};exports[_0x21f3('0x31')]=function(_0x1b2265,_0x303ee4){if(!_[_0x21f3('0x2a')](_0x1b2265)){if(_0x1b2265[_0x21f3('0x29')]('originated')){if(_0x1b2265[_0x21f3('0x32')]>0x0){_0x1b2265[_0x21f3('0x32')]-=0x1;}else{logger['error'](_0x21f3('0x33'),_0x303ee4);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x303ee4);}};exports[_0x21f3('0x34')]=function(_0x560534){var _0x298292=moment()[_0x21f3('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x560534['state']=0xd;_0x560534[_0x21f3('0x35')]=_0x21f3('0x36');_0x560534[_0x21f3('0x37')]=_0x298292;_0x560534[_0x21f3('0x38')]=_0x298292;_0x560534['endtime']=_0x298292;};exports[_0x21f3('0x39')]=function(_0xed7201,_0x3c8571,_0x1ace80){var _0x1f3e47=moment()[_0x21f3('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xed7201[_0x21f3('0x3a')]=_0x3c8571;_0xed7201[_0x21f3('0x35')]=_0x1ace80;_0xed7201['responsetime']=_0x1f3e47;_0xed7201[_0x21f3('0x3b')]=getSeconds(_0xed7201['responsetime'],_0xed7201[_0x21f3('0x37')]);};exports['logLookAgent']=function(_0xcaf2cf,_0xd2c90e,_0x24d2fe){_0xcaf2cf[_0x21f3('0x3c')]=_0xd2c90e;_0xcaf2cf[_0x21f3('0x3d')]=_0x24d2fe;};exports['logCustomer']=function(_0x1cb64b,_0x49b54d,_0x594647){var _0x2522b9=moment()[_0x21f3('0x12')](_0x21f3('0x3e'));_0x1cb64b[_0x21f3('0x3a')]=_0x49b54d;_0x1cb64b[_0x21f3('0x35')]=_0x594647;_0x1cb64b[_0x21f3('0x38')]=_0x1cb64b[_0x21f3('0x38')]?_0x1cb64b[_0x21f3('0x38')]:_0x2522b9;_0x1cb64b[_0x21f3('0x3f')]=_0x1cb64b[_0x21f3('0x3f')]?_0x1cb64b['endtime']:_0x2522b9;_0x1cb64b['ringtime']=getSeconds(_0x1cb64b[_0x21f3('0x38')]||0x0,_0x1cb64b[_0x21f3('0x37')]||0x0);_0x1cb64b[_0x21f3('0x40')]=_0x1cb64b['answertime']?getSeconds(_0x1cb64b['endtime'],_0x1cb64b[_0x21f3('0x41')]):0x0;};exports[_0x21f3('0x42')]=function(_0x1f9f25){return _0x1f9f25==='Failure';};exports[_0x21f3('0x43')]=function(_0x4d9c28,_0x122253,_0x37d73a,_0x491ace,_0x22cac1){var _0x32e84f=_0x491ace?_0x21f3('0x44'):_0x4d9c28[_0x21f3('0x45')];_0x32e84f=_0x22cac1?_0x21f3('0x46'):_0x32e84f;return{'actionid':_0x4d9c28[_0x21f3('0x47')],'action':_0x21f3('0x48'),'channel':_0x4d9c28['channelAgent'],'callerid':util['format'](_0x21f3('0x13'),_0x32e84f,_0x4d9c28['calleridnum']),'Exten':_0x21f3('0x24'),'Context':_0x21f3('0x49'),'Priority':'1','variable':_0x37d73a,'timeout':(_0x122253['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4d9c28[_0x21f3('0x47')]};};exports[_0x21f3('0x4a')]=function(_0x549f0a){return _0x549f0a[_0x21f3('0x4b')]+_0x549f0a[_0x21f3('0x4c')]+_0x549f0a['countnoanswerretry']+_0x549f0a[_0x21f3('0x4d')]+_0x549f0a[_0x21f3('0x4e')];};exports[_0x21f3('0x4f')]=function(_0x5cb027){var _0x3e328f=_[_0x21f3('0x50')](_0x5cb027);_0x3e328f[_0x21f3('0x3a')]=0xf;_0x3e328f[_0x21f3('0x35')]=_0x21f3('0x51');return _0x3e328f;};exports['scheduledAt']=function(_0x3dd718,_0xa65c86,_0x4568fa){var _0x318417={};_0x318417[_0xa65c86]=_0x3dd718[_0xa65c86];_0x318417['active']=![];_0x318417[_0x21f3('0x52')]=moment()[_0x21f3('0x53')](_0x4568fa,_0x21f3('0x54'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x318417[_0x21f3('0x17')]=_0x3dd718[_0x21f3('0x17')];_0x318417[_0x21f3('0x55')]=_0x3dd718['ListId'];_0x318417[_0x21f3('0x18')]=_0x3dd718['VoiceQueueId']||undefined;return _0x318417;};exports[_0x21f3('0x56')]=function(_0xabf918,_0x5335a5){if(!_['isNil'](_0xabf918)){if(_0xabf918[_0x21f3('0x57')]>0x0){_0xabf918[_0x21f3('0x57')]-=0x1;}else{logger[_0x21f3('0xc')](_0x5335a5,_0x21f3('0x58'));}}else{logger[_0x21f3('0xc')](_0x5335a5,_0x21f3('0x59'));}};exports[_0x21f3('0x5a')]=function(_0x2c19c3){if(_0x2c19c3<=0x0){return!![];}return![];};exports[_0x21f3('0x5b')]=function(_0x510ad8,_0x550ec2,_0xc8628b){_0x510ad8[_0x21f3('0x5c')]=_0x550ec2;_0x510ad8['name']=_0x510ad8['queue'];_0x510ad8[_0x21f3('0x5d')]=_0x510ad8['channelAgent'];_0x510ad8[_0x21f3('0x5e')]=_0x21f3('0x5f');if(_0xc8628b){_0x510ad8['mandatoryDisposition']=_0xc8628b[_0x21f3('0x60')];}return _0x510ad8;};exports[_0x21f3('0x61')]=function(_0x9c574f){var _0x3d92c4={};_0x3d92c4['queue']=_0x9c574f[_0x21f3('0x62')];_0x3d92c4[_0x21f3('0x5d')]=_0x9c574f['channelAgent'];_0x3d92c4[_0x21f3('0x47')]=_0x9c574f[_0x21f3('0x47')];return _0x3d92c4;};exports[_0x21f3('0x63')]=function(_0x5b7c8b){var _0x362f6b=[];for(var _0x55cfe9 in _0x5b7c8b){if(_0x5b7c8b[_0x21f3('0x29')](_0x55cfe9)){if(!_[_0x21f3('0x2a')](_0x5b7c8b[_0x55cfe9])&&_0x5b7c8b[_0x55cfe9][_0x21f3('0x3a')]===_0x21f3('0x64')&&_0x5b7c8b[_0x55cfe9][_0x21f3('0x65')]===_0x21f3('0x66')){_0x362f6b[_0x21f3('0x67')](_0x5b7c8b[_0x55cfe9]['id']);}}}return _0x362f6b;};exports[_0x21f3('0x68')]=function(_0x36d158){var _0x5c6607=moment()[_0x21f3('0x5')](0x0);var _0x506e26=moment(_0x36d158)['milliseconds'](0x0);return _0x5c6607[_0x21f3('0x6')](_0x506e26,_0x21f3('0x7'));};exports[_0x21f3('0x69')]=function(_0x5a6faa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a6faa[_0x21f3('0x17')],'ListId':_0x5a6faa[_0x21f3('0x55')],'VoiceQueueId':_0x5a6faa[_0x21f3('0x18')]||undefined,'CampaignId':_0x5a6faa['CampaignId']||undefined};};exports[_0x21f3('0x6a')]=function(_0x23a1ac){if(_0x23a1ac===_0x21f3('0x47')||_0x23a1ac===_0x21f3('0x6b')||_0x23a1ac===_0x21f3('0x62')||_0x23a1ac===_0x21f3('0x6c')||_0x23a1ac===_0x21f3('0x6d')||_0x23a1ac===_0x21f3('0x6e')||_0x23a1ac==='membername'||_0x23a1ac===_0x21f3('0x6f')||_0x23a1ac==='calleridname'||_0x23a1ac===_0x21f3('0x70')||_0x23a1ac==='calleridnum'||_0x23a1ac===_0x21f3('0x52')||_0x23a1ac===_0x21f3('0x4b')||_0x23a1ac==='countcongestionretry'||_0x23a1ac===_0x21f3('0x71')||_0x23a1ac===_0x21f3('0x72')||_0x23a1ac===_0x21f3('0x73')||_0x23a1ac===_0x21f3('0x74')||_0x23a1ac==='callbackat'||_0x23a1ac===_0x21f3('0x75')||_0x23a1ac==='ContactId'||_0x23a1ac===_0x21f3('0x55')||_0x23a1ac==='UserId'||_0x23a1ac===_0x21f3('0x18')||_0x23a1ac===_0x21f3('0x76')||_0x23a1ac===_0x21f3('0x77')||_0x23a1ac===_0x21f3('0x78')||_0x23a1ac===_0x21f3('0x79')||_0x23a1ac===_0x21f3('0x7a')||_0x23a1ac===_0x21f3('0x7b')||_0x23a1ac===_0x21f3('0x7c')||_0x23a1ac===_0x21f3('0x7d')||_0x23a1ac===_0x21f3('0x7e')||_0x23a1ac===_0x21f3('0x7f')||_0x23a1ac===_0x21f3('0x80')||_0x23a1ac==='xmd-cdrtype'||_0x23a1ac==='xmd-callerid'||_0x23a1ac===_0x21f3('0x81')||_0x23a1ac===_0x21f3('0x82')||_0x23a1ac===_0x21f3('0x83')||_0x23a1ac===_0x21f3('0x84')||_0x23a1ac===_0x21f3('0x85')||_0x23a1ac==='rtpaudioqosjitterbridged'||_0x23a1ac==='rtpaudioqosloss'||_0x23a1ac===_0x21f3('0x86')||_0x23a1ac===_0x21f3('0x87')||_0x23a1ac===_0x21f3('0x88')||_0x23a1ac===_0x21f3('0x83')||_0x23a1ac===_0x21f3('0x84')||_0x23a1ac===_0x21f3('0x85')||_0x23a1ac===_0x21f3('0x89')||_0x23a1ac===_0x21f3('0x8a')||_0x23a1ac==='rtpaudioqoslossbridged'||_0x23a1ac===_0x21f3('0x87')||_0x23a1ac===_0x21f3('0x88')||_0x23a1ac==='bridgepeer'||_0x23a1ac===_0x21f3('0x8b')||_0x23a1ac==='state'||_0x23a1ac===_0x21f3('0x35')){return![];}return!![];};exports[_0x21f3('0x8c')]=function(_0xe5ac36,_0xa99ce9){var _0x3280c4,_0x1d7e5c,_0x419b3b;if(_0xa99ce9<=0x0){_0xa99ce9=0x1;}_0x3280c4=new RegExp(_0x21f3('0x8d')+_0xa99ce9+'}$');_0x1d7e5c=Math['pow'](0xa,_0xa99ce9-0x1);_0x419b3b=Math['pow'](0xa,_0xa99ce9)-0x1;return util['format']('%s',_['replace'](_0xe5ac36,_0x3280c4,_[_0x21f3('0x8e')](_0x1d7e5c,_0x419b3b)));};exports[_0x21f3('0x8f')]=function(_0x880fe5){var _0x484ba8=_0x880fe5[_0x21f3('0x90')](/"(.*?)"/);return _0x484ba8?_0x484ba8[0x1]:_0x880fe5;};exports[_0x21f3('0x91')]=function(_0x19462e){var _0xf2cf8a=_0x19462e[_0x21f3('0x90')](/<(.*?)>/);return _0xf2cf8a?_0xf2cf8a[0x1]:_0x19462e;}; \ No newline at end of file +var _0xcfaa=['ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','motionChannel','mandatoryDisposition','buildAcw','queue','interface','agentReadyId','status','reachable','diff','createBody','CampaignId','idContact','type','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','seconds','logger','inspect','loggerError','error','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','name','calleridname','calleridnum'];(function(_0x1ffa43,_0x2b7134){var _0x3682c4=function(_0x324c07){while(--_0x324c07){_0x1ffa43['push'](_0x1ffa43['shift']());}};_0x3682c4(++_0x2b7134);}(_0xcfaa,0x71));var _0xacfa=function(_0x52b173,_0x1484da){_0x52b173=_0x52b173-0x0;var _0x5564fe=_0xcfaa[_0x52b173];return _0x5564fe;};'use strict';var util=require(_0xacfa('0x0'));var _=require(_0xacfa('0x1'));var moment=require('moment');var logger=require(_0xacfa('0x2'))(_0xacfa('0x3'));var ipAgi=process['env'][_0xacfa('0x4')]||'127.0.0.1';function getSeconds(_0x134dc2,_0x368592){var _0x37edbe=moment(_0x134dc2)[_0xacfa('0x5')](0x0);var _0x5d1dfd=moment(_0x368592)[_0xacfa('0x5')](0x0);return _0x37edbe['diff'](_0x5d1dfd,_0xacfa('0x6'));}exports['loggerCatch']=function(_0x14e24d){return function(_0x3c617c){logger['error'](_0x14e24d,util['inspect'](_0x3c617c,{'showHidden':![],'depth':null}));};};exports[_0xacfa('0x7')]=function(_0x4f7179,_0x37cb6c){logger['info'](_0x4f7179,util[_0xacfa('0x8')](_0x37cb6c,{'showHidden':![],'depth':null}));};exports[_0xacfa('0x9')]=function(_0x3ccde1,_0x5d209b){logger[_0xacfa('0xa')](_0x3ccde1,util[_0xacfa('0x8')](_0x5d209b,{'showHidden':![],'depth':null}));};exports[_0xacfa('0xb')]=function(_0x4b1556){return function(_0x26b486){logger[_0xacfa('0xc')](_0x4b1556,util['inspect'](_0x26b486,{'showHidden':![],'depth':null}));};};exports[_0xacfa('0xd')]=function(_0x33ad68,_0x3ab244,_0x350f36){return{'message':_0x33ad68,'unlock':_0x3ab244,'active':_0x350f36};};exports[_0xacfa('0xe')]=function(_0x5a6300,_0x1dad9a,_0x52d5f2){if(!_[_0xacfa('0xf')](_0x52d5f2)&&_0xacfa('0x10')===typeof _0x52d5f2&&!_[_0xacfa('0x11')](_0x52d5f2)){if(!_['isUndefined'](_0x1dad9a)&&_0xacfa('0x10')===typeof _0x1dad9a&&!_[_0xacfa('0x11')](_0x1dad9a)){return util[_0xacfa('0x12')](_0xacfa('0x13'),_0x1dad9a,_0x52d5f2);}return util['format'](_0xacfa('0x13'),_0x52d5f2,_0x52d5f2);}if(!_[_0xacfa('0xf')](_0x5a6300)&&_0xacfa('0x10')===typeof _0x5a6300&&!_[_0xacfa('0x11')](_0x5a6300)){return _0x5a6300;}return'\x22\x22\x20<>';};exports[_0xacfa('0x14')]=function(_0x22b2ed){if(_[_0xacfa('0x15')](_0x22b2ed)){return![];}return _0x22b2ed;};exports['addVariables']=function(_0x46074e,_0x4ab9ba,_0x341592,_0x3916fb,_0x395c79,_0x334711){var _0x3f968a={'XMD-QUEUE':_0x4ab9ba[_0xacfa('0x16')]?_0x4ab9ba[_0xacfa('0x16')][_0xacfa('0x17')]:'','XMD-CALLERID':_0x3916fb,'XMD-CALLERID-PREVIEW':_0x334711?util[_0xacfa('0x12')](_0xacfa('0x13'),_0x334711[_0xacfa('0x18')],_0x334711[_0xacfa('0x19')]):_0x3916fb,'XMD-DIALID':_0x395c79,'XMD-CONTACTID':_0x4ab9ba[_0xacfa('0x1a')],'XMD-CDRTYPE':_0xacfa('0x1b'),'CALLERID(all)':_0x3916fb,'XMD-VOICEQUEUEID':_0x4ab9ba[_0xacfa('0x1c')],'XMD-DIALCHANNEL':_0x341592,'XMD-DIALTIMEOUT':_0x46074e[_0xacfa('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xacfa('0x12')]('\x22rtTxX%s%s\x22',_0x46074e[_0xacfa('0x1e')]?'g':'',_[_0xacfa('0x11')](_0x46074e['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x46074e['dialPreviewUrl']||'','XMD-AGI':_0x46074e[_0xacfa('0x1f')]?util[_0xacfa('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x46074e[_0xacfa('0x1f')]):_0xacfa('0x20'),'XMD-AGIAFTER':_0x46074e[_0xacfa('0x1e')]?util[_0xacfa('0x12')](_0xacfa('0x21'),ipAgi,_0x46074e[_0xacfa('0x1e')]):_0xacfa('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x334711?_0x334711[_0xacfa('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x334711?_0x334711[_0xacfa('0x23')]:'','XMD-DESTINATION':_0xacfa('0x24'),'SIPADDHEADER':_0xacfa('0x25')};if(!_[_0xacfa('0x11')](_0x46074e[_0xacfa('0x26')])){_0x3f968a[util['format']('%s',_0xacfa('0x27'))]=_0x46074e[_0xacfa('0x26')];_0x3f968a[util[_0xacfa('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x395c79;}if(_0x4ab9ba&&_0x4ab9ba[_0xacfa('0x28')]){for(var _0x5d1ac0 in _0x4ab9ba['Contact']){if(_0x4ab9ba[_0xacfa('0x28')][_0xacfa('0x29')](_0x5d1ac0)){if(!_[_0xacfa('0x15')](_0x4ab9ba['Contact'][_0x5d1ac0])&&_0x5d1ac0!=='id'&&_0x5d1ac0!=='tags'&&_0x5d1ac0!==_0xacfa('0x2a')&&_0x5d1ac0!==_0xacfa('0x2b')){_0x3f968a[util[_0xacfa('0x12')]('%s%s',_0xacfa('0x2c'),_[_0xacfa('0x2d')](_0x5d1ac0))]=_0x4ab9ba[_0xacfa('0x28')][_0x5d1ac0];}}}}return _0x3f968a;};exports['toLowerVariables']=function(_0x38b903){var _0x41a3ff={};for(var _0x11da31 in _0x38b903){if(_0x38b903[_0xacfa('0x29')](_0x11da31)){_0x41a3ff[util[_0xacfa('0x12')]('%s',_['toLower'](_0x11da31))]=_0x38b903[_0x11da31];}}return{'variables':_0x41a3ff};};exports[_0xacfa('0x2e')]=function(_0x30d726,_0x3a69ee){if(!_[_0xacfa('0x15')](_0x30d726)){if(_0x30d726[_0xacfa('0x29')](_0xacfa('0x2f'))){if(_0x30d726[_0xacfa('0x2f')]>0x0){_0x30d726[_0xacfa('0x2f')]-=0x1;}else{logger[_0xacfa('0xa')](_0xacfa('0x30'),_0x3a69ee);}}}else{logger[_0xacfa('0xa')](_0xacfa('0x31'),_0x3a69ee);}};exports['logBlacklist']=function(_0x563b76){var _0x3a5d20=moment()[_0xacfa('0x12')](_0xacfa('0x32'));_0x563b76[_0xacfa('0x33')]=0xd;_0x563b76['statedesc']=_0xacfa('0x34');_0x563b76[_0xacfa('0x35')]=_0x3a5d20;_0x563b76[_0xacfa('0x36')]=_0x3a5d20;_0x563b76[_0xacfa('0x37')]=_0x3a5d20;};exports['logAgent']=function(_0x3a8840,_0x12094f,_0x2f34ca){var _0x39c620=moment()[_0xacfa('0x12')](_0xacfa('0x32'));_0x3a8840['state']=_0x12094f;_0x3a8840[_0xacfa('0x38')]=_0x2f34ca;_0x3a8840[_0xacfa('0x36')]=_0x39c620;_0x3a8840[_0xacfa('0x39')]=getSeconds(_0x3a8840['responsetime'],_0x3a8840[_0xacfa('0x35')]);};exports[_0xacfa('0x3a')]=function(_0x3a7100,_0x41801c,_0x54f8e5){_0x3a7100[_0xacfa('0x3b')]=_0x41801c;_0x3a7100[_0xacfa('0x3c')]=_0x54f8e5;};exports[_0xacfa('0x3d')]=function(_0xd093f2,_0x2ad368,_0x1e54b6){var _0x127c7c=moment()[_0xacfa('0x12')](_0xacfa('0x32'));_0xd093f2[_0xacfa('0x33')]=_0x2ad368;_0xd093f2[_0xacfa('0x38')]=_0x1e54b6;_0xd093f2[_0xacfa('0x36')]=_0xd093f2[_0xacfa('0x36')]?_0xd093f2[_0xacfa('0x36')]:_0x127c7c;_0xd093f2['endtime']=_0xd093f2[_0xacfa('0x37')]?_0xd093f2[_0xacfa('0x37')]:_0x127c7c;_0xd093f2[_0xacfa('0x39')]=getSeconds(_0xd093f2[_0xacfa('0x36')]||0x0,_0xd093f2[_0xacfa('0x35')]||0x0);_0xd093f2[_0xacfa('0x3e')]=_0xd093f2[_0xacfa('0x3f')]?getSeconds(_0xd093f2[_0xacfa('0x37')],_0xd093f2['answertime']):0x0;};exports[_0xacfa('0x40')]=function(_0x562f64){return _0x562f64===_0xacfa('0x41');};exports[_0xacfa('0x42')]=function(_0x5f496b,_0x27866d,_0x258dbd,_0x1e7890,_0x6be27e){var _0x179fe6=_0x1e7890?'RECALL':_0x5f496b[_0xacfa('0x18')];_0x179fe6=_0x6be27e?_0xacfa('0x43'):_0x179fe6;return{'actionid':_0x5f496b[_0xacfa('0x44')],'action':_0xacfa('0x45'),'channel':_0x5f496b[_0xacfa('0x46')],'callerid':util['format'](_0xacfa('0x13'),_0x179fe6,_0x5f496b[_0xacfa('0x19')]),'Exten':_0xacfa('0x24'),'Context':_0xacfa('0x47'),'Priority':'1','variable':_0x258dbd,'timeout':(_0x27866d[_0xacfa('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5f496b[_0xacfa('0x44')]};};exports[_0xacfa('0x49')]=function(_0x7a340f){return _0x7a340f[_0xacfa('0x4a')]+_0x7a340f[_0xacfa('0x4b')]+_0x7a340f[_0xacfa('0x4c')]+_0x7a340f[_0xacfa('0x4d')]+_0x7a340f['countnosuchnumberretry'];};exports[_0xacfa('0x4e')]=function(_0x54f2f3){var _0x52c003=_[_0xacfa('0x4f')](_0x54f2f3);_0x52c003[_0xacfa('0x33')]=0xf;_0x52c003[_0xacfa('0x38')]=_0xacfa('0x50');return _0x52c003;};exports[_0xacfa('0x51')]=function(_0xb2614c,_0x484866,_0x46273c){var _0x471645={};_0x471645[_0x484866]=_0xb2614c[_0x484866];_0x471645[_0xacfa('0x52')]=![];_0x471645[_0xacfa('0x53')]=moment()[_0xacfa('0x54')](_0x46273c,_0xacfa('0x55'))['format'](_0xacfa('0x32'));_0x471645[_0xacfa('0x1a')]=_0xb2614c['ContactId'];_0x471645[_0xacfa('0x56')]=_0xb2614c[_0xacfa('0x56')];_0x471645[_0xacfa('0x1c')]=_0xb2614c['VoiceQueueId']||undefined;return _0x471645;};exports[_0xacfa('0x57')]=function(_0x5c0657,_0x4a0b87){if(!_[_0xacfa('0x15')](_0x5c0657)){if(_0x5c0657[_0xacfa('0x58')]>0x0){_0x5c0657['pTalking']-=0x1;}else{logger[_0xacfa('0xa')](_0x4a0b87,_0xacfa('0x59'));}}else{logger[_0xacfa('0xa')](_0x4a0b87,_0xacfa('0x5a'));}};exports[_0xacfa('0x5b')]=function(_0x4abd5b){if(_0x4abd5b<=0x0){return!![];}return![];};exports[_0xacfa('0x5c')]=function(_0x1d4903,_0xef7978,_0x498c67){_0x1d4903[_0xacfa('0x5d')]=_0xef7978;_0x1d4903[_0xacfa('0x17')]=_0x1d4903['queue'];_0x1d4903['interface']=_0x1d4903['channelAgent'];_0x1d4903[_0xacfa('0x5e')]='voice';if(_0x498c67){_0x1d4903[_0xacfa('0x5f')]=_0x498c67[_0xacfa('0x5f')];}return _0x1d4903;};exports[_0xacfa('0x60')]=function(_0x1ac7fa){var _0x2ed384={};_0x2ed384[_0xacfa('0x61')]=_0x1ac7fa[_0xacfa('0x61')];_0x2ed384[_0xacfa('0x62')]=_0x1ac7fa[_0xacfa('0x46')];_0x2ed384[_0xacfa('0x44')]=_0x1ac7fa['uniqueid'];return _0x2ed384;};exports[_0xacfa('0x63')]=function(_0x55e3bc){var _0x4db320=[];for(var _0x2f44df in _0x55e3bc){if(_0x55e3bc[_0xacfa('0x29')](_0x2f44df)){if(!_[_0xacfa('0x15')](_0x55e3bc[_0x2f44df])&&_0x55e3bc[_0x2f44df][_0xacfa('0x33')]==='not_inuse'&&_0x55e3bc[_0x2f44df][_0xacfa('0x64')]===_0xacfa('0x65')){_0x4db320['push'](_0x55e3bc[_0x2f44df]['id']);}}}return _0x4db320;};exports['getDiff']=function(_0x2cd51f){var _0x11fc77=moment()[_0xacfa('0x5')](0x0);var _0x356edf=moment(_0x2cd51f)[_0xacfa('0x5')](0x0);return _0x11fc77[_0xacfa('0x66')](_0x356edf,_0xacfa('0x6'));};exports[_0xacfa('0x67')]=function(_0xd6def6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd6def6[_0xacfa('0x1a')],'ListId':_0xd6def6[_0xacfa('0x56')],'VoiceQueueId':_0xd6def6[_0xacfa('0x1c')]||undefined,'CampaignId':_0xd6def6[_0xacfa('0x68')]||undefined};};exports['filterKey']=function(_0x536364){if(_0x536364==='uniqueid'||_0x536364===_0xacfa('0x69')||_0x536364==='queue'||_0x536364===_0xacfa('0x6a')||_0x536364==='campaigntype'||_0x536364===_0xacfa('0x6b')||_0x536364===_0xacfa('0x3b')||_0x536364===_0xacfa('0x46')||_0x536364===_0xacfa('0x18')||_0x536364==='active'||_0x536364==='calleridnum'||_0x536364===_0xacfa('0x53')||_0x536364===_0xacfa('0x4a')||_0x536364==='countcongestionretry'||_0x536364==='countnoanswerretry'||_0x536364===_0xacfa('0x6c')||_0x536364===_0xacfa('0x6d')||_0x536364===_0xacfa('0x6e')||_0x536364===_0xacfa('0x6f')||_0x536364===_0xacfa('0x70')||_0x536364===_0xacfa('0x1a')||_0x536364===_0xacfa('0x56')||_0x536364===_0xacfa('0x3c')||_0x536364==='VoiceQueueId'||_0x536364===_0xacfa('0x71')||_0x536364===_0xacfa('0x72')||_0x536364===_0xacfa('0x73')||_0x536364==='xmd-phone'||_0x536364===_0xacfa('0x74')||_0x536364==='xmd-dialurl'||_0x536364===_0xacfa('0x75')||_0x536364===_0xacfa('0x76')||_0x536364===_0xacfa('0x77')||_0x536364===_0xacfa('0x78')||_0x536364===_0xacfa('0x79')||_0x536364===_0xacfa('0x7a')||_0x536364==='xmd-callerid'||_0x536364===_0xacfa('0x7b')||_0x536364===_0xacfa('0x7c')||_0x536364===_0xacfa('0x7d')||_0x536364===_0xacfa('0x7e')||_0x536364==='rtpaudioqosjitter'||_0x536364===_0xacfa('0x7f')||_0x536364===_0xacfa('0x80')||_0x536364===_0xacfa('0x81')||_0x536364==='rtpaudioqosrtt'||_0x536364===_0xacfa('0x82')||_0x536364===_0xacfa('0x7d')||_0x536364===_0xacfa('0x7e')||_0x536364===_0xacfa('0x83')||_0x536364===_0xacfa('0x7f')||_0x536364===_0xacfa('0x80')||_0x536364==='rtpaudioqoslossbridged'||_0x536364===_0xacfa('0x84')||_0x536364===_0xacfa('0x82')||_0x536364===_0xacfa('0x85')||_0x536364===_0xacfa('0x86')||_0x536364===_0xacfa('0x33')||_0x536364==='statedesc'){return![];}return!![];};exports[_0xacfa('0x87')]=function(_0x51038b,_0x17003f){var _0x2821d5,_0x51eff6,_0x286fda;if(_0x17003f<=0x0){_0x17003f=0x1;}_0x2821d5=new RegExp('\x5cw{0,'+_0x17003f+'}$');_0x51eff6=Math['pow'](0xa,_0x17003f-0x1);_0x286fda=Math['pow'](0xa,_0x17003f)-0x1;return util[_0xacfa('0x12')]('%s',_['replace'](_0x51038b,_0x2821d5,_['random'](_0x51eff6,_0x286fda)));};exports[_0xacfa('0x88')]=function(_0xc45e84){var _0x1a01c6=_0xc45e84[_0xacfa('0x89')](/"(.*?)"/);return _0x1a01c6?_0x1a01c6[0x1]:_0xc45e84;};exports[_0xacfa('0x8a')]=function(_0x47a6b2){var _0x1da648=_0x47a6b2['match'](/<(.*?)>/);return _0x1da648?_0x1da648[0x1]:_0x47a6b2;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 5431572..6629f25 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 _0xc344=['number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc344,0x6a));var _0x4c34=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xc344[_0x17928f];return _0x500b63;};'use strict';exports[_0x4c34('0x0')]={'queue':{'type':_0x4c34('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x4c34('0x1'),'required':!![]},'penalty':{'type':_0x4c34('0x2'),'required':![]},'paused':{'type':_0x4c34('0x3'),'required':![]}};exports[_0x4c34('0x4')]={'queue':{'type':_0x4c34('0x1'),'required':!![]},'interface':{'type':_0x4c34('0x1'),'required':!![]}};exports[_0x4c34('0x5')]={'interface':{'type':_0x4c34('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x4c34('0x6')]={'module':{'type':_0x4c34('0x1'),'required':![]}};exports[_0x4c34('0x7')]={'uniqueid':{'type':_0x4c34('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x4c34('0x1'),'required':!![]},'filename':{'type':_0x4c34('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x4c34('0x1')}};exports[_0x4c34('0x8')]={'uniqueid':{'type':_0x4c34('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x4c34('0x1'),'required':!![]},'exten':{'type':_0x4c34('0x1'),'required':!![]},'context':{'type':_0x4c34('0x1')}}; \ No newline at end of file +var _0xce98=['voicechannel','voicequeuechannelredirect','queueadd','string','boolean','voicequeuechannel'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xce98,0x19a));var _0x8ce9=function(_0x55aef1,_0x21902f){_0x55aef1=_0x55aef1-0x0;var _0x21b2e5=_0xce98[_0x55aef1];return _0x21b2e5;};'use strict';exports[_0x8ce9('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8ce9('0x1'),'required':!![]},'membername':{'type':_0x8ce9('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x8ce9('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x8ce9('0x1'),'required':!![]},'interface':{'type':_0x8ce9('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x8ce9('0x2')},'reason':{'type':_0x8ce9('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x8ce9('0x1'),'required':![]}};exports[_0x8ce9('0x3')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8ce9('0x4')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x8ce9('0x1')},'format':{'type':_0x8ce9('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x8ce9('0x5')]={'uniqueid':{'type':_0x8ce9('0x1'),'required':!![]},'exten':{'type':_0x8ce9('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index a149c5a..20ff94b 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 _0xd62a=['outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','length','isUndefined','mergeFromDatabase','telephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','faxAccounts','exports','bluebird','util','moment','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','voiceQueues','triggers','voiceExtensions','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x599777,_0x53c7e4){var _0x407929=function(_0x154380){while(--_0x154380){_0x599777['push'](_0x599777['shift']());}};_0x407929(++_0x53c7e4);}(_0xd62a,0xa3));var _0xad62=function(_0x2f424b,_0x105874){_0x2f424b=_0x2f424b-0x0;var _0x4d25d3=_0xd62a[_0x2f424b];return _0x4d25d3;};'use strict';var BPromise=require(_0xad62('0x0'));var util=require(_0xad62('0x1'));var _=require('lodash');var moment=require(_0xad62('0x2'));var Agent=require('../model/agent');var Telephone=require(_0xad62('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xad62('0x4'));var Trigger=require(_0xad62('0x5'));var Template=require(_0xad62('0x6'));var Campaign=require(_0xad62('0x7'));var VoiceExtension=require(_0xad62('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xad62('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xad62('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xad62('0xb'));var VtigerAccount=require(_0xad62('0xc'));var ServicenowAccount=require(_0xad62('0xd'));var Dynamics365Account=require(_0xad62('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xad62('0xf'));var Realtime=function(){this[_0xad62('0x10')]={};this['telephones']={};this['trunks']={};this[_0xad62('0x11')]={};this[_0xad62('0x12')]={};this['campaigns']={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xad62('0x13')]={};this['channels']={};this[_0xad62('0x14')]={};this[_0xad62('0x15')]={};this[_0xad62('0x16')]={};this[_0xad62('0x17')]={};this['zendeskAccounts']={};this[_0xad62('0x18')]={};this[_0xad62('0x19')]={};this[_0xad62('0x1a')]={};this[_0xad62('0x1b')]={};this['deskAccounts']={};this[_0xad62('0x1c')]={};this[_0xad62('0x1d')]={};this[_0xad62('0x1e')]={};this[_0xad62('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x385e09,_0x52515e,_0x47a7a6){var _0xc124c1=_[_0xad62('0x20')](_0x385e09,function(_0xec04bc,_0x3e30e5){return _0xec04bc[_0x47a7a6];});for(var _0x335b30 in _0x52515e){if(_0x52515e['hasOwnProperty'](_0x335b30)){if(!_0xc124c1[_0x335b30]){delete _0x52515e[_0x335b30];}}}}function freeIsNotKeySip(_0xdae0f8,_0x504824){var _0x452955=_[_0xad62('0x20')](_0xdae0f8,function(_0x355838,_0xa2b17d){return util['format']('SIP/%s',_0x355838[_0xad62('0x21')]);});for(var _0x2c8810 in _0x504824){if(_0x504824[_0xad62('0x22')](_0x2c8810)){if(!_0x452955[_0x2c8810]){delete _0x504824[_0x2c8810];}}}}function freeIsNotKeyAgent(_0x594e14,_0x584ddf){var _0x13968d=_['mapKeys'](_0x594e14,function(_0xeba74c,_0x487102){var _0x552d81=_[_0xad62('0x23')](_0xeba74c[_0xad62('0x24')])?util[_0xad62('0x25')](_0xad62('0x26'),_0xeba74c['name']):_0xeba74c[_0xad62('0x24')];return _0x552d81;});for(var _0x4b4bf6 in _0x584ddf){if(_0x584ddf[_0xad62('0x22')](_0x4b4bf6)){if(!_0x13968d[_0x4b4bf6]){delete _0x584ddf[_0x4b4bf6];}}}}function clearVoiceCallReports(_0x2476be){_0x2476be[_0xad62('0x27')]=0x0;_0x2476be[_0xad62('0x28')]=0x0;_0x2476be[_0xad62('0x29')]=0x0;_0x2476be[_0xad62('0x2a')]=0x0;_0x2476be[_0xad62('0x2b')]=0x0;}function clearCampaigns(_0x286533){if(!_[_0xad62('0x2c')](_0x286533)){for(var _0x54744a in _0x286533){if(_0x286533[_0xad62('0x22')](_0x54744a)){_0x286533[_0x54744a][_0xad62('0x2d')]=0x0;_0x286533[_0x54744a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x512b9b){if(!_[_0xad62('0x2c')](_0x512b9b)){for(var _0x4e956c in _0x512b9b){if(_0x512b9b[_0xad62('0x22')](_0x4e956c)){_0x512b9b[_0x4e956c]['total']=0x0;_0x512b9b[_0x4e956c][_0xad62('0x28')]=0x0;_0x512b9b[_0x4e956c]['unmanaged']=0x0;_0x512b9b[_0x4e956c][_0xad62('0x2e')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x29')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x2a')]=0x0;_0x512b9b[_0x4e956c]['sumBillable']=0x0;_0x512b9b[_0x4e956c][_0xad62('0x2f')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x30')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x31')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x32')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x33')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x34')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x35')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x36')]=0x0;_0x512b9b[_0x4e956c]['outboundBlacklistCallsDay']=0x0;_0x512b9b[_0x4e956c][_0xad62('0x37')]=0x0;_0x512b9b[_0x4e956c]['outboundRejectCallsDay']=0x0;_0x512b9b[_0x4e956c][_0xad62('0x38')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x2f')]=0x0;_0x512b9b[_0x4e956c][_0xad62('0x39')]=0x0;_0x512b9b[_0x4e956c]['queueStatusComplete']=!![];}}}}Realtime[_0xad62('0x3a')]['mergeFromDatabase']=function(_0x192ee0,_0x2d5e7c){for(var _0x176915 in _0x2d5e7c){if(_0x192ee0['hasOwnProperty'](_0x176915)){_0x192ee0[_0x176915]=_0x2d5e7c[_0x176915];}}};Realtime[_0xad62('0x3a')]['initAgents']=function(){var _0x457c72=this;return function(_0x55c3b3){if(_0x55c3b3){freeIsNotKeyAgent(_0x55c3b3,_0x457c72['agents']);for(var _0x4eac87=0x0,_0x1e9a34={},_0xfe5aef={};_0x4eac87<_0x55c3b3[_0xad62('0x3b')];_0x4eac87+=0x1){_0x1e9a34=_0x55c3b3[_0x4eac87];var _0xaf3714=_['isNil'](_0x1e9a34['interface'])?util[_0xad62('0x25')](_0xad62('0x26'),_0x1e9a34[_0xad62('0x21')]):_0x1e9a34['interface'];if(_[_0xad62('0x3c')](_0x457c72[_0xad62('0x10')][_0xaf3714])){_0x457c72[_0xad62('0x10')][_0xaf3714]=new Agent(_0x1e9a34);}else{_0x457c72[_0xad62('0x3d')](_0x457c72[_0xad62('0x10')][_0xaf3714],_0x1e9a34);}}}return _0x457c72['agents'];};};Realtime['prototype']['initTelephones']=function(){var _0x17c896=this;return function(_0x580ca6){if(_0x580ca6){freeIsNotKeySip(_0x580ca6,_0x17c896[_0xad62('0x3e')]);for(var _0x1b7f7f=0x0,_0x43f2e5={},_0x384cfd={};_0x1b7f7f<_0x580ca6[_0xad62('0x3b')];_0x1b7f7f+=0x1){_0x43f2e5=_0x580ca6[_0x1b7f7f];if(_['isUndefined'](_0x17c896[_0xad62('0x3e')][util[_0xad62('0x25')](_0xad62('0x26'),_0x43f2e5[_0xad62('0x21')])])){_0x17c896[_0xad62('0x3e')][util[_0xad62('0x25')](_0xad62('0x26'),_0x43f2e5[_0xad62('0x21')])]=new Telephone(_0x43f2e5);}else{_0x17c896[_0xad62('0x3d')](_0x17c896[_0xad62('0x3e')][util[_0xad62('0x25')](_0xad62('0x26'),_0x43f2e5[_0xad62('0x21')])],_0x43f2e5);}}}return _0x17c896[_0xad62('0x3e')];};};Realtime[_0xad62('0x3a')][_0xad62('0x3f')]=function(){var _0x279189=this;return function(_0x24baa5){if(_0x24baa5){freeIsNotKeySip(_0x24baa5,_0x279189['trunks']);for(var _0x54bbdf=0x0,_0xbc6953={},_0x29f6b1={};_0x54bbdf<_0x24baa5[_0xad62('0x3b')];_0x54bbdf+=0x1){_0xbc6953=_0x24baa5[_0x54bbdf];if(_['isUndefined'](_0x279189[_0xad62('0x40')][util[_0xad62('0x25')](_0xad62('0x26'),_0xbc6953[_0xad62('0x21')])])){_0x279189[_0xad62('0x40')][util[_0xad62('0x25')](_0xad62('0x26'),_0xbc6953[_0xad62('0x21')])]=new Trunk(_0xbc6953);}else{_0x279189[_0xad62('0x3d')](_0x279189['trunks'][util[_0xad62('0x25')](_0xad62('0x26'),_0xbc6953[_0xad62('0x21')])],_0xbc6953);}}}return _0x279189[_0xad62('0x40')];};};Realtime[_0xad62('0x3a')][_0xad62('0x41')]=function(){var _0x91552c=this;return function(_0x5a6c22){if(_0x5a6c22){freeIsNotKey(_0x5a6c22,_0x91552c[_0xad62('0x11')],'name');for(var _0x2f0b40=0x0,_0xa6b4f9={},_0x4bfcf9={};_0x2f0b40<_0x5a6c22['length'];_0x2f0b40+=0x1){_0xa6b4f9=_0x5a6c22[_0x2f0b40];if(_['isUndefined'](_0x91552c[_0xad62('0x11')][_0xa6b4f9[_0xad62('0x21')]])){_0x91552c[_0xad62('0x11')][_0xa6b4f9[_0xad62('0x21')]]=new VoiceQueue(_0xa6b4f9);}else{_0x91552c['mergeFromDatabase'](_0x91552c[_0xad62('0x11')][_0xa6b4f9[_0xad62('0x21')]],_0xa6b4f9);}}}return _0x91552c[_0xad62('0x11')];};};Realtime[_0xad62('0x3a')][_0xad62('0x42')]=function(){var _0x4d0555=this;return function(_0x2c269b){if(_0x2c269b){freeIsNotKey(_0x2c269b,_0x4d0555[_0xad62('0x12')],'id');for(var _0x5298da=0x0,_0x5a8758={},_0x480c01={};_0x5298da<_0x2c269b[_0xad62('0x3b')];_0x5298da+=0x1){_0x5a8758=_0x2c269b[_0x5298da];if(_[_0xad62('0x3c')](_0x4d0555[_0xad62('0x12')][_0x5a8758['id']])){_0x4d0555[_0xad62('0x12')][_0x5a8758['id']]=new Trigger(_0x5a8758);}else{_0x4d0555[_0xad62('0x3d')](_0x4d0555['triggers'][_0x5a8758['id']],_0x5a8758);}}}return _0x4d0555['triggers'];};};Realtime['prototype'][_0xad62('0x43')]=function(){var _0x5d5e03=this;return function(_0x3cec37){if(_0x3cec37){freeIsNotKey(_0x3cec37,_0x5d5e03[_0xad62('0x44')],'id');for(var _0x76ccd9=0x0,_0x17610a={},_0x1f7ae1={};_0x76ccd9<_0x3cec37['length'];_0x76ccd9+=0x1){_0x17610a=_0x3cec37[_0x76ccd9];if(_[_0xad62('0x3c')](_0x5d5e03[_0xad62('0x44')][_0x17610a['id']])){_0x5d5e03['templates'][_0x17610a['id']]=new Template(_0x17610a);}else{_0x5d5e03[_0xad62('0x3d')](_0x5d5e03[_0xad62('0x44')][_0x17610a['id']],_0x17610a);}}}return _0x5d5e03[_0xad62('0x44')];};};Realtime[_0xad62('0x3a')][_0xad62('0x45')]=function(){var _0x489a2d=this;return function(_0x2d9ef2){if(_0x2d9ef2){freeIsNotKey(_0x2d9ef2,_0x489a2d[_0xad62('0x46')],'id');for(var _0x41c15d=0x0,_0xccc07={},_0x249e55={};_0x41c15d<_0x2d9ef2[_0xad62('0x3b')];_0x41c15d+=0x1){_0xccc07=_0x2d9ef2[_0x41c15d];if(_['isUndefined'](_0x489a2d[_0xad62('0x46')][_0xccc07['id']])){_0x489a2d['zendeskAccounts'][_0xccc07['id']]=new ZendeskAccount(_0xccc07);}else{_0x489a2d[_0xad62('0x3d')](_0x489a2d[_0xad62('0x46')][_0xccc07['id']],_0xccc07);}}}return _0x489a2d[_0xad62('0x46')];};};Realtime[_0xad62('0x3a')][_0xad62('0x47')]=function(){var _0x280d38=this;return function(_0x1c3418){if(_0x1c3418){freeIsNotKey(_0x1c3418,_0x280d38[_0xad62('0x18')],'id');for(var _0x3d0e91=0x0,_0xda338={},_0x47a4b3={};_0x3d0e91<_0x1c3418[_0xad62('0x3b')];_0x3d0e91+=0x1){_0xda338=_0x1c3418[_0x3d0e91];if(_['isUndefined'](_0x280d38[_0xad62('0x18')][_0xda338['id']])){_0x280d38['salesforceAccounts'][_0xda338['id']]=new SalesforceAccount(_0xda338);}else{_0x280d38[_0xad62('0x3d')](_0x280d38[_0xad62('0x18')][_0xda338['id']],_0xda338);}}}return _0x280d38[_0xad62('0x18')];};};Realtime[_0xad62('0x3a')][_0xad62('0x48')]=function(){var _0x596883=this;return function(_0x3b9539){if(_0x3b9539){freeIsNotKey(_0x3b9539,_0x596883[_0xad62('0x1a')],'id');for(var _0x37fa05=0x0,_0x9fed7c={},_0x18da0f={};_0x37fa05<_0x3b9539[_0xad62('0x3b')];_0x37fa05+=0x1){_0x9fed7c=_0x3b9539[_0x37fa05];if(_['isUndefined'](_0x596883[_0xad62('0x1a')][_0x9fed7c['id']])){_0x596883[_0xad62('0x1a')][_0x9fed7c['id']]=new FreshdeskAccount(_0x9fed7c);}else{_0x596883[_0xad62('0x3d')](_0x596883[_0xad62('0x1a')][_0x9fed7c['id']],_0x9fed7c);}}}return _0x596883[_0xad62('0x1a')];};};Realtime[_0xad62('0x3a')][_0xad62('0x49')]=function(){var _0x2fe224=this;return function(_0xf97912){if(_0xf97912){freeIsNotKey(_0xf97912,_0x2fe224[_0xad62('0x1b')],'id');for(var _0x287bdf=0x0,_0x28d112={},_0x48871d={};_0x287bdf<_0xf97912[_0xad62('0x3b')];_0x287bdf+=0x1){_0x28d112=_0xf97912[_0x287bdf];if(_[_0xad62('0x3c')](_0x2fe224['zohoAccounts'][_0x28d112['id']])){_0x2fe224[_0xad62('0x1b')][_0x28d112['id']]=new ZohoAccount(_0x28d112);}else{_0x2fe224[_0xad62('0x3d')](_0x2fe224[_0xad62('0x1b')][_0x28d112['id']],_0x28d112);}}}return _0x2fe224[_0xad62('0x1b')];};};Realtime[_0xad62('0x3a')][_0xad62('0x4a')]=function(){var _0x24d949=this;return function(_0x15c1e8){if(_0x15c1e8){freeIsNotKey(_0x15c1e8,_0x24d949[_0xad62('0x4b')],'id');for(var _0x3d3d11=0x0,_0x56f499={},_0x58f049={};_0x3d3d11<_0x15c1e8[_0xad62('0x3b')];_0x3d3d11+=0x1){_0x56f499=_0x15c1e8[_0x3d3d11];if(_[_0xad62('0x3c')](_0x24d949[_0xad62('0x4b')][_0x56f499['id']])){_0x24d949['deskAccounts'][_0x56f499['id']]=new DeskAccount(_0x56f499);}else{_0x24d949[_0xad62('0x3d')](_0x24d949[_0xad62('0x4b')][_0x56f499['id']],_0x56f499);}}}return _0x24d949['deskAccounts'];};};Realtime[_0xad62('0x3a')][_0xad62('0x4c')]=function(){var _0x2434e7=this;return function(_0x306ddd){if(_0x306ddd){freeIsNotKey(_0x306ddd,_0x2434e7[_0xad62('0x19')],'id');for(var _0x5caf2c=0x0,_0x40d873={},_0x3df50b={};_0x5caf2c<_0x306ddd[_0xad62('0x3b')];_0x5caf2c+=0x1){_0x40d873=_0x306ddd[_0x5caf2c];if(_[_0xad62('0x3c')](_0x2434e7[_0xad62('0x19')][_0x40d873['id']])){_0x2434e7[_0xad62('0x19')][_0x40d873['id']]=new SugarcrmAccount(_0x40d873);}else{_0x2434e7[_0xad62('0x3d')](_0x2434e7[_0xad62('0x19')][_0x40d873['id']],_0x40d873);}}}return _0x2434e7['sugarcrmAccounts'];};};Realtime['prototype'][_0xad62('0x4d')]=function(){var _0xc63134=this;return function(_0xf6af1){if(_0xf6af1){freeIsNotKey(_0xf6af1,_0xc63134['vtigerAccounts'],'id');for(var _0x1d97bf=0x0,_0x1f0c55={},_0x5d509e={};_0x1d97bf<_0xf6af1[_0xad62('0x3b')];_0x1d97bf+=0x1){_0x1f0c55=_0xf6af1[_0x1d97bf];if(_[_0xad62('0x3c')](_0xc63134['vtigerAccounts'][_0x1f0c55['id']])){_0xc63134['vtigerAccounts'][_0x1f0c55['id']]=new VtigerAccount(_0x1f0c55);}else{_0xc63134['mergeFromDatabase'](_0xc63134[_0xad62('0x1c')][_0x1f0c55['id']],_0x1f0c55);}}}return _0xc63134[_0xad62('0x1c')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x2660ca=this;return function(_0x3a9d2a){if(_0x3a9d2a){freeIsNotKey(_0x3a9d2a,_0x2660ca[_0xad62('0x1d')],'id');for(var _0x4c6b60=0x0,_0x24aa3e={},_0x17ad50={};_0x4c6b60<_0x3a9d2a['length'];_0x4c6b60+=0x1){_0x24aa3e=_0x3a9d2a[_0x4c6b60];if(_[_0xad62('0x3c')](_0x2660ca[_0xad62('0x1d')][_0x24aa3e['id']])){_0x2660ca[_0xad62('0x1d')][_0x24aa3e['id']]=new ServicenowAccount(_0x24aa3e);}else{_0x2660ca[_0xad62('0x3d')](_0x2660ca[_0xad62('0x1d')][_0x24aa3e['id']],_0x24aa3e);}}}return _0x2660ca[_0xad62('0x1d')];};};Realtime['prototype'][_0xad62('0x4e')]=function(){var _0x121369=this;return function(_0x14f2ad){if(_0x14f2ad){freeIsNotKey(_0x14f2ad,_0x121369[_0xad62('0x1e')],'id');for(var _0x268c1f=0x0,_0x3301d7={},_0x5afe01={};_0x268c1f<_0x14f2ad[_0xad62('0x3b')];_0x268c1f+=0x1){_0x3301d7=_0x14f2ad[_0x268c1f];if(_[_0xad62('0x3c')](_0x121369[_0xad62('0x1e')][_0x3301d7['id']])){_0x121369['dynamics365Accounts'][_0x3301d7['id']]=new Dynamics365Account(_0x3301d7);}else{_0x121369['mergeFromDatabase'](_0x121369[_0xad62('0x1e')][_0x3301d7['id']],_0x3301d7);}}}return _0x121369[_0xad62('0x1e')];};};Realtime[_0xad62('0x3a')][_0xad62('0x4f')]=function(){var _0x569f64=this;return function(_0x5c985c){if(_0x5c985c){freeIsNotKey(_0x5c985c,_0x569f64[_0xad62('0x1f')],'id');for(var _0x2c0c48=0x0,_0x1513ce={},_0x258a27={};_0x2c0c48<_0x5c985c['length'];_0x2c0c48+=0x1){_0x1513ce=_0x5c985c[_0x2c0c48];if(_['isUndefined'](_0x569f64[_0xad62('0x1f')][_0x1513ce['id']])){_0x569f64[_0xad62('0x1f')][_0x1513ce['id']]=new FreshsalesAccount(_0x1513ce);}else{_0x569f64[_0xad62('0x3d')](_0x569f64['freshsalesAccounts'][_0x1513ce['id']],_0x1513ce);}}}return _0x569f64[_0xad62('0x1f')];};};Realtime[_0xad62('0x3a')][_0xad62('0x50')]=function(){var _0x5b67bb=this;return function(_0x37d958){for(var _0x456ea6=0x0;_0x456ea6<_0x37d958[_0xad62('0x3b')];_0x456ea6+=0x1){_['merge'](_0x5b67bb[_0xad62('0x11')][_0x37d958[_0x456ea6]['name']],_0x37d958[_0x456ea6]);}return _0x5b67bb[_0xad62('0x11')];};};Realtime[_0xad62('0x3a')][_0xad62('0x51')]=function(){var _0xcab8ab=this;return function(_0x4b4d5c){clearVoiceQueues(_0xcab8ab[_0xad62('0x11')]);if(_0x4b4d5c){_0x4b4d5c=_['groupBy'](_0x4b4d5c,_0xad62('0x52'));for(var _0x44a111 in _0x4b4d5c){if(_0x4b4d5c['hasOwnProperty'](_0x44a111)){var _0x8b6724={};for(var _0x38ab06=0x0;_0x38ab06<_0x4b4d5c[_0x44a111]['length'];_0x38ab06+=0x1){var _0x77626d=_0x4b4d5c[_0x44a111][_0x38ab06]['queue'];if(_0xcab8ab[_0xad62('0x11')][_0x77626d]){if(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x53')]){_0xcab8ab['voiceQueues'][_0x77626d][_0xad62('0x54')]+=0x1;}if(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x55')]){_0xcab8ab[_0xad62('0x11')][_0x77626d]['abandoned']+=0x1;}_0xcab8ab[_0xad62('0x11')][_0x77626d][_0xad62('0x29')]+=moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x56')])[_0xad62('0x57')](moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x58')]),_0xad62('0x59'))||0x0;if(_0x38ab06===_0x4b4d5c[_0x44a111][_0xad62('0x3b')]-0x1){_0xcab8ab[_0xad62('0x11')][_0x77626d]['sumDuration']+=moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x5a')]||_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x5b')]||_0x4b4d5c[_0x44a111][_0x38ab06]['queuecallerexitAt'])['diff'](moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x58')]),'seconds')||0x0;_0xcab8ab[_0xad62('0x11')][_0x77626d][_0xad62('0x27')]+=0x1;if(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x5c')]){_0xcab8ab[_0xad62('0x11')][_0x77626d][_0xad62('0x28')]+=0x1;_0xcab8ab[_0xad62('0x11')][_0x77626d]['sumBillable']+=moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x5a')])['diff'](moment(_0x4b4d5c[_0x44a111][_0x38ab06][_0xad62('0x56')]),_0xad62('0x59'))||0x0;}}else{_0xcab8ab[_0xad62('0x11')][_0x77626d][_0xad62('0x2a')]+=_0xcab8ab[_0xad62('0x11')][_0x77626d][_0xad62('0x29')]||0x0;}}}}}}return _0xcab8ab[_0xad62('0x11')];};};Realtime['prototype'][_0xad62('0x5d')]=function(){var _0x34d947=this;return function(_0x1ab7d1){clearVoiceCallReports(_0x34d947[_0xad62('0x5e')]);if(_0x1ab7d1){for(var _0x613899=0x0;_0x613899<_0x1ab7d1[_0xad62('0x3b')];_0x613899+=0x1){_0x34d947['outbound'][_0xad62('0x27')]+=0x1;_0x34d947['outbound'][_0xad62('0x2a')]+=_0x1ab7d1[_0x613899][_0xad62('0x5f')];if(_0x1ab7d1[_0x613899][_0xad62('0x60')]===_0xad62('0x61')){_0x34d947[_0xad62('0x5e')][_0xad62('0x28')]+=0x1;_0x34d947[_0xad62('0x5e')][_0xad62('0x29')]+=_0x1ab7d1[_0x613899][_0xad62('0x5f')]-_0x1ab7d1[_0x613899]['billableseconds']||0x0;_0x34d947[_0xad62('0x5e')]['sumBillable']+=_0x1ab7d1[_0x613899][_0xad62('0x62')];}}}return _0x34d947[_0xad62('0x5e')];};};Realtime[_0xad62('0x3a')][_0xad62('0x63')]=function(){var _0x1abe92=this;return function(_0x3c4fd5){if(_0x3c4fd5){freeIsNotKey(_0x3c4fd5,_0x1abe92[_0xad62('0x64')],_0xad62('0x21'));for(var _0x284d9f=0x0,_0xbbf9d9={};_0x284d9f<_0x3c4fd5[_0xad62('0x3b')];_0x284d9f+=0x1){_0xbbf9d9=_0x3c4fd5[_0x284d9f];if(_[_0xad62('0x3c')](_0x1abe92['campaigns'][_0xbbf9d9[_0xad62('0x21')]])){_0x1abe92[_0xad62('0x64')][_0xbbf9d9[_0xad62('0x21')]]=new Campaign(_0xbbf9d9);}else{_0x1abe92[_0xad62('0x3d')](_0x1abe92[_0xad62('0x64')][_0xbbf9d9[_0xad62('0x21')]],_0xbbf9d9);_0x1abe92[_0xad62('0x64')][_0xbbf9d9[_0xad62('0x21')]][_0xad62('0x65')]=_0xbbf9d9['SquareProject']?_0xbbf9d9[_0xad62('0x66')][_0xad62('0x21')]:undefined;}}}return _0x1abe92[_0xad62('0x64')];};};Realtime[_0xad62('0x3a')][_0xad62('0x67')]=function(){var _0x35daf8=this;return function(_0x23cbe3){if(_0x23cbe3){freeIsNotKey(_0x23cbe3,_0x35daf8[_0xad62('0x13')],'id');for(var _0x47ce7c=0x0,_0x358381={};_0x47ce7c<_0x23cbe3[_0xad62('0x3b')];_0x47ce7c+=0x1){_0x358381=_0x23cbe3[_0x47ce7c];if(_[_0xad62('0x3c')](_0x35daf8['voiceExtensions'][_0x358381['id']])){_0x35daf8[_0xad62('0x13')][_0x358381['id']]=new VoiceExtension(_0x358381);}else{_0x35daf8[_0xad62('0x3d')](_0x35daf8[_0xad62('0x13')][_0x358381['id']],_0x358381);}}}return _0x35daf8[_0xad62('0x13')];};};Realtime[_0xad62('0x3a')][_0xad62('0x68')]=function(){var _0x320222=this;return function(_0x549749){clearCampaigns(_0x320222[_0xad62('0x64')]);for(var _0x306040=0x0;_0x306040<_0x549749[_0xad62('0x3b')];_0x306040+=0x1){_[_0xad62('0x69')](_0x320222[_0xad62('0x64')][_0x549749[_0x306040][_0xad62('0x21')]],_0x549749[_0x306040]);}return _0x320222[_0xad62('0x64')];};};Realtime[_0xad62('0x3a')]['initFaxAccounts']=function(){var _0x4ed16a=this;return function(_0x49bd04){if(_0x49bd04){freeIsNotKey(_0x49bd04,_0x4ed16a[_0xad62('0x6a')],'id');for(var _0x24a61d=0x0,_0x5d6bec={},_0x44b567={};_0x24a61d<_0x49bd04['length'];_0x24a61d+=0x1){_0x5d6bec=_0x49bd04[_0x24a61d];if(_['isUndefined'](_0x4ed16a[_0xad62('0x6a')][_0x5d6bec['id']])){_0x4ed16a['faxAccounts'][_0x5d6bec['id']]=new FaxAccount(_0x5d6bec);}else{_0x4ed16a[_0xad62('0x3d')](_0x4ed16a[_0xad62('0x6a')][_0x5d6bec['id']],_0x5d6bec);}}}return _0x4ed16a[_0xad62('0x6a')];};};module[_0xad62('0x6b')]=Realtime; \ No newline at end of file +var _0x94eb=['../model/faxAccount','telephones','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','SIP/%s','name','mapKeys','isNil','interface','format','answered','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','length','isUndefined','trunks','initTriggers','triggers','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','total','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/zohoAccount','../model/servicenowAccount'];(function(_0x224d4a,_0x3bf5f8){var _0x42b617=function(_0x3830d2){while(--_0x3830d2){_0x224d4a['push'](_0x224d4a['shift']());}};_0x42b617(++_0x3bf5f8);}(_0x94eb,0x12a));var _0xb94e=function(_0x377942,_0x410104){_0x377942=_0x377942-0x0;var _0x46603f=_0x94eb[_0x377942];return _0x46603f;};'use strict';var BPromise=require(_0xb94e('0x0'));var util=require(_0xb94e('0x1'));var _=require(_0xb94e('0x2'));var moment=require(_0xb94e('0x3'));var Agent=require(_0xb94e('0x4'));var Telephone=require(_0xb94e('0x5'));var Trunk=require(_0xb94e('0x6'));var VoiceQueue=require(_0xb94e('0x7'));var Trigger=require(_0xb94e('0x8'));var Template=require('../model/template');var Campaign=require(_0xb94e('0x9'));var VoiceExtension=require(_0xb94e('0xa'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xb94e('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xb94e('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xb94e('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb94e('0xe'));var Realtime=function(){this['agents']={};this[_0xb94e('0xf')]={};this['trunks']={};this[_0xb94e('0x10')]={};this['triggers']={};this[_0xb94e('0x11')]={};this[_0xb94e('0x12')]={};this[_0xb94e('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb94e('0x14')]={};this[_0xb94e('0x15')]={};this[_0xb94e('0x16')]={};this[_0xb94e('0x17')]={};this[_0xb94e('0x18')]={};this['settings']={};this[_0xb94e('0x19')]={};this[_0xb94e('0x1a')]={};this['sugarcrmAccounts']={};this[_0xb94e('0x1b')]={};this[_0xb94e('0x1c')]={};this[_0xb94e('0x1d')]={};this[_0xb94e('0x1e')]={};this['servicenowAccounts']={};this[_0xb94e('0x1f')]={};this[_0xb94e('0x20')]={};this[_0xb94e('0x21')]={};};function freeIsNotKey(_0x249307,_0x33b59b,_0x314b68){var _0x2df568=_['mapKeys'](_0x249307,function(_0x2be70b,_0x2716bf){return _0x2be70b[_0x314b68];});for(var _0x1974b8 in _0x33b59b){if(_0x33b59b[_0xb94e('0x22')](_0x1974b8)){if(!_0x2df568[_0x1974b8]){delete _0x33b59b[_0x1974b8];}}}}function freeIsNotKeySip(_0x1a52ba,_0x276faa){var _0x22fce4=_['mapKeys'](_0x1a52ba,function(_0x2b4cd7,_0x1ae454){return util['format'](_0xb94e('0x23'),_0x2b4cd7[_0xb94e('0x24')]);});for(var _0x12f31e in _0x276faa){if(_0x276faa[_0xb94e('0x22')](_0x12f31e)){if(!_0x22fce4[_0x12f31e]){delete _0x276faa[_0x12f31e];}}}}function freeIsNotKeyAgent(_0x421c37,_0x57043b){var _0x2260da=_[_0xb94e('0x25')](_0x421c37,function(_0x51ae2d,_0xb879e7){var _0xa56a7=_[_0xb94e('0x26')](_0x51ae2d[_0xb94e('0x27')])?util[_0xb94e('0x28')](_0xb94e('0x23'),_0x51ae2d['name']):_0x51ae2d['interface'];return _0xa56a7;});for(var _0x1c36d4 in _0x57043b){if(_0x57043b[_0xb94e('0x22')](_0x1c36d4)){if(!_0x2260da[_0x1c36d4]){delete _0x57043b[_0x1c36d4];}}}}function clearVoiceCallReports(_0x43df2c){_0x43df2c['total']=0x0;_0x43df2c[_0xb94e('0x29')]=0x0;_0x43df2c['sumHoldTime']=0x0;_0x43df2c[_0xb94e('0x2a')]=0x0;_0x43df2c[_0xb94e('0x2b')]=0x0;}function clearCampaigns(_0x59c34e){if(!_['isEmpty'](_0x59c34e)){for(var _0x1fb24b in _0x59c34e){if(_0x59c34e['hasOwnProperty'](_0x1fb24b)){_0x59c34e[_0x1fb24b][_0xb94e('0x2c')]=0x0;_0x59c34e[_0x1fb24b][_0xb94e('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x2cd54b){if(!_['isEmpty'](_0x2cd54b)){for(var _0x48372d in _0x2cd54b){if(_0x2cd54b[_0xb94e('0x22')](_0x48372d)){_0x2cd54b[_0x48372d]['total']=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x29')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x2e')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x2f')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x30')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x2a')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x2b')]=0x0;_0x2cd54b[_0x48372d]['outboundAnswerAgiCallsDay']=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x31')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x32')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x33')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x34')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x35')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x36')]=0x0;_0x2cd54b[_0x48372d]['outboundDropCallsDayCallersExit']=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x37')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x38')]=0x0;_0x2cd54b[_0x48372d]['outboundRejectCallsDay']=0x0;_0x2cd54b[_0x48372d]['outboundReCallsDay']=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x39')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x3a')]=0x0;_0x2cd54b[_0x48372d][_0xb94e('0x3b')]=!![];}}}}Realtime['prototype'][_0xb94e('0x3c')]=function(_0x16d45c,_0xdb4ce9){for(var _0x4ec78b in _0xdb4ce9){if(_0x16d45c[_0xb94e('0x22')](_0x4ec78b)){_0x16d45c[_0x4ec78b]=_0xdb4ce9[_0x4ec78b];}}};Realtime[_0xb94e('0x3d')][_0xb94e('0x3e')]=function(){var _0x53ccc8=this;return function(_0xa920cf){if(_0xa920cf){freeIsNotKeyAgent(_0xa920cf,_0x53ccc8[_0xb94e('0x3f')]);for(var _0x1a7280=0x0,_0x3f0ef3={},_0x113836={};_0x1a7280<_0xa920cf[_0xb94e('0x40')];_0x1a7280+=0x1){_0x3f0ef3=_0xa920cf[_0x1a7280];var _0xe46f2b=_[_0xb94e('0x26')](_0x3f0ef3[_0xb94e('0x27')])?util[_0xb94e('0x28')](_0xb94e('0x23'),_0x3f0ef3[_0xb94e('0x24')]):_0x3f0ef3[_0xb94e('0x27')];if(_['isUndefined'](_0x53ccc8[_0xb94e('0x3f')][_0xe46f2b])){_0x53ccc8['agents'][_0xe46f2b]=new Agent(_0x3f0ef3);}else{_0x53ccc8[_0xb94e('0x3c')](_0x53ccc8[_0xb94e('0x3f')][_0xe46f2b],_0x3f0ef3);}}}return _0x53ccc8[_0xb94e('0x3f')];};};Realtime['prototype']['initTelephones']=function(){var _0x4249ee=this;return function(_0x73fbe1){if(_0x73fbe1){freeIsNotKeySip(_0x73fbe1,_0x4249ee[_0xb94e('0xf')]);for(var _0x3fb018=0x0,_0xd1984c={},_0xefe1fa={};_0x3fb018<_0x73fbe1[_0xb94e('0x40')];_0x3fb018+=0x1){_0xd1984c=_0x73fbe1[_0x3fb018];if(_[_0xb94e('0x41')](_0x4249ee[_0xb94e('0xf')][util['format'](_0xb94e('0x23'),_0xd1984c[_0xb94e('0x24')])])){_0x4249ee[_0xb94e('0xf')][util[_0xb94e('0x28')](_0xb94e('0x23'),_0xd1984c['name'])]=new Telephone(_0xd1984c);}else{_0x4249ee[_0xb94e('0x3c')](_0x4249ee[_0xb94e('0xf')][util['format'](_0xb94e('0x23'),_0xd1984c[_0xb94e('0x24')])],_0xd1984c);}}}return _0x4249ee[_0xb94e('0xf')];};};Realtime[_0xb94e('0x3d')]['initTrunks']=function(){var _0x49ecfc=this;return function(_0x36d816){if(_0x36d816){freeIsNotKeySip(_0x36d816,_0x49ecfc[_0xb94e('0x42')]);for(var _0x58e517=0x0,_0x3997e7={},_0x37bcc0={};_0x58e517<_0x36d816['length'];_0x58e517+=0x1){_0x3997e7=_0x36d816[_0x58e517];if(_[_0xb94e('0x41')](_0x49ecfc[_0xb94e('0x42')][util[_0xb94e('0x28')]('SIP/%s',_0x3997e7[_0xb94e('0x24')])])){_0x49ecfc[_0xb94e('0x42')][util[_0xb94e('0x28')]('SIP/%s',_0x3997e7[_0xb94e('0x24')])]=new Trunk(_0x3997e7);}else{_0x49ecfc[_0xb94e('0x3c')](_0x49ecfc[_0xb94e('0x42')][util[_0xb94e('0x28')](_0xb94e('0x23'),_0x3997e7[_0xb94e('0x24')])],_0x3997e7);}}}return _0x49ecfc[_0xb94e('0x42')];};};Realtime[_0xb94e('0x3d')]['initVoiceQueues']=function(){var _0x13c010=this;return function(_0x4893c2){if(_0x4893c2){freeIsNotKey(_0x4893c2,_0x13c010[_0xb94e('0x10')],_0xb94e('0x24'));for(var _0x2bc1fb=0x0,_0x7a2090={},_0x565700={};_0x2bc1fb<_0x4893c2[_0xb94e('0x40')];_0x2bc1fb+=0x1){_0x7a2090=_0x4893c2[_0x2bc1fb];if(_[_0xb94e('0x41')](_0x13c010[_0xb94e('0x10')][_0x7a2090[_0xb94e('0x24')]])){_0x13c010['voiceQueues'][_0x7a2090[_0xb94e('0x24')]]=new VoiceQueue(_0x7a2090);}else{_0x13c010[_0xb94e('0x3c')](_0x13c010[_0xb94e('0x10')][_0x7a2090[_0xb94e('0x24')]],_0x7a2090);}}}return _0x13c010[_0xb94e('0x10')];};};Realtime['prototype'][_0xb94e('0x43')]=function(){var _0x3f6533=this;return function(_0x5e0d63){if(_0x5e0d63){freeIsNotKey(_0x5e0d63,_0x3f6533['triggers'],'id');for(var _0x1803d7=0x0,_0x236610={},_0x1a435c={};_0x1803d7<_0x5e0d63[_0xb94e('0x40')];_0x1803d7+=0x1){_0x236610=_0x5e0d63[_0x1803d7];if(_[_0xb94e('0x41')](_0x3f6533[_0xb94e('0x44')][_0x236610['id']])){_0x3f6533[_0xb94e('0x44')][_0x236610['id']]=new Trigger(_0x236610);}else{_0x3f6533[_0xb94e('0x3c')](_0x3f6533[_0xb94e('0x44')][_0x236610['id']],_0x236610);}}}return _0x3f6533[_0xb94e('0x44')];};};Realtime['prototype']['initTemplates']=function(){var _0x4a97b9=this;return function(_0x4adf03){if(_0x4adf03){freeIsNotKey(_0x4adf03,_0x4a97b9[_0xb94e('0x12')],'id');for(var _0x2720a6=0x0,_0x35e008={},_0x4dbef9={};_0x2720a6<_0x4adf03[_0xb94e('0x40')];_0x2720a6+=0x1){_0x35e008=_0x4adf03[_0x2720a6];if(_[_0xb94e('0x41')](_0x4a97b9[_0xb94e('0x12')][_0x35e008['id']])){_0x4a97b9[_0xb94e('0x12')][_0x35e008['id']]=new Template(_0x35e008);}else{_0x4a97b9['mergeFromDatabase'](_0x4a97b9[_0xb94e('0x12')][_0x35e008['id']],_0x35e008);}}}return _0x4a97b9[_0xb94e('0x12')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x45')]=function(){var _0x535ff9=this;return function(_0x4f2bf2){if(_0x4f2bf2){freeIsNotKey(_0x4f2bf2,_0x535ff9['zendeskAccounts'],'id');for(var _0x5bbea0=0x0,_0x395178={},_0x447bd1={};_0x5bbea0<_0x4f2bf2[_0xb94e('0x40')];_0x5bbea0+=0x1){_0x395178=_0x4f2bf2[_0x5bbea0];if(_[_0xb94e('0x41')](_0x535ff9['zendeskAccounts'][_0x395178['id']])){_0x535ff9[_0xb94e('0x19')][_0x395178['id']]=new ZendeskAccount(_0x395178);}else{_0x535ff9[_0xb94e('0x3c')](_0x535ff9[_0xb94e('0x19')][_0x395178['id']],_0x395178);}}}return _0x535ff9[_0xb94e('0x19')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x5e1336=this;return function(_0x3d560d){if(_0x3d560d){freeIsNotKey(_0x3d560d,_0x5e1336[_0xb94e('0x1a')],'id');for(var _0x22ae89=0x0,_0x3dffaf={},_0x231e6d={};_0x22ae89<_0x3d560d['length'];_0x22ae89+=0x1){_0x3dffaf=_0x3d560d[_0x22ae89];if(_['isUndefined'](_0x5e1336['salesforceAccounts'][_0x3dffaf['id']])){_0x5e1336[_0xb94e('0x1a')][_0x3dffaf['id']]=new SalesforceAccount(_0x3dffaf);}else{_0x5e1336[_0xb94e('0x3c')](_0x5e1336[_0xb94e('0x1a')][_0x3dffaf['id']],_0x3dffaf);}}}return _0x5e1336[_0xb94e('0x1a')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x46')]=function(){var _0x55069d=this;return function(_0x3d7a04){if(_0x3d7a04){freeIsNotKey(_0x3d7a04,_0x55069d[_0xb94e('0x1b')],'id');for(var _0x5afc2f=0x0,_0x53f2f4={},_0x58a8bf={};_0x5afc2f<_0x3d7a04[_0xb94e('0x40')];_0x5afc2f+=0x1){_0x53f2f4=_0x3d7a04[_0x5afc2f];if(_['isUndefined'](_0x55069d[_0xb94e('0x1b')][_0x53f2f4['id']])){_0x55069d[_0xb94e('0x1b')][_0x53f2f4['id']]=new FreshdeskAccount(_0x53f2f4);}else{_0x55069d['mergeFromDatabase'](_0x55069d[_0xb94e('0x1b')][_0x53f2f4['id']],_0x53f2f4);}}}return _0x55069d[_0xb94e('0x1b')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x47')]=function(){var _0x14e5c7=this;return function(_0x155de7){if(_0x155de7){freeIsNotKey(_0x155de7,_0x14e5c7[_0xb94e('0x1c')],'id');for(var _0xae312=0x0,_0x408c4c={},_0x2cae90={};_0xae312<_0x155de7['length'];_0xae312+=0x1){_0x408c4c=_0x155de7[_0xae312];if(_['isUndefined'](_0x14e5c7['zohoAccounts'][_0x408c4c['id']])){_0x14e5c7[_0xb94e('0x1c')][_0x408c4c['id']]=new ZohoAccount(_0x408c4c);}else{_0x14e5c7['mergeFromDatabase'](_0x14e5c7['zohoAccounts'][_0x408c4c['id']],_0x408c4c);}}}return _0x14e5c7['zohoAccounts'];};};Realtime['prototype'][_0xb94e('0x48')]=function(){var _0x12fc9c=this;return function(_0x583fd7){if(_0x583fd7){freeIsNotKey(_0x583fd7,_0x12fc9c[_0xb94e('0x1d')],'id');for(var _0x4b3c12=0x0,_0x1c4d80={},_0xa3ea9f={};_0x4b3c12<_0x583fd7[_0xb94e('0x40')];_0x4b3c12+=0x1){_0x1c4d80=_0x583fd7[_0x4b3c12];if(_[_0xb94e('0x41')](_0x12fc9c[_0xb94e('0x1d')][_0x1c4d80['id']])){_0x12fc9c[_0xb94e('0x1d')][_0x1c4d80['id']]=new DeskAccount(_0x1c4d80);}else{_0x12fc9c[_0xb94e('0x3c')](_0x12fc9c[_0xb94e('0x1d')][_0x1c4d80['id']],_0x1c4d80);}}}return _0x12fc9c['deskAccounts'];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x2530b1=this;return function(_0x53a47d){if(_0x53a47d){freeIsNotKey(_0x53a47d,_0x2530b1[_0xb94e('0x49')],'id');for(var _0x347316=0x0,_0x8f3bc4={},_0x56d293={};_0x347316<_0x53a47d[_0xb94e('0x40')];_0x347316+=0x1){_0x8f3bc4=_0x53a47d[_0x347316];if(_[_0xb94e('0x41')](_0x2530b1[_0xb94e('0x49')][_0x8f3bc4['id']])){_0x2530b1[_0xb94e('0x49')][_0x8f3bc4['id']]=new SugarcrmAccount(_0x8f3bc4);}else{_0x2530b1[_0xb94e('0x3c')](_0x2530b1[_0xb94e('0x49')][_0x8f3bc4['id']],_0x8f3bc4);}}}return _0x2530b1['sugarcrmAccounts'];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x4a')]=function(){var _0x52ba6f=this;return function(_0x390c5e){if(_0x390c5e){freeIsNotKey(_0x390c5e,_0x52ba6f[_0xb94e('0x1e')],'id');for(var _0x47a333=0x0,_0x553f57={},_0x115c68={};_0x47a333<_0x390c5e[_0xb94e('0x40')];_0x47a333+=0x1){_0x553f57=_0x390c5e[_0x47a333];if(_['isUndefined'](_0x52ba6f[_0xb94e('0x1e')][_0x553f57['id']])){_0x52ba6f[_0xb94e('0x1e')][_0x553f57['id']]=new VtigerAccount(_0x553f57);}else{_0x52ba6f['mergeFromDatabase'](_0x52ba6f[_0xb94e('0x1e')][_0x553f57['id']],_0x553f57);}}}return _0x52ba6f[_0xb94e('0x1e')];};};Realtime['prototype'][_0xb94e('0x4b')]=function(){var _0x19ff47=this;return function(_0x165c9d){if(_0x165c9d){freeIsNotKey(_0x165c9d,_0x19ff47[_0xb94e('0x4c')],'id');for(var _0x4bee8b=0x0,_0x27b8ac={},_0x385252={};_0x4bee8b<_0x165c9d[_0xb94e('0x40')];_0x4bee8b+=0x1){_0x27b8ac=_0x165c9d[_0x4bee8b];if(_['isUndefined'](_0x19ff47['servicenowAccounts'][_0x27b8ac['id']])){_0x19ff47['servicenowAccounts'][_0x27b8ac['id']]=new ServicenowAccount(_0x27b8ac);}else{_0x19ff47[_0xb94e('0x3c')](_0x19ff47[_0xb94e('0x4c')][_0x27b8ac['id']],_0x27b8ac);}}}return _0x19ff47[_0xb94e('0x4c')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x4d')]=function(){var _0x625707=this;return function(_0x47b982){if(_0x47b982){freeIsNotKey(_0x47b982,_0x625707[_0xb94e('0x1f')],'id');for(var _0x5bc48b=0x0,_0x16ef48={},_0x15df25={};_0x5bc48b<_0x47b982[_0xb94e('0x40')];_0x5bc48b+=0x1){_0x16ef48=_0x47b982[_0x5bc48b];if(_[_0xb94e('0x41')](_0x625707[_0xb94e('0x1f')][_0x16ef48['id']])){_0x625707[_0xb94e('0x1f')][_0x16ef48['id']]=new Dynamics365Account(_0x16ef48);}else{_0x625707[_0xb94e('0x3c')](_0x625707[_0xb94e('0x1f')][_0x16ef48['id']],_0x16ef48);}}}return _0x625707[_0xb94e('0x1f')];};};Realtime['prototype'][_0xb94e('0x4e')]=function(){var _0x599de4=this;return function(_0x1c53cc){if(_0x1c53cc){freeIsNotKey(_0x1c53cc,_0x599de4['freshsalesAccounts'],'id');for(var _0xf9f401=0x0,_0x1d110e={},_0xa64ff5={};_0xf9f401<_0x1c53cc[_0xb94e('0x40')];_0xf9f401+=0x1){_0x1d110e=_0x1c53cc[_0xf9f401];if(_['isUndefined'](_0x599de4[_0xb94e('0x20')][_0x1d110e['id']])){_0x599de4[_0xb94e('0x20')][_0x1d110e['id']]=new FreshsalesAccount(_0x1d110e);}else{_0x599de4['mergeFromDatabase'](_0x599de4[_0xb94e('0x20')][_0x1d110e['id']],_0x1d110e);}}}return _0x599de4['freshsalesAccounts'];};};Realtime[_0xb94e('0x3d')]['initVoiceQueueHopperHistory']=function(){var _0x4c83fe=this;return function(_0x240b47){for(var _0x2ad1b0=0x0;_0x2ad1b0<_0x240b47[_0xb94e('0x40')];_0x2ad1b0+=0x1){_[_0xb94e('0x4f')](_0x4c83fe[_0xb94e('0x10')][_0x240b47[_0x2ad1b0][_0xb94e('0x24')]],_0x240b47[_0x2ad1b0]);}return _0x4c83fe[_0xb94e('0x10')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x50')]=function(){var _0x133eaf=this;return function(_0x436658){clearVoiceQueues(_0x133eaf[_0xb94e('0x10')]);if(_0x436658){_0x436658=_[_0xb94e('0x51')](_0x436658,'uniqueid');for(var _0x56cede in _0x436658){if(_0x436658[_0xb94e('0x22')](_0x56cede)){var _0x4e3efc={};for(var _0x5835d8=0x0;_0x5835d8<_0x436658[_0x56cede]['length'];_0x5835d8+=0x1){var _0x3408c3=_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x52')];if(_0x133eaf[_0xb94e('0x10')][_0x3408c3]){if(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x53')]){_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x2e')]+=0x1;}if(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x54')]){_0x133eaf['voiceQueues'][_0x3408c3]['abandoned']+=0x1;}_0x133eaf[_0xb94e('0x10')][_0x3408c3]['sumHoldTime']+=moment(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x55')])[_0xb94e('0x56')](moment(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x57')]),_0xb94e('0x58'))||0x0;if(_0x5835d8===_0x436658[_0x56cede]['length']-0x1){_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x2a')]+=moment(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x59')]||_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x5a')]||_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x5b')])[_0xb94e('0x56')](moment(_0x436658[_0x56cede][_0x5835d8]['queuecallerjoinAt']),_0xb94e('0x58'))||0x0;_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x5c')]+=0x1;if(_0x436658[_0x56cede][_0x5835d8]['queuecallercomplete']){_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x29')]+=0x1;_0x133eaf['voiceQueues'][_0x3408c3][_0xb94e('0x2b')]+=moment(_0x436658[_0x56cede][_0x5835d8][_0xb94e('0x59')])[_0xb94e('0x56')](moment(_0x436658[_0x56cede][_0x5835d8]['queuecallerleaveAt']),_0xb94e('0x58'))||0x0;}}else{_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x2a')]+=_0x133eaf[_0xb94e('0x10')][_0x3408c3][_0xb94e('0x30')]||0x0;}}}}}}return _0x133eaf[_0xb94e('0x10')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x5d')]=function(){var _0x127030=this;return function(_0x524a86){clearVoiceCallReports(_0x127030[_0xb94e('0x13')]);if(_0x524a86){for(var _0xd9e5aa=0x0;_0xd9e5aa<_0x524a86[_0xb94e('0x40')];_0xd9e5aa+=0x1){_0x127030[_0xb94e('0x13')][_0xb94e('0x5c')]+=0x1;_0x127030[_0xb94e('0x13')][_0xb94e('0x2a')]+=_0x524a86[_0xd9e5aa][_0xb94e('0x5e')];if(_0x524a86[_0xd9e5aa][_0xb94e('0x5f')]===_0xb94e('0x60')){_0x127030[_0xb94e('0x13')]['answered']+=0x1;_0x127030[_0xb94e('0x13')][_0xb94e('0x30')]+=_0x524a86[_0xd9e5aa]['duration']-_0x524a86[_0xd9e5aa][_0xb94e('0x61')]||0x0;_0x127030['outbound']['sumBillable']+=_0x524a86[_0xd9e5aa][_0xb94e('0x61')];}}}return _0x127030[_0xb94e('0x13')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x62')]=function(){var _0x496836=this;return function(_0x26664e){if(_0x26664e){freeIsNotKey(_0x26664e,_0x496836[_0xb94e('0x11')],_0xb94e('0x24'));for(var _0x18cfa6=0x0,_0x45ead3={};_0x18cfa6<_0x26664e[_0xb94e('0x40')];_0x18cfa6+=0x1){_0x45ead3=_0x26664e[_0x18cfa6];if(_[_0xb94e('0x41')](_0x496836[_0xb94e('0x11')][_0x45ead3['name']])){_0x496836[_0xb94e('0x11')][_0x45ead3[_0xb94e('0x24')]]=new Campaign(_0x45ead3);}else{_0x496836[_0xb94e('0x3c')](_0x496836[_0xb94e('0x11')][_0x45ead3['name']],_0x45ead3);_0x496836[_0xb94e('0x11')][_0x45ead3[_0xb94e('0x24')]][_0xb94e('0x63')]=_0x45ead3[_0xb94e('0x64')]?_0x45ead3[_0xb94e('0x64')][_0xb94e('0x24')]:undefined;}}}return _0x496836[_0xb94e('0x11')];};};Realtime['prototype'][_0xb94e('0x65')]=function(){var _0x274d92=this;return function(_0x38fe03){if(_0x38fe03){freeIsNotKey(_0x38fe03,_0x274d92[_0xb94e('0x14')],'id');for(var _0x34e4d6=0x0,_0x1e3af3={};_0x34e4d6<_0x38fe03[_0xb94e('0x40')];_0x34e4d6+=0x1){_0x1e3af3=_0x38fe03[_0x34e4d6];if(_[_0xb94e('0x41')](_0x274d92['voiceExtensions'][_0x1e3af3['id']])){_0x274d92[_0xb94e('0x14')][_0x1e3af3['id']]=new VoiceExtension(_0x1e3af3);}else{_0x274d92[_0xb94e('0x3c')](_0x274d92[_0xb94e('0x14')][_0x1e3af3['id']],_0x1e3af3);}}}return _0x274d92[_0xb94e('0x14')];};};Realtime[_0xb94e('0x3d')][_0xb94e('0x66')]=function(){var _0x1b2bfe=this;return function(_0x435ed7){clearCampaigns(_0x1b2bfe[_0xb94e('0x11')]);for(var _0xa0e805=0x0;_0xa0e805<_0x435ed7['length'];_0xa0e805+=0x1){_['merge'](_0x1b2bfe['campaigns'][_0x435ed7[_0xa0e805][_0xb94e('0x24')]],_0x435ed7[_0xa0e805]);}return _0x1b2bfe[_0xb94e('0x11')];};};Realtime[_0xb94e('0x3d')]['initFaxAccounts']=function(){var _0x24bcad=this;return function(_0x5969c7){if(_0x5969c7){freeIsNotKey(_0x5969c7,_0x24bcad[_0xb94e('0x21')],'id');for(var _0x420dd7=0x0,_0x513554={},_0x32d4f0={};_0x420dd7<_0x5969c7[_0xb94e('0x40')];_0x420dd7+=0x1){_0x513554=_0x5969c7[_0x420dd7];if(_[_0xb94e('0x41')](_0x24bcad['faxAccounts'][_0x513554['id']])){_0x24bcad[_0xb94e('0x21')][_0x513554['id']]=new FaxAccount(_0x513554);}else{_0x24bcad[_0xb94e('0x3c')](_0x24bcad[_0xb94e('0x21')][_0x513554['id']],_0x513554);}}}return _0x24bcad[_0xb94e('0x21')];};};module[_0xb94e('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b098e79..1651c95 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 _0x8452=['createdAt','monitors','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','format','SIP/%s','length','connectedlinenum','interface','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','voiceCallReport','destination','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','UserId','split','membername','filename'];(function(_0x42b0f3,_0x58b2fb){var _0x3bfb67=function(_0x3941a3){while(--_0x3941a3){_0x42b0f3['push'](_0x42b0f3['shift']());}};_0x3bfb67(++_0x58b2fb);}(_0x8452,0x159));var _0x2845=function(_0x413426,_0x4f7814){_0x413426=_0x413426-0x0;var _0x5576e2=_0x8452[_0x413426];return _0x5576e2;};'use strict';var _=require(_0x2845('0x0'));var moment=require(_0x2845('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x2845('0x2'));var RpcVoiceAgentReport=require(_0x2845('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x2845('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x2845('0x5'));var RpcVoiceRecording=require(_0x2845('0x6'));var RpcVoiceTransferReport=require(_0x2845('0x7'));var VoiceQueueReport=require(_0x2845('0x8'));var VoiceCallReport=require(_0x2845('0x9'));var VoiceAgentReport=require(_0x2845('0xa'));var VoiceDialReport=require(_0x2845('0xb'));var UserReport=require('./userReport');function Report(_0x28fb43){this[_0x2845('0xc')]=_0x28fb43;this['agents']=_0x28fb43[_0x2845('0xd')];this[_0x2845('0xe')]=_0x28fb43['telephones'];}Report[_0x2845('0xf')]['sync']=function(_0xf21a4){var _0x204deb=new VoiceQueueReport(this[_0x2845('0xc')]);var _0x20f25b=new VoiceAgentReport(this[_0x2845('0xc')]);var _0x41821c=new VoiceDialReport(this[_0x2845('0xc')]);var _0x131410=new VoiceCallReport(this[_0x2845('0xc')]);var _0x4ea9a0=new UserReport(this[_0x2845('0xc')]);if(config[_0x2845('0x10')]&&config[_0x2845('0x10')][_0x2845('0x11')]){ami['on']('custom:voiceQueueReport',this[_0x2845('0x12')][_0x2845('0x13')](this));ami['on'](_0x2845('0x14'),this['voiceCallReport'][_0x2845('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x2845('0x15')][_0x2845('0x13')](this));ami['on'](_0x2845('0x16'),this[_0x2845('0x17')][_0x2845('0x13')](this));ami['on']('blindtransfer',this[_0x2845('0x18')][_0x2845('0x13')](this));ami['on'](_0x2845('0x19'),this[_0x2845('0x1a')]['bind'](this));}};Report[_0x2845('0xf')][_0x2845('0x1b')]=function(_0x2f9f61){var _0x24b404;_0x24b404=_['find'](this[_0x2845('0xd')],function(_0x45b542){return _0x45b542[_0x2845('0x1c')]==_0x2f9f61||_0x45b542[_0x2845('0x1d')]==_0x2f9f61;});if(_[_0x2845('0x1e')](_0x24b404)){var _0xe0dbc7=_[_0x2845('0x1f')](this[_0x2845('0xe')],function(_0x3d2c9e){return _0x3d2c9e['accountcode']==_0x2f9f61||_0x3d2c9e[_0x2845('0x1d')]==_0x2f9f61;});if(_0xe0dbc7){_0x24b404=_[_0x2845('0x1f')](this[_0x2845('0xd')],function(_0x1035f8){return _0x1035f8['interface']==util[_0x2845('0x20')](_0x2845('0x21'),_0xe0dbc7[_0x2845('0x1d')]);});}}return _0x24b404;};Report[_0x2845('0xf')][_0x2845('0x12')]=function(_0x522c91){for(var _0x1fe40a=0x0;_0x1fe40a<_0x522c91[_0x2845('0x22')];_0x1fe40a+=0x1){var _0x19c02c=this['findAgent'](_0x522c91[_0x1fe40a][_0x2845('0x23')]);if(_0x19c02c){_0x522c91[_0x1fe40a][_0x2845('0x1c')]=_0x19c02c[_0x2845('0x1c')];_0x522c91[_0x1fe40a]['assigned']=!![];_0x522c91[_0x1fe40a]['lastAssignedTo']=_0x19c02c[_0x2845('0x1d')];_0x522c91[_0x1fe40a][_0x2845('0x24')]=_[_0x2845('0x1e')](_0x19c02c[_0x2845('0x24')])?util[_0x2845('0x20')](_0x2845('0x21'),_0x19c02c[_0x2845('0x1d')]):_0x19c02c['interface'];if(_0x522c91[_0x1fe40a]['queuecallercomplete']){_0x522c91[_0x1fe40a]['queuecallercompleteAt']=moment()[_0x2845('0x20')](_0x2845('0x25'));}if(_0x522c91[_0x1fe40a][_0x2845('0x26')]){_0x522c91[_0x1fe40a]['queuecallerexitAt']=moment()[_0x2845('0x20')](_0x2845('0x25'));}RpcMemberReport[_0x2845('0x12')](_0x522c91[_0x1fe40a]);}RpcVoiceQueueReport[_0x2845('0x27')](_0x522c91[_0x1fe40a]);}};function extractCalleridNumber(_0x284dd7){var _0x3fdb7d=_0x284dd7[_0x2845('0x28')](/<(.*?)>/);return _0x3fdb7d?_0x3fdb7d[0x1]:_0x284dd7;}Report['prototype'][_0x2845('0x29')]=function(_0xdc4c41){for(var _0x5ddee7=0x0;_0x5ddee7/);return _0x391b28?_0x391b28[0x1]:_0xe76fda;}Report[_0x0fb3('0x9')][_0x0fb3('0x29')]=function(_0x5a4054){for(var _0x563d04=0x0;_0x563d04',_0x5ba3fb[_0x0fb3('0x3f')],_0x5ba3fb['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x5ba3fb[_0x0fb3('0x40')]]){var _0x2a3eed=RpcVoiceTransferReport[_0x0fb3('0x41')][_0x5ba3fb[_0x0fb3('0x40')]];_0x2a3eed['transfereelinkedid']=_0x5ba3fb['uniqueid'];RpcVoiceTransferReport[_0x0fb3('0x14')](_0x2a3eed);delete RpcVoiceTransferReport['transfers'][_0x5ba3fb[_0x0fb3('0x40')]];}if(_[_0x0fb3('0x1c')](_0x5ba3fb['type'])){_0x5ba3fb[_0x0fb3('0x32')]=this[_0x0fb3('0x2b')](_0x5ba3fb);}if(_['isNil'](_0x5ba3fb[_0x0fb3('0x42')])){var _0x34e388=_0x5ba3fb['channel']['split']('-')[0x0];var _0x5b0980=this['agents'][_0x34e388];if(!_0x5b0980)_0x5b0980=this[_0x0fb3('0x29')](_0x5ba3fb[_0x0fb3('0x1a')]);if(_0x5b0980){_0x5ba3fb['UserId']=_0x5b0980['id'];_0x5ba3fb[_0x0fb3('0x43')]=_0x5b0980[_0x0fb3('0x1b')];}}RpcVoiceCallReport[_0x0fb3('0x28')](_0x5ba3fb);if(_0x5ba3fb[_0x0fb3('0x44')]){for(var _0x1fe2e6=0x0;_0x1fe2e6<_0x5ba3fb[_0x0fb3('0x45')][_0x0fb3('0x20')];_0x1fe2e6+=0x1){_0x5ba3fb['monitorFilename']=_0x5ba3fb[_0x0fb3('0x45')][_0x1fe2e6][_0x0fb3('0x46')];_0x5ba3fb[_0x0fb3('0x47')]=_0x5ba3fb[_0x0fb3('0x45')][_0x1fe2e6][_0x0fb3('0x47')];if(_0x5ba3fb[_0x0fb3('0x31')]=='xcally-motion-preview'){_0x5ba3fb[_0x0fb3('0x2d')]=_0x5ba3fb[_0x0fb3('0x21')];_0x5ba3fb['calleridname']=_0x5ba3fb[_0x0fb3('0x48')];_0x5ba3fb[_0x0fb3('0x21')]=_0x5ba3fb[_0x0fb3('0x1a')];_0x5ba3fb[_0x0fb3('0x48')]=_0x5ba3fb['membername'];_0x5ba3fb[_0x0fb3('0x31')]=_0x5ba3fb[_0x0fb3('0x3b')];}else if(_0x5ba3fb[_0x0fb3('0x31')]=='xcally-motion-dialer'){_0x5ba3fb[_0x0fb3('0x2d')]=_0x5ba3fb['destination'];_0x5ba3fb['exten']=_0x5ba3fb[_0x0fb3('0x3b')];}RpcVoiceRecording['create'](_0x5ba3fb);}}};Report[_0x0fb3('0x9')][_0x0fb3('0x11')]=function(_0x2e82b6){if(_[_0x0fb3('0x49')](_0x2e82b6)){_0x2e82b6[_0x0fb3('0x4a')](function(_0x20accd){RpcVoiceAgentReport[_0x0fb3('0x28')](_0x20accd);});}else{RpcVoiceAgentReport[_0x0fb3('0x28')](_0x2e82b6);}};Report[_0x0fb3('0x9')][_0x0fb3('0x13')]=function(_0x4e06df){RpcVoiceDialReport[_0x0fb3('0x28')](_0x4e06df);var _0xdeb058;var _0x3292c2;var _0x293e52=_0x4e06df[_0x0fb3('0x2c')];if(_['startsWith'](_0x293e52,'Local')){_0x3292c2=_0x293e52[_0x0fb3('0x4b')](_0x293e52[_0x0fb3('0x4c')]('/')+0x1,_0x293e52['indexOf']('@'));_0xdeb058=_[_0x0fb3('0x19')](this['agents'],function(_0x325dcd){return _0x325dcd[_0x0fb3('0x4d')]==_0x3292c2||_0x325dcd[_0x0fb3('0x4e')]==_0x3292c2||_0x325dcd['accountcode']==_0x3292c2;});}else{_0x3292c2=_0x293e52[_0x0fb3('0x4b')](_0x293e52[_0x0fb3('0x4c')]('/')+0x1,_0x293e52[_0x0fb3('0x4f')]('-'));_0xdeb058=this[_0x0fb3('0x18')](_0x3292c2);}if(_0xdeb058){_0x4e06df['interface']=_[_0x0fb3('0x1c')](_0xdeb058[_0x0fb3('0x1d')])?util[_0x0fb3('0x1e')](_0x0fb3('0x1f'),_0xdeb058[_0x0fb3('0x1b')]):_0xdeb058['interface'];_0x4e06df[_0x0fb3('0x43')]=_0xdeb058['name'];_0x4e06df['accountcode']=_0xdeb058['accountcode'];RpcMemberReport['voiceDialReport'](_0x4e06df);}};Report[_0x0fb3('0x9')][_0x0fb3('0x14')]=function(_0x57c05b){RpcVoiceTransferReport['transfers'][_0x57c05b[_0x0fb3('0x50')]]=_0x57c05b;};Report['prototype'][_0x0fb3('0x17')]=function(_0x1bbdcb){RpcVoiceTransferReport[_0x0fb3('0x17')](_0x1bbdcb);};module[_0x0fb3('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index ffe809f..e6c4a6d 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 _0x9fe6=['format','name','trunk:save','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','indexOf','mobile','phone','accountcode','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','bluebird','../../../config/environment','ami','../ami','redis','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','bind','devicestatechange','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','emit','isNotNull','username','state','debug','[userReport][registry]','find','stateRegistry','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0x9fe6,0xb4));var _0x69fe=function(_0x39770d,_0x1ec3e5){_0x39770d=_0x39770d-0x0;var _0x3a72a6=_0x9fe6[_0x39770d];return _0x3a72a6;};'use strict';var _=require(_0x69fe('0x0'));var moment=require(_0x69fe('0x1'));var util=require(_0x69fe('0x2'));var Redis=require('ioredis');var BPromise=require(_0x69fe('0x3'));var config=require(_0x69fe('0x4'));var logger=require('../../../config/logger')(_0x69fe('0x5'));var ami=require(_0x69fe('0x6'));config['redis']=_['defaults'](config[_0x69fe('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x69fe('0x8'))(new Redis(config['redis']));function UserReport(_0x3afd0b){this[_0x69fe('0x9')]=_0x3afd0b[_0x69fe('0x9')];this[_0x69fe('0xa')]=_0x3afd0b[_0x69fe('0xa')];this[_0x69fe('0xb')]=_0x3afd0b[_0x69fe('0xb')];ami['on']('registryentry',this[_0x69fe('0xc')]['bind'](this));ami['on'](_0x69fe('0xd'),this[_0x69fe('0xc')][_0x69fe('0xe')](this));ami['on'](_0x69fe('0xf'),this['syncDeviceState'][_0x69fe('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));return this[_0x69fe('0x10')]();}function showSipRegistrations(){Promise[_0x69fe('0x11')]()[_0x69fe('0x12')](ami[_0x69fe('0x13')]())[_0x69fe('0x14')](function(_0x362058){logger[_0x69fe('0x15')](_0x69fe('0x16'),util[_0x69fe('0x17')](_0x362058,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x69fe('0x12')](ami[_0x69fe('0x18')]())[_0x69fe('0x14')](function(_0x593598){logger[_0x69fe('0x15')](_0x69fe('0x19'),util[_0x69fe('0x17')](_0x593598,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x69fe('0x11')]()['then'](ami[_0x69fe('0x1a')]())['catch'](function(_0x4f9dce){logger[_0x69fe('0x15')]('[userReport][sippeerstatus]',util[_0x69fe('0x17')](_0x4f9dce,{'showHidden':![],'depth':null}));});}UserReport[_0x69fe('0x1b')][_0x69fe('0x10')]=function(){setInterval(function(){BPromise[_0x69fe('0x11')]()[_0x69fe('0x12')](showSipRegistrations())[_0x69fe('0x12')](listDeviceStates())[_0x69fe('0x12')](showPeersStatus());},0x32c8);};UserReport[_0x69fe('0x1b')]['isNotNull']=function(_0x8b8abd){return _0x8b8abd!==null&&!_['isUndefined'](_0x8b8abd);};UserReport['prototype'][_0x69fe('0x1c')]=function(_0x1ca90a,_0x228514,_0x57f44f){io['to'](_0x1ca90a)[_0x69fe('0x1c')](_0x228514,_0x57f44f);};UserReport['prototype']['syncRegistry']=function(_0x1c9c56){try{if(this[_0x69fe('0x1d')](_0x1c9c56)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x1c9c56[_0x69fe('0x1e')],_0x1c9c56[_0x69fe('0x1f')]);logger[_0x69fe('0x20')](_0x69fe('0x21'),util['inspect'](_0x1c9c56,{'showHidden':![],'depth':null}));var _0x57c1a3=_[_0x69fe('0x22')](this[_0x69fe('0x9')],{'defaultuser':_0x1c9c56[_0x69fe('0x1e')]});if(_0x57c1a3){_0x1c9c56[_0x69fe('0x23')]=_0x1c9c56[_0x69fe('0x1f')];_['merge'](_0x57c1a3,_[_0x69fe('0x24')](_0x1c9c56,[_0x69fe('0x25'),'actionid',_0x69fe('0x1e'),_0x69fe('0x1f')]));logger[_0x69fe('0x20')](_0x69fe('0x26'),util[_0x69fe('0x17')](_0x57c1a3,{'showHidden':![],'depth':null}));this[_0x69fe('0x1c')](util[_0x69fe('0x27')]('trunk:%s',_0x57c1a3[_0x69fe('0x28')]),_0x69fe('0x29'),_0x57c1a3);}}}catch(_0x1ea7fd){logger[_0x69fe('0x15')]('[userReport][registry]',util[_0x69fe('0x17')](_0x1ea7fd,{'showHidden':![],'depth':null}));}};UserReport[_0x69fe('0x1b')][_0x69fe('0x2a')]=function(_0xc51845){try{if(this[_0x69fe('0x1d')](_0xc51845)){logger[_0x69fe('0x2b')](_0x69fe('0x2c'),_0xc51845[_0x69fe('0x2d')],_0xc51845[_0x69fe('0x1f')]);logger[_0x69fe('0x20')](_0x69fe('0x2e'),util['inspect'](_0xc51845,{'showHidden':![],'depth':null}));if(this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]]){if(!this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x2f')]||_0xc51845[_0x69fe('0x1f')]['toLowerCase']()==_0x69fe('0x30')){this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]]['local']=![];if(this['agents'][_0xc51845[_0x69fe('0x2d')]]['state']!==_0xc51845[_0x69fe('0x1f')][_0x69fe('0x31')]()){this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x32')]=_['toNumber'](moment()[_0x69fe('0x27')]('x'));}this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x1f')]=_0xc51845['state'][_0x69fe('0x31')]();this[_0x69fe('0xa')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x33')](_0xc51845);}}else if(this[_0x69fe('0xb')][_0xc51845[_0x69fe('0x2d')]]){if(this[_0x69fe('0xb')][_0xc51845[_0x69fe('0x2d')]]['state']!==_0xc51845[_0x69fe('0x1f')][_0x69fe('0x31')]()){this[_0x69fe('0xb')][_0xc51845['device']][_0x69fe('0x32')]=_[_0x69fe('0x34')](moment()[_0x69fe('0x27')]('x'));}this[_0x69fe('0xb')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x1f')]=_0xc51845['state'][_0x69fe('0x31')]();logger['debug'](_0x69fe('0x35'),util[_0x69fe('0x17')](this[_0x69fe('0xb')][_0xc51845[_0x69fe('0x2d')]],{'showHidden':![],'depth':null}));this[_0x69fe('0x1c')](util['format'](_0x69fe('0x36'),this[_0x69fe('0xb')][_0xc51845[_0x69fe('0x2d')]]['name']),_0x69fe('0x37'),this['telephones'][_0xc51845[_0x69fe('0x2d')]]);}else if(this['trunks'][_0xc51845[_0x69fe('0x2d')]]){if(this[_0x69fe('0x9')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x1f')]!==_0xc51845['state'][_0x69fe('0x31')]()){this[_0x69fe('0x9')][_0xc51845['device']][_0x69fe('0x32')]=_[_0x69fe('0x34')](moment()[_0x69fe('0x27')]('x'));}this[_0x69fe('0x9')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x1f')]=_0xc51845[_0x69fe('0x1f')][_0x69fe('0x31')]();logger['debug'](_0x69fe('0x38'),util[_0x69fe('0x17')](this[_0x69fe('0x9')][_0xc51845[_0x69fe('0x2d')]],{'showHidden':![],'depth':null}));this[_0x69fe('0x1c')](util[_0x69fe('0x27')](_0x69fe('0x39'),this[_0x69fe('0x9')][_0xc51845[_0x69fe('0x2d')]][_0x69fe('0x28')]),'trunk:save',this[_0x69fe('0x9')][_0xc51845[_0x69fe('0x2d')]]);}else if(_[_0x69fe('0x3a')](_0xc51845[_0x69fe('0x2d')],_0x69fe('0x3b'))){var _0x1a92d2=_0xc51845[_0x69fe('0x2d')];var _0x4d555b=_0x1a92d2['substring'](_0x1a92d2[_0x69fe('0x3c')]('/')+0x1,_0x1a92d2[_0x69fe('0x3c')]('@'));var _0x372b28=_['find'](this['agents'],function(_0x5d8411){return _0x5d8411[_0x69fe('0x3d')]==_0x4d555b||_0x5d8411[_0x69fe('0x3e')]==_0x4d555b||_0x5d8411[_0x69fe('0x3f')]==_0x4d555b;});if(_0x372b28){if(_0x372b28[_0x69fe('0x1f')]!==_0xc51845[_0x69fe('0x1f')][_0x69fe('0x31')]()){_0x372b28[_0x69fe('0x32')]=_[_0x69fe('0x34')](moment()['format']('x'));}_0x372b28[_0x69fe('0x1f')]=_0xc51845['state']['toLowerCase']();_0x372b28[_0x69fe('0x2f')]=!![];_0x372b28[_0x69fe('0x33')](_0xc51845);}}}}catch(_0x4ef23d){logger[_0x69fe('0x15')]('[userReport][devicestatechange]',util[_0x69fe('0x17')](_0x4ef23d,{'showHidden':![],'depth':null}));}};UserReport[_0x69fe('0x1b')][_0x69fe('0x40')]=function(_0x5329de){try{if(this[_0x69fe('0x1d')](_0x5329de)&&this[_0x69fe('0x1d')](_0x5329de[_0x69fe('0x41')])){logger[_0x69fe('0x2b')](_0x69fe('0x42'),_0x5329de[_0x69fe('0x43')],_0x5329de[_0x69fe('0x44')],_0x5329de[_0x69fe('0x41')]);logger['debug'](_0x69fe('0x45'),util[_0x69fe('0x17')](_0x5329de,{'showHidden':![],'depth':null}));if(this[_0x69fe('0xa')][_0x5329de[_0x69fe('0x43')]]){if(!this[_0x69fe('0xa')][_0x5329de['peer']][_0x69fe('0x2f')]||_0x5329de[_0x69fe('0x41')]['toLowerCase']()==_0x69fe('0x46')){this['agents'][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x2f')]=![];this[_0x69fe('0xa')][_0x5329de[_0x69fe('0x43')]]['status']=_0x5329de[_0x69fe('0x41')][_0x69fe('0x31')]();this[_0x69fe('0xa')][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x44')]=_0x5329de[_0x69fe('0x44')];this[_0x69fe('0xa')][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x33')](_0x5329de);}}else if(this[_0x69fe('0xb')][_0x5329de[_0x69fe('0x43')]]){this[_0x69fe('0xb')][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x47')]=_0x5329de[_0x69fe('0x41')][_0x69fe('0x31')]();this[_0x69fe('0xb')][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x44')]=_0x5329de[_0x69fe('0x44')];logger[_0x69fe('0x20')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x69fe('0x17')](this[_0x69fe('0xb')][_0x5329de[_0x69fe('0x43')]],{'showHidden':![],'depth':null}));this[_0x69fe('0x1c')](util[_0x69fe('0x27')]('telephone:%s',this['telephones'][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x28')]),'telephone:save',this[_0x69fe('0xb')][_0x5329de['peer']]);}else if(this[_0x69fe('0x9')][_0x5329de['peer']]){this['trunks'][_0x5329de['peer']][_0x69fe('0x47')]=_0x5329de[_0x69fe('0x41')]['toLowerCase']();this[_0x69fe('0x9')][_0x5329de[_0x69fe('0x43')]][_0x69fe('0x44')]=_0x5329de['address'];logger['debug'](_0x69fe('0x48'),util['inspect'](this[_0x69fe('0x9')][_0x5329de['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x69fe('0x39'),this[_0x69fe('0x9')][_0x5329de['peer']]['name']),_0x69fe('0x29'),this[_0x69fe('0x9')][_0x5329de['peer']]);}}}catch(_0xcb0d19){logger['error'](_0x69fe('0x45'),util['inspect'](_0xcb0d19,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x49ee=['trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','format','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','local','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:'];(function(_0xfbde7,_0x1bc93a){var _0x1d9fd5=function(_0x150703){while(--_0x150703){_0xfbde7['push'](_0xfbde7['shift']());}};_0x1d9fd5(++_0x1bc93a);}(_0x49ee,0x1e1));var _0xe49e=function(_0x215aac,_0x14b659){_0x215aac=_0x215aac-0x0;var _0x2c40f5=_0x49ee[_0x215aac];return _0x2c40f5;};'use strict';var _=require(_0xe49e('0x0'));var moment=require(_0xe49e('0x1'));var util=require('util');var Redis=require(_0xe49e('0x2'));var BPromise=require(_0xe49e('0x3'));var config=require(_0xe49e('0x4'));var logger=require('../../../config/logger')(_0xe49e('0x5'));var ami=require(_0xe49e('0x6'));config[_0xe49e('0x7')]=_[_0xe49e('0x8')](config['redis'],{'host':_0xe49e('0x9'),'port':0x18eb});var io=require(_0xe49e('0xa'))(new Redis(config[_0xe49e('0x7')]));function UserReport(_0x19d7e5){this[_0xe49e('0xb')]=_0x19d7e5[_0xe49e('0xb')];this[_0xe49e('0xc')]=_0x19d7e5[_0xe49e('0xc')];this[_0xe49e('0xd')]=_0x19d7e5['telephones'];ami['on']('registryentry',this[_0xe49e('0xe')][_0xe49e('0xf')](this));ami['on'](_0xe49e('0x10'),this[_0xe49e('0xe')][_0xe49e('0xf')](this));ami['on']('devicestatechange',this[_0xe49e('0x11')]['bind'](this));ami['on'](_0xe49e('0x12'),this['syncPeerStatus'][_0xe49e('0xf')](this));return this[_0xe49e('0x13')]();}function showSipRegistrations(){Promise[_0xe49e('0x14')]()['then'](ami[_0xe49e('0x15')]())[_0xe49e('0x16')](function(_0x59d80e){logger[_0xe49e('0x17')](_0xe49e('0x18'),util[_0xe49e('0x19')](_0x59d80e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xe49e('0x1a')](ami[_0xe49e('0x1b')]())['catch'](function(_0x334376){logger[_0xe49e('0x17')](_0xe49e('0x1c'),util[_0xe49e('0x19')](_0x334376,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xe49e('0x14')]()['then'](ami['actionSipPeerStatus']())[_0xe49e('0x16')](function(_0x178c72){logger[_0xe49e('0x17')]('[userReport][sippeerstatus]',util[_0xe49e('0x19')](_0x178c72,{'showHidden':![],'depth':null}));});}UserReport[_0xe49e('0x1d')][_0xe49e('0x13')]=function(){setInterval(function(){BPromise[_0xe49e('0x14')]()[_0xe49e('0x1a')](showSipRegistrations())[_0xe49e('0x1a')](listDeviceStates())[_0xe49e('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0xe49e('0x1d')][_0xe49e('0x1e')]=function(_0x187ff5){return _0x187ff5!==null&&!_[_0xe49e('0x1f')](_0x187ff5);};UserReport[_0xe49e('0x1d')][_0xe49e('0x20')]=function(_0x10ed3e,_0x3f82b8,_0x398820){io['to'](_0x10ed3e)[_0xe49e('0x20')](_0x3f82b8,_0x398820);};UserReport[_0xe49e('0x1d')][_0xe49e('0xe')]=function(_0x325c7f){try{if(this['isNotNull'](_0x325c7f)){logger[_0xe49e('0x21')](_0xe49e('0x22'),_0x325c7f[_0xe49e('0x23')],_0x325c7f[_0xe49e('0x24')]);logger[_0xe49e('0x25')](_0xe49e('0x26'),util[_0xe49e('0x19')](_0x325c7f,{'showHidden':![],'depth':null}));var _0x2f8f3c=_[_0xe49e('0x27')](this[_0xe49e('0xb')],{'defaultuser':_0x325c7f[_0xe49e('0x23')]});if(_0x2f8f3c){_0x325c7f[_0xe49e('0x28')]=_0x325c7f[_0xe49e('0x24')];_['merge'](_0x2f8f3c,_['omit'](_0x325c7f,[_0xe49e('0x29'),_0xe49e('0x2a'),'username',_0xe49e('0x24')]));logger['debug'](_0xe49e('0x2b'),util[_0xe49e('0x19')](_0x2f8f3c,{'showHidden':![],'depth':null}));this[_0xe49e('0x20')](util['format'](_0xe49e('0x2c'),_0x2f8f3c[_0xe49e('0x2d')]),_0xe49e('0x2e'),_0x2f8f3c);}}}catch(_0x59006c){logger[_0xe49e('0x17')](_0xe49e('0x26'),util[_0xe49e('0x19')](_0x59006c,{'showHidden':![],'depth':null}));}};UserReport[_0xe49e('0x1d')][_0xe49e('0x11')]=function(_0x2fe467){try{if(this['isNotNull'](_0x2fe467)){logger['info'](_0xe49e('0x2f'),_0x2fe467['device'],_0x2fe467[_0xe49e('0x24')]);logger[_0xe49e('0x25')](_0xe49e('0x30'),util['inspect'](_0x2fe467,{'showHidden':![],'depth':null}));if(this[_0xe49e('0xc')][_0x2fe467[_0xe49e('0x31')]]){if(!this[_0xe49e('0xc')][_0x2fe467[_0xe49e('0x31')]]['local']||_0x2fe467[_0xe49e('0x24')][_0xe49e('0x32')]()==_0xe49e('0x33')){this['agents'][_0x2fe467[_0xe49e('0x31')]]['local']=![];if(this[_0xe49e('0xc')][_0x2fe467['device']]['state']!==_0x2fe467[_0xe49e('0x24')]['toLowerCase']()){this[_0xe49e('0xc')][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0xe49e('0xc')][_0x2fe467['device']][_0xe49e('0x24')]=_0x2fe467['state'][_0xe49e('0x32')]();this[_0xe49e('0xc')][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x35')](_0x2fe467);}}else if(this[_0xe49e('0xd')][_0x2fe467[_0xe49e('0x31')]]){if(this[_0xe49e('0xd')][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x24')]!==_0x2fe467[_0xe49e('0x24')][_0xe49e('0x32')]()){this[_0xe49e('0xd')][_0x2fe467['device']][_0xe49e('0x34')]=_[_0xe49e('0x36')](moment()[_0xe49e('0x37')]('x'));}this[_0xe49e('0xd')][_0x2fe467['device']][_0xe49e('0x24')]=_0x2fe467['state'][_0xe49e('0x32')]();logger[_0xe49e('0x25')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x2fe467[_0xe49e('0x31')]],{'showHidden':![],'depth':null}));this[_0xe49e('0x20')](util[_0xe49e('0x37')](_0xe49e('0x38'),this['telephones'][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x2d')]),_0xe49e('0x39'),this[_0xe49e('0xd')][_0x2fe467[_0xe49e('0x31')]]);}else if(this[_0xe49e('0xb')][_0x2fe467[_0xe49e('0x31')]]){if(this[_0xe49e('0xb')][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x24')]!==_0x2fe467['state'][_0xe49e('0x32')]()){this[_0xe49e('0xb')][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x34')]=_[_0xe49e('0x36')](moment()['format']('x'));}this['trunks'][_0x2fe467[_0xe49e('0x31')]][_0xe49e('0x24')]=_0x2fe467['state'][_0xe49e('0x32')]();logger[_0xe49e('0x25')](_0xe49e('0x3a'),util[_0xe49e('0x19')](this[_0xe49e('0xb')][_0x2fe467[_0xe49e('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xe49e('0x37')](_0xe49e('0x2c'),this[_0xe49e('0xb')][_0x2fe467['device']][_0xe49e('0x2d')]),_0xe49e('0x2e'),this['trunks'][_0x2fe467[_0xe49e('0x31')]]);}else if(_[_0xe49e('0x3b')](_0x2fe467[_0xe49e('0x31')],_0xe49e('0x3c'))){var _0x12d527=_0x2fe467[_0xe49e('0x31')];var _0x2e726e=_0x12d527[_0xe49e('0x3d')](_0x12d527[_0xe49e('0x3e')]('/')+0x1,_0x12d527[_0xe49e('0x3e')]('@'));var _0x34868d=_['find'](this['agents'],function(_0x549490){return _0x549490[_0xe49e('0x3f')]==_0x2e726e||_0x549490['phone']==_0x2e726e||_0x549490['accountcode']==_0x2e726e;});if(_0x34868d){if(_0x34868d['state']!==_0x2fe467[_0xe49e('0x24')][_0xe49e('0x32')]()){_0x34868d[_0xe49e('0x34')]=_['toNumber'](moment()[_0xe49e('0x37')]('x'));}_0x34868d['state']=_0x2fe467[_0xe49e('0x24')][_0xe49e('0x32')]();_0x34868d[_0xe49e('0x40')]=!![];_0x34868d[_0xe49e('0x35')](_0x2fe467);}}}}catch(_0x1d282a){logger['error'](_0xe49e('0x30'),util['inspect'](_0x1d282a,{'showHidden':![],'depth':null}));}};UserReport[_0xe49e('0x1d')][_0xe49e('0x41')]=function(_0x301c5f){try{if(this[_0xe49e('0x1e')](_0x301c5f)&&this[_0xe49e('0x1e')](_0x301c5f[_0xe49e('0x12')])){logger[_0xe49e('0x21')](_0xe49e('0x42'),_0x301c5f[_0xe49e('0x43')],_0x301c5f[_0xe49e('0x44')],_0x301c5f[_0xe49e('0x12')]);logger[_0xe49e('0x25')](_0xe49e('0x45'),util[_0xe49e('0x19')](_0x301c5f,{'showHidden':![],'depth':null}));if(this[_0xe49e('0xc')][_0x301c5f[_0xe49e('0x43')]]){if(!this[_0xe49e('0xc')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x40')]||_0x301c5f[_0xe49e('0x12')][_0xe49e('0x32')]()==_0xe49e('0x46')){this[_0xe49e('0xc')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x40')]=![];this[_0xe49e('0xc')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x47')]=_0x301c5f[_0xe49e('0x12')]['toLowerCase']();this[_0xe49e('0xc')][_0x301c5f['peer']][_0xe49e('0x44')]=_0x301c5f[_0xe49e('0x44')];this[_0xe49e('0xc')][_0x301c5f[_0xe49e('0x43')]]['updateStatusRealtime'](_0x301c5f);}}else if(this['telephones'][_0x301c5f[_0xe49e('0x43')]]){this[_0xe49e('0xd')][_0x301c5f['peer']][_0xe49e('0x47')]=_0x301c5f[_0xe49e('0x12')]['toLowerCase']();this[_0xe49e('0xd')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x44')]=_0x301c5f[_0xe49e('0x44')];logger[_0xe49e('0x25')](_0xe49e('0x48'),util['inspect'](this[_0xe49e('0xd')][_0x301c5f[_0xe49e('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0xe49e('0xd')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x2d')]),_0xe49e('0x39'),this['telephones'][_0x301c5f[_0xe49e('0x43')]]);}else if(this[_0xe49e('0xb')][_0x301c5f[_0xe49e('0x43')]]){this['trunks'][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x47')]=_0x301c5f[_0xe49e('0x12')][_0xe49e('0x32')]();this[_0xe49e('0xb')][_0x301c5f[_0xe49e('0x43')]][_0xe49e('0x44')]=_0x301c5f[_0xe49e('0x44')];logger['debug'](_0xe49e('0x49'),util[_0xe49e('0x19')](this['trunks'][_0x301c5f['peer']],{'showHidden':![],'depth':null}));this[_0xe49e('0x20')](util[_0xe49e('0x37')](_0xe49e('0x2c'),this[_0xe49e('0xb')][_0x301c5f['peer']][_0xe49e('0x2d')]),'trunk:save',this['trunks'][_0x301c5f['peer']]);}}}catch(_0x5e97a6){logger[_0xe49e('0x17')]('[userReport][peerstatus]',util[_0xe49e('0x19')](_0x5e97a6,{'showHidden':![],'depth':null}));}};module[_0xe49e('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index fd3c0de..7626949 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 _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x2c16a1,_0x115f00){var _0x275add=function(_0x5425c7){while(--_0x5425c7){_0x2c16a1['push'](_0x2c16a1['shift']());}};_0x275add(++_0x115f00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x4b71ec,_0x1d5ce0){var _0x1e69bf=function(_0x55eb9d){while(--_0x55eb9d){_0x4b71ec['push'](_0x4b71ec['shift']());}};_0x1e69bf(++_0x1d5ce0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 6e1346f..0f14261 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 _0xefc9=['emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','keys','context','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','type','isNil','queue','[%s][voiceCallReport][newexten]','answered','answertime','holdtime','diff','destinationchannel','UserId','membername','connectedlinename','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','push','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','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','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','undefined','stopRecordingOnTransfer','StopMixMonitor','catch','finally','event','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/logger','ami','../model/channel','../rpc/setting','set','agi','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype'];(function(_0x12c0d1,_0x17a83b){var _0x399abd=function(_0xceb326){while(--_0xceb326){_0x12c0d1['push'](_0x12c0d1['shift']());}};_0x399abd(++_0x17a83b);}(_0xefc9,0x9a));var _0x9efc=function(_0x5d6486,_0x33a779){_0x5d6486=_0x5d6486-0x0;var _0x45b894=_0xefc9[_0x5d6486];return _0x45b894;};'use strict';var _=require(_0x9efc('0x0'));var moment=require(_0x9efc('0x1'));var util=require(_0x9efc('0x2'));var path=require(_0x9efc('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x9efc('0x4'))(_0x9efc('0x5'));var ami=require('../ami');var Channel=require(_0x9efc('0x6'));var RpcSetting=require(_0x9efc('0x7'));var applications=[_0x9efc('0x8'),'queue',_0x9efc('0x9'),'dial',_0x9efc('0xa'),'voicemail'];var dispositions=[_0x9efc('0xb'),_0x9efc('0xc'),'FAILED',_0x9efc('0xb'),'NO\x20ANSWER',_0x9efc('0xb'),'ANSWERED',_0x9efc('0xd'),_0x9efc('0xc'),_0x9efc('0xc'),_0x9efc('0xc')];config[_0x9efc('0xe')]=_[_0x9efc('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9efc('0x10'))(new Redis(config[_0x9efc('0xe')]));function VoiceCallReport(_0x48cf95){this[_0x9efc('0x11')]=_0x48cf95[_0x9efc('0x11')];this[_0x9efc('0x12')]=_0x48cf95[_0x9efc('0x12')];this['blindTransfers']={};ami['on'](_0x9efc('0x13'),this[_0x9efc('0x14')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x16'),this[_0x9efc('0x14')]['bind'](this));ami['on'](_0x9efc('0x17'),this[_0x9efc('0x18')][_0x9efc('0x15')](this));ami['on']('newstate',this[_0x9efc('0x19')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x1a'),this[_0x9efc('0x1b')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x1c'),this[_0x9efc('0x1d')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x1e'),this[_0x9efc('0x1f')][_0x9efc('0x15')](this));ami['on']('attendedtransfer',this[_0x9efc('0x20')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x21'),this[_0x9efc('0x22')][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x23'),this['syncMusicOnHoldStart'][_0x9efc('0x15')](this));ami['on'](_0x9efc('0x24'),this[_0x9efc('0x25')]['bind'](this));try{logger[_0x9efc('0x26')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x28fc82){logger[_0x9efc('0x27')](_0x9efc('0x28'),util[_0x9efc('0x29')](_0x28fc82,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x9efc('0x2a')]=function(_0x360654){return _0x360654!==null&&!_[_0x9efc('0x2b')](_0x360654);};VoiceCallReport[_0x9efc('0x2c')]['emit']=function(_0x552600,_0x3dfede,_0x5357df){io['to'](_0x552600)[_0x9efc('0x2d')](_0x3dfede,_0x5357df);};VoiceCallReport[_0x9efc('0x2c')][_0x9efc('0x1f')]=function(_0x57e677){try{if(this[_0x9efc('0x2a')](_0x57e677)){logger[_0x9efc('0x26')](_0x9efc('0x2e'),_0x57e677[_0x9efc('0x2f')],_0x57e677[_0x9efc('0x30')],_0x57e677[_0x9efc('0x31')]);logger[_0x9efc('0x32')](_0x9efc('0x33'),_0x57e677['uniqueid'],util[_0x9efc('0x29')](_0x57e677,{'showHidden':![],'depth':null}));if(_0x57e677[_0x9efc('0x2f')]===_0x57e677[_0x9efc('0x34')]){if(!_[_0x9efc('0x2b')](this[_0x9efc('0x11')][_0x57e677[_0x9efc('0x2f')]])){_['merge'](this[_0x9efc('0x11')][_0x57e677['uniqueid']],_[_0x9efc('0x35')](_0x57e677,_[_0x9efc('0x36')](this[_0x9efc('0x11')][_0x57e677[_0x9efc('0x2f')]])));}}if(_0x57e677[_0x9efc('0x37')]===_0x9efc('0x38')){if(this['agents'][_0x57e677['channel'][_0x9efc('0x39')]('-')[0x0]]){if(_0x57e677[_0x9efc('0x3a')]==_0x9efc('0x3b')){this[_0x9efc('0x12')][_0x57e677[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x3d')]=_0x57e677[_0x9efc('0x3e')];this[_0x9efc('0x2d')](util[_0x9efc('0x3f')](_0x9efc('0x40'),this[_0x9efc('0x12')][_0x57e677['channel'][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x41')]),_0x9efc('0x42'),{'destaccountcode':this[_0x9efc('0x12')][_0x57e677['channel'][_0x9efc('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x57e677[_0x9efc('0x3e')]});}}}}}catch(_0x5b5bfe){logger[_0x9efc('0x27')]('[%s][voiceCallReport][newcallerid]',_0x57e677[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x5b5bfe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9efc('0x2c')]['syncNewChannel']=function(_0x51ae8a){try{if(this[_0x9efc('0x2a')](_0x51ae8a)){logger['debug'](_0x9efc('0x43'),_0x51ae8a['uniqueid'],util['inspect'](_0x51ae8a,{'showHidden':![],'depth':null}));if(this[_0x9efc('0x11')][_0x51ae8a['uniqueid']])return;if(_0x51ae8a[_0x9efc('0x3c')]===_0x9efc('0x44'))return;if(_0x51ae8a[_0x9efc('0x2f')]!==_0x51ae8a[_0x9efc('0x34')]&&!this[_0x9efc('0x45')][_0x51ae8a['linkedid']])return;logger['info'](_0x9efc('0x46'),_0x51ae8a['uniqueid'],_0x51ae8a[_0x9efc('0x37')],_0x51ae8a[_0x9efc('0x3a')]);this[_0x9efc('0x11')][_0x51ae8a['uniqueid']]=new Channel();this[_0x9efc('0x11')][_0x51ae8a['uniqueid']][_0x9efc('0x47')]=moment()[_0x9efc('0x3f')](_0x9efc('0x48'));this[_0x9efc('0x11')][_0x51ae8a[_0x9efc('0x2f')]][_0x9efc('0x49')]=dispositions[_[_0x9efc('0x4a')](_0x51ae8a[_0x9efc('0x4b')])];_[_0x9efc('0x4c')](this['channels'][_0x51ae8a['uniqueid']],_['pick'](_0x51ae8a,_[_0x9efc('0x36')](this[_0x9efc('0x11')][_0x51ae8a['uniqueid']])));if(_0x51ae8a[_0x9efc('0x37')]===_0x9efc('0x38')){if(this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]){if(_['isUndefined'](this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['destconnectedlinenum'])){this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x3d')]=_0x51ae8a[_0x9efc('0x3a')];logger[_0x9efc('0x32')](_0x9efc('0x4d'),_0x51ae8a[_0x9efc('0x2f')],util[_0x9efc('0x29')]({'id':this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9efc('0x12')][_0x51ae8a['channel'][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x4e')],'destconnectedlinenum':_0x51ae8a[_0x9efc('0x3a')]},{'showHidden':![],'depth':null}));this[_0x9efc('0x2d')](util[_0x9efc('0x3f')]('user:%s',this['agents'][_0x51ae8a['channel'][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x41')]),_0x9efc('0x42'),{'id':this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9efc('0x12')][_0x51ae8a[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x4e')],'destconnectedlinenum':_0x51ae8a[_0x9efc('0x3a')]});}}}}}catch(_0x1819db){logger[_0x9efc('0x27')](_0x9efc('0x4f'),_0x51ae8a['uniqueid'],util[_0x9efc('0x29')](_0x1819db,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0xae6e3b){try{if(this[_0x9efc('0x2a')](_0xae6e3b)){logger[_0x9efc('0x32')](_0x9efc('0x50'),_0xae6e3b[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0xae6e3b,{'showHidden':![],'depth':null}));if(_0xae6e3b['channel']===_0x9efc('0x44')||_0xae6e3b['exten']==='h')return;if(_0xae6e3b[_0x9efc('0x2f')]===_0xae6e3b['linkedid']||this[_0x9efc('0x45')][_0xae6e3b[_0x9efc('0x34')]]){_0xae6e3b[_0x9efc('0x51')]=_0xae6e3b['application'][_0x9efc('0x52')]();_0xae6e3b[_0x9efc('0x53')]=_0xae6e3b[_0x9efc('0x54')]&&_0xae6e3b['appdata'][_0x9efc('0x55')](_0x9efc('0x56'))?_0xae6e3b[_0x9efc('0x54')]:(_0xae6e3b['appdata']||_0xae6e3b[_0x9efc('0x53')])[_0x9efc('0x52')]();logger[_0x9efc('0x26')](_0x9efc('0x57'),_0xae6e3b[_0x9efc('0x2f')],_0xae6e3b[_0x9efc('0x51')],_0xae6e3b[_0x9efc('0x53')]);if(_[_0x9efc('0x2b')](this['channels'][_0xae6e3b[_0x9efc('0x2f')]])){this[_0x9efc('0x11')][_0xae6e3b[_0x9efc('0x2f')]]=new Channel();this['channels'][_0xae6e3b[_0x9efc('0x2f')]]['starttime']=_0xae6e3b[_0x9efc('0x58')]?moment()['subtract'](moment[_0x9efc('0x58')](_0xae6e3b[_0x9efc('0x58')])[_0x9efc('0x59')](),'seconds')[_0x9efc('0x3f')](_0x9efc('0x48')):moment()[_0x9efc('0x3f')](_0x9efc('0x48'));this[_0x9efc('0x11')][_0xae6e3b[_0x9efc('0x2f')]][_0x9efc('0x49')]=_0x9efc('0xb');}_[_0x9efc('0x4c')](this[_0x9efc('0x11')][_0xae6e3b['uniqueid']],_[_0x9efc('0x35')](_0xae6e3b,_[_0x9efc('0x36')](this[_0x9efc('0x11')][_0xae6e3b[_0x9efc('0x2f')]])));if(_[_0x9efc('0x5a')](applications,_0xae6e3b[_0x9efc('0x51')])){this[_0x9efc('0x11')][_0xae6e3b['uniqueid']][_0x9efc('0x5b')]=_0xae6e3b['application'];this[_0x9efc('0x11')][_0xae6e3b[_0x9efc('0x2f')]][_0x9efc('0x5c')]=_0xae6e3b[_0x9efc('0x53')];if(_0xae6e3b['application']===_0x9efc('0x8')&&_[_0x9efc('0x55')](_0xae6e3b[_0x9efc('0x53')][_0x9efc('0x52')](),'cdr(')){var _0x1e8894=_0xae6e3b[_0x9efc('0x53')][_0x9efc('0x39')]('=');var _0x4f8bbf=_0x1e8894[0x0][_0x9efc('0x52')]()['match'](/cdr\((.*)\)/);if(_0x4f8bbf){if(_0x4f8bbf[0x1]===_0x9efc('0x5d')&&!_[_0x9efc('0x5e')](this['channels'][_0xae6e3b['uniqueid']][_0x4f8bbf[0x1]]))return;this[_0x9efc('0x11')][_0xae6e3b['uniqueid']][_0x4f8bbf[0x1]]=_0x1e8894[0x1];}}else if(_0xae6e3b['application']===_0x9efc('0x5f')){this[_0x9efc('0x11')][_0xae6e3b['uniqueid']][_0x9efc('0x5f')]=_0xae6e3b[_0x9efc('0x53')][_0x9efc('0x39')](',')[0x0];}}}}}catch(_0xfe42fe){logger['error'](_0x9efc('0x60'),_0xae6e3b[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0xfe42fe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9efc('0x2c')]['syncNewState']=function(_0x5648a2){try{if(this[_0x9efc('0x2a')](_0x5648a2)){logger[_0x9efc('0x26')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5648a2[_0x9efc('0x2f')],_0x5648a2['linkedid'],_0x5648a2[_0x9efc('0x30')],_0x5648a2[_0x9efc('0x31')]);logger[_0x9efc('0x32')]('[%s][voiceCallReport][newstate]\x20event:',_0x5648a2[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x5648a2,{'showHidden':![],'depth':null}));if(_0x5648a2[_0x9efc('0x4b')]!=='6')return;if(_0x5648a2[_0x9efc('0x2f')]!==_0x5648a2[_0x9efc('0x34')]){var _0xd239a0=moment();if(this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]]){if(!this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x61')]){this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x61')]=!![];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x62')]=_0xd239a0['format'](_0x9efc('0x48'));if(this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x47')]){this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x63')]=_0xd239a0[_0x9efc('0x64')](this['channels'][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x47')],_0x9efc('0x59'));}}this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x34')]=_0x5648a2['uniqueid'];if(_0x5648a2['calleridnum']!==_0x9efc('0x3b')){this[_0x9efc('0x11')][_0x5648a2['linkedid']]['connectedlinenum']=_0x5648a2[_0x9efc('0x31')];}this[_0x9efc('0x11')][_0x5648a2['linkedid']]['connectedlinename']=_0x5648a2[_0x9efc('0x30')];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x65')]=_0x5648a2[_0x9efc('0x3c')];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x49')]=dispositions[_[_0x9efc('0x4a')](_0x5648a2['channelstate'])];if(this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]){this[_0x9efc('0x11')][_0x5648a2['linkedid']][_0x9efc('0x66')]=this['agents'][_0x5648a2[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['id'];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]][_0x9efc('0x67')]=this[_0x9efc('0x12')][_0x5648a2['channel'][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x41')];}}if(this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]){if(!this[_0x9efc('0x11')][_0x5648a2['uniqueid']]['answered']){this['channels'][_0x5648a2[_0x9efc('0x2f')]]['answered']=!![];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]][_0x9efc('0x62')]=_0xd239a0[_0x9efc('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x5648a2[_0x9efc('0x2f')]]['starttime']){this['channels'][_0x5648a2[_0x9efc('0x2f')]][_0x9efc('0x63')]=_0xd239a0['diff'](this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]['starttime'],_0x9efc('0x59'));}}if(_0x5648a2[_0x9efc('0x31')]!==_0x9efc('0x3b')){this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]][_0x9efc('0x3e')]=_0x5648a2['calleridnum'];}this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]][_0x9efc('0x68')]=_0x5648a2[_0x9efc('0x30')];this[_0x9efc('0x11')][_0x5648a2['uniqueid']]['destinationchannel']=_0x5648a2['channel'];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]['disposition']=dispositions[_[_0x9efc('0x4a')](_0x5648a2[_0x9efc('0x4b')])];}}else{if(this['channels'][_0x5648a2[_0x9efc('0x2f')]]){if(this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')]['split']('-')[0x0]]){this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]['UserId']=this[_0x9efc('0x12')][_0x5648a2['channel'][_0x9efc('0x39')]('-')[0x0]]['id'];this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]['membername']=this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x41')];}}}if(_0x5648a2[_0x9efc('0x37')]===_0x9efc('0x38')){if(this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')]['split']('-')[0x0]]){this[_0x9efc('0x12')][_0x5648a2['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x5648a2[_0x9efc('0x3a')];var _0x1bd7ae,_0x40eaeb;if(this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x2f')]]){_0x1bd7ae=this[_0x9efc('0x11')][_0x5648a2['uniqueid']][_0x9efc('0x69')];_0x40eaeb=this[_0x9efc('0x11')][_0x5648a2['uniqueid']][_0x9efc('0x5f')];}else if(this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]]){_0x1bd7ae=this[_0x9efc('0x11')][_0x5648a2['linkedid']][_0x9efc('0x69')];_0x40eaeb=this[_0x9efc('0x11')][_0x5648a2[_0x9efc('0x34')]]['queue'];}logger[_0x9efc('0x32')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5648a2[_0x9efc('0x2f')],util['inspect']({'id':this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x4e')],'destconnectedlinenum':_0x5648a2[_0x9efc('0x3a')],'routealias':_0x1bd7ae,'queue':_0x40eaeb||undefined},{'showHidden':![],'depth':null}));this[_0x9efc('0x2d')](util[_0x9efc('0x3f')](_0x9efc('0x40'),this['agents'][_0x5648a2[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['name']),'user:agentconnect',{'id':this[_0x9efc('0x12')][_0x5648a2[_0x9efc('0x3c')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x5648a2[_0x9efc('0x3c')]['split']('-')[0x0]][_0x9efc('0x4e')],'destconnectedlinenum':_0x5648a2[_0x9efc('0x3a')],'routealias':_0x1bd7ae,'queue':_0x40eaeb||undefined});}}}}catch(_0x85342b){logger['error'](_0x9efc('0x6a'),_0x5648a2[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x85342b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9efc('0x2c')][_0x9efc('0x6b')]=function(_0x581bdb,_0x402327){try{if(this['channels'][_0x581bdb]){logger[_0x9efc('0x26')](_0x9efc('0x6c'),_0x581bdb,_0x402327);this['channels'][_0x581bdb]['monitor']=!![];if(_[_0x9efc('0x6d')](_0x402327,'.wav49')){_0x402327=_0x402327[_0x9efc('0x6e')](_0x9efc('0x6f'),_0x9efc('0x70'));}this['channels'][_0x581bdb][_0x9efc('0x71')]=_0x402327;var _0x2abf4b=_[_0x9efc('0x72')](this['channels'][_0x581bdb]['monitors'],{'filename':_0x402327});if(_[_0x9efc('0x5e')](_0x2abf4b)){this[_0x9efc('0x11')][_0x581bdb][_0x9efc('0x73')][_0x9efc('0x74')]({'filename':_0x402327,'createdAt':moment()['format'](_0x9efc('0x48')),'mixmonitorid':'','status':'rec'});}}}catch(_0x1e84ba){logger[_0x9efc('0x27')]('[%s][voiceCallReport][mixMonitorFilename]',_0x581bdb,util[_0x9efc('0x29')](_0x1e84ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9efc('0x2c')]['syncVarSet']=function(_0x24eaa8){try{if(this['isNotNull'](_0x24eaa8)){logger[_0x9efc('0x32')](_0x9efc('0x75'),_0x24eaa8[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x24eaa8,{'showHidden':![],'depth':null}));if(this[_0x9efc('0x11')][_0x24eaa8['uniqueid']]&&_0x24eaa8[_0x9efc('0x3c')]!=_0x9efc('0x44')){if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')])){if(this[_0x9efc('0x2a')](_0x24eaa8['variable'][_0x9efc('0x77')])){logger[_0x9efc('0x26')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8['value']);this[_0x9efc('0x6b')](_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x79')])){logger[_0x9efc('0x26')](_0x9efc('0x7a'),_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8['uniqueid']]['calleridnum']=_0x24eaa8[_0x9efc('0x78')];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x7b')])){logger[_0x9efc('0x26')](_0x9efc('0x7c'),_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8['uniqueid']][_0x9efc('0x7d')]=_0x24eaa8[_0x9efc('0x78')];}else if(this['isNotNull'](_0x24eaa8['variable'][_0x9efc('0x7e')])){logger[_0x9efc('0x26')](_0x9efc('0x7f'),_0x24eaa8['uniqueid'],_0x24eaa8['value']);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]][_0x9efc('0x5d')]=_0x24eaa8[_0x9efc('0x78')];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x80')])){logger[_0x9efc('0x26')](_0x9efc('0x81'),_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')][_0x9efc('0x39')](',')[0x0]);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]]['queue']=_0x24eaa8[_0x9efc('0x78')][_0x9efc('0x39')](',')[0x0];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x82')])){logger[_0x9efc('0x26')](_0x9efc('0x83'),_0x24eaa8['uniqueid'],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]]['originatecalleridnum']=_0x24eaa8[_0x9efc('0x78')];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x84')])){logger[_0x9efc('0x26')](_0x9efc('0x85'),_0x24eaa8['uniqueid'],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]]['destination']=_0x24eaa8[_0x9efc('0x78')];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x86')])){logger[_0x9efc('0x26')](_0x9efc('0x87'),_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]][_0x9efc('0x88')]=_0x24eaa8[_0x9efc('0x78')];}else if(this['isNotNull'](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x89')])){logger[_0x9efc('0x26')](_0x9efc('0x8a'),_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x2f')]]['queue']=_0x24eaa8['value'];}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x8b')])){logger[_0x9efc('0x26')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x24eaa8[_0x9efc('0x2f')],_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x11')][_0x24eaa8['uniqueid']][_0x9efc('0x8c')]=_0x24eaa8[_0x9efc('0x78')];}}}else if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x77')])){if(_0x24eaa8[_0x9efc('0x78')]){var _0x183d99=path['parse'](_0x24eaa8[_0x9efc('0x78')])[_0x9efc('0x41')];logger[_0x9efc('0x26')](_0x9efc('0x8d'),_0x183d99,_0x24eaa8[_0x9efc('0x78')]);this[_0x9efc('0x6b')](_0x183d99,_0x24eaa8['value']);}}else if(this[_0x9efc('0x11')][_0x24eaa8[_0x9efc('0x34')]]){if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')])){if(this[_0x9efc('0x2a')](_0x24eaa8[_0x9efc('0x76')][_0x9efc('0x8b')])){logger[_0x9efc('0x26')](_0x9efc('0x8e'),_0x24eaa8[_0x9efc('0x34')],_0x24eaa8['value']);this['channels'][_0x24eaa8['linkedid']][_0x9efc('0x8f')]=_0x24eaa8[_0x9efc('0x78')];}}}}}catch(_0x54e042){logger[_0x9efc('0x27')](_0x9efc('0x90'),_0x24eaa8[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x54e042,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9efc('0x2c')]['syncHangup']=function(_0x4b2843){try{if(this[_0x9efc('0x2a')](_0x4b2843)){logger[_0x9efc('0x32')](_0x9efc('0x91'),_0x4b2843[_0x9efc('0x2f')],util[_0x9efc('0x29')](_0x4b2843,{'showHidden':![],'depth':null}));if(this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]]){if(this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]]){this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]][_0x9efc('0x2f')]=_0x4b2843[_0x9efc('0x2f')];this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]][_0x9efc('0x61')]=this['channels'][_0x4b2843['uniqueid']][_0x9efc('0x61')];this['channels'][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]]['linkedid']][_0x9efc('0x62')]=this[_0x9efc('0x11')][_0x4b2843['uniqueid']]['answertime'];this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]][_0x9efc('0x65')]=this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]][_0x9efc('0x3c')];this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]][_0x9efc('0x49')]=this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]]['disposition'];this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]]=this['channels'][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]];delete this['channels'][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x34')]];}else if(this[_0x9efc('0x11')][this['blindTransfers'][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x2f')]]){this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843['linkedid']][_0x9efc('0x2f')]]['uniqueid']=[this[_0x9efc('0x11')][this['blindTransfers'][_0x4b2843['linkedid']]['uniqueid']][_0x9efc('0x34')],this['channels'][this['blindTransfers'][_0x4b2843[_0x9efc('0x34')]]['uniqueid']]['linkedid']=this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x2f')]][_0x9efc('0x2f')]][0x0];this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]]['uniqueid']][_0x9efc('0x61')]=this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x61')];this['channels'][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]]['uniqueid']][_0x9efc('0x62')]=this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x62')];this[_0x9efc('0x11')][this['blindTransfers'][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x2f')]][_0x9efc('0x65')]=this[_0x9efc('0x11')][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]]['uniqueid']][_0x9efc('0x3c')];this['channels'][this['blindTransfers'][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x2f')]][_0x9efc('0x49')]=this['channels'][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x49')];this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]]=this['channels'][this['blindTransfers'][_0x4b2843[_0x9efc('0x34')]]['uniqueid']];delete this['channels'][this[_0x9efc('0x45')][_0x4b2843[_0x9efc('0x34')]][_0x9efc('0x2f')]];}}if(this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]]){logger['info'](_0x9efc('0x92'),_0x4b2843['uniqueid'],_0x4b2843[_0x9efc('0x93')]);var _0x2f84bd=moment();this[_0x9efc('0x11')][_0x4b2843['uniqueid']][_0x9efc('0x94')]=_0x2f84bd[_0x9efc('0x3f')](_0x9efc('0x48'));this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x58')]=_0x2f84bd[_0x9efc('0x64')](this[_0x9efc('0x11')][_0x4b2843['uniqueid']][_0x9efc('0x47')],'seconds');if(this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x61')]){this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x95')]=_0x2f84bd[_0x9efc('0x64')](this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x62')],_0x9efc('0x59'));this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x63')]=this[_0x9efc('0x11')][_0x4b2843[_0x9efc('0x2f')]][_0x9efc('0x58')]-this[_0x9efc('0x11')][_0x4b2843['uniqueid']][_0x9efc('0x95')];}if(_0x4b2843[_0x9efc('0x37')]===_0x9efc('0x38')){if(this['agents'][_0x4b2843[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]){this[_0x9efc('0x12')][_0x4b2843[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]=_[_0x9efc('0x96')](this['agents'][_0x4b2843[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]],[_0x9efc('0x3d')]);logger[_0x9efc('0x32')](_0x9efc('0x97'),_0x4b2843[_0x9efc('0x2f')],util[_0x9efc('0x29')]({'id':this[_0x9efc('0x12')][_0x4b2843[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4b2843['channel'][_0x9efc('0x39')]('-')[0x0]][_0x9efc('0x4e')]},{'showHidden':![],'depth':null}));this[_0x9efc('0x2d')](util['format']('user:%s',this[_0x9efc('0x12')][_0x4b2843[_0x9efc('0x3c')]['split']('-')[0x0]][_0x9efc('0x41')]),_0x9efc('0x98'),{'id':this[_0x9efc('0x12')][_0x4b2843[_0x9efc('0x3c')][_0x9efc('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4b2843[_0x9efc('0x3c')]['split']('-')[0x0]][_0x9efc('0x4e')]});for(var _0x4000dd=0x0;_0x4000dd0x0?_0x5ecf56:0x0;this[_0x3e32('0x13')][_0x107bf8['queue']]['talking']=this[_0x3e32('0x13')][_0x107bf8['queue']][_0x3e32('0x33')]>_[_0x3e32('0x6c')](_0x107bf8[_0x3e32('0x6d')])?_[_0x3e32('0x6c')](_0x107bf8[_0x3e32('0x6d')]):this[_0x3e32('0x13')][_0x107bf8['queue']][_0x3e32('0x33')];this[_0x3e32('0x50')](this['voiceQueues'][_0x107bf8['queue']],_0x3e32('0x17'));}logger[_0x3e32('0x45')](_0x3e32('0x6e'),util[_0x3e32('0x3e')](this[_0x3e32('0x13')][_0x107bf8[_0x3e32('0x66')]],{'showHidden':![],'depth':null}));ami[_0x3e32('0x43')](_0x3e32('0x6f'),this[_0x3e32('0x13')][_0x107bf8[_0x3e32('0x66')]]);}}}catch(_0x12c6fe){logger[_0x3e32('0x3c')](_0x3e32('0x64'),util[_0x3e32('0x3e')](_0x12c6fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')]['syncQueueSummaryComplete']=function(_0x322d63){logger['debug'](_0x3e32('0x70'),util[_0x3e32('0x3e')](_0x322d63,{'showHidden':![],'depth':null}));this[_0x3e32('0x14')]=!![];};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0x1c')]=function(_0x2f8616){try{if(this[_0x3e32('0x61')](_0x2f8616)){logger[_0x3e32('0x45')](_0x3e32('0x71'),_0x2f8616[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x2f8616,{'showHidden':![],'depth':null}));if(_[_0x3e32('0x72')](this[_0x3e32('0x10')][_0x2f8616['uniqueid']]))this['queueReports'][_0x2f8616[_0x3e32('0x48')]]=[];if(_[_0x3e32('0x72')](this['channels'][_0x2f8616[_0x3e32('0x48')]]))this[_0x3e32('0x12')][_0x2f8616['uniqueid']]={};var _0x416689=new QueueReport();_0x416689[_0x3e32('0x4e')]=_0x2f8616[_0x3e32('0x66')];_0x416689['type']=this[_0x3e32('0x13')][_0x416689['name']]&&this[_0x3e32('0x13')][_0x416689['name']]['type']?this[_0x3e32('0x13')][_0x416689['name']][_0x3e32('0x51')]||_0x3e32('0x52'):_0x3e32('0x52');_0x416689[_0x3e32('0x66')]=_0x2f8616['queue'];_0x416689['queuecallerjoinAt']=moment()[_0x3e32('0x49')](_0x3e32('0x73'));_0x416689[_0x3e32('0x74')]=_0x2f8616[_0x3e32('0x74')];_0x416689['count']=_0x2f8616[_0x3e32('0x75')];_0x416689[_0x3e32('0x48')]=_0x2f8616[_0x3e32('0x48')];_0x416689[_0x3e32('0x76')]=this[_0x3e32('0x12')][_0x2f8616[_0x3e32('0x48')]][_0x3e32('0x76')];logger[_0x3e32('0x68')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x416689[_0x3e32('0x4e')],_0x416689[_0x3e32('0x51')]);_['merge'](_0x416689,_[_0x3e32('0x77')](_0x2f8616,_[_0x3e32('0x78')](_0x416689)));this[_0x3e32('0x10')][_0x2f8616['uniqueid']][_0x3e32('0x79')](_0x416689);this[_0x3e32('0x12')][_0x2f8616[_0x3e32('0x48')]]=_0x416689;this[_0x3e32('0x44')](_0x416689,_0x3e32('0x1b'));}}catch(_0x1bc798){logger[_0x3e32('0x3c')](_0x3e32('0x71'),_0x2f8616[_0x3e32('0x48')],util['inspect'](_0x1bc798,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')]['syncQueueCallerAbandon']=function(_0x140748){try{if(this[_0x3e32('0x61')](_0x140748)){logger[_0x3e32('0x45')](_0x3e32('0x7a'),_0x140748[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x140748,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x140748[_0x3e32('0x48')]]){var _0xd52493=_[_0x3e32('0x7b')](this[_0x3e32('0x10')][_0x140748[_0x3e32('0x48')]]);_0xd52493[_0x3e32('0x7c')]=![];_0xd52493[_0x3e32('0x7d')]=null;_0xd52493[_0x3e32('0x7e')]=_0x140748[_0x3e32('0x7e')];_0xd52493[_0x3e32('0x7f')]=_0x140748[_0x3e32('0x7f')];_0xd52493[_0x3e32('0x1d')]=!![];_0xd52493[_0x3e32('0x80')]=moment()[_0x3e32('0x49')](_0x3e32('0x73'));_0xd52493[_0x3e32('0x81')]='ABANDONED';_0xd52493[_0x3e32('0x82')]=null;logger[_0x3e32('0x68')](_0x3e32('0x83'),_0xd52493[_0x3e32('0x4e')],_0xd52493[_0x3e32('0x51')]);this[_0x3e32('0x12')][_0x140748['uniqueid']]=_0xd52493;this[_0x3e32('0x42')](_0xd52493,_0x3e32('0x1d'));}}}catch(_0x246ced){logger[_0x3e32('0x3c')]('[%s][voiceQueueReport][queuecallerabandon]',_0x140748[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x246ced,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0x1f')]=function(_0x1bf92c){try{if(this[_0x3e32('0x61')](_0x1bf92c)){logger[_0x3e32('0x45')](_0x3e32('0x84'),_0x1bf92c[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x1bf92c,{'showHidden':![],'depth':null}));if(this[_0x3e32('0x10')][_0x1bf92c['uniqueid']]){var _0x7af853=_[_0x3e32('0x7b')](this[_0x3e32('0x10')][_0x1bf92c[_0x3e32('0x48')]]);_0x7af853[_0x3e32('0x85')]=moment()[_0x3e32('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x7af853[_0x3e32('0x86')]=_0x1bf92c[_0x3e32('0x86')];_0x7af853[_0x3e32('0x87')]=_0x1bf92c[_0x3e32('0x87')];logger[_0x3e32('0x68')](_0x3e32('0x88'),_0x7af853[_0x3e32('0x4e')],_0x7af853['type'],_0x1bf92c[_0x3e32('0x86')],_0x1bf92c[_0x3e32('0x87')]);this[_0x3e32('0x12')][_0x1bf92c['uniqueid']]=_0x7af853;this['emitVoiceQueueChannelSave'](_0x7af853,_0x3e32('0x1e'));}}}catch(_0x5789aa){logger[_0x3e32('0x3c')](_0x3e32('0x84'),_0x1bf92c[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x5789aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0x89')]=function(_0x5bc11f){try{if(this[_0x3e32('0x61')](_0x5bc11f)){logger[_0x3e32('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x5bc11f[_0x3e32('0x48')],util['inspect'](_0x5bc11f,{'showHidden':![],'depth':null}));if(this[_0x3e32('0x10')][_0x5bc11f[_0x3e32('0x48')]]){var _0x375084=_[_0x3e32('0x7b')](this[_0x3e32('0x10')][_0x5bc11f[_0x3e32('0x48')]]);_0x375084[_0x3e32('0x7c')]=!![];_0x375084[_0x3e32('0x81')]=_0x3e32('0x8a');logger[_0x3e32('0x68')](_0x3e32('0x8b'),_0x375084[_0x3e32('0x4e')],_0x375084[_0x3e32('0x51')]);}}}catch(_0x714edf){logger[_0x3e32('0x3c')](_0x3e32('0x8c'),_0x5bc11f[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x714edf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0x20')]=function(_0x5cf6b1){try{if(this['isNotNull'](_0x5cf6b1)){logger[_0x3e32('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x5cf6b1['uniqueid'],util[_0x3e32('0x3e')](_0x5cf6b1,{'showHidden':![],'depth':null}));if(this[_0x3e32('0x10')][_0x5cf6b1[_0x3e32('0x48')]]){var _0x193c68=_['last'](this[_0x3e32('0x10')][_0x5cf6b1[_0x3e32('0x48')]]);_0x193c68[_0x3e32('0x1d')]=![];_0x193c68[_0x3e32('0x80')]=null;_0x193c68[_0x3e32('0x8d')]=!![];_0x193c68['lastAssignedTo']=_0x5cf6b1[_0x3e32('0x8e')];_0x193c68[_0x3e32('0x7e')]=_0x5cf6b1[_0x3e32('0x7e')];_0x193c68[_0x3e32('0x7c')]=!![];_0x193c68['queuecallerexit']=![];_0x193c68['queuecallerexitAt']=null;if(!_0x193c68[_0x3e32('0x8f')]){if(_0x5cf6b1[_0x3e32('0x90')]==_0x3e32('0x8f')){_0x193c68['queuecallerexitreason']=_0x3e32('0x91');logger['info'](_0x3e32('0x92'),_0x193c68[_0x3e32('0x4e')],_0x193c68['type']);}else{if(_[_0x3e32('0x93')](_0x5cf6b1[_0x3e32('0x94')][_0x3e32('0x95')](),_0x3e32('0x96'))){if(this[_0x3e32('0x10')][_0x5cf6b1[_0x3e32('0x97')]]){var _0x76be5=_[_0x3e32('0x7b')](this[_0x3e32('0x10')][_0x5cf6b1['linkedid']]);_0x76be5[_0x3e32('0x7c')]=![];_0x76be5[_0x3e32('0x98')]=!![];_0x76be5[_0x3e32('0x99')]=moment(_0x193c68[_0x3e32('0x9a')])[_0x3e32('0x9b')](_0x5cf6b1[_0x3e32('0x7e')],'seconds')[_0x3e32('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x76be5['queuecallerexitreason']=_0x3e32('0x9c');_0x76be5[_0x3e32('0x8f')]=!![];_0x76be5[_0x3e32('0x9d')]=_0x3e32('0x9e');_0x76be5[_0x3e32('0x9f')]=_0x5cf6b1[_0x3e32('0xa0')];_0x76be5[_0x3e32('0xa1')]=_0x5cf6b1[_0x3e32('0x48')];logger[_0x3e32('0x68')](_0x3e32('0xa2'),_0x76be5[_0x3e32('0x4e')],_0x76be5['type']);var _0x495ab4=this[_0x3e32('0x10')][_0x5cf6b1['linkedid']];this['queueReports'][_0x5cf6b1[_0x3e32('0x97')]]=this[_0x3e32('0x10')][_0x5cf6b1[_0x3e32('0x48')]];this[_0x3e32('0x10')][_0x5cf6b1[_0x3e32('0x48')]]=_0x495ab4;}}else{_0x193c68[_0x3e32('0x81')]='COMPLETEDBY'+_0x5cf6b1['reason']['toUpperCase']();logger['info'](_0x3e32('0xa3'),_0x193c68[_0x3e32('0x4e')],_0x193c68['type'],_0x193c68[_0x3e32('0x81')]);}}}this[_0x3e32('0x12')][_0x5cf6b1[_0x3e32('0x48')]]=_0x193c68;this[_0x3e32('0x42')](_0x193c68,'agentcomplete');}}}catch(_0x4105a0){logger['error'](_0x3e32('0xa4'),_0x5cf6b1[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x4105a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x11701f){try{if(this[_0x3e32('0x61')](_0x11701f)){logger['debug'](_0x3e32('0xa5'),_0x11701f['uniqueid'],util['inspect'](_0x11701f,{'showHidden':![],'depth':null}));this[_0x3e32('0xa6')](_0x11701f[_0x3e32('0x48')],_[_0x3e32('0x78')](_0x11701f[_0x3e32('0xa7')])[0x0],_0x11701f[_0x3e32('0xa8')]);if(this['queueReports'][_0x11701f[_0x3e32('0x48')]]){var _0x2c24e8=_[_0x3e32('0x7b')](this['queueReports'][_0x11701f[_0x3e32('0x48')]]);if(_0x2c24e8){if(this[_0x3e32('0x61')](_0x11701f[_0x3e32('0xa7')])&&this[_0x3e32('0x61')](_0x11701f[_0x3e32('0xa7')]['queuestatus'])){switch(_0x11701f['value']){case _0x3e32('0xa9'):_0x2c24e8[_0x3e32('0x98')]=![];_0x2c24e8['queuecallerexitAt']=null;break;case _0x3e32('0xaa'):_0x2c24e8['lastevent']=_0x3e32('0xab');_0x2c24e8[_0x3e32('0x98')]=!![];_0x2c24e8[_0x3e32('0x99')]=moment()['format'](_0x3e32('0x73'));_0x2c24e8[_0x3e32('0x85')]=moment()[_0x3e32('0x49')](_0x3e32('0x73'));logger[_0x3e32('0x45')](_0x3e32('0xac'),_0x11701f[_0x3e32('0x48')],util[_0x3e32('0x3e')](_0x2c24e8,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x2c24e8);break;default:_0x2c24e8[_0x3e32('0x98')]=!![];_0x2c24e8['queuecallerexitAt']=moment()['format'](_0x3e32('0x73'));_0x2c24e8[_0x3e32('0x85')]=moment()[_0x3e32('0x49')](_0x3e32('0x73'));}_0x2c24e8['queuecallerabandon']=![];_0x2c24e8[_0x3e32('0x80')]=null;_0x2c24e8[_0x3e32('0x81')]=_0x11701f[_0x3e32('0xa8')];this[_0x3e32('0x12')][_0x11701f['uniqueid']]=_0x2c24e8;this[_0x3e32('0x42')](_0x2c24e8,_0x3e32('0x21'));}else if(this[_0x3e32('0x61')](_0x11701f[_0x3e32('0xa7')])&&this[_0x3e32('0x61')](_0x11701f['variable']['queueposition'])){if(!_0x2c24e8[_0x3e32('0x1d')]){_0x2c24e8[_0x3e32('0x98')]=!![];_0x2c24e8['queuecallerexitAt']=moment()[_0x3e32('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c24e8[_0x3e32('0x81')]=_0x3e32('0xad');_0x2c24e8[_0x3e32('0x85')]=moment()[_0x3e32('0x49')](_0x3e32('0x73'));this[_0x3e32('0x12')][_0x11701f[_0x3e32('0x48')]]=_0x2c24e8;}}logger[_0x3e32('0x68')](_0x3e32('0xae'),_0x11701f[_0x3e32('0x48')],_0x2c24e8[_0x3e32('0x4e')],_0x2c24e8[_0x3e32('0x51')],_[_0x3e32('0x78')](_0x11701f['variable'])[0x0],_0x11701f[_0x3e32('0xa8')]);_0x2c24e8[_0x3e32('0x16')]=this[_0x3e32('0x16')][_0x11701f[_0x3e32('0x48')]];}}}}catch(_0x189008){logger[_0x3e32('0x3c')]('[%s][voiceQueueReport][varset]',_0x11701f[_0x3e32('0x48')],util['inspect'](_0x189008,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0xa6')]=function(_0x19592d,_0x414b41,_0x116171){var _0x4a9039=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x3e32('0xaf'),_0x3e32('0xb0'),_0x3e32('0xb1'),_0x3e32('0xb2'),_0x3e32('0xb3'),_0x3e32('0xb4'),_0x3e32('0xb5'),_0x3e32('0xb6'),_0x3e32('0xb7'),_0x3e32('0xb8'),_0x3e32('0xb9'),_0x3e32('0xba'),_0x3e32('0xbb'),_0x3e32('0x8e'),_0x3e32('0xbc'),_0x3e32('0xbd')];if(!_[_0x3e32('0x38')](_0x414b41)&&!_[_0x3e32('0xbe')](_0x4a9039,_0x414b41)){if(_[_0x3e32('0x72')](this['variables'][_0x19592d])){this[_0x3e32('0x16')][_0x19592d]={};}this[_0x3e32('0x16')][_0x19592d][_0x414b41]=_0x116171;}};VoiceQueueReport[_0x3e32('0xb')][_0x3e32('0x24')]=function(_0x34ee15){try{if(this[_0x3e32('0x61')](_0x34ee15)){logger[_0x3e32('0x45')](_0x3e32('0xbf'),_0x34ee15[_0x3e32('0x48')],util['inspect'](_0x34ee15,{'showHidden':![],'depth':null}));if(this[_0x3e32('0x10')][_0x34ee15['uniqueid']]){for(var _0x4cc47d=0x0,_0x2bb867={};_0x4cc47d0x0?_0x1cdfbb:0x0;this['voiceQueues'][_0x32258f['queue']][_0x08ef('0x5b')]=this[_0x08ef('0x12')][_0x32258f[_0x08ef('0x70')]][_0x08ef('0x5b')]>_['toNumber'](_0x32258f[_0x08ef('0x75')])?_[_0x08ef('0x74')](_0x32258f[_0x08ef('0x75')]):this['voiceQueues'][_0x32258f['queue']][_0x08ef('0x5b')];this[_0x08ef('0x76')](this[_0x08ef('0x12')][_0x32258f[_0x08ef('0x70')]],_0x08ef('0x16'));}logger['debug'](_0x08ef('0x77'),util[_0x08ef('0x43')](this['voiceQueues'][_0x32258f[_0x08ef('0x70')]],{'showHidden':![],'depth':null}));ami[_0x08ef('0x47')](_0x08ef('0x78'),this['voiceQueues'][_0x32258f[_0x08ef('0x70')]]);}}}catch(_0x3befc2){logger[_0x08ef('0x41')](_0x08ef('0x79'),util['inspect'](_0x3befc2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')]['syncQueueSummaryComplete']=function(_0x267053){logger[_0x08ef('0x49')](_0x08ef('0x7a'),util['inspect'](_0x267053,{'showHidden':![],'depth':null}));this[_0x08ef('0x13')]=!![];};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0x1c')]=function(_0x178e6c){try{if(this[_0x08ef('0x69')](_0x178e6c)){logger[_0x08ef('0x49')](_0x08ef('0x7b'),_0x178e6c[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x178e6c,{'showHidden':![],'depth':null}));if(_[_0x08ef('0x6a')](this[_0x08ef('0xf')][_0x178e6c['uniqueid']]))this['queueReports'][_0x178e6c[_0x08ef('0x4b')]]=[];if(_[_0x08ef('0x6a')](this[_0x08ef('0x11')][_0x178e6c[_0x08ef('0x4b')]]))this['channels'][_0x178e6c['uniqueid']]={};var _0x1c949d=new QueueReport();_0x1c949d[_0x08ef('0x51')]=_0x178e6c['queue'];_0x1c949d[_0x08ef('0x5d')]=this[_0x08ef('0x12')][_0x1c949d[_0x08ef('0x51')]]&&this['voiceQueues'][_0x1c949d[_0x08ef('0x51')]][_0x08ef('0x5d')]?this['voiceQueues'][_0x1c949d['name']][_0x08ef('0x5d')]||_0x08ef('0x54'):_0x08ef('0x54');_0x1c949d[_0x08ef('0x70')]=_0x178e6c['queue'];_0x1c949d[_0x08ef('0x7c')]=moment()[_0x08ef('0x4c')](_0x08ef('0x7d'));_0x1c949d[_0x08ef('0x7e')]=_0x178e6c['position'];_0x1c949d[_0x08ef('0x7f')]=_0x178e6c[_0x08ef('0x7f')];_0x1c949d[_0x08ef('0x4b')]=_0x178e6c['uniqueid'];_0x1c949d[_0x08ef('0x80')]=this['channels'][_0x178e6c[_0x08ef('0x4b')]]['routealias'];logger['info'](_0x08ef('0x81'),_0x1c949d[_0x08ef('0x51')],_0x1c949d['type']);_['merge'](_0x1c949d,_['pick'](_0x178e6c,_[_0x08ef('0x82')](_0x1c949d)));this[_0x08ef('0xf')][_0x178e6c[_0x08ef('0x4b')]][_0x08ef('0x83')](_0x1c949d);this[_0x08ef('0x11')][_0x178e6c['uniqueid']]=_0x1c949d;this['emitVoiceQueueChannelSave'](_0x1c949d,_0x08ef('0x1b'));}}catch(_0x10933c){logger[_0x08ef('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x178e6c[_0x08ef('0x4b')],util['inspect'](_0x10933c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0x1e')]=function(_0x40fe3b){try{if(this['isNotNull'](_0x40fe3b)){logger[_0x08ef('0x49')](_0x08ef('0x84'),_0x40fe3b[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x40fe3b,{'showHidden':![],'depth':null}));if(this[_0x08ef('0xf')][_0x40fe3b[_0x08ef('0x4b')]]){var _0x4710ad=_['last'](this[_0x08ef('0xf')][_0x40fe3b[_0x08ef('0x4b')]]);_0x4710ad[_0x08ef('0x85')]=![];_0x4710ad[_0x08ef('0x86')]=null;_0x4710ad[_0x08ef('0x87')]=_0x40fe3b[_0x08ef('0x87')];_0x4710ad[_0x08ef('0x88')]=_0x40fe3b['originalposition'];_0x4710ad['queuecallerabandon']=!![];_0x4710ad[_0x08ef('0x89')]=moment()[_0x08ef('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4710ad[_0x08ef('0x8a')]=_0x08ef('0x8b');_0x4710ad[_0x08ef('0x8c')]=null;logger['info'](_0x08ef('0x8d'),_0x4710ad[_0x08ef('0x51')],_0x4710ad['type']);this[_0x08ef('0x11')][_0x40fe3b[_0x08ef('0x4b')]]=_0x4710ad;this[_0x08ef('0x4f')](_0x4710ad,_0x08ef('0x1d'));}}}catch(_0x4b5a73){logger['error'](_0x08ef('0x84'),_0x40fe3b['uniqueid'],util['inspect'](_0x4b5a73,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')]['syncQueueCallerLeave']=function(_0x33d021){try{if(this[_0x08ef('0x69')](_0x33d021)){logger[_0x08ef('0x49')]('[%s][voiceQueueReport][queuecallerleave]',_0x33d021['uniqueid'],util[_0x08ef('0x43')](_0x33d021,{'showHidden':![],'depth':null}));if(this[_0x08ef('0xf')][_0x33d021[_0x08ef('0x4b')]]){var _0x8e3620=_['last'](this[_0x08ef('0xf')][_0x33d021[_0x08ef('0x4b')]]);_0x8e3620[_0x08ef('0x8e')]=moment()[_0x08ef('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x8e3620[_0x08ef('0x8f')]=_0x33d021[_0x08ef('0x8f')];_0x8e3620[_0x08ef('0x90')]=_0x33d021['connectedlinename'];logger[_0x08ef('0x91')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x8e3620[_0x08ef('0x51')],_0x8e3620[_0x08ef('0x5d')],_0x33d021[_0x08ef('0x8f')],_0x33d021['connectedlinename']);this[_0x08ef('0x11')][_0x33d021[_0x08ef('0x4b')]]=_0x8e3620;this[_0x08ef('0x48')](_0x8e3620,'queuecallerleave');}}}catch(_0x376a90){logger[_0x08ef('0x41')](_0x08ef('0x92'),_0x33d021[_0x08ef('0x4b')],util['inspect'](_0x376a90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')]['syncAgentConnect']=function(_0x55353b){try{if(this['isNotNull'](_0x55353b)){logger['debug'](_0x08ef('0x93'),_0x55353b['uniqueid'],util[_0x08ef('0x43')](_0x55353b,{'showHidden':![],'depth':null}));if(this[_0x08ef('0xf')][_0x55353b['uniqueid']]){var _0x5858e5=_[_0x08ef('0x94')](this['queueReports'][_0x55353b['uniqueid']]);_0x5858e5[_0x08ef('0x85')]=!![];_0x5858e5[_0x08ef('0x8a')]=_0x08ef('0x95');logger[_0x08ef('0x91')](_0x08ef('0x96'),_0x5858e5[_0x08ef('0x51')],_0x5858e5[_0x08ef('0x5d')]);}}}catch(_0x10a663){logger[_0x08ef('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x55353b[_0x08ef('0x4b')],util['inspect'](_0x10a663,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0x21')]=function(_0xd8906f){try{if(this[_0x08ef('0x69')](_0xd8906f)){logger[_0x08ef('0x49')](_0x08ef('0x97'),_0xd8906f[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0xd8906f,{'showHidden':![],'depth':null}));if(this[_0x08ef('0xf')][_0xd8906f[_0x08ef('0x4b')]]){var _0x41847e=_[_0x08ef('0x94')](this[_0x08ef('0xf')][_0xd8906f['uniqueid']]);_0x41847e[_0x08ef('0x1d')]=![];_0x41847e[_0x08ef('0x89')]=null;_0x41847e[_0x08ef('0x98')]=!![];_0x41847e[_0x08ef('0x8c')]=_0xd8906f[_0x08ef('0x99')];_0x41847e['holdtime']=_0xd8906f['holdtime'];_0x41847e[_0x08ef('0x85')]=!![];_0x41847e[_0x08ef('0x9a')]=![];_0x41847e[_0x08ef('0x9b')]=null;if(!_0x41847e[_0x08ef('0x9c')]){if(_0xd8906f['reason']=='transfer'){_0x41847e[_0x08ef('0x8a')]=_0x08ef('0x9d');logger[_0x08ef('0x91')](_0x08ef('0x9e'),_0x41847e[_0x08ef('0x51')],_0x41847e[_0x08ef('0x5d')]);}else{if(_['startsWith'](_0xd8906f[_0x08ef('0x3e')]['toLowerCase'](),_0x08ef('0x9f'))){if(this[_0x08ef('0xf')][_0xd8906f[_0x08ef('0xa0')]]){var _0x461266=_[_0x08ef('0x94')](this[_0x08ef('0xf')][_0xd8906f['linkedid']]);_0x461266['queuecallercomplete']=![];_0x461266[_0x08ef('0x9a')]=!![];_0x461266[_0x08ef('0x9b')]=moment(_0x41847e[_0x08ef('0x7c')])[_0x08ef('0xa1')](_0xd8906f['holdtime'],_0x08ef('0xa2'))[_0x08ef('0x4c')](_0x08ef('0x7d'));_0x461266[_0x08ef('0x8a')]='FORWARDTRANSFER';_0x461266['transfer']=!![];_0x461266[_0x08ef('0xa3')]=_0x08ef('0xa4');_0x461266[_0x08ef('0xa5')]=_0xd8906f['destexten'];_0x461266[_0x08ef('0xa6')]=_0xd8906f[_0x08ef('0x4b')];logger[_0x08ef('0x91')](_0x08ef('0xa7'),_0x461266[_0x08ef('0x51')],_0x461266['type']);var _0x17e712=this[_0x08ef('0xf')][_0xd8906f['linkedid']];this[_0x08ef('0xf')][_0xd8906f[_0x08ef('0xa0')]]=this[_0x08ef('0xf')][_0xd8906f[_0x08ef('0x4b')]];this[_0x08ef('0xf')][_0xd8906f[_0x08ef('0x4b')]]=_0x17e712;}}else{_0x41847e[_0x08ef('0x8a')]=_0x08ef('0xa8')+_0xd8906f[_0x08ef('0xa9')][_0x08ef('0xaa')]();logger[_0x08ef('0x91')](_0x08ef('0xab'),_0x41847e[_0x08ef('0x51')],_0x41847e[_0x08ef('0x5d')],_0x41847e[_0x08ef('0x8a')]);}}}this['channels'][_0xd8906f[_0x08ef('0x4b')]]=_0x41847e;this[_0x08ef('0x4f')](_0x41847e,_0x08ef('0x20'));}}}catch(_0x99cc2e){logger[_0x08ef('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0xd8906f[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x99cc2e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0x24')]=function(_0x171332){try{if(this[_0x08ef('0x69')](_0x171332)){logger[_0x08ef('0x49')]('[%s][voiceQueueReport][varset]',_0x171332['uniqueid'],util[_0x08ef('0x43')](_0x171332,{'showHidden':![],'depth':null}));this[_0x08ef('0xac')](_0x171332[_0x08ef('0x4b')],_[_0x08ef('0x82')](_0x171332[_0x08ef('0xad')])[0x0],_0x171332['value']);if(this[_0x08ef('0xf')][_0x171332[_0x08ef('0x4b')]]){var _0x3fbc50=_[_0x08ef('0x94')](this[_0x08ef('0xf')][_0x171332[_0x08ef('0x4b')]]);if(_0x3fbc50){if(this[_0x08ef('0x69')](_0x171332[_0x08ef('0xad')])&&this[_0x08ef('0x69')](_0x171332['variable'][_0x08ef('0xae')])){switch(_0x171332[_0x08ef('0xaf')]){case _0x08ef('0xb0'):_0x3fbc50[_0x08ef('0x9a')]=![];_0x3fbc50[_0x08ef('0x9b')]=null;break;case'TIMEOUT':_0x3fbc50['lastevent']=_0x08ef('0xb1');_0x3fbc50[_0x08ef('0x9a')]=!![];_0x3fbc50['queuecallerexitAt']=moment()[_0x08ef('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fbc50[_0x08ef('0x8e')]=moment()['format'](_0x08ef('0x7d'));logger[_0x08ef('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x171332[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x3fbc50,{'showHidden':![],'depth':null}));ami[_0x08ef('0x47')](_0x08ef('0xb2'),_0x3fbc50);break;default:_0x3fbc50[_0x08ef('0x9a')]=!![];_0x3fbc50[_0x08ef('0x9b')]=moment()[_0x08ef('0x4c')](_0x08ef('0x7d'));_0x3fbc50[_0x08ef('0x8e')]=moment()['format'](_0x08ef('0x7d'));}_0x3fbc50[_0x08ef('0x1d')]=![];_0x3fbc50[_0x08ef('0x89')]=null;_0x3fbc50[_0x08ef('0x8a')]=_0x171332[_0x08ef('0xaf')];this['channels'][_0x171332[_0x08ef('0x4b')]]=_0x3fbc50;this['emitVoiceQueueChannelRemove'](_0x3fbc50,_0x08ef('0x23'));}else if(this[_0x08ef('0x69')](_0x171332[_0x08ef('0xad')])&&this[_0x08ef('0x69')](_0x171332[_0x08ef('0xad')][_0x08ef('0xb3')])){if(!_0x3fbc50[_0x08ef('0x1d')]){_0x3fbc50['queuecallerexit']=!![];_0x3fbc50[_0x08ef('0x9b')]=moment()[_0x08ef('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fbc50[_0x08ef('0x8a')]=_0x08ef('0xb4');_0x3fbc50[_0x08ef('0x8e')]=moment()[_0x08ef('0x4c')](_0x08ef('0x7d'));this[_0x08ef('0x11')][_0x171332[_0x08ef('0x4b')]]=_0x3fbc50;}}logger[_0x08ef('0x91')](_0x08ef('0xb5'),_0x171332[_0x08ef('0x4b')],_0x3fbc50[_0x08ef('0x51')],_0x3fbc50[_0x08ef('0x5d')],_[_0x08ef('0x82')](_0x171332['variable'])[0x0],_0x171332[_0x08ef('0xaf')]);_0x3fbc50[_0x08ef('0x15')]=this[_0x08ef('0x15')][_0x171332[_0x08ef('0x4b')]];}}}}catch(_0x1f9731){logger[_0x08ef('0x41')]('[%s][voiceQueueReport][varset]',_0x171332[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x1f9731,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0xac')]=function(_0x363f1f,_0x3cfe0a,_0x42a5d1){var _0x357bd3=['rtpaudioqos',_0x08ef('0xb6'),_0x08ef('0xb7'),_0x08ef('0xb8'),'rtpaudioqosloss',_0x08ef('0xb9'),_0x08ef('0xba'),_0x08ef('0xbb'),_0x08ef('0xbc'),'sipuri',_0x08ef('0xbd'),_0x08ef('0xbe'),'membercalls',_0x08ef('0xbf'),_0x08ef('0xc0'),'memberlastcall',_0x08ef('0x99'),_0x08ef('0xc1'),_0x08ef('0xc2')];if(!_[_0x08ef('0x3b')](_0x3cfe0a)&&!_['includes'](_0x357bd3,_0x3cfe0a)){if(_[_0x08ef('0x6a')](this[_0x08ef('0x15')][_0x363f1f])){this[_0x08ef('0x15')][_0x363f1f]={};}this[_0x08ef('0x15')][_0x363f1f][_0x3cfe0a]=_0x42a5d1;}};VoiceQueueReport[_0x08ef('0xa')][_0x08ef('0x26')]=function(_0x57a186){try{if(this[_0x08ef('0x69')](_0x57a186)){logger[_0x08ef('0x49')](_0x08ef('0xc3'),_0x57a186[_0x08ef('0x4b')],util[_0x08ef('0x43')](_0x57a186,{'showHidden':![],'depth':null}));if(this[_0x08ef('0xf')][_0x57a186[_0x08ef('0x4b')]]){for(var _0x257b14=0x0,_0x1491bc={};_0x257b14=0x0?moment(_0x3c1164[_0x58c9('0x18')])[_0x58c9('0xc')](_0x3c1164[_0x58c9('0x17')],_0x58c9('0xd')):null,'data1':'outbound','data2':_0x3c1164[_0x58c9('0x11')],'data3':_0x3c1164[_0x58c9('0x19')],'data4':_0x3c1164[_0x58c9('0x1a')]||null,'role':_0x58c9('0x10'),'internal':_0x3c1164['accountcode']?_[_0x58c9('0x12')](_0x3c1164['accountcode']):undefined,'uniqueid':_0x3c1164[_0x58c9('0x13')]},'log':_0x58c9('0x15')});}; \ No newline at end of file +var _0x30e9=['queuecallerexitAt','Request','CreateMemberReport','isNil','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','voice','membername','endtime','starttime','outbound','dialstring','agent','voiceQueueReport','queuecallercompleteAt'];(function(_0x51e6a9,_0x8b07bd){var _0x139213=function(_0x4df788){while(--_0x4df788){_0x51e6a9['push'](_0x51e6a9['shift']());}};_0x139213(++_0x8b07bd);}(_0x30e9,0x1ec));var _0x930e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x30e9[_0x2cfb58];return _0xd99951;};'use strict';var moment=require('moment');var _=require('lodash');var util=require('util');var client=require('../client');exports[_0x930e('0x0')]=function(_0x2a8662){var _0x5a67b6=_0x2a8662[_0x930e('0x1')]||_0x2a8662[_0x930e('0x2')];return client[_0x930e('0x3')](_0x930e('0x4'),{'body':{'channel':'voice','membername':_0x2a8662['lastAssignedTo'],'interface':_[_0x930e('0x5')](_0x2a8662['interface'])?util[_0x930e('0x6')](_0x930e('0x7'),_0x2a8662['lastAssignedTo']):_0x2a8662['interface'],'type':_0x930e('0x8'),'enterAt':_0x2a8662[_0x930e('0x9')],'exitAt':_0x5a67b6,'duration':moment(_0x5a67b6)[_0x930e('0xa')](_0x2a8662[_0x930e('0x9')],_0x930e('0xb')),'data1':_0x930e('0xc'),'data2':_0x2a8662['calleridnum'],'data3':_0x2a8662[_0x930e('0xd')],'data4':null,'data5':_0x2a8662[_0x930e('0xe')],'role':'agent','internal':_0x2a8662[_0x930e('0xf')]?_[_0x930e('0x10')](_0x2a8662['accountcode']):undefined,'uniqueid':_0x2a8662[_0x930e('0x11')]},'log':'CreateMemberReport'});};exports[_0x930e('0x12')]=function(_0x23ddd5){return client[_0x930e('0x3')]('CreateMemberReport',{'body':{'channel':_0x930e('0x13'),'membername':_0x23ddd5[_0x930e('0x14')],'interface':_0x23ddd5['interface'],'type':_0x930e('0x8'),'enterAt':_0x23ddd5['starttime'],'exitAt':_0x23ddd5[_0x930e('0x15')],'duration':moment(_0x23ddd5['endtime'])[_0x930e('0xa')](_0x23ddd5[_0x930e('0x16')],_0x930e('0xb'))>=0x0?moment(_0x23ddd5[_0x930e('0x15')])['diff'](_0x23ddd5['starttime'],_0x930e('0xb')):null,'data1':_0x930e('0x17'),'data2':_0x23ddd5[_0x930e('0xf')],'data3':_0x23ddd5[_0x930e('0xd')],'data4':_0x23ddd5[_0x930e('0x18')]||null,'role':_0x930e('0x19'),'internal':_0x23ddd5[_0x930e('0xf')]?_['toNumber'](_0x23ddd5[_0x930e('0xf')]):undefined,'uniqueid':_0x23ddd5[_0x930e('0x11')]},'log':_0x930e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c7643cf..bcdb999 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 _0x7008=['Request','stopRecordingOnTransfer'];(function(_0x323921,_0x25ecdd){var _0x54ae0d=function(_0x4da983){while(--_0x4da983){_0x323921['push'](_0x323921['shift']());}};_0x54ae0d(++_0x25ecdd);}(_0x7008,0x1ec));var _0x8700=function(_0x5a8a13,_0x2ebf83){_0x5a8a13=_0x5a8a13-0x0;var _0x581c50=_0x7008[_0x5a8a13];return _0x581c50;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x8700('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8700('0x1')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x6a24=['getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x178e68,_0x3998fc){var _0x501363=function(_0x29c29c){while(--_0x29c29c){_0x178e68['push'](_0x178e68['shift']());}};_0x501363(++_0x3998fc);}(_0x6a24,0xd1));var _0x46a2=function(_0x3854f6,_0x307471){_0x3854f6=_0x3854f6-0x0;var _0xe566a2=_0x6a24[_0x3854f6];return _0xe566a2;};'use strict';var client=require(_0x46a2('0x0'));exports[_0x46a2('0x1')]=function(){return client['Request'](_0x46a2('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x46a2('0x3')]},'log':_0x46a2('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ce9dd61..3ce3dc4 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 _0x3e90=['getTemplates','Request','GetTemplate','name','html'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x3e90,0xf0));var _0x03e9=function(_0x562ebc,_0x44bcfb){_0x562ebc=_0x562ebc-0x0;var _0x1ff70f=_0x3e90[_0x562ebc];return _0x1ff70f;};'use strict';var client=require('../client');exports[_0x03e9('0x0')]=function(_0x5f3e13){return function(_0x6b0934){return client[_0x03e9('0x1')](_0x03e9('0x2'),{'options':{'raw':!![],'attributes':['id',_0x03e9('0x3'),_0x03e9('0x4')]},'log':_0x03e9('0x2')});};}; \ No newline at end of file +var _0x2739=['Request','html','GetTemplate','../client'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2739,0x8b));var _0x9273=function(_0x330f2f,_0x18ce11){_0x330f2f=_0x330f2f-0x0;var _0x2cc242=_0x2739[_0x330f2f];return _0x2cc242;};'use strict';var client=require(_0x9273('0x0'));exports['getTemplates']=function(_0x4abbcb){return function(_0x58c0aa){return client[_0x9273('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x9273('0x2')]},'log':_0x9273('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 949f684..1f9e160 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 _0xfb34=['data3','data4','data5','data6','data7','../client','Request','GetTrigger','status','Condition','AllConditions','field','AnyConditions','operator','value','Action','action'];(function(_0x87e0fe,_0x268e65){var _0x43408c=function(_0x416eb7){while(--_0x416eb7){_0x87e0fe['push'](_0x87e0fe['shift']());}};_0x43408c(++_0x268e65);}(_0xfb34,0x6b));var _0x4fb3=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xfb34[_0x80f51a];return _0x327148;};'use strict';var client=require(_0x4fb3('0x0'));exports['getTriggers']=function(_0x43fa45){return function(_0x496c0f){return client[_0x4fb3('0x1')](_0x4fb3('0x2'),{'options':{'raw':![],'attributes':['id','name','channel',_0x4fb3('0x3')],'include':[{'model':_0x4fb3('0x4'),'as':_0x4fb3('0x5'),'attributes':['id',_0x4fb3('0x6'),'operator','value']},{'model':_0x4fb3('0x4'),'as':_0x4fb3('0x7'),'attributes':['id',_0x4fb3('0x6'),_0x4fb3('0x8'),_0x4fb3('0x9')]},{'model':_0x4fb3('0xa'),'as':'Actions','attributes':['id',_0x4fb3('0xb'),'data1','data2',_0x4fb3('0xc'),_0x4fb3('0xd'),_0x4fb3('0xe'),_0x4fb3('0xf'),_0x4fb3('0x10')]}]},'log':_0x4fb3('0x2')});};}; \ No newline at end of file +var _0x51ae=['data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','field','operator','value','AnyConditions','Action','data1','data2','data4','data5','data6'];(function(_0x6620b8,_0x8b3d5e){var _0x33de50=function(_0x2f1f07){while(--_0x2f1f07){_0x6620b8['push'](_0x6620b8['shift']());}};_0x33de50(++_0x8b3d5e);}(_0x51ae,0x18d));var _0xe51a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x51ae[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0xe51a('0x0'));exports[_0xe51a('0x1')]=function(_0xe0f859){return function(_0x242e72){return client['Request'](_0xe51a('0x2'),{'options':{'raw':![],'attributes':['id',_0xe51a('0x3'),_0xe51a('0x4'),_0xe51a('0x5')],'include':[{'model':_0xe51a('0x6'),'as':'AllConditions','attributes':['id',_0xe51a('0x7'),_0xe51a('0x8'),_0xe51a('0x9')]},{'model':_0xe51a('0x6'),'as':_0xe51a('0xa'),'attributes':['id',_0xe51a('0x7'),'operator',_0xe51a('0x9')]},{'model':_0xe51a('0xb'),'as':'Actions','attributes':['id','action',_0xe51a('0xc'),_0xe51a('0xd'),'data3',_0xe51a('0xe'),_0xe51a('0xf'),_0xe51a('0x10'),_0xe51a('0x11')]}]},'log':_0xe51a('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7653dac..6110817 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 _0x8d1f=['Request','name','defaultuser','getTrunks'];(function(_0x317b5f,_0x4baa96){var _0x18efe2=function(_0x3ced7f){while(--_0x3ced7f){_0x317b5f['push'](_0x317b5f['shift']());}};_0x18efe2(++_0x4baa96);}(_0x8d1f,0x137));var _0xf8d1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8d1f[_0x57b54c];return _0x59cc19;};'use strict';var client=require('../client');exports[_0xf8d1('0x0')]=function(_0x4ca083){return function(_0x5ebb81){return client[_0xf8d1('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf8d1('0x2'),'registry',_0xf8d1('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xc678=['GetTrunk','Request','name','registry','defaultuser'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc678,0x1b4));var _0x8c67=function(_0x1dde23,_0x28dda7){_0x1dde23=_0x1dde23-0x0;var _0x56e50c=_0xc678[_0x1dde23];return _0x56e50c;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x3002e5){return function(_0x137fa2){return client[_0x8c67('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8c67('0x1'),_0x8c67('0x2'),_0x8c67('0x3')]},'log':_0x8c67('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b97c356..ecf7ef2 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x14f3de,_0x5696f4){var _0x132d66=function(_0x51c47c){while(--_0x51c47c){_0x14f3de['push'](_0x14f3de['shift']());}};_0x132d66(++_0x5696f4);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b940f,_0x7afa2b){_0x1b940f=_0x1b940f-0x0;var _0x426ec5=_0xedd9[_0x1b940f];return _0x426ec5;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x40b2ae,_0x43eb53){var _0x4e701d=function(_0x9644f1){while(--_0x9644f1){_0x40b2ae['push'](_0x40b2ae['shift']());}};_0x4e701d(++_0x43eb53);}(_0x70e0,0x17b));var _0x070e=function(_0x2112e3,_0x219ca6){_0x2112e3=_0x2112e3-0x0;var _0x553436=_0x70e0[_0x2112e3];return _0x553436;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index ea5e81c..3e91552 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 _0xc4df=['update','UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x4e37c2,_0x9cbc0b){var _0x307dcc=function(_0x54ccf9){while(--_0x54ccf9){_0x4e37c2['push'](_0x4e37c2['shift']());}};_0x307dcc(++_0x9cbc0b);}(_0xc4df,0x197));var _0xfc4d=function(_0x22895b,_0xb615ab){_0x22895b=_0x22895b-0x0;var _0x1cf55b=_0xc4df[_0x22895b];return _0x1cf55b;};'use strict';var client=require('../client');exports[_0xfc4d('0x0')]=function(_0x198ff4){return client[_0xfc4d('0x1')](_0xfc4d('0x2'),{'body':_0x198ff4,'log':_0xfc4d('0x2')});};exports[_0xfc4d('0x3')]=function(_0x34f277,_0x3a65d9,_0x5b9129){return client['Request']('UpdateVoiceAgentReport',{'body':_0x34f277,'options':{'where':{'uniqueid':_0x3a65d9,'interface':_0x5b9129,'agentcomplete':!![]}},'log':_0xfc4d('0x4')});}; \ No newline at end of file +var _0x4ed7=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x1be7b0,_0x27e05a){var _0x568459=function(_0x34fbe1){while(--_0x34fbe1){_0x1be7b0['push'](_0x1be7b0['shift']());}};_0x568459(++_0x27e05a);}(_0x4ed7,0x1e0));var _0x74ed=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x4ed7[_0x277af0];return _0x43bd7c;};'use strict';var client=require('../client');exports[_0x74ed('0x0')]=function(_0x3897fc){return client[_0x74ed('0x1')](_0x74ed('0x2'),{'body':_0x3897fc,'log':'CreateVoiceAgentReport'});};exports[_0x74ed('0x3')]=function(_0xa8628,_0x11c438,_0x1c89b5){return client['Request'](_0x74ed('0x4'),{'body':_0xa8628,'options':{'where':{'uniqueid':_0x11c438,'interface':_0x1c89b5,'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 871360e..3dbea09 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 _0x32c0=['moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x32c0,0x17a));var _0x032c=function(_0x2ea9b9,_0x3b4887){_0x2ea9b9=_0x2ea9b9-0x0;var _0x47f682=_0x32c0[_0x2ea9b9];return _0x47f682;};'use strict';var moment=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var _=require('lodash');var client=require('../client');exports[_0x032c('0x2')]=function(_0x1cb5b2){return client[_0x032c('0x3')](_0x032c('0x4'),{'body':_[_0x032c('0x5')](_0x1cb5b2,{'source':_0x1cb5b2[_0x032c('0x6')],'destinationcontext':_0x1cb5b2[_0x032c('0x7')],'callerid':_0x1cb5b2['callerid'],'amaflags':_0x032c('0x8')}),'log':_0x032c('0x4')});};exports[_0x032c('0x9')]=function(){return function(){return client[_0x032c('0x3')](_0x032c('0xa'),{'options':{'where':{'type':[_0x032c('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x032c('0xc'))[_0x032c('0xd')](_0x032c('0xe')),moment()[_0x032c('0xf')]('day')['format'](_0x032c('0xe'))]}},'attributes':[_0x032c('0x10'),_0x032c('0x11'),_0x032c('0x12'),_0x032c('0x13')]},'log':_0x032c('0x14')});};}; \ No newline at end of file +var _0xffd3=['disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x50d831,_0x55c5ce){var _0x5b9f30=function(_0x29146e){while(--_0x29146e){_0x50d831['push'](_0x50d831['shift']());}};_0x5b9f30(++_0x55c5ce);}(_0xffd3,0x1df));var _0x3ffd=function(_0x382372,_0x4302fc){_0x382372=_0x382372-0x0;var _0x87680a=_0xffd3[_0x382372];return _0x87680a;};'use strict';var moment=require(_0x3ffd('0x0'));var util=require(_0x3ffd('0x1'));var _=require(_0x3ffd('0x2'));var client=require(_0x3ffd('0x3'));exports[_0x3ffd('0x4')]=function(_0x298cfa){return client[_0x3ffd('0x5')](_0x3ffd('0x6'),{'body':_[_0x3ffd('0x7')](_0x298cfa,{'source':_0x298cfa[_0x3ffd('0x8')],'destinationcontext':_0x298cfa[_0x3ffd('0x9')],'callerid':_0x298cfa[_0x3ffd('0xa')],'amaflags':_0x3ffd('0xb')}),'log':'CreateVoiceCallReport'});};exports[_0x3ffd('0xc')]=function(){return function(){return client[_0x3ffd('0x5')](_0x3ffd('0xd'),{'options':{'where':{'type':[_0x3ffd('0xe')],'createdAt':{'$between':[moment()[_0x3ffd('0xf')](_0x3ffd('0x10'))[_0x3ffd('0x11')](_0x3ffd('0x12')),moment()[_0x3ffd('0x13')](_0x3ffd('0x10'))[_0x3ffd('0x11')](_0x3ffd('0x12'))]}},'attributes':[_0x3ffd('0x14'),_0x3ffd('0x15'),_0x3ffd('0x16'),_0x3ffd('0x17')]},'log':_0x3ffd('0x18')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 84feafd..a3f0a87 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 _0x8ad3=['Request','CreateVoiceDialReport','create'];(function(_0x2860ab,_0x27440f){var _0x3037c4=function(_0x1eb3f3){while(--_0x1eb3f3){_0x2860ab['push'](_0x2860ab['shift']());}};_0x3037c4(++_0x27440f);}(_0x8ad3,0x188));var _0x38ad=function(_0x5e49b0,_0x388161){_0x5e49b0=_0x5e49b0-0x0;var _0x285249=_0x8ad3[_0x5e49b0];return _0x285249;};'use strict';var client=require('../client');exports[_0x38ad('0x0')]=function(_0x35f133){return client[_0x38ad('0x1')](_0x38ad('0x2'),{'body':_0x35f133,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4e6f=['Request','CreateVoiceDialReport','../client','create'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x4e6f,0x18a));var _0xf4e6=function(_0x4ea1c1,_0x5e2c44){_0x4ea1c1=_0x4ea1c1-0x0;var _0x329628=_0x4e6f[_0x4ea1c1];return _0x329628;};'use strict';var client=require(_0xf4e6('0x0'));exports[_0xf4e6('0x1')]=function(_0xf35792){return client[_0xf4e6('0x2')](_0xf4e6('0x3'),{'body':_0xf35792,'log':_0xf4e6('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 596fb0c..1a9cb7b 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 _0x2f3a=['getVoiceExtensions','../client','GetVoiceExtension','exten','recordingFormat'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x33a3d7,_0xe57ec2){_0x33a3d7=_0x33a3d7-0x0;var _0xf4c7a3=_0x2f3a[_0x33a3d7];return _0xf4c7a3;};'use strict';var client=require(_0xa2f3('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xa2f3('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa2f3('0x2'),_0xa2f3('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xa2f3('0x4')});};}; \ No newline at end of file +var _0x5b02=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0xc4453a,_0x47088f){var _0x91f9ac=function(_0x304180){while(--_0x304180){_0xc4453a['push'](_0xc4453a['shift']());}};_0x91f9ac(++_0x47088f);}(_0x5b02,0xe9));var _0x25b0=function(_0x249ec6,_0x450da6){_0x249ec6=_0x249ec6-0x0;var _0x1659e5=_0x5b02[_0x249ec6];return _0x1659e5;};'use strict';var client=require(_0x25b0('0x0'));exports[_0x25b0('0x1')]=function(){return function(){return client[_0x25b0('0x2')](_0x25b0('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x25b0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1601969..e0a7e07 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 _0x3cd8=['callerid','active','Pause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd8,0x150));var _0x83cd=function(_0xff8595,_0x39341d){_0xff8595=_0xff8595-0x0;var _0x31e49e=_0x3cd8[_0xff8595];return _0x31e49e;};'use strict';var client=require(_0x83cd('0x0'));exports[_0x83cd('0x1')]=function(){return function(){return client[_0x83cd('0x2')](_0x83cd('0x3'),{'options':{'raw':![],'attributes':['id',_0x83cd('0x4'),_0x83cd('0x5'),_0x83cd('0x6'),_0x83cd('0x7'),'monitor_format',_0x83cd('0x8'),_0x83cd('0x9'),_0x83cd('0xa'),_0x83cd('0xb'),_0x83cd('0xc'),_0x83cd('0xd'),_0x83cd('0xe'),_0x83cd('0xf'),_0x83cd('0x10'),_0x83cd('0x11'),_0x83cd('0x12'),_0x83cd('0x13'),_0x83cd('0x14'),_0x83cd('0x15'),_0x83cd('0x16'),_0x83cd('0x17'),_0x83cd('0x18'),_0x83cd('0x19'),_0x83cd('0x1a'),_0x83cd('0x1b'),'dialNoAnswerRetryFrequency',_0x83cd('0x1c'),_0x83cd('0x1d'),_0x83cd('0x1e'),_0x83cd('0x1f'),_0x83cd('0x20'),_0x83cd('0x21'),_0x83cd('0x22'),_0x83cd('0x23'),'dialAMDAfterGreetingSilence',_0x83cd('0x24'),_0x83cd('0x25'),_0x83cd('0x26'),_0x83cd('0x27'),_0x83cd('0x28'),_0x83cd('0x29'),'timeout','dialRecallMeTimeout',_0x83cd('0x2a'),_0x83cd('0x2b'),_0x83cd('0x2c'),_0x83cd('0x2d'),_0x83cd('0x2e'),_0x83cd('0x2f'),_0x83cd('0x30'),_0x83cd('0x31'),'dialCutDigit',_0x83cd('0x32'),'dialNoSuchNumberRetryFrequency',_0x83cd('0x33'),_0x83cd('0x34'),_0x83cd('0x35'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x83cd('0x36'),'dialAgentRejectMaxRetry',_0x83cd('0x37'),_0x83cd('0x38'),'dialPredictiveIntervalMaxThreshold',_0x83cd('0x39'),_0x83cd('0x3a')],'include':[{'model':_0x83cd('0x3b'),'as':_0x83cd('0x3b'),'attributes':['id',_0x83cd('0x4'),_0x83cd('0x3c'),_0x83cd('0x3d')]},{'model':_0x83cd('0x3e'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x83cd('0x3b'),'as':'TrunkBackup','attributes':['id',_0x83cd('0x4'),_0x83cd('0x3c'),_0x83cd('0x3d')]},{'model':'Interval','as':_0x83cd('0x3f'),'attributes':['id',_0x83cd('0x4')],'include':[{'model':_0x83cd('0x3f'),'as':_0x83cd('0x40'),'attributes':['id',_0x83cd('0x4'),_0x83cd('0x41')]}]}]},'log':_0x83cd('0x1')});};}; \ No newline at end of file +var _0x770d=['dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x770d,0x122));var _0xd770=function(_0x4aafba,_0x5c7aeb){_0x4aafba=_0x4aafba-0x0;var _0xa0567b=_0x770d[_0x4aafba];return _0xa0567b;};'use strict';var client=require(_0xd770('0x0'));exports[_0xd770('0x1')]=function(){return function(){return client[_0xd770('0x2')](_0xd770('0x3'),{'options':{'raw':![],'attributes':['id',_0xd770('0x4'),_0xd770('0x5'),_0xd770('0x6'),'autopause',_0xd770('0x7'),_0xd770('0x8'),_0xd770('0x9'),_0xd770('0xa'),'dialLimitChannel','dialLimitQueue',_0xd770('0xb'),_0xd770('0xc'),_0xd770('0xd'),_0xd770('0xe'),_0xd770('0xf'),_0xd770('0x10'),_0xd770('0x11'),'dialQueueOptions',_0xd770('0x12'),_0xd770('0x13'),_0xd770('0x14'),_0xd770('0x15'),_0xd770('0x16'),'dialBusyRetryFrequency',_0xd770('0x17'),_0xd770('0x18'),_0xd770('0x19'),_0xd770('0x1a'),_0xd770('0x1b'),_0xd770('0x1c'),_0xd770('0x1d'),_0xd770('0x1e'),'dialAMDInitialSilence','dialAMDGreeting',_0xd770('0x1f'),_0xd770('0x20'),_0xd770('0x21'),_0xd770('0x22'),'dialAMDMaximumNumberOfWords',_0xd770('0x23'),_0xd770('0x24'),_0xd770('0x25'),_0xd770('0x26'),'dialRecallInQueue',_0xd770('0x27'),'dialAgiAfterHangupAgent',_0xd770('0x28'),_0xd770('0x29'),_0xd770('0x7'),_0xd770('0x2a'),_0xd770('0x2b'),_0xd770('0x2c'),_0xd770('0x2d'),_0xd770('0x2e'),_0xd770('0x2f'),'dialDropRetryFrequency',_0xd770('0x30'),'dialAbandonedRetryFrequency',_0xd770('0x31'),'dialMachineRetryFrequency',_0xd770('0x32'),_0xd770('0x33'),_0xd770('0x34'),_0xd770('0x35'),_0xd770('0x36'),'dialPreviewAutoRecallMe'],'include':[{'model':_0xd770('0x37'),'as':_0xd770('0x37'),'attributes':['id','name',_0xd770('0x38'),_0xd770('0x39')]},{'model':_0xd770('0x3a'),'as':_0xd770('0x3b'),'attributes':['id','name']},{'model':_0xd770('0x37'),'as':_0xd770('0x3c'),'attributes':['id',_0xd770('0x4'),_0xd770('0x38'),'active']},{'model':_0xd770('0x3d'),'as':_0xd770('0x3d'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xd770('0x3e'),'attributes':['id',_0xd770('0x4'),_0xd770('0x3f')]}]}]},'log':_0xd770('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 1aa9d13..dc87150 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(_0x2f7b82,_0xb01350){var _0x5cd6a2=function(_0x43ed57){while(--_0x43ed57){_0x2f7b82['push'](_0x2f7b82['shift']());}};_0x5cd6a2(++_0xb01350);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x1e6e5a,_0x563998){var _0x394a5a=function(_0x94d406){while(--_0x94d406){_0x1e6e5a['push'](_0x1e6e5a['shift']());}};_0x394a5a(++_0x563998);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 32e0a0d..9d82f5f 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 _0x037e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0xdbf101,_0x4aa1da){var _0x4d46c0=function(_0x4f0e43){while(--_0x4f0e43){_0xdbf101['push'](_0xdbf101['shift']());}};_0x4d46c0(++_0x4aa1da);}(_0x037e,0x1aa));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0xe037('0x0')]=function(_0x280838){return function(){return client[_0xe037('0x1')](_0xe037('0x2'),{'options':{'where':{'VoiceQueueId':_0x280838,'paused':!![]},'raw':!![]},'log':_0xe037('0x0')});};}; \ No newline at end of file +var _0xe716=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x5096a1,_0x1ea2fe){var _0x480c90=function(_0x239a51){while(--_0x239a51){_0x5096a1['push'](_0x5096a1['shift']());}};_0x480c90(++_0x1ea2fe);}(_0xe716,0x1bf));var _0x6e71=function(_0x29024a,_0x2eee9d){_0x29024a=_0x29024a-0x0;var _0x110c65=_0xe716[_0x29024a];return _0x110c65;};'use strict';var client=require(_0x6e71('0x0'));exports[_0x6e71('0x1')]=function(_0xa21ef1){return function(){return client[_0x6e71('0x2')](_0x6e71('0x3'),{'options':{'where':{'VoiceQueueId':_0xa21ef1,'paused':!![]},'raw':!![]},'log':_0x6e71('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index aff5360..c580f16 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(_0x46d129,_0x504d6d){var _0x280621=function(_0x5b6c36){while(--_0x5b6c36){_0x46d129['push'](_0x46d129['shift']());}};_0x280621(++_0x504d6d);}(_0x7a54,0x106));var _0x47a5=function(_0x3fc0c7,_0x30acde){_0x3fc0c7=_0x3fc0c7-0x0;var _0x1c1122=_0x7a54[_0x3fc0c7];return _0x1c1122;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x318ca1,_0x30bf76){var _0x438e11=function(_0x1b4e69){while(--_0x1b4e69){_0x318ca1['push'](_0x318ca1['shift']());}};_0x438e11(++_0x30bf76);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 822b3de..66476ab 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 _0xfcd6=['transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x375ddd,_0x1f84e1){var _0x575d4c=function(_0x5398fc){while(--_0x5398fc){_0x375ddd['push'](_0x375ddd['shift']());}};_0x575d4c(++_0x1f84e1);}(_0xfcd6,0xf8));var _0x6fcd=function(_0x3dd60f,_0x4566bd){_0x3dd60f=_0x3dd60f-0x0;var _0x2cb70e=_0xfcd6[_0x3dd60f];return _0x2cb70e;};'use strict';var client=require(_0x6fcd('0x0'));exports[_0x6fcd('0x1')]={};exports[_0x6fcd('0x2')]=function(_0x4cece2){return client[_0x6fcd('0x3')](_0x6fcd('0x4'),{'body':{'result':_0x4cece2[_0x6fcd('0x5')],'transfererchannel':_0x4cece2['transfererchannel'],'transferercalleridnum':_0x4cece2['transferercalleridnum'],'transferercalleridname':_0x4cece2[_0x6fcd('0x6')],'transfererconnectedlinenum':_0x4cece2[_0x6fcd('0x7')],'transfererconnectedlinename':_0x4cece2[_0x6fcd('0x8')],'transfereraccountcode':_0x4cece2[_0x6fcd('0x9')],'transferercontext':_0x4cece2['transferercontext'],'transfererexten':_0x4cece2['transfererexten'],'transfererlinkedid':_0x4cece2[_0x6fcd('0xa')],'transfereechannel':_0x4cece2[_0x6fcd('0xb')],'transfereecalleridnum':_0x4cece2[_0x6fcd('0xc')],'transfereecalleridname':_0x4cece2[_0x6fcd('0xd')],'transfereeconnectedlinenum':_0x4cece2[_0x6fcd('0xe')],'transfereeconnectedlinename':_0x4cece2[_0x6fcd('0xf')],'transfereeaccountcode':_0x4cece2[_0x6fcd('0x10')],'transfereecontext':_0x4cece2[_0x6fcd('0x11')],'transfereeexten':_0x4cece2[_0x6fcd('0x12')],'transfereelinkedid':_0x4cece2[_0x6fcd('0x13')],'isexternal':_0x4cece2[_0x6fcd('0x14')],'context':_0x4cece2[_0x6fcd('0x15')],'extension':_0x4cece2[_0x6fcd('0x16')],'type':_0x6fcd('0x17')},'log':_0x6fcd('0x4')});};exports[_0x6fcd('0x18')]=function(_0x2dd9bc){return client[_0x6fcd('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2dd9bc[_0x6fcd('0x5')],'transfererchannel':_0x2dd9bc['origtransfererchannel'],'transferercalleridnum':_0x2dd9bc[_0x6fcd('0x19')],'transferercalleridname':_0x2dd9bc[_0x6fcd('0x1a')],'transfererconnectedlinenum':_0x2dd9bc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2dd9bc[_0x6fcd('0x1b')],'transfereraccountcode':_0x2dd9bc[_0x6fcd('0x1c')],'transferercontext':_0x2dd9bc['secondtransferercontext'],'transfererexten':_0x2dd9bc[_0x6fcd('0x1d')],'transfererlinkedid':_0x2dd9bc[_0x6fcd('0x1e')],'transfereechannel':_0x2dd9bc['transfertargetchannel'],'transfereecalleridnum':_0x2dd9bc[_0x6fcd('0x1f')],'transfereecalleridname':_0x2dd9bc[_0x6fcd('0x20')],'transfereeconnectedlinenum':_0x2dd9bc[_0x6fcd('0x21')],'transfereeconnectedlinename':_0x2dd9bc[_0x6fcd('0x22')],'transfereeaccountcode':_0x2dd9bc[_0x6fcd('0x23')],'transfereecontext':_0x2dd9bc[_0x6fcd('0x24')],'transfereeexten':_0x2dd9bc[_0x6fcd('0x25')],'transfereelinkedid':_0x2dd9bc['transfertargetlinkedid'],'isexternal':_0x2dd9bc[_0x6fcd('0x14')],'context':_0x2dd9bc['origtransferercontext'],'extension':_0x2dd9bc['origtransfererexten'],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x5089=['transfertargetexten','origtransferercontext','attended','../client','transfers','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext'];(function(_0x2be104,_0x4bf5d0){var _0x31c115=function(_0x41d524){while(--_0x41d524){_0x2be104['push'](_0x2be104['shift']());}};_0x31c115(++_0x4bf5d0);}(_0x5089,0x1a7));var _0x9508=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x5089[_0x32d457];return _0x338386;};'use strict';var client=require(_0x9508('0x0'));exports[_0x9508('0x1')]={};exports['blindTransfer']=function(_0x52e0a9){return client[_0x9508('0x2')](_0x9508('0x3'),{'body':{'result':_0x52e0a9['result'],'transfererchannel':_0x52e0a9[_0x9508('0x4')],'transferercalleridnum':_0x52e0a9[_0x9508('0x5')],'transferercalleridname':_0x52e0a9[_0x9508('0x6')],'transfererconnectedlinenum':_0x52e0a9[_0x9508('0x7')],'transfererconnectedlinename':_0x52e0a9['transfererconnectedlinename'],'transfereraccountcode':_0x52e0a9[_0x9508('0x8')],'transferercontext':_0x52e0a9[_0x9508('0x9')],'transfererexten':_0x52e0a9['transfererexten'],'transfererlinkedid':_0x52e0a9['transfererlinkedid'],'transfereechannel':_0x52e0a9[_0x9508('0xa')],'transfereecalleridnum':_0x52e0a9[_0x9508('0xb')],'transfereecalleridname':_0x52e0a9[_0x9508('0xc')],'transfereeconnectedlinenum':_0x52e0a9['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x52e0a9['transfereeconnectedlinename'],'transfereeaccountcode':_0x52e0a9[_0x9508('0xd')],'transfereecontext':_0x52e0a9['transfereecontext'],'transfereeexten':_0x52e0a9[_0x9508('0xe')],'transfereelinkedid':_0x52e0a9[_0x9508('0xf')],'isexternal':_0x52e0a9[_0x9508('0x10')],'context':_0x52e0a9[_0x9508('0x11')],'extension':_0x52e0a9['extension'],'type':_0x9508('0x12')},'log':'CreateVoiceTransferReport'});};exports[_0x9508('0x13')]=function(_0xe5dddc){return client[_0x9508('0x2')](_0x9508('0x3'),{'body':{'result':_0xe5dddc[_0x9508('0x14')],'transfererchannel':_0xe5dddc['origtransfererchannel'],'transferercalleridnum':_0xe5dddc[_0x9508('0x15')],'transferercalleridname':_0xe5dddc[_0x9508('0x16')],'transfererconnectedlinenum':_0xe5dddc[_0x9508('0x17')],'transfererconnectedlinename':_0xe5dddc['secondtransfererconnectedlinename'],'transfereraccountcode':_0xe5dddc['origtransfereraccountcode'],'transferercontext':_0xe5dddc[_0x9508('0x18')],'transfererexten':_0xe5dddc['secondtransfererexten'],'transfererlinkedid':_0xe5dddc['origtransfererlinkedid'],'transfereechannel':_0xe5dddc[_0x9508('0x19')],'transfereecalleridnum':_0xe5dddc[_0x9508('0x1a')],'transfereecalleridname':_0xe5dddc[_0x9508('0x1b')],'transfereeconnectedlinenum':_0xe5dddc[_0x9508('0x1c')],'transfereeconnectedlinename':_0xe5dddc[_0x9508('0x1d')],'transfereeaccountcode':_0xe5dddc[_0x9508('0x1e')],'transfereecontext':_0xe5dddc[_0x9508('0x1f')],'transfereeexten':_0xe5dddc[_0x9508('0x20')],'transfereelinkedid':_0xe5dddc['transfertargetlinkedid'],'isexternal':_0xe5dddc['isexternal'],'context':_0xe5dddc[_0x9508('0x21')],'extension':_0xe5dddc['origtransfererexten'],'type':_0x9508('0x22')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a8488cd..516b192 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 _0x6f44=['dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','uniqueid','channel','%s.%s','format','wav','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outbound','run','custom:','event','faxAccounts','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','join','module','action','Reload','catch','message','error','ami\x20disconnected','pick','command','Action','then','content','voiceQueues','hasOwnProperty','answered','sumBillable','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0xf2509e,_0x442e8b){var _0x2207c9=function(_0x5d80e2){while(--_0x5d80e2){_0xf2509e['push'](_0xf2509e['shift']());}};_0x2207c9(++_0x442e8b);}(_0x6f44,0x1ea));var _0x46f4=function(_0xb0dac2,_0x138073){_0xb0dac2=_0xb0dac2-0x0;var _0x603b4c=_0x6f44[_0xb0dac2];return _0x603b4c;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var jayson=require('jayson/promise');var schema=require(_0x46f4('0x2'));var BPromise=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var config=require(_0x46f4('0x5'));var properties=require(_0x46f4('0x6'));var ami=require(_0x46f4('0x7'));exports[_0x46f4('0x8')]=function(_0x200f8b,_0xfb0203,_0x57f1a9){return new BPromise(function(_0x169a5a,_0x2a50b1){var _0x37d6a2={'QueuePause':function(_0x4b791c){return new Promise(function(_0x5ce344,_0x357069){var _0x132ae1=util['format'](_0x46f4('0x9'),'SIP',_0x4b791c[_0x46f4('0xa')]);if(_0x200f8b['timers']&&_0x200f8b[_0x46f4('0xb')][_0x132ae1]&&_0x200f8b[_0x46f4('0xb')][_0x132ae1][_0x46f4('0xc')]){_0x200f8b[_0x46f4('0xb')][_0x132ae1][_0x46f4('0xd')]();}if(_0x200f8b[_0x46f4('0xe')][_0x132ae1]){_0x200f8b[_0x46f4('0xe')][_0x132ae1][_0x46f4('0xf')]({'statePause':_0x4b791c[_0x46f4('0x10')]?!![]:![]});}_0x5ce344({'code':0xc8,'message':_0x46f4('0x11')});});},'Reload':function(_0x1dd233){var _0x1262f6=this;return new Promise(function(_0x5649ad,_0x3b3b92){if(ami[_0x46f4('0x12')]()==![]){return _0x3b3b92(_0x1262f6['error'](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}_0x1dd233=_['pick'](_0x1dd233,_['keys'](properties[_0x46f4('0x16')]));_0x1dd233[_0x46f4('0x17')]=_0x46f4('0x18');return ami['Action'](_0x1dd233)['then'](function(_0x5e237d){_0x5649ad({'code':0xc8,'message':_0x5e237d['message']});})[_0x46f4('0x19')](function(_0x433297){_0x3b3b92(_0x1262f6['error'](0x1f5,_0x433297[_0x46f4('0x1a')]));});});},'Command':function(_0x108e6d){var _0x2232d6=this;return new Promise(function(_0x33521e,_0x4b0650){if(ami[_0x46f4('0x12')]()==![]){return _0x4b0650(_0x2232d6[_0x46f4('0x1b')](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],_0x46f4('0x1c')]['join']('\x20')));}_0x108e6d=_[_0x46f4('0x1d')](_0x108e6d,_0x46f4('0x1e'));_0x108e6d[_0x46f4('0x17')]='Command';return ami[_0x46f4('0x1f')](_0x108e6d)[_0x46f4('0x20')](function(_0x185ec2){_0x33521e({'code':0xc8,'message':_0x185ec2[_0x46f4('0x21')]});})[_0x46f4('0x19')](function(_0x41be5e){_0x4b0650(_0x2232d6[_0x46f4('0x1b')](0x1f5,_0x41be5e[_0x46f4('0x1a')]));});});},'VoiceQueues':function(_0x39eb2f){return new Promise(function(_0x301e24,_0x2ad553){var _0x16cd7f=[];for(var _0x197e55 in _0x200f8b['voiceQueues']){if(_0x200f8b[_0x46f4('0x22')][_0x46f4('0x23')](_0x197e55)){var _0xb23194=_0x200f8b[_0x46f4('0x22')][_0x197e55];var _0x57eb00={'id':_0xb23194['id'],'name':_0xb23194[_0x46f4('0xa')],'strategy':_0xb23194['strategy'],'answered':_0xb23194[_0x46f4('0x24')],'available':_0xb23194['available'],'loggedIn':_0xb23194['loggedIn'],'pTalking':_0xb23194['pTalking'],'sumBillable':_0xb23194[_0x46f4('0x25')],'sumDuration':_0xb23194['sumDuration'],'sumHoldTime':_0xb23194[_0x46f4('0x26')]||0x0,'talking':_0xb23194[_0x46f4('0x27')],'total':_0xb23194[_0x46f4('0x28')],'type':_0xb23194[_0x46f4('0x29')],'unmanaged':_0xb23194[_0x46f4('0x2a')],'abandoned':_0xb23194['abandoned'],'waiting':_0xb23194[_0x46f4('0x2b')],'loggedInDb':_0xb23194[_0x46f4('0x2c')]};if(_0xb23194[_0x46f4('0x29')]==='outbound'){_0x57eb00[_0x46f4('0x2d')]=_0xb23194[_0x46f4('0x2d')];_0x57eb00[_0x46f4('0x2e')]=_0xb23194['dialMethod'];_0x57eb00['dialOriginateCallerIdName']=_0xb23194[_0x46f4('0x2f')];_0x57eb00[_0x46f4('0x30')]=_0xb23194[_0x46f4('0x30')];_0x57eb00['dialOriginateTimeout']=_0xb23194[_0x46f4('0x31')];_0x57eb00[_0x46f4('0x32')]=_0xb23194['dialPrefix'];_0x57eb00[_0x46f4('0x33')]=_0xb23194['temp'];_0x57eb00[_0x46f4('0x34')]=_0xb23194[_0x46f4('0x34')];_0x57eb00[_0x46f4('0x35')]=_0xb23194[_0x46f4('0x35')];_0x57eb00[_0x46f4('0x36')]=_0xb23194['outboundBlacklistCallsDay'];_0x57eb00[_0x46f4('0x37')]=_0xb23194[_0x46f4('0x37')];_0x57eb00['outboundCongestionCallsDay']=_0xb23194[_0x46f4('0x38')];_0x57eb00[_0x46f4('0x39')]=_0xb23194[_0x46f4('0x39')];_0x57eb00[_0x46f4('0x3a')]=_0xb23194['outboundDropCallsDayCallersExit'];_0x57eb00[_0x46f4('0x3b')]=_0xb23194['outboundDropCallsDayTimeout'];_0x57eb00[_0x46f4('0x3c')]=_0xb23194[_0x46f4('0x3c')];_0x57eb00[_0x46f4('0x3d')]=_0xb23194[_0x46f4('0x3d')];_0x57eb00['outboundOriginateFailureCallsDay']=_0xb23194[_0x46f4('0x3e')];_0x57eb00['outboundReCallsDay']=_0xb23194['outboundReCallsDay'];_0x57eb00[_0x46f4('0x3f')]=_0xb23194['outboundRejectCallsDay'];_0x57eb00['outboundUnknownCallsDay']=_0xb23194[_0x46f4('0x40')];_0x57eb00[_0x46f4('0x41')]=_0xb23194['predictiveIntervalAnsweredCalls'];_0x57eb00[_0x46f4('0x42')]=_0xb23194['predictiveIntervalAvgHoldtime'];_0x57eb00[_0x46f4('0x43')]=_0xb23194[_0x46f4('0x43')];_0x57eb00[_0x46f4('0x44')]=_0xb23194[_0x46f4('0x44')];_0x57eb00['predictiveIntervalDroppedCallsTimeout']=_0xb23194[_0x46f4('0x45')];_0x57eb00[_0x46f4('0x46')]=_0xb23194[_0x46f4('0x46')];_0x57eb00['predictiveIntervalErlangCallsDroppedCalls']=_0xb23194['predictiveIntervalErlangCallsDroppedCalls'];_0x57eb00['predictiveIntervalHitRate']=_0xb23194[_0x46f4('0x47')];_0x57eb00[_0x46f4('0x48')]=_0xb23194[_0x46f4('0x48')];_0x57eb00[_0x46f4('0x49')]=_0xb23194['predictiveIntervalPauses'];_0x57eb00[_0x46f4('0x4a')]=_0xb23194[_0x46f4('0x4a')];_0x57eb00[_0x46f4('0x4b')]=_0xb23194[_0x46f4('0x4b')];_0x57eb00[_0x46f4('0x1a')]=_0xb23194['message'];_0x57eb00[_0x46f4('0x4c')]=_0xb23194[_0x46f4('0x4c')];_0x57eb00[_0x46f4('0x4d')]=_0xb23194[_0x46f4('0x4d')];_0x57eb00[_0x46f4('0x4e')]=_0xb23194['erlangCallToSecond'];_0x57eb00['erlangAbandonmentRate']=_0xb23194['erlangAbandonmentRate'];_0x57eb00[_0x46f4('0x4f')]=_0xb23194[_0x46f4('0x4f')];_0x57eb00[_0x46f4('0x50')]=_0xb23194['startPredictive'];_0x57eb00[_0x46f4('0x51')]=_0xb23194[_0x46f4('0x51')];}if(_0xb23194[_0x46f4('0x52')]){_0x57eb00[_0x46f4('0x52')]={'id':_0xb23194[_0x46f4('0x52')]['id'],'name':_0xb23194[_0x46f4('0x52')][_0x46f4('0xa')],'active':_0xb23194[_0x46f4('0x52')][_0x46f4('0x53')],'callerid':_0xb23194[_0x46f4('0x52')][_0x46f4('0x54')]};}if(_0xb23194[_0x46f4('0x55')]){_0x57eb00[_0x46f4('0x55')]={'id':_0xb23194['Interval']['id'],'name':_0xb23194[_0x46f4('0x55')][_0x46f4('0xa')]};}_0x16cd7f[_0x46f4('0x56')](_0x57eb00);}}_0x301e24({'count':_0x16cd7f[_0x46f4('0x57')],'rows':_0x16cd7f});});},'UpdateVoiceQueue':function(_0x3dc58d){return new Promise(function(_0x39c024,_0x5ee613){var _0x5e1cd3=_['find'](_0x200f8b[_0x46f4('0x22')],{'id':parseInt(_0x3dc58d['id'])});var _0x1c933f=_[_0x46f4('0x58')](_0x3dc58d,['id']);if(_0x5e1cd3){for(var _0x19b357 in _0x1c933f){if(typeof _0x1c933f[_0x19b357]!==_0x46f4('0x59')&&typeof _0x5e1cd3[_0x19b357]!==_0x46f4('0x59')){_0x5e1cd3[_0x19b357]=_0x1c933f[_0x19b357];}}_0x39c024(_0x5e1cd3);}else{_0x5ee613();}});},'VoiceChannels':function(_0x2ca55d){return new Promise(function(_0xf76f55,_0x35b5a4){var _0xf73c15=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x5b')]);_0xf76f55({'count':_0xf73c15['length'],'rows':_0xf73c15});});},'VoiceChannelMixMonitor':function(_0x109d2f){var _0x23939f=this;return new Promise(function(_0x159fa8,_0x5e2024){if(ami['isConnected']()==![]){return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')]['username'],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x1e3551=schema(properties[_0x46f4('0x5c')])[_0x46f4('0x2')](_0x109d2f);if(_0x1e3551[_0x46f4('0x57')]>0x0){return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f4,_['map'](_0x1e3551,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x11906a=_['find'](_0x200f8b[_0x46f4('0x5b')],{'uniqueid':_0x109d2f[_0x46f4('0x5d')]});if(_0x11906a&&_0x11906a[_0x46f4('0x5e')]){var _0x58e3b5=util['format'](_0x46f4('0x5f'),_0x109d2f['filename']||_0x109d2f[_0x46f4('0x5d')],_0x109d2f[_0x46f4('0x60')]||_0x46f4('0x61'));return ami['Action']({'action':_0x46f4('0x62'),'channel':_0x11906a[_0x46f4('0x5e')],'file':_0x58e3b5,'options':'ai(mixmonitorid)'})[_0x46f4('0x20')](function(_0x4a0fe7){var _0x5e6271=_[_0x46f4('0x63')](_0x11906a[_0x46f4('0x64')],{'filename':_0x46f4('0x65')+_0x58e3b5[_0x46f4('0x66')]()});if(_['isNil'](_0x5e6271)){_0x11906a['monitors']['push']({'filename':_0x46f4('0x65')+_0x58e3b5[_0x46f4('0x66')](),'createdAt':moment()['format'](_0x46f4('0x67')),'mixmonitorid':_0x4a0fe7[_0x46f4('0x68')],'status':_0x46f4('0x69')});}else{_0x5e6271[_0x46f4('0x68')]=_0x4a0fe7['mixmonitorid'];_0x5e6271[_0x46f4('0x6a')]='rec';}_0x159fa8({'code':0xc8,'message':[_0x109d2f[_0x46f4('0x5d')],_0x46f4('0x6b'),_0x4a0fe7[_0x46f4('0x68')]][_0x46f4('0x15')]('\x20'),'mixmonitorid':_0x4a0fe7[_0x46f4('0x68')]});})[_0x46f4('0x19')](function(_0x1cd5f0){_0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f5,[_0x109d2f[_0x46f4('0x5d')],_0x1cd5f0[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3c23a8){var _0x228435=this;return new Promise(function(_0x5538b9,_0x509f82){if(ami[_0x46f4('0x12')]()==![]){return _0x509f82(_0x228435[_0x46f4('0x1b')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x16908b=schema(properties[_0x46f4('0x5c')])[_0x46f4('0x2')](_0x3c23a8);if(_0x16908b[_0x46f4('0x57')]>0x0){return _0x509f82(_0x228435['error'](0x1f4,_[_0x46f4('0x6c')](_0x16908b,'message')['join'](',\x20')));}var _0x265b1a=_[_0x46f4('0x63')](_0x200f8b[_0x46f4('0x5b')],{'uniqueid':_0x3c23a8[_0x46f4('0x5d')]});if(_0x265b1a){return BPromise[_0x46f4('0x6d')]()[_0x46f4('0x20')](function(){if(_0x265b1a['channel']){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x6e'),'channel':_0x265b1a[_0x46f4('0x5e')],'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]})[_0x46f4('0x19')](function(_0x115d77){});}})[_0x46f4('0x20')](function(){if(_0x265b1a[_0x46f4('0x6f')]){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x6e'),'channel':_0x265b1a[_0x46f4('0x6f')],'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]})[_0x46f4('0x19')](function(_0x2ffbc9){});}})[_0x46f4('0x20')](function(_0x1d4e0b){var _0x23e6b9=_[_0x46f4('0x63')](_0x265b1a['monitors'],{'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]});if(_0x23e6b9){_0x23e6b9[_0x46f4('0x6a')]=_0x46f4('0x70');}})[_0x46f4('0x20')](function(){var _0x36ae73=util['format'](_0x46f4('0x5f'),_0x3c23a8[_0x46f4('0x71')]||_0x3c23a8[_0x46f4('0x5d')],_0x3c23a8[_0x46f4('0x60')]||_0x46f4('0x61'));var _0x2a3a17=_[_0x46f4('0x63')](_0x265b1a[_0x46f4('0x64')],{'filename':_0x46f4('0x65')+_0x36ae73[_0x46f4('0x66')]()});if(_0x2a3a17){_0x2a3a17[_0x46f4('0x6a')]=_0x46f4('0x70');}})[_0x46f4('0x20')](function(){_0x5538b9({'code':0xc8,'message':[_0x3c23a8[_0x46f4('0x5d')],_0x46f4('0x72')][_0x46f4('0x15')]('\x20')});})[_0x46f4('0x19')](function(_0x32ce0c){_0x509f82(_0x228435[_0x46f4('0x1b')](0x1f5,[_0x3c23a8[_0x46f4('0x5d')],_0x32ce0c[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x509f82(_0x228435[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannels':function(_0x4dd498){return new Promise(function(_0x43d3d0,_0x55a419){var _0x2a23b8=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x74')]);_0x43d3d0({'count':_0x2a23b8[_0x46f4('0x57')],'rows':_0x2a23b8});});},'VoiceQueuesChannel':function(_0x462e0e){var _0x20fdb1=this;return new Promise(function(_0x1b29cd,_0x2d804c){var _0x576574=schema(properties[_0x46f4('0x75')])[_0x46f4('0x2')](_0x462e0e);if(_0x576574['length']>0x0){return _0x2d804c(_0x20fdb1[_0x46f4('0x1b')](0x1f4,_[_0x46f4('0x6c')](_0x576574,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x33581c=_['find'](_0x200f8b[_0x46f4('0x74')],{'uniqueid':_0x462e0e['uniqueid']});if(_0x33581c){_0x1b29cd(_0x33581c);}else{return _0x2d804c(_0x20fdb1[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x460f00){var _0x54900c=this;return new Promise(function(_0x33da2d,_0x2a2e0b){if(ami[_0x46f4('0x12')]()==![]){return _0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],_0x46f4('0x1c')][_0x46f4('0x15')]('\x20')));}var _0x433340=schema(properties[_0x46f4('0x76')])[_0x46f4('0x2')](_0x460f00);if(_0x433340[_0x46f4('0x57')]>0x0){return _0x2a2e0b(_0x54900c['error'](0x1f4,_[_0x46f4('0x6c')](_0x433340,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x19ad9b=_[_0x46f4('0x63')](_0x200f8b['queueChannels'],{'uniqueid':_0x460f00[_0x46f4('0x5d')]});if(_0x19ad9b&&_0x19ad9b['channel']){return ami[_0x46f4('0x1f')]({'action':'Hangup','channel':_0x19ad9b[_0x46f4('0x5e')]})[_0x46f4('0x20')](function(_0x4edeb9){_0x33da2d({'code':0xc8,'message':[_0x460f00['uniqueid'],_0x4edeb9[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')});})[_0x46f4('0x19')](function(_0x439197){_0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f5,[_0x460f00[_0x46f4('0x5d')],_0x439197['message'][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x2c91be){var _0x43d539=this;return new Promise(function(_0x58489d,_0x28925c){if(ami[_0x46f4('0x12')]()==![]){return _0x28925c(_0x43d539['error'](0x1f4,[config[_0x46f4('0x13')]['ip'],config['asterisk'][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x8e0a4d=schema(properties[_0x46f4('0x77')])['validate'](_0x2c91be);if(_0x8e0a4d[_0x46f4('0x57')]>0x0){return _0x28925c(_0x43d539[_0x46f4('0x1b')](0x1f4,_[_0x46f4('0x6c')](_0x8e0a4d,_0x46f4('0x1a'))['join'](',\x20')));}var _0x1c522f=_[_0x46f4('0x63')](_0x200f8b['queueChannels'],{'uniqueid':_0x2c91be[_0x46f4('0x5d')]});if(_0x1c522f&&_0x1c522f[_0x46f4('0x5e')]){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x78'),'channel':_0x1c522f['channel'],'exten':_0x2c91be[_0x46f4('0x79')],'context':_0x2c91be[_0x46f4('0x7a')]||_0x1c522f['context'],'priority':0x1})[_0x46f4('0x20')](function(_0x50d2b3){_0x58489d({'code':0xc8,'message':[_0x2c91be[_0x46f4('0x5d')],_0x50d2b3[_0x46f4('0x1a')][_0x46f4('0x66')]()]['join']('\x20')});})[_0x46f4('0x19')](function(_0xa5ec18){_0x28925c(_0x43d539['error'](0x1f5,[_0x2c91be[_0x46f4('0x5d')],_0xa5ec18[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x28925c(_0x43d539[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'Agents':function(_0x3ed2ea){return new Promise(function(_0x31fb77,_0x197f19){var _0x32034a=_['values'](_0x200f8b[_0x46f4('0xe')]);_0x31fb77({'count':_0x32034a[_0x46f4('0x57')],'rows':_0x32034a});});},'Telephones':function(_0x42a2be){return new Promise(function(_0x513d58,_0x2df7dc){var _0x2f7ca8=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x7b')]);_0x513d58({'count':_0x2f7ca8[_0x46f4('0x57')],'rows':_0x2f7ca8});});},'Trunks':function(_0x1087a5){return new Promise(function(_0x963a74,_0x21e260){var _0x181690=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x7c')]);_0x963a74({'count':_0x181690[_0x46f4('0x57')],'rows':_0x181690});});},'OutboundChannels':function(_0x21411f){return new Promise(function(_0x4a0a02,_0x139714){var _0x58c781=_[_0x46f4('0x5a')](_0x200f8b['outboundChannels']);_0x4a0a02({'count':_0x58c781[_0x46f4('0x57')],'rows':_0x58c781});});},'Outbound':function(_0x3d56b5){return new Promise(function(_0xe6f4b6,_0x53d656){_0xe6f4b6(_0x200f8b[_0x46f4('0x7d')]);});},'Campaigns':function(_0x1b438d){return new Promise(function(_0x30ada9,_0x5dec66){var _0x4eabcd=_[_0x46f4('0x5a')](_0x200f8b['campaigns']);_0x30ada9({'count':_0x4eabcd[_0x46f4('0x57')],'rows':_0x4eabcd});});},'VoiceQueuesPreview':function(_0x102c46){var _0x50ae14=this;return new Promise(function(_0x31219b,_0x1d95e2){_0xfb0203[_0x46f4('0x7e')](_0x102c46['id'])['then'](function(_0x4d0729){_0x31219b({'code':0xc8,'message':_0x4d0729[_0x46f4('0x1a')]});})[_0x46f4('0x19')](function(_0x3798b4){_0x1d95e2(_0x50ae14[_0x46f4('0x1b')](0x1f4,_0x3798b4[_0x46f4('0x1a')]));});});},'EventManager':function(_0x52250f){var _0x3fcd7e=this;return new Promise(function(_0x11fef8,_0x31f01b){if(!_0x52250f['event']){return _0x31f01b(_0x3fcd7e[_0x46f4('0x1b')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x46f4('0x7f')+_0x52250f[_0x46f4('0x80')],_0x52250f[_0x46f4('0x1a')]);_0x11fef8({'code':0xc8,'message':_0x52250f});});},'FaxAccounts':function(_0x110fc0){return new Promise(function(_0x51bbde,_0x24abb3){var _0x21cfb6=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x81')]);_0x51bbde({'count':_0x21cfb6[_0x46f4('0x57')],'rows':_0x21cfb6});});},'SendFax':function(_0x577c48){var _0xa1d6bf=this;return new Promise(function(_0x31acdc,_0x2f3aed){_0x57f1a9['send'](_0x577c48)[_0x46f4('0x20')](function(_0x1256cb){_0x31acdc({'code':0xc8,'message':_0x1256cb['message']});})[_0x46f4('0x19')](function(_0x2b1bb4){_0x2f3aed(_0xa1d6bf[_0x46f4('0x1b')](0x1f4,_0x2b1bb4['message']));});});},'CheckAfterSend':function(_0x41959b){var _0x3bcf24=this;return new Promise(function(_0x4ffca2,_0x2748be){_0x57f1a9[_0x46f4('0x82')](_0x41959b)['then'](function(_0x3304d0){_0x4ffca2({'code':0xc8,'message':_0x3304d0[_0x46f4('0x1a')]});})[_0x46f4('0x19')](function(_0x133a4c){_0x2748be(_0x3bcf24[_0x46f4('0x1b')](0x1f4,_0x133a4c[_0x46f4('0x1a')]));});});}};var _0x10ba2e=jayson[_0x46f4('0x83')](_0x37d6a2)[_0x46f4('0x84')]();_0x10ba2e['on'](_0x46f4('0x1b'),function(_0x150ace){return _0x2a50b1(_0x150ace);});_0x10ba2e[_0x46f4('0x8')](0x232a,_0x46f4('0x85'),function(){console['log'](_0x46f4('0x86'),0x232a);return _0x169a5a('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4bd3=['loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','length','find','undefined','voicechannel','map','uniqueid','%s.%s','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','MixMonitor\x20Success','channels','resolve','channel','destinationchannel','StopMixMonitor','stop','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','voicequeuechannel','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','username','pick','keys','module','action','Reload','Action','then','message','catch','ami\x20disconnected','join','command','content','voiceQueues','hasOwnProperty','name','strategy','available'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x4bd3,0x174));var _0x34bd=function(_0x1d65d1,_0x34fbd1){_0x1d65d1=_0x1d65d1-0x0;var _0x4bf796=_0x4bd3[_0x1d65d1];return _0x4bf796;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var jayson=require(_0x34bd('0x1'));var schema=require(_0x34bd('0x2'));var BPromise=require('bluebird');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x34bd('0x3'));var ami=require(_0x34bd('0x4'));exports[_0x34bd('0x5')]=function(_0x5846f3,_0x2133c5,_0x2a15a2){return new BPromise(function(_0x5c2a7a,_0x3e8744){var _0x213716={'QueuePause':function(_0x51a4d7){return new Promise(function(_0xd600e1,_0x76de8d){var _0x3260ff=util[_0x34bd('0x6')](_0x34bd('0x7'),_0x34bd('0x8'),_0x51a4d7['name']);if(_0x5846f3[_0x34bd('0x9')]&&_0x5846f3[_0x34bd('0x9')][_0x3260ff]&&_0x5846f3[_0x34bd('0x9')][_0x3260ff][_0x34bd('0xa')]){_0x5846f3['timers'][_0x3260ff]['updateAcw']();}if(_0x5846f3[_0x34bd('0xb')][_0x3260ff]){_0x5846f3['agents'][_0x3260ff]['updateStatusRealtime']({'statePause':_0x51a4d7[_0x34bd('0xc')]?!![]:![]});}_0xd600e1({'code':0xc8,'message':_0x34bd('0xd')});});},'Reload':function(_0x282af4){var _0x1d627d=this;return new Promise(function(_0x2ee180,_0x14cd37){if(ami[_0x34bd('0xe')]()==![]){return _0x14cd37(_0x1d627d[_0x34bd('0xf')](0x1f4,[config[_0x34bd('0x10')]['ip'],config['asterisk'][_0x34bd('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x282af4=_[_0x34bd('0x12')](_0x282af4,_[_0x34bd('0x13')](properties[_0x34bd('0x14')]));_0x282af4[_0x34bd('0x15')]=_0x34bd('0x16');return ami[_0x34bd('0x17')](_0x282af4)[_0x34bd('0x18')](function(_0x1c12e8){_0x2ee180({'code':0xc8,'message':_0x1c12e8[_0x34bd('0x19')]});})[_0x34bd('0x1a')](function(_0x4b5ebb){_0x14cd37(_0x1d627d['error'](0x1f5,_0x4b5ebb[_0x34bd('0x19')]));});});},'Command':function(_0x324f7d){var _0x265e70=this;return new Promise(function(_0x220666,_0x3976e4){if(ami[_0x34bd('0xe')]()==![]){return _0x3976e4(_0x265e70[_0x34bd('0xf')](0x1f4,[config[_0x34bd('0x10')]['ip'],config[_0x34bd('0x10')]['username'],_0x34bd('0x1b')][_0x34bd('0x1c')]('\x20')));}_0x324f7d=_[_0x34bd('0x12')](_0x324f7d,_0x34bd('0x1d'));_0x324f7d[_0x34bd('0x15')]='Command';return ami['Action'](_0x324f7d)['then'](function(_0x4edf84){_0x220666({'code':0xc8,'message':_0x4edf84[_0x34bd('0x1e')]});})['catch'](function(_0x10fc4b){_0x3976e4(_0x265e70[_0x34bd('0xf')](0x1f5,_0x10fc4b[_0x34bd('0x19')]));});});},'VoiceQueues':function(_0x5c3c85){return new Promise(function(_0x41bffd,_0x14479a){var _0x4f0dff=[];for(var _0x457006 in _0x5846f3['voiceQueues']){if(_0x5846f3[_0x34bd('0x1f')][_0x34bd('0x20')](_0x457006)){var _0x264c94=_0x5846f3[_0x34bd('0x1f')][_0x457006];var _0x56baf7={'id':_0x264c94['id'],'name':_0x264c94[_0x34bd('0x21')],'strategy':_0x264c94[_0x34bd('0x22')],'answered':_0x264c94['answered'],'available':_0x264c94[_0x34bd('0x23')],'loggedIn':_0x264c94[_0x34bd('0x24')],'pTalking':_0x264c94[_0x34bd('0x25')],'sumBillable':_0x264c94[_0x34bd('0x26')],'sumDuration':_0x264c94[_0x34bd('0x27')],'sumHoldTime':_0x264c94[_0x34bd('0x28')]||0x0,'talking':_0x264c94[_0x34bd('0x29')],'total':_0x264c94['total'],'type':_0x264c94[_0x34bd('0x2a')],'unmanaged':_0x264c94[_0x34bd('0x2b')],'abandoned':_0x264c94['abandoned'],'waiting':_0x264c94['waiting'],'loggedInDb':_0x264c94[_0x34bd('0x2c')]};if(_0x264c94[_0x34bd('0x2a')]===_0x34bd('0x2d')){_0x56baf7['dialActive']=_0x264c94['dialActive'];_0x56baf7[_0x34bd('0x2e')]=_0x264c94[_0x34bd('0x2e')];_0x56baf7[_0x34bd('0x2f')]=_0x264c94[_0x34bd('0x2f')];_0x56baf7['dialOriginateCallerIdNumber']=_0x264c94[_0x34bd('0x30')];_0x56baf7[_0x34bd('0x31')]=_0x264c94[_0x34bd('0x31')];_0x56baf7[_0x34bd('0x32')]=_0x264c94[_0x34bd('0x32')];_0x56baf7[_0x34bd('0x33')]=_0x264c94['temp'];_0x56baf7[_0x34bd('0x34')]=_0x264c94['outboundAnswerAgiCallsDay'];_0x56baf7[_0x34bd('0x35')]=_0x264c94[_0x34bd('0x35')];_0x56baf7[_0x34bd('0x36')]=_0x264c94['outboundBlacklistCallsDay'];_0x56baf7[_0x34bd('0x37')]=_0x264c94[_0x34bd('0x37')];_0x56baf7['outboundCongestionCallsDay']=_0x264c94[_0x34bd('0x38')];_0x56baf7[_0x34bd('0x39')]=_0x264c94[_0x34bd('0x39')];_0x56baf7['outboundDropCallsDayCallersExit']=_0x264c94[_0x34bd('0x3a')];_0x56baf7[_0x34bd('0x3b')]=_0x264c94['outboundDropCallsDayTimeout'];_0x56baf7[_0x34bd('0x3c')]=_0x264c94[_0x34bd('0x3c')];_0x56baf7[_0x34bd('0x3d')]=_0x264c94[_0x34bd('0x3d')];_0x56baf7[_0x34bd('0x3e')]=_0x264c94[_0x34bd('0x3e')];_0x56baf7['outboundReCallsDay']=_0x264c94['outboundReCallsDay'];_0x56baf7['outboundRejectCallsDay']=_0x264c94[_0x34bd('0x3f')];_0x56baf7[_0x34bd('0x40')]=_0x264c94['outboundUnknownCallsDay'];_0x56baf7['predictiveIntervalAnsweredCalls']=_0x264c94[_0x34bd('0x41')];_0x56baf7['predictiveIntervalAvgHoldtime']=_0x264c94['predictiveIntervalAvgHoldtime'];_0x56baf7[_0x34bd('0x42')]=_0x264c94[_0x34bd('0x42')];_0x56baf7[_0x34bd('0x43')]=_0x264c94[_0x34bd('0x43')];_0x56baf7[_0x34bd('0x44')]=_0x264c94['predictiveIntervalDroppedCallsTimeout'];_0x56baf7['predictiveIntervalErlangCalls']=_0x264c94[_0x34bd('0x45')];_0x56baf7['predictiveIntervalErlangCallsDroppedCalls']=_0x264c94[_0x34bd('0x46')];_0x56baf7[_0x34bd('0x47')]=_0x264c94[_0x34bd('0x47')];_0x56baf7[_0x34bd('0x48')]=_0x264c94[_0x34bd('0x48')];_0x56baf7['predictiveIntervalPauses']=_0x264c94[_0x34bd('0x49')];_0x56baf7[_0x34bd('0x4a')]=_0x264c94[_0x34bd('0x4a')];_0x56baf7[_0x34bd('0x4b')]=_0x264c94['predictiveIntervalTotalCalls'];_0x56baf7[_0x34bd('0x19')]=_0x264c94['message'];_0x56baf7[_0x34bd('0x4c')]=_0x264c94[_0x34bd('0x4c')];_0x56baf7['erlangCalls']=_0x264c94[_0x34bd('0x4d')];_0x56baf7['erlangCallToSecond']=_0x264c94[_0x34bd('0x4e')];_0x56baf7[_0x34bd('0x4f')]=_0x264c94[_0x34bd('0x4f')];_0x56baf7[_0x34bd('0x50')]=_0x264c94[_0x34bd('0x50')];_0x56baf7[_0x34bd('0x51')]=_0x264c94[_0x34bd('0x51')];_0x56baf7['startProgressive']=_0x264c94['startProgressive'];}if(_0x264c94['Trunk']){_0x56baf7[_0x34bd('0x52')]={'id':_0x264c94[_0x34bd('0x52')]['id'],'name':_0x264c94[_0x34bd('0x52')][_0x34bd('0x21')],'active':_0x264c94['Trunk'][_0x34bd('0x53')],'callerid':_0x264c94[_0x34bd('0x52')][_0x34bd('0x54')]};}if(_0x264c94[_0x34bd('0x55')]){_0x56baf7[_0x34bd('0x55')]={'id':_0x264c94['Interval']['id'],'name':_0x264c94[_0x34bd('0x55')]['name']};}_0x4f0dff['push'](_0x56baf7);}}_0x41bffd({'count':_0x4f0dff[_0x34bd('0x56')],'rows':_0x4f0dff});});},'UpdateVoiceQueue':function(_0x53a114){return new Promise(function(_0x8474fb,_0x293457){var _0x18d71e=_[_0x34bd('0x57')](_0x5846f3[_0x34bd('0x1f')],{'id':parseInt(_0x53a114['id'])});var _0x5b061a=_['omit'](_0x53a114,['id']);if(_0x18d71e){for(var _0x33e8e8 in _0x5b061a){if(typeof _0x5b061a[_0x33e8e8]!=='undefined'&&typeof _0x18d71e[_0x33e8e8]!==_0x34bd('0x58')){_0x18d71e[_0x33e8e8]=_0x5b061a[_0x33e8e8];}}_0x8474fb(_0x18d71e);}else{_0x293457();}});},'VoiceChannels':function(_0x223adb){return new Promise(function(_0x23b29,_0x540b04){var _0x4ad00c=_['values'](_0x5846f3['channels']);_0x23b29({'count':_0x4ad00c[_0x34bd('0x56')],'rows':_0x4ad00c});});},'VoiceChannelMixMonitor':function(_0x510c27){var _0x21d2ea=this;return new Promise(function(_0x5c0f86,_0x24033f){if(ami[_0x34bd('0xe')]()==![]){return _0x24033f(_0x21d2ea[_0x34bd('0xf')](0x1f4,[config[_0x34bd('0x10')]['ip'],config[_0x34bd('0x10')]['username'],_0x34bd('0x1b')][_0x34bd('0x1c')]('\x20')));}var _0x1f4d0b=schema(properties[_0x34bd('0x59')])[_0x34bd('0x2')](_0x510c27);if(_0x1f4d0b['length']>0x0){return _0x24033f(_0x21d2ea[_0x34bd('0xf')](0x1f4,_[_0x34bd('0x5a')](_0x1f4d0b,'message')[_0x34bd('0x1c')](',\x20')));}var _0x1a935e=_['find'](_0x5846f3['channels'],{'uniqueid':_0x510c27[_0x34bd('0x5b')]});if(_0x1a935e&&_0x1a935e['channel']){var _0x499642=util[_0x34bd('0x6')](_0x34bd('0x5c'),_0x510c27['filename']||_0x510c27['uniqueid'],_0x510c27['format']||'wav');return ami[_0x34bd('0x17')]({'action':_0x34bd('0x5d'),'channel':_0x1a935e['channel'],'file':_0x499642,'options':'ai(mixmonitorid)'})['then'](function(_0x477fd4){var _0x7df072=_['find'](_0x1a935e[_0x34bd('0x5e')],{'filename':_0x34bd('0x5f')+_0x499642[_0x34bd('0x60')]()});if(_[_0x34bd('0x61')](_0x7df072)){_0x1a935e[_0x34bd('0x5e')][_0x34bd('0x62')]({'filename':'/var/spool/asterisk/monitor/'+_0x499642[_0x34bd('0x60')](),'createdAt':moment()[_0x34bd('0x6')](_0x34bd('0x63')),'mixmonitorid':_0x477fd4[_0x34bd('0x64')],'status':'rec'});}else{_0x7df072[_0x34bd('0x64')]=_0x477fd4['mixmonitorid'];_0x7df072[_0x34bd('0x65')]='rec';}_0x5c0f86({'code':0xc8,'message':[_0x510c27[_0x34bd('0x5b')],_0x34bd('0x66'),_0x477fd4[_0x34bd('0x64')]][_0x34bd('0x1c')]('\x20'),'mixmonitorid':_0x477fd4[_0x34bd('0x64')]});})[_0x34bd('0x1a')](function(_0x6db4ba){_0x24033f(_0x21d2ea[_0x34bd('0xf')](0x1f5,[_0x510c27[_0x34bd('0x5b')],_0x6db4ba[_0x34bd('0x19')][_0x34bd('0x60')]()]['join']('\x20')));});}else{return _0x24033f(_0x21d2ea[_0x34bd('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x15fea7){var _0x4f2091=this;return new Promise(function(_0x3fc297,_0x50ed7f){if(ami[_0x34bd('0xe')]()==![]){return _0x50ed7f(_0x4f2091[_0x34bd('0xf')](0x1f4,[config[_0x34bd('0x10')]['ip'],config[_0x34bd('0x10')][_0x34bd('0x11')],_0x34bd('0x1b')][_0x34bd('0x1c')]('\x20')));}var _0xeffa5d=schema(properties[_0x34bd('0x59')])[_0x34bd('0x2')](_0x15fea7);if(_0xeffa5d[_0x34bd('0x56')]>0x0){return _0x50ed7f(_0x4f2091[_0x34bd('0xf')](0x1f4,_[_0x34bd('0x5a')](_0xeffa5d,_0x34bd('0x19'))[_0x34bd('0x1c')](',\x20')));}var _0x4a0c28=_['find'](_0x5846f3[_0x34bd('0x67')],{'uniqueid':_0x15fea7[_0x34bd('0x5b')]});if(_0x4a0c28){return BPromise[_0x34bd('0x68')]()[_0x34bd('0x18')](function(){if(_0x4a0c28[_0x34bd('0x69')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4a0c28['channel'],'mixmonitorid':_0x15fea7['mixmonitorid']})[_0x34bd('0x1a')](function(_0x19fde8){});}})['then'](function(){if(_0x4a0c28[_0x34bd('0x6a')]){return ami[_0x34bd('0x17')]({'action':_0x34bd('0x6b'),'channel':_0x4a0c28['destinationchannel'],'mixmonitorid':_0x15fea7[_0x34bd('0x64')]})[_0x34bd('0x1a')](function(_0x2fac2a){});}})[_0x34bd('0x18')](function(_0x1d8e0f){var _0x26e763=_[_0x34bd('0x57')](_0x4a0c28[_0x34bd('0x5e')],{'mixmonitorid':_0x15fea7['mixmonitorid']});if(_0x26e763){_0x26e763['status']=_0x34bd('0x6c');}})['then'](function(){var _0x2959aa=util[_0x34bd('0x6')](_0x34bd('0x5c'),_0x15fea7['filename']||_0x15fea7['uniqueid'],_0x15fea7[_0x34bd('0x6')]||_0x34bd('0x6d'));var _0x3c2e61=_['find'](_0x4a0c28['monitors'],{'filename':_0x34bd('0x5f')+_0x2959aa[_0x34bd('0x60')]()});if(_0x3c2e61){_0x3c2e61[_0x34bd('0x65')]=_0x34bd('0x6c');}})[_0x34bd('0x18')](function(){_0x3fc297({'code':0xc8,'message':[_0x15fea7[_0x34bd('0x5b')],_0x34bd('0x6e')][_0x34bd('0x1c')]('\x20')});})[_0x34bd('0x1a')](function(_0x4f397f){_0x50ed7f(_0x4f2091['error'](0x1f5,[_0x15fea7[_0x34bd('0x5b')],_0x4f397f['message'][_0x34bd('0x60')]()][_0x34bd('0x1c')]('\x20')));});}else{return _0x50ed7f(_0x4f2091[_0x34bd('0xf')](0x1f5,_0x34bd('0x6f')));}});},'VoiceQueuesChannels':function(_0x4a5e55){return new Promise(function(_0x50ae2e,_0x3d60fa){var _0x2273af=_[_0x34bd('0x70')](_0x5846f3['queueChannels']);_0x50ae2e({'count':_0x2273af[_0x34bd('0x56')],'rows':_0x2273af});});},'VoiceQueuesChannel':function(_0x4832d5){var _0x3ec753=this;return new Promise(function(_0x35d9be,_0x171a14){var _0x55876d=schema(properties[_0x34bd('0x71')])['validate'](_0x4832d5);if(_0x55876d['length']>0x0){return _0x171a14(_0x3ec753[_0x34bd('0xf')](0x1f4,_[_0x34bd('0x5a')](_0x55876d,_0x34bd('0x19'))['join'](',\x20')));}var _0x3f909d=_[_0x34bd('0x57')](_0x5846f3[_0x34bd('0x72')],{'uniqueid':_0x4832d5['uniqueid']});if(_0x3f909d){_0x35d9be(_0x3f909d);}else{return _0x171a14(_0x3ec753[_0x34bd('0xf')](0x1f5,_0x34bd('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x385ab3){var _0x44fc41=this;return new Promise(function(_0x19ad93,_0xbb9b5d){if(ami[_0x34bd('0xe')]()==![]){return _0xbb9b5d(_0x44fc41[_0x34bd('0xf')](0x1f4,[config[_0x34bd('0x10')]['ip'],config[_0x34bd('0x10')][_0x34bd('0x11')],'ami\x20disconnected'][_0x34bd('0x1c')]('\x20')));}var _0x507806=schema(properties[_0x34bd('0x73')])['validate'](_0x385ab3);if(_0x507806[_0x34bd('0x56')]>0x0){return _0xbb9b5d(_0x44fc41[_0x34bd('0xf')](0x1f4,_[_0x34bd('0x5a')](_0x507806,_0x34bd('0x19'))[_0x34bd('0x1c')](',\x20')));}var _0x4556ce=_[_0x34bd('0x57')](_0x5846f3[_0x34bd('0x72')],{'uniqueid':_0x385ab3[_0x34bd('0x5b')]});if(_0x4556ce&&_0x4556ce[_0x34bd('0x69')]){return ami['Action']({'action':'Hangup','channel':_0x4556ce[_0x34bd('0x69')]})[_0x34bd('0x18')](function(_0xfc56a3){_0x19ad93({'code':0xc8,'message':[_0x385ab3['uniqueid'],_0xfc56a3['message']['toLowerCase']()][_0x34bd('0x1c')]('\x20')});})[_0x34bd('0x1a')](function(_0x438458){_0xbb9b5d(_0x44fc41[_0x34bd('0xf')](0x1f5,[_0x385ab3[_0x34bd('0x5b')],_0x438458['message'][_0x34bd('0x60')]()]['join']('\x20')));});}else{return _0xbb9b5d(_0x44fc41[_0x34bd('0xf')](0x1f5,_0x34bd('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x500a25){var _0x36ebad=this;return new Promise(function(_0x5df452,_0x242093){if(ami['isConnected']()==![]){return _0x242093(_0x36ebad[_0x34bd('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x34bd('0x10')][_0x34bd('0x11')],_0x34bd('0x1b')][_0x34bd('0x1c')]('\x20')));}var _0x2de8a0=schema(properties[_0x34bd('0x74')])[_0x34bd('0x2')](_0x500a25);if(_0x2de8a0[_0x34bd('0x56')]>0x0){return _0x242093(_0x36ebad['error'](0x1f4,_[_0x34bd('0x5a')](_0x2de8a0,_0x34bd('0x19'))[_0x34bd('0x1c')](',\x20')));}var _0x49d395=_['find'](_0x5846f3['queueChannels'],{'uniqueid':_0x500a25[_0x34bd('0x5b')]});if(_0x49d395&&_0x49d395[_0x34bd('0x69')]){return ami['Action']({'action':_0x34bd('0x75'),'channel':_0x49d395['channel'],'exten':_0x500a25[_0x34bd('0x76')],'context':_0x500a25[_0x34bd('0x77')]||_0x49d395[_0x34bd('0x77')],'priority':0x1})['then'](function(_0x474c2f){_0x5df452({'code':0xc8,'message':[_0x500a25['uniqueid'],_0x474c2f[_0x34bd('0x19')][_0x34bd('0x60')]()][_0x34bd('0x1c')]('\x20')});})[_0x34bd('0x1a')](function(_0x1fe8cc){_0x242093(_0x36ebad[_0x34bd('0xf')](0x1f5,[_0x500a25[_0x34bd('0x5b')],_0x1fe8cc[_0x34bd('0x19')][_0x34bd('0x60')]()][_0x34bd('0x1c')]('\x20')));});}else{return _0x242093(_0x36ebad[_0x34bd('0xf')](0x1f5,_0x34bd('0x6f')));}});},'Agents':function(_0x44c5d4){return new Promise(function(_0x48d9b9,_0x59c473){var _0x2c1b4f=_[_0x34bd('0x70')](_0x5846f3[_0x34bd('0xb')]);_0x48d9b9({'count':_0x2c1b4f[_0x34bd('0x56')],'rows':_0x2c1b4f});});},'Telephones':function(_0x36aca5){return new Promise(function(_0x49455c,_0x1799dd){var _0x1d4259=_[_0x34bd('0x70')](_0x5846f3[_0x34bd('0x78')]);_0x49455c({'count':_0x1d4259['length'],'rows':_0x1d4259});});},'Trunks':function(_0x2b838a){return new Promise(function(_0x572ac2,_0x5e329b){var _0x49ba99=_['values'](_0x5846f3[_0x34bd('0x79')]);_0x572ac2({'count':_0x49ba99[_0x34bd('0x56')],'rows':_0x49ba99});});},'OutboundChannels':function(_0x6ec278){return new Promise(function(_0x5c8e2e,_0x326888){var _0x21588f=_[_0x34bd('0x70')](_0x5846f3[_0x34bd('0x7a')]);_0x5c8e2e({'count':_0x21588f[_0x34bd('0x56')],'rows':_0x21588f});});},'Outbound':function(_0x1353b0){return new Promise(function(_0x4624fc,_0x5b0585){_0x4624fc(_0x5846f3[_0x34bd('0x2d')]);});},'Campaigns':function(_0x4456c5){return new Promise(function(_0x4451ef,_0x4be22a){var _0x5403fa=_[_0x34bd('0x70')](_0x5846f3['campaigns']);_0x4451ef({'count':_0x5403fa[_0x34bd('0x56')],'rows':_0x5403fa});});},'VoiceQueuesPreview':function(_0x384905){var _0x2e2ba1=this;return new Promise(function(_0x9f4df7,_0x22aa49){_0x2133c5[_0x34bd('0x7b')](_0x384905['id'])[_0x34bd('0x18')](function(_0xf45fee){_0x9f4df7({'code':0xc8,'message':_0xf45fee['message']});})[_0x34bd('0x1a')](function(_0x1ae798){_0x22aa49(_0x2e2ba1[_0x34bd('0xf')](0x1f4,_0x1ae798['message']));});});},'EventManager':function(_0x2b56eb){var _0x4022a0=this;return new Promise(function(_0xca91e2,_0x4502e6){if(!_0x2b56eb['event']){return _0x4502e6(_0x4022a0[_0x34bd('0xf')](0x1f4,_0x34bd('0x7c')));}ami[_0x34bd('0x7d')](_0x34bd('0x7e')+_0x2b56eb[_0x34bd('0x7f')],_0x2b56eb[_0x34bd('0x19')]);_0xca91e2({'code':0xc8,'message':_0x2b56eb});});},'FaxAccounts':function(_0x1203fc){return new Promise(function(_0x193f37,_0x15651a){var _0x3b95f6=_['values'](_0x5846f3[_0x34bd('0x80')]);_0x193f37({'count':_0x3b95f6[_0x34bd('0x56')],'rows':_0x3b95f6});});},'SendFax':function(_0x19d537){var _0x1e9839=this;return new Promise(function(_0x2f7caf,_0x38752d){_0x2a15a2[_0x34bd('0x81')](_0x19d537)[_0x34bd('0x18')](function(_0x199390){_0x2f7caf({'code':0xc8,'message':_0x199390[_0x34bd('0x19')]});})[_0x34bd('0x1a')](function(_0x1d735f){_0x38752d(_0x1e9839[_0x34bd('0xf')](0x1f4,_0x1d735f[_0x34bd('0x19')]));});});},'CheckAfterSend':function(_0x47a050){var _0x70c6a9=this;return new Promise(function(_0x545d68,_0x45ae98){_0x2a15a2[_0x34bd('0x82')](_0x47a050)[_0x34bd('0x18')](function(_0x24d607){_0x545d68({'code':0xc8,'message':_0x24d607[_0x34bd('0x19')]});})[_0x34bd('0x1a')](function(_0x334c57){_0x45ae98(_0x70c6a9[_0x34bd('0xf')](0x1f4,_0x334c57['message']));});});}};var _0x285f8a=jayson[_0x34bd('0x83')](_0x213716)[_0x34bd('0x84')]();_0x285f8a['on']('error',function(_0x4519eb){return _0x3e8744(_0x4519eb);});_0x285f8a[_0x34bd('0x5')](0x232a,_0x34bd('0x85'),function(){console[_0x34bd('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x5c2a7a(_0x34bd('0x87')+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 2417b8b..120a5dd 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 _0x84ab=['resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','createContact','push','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','union'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x84ab,0x12f));var _0xb84a=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x84ab[_0x4702ee];return _0x62ca7d;};'use strict';var _=require(_0xb84a('0x0'));var BPromise=require(_0xb84a('0x1'));var Redis=require(_0xb84a('0x2'));var util=require(_0xb84a('0x3'));var config=require(_0xb84a('0x4'));var logger=require('../../../../config/logger')(_0xb84a('0x5'));var cmContactRpc=require(_0xb84a('0x6'));config['redis']=_[_0xb84a('0x7')](config[_0xb84a('0x8')],{'host':_0xb84a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4dc496,_0xd445b5,_0x4fac4d,_0x3e9086,_0x8d9dbe){logger['info'](_0xb84a('0xa'),_0x4dc496,_0xd445b5['id'],_0x4fac4d,_0x3e9086,JSON['stringify'](_0x8d9dbe));io['to'](_0x4fac4d)[_0xb84a('0xb')](_0x3e9086,_0x8d9dbe);}exports[_0xb84a('0xc')]=function(_0x42daf5,_0x5d3b29,_0x5a34f7,_0x591de9){var _0x1e0180,_0x17379b;var _0x350e99={};var _0x35c6c5=Number(_0x5a34f7[_0xb84a('0xd')]);var _0x4d3758=_0x5a34f7[_0xb84a('0xe')]?Boolean(Number(_0x5a34f7[_0xb84a('0xe')])):![];var _0x39a0df;var _0x3c161c=![];if(!_[_0xb84a('0xf')](_0x5a34f7[_0xb84a('0x10')])){if(_0x5a34f7[_0xb84a('0x10')]=='1')_0x3c161c=!![];}if(!_0x3c161c){if(_0x591de9[_0xb84a('0x11')]){_0x350e99['id']=_0x591de9[_0xb84a('0x11')];}}if(!_0x350e99['id']){_0x350e99[_0xb84a('0x12')]=_0x35c6c5;_0x39a0df=_0x5a34f7[_0xb84a('0x13')]&&_0x5a34f7[_0xb84a('0x13')]!=='0'?_0x5a34f7['data3'][_0xb84a('0x14')](','):[_0xb84a('0x15')];_0x350e99[_0xb84a('0x16')]=_[_0xb84a('0x17')](_0x39a0df,function(_0x1c7378){var _0x1be87a={};_0x1be87a[_0x1c7378]=_0x591de9[_0xb84a('0x18')]?_0x591de9[_0xb84a('0x19')]:_0x591de9[_0xb84a('0x1a')];return _0x1be87a;});}var _0x3f7437=['id',_0xb84a('0x1b'),_0xb84a('0x1c'),_0xb84a('0x15'),_0xb84a('0x1d'),'fax',_0xb84a('0x12'),_0xb84a('0x1e'),'scheduledAt',_0xb84a('0x1f')];var _0x61ef03=_[_0xb84a('0x20')](_0x3f7437,_0x39a0df);BPromise[_0xb84a('0x21')]()['then'](cmContactRpc['getContacts']({'attributes':_0x61ef03,'where':_0x350e99}))[_0xb84a('0x22')](function(_0x19097d){_0x17379b=_0x19097d;if(!_[_0xb84a('0x23')](_0x17379b)){if(_0x17379b[_0xb84a('0x24')]===0x1){_0x1e0180=_0x17379b[0x0];logger[_0xb84a('0x25')](_0xb84a('0x26'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_0x1e0180['id']);}else{logger[_0xb84a('0x25')](_0xb84a('0x28'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_[_0xb84a('0x17')](_0x17379b,'id')[_0xb84a('0x29')](','));}return;}else{logger[_0xb84a('0x25')](_0xb84a('0x2a'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id']);var _0x3258a9={'ListId':_0x35c6c5};var _0x378ce1=_0x5a34f7[_0xb84a('0x2b')]&&_0x5a34f7[_0xb84a('0x2b')]!=='0'?_0x5a34f7[_0xb84a('0x2b')]:_0xb84a('0x15');if(_0x4d3758){logger[_0xb84a('0x25')](_0xb84a('0x2c'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id']);_0x3258a9[_0x378ce1]=_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])?_0x591de9['calleridnum']:_0x591de9['destcalleridnum'];if(_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])){_0x3258a9['firstName']=_0x591de9[_0xb84a('0x2d')]&&_0x591de9[_0xb84a('0x2d')]!==''?_0x591de9['calleridname']:_0xb84a('0x2e');}else{_0x3258a9[_0xb84a('0x1b')]=_0x591de9['destcalleridname']&&_0x591de9[_0xb84a('0x2f')]!==_0xb84a('0x30')?_0x591de9[_0xb84a('0x2f')]:_0xb84a('0x2e');}return BPromise[_0xb84a('0x21')]()[_0xb84a('0x22')](cmContactRpc[_0xb84a('0x31')](_0x3258a9))[_0xb84a('0x22')](function(_0x54ec50){_0x1e0180=_0x54ec50;_0x17379b[_0xb84a('0x32')](_0x54ec50);if(_0x1e0180){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_0x1e0180['id']);}return;});}else{logger[_0xb84a('0x25')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x591de9['uniqueid'],_0x5d3b29['id']);_0x3258a9[_0x378ce1]=_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])?_0x591de9[_0xb84a('0x1a')]:_0x591de9[_0xb84a('0x19')];if(_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])){_0x3258a9[_0xb84a('0x1b')]=_0x591de9[_0xb84a('0x2d')]&&_0x591de9['calleridname']!==_0xb84a('0x30')?_0x591de9[_0xb84a('0x2d')]:_0xb84a('0x2e');}else{_0x3258a9[_0xb84a('0x1b')]=_0x591de9[_0xb84a('0x2f')]&&_0x591de9[_0xb84a('0x2f')]!==_0xb84a('0x30')?_0x591de9['destcalleridname']:_0xb84a('0x2e');}_0x1e0180=_0x3258a9;_0x17379b['push'](_0x3258a9);return;}}})[_0xb84a('0x22')](function(){if(_0x42daf5){emit(_0x591de9[_0xb84a('0x27')],_0x5d3b29,util[_0xb84a('0x33')]('user:%s',_0x42daf5['name']),util[_0xb84a('0x33')](_0xb84a('0x34'),_0x5a34f7[_0xb84a('0x35')][_0xb84a('0x36')]()),{'evt':_[_0xb84a('0x37')](_0x591de9,{'autoCreate':_0x4d3758}),'contact':_0x1e0180===undefined?{}:_0x1e0180,'contacts':_0x17379b['length']===0x0?undefined:_0x17379b});}});}; \ No newline at end of file +var _0x3e74=['scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','data1','data2','isNil','data5','ListId','data3','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt'];(function(_0x3cc2d4,_0x38fa92){var _0x4dbb6a=function(_0x5dd4d3){while(--_0x5dd4d3){_0x3cc2d4['push'](_0x3cc2d4['shift']());}};_0x4dbb6a(++_0x38fa92);}(_0x3e74,0x175));var _0x43e7=function(_0x8f553f,_0x1f1ea3){_0x8f553f=_0x8f553f-0x0;var _0xd83f21=_0x3e74[_0x8f553f];return _0xd83f21;};'use strict';var _=require(_0x43e7('0x0'));var BPromise=require('bluebird');var Redis=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x43e7('0x4'));config['redis']=_[_0x43e7('0x5')](config[_0x43e7('0x6')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config[_0x43e7('0x6')]));function emit(_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){logger[_0x43e7('0x9')]('[CM][%s][%s]',_0x503698,_0x45a0d1['id'],_0x3491d6,_0x2ede2d,JSON[_0x43e7('0xa')](_0x8528fc));io['to'](_0x3491d6)['emit'](_0x2ede2d,_0x8528fc);}exports['exec']=function(_0x39c8bd,_0x4139c9,_0x5c34f4,_0x2803d9){var _0x513707,_0xf7c520;var _0x37302c={};var _0x4ebc8e=Number(_0x5c34f4[_0x43e7('0xb')]);var _0xc960ea=_0x5c34f4[_0x43e7('0xc')]?Boolean(Number(_0x5c34f4[_0x43e7('0xc')])):![];var _0x4e008c;var _0x583d85=![];if(!_[_0x43e7('0xd')](_0x5c34f4[_0x43e7('0xe')])){if(_0x5c34f4[_0x43e7('0xe')]=='1')_0x583d85=!![];}if(!_0x583d85){if(_0x2803d9['xmd-contactid']){_0x37302c['id']=_0x2803d9['xmd-contactid'];}}if(!_0x37302c['id']){_0x37302c[_0x43e7('0xf')]=_0x4ebc8e;_0x4e008c=_0x5c34f4[_0x43e7('0x10')]&&_0x5c34f4[_0x43e7('0x10')]!=='0'?_0x5c34f4[_0x43e7('0x10')]['split'](','):['phone'];_0x37302c[_0x43e7('0x11')]=_[_0x43e7('0x12')](_0x4e008c,function(_0x273a32){var _0x5d346f={};_0x5d346f[_0x273a32]=_0x2803d9['routeId']?_0x2803d9[_0x43e7('0x13')]:_0x2803d9[_0x43e7('0x14')];return _0x5d346f;});}var _0x9037d3=['id',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),_0x43e7('0x19'),_0x43e7('0xf'),_0x43e7('0x1a'),_0x43e7('0x1b'),_0x43e7('0x1c')];var _0x4b5d64=_[_0x43e7('0x1d')](_0x9037d3,_0x4e008c);BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x1f')]({'attributes':_0x4b5d64,'where':_0x37302c}))[_0x43e7('0x20')](function(_0x3945bb){_0xf7c520=_0x3945bb;if(!_[_0x43e7('0x21')](_0xf7c520)){if(_0xf7c520[_0x43e7('0x22')]===0x1){_0x513707=_0xf7c520[0x0];logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_[_0x43e7('0x12')](_0xf7c520,'id')['join'](','));}return;}else{logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);var _0x5c5e67={'ListId':_0x4ebc8e};var _0x1af208=_0x5c34f4[_0x43e7('0x24')]&&_0x5c34f4[_0x43e7('0x24')]!=='0'?_0x5c34f4[_0x43e7('0x24')]:'phone';if(_0xc960ea){logger['info'](_0x43e7('0x25'),_0x2803d9['uniqueid'],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])?_0x2803d9[_0x43e7('0x14')]:_0x2803d9[_0x43e7('0x13')];if(_['isNil'](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x27')]:_0x43e7('0x29');}else{_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x2a')]&&_0x2803d9[_0x43e7('0x2a')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x2a')]:_0x43e7('0x29');}return BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x2b')](_0x5c5e67))[_0x43e7('0x20')](function(_0x3b8f78){_0x513707=_0x3b8f78;_0xf7c520[_0x43e7('0x2c')](_0x3b8f78);if(_0x513707){logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}return;});}else{logger[_0x43e7('0x9')](_0x43e7('0x2d'),_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_['isNil'](_0x2803d9['routeId'])?_0x2803d9['calleridnum']:_0x2803d9[_0x43e7('0x13')];if(_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==''?_0x2803d9['calleridname']:'Unknown';}else{_0x5c5e67['firstName']=_0x2803d9['destcalleridname']&&_0x2803d9['destcalleridname']!==''?_0x2803d9[_0x43e7('0x2a')]:'Unknown';}_0x513707=_0x5c5e67;_0xf7c520[_0x43e7('0x2c')](_0x5c5e67);return;}}})[_0x43e7('0x20')](function(){if(_0x39c8bd){emit(_0x2803d9[_0x43e7('0x23')],_0x4139c9,util[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x39c8bd[_0x43e7('0x30')]),util[_0x43e7('0x2e')]('trigger:%s',_0x5c34f4['action']['toLowerCase']()),{'evt':_[_0x43e7('0x31')](_0x2803d9,{'autoCreate':_0xc960ea}),'contact':_0x513707===undefined?{}:_0x513707,'contacts':_0xf7c520[_0x43e7('0x22')]===0x0?undefined:_0xf7c520});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index b6672b4..4e6ef07 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 _0x0688=['winapp','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','zendeskAccounts','dynamics365Accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','prototype','info','stringify','emit','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','Actions','action','contactmanager','browser','TemplateId','html','data2','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','data6','600','winApplication','render','user:%s','format','data1','jscripty','name','trigger:%s','toLowerCase','integration','exec','queue','routeId','script','parse','search','replace','channel','AllConditions','length','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','event','agent','membername','lastevent','null','substatus','exports','util','lodash','url','mustache','./integration','./cmContact','./script','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','popup'];(function(_0xa6338c,_0x419354){var _0x530c5c=function(_0x4ee9ff){while(--_0x4ee9ff){_0xa6338c['push'](_0xa6338c['shift']());}};_0x530c5c(++_0x419354);}(_0x0688,0x1ca));var _0x8068=function(_0x4b194e,_0x165a7d){_0x4b194e=_0x4b194e-0x0;var _0x19b534=_0x0688[_0x4b194e];return _0x19b534;};'use strict';var util=require(_0x8068('0x0'));var _=require(_0x8068('0x1'));var url=require(_0x8068('0x2'));var Mustache=require(_0x8068('0x3'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0x8068('0x4'));var cmContact=require(_0x8068('0x5'));var script=require(_0x8068('0x6'));var config=require(_0x8068('0x7'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x8068('0x8'));config[_0x8068('0x9')]=_[_0x8068('0xa')](config['redis'],{'host':_0x8068('0xb'),'port':0x18eb});var io=require(_0x8068('0xc'))(new Redis(config[_0x8068('0x9')]));var operators={'equals':function(_0x5a7ca6,_0x1bca4e){return _0x5a7ca6==_0x1bca4e;},'not_equals':function(_0x26c5d7,_0x38eebe){return _0x26c5d7!=_0x38eebe;}};var barAndWebActions=[_0x8068('0xd'),_0x8068('0x2'),_0x8068('0xe')];function Trigger(_0x4b9dd6){this['triggers']=_0x4b9dd6[_0x8068('0xf')];this['agents']=_0x4b9dd6[_0x8068('0x10')];this[_0x8068('0x11')]=_0x4b9dd6[_0x8068('0x11')];this['templates']=_0x4b9dd6[_0x8068('0x12')];this[_0x8068('0x13')]=_0x4b9dd6[_0x8068('0x13')];this['zendeskAccounts']=_0x4b9dd6['zendeskAccounts'];this[_0x8068('0x14')]=_0x4b9dd6[_0x8068('0x14')];this[_0x8068('0x15')]=_0x4b9dd6[_0x8068('0x15')];this[_0x8068('0x16')]=_0x4b9dd6['sugarcrmAccounts'];this[_0x8068('0x17')]=_0x4b9dd6[_0x8068('0x17')];this[_0x8068('0x18')]=_0x4b9dd6[_0x8068('0x18')];this[_0x8068('0x19')]=_0x4b9dd6[_0x8068('0x19')];this['servicenowAccounts']=_0x4b9dd6[_0x8068('0x1a')];this['dynamics365Accounts']=_0x4b9dd6['dynamics365Accounts'];this[_0x8068('0x1b')]=_0x4b9dd6['freshsalesAccounts'];this[_0x8068('0x1c')]={'zendesk':this[_0x8068('0x1d')],'salesforce':this[_0x8068('0x15')],'freshdesk':this[_0x8068('0x14')],'sugarcrm':this[_0x8068('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0x8068('0x18')],'vtiger':this[_0x8068('0x19')],'dynamics365':this[_0x8068('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x8068('0x1a')]};ami['on']('custom:agentcalled',this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x21'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x22'),this['syncCustomEvent'][_0x8068('0x20')](this));ami['on'](_0x8068('0x23'),this['syncCustomEvent'][_0x8068('0x20')](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0x8068('0x20')](this));ami['on'](_0x8068('0x24'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on']('custom:agentbusy',this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x25'),this['syncCustomEvent'][_0x8068('0x20')](this));ami['on'](_0x8068('0x26'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x27'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x28'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x29'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on']('custom:dialbegin',this[_0x8068('0x2a')][_0x8068('0x20')](this));ami['on']('custom:dialconnect',this[_0x8068('0x2a')]['bind'](this));ami['on'](_0x8068('0x2b'),this[_0x8068('0x2a')][_0x8068('0x20')](this));ami['on'](_0x8068('0x2c'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on']('custom:closedinteraction',this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on']('custom:substatus',this[_0x8068('0x1f')]['bind'](this));ami['on'](_0x8068('0x2d'),this[_0x8068('0x1f')][_0x8068('0x20')](this));ami['on'](_0x8068('0x2e'),this['syncCustomEvent'][_0x8068('0x20')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent']['bind'](this));ami['on']('custom:rejectmessage',this[_0x8068('0x1f')]['bind'](this));}Trigger[_0x8068('0x2f')]['emit']=function(_0x2d78ff,_0x33d305,_0x2051cc){logger[_0x8068('0x30')](_0x2d78ff,_0x33d305,JSON[_0x8068('0x31')](_0x2051cc));io['to'](_0x2d78ff)[_0x8068('0x32')](_0x33d305,_0x2051cc);};Trigger[_0x8068('0x2f')][_0x8068('0x1f')]=function(_0x49ce94){var _0x460ad3=_[_0x8068('0x33')](_0x49ce94);if(typeof _0x460ad3[_0x8068('0x34')]===_0x8068('0x35')){_0x460ad3[_0x8068('0x34')]=_0x8068('0x36');}this[_0x8068('0x37')](_0x460ad3);};Trigger[_0x8068('0x2f')][_0x8068('0x2a')]=function(_0x5c6bbe){if(this[_0x8068('0x10')][_0x5c6bbe[_0x8068('0x38')]]){this['syncCustomEvent'](_0x5c6bbe);}};Trigger[_0x8068('0x2f')][_0x8068('0x37')]=function(_0x20bc66){var _0x11e29a;for(var _0x162f30 in this[_0x8068('0xf')]){if(this[_0x8068('0xf')][_0x8068('0x39')](_0x162f30)){if(this[_0x8068('0xf')][_0x162f30][_0x8068('0x3a')]){_0x11e29a=this[_0x8068('0x3b')](this['triggers'][_0x162f30],_0x20bc66);if(_0x11e29a){_[_0x8068('0x3c')](_0x20bc66,_0x20bc66['variables']);for(var _0x5b1c3f=0x0,_0x32442d,_0x2f1a1c,_0x3a4e30;_0x5b1c3f0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x743639,_0x41d558){var _0x15192f=function(_0x535794){while(--_0x535794){_0x743639['push'](_0x743639['shift']());}};_0x15192f(++_0x41d558);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 31983a3..7f24eee 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 _0x272b=['phonecall','callDirection','queue','/contacts(','phonecalls','assign','Descriptions','headers','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','length','internalemailaddress','toLowerCase','outbound','calleridnum','POST','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','nothing',']\x20Enduser\x20created!','enduserId','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','Subjects','getString','Fields'];(function(_0x31611f,_0x1e6d20){var _0x3185e6=function(_0x4d8ec1){while(--_0x4d8ec1){_0x31611f['push'](_0x31611f['shift']());}};_0x3185e6(++_0x1e6d20);}(_0x272b,0x16a));var _0xb272=function(_0x37b2be,_0x2c92fc){_0x37b2be=_0x37b2be-0x0;var _0x1e80ef=_0x272b[_0x37b2be];return _0x1e80ef;};'use strict';var _=require(_0xb272('0x0'));var BPromise=require(_0xb272('0x1'));var rp=require(_0xb272('0x2'));var util=require(_0xb272('0x3'));var intUtil=require(_0xb272('0x4'));var md5=require('md5');var Redis=require(_0xb272('0x5'));var logger=require(_0xb272('0x6'))(_0xb272('0x7'));var config=require(_0xb272('0x8'));config['redis']=_[_0xb272('0x9')](config[_0xb272('0xa')],{'host':_0xb272('0xb'),'port':0x18eb});var io=require(_0xb272('0xc'))(new Redis(config['redis']));function getAuthToken(_0x2df467,_0x3aa7e2,_0x1b94b2){var _0x1fa1d2={'method':'POST','uri':_0x3aa7e2,'form':{'client_id':_0x2df467[_0xb272('0xd')],'resource':_0x2df467['remoteUri'],'username':_0x2df467[_0xb272('0xe')],'password':_0x2df467[_0xb272('0xf')],'grant_type':_0xb272('0xf'),'client_secret':_0x2df467[_0xb272('0x10')]},'json':!![]};return rp(_0x1fa1d2)[_0xb272('0x11')](function(_0x58f2ec){return _0x58f2ec[_0xb272('0x12')];})[_0xb272('0x13')](function(_0x2516d3){logger[_0xb272('0x14')]('['+[_0x1b94b2['toUpperCase']()]+_0xb272('0x15'));return _0x2516d3[_0xb272('0x16')];});}function getUser(_0x1d7309,_0x3c16ba,_0x14a0a2,_0x558d52,_0x2ca676,_0x313698){return new BPromise(function(_0x284ca2,_0x259da5){return getAuthToken(_0x3c16ba,_0x558d52,_0x313698)[_0xb272('0x11')](function(_0x1c6238){var _0x12cf05={'method':_0xb272('0x17'),'uri':_0x2ca676+_0xb272('0x18'),'headers':{'Authorization':_0xb272('0x19')+_0x1c6238,'OData-Version':_0xb272('0x1a')},'json':!![]};return rp(_0x12cf05);})[_0xb272('0x11')](function(_0x302058){var _0x22add7=_0x302058[_0xb272('0x1b')];var _0x189635=![];var _0x403616=null;if(!_[_0xb272('0x1c')](_0x14a0a2)){if(intUtil[_0xb272('0x1d')](_0x14a0a2[_0xb272('0x1e')])){_0x1d7309[_0xb272('0x1f')]=_0x14a0a2['email'];for(_0x403616=0x0;_0x403616<_0x22add7['length'];_0x403616++){if(_0x22add7[_0x403616]['internalemailaddress']===_0x14a0a2[_0xb272('0x1e')]&&!_0x22add7[_0x403616]['isdisabled']){_0x189635=!![];logger[_0xb272('0x20')]('['+[_0x313698[_0xb272('0x21')]()]+_0xb272('0x22')+_0x22add7[_0x403616][_0xb272('0x23')]+'!');_0x1d7309[_0xb272('0x24')]=_0x22add7[_0x403616][_0xb272('0x23')];}}}}if(!_0x189635){logger[_0xb272('0x20')]('['+[_0x313698[_0xb272('0x21')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1d7309[_0xb272('0x1f')]=_0x3c16ba['username'];for(_0x403616=0x0;_0x403616<_0x22add7[_0xb272('0x25')];_0x403616++){if(_0x22add7[_0x403616][_0xb272('0x26')]===_0x3c16ba[_0xb272('0xe')]){_0x1d7309[_0xb272('0x24')]=_0x22add7[_0x403616][_0xb272('0x23')];}}}_0x284ca2(_0x1d7309);})[_0xb272('0x13')](function(_0x3e9ba4){_0x259da5(_0x3e9ba4[_0xb272('0x16')]);});});}function createEndUser(_0x1365ca,_0x12c7b6,_0xe2b4e5,_0x47d281,_0x583d1b,_0x46cbe2){return new BPromise(function(_0x5debbc,_0x9cb5e3){return getAuthToken(_0x12c7b6,_0xe2b4e5,_0x46cbe2)[_0xb272('0x11')](function(_0x4e344e){var _0x40a361=_0x46cbe2[_0xb272('0x27')]()===_0xb272('0x28')?_0x583d1b['destcalleridnum']:_0x583d1b[_0xb272('0x29')];var _0x4866a3={'method':_0xb272('0x2a'),'uri':_0x47d281+_0xb272('0x2b'),'body':{'telephone1':_0x40a361,'fullname':_0x40a361,'firstname':_0x40a361,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb272('0x2c')+_0x1365ca[_0xb272('0x24')]+')'},'headers':{'Authorization':_0xb272('0x19')+_0x4e344e,'OData-Version':_0xb272('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4866a3);})['then'](function(_0x5f5b26){var _0x1eef86=_0x5f5b26['headers'][_0xb272('0x2d')];var _0xa391bc=_0x1eef86[_0xb272('0x2e')](_0x1eef86[_0xb272('0x2f')]('(')+0x1,_0x1eef86[_0xb272('0x2f')](')'));_0x1365ca['enduserId']=_0xa391bc;_0x5debbc(_0x1365ca);})[_0xb272('0x13')](function(_0xbfdbd1){_0x9cb5e3(_0xbfdbd1[_0xb272('0x16')]);});});}function getEndUser(_0xc18764,_0x67176f,_0x4d570c,_0x255243,_0x113c84,_0x3a89eb,_0x3c20d0){var _0x1336a9=_0x3a89eb[_0xb272('0x27')]()===_0xb272('0x28')?_0x113c84[_0xb272('0x30')]:_0x113c84[_0xb272('0x29')];return getAuthToken(_0x67176f,_0x4d570c,_0x3a89eb)[_0xb272('0x11')](function(_0x4c0b96){var _0x3466e7={'method':_0xb272('0x17'),'uri':_0x255243+_0xb272('0x31')+_0x1336a9['replace']('+',_0xb272('0x32'))+'\x27','headers':{'Authorization':_0xb272('0x19')+_0x4c0b96,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3466e7);})['then'](function(_0x4a1664){var _0x1d2ece=![];if(!_0x4a1664)return _0x1d2ece;var _0x16afc2=_0x4a1664[_0xb272('0x1b')];for(var _0x4627d7=0x0;_0x4627d7<_0x16afc2[_0xb272('0x25')];_0x4627d7++){if(_0x16afc2[_0x4627d7][_0xb272('0x33')]===_0x1336a9){_0x1d2ece=!![];_0xc18764['enduserId']=_0x16afc2[_0x4627d7][_0xb272('0x34')];}}return _0x1d2ece;})[_0xb272('0x11')](function(_0x52b483){if(_0x52b483)return _0xc18764;if(_0x3c20d0===_0xb272('0x35')){logger[_0xb272('0x20')]('['+[_0x3a89eb['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0xc18764;}return createEndUser(_0xc18764,_0x67176f,_0x4d570c,_0x255243,_0x113c84,_0x3a89eb)[_0xb272('0x11')](function(_0x4e940a){logger[_0xb272('0x20')]('['+[_0x3a89eb[_0xb272('0x21')]()]+_0xb272('0x36'),_0x4e940a[_0xb272('0x37')]);return _0x4e940a;});});}function getCustomFields(_0x2558aa,_0xe3eba8,_0x1735d){var _0x58b007={};if(_0x2558aa[_0xb272('0x25')]>0x0){_[_0xb272('0x38')](_0x2558aa,function(_0x3e4513){if(_[_0xb272('0x39')]([_0xb272('0x3a'),_0xb272('0x3b')],_0x3e4513[_0xb272('0x3c')])&&_0x3e4513[_0xb272('0x3d')]&&!_0x3e4513['customField']){var _0x5c31e6=_0x3e4513[_0xb272('0x3e')]['toLowerCase']();var _0x29c21e=_0x5c31e6[_0xb272('0x2e')](0x0,_0x5c31e6[_0xb272('0x3f')]('_'));var _0x38d99c=_0x5c31e6[_0xb272('0x2e')](_0x5c31e6[_0xb272('0x3f')]('_')+0x1);if(_0x29c21e===_0x1735d){_0x58b007[_0x38d99c]=_0x3e4513[_0xb272('0x40')];}}});}return _0x58b007;}function getTicket(_0x40f175,_0x59548d,_0x1958ef,_0x3fe525,_0x2bd8ed,_0x4acd6d,_0x1d4bf0){return new BPromise(function(_0x2ba087,_0x3b5bca){var _0x2fd7e6;return getAuthToken(_0x59548d,_0x1958ef,_0x1d4bf0)['then'](function(_0x1226ad){if(_0x4acd6d[_0xb272('0x41')]===_0xb272('0x42')){_0x2fd7e6={'method':_0xb272('0x2a'),'uri':_0x3fe525+'incidents','body':Object['assign']({},{'title':intUtil['getString'](_0x4acd6d[_0xb272('0x43')],_0x2bd8ed,'\x20'),'description':intUtil[_0xb272('0x44')](_0x4acd6d['Descriptions'],_0x2bd8ed,'\x0a'),'customerid_contact@odata.bind':_0x40f175[_0xb272('0x37')]?'/contacts('+_0x40f175[_0xb272('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x40f175['userId']+')','caseorigincode':'1'},getCustomFields(_0x4acd6d[_0xb272('0x45')],_0x2bd8ed,_0x4acd6d[_0xb272('0x41')])),'headers':{'Authorization':_0xb272('0x19')+_0x1226ad,'OData-Version':_0xb272('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4acd6d[_0xb272('0x41')]===_0xb272('0x46')){var _0x723d9b=_0x40f175[_0xb272('0x37')]?[{'partyid_systemuser@odata.bind':_0xb272('0x2c')+_0x40f175[_0xb272('0x24')]+')','participationtypemask':_0x40f175[_0xb272('0x47')]===_0xb272('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0xb272('0x49')+_0x40f175['enduserId']+')','participationtypemask':_0x40f175['callDirection']===_0xb272('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x40f175['userId']+')','participationtypemask':_0x40f175[_0xb272('0x47')]===_0xb272('0x48')?0x2:0x1}];_0x2fd7e6={'method':_0xb272('0x2a'),'uri':_0x3fe525+_0xb272('0x4a'),'body':Object[_0xb272('0x4b')]({},{'subject':intUtil['getString'](_0x4acd6d[_0xb272('0x43')],_0x2bd8ed,'\x20'),'phonenumber':String(_0x2bd8ed[_0xb272('0x29')]),'description':intUtil['getString'](_0x4acd6d[_0xb272('0x4c')],_0x2bd8ed,'\x0a'),'regardingobjectid_contact@odata.bind':_0x40f175[_0xb272('0x37')]?'/contacts('+_0x40f175['enduserId']+')':undefined,'ownerid@odata.bind':_0xb272('0x2c')+_0x40f175[_0xb272('0x24')]+')','directioncode':_0x40f175[_0xb272('0x47')]===_0xb272('0x48')?![]:!![],'phonecall_activity_parties':_0x723d9b},getCustomFields(_0x4acd6d[_0xb272('0x45')],_0x2bd8ed,_0x4acd6d[_0xb272('0x41')])),'headers':{'Authorization':_0xb272('0x19')+_0x1226ad,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2fd7e6);})['then'](function(_0x83fc77){var _0x2c7c96=_0x83fc77[_0xb272('0x4d')][_0xb272('0x2d')];var _0x229c8b=_0x2c7c96[_0xb272('0x2e')](_0x2c7c96[_0xb272('0x2f')]('(')+0x1,_0x2c7c96[_0xb272('0x2f')](')'));_0x40f175['ticketId']=_0x229c8b;_0x2ba087(_0x40f175);})['catch'](function(_0x1728bb){_0x3b5bca(_0x1728bb[_0xb272('0x16')]);});});}function emit(_0x552abb,_0x49c7fe,_0x189c1b,_0x3aeb47){var _0x52172d={'uri':util['format'](_0xb272('0x4e'),_0x552abb,_0x189c1b,_0x3aeb47)};io['to'](util[_0xb272('0x4f')](_0xb272('0x50'),_0x49c7fe))[_0xb272('0x51')](_0xb272('0x52'),_0x52172d);}exports['cs']=function(_0x47f3f9,_0x4f1212,_0x57a429,_0x5d39f1,_0x25a4c2,_0x3a9880,_0x280f56,_0x4e6417){var _0x4bd9cc={};_0x3a9880[_0xb272('0x53')]=intUtil[_0xb272('0x54')](_0x3a9880[_0xb272('0x53')]);_0x3a9880['serverUrl']=intUtil['stripTrailingSlash'](_0x3a9880[_0xb272('0x55')]);_0x4bd9cc['callDirection']=_0x4e6417===_0xb272('0x48')||_0x4e6417===_0xb272('0x56')?_0xb272('0x48'):_0xb272('0x28');var _0x31fdd2=util[_0xb272('0x4f')](_0xb272('0x57'),_0x3a9880[_0xb272('0x53')]);var _0x3bf486=util[_0xb272('0x4f')](_0xb272('0x58'),_0x3a9880[_0xb272('0x59')]);var _0x2d2609=util[_0xb272('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a9880[_0xb272('0x55')],_0x4f1212[_0xb272('0x5a')],md5(_0x4f1212[_0xb272('0x5a')]));if(_0x25a4c2&&_0x25a4c2[_0xb272('0x5b')]){logger['info'](_0xb272('0x5c'),'Recording\x20is\x20enabled!');_0x4f1212['recordingURL']=_0x2d2609;}else if(_0x280f56&&_0x280f56[_0xb272('0x5d')]&&_0x280f56[_0xb272('0x5d')]!==_0xb272('0x5e')){logger[_0xb272('0x20')](_0xb272('0x5f'),_0xb272('0x60'));_0x4f1212[_0xb272('0x61')]=_0x2d2609;}else{_0x4f1212[_0xb272('0x61')]='';}return getUser(_0x4bd9cc,_0x3a9880,_0x5d39f1,_0x3bf486,_0x31fdd2,_0x4e6417)[_0xb272('0x11')](function(_0x50955c){logger['info']('['+_0x4e6417[_0xb272('0x21')]()+_0xb272('0x62'),_0x50955c[_0xb272('0x24')]);logger['info']('['+_0x4e6417[_0xb272('0x21')]()+_0xb272('0x63'),_0x50955c[_0xb272('0x1f')]);return getEndUser(_0x50955c,_0x3a9880,_0x3bf486,_0x31fdd2,_0x4f1212,_0x4e6417,_0x57a429[_0xb272('0x64')]);})[_0xb272('0x11')](function(_0x241206){logger['info']('['+_0x4e6417[_0xb272('0x21')]()+_0xb272('0x65'),_0x241206[_0xb272('0x37')]);logger['info']('['+_0x4e6417['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x4f1212[_0xb272('0x29')]);return getTicket(_0x241206,_0x3a9880,_0x3bf486,_0x31fdd2,_0x4f1212,_0x57a429,_0x4e6417);})[_0xb272('0x11')](function(_0x1b8827){logger[_0xb272('0x20')](util[_0xb272('0x4f')]('['+_0x4e6417[_0xb272('0x21')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x57a429[_0xb272('0x41')],_0x1b8827['ticketId']));logger['info'](util[_0xb272('0x4f')]('['+_0x4e6417[_0xb272('0x21')]()+_0xb272('0x66'),_0x4e6417));if(_0x4e6417!==_0xb272('0x56')){logger['info']('['+_0x4e6417[_0xb272('0x21')]()+']',_0xb272('0x67'));emit(_0x3a9880[_0xb272('0x53')],_0x5d39f1[_0xb272('0x68')],_0x57a429[_0xb272('0x41')],_0x1b8827[_0xb272('0x69')]);}})[_0xb272('0x13')](function(_0x591648){logger[_0xb272('0x14')]('['+_0x4e6417['toUpperCase']()+_0xb272('0x6a'),util[_0xb272('0x6b')](_0x591648,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xea60=['Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','odata-entityid','ticketId','format','user:%s','emit','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','substring','lastIndexOf','toLowerCase','outbound','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','telephone1','enduserId',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','type','idField','indexOf','content','ticketType','assign','getString','Subjects'];(function(_0x480032,_0x368cd8){var _0x28d998=function(_0x45e34b){while(--_0x45e34b){_0x480032['push'](_0x480032['shift']());}};_0x28d998(++_0x368cd8);}(_0xea60,0xe8));var _0x0ea6=function(_0x517e8f,_0x5c7f0a){_0x517e8f=_0x517e8f-0x0;var _0x2b756b=_0xea60[_0x517e8f];return _0x2b756b;};'use strict';var _=require(_0x0ea6('0x0'));var BPromise=require(_0x0ea6('0x1'));var rp=require('request-promise');var util=require(_0x0ea6('0x2'));var intUtil=require(_0x0ea6('0x3'));var md5=require(_0x0ea6('0x4'));var Redis=require('ioredis');var logger=require(_0x0ea6('0x5'))('dynamics365');var config=require(_0x0ea6('0x6'));config[_0x0ea6('0x7')]=_[_0x0ea6('0x8')](config[_0x0ea6('0x7')],{'host':_0x0ea6('0x9'),'port':0x18eb});var io=require(_0x0ea6('0xa'))(new Redis(config[_0x0ea6('0x7')]));function getAuthToken(_0xfdd9a1,_0xc3b0d6,_0x28a151){var _0x5669ca={'method':_0x0ea6('0xb'),'uri':_0xc3b0d6,'form':{'client_id':_0xfdd9a1[_0x0ea6('0xc')],'resource':_0xfdd9a1[_0x0ea6('0xd')],'username':_0xfdd9a1[_0x0ea6('0xe')],'password':_0xfdd9a1[_0x0ea6('0xf')],'grant_type':'password','client_secret':_0xfdd9a1['clientSecret']},'json':!![]};return rp(_0x5669ca)[_0x0ea6('0x10')](function(_0xf96c71){return _0xf96c71[_0x0ea6('0x11')];})[_0x0ea6('0x12')](function(_0x15845c){logger['error']('['+[_0x28a151[_0x0ea6('0x13')]()]+_0x0ea6('0x14'));return _0x15845c[_0x0ea6('0x15')];});}function getUser(_0x29cedb,_0x464a10,_0x52a62c,_0x3569bf,_0x137d3c,_0x1108a1){return new BPromise(function(_0x2a6e09,_0x4db8da){return getAuthToken(_0x464a10,_0x3569bf,_0x1108a1)[_0x0ea6('0x10')](function(_0xe77596){var _0x2203ce={'method':_0x0ea6('0x16'),'uri':_0x137d3c+_0x0ea6('0x17'),'headers':{'Authorization':_0x0ea6('0x18')+_0xe77596,'OData-Version':'4.0'},'json':!![]};return rp(_0x2203ce);})[_0x0ea6('0x10')](function(_0x6c7215){var _0x197e5c=_0x6c7215['value'];var _0x135b7f=![];var _0x2ff2c9=null;if(!_[_0x0ea6('0x19')](_0x52a62c)){if(intUtil[_0x0ea6('0x1a')](_0x52a62c['email'])){_0x29cedb['userEmail']=_0x52a62c[_0x0ea6('0x1b')];for(_0x2ff2c9=0x0;_0x2ff2c9<_0x197e5c[_0x0ea6('0x1c')];_0x2ff2c9++){if(_0x197e5c[_0x2ff2c9][_0x0ea6('0x1d')]===_0x52a62c[_0x0ea6('0x1b')]&&!_0x197e5c[_0x2ff2c9][_0x0ea6('0x1e')]){_0x135b7f=!![];logger['info']('['+[_0x1108a1[_0x0ea6('0x13')]()]+_0x0ea6('0x1f')+_0x197e5c[_0x2ff2c9][_0x0ea6('0x20')]+'!');_0x29cedb[_0x0ea6('0x21')]=_0x197e5c[_0x2ff2c9][_0x0ea6('0x20')];}}}}if(!_0x135b7f){logger[_0x0ea6('0x22')]('['+[_0x1108a1[_0x0ea6('0x13')]()]+_0x0ea6('0x23'));_0x29cedb[_0x0ea6('0x24')]=_0x464a10[_0x0ea6('0xe')];for(_0x2ff2c9=0x0;_0x2ff2c9<_0x197e5c['length'];_0x2ff2c9++){if(_0x197e5c[_0x2ff2c9][_0x0ea6('0x1d')]===_0x464a10[_0x0ea6('0xe')]){_0x29cedb['userId']=_0x197e5c[_0x2ff2c9][_0x0ea6('0x20')];}}}_0x2a6e09(_0x29cedb);})[_0x0ea6('0x12')](function(_0x6c79a7){_0x4db8da(_0x6c79a7['message']);});});}function createEndUser(_0x315ab4,_0x511cc8,_0x34710d,_0x3e4867,_0x3d0dad,_0x3ef7c1){return new BPromise(function(_0x38adc1,_0x5d9244){return getAuthToken(_0x511cc8,_0x34710d,_0x3ef7c1)[_0x0ea6('0x10')](function(_0x5406c7){var _0x5d3757=_0x3ef7c1['toLowerCase']()==='outbound'?_0x3d0dad[_0x0ea6('0x25')]:_0x3d0dad[_0x0ea6('0x26')];var _0x49d286={'method':_0x0ea6('0xb'),'uri':_0x3e4867+_0x0ea6('0x27'),'body':{'telephone1':_0x5d3757,'fullname':_0x5d3757,'firstname':_0x5d3757,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0ea6('0x28')+_0x315ab4['userId']+')'},'headers':{'Authorization':_0x0ea6('0x18')+_0x5406c7,'OData-Version':_0x0ea6('0x29')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x49d286);})[_0x0ea6('0x10')](function(_0x3a0a91){var _0x1d8f04=_0x3a0a91[_0x0ea6('0x2a')]['odata-entityid'];var _0x36f8b6=_0x1d8f04[_0x0ea6('0x2b')](_0x1d8f04[_0x0ea6('0x2c')]('(')+0x1,_0x1d8f04[_0x0ea6('0x2c')](')'));_0x315ab4['enduserId']=_0x36f8b6;_0x38adc1(_0x315ab4);})[_0x0ea6('0x12')](function(_0x3301d9){_0x5d9244(_0x3301d9[_0x0ea6('0x15')]);});});}function getEndUser(_0x18e99c,_0x13c00c,_0x51c522,_0x416c5e,_0xac6764,_0x2b34d4,_0x1c7e47){var _0x3d93fc=_0x2b34d4[_0x0ea6('0x2d')]()===_0x0ea6('0x2e')?_0xac6764[_0x0ea6('0x25')]:_0xac6764[_0x0ea6('0x26')];return getAuthToken(_0x13c00c,_0x51c522,_0x2b34d4)[_0x0ea6('0x10')](function(_0x526ba1){var _0x28ffb5={'method':_0x0ea6('0x16'),'uri':_0x416c5e+_0x0ea6('0x2f')+_0x3d93fc[_0x0ea6('0x30')]('+',_0x0ea6('0x31'))+'\x27','headers':{'Authorization':_0x0ea6('0x18')+_0x526ba1,'If-None-Match':null,'OData-Version':_0x0ea6('0x29')},'json':!![]};return rp(_0x28ffb5);})[_0x0ea6('0x10')](function(_0xe103fc){var _0x434888=![];if(!_0xe103fc)return _0x434888;var _0x3e7ce2=_0xe103fc[_0x0ea6('0x32')];for(var _0x1fd0c0=0x0;_0x1fd0c0<_0x3e7ce2[_0x0ea6('0x1c')];_0x1fd0c0++){if(_0x3e7ce2[_0x1fd0c0][_0x0ea6('0x33')]===_0x3d93fc){_0x434888=!![];_0x18e99c[_0x0ea6('0x34')]=_0x3e7ce2[_0x1fd0c0]['contactid'];}}return _0x434888;})[_0x0ea6('0x10')](function(_0x4f1c06){if(_0x4f1c06)return _0x18e99c;if(_0x1c7e47==='nothing'){logger[_0x0ea6('0x22')]('['+[_0x2b34d4[_0x0ea6('0x13')]()]+_0x0ea6('0x35'));return _0x18e99c;}return createEndUser(_0x18e99c,_0x13c00c,_0x51c522,_0x416c5e,_0xac6764,_0x2b34d4)['then'](function(_0x5d5cb6){logger[_0x0ea6('0x22')]('['+[_0x2b34d4[_0x0ea6('0x13')]()]+_0x0ea6('0x36'),_0x5d5cb6[_0x0ea6('0x34')]);return _0x5d5cb6;});});}function getCustomFields(_0x233478,_0x5e409f,_0x1e5b0d){var _0x44c6e1={};if(_0x233478[_0x0ea6('0x1c')]>0x0){_['forEach'](_0x233478,function(_0x267982){if(_[_0x0ea6('0x37')](['string',_0x0ea6('0x38')],_0x267982[_0x0ea6('0x39')])&&_0x267982['nameField']&&!_0x267982['customField']){var _0x4b2480=_0x267982[_0x0ea6('0x3a')][_0x0ea6('0x2d')]();var _0x45f183=_0x4b2480[_0x0ea6('0x2b')](0x0,_0x4b2480['indexOf']('_'));var _0x4a7234=_0x4b2480[_0x0ea6('0x2b')](_0x4b2480[_0x0ea6('0x3b')]('_')+0x1);if(_0x45f183===_0x1e5b0d){_0x44c6e1[_0x4a7234]=_0x267982[_0x0ea6('0x3c')];}}});}return _0x44c6e1;}function getTicket(_0x189da7,_0x31237e,_0x53c261,_0x517965,_0x29a606,_0xecdc23,_0x538d3c){return new BPromise(function(_0x208242,_0x123202){var _0x3e91fc;return getAuthToken(_0x31237e,_0x53c261,_0x538d3c)['then'](function(_0xa7b15f){if(_0xecdc23[_0x0ea6('0x3d')]==='incident'){_0x3e91fc={'method':_0x0ea6('0xb'),'uri':_0x517965+'incidents','body':Object[_0x0ea6('0x3e')]({},{'title':intUtil[_0x0ea6('0x3f')](_0xecdc23[_0x0ea6('0x40')],_0x29a606,'\x20'),'description':intUtil[_0x0ea6('0x3f')](_0xecdc23[_0x0ea6('0x41')],_0x29a606,'\x0a'),'customerid_contact@odata.bind':_0x189da7['enduserId']?_0x0ea6('0x42')+_0x189da7[_0x0ea6('0x34')]+')':undefined,'ownerid@odata.bind':_0x0ea6('0x28')+_0x189da7['userId']+')','caseorigincode':'1'},getCustomFields(_0xecdc23[_0x0ea6('0x43')],_0x29a606,_0xecdc23[_0x0ea6('0x3d')])),'headers':{'Authorization':_0x0ea6('0x18')+_0xa7b15f,'OData-Version':_0x0ea6('0x29')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xecdc23[_0x0ea6('0x3d')]==='phonecall'){var _0x22d53b=_0x189da7[_0x0ea6('0x34')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x189da7[_0x0ea6('0x21')]+')','participationtypemask':_0x189da7[_0x0ea6('0x44')]===_0x0ea6('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x0ea6('0x42')+_0x189da7['enduserId']+')','participationtypemask':_0x189da7['callDirection']===_0x0ea6('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x189da7[_0x0ea6('0x21')]+')','participationtypemask':_0x189da7[_0x0ea6('0x44')]===_0x0ea6('0x45')?0x2:0x1}];_0x3e91fc={'method':_0x0ea6('0xb'),'uri':_0x517965+_0x0ea6('0x46'),'body':Object[_0x0ea6('0x3e')]({},{'subject':intUtil['getString'](_0xecdc23[_0x0ea6('0x40')],_0x29a606,'\x20'),'phonenumber':String(_0x29a606['calleridnum']),'description':intUtil[_0x0ea6('0x3f')](_0xecdc23['Descriptions'],_0x29a606,'\x0a'),'regardingobjectid_contact@odata.bind':_0x189da7[_0x0ea6('0x34')]?_0x0ea6('0x42')+_0x189da7[_0x0ea6('0x34')]+')':undefined,'ownerid@odata.bind':_0x0ea6('0x28')+_0x189da7[_0x0ea6('0x21')]+')','directioncode':_0x189da7[_0x0ea6('0x44')]===_0x0ea6('0x45')?![]:!![],'phonecall_activity_parties':_0x22d53b},getCustomFields(_0xecdc23['Fields'],_0x29a606,_0xecdc23[_0x0ea6('0x3d')])),'headers':{'Authorization':_0x0ea6('0x18')+_0xa7b15f,'OData-Version':_0x0ea6('0x29')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e91fc);})['then'](function(_0x1c99fc){var _0x138fce=_0x1c99fc[_0x0ea6('0x2a')][_0x0ea6('0x47')];var _0x339605=_0x138fce['substring'](_0x138fce[_0x0ea6('0x2c')]('(')+0x1,_0x138fce[_0x0ea6('0x2c')](')'));_0x189da7[_0x0ea6('0x48')]=_0x339605;_0x208242(_0x189da7);})[_0x0ea6('0x12')](function(_0x5893c7){_0x123202(_0x5893c7[_0x0ea6('0x15')]);});});}function emit(_0x4f4ef2,_0x5230ce,_0x510bc3,_0x526947){var _0x370398={'uri':util[_0x0ea6('0x49')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x4f4ef2,_0x510bc3,_0x526947)};io['to'](util[_0x0ea6('0x49')](_0x0ea6('0x4a'),_0x5230ce))[_0x0ea6('0x4b')]('trigger:browser:url',_0x370398);}exports['cs']=function(_0x965435,_0x5f2d63,_0xc2e9aa,_0x1b4478,_0x1c5df2,_0x2165f7,_0x19abef,_0xb56cd){var _0x2edab1={};_0x2165f7[_0x0ea6('0xd')]=intUtil['stripTrailingSlash'](_0x2165f7[_0x0ea6('0xd')]);_0x2165f7[_0x0ea6('0x4c')]=intUtil[_0x0ea6('0x4d')](_0x2165f7[_0x0ea6('0x4c')]);_0x2edab1[_0x0ea6('0x44')]=_0xb56cd===_0x0ea6('0x45')||_0xb56cd==='unmanaged'?'queue':_0x0ea6('0x2e');var _0x52ac53=util['format'](_0x0ea6('0x4e'),_0x2165f7[_0x0ea6('0xd')]);var _0x4a5034=util[_0x0ea6('0x49')](_0x0ea6('0x4f'),_0x2165f7[_0x0ea6('0x50')]);var _0x3edc4a=util[_0x0ea6('0x49')](_0x0ea6('0x51'),_0x2165f7[_0x0ea6('0x4c')],_0x5f2d63[_0x0ea6('0x52')],md5(_0x5f2d63[_0x0ea6('0x52')]));if(_0x1c5df2&&_0x1c5df2[_0x0ea6('0x53')]){logger['info'](_0x0ea6('0x54'),_0x0ea6('0x55'));_0x5f2d63[_0x0ea6('0x56')]=_0x3edc4a;}else if(_0x19abef&&_0x19abef['recordingFormat']&&_0x19abef[_0x0ea6('0x57')]!==_0x0ea6('0x58')){logger[_0x0ea6('0x22')](_0x0ea6('0x59'),_0x0ea6('0x55'));_0x5f2d63['recordingURL']=_0x3edc4a;}else{_0x5f2d63[_0x0ea6('0x56')]='';}return getUser(_0x2edab1,_0x2165f7,_0x1b4478,_0x4a5034,_0x52ac53,_0xb56cd)[_0x0ea6('0x10')](function(_0xc4df7e){logger['info']('['+_0xb56cd[_0x0ea6('0x13')]()+_0x0ea6('0x5a'),_0xc4df7e[_0x0ea6('0x21')]);logger[_0x0ea6('0x22')]('['+_0xb56cd[_0x0ea6('0x13')]()+']\x20The\x20User\x20email\x20is:',_0xc4df7e[_0x0ea6('0x24')]);return getEndUser(_0xc4df7e,_0x2165f7,_0x4a5034,_0x52ac53,_0x5f2d63,_0xb56cd,_0xc2e9aa[_0x0ea6('0x5b')]);})[_0x0ea6('0x10')](function(_0x54bab7){logger[_0x0ea6('0x22')]('['+_0xb56cd[_0x0ea6('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x54bab7[_0x0ea6('0x34')]);logger[_0x0ea6('0x22')]('['+_0xb56cd[_0x0ea6('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x5f2d63['calleridnum']);return getTicket(_0x54bab7,_0x2165f7,_0x4a5034,_0x52ac53,_0x5f2d63,_0xc2e9aa,_0xb56cd);})[_0x0ea6('0x10')](function(_0x4609f5){logger['info'](util[_0x0ea6('0x49')]('['+_0xb56cd[_0x0ea6('0x13')]()+_0x0ea6('0x5c'),_0xc2e9aa[_0x0ea6('0x3d')],_0x4609f5['ticketId']));logger[_0x0ea6('0x22')](util[_0x0ea6('0x49')]('['+_0xb56cd['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xb56cd));if(_0xb56cd!==_0x0ea6('0x5d')){logger[_0x0ea6('0x22')]('['+_0xb56cd[_0x0ea6('0x13')]()+']',_0x0ea6('0x5e'));emit(_0x2165f7[_0x0ea6('0xd')],_0x1b4478[_0x0ea6('0x5f')],_0xc2e9aa[_0x0ea6('0x3d')],_0x4609f5[_0x0ea6('0x48')]);}})['catch'](function(_0x48acfc){logger[_0x0ea6('0x60')]('['+_0xb56cd[_0x0ea6('0x13')]()+_0x0ea6('0x61'),util[_0x0ea6('0x62')](_0x48acfc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index d9030d2..2e629c9 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 _0xecd2=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','variable','variableName','idField','Variable','push','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL'];(function(_0x4496c1,_0x103294){var _0xa2da11=function(_0x22d096){while(--_0x22d096){_0x4496c1['push'](_0x4496c1['shift']());}};_0xa2da11(++_0x103294);}(_0xecd2,0x130));var _0x2ecd=function(_0x2180ab,_0x223e39){_0x2180ab=_0x2180ab-0x0;var _0x36bec1=_0xecd2[_0x2180ab];return _0x36bec1;};'use strict';var _=require(_0x2ecd('0x0'));var rp=require(_0x2ecd('0x1'));var md5=require(_0x2ecd('0x2'));var util=require('util');var Redis=require(_0x2ecd('0x3'));var intUtil=require('./util');var config=require(_0x2ecd('0x4'));var logger=require(_0x2ecd('0x5'))(_0x2ecd('0x6'));config[_0x2ecd('0x7')]=_[_0x2ecd('0x8')](config[_0x2ecd('0x7')],{'host':_0x2ecd('0x9'),'port':0x18eb});var io=require(_0x2ecd('0xa'))(new Redis(config[_0x2ecd('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x2ecd('0xb')};function emit(_0x47d4c3,_0x4996bc,_0x965221){io['to'](_0x47d4c3)[_0x2ecd('0xc')](_0x4996bc,_0x965221);}function getTicket(_0x18394f,_0x479929,_0x5b1c31,_0x30213,_0x462dfa){logger[_0x2ecd('0xd')](_0x2ecd('0xe'));var _0x38e02b=_[_0x2ecd('0xf')]({'responder_id':_0x479929['id'],'requester_id':_0x5b1c31['id'],'name':util[_0x2ecd('0x10')](_0x2ecd('0x11'),_0x462dfa['calleridname']),'phone':_0x462dfa[_0x2ecd('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x30213[_0x2ecd('0x13')],_0x462dfa,'\x20'),'description':intUtil[_0x2ecd('0x14')](_0x30213['Descriptions'],_0x462dfa,_0x2ecd('0x15')),'tags':getTags(_0x30213['Tags'],_0x2ecd('0x16'))},getCustomFields(_0x30213[_0x2ecd('0x17')],_0x462dfa));_0x38e02b[_0x2ecd('0x18')]=_[_0x2ecd('0x19')](_[_0x2ecd('0x1a')](_0x38e02b[_0x2ecd('0x18')],'id'),_0x2ecd('0x1b'));return request({'uri':util['format'](_0x2ecd('0x1c'),_0x18394f['remoteUri']),'method':_0x2ecd('0x1d'),'body':_0x38e02b})[_0x2ecd('0x1e')](function(_0x467729){logger[_0x2ecd('0xd')](_0x2ecd('0x1f'));return _0x467729;});}function getUser(_0x2ac152,_0x59f487){if(intUtil[_0x2ecd('0x20')](_0x59f487)){return request({'uri':util[_0x2ecd('0x10')](_0x2ecd('0x21'),_0x2ac152[_0x2ecd('0x22')]),'qs':{'email':_0x59f487}})[_0x2ecd('0x1e')](function(_0x12e885){if(_0x12e885[_0x2ecd('0x23')]){logger[_0x2ecd('0xd')](_0x2ecd('0x24'));return _[_0x2ecd('0x25')](_0x12e885,function(_0x1961b4){return _0x1961b4[_0x2ecd('0x26')][_0x2ecd('0x27')]===_0x59f487;});}else{logger[_0x2ecd('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2ecd('0x10')](_0x2ecd('0x28'),_0x2ac152[_0x2ecd('0x22')])})[_0x2ecd('0x1e')](function(_0x2b4269){logger[_0x2ecd('0xd')]('Admin\x20account\x20selected.');return _0x2b4269;});}});}else{logger[_0x2ecd('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x2ac152['remoteUri'])})[_0x2ecd('0x1e')](function(_0x3518fa){logger[_0x2ecd('0xd')](_0x2ecd('0x29'));return _0x3518fa;});}}function getEndUser(_0x273500,_0x316cb4,_0x37f693){logger['info'](_0x2ecd('0x2a'),_0x37f693);return request({'uri':util[_0x2ecd('0x10')]('%s/api/v2/contacts',_0x273500['remoteUri']),'qs':{'phone':_0x37f693}})[_0x2ecd('0x1e')](function(_0x9c3283){if(_0x9c3283[_0x2ecd('0x23')]){logger[_0x2ecd('0xd')](_0x2ecd('0x2b'));return _['find'](_0x9c3283,{'phone':_0x37f693});}else{logger[_0x2ecd('0xd')](_0x2ecd('0x2c'));return request({'uri':util[_0x2ecd('0x10')]('%s/api/v2/contacts',_0x273500[_0x2ecd('0x22')]),'method':_0x2ecd('0x1d'),'body':{'name':_0x316cb4,'phone':_0x37f693}})['then'](function(_0x5d1da8){logger[_0x2ecd('0xd')](_0x2ecd('0x2d'));return _0x5d1da8;});}});}function getAuth(_0x71302a){return util['format']('Basic\x20%s',new Buffer(_0x71302a[_0x2ecd('0x2e')]+':X')[_0x2ecd('0x2f')](_0x2ecd('0x30')));}function request(_0x504e95){logger[_0x2ecd('0x31')](_0x2ecd('0x32'),JSON[_0x2ecd('0x33')](_0x504e95));return rp(_[_0x2ecd('0x8')](_0x504e95,{'method':_0x2ecd('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x55b021,_0x3e5230){var _0x415d62=[];if(_0x55b021&&_0x55b021[_0x2ecd('0x23')]>0x0){_0x415d62=_['map'](_0x55b021,_0x3e5230);}return _0x415d62;}function getCustomFields(_0x3eb7af,_0x580b1b){var _0x324796=[];var _0x366443={'custom_fields':[]};if(_0x3eb7af[_0x2ecd('0x23')]>0x0){_[_0x2ecd('0x35')](_0x3eb7af,function(_0xca733b){if(_[_0x2ecd('0x36')]([_0x2ecd('0x37'),_0x2ecd('0x38')],_0xca733b[_0x2ecd('0x39')])&&_0xca733b['nameField']&&!_0xca733b[_0x2ecd('0x3a')]){_0x366443[_0xca733b[_0x2ecd('0x3b')][_0x2ecd('0x3c')]()]=_0xca733b[_0x2ecd('0x3d')][_0x2ecd('0x2f')]();}else if(_[_0x2ecd('0x36')]([_0x2ecd('0x37'),_0x2ecd('0x38')],_0xca733b[_0x2ecd('0x39')])&&_0xca733b['idField']&&_0xca733b[_0x2ecd('0x3a')]){_0x366443[_0x2ecd('0x18')]['push']({'id':_0xca733b['idField'],'value':_0xca733b[_0x2ecd('0x3d')]['toString']()});}else if(_0xca733b[_0x2ecd('0x39')]===_0x2ecd('0x3e')&&_0xca733b[_0x2ecd('0x3f')]&&_0xca733b[_0x2ecd('0x40')]&&_0xca733b['customField']){_0x580b1b[_0xca733b[_0x2ecd('0x3f')]]&&_0x366443[_0x2ecd('0x18')]['push']({'id':_0xca733b[_0x2ecd('0x40')],'value':_0x580b1b[_0xca733b['variableName']][_0x2ecd('0x2f')]()});}else if(_0xca733b[_0x2ecd('0x39')]==='customVariable'&&_0xca733b[_0x2ecd('0x41')]&&_0xca733b[_0x2ecd('0x41')]['name']&&_0xca733b[_0x2ecd('0x40')]&&_0xca733b[_0x2ecd('0x3a')]){_0x580b1b[_0xca733b[_0x2ecd('0x41')]['name'][_0x2ecd('0x3c')]()]&&_0x366443[_0x2ecd('0x18')][_0x2ecd('0x42')]({'id':_0xca733b[_0x2ecd('0x40')],'value':_0x580b1b[_0xca733b[_0x2ecd('0x41')]['name']['toLowerCase']()][_0x2ecd('0x2f')]()});}});}return _0x366443;}exports['queue']=function(_0x3aa6c1,_0xecdaa8,_0x3e6ecc,_0x32ef62,_0xeb9a4a,_0x43e7e5){var _0x2529e5,_0x4775bf;_0x43e7e5[_0x2ecd('0x22')]=intUtil[_0x2ecd('0x43')](_0x43e7e5['remoteUri']);_0x43e7e5[_0x2ecd('0x44')]=intUtil[_0x2ecd('0x43')](_0x43e7e5[_0x2ecd('0x44')]);if(_0xeb9a4a&&_0xeb9a4a[_0x2ecd('0x45')]){logger[_0x2ecd('0xd')]('[QUEUE]',_0x2ecd('0x46'));_0xecdaa8[_0x2ecd('0x47')]=util[_0x2ecd('0x10')](_0x2ecd('0x48'),_0x43e7e5['serverUrl'],_0xecdaa8[_0x2ecd('0x49')],md5(_0xecdaa8[_0x2ecd('0x49')]));}else{_0xecdaa8[_0x2ecd('0x47')]='';}headers[_0x2ecd('0x4a')]=getAuth(_0x43e7e5);return getUser(_0x43e7e5,_0x32ef62[_0x2ecd('0x27')])['then'](function(_0x51aea1){_0x2529e5=_0x51aea1;logger[_0x2ecd('0xd')](_0x2ecd('0x4b'),_0x2529e5['id']);return getEndUser(_0x43e7e5,_0xecdaa8[_0x2ecd('0x4c')],_0xecdaa8[_0x2ecd('0x12')]);})['then'](function(_0xbf5e56){_0x4775bf=_0xbf5e56;logger[_0x2ecd('0xd')](_0x2ecd('0x4d'),_0x4775bf['id']);return getTicket(_0x43e7e5,_0x2529e5,_0x4775bf,_0x3e6ecc,_0xecdaa8);})[_0x2ecd('0x1e')](function(_0x215998){if(_0x215998&&_0x215998['id']){logger[_0x2ecd('0xd')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x215998['id']);logger[_0x2ecd('0xd')](_0x2ecd('0x4e'),_0x2ecd('0x4f'));emit(util[_0x2ecd('0x10')](_0x2ecd('0x50'),_0x32ef62[_0x2ecd('0x16')]),_0x2ecd('0x51'),{'uri':util[_0x2ecd('0x10')](_0x2ecd('0x52'),_0x43e7e5[_0x2ecd('0x22')],_0x215998['id'])});}})[_0x2ecd('0x53')](function(_0x461888){logger[_0x2ecd('0x54')](_0x2ecd('0x4e'),JSON[_0x2ecd('0x33')](_0x461888));});};exports[_0x2ecd('0x55')]=function(_0x15df77,_0xa8d84b,_0x264db6,_0x19595f,_0x14d60b,_0x3b3e3b,_0x5f14f8){var _0x1c92eb,_0x2c3ae0;_0x3b3e3b[_0x2ecd('0x22')]=intUtil[_0x2ecd('0x43')](_0x3b3e3b['remoteUri']);_0x3b3e3b['serverUrl']=intUtil[_0x2ecd('0x43')](_0x3b3e3b[_0x2ecd('0x44')]);if(_0x5f14f8&&_0x5f14f8[_0x2ecd('0x56')]&&_0x5f14f8[_0x2ecd('0x56')]!=='none'){logger[_0x2ecd('0xd')](_0x2ecd('0x57'),_0x2ecd('0x46'));_0xa8d84b['recordingURL']=util[_0x2ecd('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b3e3b[_0x2ecd('0x44')],_0xa8d84b[_0x2ecd('0x49')],md5(_0xa8d84b[_0x2ecd('0x49')]));}headers[_0x2ecd('0x4a')]=getAuth(_0x3b3e3b);return getUser(_0x3b3e3b,_0x19595f[_0x2ecd('0x27')])['then'](function(_0x5d9f54){_0x1c92eb=_0x5d9f54;logger[_0x2ecd('0xd')](_0x2ecd('0x4b'),_0x1c92eb['id']);return getEndUser(_0x3b3e3b,_0xa8d84b[_0x2ecd('0x58')],_0xa8d84b[_0x2ecd('0x59')]);})[_0x2ecd('0x1e')](function(_0x31e104){_0x2c3ae0=_0x31e104;logger['info'](_0x2ecd('0x4d'),_0x2c3ae0['id']);return getTicket(_0x3b3e3b,_0x1c92eb,_0x2c3ae0,_0x264db6,_0xa8d84b);})['then'](function(_0x1e0b0f){if(_0x1e0b0f&&_0x1e0b0f['id']){logger[_0x2ecd('0xd')](_0x2ecd('0x1f'));logger[_0x2ecd('0xd')](_0x2ecd('0x5a'),_0x1e0b0f['id']);logger[_0x2ecd('0xd')](_0x2ecd('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2ecd('0x10')](_0x2ecd('0x50'),_0x19595f[_0x2ecd('0x16')]),_0x2ecd('0x51'),{'uri':util[_0x2ecd('0x10')](_0x2ecd('0x52'),_0x3b3e3b[_0x2ecd('0x22')],_0x1e0b0f['id'])});}})['catch'](function(_0x3286fb){logger[_0x2ecd('0x54')](_0x2ecd('0x57'),JSON[_0x2ecd('0x33')](_0x3286fb));});};exports[_0x2ecd('0x5b')]=function(_0x27ef87,_0x1f3785,_0x320ed5,_0x2968e0,_0x438e0e,_0x2efdad){var _0x270401,_0x4dc646;_0x2efdad[_0x2ecd('0x22')]=intUtil[_0x2ecd('0x43')](_0x2efdad[_0x2ecd('0x22')]);_0x2efdad['serverUrl']=intUtil['stripTrailingSlash'](_0x2efdad[_0x2ecd('0x44')]);if(_0x438e0e&&_0x438e0e[_0x2ecd('0x45')]){logger[_0x2ecd('0xd')]('['+_0x1f3785[_0x2ecd('0x5c')][_0x2ecd('0x5d')]()+']','Recording\x20is\x20enabled!');_0x1f3785[_0x2ecd('0x47')]=util[_0x2ecd('0x10')](_0x2ecd('0x48'),_0x2efdad[_0x2ecd('0x44')],_0x1f3785[_0x2ecd('0x49')],md5(_0x1f3785[_0x2ecd('0x49')]));}else{_0x1f3785[_0x2ecd('0x47')]='';}headers['Authorization']=getAuth(_0x2efdad);return getUser(_0x2efdad,'')[_0x2ecd('0x1e')](function(_0x764780){_0x270401=_0x764780;logger[_0x2ecd('0xd')](_0x2ecd('0x4b'),_0x270401['id']);return getEndUser(_0x2efdad,_0x1f3785['calleridname'],_0x1f3785[_0x2ecd('0x12')]);})[_0x2ecd('0x1e')](function(_0x3f4b37){_0x4dc646=_0x3f4b37;logger[_0x2ecd('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4dc646['id']);return getTicket(_0x2efdad,_0x270401,_0x4dc646,_0x320ed5,_0x1f3785);})[_0x2ecd('0x1e')](function(_0x2485e6){if(_0x2485e6){logger['info'](_0x2ecd('0x1f'));logger[_0x2ecd('0xd')](_0x2ecd('0x5a'),_0x2485e6['id']);}})['catch'](function(_0x440449){logger[_0x2ecd('0x54')]('['+_0x1f3785[_0x2ecd('0x5c')][_0x2ecd('0x5d')]()+']',JSON[_0x2ecd('0x33')](_0x440449));});}; \ No newline at end of file +var _0x4ca7=['customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','error','monitor_format','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','Subjects','getString','Descriptions','
','Tags','name','Fields','mapValues','custom_fields','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','stringify','GET','map','includes','picklist','nameField','toLowerCase','content','string','type','idField','customField','push','variableName'];(function(_0x19c6a6,_0x36701d){var _0x29014=function(_0x4a61b3){while(--_0x4a61b3){_0x19c6a6['push'](_0x19c6a6['shift']());}};_0x29014(++_0x36701d);}(_0x4ca7,0x192));var _0x74ca=function(_0x54b743,_0x9c4ee2){_0x54b743=_0x54b743-0x0;var _0x15cb3d=_0x4ca7[_0x54b743];return _0x15cb3d;};'use strict';var _=require(_0x74ca('0x0'));var rp=require('request-promise');var md5=require(_0x74ca('0x1'));var util=require(_0x74ca('0x2'));var Redis=require(_0x74ca('0x3'));var intUtil=require(_0x74ca('0x4'));var config=require(_0x74ca('0x5'));var logger=require(_0x74ca('0x6'))('freshdesk');config[_0x74ca('0x7')]=_[_0x74ca('0x8')](config[_0x74ca('0x7')],{'host':_0x74ca('0x9'),'port':0x18eb});var io=require(_0x74ca('0xa'))(new Redis(config[_0x74ca('0x7')]));var headers={'Content-Type':_0x74ca('0xb'),'Accept':_0x74ca('0xb')};function emit(_0x557b9e,_0x4804c5,_0x1a80b8){io['to'](_0x557b9e)[_0x74ca('0xc')](_0x4804c5,_0x1a80b8);}function getTicket(_0xcdc419,_0x42c180,_0x44af7f,_0x140328,_0x3f38cc){logger[_0x74ca('0xd')](_0x74ca('0xe'));var _0x3f0b59=_[_0x74ca('0xf')]({'responder_id':_0x42c180['id'],'requester_id':_0x44af7f['id'],'name':util['format'](_0x74ca('0x10'),_0x3f38cc[_0x74ca('0x11')]),'phone':_0x3f38cc['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x140328[_0x74ca('0x12')],_0x3f38cc,'\x20'),'description':intUtil[_0x74ca('0x13')](_0x140328[_0x74ca('0x14')],_0x3f38cc,_0x74ca('0x15')),'tags':getTags(_0x140328[_0x74ca('0x16')],_0x74ca('0x17'))},getCustomFields(_0x140328[_0x74ca('0x18')],_0x3f38cc));_0x3f0b59['custom_fields']=_[_0x74ca('0x19')](_['keyBy'](_0x3f0b59[_0x74ca('0x1a')],'id'),_0x74ca('0x1b'));return request({'uri':util[_0x74ca('0x1c')](_0x74ca('0x1d'),_0xcdc419[_0x74ca('0x1e')]),'method':_0x74ca('0x1f'),'body':_0x3f0b59})[_0x74ca('0x20')](function(_0x1c91f3){logger[_0x74ca('0xd')](_0x74ca('0x21'));return _0x1c91f3;});}function getUser(_0x3a00b6,_0x17b3fe){if(intUtil['validateEmail'](_0x17b3fe)){return request({'uri':util[_0x74ca('0x1c')]('%s/api/v2/agents',_0x3a00b6[_0x74ca('0x1e')]),'qs':{'email':_0x17b3fe}})[_0x74ca('0x20')](function(_0x3f8fc6){if(_0x3f8fc6[_0x74ca('0x22')]){logger[_0x74ca('0xd')](_0x74ca('0x23'));return _['find'](_0x3f8fc6,function(_0x3860ac){return _0x3860ac[_0x74ca('0x24')]['email']===_0x17b3fe;});}else{logger['info'](_0x74ca('0x25'));return request({'uri':util[_0x74ca('0x1c')](_0x74ca('0x26'),_0x3a00b6[_0x74ca('0x1e')])})[_0x74ca('0x20')](function(_0x21f804){logger[_0x74ca('0xd')](_0x74ca('0x27'));return _0x21f804;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x74ca('0x1c')](_0x74ca('0x26'),_0x3a00b6['remoteUri'])})['then'](function(_0x3ff3ca){logger[_0x74ca('0xd')]('Admin\x20account\x20selected.');return _0x3ff3ca;});}}function getEndUser(_0x1ae271,_0x40f3cc,_0x3e45fb){logger['info'](_0x74ca('0x28'),_0x3e45fb);return request({'uri':util[_0x74ca('0x1c')](_0x74ca('0x29'),_0x1ae271[_0x74ca('0x1e')]),'qs':{'phone':_0x3e45fb}})[_0x74ca('0x20')](function(_0x459e75){if(_0x459e75[_0x74ca('0x22')]){logger[_0x74ca('0xd')](_0x74ca('0x2a'));return _[_0x74ca('0x2b')](_0x459e75,{'phone':_0x3e45fb});}else{logger[_0x74ca('0xd')](_0x74ca('0x2c'));return request({'uri':util[_0x74ca('0x1c')]('%s/api/v2/contacts',_0x1ae271[_0x74ca('0x1e')]),'method':_0x74ca('0x1f'),'body':{'name':_0x40f3cc,'phone':_0x3e45fb}})[_0x74ca('0x20')](function(_0x37fed5){logger[_0x74ca('0xd')]('Enduser\x20created.');return _0x37fed5;});}});}function getAuth(_0x23cf8a){return util['format'](_0x74ca('0x2d'),new Buffer(_0x23cf8a[_0x74ca('0x2e')]+':X')[_0x74ca('0x2f')](_0x74ca('0x30')));}function request(_0x5916af){logger['debug']('[HTTP]',JSON[_0x74ca('0x31')](_0x5916af));return rp(_[_0x74ca('0x8')](_0x5916af,{'method':_0x74ca('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x39ab6e,_0x511fca){var _0x18edb1=[];if(_0x39ab6e&&_0x39ab6e[_0x74ca('0x22')]>0x0){_0x18edb1=_[_0x74ca('0x33')](_0x39ab6e,_0x511fca);}return _0x18edb1;}function getCustomFields(_0x81576f,_0x57286e){var _0x54f490=[];var _0x1652af={'custom_fields':[]};if(_0x81576f['length']>0x0){_['forEach'](_0x81576f,function(_0x578a7c){if(_[_0x74ca('0x34')](['string',_0x74ca('0x35')],_0x578a7c['type'])&&_0x578a7c[_0x74ca('0x36')]&&!_0x578a7c['customField']){_0x1652af[_0x578a7c[_0x74ca('0x36')][_0x74ca('0x37')]()]=_0x578a7c[_0x74ca('0x38')][_0x74ca('0x2f')]();}else if(_['includes']([_0x74ca('0x39'),_0x74ca('0x35')],_0x578a7c[_0x74ca('0x3a')])&&_0x578a7c[_0x74ca('0x3b')]&&_0x578a7c[_0x74ca('0x3c')]){_0x1652af[_0x74ca('0x1a')][_0x74ca('0x3d')]({'id':_0x578a7c[_0x74ca('0x3b')],'value':_0x578a7c[_0x74ca('0x38')][_0x74ca('0x2f')]()});}else if(_0x578a7c[_0x74ca('0x3a')]==='variable'&&_0x578a7c[_0x74ca('0x3e')]&&_0x578a7c['idField']&&_0x578a7c[_0x74ca('0x3c')]){_0x57286e[_0x578a7c['variableName']]&&_0x1652af[_0x74ca('0x1a')][_0x74ca('0x3d')]({'id':_0x578a7c[_0x74ca('0x3b')],'value':_0x57286e[_0x578a7c[_0x74ca('0x3e')]]['toString']()});}else if(_0x578a7c[_0x74ca('0x3a')]===_0x74ca('0x3f')&&_0x578a7c['Variable']&&_0x578a7c[_0x74ca('0x40')][_0x74ca('0x17')]&&_0x578a7c['idField']&&_0x578a7c[_0x74ca('0x3c')]){_0x57286e[_0x578a7c['Variable'][_0x74ca('0x17')]['toLowerCase']()]&&_0x1652af[_0x74ca('0x1a')]['push']({'id':_0x578a7c[_0x74ca('0x3b')],'value':_0x57286e[_0x578a7c[_0x74ca('0x40')][_0x74ca('0x17')]['toLowerCase']()]['toString']()});}});}return _0x1652af;}exports[_0x74ca('0x41')]=function(_0x113d11,_0x27c735,_0x534f76,_0x25068c,_0x36a7b7,_0xd44a9d){var _0x49ac6a,_0x17452e;_0xd44a9d['remoteUri']=intUtil[_0x74ca('0x42')](_0xd44a9d[_0x74ca('0x1e')]);_0xd44a9d[_0x74ca('0x43')]=intUtil[_0x74ca('0x42')](_0xd44a9d[_0x74ca('0x43')]);if(_0x36a7b7&&_0x36a7b7['monitor_format']){logger[_0x74ca('0xd')](_0x74ca('0x44'),_0x74ca('0x45'));_0x27c735[_0x74ca('0x46')]=util[_0x74ca('0x1c')](_0x74ca('0x47'),_0xd44a9d[_0x74ca('0x43')],_0x27c735[_0x74ca('0x48')],md5(_0x27c735[_0x74ca('0x48')]));}else{_0x27c735[_0x74ca('0x46')]='';}headers[_0x74ca('0x49')]=getAuth(_0xd44a9d);return getUser(_0xd44a9d,_0x25068c[_0x74ca('0x4a')])['then'](function(_0x357217){_0x49ac6a=_0x357217;logger['info']('The\x20User\x20ID\x20is:',_0x49ac6a['id']);return getEndUser(_0xd44a9d,_0x27c735[_0x74ca('0x11')],_0x27c735[_0x74ca('0x4b')]);})[_0x74ca('0x20')](function(_0x38a7b2){_0x17452e=_0x38a7b2;logger[_0x74ca('0xd')](_0x74ca('0x4c'),_0x17452e['id']);return getTicket(_0xd44a9d,_0x49ac6a,_0x17452e,_0x534f76,_0x27c735);})['then'](function(_0x471a45){if(_0x471a45&&_0x471a45['id']){logger[_0x74ca('0xd')](_0x74ca('0x21'));logger[_0x74ca('0xd')](_0x74ca('0x4d'),_0x471a45['id']);logger[_0x74ca('0xd')](_0x74ca('0x44'),_0x74ca('0x4e'));emit(util['format']('user:%s',_0x25068c['name']),_0x74ca('0x4f'),{'uri':util[_0x74ca('0x1c')](_0x74ca('0x50'),_0xd44a9d[_0x74ca('0x1e')],_0x471a45['id'])});}})[_0x74ca('0x51')](function(_0x2866e3){logger['error'](_0x74ca('0x44'),JSON[_0x74ca('0x31')](_0x2866e3));});};exports[_0x74ca('0x52')]=function(_0xe9c352,_0x3d66c3,_0x42e7f4,_0x32f8a8,_0x45e50d,_0x3a5b07,_0x3ffbec){var _0x231ff7,_0x617b88;_0x3a5b07[_0x74ca('0x1e')]=intUtil['stripTrailingSlash'](_0x3a5b07[_0x74ca('0x1e')]);_0x3a5b07[_0x74ca('0x43')]=intUtil[_0x74ca('0x42')](_0x3a5b07['serverUrl']);if(_0x3ffbec&&_0x3ffbec['recordingFormat']&&_0x3ffbec[_0x74ca('0x53')]!==_0x74ca('0x54')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3d66c3[_0x74ca('0x46')]=util[_0x74ca('0x1c')](_0x74ca('0x47'),_0x3a5b07[_0x74ca('0x43')],_0x3d66c3['uniqueid'],md5(_0x3d66c3[_0x74ca('0x48')]));}headers[_0x74ca('0x49')]=getAuth(_0x3a5b07);return getUser(_0x3a5b07,_0x32f8a8[_0x74ca('0x4a')])[_0x74ca('0x20')](function(_0x441e49){_0x231ff7=_0x441e49;logger['info'](_0x74ca('0x55'),_0x231ff7['id']);return getEndUser(_0x3a5b07,_0x3d66c3[_0x74ca('0x56')],_0x3d66c3[_0x74ca('0x57')]);})[_0x74ca('0x20')](function(_0x4307f0){_0x617b88=_0x4307f0;logger[_0x74ca('0xd')](_0x74ca('0x4c'),_0x617b88['id']);return getTicket(_0x3a5b07,_0x231ff7,_0x617b88,_0x42e7f4,_0x3d66c3);})[_0x74ca('0x20')](function(_0xb3fb12){if(_0xb3fb12&&_0xb3fb12['id']){logger['info'](_0x74ca('0x21'));logger[_0x74ca('0xd')]('The\x20Ticket\x20ID\x20is:',_0xb3fb12['id']);logger['info'](_0x74ca('0x58'),_0x74ca('0x4e'));emit(util[_0x74ca('0x1c')]('user:%s',_0x32f8a8['name']),_0x74ca('0x4f'),{'uri':util[_0x74ca('0x1c')](_0x74ca('0x50'),_0x3a5b07[_0x74ca('0x1e')],_0xb3fb12['id'])});}})['catch'](function(_0x37beca){logger[_0x74ca('0x59')](_0x74ca('0x58'),JSON['stringify'](_0x37beca));});};exports['unmanaged']=function(_0x4c85ea,_0x41d2bd,_0x3ac7ea,_0x2ad708,_0x2c6231,_0x30c2f2){var _0x398745,_0x50319b;_0x30c2f2['remoteUri']=intUtil[_0x74ca('0x42')](_0x30c2f2[_0x74ca('0x1e')]);_0x30c2f2[_0x74ca('0x43')]=intUtil[_0x74ca('0x42')](_0x30c2f2['serverUrl']);if(_0x2c6231&&_0x2c6231[_0x74ca('0x5a')]){logger[_0x74ca('0xd')]('['+_0x41d2bd[_0x74ca('0x5b')][_0x74ca('0x5c')]()+']',_0x74ca('0x45'));_0x41d2bd[_0x74ca('0x46')]=util[_0x74ca('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x30c2f2[_0x74ca('0x43')],_0x41d2bd['uniqueid'],md5(_0x41d2bd[_0x74ca('0x48')]));}else{_0x41d2bd[_0x74ca('0x46')]='';}headers[_0x74ca('0x49')]=getAuth(_0x30c2f2);return getUser(_0x30c2f2,'')['then'](function(_0x481ec1){_0x398745=_0x481ec1;logger['info'](_0x74ca('0x55'),_0x398745['id']);return getEndUser(_0x30c2f2,_0x41d2bd[_0x74ca('0x11')],_0x41d2bd[_0x74ca('0x4b')]);})['then'](function(_0x1dac38){_0x50319b=_0x1dac38;logger['info'](_0x74ca('0x4c'),_0x50319b['id']);return getTicket(_0x30c2f2,_0x398745,_0x50319b,_0x3ac7ea,_0x41d2bd);})[_0x74ca('0x20')](function(_0x20f72b){if(_0x20f72b){logger['info'](_0x74ca('0x21'));logger[_0x74ca('0xd')]('The\x20Ticket\x20ID\x20is:',_0x20f72b['id']);}})[_0x74ca('0x51')](function(_0x9f650a){logger[_0x74ca('0x59')]('['+_0x41d2bd[_0x74ca('0x5b')]['toUpperCase']()+']',JSON[_0x74ca('0x31')](_0x9f650a));});}; \ 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 c5fc980..d893fb4 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 _0x6b7d=['contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','then','agentEmail','userEmail','length','userId','Admin\x20selected','GET','/api/lookup?q=','&f=','contacts','format'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6b7d,0xc8));var _0xd6b7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6b7d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var rp=require(_0xd6b7('0x0'));var md5=require('md5');var util=require(_0xd6b7('0x1'));var moment=require(_0xd6b7('0x2'));var Promise=require(_0xd6b7('0x3'));var Redis=require(_0xd6b7('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd6b7('0x5'))(_0xd6b7('0x6'));config['redis']=_[_0xd6b7('0x7')](config[_0xd6b7('0x8')],{'host':_0xd6b7('0x9'),'port':0x18eb});var io=require(_0xd6b7('0xa'))(new Redis(config[_0xd6b7('0x8')]));function getAdminId(_0x3f03cf,_0x370b79,_0x235751,_0x4a6b70){return new Promise(function(_0x12e50d,_0x356312){var _0x209f0a=![];var _0x383dcf={'method':'GET','uri':_0x4a6b70+_0xd6b7('0xb'),'json':!![]};_0x383dcf[_0xd6b7('0xc')]=_0x235751;logger[_0xd6b7('0xd')](_0xd6b7('0xe'));return rp(_0x383dcf)['then'](function(_0x229b3a){if(_0x229b3a){var _0x444f3b=_0x229b3a[_0xd6b7('0xf')];var _0xda9cd=null;for(_0xda9cd=0x0;_0xda9cd<_0x444f3b['length'];_0xda9cd++){if(_0x444f3b[_0xda9cd][_0xd6b7('0x10')]===_0x3f03cf[_0xd6b7('0x11')]){_0x3f03cf[_0xd6b7('0x12')]=_0x444f3b[_0xda9cd]['id'];_0x209f0a=!![];}}if(_0x209f0a){logger[_0xd6b7('0xd')](_0xd6b7('0x13'),_0x3f03cf[_0xd6b7('0x12')]);_0x12e50d(_0x3f03cf);}else{_0x356312({'statusCode':0x194,'message':_0xd6b7('0x14')});}}else{_0x356312({'statusCode':0x194,'message':_0xd6b7('0x14')});}})[_0xd6b7('0x15')](function(_0x4ca4bd){logger[_0xd6b7('0x16')]('['+[_0x370b79[_0xd6b7('0x17')]()]+']',_0x4ca4bd[_0xd6b7('0x18')]);_0x356312(_0x4ca4bd);});});}function getUser(_0x2e561c,_0x43176e,_0x22f039){return function(_0x334993){return new Promise(function(_0x3c25ea,_0x25d123){var _0x1a6b6e={'method':'GET','uri':_0x22f039+_0xd6b7('0xb'),'json':!![]};_0x1a6b6e[_0xd6b7('0xc')]=_0x43176e;logger[_0xd6b7('0xd')](_0xd6b7('0x19'));return rp(_0x1a6b6e)[_0xd6b7('0x1a')](function(_0x5f5b7f){if(_0x5f5b7f){var _0x269b36=_0x5f5b7f[_0xd6b7('0xf')];var _0x503722=![];var _0x16349b=null;if(_0x334993[_0xd6b7('0x1b')]!==null){logger[_0xd6b7('0xd')]('Getting\x20user\x20with\x20email',_0x334993['agentEmail']);_0x334993[_0xd6b7('0x1c')]=_0x334993[_0xd6b7('0x1b')];for(_0x16349b=0x0;_0x16349b<_0x269b36[_0xd6b7('0x1d')];_0x16349b++){if(_0x269b36[_0x16349b][_0xd6b7('0x10')]===_0x334993[_0xd6b7('0x1b')]){_0x503722=!![];_0x334993[_0xd6b7('0x1e')]=_0x269b36[_0x16349b]['id'];logger[_0xd6b7('0xd')]('User\x20found:',_0x334993[_0xd6b7('0x1e')]);}}}if(!_0x503722){logger[_0xd6b7('0xd')](_0xd6b7('0x1f'));_0x334993[_0xd6b7('0x1c')]=_0x334993[_0xd6b7('0x11')];_0x334993[_0xd6b7('0x1e')]=_0x334993[_0xd6b7('0x12')];_0x503722=!![];}if(_0x503722){_0x3c25ea(_0x334993);}else{_0x25d123({'statusCode':0x194,'message':_0xd6b7('0x14')});}}else{_0x25d123({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x9bf86){logger[_0xd6b7('0x16')]('['+[_0x2e561c[_0xd6b7('0x17')]()]+']',_0x9bf86[_0xd6b7('0x18')]);_0x25d123(_0x9bf86);});});};}function searchContact(_0x2a9b38,_0x280869,_0x15077c,_0x20dafc){return new Promise(function(_0xbe3b5e,_0x3ba88c){var _0x18a7af={'method':_0xd6b7('0x20'),'headers':_0x280869,'uri':_0x2a9b38+_0xd6b7('0x21')+_0x20dafc+_0xd6b7('0x22')+_0x15077c+'&entities=contact','json':!![]};rp(_0x18a7af)['then'](function(_0x5891f4){var _0x479217=_['find'](_0x5891f4['contacts'][_0xd6b7('0x23')],[_0x15077c,_0x20dafc]);_0xbe3b5e(_0x479217);})[_0xd6b7('0x15')](function(_0x7eff78){_0x3ba88c(_0x7eff78);});});}function getEndUser(_0x66cb94,_0x5e4031,_0x3a57a6){return function(_0x2f01ce){return new Promise(function(_0xe71e97,_0x43bdb2){logger[_0xd6b7('0xd')](util[_0xd6b7('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2f01ce[_0xd6b7('0x25')]));searchContact(_0x3a57a6,_0x5e4031,'mobile_number',_0x2f01ce[_0xd6b7('0x25')])[_0xd6b7('0x1a')](function(_0x1117f1){if(_0x1117f1){_0x2f01ce['endUserId']=_0x1117f1['id'];logger[_0xd6b7('0xd')](_0xd6b7('0x26'),_0x2f01ce[_0xd6b7('0x27')]);return _0xe71e97(_0x2f01ce);}searchContact(_0x3a57a6,_0x5e4031,_0xd6b7('0x28'),_0x2f01ce[_0xd6b7('0x25')])[_0xd6b7('0x1a')](function(_0x22ad22){if(_0x22ad22){_0x2f01ce[_0xd6b7('0x27')]=_0x22ad22['id'];logger[_0xd6b7('0xd')](_0xd6b7('0x29'),_0x2f01ce[_0xd6b7('0x27')]);return _0xe71e97(_0x2f01ce);}createEndUser(_0x2f01ce,_0x66cb94,_0x5e4031,_0x3a57a6)[_0xd6b7('0x1a')](function(_0x251f32){logger[_0xd6b7('0xd')]('Contact\x20created:',_0x251f32[_0xd6b7('0x27')]);return _0xe71e97(_0x251f32);});});})[_0xd6b7('0x15')](function(_0x20593d){_0x43bdb2(_0x20593d);});});};}function createEndUser(_0x560e32,_0x4761c3,_0x3e990a,_0x4789ff){return new Promise(function(_0x1256b1,_0x2ad95b){var _0x2338e2=moment();var _0x29de7d={'method':_0xd6b7('0x2a'),'uri':_0x4789ff+_0xd6b7('0x2b'),'body':{'contact':{'last_name':_0x560e32['contactNumber'],'work_number':_0x560e32[_0xd6b7('0x25')],'mobile_number':_0x560e32[_0xd6b7('0x25')],'owner_id':_0x560e32[_0xd6b7('0x1e')],'created_at':_0x2338e2['format'](_0xd6b7('0x2c'))}},'json':!![]};_0x29de7d[_0xd6b7('0xc')]=_0x3e990a;logger[_0xd6b7('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x29de7d)[_0xd6b7('0x1a')](function(_0x2c59b3){_0x560e32['endUserId']=_0x2c59b3[_0xd6b7('0x2d')]['id'];_0x1256b1(_0x560e32);})[_0xd6b7('0x15')](function(_0x2b7c31){logger[_0xd6b7('0x16')]('['+[_0x4761c3[_0xd6b7('0x17')]()]+']',_0x2b7c31[_0xd6b7('0x18')]);_0x2ad95b(_0x2b7c31[_0xd6b7('0x18')]);});});}function getTicket(_0x3c95d2,_0x4d1ac9,_0x1f431b,_0x5bdc6e,_0x2fd423){return function(_0x47f7b9){logger['info'](_0xd6b7('0x2e'));return new Promise(function(_0x50ef17,_0x4e89e6){var _0x14bf0b=moment();var _0x4f22af={'method':_0xd6b7('0x2a'),'uri':_0x1f431b+'/api/tasks','body':{'title':intUtil[_0xd6b7('0x2f')](_0x5bdc6e['Subjects'],_0x2fd423,'\x20'),'description':intUtil[_0xd6b7('0x2f')](_0x5bdc6e[_0xd6b7('0x30')],_0x2fd423,'\x0a'),'owner_id':_0x47f7b9[_0xd6b7('0x1e')],'creater_id':_0x47f7b9['adminId'],'targetable_id':_0x47f7b9[_0xd6b7('0x27')],'targetable_type':_0xd6b7('0x31'),'created_at':_0x14bf0b[_0xd6b7('0x24')](_0xd6b7('0x2c')),'due_date':_0x14bf0b[_0xd6b7('0x32')](0x1e,'m')[_0xd6b7('0x24')](_0xd6b7('0x2c'))},'json':!![]};_0x4f22af['headers']=_0x4d1ac9;return rp(_0x4f22af)['then'](function(_0x1d7d32){_0x47f7b9[_0xd6b7('0x33')]=_0x1d7d32[_0xd6b7('0x34')]['id'];logger[_0xd6b7('0xd')](_0xd6b7('0x35'),_0x47f7b9[_0xd6b7('0x33')]);_0x50ef17(_0x47f7b9);})[_0xd6b7('0x15')](function(_0xda708e){logger[_0xd6b7('0x16')]('['+[_0x3c95d2[_0xd6b7('0x17')]()]+']',_0xda708e[_0xd6b7('0x18')]);_0x4e89e6(_0xda708e['message']);});});};}function emit(_0x11b2f1,_0x4482f0,_0x209681){var _0x54dda4={'uri':_0x11b2f1+_0xd6b7('0x36')+_0x209681};io['to'](util[_0xd6b7('0x24')](_0xd6b7('0x37'),_0x4482f0))[_0xd6b7('0x38')](_0xd6b7('0x39'),_0x54dda4);}exports['cs']=function(_0x29f55b,_0x2a4fbd,_0x51eb43,_0x2f5791,_0x442873,_0x2921c4,_0x113a6d,_0x369dc9){var _0x128d46={};var _0x45775c={'Authorization':_0xd6b7('0x3a')+_0x2921c4[_0xd6b7('0x3b')]};_0x2921c4['remoteUri']=intUtil[_0xd6b7('0x3c')](_0x2921c4[_0xd6b7('0x3d')]);_0x2921c4[_0xd6b7('0x3e')]=intUtil['stripTrailingSlash'](_0x2921c4[_0xd6b7('0x3e')]);var _0x22809f=_0x2921c4[_0xd6b7('0x3d')];_0x128d46['adminEmail']=_0x2921c4[_0xd6b7('0x3f')];_0x128d46[_0xd6b7('0x25')]=_0x369dc9[_0xd6b7('0x40')]()===_0xd6b7('0x41')?_0x2a4fbd[_0xd6b7('0x42')]:_0x2a4fbd[_0xd6b7('0x43')];_0x128d46['callDirection']=_0x369dc9===_0xd6b7('0x44')||_0x369dc9===_0xd6b7('0x45')?'queue':_0xd6b7('0x41');if(_0x2f5791){_0x128d46[_0xd6b7('0x1b')]=_0x2f5791['email'];}var _0x4a8c23=util[_0xd6b7('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2921c4['serverUrl'],_0x2a4fbd[_0xd6b7('0x46')],md5(_0x2a4fbd[_0xd6b7('0x46')]));if(_0x442873&&_0x442873[_0xd6b7('0x47')]){logger[_0xd6b7('0xd')]('[QUEUE]',_0xd6b7('0x48'));_0x2a4fbd[_0xd6b7('0x49')]=_0x4a8c23;}else if(_0x113a6d&&_0x113a6d['recordingFormat']&&_0x113a6d[_0xd6b7('0x4a')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2a4fbd[_0xd6b7('0x49')]=_0x4a8c23;}else{_0x2a4fbd[_0xd6b7('0x49')]='';}return getAdminId(_0x128d46,_0x369dc9,_0x45775c,_0x22809f)[_0xd6b7('0x1a')](getUser(_0x369dc9,_0x45775c,_0x22809f))['then'](getEndUser(_0x369dc9,_0x45775c,_0x22809f))[_0xd6b7('0x1a')](getTicket(_0x369dc9,_0x45775c,_0x22809f,_0x51eb43,_0x2a4fbd))[_0xd6b7('0x1a')](function(_0x41bafa){logger[_0xd6b7('0xd')](util[_0xd6b7('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x41bafa[_0xd6b7('0x33')]));if(_0x369dc9!==_0xd6b7('0x45')){logger[_0xd6b7('0xd')]('['+[_0x369dc9['toUpperCase']()]+']',_0xd6b7('0x4b'));emit(_0x22809f,_0x2f5791[_0xd6b7('0x4c')],_0x41bafa[_0xd6b7('0x27')]);}})['catch'](function(_0x3b70c4){logger['error']('['+[_0x369dc9[_0xd6b7('0x17')]()]+_0xd6b7('0x4d'),util[_0xd6b7('0x4e')](_0x3b70c4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4421=['Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','adminEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','toLowerCase','outbound','calleridnum','callDirection','queue','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','unmanaged'];(function(_0xd77bf5,_0x42b453){var _0x48e838=function(_0x32d312){while(--_0x32d312){_0xd77bf5['push'](_0xd77bf5['shift']());}};_0x48e838(++_0x42b453);}(_0x4421,0x1b2));var _0x1442=function(_0x2bdbda,_0x5a9990){_0x2bdbda=_0x2bdbda-0x0;var _0x3c9af3=_0x4421[_0x2bdbda];return _0x3c9af3;};'use strict';var _=require(_0x1442('0x0'));var rp=require(_0x1442('0x1'));var md5=require('md5');var util=require(_0x1442('0x2'));var moment=require(_0x1442('0x3'));var Promise=require(_0x1442('0x4'));var Redis=require(_0x1442('0x5'));var intUtil=require('./util');var config=require(_0x1442('0x6'));var logger=require('../../../../config/logger')(_0x1442('0x7'));config[_0x1442('0x8')]=_[_0x1442('0x9')](config[_0x1442('0x8')],{'host':_0x1442('0xa'),'port':0x18eb});var io=require(_0x1442('0xb'))(new Redis(config[_0x1442('0x8')]));function getAdminId(_0x27d386,_0x3a0151,_0x27e9b2,_0x115114){return new Promise(function(_0x47beaf,_0x20fc66){var _0x4bcd5f=![];var _0x4cfc42={'method':_0x1442('0xc'),'uri':_0x115114+_0x1442('0xd'),'json':!![]};_0x4cfc42[_0x1442('0xe')]=_0x27e9b2;logger[_0x1442('0xf')](_0x1442('0x10'));return rp(_0x4cfc42)[_0x1442('0x11')](function(_0x318593){if(_0x318593){var _0x474a25=_0x318593[_0x1442('0x12')];var _0x449fb2=null;for(_0x449fb2=0x0;_0x449fb2<_0x474a25[_0x1442('0x13')];_0x449fb2++){if(_0x474a25[_0x449fb2][_0x1442('0x14')]===_0x27d386['adminEmail']){_0x27d386[_0x1442('0x15')]=_0x474a25[_0x449fb2]['id'];_0x4bcd5f=!![];}}if(_0x4bcd5f){logger[_0x1442('0xf')](_0x1442('0x16'),_0x27d386[_0x1442('0x15')]);_0x47beaf(_0x27d386);}else{_0x20fc66({'statusCode':0x194,'message':_0x1442('0x17')});}}else{_0x20fc66({'statusCode':0x194,'message':_0x1442('0x17')});}})[_0x1442('0x18')](function(_0x268d39){logger[_0x1442('0x19')]('['+[_0x3a0151[_0x1442('0x1a')]()]+']',_0x268d39[_0x1442('0x1b')]);_0x20fc66(_0x268d39);});});}function getUser(_0x175195,_0x567097,_0x2ed9ba){return function(_0x2a4abd){return new Promise(function(_0x4cf42b,_0x3e8bcb){var _0x56ce5a={'method':_0x1442('0xc'),'uri':_0x2ed9ba+_0x1442('0xd'),'json':!![]};_0x56ce5a[_0x1442('0xe')]=_0x567097;logger['info'](_0x1442('0x1c'));return rp(_0x56ce5a)[_0x1442('0x11')](function(_0xd52aac){if(_0xd52aac){var _0x2bd3ae=_0xd52aac[_0x1442('0x12')];var _0x2baaed=![];var _0x41ae69=null;if(_0x2a4abd['agentEmail']!==null){logger[_0x1442('0xf')](_0x1442('0x1d'),_0x2a4abd[_0x1442('0x1e')]);_0x2a4abd[_0x1442('0x1f')]=_0x2a4abd[_0x1442('0x1e')];for(_0x41ae69=0x0;_0x41ae69<_0x2bd3ae[_0x1442('0x13')];_0x41ae69++){if(_0x2bd3ae[_0x41ae69][_0x1442('0x14')]===_0x2a4abd[_0x1442('0x1e')]){_0x2baaed=!![];_0x2a4abd[_0x1442('0x20')]=_0x2bd3ae[_0x41ae69]['id'];logger['info']('User\x20found:',_0x2a4abd[_0x1442('0x20')]);}}}if(!_0x2baaed){logger[_0x1442('0xf')](_0x1442('0x21'));_0x2a4abd[_0x1442('0x1f')]=_0x2a4abd[_0x1442('0x22')];_0x2a4abd[_0x1442('0x20')]=_0x2a4abd['adminId'];_0x2baaed=!![];}if(_0x2baaed){_0x4cf42b(_0x2a4abd);}else{_0x3e8bcb({'statusCode':0x194,'message':_0x1442('0x17')});}}else{_0x3e8bcb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1442('0x18')](function(_0x36702a){logger['error']('['+[_0x175195[_0x1442('0x1a')]()]+']',_0x36702a[_0x1442('0x1b')]);_0x3e8bcb(_0x36702a);});});};}function searchContact(_0x23254f,_0x5463c8,_0x8275ce,_0x1c8541){return new Promise(function(_0x24ed0b,_0x2b8734){var _0x53e051={'method':_0x1442('0xc'),'headers':_0x5463c8,'uri':_0x23254f+_0x1442('0x23')+_0x1c8541+_0x1442('0x24')+_0x8275ce+_0x1442('0x25'),'json':!![]};rp(_0x53e051)[_0x1442('0x11')](function(_0x4f2c9b){var _0x265c99=_[_0x1442('0x26')](_0x4f2c9b['contacts'][_0x1442('0x27')],[_0x8275ce,_0x1c8541]);_0x24ed0b(_0x265c99);})[_0x1442('0x18')](function(_0x5b9bb4){_0x2b8734(_0x5b9bb4);});});}function getEndUser(_0x5de183,_0x75a16b,_0x10ca1d){return function(_0x1f9b06){return new Promise(function(_0x3f47f1,_0x57614a){logger[_0x1442('0xf')](util[_0x1442('0x28')](_0x1442('0x29'),_0x1f9b06['contactNumber']));searchContact(_0x10ca1d,_0x75a16b,_0x1442('0x2a'),_0x1f9b06[_0x1442('0x2b')])[_0x1442('0x11')](function(_0x62b0f){if(_0x62b0f){_0x1f9b06['endUserId']=_0x62b0f['id'];logger[_0x1442('0xf')](_0x1442('0x2c'),_0x1f9b06[_0x1442('0x2d')]);return _0x3f47f1(_0x1f9b06);}searchContact(_0x10ca1d,_0x75a16b,'work_number',_0x1f9b06['contactNumber'])[_0x1442('0x11')](function(_0x130a44){if(_0x130a44){_0x1f9b06[_0x1442('0x2d')]=_0x130a44['id'];logger[_0x1442('0xf')](_0x1442('0x2e'),_0x1f9b06[_0x1442('0x2d')]);return _0x3f47f1(_0x1f9b06);}createEndUser(_0x1f9b06,_0x5de183,_0x75a16b,_0x10ca1d)[_0x1442('0x11')](function(_0x1d2e58){logger[_0x1442('0xf')]('Contact\x20created:',_0x1d2e58[_0x1442('0x2d')]);return _0x3f47f1(_0x1d2e58);});});})[_0x1442('0x18')](function(_0x5c552b){_0x57614a(_0x5c552b);});});};}function createEndUser(_0x548084,_0x57e35e,_0xaf3901,_0x10a7d1){return new Promise(function(_0x273e75,_0x3eedf0){var _0x36ef0d=moment();var _0x1d65f1={'method':_0x1442('0x2f'),'uri':_0x10a7d1+_0x1442('0x30'),'body':{'contact':{'last_name':_0x548084[_0x1442('0x2b')],'work_number':_0x548084[_0x1442('0x2b')],'mobile_number':_0x548084[_0x1442('0x2b')],'owner_id':_0x548084['userId'],'created_at':_0x36ef0d[_0x1442('0x28')](_0x1442('0x31'))}},'json':!![]};_0x1d65f1[_0x1442('0xe')]=_0xaf3901;logger[_0x1442('0xf')](_0x1442('0x32'));return rp(_0x1d65f1)['then'](function(_0x3ee04b){_0x548084['endUserId']=_0x3ee04b['contact']['id'];_0x273e75(_0x548084);})[_0x1442('0x18')](function(_0x47d6bb){logger[_0x1442('0x19')]('['+[_0x57e35e['toUpperCase']()]+']',_0x47d6bb[_0x1442('0x1b')]);_0x3eedf0(_0x47d6bb[_0x1442('0x1b')]);});});}function getTicket(_0x2acb65,_0x1199b5,_0x21fc69,_0x456a6c,_0x6dc6d8){return function(_0x26ec67){logger[_0x1442('0xf')](_0x1442('0x33'));return new Promise(function(_0x5bafe0,_0x8abed1){var _0x4fb044=moment();var _0x449b6d={'method':_0x1442('0x2f'),'uri':_0x21fc69+_0x1442('0x34'),'body':{'title':intUtil['getString'](_0x456a6c[_0x1442('0x35')],_0x6dc6d8,'\x20'),'description':intUtil['getString'](_0x456a6c[_0x1442('0x36')],_0x6dc6d8,'\x0a'),'owner_id':_0x26ec67[_0x1442('0x20')],'creater_id':_0x26ec67[_0x1442('0x15')],'targetable_id':_0x26ec67[_0x1442('0x2d')],'targetable_type':_0x1442('0x37'),'created_at':_0x4fb044[_0x1442('0x28')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4fb044[_0x1442('0x38')](0x1e,'m')[_0x1442('0x28')](_0x1442('0x31'))},'json':!![]};_0x449b6d['headers']=_0x1199b5;return rp(_0x449b6d)['then'](function(_0x2fe5d2){_0x26ec67[_0x1442('0x39')]=_0x2fe5d2[_0x1442('0x3a')]['id'];logger[_0x1442('0xf')](_0x1442('0x3b'),_0x26ec67[_0x1442('0x39')]);_0x5bafe0(_0x26ec67);})[_0x1442('0x18')](function(_0x2db79e){logger['error']('['+[_0x2acb65['toUpperCase']()]+']',_0x2db79e[_0x1442('0x1b')]);_0x8abed1(_0x2db79e['message']);});});};}function emit(_0x466c2f,_0x302c96,_0xdf7649){var _0x55a324={'uri':_0x466c2f+_0x1442('0x3c')+_0xdf7649};io['to'](util[_0x1442('0x28')](_0x1442('0x3d'),_0x302c96))[_0x1442('0x3e')](_0x1442('0x3f'),_0x55a324);}exports['cs']=function(_0x4577fc,_0x4c8792,_0x4c18b7,_0x2b8bd6,_0x417bae,_0x394793,_0x5ade24,_0x308feb){var _0x3ca7b7={};var _0x41498f={'Authorization':_0x1442('0x40')+_0x394793[_0x1442('0x41')]};_0x394793['remoteUri']=intUtil[_0x1442('0x42')](_0x394793[_0x1442('0x43')]);_0x394793['serverUrl']=intUtil[_0x1442('0x42')](_0x394793['serverUrl']);var _0x58785d=_0x394793[_0x1442('0x43')];_0x3ca7b7[_0x1442('0x22')]=_0x394793['username'];_0x3ca7b7[_0x1442('0x2b')]=_0x308feb[_0x1442('0x44')]()===_0x1442('0x45')?_0x4c8792['destcalleridnum']:_0x4c8792[_0x1442('0x46')];_0x3ca7b7[_0x1442('0x47')]=_0x308feb===_0x1442('0x48')||_0x308feb==='unmanaged'?'queue':_0x1442('0x45');if(_0x2b8bd6){_0x3ca7b7['agentEmail']=_0x2b8bd6[_0x1442('0x14')];}var _0x10e433=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x394793[_0x1442('0x49')],_0x4c8792[_0x1442('0x4a')],md5(_0x4c8792['uniqueid']));if(_0x417bae&&_0x417bae['monitor_format']){logger[_0x1442('0xf')](_0x1442('0x4b'),_0x1442('0x4c'));_0x4c8792[_0x1442('0x4d')]=_0x10e433;}else if(_0x5ade24&&_0x5ade24[_0x1442('0x4e')]&&_0x5ade24['recordingFormat']!==_0x1442('0x4f')){logger[_0x1442('0xf')](_0x1442('0x50'),'Recording\x20is\x20enabled!');_0x4c8792[_0x1442('0x4d')]=_0x10e433;}else{_0x4c8792[_0x1442('0x4d')]='';}return getAdminId(_0x3ca7b7,_0x308feb,_0x41498f,_0x58785d)[_0x1442('0x11')](getUser(_0x308feb,_0x41498f,_0x58785d))['then'](getEndUser(_0x308feb,_0x41498f,_0x58785d))[_0x1442('0x11')](getTicket(_0x308feb,_0x41498f,_0x58785d,_0x4c18b7,_0x4c8792))[_0x1442('0x11')](function(_0xa0f5e2){logger[_0x1442('0xf')](util[_0x1442('0x28')]('The\x20ticket\x20ID\x20is:\x20%s',_0xa0f5e2[_0x1442('0x39')]));if(_0x308feb!==_0x1442('0x51')){logger[_0x1442('0xf')]('['+[_0x308feb['toUpperCase']()]+']',_0x1442('0x52'));emit(_0x58785d,_0x2b8bd6[_0x1442('0x53')],_0xa0f5e2[_0x1442('0x2d')]);}})[_0x1442('0x18')](function(_0x4a8d9f){logger[_0x1442('0x19')]('['+[_0x308feb[_0x1442('0x1a')]()]+_0x1442('0x54'),util[_0x1442('0x55')](_0x4a8d9f,{'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 8bdd5a6..b374543 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 _0x839e=['Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find'];(function(_0x3c12aa,_0x500812){var _0x51bb6d=function(_0x383f17){while(--_0x383f17){_0x3c12aa['push'](_0x3c12aa['shift']());}};_0x51bb6d(++_0x500812);}(_0x839e,0x170));var _0xe839=function(_0x301785,_0x506056){_0x301785=_0x301785-0x0;var _0x4ea53b=_0x839e[_0x301785];return _0x4ea53b;};'use strict';var _=require(_0xe839('0x0'));var util=require(_0xe839('0x1'));var zendesk=require(_0xe839('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xe839('0x3'));var zoho=require(_0xe839('0x4'));var desk=require(_0xe839('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xe839('0x6'));var freshsales=require(_0xe839('0x7'));var integrations=[_0xe839('0x8'),'salesforce',_0xe839('0x9'),_0xe839('0xa'),_0xe839('0xb'),_0xe839('0xc'),_0xe839('0xd'),_0xe839('0xe'),_0xe839('0xf'),_0xe839('0x10')];exports[_0xe839('0x11')]=function(_0x3d3253,_0xf8ba0c,_0x32e6f8,_0x244cf1,_0x4bee6f,_0x1cf695){if(_0x32e6f8){if(_[_0xe839('0x12')](integrations,_0x3d3253[_0xe839('0x13')][_0xe839('0x14')]())){try{var _0x3f80f3=null;var _0x4e088a='';var _0x1513eb=_0x32e6f8[_0x3d3253[_0xe839('0x13')][_0xe839('0x14')]()];if(_0x1513eb){var _0x5af868=_0x1513eb[_0x3d3253['data2']];if(_0x5af868){var _0x14b852=_[_0xe839('0x15')](_0x5af868[_0xe839('0x16')],{'id':parseInt(_0x3d3253[_0xe839('0x17')],0xa)});if(_0x14b852){if(_0x244cf1){if(_0x4bee6f&&_0xf8ba0c[_0xe839('0x18')]){_0x4e088a=_0xe839('0x18');}else if(_0xf8ba0c[_0xe839('0x19')]){_0x4e088a=_0xe839('0x1a');}else{console[_0xe839('0x1b')](_0xe839('0x1c'),_0xf8ba0c);}}else{_0x4e088a=_0xe839('0x1d');}switch(_0x3d3253[_0xe839('0x13')][_0xe839('0x14')]()){case _0xe839('0x8'):zendesk[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0x1e'):salesforce[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0x9'):sugarcrm[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0xa'):freshdesk[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0xb'):zoho[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case'desk':desk[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0xd'):vtiger[_0x4e088a](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695);break;case _0xe839('0xf'):freshsales['cs'](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695,_0x4e088a);break;case _0xe839('0x10'):servicenow['cs'](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695,_0x4e088a);break;case _0xe839('0xe'):dynamics365['cs'](_0x3d3253,_0xf8ba0c,_0x14b852,_0x244cf1,_0x4bee6f,_0x5af868,_0x1cf695,_0x4e088a);break;default:console[_0xe839('0x1b')](_0xe839('0x1f'));}}else{_0x3f80f3=require(_0xe839('0x20'))(_0x3d3253[_0xe839('0x13')]['toLowerCase']());_0x3f80f3[_0xe839('0x21')]('[EXEC]',util['format'](_0xe839('0x22'),_0x3d3253['data1'][_0xe839('0x14')](),_0x3d3253[_0xe839('0x17')]));}}else{_0x3f80f3=require(_0xe839('0x20'))(_0x3d3253[_0xe839('0x13')][_0xe839('0x14')]());_0x3f80f3[_0xe839('0x21')](_0xe839('0x23'),util[_0xe839('0x24')](_0xe839('0x25'),_0x3d3253[_0xe839('0x13')]['toLowerCase'](),_0x3d3253[_0xe839('0x26')]));}}else{}}catch(_0x157f77){console[_0xe839('0x21')](_0x157f77);}}}}; \ No newline at end of file +var _0x58ed=['./salesforce','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','../../../../config/logger','error','format','data3','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./zendesk'];(function(_0x598ae5,_0x2b99d6){var _0x3bd58a=function(_0x2a7610){while(--_0x2a7610){_0x598ae5['push'](_0x598ae5['shift']());}};_0x3bd58a(++_0x2b99d6);}(_0x58ed,0x1da));var _0xd58e=function(_0x5680d7,_0x5804c5){_0x5680d7=_0x5680d7-0x0;var _0x9f664e=_0x58ed[_0x5680d7];return _0x9f664e;};'use strict';var _=require('lodash');var util=require(_0xd58e('0x0'));var zendesk=require(_0xd58e('0x1'));var salesforce=require(_0xd58e('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xd58e('0x3'));var desk=require('./desk');var vtiger=require(_0xd58e('0x4'));var servicenow=require(_0xd58e('0x5'));var dynamics365=require(_0xd58e('0x6'));var freshsales=require(_0xd58e('0x7'));var integrations=['zendesk',_0xd58e('0x8'),_0xd58e('0x9'),_0xd58e('0xa'),_0xd58e('0xb'),_0xd58e('0xc'),_0xd58e('0xd'),'dynamics365','freshsales','servicenow'];exports[_0xd58e('0xe')]=function(_0x3d07ba,_0x7e43cd,_0x20207b,_0x1702a,_0x228cbf,_0x329f5b){if(_0x20207b){if(_[_0xd58e('0xf')](integrations,_0x3d07ba[_0xd58e('0x10')][_0xd58e('0x11')]())){try{var _0x2eac38=null;var _0x3d7def='';var _0x467331=_0x20207b[_0x3d07ba['data1']['toLowerCase']()];if(_0x467331){var _0x2fa798=_0x467331[_0x3d07ba[_0xd58e('0x12')]];if(_0x2fa798){var _0x44ff32=_[_0xd58e('0x13')](_0x2fa798[_0xd58e('0x14')],{'id':parseInt(_0x3d07ba['data3'],0xa)});if(_0x44ff32){if(_0x1702a){if(_0x228cbf&&_0x7e43cd[_0xd58e('0x15')]){_0x3d7def=_0xd58e('0x15');}else if(_0x7e43cd[_0xd58e('0x16')]){_0x3d7def=_0xd58e('0x17');}else{console[_0xd58e('0x18')](_0xd58e('0x19'),_0x7e43cd);}}else{_0x3d7def=_0xd58e('0x1a');}switch(_0x3d07ba[_0xd58e('0x10')][_0xd58e('0x11')]()){case _0xd58e('0x1b'):zendesk[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case _0xd58e('0x8'):salesforce[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case _0xd58e('0x9'):sugarcrm[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case _0xd58e('0xa'):freshdesk[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case _0xd58e('0xb'):zoho[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case'desk':desk[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case _0xd58e('0xd'):vtiger[_0x3d7def](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b);break;case'freshsales':freshsales['cs'](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b,_0x3d7def);break;case'servicenow':servicenow['cs'](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b,_0x3d7def);break;case'dynamics365':dynamics365['cs'](_0x3d07ba,_0x7e43cd,_0x44ff32,_0x1702a,_0x228cbf,_0x2fa798,_0x329f5b,_0x3d7def);break;default:console[_0xd58e('0x18')]('unknown\x20integration');}}else{_0x2eac38=require(_0xd58e('0x1c'))(_0x3d07ba['data1']['toLowerCase']());_0x2eac38[_0xd58e('0x1d')]('[EXEC]',util[_0xd58e('0x1e')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3d07ba[_0xd58e('0x10')][_0xd58e('0x11')](),_0x3d07ba[_0xd58e('0x1f')]));}}else{_0x2eac38=require(_0xd58e('0x1c'))(_0x3d07ba[_0xd58e('0x10')][_0xd58e('0x11')]());_0x2eac38['error'](_0xd58e('0x20'),util[_0xd58e('0x1e')](_0xd58e('0x21'),_0x3d07ba['data1'][_0xd58e('0x11')](),_0x3d07ba[_0xd58e('0x12')]));}}else{}}catch(_0x135db2){console[_0xd58e('0x1d')](_0x135db2);}}}}; \ 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 500d0e0..e5d749e 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 _0xa91b=['[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','forEach','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','queue','stripTrailingSlash','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','outbound'];(function(_0x25a968,_0x299c00){var _0x1659e3=function(_0x5975c9){while(--_0x5975c9){_0x25a968['push'](_0x25a968['shift']());}};_0x1659e3(++_0x299c00);}(_0xa91b,0x89));var _0xba91=function(_0xf59452,_0xe960df){_0xf59452=_0xf59452-0x0;var _0x3ce854=_0xa91b[_0xf59452];return _0x3ce854;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xba91('0x0'));var BPromise=require(_0xba91('0x1'));var md5=require(_0xba91('0x2'));var jsforce=require(_0xba91('0x3'));var util=require('util');var Redis=require(_0xba91('0x4'));var intUtil=require('./util');var config=require(_0xba91('0x5'));var logger=require(_0xba91('0x6'))(_0xba91('0x7'));config[_0xba91('0x8')]=_[_0xba91('0x9')](config[_0xba91('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xba91('0xa'))(new Redis(config[_0xba91('0x8')]));function emit(_0x2cae3c,_0x3f5151,_0x1fe4be){io['to'](_0x2cae3c)['emit'](_0x3f5151,_0x1fe4be);}function getTicket(_0x3c823e,_0x3031a5,_0x3f405a,_0x3d7754,_0x11becb,_0x27d91a,_0x2f275d,_0x20e2f7){var _0x276ae1=Object['assign']({},{'OwnerId':_0x3031a5['id'],'Subject':intUtil['getString'](_0x3d7754[_0xba91('0xb')],_0x11becb,'\x20'),'Description':intUtil[_0xba91('0xc')](_0x3d7754[_0xba91('0xd')],_0x11becb,'\x0a')},getCustomFields(_0x27d91a,_0x11becb));if(_0x3f405a){if(_0x3d7754[_0xba91('0xe')]===_0xba91('0xf')){_0x276ae1[_0xba91('0x10')]=moment[_0xba91('0x11')]();_0x276ae1[_0xba91('0x12')]=![];_0x276ae1[_0xba91('0x13')]=![];if(_0x3f405a[_0xba91('0x14')]===_0xba91('0x15')||_0x3f405a[_0xba91('0x14')]==='lead'){_0x276ae1[_0xba91('0x16')]=_0x3f405a['id'];}else if(_0x3f405a[_0xba91('0x14')]===_0xba91('0x17')){_0x276ae1[_0xba91('0x18')]=_0x3f405a['id'];}}else if(_0x3d7754[_0xba91('0xe')]===_0xba91('0x19')){if(_0x3f405a[_0xba91('0x14')]===_0xba91('0x15')){_0x276ae1[_0xba91('0x1a')]=_0x3f405a['id'];}else if(_0x3f405a[_0xba91('0x14')]===_0xba91('0x17')){_0x276ae1['AccountId']=_0x3f405a['id'];}else if(_0x3f405a[_0xba91('0x14')]===_0xba91('0x1b')&&_0x3d7754[_0xba91('0x1c')]){_0x276ae1[_0x3d7754[_0xba91('0x1c')]]=_0x3f405a['id'];}else{logger[_0xba91('0x1d')](_0xba91('0x1e'));}}}return _0x2f275d[_0xba91('0x1f')](_0x3d7754[_0xba91('0xe')])[_0xba91('0x20')](_0x276ae1);}function getUser(_0x421da9,_0x5e3dd0,_0x377bdc){if(!_[_0xba91('0x21')](_0x5e3dd0)&&intUtil[_0xba91('0x22')](_0x5e3dd0)){var _0x21e649={'Email':_0x5e3dd0};var _0x2de7e7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x377bdc[_0xba91('0x1f')]('User')[_0xba91('0x23')](_0x21e649,_0x2de7e7)[_0xba91('0x24')]()[_0xba91('0x25')](function(_0x338c9c){if(_0x338c9c[_0xba91('0x26')]){var _0x446100=_[_0xba91('0x23')](_0x338c9c,function(_0x2f2c09){return _0x2f2c09['Email']===_0x5e3dd0;});if(_0x446100){logger['info'](_0xba91('0x27'),_0x5e3dd0);return BPromise[_0xba91('0x28')]({'id':_0x446100['Id'],'name':_0x446100[_0xba91('0x29')]});}}else{logger[_0xba91('0x1d')](_0xba91('0x2a'),_0x5e3dd0);return _0x377bdc[_0xba91('0x2b')]()['then'](function(_0x2084f1){return BPromise[_0xba91('0x28')]({'id':_0x2084f1['user_id'],'name':_0x2084f1[_0xba91('0x2c')]});});}});}else{logger[_0xba91('0x1d')](_0xba91('0x2a'),_0x5e3dd0);return _0x377bdc['identity']()[_0xba91('0x25')](function(_0x13d4e5){return BPromise[_0xba91('0x28')]({'id':_0x13d4e5[_0xba91('0x2d')],'name':_0x13d4e5[_0xba91('0x2c')]});});}}function getEndUser(_0xe7d245,_0xd5604e,_0x45f620,_0x4c5d03,_0x1ad714){var _0x2b74ee={'$or':{'Phone':_0x4c5d03}};var _0x159331={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xba91('0x28')]()[_0xba91('0x25')](function(){logger[_0xba91('0x1d')](_0xba91('0x2e'),_0x4c5d03,_0xd5604e['moduleSearch']);switch(_0xd5604e[_0xba91('0x2f')]){case'contact_lead':var _0x26fa19=_[_0xba91('0x30')](_0x2b74ee);if(_0xd5604e[_0xba91('0x31')]){var _0x18a46e={};_0x18a46e[_0xd5604e[_0xba91('0x31')]]=_0x4c5d03;_[_0xba91('0x32')](_0x26fa19[_0xba91('0x33')],_0x18a46e);}return _0x1ad714['sobject'](_0xba91('0x34'))[_0xba91('0x23')](_0x26fa19,_0x159331)[_0xba91('0x24')]()[_0xba91('0x25')](function(_0x409f38){if(_0x409f38&&_0x409f38[_0xba91('0x26')]){return _0x409f38;}else{var _0x1a491d=_[_0xba91('0x30')](_0x2b74ee);if(_0xd5604e['additionalSearchLead']){var _0x2429e9={};_0x2429e9[_0xd5604e[_0xba91('0x35')]]=_0x4c5d03;_[_0xba91('0x32')](_0x1a491d[_0xba91('0x33')],_0x2429e9);}return _0x1ad714[_0xba91('0x1f')](_0xba91('0x36'))['find'](_0x1a491d,_0x159331);}});case _0xba91('0x37'):var _0x2fb8db=_[_0xba91('0x30')](_0x2b74ee);if(_0xd5604e[_0xba91('0x38')]){var _0x18a46e={};_0x18a46e[_0xd5604e[_0xba91('0x38')]]=_0x4c5d03;_[_0xba91('0x32')](_0x2fb8db[_0xba91('0x33')],_0x18a46e);}return _0x1ad714[_0xba91('0x1f')]('Account')[_0xba91('0x23')](_0x2fb8db,_0x159331)[_0xba91('0x24')]()[_0xba91('0x25')](function(_0x3b1005){if(_0x3b1005&&_0x3b1005[_0xba91('0x26')]){return _0x3b1005;}else{var _0x59ab47=_['cloneDeep'](_0x2b74ee);if(_0xd5604e[_0xba91('0x31')]){var _0x3009cd={};_0x3009cd[_0xd5604e[_0xba91('0x31')]]=_0x4c5d03;_['merge'](_0x59ab47[_0xba91('0x33')],_0x3009cd);}return _0x1ad714['sobject'](_0xba91('0x34'))[_0xba91('0x23')](_0x59ab47,_0x159331)['then'](function(_0x27746b){if(_0x27746b&&_0x27746b['length']){return _0x27746b;}else{var _0x2b0fa9=_[_0xba91('0x30')](_0x2b74ee);if(_0xd5604e[_0xba91('0x35')]){var _0x47591a={};_0x47591a[_0xd5604e['additionalSearchLead']]=_0x4c5d03;_['merge'](_0x2b0fa9[_0xba91('0x33')],_0x47591a);}return _0x1ad714['sobject'](_0xba91('0x36'))[_0xba91('0x23')](_0x2b0fa9,_0x159331);}});}});case _0xba91('0x15'):var _0x26fa19=_[_0xba91('0x30')](_0x2b74ee);if(_0xd5604e[_0xba91('0x31')]){var _0x18a46e={};_0x18a46e[_0xd5604e[_0xba91('0x31')]]=_0x4c5d03;_[_0xba91('0x32')](_0x26fa19[_0xba91('0x33')],_0x18a46e);}return _0x1ad714[_0xba91('0x1f')]('Contact')['find'](_0x26fa19,_0x159331)[_0xba91('0x24')]();case _0xba91('0x1b'):var _0x17980b=_['cloneDeep'](_0x2b74ee);if(_0xd5604e[_0xba91('0x35')]){var _0x18a46e={};_0x18a46e[_0xd5604e[_0xba91('0x35')]]=_0x4c5d03;_[_0xba91('0x32')](_0x17980b[_0xba91('0x33')],_0x18a46e);}return _0x1ad714['sobject'](_0xba91('0x36'))[_0xba91('0x23')](_0x17980b,_0x159331);case _0xba91('0x17'):var _0x2fb8db=_['cloneDeep'](_0x2b74ee);if(_0xd5604e[_0xba91('0x38')]){var _0x18a46e={};_0x18a46e[_0xd5604e[_0xba91('0x38')]]=_0x4c5d03;_[_0xba91('0x32')](_0x2fb8db[_0xba91('0x33')],_0x18a46e);}return _0x1ad714['sobject'](_0xba91('0x39'))[_0xba91('0x23')](_0x2fb8db,_0x159331);default:return null;}})['then'](function(_0x3ece9b){if(_0x3ece9b&&_0x3ece9b[_0xba91('0x26')]){var _0x473155=_[_0xba91('0x3a')](_0x3ece9b);if(_0x473155){return BPromise[_0xba91('0x28')]({'id':_0x473155['Id'],'name':_0x473155['Name'],'phone':_0x473155[_0xba91('0x3b')],'endUserType':_0x473155[_0xba91('0x3c')][_0xba91('0x3d')][_0xba91('0x3e')]()});}}})[_0xba91('0x25')](function(_0x477ef7){if(_0x477ef7){logger[_0xba91('0x1d')](_0xba91('0x3f'),_0x477ef7[_0xba91('0x14')],_0x4c5d03);return BPromise[_0xba91('0x28')](_0x477ef7);}else{logger['info'](_0xba91('0x40'),_0x4c5d03);var _0x3aac88={'Phone':_0x4c5d03};if(_0xd5604e['moduleCreate']){if(_0xd5604e[_0xba91('0x41')]===_0xba91('0x15')){logger[_0xba91('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4c5d03,_0xd5604e[_0xba91('0x41')]);_0x3aac88[_0xba91('0x42')]=_0x45f620!==''?_0x45f620:util[_0xba91('0x43')](_0xba91('0x44'),_0x4c5d03);}else if(_0xd5604e['moduleCreate']===_0xba91('0x1b')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4c5d03,_0xd5604e[_0xba91('0x41')]);_0x3aac88[_0xba91('0x42')]=_0x45f620!==_0xba91('0x45')?_0x45f620:util[_0xba91('0x43')](_0xba91('0x44'),_0x4c5d03);_0x3aac88[_0xba91('0x46')]=_0xba91('0x47');}else if(_0xd5604e[_0xba91('0x41')]===_0xba91('0x17')){logger[_0xba91('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4c5d03,_0xd5604e['moduleCreate']);_0x3aac88[_0xba91('0x29')]=_0x45f620!==''?_0x45f620:util['format'](_0xba91('0x44'),_0x4c5d03);}else{return null;}}return _0x1ad714[_0xba91('0x1f')](_['upperFirst'](_0xd5604e[_0xba91('0x41')]))[_0xba91('0x20')](_0x3aac88)[_0xba91('0x25')](function(_0x532509){return BPromise[_0xba91('0x28')]({'id':_0x532509['id'],'endUserType':_0xd5604e[_0xba91('0x41')]});});}});}function getCustomFields(_0x3fd457,_0x2846dd){var _0x519e23={};if(_0x3fd457[_0xba91('0x26')]>0x0){_[_0xba91('0x48')](_0x3fd457,function(_0x5dc197){if(_['includes']([_0xba91('0x49'),_0xba91('0x4a')],_0x5dc197['type'])&&_0x5dc197[_0xba91('0x4b')]){_0x519e23[_0x5dc197[_0xba91('0x4b')]]=_0x5dc197[_0xba91('0x4c')]['toString']();}else if(_0x5dc197[_0xba91('0x3d')]===_0xba91('0x4d')&&_0x5dc197[_0xba91('0x4e')]&&_0x5dc197[_0xba91('0x4b')]){_0x2846dd[_0x5dc197['variableName']]&&(_0x519e23[_0x5dc197['idField']]=_0x2846dd[_0x5dc197['variableName']][_0xba91('0x4f')]());}else if(_0x5dc197[_0xba91('0x3d')]===_0xba91('0x50')&&_0x5dc197[_0xba91('0x51')]&&_0x5dc197[_0xba91('0x51')][_0xba91('0x52')]&&_0x5dc197[_0xba91('0x4b')]){_0x2846dd[_0x5dc197[_0xba91('0x51')][_0xba91('0x52')][_0xba91('0x3e')]()]&&(_0x519e23[_0x5dc197[_0xba91('0x4b')]]=_0x2846dd[_0x5dc197[_0xba91('0x51')][_0xba91('0x52')][_0xba91('0x3e')]()][_0xba91('0x4f')]());}});}return _0x519e23;}function getConnection(_0x3ad97a){var _0xbd5397=_0x3ad97a['password'][_0xba91('0x53')](_0x3ad97a[_0xba91('0x54')]);var _0x3bf6ac=new jsforce[(_0xba91('0x55'))]({'oauth2':{'loginUrl':_0x3ad97a['remoteUri']||_0xba91('0x56'),'clientId':_0x3ad97a[_0xba91('0x57')],'clientSecret':_0x3ad97a[_0xba91('0x58')]}});return _0x3bf6ac[_0xba91('0x59')](_0x3ad97a['username'],_0xbd5397)[_0xba91('0x25')](function(){logger[_0xba91('0x1d')]('Connection\x20established.');return _0x3bf6ac;});}exports[_0xba91('0x5a')]=function(_0x42e759,_0x6d88a8,_0x26c6ce,_0x3cd41e,_0x9c9c16,_0x2da6a3){var _0x549762,_0x3e5b0a,_0x55b73d,_0x38677f;_0x2da6a3['serverUrl']=intUtil[_0xba91('0x5b')](_0x2da6a3[_0xba91('0x5c')]);_0x2da6a3['remoteUri']=intUtil['stripTrailingSlash'](_0x2da6a3[_0xba91('0x5d')]);if(_0x9c9c16&&_0x9c9c16[_0xba91('0x5e')]){logger[_0xba91('0x1d')](_0xba91('0x5f'),_0xba91('0x60'));_0x6d88a8[_0xba91('0x61')]=util['format'](_0xba91('0x62'),_0x2da6a3[_0xba91('0x5c')],_0x6d88a8['uniqueid'],md5(_0x6d88a8[_0xba91('0x63')]));}else{_0x6d88a8[_0xba91('0x61')]='';}return getConnection(_0x2da6a3)[_0xba91('0x25')](function(_0xda3392){_0x38677f=_0xda3392;return getUser(_0x2da6a3,_0x3cd41e['email'],_0x38677f);})[_0xba91('0x25')](function(_0x49c113){_0x549762=_0x49c113;return getEndUser(_0x2da6a3,_0x26c6ce,_0x6d88a8[_0xba91('0x64')],_0x6d88a8['calleridnum'],_0x38677f);})[_0xba91('0x25')](function(_0x21bd44){_0x3e5b0a=_0x21bd44;return getTicket(_0x2da6a3,_0x549762,_0x3e5b0a,_0x26c6ce,_0x6d88a8,_0x26c6ce['Fields'],_0x38677f,_0xba91('0x5a'));})[_0xba91('0x25')](function(_0x28ab63){_0x55b73d=_0x28ab63;logger['info'](_0xba91('0x65'),_0x55b73d['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x55b73d['id'],_0x3cd41e[_0xba91('0x52')],_0x2da6a3[_0xba91('0x3d')]);switch(_0x2da6a3[_0xba91('0x3d')]){case _0xba91('0x66'):emit(util[_0xba91('0x43')]('user:%s',_0x3cd41e['name']),_0xba91('0x67'),{'recordId':_0x55b73d['id']});break;case _0xba91('0x68'):emit(util[_0xba91('0x43')]('user:%s',_0x3cd41e['name']),_0xba91('0x69'),{'uri':util[_0xba91('0x43')]('%s/%s/e',_0x38677f[_0xba91('0x6a')],_0x55b73d['id'])});break;default:logger[_0xba91('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x57298b){logger[_0xba91('0x6b')](_0xba91('0x5f'),_0x57298b);});};exports['outbound']=function(_0x40f276,_0x1ae424,_0x3931fc,_0xf2bb,_0x203525,_0x5df333,_0x4dfba8){var _0x132850,_0x41734c,_0xea3168,_0x20a00c;_0x5df333[_0xba91('0x5c')]=intUtil[_0xba91('0x5b')](_0x5df333[_0xba91('0x5c')]);_0x5df333['remoteUri']=intUtil['stripTrailingSlash'](_0x5df333[_0xba91('0x5d')]);if(_0x4dfba8&&_0x4dfba8[_0xba91('0x6c')]&&_0x4dfba8['recordingFormat']!=='none'){logger[_0xba91('0x1d')](_0xba91('0x6d'),_0xba91('0x60'));_0x1ae424['recordingURL']=util[_0xba91('0x43')](_0xba91('0x62'),_0x5df333['serverUrl'],_0x1ae424[_0xba91('0x63')],md5(_0x1ae424[_0xba91('0x63')]));}return getConnection(_0x5df333)[_0xba91('0x25')](function(_0x2f83cc){_0x20a00c=_0x2f83cc;return getUser(_0x5df333,_0xf2bb[_0xba91('0x6e')],_0x20a00c);})[_0xba91('0x25')](function(_0x22e570){_0x132850=_0x22e570;return getEndUser(_0x5df333,_0x3931fc,_0x1ae424[_0xba91('0x6f')],_0x1ae424[_0xba91('0x70')],_0x20a00c);})[_0xba91('0x25')](function(_0xbe5c){_0x41734c=_0xbe5c;return getTicket(_0x5df333,_0x132850,_0x41734c,_0x3931fc,_0x1ae424,_0x3931fc[_0xba91('0x71')],_0x20a00c,_0xba91('0x72'));})[_0xba91('0x25')](function(_0x3bc2f7){_0xea3168=_0x3bc2f7;logger[_0xba91('0x1d')](_0xba91('0x73'),_0xea3168['id']);logger['info'](_0xba91('0x74'),_0xea3168['id'],_0xf2bb[_0xba91('0x52')],_0x5df333[_0xba91('0x3d')]);switch(_0x5df333[_0xba91('0x3d')]){case _0xba91('0x66'):emit(util[_0xba91('0x43')](_0xba91('0x75'),_0xf2bb['name']),_0xba91('0x67'),{'recordId':_0xea3168['id']});break;case'newTab':emit(util[_0xba91('0x43')](_0xba91('0x75'),_0xf2bb[_0xba91('0x52')]),_0xba91('0x69'),{'uri':util[_0xba91('0x43')](_0xba91('0x76'),_0x20a00c['instanceUrl'],_0xea3168['id'])});break;default:logger[_0xba91('0x6b')](_0xba91('0x6d'),_0xba91('0x77'));}})[_0xba91('0x78')](function(_0x58ef8a){logger[_0xba91('0x6b')](_0xba91('0x6d'),_0x58ef8a);});};exports[_0xba91('0x79')]=function(_0x375c09,_0x1da82f,_0x4972be,_0x500b30,_0x1433bc,_0x1a9c27){var _0x3aff36,_0x12e8db,_0x653fd5,_0x1273b7;_0x1a9c27[_0xba91('0x5c')]=intUtil['stripTrailingSlash'](_0x1a9c27[_0xba91('0x5c')]);_0x1a9c27[_0xba91('0x5d')]=intUtil[_0xba91('0x5b')](_0x1a9c27[_0xba91('0x5d')]);if(_0x1433bc&&_0x1433bc[_0xba91('0x5e')]){logger[_0xba91('0x1d')]('['+_0x1da82f[_0xba91('0x7a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1da82f['recordingURL']=util['format'](_0xba91('0x62'),_0x1a9c27[_0xba91('0x5c')],_0x1da82f['uniqueid'],md5(_0x1da82f[_0xba91('0x63')]));}else{_0x1da82f[_0xba91('0x61')]='';}return getConnection(_0x1a9c27)['then'](function(_0x5b74da){_0x1273b7=_0x5b74da;if(!_[_0xba91('0x21')](_0x500b30)){return getUser(_0x1a9c27,_0x500b30[_0xba91('0x52')],_0x1273b7);}else{return getUser(_0x1a9c27,null,_0x1273b7);}})[_0xba91('0x25')](function(_0x54b361){_0x3aff36=_0x54b361;return getEndUser(_0x1a9c27,_0x4972be,_0x1da82f[_0xba91('0x64')],_0x1da82f['calleridnum'],_0x1273b7);})[_0xba91('0x25')](function(_0x22937a){_0x12e8db=_0x22937a;return getTicket(_0x1a9c27,_0x3aff36,_0x12e8db,_0x4972be,_0x1da82f,_0x4972be[_0xba91('0x71')],_0x1273b7);})[_0xba91('0x25')](function(_0x43b579){_0x653fd5=_0x43b579;logger[_0xba91('0x1d')]('['+_0x1da82f['lastevent']['toUpperCase']()+_0xba91('0x7b'),_0x653fd5['id']);logger[_0xba91('0x1d')]('['+_0x1da82f[_0xba91('0x7a')][_0xba91('0x7c')]()+_0xba91('0x7d'),_0x1a9c27[_0xba91('0x3d')]);})[_0xba91('0x78')](function(_0x5cc654){logger['error']('['+_0x1da82f[_0xba91('0x7a')]['toUpperCase']()+']',_0x5cc654);});}; \ No newline at end of file +var _0xe743=['WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','execute','then','length','find','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','additionalSearchAccount','Account','Lead','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','toUpperCase','calleridname','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','localhost','socket.io-emitter','redis','emit','getString','Subjects','Descriptions','ticketType','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account'];(function(_0x24a9dc,_0x36ae48){var _0x540bf6=function(_0x304274){while(--_0x304274){_0x24a9dc['push'](_0x24a9dc['shift']());}};_0x540bf6(++_0x36ae48);}(_0xe743,0x1f2));var _0x3e74=function(_0x5cf874,_0x4cd12b){_0x5cf874=_0x5cf874-0x0;var _0xf7550d=_0xe743[_0x5cf874];return _0xf7550d;};'use strict';var _=require(_0x3e74('0x0'));var rp=require(_0x3e74('0x1'));var moment=require(_0x3e74('0x2'));var BPromise=require(_0x3e74('0x3'));var md5=require('md5');var jsforce=require(_0x3e74('0x4'));var util=require(_0x3e74('0x5'));var Redis=require('ioredis');var intUtil=require(_0x3e74('0x6'));var config=require(_0x3e74('0x7'));var logger=require(_0x3e74('0x8'))(_0x3e74('0x9'));config['redis']=_[_0x3e74('0xa')](config['redis'],{'host':_0x3e74('0xb'),'port':0x18eb});var io=require(_0x3e74('0xc'))(new Redis(config[_0x3e74('0xd')]));function emit(_0x3f1bad,_0x5aea4e,_0x463400){io['to'](_0x3f1bad)[_0x3e74('0xe')](_0x5aea4e,_0x463400);}function getTicket(_0x2112c3,_0x40cf5b,_0x539236,_0x2b9b40,_0x47beeb,_0x18da90,_0x4752c2,_0x1f19b3){var _0x57fcf5=Object['assign']({},{'OwnerId':_0x40cf5b['id'],'Subject':intUtil[_0x3e74('0xf')](_0x2b9b40[_0x3e74('0x10')],_0x47beeb,'\x20'),'Description':intUtil[_0x3e74('0xf')](_0x2b9b40[_0x3e74('0x11')],_0x47beeb,'\x0a')},getCustomFields(_0x18da90,_0x47beeb));if(_0x539236){if(_0x2b9b40[_0x3e74('0x12')]==='Task'){_0x57fcf5['ActivityDate']=moment['utc']();_0x57fcf5[_0x3e74('0x13')]=![];_0x57fcf5[_0x3e74('0x14')]=![];if(_0x539236[_0x3e74('0x15')]===_0x3e74('0x16')||_0x539236['endUserType']===_0x3e74('0x17')){_0x57fcf5[_0x3e74('0x18')]=_0x539236['id'];}else if(_0x539236[_0x3e74('0x15')]===_0x3e74('0x19')){_0x57fcf5[_0x3e74('0x1a')]=_0x539236['id'];}}else if(_0x2b9b40['ticketType']===_0x3e74('0x1b')){if(_0x539236[_0x3e74('0x15')]===_0x3e74('0x16')){_0x57fcf5[_0x3e74('0x1c')]=_0x539236['id'];}else if(_0x539236[_0x3e74('0x15')]===_0x3e74('0x19')){_0x57fcf5[_0x3e74('0x1d')]=_0x539236['id'];}else if(_0x539236[_0x3e74('0x15')]===_0x3e74('0x17')&&_0x2b9b40[_0x3e74('0x1e')]){_0x57fcf5[_0x2b9b40[_0x3e74('0x1e')]]=_0x539236['id'];}else{logger[_0x3e74('0x1f')](_0x3e74('0x20'));}}}return _0x4752c2['sobject'](_0x2b9b40[_0x3e74('0x12')])[_0x3e74('0x21')](_0x57fcf5);}function getUser(_0x44a7e8,_0x3253c9,_0x4f3778){if(!_[_0x3e74('0x22')](_0x3253c9)&&intUtil[_0x3e74('0x23')](_0x3253c9)){var _0x1c1c42={'Email':_0x3253c9};var _0x151133={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4f3778[_0x3e74('0x24')](_0x3e74('0x25'))['find'](_0x1c1c42,_0x151133)[_0x3e74('0x26')]()[_0x3e74('0x27')](function(_0x3a14ef){if(_0x3a14ef[_0x3e74('0x28')]){var _0x5b4fb5=_[_0x3e74('0x29')](_0x3a14ef,function(_0x318c4c){return _0x318c4c['Email']===_0x3253c9;});if(_0x5b4fb5){logger['info'](_0x3e74('0x2a'),_0x3253c9);return BPromise['resolve']({'id':_0x5b4fb5['Id'],'name':_0x5b4fb5[_0x3e74('0x2b')]});}}else{logger[_0x3e74('0x1f')](_0x3e74('0x2c'),_0x3253c9);return _0x4f3778['identity']()[_0x3e74('0x27')](function(_0x552072){return BPromise[_0x3e74('0x2d')]({'id':_0x552072[_0x3e74('0x2e')],'name':_0x552072[_0x3e74('0x2f')]});});}});}else{logger[_0x3e74('0x1f')](_0x3e74('0x2c'),_0x3253c9);return _0x4f3778[_0x3e74('0x30')]()[_0x3e74('0x27')](function(_0x14f682){return BPromise[_0x3e74('0x2d')]({'id':_0x14f682[_0x3e74('0x2e')],'name':_0x14f682[_0x3e74('0x2f')]});});}}function getEndUser(_0x42f951,_0x57afa9,_0x142b83,_0x5f1366,_0x5a34f1){var _0x32385e={'$or':{'Phone':_0x5f1366}};var _0x8ffa98={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3e74('0x2d')]()['then'](function(){logger[_0x3e74('0x1f')](_0x3e74('0x31'),_0x5f1366,_0x57afa9['moduleSearch']);switch(_0x57afa9[_0x3e74('0x32')]){case _0x3e74('0x33'):var _0x29bf00=_[_0x3e74('0x34')](_0x32385e);if(_0x57afa9['additionalSearchContact']){var _0x1d4b8={};_0x1d4b8[_0x57afa9[_0x3e74('0x35')]]=_0x5f1366;_['merge'](_0x29bf00[_0x3e74('0x36')],_0x1d4b8);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x37'))[_0x3e74('0x29')](_0x29bf00,_0x8ffa98)[_0x3e74('0x26')]()[_0x3e74('0x27')](function(_0x1704d6){if(_0x1704d6&&_0x1704d6[_0x3e74('0x28')]){return _0x1704d6;}else{var _0x6b7679=_[_0x3e74('0x34')](_0x32385e);if(_0x57afa9[_0x3e74('0x38')]){var _0x592fb2={};_0x592fb2[_0x57afa9[_0x3e74('0x38')]]=_0x5f1366;_[_0x3e74('0x39')](_0x6b7679[_0x3e74('0x36')],_0x592fb2);}return _0x5a34f1[_0x3e74('0x24')]('Lead')[_0x3e74('0x29')](_0x6b7679,_0x8ffa98);}});case'account_contact_lead':var _0x4fd3ef=_[_0x3e74('0x34')](_0x32385e);if(_0x57afa9['additionalSearchAccount']){var _0x1d4b8={};_0x1d4b8[_0x57afa9[_0x3e74('0x3a')]]=_0x5f1366;_[_0x3e74('0x39')](_0x4fd3ef[_0x3e74('0x36')],_0x1d4b8);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x3b'))[_0x3e74('0x29')](_0x4fd3ef,_0x8ffa98)['execute']()[_0x3e74('0x27')](function(_0x4ff4e0){if(_0x4ff4e0&&_0x4ff4e0[_0x3e74('0x28')]){return _0x4ff4e0;}else{var _0x24213a=_['cloneDeep'](_0x32385e);if(_0x57afa9[_0x3e74('0x35')]){var _0x11bc5d={};_0x11bc5d[_0x57afa9[_0x3e74('0x35')]]=_0x5f1366;_['merge'](_0x24213a[_0x3e74('0x36')],_0x11bc5d);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x37'))[_0x3e74('0x29')](_0x24213a,_0x8ffa98)[_0x3e74('0x27')](function(_0x1ac9b9){if(_0x1ac9b9&&_0x1ac9b9[_0x3e74('0x28')]){return _0x1ac9b9;}else{var _0x56503a=_['cloneDeep'](_0x32385e);if(_0x57afa9[_0x3e74('0x38')]){var _0x191efe={};_0x191efe[_0x57afa9[_0x3e74('0x38')]]=_0x5f1366;_[_0x3e74('0x39')](_0x56503a['$or'],_0x191efe);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x3c'))['find'](_0x56503a,_0x8ffa98);}});}});case _0x3e74('0x16'):var _0x29bf00=_[_0x3e74('0x34')](_0x32385e);if(_0x57afa9[_0x3e74('0x35')]){var _0x1d4b8={};_0x1d4b8[_0x57afa9[_0x3e74('0x35')]]=_0x5f1366;_[_0x3e74('0x39')](_0x29bf00[_0x3e74('0x36')],_0x1d4b8);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x37'))[_0x3e74('0x29')](_0x29bf00,_0x8ffa98)[_0x3e74('0x26')]();case _0x3e74('0x17'):var _0x1d2853=_[_0x3e74('0x34')](_0x32385e);if(_0x57afa9[_0x3e74('0x38')]){var _0x1d4b8={};_0x1d4b8[_0x57afa9[_0x3e74('0x38')]]=_0x5f1366;_[_0x3e74('0x39')](_0x1d2853['$or'],_0x1d4b8);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x3c'))[_0x3e74('0x29')](_0x1d2853,_0x8ffa98);case _0x3e74('0x19'):var _0x4fd3ef=_['cloneDeep'](_0x32385e);if(_0x57afa9['additionalSearchAccount']){var _0x1d4b8={};_0x1d4b8[_0x57afa9[_0x3e74('0x3a')]]=_0x5f1366;_[_0x3e74('0x39')](_0x4fd3ef[_0x3e74('0x36')],_0x1d4b8);}return _0x5a34f1[_0x3e74('0x24')](_0x3e74('0x3b'))[_0x3e74('0x29')](_0x4fd3ef,_0x8ffa98);default:return null;}})[_0x3e74('0x27')](function(_0x4fe3f4){if(_0x4fe3f4&&_0x4fe3f4[_0x3e74('0x28')]){var _0x3e59ae=_[_0x3e74('0x3d')](_0x4fe3f4);if(_0x3e59ae){return BPromise['resolve']({'id':_0x3e59ae['Id'],'name':_0x3e59ae[_0x3e74('0x2b')],'phone':_0x3e59ae[_0x3e74('0x3e')],'endUserType':_0x3e59ae[_0x3e74('0x3f')][_0x3e74('0x40')][_0x3e74('0x41')]()});}}})['then'](function(_0x5d8f84){if(_0x5d8f84){logger[_0x3e74('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5d8f84[_0x3e74('0x15')],_0x5f1366);return BPromise[_0x3e74('0x2d')](_0x5d8f84);}else{logger[_0x3e74('0x1f')](_0x3e74('0x42'),_0x5f1366);var _0xf40ec9={'Phone':_0x5f1366};if(_0x57afa9['moduleCreate']){if(_0x57afa9[_0x3e74('0x43')]==='contact'){logger[_0x3e74('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5f1366,_0x57afa9['moduleCreate']);_0xf40ec9['LastName']=_0x142b83!==''?_0x142b83:util[_0x3e74('0x44')](_0x3e74('0x45'),_0x5f1366);}else if(_0x57afa9[_0x3e74('0x43')]===_0x3e74('0x17')){logger['info'](_0x3e74('0x46'),_0x5f1366,_0x57afa9['moduleCreate']);_0xf40ec9[_0x3e74('0x47')]=_0x142b83!==''?_0x142b83:util[_0x3e74('0x44')](_0x3e74('0x45'),_0x5f1366);_0xf40ec9[_0x3e74('0x48')]=_0x3e74('0x49');}else if(_0x57afa9['moduleCreate']===_0x3e74('0x19')){logger[_0x3e74('0x1f')](_0x3e74('0x46'),_0x5f1366,_0x57afa9['moduleCreate']);_0xf40ec9[_0x3e74('0x2b')]=_0x142b83!==''?_0x142b83:util[_0x3e74('0x44')](_0x3e74('0x45'),_0x5f1366);}else{return null;}}return _0x5a34f1[_0x3e74('0x24')](_[_0x3e74('0x4a')](_0x57afa9[_0x3e74('0x43')]))[_0x3e74('0x21')](_0xf40ec9)[_0x3e74('0x27')](function(_0x28abdd){return BPromise[_0x3e74('0x2d')]({'id':_0x28abdd['id'],'endUserType':_0x57afa9['moduleCreate']});});}});}function getCustomFields(_0x18f327,_0x252263){var _0x406407={};if(_0x18f327[_0x3e74('0x28')]>0x0){_[_0x3e74('0x4b')](_0x18f327,function(_0x34c9f8){if(_['includes']([_0x3e74('0x4c'),_0x3e74('0x4d')],_0x34c9f8[_0x3e74('0x40')])&&_0x34c9f8['idField']){_0x406407[_0x34c9f8[_0x3e74('0x4e')]]=_0x34c9f8[_0x3e74('0x4f')][_0x3e74('0x50')]();}else if(_0x34c9f8[_0x3e74('0x40')]==='variable'&&_0x34c9f8[_0x3e74('0x51')]&&_0x34c9f8[_0x3e74('0x4e')]){_0x252263[_0x34c9f8[_0x3e74('0x51')]]&&(_0x406407[_0x34c9f8['idField']]=_0x252263[_0x34c9f8[_0x3e74('0x51')]][_0x3e74('0x50')]());}else if(_0x34c9f8['type']===_0x3e74('0x52')&&_0x34c9f8[_0x3e74('0x53')]&&_0x34c9f8['Variable'][_0x3e74('0x54')]&&_0x34c9f8[_0x3e74('0x4e')]){_0x252263[_0x34c9f8[_0x3e74('0x53')]['name']['toLowerCase']()]&&(_0x406407[_0x34c9f8['idField']]=_0x252263[_0x34c9f8['Variable'][_0x3e74('0x54')]['toLowerCase']()][_0x3e74('0x50')]());}});}return _0x406407;}function getConnection(_0x453b5b){var _0x2e606d=_0x453b5b[_0x3e74('0x55')][_0x3e74('0x56')](_0x453b5b[_0x3e74('0x57')]);var _0x388be3=new jsforce[(_0x3e74('0x58'))]({'oauth2':{'loginUrl':_0x453b5b[_0x3e74('0x59')]||_0x3e74('0x5a'),'clientId':_0x453b5b[_0x3e74('0x5b')],'clientSecret':_0x453b5b[_0x3e74('0x5c')]}});return _0x388be3['login'](_0x453b5b[_0x3e74('0x5d')],_0x2e606d)[_0x3e74('0x27')](function(){logger['info'](_0x3e74('0x5e'));return _0x388be3;});}exports['queue']=function(_0xaf65b8,_0x17c7cb,_0x3c5b26,_0xe6b416,_0x21f8a6,_0x301d88){var _0x2ac999,_0x50d451,_0x4d6e4a,_0x41c3a7;_0x301d88[_0x3e74('0x5f')]=intUtil['stripTrailingSlash'](_0x301d88[_0x3e74('0x5f')]);_0x301d88[_0x3e74('0x59')]=intUtil[_0x3e74('0x60')](_0x301d88[_0x3e74('0x59')]);if(_0x21f8a6&&_0x21f8a6[_0x3e74('0x61')]){logger[_0x3e74('0x1f')](_0x3e74('0x62'),_0x3e74('0x63'));_0x17c7cb[_0x3e74('0x64')]=util[_0x3e74('0x44')](_0x3e74('0x65'),_0x301d88[_0x3e74('0x5f')],_0x17c7cb[_0x3e74('0x66')],md5(_0x17c7cb[_0x3e74('0x66')]));}else{_0x17c7cb[_0x3e74('0x64')]='';}return getConnection(_0x301d88)[_0x3e74('0x27')](function(_0x40cd5c){_0x41c3a7=_0x40cd5c;return getUser(_0x301d88,_0xe6b416[_0x3e74('0x67')],_0x41c3a7);})['then'](function(_0x2eefba){_0x2ac999=_0x2eefba;return getEndUser(_0x301d88,_0x3c5b26,_0x17c7cb['calleridname'],_0x17c7cb[_0x3e74('0x68')],_0x41c3a7);})[_0x3e74('0x27')](function(_0x6f4e52){_0x50d451=_0x6f4e52;return getTicket(_0x301d88,_0x2ac999,_0x50d451,_0x3c5b26,_0x17c7cb,_0x3c5b26[_0x3e74('0x69')],_0x41c3a7,'queue');})['then'](function(_0x2bdf55){_0x4d6e4a=_0x2bdf55;logger[_0x3e74('0x1f')](_0x3e74('0x6a'),_0x4d6e4a['id']);logger[_0x3e74('0x1f')](_0x3e74('0x6b'),_0x4d6e4a['id'],_0xe6b416[_0x3e74('0x54')],_0x301d88['type']);switch(_0x301d88['type']){case _0x3e74('0x6c'):emit(util['format'](_0x3e74('0x6d'),_0xe6b416[_0x3e74('0x54')]),_0x3e74('0x6e'),{'recordId':_0x4d6e4a['id']});break;case _0x3e74('0x6f'):emit(util[_0x3e74('0x44')](_0x3e74('0x6d'),_0xe6b416['name']),_0x3e74('0x70'),{'uri':util[_0x3e74('0x44')](_0x3e74('0x71'),_0x41c3a7[_0x3e74('0x72')],_0x4d6e4a['id'])});break;default:logger[_0x3e74('0x73')](_0x3e74('0x74'));}})['catch'](function(_0x23e525){logger[_0x3e74('0x73')](_0x3e74('0x62'),_0x23e525);});};exports['outbound']=function(_0x49c9be,_0x25dc66,_0x1e5646,_0x264d8f,_0x2aeaa6,_0x261bdb,_0x368f3e){var _0xc6be6b,_0x353081,_0x22d04b,_0x4a23d7;_0x261bdb['serverUrl']=intUtil[_0x3e74('0x60')](_0x261bdb[_0x3e74('0x5f')]);_0x261bdb[_0x3e74('0x59')]=intUtil[_0x3e74('0x60')](_0x261bdb['remoteUri']);if(_0x368f3e&&_0x368f3e[_0x3e74('0x75')]&&_0x368f3e[_0x3e74('0x75')]!==_0x3e74('0x76')){logger[_0x3e74('0x1f')](_0x3e74('0x77'),'Recording\x20is\x20enabled!');_0x25dc66[_0x3e74('0x64')]=util[_0x3e74('0x44')](_0x3e74('0x65'),_0x261bdb[_0x3e74('0x5f')],_0x25dc66[_0x3e74('0x66')],md5(_0x25dc66[_0x3e74('0x66')]));}return getConnection(_0x261bdb)[_0x3e74('0x27')](function(_0x436586){_0x4a23d7=_0x436586;return getUser(_0x261bdb,_0x264d8f[_0x3e74('0x67')],_0x4a23d7);})[_0x3e74('0x27')](function(_0x1b5036){_0xc6be6b=_0x1b5036;return getEndUser(_0x261bdb,_0x1e5646,_0x25dc66[_0x3e74('0x78')],_0x25dc66[_0x3e74('0x79')],_0x4a23d7);})[_0x3e74('0x27')](function(_0x3abb5d){_0x353081=_0x3abb5d;return getTicket(_0x261bdb,_0xc6be6b,_0x353081,_0x1e5646,_0x25dc66,_0x1e5646['Fields'],_0x4a23d7,_0x3e74('0x7a'));})[_0x3e74('0x27')](function(_0x41222d){_0x22d04b=_0x41222d;logger[_0x3e74('0x1f')](_0x3e74('0x7b'),_0x22d04b['id']);logger[_0x3e74('0x1f')](_0x3e74('0x7c'),_0x22d04b['id'],_0x264d8f['name'],_0x261bdb[_0x3e74('0x40')]);switch(_0x261bdb['type']){case'integrationTab':emit(util[_0x3e74('0x44')](_0x3e74('0x6d'),_0x264d8f[_0x3e74('0x54')]),_0x3e74('0x6e'),{'recordId':_0x22d04b['id']});break;case'newTab':emit(util['format'](_0x3e74('0x6d'),_0x264d8f[_0x3e74('0x54')]),'trigger:browser:url',{'uri':util[_0x3e74('0x44')]('%s/%s/e',_0x4a23d7['instanceUrl'],_0x22d04b['id'])});break;default:logger[_0x3e74('0x73')]('[OUTBOUND]',_0x3e74('0x7d'));}})[_0x3e74('0x7e')](function(_0x46b1fa){logger[_0x3e74('0x73')](_0x3e74('0x77'),_0x46b1fa);});};exports['unmanaged']=function(_0x23b6f0,_0x585ec3,_0x48ff0d,_0x2579a9,_0x5198c9,_0x10c51d){var _0x2a44c7,_0x91b520,_0x535843,_0x5f20df;_0x10c51d[_0x3e74('0x5f')]=intUtil[_0x3e74('0x60')](_0x10c51d[_0x3e74('0x5f')]);_0x10c51d[_0x3e74('0x59')]=intUtil['stripTrailingSlash'](_0x10c51d[_0x3e74('0x59')]);if(_0x5198c9&&_0x5198c9['monitor_format']){logger[_0x3e74('0x1f')]('['+_0x585ec3['lastevent'][_0x3e74('0x7f')]()+']',_0x3e74('0x63'));_0x585ec3[_0x3e74('0x64')]=util[_0x3e74('0x44')](_0x3e74('0x65'),_0x10c51d[_0x3e74('0x5f')],_0x585ec3[_0x3e74('0x66')],md5(_0x585ec3['uniqueid']));}else{_0x585ec3[_0x3e74('0x64')]='';}return getConnection(_0x10c51d)[_0x3e74('0x27')](function(_0x42df75){_0x5f20df=_0x42df75;if(!_[_0x3e74('0x22')](_0x2579a9)){return getUser(_0x10c51d,_0x2579a9[_0x3e74('0x54')],_0x5f20df);}else{return getUser(_0x10c51d,null,_0x5f20df);}})[_0x3e74('0x27')](function(_0x574753){_0x2a44c7=_0x574753;return getEndUser(_0x10c51d,_0x48ff0d,_0x585ec3[_0x3e74('0x80')],_0x585ec3[_0x3e74('0x68')],_0x5f20df);})[_0x3e74('0x27')](function(_0x3c0dfa){_0x91b520=_0x3c0dfa;return getTicket(_0x10c51d,_0x2a44c7,_0x91b520,_0x48ff0d,_0x585ec3,_0x48ff0d[_0x3e74('0x69')],_0x5f20df);})[_0x3e74('0x27')](function(_0x101804){_0x535843=_0x101804;logger[_0x3e74('0x1f')]('['+_0x585ec3[_0x3e74('0x81')][_0x3e74('0x7f')]()+_0x3e74('0x82'),_0x535843['id']);logger['info']('['+_0x585ec3['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x10c51d['type']);})[_0x3e74('0x7e')](function(_0x57d39d){logger['error']('['+_0x585ec3['lastevent'][_0x3e74('0x7f')]()+']',_0x57d39d);});}; \ 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 4e0a4b8..81a44a6 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 _0x1215=['Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','result','length','toUpperCase','catch','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','sys_id','adminId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminEmail','POST','user','true','endUserNumber','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','customField','nameField','toLowerCase','includes','type','idField','variableName','customVariable','Variable','name','toString',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','ticketId'];(function(_0xc9d65c,_0x23c761){var _0x276559=function(_0xfc26c5){while(--_0xfc26c5){_0xc9d65c['push'](_0xc9d65c['shift']());}};_0x276559(++_0x23c761);}(_0x1215,0xf8));var _0x5121=function(_0xc2d6a7,_0x3857fb){_0xc2d6a7=_0xc2d6a7-0x0;var _0x11f91d=_0x1215[_0xc2d6a7];return _0x11f91d;};'use strict';var _=require('lodash');var Promise=require(_0x5121('0x0'));var rp=require(_0x5121('0x1'));var util=require(_0x5121('0x2'));var md5=require(_0x5121('0x3'));var Redis=require(_0x5121('0x4'));var intUtil=require(_0x5121('0x5'));var config=require(_0x5121('0x6'));var logger=require(_0x5121('0x7'))(_0x5121('0x8'));config[_0x5121('0x9')]=_[_0x5121('0xa')](config[_0x5121('0x9')],{'host':_0x5121('0xb'),'port':0x18eb});var io=require(_0x5121('0xc'))(new Redis(config[_0x5121('0x9')]));function getAdminUser(_0x123733,_0x12ccd4,_0x42e873,_0x5095be,_0x7a372,_0x86da79){return new Promise(function(_0x229abc,_0x1e8591){var _0x10c6f5={'method':_0x5121('0xd'),'uri':_0x5095be+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x7a372+'&'+_0x86da79,'auth':_0x12ccd4,'json':!![]};return rp(_0x10c6f5)['then'](function(_0x1e4c00){if(_0x1e4c00[_0x5121('0xe')][_0x5121('0xf')]>0x0){_0x42e873['adminId']=_0x1e4c00[_0x5121('0xe')][0x0]['sys_id'];}logger['info']('['+[_0x123733[_0x5121('0x10')]()]+'],\x20getAdminUser\x20crm',_0x42e873);_0x229abc(_0x42e873);})[_0x5121('0x11')](function(_0x3fdfed){logger['error']('['+[_0x123733[_0x5121('0x10')]()]+']',_0x3fdfed[_0x5121('0x12')]);_0x1e8591(_0x3fdfed['message']);});});}function getUser(_0x47715,_0x40360d,_0x3279cf,_0x49aa75,_0xf898e8){return function(_0xf2d08f){logger[_0x5121('0x13')]('['+[_0x47715[_0x5121('0x10')]()]+'],\x20getUser\x20input\x20crm',_0xf2d08f);return new Promise(function(_0x21b20f,_0xe2257c){if(intUtil[_0x5121('0x14')](_0xf2d08f[_0x5121('0x15')])){var _0x270a37={'method':'GET','uri':_0x3279cf+_0x5121('0x16')+_0xf2d08f[_0x5121('0x15')]+'&'+_0x49aa75+'&'+_0xf898e8,'auth':_0x40360d,'json':!![]};logger[_0x5121('0x13')]('['+[_0x47715[_0x5121('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x270a37);return rp(_0x270a37)['then'](function(_0x4ad119){logger[_0x5121('0x13')]('['+[_0x47715[_0x5121('0x10')]()]+_0x5121('0x17'),_0x4ad119);if(_0x4ad119[_0x5121('0xe')][_0x5121('0xf')]>0x0&&String(_0x4ad119[_0x5121('0xe')][0x0][_0x5121('0x18')])==='true'){_0xf2d08f[_0x5121('0x19')]=_0x4ad119['result'][0x0][_0x5121('0x1a')];}else{_0xf2d08f[_0x5121('0x19')]=_0xf2d08f[_0x5121('0x1b')];_0xf2d08f[_0x5121('0x15')]=_0xf2d08f['adminEmail'];}logger['info']('['+[_0x47715[_0x5121('0x10')]()]+_0x5121('0x1c'),_0xf2d08f);_0x21b20f(_0xf2d08f);})[_0x5121('0x11')](function(_0x13558a){logger[_0x5121('0x1d')]('['+[_0x47715[_0x5121('0x10')]()]+']',_0x13558a[_0x5121('0x12')]);_0xe2257c(_0x13558a[_0x5121('0x12')]);});}else{logger[_0x5121('0x13')]('['+[_0x47715[_0x5121('0x10')]()]+_0x5121('0x1e'));_0xf2d08f[_0x5121('0x19')]=_0xf2d08f[_0x5121('0x1b')];_0xf2d08f[_0x5121('0x15')]=_0xf2d08f[_0x5121('0x1f')];_0x21b20f(_0xf2d08f);}});};}function createEndUser(_0x244d92,_0x5781cd,_0x26eb07,_0x97f382,_0x5d360a){logger[_0x5121('0x13')]('['+[_0x244d92[_0x5121('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x26eb07);return new Promise(function(_0x137ade,_0x490016){var _0x255773={'method':_0x5121('0x20'),'uri':_0x97f382+'sys_user?'+_0x5d360a,'body':{'user_name':_0x26eb07['endUserNumber'],'roles':_0x5121('0x21'),'first_name':_0x26eb07['endUserNumber'],'active':_0x5121('0x22'),'date_format':'System','phone':_0x26eb07[_0x5121('0x23')]},'auth':_0x5781cd,'json':!![]};return rp(_0x255773)[_0x5121('0x24')](function(_0x7f1672){logger[_0x5121('0x13')]('['+[_0x244d92[_0x5121('0x10')]()]+_0x5121('0x25'),_0x7f1672[_0x5121('0xe')]);_0x26eb07[_0x5121('0x26')]=_0x7f1672['result']['sys_id'];_0x137ade(_0x26eb07);})[_0x5121('0x11')](function(_0x5f552f){logger[_0x5121('0x1d')]('['+[_0x244d92[_0x5121('0x10')]()]+']',_0x5f552f[_0x5121('0x12')]);_0x490016(_0x5f552f[_0x5121('0x12')]);});});}function getEndUser(_0x503672,_0x44a654,_0x17f932,_0x46e127,_0xfe5386){return function(_0x120de5){logger[_0x5121('0x13')]('['+[_0x503672['toUpperCase']()]+_0x5121('0x27'),_0x120de5);return new Promise(function(_0x171e7a,_0xb4610){var _0x47519f={'method':_0x5121('0xd'),'uri':_0x17f932+_0x5121('0x28')+_0x120de5[_0x5121('0x23')]+'&'+_0x46e127+'&'+_0xfe5386,'auth':_0x44a654,'json':!![]};return rp(_0x47519f)[_0x5121('0x24')](function(_0x1e4947){if(_0x1e4947[_0x5121('0xe')][_0x5121('0xf')]>0x0){_0x120de5[_0x5121('0x26')]=_0x1e4947[_0x5121('0xe')][0x0][_0x5121('0x1a')];logger[_0x5121('0x13')]('['+[_0x503672['toUpperCase']()]+_0x5121('0x29'),_0x120de5);_0x171e7a(_0x120de5);}else{return createEndUser(_0x503672,_0x44a654,_0x120de5,_0x17f932,_0x46e127)[_0x5121('0x24')](function(_0x325f0d){logger['info']('['+[_0x503672[_0x5121('0x10')]()]+_0x5121('0x2a'),_0x325f0d);_0x171e7a(_0x325f0d);});}})[_0x5121('0x11')](function(_0x11c4d0){logger[_0x5121('0x1d')]('['+[_0x503672[_0x5121('0x10')]()]+']',_0x11c4d0[_0x5121('0x12')]);_0xb4610(_0x11c4d0[_0x5121('0x12')]);});});};}function getCustomFields(_0x5e01bb,_0x2f502a){var _0x55424a={};if(_0x5e01bb['length']>0x0){_[_0x5121('0x2b')](_0x5e01bb,function(_0x14028a){if(_['includes']([_0x5121('0x2c'),_0x5121('0x2d')],_0x14028a['type'])&&_0x14028a['nameField']&&!_0x14028a[_0x5121('0x2e')]){_0x55424a[_0x14028a[_0x5121('0x2f')][_0x5121('0x30')]()]=_0x14028a['content']['toString']();}else if(_[_0x5121('0x31')]([_0x5121('0x2c'),_0x5121('0x2d')],_0x14028a[_0x5121('0x32')])&&_0x14028a[_0x5121('0x33')]&&_0x14028a['customField']){_0x55424a[_0x14028a[_0x5121('0x33')][_0x5121('0x30')]()]=_0x14028a['content']['toString']();}else if(_0x14028a[_0x5121('0x32')]==='variable'&&_0x14028a[_0x5121('0x34')]&&_0x14028a[_0x5121('0x33')]&&_0x14028a['customField']){_0x55424a[_0x14028a[_0x5121('0x33')][_0x5121('0x30')]()]=_0x2f502a[_0x14028a[_0x5121('0x34')]]['toString']();}else if(_0x14028a[_0x5121('0x32')]===_0x5121('0x35')&&_0x14028a[_0x5121('0x36')]&&_0x14028a[_0x5121('0x36')]['name']&&_0x14028a[_0x5121('0x33')]&&_0x14028a['customField']){_0x55424a[_0x14028a[_0x5121('0x33')][_0x5121('0x30')]()]=_0x2f502a[_0x14028a['Variable'][_0x5121('0x37')][_0x5121('0x30')]()][_0x5121('0x38')]();}});}return _0x55424a;}function getTicket(_0x3ff485,_0x5f0c76,_0x2a01ec,_0x307aa1,_0x515d18,_0x4c9b12){return function(_0x429db0){logger['info']('['+[_0x3ff485[_0x5121('0x10')]()]+_0x5121('0x39'),_0x429db0);return new Promise(function(_0x480e15,_0x46e705){var _0xb14627=_0x3ff485[_0x5121('0x30')]()===_0x5121('0x3a')?_0x429db0[_0x5121('0x19')]:_0x429db0[_0x5121('0x26')];var _0x10a786={'method':_0x5121('0x20'),'uri':_0x2a01ec+_0x5121('0x3b')+'?'+_0x4c9b12,'body':Object[_0x5121('0x3c')]({},{'active':'true','caller_id':_0xb14627,'assigned_to':_0x429db0[_0x5121('0x19')],'short_description':intUtil[_0x5121('0x3d')](_0x307aa1[_0x5121('0x3e')],_0x515d18,'\x20'),'description':intUtil[_0x5121('0x3d')](_0x307aa1[_0x5121('0x3f')],_0x515d18,'\x0a')},getCustomFields(_0x307aa1[_0x5121('0x40')],_0x515d18)),'auth':_0x5f0c76,'json':!![]};return rp(_0x10a786)[_0x5121('0x24')](function(_0x22a5a2){logger[_0x5121('0x13')]('['+[_0x3ff485[_0x5121('0x10')]()]+_0x5121('0x41'),_0x22a5a2[_0x5121('0xe')]);_0x429db0['ticketId']=_0x22a5a2[_0x5121('0xe')][_0x5121('0x1a')];_0x429db0[_0x5121('0x42')]=_0x22a5a2[_0x5121('0xe')][_0x5121('0x43')];logger[_0x5121('0x13')]('['+[_0x3ff485['toUpperCase']()]+_0x5121('0x44'),_0x429db0);_0x480e15(_0x429db0);})[_0x5121('0x11')](function(_0x1e662f){logger['error']('['+[_0x3ff485['toUpperCase']()]+']',_0x1e662f['message']);_0x46e705(_0x1e662f[_0x5121('0x12')]);});});};}function createRemoteTag(_0x1b4dd7,_0x119ef4,_0x48fbf5,_0xd7c93){return new Promise(function(_0x26cd52,_0x50509e){var _0xce7cc3={'method':_0x5121('0x20'),'uri':_0x48fbf5+'label'+'?'+_0xd7c93,'body':{'short_description':_0x1b4dd7,'global':!![],'active':!![],'name':_0x1b4dd7},'auth':_0x119ef4,'json':!![]};return rp(_0xce7cc3)['then'](function(_0xcc7e99){var _0x3883bb=_0xcc7e99[_0x5121('0xe')][_0x5121('0x1a')];_0x26cd52(_0x3883bb);});});}function getRemoteTag(_0x56eda9,_0x5c2647,_0xa93555,_0x1c6b95,_0x2efa7e){return new Promise(function(_0x3a5e25,_0x399d10){var _0x3b8756={'method':_0x5121('0xd'),'uri':_0xa93555+_0x5121('0x45')+_0x5121('0x46')+_0x56eda9+'&'+_0x1c6b95,'auth':_0x5c2647,'json':!![]};return rp(_0x3b8756)[_0x5121('0x24')](function(_0x214f04){if(_0x214f04[_0x5121('0xe')][_0x5121('0xf')]>0x0){var _0x57c849=_0x214f04['result'][0x0][_0x5121('0x1a')];_0x3a5e25(_0x57c849);}else{return createRemoteTag(_0x56eda9,_0x5c2647,_0xa93555,_0x1c6b95)[_0x5121('0x24')](function(_0x1f8d30){_0x3a5e25(_0x1f8d30);});}});});}function assignTagToIncident(_0x1dcb56,_0x413324,_0x1c4f34,_0x5ac95a,_0x319045){return new Promise(function(_0x2b3f23,_0x404e77){var _0x1d53e0={'method':_0x5121('0x20'),'uri':_0x1c4f34+'label_entry'+'?'+_0x319045,'body':{'label':_0x1dcb56,'table':_0x5121('0x3b'),'id_type':_0x5121('0x47'),'table_key':_0x5ac95a[_0x5121('0x48')],'title':_0x5121('0x49')+_0x5ac95a[_0x5121('0x42')],'id_display':_0x5ac95a[_0x5121('0x42')]},'auth':_0x413324,'json':!![]};return rp(_0x1d53e0)[_0x5121('0x24')](function(_0x144890){_0x2b3f23();})[_0x5121('0x11')](function(){_0x2b3f23();});});}function manageTags(_0x261d18,_0x1abc1f,_0x2bbdae,_0xb24e22,_0xa1bb0c,_0x2d33c9,_0x3870ba){return new Promise(function(_0x4aebd1,_0x466455){var _0x405d00=[];_0x1abc1f['forEach'](function(_0x56e995){_0x405d00[_0x5121('0x4a')](getRemoteTag(_0x56e995,_0x2bbdae,_0xb24e22,_0x2d33c9,_0x3870ba));});return Promise[_0x5121('0x4b')](_0x405d00)[_0x5121('0x24')](function(_0xe9489d){if(_0xe9489d['length']){logger[_0x5121('0x13')]('['+[_0x261d18[_0x5121('0x10')]()]+_0x5121('0x4c'),_0xe9489d);var _0x39ef52=[];_0xe9489d[_0x5121('0x2b')](function(_0x4af661){_0x39ef52[_0x5121('0x4a')](assignTagToIncident(_0x4af661,_0x2bbdae,_0xb24e22,_0xa1bb0c,_0x2d33c9));});return Promise[_0x5121('0x4b')](_0x39ef52)['then'](function(){_0x4aebd1();})[_0x5121('0x11')](function(){_0x4aebd1();});}else{_0x4aebd1();}});});}function getTags(_0x58b5f2,_0x29e65d,_0x743119,_0x5efd72,_0x3fe82c,_0x4ec716){return function(_0x3a3c6e){return new Promise(function(_0x39558b,_0x1ebee5){var _0x2fee0d=[];var _0x4de451=_0x5efd72[_0x5121('0x4d')];if(_0x4de451&&_0x4de451['length']>0x0){_0x2fee0d=_[_0x5121('0x4e')](_0x4de451,_0x5121('0x37'));}if(_0x2fee0d[_0x5121('0xf')]>0x0){return manageTags(_0x58b5f2,_0x2fee0d,_0x29e65d,_0x743119,_0x3a3c6e,_0x3fe82c,_0x4ec716)[_0x5121('0x24')](function(){_0x39558b(_0x3a3c6e);});}else{_0x39558b(_0x3a3c6e);}});};}function emit(_0x5e59c2,_0x42d993,_0x367c1e){var _0x484df3='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x5121('0x4f')+_0x5121('0x50');var _0x7e9e07={'uri':_0x5e59c2+_0x5121('0x51')+_0x367c1e+_0x484df3};io['to'](util[_0x5121('0x52')]('user:%s',_0x42d993))[_0x5121('0x53')](_0x5121('0x54'),_0x7e9e07);}exports['cs']=function(_0x49c07d,_0x5b99c8,_0x4e95fb,_0x2c65f4,_0x5cc35d,_0x113a59,_0x2ea314,_0x330d8a){var _0x34a975={};var _0x257342={'user':_0x113a59['username'],'pass':_0x113a59[_0x5121('0x55')]};var _0x491a5b=_0x5121('0x56');var _0x9d8aa6='sysparm_display_value=true';_0x113a59[_0x5121('0x57')]=intUtil[_0x5121('0x58')](_0x113a59[_0x5121('0x57')]);_0x113a59[_0x5121('0x59')]=intUtil[_0x5121('0x58')](_0x113a59['serverUrl']);var _0x18076f=util[_0x5121('0x52')](_0x5121('0x5a'),_0x113a59[_0x5121('0x57')]);_0x34a975['userEmail']=!_[_0x5121('0x5b')](_0x2c65f4)?_0x2c65f4[_0x5121('0x5c')]:null;_0x34a975[_0x5121('0x1f')]=_0x113a59[_0x5121('0x5c')];_0x34a975['endUserNumber']=_0x330d8a[_0x5121('0x30')]()===_0x5121('0x3a')?_0x5b99c8['destcalleridnum']:_0x5b99c8[_0x5121('0x5d')];_0x34a975[_0x5121('0x5e')]=_0x330d8a===_0x5121('0x5f')||_0x330d8a===_0x5121('0x60')?_0x5121('0x5f'):'outbound';var _0x51cd04=util[_0x5121('0x52')](_0x5121('0x61'),_0x113a59[_0x5121('0x59')],_0x5b99c8['uniqueid'],md5(_0x5b99c8['uniqueid']));if(_0x5cc35d&&_0x5cc35d[_0x5121('0x62')]){logger['info'](_0x5121('0x63'),'Recording\x20is\x20enabled!');_0x5b99c8[_0x5121('0x64')]=_0x51cd04;}else if(_0x2ea314&&_0x2ea314[_0x5121('0x65')]&&_0x2ea314[_0x5121('0x65')]!=='none'){logger[_0x5121('0x13')](_0x5121('0x66'),_0x5121('0x67'));_0x5b99c8[_0x5121('0x64')]=_0x51cd04;}else{_0x5b99c8[_0x5121('0x64')]='';}return getAdminUser(_0x330d8a,_0x257342,_0x34a975,_0x18076f,_0x9d8aa6,_0x491a5b)[_0x5121('0x24')](getUser(_0x330d8a,_0x257342,_0x18076f,_0x9d8aa6,_0x491a5b))[_0x5121('0x24')](getEndUser(_0x330d8a,_0x257342,_0x18076f,_0x9d8aa6,_0x491a5b))[_0x5121('0x24')](getTicket(_0x330d8a,_0x257342,_0x18076f,_0x4e95fb,_0x5b99c8,_0x9d8aa6))[_0x5121('0x24')](function(_0x2b46aa){logger[_0x5121('0x13')](util[_0x5121('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2b46aa['ticketId']));logger[_0x5121('0x13')](util[_0x5121('0x52')](_0x5121('0x68'),_0x330d8a));if(_0x330d8a!==_0x5121('0x60')){logger[_0x5121('0x13')]('['+[_0x330d8a[_0x5121('0x10')]()]+']',_0x5121('0x69'));emit(_0x113a59['remoteUri'],_0x2c65f4['name'],_0x2b46aa[_0x5121('0x48')]);}})[_0x5121('0x11')](function(_0x202447){logger[_0x5121('0x1d')]('['+[_0x330d8a[_0x5121('0x10')]()]+_0x5121('0x6a'),util['inspect'](_0x202447,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xee88=['Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','content','toString','idField','toLowerCase','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label'];(function(_0x37503a,_0x5b29b4){var _0x6a9c75=function(_0x5ab65c){while(--_0x5ab65c){_0x37503a['push'](_0x37503a['shift']());}};_0x6a9c75(++_0x5b29b4);}(_0xee88,0x1da));var _0x8ee8=function(_0x3db2de,_0x5b3c15){_0x3db2de=_0x3db2de-0x0;var _0x547a4a=_0xee88[_0x3db2de];return _0x547a4a;};'use strict';var _=require(_0x8ee8('0x0'));var Promise=require(_0x8ee8('0x1'));var rp=require(_0x8ee8('0x2'));var util=require(_0x8ee8('0x3'));var md5=require('md5');var Redis=require(_0x8ee8('0x4'));var intUtil=require(_0x8ee8('0x5'));var config=require(_0x8ee8('0x6'));var logger=require(_0x8ee8('0x7'))(_0x8ee8('0x8'));config[_0x8ee8('0x9')]=_[_0x8ee8('0xa')](config[_0x8ee8('0x9')],{'host':_0x8ee8('0xb'),'port':0x18eb});var io=require(_0x8ee8('0xc'))(new Redis(config[_0x8ee8('0x9')]));function getAdminUser(_0x43d357,_0x56167e,_0xbe8203,_0x983d68,_0x5c80f0,_0x2f20c8){return new Promise(function(_0x386526,_0x5c0e9a){var _0x4a8642={'method':_0x8ee8('0xd'),'uri':_0x983d68+_0x8ee8('0xe')+'&'+_0x5c80f0+'&'+_0x2f20c8,'auth':_0x56167e,'json':!![]};return rp(_0x4a8642)[_0x8ee8('0xf')](function(_0x5c9283){if(_0x5c9283[_0x8ee8('0x10')][_0x8ee8('0x11')]>0x0){_0xbe8203[_0x8ee8('0x12')]=_0x5c9283[_0x8ee8('0x10')][0x0][_0x8ee8('0x13')];}logger[_0x8ee8('0x14')]('['+[_0x43d357[_0x8ee8('0x15')]()]+_0x8ee8('0x16'),_0xbe8203);_0x386526(_0xbe8203);})[_0x8ee8('0x17')](function(_0x9fa470){logger[_0x8ee8('0x18')]('['+[_0x43d357[_0x8ee8('0x15')]()]+']',_0x9fa470[_0x8ee8('0x19')]);_0x5c0e9a(_0x9fa470[_0x8ee8('0x19')]);});});}function getUser(_0x1201e8,_0x4f3a83,_0xbb76c3,_0x945504,_0x23683c){return function(_0x21a8bb){logger[_0x8ee8('0x14')]('['+[_0x1201e8[_0x8ee8('0x15')]()]+'],\x20getUser\x20input\x20crm',_0x21a8bb);return new Promise(function(_0x335b12,_0xc2ee72){if(intUtil[_0x8ee8('0x1a')](_0x21a8bb[_0x8ee8('0x1b')])){var _0x6d7bf1={'method':_0x8ee8('0xd'),'uri':_0xbb76c3+_0x8ee8('0x1c')+_0x21a8bb[_0x8ee8('0x1b')]+'&'+_0x945504+'&'+_0x23683c,'auth':_0x4f3a83,'json':!![]};logger[_0x8ee8('0x14')]('['+[_0x1201e8[_0x8ee8('0x15')]()]+_0x8ee8('0x1d'),_0x6d7bf1);return rp(_0x6d7bf1)[_0x8ee8('0xf')](function(_0x550d77){logger[_0x8ee8('0x14')]('['+[_0x1201e8[_0x8ee8('0x15')]()]+_0x8ee8('0x1e'),_0x550d77);if(_0x550d77[_0x8ee8('0x10')]['length']>0x0&&String(_0x550d77['result'][0x0][_0x8ee8('0x1f')])===_0x8ee8('0x20')){_0x21a8bb[_0x8ee8('0x21')]=_0x550d77['result'][0x0][_0x8ee8('0x13')];}else{_0x21a8bb['userId']=_0x21a8bb[_0x8ee8('0x12')];_0x21a8bb[_0x8ee8('0x1b')]=_0x21a8bb[_0x8ee8('0x22')];}logger[_0x8ee8('0x14')]('['+[_0x1201e8[_0x8ee8('0x15')]()]+'],\x20getUser\x20crm',_0x21a8bb);_0x335b12(_0x21a8bb);})[_0x8ee8('0x17')](function(_0x23e5e3){logger['error']('['+[_0x1201e8[_0x8ee8('0x15')]()]+']',_0x23e5e3[_0x8ee8('0x19')]);_0xc2ee72(_0x23e5e3[_0x8ee8('0x19')]);});}else{logger[_0x8ee8('0x14')]('['+[_0x1201e8[_0x8ee8('0x15')]()]+_0x8ee8('0x23'));_0x21a8bb[_0x8ee8('0x21')]=_0x21a8bb[_0x8ee8('0x12')];_0x21a8bb['userEmail']=_0x21a8bb['adminEmail'];_0x335b12(_0x21a8bb);}});};}function createEndUser(_0x1668a9,_0x160c15,_0x1f8de1,_0x32858d,_0x3bf9d8){logger[_0x8ee8('0x14')]('['+[_0x1668a9[_0x8ee8('0x15')]()]+_0x8ee8('0x24'),_0x1f8de1);return new Promise(function(_0x26c618,_0xc05a2a){var _0xdfbed0={'method':_0x8ee8('0x25'),'uri':_0x32858d+_0x8ee8('0x26')+_0x3bf9d8,'body':{'user_name':_0x1f8de1[_0x8ee8('0x27')],'roles':_0x8ee8('0x28'),'first_name':_0x1f8de1[_0x8ee8('0x27')],'active':'true','date_format':_0x8ee8('0x29'),'phone':_0x1f8de1[_0x8ee8('0x27')]},'auth':_0x160c15,'json':!![]};return rp(_0xdfbed0)['then'](function(_0x3abb23){logger[_0x8ee8('0x14')]('['+[_0x1668a9['toUpperCase']()]+_0x8ee8('0x2a'),_0x3abb23[_0x8ee8('0x10')]);_0x1f8de1[_0x8ee8('0x2b')]=_0x3abb23[_0x8ee8('0x10')]['sys_id'];_0x26c618(_0x1f8de1);})['catch'](function(_0x45fd22){logger[_0x8ee8('0x18')]('['+[_0x1668a9[_0x8ee8('0x15')]()]+']',_0x45fd22[_0x8ee8('0x19')]);_0xc05a2a(_0x45fd22['message']);});});}function getEndUser(_0x641578,_0x264a5a,_0x492f13,_0x201526,_0x2de829){return function(_0x2cb732){logger[_0x8ee8('0x14')]('['+[_0x641578[_0x8ee8('0x15')]()]+_0x8ee8('0x2c'),_0x2cb732);return new Promise(function(_0x3bba29,_0x5e2b62){var _0x1e7fb9={'method':_0x8ee8('0xd'),'uri':_0x492f13+'sys_user?sysparm_query=phone%3D'+_0x2cb732[_0x8ee8('0x27')]+'&'+_0x201526+'&'+_0x2de829,'auth':_0x264a5a,'json':!![]};return rp(_0x1e7fb9)[_0x8ee8('0xf')](function(_0x4cc164){if(_0x4cc164[_0x8ee8('0x10')]['length']>0x0){_0x2cb732[_0x8ee8('0x2b')]=_0x4cc164[_0x8ee8('0x10')][0x0][_0x8ee8('0x13')];logger[_0x8ee8('0x14')]('['+[_0x641578[_0x8ee8('0x15')]()]+_0x8ee8('0x2d'),_0x2cb732);_0x3bba29(_0x2cb732);}else{return createEndUser(_0x641578,_0x264a5a,_0x2cb732,_0x492f13,_0x201526)[_0x8ee8('0xf')](function(_0x311a1a){logger[_0x8ee8('0x14')]('['+[_0x641578[_0x8ee8('0x15')]()]+_0x8ee8('0x2e'),_0x311a1a);_0x3bba29(_0x311a1a);});}})[_0x8ee8('0x17')](function(_0x457b7f){logger[_0x8ee8('0x18')]('['+[_0x641578[_0x8ee8('0x15')]()]+']',_0x457b7f[_0x8ee8('0x19')]);_0x5e2b62(_0x457b7f['message']);});});};}function getCustomFields(_0x595ab0,_0xac1724){var _0x123687={};if(_0x595ab0[_0x8ee8('0x11')]>0x0){_[_0x8ee8('0x2f')](_0x595ab0,function(_0x1290bf){if(_[_0x8ee8('0x30')]([_0x8ee8('0x31'),_0x8ee8('0x32')],_0x1290bf[_0x8ee8('0x33')])&&_0x1290bf[_0x8ee8('0x34')]&&!_0x1290bf[_0x8ee8('0x35')]){_0x123687[_0x1290bf['nameField']['toLowerCase']()]=_0x1290bf[_0x8ee8('0x36')][_0x8ee8('0x37')]();}else if(_[_0x8ee8('0x30')]([_0x8ee8('0x31'),_0x8ee8('0x32')],_0x1290bf[_0x8ee8('0x33')])&&_0x1290bf[_0x8ee8('0x38')]&&_0x1290bf[_0x8ee8('0x35')]){_0x123687[_0x1290bf[_0x8ee8('0x38')][_0x8ee8('0x39')]()]=_0x1290bf[_0x8ee8('0x36')]['toString']();}else if(_0x1290bf[_0x8ee8('0x33')]==='variable'&&_0x1290bf[_0x8ee8('0x3a')]&&_0x1290bf[_0x8ee8('0x38')]&&_0x1290bf[_0x8ee8('0x35')]){_0x123687[_0x1290bf['idField'][_0x8ee8('0x39')]()]=_0xac1724[_0x1290bf[_0x8ee8('0x3a')]][_0x8ee8('0x37')]();}else if(_0x1290bf[_0x8ee8('0x33')]===_0x8ee8('0x3b')&&_0x1290bf[_0x8ee8('0x3c')]&&_0x1290bf[_0x8ee8('0x3c')][_0x8ee8('0x3d')]&&_0x1290bf[_0x8ee8('0x38')]&&_0x1290bf['customField']){_0x123687[_0x1290bf[_0x8ee8('0x38')][_0x8ee8('0x39')]()]=_0xac1724[_0x1290bf[_0x8ee8('0x3c')][_0x8ee8('0x3d')][_0x8ee8('0x39')]()][_0x8ee8('0x37')]();}});}return _0x123687;}function getTicket(_0x1586fd,_0xfc8ba5,_0x23a630,_0x5f18bf,_0x1ef573,_0x59e778){return function(_0x524b4){logger[_0x8ee8('0x14')]('['+[_0x1586fd[_0x8ee8('0x15')]()]+_0x8ee8('0x3e'),_0x524b4);return new Promise(function(_0x3819a0,_0x2e6d5e){var _0x1f5c7c=_0x1586fd[_0x8ee8('0x39')]()===_0x8ee8('0x3f')?_0x524b4[_0x8ee8('0x21')]:_0x524b4[_0x8ee8('0x2b')];var _0x3aaeea={'method':_0x8ee8('0x25'),'uri':_0x23a630+_0x8ee8('0x40')+'?'+_0x59e778,'body':Object[_0x8ee8('0x41')]({},{'active':'true','caller_id':_0x1f5c7c,'assigned_to':_0x524b4['userId'],'short_description':intUtil['getString'](_0x5f18bf['Subjects'],_0x1ef573,'\x20'),'description':intUtil[_0x8ee8('0x42')](_0x5f18bf[_0x8ee8('0x43')],_0x1ef573,'\x0a')},getCustomFields(_0x5f18bf[_0x8ee8('0x44')],_0x1ef573)),'auth':_0xfc8ba5,'json':!![]};return rp(_0x3aaeea)[_0x8ee8('0xf')](function(_0x18bac9){logger[_0x8ee8('0x14')]('['+[_0x1586fd[_0x8ee8('0x15')]()]+_0x8ee8('0x45'),_0x18bac9[_0x8ee8('0x10')]);_0x524b4[_0x8ee8('0x46')]=_0x18bac9[_0x8ee8('0x10')][_0x8ee8('0x13')];_0x524b4['ticketNumber']=_0x18bac9[_0x8ee8('0x10')][_0x8ee8('0x47')];logger[_0x8ee8('0x14')]('['+[_0x1586fd[_0x8ee8('0x15')]()]+_0x8ee8('0x48'),_0x524b4);_0x3819a0(_0x524b4);})[_0x8ee8('0x17')](function(_0x4c7b71){logger[_0x8ee8('0x18')]('['+[_0x1586fd[_0x8ee8('0x15')]()]+']',_0x4c7b71[_0x8ee8('0x19')]);_0x2e6d5e(_0x4c7b71[_0x8ee8('0x19')]);});});};}function createRemoteTag(_0x8bff2a,_0x329f14,_0x4bb354,_0x49083f){return new Promise(function(_0x1a7e9f,_0x3db8b2){var _0x108018={'method':'POST','uri':_0x4bb354+_0x8ee8('0x49')+'?'+_0x49083f,'body':{'short_description':_0x8bff2a,'global':!![],'active':!![],'name':_0x8bff2a},'auth':_0x329f14,'json':!![]};return rp(_0x108018)[_0x8ee8('0xf')](function(_0x3b546b){var _0x46cd4a=_0x3b546b[_0x8ee8('0x10')][_0x8ee8('0x13')];_0x1a7e9f(_0x46cd4a);});});}function getRemoteTag(_0x25e0be,_0xabaf83,_0x1837eb,_0x378c7a,_0xfbbff3){return new Promise(function(_0x3b848c,_0x5f3cac){var _0xd9ab66={'method':_0x8ee8('0xd'),'uri':_0x1837eb+_0x8ee8('0x49')+_0x8ee8('0x4a')+_0x25e0be+'&'+_0x378c7a,'auth':_0xabaf83,'json':!![]};return rp(_0xd9ab66)['then'](function(_0x569594){if(_0x569594[_0x8ee8('0x10')][_0x8ee8('0x11')]>0x0){var _0x42bee2=_0x569594[_0x8ee8('0x10')][0x0][_0x8ee8('0x13')];_0x3b848c(_0x42bee2);}else{return createRemoteTag(_0x25e0be,_0xabaf83,_0x1837eb,_0x378c7a)[_0x8ee8('0xf')](function(_0x57bce0){_0x3b848c(_0x57bce0);});}});});}function assignTagToIncident(_0x14d054,_0x24b05c,_0xaecd01,_0x264aa0,_0x1ece1b){return new Promise(function(_0x59d507,_0x7eb23a){var _0xd5cb02={'method':'POST','uri':_0xaecd01+'label_entry'+'?'+_0x1ece1b,'body':{'label':_0x14d054,'table':_0x8ee8('0x40'),'id_type':_0x8ee8('0x4b'),'table_key':_0x264aa0[_0x8ee8('0x46')],'title':_0x8ee8('0x4c')+_0x264aa0['ticketNumber'],'id_display':_0x264aa0[_0x8ee8('0x4d')]},'auth':_0x24b05c,'json':!![]};return rp(_0xd5cb02)[_0x8ee8('0xf')](function(_0x5c70e4){_0x59d507();})[_0x8ee8('0x17')](function(){_0x59d507();});});}function manageTags(_0x559337,_0x449865,_0x4d2897,_0x2213fd,_0x5937c2,_0x2ea462,_0x2d7c5d){return new Promise(function(_0x5bac84,_0x1b9fcf){var _0xb257c9=[];_0x449865[_0x8ee8('0x2f')](function(_0x249193){_0xb257c9[_0x8ee8('0x4e')](getRemoteTag(_0x249193,_0x4d2897,_0x2213fd,_0x2ea462,_0x2d7c5d));});return Promise[_0x8ee8('0x4f')](_0xb257c9)['then'](function(_0x1aeffc){if(_0x1aeffc[_0x8ee8('0x11')]){logger[_0x8ee8('0x14')]('['+[_0x559337['toUpperCase']()]+_0x8ee8('0x50'),_0x1aeffc);var _0xcdfdb=[];_0x1aeffc[_0x8ee8('0x2f')](function(_0x4dee47){_0xcdfdb[_0x8ee8('0x4e')](assignTagToIncident(_0x4dee47,_0x4d2897,_0x2213fd,_0x5937c2,_0x2ea462));});return Promise[_0x8ee8('0x4f')](_0xcdfdb)[_0x8ee8('0xf')](function(){_0x5bac84();})[_0x8ee8('0x17')](function(){_0x5bac84();});}else{_0x5bac84();}});});}function getTags(_0x26c03d,_0x5f1e71,_0x2a120e,_0x49a42c,_0x4c737e,_0x27646f){return function(_0x8f29f9){return new Promise(function(_0x5e2c1d,_0x198db8){var _0x1c5c68=[];var _0x4a4745=_0x49a42c[_0x8ee8('0x51')];if(_0x4a4745&&_0x4a4745[_0x8ee8('0x11')]>0x0){_0x1c5c68=_[_0x8ee8('0x52')](_0x4a4745,_0x8ee8('0x3d'));}if(_0x1c5c68['length']>0x0){return manageTags(_0x26c03d,_0x1c5c68,_0x5f1e71,_0x2a120e,_0x8f29f9,_0x4c737e,_0x27646f)['then'](function(){_0x5e2c1d(_0x8f29f9);});}else{_0x5e2c1d(_0x8f29f9);}});};}function emit(_0x4923e6,_0x32be81,_0x26c079){var _0x39d4a9='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x8ee8('0x53')+_0x8ee8('0x54');var _0x1c684c={'uri':_0x4923e6+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x26c079+_0x39d4a9};io['to'](util[_0x8ee8('0x55')](_0x8ee8('0x56'),_0x32be81))[_0x8ee8('0x57')](_0x8ee8('0x58'),_0x1c684c);}exports['cs']=function(_0x175160,_0x11caee,_0x296d42,_0x4f7553,_0x288103,_0x2d8155,_0x57c623,_0x2b592e){var _0xf332fa={};var _0x1f7bd8={'user':_0x2d8155['username'],'pass':_0x2d8155[_0x8ee8('0x59')]};var _0x4c1d5b='sysparm_limit=1';var _0x12e28f=_0x8ee8('0x5a');_0x2d8155[_0x8ee8('0x5b')]=intUtil[_0x8ee8('0x5c')](_0x2d8155['remoteUri']);_0x2d8155[_0x8ee8('0x5d')]=intUtil[_0x8ee8('0x5c')](_0x2d8155[_0x8ee8('0x5d')]);var _0xa8056e=util[_0x8ee8('0x55')](_0x8ee8('0x5e'),_0x2d8155[_0x8ee8('0x5b')]);_0xf332fa[_0x8ee8('0x1b')]=!_[_0x8ee8('0x5f')](_0x4f7553)?_0x4f7553['email']:null;_0xf332fa[_0x8ee8('0x22')]=_0x2d8155['email'];_0xf332fa['endUserNumber']=_0x2b592e[_0x8ee8('0x39')]()===_0x8ee8('0x3f')?_0x11caee[_0x8ee8('0x60')]:_0x11caee[_0x8ee8('0x61')];_0xf332fa['callDirection']=_0x2b592e===_0x8ee8('0x62')||_0x2b592e===_0x8ee8('0x63')?_0x8ee8('0x62'):'outbound';var _0x49d8e0=util['format'](_0x8ee8('0x64'),_0x2d8155['serverUrl'],_0x11caee[_0x8ee8('0x65')],md5(_0x11caee[_0x8ee8('0x65')]));if(_0x288103&&_0x288103[_0x8ee8('0x66')]){logger[_0x8ee8('0x14')]('[QUEUE]',_0x8ee8('0x67'));_0x11caee[_0x8ee8('0x68')]=_0x49d8e0;}else if(_0x57c623&&_0x57c623[_0x8ee8('0x69')]&&_0x57c623['recordingFormat']!=='none'){logger[_0x8ee8('0x14')](_0x8ee8('0x6a'),'Recording\x20is\x20enabled!');_0x11caee[_0x8ee8('0x68')]=_0x49d8e0;}else{_0x11caee[_0x8ee8('0x68')]='';}return getAdminUser(_0x2b592e,_0x1f7bd8,_0xf332fa,_0xa8056e,_0x12e28f,_0x4c1d5b)['then'](getUser(_0x2b592e,_0x1f7bd8,_0xa8056e,_0x12e28f,_0x4c1d5b))[_0x8ee8('0xf')](getEndUser(_0x2b592e,_0x1f7bd8,_0xa8056e,_0x12e28f,_0x4c1d5b))[_0x8ee8('0xf')](getTicket(_0x2b592e,_0x1f7bd8,_0xa8056e,_0x296d42,_0x11caee,_0x12e28f))['then'](function(_0x2552b4){logger[_0x8ee8('0x14')](util[_0x8ee8('0x55')](_0x8ee8('0x6b'),_0x2552b4[_0x8ee8('0x46')]));logger['info'](util[_0x8ee8('0x55')](_0x8ee8('0x6c'),_0x2b592e));if(_0x2b592e!==_0x8ee8('0x63')){logger[_0x8ee8('0x14')]('['+[_0x2b592e[_0x8ee8('0x15')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2d8155[_0x8ee8('0x5b')],_0x4f7553[_0x8ee8('0x3d')],_0x2552b4[_0x8ee8('0x46')]);}})[_0x8ee8('0x17')](function(_0x43b0a5){logger['error']('['+[_0x2b592e[_0x8ee8('0x15')]()]+_0x8ee8('0x6d'),util[_0x8ee8('0x6e')](_0x43b0a5,{'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 96f2f31..b0621cf 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 _0x8db3=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','uri','monitor_format','lastevent','toUpperCase','calleridname','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','idField','JSON','Calls','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','stringify','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','push','content','variable','custom_fields','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php'];(function(_0x7fabe1,_0x5d2150){var _0x43669e=function(_0xcfd05b){while(--_0xcfd05b){_0x7fabe1['push'](_0x7fabe1['shift']());}};_0x43669e(++_0x5d2150);}(_0x8db3,0x195));var _0x38db=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x8db3[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x38db('0x0'));var Redis=require(_0x38db('0x1'));var intUtil=require(_0x38db('0x2'));var config=require('../../../../config/environment');var logger=require(_0x38db('0x3'))(_0x38db('0x4'));config[_0x38db('0x5')]=_[_0x38db('0x6')](config[_0x38db('0x5')],{'host':_0x38db('0x7'),'port':0x18eb});var io=require(_0x38db('0x8'))(new Redis(config[_0x38db('0x5')]));var def={'method':_0x38db('0x9'),'json':!![]};function emit(_0x498800,_0x415579,_0x319c0b){io['to'](_0x498800)[_0x38db('0xa')](_0x415579,_0x319c0b);}function getTicket(_0x3bd22a,_0x39cffb,_0x3f2b7c,_0xaa589c,_0x2774d9,_0xd3b0f3,_0x238167,_0x391bff){logger['info'](_0x38db('0xb'));var _0x301186=new Date();var _0xbae981=[{'name':_0x38db('0xc'),'value':intUtil['getString'](_0xaa589c['Subjects'],_0x2774d9,'\x20')},{'name':_0x38db('0xd'),'value':_0x39cffb['id']},{'name':_0x38db('0xe'),'value':_0x39cffb['id']},{'name':_0x38db('0xf'),'value':intUtil[_0x38db('0x10')](_0xaa589c[_0x38db('0x11')],_0x2774d9,'\x0a')},{'name':_0x38db('0x12'),'value':_0x301186[_0x38db('0x13')]()[_0x38db('0x14')](0x0,0x13)[_0x38db('0x15')]('T','\x20')},{'name':_0x38db('0x16'),'value':'0'},{'name':_0x38db('0x17'),'value':'15'},{'name':_0x38db('0x18'),'value':_0x3f2b7c['id']},{'name':_0x38db('0x19'),'value':_0x38db('0x1a')},{'name':'parent_name','value':_0x3f2b7c[_0x38db('0xc')]},{'name':_0x38db('0x1b'),'value':_0x391bff}];if(_0xd3b0f3[_0x38db('0x1c')]){_[_0x38db('0x1d')](_0xd3b0f3,function(_0x1bda73){if(_0x2774d9[_0x1bda73[_0x38db('0x1e')]]){_0xbae981['push']({'name':_0x1bda73[_0x38db('0x1f')],'value':_0x2774d9[_0x1bda73[_0x38db('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x38db('0x20'),'response_type':_0x38db('0x20'),'rest_data':JSON['stringify']({'session':_0x238167['id'],'module_name':_0x38db('0x21'),'name_value_list':_0xbae981})}});}function getAuth(_0x26c83a){return util['format'](_0x38db('0x22'),new Buffer(_0x26c83a[_0x38db('0x23')]+':X')[_0x38db('0x24')]('base64'));}function getServerInfo(_0x3b6a55){return request({'form':{'method':_0x38db('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3b6a55['id']})}});}function getUser(_0x5cdfab,_0x382455,_0x201bba){if(!_[_0x38db('0x26')](_0x382455)){logger['info'](_0x38db('0x27'),_0x382455);return request({'form':{'method':_0x38db('0x28'),'input_type':_0x38db('0x20'),'response_type':_0x38db('0x20'),'rest_data':JSON[_0x38db('0x29')]({'session':_0x201bba['id'],'module_name':_0x38db('0x2a'),'query':util[_0x38db('0x2b')](_0x38db('0x2c'),_0x382455),'order_by':'','offset':'0','select_fields':['id',_0x38db('0xc'),_0x38db('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x38db('0x2e')](function(_0x6e7870){if(_0x6e7870[_0x38db('0x2f')][_0x38db('0x1c')]){var _0x34913f=_['find'](_0x6e7870[_0x38db('0x2f')],function(_0x358e0e){return _0x358e0e[_0x38db('0x30')][_0x38db('0x2d')][_0x38db('0x31')]===_0x382455;});if(_0x34913f){logger[_0x38db('0x32')](_0x38db('0x33'));return BPromise['resolve']({'id':_0x34913f[_0x38db('0x30')]['id'][_0x38db('0x31')],'name':_0x34913f['name_value_list']['name']['value']});}}logger[_0x38db('0x32')](_0x38db('0x34'));return BPromise[_0x38db('0x35')]({'id':_0x201bba[_0x38db('0x30')][_0x38db('0x36')][_0x38db('0x31')],'name':_0x201bba[_0x38db('0x30')][_0x38db('0x2d')][_0x38db('0x31')]});});}else{logger[_0x38db('0x32')](_0x38db('0x37'));return BPromise['resolve']({'id':_0x201bba[_0x38db('0x30')][_0x38db('0x36')][_0x38db('0x31')],'name':_0x201bba[_0x38db('0x30')][_0x38db('0x2d')][_0x38db('0x31')]});}}function getEndUser(_0x2ac023,_0x49f0e7,_0x220c24,_0x33ef9c){logger[_0x38db('0x32')]('Searching\x20enduser\x20with\x20phone',_0x220c24);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x38db('0x29')]({'session':_0x33ef9c['id'],'module_name':_0x38db('0x1a'),'query':util[_0x38db('0x2b')](_0x38db('0x38'),_0x220c24),'order_by':'','offset':'0','select_fields':['id',_0x38db('0xc'),_0x38db('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x38db('0x2e')](function(_0x35ac90){if(_0x35ac90[_0x38db('0x2f')]['length']){var _0x26129c=_[_0x38db('0x3a')](_0x35ac90[_0x38db('0x2f')],function(_0x15121a){return _0x15121a[_0x38db('0x30')][_0x38db('0x39')]['value']===_0x220c24;});if(_0x26129c){logger['info']('Enduser\x20found!');return BPromise[_0x38db('0x35')]({'id':_0x26129c[_0x38db('0x30')]['id'][_0x38db('0x31')],'name':_0x26129c[_0x38db('0x30')][_0x38db('0xc')]['value'],'phone':_0x26129c[_0x38db('0x30')][_0x38db('0x39')]['value']});}}else{logger['info'](_0x38db('0x3b'));return request({'form':{'method':_0x38db('0x3c'),'input_type':_0x38db('0x20'),'response_type':'JSON','rest_data':JSON[_0x38db('0x29')]({'session':_0x33ef9c['id'],'module_name':_0x38db('0x1a'),'name_value_list':[{'name':_0x38db('0x3d'),'value':_0x49f0e7!==_0x38db('0x3e')?_0x49f0e7:util[_0x38db('0x2b')](_0x38db('0x3f'),_0x220c24)},{'name':_0x38db('0x39'),'value':_0x220c24}]})}})[_0x38db('0x2e')](function(_0x10c3fc){logger[_0x38db('0x32')](_0x38db('0x40'));return BPromise[_0x38db('0x35')]({'id':_0x10c3fc['id'],'name':_0x10c3fc['entry_list'][_0x38db('0x3d')][_0x38db('0x31')],'phone':_0x10c3fc[_0x38db('0x2f')][_0x38db('0x39')]['value']});});}});}function request(_0xdc391){logger[_0x38db('0x41')](_0x38db('0x42'),JSON[_0x38db('0x29')](_0xdc391));return rp(_[_0x38db('0x43')](def,_0xdc391));}function getTags(_0x7047e3,_0x4316c4){var _0x363f61=[];if(_0x7047e3&&_0x7047e3[_0x38db('0x1c')]>0x0){_0x363f61=_[_0x38db('0x44')](_0x7047e3,_0x4316c4);}return _0x363f61;}function getCustomFields(_0x27b1a4,_0x63d435){var _0x6c350e=[];var _0x1cdcfc={'custom_fields':[]};if(_0x27b1a4[_0x38db('0x1c')]>0x0){_['forEach'](_0x27b1a4,function(_0x24759d){if(_0x24759d[_0x38db('0x45')]===_0x38db('0x46')&&_0x24759d[_0x38db('0x47')]&&!_0x24759d[_0x38db('0x48')]){_0x1cdcfc[_0x24759d['nameField'][_0x38db('0x49')]()]=_0x24759d['content'][_0x38db('0x24')]();}else if(_0x24759d[_0x38db('0x45')]==='string'&&_0x24759d['idField']&&_0x24759d[_0x38db('0x48')]){_0x1cdcfc['custom_fields'][_0x38db('0x4a')]({'id':_0x24759d[_0x38db('0x1f')],'value':_0x24759d[_0x38db('0x4b')][_0x38db('0x24')]()});}else if(_0x24759d['type']===_0x38db('0x4c')&&_0x24759d['variableName']&&_0x24759d[_0x38db('0x1f')]&&_0x24759d[_0x38db('0x48')]){_0x63d435[_0x24759d[_0x38db('0x1e')]]&&_0x1cdcfc[_0x38db('0x4d')][_0x38db('0x4a')]({'id':_0x24759d[_0x38db('0x1f')],'value':_0x63d435[_0x24759d[_0x38db('0x1e')]]['toString']()});}else if(_0x24759d[_0x38db('0x45')]===_0x38db('0x4e')&&_0x24759d[_0x38db('0x4f')]&&_0x24759d[_0x38db('0x4f')][_0x38db('0xc')]&&_0x24759d[_0x38db('0x1f')]&&_0x24759d[_0x38db('0x48')]){_0x63d435[_0x24759d['Variable'][_0x38db('0xc')]['toLowerCase']()]&&_0x1cdcfc[_0x38db('0x4d')][_0x38db('0x4a')]({'id':_0x24759d[_0x38db('0x1f')],'value':_0x63d435[_0x24759d[_0x38db('0x4f')][_0x38db('0xc')][_0x38db('0x49')]()][_0x38db('0x24')]()});}});}return _0x1cdcfc;}function getConnection(_0x9ba7cd){return request({'method':_0x38db('0x9'),'form':{'method':_0x38db('0x50'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x9ba7cd['username'],'password':_0x9ba7cd[_0x38db('0x51')],'encryption':_0x38db('0x52')},'application':_0x38db('0x53')})}})[_0x38db('0x2e')](function(_0x45ebfa){var _0x541a29=_0x45ebfa;if(_0x541a29['id']){def[_0x38db('0x54')]=_0x541a29['id'];return BPromise[_0x38db('0x35')](_0x541a29);}else{throw new Error(util[_0x38db('0x2b')]('Account\x20%d\x20is\x20not\x20valid',_0x9ba7cd['id']));}});}function setRelationship(_0x3c2088,_0x461e34,_0x70de2d,_0x43bd92){return request({'form':{'method':_0x38db('0x55'),'input_type':_0x38db('0x20'),'response_type':'JSON','rest_data':JSON[_0x38db('0x29')]({'session':_0x3c2088['id'],'module_name':_0x38db('0x21'),'module_id':_0x70de2d['id'],'link_field_name':_0x43bd92,'related_ids':[_0x461e34['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x38db('0x56')]=function(_0x2b0abe,_0x58b16a,_0x56ce70,_0x2ab51b,_0x3ff467,_0xb98b11){var _0xe236ba,_0x1288ff,_0x4cacae,_0x42225;_0xb98b11['remoteUri']=intUtil[_0x38db('0x57')](_0xb98b11[_0x38db('0x58')]);_0xb98b11[_0x38db('0x59')]=intUtil[_0x38db('0x57')](_0xb98b11['serverUrl']);def['uri']=util[_0x38db('0x2b')](_0x38db('0x5a'),_0xb98b11[_0x38db('0x58')]);if(_0x3ff467&&_0x3ff467['monitor_format']){logger[_0x38db('0x32')]('[QUEUE]','Recording\x20is\x20enabled!');_0x58b16a['recordingURL']=util[_0x38db('0x2b')](_0x38db('0x5b'),_0xb98b11[_0x38db('0x59')],_0x58b16a[_0x38db('0x5c')],md5(_0x58b16a['uniqueid']));}else{_0x58b16a[_0x38db('0x5d')]='';}return getConnection(_0xb98b11)[_0x38db('0x2e')](function(_0x4f2da1){_0x42225=_0x4f2da1;return getUser(_0xb98b11,_0x2ab51b['name'],_0x42225);})[_0x38db('0x2e')](function(_0x58cb4e){_0xe236ba=_0x58cb4e;logger['info'](_0x38db('0x5e'),_0xe236ba['id']);return getEndUser(_0xb98b11,_0x58b16a['calleridname'],_0x58b16a[_0x38db('0x5f')],_0x42225);})[_0x38db('0x2e')](function(_0x23a7c9){_0x1288ff=_0x23a7c9;logger['info'](_0x38db('0x60'),_0x1288ff['id']);return getTicket(_0xb98b11,_0xe236ba,_0x1288ff,_0x56ce70,_0x58b16a,_0x56ce70[_0x38db('0x61')],_0x42225,_0x38db('0x62'));})[_0x38db('0x2e')](function(_0x2159c2){_0x4cacae=_0x2159c2;logger[_0x38db('0x32')](_0x38db('0x63'));logger['info'](_0x38db('0x64'),_0x4cacae['id']);return setRelationship(_0x42225,_0xe236ba,_0x4cacae,_0x38db('0x65'));})['then'](function(){return setRelationship(_0x42225,_0x1288ff,_0x4cacae,_0x38db('0x66'));})['then'](function(){return getServerInfo(_0x42225);})[_0x38db('0x2e')](function(_0x489185){var _0x21e545=parseInt(_0x489185[_0x38db('0x67')][_0x38db('0x68')](0x0));var _0x293caa=util[_0x38db('0x2b')](_0x38db('0x69'),_0xb98b11[_0x38db('0x58')],_0x4cacae['id']);if(_0x21e545>0x6){_0x293caa=util[_0x38db('0x2b')](_0x38db('0x6a'),_0xb98b11[_0x38db('0x58')],_0x4cacae['id']);}logger['info'](_0x38db('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x38db('0x2b')]('user:%s',_0x2ab51b[_0x38db('0xc')]),_0x38db('0x6c'),{'uri':_0x293caa});})['catch'](function(_0x10f7e9){logger[_0x38db('0x6d')](_0x38db('0x6b'),JSON[_0x38db('0x29')](_0x10f7e9));});};exports[_0x38db('0x6e')]=function(_0x2b9b96,_0x2645a8,_0x2f0711,_0x38fd0f,_0x1b0774,_0x241c6f,_0x4575aa){var _0xb14211,_0x46cb8a,_0x51afb3,_0x331dd9;_0x241c6f[_0x38db('0x58')]=intUtil[_0x38db('0x57')](_0x241c6f[_0x38db('0x58')]);_0x241c6f['serverUrl']=intUtil[_0x38db('0x57')](_0x241c6f[_0x38db('0x59')]);def['uri']=util[_0x38db('0x2b')](_0x38db('0x5a'),_0x241c6f[_0x38db('0x58')]);if(_0x4575aa&&_0x4575aa[_0x38db('0x6f')]&&_0x4575aa[_0x38db('0x6f')]!==_0x38db('0x70')){logger[_0x38db('0x32')](_0x38db('0x71'),_0x38db('0x72'));_0x2645a8[_0x38db('0x5d')]=util['format'](_0x38db('0x5b'),_0x241c6f[_0x38db('0x59')],_0x2645a8['uniqueid'],md5(_0x2645a8[_0x38db('0x5c')]));}return getConnection(_0x241c6f)[_0x38db('0x2e')](function(_0x2c0a46){_0x331dd9=_0x2c0a46;return getUser(_0x241c6f,_0x38fd0f[_0x38db('0xc')],_0x331dd9);})['then'](function(_0x31ac0e){_0xb14211=_0x31ac0e;logger[_0x38db('0x32')]('The\x20User\x20ID\x20is:',_0xb14211['id']);return getEndUser(_0x241c6f,_0x2645a8['destcalleridname'],_0x2645a8['destcalleridnum'],_0x331dd9);})[_0x38db('0x2e')](function(_0x15bb0b){_0x46cb8a=_0x15bb0b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x46cb8a['id']);return getTicket(_0x241c6f,_0xb14211,_0x46cb8a,_0x2f0711,_0x2645a8,_0x2f0711[_0x38db('0x61')],_0x331dd9,_0x38db('0x73'));})['then'](function(_0x10ddb8){_0x51afb3=_0x10ddb8;logger[_0x38db('0x32')]('Ticket\x20created!');logger[_0x38db('0x32')]('The\x20Ticket\x20ID\x20is:',_0x51afb3['id']);return setRelationship(_0x331dd9,_0xb14211,_0x51afb3,'users');})['then'](function(){return setRelationship(_0x331dd9,_0x46cb8a,_0x51afb3,'contacts');})['then'](function(){return getServerInfo(_0x331dd9);})[_0x38db('0x2e')](function(_0x42e8e4){var _0x41d367=parseInt(_0x42e8e4['version'][_0x38db('0x68')](0x0));var _0x25ef32=util['format'](_0x38db('0x69'),_0x241c6f[_0x38db('0x58')],_0x51afb3['id']);if(_0x41d367>0x6){_0x25ef32=util[_0x38db('0x2b')](_0x38db('0x6a'),_0x241c6f[_0x38db('0x58')],_0x51afb3['id']);}logger[_0x38db('0x32')](_0x38db('0x71'),_0x38db('0x74'));emit(util['format'](_0x38db('0x75'),_0x38fd0f[_0x38db('0xc')]),'trigger:browser:url',{'uri':_0x25ef32});})[_0x38db('0x76')](function(_0x489bdb){logger[_0x38db('0x6d')](_0x38db('0x71'),JSON[_0x38db('0x29')](_0x489bdb));});};exports['unmanaged']=function(_0x4f6e65,_0x50bbe3,_0x480061,_0x473771,_0x5ebaec,_0x1d146e){var _0x463c59,_0xf37366,_0x56ca00,_0x53d001;_0x1d146e[_0x38db('0x58')]=intUtil[_0x38db('0x57')](_0x1d146e[_0x38db('0x58')]);_0x1d146e[_0x38db('0x59')]=intUtil[_0x38db('0x57')](_0x1d146e[_0x38db('0x59')]);def[_0x38db('0x77')]=util[_0x38db('0x2b')](_0x38db('0x5a'),_0x1d146e[_0x38db('0x58')]);if(_0x5ebaec&&_0x5ebaec[_0x38db('0x78')]){logger['info']('['+_0x50bbe3[_0x38db('0x79')][_0x38db('0x7a')]()+']',_0x38db('0x72'));_0x50bbe3['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d146e[_0x38db('0x59')],_0x50bbe3['uniqueid'],md5(_0x50bbe3[_0x38db('0x5c')]));}else{_0x50bbe3['recordingURL']='';}return getConnection(_0x1d146e)[_0x38db('0x2e')](function(_0x40be21){_0x53d001=_0x40be21;if(!_['isNil'](_0x473771)){return getUser(_0x1d146e,_0x473771['name'],_0x53d001);}else{return getUser(_0x1d146e,null,_0x53d001);}})['then'](function(_0x56052a){_0x463c59=_0x56052a;logger['info'](_0x38db('0x5e'),_0x463c59['id']);return getEndUser(_0x1d146e,_0x50bbe3[_0x38db('0x7b')],_0x50bbe3['calleridnum'],_0x53d001);})[_0x38db('0x2e')](function(_0x50a67c){_0xf37366=_0x50a67c;logger[_0x38db('0x32')](_0x38db('0x60'),_0xf37366['id']);return getTicket(_0x1d146e,_0x463c59,_0xf37366,_0x480061,_0x50bbe3,_0x480061[_0x38db('0x61')],_0x53d001,_0x38db('0x62'));})[_0x38db('0x2e')](function(_0xbe6c5b){_0x56ca00=_0xbe6c5b;logger[_0x38db('0x32')](_0x38db('0x63'));logger[_0x38db('0x32')](_0x38db('0x64'),_0x56ca00['id']);return setRelationship(_0x53d001,_0x463c59,_0x56ca00,_0x38db('0x65'));})['then'](function(){return setRelationship(_0x53d001,_0xf37366,_0x56ca00,_0x38db('0x66'));})['then'](function(){return getServerInfo(_0x53d001);})[_0x38db('0x76')](function(_0x258dd5){logger[_0x38db('0x6d')]('['+_0x50bbe3[_0x38db('0x79')][_0x38db('0x7a')]()+']',JSON[_0x38db('0x29')](_0x258dd5));});}; \ No newline at end of file +var _0x2032=['queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','unmanaged','monitor_format','lastevent','Recording\x20is\x20enabled!','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','redis','socket.io-emitter','POST','info','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_name','name','direction','variableName','push','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','entry_list','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','then','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','length','forEach','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship'];(function(_0x36a24a,_0x6b584){var _0x3ed817=function(_0x12a381){while(--_0x12a381){_0x36a24a['push'](_0x36a24a['shift']());}};_0x3ed817(++_0x6b584);}(_0x2032,0xa1));var _0x2203=function(_0x3666e4,_0x546173){_0x3666e4=_0x3666e4-0x0;var _0x55761d=_0x2032[_0x3666e4];return _0x55761d;};'use strict';var _=require(_0x2203('0x0'));var rp=require(_0x2203('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x2203('0x2'));var Redis=require('ioredis');var intUtil=require(_0x2203('0x3'));var config=require(_0x2203('0x4'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x2203('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2203('0x6'))(new Redis(config['redis']));var def={'method':_0x2203('0x7'),'json':!![]};function emit(_0xb4d55b,_0x459d81,_0x4c512c){io['to'](_0xb4d55b)['emit'](_0x459d81,_0x4c512c);}function getTicket(_0x1ba455,_0x31690e,_0xb6fc9,_0x46e404,_0x405d1d,_0xb57377,_0x17308a,_0x2175ad){logger[_0x2203('0x8')]('Creating\x20new\x20ticket...');var _0x338164=new Date();var _0x328eb2=[{'name':'name','value':intUtil['getString'](_0x46e404[_0x2203('0x9')],_0x405d1d,'\x20')},{'name':_0x2203('0xa'),'value':_0x31690e['id']},{'name':'created_by','value':_0x31690e['id']},{'name':_0x2203('0xb'),'value':intUtil[_0x2203('0xc')](_0x46e404[_0x2203('0xd')],_0x405d1d,'\x0a')},{'name':_0x2203('0xe'),'value':_0x338164[_0x2203('0xf')]()['slice'](0x0,0x13)[_0x2203('0x10')]('T','\x20')},{'name':_0x2203('0x11'),'value':'0'},{'name':_0x2203('0x12'),'value':'15'},{'name':_0x2203('0x13'),'value':_0xb6fc9['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x2203('0x14'),'value':_0xb6fc9[_0x2203('0x15')]},{'name':_0x2203('0x16'),'value':_0x2175ad}];if(_0xb57377['length']){_['forEach'](_0xb57377,function(_0x388db6){if(_0x405d1d[_0x388db6[_0x2203('0x17')]]){_0x328eb2[_0x2203('0x18')]({'name':_0x388db6['idField'],'value':_0x405d1d[_0x388db6['variableName']]});}});}return request({'form':{'method':_0x2203('0x19'),'input_type':_0x2203('0x1a'),'response_type':_0x2203('0x1a'),'rest_data':JSON[_0x2203('0x1b')]({'session':_0x17308a['id'],'module_name':_0x2203('0x1c'),'name_value_list':_0x328eb2})}});}function getAuth(_0x32176d){return util['format'](_0x2203('0x1d'),new Buffer(_0x32176d[_0x2203('0x1e')]+':X')[_0x2203('0x1f')](_0x2203('0x20')));}function getServerInfo(_0x260a49){return request({'form':{'method':_0x2203('0x21'),'input_type':_0x2203('0x1a'),'response_type':_0x2203('0x1a'),'rest_data':JSON[_0x2203('0x1b')]({'session':_0x260a49['id']})}});}function getUser(_0x155a2b,_0x2f4c5f,_0x37b44b){if(!_[_0x2203('0x22')](_0x2f4c5f)){logger[_0x2203('0x8')](_0x2203('0x23'),_0x2f4c5f);return request({'form':{'method':_0x2203('0x24'),'input_type':_0x2203('0x1a'),'response_type':_0x2203('0x1a'),'rest_data':JSON[_0x2203('0x1b')]({'session':_0x37b44b['id'],'module_name':_0x2203('0x25'),'query':util[_0x2203('0x26')](_0x2203('0x27'),_0x2f4c5f),'order_by':'','offset':'0','select_fields':['id',_0x2203('0x15'),_0x2203('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x40ec60){if(_0x40ec60['entry_list']['length']){var _0x45d798=_[_0x2203('0x29')](_0x40ec60[_0x2203('0x2a')],function(_0x2b4c25){return _0x2b4c25['name_value_list']['user_name'][_0x2203('0x2b')]===_0x2f4c5f;});if(_0x45d798){logger[_0x2203('0x8')](_0x2203('0x2c'));return BPromise['resolve']({'id':_0x45d798[_0x2203('0x2d')]['id'][_0x2203('0x2b')],'name':_0x45d798[_0x2203('0x2d')][_0x2203('0x15')][_0x2203('0x2b')]});}}logger[_0x2203('0x8')](_0x2203('0x2e'));return BPromise[_0x2203('0x2f')]({'id':_0x37b44b[_0x2203('0x2d')][_0x2203('0x30')][_0x2203('0x2b')],'name':_0x37b44b['name_value_list']['user_name'][_0x2203('0x2b')]});});}else{logger[_0x2203('0x8')](_0x2203('0x31'));return BPromise[_0x2203('0x2f')]({'id':_0x37b44b['name_value_list'][_0x2203('0x30')][_0x2203('0x2b')],'name':_0x37b44b[_0x2203('0x2d')][_0x2203('0x28')][_0x2203('0x2b')]});}}function getEndUser(_0x57e23f,_0x454d1d,_0x5924fb,_0x50f628){logger[_0x2203('0x8')](_0x2203('0x32'),_0x5924fb);return request({'form':{'method':_0x2203('0x24'),'input_type':_0x2203('0x1a'),'response_type':_0x2203('0x1a'),'rest_data':JSON['stringify']({'session':_0x50f628['id'],'module_name':_0x2203('0x33'),'query':util[_0x2203('0x26')](_0x2203('0x34'),_0x5924fb),'order_by':'','offset':'0','select_fields':['id',_0x2203('0x15'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2203('0x35')](function(_0x195945){if(_0x195945[_0x2203('0x2a')]['length']){var _0x26e7d2=_[_0x2203('0x29')](_0x195945[_0x2203('0x2a')],function(_0x12344b){return _0x12344b['name_value_list'][_0x2203('0x36')][_0x2203('0x2b')]===_0x5924fb;});if(_0x26e7d2){logger['info'](_0x2203('0x37'));return BPromise[_0x2203('0x2f')]({'id':_0x26e7d2['name_value_list']['id']['value'],'name':_0x26e7d2[_0x2203('0x2d')]['name'][_0x2203('0x2b')],'phone':_0x26e7d2[_0x2203('0x2d')]['phone_home'][_0x2203('0x2b')]});}}else{logger[_0x2203('0x8')](_0x2203('0x38'));return request({'form':{'method':_0x2203('0x19'),'input_type':_0x2203('0x1a'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x50f628['id'],'module_name':_0x2203('0x33'),'name_value_list':[{'name':_0x2203('0x39'),'value':_0x454d1d!==_0x2203('0x3a')?_0x454d1d:util[_0x2203('0x26')](_0x2203('0x3b'),_0x5924fb)},{'name':_0x2203('0x36'),'value':_0x5924fb}]})}})[_0x2203('0x35')](function(_0x52761e){logger[_0x2203('0x8')](_0x2203('0x3c'));return BPromise[_0x2203('0x2f')]({'id':_0x52761e['id'],'name':_0x52761e[_0x2203('0x2a')][_0x2203('0x39')][_0x2203('0x2b')],'phone':_0x52761e[_0x2203('0x2a')]['phone_home'][_0x2203('0x2b')]});});}});}function request(_0xdea57b){logger[_0x2203('0x3d')](_0x2203('0x3e'),JSON[_0x2203('0x1b')](_0xdea57b));return rp(_[_0x2203('0x3f')](def,_0xdea57b));}function getTags(_0x3b69d0,_0x3b8d0f){var _0x3ded2c=[];if(_0x3b69d0&&_0x3b69d0['length']>0x0){_0x3ded2c=_[_0x2203('0x40')](_0x3b69d0,_0x3b8d0f);}return _0x3ded2c;}function getCustomFields(_0x27f661,_0x256724){var _0x3316dc=[];var _0x39b89d={'custom_fields':[]};if(_0x27f661[_0x2203('0x41')]>0x0){_[_0x2203('0x42')](_0x27f661,function(_0x3034b2){if(_0x3034b2[_0x2203('0x43')]===_0x2203('0x44')&&_0x3034b2[_0x2203('0x45')]&&!_0x3034b2['customField']){_0x39b89d[_0x3034b2[_0x2203('0x45')][_0x2203('0x46')]()]=_0x3034b2[_0x2203('0x47')][_0x2203('0x1f')]();}else if(_0x3034b2[_0x2203('0x43')]==='string'&&_0x3034b2[_0x2203('0x48')]&&_0x3034b2[_0x2203('0x49')]){_0x39b89d[_0x2203('0x4a')][_0x2203('0x18')]({'id':_0x3034b2[_0x2203('0x48')],'value':_0x3034b2[_0x2203('0x47')]['toString']()});}else if(_0x3034b2['type']===_0x2203('0x4b')&&_0x3034b2['variableName']&&_0x3034b2[_0x2203('0x48')]&&_0x3034b2[_0x2203('0x49')]){_0x256724[_0x3034b2['variableName']]&&_0x39b89d['custom_fields'][_0x2203('0x18')]({'id':_0x3034b2[_0x2203('0x48')],'value':_0x256724[_0x3034b2[_0x2203('0x17')]][_0x2203('0x1f')]()});}else if(_0x3034b2[_0x2203('0x43')]===_0x2203('0x4c')&&_0x3034b2[_0x2203('0x4d')]&&_0x3034b2[_0x2203('0x4d')][_0x2203('0x15')]&&_0x3034b2[_0x2203('0x48')]&&_0x3034b2[_0x2203('0x49')]){_0x256724[_0x3034b2[_0x2203('0x4d')][_0x2203('0x15')][_0x2203('0x46')]()]&&_0x39b89d['custom_fields'][_0x2203('0x18')]({'id':_0x3034b2[_0x2203('0x48')],'value':_0x256724[_0x3034b2['Variable'][_0x2203('0x15')][_0x2203('0x46')]()][_0x2203('0x1f')]()});}});}return _0x39b89d;}function getConnection(_0x500f35){return request({'method':_0x2203('0x7'),'form':{'method':_0x2203('0x4e'),'input_type':_0x2203('0x1a'),'response_type':'JSON','rest_data':JSON[_0x2203('0x1b')]({'user_auth':{'user_name':_0x500f35[_0x2203('0x4f')],'password':_0x500f35[_0x2203('0x50')],'encryption':_0x2203('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x2203('0x35')](function(_0x3a4d1d){var _0x5a6489=_0x3a4d1d;if(_0x5a6489['id']){def[_0x2203('0x52')]=_0x5a6489['id'];return BPromise['resolve'](_0x5a6489);}else{throw new Error(util[_0x2203('0x26')](_0x2203('0x53'),_0x500f35['id']));}});}function setRelationship(_0x367563,_0x509e3c,_0x9d0feb,_0x4a92b6){return request({'form':{'method':_0x2203('0x54'),'input_type':'JSON','response_type':_0x2203('0x1a'),'rest_data':JSON[_0x2203('0x1b')]({'session':_0x367563['id'],'module_name':_0x2203('0x1c'),'module_id':_0x9d0feb['id'],'link_field_name':_0x4a92b6,'related_ids':[_0x509e3c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2203('0x55')]=function(_0xd4082f,_0x1af8b1,_0xeef3ab,_0xb1e01a,_0x2eb7c8,_0x4e82d4){var _0x4383d5,_0x2c4e3e,_0x344e4b,_0x30893f;_0x4e82d4[_0x2203('0x56')]=intUtil[_0x2203('0x57')](_0x4e82d4[_0x2203('0x56')]);_0x4e82d4[_0x2203('0x58')]=intUtil[_0x2203('0x57')](_0x4e82d4[_0x2203('0x58')]);def[_0x2203('0x59')]=util['format'](_0x2203('0x5a'),_0x4e82d4[_0x2203('0x56')]);if(_0x2eb7c8&&_0x2eb7c8['monitor_format']){logger[_0x2203('0x8')](_0x2203('0x5b'),'Recording\x20is\x20enabled!');_0x1af8b1[_0x2203('0x5c')]=util[_0x2203('0x26')](_0x2203('0x5d'),_0x4e82d4[_0x2203('0x58')],_0x1af8b1['uniqueid'],md5(_0x1af8b1[_0x2203('0x5e')]));}else{_0x1af8b1[_0x2203('0x5c')]='';}return getConnection(_0x4e82d4)[_0x2203('0x35')](function(_0x235942){_0x30893f=_0x235942;return getUser(_0x4e82d4,_0xb1e01a[_0x2203('0x15')],_0x30893f);})['then'](function(_0x3a878b){_0x4383d5=_0x3a878b;logger[_0x2203('0x8')](_0x2203('0x5f'),_0x4383d5['id']);return getEndUser(_0x4e82d4,_0x1af8b1[_0x2203('0x60')],_0x1af8b1['calleridnum'],_0x30893f);})[_0x2203('0x35')](function(_0x213627){_0x2c4e3e=_0x213627;logger[_0x2203('0x8')]('The\x20Enduser\x20ID\x20is:',_0x2c4e3e['id']);return getTicket(_0x4e82d4,_0x4383d5,_0x2c4e3e,_0xeef3ab,_0x1af8b1,_0xeef3ab[_0x2203('0x61')],_0x30893f,'Inbound');})[_0x2203('0x35')](function(_0x4d6f54){_0x344e4b=_0x4d6f54;logger[_0x2203('0x8')](_0x2203('0x62'));logger[_0x2203('0x8')]('The\x20Ticket\x20ID\x20is:',_0x344e4b['id']);return setRelationship(_0x30893f,_0x4383d5,_0x344e4b,_0x2203('0x63'));})[_0x2203('0x35')](function(){return setRelationship(_0x30893f,_0x2c4e3e,_0x344e4b,_0x2203('0x64'));})['then'](function(){return getServerInfo(_0x30893f);})['then'](function(_0x76430b){var _0x2e2975=parseInt(_0x76430b[_0x2203('0x65')][_0x2203('0x66')](0x0));var _0x56da30=util[_0x2203('0x26')](_0x2203('0x67'),_0x4e82d4['remoteUri'],_0x344e4b['id']);if(_0x2e2975>0x6){_0x56da30=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4e82d4[_0x2203('0x56')],_0x344e4b['id']);}logger[_0x2203('0x8')]('[QUEUE]',_0x2203('0x68'));emit(util[_0x2203('0x26')](_0x2203('0x69'),_0xb1e01a[_0x2203('0x15')]),_0x2203('0x6a'),{'uri':_0x56da30});})[_0x2203('0x6b')](function(_0x229285){logger[_0x2203('0x6c')]('[QUEUE]',JSON[_0x2203('0x1b')](_0x229285));});};exports['outbound']=function(_0xd872cd,_0x5b0caa,_0x552151,_0x27c6ee,_0x55b558,_0x5c8ba3,_0x247dad){var _0x3194cd,_0xfd3a98,_0x55b921,_0x26fcd9;_0x5c8ba3[_0x2203('0x56')]=intUtil[_0x2203('0x57')](_0x5c8ba3[_0x2203('0x56')]);_0x5c8ba3[_0x2203('0x58')]=intUtil['stripTrailingSlash'](_0x5c8ba3[_0x2203('0x58')]);def[_0x2203('0x59')]=util[_0x2203('0x26')](_0x2203('0x5a'),_0x5c8ba3['remoteUri']);if(_0x247dad&&_0x247dad[_0x2203('0x6d')]&&_0x247dad[_0x2203('0x6d')]!==_0x2203('0x6e')){logger[_0x2203('0x8')](_0x2203('0x6f'),'Recording\x20is\x20enabled!');_0x5b0caa[_0x2203('0x5c')]=util[_0x2203('0x26')](_0x2203('0x5d'),_0x5c8ba3[_0x2203('0x58')],_0x5b0caa['uniqueid'],md5(_0x5b0caa[_0x2203('0x5e')]));}return getConnection(_0x5c8ba3)[_0x2203('0x35')](function(_0x37e211){_0x26fcd9=_0x37e211;return getUser(_0x5c8ba3,_0x27c6ee[_0x2203('0x15')],_0x26fcd9);})[_0x2203('0x35')](function(_0x4ae6a1){_0x3194cd=_0x4ae6a1;logger[_0x2203('0x8')](_0x2203('0x5f'),_0x3194cd['id']);return getEndUser(_0x5c8ba3,_0x5b0caa['destcalleridname'],_0x5b0caa[_0x2203('0x70')],_0x26fcd9);})[_0x2203('0x35')](function(_0x190524){_0xfd3a98=_0x190524;logger[_0x2203('0x8')]('The\x20Enduser\x20ID\x20is:',_0xfd3a98['id']);return getTicket(_0x5c8ba3,_0x3194cd,_0xfd3a98,_0x552151,_0x5b0caa,_0x552151[_0x2203('0x61')],_0x26fcd9,_0x2203('0x71'));})[_0x2203('0x35')](function(_0x543657){_0x55b921=_0x543657;logger[_0x2203('0x8')](_0x2203('0x62'));logger[_0x2203('0x8')](_0x2203('0x72'),_0x55b921['id']);return setRelationship(_0x26fcd9,_0x3194cd,_0x55b921,_0x2203('0x63'));})[_0x2203('0x35')](function(){return setRelationship(_0x26fcd9,_0xfd3a98,_0x55b921,_0x2203('0x64'));})[_0x2203('0x35')](function(){return getServerInfo(_0x26fcd9);})[_0x2203('0x35')](function(_0xbb9c5d){var _0x4fe2d6=parseInt(_0xbb9c5d[_0x2203('0x65')][_0x2203('0x66')](0x0));var _0x28e7a9=util[_0x2203('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5c8ba3['remoteUri'],_0x55b921['id']);if(_0x4fe2d6>0x6){_0x28e7a9=util[_0x2203('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5c8ba3['remoteUri'],_0x55b921['id']);}logger[_0x2203('0x8')](_0x2203('0x6f'),_0x2203('0x68'));emit(util[_0x2203('0x26')](_0x2203('0x69'),_0x27c6ee[_0x2203('0x15')]),'trigger:browser:url',{'uri':_0x28e7a9});})[_0x2203('0x6b')](function(_0x17ac81){logger[_0x2203('0x6c')](_0x2203('0x6f'),JSON[_0x2203('0x1b')](_0x17ac81));});};exports[_0x2203('0x73')]=function(_0x5aaa97,_0x48c735,_0x61e83e,_0x58f962,_0x4f4882,_0x1b5802){var _0x5bf5ed,_0x217362,_0x2b37a1,_0x11b96f;_0x1b5802[_0x2203('0x56')]=intUtil[_0x2203('0x57')](_0x1b5802['remoteUri']);_0x1b5802[_0x2203('0x58')]=intUtil[_0x2203('0x57')](_0x1b5802[_0x2203('0x58')]);def[_0x2203('0x59')]=util['format'](_0x2203('0x5a'),_0x1b5802[_0x2203('0x56')]);if(_0x4f4882&&_0x4f4882[_0x2203('0x74')]){logger[_0x2203('0x8')]('['+_0x48c735[_0x2203('0x75')]['toUpperCase']()+']',_0x2203('0x76'));_0x48c735['recordingURL']=util['format'](_0x2203('0x5d'),_0x1b5802['serverUrl'],_0x48c735[_0x2203('0x5e')],md5(_0x48c735[_0x2203('0x5e')]));}else{_0x48c735['recordingURL']='';}return getConnection(_0x1b5802)['then'](function(_0xf25c60){_0x11b96f=_0xf25c60;if(!_[_0x2203('0x22')](_0x58f962)){return getUser(_0x1b5802,_0x58f962['name'],_0x11b96f);}else{return getUser(_0x1b5802,null,_0x11b96f);}})[_0x2203('0x35')](function(_0x45cd9a){_0x5bf5ed=_0x45cd9a;logger['info'](_0x2203('0x5f'),_0x5bf5ed['id']);return getEndUser(_0x1b5802,_0x48c735[_0x2203('0x60')],_0x48c735[_0x2203('0x77')],_0x11b96f);})[_0x2203('0x35')](function(_0x10c839){_0x217362=_0x10c839;logger[_0x2203('0x8')](_0x2203('0x78'),_0x217362['id']);return getTicket(_0x1b5802,_0x5bf5ed,_0x217362,_0x61e83e,_0x48c735,_0x61e83e[_0x2203('0x61')],_0x11b96f,_0x2203('0x79'));})[_0x2203('0x35')](function(_0x10a259){_0x2b37a1=_0x10a259;logger[_0x2203('0x8')](_0x2203('0x62'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2b37a1['id']);return setRelationship(_0x11b96f,_0x5bf5ed,_0x2b37a1,_0x2203('0x63'));})[_0x2203('0x35')](function(){return setRelationship(_0x11b96f,_0x217362,_0x2b37a1,'contacts');})[_0x2203('0x35')](function(){return getServerInfo(_0x11b96f);})[_0x2203('0x6b')](function(_0x2d3d6a){logger[_0x2203('0x6c')]('['+_0x48c735['lastevent'][_0x2203('0x7a')]()+']',JSON[_0x2203('0x1b')](_0x2d3d6a));});}; \ 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 c3284b0..0fb0e3b 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 _0x3a6b=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','sortBy','length','string','push','content','type','variable','variableName','toString'];(function(_0x52de74,_0x152687){var _0x33113e=function(_0x182424){while(--_0x182424){_0x52de74['push'](_0x52de74['shift']());}};_0x33113e(++_0x152687);}(_0x3a6b,0x128));var _0xb3a6=function(_0x4b0391,_0x53cd78){_0x4b0391=_0x4b0391-0x0;var _0x1280a5=_0x3a6b[_0x4b0391];return _0x1280a5;};'use strict';var _=require(_0xb3a6('0x0'));var util=require(_0xb3a6('0x1'));exports[_0xb3a6('0x2')]=function(_0x4721ea,_0x24f611,_0x6bcf19){var _0x269c03=[];if(_0x4721ea['length']>0x0){var _0x21038a=_[_0xb3a6('0x3')](_0x4721ea,['id']);for(var _0x4df8f8=0x0;_0x4df8f8<_0x21038a[_0xb3a6('0x4')];_0x4df8f8++){var _0x1b8114=_0x21038a[_0x4df8f8];if(_0x1b8114['type']===_0xb3a6('0x5')){_0x269c03[_0xb3a6('0x6')](_0x1b8114[_0xb3a6('0x7')]);}else if(_0x1b8114[_0xb3a6('0x8')]===_0xb3a6('0x9')&&_0x1b8114[_0xb3a6('0xa')]){_0x24f611[_0x1b8114[_0xb3a6('0xa')]]&&_0x269c03[_0xb3a6('0x6')](_0x24f611[_0x1b8114[_0xb3a6('0xa')]][_0xb3a6('0xb')]());}else if(_0x1b8114['type']===_0xb3a6('0xc')&&_0x1b8114[_0xb3a6('0xd')]&&_0x1b8114['Variable'][_0xb3a6('0xe')]){_0x24f611[_0x1b8114[_0xb3a6('0xd')][_0xb3a6('0xe')]['toLowerCase']()]&&_0x269c03['push'](_0x24f611[_0x1b8114[_0xb3a6('0xd')][_0xb3a6('0xe')][_0xb3a6('0xf')]()][_0xb3a6('0xb')]());}else if(_0x1b8114[_0xb3a6('0x8')]===_0xb3a6('0x10')){if(_0x1b8114[_0xb3a6('0x11')]===_0xb3a6('0x5')&&_0x1b8114[_0xb3a6('0x12')]){_0x269c03[_0xb3a6('0x6')](util['format']('%s:\x20%s',_0x1b8114[_0xb3a6('0x12')],_0x1b8114['keyContent']));}else if(_0x1b8114[_0xb3a6('0x11')]===_0xb3a6('0x9')&&_0x1b8114['variableName']&&_0x1b8114[_0xb3a6('0x12')]){_0x24f611[_0x1b8114[_0xb3a6('0xa')]]&&_0x269c03['push'](util[_0xb3a6('0x13')](_0xb3a6('0x14'),_0x1b8114[_0xb3a6('0x12')],_0x24f611[_0x1b8114[_0xb3a6('0xa')]]));}else if(_0x1b8114[_0xb3a6('0x11')]==='customVariable'&&_0x1b8114[_0xb3a6('0xd')]&&_0x1b8114[_0xb3a6('0xd')][_0xb3a6('0xe')]&&_0x1b8114[_0xb3a6('0x12')]){_0x24f611[_0x1b8114[_0xb3a6('0xd')][_0xb3a6('0xe')]['toLowerCase']()]&&_0x269c03['push'](util[_0xb3a6('0x13')](_0xb3a6('0x14'),_0x1b8114['key'],_0x24f611[_0x1b8114[_0xb3a6('0xd')][_0xb3a6('0xe')][_0xb3a6('0xf')]()]));}}}}return _0x269c03[_0xb3a6('0x15')](_0x6bcf19);};exports[_0xb3a6('0x16')]=function(_0x5b67bd){var _0x27abd1=_0x5b67bd[_0xb3a6('0x17')](-0x1);if(_0x27abd1==='/'){_0x5b67bd=_0x5b67bd[_0xb3a6('0x18')](0x0,_0x5b67bd['lastIndexOf'](_0x27abd1));}return _0x5b67bd;};exports[_0xb3a6('0x19')]=function(_0x16611a){if(!_[_0xb3a6('0x1a')](_0x16611a)&&_0x16611a!==''){var _0x21a407=/^(([^<>()\[\]\\.,;:\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 _0x21a407[_0xb3a6('0x1b')](String(_0x16611a)[_0xb3a6('0xf')]());}else{return![];}}; \ No newline at end of file +var _0xf874=['format','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xf874,0x191));var _0x4f87=function(_0x3ae2b9,_0x378d82){_0x3ae2b9=_0x3ae2b9-0x0;var _0x23bd8e=_0xf874[_0x3ae2b9];return _0x23bd8e;};'use strict';var _=require(_0x4f87('0x0'));var util=require(_0x4f87('0x1'));exports[_0x4f87('0x2')]=function(_0x31deff,_0xeb0524,_0x2f0c6c){var _0x5eefca=[];if(_0x31deff[_0x4f87('0x3')]>0x0){var _0x2fad77=_[_0x4f87('0x4')](_0x31deff,['id']);for(var _0x376bf2=0x0;_0x376bf2<_0x2fad77[_0x4f87('0x3')];_0x376bf2++){var _0x23951b=_0x2fad77[_0x376bf2];if(_0x23951b[_0x4f87('0x5')]===_0x4f87('0x6')){_0x5eefca['push'](_0x23951b[_0x4f87('0x7')]);}else if(_0x23951b[_0x4f87('0x5')]===_0x4f87('0x8')&&_0x23951b['variableName']){_0xeb0524[_0x23951b[_0x4f87('0x9')]]&&_0x5eefca[_0x4f87('0xa')](_0xeb0524[_0x23951b[_0x4f87('0x9')]][_0x4f87('0xb')]());}else if(_0x23951b['type']===_0x4f87('0xc')&&_0x23951b[_0x4f87('0xd')]&&_0x23951b[_0x4f87('0xd')]['name']){_0xeb0524[_0x23951b[_0x4f87('0xd')][_0x4f87('0xe')][_0x4f87('0xf')]()]&&_0x5eefca[_0x4f87('0xa')](_0xeb0524[_0x23951b['Variable']['name'][_0x4f87('0xf')]()][_0x4f87('0xb')]());}else if(_0x23951b[_0x4f87('0x5')]===_0x4f87('0x10')){if(_0x23951b[_0x4f87('0x11')]===_0x4f87('0x6')&&_0x23951b[_0x4f87('0x12')]){_0x5eefca['push'](util[_0x4f87('0x13')](_0x4f87('0x14'),_0x23951b[_0x4f87('0x12')],_0x23951b['keyContent']));}else if(_0x23951b[_0x4f87('0x11')]==='variable'&&_0x23951b[_0x4f87('0x9')]&&_0x23951b['key']){_0xeb0524[_0x23951b[_0x4f87('0x9')]]&&_0x5eefca[_0x4f87('0xa')](util[_0x4f87('0x13')](_0x4f87('0x14'),_0x23951b[_0x4f87('0x12')],_0xeb0524[_0x23951b[_0x4f87('0x9')]]));}else if(_0x23951b[_0x4f87('0x11')]===_0x4f87('0xc')&&_0x23951b[_0x4f87('0xd')]&&_0x23951b['Variable']['name']&&_0x23951b[_0x4f87('0x12')]){_0xeb0524[_0x23951b['Variable'][_0x4f87('0xe')][_0x4f87('0xf')]()]&&_0x5eefca[_0x4f87('0xa')](util['format']('%s:\x20%s',_0x23951b[_0x4f87('0x12')],_0xeb0524[_0x23951b[_0x4f87('0xd')][_0x4f87('0xe')][_0x4f87('0xf')]()]));}}}}return _0x5eefca[_0x4f87('0x15')](_0x2f0c6c);};exports[_0x4f87('0x16')]=function(_0x2a52b4){var _0x47f348=_0x2a52b4['slice'](-0x1);if(_0x47f348==='/'){_0x2a52b4=_0x2a52b4[_0x4f87('0x17')](0x0,_0x2a52b4[_0x4f87('0x18')](_0x47f348));}return _0x2a52b4;};exports[_0x4f87('0x19')]=function(_0xb56920){if(!_[_0x4f87('0x1a')](_0xb56920)&&_0xb56920!==''){var _0x500674=/^(([^<>()\[\]\\.,;:\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 _0x500674[_0x4f87('0x1b')](String(_0xb56920)[_0x4f87('0xf')]());}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 1cf61b0..d14d1ac 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x332005,_0x24edf1){var _0x4393e1=function(_0x352f93){while(--_0x352f93){_0x332005['push'](_0x332005['shift']());}};_0x4393e1(++_0x24edf1);}(_0xe706,0xa3));var _0x6e70=function(_0x469850,_0x3357a1){_0x469850=_0x469850-0x0;var _0x326907=_0xe706[_0x469850];return _0x326907;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0xae86b9,_0x444315){var _0x405441=function(_0x472caa){while(--_0x472caa){_0xae86b9['push'](_0xae86b9['shift']());}};_0x405441(++_0x444315);}(_0x34e8,0x12c));var _0x834e=function(_0x4c0928,_0x307312){_0x4c0928=_0x4c0928-0x0;var _0x23f4f5=_0x34e8[_0x4c0928];return _0x23f4f5;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index aacb2fe..e01f384 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 _0x3840=['defaults','localhost','socket.io-emitter','application/json','info','format','remoteUri','POST','name','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','%s:%s','username','password','%s/token:%s','Basic\x20%s','debug','stringify','map','forEach','includes','string','nameField','customField','toLowerCase','content','toString','picklist','type','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','lodash','request-promise','util','ioredis','./util','zendesk','redis'];(function(_0x49cd43,_0x2eb968){var _0x7c8a12=function(_0x3e0ff4){while(--_0x3e0ff4){_0x49cd43['push'](_0x49cd43['shift']());}};_0x7c8a12(++_0x2eb968);}(_0x3840,0x199));var _0x0384=function(_0x4f08c8,_0x160316){_0x4f08c8=_0x4f08c8-0x0;var _0x304fd6=_0x3840[_0x4f08c8];return _0x304fd6;};'use strict';var _=require(_0x0384('0x0'));var rp=require(_0x0384('0x1'));var md5=require('md5');var util=require(_0x0384('0x2'));var Redis=require(_0x0384('0x3'));var intUtil=require(_0x0384('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x0384('0x5'));config[_0x0384('0x6')]=_[_0x0384('0x7')](config[_0x0384('0x6')],{'host':_0x0384('0x8'),'port':0x18eb});var io=require(_0x0384('0x9'))(new Redis(config[_0x0384('0x6')]));function emit(_0x4a5fab,_0x1a5cb6,_0xd2d1cd){io['to'](_0x4a5fab)['emit'](_0x1a5cb6,_0xd2d1cd);}var headers={'Content-Type':_0x0384('0xa'),'Accept':'application/json'};function getTicket(_0x18a6e5,_0x54e282,_0x4f0851,_0x1e7d45,_0x1240f2){logger[_0x0384('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x0384('0xc')]('%s/tickets.json',_0x18a6e5[_0x0384('0xd')]),'method':_0x0384('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x4f0851['id'],'submitter_id':_0x54e282?_0x54e282['id']:undefined,'assignee_id':_0x54e282?_0x54e282['id']:undefined,'tags':getTags(_0x1e7d45['Tags'],_0x0384('0xf')),'subject':intUtil[_0x0384('0x10')](_0x1e7d45['Subjects'],_0x1240f2,'\x20'),'description':intUtil['getString'](_0x1e7d45[_0x0384('0x11')],_0x1240f2,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0384('0x10')](_0x1e7d45[_0x0384('0x11')],_0x1240f2,'\x0a')}},getCustomFields(_0x1e7d45['Fields'],_0x1240f2))}})[_0x0384('0x12')](function(_0x3b6c52){logger[_0x0384('0xb')](_0x0384('0x13'));return _0x3b6c52[_0x0384('0x14')];});}function getUser(_0x4f3109,_0x28c92e){if(intUtil[_0x0384('0x15')](_0x28c92e)){logger['info'](_0x0384('0x16'),_0x28c92e);return request({'uri':util[_0x0384('0xc')](_0x0384('0x17'),_0x4f3109[_0x0384('0xd')]),'qs':{'query':util[_0x0384('0xc')](_0x0384('0x18'),_0x28c92e)}})[_0x0384('0x12')](function(_0x108b07){if(_0x108b07[_0x0384('0x19')]){logger[_0x0384('0xb')]('Agent\x20found!');return _[_0x0384('0x1a')](_0x108b07[_0x0384('0x1b')],{'email':_0x28c92e,'role':_0x0384('0x1c')});}else{logger[_0x0384('0xb')](_0x0384('0x1d'));return request({'uri':util[_0x0384('0xc')]('%s/users/me.json',_0x4f3109['remoteUri'])})['then'](function(_0x3a0f90){logger[_0x0384('0xb')](_0x0384('0x1e'));return _0x3a0f90['user'];});}});}else{logger[_0x0384('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0384('0xc')](_0x0384('0x1f'),_0x4f3109[_0x0384('0xd')])})[_0x0384('0x12')](function(_0x494373){logger[_0x0384('0xb')](_0x0384('0x1e'));return _0x494373[_0x0384('0x20')];});}}function getEndUser(_0xb6ab53,_0x156a8c,_0x38d927){logger['info']('Searching\x20enduser\x20with\x20phone',_0x38d927);return request({'uri':util['format'](_0x0384('0x17'),_0xb6ab53[_0x0384('0xd')]),'qs':{'query':util[_0x0384('0xc')](_0x0384('0x21'),_0x38d927)}})[_0x0384('0x12')](function(_0x130f10){var _0x5bc349;if(_0x130f10[_0x0384('0x1b')][_0x0384('0x22')]){_0x130f10[_0x0384('0x1b')]=_['filter'](_0x130f10[_0x0384('0x1b')],{'suspended':![],'role':_0x0384('0x23')});if(_0x130f10['results'][_0x0384('0x22')]){_0x5bc349=_[_0x0384('0x24')](_0x130f10[_0x0384('0x1b')]);}}if(_0x5bc349){logger[_0x0384('0xb')]('Enduser\x20found!');return _0x5bc349;}else{logger[_0x0384('0xb')](_0x0384('0x25'));return request({'uri':util[_0x0384('0xc')](_0x0384('0x26'),_0xb6ab53[_0x0384('0xd')]),'method':_0x0384('0xe'),'body':{'user':{'role':_0x0384('0x23'),'name':util[_0x0384('0xc')]('Caller\x20-\x20%s',_0x156a8c||_0x38d927),'phone':_0x38d927}}})[_0x0384('0x12')](function(_0x114bef){logger[_0x0384('0xb')]('Enduser\x20created.');return _0x114bef[_0x0384('0x20')];});}});}function getAuth(_0xcf471b){var _0x4502b5;if(_0xcf471b[_0x0384('0x27')]==='password'){_0x4502b5=util[_0x0384('0xc')](_0x0384('0x28'),_0xcf471b[_0x0384('0x29')],_0xcf471b[_0x0384('0x2a')]);}else if(_0xcf471b['authType']==='token'){_0x4502b5=util[_0x0384('0xc')](_0x0384('0x2b'),_0xcf471b[_0x0384('0x29')],_0xcf471b['token']);}return util['format'](_0x0384('0x2c'),new Buffer(_0x4502b5)['toString']('base64'));}function request(_0x42139a){logger[_0x0384('0x2d')]('[HTTP]',JSON[_0x0384('0x2e')](_0x42139a));return rp(_[_0x0384('0x7')](_0x42139a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x287acd,_0x1f08fa){var _0x288b64=[];if(_0x287acd&&_0x287acd[_0x0384('0x22')]>0x0){_0x288b64=_[_0x0384('0x2f')](_0x287acd,_0x1f08fa);}return _0x288b64;}function getCustomFields(_0x15b5d6,_0x3d8806){var _0xf82769=[];var _0x4717ec={'custom_fields':[]};if(_0x15b5d6[_0x0384('0x22')]>0x0){_[_0x0384('0x30')](_0x15b5d6,function(_0x10c26a){if(_[_0x0384('0x31')]([_0x0384('0x32'),'picklist'],_0x10c26a['type'])&&_0x10c26a[_0x0384('0x33')]&&!_0x10c26a[_0x0384('0x34')]){_0x4717ec[_0x10c26a['nameField'][_0x0384('0x35')]()]=_0x10c26a[_0x0384('0x36')][_0x0384('0x37')]();}else if(_[_0x0384('0x31')]([_0x0384('0x32'),_0x0384('0x38')],_0x10c26a[_0x0384('0x39')])&&_0x10c26a[_0x0384('0x3a')]&&_0x10c26a[_0x0384('0x34')]){_0x4717ec[_0x0384('0x3b')]['push']({'id':_0x10c26a['idField'],'value':_0x10c26a['content'][_0x0384('0x37')]()});}else if(_0x10c26a[_0x0384('0x39')]===_0x0384('0x3c')&&_0x10c26a[_0x0384('0x3d')]&&_0x10c26a[_0x0384('0x3a')]&&_0x10c26a[_0x0384('0x34')]){_0x3d8806[_0x10c26a['variableName']]&&_0x4717ec['custom_fields'][_0x0384('0x3e')]({'id':_0x10c26a['idField'],'value':_0x3d8806[_0x10c26a['variableName']]['toString']()});}else if(_0x10c26a['type']===_0x0384('0x3f')&&_0x10c26a['Variable']&&_0x10c26a[_0x0384('0x40')][_0x0384('0xf')]&&_0x10c26a['idField']&&_0x10c26a[_0x0384('0x34')]){_0x3d8806[_0x10c26a[_0x0384('0x40')]['name'][_0x0384('0x35')]()]&&_0x4717ec[_0x0384('0x3b')][_0x0384('0x3e')]({'id':_0x10c26a['idField'],'value':_0x3d8806[_0x10c26a[_0x0384('0x40')]['name'][_0x0384('0x35')]()][_0x0384('0x37')]()});}});}return _0x4717ec;}exports[_0x0384('0x41')]=function(_0x48a32f,_0x50ce48,_0x535feb,_0x5989e8,_0x300a44,_0xd52a2d){var _0x3c9adf,_0x1fb4b5;_0xd52a2d[_0x0384('0xd')]=intUtil['stripTrailingSlash'](_0xd52a2d[_0x0384('0xd')]);_0xd52a2d[_0x0384('0x42')]=intUtil[_0x0384('0x43')](_0xd52a2d['serverUrl']);if(_0x300a44&&_0x300a44['monitor_format']){logger[_0x0384('0xb')]('[QUEUE]',_0x0384('0x44'));_0x50ce48[_0x0384('0x45')]=util[_0x0384('0xc')](_0x0384('0x46'),_0xd52a2d[_0x0384('0x42')],_0x50ce48[_0x0384('0x47')],md5(_0x50ce48[_0x0384('0x47')]));}else{_0x50ce48[_0x0384('0x45')]='';}headers['Authorization']=getAuth(_0xd52a2d);return getUser(_0xd52a2d,_0x5989e8[_0x0384('0x48')])[_0x0384('0x12')](function(_0x4e5d55){_0x3c9adf=_0x4e5d55;logger[_0x0384('0xb')](_0x0384('0x49'),_0x3c9adf['id']);return getEndUser(_0xd52a2d,_0x50ce48[_0x0384('0x4a')],_0x50ce48[_0x0384('0x4b')]);})['then'](function(_0x522256){_0x1fb4b5=_0x522256;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1fb4b5['id']);return getTicket(_0xd52a2d,_0x3c9adf,_0x1fb4b5,_0x535feb,_0x50ce48);})[_0x0384('0x12')](function(_0x264c09){if(_0x264c09){logger['info'](_0x0384('0x4c'),_0x264c09['id']);switch(_0xd52a2d[_0x0384('0x39')]){case _0x0384('0x4d'):logger[_0x0384('0xb')]('[QUEUE]',_0x0384('0x4e'));return request({'uri':util[_0x0384('0xc')](_0x0384('0x4f'),_0xd52a2d[_0x0384('0xd')],_0x3c9adf['id'],_0x264c09['id']),'method':_0x0384('0xe')});case'newTab':logger[_0x0384('0xb')](_0x0384('0x50'),_0x0384('0x51'));emit(util[_0x0384('0xc')]('user:%s',_0x5989e8[_0x0384('0xf')]),_0x0384('0x52'),{'uri':util['format']('%s/agent/tickets/%s',_0xd52a2d[_0x0384('0xd')]['replace'](_0x0384('0x53'),''),_0x264c09['id'])});break;default:logger[_0x0384('0x54')](_0x0384('0x50'),_0x0384('0x55'));}}})[_0x0384('0x56')](function(_0x436e6c){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0384('0x57')](_0x436e6c,{'showHidden':!![],'depth':null}));});};exports[_0x0384('0x58')]=function(_0x35e5af,_0x5eb9a2,_0x566ac3,_0x1fdb5b,_0xb4c90d,_0x16a277,_0xca43cb){var _0x1b85a2,_0x2dcaea;_0x16a277['remoteUri']=intUtil['stripTrailingSlash'](_0x16a277['remoteUri']);_0x16a277[_0x0384('0x42')]=intUtil[_0x0384('0x43')](_0x16a277[_0x0384('0x42')]);if(_0xca43cb&&_0xca43cb[_0x0384('0x59')]&&_0xca43cb[_0x0384('0x59')]!==_0x0384('0x5a')){logger['info'](_0x0384('0x5b'),_0x0384('0x44'));_0x5eb9a2[_0x0384('0x45')]=util[_0x0384('0xc')](_0x0384('0x46'),_0x16a277['serverUrl'],_0x5eb9a2[_0x0384('0x47')],md5(_0x5eb9a2['uniqueid']));}headers['Authorization']=getAuth(_0x16a277);return getUser(_0x16a277,_0x1fdb5b[_0x0384('0x48')])[_0x0384('0x12')](function(_0x1c69c8){_0x1b85a2=_0x1c69c8;logger['info'](_0x0384('0x49'),_0x1b85a2['id']);return getEndUser(_0x16a277,_0x5eb9a2[_0x0384('0x5c')],_0x5eb9a2[_0x0384('0x5d')]);})['then'](function(_0x37cc9b){_0x2dcaea=_0x37cc9b;logger[_0x0384('0xb')](_0x0384('0x5e'),_0x2dcaea['id']);return getTicket(_0x16a277,_0x1b85a2,_0x2dcaea,_0x566ac3,_0x5eb9a2);})[_0x0384('0x12')](function(_0x4206ee){if(_0x4206ee){logger[_0x0384('0xb')](_0x0384('0x4c'),_0x4206ee['id']);switch(_0x16a277[_0x0384('0x39')]){case _0x0384('0x4d'):logger[_0x0384('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x0384('0x4f'),_0x16a277['remoteUri'],_0x1b85a2['id'],_0x4206ee['id']),'method':_0x0384('0xe')});case'newTab':logger[_0x0384('0xb')](_0x0384('0x5b'),_0x0384('0x51'));emit(util[_0x0384('0xc')](_0x0384('0x5f'),_0x1fdb5b[_0x0384('0xf')]),'trigger:browser:url',{'uri':util[_0x0384('0xc')](_0x0384('0x60'),_0x16a277[_0x0384('0xd')][_0x0384('0x61')](_0x0384('0x53'),''),_0x4206ee['id'])});break;default:logger[_0x0384('0x54')](_0x0384('0x5b'),_0x0384('0x55'));}}})['catch'](function(_0x23543f){logger[_0x0384('0x54')](_0x0384('0x62'),util['inspect'](_0x23543f,{'showHidden':!![],'depth':null}));});};exports[_0x0384('0x63')]=function(_0x46fb21,_0x50158e,_0xd73a9f,_0x20f43e,_0x17b95a,_0x1c0163){var _0x3415d1,_0x329380;_0x1c0163[_0x0384('0xd')]=intUtil['stripTrailingSlash'](_0x1c0163['remoteUri']);_0x1c0163[_0x0384('0x42')]=intUtil[_0x0384('0x43')](_0x1c0163['serverUrl']);if(_0x17b95a&&_0x17b95a[_0x0384('0x64')]){logger[_0x0384('0xb')]('['+_0x50158e[_0x0384('0x65')][_0x0384('0x66')]()+']',_0x0384('0x44'));_0x50158e[_0x0384('0x45')]=util[_0x0384('0xc')](_0x0384('0x46'),_0x1c0163[_0x0384('0x42')],_0x50158e[_0x0384('0x47')],md5(_0x50158e['uniqueid']));}else{_0x50158e[_0x0384('0x45')]='';}headers[_0x0384('0x67')]=getAuth(_0x1c0163);return getUser(_0x1c0163)[_0x0384('0x12')](function(_0x29c3fa){_0x3415d1=_0x29c3fa;logger[_0x0384('0xb')](_0x0384('0x49'),_0x3415d1['id']);return getEndUser(_0x1c0163,_0x50158e['calleridname'],_0x50158e[_0x0384('0x4b')]);})['then'](function(_0x54bd9e){_0x329380=_0x54bd9e;logger['info'](_0x0384('0x5e'),_0x329380['id']);return getTicket(_0x1c0163,_0x3415d1,_0x329380,_0xd73a9f,_0x50158e);})[_0x0384('0x12')](function(_0x14aa56){if(_0x14aa56){logger[_0x0384('0xb')](_0x0384('0x4c'),_0x14aa56['id']);}})[_0x0384('0x56')](function(_0x4163ea){logger[_0x0384('0x54')]('['+_0x50158e[_0x0384('0x65')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x0384('0x57')](_0x4163ea,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7c83=['count','Agent\x20found!','find','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','first','Enduser\x20found!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','picklist','nameField','customField','toLowerCase','content','includes','string','type','idField','custom_fields','variable','variableName','customVariable','Variable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s'];(function(_0x68bd67,_0x5c76e3){var _0x2126d8=function(_0x229aa1){while(--_0x229aa1){_0x68bd67['push'](_0x68bd67['shift']());}};_0x2126d8(++_0x5c76e3);}(_0x7c83,0xc8));var _0x37c8=function(_0x85aa94,_0x15e274){_0x85aa94=_0x85aa94-0x0;var _0x13bba6=_0x7c83[_0x85aa94];return _0x13bba6;};'use strict';var _=require(_0x37c8('0x0'));var rp=require(_0x37c8('0x1'));var md5=require(_0x37c8('0x2'));var util=require('util');var Redis=require(_0x37c8('0x3'));var intUtil=require(_0x37c8('0x4'));var config=require(_0x37c8('0x5'));var logger=require('../../../../config/logger')(_0x37c8('0x6'));config[_0x37c8('0x7')]=_[_0x37c8('0x8')](config[_0x37c8('0x7')],{'host':_0x37c8('0x9'),'port':0x18eb});var io=require(_0x37c8('0xa'))(new Redis(config['redis']));function emit(_0x3f3923,_0x2d33e1,_0x5cc529){io['to'](_0x3f3923)[_0x37c8('0xb')](_0x2d33e1,_0x5cc529);}var headers={'Content-Type':_0x37c8('0xc'),'Accept':_0x37c8('0xc')};function getTicket(_0x3024ea,_0x30a209,_0x261d6c,_0x76f383,_0x38a90d){logger[_0x37c8('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x37c8('0xe')]('%s/tickets.json',_0x3024ea['remoteUri']),'method':'POST','body':{'ticket':_[_0x37c8('0xf')]({'requester_id':_0x261d6c['id'],'submitter_id':_0x30a209?_0x30a209['id']:undefined,'assignee_id':_0x30a209?_0x30a209['id']:undefined,'tags':getTags(_0x76f383['Tags'],_0x37c8('0x10')),'subject':intUtil[_0x37c8('0x11')](_0x76f383['Subjects'],_0x38a90d,'\x20'),'description':intUtil[_0x37c8('0x11')](_0x76f383[_0x37c8('0x12')],_0x38a90d,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x76f383[_0x37c8('0x12')],_0x38a90d,'\x0a')}},getCustomFields(_0x76f383[_0x37c8('0x13')],_0x38a90d))}})[_0x37c8('0x14')](function(_0x2e5480){logger[_0x37c8('0xd')](_0x37c8('0x15'));return _0x2e5480[_0x37c8('0x16')];});}function getUser(_0x55f990,_0x1627fc){if(intUtil[_0x37c8('0x17')](_0x1627fc)){logger[_0x37c8('0xd')](_0x37c8('0x18'),_0x1627fc);return request({'uri':util['format'](_0x37c8('0x19'),_0x55f990[_0x37c8('0x1a')]),'qs':{'query':util[_0x37c8('0xe')](_0x37c8('0x1b'),_0x1627fc)}})[_0x37c8('0x14')](function(_0x22b28b){if(_0x22b28b[_0x37c8('0x1c')]){logger[_0x37c8('0xd')](_0x37c8('0x1d'));return _[_0x37c8('0x1e')](_0x22b28b['results'],{'email':_0x1627fc,'role':_0x37c8('0x1f')});}else{logger[_0x37c8('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x55f990['remoteUri'])})[_0x37c8('0x14')](function(_0x144d26){logger[_0x37c8('0xd')](_0x37c8('0x20'));return _0x144d26[_0x37c8('0x21')];});}});}else{logger['info'](_0x37c8('0x22'));return request({'uri':util[_0x37c8('0xe')](_0x37c8('0x23'),_0x55f990[_0x37c8('0x1a')])})[_0x37c8('0x14')](function(_0xf1a4c8){logger[_0x37c8('0xd')](_0x37c8('0x20'));return _0xf1a4c8[_0x37c8('0x21')];});}}function getEndUser(_0x59c210,_0x261ef9,_0x1f3edf){logger[_0x37c8('0xd')](_0x37c8('0x24'),_0x1f3edf);return request({'uri':util[_0x37c8('0xe')](_0x37c8('0x19'),_0x59c210[_0x37c8('0x1a')]),'qs':{'query':util[_0x37c8('0xe')](_0x37c8('0x25'),_0x1f3edf)}})[_0x37c8('0x14')](function(_0x4c0163){var _0x16d450;if(_0x4c0163[_0x37c8('0x26')][_0x37c8('0x27')]){_0x4c0163[_0x37c8('0x26')]=_[_0x37c8('0x28')](_0x4c0163[_0x37c8('0x26')],{'suspended':![],'role':'end-user'});if(_0x4c0163[_0x37c8('0x26')][_0x37c8('0x27')]){_0x16d450=_[_0x37c8('0x29')](_0x4c0163[_0x37c8('0x26')]);}}if(_0x16d450){logger[_0x37c8('0xd')](_0x37c8('0x2a'));return _0x16d450;}else{logger[_0x37c8('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x37c8('0xe')](_0x37c8('0x2b'),_0x59c210['remoteUri']),'method':_0x37c8('0x2c'),'body':{'user':{'role':_0x37c8('0x2d'),'name':util['format'](_0x37c8('0x2e'),_0x261ef9||_0x1f3edf),'phone':_0x1f3edf}}})[_0x37c8('0x14')](function(_0x483041){logger[_0x37c8('0xd')](_0x37c8('0x2f'));return _0x483041[_0x37c8('0x21')];});}});}function getAuth(_0xcca451){var _0x137bda;if(_0xcca451[_0x37c8('0x30')]===_0x37c8('0x31')){_0x137bda=util[_0x37c8('0xe')]('%s:%s',_0xcca451['username'],_0xcca451[_0x37c8('0x31')]);}else if(_0xcca451[_0x37c8('0x30')]===_0x37c8('0x32')){_0x137bda=util['format'](_0x37c8('0x33'),_0xcca451[_0x37c8('0x34')],_0xcca451['token']);}return util['format'](_0x37c8('0x35'),new Buffer(_0x137bda)[_0x37c8('0x36')](_0x37c8('0x37')));}function request(_0x3a19c4){logger[_0x37c8('0x38')](_0x37c8('0x39'),JSON[_0x37c8('0x3a')](_0x3a19c4));return rp(_[_0x37c8('0x8')](_0x3a19c4,{'method':_0x37c8('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x49cfe1,_0x3d6f66){var _0x2cb100=[];if(_0x49cfe1&&_0x49cfe1[_0x37c8('0x27')]>0x0){_0x2cb100=_['map'](_0x49cfe1,_0x3d6f66);}return _0x2cb100;}function getCustomFields(_0x40d0e3,_0x10acfa){var _0x3cd293=[];var _0x385797={'custom_fields':[]};if(_0x40d0e3[_0x37c8('0x27')]>0x0){_[_0x37c8('0x3c')](_0x40d0e3,function(_0x43be58){if(_['includes'](['string',_0x37c8('0x3d')],_0x43be58['type'])&&_0x43be58[_0x37c8('0x3e')]&&!_0x43be58[_0x37c8('0x3f')]){_0x385797[_0x43be58[_0x37c8('0x3e')][_0x37c8('0x40')]()]=_0x43be58[_0x37c8('0x41')][_0x37c8('0x36')]();}else if(_[_0x37c8('0x42')]([_0x37c8('0x43'),_0x37c8('0x3d')],_0x43be58[_0x37c8('0x44')])&&_0x43be58[_0x37c8('0x45')]&&_0x43be58[_0x37c8('0x3f')]){_0x385797[_0x37c8('0x46')]['push']({'id':_0x43be58['idField'],'value':_0x43be58[_0x37c8('0x41')][_0x37c8('0x36')]()});}else if(_0x43be58[_0x37c8('0x44')]===_0x37c8('0x47')&&_0x43be58[_0x37c8('0x48')]&&_0x43be58[_0x37c8('0x45')]&&_0x43be58[_0x37c8('0x3f')]){_0x10acfa[_0x43be58[_0x37c8('0x48')]]&&_0x385797['custom_fields']['push']({'id':_0x43be58['idField'],'value':_0x10acfa[_0x43be58[_0x37c8('0x48')]][_0x37c8('0x36')]()});}else if(_0x43be58['type']===_0x37c8('0x49')&&_0x43be58['Variable']&&_0x43be58[_0x37c8('0x4a')]['name']&&_0x43be58[_0x37c8('0x45')]&&_0x43be58[_0x37c8('0x3f')]){_0x10acfa[_0x43be58[_0x37c8('0x4a')][_0x37c8('0x10')]['toLowerCase']()]&&_0x385797[_0x37c8('0x46')][_0x37c8('0x4b')]({'id':_0x43be58[_0x37c8('0x45')],'value':_0x10acfa[_0x43be58[_0x37c8('0x4a')][_0x37c8('0x10')][_0x37c8('0x40')]()][_0x37c8('0x36')]()});}});}return _0x385797;}exports['queue']=function(_0xa59552,_0x48c1b0,_0x33073c,_0x251dce,_0x4f1dd6,_0x24142f){var _0x451c91,_0x21c9c4;_0x24142f[_0x37c8('0x1a')]=intUtil[_0x37c8('0x4c')](_0x24142f[_0x37c8('0x1a')]);_0x24142f[_0x37c8('0x4d')]=intUtil['stripTrailingSlash'](_0x24142f[_0x37c8('0x4d')]);if(_0x4f1dd6&&_0x4f1dd6[_0x37c8('0x4e')]){logger[_0x37c8('0xd')](_0x37c8('0x4f'),_0x37c8('0x50'));_0x48c1b0[_0x37c8('0x51')]=util['format'](_0x37c8('0x52'),_0x24142f[_0x37c8('0x4d')],_0x48c1b0['uniqueid'],md5(_0x48c1b0[_0x37c8('0x53')]));}else{_0x48c1b0['recordingURL']='';}headers[_0x37c8('0x54')]=getAuth(_0x24142f);return getUser(_0x24142f,_0x251dce[_0x37c8('0x55')])['then'](function(_0x3c0146){_0x451c91=_0x3c0146;logger['info'](_0x37c8('0x56'),_0x451c91['id']);return getEndUser(_0x24142f,_0x48c1b0[_0x37c8('0x57')],_0x48c1b0[_0x37c8('0x58')]);})['then'](function(_0x1f8637){_0x21c9c4=_0x1f8637;logger['info']('The\x20Enduser\x20ID\x20is:',_0x21c9c4['id']);return getTicket(_0x24142f,_0x451c91,_0x21c9c4,_0x33073c,_0x48c1b0);})['then'](function(_0x311c2){if(_0x311c2){logger['info']('The\x20Ticket\x20ID\x20is:',_0x311c2['id']);switch(_0x24142f[_0x37c8('0x44')]){case _0x37c8('0x59'):logger[_0x37c8('0xd')](_0x37c8('0x4f'),_0x37c8('0x5a'));return request({'uri':util[_0x37c8('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x24142f[_0x37c8('0x1a')],_0x451c91['id'],_0x311c2['id']),'method':_0x37c8('0x2c')});case _0x37c8('0x5b'):logger[_0x37c8('0xd')](_0x37c8('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x37c8('0xe')](_0x37c8('0x5c'),_0x251dce[_0x37c8('0x10')]),_0x37c8('0x5d'),{'uri':util[_0x37c8('0xe')]('%s/agent/tickets/%s',_0x24142f['remoteUri']['replace'](_0x37c8('0x5e'),''),_0x311c2['id'])});break;default:logger[_0x37c8('0x5f')](_0x37c8('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x37c8('0x60')](function(_0x1a794e){logger[_0x37c8('0x5f')](_0x37c8('0x61'),util['inspect'](_0x1a794e,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x12e263,_0xb3c5f3,_0x5e15bd,_0x224dbd,_0x19148a,_0x170b08,_0x58c809){var _0x2a5026,_0x4f6734;_0x170b08[_0x37c8('0x1a')]=intUtil[_0x37c8('0x4c')](_0x170b08[_0x37c8('0x1a')]);_0x170b08[_0x37c8('0x4d')]=intUtil[_0x37c8('0x4c')](_0x170b08[_0x37c8('0x4d')]);if(_0x58c809&&_0x58c809[_0x37c8('0x62')]&&_0x58c809['recordingFormat']!==_0x37c8('0x63')){logger[_0x37c8('0xd')](_0x37c8('0x64'),'Recording\x20is\x20enabled!');_0xb3c5f3[_0x37c8('0x51')]=util['format'](_0x37c8('0x52'),_0x170b08[_0x37c8('0x4d')],_0xb3c5f3[_0x37c8('0x53')],md5(_0xb3c5f3[_0x37c8('0x53')]));}headers[_0x37c8('0x54')]=getAuth(_0x170b08);return getUser(_0x170b08,_0x224dbd[_0x37c8('0x55')])[_0x37c8('0x14')](function(_0x463cee){_0x2a5026=_0x463cee;logger[_0x37c8('0xd')](_0x37c8('0x56'),_0x2a5026['id']);return getEndUser(_0x170b08,_0xb3c5f3[_0x37c8('0x65')],_0xb3c5f3[_0x37c8('0x66')]);})[_0x37c8('0x14')](function(_0x28f389){_0x4f6734=_0x28f389;logger[_0x37c8('0xd')](_0x37c8('0x67'),_0x4f6734['id']);return getTicket(_0x170b08,_0x2a5026,_0x4f6734,_0x5e15bd,_0xb3c5f3);})[_0x37c8('0x14')](function(_0xc9ee57){if(_0xc9ee57){logger[_0x37c8('0xd')]('The\x20Ticket\x20ID\x20is:',_0xc9ee57['id']);switch(_0x170b08[_0x37c8('0x44')]){case _0x37c8('0x59'):logger['info']('[OUTBOUND]',_0x37c8('0x5a'));return request({'uri':util[_0x37c8('0xe')](_0x37c8('0x68'),_0x170b08[_0x37c8('0x1a')],_0x2a5026['id'],_0xc9ee57['id']),'method':_0x37c8('0x2c')});case _0x37c8('0x5b'):logger[_0x37c8('0xd')](_0x37c8('0x64'),_0x37c8('0x69'));emit(util[_0x37c8('0xe')](_0x37c8('0x5c'),_0x224dbd['name']),'trigger:browser:url',{'uri':util['format'](_0x37c8('0x6a'),_0x170b08[_0x37c8('0x1a')]['replace'](_0x37c8('0x5e'),''),_0xc9ee57['id'])});break;default:logger[_0x37c8('0x5f')](_0x37c8('0x64'),_0x37c8('0x6b'));}}})[_0x37c8('0x60')](function(_0x1f9b7a){logger[_0x37c8('0x5f')](_0x37c8('0x6c'),util[_0x37c8('0x6d')](_0x1f9b7a,{'showHidden':!![],'depth':null}));});};exports[_0x37c8('0x6e')]=function(_0x2a950b,_0x4a1aea,_0x4b3746,_0x78c3e9,_0x3a9b48,_0x41c0b7){var _0xb523cc,_0x2762f0;_0x41c0b7['remoteUri']=intUtil[_0x37c8('0x4c')](_0x41c0b7[_0x37c8('0x1a')]);_0x41c0b7[_0x37c8('0x4d')]=intUtil[_0x37c8('0x4c')](_0x41c0b7[_0x37c8('0x4d')]);if(_0x3a9b48&&_0x3a9b48[_0x37c8('0x4e')]){logger['info']('['+_0x4a1aea[_0x37c8('0x6f')]['toUpperCase']()+']',_0x37c8('0x50'));_0x4a1aea[_0x37c8('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41c0b7[_0x37c8('0x4d')],_0x4a1aea[_0x37c8('0x53')],md5(_0x4a1aea[_0x37c8('0x53')]));}else{_0x4a1aea[_0x37c8('0x51')]='';}headers[_0x37c8('0x54')]=getAuth(_0x41c0b7);return getUser(_0x41c0b7)[_0x37c8('0x14')](function(_0x33977d){_0xb523cc=_0x33977d;logger[_0x37c8('0xd')](_0x37c8('0x56'),_0xb523cc['id']);return getEndUser(_0x41c0b7,_0x4a1aea['calleridname'],_0x4a1aea[_0x37c8('0x58')]);})[_0x37c8('0x14')](function(_0xf2de21){_0x2762f0=_0xf2de21;logger['info'](_0x37c8('0x67'),_0x2762f0['id']);return getTicket(_0x41c0b7,_0xb523cc,_0x2762f0,_0x4b3746,_0x4a1aea);})[_0x37c8('0x14')](function(_0xfd7def){if(_0xfd7def){logger['info'](_0x37c8('0x70'),_0xfd7def['id']);}})[_0x37c8('0x60')](function(_0x4f363b){logger[_0x37c8('0x5f')]('['+_0x4a1aea[_0x37c8('0x6f')]['toUpperCase']()+']'+_0x37c8('0x71'),util['inspect'](_0x4f363b,{'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 4ee51f5..2612d07 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 _0x8dfc=['role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','Contacts','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','starttime','called','Call_Result','Called','connect','Answered','abandoned','Timeout','outbound','YYYY-MM-DDTHH:mm:ss','agentcalledAt','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/api/voice/recordings/','uniqueid','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','isArrayLikeObject','users','isNil','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate'];(function(_0x4c32f5,_0x3dbbf1){var _0x19cae9=function(_0x3c77cd){while(--_0x3c77cd){_0x4c32f5['push'](_0x4c32f5['shift']());}};_0x19cae9(++_0x3dbbf1);}(_0x8dfc,0xdf));var _0xc8df=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x8dfc[_0x49052b];return _0x48c045;};'use strict';var _=require(_0xc8df('0x0'));var rp=require(_0xc8df('0x1'));var md5=require(_0xc8df('0x2'));var util=require(_0xc8df('0x3'));var intUtil=require(_0xc8df('0x4'));var moment=require(_0xc8df('0x5'));var Redis=require(_0xc8df('0x6'));var BPromise=require(_0xc8df('0x7'));var config=require(_0xc8df('0x8'));var logger=require('../../../../config/logger')(_0xc8df('0x9'));config[_0xc8df('0xa')]=_['defaults'](config[_0xc8df('0xa')],{'host':_0xc8df('0xb'),'port':0x18eb});var io=require(_0xc8df('0xc'))(new Redis(config[_0xc8df('0xa')]));function emit(_0x5a0bad,_0x32e6d0,_0x1e423d){io['to'](_0x5a0bad)[_0xc8df('0xd')](_0x32e6d0,_0x1e423d);}function request(_0x20909b){logger[_0xc8df('0xe')](_0xc8df('0xf'),JSON[_0xc8df('0x10')](_0x20909b));return rp(_0x20909b);}function getCustomFields(_0x7e609a,_0x55bcd7){var _0x4b6cf9={};if(_0x7e609a['length']>0x0){_[_0xc8df('0x11')](_0x7e609a,function(_0x5f0833){if(_[_0xc8df('0x12')](['string','picklist'],_0x5f0833[_0xc8df('0x13')])&&_0x5f0833[_0xc8df('0x14')]){_0x4b6cf9[_0x5f0833['idField']]=_0x5f0833['content'][_0xc8df('0x15')]();}else if(_0x5f0833['type']===_0xc8df('0x16')&&_0x5f0833[_0xc8df('0x17')]&&_0x5f0833[_0xc8df('0x14')]&&_0x55bcd7[_0x5f0833[_0xc8df('0x17')]]){_0x4b6cf9[_0x5f0833[_0xc8df('0x14')]]=_0x55bcd7[_0x5f0833[_0xc8df('0x17')]][_0xc8df('0x15')]();}else if(_0x5f0833['type']===_0xc8df('0x18')&&_0x5f0833[_0xc8df('0x19')]&&_0x5f0833['Variable'][_0xc8df('0x1a')]&&_0x5f0833[_0xc8df('0x14')]&&_0x55bcd7[_0x5f0833[_0xc8df('0x19')]['name']['toLowerCase']()]){_0x4b6cf9[_0x5f0833['idField']]=_0x55bcd7[_0x5f0833[_0xc8df('0x19')]['name'][_0xc8df('0x1b')]()][_0xc8df('0x15')]();}});}return _0x4b6cf9;}function getName(_0x186fef){if(_0x186fef['indexOf']('\x20')>0x0){var _0x43d943=_0x186fef[_0xc8df('0x1c')](/ (.+)/);if(_0x43d943[0x1]){return _0x43d943;}}return[_0x186fef,_0x186fef];}var accountsTokens={};function getAccessToken(_0x360c1f){return new Promise(function(_0x4aa383,_0x225030){if(!_['isNil'](accountsTokens[_0x360c1f['id']])&&!_['isNil'](accountsTokens[_0x360c1f['id']][_0xc8df('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x360c1f['id']][_0xc8df('0x1e')])){_0x4aa383(accountsTokens[_0x360c1f['id']][_0xc8df('0x1d')]);}}var _0x284782;switch(_0x360c1f[_0xc8df('0x1f')]){case'US':_0x284782=_0xc8df('0x20');break;case'AU':_0x284782=_0xc8df('0x21');break;case'EU':_0x284782=_0xc8df('0x22');break;case'IN':_0x284782=_0xc8df('0x23');break;case'CN':_0x284782=_0xc8df('0x24');break;default:_0x284782=_0xc8df('0x22');break;}var _0x329f82={'method':'POST','uri':_0x284782+_0xc8df('0x25'),'qs':{'refresh_token':_0x360c1f[_0xc8df('0x26')],'client_id':_0x360c1f[_0xc8df('0x27')],'client_secret':_0x360c1f[_0xc8df('0x28')],'grant_type':_0xc8df('0x29')},'json':!![]};return rp(_0x329f82)['then'](function(_0x4d693b){accountsTokens[_0x360c1f['id']]={'access_token':_0x4d693b[_0xc8df('0x1d')],'expires_in':moment()[_0xc8df('0x2a')](_0x4d693b[_0xc8df('0x1e')],_0xc8df('0x2b'))};_0x4aa383(_0x4d693b['access_token']);})[_0xc8df('0x2c')](function(_0x26b989){logger[_0xc8df('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x26b989[_0xc8df('0x2e')]);_0x225030(_0x26b989);});});}function getUser(_0x5d17e0,_0x505597,_0x50449e,_0x2d5cc7){logger['info'](_0xc8df('0x2f'));return request({'method':_0xc8df('0x30'),'uri':util[_0xc8df('0x31')](_0xc8df('0x32'),_0x505597),'qs':{'type':_0xc8df('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d17e0},'json':!![]})[_0xc8df('0x34')](function(_0x53dc0d){if(_0x53dc0d['users']){var _0x599ee5=-0x1;if(_[_0xc8df('0x35')](_0x53dc0d[_0xc8df('0x36')])){if(!_[_0xc8df('0x37')](_0x2d5cc7)){_0x599ee5=_[_0xc8df('0x38')](_0x53dc0d[_0xc8df('0x36')],function(_0x1f8ab5){return _0x1f8ab5[_0xc8df('0x39')]===_0x2d5cc7;});}if(_0x599ee5>=0x0){logger[_0xc8df('0x3a')](_0xc8df('0x3b'));}else{logger[_0xc8df('0x3a')](_0xc8df('0x3c'));_0x599ee5=_[_0xc8df('0x38')](_0x53dc0d[_0xc8df('0x36')],function(_0x3c54d1){return _0x3c54d1[_0xc8df('0x3d')][_0xc8df('0x1a')]===_0xc8df('0x3e');});}return _0x53dc0d[_0xc8df('0x36')][_0x599ee5];}else{if(_0x53dc0d[_0xc8df('0x3f')][_0xc8df('0x3d')][_0xc8df('0x1a')]===_0xc8df('0x3e')){logger[_0xc8df('0x3a')]('Using\x20the\x20admin\x20account!');user=_0x53dc0d['user'];return user;}else{logger['error'](_0xc8df('0x40'),JSON[_0xc8df('0x10')](_0x53dc0d));throw new Error(_0xc8df('0x41')+JSON['stringify'](_0x53dc0d));}}}else{logger[_0xc8df('0x2d')](_0xc8df('0x40'),JSON['stringify'](_0x53dc0d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xc8df('0x10')](_0x53dc0d));}})['catch'](function(_0x49ca66){console['error'](_0x49ca66);});}function getZohoUser(_0xeceaf3,_0x1ff176){return new BPromise(function(_0x25d4f5,_0x30cab5){request(_0xeceaf3)[_0xc8df('0x34')](function(_0x19e1f4){var _0x5b992c=null;if(_0x19e1f4){_0x5b992c=_0x19e1f4[_0xc8df('0x42')][0x0];_0x5b992c[_0xc8df('0x43')]=_0x1ff176;}_0x25d4f5(_0x5b992c);})[_0xc8df('0x2c')](function(_0x2209cb){_0x30cab5(_0x2209cb);});});}function createEndUser(_0x1a8867,_0x17e714,_0x17c5c3,_0xab903d,_0x124d79,_0x546e6a){var _0x17c5c3=getName(_0x17c5c3);return request({'method':_0xc8df('0x44'),'uri':_0xc8df('0x45')+_0x17e714+_0xc8df('0x46')+_[_0xc8df('0x47')](_0x546e6a[_0xc8df('0x48')])+'s','body':{'data':[{'Last_Name':_0x17c5c3[0x1],'First_Name':_0x17c5c3[0x0],'Phone':_0xab903d,'Owner':{'name':!_[_0xc8df('0x37')](_0x124d79[_0xc8df('0x49')]['name'])?_0x124d79[_0xc8df('0x49')][_0xc8df('0x1a')]:!_[_0xc8df('0x37')](_0x124d79['first_name'])?_0x124d79[_0xc8df('0x4a')]+'\x20'+_0x124d79[_0xc8df('0x4b')]:_0x124d79[_0xc8df('0x4b')],'id':_0x124d79['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1a8867},'json':!![]})[_0xc8df('0x34')](function(_0x4eb196){if(_0x4eb196&&_0x4eb196['data'][0x0][_0xc8df('0x4c')]===_0xc8df('0x4d')){var _0x4a5c1d=_0x4eb196[_0xc8df('0x42')][0x0][_0xc8df('0x4e')];_0x4a5c1d[_0xc8df('0x43')]=_['startCase'](_0x546e6a[_0xc8df('0x48')])+'s';return _0x4a5c1d;}logger[_0xc8df('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xc8df('0x10')](data));throw new Error(_0xc8df('0x4f')+JSON[_0xc8df('0x10')](data));})[_0xc8df('0x2c')](function(_0x19d3e2){console[_0xc8df('0x50')](_0xc8df('0x51'),_0x19d3e2);});}function getEndUser(_0x43b371,_0x4b93e5,_0x559aec,_0x4ff331,_0x3835a2,_0x44df39,_0x1444a9){var _0xed1155={'method':_0xc8df('0x30'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x43b371},'json':!![]};switch(_0x1444a9[_0xc8df('0x52')]){case _0xc8df('0x53'):_0xed1155[_0xc8df('0x54')]=_0xc8df('0x45')+_0x4b93e5+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3835a2+'))';return getZohoUser(_0xed1155,'Contacts')[_0xc8df('0x34')](function(_0x44accc){if(_0x44accc)return _0x44accc;_0xed1155[_0xc8df('0x54')]='https://www.zohoapis.'+_0x4b93e5+_0xc8df('0x55')+_0x3835a2+'))';return getZohoUser(_0xed1155,_0xc8df('0x56'))[_0xc8df('0x34')](function(_0x4bb49a){if(_0x4bb49a)return _0x4bb49a;if(_0x1444a9[_0xc8df('0x48')]!='nothing'){return createEndUser(_0x43b371,_0x4b93e5,_0x4ff331,_0x3835a2,_0x44df39,_0x1444a9);}else{return{};}});});break;case _0xc8df('0x57'):_0xed1155[_0xc8df('0x54')]=_0xc8df('0x45')+_0x4b93e5+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3835a2+'))';return getZohoUser(_0xed1155,_0xc8df('0x58'))['then'](function(_0x5d2af2){if(_0x5d2af2)return _0x5d2af2;if(_0x1444a9[_0xc8df('0x48')]!='nothing'){return createEndUser(_0x43b371,_0x4b93e5,_0x4ff331,_0x3835a2,_0x44df39,_0x1444a9);}else{return{};}});break;case'lead':_0xed1155[_0xc8df('0x54')]=_0xc8df('0x45')+_0x4b93e5+_0xc8df('0x55')+_0x3835a2+'))';return getZohoUser(_0xed1155,_0xc8df('0x56'))[_0xc8df('0x34')](function(_0x253591){if(_0x253591)return _0x253591;if(_0x1444a9['moduleCreate']!='nothing'){return createEndUser(_0x43b371,_0x4b93e5,_0x4ff331,_0x3835a2,_0x44df39,_0x1444a9);}else{return{};}});break;}}function getCall(_0x289346,_0x3b8468,_0xd80054,_0x332ab6,_0x3f51d8,_0x1afb7a,_0xe2fa1f,_0x1fc8b0){logger['info']('Creating\x20new\x20call...');var _0x21b532={};_0x21b532[_0xc8df('0x59')]={'name':!_[_0xc8df('0x37')](_0x332ab6[_0xc8df('0x49')][_0xc8df('0x1a')])&&!_[_0xc8df('0x37')](_0x332ab6[_0xc8df('0x3d')]['name'])&&_0x332ab6[_0xc8df('0x3d')]['name']===_0xc8df('0x5a')?_0x332ab6[_0xc8df('0x49')]['name']:!_[_0xc8df('0x37')](_0x332ab6[_0xc8df('0x4a')])?_0x332ab6[_0xc8df('0x4a')]+'\x20'+_0x332ab6['last_name']:_0x332ab6[_0xc8df('0x4b')],'id':_0x332ab6['id']};_0x21b532[_0xc8df('0x5b')]=intUtil[_0xc8df('0x5c')](_0x1afb7a[_0xc8df('0x5d')],_0xe2fa1f,'\x20');_0x21b532[_0xc8df('0x5e')]=intUtil['getString'](_0x1afb7a[_0xc8df('0x5f')],_0xe2fa1f,'\x0a');if(_0x3f51d8['enduserType']===_0xc8df('0x58')){_0x21b532[_0xc8df('0x60')]={'name':!_[_0xc8df('0x37')](_0x3f51d8[_0xc8df('0x61')])?_0x3f51d8[_0xc8df('0x61')]:!_[_0xc8df('0x37')](_0x3f51d8[_0xc8df('0x62')])?_0x3f51d8['First_Name']+'\x20'+_0x3f51d8[_0xc8df('0x63')]:_0x3f51d8['Last_Name'],'id':_0x3f51d8['id']};}if(_0x3f51d8[_0xc8df('0x43')]===_0xc8df('0x56')){_0x21b532['What_Id']={'name':!_[_0xc8df('0x37')](_0x3f51d8[_0xc8df('0x61')])?_0x3f51d8[_0xc8df('0x61')]:!_['isNil'](_0x3f51d8[_0xc8df('0x62')])?_0x3f51d8[_0xc8df('0x62')]+'\x20'+_0x3f51d8[_0xc8df('0x63')]:_0x3f51d8[_0xc8df('0x63')],'id':_0x3f51d8['id']};_0x21b532['$se_module']=_[_0xc8df('0x47')](_0x3f51d8['enduserType']);}if(_0xe2fa1f[_0xc8df('0x64')]){_0x21b532['Call_Duration']=moment[_0xc8df('0x65')](parseInt(_0xe2fa1f['talktime'])*0x3e8)[_0xc8df('0x31')](_0xc8df('0x66'));}else if(_0xe2fa1f[_0xc8df('0x67')]&&_0xe2fa1f[_0xc8df('0x68')]){_0x21b532['Call_Duration']=moment[_0xc8df('0x65')](moment(_0xe2fa1f[_0xc8df('0x68')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0xe2fa1f[_0xc8df('0x69')],'YYYY-MM-DDTHH:mm:ss')))[_0xc8df('0x31')]('mm:ss');}switch(_0xe2fa1f['lastevent']){case _0xc8df('0x6a'):_0x21b532[_0xc8df('0x6b')]=_0xc8df('0x6c');break;case'complete':case _0xc8df('0x6d'):_0x21b532[_0xc8df('0x6b')]=_0xc8df('0x6e');break;case'rejected':_0x21b532['Call_Result']='Rejected';break;case _0xc8df('0x6f'):_0x21b532['Call_Result']='Abandoned';break;case'timeout':_0x21b532['Call_Result']=_0xc8df('0x70');default:}_0x21b532['Call_Start_Time']=(_0x1fc8b0===_0xc8df('0x71')?moment(_0xe2fa1f[_0xc8df('0x69')])[_0xc8df('0x31')](_0xc8df('0x72')):moment(_0xe2fa1f[_0xc8df('0x73')])[_0xc8df('0x31')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xc8df('0x31')](_0xc8df('0x72'));_0x21b532['Call_Type']=_0x1fc8b0||'Inbound';_0x21b532=_[_0xc8df('0x74')](_0x21b532,getCustomFields(_0x1afb7a[_0xc8df('0x75')],_0xe2fa1f));return request({'method':_0xc8df('0x44'),'uri':'https://www.zohoapis.'+_0x3b8468+_0xc8df('0x76'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x289346},'body':{'data':[_0x21b532]},'json':!![]})[_0xc8df('0x34')](function(_0xe3c02d){if(_0xe3c02d&&_0xe3c02d[_0xc8df('0x42')][0x0]['code']===_0xc8df('0x4d')){logger[_0xc8df('0x3a')](_0xc8df('0x77'));return{'id':_0xe3c02d[_0xc8df('0x42')][0x0]['details']['id']};}})[_0xc8df('0x2c')](function(_0x11cbd5){logger[_0xc8df('0x3a')](_0xc8df('0x78'),_0x11cbd5[_0xc8df('0x2e')]);console[_0xc8df('0x50')](_0xc8df('0x78'),_0x11cbd5);});}exports['queue']=function(_0x82fea5,_0x1b1994,_0x53e785,_0x15acf6,_0x2538e6,_0x5f563d){var _0x43034b,_0x4bb461,_0x228959;_0x5f563d[_0xc8df('0x79')]=intUtil[_0xc8df('0x7a')](_0x5f563d['host']);_0x5f563d[_0xc8df('0x7b')]=intUtil['stripTrailingSlash'](_0x5f563d[_0xc8df('0x7b')]);if(_0x2538e6&&_0x2538e6[_0xc8df('0x7c')]){logger['info'](_0xc8df('0x7d'),_0xc8df('0x7e'));_0x1b1994['recordingURL']=_0x5f563d[_0xc8df('0x7b')]+'/api/voice/recordings/'+_0x1b1994['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x1b1994['uniqueid']);}else{_0x1b1994[_0xc8df('0x7f')]='';}var _0x238d5f=_0x5f563d['host']===_0xc8df('0x80')?'eu':_0xc8df('0x81');return getAccessToken(_0x5f563d)[_0xc8df('0x34')](function(_0x5e50c5){_0x228959=_0x5e50c5;return getUser(_0x228959,_0x238d5f,_0x5f563d,_0x15acf6[_0xc8df('0x39')]);})[_0xc8df('0x34')](function(_0x2b0068){_0x43034b=_0x2b0068;logger[_0xc8df('0x3a')](_0xc8df('0x82'),_0x43034b['id']);return getEndUser(_0x228959,_0x238d5f,_0x5f563d,_0x1b1994[_0xc8df('0x83')],_0x1b1994['calleridnum'],_0x43034b,_0x53e785);})[_0xc8df('0x34')](function(_0x2e9502){_0x4bb461=_0x2e9502;return getCall(_0x228959,_0x238d5f,_0x5f563d,_0x43034b,_0x4bb461,_0x53e785,_0x1b1994,_0xc8df('0x84'));})['then'](function(_0x1840a1){if(_0x1840a1){logger[_0xc8df('0x3a')]('The\x20Call\x20ID\x20is:',_0x1840a1['id']);logger['info'](_0xc8df('0x7d'),_0xc8df('0x85'));emit(util[_0xc8df('0x31')](_0xc8df('0x86'),_0x15acf6['name']),_0xc8df('0x87'),{'uri':'https://crm.'+_0x5f563d[_0xc8df('0x79')]+_0xc8df('0x88')+_0x1840a1['id']});}})[_0xc8df('0x2c')](function(_0x448e42){logger[_0xc8df('0x2d')](_0xc8df('0x7d'),JSON[_0xc8df('0x10')](_0x448e42));});};exports[_0xc8df('0x71')]=function(_0x320a7d,_0x4f11b0,_0x87d3bb,_0x4938b7,_0xa19e06,_0x2609ab,_0x471a2f){var _0x149cdc,_0x1f03c1,_0x1e6ab7;_0x2609ab['host']=intUtil[_0xc8df('0x7a')](_0x2609ab[_0xc8df('0x79')]);_0x2609ab['serverUrl']=intUtil[_0xc8df('0x7a')](_0x2609ab[_0xc8df('0x7b')]);if(_0x471a2f&&_0x471a2f[_0xc8df('0x89')]&&_0x471a2f[_0xc8df('0x89')]!=='none'){logger[_0xc8df('0x3a')](_0xc8df('0x8a'),_0xc8df('0x7e'));_0x4f11b0[_0xc8df('0x7f')]=_0x2609ab[_0xc8df('0x7b')]+_0xc8df('0x8b')+_0x4f11b0[_0xc8df('0x8c')]+'/downloads?type=uniqueid&token='+md5(_0x4f11b0['uniqueid']);}var _0x58e332=_0x2609ab[_0xc8df('0x79')]==='zoho.eu'?'eu':_0xc8df('0x81');return getAccessToken(_0x2609ab)[_0xc8df('0x34')](function(_0x465efd){_0x1e6ab7=_0x465efd;return getUser(_0x1e6ab7,_0x58e332,_0x2609ab,_0x4938b7[_0xc8df('0x39')]);})[_0xc8df('0x34')](function(_0xac475e){_0x149cdc=_0xac475e;logger[_0xc8df('0x3a')]('The\x20User\x20ID\x20is:',_0x149cdc['id']);return getEndUser(_0x1e6ab7,_0x58e332,_0x2609ab,_0x4f11b0[_0xc8df('0x8d')],_0x4f11b0[_0xc8df('0x8e')],_0x149cdc,_0x87d3bb);})[_0xc8df('0x34')](function(_0x1f0add){_0x1f03c1=_0x1f0add;return getCall(_0x1e6ab7,_0x58e332,_0x2609ab,_0x149cdc,_0x1f03c1,_0x87d3bb,_0x4f11b0,_0xc8df('0x8f'));})[_0xc8df('0x34')](function(_0x327f7b){if(_0x327f7b){logger[_0xc8df('0x3a')](_0xc8df('0x90'),_0x327f7b['id']);logger['info'](_0xc8df('0x8a'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc8df('0x31')]('user:%s',_0x4938b7[_0xc8df('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x2609ab[_0xc8df('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x327f7b['id']});}})['catch'](function(_0x33ef85){logger[_0xc8df('0x2d')](_0xc8df('0x8a'),JSON[_0xc8df('0x10')](_0x33ef85));});};exports[_0xc8df('0x91')]=function(_0x13ffe4,_0x23b1da,_0x26c9b5,_0x4a5819,_0x211348,_0x56e970){var _0x49d24b,_0x790c87,_0x1a92be;_0x56e970[_0xc8df('0x79')]=intUtil[_0xc8df('0x7a')](_0x56e970['host']);_0x56e970[_0xc8df('0x7b')]=intUtil['stripTrailingSlash'](_0x56e970[_0xc8df('0x7b')]);if(_0x211348&&_0x211348[_0xc8df('0x7c')]){logger[_0xc8df('0x3a')]('['+_0x23b1da[_0xc8df('0x92')][_0xc8df('0x93')]()+']',_0xc8df('0x7e'));_0x23b1da[_0xc8df('0x7f')]=_0x56e970[_0xc8df('0x7b')]+'/api/voice/recordings/'+_0x23b1da[_0xc8df('0x8c')]+'/downloads?type=uniqueid&token='+md5(_0x23b1da['uniqueid']);}else{_0x23b1da[_0xc8df('0x7f')]='';}var _0xb5a047=_0x56e970['host']===_0xc8df('0x80')?'eu':'com';return getAccessToken(_0x56e970)[_0xc8df('0x34')](function(_0x39486a){_0x1a92be=_0x39486a;return getUser(_0x1a92be,_0xb5a047,_0x56e970);})['then'](function(_0x268294){_0x49d24b=_0x268294;logger[_0xc8df('0x3a')](_0xc8df('0x82'),_0x49d24b['id']);return getEndUser(_0x1a92be,_0xb5a047,_0x56e970,_0x23b1da[_0xc8df('0x83')],_0x23b1da['calleridnum'],_0x49d24b,_0x26c9b5);})[_0xc8df('0x34')](function(_0x37f52f){_0x790c87=_0x37f52f;return getCall(_0x1a92be,_0xb5a047,_0x56e970,_0x49d24b,_0x790c87,_0x26c9b5,_0x23b1da,_0xc8df('0x84'));})[_0xc8df('0x34')](function(_0x51a52f){if(_0x51a52f){logger[_0xc8df('0x3a')](_0xc8df('0x90'),_0x51a52f['id']);}})[_0xc8df('0x2c')](function(_0x200df7){logger[_0xc8df('0x2d')]('['+_0x23b1da['lastevent'][_0xc8df('0x93')]()+']',JSON[_0xc8df('0x10')](_0x200df7));});}; \ No newline at end of file +var _0x905b=['ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','profile','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','Leads','Creating\x20new\x20call...','Owner','getString','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Timeout','Call_Start_Time','outbound','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','toUpperCase','lodash','md5','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users'];(function(_0x15f1cc,_0x1e99c9){var _0x3549d7=function(_0x3e2e04){while(--_0x3e2e04){_0x15f1cc['push'](_0x15f1cc['shift']());}};_0x3549d7(++_0x1e99c9);}(_0x905b,0x1a1));var _0xb905=function(_0x42f260,_0x55b6a9){_0x42f260=_0x42f260-0x0;var _0x28541a=_0x905b[_0x42f260];return _0x28541a;};'use strict';var _=require(_0xb905('0x0'));var rp=require('request-promise');var md5=require(_0xb905('0x1'));var util=require('util');var intUtil=require('./util');var moment=require(_0xb905('0x2'));var Redis=require(_0xb905('0x3'));var BPromise=require(_0xb905('0x4'));var config=require(_0xb905('0x5'));var logger=require(_0xb905('0x6'))(_0xb905('0x7'));config[_0xb905('0x8')]=_['defaults'](config[_0xb905('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb905('0x9'))(new Redis(config[_0xb905('0x8')]));function emit(_0xcacb16,_0x233e5e,_0x15842e){io['to'](_0xcacb16)[_0xb905('0xa')](_0x233e5e,_0x15842e);}function request(_0x1c725e){logger[_0xb905('0xb')](_0xb905('0xc'),JSON['stringify'](_0x1c725e));return rp(_0x1c725e);}function getCustomFields(_0x286815,_0x42738b){var _0x74ce19={};if(_0x286815[_0xb905('0xd')]>0x0){_[_0xb905('0xe')](_0x286815,function(_0x552365){if(_[_0xb905('0xf')]([_0xb905('0x10'),_0xb905('0x11')],_0x552365[_0xb905('0x12')])&&_0x552365[_0xb905('0x13')]){_0x74ce19[_0x552365[_0xb905('0x13')]]=_0x552365[_0xb905('0x14')]['toString']();}else if(_0x552365['type']===_0xb905('0x15')&&_0x552365[_0xb905('0x16')]&&_0x552365[_0xb905('0x13')]&&_0x42738b[_0x552365[_0xb905('0x16')]]){_0x74ce19[_0x552365[_0xb905('0x13')]]=_0x42738b[_0x552365[_0xb905('0x16')]][_0xb905('0x17')]();}else if(_0x552365[_0xb905('0x12')]===_0xb905('0x18')&&_0x552365[_0xb905('0x19')]&&_0x552365[_0xb905('0x19')][_0xb905('0x1a')]&&_0x552365[_0xb905('0x13')]&&_0x42738b[_0x552365['Variable']['name']['toLowerCase']()]){_0x74ce19[_0x552365[_0xb905('0x13')]]=_0x42738b[_0x552365[_0xb905('0x19')][_0xb905('0x1a')][_0xb905('0x1b')]()]['toString']();}});}return _0x74ce19;}function getName(_0x576213){if(_0x576213['indexOf']('\x20')>0x0){var _0x1f52e3=_0x576213['split'](/ (.+)/);if(_0x1f52e3[0x1]){return _0x1f52e3;}}return[_0x576213,_0x576213];}var accountsTokens={};function getAccessToken(_0x59fb4c){return new Promise(function(_0x551963,_0x31f9e2){if(!_[_0xb905('0x1c')](accountsTokens[_0x59fb4c['id']])&&!_[_0xb905('0x1c')](accountsTokens[_0x59fb4c['id']][_0xb905('0x1d')])){if(moment()[_0xb905('0x1e')](accountsTokens[_0x59fb4c['id']]['expires_in'])){_0x551963(accountsTokens[_0x59fb4c['id']][_0xb905('0x1d')]);}}var _0x34fdc3;switch(_0x59fb4c[_0xb905('0x1f')]){case'US':_0x34fdc3=_0xb905('0x20');break;case'AU':_0x34fdc3='https://accounts.zoho.com.au';break;case'EU':_0x34fdc3=_0xb905('0x21');break;case'IN':_0x34fdc3=_0xb905('0x22');break;case'CN':_0x34fdc3=_0xb905('0x23');break;default:_0x34fdc3='https://accounts.zoho.eu';break;}var _0x55c018={'method':'POST','uri':_0x34fdc3+_0xb905('0x24'),'qs':{'refresh_token':_0x59fb4c[_0xb905('0x25')],'client_id':_0x59fb4c[_0xb905('0x26')],'client_secret':_0x59fb4c['clientSecret'],'grant_type':_0xb905('0x27')},'json':!![]};return rp(_0x55c018)[_0xb905('0x28')](function(_0x1270e9){accountsTokens[_0x59fb4c['id']]={'access_token':_0x1270e9[_0xb905('0x1d')],'expires_in':moment()[_0xb905('0x29')](_0x1270e9[_0xb905('0x2a')],_0xb905('0x2b'))};_0x551963(_0x1270e9['access_token']);})[_0xb905('0x2c')](function(_0x51004c){logger['error'](_0xb905('0x2d'),_0x51004c[_0xb905('0x2e')]);_0x31f9e2(_0x51004c);});});}function getUser(_0x2b2ab4,_0x51e431,_0x4da060,_0x2f7c19){logger[_0xb905('0x2f')]('Search\x20user');return request({'method':_0xb905('0x30'),'uri':util[_0xb905('0x31')](_0xb905('0x32'),_0x51e431),'qs':{'type':_0xb905('0x33')},'headers':{'Authorization':_0xb905('0x34')+_0x2b2ab4},'json':!![]})[_0xb905('0x28')](function(_0x54c203){if(_0x54c203[_0xb905('0x35')]){var _0x1f6409=-0x1;if(_[_0xb905('0x36')](_0x54c203[_0xb905('0x35')])){if(!_[_0xb905('0x1c')](_0x2f7c19)){_0x1f6409=_['findIndex'](_0x54c203['users'],function(_0x319ec3){return _0x319ec3[_0xb905('0x37')]===_0x2f7c19;});}if(_0x1f6409>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xb905('0x2f')](_0xb905('0x38'));_0x1f6409=_[_0xb905('0x39')](_0x54c203['users'],function(_0x29705f){return _0x29705f['profile'][_0xb905('0x1a')]===_0xb905('0x3a');});}return _0x54c203[_0xb905('0x35')][_0x1f6409];}else{if(_0x54c203[_0xb905('0x3b')][_0xb905('0x3c')]['name']===_0xb905('0x3a')){logger[_0xb905('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x54c203[_0xb905('0x3b')];return user;}else{logger[_0xb905('0x3d')](_0xb905('0x3e'),JSON[_0xb905('0x3f')](_0x54c203));throw new Error(_0xb905('0x40')+JSON[_0xb905('0x3f')](_0x54c203));}}}else{logger[_0xb905('0x3d')]('The\x20failing\x20result\x20is',JSON[_0xb905('0x3f')](_0x54c203));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb905('0x3f')](_0x54c203));}})['catch'](function(_0xcb38af){console[_0xb905('0x3d')](_0xcb38af);});}function getZohoUser(_0x46f769,_0x2a120c){return new BPromise(function(_0x447f33,_0x833cdd){request(_0x46f769)['then'](function(_0x564021){var _0x3c6249=null;if(_0x564021){_0x3c6249=_0x564021[_0xb905('0x41')][0x0];_0x3c6249['enduserType']=_0x2a120c;}_0x447f33(_0x3c6249);})[_0xb905('0x2c')](function(_0x4953bf){_0x833cdd(_0x4953bf);});});}function createEndUser(_0x15bda1,_0x27a308,_0x1fc238,_0x26b139,_0x196bc1,_0x5f3462){var _0x1fc238=getName(_0x1fc238);return request({'method':_0xb905('0x42'),'uri':_0xb905('0x43')+_0x27a308+_0xb905('0x44')+_['startCase'](_0x5f3462[_0xb905('0x45')])+'s','body':{'data':[{'Last_Name':_0x1fc238[0x1],'First_Name':_0x1fc238[0x0],'Phone':_0x26b139,'Owner':{'name':!_[_0xb905('0x1c')](_0x196bc1[_0xb905('0x46')][_0xb905('0x1a')])?_0x196bc1[_0xb905('0x46')]['name']:!_[_0xb905('0x1c')](_0x196bc1[_0xb905('0x47')])?_0x196bc1[_0xb905('0x47')]+'\x20'+_0x196bc1[_0xb905('0x48')]:_0x196bc1['last_name'],'id':_0x196bc1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x15bda1},'json':!![]})['then'](function(_0x189077){if(_0x189077&&_0x189077[_0xb905('0x41')][0x0][_0xb905('0x49')]===_0xb905('0x4a')){var _0x4331a8=_0x189077[_0xb905('0x41')][0x0][_0xb905('0x4b')];_0x4331a8[_0xb905('0x4c')]=_[_0xb905('0x4d')](_0x5f3462[_0xb905('0x45')])+'s';return _0x4331a8;}logger[_0xb905('0x3d')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xb905('0x4e')+JSON[_0xb905('0x3f')](data));})[_0xb905('0x2c')](function(_0xdf8df6){console['log'](_0xb905('0x4f'),_0xdf8df6);});}function getEndUser(_0x2cccf4,_0x52245b,_0x538e1a,_0x41998d,_0x1b5817,_0x4add8d,_0x1db15){var _0x1fa6fc={'method':_0xb905('0x30'),'uri':'','headers':{'Authorization':_0xb905('0x34')+_0x2cccf4},'json':!![]};switch(_0x1db15[_0xb905('0x50')]){case'contact_lead':_0x1fa6fc[_0xb905('0x51')]=_0xb905('0x43')+_0x52245b+_0xb905('0x52')+_0x1b5817+'))';return getZohoUser(_0x1fa6fc,'Contacts')['then'](function(_0x38dea9){if(_0x38dea9)return _0x38dea9;_0x1fa6fc[_0xb905('0x51')]=_0xb905('0x43')+_0x52245b+_0xb905('0x53')+_0x1b5817+'))';return getZohoUser(_0x1fa6fc,'Leads')[_0xb905('0x28')](function(_0x50872b){if(_0x50872b)return _0x50872b;if(_0x1db15['moduleCreate']!=_0xb905('0x54')){return createEndUser(_0x2cccf4,_0x52245b,_0x41998d,_0x1b5817,_0x4add8d,_0x1db15);}else{return{};}});});break;case _0xb905('0x55'):_0x1fa6fc['uri']='https://www.zohoapis.'+_0x52245b+_0xb905('0x52')+_0x1b5817+'))';return getZohoUser(_0x1fa6fc,'Contacts')[_0xb905('0x28')](function(_0x3e57de){if(_0x3e57de)return _0x3e57de;if(_0x1db15[_0xb905('0x45')]!=_0xb905('0x54')){return createEndUser(_0x2cccf4,_0x52245b,_0x41998d,_0x1b5817,_0x4add8d,_0x1db15);}else{return{};}});break;case'lead':_0x1fa6fc[_0xb905('0x51')]=_0xb905('0x43')+_0x52245b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1b5817+'))';return getZohoUser(_0x1fa6fc,_0xb905('0x56'))['then'](function(_0x21c652){if(_0x21c652)return _0x21c652;if(_0x1db15[_0xb905('0x45')]!=_0xb905('0x54')){return createEndUser(_0x2cccf4,_0x52245b,_0x41998d,_0x1b5817,_0x4add8d,_0x1db15);}else{return{};}});break;}}function getCall(_0x27eb4c,_0x3a7fd3,_0x108595,_0x1d93bc,_0x134c63,_0x408795,_0x4e3269,_0x5e19a8){logger[_0xb905('0x2f')](_0xb905('0x57'));var _0x12ccf7={};_0x12ccf7[_0xb905('0x58')]={'name':!_[_0xb905('0x1c')](_0x1d93bc['role']['name'])&&!_[_0xb905('0x1c')](_0x1d93bc['profile'][_0xb905('0x1a')])&&_0x1d93bc[_0xb905('0x3c')]['name']==='administrator'?_0x1d93bc[_0xb905('0x46')][_0xb905('0x1a')]:!_[_0xb905('0x1c')](_0x1d93bc['first_name'])?_0x1d93bc['first_name']+'\x20'+_0x1d93bc['last_name']:_0x1d93bc[_0xb905('0x48')],'id':_0x1d93bc['id']};_0x12ccf7['Subject']=intUtil[_0xb905('0x59')](_0x408795['Subjects'],_0x4e3269,'\x20');_0x12ccf7[_0xb905('0x5a')]=intUtil[_0xb905('0x59')](_0x408795[_0xb905('0x5b')],_0x4e3269,'\x0a');if(_0x134c63['enduserType']===_0xb905('0x5c')){_0x12ccf7[_0xb905('0x5d')]={'name':!_[_0xb905('0x1c')](_0x134c63[_0xb905('0x5e')])?_0x134c63[_0xb905('0x5e')]:!_[_0xb905('0x1c')](_0x134c63[_0xb905('0x5f')])?_0x134c63['First_Name']+'\x20'+_0x134c63[_0xb905('0x60')]:_0x134c63[_0xb905('0x60')],'id':_0x134c63['id']};}if(_0x134c63[_0xb905('0x4c')]==='Leads'){_0x12ccf7[_0xb905('0x61')]={'name':!_[_0xb905('0x1c')](_0x134c63[_0xb905('0x5e')])?_0x134c63[_0xb905('0x5e')]:!_[_0xb905('0x1c')](_0x134c63[_0xb905('0x5f')])?_0x134c63['First_Name']+'\x20'+_0x134c63[_0xb905('0x60')]:_0x134c63['Last_Name'],'id':_0x134c63['id']};_0x12ccf7[_0xb905('0x62')]=_[_0xb905('0x4d')](_0x134c63[_0xb905('0x4c')]);}if(_0x4e3269[_0xb905('0x63')]){_0x12ccf7[_0xb905('0x64')]=moment['utc'](parseInt(_0x4e3269[_0xb905('0x63')])*0x3e8)[_0xb905('0x31')](_0xb905('0x65'));}else if(_0x4e3269[_0xb905('0x66')]&&_0x4e3269[_0xb905('0x67')]){_0x12ccf7[_0xb905('0x64')]=moment['utc'](moment(_0x4e3269[_0xb905('0x67')],_0xb905('0x68'))[_0xb905('0x69')](moment(_0x4e3269[_0xb905('0x6a')],_0xb905('0x68'))))[_0xb905('0x31')]('mm:ss');}switch(_0x4e3269[_0xb905('0x6b')]){case _0xb905('0x6c'):_0x12ccf7[_0xb905('0x6d')]=_0xb905('0x6e');break;case _0xb905('0x6f'):case _0xb905('0x70'):_0x12ccf7[_0xb905('0x6d')]='Answered';break;case _0xb905('0x71'):_0x12ccf7[_0xb905('0x6d')]=_0xb905('0x72');break;case _0xb905('0x73'):_0x12ccf7[_0xb905('0x6d')]='Abandoned';break;case'timeout':_0x12ccf7['Call_Result']=_0xb905('0x74');default:}_0x12ccf7[_0xb905('0x75')]=(_0x5e19a8===_0xb905('0x76')?moment(_0x4e3269[_0xb905('0x6a')])[_0xb905('0x31')](_0xb905('0x68')):moment(_0x4e3269['agentcalledAt'])[_0xb905('0x31')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xb905('0x31')](_0xb905('0x68'));_0x12ccf7[_0xb905('0x77')]=_0x5e19a8||'Inbound';_0x12ccf7=_[_0xb905('0x78')](_0x12ccf7,getCustomFields(_0x408795[_0xb905('0x79')],_0x4e3269));return request({'method':_0xb905('0x42'),'uri':_0xb905('0x43')+_0x3a7fd3+_0xb905('0x7a'),'headers':{'Authorization':_0xb905('0x34')+_0x27eb4c},'body':{'data':[_0x12ccf7]},'json':!![]})[_0xb905('0x28')](function(_0x1c41c4){if(_0x1c41c4&&_0x1c41c4['data'][0x0]['code']===_0xb905('0x4a')){logger['info'](_0xb905('0x7b'));return{'id':_0x1c41c4[_0xb905('0x41')][0x0][_0xb905('0x4b')]['id']};}})[_0xb905('0x2c')](function(_0xaafefb){logger['info'](_0xb905('0x7c'),_0xaafefb[_0xb905('0x2e')]);console[_0xb905('0x7d')](_0xb905('0x7c'),_0xaafefb);});}exports[_0xb905('0x7e')]=function(_0x1a5dfd,_0x1b64c9,_0x194322,_0x17994d,_0x5b46e9,_0x415867){var _0x22aa4b,_0x57101e,_0x21e3f2;_0x415867[_0xb905('0x7f')]=intUtil['stripTrailingSlash'](_0x415867[_0xb905('0x7f')]);_0x415867[_0xb905('0x80')]=intUtil[_0xb905('0x81')](_0x415867[_0xb905('0x80')]);if(_0x5b46e9&&_0x5b46e9[_0xb905('0x82')]){logger['info'](_0xb905('0x83'),'Recording\x20is\x20enabled!');_0x1b64c9[_0xb905('0x84')]=_0x415867[_0xb905('0x80')]+'/api/voice/recordings/'+_0x1b64c9[_0xb905('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x1b64c9[_0xb905('0x85')]);}else{_0x1b64c9[_0xb905('0x84')]='';}var _0x1a4779=_0x415867[_0xb905('0x7f')]===_0xb905('0x86')?'eu':'com';return getAccessToken(_0x415867)[_0xb905('0x28')](function(_0x351613){_0x21e3f2=_0x351613;return getUser(_0x21e3f2,_0x1a4779,_0x415867,_0x17994d['email']);})[_0xb905('0x28')](function(_0x3d128a){_0x22aa4b=_0x3d128a;logger[_0xb905('0x2f')](_0xb905('0x87'),_0x22aa4b['id']);return getEndUser(_0x21e3f2,_0x1a4779,_0x415867,_0x1b64c9[_0xb905('0x88')],_0x1b64c9[_0xb905('0x89')],_0x22aa4b,_0x194322);})['then'](function(_0x4b553b){_0x57101e=_0x4b553b;return getCall(_0x21e3f2,_0x1a4779,_0x415867,_0x22aa4b,_0x57101e,_0x194322,_0x1b64c9,'Inbound');})['then'](function(_0x39d322){if(_0x39d322){logger[_0xb905('0x2f')](_0xb905('0x8a'),_0x39d322['id']);logger[_0xb905('0x2f')](_0xb905('0x83'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb905('0x8b'),_0x17994d[_0xb905('0x1a')]),'trigger:browser:url',{'uri':_0xb905('0x8c')+_0x415867[_0xb905('0x7f')]+_0xb905('0x8d')+_0x39d322['id']});}})['catch'](function(_0x4c90ca){logger['error']('[QUEUE]',JSON[_0xb905('0x3f')](_0x4c90ca));});};exports[_0xb905('0x76')]=function(_0x53f9c3,_0x48d3e2,_0x3e70fa,_0x2f40ca,_0x1c232b,_0x1e61cc,_0x5f1102){var _0x3a1779,_0x5694cd,_0x44cbf9;_0x1e61cc[_0xb905('0x7f')]=intUtil[_0xb905('0x81')](_0x1e61cc[_0xb905('0x7f')]);_0x1e61cc[_0xb905('0x80')]=intUtil['stripTrailingSlash'](_0x1e61cc[_0xb905('0x80')]);if(_0x5f1102&&_0x5f1102[_0xb905('0x8e')]&&_0x5f1102['recordingFormat']!==_0xb905('0x8f')){logger[_0xb905('0x2f')](_0xb905('0x90'),_0xb905('0x91'));_0x48d3e2['recordingURL']=_0x1e61cc[_0xb905('0x80')]+_0xb905('0x92')+_0x48d3e2['uniqueid']+_0xb905('0x93')+md5(_0x48d3e2[_0xb905('0x85')]);}var _0x16cc35=_0x1e61cc['host']===_0xb905('0x86')?'eu':_0xb905('0x94');return getAccessToken(_0x1e61cc)['then'](function(_0x1027ec){_0x44cbf9=_0x1027ec;return getUser(_0x44cbf9,_0x16cc35,_0x1e61cc,_0x2f40ca[_0xb905('0x37')]);})[_0xb905('0x28')](function(_0x5e4292){_0x3a1779=_0x5e4292;logger['info'](_0xb905('0x87'),_0x3a1779['id']);return getEndUser(_0x44cbf9,_0x16cc35,_0x1e61cc,_0x48d3e2[_0xb905('0x95')],_0x48d3e2[_0xb905('0x96')],_0x3a1779,_0x3e70fa);})['then'](function(_0x232a52){_0x5694cd=_0x232a52;return getCall(_0x44cbf9,_0x16cc35,_0x1e61cc,_0x3a1779,_0x5694cd,_0x3e70fa,_0x48d3e2,_0xb905('0x97'));})[_0xb905('0x28')](function(_0x59b997){if(_0x59b997){logger[_0xb905('0x2f')](_0xb905('0x8a'),_0x59b997['id']);logger['info'](_0xb905('0x90'),_0xb905('0x98'));emit(util[_0xb905('0x31')](_0xb905('0x8b'),_0x2f40ca[_0xb905('0x1a')]),_0xb905('0x99'),{'uri':_0xb905('0x8c')+_0x1e61cc[_0xb905('0x7f')]+_0xb905('0x8d')+_0x59b997['id']});}})[_0xb905('0x2c')](function(_0x1c2906){logger[_0xb905('0x3d')](_0xb905('0x90'),JSON['stringify'](_0x1c2906));});};exports[_0xb905('0x9a')]=function(_0x576294,_0x210f21,_0x2cedd3,_0x1039a3,_0xc6125f,_0x52903b){var _0x35e1e0,_0x28c7bc,_0xf15513;_0x52903b[_0xb905('0x7f')]=intUtil[_0xb905('0x81')](_0x52903b[_0xb905('0x7f')]);_0x52903b[_0xb905('0x80')]=intUtil[_0xb905('0x81')](_0x52903b[_0xb905('0x80')]);if(_0xc6125f&&_0xc6125f[_0xb905('0x82')]){logger[_0xb905('0x2f')]('['+_0x210f21[_0xb905('0x6b')][_0xb905('0x9b')]()+']','Recording\x20is\x20enabled!');_0x210f21[_0xb905('0x84')]=_0x52903b['serverUrl']+_0xb905('0x92')+_0x210f21['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x210f21[_0xb905('0x85')]);}else{_0x210f21['recordingURL']='';}var _0x3d2415=_0x52903b['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x52903b)[_0xb905('0x28')](function(_0x34bdf3){_0xf15513=_0x34bdf3;return getUser(_0xf15513,_0x3d2415,_0x52903b);})[_0xb905('0x28')](function(_0xf04d72){_0x35e1e0=_0xf04d72;logger[_0xb905('0x2f')](_0xb905('0x87'),_0x35e1e0['id']);return getEndUser(_0xf15513,_0x3d2415,_0x52903b,_0x210f21['calleridname'],_0x210f21['calleridnum'],_0x35e1e0,_0x2cedd3);})[_0xb905('0x28')](function(_0x446b0c){_0x28c7bc=_0x446b0c;return getCall(_0xf15513,_0x3d2415,_0x52903b,_0x35e1e0,_0x28c7bc,_0x2cedd3,_0x210f21,'Inbound');})[_0xb905('0x28')](function(_0x44706c){if(_0x44706c){logger[_0xb905('0x2f')]('The\x20Call\x20ID\x20is:',_0x44706c['id']);}})[_0xb905('0x2c')](function(_0x443d76){logger['error']('['+_0x210f21[_0xb905('0x6b')][_0xb905('0x9b')]()+']',JSON[_0xb905('0x3f')](_0x443d76));});}; \ 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 2f7a674..ed761c5 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 _0x9d62=['util','shelljs','mustache','../../../../config/logger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x20561a,_0x19bfc0){var _0x40e249=function(_0x7fc86d){while(--_0x7fc86d){_0x20561a['push'](_0x20561a['shift']());}};_0x40e249(++_0x19bfc0);}(_0x9d62,0x82));var _0x29d6=function(_0xb216c,_0x4fcae3){_0xb216c=_0xb216c-0x0;var _0xc17a9e=_0x9d62[_0xb216c];return _0xc17a9e;};'use strict';var util=require(_0x29d6('0x0'));var sh=require(_0x29d6('0x1'));var Mustache=require(_0x29d6('0x2'));var logger=require(_0x29d6('0x3'))('trigger');exports[_0x29d6('0x4')]=function(_0x10d7e7,_0x1633c2){var _0x3a9a51=_0x10d7e7[_0x29d6('0x5')]?_0x10d7e7[_0x29d6('0x5')]:_0x29d6('0x6');var _0x5c7554=_0x10d7e7[_0x29d6('0x7')]?Mustache['render'](_0x10d7e7[_0x29d6('0x7')],_0x1633c2):_0x1633c2;sh[_0x29d6('0x4')](_0x5c7554,function(_0x566a9a,_0x33d71f,_0x28ac6e){if(_0x566a9a!==0x0){logger[_0x29d6('0x8')](util[_0x29d6('0x9')](_0x29d6('0xa'),_0x3a9a51,_0x5c7554,_0x566a9a,_0x28ac6e));}else{logger[_0x29d6('0xb')](util['format'](_0x29d6('0xc'),_0x3a9a51,_0x5c7554,_0x33d71f));}});}; \ No newline at end of file +var _0x20dc=['error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x18ca1a,_0x798afa){var _0x7fecf0=function(_0x12e62b){while(--_0x12e62b){_0x18ca1a['push'](_0x18ca1a['shift']());}};_0x7fecf0(++_0x798afa);}(_0x20dc,0x79));var _0xc20d=function(_0x5d7e31,_0x219924){_0x5d7e31=_0x5d7e31-0x0;var _0x1830c1=_0x20dc[_0x5d7e31];return _0x1830c1;};'use strict';var util=require(_0xc20d('0x0'));var sh=require(_0xc20d('0x1'));var Mustache=require(_0xc20d('0x2'));var logger=require(_0xc20d('0x3'))(_0xc20d('0x4'));exports[_0xc20d('0x5')]=function(_0x5752ff,_0x1bf765){var _0x370cfc=_0x5752ff[_0xc20d('0x6')]?_0x5752ff[_0xc20d('0x6')]:_0xc20d('0x7');var _0x15ad36=_0x5752ff[_0xc20d('0x8')]?Mustache['render'](_0x5752ff[_0xc20d('0x8')],_0x1bf765):_0x1bf765;sh['exec'](_0x15ad36,function(_0x1fec3c,_0x3a850a,_0x2efc36){if(_0x1fec3c!==0x0){logger[_0xc20d('0x9')](util[_0xc20d('0xa')](_0xc20d('0xb'),_0x370cfc,_0x15ad36,_0x1fec3c,_0x2efc36));}else{logger[_0xc20d('0xc')](util[_0xc20d('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x370cfc,_0x15ad36,_0x3a850a));}});}; \ 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 d78a8fe..b4efa3e 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 _0xeeff=['data7','body','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','headers','data6','render','error','GET','DELETE','POST','PUT'];(function(_0x5f2098,_0x47308b){var _0x18af32=function(_0xa53c8e){while(--_0xa53c8e){_0x5f2098['push'](_0x5f2098['shift']());}};_0x18af32(++_0x47308b);}(_0xeeff,0x1ed));var _0xfeef=function(_0x921a0,_0x2795ee){_0x921a0=_0x921a0-0x0;var _0x3bafec=_0xeeff[_0x921a0];return _0x3bafec;};'use strict';var rp=require(_0xfeef('0x0'));var util=require(_0xfeef('0x1'));var _=require('lodash');var Mustache=require(_0xfeef('0x2'));var logger=require(_0xfeef('0x3'))(_0xfeef('0x4'));exports['exec']=function(_0x3f08cc,_0x4693f6){var _0x3f5fd7,_0x52ea73;var _0x376f47={'method':_0x3f08cc[_0xfeef('0x5')][_0xfeef('0x6')](),'uri':Mustache['render'](_0x3f08cc[_0xfeef('0x7')],_0x4693f6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3f08cc[_0xfeef('0x8')])==='number'&&parseInt(_0x3f08cc[_0xfeef('0x8')])>=0x1&&parseInt(_0x3f08cc[_0xfeef('0x8')])<=0xa?parseInt(_0x3f08cc['data5'])*0x3e8:0x5*0x3e8};try{_0x376f47[_0xfeef('0x9')]=_0x3f08cc[_0xfeef('0xa')]?JSON['parse'](Mustache[_0xfeef('0xb')](_0x3f08cc[_0xfeef('0xa')],_0x4693f6)):{};}catch(_0x55ebb5){logger[_0xfeef('0xc')](_0x55ebb5['stack']);}switch(_0x3f08cc['data1'][_0xfeef('0x6')]()){case _0xfeef('0xd'):case _0xfeef('0xe'):_0x3f5fd7=null;_0x376f47['qs']=_0x4693f6;break;case _0xfeef('0xf'):case _0xfeef('0x10'):if(_0x3f08cc[_0xfeef('0x11')]){try{_0x3f5fd7=JSON['parse'](Mustache[_0xfeef('0xb')](_0x3f08cc[_0xfeef('0x11')],_0x4693f6));_0x376f47[_0xfeef('0x12')]=_0x3f5fd7;}catch(_0x240240){logger['error'](_0x240240[_0xfeef('0x13')]);logger[_0xfeef('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x3f5fd7=_0x4693f6;_0x376f47[_0xfeef('0x12')]=_0x3f5fd7;}break;}logger[_0xfeef('0x14')](util[_0xfeef('0x15')](_0xfeef('0x16'),_0x3f08cc[_0xfeef('0x5')],_0x3f08cc[_0xfeef('0x7')],JSON[_0xfeef('0x17')](_0x376f47)));rp(_0x376f47)[_0xfeef('0x18')](function(_0x12612e){_0x3f5fd7=!_[_0xfeef('0x19')](_0x3f5fd7)?_0xfeef('0x1a')+_0x3f5fd7:'';_0x52ea73=typeof _0x12612e[_0xfeef('0x12')]===_0xfeef('0x1b')?JSON[_0xfeef('0x17')](_0x12612e[_0xfeef('0x12')]):_0x12612e['body'];logger[_0xfeef('0x14')](util['format'](_0xfeef('0x1c'),_0x3f08cc[_0xfeef('0x5')],_0x3f08cc['data2'],_0x12612e[_0xfeef('0x1d')],_0x52ea73));})[_0xfeef('0x1e')](function(_0x492462){logger[_0xfeef('0xc')](util[_0xfeef('0x15')](_0xfeef('0x1f'),_0x3f08cc[_0xfeef('0x5')],_0x3f08cc[_0xfeef('0x7')],_0x492462[_0xfeef('0x1d')],_0x492462[_0xfeef('0x20')],_0x492462[_0xfeef('0x21')]));});}; \ No newline at end of file +var _0x4626=['parse','data6','error','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','object','stringify','info','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers'];(function(_0x5a0a84,_0x317608){var _0x44b69c=function(_0x4bb00f){while(--_0x4bb00f){_0x5a0a84['push'](_0x5a0a84['shift']());}};_0x44b69c(++_0x317608);}(_0x4626,0x1b3));var _0x6462=function(_0x29abae,_0x624325){_0x29abae=_0x29abae-0x0;var _0x38f916=_0x4626[_0x29abae];return _0x38f916;};'use strict';var rp=require('request-promise');var util=require(_0x6462('0x0'));var _=require(_0x6462('0x1'));var Mustache=require(_0x6462('0x2'));var logger=require(_0x6462('0x3'))(_0x6462('0x4'));exports[_0x6462('0x5')]=function(_0x52eab8,_0x5ec785){var _0x6349ee,_0x1c738c;var _0x4c19ee={'method':_0x52eab8[_0x6462('0x6')][_0x6462('0x7')](),'uri':Mustache[_0x6462('0x8')](_0x52eab8[_0x6462('0x9')],_0x5ec785),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x52eab8[_0x6462('0xa')])===_0x6462('0xb')&&parseInt(_0x52eab8[_0x6462('0xa')])>=0x1&&parseInt(_0x52eab8[_0x6462('0xa')])<=0xa?parseInt(_0x52eab8[_0x6462('0xa')])*0x3e8:0x5*0x3e8};try{_0x4c19ee[_0x6462('0xc')]=_0x52eab8['data6']?JSON[_0x6462('0xd')](Mustache['render'](_0x52eab8[_0x6462('0xe')],_0x5ec785)):{};}catch(_0x31252e){logger[_0x6462('0xf')](_0x31252e['stack']);}switch(_0x52eab8[_0x6462('0x6')][_0x6462('0x7')]()){case'GET':case'DELETE':_0x6349ee=null;_0x4c19ee['qs']=_0x5ec785;break;case _0x6462('0x10'):case'PUT':if(_0x52eab8[_0x6462('0x11')]){try{_0x6349ee=JSON['parse'](Mustache[_0x6462('0x8')](_0x52eab8[_0x6462('0x11')],_0x5ec785));_0x4c19ee[_0x6462('0x12')]=_0x6349ee;}catch(_0x340f0b){logger[_0x6462('0xf')](_0x340f0b['stack']);logger[_0x6462('0xf')](_0x6462('0x13'));}}else{_0x6349ee=_0x5ec785;_0x4c19ee[_0x6462('0x12')]=_0x6349ee;}break;}logger['info'](util[_0x6462('0x14')](_0x6462('0x15'),_0x52eab8[_0x6462('0x6')],_0x52eab8[_0x6462('0x9')],JSON['stringify'](_0x4c19ee)));rp(_0x4c19ee)[_0x6462('0x16')](function(_0xbca63b){_0x6349ee=!_[_0x6462('0x17')](_0x6349ee)?',\x20request\x20body:\x20'+_0x6349ee:'';_0x1c738c=typeof _0xbca63b['body']===_0x6462('0x18')?JSON[_0x6462('0x19')](_0xbca63b[_0x6462('0x12')]):_0xbca63b['body'];logger[_0x6462('0x1a')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x52eab8[_0x6462('0x6')],_0x52eab8['data2'],_0xbca63b[_0x6462('0x1b')],_0x1c738c));})[_0x6462('0x1c')](function(_0x3ad5a3){logger[_0x6462('0xf')](util[_0x6462('0x14')](_0x6462('0x1d'),_0x52eab8[_0x6462('0x6')],_0x52eab8[_0x6462('0x9')],_0x3ad5a3[_0x6462('0x1b')],_0x3ad5a3[_0x6462('0x1e')],_0x3ad5a3[_0x6462('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9726f1c..584552c 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 _0x4ed7=['rpc','error','message','result','exports','bluebird','../../config/logger','routing','client','http','request','then','debug'];(function(_0x5beb44,_0x26cac6){var _0x1968a0=function(_0x35d0b2){while(--_0x35d0b2){_0x5beb44['push'](_0x5beb44['shift']());}};_0x1968a0(++_0x26cac6);}(_0x4ed7,0xc8));var _0x74ed=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x4ed7[_0xbc4560];return _0x298cfb;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x74ed('0x0'));var logger=require(_0x74ed('0x1'))(_0x74ed('0x2'));var client=jayson[_0x74ed('0x3')][_0x74ed('0x4')]({'port':0x2329});client['Request']=function(_0x41a286,_0x120606){return new BPromise(function(_0x2d4940,_0xcaf2d9){return client[_0x74ed('0x5')](_0x41a286,_0x120606)[_0x74ed('0x6')](function(_0x495fba){logger[_0x74ed('0x7')](_0x74ed('0x8'),_0x74ed('0x2'),_0x41a286,_0x120606,_0x495fba);if(_0x495fba[_0x74ed('0x9')]){logger['error'](_0x74ed('0x8'),'routing',_0x41a286,_0x495fba[_0x74ed('0x9')][_0x74ed('0xa')],_0x120606);return _0xcaf2d9(_0x495fba[_0x74ed('0x9')][_0x74ed('0xa')]);}else{return _0x2d4940(_0x495fba[_0x74ed('0xb')]);}})['catch'](function(_0x5cc6c0){logger[_0x74ed('0x9')](_0x74ed('0x8'),_0x74ed('0x2'),_0x41a286,_0x5cc6c0,_0x120606);return _0xcaf2d9(_0x5cc6c0);});});};module[_0x74ed('0xc')]=client; \ No newline at end of file +var _0x11cc=['client','http','Request','request','debug','rpc','error','message','result','exports','bluebird','routing'];(function(_0x466b8c,_0x492ed0){var _0x3f461d=function(_0x1bb52c){while(--_0x1bb52c){_0x466b8c['push'](_0x466b8c['shift']());}};_0x3f461d(++_0x492ed0);}(_0x11cc,0x18a));var _0xc11c=function(_0x36bf75,_0x34b46a){_0x36bf75=_0x36bf75-0x0;var _0x49660f=_0x11cc[_0x36bf75];return _0x49660f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc11c('0x0'));var logger=require('../../config/logger')(_0xc11c('0x1'));var client=jayson[_0xc11c('0x2')][_0xc11c('0x3')]({'port':0x2329});client[_0xc11c('0x4')]=function(_0x3c3153,_0x5aeac4){return new BPromise(function(_0x4c3328,_0x27ef2e){return client[_0xc11c('0x5')](_0x3c3153,_0x5aeac4)['then'](function(_0x555d6f){logger[_0xc11c('0x6')](_0xc11c('0x7'),'routing',_0x3c3153,_0x5aeac4,_0x555d6f);if(_0x555d6f[_0xc11c('0x8')]){logger[_0xc11c('0x8')]('rpc',_0xc11c('0x1'),_0x3c3153,_0x555d6f[_0xc11c('0x8')][_0xc11c('0x9')],_0x5aeac4);return _0x27ef2e(_0x555d6f['error']['message']);}else{return _0x4c3328(_0x555d6f[_0xc11c('0xa')]);}})['catch'](function(_0xaa05ee){logger[_0xc11c('0x8')]('rpc',_0xc11c('0x1'),_0x3c3153,_0xaa05ee,_0x5aeac4);return _0x27ef2e(_0xaa05ee);});});};module[_0xc11c('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f550120..e573801 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 _0x97db=['getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/setting','resolve','then','getMailAccounts','refresh'];(function(_0x4cb2a9,_0x2533ca){var _0x157ce=function(_0x5a9ff9){while(--_0x5a9ff9){_0x4cb2a9['push'](_0x4cb2a9['shift']());}};_0x157ce(++_0x2533ca);}(_0x97db,0x1b4));var _0xb97d=function(_0x27fc63,_0x46356b){_0x27fc63=_0x27fc63-0x0;var _0x579b8f=_0x97db[_0x27fc63];return _0x579b8f;};'use strict';var BPromise=require(_0xb97d('0x0'));var server=require(_0xb97d('0x1'));var Realtime=require(_0xb97d('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xb97d('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb97d('0x4')]()[_0xb97d('0x5')](mailAccount[_0xb97d('0x6')]())['then'](realtime['initMailAccounts']())[_0xb97d('0x5')](function(){email[_0xb97d('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xb97d('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xb97d('0x8')]();})[_0xb97d('0x5')](function(_0x48988e){return setInterval(initRealtime,_0x48988e[_0xb97d('0x9')]*0x3e8);})[_0xb97d('0xa')](function(_0x12e003){console[_0xb97d('0xb')](_0x12e003);});}main(); \ No newline at end of file +var _0x8014=['then','getMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./realtime','./lib/email','./rpc/mailAccount','resolve'];(function(_0x1d0e6,_0xc95248){var _0x39b273=function(_0x5105f1){while(--_0x5105f1){_0x1d0e6['push'](_0x1d0e6['shift']());}};_0x39b273(++_0xc95248);}(_0x8014,0x163));var _0x4801=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x8014[_0x31bab3];return _0x4fd382;};'use strict';var BPromise=require(_0x4801('0x0'));var server=require('./server');var Realtime=require(_0x4801('0x1'));var EmailChannel=require(_0x4801('0x2'));var mailAccount=require(_0x4801('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4801('0x4')]()[_0x4801('0x5')](mailAccount[_0x4801('0x6')]())[_0x4801('0x5')](realtime['initMailAccounts']())[_0x4801('0x5')](function(){email['refresh'](realtime[_0x4801('0x7')]);return realtime;});}function main(){return server[_0x4801('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x4801('0x5')](function(){return setting[_0x4801('0x9')]();})[_0x4801('0x5')](function(_0x459aa1){return setInterval(initRealtime,_0x459aa1[_0x4801('0xa')]*0x3e8);})[_0x4801('0xb')](function(_0x921c0f){console['log'](_0x921c0f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 788ab6b..211ea75 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 _0xab92=['localhost','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','connected','messages','info','lastName','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis'];(function(_0x2cb57d,_0x223577){var _0x58f052=function(_0x5b8df1){while(--_0x5b8df1){_0x2cb57d['push'](_0x2cb57d['shift']());}};_0x58f052(++_0x223577);}(_0xab92,0xed));var _0x2ab9=function(_0x40b878,_0x46b9d3){_0x40b878=_0x40b878-0x0;var _0x587369=_0xab92[_0x40b878];return _0x587369;};'use strict';var _=require(_0x2ab9('0x0'));var moment=require('moment');var BPromise=require(_0x2ab9('0x1'));var md5=require(_0x2ab9('0x2'));var Redis=require(_0x2ab9('0x3'));var config=require(_0x2ab9('0x4'));var logger=require(_0x2ab9('0x5'))(_0x2ab9('0x6'));config[_0x2ab9('0x7')]=_['defaults'](config[_0x2ab9('0x7')],{'host':_0x2ab9('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2ab9('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5ef8ca){logger['info'](_0x2ab9('0x9'));this[_0x2ab9('0xa')]=_0x5ef8ca[_0x2ab9('0xa')];this[_0x2ab9('0xb')]={};this[_0x2ab9('0xc')]=new EmailSmtp();}EmailChannel[_0x2ab9('0xd')][_0x2ab9('0xe')]=function(_0x218e34){var _0x341886=this[_0x2ab9('0xa')][_0x218e34];var _0x1be384={'id':_0x341886['id'],'name':_0x341886[_0x2ab9('0xf')],'key':_0x341886[_0x2ab9('0x10')],'active':_0x341886[_0x2ab9('0x11')],'Imap':{'status':_0x341886[_0x2ab9('0x12')][_0x2ab9('0x13')],'messageStatus':_0x341886[_0x2ab9('0x12')][_0x2ab9('0x14')],'total':_0x341886[_0x2ab9('0x12')][_0x2ab9('0x15')]}};if(_[_0x2ab9('0x16')](md5Accounts[_0x218e34])){md5Accounts[_0x218e34]={};}var _0x318d46=md5(JSON[_0x2ab9('0x17')](_0x1be384));if(md5Accounts[_0x218e34][_0x2ab9('0x2')]!==_0x318d46){md5Accounts[_0x218e34][_0x2ab9('0x2')]=_0x318d46;io[_0x2ab9('0xe')](_0x2ab9('0x18'),_0x1be384);}};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x19')]=function(_0x54c324){for(var _0x56d3b3 in _0x54c324){if(_0x54c324['hasOwnProperty'](_0x56d3b3)){if(_0x54c324[_0x56d3b3][_0x2ab9('0x12')]&&_0x54c324[_0x56d3b3][_0x2ab9('0x11')]){var _0x19701c=_0x54c324[_0x56d3b3][_0x2ab9('0x12')];if(!this[_0x2ab9('0xb')]['hasOwnProperty'](_0x19701c['id'])){this[_0x2ab9('0xb')][_0x19701c['id']]=new EmailImap(_0x19701c,_0x54c324[_0x56d3b3]['email']);this[_0x2ab9('0xb')][_0x19701c['id']]['on'](_0x2ab9('0x1a'),this[_0x2ab9('0x1b')][_0x2ab9('0x1c')](this,_0x56d3b3));this[_0x2ab9('0xb')][_0x19701c['id']]['on']('email',this[_0x2ab9('0x1d')]['bind'](this,_0x56d3b3));this[_0x2ab9('0xb')][_0x19701c['id']]['on'](_0x2ab9('0x1e'),this[_0x2ab9('0x1f')]['bind'](this,_0x56d3b3));this['imapAccounts'][_0x19701c['id']]['on'](_0x2ab9('0x20'),this[_0x2ab9('0x21')][_0x2ab9('0x1c')](this,_0x56d3b3));}}else{if(_[_0x2ab9('0x16')](this[_0x2ab9('0xa')][_0x56d3b3]['Imap'])){this[_0x2ab9('0xa')][_0x56d3b3][_0x2ab9('0x12')]={};}this[_0x2ab9('0xa')][_0x56d3b3][_0x2ab9('0x12')][_0x2ab9('0x13')]='disabled';this[_0x2ab9('0xa')][_0x56d3b3][_0x2ab9('0x12')][_0x2ab9('0x14')]='';this['emit'](_0x56d3b3);}}}};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x1b')]=function(_0x281850,_0x5613df){if(this['mailAccounts'][_0x281850]){this[_0x2ab9('0xa')][_0x281850]['Imap'][_0x2ab9('0x13')]=_0x2ab9('0x22');this['mailAccounts'][_0x281850][_0x2ab9('0x12')][_0x2ab9('0x14')]=_0x5613df[_0x2ab9('0xf')];if(_0x5613df[_0x2ab9('0x23')]){this[_0x2ab9('0xa')][_0x281850][_0x2ab9('0x12')]['total']=_0x5613df[_0x2ab9('0x23')]['total'];}return this[_0x2ab9('0xe')](_0x281850);}};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x1d')]=function(_0xc56944,_0x5e29d3){logger[_0x2ab9('0x24')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5e29d3['firstName'],_0x5e29d3[_0x2ab9('0x25')],_0x5e29d3['from'],_0xc56944);if(this['mailAccounts'][_0xc56944]){return mailAccount['notify'](_0xc56944,_0x5e29d3)[_0x2ab9('0x26')](function(_0x51b3ec){if(_0x51b3ec){logger[_0x2ab9('0x24')](_0x2ab9('0x27'));}})[_0x2ab9('0x28')](function(_0x5e76f8){logger[_0x2ab9('0x20')](_0x2ab9('0x29'),JSON[_0x2ab9('0x17')](_0x5e76f8));});}};EmailChannel['prototype'][_0x2ab9('0x1f')]=function(_0x3d51c4){if(this[_0x2ab9('0xa')][_0x3d51c4]&&this[_0x2ab9('0xa')][_0x3d51c4][_0x2ab9('0x12')]){if(this[_0x2ab9('0xb')][this['mailAccounts'][_0x3d51c4][_0x2ab9('0x12')]['id']]){delete this[_0x2ab9('0xb')][this['mailAccounts'][_0x3d51c4][_0x2ab9('0x12')]['id']];}this[_0x2ab9('0xa')][_0x3d51c4][_0x2ab9('0x12')]['lastSync']=moment();this[_0x2ab9('0xe')](_0x3d51c4);}};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x21')]=function(_0x5565f5,_0x6736e0){if(this[_0x2ab9('0xa')][_0x5565f5]){this[_0x2ab9('0xa')][_0x5565f5][_0x2ab9('0x12')][_0x2ab9('0x13')]='error';this['mailAccounts'][_0x5565f5][_0x2ab9('0x12')][_0x2ab9('0x14')]=_0x6736e0;return this[_0x2ab9('0xe')](_0x5565f5);}};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x2a')]=function(_0x251271,_0x5e81e2){return this[_0x2ab9('0xc')][_0x2ab9('0x2b')](_0x251271,_0x5e81e2);};EmailChannel[_0x2ab9('0xd')][_0x2ab9('0x2c')]=function(_0x593921){var _0x4c56e3=this;if(this[_0x2ab9('0xa')][_0x593921['id']]){if(_[_0x2ab9('0x16')](this['mailAccounts'][_0x593921['id']]['Smtp'])){this['mailAccounts'][_0x593921['id']][_0x2ab9('0x2d')]={};}this['mailAccounts'][_0x593921['id']][_0x2ab9('0x2d')]['lastSync']=moment();return new BPromise(function(_0x5fc946,_0x1660b5){return _0x4c56e3[_0x2ab9('0xc')][_0x2ab9('0x2e')](_0x593921)[_0x2ab9('0x26')](function(_0x356afa){_0x4c56e3[_0x2ab9('0xa')][_0x593921['id']][_0x2ab9('0x2d')][_0x2ab9('0x13')]=_0x2ab9('0x2f');_0x4c56e3[_0x2ab9('0xa')][_0x593921['id']]['Smtp'][_0x2ab9('0x14')]='';_0x4c56e3[_0x2ab9('0xe')](_0x593921['id']);_0x5fc946(_0x356afa);})[_0x2ab9('0x28')](function(_0x3e00ca){_0x4c56e3[_0x2ab9('0xa')][_0x593921['id']][_0x2ab9('0x2d')][_0x2ab9('0x13')]='error';_0x4c56e3['mailAccounts'][_0x593921['id']][_0x2ab9('0x2d')][_0x2ab9('0x14')]=_0x3e00ca;_0x4c56e3[_0x2ab9('0xe')](_0x593921['id']);_0x1660b5(_0x3e00ca);});});}return this[_0x2ab9('0xc')][_0x2ab9('0x2e')](_0x593921);};module[_0x2ab9('0x30')]=EmailChannel; \ No newline at end of file +var _0x78b6=['total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapEmail','bind','end','handleImapEnd','error','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','sendMail','send','verifySmtp','Smtp','verify','verified','exports','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','messageStatus','Imap'];(function(_0x120daf,_0x181a4d){var _0x489123=function(_0x7276a1){while(--_0x7276a1){_0x120daf['push'](_0x120daf['shift']());}};_0x489123(++_0x181a4d);}(_0x78b6,0x7f));var _0x678b=function(_0x3044e3,_0x255336){_0x3044e3=_0x3044e3-0x0;var _0x389181=_0x78b6[_0x3044e3];return _0x389181;};'use strict';var _=require('lodash');var moment=require(_0x678b('0x0'));var BPromise=require(_0x678b('0x1'));var md5=require(_0x678b('0x2'));var Redis=require(_0x678b('0x3'));var config=require('../../../config/environment');var logger=require(_0x678b('0x4'))(_0x678b('0x5'));config[_0x678b('0x6')]=_[_0x678b('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x678b('0x8'))(new Redis(config[_0x678b('0x6')]));var EmailImap=require(_0x678b('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x678b('0xa'));var md5Accounts={};function EmailChannel(_0x3e9caa){logger[_0x678b('0xb')]('start\x20email\x20channel');this[_0x678b('0xc')]=_0x3e9caa[_0x678b('0xc')];this[_0x678b('0xd')]={};this[_0x678b('0xe')]=new EmailSmtp();}EmailChannel[_0x678b('0xf')][_0x678b('0x10')]=function(_0x4db6f4){var _0x1b081b=this[_0x678b('0xc')][_0x4db6f4];var _0xed8c98={'id':_0x1b081b['id'],'name':_0x1b081b[_0x678b('0x11')],'key':_0x1b081b[_0x678b('0x12')],'active':_0x1b081b[_0x678b('0x13')],'Imap':{'status':_0x1b081b['Imap'][_0x678b('0x14')],'messageStatus':_0x1b081b['Imap'][_0x678b('0x15')],'total':_0x1b081b[_0x678b('0x16')][_0x678b('0x17')]}};if(_[_0x678b('0x18')](md5Accounts[_0x4db6f4])){md5Accounts[_0x4db6f4]={};}var _0xb3a04f=md5(JSON[_0x678b('0x19')](_0xed8c98));if(md5Accounts[_0x4db6f4][_0x678b('0x2')]!==_0xb3a04f){md5Accounts[_0x4db6f4][_0x678b('0x2')]=_0xb3a04f;io[_0x678b('0x10')](_0x678b('0x1a'),_0xed8c98);}};EmailChannel[_0x678b('0xf')][_0x678b('0x1b')]=function(_0x410c8f){for(var _0x2d85b6 in _0x410c8f){if(_0x410c8f[_0x678b('0x1c')](_0x2d85b6)){if(_0x410c8f[_0x2d85b6][_0x678b('0x16')]&&_0x410c8f[_0x2d85b6][_0x678b('0x13')]){var _0xe66872=_0x410c8f[_0x2d85b6]['Imap'];if(!this['imapAccounts']['hasOwnProperty'](_0xe66872['id'])){this['imapAccounts'][_0xe66872['id']]=new EmailImap(_0xe66872,_0x410c8f[_0x2d85b6][_0x678b('0x5')]);this[_0x678b('0xd')][_0xe66872['id']]['on'](_0x678b('0x1d'),this['handleImapBox']['bind'](this,_0x2d85b6));this[_0x678b('0xd')][_0xe66872['id']]['on']('email',this[_0x678b('0x1e')][_0x678b('0x1f')](this,_0x2d85b6));this['imapAccounts'][_0xe66872['id']]['on'](_0x678b('0x20'),this[_0x678b('0x21')][_0x678b('0x1f')](this,_0x2d85b6));this[_0x678b('0xd')][_0xe66872['id']]['on'](_0x678b('0x22'),this['handleImapError']['bind'](this,_0x2d85b6));}}else{if(_[_0x678b('0x18')](this[_0x678b('0xc')][_0x2d85b6]['Imap'])){this[_0x678b('0xc')][_0x2d85b6][_0x678b('0x16')]={};}this[_0x678b('0xc')][_0x2d85b6]['Imap'][_0x678b('0x14')]='disabled';this[_0x678b('0xc')][_0x2d85b6][_0x678b('0x16')][_0x678b('0x15')]='';this[_0x678b('0x10')](_0x2d85b6);}}}};EmailChannel[_0x678b('0xf')]['handleImapBox']=function(_0x39e14f,_0x5f46f3){if(this[_0x678b('0xc')][_0x39e14f]){this[_0x678b('0xc')][_0x39e14f]['Imap'][_0x678b('0x14')]='connected';this['mailAccounts'][_0x39e14f][_0x678b('0x16')][_0x678b('0x15')]=_0x5f46f3[_0x678b('0x11')];if(_0x5f46f3[_0x678b('0x23')]){this[_0x678b('0xc')][_0x39e14f][_0x678b('0x16')][_0x678b('0x17')]=_0x5f46f3[_0x678b('0x23')]['total'];}return this[_0x678b('0x10')](_0x39e14f);}};EmailChannel[_0x678b('0xf')][_0x678b('0x1e')]=function(_0x25cf47,_0x4d5664){logger['info'](_0x678b('0x24'),_0x4d5664[_0x678b('0x25')],_0x4d5664[_0x678b('0x26')],_0x4d5664[_0x678b('0x27')],_0x25cf47);if(this['mailAccounts'][_0x25cf47]){return mailAccount['notify'](_0x25cf47,_0x4d5664)[_0x678b('0x28')](function(_0x19d024){if(_0x19d024){logger['info'](_0x678b('0x29'));}})[_0x678b('0x2a')](function(_0x3cd001){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x678b('0x19')](_0x3cd001));});}};EmailChannel[_0x678b('0xf')]['handleImapEnd']=function(_0x1a22e5){if(this[_0x678b('0xc')][_0x1a22e5]&&this[_0x678b('0xc')][_0x1a22e5]['Imap']){if(this[_0x678b('0xd')][this[_0x678b('0xc')][_0x1a22e5][_0x678b('0x16')]['id']]){delete this['imapAccounts'][this[_0x678b('0xc')][_0x1a22e5][_0x678b('0x16')]['id']];}this['mailAccounts'][_0x1a22e5]['Imap']['lastSync']=moment();this[_0x678b('0x10')](_0x1a22e5);}};EmailChannel['prototype']['handleImapError']=function(_0x1675cf,_0x6762e2){if(this[_0x678b('0xc')][_0x1675cf]){this[_0x678b('0xc')][_0x1675cf][_0x678b('0x16')]['status']='error';this[_0x678b('0xc')][_0x1675cf]['Imap'][_0x678b('0x15')]=_0x6762e2;return this[_0x678b('0x10')](_0x1675cf);}};EmailChannel[_0x678b('0xf')][_0x678b('0x2b')]=function(_0x78ade1,_0x5109b3){return this[_0x678b('0xe')][_0x678b('0x2c')](_0x78ade1,_0x5109b3);};EmailChannel[_0x678b('0xf')][_0x678b('0x2d')]=function(_0x336350){var _0x4d1e4e=this;if(this['mailAccounts'][_0x336350['id']]){if(_[_0x678b('0x18')](this[_0x678b('0xc')][_0x336350['id']]['Smtp'])){this['mailAccounts'][_0x336350['id']][_0x678b('0x2e')]={};}this[_0x678b('0xc')][_0x336350['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x532d0d,_0x2c6896){return _0x4d1e4e[_0x678b('0xe')][_0x678b('0x2f')](_0x336350)[_0x678b('0x28')](function(_0x58e35c){_0x4d1e4e[_0x678b('0xc')][_0x336350['id']][_0x678b('0x2e')][_0x678b('0x14')]=_0x678b('0x30');_0x4d1e4e[_0x678b('0xc')][_0x336350['id']][_0x678b('0x2e')]['messageStatus']='';_0x4d1e4e[_0x678b('0x10')](_0x336350['id']);_0x532d0d(_0x58e35c);})[_0x678b('0x2a')](function(_0x401282){_0x4d1e4e['mailAccounts'][_0x336350['id']][_0x678b('0x2e')][_0x678b('0x14')]='error';_0x4d1e4e['mailAccounts'][_0x336350['id']][_0x678b('0x2e')][_0x678b('0x15')]=_0x401282;_0x4d1e4e['emit'](_0x336350['id']);_0x2c6896(_0x401282);});});}return this[_0x678b('0xe')][_0x678b('0x2f')](_0x336350);};module[_0x678b('0x31')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 162c700..d69c368 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 _0xab2a=['readUnseen','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleFetchEnd','handleCloseBox','textCode','hasOwnProperty','path','util','imap','randomstring','simpleParser','iconv','Iconv','EventEmitter','mailbox','INBOX','account','getAccount','once','ready','handleReady','end','handleEnd','bind','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','tls','autotls','required','getHost','port','email','anonymous@xcally.com','openBox','handleOpenBox','emit'];(function(_0x534ca8,_0x43dbd4){var _0x32f906=function(_0x4cc311){while(--_0x4cc311){_0x534ca8['push'](_0x534ca8['shift']());}};_0x32f906(++_0x43dbd4);}(_0xab2a,0x1a1));var _0xaab2=function(_0x1f8e39,_0x47e328){_0x1f8e39=_0x1f8e39-0x0;var _0x4f86ed=_0xab2a[_0x1f8e39];return _0x4f86ed;};'use strict';var fs=require('fs');var path=require(_0xaab2('0x0'));var util=require(_0xaab2('0x1'));var Imap=require(_0xaab2('0x2'));var _=require('lodash');var rs=require(_0xaab2('0x3'));var simpleParser=require('mailparser')[_0xaab2('0x4')];var Iconv=require(_0xaab2('0x5'))[_0xaab2('0x6')];var EventEmitter=require('events')[_0xaab2('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x5ec536,_0x113939){this[_0xaab2('0x8')]=_0xaab2('0x9');this[_0xaab2('0xa')]=this[_0xaab2('0xb')](_0x5ec536,_0x113939);this[_0xaab2('0x2')]=new Imap(this[_0xaab2('0xa')]);this[_0xaab2('0x2')][_0xaab2('0xc')](_0xaab2('0xd'),this[_0xaab2('0xe')]['bind'](this));this[_0xaab2('0x2')]['once'](_0xaab2('0xf'),this[_0xaab2('0x10')][_0xaab2('0x11')](this));this[_0xaab2('0x2')]['on']('error',this[_0xaab2('0x12')][_0xaab2('0x11')](this));this[_0xaab2('0x2')][_0xaab2('0x13')]();}util[_0xaab2('0x14')](EmailImap,EventEmitter);EmailImap[_0xaab2('0x15')]['getAccount']=function(_0x58cab0,_0x1ff2ab){var _0x43e0c6={'connTimeout':_0x58cab0['connTimeout']?_0x58cab0[_0xaab2('0x16')]*0x3e8:0x2710,'authTimeout':_0x58cab0[_0xaab2('0x17')]?_0x58cab0[_0xaab2('0x17')]*0x3e8:0x1388};if(_[_0xaab2('0x18')](_0x58cab0[_0xaab2('0x19')])){if(_0x58cab0['authentication']){_0x43e0c6['user']=_0x58cab0[_0xaab2('0x1a')];_0x43e0c6[_0xaab2('0x1b')]=_0x58cab0['password'];}_0x43e0c6[_0xaab2('0x1c')]=_0x58cab0[_0xaab2('0x1c')];_0x43e0c6['port']=_0x58cab0['port']||0x3e1;if(_0x58cab0[_0xaab2('0x1d')]){_0x43e0c6[_0xaab2('0x1d')]=!![];}else{_0x43e0c6[_0xaab2('0x1d')]=![];_0x43e0c6[_0xaab2('0x1e')]=_0xaab2('0x1f');}}else{_0x43e0c6[_0xaab2('0x1a')]=_0x58cab0[_0xaab2('0x1a')];_0x43e0c6[_0xaab2('0x1b')]=_0x58cab0[_0xaab2('0x1b')];_0x43e0c6[_0xaab2('0x1c')]=utils[_0xaab2('0x20')](_0x58cab0[_0xaab2('0x19')]);_0x43e0c6[_0xaab2('0x21')]=0x3e1;_0x43e0c6[_0xaab2('0x1d')]=!![];}_0x43e0c6[_0xaab2('0x22')]=_0x1ff2ab||_0x58cab0[_0xaab2('0x1a')]||_0xaab2('0x23');return _0x43e0c6;};EmailImap[_0xaab2('0x15')][_0xaab2('0xe')]=function(){this['imap'][_0xaab2('0x24')](this['mailbox'],![],this[_0xaab2('0x25')]['bind'](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x25')]=function(_0x4d7ed,_0x35e3e6){if(_0x4d7ed){this[_0xaab2('0x12')](_0x4d7ed,!![]);}else{this[_0xaab2('0x26')]('box',_0x35e3e6);this[_0xaab2('0x27')]();}};EmailImap[_0xaab2('0x15')]['handleCloseBox']=function(_0x511af9){if(_0x511af9){this['handleError'](_0x511af9,!![]);}else{this[_0xaab2('0x2')]['end']();}};EmailImap[_0xaab2('0x15')][_0xaab2('0x27')]=function(){this[_0xaab2('0x2')]['search']([_0xaab2('0x28')],this[_0xaab2('0x29')]['bind'](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x29')]=function(_0x1ab9e5,_0x2e30f5){if(_0x1ab9e5){this[_0xaab2('0x12')](_0x1ab9e5,!![]);}else{if(_0x2e30f5[_0xaab2('0x2a')]){try{var _0x2a3b5b=this['imap'][_0xaab2('0x2b')](_0x2e30f5,{'bodies':'','markSeen':!![]});_0x2a3b5b['on'](_0xaab2('0x2c'),this[_0xaab2('0x2d')][_0xaab2('0x11')](this));_0x2a3b5b['once'](_0xaab2('0x2e'),this[_0xaab2('0x2f')][_0xaab2('0x11')](this));_0x2a3b5b[_0xaab2('0xc')](_0xaab2('0xf'),this['handleFetchEnd'][_0xaab2('0x11')](this));}catch(_0x825af7){logger['error'](_0x825af7);}}else{this[_0xaab2('0x2')][_0xaab2('0x30')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xaab2('0x15')][_0xaab2('0x2d')]=function(_0xde0b8b,_0x232851){_0xde0b8b['on']('body',this[_0xaab2('0x31')]['bind'](this));_0xde0b8b[_0xaab2('0xc')](_0xaab2('0x32'),this[_0xaab2('0x33')][_0xaab2('0x11')](this));_0xde0b8b['once'](_0xaab2('0xf'),this['handleMessageEnd'][_0xaab2('0x11')](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x31')]=function(_0x37876b,_0x468595){simpleParser(_0x37876b,{'Iconv':Iconv},this['handleSimpleParser'][_0xaab2('0x11')](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x33')]=function(_0xfee92c){};EmailImap[_0xaab2('0x15')]['handleMessageEnd']=function(){};EmailImap[_0xaab2('0x15')][_0xaab2('0x34')]=function(_0x375244,_0x3caf98){if(_0x375244){logger[_0xaab2('0x2e')](_0x375244);}else{var _0x15f7a9=this;utils['parser'](this[_0xaab2('0xa')],_0x3caf98,function(_0x340458){_0x15f7a9[_0xaab2('0x26')](_0xaab2('0x22'),_0x340458);});}};EmailImap[_0xaab2('0x15')][_0xaab2('0x35')]=function(){this[_0xaab2('0x2')][_0xaab2('0x30')](!![],this[_0xaab2('0x36')][_0xaab2('0x11')](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x2f')]=function(_0x171f79){this[_0xaab2('0x12')](_0x171f79);this[_0xaab2('0x2')][_0xaab2('0x30')](!![],this[_0xaab2('0x36')][_0xaab2('0x11')](this));};EmailImap[_0xaab2('0x15')][_0xaab2('0x10')]=function(){this['emit'](_0xaab2('0xf'));};EmailImap[_0xaab2('0x15')][_0xaab2('0x12')]=function(_0x2f5f83,_0x506ec4){logger[_0xaab2('0x2e')](_0xaab2('0x12'),this[_0xaab2('0xa')][_0xaab2('0x22')],JSON['stringify'](_0x2f5f83));var _0x130d6a='';if(_0x2f5f83){if(_0x2f5f83[_0xaab2('0x37')]){_0x130d6a=_0x2f5f83[_0xaab2('0x37')];}else{for(var _0x4adfc3 in _0x2f5f83){if(_0x2f5f83[_0xaab2('0x38')](_0x4adfc3)){_0x130d6a+=_['upperFirst'](_0x4adfc3)+':\x20'+_0x2f5f83[_0x4adfc3]+'\x0a';}}}}if(_0x506ec4){this[_0xaab2('0x2')][_0xaab2('0xf')]();}else{this[_0xaab2('0x26')]('error',_0x130d6a);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x1319=['box','handleCloseBox','handleError','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','handleEnd','textCode','hasOwnProperty','upperFirst','path','util','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','mailbox','account','getAccount','imap','once','ready','bind','end','error','connect','inherits','prototype','connTimeout','authTimeout','authentication','password','host','tls','autotls','required','user','getHost','service','email','anonymous@xcally.com','handleReady','handleOpenBox','emit'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x1319,0x143));var _0x9131=function(_0x595e57,_0x476362){_0x595e57=_0x595e57-0x0;var _0xd7a8a8=_0x1319[_0x595e57];return _0xd7a8a8;};'use strict';var fs=require('fs');var path=require(_0x9131('0x0'));var util=require(_0x9131('0x1'));var Imap=require('imap');var _=require(_0x9131('0x2'));var rs=require(_0x9131('0x3'));var simpleParser=require('mailparser')[_0x9131('0x4')];var Iconv=require(_0x9131('0x5'))[_0x9131('0x6')];var EventEmitter=require(_0x9131('0x7'))[_0x9131('0x8')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x2fd13e,_0x138ea0){this[_0x9131('0x9')]='INBOX';this[_0x9131('0xa')]=this[_0x9131('0xb')](_0x2fd13e,_0x138ea0);this[_0x9131('0xc')]=new Imap(this[_0x9131('0xa')]);this[_0x9131('0xc')][_0x9131('0xd')](_0x9131('0xe'),this['handleReady'][_0x9131('0xf')](this));this[_0x9131('0xc')][_0x9131('0xd')](_0x9131('0x10'),this['handleEnd']['bind'](this));this[_0x9131('0xc')]['on'](_0x9131('0x11'),this['handleError']['bind'](this));this['imap'][_0x9131('0x12')]();}util[_0x9131('0x13')](EmailImap,EventEmitter);EmailImap[_0x9131('0x14')][_0x9131('0xb')]=function(_0x1c6e2f,_0x2ab44a){var _0x474c98={'connTimeout':_0x1c6e2f[_0x9131('0x15')]?_0x1c6e2f[_0x9131('0x15')]*0x3e8:0x2710,'authTimeout':_0x1c6e2f['authTimeout']?_0x1c6e2f[_0x9131('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x1c6e2f['service'])){if(_0x1c6e2f[_0x9131('0x17')]){_0x474c98['user']=_0x1c6e2f['user'];_0x474c98[_0x9131('0x18')]=_0x1c6e2f['password'];}_0x474c98[_0x9131('0x19')]=_0x1c6e2f['host'];_0x474c98['port']=_0x1c6e2f['port']||0x3e1;if(_0x1c6e2f[_0x9131('0x1a')]){_0x474c98[_0x9131('0x1a')]=!![];}else{_0x474c98[_0x9131('0x1a')]=![];_0x474c98[_0x9131('0x1b')]=_0x9131('0x1c');}}else{_0x474c98[_0x9131('0x1d')]=_0x1c6e2f[_0x9131('0x1d')];_0x474c98[_0x9131('0x18')]=_0x1c6e2f['password'];_0x474c98[_0x9131('0x19')]=utils[_0x9131('0x1e')](_0x1c6e2f[_0x9131('0x1f')]);_0x474c98['port']=0x3e1;_0x474c98[_0x9131('0x1a')]=!![];}_0x474c98[_0x9131('0x20')]=_0x2ab44a||_0x1c6e2f[_0x9131('0x1d')]||_0x9131('0x21');return _0x474c98;};EmailImap[_0x9131('0x14')][_0x9131('0x22')]=function(){this[_0x9131('0xc')]['openBox'](this['mailbox'],![],this[_0x9131('0x23')][_0x9131('0xf')](this));};EmailImap['prototype'][_0x9131('0x23')]=function(_0x13a260,_0x4d3a6d){if(_0x13a260){this['handleError'](_0x13a260,!![]);}else{this[_0x9131('0x24')](_0x9131('0x25'),_0x4d3a6d);this['readUnseen']();}};EmailImap['prototype'][_0x9131('0x26')]=function(_0x145ac0){if(_0x145ac0){this[_0x9131('0x27')](_0x145ac0,!![]);}else{this[_0x9131('0xc')][_0x9131('0x10')]();}};EmailImap[_0x9131('0x14')]['readUnseen']=function(){this[_0x9131('0xc')]['search']([_0x9131('0x28')],this[_0x9131('0x29')][_0x9131('0xf')](this));};EmailImap[_0x9131('0x14')][_0x9131('0x29')]=function(_0x550f53,_0x50b19b){if(_0x550f53){this[_0x9131('0x27')](_0x550f53,!![]);}else{if(_0x50b19b[_0x9131('0x2a')]){try{var _0x1427e5=this['imap'][_0x9131('0x2b')](_0x50b19b,{'bodies':'','markSeen':!![]});_0x1427e5['on'](_0x9131('0x2c'),this[_0x9131('0x2d')][_0x9131('0xf')](this));_0x1427e5[_0x9131('0xd')](_0x9131('0x11'),this['handleFetchError'][_0x9131('0xf')](this));_0x1427e5[_0x9131('0xd')]('end',this[_0x9131('0x2e')][_0x9131('0xf')](this));}catch(_0x1f7ca9){logger[_0x9131('0x11')](_0x1f7ca9);}}else{this['imap'][_0x9131('0x2f')](!![],this[_0x9131('0x26')][_0x9131('0xf')](this));}}};EmailImap[_0x9131('0x14')][_0x9131('0x2d')]=function(_0x3f96e6,_0x52f7c6){_0x3f96e6['on'](_0x9131('0x30'),this[_0x9131('0x31')][_0x9131('0xf')](this));_0x3f96e6[_0x9131('0xd')](_0x9131('0x32'),this[_0x9131('0x33')][_0x9131('0xf')](this));_0x3f96e6[_0x9131('0xd')](_0x9131('0x10'),this[_0x9131('0x34')][_0x9131('0xf')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x20738b,_0x272624){simpleParser(_0x20738b,{'Iconv':Iconv},this['handleSimpleParser'][_0x9131('0xf')](this));};EmailImap[_0x9131('0x14')][_0x9131('0x33')]=function(_0xf9e106){};EmailImap[_0x9131('0x14')][_0x9131('0x34')]=function(){};EmailImap[_0x9131('0x14')][_0x9131('0x35')]=function(_0x53e195,_0x165c32){if(_0x53e195){logger[_0x9131('0x11')](_0x53e195);}else{var _0x318fd9=this;utils[_0x9131('0x36')](this['account'],_0x165c32,function(_0x242a09){_0x318fd9[_0x9131('0x24')]('email',_0x242a09);});}};EmailImap[_0x9131('0x14')][_0x9131('0x2e')]=function(){this[_0x9131('0xc')][_0x9131('0x2f')](!![],this[_0x9131('0x26')][_0x9131('0xf')](this));};EmailImap[_0x9131('0x14')][_0x9131('0x37')]=function(_0x403e93){this[_0x9131('0x27')](_0x403e93);this['imap'][_0x9131('0x2f')](!![],this[_0x9131('0x26')][_0x9131('0xf')](this));};EmailImap['prototype'][_0x9131('0x38')]=function(){this['emit'](_0x9131('0x10'));};EmailImap[_0x9131('0x14')]['handleError']=function(_0xa66f60,_0x2f9440){logger['error']('handleError',this[_0x9131('0xa')][_0x9131('0x20')],JSON['stringify'](_0xa66f60));var _0x393d25='';if(_0xa66f60){if(_0xa66f60['textCode']){_0x393d25=_0xa66f60[_0x9131('0x39')];}else{for(var _0x243062 in _0xa66f60){if(_0xa66f60[_0x9131('0x3a')](_0x243062)){_0x393d25+=_[_0x9131('0x3b')](_0x243062)+':\x20'+_0xa66f60[_0x243062]+'\x0a';}}}}if(_0x2f9440){this[_0x9131('0xc')][_0x9131('0x10')]();}else{this[_0x9131('0x24')](_0x9131('0x11'),_0x393d25);this['emit'](_0x9131('0x10'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 106b277..4c908e0 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 _0xa8a6=['toString','verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','createTransport','use','compile','sendMail'];(function(_0x7c39c3,_0x39fb4e){var _0x4dd879=function(_0x653344){while(--_0x653344){_0x7c39c3['push'](_0x7c39c3['shift']());}};_0x4dd879(++_0x39fb4e);}(_0xa8a6,0x16c));var _0x6a8a=function(_0x29a109,_0x1332bc){_0x29a109=_0x29a109-0x0;var _0x51406d=_0xa8a6[_0x29a109];return _0x51406d;};'use strict';var nodemailer=require(_0x6a8a('0x0'));var BPromise=require(_0x6a8a('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6a8a('0x2')][_0x6a8a('0x3')]=function(_0x389786,_0x74b767){return new BPromise(function(_0x3c8800,_0x15b0ef){var _0x730990=nodemailer[_0x6a8a('0x4')](_0x389786);_0x730990[_0x6a8a('0x5')](_0x6a8a('0x6'),inlineBase64());_0x730990[_0x6a8a('0x7')](_0x74b767,function(_0x2c2865,_0x19d65a){if(_0x2c2865){_0x15b0ef(_0x2c2865[_0x6a8a('0x8')]());}else{_0x3c8800(_0x19d65a);}});});};EmailSmtp[_0x6a8a('0x2')]['verify']=function(_0x5c71f1){return new BPromise(function(_0x564e24,_0x26bddf){var _0x679bf3=nodemailer[_0x6a8a('0x4')](_0x5c71f1);_0x679bf3[_0x6a8a('0x9')](function(_0x21cd0d,_0x3e5e4c){if(_0x21cd0d){_0x26bddf(_0x21cd0d[_0x6a8a('0x8')]());}else{if(_0x3e5e4c){_0x564e24(_0x3e5e4c);}else{_0x26bddf(_0x6a8a('0xa'));}}});});};module[_0x6a8a('0xb')]=EmailSmtp; \ No newline at end of file +var _0x8dd2=['verify','Not\x20verifired','nodemailer','bluebird','send','createTransport','use','compile','sendMail','toString','prototype'];(function(_0xe71cf6,_0x120a90){var _0x1ffd42=function(_0x5b1ab5){while(--_0x5b1ab5){_0xe71cf6['push'](_0xe71cf6['shift']());}};_0x1ffd42(++_0x120a90);}(_0x8dd2,0x14c));var _0x28dd=function(_0x4099d4,_0x38671e){_0x4099d4=_0x4099d4-0x0;var _0x4171b1=_0x8dd2[_0x4099d4];return _0x4171b1;};'use strict';var nodemailer=require(_0x28dd('0x0'));var BPromise=require(_0x28dd('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x28dd('0x2')]=function(_0x49c9a4,_0x73f4a1){return new BPromise(function(_0x38afc5,_0x41b051){var _0x30fe18=nodemailer[_0x28dd('0x3')](_0x49c9a4);_0x30fe18[_0x28dd('0x4')](_0x28dd('0x5'),inlineBase64());_0x30fe18[_0x28dd('0x6')](_0x73f4a1,function(_0x46be0c,_0x376eda){if(_0x46be0c){_0x41b051(_0x46be0c[_0x28dd('0x7')]());}else{_0x38afc5(_0x376eda);}});});};EmailSmtp[_0x28dd('0x8')][_0x28dd('0x9')]=function(_0x1bc190){return new BPromise(function(_0x58617f,_0x16f965){var _0x58df4f=nodemailer[_0x28dd('0x3')](_0x1bc190);_0x58df4f[_0x28dd('0x9')](function(_0x495fb9,_0x56097c){if(_0x495fb9){_0x16f965(_0x495fb9[_0x28dd('0x7')]());}else{if(_0x56097c){_0x58617f(_0x56097c);}else{_0x16f965(_0x28dd('0xa'));}}});});};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 8b8d68b..91068fd 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 _0x07fa=['head','name','substring','indexOf','length','slice','Anonymous','split','pop','generate','test','html','includes','Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous'];(function(_0x387e6f,_0x254dcc){var _0x153b3c=function(_0x1922b4){while(--_0x1922b4){_0x387e6f['push'](_0x387e6f['shift']());}};_0x153b3c(++_0x254dcc);}(_0x07fa,0x177));var _0xa07f=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x07fa[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var moment=require(_0xa07f('0x0'));var random=require(_0xa07f('0x1'));var fs=require('fs');var path=require(_0xa07f('0x2'));var util=require(_0xa07f('0x3'));var tnef=require(_0xa07f('0x4'));var logger=require('../../../config/logger')(_0xa07f('0x5'));var config=require(_0xa07f('0x6'));function getAddress(_0x573aa3){var _0x4ceab6=_['head'](_0x573aa3[_0xa07f('0x7')]);return _0x4ceab6&&_0x4ceab6[_0xa07f('0x8')]?_0x4ceab6['address']:_0xa07f('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x5d82e9){var _0x5cac85=_[_0xa07f('0xa')](_0x5d82e9[_0xa07f('0x7')]);if(_0x5cac85&&_0x5cac85['name']){if(_0x5cac85[_0xa07f('0xb')]==_0x5cac85[_0xa07f('0x8')]){return _0x5cac85[_0xa07f('0xb')][_0xa07f('0xc')](0x0,_0x5cac85[_0xa07f('0xb')][_0xa07f('0xd')]('@'));}var _0x7873c2=_0x5cac85[_0xa07f('0xb')]['split'](/\s+/);return _0x7873c2[_0xa07f('0xe')]>0x1?_0x7873c2[_0xa07f('0xf')](0x0,-0x1)['join']('\x20'):_0x5cac85[_0xa07f('0xb')];}return _0xa07f('0x10');}function getLastName(_0x30ed68){var _0x48e002=_[_0xa07f('0xa')](_0x30ed68['value']);if(_0x48e002&&_0x48e002[_0xa07f('0xb')]){var _0x20db62=_0x48e002[_0xa07f('0xb')][_0xa07f('0x11')](/\s+/);return _0x20db62['length']>0x1?_0x20db62[_0xa07f('0x12')]():'';}return'';}function getMails(_0x319924,_0x8d269e){var _0xfa96a='';for(var _0x4090a1=0x0;_0x4090a1<_0x8d269e['value'][_0xa07f('0xe')];_0x4090a1+=0x1){if(_0x8d269e['value'][_0x4090a1]['address']!==_0x319924){if(!_['isEmpty'](_0xfa96a)){_0xfa96a+=',';}_0xfa96a+=_0x8d269e['value'][_0x4090a1]['name']||_0x8d269e['value'][_0x4090a1][_0xa07f('0x8')]||'';_0xfa96a+='\x20<';_0xfa96a+=_0x8d269e[_0xa07f('0x7')][_0x4090a1][_0xa07f('0x8')]?_0x8d269e[_0xa07f('0x7')][_0x4090a1][_0xa07f('0x8')]:_0xa07f('0x9')+random[_0xa07f('0x13')](0x6)+'@xcally.com';_0xfa96a+='>';}}return _0xfa96a;}function parseEmail(_0x1480bc,_0x5155df,_0xe93a17){if(_0x5155df['html']){var _0x587d58=/)<[^<]*)*<\/script>/gi;while(_0x587d58[_0xa07f('0x14')](_0x5155df[_0xa07f('0x15')])){_0x5155df[_0xa07f('0x15')]=_0x5155df[_0xa07f('0x15')]['replace'](_0x587d58,'');}if(_0x5155df[_0xa07f('0x15')][_0xa07f('0x16')](_0xa07f('0x17'))){var _0x1b08df=[];_0x5155df[_0xa07f('0x18')][_0xa07f('0x19')](_0x482ed8=>{_0x1b08df[_0xa07f('0x1a')](_0x482ed8[_0xa07f('0x1b')]);});var _0x37093a=/]+>/g;var _0x3bd2c7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x459a6b=_0x5155df['html']['replace'](_0x3bd2c7,_0xa07f('0x1c'));var _0x2cdd67=_0x459a6b['replace'](_0x37093a,_0xa07f('0x1d'));for(let _0x327488=0x0;_0x327488<_0x1b08df[_0xa07f('0xe')];_0x327488++){var _0x5d8239=_0x2cdd67[_0xa07f('0x1e')](_0xa07f('0x1d'),'\x20[Attachment:\x20'+_0x1b08df[_0x327488]+'\x20]');_0x2cdd67=_0x5d8239;}_0x5155df[_0xa07f('0x15')]=_0x2cdd67;}_0xe93a17[_0xa07f('0x1f')]=_0x5155df[_0xa07f('0x15')];}else{_0xe93a17['body']=_0x5155df[_0xa07f('0x20')];}if(_0xe93a17[_0xa07f('0x1f')]){_0xe93a17['body']=_0xe93a17['body'][_0xa07f('0x1e')](/0x0){var _0x55f7b8=[_0xa07f('0x31'),_0xa07f('0x32'),'Precedence:\x20auto_reply'];for(var _0x3959d5=0x0;_0x3959d5<_0x5155df['headerLines'][_0xa07f('0xe')];_0x3959d5++){var _0x257125=_[_0xa07f('0xd')](_0x55f7b8,_0x5155df[_0xa07f('0x30')][_0x3959d5][_0xa07f('0x33')]);if(_0x257125>=0x0){_0xe93a17[_0xa07f('0x34')]=!![];}}}return _0xe93a17;}exports['parser']=function(_0x5a6573,_0x3ef4fb,_0x4f954b){var _0x12a4a6={'from':getAddress(_0x3ef4fb['from']),'firstName':getFirstName(_0x3ef4fb['from']),'lastName':getLastName(_0x3ef4fb[_0xa07f('0x35')]),'mapKey':_0xa07f('0x5'),'message':{'from':getMails(_0x5a6573[_0xa07f('0x5')],_0x3ef4fb[_0xa07f('0x35')]),'to':_0x5a6573[_0xa07f('0x5')],'cc':'','subject':_0x3ef4fb[_0xa07f('0x36')]||'','messageId':_0x3ef4fb['messageId'],'inReplyTo':_0x3ef4fb[_0xa07f('0x37')],'sentAt':moment(_0x3ef4fb[_0xa07f('0x38')])[_0xa07f('0x29')](_0xa07f('0x39')),'attach':![],'attachments':[]}};if(!_0x3ef4fb[_0xa07f('0x15')]&&!_0x3ef4fb['textAsHtml']){var _0x5a1915=_[_0xa07f('0x3a')](_0x3ef4fb[_0xa07f('0x18')],{'contentType':_0xa07f('0x3b')});if(_0x5a1915[_0xa07f('0xe')]){logger[_0xa07f('0x3c')](util[_0xa07f('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3ef4fb[_0xa07f('0x3d')]));tnef[_0xa07f('0x3e')](_[_0xa07f('0x3f')](_0x5a1915)['content'],function(_0x1df46b,_0x1e6112){if(_0x1e6112){_0x3ef4fb[_0xa07f('0x15')]=_0x1e6112[_0xa07f('0x40')]||_0xa07f('0x41');if(_0x1e6112['Attachments']){for(var _0x484bb1=0x0;_0x484bb1<_0x1e6112[_0xa07f('0x42')][_0xa07f('0xe')];_0x484bb1++){var _0xbf4c17=_0x1e6112[_0xa07f('0x42')][_0x484bb1];_0x12a4a6[_0xa07f('0x21')][_0xa07f('0x18')][_0xa07f('0x1a')]({'filename':_0xbf4c17[_0xa07f('0x43')],'content':Buffer[_0xa07f('0x35')](_0xbf4c17[_0xa07f('0x44')])});}}}_0x4f954b(parseEmail(_0x5a6573,_0x3ef4fb,_0x12a4a6));});}else{_0x3ef4fb[_0xa07f('0x15')]=_0xa07f('0x41');_0x4f954b(parseEmail(_0x5a6573,_0x3ef4fb,_0x12a4a6));}}else{_0x4f954b(parseEmail(_0x5a6573,_0x3ef4fb,_0x12a4a6));}};exports[_0xa07f('0x45')]=function(_0x210eed){switch(_0x210eed){case _0xa07f('0x46'):return'imap.gmail.com';case _0xa07f('0x47'):return _0xa07f('0x48');case _0xa07f('0x49'):return _0xa07f('0x4a');case _0xa07f('0x4b'):return'outlook.office365.com';}return _0xa07f('0x4c');}; \ No newline at end of file +var _0x0120=['now','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','anonymous','generate','@xcally.com','value','name','address','substring','indexOf','split','length','join','pop','isEmpty','html','test','includes','attachments','forEach','push','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x1d1c02['slice'](0x0,-0x1)[_0x0012('0x14')]('\x20'):_0x33c82f['name'];}return'Anonymous';}function getLastName(_0x5d845a){var _0x5563fc=_[_0x0012('0x9')](_0x5d845a['value']);if(_0x5563fc&&_0x5563fc[_0x0012('0xe')]){var _0xf658bc=_0x5563fc['name'][_0x0012('0x12')](/\s+/);return _0xf658bc[_0x0012('0x13')]>0x1?_0xf658bc[_0x0012('0x15')]():'';}return'';}function getMails(_0x3b8dfc,_0x522e9b){var _0x4e72da='';for(var _0x1e7fbe=0x0;_0x1e7fbe<_0x522e9b[_0x0012('0xd')][_0x0012('0x13')];_0x1e7fbe+=0x1){if(_0x522e9b[_0x0012('0xd')][_0x1e7fbe][_0x0012('0xf')]!==_0x3b8dfc){if(!_[_0x0012('0x16')](_0x4e72da)){_0x4e72da+=',';}_0x4e72da+=_0x522e9b[_0x0012('0xd')][_0x1e7fbe][_0x0012('0xe')]||_0x522e9b['value'][_0x1e7fbe][_0x0012('0xf')]||'';_0x4e72da+='\x20<';_0x4e72da+=_0x522e9b[_0x0012('0xd')][_0x1e7fbe]['address']?_0x522e9b[_0x0012('0xd')][_0x1e7fbe][_0x0012('0xf')]:_0x0012('0xa')+random[_0x0012('0xb')](0x6)+'@xcally.com';_0x4e72da+='>';}}return _0x4e72da;}function parseEmail(_0x4d56ff,_0x460d82,_0x1c6583){if(_0x460d82[_0x0012('0x17')]){var _0x7177bc=/)<[^<]*)*<\/script>/gi;while(_0x7177bc[_0x0012('0x18')](_0x460d82[_0x0012('0x17')])){_0x460d82[_0x0012('0x17')]=_0x460d82[_0x0012('0x17')]['replace'](_0x7177bc,'');}if(_0x460d82[_0x0012('0x17')][_0x0012('0x19')]('{_0x36cf42[_0x0012('0x1c')](_0x46c260['filename']);});var _0x351ffd=/]+>/g;var _0x18b0a7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xbb5b55=_0x460d82[_0x0012('0x17')][_0x0012('0x1d')](_0x18b0a7,_0x0012('0x1e'));var _0x15d48a=_0xbb5b55[_0x0012('0x1d')](_0x351ffd,_0x0012('0x1f'));for(let _0x29a577=0x0;_0x29a577<_0x36cf42[_0x0012('0x13')];_0x29a577++){var _0x20b78f=_0x15d48a[_0x0012('0x1d')](_0x0012('0x1f'),_0x0012('0x20')+_0x36cf42[_0x29a577]+_0x0012('0x21'));_0x15d48a=_0x20b78f;}_0x460d82[_0x0012('0x17')]=_0x15d48a;}_0x1c6583[_0x0012('0x22')]=_0x460d82[_0x0012('0x17')];}else{_0x1c6583[_0x0012('0x22')]=_0x460d82[_0x0012('0x23')];}if(_0x1c6583['body']){_0x1c6583[_0x0012('0x22')]=_0x1c6583[_0x0012('0x22')]['replace'](/0x0){var _0x1799f2=[_0x0012('0x32'),_0x0012('0x33'),_0x0012('0x34')];for(var _0x56058b=0x0;_0x56058b<_0x460d82['headerLines'][_0x0012('0x13')];_0x56058b++){var _0x574ece=_[_0x0012('0x11')](_0x1799f2,_0x460d82[_0x0012('0x31')][_0x56058b][_0x0012('0x35')]);if(_0x574ece>=0x0){_0x1c6583[_0x0012('0x36')]=!![];}}}return _0x1c6583;}exports[_0x0012('0x37')]=function(_0x5348a2,_0x1bd93a,_0x375a6c){var _0x54ef3f={'from':getAddress(_0x1bd93a[_0x0012('0x38')]),'firstName':getFirstName(_0x1bd93a[_0x0012('0x38')]),'lastName':getLastName(_0x1bd93a[_0x0012('0x38')]),'mapKey':_0x0012('0x7'),'message':{'from':getMails(_0x5348a2['email'],_0x1bd93a['from']),'to':_0x5348a2[_0x0012('0x7')],'cc':'','subject':_0x1bd93a['subject']||'','messageId':_0x1bd93a[_0x0012('0x39')],'inReplyTo':_0x1bd93a['inReplyTo'],'sentAt':moment(_0x1bd93a[_0x0012('0x3a')])[_0x0012('0x3b')](_0x0012('0x3c')),'attach':![],'attachments':[]}};if(!_0x1bd93a[_0x0012('0x17')]&&!_0x1bd93a['textAsHtml']){var _0x1de7d5=_['filter'](_0x1bd93a[_0x0012('0x1a')],{'contentType':_0x0012('0x3d')});if(_0x1de7d5[_0x0012('0x13')]){logger[_0x0012('0x3e')](util[_0x0012('0x3b')](_0x0012('0x3f'),_0x1bd93a[_0x0012('0x39')]));tnef['parseBuffer'](_[_0x0012('0x40')](_0x1de7d5)[_0x0012('0x30')],function(_0x2855cd,_0x11a89c){if(_0x11a89c){_0x1bd93a[_0x0012('0x17')]=_0x11a89c[_0x0012('0x41')]||'

Empty\x20message

';if(_0x11a89c['Attachments']){for(var _0x48de64=0x0;_0x48de64<_0x11a89c['Attachments'][_0x0012('0x13')];_0x48de64++){var _0x4033ca=_0x11a89c[_0x0012('0x42')][_0x48de64];_0x54ef3f[_0x0012('0x25')][_0x0012('0x1a')]['push']({'filename':_0x4033ca[_0x0012('0x43')],'content':Buffer[_0x0012('0x38')](_0x4033ca[_0x0012('0x44')])});}}}_0x375a6c(parseEmail(_0x5348a2,_0x1bd93a,_0x54ef3f));});}else{_0x1bd93a[_0x0012('0x17')]=_0x0012('0x45');_0x375a6c(parseEmail(_0x5348a2,_0x1bd93a,_0x54ef3f));}}else{_0x375a6c(parseEmail(_0x5348a2,_0x1bd93a,_0x54ef3f));}};exports[_0x0012('0x46')]=function(_0x156490){switch(_0x156490){case _0x0012('0x47'):return _0x0012('0x48');case _0x0012('0x49'):return _0x0012('0x4a');case'hotmail':return _0x0012('0x4b');case _0x0012('0x4c'):return _0x0012('0x4d');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c1398d8..7a2e295 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 _0x84ab=['active','Imap','Smtp','lodash','name','Service','key','SERV'];(function(_0x58c483,_0x1876ac){var _0x277a6e=function(_0x34d7aa){while(--_0x34d7aa){_0x58c483['push'](_0x58c483['shift']());}};_0x277a6e(++_0x1876ac);}(_0x84ab,0x173));var _0xb84a=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x84ab[_0x737a1f];return _0x16eba1;};'use strict';var _=require(_0xb84a('0x0'));function MailAccount(_0x48ea3b){this['id']=_0x48ea3b['id']||0x0;this[_0xb84a('0x1')]=_0x48ea3b['name']||_0xb84a('0x2');this['key']=_0x48ea3b[_0xb84a('0x3')]||_0xb84a('0x4');this[_0xb84a('0x5')]=_0x48ea3b[_0xb84a('0x5')]||![];this['Imap']=_0x48ea3b[_0xb84a('0x6')]||[];this['Smtp']=_0x48ea3b[_0xb84a('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x6b6b=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0x6b6b,0x1d2));var _0xb6b6=function(_0x215eaa,_0xd7abf6){_0x215eaa=_0x215eaa-0x0;var _0x4de0d2=_0x6b6b[_0x215eaa];return _0x4de0d2;};'use strict';var _=require(_0xb6b6('0x0'));function MailAccount(_0xccc9dd){this['id']=_0xccc9dd['id']||0x0;this[_0xb6b6('0x1')]=_0xccc9dd[_0xb6b6('0x1')]||_0xb6b6('0x2');this[_0xb6b6('0x3')]=_0xccc9dd[_0xb6b6('0x3')]||_0xb6b6('0x4');this[_0xb6b6('0x5')]=_0xccc9dd[_0xb6b6('0x5')]||![];this[_0xb6b6('0x6')]=_0xccc9dd['Imap']||[];this[_0xb6b6('0x7')]=_0xccc9dd['Smtp']||[];}module[_0xb6b6('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index afd895a..e8a2379 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 _0xf934=['mergeFromDatabase','initMailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype'];(function(_0x51ce52,_0x23da27){var _0xfdc284=function(_0x2cd1b4){while(--_0x2cd1b4){_0x51ce52['push'](_0x51ce52['shift']());}};_0xfdc284(++_0x23da27);}(_0xf934,0x7d));var _0x4f93=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xf934[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x4f93('0x0'));var MailAccount=require(_0x4f93('0x1'));var Realtime=function(){this[_0x4f93('0x2')]={};};function freeIsNotKey(_0x5d2803,_0x4281a6,_0x4b19ac){var _0x3d5481=_['mapKeys'](_0x5d2803,function(_0x12cddc,_0x27930d){return _0x12cddc[_0x4b19ac];});for(var _0x514b79 in _0x4281a6){if(_0x4281a6[_0x4f93('0x3')](_0x514b79)){if(!_0x3d5481[_0x514b79]){delete _0x4281a6[_0x514b79];}}}}Realtime[_0x4f93('0x4')][_0x4f93('0x5')]=function(_0x453196,_0x357791){for(var _0x3c0062 in _0x357791){if(_0x453196[_0x4f93('0x3')](_0x3c0062)){_0x453196[_0x3c0062]=_0x357791[_0x3c0062];}}};Realtime['prototype'][_0x4f93('0x6')]=function(){var _0x4b2a96=this;return function(_0x42fc2e){if(_0x42fc2e){freeIsNotKey(_0x42fc2e,_0x4b2a96[_0x4f93('0x2')],'id');for(var _0x2ec9cc=0x0,_0x1901a9={},_0x3c687a={};_0x2ec9cc<_0x42fc2e['length'];_0x2ec9cc+=0x1){_0x1901a9=_0x42fc2e[_0x2ec9cc];if(_[_0x4f93('0x7')](_0x4b2a96[_0x4f93('0x2')][_0x1901a9['id']])){_0x4b2a96[_0x4f93('0x2')][_0x1901a9['id']]=new MailAccount(_0x1901a9);}else{_[_0x4f93('0x8')](_0x4b2a96[_0x4f93('0x2')][_0x1901a9['id']],_0x1901a9);}}}return _0x4b2a96[_0x4f93('0x2')];};};module[_0x4f93('0x9')]=Realtime; \ No newline at end of file +var _0xba38=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge','exports'];(function(_0x4199a9,_0xf0a5c8){var _0x4aef66=function(_0x49ed67){while(--_0x49ed67){_0x4199a9['push'](_0x4199a9['shift']());}};_0x4aef66(++_0xf0a5c8);}(_0xba38,0x190));var _0x8ba3=function(_0x1963c2,_0x3c6299){_0x1963c2=_0x1963c2-0x0;var _0x522f6d=_0xba38[_0x1963c2];return _0x522f6d;};'use strict';var _=require('lodash');var MailAccount=require(_0x8ba3('0x0'));var Realtime=function(){this[_0x8ba3('0x1')]={};};function freeIsNotKey(_0x13dd6a,_0x52c7fc,_0x30c324){var _0x4b8e90=_[_0x8ba3('0x2')](_0x13dd6a,function(_0x2dce57,_0x124492){return _0x2dce57[_0x30c324];});for(var _0x105cb3 in _0x52c7fc){if(_0x52c7fc[_0x8ba3('0x3')](_0x105cb3)){if(!_0x4b8e90[_0x105cb3]){delete _0x52c7fc[_0x105cb3];}}}}Realtime[_0x8ba3('0x4')][_0x8ba3('0x5')]=function(_0x17276c,_0x193e7e){for(var _0x1dab1f in _0x193e7e){if(_0x17276c[_0x8ba3('0x3')](_0x1dab1f)){_0x17276c[_0x1dab1f]=_0x193e7e[_0x1dab1f];}}};Realtime[_0x8ba3('0x4')]['initMailAccounts']=function(){var _0x445b76=this;return function(_0x3041b5){if(_0x3041b5){freeIsNotKey(_0x3041b5,_0x445b76['mailAccounts'],'id');for(var _0xcf7968=0x0,_0x51568f={},_0x3d765c={};_0xcf7968<_0x3041b5[_0x8ba3('0x6')];_0xcf7968+=0x1){_0x51568f=_0x3041b5[_0xcf7968];if(_[_0x8ba3('0x7')](_0x445b76[_0x8ba3('0x1')][_0x51568f['id']])){_0x445b76[_0x8ba3('0x1')][_0x51568f['id']]=new MailAccount(_0x51568f);}else{_[_0x8ba3('0x8')](_0x445b76[_0x8ba3('0x1')][_0x51568f['id']],_0x51568f);}}}return _0x445b76[_0x8ba3('0x1')];};};module[_0x8ba3('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 397ebc0..f8d7ca4 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 _0xfa75=['MailServerIn','Imap','MailServerOut','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','name','service','email','active','ListId','TemplateId'];(function(_0x3801f9,_0x388098){var _0x34a7f3=function(_0x4239ca){while(--_0x4239ca){_0x3801f9['push'](_0x3801f9['shift']());}};_0x34a7f3(++_0x388098);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa75[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x5fa7('0x0'));exports[_0x5fa7('0x1')]=function(){return function(){return client[_0x5fa7('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x5fa7('0x3'),_0x5fa7('0x4'),_0x5fa7('0x5'),_0x5fa7('0x6'),'key',_0x5fa7('0x7'),_0x5fa7('0x8')],'raw':![],'include':[{'model':_0x5fa7('0x9'),'as':_0x5fa7('0xa')},{'model':_0x5fa7('0xb'),'as':'Smtp'}]},'log':_0x5fa7('0xc')});};};exports['notify']=function(_0x9543ee,_0x2df4b8){return client[_0x5fa7('0x2')](_0x5fa7('0xd'),{'account':{'id':_0x9543ee},'body':_0x2df4b8,'log':_0x5fa7('0xd')});}; \ No newline at end of file +var _0xdbb9=['notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','email','active','key','ListId','TemplateId','MailServerIn','getMailAccount'];(function(_0x26a322,_0x3190af){var _0x1c20fa=function(_0x30077a){while(--_0x30077a){_0x26a322['push'](_0x26a322['shift']());}};_0x1c20fa(++_0x3190af);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x3e38b0,_0x1db1ad){_0x3e38b0=_0x3e38b0-0x0;var _0x55ff66=_0xdbb9[_0x3e38b0];return _0x55ff66;};'use strict';var client=require('../client');exports[_0x9dbb('0x0')]=function(){return function(){return client[_0x9dbb('0x1')](_0x9dbb('0x2'),{'options':{'attributes':['id',_0x9dbb('0x3'),'service',_0x9dbb('0x4'),_0x9dbb('0x5'),_0x9dbb('0x6'),_0x9dbb('0x7'),_0x9dbb('0x8')],'raw':![],'include':[{'model':_0x9dbb('0x9'),'as':'Imap'},{'model':'MailServerOut','as':'Smtp'}]},'log':_0x9dbb('0xa')});};};exports[_0x9dbb('0xb')]=function(_0x203da3,_0x485819){return client['Request'](_0x9dbb('0xc'),{'account':{'id':_0x203da3},'body':_0x485819,'log':_0x9dbb('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index b15f848..4ed36d6 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 _0x9280=['../client'];(function(_0x4cbcd4,_0x1cba2e){var _0x2cbd42=function(_0x35a04d){while(--_0x35a04d){_0x4cbcd4['push'](_0x4cbcd4['shift']());}};_0x2cbd42(++_0x1cba2e);}(_0x9280,0x175));var _0x0928=function(_0x5945c1,_0x23e8e0){_0x5945c1=_0x5945c1-0x0;var _0x4c6de9=_0x9280[_0x5945c1];return _0x4c6de9;};'use strict';var client=require(_0x0928('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x7694=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x27d751,_0x1a7e34){var _0x492995=function(_0x51de0a){while(--_0x51de0a){_0x27d751['push'](_0x27d751['shift']());}};_0x492995(++_0x1a7e34);}(_0x7694,0xa3));var _0x4769=function(_0x55ba1c,_0x2794ec){_0x55ba1c=_0x55ba1c-0x0;var _0x5e85c3=_0x7694[_0x55ba1c];return _0x5e85c3;};'use strict';var client=require(_0x4769('0x0'));exports[_0x4769('0x1')]=function(){return client[_0x4769('0x2')](_0x4769('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4769('0x4')]},'log':_0x4769('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 54c1fd2..396e686 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 262ea12..8c2636c 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 _0x57dd=['log','port','exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','websocket','redis','defaults','localhost','socket.io-redis','default','../../config/express','../../routes','once','listening'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x57dd,0xf3));var _0xd57d=function(_0x387f6d,_0x2f2d93){_0x387f6d=_0x387f6d-0x0;var _0x29d8d5=_0x57dd[_0x387f6d];return _0x29d8d5;};'use strict';var _=require(_0xd57d('0x0'));var http=require(_0xd57d('0x1'));var express=require(_0xd57d('0x2'));var sticky=require('sticky-session');var Redis=require(_0xd57d('0x3'));var config=require(_0xd57d('0x4'));var app=express();var server=http[_0xd57d('0x5')](app);server[_0xd57d('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0xd57d('0x7'),'polling']});config[_0xd57d('0x8')]=_[_0xd57d('0x9')](config[_0xd57d('0x8')],{'host':_0xd57d('0xa'),'port':0x18eb});socketio['adapter'](require(_0xd57d('0xb'))({'pubClient':new Redis(config[_0xd57d('0x8')]),'subClient':new Redis(config[_0xd57d('0x8')])}));require('../../config/triggers')['default']();require('../../config/socketio')[_0xd57d('0xc')](socketio);require(_0xd57d('0xd'))[_0xd57d('0xc')](app);require(_0xd57d('0xe'))[_0xd57d('0xc')](app);}else{server[_0xd57d('0xf')](_0xd57d('0x10'),function(){console[_0xd57d('0x11')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xd57d('0x12')]);});}exports=module[_0xd57d('0x13')]=app; \ No newline at end of file +var _0xd44f=['default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','redis','defaults','localhost','socket.io-redis','../../config/triggers','../../config/socketio'];(function(_0x3bdb13,_0x8a31b0){var _0x1dce41=function(_0x33c267){while(--_0x33c267){_0x3bdb13['push'](_0x3bdb13['shift']());}};_0x1dce41(++_0x8a31b0);}(_0xd44f,0x16f));var _0xfd44=function(_0x4b90b7,_0x2b0ab0){_0x4b90b7=_0x4b90b7-0x0;var _0x36ac5f=_0xd44f[_0x4b90b7];return _0x36ac5f;};'use strict';var _=require(_0xfd44('0x0'));var http=require(_0xfd44('0x1'));var express=require(_0xfd44('0x2'));var sticky=require(_0xfd44('0x3'));var Redis=require(_0xfd44('0x4'));var config=require(_0xfd44('0x5'));var app=express();var server=http[_0xfd44('0x6')](app);server[_0xfd44('0x7')]=0xdbba0;if(sticky[_0xfd44('0x8')](server,config[_0xfd44('0x9')])){var socketio=require(_0xfd44('0xa'))(server,{'transports':['websocket','polling']});config[_0xfd44('0xb')]=_[_0xfd44('0xc')](config[_0xfd44('0xb')],{'host':_0xfd44('0xd'),'port':0x18eb});socketio['adapter'](require(_0xfd44('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xfd44('0xb')])}));require(_0xfd44('0xf'))['default']();require(_0xfd44('0x10'))[_0xfd44('0x11')](socketio);require('../../config/express')[_0xfd44('0x11')](app);require(_0xfd44('0x12'))[_0xfd44('0x11')](app);}else{server[_0xfd44('0x13')](_0xfd44('0x14'),function(){console[_0xfd44('0x15')](_0xfd44('0x16'),config[_0xfd44('0x9')]);});}exports=module[_0xfd44('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 5639fa8..2155e03 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 _0x0abf=['request','then','debug','rpc','error','message','result','catch','bluebird','routing','Request'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x0abf,0xef));var _0xf0ab=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0abf[_0x432682];return _0x463d05;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf0ab('0x0'));var logger=require('../../config/logger')(_0xf0ab('0x1'));var client=jayson['client']['http']({'port':0x2329});client[_0xf0ab('0x2')]=function(_0x579bf0,_0x15631c){return new BPromise(function(_0x3edb82,_0x1275b5){return client[_0xf0ab('0x3')](_0x579bf0,_0x15631c)[_0xf0ab('0x4')](function(_0x4e7bf7){logger[_0xf0ab('0x5')](_0xf0ab('0x6'),_0xf0ab('0x1'),_0x579bf0,_0x15631c,_0x4e7bf7);if(_0x4e7bf7[_0xf0ab('0x7')]){logger['error'](_0xf0ab('0x6'),'routing',_0x579bf0,_0x4e7bf7['error'][_0xf0ab('0x8')],_0x15631c);return _0x1275b5(_0x4e7bf7[_0xf0ab('0x7')][_0xf0ab('0x8')]);}else{return _0x3edb82(_0x4e7bf7[_0xf0ab('0x9')]);}})[_0xf0ab('0xa')](function(_0x39e7ca){logger[_0xf0ab('0x7')](_0xf0ab('0x6'),_0xf0ab('0x1'),_0x579bf0,_0x39e7ca,_0x15631c);return _0x1275b5(_0x39e7ca);});});};module['exports']=client; \ No newline at end of file +var _0x59dc=['routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','exports','../../config/logger'];(function(_0x5575cd,_0x73ab7a){var _0x4979a0=function(_0x1ac744){while(--_0x1ac744){_0x5575cd['push'](_0x5575cd['shift']());}};_0x4979a0(++_0x73ab7a);}(_0x59dc,0xc3));var _0xc59d=function(_0x20971a,_0x5e08ca){_0x20971a=_0x20971a-0x0;var _0x126cf9=_0x59dc[_0x20971a];return _0x126cf9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc59d('0x0'))(_0xc59d('0x1'));var client=jayson[_0xc59d('0x2')][_0xc59d('0x3')]({'port':0x2329});client[_0xc59d('0x4')]=function(_0x3f2803,_0xfc3926){return new BPromise(function(_0x4f5429,_0x52a178){return client[_0xc59d('0x5')](_0x3f2803,_0xfc3926)[_0xc59d('0x6')](function(_0x49337b){logger[_0xc59d('0x7')](_0xc59d('0x8'),_0xc59d('0x1'),_0x3f2803,_0xfc3926,_0x49337b);if(_0x49337b[_0xc59d('0x9')]){logger[_0xc59d('0x9')](_0xc59d('0x8'),_0xc59d('0x1'),_0x3f2803,_0x49337b[_0xc59d('0x9')][_0xc59d('0xa')],_0xfc3926);return _0x52a178(_0x49337b['error'][_0xc59d('0xa')]);}else{return _0x4f5429(_0x49337b[_0xc59d('0xb')]);}})[_0xc59d('0xc')](function(_0x8006b1){logger[_0xc59d('0x9')]('rpc','routing',_0x3f2803,_0x8006b1,_0xfc3926);return _0x52a178(_0x8006b1);});});};module[_0xc59d('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 2375338..3a40e55 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 _0x63d8=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','resolve','then','getAgents','initAgents','getIntervals'];(function(_0xcac32e,_0x50622c){var _0x565e56=function(_0x10c67){while(--_0x10c67){_0xcac32e['push'](_0xcac32e['shift']());}};_0x565e56(++_0x50622c);}(_0x63d8,0x1d6));var _0x863d=function(_0x25c17f,_0x15a81b){_0x25c17f=_0x25c17f-0x0;var _0x1e9e98=_0x63d8[_0x25c17f];return _0x1e9e98;};'use strict';var BPromise=require(_0x863d('0x0'));var server=require('./server');var Realtime=require(_0x863d('0x1'));var user=require(_0x863d('0x2'));var interval=require(_0x863d('0x3'));var openchannelQueue=require(_0x863d('0x4'));var chatQueue=require(_0x863d('0x5'));var smsQueue=require(_0x863d('0x6'));var mailQueue=require(_0x863d('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x863d('0x8')]()[_0x863d('0x9')](user[_0x863d('0xa')]())[_0x863d('0x9')](realtime[_0x863d('0xb')]())[_0x863d('0x9')](interval[_0x863d('0xc')]())[_0x863d('0x9')](realtime[_0x863d('0xd')]())['then'](openchannelQueue[_0x863d('0xe')]())[_0x863d('0x9')](realtime[_0x863d('0xf')]())[_0x863d('0x9')](chatQueue[_0x863d('0x10')]())[_0x863d('0x9')](realtime[_0x863d('0x11')]())[_0x863d('0x9')](smsQueue[_0x863d('0x12')]())[_0x863d('0x9')](realtime[_0x863d('0x13')]())[_0x863d('0x9')](mailQueue[_0x863d('0x14')]())['then'](realtime['initMailQueues']())[_0x863d('0x9')](faxQueue[_0x863d('0x15')]())[_0x863d('0x9')](realtime['initFaxQueues']())[_0x863d('0x9')](whatsappQueue['getWhatsappQueues']())[_0x863d('0x9')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x863d('0x9')](function(_0x1c0ce3){return initRealtime();})[_0x863d('0x9')](function(_0x501af1){return setInterval(initRealtime,0x1388);})['catch'](function(_0x196592){console[_0x863d('0x16')](_0x196592);});}main(); \ No newline at end of file +var _0xcdde=['initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','catch','bluebird','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x52585b,_0x33f30){var _0x2b2adb=function(_0x2b0a37){while(--_0x2b0a37){_0x52585b['push'](_0x52585b['shift']());}};_0x2b2adb(++_0x33f30);}(_0xcdde,0x6d));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xecdd('0x0'));var server=require(_0xecdd('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xecdd('0x2'));var openchannelQueue=require(_0xecdd('0x3'));var chatQueue=require(_0xecdd('0x4'));var smsQueue=require(_0xecdd('0x5'));var mailQueue=require(_0xecdd('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xecdd('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xecdd('0x8')]()[_0xecdd('0x9')](user[_0xecdd('0xa')]())[_0xecdd('0x9')](realtime[_0xecdd('0xb')]())[_0xecdd('0x9')](interval[_0xecdd('0xc')]())[_0xecdd('0x9')](realtime['initIntervals']())[_0xecdd('0x9')](openchannelQueue[_0xecdd('0xd')]())[_0xecdd('0x9')](realtime[_0xecdd('0xe')]())[_0xecdd('0x9')](chatQueue[_0xecdd('0xf')]())[_0xecdd('0x9')](realtime[_0xecdd('0x10')]())[_0xecdd('0x9')](smsQueue[_0xecdd('0x11')]())['then'](realtime['initSmsQueues']())['then'](mailQueue[_0xecdd('0x12')]())[_0xecdd('0x9')](realtime[_0xecdd('0x13')]())[_0xecdd('0x9')](faxQueue[_0xecdd('0x14')]())[_0xecdd('0x9')](realtime[_0xecdd('0x15')]())[_0xecdd('0x9')](whatsappQueue['getWhatsappQueues']())[_0xecdd('0x9')](realtime['initWhatsappQueues']())[_0xecdd('0x9')](function(){return realtime;});}function main(){return server[_0xecdd('0x16')](realtime)[_0xecdd('0x9')](function(_0x238ed5){return initRealtime();})['then'](function(_0xfd517e){return setInterval(initRealtime,0x1388);})[_0xecdd('0x17')](function(_0x1cd1d7){console['log'](_0x1cd1d7);});}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 4aacbe6..3509da7 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 _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(_0xb35529,_0xbd48c5){var _0x1d8c70=function(_0x64a4e){while(--_0x64a4e){_0xb35529['push'](_0xb35529['shift']());}};_0x1d8c70(++_0xbd48c5);}(_0x814b,0x1a2));var _0xb814=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x814b[_0x134192];return _0x3cd080;};'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 +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x2e689d,_0x4c3b29){var _0x540160=function(_0xac5c81){while(--_0xac5c81){_0x2e689d['push'](_0x2e689d['shift']());}};_0x540160(++_0x4c3b29);}(_0x326f,0xd1));var _0xf326=function(_0x19ab4f,_0xbf5c1a){_0x19ab4f=_0x19ab4f-0x0;var _0x2f30f7=_0x326f[_0x19ab4f];return _0x2f30f7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 94e201b..9b19f71 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 _0x731f=['client','request','then','error','SendMail','bluebird'];(function(_0x47f06e,_0x24f0f7){var _0x5a10e0=function(_0x294178){while(--_0x294178){_0x47f06e['push'](_0x47f06e['shift']());}};_0x5a10e0(++_0x24f0f7);}(_0x731f,0x1f1));var _0xf731=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x731f[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0xf731('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf731('0x1')]['http']({'port':0x232b});function request(_0x49ef8a,_0x4ca753){return new BPromise(function(_0xb84048,_0x589515){return client[_0xf731('0x2')](_0x49ef8a,_0x4ca753)[_0xf731('0x3')](function(_0x5bb6eb){if(_0x5bb6eb['error']){return _0x589515(_0x5bb6eb[_0xf731('0x4')]['message']);}else{return _0xb84048(_0x5bb6eb['result']);}})['catch'](function(_0x3707db){return _0x589515(_0x3707db);});});}exports['sendMailMessage']=function(_0x41ed25,_0x190cf9){return request(_0xf731('0x5'),{'account':_0x41ed25,'message':_0x190cf9});}; \ No newline at end of file +var _0x4e83=['bluebird','jayson/promise','client','http','request','then','error','result','catch','SendMail'];(function(_0x281b4c,_0x2c8ae0){var _0x2f32d1=function(_0x59db3b){while(--_0x59db3b){_0x281b4c['push'](_0x281b4c['shift']());}};_0x2f32d1(++_0x2c8ae0);}(_0x4e83,0x136));var _0x34e8=function(_0x58b603,_0x450f6d){_0x58b603=_0x58b603-0x0;var _0xf76126=_0x4e83[_0x58b603];return _0xf76126;};'use strict';var BPromise=require(_0x34e8('0x0'));var jayson=require(_0x34e8('0x1'));var client=jayson[_0x34e8('0x2')][_0x34e8('0x3')]({'port':0x232b});function request(_0x1c5f56,_0x15302d){return new BPromise(function(_0x165d72,_0x1eff7e){return client[_0x34e8('0x4')](_0x1c5f56,_0x15302d)[_0x34e8('0x5')](function(_0xcd8fe2){if(_0xcd8fe2[_0x34e8('0x6')]){return _0x1eff7e(_0xcd8fe2[_0x34e8('0x6')]['message']);}else{return _0x165d72(_0xcd8fe2[_0x34e8('0x7')]);}})[_0x34e8('0x8')](function(_0x49ebbc){return _0x1eff7e(_0x49ebbc);});});}exports['sendMailMessage']=function(_0x24f509,_0x47dca9){return request(_0x34e8('0x9'),{'account':_0x24f509,'message':_0x47dca9});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2e63a50..811bee2 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 _0x80e9=['whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','fax','sms','whatsapp','StatusTime','toNumber','format','Status','chatStatus','faxStatusTime','stringify','emit','user:save','exports','lodash','moment','ioredis','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x80e9,0x9a));var _0x980e=function(_0x4ac3c4,_0x4e2877){_0x4ac3c4=_0x4ac3c4-0x0;var _0x2ea26f=_0x80e9[_0x4ac3c4];return _0x2ea26f;};'use strict';var _=require(_0x980e('0x0'));var moment=require(_0x980e('0x1'));var md5=require('md5');var Redis=require(_0x980e('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x980e('0x3')](config[_0x980e('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x980e('0x4')]));function Agent(_0x2aae34){this['id']=_0x2aae34['id']||0x0;this[_0x980e('0x5')]=_0x2aae34[_0x980e('0x5')]||'';this[_0x980e('0x6')]=_0x2aae34['online']||!![];this[_0x980e('0x7')]=_0x2aae34[_0x980e('0x7')]||![];this[_0x980e('0x8')]=_0x2aae34[_0x980e('0x8')]||![];this[_0x980e('0x9')]=_0x2aae34[_0x980e('0x9')]||![];this[_0x980e('0xa')]=_0x2aae34[_0x980e('0xa')]||![];this[_0x980e('0xb')]=_0x2aae34[_0x980e('0xb')]||![];this[_0x980e('0xc')]=_0x2aae34[_0x980e('0xc')]||![];this['chatStatus']=_0x980e('0xd');this[_0x980e('0xe')]=0x0;this['chatCapacity']=_0x2aae34[_0x980e('0xf')]||0x0;this[_0x980e('0x10')]=0x0;this[_0x980e('0x11')]='unknown';this[_0x980e('0x12')]=0x0;this['mailCapacity']=_0x2aae34[_0x980e('0x13')]||0x0;this[_0x980e('0x14')]=0x0;this[_0x980e('0x15')]='unknown';this['faxStatusTime']=0x0;this[_0x980e('0x16')]=_0x2aae34[_0x980e('0x16')]||0x0;this[_0x980e('0x17')]=0x0;this[_0x980e('0x18')]=_0x980e('0xd');this[_0x980e('0x19')]=0x0;this[_0x980e('0x1a')]=_0x2aae34[_0x980e('0x1a')]||0x0;this[_0x980e('0x1b')]=0x0;this[_0x980e('0x1c')]='unknown';this[_0x980e('0x1d')]=0x0;this['whatsappCapacity']=_0x2aae34['whatsappCapacity']||0x0;this[_0x980e('0x1e')]=0x0;this[_0x980e('0x1f')]='unknown';this[_0x980e('0x20')]=0x0;this[_0x980e('0x21')]=_0x2aae34[_0x980e('0x21')]||0x0;this[_0x980e('0x22')]=0x0;this[_0x980e('0x23')]=![];this[_0x980e('0x24')]=undefined;this[_0x980e('0x25')]='';this[_0x980e('0x26')]();}Agent['prototype']['getChannelStatus']=function(_0x515856){if(this[_0x515856+_0x980e('0x27')]>0x0){if(this[_0x515856+_0x980e('0x28')]>0x0&&this[_0x515856+'CurrentCapacity']>=this[_0x515856+'Capacity']){return _0x980e('0x29');}else{return _0x980e('0x2a');}}else{return _0x980e('0x2b');}};Agent[_0x980e('0x2c')][_0x980e('0x26')]=function(){var _0x1c4c3b=[_0x980e('0x2d'),_0x980e('0x2e'),_0x980e('0x2f'),_0x980e('0x30'),_0x980e('0x31'),_0x980e('0x32')];for(var _0x1971f8=0x0;_0x1971f8<_0x1c4c3b['length'];_0x1971f8+=0x1){var _0x279498=this['getChannelStatus'](_0x1c4c3b[_0x1971f8]);if(this[_0x1c4c3b[_0x1971f8]+'Status']!==_0x279498){this[_0x1c4c3b[_0x1971f8]+_0x980e('0x33')]=_[_0x980e('0x34')](moment()[_0x980e('0x35')]('x'));}this[_0x1c4c3b[_0x1971f8]+_0x980e('0x36')]=_0x279498;}var _0x20365a={'id':this['id'],'name':this[_0x980e('0x5')],'online':this[_0x980e('0x6')],'voicePause':this[_0x980e('0x7')],'chatPause':this[_0x980e('0x8')],'mailPause':this[_0x980e('0x9')],'smsPause':this[_0x980e('0xb')],'faxPause':this[_0x980e('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x980e('0x37')],'chatStatusTime':this[_0x980e('0xe')],'chatCapacity':this[_0x980e('0xf')],'chatCurrentCapacity':this[_0x980e('0x10')],'mailStatus':this[_0x980e('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x980e('0x13')],'mailCurrentCapacity':this[_0x980e('0x14')],'faxStatus':this[_0x980e('0x15')],'faxStatusTime':this[_0x980e('0x38')],'faxCapacity':this[_0x980e('0x16')],'faxCurrentCapacity':this[_0x980e('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x980e('0x19')],'smsCapacity':this[_0x980e('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x980e('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x980e('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x980e('0x21')],'openchannelCurrentCapacity':this[_0x980e('0x22')],'busy':this['busy'],'busyQueue':this[_0x980e('0x24')]};var _0x550e41=md5(JSON[_0x980e('0x39')](_0x20365a));if(this['md5']!==_0x550e41){this[_0x980e('0x25')]=_0x550e41;io[_0x980e('0x3a')](_0x980e('0x3b'),_0x20365a);}};module[_0x980e('0x3c')]=Agent; \ No newline at end of file +var _0xfdb8=['length','Status','StatusTime','toNumber','online','smsPause','chatStatus','chatCurrentCapacity','smsCurrentCapacity','busy','busyQueue','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','openchannelPause','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','sms','whatsapp'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xfdb8,0x13a));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8fdb('0x0'));var moment=require(_0x8fdb('0x1'));var md5=require(_0x8fdb('0x2'));var Redis=require(_0x8fdb('0x3'));var config=require(_0x8fdb('0x4'));config[_0x8fdb('0x5')]=_[_0x8fdb('0x6')](config[_0x8fdb('0x5')],{'host':_0x8fdb('0x7'),'port':0x18eb});var io=require(_0x8fdb('0x8'))(new Redis(config['redis']));function Agent(_0x2ee846){this['id']=_0x2ee846['id']||0x0;this[_0x8fdb('0x9')]=_0x2ee846['name']||'';this['online']=_0x2ee846['online']||!![];this['voicePause']=_0x2ee846[_0x8fdb('0xa')]||![];this[_0x8fdb('0xb')]=_0x2ee846[_0x8fdb('0xb')]||![];this[_0x8fdb('0xc')]=_0x2ee846['mailPause']||![];this['faxPause']=_0x2ee846[_0x8fdb('0xd')]||![];this['smsPause']=_0x2ee846['smsPause']||![];this[_0x8fdb('0xe')]=_0x2ee846['openchannelPause']||![];this['chatStatus']=_0x8fdb('0xf');this['chatStatusTime']=0x0;this[_0x8fdb('0x10')]=_0x2ee846[_0x8fdb('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this[_0x8fdb('0x11')]=0x0;this[_0x8fdb('0x12')]=_0x2ee846[_0x8fdb('0x12')]||0x0;this[_0x8fdb('0x13')]=0x0;this[_0x8fdb('0x14')]=_0x8fdb('0xf');this[_0x8fdb('0x15')]=0x0;this[_0x8fdb('0x16')]=_0x2ee846[_0x8fdb('0x16')]||0x0;this[_0x8fdb('0x17')]=0x0;this[_0x8fdb('0x18')]='unknown';this[_0x8fdb('0x19')]=0x0;this[_0x8fdb('0x1a')]=_0x2ee846[_0x8fdb('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x8fdb('0x1b')]=_0x8fdb('0xf');this[_0x8fdb('0x1c')]=0x0;this[_0x8fdb('0x1d')]=_0x2ee846[_0x8fdb('0x1d')]||0x0;this[_0x8fdb('0x1e')]=0x0;this[_0x8fdb('0x1f')]=_0x8fdb('0xf');this[_0x8fdb('0x20')]=0x0;this[_0x8fdb('0x21')]=_0x2ee846[_0x8fdb('0x21')]||0x0;this[_0x8fdb('0x22')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x8fdb('0x2')]='';this['updateRealtime']();}Agent[_0x8fdb('0x23')][_0x8fdb('0x24')]=function(_0x1bb689){if(this[_0x1bb689+_0x8fdb('0x25')]>0x0){if(this[_0x1bb689+_0x8fdb('0x26')]>0x0&&this[_0x1bb689+_0x8fdb('0x25')]>=this[_0x1bb689+_0x8fdb('0x26')]){return _0x8fdb('0x27');}else{return'working';}}else{return _0x8fdb('0x28');}};Agent['prototype']['updateRealtime']=function(){var _0x4a75ad=[_0x8fdb('0x29'),_0x8fdb('0x2a'),_0x8fdb('0x2b'),'fax',_0x8fdb('0x2c'),_0x8fdb('0x2d')];for(var _0x405746=0x0;_0x405746<_0x4a75ad[_0x8fdb('0x2e')];_0x405746+=0x1){var _0x5e0afa=this['getChannelStatus'](_0x4a75ad[_0x405746]);if(this[_0x4a75ad[_0x405746]+_0x8fdb('0x2f')]!==_0x5e0afa){this[_0x4a75ad[_0x405746]+_0x8fdb('0x30')]=_[_0x8fdb('0x31')](moment()['format']('x'));}this[_0x4a75ad[_0x405746]+_0x8fdb('0x2f')]=_0x5e0afa;}var _0xda1dd0={'id':this['id'],'name':this[_0x8fdb('0x9')],'online':this[_0x8fdb('0x32')],'voicePause':this['voicePause'],'chatPause':this[_0x8fdb('0xb')],'mailPause':this[_0x8fdb('0xc')],'smsPause':this[_0x8fdb('0x33')],'faxPause':this['faxPause'],'openchannelPause':this[_0x8fdb('0xe')],'chatStatus':this[_0x8fdb('0x34')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x8fdb('0x10')],'chatCurrentCapacity':this[_0x8fdb('0x35')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x8fdb('0x11')],'mailCapacity':this[_0x8fdb('0x12')],'mailCurrentCapacity':this[_0x8fdb('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x8fdb('0x15')],'faxCapacity':this[_0x8fdb('0x16')],'faxCurrentCapacity':this[_0x8fdb('0x17')],'smsStatus':this[_0x8fdb('0x18')],'smsStatusTime':this[_0x8fdb('0x19')],'smsCapacity':this[_0x8fdb('0x1a')],'smsCurrentCapacity':this[_0x8fdb('0x36')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x8fdb('0x1c')],'whatsappCapacity':this[_0x8fdb('0x1d')],'whatsappCurrentCapacity':this[_0x8fdb('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x8fdb('0x37')],'busyQueue':this[_0x8fdb('0x38')]};var _0x22e71f=md5(JSON['stringify'](_0xda1dd0));if(this[_0x8fdb('0x2')]!==_0x22e71f){this[_0x8fdb('0x2')]=_0x22e71f;io[_0x8fdb('0x39')](_0x8fdb('0x3a'),_0xda1dd0);}};module[_0x8fdb('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index a8b70b7..3ceb678 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 _0xefed=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x522537,_0x1ffdb3){var _0xaa9034=function(_0xb8d005){while(--_0xb8d005){_0x522537['push'](_0x522537['shift']());}};_0xaa9034(++_0x1ffdb3);}(_0xefed,0x1d3));var _0xdefe=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0xefed[_0x54a761];return _0x37d1da;};'use strict';var _=require(_0xdefe('0x0'));var md5=require(_0xdefe('0x1'));var util=require('util');var Redis=require(_0xdefe('0x2'));var config=require(_0xdefe('0x3'));config[_0xdefe('0x4')]=_[_0xdefe('0x5')](config[_0xdefe('0x4')],{'host':_0xdefe('0x6'),'port':0x18eb});var io=require(_0xdefe('0x7'))(new Redis(config[_0xdefe('0x4')]));function ChatQueue(_0x1259ec){this['id']=_0x1259ec['id']||0x0;this[_0xdefe('0x8')]=_0x1259ec['name']||'';this['timeout']=_0x1259ec[_0xdefe('0x9')]||0xa;this[_0xdefe('0xa')]=_0x1259ec[_0xdefe('0xa')]||_0xdefe('0xb');this[_0xdefe('0xc')]=_0x1259ec['Agents'];this['mapAgentsId']={};this[_0xdefe('0xd')]=0x0;this[_0xdefe('0x1')]='';this[_0xdefe('0xe')]();this[_0xdefe('0xf')]();}ChatQueue[_0xdefe('0x10')][_0xdefe('0xe')]=function(){var _0x41f3d4=this[_0xdefe('0x11')][_0xdefe('0x12')];this[_0xdefe('0x11')]=_['map'](this[_0xdefe('0xc')],'id');this[_0xdefe('0x11')]['_rr']=_0x41f3d4;};ChatQueue[_0xdefe('0x10')][_0xdefe('0xf')]=function(){this[_0xdefe('0x13')]=0x0;this[_0xdefe('0x14')]=0x0;for(var _0x5789f5=0x0;_0x5789f5=0x0?this[_0xdefe('0x18')]:0x0;var _0x29058a={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdefe('0x13')],'name':this[_0xdefe('0x8')],'paused':this[_0xdefe('0x14')],'waiting':this[_0xdefe('0xd')]};var _0x42826b=md5(JSON['stringify'](_0x29058a));if(this['md5']!==_0x42826b){this[_0xdefe('0x1')]=_0x42826b;io['to'](util[_0xdefe('0x19')](_0xdefe('0x1a'),_0x29058a[_0xdefe('0x8')]))[_0xdefe('0x1b')]('chat_queue:save',_0x29058a);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x2a50=['localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x514f10,_0x5c1c1c){var _0x374afa=function(_0x481c1c){while(--_0x481c1c){_0x514f10['push'](_0x514f10['shift']());}};_0x374afa(++_0x5c1c1c);}(_0x2a50,0x1ba));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x02a5('0x0'));var md5=require(_0x02a5('0x1'));var util=require(_0x02a5('0x2'));var Redis=require(_0x02a5('0x3'));var config=require(_0x02a5('0x4'));config['redis']=_[_0x02a5('0x5')](config['redis'],{'host':_0x02a5('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x02a5('0x7')]));function ChatQueue(_0x406885){this['id']=_0x406885['id']||0x0;this[_0x02a5('0x8')]=_0x406885[_0x02a5('0x8')]||'';this[_0x02a5('0x9')]=_0x406885[_0x02a5('0x9')]||0xa;this['strategy']=_0x406885[_0x02a5('0xa')]||_0x02a5('0xb');this[_0x02a5('0xc')]=_0x406885[_0x02a5('0xc')];this[_0x02a5('0xd')]={};this['waiting']=0x0;this[_0x02a5('0x1')]='';this[_0x02a5('0xe')]();this['updateRealtime']();}ChatQueue[_0x02a5('0xf')][_0x02a5('0xe')]=function(){var _0x16ffeb=this['mapAgentsId']['_rr'];this[_0x02a5('0xd')]=_[_0x02a5('0x10')](this[_0x02a5('0xc')],'id');this[_0x02a5('0xd')]['_rr']=_0x16ffeb;};ChatQueue[_0x02a5('0xf')][_0x02a5('0x11')]=function(){this[_0x02a5('0x12')]=0x0;this[_0x02a5('0x13')]=0x0;for(var _0x1de88c=0x0;_0x1de88c=0x0?this[_0x02a5('0x16')]:0x0;var _0x2b66be={'id':this['id'],'available':this[_0x02a5('0x16')],'loggedIn':this[_0x02a5('0x12')],'name':this[_0x02a5('0x8')],'paused':this[_0x02a5('0x13')],'waiting':this[_0x02a5('0x17')]};var _0x4fb8ae=md5(JSON[_0x02a5('0x18')](_0x2b66be));if(this[_0x02a5('0x1')]!==_0x4fb8ae){this[_0x02a5('0x1')]=_0x4fb8ae;io['to'](util[_0x02a5('0x19')]('chat:queue:%s',_0x2b66be[_0x02a5('0x8')]))[_0x02a5('0x1a')]('chat_queue:save',_0x2b66be);}};module[_0x02a5('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 455f65e..a24ccc9 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 _0xea7a=['Agents','md5','prototype','_rr','mapAgentsId','map','loggedIn','paused','length','faxPause','available','waiting','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xea7a,0x1a6));var _0xaea7=function(_0x5e3db0,_0x1e06ed){_0x5e3db0=_0x5e3db0-0x0;var _0x251fdf=_0xea7a[_0x5e3db0];return _0x251fdf;};'use strict';var _=require(_0xaea7('0x0'));var md5=require('md5');var util=require(_0xaea7('0x1'));var Redis=require(_0xaea7('0x2'));var config=require('../../../config/environment');config[_0xaea7('0x3')]=_[_0xaea7('0x4')](config['redis'],{'host':_0xaea7('0x5'),'port':0x18eb});var io=require(_0xaea7('0x6'))(new Redis(config[_0xaea7('0x3')]));function FaxQueue(_0x56f858){this['id']=_0x56f858['id']||0x0;this[_0xaea7('0x7')]=_0x56f858['name']||'';this['timeout']=_0x56f858['timeout']||0xa;this[_0xaea7('0x8')]=_0x56f858[_0xaea7('0x8')]||_0xaea7('0x9');this[_0xaea7('0xa')]=_0x56f858[_0xaea7('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xaea7('0xb')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xaea7('0xc')]['updateRouting']=function(){var _0xe3b07=this['mapAgentsId'][_0xaea7('0xd')];this[_0xaea7('0xe')]=_[_0xaea7('0xf')](this[_0xaea7('0xa')],'id');this['mapAgentsId']['_rr']=_0xe3b07;};FaxQueue[_0xaea7('0xc')]['updateRealtime']=function(){this[_0xaea7('0x10')]=0x0;this[_0xaea7('0x11')]=0x0;for(var _0x5b0206=0x0;_0x5b0206=0x0?this[_0xaea7('0x14')]:0x0;var _0x48846={'id':this['id'],'available':this[_0xaea7('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xaea7('0x7')],'paused':this[_0xaea7('0x11')],'waiting':this[_0xaea7('0x15')]};var _0x5a1a56=md5(JSON['stringify'](_0x48846));if(this['md5']!==_0x5a1a56){this[_0xaea7('0xb')]=_0x5a1a56;io['to'](util[_0xaea7('0x16')](_0xaea7('0x17'),_0x48846[_0xaea7('0x7')]))[_0xaea7('0x18')](_0xaea7('0x19'),_0x48846);}};module[_0xaea7('0x1a')]=FaxQueue; \ No newline at end of file +var _0x584d=['lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','emit','exports'];(function(_0x39a36c,_0x5d2c45){var _0x1b5c76=function(_0xe1a947){while(--_0xe1a947){_0x39a36c['push'](_0x39a36c['shift']());}};_0x1b5c76(++_0x5d2c45);}(_0x584d,0x1e0));var _0xd584=function(_0x509738,_0xe585c1){_0x509738=_0x509738-0x0;var _0x3bafc2=_0x584d[_0x509738];return _0x3bafc2;};'use strict';var _=require(_0xd584('0x0'));var md5=require('md5');var util=require(_0xd584('0x1'));var Redis=require(_0xd584('0x2'));var config=require(_0xd584('0x3'));config[_0xd584('0x4')]=_[_0xd584('0x5')](config[_0xd584('0x4')],{'host':_0xd584('0x6'),'port':0x18eb});var io=require(_0xd584('0x7'))(new Redis(config[_0xd584('0x4')]));function FaxQueue(_0x4a2175){this['id']=_0x4a2175['id']||0x0;this[_0xd584('0x8')]=_0x4a2175[_0xd584('0x8')]||'';this[_0xd584('0x9')]=_0x4a2175[_0xd584('0x9')]||0xa;this[_0xd584('0xa')]=_0x4a2175['strategy']||'beepall';this[_0xd584('0xb')]=_0x4a2175[_0xd584('0xb')];this['mapAgentsId']={};this[_0xd584('0xc')]=0x0;this[_0xd584('0xd')]='';this[_0xd584('0xe')]();this[_0xd584('0xf')]();}FaxQueue[_0xd584('0x10')]['updateRouting']=function(){var _0x67ab8d=this['mapAgentsId']['_rr'];this[_0xd584('0x11')]=_[_0xd584('0x12')](this['Agents'],'id');this['mapAgentsId'][_0xd584('0x13')]=_0x67ab8d;};FaxQueue[_0xd584('0x10')][_0xd584('0xf')]=function(){this[_0xd584('0x14')]=0x0;this[_0xd584('0x15')]=0x0;for(var _0x46379d=0x0;_0x46379d=0x0?this[_0xd584('0x18')]:0x0;var _0x3b78c1={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd584('0x14')],'name':this['name'],'paused':this[_0xd584('0x15')],'waiting':this[_0xd584('0xc')]};var _0x58f13b=md5(JSON[_0xd584('0x19')](_0x3b78c1));if(this[_0xd584('0xd')]!==_0x58f13b){this[_0xd584('0xd')]=_0x58f13b;io['to'](util[_0xd584('0x1a')](_0xd584('0x1b'),_0x3b78c1[_0xd584('0x8')]))[_0xd584('0x1c')]('fax_queue:save',_0x3b78c1);}};module[_0xd584('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 932988e..312ab01 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 _0xe11a=['Intervals','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe11a,0x1cd));var _0xae11=function(_0x2561ce,_0x251a80){_0x2561ce=_0x2561ce-0x0;var _0x39511a=_0xe11a[_0x2561ce];return _0x39511a;};'use strict';function Interval(_0x31c8ed){this['id']=_0x31c8ed['id']||0x0;this[_0xae11('0x0')]=_0x31c8ed[_0xae11('0x0')]||'';this[_0xae11('0x1')]=_0x31c8ed[_0xae11('0x1')]||{};}module[_0xae11('0x2')]=Interval; \ No newline at end of file +var _0x5792=['exports','name','Intervals'];(function(_0x55f853,_0x33e1f7){var _0x341bbf=function(_0x73df28){while(--_0x73df28){_0x55f853['push'](_0x55f853['shift']());}};_0x341bbf(++_0x33e1f7);}(_0x5792,0x151));var _0x2579=function(_0x3f530f,_0x46718d){_0x3f530f=_0x3f530f-0x0;var _0x205c38=_0x5792[_0x3f530f];return _0x205c38;};'use strict';function Interval(_0x1f011a){this['id']=_0x1f011a['id']||0x0;this[_0x2579('0x0')]=_0x1f011a[_0x2579('0x0')]||'';this[_0x2579('0x1')]=_0x1f011a[_0x2579('0x1')]||{};}module[_0x2579('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 a3445ff..156f5c2 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 _0x1c72=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x58e2dd,_0x1c40e7){var _0x65923d=function(_0x18ae26){while(--_0x18ae26){_0x58e2dd['push'](_0x58e2dd['shift']());}};_0x65923d(++_0x1c40e7);}(_0x1c72,0x1cc));var _0x21c7=function(_0x5cb8ed,_0xe423d6){_0x5cb8ed=_0x5cb8ed-0x0;var _0x2df596=_0x1c72[_0x5cb8ed];return _0x2df596;};'use strict';var _=require(_0x21c7('0x0'));var md5=require(_0x21c7('0x1'));var util=require(_0x21c7('0x2'));var Redis=require('ioredis');var config=require(_0x21c7('0x3'));config[_0x21c7('0x4')]=_[_0x21c7('0x5')](config[_0x21c7('0x4')],{'host':_0x21c7('0x6'),'port':0x18eb});var io=require(_0x21c7('0x7'))(new Redis(config[_0x21c7('0x4')]));function MailQueue(_0x5dcff3){this['id']=_0x5dcff3['id']||0x0;this[_0x21c7('0x8')]=_0x5dcff3['name']||'';this['timeout']=_0x5dcff3[_0x21c7('0x9')]||0xa;this['strategy']=_0x5dcff3[_0x21c7('0xa')]||_0x21c7('0xb');this['Agents']=_0x5dcff3[_0x21c7('0xc')];this[_0x21c7('0xd')]={};this['waiting']=0x0;this[_0x21c7('0x1')]='';this[_0x21c7('0xe')]();this['updateRealtime']();}MailQueue['prototype']['updateRouting']=function(){var _0x54f501=this[_0x21c7('0xd')][_0x21c7('0xf')];this[_0x21c7('0xd')]=_[_0x21c7('0x10')](this['Agents'],'id');this[_0x21c7('0xd')][_0x21c7('0xf')]=_0x54f501;};MailQueue[_0x21c7('0x11')][_0x21c7('0x12')]=function(){this[_0x21c7('0x13')]=0x0;this[_0x21c7('0x14')]=0x0;for(var _0xd5ac4a=0x0;_0xd5ac4a=0x0?this['available']:0x0;var _0x540c43={'id':this['id'],'available':this[_0x21c7('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x21c7('0x8')],'paused':this[_0x21c7('0x14')],'waiting':this[_0x21c7('0x18')]};var _0x2b071b=md5(JSON[_0x21c7('0x19')](_0x540c43));if(this[_0x21c7('0x1')]!==_0x2b071b){this[_0x21c7('0x1')]=_0x2b071b;io['to'](util[_0x21c7('0x1a')](_0x21c7('0x1b'),_0x540c43['name']))[_0x21c7('0x1c')](_0x21c7('0x1d'),_0x540c43);}};module[_0x21c7('0x1e')]=MailQueue; \ No newline at end of file +var _0x5638=['updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn','mailPause','available','waiting','stringify','mail:queue:%s','exports','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x46c3a1,_0x3a66c7){var _0x4d9b05=function(_0x425a3a){while(--_0x425a3a){_0x46c3a1['push'](_0x46c3a1['shift']());}};_0x4d9b05(++_0x3a66c7);}(_0x5638,0x184));var _0x8563=function(_0x19cd35,_0x3b4f50){_0x19cd35=_0x19cd35-0x0;var _0xb6762f=_0x5638[_0x19cd35];return _0xb6762f;};'use strict';var _=require('lodash');var md5=require(_0x8563('0x0'));var util=require(_0x8563('0x1'));var Redis=require(_0x8563('0x2'));var config=require('../../../config/environment');config[_0x8563('0x3')]=_[_0x8563('0x4')](config[_0x8563('0x3')],{'host':_0x8563('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8563('0x3')]));function MailQueue(_0x28a83a){this['id']=_0x28a83a['id']||0x0;this[_0x8563('0x6')]=_0x28a83a['name']||'';this[_0x8563('0x7')]=_0x28a83a[_0x8563('0x7')]||0xa;this[_0x8563('0x8')]=_0x28a83a[_0x8563('0x8')]||_0x8563('0x9');this[_0x8563('0xa')]=_0x28a83a['Agents'];this[_0x8563('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x8563('0xc')]();this[_0x8563('0xd')]();}MailQueue[_0x8563('0xe')][_0x8563('0xc')]=function(){var _0x2a2866=this[_0x8563('0xb')][_0x8563('0xf')];this[_0x8563('0xb')]=_['map'](this[_0x8563('0xa')],'id');this[_0x8563('0xb')][_0x8563('0xf')]=_0x2a2866;};MailQueue[_0x8563('0xe')][_0x8563('0xd')]=function(){this['loggedIn']=0x0;this[_0x8563('0x10')]=0x0;for(var _0x304646=0x0;_0x304646=0x0?this[_0x8563('0x14')]:0x0;var _0x343283={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8563('0x12')],'name':this['name'],'paused':this[_0x8563('0x10')],'waiting':this[_0x8563('0x15')]};var _0x156e53=md5(JSON[_0x8563('0x16')](_0x343283));if(this[_0x8563('0x0')]!==_0x156e53){this[_0x8563('0x0')]=_0x156e53;io['to'](util['format'](_0x8563('0x17'),_0x343283['name']))['emit']('mail_queue:save',_0x343283);}};module[_0x8563('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index bb1e799..6c88266 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x78e522,_0x37c539){var _0x4a170d=function(_0x2ef664){while(--_0x2ef664){_0x78e522['push'](_0x78e522['shift']());}};_0x4a170d(++_0x37c539);}(_0x5fc3,0xa8));var _0x35fc=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x5fc3[_0x41ee16];return _0x1f60de;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x326f,0xd1));var _0xf326=function(_0x4c5ada,_0x42e02a){_0x4c5ada=_0x4c5ada-0x0;var _0x364e68=_0x326f[_0x4c5ada];return _0x364e68;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9ec4baf..d22f9a6 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 _0x7119=['ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','paused','length','loggedIn','smsPause','available','stringify','emit','sms_queue:save','md5'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7119,0x1c7));var _0x9711=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x7119[_0x3c504b];return _0x2e5354;};'use strict';var _=require('lodash');var md5=require(_0x9711('0x0'));var util=require('util');var Redis=require(_0x9711('0x1'));var config=require('../../../config/environment');config[_0x9711('0x2')]=_[_0x9711('0x3')](config[_0x9711('0x2')],{'host':_0x9711('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9711('0x2')]));function SmsQueue(_0x39ca84){this['id']=_0x39ca84['id']||0x0;this[_0x9711('0x5')]=_0x39ca84[_0x9711('0x5')]||'';this[_0x9711('0x6')]=_0x39ca84['timeout']||0xa;this[_0x9711('0x7')]=_0x39ca84[_0x9711('0x7')]||_0x9711('0x8');this['Agents']=_0x39ca84[_0x9711('0x9')];this['mapAgentsId']={};this[_0x9711('0xa')]=0x0;this[_0x9711('0x0')]='';this[_0x9711('0xb')]();this['updateRealtime']();}SmsQueue[_0x9711('0xc')][_0x9711('0xb')]=function(){var _0x25dbf6=this[_0x9711('0xd')][_0x9711('0xe')];this[_0x9711('0xd')]=_[_0x9711('0xf')](this[_0x9711('0x9')],'id');this[_0x9711('0xd')][_0x9711('0xe')]=_0x25dbf6;};SmsQueue[_0x9711('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9711('0x10')]=0x0;for(var _0x38d721=0x0;_0x38d721=0x0?this[_0x9711('0x14')]:0x0;var _0x3615c9={'id':this['id'],'available':this[_0x9711('0x14')],'loggedIn':this[_0x9711('0x12')],'name':this[_0x9711('0x5')],'paused':this['paused'],'waiting':this[_0x9711('0xa')]};var _0x31e19f=md5(JSON[_0x9711('0x15')](_0x3615c9));if(this[_0x9711('0x0')]!==_0x31e19f){this['md5']=_0x31e19f;io['to'](util['format']('sms:queue:%s',_0x3615c9[_0x9711('0x5')]))[_0x9711('0x16')](_0x9711('0x17'),_0x3615c9);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x9224=['defaults','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x4c2c7b,_0x205d3c){var _0x529690=function(_0x5ee80a){while(--_0x5ee80a){_0x4c2c7b['push'](_0x4c2c7b['shift']());}};_0x529690(++_0x205d3c);}(_0x9224,0xa3));var _0x4922=function(_0x1158a7,_0x31c1a2){_0x1158a7=_0x1158a7-0x0;var _0x135ddf=_0x9224[_0x1158a7];return _0x135ddf;};'use strict';var _=require('lodash');var md5=require(_0x4922('0x0'));var util=require(_0x4922('0x1'));var Redis=require(_0x4922('0x2'));var config=require(_0x4922('0x3'));config[_0x4922('0x4')]=_[_0x4922('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4922('0x4')]));function SmsQueue(_0x4a8b56){this['id']=_0x4a8b56['id']||0x0;this[_0x4922('0x6')]=_0x4a8b56[_0x4922('0x6')]||'';this[_0x4922('0x7')]=_0x4a8b56[_0x4922('0x7')]||0xa;this[_0x4922('0x8')]=_0x4a8b56[_0x4922('0x8')]||'beepall';this[_0x4922('0x9')]=_0x4a8b56[_0x4922('0x9')];this['mapAgentsId']={};this[_0x4922('0xa')]=0x0;this[_0x4922('0x0')]='';this[_0x4922('0xb')]();this[_0x4922('0xc')]();}SmsQueue[_0x4922('0xd')][_0x4922('0xb')]=function(){var _0x33053f=this[_0x4922('0xe')]['_rr'];this[_0x4922('0xe')]=_['map'](this[_0x4922('0x9')],'id');this[_0x4922('0xe')][_0x4922('0xf')]=_0x33053f;};SmsQueue[_0x4922('0xd')][_0x4922('0xc')]=function(){this['loggedIn']=0x0;this[_0x4922('0x10')]=0x0;for(var _0x704e23=0x0;_0x704e23=0x0?this[_0x4922('0x15')]:0x0;var _0x15cdc9={'id':this['id'],'available':this[_0x4922('0x15')],'loggedIn':this[_0x4922('0x13')],'name':this['name'],'paused':this[_0x4922('0x10')],'waiting':this[_0x4922('0xa')]};var _0x7298c1=md5(JSON[_0x4922('0x16')](_0x15cdc9));if(this[_0x4922('0x0')]!==_0x7298c1){this['md5']=_0x7298c1;io['to'](util[_0x4922('0x17')](_0x4922('0x18'),_0x15cdc9[_0x4922('0x6')]))[_0x4922('0x19')](_0x4922('0x1a'),_0x15cdc9);}};module[_0x4922('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 4a9da7f..a6b59f2 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 _0x1a5c=['loggedIn','paused','length','online','whatsappPause','available','stringify','format','emit','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x4aeed0,_0x4b6534){var _0x5a27f4=function(_0x5de2a5){while(--_0x5de2a5){_0x4aeed0['push'](_0x4aeed0['shift']());}};_0x5a27f4(++_0x4b6534);}(_0x1a5c,0x95));var _0xc1a5=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x1a5c[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xc1a5('0x0'));var md5=require(_0xc1a5('0x1'));var util=require(_0xc1a5('0x2'));var Redis=require(_0xc1a5('0x3'));var config=require('../../../config/environment');config[_0xc1a5('0x4')]=_[_0xc1a5('0x5')](config['redis'],{'host':_0xc1a5('0x6'),'port':0x18eb});var io=require(_0xc1a5('0x7'))(new Redis(config[_0xc1a5('0x4')]));function WhatsappQueue(_0x58c4ce){this['id']=_0x58c4ce['id']||0x0;this['name']=_0x58c4ce[_0xc1a5('0x8')]||'';this['timeout']=_0x58c4ce['timeout']||0xa;this['strategy']=_0x58c4ce[_0xc1a5('0x9')]||_0xc1a5('0xa');this[_0xc1a5('0xb')]=_0x58c4ce[_0xc1a5('0xb')];this[_0xc1a5('0xc')]={};this[_0xc1a5('0xd')]=0x0;this['md5']='';this[_0xc1a5('0xe')]();this[_0xc1a5('0xf')]();}WhatsappQueue[_0xc1a5('0x10')]['updateRouting']=function(){var _0x259b16=this['mapAgentsId'][_0xc1a5('0x11')];this[_0xc1a5('0xc')]=_[_0xc1a5('0x12')](this[_0xc1a5('0xb')],'id');this['mapAgentsId'][_0xc1a5('0x11')]=_0x259b16;};WhatsappQueue[_0xc1a5('0x10')][_0xc1a5('0xf')]=function(){this[_0xc1a5('0x13')]=0x0;this[_0xc1a5('0x14')]=0x0;for(var _0x3215f2=0x0;_0x3215f2=0x0?this[_0xc1a5('0x18')]:0x0;var _0x4d808a={'id':this['id'],'available':this[_0xc1a5('0x18')],'loggedIn':this[_0xc1a5('0x13')],'name':this[_0xc1a5('0x8')],'paused':this[_0xc1a5('0x14')],'waiting':this['waiting']};var _0x387fa7=md5(JSON[_0xc1a5('0x19')](_0x4d808a));if(this[_0xc1a5('0x1')]!==_0x387fa7){this[_0xc1a5('0x1')]=_0x387fa7;io['to'](util[_0xc1a5('0x1a')]('whatsapp:queue:%s',_0x4d808a[_0xc1a5('0x8')]))[_0xc1a5('0x1b')]('whatsapp_queue:save',_0x4d808a);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x2a80=['paused','length','available','format','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x2a80,0x125));var _0x02a8=function(_0x1edc9d,_0x49c118){_0x1edc9d=_0x1edc9d-0x0;var _0x4f1142=_0x2a80[_0x1edc9d];return _0x4f1142;};'use strict';var _=require(_0x02a8('0x0'));var md5=require(_0x02a8('0x1'));var util=require(_0x02a8('0x2'));var Redis=require(_0x02a8('0x3'));var config=require(_0x02a8('0x4'));config[_0x02a8('0x5')]=_[_0x02a8('0x6')](config['redis'],{'host':_0x02a8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x02a8('0x5')]));function WhatsappQueue(_0x2cfb40){this['id']=_0x2cfb40['id']||0x0;this[_0x02a8('0x8')]=_0x2cfb40['name']||'';this[_0x02a8('0x9')]=_0x2cfb40[_0x02a8('0x9')]||0xa;this['strategy']=_0x2cfb40['strategy']||'beepall';this['Agents']=_0x2cfb40['Agents'];this[_0x02a8('0xa')]={};this[_0x02a8('0xb')]=0x0;this[_0x02a8('0x1')]='';this[_0x02a8('0xc')]();this[_0x02a8('0xd')]();}WhatsappQueue[_0x02a8('0xe')][_0x02a8('0xc')]=function(){var _0x21607a=this['mapAgentsId'][_0x02a8('0xf')];this['mapAgentsId']=_[_0x02a8('0x10')](this[_0x02a8('0x11')],'id');this[_0x02a8('0xa')][_0x02a8('0xf')]=_0x21607a;};WhatsappQueue[_0x02a8('0xe')][_0x02a8('0xd')]=function(){this[_0x02a8('0x12')]=0x0;this[_0x02a8('0x13')]=0x0;for(var _0x4dcf7b=0x0;_0x4dcf7b=0x0?this[_0x02a8('0x15')]:0x0;var _0x3cf422={'id':this['id'],'available':this[_0x02a8('0x15')],'loggedIn':this[_0x02a8('0x12')],'name':this[_0x02a8('0x8')],'paused':this[_0x02a8('0x13')],'waiting':this[_0x02a8('0xb')]};var _0x492588=md5(JSON['stringify'](_0x3cf422));if(this[_0x02a8('0x1')]!==_0x492588){this[_0x02a8('0x1')]=_0x492588;io['to'](util[_0x02a8('0x16')]('whatsapp:queue:%s',_0x3cf422['name']))[_0x02a8('0x17')](_0x02a8('0x18'),_0x3cf422);}};module[_0x02a8('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 441784f..3ee9da0 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x59fd61,_0xeb06d){var _0x1c3b3e=function(_0x3980cd){while(--_0x3980cd){_0x59fd61['push'](_0x59fd61['shift']());}};_0x1c3b3e(++_0xeb06d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c89cd,_0x2c57e2){_0x4c89cd=_0x4c89cd-0x0;var _0x1090d2=_0xb10b[_0x4c89cd];return _0x1090d2;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index e8d663e..7e149db 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 _0x52c0=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0xec083c,_0x4f19b2){var _0x14d80d=function(_0x4a5722){while(--_0x4a5722){_0xec083c['push'](_0xec083c['shift']());}};_0x14d80d(++_0x4f19b2);}(_0x52c0,0x8b));var _0x052c=function(_0x5d5ce6,_0x29d2f7){_0x5d5ce6=_0x5d5ce6-0x0;var _0x55b574=_0x52c0[_0x5d5ce6];return _0x55b574;};'use strict';var client=require(_0x052c('0x0'));exports['update']=function(_0x15c476,_0x390e9c){return client[_0x052c('0x1')](_0x052c('0x2'),{'body':_0x390e9c,'options':{'where':{'id':_0x15c476}},'log':'updateChatInteraction'});};exports[_0x052c('0x3')]=function(_0x45815b,_0x868ca8){return client[_0x052c('0x1')](_0x052c('0x4'),{'body':_0x868ca8,'options':{'where':{'id':_0x45815b}},'log':_0x052c('0x5')});}; \ No newline at end of file +var _0x2a82=['addTags','addTagsToChatInteraction','../client','update','Request'];(function(_0x5a4ad1,_0x40b2fe){var _0x5591ab=function(_0x57add5){while(--_0x57add5){_0x5a4ad1['push'](_0x5a4ad1['shift']());}};_0x5591ab(++_0x40b2fe);}(_0x2a82,0xb1));var _0x22a8=function(_0x20531b,_0x5936a7){_0x20531b=_0x20531b-0x0;var _0x47fd70=_0x2a82[_0x20531b];return _0x47fd70;};'use strict';var client=require(_0x22a8('0x0'));exports[_0x22a8('0x1')]=function(_0x4e7e8d,_0x371137){return client[_0x22a8('0x2')]('UpdateChatInteraction',{'body':_0x371137,'options':{'where':{'id':_0x4e7e8d}},'log':'updateChatInteraction'});};exports[_0x22a8('0x3')]=function(_0x28e2c3,_0x449bec){return client[_0x22a8('0x2')]('AddTagsToChatInteraction',{'body':_0x449bec,'options':{'where':{'id':_0x28e2c3}},'log':_0x22a8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 47a4cd2..4afb115 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 _0x0467=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x292831,_0x5ae2fa){var _0x2e7416=function(_0x5cb33b){while(--_0x5cb33b){_0x292831['push'](_0x292831['shift']());}};_0x2e7416(++_0x5ae2fa);}(_0x0467,0xfd));var _0x7046=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0467[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7046('0x0'));exports['create']=function(_0x1ff55d){return client[_0x7046('0x1')](_0x7046('0x2'),{'body':_0x1ff55d,'log':_0x7046('0x3')});}; \ No newline at end of file +var _0x70e0=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x392a3d,_0x142165){var _0x37c6bf=function(_0x35594c){while(--_0x35594c){_0x392a3d['push'](_0x392a3d['shift']());}};_0x37c6bf(++_0x142165);}(_0x70e0,0xb6));var _0x070e=function(_0x565684,_0xc51a22){_0x565684=_0x565684-0x0;var _0x261d54=_0x70e0[_0x565684];return _0x261d54;};'use strict';var client=require('../client');exports[_0x070e('0x0')]=function(_0x53cd42){return client[_0x070e('0x1')](_0x070e('0x2'),{'body':_0x53cd42,'log':_0x070e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 34cc12f..bd666a7 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 _0x1696=['getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x5c9326,_0x4cae9c){var _0x5e3259=function(_0x181deb){while(--_0x181deb){_0x5c9326['push'](_0x5c9326['shift']());}};_0x5e3259(++_0x4cae9c);}(_0x1696,0x79));var _0x6169=function(_0x57ae6b,_0x3d7234){_0x57ae6b=_0x57ae6b-0x0;var _0x292eb9=_0x1696[_0x57ae6b];return _0x292eb9;};'use strict';var client=require(_0x6169('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x6169('0x1')](_0x6169('0x2'),{'options':{'raw':![],'attributes':['id',_0x6169('0x3'),_0x6169('0x4'),_0x6169('0x5')],'include':[{'model':_0x6169('0x6'),'as':_0x6169('0x7'),'attributes':['id',_0x6169('0x3'),_0x6169('0x8'),'chatPause']}]},'log':_0x6169('0x9')});};}; \ No newline at end of file +var _0xbe48=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','User','Agents','online'];(function(_0x387ed5,_0x44e590){var _0x20a79e=function(_0x54f5e5){while(--_0x54f5e5){_0x387ed5['push'](_0x387ed5['shift']());}};_0x20a79e(++_0x44e590);}(_0xbe48,0x121));var _0x8be4=function(_0x405b42,_0x42d9a1){_0x405b42=_0x405b42-0x0;var _0x15a57d=_0xbe48[_0x405b42];return _0x15a57d;};'use strict';var client=require(_0x8be4('0x0'));exports[_0x8be4('0x1')]=function(){return function(){return client[_0x8be4('0x2')](_0x8be4('0x3'),{'options':{'raw':![],'attributes':['id',_0x8be4('0x4'),'timeout','strategy'],'include':[{'model':_0x8be4('0x5'),'as':_0x8be4('0x6'),'attributes':['id','name',_0x8be4('0x7'),_0x8be4('0x8')]}]},'log':_0x8be4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d2e599a..383a7fb 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 _0x54f3=['create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x54f3,0x120));var _0x354f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x54f3[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports[_0x354f('0x0')]=function(_0x344fae){return client[_0x354f('0x1')](_0x354f('0x2'),{'body':_0x344fae,'log':_0x354f('0x2')});};exports['update']=function(_0x48d7aa,_0xe4efe){return client[_0x354f('0x1')](_0x354f('0x3'),{'body':_0xe4efe,'options':{'where':{'uniqueid':_0x48d7aa},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xc7e9=['../client','create','Request','CreateChatQueueReport','DESC'];(function(_0x451869,_0x490465){var _0x1263fd=function(_0x4de1db){while(--_0x4de1db){_0x451869['push'](_0x451869['shift']());}};_0x1263fd(++_0x490465);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xc7e9[_0x5f3f88];return _0xd08119;};'use strict';var client=require(_0x9c7e('0x0'));exports[_0x9c7e('0x1')]=function(_0x581e2d){return client[_0x9c7e('0x2')](_0x9c7e('0x3'),{'body':_0x581e2d,'log':_0x9c7e('0x3')});};exports['update']=function(_0x340997,_0x34cef0){return client['Request']('UpdateChatQueueReport',{'body':_0x34cef0,'options':{'where':{'uniqueid':_0x340997},'order':[['id',_0x9c7e('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index a37c76a..4c34f5b 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(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x7a54,0x106));var _0x47a5=function(_0x131a8d,_0x3e96da){_0x131a8d=_0x131a8d-0x0;var _0x556547=_0x7a54[_0x131a8d];return _0x556547;};'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(_0x228540,_0x31248d){var _0x6e8c86=function(_0xee291b){while(--_0xee291b){_0x228540['push'](_0x228540['shift']());}};_0x6e8c86(++_0x31248d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 9c6ead4..115216e 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 _0x7493=['CreateFaxMessage','../client','create','Request'];(function(_0x2b77ae,_0x49e8fb){var _0x5a3cc5=function(_0x46b423){while(--_0x46b423){_0x2b77ae['push'](_0x2b77ae['shift']());}};_0x5a3cc5(++_0x49e8fb);}(_0x7493,0xbd));var _0x3749=function(_0xb96f50,_0xa21d9b){_0xb96f50=_0xb96f50-0x0;var _0x1caf5d=_0x7493[_0xb96f50];return _0x1caf5d;};'use strict';var client=require(_0x3749('0x0'));exports[_0x3749('0x1')]=function(_0x40cdd0){return client[_0x3749('0x2')](_0x3749('0x3'),{'body':_0x40cdd0,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xe03d=['create','createFaxMessage','../client'];(function(_0xe169d1,_0x10700f){var _0x1eb74e=function(_0x5b1be8){while(--_0x5b1be8){_0xe169d1['push'](_0xe169d1['shift']());}};_0x1eb74e(++_0x10700f);}(_0xe03d,0x113));var _0xde03=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xe03d[_0x3cea78];return _0x33b66b;};'use strict';var client=require(_0xde03('0x0'));exports[_0xde03('0x1')]=function(_0x192585){return client['Request']('CreateFaxMessage',{'body':_0x192585,'log':_0xde03('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c09bcef..0311c9a 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 _0x11e7=['Request','GetFaxQueue','name','timeout','User','Agents','faxPause','../client','getFaxQueues'];(function(_0x1ec8f9,_0x9348b2){var _0x417145=function(_0x17c243){while(--_0x17c243){_0x1ec8f9['push'](_0x1ec8f9['shift']());}};_0x417145(++_0x9348b2);}(_0x11e7,0x1d2));var _0x711e=function(_0x56070a,_0x5cbf44){_0x56070a=_0x56070a-0x0;var _0x12a94b=_0x11e7[_0x56070a];return _0x12a94b;};'use strict';var client=require(_0x711e('0x0'));exports[_0x711e('0x1')]=function(){return function(){return client[_0x711e('0x2')](_0x711e('0x3'),{'options':{'raw':![],'attributes':['id',_0x711e('0x4'),_0x711e('0x5'),'strategy'],'include':[{'model':_0x711e('0x6'),'as':_0x711e('0x7'),'attributes':['id',_0x711e('0x4'),'online',_0x711e('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x07cd=['timeout','User','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x4c3f50,_0x229c34){var _0x1d7c19=function(_0x596743){while(--_0x596743){_0x4c3f50['push'](_0x4c3f50['shift']());}};_0x1d7c19(++_0x229c34);}(_0x07cd,0x9d));var _0xd07c=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x07cd[_0x26b622];return _0x58a028;};'use strict';var client=require(_0xd07c('0x0'));exports[_0xd07c('0x1')]=function(){return function(){return client[_0xd07c('0x2')](_0xd07c('0x3'),{'options':{'raw':![],'attributes':['id',_0xd07c('0x4'),_0xd07c('0x5'),'strategy'],'include':[{'model':_0xd07c('0x6'),'as':'Agents','attributes':['id',_0xd07c('0x4'),_0xd07c('0x7'),_0xd07c('0x8')]}]},'log':_0xd07c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3733770..d47a554 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 _0xadd2=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x10b863,_0x4027c2){var _0x498d2a=function(_0x140cf6){while(--_0x140cf6){_0x10b863['push'](_0x10b863['shift']());}};_0x498d2a(++_0x4027c2);}(_0xadd2,0xa5));var _0x2add=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xadd2[_0x1cc8fe];return _0x230054;};'use strict';var client=require('../client');exports['create']=function(_0x3e01d5){return client['Request'](_0x2add('0x0'),{'body':_0x3e01d5,'log':_0x2add('0x0')});};exports[_0x2add('0x1')]=function(_0x270575,_0x1ecb83){return client[_0x2add('0x2')](_0x2add('0x3'),{'body':_0x1ecb83,'options':{'where':{'uniqueid':_0x270575},'order':[['id',_0x2add('0x4')]],'limit':0x1},'log':_0x2add('0x3')});}; \ No newline at end of file +var _0x529c=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x33ab06,_0x3ca641){var _0x5c57ce=function(_0x125474){while(--_0x125474){_0x33ab06['push'](_0x33ab06['shift']());}};_0x5c57ce(++_0x3ca641);}(_0x529c,0x164));var _0xc529=function(_0x4eff5a,_0x789014){_0x4eff5a=_0x4eff5a-0x0;var _0x16602c=_0x529c[_0x4eff5a];return _0x16602c;};'use strict';var client=require(_0xc529('0x0'));exports[_0xc529('0x1')]=function(_0x108bb2){return client[_0xc529('0x2')](_0xc529('0x3'),{'body':_0x108bb2,'log':_0xc529('0x3')});};exports['update']=function(_0x17baa6,_0x36053b){return client[_0xc529('0x2')](_0xc529('0x4'),{'body':_0x36053b,'options':{'where':{'uniqueid':_0x17baa6},'order':[['id',_0xc529('0x5')]],'limit':0x1},'log':_0xc529('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3abea89..e00844d 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 _0xe36a=['../client','getIntervals','Request','GetInterval','Interval','Intervals','interval'];(function(_0x34f640,_0x261122){var _0x23e691=function(_0x3dccf7){while(--_0x3dccf7){_0x34f640['push'](_0x34f640['shift']());}};_0x23e691(++_0x261122);}(_0xe36a,0x1f1));var _0xae36=function(_0x3e762f,_0x52155f){_0x3e762f=_0x3e762f-0x0;var _0x5277a3=_0xe36a[_0x3e762f];return _0x5277a3;};'use strict';var client=require(_0xae36('0x0'));exports[_0xae36('0x1')]=function(){return function(){return client[_0xae36('0x2')](_0xae36('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xae36('0x4'),'as':_0xae36('0x5'),'attributes':['id','name',_0xae36('0x6')]}]},'log':_0xae36('0x1')});};}; \ No newline at end of file +var _0x23d4=['Intervals','interval','../client','getIntervals','Request','name','Interval'];(function(_0x463fc1,_0x813793){var _0x28b348=function(_0x42cfb9){while(--_0x42cfb9){_0x463fc1['push'](_0x463fc1['shift']());}};_0x28b348(++_0x813793);}(_0x23d4,0x152));var _0x423d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x423d('0x0'));exports[_0x423d('0x1')]=function(){return function(){return client[_0x423d('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x423d('0x3')],'include':[{'model':_0x423d('0x4'),'as':_0x423d('0x5'),'attributes':['id',_0x423d('0x3'),_0x423d('0x6')]}]},'log':_0x423d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 6dd1967..4d41146 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 _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x43ba3d,_0xce8ad7){var _0x287e73=function(_0x544cb7){while(--_0x544cb7){_0x43ba3d['push'](_0x43ba3d['shift']());}};_0x287e73(++_0xce8ad7);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});}; \ No newline at end of file +var _0xe2cf=['addTags','Request','AddTagsToMailInteraction','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1d0e07,_0x2037e9){_0x1d0e07=_0x1d0e07-0x0;var _0x8912e0=_0xe2cf[_0x1d0e07];return _0x8912e0;};'use strict';var client=require('../client');exports[_0xfe2c('0x0')]=function(_0x546786,_0x11c3a4){return client['Request'](_0xfe2c('0x1'),{'body':_0x11c3a4,'options':{'where':{'id':_0x546786}},'log':_0xfe2c('0x2')});};exports[_0xfe2c('0x3')]=function(_0x11b6b8,_0x494978){return client[_0xfe2c('0x4')](_0xfe2c('0x5'),{'body':_0x494978,'options':{'where':{'id':_0x11b6b8}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c3f3813..ad8d980 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 _0x528c=['create','Request','CreateMailMessage'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x528c,0xcc));var _0xc528=function(_0xb6fbe6,_0x56d1da){_0xb6fbe6=_0xb6fbe6-0x0;var _0x27ba98=_0x528c[_0xb6fbe6];return _0x27ba98;};'use strict';var client=require('../client');exports[_0xc528('0x0')]=function(_0xf2814b){return client[_0xc528('0x1')](_0xc528('0x2'),{'body':_0xf2814b,'log':'createMailMessage'});}; \ No newline at end of file +var _0xbd88=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0xbd88,0x1d0));var _0x8bd8=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xbd88[_0x27af45];return _0x18df21;};'use strict';var client=require(_0x8bd8('0x0'));exports[_0x8bd8('0x1')]=function(_0x26bf52){return client[_0x8bd8('0x2')](_0x8bd8('0x3'),{'body':_0x26bf52,'log':_0x8bd8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 259f7a6..408bdc4 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 _0x8e50=['getMailQueues','../client','Request','GetMailQueue','name','strategy','User','Agents','online','mailPause'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8e50,0xd3));var _0x08e5=function(_0x5523bb,_0x448023){_0x5523bb=_0x5523bb-0x0;var _0x1392dd=_0x8e50[_0x5523bb];return _0x1392dd;};'use strict';var client=require(_0x08e5('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x08e5('0x1')](_0x08e5('0x2'),{'options':{'raw':![],'attributes':['id',_0x08e5('0x3'),'timeout',_0x08e5('0x4')],'include':[{'model':_0x08e5('0x5'),'as':_0x08e5('0x6'),'attributes':['id',_0x08e5('0x3'),_0x08e5('0x7'),_0x08e5('0x8')]}]},'log':_0x08e5('0x9')});};}; \ No newline at end of file +var _0xb9f8=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xb9f8,0x1e2));var _0x8b9f=function(_0x44d927,_0x54720f){_0x44d927=_0x44d927-0x0;var _0xa60767=_0xb9f8[_0x44d927];return _0xa60767;};'use strict';var client=require(_0x8b9f('0x0'));exports[_0x8b9f('0x1')]=function(){return function(){return client[_0x8b9f('0x2')](_0x8b9f('0x3'),{'options':{'raw':![],'attributes':['id',_0x8b9f('0x4'),'timeout',_0x8b9f('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x8b9f('0x4'),_0x8b9f('0x6'),_0x8b9f('0x7')]}]},'log':_0x8b9f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 7be2d61..bcbd0e0 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 _0x453c=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x453c,0x1d6));var _0xc453=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x453c[_0x2f62aa];return _0x1a341f;};'use strict';var client=require(_0xc453('0x0'));exports['create']=function(_0x449007){return client[_0xc453('0x1')]('CreateMailQueueReport',{'body':_0x449007,'log':_0xc453('0x2')});};exports[_0xc453('0x3')]=function(_0x3f71ce,_0x1e9224){return client['Request'](_0xc453('0x4'),{'body':_0x1e9224,'options':{'where':{'uniqueid':_0x3f71ce},'order':[['id',_0xc453('0x5')]],'limit':0x1},'log':_0xc453('0x4')});}; \ No newline at end of file +var _0x25d0=['DESC','../client','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x25510b,_0x46fc92){var _0x5a07e9=function(_0x25860d){while(--_0x25860d){_0x25510b['push'](_0x25510b['shift']());}};_0x5a07e9(++_0x46fc92);}(_0x25d0,0x14b));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x025d('0x0'));exports['create']=function(_0x37c8d4){return client[_0x025d('0x1')](_0x025d('0x2'),{'body':_0x37c8d4,'log':_0x025d('0x2')});};exports['update']=function(_0x543c32,_0xe791e5){return client[_0x025d('0x1')](_0x025d('0x3'),{'body':_0xe791e5,'options':{'where':{'uniqueid':_0x543c32},'order':[['id',_0x025d('0x4')]],'limit':0x1},'log':_0x025d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ce05624..cedde89 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 _0x9eab=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x484d33,_0x236ca3){var _0x20055b=function(_0x44c69b){while(--_0x44c69b){_0x484d33['push'](_0x484d33['shift']());}};_0x20055b(++_0x236ca3);}(_0x9eab,0x1d0));var _0xb9ea=function(_0x78d1ac,_0x3a448e){_0x78d1ac=_0x78d1ac-0x0;var _0x4aa3e3=_0x9eab[_0x78d1ac];return _0x4aa3e3;};'use strict';var client=require('../client');exports[_0xb9ea('0x0')]=function(_0x10812d,_0x2508e5){return client[_0xb9ea('0x1')](_0xb9ea('0x2'),{'body':_0x2508e5,'options':{'where':{'id':_0x10812d}},'log':_0xb9ea('0x3')});};exports['addTags']=function(_0x2f0bbf,_0x23a532){return client[_0xb9ea('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x23a532,'options':{'where':{'id':_0x2f0bbf}},'log':_0xb9ea('0x4')});}; \ No newline at end of file +var _0x1338=['update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0xd94bb6,_0x160af1){var _0x5bd51b=function(_0x110041){while(--_0x110041){_0xd94bb6['push'](_0xd94bb6['shift']());}};_0x5bd51b(++_0x160af1);}(_0x1338,0x102));var _0x8133=function(_0x3406ad,_0x1100c2){_0x3406ad=_0x3406ad-0x0;var _0x52e70=_0x1338[_0x3406ad];return _0x52e70;};'use strict';var client=require(_0x8133('0x0'));exports[_0x8133('0x1')]=function(_0x108795,_0x26987e){return client[_0x8133('0x2')](_0x8133('0x3'),{'body':_0x26987e,'options':{'where':{'id':_0x108795}},'log':'updateOpenchannelInteraction'});};exports[_0x8133('0x4')]=function(_0x490f49,_0x5bc253){return client[_0x8133('0x2')](_0x8133('0x5'),{'body':_0x5bc253,'options':{'where':{'id':_0x490f49}},'log':_0x8133('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 9228787..18a0369 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 _0x16d1=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x5a142d,_0x1e81a5){var _0x99ee4e=function(_0x4effac){while(--_0x4effac){_0x5a142d['push'](_0x5a142d['shift']());}};_0x99ee4e(++_0x1e81a5);}(_0x16d1,0xc0));var _0x116d=function(_0x4d7565,_0x1a40f3){_0x4d7565=_0x4d7565-0x0;var _0xeb52c3=_0x16d1[_0x4d7565];return _0xeb52c3;};'use strict';var client=require(_0x116d('0x0'));exports[_0x116d('0x1')]=function(_0x3cdcfc){return client[_0x116d('0x2')](_0x116d('0x3'),{'body':_0x3cdcfc,'log':_0x116d('0x4')});}; \ No newline at end of file +var _0xdbeb=['createOpenchannelMessage','../client','create','Request'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0xdbeb,0x19d));var _0xbdbe=function(_0x52bbe8,_0x554ab2){_0x52bbe8=_0x52bbe8-0x0;var _0x1228e1=_0xdbeb[_0x52bbe8];return _0x1228e1;};'use strict';var client=require(_0xbdbe('0x0'));exports[_0xbdbe('0x1')]=function(_0x32180d){return client[_0xbdbe('0x2')]('CreateOpenchannelMessage',{'body':_0x32180d,'log':_0xbdbe('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index dcdd3fb..9b2d956 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 _0x526e=['Request','GetOpenchannelQueue','name','timeout','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x322d3a,_0x4e59f4){var _0xd5864b=function(_0x27c2f8){while(--_0x27c2f8){_0x322d3a['push'](_0x322d3a['shift']());}};_0xd5864b(++_0x4e59f4);}(_0x526e,0x166));var _0xe526=function(_0x1bc77a,_0x2f0207){_0x1bc77a=_0x1bc77a-0x0;var _0x3103c1=_0x526e[_0x1bc77a];return _0x3103c1;};'use strict';var client=require(_0xe526('0x0'));exports[_0xe526('0x1')]=function(){return function(){return client[_0xe526('0x2')](_0xe526('0x3'),{'options':{'raw':![],'attributes':['id',_0xe526('0x4'),_0xe526('0x5'),'strategy'],'include':[{'model':'User','as':_0xe526('0x6'),'attributes':['id',_0xe526('0x4'),_0xe526('0x7'),_0xe526('0x8')]}]},'log':_0xe526('0x1')});};}; \ No newline at end of file +var _0xe187=['../client','getOpenchannelQueues','timeout','strategy','Agents','name','online'];(function(_0x28c8ef,_0x32fe6d){var _0xb8a9c=function(_0x3ad49f){while(--_0x3ad49f){_0x28c8ef['push'](_0x28c8ef['shift']());}};_0xb8a9c(++_0x32fe6d);}(_0xe187,0x126));var _0x7e18=function(_0x52e625,_0x4a38f3){_0x52e625=_0x52e625-0x0;var _0x2da7f6=_0xe187[_0x52e625];return _0x2da7f6;};'use strict';var client=require(_0x7e18('0x0'));exports[_0x7e18('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x7e18('0x2'),_0x7e18('0x3')],'include':[{'model':'User','as':_0x7e18('0x4'),'attributes':['id',_0x7e18('0x5'),_0x7e18('0x6'),'openchannelPause']}]},'log':_0x7e18('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f29d281..de82279 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 _0xde7f=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x679fa1,_0x3614fa){var _0x3463b9=function(_0x399529){while(--_0x399529){_0x679fa1['push'](_0x679fa1['shift']());}};_0x3463b9(++_0x3614fa);}(_0xde7f,0x18d));var _0xfde7=function(_0x4e7be8,_0x556843){_0x4e7be8=_0x4e7be8-0x0;var _0x5ea8e2=_0xde7f[_0x4e7be8];return _0x5ea8e2;};'use strict';var client=require('../client');exports[_0xfde7('0x0')]=function(_0x31b27d){return client[_0xfde7('0x1')]('CreateOpenchannelQueueReport',{'body':_0x31b27d,'log':_0xfde7('0x2')});};exports[_0xfde7('0x3')]=function(_0x44c430,_0x85f1f5){return client['Request'](_0xfde7('0x4'),{'body':_0x85f1f5,'options':{'where':{'uniqueid':_0x44c430},'order':[['id',_0xfde7('0x5')]],'limit':0x1},'log':_0xfde7('0x4')});}; \ No newline at end of file +var _0xbf77=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x37fb29,_0x295d9e){var _0x25a99e=function(_0x3afc25){while(--_0x3afc25){_0x37fb29['push'](_0x37fb29['shift']());}};_0x25a99e(++_0x295d9e);}(_0xbf77,0xec));var _0x7bf7=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xbf77[_0x422905];return _0x33dc6c;};'use strict';var client=require(_0x7bf7('0x0'));exports[_0x7bf7('0x1')]=function(_0x25351a){return client[_0x7bf7('0x2')](_0x7bf7('0x3'),{'body':_0x25351a,'log':_0x7bf7('0x3')});};exports[_0x7bf7('0x4')]=function(_0x29175d,_0x53ab9f){return client[_0x7bf7('0x2')](_0x7bf7('0x5'),{'body':_0x53ab9f,'options':{'where':{'uniqueid':_0x29175d},'order':[['id',_0x7bf7('0x6')]],'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 ded17ba..bcb25b2 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 _0x782e=['AddTagsToSmsInteraction','UpdateSmsInteraction','updateSmsInteraction','Request'];(function(_0x18b89a,_0x70f21a){var _0x32714f=function(_0x3d29e4){while(--_0x3d29e4){_0x18b89a['push'](_0x18b89a['shift']());}};_0x32714f(++_0x70f21a);}(_0x782e,0xb9));var _0xe782=function(_0xce8120,_0x73ed90){_0xce8120=_0xce8120-0x0;var _0x1c9c2c=_0x782e[_0xce8120];return _0x1c9c2c;};'use strict';var client=require('../client');exports['update']=function(_0x120c31,_0x15b01d){return client['Request'](_0xe782('0x0'),{'body':_0x15b01d,'options':{'where':{'id':_0x120c31}},'log':_0xe782('0x1')});};exports['addTags']=function(_0x26f960,_0x6726f){return client[_0xe782('0x2')](_0xe782('0x3'),{'body':_0x6726f,'options':{'where':{'id':_0x26f960}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xc18a=['update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0xc18a,0x1cf));var _0xac18=function(_0x3a99d1,_0x37e78b){_0x3a99d1=_0x3a99d1-0x0;var _0x38dc1f=_0xc18a[_0x3a99d1];return _0x38dc1f;};'use strict';var client=require(_0xac18('0x0'));exports[_0xac18('0x1')]=function(_0x1bb84d,_0x249826){return client['Request'](_0xac18('0x2'),{'body':_0x249826,'options':{'where':{'id':_0x1bb84d}},'log':_0xac18('0x3')});};exports[_0xac18('0x4')]=function(_0x3da5f5,_0x42f646){return client[_0xac18('0x5')](_0xac18('0x6'),{'body':_0x42f646,'options':{'where':{'id':_0x3da5f5}},'log':_0xac18('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 87087ea..886bdb9 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 _0x0f6c=['Request','CreateSmsMessage','createSmsMessage'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0f6c,0x108));var _0xc0f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f6c[_0x2b4411];return _0x8e41ef;};'use strict';var client=require('../client');exports['create']=function(_0x3ff5f2){return client[_0xc0f6('0x0')](_0xc0f6('0x1'),{'body':_0x3ff5f2,'log':_0xc0f6('0x2')});}; \ No newline at end of file +var _0xda29=['CreateSmsMessage','../client'];(function(_0x33ed20,_0x5701d8){var _0x3913d5=function(_0x2ecb65){while(--_0x2ecb65){_0x33ed20['push'](_0x33ed20['shift']());}};_0x3913d5(++_0x5701d8);}(_0xda29,0xef));var _0x9da2=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xda29[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require(_0x9da2('0x0'));exports['create']=function(_0x1f8e51){return client['Request'](_0x9da2('0x1'),{'body':_0x1f8e51,'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 7d9b553..f64e913 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x21da0f,_0x34a74e){var _0x2fd6c5=function(_0x5a5a5c){while(--_0x5a5a5c){_0x21da0f['push'](_0x21da0f['shift']());}};_0x2fd6c5(++_0x34a74e);}(_0x70e0,0x17b));var _0x070e=function(_0x44661a,_0x10965a){_0x44661a=_0x44661a-0x0;var _0x17a09a=_0x70e0[_0x44661a];return _0x17a09a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x2bb0ff,_0x22c9e2){var _0x497825=function(_0x168536){while(--_0x168536){_0x2bb0ff['push'](_0x2bb0ff['shift']());}};_0x497825(++_0x22c9e2);}(_0x70e0,0x17b));var _0x070e=function(_0x312b0a,_0x1f46eb){_0x312b0a=_0x312b0a-0x0;var _0x3bba0c=_0x70e0[_0x312b0a];return _0x3bba0c;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 01b5df1..acab788 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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xe4f1c0,_0x17dae3){var _0x16e788=function(_0x53e83d){while(--_0x53e83d){_0xe4f1c0['push'](_0xe4f1c0['shift']());}};_0x16e788(++_0x17dae3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2b2263,_0x20b1bb){var _0x3d7d84=function(_0x2434f4){while(--_0x2434f4){_0x2b2263['push'](_0x2b2263['shift']());}};_0x3d7d84(++_0x20b1bb);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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 a94d0ab..0cb11d7 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(_0xa83023,_0x2ccc21){var _0x557cc0=function(_0xfdf9ad){while(--_0xfdf9ad){_0xa83023['push'](_0xa83023['shift']());}};_0x557cc0(++_0x2ccc21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x221700,_0x57af01){var _0x185e8f=function(_0x3df02d){while(--_0x3df02d){_0x221700['push'](_0x221700['shift']());}};_0x185e8f(++_0x57af01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 114c739..7048fdf 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 _0x36c3=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x374764,_0x44e13f){var _0xb6af4d=function(_0x958d0e){while(--_0x958d0e){_0x374764['push'](_0x374764['shift']());}};_0xb6af4d(++_0x44e13f);}(_0x36c3,0x1a6));var _0x336c=function(_0x50abc4,_0x558d64){_0x50abc4=_0x50abc4-0x0;var _0x5a745d=_0x36c3[_0x50abc4];return _0x5a745d;};'use strict';var client=require(_0x336c('0x0'));exports[_0x336c('0x1')]=function(_0x4c7eb5,_0xa96e0b){return client[_0x336c('0x2')](_0x336c('0x3'),{'body':_0xa96e0b,'options':{'where':{'id':_0x4c7eb5}},'log':_0x336c('0x4')});};exports[_0x336c('0x5')]=function(_0x2b1194,_0x39ed12){return client['Request'](_0x336c('0x6'),{'body':_0x39ed12,'options':{'where':{'id':_0x2b1194}},'log':_0x336c('0x7')});}; \ No newline at end of file +var _0x37c5=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','update'];(function(_0x1dcbda,_0x9d1707){var _0x1368a2=function(_0x3dc7cb){while(--_0x3dc7cb){_0x1dcbda['push'](_0x1dcbda['shift']());}};_0x1368a2(++_0x9d1707);}(_0x37c5,0xa7));var _0x537c=function(_0x5656f9,_0x2fcfe1){_0x5656f9=_0x5656f9-0x0;var _0x5d4f15=_0x37c5[_0x5656f9];return _0x5d4f15;};'use strict';var client=require('../client');exports[_0x537c('0x0')]=function(_0x187a44,_0x392fa1){return client[_0x537c('0x1')](_0x537c('0x2'),{'body':_0x392fa1,'options':{'where':{'id':_0x187a44}},'log':_0x537c('0x3')});};exports[_0x537c('0x4')]=function(_0x42bd15,_0x2c0854){return client[_0x537c('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x2c0854,'options':{'where':{'id':_0x42bd15}},'log':_0x537c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 379f408..c8c8b2e 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 _0x91b3=['CreateWhatsappMessage','../client','Request'];(function(_0x50323e,_0x3c341c){var _0x593eb9=function(_0x454522){while(--_0x454522){_0x50323e['push'](_0x50323e['shift']());}};_0x593eb9(++_0x3c341c);}(_0x91b3,0x15a));var _0x391b=function(_0x486250,_0x52277d){_0x486250=_0x486250-0x0;var _0x4537ec=_0x91b3[_0x486250];return _0x4537ec;};'use strict';var client=require(_0x391b('0x0'));exports['create']=function(_0x536d70){return client[_0x391b('0x1')](_0x391b('0x2'),{'body':_0x536d70,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x6fe6=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x15d75a,_0x28ed2d){var _0x1a5734=function(_0x508610){while(--_0x508610){_0x15d75a['push'](_0x15d75a['shift']());}};_0x1a5734(++_0x28ed2d);}(_0x6fe6,0x80));var _0x66fe=function(_0x127fee,_0x3f7ea7){_0x127fee=_0x127fee-0x0;var _0x48f862=_0x6fe6[_0x127fee];return _0x48f862;};'use strict';var client=require(_0x66fe('0x0'));exports['create']=function(_0x51eef9){return client[_0x66fe('0x1')](_0x66fe('0x2'),{'body':_0x51eef9,'log':_0x66fe('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 5aaae6c..68b8a4c 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 _0x77ea=['online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','Agents'];(function(_0x3c630c,_0x3fe0e9){var _0x2b55bd=function(_0x2a8a6f){while(--_0x2a8a6f){_0x3c630c['push'](_0x3c630c['shift']());}};_0x2b55bd(++_0x3fe0e9);}(_0x77ea,0x1b3));var _0xa77e=function(_0x580ee3,_0x3712ad){_0x580ee3=_0x580ee3-0x0;var _0x52bd8c=_0x77ea[_0x580ee3];return _0x52bd8c;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xa77e('0x0')](_0xa77e('0x1'),{'options':{'raw':![],'attributes':['id',_0xa77e('0x2'),_0xa77e('0x3'),_0xa77e('0x4')],'include':[{'model':'User','as':_0xa77e('0x5'),'attributes':['id',_0xa77e('0x2'),_0xa77e('0x6'),_0xa77e('0x7')]}]},'log':_0xa77e('0x8')});};}; \ No newline at end of file +var _0x09b9=['timeout','strategy','User','Agents','whatsappPause','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x09b9,0x1bd));var _0x909b=function(_0x325bf7,_0x392335){_0x325bf7=_0x325bf7-0x0;var _0x235cef=_0x09b9[_0x325bf7];return _0x235cef;};'use strict';var client=require('../client');exports[_0x909b('0x0')]=function(){return function(){return client['Request'](_0x909b('0x1'),{'options':{'raw':![],'attributes':['id',_0x909b('0x2'),_0x909b('0x3'),_0x909b('0x4')],'include':[{'model':_0x909b('0x5'),'as':_0x909b('0x6'),'attributes':['id',_0x909b('0x2'),'online',_0x909b('0x7')]}]},'log':_0x909b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 13d3eee..5f1e132 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 _0x5d08=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0xfe9e3b,_0x458d27){var _0x28f3e7=function(_0xb9d0a7){while(--_0xb9d0a7){_0xfe9e3b['push'](_0xfe9e3b['shift']());}};_0x28f3e7(++_0x458d27);}(_0x5d08,0x76));var _0x85d0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5d08[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require('../client');exports[_0x85d0('0x0')]=function(_0x504b18){return client[_0x85d0('0x1')](_0x85d0('0x2'),{'body':_0x504b18,'log':_0x85d0('0x2')});};exports['update']=function(_0x275d1c,_0x26dfa9){return client['Request'](_0x85d0('0x3'),{'body':_0x26dfa9,'options':{'where':{'uniqueid':_0x275d1c},'order':[['id',_0x85d0('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xe62a=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0xdb75fa,_0x184650){var _0x4f86dc=function(_0x5367a3){while(--_0x5367a3){_0xdb75fa['push'](_0xdb75fa['shift']());}};_0x4f86dc(++_0x184650);}(_0xe62a,0x149));var _0xae62=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe62a[_0x5d6456];return _0x4d66c1;};'use strict';var client=require(_0xae62('0x0'));exports[_0xae62('0x1')]=function(_0x302b84){return client[_0xae62('0x2')](_0xae62('0x3'),{'body':_0x302b84,'log':_0xae62('0x3')});};exports['update']=function(_0x15d7fe,_0x10e8be){return client['Request'](_0xae62('0x4'),{'body':_0x10e8be,'options':{'where':{'uniqueid':_0x15d7fe},'order':[['id',_0xae62('0x5')]],'limit':0x1},'log':_0xae62('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 c668b72..71d1c2e 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 _0xc69b=['next','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x5ce358,_0xa88c44){var _0x107f30=function(_0x5d7f28){while(--_0x5d7f28){_0x5ce358['push'](_0x5ce358['shift']());}};_0x107f30(++_0xa88c44);}(_0xc69b,0x14a));var _0xbc69=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xc69b[_0x32b993];return _0x482780;};'use strict';var schema=require(_0xbc69('0x0'));var _=require(_0xbc69('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xbc69('0x2'))(_0xbc69('0x3'));var strategy=require(_0xbc69('0x4'));var queue=schema({'name':{'type':_0xbc69('0x5'),'required':!![],'message':_0xbc69('0x6')},'timeout':{'type':_0xbc69('0x7'),'message':_0xbc69('0x8')}});function writeLog(_0x5acd6f,_0x5ebd6e,_0x106075){return logger[_0xbc69('0x9')](util[_0xbc69('0xa')](_0xbc69('0xb'),_0x5acd6f,_0x5ebd6e[_0xbc69('0xc')],_0x106075));}function handleFindAgent(_0x2e985c){return function(_0x189ff8){return _0x189ff8[_0xbc69('0xc')][_0xbc69('0xd')]()===_0x2e985c[_0xbc69('0xd')]();};}exports[_0xbc69('0xe')]=function(_0x19b34d,_0x162059,_0x38fc2f,_0x305242){return function(_0x372694){try{var _0x1588ac={'name':_0x162059[0x0],'timeout':_0x162059[0x1]};var _0xe03deb=queue[_0xbc69('0x0')](_0x1588ac,{'typecast':!![]});if(_0xe03deb[_0xbc69('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x19b34d,_[_0xbc69('0x10')](_0xe03deb,'message')['join'](',\x20'));_0x372694[_0xbc69('0x11')]();}else{var _0x4fd24c=_[_0xbc69('0x12')](_0x38fc2f[_0xbc69('0x13')],handleFindAgent(_0x1588ac[_0xbc69('0xc')]));if(_0x4fd24c){var _0x4bd07f=(_0x1588ac[_0xbc69('0x14')]||0xa)*0x3e8;var _0x44a58d,_0x49b7f;var _0x32db83=seqqueue[_0xbc69('0x15')](_0x4bd07f);_0x32db83['id']=_0x19b34d;_0x32db83[_0xbc69('0x16')]=_0x4bd07f;_0x32db83[_0xbc69('0x17')]=_0x305242[_0xbc69('0x17')];writeLog(_0x19b34d,_0x4fd24c,util['format'](_0xbc69('0x18'),_0x4bd07f));_0x38fc2f['rules'][_0x19b34d]['on']('end',function(){logger['info'](_0xbc69('0x19'),_0x19b34d);clearTimeout(_0x49b7f);_0x49b7f=undefined;_0x32db83[_0xbc69('0x1a')]();if(_0x38fc2f[_0xbc69('0x1b')][_0x19b34d]){delete _0x38fc2f[_0xbc69('0x1b')][_0x19b34d];}_0x372694[_0xbc69('0x11')]();});_0x38fc2f[_0xbc69('0x1b')][_0x19b34d]['on'](_0xbc69('0x1c'),function(){if(_0x38fc2f['rules'][_0x19b34d]){delete _0x38fc2f['rules'][_0x19b34d];}});_0x49b7f=setTimeout(function(){logger[_0xbc69('0x9')](_0xbc69('0x1d'),_0x19b34d);clearTimeout(_0x49b7f);_0x32db83['close']();_0x372694[_0xbc69('0x1e')]();},_0x4bd07f);strategy[_0xbc69('0x1f')](_0x32db83,_0x4fd24c,_0x38fc2f,_0x305242);}else{logger[_0xbc69('0x20')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x19b34d,_0x1588ac[_0xbc69('0xc')]);_0x372694[_0xbc69('0x11')]();}}}catch(_0x3d534f){console[_0xbc69('0x21')](_0x3d534f);logger[_0xbc69('0x20')](_0xbc69('0x22'),_0x19b34d,_0x3d534f[_0xbc69('0x23')]);_0x372694[_0xbc69('0x11')]();}};}; \ No newline at end of file +var _0x8acc=['stop','find','agents','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join'];(function(_0x5b5f97,_0x46b15e){var _0x2f6001=function(_0x268878){while(--_0x268878){_0x5b5f97['push'](_0x5b5f97['shift']());}};_0x2f6001(++_0x46b15e);}(_0x8acc,0x1f2));var _0xc8ac=function(_0x35ef0c,_0x38a430){_0x35ef0c=_0x35ef0c-0x0;var _0x2894aa=_0x8acc[_0x35ef0c];return _0x2894aa;};'use strict';var schema=require(_0xc8ac('0x0'));var _=require(_0xc8ac('0x1'));var util=require(_0xc8ac('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xc8ac('0x3'))(_0xc8ac('0x4'));var strategy=require(_0xc8ac('0x5'));var queue=schema({'name':{'type':_0xc8ac('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc8ac('0x7'),'message':_0xc8ac('0x8')}});function writeLog(_0xdbd98,_0x85e52e,_0x59d7ea){return logger[_0xc8ac('0x9')](util[_0xc8ac('0xa')](_0xc8ac('0xb'),_0xdbd98,_0x85e52e[_0xc8ac('0xc')],_0x59d7ea));}function handleFindAgent(_0x302f31){return function(_0x5aaaf9){return _0x5aaaf9['name'][_0xc8ac('0xd')]()===_0x302f31[_0xc8ac('0xd')]();};}exports['consequence']=function(_0xfc9a48,_0x365106,_0x1d7d5c,_0x2dbba3){return function(_0x29b20e){try{var _0x831553={'name':_0x365106[0x0],'timeout':_0x365106[0x1]};var _0x501403=queue['validate'](_0x831553,{'typecast':!![]});if(_0x501403[_0xc8ac('0xe')]){logger[_0xc8ac('0xf')](_0xc8ac('0x10'),_0xfc9a48,_[_0xc8ac('0x11')](_0x501403,_0xc8ac('0x12'))[_0xc8ac('0x13')](',\x20'));_0x29b20e[_0xc8ac('0x14')]();}else{var _0x4b5773=_[_0xc8ac('0x15')](_0x1d7d5c[_0xc8ac('0x16')],handleFindAgent(_0x831553[_0xc8ac('0xc')]));if(_0x4b5773){var _0x1c27ef=(_0x831553['timeout']||0xa)*0x3e8;var _0x3c60ea,_0x4018a0;var _0x2551c3=seqqueue[_0xc8ac('0x17')](_0x1c27ef);_0x2551c3['id']=_0xfc9a48;_0x2551c3[_0xc8ac('0x18')]=_0x1c27ef;_0x2551c3[_0xc8ac('0x19')]=_0x2dbba3[_0xc8ac('0x19')];writeLog(_0xfc9a48,_0x4b5773,util[_0xc8ac('0xa')](_0xc8ac('0x1a'),_0x1c27ef));_0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48]['on'](_0xc8ac('0x1c'),function(){logger['info'](_0xc8ac('0x1d'),_0xfc9a48);clearTimeout(_0x4018a0);_0x4018a0=undefined;_0x2551c3[_0xc8ac('0x1e')]();if(_0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48]){delete _0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48];}_0x29b20e[_0xc8ac('0x14')]();});_0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48]['on'](_0xc8ac('0x1f'),function(){if(_0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48]){delete _0x1d7d5c[_0xc8ac('0x1b')][_0xfc9a48];}});_0x4018a0=setTimeout(function(){logger['info'](_0xc8ac('0x20'),_0xfc9a48);clearTimeout(_0x4018a0);_0x2551c3[_0xc8ac('0x1e')]();_0x29b20e[_0xc8ac('0x21')]();},_0x1c27ef);strategy[_0xc8ac('0x22')](_0x2551c3,_0x4b5773,_0x1d7d5c,_0x2dbba3);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xfc9a48,_0x831553[_0xc8ac('0xc')]);_0x29b20e['stop']();}}}catch(_0xad6bd7){console[_0xc8ac('0x23')](_0xad6bd7);logger[_0xc8ac('0xf')]('[%s][QUEUE]\x20%s',_0xfc9a48,_0xad6bd7[_0xc8ac('0x24')]);_0x29b20e[_0xc8ac('0x14')]();}};}; \ 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 61f57dc..4446f2a 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 _0x8d20=['isEmpty','Message','create','then','[%s][AMAZONLEX]\x20%s','body','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','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','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x7ff380,_0x14e315){var _0x22619e=function(_0xe7d538){while(--_0xe7d538){_0x7ff380['push'](_0x7ff380['shift']());}};_0x22619e(++_0x14e315);}(_0x8d20,0xa8));var _0x08d2=function(_0x469e35,_0x5b85b4){_0x469e35=_0x469e35-0x0;var _0x4e0402=_0x8d20[_0x469e35];return _0x4e0402;};'use strict';var _=require('lodash');var moment=require(_0x08d2('0x0'));var AWS=require(_0x08d2('0x1'));var utils=require(_0x08d2('0x2'));var logger=require(_0x08d2('0x3'))(_0x08d2('0x4'));var rpc={'chatMessage':require(_0x08d2('0x5')),'openchannelMessage':require(_0x08d2('0x6')),'mailMessage':require(_0x08d2('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x08d2('0x8')),'whatsappMessage':require(_0x08d2('0x9'))};exports[_0x08d2('0xa')]=function(_0x38e150,_0x9dfda4){return function(_0x5e33cc){try{if(!_['isNil'](this[_0x08d2('0xb')][_0x08d2('0xc')])){logger[_0x08d2('0xd')]('[%s][AMAZONLEX]\x20%s',_0x38e150,_0x08d2('0xe'));return _0x5e33cc[_0x08d2('0xf')]();}var _0x5c2986={'ContactId':this['contact']['id'],'sentAt':moment()[_0x08d2('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x08d2('0x11')};if(this[_0x08d2('0x12')]===_0x08d2('0x13')||this[_0x08d2('0x12')]===_0x08d2('0x14')){_0x5c2986[_0x08d2('0x15')]=this[_0x08d2('0xb')][_0x08d2('0x15')];}var _0x5b1971=this[_0x08d2('0x12')];if(_0x5b1971===_0x08d2('0x16')){_0x5c2986[_0x08d2('0x17')]=this[_0x08d2('0x18')]['id'];}else{_0x5c2986[_[_0x08d2('0x19')](_0x5b1971)+_0x08d2('0x1a')]=this['account']['id'];}_0x5c2986[_[_0x08d2('0x19')](_0x5b1971)+_0x08d2('0x1b')]=this[_0x08d2('0xb')]['id'];if(this[_0x08d2('0xb')]['created']){var _0x374e2f=_0x9dfda4[0x4];if(!_[_0x08d2('0x1c')](_0x374e2f)){_0x5c2986['body']=utils['getMustacheRender'](_0x374e2f,this);return rpc[_0x5b1971+_0x08d2('0x1d')][_0x08d2('0x1e')](_0x5c2986)[_0x08d2('0x1f')](function(_0x325887){logger[_0x08d2('0xd')](_0x08d2('0x20'),_0x38e150,_0x5c2986[_0x08d2('0x21')]);})[_0x08d2('0x22')](function(_0x2a8e85){logger[_0x08d2('0x23')](_0x08d2('0x20'),_0x38e150,JSON['stringify'](_0x2a8e85));})[_0x08d2('0x24')](function(){logger['info'](_0x08d2('0x25'),_0x38e150);_0x5e33cc[_0x08d2('0x26')]();});}else{logger[_0x08d2('0xd')](_0x08d2('0x27'),_0x38e150);_0x5e33cc['stop']();}}else{var _0x2c57b6=this;var _0x4c312f=new AWS[(_0x08d2('0x28'))]({'accessKeyId':_0x9dfda4[0x0],'secretAccessKey':_0x9dfda4[0x1],'region':_0x9dfda4[0x2]});var _0xefb5f5={'botAlias':_0x08d2('0x29'),'botName':_0x9dfda4[0x3],'inputText':this[_0x08d2('0x2a')][_0x08d2('0x21')],'userId':this[_0x08d2('0x12')]+':'+this[_0x08d2('0xb')]['id'][_0x08d2('0x2b')]()};_0x4c312f['postText'](_0xefb5f5,function(_0x22ed3b,_0x599b54){if(_0x22ed3b){logger[_0x08d2('0x23')]('[%s][AMAZONLEX]\x20%s',_0x38e150,_0x22ed3b[_0x08d2('0x2a')]);_0x5e33cc[_0x08d2('0xf')]();}else if(_0x599b54&&_0x599b54['message']){_0x2c57b6[_0x08d2('0x21')][_0x08d2('0x2c')]=_0x599b54;_0x5c2986[_0x08d2('0x21')]=_0x599b54[_0x08d2('0x2a')];_0x5c2986['providerName']=_0x08d2('0x2c');_0x5c2986[_0x08d2('0x2d')]=JSON[_0x08d2('0x2e')](_0x599b54);return rpc[_0x5b1971+_0x08d2('0x1d')][_0x08d2('0x1e')](_0x5c2986)[_0x08d2('0x1f')](function(_0x5c00da){logger[_0x08d2('0xd')](_0x08d2('0x20'),_0x38e150,_0x5c2986[_0x08d2('0x21')]);if(_0x599b54[_0x08d2('0x2f')]==_0x08d2('0x30')){_0x5e33cc['next']();}else{_0x5e33cc[_0x08d2('0x26')]();}})[_0x08d2('0x22')](function(_0x50eb23){logger[_0x08d2('0x23')](_0x08d2('0x20'),_0x38e150,JSON[_0x08d2('0x2e')](_0x50eb23));_0x5e33cc['next']();});}else{_0x5e33cc[_0x08d2('0xf')]();}});}}catch(_0x9b63f8){logger[_0x08d2('0x23')]('[%s][AMAZONLEX]\x20%s',_0x38e150,JSON[_0x08d2('0x2e')](_0x9b63f8));_0x5e33cc[_0x08d2('0x26')]();}};}; \ No newline at end of file +var _0x8bb9=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','error','amazonlex','providerResponse','stringify','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x1b808f,_0x1aba4f){var _0x4bc35b=function(_0x24c06d){while(--_0x24c06d){_0x1b808f['push'](_0x1b808f['shift']());}};_0x4bc35b(++_0x1aba4f);}(_0x8bb9,0x69));var _0x98bb=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x8bb9[_0x3227c1];return _0x31fd48;};'use strict';var _=require(_0x98bb('0x0'));var moment=require(_0x98bb('0x1'));var AWS=require(_0x98bb('0x2'));var utils=require(_0x98bb('0x3'));var logger=require(_0x98bb('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x98bb('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x98bb('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x98bb('0x7')]=function(_0x377e74,_0x18c413){return function(_0x478626){try{if(!_[_0x98bb('0x8')](this['interaction'][_0x98bb('0x9')])){logger[_0x98bb('0xa')](_0x98bb('0xb'),_0x377e74,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x478626[_0x98bb('0xc')]();}var _0x5f357c={'ContactId':this[_0x98bb('0xd')]['id'],'sentAt':moment()[_0x98bb('0xe')](_0x98bb('0xf')),'direction':_0x98bb('0x10')};if(this[_0x98bb('0x11')]==='sms'||this[_0x98bb('0x11')]===_0x98bb('0x12')){_0x5f357c[_0x98bb('0x13')]=this[_0x98bb('0x14')]['phone'];}var _0x1761eb=this['channel'];if(_0x1761eb===_0x98bb('0x15')){_0x5f357c[_0x98bb('0x16')]=this[_0x98bb('0x17')]['id'];}else{_0x5f357c[_[_0x98bb('0x18')](_0x1761eb)+'AccountId']=this[_0x98bb('0x17')]['id'];}_0x5f357c[_[_0x98bb('0x18')](_0x1761eb)+_0x98bb('0x19')]=this[_0x98bb('0x14')]['id'];if(this[_0x98bb('0x14')]['created']){var _0x170745=_0x18c413[0x4];if(!_[_0x98bb('0x1a')](_0x170745)){_0x5f357c[_0x98bb('0x1b')]=utils[_0x98bb('0x1c')](_0x170745,this);return rpc[_0x1761eb+_0x98bb('0x1d')][_0x98bb('0x1e')](_0x5f357c)[_0x98bb('0x1f')](function(_0x53b893){logger[_0x98bb('0xa')](_0x98bb('0xb'),_0x377e74,_0x5f357c['body']);})[_0x98bb('0x20')](function(_0x2b1e4d){logger['error'](_0x98bb('0xb'),_0x377e74,JSON['stringify'](_0x2b1e4d));})[_0x98bb('0x21')](function(){logger[_0x98bb('0xa')](_0x98bb('0x22'),_0x377e74);_0x478626[_0x98bb('0x23')]();});}else{logger[_0x98bb('0xa')](_0x98bb('0x24'),_0x377e74);_0x478626['stop']();}}else{var _0xa734c3=this;var _0x2a58ec=new AWS[(_0x98bb('0x25'))]({'accessKeyId':_0x18c413[0x0],'secretAccessKey':_0x18c413[0x1],'region':_0x18c413[0x2]});var _0x3ce8de={'botAlias':_0x98bb('0x26'),'botName':_0x18c413[0x3],'inputText':this[_0x98bb('0x27')][_0x98bb('0x1b')],'userId':this[_0x98bb('0x11')]+':'+this[_0x98bb('0x14')]['id'][_0x98bb('0x28')]()};_0x2a58ec['postText'](_0x3ce8de,function(_0x4d67be,_0x378f52){if(_0x4d67be){logger[_0x98bb('0x29')]('[%s][AMAZONLEX]\x20%s',_0x377e74,_0x4d67be['message']);_0x478626[_0x98bb('0xc')]();}else if(_0x378f52&&_0x378f52[_0x98bb('0x27')]){_0xa734c3['body']['amazonlex']=_0x378f52;_0x5f357c[_0x98bb('0x1b')]=_0x378f52[_0x98bb('0x27')];_0x5f357c['providerName']=_0x98bb('0x2a');_0x5f357c[_0x98bb('0x2b')]=JSON[_0x98bb('0x2c')](_0x378f52);return rpc[_0x1761eb+_0x98bb('0x1d')][_0x98bb('0x1e')](_0x5f357c)['then'](function(_0x5a6422){logger['info'](_0x98bb('0xb'),_0x377e74,_0x5f357c[_0x98bb('0x1b')]);if(_0x378f52[_0x98bb('0x2d')]==_0x98bb('0x2e')){_0x478626[_0x98bb('0xc')]();}else{_0x478626[_0x98bb('0x23')]();}})[_0x98bb('0x20')](function(_0x52a393){logger[_0x98bb('0x29')](_0x98bb('0xb'),_0x377e74,JSON[_0x98bb('0x2c')](_0x52a393));_0x478626[_0x98bb('0xc')]();});}else{_0x478626[_0x98bb('0xc')]();}});}}catch(_0x42e2a5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x377e74,JSON[_0x98bb('0x2c')](_0x42e2a5));_0x478626[_0x98bb('0x23')]();}};}; \ 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 0759e2c..d4e21a4 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 _0xc19d=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','Re:\x20','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','html','replace',''+_[_0xdc19('0x36')](_0x37016f[_0xdc19('0xf')],_0xdc19('0x37'),'';_0x37016f['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xdc19('0x38'),'Precedence':_0xdc19('0x39')};return mailRpc['sendMailMessage'](_0x56ea04,_0x37016f)[_0xdc19('0x3a')](function(_0x2cd112){logger[_0xdc19('0x16')](_0xdc19('0x3b'),_0x306b3a);_0x37016f[_0xdc19('0x3c')]=_0x2cd112['message']['messageId'];return rpc[_0x2647ce+_0xdc19('0x2b')][_0xdc19('0x3d')](_0x37016f);})[_0xdc19('0x3a')](function(_0x12b865){logger[_0xdc19('0x16')](_0xdc19('0x11'),_0x306b3a,JSON[_0xdc19('0x3e')](_0x12b865));})['catch'](function(_0x183665){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x306b3a,JSON[_0xdc19('0x3e')](_0x183665));})[_0xdc19('0x3f')](function(){Promise[_0xdc19('0x40')]()['then'](function(){if(_0xe88a23[0x0]!=='2'||_0x221fe6[_0xdc19('0x18')])return;return rpc[_0x2647ce+_0xdc19('0x41')][_0xdc19('0x42')](_0x221fe6['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4c349d){logger[_0xdc19('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x306b3a,JSON['stringify'](_0x4c349d));})['catch'](function(_0x3f4630){logger[_0xdc19('0x43')](_0xdc19('0x44'),_0x306b3a,JSON['stringify'](_0x3f4630));});})[_0xdc19('0x3a')](function(){_0x3c4858[_0xdc19('0x13')]();});});}else{return rpc[this[_0xdc19('0xe')]+_0xdc19('0x2b')][_0xdc19('0x3d')](_0x37016f)['then'](function(_0x243b25){logger[_0xdc19('0x16')](_0xdc19('0x11'),_0x306b3a,_0x37016f[_0xdc19('0xf')]);})[_0xdc19('0x45')](function(_0x1ee6dc){logger['error'](_0xdc19('0x11'),_0x306b3a,JSON['stringify'](_0x1ee6dc));})['finally'](function(){Promise['resolve']()[_0xdc19('0x3a')](function(){if(_0xe88a23[0x0]!=='2'||_0x221fe6[_0xdc19('0x18')])return;return rpc[_0x2647ce+_0xdc19('0x41')][_0xdc19('0x42')](_0x221fe6['id'],{'autoreplyExecuted':!![]})[_0xdc19('0x3a')](function(_0x596cd1){logger[_0xdc19('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x306b3a,JSON[_0xdc19('0x3e')](_0x596cd1));})['catch'](function(_0x400661){logger[_0xdc19('0x43')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x306b3a,JSON['stringify'](_0x400661));});})[_0xdc19('0x3a')](function(){_0x3c4858[_0xdc19('0x13')]();});});}}}catch(_0x67b0da){logger[_0xdc19('0x43')](_0xdc19('0x11'),_0x306b3a,JSON[_0xdc19('0x3e')](_0x67b0da));_0x3c4858[_0xdc19('0x46')]();}};}; \ No newline at end of file +var _0xe211=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','','auto-replied','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x1de46e,_0x3d5162){var _0x38d04b=function(_0x526d69){while(--_0x526d69){_0x1de46e['push'](_0x1de46e['shift']());}};_0x38d04b(++_0x3d5162);}(_0xe211,0x96));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e21('0x0'));var moment=require('moment');var utils=require(_0x1e21('0x1'));var logger=require(_0x1e21('0x2'))(_0x1e21('0x3'));var rpc={'chatMessage':require(_0x1e21('0x4')),'openchannelMessage':require(_0x1e21('0x5')),'mailMessage':require(_0x1e21('0x6')),'smsMessage':require(_0x1e21('0x7')),'faxMessage':require(_0x1e21('0x8')),'whatsappMessage':require(_0x1e21('0x9')),'chatInteraction':require(_0x1e21('0xa')),'openchannelInteraction':require(_0x1e21('0xb')),'mailInteraction':require(_0x1e21('0xc')),'smsInteraction':require(_0x1e21('0xd')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1e21('0xe'))};var mailRpc=require(_0x1e21('0xf'));exports[_0x1e21('0x10')]=function(_0xbb241d,_0x4d24ae,_0xa0e71f,_0x9eccdd){return function(_0x898dbd){try{var _0x12d8ab=this[_0x1e21('0x11')];if(_0x12d8ab==='mail'&&_0x9eccdd[_0x1e21('0x12')]['isAutoreply']){logger['info'](_0x1e21('0x13'),_0xbb241d,_0x1e21('0x14'));return _0x898dbd[_0x1e21('0x15')]();}if(_0x4d24ae[0x0]==='1'&&(_['isNil'](this[_0x1e21('0x16')]['created'])||!this[_0x1e21('0x16')][_0x1e21('0x17')])){logger[_0x1e21('0x18')](_0x1e21('0x13'),_0xbb241d,_0x1e21('0x19'));return _0x898dbd[_0x1e21('0x15')]();}if(_0x4d24ae[0x0]==='2'&&this[_0x1e21('0x16')][_0x1e21('0x1a')]){logger[_0x1e21('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xbb241d,'One\x20Time\x20already\x20sent');return _0x898dbd['next']();}var _0x4379dc={'ContactId':this[_0x1e21('0x1b')]['id'],'sentAt':moment()[_0x1e21('0x1c')](_0x1e21('0x1d')),'direction':_0x1e21('0x1e')};if(this[_0x1e21('0x11')]===_0x1e21('0x1f')){_0x4379dc['body']=utils['getMustacheRender'](_0x4d24ae[0x2],this);}else{_0x4379dc[_0x1e21('0x12')]=utils[_0x1e21('0x20')](_0x4d24ae[0x1],this);}if(this[_0x1e21('0x21')]){_0x4379dc['to']=this[_0x1e21('0x21')][_0x1e21('0x22')]||'';if(this[_0x1e21('0x11')]===_0x1e21('0x1f')&&_0x4d24ae[0x1]==='1'){_0x4379dc['cc']=this['message']['cc']||'';}_0x4379dc['from']=this[_0x1e21('0x21')]['to']||'';_0x4379dc[_0x1e21('0x23')]=this[_0x1e21('0x21')]['phone']||'';_0x4379dc['read']=!![];if(this['message'][_0x1e21('0x24')]){_0x4379dc[_0x1e21('0x24')]='';_0x4379dc['subject']+=_[_0x1e21('0x25')](this[_0x1e21('0x21')][_0x1e21('0x24')],_0x1e21('0x26'))?'':'Re:\x20';_0x4379dc[_0x1e21('0x24')]+=this[_0x1e21('0x21')][_0x1e21('0x24')];}}if(this[_0x1e21('0x11')]===_0x1e21('0x27')){_0x4379dc[_0x1e21('0x28')]=this[_0x1e21('0x29')]['id'];}else{_0x4379dc[_[_0x1e21('0x2a')](this[_0x1e21('0x11')])+_0x1e21('0x2b')]=this[_0x1e21('0x29')]['id'];}_0x4379dc[_[_0x1e21('0x2a')](this[_0x1e21('0x11')])+_0x1e21('0x2c')]=this['interaction']['id'];var _0x3dac13=this[_0x1e21('0x16')];if(rpc[this[_0x1e21('0x11')]+_0x1e21('0x2d')]){if(this[_0x1e21('0x11')]===_0x1e21('0x1f')){var _0xc60c64={'tls':{'rejectUnauthorized':![]}};if(this[_0x1e21('0x29')][_0x1e21('0x2e')][_0x1e21('0x2f')]){_0xc60c64[_0x1e21('0x2f')]=this[_0x1e21('0x29')][_0x1e21('0x2e')]['service'];}else{_0xc60c64['host']=this[_0x1e21('0x29')][_0x1e21('0x2e')][_0x1e21('0x30')];_0xc60c64[_0x1e21('0x31')]=this[_0x1e21('0x29')]['Smtp']['port'];_0xc60c64[_0x1e21('0x32')]=this[_0x1e21('0x29')]['Smtp'][_0x1e21('0x32')];}if(this[_0x1e21('0x29')][_0x1e21('0x2e')]['authentication']){_0xc60c64[_0x1e21('0x33')]={'user':this['account'][_0x1e21('0x2e')][_0x1e21('0x34')],'pass':this[_0x1e21('0x29')][_0x1e21('0x2e')][_0x1e21('0x35')]};}_0x4379dc[_0x1e21('0x36')]=this[_0x1e21('0x21')][_0x1e21('0x37')];_0x4379dc[_0x1e21('0x38')]=_0x1e21('0x39')+_[_0x1e21('0x3a')](_0x4379dc[_0x1e21('0x12')],_0x1e21('0x3b'),']+(>|$)/g,''),'priorityTrue':_0x4e3568[0x1],'priorityFalse':_0x4e3568[0x2]};var _0x330708=gotoif[_0x4bde('0x0')](_0x17899b,{'typecast':!![]});if(_0x330708[_0x4bde('0xb')]){logger[_0x4bde('0xc')](_0x4bde('0xd'),_0x1ac975,_[_0x4bde('0xe')](_0x330708,_0x4bde('0xf'))['join'](',\x20'));_0x3685bc[_0x4bde('0x10')]();}else{try{var _0x379e3e=eval('('+_0x17899b['condition']+')');var _0xfd3877=_0x379e3e?_0x17899b[_0x4bde('0x11')]:_0x17899b[_0x4bde('0x12')];logger[_0x4bde('0x13')](_0x4bde('0x14'),_0x1ac975,_0x17899b[_0x4bde('0x15')],_0x379e3e,_0xfd3877||_0x4bde('0x16'));if(_0xfd3877){var _0x520a75=_[_0x4bde('0x17')](_0x3685bc[_0x4bde('0x18')](),{'p':_0xfd3877});if(_0x520a75>=0x0){logger[_0x4bde('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1ac975,_0xfd3877||_0x4bde('0x16'),_0x520a75);_0x3685bc[_0x4bde('0x16')](_0x520a75);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1ac975,_0xfd3877||_0x4bde('0x16'));_0x3685bc[_0x4bde('0x10')]();}}else{_0x3685bc['next']();}}catch(_0x258c4d){logger[_0x4bde('0xc')](_0x4bde('0x19'),_0x1ac975,_0x258c4d[_0x4bde('0xf')]);_0x3685bc[_0x4bde('0x10')]();}}}catch(_0x1dd233){logger[_0x4bde('0xc')]('[%s][GOTOIF]\x20%s',_0x1ac975,JSON[_0x4bde('0x1a')](_0x1dd233));_0x3685bc['stop']();}};}; \ No newline at end of file +var _0x5a97=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x20736d,_0x436af4){var _0x5c7358=function(_0x32782e){while(--_0x32782e){_0x20736d['push'](_0x20736d['shift']());}};_0x5c7358(++_0x436af4);}(_0x5a97,0x1f2));var _0x75a9=function(_0x4fbb7b,_0x3f5274){_0x4fbb7b=_0x4fbb7b-0x0;var _0x4d8167=_0x5a97[_0x4fbb7b];return _0x4d8167;};'use strict';var schema=require(_0x75a9('0x0'));var _=require(_0x75a9('0x1'));var htmlToText=require(_0x75a9('0x2'));var utils=require(_0x75a9('0x3'));var logger=require('../../../../config/logger')(_0x75a9('0x4'));var gotoif=schema({'condition':{'type':_0x75a9('0x5'),'required':!![],'message':_0x75a9('0x6')},'priorityTrue':{'type':_0x75a9('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x75a9('0x7'),'message':_0x75a9('0x8')}});exports[_0x75a9('0x9')]=function(_0x538e16,_0x468d28){return function(_0x2c3433){try{var _0x8bfc8d={'condition':htmlToText[_0x75a9('0xa')](utils['getMustacheRender'](_0x468d28[0x0],this),{'wordwrap':![]})[_0x75a9('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x468d28[0x1],'priorityFalse':_0x468d28[0x2]};var _0x25834d=gotoif[_0x75a9('0x0')](_0x8bfc8d,{'typecast':!![]});if(_0x25834d[_0x75a9('0xc')]){logger[_0x75a9('0xd')](_0x75a9('0xe'),_0x538e16,_[_0x75a9('0xf')](_0x25834d,_0x75a9('0x10'))[_0x75a9('0x11')](',\x20'));_0x2c3433[_0x75a9('0x12')]();}else{try{var _0x581b43=eval('('+_0x8bfc8d[_0x75a9('0x13')]+')');var _0x456bc8=_0x581b43?_0x8bfc8d['priorityTrue']:_0x8bfc8d[_0x75a9('0x14')];logger[_0x75a9('0x15')](_0x75a9('0x16'),_0x538e16,_0x8bfc8d[_0x75a9('0x13')],_0x581b43,_0x456bc8||_0x75a9('0x17'));if(_0x456bc8){var _0x54c184=_[_0x75a9('0x18')](_0x2c3433[_0x75a9('0x19')](),{'p':_0x456bc8});if(_0x54c184>=0x0){logger[_0x75a9('0x15')](_0x75a9('0x1a'),_0x538e16,_0x456bc8||_0x75a9('0x17'),_0x54c184);_0x2c3433[_0x75a9('0x17')](_0x54c184);}else{logger[_0x75a9('0x15')](_0x75a9('0x1b'),_0x538e16,_0x456bc8||'next');_0x2c3433[_0x75a9('0x12')]();}}else{_0x2c3433['next']();}}catch(_0x2c3a2b){logger[_0x75a9('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x538e16,_0x2c3a2b[_0x75a9('0x10')]);_0x2c3433['stop']();}}}catch(_0x3bc193){logger[_0x75a9('0xd')]('[%s][GOTOIF]\x20%s',_0x538e16,JSON[_0x75a9('0x1c')](_0x3bc193));_0x2c3433['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index e8fef3d..99ae6fb 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 _0xe931=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules'];(function(_0x2d6e64,_0x458933){var _0x3700f3=function(_0x56d2ce){while(--_0x56d2ce){_0x2d6e64['push'](_0x2d6e64['shift']());}};_0x3700f3(++_0x458933);}(_0xe931,0x1e4));var _0x1e93=function(_0x37a3db,_0xf0e997){_0x37a3db=_0x37a3db-0x0;var _0x5a46c1=_0xe931[_0x37a3db];return _0x5a46c1;};'use strict';var schema=require(_0x1e93('0x0'));var _=require(_0x1e93('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x1e93('0x2'),'required':!![],'message':_0x1e93('0x3')}});exports[_0x1e93('0x4')]=function(_0x70dcd1,_0x41cea5){return function(_0x1b25ec){try{var _0x396c85={'priority':_0x41cea5[0x0]};var _0x4a9a9d=gotop['validate'](_0x396c85,{'typecast':!![]});if(_0x4a9a9d['length']){logger['error']('[%s][GOTOP]\x20%s',_0x70dcd1,_[_0x1e93('0x5')](_0x4a9a9d,'message')[_0x1e93('0x6')](',\x20'));_0x1b25ec[_0x1e93('0x7')]();}else{logger[_0x1e93('0x8')](_0x1e93('0x9'),_0x70dcd1,_0x396c85[_0x1e93('0xa')]);if(_0x396c85[_0x1e93('0xa')]){var _0x5af1a3=_['findIndex'](_0x1b25ec[_0x1e93('0xb')](),{'p':_0x396c85[_0x1e93('0xa')]});if(_0x5af1a3>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x70dcd1,_0x396c85[_0x1e93('0xa')]||_0x1e93('0xc'),_0x5af1a3);_0x1b25ec[_0x1e93('0xc')](_0x5af1a3);}else{logger[_0x1e93('0x8')](_0x1e93('0xd'),_0x70dcd1,_0x396c85['priority']||_0x1e93('0xc'));_0x1b25ec[_0x1e93('0x7')]();}}else{_0x1b25ec[_0x1e93('0xc')]();}}}catch(_0x34bbf5){logger[_0x1e93('0xe')](_0x1e93('0xf'),_0x70dcd1,JSON['stringify'](_0x34bbf5));_0x1b25ec[_0x1e93('0x7')]();}};}; \ No newline at end of file +var _0x9374=['findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x39fcd5,_0x474d5a){var _0xeb5477=function(_0x1623e6){while(--_0x1623e6){_0x39fcd5['push'](_0x39fcd5['shift']());}};_0xeb5477(++_0x474d5a);}(_0x9374,0x169));var _0x4937=function(_0x51af8c,_0x7ae22f){_0x51af8c=_0x51af8c-0x0;var _0x170551=_0x9374[_0x51af8c];return _0x170551;};'use strict';var schema=require(_0x4937('0x0'));var _=require(_0x4937('0x1'));var logger=require(_0x4937('0x2'))(_0x4937('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x4937('0x4')}});exports[_0x4937('0x5')]=function(_0x21074c,_0x544318){return function(_0x534a73){try{var _0x4859ba={'priority':_0x544318[0x0]};var _0x390cc8=gotop[_0x4937('0x0')](_0x4859ba,{'typecast':!![]});if(_0x390cc8[_0x4937('0x6')]){logger['error'](_0x4937('0x7'),_0x21074c,_[_0x4937('0x8')](_0x390cc8,_0x4937('0x9'))[_0x4937('0xa')](',\x20'));_0x534a73['stop']();}else{logger['info'](_0x4937('0xb'),_0x21074c,_0x4859ba[_0x4937('0xc')]);if(_0x4859ba[_0x4937('0xc')]){var _0x1f23d2=_[_0x4937('0xd')](_0x534a73[_0x4937('0xe')](),{'p':_0x4859ba[_0x4937('0xc')]});if(_0x1f23d2>=0x0){logger[_0x4937('0xf')](_0x4937('0x10'),_0x21074c,_0x4859ba['priority']||_0x4937('0x11'),_0x1f23d2);_0x534a73[_0x4937('0x11')](_0x1f23d2);}else{logger['info'](_0x4937('0x12'),_0x21074c,_0x4859ba[_0x4937('0xc')]||_0x4937('0x11'));_0x534a73[_0x4937('0x13')]();}}else{_0x534a73[_0x4937('0x11')]();}}}catch(_0x3accb3){logger[_0x4937('0x14')]('[%s][GOTOP]\x20%s',_0x21074c,JSON[_0x4937('0x15')](_0x3accb3));_0x534a73[_0x4937('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 11de6b4..5e5da75 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 _0x6124=['AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','error','stop','stringify','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0x346047,_0x4b6669){var _0x536fed=function(_0x2a0a97){while(--_0x2a0a97){_0x346047['push'](_0x346047['shift']());}};_0x536fed(++_0x4b6669);}(_0x6124,0x140));var _0x4612=function(_0x2684db,_0xae828a){_0x2684db=_0x2684db-0x0;var _0x22e28a=_0x6124[_0x2684db];return _0x22e28a;};'use strict';var _=require(_0x4612('0x0'));var utils=require(_0x4612('0x1'));var logger=require(_0x4612('0x2'))('routing');var rpc={'chatMessage':require(_0x4612('0x3')),'openchannelMessage':require(_0x4612('0x4')),'mailMessage':require(_0x4612('0x5')),'smsMessage':require(_0x4612('0x6')),'faxMessage':require(_0x4612('0x7')),'whatsappMessage':require(_0x4612('0x8'))};exports[_0x4612('0x9')]=function(_0x5dd8f7,_0x113683){return function(_0x30b185){try{var _0xc31d0={'body':utils[_0x4612('0xa')](_0x113683[0x0],this),'ContactId':this['contact']['id']};if(this[_0x4612('0xb')]===_0x4612('0xc')){_0xc31d0[_0x4612('0xd')]=this[_0x4612('0xe')]['id'];}else{_0xc31d0[_[_0x4612('0xf')](this[_0x4612('0xb')])+_0x4612('0x10')]=this[_0x4612('0xe')]['id'];}_0xc31d0[_[_0x4612('0xf')](this[_0x4612('0xb')])+_0x4612('0x11')]=this[_0x4612('0x12')]['id'];if(rpc[this[_0x4612('0xb')]+_0x4612('0x13')]){return rpc[this[_0x4612('0xb')]+_0x4612('0x13')][_0x4612('0x14')](_0xc31d0)['then'](function(_0x216b7d){logger[_0x4612('0x15')](_0x4612('0x16'),_0x5dd8f7,_0xc31d0[_0x4612('0x17')]);_0x30b185[_0x4612('0x18')]();})['catch'](function(_0x5929d6){logger[_0x4612('0x19')]('[%s][MESSAGE]\x20%s',_0x5dd8f7,JSON['stringify'](_0x5929d6));_0x30b185[_0x4612('0x1a')]();});}}catch(_0x3c23ca){logger[_0x4612('0x19')](_0x4612('0x16'),_0x5dd8f7,JSON[_0x4612('0x1b')](_0x3c23ca));_0x30b185[_0x4612('0x1a')]();}};}; \ No newline at end of file +var _0x34b7=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','../../../../config/logger','routing'];(function(_0x141dfd,_0x5310c4){var _0x35f88d=function(_0x491a73){while(--_0x491a73){_0x141dfd['push'](_0x141dfd['shift']());}};_0x35f88d(++_0x5310c4);}(_0x34b7,0x196));var _0x734b=function(_0x570b34,_0x537c5c){_0x570b34=_0x570b34-0x0;var _0x325f61=_0x34b7[_0x570b34];return _0x325f61;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var rpc={'chatMessage':require(_0x734b('0x2')),'openchannelMessage':require(_0x734b('0x3')),'mailMessage':require(_0x734b('0x4')),'smsMessage':require(_0x734b('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x734b('0x6')]=function(_0x2fde69,_0x2f3128){return function(_0x34fd70){try{var _0x28918a={'body':utils[_0x734b('0x7')](_0x2f3128[0x0],this),'ContactId':this['contact']['id']};if(this[_0x734b('0x8')]===_0x734b('0x9')){_0x28918a['ChatWebsiteId']=this['account']['id'];}else{_0x28918a[_['upperFirst'](this[_0x734b('0x8')])+'AccountId']=this[_0x734b('0xa')]['id'];}_0x28918a[_[_0x734b('0xb')](this[_0x734b('0x8')])+_0x734b('0xc')]=this[_0x734b('0xd')]['id'];if(rpc[this[_0x734b('0x8')]+_0x734b('0xe')]){return rpc[this[_0x734b('0x8')]+_0x734b('0xe')][_0x734b('0xf')](_0x28918a)[_0x734b('0x10')](function(_0xff9ddf){logger[_0x734b('0x11')](_0x734b('0x12'),_0x2fde69,_0x28918a['body']);_0x34fd70[_0x734b('0x13')]();})[_0x734b('0x14')](function(_0x47791c){logger[_0x734b('0x15')](_0x734b('0x12'),_0x2fde69,JSON[_0x734b('0x16')](_0x47791c));_0x34fd70[_0x734b('0x17')]();});}}catch(_0x2c03bd){logger[_0x734b('0x15')](_0x734b('0x12'),_0x2fde69,JSON[_0x734b('0x16')](_0x2c03bd));_0x34fd70['stop']();}};}; \ 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 228631f..23fe82b 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 _0x7565=['next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing'];(function(_0x47f2fb,_0x2a76e3){var _0x26d719=function(_0x384dfd){while(--_0x384dfd){_0x47f2fb['push'](_0x47f2fb['shift']());}};_0x26d719(++_0x2a76e3);}(_0x7565,0x1b0));var _0x5756=function(_0x1cd6f1,_0x27de4f){_0x1cd6f1=_0x1cd6f1-0x0;var _0x52988f=_0x7565[_0x1cd6f1];return _0x52988f;};'use strict';var utils=require('./utils');var logger=require(_0x5756('0x0'))(_0x5756('0x1'));exports['consequence']=function(_0x4de1ed,_0x26ad57){return function(_0x4a0020){try{logger['info']('[%s][NOOP]\x20%s',_0x4de1ed,utils['getMustacheRender'](_0x26ad57[0x0],this));_0x4a0020[_0x5756('0x2')]();}catch(_0x518d24){logger[_0x5756('0x3')](_0x5756('0x4'),_0x4de1ed,JSON[_0x5756('0x5')](_0x518d24));_0x4a0020[_0x5756('0x6')]();}};}; \ No newline at end of file +var _0x6b2a=['next','error','stringify','stop','./utils','info','getMustacheRender'];(function(_0x19c788,_0x2cf31d){var _0x364e70=function(_0x4106ce){while(--_0x4106ce){_0x19c788['push'](_0x19c788['shift']());}};_0x364e70(++_0x2cf31d);}(_0x6b2a,0xeb));var _0xa6b2=function(_0x3799ea,_0xfd97b9){_0x3799ea=_0x3799ea-0x0;var _0x379651=_0x6b2a[_0x3799ea];return _0x379651;};'use strict';var utils=require(_0xa6b2('0x0'));var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0x4b5a33,_0xbe93ba){return function(_0x4f07c7){try{logger[_0xa6b2('0x1')]('[%s][NOOP]\x20%s',_0x4b5a33,utils[_0xa6b2('0x2')](_0xbe93ba[0x0],this));_0x4f07c7[_0xa6b2('0x3')]();}catch(_0x10c747){logger[_0xa6b2('0x4')]('[%s][NOOP]\x20%s',_0x4b5a33,JSON[_0xa6b2('0x5')](_0x10c747));_0x4f07c7[_0xa6b2('0x6')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 42f3aa7..de723ff 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 _0x4fb5=['body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','queue_id','%sQueuesWaitingInteractions','format','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x4fb5,0xc8));var _0x54fb=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4fb5[_0x13d07a];return _0x5ee0ee;};'use strict';var schema=require(_0x54fb('0x0'));var _=require(_0x54fb('0x1'));var util=require(_0x54fb('0x2'));var seqqueue=require(_0x54fb('0x3'));var moment=require(_0x54fb('0x4'));var Redis=require(_0x54fb('0x5'));var config=require('../../../../config/environment');var logger=require(_0x54fb('0x6'))(_0x54fb('0x7'));var strategy=require('./strategy');config[_0x54fb('0x8')]=_[_0x54fb('0x9')](config[_0x54fb('0x8')],{'host':_0x54fb('0xa'),'port':0x18eb});var io=require(_0x54fb('0xb'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x54fb('0xc'),_0x54fb('0xd'),_0x54fb('0xe'),_0x54fb('0xf')];function emit(_0x1aba05,_0x404886,_0x43f707){io['to'](_0x1aba05)[_0x54fb('0x10')](_0x404886,_0x43f707);}function emitChannelQueueInteraction(_0xb7de70,_0x30a451,_0x249c22,_0xc56c97,_0x3fe1b3,_0x332e3a,_0x354cd8,_0xef7e67){var _0x1904e6=_['clone'](_0x249c22);_0x1904e6[_0x54fb('0x11')]=_0xef7e67;_0x1904e6['queue']=_0x30a451;_0x1904e6[_0x54fb('0xc')]=_0xc56c97;_0x1904e6['id']=_0x3fe1b3;if(_0x332e3a){_0x354cd8[util['format'](_0x54fb('0x12'),_0xb7de70)][_0x3fe1b3]=_['pick'](_0x1904e6,attributes);}else{delete _0x354cd8[util[_0x54fb('0x13')](_0x54fb('0x12'),_0xb7de70)][_0x3fe1b3];}emit(util[_0x54fb('0x13')]('%s:queue:%s',_0xb7de70,_0x30a451),util['format']('%s_queue_waiting_interaction:%s',_0xb7de70,_0x332e3a?_0x54fb('0x14'):_0x54fb('0x15')),_['pick'](_0x1904e6,attributes));}var rpc={'openchannelQueueReport':require(_0x54fb('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x54fb('0x17')),'smsQueueReport':require(_0x54fb('0x18')),'faxQueueReport':require(_0x54fb('0x19')),'whatsappQueueReport':require(_0x54fb('0x1a'))};var queue=schema({'name':{'type':_0x54fb('0x1b'),'required':!![],'message':_0x54fb('0x1c')},'timeout':{'type':_0x54fb('0x1d'),'message':_0x54fb('0x1e')}});function startRouting(_0x520738,_0x5263bb,_0x5dddd2,_0x21dc6e){if(_0x520738&&_0x5263bb&&_0x5dddd2){_0x5263bb['waiting']+=0x1;var _0x4672a9={'uniqueid':_0x520738,'from':_0x5dddd2[_0x54fb('0x1f')]?_0x5dddd2['body'][_0x54fb('0xe')]:'','joinAt':moment()[_0x54fb('0x13')](_0x54fb('0x20')),'ContactId':_0x5dddd2[_0x54fb('0x21')]?_0x5dddd2[_0x54fb('0x21')]['id']:null,'ListId':_0x5dddd2[_0x54fb('0x22')]?_0x5dddd2[_0x54fb('0x22')]['id']:null};_0x4672a9[_[_0x54fb('0x23')](_0x5dddd2[_0x54fb('0x24')])+_0x54fb('0x25')]=_0x5263bb['id']||null;_0x4672a9[_['upperFirst'](_0x5dddd2[_0x54fb('0x24')])+_0x54fb('0x26')]=_0x5dddd2[_0x54fb('0x27')]?_0x5dddd2[_0x54fb('0x27')]['id']:null;_0x4672a9[_['upperFirst'](_0x5dddd2['channel'])+_0x54fb('0x28')]=_0x5dddd2[_0x54fb('0x29')]?_0x5dddd2[_0x54fb('0x29')]['id']:null;_0x4672a9[_[_0x54fb('0x23')](_0x5dddd2[_0x54fb('0x24')])+(_0x5dddd2[_0x54fb('0x24')]!==_0x54fb('0x2a')?_0x54fb('0x2b'):_0x54fb('0x2c'))]=_0x5dddd2[_0x54fb('0xc')]?_0x5dddd2[_0x54fb('0xc')]['id']:null;logger[_0x54fb('0x2d')](util[_0x54fb('0x13')](_0x54fb('0x2e'),_0x520738,_0x5263bb[_0x54fb('0x2f')]));emitChannelQueueInteraction(_0x5dddd2[_0x54fb('0x24')],_0x5263bb['name'],_0x4672a9,_0x5dddd2[_0x54fb('0xc')][_0x54fb('0x2f')],_0x5dddd2[_0x54fb('0x29')]['id'],!![],_0x21dc6e,_0x5263bb['id']);if(rpc[_0x5dddd2['channel']+_0x54fb('0x30')]){return rpc[_0x5dddd2[_0x54fb('0x24')]+_0x54fb('0x30')][_0x54fb('0x31')](_0x4672a9)[_0x54fb('0x32')](function(_0x276000){logger[_0x54fb('0x33')](_0x54fb('0x34'));});}}}function stopRouting(_0x3b0d65,_0x10d565,_0x3037bc,_0x28b1e2){if(_0x3b0d65&&_0x10d565){_0x10d565['waiting']-=0x1;var _0x5915ea={'leaveAt':moment()['format'](_0x54fb('0x20')),'acceptAt':moment()[_0x54fb('0x13')](_0x54fb('0x20')),'reason':_0x54fb('0x35')};logger[_0x54fb('0x2d')](util['format'](_0x54fb('0x36'),_0x3b0d65,_0x10d565[_0x54fb('0x2f')]));emitChannelQueueInteraction(_0x3037bc['channel'],_0x10d565[_0x54fb('0x2f')],_0x3037bc['body'],_0x3037bc['account'][_0x54fb('0x2f')],_0x3037bc[_0x54fb('0x29')]['id'],![],_0x28b1e2,_0x10d565['id']);if(rpc[_0x3037bc[_0x54fb('0x24')]+_0x54fb('0x30')]){return rpc[_0x3037bc[_0x54fb('0x24')]+'QueueReport'][_0x54fb('0x37')](_0x3b0d65,_0x5915ea)['catch'](function(_0x5edd9d){logger[_0x54fb('0x33')](_0x54fb('0x38'));});}}}function endRouting(_0x55800a,_0x401f75,_0x2405e0,_0x79602c){if(_0x55800a&&_0x401f75){_0x401f75['waiting']-=0x1;var _0x18419b={'leaveAt':moment()[_0x54fb('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x54fb('0x20')),'reason':_0x54fb('0x39')};logger[_0x54fb('0x2d')](util['format'](_0x54fb('0x3a'),_0x55800a,_0x401f75[_0x54fb('0x2f')]));emitChannelQueueInteraction(_0x2405e0[_0x54fb('0x24')],_0x401f75[_0x54fb('0x2f')],_0x2405e0[_0x54fb('0x1f')],_0x2405e0['account'][_0x54fb('0x2f')],_0x2405e0[_0x54fb('0x29')]['id'],![],_0x79602c);if(rpc[_0x2405e0[_0x54fb('0x24')]+_0x54fb('0x30')]){return rpc[_0x2405e0[_0x54fb('0x24')]+_0x54fb('0x30')][_0x54fb('0x37')](_0x55800a,_0x18419b)[_0x54fb('0x32')](function(_0xcb68ef){logger['error'](_0x54fb('0x38'));});}}}function handleFindQueue(_0x1f3713){return function(_0x4d90a4){return _0x4d90a4['name']['toLowerCase']()===_0x1f3713[_0x54fb('0x3b')]();};}exports['consequence']=function(_0x1a859a,_0x43b411,_0x1ee17e,_0x594f4f){return function(_0x630843){try{var _0x1eca3e={'name':_0x43b411[0x0],'timeout':_0x43b411[0x1]};var _0x3c15b5=queue[_0x54fb('0x0')](_0x1eca3e,{'typecast':!![]});if(_0x3c15b5[_0x54fb('0x3c')]){logger[_0x54fb('0x33')](_0x54fb('0x3d'),_0x1a859a,_['map'](_0x3c15b5,_0x54fb('0x29'))[_0x54fb('0x3e')](',\x20'));_0x630843[_0x54fb('0x3f')]();}else{var _0x11d780=_[_0x54fb('0x40')](_0x1ee17e[_0x594f4f[_0x54fb('0x24')]+_0x54fb('0x41')],handleFindQueue(_0x1eca3e[_0x54fb('0x2f')]));if(_0x11d780){startRouting(_0x1a859a,_0x11d780,_0x594f4f,_0x1ee17e);var _0x1d1c59=(_0x11d780[_0x54fb('0x39')]||0xa)*0x3e8;var _0xa2ea27=(_0x1eca3e[_0x54fb('0x39')]||0x14)*0x3e8;var _0x411fef,_0x24a865;if(_0x1d1c59>_0xa2ea27){_0xa2ea27=_0x1d1c59;}var _0x42d955=seqqueue['createQueue'](_0x1d1c59);_0x42d955['id']=_0x1a859a;_0x42d955['atimeout']=_0x1d1c59;_0x42d955[_0x54fb('0x42')]=_0xa2ea27;_0x42d955[_0x54fb('0x24')]=_0x594f4f[_0x54fb('0x24')];_0x1ee17e[_0x54fb('0x43')][_0x1a859a]['on']('end',function(){logger[_0x54fb('0x2d')](_0x54fb('0x44'),_0x1a859a);stopRouting(_0x1a859a,_0x11d780,_0x594f4f,_0x1ee17e);clearTimeout(_0x411fef);_0x411fef=undefined;_0x42d955[_0x54fb('0x45')](!![]);if(_0x1ee17e[_0x54fb('0x43')][_0x1a859a]){delete _0x1ee17e['rules'][_0x1a859a];}_0x630843['stop']();});_0x1ee17e[_0x54fb('0x43')][_0x1a859a]['on']('complete',function(){if(_0x1ee17e[_0x54fb('0x43')][_0x1a859a]){delete _0x1ee17e['rules'][_0x1a859a];}});_0x411fef=setTimeout(function(){logger['info'](_0x54fb('0x46'),_0x1a859a);endRouting(_0x1a859a,_0x11d780,_0x594f4f,_0x1ee17e);clearTimeout(_0x411fef);_0x42d955[_0x54fb('0x45')](!![]);_0x630843[_0x54fb('0x47')]();},_0xa2ea27);switch(_0x11d780[_0x54fb('0x48')]){case _0x54fb('0x49'):strategy[_0x54fb('0x49')](_0x42d955,_0x11d780,_0x1ee17e,_0x594f4f);break;default:strategy[_0x54fb('0x4a')](_0x42d955,_0x11d780,_0x1ee17e,_0x594f4f);}}else{logger[_0x54fb('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1a859a,_0x1eca3e['name']);_0x630843[_0x54fb('0x3f')]();}}}catch(_0x7bb0be){console[_0x54fb('0x4b')](_0x7bb0be);logger[_0x54fb('0x33')](_0x54fb('0x3d'),_0x1a859a,_0x7bb0be[_0x54fb('0x4c')]);_0x630843['stop']();}};}; \ No newline at end of file +var _0x60ae=['catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','beepall','log','stack','validate','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','redis','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create'];(function(_0x45841d,_0x320ce1){var _0x30037c=function(_0x34260b){while(--_0x34260b){_0x45841d['push'](_0x45841d['shift']());}};_0x30037c(++_0x320ce1);}(_0x60ae,0xb0));var _0xe60a=function(_0xc6d89e,_0x20e99c){_0xc6d89e=_0xc6d89e-0x0;var _0x3d5476=_0x60ae[_0xc6d89e];return _0x3d5476;};'use strict';var schema=require(_0xe60a('0x0'));var _=require('lodash');var util=require(_0xe60a('0x1'));var seqqueue=require(_0xe60a('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0xe60a('0x3'));var logger=require(_0xe60a('0x4'))(_0xe60a('0x5'));var strategy=require('./strategy');config[_0xe60a('0x6')]=_['defaults'](config[_0xe60a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe60a('0x7'))(new Redis(config[_0xe60a('0x6')]));var attributes=['id',_0xe60a('0x8'),_0xe60a('0x9'),_0xe60a('0xa'),'from',_0xe60a('0xb')];function emit(_0x26c3f2,_0x11fbce,_0x11895e){io['to'](_0x26c3f2)[_0xe60a('0xc')](_0x11fbce,_0x11895e);}function emitChannelQueueInteraction(_0x56f099,_0x1a5b2e,_0x4e137b,_0x3f269f,_0x1ba4ba,_0x11ce88,_0x432bd2,_0x4d3759){var _0x24fd94=_[_0xe60a('0xd')](_0x4e137b);_0x24fd94['queue_id']=_0x4d3759;_0x24fd94[_0xe60a('0xa')]=_0x1a5b2e;_0x24fd94[_0xe60a('0x9')]=_0x3f269f;_0x24fd94['id']=_0x1ba4ba;if(_0x11ce88){_0x432bd2[util['format'](_0xe60a('0xe'),_0x56f099)][_0x1ba4ba]=_[_0xe60a('0xf')](_0x24fd94,attributes);}else{delete _0x432bd2[util[_0xe60a('0x10')]('%sQueuesWaitingInteractions',_0x56f099)][_0x1ba4ba];}emit(util['format'](_0xe60a('0x11'),_0x56f099,_0x1a5b2e),util['format']('%s_queue_waiting_interaction:%s',_0x56f099,_0x11ce88?_0xe60a('0x12'):_0xe60a('0x13')),_[_0xe60a('0xf')](_0x24fd94,attributes));}var rpc={'openchannelQueueReport':require(_0xe60a('0x14')),'mailQueueReport':require(_0xe60a('0x15')),'chatQueueReport':require(_0xe60a('0x16')),'smsQueueReport':require(_0xe60a('0x17')),'faxQueueReport':require(_0xe60a('0x18')),'whatsappQueueReport':require(_0xe60a('0x19'))};var queue=schema({'name':{'type':_0xe60a('0x1a'),'required':!![],'message':_0xe60a('0x1b')},'timeout':{'type':_0xe60a('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2cf79c,_0x5ea134,_0x2c2b42,_0x3b979c){if(_0x2cf79c&&_0x5ea134&&_0x2c2b42){_0x5ea134[_0xe60a('0x1d')]+=0x1;var _0x41f180={'uniqueid':_0x2cf79c,'from':_0x2c2b42[_0xe60a('0x1e')]?_0x2c2b42[_0xe60a('0x1e')][_0xe60a('0x1f')]:'','joinAt':moment()[_0xe60a('0x10')](_0xe60a('0x20')),'ContactId':_0x2c2b42['contact']?_0x2c2b42[_0xe60a('0x21')]['id']:null,'ListId':_0x2c2b42['list']?_0x2c2b42[_0xe60a('0x22')]['id']:null};_0x41f180[_[_0xe60a('0x23')](_0x2c2b42['channel'])+_0xe60a('0x24')]=_0x5ea134['id']||null;_0x41f180[_[_0xe60a('0x23')](_0x2c2b42[_0xe60a('0x25')])+_0xe60a('0x26')]=_0x2c2b42[_0xe60a('0x27')]?_0x2c2b42[_0xe60a('0x27')]['id']:null;_0x41f180[_[_0xe60a('0x23')](_0x2c2b42[_0xe60a('0x25')])+_0xe60a('0x28')]=_0x2c2b42[_0xe60a('0x29')]?_0x2c2b42['message']['id']:null;_0x41f180[_[_0xe60a('0x23')](_0x2c2b42[_0xe60a('0x25')])+(_0x2c2b42[_0xe60a('0x25')]!==_0xe60a('0x2a')?_0xe60a('0x2b'):'WebsiteId')]=_0x2c2b42[_0xe60a('0x9')]?_0x2c2b42[_0xe60a('0x9')]['id']:null;logger[_0xe60a('0x2c')](util['format'](_0xe60a('0x2d'),_0x2cf79c,_0x5ea134[_0xe60a('0x2e')]));emitChannelQueueInteraction(_0x2c2b42[_0xe60a('0x25')],_0x5ea134['name'],_0x41f180,_0x2c2b42[_0xe60a('0x9')][_0xe60a('0x2e')],_0x2c2b42[_0xe60a('0x29')]['id'],!![],_0x3b979c,_0x5ea134['id']);if(rpc[_0x2c2b42[_0xe60a('0x25')]+_0xe60a('0x2f')]){return rpc[_0x2c2b42[_0xe60a('0x25')]+_0xe60a('0x2f')][_0xe60a('0x30')](_0x41f180)[_0xe60a('0x31')](function(_0x1dfba6){logger[_0xe60a('0x32')](_0xe60a('0x33'));});}}}function stopRouting(_0x38ada9,_0x3f48f2,_0x187483,_0x4ab3fb){if(_0x38ada9&&_0x3f48f2){_0x3f48f2[_0xe60a('0x1d')]-=0x1;var _0x31a322={'leaveAt':moment()['format'](_0xe60a('0x20')),'acceptAt':moment()[_0xe60a('0x10')](_0xe60a('0x20')),'reason':_0xe60a('0x34')};logger['info'](util[_0xe60a('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x38ada9,_0x3f48f2['name']));emitChannelQueueInteraction(_0x187483[_0xe60a('0x25')],_0x3f48f2['name'],_0x187483['body'],_0x187483[_0xe60a('0x9')]['name'],_0x187483[_0xe60a('0x29')]['id'],![],_0x4ab3fb,_0x3f48f2['id']);if(rpc[_0x187483['channel']+_0xe60a('0x2f')]){return rpc[_0x187483[_0xe60a('0x25')]+'QueueReport'][_0xe60a('0x35')](_0x38ada9,_0x31a322)[_0xe60a('0x31')](function(_0x3580e1){logger[_0xe60a('0x32')](_0xe60a('0x36'));});}}}function endRouting(_0x2922ec,_0x53d522,_0x2ad4e3,_0x112ac0){if(_0x2922ec&&_0x53d522){_0x53d522[_0xe60a('0x1d')]-=0x1;var _0x10dc0d={'leaveAt':moment()[_0xe60a('0x10')](_0xe60a('0x20')),'exitAt':moment()[_0xe60a('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe60a('0x37')};logger['info'](util[_0xe60a('0x10')](_0xe60a('0x38'),_0x2922ec,_0x53d522[_0xe60a('0x2e')]));emitChannelQueueInteraction(_0x2ad4e3[_0xe60a('0x25')],_0x53d522[_0xe60a('0x2e')],_0x2ad4e3[_0xe60a('0x1e')],_0x2ad4e3['account'][_0xe60a('0x2e')],_0x2ad4e3[_0xe60a('0x29')]['id'],![],_0x112ac0);if(rpc[_0x2ad4e3[_0xe60a('0x25')]+'QueueReport']){return rpc[_0x2ad4e3[_0xe60a('0x25')]+'QueueReport'][_0xe60a('0x35')](_0x2922ec,_0x10dc0d)[_0xe60a('0x31')](function(_0x9d4cae){logger[_0xe60a('0x32')](_0xe60a('0x36'));});}}}function handleFindQueue(_0x30d510){return function(_0xe03004){return _0xe03004[_0xe60a('0x2e')][_0xe60a('0x39')]()===_0x30d510[_0xe60a('0x39')]();};}exports[_0xe60a('0x3a')]=function(_0x50c42e,_0x41a696,_0x587c68,_0x395817){return function(_0x3fd9ba){try{var _0x55c32d={'name':_0x41a696[0x0],'timeout':_0x41a696[0x1]};var _0x17456d=queue[_0xe60a('0x0')](_0x55c32d,{'typecast':!![]});if(_0x17456d['length']){logger[_0xe60a('0x32')](_0xe60a('0x3b'),_0x50c42e,_[_0xe60a('0x3c')](_0x17456d,_0xe60a('0x29'))['join'](',\x20'));_0x3fd9ba[_0xe60a('0x3d')]();}else{var _0x245d9c=_[_0xe60a('0x3e')](_0x587c68[_0x395817['channel']+_0xe60a('0x3f')],handleFindQueue(_0x55c32d['name']));if(_0x245d9c){startRouting(_0x50c42e,_0x245d9c,_0x395817,_0x587c68);var _0xa85b28=(_0x245d9c[_0xe60a('0x37')]||0xa)*0x3e8;var _0xc1d137=(_0x55c32d[_0xe60a('0x37')]||0x14)*0x3e8;var _0x5e58b6,_0x413095;if(_0xa85b28>_0xc1d137){_0xc1d137=_0xa85b28;}var _0x52e95c=seqqueue[_0xe60a('0x40')](_0xa85b28);_0x52e95c['id']=_0x50c42e;_0x52e95c[_0xe60a('0x41')]=_0xa85b28;_0x52e95c['qtimeout']=_0xc1d137;_0x52e95c[_0xe60a('0x25')]=_0x395817['channel'];_0x587c68[_0xe60a('0x42')][_0x50c42e]['on'](_0xe60a('0x43'),function(){logger[_0xe60a('0x2c')](_0xe60a('0x44'),_0x50c42e);stopRouting(_0x50c42e,_0x245d9c,_0x395817,_0x587c68);clearTimeout(_0x5e58b6);_0x5e58b6=undefined;_0x52e95c[_0xe60a('0x45')](!![]);if(_0x587c68[_0xe60a('0x42')][_0x50c42e]){delete _0x587c68['rules'][_0x50c42e];}_0x3fd9ba['stop']();});_0x587c68['rules'][_0x50c42e]['on'](_0xe60a('0x46'),function(){if(_0x587c68['rules'][_0x50c42e]){delete _0x587c68[_0xe60a('0x42')][_0x50c42e];}});_0x5e58b6=setTimeout(function(){logger[_0xe60a('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x50c42e);endRouting(_0x50c42e,_0x245d9c,_0x395817,_0x587c68);clearTimeout(_0x5e58b6);_0x52e95c[_0xe60a('0x45')](!![]);_0x3fd9ba[_0xe60a('0x47')]();},_0xc1d137);switch(_0x245d9c['strategy']){case'rrmemory':strategy['rrmemory'](_0x52e95c,_0x245d9c,_0x587c68,_0x395817);break;default:strategy[_0xe60a('0x48')](_0x52e95c,_0x245d9c,_0x587c68,_0x395817);}}else{logger[_0xe60a('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x50c42e,_0x55c32d['name']);_0x3fd9ba[_0xe60a('0x3d')]();}}}catch(_0x58c2f0){console[_0xe60a('0x49')](_0x58c2f0);logger['error'](_0xe60a('0x3b'),_0x50c42e,_0x58c2f0[_0xe60a('0x4a')]);_0x3fd9ba[_0xe60a('0x3d')]();}};}; \ 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 2146ebb..600d70d 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 _0x75e8=['busyQueue','writeLog','STOP','exports','lodash','../../../../../config/logger','routing','agent','squeue','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','isAgentAvailable','realtime','channel','busy','showNotification','notificationId','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75e8,0x1b6));var _0x875e=function(_0x1efde6,_0x3ab21e){_0x1efde6=_0x1efde6-0x0;var _0x1c9021=_0x75e8[_0x1efde6];return _0x1c9021;};'use strict';var _=require(_0x875e('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x875e('0x1'))(_0x875e('0x2'));var Agent=function(_0x3a5da8,_0x5e1756,_0xde2df1,_0x1b1ee1){this['notificationId']=uuid['v4']();this['squeue']=_0x3a5da8;this[_0x875e('0x3')]=_0x5e1756;this['realtime']=_0xde2df1;this[_0x875e('0x2')]=_0x1b1ee1;this[_0x875e('0x4')][_0x875e('0x5')](this['handleRun'][_0x875e('0x6')](this),this[_0x875e('0x7')][_0x875e('0x6')](this));this[_0x875e('0x4')]['on']('timeout',this['handleTimeout'][_0x875e('0x6')](this));this[_0x875e('0x4')]['on'](_0x875e('0x8'),this[_0x875e('0x9')]['bind'](this));};Agent[_0x875e('0xa')][_0x875e('0x5')]=function(){this[_0x875e('0x4')][_0x875e('0x5')](this[_0x875e('0xb')]['bind'](this),this[_0x875e('0x7')][_0x875e('0x6')](this));};Agent['prototype'][_0x875e('0x9')]=function(){this[_0x875e('0x7')](!![]);};Agent[_0x875e('0xa')]['handleRun']=function(_0x5a59ff){logger[_0x875e('0xc')](_0x875e('0xd'),this['squeue']['id'],this['agent']['id']);if(_[_0x875e('0xe')](this['realtime'][_0x875e('0xf')][this['agent']['id']])){logger[_0x875e('0xc')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x875e('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x875e('0x6')](this),0x3e8);}else{if(this[_0x875e('0x2')]['forcedOwnership']||util[_0x875e('0x10')](this['squeue']['id'],this[_0x875e('0x11')][_0x875e('0xf')][this['agent']['id']],this[_0x875e('0x4')][_0x875e('0x12')],![])){this[_0x875e('0x11')][_0x875e('0xf')][this['agent']['id']][_0x875e('0x13')]=!![];this['realtime'][_0x875e('0xf')][this[_0x875e('0x3')]['id']]['busyQueue']=undefined;util[_0x875e('0x14')](this[_0x875e('0x15')],this[_0x875e('0x4')]['id'],this[_0x875e('0x11')][_0x875e('0xf')][this['agent']['id']],null,this[_0x875e('0x2')]);util['writeLog'](this[_0x875e('0x4')]['id'],this[_0x875e('0x11')]['agents'][this[_0x875e('0x3')]['id']],_0x875e('0x16')+(this[_0x875e('0x2')]['forcedOwnership']?':FORCED':''));}else{logger[_0x875e('0xc')](_0x875e('0x17'),this[_0x875e('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x875e('0x5')][_0x875e('0x6')](this),0x3e8);}}};Agent['prototype'][_0x875e('0x7')]=function(_0x1885c7){if(_[_0x875e('0xe')](this['realtime'][_0x875e('0xf')][this[_0x875e('0x3')]['id']])){return logger[_0x875e('0xc')](_0x875e('0x18'),this[_0x875e('0x4')]['id'],this[_0x875e('0x3')]['id']);}else{logger[_0x875e('0xc')](_0x875e('0x19'),this['squeue']['id'],this[_0x875e('0x3')]['id']);util[_0x875e('0x1a')](this[_0x875e('0x15')],this[_0x875e('0x4')]['id'],this[_0x875e('0x11')]['agents'][this[_0x875e('0x3')]['id']],null,this['routing']);this[_0x875e('0x11')][_0x875e('0xf')][this[_0x875e('0x3')]['id']][_0x875e('0x13')]=![];this['realtime'][_0x875e('0xf')][this[_0x875e('0x3')]['id']][_0x875e('0x1b')]=undefined;util[_0x875e('0x1c')](this['squeue']['id'],this[_0x875e('0x11')]['agents'][this[_0x875e('0x3')]['id']],_0x1885c7?_0x875e('0x1d'):'TIMEOUT');}if(!_0x1885c7){setTimeout(this[_0x875e('0x5')][_0x875e('0x6')](this),0x3e8);}};function agent(_0x258ea4,_0x21d9a8,_0x20a973,_0x2b0c1f){return new Agent(_0x258ea4,_0x21d9a8,_0x20a973,_0x2b0c1f);}module[_0x875e('0x1e')]=agent; \ No newline at end of file +var _0x3371=['TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','showNotification','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','STOP'];(function(_0x4da690,_0x12d136){var _0x263c53=function(_0x1832fa){while(--_0x1832fa){_0x4da690['push'](_0x4da690['shift']());}};_0x263c53(++_0x12d136);}(_0x3371,0xb1));var _0x1337=function(_0x3f1068,_0x2d4f61){_0x3f1068=_0x3f1068-0x0;var _0x54c89c=_0x3371[_0x3f1068];return _0x54c89c;};'use strict';var _=require(_0x1337('0x0'));var uuid=require(_0x1337('0x1'));var util=require('./util');var logger=require(_0x1337('0x2'))(_0x1337('0x3'));var Agent=function(_0x1afd24,_0x49e11d,_0x502428,_0x5408f5){this[_0x1337('0x4')]=uuid['v4']();this['squeue']=_0x1afd24;this[_0x1337('0x5')]=_0x49e11d;this[_0x1337('0x6')]=_0x502428;this['routing']=_0x5408f5;this[_0x1337('0x7')][_0x1337('0x8')](this[_0x1337('0x9')][_0x1337('0xa')](this),this[_0x1337('0xb')]['bind'](this));this['squeue']['on'](_0x1337('0xc'),this[_0x1337('0xb')][_0x1337('0xa')](this));this[_0x1337('0x7')]['on'](_0x1337('0xd'),this[_0x1337('0xe')][_0x1337('0xa')](this));};Agent[_0x1337('0xf')]['push']=function(){this[_0x1337('0x7')][_0x1337('0x8')](this[_0x1337('0x9')][_0x1337('0xa')](this),this[_0x1337('0xb')]['bind'](this));};Agent[_0x1337('0xf')][_0x1337('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x1337('0xf')]['handleRun']=function(_0x6648a1){logger['info'](_0x1337('0x10'),this[_0x1337('0x7')]['id'],this[_0x1337('0x5')]['id']);if(_[_0x1337('0x11')](this[_0x1337('0x6')][_0x1337('0x12')][this[_0x1337('0x5')]['id']])){logger[_0x1337('0x13')](_0x1337('0x14'),this[_0x1337('0x7')]['id'],this['agent']['id']);setTimeout(this[_0x1337('0x8')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x1337('0x15')](this['squeue']['id'],this[_0x1337('0x6')]['agents'][this[_0x1337('0x5')]['id']],this[_0x1337('0x7')][_0x1337('0x16')],![])){this[_0x1337('0x6')]['agents'][this['agent']['id']]['busy']=!![];this[_0x1337('0x6')][_0x1337('0x12')][this[_0x1337('0x5')]['id']]['busyQueue']=undefined;util[_0x1337('0x17')](this[_0x1337('0x4')],this[_0x1337('0x7')]['id'],this[_0x1337('0x6')]['agents'][this['agent']['id']],null,this[_0x1337('0x3')]);util[_0x1337('0x18')](this[_0x1337('0x7')]['id'],this[_0x1337('0x6')][_0x1337('0x12')][this['agent']['id']],_0x1337('0x19')+(this[_0x1337('0x3')][_0x1337('0x1a')]?':FORCED':''));}else{logger[_0x1337('0x13')](_0x1337('0x1b'),this['squeue']['id'],this[_0x1337('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x1337('0xf')]['handleTimeout']=function(_0x551017){if(_[_0x1337('0x11')](this[_0x1337('0x6')][_0x1337('0x12')][this['agent']['id']])){return logger[_0x1337('0x13')](_0x1337('0x14'),this[_0x1337('0x7')]['id'],this[_0x1337('0x5')]['id']);}else{logger['info'](_0x1337('0x1c'),this[_0x1337('0x7')]['id'],this['agent']['id']);util[_0x1337('0x1d')](this['notificationId'],this[_0x1337('0x7')]['id'],this['realtime'][_0x1337('0x12')][this[_0x1337('0x5')]['id']],null,this['routing']);this['realtime'][_0x1337('0x12')][this[_0x1337('0x5')]['id']][_0x1337('0x1e')]=![];this['realtime'][_0x1337('0x12')][this['agent']['id']][_0x1337('0x1f')]=undefined;util['writeLog'](this[_0x1337('0x7')]['id'],this[_0x1337('0x6')]['agents'][this[_0x1337('0x5')]['id']],_0x551017?_0x1337('0x20'):_0x1337('0x21'));}if(!_0x551017){setTimeout(this[_0x1337('0x8')]['bind'](this),0x3e8);}};function agent(_0x18b0ac,_0x28116f,_0x30e073,_0x2042bc){return new Agent(_0x18b0ac,_0x28116f,_0x30e073,_0x2042bc);}module[_0x1337('0x22')]=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 e6e8a50..85c727f 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 _0x98a7=['squeue','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','isNil','queue','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','realtime'];(function(_0x39bf1d,_0x2aa2a7){var _0x4716a7=function(_0x4aaa71){while(--_0x4aaa71){_0x39bf1d['push'](_0x39bf1d['shift']());}};_0x4716a7(++_0x2aa2a7);}(_0x98a7,0x9e));var _0x798a=function(_0x452088,_0x5a5923){_0x452088=_0x452088-0x0;var _0x11a239=_0x98a7[_0x452088];return _0x11a239;};'use strict';var _=require(_0x798a('0x0'));var uuid=require(_0x798a('0x1'));var util=require(_0x798a('0x2'));var logger=require(_0x798a('0x3'))(_0x798a('0x4'));var Beepall=function(_0x1d6ea8,_0xef4dd9,_0x5d1e77,_0x15c97c){this[_0x798a('0x5')]=uuid['v4']();this['squeue']=_0x1d6ea8;this['queue']=_0xef4dd9;this[_0x798a('0x6')]=_0x5d1e77;this[_0x798a('0x4')]=_0x15c97c;this[_0x798a('0x7')][_0x798a('0x8')](this[_0x798a('0x9')][_0x798a('0xa')](this),this[_0x798a('0xb')][_0x798a('0xa')](this));this['squeue']['on'](_0x798a('0xc'),this[_0x798a('0xb')][_0x798a('0xa')](this));this[_0x798a('0x7')]['on']('drained',this[_0x798a('0xd')][_0x798a('0xa')](this));};Beepall[_0x798a('0xe')][_0x798a('0x8')]=function(){this[_0x798a('0x7')][_0x798a('0x8')](this['handleRun'][_0x798a('0xa')](this),this[_0x798a('0xb')][_0x798a('0xa')](this));};Beepall[_0x798a('0xe')]['handleDrained']=function(_0x1cb92b){this[_0x798a('0xb')](!![]);};Beepall['prototype'][_0x798a('0x9')]=function(_0x594693){var _0xf12a1=!![];if(!_[_0x798a('0xf')](this[_0x798a('0x10')])&&!_[_0x798a('0xf')](this['queue'][_0x798a('0x11')])&&this[_0x798a('0x10')]['Agents'][_0x798a('0x12')]>0x0){for(var _0x2529c9=0x0,_0x27ed21;_0x2529c90x0){for(var _0x458f20=0x0,_0x4278f1;_0x458f200x0&&_0x5f21a2[_0x337ed5+_0xf326('0x25')]>=_0x5f21a2[_0x337ed5+_0xf326('0x23')]){writeLog(_0xb1efcf,_0x5f21a2,_0x337ed5['toUpperCase']()+_0xf326('0x26'));return![];}}return!![];};exports[_0xf326('0x27')]=function(_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf){return sendNotification(!![],_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf);};exports[_0xf326('0x28')]=function(_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500){return sendNotification(![],_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8ca9=['user:%s','name','user:save','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','save','remove','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','CurrentCapacity','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','defaults','localhost','redis','emit','format'];(function(_0xcbf85,_0x4b847d){var _0x4d5bd2=function(_0x235c35){while(--_0x235c35){_0xcbf85['push'](_0xcbf85['shift']());}};_0x4d5bd2(++_0x4b847d);}(_0x8ca9,0x9c));var _0x98ca=function(_0x3d4219,_0xde17a2){_0x3d4219=_0x3d4219-0x0;var _0xabcbd3=_0x8ca9[_0x3d4219];return _0xabcbd3;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var utils=require(_0x98ca('0x2'));var Mustache=require(_0x98ca('0x3'));var Redis=require(_0x98ca('0x4'));var config=require(_0x98ca('0x5'));var logger=require(_0x98ca('0x6'))('routing');config['redis']=_[_0x98ca('0x7')](config['redis'],{'host':_0x98ca('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98ca('0x9')]));function emit(_0xca4097,_0x18c349,_0x2852a0){io['to'](_0xca4097)[_0x98ca('0xa')](_0x18c349,_0x2852a0);}function sendNotification(_0x28a37a,_0x162bd0,_0x210234,_0x277c29,_0x404cc1,_0x572858){io['to'](util[_0x98ca('0xb')](_0x98ca('0xc'),_0x277c29[_0x98ca('0xd')]))[_0x98ca('0xa')](_0x98ca('0xe'),_0x277c29);var _0x276213=_0x572858||{};var _0x17ee87=_0x210234['split']('.');var _0x16221a={'uniqueid':_0x162bd0,'channel':_0x17ee87[0x0],'id':_0x17ee87[0x1],'title':_0x17ee87[0x0]+_0x98ca('0xf'),'interactionId':_0x17ee87[0x2],'queue':_0x404cc1?_0x404cc1[_0x98ca('0xd')]:null,'sound':_0x276213[_0x98ca('0x10')]['notificationSound'],'shake':_0x276213[_0x98ca('0x10')][_0x98ca('0x11')]};try{if(!_0x276213[_0x98ca('0x12')]){_0x276213[_0x98ca('0x12')]={};}if(_0x404cc1){_0x276213[_0x98ca('0x12')][_0x98ca('0x13')]=_0x404cc1;}else if(_0x276213[_0x98ca('0x12')]['queue']){delete _0x276213[_0x98ca('0x12')][_0x98ca('0x13')];}_0x16221a[_0x98ca('0x14')]=utils[_0x98ca('0x15')](_0x276213['account'][_0x98ca('0x16')],_0x276213);}catch(_0x3c2f65){_0x16221a[_0x98ca('0x14')]=_0x98ca('0x17');logger[_0x98ca('0x18')](util[_0x98ca('0xb')](_0x98ca('0x19'),_0x162bd0,_0x3c2f65[_0x98ca('0x1a')]));}io['to'](util[_0x98ca('0xb')](_0x98ca('0xc'),_0x277c29[_0x98ca('0xd')]))['emit'](util[_0x98ca('0xb')]('notification:%s',_0x28a37a?_0x98ca('0x1b'):_0x98ca('0x1c')),_0x16221a);}function writeLog(_0x50f8b4,_0x5ca905,_0x4620e3){return logger[_0x98ca('0x1d')](util[_0x98ca('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x50f8b4,_0x5ca905[_0x98ca('0xd')],_0x4620e3));}exports[_0x98ca('0x1e')]=function(_0x56f799,_0x6651c8,_0x5dc400,_0x3fd0bd){if(_0x6651c8[_0x98ca('0x1f')]){writeLog(_0x56f799,_0x6651c8,_0x98ca('0x20'));return![];}if(!_0x6651c8[_0x98ca('0x21')]){writeLog(_0x56f799,_0x6651c8,_0x98ca('0x22'));return![];}if(_0x6651c8[_0x5dc400+_0x98ca('0x23')]){writeLog(_0x56f799,_0x6651c8,_0x98ca('0x24'));return![];}if(_0x3fd0bd&&_0x6651c8['hasOwnProperty'](_0x5dc400+_0x98ca('0x25'))&&_0x6651c8['hasOwnProperty'](_0x5dc400+_0x98ca('0x26'))){if(_0x6651c8[_0x5dc400+_0x98ca('0x25')]>0x0&&_0x6651c8[_0x5dc400+'CurrentCapacity']>=_0x6651c8[_0x5dc400+_0x98ca('0x25')]){writeLog(_0x56f799,_0x6651c8,_0x5dc400['toUpperCase']()+_0x98ca('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x5bf77d,_0x14bfb4,_0x540f45,_0x342a83,_0x35b920){return sendNotification(!![],_0x5bf77d,_0x14bfb4,_0x540f45,_0x342a83,_0x35b920);};exports[_0x98ca('0x28')]=function(_0x21a12a,_0x3b3e60,_0x1e7fcf,_0x11389a,_0x1bf154){return sendNotification(![],_0x21a12a,_0x3b3e60,_0x1e7fcf,_0x11389a,_0x1bf154);};exports[_0x98ca('0x29')]=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 8b8af3b..cf8b83f 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 _0xc72f=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','join','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils'];(function(_0x2d8efc,_0x58e635){var _0x4a7f2d=function(_0x5404e7){while(--_0x5404e7){_0x2d8efc['push'](_0x2d8efc['shift']());}};_0x4a7f2d(++_0x58e635);}(_0xc72f,0x9e));var _0xfc72=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xc72f[_0x3fba9f];return _0x192cf1;};'use strict';var schema=require(_0xfc72('0x0'));var sh=require(_0xfc72('0x1'));var _=require(_0xfc72('0x2'));var utils=require(_0xfc72('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xfc72('0x4'),'required':!![],'message':_0xfc72('0x5')}});exports['consequence']=function(_0xa2f23e,_0x598d12){return function(_0x2b34af){try{var _0x466fb3={'command':_0x598d12[0x0]};var _0x2a19f0=system[_0xfc72('0x0')](_0x466fb3,{'typecast':!![]});if(_0x2a19f0[_0xfc72('0x6')]){logger[_0xfc72('0x7')]('[%s][SYSTEM]\x20%s',_0xa2f23e,_[_0xfc72('0x8')](_0x2a19f0,_0xfc72('0x9'))[_0xfc72('0xa')](',\x20'));logger[_0xfc72('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0xa2f23e);_0x2b34af[_0xfc72('0xc')]();}else{var _0xd31808=this;var _0x3f1bc5=utils[_0xfc72('0xd')](_0x598d12[0x0],this);logger[_0xfc72('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xa2f23e,_0x3f1bc5);sh[_0xfc72('0xe')](_[_0xfc72('0xf')](_0x3f1bc5),function(_0x48bbd2,_0x2f19b2){logger[_0xfc72('0xb')](_0xfc72('0x10'),_0xa2f23e,_0x48bbd2);if(_0x48bbd2==0x0){var _0x2b3dfd=_0x2f19b2[_0xfc72('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xfc72('0x12')](_0x598d12[0x1])||_[_0xfc72('0x13')](_0x598d12[0x1])){logger[_0xfc72('0xb')](_0xfc72('0x14'),_0xa2f23e);_0xd31808[_0xfc72('0x15')][_0x598d12[0x1]]=_0x2b3dfd;}else{logger[_0xfc72('0xb')](_0xfc72('0x16'),_0xa2f23e,_0x598d12[0x1],_0x2b3dfd);_0xd31808[_0xfc72('0x15')][_0x598d12[0x1]]=_0x2b3dfd;}}_0x2b34af[_0xfc72('0xc')]();});}}catch(_0x4c2594){logger[_0xfc72('0x7')](_0xfc72('0x17'),_0xa2f23e,_[_0xfc72('0x18')](_0x4c2594)?JSON[_0xfc72('0x19')](_0x4c2594):_0x4c2594);logger[_0xfc72('0xb')](_0xfc72('0x1a'),_0xa2f23e);_0x2b34af[_0xfc72('0xc')]();}};}; \ No newline at end of file +var _0x5160=['getMustacheRender','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x11051a,_0x3900e9){var _0x3b890c=function(_0x14322b){while(--_0x14322b){_0x11051a['push'](_0x11051a['shift']());}};_0x3b890c(++_0x3900e9);}(_0x5160,0x1cc));var _0x0516=function(_0xa37d16,_0x4a6e3c){_0xa37d16=_0xa37d16-0x0;var _0x579bdd=_0x5160[_0xa37d16];return _0x579bdd;};'use strict';var schema=require(_0x0516('0x0'));var sh=require(_0x0516('0x1'));var _=require(_0x0516('0x2'));var utils=require('./utils');var logger=require(_0x0516('0x3'))(_0x0516('0x4'));var system=schema({'command':{'type':_0x0516('0x5'),'required':!![],'message':_0x0516('0x6')}});exports[_0x0516('0x7')]=function(_0x219d34,_0x1fadc0){return function(_0x4ad327){try{var _0x10a70e={'command':_0x1fadc0[0x0]};var _0x81a539=system[_0x0516('0x0')](_0x10a70e,{'typecast':!![]});if(_0x81a539[_0x0516('0x8')]){logger[_0x0516('0x9')]('[%s][SYSTEM]\x20%s',_0x219d34,_[_0x0516('0xa')](_0x81a539,_0x0516('0xb'))[_0x0516('0xc')](',\x20'));logger[_0x0516('0xd')](_0x0516('0xe'),_0x219d34);_0x4ad327[_0x0516('0xf')]();}else{var _0x2be7f5=this;var _0x51b5c0=utils[_0x0516('0x10')](_0x1fadc0[0x0],this);logger[_0x0516('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x219d34,_0x51b5c0);sh[_0x0516('0x11')](_[_0x0516('0x12')](_0x51b5c0),function(_0x4d3c14,_0x2a2bba){logger[_0x0516('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x219d34,_0x4d3c14);if(_0x4d3c14==0x0){var _0x3a04d2=_0x2a2bba[_0x0516('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x0516('0x14')](_0x1fadc0[0x1])||_[_0x0516('0x15')](_0x1fadc0[0x1])){logger[_0x0516('0xd')](_0x0516('0x16'),_0x219d34);_0x2be7f5[_0x0516('0x17')][_0x1fadc0[0x1]]=_0x3a04d2;}else{logger[_0x0516('0xd')](_0x0516('0x18'),_0x219d34,_0x1fadc0[0x1],_0x3a04d2);_0x2be7f5[_0x0516('0x17')][_0x1fadc0[0x1]]=_0x3a04d2;}}_0x4ad327['next']();});}}catch(_0x51f0d1){logger[_0x0516('0x9')](_0x0516('0x19'),_0x219d34,_[_0x0516('0x1a')](_0x51f0d1)?JSON[_0x0516('0x1b')](_0x51f0d1):_0x51f0d1);logger[_0x0516('0xd')](_0x0516('0xe'),_0x219d34);_0x4ad327['next']();}};}; \ 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 d81973a..4b01efe 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 _0xa6f4=['map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','then','interaction','catch','error','[%s][TAG]\x20%s','stringify','info','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','consequence','length'];(function(_0x56a79a,_0x249558){var _0x95dd0c=function(_0x27cd9a){while(--_0x27cd9a){_0x56a79a['push'](_0x56a79a['shift']());}};_0x95dd0c(++_0x249558);}(_0xa6f4,0x1e4));var _0x4a6f=function(_0x31ed91,_0x421b6e){_0x31ed91=_0x31ed91-0x0;var _0x456bb6=_0xa6f4[_0x31ed91];return _0x456bb6;};'use strict';var schema=require(_0x4a6f('0x0'));var _=require(_0x4a6f('0x1'));var rpc={'chatInteraction':require(_0x4a6f('0x2')),'openchannelInteraction':require(_0x4a6f('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x4a6f('0x4')),'faxInteraction':require(_0x4a6f('0x5')),'whatsappInteraction':require(_0x4a6f('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x4a6f('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x4a6f('0x8')]=function(_0x527a68,_0x597a6f,_0x351f85,_0x55a549){return function(_0x4ae574){try{var _0x1d0bc8={'tag':_0x597a6f[0x0]};var _0x5ceb5e=tag[_0x4a6f('0x0')](_0x1d0bc8,{'typecast':!![]});if(_0x5ceb5e[_0x4a6f('0x9')]){logger['error']('[%s][TAG]\x20%s',_0x527a68,_[_0x4a6f('0xa')](_0x5ceb5e,_0x4a6f('0xb'))[_0x4a6f('0xc')](',\x20'));logger['info'](_0x4a6f('0xd'),_0x527a68);_0x4ae574[_0x4a6f('0xe')]();}else{var _0x2b6fdf={'ids':[_0x597a6f[0x0]]};if(rpc[_0x55a549['channel']+_0x4a6f('0xf')]){rpc[_0x55a549[_0x4a6f('0x10')]+_0x4a6f('0xf')][_0x4a6f('0x11')](_0x55a549['interaction']['id'],_0x2b6fdf)[_0x4a6f('0x12')](function(_0x519402){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x527a68,_0x597a6f[0x1],_0x55a549[_0x4a6f('0x10')],_0x55a549[_0x4a6f('0x13')]['id']);})[_0x4a6f('0x14')](function(_0xbd91a5){logger[_0x4a6f('0x15')](_0x4a6f('0x16'),_0x527a68,JSON[_0x4a6f('0x17')](_0xbd91a5));logger[_0x4a6f('0x18')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x527a68);})['finally'](function(){_0x4ae574[_0x4a6f('0xe')]();});}}}catch(_0x22583a){logger[_0x4a6f('0x15')]('[%s][TAG]\x20%s',_0x527a68,_[_0x4a6f('0x19')](_0x22583a)?JSON[_0x4a6f('0x17')](_0x22583a):_0x22583a);logger['info'](_0x4a6f('0xd'),_0x527a68);_0x4ae574['next']();}};}; \ No newline at end of file +var _0xdc24=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc24,0x172));var _0x4dc2=function(_0xcf5536,_0x4518f0){_0xcf5536=_0xcf5536-0x0;var _0x3dc63e=_0xdc24[_0xcf5536];return _0x3dc63e;};'use strict';var schema=require(_0x4dc2('0x0'));var _=require(_0x4dc2('0x1'));var rpc={'chatInteraction':require(_0x4dc2('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4dc2('0x3')),'mailInteraction':require(_0x4dc2('0x4')),'faxInteraction':require(_0x4dc2('0x5')),'whatsappInteraction':require(_0x4dc2('0x6'))};var logger=require(_0x4dc2('0x7'))(_0x4dc2('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x4dc2('0x9')}});exports[_0x4dc2('0xa')]=function(_0x3c0912,_0x756ab8,_0x114636,_0x261a0a){return function(_0x268d45){try{var _0x1ad90c={'tag':_0x756ab8[0x0]};var _0x1c2ace=tag['validate'](_0x1ad90c,{'typecast':!![]});if(_0x1c2ace['length']){logger[_0x4dc2('0xb')](_0x4dc2('0xc'),_0x3c0912,_['map'](_0x1c2ace,'message')[_0x4dc2('0xd')](',\x20'));logger['info'](_0x4dc2('0xe'),_0x3c0912);_0x268d45[_0x4dc2('0xf')]();}else{var _0x2d1afc={'ids':[_0x756ab8[0x0]]};if(rpc[_0x261a0a[_0x4dc2('0x10')]+'Interaction']){rpc[_0x261a0a[_0x4dc2('0x10')]+_0x4dc2('0x11')][_0x4dc2('0x12')](_0x261a0a[_0x4dc2('0x13')]['id'],_0x2d1afc)[_0x4dc2('0x14')](function(_0x4f6ea4){logger[_0x4dc2('0x15')](_0x4dc2('0x16'),_0x3c0912,_0x756ab8[0x1],_0x261a0a[_0x4dc2('0x10')],_0x261a0a[_0x4dc2('0x13')]['id']);})['catch'](function(_0x3c89cf){logger[_0x4dc2('0xb')](_0x4dc2('0xc'),_0x3c0912,JSON[_0x4dc2('0x17')](_0x3c89cf));logger[_0x4dc2('0x15')](_0x4dc2('0xe'),_0x3c0912);})['finally'](function(){_0x268d45[_0x4dc2('0xf')]();});}}}catch(_0x54b8f7){logger[_0x4dc2('0xb')](_0x4dc2('0xc'),_0x3c0912,_['isObject'](_0x54b8f7)?JSON[_0x4dc2('0x17')](_0x54b8f7):_0x54b8f7);logger[_0x4dc2('0x15')](_0x4dc2('0xe'),_0x3c0912);_0x268d45[_0x4dc2('0xf')]();}};}; \ 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 cd244e3..e874ae0 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 _0x680b=['application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','login','params','stringify','utf8','POST'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x680b,0xfe));var _0xb680=function(_0x2e030d,_0x4ac4bc){_0x2e030d=_0x2e030d-0x0;var _0x3785d5=_0x680b[_0x2e030d];return _0x3785d5;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0xb680('0x0'));var _=require(_0xb680('0x1'));var arr=[];exports[_0xb680('0x2')]=function(_0x569ab1,_0x114bcd){return function(_0x2b6ee7){var _0x3b3416=_0x114bcd[0xa];var _0x5deb88=_0x114bcd[0xb];var _0x23fb5f=_0x114bcd[0xc];var _0x1d5f17=_0x114bcd[0xd];var _0x386f0b=_0x114bcd[0xe];var _0x5bc969=_0x114bcd[0xf][_0xb680('0x3')](/\n/g,_0xb680('0x4'));var _0x2c50d4=_0x114bcd[0x10][_0xb680('0x3')](/\n/g,'\x20');if(!arr[_0xb680('0x5')](_0x5deb88)){arr[_0xb680('0x6')](_0x5deb88);var _0x9d9859=_0x114bcd[0x3];var _0x512f8c=_0x114bcd[0x4];var _0x23b721=_0x114bcd[0x1];var _0x4d5fea=_0x114bcd[0x0];var _0x35141d={};_0x35141d[_0xb680('0x7')]=_0x114bcd[0x8]+'?params='+_0x23fb5f+'|'+_0x3b3416+'|'+_0x1d5f17+'|'+_0x5deb88+'|'+_0x386f0b;_0x35141d[_0xb680('0x8')]=_0x114bcd[0x7]+_0xb680('0x9')+_0x23fb5f+'|'+_0x3b3416+'|'+_0x1d5f17+'|'+_0x5deb88+'|'+_0x386f0b+'|'+_0x5bc969+'|'+_0x2c50d4;_0x35141d[_0xb680('0xa')]=_0x114bcd[0x9];var _0x554a10={};_0x554a10[_0xb680('0xb')]=_0xb680('0xc');_0x554a10['method']=_0xb680('0xd');var _0xe019c8=[];_0xe019c8[_0xb680('0x6')](_0x114bcd[0x2]);_0xe019c8[_0xb680('0x6')](_0x114bcd[0x5]);_0xe019c8['push'](_0x114bcd[0x6]);_0x554a10[_0xb680('0xe')]=_0xe019c8;_0x554a10['id']=0x1;var _0x1983a9=JSON[_0xb680('0xf')](_0x554a10);var _0x58c88d={'encoding':_0xb680('0x10'),'method':_0xb680('0x11'),'timeout':0x2710,'url':_0x9d9859,'headers':{'Content-Type':_0xb680('0x12')},'body':_0x1983a9};return rp(_0x58c88d)[_0xb680('0x13')](function(_0x5d584b){const _0x5e2f38=JSON[_0xb680('0x14')](_0x5d584b);if(!_0x5e2f38[_0xb680('0x15')][_0xb680('0x16')]){throw new Error(_0xb680('0x17'));}var _0x316df4=_0x5deb88;var _0x8e12c8='channelId='+_0x23b721+_0xb680('0x18')+_0x4d5fea+_0xb680('0x19')+_0x316df4+_0xb680('0x1a')+JSON[_0xb680('0xf')](_0x35141d);var _0x164dd6=_0x512f8c+'?'+_0x8e12c8;return rp(_0x164dd6);})[_0xb680('0x13')](function(_0x2ecece){logger[_0xb680('0x1b')](_0xb680('0x1c'),_0x569ab1,_0x2ecece);_0x2b6ee7[_0xb680('0x1d')]();})['catch'](function(_0x548a64){logger[_0xb680('0x1e')]('[%s][TVOX]\x20%s',_0x569ab1,_[_0xb680('0x1f')](_0x548a64)?JSON[_0xb680('0xf')](_0x548a64):_0x548a64);_0x2b6ee7['stop']();});}else{logger[_0xb680('0x1b')](_0xb680('0x20'),_0x569ab1);_0x2b6ee7[_0xb680('0x21')]();}};}; \ No newline at end of file +var _0xe738=['logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','stringify','info','catch','[%s][TVOX]\x20%s','stop','next','request-promise','../../../../config/logger','lodash','consequence','\x20-\x20','includes','urlOnAnswer','?params=','title','jsonrpc','2.0','method','push','params','utf8','application/json-rpc','then','parse'];(function(_0x477d3f,_0x450141){var _0x4a4a72=function(_0x13663e){while(--_0x13663e){_0x477d3f['push'](_0x477d3f['shift']());}};_0x4a4a72(++_0x450141);}(_0xe738,0x192));var _0x8e73=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xe738[_0x1694f5];return _0x5b4321;};'use strict';var rp=require(_0x8e73('0x0'));var logger=require(_0x8e73('0x1'))('routing');var _=require(_0x8e73('0x2'));var arr=[];exports[_0x8e73('0x3')]=function(_0x3bda56,_0x21c877){return function(_0x1992dc){var _0xde4bbe=_0x21c877[0xa];var _0x2f6932=_0x21c877[0xb];var _0x4be39a=_0x21c877[0xc];var _0x39204b=_0x21c877[0xd];var _0x3ab11b=_0x21c877[0xe];var _0x1b2b7d=_0x21c877[0xf]['replace'](/\n/g,_0x8e73('0x4'));var _0xce6b23=_0x21c877[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x8e73('0x5')](_0x2f6932)){arr['push'](_0x2f6932);var _0xa99f47=_0x21c877[0x3];var _0x224c54=_0x21c877[0x4];var _0x293bc5=_0x21c877[0x1];var _0x2c5502=_0x21c877[0x0];var _0x229e29={};_0x229e29[_0x8e73('0x6')]=_0x21c877[0x8]+_0x8e73('0x7')+_0x4be39a+'|'+_0xde4bbe+'|'+_0x39204b+'|'+_0x2f6932+'|'+_0x3ab11b;_0x229e29['urlOnRing']=_0x21c877[0x7]+_0x8e73('0x7')+_0x4be39a+'|'+_0xde4bbe+'|'+_0x39204b+'|'+_0x2f6932+'|'+_0x3ab11b+'|'+_0x1b2b7d+'|'+_0xce6b23;_0x229e29[_0x8e73('0x8')]=_0x21c877[0x9];var _0x39972e={};_0x39972e[_0x8e73('0x9')]=_0x8e73('0xa');_0x39972e[_0x8e73('0xb')]='login';var _0x5a4b6f=[];_0x5a4b6f[_0x8e73('0xc')](_0x21c877[0x2]);_0x5a4b6f[_0x8e73('0xc')](_0x21c877[0x5]);_0x5a4b6f[_0x8e73('0xc')](_0x21c877[0x6]);_0x39972e[_0x8e73('0xd')]=_0x5a4b6f;_0x39972e['id']=0x1;var _0x1314c2=JSON['stringify'](_0x39972e);var _0x2a51dd={'encoding':_0x8e73('0xe'),'method':'POST','timeout':0x2710,'url':_0xa99f47,'headers':{'Content-Type':_0x8e73('0xf')},'body':_0x1314c2};return rp(_0x2a51dd)[_0x8e73('0x10')](function(_0x25e4fa){const _0x3cd248=JSON[_0x8e73('0x11')](_0x25e4fa);if(!_0x3cd248['result'][_0x8e73('0x12')]){throw new Error(_0x8e73('0x13'));}var _0x50b381=_0x2f6932;var _0x44a34b=_0x8e73('0x14')+_0x293bc5+'&serviceId='+_0x2c5502+_0x8e73('0x15')+_0x50b381+'&data='+JSON[_0x8e73('0x16')](_0x229e29);var _0xa8fdb4=_0x224c54+'?'+_0x44a34b;return rp(_0xa8fdb4);})[_0x8e73('0x10')](function(_0x5289b2){logger[_0x8e73('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x3bda56,_0x5289b2);_0x1992dc['stop']();})[_0x8e73('0x18')](function(_0x48ee9d){logger['error'](_0x8e73('0x19'),_0x3bda56,_['isObject'](_0x48ee9d)?JSON[_0x8e73('0x16')](_0x48ee9d):_0x48ee9d);_0x1992dc[_0x8e73('0x1a')]();});}else{logger[_0x8e73('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3bda56);_0x1992dc[_0x8e73('0x1b')]();}};}; \ 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 f8f5634..eacbcc8 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(_0x473813,_0x29de98){var _0x55f05b=function(_0x32167a){while(--_0x32167a){_0x473813['push'](_0x473813['shift']());}};_0x55f05b(++_0x29de98);}(_0xe706,0xa3));var _0x6e70=function(_0x3f92bc,_0x482ad4){_0x3f92bc=_0x3f92bc-0x0;var _0xa15d20=_0xe706[_0x3f92bc];return _0xa15d20;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x14b869,_0x2a6500){var _0x539f7c=function(_0x49d6bf){while(--_0x49d6bf){_0x14b869['push'](_0x14b869['shift']());}};_0x539f7c(++_0x2a6500);}(_0xe706,0xa3));var _0x6e70=function(_0x14ab01,_0x34fd2a){_0x14ab01=_0x14ab01-0x0;var _0x5ee177=_0xe706[_0x14ab01];return _0x5ee177;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index bb7b2ff..7cbc894 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 _0x81d5=['UserId','catch','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','emit','agent','agents','busy','busyQueue','channel','end','QueueReport','update'];(function(_0x5b7d7a,_0x50d85e){var _0x5c5c2c=function(_0x4b6c6c){while(--_0x4b6c6c){_0x5b7d7a['push'](_0x5b7d7a['shift']());}};_0x5c5c2c(++_0x50d85e);}(_0x81d5,0x1ab));var _0x581d=function(_0x5dc547,_0x10bb82){_0x5dc547=_0x5dc547-0x0;var _0x29d720=_0x81d5[_0x5dc547];return _0x29d720;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x581d('0x2'));var BPromise=require(_0x581d('0x3'));var uuid=require(_0x581d('0x4'));var utils=require(_0x581d('0x5'));var config=require(_0x581d('0x6'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x581d('0x7')),'mailQueueReport':require(_0x581d('0x8')),'chatQueueReport':require(_0x581d('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x581d('0xa')),'whatsappQueueReport':require(_0x581d('0xb'))};var RuleEngine=require(_0x581d('0xc'));function getId(_0x497368,_0xf1a3b6,_0x5efb9b){return util['format']('%s.%s.%s',_0x497368,_0xf1a3b6||0x0,_0x5efb9b||0x0);}function getIntervals(_0xdeeb73,_0x3435a9){var _0x2b73b1=[];if(!_[_0x581d('0xd')](_0x3435a9[_0x581d('0xe')])&&!_['isNil'](_0xdeeb73[_0x3435a9[_0x581d('0xe')]])&&!_[_0x581d('0xd')](_0xdeeb73[_0x3435a9[_0x581d('0xe')]][_0x581d('0xf')])){_0x2b73b1=_[_0x581d('0x10')](_0xdeeb73[_0x3435a9[_0x581d('0xe')]][_0x581d('0xf')],_0x581d('0x11'));}else if(!_[_0x581d('0xd')](_0x3435a9[_0x581d('0x11')])){_0x2b73b1=[_0x3435a9['interval']];}return _0x2b73b1;}exports[_0x581d('0x12')]=function(_0xfab29f){_0xfab29f['rules']={};return new BPromise(function(_0x5f3ba8,_0x4f5591){var _0x4deffa={'Start':function(_0x110e13){var _0x550365=this;return new Promise(function(_0x1d609f,_0x29d7a6){if(_0x110e13){try{var _0x5b3f2d=[];var _0x1890d0=getId(_0x110e13['channel'],_0x110e13[_0x581d('0x13')]?_0x110e13[_0x581d('0x13')]['id']:0x0,_0x110e13[_0x581d('0x14')]?_0x110e13[_0x581d('0x14')]['id']:0x0);if(_0x110e13[_0x581d('0x15')]&&_[_0x581d('0x16')](_0x110e13[_0x581d('0x15')])&&_0x110e13['applications'][_0x581d('0x17')]){for(var _0x2b740d=0x0;_0x2b740d<_0x110e13[_0x581d('0x15')][_0x581d('0x17')];_0x2b740d+=0x1){var _0x352700=_0x110e13[_0x581d('0x15')][_0x2b740d];if(fs[_0x581d('0x18')](path[_0x581d('0x19')](__dirname,_0x581d('0x15'),_0x352700[_0x581d('0x1a')]+_0x581d('0x1b')))){var _0xf74d2b=[];switch(_0x352700['app'][_0x581d('0x1c')]()){case _0x581d('0x1d'):var _0x32ed5a=_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');if(_0x110e13['channel']===_0x581d('0x20')){_0xf74d2b[_0x581d('0x21')](_0x32ed5a[0x0]);_0xf74d2b['push'](_0x32ed5a[0x1]);_0xf74d2b[_0x581d('0x21')](_0x32ed5a[_0x581d('0x22')](0x2,_0x32ed5a[_0x581d('0x17')])['join'](','));}else{_0xf74d2b[_0x581d('0x21')](_0x32ed5a[0x0]);_0xf74d2b[_0x581d('0x21')](_0x32ed5a[_0x581d('0x22')](0x1,_0x32ed5a[_0x581d('0x17')])[_0x581d('0x19')](','));}break;case _0x581d('0x23'):var _0x4b9b62=_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');_0xf74d2b[_0x581d('0x21')](_0x4b9b62[0x0]);_0xf74d2b['push'](_0x4b9b62[0x1]);_0xf74d2b['push'](_0x4b9b62['slice'](0x2,_0x4b9b62['length'])[_0x581d('0x19')](','));break;case _0x581d('0x24'):var _0x337361=_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');_0xf74d2b[_0x581d('0x21')](_0x337361[0x0]);_0xf74d2b[_0x581d('0x21')](_0x337361[0x1]);_0xf74d2b[_0x581d('0x21')](_0x337361[0x2]);_0xf74d2b[_0x581d('0x21')](_0x337361[0x3]);_0xf74d2b[_0x581d('0x21')](_0x337361[_0x581d('0x22')](0x4,_0x337361['length'])[_0x581d('0x19')](','));break;case'amazonlex':var _0x15ceb9=_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');_0xf74d2b[_0x581d('0x21')](_0x15ceb9[0x0]);_0xf74d2b[_0x581d('0x21')](_0x15ceb9[0x1]);_0xf74d2b[_0x581d('0x21')](_0x15ceb9[0x2]);_0xf74d2b['push'](_0x15ceb9[0x3]);_0xf74d2b[_0x581d('0x21')](_0x15ceb9[_0x581d('0x22')](0x4,_0x15ceb9['length'])['join'](','));break;case'message':_0xf74d2b[_0x581d('0x21')](_0x352700[_0x581d('0x1e')]);break;case _0x581d('0x25'):_0xf74d2b[_0x581d('0x21')](_0x352700[_0x581d('0x26')]);_0xf74d2b[_0x581d('0x21')](_0x352700[_0x581d('0x1e')]);break;case'tvox':var _0x43a48f=utils[_0x581d('0x27')](_0x110e13['account'][_0x581d('0x28')],_0x110e13);var _0x35a63f=_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');_0xf74d2b[_0x581d('0x21')](_0x35a63f[0x0]);_0xf74d2b['push'](_0x35a63f[0x1]);_0xf74d2b[_0x581d('0x21')](_0x35a63f[0x2]);_0xf74d2b['push'](_0x35a63f[0x3]);_0xf74d2b[_0x581d('0x21')](_0x35a63f[0x4]);_0xf74d2b[_0x581d('0x21')](_0x35a63f[0x5]);_0xf74d2b['push'](_0x35a63f[0x6]);_0xf74d2b['push'](_0x35a63f[0x7]);_0xf74d2b['push'](_0x35a63f[0x8]);_0xf74d2b['push'](_0x35a63f[0x9]);_0xf74d2b[_0x581d('0x21')](_0x35a63f[0xa]);_0xf74d2b['push'](_0x110e13[_0x581d('0x14')]['id']);_0xf74d2b['push'](_0x110e13[_0x581d('0x13')]['id']);_0xf74d2b[_0x581d('0x21')](_0x352700[_0x581d('0x29')]);_0xf74d2b[_0x581d('0x21')](_0x110e13[_0x581d('0x14')][_0x581d('0x2a')]);_0xf74d2b[_0x581d('0x21')](_0x110e13[_0x581d('0x2b')][_0x581d('0x2b')]);_0xf74d2b[_0x581d('0x21')](_0x43a48f);break;default:_0xf74d2b=_['isNil'](_0x352700['appdata'])?[]:_0x352700[_0x581d('0x1e')][_0x581d('0x1f')](',');}var _0x109d34={'id':util['format'](_0x581d('0x2c'),_0x1890d0,_0x352700['id'],_0x352700[_0x581d('0x1a')]),'condition':require(_0x581d('0x2d'))['condition'](_0x1890d0,getIntervals(_0xfab29f[_0x581d('0x2e')],_0x352700),_0xfab29f),'consequence':require(_0x581d('0x2f')+_0x352700['app'])[_0x581d('0x30')](_0x1890d0,_0xf74d2b,_0xfab29f,_0x110e13),'p':_0x352700[_0x581d('0x31')]||0x0};logger[_0x581d('0x32')](_0x581d('0x33'),_0x109d34['id'],_0x581d('0x34'),getIntervals(_0xfab29f[_0x581d('0x2e')],_0x352700)[_0x581d('0x19')]('\x20|\x20'));_0x5b3f2d[_0x581d('0x21')](_0x109d34);}else{logger[_0x581d('0x35')](_0x581d('0x36'),path['join'](__dirname,_0x581d('0x15'),_0x352700[_0x581d('0x1a')]+'.js'));}}_0xfab29f['rules'][_0x1890d0]=new RuleEngine(_0x5b3f2d);_0xfab29f[_0x581d('0x37')][_0x1890d0][_0x581d('0x38')](_0x110e13,function(_0x1adea5){logger['info'](_0x581d('0x39'),JSON[_0x581d('0x3a')](_0x1adea5['matchPath']));if(_0xfab29f[_0x581d('0x37')][_0x1890d0]){_0xfab29f['rules'][_0x1890d0][_0x581d('0x3b')]('complete');}});return _0x1d609f({'code':0xc8,'message':_0x110e13});}else{logger[_0x581d('0x32')]('No\x20applications\x20to\x20execute');return _0x1d609f({'code':0xc8,'message':_0x110e13});}}catch(_0x483d8f){logger[_0x581d('0x35')](_0x483d8f['stack']);return _0x29d7a6(_0x550365['error'](0x1f4,_0x483d8f));}}return _0x29d7a6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x43223a){var _0x37700d=this;return new Promise(function(_0x1cbb11,_0x510f57){if(_0x43223a[_0x581d('0x3c')]&&_0x43223a[_0x581d('0x3c')]['id']){if(_0xfab29f['agents'][_0x43223a['agent']['id']]){_0xfab29f[_0x581d('0x3d')][_0x43223a['agent']['id']][_0x581d('0x3e')]=![];_0xfab29f['agents'][_0x43223a[_0x581d('0x3c')]['id']][_0x581d('0x3f')]=undefined;}}if(_0x43223a['message']&&_0x43223a[_0x581d('0x13')]['id']){try{var _0x44a3ea=getId(_0x43223a[_0x581d('0x40')],_0x43223a[_0x581d('0x13')]?_0x43223a[_0x581d('0x13')]['id']:0x0,_0x43223a['interaction']?_0x43223a[_0x581d('0x14')]['id']:0x0);if(_0xfab29f[_0x581d('0x37')][_0x44a3ea]){_0xfab29f[_0x581d('0x37')][_0x44a3ea][_0x581d('0x3b')](_0x581d('0x41'));if(rpc[_0x43223a[_0x581d('0x40')]+_0x581d('0x42')]){rpc[_0x43223a['channel']+_0x581d('0x42')][_0x581d('0x43')](_0x44a3ea,{'UserId':_0x43223a[_0x581d('0x13')][_0x581d('0x44')]})[_0x581d('0x45')](function(_0x1af2d1){logger[_0x581d('0x35')]('error\x20update\x20queue\x20report');});}}return _0x1cbb11({'code':0xc8,'message':_0x43223a});}catch(_0x14ae69){logger[_0x581d('0x35')](_0x14ae69['stack']);return _0x510f57(_0x37700d[_0x581d('0x35')](0x1f4,_0x14ae69));}}logger['error'](_0x581d('0x46'));return _0x510f57(_0x37700d[_0x581d('0x35')](0x1f4,_0x581d('0x46')));});},'RejectMessage':function(_0x35636c){var _0x51e56f=this;return new Promise(function(_0x507e1a,_0x29bb5c){if(_0x35636c[_0x581d('0x3c')]&&_0x35636c['agent']['id']){try{if(_0xfab29f['agents'][_0x35636c[_0x581d('0x3c')]['id']]){_0xfab29f[_0x581d('0x3d')][_0x35636c[_0x581d('0x3c')]['id']][_0x581d('0x3e')]=![];_0xfab29f['agents'][_0x35636c[_0x581d('0x3c')]['id']][_0x581d('0x3f')]=undefined;}return _0x507e1a({'code':0xc8,'message':_0x35636c});}catch(_0xcca54f){logger[_0x581d('0x35')](_0xcca54f[_0x581d('0x47')]);return _0x29bb5c(_0x51e56f[_0x581d('0x35')](0x1f4,_0xcca54f));}}logger[_0x581d('0x35')](_0x581d('0x46'));return _0x29bb5c(_0x51e56f[_0x581d('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3749a0){var _0x3252dc=this;return new Promise(function(_0x2115b5,_0x510a39){if(_0x3749a0[_0x581d('0x40')]&&_0x3749a0['interaction']&&_0x3749a0[_0x581d('0x14')]['id']){try{var _0x3bd923=getId(_0x3749a0[_0x581d('0x40')],_0x3749a0[_0x581d('0x13')]?_0x3749a0['message']['id']:0x0,_0x3749a0['interaction']?_0x3749a0[_0x581d('0x14')]['id']:0x0);if(_0xfab29f[_0x581d('0x37')][_0x3bd923]){_0xfab29f[_0x581d('0x37')][_0x3bd923][_0x581d('0x3b')](_0x581d('0x41'));}return _0x2115b5({'code':0xc8,'message':_0x3749a0});}catch(_0x5dfb06){logger['error'](_0x5dfb06[_0x581d('0x47')]);return _0x510a39(_0x3252dc[_0x581d('0x35')](0x1f4,_0x5dfb06));}}logger[_0x581d('0x35')]('message\x20is\x20empty');return _0x510a39(_0x3252dc[_0x581d('0x35')](0x1f4,_0x581d('0x46')));});},'AgentCapacity':function(_0x372282){var _0x46b833=this;return new Promise(function(_0x274dc9,_0x1ee7bc){if(_0xfab29f[_0x581d('0x3d')][_0x581d('0x48')](_0x372282['id'])){for(var _0x52bcd0 in _0x372282[_0x581d('0x49')]){if(_0x372282[_0x581d('0x49')]['hasOwnProperty'](_0x52bcd0)){if(_0xfab29f[_0x581d('0x3d')][_0x372282['id']][_0x581d('0x48')](_0x52bcd0+_0x581d('0x4a'))){_0xfab29f[_0x581d('0x3d')][_0x372282['id']][_0x52bcd0+_0x581d('0x4a')]=parseInt(_0x372282[_0x581d('0x49')][_0x52bcd0],0xa);}}}_0xfab29f[_0x581d('0x3d')][_0x372282['id']][_0x581d('0x4b')]();return _0x274dc9({'code':0xc8,'message':_0xfab29f[_0x581d('0x3d')][_0x372282['id']]});}else{return _0x1ee7bc(_0x46b833[_0x581d('0x35')](0x1f4,_0x581d('0x4c')));}});},'Agents':function(_0xb34e67){return new Promise(function(_0x4bdc1b,_0x15725e){var _0x495192=_[_0x581d('0x4d')](_0xfab29f['agents']);_0x4bdc1b({'count':_0x495192[_0x581d('0x17')],'rows':_0x495192});});},'ChatQueues':function(_0x20d1b0){return new Promise(function(_0xe3cdb0,_0x19fd4c){var _0x1dcb58=[];for(var _0x52d3fe in _0xfab29f[_0x581d('0x4e')]){if(_0xfab29f['chatQueues'][_0x581d('0x48')](_0x52d3fe)){var _0x52c8e8=_0xfab29f[_0x581d('0x4e')][_0x52d3fe];var _0x27e990={'id':_0x52c8e8['id'],'available':_0x52c8e8[_0x581d('0x4f')],'loggedIn':_0x52c8e8[_0x581d('0x50')],'name':_0x52c8e8[_0x581d('0x51')],'paused':_0x52c8e8[_0x581d('0x52')],'waiting':_0x52c8e8['waiting']};_0x1dcb58['push'](_0x27e990);}}_0xe3cdb0({'count':_0x1dcb58[_0x581d('0x17')],'rows':_0x1dcb58});});},'MailQueues':function(_0x415f72){return new Promise(function(_0x5446c3,_0x53bf21){var _0x345d58=[];for(var _0x64d394 in _0xfab29f['mailQueues']){if(_0xfab29f[_0x581d('0x53')][_0x581d('0x48')](_0x64d394)){var _0xa21214=_0xfab29f['mailQueues'][_0x64d394];var _0x2f5310={'id':_0xa21214['id'],'available':_0xa21214['available'],'loggedIn':_0xa21214['loggedIn'],'name':_0xa21214[_0x581d('0x51')],'paused':_0xa21214[_0x581d('0x52')],'waiting':_0xa21214[_0x581d('0x54')]};_0x345d58[_0x581d('0x21')](_0x2f5310);}}_0x5446c3({'count':_0x345d58[_0x581d('0x17')],'rows':_0x345d58});});},'OpenchannelQueues':function(_0x4c8c96){return new Promise(function(_0x3ddf86,_0x106684){var _0x3a42f1=[];for(var _0x33344d in _0xfab29f[_0x581d('0x55')]){if(_0xfab29f[_0x581d('0x55')][_0x581d('0x48')](_0x33344d)){var _0x78f3e9=_0xfab29f['openchannelQueues'][_0x33344d];var _0x10ccfa={'id':_0x78f3e9['id'],'available':_0x78f3e9[_0x581d('0x4f')],'loggedIn':_0x78f3e9[_0x581d('0x50')],'name':_0x78f3e9[_0x581d('0x51')],'paused':_0x78f3e9[_0x581d('0x52')],'waiting':_0x78f3e9[_0x581d('0x54')]};_0x3a42f1[_0x581d('0x21')](_0x10ccfa);}}_0x3ddf86({'count':_0x3a42f1[_0x581d('0x17')],'rows':_0x3a42f1});});},'SmsQueues':function(_0x387050){return new Promise(function(_0x4c060d,_0x3d12f9){var _0x40b5e5=[];for(var _0x2ccf6f in _0xfab29f['smsQueues']){if(_0xfab29f[_0x581d('0x56')][_0x581d('0x48')](_0x2ccf6f)){var _0x4d0835=_0xfab29f[_0x581d('0x56')][_0x2ccf6f];var _0x1df7c5={'id':_0x4d0835['id'],'available':_0x4d0835[_0x581d('0x4f')],'loggedIn':_0x4d0835[_0x581d('0x50')],'name':_0x4d0835[_0x581d('0x51')],'paused':_0x4d0835[_0x581d('0x52')],'waiting':_0x4d0835[_0x581d('0x54')]};_0x40b5e5['push'](_0x1df7c5);}}_0x4c060d({'count':_0x40b5e5[_0x581d('0x17')],'rows':_0x40b5e5});});},'FaxQueues':function(_0x32ef4d){return new Promise(function(_0x243d99,_0x16939c){var _0x3e6d92=[];for(var _0x17f7fc in _0xfab29f[_0x581d('0x57')]){if(_0xfab29f[_0x581d('0x57')][_0x581d('0x48')](_0x17f7fc)){var _0x1cb6d3=_0xfab29f['faxQueues'][_0x17f7fc];var _0x4f8b06={'id':_0x1cb6d3['id'],'available':_0x1cb6d3[_0x581d('0x4f')],'loggedIn':_0x1cb6d3[_0x581d('0x50')],'name':_0x1cb6d3[_0x581d('0x51')],'paused':_0x1cb6d3[_0x581d('0x52')],'waiting':_0x1cb6d3[_0x581d('0x54')]};_0x3e6d92[_0x581d('0x21')](_0x4f8b06);}}_0x243d99({'count':_0x3e6d92[_0x581d('0x17')],'rows':_0x3e6d92});});},'WhatsappQueues':function(_0x47eeac){return new Promise(function(_0x1573b3,_0x5f1419){var _0x1aaf14=[];for(var _0x31b765 in _0xfab29f[_0x581d('0x58')]){if(_0xfab29f[_0x581d('0x58')][_0x581d('0x48')](_0x31b765)){var _0x21be01=_0xfab29f['whatsappQueues'][_0x31b765];var _0x5b1b6d={'id':_0x21be01['id'],'available':_0x21be01[_0x581d('0x4f')],'loggedIn':_0x21be01[_0x581d('0x50')],'name':_0x21be01[_0x581d('0x51')],'paused':_0x21be01[_0x581d('0x52')],'waiting':_0x21be01[_0x581d('0x54')]};_0x1aaf14[_0x581d('0x21')](_0x5b1b6d);}}_0x1573b3({'count':_0x1aaf14[_0x581d('0x17')],'rows':_0x1aaf14});});},'ChatQueuesWaitingInteractions':function(_0x1e4656){return new Promise(function(_0x50bf64,_0x1642d8){var _0x3e1c34=_['values'](_0xfab29f[_0x581d('0x59')]);_0x50bf64({'count':_0x3e1c34[_0x581d('0x17')],'rows':_0x3e1c34});});},'MailQueuesWaitingInteractions':function(_0x52ca16){return new Promise(function(_0x21b8da,_0x54e758){var _0x343c2a=_[_0x581d('0x4d')](_0xfab29f[_0x581d('0x5a')]);_0x21b8da({'count':_0x343c2a[_0x581d('0x17')],'rows':_0x343c2a});});},'OpenchannelQueuesWaitingInteractions':function(_0x2472f6){return new Promise(function(_0x484f6a,_0x1231ba){var _0x57e0b7=_[_0x581d('0x4d')](_0xfab29f[_0x581d('0x5b')]);_0x484f6a({'count':_0x57e0b7['length'],'rows':_0x57e0b7});});},'SmsQueuesWaitingInteractions':function(_0x300ad9){return new Promise(function(_0x449e9e,_0x2bc845){var _0x5730aa=_[_0x581d('0x4d')](_0xfab29f[_0x581d('0x5c')]);_0x449e9e({'count':_0x5730aa[_0x581d('0x17')],'rows':_0x5730aa});});},'FaxQueuesWaitingInteractions':function(_0x541efe){return new Promise(function(_0x2a4b56,_0x5f2a21){var _0x5f13b8=_[_0x581d('0x4d')](_0xfab29f['faxQueuesWaitingInteractions']);_0x2a4b56({'count':_0x5f13b8[_0x581d('0x17')],'rows':_0x5f13b8});});},'WhatsappQueuesWaitingInteractions':function(_0x401f66){return new Promise(function(_0x5e61d2,_0x11fb53){var _0x5026ab=_[_0x581d('0x4d')](_0xfab29f[_0x581d('0x5d')]);_0x5e61d2({'count':_0x5026ab[_0x581d('0x17')],'rows':_0x5026ab});});}};var _0x63c57d=jayson[_0x581d('0x5e')](_0x4deffa)[_0x581d('0x5f')]();_0x63c57d['on'](_0x581d('0x35'),function(_0x10f221){logger['error'](JSON[_0x581d('0x3a')](_0x10f221));return _0x4f5591(_0x10f221);});_0x63c57d['listen'](0x232c,_0x581d('0x60'),function(){console[_0x581d('0x61')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5f3ba8(_0x581d('0x62')+0x232c);});});}; \ No newline at end of file +var _0xcffe=['message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','split','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','matchPath','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch'];(function(_0x45796a,_0x10d824){var _0x268307=function(_0x387d8d){while(--_0x387d8d){_0x45796a['push'](_0x45796a['shift']());}};_0x268307(++_0x10d824);}(_0xcffe,0x1a1));var _0xecff=function(_0x436073,_0x11b1d6){_0x436073=_0x436073-0x0;var _0x564463=_0xcffe[_0x436073];return _0x564463;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var path=require(_0xecff('0x2'));var fs=require('fs');var jayson=require(_0xecff('0x3'));var BPromise=require(_0xecff('0x4'));var uuid=require(_0xecff('0x5'));var utils=require(_0xecff('0x6'));var config=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xecff('0xa')),'smsQueueReport':require(_0xecff('0xb')),'faxQueueReport':require(_0xecff('0xc')),'whatsappQueueReport':require(_0xecff('0xd'))};var RuleEngine=require(_0xecff('0xe'));function getId(_0x298c19,_0x1f7386,_0x4d4458){return util[_0xecff('0xf')](_0xecff('0x10'),_0x298c19,_0x1f7386||0x0,_0x4d4458||0x0);}function getIntervals(_0x195b15,_0x20ab4f){var _0x698e40=[];if(!_['isNil'](_0x20ab4f[_0xecff('0x11')])&&!_[_0xecff('0x12')](_0x195b15[_0x20ab4f[_0xecff('0x11')]])&&!_[_0xecff('0x12')](_0x195b15[_0x20ab4f[_0xecff('0x11')]][_0xecff('0x13')])){_0x698e40=_[_0xecff('0x14')](_0x195b15[_0x20ab4f[_0xecff('0x11')]][_0xecff('0x13')],_0xecff('0x15'));}else if(!_[_0xecff('0x12')](_0x20ab4f[_0xecff('0x15')])){_0x698e40=[_0x20ab4f[_0xecff('0x15')]];}return _0x698e40;}exports[_0xecff('0x16')]=function(_0x5495f9){_0x5495f9['rules']={};return new BPromise(function(_0xa26f3d,_0x2e1d6f){var _0x558ecd={'Start':function(_0x35ce1f){var _0x362ed0=this;return new Promise(function(_0x3a7623,_0x596b09){if(_0x35ce1f){try{var _0x52b62f=[];var _0x24abef=getId(_0x35ce1f[_0xecff('0x17')],_0x35ce1f['message']?_0x35ce1f[_0xecff('0x18')]['id']:0x0,_0x35ce1f[_0xecff('0x19')]?_0x35ce1f[_0xecff('0x19')]['id']:0x0);if(_0x35ce1f[_0xecff('0x1a')]&&_[_0xecff('0x1b')](_0x35ce1f[_0xecff('0x1a')])&&_0x35ce1f['applications'][_0xecff('0x1c')]){for(var _0x422bd8=0x0;_0x422bd8<_0x35ce1f[_0xecff('0x1a')][_0xecff('0x1c')];_0x422bd8+=0x1){var _0x49d0e2=_0x35ce1f[_0xecff('0x1a')][_0x422bd8];if(fs[_0xecff('0x1d')](path[_0xecff('0x1e')](__dirname,_0xecff('0x1a'),_0x49d0e2[_0xecff('0x1f')]+_0xecff('0x20')))){var _0x494754=[];switch(_0x49d0e2[_0xecff('0x1f')]['toLowerCase']()){case'autoreply':var _0x2d16f1=_0x49d0e2['appdata'][_0xecff('0x21')](',');if(_0x35ce1f['channel']===_0xecff('0x22')){_0x494754['push'](_0x2d16f1[0x0]);_0x494754[_0xecff('0x23')](_0x2d16f1[0x1]);_0x494754[_0xecff('0x23')](_0x2d16f1['slice'](0x2,_0x2d16f1[_0xecff('0x1c')])[_0xecff('0x1e')](','));}else{_0x494754[_0xecff('0x23')](_0x2d16f1[0x0]);_0x494754[_0xecff('0x23')](_0x2d16f1[_0xecff('0x24')](0x1,_0x2d16f1['length'])['join'](','));}break;case _0xecff('0x25'):var _0x484415=_0x49d0e2[_0xecff('0x26')][_0xecff('0x21')](',');_0x494754[_0xecff('0x23')](_0x484415[0x0]);_0x494754[_0xecff('0x23')](_0x484415[0x1]);_0x494754['push'](_0x484415['slice'](0x2,_0x484415['length'])[_0xecff('0x1e')](','));break;case _0xecff('0x27'):var _0x230d04=_0x49d0e2[_0xecff('0x26')]['split'](',');_0x494754[_0xecff('0x23')](_0x230d04[0x0]);_0x494754[_0xecff('0x23')](_0x230d04[0x1]);_0x494754[_0xecff('0x23')](_0x230d04[0x2]);_0x494754['push'](_0x230d04[0x3]);_0x494754[_0xecff('0x23')](_0x230d04[_0xecff('0x24')](0x4,_0x230d04[_0xecff('0x1c')])[_0xecff('0x1e')](','));break;case'amazonlex':var _0x7e7a6c=_0x49d0e2[_0xecff('0x26')]['split'](',');_0x494754[_0xecff('0x23')](_0x7e7a6c[0x0]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x1]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x2]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x3]);_0x494754['push'](_0x7e7a6c[_0xecff('0x24')](0x4,_0x7e7a6c[_0xecff('0x1c')])[_0xecff('0x1e')](','));break;case'message':_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x26')]);break;case _0xecff('0x28'):_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x29')]);_0x494754[_0xecff('0x23')](_0x49d0e2['appdata']);break;case'tvox':var _0x4dd43c=utils[_0xecff('0x2a')](_0x35ce1f['account'][_0xecff('0x2b')],_0x35ce1f);var _0x21411b=_0x49d0e2['appdata'][_0xecff('0x21')](',');_0x494754[_0xecff('0x23')](_0x21411b[0x0]);_0x494754[_0xecff('0x23')](_0x21411b[0x1]);_0x494754['push'](_0x21411b[0x2]);_0x494754[_0xecff('0x23')](_0x21411b[0x3]);_0x494754[_0xecff('0x23')](_0x21411b[0x4]);_0x494754[_0xecff('0x23')](_0x21411b[0x5]);_0x494754['push'](_0x21411b[0x6]);_0x494754[_0xecff('0x23')](_0x21411b[0x7]);_0x494754[_0xecff('0x23')](_0x21411b[0x8]);_0x494754[_0xecff('0x23')](_0x21411b[0x9]);_0x494754[_0xecff('0x23')](_0x21411b[0xa]);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x19')]['id']);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x18')]['id']);_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x2c')]);_0x494754[_0xecff('0x23')](_0x35ce1f['interaction'][_0xecff('0x2d')]);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x2e')][_0xecff('0x2e')]);_0x494754[_0xecff('0x23')](_0x4dd43c);break;default:_0x494754=_[_0xecff('0x12')](_0x49d0e2[_0xecff('0x26')])?[]:_0x49d0e2[_0xecff('0x26')]['split'](',');}var _0x28141f={'id':util['format'](_0xecff('0x2f'),_0x24abef,_0x49d0e2['id'],_0x49d0e2[_0xecff('0x1f')]),'condition':require(_0xecff('0x30'))[_0xecff('0x31')](_0x24abef,getIntervals(_0x5495f9[_0xecff('0x32')],_0x49d0e2),_0x5495f9),'consequence':require(_0xecff('0x33')+_0x49d0e2[_0xecff('0x1f')])['consequence'](_0x24abef,_0x494754,_0x5495f9,_0x35ce1f),'p':_0x49d0e2[_0xecff('0x34')]||0x0};logger[_0xecff('0x35')]('Push\x20new\x20rule',_0x28141f['id'],'on\x20interval',getIntervals(_0x5495f9[_0xecff('0x32')],_0x49d0e2)[_0xecff('0x1e')](_0xecff('0x36')));_0x52b62f[_0xecff('0x23')](_0x28141f);}else{logger[_0xecff('0x37')](_0xecff('0x38'),path['join'](__dirname,_0xecff('0x1a'),_0x49d0e2[_0xecff('0x1f')]+'.js'));}}_0x5495f9[_0xecff('0x39')][_0x24abef]=new RuleEngine(_0x52b62f);_0x5495f9[_0xecff('0x39')][_0x24abef][_0xecff('0x3a')](_0x35ce1f,function(_0x4402a0){logger[_0xecff('0x35')](_0xecff('0x3b'),JSON['stringify'](_0x4402a0[_0xecff('0x3c')]));if(_0x5495f9[_0xecff('0x39')][_0x24abef]){_0x5495f9[_0xecff('0x39')][_0x24abef]['emit'](_0xecff('0x3d'));}});return _0x3a7623({'code':0xc8,'message':_0x35ce1f});}else{logger[_0xecff('0x35')](_0xecff('0x3e'));return _0x3a7623({'code':0xc8,'message':_0x35ce1f});}}catch(_0x3c73ca){logger['error'](_0x3c73ca[_0xecff('0x3f')]);return _0x596b09(_0x362ed0[_0xecff('0x37')](0x1f4,_0x3c73ca));}}return _0x596b09('routing\x20is\x20empty');});},'AcceptMessage':function(_0x22869d){var _0x1d2ac3=this;return new Promise(function(_0x4ba9e3,_0x1ee5fc){if(_0x22869d['agent']&&_0x22869d[_0xecff('0x40')]['id']){if(_0x5495f9[_0xecff('0x41')][_0x22869d[_0xecff('0x40')]['id']]){_0x5495f9[_0xecff('0x41')][_0x22869d[_0xecff('0x40')]['id']][_0xecff('0x42')]=![];_0x5495f9['agents'][_0x22869d['agent']['id']][_0xecff('0x43')]=undefined;}}if(_0x22869d[_0xecff('0x18')]&&_0x22869d[_0xecff('0x18')]['id']){try{var _0x29ff01=getId(_0x22869d[_0xecff('0x17')],_0x22869d[_0xecff('0x18')]?_0x22869d[_0xecff('0x18')]['id']:0x0,_0x22869d[_0xecff('0x19')]?_0x22869d['interaction']['id']:0x0);if(_0x5495f9[_0xecff('0x39')][_0x29ff01]){_0x5495f9[_0xecff('0x39')][_0x29ff01]['emit'](_0xecff('0x44'));if(rpc[_0x22869d['channel']+_0xecff('0x45')]){rpc[_0x22869d[_0xecff('0x17')]+'QueueReport'][_0xecff('0x46')](_0x29ff01,{'UserId':_0x22869d[_0xecff('0x18')][_0xecff('0x47')]})[_0xecff('0x48')](function(_0x27cc00){logger['error']('error\x20update\x20queue\x20report');});}}return _0x4ba9e3({'code':0xc8,'message':_0x22869d});}catch(_0x198ad6){logger[_0xecff('0x37')](_0x198ad6[_0xecff('0x3f')]);return _0x1ee5fc(_0x1d2ac3[_0xecff('0x37')](0x1f4,_0x198ad6));}}logger[_0xecff('0x37')](_0xecff('0x49'));return _0x1ee5fc(_0x1d2ac3[_0xecff('0x37')](0x1f4,_0xecff('0x49')));});},'RejectMessage':function(_0x9b44d4){var _0x4f9060=this;return new Promise(function(_0x289659,_0x56fed4){if(_0x9b44d4[_0xecff('0x40')]&&_0x9b44d4[_0xecff('0x40')]['id']){try{if(_0x5495f9[_0xecff('0x41')][_0x9b44d4['agent']['id']]){_0x5495f9[_0xecff('0x41')][_0x9b44d4['agent']['id']][_0xecff('0x42')]=![];_0x5495f9['agents'][_0x9b44d4['agent']['id']][_0xecff('0x43')]=undefined;}return _0x289659({'code':0xc8,'message':_0x9b44d4});}catch(_0x5cd819){logger[_0xecff('0x37')](_0x5cd819[_0xecff('0x3f')]);return _0x56fed4(_0x4f9060['error'](0x1f4,_0x5cd819));}}logger[_0xecff('0x37')](_0xecff('0x49'));return _0x56fed4(_0x4f9060[_0xecff('0x37')](0x1f4,_0xecff('0x49')));});},'AbandonInteraction':function(_0x181760){var _0x162938=this;return new Promise(function(_0x74fc77,_0x574c40){if(_0x181760['channel']&&_0x181760[_0xecff('0x19')]&&_0x181760[_0xecff('0x19')]['id']){try{var _0x18ead4=getId(_0x181760[_0xecff('0x17')],_0x181760[_0xecff('0x18')]?_0x181760[_0xecff('0x18')]['id']:0x0,_0x181760[_0xecff('0x19')]?_0x181760[_0xecff('0x19')]['id']:0x0);if(_0x5495f9[_0xecff('0x39')][_0x18ead4]){_0x5495f9[_0xecff('0x39')][_0x18ead4][_0xecff('0x4a')](_0xecff('0x44'));}return _0x74fc77({'code':0xc8,'message':_0x181760});}catch(_0x3f8e22){logger[_0xecff('0x37')](_0x3f8e22['stack']);return _0x574c40(_0x162938['error'](0x1f4,_0x3f8e22));}}logger[_0xecff('0x37')]('message\x20is\x20empty');return _0x574c40(_0x162938['error'](0x1f4,_0xecff('0x49')));});},'AgentCapacity':function(_0x41efbc){var _0x371e6=this;return new Promise(function(_0x48a737,_0x161190){if(_0x5495f9[_0xecff('0x41')][_0xecff('0x4b')](_0x41efbc['id'])){for(var _0x56b445 in _0x41efbc[_0xecff('0x4c')]){if(_0x41efbc['capacity']['hasOwnProperty'](_0x56b445)){if(_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0xecff('0x4b')](_0x56b445+_0xecff('0x4d'))){_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0x56b445+_0xecff('0x4d')]=parseInt(_0x41efbc[_0xecff('0x4c')][_0x56b445],0xa);}}}_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0xecff('0x4e')]();return _0x48a737({'code':0xc8,'message':_0x5495f9[_0xecff('0x41')][_0x41efbc['id']]});}else{return _0x161190(_0x371e6[_0xecff('0x37')](0x1f4,_0xecff('0x4f')));}});},'Agents':function(_0x3dcafd){return new Promise(function(_0x22e778,_0x3042c3){var _0x4d6265=_['values'](_0x5495f9[_0xecff('0x41')]);_0x22e778({'count':_0x4d6265[_0xecff('0x1c')],'rows':_0x4d6265});});},'ChatQueues':function(_0x4c0b1c){return new Promise(function(_0x15be2b,_0xe7f29a){var _0x59857d=[];for(var _0x148c69 in _0x5495f9[_0xecff('0x50')]){if(_0x5495f9[_0xecff('0x50')][_0xecff('0x4b')](_0x148c69)){var _0x20e8ab=_0x5495f9[_0xecff('0x50')][_0x148c69];var _0x485361={'id':_0x20e8ab['id'],'available':_0x20e8ab[_0xecff('0x51')],'loggedIn':_0x20e8ab[_0xecff('0x52')],'name':_0x20e8ab[_0xecff('0x53')],'paused':_0x20e8ab[_0xecff('0x54')],'waiting':_0x20e8ab[_0xecff('0x55')]};_0x59857d['push'](_0x485361);}}_0x15be2b({'count':_0x59857d[_0xecff('0x1c')],'rows':_0x59857d});});},'MailQueues':function(_0x4ca3c0){return new Promise(function(_0x6988b9,_0x3e54b8){var _0x5661b5=[];for(var _0x5988c2 in _0x5495f9['mailQueues']){if(_0x5495f9[_0xecff('0x56')][_0xecff('0x4b')](_0x5988c2)){var _0x1af54d=_0x5495f9['mailQueues'][_0x5988c2];var _0x2b79b3={'id':_0x1af54d['id'],'available':_0x1af54d['available'],'loggedIn':_0x1af54d[_0xecff('0x52')],'name':_0x1af54d[_0xecff('0x53')],'paused':_0x1af54d[_0xecff('0x54')],'waiting':_0x1af54d[_0xecff('0x55')]};_0x5661b5['push'](_0x2b79b3);}}_0x6988b9({'count':_0x5661b5[_0xecff('0x1c')],'rows':_0x5661b5});});},'OpenchannelQueues':function(_0x23aa75){return new Promise(function(_0xb3594f,_0x4dfd1d){var _0x5dd627=[];for(var _0x3aa2d8 in _0x5495f9[_0xecff('0x57')]){if(_0x5495f9['openchannelQueues'][_0xecff('0x4b')](_0x3aa2d8)){var _0x3756fe=_0x5495f9[_0xecff('0x57')][_0x3aa2d8];var _0xe7f2fb={'id':_0x3756fe['id'],'available':_0x3756fe[_0xecff('0x51')],'loggedIn':_0x3756fe['loggedIn'],'name':_0x3756fe['name'],'paused':_0x3756fe[_0xecff('0x54')],'waiting':_0x3756fe[_0xecff('0x55')]};_0x5dd627['push'](_0xe7f2fb);}}_0xb3594f({'count':_0x5dd627['length'],'rows':_0x5dd627});});},'SmsQueues':function(_0xd588df){return new Promise(function(_0x5d1635,_0x1b0ccd){var _0xac26eb=[];for(var _0x5155c1 in _0x5495f9[_0xecff('0x58')]){if(_0x5495f9[_0xecff('0x58')][_0xecff('0x4b')](_0x5155c1)){var _0x3f6444=_0x5495f9[_0xecff('0x58')][_0x5155c1];var _0x11648c={'id':_0x3f6444['id'],'available':_0x3f6444[_0xecff('0x51')],'loggedIn':_0x3f6444[_0xecff('0x52')],'name':_0x3f6444['name'],'paused':_0x3f6444[_0xecff('0x54')],'waiting':_0x3f6444['waiting']};_0xac26eb['push'](_0x11648c);}}_0x5d1635({'count':_0xac26eb[_0xecff('0x1c')],'rows':_0xac26eb});});},'FaxQueues':function(_0x5aa6c7){return new Promise(function(_0x4932ff,_0x3769ff){var _0x16669b=[];for(var _0x8fcddc in _0x5495f9[_0xecff('0x59')]){if(_0x5495f9[_0xecff('0x59')]['hasOwnProperty'](_0x8fcddc)){var _0x46e71c=_0x5495f9[_0xecff('0x59')][_0x8fcddc];var _0x147766={'id':_0x46e71c['id'],'available':_0x46e71c[_0xecff('0x51')],'loggedIn':_0x46e71c[_0xecff('0x52')],'name':_0x46e71c['name'],'paused':_0x46e71c[_0xecff('0x54')],'waiting':_0x46e71c[_0xecff('0x55')]};_0x16669b[_0xecff('0x23')](_0x147766);}}_0x4932ff({'count':_0x16669b[_0xecff('0x1c')],'rows':_0x16669b});});},'WhatsappQueues':function(_0x46ba08){return new Promise(function(_0x4e829b,_0x5a0cea){var _0x29ea01=[];for(var _0x5b6054 in _0x5495f9['whatsappQueues']){if(_0x5495f9[_0xecff('0x5a')]['hasOwnProperty'](_0x5b6054)){var _0xae0c00=_0x5495f9['whatsappQueues'][_0x5b6054];var _0x5ef856={'id':_0xae0c00['id'],'available':_0xae0c00['available'],'loggedIn':_0xae0c00['loggedIn'],'name':_0xae0c00[_0xecff('0x53')],'paused':_0xae0c00[_0xecff('0x54')],'waiting':_0xae0c00[_0xecff('0x55')]};_0x29ea01[_0xecff('0x23')](_0x5ef856);}}_0x4e829b({'count':_0x29ea01[_0xecff('0x1c')],'rows':_0x29ea01});});},'ChatQueuesWaitingInteractions':function(_0x391ea3){return new Promise(function(_0x1bbf7a,_0x385909){var _0x410d73=_[_0xecff('0x5b')](_0x5495f9['chatQueuesWaitingInteractions']);_0x1bbf7a({'count':_0x410d73[_0xecff('0x1c')],'rows':_0x410d73});});},'MailQueuesWaitingInteractions':function(_0x461dfb){return new Promise(function(_0x44e34a,_0x2d77a){var _0x2c07fb=_['values'](_0x5495f9[_0xecff('0x5c')]);_0x44e34a({'count':_0x2c07fb[_0xecff('0x1c')],'rows':_0x2c07fb});});},'OpenchannelQueuesWaitingInteractions':function(_0x19d449){return new Promise(function(_0x4f3e8c,_0xd9787d){var _0x4f2af6=_[_0xecff('0x5b')](_0x5495f9['openchannelQueuesWaitingInteractions']);_0x4f3e8c({'count':_0x4f2af6[_0xecff('0x1c')],'rows':_0x4f2af6});});},'SmsQueuesWaitingInteractions':function(_0x1fd6df){return new Promise(function(_0x2d934a,_0x198b36){var _0x2d3286=_['values'](_0x5495f9[_0xecff('0x5d')]);_0x2d934a({'count':_0x2d3286[_0xecff('0x1c')],'rows':_0x2d3286});});},'FaxQueuesWaitingInteractions':function(_0x537151){return new Promise(function(_0x49c50e,_0x4306f4){var _0x334310=_[_0xecff('0x5b')](_0x5495f9[_0xecff('0x5e')]);_0x49c50e({'count':_0x334310['length'],'rows':_0x334310});});},'WhatsappQueuesWaitingInteractions':function(_0x2eb5b4){return new Promise(function(_0x28e423,_0x581e15){var _0x3f8cd9=_['values'](_0x5495f9['whatsappQueuesWaitingInteractions']);_0x28e423({'count':_0x3f8cd9[_0xecff('0x1c')],'rows':_0x3f8cd9});});}};var _0x49cc1e=jayson[_0xecff('0x5f')](_0x558ecd)[_0xecff('0x60')]();_0x49cc1e['on'](_0xecff('0x37'),function(_0x8cb05f){logger[_0xecff('0x37')](JSON['stringify'](_0x8cb05f));return _0x2e1d6f(_0x8cb05f);});_0x49cc1e['listen'](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xa26f3d(_0xecff('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c1f1cb2..170cefc 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 _0xb82c=['all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','catch','rules','info','stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s'];(function(_0x1716bb,_0x42caf2){var _0x28024f=function(_0x471c6d){while(--_0x471c6d){_0x1716bb['push'](_0x1716bb['shift']());}};_0x28024f(++_0x42caf2);}(_0xb82c,0x162));var _0xcb82=function(_0x1e8462,_0x4c0443){_0x1e8462=_0x1e8462-0x0;var _0x34774f=_0xb82c[_0x1e8462];return _0x34774f;};'use strict';var util=require(_0xcb82('0x0'));var BPromise=require(_0xcb82('0x1'));var jayson=require(_0xcb82('0x2'));var _=require(_0xcb82('0x3'));var logger=require(_0xcb82('0x4'))('routing');var client=jayson[_0xcb82('0x5')][_0xcb82('0x6')]({'port':0x232a});function request(_0x59e857,_0x4aa65b){return new BPromise(function(_0x17dc21,_0x41e989){return client[_0xcb82('0x7')](_0x59e857,_0x4aa65b)[_0xcb82('0x8')](function(_0x185532){if(_0x185532[_0xcb82('0x9')]){return _0x41e989(_0x185532[_0xcb82('0x9')]['message']);}else{return _0x17dc21(_0x185532['result']);}})[_0xcb82('0xa')](function(_0x7cf360){return _0x41e989(_0x7cf360);});});}exports['condition']=function(_0x257592,_0x15026c,_0x27ae1d){return function(_0xc5dbd2){if(_0x27ae1d[_0xcb82('0xb')]&&!_0x27ae1d[_0xcb82('0xb')][_0x257592]){logger[_0xcb82('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x257592);return _0xc5dbd2[_0xcb82('0xd')]();}var _0x48f208=[];for(var _0x2b6fe2=0x0;_0x2b6fe2<_0x15026c[_0xcb82('0xe')];_0x2b6fe2+=0x1){_0x48f208[_0xcb82('0xf')](request(_0xcb82('0x10'),{'command':util[_0xcb82('0x11')](_0xcb82('0x12'),_0x15026c[_0x2b6fe2])})[_0xcb82('0x8')](function(_0x29c24e){return _0x29c24e&&_0x29c24e[_0xcb82('0x13')]&&_0x29c24e['message'][_0xcb82('0x14')](_0xcb82('0x15'))>=0x0?!![]:![];})[_0xcb82('0xa')](function(_0x4760ef){logger[_0xcb82('0x9')](_0xcb82('0x16'),_0x257592,_0x15026c[_0x2b6fe2]);}));}BPromise[_0xcb82('0x17')](_0x48f208)[_0xcb82('0x8')](function(_0x6bc703){var _0x55f47f=_[_0xcb82('0x18')](_0x6bc703);logger[_0xcb82('0xc')](_0xcb82('0x19'),_0x257592,_0x15026c[_0xcb82('0x1a')]('\x20|\x20'),_0x55f47f);_0xc5dbd2[_0xcb82('0x1b')](_0x55f47f);})[_0xcb82('0xa')](function(_0x1c5f14){console[_0xcb82('0x1c')](_0x1c5f14);logger[_0xcb82('0x9')](_0xcb82('0x19'),_0x257592,_0x15026c[_0xcb82('0x1a')]('\x20|\x20'),_0x1c5f14['stack']);_0xc5dbd2[_0xcb82('0xd')]();});};}; \ No newline at end of file +var _0x32cb=['[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','stop','length','Command','format','iftime\x20%s','indexOf','true'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x32cb,0x19e));var _0xb32c=function(_0xc80137,_0x3a3158){_0xc80137=_0xc80137-0x0;var _0x5cb4d2=_0x32cb[_0xc80137];return _0x5cb4d2;};'use strict';var util=require(_0xb32c('0x0'));var BPromise=require('bluebird');var jayson=require(_0xb32c('0x1'));var _=require(_0xb32c('0x2'));var logger=require(_0xb32c('0x3'))(_0xb32c('0x4'));var client=jayson['client'][_0xb32c('0x5')]({'port':0x232a});function request(_0x6b96ff,_0x28a8a9){return new BPromise(function(_0x224e7f,_0x3549a9){return client[_0xb32c('0x6')](_0x6b96ff,_0x28a8a9)[_0xb32c('0x7')](function(_0x225774){if(_0x225774[_0xb32c('0x8')]){return _0x3549a9(_0x225774[_0xb32c('0x8')][_0xb32c('0x9')]);}else{return _0x224e7f(_0x225774[_0xb32c('0xa')]);}})[_0xb32c('0xb')](function(_0x2b89d4){return _0x3549a9(_0x2b89d4);});});}exports[_0xb32c('0xc')]=function(_0x25eab8,_0x4ef2a9,_0x34e3e0){return function(_0x4bd549){if(_0x34e3e0[_0xb32c('0xd')]&&!_0x34e3e0[_0xb32c('0xd')][_0x25eab8]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x25eab8);return _0x4bd549[_0xb32c('0xe')]();}var _0x3fd93a=[];for(var _0x1e95bc=0x0;_0x1e95bc<_0x4ef2a9[_0xb32c('0xf')];_0x1e95bc+=0x1){_0x3fd93a['push'](request(_0xb32c('0x10'),{'command':util[_0xb32c('0x11')](_0xb32c('0x12'),_0x4ef2a9[_0x1e95bc])})['then'](function(_0x2c5e37){return _0x2c5e37&&_0x2c5e37['message']&&_0x2c5e37[_0xb32c('0x9')][_0xb32c('0x13')](_0xb32c('0x14'))>=0x0?!![]:![];})['catch'](function(_0x204368){logger[_0xb32c('0x8')](_0xb32c('0x15'),_0x25eab8,_0x4ef2a9[_0x1e95bc]);}));}BPromise[_0xb32c('0x16')](_0x3fd93a)[_0xb32c('0x7')](function(_0x5b062c){var _0x547d35=_[_0xb32c('0x17')](_0x5b062c);logger[_0xb32c('0x18')](_0xb32c('0x19'),_0x25eab8,_0x4ef2a9[_0xb32c('0x1a')](_0xb32c('0x1b')),_0x547d35);_0x4bd549['when'](_0x547d35);})[_0xb32c('0xb')](function(_0x41725c){console['log'](_0x41725c);logger[_0xb32c('0x8')](_0xb32c('0x19'),_0x25eab8,_0x4ef2a9[_0xb32c('0x1a')]('\x20|\x20'),_0x41725c[_0xb32c('0x1c')]);_0x4bd549[_0xb32c('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7e06fd4..3f83150 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 _0xac4a=['now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','calleridnum','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','./utils','info','uniqueid','channel','queue','interface','connectedlinenum','getVoiceQueueByName','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt'];(function(_0x48a9e6,_0x21ac6c){var _0x4b6ef2=function(_0x213ad2){while(--_0x213ad2){_0x48a9e6['push'](_0x48a9e6['shift']());}};_0x4b6ef2(++_0x21ac6c);}(_0xac4a,0x13f));var _0xaac4=function(_0x1464e3,_0x11065a){_0x1464e3=_0x1464e3-0x0;var _0x230d73=_0xac4a[_0x1464e3];return _0x230d73;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var utils=require(_0xaac4('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x132fc3,_0x38f4f4){utils[_0xaac4('0x3')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x132fc3[_0xaac4('0x4')],_0x132fc3[_0xaac4('0x5')],_0x132fc3[_0xaac4('0x6')],_0x132fc3['membername'],_0x132fc3[_0xaac4('0x7')],_0x132fc3['calleridnum'],_0x132fc3[_0xaac4('0x8')],_0x132fc3['lastevent']));if(_0x132fc3[_0xaac4('0x6')]){utils[_0xaac4('0x9')](_0x132fc3['queue'])['then'](function(_0x349671){if(_0x349671){_0x132fc3['type']=_0x349671[_0xaac4('0xa')];_0x132fc3['agentacw']=_0x132fc3['agentcomplete']?_0x349671[_0xaac4('0xb')]:![];_0x132fc3[_0xaac4('0xc')]=_0x132fc3[_0xaac4('0xd')]?_0x349671[_0xaac4('0xe')]:0x0;}utils[_0xaac4('0xf')]('CreateVoiceAgentReport',_0x132fc3);});}else{utils['request'](_0xaac4('0x10'),_0x132fc3);}if(_0x38f4f4){delete transfers[_0x132fc3[_0xaac4('0x4')]];}else{delete agents[_0x132fc3[_0xaac4('0x11')]];}}exports['agentcalled']=function(_0x6a808d){try{utils[_0xaac4('0x12')](util['format'](_0xaac4('0x13'),_0x6a808d[_0xaac4('0x4')]),_0x6a808d);agents[_0x6a808d[_0xaac4('0x11')]]=_0x6a808d;agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x14')]=utils[_0xaac4('0x15')]();agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x16')]=_0xaac4('0x17');agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x8')]=null;agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x18')]=null;utils['info'](util[_0xaac4('0x19')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x6a808d[_0xaac4('0x4')],agents[_0x6a808d['destuniqueid']][_0xaac4('0x1a')],_0x6a808d[_0xaac4('0x11')]));}catch(_0xa22b76){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x13'),_0x6a808d[_0xaac4('0x4')]),_0xa22b76);}};exports[_0xaac4('0x1c')]=function(_0x4166ee){try{if(!_['isNil'](agents[_0x4166ee[_0xaac4('0x11')]])){utils['debug'](util[_0xaac4('0x19')](_0xaac4('0x1d'),_0x4166ee[_0xaac4('0x4')]),_0x4166ee);utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x1e'),_0x4166ee['uniqueid'],agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1a')],_0x4166ee[_0xaac4('0x11')]));agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1c')]=!![];agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1f')]=utils['now']();agents[_0x4166ee[_0xaac4('0x11')]]['lastevent']='timeout';agents[_0x4166ee['destuniqueid']]['reason']=_0xaac4('0x20');agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x21')]=_0x4166ee[_0xaac4('0x22')]?parseInt(_0x4166ee[_0xaac4('0x22')])/0x3e8:0x0;agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x23')]=0x0;unanswered[_0xaac4('0x24')](_0x4166ee[_0xaac4('0x11')]);}}catch(_0x386c9b){utils['error'](util[_0xaac4('0x19')](_0xaac4('0x1d'),_0x4166ee[_0xaac4('0x4')]),_0x386c9b);}};exports[_0xaac4('0x25')]=function(_0x669b34){try{_[_0xaac4('0x26')](agents,function(_0x5e469a,_0xcf6c1){if(_0x5e469a['uniqueid']==_0x669b34[_0xaac4('0x4')]&&!_[_0xaac4('0x27')](unanswered,_0x5e469a[_0xaac4('0x11')])){utils[_0xaac4('0x12')](util['format']('[%s][agents][queuecallerabandon]',_0x669b34['uniqueid']),_0x669b34);utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x28'),_0x669b34[_0xaac4('0x4')],_0x5e469a[_0xaac4('0x1a')],_0x5e469a[_0xaac4('0x11')]));_0x5e469a[_0xaac4('0x1c')]=!![];_0x5e469a[_0xaac4('0x1f')]=utils[_0xaac4('0x15')]();_0x5e469a[_0xaac4('0x16')]=_0xaac4('0x29');_0x5e469a[_0xaac4('0x2a')]=_0xaac4('0x29');_0x5e469a[_0xaac4('0x21')]=_0x669b34[_0xaac4('0x21')];_0x5e469a['talktime']=0x0;writeDB(_0x5e469a);}});}catch(_0x5bad9f){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x2b'),_0x669b34['uniqueid']),_0x5bad9f);}};exports[_0xaac4('0x2c')]=function(_0x16fae8){try{if(agents[_0x16fae8[_0xaac4('0x11')]]){utils[_0xaac4('0x12')](util[_0xaac4('0x19')](_0xaac4('0x2d'),_0x16fae8[_0xaac4('0x4')]),_0x16fae8);utils['info'](util[_0xaac4('0x19')](_0xaac4('0x2e'),_0x16fae8[_0xaac4('0x4')],agents[_0x16fae8['destuniqueid']][_0xaac4('0x1a')],_0x16fae8['destuniqueid']));agents[_0x16fae8['destuniqueid']][_0xaac4('0x2f')]=utils[_0xaac4('0x15')]();agents[_0x16fae8[_0xaac4('0x11')]]['connectedlinenum']=_0x16fae8['connectedlinenum'];agents[_0x16fae8[_0xaac4('0x11')]][_0xaac4('0x18')]=_0x16fae8[_0xaac4('0x18')];agents[_0x16fae8[_0xaac4('0x11')]][_0xaac4('0x21')]=_0x16fae8[_0xaac4('0x22')];agents[_0x16fae8['destuniqueid']]['lastevent']=_0xaac4('0x30');_[_0xaac4('0x26')](agents,function(_0x5371b4,_0x416a5b){if(_0x5371b4[_0xaac4('0x11')]!=_0x16fae8[_0xaac4('0x11')]&&_0x5371b4['uniqueid']==_0x16fae8[_0xaac4('0x4')]){_0x5371b4[_0xaac4('0x23')]=0x0;_0x5371b4[_0xaac4('0x21')]=_0x16fae8['ringtime'];_0x5371b4[_0xaac4('0x1c')]=!![];_0x5371b4[_0xaac4('0x1f')]=utils[_0xaac4('0x15')]();_0x5371b4[_0xaac4('0x16')]='answered_elsewhere';_0x5371b4[_0xaac4('0x2a')]='answered_elsewhere';_0x5371b4['answeredelsewheredestinationuniqueid']=_0x16fae8[_0xaac4('0x11')];_0x5371b4[_0xaac4('0x31')]=_0x16fae8[_0xaac4('0x1a')];writeDB(_0x5371b4);}});}}catch(_0x40c007){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x2d'),_0x16fae8[_0xaac4('0x4')]),_0x40c007);}};exports['agentcomplete']=function(_0x15191a){try{if(!_[_0xaac4('0x32')](agents[_0x15191a[_0xaac4('0x11')]])){utils[_0xaac4('0x12')](util['format'](_0xaac4('0x33'),_0x15191a[_0xaac4('0x4')]),_0x15191a);utils[_0xaac4('0x3')](util['format'](_0xaac4('0x34'),_0x15191a[_0xaac4('0x4')],agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x1a')],_0x15191a['destuniqueid']));agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x35')]=!![];agents[_0x15191a[_0xaac4('0x11')]]['agentcompleteAt']=utils[_0xaac4('0x15')]();agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x37')],agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x2f')]);agents[_0x15191a[_0xaac4('0x11')]]['reason']=_0x15191a[_0xaac4('0x2a')];agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x16')]=_0xaac4('0x38');writeDB(agents[_0x15191a[_0xaac4('0x11')]]);}}catch(_0x5dca5c){utils['error'](util[_0xaac4('0x19')](_0xaac4('0x33'),_0x15191a[_0xaac4('0x4')]),_0x5dca5c);}};exports[_0xaac4('0x39')]=function(_0x5f33ea){try{if(!_[_0xaac4('0x32')](agents[_0x5f33ea['transfereruniqueid']])){utils[_0xaac4('0x12')](util[_0xaac4('0x19')]('[%s][agents][blindtransfer]',_0x5f33ea[_0xaac4('0x4')]),_0x5f33ea);utils[_0xaac4('0x3')](util[_0xaac4('0x19')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5f33ea['uniqueid'],agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x1a')],agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x4')]));agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x3b')]=!![];agents[_0x5f33ea['transfereruniqueid']][_0xaac4('0x3c')]=_0xaac4('0x3d');agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x3e')]=_0x5f33ea['extension'];agents[_0x5f33ea[_0xaac4('0x3a')]]['transferuniqueid']=agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x4')];}}catch(_0x460252){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x3f'),_0x5f33ea[_0xaac4('0x4')]),_0x460252);}};exports[_0xaac4('0x40')]=function(_0x28aed5){try{utils[_0xaac4('0x12')](util[_0xaac4('0x19')](_0xaac4('0x41'),_0x28aed5[_0xaac4('0x42')]),_0x28aed5);if(_0x28aed5[_0xaac4('0x42')]==_0x28aed5['origtransfererlinkedid']){if(!_[_0xaac4('0x32')](agents[_0x28aed5[_0xaac4('0x43')]])){utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x44'),_0x28aed5[_0xaac4('0x42')],agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x1a')]));agents[_0x28aed5['secondtransfereruniqueid']][_0xaac4('0x3b')]=!![];agents[_0x28aed5['secondtransfereruniqueid']][_0xaac4('0x3c')]='ATTENDED';agents[_0x28aed5[_0xaac4('0x43')]]['transferexten']=_0x28aed5['origtransfererexten'];agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x45')]=_0x28aed5['origtransfereruniqueid'];}if(_0x28aed5[_0xaac4('0x46')]&&agents[_0x28aed5[_0xaac4('0x46')]]){agents[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x47')]=0x1;transfers[_0x28aed5[_0xaac4('0x46')]]=_[_0xaac4('0x48')](agents[_0x28aed5['transfereeuniqueid']]);transfers[_0x28aed5[_0xaac4('0x46')]]['calleridnum']=agents[_0x28aed5[_0xaac4('0x43')]]['calleridnum'];transfers[_0x28aed5['transfereeuniqueid']]['calleridname']=agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x49')];transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x14')]=utils['now']();transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x2f')]=utils[_0xaac4('0x15')]();transfers[_0x28aed5['transfereeuniqueid']][_0xaac4('0x21')]=0x0;transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x47')]=0x2;}}else if(_0x28aed5[_0xaac4('0x43')]==_0x28aed5[_0xaac4('0x4a')]){if(!_[_0xaac4('0x32')](agents[_0x28aed5[_0xaac4('0x42')]])){utils['info'](util['format'](_0xaac4('0x44'),_0x28aed5['origtransfereruniqueid'],agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x1a')]));agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x3b')]=!![];agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x3c')]=_0xaac4('0x4b');agents[_0x28aed5['origtransfereruniqueid']]['transferexten']=_0x28aed5['secondtransfererexten'];agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x45')]=_0x28aed5[_0xaac4('0x43')];}if(_0x28aed5[_0xaac4('0x4c')]&&agents[_0x28aed5[_0xaac4('0x4c')]]){agents[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x47')]=0x1;transfers[_0x28aed5[_0xaac4('0x4c')]]=_[_0xaac4('0x48')](agents[_0x28aed5[_0xaac4('0x4c')]]);transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x4d')]=agents[_0x28aed5[_0xaac4('0x42')]][_0xaac4('0x4d')];transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x49')]=agents[_0x28aed5[_0xaac4('0x42')]]['calleridname'];transfers[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x14')]=utils['now']();transfers[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x2f')]=utils['now']();transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x21')]=0x0;transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x47')]=0x2;}}}catch(_0x50eeee){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x41'),_0x28aed5[_0xaac4('0x42')]),_0x50eeee);}};exports[_0xaac4('0x4e')]=function(_0x3a1b41){try{utils['debug'](util[_0xaac4('0x19')](_0xaac4('0x4f'),_0x3a1b41['uniqueid']),_0x3a1b41);if(agents[_0x3a1b41[_0xaac4('0x4')]]&&agents[_0x3a1b41[_0xaac4('0x4')]]['reason']==='timeout'){if(_0x3a1b41[_0xaac4('0x50')]==='21'){agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')]=_0xaac4('0x51');agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x16')]=_0xaac4('0x51');}utils[_0xaac4('0x3')](util['format'](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x1a')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x16')]));writeDB(agents[_0x3a1b41[_0xaac4('0x4')]]);var _0x53059b=unanswered['indexOf'](_0x3a1b41['uniqueid']);if(_0x53059b>-0x1){unanswered[_0xaac4('0x53')](_0x53059b,0x1);}}if(transfers[_0x3a1b41['uniqueid']]){transfers[_0x3a1b41['uniqueid']]['agentcomplete']=!![];transfers[_0x3a1b41['uniqueid']]['agentcompleteAt']=utils[_0xaac4('0x15')]();transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](transfers[_0x3a1b41['uniqueid']][_0xaac4('0x37')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]);transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')]=_0xaac4('0x54');transfers[_0x3a1b41[_0xaac4('0x4')]]['lastevent']=_0xaac4('0x38');utils['info'](util['format'](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x1a')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x16')]));writeDB(transfers[_0x3a1b41[_0xaac4('0x4')]],!![]);}if(agents[_0x3a1b41[_0xaac4('0x4')]]&&agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]){agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x35')]=!![];agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x37')]=utils[_0xaac4('0x15')]();agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x37')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]);agents[_0x3a1b41[_0xaac4('0x4')]]['reason']=agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x3b')]?_0xaac4('0x3b'):_0xaac4('0x54');agents[_0x3a1b41[_0xaac4('0x4')]]['lastevent']=_0xaac4('0x38');utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x1a')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x2a')],agents[_0x3a1b41[_0xaac4('0x4')]]['lastevent']));writeDB(agents[_0x3a1b41[_0xaac4('0x4')]]);}}catch(_0x55cf3c){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')]('[%s][agents][hangup]',_0x3a1b41[_0xaac4('0x4')]),_0x55cf3c);}}; \ No newline at end of file +var _0xa5fa=['[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertype','secondtransfererexten','transferuniqueid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','acw','acwTimeout','CreateVoiceAgentReport','request','uniqueid','destuniqueid','[%s][agents][agentcalled]','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','[%s][agents][blindtransfer]','attendedtransfer'];(function(_0x35f543,_0x348f00){var _0x12506d=function(_0x4b40ad){while(--_0x4b40ad){_0x35f543['push'](_0x35f543['shift']());}};_0x12506d(++_0x348f00);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x353e55,_0x384e65){_0x353e55=_0x353e55-0x0;var _0xe1646a=_0xa5fa[_0x353e55];return _0xe1646a;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var utils=require(_0xaa5f('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24d383,_0x1b7e1d){utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x3'),_0x24d383['uniqueid'],_0x24d383[_0xaa5f('0x4')],_0x24d383[_0xaa5f('0x5')],_0x24d383[_0xaa5f('0x6')],_0x24d383[_0xaa5f('0x7')],_0x24d383[_0xaa5f('0x8')],_0x24d383[_0xaa5f('0x9')],_0x24d383[_0xaa5f('0xa')]));if(_0x24d383[_0xaa5f('0x5')]){utils[_0xaa5f('0xb')](_0x24d383[_0xaa5f('0x5')])[_0xaa5f('0xc')](function(_0x4e5257){if(_0x4e5257){_0x24d383[_0xaa5f('0xd')]=_0x4e5257[_0xaa5f('0xd')];_0x24d383['agentacw']=_0x24d383['agentcomplete']?_0x4e5257[_0xaa5f('0xe')]:![];_0x24d383['acwtime']=_0x24d383['agentacw']?_0x4e5257[_0xaa5f('0xf')]:0x0;}utils['request'](_0xaa5f('0x10'),_0x24d383);});}else{utils[_0xaa5f('0x11')](_0xaa5f('0x10'),_0x24d383);}if(_0x1b7e1d){delete transfers[_0x24d383[_0xaa5f('0x12')]];}else{delete agents[_0x24d383[_0xaa5f('0x13')]];}}exports['agentcalled']=function(_0xbd4e10){try{utils['debug'](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0xbd4e10);agents[_0xbd4e10[_0xaa5f('0x13')]]=_0xbd4e10;agents[_0xbd4e10[_0xaa5f('0x13')]]['agentcalledAt']=utils['now']();agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x15');agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x9')]=null;agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x16')]=null;utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x18'),_0xbd4e10[_0xaa5f('0x12')],agents[_0xbd4e10[_0xaa5f('0x13')]]['membername'],_0xbd4e10[_0xaa5f('0x13')]));}catch(_0x4c0a9d){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0x4c0a9d);}};exports[_0xaa5f('0x1a')]=function(_0x194691){try{if(!_[_0xaa5f('0x1b')](agents[_0x194691[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x1d'),_0x194691['uniqueid']),_0x194691);utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x1e'),_0x194691[_0xaa5f('0x12')],agents[_0x194691['destuniqueid']][_0xaa5f('0x6')],_0x194691[_0xaa5f('0x13')]));agents[_0x194691['destuniqueid']][_0xaa5f('0x1a')]=!![];agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x1f')]=utils[_0xaa5f('0x20')]();agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]]['reason']=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x194691['ringtime']?parseInt(_0x194691[_0xaa5f('0x23')])/0x3e8:0x0;agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x24')]=0x0;unanswered['push'](_0x194691[_0xaa5f('0x13')]);}}catch(_0x479f29){utils['error'](util[_0xaa5f('0x2')]('[%s][agents][agentringnoanswer]',_0x194691[_0xaa5f('0x12')]),_0x479f29);}};exports['queuecallerabandon']=function(_0x4c5dc0){try{_['forIn'](agents,function(_0x26a90d,_0x4ddebd){if(_0x26a90d[_0xaa5f('0x12')]==_0x4c5dc0[_0xaa5f('0x12')]&&!_['includes'](unanswered,_0x26a90d['destuniqueid'])){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x4c5dc0);utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x26'),_0x4c5dc0[_0xaa5f('0x12')],_0x26a90d['membername'],_0x26a90d[_0xaa5f('0x13')]));_0x26a90d[_0xaa5f('0x1a')]=!![];_0x26a90d['agentringnoanswerAt']=utils['now']();_0x26a90d['lastevent']='abandoned';_0x26a90d[_0xaa5f('0x27')]=_0xaa5f('0x28');_0x26a90d[_0xaa5f('0x22')]=_0x4c5dc0[_0xaa5f('0x22')];_0x26a90d[_0xaa5f('0x24')]=0x0;writeDB(_0x26a90d);}});}catch(_0x3bcaf6){utils[_0xaa5f('0x19')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x3bcaf6);}};exports[_0xaa5f('0x29')]=function(_0x1f3268){try{if(agents[_0x1f3268[_0xaa5f('0x13')]]){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x2a'),_0x1f3268[_0xaa5f('0x12')]),_0x1f3268);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x2b'),_0x1f3268['uniqueid'],agents[_0x1f3268['destuniqueid']][_0xaa5f('0x6')],_0x1f3268[_0xaa5f('0x13')]));agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x2c')]=utils['now']();agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x9')]=_0x1f3268[_0xaa5f('0x9')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x16')]=_0x1f3268[_0xaa5f('0x16')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0xa')]='connect';_[_0xaa5f('0x2d')](agents,function(_0x2562ce,_0xcd9c30){if(_0x2562ce[_0xaa5f('0x13')]!=_0x1f3268[_0xaa5f('0x13')]&&_0x2562ce[_0xaa5f('0x12')]==_0x1f3268[_0xaa5f('0x12')]){_0x2562ce[_0xaa5f('0x24')]=0x0;_0x2562ce[_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];_0x2562ce['agentringnoanswer']=!![];_0x2562ce[_0xaa5f('0x1f')]=utils['now']();_0x2562ce[_0xaa5f('0xa')]=_0xaa5f('0x2e');_0x2562ce[_0xaa5f('0x27')]='answered_elsewhere';_0x2562ce[_0xaa5f('0x2f')]=_0x1f3268[_0xaa5f('0x13')];_0x2562ce[_0xaa5f('0x30')]=_0x1f3268['membername'];writeDB(_0x2562ce);}});}}catch(_0x12a8e4){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x2a'),_0x1f3268['uniqueid']),_0x12a8e4);}};exports[_0xaa5f('0x31')]=function(_0x2b2b4c){try{if(!_[_0xaa5f('0x1b')](agents[_0x2b2b4c[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x2b2b4c);utils['info'](util[_0xaa5f('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2b2b4c[_0xaa5f('0x12')],agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x6')],_0x2b2b4c[_0xaa5f('0x13')]));agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x33')]=utils['now']();agents[_0x2b2b4c['destuniqueid']]['talktime']=utils[_0xaa5f('0x34')](agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x33')],agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x2c')]);agents[_0x2b2b4c[_0xaa5f('0x13')]]['reason']=_0x2b2b4c[_0xaa5f('0x27')];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x35');writeDB(agents[_0x2b2b4c[_0xaa5f('0x13')]]);}}catch(_0x1f9629){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x1f9629);}};exports[_0xaa5f('0x36')]=function(_0x2de737){try{if(!_[_0xaa5f('0x1b')](agents[_0x2de737[_0xaa5f('0x37')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')]('[%s][agents][blindtransfer]',_0x2de737[_0xaa5f('0x12')]),_0x2de737);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x38'),_0x2de737[_0xaa5f('0x12')],agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x6')],agents[_0x2de737['transfereruniqueid']][_0xaa5f('0x12')]));agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x39')]=!![];agents[_0x2de737[_0xaa5f('0x37')]]['transfertype']=_0xaa5f('0x3a');agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x3b')]=_0x2de737['extension'];agents[_0x2de737['transfereruniqueid']]['transferuniqueid']=agents[_0x2de737['transfereruniqueid']]['uniqueid'];}}catch(_0x509c61){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3c'),_0x2de737[_0xaa5f('0x12')]),_0x509c61);}};exports[_0xaa5f('0x3d')]=function(_0x17b872){try{utils['debug'](util['format'](_0xaa5f('0x3e'),_0x17b872[_0xaa5f('0x3f')]),_0x17b872);if(_0x17b872['origtransfereruniqueid']==_0x17b872[_0xaa5f('0x40')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872[_0xaa5f('0x41')]])){utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872['secondtransfereruniqueid']]['membername']));agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x39')]=!![];agents[_0x17b872['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x17b872[_0xaa5f('0x41')]]['transferexten']=_0x17b872[_0xaa5f('0x43')];agents[_0x17b872['secondtransfereruniqueid']]['transferuniqueid']=_0x17b872[_0xaa5f('0x3f')];}if(_0x17b872[_0xaa5f('0x44')]&&agents[_0x17b872[_0xaa5f('0x44')]]){agents[_0x17b872['transfereeuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x44')]]=_[_0xaa5f('0x46')](agents[_0x17b872['transfereeuniqueid']]);transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x8')]=agents[_0x17b872['secondtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x47')]=agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x48')]=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]]['agentconnectAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x45')]=0x2;}}else if(_0x17b872[_0xaa5f('0x41')]==_0x17b872[_0xaa5f('0x49')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872['origtransfereruniqueid']])){utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x6')]));agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x39')]=!![];agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x4a')]='ATTENDED';agents[_0x17b872[_0xaa5f('0x3f')]]['transferexten']=_0x17b872[_0xaa5f('0x4b')];agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x4c')]=_0x17b872[_0xaa5f('0x41')];}if(_0x17b872[_0xaa5f('0x4d')]&&agents[_0x17b872[_0xaa5f('0x4d')]]){agents[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x4d')]]=_['clone'](agents[_0x17b872['transfertargetuniqueid']]);transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x8')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x47')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x4d')]]['agentcalledAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x2c')]=utils['now']();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x2;}}}catch(_0x309605){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3e'),_0x17b872['origtransfereruniqueid']),_0x309605);}};exports[_0xaa5f('0x4e')]=function(_0x2ba378){try{utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x4f'),_0x2ba378['uniqueid']),_0x2ba378);if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378['uniqueid']][_0xaa5f('0x27')]===_0xaa5f('0x21')){if(_0x2ba378[_0xaa5f('0x50')]==='21'){agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=_0xaa5f('0x51');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x51');}utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378['uniqueid'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]]['lastevent']));writeDB(agents[_0x2ba378['uniqueid']]);var _0x104079=unanswered[_0xaa5f('0x52')](_0x2ba378['uniqueid']);if(_0x104079>-0x1){unanswered[_0xaa5f('0x53')](_0x104079,0x1);}}if(transfers[_0x2ba378['uniqueid']]){transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x31')]=!![];transfers[_0x2ba378['uniqueid']][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')],transfers[_0x2ba378['uniqueid']][_0xaa5f('0x2c')]);transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')]='agent';transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378[_0xaa5f('0x12')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(transfers[_0x2ba378[_0xaa5f('0x12')]],!![]);}if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378[_0xaa5f('0x12')]]['agentconnectAt']){agents[_0x2ba378['uniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](agents[_0x2ba378[_0xaa5f('0x12')]]['agentcompleteAt'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x2c')]);agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=agents[_0x2ba378['uniqueid']][_0xaa5f('0x39')]?_0xaa5f('0x39'):_0xaa5f('0x54');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x55'),_0x2ba378[_0xaa5f('0x12')],agents[_0x2ba378['uniqueid']][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(agents[_0x2ba378['uniqueid']]);}}catch(_0x4183c0){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')]('[%s][agents][hangup]',_0x2ba378['uniqueid']),_0x4183c0);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index a63c19a..e394fdd 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 _0x7e02=['split','lastIndexOf','includes','execif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','info','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','billableseconds','endtime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','mohtime','[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','value','source','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','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7e02,0x71));var _0x27e0=function(_0x200af4,_0x8416e8){_0x200af4=_0x200af4-0x0;var _0x3831b6=_0x7e02[_0x200af4];return _0x3831b6;};'use strict';var _=require(_0x27e0('0x0'));var util=require(_0x27e0('0x1'));var utils=require(_0x27e0('0x2'));var transfers=require(_0x27e0('0x3'));var dispositions=[_0x27e0('0x4'),_0x27e0('0x5'),_0x27e0('0x5'),'NO\x20ANSWER','NO\x20ANSWER',_0x27e0('0x4'),'ANSWERED',_0x27e0('0x6'),_0x27e0('0x5'),_0x27e0('0x5'),_0x27e0('0x5')];var channels={};function writeDB(_0x32bc79){var _0x2dff51;if(transfers[_0x27e0('0x7')][_0x32bc79[_0x27e0('0x8')]]){_0x2dff51=_0x32bc79['uniqueid'];_0x32bc79[_0x27e0('0x8')]=transfers['blinds'][_0x32bc79[_0x27e0('0x8')]][_0x27e0('0x9')];}utils['info'](util[_0x27e0('0xa')](_0x27e0('0xb'),_0x32bc79[_0x27e0('0x8')],_0x32bc79[_0x27e0('0xc')],_0x32bc79[_0x27e0('0xd')],_0x32bc79[_0x27e0('0xe')],_0x32bc79[_0x27e0('0xf')],_0x32bc79[_0x27e0('0x10')],_0x32bc79[_0x27e0('0x11')],_0x32bc79['lastevent']));if(_0x32bc79[_0x27e0('0x12')]){utils[_0x27e0('0x13')](_0x32bc79[_0x27e0('0x12')])['then'](function(_0x39fb61){if(_0x39fb61){_0x32bc79[_0x27e0('0x14')]=_0x39fb61['id'];}utils[_0x27e0('0x15')]('CreateVoiceCallReport',_0x32bc79);});}else{utils[_0x27e0('0x15')](_0x27e0('0x16'),_0x32bc79);}if(channels[_0x32bc79[_0x27e0('0x8')]]){delete channels[_0x32bc79[_0x27e0('0x8')]];}else if(_0x2dff51&&channels[_0x2dff51]){if(!transfers['blinds'][_0x2dff51]['recording'])delete transfers[_0x27e0('0x7')][_0x2dff51];delete channels[_0x2dff51];}}exports[_0x27e0('0x17')]=function(_0x15d297){try{utils[_0x27e0('0x18')](util['format'](_0x27e0('0x19'),_0x15d297[_0x27e0('0x8')]),_0x15d297);if(_0x15d297[_0x27e0('0x8')]==_0x15d297[_0x27e0('0x1a')]&&_0x15d297[_0x27e0('0xc')]!=_0x27e0('0x1b')){utils['info'](util[_0x27e0('0xa')](_0x27e0('0x1c'),_0x15d297['uniqueid'],_0x15d297[_0x27e0('0x1d')],_0x15d297[_0x27e0('0x1e')]));channels[_0x15d297[_0x27e0('0x8')]]={'uniqueid':_0x15d297[_0x27e0('0x8')],'accountcode':_0x15d297[_0x27e0('0x12')],'source':_0x15d297['calleridnum'],'destination':_0x15d297['exten'],'destinationcontext':_0x15d297['context'],'channel':_0x15d297[_0x27e0('0xc')],'starttime':utils[_0x27e0('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x27e0('0x20')};}}catch(_0xee6318){utils[_0x27e0('0x21')](util[_0x27e0('0xa')](_0x27e0('0x19'),_0x15d297[_0x27e0('0x8')]),_0xee6318);}};exports[_0x27e0('0x22')]=function(_0x371039){try{utils[_0x27e0('0x18')](util[_0x27e0('0xa')](_0x27e0('0x23'),_0x371039[_0x27e0('0x8')]),_0x371039);if(!_[_0x27e0('0x24')](channels[_0x371039[_0x27e0('0x8')]])&&_0x371039[_0x27e0('0x25')]==0x6){utils['info'](util[_0x27e0('0xa')](_0x27e0('0x26'),_0x371039[_0x27e0('0x8')],_0x371039[_0x27e0('0x1d')],_0x371039[_0x27e0('0xc')]));if(_['isNil'](channels[_0x371039['uniqueid']][_0x27e0('0x27')])){channels[_0x371039[_0x27e0('0x8')]][_0x27e0('0x27')]=utils[_0x27e0('0x1f')]();}}else if(!_['isNil'](channels[_0x371039['linkedid']])&&_0x371039[_0x27e0('0x25')]==0x6&&_0x371039[_0x27e0('0x1d')]!='transfer'){utils['info'](util['format'](_0x27e0('0x28'),_0x371039[_0x27e0('0x8')],_0x371039[_0x27e0('0x1a')],_0x371039[_0x27e0('0x1d')],_0x371039['channel']));channels[_0x371039[_0x27e0('0x1a')]][_0x27e0('0x12')]=_0x371039[_0x27e0('0x12')];channels[_0x371039[_0x27e0('0x1a')]][_0x27e0('0x29')]=_0x371039[_0x27e0('0xc')];if(_[_0x27e0('0x24')](channels[_0x371039[_0x27e0('0x1a')]][_0x27e0('0x2a')])){channels[_0x371039[_0x27e0('0x1a')]]['answertime']=utils[_0x27e0('0x1f')]();}channels[_0x371039[_0x27e0('0x1a')]]['disposition']=dispositions[_['toNumber'](_0x371039[_0x27e0('0x25')])]||_0x27e0('0x2b');}}catch(_0x339608){utils['error'](util[_0x27e0('0xa')](_0x27e0('0x23'),_0x371039['uniqueid']),_0x339608);}};exports[_0x27e0('0x2c')]=function(_0xf58e4a){try{if(!_['isNil'](channels[_0xf58e4a[_0x27e0('0x8')]])){utils[_0x27e0('0x18')](util['format'](_0x27e0('0x2d'),_0xf58e4a[_0x27e0('0x8')]),_0xf58e4a);if(_['isNil'](channels[_0xf58e4a['uniqueid']][_0x27e0('0x2e')])){channels[_0xf58e4a[_0x27e0('0x8')]][_0x27e0('0x2e')]=_0xf58e4a[_0x27e0('0x2f')]+'\x20<'+_0xf58e4a['calleridnum']+'>';}utils[_0x27e0('0x30')](util['format'](_0x27e0('0x31'),_0xf58e4a[_0x27e0('0x8')],channels[_0xf58e4a[_0x27e0('0x8')]]['callerid'],_0xf58e4a[_0x27e0('0x32')]));channels[_0xf58e4a[_0x27e0('0x8')]]['endtime']=utils['now']();channels[_0xf58e4a[_0x27e0('0x8')]][_0x27e0('0x33')]=utils[_0x27e0('0x34')](channels[_0xf58e4a[_0x27e0('0x8')]]['endtime'],channels[_0xf58e4a['uniqueid']]['starttime']);channels[_0xf58e4a[_0x27e0('0x8')]][_0x27e0('0x35')]=channels[_0xf58e4a['uniqueid']]['answertime']?utils['diffTime'](channels[_0xf58e4a[_0x27e0('0x8')]][_0x27e0('0x36')],channels[_0xf58e4a[_0x27e0('0x8')]][_0x27e0('0x2a')]):0x0;writeDB(channels[_0xf58e4a[_0x27e0('0x8')]]);}}catch(_0x2f2b5e){utils[_0x27e0('0x21')](util[_0x27e0('0xa')](_0x27e0('0x2d'),_0xf58e4a[_0x27e0('0x8')]),_0x2f2b5e);}};exports[_0x27e0('0x37')]=function(_0x233f5c){try{if(!_[_0x27e0('0x24')](channels[_0x233f5c[_0x27e0('0x38')]])){utils[_0x27e0('0x18')](util['format']('[%s][calls][attendedtransfer]',_0x233f5c[_0x27e0('0x39')]),_0x233f5c);if(channels[_0x233f5c[_0x27e0('0x38')]]['channel']==_0x233f5c['transfereechannel']){utils['info'](util[_0x27e0('0xa')](_0x27e0('0x3a'),_0x233f5c['origtransfereruniqueid'],_0x233f5c['localtwolinkedid'],_0x233f5c[_0x27e0('0x3b')]));channels[_0x233f5c[_0x27e0('0x38')]][_0x27e0('0x29')]=_0x233f5c[_0x27e0('0x3b')];channels[_0x233f5c[_0x27e0('0x38')]][_0x27e0('0x3c')]=_0x27e0('0x3d');}else if(channels[_0x233f5c[_0x27e0('0x38')]][_0x27e0('0xc')]=_0x233f5c[_0x27e0('0x3e')]){utils[_0x27e0('0x30')](util[_0x27e0('0xa')](_0x27e0('0x3a'),_0x233f5c[_0x27e0('0x39')],_0x233f5c[_0x27e0('0x38')],_0x233f5c[_0x27e0('0x3f')]));channels[_0x233f5c[_0x27e0('0x38')]][_0x27e0('0x29')]=_0x233f5c[_0x27e0('0x3f')];channels[_0x233f5c[_0x27e0('0x38')]][_0x27e0('0x3c')]=_0x27e0('0x3d');}}}catch(_0x1e8969){utils[_0x27e0('0x21')](util[_0x27e0('0xa')](_0x27e0('0x40'),_0x233f5c[_0x27e0('0x39')]),_0x1e8969);}};exports[_0x27e0('0x41')]=function(_0x4ef533){try{if(!_['isNil'](channels[_0x4ef533[_0x27e0('0x8')]])){utils[_0x27e0('0x18')](util['format']('[%s][calls][musiconholdstart]',_0x4ef533[_0x27e0('0x8')]),_0x4ef533);channels[_0x4ef533[_0x27e0('0x8')]][_0x27e0('0x42')]=utils[_0x27e0('0x1f')]();utils[_0x27e0('0x30')](util[_0x27e0('0xa')](_0x27e0('0x43'),_0x4ef533['uniqueid'],channels[_0x4ef533['uniqueid']][_0x27e0('0x42')]));}}catch(_0x2b54e6){utils[_0x27e0('0x21')](util[_0x27e0('0xa')](_0x27e0('0x44'),_0x4ef533[_0x27e0('0x8')]),_0x2b54e6);}};exports['musiconholdstop']=function(_0x5b25e1){try{if(!_[_0x27e0('0x24')](channels[_0x5b25e1[_0x27e0('0x8')]])){utils[_0x27e0('0x18')](util[_0x27e0('0xa')]('[%s][calls][musiconholdstop]',_0x5b25e1['uniqueid']),_0x5b25e1);if(!_[_0x27e0('0x24')](channels[_0x5b25e1[_0x27e0('0x8')]]['musiconholdstartAt'])){channels[_0x5b25e1[_0x27e0('0x8')]][_0x27e0('0x45')]+=utils['diffTime'](utils['now'](),channels[_0x5b25e1['uniqueid']][_0x27e0('0x42')]);utils[_0x27e0('0x30')](util[_0x27e0('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5b25e1[_0x27e0('0x8')],channels[_0x5b25e1[_0x27e0('0x8')]][_0x27e0('0x45')]));delete channels[_0x5b25e1[_0x27e0('0x8')]][_0x27e0('0x42')];}}}catch(_0x38c7c2){utils[_0x27e0('0x21')](util[_0x27e0('0xa')](_0x27e0('0x46'),_0x5b25e1[_0x27e0('0x8')]),_0x38c7c2);}};exports[_0x27e0('0x47')]=function(_0x5599be){try{if(!_[_0x27e0('0x24')](channels[_0x5599be[_0x27e0('0x8')]])){utils[_0x27e0('0x18')](util[_0x27e0('0xa')]('[%s][calls][varset]',_0x5599be[_0x27e0('0x8')]),_0x5599be);if(!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x49')])){utils[_0x27e0('0x30')](util[_0x27e0('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5599be[_0x27e0('0x8')],_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x4b')]=_0x5599be[_0x27e0('0x4a')];}if(!_['isNil'](_0x5599be[_0x27e0('0x48')][_0x27e0('0x4c')])){utils['info'](util[_0x27e0('0xa')](_0x27e0('0x4d'),_0x5599be[_0x27e0('0x8')],_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x4e')]=_0x5599be[_0x27e0('0x4a')];channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x2e')]='\x22'+_0x5599be['value']+_0x27e0('0x4f')+_0x5599be[_0x27e0('0x4a')]+'>';}if(!_[_0x27e0('0x24')](_0x5599be['variable'][_0x27e0('0x50')])||!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x51')])){utils[_0x27e0('0x30')](util[_0x27e0('0xa')](_0x27e0('0x52'),_0x5599be[_0x27e0('0x8')],!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x50')])?_0x27e0('0x50'):_0x27e0('0x51'),_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x2e')]=_0x5599be[_0x27e0('0x4a')];}if(!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x53')])||!_[_0x27e0('0x24')](_0x5599be['variable']['xmcs-queue'])){utils[_0x27e0('0x30')](util[_0x27e0('0xa')](_0x27e0('0x52'),_0x5599be['uniqueid'],!_[_0x27e0('0x24')](_0x5599be['variable'][_0x27e0('0x53')])?_0x27e0('0x53'):'xmcs-queue',_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x54')]=_0x27e0('0x55');channels[_0x5599be['uniqueid']][_0x27e0('0x56')]=_0x5599be[_0x27e0('0x4a')];channels[_0x5599be[_0x27e0('0x8')]]['queue']=!![];}if(!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x57')])){utils['info'](util[_0x27e0('0xa')](_0x27e0('0x58'),_0x5599be['uniqueid'],_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x59')]=_0x5599be[_0x27e0('0x4a')];}if(!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x5a')])){utils[_0x27e0('0x30')](util['format'](_0x27e0('0x5b'),_0x5599be['uniqueid'],_0x5599be['value']));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x5c')]=_0x5599be[_0x27e0('0x4a')];}if(!_[_0x27e0('0x24')](_0x5599be[_0x27e0('0x48')][_0x27e0('0x5d')])){utils[_0x27e0('0x30')](util[_0x27e0('0xa')](_0x27e0('0x5e'),_0x5599be[_0x27e0('0x8')],_0x5599be[_0x27e0('0x4a')]));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x5f')]=_0x5599be[_0x27e0('0x4a')];}if(!_[_0x27e0('0x24')](_0x5599be['variable']['sipcallid'])){utils[_0x27e0('0x30')](util['format'](_0x27e0('0x60'),_0x5599be[_0x27e0('0x8')],_0x5599be['value']));channels[_0x5599be[_0x27e0('0x8')]][_0x27e0('0x61')]=_0x5599be['value'];}}}catch(_0x21dc07){utils['error'](util[_0x27e0('0xa')]('[%s][calls][varset]',_0x5599be[_0x27e0('0x8')]),_0x21dc07);}};exports['newexten']=function(_0x5eef8c){try{if(!_[_0x27e0('0x24')](channels[_0x5eef8c[_0x27e0('0x8')]])){utils['debug'](util[_0x27e0('0xa')](_0x27e0('0x62'),_0x5eef8c[_0x27e0('0x8')]),_0x5eef8c);utils['info'](util[_0x27e0('0xa')](_0x27e0('0x63'),_0x5eef8c[_0x27e0('0x8')],_0x5eef8c[_0x27e0('0x64')],_0x5eef8c[_0x27e0('0x65')]));if(_0x5eef8c['application'][_0x27e0('0x66')]()==_0x27e0('0x67')&&_['startsWith'](_0x5eef8c['appdata'][_0x27e0('0x66')](),_0x27e0('0x68'))){var _0x5a4cf2=_0x5eef8c[_0x27e0('0x65')][_0x27e0('0x69')]('=');var _0x184c31=_0x5a4cf2[0x0]['substring'](_0x5a4cf2[0x0][_0x27e0('0x6a')]('(')+0x1,_0x5a4cf2[0x0][_0x27e0('0x6a')](')'));var _0x5b2a1c=_0x5a4cf2[0x1];channels[_0x5eef8c[_0x27e0('0x8')]][_0x184c31]=_0x5b2a1c;}if(!_[_0x27e0('0x6b')](['hangup','noop',_0x27e0('0x6c'),_0x27e0('0x67'),'gotoif'],_0x5eef8c['application']['toLowerCase']())){channels[_0x5eef8c[_0x27e0('0x8')]]['lastapplication']=_0x5eef8c[_0x27e0('0x64')];channels[_0x5eef8c['uniqueid']]['lastdata']=_0x5eef8c['appdata'];}}}catch(_0x1721d0){utils[_0x27e0('0x21')](util['format'](_0x27e0('0x62'),_0x5eef8c[_0x27e0('0x8')]),_0x1721d0);}}; \ No newline at end of file +var _0x9ca0=['channel','membername','interface','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','application','toLowerCase','set','cdr','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9ca0,0x65));var _0x09ca=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x9ca0[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0x09ca('0x0'));var util=require(_0x09ca('0x1'));var utils=require(_0x09ca('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x09ca('0x3'),_0x09ca('0x4'),'FAILED',_0x09ca('0x3'),_0x09ca('0x3'),'NO\x20ANSWER',_0x09ca('0x5'),'BUSY','FAILED',_0x09ca('0x4'),_0x09ca('0x4')];var channels={};function writeDB(_0x3bf4d9){var _0x224661;if(transfers[_0x09ca('0x6')][_0x3bf4d9['uniqueid']]){_0x224661=_0x3bf4d9['uniqueid'];_0x3bf4d9[_0x09ca('0x7')]=transfers[_0x09ca('0x6')][_0x3bf4d9['uniqueid']][_0x09ca('0x8')];}utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0xb'),_0x3bf4d9[_0x09ca('0x7')],_0x3bf4d9[_0x09ca('0xc')],_0x3bf4d9['queue'],_0x3bf4d9[_0x09ca('0xd')],_0x3bf4d9[_0x09ca('0xe')],_0x3bf4d9['calleridnum'],_0x3bf4d9[_0x09ca('0xf')],_0x3bf4d9['lastevent']));if(_0x3bf4d9[_0x09ca('0x10')]){utils[_0x09ca('0x11')](_0x3bf4d9[_0x09ca('0x10')])['then'](function(_0x57eda0){if(_0x57eda0){_0x3bf4d9[_0x09ca('0x12')]=_0x57eda0['id'];}utils[_0x09ca('0x13')]('CreateVoiceCallReport',_0x3bf4d9);});}else{utils[_0x09ca('0x13')](_0x09ca('0x14'),_0x3bf4d9);}if(channels[_0x3bf4d9[_0x09ca('0x7')]]){delete channels[_0x3bf4d9[_0x09ca('0x7')]];}else if(_0x224661&&channels[_0x224661]){if(!transfers[_0x09ca('0x6')][_0x224661][_0x09ca('0x15')])delete transfers[_0x09ca('0x6')][_0x224661];delete channels[_0x224661];}}exports[_0x09ca('0x16')]=function(_0x349eb7){try{utils[_0x09ca('0x17')](util[_0x09ca('0xa')](_0x09ca('0x18'),_0x349eb7['uniqueid']),_0x349eb7);if(_0x349eb7[_0x09ca('0x7')]==_0x349eb7[_0x09ca('0x19')]&&_0x349eb7[_0x09ca('0xc')]!=_0x09ca('0x1a')){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x1b'),_0x349eb7[_0x09ca('0x7')],_0x349eb7['context'],_0x349eb7[_0x09ca('0x1c')]));channels[_0x349eb7[_0x09ca('0x7')]]={'uniqueid':_0x349eb7[_0x09ca('0x7')],'accountcode':_0x349eb7['accountcode'],'source':_0x349eb7[_0x09ca('0x1d')],'destination':_0x349eb7[_0x09ca('0x1c')],'destinationcontext':_0x349eb7[_0x09ca('0x1e')],'channel':_0x349eb7[_0x09ca('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x09ca('0x3'),'amaflags':_0x09ca('0x1f')};}}catch(_0x3115d0){utils[_0x09ca('0x20')](util[_0x09ca('0xa')](_0x09ca('0x18'),_0x349eb7[_0x09ca('0x7')]),_0x3115d0);}};exports['newstate']=function(_0x2558a3){try{utils[_0x09ca('0x17')](util[_0x09ca('0xa')](_0x09ca('0x21'),_0x2558a3[_0x09ca('0x7')]),_0x2558a3);if(!_[_0x09ca('0x22')](channels[_0x2558a3[_0x09ca('0x7')]])&&_0x2558a3[_0x09ca('0x23')]==0x6){utils['info'](util[_0x09ca('0xa')](_0x09ca('0x24'),_0x2558a3[_0x09ca('0x7')],_0x2558a3['context'],_0x2558a3['channel']));if(_[_0x09ca('0x22')](channels[_0x2558a3[_0x09ca('0x7')]][_0x09ca('0x25')])){channels[_0x2558a3[_0x09ca('0x7')]]['systemanswertime']=utils[_0x09ca('0x26')]();}}else if(!_['isNil'](channels[_0x2558a3[_0x09ca('0x19')]])&&_0x2558a3[_0x09ca('0x23')]==0x6&&_0x2558a3[_0x09ca('0x1e')]!='transfer'){utils['info'](util[_0x09ca('0xa')](_0x09ca('0x27'),_0x2558a3['uniqueid'],_0x2558a3['linkedid'],_0x2558a3[_0x09ca('0x1e')],_0x2558a3[_0x09ca('0xc')]));channels[_0x2558a3[_0x09ca('0x19')]][_0x09ca('0x10')]=_0x2558a3[_0x09ca('0x10')];channels[_0x2558a3[_0x09ca('0x19')]]['destinationchannel']=_0x2558a3[_0x09ca('0xc')];if(_['isNil'](channels[_0x2558a3[_0x09ca('0x19')]][_0x09ca('0x28')])){channels[_0x2558a3[_0x09ca('0x19')]]['answertime']=utils[_0x09ca('0x26')]();}channels[_0x2558a3['linkedid']][_0x09ca('0x29')]=dispositions[_['toNumber'](_0x2558a3[_0x09ca('0x23')])]||_0x09ca('0x5');}}catch(_0x5323b4){utils[_0x09ca('0x20')](util[_0x09ca('0xa')](_0x09ca('0x21'),_0x2558a3['uniqueid']),_0x5323b4);}};exports[_0x09ca('0x2a')]=function(_0x17687d){try{if(!_[_0x09ca('0x22')](channels[_0x17687d[_0x09ca('0x7')]])){utils['debug'](util[_0x09ca('0xa')](_0x09ca('0x2b'),_0x17687d[_0x09ca('0x7')]),_0x17687d);if(_[_0x09ca('0x22')](channels[_0x17687d['uniqueid']][_0x09ca('0x2c')])){channels[_0x17687d['uniqueid']]['callerid']=_0x17687d[_0x09ca('0x2d')]+'\x20<'+_0x17687d['calleridnum']+'>';}utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x2e'),_0x17687d[_0x09ca('0x7')],channels[_0x17687d['uniqueid']][_0x09ca('0x2c')],_0x17687d['cause-txt']));channels[_0x17687d['uniqueid']][_0x09ca('0x2f')]=utils[_0x09ca('0x26')]();channels[_0x17687d['uniqueid']][_0x09ca('0x30')]=utils[_0x09ca('0x31')](channels[_0x17687d['uniqueid']][_0x09ca('0x2f')],channels[_0x17687d[_0x09ca('0x7')]]['starttime']);channels[_0x17687d[_0x09ca('0x7')]][_0x09ca('0x32')]=channels[_0x17687d[_0x09ca('0x7')]][_0x09ca('0x28')]?utils[_0x09ca('0x31')](channels[_0x17687d[_0x09ca('0x7')]][_0x09ca('0x2f')],channels[_0x17687d[_0x09ca('0x7')]]['answertime']):0x0;writeDB(channels[_0x17687d[_0x09ca('0x7')]]);}}catch(_0x10b87c){utils[_0x09ca('0x20')](util[_0x09ca('0xa')](_0x09ca('0x2b'),_0x17687d[_0x09ca('0x7')]),_0x10b87c);}};exports[_0x09ca('0x33')]=function(_0x4dff85){try{if(!_[_0x09ca('0x22')](channels[_0x4dff85['localtwolinkedid']])){utils[_0x09ca('0x17')](util['format'](_0x09ca('0x34'),_0x4dff85[_0x09ca('0x35')]),_0x4dff85);if(channels[_0x4dff85[_0x09ca('0x36')]][_0x09ca('0xc')]==_0x4dff85[_0x09ca('0x37')]){utils[_0x09ca('0x9')](util['format'](_0x09ca('0x38'),_0x4dff85[_0x09ca('0x35')],_0x4dff85[_0x09ca('0x36')],_0x4dff85[_0x09ca('0x39')]));channels[_0x4dff85[_0x09ca('0x36')]][_0x09ca('0x3a')]=_0x4dff85[_0x09ca('0x39')];channels[_0x4dff85[_0x09ca('0x36')]]['userfield']=_0x09ca('0x3b');}else if(channels[_0x4dff85[_0x09ca('0x36')]][_0x09ca('0xc')]=_0x4dff85[_0x09ca('0x3c')]){utils[_0x09ca('0x9')](util[_0x09ca('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4dff85[_0x09ca('0x35')],_0x4dff85['localtwolinkedid'],_0x4dff85[_0x09ca('0x3d')]));channels[_0x4dff85[_0x09ca('0x36')]][_0x09ca('0x3a')]=_0x4dff85[_0x09ca('0x3d')];channels[_0x4dff85[_0x09ca('0x36')]][_0x09ca('0x3e')]=_0x09ca('0x3b');}}}catch(_0x3b79be){utils[_0x09ca('0x20')](util['format'](_0x09ca('0x34'),_0x4dff85[_0x09ca('0x35')]),_0x3b79be);}};exports[_0x09ca('0x3f')]=function(_0xa74bc1){try{if(!_[_0x09ca('0x22')](channels[_0xa74bc1[_0x09ca('0x7')]])){utils['debug'](util[_0x09ca('0xa')](_0x09ca('0x40'),_0xa74bc1[_0x09ca('0x7')]),_0xa74bc1);channels[_0xa74bc1[_0x09ca('0x7')]][_0x09ca('0x41')]=utils[_0x09ca('0x26')]();utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x42'),_0xa74bc1[_0x09ca('0x7')],channels[_0xa74bc1[_0x09ca('0x7')]][_0x09ca('0x41')]));}}catch(_0x5b50fc){utils[_0x09ca('0x20')](util[_0x09ca('0xa')]('[%s][calls][musiconholdstart]',_0xa74bc1[_0x09ca('0x7')]),_0x5b50fc);}};exports['musiconholdstop']=function(_0x172d52){try{if(!_[_0x09ca('0x22')](channels[_0x172d52[_0x09ca('0x7')]])){utils[_0x09ca('0x17')](util[_0x09ca('0xa')]('[%s][calls][musiconholdstop]',_0x172d52[_0x09ca('0x7')]),_0x172d52);if(!_[_0x09ca('0x22')](channels[_0x172d52[_0x09ca('0x7')]][_0x09ca('0x41')])){channels[_0x172d52[_0x09ca('0x7')]][_0x09ca('0x43')]+=utils[_0x09ca('0x31')](utils[_0x09ca('0x26')](),channels[_0x172d52[_0x09ca('0x7')]][_0x09ca('0x41')]);utils['info'](util[_0x09ca('0xa')](_0x09ca('0x44'),_0x172d52['uniqueid'],channels[_0x172d52[_0x09ca('0x7')]]['mohtime']));delete channels[_0x172d52[_0x09ca('0x7')]]['musiconholdstartAt'];}}}catch(_0x178d04){utils['error'](util[_0x09ca('0xa')](_0x09ca('0x45'),_0x172d52[_0x09ca('0x7')]),_0x178d04);}};exports[_0x09ca('0x46')]=function(_0x16e5b9){try{if(!_[_0x09ca('0x22')](channels[_0x16e5b9[_0x09ca('0x7')]])){utils['debug'](util[_0x09ca('0xa')]('[%s][calls][varset]',_0x16e5b9[_0x09ca('0x7')]),_0x16e5b9);if(!_['isNil'](_0x16e5b9[_0x09ca('0x47')][_0x09ca('0x48')])){utils['info'](util[_0x09ca('0xa')](_0x09ca('0x49'),_0x16e5b9[_0x09ca('0x7')],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x4b')]=_0x16e5b9[_0x09ca('0x4a')];}if(!_[_0x09ca('0x22')](_0x16e5b9[_0x09ca('0x47')][_0x09ca('0x4c')])){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x4d'),_0x16e5b9[_0x09ca('0x7')],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x4e')]=_0x16e5b9[_0x09ca('0x4a')];channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x2c')]='\x22'+_0x16e5b9[_0x09ca('0x4a')]+_0x09ca('0x4f')+_0x16e5b9['value']+'>';}if(!_[_0x09ca('0x22')](_0x16e5b9['variable'][_0x09ca('0x50')])||!_[_0x09ca('0x22')](_0x16e5b9['variable'][_0x09ca('0x51')])){utils[_0x09ca('0x9')](util['format'](_0x09ca('0x52'),_0x16e5b9['uniqueid'],!_[_0x09ca('0x22')](_0x16e5b9[_0x09ca('0x47')]['xmd-callerid-preview'])?_0x09ca('0x50'):_0x09ca('0x51'),_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x2c')]=_0x16e5b9[_0x09ca('0x4a')];}if(!_[_0x09ca('0x22')](_0x16e5b9['variable'][_0x09ca('0x53')])||!_[_0x09ca('0x22')](_0x16e5b9[_0x09ca('0x47')][_0x09ca('0x54')])){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x52'),_0x16e5b9[_0x09ca('0x7')],!_[_0x09ca('0x22')](_0x16e5b9['variable']['xmd-queue'])?'xmd-queue':_0x09ca('0x54'),_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]]['lastapplication']=_0x09ca('0x55');channels[_0x16e5b9['uniqueid']]['lastdata']=_0x16e5b9['value'];channels[_0x16e5b9[_0x09ca('0x7')]]['queue']=!![];}if(!_[_0x09ca('0x22')](_0x16e5b9[_0x09ca('0x47')][_0x09ca('0x56')])){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x57'),_0x16e5b9[_0x09ca('0x7')],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9['uniqueid']][_0x09ca('0x58')]=_0x16e5b9['value'];}if(!_[_0x09ca('0x22')](_0x16e5b9[_0x09ca('0x47')][_0x09ca('0x59')])){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x5a'),_0x16e5b9[_0x09ca('0x7')],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x5b')]=_0x16e5b9[_0x09ca('0x4a')];}if(!_[_0x09ca('0x22')](_0x16e5b9['variable'][_0x09ca('0x5c')])){utils[_0x09ca('0x9')](util[_0x09ca('0xa')](_0x09ca('0x5d'),_0x16e5b9['uniqueid'],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9['uniqueid']][_0x09ca('0x5e')]=_0x16e5b9[_0x09ca('0x4a')];}if(!_['isNil'](_0x16e5b9[_0x09ca('0x47')]['sipcallid'])){utils['info'](util[_0x09ca('0xa')](_0x09ca('0x5f'),_0x16e5b9['uniqueid'],_0x16e5b9[_0x09ca('0x4a')]));channels[_0x16e5b9[_0x09ca('0x7')]][_0x09ca('0x60')]=_0x16e5b9[_0x09ca('0x4a')];}}}catch(_0x345a8b){utils[_0x09ca('0x20')](util[_0x09ca('0xa')](_0x09ca('0x61'),_0x16e5b9[_0x09ca('0x7')]),_0x345a8b);}};exports[_0x09ca('0x62')]=function(_0x592d6e){try{if(!_['isNil'](channels[_0x592d6e[_0x09ca('0x7')]])){utils[_0x09ca('0x17')](util[_0x09ca('0xa')]('[%s][calls][newexten]',_0x592d6e['uniqueid']),_0x592d6e);utils[_0x09ca('0x9')](util[_0x09ca('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x592d6e[_0x09ca('0x7')],_0x592d6e['application'],_0x592d6e['appdata']));if(_0x592d6e[_0x09ca('0x63')][_0x09ca('0x64')]()==_0x09ca('0x65')&&_['startsWith'](_0x592d6e['appdata'][_0x09ca('0x64')](),_0x09ca('0x66'))){var _0x1556b3=_0x592d6e[_0x09ca('0x67')][_0x09ca('0x68')]('=');var _0x205759=_0x1556b3[0x0][_0x09ca('0x69')](_0x1556b3[0x0][_0x09ca('0x6a')]('(')+0x1,_0x1556b3[0x0][_0x09ca('0x6a')](')'));var _0x523a7e=_0x1556b3[0x1];channels[_0x592d6e[_0x09ca('0x7')]][_0x205759]=_0x523a7e;}if(!_[_0x09ca('0x6b')]([_0x09ca('0x2a'),_0x09ca('0x6c'),_0x09ca('0x6d'),_0x09ca('0x65'),_0x09ca('0x6e')],_0x592d6e['application']['toLowerCase']())){channels[_0x592d6e[_0x09ca('0x7')]][_0x09ca('0x6f')]=_0x592d6e[_0x09ca('0x63')];channels[_0x592d6e[_0x09ca('0x7')]][_0x09ca('0x70')]=_0x592d6e[_0x09ca('0x67')];}}}catch(_0x39c71d){utils['error'](util[_0x09ca('0xa')]('[%s][calls][newexten]',_0x592d6e['uniqueid']),_0x39c71d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a14d4e5..a5d56f5 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 _0xe797=['error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','fullybooted','[core]\x20fullybooted'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xe797,0x1c6));var _0x7e79=function(_0x12f926,_0x4d1b9d){_0x12f926=_0x12f926-0x0;var _0x6bf288=_0xe797[_0x12f926];return _0x6bf288;};'use strict';var utils=require(_0x7e79('0x0'));exports[_0x7e79('0x1')]=function(){utils[_0x7e79('0x2')](_0x7e79('0x3'));};exports['shutdown']=function(){utils[_0x7e79('0x2')]('[core]\x20shutdown');};exports[_0x7e79('0x4')]=function(){utils['info'](_0x7e79('0x5'));};exports[_0x7e79('0x6')]=function(_0x12130f){utils[_0x7e79('0x6')](_0x7e79('0x7'),_0x12130f);};exports['close']=function(){utils[_0x7e79('0x2')](_0x7e79('0x8'));};exports[_0x7e79('0x9')]=function(_0x5540d8){}; \ No newline at end of file +var _0x30b8=['[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','info','[core]\x20connected','shutdown'];(function(_0x5308ec,_0x31413b){var _0x588eb8=function(_0x384626){while(--_0x384626){_0x5308ec['push'](_0x5308ec['shift']());}};_0x588eb8(++_0x31413b);}(_0x30b8,0x10b));var _0x830b=function(_0x123676,_0x106dfb){_0x123676=_0x123676-0x0;var _0x5e6bb2=_0x30b8[_0x123676];return _0x5e6bb2;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x830b('0x0')](_0x830b('0x1'));};exports[_0x830b('0x2')]=function(){utils[_0x830b('0x0')](_0x830b('0x3'));};exports[_0x830b('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0x830b('0x5')]=function(_0x32a823){utils[_0x830b('0x5')](_0x830b('0x6'),_0x32a823);};exports[_0x830b('0x7')]=function(){utils[_0x830b('0x0')](_0x830b('0x8'));};exports[_0x830b('0x9')]=function(_0x103553){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6dc9066..18beda7 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 _0xf219=['[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','isNil','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset'];(function(_0x366dc5,_0x2fad9c){var _0x2b664d=function(_0x384f72){while(--_0x384f72){_0x366dc5['push'](_0x366dc5['shift']());}};_0x2b664d(++_0x2fad9c);}(_0xf219,0x114));var _0x9f21=function(_0x45ec0b,_0x260c5d){_0x45ec0b=_0x45ec0b-0x0;var _0x99a3d8=_0xf219[_0x45ec0b];return _0x99a3d8;};'use strict';var _=require(_0x9f21('0x0'));var util=require(_0x9f21('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x424425){utils[_0x9f21('0x2')](util[_0x9f21('0x3')](_0x9f21('0x4'),_0x424425[_0x9f21('0x5')],_0x424425['channel'],_0x424425[_0x9f21('0x6')],_0x424425[_0x9f21('0x7')],_0x424425[_0x9f21('0x8')],_0x424425[_0x9f21('0x9')]));utils['request'](_0x9f21('0xa'),_0x424425);delete dials[_0x424425[_0x9f21('0x5')]];}exports[_0x9f21('0xb')]=function(_0x28e28e){try{utils[_0x9f21('0xc')](util['format'](_0x9f21('0xd'),_0x28e28e[_0x9f21('0x5')]),_0x28e28e);utils[_0x9f21('0x2')](util[_0x9f21('0x3')](_0x9f21('0xe'),_0x28e28e[_0x9f21('0x5')],_0x28e28e[_0x9f21('0xf')],_0x28e28e[_0x9f21('0x10')]));if(_0x28e28e['application'][_0x9f21('0x11')]()==_0x9f21('0x12')&&_[_0x9f21('0x13')](_0x28e28e['appdata'][_0x9f21('0x11')](),_0x9f21('0x14'))){var _0x1b05e9=_0x28e28e[_0x9f21('0x10')][_0x9f21('0x15')]('=');dials[_0x28e28e['uniqueid']]={'routeId':_0x1b05e9[0x1]};}}catch(_0x20e7d4){utils[_0x9f21('0x16')](util[_0x9f21('0x3')](_0x9f21('0xd'),_0x28e28e[_0x9f21('0x5')]),_0x20e7d4);}};exports[_0x9f21('0x17')]=function(_0x5849cd){try{utils[_0x9f21('0xc')](util[_0x9f21('0x3')](_0x9f21('0x18'),_0x5849cd[_0x9f21('0x5')]),_0x5849cd);if(!_['isNil'](_0x5849cd[_0x9f21('0x19')][_0x9f21('0x1a')])){utils[_0x9f21('0x2')](util[_0x9f21('0x3')](_0x9f21('0x1b'),_0x5849cd[_0x9f21('0x5')],_0x5849cd['value']));dials[_0x5849cd[_0x9f21('0x5')]]={'routeId':_0x5849cd['value']};}}catch(_0x3ef837){utils[_0x9f21('0x16')](util[_0x9f21('0x3')](_0x9f21('0x18'),_0x5849cd['uniqueid']),_0x3ef837);}};exports[_0x9f21('0x1c')]=function(_0x25d54e){try{if(!_['isNil'](dials[_0x25d54e['uniqueid']])){utils[_0x9f21('0xc')](util[_0x9f21('0x3')](_0x9f21('0x1d'),_0x25d54e[_0x9f21('0x5')]),_0x25d54e);dials[_0x25d54e[_0x9f21('0x5')]]=_[_0x9f21('0x1e')](dials[_0x25d54e[_0x9f21('0x5')]],_0x25d54e);dials[_0x25d54e[_0x9f21('0x5')]][_0x9f21('0x1f')]=utils[_0x9f21('0x20')]();dials[_0x25d54e[_0x9f21('0x5')]][_0x9f21('0x21')]=_0x9f21('0x22');utils['info'](util[_0x9f21('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x25d54e[_0x9f21('0x5')],dials[_0x25d54e[_0x9f21('0x5')]][_0x9f21('0x1f')]));}}catch(_0x401d7c){utils[_0x9f21('0x16')](util[_0x9f21('0x3')](_0x9f21('0x1d'),_0x25d54e['uniqueid']),_0x401d7c);}};exports['dialend']=function(_0x102eca){try{if(!_[_0x9f21('0x23')](dials[_0x102eca['uniqueid']])){utils['debug'](util[_0x9f21('0x3')](_0x9f21('0x24'),_0x102eca[_0x9f21('0x5')]),_0x102eca);dials[_0x102eca[_0x9f21('0x5')]][_0x9f21('0x9')]=_0x102eca[_0x9f21('0x9')];if(_0x102eca[_0x9f21('0x9')]==_0x9f21('0x25')){dials[_0x102eca[_0x9f21('0x5')]]=_[_0x9f21('0x1e')](dials[_0x102eca['uniqueid']],_0x102eca);dials[_0x102eca['uniqueid']]['answertime']=utils[_0x9f21('0x20')]();dials[_0x102eca['uniqueid']][_0x9f21('0x21')]=_0x9f21('0x26');utils['info'](util['format'](_0x9f21('0x27'),_0x102eca['uniqueid'],_0x102eca[_0x9f21('0x9')],dials[_0x102eca[_0x9f21('0x5')]][_0x9f21('0x28')]));}else{utils['info'](util[_0x9f21('0x3')](_0x9f21('0x29'),_0x102eca[_0x9f21('0x5')],_0x102eca[_0x9f21('0x9')]));}}}catch(_0x4dc620){utils[_0x9f21('0x16')](util['format'](_0x9f21('0x24'),_0x102eca[_0x9f21('0x5')]),_0x4dc620);}};exports['hangup']=function(_0x3dc375){try{if(!_[_0x9f21('0x23')](dials[_0x3dc375[_0x9f21('0x5')]])){utils[_0x9f21('0xc')](util[_0x9f21('0x3')](_0x9f21('0x2a'),_0x3dc375['uniqueid']),_0x3dc375);utils['info'](util[_0x9f21('0x3')](_0x9f21('0x2b'),_0x3dc375[_0x9f21('0x5')],_0x3dc375[_0x9f21('0x7')],_0x3dc375[_0x9f21('0x2c')],_0x3dc375[_0x9f21('0x2d')]));dials[_0x3dc375[_0x9f21('0x5')]]=_[_0x9f21('0x1e')](dials[_0x3dc375[_0x9f21('0x5')]],{'endtime':utils[_0x9f21('0x20')](),'lastevent':_0x9f21('0x2e')});dials[_0x3dc375[_0x9f21('0x5')]][_0x9f21('0x2f')]=utils[_0x9f21('0x30')](dials[_0x3dc375[_0x9f21('0x5')]]['endtime'],dials[_0x3dc375['uniqueid']][_0x9f21('0x1f')]);dials[_0x3dc375[_0x9f21('0x5')]]['holdtime']=utils[_0x9f21('0x30')](dials[_0x3dc375[_0x9f21('0x5')]][_0x9f21('0x28')]||dials[_0x3dc375[_0x9f21('0x5')]][_0x9f21('0x31')],dials[_0x3dc375[_0x9f21('0x5')]][_0x9f21('0x1f')]);dials[_0x3dc375[_0x9f21('0x5')]]['billableseconds']=dials[_0x3dc375[_0x9f21('0x5')]][_0x9f21('0x28')]?utils['diffTime'](dials[_0x3dc375['uniqueid']][_0x9f21('0x31')],dials[_0x3dc375[_0x9f21('0x5')]]['answertime']):0x0;writeDB(dials[_0x3dc375['uniqueid']]);}}catch(_0x40570f){utils[_0x9f21('0x16')](util['format'](_0x9f21('0x2a'),_0x3dc375[_0x9f21('0x5')]),_0x40570f);}}; \ No newline at end of file +var _0xb74f=['[%s][dials][dialend]','dialstatus','[%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','calleridname','cause-txt','complete','duration','endtime','diffTime','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','error','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x2659fd,_0x4325e4){var _0x4adb2f=function(_0x48d0f9){while(--_0x48d0f9){_0x2659fd['push'](_0x2659fd['shift']());}};_0x4adb2f(++_0x4325e4);}(_0xb74f,0xa4));var _0xfb74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb74f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb74('0x0'));var util=require(_0xfb74('0x1'));var utils=require(_0xfb74('0x2'));var dials={};function writeDB(_0x5243a7){utils['info'](util[_0xfb74('0x3')](_0xfb74('0x4'),_0x5243a7[_0xfb74('0x5')],_0x5243a7[_0xfb74('0x6')],_0x5243a7[_0xfb74('0x7')],_0x5243a7[_0xfb74('0x8')],_0x5243a7[_0xfb74('0x9')],_0x5243a7['dialstatus']));utils[_0xfb74('0xa')](_0xfb74('0xb'),_0x5243a7);delete dials[_0x5243a7[_0xfb74('0x5')]];}exports[_0xfb74('0xc')]=function(_0x5b7950){try{utils['debug'](util[_0xfb74('0x3')](_0xfb74('0xd'),_0x5b7950[_0xfb74('0x5')]),_0x5b7950);utils[_0xfb74('0xe')](util[_0xfb74('0x3')](_0xfb74('0xf'),_0x5b7950[_0xfb74('0x5')],_0x5b7950['application'],_0x5b7950[_0xfb74('0x10')]));if(_0x5b7950[_0xfb74('0x11')][_0xfb74('0x12')]()==_0xfb74('0x13')&&_[_0xfb74('0x14')](_0x5b7950[_0xfb74('0x10')][_0xfb74('0x12')](),'cdr(routeid)')){var _0x5237e3=_0x5b7950[_0xfb74('0x10')]['split']('=');dials[_0x5b7950[_0xfb74('0x5')]]={'routeId':_0x5237e3[0x1]};}}catch(_0x46bf55){utils[_0xfb74('0x15')](util['format']('[%s][dials][newexten]',_0x5b7950[_0xfb74('0x5')]),_0x46bf55);}};exports['varset']=function(_0x9c19d2){try{utils[_0xfb74('0x16')](util['format'](_0xfb74('0x17'),_0x9c19d2[_0xfb74('0x5')]),_0x9c19d2);if(!_[_0xfb74('0x18')](_0x9c19d2[_0xfb74('0x19')][_0xfb74('0x1a')])){utils[_0xfb74('0xe')](util[_0xfb74('0x3')](_0xfb74('0x1b'),_0x9c19d2[_0xfb74('0x5')],_0x9c19d2[_0xfb74('0x1c')]));dials[_0x9c19d2[_0xfb74('0x5')]]={'routeId':_0x9c19d2[_0xfb74('0x1c')]};}}catch(_0x57aa6f){utils[_0xfb74('0x15')](util[_0xfb74('0x3')]('[%s][dials][varset]',_0x9c19d2[_0xfb74('0x5')]),_0x57aa6f);}};exports[_0xfb74('0x1d')]=function(_0x4080d9){try{if(!_['isNil'](dials[_0x4080d9[_0xfb74('0x5')]])){utils[_0xfb74('0x16')](util['format']('[%s][dials][dialbegin]',_0x4080d9['uniqueid']),_0x4080d9);dials[_0x4080d9[_0xfb74('0x5')]]=_[_0xfb74('0x1e')](dials[_0x4080d9[_0xfb74('0x5')]],_0x4080d9);dials[_0x4080d9[_0xfb74('0x5')]][_0xfb74('0x1f')]=utils[_0xfb74('0x20')]();dials[_0x4080d9[_0xfb74('0x5')]][_0xfb74('0x21')]='called';utils[_0xfb74('0xe')](util[_0xfb74('0x3')](_0xfb74('0x22'),_0x4080d9[_0xfb74('0x5')],dials[_0x4080d9[_0xfb74('0x5')]]['starttime']));}}catch(_0x55b8a0){utils[_0xfb74('0x15')](util[_0xfb74('0x3')]('[%s][dials][dialbegin]',_0x4080d9[_0xfb74('0x5')]),_0x55b8a0);}};exports[_0xfb74('0x23')]=function(_0x1c245d){try{if(!_[_0xfb74('0x18')](dials[_0x1c245d[_0xfb74('0x5')]])){utils['debug'](util[_0xfb74('0x3')](_0xfb74('0x24'),_0x1c245d[_0xfb74('0x5')]),_0x1c245d);dials[_0x1c245d['uniqueid']]['dialstatus']=_0x1c245d[_0xfb74('0x25')];if(_0x1c245d['dialstatus']=='ANSWER'){dials[_0x1c245d[_0xfb74('0x5')]]=_[_0xfb74('0x1e')](dials[_0x1c245d['uniqueid']],_0x1c245d);dials[_0x1c245d[_0xfb74('0x5')]]['answertime']=utils['now']();dials[_0x1c245d['uniqueid']]['lastevent']='connect';utils[_0xfb74('0xe')](util[_0xfb74('0x3')](_0xfb74('0x26'),_0x1c245d[_0xfb74('0x5')],_0x1c245d['dialstatus'],dials[_0x1c245d[_0xfb74('0x5')]][_0xfb74('0x27')]));}else{utils[_0xfb74('0xe')](util['format'](_0xfb74('0x28'),_0x1c245d[_0xfb74('0x5')],_0x1c245d[_0xfb74('0x25')]));}}}catch(_0x10a558){utils[_0xfb74('0x15')](util[_0xfb74('0x3')](_0xfb74('0x24'),_0x1c245d['uniqueid']),_0x10a558);}};exports[_0xfb74('0x29')]=function(_0x384e8c){try{if(!_[_0xfb74('0x18')](dials[_0x384e8c['uniqueid']])){utils[_0xfb74('0x16')](util[_0xfb74('0x3')]('[%s][dials][hangup]',_0x384e8c['uniqueid']),_0x384e8c);utils['info'](util['format'](_0xfb74('0x2a'),_0x384e8c[_0xfb74('0x5')],_0x384e8c['calleridnum'],_0x384e8c[_0xfb74('0x2b')],_0x384e8c[_0xfb74('0x2c')]));dials[_0x384e8c['uniqueid']]=_[_0xfb74('0x1e')](dials[_0x384e8c[_0xfb74('0x5')]],{'endtime':utils[_0xfb74('0x20')](),'lastevent':_0xfb74('0x2d')});dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x2e')]=utils['diffTime'](dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x2f')],dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x1f')]);dials[_0x384e8c[_0xfb74('0x5')]]['holdtime']=utils[_0xfb74('0x30')](dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x27')]||dials[_0x384e8c['uniqueid']][_0xfb74('0x2f')],dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x1f')]);dials[_0x384e8c[_0xfb74('0x5')]]['billableseconds']=dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x27')]?utils[_0xfb74('0x30')](dials[_0x384e8c[_0xfb74('0x5')]][_0xfb74('0x2f')],dials[_0x384e8c['uniqueid']][_0xfb74('0x27')]):0x0;writeDB(dials[_0x384e8c[_0xfb74('0x5')]]);}}catch(_0x30a608){utils[_0xfb74('0x15')](util[_0xfb74('0x3')](_0xfb74('0x31'),_0x384e8c['uniqueid']),_0x30a608);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 98c1e02..47431de 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 _0x898b=['debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','keepConnected','xdr','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent'];(function(_0x295e3f,_0xd46212){var _0xd9139b=function(_0x29b7f3){while(--_0x29b7f3){_0x295e3f['push'](_0x295e3f['shift']());}};_0xd9139b(++_0xd46212);}(_0x898b,0x1bf));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0xb898('0x0'));var config=require(_0xb898('0x1'));var utils=require(_0xb898('0x2'));var util=require(_0xb898('0x3'));var ami=new AsteriskManager(config[_0xb898('0x4')][_0xb898('0x5')],config['asterisk']['ip'],config[_0xb898('0x4')]['username'],config['asterisk'][_0xb898('0x6')],!![]);ami[_0xb898('0x7')]();if(config[_0xb898('0x8')]&&config[_0xb898('0x8')]['disabled']){utils[_0xb898('0x9')](_0xb898('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xb898('0xb'));var queues=require(_0xb898('0xc'));var recordings=require('./recordings.controller');var members=require(_0xb898('0xd'));var dials=require(_0xb898('0xe'));var transfers=require(_0xb898('0xf'));var core=require(_0xb898('0x10'));ami['on'](_0xb898('0x11'),core[_0xb898('0x11')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xb898('0x12'),core[_0xb898('0x12')]);ami['on'](_0xb898('0x13'),core['error']);ami['on'](_0xb898('0x14'),core[_0xb898('0x14')]);ami['on'](_0xb898('0x15'),core[_0xb898('0x15')]);ami['on']('devicestatechange',function(_0x27f851){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x18'),_0x27f851[_0xb898('0x19')]),_0x27f851);members[_0xb898('0x1a')](_0x27f851);}catch(_0x155397){utils['error'](util[_0xb898('0x17')](_0xb898('0x18'),_0x27f851[_0xb898('0x19')]),_0x155397);}});ami['on'](_0xb898('0x1b'),function(_0x414055){try{utils['debug'](util[_0xb898('0x17')](_0xb898('0x1c'),_0x414055[_0xb898('0x1d')]),_0x414055);agents[_0xb898('0x1b')](_0x414055);}catch(_0x59db78){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x1c'),_0x414055['uniqueid']),_0x59db78);}});ami['on'](_0xb898('0x1e'),function(_0x1a0dad){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x1f'),_0x1a0dad[_0xb898('0x1d')]),_0x1a0dad);agents['agentringnoanswer'](_0x1a0dad);}catch(_0x32eae8){utils['error'](util[_0xb898('0x17')](_0xb898('0x1f'),_0x1a0dad[_0xb898('0x1d')]),_0x32eae8);}});ami['on'](_0xb898('0x20'),function(_0x1240bf){try{utils[_0xb898('0x16')](util['format'](_0xb898('0x21'),_0x1240bf['uniqueid']),_0x1240bf);agents[_0xb898('0x20')](_0x1240bf);queues[_0xb898('0x20')](_0x1240bf);}catch(_0x19e69e){utils[_0xb898('0x13')](util[_0xb898('0x17')]('[%s][index][agentconnect]',_0x1240bf['uniqueid']),_0x19e69e);}});ami['on'](_0xb898('0x22'),function(_0x18a1d8){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x23'),_0x18a1d8[_0xb898('0x1d')]),_0x18a1d8);agents[_0xb898('0x22')](_0x18a1d8);queues[_0xb898('0x22')](_0x18a1d8);members[_0xb898('0x22')](_0x18a1d8);}catch(_0x120167){utils[_0xb898('0x13')](util['format'](_0xb898('0x23'),_0x18a1d8[_0xb898('0x1d')]),_0x120167);}});ami['on'](_0xb898('0x24'),function(_0x27e920){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x25'),_0x27e920[_0xb898('0x1d')]),_0x27e920);agents[_0xb898('0x24')](_0x27e920);queues['queuecallerabandon'](_0x27e920);}catch(_0x2ab099){utils['error'](util['format'](_0xb898('0x25'),_0x27e920['uniqueid']),_0x2ab099);}});ami['on'](_0xb898('0x26'),function(_0xfeca5a){try{utils['debug'](util[_0xb898('0x17')](_0xb898('0x27'),_0xfeca5a[_0xb898('0x1d')]),_0xfeca5a);queues['queuecallerjoin'](_0xfeca5a);recordings[_0xb898('0x26')](_0xfeca5a);}catch(_0x48ed76){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x27'),_0xfeca5a[_0xb898('0x1d')]),_0x48ed76);}});ami['on']('queuecallerleave',function(_0x4be287){try{utils[_0xb898('0x16')](util[_0xb898('0x17')]('[%s][index][queuecallerleave]',_0x4be287[_0xb898('0x1d')]),_0x4be287);queues[_0xb898('0x28')](_0x4be287);}catch(_0x2daf31){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x29'),_0x4be287['uniqueid']),_0x2daf31);}});ami['on']('musiconholdstart',function(_0x146d62){try{utils[_0xb898('0x16')](util['format'](_0xb898('0x2a'),_0x146d62[_0xb898('0x1d')]),_0x146d62);queues[_0xb898('0x2b')](_0x146d62);calls[_0xb898('0x2b')](_0x146d62);}catch(_0x31080e){utils[_0xb898('0x13')](util['format'](_0xb898('0x2a'),_0x146d62['uniqueid']),_0x31080e);}});ami['on']('musiconholdstop',function(_0xb1a97e){try{utils[_0xb898('0x16')](util['format']('[%s][index][musiconholdstop]',_0xb1a97e[_0xb898('0x1d')]),_0xb1a97e);queues[_0xb898('0x2c')](_0xb1a97e);calls['musiconholdstop'](_0xb1a97e);}catch(_0xcbf0f2){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x2d'),_0xb1a97e[_0xb898('0x1d')]),_0xcbf0f2);}});ami['on'](_0xb898('0x2e'),function(_0x10cadd){try{utils['debug'](util[_0xb898('0x17')](_0xb898('0x2f'),_0x10cadd[_0xb898('0x1d')]),_0x10cadd);calls[_0xb898('0x2e')](_0x10cadd);recordings[_0xb898('0x2e')](_0x10cadd);}catch(_0x29cb49){utils[_0xb898('0x13')](util[_0xb898('0x17')]('[%s][index][newstate]',_0x10cadd[_0xb898('0x1d')]),_0x29cb49);}});ami['on']('hangup',function(_0x2fda82){try{utils['debug'](util[_0xb898('0x17')](_0xb898('0x30'),_0x2fda82[_0xb898('0x1d')]),_0x2fda82);calls[_0xb898('0x31')](_0x2fda82);recordings[_0xb898('0x31')](_0x2fda82);dials['hangup'](_0x2fda82);agents[_0xb898('0x31')](_0x2fda82);queues[_0xb898('0x31')](_0x2fda82);}catch(_0x78aa7a){utils['error'](util[_0xb898('0x17')](_0xb898('0x30'),_0x2fda82['uniqueid']),_0x78aa7a);}});ami['on']('cdr',function(_0x327026){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x32'),_0x327026[_0xb898('0x1d')]),_0x327026);members[_0xb898('0x33')](_0x327026);}catch(_0x5320b2){utils['error'](util[_0xb898('0x17')](_0xb898('0x32'),_0x327026[_0xb898('0x1d')]),_0x5320b2);}});ami['on'](_0xb898('0x34'),function(_0x5599f9){try{utils[_0xb898('0x16')](util['format'](_0xb898('0x35'),_0x5599f9[_0xb898('0x1d')]),_0x5599f9);queues['blindtransfer'](_0x5599f9);agents[_0xb898('0x34')](_0x5599f9);transfers[_0xb898('0x34')](_0x5599f9);recordings[_0xb898('0x34')](_0x5599f9);}catch(_0x10ec16){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x35'),_0x5599f9[_0xb898('0x1d')]),_0x10ec16);}});ami['on'](_0xb898('0x36'),function(_0x44ddf7){try{utils[_0xb898('0x16')](util['format'](_0xb898('0x37'),_0x44ddf7[_0xb898('0x38')]),_0x44ddf7);queues[_0xb898('0x36')](_0x44ddf7);transfers[_0xb898('0x36')](_0x44ddf7);agents['attendedtransfer'](_0x44ddf7);calls['attendedtransfer'](_0x44ddf7);}catch(_0x4884f2){utils[_0xb898('0x13')](util[_0xb898('0x17')]('[%s][index][attendedtransfer]',_0x44ddf7[_0xb898('0x38')]),_0x4884f2);}});ami['on'](_0xb898('0x39'),function(_0x1cd2ae){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x3a'),_0x1cd2ae[_0xb898('0x1d')]),_0x1cd2ae);queues[_0xb898('0x39')](_0x1cd2ae);recordings['varset'](_0x1cd2ae);calls[_0xb898('0x39')](_0x1cd2ae);dials[_0xb898('0x39')](_0x1cd2ae);}catch(_0x464da3){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x3a'),_0x1cd2ae[_0xb898('0x1d')]),_0x464da3);}});ami['on']('newexten',function(_0x5257a4){try{utils['debug'](util['format'](_0xb898('0x3b'),_0x5257a4[_0xb898('0x1d')]),_0x5257a4);calls['newexten'](_0x5257a4);recordings[_0xb898('0x3c')](_0x5257a4);dials['newexten'](_0x5257a4);}catch(_0x12068d){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x3b'),_0x5257a4[_0xb898('0x1d')]),_0x12068d);}});ami['on'](_0xb898('0x3d'),function(_0x1f380c){try{utils[_0xb898('0x16')](util[_0xb898('0x17')](_0xb898('0x3e'),_0x1f380c[_0xb898('0x1d')]),_0x1f380c);calls[_0xb898('0x3d')](_0x1f380c);recordings[_0xb898('0x3d')](_0x1f380c);}catch(_0x49c0a2){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x3e'),_0x1f380c[_0xb898('0x1d')]),_0x49c0a2);}});ami['on']('dialbegin',function(_0x1bbbcc){try{utils['debug'](util['format']('[%s][index][dialbegin]',_0x1bbbcc[_0xb898('0x1d')]),_0x1bbbcc);dials[_0xb898('0x3f')](_0x1bbbcc);}catch(_0x2842b1){utils['error'](util['format'](_0xb898('0x40'),_0x1bbbcc[_0xb898('0x1d')]),_0x2842b1);}});ami['on'](_0xb898('0x41'),function(_0xf1df04){try{utils['debug'](util[_0xb898('0x17')](_0xb898('0x42'),_0xf1df04['uniqueid']),_0xf1df04);dials[_0xb898('0x41')](_0xf1df04);}catch(_0x547dcc){utils[_0xb898('0x13')](util[_0xb898('0x17')](_0xb898('0x42'),_0xf1df04['uniqueid']),_0x547dcc);}});} \ No newline at end of file +var _0x0564=['[%s][index][devicestatechange]','device','agentcalled','debug','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','port','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x0564,0xfb));var _0x4056=function(_0x19dfa0,_0x39dcae){_0x19dfa0=_0x19dfa0-0x0;var _0x5d4d22=_0x0564[_0x19dfa0];return _0x5d4d22;};var AsteriskManager=require(_0x4056('0x0'));var config=require('../../config/environment');var utils=require(_0x4056('0x1'));var util=require(_0x4056('0x2'));var ami=new AsteriskManager(config[_0x4056('0x3')][_0x4056('0x4')],config[_0x4056('0x3')]['ip'],config['asterisk']['username'],config[_0x4056('0x3')][_0x4056('0x5')],!![]);ami[_0x4056('0x6')]();if(config[_0x4056('0x7')]&&config['xdr'][_0x4056('0x8')]){utils['info'](_0x4056('0x9'));}else{var agents=require(_0x4056('0xa'));var calls=require(_0x4056('0xb'));var queues=require(_0x4056('0xc'));var recordings=require(_0x4056('0xd'));var members=require(_0x4056('0xe'));var dials=require(_0x4056('0xf'));var transfers=require('./transfers.controller');var core=require(_0x4056('0x10'));ami['on']('connect',core[_0x4056('0x11')]);ami['on']('shutdown',core[_0x4056('0x12')]);ami['on'](_0x4056('0x13'),core['fullybooted']);ami['on']('error',core[_0x4056('0x14')]);ami['on'](_0x4056('0x15'),core[_0x4056('0x15')]);ami['on'](_0x4056('0x16'),core['managerevent']);ami['on'](_0x4056('0x17'),function(_0x5bad97){try{utils['debug'](util[_0x4056('0x18')](_0x4056('0x19'),_0x5bad97[_0x4056('0x1a')]),_0x5bad97);members['devicestatechange'](_0x5bad97);}catch(_0x753cd9){utils[_0x4056('0x14')](util['format']('[%s][index][devicestatechange]',_0x5bad97['device']),_0x753cd9);}});ami['on'](_0x4056('0x1b'),function(_0x2bb467){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')]('[%s][index][agentcalled]',_0x2bb467[_0x4056('0x1d')]),_0x2bb467);agents[_0x4056('0x1b')](_0x2bb467);}catch(_0x5b301d){utils[_0x4056('0x14')](util['format'](_0x4056('0x1e'),_0x2bb467[_0x4056('0x1d')]),_0x5b301d);}});ami['on'](_0x4056('0x1f'),function(_0xcfd79e){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x20'),_0xcfd79e[_0x4056('0x1d')]),_0xcfd79e);agents['agentringnoanswer'](_0xcfd79e);}catch(_0x36766e){utils['error'](util[_0x4056('0x18')]('[%s][index][agentringnoanswer]',_0xcfd79e[_0x4056('0x1d')]),_0x36766e);}});ami['on'](_0x4056('0x21'),function(_0x18d940){try{utils['debug'](util[_0x4056('0x18')]('[%s][index][agentconnect]',_0x18d940[_0x4056('0x1d')]),_0x18d940);agents[_0x4056('0x21')](_0x18d940);queues[_0x4056('0x21')](_0x18d940);}catch(_0x88cab7){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x22'),_0x18d940[_0x4056('0x1d')]),_0x88cab7);}});ami['on'](_0x4056('0x23'),function(_0x381edb){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x24'),_0x381edb[_0x4056('0x1d')]),_0x381edb);agents[_0x4056('0x23')](_0x381edb);queues[_0x4056('0x23')](_0x381edb);members[_0x4056('0x23')](_0x381edb);}catch(_0x5aee45){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x24'),_0x381edb['uniqueid']),_0x5aee45);}});ami['on'](_0x4056('0x25'),function(_0x39b2cf){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')]('[%s][index][queuecallerabandon]',_0x39b2cf[_0x4056('0x1d')]),_0x39b2cf);agents['queuecallerabandon'](_0x39b2cf);queues[_0x4056('0x25')](_0x39b2cf);}catch(_0x1eabd6){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x26'),_0x39b2cf[_0x4056('0x1d')]),_0x1eabd6);}});ami['on'](_0x4056('0x27'),function(_0x3a962){try{utils['debug'](util[_0x4056('0x18')](_0x4056('0x28'),_0x3a962['uniqueid']),_0x3a962);queues[_0x4056('0x27')](_0x3a962);recordings[_0x4056('0x27')](_0x3a962);}catch(_0x235be8){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x28'),_0x3a962[_0x4056('0x1d')]),_0x235be8);}});ami['on'](_0x4056('0x29'),function(_0x281a79){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')]('[%s][index][queuecallerleave]',_0x281a79['uniqueid']),_0x281a79);queues['queuecallerleave'](_0x281a79);}catch(_0x44749c){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x2a'),_0x281a79[_0x4056('0x1d')]),_0x44749c);}});ami['on']('musiconholdstart',function(_0x35c065){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x2b'),_0x35c065[_0x4056('0x1d')]),_0x35c065);queues[_0x4056('0x2c')](_0x35c065);calls[_0x4056('0x2c')](_0x35c065);}catch(_0x4effbd){utils['error'](util['format'](_0x4056('0x2b'),_0x35c065[_0x4056('0x1d')]),_0x4effbd);}});ami['on'](_0x4056('0x2d'),function(_0x287dc3){try{utils['debug'](util[_0x4056('0x18')](_0x4056('0x2e'),_0x287dc3['uniqueid']),_0x287dc3);queues[_0x4056('0x2d')](_0x287dc3);calls[_0x4056('0x2d')](_0x287dc3);}catch(_0x2318de){utils[_0x4056('0x14')](util['format'](_0x4056('0x2e'),_0x287dc3[_0x4056('0x1d')]),_0x2318de);}});ami['on'](_0x4056('0x2f'),function(_0x3f6330){try{utils['debug'](util[_0x4056('0x18')]('[%s][index][newstate]',_0x3f6330['uniqueid']),_0x3f6330);calls['newstate'](_0x3f6330);recordings[_0x4056('0x2f')](_0x3f6330);}catch(_0x1751ca){utils['error'](util[_0x4056('0x18')](_0x4056('0x30'),_0x3f6330[_0x4056('0x1d')]),_0x1751ca);}});ami['on'](_0x4056('0x31'),function(_0x5df071){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x32'),_0x5df071[_0x4056('0x1d')]),_0x5df071);calls[_0x4056('0x31')](_0x5df071);recordings[_0x4056('0x31')](_0x5df071);dials[_0x4056('0x31')](_0x5df071);agents[_0x4056('0x31')](_0x5df071);queues['hangup'](_0x5df071);}catch(_0x11e2bb){utils[_0x4056('0x14')](util['format'](_0x4056('0x32'),_0x5df071[_0x4056('0x1d')]),_0x11e2bb);}});ami['on']('cdr',function(_0x2add91){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x33'),_0x2add91['uniqueid']),_0x2add91);members[_0x4056('0x34')](_0x2add91);}catch(_0x1de7f8){utils[_0x4056('0x14')](util['format'](_0x4056('0x33'),_0x2add91[_0x4056('0x1d')]),_0x1de7f8);}});ami['on'](_0x4056('0x35'),function(_0x1b2877){try{utils[_0x4056('0x1c')](util['format'](_0x4056('0x36'),_0x1b2877['uniqueid']),_0x1b2877);queues['blindtransfer'](_0x1b2877);agents[_0x4056('0x35')](_0x1b2877);transfers[_0x4056('0x35')](_0x1b2877);recordings['blindtransfer'](_0x1b2877);}catch(_0x449682){utils['error'](util[_0x4056('0x18')](_0x4056('0x36'),_0x1b2877[_0x4056('0x1d')]),_0x449682);}});ami['on']('attendedtransfer',function(_0x3cd52a){try{utils['debug'](util['format'](_0x4056('0x37'),_0x3cd52a[_0x4056('0x38')]),_0x3cd52a);queues[_0x4056('0x39')](_0x3cd52a);transfers[_0x4056('0x39')](_0x3cd52a);agents[_0x4056('0x39')](_0x3cd52a);calls[_0x4056('0x39')](_0x3cd52a);}catch(_0x13d6a0){utils[_0x4056('0x14')](util['format'](_0x4056('0x37'),_0x3cd52a[_0x4056('0x38')]),_0x13d6a0);}});ami['on'](_0x4056('0x3a'),function(_0x430943){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x3b'),_0x430943[_0x4056('0x1d')]),_0x430943);queues[_0x4056('0x3a')](_0x430943);recordings['varset'](_0x430943);calls['varset'](_0x430943);dials['varset'](_0x430943);}catch(_0x4143a3){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x3b'),_0x430943['uniqueid']),_0x4143a3);}});ami['on'](_0x4056('0x3c'),function(_0x312eeb){try{utils['debug'](util[_0x4056('0x18')](_0x4056('0x3d'),_0x312eeb[_0x4056('0x1d')]),_0x312eeb);calls[_0x4056('0x3c')](_0x312eeb);recordings[_0x4056('0x3c')](_0x312eeb);dials['newexten'](_0x312eeb);}catch(_0x2a0acd){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x3d'),_0x312eeb[_0x4056('0x1d')]),_0x2a0acd);}});ami['on'](_0x4056('0x3e'),function(_0x29b1de){try{utils['debug'](util[_0x4056('0x18')](_0x4056('0x3f'),_0x29b1de['uniqueid']),_0x29b1de);calls['newchannel'](_0x29b1de);recordings[_0x4056('0x3e')](_0x29b1de);}catch(_0x203eca){utils[_0x4056('0x14')](util[_0x4056('0x18')]('[%s][index][newchannel]',_0x29b1de[_0x4056('0x1d')]),_0x203eca);}});ami['on']('dialbegin',function(_0x2e3a25){try{utils['debug'](util['format'](_0x4056('0x40'),_0x2e3a25[_0x4056('0x1d')]),_0x2e3a25);dials[_0x4056('0x41')](_0x2e3a25);}catch(_0x559f7b){utils['error'](util[_0x4056('0x18')](_0x4056('0x42'),_0x2e3a25[_0x4056('0x1d')]),_0x559f7b);}});ami['on'](_0x4056('0x43'),function(_0x3aab52){try{utils[_0x4056('0x1c')](util[_0x4056('0x18')](_0x4056('0x44'),_0x3aab52[_0x4056('0x1d')]),_0x3aab52);dials['dialend'](_0x3aab52);}catch(_0x3a5472){utils[_0x4056('0x14')](util[_0x4056('0x18')](_0x4056('0x44'),_0x3aab52[_0x4056('0x1d')]),_0x3a5472);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e234ce2..128e4a6 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 _0xfd65=['startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','voice','TALKING','now','NOT_INUSE','isNil','exitAt','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','getUserByInterface','then','membername','internal','CreateMemberReport','split','name','request','catch','[%s][members][writeDB]'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xfd65,0x13d));var _0x5fd6=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xfd65[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x5fd6('0x0'),_0x5fd6('0x1')];function writeDB(_0x47ea01){utils[_0x5fd6('0x2')](util[_0x5fd6('0x3')](_0x5fd6('0x4'),_0x47ea01[_0x5fd6('0x5')],_0x47ea01[_0x5fd6('0x6')],_0x47ea01[_0x5fd6('0x7')],_0x47ea01[_0x5fd6('0x8')],_0x47ea01['membername'],_0x47ea01['type']));if(_0x47ea01[_0x5fd6('0x6')]){utils[_0x5fd6('0x9')](_0x47ea01[_0x5fd6('0x6')])[_0x5fd6('0xa')](function(_0x5bd7a8){if(_0x5bd7a8){_0x47ea01[_0x5fd6('0xb')]=_0x5bd7a8['name'];_0x47ea01[_0x5fd6('0xc')]=_0x5bd7a8[_0x5fd6('0xc')];utils['request'](_0x5fd6('0xd'),_0x47ea01);}else{utils['getUserByName'](_0x47ea01[_0x5fd6('0x6')][_0x5fd6('0xe')]('/')[0x1])[_0x5fd6('0xa')](function(_0x5a9ae0){if(_0x5a9ae0){_0x47ea01[_0x5fd6('0xb')]=_0x5a9ae0[_0x5fd6('0xf')];_0x47ea01[_0x5fd6('0xc')]=_0x5a9ae0[_0x5fd6('0xc')];utils[_0x5fd6('0x10')](_0x5fd6('0xd'),_0x47ea01);}});}})[_0x5fd6('0x11')](function(_0x5c601a){utils['error'](util[_0x5fd6('0x3')](_0x5fd6('0x12'),_0x47ea01[_0x5fd6('0x5')]),_0x5c601a);});}delete members[_0x47ea01[_0x5fd6('0x6')]];}function startsWith(_0x531e05,_0x455114){return _['some'](_0x531e05,function(_0x39c902){return _[_0x5fd6('0x13')](_0x455114,_0x39c902);});}exports[_0x5fd6('0x14')]=function(_0x258b05){try{utils[_0x5fd6('0x15')](util[_0x5fd6('0x3')](_0x5fd6('0x16'),members[_0x258b05[_0x5fd6('0x17')]]?members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x5')]:_0x258b05[_0x5fd6('0x17')]),_0x258b05);utils[_0x5fd6('0x2')](util[_0x5fd6('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x258b05['device']]?members[_0x258b05['device']][_0x5fd6('0x5')]:_0x258b05[_0x5fd6('0x17')],_0x258b05[_0x5fd6('0x18')],_0x258b05[_0x5fd6('0x17')]));switch(_0x258b05[_0x5fd6('0x18')]){case _0x5fd6('0x19'):case'BUSY':if(!startsWith(exclude,_0x258b05[_0x5fd6('0x17')])){members[_0x258b05[_0x5fd6('0x17')]]={'channel':_0x5fd6('0x1a'),'interface':_0x258b05[_0x5fd6('0x17')],'type':_0x5fd6('0x1b'),'enterAt':utils[_0x5fd6('0x1c')](),'role':'agent'};}break;case _0x5fd6('0x1d'):if(!_[_0x5fd6('0x1e')](members[_0x258b05[_0x5fd6('0x17')]])){members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x1f')]=utils[_0x5fd6('0x1c')]();members[_0x258b05[_0x5fd6('0x17')]]['duration']=utils['diffTime'](members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x1f')],members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x20')]);if(members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x5')]){writeDB(members[_0x258b05[_0x5fd6('0x17')]]);}}break;default:break;}}catch(_0x103d70){utils[_0x5fd6('0x21')](util[_0x5fd6('0x3')](_0x5fd6('0x16'),members[_0x258b05[_0x5fd6('0x17')]]?members[_0x258b05[_0x5fd6('0x17')]][_0x5fd6('0x5')]:_0x258b05['device']),_0x103d70);}};exports[_0x5fd6('0x22')]=function(_0x23ff96){try{if(!_[_0x5fd6('0x1e')](members[_0x23ff96[_0x5fd6('0x6')]])){utils['debug'](util['format'](_0x5fd6('0x23'),_0x23ff96['uniqueid']),_0x23ff96);utils[_0x5fd6('0x2')](util['format'](_0x5fd6('0x24'),_0x23ff96['uniqueid'],_0x23ff96[_0x5fd6('0x6')],_0x23ff96[_0x5fd6('0x25')]));members[_0x23ff96[_0x5fd6('0x6')]]=_[_0x5fd6('0x26')](members[_0x23ff96[_0x5fd6('0x6')]],{'data4':_0x23ff96['queue'],'uniqueid':_0x23ff96['uniqueid']});}}catch(_0x236a6e){utils[_0x5fd6('0x21')](util[_0x5fd6('0x3')](_0x5fd6('0x23'),_0x23ff96['uniqueid']),_0x236a6e);}};exports[_0x5fd6('0x27')]=function(_0x314c1c){try{utils[_0x5fd6('0x15')](util['format'](_0x5fd6('0x28'),_0x314c1c[_0x5fd6('0x5')]),_0x314c1c);if(_0x314c1c[_0x5fd6('0x7')]){var _0x52000b=_0x314c1c['channel']['split']('-')[0x0];if(!_[_0x5fd6('0x1e')](members[_0x52000b])){members[_0x52000b]=_[_0x5fd6('0x26')](members[_0x52000b],{'data1':members[_0x52000b][_0x5fd6('0x29')]||_0x314c1c[_0x5fd6('0x2a')],'data2':members[_0x52000b][_0x5fd6('0x8')]||_0x314c1c[_0x5fd6('0x2b')],'data3':members[_0x52000b]['data3']||_0x314c1c[_0x5fd6('0x2c')],'uniqueid':members[_0x52000b][_0x5fd6('0x5')]||_0x314c1c[_0x5fd6('0x5')]});utils[_0x5fd6('0x2')](util['format'](_0x5fd6('0x2d'),_0x314c1c['uniqueid'],members[_0x52000b][_0x5fd6('0x29')],members[_0x52000b][_0x5fd6('0x8')],members[_0x52000b][_0x5fd6('0x2e')]));if(members[_0x52000b][_0x5fd6('0x1f')]){writeDB(members[_0x52000b]);}}}if(_0x314c1c['destinationchannel']){var _0x2cf1e8=_0x314c1c[_0x5fd6('0x2f')][_0x5fd6('0xe')]('-')[0x0];if(!_[_0x5fd6('0x1e')](members[_0x2cf1e8])){members[_0x2cf1e8]=_[_0x5fd6('0x26')](members[_0x2cf1e8],{'data1':members[_0x2cf1e8][_0x5fd6('0x29')]||_0x314c1c[_0x5fd6('0x2a')],'data2':members[_0x2cf1e8][_0x5fd6('0x8')]||_0x314c1c['source'],'data3':members[_0x2cf1e8][_0x5fd6('0x2e')]||_0x314c1c[_0x5fd6('0x2c')],'uniqueid':members[_0x2cf1e8][_0x5fd6('0x5')]||_0x314c1c[_0x5fd6('0x5')]});utils['info'](util[_0x5fd6('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x314c1c[_0x5fd6('0x5')],members[_0x2cf1e8]['data1'],members[_0x2cf1e8][_0x5fd6('0x8')],members[_0x2cf1e8][_0x5fd6('0x2e')]));if(members[_0x2cf1e8]['exitAt']){writeDB(members[_0x2cf1e8]);}}}}catch(_0x1db091){utils[_0x5fd6('0x21')](util['format'](_0x5fd6('0x28'),_0x314c1c[_0x5fd6('0x5')]),_0x1db091);}}; \ No newline at end of file +var _0xdfe0=['format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil','diffTime','enterAt','[%s][members][devicestatechange]','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','exitAt','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info'];(function(_0x5a9aa7,_0x55b38f){var _0x298adf=function(_0x2643d4){while(--_0x2643d4){_0x5a9aa7['push'](_0x5a9aa7['shift']());}};_0x298adf(++_0x55b38f);}(_0xdfe0,0xce));var _0x0dfe=function(_0x4f0048,_0x3687eb){_0x4f0048=_0x4f0048-0x0;var _0x105b75=_0xdfe0[_0x4f0048];return _0x105b75;};'use strict';var _=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));var utils=require(_0x0dfe('0x2'));var members={};var exclude=[_0x0dfe('0x3'),_0x0dfe('0x4')];function writeDB(_0x77f0f6){utils[_0x0dfe('0x5')](util[_0x0dfe('0x6')](_0x0dfe('0x7'),_0x77f0f6['uniqueid'],_0x77f0f6[_0x0dfe('0x8')],_0x77f0f6[_0x0dfe('0x9')],_0x77f0f6[_0x0dfe('0xa')],_0x77f0f6[_0x0dfe('0xb')],_0x77f0f6[_0x0dfe('0xc')]));if(_0x77f0f6['interface']){utils[_0x0dfe('0xd')](_0x77f0f6[_0x0dfe('0x8')])[_0x0dfe('0xe')](function(_0x14e1dd){if(_0x14e1dd){_0x77f0f6[_0x0dfe('0xb')]=_0x14e1dd[_0x0dfe('0xf')];_0x77f0f6[_0x0dfe('0x10')]=_0x14e1dd[_0x0dfe('0x10')];utils[_0x0dfe('0x11')]('CreateMemberReport',_0x77f0f6);}else{utils[_0x0dfe('0x12')](_0x77f0f6[_0x0dfe('0x8')][_0x0dfe('0x13')]('/')[0x1])[_0x0dfe('0xe')](function(_0x1da194){if(_0x1da194){_0x77f0f6[_0x0dfe('0xb')]=_0x1da194[_0x0dfe('0xf')];_0x77f0f6[_0x0dfe('0x10')]=_0x1da194[_0x0dfe('0x10')];utils[_0x0dfe('0x11')](_0x0dfe('0x14'),_0x77f0f6);}});}})[_0x0dfe('0x15')](function(_0x589f73){utils[_0x0dfe('0x16')](util[_0x0dfe('0x6')](_0x0dfe('0x17'),_0x77f0f6[_0x0dfe('0x18')]),_0x589f73);});}delete members[_0x77f0f6[_0x0dfe('0x8')]];}function startsWith(_0x56bda7,_0x3e250c){return _['some'](_0x56bda7,function(_0x563f93){return _[_0x0dfe('0x19')](_0x3e250c,_0x563f93);});}exports[_0x0dfe('0x1a')]=function(_0x1e80fe){try{utils[_0x0dfe('0x1b')](util[_0x0dfe('0x6')]('[%s][members][devicestatechange]',members[_0x1e80fe['device']]?members[_0x1e80fe['device']]['uniqueid']:_0x1e80fe[_0x0dfe('0x1c')]),_0x1e80fe);utils[_0x0dfe('0x5')](util[_0x0dfe('0x6')](_0x0dfe('0x1d'),members[_0x1e80fe['device']]?members[_0x1e80fe[_0x0dfe('0x1c')]][_0x0dfe('0x18')]:_0x1e80fe[_0x0dfe('0x1c')],_0x1e80fe[_0x0dfe('0x1e')],_0x1e80fe[_0x0dfe('0x1c')]));switch(_0x1e80fe[_0x0dfe('0x1e')]){case _0x0dfe('0x1f'):case'BUSY':if(!startsWith(exclude,_0x1e80fe[_0x0dfe('0x1c')])){members[_0x1e80fe[_0x0dfe('0x1c')]]={'channel':_0x0dfe('0x20'),'interface':_0x1e80fe[_0x0dfe('0x1c')],'type':_0x0dfe('0x21'),'enterAt':utils[_0x0dfe('0x22')](),'role':_0x0dfe('0x23')};}break;case _0x0dfe('0x24'):if(!_[_0x0dfe('0x25')](members[_0x1e80fe[_0x0dfe('0x1c')]])){members[_0x1e80fe[_0x0dfe('0x1c')]]['exitAt']=utils[_0x0dfe('0x22')]();members[_0x1e80fe[_0x0dfe('0x1c')]]['duration']=utils[_0x0dfe('0x26')](members[_0x1e80fe[_0x0dfe('0x1c')]]['exitAt'],members[_0x1e80fe['device']][_0x0dfe('0x27')]);if(members[_0x1e80fe[_0x0dfe('0x1c')]][_0x0dfe('0x18')]){writeDB(members[_0x1e80fe[_0x0dfe('0x1c')]]);}}break;default:break;}}catch(_0x1d20e3){utils[_0x0dfe('0x16')](util[_0x0dfe('0x6')](_0x0dfe('0x28'),members[_0x1e80fe[_0x0dfe('0x1c')]]?members[_0x1e80fe[_0x0dfe('0x1c')]][_0x0dfe('0x18')]:_0x1e80fe[_0x0dfe('0x1c')]),_0x1d20e3);}};exports['agentcomplete']=function(_0x193f4a){try{if(!_[_0x0dfe('0x25')](members[_0x193f4a[_0x0dfe('0x8')]])){utils['debug'](util['format'](_0x0dfe('0x29'),_0x193f4a[_0x0dfe('0x18')]),_0x193f4a);utils[_0x0dfe('0x5')](util[_0x0dfe('0x6')](_0x0dfe('0x2a'),_0x193f4a[_0x0dfe('0x18')],_0x193f4a['interface'],_0x193f4a[_0x0dfe('0x2b')]));members[_0x193f4a[_0x0dfe('0x8')]]=_[_0x0dfe('0x2c')](members[_0x193f4a[_0x0dfe('0x8')]],{'data4':_0x193f4a[_0x0dfe('0x2b')],'uniqueid':_0x193f4a['uniqueid']});}}catch(_0x5d07bc){utils[_0x0dfe('0x16')](util['format'](_0x0dfe('0x29'),_0x193f4a[_0x0dfe('0x18')]),_0x5d07bc);}};exports['cdr']=function(_0x459a0d){try{utils[_0x0dfe('0x1b')](util[_0x0dfe('0x6')](_0x0dfe('0x2d'),_0x459a0d[_0x0dfe('0x18')]),_0x459a0d);if(_0x459a0d[_0x0dfe('0x9')]){var _0x46aaab=_0x459a0d[_0x0dfe('0x9')][_0x0dfe('0x13')]('-')[0x0];if(!_[_0x0dfe('0x25')](members[_0x46aaab])){members[_0x46aaab]=_[_0x0dfe('0x2c')](members[_0x46aaab],{'data1':members[_0x46aaab][_0x0dfe('0x2e')]||_0x459a0d[_0x0dfe('0xc')],'data2':members[_0x46aaab][_0x0dfe('0xa')]||_0x459a0d[_0x0dfe('0x2f')],'data3':members[_0x46aaab]['data3']||_0x459a0d[_0x0dfe('0x30')],'uniqueid':members[_0x46aaab][_0x0dfe('0x18')]||_0x459a0d[_0x0dfe('0x18')]});utils[_0x0dfe('0x5')](util['format'](_0x0dfe('0x31'),_0x459a0d['uniqueid'],members[_0x46aaab][_0x0dfe('0x2e')],members[_0x46aaab][_0x0dfe('0xa')],members[_0x46aaab][_0x0dfe('0x32')]));if(members[_0x46aaab][_0x0dfe('0x33')]){writeDB(members[_0x46aaab]);}}}if(_0x459a0d[_0x0dfe('0x34')]){var _0x2621f7=_0x459a0d['destinationchannel'][_0x0dfe('0x13')]('-')[0x0];if(!_['isNil'](members[_0x2621f7])){members[_0x2621f7]=_[_0x0dfe('0x2c')](members[_0x2621f7],{'data1':members[_0x2621f7]['data1']||_0x459a0d['type'],'data2':members[_0x2621f7]['data2']||_0x459a0d['source'],'data3':members[_0x2621f7][_0x0dfe('0x32')]||_0x459a0d[_0x0dfe('0x30')],'uniqueid':members[_0x2621f7][_0x0dfe('0x18')]||_0x459a0d[_0x0dfe('0x18')]});utils[_0x0dfe('0x5')](util['format'](_0x0dfe('0x31'),_0x459a0d[_0x0dfe('0x18')],members[_0x2621f7][_0x0dfe('0x2e')],members[_0x2621f7][_0x0dfe('0xa')],members[_0x2621f7]['data3']));if(members[_0x2621f7]['exitAt']){writeDB(members[_0x2621f7]);}}}}catch(_0x92bded){utils[_0x0dfe('0x16')](util[_0x0dfe('0x6')]('[%s][members][cdr]',_0x459a0d[_0x0dfe('0x18')]),_0x92bded);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8b17efb..eca3e47 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 _0xad9b=['connectedlinenum','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','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','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','assign','position','now','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','queuecallerleave','holdtime','queuecallerjoinAt','count'];(function(_0x254bff,_0x124f7a){var _0x3ba4f8=function(_0x1ee6d9){while(--_0x1ee6d9){_0x254bff['push'](_0x254bff['shift']());}};_0x3ba4f8(++_0x124f7a);}(_0xad9b,0x1be));var _0xbad9=function(_0x36594d,_0x5aaa06){_0x36594d=_0x36594d-0x0;var _0x1b8802=_0xad9b[_0x36594d];return _0x1b8802;};'use strict';var _=require(_0xbad9('0x0'));var util=require(_0xbad9('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1d2d45){utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x4'),_0x1d2d45[_0xbad9('0x5')],_0x1d2d45['channel'],_0x1d2d45['queue'],_0x1d2d45[_0xbad9('0x6')],_0x1d2d45[_0xbad9('0x7')],_0x1d2d45['accountcode'],_0x1d2d45['queuecallerexitreason']));if(_0x1d2d45['queue']){utils['getVoiceQueueByName'](_0x1d2d45['queue'])['then'](function(_0x22e04f){if(_0x22e04f){_0x1d2d45[_0xbad9('0x8')]=_0x22e04f[_0xbad9('0x8')];}utils['request'](_0xbad9('0x9'),_0x1d2d45);});}else{utils['request'](_0xbad9('0x9'),_0x1d2d45);}if(_0x1d2d45[_0xbad9('0xa')]){delete queues[_0x1d2d45[_0xbad9('0xa')]];}else{delete queues[_0x1d2d45[_0xbad9('0x5')]];}}exports[_0xbad9('0xb')]=function(_0xf890ee){try{utils[_0xbad9('0xc')](util['format']('[%s][queues][queuecallerjoin]',_0xf890ee[_0xbad9('0x5')]),_0xf890ee);utils[_0xbad9('0x2')](util[_0xbad9('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xf890ee[_0xbad9('0x5')],_0xf890ee['queue'],_0xf890ee['position']));queues[_0xf890ee[_0xbad9('0x5')]]=_[_0xbad9('0xd')](_0xf890ee,{'originalposition':_0xf890ee[_0xbad9('0xe')],'queuecallerjoinAt':utils[_0xbad9('0xf')](),'mohtime':0x0});}catch(_0x14b66d){utils['error'](util[_0xbad9('0x3')](_0xbad9('0x10'),_0xf890ee[_0xbad9('0x5')]),_0x14b66d);}};exports[_0xbad9('0x11')]=function(_0x41217d){try{if(!_[_0xbad9('0x12')](queues[_0x41217d['uniqueid']])){utils[_0xbad9('0xc')](util[_0xbad9('0x3')](_0xbad9('0x13'),_0x41217d[_0xbad9('0x5')]),_0x41217d);if(queues[_0x41217d[_0xbad9('0x5')]][_0xbad9('0x14')]){if(!queues[_0x41217d['uniqueid']][_0xbad9('0x15')]&&!queues[_0x41217d[_0xbad9('0x5')]][_0xbad9('0x16')]){queues[_0x41217d['uniqueid']][_0xbad9('0x17')]=!![];queues[_0x41217d[_0xbad9('0x5')]]['queuecallercompleteAt']=utils[_0xbad9('0xf')]();queues[_0x41217d[_0xbad9('0x5')]][_0xbad9('0x18')]='COMPLETEDBYAGENT';}utils['info'](util[_0xbad9('0x3')](_0xbad9('0x19'),_0x41217d[_0xbad9('0x5')],queues[_0x41217d[_0xbad9('0x5')]][_0xbad9('0x1a')],queues[_0x41217d[_0xbad9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x41217d[_0xbad9('0x5')]]);}else if(queues[_0x41217d[_0xbad9('0x5')]][_0xbad9('0xa')]){utils['info'](util[_0xbad9('0x3')](_0xbad9('0x1b'),_0x41217d[_0xbad9('0x5')],queues[_0x41217d[_0xbad9('0x5')]]['name'],queues[_0x41217d[_0xbad9('0x5')]]['transfereduniqueid']));queues[queues[_0x41217d['uniqueid']][_0xbad9('0xa')]]=queues[_0x41217d['uniqueid']];queues[queues[_0x41217d[_0xbad9('0x5')]]['transfereduniqueid']][_0xbad9('0x1c')]=0x2;delete queues[_0x41217d[_0xbad9('0x5')]];}}}catch(_0x3978b4){utils['error'](util['format']('[%s][queues][hangup]',_0x41217d[_0xbad9('0x5')]),_0x3978b4);}};exports[_0xbad9('0x1d')]=function(_0x45a0ab){try{utils[_0xbad9('0xc')](util[_0xbad9('0x3')]('[%s][queues][varset]',_0x45a0ab[_0xbad9('0x5')]),_0x45a0ab);if(!_['isNil'](_0x45a0ab[_0xbad9('0x1e')][_0xbad9('0x1f')])&&_0x45a0ab[_0xbad9('0x20')]['toUpperCase']()!==_0xbad9('0x21')){if(!_['isNil'](queues[_0x45a0ab[_0xbad9('0x5')]])){queues[_0x45a0ab['uniqueid']]['queuecallerabandon']=![];queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x22')]=null;queues[_0x45a0ab['uniqueid']][_0xbad9('0x16')]=!![];queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x23')]=utils['now']();queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x18')]=_0x45a0ab['value'][_0xbad9('0x24')]();utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x25'),_0x45a0ab[_0xbad9('0x5')],queues[_0x45a0ab[_0xbad9('0x5')]]['name'],_0x45a0ab[_0xbad9('0x20')],queues[_0x45a0ab['uniqueid']][_0xbad9('0x18')]));writeDB(queues[_0x45a0ab[_0xbad9('0x5')]]);}}else if(!_[_0xbad9('0x12')](_0x45a0ab[_0xbad9('0x1e')]['queueposition'])){if(!_['isNil'](queues[_0x45a0ab[_0xbad9('0x5')]])&&!queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x15')]){queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x15')]=![];queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x22')]=null;queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x16')]=!![];queues[_0x45a0ab['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x18')]=_0xbad9('0x26');utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x27'),_0x45a0ab['uniqueid'],queues[_0x45a0ab[_0xbad9('0x5')]]['name'],_0x45a0ab[_0xbad9('0x20')],queues[_0x45a0ab[_0xbad9('0x5')]][_0xbad9('0x18')]));}}}catch(_0x13742a){utils[_0xbad9('0x28')](util[_0xbad9('0x3')](_0xbad9('0x29'),_0x45a0ab[_0xbad9('0x5')]),_0x13742a);}};exports['queuecallerabandon']=function(_0x55bba0){try{if(!_[_0xbad9('0x12')](queues[_0x55bba0[_0xbad9('0x5')]])){utils['debug'](util[_0xbad9('0x3')](_0xbad9('0x2a'),_0x55bba0[_0xbad9('0x5')]),_0x55bba0);queues[_0x55bba0[_0xbad9('0x5')]][_0xbad9('0x16')]=![];queues[_0x55bba0[_0xbad9('0x5')]]['queuecallerexitAt']=null;queues[_0x55bba0[_0xbad9('0x5')]][_0xbad9('0x15')]=!![];queues[_0x55bba0[_0xbad9('0x5')]][_0xbad9('0x22')]=utils[_0xbad9('0xf')]();queues[_0x55bba0[_0xbad9('0x5')]][_0xbad9('0x18')]='ABANDONED';utils[_0xbad9('0x2')](util['format'](_0xbad9('0x2b'),_0x55bba0[_0xbad9('0x5')],queues[_0x55bba0[_0xbad9('0x5')]]['name'],queues[_0x55bba0[_0xbad9('0x5')]][_0xbad9('0x18')]));}}catch(_0x2a72ef){utils['error'](util[_0xbad9('0x3')](_0xbad9('0x2a'),_0x55bba0['uniqueid']),_0x2a72ef);}};exports['queuecallerleave']=function(_0x30293c){try{if(!_[_0xbad9('0x12')](queues[_0x30293c[_0xbad9('0x5')]])){utils['debug'](util[_0xbad9('0x3')](_0xbad9('0x2c'),_0x30293c['uniqueid']),_0x30293c);utils[_0xbad9('0x2')](util[_0xbad9('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30293c[_0xbad9('0x5')],queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0x1a')],_0x30293c['connectedlinenum'],_0x30293c['connectedlinename']));queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0x2d')]=!![];queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0x14')]=utils[_0xbad9('0xf')]();queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0x2e')]=utils['diffTime'](queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0x14')],queues[_0x30293c['uniqueid']][_0xbad9('0x2f')]);queues[_0x30293c[_0xbad9('0x5')]][_0xbad9('0xe')]=_0x30293c[_0xbad9('0xe')];queues[_0x30293c[_0xbad9('0x5')]]['count']=_0x30293c[_0xbad9('0x30')];queues[_0x30293c['uniqueid']][_0xbad9('0x31')]=_0x30293c['connectedlinenum'];queues[_0x30293c[_0xbad9('0x5')]]['connectedlinename']=_0x30293c['connectedlinename'];}}catch(_0x431955){utils[_0xbad9('0x28')](util[_0xbad9('0x3')](_0xbad9('0x2c'),_0x30293c[_0xbad9('0x5')]),_0x431955);}};exports['agentconnect']=function(_0xc62d37){try{if(!_['isNil'](queues[_0xc62d37[_0xbad9('0x5')]])){utils[_0xbad9('0xc')](util[_0xbad9('0x3')](_0xbad9('0x32'),_0xc62d37[_0xbad9('0x5')]),_0xc62d37);utils['info'](util[_0xbad9('0x3')](_0xbad9('0x33'),_0xc62d37[_0xbad9('0x5')],queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x1a')],_0xc62d37[_0xbad9('0x34')],_0xc62d37['destaccountcode']));queues[_0xc62d37[_0xbad9('0x5')]]['queuecallerabandon']=![];queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x15')]=![];queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x22')]=null;queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x16')]=![];queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x18')]=null;queues[_0xc62d37[_0xbad9('0x5')]]['queuecallerexitAt']=null;queues[_0xc62d37['uniqueid']][_0xbad9('0x35')]=!![];queues[_0xc62d37[_0xbad9('0x5')]][_0xbad9('0x36')]=_0xc62d37[_0xbad9('0x37')];queues[_0xc62d37['uniqueid']][_0xbad9('0x6')]=_0xc62d37[_0xbad9('0x34')];}}catch(_0x36bd3d){utils[_0xbad9('0x28')](util[_0xbad9('0x3')](_0xbad9('0x32'),_0xc62d37[_0xbad9('0x5')]),_0x36bd3d);}};exports[_0xbad9('0x38')]=function(_0x250fba){try{if(!_[_0xbad9('0x12')](queues[_0x250fba[_0xbad9('0x5')]])){if(queues[_0x250fba[_0xbad9('0x5')]]['queuecallerleaveAt']){utils[_0xbad9('0xc')](util[_0xbad9('0x3')]('[%s][queues][agentcomplete]',_0x250fba[_0xbad9('0x5')]),_0x250fba);queues[_0x250fba[_0xbad9('0x5')]]['queuecallerabandon']=![];queues[_0x250fba[_0xbad9('0x5')]]['queuecallerabandon']=![];queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x22')]=null;queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x16')]=![];queues[_0x250fba['uniqueid']]['queuecallerexitAt']=null;queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x35')]=!![];queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x6')]=_0x250fba[_0xbad9('0x34')];queues[_0x250fba[_0xbad9('0x5')]]['queuecallercomplete']=!![];queues[_0x250fba['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x250fba[_0xbad9('0x39')]==_0xbad9('0x3a')){if(!queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x3a')]){queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x18')]=_0xbad9('0x3b');}}else{queues[_0x250fba[_0xbad9('0x5')]][_0xbad9('0x18')]=_0xbad9('0x3c')+_0x250fba['reason'][_0xbad9('0x24')]();}utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x3d'),_0x250fba[_0xbad9('0x5')],queues[_0x250fba['uniqueid']][_0xbad9('0x1a')],_0x250fba[_0xbad9('0x34')],queues[_0x250fba[_0xbad9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x250fba[_0xbad9('0x5')]]);}}}catch(_0xcea1d){utils[_0xbad9('0x28')](util['format']('[%s][queues][agentcomplete]',_0x250fba[_0xbad9('0x5')]),_0xcea1d);}};exports[_0xbad9('0x3e')]=function(_0x324e68){try{if(!_[_0xbad9('0x12')](queues[_0x324e68[_0xbad9('0x3f')]])){utils[_0xbad9('0xc')](util[_0xbad9('0x3')]('[%s][queues][blindtransfer]',_0x324e68[_0xbad9('0x5')]),_0x324e68);queues[_0x324e68[_0xbad9('0x3f')]][_0xbad9('0x3a')]=!![];queues[_0x324e68[_0xbad9('0x3f')]][_0xbad9('0x40')]='BLIND';queues[_0x324e68['transfereeuniqueid']][_0xbad9('0x41')]=_0x324e68[_0xbad9('0x42')];queues[_0x324e68[_0xbad9('0x3f')]][_0xbad9('0x43')]=_0x324e68[_0xbad9('0x3f')];queues[_0x324e68[_0xbad9('0x3f')]][_0xbad9('0x18')]=_0xbad9('0x44');utils[_0xbad9('0x2')](util['format'](_0xbad9('0x45'),_0x324e68[_0xbad9('0x5')],queues[_0x324e68['transfereeuniqueid']][_0xbad9('0x1a')],_0x324e68[_0xbad9('0x3f')],_0x324e68[_0xbad9('0x42')]));}}catch(_0x2a2e4c){utils['error'](util['format'](_0xbad9('0x46'),_0x324e68['uniqueid']),_0x2a2e4c);}};exports[_0xbad9('0x47')]=function(_0x4387a5){try{utils[_0xbad9('0xc')](util[_0xbad9('0x3')](_0xbad9('0x48'),_0x4387a5[_0xbad9('0x49')]),_0x4387a5);if(_0x4387a5[_0xbad9('0x49')]==_0x4387a5['origtransfererlinkedid']){if(!_['isNil'](queues[_0x4387a5[_0xbad9('0x4a')]])){utils[_0xbad9('0x2')](util['format'](_0xbad9('0x4b'),_0x4387a5[_0xbad9('0x49')],queues[_0x4387a5['secondtransfererlinkedid']][_0xbad9('0x1a')],_0x4387a5[_0xbad9('0x4c')]));queues[_0x4387a5[_0xbad9('0x4a')]][_0xbad9('0x3a')]=!![];queues[_0x4387a5[_0xbad9('0x4a')]][_0xbad9('0x40')]='ATTENDED';queues[_0x4387a5['secondtransfererlinkedid']][_0xbad9('0x41')]=_0x4387a5['origtransfererexten'];queues[_0x4387a5['secondtransfererlinkedid']]['transferuniqueid']=_0x4387a5[_0xbad9('0x49')];queues[_0x4387a5[_0xbad9('0x4a')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xbad9('0x12')](queues[_0x4387a5[_0xbad9('0x4d')]])){if(_0x4387a5[_0xbad9('0x4e')]&&queues[_0x4387a5[_0xbad9('0x4e')]]){queues[_0x4387a5[_0xbad9('0x4e')]][_0xbad9('0x1c')]=0x1;queues[_0x4387a5[_0xbad9('0x3f')]]=_[_0xbad9('0x4f')](queues[_0x4387a5[_0xbad9('0x4e')]]);queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0xa')]=_0x4387a5[_0xbad9('0x50')];queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x1c')]=0x2;queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x7')]=queues[_0x4387a5[_0xbad9('0x4a')]][_0xbad9('0x7')];queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x51')]=queues[_0x4387a5[_0xbad9('0x4a')]][_0xbad9('0x51')];queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x2f')]=utils[_0xbad9('0xf')]();queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x14')]=utils['now']();queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x2e')]=0x0;queues[_0x4387a5[_0xbad9('0x3f')]][_0xbad9('0x52')]=0x0;utils['info'](util[_0xbad9('0x3')](_0xbad9('0x53'),_0x4387a5[_0xbad9('0x49')],queues[_0x4387a5['transfereeuniqueid']][_0xbad9('0x1a')],queues[_0x4387a5[_0xbad9('0x3f')]]['calleridnum'],queues[_0x4387a5[_0xbad9('0x3f')]]['calleridname']));}else{utils['info'](util[_0xbad9('0x3')](_0xbad9('0x54'),_0x4387a5['origtransfereruniqueid'],queues[_0x4387a5[_0xbad9('0x4d')]][_0xbad9('0x1a')],_0x4387a5[_0xbad9('0x4a')]));queues[_0x4387a5[_0xbad9('0x4d')]][_0xbad9('0xa')]=_0x4387a5[_0xbad9('0x4a')];}}}else if(_0x4387a5[_0xbad9('0x55')]==_0x4387a5[_0xbad9('0x4a')]){if(!_[_0xbad9('0x12')](queues[_0x4387a5[_0xbad9('0x4d')]])){utils[_0xbad9('0x2')](util['format'](_0xbad9('0x56'),_0x4387a5['origtransfereruniqueid'],queues[_0x4387a5[_0xbad9('0x4d')]][_0xbad9('0x1a')],_0x4387a5[_0xbad9('0x55')],_0x4387a5[_0xbad9('0x57')]));queues[_0x4387a5[_0xbad9('0x4d')]]['transfer']=!![];queues[_0x4387a5['origtransfererlinkedid']]['transfertype']=_0xbad9('0x58');queues[_0x4387a5['origtransfererlinkedid']][_0xbad9('0x41')]=_0x4387a5['secondtransfererexten'];queues[_0x4387a5['origtransfererlinkedid']][_0xbad9('0x43')]=_0x4387a5[_0xbad9('0x55')];queues[_0x4387a5[_0xbad9('0x4d')]][_0xbad9('0x18')]=_0xbad9('0x59');}if(!_['isNil'](queues[_0x4387a5[_0xbad9('0x4a')]])){if(_0x4387a5[_0xbad9('0x5a')]&&queues[_0x4387a5[_0xbad9('0x5a')]]){queues[_0x4387a5['transfertargetlinkedid']][_0xbad9('0x1c')]=0x1;queues[_0x4387a5[_0xbad9('0x50')]]=_[_0xbad9('0x4f')](queues[_0x4387a5[_0xbad9('0x5a')]]);queues[_0x4387a5['transfertargetuniqueid']][_0xbad9('0xa')]=_0x4387a5[_0xbad9('0x50')];queues[_0x4387a5[_0xbad9('0x50')]]['queuecallerenterreason']=0x2;queues[_0x4387a5['transfertargetuniqueid']][_0xbad9('0x7')]=queues[_0x4387a5['origtransfererlinkedid']][_0xbad9('0x7')];queues[_0x4387a5['transfertargetuniqueid']][_0xbad9('0x51')]=queues[_0x4387a5['origtransfererlinkedid']][_0xbad9('0x51')];queues[_0x4387a5['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xbad9('0xf')]();queues[_0x4387a5['transfertargetuniqueid']][_0xbad9('0x14')]=utils[_0xbad9('0xf')]();queues[_0x4387a5[_0xbad9('0x50')]][_0xbad9('0x2e')]=0x0;queues[_0x4387a5[_0xbad9('0x50')]][_0xbad9('0x52')]=0x0;utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x5b'),_0x4387a5[_0xbad9('0x49')],queues[_0x4387a5[_0xbad9('0x50')]][_0xbad9('0x1a')],queues[_0x4387a5[_0xbad9('0x50')]]['transfereduniqueid'],queues[_0x4387a5[_0xbad9('0x50')]]['calleridnum'],queues[_0x4387a5[_0xbad9('0x50')]][_0xbad9('0x51')]));}else{utils[_0xbad9('0x2')](util['format'](_0xbad9('0x54'),_0x4387a5[_0xbad9('0x49')],queues[_0x4387a5[_0xbad9('0x4a')]][_0xbad9('0x1a')],_0x4387a5[_0xbad9('0x4d')]));queues[_0x4387a5['secondtransfererlinkedid']][_0xbad9('0xa')]=_0x4387a5[_0xbad9('0x4d')];}}}}catch(_0x48ecc5){utils[_0xbad9('0x28')](util[_0xbad9('0x3')](_0xbad9('0x48'),_0x4387a5[_0xbad9('0x49')]),_0x48ecc5);}};exports[_0xbad9('0x5c')]=function(_0x210824){try{if(!_[_0xbad9('0x12')](queues[_0x210824[_0xbad9('0x5')]])){utils[_0xbad9('0xc')](util[_0xbad9('0x3')](_0xbad9('0x5d'),_0x210824[_0xbad9('0x5')]),_0x210824);queues[_0x210824[_0xbad9('0x5')]][_0xbad9('0x5e')]=utils[_0xbad9('0xf')]();utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x5f'),_0x210824[_0xbad9('0x5')],queues[_0x210824[_0xbad9('0x5')]][_0xbad9('0x1a')],queues[_0x210824['uniqueid']][_0xbad9('0x5e')]));}}catch(_0x2208f5){utils[_0xbad9('0x28')](util['format'](_0xbad9('0x5d'),_0x210824[_0xbad9('0x5')]),_0x2208f5);}};exports[_0xbad9('0x60')]=function(_0x67cb3e){try{if(!_[_0xbad9('0x12')](queues[_0x67cb3e[_0xbad9('0x5')]])){if(!_[_0xbad9('0x12')](queues[_0x67cb3e[_0xbad9('0x5')]]['musiconholdstartAt'])){utils[_0xbad9('0xc')](util[_0xbad9('0x3')]('[%s][queues][musiconholdstop]',_0x67cb3e[_0xbad9('0x5')]),_0x67cb3e);queues[_0x67cb3e[_0xbad9('0x5')]][_0xbad9('0x52')]+=utils[_0xbad9('0x61')](utils['now'](),queues[_0x67cb3e[_0xbad9('0x5')]][_0xbad9('0x5e')]);utils[_0xbad9('0x2')](util[_0xbad9('0x3')](_0xbad9('0x62'),_0x67cb3e[_0xbad9('0x5')],queues[_0x67cb3e[_0xbad9('0x5')]][_0xbad9('0x1a')],queues[_0x67cb3e[_0xbad9('0x5')]][_0xbad9('0x52')]));delete queues[_0x67cb3e[_0xbad9('0x5')]][_0xbad9('0x5e')];}}}catch(_0x4be09e){utils['error'](util[_0xbad9('0x3')]('[%s][queues][musiconholdstop]',_0x67cb3e['uniqueid']),_0x4be09e);}}; \ No newline at end of file +var _0xfe14=['[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','holdtime','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','./utils','info','format','uniqueid','channel','calleridnum','queue','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','position','now','[%s][queues][queuecallerjoin]','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfe14,0x15a));var _0x4fe1=function(_0x1a8dc7,_0x2835f1){_0x1a8dc7=_0x1a8dc7-0x0;var _0x306cf0=_0xfe14[_0x1a8dc7];return _0x306cf0;};'use strict';var _=require(_0x4fe1('0x0'));var util=require('util');var utils=require(_0x4fe1('0x1'));var queues={};function writeDB(_0x57bb63){utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x57bb63[_0x4fe1('0x4')],_0x57bb63[_0x4fe1('0x5')],_0x57bb63['queue'],_0x57bb63['lastAssignedTo'],_0x57bb63[_0x4fe1('0x6')],_0x57bb63['accountcode'],_0x57bb63['queuecallerexitreason']));if(_0x57bb63[_0x4fe1('0x7')]){utils[_0x4fe1('0x8')](_0x57bb63[_0x4fe1('0x7')])[_0x4fe1('0x9')](function(_0xc3087c){if(_0xc3087c){_0x57bb63[_0x4fe1('0xa')]=_0xc3087c[_0x4fe1('0xa')];}utils['request'](_0x4fe1('0xb'),_0x57bb63);});}else{utils[_0x4fe1('0xc')](_0x4fe1('0xb'),_0x57bb63);}if(_0x57bb63[_0x4fe1('0xd')]){delete queues[_0x57bb63[_0x4fe1('0xd')]];}else{delete queues[_0x57bb63[_0x4fe1('0x4')]];}}exports[_0x4fe1('0xe')]=function(_0x14cf14){try{utils['debug'](util[_0x4fe1('0x3')]('[%s][queues][queuecallerjoin]',_0x14cf14[_0x4fe1('0x4')]),_0x14cf14);utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x14cf14['uniqueid'],_0x14cf14[_0x4fe1('0x7')],_0x14cf14[_0x4fe1('0xf')]));queues[_0x14cf14[_0x4fe1('0x4')]]=_['assign'](_0x14cf14,{'originalposition':_0x14cf14['position'],'queuecallerjoinAt':utils[_0x4fe1('0x10')](),'mohtime':0x0});}catch(_0x58993f){utils['error'](util[_0x4fe1('0x3')](_0x4fe1('0x11'),_0x14cf14[_0x4fe1('0x4')]),_0x58993f);}};exports['hangup']=function(_0x5d672d){try{if(!_[_0x4fe1('0x12')](queues[_0x5d672d[_0x4fe1('0x4')]])){utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')](_0x4fe1('0x14'),_0x5d672d[_0x4fe1('0x4')]),_0x5d672d);if(queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x15')]){if(!queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x16')]&&!queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x17')]){queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x18')]=!![];queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x19')]=utils['now']();queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x1a')]='COMPLETEDBYAGENT';}utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x5d672d[_0x4fe1('0x4')],queues[_0x5d672d[_0x4fe1('0x4')]]['name'],queues[_0x5d672d['uniqueid']][_0x4fe1('0x1a')]));writeDB(queues[_0x5d672d['uniqueid']]);}else if(queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0xd')]){utils['info'](util['format'](_0x4fe1('0x1b'),_0x5d672d['uniqueid'],queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0x1c')],queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0xd')]));queues[queues[_0x5d672d[_0x4fe1('0x4')]]['transfereduniqueid']]=queues[_0x5d672d[_0x4fe1('0x4')]];queues[queues[_0x5d672d[_0x4fe1('0x4')]][_0x4fe1('0xd')]][_0x4fe1('0x1d')]=0x2;delete queues[_0x5d672d[_0x4fe1('0x4')]];}}}catch(_0x301a82){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')]('[%s][queues][hangup]',_0x5d672d[_0x4fe1('0x4')]),_0x301a82);}};exports[_0x4fe1('0x1f')]=function(_0x2ab86c){try{utils[_0x4fe1('0x13')](util['format'](_0x4fe1('0x20'),_0x2ab86c[_0x4fe1('0x4')]),_0x2ab86c);if(!_[_0x4fe1('0x12')](_0x2ab86c[_0x4fe1('0x21')]['queuestatus'])&&_0x2ab86c[_0x4fe1('0x22')][_0x4fe1('0x23')]()!==_0x4fe1('0x24')){if(!_['isNil'](queues[_0x2ab86c['uniqueid']])){queues[_0x2ab86c[_0x4fe1('0x4')]]['queuecallerabandon']=![];queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x25')]=null;queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x17')]=!![];queues[_0x2ab86c[_0x4fe1('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x2ab86c[_0x4fe1('0x4')]]['queuecallerexitreason']=_0x2ab86c['value']['toUpperCase']();utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x26'),_0x2ab86c[_0x4fe1('0x4')],queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x1c')],_0x2ab86c[_0x4fe1('0x22')],queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x1a')]));writeDB(queues[_0x2ab86c['uniqueid']]);}}else if(!_[_0x4fe1('0x12')](_0x2ab86c['variable'][_0x4fe1('0x27')])){if(!_[_0x4fe1('0x12')](queues[_0x2ab86c[_0x4fe1('0x4')]])&&!queues[_0x2ab86c['uniqueid']][_0x4fe1('0x16')]){queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x16')]=![];queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x25')]=null;queues[_0x2ab86c['uniqueid']][_0x4fe1('0x17')]=!![];queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x28')]=utils[_0x4fe1('0x10')]();queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x1a')]=_0x4fe1('0x29');utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x2a'),_0x2ab86c[_0x4fe1('0x4')],queues[_0x2ab86c[_0x4fe1('0x4')]][_0x4fe1('0x1c')],_0x2ab86c[_0x4fe1('0x22')],queues[_0x2ab86c[_0x4fe1('0x4')]]['queuecallerexitreason']));}}}catch(_0x9b26e){utils['error'](util[_0x4fe1('0x3')](_0x4fe1('0x20'),_0x2ab86c[_0x4fe1('0x4')]),_0x9b26e);}};exports['queuecallerabandon']=function(_0x233bb8){try{if(!_[_0x4fe1('0x12')](queues[_0x233bb8[_0x4fe1('0x4')]])){utils[_0x4fe1('0x13')](util['format'](_0x4fe1('0x2b'),_0x233bb8[_0x4fe1('0x4')]),_0x233bb8);queues[_0x233bb8['uniqueid']][_0x4fe1('0x17')]=![];queues[_0x233bb8['uniqueid']][_0x4fe1('0x28')]=null;queues[_0x233bb8[_0x4fe1('0x4')]][_0x4fe1('0x16')]=!![];queues[_0x233bb8[_0x4fe1('0x4')]]['queuecallerabandonAt']=utils['now']();queues[_0x233bb8[_0x4fe1('0x4')]][_0x4fe1('0x1a')]=_0x4fe1('0x2c');utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x2d'),_0x233bb8[_0x4fe1('0x4')],queues[_0x233bb8[_0x4fe1('0x4')]][_0x4fe1('0x1c')],queues[_0x233bb8[_0x4fe1('0x4')]]['queuecallerexitreason']));}}catch(_0x475ec1){utils['error'](util['format'](_0x4fe1('0x2b'),_0x233bb8[_0x4fe1('0x4')]),_0x475ec1);}};exports['queuecallerleave']=function(_0x2f1fb8){try{if(!_['isNil'](queues[_0x2f1fb8['uniqueid']])){utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')](_0x4fe1('0x2e'),_0x2f1fb8[_0x4fe1('0x4')]),_0x2f1fb8);utils[_0x4fe1('0x2')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2f1fb8[_0x4fe1('0x4')],queues[_0x2f1fb8[_0x4fe1('0x4')]][_0x4fe1('0x1c')],_0x2f1fb8[_0x4fe1('0x2f')],_0x2f1fb8[_0x4fe1('0x30')]));queues[_0x2f1fb8[_0x4fe1('0x4')]][_0x4fe1('0x31')]=!![];queues[_0x2f1fb8[_0x4fe1('0x4')]]['queuecallerleaveAt']=utils[_0x4fe1('0x10')]();queues[_0x2f1fb8['uniqueid']][_0x4fe1('0x32')]=utils['diffTime'](queues[_0x2f1fb8['uniqueid']]['queuecallerleaveAt'],queues[_0x2f1fb8[_0x4fe1('0x4')]]['queuecallerjoinAt']);queues[_0x2f1fb8['uniqueid']][_0x4fe1('0xf')]=_0x2f1fb8[_0x4fe1('0xf')];queues[_0x2f1fb8[_0x4fe1('0x4')]][_0x4fe1('0x33')]=_0x2f1fb8[_0x4fe1('0x33')];queues[_0x2f1fb8[_0x4fe1('0x4')]][_0x4fe1('0x2f')]=_0x2f1fb8[_0x4fe1('0x2f')];queues[_0x2f1fb8[_0x4fe1('0x4')]][_0x4fe1('0x30')]=_0x2f1fb8[_0x4fe1('0x30')];}}catch(_0x1adbf9){utils['error'](util[_0x4fe1('0x3')](_0x4fe1('0x2e'),_0x2f1fb8['uniqueid']),_0x1adbf9);}};exports[_0x4fe1('0x34')]=function(_0x388358){try{if(!_[_0x4fe1('0x12')](queues[_0x388358[_0x4fe1('0x4')]])){utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')]('[%s][queues][agentconnect]',_0x388358['uniqueid']),_0x388358);utils['info'](util[_0x4fe1('0x3')](_0x4fe1('0x35'),_0x388358[_0x4fe1('0x4')],queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x1c')],_0x388358[_0x4fe1('0x36')],_0x388358[_0x4fe1('0x37')]));queues[_0x388358['uniqueid']]['queuecallerabandon']=![];queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x16')]=![];queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x25')]=null;queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x17')]=![];queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x1a')]=null;queues[_0x388358['uniqueid']][_0x4fe1('0x28')]=null;queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x38')]=!![];queues[_0x388358[_0x4fe1('0x4')]]['accountcode']=_0x388358[_0x4fe1('0x37')];queues[_0x388358[_0x4fe1('0x4')]][_0x4fe1('0x39')]=_0x388358['membername'];}}catch(_0x2fa6e6){utils['error'](util[_0x4fe1('0x3')]('[%s][queues][agentconnect]',_0x388358[_0x4fe1('0x4')]),_0x2fa6e6);}};exports['agentcomplete']=function(_0x58e228){try{if(!_[_0x4fe1('0x12')](queues[_0x58e228['uniqueid']])){if(queues[_0x58e228['uniqueid']][_0x4fe1('0x15')]){utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')]('[%s][queues][agentcomplete]',_0x58e228[_0x4fe1('0x4')]),_0x58e228);queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x16')]=![];queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x16')]=![];queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x25')]=null;queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x17')]=![];queues[_0x58e228['uniqueid']][_0x4fe1('0x28')]=null;queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x38')]=!![];queues[_0x58e228['uniqueid']][_0x4fe1('0x39')]=_0x58e228[_0x4fe1('0x36')];queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x18')]=!![];queues[_0x58e228['uniqueid']][_0x4fe1('0x19')]=utils[_0x4fe1('0x10')]();if(_0x58e228[_0x4fe1('0x3a')]=='transfer'){if(!queues[_0x58e228['uniqueid']][_0x4fe1('0x3b')]){queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x1a')]=_0x4fe1('0x3c');}}else{queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x1a')]=_0x4fe1('0x3d')+_0x58e228['reason'][_0x4fe1('0x23')]();}utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x58e228[_0x4fe1('0x4')],queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x1c')],_0x58e228[_0x4fe1('0x36')],queues[_0x58e228[_0x4fe1('0x4')]][_0x4fe1('0x1a')]));writeDB(queues[_0x58e228[_0x4fe1('0x4')]]);}}}catch(_0x5627a7){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')](_0x4fe1('0x3e'),_0x58e228['uniqueid']),_0x5627a7);}};exports[_0x4fe1('0x3f')]=function(_0x339e43){try{if(!_[_0x4fe1('0x12')](queues[_0x339e43[_0x4fe1('0x40')]])){utils['debug'](util['format'](_0x4fe1('0x41'),_0x339e43[_0x4fe1('0x4')]),_0x339e43);queues[_0x339e43[_0x4fe1('0x40')]]['transfer']=!![];queues[_0x339e43[_0x4fe1('0x40')]][_0x4fe1('0x42')]='BLIND';queues[_0x339e43[_0x4fe1('0x40')]][_0x4fe1('0x43')]=_0x339e43['extension'];queues[_0x339e43[_0x4fe1('0x40')]][_0x4fe1('0x44')]=_0x339e43[_0x4fe1('0x40')];queues[_0x339e43[_0x4fe1('0x40')]][_0x4fe1('0x1a')]='BLINDTRANSFER';utils[_0x4fe1('0x2')](util['format'](_0x4fe1('0x45'),_0x339e43[_0x4fe1('0x4')],queues[_0x339e43['transfereeuniqueid']]['name'],_0x339e43[_0x4fe1('0x40')],_0x339e43[_0x4fe1('0x46')]));}}catch(_0x452312){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')](_0x4fe1('0x41'),_0x339e43['uniqueid']),_0x452312);}};exports['attendedtransfer']=function(_0x131034){try{utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')](_0x4fe1('0x47'),_0x131034[_0x4fe1('0x48')]),_0x131034);if(_0x131034[_0x4fe1('0x48')]==_0x131034[_0x4fe1('0x49')]){if(!_['isNil'](queues[_0x131034['secondtransfererlinkedid']])){utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x4a'),_0x131034[_0x4fe1('0x48')],queues[_0x131034[_0x4fe1('0x4b')]]['name'],_0x131034[_0x4fe1('0x4c')]));queues[_0x131034[_0x4fe1('0x4b')]]['transfer']=!![];queues[_0x131034[_0x4fe1('0x4b')]]['transfertype']=_0x4fe1('0x4d');queues[_0x131034[_0x4fe1('0x4b')]][_0x4fe1('0x43')]=_0x131034[_0x4fe1('0x4c')];queues[_0x131034[_0x4fe1('0x4b')]][_0x4fe1('0x44')]=_0x131034['origtransfereruniqueid'];queues[_0x131034[_0x4fe1('0x4b')]]['queuecallerexitreason']=_0x4fe1('0x4e');}if(!_[_0x4fe1('0x12')](queues[_0x131034[_0x4fe1('0x49')]])){if(_0x131034[_0x4fe1('0x4f')]&&queues[_0x131034['transfereelinkedid']]){queues[_0x131034[_0x4fe1('0x4f')]]['queuecallerenterreason']=0x1;queues[_0x131034[_0x4fe1('0x40')]]=_[_0x4fe1('0x50')](queues[_0x131034['transfereelinkedid']]);queues[_0x131034['transfereeuniqueid']][_0x4fe1('0xd')]=_0x131034[_0x4fe1('0x51')];queues[_0x131034[_0x4fe1('0x40')]]['queuecallerenterreason']=0x2;queues[_0x131034[_0x4fe1('0x40')]][_0x4fe1('0x6')]=queues[_0x131034[_0x4fe1('0x4b')]][_0x4fe1('0x6')];queues[_0x131034[_0x4fe1('0x40')]][_0x4fe1('0x52')]=queues[_0x131034['secondtransfererlinkedid']][_0x4fe1('0x52')];queues[_0x131034[_0x4fe1('0x40')]]['queuecallerjoinAt']=utils[_0x4fe1('0x10')]();queues[_0x131034[_0x4fe1('0x40')]]['queuecallerleaveAt']=utils['now']();queues[_0x131034['transfereeuniqueid']]['holdtime']=0x0;queues[_0x131034[_0x4fe1('0x40')]][_0x4fe1('0x53')]=0x0;utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x54'),_0x131034[_0x4fe1('0x48')],queues[_0x131034[_0x4fe1('0x40')]][_0x4fe1('0x1c')],queues[_0x131034['transfereeuniqueid']][_0x4fe1('0x6')],queues[_0x131034[_0x4fe1('0x40')]][_0x4fe1('0x52')]));}else{utils[_0x4fe1('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x131034['origtransfereruniqueid'],queues[_0x131034['origtransfererlinkedid']]['name'],_0x131034[_0x4fe1('0x4b')]));queues[_0x131034[_0x4fe1('0x49')]][_0x4fe1('0xd')]=_0x131034[_0x4fe1('0x4b')];}}}else if(_0x131034[_0x4fe1('0x55')]==_0x131034[_0x4fe1('0x4b')]){if(!_[_0x4fe1('0x12')](queues[_0x131034[_0x4fe1('0x49')]])){utils[_0x4fe1('0x2')](util['format'](_0x4fe1('0x56'),_0x131034['origtransfereruniqueid'],queues[_0x131034[_0x4fe1('0x49')]][_0x4fe1('0x1c')],_0x131034[_0x4fe1('0x55')],_0x131034[_0x4fe1('0x57')]));queues[_0x131034[_0x4fe1('0x49')]][_0x4fe1('0x3b')]=!![];queues[_0x131034[_0x4fe1('0x49')]][_0x4fe1('0x42')]=_0x4fe1('0x4d');queues[_0x131034[_0x4fe1('0x49')]]['transferexten']=_0x131034[_0x4fe1('0x57')];queues[_0x131034[_0x4fe1('0x49')]][_0x4fe1('0x44')]=_0x131034['secondtransfereruniqueid'];queues[_0x131034['origtransfererlinkedid']]['queuecallerexitreason']=_0x4fe1('0x4e');}if(!_[_0x4fe1('0x12')](queues[_0x131034[_0x4fe1('0x4b')]])){if(_0x131034[_0x4fe1('0x58')]&&queues[_0x131034['transfertargetlinkedid']]){queues[_0x131034[_0x4fe1('0x58')]][_0x4fe1('0x1d')]=0x1;queues[_0x131034[_0x4fe1('0x51')]]=_['clone'](queues[_0x131034['transfertargetlinkedid']]);queues[_0x131034['transfertargetuniqueid']][_0x4fe1('0xd')]=_0x131034[_0x4fe1('0x51')];queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x1d')]=0x2;queues[_0x131034[_0x4fe1('0x51')]]['calleridnum']=queues[_0x131034['origtransfererlinkedid']][_0x4fe1('0x6')];queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x52')]=queues[_0x131034['origtransfererlinkedid']]['calleridname'];queues[_0x131034[_0x4fe1('0x51')]]['queuecallerjoinAt']=utils['now']();queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x15')]=utils[_0x4fe1('0x10')]();queues[_0x131034['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x53')]=0x0;utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x59'),_0x131034[_0x4fe1('0x48')],queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x1c')],queues[_0x131034[_0x4fe1('0x51')]]['transfereduniqueid'],queues[_0x131034['transfertargetuniqueid']][_0x4fe1('0x6')],queues[_0x131034[_0x4fe1('0x51')]][_0x4fe1('0x52')]));}else{utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x131034['origtransfereruniqueid'],queues[_0x131034[_0x4fe1('0x4b')]][_0x4fe1('0x1c')],_0x131034['origtransfererlinkedid']));queues[_0x131034[_0x4fe1('0x4b')]]['transfereduniqueid']=_0x131034[_0x4fe1('0x49')];}}}}catch(_0x504172){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')](_0x4fe1('0x47'),_0x131034[_0x4fe1('0x48')]),_0x504172);}};exports[_0x4fe1('0x5a')]=function(_0x1770cd){try{if(!_[_0x4fe1('0x12')](queues[_0x1770cd['uniqueid']])){utils['debug'](util[_0x4fe1('0x3')]('[%s][queues][musiconholdstart]',_0x1770cd[_0x4fe1('0x4')]),_0x1770cd);queues[_0x1770cd[_0x4fe1('0x4')]][_0x4fe1('0x5b')]=utils[_0x4fe1('0x10')]();utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')](_0x4fe1('0x5c'),_0x1770cd[_0x4fe1('0x4')],queues[_0x1770cd[_0x4fe1('0x4')]][_0x4fe1('0x1c')],queues[_0x1770cd[_0x4fe1('0x4')]][_0x4fe1('0x5b')]));}}catch(_0x41decc){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')](_0x4fe1('0x5d'),_0x1770cd[_0x4fe1('0x4')]),_0x41decc);}};exports[_0x4fe1('0x5e')]=function(_0xfea402){try{if(!_[_0x4fe1('0x12')](queues[_0xfea402[_0x4fe1('0x4')]])){if(!_[_0x4fe1('0x12')](queues[_0xfea402[_0x4fe1('0x4')]][_0x4fe1('0x5b')])){utils[_0x4fe1('0x13')](util[_0x4fe1('0x3')](_0x4fe1('0x5f'),_0xfea402[_0x4fe1('0x4')]),_0xfea402);queues[_0xfea402['uniqueid']][_0x4fe1('0x53')]+=utils[_0x4fe1('0x60')](utils['now'](),queues[_0xfea402[_0x4fe1('0x4')]]['musiconholdstartAt']);utils[_0x4fe1('0x2')](util[_0x4fe1('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xfea402[_0x4fe1('0x4')],queues[_0xfea402[_0x4fe1('0x4')]][_0x4fe1('0x1c')],queues[_0xfea402[_0x4fe1('0x4')]]['mohtime']));delete queues[_0xfea402[_0x4fe1('0x4')]]['musiconholdstartAt'];}}}catch(_0x4555fd){utils[_0x4fe1('0x1e')](util[_0x4fe1('0x3')](_0x4fe1('0x5f'),_0xfea402[_0x4fe1('0x4')]),_0x4555fd);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b3c8ca4..e07eecb 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 _0x9494=['transferercalleridnum','transfereecalleridnum','transfereruniqueid','lodash','util','./transfers.controller','format','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','find','monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x90ced,_0x129133){var _0x2e283d=function(_0x47b58d){while(--_0x47b58d){_0x90ced['push'](_0x90ced['shift']());}};_0x2e283d(++_0x129133);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4949('0x0'));var util=require(_0x4949('0x1'));var utils=require('./utils');var transfers=require(_0x4949('0x2'));var recordings={};function writeDB(_0xd83e3e){var _0x5e194b;utils['info'](util[_0x4949('0x3')]('[%s][recordings][writeDB]',_0xd83e3e[_0x4949('0x4')]));if(transfers['blinds'][_0xd83e3e[_0x4949('0x4')]]){_0x5e194b=_0xd83e3e[_0x4949('0x4')];_0xd83e3e['uniqueid']=transfers['blinds'][_0xd83e3e[_0x4949('0x4')]][_0x4949('0x5')];}if(_0xd83e3e[_0x4949('0x6')]){utils[_0x4949('0x7')](_0xd83e3e[_0x4949('0x6')])[_0x4949('0x8')](function(_0x212cc8){if(_0x212cc8){_0xd83e3e[_0x4949('0x9')]=_0x212cc8['name'];_0xd83e3e[_0x4949('0xa')]=_0x212cc8['id'];}utils['request'](_0x4949('0xb'),_0xd83e3e);});}else{utils[_0x4949('0xc')](_0x4949('0xb'),_0xd83e3e);}if(_0x5e194b)delete transfers['blinds'][_0x5e194b];}exports[_0x4949('0xd')]=function(_0x4b1308){try{utils[_0x4949('0xe')](util['format'](_0x4949('0xf'),_0x4b1308[_0x4949('0x4')]),_0x4b1308);if(_0x4b1308['uniqueid']==_0x4b1308[_0x4949('0x10')]){utils[_0x4949('0x11')](util[_0x4949('0x3')](_0x4949('0x12'),_0x4b1308[_0x4949('0x4')],_0x4b1308['context'],_0x4b1308[_0x4949('0x13')]));recordings[_0x4b1308[_0x4949('0x4')]]={'uniqueid':_0x4b1308[_0x4949('0x4')],'accountcode':_0x4b1308[_0x4949('0x6')],'exten':_0x4b1308['exten'],'context':_0x4b1308['context'],'channel':_0x4b1308[_0x4949('0x14')],'monitors':[]};}}catch(_0x464790){utils[_0x4949('0x15')](util[_0x4949('0x3')](_0x4949('0xf'),_0x4b1308[_0x4949('0x4')]),_0x464790);}};exports[_0x4949('0x16')]=function(_0xe4f560){try{utils['debug'](util[_0x4949('0x3')](_0x4949('0x17'),_0xe4f560[_0x4949('0x4')]),_0xe4f560);if(!_[_0x4949('0x18')](recordings[_0xe4f560[_0x4949('0x4')]])&&_0xe4f560['channelstate']==0x6){utils[_0x4949('0x11')](util[_0x4949('0x3')](_0x4949('0x19'),_0xe4f560['uniqueid'],_0xe4f560[_0x4949('0x1a')],_0xe4f560['channel']));}else if(!_[_0x4949('0x18')](recordings[_0xe4f560[_0x4949('0x10')]])&&_0xe4f560[_0x4949('0x1b')]==0x6&&_0xe4f560[_0x4949('0x1a')]!=_0x4949('0x1c')){utils[_0x4949('0x11')](util[_0x4949('0x3')](_0x4949('0x1d'),_0xe4f560['uniqueid'],_0xe4f560[_0x4949('0x10')],_0xe4f560[_0x4949('0x1a')],_0xe4f560[_0x4949('0x14')]));recordings[_0xe4f560[_0x4949('0x10')]][_0x4949('0x6')]=_0xe4f560[_0x4949('0x6')];}}catch(_0x57c443){utils[_0x4949('0x15')](util['format'](_0x4949('0x17'),_0xe4f560[_0x4949('0x4')]),_0x57c443);}};exports[_0x4949('0x1e')]=function(_0x1a7d3e){try{if(!_['isNil'](_0x1a7d3e[_0x4949('0x1f')])&&!_['isNil'](_0x1a7d3e['variable'][_0x4949('0x20')])){utils[_0x4949('0xe')](util[_0x4949('0x3')]('[%s][recordings][varset]',_0x1a7d3e[_0x4949('0x4')]),_0x1a7d3e);utils[_0x4949('0x11')](util[_0x4949('0x3')](_0x4949('0x21'),_0x1a7d3e[_0x4949('0x4')],_0x1a7d3e[_0x4949('0x1f')],_0x1a7d3e[_0x4949('0x22')]));if(_['endsWith'](_0x1a7d3e['value'],_0x4949('0x23'))){_0x1a7d3e[_0x4949('0x22')]=_0x1a7d3e['value'][_0x4949('0x24')](_0x4949('0x23'),'.WAV');}if(recordings[_0x1a7d3e['linkedid']]){var _0x34d0f8=_[_0x4949('0x25')](recordings[_0x1a7d3e[_0x4949('0x10')]][_0x4949('0x26')],{'value':_0x1a7d3e['value']});if(_[_0x4949('0x18')](_0x34d0f8)){recordings[_0x1a7d3e[_0x4949('0x10')]][_0x4949('0x26')]['push']({'value':_0x1a7d3e['value']});}}}}catch(_0x54c792){utils[_0x4949('0x15')](util[_0x4949('0x3')](_0x4949('0x27'),_0x1a7d3e[_0x4949('0x4')]),_0x54c792);}};exports[_0x4949('0x28')]=function(_0x39a247){try{if(!_[_0x4949('0x18')](recordings[_0x39a247[_0x4949('0x4')]])){utils[_0x4949('0xe')](util[_0x4949('0x3')](_0x4949('0x29'),_0x39a247['uniqueid']),_0x39a247);utils['info'](util[_0x4949('0x3')](_0x4949('0x2a'),_0x39a247[_0x4949('0x4')],_0x39a247[_0x4949('0x2b')],_0x39a247[_0x4949('0x2c')],_0x39a247[_0x4949('0x2d')]));recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x2b')]=_0x39a247[_0x4949('0x2b')];recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x2c')]=_0x39a247['calleridname'];recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x2e')]=_0x39a247[_0x4949('0x2e')];recordings[_0x39a247[_0x4949('0x4')]]['connectedlinename']=_0x39a247['connectedlinename'];if(recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x2f')]==_0x4949('0x30')&&recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x6')]){recordings[_0x39a247[_0x4949('0x4')]]['connectedlinenum']=recordings[_0x39a247['uniqueid']][_0x4949('0x6')];recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x31')]='';}recordings[_0x39a247[_0x4949('0x4')]][_0x4949('0x26')][_0x4949('0x32')](function(_0x5385ff){var _0x472c8f=_[_0x4949('0x33')](recordings[_0x39a247[_0x4949('0x4')]]);_0x472c8f[_0x4949('0x22')]=_0x5385ff[_0x4949('0x22')];writeDB(_0x472c8f);});delete recordings[_0x39a247[_0x4949('0x4')]];}}catch(_0x2229f1){utils[_0x4949('0x15')](util['format'](_0x4949('0x29'),_0x39a247[_0x4949('0x4')]),_0x2229f1);}};exports[_0x4949('0x34')]=function(_0x59af4b){try{if(!_[_0x4949('0x18')](recordings[_0x59af4b[_0x4949('0x4')]])){utils['debug'](util[_0x4949('0x3')](_0x4949('0x35'),_0x59af4b['uniqueid']),_0x59af4b);utils['info'](util[_0x4949('0x3')](_0x4949('0x36'),_0x59af4b[_0x4949('0x4')],_0x59af4b['application'],_0x59af4b[_0x4949('0x37')]));if(_0x59af4b[_0x4949('0x38')][_0x4949('0x39')]()=='set'&&_[_0x4949('0x3a')](_0x59af4b[_0x4949('0x37')][_0x4949('0x39')](),'cdr')){var _0x148c41=_0x59af4b[_0x4949('0x37')][_0x4949('0x3b')]('=');var _0x5e4746=_0x148c41[0x0]['substring'](_0x148c41[0x0][_0x4949('0x3c')]('(')+0x1,_0x148c41[0x0]['lastIndexOf'](')'));var _0x4734ed=_0x148c41[0x1];recordings[_0x59af4b[_0x4949('0x4')]][_0x5e4746]=_0x4734ed;}}}catch(_0xd60f50){utils[_0x4949('0x15')](util['format'](_0x4949('0x35'),_0x59af4b[_0x4949('0x4')]),_0xd60f50);}};exports[_0x4949('0x3d')]=function(_0x45e043){try{if(!_[_0x4949('0x18')](recordings[_0x45e043[_0x4949('0x4')]])){utils[_0x4949('0xe')](util[_0x4949('0x3')]('[%s][recordings][queuecallerjoin]',_0x45e043[_0x4949('0x4')]),_0x45e043);utils[_0x4949('0x11')](util[_0x4949('0x3')](_0x4949('0x3e'),_0x45e043['uniqueid'],_0x45e043[_0x4949('0x3f')]));recordings[_0x45e043[_0x4949('0x4')]][_0x4949('0x3f')]=_0x45e043[_0x4949('0x3f')];}}catch(_0x547253){utils[_0x4949('0x15')](util[_0x4949('0x3')]('[%s][recordings][queuecallerjoin]',_0x45e043[_0x4949('0x4')]),_0x547253);}};exports[_0x4949('0x40')]=function(_0x194d35){try{utils[_0x4949('0xe')](util[_0x4949('0x3')](_0x4949('0x41'),_0x194d35[_0x4949('0x4')]),_0x194d35);utils['info'](util['format'](_0x4949('0x42'),_0x194d35[_0x4949('0x4')],_0x194d35[_0x4949('0x43')],_0x194d35['transferercalleridname'],_0x194d35[_0x4949('0x44')],_0x194d35['transfereecalleridname']));if(recordings[_0x194d35[_0x4949('0x45')]]&&transfers['blinds'][_0x194d35[_0x4949('0x45')]]){transfers['blinds'][_0x194d35[_0x4949('0x45')]]['recording']=!![];}}catch(_0x5f3a95){utils[_0x4949('0x15')](util['format'](_0x4949('0x41'),_0x194d35[_0x4949('0x4')]),_0x5f3a95);}}; \ No newline at end of file +var _0xff64=['varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','./utils','info','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','format','exten','context','channel','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','error','[%s][recordings][newstate]'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0xff64,0x6c));var _0x4ff6=function(_0x4dfa20,_0x35afb5){_0x4dfa20=_0x4dfa20-0x0;var _0x146afc=_0xff64[_0x4dfa20];return _0x146afc;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4ff6('0x0'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0xc6d2f){var _0x5192e0;utils[_0x4ff6('0x1')](util['format']('[%s][recordings][writeDB]',_0xc6d2f[_0x4ff6('0x2')]));if(transfers[_0x4ff6('0x3')][_0xc6d2f['uniqueid']]){_0x5192e0=_0xc6d2f[_0x4ff6('0x2')];_0xc6d2f['uniqueid']=transfers[_0x4ff6('0x3')][_0xc6d2f[_0x4ff6('0x2')]][_0x4ff6('0x4')];}if(_0xc6d2f[_0x4ff6('0x5')]){utils[_0x4ff6('0x6')](_0xc6d2f[_0x4ff6('0x5')])['then'](function(_0x59b13d){if(_0x59b13d){_0xc6d2f[_0x4ff6('0x7')]=_0x59b13d[_0x4ff6('0x8')];_0xc6d2f['UserId']=_0x59b13d['id'];}utils[_0x4ff6('0x9')](_0x4ff6('0xa'),_0xc6d2f);});}else{utils['request']('CreateVoiceRecording',_0xc6d2f);}if(_0x5192e0)delete transfers[_0x4ff6('0x3')][_0x5192e0];}exports[_0x4ff6('0xb')]=function(_0x269acd){try{utils[_0x4ff6('0xc')](util['format'](_0x4ff6('0xd'),_0x269acd[_0x4ff6('0x2')]),_0x269acd);if(_0x269acd[_0x4ff6('0x2')]==_0x269acd[_0x4ff6('0xe')]){utils[_0x4ff6('0x1')](util[_0x4ff6('0xf')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x269acd[_0x4ff6('0x2')],_0x269acd['context'],_0x269acd[_0x4ff6('0x10')]));recordings[_0x269acd[_0x4ff6('0x2')]]={'uniqueid':_0x269acd[_0x4ff6('0x2')],'accountcode':_0x269acd[_0x4ff6('0x5')],'exten':_0x269acd[_0x4ff6('0x10')],'context':_0x269acd[_0x4ff6('0x11')],'channel':_0x269acd[_0x4ff6('0x12')],'monitors':[]};}}catch(_0x142f96){utils['error'](util['format'](_0x4ff6('0xd'),_0x269acd[_0x4ff6('0x2')]),_0x142f96);}};exports[_0x4ff6('0x13')]=function(_0x359386){try{utils[_0x4ff6('0xc')](util['format']('[%s][recordings][newstate]',_0x359386[_0x4ff6('0x2')]),_0x359386);if(!_[_0x4ff6('0x14')](recordings[_0x359386[_0x4ff6('0x2')]])&&_0x359386[_0x4ff6('0x15')]==0x6){utils['info'](util[_0x4ff6('0xf')](_0x4ff6('0x16'),_0x359386[_0x4ff6('0x2')],_0x359386[_0x4ff6('0x11')],_0x359386[_0x4ff6('0x12')]));}else if(!_[_0x4ff6('0x14')](recordings[_0x359386[_0x4ff6('0xe')]])&&_0x359386[_0x4ff6('0x15')]==0x6&&_0x359386[_0x4ff6('0x11')]!=_0x4ff6('0x17')){utils[_0x4ff6('0x1')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x359386[_0x4ff6('0x2')],_0x359386['linkedid'],_0x359386[_0x4ff6('0x11')],_0x359386['channel']));recordings[_0x359386[_0x4ff6('0xe')]][_0x4ff6('0x5')]=_0x359386[_0x4ff6('0x5')];}}catch(_0x1f715e){utils[_0x4ff6('0x18')](util[_0x4ff6('0xf')](_0x4ff6('0x19'),_0x359386['uniqueid']),_0x1f715e);}};exports[_0x4ff6('0x1a')]=function(_0x12f86a){try{if(!_[_0x4ff6('0x14')](_0x12f86a[_0x4ff6('0x1b')])&&!_[_0x4ff6('0x14')](_0x12f86a[_0x4ff6('0x1b')][_0x4ff6('0x1c')])){utils[_0x4ff6('0xc')](util[_0x4ff6('0xf')]('[%s][recordings][varset]',_0x12f86a[_0x4ff6('0x2')]),_0x12f86a);utils[_0x4ff6('0x1')](util[_0x4ff6('0xf')](_0x4ff6('0x1d'),_0x12f86a[_0x4ff6('0x2')],_0x12f86a[_0x4ff6('0x1b')],_0x12f86a[_0x4ff6('0x1e')]));if(_[_0x4ff6('0x1f')](_0x12f86a[_0x4ff6('0x1e')],_0x4ff6('0x20'))){_0x12f86a[_0x4ff6('0x1e')]=_0x12f86a['value'][_0x4ff6('0x21')](_0x4ff6('0x20'),_0x4ff6('0x22'));}if(recordings[_0x12f86a[_0x4ff6('0xe')]]){var _0x536514=_[_0x4ff6('0x23')](recordings[_0x12f86a[_0x4ff6('0xe')]]['monitors'],{'value':_0x12f86a['value']});if(_[_0x4ff6('0x14')](_0x536514)){recordings[_0x12f86a[_0x4ff6('0xe')]][_0x4ff6('0x24')][_0x4ff6('0x25')]({'value':_0x12f86a['value']});}}}}catch(_0x140446){utils[_0x4ff6('0x18')](util[_0x4ff6('0xf')](_0x4ff6('0x26'),_0x12f86a['uniqueid']),_0x140446);}};exports[_0x4ff6('0x27')]=function(_0x33b3b2){try{if(!_[_0x4ff6('0x14')](recordings[_0x33b3b2[_0x4ff6('0x2')]])){utils[_0x4ff6('0xc')](util[_0x4ff6('0xf')](_0x4ff6('0x28'),_0x33b3b2[_0x4ff6('0x2')]),_0x33b3b2);utils[_0x4ff6('0x1')](util['format'](_0x4ff6('0x29'),_0x33b3b2['uniqueid'],_0x33b3b2[_0x4ff6('0x2a')],_0x33b3b2[_0x4ff6('0x2b')],_0x33b3b2[_0x4ff6('0x2c')]));recordings[_0x33b3b2['uniqueid']][_0x4ff6('0x2a')]=_0x33b3b2[_0x4ff6('0x2a')];recordings[_0x33b3b2[_0x4ff6('0x2')]][_0x4ff6('0x2b')]=_0x33b3b2[_0x4ff6('0x2b')];recordings[_0x33b3b2[_0x4ff6('0x2')]][_0x4ff6('0x2d')]=_0x33b3b2['connectedlinenum'];recordings[_0x33b3b2[_0x4ff6('0x2')]]['connectedlinename']=_0x33b3b2[_0x4ff6('0x2e')];if(recordings[_0x33b3b2['uniqueid']][_0x4ff6('0x2f')]==_0x4ff6('0x30')&&recordings[_0x33b3b2[_0x4ff6('0x2')]][_0x4ff6('0x5')]){recordings[_0x33b3b2[_0x4ff6('0x2')]][_0x4ff6('0x2d')]=recordings[_0x33b3b2[_0x4ff6('0x2')]]['accountcode'];recordings[_0x33b3b2[_0x4ff6('0x2')]]['connectedlinename']='';}recordings[_0x33b3b2['uniqueid']][_0x4ff6('0x24')]['forEach'](function(_0x339379){var _0x55de71=_[_0x4ff6('0x31')](recordings[_0x33b3b2[_0x4ff6('0x2')]]);_0x55de71[_0x4ff6('0x1e')]=_0x339379[_0x4ff6('0x1e')];writeDB(_0x55de71);});delete recordings[_0x33b3b2[_0x4ff6('0x2')]];}}catch(_0xfa2265){utils[_0x4ff6('0x18')](util[_0x4ff6('0xf')](_0x4ff6('0x28'),_0x33b3b2[_0x4ff6('0x2')]),_0xfa2265);}};exports[_0x4ff6('0x32')]=function(_0xc9725d){try{if(!_[_0x4ff6('0x14')](recordings[_0xc9725d[_0x4ff6('0x2')]])){utils[_0x4ff6('0xc')](util[_0x4ff6('0xf')](_0x4ff6('0x33'),_0xc9725d['uniqueid']),_0xc9725d);utils['info'](util['format'](_0x4ff6('0x34'),_0xc9725d[_0x4ff6('0x2')],_0xc9725d[_0x4ff6('0x35')],_0xc9725d[_0x4ff6('0x36')]));if(_0xc9725d['application']['toLowerCase']()=='set'&&_[_0x4ff6('0x37')](_0xc9725d[_0x4ff6('0x36')]['toLowerCase'](),'cdr')){var _0x4e2aff=_0xc9725d[_0x4ff6('0x36')]['split']('=');var _0x23e632=_0x4e2aff[0x0]['substring'](_0x4e2aff[0x0][_0x4ff6('0x38')]('(')+0x1,_0x4e2aff[0x0]['lastIndexOf'](')'));var _0x5a5add=_0x4e2aff[0x1];recordings[_0xc9725d[_0x4ff6('0x2')]][_0x23e632]=_0x5a5add;}}}catch(_0x471eb0){utils['error'](util[_0x4ff6('0xf')]('[%s][recordings][newexten]',_0xc9725d['uniqueid']),_0x471eb0);}};exports[_0x4ff6('0x39')]=function(_0x13fb2b){try{if(!_[_0x4ff6('0x14')](recordings[_0x13fb2b['uniqueid']])){utils['debug'](util[_0x4ff6('0xf')](_0x4ff6('0x3a'),_0x13fb2b[_0x4ff6('0x2')]),_0x13fb2b);utils[_0x4ff6('0x1')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x13fb2b[_0x4ff6('0x2')],_0x13fb2b[_0x4ff6('0x3b')]));recordings[_0x13fb2b[_0x4ff6('0x2')]][_0x4ff6('0x3b')]=_0x13fb2b[_0x4ff6('0x3b')];}}catch(_0x4351e2){utils[_0x4ff6('0x18')](util[_0x4ff6('0xf')](_0x4ff6('0x3a'),_0x13fb2b[_0x4ff6('0x2')]),_0x4351e2);}};exports[_0x4ff6('0x3c')]=function(_0x30e65c){try{utils['debug'](util[_0x4ff6('0xf')](_0x4ff6('0x3d'),_0x30e65c[_0x4ff6('0x2')]),_0x30e65c);utils[_0x4ff6('0x1')](util[_0x4ff6('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x30e65c['uniqueid'],_0x30e65c[_0x4ff6('0x3e')],_0x30e65c[_0x4ff6('0x3f')],_0x30e65c[_0x4ff6('0x40')],_0x30e65c['transfereecalleridname']));if(recordings[_0x30e65c[_0x4ff6('0x41')]]&&transfers['blinds'][_0x30e65c['transfereruniqueid']]){transfers[_0x4ff6('0x3')][_0x30e65c[_0x4ff6('0x41')]][_0x4ff6('0x42')]=!![];}}catch(_0x597049){utils[_0x4ff6('0x18')](util[_0x4ff6('0xf')](_0x4ff6('0x3d'),_0x30e65c['uniqueid']),_0x597049);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a2dcc07..fc463bd 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 _0xda48=['request','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','info','format','type','attended','origtransfereruniqueid','uniqueid'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xda48,0x10a));var _0x8da4=function(_0x370621,_0x13a81d){_0x370621=_0x370621-0x0;var _0x479e21=_0xda48[_0x370621];return _0x479e21;};'use strict';var _=require(_0x8da4('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x453bbf){utils[_0x8da4('0x1')](util[_0x8da4('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x453bbf[_0x8da4('0x3')]===_0x8da4('0x4')?_0x453bbf[_0x8da4('0x5')]:_0x453bbf[_0x8da4('0x6')],_0x453bbf[_0x8da4('0x3')]));utils[_0x8da4('0x7')]('CreateVoiceTransferReport',_0x453bbf);}exports['blinds']={};exports[_0x8da4('0x8')]=function(_0x556fcb){try{utils['debug'](util[_0x8da4('0x2')](_0x8da4('0x9'),_0x556fcb[_0x8da4('0x6')]),_0x556fcb);utils['info'](util[_0x8da4('0x2')](_0x8da4('0xa'),_0x556fcb[_0x8da4('0x6')],_0x556fcb[_0x8da4('0xb')],_0x556fcb['transferercalleridname'],_0x556fcb[_0x8da4('0xc')],_0x556fcb[_0x8da4('0xd')]));_0x556fcb[_0x8da4('0x3')]=_0x8da4('0xe');exports[_0x8da4('0xf')][_0x556fcb[_0x8da4('0x10')]]=_0x556fcb;writeDB(_0x556fcb);}catch(_0x43226e){utils['error'](util['format'](_0x8da4('0x9'),_0x556fcb[_0x8da4('0x6')]),_0x43226e);}};exports[_0x8da4('0x11')]=function(_0x21ab56){try{utils['debug'](util['format'](_0x8da4('0x12'),_0x21ab56[_0x8da4('0x5')]),_0x21ab56);utils['info'](util[_0x8da4('0x2')](_0x8da4('0x13'),_0x21ab56['origtransfereruniqueid'],_0x21ab56[_0x8da4('0x14')],_0x21ab56['origtransferercalleridname'],_0x21ab56[_0x8da4('0x15')],_0x21ab56[_0x8da4('0x16')]));_0x21ab56=_[_0x8da4('0x17')](_0x21ab56,{'transfererchannel':_0x21ab56[_0x8da4('0x18')],'transferercalleridnum':_0x21ab56[_0x8da4('0x14')],'transferercalleridname':_0x21ab56['origtransferercalleridname'],'transfererconnectedlinenum':_0x21ab56[_0x8da4('0x19')],'transfererconnectedlinename':_0x21ab56[_0x8da4('0x1a')],'transfereraccountcode':_0x21ab56['origtransfereraccountcode'],'transferercontext':_0x21ab56['secondtransferercontext'],'transfererexten':_0x21ab56[_0x8da4('0x1b')],'transfererlinkedid':_0x21ab56[_0x8da4('0x1c')],'context':_0x21ab56[_0x8da4('0x1d')],'extension':_0x21ab56[_0x8da4('0x1e')],'type':_0x8da4('0x4')});if(_['isNil'](_0x21ab56[_0x8da4('0x1f')])){_0x21ab56=_[_0x8da4('0x17')](_0x21ab56,{'transfereechannel':_0x21ab56['transfertargetchannel'],'transfereecalleridnum':_0x21ab56[_0x8da4('0x15')],'transfereecalleridname':_0x21ab56['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x21ab56[_0x8da4('0x20')],'transfereeconnectedlinename':_0x21ab56[_0x8da4('0x21')],'transfereeaccountcode':_0x21ab56[_0x8da4('0x22')],'transfereecontext':_0x21ab56[_0x8da4('0x23')],'transfereeexten':_0x21ab56[_0x8da4('0x24')],'transfereelinkedid':_0x21ab56[_0x8da4('0x25')]});}writeDB(_0x21ab56);}catch(_0x29acce){utils[_0x8da4('0x26')](util[_0x8da4('0x2')](_0x8da4('0x12'),_0x21ab56[_0x8da4('0x5')]),_0x29acce);}}; \ No newline at end of file +var _0x2b83=['assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x2b83,0x114));var _0x32b8=function(_0x3a4ddb,_0x352123){_0x3a4ddb=_0x3a4ddb-0x0;var _0x5db519=_0x2b83[_0x3a4ddb];return _0x5db519;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x32b8('0x0'));function writeDB(_0x340c03){utils[_0x32b8('0x1')](util[_0x32b8('0x2')](_0x32b8('0x3'),_0x340c03[_0x32b8('0x4')]==='attended'?_0x340c03[_0x32b8('0x5')]:_0x340c03[_0x32b8('0x6')],_0x340c03[_0x32b8('0x4')]));utils[_0x32b8('0x7')](_0x32b8('0x8'),_0x340c03);}exports[_0x32b8('0x9')]={};exports[_0x32b8('0xa')]=function(_0x1edac5){try{utils[_0x32b8('0xb')](util[_0x32b8('0x2')](_0x32b8('0xc'),_0x1edac5[_0x32b8('0x6')]),_0x1edac5);utils[_0x32b8('0x1')](util[_0x32b8('0x2')](_0x32b8('0xd'),_0x1edac5['uniqueid'],_0x1edac5[_0x32b8('0xe')],_0x1edac5['transferercalleridname'],_0x1edac5[_0x32b8('0xf')],_0x1edac5[_0x32b8('0x10')]));_0x1edac5[_0x32b8('0x4')]=_0x32b8('0x11');exports[_0x32b8('0x9')][_0x1edac5[_0x32b8('0x12')]]=_0x1edac5;writeDB(_0x1edac5);}catch(_0xff00ca){utils[_0x32b8('0x13')](util[_0x32b8('0x2')](_0x32b8('0xc'),_0x1edac5['uniqueid']),_0xff00ca);}};exports[_0x32b8('0x14')]=function(_0x6e1a81){try{utils[_0x32b8('0xb')](util['format']('[%s][transfers][attendedtransfer]',_0x6e1a81[_0x32b8('0x5')]),_0x6e1a81);utils[_0x32b8('0x1')](util[_0x32b8('0x2')](_0x32b8('0x15'),_0x6e1a81[_0x32b8('0x5')],_0x6e1a81['origtransferercalleridnum'],_0x6e1a81[_0x32b8('0x16')],_0x6e1a81[_0x32b8('0x17')],_0x6e1a81[_0x32b8('0x18')]));_0x6e1a81=_[_0x32b8('0x19')](_0x6e1a81,{'transfererchannel':_0x6e1a81[_0x32b8('0x1a')],'transferercalleridnum':_0x6e1a81['origtransferercalleridnum'],'transferercalleridname':_0x6e1a81['origtransferercalleridname'],'transfererconnectedlinenum':_0x6e1a81[_0x32b8('0x1b')],'transfererconnectedlinename':_0x6e1a81[_0x32b8('0x1c')],'transfereraccountcode':_0x6e1a81[_0x32b8('0x1d')],'transferercontext':_0x6e1a81[_0x32b8('0x1e')],'transfererexten':_0x6e1a81['secondtransfererexten'],'transfererlinkedid':_0x6e1a81[_0x32b8('0x1f')],'context':_0x6e1a81[_0x32b8('0x20')],'extension':_0x6e1a81[_0x32b8('0x21')],'type':'attended'});if(_['isNil'](_0x6e1a81[_0x32b8('0x22')])){_0x6e1a81=_[_0x32b8('0x19')](_0x6e1a81,{'transfereechannel':_0x6e1a81[_0x32b8('0x23')],'transfereecalleridnum':_0x6e1a81[_0x32b8('0x17')],'transfereecalleridname':_0x6e1a81[_0x32b8('0x18')],'transfereeconnectedlinenum':_0x6e1a81[_0x32b8('0x24')],'transfereeconnectedlinename':_0x6e1a81[_0x32b8('0x25')],'transfereeaccountcode':_0x6e1a81[_0x32b8('0x26')],'transfereecontext':_0x6e1a81[_0x32b8('0x27')],'transfereeexten':_0x6e1a81[_0x32b8('0x28')],'transfereelinkedid':_0x6e1a81[_0x32b8('0x29')]});}writeDB(_0x6e1a81);}catch(_0x26eb48){utils[_0x32b8('0x13')](util[_0x32b8('0x2')](_0x32b8('0x2a'),_0x6e1a81[_0x32b8('0x5')]),_0x26eb48);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8d167dd..3e7e37e 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 _0xcce9=['catch','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','format','YYYY-MM-DD\x20HH:mm:ss','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request'];(function(_0x436926,_0x255e13){var _0x85ba6a=function(_0x209e67){while(--_0x209e67){_0x436926['push'](_0x436926['shift']());}};_0x85ba6a(++_0x255e13);}(_0xcce9,0xd4));var _0x9cce=function(_0x4e493b,_0x38ae51){_0x4e493b=_0x4e493b-0x0;var _0x1ec2aa=_0xcce9[_0x4e493b];return _0x1ec2aa;};'use strict';var BPromise=require(_0x9cce('0x0'));var jayson=require(_0x9cce('0x1'));var moment=require(_0x9cce('0x2'));var util=require(_0x9cce('0x3'));var client=jayson[_0x9cce('0x4')][_0x9cce('0x5')]({'port':0x2329});var logger=require(_0x9cce('0x6'))(_0x9cce('0x7'));exports['info']=function(_0x143f3a,_0x115cd4){logger[_0x9cce('0x8')](_0x143f3a,_0x115cd4?util['inspect'](_0x115cd4,{'showHidden':![],'depth':null}):'');};exports[_0x9cce('0x9')]=function(_0x3c527a,_0x127c42){logger['debug'](_0x3c527a,_0x127c42?util[_0x9cce('0xa')](_0x127c42,{'showHidden':![],'depth':null}):'');};exports[_0x9cce('0xb')]=function(_0x91f3da,_0x2bf9fc){logger[_0x9cce('0xb')](_0x91f3da,_0x2bf9fc?util[_0x9cce('0xa')](_0x2bf9fc,{'showHidden':![],'depth':null}):'');};exports[_0x9cce('0xc')]=function(_0x375010,_0x3e4ce6){return client[_0x9cce('0xc')](_0x375010,{'body':_0x3e4ce6})['then'](function(_0x951e45){logger[_0x9cce('0x9')]('[utils][request]\x20name:%s',_0x375010,_0x951e45?util[_0x9cce('0xa')](_0x951e45,{'showHidden':![],'depth':null}):'');})[_0x9cce('0xd')](function(_0x45eff6){logger[_0x9cce('0xb')]('[utils][request]\x20name:%s',_0x375010,_0x45eff6?util[_0x9cce('0xa')](_0x45eff6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x43cd56){return client[_0x9cce('0xc')](_0x9cce('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9cce('0xf'),_0x9cce('0x10'),_0x9cce('0x11')],'where':_0x43cd56,'limit':0x1}})[_0x9cce('0x12')](function(_0x1b28ca){logger[_0x9cce('0x9')](_0x9cce('0x13'),JSON[_0x9cce('0x14')](_0x43cd56),_0x1b28ca?util[_0x9cce('0xa')](_0x1b28ca,{'showHidden':![],'depth':null}):'');return _0x1b28ca[_0x9cce('0x15')][_0x9cce('0x16')]?_0x1b28ca['result'][0x0]:null;});}exports[_0x9cce('0x17')]=function(_0x2d0df2){return new BPromise(function(_0x5cd0a3,_0x15afc6){if(_0x2d0df2){return getUser({'internal':_0x2d0df2})[_0x9cce('0x12')](function(_0x14a792){logger[_0x9cce('0x8')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2d0df2,_0x14a792?_0x9cce('0x18'):_0x9cce('0x19'));return _0x5cd0a3(_0x14a792);})['catch'](function(_0x35d25d){logger[_0x9cce('0xb')]('[utils][getUserByInternal]',_0x35d25d?util['inspect'](_0x35d25d,{'showHidden':![],'depth':null}):'');return _0x5cd0a3(null);});}return _0x5cd0a3(null);});};exports[_0x9cce('0x1a')]=function(_0x4cf8a){return new BPromise(function(_0x3148c7,_0x10c403){if(_0x4cf8a){return getUser({'interface':_0x4cf8a})[_0x9cce('0x12')](function(_0x35fc7c){logger[_0x9cce('0x8')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4cf8a,_0x35fc7c?_0x9cce('0x18'):'notfound');return _0x3148c7(_0x35fc7c);})['catch'](function(_0x4bd606){logger['error'](_0x9cce('0x1b'),_0x4bd606?util[_0x9cce('0xa')](_0x4bd606,{'showHidden':![],'depth':null}):'');return _0x3148c7(null);});}return _0x3148c7(null);});};exports[_0x9cce('0x1c')]=function(_0x2de40d){return new BPromise(function(_0x299058,_0x550071){if(_0x2de40d){return getUser({'name':_0x2de40d})[_0x9cce('0x12')](function(_0x53d0ec){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x2de40d,_0x53d0ec?_0x9cce('0x18'):'notfound');return _0x299058(_0x53d0ec);})[_0x9cce('0xd')](function(_0x4d0925){logger[_0x9cce('0xb')](_0x9cce('0x1d'),_0x4d0925?util[_0x9cce('0xa')](_0x4d0925,{'showHidden':![],'depth':null}):'');return _0x299058(null);});}return _0x299058(null);});};exports[_0x9cce('0x1e')]=function(_0x4c90cf){return new BPromise(function(_0x26c5eb,_0x177d54){if(_0x4c90cf){return client[_0x9cce('0xc')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x9cce('0x10'),_0x9cce('0x1f'),_0x9cce('0x20'),_0x9cce('0x21')],'where':{'name':_0x4c90cf},'limit':0x1}})[_0x9cce('0x12')](function(_0x7417d7){logger[_0x9cce('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x4c90cf,_0x7417d7?util[_0x9cce('0xa')](_0x7417d7,{'showHidden':![],'depth':null}):'');logger[_0x9cce('0x8')](_0x9cce('0x22'),_0x4c90cf,_0x7417d7?_0x9cce('0x18'):_0x9cce('0x19'));return _0x26c5eb(_0x7417d7[_0x9cce('0x15')][_0x9cce('0x16')]?_0x7417d7[_0x9cce('0x15')][0x0]:null);})['catch'](function(_0x2325c6){logger['error']('[utils][getVoiceQueueByName]',_0x2325c6?util['inspect'](_0x2325c6,{'showHidden':![],'depth':null}):'');return _0x26c5eb(null);});}return _0x26c5eb(null);});};exports[_0x9cce('0x23')]=function(_0x14959a,_0x5448fd){return moment(_0x14959a)['add'](_0x5448fd,'seconds')[_0x9cce('0x24')](_0x9cce('0x25'));};exports['subtractTime']=function(_0x30fc32,_0xdce82e){return moment(_0x30fc32)['subtract'](_0xdce82e,_0x9cce('0x26'))[_0x9cce('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9cce('0x27')]=function(_0x19c95c,_0x3095c4){return moment(_0x19c95c)[_0x9cce('0x28')](moment(_0x3095c4),'seconds');};exports[_0x9cce('0x29')]=function(_0x4543ba,_0x93eacc){return parseInt(_0x4543ba,0xa)+parseInt(_0x93eacc,0xa);};exports[_0x9cce('0x2a')]=function(){return moment()[_0x9cce('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x4d9e6b,_0x3a0030){if(_0x3a0030){return moment(_0x4d9e6b)[_0x9cce('0x2b')](_0x3a0030);}return!![];};exports['isBefore']=function(_0x5ef1d7,_0x3688b4){if(_0x3688b4){return moment(_0x5ef1d7)[_0x9cce('0x2c')](_0x3688b4);}else if(_0x5ef1d7){return!![];}return![];}; \ No newline at end of file +var _0xe636=['[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout'];(function(_0x4dcf1b,_0x20ff8e){var _0x1a4ce4=function(_0x2fbf33){while(--_0x2fbf33){_0x4dcf1b['push'](_0x4dcf1b['shift']());}};_0x1a4ce4(++_0x20ff8e);}(_0xe636,0x16d));var _0x6e63=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xe636[_0x1ac120];return _0x19b703;};'use strict';var BPromise=require(_0x6e63('0x0'));var jayson=require(_0x6e63('0x1'));var moment=require('moment');var util=require(_0x6e63('0x2'));var client=jayson[_0x6e63('0x3')][_0x6e63('0x4')]({'port':0x2329});var logger=require(_0x6e63('0x5'))(_0x6e63('0x6'));exports['info']=function(_0x4a8aab,_0x51deea){logger[_0x6e63('0x7')](_0x4a8aab,_0x51deea?util[_0x6e63('0x8')](_0x51deea,{'showHidden':![],'depth':null}):'');};exports[_0x6e63('0x9')]=function(_0x677089,_0x33c842){logger[_0x6e63('0x9')](_0x677089,_0x33c842?util[_0x6e63('0x8')](_0x33c842,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x23d117,_0x50f955){logger[_0x6e63('0xa')](_0x23d117,_0x50f955?util[_0x6e63('0x8')](_0x50f955,{'showHidden':![],'depth':null}):'');};exports[_0x6e63('0xb')]=function(_0x23ac48,_0x28aaa4){return client[_0x6e63('0xb')](_0x23ac48,{'body':_0x28aaa4})[_0x6e63('0xc')](function(_0x269a41){logger[_0x6e63('0x9')](_0x6e63('0xd'),_0x23ac48,_0x269a41?util['inspect'](_0x269a41,{'showHidden':![],'depth':null}):'');})[_0x6e63('0xe')](function(_0x20f77a){logger['error']('[utils][request]\x20name:%s',_0x23ac48,_0x20f77a?util['inspect'](_0x20f77a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x34b318){return client['request'](_0x6e63('0xf'),{'options':{'raw':!![],'attributes':['id',_0x6e63('0x10'),_0x6e63('0x11'),_0x6e63('0x12')],'where':_0x34b318,'limit':0x1}})['then'](function(_0x159f86){logger[_0x6e63('0x9')](_0x6e63('0x13'),JSON['stringify'](_0x34b318),_0x159f86?util[_0x6e63('0x8')](_0x159f86,{'showHidden':![],'depth':null}):'');return _0x159f86[_0x6e63('0x14')]['length']?_0x159f86[_0x6e63('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0x342ed8){return new BPromise(function(_0x260fff,_0x3b0aab){if(_0x342ed8){return getUser({'internal':_0x342ed8})[_0x6e63('0xc')](function(_0x334e43){logger[_0x6e63('0x7')](_0x6e63('0x15'),_0x342ed8,_0x334e43?_0x6e63('0x16'):_0x6e63('0x17'));return _0x260fff(_0x334e43);})[_0x6e63('0xe')](function(_0x5fb10){logger[_0x6e63('0xa')]('[utils][getUserByInternal]',_0x5fb10?util[_0x6e63('0x8')](_0x5fb10,{'showHidden':![],'depth':null}):'');return _0x260fff(null);});}return _0x260fff(null);});};exports['getUserByInterface']=function(_0x3da57a){return new BPromise(function(_0x42f21e,_0x12449f){if(_0x3da57a){return getUser({'interface':_0x3da57a})['then'](function(_0x1bd3af){logger[_0x6e63('0x7')](_0x6e63('0x18'),_0x3da57a,_0x1bd3af?_0x6e63('0x16'):_0x6e63('0x17'));return _0x42f21e(_0x1bd3af);})[_0x6e63('0xe')](function(_0x30ce17){logger[_0x6e63('0xa')](_0x6e63('0x19'),_0x30ce17?util[_0x6e63('0x8')](_0x30ce17,{'showHidden':![],'depth':null}):'');return _0x42f21e(null);});}return _0x42f21e(null);});};exports[_0x6e63('0x1a')]=function(_0x250a1a){return new BPromise(function(_0x40f33d,_0x52f259){if(_0x250a1a){return getUser({'name':_0x250a1a})[_0x6e63('0xc')](function(_0xa20c05){logger[_0x6e63('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x250a1a,_0xa20c05?'found':_0x6e63('0x17'));return _0x40f33d(_0xa20c05);})['catch'](function(_0xd12e35){logger[_0x6e63('0xa')](_0x6e63('0x1b'),_0xd12e35?util[_0x6e63('0x8')](_0xd12e35,{'showHidden':![],'depth':null}):'');return _0x40f33d(null);});}return _0x40f33d(null);});};exports[_0x6e63('0x1c')]=function(_0x385622){return new BPromise(function(_0x1e2e55,_0x51dea4){if(_0x385622){return client[_0x6e63('0xb')](_0x6e63('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x6e63('0x11'),'type','acw',_0x6e63('0x1e')],'where':{'name':_0x385622},'limit':0x1}})[_0x6e63('0xc')](function(_0x5bd06a){logger[_0x6e63('0x9')](_0x6e63('0x1f'),_0x385622,_0x5bd06a?util['inspect'](_0x5bd06a,{'showHidden':![],'depth':null}):'');logger['info'](_0x6e63('0x20'),_0x385622,_0x5bd06a?_0x6e63('0x16'):'notfound');return _0x1e2e55(_0x5bd06a[_0x6e63('0x14')][_0x6e63('0x21')]?_0x5bd06a[_0x6e63('0x14')][0x0]:null);})[_0x6e63('0xe')](function(_0x5a29a1){logger[_0x6e63('0xa')]('[utils][getVoiceQueueByName]',_0x5a29a1?util[_0x6e63('0x8')](_0x5a29a1,{'showHidden':![],'depth':null}):'');return _0x1e2e55(null);});}return _0x1e2e55(null);});};exports[_0x6e63('0x22')]=function(_0x50aea8,_0x222a88){return moment(_0x50aea8)[_0x6e63('0x23')](_0x222a88,_0x6e63('0x24'))[_0x6e63('0x25')](_0x6e63('0x26'));};exports['subtractTime']=function(_0x31c229,_0x113c39){return moment(_0x31c229)[_0x6e63('0x27')](_0x113c39,'seconds')[_0x6e63('0x25')](_0x6e63('0x26'));};exports[_0x6e63('0x28')]=function(_0x502b5b,_0x41cafe){return moment(_0x502b5b)['diff'](moment(_0x41cafe),_0x6e63('0x24'));};exports[_0x6e63('0x29')]=function(_0x320c39,_0x44975c){return parseInt(_0x320c39,0xa)+parseInt(_0x44975c,0xa);};exports['now']=function(){return moment()[_0x6e63('0x25')](_0x6e63('0x26'));};exports[_0x6e63('0x2a')]=function(_0x1dd9a2,_0xe52219){if(_0xe52219){return moment(_0x1dd9a2)[_0x6e63('0x2a')](_0xe52219);}return!![];};exports['isBefore']=function(_0x546dda,_0x205519){if(_0x205519){return moment(_0x546dda)[_0x6e63('0x2b')](_0x205519);}else if(_0x546dda){return!![];}return![];}; \ No newline at end of file